[ossim] 01/01: New upstream version 2.0.0

Bas Couwenberg sebastic at debian.org
Thu Aug 24 17:18:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch upstream
in repository ossim.

commit b93477ca333df23bda1ee03bef6e91cd5b908788
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Tue Jul 25 12:20:38 2017 +0200

    New upstream version 2.0.0
---
 .gitignore                                         |   10 +
 CMakeLists.txt                                     |  278 +
 LICENSE.txt                                        |   22 +
 README.md                                          |  154 +
 apps/CMakeLists.txt                                |   22 +
 apps/curl_apps/CMakeLists.txt                      |   73 +
 apps/curl_apps/omar-data-mgr.cpp                   |   77 +
 apps/curl_apps/omarDataMgrUtil.cpp                 | 1013 +++
 apps/curl_apps/omarDataMgrUtil.h                   |  280 +
 .../apps => apps}/ossim-adrg-dump/CMakeLists.txt   |    0
 .../ossim-adrg-dump/ossim-adrg-dump.cpp            |    0
 .../ossim-applanix2ogeom/CMakeLists.txt            |    0
 apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp |  322 +
 .../src/apps => apps}/ossim-autreg/CMakeLists.txt  |    0
 apps/ossim-autreg/ossim-autreg.cpp                 |   96 +
 .../apps => apps}/ossim-band-merge/CMakeLists.txt  |    0
 apps/ossim-band-merge/ossim-band-merge.cpp         |  326 +
 {ossim/src/apps => apps}/ossim-btoa/CMakeLists.txt |    0
 {ossim/src/apps => apps}/ossim-btoa/ossim-btoa.cpp |    0
 .../apps => apps}/ossim-chgkwval/CMakeLists.txt    |    0
 .../ossim-chgkwval/ossim-chgkwval.cpp              |    0
 .../src/apps => apps}/ossim-chipper/CMakeLists.txt |    0
 apps/ossim-chipper/ossim-chipper.cpp               |   94 +
 apps/ossim-cli/CMakeLists.txt                      |    2 +
 apps/ossim-cli/ossim-cli.cpp                       |  167 +
 {ossim/src/apps => apps}/ossim-cmm/CMakeLists.txt  |    0
 {ossim/src/apps => apps}/ossim-cmm/ossim-cmm.cpp   |    0
 .../ossim-computeSrtmStats/CMakeLists.txt          |    0
 .../ossim-computeSrtmStats.cpp                     |  108 +
 {ossim/src/apps => apps}/ossim-config.in           |    0
 .../src/apps => apps}/ossim-correl/CMakeLists.txt  |    0
 .../apps => apps}/ossim-correl/ossim-correl.cpp    |    0
 .../ossim-create-bitmask/CMakeLists.txt            |    0
 .../ossim-create-bitmask/ossim-create-bitmask.cpp  |    0
 .../apps => apps}/ossim-create-cg/CMakeLists.txt   |    0
 apps/ossim-create-cg/ossim-create-cg.cpp           |  143 +
 .../ossim-create-histo/CMakeLists.txt              |    0
 apps/ossim-create-histo/ossim-create-histo.cpp     |  301 +
 .../src/apps => apps}/ossim-deg2dms/CMakeLists.txt |    0
 apps/ossim-deg2dms/ossim-deg2dms.cpp               |  112 +
 .../src/apps => apps}/ossim-dms2deg/CMakeLists.txt |    0
 apps/ossim-dms2deg/ossim-dms2deg.cpp               |  166 +
 .../apps => apps}/ossim-dump-ocg/CMakeLists.txt    |    0
 .../ossim-dump-ocg/ossim-dump-ocg.cpp              |    0
 .../apps => apps}/ossim-equation/CMakeLists.txt    |    0
 .../ossim-equation/ossim-equation.cpp              |    0
 .../ossim-extract-vertices/CMakeLists.txt          |    0
 .../ossim-extract-vertices.cpp                     |    0
 {ossim/src/apps => apps}/ossim-icp/CMakeLists.txt  |    0
 apps/ossim-icp/ossim-icp.cpp                       |  747 ++
 {ossim/src/apps => apps}/ossim-igen/CMakeLists.txt |    0
 {ossim/src/apps => apps}/ossim-igen/ossim-igen.cpp |    0
 .../ossim-image-compare/CMakeLists.txt             |    0
 apps/ossim-image-compare/ossim-image-compare.cpp   |  158 +
 .../apps => apps}/ossim-image-synth/CMakeLists.txt |    0
 apps/ossim-image-synth/ossim-image-synth.cpp       |  125 +
 .../src/apps => apps}/ossim-img2md/CMakeLists.txt  |    0
 apps/ossim-img2md/ossim-img2md.cpp                 |  159 +
 .../src/apps => apps}/ossim-img2rr/CMakeLists.txt  |    0
 .../apps => apps}/ossim-img2rr/ossim-img2rr.cpp    |    0
 {ossim/src/apps => apps}/ossim-info/CMakeLists.txt |    0
 apps/ossim-info/ossim-info.cpp                     |   70 +
 .../src/apps => apps}/ossim-modopt/CMakeLists.txt  |    0
 .../apps => apps}/ossim-modopt/ossim-modopt.cpp    |    0
 .../src/apps => apps}/ossim-mosaic/CMakeLists.txt  |    0
 .../apps => apps}/ossim-mosaic/mosaic_usage.txt    |    0
 apps/ossim-mosaic/ossim-mosaic.cpp                 |  539 ++
 .../apps => apps}/ossim-ogeom2ogeom/CMakeLists.txt |    0
 .../ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp        |    0
 .../apps => apps}/ossim-orthoigen/CMakeLists.txt   |    0
 apps/ossim-orthoigen/ossim-orthoigen.cpp           |  167 +
 .../src/apps => apps}/ossim-pc2dem/CMakeLists.txt  |    0
 .../apps => apps}/ossim-pc2dem/ossim-pc2dem.cpp    |    0
 .../apps => apps}/ossim-pixelflip/CMakeLists.txt   |    0
 apps/ossim-pixelflip/ossim-pixelflip.cpp           |  426 ++
 apps/ossim-plot-histo/CMakeLists.txt               |    2 +
 apps/ossim-plot-histo/ossim-plot-histo.cpp         |  172 +
 .../src/apps => apps}/ossim-preproc/CMakeLists.txt |    0
 apps/ossim-preproc/ossim-preproc.cpp               |   86 +
 .../src/apps => apps}/ossim-prune/CMakeLists.txt   |    0
 apps/ossim-prune/ossim-prune.cpp                   |  132 +
 .../src/apps => apps}/ossim-rejout/CMakeLists.txt  |    0
 .../apps => apps}/ossim-rejout/ossim-rejout.cpp    |    0
 {ossim/src/apps => apps}/ossim-rpf/CMakeLists.txt  |    0
 {ossim/src/apps => apps}/ossim-rpf/ossim-rpf.cpp   |    0
 .../src/apps => apps}/ossim-senint/CMakeLists.txt  |    0
 .../apps => apps}/ossim-senint/ossim-senint.cpp    |    0
 .../ossim-space-imaging/CMakeLists.txt             |    0
 .../ossim-space-imaging/ossim-space-imaging.cpp    |    0
 .../src/apps => apps}/ossim-src2src/CMakeLists.txt |    0
 apps/ossim-src2src/ossim-src2src.cpp               |  522 ++
 .../apps => apps}/ossim-swapbytes/CMakeLists.txt   |    0
 .../ossim-swapbytes/ossim-swapbytes.cpp            |    0
 .../apps => apps}/ossim-tfw2ogeom/CMakeLists.txt   |    0
 .../ossim-tfw2ogeom/ossim-tfw2ogeom.cpp            |    0
 .../src/apps => apps}/ossim-tfw2ogeom/template.kwl |    0
 apps/ossim-tool-client/CMakeLists.txt              |    4 +
 apps/ossim-tool-client/ossim-tool-client.cpp       |   62 +
 apps/ossim-tool-server/CMakeLists.txt              |    4 +
 apps/ossim-tool-server/ossim-tool-server.cpp       |   27 +
 .../apps => apps}/ossim-viirs-proc/CMakeLists.txt  |    0
 apps/ossim-viirs-proc/ossim-viirs-proc.cpp         |  210 +
 .../src/apps => apps}/ossim-ws-cmp/CMakeLists.txt  |    0
 apps/ossim-ws-cmp/ossim-ws-cmp.cpp                 |  230 +
 cmake/CMakeLists.txt                               |  365 +
 cmake/CMakeModules/CMakeParseArguments.cmake       |  161 +
 cmake/CMakeModules/FindAWS.cmake                   |   93 +
 cmake/CMakeModules/FindCPPUNIT.cmake               |   43 +
 cmake/CMakeModules/FindCsmApi.cmake                |   48 +
 cmake/CMakeModules/FindFFTW3.cmake                 |   24 +
 cmake/CMakeModules/FindFFmpeg.cmake                |  190 +
 cmake/CMakeModules/FindFreetype.cmake              |  164 +
 cmake/CMakeModules/FindGEOS.cmake                  |   89 +
 cmake/CMakeModules/FindGEOTIFF.cmake               |   39 +
 cmake/CMakeModules/FindGPSTK.cmake                 |   24 +
 cmake/CMakeModules/FindGeotrans.cmake              |   69 +
 cmake/CMakeModules/FindGit.cmake                   |  126 +
 cmake/CMakeModules/FindHDF5.cmake                  |   75 +
 cmake/CMakeModules/FindHDF5A.cmake                 |   79 +
 cmake/CMakeModules/FindJPEG.cmake                  |   55 +
 cmake/CMakeModules/FindJPEG12.cmake                |   67 +
 cmake/CMakeModules/FindLASzip.cmake                |  118 +
 cmake/CMakeModules/FindLIBLAS.cmake                |  103 +
 cmake/CMakeModules/FindMSP.cmake                   |  182 +
 cmake/CMakeModules/FindMiniZip.cmake               |   26 +
 cmake/CMakeModules/FindMrSid.cmake                 |   90 +
 cmake/CMakeModules/FindOMS.cmake                   |   44 +
 cmake/CMakeModules/FindOSG.cmake                   |  133 +
 cmake/CMakeModules/FindOpenCV.cmake                |   96 +
 cmake/CMakeModules/FindOpenCV2.cmake               |   94 +
 cmake/CMakeModules/FindOpenJPEG.cmake              |   59 +
 cmake/CMakeModules/FindOssimVideo.cmake            |   45 +
 cmake/CMakeModules/FindOssimWMS.cmake              |   48 +
 cmake/CMakeModules/FindPDAL.cmake                  |   66 +
 .../FindPackageHandleStandardArgs.cmake            |  382 +
 cmake/CMakeModules/FindPackageMessage.cmake        |   57 +
 cmake/CMakeModules/FindPodofo.cmake                |   25 +
 cmake/CMakeModules/FindPostgreSQL.cmake            |  192 +
 cmake/CMakeModules/FindPotrace.cmake               |   46 +
 cmake/CMakeModules/FindQt5.cmake                   |  165 +
 cmake/CMakeModules/FindRapier.cmake                |   47 +
 cmake/CMakeModules/FindRegex.cmake                 |   64 +
 cmake/CMakeModules/FindSQLITE.cmake                |   61 +
 cmake/CMakeModules/FindStlPort.cmake               |   26 +
 cmake/CMakeModules/FindSubversion.cmake            |  148 +
 cmake/CMakeModules/FindTIFF.cmake                  |   56 +
 cmake/CMakeModules/Findossim.cmake                 |   61 +
 cmake/CMakeModules/FindossimPlanet.cmake           |   44 +
 cmake/CMakeModules/OssimCPack.cmake                |  156 +
 cmake/CMakeModules/OssimCPackConfig.cmake.in       |   73 +
 cmake/CMakeModules/OssimCommonVariables.cmake      |  274 +
 cmake/CMakeModules/OssimDetermineCompiler.cmake    |   77 +
 cmake/CMakeModules/OssimQt4Macros.cmake            |   24 +
 cmake/CMakeModules/OssimQt5Macros.cmake            |   19 +
 cmake/CMakeModules/OssimUtilities.cmake            |  357 +
 cmake/CMakeModules/OssimVersion.cmake              |    6 +
 cmake/CMakeModules/Qt5Macros.cmake                 |   83 +
 cmake/CMakeModules/cmake_uninstall.cmake.in        |   22 +
 cmake/packaging/pkgconfig/ossim.pc.in              |   14 +
 cmake/scripts/ossim-cmake-config-WINDOWS.bat       |  220 +
 cmake/scripts/ossim-cmake-config.sh                |  297 +
 doc/Doxyfile                                       | 1553 ++++
 doc/dependencies.md                                |   16 +
 {ossim/include => include}/ossim/base/datum.h      |    0
 include/ossim/base/jsoncpp.h                       | 2085 ++++++
 .../ossim/base/ossim2dBilinearTransform.h          |    0
 .../ossim/base/ossim2dLinearRegression.h           |    0
 include/ossim/base/ossim2dTo2dIdentityTransform.h  |   68 +
 include/ossim/base/ossim2dTo2dMatrixTransform.h    |  220 +
 include/ossim/base/ossim2dTo2dShiftTransform.h     |  126 +
 include/ossim/base/ossim2dTo2dTransform.h          |   64 +
 include/ossim/base/ossim2dTo2dTransformFactory.h   |   44 +
 .../ossim/base/ossim2dTo2dTransformFactoryBase.h   |   49 +
 include/ossim/base/ossim2dTo2dTransformRegistry.h  |   84 +
 .../ossim/base/ossimActiveEdgeTable.h              |    0
 .../ossim/base/ossimAdjSolutionAttributes.h        |    0
 .../ossim/base/ossimAdjustableParameterInfo.h      |    0
 .../ossim/base/ossimAdjustableParameterInterface.h |    0
 .../ossim/base/ossimAdjustmentExecutive.h          |    0
 .../ossim/base/ossimAdjustmentInfo.h               |    0
 .../ossim/base/ossimAffineTransform.h              |    0
 .../ossim/base/ossimApplicationUsage.h             |    0
 include/ossim/base/ossimArgumentParser.h           |  249 +
 {ossim/include => include}/ossim/base/ossimAxes.h  |    0
 .../ossim/base/ossimBaseObjectFactory.h            |    0
 .../ossim/base/ossimBilSplitter.h                  |    0
 .../ossim/base/ossimBinaryDataProperty.h           |    0
 .../ossim/base/ossimBooleanProperty.h              |    0
 .../ossim/base/ossimByteStreamBuffer.h             |    0
 include/ossim/base/ossimCallback1.h                |   81 +
 include/ossim/base/ossimCallback1wRet.h            |   81 +
 include/ossim/base/ossimCallback2wRet.h            |   82 +
 .../ossim/base/ossimCmyVector.h                    |    0
 .../ossim/base/ossimColorProperty.h                |    0
 include/ossim/base/ossimColumnVector3d.h           |  288 +
 .../ossim/base/ossimColumnVector4d.h               |    0
 include/ossim/base/ossimCommon.h                   |  689 ++
 .../ossim/base/ossimConnectableContainer.h         |    0
 .../base/ossimConnectableContainerInterface.h      |    0
 .../ossim/base/ossimConnectableDisplayListener.h   |  109 +
 include/ossim/base/ossimConnectableObject.h        |  600 ++
 .../ossim/base/ossimConnectableObjectListener.h    |    0
 include/ossim/base/ossimConnectionEvent.h          |   79 +
 include/ossim/base/ossimConstants.h                |  569 ++
 include/ossim/base/ossimContainerEvent.h           |   45 +
 .../ossim/base/ossimContainerProperty.h            |    0
 .../include => include}/ossim/base/ossimCplUtil.h  |    0
 .../include => include}/ossim/base/ossimCsvFile.h  |    0
 .../ossim/base/ossimCustomEditorWindow.h           |    0
 .../base/ossimCustomEditorWindowFactoryBase.h      |    0
 .../ossim/base/ossimCustomEditorWindowRegistry.h   |    0
 include/ossim/base/ossimDataObject.h               |  115 +
 include/ossim/base/ossimDate.h                     |  279 +
 include/ossim/base/ossimDateProperty.h             |   37 +
 {ossim/include => include}/ossim/base/ossimDatum.h |    0
 .../ossim/base/ossimDatumFactory.h                 |    0
 .../ossim/base/ossimDatumFactoryInterface.h        |    0
 .../ossim/base/ossimDatumFactoryRegistry.h         |    0
 include/ossim/base/ossimDblGrid.h                  |  233 +
 include/ossim/base/ossimDirectory.h                |  105 +
 .../ossim/base/ossimDirectoryData.h                |    0
 .../ossim/base/ossimDirectoryTree.h                |    0
 .../ossim/base/ossimDisplayEventListener.h         |    0
 include/ossim/base/ossimDisplayInterface.h         |   40 +
 .../ossim/base/ossimDisplayListEvent.h             |    0
 .../ossim/base/ossimDisplayRefreshEvent.h          |    0
 {ossim/include => include}/ossim/base/ossimDms.h   |    0
 .../ossim/base/ossimDoubleGridProperty.h           |    0
 include/ossim/base/ossimDpt.h                      |  166 +
 include/ossim/base/ossimDpt3d.h                    |  148 +
 include/ossim/base/ossimDrect.h                    |  859 +++
 include/ossim/base/ossimDuration.h                 |  166 +
 .../ossim/base/ossimEbcdicToAscii.h                |    0
 include/ossim/base/ossimEcefPoint.h                |  210 +
 .../include => include}/ossim/base/ossimEcefRay.h  |    0
 .../ossim/base/ossimEcefVector.h                   |    0
 .../ossim/base/ossimElevationManagerEvent.h        |    0
 .../base/ossimElevationManagerEventListener.h      |    0
 .../ossim/base/ossimEllipsoid.h                    |    0
 .../ossim/base/ossimEllipsoidFactory.h             |    0
 include/ossim/base/ossimEndian.h                   |  277 +
 include/ossim/base/ossimEnvironmentUtility.h       |   61 +
 .../ossim/base/ossimEpsgDatumFactory.h             |    0
 .../ossim/base/ossimEquTokenDefines.h              |    0
 .../ossim/base/ossimEquTokenizer.h                 |    0
 .../ossim/base/ossimErrorCodes.h                   |    0
 .../ossim/base/ossimErrorContext.h                 |    0
 .../ossim/base/ossimErrorStatusInterface.h         |    0
 {ossim/include => include}/ossim/base/ossimEvent.h |    0
 .../include => include}/ossim/base/ossimEventIds.h |    0
 .../ossim/base/ossimException.h                    |    0
 .../ossim/base/ossimFactoryBaseTemplate.h          |    0
 include/ossim/base/ossimFactoryListInterface.h     |  265 +
 include/ossim/base/ossimFileProcessorInterface.h   |   41 +
 include/ossim/base/ossimFilename.h                 |  293 +
 .../ossim/base/ossimFilenameProperty.h             |    0
 .../ossim/base/ossimFlexLexer.h                    |    0
 .../ossim/base/ossimFontInformation.h              |    0
 .../ossim/base/ossimFontProperty.h                 |    0
 {ossim/include => include}/ossim/base/ossimFpt.h   |    0
 {ossim/include => include}/ossim/base/ossimFpt3d.h |    0
 .../ossim/base/ossimGeoPolygon.h                   |    0
 .../ossim/base/ossimGeoTiffCoordTransformsLut.h    |    0
 include/ossim/base/ossimGeoTiffDatumLut.h          |   74 +
 .../include => include}/ossim/base/ossimGeocent.h  |    0
 .../ossim/base/ossimGeodeticEvaluator.h            |    0
 {ossim/include => include}/ossim/base/ossimGeoid.h |    0
 include/ossim/base/ossimGeoidEgm96.h               |   65 +
 include/ossim/base/ossimGeoidImage.h               |  116 +
 include/ossim/base/ossimGeoidManager.h             |   93 +
 .../include => include}/ossim/base/ossimGeoidNgs.h |    0
 .../ossim/base/ossimGeoidNgsHeader.h               |    0
 .../include => include}/ossim/base/ossimGeoref.h   |    0
 {ossim/include => include}/ossim/base/ossimGpt.h   |    0
 include/ossim/base/ossimGrect.h                    |  310 +
 .../include => include}/ossim/base/ossimGzStream.h |    0
 .../ossim/base/ossimHexString.h                    |    0
 include/ossim/base/ossimHistogram.h                |  209 +
 include/ossim/base/ossimHistogramSource.h          |   57 +
 .../ossim/base/ossimHsiVector.h                    |    0
 .../ossim/base/ossimHsvVector.h                    |    0
 .../ossim/base/ossimHttpRequest.h                  |    0
 include/ossim/base/ossimHttpResponse.h             |   82 +
 {ossim/include => include}/ossim/base/ossimId.h    |    0
 .../ossim/base/ossimIdManager.h                    |    0
 .../ossim/base/ossimImageAoiListener.h             |    0
 .../ossim/base/ossimImageGeometryEvent.h           |    0
 .../ossim/base/ossimImageGeometryEventListener.h   |    0
 .../ossim/base/ossimImagePolygonEvent.h            |    0
 .../ossim/base/ossimImageRectangleEvent.h          |    0
 include/ossim/base/ossimImageTypeLut.h             |   33 +
 .../ossim/base/ossimInterleaveTypeLut.h            |    0
 include/ossim/base/ossimIoStream.h                 |  248 +
 include/ossim/base/ossimIosFwd.h                   |   54 +
 {ossim/include => include}/ossim/base/ossimIpt.h   |    0
 {ossim/include => include}/ossim/base/ossimIrect.h |    0
 .../ossim/base/ossimJpegYCbCrVector.h              |    0
 include/ossim/base/ossimKMeansClustering.h         |   95 +
 .../include => include}/ossim/base/ossimKeyword.h  |    0
 include/ossim/base/ossimKeywordNames.h             |  210 +
 include/ossim/base/ossimKeywordlist.h              |  560 ++
 .../ossim/base/ossimLagrangeInterpolator.h         |    0
 .../ossim/base/ossimLeastSquaresBilin.h            |    0
 .../ossim/base/ossimLeastSquaresPlane.h            |    0
 {ossim/include => include}/ossim/base/ossimLine.h  |    0
 include/ossim/base/ossimListener.h                 |   51 +
 .../ossim/base/ossimListenerManager.h              |    0
 include/ossim/base/ossimLookUpTable.h              |  116 +
 .../include => include}/ossim/base/ossimLsrPoint.h |    0
 .../include => include}/ossim/base/ossimLsrRay.h   |    0
 .../include => include}/ossim/base/ossimLsrSpace.h |    0
 .../ossim/base/ossimLsrVector.h                    |    0
 .../ossim/base/ossimMatrix3x3.h                    |    0
 .../ossim/base/ossimMatrix4x4.h                    |    0
 .../ossim/base/ossimMatrixProperty.h               |    0
 include/ossim/base/ossimMetadataInterface.h        |   45 +
 .../ossim/base/ossimMouseEvent.h                   |    0
 .../ossim/base/ossimMouseListener.h                |    0
 .../ossim/base/ossimMultiBandHistogram.h           |    0
 include/ossim/base/ossimMultiResLevelHistogram.h   |  103 +
 include/ossim/base/ossimNBandLutDataObject.h       |  489 ++
 .../ossim/base/ossimNadconGridDatum.h              |    0
 .../ossim/base/ossimNadconGridFile.h               |    0
 .../ossim/base/ossimNadconGridHeader.h             |    0
 .../ossim/base/ossimNadconNarDatum.h               |    0
 .../ossim/base/ossimNadconNasDatum.h               |    0
 include/ossim/base/ossimNormRgbVector.h            |  109 +
 .../include => include}/ossim/base/ossimNotify.h   |    0
 .../ossim/base/ossimNotifyContext.h                |    0
 .../ossim/base/ossimNumericProperty.h              |    0
 .../include => include}/ossim/base/ossimObject.h   |    0
 .../ossim/base/ossimObjectDestructingEvent.h       |    0
 .../ossim/base/ossimObjectEvents.h                 |    0
 .../ossim/base/ossimObjectFactory.h                |    0
 .../ossim/base/ossimObjectFactoryRegistry.h        |    0
 .../ossim/base/ossimObservationSet.h               |    0
 .../ossim/base/ossimOutputSource.h                 |    0
 .../ossim/base/ossimPackedBits.h                   |    0
 include/ossim/base/ossimPointHash.h                |   28 +
 .../ossim/base/ossimPointObservation.h             |    0
 include/ossim/base/ossimPolyArea2d.h               |  152 +
 .../include => include}/ossim/base/ossimPolyLine.h |    0
 include/ossim/base/ossimPolygon.h                  |  249 +
 .../include => include}/ossim/base/ossimPolynom.h  |    0
 {ossim/include => include}/ossim/base/ossimPool.h  |    0
 .../ossim/base/ossimPoolObject.h                   |    0
 .../ossim/base/ossimPreferences.h                  |    0
 .../ossim/base/ossimProcessInterface.h             |    0
 include/ossim/base/ossimProcessListener.h          |   29 +
 include/ossim/base/ossimProcessProgressEvent.h     |   51 +
 .../include => include}/ossim/base/ossimProperty.h |    0
 .../ossim/base/ossimPropertyEvent.h                |    0
 include/ossim/base/ossimPropertyInterface.h        |   41 +
 .../ossim/base/ossimPropertyInterfaceFactory.h     |    0
 .../ossim/base/ossimPropertyInterfaceRegistry.h    |    0
 .../ossim/base/ossimProtocolStream.h               |    0
 .../ossim/base/ossimQuadTreeWarp.h                 |    0
 .../ossim/base/ossimQuadrilateralMap.h             |    0
 .../ossim/base/ossimQuaternion.h                   |    0
 .../include => include}/ossim/base/ossimROIEvent.h |    0
 .../ossim/base/ossimROIEventListener.h             |    0
 .../ossim/base/ossimRationalNumber.h               |    0
 include/ossim/base/ossimRectanglePartitioner.h     |  147 +
 include/ossim/base/ossimRectilinearDataObject.h    |  155 +
 include/ossim/base/ossimRefPtr.h                   |   93 +
 include/ossim/base/ossimReferenced.h               |  107 +
 .../ossim/base/ossimRefreshEvent.h                 |    0
 include/ossim/base/ossimRegExp.h                   |  264 +
 .../ossim/base/ossimRgbLutDataObject.h             |    0
 .../ossim/base/ossimRgbVector.h                    |    0
 {ossim/include => include}/ossim/base/ossimRtti.h  |    0
 .../ossim/base/ossimScalarTypeLut.h                |    0
 .../ossim/base/ossimSevenParamDatum.h              |    0
 .../include => include}/ossim/base/ossimSource.h   |    0
 .../ossim/base/ossimStateChangedEvent.h            |    0
 include/ossim/base/ossimStdOutProgress.h           |   36 +
 .../ossim/base/ossimStreamBase.h                   |    0
 include/ossim/base/ossimStreamFactory.h            |   91 +
 include/ossim/base/ossimStreamFactoryBase.h        |   78 +
 include/ossim/base/ossimStreamFactoryRegistry.h    |  109 +
 include/ossim/base/ossimString.h                   |  938 +++
 .../ossim/base/ossimStringListProperty.h           |    0
 include/ossim/base/ossimStringProperty.h           |   73 +
 {ossim/include => include}/ossim/base/ossimTDpt.h  |    0
 include/ossim/base/ossimTempFilename.h             |   42 +
 .../ossim/base/ossimTextProperty.h                 |    0
 .../ossim/base/ossimThinPlateSpline.h              |    0
 .../ossim/base/ossimThreeParamDatum.h              |    0
 .../include => include}/ossim/base/ossimTieGpt.h   |    0
 .../ossim/base/ossimTieGptSet.h                    |    0
 .../base/ossimTieMeasurementGeneratorInterface.h   |   84 +
 include/ossim/base/ossimTiffConstants.h            |  186 +
 include/ossim/base/ossimTileHash.h                 |   46 +
 include/ossim/base/ossimTiledImageHash.h           |   40 +
 {ossim/include => include}/ossim/base/ossimTimer.h |    0
 {ossim/include => include}/ossim/base/ossimTrace.h |    0
 include/ossim/base/ossimTraceManager.h             |   69 +
 include/ossim/base/ossimUnitConversionTool.h       |   80 +
 .../ossim/base/ossimUnitTypeLut.h                  |    0
 {ossim/include => include}/ossim/base/ossimUrl.h   |    0
 .../include => include}/ossim/base/ossimUsgsQuad.h |    0
 .../ossim/base/ossimViewController.h               |    0
 .../ossim/base/ossimViewEvent.h                    |    0
 .../ossim/base/ossimViewInterface.h                |    0
 .../ossim/base/ossimViewListener.h                 |    0
 .../include => include}/ossim/base/ossimVisitor.h  |    0
 include/ossim/base/ossimVrect.h                    |  167 +
 .../ossim/base/ossimWLSBundleSolution.h            |    0
 include/ossim/base/ossimWebRequest.h               |   28 +
 .../ossim/base/ossimWebRequestFactoryBase.h        |    0
 .../ossim/base/ossimWebRequestFactoryRegistry.h    |    0
 .../ossim/base/ossimWebResponse.h                  |    0
 .../ossim/base/ossimWgs72Datum.h                   |    0
 .../ossim/base/ossimWgs84Datum.h                   |    0
 {ossim/include => include}/ossim/base/ossimWms.h   |    0
 .../ossim/base/ossimXmlAttribute.h                 |    0
 .../ossim/base/ossimXmlDocument.h                  |    0
 include/ossim/base/ossimXmlNode.h                  |  129 +
 .../ossim/base/ossimXmlString.h                    |    0
 .../ossim/elevation/ossimDtedElevationDatabase.h   |   87 +
 include/ossim/elevation/ossimDtedFactory.h         |   38 +
 include/ossim/elevation/ossimDtedHandler.h         |  247 +
 .../ossim/elevation/ossimElevCellHandler.h         |    0
 .../ossim/elevation/ossimElevCellHandlerFactory.h  |    0
 .../ossim/elevation/ossimElevLess.h                |    0
 include/ossim/elevation/ossimElevManager.h         |  196 +
 .../ossim/elevation/ossimElevSource.h              |    0
 include/ossim/elevation/ossimElevSourceFactory.h   |   74 +
 .../ossim/elevation/ossimElevationAccuracyInfo.h   |    0
 .../ossim/elevation/ossimElevationCellDatabase.h   |  170 +
 .../ossim/elevation/ossimElevationDatabase.h       |    0
 .../elevation/ossimElevationDatabaseFactory.h      |    0
 .../elevation/ossimElevationDatabaseFactoryBase.h  |    0
 .../elevation/ossimElevationDatabaseRegistry.h     |    0
 .../elevation/ossimGeneralRasterElevFactory.h      |    0
 .../elevation/ossimGeneralRasterElevHandler.h      |    0
 .../ossimGeneralRasterElevationDatabase.h          |    0
 .../ossim/elevation/ossimHgtRef.h                  |    0
 .../ossim/elevation/ossimImageElevationDatabase.h  |  219 +
 .../ossim/elevation/ossimImageElevationHandler.h   |  154 +
 .../ossim/elevation/ossimSrtmElevationDatabase.h   |   71 +
 include/ossim/elevation/ossimSrtmFactory.h         |   57 +
 .../ossim/elevation/ossimSrtmHandler.h             |    0
 .../ossim/elevation/ossimTiledElevationDatabase.h  |  222 +
 {ossim/include => include}/ossim/font/ossimFont.h  |    0
 include/ossim/font/ossimFontFactoryBase.h          |   41 +
 .../ossim/font/ossimFontFactoryRegistry.h          |    0
 .../ossim/font/ossimFreeTypeFont.h                 |    0
 .../ossim/font/ossimFreeTypeFontFactory.h          |    0
 .../ossim/font/ossimGdBitmapFont.h                 |    0
 .../ossim/font/ossimGdSansBold.inc                 |    0
 include/ossim/hdf5/ossimHdf5.h                     |  116 +
 include/ossim/hdf5/ossimHdf5GridModel.h            |   69 +
 include/ossim/hdf5/ossimHdf5ImageDataset.h         |  153 +
 include/ossim/hdf5/ossimHdf5ImageHandler.h         |  229 +
 include/ossim/hdf5/ossimHdf5Info.h                 |  131 +
 include/ossim/hdf5/ossimHdf5ProjectionFactory.h    |   63 +
 include/ossim/hdf5/ossimHdf5Tool.h                 |   74 +
 include/ossim/hdf5/ossimViirsHandler.h             |   32 +
 .../include => include}/ossim/imaging/gdfontg.inc  |    0
 .../include => include}/ossim/imaging/gdfontl.inc  |    0
 .../include => include}/ossim/imaging/gdfontmb.inc |    0
 .../include => include}/ossim/imaging/gdfonts.inc  |    0
 .../include => include}/ossim/imaging/gdfontt.inc  |    0
 include/ossim/imaging/ossim3x3ConvolutionFilter.h  |   97 +
 include/ossim/imaging/ossimAOD.h                   |   66 +
 .../ossim/imaging/ossimAdrgHeader.h                |    0
 include/ossim/imaging/ossimAdrgTileSource.h        |  196 +
 .../ossim/imaging/ossimAnnotationEllipseObject.h   |    0
 .../ossim/imaging/ossimAnnotationFontObject.h      |    0
 .../ossim/imaging/ossimAnnotationGdBitmapFont.h    |    0
 .../ossim/imaging/ossimAnnotationLineObject.h      |    0
 .../ossim/imaging/ossimAnnotationMapGridSource.h   |    0
 .../imaging/ossimAnnotationMultiEllipseObject.h    |    0
 .../ossim/imaging/ossimAnnotationMultiLineObject.h |    0
 .../imaging/ossimAnnotationMultiPolyLineObject.h   |    0
 .../ossim/imaging/ossimAnnotationMultiPolyObject.h |    0
 .../ossim/imaging/ossimAnnotationObject.h          |    0
 .../ossim/imaging/ossimAnnotationObjectFactory.h   |    0
 .../ossim/imaging/ossimAnnotationPolyObject.h      |    0
 .../ossim/imaging/ossimAnnotationSource.h          |    0
 include/ossim/imaging/ossimAppFixedTileCache.h     |  117 +
 include/ossim/imaging/ossimAppTileCache.h          |  170 +
 .../ossim/imaging/ossimArcInfoGridWriter.h         |    0
 .../ossim/imaging/ossimAtCorrGridRemapper.h        |    0
 .../ossim/imaging/ossimAtCorrKeywords.h            |    0
 include/ossim/imaging/ossimAtCorrRemapper.h        |   88 +
 .../ossim/imaging/ossimAtbController.h             |    0
 .../ossim/imaging/ossimAtbMatchPoint.h             |    0
 .../ossim/imaging/ossimAtbPointSource.h            |    0
 include/ossim/imaging/ossimBandAverageFilter.h     |  110 +
 include/ossim/imaging/ossimBandClipFilter.h        |   92 +
 include/ossim/imaging/ossimBandLutFilter.h         |  152 +
 include/ossim/imaging/ossimBandMergeSource.h       |   62 +
 include/ossim/imaging/ossimBandSelector.h          |  189 +
 include/ossim/imaging/ossimBandSeparateHandler.h   |   97 +
 include/ossim/imaging/ossimBitMaskTileSource.h     |  133 +
 include/ossim/imaging/ossimBitMaskWriter.h         |  133 +
 include/ossim/imaging/ossimBlendMosaic.h           |   78 +
 .../ossim/imaging/ossimBrightnessContrastSource.h  |    0
 include/ossim/imaging/ossimBrightnessMatch.h       |   57 +
 include/ossim/imaging/ossimBumpShadeTileSource.h   |  283 +
 include/ossim/imaging/ossimCacheTileSource.h       |   91 +
 include/ossim/imaging/ossimCastTileSourceFilter.h  |   93 +
 include/ossim/imaging/ossimCcfHead.h               |  192 +
 include/ossim/imaging/ossimCcfTileSource.h         |  232 +
 include/ossim/imaging/ossimCibCadrgTileSource.h    |  601 ++
 .../ossim/imaging/ossimClosestToCenterCombiner.h   |   60 +
 include/ossim/imaging/ossimCodecBase.h             |   66 +
 include/ossim/imaging/ossimCodecFactory.h          |   73 +
 include/ossim/imaging/ossimCodecFactoryInterface.h |   90 +
 .../ossim/imaging/ossimCodecFactoryRegistry.h      |    0
 include/ossim/imaging/ossimColorNormalizedFusion.h |   32 +
 include/ossim/imaging/ossimConvolutionFilter1D.h   |  124 +
 include/ossim/imaging/ossimConvolutionSource.h     |   72 +
 include/ossim/imaging/ossimDespeckleFilter.h       |   48 +
 include/ossim/imaging/ossimDilationFilter.h        |   74 +
 .../ossim/imaging/ossimDiscrete3x3HatFilter.h      |    0
 .../ossim/imaging/ossimDiscreteConvolutionKernel.h |    0
 .../ossim/imaging/ossimDiscreteNearestNeighbor.h   |    0
 include/ossim/imaging/ossimDoqqTileSource.h        |   58 +
 include/ossim/imaging/ossimDtedTileSource.h        |  263 +
 .../ossim/imaging/ossimERSFileWriter.h             |    0
 include/ossim/imaging/ossimERSTileSource.h         |   56 +
 .../ossim/imaging/ossimEastingNorthingCutter.h     |    0
 include/ossim/imaging/ossimEdgeFilter.h            |   86 +
 include/ossim/imaging/ossimElevImageSource.h       |  146 +
 include/ossim/imaging/ossimElevRemapper.h          |   45 +
 include/ossim/imaging/ossimElevationMosaic.h       |   73 +
 include/ossim/imaging/ossimEnviHeaderFileWriter.h  |   78 +
 include/ossim/imaging/ossimEnviTileSource.h        |  110 +
 include/ossim/imaging/ossimEquationCombiner.h      |  323 +
 include/ossim/imaging/ossimErosionFilter.h         |   62 +
 .../ossim/imaging/ossimEsriShapeFileInterface.h    |    0
 include/ossim/imaging/ossimFeatherMosaic.h         |   87 +
 include/ossim/imaging/ossimFftFilter.h             |   81 +
 include/ossim/imaging/ossimFgdcFileWriter.h        |  157 +
 .../ossim/imaging/ossimFilter.h                    |    0
 include/ossim/imaging/ossimFilterResampler.h       |  151 +
 include/ossim/imaging/ossimFilterTable.h           |   97 +
 include/ossim/imaging/ossimFixedTileCache.h        |  146 +
 include/ossim/imaging/ossimFusionCombiner.h        |   47 +
 include/ossim/imaging/ossimGammaRemapper.h         |   71 +
 .../ossim/imaging/ossimGdFont.h                    |    0
 .../ossim/imaging/ossimGdFontExterns.h             |    0
 include/ossim/imaging/ossimGeneralRasterInfo.h     |  431 ++
 .../ossim/imaging/ossimGeneralRasterTileSource.h   |  212 +
 .../ossim/imaging/ossimGeneralRasterWriter.h       |    0
 include/ossim/imaging/ossimGeoAnnotationBitmap.h   |   54 +
 .../imaging/ossimGeoAnnotationEllipseObject.h      |    0
 .../ossim/imaging/ossimGeoAnnotationFontObject.h   |    0
 .../ossim/imaging/ossimGeoAnnotationGdBitmapFont.h |    0
 .../ossim/imaging/ossimGeoAnnotationLineObject.h   |    0
 .../imaging/ossimGeoAnnotationMultiEllipseObject.h |    0
 .../ossimGeoAnnotationMultiPolyLineObject.h        |    0
 .../imaging/ossimGeoAnnotationMultiPolyObject.h    |    0
 .../ossim/imaging/ossimGeoAnnotationObject.h       |    0
 .../imaging/ossimGeoAnnotationPolyLineObject.h     |    0
 .../ossim/imaging/ossimGeoAnnotationPolyObject.h   |    0
 .../ossim/imaging/ossimGeoAnnotationSource.h       |    0
 .../ossim/imaging/ossimGeoPolyCutter.h             |    0
 .../ossim/imaging/ossimGeographicAnnotationGrid.h  |    0
 include/ossim/imaging/ossimGeomFileWriter.h        |   57 +
 include/ossim/imaging/ossimGpkgWriterInterface.h   |   79 +
 include/ossim/imaging/ossimGridRemapEngine.h       |   70 +
 .../ossim/imaging/ossimGridRemapEngineFactory.h    |    0
 include/ossim/imaging/ossimGridRemapSource.h       |  144 +
 include/ossim/imaging/ossimHistoMatchRemapper.h    |   97 +
 include/ossim/imaging/ossimHistogramEqualization.h |   99 +
 .../ossim/imaging/ossimHistogramMatchFilter.h      |    0
 include/ossim/imaging/ossimHistogramRemapper.h     |  586 ++
 .../ossim/imaging/ossimHistogramThreshholdFilter.h |   51 +
 .../ossim/imaging/ossimHistogramWriter.h           |    0
 include/ossim/imaging/ossimHsiRemapper.h           |  256 +
 include/ossim/imaging/ossimHsiToRgbSource.h        |   49 +
 include/ossim/imaging/ossimHsvGridRemapEngine.h    |   54 +
 include/ossim/imaging/ossimHsvToRgbSource.h        |   42 +
 .../ossim/imaging/ossimIgenGenerator.h             |    0
 .../ossim/imaging/ossimImageCacheBase.h            |    0
 .../ossim/imaging/ossimImageCacheTileSource.h      |    0
 include/ossim/imaging/ossimImageChain.h            |  416 ++
 .../ossim/imaging/ossimImageCombiner.h             |    0
 include/ossim/imaging/ossimImageData.h             | 1299 ++++
 include/ossim/imaging/ossimImageDataFactory.h      |   63 +
 .../ossim/imaging/ossimImageDataHelper.h           |    0
 .../ossim/imaging/ossimImageDisplayWriter.h        |    0
 include/ossim/imaging/ossimImageFileWriter.h       |  499 ++
 include/ossim/imaging/ossimImageGaussianFilter.h   |   80 +
 include/ossim/imaging/ossimImageGeometry.h         |  482 ++
 include/ossim/imaging/ossimImageGeometryFactory.h  |   53 +
 .../ossim/imaging/ossimImageGeometryFactoryBase.h  |   44 +
 include/ossim/imaging/ossimImageGeometryRegistry.h |   74 +
 include/ossim/imaging/ossimImageHandler.h          |  849 +++
 include/ossim/imaging/ossimImageHandlerFactory.h   |  130 +
 .../ossim/imaging/ossimImageHandlerFactoryBase.h   |  142 +
 include/ossim/imaging/ossimImageHandlerRegistry.h  |  175 +
 include/ossim/imaging/ossimImageHistogramSource.h  |  107 +
 include/ossim/imaging/ossimImageMetaData.h         |  167 +
 .../imaging/ossimImageMetaDataWriterFactory.h      |   87 +
 .../imaging/ossimImageMetaDataWriterFactoryBase.h  |   67 +
 .../imaging/ossimImageMetaDataWriterRegistry.h     |   98 +
 include/ossim/imaging/ossimImageModel.h            |  189 +
 include/ossim/imaging/ossimImageMosaic.h           |   73 +
 .../ossimImageReconstructionFilterFactory.h        |    0
 .../ossimImageReconstructionFilterRegistry.h       |    0
 include/ossim/imaging/ossimImageRenderer.h         |  500 ++
 include/ossim/imaging/ossimImageSharpenFilter.h    |   83 +
 include/ossim/imaging/ossimImageSource.h           |  246 +
 .../ossim/imaging/ossimImageSourceFactory.h        |    0
 .../ossim/imaging/ossimImageSourceFactoryBase.h    |    0
 .../imaging/ossimImageSourceFactoryRegistry.h      |    0
 include/ossim/imaging/ossimImageSourceFilter.h     |   66 +
 .../imaging/ossimImageSourceHistogramFilter.h      |    0
 include/ossim/imaging/ossimImageSourceSequencer.h  |  179 +
 .../ossim/imaging/ossimImageStatisticsSource.h     |    0
 .../ossim/imaging/ossimImageToPlaneNormalFilter.h  |   74 +
 .../ossim/imaging/ossimImageWriter.h               |    0
 include/ossim/imaging/ossimImageWriterFactory.h    |   63 +
 .../ossim/imaging/ossimImageWriterFactoryBase.h    |    0
 .../imaging/ossimImageWriterFactoryRegistry.h      |   89 +
 include/ossim/imaging/ossimIndexToRgbLutFilter.h   |  171 +
 .../ossim/imaging/ossimIntensityAdjustmentFilter.h |   74 +
 .../ossim/imaging/ossimIso8211.h                   |    0
 include/ossim/imaging/ossimJpegCodec.h             |  133 +
 include/ossim/imaging/ossimJpegDefaultTable.h      |  162 +
 include/ossim/imaging/ossimJpegMemDest.h           |   44 +
 include/ossim/imaging/ossimJpegMemSrc.h            |   38 +
 include/ossim/imaging/ossimJpegStdIOSrc.h          |   39 +
 include/ossim/imaging/ossimJpegTileSource.h        |  215 +
 .../ossim/imaging/ossimJpegWriter.h                |    0
 include/ossim/imaging/ossimJpegYCbCrToRgbSource.h  |   37 +
 include/ossim/imaging/ossimKMeansFilter.h          |  139 +
 .../ossim/imaging/ossimKakaduCompressorInterface.h |  137 +
 .../ossim/imaging/ossimLandsatTileSource.h         |    0
 .../imaging/ossimLandsatTopoCorrectionFilter.h     |    0
 include/ossim/imaging/ossimLasReader.h             |  330 +
 include/ossim/imaging/ossimLinearStretchRemapper.h |   72 +
 .../ossim/imaging/ossimLocalCorrelationFusion.h    |    0
 include/ossim/imaging/ossimMapCompositionSource.h  |  336 +
 include/ossim/imaging/ossimMaskFilter.h            |  266 +
 include/ossim/imaging/ossimMaxMosaic.h             |   78 +
 include/ossim/imaging/ossimMeanMedianFilter.h      |  129 +
 .../ossim/imaging/ossimMemoryImageSource.h         |    0
 include/ossim/imaging/ossimMetadataFileWriter.h    |  176 +
 include/ossim/imaging/ossimMonoGridRemapEngine.h   |   54 +
 .../imaging/ossimMultiBandHistogramTileSource.h    |    0
 include/ossim/imaging/ossimNBandToIndexFilter.h    |  129 +
 include/ossim/imaging/ossimNitf20Writer.h          |  135 +
 include/ossim/imaging/ossimNitfTileSource.h        |  553 ++
 include/ossim/imaging/ossimNitfWriter.h            |  174 +
 include/ossim/imaging/ossimNitfWriterBase.h        |  195 +
 include/ossim/imaging/ossimNormalizedRemapTable.h  |   84 +
 .../ossim/imaging/ossimNormalizedS16RemapTable.h   |  146 +
 .../ossim/imaging/ossimNormalizedU11RemapTable.h   |  117 +
 .../ossim/imaging/ossimNormalizedU12RemapTable.h   |  117 +
 .../ossim/imaging/ossimNormalizedU13RemapTable.h   |  117 +
 .../ossim/imaging/ossimNormalizedU14RemapTable.h   |  117 +
 .../ossim/imaging/ossimNormalizedU15RemapTable.h   |  117 +
 .../ossim/imaging/ossimNormalizedU16RemapTable.h   |  116 +
 .../ossim/imaging/ossimNormalizedU8RemapTable.h    |  116 +
 .../ossim/imaging/ossimNullPixelFlip.h             |    0
 include/ossim/imaging/ossimOrthoImageMosaic.h      |   61 +
 include/ossim/imaging/ossimOverviewBuilderBase.h   |  240 +
 .../ossim/imaging/ossimOverviewBuilderFactory.h    |    0
 .../imaging/ossimOverviewBuilderFactoryBase.h      |    0
 .../imaging/ossimOverviewBuilderFactoryRegistry.h  |    0
 .../ossim/imaging/ossimOverviewSequencer.h         |    0
 .../ossim/imaging/ossimPdfWriter.h                 |    0
 include/ossim/imaging/ossimPiecewiseRemapper.h     |  272 +
 include/ossim/imaging/ossimPixelFlipper.h          |  272 +
 include/ossim/imaging/ossimPolyCutter.h            |  108 +
 include/ossim/imaging/ossimQbTileFilesHandler.h    |   44 +
 .../ossim/imaging/ossimQuickbirdNitfTileSource.h   |   44 +
 .../ossim/imaging/ossimQuickbirdTiffTileSource.h   |   36 +
 include/ossim/imaging/ossimRLevelFilter.h          |   99 +
 include/ossim/imaging/ossimRangeDomeTileSource.h   |  123 +
 include/ossim/imaging/ossimReadmeFileWriter.h      |   57 +
 include/ossim/imaging/ossimRectangleCutFilter.h    |   57 +
 .../ossim/imaging/ossimResampler.h                 |    0
 include/ossim/imaging/ossimRgbGridRemapEngine.h    |   54 +
 .../ossim/imaging/ossimRgbImage.h                  |    0
 include/ossim/imaging/ossimRgbToGreyFilter.h       |   70 +
 include/ossim/imaging/ossimRgbToHsiSource.h        |   47 +
 include/ossim/imaging/ossimRgbToHsvSource.h        |   47 +
 include/ossim/imaging/ossimRgbToIndexFilter.h      |   96 +
 include/ossim/imaging/ossimRgbToJpegYCbCrSource.h  |   32 +
 .../ossim/imaging/ossimRpfCacheTileSource.h        |    0
 include/ossim/imaging/ossimS16ImageData.h          |  184 +
 include/ossim/imaging/ossimSFIMFusion.h            |   86 +
 .../ossim/imaging/ossimSICDToDetectedImage.h       |    0
 include/ossim/imaging/ossimScalarRemapper.h        |  110 +
 include/ossim/imaging/ossimScaleFilter.h           |  184 +
 include/ossim/imaging/ossimShiftFilter.h           |  105 +
 include/ossim/imaging/ossimSingleImageChain.h      |  562 ++
 .../ossim/imaging/ossimSlopeFilter.h               |    0
 include/ossim/imaging/ossimSrtmTileSource.h        |   74 +
 include/ossim/imaging/ossimStreamReaderInterface.h |   50 +
 include/ossim/imaging/ossimSubImageTileSource.h    |   90 +
 include/ossim/imaging/ossimTableRemapper.h         |   97 +
 include/ossim/imaging/ossimTiffOverviewBuilder.h   |  304 +
 include/ossim/imaging/ossimTiffTileSource.h        |  382 +
 .../ossim/imaging/ossimTiffWriter.h                |    0
 include/ossim/imaging/ossimTileCache.h             |  105 +
 include/ossim/imaging/ossimTilePatch.h             |  136 +
 include/ossim/imaging/ossimTiledImageHandler.h     |  160 +
 include/ossim/imaging/ossimTiledImagePatch.h       |  124 +
 include/ossim/imaging/ossimTiling.h                |  200 +
 include/ossim/imaging/ossimTilingPoly.h            |   96 +
 include/ossim/imaging/ossimTilingRect.h            |   67 +
 .../imaging/ossimTopographicCorrectionFilter.h     |  224 +
 include/ossim/imaging/ossimTrimFilter.h            |   71 +
 include/ossim/imaging/ossimTwoColorView.h          |  105 +
 include/ossim/imaging/ossimU11ImageData.h          |  188 +
 include/ossim/imaging/ossimU12ImageData.h          |  188 +
 include/ossim/imaging/ossimU13ImageData.h          |  188 +
 include/ossim/imaging/ossimU14ImageData.h          |  188 +
 include/ossim/imaging/ossimU15ImageData.h          |  188 +
 include/ossim/imaging/ossimU16ImageData.h          |  192 +
 include/ossim/imaging/ossimU8ImageData.h           |  175 +
 include/ossim/imaging/ossimUsgsDemTileSource.h     |  194 +
 .../imaging/ossimValueAssignImageSourceFilter.h    |  102 +
 .../ossim/imaging/ossimVectorRenderer.h            |    0
 .../ossim/imaging/ossimVertexExtractor.h           |    0
 .../ossim/imaging/ossimVpfAnnotationCoverageInfo.h |   77 +
 .../ossim/imaging/ossimVpfAnnotationFeatureInfo.h  |  229 +
 .../ossim/imaging/ossimVpfAnnotationLibraryInfo.h  |    0
 .../ossim/imaging/ossimVpfAnnotationSource.h       |    0
 include/ossim/imaging/ossimVpfTileSource.h         |  164 +
 include/ossim/imaging/ossimWatermarkFilter.h       |  347 +
 .../ossim/imaging/ossimWorldFileWriter.h           |    0
 include/ossim/imaging/ossimWriter.h                |  208 +
 include/ossim/init/ossimInit.h                     |  154 +
 {ossim/include => include}/ossim/matrix/controlw.h |    0
 {ossim/include => include}/ossim/matrix/include.h  |    0
 {ossim/include => include}/ossim/matrix/myexcept.h |    0
 {ossim/include => include}/ossim/matrix/newmat.h   |    0
 {ossim/include => include}/ossim/matrix/newmatap.h |    0
 {ossim/include => include}/ossim/matrix/newmatio.h |    0
 {ossim/include => include}/ossim/matrix/newmatnl.h |    0
 {ossim/include => include}/ossim/matrix/newmatrc.h |    0
 {ossim/include => include}/ossim/matrix/newmatrm.h |    0
 {ossim/include => include}/ossim/matrix/precisio.h |    0
 {ossim/include => include}/ossim/matrix/solution.h |    0
 include/ossim/ossimConfig.h.vc                     |   57 +
 include/ossim/parallel/ossimIgen.h                 |   71 +
 include/ossim/parallel/ossimImageChainMtAdaptor.h  |  127 +
 .../ossim/parallel/ossimImageHandlerMtAdaptor.h    |  105 +
 .../ossimImageMpiMWriterSequenceConnection.h       |   60 +
 .../ossimImageMpiSWriterSequenceConnection.h       |   53 +
 .../include => include}/ossim/parallel/ossimJob.h  |    0
 .../ossim/parallel/ossimJobMultiThreadQueue.h      |    0
 .../ossim/parallel/ossimJobQueue.h                 |    0
 .../ossim/parallel/ossimJobThreadQueue.h           |    0
 .../include => include}/ossim/parallel/ossimMpi.h  |    0
 .../parallel/ossimMpiMasterOverviewSequencer.h     |    0
 .../parallel/ossimMpiSlaveOverviewSequencer.h      |    0
 .../ossim/parallel/ossimMtDebug.h                  |    0
 include/ossim/parallel/ossimMultiThreadSequencer.h |  149 +
 include/ossim/plugin/ossimDynamicLibrary.h         |   65 +
 include/ossim/plugin/ossimPluginConstants.h        |   42 +
 .../ossim/plugin/ossimPluginLibrary.h              |    0
 .../ossim/plugin/ossimSharedObjectBridge.h         |    0
 .../ossim/plugin/ossimSharedPluginRegistry.h       |    0
 .../point_cloud/ossimGenericPointCloudHandler.h    |   40 +
 include/ossim/point_cloud/ossimPointBlock.h        |   97 +
 .../ossim/point_cloud/ossimPointCloudGeometry.h    |   88 +
 include/ossim/point_cloud/ossimPointCloudHandler.h |   97 +
 .../point_cloud/ossimPointCloudHandlerFactory.h    |   43 +
 .../point_cloud/ossimPointCloudHandlerRegistry.h   |   57 +
 .../point_cloud/ossimPointCloudImageHandler.h      |  254 +
 .../ossimPointCloudImageHandlerFactory.h           |    0
 include/ossim/point_cloud/ossimPointCloudSource.h  |   83 +
 .../point_cloud/ossimPointCloudUtilityFilter.h     |   67 +
 include/ossim/point_cloud/ossimPointRecord.h       |   90 +
 include/ossim/projection/ossimAdjMapModel.h        |  137 +
 .../ossim/projection/ossimAffineProjection.h       |    0
 .../ossim/projection/ossimAlbersProjection.h       |    0
 .../ossim/projection/ossimAlphaSensor.h            |    0
 .../ossim/projection/ossimAlphaSensorHRI.h         |    0
 .../ossim/projection/ossimAlphaSensorHSI.h         |    0
 include/ossim/projection/ossimApplanixEcefModel.h  |  102 +
 include/ossim/projection/ossimApplanixUtmModel.h   |   83 +
 .../ossim/projection/ossimAzimEquDistProjection.h  |    0
 .../ossim/projection/ossimBilinearProjection.h     |    0
 .../ossim/projection/ossimBngProjection.h          |    0
 .../ossim/projection/ossimBonneProjection.h        |    0
 .../ossim/projection/ossimBuckeyeSensor.h          |    0
 include/ossim/projection/ossimCadrgProjection.h    |   90 +
 .../ossim/projection/ossimCassiniProjection.h      |    0
 include/ossim/projection/ossimCoarseGridModel.h    |  145 +
 .../ossim/projection/ossimCylEquAreaProjection.h   |    0
 .../ossim/projection/ossimEckert4Projection.h      |    0
 .../ossim/projection/ossimEckert6Projection.h      |    0
 .../ossim/projection/ossimEpsgProjectionDatabase.h |  132 +
 .../ossim/projection/ossimEpsgProjectionFactory.h  |    0
 .../ossim/projection/ossimEquDistCylProjection.h   |    0
 .../ossim/projection/ossimFcsiModel.h              |    0
 .../ossim/projection/ossimGnomonicProjection.h     |    0
 include/ossim/projection/ossimGoogleProjection.h   |   34 +
 include/ossim/projection/ossimIkonosRpcModel.h     |   76 +
 .../ossim/projection/ossimImageProjectionModel.h   |   61 +
 .../projection/ossimImageViewAffineTransform.h     |  187 +
 .../projection/ossimImageViewProjectionTransform.h |  130 +
 .../ossim/projection/ossimImageViewTransform.h     |    0
 .../projection/ossimImageViewTransformFactory.h    |    0
 .../ossim/projection/ossimIpodSensor.h             |    0
 .../ossimLambertConformalConicProjection.h         |    0
 .../ossim/projection/ossimLandSatModel.h           |    0
 include/ossim/projection/ossimLensDistortion.h     |   53 +
 .../ossim/projection/ossimLlxyProjection.h         |    0
 .../ossim/projection/ossimMapProjection.h          |    0
 .../ossim/projection/ossimMapProjectionFactory.h   |   66 +
 include/ossim/projection/ossimMapProjectionInfo.h  |  276 +
 .../ossim/projection/ossimMapViewController.h      |    0
 .../projection/ossimMeanRadialLensDistortion.h     |  119 +
 .../ossim/projection/ossimMercatorProjection.h     |    0
 .../ossim/projection/ossimMgrs.h                   |    0
 .../ossim/projection/ossimMillerProjection.h       |    0
 .../ossim/projection/ossimMiscProjectionFactory.h  |    0
 .../ossim/projection/ossimMollweidProjection.h     |    0
 .../projection/ossimNewZealandMapGridProjection.h  |    0
 .../ossim/projection/ossimNgaProjectionFactory.h   |   65 +
 .../ossim/projection/ossimNitfMapModel.h           |    0
 .../ossim/projection/ossimNitfProjectionFactory.h  |    0
 include/ossim/projection/ossimNitfRpcModel.h       |  115 +
 include/ossim/projection/ossimNitfRsmModel.h       |   74 +
 .../projection/ossimObliqueMercatorProjection.h    |    0
 .../ossim/projection/ossimOptimizableProjection.h  |    0
 .../ossim/projection/ossimOrthoGraphicProjection.h |    0
 .../ossim/projection/ossimPolarStereoProjection.h  |    0
 .../ossim/projection/ossimPolarst.h                |    0
 .../ossim/projection/ossimPolyconicProjection.h    |    0
 .../ossim/projection/ossimPolynomProjection.h      |    0
 .../projection/ossimPositionQualityEvaluator.h     |    0
 .../ossim/projection/ossimPpjFrameSensor.h         |    0
 .../ossim/projection/ossimProjection.h             |    0
 .../ossim/projection/ossimProjectionFactoryBase.h  |    0
 .../projection/ossimProjectionFactoryRegistry.h    |    0
 .../ossimProjectionViewControllerFactory.h         |    0
 .../ossim/projection/ossimQuadProjection.h         |    0
 include/ossim/projection/ossimQuickbirdRpcModel.h  |   85 +
 .../ossim/projection/ossimRS1SarModel.h            |    0
 .../projection/ossimRadialDecentLensDistortion.h   |    0
 .../ossim/projection/ossimRpcModel.h               |    0
 include/ossim/projection/ossimRpcProjection.h      |  238 +
 include/ossim/projection/ossimRpcSolver.h          |  243 +
 include/ossim/projection/ossimRsmModel.h           |  173 +
 include/ossim/projection/ossimSarModel.h           |  345 +
 include/ossim/projection/ossimSensorModel.h        |  393 +
 .../ossim/projection/ossimSensorModelFactory.h     |    0
 .../ossim/projection/ossimSensorModelTuple.h       |    0
 .../ossim/projection/ossimSinusoid.h               |    0
 .../ossim/projection/ossimSinusoidalProjection.h   |    0
 .../ossim/projection/ossimSkyBoxLearSensor.h       |    0
 .../ossim/projection/ossimSmacCallibrationSystem.h |    0
 .../ossim/projection/ossimSonomaSensor.h           |    0
 .../ossimSpaceObliqueMercatorProjection.h          |    0
 .../projection/ossimSpectraboticsRedEdgeModel.h    |  100 +
 .../ossim/projection/ossimSpot5Model.h             |    0
 .../projection/ossimStatePlaneProjectionInfo.h     |    0
 .../projection/ossimStereographicProjection.h      |    0
 .../ossimTangentialRadialLensDistortion.h          |   66 +
 .../ossim/projection/ossimTiffProjectionFactory.h  |    0
 .../ossim/projection/ossimTranmerc.h               |    0
 .../projection/ossimTransCylEquAreaProjection.h    |    0
 .../projection/ossimTransMercatorProjection.h      |    0
 .../ossim/projection/ossimUps.h                    |    0
 .../ossim/projection/ossimUpsProjection.h          |    0
 .../ossim/projection/ossimUpspt.h                  |    0
 .../ossim/projection/ossimUtm.h                    |    0
 include/ossim/projection/ossimUtmProjection.h      |  228 +
 include/ossim/projection/ossimUtmpt.h              |   89 +
 .../projection/ossimVanDerGrintenProjection.h      |    0
 .../ossim/projection/ossimWarpProjection.h         |    0
 .../ossim/projection/ossimWktProjectionFactory.h   |   78 +
 include/ossim/sockets/ossimToolClient.h            |   88 +
 include/ossim/sockets/ossimToolServer.h            |   45 +
 .../ossim/support_data/ossimAigBounds.h            |    0
 .../ossim/support_data/ossimAigDataFileHeader.h    |    0
 .../ossim/support_data/ossimAigHeader.h            |    0
 .../ossim/support_data/ossimAigIndexFileHeader.h   |    0
 .../ossim/support_data/ossimAigStatistics.h        |    0
 .../support_data/ossimAlphaSensorSupportData.h     |    0
 include/ossim/support_data/ossimApplanixEOFile.h   |  213 +
 include/ossim/support_data/ossimAuxFileHandler.h   |  230 +
 .../ossim/support_data/ossimAuxXmlSupportData.h    |   93 +
 include/ossim/support_data/ossimCcfInfo.h          |   65 +
 .../ossim/support_data/ossimCeosData.h             |    0
 include/ossim/support_data/ossimDemGrid.h          |  109 +
 include/ossim/support_data/ossimDemHeader.h        |  387 +
 include/ossim/support_data/ossimDemInfo.h          |   63 +
 .../ossim/support_data/ossimDemPoint.h             |    0
 include/ossim/support_data/ossimDemProfile.h       |   97 +
 include/ossim/support_data/ossimDemStats.h         |   88 +
 include/ossim/support_data/ossimDemUtil.h          |   76 +
 include/ossim/support_data/ossimDoqq.h             |  135 +
 include/ossim/support_data/ossimDtedAcc.h          |  136 +
 include/ossim/support_data/ossimDtedDsi.h          |  239 +
 include/ossim/support_data/ossimDtedHdr.h          |  129 +
 include/ossim/support_data/ossimDtedInfo.h         |   92 +
 include/ossim/support_data/ossimDtedRecord.h       |  164 +
 include/ossim/support_data/ossimDtedUhl.h          |  132 +
 include/ossim/support_data/ossimDtedVol.h          |  110 +
 .../ossim/support_data/ossimERS.h                  |    0
 include/ossim/support_data/ossimEnviHeader.h       |  415 ++
 include/ossim/support_data/ossimEnviInfo.h         |   54 +
 include/ossim/support_data/ossimFfL5.h             |   43 +
 .../ossim/support_data/ossimFfL7.h                 |    0
 include/ossim/support_data/ossimFfRevb.h           |  290 +
 include/ossim/support_data/ossimFfRevc.h           |  346 +
 include/ossim/support_data/ossimFgdcTxtDoc.h       |  129 +
 include/ossim/support_data/ossimFgdcXmlDoc.h       |  188 +
 include/ossim/support_data/ossimGeoTiff.h          |  289 +
 include/ossim/support_data/ossimGmlSupportData.h   |  170 +
 include/ossim/support_data/ossimIkonosMetaData.h   |  120 +
 include/ossim/support_data/ossimInfoBase.h         |  105 +
 include/ossim/support_data/ossimInfoFactory.h      |   62 +
 .../ossim/support_data/ossimInfoFactoryInterface.h |   60 +
 .../ossim/support_data/ossimInfoFactoryRegistry.h  |  103 +
 include/ossim/support_data/ossimJ2kCodRecord.h     |  103 +
 include/ossim/support_data/ossimJ2kInfo.h          |  124 +
 include/ossim/support_data/ossimJ2kSizRecord.h     |  143 +
 include/ossim/support_data/ossimJ2kSotRecord.h     |   89 +
 include/ossim/support_data/ossimJ2kTlmRecord.h     |  219 +
 include/ossim/support_data/ossimJp2Info.h          |  134 +
 include/ossim/support_data/ossimJpipMessage.h      |   36 +
 .../ossim/support_data/ossimJpipMessageDecoder.h   |    0
 .../ossim/support_data/ossimJpipMessageHeader.h    |    0
 include/ossim/support_data/ossimLasHdr.h           |  187 +
 include/ossim/support_data/ossimLasInfo.h          |   57 +
 include/ossim/support_data/ossimLasPointRecord0.h  |  105 +
 include/ossim/support_data/ossimLasPointRecord1.h  |  106 +
 include/ossim/support_data/ossimLasPointRecord2.h  |  123 +
 include/ossim/support_data/ossimLasPointRecord3.h  |  124 +
 include/ossim/support_data/ossimLasPointRecord4.h  |  128 +
 .../support_data/ossimLasPointRecordInterface.h    |   49 +
 include/ossim/support_data/ossimNitfAcftbTag.h     |  403 ++
 include/ossim/support_data/ossimNitfAimidbTag.h    |  278 +
 include/ossim/support_data/ossimNitfBlockaTag.h    |  336 +
 include/ossim/support_data/ossimNitfCommon.h       |  182 +
 .../support_data/ossimNitfCompressionHeader.h      |   39 +
 include/ossim/support_data/ossimNitfCsccgaTag.h    |  146 +
 include/ossim/support_data/ossimNitfCscrnaTag.h    |  184 +
 include/ossim/support_data/ossimNitfCsdidaTag.h    |  209 +
 include/ossim/support_data/ossimNitfCsexraTag.h    |  477 ++
 .../ossim/support_data/ossimNitfCsproaTag.h        |    0
 .../support_data/ossimNitfDataExtensionSegment.h   |    0
 .../ossimNitfDataExtensionSegmentV2_0.h            |    0
 .../ossimNitfDataExtensionSegmentV2_1.h            |    0
 include/ossim/support_data/ossimNitfDesFactory.h   |   38 +
 .../support_data/ossimNitfDesFactoryRegistry.h     |   49 +
 .../ossim/support_data/ossimNitfDesInformation.h   |  134 +
 .../ossim/support_data/ossimNitfEmbeddedRpfDes.h   |   43 +
 include/ossim/support_data/ossimNitfEngrdaTag.h    |  215 +
 .../ossim/support_data/ossimNitfExoptaTag.h        |    0
 include/ossim/support_data/ossimNitfFile.h         |  127 +
 include/ossim/support_data/ossimNitfFileHeader.h   |  230 +
 .../ossim/support_data/ossimNitfFileHeaderV2_0.h   |  618 ++
 .../ossim/support_data/ossimNitfFileHeaderV2_1.h   |  649 ++
 .../ossim/support_data/ossimNitfFileHeaderV2_X.h   |  260 +
 .../support_data/ossimNitfGeoPositioningTag.h      |  229 +
 .../ossim/support_data/ossimNitfHistoaTag.h        |    0
 include/ossim/support_data/ossimNitfIchipbTag.h    |  567 ++
 include/ossim/support_data/ossimNitfImageBand.h    |   52 +
 .../ossim/support_data/ossimNitfImageBandV2_0.h    |  116 +
 .../ossim/support_data/ossimNitfImageBandV2_1.h    |   27 +
 .../support_data/ossimNitfImageDataMaskV2_1.h      |    0
 include/ossim/support_data/ossimNitfImageHeader.h  |  204 +
 .../ossim/support_data/ossimNitfImageHeaderV2_0.h  |  168 +
 .../ossim/support_data/ossimNitfImageHeaderV2_1.h  |  427 ++
 .../ossim/support_data/ossimNitfImageHeaderV2_X.h  |  948 +++
 include/ossim/support_data/ossimNitfImageLut.h     |   35 +
 .../ossim/support_data/ossimNitfImageLutV2_0.h     |    0
 .../ossim/support_data/ossimNitfImageLutV2_1.h     |    0
 include/ossim/support_data/ossimNitfInfo.h         |   69 +
 include/ossim/support_data/ossimNitfJ2klraTag.h    |  296 +
 .../ossim/support_data/ossimNitfLabelHeader.h      |    0
 .../ossim/support_data/ossimNitfLabelHeaderV2_0.h  |    0
 .../support_data/ossimNitfLocalCartographicTag.h   |    0
 .../support_data/ossimNitfLocalGeographicTag.h     |   81 +
 include/ossim/support_data/ossimNitfMstgtaTag.h    |  217 +
 .../support_data/ossimNitfNameConversionTables.h   |   29 +
 include/ossim/support_data/ossimNitfPiaimcTag.h    |  427 ++
 .../support_data/ossimNitfProjectionParameterTag.h |  332 +
 .../ossim/support_data/ossimNitfRegisteredDes.h    |  124 +
 .../support_data/ossimNitfRegisteredDesFactory.h   |   30 +
 .../ossim/support_data/ossimNitfRegisteredTag.h    |  126 +
 .../support_data/ossimNitfRegisteredTagFactory.h   |   30 +
 include/ossim/support_data/ossimNitfRpcATag.h      |   35 +
 include/ossim/support_data/ossimNitfRpcBTag.h      |   30 +
 include/ossim/support_data/ossimNitfRpcBase.h      |  545 ++
 .../ossim/support_data/ossimNitfRpfTagFactory.h    |   40 +
 .../ossim/support_data/ossimNitfRsmecaTag.h        |    0
 .../ossim/support_data/ossimNitfRsmidaTag.h        |    0
 .../ossim/support_data/ossimNitfRsmpcaTag.h        |    0
 .../ossim/support_data/ossimNitfRsmpiaTag.h        |    0
 include/ossim/support_data/ossimNitfSensraTag.h    |  268 +
 include/ossim/support_data/ossimNitfStdidcTag.h    |  203 +
 include/ossim/support_data/ossimNitfStreobTag.h    |  181 +
 .../ossim/support_data/ossimNitfSymbolHeader.h     |    0
 .../ossim/support_data/ossimNitfSymbolHeaderV2_0.h |    0
 .../ossim/support_data/ossimNitfTagFactory.h       |    0
 .../support_data/ossimNitfTagFactoryRegistry.h     |    0
 .../ossim/support_data/ossimNitfTagInformation.h   |  101 +
 .../ossim/support_data/ossimNitfTextHeader.h       |    0
 .../ossim/support_data/ossimNitfTextHeaderV2_0.h   |    0
 .../ossim/support_data/ossimNitfTextHeaderV2_1.h   |    0
 include/ossim/support_data/ossimNitfUnknownTag.h   |   84 +
 include/ossim/support_data/ossimNitfUse00aTag.h    |  282 +
 .../support_data/ossimNitfVqCompressionHeader.h    |   79 +
 .../support_data/ossimNitfXmlDataContentDes.h      |   64 +
 include/ossim/support_data/ossimNmeaMessage.h      |   86 +
 .../ossim/support_data/ossimNmeaMessageSequencer.h |    0
 .../ossim/support_data/ossimPpjFrameSensorFile.h   |    0
 .../ossim/support_data/ossimQuickbirdMetaData.h    |  132 +
 .../ossim/support_data/ossimQuickbirdRpcHeader.h   |    0
 .../ossim/support_data/ossimQuickbirdTile.h        |    0
 .../support_data/ossimRpfAttributeOffsetRecord.h   |  274 +
 .../ossimRpfAttributeSectionSubheader.h            |   53 +
 include/ossim/support_data/ossimRpfAttributes.h    |  370 +
 .../support_data/ossimRpfBoundaryRectRecord.h      |    0
 .../ossimRpfBoundaryRectSectionSubheader.h         |    0
 .../ossim/support_data/ossimRpfBoundaryRectTable.h |    0
 .../ossimRpfColorConverterOffsetRecord.h           |   61 +
 .../ossimRpfColorConverterSubsection.h             |   52 +
 .../support_data/ossimRpfColorConverterTable.h     |   44 +
 .../ossimRpfColorGrayscaleOffsetRecord.h           |   43 +
 .../support_data/ossimRpfColorGrayscaleSubheader.h |   52 +
 .../support_data/ossimRpfColorGrayscaleTable.h     |   49 +
 .../ossim/support_data/ossimRpfComponentIdLut.h    |    0
 .../ossimRpfCompressionLookupOffsetRecord.h        |   49 +
 .../support_data/ossimRpfCompressionSection.h      |   56 +
 .../ossimRpfCompressionSectionSubheader.h          |   62 +
 .../ossim/support_data/ossimRpfConstants.h         |    0
 .../ossim/support_data/ossimRpfCoverageSection.h   |  162 +
 include/ossim/support_data/ossimRpfFrame.h         |  207 +
 include/ossim/support_data/ossimRpfFrameEntry.h    |   61 +
 .../support_data/ossimRpfFrameFileIndexRecord.h    |    0
 .../ossimRpfFrameFileIndexSectionSubheader.h       |    0
 .../ossimRpfFrameFileIndexSubsection.h             |    0
 .../ossim/support_data/ossimRpfFrameFileReader.h   |    0
 include/ossim/support_data/ossimRpfHeader.h        |  181 +
 .../ossimRpfImageDescriptionSubheader.h            |  127 +
 .../ossimRpfImageDisplayParameterSubheader.h       |   60 +
 include/ossim/support_data/ossimRpfInfo.h          |   62 +
 .../ossim/support_data/ossimRpfLocationSection.h   |  167 +
 .../ossim/support_data/ossimRpfMaskSubheader.h     |    0
 .../ossim/support_data/ossimRpfMaskSubsection.h    |    0
 .../ossim/support_data/ossimRpfPathnameRecord.h    |    0
 .../support_data/ossimRpfReplaceUpdateRecord.h     |    0
 .../ossimRpfReplaceUpdateSectionSubheader.h        |    0
 .../support_data/ossimRpfReplaceUpdateTable.h      |    0
 include/ossim/support_data/ossimRpfToc.h           |  262 +
 include/ossim/support_data/ossimRpfTocEntry.h      |  113 +
 include/ossim/support_data/ossimRsmida.h           |  173 +
 include/ossim/support_data/ossimRsmpca.h           |  118 +
 include/ossim/support_data/ossimRsmpia.h           |   99 +
 .../ossim/support_data/ossimSpaceImagingGeom.h     |    0
 .../ossim/support_data/ossimSpotDimapSupportData.h |    0
 .../ossim/support_data/ossimSrcRecord.h            |    0
 .../ossim/support_data/ossimSrtmFilename.h         |    0
 include/ossim/support_data/ossimSrtmSupportData.h  |  206 +
 include/ossim/support_data/ossimSupportFilesList.h |   44 +
 include/ossim/support_data/ossimTiffInfo.h         |  638 ++
 include/ossim/support_data/ossimTiffWorld.h        |   80 +
 include/ossim/support_data/ossimWavelength.h       |  106 +
 include/ossim/support_data/ossimWkt.h              |  111 +
 include/ossim/support_data/ossimXmpInfo.h          |  120 +
 include/ossim/util/ossimAutRegUtil.h               |  288 +
 include/ossim/util/ossimBandMergeTool.h            |   46 +
 include/ossim/util/ossimBatchTest.h                |  148 +
 include/ossim/util/ossimChipProcTool.h             |  230 +
 include/ossim/util/ossimChipperUtil.h              |  823 +++
 .../ossim/util/ossimEquationUtil.h                 |    0
 include/ossim/util/ossimFileWalker.h               |  222 +
 include/ossim/util/ossimHillshadeTool.h            |   62 +
 include/ossim/util/ossimHlzTool.h                  |  141 +
 include/ossim/util/ossimImageUtil.h                |  510 ++
 include/ossim/util/ossimInfo.h                     |  791 ++
 include/ossim/util/ossimOrthoIgen.h                |  252 +
 include/ossim/util/ossimOrthoTool.h                |   57 +
 include/ossim/util/ossimPointCloudUtil.h           |   81 +
 include/ossim/util/ossimRpfUtil.h                  |   85 +
 include/ossim/util/ossimShorelineTool.h            |   90 +
 include/ossim/util/ossimSlopeTool.h                |   58 +
 include/ossim/util/ossimTool.h                     |  153 +
 include/ossim/util/ossimToolFactory.h              |   49 +
 include/ossim/util/ossimToolFactoryBase.h          |   43 +
 include/ossim/util/ossimToolRegistry.h             |   55 +
 include/ossim/util/ossimVerticesFinderTool.h       |   45 +
 include/ossim/util/ossimViewshedTool.h             |  175 +
 .../ossim/vec/ossimVpfBoundingRecordTable.h        |    0
 .../ossim/vec/ossimVpfCoverage.h                   |    0
 .../ossim/vec/ossimVpfDatabase.h                   |    0
 .../ossim/vec/ossimVpfDatabaseHeader.h             |    0
 .../vec/ossimVpfDatabaseHeaderTableValidator.h     |   17 +
 .../include => include}/ossim/vec/ossimVpfExtent.h |    0
 .../ossim/vec/ossimVpfFeatureClass.h               |    0
 .../ossim/vec/ossimVpfFeatureClassSchema.h         |    0
 .../ossim/vec/ossimVpfLibrary.h                    |    0
 .../vec/ossimVpfLibraryAttributeTableValidator.h   |    0
 .../include => include}/ossim/vec/ossimVpfTable.h  |    0
 include/ossim/vec/ossimVpfTableValidator.h         |   18 +
 include/ossim/vec/vpf.h                            |   35 +
 .../ossim/video/ossimVideoGeometry.h               |    0
 .../ossim/video/ossimVideoHandler.h                |    0
 .../ossim/video/ossimVideoImageHandler.h           |    0
 .../ossim/video/ossimVideoImageSource.h            |    0
 .../ossim/video/ossimVideoSource.h                 |    0
 .../include => include}/ossim/vpfutil/linklist.h   |    0
 {ossim/include => include}/ossim/vpfutil/machine.h |    0
 .../include => include}/ossim/vpfutil/mapgraph.h   |    0
 {ossim/include => include}/ossim/vpfutil/polygrf.h |    0
 .../include => include}/ossim/vpfutil/projectn.h   |    0
 .../include => include}/ossim/vpfutil/protomas.h   |    0
 {ossim/include => include}/ossim/vpfutil/set.h     |    0
 {ossim/include => include}/ossim/vpfutil/system.h  |    0
 {ossim/include => include}/ossim/vpfutil/values.h  |    0
 {ossim/include => include}/ossim/vpfutil/vpfapi.h  |    0
 {ossim/include => include}/ossim/vpfutil/vpfdisp.h |    0
 {ossim/include => include}/ossim/vpfutil/vpfdraw.h |    0
 {ossim/include => include}/ossim/vpfutil/vpfinit.h |    0
 {ossim/include => include}/ossim/vpfutil/vpfio.h   |    0
 {ossim/include => include}/ossim/vpfutil/vpfmisc.h |    0
 {ossim/include => include}/ossim/vpfutil/vpfprim.h |    0
 .../include => include}/ossim/vpfutil/vpfrelat.h   |    0
 .../include => include}/ossim/vpfutil/vpfselec.h   |    0
 .../include => include}/ossim/vpfutil/vpftable.h   |    0
 {ossim/include => include}/ossim/vpfutil/vpftidx.h |    0
 {ossim/include => include}/ossim/vpfutil/vpfview.h |    0
 {ossim/include => include}/ossim/vpfutil/xmemory.h |    0
 ossim-logo.png                                     |  Bin 0 -> 49002 bytes
 ossim/CMakeLists.txt                               |  273 -
 ossim/Doxyfile                                     | 1552 ----
 ossim/LICENSE.txt                                  |   23 -
 ossim/OSSIM_logo.png                               |  Bin 112233 -> 0 bytes
 ossim/README.txt                                   |  148 -
 ossim/doc/ossim.spec                               |   78 -
 ossim/etc/linux/profile.d/ossim.csh                |   18 -
 ossim/etc/linux/profile.d/ossim.sh                 |   19 -
 ossim/etc/templates/ossim_preferences_template     |  585 --
 .../ossim/base/ossim2dTo2dIdentityTransform.h      |   69 -
 .../ossim/base/ossim2dTo2dMatrixTransform.h        |  221 -
 .../include/ossim/base/ossim2dTo2dShiftTransform.h |  127 -
 ossim/include/ossim/base/ossim2dTo2dTransform.h    |   65 -
 .../ossim/base/ossim2dTo2dTransformFactory.h       |   45 -
 .../ossim/base/ossim2dTo2dTransformFactoryBase.h   |   50 -
 .../ossim/base/ossim2dTo2dTransformRegistry.h      |   85 -
 ossim/include/ossim/base/ossimArgumentParser.h     |  230 -
 ossim/include/ossim/base/ossimCallback1.h          |   82 -
 ossim/include/ossim/base/ossimCallback1wRet.h      |   82 -
 ossim/include/ossim/base/ossimCallback2wRet.h      |   83 -
 ossim/include/ossim/base/ossimColumnVector3d.h     |  292 -
 ossim/include/ossim/base/ossimCommon.h             |  661 --
 .../ossim/base/ossimConnectableDisplayListener.h   |  110 -
 ossim/include/ossim/base/ossimConnectableObject.h  |  601 --
 ossim/include/ossim/base/ossimConnectionEvent.h    |   80 -
 ossim/include/ossim/base/ossimConstants.h          |  545 --
 ossim/include/ossim/base/ossimContainerEvent.h     |   46 -
 ossim/include/ossim/base/ossimDataObject.h         |  116 -
 ossim/include/ossim/base/ossimDate.h               |  280 -
 ossim/include/ossim/base/ossimDateProperty.h       |   37 -
 ossim/include/ossim/base/ossimDblGrid.h            |  233 -
 ossim/include/ossim/base/ossimDirectory.h          |  106 -
 ossim/include/ossim/base/ossimDisplayInterface.h   |   41 -
 ossim/include/ossim/base/ossimDpt.h                |  166 -
 ossim/include/ossim/base/ossimDpt3d.h              |  149 -
 ossim/include/ossim/base/ossimDrect.h              |  860 ---
 ossim/include/ossim/base/ossimDuration.h           |  167 -
 ossim/include/ossim/base/ossimEcefPoint.h          |  220 -
 ossim/include/ossim/base/ossimEndian.h             |  273 -
 ossim/include/ossim/base/ossimEnvironmentUtility.h |   60 -
 .../include/ossim/base/ossimFactoryListInterface.h |  266 -
 .../ossim/base/ossimFileProcessorInterface.h       |   42 -
 ossim/include/ossim/base/ossimFilename.h           |  265 -
 ossim/include/ossim/base/ossimGeoTiffDatumLut.h    |   75 -
 ossim/include/ossim/base/ossimGeoidEgm96.h         |   66 -
 ossim/include/ossim/base/ossimGeoidImage.h         |  117 -
 ossim/include/ossim/base/ossimGeoidManager.h       |   87 -
 ossim/include/ossim/base/ossimGrect.h              |  311 -
 ossim/include/ossim/base/ossimHistogram.h          |  202 -
 ossim/include/ossim/base/ossimHistogramSource.h    |   58 -
 ossim/include/ossim/base/ossimHttpResponse.h       |   81 -
 ossim/include/ossim/base/ossimImageTypeLut.h       |   33 -
 ossim/include/ossim/base/ossimIoStream.h           |  236 -
 ossim/include/ossim/base/ossimKeywordNames.h       |  209 -
 ossim/include/ossim/base/ossimKeywordlist.h        |  529 --
 ossim/include/ossim/base/ossimListener.h           |   52 -
 ossim/include/ossim/base/ossimLookUpTable.h        |  117 -
 ossim/include/ossim/base/ossimMetadataInterface.h  |   46 -
 .../ossim/base/ossimMultiResLevelHistogram.h       |  103 -
 ossim/include/ossim/base/ossimNBandLutDataObject.h |  489 --
 ossim/include/ossim/base/ossimNormRgbVector.h      |  109 -
 ossim/include/ossim/base/ossimPointHash.h          |   29 -
 ossim/include/ossim/base/ossimPolyArea2d.h         |  151 -
 ossim/include/ossim/base/ossimPolygon.h            |  248 -
 ossim/include/ossim/base/ossimProcessListener.h    |   30 -
 .../include/ossim/base/ossimProcessProgressEvent.h |   52 -
 ossim/include/ossim/base/ossimPropertyInterface.h  |   41 -
 .../include/ossim/base/ossimRectanglePartitioner.h |  148 -
 .../ossim/base/ossimRectilinearDataObject.h        |  156 -
 ossim/include/ossim/base/ossimRefPtr.h             |   87 -
 ossim/include/ossim/base/ossimReferenced.h         |  107 -
 ossim/include/ossim/base/ossimRegExp.h             |  264 -
 ossim/include/ossim/base/ossimStdOutProgress.h     |   36 -
 ossim/include/ossim/base/ossimStreamFactory.h      |   38 -
 ossim/include/ossim/base/ossimStreamFactoryBase.h  |   36 -
 .../ossim/base/ossimStreamFactoryRegistry.h        |   40 -
 ossim/include/ossim/base/ossimString.h             |  936 ---
 ossim/include/ossim/base/ossimStringProperty.h     |   73 -
 ossim/include/ossim/base/ossimTempFilename.h       |   43 -
 .../base/ossimTieMeasurementGeneratorInterface.h   |   83 -
 ossim/include/ossim/base/ossimTileHash.h           |   47 -
 ossim/include/ossim/base/ossimTiledImageHash.h     |   41 -
 ossim/include/ossim/base/ossimTraceManager.h       |   70 -
 ossim/include/ossim/base/ossimUnitConversionTool.h |   81 -
 ossim/include/ossim/base/ossimVrect.h              |  168 -
 ossim/include/ossim/base/ossimWebRequest.h         |   26 -
 ossim/include/ossim/base/ossimXmlNode.h            |  128 -
 .../ossim/elevation/ossimDtedElevationDatabase.h   |   81 -
 ossim/include/ossim/elevation/ossimDtedFactory.h   |   39 -
 ossim/include/ossim/elevation/ossimDtedHandler.h   |  241 -
 ossim/include/ossim/elevation/ossimElevManager.h   |  184 -
 .../ossim/elevation/ossimElevSourceFactory.h       |   75 -
 .../ossim/elevation/ossimElevationCellDatabase.h   |  170 -
 .../ossim/elevation/ossimImageElevationDatabase.h  |  219 -
 .../ossim/elevation/ossimImageElevationHandler.h   |  135 -
 .../ossim/elevation/ossimSrtmElevationDatabase.h   |   84 -
 ossim/include/ossim/elevation/ossimSrtmFactory.h   |   58 -
 .../ossim/elevation/ossimTiledElevationDatabase.h  |  223 -
 ossim/include/ossim/font/ossimFontFactoryBase.h    |   42 -
 .../ossim/imaging/ossim3x3ConvolutionFilter.h      |   98 -
 ossim/include/ossim/imaging/ossimAOD.h             |   67 -
 ossim/include/ossim/imaging/ossimAdrgTileSource.h  |  197 -
 .../include/ossim/imaging/ossimAppFixedTileCache.h |  118 -
 ossim/include/ossim/imaging/ossimAppTileCache.h    |  171 -
 ossim/include/ossim/imaging/ossimAtCorrRemapper.h  |   89 -
 .../include/ossim/imaging/ossimBandAverageFilter.h |  111 -
 ossim/include/ossim/imaging/ossimBandClipFilter.h  |   93 -
 ossim/include/ossim/imaging/ossimBandMergeSource.h |   63 -
 ossim/include/ossim/imaging/ossimBandSelector.h    |  169 -
 .../ossim/imaging/ossimBandSeparateHandler.h       |   98 -
 .../include/ossim/imaging/ossimBitMaskTileSource.h |  134 -
 ossim/include/ossim/imaging/ossimBitMaskWriter.h   |  134 -
 ossim/include/ossim/imaging/ossimBlendMosaic.h     |   79 -
 ossim/include/ossim/imaging/ossimBrightnessMatch.h |   58 -
 .../ossim/imaging/ossimBumpShadeTileSource.h       |  284 -
 ossim/include/ossim/imaging/ossimCacheTileSource.h |   88 -
 .../ossim/imaging/ossimCastTileSourceFilter.h      |   94 -
 ossim/include/ossim/imaging/ossimCcfHead.h         |  188 -
 ossim/include/ossim/imaging/ossimCcfTileSource.h   |  233 -
 .../ossim/imaging/ossimCibCadrgTileSource.h        |  606 --
 .../ossim/imaging/ossimClosestToCenterCombiner.h   |   61 -
 ossim/include/ossim/imaging/ossimCodecBase.h       |   67 -
 ossim/include/ossim/imaging/ossimCodecFactory.h    |   74 -
 .../ossim/imaging/ossimCodecFactoryInterface.h     |   91 -
 .../ossim/imaging/ossimColorNormalizedFusion.h     |   33 -
 .../ossim/imaging/ossimConvolutionFilter1D.h       |  125 -
 .../include/ossim/imaging/ossimConvolutionSource.h |   73 -
 ossim/include/ossim/imaging/ossimDespeckleFilter.h |   49 -
 ossim/include/ossim/imaging/ossimDilationFilter.h  |   74 -
 ossim/include/ossim/imaging/ossimDoqqTileSource.h  |   59 -
 ossim/include/ossim/imaging/ossimDtedTileSource.h  |  260 -
 ossim/include/ossim/imaging/ossimERSTileSource.h   |   57 -
 ossim/include/ossim/imaging/ossimEdgeFilter.h      |   84 -
 ossim/include/ossim/imaging/ossimElevImageSource.h |  147 -
 .../ossim/imaging/ossimEnviHeaderFileWriter.h      |   79 -
 ossim/include/ossim/imaging/ossimEnviTileSource.h  |  102 -
 .../include/ossim/imaging/ossimEquationCombiner.h  |  324 -
 ossim/include/ossim/imaging/ossimFeatherMosaic.h   |   88 -
 ossim/include/ossim/imaging/ossimFftFilter.h       |   87 -
 ossim/include/ossim/imaging/ossimFgdcFileWriter.h  |  158 -
 ossim/include/ossim/imaging/ossimFilterResampler.h |  152 -
 ossim/include/ossim/imaging/ossimFilterTable.h     |   98 -
 ossim/include/ossim/imaging/ossimFixedTileCache.h  |  147 -
 ossim/include/ossim/imaging/ossimFusionCombiner.h  |   48 -
 ossim/include/ossim/imaging/ossimGammaRemapper.h   |   72 -
 .../include/ossim/imaging/ossimGeneralRasterInfo.h |  432 --
 .../ossim/imaging/ossimGeneralRasterTileSource.h   |  213 -
 .../ossim/imaging/ossimGeoAnnotationBitmap.h       |   55 -
 ossim/include/ossim/imaging/ossimGeomFileWriter.h  |   58 -
 .../ossim/imaging/ossimGpkgWriterInterface.h       |   73 -
 ossim/include/ossim/imaging/ossimGridRemapEngine.h |   71 -
 ossim/include/ossim/imaging/ossimGridRemapSource.h |  145 -
 .../ossim/imaging/ossimHistoMatchRemapper.h        |   98 -
 .../ossim/imaging/ossimHistogramEqualization.h     |  100 -
 .../include/ossim/imaging/ossimHistogramRemapper.h |  574 --
 .../ossim/imaging/ossimHistogramThreshholdFilter.h |   52 -
 ossim/include/ossim/imaging/ossimHsiRemapper.h     |  257 -
 ossim/include/ossim/imaging/ossimHsiToRgbSource.h  |   50 -
 .../ossim/imaging/ossimHsvGridRemapEngine.h        |   55 -
 ossim/include/ossim/imaging/ossimHsvToRgbSource.h  |   43 -
 ossim/include/ossim/imaging/ossimImageChain.h      |  417 --
 ossim/include/ossim/imaging/ossimImageData.h       | 1275 ----
 .../include/ossim/imaging/ossimImageDataFactory.h  |   64 -
 ossim/include/ossim/imaging/ossimImageFileWriter.h |  499 --
 .../ossim/imaging/ossimImageGaussianFilter.h       |   81 -
 ossim/include/ossim/imaging/ossimImageGeometry.h   |  473 --
 .../ossim/imaging/ossimImageGeometryFactory.h      |   54 -
 .../ossim/imaging/ossimImageGeometryFactoryBase.h  |   45 -
 .../ossim/imaging/ossimImageGeometryRegistry.h     |   75 -
 ossim/include/ossim/imaging/ossimImageHandler.h    |  788 --
 .../ossim/imaging/ossimImageHandlerFactory.h       |   94 -
 .../ossim/imaging/ossimImageHandlerFactoryBase.h   |  110 -
 .../ossim/imaging/ossimImageHandlerRegistry.h      |  157 -
 .../ossim/imaging/ossimImageHistogramSource.h      |  106 -
 ossim/include/ossim/imaging/ossimImageMetaData.h   |  139 -
 .../imaging/ossimImageMetaDataWriterFactory.h      |   88 -
 .../imaging/ossimImageMetaDataWriterFactoryBase.h  |   68 -
 .../imaging/ossimImageMetaDataWriterRegistry.h     |   99 -
 ossim/include/ossim/imaging/ossimImageModel.h      |  190 -
 ossim/include/ossim/imaging/ossimImageMosaic.h     |   74 -
 ossim/include/ossim/imaging/ossimImageRenderer.h   |  500 --
 .../ossim/imaging/ossimImageSharpenFilter.h        |   84 -
 ossim/include/ossim/imaging/ossimImageSource.h     |  247 -
 .../include/ossim/imaging/ossimImageSourceFilter.h |   67 -
 .../ossim/imaging/ossimImageSourceSequencer.h      |  168 -
 .../ossim/imaging/ossimImageToPlaneNormalFilter.h  |   75 -
 .../ossim/imaging/ossimImageWriterFactory.h        |   64 -
 .../imaging/ossimImageWriterFactoryRegistry.h      |   90 -
 .../ossim/imaging/ossimIndexToRgbLutFilter.h       |  176 -
 .../ossim/imaging/ossimIntensityAdjustmentFilter.h |   75 -
 ossim/include/ossim/imaging/ossimJpegCodec.h       |  134 -
 .../include/ossim/imaging/ossimJpegDefaultTable.h  |  163 -
 ossim/include/ossim/imaging/ossimJpegMemDest.h     |   36 -
 ossim/include/ossim/imaging/ossimJpegMemSrc.h      |   43 -
 ossim/include/ossim/imaging/ossimJpegStdIOSrc.h    |   29 -
 ossim/include/ossim/imaging/ossimJpegTileSource.h  |  216 -
 .../ossim/imaging/ossimJpegYCbCrToRgbSource.h      |   38 -
 .../ossim/imaging/ossimMapCompositionSource.h      |  337 -
 ossim/include/ossim/imaging/ossimMaskFilter.h      |  267 -
 ossim/include/ossim/imaging/ossimMaxMosaic.h       |   79 -
 .../include/ossim/imaging/ossimMeanMedianFilter.h  |  130 -
 .../ossim/imaging/ossimMetadataFileWriter.h        |  177 -
 .../ossim/imaging/ossimMonoGridRemapEngine.h       |   55 -
 .../ossim/imaging/ossimNBandToIndexFilter.h        |  130 -
 ossim/include/ossim/imaging/ossimNitf20Writer.h    |  136 -
 ossim/include/ossim/imaging/ossimNitfTileSource.h  |  544 --
 .../include/ossim/imaging/ossimNitfTileSource_12.h |   42 -
 ossim/include/ossim/imaging/ossimNitfWriter.h      |  173 -
 ossim/include/ossim/imaging/ossimNitfWriterBase.h  |  184 -
 .../ossim/imaging/ossimNormalizedRemapTable.h      |   85 -
 .../ossim/imaging/ossimNormalizedS16RemapTable.h   |  147 -
 .../ossim/imaging/ossimNormalizedU11RemapTable.h   |  118 -
 .../ossim/imaging/ossimNormalizedU16RemapTable.h   |  117 -
 .../ossim/imaging/ossimNormalizedU8RemapTable.h    |  117 -
 .../include/ossim/imaging/ossimOrthoImageMosaic.h  |   62 -
 .../ossim/imaging/ossimOverviewBuilderBase.h       |  241 -
 .../include/ossim/imaging/ossimPiecewiseRemapper.h |  262 -
 ossim/include/ossim/imaging/ossimPixelFlipper.h    |  273 -
 ossim/include/ossim/imaging/ossimPolyCutter.h      |  109 -
 .../ossim/imaging/ossimQbTileFilesHandler.h        |   45 -
 .../ossim/imaging/ossimQuickbirdNitfTileSource.h   |   45 -
 .../ossim/imaging/ossimQuickbirdTiffTileSource.h   |   37 -
 ossim/include/ossim/imaging/ossimRLevelFilter.h    |  100 -
 .../ossim/imaging/ossimRangeDomeTileSource.h       |  122 -
 .../include/ossim/imaging/ossimReadmeFileWriter.h  |   58 -
 .../ossim/imaging/ossimRectangleCutFilter.h        |   58 -
 .../ossim/imaging/ossimRgbGridRemapEngine.h        |   55 -
 ossim/include/ossim/imaging/ossimRgbToGreyFilter.h |   71 -
 ossim/include/ossim/imaging/ossimRgbToHsiSource.h  |   48 -
 ossim/include/ossim/imaging/ossimRgbToHsvSource.h  |   48 -
 .../include/ossim/imaging/ossimRgbToIndexFilter.h  |   97 -
 .../ossim/imaging/ossimRgbToJpegYCbCrSource.h      |   33 -
 ossim/include/ossim/imaging/ossimS16ImageData.h    |  185 -
 ossim/include/ossim/imaging/ossimSFIMFusion.h      |   86 -
 ossim/include/ossim/imaging/ossimScalarRemapper.h  |  107 -
 ossim/include/ossim/imaging/ossimScaleFilter.h     |  185 -
 ossim/include/ossim/imaging/ossimShiftFilter.h     |  106 -
 .../include/ossim/imaging/ossimSingleImageChain.h  |  557 --
 ossim/include/ossim/imaging/ossimSrtmTileSource.h  |   75 -
 .../ossim/imaging/ossimStreamReaderInterface.h     |   53 -
 .../ossim/imaging/ossimSubImageTileSource.h        |   91 -
 ossim/include/ossim/imaging/ossimTableRemapper.h   |   96 -
 .../ossim/imaging/ossimTiffOverviewBuilder.h       |  304 -
 ossim/include/ossim/imaging/ossimTiffTileSource.h  |  365 -
 ossim/include/ossim/imaging/ossimTileCache.h       |  106 -
 ossim/include/ossim/imaging/ossimTilePatch.h       |  137 -
 .../include/ossim/imaging/ossimTiledImageHandler.h |  161 -
 ossim/include/ossim/imaging/ossimTiling.h          |  201 -
 ossim/include/ossim/imaging/ossimTilingPoly.h      |   97 -
 ossim/include/ossim/imaging/ossimTilingRect.h      |   68 -
 .../imaging/ossimTopographicCorrectionFilter.h     |  225 -
 ossim/include/ossim/imaging/ossimTrimFilter.h      |   72 -
 ossim/include/ossim/imaging/ossimTwoColorView.h    |  106 -
 ossim/include/ossim/imaging/ossimU11ImageData.h    |  189 -
 ossim/include/ossim/imaging/ossimU16ImageData.h    |  193 -
 ossim/include/ossim/imaging/ossimU8ImageData.h     |  176 -
 .../include/ossim/imaging/ossimUsgsDemTileSource.h |  195 -
 .../imaging/ossimValueAssignImageSourceFilter.h    |  103 -
 .../ossim/imaging/ossimVpfAnnotationCoverageInfo.h |   78 -
 .../ossim/imaging/ossimVpfAnnotationFeatureInfo.h  |  230 -
 ossim/include/ossim/imaging/ossimVpfTileSource.h   |  165 -
 ossim/include/ossim/imaging/ossimWatermarkFilter.h |  348 -
 ossim/include/ossim/init/ossimInit.h               |  152 -
 ossim/include/ossim/ossimConfig.h.in               |   23 -
 ossim/include/ossim/ossimConfig.h.vc               |   54 -
 ossim/include/ossim/parallel/ossimIgen.h           |   72 -
 .../ossim/parallel/ossimImageChainMtAdaptor.h      |  123 -
 .../ossim/parallel/ossimImageHandlerMtAdaptor.h    |  101 -
 .../ossimImageMpiMWriterSequenceConnection.h       |   61 -
 .../ossimImageMpiSWriterSequenceConnection.h       |   54 -
 .../ossim/parallel/ossimMultiThreadSequencer.h     |  142 -
 ossim/include/ossim/parallel/ossimOrthoIgen.h      |  253 -
 ossim/include/ossim/plugin/ossimDynamicLibrary.h   |   67 -
 .../point_cloud/ossimGenericPointCloudHandler.h    |   41 -
 ossim/include/ossim/point_cloud/ossimPointBlock.h  |   98 -
 .../ossim/point_cloud/ossimPointCloudGeometry.h    |   89 -
 .../ossim/point_cloud/ossimPointCloudHandler.h     |   98 -
 .../point_cloud/ossimPointCloudHandlerFactory.h    |   44 -
 .../point_cloud/ossimPointCloudHandlerRegistry.h   |   58 -
 .../point_cloud/ossimPointCloudImageHandler.h      |  255 -
 .../ossim/point_cloud/ossimPointCloudSource.h      |   84 -
 ossim/include/ossim/point_cloud/ossimPointRecord.h |   91 -
 ossim/include/ossim/projection/ossimAdjMapModel.h  |  138 -
 .../ossim/projection/ossimApplanixEcefModel.h      |  102 -
 .../ossim/projection/ossimApplanixUtmModel.h       |   83 -
 .../ossim/projection/ossimCadrgProjection.h        |   91 -
 .../ossim/projection/ossimCoarseGridModel.h        |  185 -
 .../ossim/projection/ossimEpsgProjectionDatabase.h |  132 -
 .../ossim/projection/ossimGoogleProjection.h       |   35 -
 .../include/ossim/projection/ossimIkonosRpcModel.h |   77 -
 .../ossim/projection/ossimImageProjectionModel.h   |   62 -
 .../projection/ossimImageViewAffineTransform.h     |  188 -
 .../projection/ossimImageViewProjectionTransform.h |  104 -
 .../include/ossim/projection/ossimLensDistortion.h |   52 -
 .../ossim/projection/ossimMapProjectionFactory.h   |   67 -
 .../ossim/projection/ossimMapProjectionInfo.h      |  277 -
 .../projection/ossimMeanRadialLensDistortion.h     |  119 -
 .../ossim/projection/ossimNgaProjectionFactory.h   |   66 -
 ossim/include/ossim/projection/ossimNitfRpcModel.h |  116 -
 ossim/include/ossim/projection/ossimNitfRsmModel.h |   92 -
 .../ossim/projection/ossimQuickbirdRpcModel.h      |   86 -
 .../include/ossim/projection/ossimRpcProjection.h  |  238 -
 ossim/include/ossim/projection/ossimRpcSolver.h    |  244 -
 ossim/include/ossim/projection/ossimRsmModel.h     |  166 -
 ossim/include/ossim/projection/ossimSarModel.h     |  344 -
 ossim/include/ossim/projection/ossimSensorModel.h  |  393 -
 .../include/ossim/projection/ossimUtmProjection.h  |  217 -
 ossim/include/ossim/projection/ossimUtmpt.h        |   90 -
 .../ossim/projection/ossimWktProjectionFactory.h   |   76 -
 .../ossim/support_data/ossimApplanixEOFile.h       |  211 -
 .../ossim/support_data/ossimAuxFileHandler.h       |  231 -
 .../ossim/support_data/ossimAuxXmlSupportData.h    |   94 -
 ossim/include/ossim/support_data/ossimCcfInfo.h    |   61 -
 ossim/include/ossim/support_data/ossimDemGrid.h    |  110 -
 ossim/include/ossim/support_data/ossimDemHeader.h  |  384 -
 ossim/include/ossim/support_data/ossimDemInfo.h    |   59 -
 ossim/include/ossim/support_data/ossimDemProfile.h |   97 -
 ossim/include/ossim/support_data/ossimDemStats.h   |   89 -
 ossim/include/ossim/support_data/ossimDemUtil.h    |   83 -
 ossim/include/ossim/support_data/ossimDoqq.h       |  127 -
 ossim/include/ossim/support_data/ossimDtedAcc.h    |  135 -
 ossim/include/ossim/support_data/ossimDtedDsi.h    |  238 -
 ossim/include/ossim/support_data/ossimDtedHdr.h    |  128 -
 ossim/include/ossim/support_data/ossimDtedInfo.h   |   78 -
 ossim/include/ossim/support_data/ossimDtedRecord.h |  165 -
 ossim/include/ossim/support_data/ossimDtedUhl.h    |  131 -
 ossim/include/ossim/support_data/ossimDtedVol.h    |  110 -
 ossim/include/ossim/support_data/ossimEnviHeader.h |  415 --
 ossim/include/ossim/support_data/ossimEnviInfo.h   |   55 -
 ossim/include/ossim/support_data/ossimFfL5.h       |   47 -
 ossim/include/ossim/support_data/ossimFfRevb.h     |  291 -
 ossim/include/ossim/support_data/ossimFfRevc.h     |  347 -
 ossim/include/ossim/support_data/ossimFgdcTxtDoc.h |  130 -
 ossim/include/ossim/support_data/ossimFgdcXmlDoc.h |  189 -
 ossim/include/ossim/support_data/ossimGeoTiff.h    |  290 -
 .../ossim/support_data/ossimGmlSupportData.h       |  118 -
 .../ossim/support_data/ossimIkonosMetaData.h       |  121 -
 ossim/include/ossim/support_data/ossimInfoBase.h   |   84 -
 .../include/ossim/support_data/ossimInfoFactory.h  |   60 -
 .../ossim/support_data/ossimInfoFactoryInterface.h |   81 -
 .../ossim/support_data/ossimInfoFactoryRegistry.h  |   89 -
 .../include/ossim/support_data/ossimJ2kCodRecord.h |   96 -
 ossim/include/ossim/support_data/ossimJ2kInfo.h    |  125 -
 .../include/ossim/support_data/ossimJ2kSizRecord.h |  131 -
 .../include/ossim/support_data/ossimJ2kSotRecord.h |   85 -
 ossim/include/ossim/support_data/ossimJp2Info.h    |  135 -
 .../include/ossim/support_data/ossimJpipMessage.h  |   36 -
 ossim/include/ossim/support_data/ossimLasHdr.h     |  188 -
 ossim/include/ossim/support_data/ossimLasInfo.h    |   58 -
 .../include/ossim/support_data/ossimNitfAcftbTag.h |  404 --
 .../ossim/support_data/ossimNitfAimidbTag.h        |  279 -
 .../ossim/support_data/ossimNitfBlockaTag.h        |  335 -
 ossim/include/ossim/support_data/ossimNitfCommon.h |  183 -
 .../support_data/ossimNitfCompressionHeader.h      |   36 -
 .../ossim/support_data/ossimNitfCsccgaTag.h        |  145 -
 .../ossim/support_data/ossimNitfCscrnaTag.h        |  185 -
 .../ossim/support_data/ossimNitfCsdidaTag.h        |  210 -
 .../ossim/support_data/ossimNitfCsexraTag.h        |  478 --
 .../ossim/support_data/ossimNitfEmbeddedRpfDes.h   |   44 -
 .../ossim/support_data/ossimNitfEngrdaTag.h        |  149 -
 ossim/include/ossim/support_data/ossimNitfFile.h   |   93 -
 .../ossim/support_data/ossimNitfFileHeader.h       |  220 -
 .../ossim/support_data/ossimNitfFileHeaderV2_0.h   |  612 --
 .../ossim/support_data/ossimNitfFileHeaderV2_1.h   |  641 --
 .../ossim/support_data/ossimNitfFileHeaderV2_X.h   |  255 -
 .../support_data/ossimNitfGeoPositioningTag.h      |  230 -
 .../ossim/support_data/ossimNitfIchipbTag.h        |  565 --
 .../ossim/support_data/ossimNitfImageBand.h        |   51 -
 .../ossim/support_data/ossimNitfImageBandV2_0.h    |  113 -
 .../ossim/support_data/ossimNitfImageBandV2_1.h    |   27 -
 .../ossim/support_data/ossimNitfImageHeader.h      |  181 -
 .../ossim/support_data/ossimNitfImageHeaderV2_0.h  |  165 -
 .../ossim/support_data/ossimNitfImageHeaderV2_1.h  |  428 --
 .../ossim/support_data/ossimNitfImageHeaderV2_X.h  |  946 ---
 .../include/ossim/support_data/ossimNitfImageLut.h |   35 -
 ossim/include/ossim/support_data/ossimNitfInfo.h   |   60 -
 .../ossim/support_data/ossimNitfJ2klraTag.h        |  177 -
 .../support_data/ossimNitfLocalGeographicTag.h     |   81 -
 .../ossim/support_data/ossimNitfMstgtaTag.h        |  218 -
 .../support_data/ossimNitfNameConversionTables.h   |   30 -
 .../ossim/support_data/ossimNitfPiaimcTag.h        |  428 --
 .../support_data/ossimNitfProjectionParameterTag.h |  333 -
 .../ossim/support_data/ossimNitfRegisteredTag.h    |  125 -
 .../support_data/ossimNitfRegisteredTagFactory.h   |   30 -
 .../include/ossim/support_data/ossimNitfRpcATag.h  |   35 -
 .../include/ossim/support_data/ossimNitfRpcBTag.h  |   30 -
 .../include/ossim/support_data/ossimNitfRpcBase.h  |  544 --
 .../ossim/support_data/ossimNitfRpfTagFactory.h    |   40 -
 .../ossim/support_data/ossimNitfSensraTag.h        |  269 -
 .../ossim/support_data/ossimNitfStdidcTag.h        |  204 -
 .../ossim/support_data/ossimNitfTagInformation.h   |   99 -
 .../ossim/support_data/ossimNitfUnknownTag.h       |   84 -
 .../ossim/support_data/ossimNitfUse00aTag.h        |  283 -
 .../support_data/ossimNitfVqCompressionHeader.h    |   79 -
 .../include/ossim/support_data/ossimNmeaMessage.h  |   87 -
 .../ossim/support_data/ossimQuickbirdMetaData.h    |  130 -
 .../support_data/ossimRpfAttributeOffsetRecord.h   |  275 -
 .../ossimRpfAttributeSectionSubheader.h            |   53 -
 .../ossim/support_data/ossimRpfAttributes.h        |  371 -
 .../ossimRpfColorConverterOffsetRecord.h           |   61 -
 .../ossimRpfColorConverterSubsection.h             |   52 -
 .../support_data/ossimRpfColorConverterTable.h     |   45 -
 .../ossimRpfColorGrayscaleOffsetRecord.h           |   44 -
 .../support_data/ossimRpfColorGrayscaleSubheader.h |   52 -
 .../support_data/ossimRpfColorGrayscaleTable.h     |   51 -
 .../ossimRpfCompressionLookupOffsetRecord.h        |   48 -
 .../support_data/ossimRpfCompressionSection.h      |   57 -
 .../ossimRpfCompressionSectionSubheader.h          |   63 -
 .../ossim/support_data/ossimRpfCoverageSection.h   |  163 -
 ossim/include/ossim/support_data/ossimRpfFrame.h   |  208 -
 .../ossim/support_data/ossimRpfFrameEntry.h        |   62 -
 ossim/include/ossim/support_data/ossimRpfHeader.h  |  182 -
 .../ossimRpfImageDescriptionSubheader.h            |  128 -
 .../ossimRpfImageDisplayParameterSubheader.h       |   60 -
 ossim/include/ossim/support_data/ossimRpfInfo.h    |   63 -
 .../ossim/support_data/ossimRpfLocationSection.h   |  168 -
 ossim/include/ossim/support_data/ossimRpfToc.h     |  230 -
 .../include/ossim/support_data/ossimRpfTocEntry.h  |  114 -
 .../ossim/support_data/ossimSrtmSupportData.h      |  204 -
 .../ossim/support_data/ossimSupportFilesList.h     |   45 -
 ossim/include/ossim/support_data/ossimTiffInfo.h   |  772 --
 ossim/include/ossim/support_data/ossimTiffWorld.h  |   81 -
 ossim/include/ossim/support_data/ossimWavelength.h |  107 -
 ossim/include/ossim/support_data/ossimWkt.h        |  112 -
 ossim/include/ossim/support_data/ossimXmpInfo.h    |  121 -
 ossim/include/ossim/util/ossimAutRegUtil.h         |  289 -
 ossim/include/ossim/util/ossimBatchTest.h          |  146 -
 ossim/include/ossim/util/ossimChipperUtil.h        |  768 --
 ossim/include/ossim/util/ossimFileWalker.h         |  223 -
 ossim/include/ossim/util/ossimHLZUtil.h            |  182 -
 ossim/include/ossim/util/ossimImageUtil.h          |  504 --
 ossim/include/ossim/util/ossimInfo.h               |  698 --
 ossim/include/ossim/util/ossimRpfUtil.h            |   86 -
 ossim/include/ossim/util/ossimSlopeUtil.h          |   67 -
 ossim/include/ossim/util/ossimViewshedUtil.h       |  198 -
 .../vec/ossimVpfDatabaseHeaderTableValidator.h     |   18 -
 ossim/include/ossim/vec/ossimVpfTableValidator.h   |   19 -
 ossim/include/ossim/vec/vpf.h                      |   36 -
 ossim/ossim_header.txt                             |    8 -
 ossim/packaging/pkgconfig/ossim.pc.in              |   14 -
 .../projection/ossim_epsg_projections-v7_4.csv     | 3252 ---------
 .../ossim/templates/ossim_preferences_template     |  585 --
 ossim/share/ossim/util/ossimHlzApi.json            |   96 -
 ossim/share/ossim/util/ossimViewshedApi.json       |   86 -
 ossim/src/apps/CMakeLists.txt                      |    7 -
 ossim/src/apps/curl_apps/CMakeLists.txt            |   73 -
 ossim/src/apps/curl_apps/omar-data-mgr.cpp         |   72 -
 ossim/src/apps/curl_apps/omarDataMgrUtil.cpp       |  942 ---
 ossim/src/apps/curl_apps/omarDataMgrUtil.h         |  269 -
 ossim/src/apps/ossim-adrg-dump/Makefile            |    3 -
 ossim/src/apps/ossim-applanix2ogeom/Makefile       |    3 -
 ossim/src/apps/ossim-applanix2ogeom/makefile.vc    |   11 -
 .../ossim-applanix2ogeom/ossim-applanix2ogeom.cpp  |  323 -
 ossim/src/apps/ossim-autreg/ossim-autreg.cpp       |   97 -
 ossim/src/apps/ossim-band-merge/Makefile           |    5 -
 ossim/src/apps/ossim-band-merge/makefile.vc        |    9 -
 .../src/apps/ossim-band-merge/ossim-band-merge.cpp |  327 -
 ossim/src/apps/ossim-batch-test/CMakeLists.txt     |    2 -
 .../src/apps/ossim-batch-test/ossim-batch-test.cpp |   55 -
 ossim/src/apps/ossim-btoa/Makefile                 |    3 -
 ossim/src/apps/ossim-btoa/makefile.vc              |   11 -
 ossim/src/apps/ossim-chgkwval/Makefile             |    3 -
 ossim/src/apps/ossim-chgkwval/makefile.vc          |   11 -
 ossim/src/apps/ossim-chipper/ossim-chipper.cpp     |   92 -
 ossim/src/apps/ossim-cmm/Makefile                  |    3 -
 ossim/src/apps/ossim-cmm/makefile.vc               |   11 -
 ossim/src/apps/ossim-computeSrtmStats/Makefile     |    3 -
 ossim/src/apps/ossim-computeSrtmStats/makefile.vc  |   11 -
 .../ossim-computeSrtmStats.cpp                     |  108 -
 ossim/src/apps/ossim-correl/Makefile               |    3 -
 ossim/src/apps/ossim-correl/makefile.vc            |   11 -
 ossim/src/apps/ossim-create-cg/Makefile            |    3 -
 ossim/src/apps/ossim-create-cg/makefile.vc         |   11 -
 ossim/src/apps/ossim-create-cg/ossim-create-cg.cpp |  144 -
 ossim/src/apps/ossim-create-histo/Makefile         |    3 -
 ossim/src/apps/ossim-create-histo/makefile.vc      |   11 -
 .../apps/ossim-create-histo/ossim-create-histo.cpp |  300 -
 ossim/src/apps/ossim-deg2dms/Makefile              |   43 -
 ossim/src/apps/ossim-deg2dms/makefile.vc           |   11 -
 ossim/src/apps/ossim-deg2dms/ossim-deg2dms.cpp     |  113 -
 ossim/src/apps/ossim-dms2deg/Makefile              |   43 -
 ossim/src/apps/ossim-dms2deg/makefile.vc           |   11 -
 ossim/src/apps/ossim-dms2deg/ossim-dms2deg.cpp     |  167 -
 ossim/src/apps/ossim-dump-ocg/Makefile             |    2 -
 ossim/src/apps/ossim-dump-ocg/makefile.vc          |   11 -
 ossim/src/apps/ossim-equation/Makefile             |    3 -
 ossim/src/apps/ossim-equation/makefile.vc          |   11 -
 ossim/src/apps/ossim-extract-vertices/Makefile     |    3 -
 ossim/src/apps/ossim-extract-vertices/makefile.vc  |   11 -
 ossim/src/apps/ossim-hlz/CMakeLists.txt            |    2 -
 ossim/src/apps/ossim-hlz/Makefile                  |    3 -
 ossim/src/apps/ossim-hlz/makefile.vc               |   11 -
 ossim/src/apps/ossim-hlz/ossim-hlz.cpp             |   58 -
 ossim/src/apps/ossim-icp/Makefile                  |    3 -
 ossim/src/apps/ossim-icp/makefile.vc               |   11 -
 ossim/src/apps/ossim-icp/ossim-icp.cpp             |  747 --
 ossim/src/apps/ossim-igen/Makefile                 |    3 -
 ossim/src/apps/ossim-igen/makefile.vc              |   11 -
 .../ossim-image-compare/ossim-image-compare.cpp    |  154 -
 ossim/src/apps/ossim-image-synth/Makefile          |    3 -
 ossim/src/apps/ossim-image-synth/makefile.vc       |   11 -
 .../apps/ossim-image-synth/ossim-image-synth.cpp   |  184 -
 ossim/src/apps/ossim-img2md/Makefile               |    4 -
 ossim/src/apps/ossim-img2md/makefile.vc            |   11 -
 ossim/src/apps/ossim-img2md/ossim-img2md.cpp       |  160 -
 ossim/src/apps/ossim-img2rr/Makefile               |    3 -
 ossim/src/apps/ossim-img2rr/makefile.vc            |   11 -
 ossim/src/apps/ossim-info/Makefile                 |    3 -
 ossim/src/apps/ossim-info/makefile.vc              |   11 -
 ossim/src/apps/ossim-info/ossim-info.cpp           |   71 -
 ossim/src/apps/ossim-modopt/Makefile               |    3 -
 ossim/src/apps/ossim-modopt/makefile.vc            |   11 -
 ossim/src/apps/ossim-mosaic/Makefile               |    3 -
 ossim/src/apps/ossim-mosaic/makefile.vc            |   11 -
 ossim/src/apps/ossim-mosaic/ossim-mosaic.cpp       |  539 --
 ossim/src/apps/ossim-ogeom2ogeom/Makefile          |    3 -
 ossim/src/apps/ossim-ogeom2ogeom/makefile.vc       |   11 -
 ossim/src/apps/ossim-orthoigen/Makefile            |    3 -
 ossim/src/apps/ossim-orthoigen/makefile.vc         |   11 -
 ossim/src/apps/ossim-orthoigen/ossim-orthoigen.cpp |  168 -
 ossim/src/apps/ossim-pc2dem/Makefile               |    3 -
 ossim/src/apps/ossim-pc2dem/makefile.vc            |   11 -
 ossim/src/apps/ossim-pixelflip/Makefile            |    3 -
 ossim/src/apps/ossim-pixelflip/makefile.vc         |   11 -
 ossim/src/apps/ossim-pixelflip/ossim-pixelflip.cpp |  419 --
 ossim/src/apps/ossim-preproc/ossim-preproc.cpp     |   87 -
 ossim/src/apps/ossim-prune/Makefile                |    3 -
 ossim/src/apps/ossim-prune/makefile.vc             |   11 -
 ossim/src/apps/ossim-prune/ossim-prune.cpp         |  133 -
 ossim/src/apps/ossim-rejout/Makefile               |    3 -
 ossim/src/apps/ossim-rejout/makefile.vc            |   11 -
 ossim/src/apps/ossim-rpf/Makefile                  |    3 -
 ossim/src/apps/ossim-rpf/makefile.vc               |   11 -
 ossim/src/apps/ossim-senint/Makefile               |    3 -
 ossim/src/apps/ossim-senint/makefile.vc            |   11 -
 ossim/src/apps/ossim-slope/CMakeLists.txt          |    2 -
 ossim/src/apps/ossim-slope/Makefile                |    3 -
 ossim/src/apps/ossim-slope/makefile.vc             |   11 -
 ossim/src/apps/ossim-slope/ossim-slope.cpp         |   38 -
 ossim/src/apps/ossim-space-imaging/Makefile        |    3 -
 ossim/src/apps/ossim-space-imaging/makefile.vc     |   11 -
 ossim/src/apps/ossim-src2src/ossim-src2src.cpp     |  523 --
 ossim/src/apps/ossim-swapbytes/Makefile            |    3 -
 ossim/src/apps/ossim-swapbytes/makefile.vc         |   11 -
 ossim/src/apps/ossim-tfw2ogeom/Makefile            |    3 -
 ossim/src/apps/ossim-tfw2ogeom/makefile.vc         |   11 -
 ossim/src/apps/ossim-viewshed/CMakeLists.txt       |    2 -
 ossim/src/apps/ossim-viewshed/Makefile             |    3 -
 ossim/src/apps/ossim-viewshed/makefile.vc          |   11 -
 ossim/src/apps/ossim-viewshed/ossim-viewshed.cpp   |   53 -
 .../src/apps/ossim-viirs-proc/ossim-viirs-proc.cpp |  265 -
 ossim/src/apps/ossim-ws-cmp/Makefile               |    2 -
 ossim/src/apps/ossim-ws-cmp/makefile.vc            |   11 -
 ossim/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp       |  229 -
 ossim/src/ossim/CMakeLists.txt                     |  146 -
 ossim/src/ossim/base/makefile.vc                   |  214 -
 .../src/ossim/base/ossim2dTo2dMatrixTransform.cpp  |  184 -
 ossim/src/ossim/base/ossim2dTo2dTransform.cpp      |  281 -
 .../src/ossim/base/ossim2dTo2dTransformFactory.cpp |   67 -
 .../ossim/base/ossim2dTo2dTransformRegistry.cpp    |   27 -
 ossim/src/ossim/base/ossimArgumentParser.cpp       |  574 --
 ossim/src/ossim/base/ossimBooleanProperty.cpp      |   68 -
 ossim/src/ossim/base/ossimColorProperty.cpp        |  121 -
 ossim/src/ossim/base/ossimCommon.cpp               | 1130 ---
 .../ossim/base/ossimConnectableDisplayListener.cpp |  180 -
 ossim/src/ossim/base/ossimConnectableObject.cpp    | 2347 ------
 .../ossim/base/ossimConnectableObjectListener.cpp  |  113 -
 ossim/src/ossim/base/ossimContainerEvent.cpp       |   32 -
 ossim/src/ossim/base/ossimContainerProperty.cpp    |  228 -
 ossim/src/ossim/base/ossimDataObject.cpp           |  191 -
 ossim/src/ossim/base/ossimDate.cpp                 | 1140 ---
 ossim/src/ossim/base/ossimDateProperty.cpp         |  146 -
 ossim/src/ossim/base/ossimDatumFactory.inc         |  287 -
 ossim/src/ossim/base/ossimDblGrid.cpp              | 1225 ----
 ossim/src/ossim/base/ossimDirectory.cpp            |  320 -
 ossim/src/ossim/base/ossimDisplayEventListener.cpp |   48 -
 ossim/src/ossim/base/ossimDisplayInterface.cpp     |   32 -
 ossim/src/ossim/base/ossimDoubleGridProperty.cpp   |  161 -
 ossim/src/ossim/base/ossimDpt3d.cpp                |  207 -
 ossim/src/ossim/base/ossimDrect.cpp                |  854 ---
 ossim/src/ossim/base/ossimDuration.cpp             |  270 -
 .../base/ossimElevationManagerEventListener.cpp    |   31 -
 ossim/src/ossim/base/ossimEllipsoid.cpp            |  691 --
 ossim/src/ossim/base/ossimEllipsoidFactory.cpp     |  243 -
 ossim/src/ossim/base/ossimEnvironmentUtility.cpp   |  304 -
 ossim/src/ossim/base/ossimEquTokenizer.cpp         | 1817 -----
 ossim/src/ossim/base/ossimFilename.cpp             | 1338 ----
 ossim/src/ossim/base/ossimFilenameProperty.cpp     |  154 -
 ossim/src/ossim/base/ossimFontProperty.cpp         |   90 -
 ossim/src/ossim/base/ossimGeoTiffDatumLut.cpp      |  121 -
 ossim/src/ossim/base/ossimGeoidImage.cpp           |  364 -
 ossim/src/ossim/base/ossimGeoidManager.cpp         |  349 -
 ossim/src/ossim/base/ossimGrect.cpp                |  320 -
 ossim/src/ossim/base/ossimHistogram.cpp            | 1612 -----
 ossim/src/ossim/base/ossimHistogramSource.cpp      |  107 -
 ossim/src/ossim/base/ossimHttpResponse.cpp         |   29 -
 ossim/src/ossim/base/ossimImageTypeLut.cpp         |   56 -
 ossim/src/ossim/base/ossimIrect.cpp                |  681 --
 ossim/src/ossim/base/ossimKeywordNames.cpp         |  198 -
 ossim/src/ossim/base/ossimKeywordlist.cpp          | 1411 ----
 ossim/src/ossim/base/ossimListener.cpp             |   52 -
 ossim/src/ossim/base/ossimListenerManager.cpp      |  156 -
 ossim/src/ossim/base/ossimMatrixProperty.cpp       |  317 -
 ossim/src/ossim/base/ossimMouseListener.cpp        |   40 -
 ossim/src/ossim/base/ossimMultiBandHistogram.cpp   |  508 --
 .../src/ossim/base/ossimMultiResLevelHistogram.cpp |  500 --
 ossim/src/ossim/base/ossimNormRgbVector.cpp        |  183 -
 ossim/src/ossim/base/ossimNumericProperty.cpp      |  210 -
 ossim/src/ossim/base/ossimObject.cpp               |  133 -
 ossim/src/ossim/base/ossimPolyArea2d.cpp           |  837 ---
 ossim/src/ossim/base/ossimPolygon.cpp              | 1267 ----
 ossim/src/ossim/base/ossimPreferences.cpp          |  274 -
 ossim/src/ossim/base/ossimProcessInterface.cpp     |  145 -
 ossim/src/ossim/base/ossimProcessListener.cpp      |   45 -
 ossim/src/ossim/base/ossimProcessProgressEvent.cpp |   69 -
 ossim/src/ossim/base/ossimROIEventListener.cpp     |   49 -
 ossim/src/ossim/base/ossimRectanglePartitioner.cpp |  249 -
 .../src/ossim/base/ossimRectilinearDataObject.cpp  |  309 -
 ossim/src/ossim/base/ossimRegExp.cpp               | 1299 ----
 ossim/src/ossim/base/ossimRgbLutDataObject.cpp     |  280 -
 ossim/src/ossim/base/ossimRtti.cpp                 |  153 -
 ossim/src/ossim/base/ossimScalarTypeLut.cpp        |  184 -
 ossim/src/ossim/base/ossimSource.cpp               |  168 -
 ossim/src/ossim/base/ossimStdOutProgress.cpp       |   62 -
 ossim/src/ossim/base/ossimStreamFactory.cpp        |   94 -
 .../src/ossim/base/ossimStreamFactoryRegistry.cpp  |   75 -
 ossim/src/ossim/base/ossimString.cpp               | 1088 ---
 ossim/src/ossim/base/ossimStringListProperty.cpp   |  259 -
 ossim/src/ossim/base/ossimStringProperty.cpp       |  127 -
 ossim/src/ossim/base/ossimTempFilename.cpp         |  116 -
 ossim/src/ossim/base/ossimTieGpt.cpp               |  246 -
 ossim/src/ossim/base/ossimTileHash.cpp             |  124 -
 ossim/src/ossim/base/ossimTiledImageHash.cpp       |  141 -
 ossim/src/ossim/base/ossimTimer.cpp                |   88 -
 ossim/src/ossim/base/ossimTrace.cpp                |   41 -
 ossim/src/ossim/base/ossimTraceManager.cpp         |  106 -
 ossim/src/ossim/base/ossimUnitConversionTool.cpp   |  436 --
 ossim/src/ossim/base/ossimViewListener.cpp         |   45 -
 ossim/src/ossim/base/ossimVrect.cpp                |   42 -
 ossim/src/ossim/base/ossimXmlAttribute.cpp         |  247 -
 ossim/src/ossim/base/ossimXmlDocument.cpp          |  431 --
 ossim/src/ossim/base/ossimXmlNode.cpp              | 1424 ----
 ossim/src/ossim/dll_main/makefile.vc               |   14 -
 ossim/src/ossim/elevation/makefile.vc              |   32 -
 .../ossim/elevation/ossimDtedElevationDatabase.cpp |  260 -
 ossim/src/ossim/elevation/ossimDtedHandler.cpp     |  578 --
 ossim/src/ossim/elevation/ossimElevCellHandler.cpp |  103 -
 .../elevation/ossimElevCellHandlerFactory.cpp      |  131 -
 ossim/src/ossim/elevation/ossimElevManager.cpp     |  656 --
 ossim/src/ossim/elevation/ossimElevSource.cpp      |  276 -
 .../src/ossim/elevation/ossimElevSourceFactory.cpp |   44 -
 .../ossim/elevation/ossimElevationCellDatabase.cpp |  171 -
 .../src/ossim/elevation/ossimElevationDatabase.cpp |   61 -
 .../elevation/ossimElevationDatabaseFactory.cpp    |  115 -
 .../elevation/ossimImageElevationDatabase.cpp      |  468 --
 .../ossim/elevation/ossimImageElevationHandler.cpp |  260 -
 .../ossim/elevation/ossimSrtmElevationDatabase.cpp |  243 -
 ossim/src/ossim/elevation/ossimSrtmFactory.cpp     |  166 -
 .../elevation/ossimTiledElevationDatabase.cpp      |  656 --
 ossim/src/ossim/font/makefile.vc                   |   19 -
 ossim/src/ossim/imaging/makefile.vc                |  238 -
 .../ossim/imaging/ossim3x3ConvolutionFilter.cpp    |  634 --
 ossim/src/ossim/imaging/ossimAOD.cpp               |  238 -
 ossim/src/ossim/imaging/ossimAdrgTileSource.cpp    |  677 --
 .../ossim/imaging/ossimAnnotationLineObject.cpp    |  185 -
 .../imaging/ossimAnnotationMultiLineObject.cpp     |  192 -
 ossim/src/ossim/imaging/ossimAnnotationObject.cpp  |  161 -
 ossim/src/ossim/imaging/ossimAppFixedTileCache.cpp |  431 --
 ossim/src/ossim/imaging/ossimAppTileCache.cpp      |  303 -
 ossim/src/ossim/imaging/ossimArcInfoGridWriter.cpp |  371 -
 ossim/src/ossim/imaging/ossimAtCorrRemapper.cpp    |  731 --
 ossim/src/ossim/imaging/ossimBandAverageFilter.cpp |  395 -
 ossim/src/ossim/imaging/ossimBandClipFilter.cpp    |  699 --
 ossim/src/ossim/imaging/ossimBandMergeSource.cpp   |  287 -
 ossim/src/ossim/imaging/ossimBandSelector.cpp      |  713 --
 .../src/ossim/imaging/ossimBandSeparateHandler.cpp |  284 -
 ossim/src/ossim/imaging/ossimBitMaskTileSource.cpp |  386 -
 ossim/src/ossim/imaging/ossimBitMaskWriter.cpp     |  482 --
 ossim/src/ossim/imaging/ossimBlendMosaic.cpp       |  593 --
 ossim/src/ossim/imaging/ossimBrightnessMatch.cpp   |  248 -
 .../src/ossim/imaging/ossimBumpShadeTileSource.cpp |  539 --
 ossim/src/ossim/imaging/ossimCacheTileSource.cpp   |  510 --
 .../ossim/imaging/ossimCastTileSourceFilter.cpp    |  689 --
 ossim/src/ossim/imaging/ossimCcfHead.cpp           |  764 --
 ossim/src/ossim/imaging/ossimCcfTileSource.cpp     |  902 ---
 .../src/ossim/imaging/ossimCibCadrgTileSource.cpp  | 1334 ----
 .../ossim/imaging/ossimClosestToCenterCombiner.cpp |  143 -
 ossim/src/ossim/imaging/ossimCodecFactory.cpp      |   84 -
 .../ossim/imaging/ossimColorNormalizedFusion.cpp   |  146 -
 .../src/ossim/imaging/ossimConvolutionFilter1D.cpp |  669 --
 ossim/src/ossim/imaging/ossimConvolutionSource.cpp |  527 --
 ossim/src/ossim/imaging/ossimDespeckleFilter.cpp   |  237 -
 ossim/src/ossim/imaging/ossimDilationFilter.cpp    |  308 -
 ossim/src/ossim/imaging/ossimDoqqTileSource.cpp    |  261 -
 ossim/src/ossim/imaging/ossimDtedTileSource.cpp    |  683 --
 ossim/src/ossim/imaging/ossimERSTileSource.cpp     |  220 -
 .../ossim/imaging/ossimEastingNorthingCutter.cpp   |  203 -
 ossim/src/ossim/imaging/ossimEdgeFilter.cpp        |  650 --
 ossim/src/ossim/imaging/ossimElevImageSource.cpp   |  822 ---
 .../ossim/imaging/ossimEnviHeaderFileWriter.cpp    |  102 -
 ossim/src/ossim/imaging/ossimEnviTileSource.cpp    |  282 -
 ossim/src/ossim/imaging/ossimEquationCombiner.cpp  | 3573 ---------
 ossim/src/ossim/imaging/ossimFeatherMosaic.cpp     |  476 --
 ossim/src/ossim/imaging/ossimFftFilter.cpp         |  473 --
 ossim/src/ossim/imaging/ossimFgdcFileWriter.cpp    |  956 ---
 ossim/src/ossim/imaging/ossimFilter.cpp            |  334 -
 ossim/src/ossim/imaging/ossimFilterResampler.cpp   |  951 ---
 ossim/src/ossim/imaging/ossimFilterTable.cpp       |  148 -
 ossim/src/ossim/imaging/ossimGammaRemapper.cpp     |  435 --
 ossim/src/ossim/imaging/ossimGeneralRasterInfo.cpp | 1299 ----
 .../ossim/imaging/ossimGeneralRasterTileSource.cpp | 1601 -----
 .../src/ossim/imaging/ossimGeoAnnotationBitmap.cpp |  205 -
 .../ossim/imaging/ossimGridRemapEngineFactory.cpp  |   45 -
 .../src/ossim/imaging/ossimHistoMatchRemapper.cpp  |  350 -
 .../ossim/imaging/ossimHistogramEqualization.cpp   |  539 --
 ossim/src/ossim/imaging/ossimHistogramRemapper.cpp | 2065 ------
 .../imaging/ossimHistogramThreshholdFilter.cpp     |  261 -
 ossim/src/ossim/imaging/ossimHistogramWriter.cpp   |  310 -
 ossim/src/ossim/imaging/ossimHsiRemapper.cpp       | 3193 ---------
 ossim/src/ossim/imaging/ossimHsiToRgbSource.cpp    |  148 -
 .../src/ossim/imaging/ossimHsvGridRemapEngine.cpp  |  277 -
 ossim/src/ossim/imaging/ossimHsvToRgbSource.cpp    |  160 -
 ossim/src/ossim/imaging/ossimIgenGenerator.cpp     |  682 --
 ossim/src/ossim/imaging/ossimImageCacheBase.cpp    |  662 --
 .../ossim/imaging/ossimImageCacheTileSource.cpp    |  438 --
 ossim/src/ossim/imaging/ossimImageChain.cpp        | 1834 -----
 ossim/src/ossim/imaging/ossimImageData.cpp         | 7326 -------------------
 ossim/src/ossim/imaging/ossimImageDataFactory.cpp  |  260 -
 ossim/src/ossim/imaging/ossimImageDataHelper.cpp   |  608 --
 ossim/src/ossim/imaging/ossimImageFileWriter.cpp   | 1653 -----
 .../src/ossim/imaging/ossimImageGaussianFilter.cpp |  246 -
 ossim/src/ossim/imaging/ossimImageGeometry.cpp     | 1750 -----
 .../ossim/imaging/ossimImageGeometryFactory.cpp    |  228 -
 .../ossim/imaging/ossimImageGeometryRegistry.cpp   |   75 -
 ossim/src/ossim/imaging/ossimImageHandler.cpp      | 1689 -----
 .../src/ossim/imaging/ossimImageHandlerFactory.cpp |  905 ---
 .../ossim/imaging/ossimImageHandlerFactoryBase.cpp |   36 -
 .../ossim/imaging/ossimImageHandlerRegistry.cpp    |  283 -
 .../ossim/imaging/ossimImageHistogramSource.cpp    |  524 --
 ossim/src/ossim/imaging/ossimImageMetaData.cpp     |  535 --
 .../ossimImageMetaDataWriterFactoryBase.cpp        |   29 -
 .../imaging/ossimImageMetaDataWriterRegistry.cpp   |  172 -
 ossim/src/ossim/imaging/ossimImageModel.cpp        |  155 -
 ossim/src/ossim/imaging/ossimImageMosaic.cpp       |  525 --
 ossim/src/ossim/imaging/ossimImageRenderer.cpp     | 2401 -------
 .../src/ossim/imaging/ossimImageSharpenFilter.cpp  |  226 -
 ossim/src/ossim/imaging/ossimImageSource.cpp       |  379 -
 .../src/ossim/imaging/ossimImageSourceFactory.cpp  |  591 --
 ossim/src/ossim/imaging/ossimImageSourceFilter.cpp |  216 -
 .../ossim/imaging/ossimImageSourceSequencer.cpp    |  449 --
 .../ossim/imaging/ossimImageStatisticsSource.cpp   |  180 -
 .../imaging/ossimImageToPlaneNormalFilter.cpp      |  489 --
 .../src/ossim/imaging/ossimImageWriterFactory.cpp  |  373 -
 .../imaging/ossimImageWriterFactoryRegistry.cpp    |  293 -
 .../src/ossim/imaging/ossimIndexToRgbLutFilter.cpp |  514 --
 .../imaging/ossimIntensityAdjustmentFilter.cpp     |  289 -
 ossim/src/ossim/imaging/ossimJpegCodec.cpp         |  510 --
 ossim/src/ossim/imaging/ossimJpegMemDest.cpp       |   76 -
 ossim/src/ossim/imaging/ossimJpegMemSrc.cpp        |  187 -
 ossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp      |  248 -
 .../ossim/imaging/ossimJpegYCbCrToRgbSource.cpp    |  115 -
 .../imaging/ossimLandsatTopoCorrectionFilter.cpp   |  361 -
 .../ossim/imaging/ossimMapCompositionSource.cpp    | 3801 ----------
 ossim/src/ossim/imaging/ossimMaskFilter.cpp        |  863 ---
 ossim/src/ossim/imaging/ossimMaxMosaic.cpp         |  556 --
 ossim/src/ossim/imaging/ossimMeanMedianFilter.cpp  |  931 ---
 ossim/src/ossim/imaging/ossimMemoryImageSource.cpp |  246 -
 .../src/ossim/imaging/ossimMetadataFileWriter.cpp  |  278 -
 .../src/ossim/imaging/ossimMonoGridRemapEngine.cpp |  367 -
 .../imaging/ossimMultiBandHistogramTileSource.cpp  |  369 -
 .../src/ossim/imaging/ossimNBandToIndexFilter.cpp  |  566 --
 ossim/src/ossim/imaging/ossimNitf20Writer.cpp      |  833 ---
 ossim/src/ossim/imaging/ossimNitfTileSource.cpp    | 3419 ---------
 ossim/src/ossim/imaging/ossimNitfTileSource_12.cpp |  256 -
 ossim/src/ossim/imaging/ossimNitfWriter.cpp        |  930 ---
 ossim/src/ossim/imaging/ossimNitfWriterBase.cpp    |  361 -
 .../ossim/imaging/ossimNormalizedRemapTable.cpp    |   37 -
 .../ossim/imaging/ossimNormalizedS16RemapTable.cpp |   50 -
 .../ossim/imaging/ossimNormalizedU11RemapTable.cpp |   42 -
 .../ossim/imaging/ossimNormalizedU16RemapTable.cpp |   45 -
 .../ossim/imaging/ossimNormalizedU8RemapTable.cpp  |   43 -
 ossim/src/ossim/imaging/ossimNullPixelFlip.cpp     |  172 -
 ossim/src/ossim/imaging/ossimOverviewSequencer.cpp | 1049 ---
 ossim/src/ossim/imaging/ossimPdfWriter.cpp         | 1888 -----
 ossim/src/ossim/imaging/ossimPiecewiseRemapper.cpp |  926 ---
 ossim/src/ossim/imaging/ossimPixelFlipper.cpp      | 1143 ---
 ossim/src/ossim/imaging/ossimPolyCutter.cpp        |  412 --
 .../src/ossim/imaging/ossimQbTileFilesHandler.cpp  |  291 -
 .../ossim/imaging/ossimQuickbirdNitfTileSource.cpp |  168 -
 .../ossim/imaging/ossimQuickbirdTiffTileSource.cpp |  153 -
 ossim/src/ossim/imaging/ossimRLevelFilter.cpp      |  235 -
 .../src/ossim/imaging/ossimRangeDomeTileSource.cpp |  392 -
 ossim/src/ossim/imaging/ossimReadmeFileWriter.cpp  |  455 --
 .../src/ossim/imaging/ossimRectangleCutFilter.cpp  |  307 -
 ossim/src/ossim/imaging/ossimResampler.cpp         | 1251 ----
 .../src/ossim/imaging/ossimRgbGridRemapEngine.cpp  |  272 -
 ossim/src/ossim/imaging/ossimRgbToGreyFilter.cpp   |  248 -
 ossim/src/ossim/imaging/ossimRgbToHsiSource.cpp    |  163 -
 ossim/src/ossim/imaging/ossimRgbToHsvSource.cpp    |  156 -
 ossim/src/ossim/imaging/ossimRgbToIndexFilter.cpp  |  229 -
 .../ossim/imaging/ossimRgbToJpegYCbCrSource.cpp    |   94 -
 .../src/ossim/imaging/ossimRpfCacheTileSource.cpp  | 1315 ----
 ossim/src/ossim/imaging/ossimScalarRemapper.cpp    |  582 --
 ossim/src/ossim/imaging/ossimScaleFilter.cpp       |  960 ---
 ossim/src/ossim/imaging/ossimShiftFilter.cpp       |  311 -
 ossim/src/ossim/imaging/ossimSingleImageChain.cpp  |  953 ---
 .../src/ossim/imaging/ossimSubImageTileSource.cpp  |  226 -
 ossim/src/ossim/imaging/ossimTableRemapper.cpp     |  577 --
 .../src/ossim/imaging/ossimTiffOverviewBuilder.cpp | 1439 ----
 ossim/src/ossim/imaging/ossimTiffTileSource.cpp    | 2721 -------
 ossim/src/ossim/imaging/ossimTiffWriter.cpp        | 1741 -----
 ossim/src/ossim/imaging/ossimTilePatch.cpp         |  519 --
 ossim/src/ossim/imaging/ossimTiledImageHandler.cpp |  565 --
 ossim/src/ossim/imaging/ossimTiling.cpp            |  988 ---
 ossim/src/ossim/imaging/ossimTilingPoly.cpp        |  370 -
 ossim/src/ossim/imaging/ossimTilingRect.cpp        |  887 ---
 .../imaging/ossimTopographicCorrectionFilter.cpp   | 1298 ----
 ossim/src/ossim/imaging/ossimTrimFilter.cpp        |  358 -
 ossim/src/ossim/imaging/ossimTwoColorView.cpp      |  421 --
 ossim/src/ossim/imaging/ossimUsgsDemTileSource.cpp |  575 --
 .../imaging/ossimValueAssignImageSourceFilter.cpp  |  378 -
 .../imaging/ossimVpfAnnotationCoverageInfo.cpp     |  218 -
 .../imaging/ossimVpfAnnotationLibraryInfo.cpp      |  260 -
 ossim/src/ossim/imaging/ossimWatermarkFilter.cpp   | 1159 ---
 ossim/src/ossim/init/makefile.vc                   |   15 -
 ossim/src/ossim/init/ossimInit.cpp                 |  713 --
 ossim/src/ossim/makefile.vc                        |  157 -
 ossim/src/ossim/matrix/makefile.vc                 |   38 -
 ossim/src/ossim/ossimConfig.h.in                   |   20 -
 ossim/src/ossim/ossimVersion.h.in                  |   14 -
 ossim/src/ossim/parallel/makefile.vc               |   21 -
 .../ossim/parallel/ossimImageChainMtAdaptor.cpp    |  459 --
 .../ossim/parallel/ossimImageHandlerMtAdaptor.cpp  |  364 -
 .../ossimImageMpiMWriterSequenceConnection.cpp     |  287 -
 .../ossimImageMpiSWriterSequenceConnection.cpp     |  350 -
 ossim/src/ossim/parallel/ossimJobThreadQueue.cpp   |  240 -
 ossim/src/ossim/parallel/ossimMpi.cpp              |  190 -
 .../ossim/parallel/ossimMultiThreadSequencer.cpp   |  441 --
 ossim/src/ossim/parallel/ossimOrthoIgen.cpp        | 3043 --------
 ossim/src/ossim/plugin/makefile.vc                 |   18 -
 ossim/src/ossim/plugin/ossimDynamicLibrary.cpp     |  107 -
 ossim/src/ossim/plugin/ossimPluginLibrary.cpp      |   90 -
 .../point_cloud/ossimGenericPointCloudHandler.cpp  |   69 -
 ossim/src/ossim/point_cloud/ossimPointBlock.cpp    |  239 -
 .../ossim/point_cloud/ossimPointCloudGeometry.cpp  |   79 -
 .../ossim/point_cloud/ossimPointCloudHandler.cpp   |  100 -
 .../point_cloud/ossimPointCloudHandlerRegistry.cpp |   98 -
 .../point_cloud/ossimPointCloudImageHandler.cpp    |  832 ---
 .../ossim/point_cloud/ossimPointCloudSource.cpp    |   67 -
 ossim/src/ossim/point_cloud/ossimPointRecord.cpp   |  180 -
 ossim/src/ossim/projection/makefile.vc             |  103 -
 ossim/src/ossim/projection/ossimAdjMapModel.cpp    |  418 --
 .../src/ossim/projection/ossimAlbersProjection.cpp |  642 --
 .../ossim/projection/ossimApplanixEcefModel.cpp    |  806 ---
 .../src/ossim/projection/ossimApplanixUtmModel.cpp |  979 ---
 .../src/ossim/projection/ossimBonneProjection.cpp  |  535 --
 ossim/src/ossim/projection/ossimBuckeyeSensor.cpp  |  721 --
 .../src/ossim/projection/ossimCadrgProjection.cpp  |  424 --
 .../src/ossim/projection/ossimCoarseGridModel.cpp  | 1049 ---
 .../projection/ossimEpsgProjectionDatabase.cpp     |  913 ---
 .../ossim/projection/ossimEquDistCylProjection.cpp |  680 --
 ossim/src/ossim/projection/ossimFcsiModel.cpp      | 1064 ---
 .../src/ossim/projection/ossimGoogleProjection.cpp |  125 -
 ossim/src/ossim/projection/ossimIkonosRpcModel.cpp |  985 ---
 .../ossim/projection/ossimImageProjectionModel.cpp |   55 -
 .../projection/ossimImageViewAffineTransform.cpp   |  339 -
 .../ossimImageViewProjectionTransform.cpp          |  508 --
 .../ossimLambertConformalConicProjection.cpp       |  647 --
 ossim/src/ossim/projection/ossimLandSatModel.cpp   | 1205 ----
 ossim/src/ossim/projection/ossimLensDistortion.cpp |  132 -
 ossim/src/ossim/projection/ossimLlxyProjection.cpp |  322 -
 ossim/src/ossim/projection/ossimMapProjection.cpp  | 1699 -----
 .../ossim/projection/ossimMapProjectionFactory.cpp |  290 -
 .../ossim/projection/ossimMercatorProjection.cpp   |  492 --
 .../ossim/projection/ossimMollweidProjection.cpp   |  448 --
 .../ossim/projection/ossimNgaProjectionFactory.cpp |   87 -
 .../projection/ossimNitfProjectionFactory.cpp      |  992 ---
 ossim/src/ossim/projection/ossimNitfRpcModel.cpp   |  475 --
 ossim/src/ossim/projection/ossimNitfRsmModel.cpp   |  491 --
 .../projection/ossimObliqueMercatorProjection.cpp  |  724 --
 ossim/src/ossim/projection/ossimPpjFrameSensor.cpp |  475 --
 .../projection/ossimProjectionFactoryBase.cpp      |  111 -
 .../projection/ossimProjectionFactoryRegistry.cpp  |  173 -
 .../ossim/projection/ossimQuickbirdRpcModel.cpp    |  497 --
 ossim/src/ossim/projection/ossimRpcModel.cpp       | 1399 ----
 ossim/src/ossim/projection/ossimRpcProjection.cpp  | 1393 ----
 ossim/src/ossim/projection/ossimRpcSolver.cpp      |  828 ---
 ossim/src/ossim/projection/ossimRsmModel.cpp       |  997 ---
 ossim/src/ossim/projection/ossimSarModel.cpp       | 1402 ----
 ossim/src/ossim/projection/ossimSensorModel.cpp    | 1783 -----
 .../ossim/projection/ossimSensorModelFactory.cpp   |  705 --
 .../ossim/projection/ossimSinusoidalProjection.cpp |  450 --
 .../ossimSpaceObliqueMercatorProjection.cpp        |  412 --
 .../projection/ossimTransCylEquAreaProjection.cpp  |  597 --
 .../projection/ossimTransMercatorProjection.cpp    |  733 --
 ossim/src/ossim/projection/ossimUpsProjection.cpp  |  344 -
 ossim/src/ossim/projection/ossimUtmProjection.cpp  |  925 ---
 ossim/src/ossim/projection/ossimUtmpt.cpp          |   89 -
 .../projection/ossimVanDerGrintenProjection.cpp    |  524 --
 .../ossim/projection/ossimWktProjectionFactory.cpp |  426 --
 ossim/src/ossim/support_data/makefile.vc           |  148 -
 .../support_data/ossimAlphaSensorSupportData.cpp   |  699 --
 .../src/ossim/support_data/ossimApplanixEOFile.cpp |  691 --
 .../src/ossim/support_data/ossimAuxFileHandler.cpp | 1139 ---
 .../ossim/support_data/ossimAuxXmlSupportData.cpp  |  352 -
 ossim/src/ossim/support_data/ossimCcfInfo.cpp      |   59 -
 ossim/src/ossim/support_data/ossimDemGrid.cpp      |  235 -
 ossim/src/ossim/support_data/ossimDemHeader.cpp    |  786 --
 ossim/src/ossim/support_data/ossimDemInfo.cpp      |   62 -
 ossim/src/ossim/support_data/ossimDemPoint.cpp     |   17 -
 ossim/src/ossim/support_data/ossimDemProfile.cpp   |  156 -
 ossim/src/ossim/support_data/ossimDemStats.cpp     |  127 -
 ossim/src/ossim/support_data/ossimDemUtil.cpp      |  179 -
 ossim/src/ossim/support_data/ossimDoqq.cpp         |  438 --
 ossim/src/ossim/support_data/ossimDtedAcc.cpp      |  287 -
 ossim/src/ossim/support_data/ossimDtedDsi.cpp      |  586 --
 ossim/src/ossim/support_data/ossimDtedHdr.cpp      |  234 -
 ossim/src/ossim/support_data/ossimDtedInfo.cpp     |  285 -
 ossim/src/ossim/support_data/ossimDtedUhl.cpp      |  331 -
 ossim/src/ossim/support_data/ossimDtedVol.cpp      |  201 -
 ossim/src/ossim/support_data/ossimERS.cpp          |  673 --
 ossim/src/ossim/support_data/ossimEnviInfo.cpp     |   79 -
 ossim/src/ossim/support_data/ossimFfRevb.cpp       | 1136 ---
 ossim/src/ossim/support_data/ossimFfRevc.cpp       | 1661 -----
 ossim/src/ossim/support_data/ossimFgdcTxtDoc.cpp   |  307 -
 ossim/src/ossim/support_data/ossimFgdcXmlDoc.cpp   |  549 --
 ossim/src/ossim/support_data/ossimGeoTiff.cpp      | 2184 ------
 .../src/ossim/support_data/ossimGmlSupportData.cpp | 1092 ---
 .../src/ossim/support_data/ossimIkonosMetaData.cpp |  600 --
 ossim/src/ossim/support_data/ossimInfoBase.cpp     |   45 -
 ossim/src/ossim/support_data/ossimInfoFactory.cpp  |  135 -
 .../support_data/ossimInfoFactoryRegistry.cpp      |  110 -
 ossim/src/ossim/support_data/ossimJ2kCodRecord.cpp |  124 -
 ossim/src/ossim/support_data/ossimJ2kInfo.cpp      |  239 -
 ossim/src/ossim/support_data/ossimJ2kSizRecord.cpp |  181 -
 ossim/src/ossim/support_data/ossimJ2kSotRecord.cpp |   88 -
 ossim/src/ossim/support_data/ossimJp2Info.cpp      |  654 --
 ossim/src/ossim/support_data/ossimLasHdr.cpp       |  627 --
 ossim/src/ossim/support_data/ossimLasInfo.cpp      |   60 -
 ossim/src/ossim/support_data/ossimNitfAcftbTag.cpp |  265 -
 .../src/ossim/support_data/ossimNitfAimidbTag.cpp  |  172 -
 .../src/ossim/support_data/ossimNitfBlockaTag.cpp  |  326 -
 ossim/src/ossim/support_data/ossimNitfCommon.cpp   |  542 --
 .../support_data/ossimNitfCompressionHeader.cpp    |   20 -
 .../src/ossim/support_data/ossimNitfCscrnaTag.cpp  |  155 -
 .../src/ossim/support_data/ossimNitfCsdidaTag.cpp  |  150 -
 .../src/ossim/support_data/ossimNitfCsexraTag.cpp  |  338 -
 .../src/ossim/support_data/ossimNitfCsproaTag.cpp  |   94 -
 .../ossim/support_data/ossimNitfEmbeddedRpfDes.cpp |   39 -
 .../src/ossim/support_data/ossimNitfEngrdaTag.cpp  |  254 -
 ossim/src/ossim/support_data/ossimNitfFile.cpp     |  416 --
 .../src/ossim/support_data/ossimNitfFileHeader.cpp |  230 -
 .../ossim/support_data/ossimNitfFileHeaderV2_0.cpp | 1704 -----
 .../ossim/support_data/ossimNitfFileHeaderV2_1.cpp | 2115 ------
 .../ossim/support_data/ossimNitfFileHeaderV2_X.cpp |  532 --
 .../support_data/ossimNitfGeoPositioningTag.cpp    |  143 -
 .../src/ossim/support_data/ossimNitfIchipbTag.cpp  |  495 --
 .../src/ossim/support_data/ossimNitfImageBand.cpp  |   27 -
 .../ossim/support_data/ossimNitfImageBandV2_0.cpp  |  223 -
 .../ossim/support_data/ossimNitfImageHeader.cpp    |  400 --
 .../support_data/ossimNitfImageHeaderV2_0.cpp      | 1039 ---
 .../support_data/ossimNitfImageHeaderV2_1.cpp      | 1816 -----
 .../support_data/ossimNitfImageHeaderV2_X.cpp      |  931 ---
 ossim/src/ossim/support_data/ossimNitfImageLut.cpp |   34 -
 ossim/src/ossim/support_data/ossimNitfInfo.cpp     |   60 -
 .../src/ossim/support_data/ossimNitfJ2klraTag.cpp  |  182 -
 .../support_data/ossimNitfLocalCartographicTag.cpp |  137 -
 .../support_data/ossimNitfLocalGeographicTag.cpp   |  110 -
 .../src/ossim/support_data/ossimNitfMstgtaTag.cpp  |  135 -
 .../support_data/ossimNitfNameConversionTables.cpp |  164 -
 .../src/ossim/support_data/ossimNitfPiaimcTag.cpp  |  412 --
 .../ossimNitfProjectionParameterTag.cpp            |  213 -
 .../ossim/support_data/ossimNitfRegisteredTag.cpp  |  117 -
 .../support_data/ossimNitfRegisteredTagFactory.cpp |  210 -
 ossim/src/ossim/support_data/ossimNitfRpcATag.cpp  |   24 -
 ossim/src/ossim/support_data/ossimNitfRpcBTag.cpp  |   22 -
 ossim/src/ossim/support_data/ossimNitfRpcBase.cpp  |  929 ---
 .../ossim/support_data/ossimNitfRpfTagFactory.cpp  |   54 -
 .../src/ossim/support_data/ossimNitfSensraTag.cpp  |  444 --
 .../src/ossim/support_data/ossimNitfStdidcTag.cpp  |  469 --
 .../ossim/support_data/ossimNitfTagInformation.cpp |  209 -
 .../src/ossim/support_data/ossimNitfUnknownTag.cpp |  126 -
 .../src/ossim/support_data/ossimNitfUse00aTag.cpp  |  540 --
 .../support_data/ossimNitfVqCompressionHeader.cpp  |  349 -
 ossim/src/ossim/support_data/ossimNmeaMessage.cpp  |   99 -
 .../ossim/support_data/ossimQuickbirdMetaData.cpp  |  819 ---
 .../ossim/support_data/ossimQuickbirdRpcHeader.cpp |  247 -
 .../support_data/ossimRpfAttributeOffsetRecord.cpp |   58 -
 .../ossimRpfAttributeSectionSubheader.cpp          |   85 -
 .../src/ossim/support_data/ossimRpfAttributes.cpp  |  171 -
 .../ossimRpfColorConverterOffsetRecord.cpp         |   60 -
 .../ossimRpfColorConverterSubsection.cpp           |  131 -
 .../support_data/ossimRpfColorConverterTable.cpp   |   93 -
 .../ossimRpfColorGrayscaleOffsetRecord.cpp         |   69 -
 .../ossimRpfColorGrayscaleSubheader.cpp            |   59 -
 .../support_data/ossimRpfColorGrayscaleTable.cpp   |  152 -
 .../ossimRpfCompressionLookupOffsetRecord.cpp      |   64 -
 .../support_data/ossimRpfCompressionSection.cpp    |  202 -
 .../ossimRpfCompressionSectionSubheader.cpp        |   62 -
 .../ossim/support_data/ossimRpfCoverageSection.cpp |  296 -
 ossim/src/ossim/support_data/ossimRpfFrame.cpp     | 1130 ---
 .../src/ossim/support_data/ossimRpfFrameEntry.cpp  |  126 -
 ossim/src/ossim/support_data/ossimRpfHeader.cpp    |  873 ---
 .../ossimRpfImageDescriptionSubheader.cpp          |  115 -
 .../ossimRpfImageDisplayParameterSubheader.cpp     |   67 -
 ossim/src/ossim/support_data/ossimRpfInfo.cpp      |   92 -
 .../ossim/support_data/ossimRpfLocationSection.cpp |  316 -
 ossim/src/ossim/support_data/ossimRpfToc.cpp       | 1295 ----
 ossim/src/ossim/support_data/ossimRpfTocEntry.cpp  |  280 -
 .../ossim/support_data/ossimSrtmSupportData.cpp    |  913 ---
 .../ossim/support_data/ossimSupportFilesList.cpp   |   43 -
 ossim/src/ossim/support_data/ossimTiffInfo.cpp     | 3913 ----------
 ossim/src/ossim/support_data/ossimTiffWorld.cpp    |  269 -
 ossim/src/ossim/support_data/ossimWavelength.cpp   |  204 -
 ossim/src/ossim/support_data/ossimWkt.cpp          |  274 -
 ossim/src/ossim/support_data/ossimXmpInfo.cpp      |  645 --
 ossim/src/ossim/util/ossimAutRegUtil.cpp           | 1747 -----
 ossim/src/ossim/util/ossimBatchTest.cpp            | 1257 ----
 ossim/src/ossim/util/ossimChipperUtil.cpp          | 5081 -------------
 ossim/src/ossim/util/ossimEquationUtil.cpp         |  410 --
 ossim/src/ossim/util/ossimFileWalker.cpp           |  535 --
 ossim/src/ossim/util/ossimHLZUtil.cpp              | 1108 ---
 ossim/src/ossim/util/ossimImageUtil.cpp            | 2133 ------
 ossim/src/ossim/util/ossimInfo.cpp                 | 2772 -------
 ossim/src/ossim/util/ossimRpfUtil.cpp              |  349 -
 ossim/src/ossim/util/ossimSlopeUtil.cpp            |  374 -
 ossim/src/ossim/util/ossimViewshedUtil.cpp         |  873 ---
 ossim/src/ossim/vec/makefile.vc                    |   25 -
 ossim/src/ossim/vec/ossimVpfDatabase.cpp           |  190 -
 .../vec/ossimVpfDatabaseHeaderTableValidator.cpp   |  133 -
 ossim/src/ossim/vec/ossimVpfFeatureClass.cpp       |  151 -
 ossim/src/ossim/vec/ossimVpfFeatureClassSchema.cpp |  149 -
 ossim/src/ossim/vpfutil/linklist.c                 |  712 --
 ossim/src/ossim/vpfutil/makefile.vc                |   36 -
 ossim/src/ossim/vpfutil/vpfclip.c                  |  293 -
 ossim/src/ossim/vpfutil/vpfcntnt.c                 |  513 --
 ossim/src/ossim/vpfutil/vpfdict.c                  |  238 -
 ossim/src/ossim/vpfutil/vpfmisc.c                  | 1837 -----
 ossim/src/ossim/vpfutil/vpfprim.c                  | 1137 ---
 ossim/src/ossim/vpfutil/vpfquery.c                 |  972 ---
 ossim/src/ossim/vpfutil/vpfrelat.c                 |  907 ---
 ossim/src/ossim/vpfutil/vpfselec.c                 | 1320 ----
 ossim/src/test/CMakeLists.txt                      |   71 -
 ossim/src/test/ossim-date-test.cpp                 |   57 -
 ossim/src/test/ossim-directory-test.cpp            |   81 -
 ossim/src/test/ossim-dted-handler-test.cpp         |   81 -
 ossim/src/test/ossim-elevation-manager-test.cpp    |   55 -
 ossim/src/test/ossim-envi-hdr-test.cpp             |   49 -
 ossim/src/test/ossim-eq-projection-test.cpp        |   51 -
 ossim/src/test/ossim-fgdc-txt-doc-test.cpp         |   74 -
 ossim/src/test/ossim-filename-test.cpp             |  202 -
 ossim/src/test/ossim-foo.cpp                       |  111 -
 ossim/src/test/ossim-get-pixel-test.cpp            |  219 -
 ossim/src/test/ossim-gpkg-writer-test.cpp          |  233 -
 ossim/src/test/ossim-gpt-test.cpp                  |  142 -
 ossim/src/test/ossim-gsd-test.cpp                  |  119 -
 ossim/src/test/ossim-image-chain-test.cpp          |   81 -
 ossim/src/test/ossim-image-elevation-test.cpp      |   99 -
 ossim/src/test/ossim-image-geometry-test.cpp       |  349 -
 ossim/src/test/ossim-index-to-rgb-lut-test.cpp     |  200 -
 ossim/src/test/ossim-info-test.cpp                 |   72 -
 ossim/src/test/ossim-keywordlist-test.cpp          |  266 -
 ossim/src/test/ossim-loadtile-test.cpp             |  127 -
 ossim/src/test/ossim-mask-filter-test.cpp          |  182 -
 ossim/src/test/ossim-nitf-rsm-model-test.cpp       |  513 --
 ossim/src/test/ossim-notify-test.cpp               |   52 -
 ossim/src/test/ossim-piecewise-remapper-test.cpp   |  257 -
 ossim/src/test/ossim-point-test.cpp                |  185 -
 ossim/src/test/ossim-range-dome-test.cpp           |  247 -
 ossim/src/test/ossim-rect-test.cpp                 |   72 -
 ossim/src/test/ossim-ref-ptr-test.cpp              |   91 -
 ossim/src/test/ossim-remap-table-test.cpp          |  360 -
 ossim/src/test/ossim-shift-filter-test.cpp         |  201 -
 ossim/src/test/ossim-single-image-chain-test.cpp   |  166 -
 .../ossim-single-image-chain-threaded-test.cpp     |  102 -
 ossim/src/test/ossim-srtm-support-data-test.cpp    |   49 -
 ossim/src/test/ossim-tiff-info-test.cpp            |   83 -
 ossim/src/test/ossim-tiled-elevation-test.cpp      |  209 -
 ossim/src/test/ossim-wavelength-test.cpp           |  128 -
 ossim/src/test/ossim-xml-test.cpp                  |   49 -
 ossim_header.txt                                   |    7 +
 scripts/archive.sh                                 |  237 +
 scripts/build-dependencies.sh                      |  741 ++
 scripts/build.sh                                   |   95 +
 scripts/env.bat                                    |   16 +
 scripts/env.sh                                     |  204 +
 scripts/gcrbr.sh                                   |   28 +
 scripts/git-prompt.sh                              |  531 ++
 scripts/got                                        |   65 +
 scripts/grmbr.sh                                   |   36 +
 scripts/install.sh                                 |   14 +
 scripts/setup.sh                                   |   83 +
 scripts/test.sh                                    |  122 +
 share/ossim/fonts/arial.ttf                        |  Bin 0 -> 43536 bytes
 share/ossim/fonts/times.ttf                        |  Bin 0 -> 45248 bytes
 share/ossim/geoids/egm96.grd                       |  Bin 0 -> 4155868 bytes
 .../projection/ossim_epsg_projections-v7_4.csv     | 3253 +++++++++
 .../projection/ossim_harn_state_plane_epsg.csv     |    0
 .../projection/ossim_harn_state_plane_esri.csv     |    0
 .../ossim/projection/ossim_state_plane_readme.txt  |    0
 .../ossim/projection/ossim_state_plane_spcs.csv    |    0
 .../ossim/projection/ossim_wkt_pcs.csv             |    0
 .../LambertConformalConicProjection_template.geom  |    0
 .../share => share}/ossim/templates/applanix.geom  |    0
 .../ossim/templates/applanix_ecef.geom             |    0
 .../templates/applanix_ecef_camera_file_sn0056.kwl |    0
 .../ossim/templates/applanix_ecef_eo_example.txt   |    0
 .../ossim/templates/applanix_utm.geom              |    0
 .../templates/applanix_utm_camera_file_sn0085D.kwl |    0
 .../ossim/templates/applanix_utm_eo_example.txt    |    0
 .../templates/bilinear_projection_template.geom    |    0
 .../templates/elevation_database_template.sql      |    0
 .../fgdc_metadata_file_writer_template.xml         |    0
 .../ossim/templates/general_raster_template.omd    |    0
 .../templates/geographic_projection_template.geom  |    0
 .../ossim/templates/index_to_rgb.lut               |    0
 .../ossim/templates/nitf-site-configuration.kwl    |    0
 .../share => share}/ossim/templates/orthoigen1.kwl |    0
 .../share => share}/ossim/templates/orthoigen2.kwl |    0
 .../share => share}/ossim/templates/orthoigen3.kwl |    0
 .../share => share}/ossim/templates/orthoigen4.kwl |    0
 .../orthoigenTilingTemplateByOutputBytes.kwl       |    0
 .../templates/orthoigen_annotation_template.kwl    |    0
 .../ossim/templates/orthoigen_srtm.kwl             |    0
 .../ossim/templates/orthoigen_writer_template.kwl  |    0
 .../ossim/templates/ossim-batch-test-template.kwl  |    0
 .../ossim-chipper-annotation-template.kwl          |   66 +
 .../ossim-chipper-color-table-template.kwl         |    0
 .../ossim/templates/ossim-dem-example-commands.txt |    0
 share/ossim/templates/ossim_preferences_template   |  734 ++
 .../ossim/templates/sample_applanix_camera.kwl     |    0
 .../ossim/templates/shapefile_template.omd         |    0
 .../ossim/templates/usgs_dem_template.kwl          |    0
 .../ossim/templates/utm_projection_template.geom   |    0
 share/ossim/util/ossimChipProcUtil.json            |   91 +
 share/ossim/util/ossimChipProcUtil.kwl             |   66 +
 share/ossim/util/ossimHillshadeUtil.kwl            |   20 +
 share/ossim/util/ossimHlzUtil.json                 |   66 +
 share/ossim/util/ossimHlzUtil.kwl                  |   36 +
 share/ossim/util/ossimInfo.kwl                     |   40 +
 share/ossim/util/ossimOrthoUtil.kwl                |    8 +
 share/ossim/util/ossimShorelineUtil.json           |   20 +
 share/ossim/util/ossimShorelineUtil.kwl            |   17 +
 .../ossim/util/ossimSlopeUtil.json                 |    0
 share/ossim/util/ossimSlopeUtil.kwl                |    8 +
 .../ossim/util/ossimSlopeUtilX.json                |    0
 share/ossim/util/ossimViewshedUtil.json            |   86 +
 share/ossim/util/ossimViewshedUtil.kwl             |   38 +
 src/CMakeLists.txt                                 |  178 +
 {ossim/src/ossim => src}/base/ellips.dat           |    0
 src/base/jsoncpp.cpp                               | 5206 ++++++++++++++
 .../base/ossim2dBilinearTransform.cpp              |    0
 .../ossim => src}/base/ossim2dLinearRegression.cpp |    0
 .../base/ossim2dTo2dIdentityTransform.cpp          |    0
 src/base/ossim2dTo2dMatrixTransform.cpp            |  183 +
 .../base/ossim2dTo2dShiftTransform.cpp             |    0
 src/base/ossim2dTo2dTransform.cpp                  |  280 +
 src/base/ossim2dTo2dTransformFactory.cpp           |   66 +
 src/base/ossim2dTo2dTransformRegistry.cpp          |   26 +
 .../ossim => src}/base/ossimActiveEdgeTable.cpp    |    0
 .../base/ossimAdjSolutionAttributes.cpp            |    0
 .../base/ossimAdjustableParameterInfo.cpp          |    0
 .../base/ossimAdjustableParameterInterface.cpp     |    0
 .../base/ossimAdjustmentExecutive.cpp              |    0
 .../src/ossim => src}/base/ossimAdjustmentInfo.cpp |    0
 .../ossim => src}/base/ossimAffineTransform.cpp    |    0
 .../ossim => src}/base/ossimApplicationUsage.cpp   |    0
 src/base/ossimArgumentParser.cpp                   |  670 ++
 .../ossim => src}/base/ossimBaseObjectFactory.cpp  |    0
 {ossim/src/ossim => src}/base/ossimBilSplitter.cpp |    0
 .../ossim => src}/base/ossimBinaryDataProperty.cpp |    0
 src/base/ossimBooleanProperty.cpp                  |   67 +
 .../ossim => src}/base/ossimByteStreamBuffer.cpp   |    0
 {ossim/src/ossim => src}/base/ossimCmyVector.cpp   |    0
 src/base/ossimColorProperty.cpp                    |  120 +
 .../src/ossim => src}/base/ossimColumnVector3d.cpp |    0
 src/base/ossimCommon.cpp                           | 1287 ++++
 .../base/ossimConnectableContainer.cpp             |    0
 .../base/ossimConnectableContainerInterface.cpp    |    0
 src/base/ossimConnectableDisplayListener.cpp       |  179 +
 src/base/ossimConnectableObject.cpp                | 2351 ++++++
 src/base/ossimConnectableObjectListener.cpp        |  112 +
 .../ossim => src}/base/ossimConnectionEvent.cpp    |    0
 src/base/ossimContainerEvent.cpp                   |   31 +
 src/base/ossimContainerProperty.cpp                |  227 +
 {ossim/src/ossim => src}/base/ossimCplUtil.cpp     |    0
 {ossim/src/ossim => src}/base/ossimCsvFile.cpp     |    0
 .../ossim => src}/base/ossimCustomEditorWindow.cpp |    0
 .../base/ossimCustomEditorWindowFactoryBase.cpp    |    0
 .../base/ossimCustomEditorWindowRegistry.cpp       |    0
 src/base/ossimDataObject.cpp                       |  190 +
 src/base/ossimDate.cpp                             | 1158 +++
 src/base/ossimDateProperty.cpp                     |  145 +
 {ossim/src/ossim => src}/base/ossimDatum.cpp       |    0
 .../src/ossim => src}/base/ossimDatumFactory.cpp   |    0
 src/base/ossimDatumFactory.inc                     |  287 +
 .../base/ossimDatumFactoryRegistry.cpp             |    0
 src/base/ossimDblGrid.cpp                          | 1239 ++++
 src/base/ossimDirectory.cpp                        |  319 +
 .../src/ossim => src}/base/ossimDirectoryData.cpp  |    0
 .../src/ossim => src}/base/ossimDirectoryTree.cpp  |    0
 src/base/ossimDisplayEventListener.cpp             |   48 +
 src/base/ossimDisplayInterface.cpp                 |   31 +
 .../ossim => src}/base/ossimDisplayListEvent.cpp   |    0
 .../base/ossimDisplayRefreshEvent.cpp              |    0
 {ossim/src/ossim => src}/base/ossimDms.cpp         |    0
 src/base/ossimDoubleGridProperty.cpp               |  159 +
 {ossim/src/ossim => src}/base/ossimDpt.cpp         |    0
 src/base/ossimDpt3d.cpp                            |  206 +
 src/base/ossimDrect.cpp                            |  858 +++
 src/base/ossimDuration.cpp                         |  269 +
 .../src/ossim => src}/base/ossimEbcdicToAscii.cpp  |    0
 {ossim/src/ossim => src}/base/ossimEcefPoint.cpp   |    0
 {ossim/src/ossim => src}/base/ossimEcefRay.cpp     |    0
 {ossim/src/ossim => src}/base/ossimEcefVector.cpp  |    0
 .../base/ossimElevationManagerEvent.cpp            |    0
 src/base/ossimElevationManagerEventListener.cpp    |   31 +
 src/base/ossimEllipsoid.cpp                        |  731 ++
 src/base/ossimEllipsoidFactory.cpp                 |  242 +
 {ossim/src/ossim => src}/base/ossimEndian.cpp      |    0
 src/base/ossimEnvironmentUtility.cpp               |  318 +
 .../ossim => src}/base/ossimEpsgDatumFactory.cpp   |    0
 src/base/ossimEquTokenizer.cpp                     | 1817 +++++
 {ossim/src/ossim => src}/base/ossimEquTokenizer.l  |    0
 {ossim/src/ossim => src}/base/ossimErrorCodes.cpp  |    0
 .../base/ossimErrorStatusInterface.cpp             |    0
 {ossim/src/ossim => src}/base/ossimEvent.cpp       |    0
 {ossim/src/ossim => src}/base/ossimException.cpp   |    0
 .../base/ossimFactoryBaseTemplate.cpp              |    0
 src/base/ossimFilename.cpp                         | 1457 ++++
 src/base/ossimFilenameProperty.cpp                 |  152 +
 .../ossim => src}/base/ossimFontInformation.cpp    |    0
 src/base/ossimFontProperty.cpp                     |   88 +
 {ossim/src/ossim => src}/base/ossimFpt.cpp         |    0
 {ossim/src/ossim => src}/base/ossimFpt3d.cpp       |    0
 {ossim/src/ossim => src}/base/ossimGeoPolygon.cpp  |    0
 .../base/ossimGeoTiffCoordTransformsLut.cpp        |    0
 src/base/ossimGeoTiffDatumLut.cpp                  |  120 +
 {ossim/src/ossim => src}/base/ossimGeocent.c       |    0
 .../ossim => src}/base/ossimGeodeticEvaluator.cpp  |    0
 {ossim/src/ossim => src}/base/ossimGeoid.cpp       |    0
 {ossim/src/ossim => src}/base/ossimGeoidEgm96.cpp  |    0
 src/base/ossimGeoidImage.cpp                       |  363 +
 src/base/ossimGeoidManager.cpp                     |  358 +
 {ossim/src/ossim => src}/base/ossimGeoidNgs.cpp    |    0
 .../src/ossim => src}/base/ossimGeoidNgsHeader.cpp |    0
 {ossim/src/ossim => src}/base/ossimGeoref.cpp      |    0
 {ossim/src/ossim => src}/base/ossimGpt.cpp         |    0
 src/base/ossimGrect.cpp                            |  323 +
 {ossim/src/ossim => src}/base/ossimGzStream.cpp    |    0
 {ossim/src/ossim => src}/base/ossimHexString.cpp   |    0
 src/base/ossimHistogram.cpp                        | 1696 +++++
 src/base/ossimHistogramSource.cpp                  |  106 +
 {ossim/src/ossim => src}/base/ossimHsiVector.cpp   |    0
 {ossim/src/ossim => src}/base/ossimHsvVector.cpp   |    0
 {ossim/src/ossim => src}/base/ossimHttpRequest.cpp |    0
 src/base/ossimHttpResponse.cpp                     |   49 +
 {ossim/src/ossim => src}/base/ossimId.cpp          |    0
 {ossim/src/ossim => src}/base/ossimIdManager.cpp   |    0
 .../ossim => src}/base/ossimImageAoiListener.cpp   |    0
 .../ossim => src}/base/ossimImageGeometryEvent.cpp |    0
 .../base/ossimImageGeometryEventListener.cpp       |    0
 src/base/ossimImageTypeLut.cpp                     |   56 +
 .../ossim => src}/base/ossimInterleaveTypeLut.cpp  |    0
 {ossim/src/ossim => src}/base/ossimIoStream.cpp    |    0
 {ossim/src/ossim => src}/base/ossimIpt.cpp         |    0
 src/base/ossimIrect.cpp                            |  685 ++
 .../ossim => src}/base/ossimJpegYCbCrVector.cpp    |    0
 src/base/ossimKMeansClustering.cpp                 |  240 +
 {ossim/src/ossim => src}/base/ossimKeyword.cpp     |    0
 src/base/ossimKeywordNames.cpp                     |  199 +
 src/base/ossimKeywordlist.cpp                      | 1440 ++++
 .../base/ossimLagrangeInterpolator.cpp             |    0
 .../ossim => src}/base/ossimLeastSquaresBilin.cpp  |    0
 .../ossim => src}/base/ossimLeastSquaresPlane.cpp  |    0
 {ossim/src/ossim => src}/base/ossimLine.cpp        |    0
 src/base/ossimListener.cpp                         |   51 +
 src/base/ossimListenerManager.cpp                  |  156 +
 {ossim/src/ossim => src}/base/ossimLookUpTable.cpp |    0
 {ossim/src/ossim => src}/base/ossimLsrPoint.cpp    |    0
 {ossim/src/ossim => src}/base/ossimLsrRay.cpp      |    0
 {ossim/src/ossim => src}/base/ossimLsrSpace.cpp    |    0
 {ossim/src/ossim => src}/base/ossimLsrVector.cpp   |    0
 {ossim/src/ossim => src}/base/ossimMatrix3x3.cpp   |    0
 {ossim/src/ossim => src}/base/ossimMatrix4x4.cpp   |    0
 src/base/ossimMatrixProperty.cpp                   |  316 +
 {ossim/src/ossim => src}/base/ossimMouseEvent.cpp  |    0
 src/base/ossimMouseListener.cpp                    |   39 +
 src/base/ossimMultiBandHistogram.cpp               |  542 ++
 src/base/ossimMultiResLevelHistogram.cpp           |  511 ++
 .../ossim => src}/base/ossimNBandLutDataObject.cpp |    0
 .../ossim => src}/base/ossimNadconGridDatum.cpp    |    0
 .../src/ossim => src}/base/ossimNadconGridFile.cpp |    0
 .../ossim => src}/base/ossimNadconGridHeader.cpp   |    0
 .../src/ossim => src}/base/ossimNadconNarDatum.cpp |    0
 .../src/ossim => src}/base/ossimNadconNasDatum.cpp |    0
 src/base/ossimNormRgbVector.cpp                    |  183 +
 {ossim/src/ossim => src}/base/ossimNotify.cpp      |    0
 src/base/ossimNumericProperty.cpp                  |  209 +
 src/base/ossimObject.cpp                           |  132 +
 .../base/ossimObjectDestructingEvent.cpp           |    0
 .../src/ossim => src}/base/ossimObjectFactory.cpp  |    0
 .../base/ossimObjectFactoryRegistry.cpp            |    0
 .../src/ossim => src}/base/ossimObservationSet.cpp |    0
 .../src/ossim => src}/base/ossimOutputSource.cpp   |    0
 {ossim/src/ossim => src}/base/ossimPackedBits.cpp  |    0
 .../ossim => src}/base/ossimPointObservation.cpp   |    0
 src/base/ossimPolyArea2d.cpp                       |  861 +++
 {ossim/src/ossim => src}/base/ossimPolyLine.cpp    |    0
 src/base/ossimPolygon.cpp                          | 1296 ++++
 src/base/ossimPreferences.cpp                      |  260 +
 src/base/ossimProcessInterface.cpp                 |  144 +
 src/base/ossimProcessListener.cpp                  |   44 +
 src/base/ossimProcessProgressEvent.cpp             |   68 +
 {ossim/src/ossim => src}/base/ossimProperty.cpp    |    0
 .../ossim => src}/base/ossimPropertyInterface.cpp  |    0
 .../base/ossimPropertyInterfaceFactory.cpp         |    0
 .../base/ossimPropertyInterfaceRegistry.cpp        |    0
 .../src/ossim => src}/base/ossimQuadTreeWarp.cpp   |    0
 .../ossim => src}/base/ossimQuadrilateralMap.cpp   |    0
 {ossim/src/ossim => src}/base/ossimQuaternion.cpp  |    0
 {ossim/src/ossim => src}/base/ossimROIEvent.cpp    |    0
 src/base/ossimROIEventListener.cpp                 |   47 +
 .../src/ossim => src}/base/ossimRationalNumber.cpp |    0
 src/base/ossimRectanglePartitioner.cpp             |  248 +
 src/base/ossimRectilinearDataObject.cpp            |  308 +
 {ossim/src/ossim => src}/base/ossimReferenced.cpp  |    0
 .../src/ossim => src}/base/ossimRefreshEvent.cpp   |    0
 src/base/ossimRegExp.cpp                           | 1299 ++++
 src/base/ossimRgbLutDataObject.cpp                 |  279 +
 {ossim/src/ossim => src}/base/ossimRgbVector.cpp   |    0
 src/base/ossimRtti.cpp                             |  158 +
 src/base/ossimScalarTypeLut.cpp                    |  220 +
 .../ossim => src}/base/ossimSevenParamDatum.cpp    |    0
 src/base/ossimSource.cpp                           |  167 +
 .../ossim => src}/base/ossimStateChangedEvent.cpp  |    0
 src/base/ossimStdOutProgress.cpp                   |   88 +
 {ossim/src/ossim => src}/base/ossimStreamBase.cpp  |    0
 src/base/ossimStreamFactory.cpp                    |  234 +
 src/base/ossimStreamFactoryRegistry.cpp            |  197 +
 src/base/ossimString.cpp                           | 1126 +++
 src/base/ossimStringListProperty.cpp               |  257 +
 src/base/ossimStringProperty.cpp                   |  126 +
 {ossim/src/ossim => src}/base/ossimTDpt.cpp        |    0
 src/base/ossimTempFilename.cpp                     |  115 +
 .../src/ossim => src}/base/ossimTextProperty.cpp   |    0
 .../ossim => src}/base/ossimThinPlateSpline.cpp    |    0
 .../ossim => src}/base/ossimThreeParamDatum.cpp    |    0
 src/base/ossimTieGpt.cpp                           |  246 +
 {ossim/src/ossim => src}/base/ossimTieGptSet.cpp   |    0
 src/base/ossimTileHash.cpp                         |  123 +
 src/base/ossimTiledImageHash.cpp                   |  140 +
 src/base/ossimTimer.cpp                            |  110 +
 src/base/ossimTrace.cpp                            |   40 +
 src/base/ossimTraceManager.cpp                     |  105 +
 src/base/ossimUnitConversionTool.cpp               |  435 ++
 {ossim/src/ossim => src}/base/ossimUnitTypeLut.cpp |    0
 {ossim/src/ossim => src}/base/ossimUrl.cpp         |    0
 {ossim/src/ossim => src}/base/ossimUsgsQuad.cpp    |    0
 .../src/ossim => src}/base/ossimViewController.cpp |    0
 {ossim/src/ossim => src}/base/ossimViewEvent.cpp   |    0
 .../src/ossim => src}/base/ossimViewInterface.cpp  |    0
 src/base/ossimViewListener.cpp                     |   45 +
 {ossim/src/ossim => src}/base/ossimVisitor.cpp     |    0
 src/base/ossimVrect.cpp                            |   41 +
 .../ossim => src}/base/ossimWLSBundleSolution.cpp  |    0
 {ossim/src/ossim => src}/base/ossimWebRequest.cpp  |    0
 .../base/ossimWebRequestFactoryBase.cpp            |    0
 .../base/ossimWebRequestFactoryRegistry.cpp        |    0
 {ossim/src/ossim => src}/base/ossimWebResponse.cpp |    0
 {ossim/src/ossim => src}/base/ossimWgs72Datum.cpp  |    0
 {ossim/src/ossim => src}/base/ossimWgs84Datum.cpp  |    0
 {ossim/src/ossim => src}/base/ossimWms.cpp         |    0
 src/base/ossimXmlAttribute.cpp                     |  247 +
 src/base/ossimXmlDocument.cpp                      |  430 ++
 src/base/ossimXmlNode.cpp                          | 1402 ++++
 {ossim/src/ossim => src}/base/ossimXmlString.cpp   |    0
 {ossim/src/ossim => src}/dll_main/Makefile         |    0
 {ossim/src/ossim => src}/dll_main/ossimDllMain.cpp |    0
 src/elevation/ossimDtedElevationDatabase.cpp       |  376 +
 .../ossim => src}/elevation/ossimDtedFactory.cpp   |    0
 src/elevation/ossimDtedHandler.cpp                 |  601 ++
 src/elevation/ossimElevCellHandler.cpp             |  103 +
 src/elevation/ossimElevCellHandlerFactory.cpp      |  130 +
 src/elevation/ossimElevManager.cpp                 |  673 ++
 src/elevation/ossimElevSource.cpp                  |  277 +
 src/elevation/ossimElevSourceFactory.cpp           |   43 +
 src/elevation/ossimElevationCellDatabase.cpp       |  222 +
 src/elevation/ossimElevationDatabase.cpp           |   71 +
 src/elevation/ossimElevationDatabaseFactory.cpp    |  112 +
 .../elevation/ossimElevationDatabaseRegistry.cpp   |    0
 .../elevation/ossimGeneralRasterElevFactory.cpp    |    0
 .../elevation/ossimGeneralRasterElevHandler.cpp    |    0
 .../ossimGeneralRasterElevationDatabase.cpp        |    0
 {ossim/src/ossim => src}/elevation/ossimHgtRef.cpp |    0
 src/elevation/ossimImageElevationDatabase.cpp      |  474 ++
 src/elevation/ossimImageElevationHandler.cpp       |  293 +
 src/elevation/ossimSrtmElevationDatabase.cpp       |  264 +
 src/elevation/ossimSrtmFactory.cpp                 |  167 +
 .../ossim => src}/elevation/ossimSrtmHandler.cpp   |    0
 src/elevation/ossimTiledElevationDatabase.cpp      |  659 ++
 src/examples/tutorial/Makefile                     |   40 +
 .../src => src}/examples/tutorial/band_average.cpp |    0
 .../src => src}/examples/tutorial/image_copy.cpp   |    0
 .../examples/tutorial/image_copy_b1.cpp            |    0
 .../src => src}/examples/tutorial/image_data.cpp   |    0
 .../src => src}/examples/tutorial/image_open.cpp   |    0
 {ossim/src => src}/examples/tutorial/kwl.cpp       |    0
 .../examples/tutorial/ossim_preferences            |    0
 {ossim/src => src}/examples/tutorial/reproject.cpp |    0
 .../writing_your_own_image_processing_filter.html  |    0
 {ossim/src/ossim => src}/font/ossimFont.cpp        |    0
 .../font/ossimFontFactoryRegistry.cpp              |    0
 .../src/ossim => src}/font/ossimFreeTypeFont.cpp   |    0
 .../font/ossimFreeTypeFontFactory.cpp              |    0
 .../src/ossim => src}/font/ossimGdBitmapFont.cpp   |    0
 src/hdf5/ossimHdf5.cpp                             |  776 ++
 src/hdf5/ossimHdf5GridModel.cpp                    |  449 ++
 src/hdf5/ossimHdf5ImageDataset.cpp                 |  832 +++
 src/hdf5/ossimHdf5ImageHandler.cpp                 |  583 ++
 src/hdf5/ossimHdf5Info.cpp                         | 1371 ++++
 src/hdf5/ossimHdf5ProjectionFactory.cpp            |   91 +
 src/hdf5/ossimHdf5Tool.cpp                         |  355 +
 src/hdf5/ossimViirsHandler.cpp                     |   49 +
 src/imaging/ossim3x3ConvolutionFilter.cpp          |  637 ++
 src/imaging/ossimAOD.cpp                           |  237 +
 .../src/ossim => src}/imaging/ossimAdrgHeader.cpp  |    0
 src/imaging/ossimAdrgTileSource.cpp                |  682 ++
 .../imaging/ossimAnnotationEllipseObject.cpp       |    0
 .../imaging/ossimAnnotationFontObject.cpp          |    0
 .../imaging/ossimAnnotationGdBitmapFont.cpp        |    0
 src/imaging/ossimAnnotationLineObject.cpp          |  184 +
 .../imaging/ossimAnnotationMultiEllipseObject.cpp  |    0
 src/imaging/ossimAnnotationMultiLineObject.cpp     |  191 +
 .../imaging/ossimAnnotationMultiPolyLineObject.cpp |    0
 .../imaging/ossimAnnotationMultiPolyObject.cpp     |    0
 src/imaging/ossimAnnotationObject.cpp              |  160 +
 .../imaging/ossimAnnotationObjectFactory.cpp       |    0
 .../imaging/ossimAnnotationPolyObject.cpp          |    0
 .../imaging/ossimAnnotationSource.cpp              |    0
 src/imaging/ossimAppFixedTileCache.cpp             |  430 ++
 src/imaging/ossimAppTileCache.cpp                  |  302 +
 src/imaging/ossimArcInfoGridWriter.cpp             |  374 +
 .../imaging/ossimAtCorrGridRemapper.cpp            |    0
 src/imaging/ossimAtCorrRemapper.cpp                |  730 ++
 .../ossim => src}/imaging/ossimAtbController.cpp   |    0
 .../ossim => src}/imaging/ossimAtbMatchPoint.cpp   |    0
 .../ossim => src}/imaging/ossimAtbPointSource.cpp  |    0
 src/imaging/ossimBandAverageFilter.cpp             |  398 ++
 src/imaging/ossimBandClipFilter.cpp                |  698 ++
 src/imaging/ossimBandLutFilter.cpp                 |  438 ++
 src/imaging/ossimBandMergeSource.cpp               |  286 +
 src/imaging/ossimBandSelector.cpp                  |  722 ++
 src/imaging/ossimBandSeparateHandler.cpp           |  283 +
 src/imaging/ossimBitMaskTileSource.cpp             |  385 +
 src/imaging/ossimBitMaskWriter.cpp                 |  485 ++
 src/imaging/ossimBlendMosaic.cpp                   |  597 ++
 .../imaging/ossimBrightnessContrastSource.cpp      |    0
 src/imaging/ossimBrightnessMatch.cpp               |  247 +
 src/imaging/ossimBumpShadeTileSource.cpp           |  538 ++
 src/imaging/ossimCacheTileSource.cpp               |  671 ++
 src/imaging/ossimCastTileSourceFilter.cpp          |  696 ++
 src/imaging/ossimCcfHead.cpp                       |  822 +++
 src/imaging/ossimCcfTileSource.cpp                 |  905 +++
 src/imaging/ossimCibCadrgTileSource.cpp            | 1361 ++++
 src/imaging/ossimClosestToCenterCombiner.cpp       |  146 +
 .../src/ossim => src}/imaging/ossimCodecBase.cpp   |    0
 src/imaging/ossimCodecFactory.cpp                  |   83 +
 .../imaging/ossimCodecFactoryInterface.cpp         |    0
 .../imaging/ossimCodecFactoryRegistry.cpp          |    0
 src/imaging/ossimColorNormalizedFusion.cpp         |  145 +
 src/imaging/ossimConvolutionFilter1D.cpp           |  672 ++
 src/imaging/ossimConvolutionSource.cpp             |  530 ++
 {ossim/src/ossim => src}/imaging/ossimDdffield.cpp |    0
 .../ossim => src}/imaging/ossimDdffielddefn.cpp    |    0
 .../src/ossim => src}/imaging/ossimDdfmodule.cpp   |    0
 .../src/ossim => src}/imaging/ossimDdfrecord.cpp   |    0
 .../ossim => src}/imaging/ossimDdfsubfielddefn.cpp |    0
 {ossim/src/ossim => src}/imaging/ossimDdfutils.cpp |    0
 src/imaging/ossimDespeckleFilter.cpp               |  240 +
 src/imaging/ossimDilationFilter.cpp                |  311 +
 .../imaging/ossimDiscrete3x3HatFilter.cpp          |    0
 .../imaging/ossimDiscreteConvolutionKernel.cpp     |    0
 src/imaging/ossimDoqqTileSource.cpp                |  260 +
 src/imaging/ossimDtedTileSource.cpp                |  688 ++
 .../ossim => src}/imaging/ossimERSFileWriter.cpp   |    0
 src/imaging/ossimERSTileSource.cpp                 |  219 +
 src/imaging/ossimEastingNorthingCutter.cpp         |  202 +
 src/imaging/ossimEdgeFilter.cpp                    |  720 ++
 src/imaging/ossimElevImageSource.cpp               |  821 +++
 src/imaging/ossimElevRemapper.cpp                  |  284 +
 src/imaging/ossimElevationMosaic.cpp               |  541 ++
 src/imaging/ossimEnviHeaderFileWriter.cpp          |  101 +
 src/imaging/ossimEnviTileSource.cpp                |  298 +
 src/imaging/ossimEquationCombiner.cpp              | 3576 +++++++++
 src/imaging/ossimErosionFilter.cpp                 |  258 +
 .../imaging/ossimEsriShapeFileInterface.cpp        |    0
 src/imaging/ossimFeatherMosaic.cpp                 |  479 ++
 src/imaging/ossimFftFilter.cpp                     |  447 ++
 src/imaging/ossimFgdcFileWriter.cpp                |  955 +++
 src/imaging/ossimFilter.cpp                        |  330 +
 src/imaging/ossimFilterResampler.cpp               |  954 +++
 src/imaging/ossimFilterTable.cpp                   |  148 +
 .../ossim => src}/imaging/ossimFixedTileCache.cpp  |    0
 .../ossim => src}/imaging/ossimFusionCombiner.cpp  |    0
 src/imaging/ossimGammaRemapper.cpp                 |  434 ++
 src/imaging/ossimGeneralRasterInfo.cpp             | 1298 ++++
 src/imaging/ossimGeneralRasterTileSource.cpp       | 1616 +++++
 .../imaging/ossimGeneralRasterWriter.cpp           |    0
 src/imaging/ossimGeoAnnotationBitmap.cpp           |  204 +
 .../imaging/ossimGeoAnnotationEllipseObject.cpp    |    0
 .../imaging/ossimGeoAnnotationFontObject.cpp       |    0
 .../imaging/ossimGeoAnnotationGdBitmapFont.cpp     |    0
 .../imaging/ossimGeoAnnotationLineObject.cpp       |    0
 .../ossimGeoAnnotationMultiEllipseObject.cpp       |    0
 .../ossimGeoAnnotationMultiPolyLineObject.cpp      |    0
 .../imaging/ossimGeoAnnotationMultiPolyObject.cpp  |    0
 .../imaging/ossimGeoAnnotationObject.cpp           |    0
 .../imaging/ossimGeoAnnotationPolyLineObject.cpp   |    0
 .../imaging/ossimGeoAnnotationPolyObject.cpp       |    0
 .../imaging/ossimGeoAnnotationSource.cpp           |    0
 .../ossim => src}/imaging/ossimGeoPolyCutter.cpp   |    0
 .../imaging/ossimGeographicAnnotationGrid.cpp      |    0
 .../ossim => src}/imaging/ossimGeomFileWriter.cpp  |    0
 src/imaging/ossimGpkgWriterInterface.cpp           |   22 +
 .../ossim => src}/imaging/ossimGridRemapEngine.cpp |    0
 src/imaging/ossimGridRemapEngineFactory.cpp        |   44 +
 .../ossim => src}/imaging/ossimGridRemapSource.cpp |    0
 src/imaging/ossimHistoMatchRemapper.cpp            |  349 +
 src/imaging/ossimHistogramEqualization.cpp         |  542 ++
 .../imaging/ossimHistogramMatchFilter.cpp          |    0
 src/imaging/ossimHistogramRemapper.cpp             | 2307 ++++++
 src/imaging/ossimHistogramThreshholdFilter.cpp     |  265 +
 src/imaging/ossimHistogramWriter.cpp               |  309 +
 src/imaging/ossimHsiRemapper.cpp                   | 3192 +++++++++
 src/imaging/ossimHsiToRgbSource.cpp                |  147 +
 src/imaging/ossimHsvGridRemapEngine.cpp            |  280 +
 src/imaging/ossimHsvToRgbSource.cpp                |  159 +
 src/imaging/ossimIgenGenerator.cpp                 |  681 ++
 src/imaging/ossimImageCacheBase.cpp                |  661 ++
 src/imaging/ossimImageCacheTileSource.cpp          |  437 ++
 src/imaging/ossimImageChain.cpp                    | 1835 +++++
 .../ossim => src}/imaging/ossimImageCombiner.cpp   |    0
 src/imaging/ossimImageData.cpp                     | 7556 ++++++++++++++++++++
 src/imaging/ossimImageDataFactory.cpp              |  303 +
 src/imaging/ossimImageDataHelper.cpp               |  627 ++
 .../imaging/ossimImageDisplayWriter.cpp            |    0
 src/imaging/ossimImageFileWriter.cpp               | 1653 +++++
 src/imaging/ossimImageGaussianFilter.cpp           |  245 +
 src/imaging/ossimImageGeometry.cpp                 | 1640 +++++
 src/imaging/ossimImageGeometryFactory.cpp          |  227 +
 src/imaging/ossimImageGeometryRegistry.cpp         |   74 +
 src/imaging/ossimImageHandler.cpp                  | 1807 +++++
 src/imaging/ossimImageHandlerFactory.cpp           | 1103 +++
 src/imaging/ossimImageHandlerFactoryBase.cpp       |   53 +
 src/imaging/ossimImageHandlerRegistry.cpp          |  391 +
 src/imaging/ossimImageHistogramSource.cpp          |  659 ++
 src/imaging/ossimImageMetaData.cpp                 |  571 ++
 .../imaging/ossimImageMetaDataWriterFactory.cpp    |    0
 .../ossimImageMetaDataWriterFactoryBase.cpp        |   28 +
 src/imaging/ossimImageMetaDataWriterRegistry.cpp   |  171 +
 src/imaging/ossimImageModel.cpp                    |  154 +
 src/imaging/ossimImageMosaic.cpp                   |  529 ++
 .../ossimImageReconstructionFilterFactory.cpp      |    0
 .../ossimImageReconstructionFilterRegistry.cpp     |    0
 src/imaging/ossimImageRenderer.cpp                 | 2512 +++++++
 src/imaging/ossimImageSharpenFilter.cpp            |  225 +
 src/imaging/ossimImageSource.cpp                   |  378 +
 src/imaging/ossimImageSourceFactory.cpp            |  625 ++
 .../imaging/ossimImageSourceFactoryBase.cpp        |    0
 .../imaging/ossimImageSourceFactoryRegistry.cpp    |    0
 src/imaging/ossimImageSourceFilter.cpp             |  215 +
 .../imaging/ossimImageSourceHistogramFilter.cpp    |    0
 src/imaging/ossimImageSourceSequencer.cpp          |  621 ++
 src/imaging/ossimImageStatisticsSource.cpp         |  183 +
 src/imaging/ossimImageToPlaneNormalFilter.cpp      |  492 ++
 .../src/ossim => src}/imaging/ossimImageWriter.cpp |    0
 src/imaging/ossimImageWriterFactory.cpp            |  393 +
 .../imaging/ossimImageWriterFactoryBase.cpp        |    0
 src/imaging/ossimImageWriterFactoryRegistry.cpp    |  317 +
 src/imaging/ossimIndexToRgbLutFilter.cpp           |  472 ++
 src/imaging/ossimIntensityAdjustmentFilter.cpp     |  288 +
 src/imaging/ossimJpegCodec.cpp                     |  532 ++
 src/imaging/ossimJpegMemDest.cpp                   |   82 +
 src/imaging/ossimJpegMemSrc.cpp                    |  177 +
 src/imaging/ossimJpegStdIOSrc.cpp                  |  250 +
 .../ossim => src}/imaging/ossimJpegTileSource.cpp  |    0
 .../src/ossim => src}/imaging/ossimJpegWriter.cpp  |    0
 src/imaging/ossimJpegYCbCrToRgbSource.cpp          |  114 +
 src/imaging/ossimKMeansFilter.cpp                  |  421 ++
 src/imaging/ossimKakaduCompressorInterface.cpp     |   21 +
 .../imaging/ossimLandsatTileSource.cpp             |    0
 src/imaging/ossimLandsatTopoCorrectionFilter.cpp   |  360 +
 src/imaging/ossimLasReader.cpp                     | 1290 ++++
 src/imaging/ossimLinearStretchRemapper.cpp         |  237 +
 .../imaging/ossimLocalCorrelationFusion.cpp        |    0
 src/imaging/ossimMapCompositionSource.cpp          | 3800 ++++++++++
 src/imaging/ossimMaskFilter.cpp                    |  878 +++
 src/imaging/ossimMaxMosaic.cpp                     |  559 ++
 src/imaging/ossimMeanMedianFilter.cpp              |  934 +++
 src/imaging/ossimMemoryImageSource.cpp             |  245 +
 src/imaging/ossimMetadataFileWriter.cpp            |  277 +
 src/imaging/ossimMonoGridRemapEngine.cpp           |  520 ++
 src/imaging/ossimMultiBandHistogramTileSource.cpp  |  373 +
 src/imaging/ossimNBandToIndexFilter.cpp            |  565 ++
 src/imaging/ossimNitf20Writer.cpp                  |  840 +++
 src/imaging/ossimNitfTileSource.cpp                | 3683 ++++++++++
 src/imaging/ossimNitfWriter.cpp                    |  943 +++
 src/imaging/ossimNitfWriterBase.cpp                |  404 ++
 src/imaging/ossimNormalizedRemapTable.cpp          |   36 +
 src/imaging/ossimNormalizedS16RemapTable.cpp       |   49 +
 src/imaging/ossimNormalizedU11RemapTable.cpp       |   41 +
 src/imaging/ossimNormalizedU12RemapTable.cpp       |   41 +
 src/imaging/ossimNormalizedU13RemapTable.cpp       |   41 +
 src/imaging/ossimNormalizedU14RemapTable.cpp       |   41 +
 src/imaging/ossimNormalizedU15RemapTable.cpp       |   41 +
 src/imaging/ossimNormalizedU16RemapTable.cpp       |   44 +
 src/imaging/ossimNormalizedU8RemapTable.cpp        |   42 +
 src/imaging/ossimNullPixelFlip.cpp                 |  176 +
 .../imaging/ossimOrthoImageMosaic.cpp              |    0
 .../imaging/ossimOverviewBuilderBase.cpp           |    0
 .../imaging/ossimOverviewBuilderFactory.cpp        |    0
 .../imaging/ossimOverviewBuilderFactoryBase.cpp    |    0
 .../ossimOverviewBuilderFactoryRegistry.cpp        |    0
 src/imaging/ossimOverviewSequencer.cpp             | 1056 +++
 src/imaging/ossimPdfWriter.cpp                     | 1889 +++++
 src/imaging/ossimPiecewiseRemapper.cpp             |  951 +++
 src/imaging/ossimPixelFlipper.cpp                  | 1183 +++
 src/imaging/ossimPolyCutter.cpp                    |  411 ++
 src/imaging/ossimQbTileFilesHandler.cpp            |  330 +
 src/imaging/ossimQuickbirdNitfTileSource.cpp       |  167 +
 src/imaging/ossimQuickbirdTiffTileSource.cpp       |  156 +
 src/imaging/ossimRLevelFilter.cpp                  |  234 +
 src/imaging/ossimRangeDomeTileSource.cpp           |  398 ++
 src/imaging/ossimReadmeFileWriter.cpp              |  454 ++
 src/imaging/ossimRectangleCutFilter.cpp            |  306 +
 src/imaging/ossimResampler.cpp                     | 1263 ++++
 src/imaging/ossimRgbGridRemapEngine.cpp            |  271 +
 {ossim/src/ossim => src}/imaging/ossimRgbImage.cpp |    0
 src/imaging/ossimRgbToGreyFilter.cpp               |  247 +
 src/imaging/ossimRgbToHsiSource.cpp                |  162 +
 src/imaging/ossimRgbToHsvSource.cpp                |  155 +
 src/imaging/ossimRgbToIndexFilter.cpp              |  228 +
 src/imaging/ossimRgbToJpegYCbCrSource.cpp          |   93 +
 src/imaging/ossimRpfCacheTileSource.cpp            | 1314 ++++
 .../ossim => src}/imaging/ossimS16ImageData.cpp    |    0
 .../src/ossim => src}/imaging/ossimSFIMFusion.cpp  |    0
 .../imaging/ossimSICDToDetectedImage.cpp           |    0
 src/imaging/ossimScalarRemapper.cpp                |  637 ++
 src/imaging/ossimScaleFilter.cpp                   |  963 +++
 src/imaging/ossimShiftFilter.cpp                   |  315 +
 src/imaging/ossimSingleImageChain.cpp              | 1023 +++
 .../src/ossim => src}/imaging/ossimSlopeFilter.cpp |    0
 .../ossim => src}/imaging/ossimSrtmTileSource.cpp  |    0
 src/imaging/ossimSubImageTileSource.cpp            |  225 +
 src/imaging/ossimTableRemapper.cpp                 |  596 ++
 src/imaging/ossimTiffOverviewBuilder.cpp           | 1461 ++++
 src/imaging/ossimTiffTileSource.cpp                | 2908 ++++++++
 src/imaging/ossimTiffWriter.cpp                    | 1758 +++++
 .../src/ossim => src}/imaging/ossimTileCache.cpp   |    0
 src/imaging/ossimTilePatch.cpp                     |  526 ++
 src/imaging/ossimTiledImageHandler.cpp             |  638 ++
 src/imaging/ossimTiledImagePatch.cpp               |  234 +
 src/imaging/ossimTiling.cpp                        |  987 +++
 src/imaging/ossimTilingPoly.cpp                    |  369 +
 src/imaging/ossimTilingRect.cpp                    |  886 +++
 src/imaging/ossimTopographicCorrectionFilter.cpp   | 1305 ++++
 src/imaging/ossimTrimFilter.cpp                    |  357 +
 src/imaging/ossimTwoColorView.cpp                  |  420 ++
 .../ossim => src}/imaging/ossimU11ImageData.cpp    |    0
 src/imaging/ossimU12ImageData.cpp                  |  614 ++
 src/imaging/ossimU13ImageData.cpp                  |  614 ++
 src/imaging/ossimU14ImageData.cpp                  |  614 ++
 src/imaging/ossimU15ImageData.cpp                  |  614 ++
 .../ossim => src}/imaging/ossimU16ImageData.cpp    |    0
 .../src/ossim => src}/imaging/ossimU8ImageData.cpp |    0
 src/imaging/ossimUsgsDemTileSource.cpp             |  562 ++
 src/imaging/ossimValueAssignImageSourceFilter.cpp  |  381 +
 .../ossim => src}/imaging/ossimVectorRenderer.cpp  |    0
 .../ossim => src}/imaging/ossimVertexExtractor.cpp |    0
 src/imaging/ossimVpfAnnotationCoverageInfo.cpp     |  217 +
 .../imaging/ossimVpfAnnotationFeatureInfo.cpp      |    0
 src/imaging/ossimVpfAnnotationLibraryInfo.cpp      |  259 +
 .../imaging/ossimVpfAnnotationSource.cpp           |    0
 .../ossim => src}/imaging/ossimVpfTileSource.cpp   |    0
 src/imaging/ossimWatermarkFilter.cpp               | 1163 +++
 .../ossim => src}/imaging/ossimWorldFileWriter.cpp |    0
 src/imaging/ossimWriter.cpp                        |  927 +++
 src/init/ossimInit.cpp                             |  937 +++
 {ossim/src/ossim => src}/matrix/bandmat.cpp        |    0
 {ossim/src/ossim => src}/matrix/bc.mak             |    0
 {ossim/src/ossim => src}/matrix/bc32.mak           |    0
 {ossim/src/ossim => src}/matrix/cc.mak             |    0
 {ossim/src/ossim => src}/matrix/cholesky.cpp       |    0
 {ossim/src/ossim => src}/matrix/evalue.cpp         |    0
 {ossim/src/ossim => src}/matrix/example.txt        |    0
 {ossim/src/ossim => src}/matrix/fft.cpp            |    0
 {ossim/src/ossim => src}/matrix/gnu.mak            |    0
 {ossim/src/ossim => src}/matrix/hholder.cpp        |    0
 {ossim/src/ossim => src}/matrix/jacobi.cpp         |    0
 {ossim/src/ossim => src}/matrix/ms.mak             |    0
 {ossim/src/ossim => src}/matrix/ms_nt.mak          |    0
 {ossim/src/ossim => src}/matrix/myexcept.cpp       |    0
 {ossim/src/ossim => src}/matrix/newfft.cpp         |    0
 {ossim/src/ossim => src}/matrix/newmat.txt         |    0
 {ossim/src/ossim => src}/matrix/newmat1.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat2.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat3.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat4.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat5.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat6.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat7.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat8.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmat9.cpp        |    0
 {ossim/src/ossim => src}/matrix/newmatex.cpp       |    0
 {ossim/src/ossim => src}/matrix/newmatnl.cpp       |    0
 {ossim/src/ossim => src}/matrix/newmatrm.cpp       |    0
 {ossim/src/ossim => src}/matrix/nl_ex.txt          |    0
 {ossim/src/ossim => src}/matrix/sl_ex.txt          |    0
 {ossim/src/ossim => src}/matrix/solution.cpp       |    0
 {ossim/src/ossim => src}/matrix/sort.cpp           |    0
 {ossim/src/ossim => src}/matrix/submat.cpp         |    0
 {ossim/src/ossim => src}/matrix/svd.cpp            |    0
 {ossim/src/ossim => src}/matrix/test_exc.txt       |    0
 {ossim/src/ossim => src}/matrix/watco_nt.mak       |    0
 {ossim/src/ossim => src}/matrix/watcom.mak         |    0
 src/ossimConfig.h.in                               |   23 +
 src/ossimVersion.h.in                              |   14 +
 {ossim/src/ossim => src}/parallel/ossimIgen.cpp    |    0
 src/parallel/ossimImageChainMtAdaptor.cpp          |  489 ++
 src/parallel/ossimImageHandlerMtAdaptor.cpp        |  438 ++
 .../ossimImageMpiMWriterSequenceConnection.cpp     |  291 +
 .../ossimImageMpiSWriterSequenceConnection.cpp     |  350 +
 {ossim/src/ossim => src}/parallel/ossimJob.cpp     |    0
 .../parallel/ossimJobMultiThreadQueue.cpp          |    0
 .../src/ossim => src}/parallel/ossimJobQueue.cpp   |    0
 src/parallel/ossimJobThreadQueue.cpp               |  244 +
 src/parallel/ossimMpi.cpp                          |  190 +
 .../parallel/ossimMpiMasterOverviewSequencer.cpp   |    0
 .../parallel/ossimMpiSlaveOverviewSequencer.cpp    |    0
 src/parallel/ossimMultiThreadSequencer.cpp         |  509 ++
 src/plugin/ossimDynamicLibrary.cpp                 |  102 +
 src/plugin/ossimPluginLibrary.cpp                  |   89 +
 .../plugin/ossimSharedObjectBridge.cpp             |    0
 .../plugin/ossimSharedPluginRegistry.cpp           |    0
 src/point_cloud/ossimGenericPointCloudHandler.cpp  |   69 +
 src/point_cloud/ossimPointBlock.cpp                |  238 +
 src/point_cloud/ossimPointCloudGeometry.cpp        |   78 +
 src/point_cloud/ossimPointCloudHandler.cpp         |   99 +
 src/point_cloud/ossimPointCloudHandlerRegistry.cpp |   97 +
 src/point_cloud/ossimPointCloudImageHandler.cpp    |  831 +++
 .../ossimPointCloudImageHandlerFactory.cpp         |    0
 src/point_cloud/ossimPointCloudSource.cpp          |   66 +
 src/point_cloud/ossimPointCloudUtilityFilter.cpp   |   94 +
 src/point_cloud/ossimPointRecord.cpp               |  179 +
 src/projection/ossimAdjMapModel.cpp                |  430 ++
 .../projection/ossimAffineProjection.cpp           |    0
 src/projection/ossimAlbersProjection.cpp           |  642 ++
 .../ossim => src}/projection/ossimAlphaSensor.cpp  |    0
 .../projection/ossimAlphaSensorHRI.cpp             |    0
 .../projection/ossimAlphaSensorHSI.cpp             |    0
 src/projection/ossimApplanixEcefModel.cpp          |  805 +++
 src/projection/ossimApplanixUtmModel.cpp           |  979 +++
 .../projection/ossimAzimEquDistProjection.cpp      |    0
 .../projection/ossimBilinearProjection.cpp         |    0
 .../projection/ossimBngProjection.cpp              |    0
 src/projection/ossimBonneProjection.cpp            |  535 ++
 src/projection/ossimBuckeyeSensor.cpp              |  720 ++
 src/projection/ossimCadrgProjection.cpp            |  424 ++
 .../projection/ossimCassiniProjection.cpp          |    0
 src/projection/ossimCoarseGridModel.cpp            | 1059 +++
 .../projection/ossimCylEquAreaProjection.cpp       |    0
 .../projection/ossimEckert4Projection.cpp          |    0
 .../projection/ossimEckert6Projection.cpp          |    0
 src/projection/ossimEpsgProjectionDatabase.cpp     | 1005 +++
 .../projection/ossimEpsgProjectionFactory.cpp      |    0
 src/projection/ossimEquDistCylProjection.cpp       |  686 ++
 src/projection/ossimFcsiModel.cpp                  | 1064 +++
 .../projection/ossimGnomonicProjection.cpp         |    0
 src/projection/ossimGoogleProjection.cpp           |  124 +
 src/projection/ossimIkonosRpcModel.cpp             |  984 +++
 src/projection/ossimImageProjectionModel.cpp       |   54 +
 src/projection/ossimImageViewAffineTransform.cpp   |  346 +
 .../ossimImageViewProjectionTransform.cpp          |  748 ++
 .../projection/ossimImageViewTransform.cpp         |    0
 .../projection/ossimImageViewTransformFactory.cpp  |    0
 .../ossim => src}/projection/ossimIpodSensor.cpp   |    0
 .../ossimLambertConformalConicProjection.cpp       |  647 ++
 src/projection/ossimLandSatModel.cpp               | 1204 ++++
 src/projection/ossimLensDistortion.cpp             |  130 +
 src/projection/ossimLlxyProjection.cpp             |  321 +
 src/projection/ossimMapProjection.cpp              | 1699 +++++
 src/projection/ossimMapProjectionFactory.cpp       |  294 +
 .../projection/ossimMapProjectionInfo.cpp          |    0
 .../projection/ossimMapViewController.cpp          |    0
 .../projection/ossimMeanRadialLensDistortion.cpp   |    0
 src/projection/ossimMercatorProjection.cpp         |  503 ++
 {ossim/src/ossim => src}/projection/ossimMgrs.c    |    0
 .../projection/ossimMillerProjection.cpp           |    0
 .../projection/ossimMiscProjectionFactory.cpp      |    0
 src/projection/ossimMollweidProjection.cpp         |  448 ++
 .../ossimNewZealandMapGridProjection.cpp           |    0
 src/projection/ossimNgaProjectionFactory.cpp       |   86 +
 .../ossim => src}/projection/ossimNitfMapModel.cpp |    0
 src/projection/ossimNitfProjectionFactory.cpp      |  992 +++
 src/projection/ossimNitfRpcModel.cpp               |  488 ++
 src/projection/ossimNitfRsmModel.cpp               |  391 +
 src/projection/ossimObliqueMercatorProjection.cpp  |  725 ++
 .../projection/ossimOptimizableProjection.cpp      |    0
 .../projection/ossimOrthoGraphicProjection.cpp     |    0
 .../projection/ossimPolarStereoProjection.cpp      |    0
 {ossim/src/ossim => src}/projection/ossimPolarst.c |    0
 .../projection/ossimPolyconicProjection.cpp        |    0
 .../projection/ossimPolynomProjection.cpp          |    0
 .../projection/ossimPositionQualityEvaluator.cpp   |    0
 src/projection/ossimPpjFrameSensor.cpp             |  475 ++
 .../ossim => src}/projection/ossimProjection.cpp   |    0
 src/projection/ossimProjectionFactoryBase.cpp      |  110 +
 src/projection/ossimProjectionFactoryRegistry.cpp  |  181 +
 .../ossimProjectionViewControllerFactory.cpp       |    0
 .../projection/ossimQuadProjection.cpp             |    0
 src/projection/ossimQuickbirdRpcModel.cpp          |  512 ++
 .../ossim => src}/projection/ossimRS1SarModel.cpp  |    0
 .../projection/ossimRadialDecentLensDistortion.cpp |    0
 src/projection/ossimRpcModel.cpp                   | 1399 ++++
 src/projection/ossimRpcProjection.cpp              | 1393 ++++
 src/projection/ossimRpcSolver.cpp                  |  827 +++
 src/projection/ossimRsmModel.cpp                   |  720 ++
 src/projection/ossimSarModel.cpp                   | 1418 ++++
 src/projection/ossimSensorModel.cpp                | 1800 +++++
 src/projection/ossimSensorModelFactory.cpp         |  721 ++
 .../projection/ossimSensorModelTuple.cpp           |    0
 .../src/ossim => src}/projection/ossimSinusoid.c   |    0
 src/projection/ossimSinusoidalProjection.cpp       |  450 ++
 .../projection/ossimSkyBoxLearSensor.cpp           |    0
 .../projection/ossimSmacCallibrationSystem.cpp     |    0
 .../ossim => src}/projection/ossimSonomaSensor.cpp |    0
 .../ossimSpaceObliqueMercatorProjection.cpp        |  413 ++
 src/projection/ossimSpectraboticsRedEdgeModel.cpp  |  788 ++
 .../ossim => src}/projection/ossimSpot5Model.cpp   |    0
 .../projection/ossimStatePlaneProjectionInfo.cpp   |    0
 .../projection/ossimStereographicProjection.cpp    |    0
 .../ossimTangentialRadialLensDistortion.cpp        |  103 +
 .../projection/ossimTiffProjectionFactory.cpp      |    0
 .../src/ossim => src}/projection/ossimTranmerc.c   |    0
 src/projection/ossimTransCylEquAreaProjection.cpp  |  598 ++
 src/projection/ossimTransMercatorProjection.cpp    |  734 ++
 {ossim/src/ossim => src}/projection/ossimUps.c     |    0
 src/projection/ossimUpsProjection.cpp              |  344 +
 {ossim/src/ossim => src}/projection/ossimUpspt.cpp |    0
 {ossim/src/ossim => src}/projection/ossimUtm.c     |    0
 src/projection/ossimUtmProjection.cpp              |  932 +++
 src/projection/ossimUtmpt.cpp                      |   88 +
 src/projection/ossimVanDerGrintenProjection.cpp    |  525 ++
 .../projection/ossimWarpProjection.cpp             |    0
 src/projection/ossimWktProjectionFactory.cpp       |  492 ++
 src/sockets/ossimToolClient.cpp                    |  321 +
 src/sockets/ossimToolServer.cpp                    |  473 ++
 .../ossim => src}/support_data/ossimAigBounds.cpp  |    0
 .../support_data/ossimAigDataFileHeader.cpp        |    0
 .../ossim => src}/support_data/ossimAigHeader.cpp  |    0
 .../support_data/ossimAigIndexFileHeader.cpp       |    0
 .../support_data/ossimAigStatistics.cpp            |    0
 src/support_data/ossimAlphaSensorSupportData.cpp   |  702 ++
 src/support_data/ossimApplanixEOFile.cpp           |  717 ++
 src/support_data/ossimAuxFileHandler.cpp           | 1138 +++
 src/support_data/ossimAuxXmlSupportData.cpp        |  353 +
 src/support_data/ossimCcfInfo.cpp                  |   69 +
 .../ossim => src}/support_data/ossimCeosData.cpp   |    0
 src/support_data/ossimDemGrid.cpp                  |  249 +
 src/support_data/ossimDemHeader.cpp                |  889 +++
 src/support_data/ossimDemInfo.cpp                  |   76 +
 src/support_data/ossimDemPoint.cpp                 |   16 +
 src/support_data/ossimDemProfile.cpp               |  155 +
 src/support_data/ossimDemStats.cpp                 |  126 +
 src/support_data/ossimDemUtil.cpp                  |  211 +
 src/support_data/ossimDoqq.cpp                     |  437 ++
 src/support_data/ossimDtedAcc.cpp                  |  261 +
 src/support_data/ossimDtedDsi.cpp                  |  558 ++
 src/support_data/ossimDtedHdr.cpp                  |  207 +
 src/support_data/ossimDtedInfo.cpp                 |  271 +
 .../ossim => src}/support_data/ossimDtedRecord.cpp |    0
 src/support_data/ossimDtedUhl.cpp                  |  290 +
 src/support_data/ossimDtedVol.cpp                  |  226 +
 src/support_data/ossimERS.cpp                      |  681 ++
 .../ossim => src}/support_data/ossimEnviHeader.cpp |    0
 src/support_data/ossimEnviInfo.cpp                 |   78 +
 .../src/ossim => src}/support_data/ossimFfL5.cpp   |    0
 .../src/ossim => src}/support_data/ossimFfL7.cpp   |    0
 src/support_data/ossimFfRevb.cpp                   | 1132 +++
 src/support_data/ossimFfRevc.cpp                   | 1653 +++++
 src/support_data/ossimFgdcTxtDoc.cpp               |  306 +
 src/support_data/ossimFgdcXmlDoc.cpp               |  548 ++
 src/support_data/ossimGeoTiff.cpp                  | 2183 ++++++
 src/support_data/ossimGmlSupportData.cpp           | 1445 ++++
 src/support_data/ossimIkonosMetaData.cpp           |  599 ++
 src/support_data/ossimInfoBase.cpp                 |   67 +
 src/support_data/ossimInfoFactory.cpp              |  374 +
 src/support_data/ossimInfoFactoryRegistry.cpp      |  150 +
 src/support_data/ossimJ2kCodRecord.cpp             |  159 +
 src/support_data/ossimJ2kInfo.cpp                  |  238 +
 src/support_data/ossimJ2kSizRecord.cpp             |  295 +
 src/support_data/ossimJ2kSotRecord.cpp             |  127 +
 src/support_data/ossimJ2kTlmRecord.cpp             |  536 ++
 src/support_data/ossimJp2Info.cpp                  |  685 ++
 .../support_data/ossimJpipMessage.cpp              |    0
 .../support_data/ossimJpipMessageDecoder.cpp       |    0
 src/support_data/ossimLasHdr.cpp                   |  626 ++
 src/support_data/ossimLasInfo.cpp                  |   59 +
 src/support_data/ossimLasPointRecord0.cpp          |  208 +
 src/support_data/ossimLasPointRecord1.cpp          |  213 +
 src/support_data/ossimLasPointRecord2.cpp          |  224 +
 src/support_data/ossimLasPointRecord3.cpp          |  230 +
 src/support_data/ossimLasPointRecord4.cpp          |  248 +
 src/support_data/ossimNitfAcftbTag.cpp             |  264 +
 src/support_data/ossimNitfAimidbTag.cpp            |  171 +
 src/support_data/ossimNitfBlockaTag.cpp            |  325 +
 src/support_data/ossimNitfCommon.cpp               |  545 ++
 src/support_data/ossimNitfCompressionHeader.cpp    |   20 +
 .../support_data/ossimNitfCsccgaTag.cpp            |    0
 src/support_data/ossimNitfCscrnaTag.cpp            |  154 +
 src/support_data/ossimNitfCsdidaTag.cpp            |  149 +
 src/support_data/ossimNitfCsexraTag.cpp            |  337 +
 src/support_data/ossimNitfCsproaTag.cpp            |   94 +
 .../support_data/ossimNitfDataExtensionSegment.cpp |    0
 .../ossimNitfDataExtensionSegmentV2_0.cpp          |    0
 .../ossimNitfDataExtensionSegmentV2_1.cpp          |    0
 src/support_data/ossimNitfDesFactory.cpp           |   23 +
 src/support_data/ossimNitfDesFactoryRegistry.cpp   |   99 +
 src/support_data/ossimNitfDesInformation.cpp       |  325 +
 src/support_data/ossimNitfEmbeddedRpfDes.cpp       |   38 +
 src/support_data/ossimNitfEngrdaTag.cpp            |  243 +
 .../support_data/ossimNitfExoptaTag.cpp            |    0
 src/support_data/ossimNitfFile.cpp                 |  571 ++
 src/support_data/ossimNitfFileHeader.cpp           |  229 +
 src/support_data/ossimNitfFileHeaderV2_0.cpp       | 1715 +++++
 src/support_data/ossimNitfFileHeaderV2_1.cpp       | 2188 ++++++
 src/support_data/ossimNitfFileHeaderV2_X.cpp       |  546 ++
 src/support_data/ossimNitfGeoPositioningTag.cpp    |  142 +
 .../support_data/ossimNitfHistoaTag.cpp            |    0
 src/support_data/ossimNitfIchipbTag.cpp            |  612 ++
 src/support_data/ossimNitfImageBand.cpp            |   26 +
 src/support_data/ossimNitfImageBandV2_0.cpp        |  222 +
 .../support_data/ossimNitfImageBandV2_1.cpp        |    0
 .../support_data/ossimNitfImageDataMaskV2_1.cpp    |    0
 src/support_data/ossimNitfImageHeader.cpp          |  419 ++
 src/support_data/ossimNitfImageHeaderV2_0.cpp      | 1064 +++
 src/support_data/ossimNitfImageHeaderV2_1.cpp      | 1888 +++++
 src/support_data/ossimNitfImageHeaderV2_X.cpp      | 1046 +++
 src/support_data/ossimNitfImageLut.cpp             |   34 +
 .../support_data/ossimNitfImageLutV2_0.cpp         |    0
 .../support_data/ossimNitfImageLutV2_1.cpp         |    0
 src/support_data/ossimNitfInfo.cpp                 |   78 +
 src/support_data/ossimNitfJ2klraTag.cpp            |  349 +
 .../support_data/ossimNitfLabelHeader.cpp          |    0
 .../support_data/ossimNitfLabelHeaderV2_0.cpp      |    0
 src/support_data/ossimNitfLocalCartographicTag.cpp |  137 +
 src/support_data/ossimNitfLocalGeographicTag.cpp   |  110 +
 src/support_data/ossimNitfMstgtaTag.cpp            |  134 +
 src/support_data/ossimNitfNameConversionTables.cpp |  163 +
 src/support_data/ossimNitfPiaimcTag.cpp            |  411 ++
 .../ossimNitfProjectionParameterTag.cpp            |  212 +
 src/support_data/ossimNitfRegisteredDes.cpp        |  116 +
 src/support_data/ossimNitfRegisteredDesFactory.cpp |   46 +
 src/support_data/ossimNitfRegisteredTag.cpp        |  116 +
 src/support_data/ossimNitfRegisteredTagFactory.cpp |  215 +
 src/support_data/ossimNitfRpcATag.cpp              |   24 +
 src/support_data/ossimNitfRpcBTag.cpp              |   22 +
 src/support_data/ossimNitfRpcBase.cpp              | 1038 +++
 src/support_data/ossimNitfRpfTagFactory.cpp        |   54 +
 .../support_data/ossimNitfRsmecaTag.cpp            |    0
 .../support_data/ossimNitfRsmidaTag.cpp            |    0
 .../support_data/ossimNitfRsmpcaTag.cpp            |    0
 .../support_data/ossimNitfRsmpiaTag.cpp            |    0
 src/support_data/ossimNitfSensraTag.cpp            |  444 ++
 src/support_data/ossimNitfStdidcTag.cpp            |  468 ++
 src/support_data/ossimNitfStreobTag.cpp            |   97 +
 .../support_data/ossimNitfSymbolHeader.cpp         |    0
 .../support_data/ossimNitfSymbolHeaderV2_0.cpp     |    0
 .../support_data/ossimNitfTagFactory.cpp           |    0
 .../support_data/ossimNitfTagFactoryRegistry.cpp   |    0
 src/support_data/ossimNitfTagInformation.cpp       |  210 +
 .../support_data/ossimNitfTextHeader.cpp           |    0
 .../support_data/ossimNitfTextHeaderV2_0.cpp       |    0
 .../support_data/ossimNitfTextHeaderV2_1.cpp       |    0
 src/support_data/ossimNitfUnknownTag.cpp           |  142 +
 src/support_data/ossimNitfUse00aTag.cpp            |  539 ++
 src/support_data/ossimNitfVqCompressionHeader.cpp  |  349 +
 src/support_data/ossimNitfXmlDataContentDes.cpp    |  190 +
 src/support_data/ossimNmeaMessage.cpp              |   98 +
 .../support_data/ossimNmeaMessageSequencer.cpp     |    0
 .../support_data/ossimPpjFrameSensorFile.cpp       |    0
 src/support_data/ossimQuickbirdMetaData.cpp        | 1080 +++
 src/support_data/ossimQuickbirdRpcHeader.cpp       |  246 +
 .../support_data/ossimQuickbirdTile.cpp            |    0
 src/support_data/ossimRpfAttributeOffsetRecord.cpp |   59 +
 .../ossimRpfAttributeSectionSubheader.cpp          |   87 +
 src/support_data/ossimRpfAttributes.cpp            |  170 +
 .../support_data/ossimRpfBoundaryRectRecord.cpp    |    0
 .../ossimRpfBoundaryRectSectionSubheader.cpp       |    0
 .../support_data/ossimRpfBoundaryRectTable.cpp     |    0
 .../ossimRpfColorConverterOffsetRecord.cpp         |   61 +
 .../ossimRpfColorConverterSubsection.cpp           |  131 +
 src/support_data/ossimRpfColorConverterTable.cpp   |   93 +
 .../ossimRpfColorGrayscaleOffsetRecord.cpp         |   70 +
 .../ossimRpfColorGrayscaleSubheader.cpp            |   60 +
 src/support_data/ossimRpfColorGrayscaleTable.cpp   |  153 +
 .../support_data/ossimRpfComponentIdLut.cpp        |    0
 .../ossimRpfCompressionLookupOffsetRecord.cpp      |   65 +
 src/support_data/ossimRpfCompressionSection.cpp    |  199 +
 .../ossimRpfCompressionSectionSubheader.cpp        |   63 +
 src/support_data/ossimRpfCoverageSection.cpp       |  295 +
 src/support_data/ossimRpfFrame.cpp                 | 1144 +++
 src/support_data/ossimRpfFrameEntry.cpp            |  125 +
 .../support_data/ossimRpfFrameFileIndexRecord.cpp  |    0
 .../ossimRpfFrameFileIndexSectionSubheader.cpp     |    0
 .../ossimRpfFrameFileIndexSubsection.cpp           |    0
 .../support_data/ossimRpfFrameFileReader.cpp       |    0
 src/support_data/ossimRpfHeader.cpp                |  872 +++
 .../ossimRpfImageDescriptionSubheader.cpp          |  114 +
 .../ossimRpfImageDisplayParameterSubheader.cpp     |   68 +
 src/support_data/ossimRpfInfo.cpp                  |   92 +
 src/support_data/ossimRpfLocationSection.cpp       |  315 +
 .../support_data/ossimRpfMaskSubheader.cpp         |    0
 .../support_data/ossimRpfMaskSubsection.cpp        |    0
 .../support_data/ossimRpfPathnameRecord.cpp        |    0
 .../support_data/ossimRpfReplaceUpdateRecord.cpp   |    0
 .../ossimRpfReplaceUpdateSectionSubheader.cpp      |    0
 .../support_data/ossimRpfReplaceUpdateTable.cpp    |    0
 src/support_data/ossimRpfToc.cpp                   | 1306 ++++
 src/support_data/ossimRpfTocEntry.cpp              |  279 +
 src/support_data/ossimRsmida.cpp                   | 1662 +++++
 src/support_data/ossimRsmpca.cpp                   |  840 +++
 src/support_data/ossimRsmpia.cpp                   |  594 ++
 .../support_data/ossimSpaceImagingGeom.cpp         |    0
 .../support_data/ossimSpotDimapSupportData.cpp     |    0
 .../ossim => src}/support_data/ossimSrcRecord.cpp  |    0
 .../support_data/ossimSrtmFilename.cpp             |    0
 src/support_data/ossimSrtmSupportData.cpp          |  917 +++
 src/support_data/ossimSupportFilesList.cpp         |   42 +
 src/support_data/ossimTiffInfo.cpp                 | 4191 +++++++++++
 src/support_data/ossimTiffWorld.cpp                |  268 +
 src/support_data/ossimWavelength.cpp               |  203 +
 src/support_data/ossimWkt.cpp                      |  273 +
 src/support_data/ossimXmpInfo.cpp                  |  644 ++
 src/util/Notes.txt                                 |   34 +
 src/util/ossimAutRegUtil.cpp                       | 1747 +++++
 src/util/ossimBandMergeTool.cpp                    |  185 +
 src/util/ossimBatchTest.cpp                        | 1261 ++++
 src/util/ossimChipProcTool.cpp                     | 1509 ++++
 src/util/ossimChipperUtil.cpp                      | 5646 +++++++++++++++
 src/util/ossimEquationUtil.cpp                     |  408 ++
 src/util/ossimFileWalker.cpp                       |  534 ++
 src/util/ossimHillshadeTool.cpp                    |  256 +
 src/util/ossimHlzTool.cpp                          |  737 ++
 src/util/ossimImageUtil.cpp                        | 2165 ++++++
 src/util/ossimInfo.cpp                             | 3211 +++++++++
 src/util/ossimOrthoIgen.cpp                        | 3042 ++++++++
 src/util/ossimOrthoTool.cpp                        |   82 +
 src/util/ossimPointCloudUtil.cpp                   |  266 +
 src/util/ossimRpfUtil.cpp                          |  348 +
 src/util/ossimShorelineTool.cpp                    |  631 ++
 src/util/ossimSlopeTool.cpp                        |  134 +
 src/util/ossimTool.cpp                             |  192 +
 src/util/ossimToolFactory.cpp                      |  119 +
 src/util/ossimToolRegistry.cpp                     |   81 +
 src/util/ossimVerticesFinderTool.cpp               |  171 +
 src/util/ossimViewshedTool.cpp                     | 1057 +++
 .../vec/ossimVpfBoundingRecordTable.cpp            |    0
 {ossim/src/ossim => src}/vec/ossimVpfCoverage.cpp  |    0
 src/vec/ossimVpfDatabase.cpp                       |  190 +
 .../ossim => src}/vec/ossimVpfDatabaseHeader.cpp   |    0
 src/vec/ossimVpfDatabaseHeaderTableValidator.cpp   |  132 +
 {ossim/src/ossim => src}/vec/ossimVpfExtent.cpp    |    0
 src/vec/ossimVpfFeatureClass.cpp                   |  151 +
 src/vec/ossimVpfFeatureClassSchema.cpp             |  148 +
 {ossim/src/ossim => src}/vec/ossimVpfLibrary.cpp   |    0
 .../vec/ossimVpfLibraryAttributeTableValidator.cpp |    0
 {ossim/src/ossim => src}/vec/ossimVpfTable.cpp     |    0
 {ossim/src/ossim => src}/version-config.cpp        |    0
 .../src/ossim => src}/video/ossimVideoGeometry.cpp |    0
 .../src/ossim => src}/video/ossimVideoHandler.cpp  |    0
 .../ossim => src}/video/ossimVideoImageHandler.cpp |    0
 .../ossim => src}/video/ossimVideoImageSource.cpp  |    0
 .../src/ossim => src}/video/ossimVideoSource.cpp   |    0
 {ossim/src/ossim => src}/vpfutil/bitarray.c        |    0
 {ossim/src/ossim => src}/vpfutil/distance.c        |    0
 src/vpfutil/linklist.c                             |  712 ++
 {ossim/src/ossim => src}/vpfutil/polygrf.c         |    0
 {ossim/src/ossim => src}/vpfutil/set.c             |    0
 src/vpfutil/vpfclip.c                              |  293 +
 src/vpfutil/vpfcntnt.c                             |  513 ++
 src/vpfutil/vpfdict.c                              |  238 +
 {ossim/src/ossim => src}/vpfutil/vpfdisp.c         |    0
 {ossim/src/ossim => src}/vpfutil/vpfdraw.c         |    0
 src/vpfutil/vpfmisc.c                              | 1837 +++++
 {ossim/src/ossim => src}/vpfutil/vpfnear.c         |    0
 src/vpfutil/vpfprim.c                              | 1137 +++
 {ossim/src/ossim => src}/vpfutil/vpfptply.c        |    0
 src/vpfutil/vpfquery.c                             |  972 +++
 {ossim/src/ossim => src}/vpfutil/vpfread.c         |    0
 src/vpfutil/vpfrelat.c                             |  907 +++
 src/vpfutil/vpfselec.c                             | 1320 ++++
 {ossim/src/ossim => src}/vpfutil/vpfspx.c          |    0
 {ossim/src/ossim => src}/vpfutil/vpftable.c        |    0
 {ossim/src/ossim => src}/vpfutil/vpftidx.c         |    0
 {ossim/src/ossim => src}/vpfutil/vpfwrite.c        |    0
 support/linux/etc/ld.so.conf.d/ossim.conf          |    2 +
 support/linux/etc/profile.d/ossim.csh              |   19 +
 support/linux/etc/profile.d/ossim.sh               |   20 +
 support/linux/rpm_specs/ossim-all-el6.spec         |  565 ++
 support/linux/rpm_specs/ossim-all-el7.spec         |  565 ++
 support/linux/rpm_specs/ossim-el6.spec             |  507 ++
 support/linux/rpm_specs/ossim-el7.spec             |  507 ++
 .../linux/rpm_specs/ossim-kakadu-plugin-el6.spec   |   89 +
 .../linux/rpm_specs/ossim-kakadu-plugin-el7.spec   |   89 +
 .../linux/rpm_specs/ossim-mrsid-plugin-el6.spec    |   72 +
 .../linux/rpm_specs/ossim-mrsid-plugin-el7.spec    |   72 +
 support/linux/service-wrapper-initd-template       |  213 +
 support/linux/service-wrapper-systemd-template     |    9 +
 test/README.md                                     |    5 +
 test/config/README.md                              |   19 +
 test/config/applanix-test.kwl                      |  214 +
 test/config/dot1.kwl                               |   98 +
 test/config/dot2.kwl                               |  109 +
 test/config/eq-test.kwl                            |   28 +
 test/config/fusion-test1.kwl                       |  109 +
 test/config/genras-writer-test.kwl                 |  198 +
 test/config/height-info-test.kwl                   |   44 +
 test/config/hlz-test.kwl                           |   47 +
 test/config/index-to-rgb-lut.kwl                   |   46 +
 test/config/lut-test.kwl                           |   60 +
 test/config/ossim-chipper-test.kwl                 |  300 +
 test/config/potrace-test.kwl                       |   41 +
 test/config/super-test.kwl                         |   69 +
 test/config/test1.kwl                              |  133 +
 test/config/viewshed-test.kwl                      |   47 +
 test/config/wrap-test.kwl                          |   76 +
 test/src/CMakeLists.txt                            |   23 +
 test/src/base/CMakeLists.txt                       |   30 +
 test/src/base/ossim-argument-parser-test.cpp       |   78 +
 .../src/base}/ossim-byte-stream-buffer-test.cpp    |    0
 .../test => test/src/base}/ossim-csv-file-test.cpp |    0
 test/src/base/ossim-date-test.cpp                  |   56 +
 .../test => test/src/base}/ossim-datum-shift.cpp   |    0
 test/src/base/ossim-directory-test.cpp             |   80 +
 .../src/test => test/src/base}/ossim-dms-test.cpp  |    0
 .../test => test/src/base}/ossim-duration-test.cpp |    0
 test/src/base/ossim-filename-test.cpp              |  210 +
 test/src/base/ossim-gpt-test.cpp                   |  141 +
 .../test => test/src/base}/ossim-histo-compare.cpp |    0
 test/src/base/ossim-keywordlist-test.cpp           |  399 ++
 test/src/base/ossim-kmeans-clustering-test.cpp     |  123 +
 .../src/base}/ossim-least-squares-plane-test.cpp   |    0
 .../src/base}/ossim-lsr-space-test.cpp             |    0
 test/src/base/ossim-notify-test.cpp                |   51 +
 .../test => test/src/base}/ossim-obj-allocate.cpp  |    0
 test/src/base/ossim-point-test.cpp                 |  184 +
 test/src/base/ossim-rect-test.cpp                  |  160 +
 test/src/base/ossim-ref-ptr-test.cpp               |   90 +
 test/src/base/ossim-stream-factory-test.cpp        |  133 +
 .../test => test/src/base}/ossim-string-test.cpp   |    0
 .../src/base}/ossim-thin-plate-spline-test.cpp     |    0
 .../src/base}/ossim-threaded-logfile-test.cpp      |    0
 .../src/base}/ossim-threaded-polyarea2d-test.cpp   |    0
 .../test => test/src/base}/ossim-visitor-test.cpp  |    0
 test/src/base/ossim-xml-test.cpp                   |   48 +
 test/src/elevation/CMakeLists.txt                  |    8 +
 test/src/elevation/ossim-dted-handler-test.cpp     |   80 +
 .../src/elevation/ossim-elevation-manager-test.cpp |   55 +
 test/src/elevation/ossim-image-elevation-test.cpp  |   99 +
 .../elevation}/ossim-threaded-elevation-test.cpp   |    0
 test/src/elevation/ossim-tiled-elevation-test.cpp  |  208 +
 test/src/gsoc/CMakeLists.txt                       |    3 +
 {ossim/src/test => test/src/gsoc}/ossim-gsoc1.cpp  |    0
 test/src/hdf5/CMakeLists.txt                       |    2 +
 test/src/hdf5/ossim-hdf5-info.cpp                  |   55 +
 test/src/hdf5/ossim-hdf5-test.cpp                  |   56 +
 test/src/imaging/CMakeLists.txt                    |   26 +
 test/src/imaging/ossim-band-lut-test.cpp           |  199 +
 test/src/imaging/ossim-fft-test.cpp                |  269 +
 test/src/imaging/ossim-get-pixel-test.cpp          |  218 +
 test/src/imaging/ossim-gpkg-writer-test.cpp        |  232 +
 test/src/imaging/ossim-gsd-test.cpp                |  118 +
 test/src/imaging/ossim-histogram-test.cpp          |  111 +
 test/src/imaging/ossim-image-chain-test.cpp        |   80 +
 .../src/imaging}/ossim-image-handler-test.cpp      |    0
 .../src/imaging}/ossim-image-writer-test.cpp       |    0
 test/src/imaging/ossim-index-to-rgb-lut-test.cpp   |  196 +
 test/src/imaging/ossim-kmeans-filter-test.cpp      |  195 +
 .../imaging/ossim-linear-stretch-remapper-test.cpp |   96 +
 test/src/imaging/ossim-loadtile-test.cpp           |  130 +
 test/src/imaging/ossim-mask-filter-test.cpp        |  181 +
 test/src/imaging/ossim-piecewise-remapper-test.cpp |  252 +
 .../src/imaging}/ossim-pixel-flipper-test.cpp      |    0
 test/src/imaging/ossim-range-dome-test.cpp         |  247 +
 .../imaging}/ossim-read-write-consistency-test.cpp |    0
 test/src/imaging/ossim-remap-table-test.cpp        |  359 +
 test/src/imaging/ossim-shift-filter-test.cpp       |  200 +
 test/src/imaging/ossim-single-image-chain-test.cpp |  165 +
 .../ossim-single-image-chain-threaded-test.cpp     |  101 +
 .../ossim-threaded-app-tile-cache-test.cpp         |    0
 .../src/imaging}/ossim-threaded-chain-test.cpp     |    0
 test/src/ossim-batch-test.cpp                      |   72 +
 test/src/ossim-foo.cpp                             |  112 +
 {ossim/src/test => test/src}/ossim-test.cpp        |    0
 test/src/parallel/CMakeLists.txt                   |    3 +
 .../src/parallel}/ossim-jobqueue-test.cpp          |    0
 test/src/point_cloud/CMakeLists.txt                |    3 +
 .../ossim-point-cloud-handler-test.cpp             |    0
 .../ossim-point-cloud-image-handler-test.cpp       |    0
 test/src/projection/CMakeLists.txt                 |   10 +
 .../src/projection}/ossim-epsg-factory-test.cpp    |    0
 test/src/projection/ossim-eq-projection-test.cpp   |   54 +
 test/src/projection/ossim-image-geometry-test.cpp  |  362 +
 test/src/projection/ossim-nitf-rsm-model-test.cpp  |  467 ++
 .../projection}/ossim-projection-factory-test.cpp  |    0
 .../src/projection}/ossim-projection-test.cpp      |    0
 .../projection}/ossim-wkt-proj-factory-test.cpp    |    0
 .../src/projection}/ossim-wkt-test.cpp             |    0
 test/src/support_data/CMakeLists.txt               |   10 +
 .../src/support_data}/ossim-aux-dot-xml-test.cpp   |    0
 test/src/support_data/ossim-envi-hdr-test.cpp      |   48 +
 test/src/support_data/ossim-fgdc-txt-doc-test.cpp  |   73 +
 .../support_data/ossim-quickbird-metadata-test.cpp |   73 +
 .../support_data/ossim-srtm-support-data-test.cpp  |   48 +
 test/src/support_data/ossim-tiff-info-test.cpp     |   82 +
 test/src/support_data/ossim-wavelength-test.cpp    |  127 +
 test/src/util/CMakeLists.txt                       |    7 +
 test/src/util/ossim-chipper-test.cpp               |  122 +
 test/src/util/ossim-info-test.cpp                  |   95 +
 test/src/util/ossim-tools-test.cpp                 |   88 +
 test/src/util/ossim-viewshed-test.cpp              |   72 +
 test/src/vec/CMakeLists.txt                        |    3 +
 .../test => test/src/vec}/ossim-dump-vpf-table.cpp |    0
 3367 files changed, 405552 insertions(+), 347329 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3028b2d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+*~
+include/ossim/ossimConfig.h
+include/ossim/ossimVersion.h
+doc/html
+*CMakeFiles*
+*Makefile
+cmake_install*
+*.swp
+CMakeCache.txt
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ab8260f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,278 @@
+PROJECT(ossim)
+SET(CMAKE_MODULE_PATH "${${PROJECT_NAME}_SOURCE_DIR}/cmake/CMakeModules;${CMAKE_MODULE_PATH}")
+
+Message("################## Setting up OSSIM core library #########################")
+
+IF(NOT OSSIM_BUILD_ADDITIONAL_OSSIM_DIRECTORIES)
+   SET(OSSIM_BUILD_ADDITIONAL_OSSIM_DIRECTORIES "" CACHE PATH "Specify full paths separated by ; to additional OSSIM applications you wish to include into the ossim build framework.  These will have variables setup for the ossim includes" FORCE)
+ENDIF(NOT OSSIM_BUILD_ADDITIONAL_OSSIM_DIRECTORIES)
+
+cmake_minimum_required(VERSION 2.8)
+
+INCLUDE(OssimVersion)
+INCLUDE(OssimCommonVariables)
+
+# Expose some build options
+OPTION(BUILD_OSSIM_FREETYPE_SUPPORT "Set to ON to build OSSIM with freetype support.  Use OFF to turn off freetype support." ON)
+OPTION(BUILD_OSSIM_MPI_SUPPORT "Set to ON to build OSSIM with MPI support.  Use OFF to turn off MPI support." OFF)
+OPTION(BUILD_OSSIM_ID_SUPPORT "Set to ON to build OSSIM GIT ID support into the library.  Use OFF to turn off ID support." ON)
+
+OPTION(BUILD_OSSIM_APPS "Set to ON to build OSSIM applications." ON)
+OPTION(BUILD_OSSIM_CURL_APPS "Set to ON to build ossim curl dependent apps. Use ON to enable." OFF)
+OPTION(BUILD_OSSIM_TESTS "Set to ON to build OSSIM unit/functional tests." ON)
+
+###################################################################################
+# Include the Utilities in the root make
+###################################################################################
+INCLUDE(OssimUtilities)
+
+INCLUDE(CheckIncludeFile)
+CHECK_INCLUDE_FILE("dirent.h" CMAKE_HAVE_DIRENT_H)
+CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
+CHECK_INCLUDE_FILE("getopt.h" CMAKE_HAVE_GETOPT_H)
+CHECK_INCLUDE_FILE("fcntl.h" CMAKE_HAVE_FCNTL_H)
+CHECK_INCLUDE_FILE("dbmalloc.h" CMAKE_HAVE_DBMALLOC_H)
+CHECK_INCLUDE_FILE("malloc.h" CMAKE_HAVE_MALLOC_H)
+CHECK_INCLUDE_FILE("dlfcn.h" CMAKE_HAVE_DLFCN_H)
+
+# Set our include paths:
+include_directories( ${PROJECT_SOURCE_DIR}/include )
+include_directories( ${PROJECT_BINARY_DIR}/include )
+include_directories( ${OSSIM_INCLUDE_DIR} )
+
+# Stores list of libs to link with. Initialized throughout.
+set( ossimDependentLibs )
+
+#---
+# Find required and optional packages and add their include paths and libraries:
+#---
+
+# GEOS - Currently optional until it is actually called.:
+find_package( GEOS )
+if( GEOS_FOUND )
+   include_directories( ${GEOS_INCLUDE_DIR} )
+   set( ossimDependentLibs ${ossimDependentLibs} ${GEOS_LIBRARY} )
+else( GEOS_FOUND )
+   message( FATAL_ERROR "Could not find geos package! Consider installing this as it will soon become a required package." )
+endif( GEOS_FOUND )
+
+# GEOFIFF - Required:
+set( OSSIM_HAS_GEOTIFF 0 )
+find_package( GEOTIFF )
+if( GEOTIFF_FOUND )
+   include_directories( ${GEOTIFF_INCLUDE_DIR} )
+   set( ossimDependentLibs ${ossimDependentLibs} ${GEOTIFF_LIBRARY} )
+   set( OSSIM_HAS_GEOTIFF 1 )
+else( GEOTIFF_FOUND )
+   message( FATAL_ERROR "Could not find required geotiff package!" )
+endif( GEOTIFF_FOUND )
+
+# GEOTRANS - Required: (GeoTrans 3.4.x port future...)
+# find_package( Geotrans )
+# if( GEOTRANS_FOUND )
+#   include_directories( ${GEOTRANS_INCLUDE_DIR} )
+#   set( ossimDependentLibs ${ossimDependentLibs} ${GEOTRANS_LIBRARY} )
+# else( GEOTRANS_FOUND )
+#   message( FATAL_ERROR "Could not find required geotrans package!" )
+# endif( GEOTRANS_FOUND )
+
+# JPEG - Required package:
+find_package( JPEG )
+if( JPEG_FOUND )
+   include_directories( ${JPEG_INCLUDE_DIR} )
+   set( ossimDependentLibs ${ossimDependentLibs} ${JPEG_LIBRARY} )
+else( JPEG_FOUND )
+   message( FATAL_ERROR "Could not find required jpeg package!" )
+endif( JPEG_FOUND )
+
+# OpenThreads - Required:
+find_package( OpenThreads )
+if( OPENTHREADS_FOUND )
+   include_directories( ${OPENTHREADS_INCLUDE_DIR} )
+   set( ossimDependentLibs ${ossimDependentLibs} ${OPENTHREADS_LIBRARY} )
+else( OPENTHREADS_FOUND )
+   message( FATAL_ERROR "Could not find required OpenThreads package!" )
+endif( OPENTHREADS_FOUND )
+
+# TIFF - Required:
+find_package( TIFF )
+if( TIFF_FOUND )
+   include_directories( ${TIFF_INCLUDE_DIR} )
+   set( ossimDependentLibs ${ossimDependentLibs} ${TIFF_LIBRARY} )
+else( TIFF_FOUND )
+   message( FATAL_ERROR "Could not find required tiff package!" )
+endif( TIFF_FOUND )
+
+# This caused a core dump on ossim executables running in jenins pipeline (ossim-test-dev)
+if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+  find_library( DL_LIBRARY dl )
+  if ( DL_LIBRARY )
+    set( ossimDependentLibs ${ossimDependentLibs} ${DL_LIBRARY} )
+  else( DL_LIBRARY )
+    # TODO:  Is this required on unix?  If so move to the required section.
+    message( FATAL_ERROR "Could not find dl library!" )
+  endif( DL_LIBRARY )
+endif() # if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+
+#if( UNIX )
+#   find_library( DL_LIBRARY dl )
+#  if ( DL_LIBRARY )
+#      set( ossimDependentLibs ${ossimDependentLibs} ${DL_LIBRARY} )
+#   else( DL_LIBRARY )
+#      # TODO:  Is this required on unix?  If so move to the required section.
+#      message( FATAL_ERROR "Could not find dl library!" )
+#   endif( DL_LIBRARY )
+#endif( UNIX )
+
+# FREETYPE - Optional:
+set( OSSIM_HAS_FREETYPE 0 )
+if( BUILD_OSSIM_FREETYPE_SUPPORT )
+   find_package(Freetype)
+   if( FREETYPE_FOUND )
+      include_directories( ${FREETYPE_INCLUDE_DIRS} )
+      set( ossimDependentLibs ${ossimDependentLibs} ${FREETYPE_LIBRARIES} )
+      set( OSSIM_HAS_FREETYPE 1 )
+   else( FREETYPE_FOUND )
+      message( WARNING "Could not find optional freetype package!" )
+   endif( FREETYPE_FOUND )
+endif( BUILD_OSSIM_FREETYPE_SUPPORT )
+
+# MPI - Optional:
+set( OSSIM_HAS_MPI 0 )
+if( BUILD_OSSIM_MPI_SUPPORT )
+   find_package(MPI)
+   if ( MPI_FOUND )
+      include_directories( ${MPI_INCLUDE_DIR} )
+      set( ossimDependentLibs ${ossimDependentLibs} ${MPI_LIBRARY} )
+      set( OSSIM_HAS_MPI 1 )
+   else ( MPI_FOUND )
+      message( WARNING "Could not find optional MPI package!" )
+   endif ( MPI_FOUND )
+endif( BUILD_OSSIM_MPI_SUPPORT )
+
+# ZLIB - Optional:
+set( OSSIM_HAS_LIBZ 0 )
+find_package( ZLIB )
+if ( ZLIB_FOUND )
+   include_directories( ${ZLIB_INCLUDE_DIR} )
+   set( ossimDependentLibs ${ossimDependentLibs} ${ZLIB_LIBRARY} )
+   set( OSSIM_HAS_LIBZ 1 )
+else ( ZLIB_FOUND )
+   message( WARNING "Could not find optional zlib package!" )
+endif ( ZLIB_FOUND )
+
+# HDF5 - Optional
+set( OSSIM_HAS_HDF5 0 )
+if (BUILD_OSSIM_HDF5_SUPPORT)
+  message( STATUS "Native HDF5 support requested. Searching for HDF5 library..." )
+  find_package( HDF5A )
+  if ( HDF5A_FOUND)
+     include_directories( ${HDF5A_INCLUDE_DIR} )
+     set( ossimDependentLibs ${ossimDependentLibs} ${HDF5A_LIBRARIES} )
+     set( OSSIM_HAS_HDF5 1 )
+  else ( HDF5A_FOUND )
+     message( WARNING "Could not find optional HDF5A package. Excluding native support." )
+  endif ( HDF5A_FOUND )
+else (BUILD_OSSIM_HDF5_SUPPORT)
+  message( STATUS "Native HDF5 support was not requested. If you want HDF5 support, set the environment BUILD_OSSIM_HDF5_SUPPORT=ON..." )
+endif ( BUILD_OSSIM_HDF5_SUPPORT )
+
+
+
+#---
+# Call the OSSIM macros in OssimUtilities.cmake
+#---
+if ( NOT OSSIM_BUILD_DATE )
+    TODAYS_DATE(OSSIM_BUILD_DATE)
+endif( NOT OSSIM_BUILD_DATE )
+SET(OSSIM_GIT_REVISION_NUMBER "UNKNOWN")
+GET_GIT_REVISION()
+if ( NOT ${Project_WC_REVISION} EQUAL 0 )
+   set( OSSIM_GIT_REVISION_NUMBER ${Project_WC_REVISION} )
+endif()
+
+#####################################################################################
+# Call the configure files for ossimConfig and ossimVersion setup
+#####################################################################################
+set(OSSIM_VERSION_NUMBER "\"${OSSIM_VERSION}\"")
+set(OSSIM_BUILD_DATE "\"${OSSIM_BUILD_DATE}\"")
+set(OSSIM_REVISION "\"${OSSIM_GIT_REVISION_NUMBER}\"")
+
+# Setting of OSSIM_ID to variable expanded $Id$ results.  Embedded troughout code.
+set(OSSIM_ID_ENABLED   1)
+IF(NOT BUILD_OSSIM_ID_SUPPORT)
+   set(OSSIM_ID_ENABLED 0)
+ENDIF(NOT BUILD_OSSIM_ID_SUPPORT)
+
+SET(OSSIM_CONFIGURE_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/ossim/ossimConfig.h")
+CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/ossimConfig.h.in"
+	       "${OSSIM_CONFIGURE_HEADER}")
+SET(OSSIM_VERSION_HEADER_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/src/ossimVersion.h.in")
+SET(OSSIM_VERSION_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/ossim/ossimVersion.h")
+CONFIGURE_FILE("${OSSIM_VERSION_HEADER_CONFIG}"
+               "${OSSIM_VERSION_HEADER}")
+
+
+##################################################################################################
+# Point to the CMakeLists.txt in the src dir. OLK: Removed unnecessary src/ossim structure and
+# replaced with simply src.
+##################################################################################################
+subdirs(src)
+
+set(TARGET_COMMON_LIBRARIES ossim ${OPENTHREADS_LIBRARY})
+
+##################################################################################################
+#
+# Setup install destinations for the shared files:
+# 1) Projection CSV files:
+#
+##################################################################################################
+FILE(GLOB ossim_projection_codes_csv ${${PROJECT_NAME}_SOURCE_DIR}/share/ossim/projection/*.csv ${${PROJECT_NAME}_SOURCE_DIR}/share/ossim/projection/*.txt)
+INSTALL(FILES ${ossim_projection_codes_csv} DESTINATION share/ossim/projection COMPONENT ossim)
+
+# 2) Utility API JSON files
+FILE(GLOB ossim_util_api_json ${${PROJECT_NAME}_SOURCE_DIR}/share/ossim/util/*.json)
+INSTALL(FILES ${ossim_util_api_json} DESTINATION share/ossim/util COMPONENT ossim)
+
+# 3) Fonts
+FILE(GLOB ossim_fonts ${${PROJECT_NAME}_SOURCE_DIR}/share/ossim/fonts/*.ttf)
+INSTALL(FILES ${ossim_fonts} DESTINATION share/ossim/fonts COMPONENT ossim)
+
+###################### OUTPUT GENERAL VARIABLE SETTINGS #######################
+
+MESSAGE( STATUS "OSSIM_REVISION                  = ${OSSIM_REVISION}" )
+MESSAGE( STATUS "FREETYPE_LIBRARY                = ${FREETYPE_LIBRARIES}" )
+MESSAGE( STATUS "FREETYPE_INCLUDE                = ${FREETYPE_INCLUDE_DIRS}" )
+MESSAGE( STATUS "GEOTIFF_LIBRARY                 = ${GEOTIFF_LIBRARIES}" )
+MESSAGE( STATUS "GEOTIFF_INCLUDE                 = ${GEOTIFF_INCLUDE_DIR}" )
+MESSAGE( STATUS "GEOTRANS_LIBRARY                = ${GEOTRANS_LIBRARY}" )
+MESSAGE( STATUS "GEOTRANS_INCLUDE                = ${GEOTRANS_INCLUDE_DIR}" )
+MESSAGE( STATUS "GEOS_LIBRARY                    = ${GEOS_LIBRARY}" )
+MESSAGE( STATUS "GEOS_INCLUDE                    = ${GEOS_INCLUDE_DIR}" )
+MESSAGE( STATUS "JPEG_LIBRARY                    = ${JPEG_LIBRARIES}" )
+MESSAGE( STATUS "JPEG_INCLUDE                    = ${JPEG_INCLUDE_DIR}" )
+MESSAGE( STATUS "OSSIM DEPENDENT LIBRARIES       = ${ossimDependentLibs}" )
+MESSAGE( STATUS "OSSIM_HAS_HDF5                  = ${OSSIM_HAS_HDF5}" )
+
+
+#-----------------------------------------------------------------------------
+# uninstall target
+#-----------------------------------------------------------------------------
+#OSSIM_ADD_COMMON_MAKE_UNINSTALL()
+
+message("################## end of OSSIM core library setup #########################")
+
+IF(BUILD_OSSIM_APPS)
+   add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/apps ${CMAKE_CURRENT_BINARY_DIR}/apps)
+ENDIF()
+
+#---
+# Building curl dependant apps optional. default=OFF
+#---
+if(BUILD_OSSIM_CURL_APPS)
+  add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/apps/curl_apps)
+endif()
+
+IF(BUILD_OSSIM_TESTS)
+   add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/src ${CMAKE_CURRENT_BINARY_DIR}/test/src)
+ENDIF()
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..20efd1b
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f754744
--- /dev/null
+++ b/README.md
@@ -0,0 +1,154 @@
+### Jenkins Build Status 
+Resource | *master* | *dev* | 
+------------ | ------------- | -------------
+OSSIM Build Centos7 | ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=ossim-master&style=plastic) | ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=ossim-dev&style=plastic)
+Batch Test| ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=ossim-test-master&style=plastic) | ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=ossim-test-dev&style=plastic)
+RPMS Build Centos7 | ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=rpm-master&style=plastic) | ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=rpm-dev&style=plastic)
+RPMS Publish Centos7 | ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=rpm-publish-master&style=plastic) | ![centos7 Status](https://jenkins.radiantbluecloud.com/buildStatus/icon/?job=rpm-publish-dev&style=plastic)
+
+ 
+<a href="https://scan.coverity.com/projects/ossimlabs">
+  <img alt="Coverity Scan Build Status"
+       src="https://img.shields.io/coverity/scan/7516.svg"/>
+</a>
+
+
+# Welcome to OSSIM
+
+OSSIM is an open source, C++ (mostly), geospatial image processing library used by government, commercial, educational, and private entities throughout the solar system. It has been in active development since the last millenium. This repository contains the full OSSIM package including core library, applications, tests, and build system. It does *not* contain the OSSIM plugins and other OSSIM-related code such as java-bindings ([ossim-oms](https://github.com/ossimlabs/ossim-oms)), and G [...]
+
+Quick links:
+
+* [What to Get](#relationship-between-repositories)
+* [How to Build](#how-to-build)
+* [How to Test](#how-to-test)
+* [OSSIM Command Line Utility](#ossim-command-line-utility)
+* [Doxygen Source Code Documentation](https://trac.osgeo.org/ossim/doxygen)
+
+# Relationship between Repositories (What to Get)
+
+The principal repository is this one (ossim), containing not only the core classes but also the command line utility applications code as well as the cmake build system files and related scripts. This repository must be cloned first before attempting to work with other _ossim-*_ repositories.
+
+The remaining _ossim-*_ repositories are independent of each other and can be cloned in any order. However, it will be necessary to re-run the [build script (linux version)](/scripts/linux/build.sh) or at least regenerate makefiles with the [cmake script (linux version)](/cmake/scripts/ossim-cmake-config-LINUX.sh) before building. This must be done each time a new ossim-* repository is added to the ossimlabs build. See below for detailed build instructions.
+
+# Branching Scheme and Pull Requests
+
+The "master" branches (for all OSSIM family repos) contain the most stable code. It is periodically merged with "dev" branch. If you don't plan on developing code, but want to build from source, this is the branch you want. For bleeding edge development, use the "dev" branch. This branch serves as the parent to all feature branches and is frequently merged with those feature branches once those branches are tested by the developers responsible for them.
+
+If you want to contribute code, you'll need to:
+ * create your own feature branch from dev, 
+ * test your modification, 
+ * then create a pull request. 
+
+The moderators will review the request and merge your changes to "dev". At that point, the automated continuous integration system (Jenkins) will get triggered to perform a build and test. If there are any failures, your merge commit will be backed out.
+
+#How to Build
+The easy way is to just run the script in `ossim/scripts/build.sh`.  This approach should work for the default build configuration. This currently works for both linux and Mac. We hope to soon have a Windows `build.bat` file and world peace. Assuming all dependencies were met and no compile/link errors occured, this script will generate all build binaries under a sibling directory to the ossim repo directory, namely, `ossim/../build`. See the section on environment variables below for op [...]
+
+This repository provides the CMAKE infrastructure necessary to build the OSSIM core library and related plugins and applications. Throughout this document, reference is made to the local, top-level directory containing this repository. We'll call this directory simply *ossim-dev-home*. (In fact, you'll find the shell variable `OSSIM_DEV_HOME` used throughout the various scripts in this and other repositories.
+
+The following 3rd-party SDKs are needed in order to build the core ossim library:
+
+    libtiff-devel (preferably version 4.x for BigTIFF support)
+    OpenThreads-devel
+    libjpeg-devel
+    libgeos-devel (on later Debian / Ubuntu versions, libgeos++-dev)
+
+Plugins will require additional 3rd-party packages.
+
+Building OSSIM and related repos from source is a two-step process: first create the make files using CMake, then run `make` to build the binaries. Scripts are available for Linux/Mac and (soon) Windows to run CMake with default settings. You can run the script from any working directory and default settings will be used for creating the default build environment. It is possible to override specific defaults for your own custom requirements or preferences.
+
+Presently, the default setting is to disable the building of all plugins. If you want specific plugin libraries to be built, you'll need to edit your cmake script at `cmake/scripts/ossim-cmake-config.sh` (or similar `.bat` file for Windows). Scroll down to the "Plugins" section and set the corresponding variables to "ON". Note that you could also define those variables in your shell environment in lieu of editing the script.
+
+## Creating the Makefiles
+
+### Creating a Default Build Environment
+The cmake configuration scripts are available in the `cmake/scripts` subdirectory. Assuming no OSSIM environment variables are available to override the defaults, the "out-of-source" `build` directory will be created under the same parent directory *ossim-dev-home* as this repo. The linux/Mac script `ossim/scripts/build.sh`, if run in an interactive shell will query for the build type. If the script is run as part of a batch process, "Release" is assumed. If the build directory does not  [...]
+
+### Customizing the Build
+There are two ways to customize the build: via environment variables and by directly editing the cmake configuration script. 
+
+#### Environment Variables
+The CMake system will locally define certain environment variables that live for the lifetime of the cmake config script execution. The following shell variables, if defined, are referenced to override the default settings.
+
+The developer has the option to override the default build directory location by setting the environment variable `OSSIM_BUILD_DIR` prior to running the cmake config script. If not present, the `build` directory will be located just under *ossim-dev-home* as described above. 
+
+Another defaulted environment variable is `OSSIM_INSTALL_PREFIX`. This variable as two distinct functions. First, it indicates where to install the OSSIM SDK when running `make install`. Second, it serves to specify a path to SDKs that OSSIM depends on. The CMake system will scan `OSSIM_INSTALL_PREFIX` for the presence of dependency packages such as GeoTiff, JPEG, and others. This secondary purpose of `OSSIM_INSTALL_PREFIX` used to be handled by the now obsolete environment variable `OSS [...]
+
+As already mentioned, you can enable the building of specific plugins by defining the corresponding environment variable: `BUILD_<NAME>_PLUGIN=ON`.
+
+NOTE: For legacy reasons, `OSSIM_DEPENDENCIES` is still scanned for dependency SDKs. New dependencies however should be "installed" in `OSSIM_INSTALL_PREFIX`.
+
+#### Editing the CMake Config Script
+The default configuration relies on the presence of the OSSIM repositories under the *ossim-dev-home* to decide whether to include those in the build (with the exception of the plugins, which default to "OFF"). You may want to selectively exclude certain applications from the build without having to hide the workspaces from CMake. The flags enabling those are defined in the script. Simply set the corresponding variable to "OFF" and rerun the script. Likewise, for the plugins, you can mod [...]
+
+There are other flags available that direct CMake to generate project files for IDEs such as Eclipse and Visual Studio. You can also specify multi-threaded builds, non-standard output directories, and more. Feel free to experiment, but know that you'll be voiding the warranty.
+
+### _How do I know what dependencies are needed?_ 
+
+The CMake system will attempt to locate all necessary dependency SDKs in the system's standard install directories. On linux, this includes, but not limited to, /usr and /usr/local. If it cannot find them, the script will exit with an error message indicating the missing library. You can then install the missing library from the third-party repository before trying to run the OSSIM cmake config script again. You may get several dependency errors before CMake succeeds in generating all th [...]
+
+Remember, you can provide "sandbox" installations of dependency libraries that you want to link with, even though your system may (or may not) have installed different versions of those libraries. That's achieved by "installing" those SDKs inside the directory indicated by the CMake environment variable `OSSIM_INSTALL_PREFIX` (defaults to *ossim-dev-home*/install, see above).
+
+Eventually, we hope to provide an artifact repository so that CMake itself can access any missing dependencies without the need for the developer to manually install them.
+
+## Building the Binaries
+
+Once the cmake configuration script terminates successfully, you are ready to build the binaries. Build instructions vary slightly between OS's, but generally involve simply running `make` inside the build directory.
+
+First change directory to the build folder created by the cmake config script. There you will find a top-level Makefile that will bootstrap the build. From a terminal, run `make`. The build should proceed normally for a few minutes, longer if the first time through. Upon successful completion, you should find a "lib" and "bin" folder containing the ossim library and executable, respectively.
+
+Developers have different ways of working -- all we're helping you with here is building the OSSIM library and associated plugins and executables. You may choose to then run `make install` to copy the binaries to some standard system location (you'll need to have the appropriate permissions). Alternatively, you can append your `PATH` environment variable to include the `build/bin` folder containing the executables. You also need to update the library path to include `build/lib`. These se [...]
+
+## Integrated Development Environments
+
+You may be able to import the build environment into your IDE "as a Makefile project." The Windows cmake configuration script will generate Visual Studio project files for direct import into Visual Studio. You may want to take a look at that script to see if there is a custom setting (or command line argument) you need to tinker with.
+
+### Eclipse Users
+For convenience, you can specify "eclipse" as the build-type to the script at `ossim/cmake/scripts/ossim-cmake-config-LINUX.sh` that will generate the Eclipse CDT4 project files along with the makefiles for a debug build. The output build directory will be one level up from *ossim-dev-home* since Eclipse does not support the build directory as sibling of source. Eclipse will properly generate "Subprojects" corresponding to each ossimlabs repo present in your *ossim-dev-home*  for indexed [...]
+
+# How to Test
+
+The first check of a successful build is to run the ossim command line utility `ossim-cli --version`. You should get the current version output to the console. More on the `ossim-cli` command below.
+
+Testing is generally divided into unit, functional, and integration tests. At the moment, true unit testing in OSSIM is very limited, and likely to stay that way. There is however a _de facto_ scheme in place that has been used for implementing integration and functional testing using the `ossim-batch-test` command line executable. Much of the functional testing supplied through `ossim-batch-test` configuration files is fairly fine-grained, almost to the unit-test level of granularity. T [...]
+
+A rudimentary test suite is encapsulated in this [test script (linux version)](/scripts/test.sh). It defines the locations of the input source data and expected results, and runs the command-line test applications. 
+
+The _ossim_ repository contains `test/src` and `test/config` subdirectories which contain items available for testing OSSIM core functionality. At some point when we start including unit tests, there will be a third directory, `test/scripts`, that will contain the commands to run those unit tests.
+
+## test/src
+
+This directory contains the source code for unit and functional testing of core OSSIM objects. It is automatically built by the cmake/make system, assuming `BUILD_OSSIM_TESTS` is set to `ON` (the default). The resulting executables, located in `build/bin`, can be run standalone on the command line. The code in this directory is also a good source of examples for interfacing to many important OSSIM classes. This directory also contains the source code for `ossim-batch-test`.
+
+## test/config
+
+This subdirectory contains, primarily, configuration files for existing `ossim-batch-test` runs. 
+
+The input data referenced in the `ossim-batch-test` configuration files are presently hosted on an Amazon S3 storage. Contact the [OSSIM developer list](mailto:ossim-developer at lists.sourceforge.net) if you want access to this public data for your own testing.
+
+# OSSIM Command Line Utility
+
+The executable `ossim-cli` will eventually consolidate the plethora of ossim utility applications currently existing. For now it supports a small subset of utilities though among them is `info` that reproduces the functionality of the ubiquitous `ossim-info`.
+
+The usage is:   `ossim-cli <command> [options and parameters]`
+
+With no arguments, the app will give a list of capabilities. Currently those are
+
+* help <command> -- To get help on specific command. Same as "<command> --help"
+* bandmerge -- Merges multiple band files into a single RGB image.
+* hillshade -- Computes shaded representation of input elevation surface with specified lighting parameters.
+* hlz -- Computes bitmap of helicopter landing zones given ROI and DEM.
+* info -- Dumps metadata information about input image and OSSIM in general.
+* ortho -- Utility for orthorectifying and reprojecting image data.
+* potrace -- Computes vector representation of input raster image.
+* shoreline -- Computes bitmap of water versus land areas in an input image.
+* slope -- Utility for computing the slope at each elevation post and generating a corresponding slope image.
+* vertices -- Utility for determining the active image corner vertices inside larger null-filled image rectangle.
+* viewshed -- Computes bitmap image representing the viewshed from specified location using only DEM information.
+
+For example, to get projection and image information for an image file, use
+
+ `ossim-cli info -p -i <image-filename>`
+
+You can also give a keyword list (KWL) file as the only arg. The KWL must contain the keyword "tool" with one of the supported commands above, along with the keywords expected by that utility. You can even get KWL templates or enter the keyword/values interactively.
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
new file mode 100644
index 0000000..285216e
--- /dev/null
+++ b/apps/CMakeLists.txt
@@ -0,0 +1,22 @@
+FILE(GLOB OSSIM_APP_DIRS "ossim-*")
+FILE(GLOB OSSIM_CONFIG_DIR "ossim-config*")
+LIST(REMOVE_ITEM OSSIM_APP_DIRS ${OSSIM_CONFIG_DIR})
+
+FIND_PACKAGE(ossim)
+FIND_PACKAGE( OpenThreads )
+if( OPENTHREADS_FOUND )
+   include_directories( ${OPENTHREADS_INCLUDE_DIR} )
+else( OPENTHREADS_FOUND )
+   message( FATAL_ERROR "Could not find required OpenThreads package!" )
+endif( OPENTHREADS_FOUND )
+
+if( OSSIM_FOUND )
+   include_directories( ${OSSIM_INCLUDE_DIR} )
+else( OSSIM_FOUND )
+   message( FATAL_ERROR "Could not find required OSSIM package!" )
+endif( OSSIM_FOUND )
+set(TARGET_COMMON_LIBRARIES ${OSSIM_LIBRARY} ${OPENTHREADS_LIBRARY})
+
+FOREACH(f ${OSSIM_APP_DIRS})
+	ADD_SUBDIRECTORY(${f})
+ENDFOREACH(f)
diff --git a/apps/curl_apps/CMakeLists.txt b/apps/curl_apps/CMakeLists.txt
new file mode 100644
index 0000000..de08755
--- /dev/null
+++ b/apps/curl_apps/CMakeLists.txt
@@ -0,0 +1,73 @@
+message( "************** Begin: CMAKE SETUP FOR ossim curl apps ******************" )
+
+cmake_minimum_required (VERSION 2.8)
+
+project(ossimcore)
+
+set(requiredLibs)
+
+# Get the library suffix for lib or lib64.
+get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)       
+if(LIB64)
+   set(LIBSUFFIX 64)
+else()
+   set(LIBSUFFIX "")
+endif()
+
+# OpenThreads - Required:
+find_package( OpenThreads )
+if( OPENTHREADS_FOUND )
+   include_directories( ${OPENTHREADS_INCLUDE_DIR} )
+   set( requiredLibs ${requiredLibs} ${OPENTHREADS_LIBRARY} )
+else( OPENTHREADS_FOUND )
+   message( FATAL_ERROR "Could not find required OpenThreads package!" )
+endif( OPENTHREADS_FOUND )
+
+find_package( CURL )
+if( CURL_FOUND )
+   include_directories( ${CURL_INCLUDE_DIR} )
+   set( requiredLibs ${requiredLibs} ${CURL_LIBRARY} )
+else( CURL_FOUND )
+   message(FATAL_ERROR "Could not find curl") 
+endif( CURL_FOUND )
+
+# Requires ossim:
+find_package(ossim)
+if (OSSIM_FOUND)
+   include_directories( ${OSSIM_INCLUDE_DIR} )
+   set(requiredLibs ${requiredLibs} ${OSSIM_LIBRARIES} )
+else(OSSIM_FOUND)
+   message(FATAL_ERROR "Could not find ossim")
+endif(OSSIM_FOUND)
+
+# Add our include...
+include_directories(".")
+
+message( STATUS "CURL_INCLUDE_DIR    = ${CURL_INCLUDE_DIR}" )
+message( STATUS "CURL_LIBRARY        = ${CURL_LIBRARY}" )
+message( STATUS "OPENTHREADS_LIBRARY = ${OPENTHREADS_LIBRARY}" )
+message( STATUS "OPENTHREADS_INCLUDE = ${OPENTHREADS_INCLUDE_DIR}" )
+message( STATUS "OSSIM_INCLUDE_DIR   = ${OSSIM_INCLUDE_DIR}" )
+message( STATUS "OSSIM_LIBRARIES     = ${OSSIM_LIBRARIES}" )
+message( STATUS "Required libs       = ${requiredLibs}" )
+
+# ---
+# omar-data-mgr app:
+# ---
+
+# Add the executable:
+add_executable(omar-data-mgr omar-data-mgr.cpp omarDataMgrUtil.cpp )
+
+# Set the output dir:
+set_target_properties(omar-data-mgr 
+                      PROPERTIES 
+                      RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+
+# omar-data-mgr application links with required libs.
+target_link_libraries( omar-data-mgr ${requiredLibs} )
+
+# Install app:
+install( TARGETS omar-data-mgr
+         DESTINATION bin )
+
+message( "************** End: CMAKE SETUP FOR ossim curl apps ******************" )
diff --git a/apps/curl_apps/omar-data-mgr.cpp b/apps/curl_apps/omar-data-mgr.cpp
new file mode 100644
index 0000000..3b90287
--- /dev/null
+++ b/apps/curl_apps/omar-data-mgr.cpp
@@ -0,0 +1,77 @@
+//---
+// File: omar-data-mrg.cpp
+//
+// License: See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+// 
+// Description: omar-data-mrg application for interfacing with OMAR
+// dataManager services, e.g. "add", "remove" raster via libcurl.
+//---
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/parallel/ossimMpi.h>
+#include "omarDataMgrUtil.h"
+
+#include <iostream>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+#if OSSIM_HAS_MPI
+   ossimMpi::instance()->initialize(&argc, &argv);
+#endif
+
+   int rv = 0; // Return value.
+   
+   //---
+   // Get the arg count so we can tell if an arg was consumed by
+   // ossimInit::instance()->initialize
+   //---
+   int originalArgCount = argc;
+   
+   ossimArgumentParser ap(&argc, argv);
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(ap);
+
+   //---
+   // Avoid going on if a global option was consumed by ossimInit::initialize
+   // like -V or --version option and the arg count is down to 1.
+   //---
+   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
+   {
+      // Make the info object.
+      ossimRefPtr<omarDataMgrUtil> dm = new omarDataMgrUtil();
+
+      try
+      {
+         //---
+         // Initialize will take the options passed in and set things to output
+         // information for.
+         //
+         // omarDataMgrUtil::initialize can throw an exception.
+         //---
+         bool continue_after_init = dm->initialize(ap);
+
+         if ( continue_after_init )
+         {
+            // This does all the work...
+            rv = (int)dm->execute();
+         }
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         rv = 1;
+      }
+      
+   }  // End: if ( ( ap.argc() > 1 ) ...
+   
+   return rv;
+   
+} // End of main...
diff --git a/apps/curl_apps/omarDataMgrUtil.cpp b/apps/curl_apps/omarDataMgrUtil.cpp
new file mode 100644
index 0000000..dd0a81e
--- /dev/null
+++ b/apps/curl_apps/omarDataMgrUtil.cpp
@@ -0,0 +1,1013 @@
+//----------------------------------------------------------------------------
+// File: omarDataMgrUtil.cpp
+// 
+// License: See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: omarDataMgrUtil class definition
+//
+// Utility class for processing images recursively and calling OMAR
+// services upon successful open.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include "omarDataMgrUtil.h"
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/util/ossimFileWalker.h>
+
+#include <curl/curl.h>
+#include <iomanip>
+#include <string>
+#include <vector>
+
+static std::string ACCESS_TIME_THRESHOLD_KW    = "access_time_threshold";
+static std::string CLEAN_KW                    = "clean";
+static std::string DUMP_FILTERED_IMAGES_KW     = "dump_filtered_images";
+static std::string FALSE_KW                    = "false";
+static std::string FILE_KW                     = "file";
+static std::string OVERRIDE_FILTERED_IMAGES_KW = "override_filtered_images";
+static std::string SERVICE_KW                  = "service";
+static std::string THREADS_KW                  = "threads";
+static std::string TRUE_KW                     = "true";
+static std::string URL_KW                      = "url";
+
+// Static trace for debugging.  Use -T omarDataMgrUtil to turn on.
+static ossimTrace traceDebug = ossimTrace("omarDataMgrUtil:debug");
+
+omarDataMgrUtil::omarDataMgrUtil()
+   :
+   ossimReferenced(),
+   ossimFileProcessorInterface(),
+   m_kwl( new ossimKeywordlist() ),
+   m_fileWalker(0),
+   m_mutex(),
+   m_imageUtil(0),
+   m_errorStatus(0),
+   m_filteredImages(0)
+{
+}
+
+omarDataMgrUtil::~omarDataMgrUtil()
+{
+   if ( m_fileWalker )
+   {
+      delete m_fileWalker;
+      m_fileWalker = 0;
+   }
+}
+
+void omarDataMgrUtil::addArguments(ossimArgumentParser& ap)
+{
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [options] <service> <file(s)-or-directory-to-walk>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+
+   au->addCommandLineOption("--access-time-threshold", "<days> For \"remove\" action. Only remove if last access is greater than days.");
+   
+   au->addCommandLineOption("--clean", "Cleans/removes image file and associated files from file system if present.\n\"remove\" option only.\nLooks for associated files of image, e.g. .ovr, .his, .omd, .geom\nCAUTION: This command is irreversible once envoked!");
+   
+   au->addCommandLineOption("--dump-filtered-image-list", "Outputs list of filtered images.");
+
+   au->addCommandLineOption("--override-filtered-images", "Allows processing of file that is in the filtered image list.");
+   
+   au->addCommandLineOption("--threads", "<threads> The number of threads to use. (default=1) Note a default can be set in your ossim preferences file by setting the key \"ossim_threads\".");
+   
+   au->addCommandLineOption("--preproc", "Enables the use of the preproc utility to build overviews and histograms");
+
+   au->addCommandLineOption( "-u", "<url> URL, e.g. \"http://omar.osssim.org/omar\"\n(default= url \"http://localhost:8080/omar\"" );
+
+   ossimRefPtr<ossimImageUtil> imageUtil = new ossimImageUtil();
+   imageUtil->addOptions(au);
+   imageUtil = 0;
+   
+} // void omarDataMgrUtil::addArguments(ossimArgumentParser& ap)
+
+bool omarDataMgrUtil::initialize(ossimArgumentParser& ap)
+{
+   static const char M[] = "omarDataMgrUtil::initialize(ossimArgumentParser&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+
+   bool result = true;
+
+   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
+   {
+      usage(ap);
+
+      // continue_after_init to false
+      result = false;
+   }
+   else
+   {
+      //---
+      // Start with clean options keyword list.
+      //---
+      m_kwl->clear();
+
+      while ( 1 ) //  While forever loop...
+      {
+         // Used throughout below:
+         std::string ts1;
+         ossimArgumentParser::ossimParameter sp1(ts1);
+
+         if( ap.read("--access-time-threshold", sp1) )
+         {
+            m_kwl->addPair( ACCESS_TIME_THRESHOLD_KW, ts1 );
+            if ( ap.argc() < 3 )
+            {
+               break;
+            }
+         }
+
+         if( ap.read("--clean") )
+         {
+            addOption( CLEAN_KW, TRUE_KW );
+            if ( ap.argc() < 3 )
+            {
+               break;
+            }
+         }
+
+         if( ap.read("--dump-filtered-image-list") )
+         {
+            setDumpFilteredImageListFlag( true );
+            if ( ap.argc() < 3 )
+            {
+               break;
+            }
+         }
+
+         if( ap.read("--override-filtered-images") )
+         {
+            setOverrideFilteredImagesFlag( true );
+            if ( ap.argc() < 3 )
+            {
+               break;
+            }
+         }
+
+         if( ap.read("--threads", sp1) )
+         {
+            m_kwl->addPair( THREADS_KW, ts1 );
+            if ( ap.argc() < 3 )
+            {
+               break;
+            }
+         }
+
+         if( ap.read("-u", sp1) )
+         {
+            m_kwl->addPair( URL_KW, ts1 );
+            if ( ap.argc() < 3 )
+            {
+               break;
+            }
+         }
+         
+         if( ap.read("--preproc"))
+         {
+            m_imageUtil = new ossimImageUtil();
+
+            if ( getOverrideFilteredImagesFlag() )
+            {
+               //---
+               // User requested override but the arg parser for omarDataMgr has
+               // stripped the argument for image util so manually set it.
+               //---
+               m_imageUtil->setOverrideFilteredImagesFlag( true );
+            }
+            
+            m_imageUtil->initialize(ap);
+         }
+
+         if ( ap.argc() < 3 )
+         {
+            break;
+         }
+
+         // End of arg parsing.
+         ap.reportRemainingOptionsAsUnrecognized();
+         if ( ap.errors() )
+         {
+            ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+            std::string errMsg = "Unknown option...";
+            throw ossimException(errMsg);
+         }
+
+         break; // Break from while forever.
+         
+      } // End while (forever) loop.
+      
+      if( ap.argc() > 2 )
+      {
+         // First arg should be service, e.g. "add", "remove".
+         std::string value = ap[1];
+         m_kwl->addPair( SERVICE_KW, value );
+
+         // Check for "clean" used with "add" and issue warning???
+         if ( getCleanFlag() && ( value == "add" ) )
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "NOTICE: Using --clean with \"add\" service is illogical!\n";
+         }
+
+         // The remaining args should be files to process.
+         for (ossim_int32 i = 1; i < (ap.argc()-1); ++i)
+         {
+            ossimString kw = "file";
+            kw += ossimString::toString(i);
+            std::string value = ap[i+1];
+            m_kwl->addPair(kw.string(), value, true);
+         }
+      }
+      else
+      {
+         if ( getDumpFilterImagesFlag() )
+         {
+            // Caller wants to see filtered image names:
+            dumpFilteredImageList();
+         }
+         else
+         {
+            usage(ap);
+            result = false;
+         }
+      }
+
+   } // not usage
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "m_kwl:\n" << *(m_kwl.get()) << "\n"
+         << M << " exit result = " << (result?"true":"false")
+         << "\n";
+   }
+   
+   return result;
+}
+
+ossim_int32 omarDataMgrUtil::execute()
+{
+   static const char M[] = "omarDataMgrUtil::execute()";
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+
+   if ( getDumpFilterImagesFlag() )
+   {
+      // Caller wants to see filtered image names:
+      if ( m_filteredImages.empty() )
+      {
+         initializeDefaultFilterList();
+      }
+      
+      dumpFilteredImageList();
+   }
+   
+   // Get the number of "file*" keywords.
+   ossim_uint32 fileCount = m_kwl->numberOf("file");
+
+   if ( fileCount )
+   {
+      if ( !m_fileWalker )
+      {
+         m_fileWalker = new ossimFileWalker();
+      }
+      
+      if ( !getOverrideFilteredImagesFlag() && m_filteredImages.empty() )
+      {
+         initializeDefaultFilterList();
+         m_fileWalker->initializeDefaultFilterList();
+      }
+
+      //---
+      // Passing getNumberOfThreads() to ossimFileWalker::setNumberOfThreads was
+      // kicking up a coverity scan error:
+      // Passing tainted variable "this->getNumberOfThreads()" to a tainted sink.
+      // drb
+      //---
+      ossim_uint32 threads = getNumberOfThreads();
+      m_fileWalker->setNumberOfThreads( threads );
+
+      // Must set this so we can stop recursion on directory based images.
+      m_fileWalker->setWaitOnDirFlag( true );
+
+      // This links the file walker back to our "processFile" method.
+      m_fileWalker->setFileProcessor( this );
+      
+      // Wrap in try catch block as excptions can be thrown under the hood.
+      try
+      {
+         // Get the list of files passed to us:
+         std::vector<ossimFilename> files;
+         ossim_uint32 processedFiles = 0;;
+         ossim_uint32 i = 0;
+         while ( processedFiles < fileCount )
+         {
+            ossimString kw = FILE_KW;
+            kw += ossimString::toString(i);
+            std::string lookup = m_kwl->findKey( kw.string() );
+            if ( lookup.size() )
+            {
+               files.push_back( ossimFilename(lookup) );
+               ++processedFiles;
+            }
+            
+            ++i;
+            if ( i > (fileCount + 100) ) break;
+         }
+
+         // Process the files:
+         m_fileWalker->walk( files ); 
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Caught exception: " << e.what() << endl;
+         setErrorStatus( ossimErrorCodes::OSSIM_ERROR );
+      }
+      
+   } // if ( fileCount )
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " exit status: " << m_errorStatus << std::endl;
+   }
+   
+   // Zero is good, non zero is bad.
+   return m_errorStatus; 
+}
+
+//---
+// This method is called back by the ossimFileWalker::walk method for each file it finds that it
+// deems can be processed.
+//---
+void omarDataMgrUtil::processFile(const ossimFilename& file)
+{
+   static const char M[] = "omarDataMgrUtil::processFile";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "\nfile:    " << file << "\n";
+   }
+   
+   if ( file.size() )
+   {
+      bool processFileFlag = true;
+      if ( !getOverrideFilteredImagesFlag() )
+      {
+         processFileFlag = !isFiltered( file );
+      }
+      
+      if ( processFileFlag )
+      {
+         omarDataMgrUtil::OmarDataMgrUtilService service = getService();
+
+         if ( service == omarDataMgrUtil::ADD_RASTER )
+         {
+            callAddRasterService( file );
+         }
+         else if ( service == omarDataMgrUtil::REMOVE_RASTER )
+         {
+            callRemoveRasterService( file );
+         }
+         else
+         {
+            std::string s;
+            getService( s );
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Unhandled service: " << s << "\n";
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Filtered file, not processing: " << file << std::endl;
+      }
+      
+   } // Matches: if ( file.size() )
+   
+   
+   if(traceDebug())
+   {
+      // Since ossimFileWalker is threaded output the file so we know which job exited.
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
+   }
+   
+} // End: omarDataMgrUtil::processFile(const ossimFilename& file)
+
+void omarDataMgrUtil::usage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+   
+   // Set app name.
+   ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
+
+   // Add options.
+   addArguments(ap);
+   
+   // Write usage.
+   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+   
+   ossimNotify(ossimNotifyLevel_INFO)
+      << "\nValid services: \"add\" and \"remove\"."
+      << "\nExample usage:\n\n"
+
+      << "Using default url \"http://localhost:8080/omar\":\n"
+      << ap.getApplicationName()
+      << " add 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
+
+      << "Build overviews, histogram, and add to database.\n"
+      << ap.getApplicationName()
+      << " --preproc --ot ossim_kakadu_nitf_j2k --ch add "
+      << "5V090205M0001912264B220000100072M_001508507.ntf\n\n"
+
+      << "Passing in url:\n"
+      << ap.getApplicationName()
+      << " -u http://your_url/omar add 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
+
+      << "Adding all images in a directory using 32 threads:\n"
+      << ap.getApplicationName()
+      << " --threads 32 add /data1/imagery/2015/09/28/0000\n\n"
+      
+      << "Removing file from database:\n"
+      << ap.getApplicationName()
+      << " remove 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
+
+      << "Removing file from database and file system:\n"
+      << ap.getApplicationName()
+      << " --clean remove 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
+
+      << "Removing all images in a directory using 32 threads:\n"
+      << ap.getApplicationName()
+      << " --clean --threads 32 remove /data1/imagery/2015/09/28/0000\n\n"
+
+      << "Removing all images in a directory using 4 threads that have not been accessed in 30 days:\n"
+      << ap.getApplicationName()
+      << " --access-time-threshold  30 --clean --threads 4 remove /data1/imagery/2015/09/28/0000\n"
+
+      << std::endl;
+}
+
+// Private method:
+bool omarDataMgrUtil::isDirectoryBasedImage(const ossimImageHandler* ih) const
+{
+   bool result = false;
+   if ( ih )
+   {
+      // Get the image handler name.
+      ossimString imageHandlerName = ih->getClassName();
+      if ( (imageHandlerName == "ossimAdrgTileSource") ||
+           (imageHandlerName == "ossimCibCadrgTileSource") )  
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool omarDataMgrUtil::isPastLastAccessedThreshold( const ossimFilename& file ) const
+{
+   // Default to true.
+   bool result = true;
+
+   std::string value = m_kwl->findKey( ACCESS_TIME_THRESHOLD_KW );
+   if ( value.size() )
+   {
+      const ossim_int64 SECONDS_PER_DAY = 86400; // 60 * 60 * 24
+      ossim_int64 thresholdInDays = ossimString(value).toInt64();
+      if ( thresholdInDays )
+      {
+         // Returns -1 if does not exist.
+         ossim_int64 secondsSinceAccessed = file.lastAccessed();
+
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << ACCESS_TIME_THRESHOLD_KW << ": " << thresholdInDays
+               << "\nfile_last_accessed: " << secondsSinceAccessed/SECONDS_PER_DAY
+               << "\n";
+         }
+
+         if ( secondsSinceAccessed > 0 )
+         {
+            if ( secondsSinceAccessed/SECONDS_PER_DAY <= thresholdInDays )
+            {
+               result = false;
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
+void omarDataMgrUtil::setNumberOfThreads( ossim_uint32 threads )
+{
+   addOption( THREADS_KW, threads );
+}
+
+void omarDataMgrUtil::setNumberOfThreads( const std::string& threads )
+{
+   addOption( THREADS_KW, threads );
+}
+
+ossim_uint32 omarDataMgrUtil::getNumberOfThreads() const
+{
+   ossim_uint32 result = 1;
+   std::string lookup = m_kwl->findKey( THREADS_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toUInt32();
+   }
+   else
+   {
+      result = ossim::getNumberOfThreads();
+   }
+   return result;
+}
+
+void omarDataMgrUtil::addOption( const std::string& key, ossim_uint32 value )
+{
+   addOption( key, ossimString::toString( value ).string() );
+}
+
+void omarDataMgrUtil::addOption(  const std::string& key, const std::string& value )
+{
+   m_mutex.lock();
+   if ( m_kwl.valid() )
+   {
+      if ( key.size() && value.size() )
+      {
+         m_kwl->addPair( key, value );
+      }
+   }
+   m_mutex.unlock();
+}
+
+void omarDataMgrUtil::setErrorStatus( ossim_int32 status )
+{
+   m_mutex.lock();
+   m_errorStatus = status;
+   m_mutex.unlock();
+}
+
+omarDataMgrUtil::OmarDataMgrUtilService omarDataMgrUtil::getService() const
+{
+   omarDataMgrUtil::OmarDataMgrUtilService service = omarDataMgrUtil::UNKNOWN;
+   
+   std::string value = m_kwl->findKey( SERVICE_KW );
+   if ( value.size() )
+   {
+      ossimString s = value;
+      s.downcase();
+
+      if ( s == "add" )
+      {
+         service = omarDataMgrUtil::ADD_RASTER;
+      }
+      else if ( (s == "remove") || (s == "rm") || (s == "delete") || (s == "erase") )
+      {
+         service = omarDataMgrUtil::REMOVE_RASTER;
+      }
+   }
+
+   return service;
+}
+
+void omarDataMgrUtil::getService(std::string& serviceString) const
+{
+   omarDataMgrUtil::OmarDataMgrUtilService service = getService();
+   
+   if ( service == omarDataMgrUtil::ADD_RASTER )
+   {
+      serviceString = "/dataManager/addRaster";
+   }
+   else if ( service == omarDataMgrUtil::REMOVE_RASTER )
+   {
+      serviceString = "/dataManager/removeRaster";
+   }
+   else
+   {
+      serviceString.clear();
+   }
+}
+
+void omarDataMgrUtil::getUrl( std::string& url ) const
+{
+   url = m_kwl->findKey( URL_KW );
+   if ( url.empty() )
+   {
+      url = "http://localhost:8080/omar"; // default url
+   }
+}
+
+bool omarDataMgrUtil::callAddRasterService( const ossimFilename& file )
+{
+   static const char M[] = "omarDataMgrUtil::callAddRasterService";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "\nfile:    " << file << "\n";
+   }
+   
+   bool result = false;
+
+   // Must be able to open:
+   m_mutex.lock();
+   ossimRefPtr<ossimImageHandler> ih =
+      ossimImageHandlerRegistry::instance()->open(file, true, true);
+   m_mutex.unlock();
+   
+   if ( ih.valid() && !ih->hasError() )
+   {
+      if ( isDirectoryBasedImage( ih.get() ) )
+      {
+         // Tell the walker not to recurse this directory.
+         m_mutex.lock();
+         m_fileWalker->setRecurseFlag(false);
+         m_mutex.unlock();
+      }
+            
+      // Must have geometry:
+      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+      if( geom.valid() )
+      {
+         // Geometry object must have a valid projection:
+         ossimRefPtr<ossimProjection> proj = geom->getProjection();
+         if ( proj.valid() )
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "Processing file: " << file << std::endl;
+
+            if( m_imageUtil.valid() )
+            {
+               m_imageUtil->processFile(file);
+            }
+            
+            std::string service;
+            getService( service );
+            
+            std::string url;
+            getUrl( url );
+            
+            if ( service.size() && url.size() )
+            {
+               CURL* curl = curl_easy_init();
+               if ( curl )
+               {
+                  // Data for POST:
+                  std::string data = std::string("filename=") + file.string();
+                  curl_easy_setopt( curl, CURLOPT_POSTFIELDS, data.c_str() );
+                  
+                  // Create the URL string:
+                  std::string urlString = url + service;
+                  curl_easy_setopt( curl, CURLOPT_URL, urlString.c_str() );
+                  
+                  ossimNotify(ossimNotifyLevel_INFO)
+                     << "data: " << data 
+                     << "\nurl: " << urlString.c_str()
+                     << std::endl;
+                  
+                  // Tell libcurl to follow redirection
+                  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+                  
+                  // Run it:
+                  CURLcode res = curl_easy_perform(curl);
+                  
+                  // Check for errors:
+                  if ( res == CURLE_OK )
+                  {
+                     // Response code of the http transaction:
+                     long respcode; 
+                     res = curl_easy_getinfo(curl,CURLINFO_RESPONSE_CODE, &respcode);
+                     if ( res == CURLE_OK )
+                     {
+                        if ( respcode == 200 ) //  OK 200 "The request was fulfilled."
+                        {
+                           result = true; // Set return status for caller.
+                        }
+                     }
+                  }
+                  else
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "curl_easy_perform() failed: \n"
+                        << curl_easy_strerror(res)
+                        << std::endl;
+                     setErrorStatus( (ossim_int32)res );
+                  }
+                  
+                  ossimNotify(ossimNotifyLevel_WARN) << std::endl;
+                  
+                  // Always cleanup:
+                  curl_easy_cleanup(curl);
+               }
+               
+               // Cleanup curl:
+               curl_global_cleanup();
+            
+            } // Matches: if ( url.size() )
+
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << M << "\nCould create projection for: " << file << std::endl;
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << M << "\nCould create geometry for: " << file << std::endl;
+      }  
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << M << "\nCould not open: " << file << std::endl;
+   }
+   
+   if(traceDebug())
+   {
+      // Since ossimFileWalker is threaded output the file so we know which job exited.
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
+   }
+   
+   return result;
+   
+} // End: omarDataMgrUtil::callAddRasterService( file )
+
+bool omarDataMgrUtil::callRemoveRasterService( const ossimFilename& file )
+{
+   static const char M[] = "omarDataMgrUtil::callRemoveRasterService";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "\nfile:    " << file << "\n";
+   }
+   
+   bool result = false;
+
+   if ( isPastLastAccessedThreshold( file ) )
+   {
+      std::string service;
+      getService( service );
+   
+      std::string url;
+      getUrl( url );
+   
+      if ( service.size() && url.size() )
+      {
+         CURL* curl = curl_easy_init();
+         if ( curl )
+         {
+            // Data for POST:
+            std::string data = std::string("filename=") + file.string();
+            curl_easy_setopt( curl, CURLOPT_POSTFIELDS, data.c_str() );
+         
+            // Create the URL string:
+            std::string urlString = url + service;
+            curl_easy_setopt( curl, CURLOPT_URL, urlString.c_str() );
+         
+            ossimNotify(ossimNotifyLevel_INFO)
+               << "data: " << data 
+               << "\nurl: " << urlString.c_str()
+               << std::endl;
+         
+            // Tell libcurl to follow redirection
+            curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+         
+            // Run it:
+            CURLcode res = curl_easy_perform(curl);
+         
+            // Check for errors:
+            if ( res == CURLE_OK )
+            {
+               // Response code of the http transaction:
+               long respcode; 
+               res = curl_easy_getinfo(curl,CURLINFO_RESPONSE_CODE, &respcode);
+               if ( res == CURLE_OK )
+               {
+                  if ( respcode == 200 ) //  OK 200 "The request was fulfilled."
+                  {
+                     result = true; // Set return status for caller.
+
+                     // Check for clean flag:
+                     if ( getCleanFlag() )
+                     {
+                        clean( file );
+                     }
+                  }
+               }
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "curl_easy_perform() failed: \n"
+                  << curl_easy_strerror(res)
+                  << std::endl;
+               setErrorStatus( (ossim_int32)res );
+            }
+         
+            ossimNotify(ossimNotifyLevel_WARN) << std::endl;
+         
+            // Always cleanup:
+            curl_easy_cleanup(curl);
+         }
+      
+         // Cleanup curl:
+         curl_global_cleanup();
+      
+      } // Matches: if ( service.size() )
+      
+   } // Matches: if ( isPastLastAccessedThreshold( file ) )
+   
+   if(traceDebug())
+   {
+      // Since ossimFileWalker is threaded output the file so we know which job exited.
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
+   }
+   
+   return result;
+      
+} // End: omarDataMgrUtil::callRemoveRasterService( file, clean )
+
+
+void omarDataMgrUtil::clean( const ossimFilename& file ) const
+{
+   // Remove files from disk:
+   ossimFilename f = file;
+   
+   // Base image file:
+   if ( f.exists() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << "\nRemoving file: " << f << "\n";
+      ossimFilename::remove( f );
+   }
+   
+   // Overview:
+   ossimString e = "ovr";
+   f.setExtension( e );
+   if ( f.exists() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << "Removing file: " << f << "\n";
+      ossimFilename::remove( f );
+   }
+
+   // Histogram:
+   e = "his";
+   f.setExtension( e );
+   if ( f.exists() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << "Removing file: " << f << "\n";
+      ossimFilename::remove( f );
+   }
+   
+   // Omd file:
+   e = "omd";
+   f.setExtension( e );
+   if ( f.exists() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << "Removing file: " << f << "\n";
+      ossimFilename::remove( f );
+   }
+}
+
+bool omarDataMgrUtil::isFiltered(const ossimFilename& file) const
+{
+   bool result = false;
+   if ( file.size() )
+   {
+      // Strip full path to base name.
+      std::string baseName = file.file().string();
+      if ( baseName.size() )
+      {
+         std::vector<std::string>::const_iterator i = m_filteredImages.begin();
+         while ( i != m_filteredImages.end() )
+         {
+            if ( baseName == (*i) )
+            {
+               result = true;
+               break;
+            }
+            ++i;
+         }
+      }
+   }
+#if 0 /* Please leave for debug. (drb) */
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimFileWalker::isFiltered file " << (result?"filtered: ":"not filtered: ")
+         << file << "\n";
+   }
+#endif
+   
+   return result;
+}
+
+bool omarDataMgrUtil::keyIsTrue( const std::string& key ) const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      std::string value = m_kwl->findKey( key );
+      if ( value.size() )
+      {
+         result = ossimString(value).toBool();
+      }
+   }
+   return result;
+}
+
+const std::vector<std::string>& omarDataMgrUtil::getFilteredImages() const
+{
+   return m_filteredImages;
+}
+
+std::vector<std::string>& omarDataMgrUtil::getFilteredImages()
+{
+   return m_filteredImages;
+}
+
+void omarDataMgrUtil::initializeDefaultFilterList()
+{
+   m_mutex.lock();
+
+   // Common images to filter out, put most common first.
+   m_filteredImages.push_back(std::string("icon.jpg"));
+   m_filteredImages.push_back(std::string("logo.jpg"));
+   m_filteredImages.push_back(std::string("preview.jpg"));
+   
+   m_mutex.unlock();
+}
+
+void omarDataMgrUtil::dumpFilteredImageList() const
+{
+   ossimNotify(ossimNotifyLevel_NOTICE) << "Filtered image list:\n";
+
+   std::vector<std::string>::const_iterator i = m_filteredImages.begin();
+   while ( i != m_filteredImages.end() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << (*i) << "\n";
+      ++i;
+   }
+
+   ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
+}
+
+void omarDataMgrUtil::setDumpFilteredImageListFlag( bool flag )
+{
+   // Add this for hasRequiredOverview method.
+   std::string key   = DUMP_FILTERED_IMAGES_KW;
+   std::string value = ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+}
+
+bool omarDataMgrUtil::getDumpFilterImagesFlag() const
+{
+   return keyIsTrue( DUMP_FILTERED_IMAGES_KW );
+}
+
+bool omarDataMgrUtil::getCleanFlag() const
+{
+   return keyIsTrue( CLEAN_KW );
+}
+
+void omarDataMgrUtil::setOverrideFilteredImagesFlag( bool flag )
+{
+   std::string key   = OVERRIDE_FILTERED_IMAGES_KW;
+   std::string value = ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+}
+
+bool omarDataMgrUtil::getOverrideFilteredImagesFlag() const
+{
+   return keyIsTrue( OVERRIDE_FILTERED_IMAGES_KW );
+}
diff --git a/apps/curl_apps/omarDataMgrUtil.h b/apps/curl_apps/omarDataMgrUtil.h
new file mode 100644
index 0000000..d89f674
--- /dev/null
+++ b/apps/curl_apps/omarDataMgrUtil.h
@@ -0,0 +1,280 @@
+//----------------------------------------------------------------------------
+// File: omarDataMgrUtil.h
+// 
+// License: See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: omarDataMgrUtil
+//
+// See class descriptions below for more.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef omarDataMgrUtil_HEADER
+#define omarDataMgrUtil_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFileProcessorInterface.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/util/ossimImageUtil.h>
+
+#include <OpenThreads/Mutex>
+#include <ostream>
+#include <vector>
+
+class ossimArgumentParser;
+class ossimFileWalker;
+class ossimGpt;
+class ossimImageHandler;
+class ossimPropertyInterface;
+
+/**
+ * @brief omarDataMgrUtil class.
+ *
+ * Utility class for processing images recursively and calling OMAR
+ * dataManager services upon successful open.
+ */
+class omarDataMgrUtil :
+   public ossimReferenced, public ossimFileProcessorInterface
+{
+public:
+
+   enum OmarDataMgrUtilService
+   {
+      UNKNOWN       = 0,
+      ADD_RASTER    = 1,
+      REMOVE_RASTER = 2
+   };
+   
+   /** default constructor */
+   omarDataMgrUtil();
+
+   /** virtual destructor */
+   virtual ~omarDataMgrUtil();
+
+   /**
+    * @brief Adds application arguments to the argument parser.
+    * @param ap Parser to add to.
+    */
+   void addArguments(ossimArgumentParser& ap);
+
+   /**
+    * @brief Initial method.
+    *
+    * Typically called from application prior to execute.  This parses
+    * all options and put in keyword list m_kwl.
+    * 
+    * @param ap Arg parser to initialize from.
+    *
+    * @return true, indicating process should continue with execute.
+    */
+   bool initialize(ossimArgumentParser& ap);
+
+   /**
+    * @brief Execute method.
+    *
+    * This launches file walking mechanism.
+    *
+    * @return int, 0 = good, non-zero something happened.  Because this can
+    * process multiple files a non-zero return may indicate just one file
+    * did not complete, e.g. building overviews.
+    * 
+    * @note Throws ossimException on error.
+    */
+   ossim_int32 execute();
+
+   /**
+    * @brief ProcessFile method.
+    *
+    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
+    *
+    * This method is linked to the ossimFileWalker::walk method via a callback
+    * mechanism.  It is called by the ossimFileWalk (caller).  In turn this
+    * class (callee) calls ossimFileWalker::setRecurseFlag and
+    * ossimFileWalker::setAbortFlag to control the waking process.
+    * 
+    * @param file to process.
+    */
+   virtual void processFile(const ossimFilename& file);
+   
+   /**
+    * @brief Set number of threads to use.
+    *
+    * This is only used in execute method if a directory is given to
+    * application to walk.
+    *
+    * @param threads Defaults to 1 if THREADS_KW is not found.
+    */
+   void setNumberOfThreads( ossim_uint32 threads );
+   void setNumberOfThreads( const std::string& threads );
+
+   /** @return The list of filtered out files. */
+   const std::vector<std::string>& getFilteredImages() const;
+
+   /**
+    * @brief Non const method to allow access for
+    * adding or deleting extensions from the list.
+    *
+    * The list is used by the private isFiltered method to avoid trying to
+    * process unwanted files.
+    */
+   std::vector<std::string>& getFilteredImages();
+
+private:
+
+   /** @return service as enumerated type. */
+   omarDataMgrUtil::OmarDataMgrUtilService getService() const;
+
+   /** @brief Gets service string, e.g. /dataManager/addRaster. */
+   void getService(std::string& serviceString) const;
+
+   /** @brief Gets url string, e.g. http://localhost:8080/omar */
+   void getUrl(std::string& url) const;
+
+   /**
+    * @brief Runs the curl command to call addRaster service.
+    * @param file Image file.
+    * @return true if http status code of 200(OK); else, false
+    */
+   bool callAddRasterService( const ossimFilename& file );
+
+   /**
+    * @brief Runs the curl command to call removeRaster service.
+    * @param file Image file.
+    * @return true if http status code of 200(OK); else, false
+    */
+   bool callRemoveRasterService( const ossimFilename& file );
+
+   /**
+    * @brief Removes files from disk.
+    *
+    * Triggered by the --clean option.
+    * 
+    * Given: 
+    * base file = foo.ntf
+    *
+    * Currently removes:
+    * foo.ntf
+    * foo.ovr
+    * foo.his
+    * foo.omd
+    *
+    * There are no checks for multi-entry images or directory based image
+    * files.
+    */
+   void clean( const ossimFilename& file ) const;
+
+   /**
+    * @brief Convenience method to check file to see is if file should be
+    * processed.
+    *
+    * @param f File to check.
+    * 
+    * @return true if f is in filter list, false if not.
+    */
+   bool isFiltered(const ossimFilename& f) const;
+   
+   /**
+    * @brief Initializes the filter list with a default set of filtered out
+    * file names.
+    */
+   void initializeDefaultFilterList();
+
+   /** @brief Dumps filtered image list to std out. */
+   void dumpFilteredImageList() const;
+   
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
+   
+   /**
+    * @return Threads to use.  Defaults to 1 if THREADS_KW is not found.
+    */
+   ossim_uint32 getNumberOfThreads() const;
+
+   /**
+    * @brief Adds option to m_kwl with mutex lock.
+    * @param key
+    * @param value
+    */
+   void addOption( const std::string& key, ossim_uint32 value );
+   void addOption( const std::string& key, const std::string& value );
+   
+   /**
+    * @brief Sets the m_errorStatus for return on execute.
+    */
+   void setErrorStatus( ossim_int32 status );
+
+   /**
+    * @brief Sets the dump filteredImageList flag.
+    * @param flag
+    */
+   void setDumpFilteredImageListFlag( bool flag );
+   
+   /**
+    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
+    * false.
+    * 
+    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
+    */
+   bool getDumpFilterImagesFlag() const;
+
+   /**
+    * @return true if CLEAN_KW key is found and value is true; else,
+    * false.
+    * 
+    * CLEAN_KW = "clean"
+    */
+   bool getCleanFlag() const;
+
+   /**
+    * @brief Sets the override filtered images flag.
+    * @param flag
+    */
+   void setOverrideFilteredImagesFlag( bool flag );
+   
+   /**
+    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
+    * false.
+    * 
+    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
+    */
+   bool getOverrideFilteredImagesFlag() const;
+
+   /**
+    * @return true if file is a directory based image and the stager should go
+    * on to next directory; false if stager should continue with directory.
+    */
+   bool isDirectoryBasedImage(const ossimImageHandler* ih) const;
+
+   /**
+    * @brief Checks file last access time against threshold.
+    *
+    * This check for option key "access_time_threshold", value in days.  If
+    * found will return true if files last access time is greater than the
+    * threshold days.  If key is not set the default return is true.
+    * 
+    * @return true if file is past last accessed threshold.
+    */
+   bool isPastLastAccessedThreshold( const ossimFilename& file ) const;
+
+   /** @return true if key is set to true; false, if not. */
+   bool keyIsTrue( const std::string& key ) const;
+   
+   /** Holds all options passed into intialize except writer props. */
+   ossimRefPtr<ossimKeywordlist> m_kwl;
+
+   ossimFileWalker*   m_fileWalker;
+   OpenThreads::Mutex m_mutex;
+
+   ossimRefPtr<ossimImageUtil> m_imageUtil;
+   ossim_int32 m_errorStatus;
+
+   /** Hold images we never want to process. */
+   std::vector<std::string> m_filteredImages; 
+};
+
+#endif /* #ifndef omarDataMgrUtil_HEADER */
diff --git a/ossim/src/apps/ossim-adrg-dump/CMakeLists.txt b/apps/ossim-adrg-dump/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-adrg-dump/CMakeLists.txt
rename to apps/ossim-adrg-dump/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-adrg-dump/ossim-adrg-dump.cpp b/apps/ossim-adrg-dump/ossim-adrg-dump.cpp
similarity index 100%
rename from ossim/src/apps/ossim-adrg-dump/ossim-adrg-dump.cpp
rename to apps/ossim-adrg-dump/ossim-adrg-dump.cpp
diff --git a/ossim/src/apps/ossim-applanix2ogeom/CMakeLists.txt b/apps/ossim-applanix2ogeom/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-applanix2ogeom/CMakeLists.txt
rename to apps/ossim-applanix2ogeom/CMakeLists.txt
diff --git a/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp b/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp
new file mode 100644
index 0000000..76bb856
--- /dev/null
+++ b/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp
@@ -0,0 +1,322 @@
+
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Applinix to ossim geometry.
+// 
+// Application to create an ossim geometry file from Applanix
+// support data files.
+//
+//----------------------------------------------------------------------------
+// $Id: applanix2ogeom.cpp 13025 2008-06-13 17:06:30Z sbortman $
+
+#include <iostream>
+#include <cstdlib>
+using namespace std;
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimApplanixEOFile.h>
+#include <ossim/projection/ossimApplanixEcefModel.h>
+#include <ossim/projection/ossimApplanixUtmModel.h>
+
+
+static const ossimTrace traceDebug(ossimString("applanix2ogeom:debug"));
+
+bool processImage(ossimApplanixEOFile& eo,
+                  const ossimKeywordlist& kwl,
+                  const ossimString& id,
+                  const ossimFilename& outputDir);
+
+int main(int argc, char* argv[])
+{
+   static const char MODULE[] = "applanix2ogeom";
+
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   bool outputDirOverrideFlag = false;
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+
+   argumentParser.getApplicationUsage()->setApplicationName(
+      argumentParser.getApplicationName());
+   
+   argumentParser.getApplicationUsage()->setDescription(
+      argumentParser.getApplicationName()+
+      " Creates ossim geometry file from Applannix support data.");
+   
+   argumentParser.getApplicationUsage()->setCommandLineUsage(
+      argumentParser.getApplicationName()+
+      " <camera_file> <exterior_orientation_file> <imageToProcess> <optional_output_directory>");
+
+   argumentParser.getApplicationUsage()->addUsageExplanation(
+      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
+      std::string("camera_file"),
+      std::string("Serial number specific keyword list with camera parameters."));
+   
+   argumentParser.getApplicationUsage()->addUsageExplanation(
+      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
+      std::string("exterior_orientation_file"),
+      std::string("Applanix exterior orientation file."));
+   
+   argumentParser.getApplicationUsage()->addUsageExplanation(
+      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
+      std::string("imageToProcess"),
+      std::string("Image to create geometry for. If not present then all geometries are created"));
+   
+   argumentParser.getApplicationUsage()->addUsageExplanation(
+      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
+      std::string("option_output_directory"),
+      std::string("Option directory to output geometry file(s) to.  If not set the imageToProcess directory will be used."));
+
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "-h or --help", "Shows help");
+   
+   //---
+   // Extract optional arguments.
+   //---
+   if(argumentParser.read("-h") || argumentParser.read("--help"))
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      exit(0);
+   }
+   
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+   if (argumentParser.errors())
+   {
+      argumentParser.writeErrorMessages(std::cout);
+      exit(1);
+   }
+
+   // cout << "argc:  " << argumentParser.argc() << endl;
+   
+   if(argumentParser.argc() < 4)
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      exit(1);
+   }
+
+//    if(argumentParser.argc() == 4)
+//    {
+//       if(!ossimFilename(argumentParser.argv()[3]).isDir())
+//       {
+//          ossimNotify(ossimNotifyLevel_WARN) << "for the 3 argument option the last argument must be a directory" << std::endl;
+//          exit(0);
+//       }
+//    }
+   ossimFilename cameraFile     = argumentParser.argv()[1];
+   ossimFilename eoFile         = argumentParser.argv()[2];
+   ossimFilename imageToProcess;
+   ossimFilename outputDir;
+   ossim_uint32 maxIdx = argumentParser.argc();
+   if (argumentParser.argc() > 4)
+   {
+      outputDir = argumentParser.argv()[argumentParser.argc()-1];
+
+      if (outputDir.isDir() == false) // doesn't exist
+      {
+         --maxIdx;
+         if (outputDir.createDirectory() == false)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nCould not create directory:  " << outputDir
+               << endl;
+            exit(1);
+         }
+      }
+      outputDirOverrideFlag = outputDir.exists();
+   }
+
+   
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG:"
+         << "\ncamera file:       " << cameraFile
+         << "\neo file:           " << eoFile
+         << endl;
+   }
+
+   
+   // Keyword list to pass to model loadState.
+   ossimKeywordlist kwl;
+   // Open up the exterior orientation file.
+   ossimApplanixEOFile eo;
+   if (eo.parseFile(eoFile) == false)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Could not open:  " << eoFile << endl;
+      exit(1);
+   }
+   eo.indexRecordIds();
+
+   if(argc >4)
+   {
+      ossim_uint32 idx = 0;
+      for(idx = 3; idx < maxIdx; ++idx)
+      {
+         kwl.clear();
+         // Add the eo_file keyword to the keyword list.
+         kwl.add("eo_file", eoFile.c_str(), true);
+         
+         // Add the eo_file keyword to the keyword list.
+         kwl.add("camera_file", cameraFile.c_str(), true);
+         kwl.add("compute_gsd_flag", true, true);
+         
+         // See if the ID is in the eo file.
+         imageToProcess = argumentParser.argv()[idx];
+         ossimString id = imageToProcess.fileNoExtension();
+         ossimRefPtr<ossimApplanixEORecord> rec = eo.getRecordGivenId(id);
+         if (!rec)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "applanix2ogeom ERROR:"
+               << "\nMatching id for imageToProcess not found in eo file!"
+               << "\nfile:  " << imageToProcess
+               << "\nid:    " << id
+               << "\nReturning..." << endl;
+            exit(1);
+         }
+         kwl.add("image_id", id, true);
+         if (!outputDirOverrideFlag)
+         {
+            outputDir = imageToProcess.path();
+         }
+         processImage(eo, kwl, id, outputDir);
+      }
+   }
+   else if(argc <=4)
+   {
+      outputDir = argumentParser.argv()[argumentParser.argc()-1];
+
+      if(!outputDir .isDir())
+      {
+         ossimFilename idFile = outputDir.file();
+         outputDir = outputDir.path();
+         idFile = idFile.setExtension("");
+         const ossimRefPtr<ossimApplanixEORecord> rec = eo.getRecordGivenId(idFile);
+         
+         if(rec.valid())
+         {
+            // Add the eo_file keyword to the keyword list.
+            kwl.add("eo_file", eoFile.c_str(), true);
+            kwl.add("eo_id", idFile.c_str(), true);
+            
+            // Add the eo_file keyword to the keyword list.
+            kwl.add("camera_file", cameraFile.c_str(), true);
+            kwl.add("compute_gsd_flag", true, true);
+            
+            processImage(eo, kwl, idFile, outputDir);
+         }
+      }
+      else
+      {
+         ossim_uint32 idx = 0;
+         ossim_uint32 nRecords = eo.getNumberOfRecords();
+         ossim_int32 idIdx = eo.getFieldIdx("ID");
+         if(idIdx >= 0)
+         {
+            for(idx = 0; idx < nRecords; ++idx)
+            {
+               const ossimRefPtr<ossimApplanixEORecord> rec = eo.getRecord(idx);
+               
+               if(rec.valid())
+               {
+                  ossimString id = (*rec)[idIdx];
+                  // Add the eo_file keyword to the keyword list.
+                  kwl.add("eo_file", eoFile.c_str(), true);
+                  kwl.add("eo_id", id.c_str(), true);
+                  
+                  // Add the eo_file keyword to the keyword list.
+                  kwl.add("camera_file", cameraFile.c_str(), true);
+                  kwl.add("compute_gsd_flag", true, true);
+                  
+                  processImage(eo, kwl, id, outputDir);
+               }
+            }
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "NO ID RECORD FOUND!!" << std::endl;
+            exit(0);
+         }
+      }
+   }
+   
+   
+   return 0;
+}
+
+bool processImage(ossimApplanixEOFile& eo,
+                  const ossimKeywordlist& kwl,
+                  const ossimString& id,
+                  const ossimFilename& outputDir)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "applanix2ogeom:processImage DEBUG:"
+         << "\nkwl:\n"
+         << kwl
+         << endl;
+   }
+
+//   ossimRefPtr<ossimApplanixEcefModel> model = new ossimApplanixEcefModel;
+   ossimRefPtr<ossimProjection> model;
+
+   if(eo.isUtmFrame())
+   {
+      model = new ossimApplanixUtmModel;
+   }
+   else
+   {
+     model = new ossimApplanixEcefModel;
+   }
+   if (model->loadState(kwl) == false)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "applanix2ogeom:processImage ERROR:"
+         << "\nossimApplanixEcefModel::loadState failded for id:  "
+         << id
+         << endl;
+      return false;
+   }
+      
+   ossimFilename geomFile = id;
+   geomFile.setExtension(ossimString(".geom"));
+   if (outputDir != ossimFilename::NIL)
+   {
+      geomFile = outputDir.dirCat(geomFile);
+   }
+
+   ossimKeywordlist geomKwl;
+   model->saveState(geomKwl);
+
+   if (geomKwl.write(geomFile.c_str()) == false)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "applanix2ogeom:processImage ERROR:"
+         << "\nCould not write file:  " << geomFile << endl;
+      return false;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "Wrote file:  " << geomFile << endl;
+   }
+   return true;
+}
diff --git a/ossim/src/apps/ossim-autreg/CMakeLists.txt b/apps/ossim-autreg/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-autreg/CMakeLists.txt
rename to apps/ossim-autreg/CMakeLists.txt
diff --git a/apps/ossim-autreg/ossim-autreg.cpp b/apps/ossim-autreg/ossim-autreg.cpp
new file mode 100644
index 0000000..515d2eb
--- /dev/null
+++ b/apps/ossim-autreg/ossim-autreg.cpp
@@ -0,0 +1,96 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-autreg.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Hicks
+//
+// Description: Autonomous registration.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimAutRegUtil.h>
+
+#include <vector>
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+#include <ctime>
+#include <cstdlib>
+
+
+using namespace std;
+
+static ossimTrace traceDebug = ossimTrace("ossim-autreg:debug");
+
+
+int main(int argc, char *argv[])
+{
+   // Start the timer.
+   ossimTimer::instance()->setStartTick();
+
+   //---
+   // Get the arg count so we can tell if an arg was consumed by
+   // ossimInit::instance()->initialize
+   //---
+   int originalArgCount = argc;
+   
+   ossimArgumentParser ap(&argc, argv);
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(ap);
+
+   //---
+   // Avoid going on if a global option was consumed by ossimInit::initialize
+   // like -V or --version option and the arg count is down to 1.
+   //---
+   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
+   {
+
+      ossimRefPtr<ossimAutRegUtil> autreg = new ossimAutRegUtil;
+
+      try
+      {      
+         //---
+         // NOTE: ossimAutRegUtil::initialize handles the application usage which will
+         // false, to end things if certain options (e.g. "--help") are provided.
+         //
+         // ossimAutRegUtil::initialize can throw an exception.
+         //---
+         bool goAhead = autreg->initialize(ap);
+         if (goAhead)
+         {      
+            // ossimAutRegUtil::execute can throw an excepion.
+            autreg->execute();
+            
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "elapsed time in seconds: "
+               << std::setiosflags(ios::fixed)
+               << std::setprecision(3)
+               << ossimTimer::instance()->time_s() << endl;
+         }
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         exit(1);
+      }
+      
+   } // End: if ( ( ap.argc() > 1 ) ...
+
+   exit(0);
+   
+} // End of main...
diff --git a/ossim/src/apps/ossim-band-merge/CMakeLists.txt b/apps/ossim-band-merge/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-band-merge/CMakeLists.txt
rename to apps/ossim-band-merge/CMakeLists.txt
diff --git a/apps/ossim-band-merge/ossim-band-merge.cpp b/apps/ossim-band-merge/ossim-band-merge.cpp
new file mode 100644
index 0000000..69b0496
--- /dev/null
+++ b/apps/ossim-band-merge/ossim-band-merge.cpp
@@ -0,0 +1,326 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Ken Melero
+//
+// Merges input images together into output image.  Images must be of
+// same scalar type and same number of bands.  If image width is different
+// output image will be expanded to the largest input image width.
+//
+//*******************************************************************
+//  $Id: band_merge.cpp 10695 2007-04-12 13:56:50Z gpotts $
+
+#include <ossim/imaging/ossimJpegWriter.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimImageTypeLut.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactory.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimBandMergeSource.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <iostream>
+#include <exception>
+static ossimTrace traceDebug("band_merge:main");
+
+static void usage();
+static void outputWriterTypes();
+
+int main(int argc, char* argv[])
+{
+   static const char MODULE[] = "band_merge:main";
+
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+ 
+   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" merges band separate images to one image");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-o or --create-overview", "Creates and overview for the output image");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-w or --tile-width", "Defines the tile width for the handlers that support tiled output");
+   
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
+
+   if (argumentParser.read("-h") ||
+       argumentParser.read("--help")||(argumentParser.argc() < 2))
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage(); // for writer output types
+      exit(0);
+   }
+
+   // Keyword list to initialize image writers with.
+   ossimKeywordlist kwl;
+   const char* PREFIX = "imagewriter.";
+
+   ossim_uint32 tile_width = 32;
+   bool create_overview = false;
+
+   if (argumentParser.read("-o") || argumentParser.read("--crate-overview"))
+   {
+      create_overview = true;
+      std::cout << "\nOutput overview building enabled." << std::endl;
+   }
+
+   if (argumentParser.read("-w", stringParam) ||
+       argumentParser.read("-tile-width", stringParam))
+   {
+      tile_width = ossimString(tempString).toInt();
+      if ((tile_width % 16) != 0)
+      {
+         cerr << MODULE << " NOTICE:"
+              << "\nTile width must be a multiple of 16!"
+              << "\nDefaulting to 128"
+              << std::endl;
+         tile_width = 0;
+      }
+      std::cout << "Tile width set to:  " << tile_width << std::endl;
+   }
+   
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+   
+   // Three required args:  output_type, input file, and output file.
+   if (argumentParser.errors())
+   {
+      argumentParser.writeErrorMessages(std::cout);
+      exit(0);
+   }
+   if (argumentParser.argc() == 1)
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage(); // for writer output types
+      exit(0);
+   }
+   
+   ossim_uint32 number_of_source_images = argumentParser.argc() - 3;
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nargc:  " << argumentParser.argc()
+           << "\nnumber_of_source_images:  " << number_of_source_images
+           << "\ntile_width:  " << tile_width
+           << "\ncreate_overview:  " << (create_overview?"true":"false")
+           << std::endl;
+   }
+
+   ossimString output_type = argv[1];
+   output_type.downcase();
+   std::cout << "Output type:        " << output_type << std::endl;
+
+   // Create the vector of image handlers.
+   ossimConnectableObject::ConnectableObjectList ihs;
+   for(ossim_uint32 h = 0; h < number_of_source_images; ++h)
+   {
+      ossimFilename f = argv[h + 2];
+      std::cout << "Input_image[" << h << "]:     " << f << std::endl;
+      ihs.push_back(ossimImageHandlerRegistry::instance()->open(f));
+   }
+
+   // Get the output file.
+   ossimFilename output_file = argv[argumentParser.argc() - 1];
+   std::cout << "Output file:        " << output_file << std::endl;   
+
+   //---
+   // Set the output writer type and the image type.
+   //---
+   kwl.add(PREFIX, ossimKeywordNames::TYPE_KW, output_type.c_str());
+
+   ossimRefPtr<ossimBandMergeSource> bm = new ossimBandMergeSource(ihs);
+   ossimRefPtr<ossimImageFileWriter> fileWriter =
+      ossimImageWriterFactoryRegistry::instance()->createWriter(kwl, PREFIX);
+   if(!fileWriter)
+   {
+      bm->disconnect();
+      bm = 0;
+      ossimConnectableObject::ConnectableObjectList::iterator i = ihs.begin();
+      while (i != ihs.end())
+      {
+         (*i)->disconnect();
+         (*i) = 0;
+         ++i;
+      }
+      
+      cerr << "Error making an image writer..."
+           << "\nExiting application..." << std::endl;
+      exit(1);
+   }
+   
+   // Write out a geometry file for new image.
+   ossimKeywordlist bm_geom;
+   ossimRefPtr<ossimImageGeometry> geom = bm->getImageGeometry();
+   geom->saveState(bm_geom);
+   
+   ossimFilename geom_file = output_file;
+   geom_file.setExtension("geom");
+   bm_geom.write(geom_file);
+   
+   fileWriter->connectMyInputTo(0, bm.get());
+   
+   if (tile_width)
+   {
+      // Set the tile size...
+      fileWriter->setTileSize(ossimIpt(tile_width, tile_width));
+   }
+   
+   fileWriter->open(output_file);
+   
+   ossimStdOutProgress prog(2);
+   fileWriter->addListener(&prog);
+   
+   fileWriter->setAreaOfInterest(bm->getBoundingRect());
+
+   if( fileWriter->canCastTo("ossimTiffWriter") )
+   {
+//      ossimTiffWriter* twriter = PTR_CAST(ossimTiffWriter, fileWriter);
+      
+      if(fileWriter.valid())
+      {
+         try
+         {
+            fileWriter->execute();
+         }
+         catch(std::exception& e)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "band_merge: ERROR exception caught:\n"
+               << e.what()
+               << std::endl;
+         }
+         catch (...)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "band_merge: ERROR - Unknown exception caught!"
+               << std::endl;
+         }
+      }
+   }
+   else if(fileWriter->canCastTo("ossimJpegWriter"))
+   {
+      ossimRefPtr<ossimScalarRemapper> remapper = NULL;
+      
+      if(PTR_CAST(ossimJpegWriter, fileWriter.get()) &&
+         (bm->getOutputScalarType() != OSSIM_UCHAR))
+      {
+         remapper = new ossimScalarRemapper(bm.get(), OSSIM_UCHAR);
+         remapper->initialize();
+         fileWriter->connectMyInputTo(0, remapper.get());
+      }
+      fileWriter->initialize();
+      try
+      {
+         fileWriter->execute();
+      }
+      catch(std::exception& e)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "band_merge: ERROR exception caught:\n"
+            << e.what()
+            << std::endl;
+      }
+      catch (...)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "band_merge: ERROR - Unknown exception caught!"
+            << std::endl;
+      }
+   }
+   else
+   {
+      try
+      {
+         fileWriter->execute();
+      }
+      catch(std::exception& e)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "band_merge: ERROR exception caught:\n"
+               << e.what()
+               << std::endl;
+         }
+      }
+      catch (...)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "band_merge: ERROR - Unknown exception caught!"
+               << std::endl;
+         }
+      }
+   }
+   
+   if (create_overview == true)
+   {
+      fileWriter->writeOverviewFile();
+   }
+   fileWriter->disconnect();
+   fileWriter = 0;
+   bm = 0;
+   ossimConnectableObject::ConnectableObjectList::iterator it = ihs.begin();
+   while (it != ihs.end())
+   {
+      (*it)->disconnect();
+      (*it) = 0;
+      ++it;
+   }
+
+   exit(0);
+}
+
+void usage()
+{
+   std::cout
+      << "band_merge: Band Merge\n"
+      << "Usage:\n"
+      << "band_merge [-h][-o][-w tile_width] <output_type> <input_file1> "
+      << "<input_file2> ... <output_file>"
+      << "\n\nOptional argument list:"
+      << "\n -h  -- display Usage/Help"
+      << "\n -o  -- create an ossim overview file with output file"
+      << "\n -w  -- tile width (default = 32)"
+      << "\n"
+      << "\nNOTES:"
+      << "\n\"-w\" option only valid with tiff type."
+      << "\n\"Tile width must be a multiple of 32."
+      << "\nValid output writer types:"
+      << "\n";
+   
+   outputWriterTypes();
+}
+
+void outputWriterTypes()
+{
+   ossimImageTypeLut lut;
+
+   ossim_uint32 index = 0;
+   ossimString type = lut.getTableIndexString(index);
+   
+   while (type.size())
+   {
+      std::cout << "\t" << type << std::endl;
+      ++index;
+      type = lut.getTableIndexString(index);
+   }
+   std::cout << std::endl;
+}
diff --git a/ossim/src/apps/ossim-btoa/CMakeLists.txt b/apps/ossim-btoa/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-btoa/CMakeLists.txt
rename to apps/ossim-btoa/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-btoa/ossim-btoa.cpp b/apps/ossim-btoa/ossim-btoa.cpp
similarity index 100%
rename from ossim/src/apps/ossim-btoa/ossim-btoa.cpp
rename to apps/ossim-btoa/ossim-btoa.cpp
diff --git a/ossim/src/apps/ossim-chgkwval/CMakeLists.txt b/apps/ossim-chgkwval/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-chgkwval/CMakeLists.txt
rename to apps/ossim-chgkwval/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-chgkwval/ossim-chgkwval.cpp b/apps/ossim-chgkwval/ossim-chgkwval.cpp
similarity index 100%
rename from ossim/src/apps/ossim-chgkwval/ossim-chgkwval.cpp
rename to apps/ossim-chgkwval/ossim-chgkwval.cpp
diff --git a/ossim/src/apps/ossim-chipper/CMakeLists.txt b/apps/ossim-chipper/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-chipper/CMakeLists.txt
rename to apps/ossim-chipper/CMakeLists.txt
diff --git a/apps/ossim-chipper/ossim-chipper.cpp b/apps/ossim-chipper/ossim-chipper.cpp
new file mode 100644
index 0000000..8bc8980
--- /dev/null
+++ b/apps/ossim-chipper/ossim-chipper.cpp
@@ -0,0 +1,94 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-chipper.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Utility class definition for processing digital elevation models(dems).
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimChipperUtil.h>
+
+#include <cstdlib> /* for exit */
+#include <iomanip>
+#include <iostream>
+
+using namespace std;
+
+static ossimTrace traceDebug = ossimTrace("ossim-chipper:debug");
+
+int main(int argc, char* argv[])
+{
+   ossimTimer timer;
+   // Start the timer.
+   ossimTimer::Timer_t tickStart = timer.tick();
+
+   //---
+   // Get the arg count so we can tell if an arg was consumed by
+   // ossimInit::instance()->initialize
+   //---
+   int originalArgCount = argc;
+   
+   ossimArgumentParser ap(&argc, argv);
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(ap);
+
+   //---
+   // Avoid going on if a global option was consumed by ossimInit::initialize
+   // like -V or --version option and the arg count is down to 1.
+   //---
+   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
+   {
+      // Make the generator.
+      ossimRefPtr<ossimChipperUtil> chipper = new ossimChipperUtil;
+
+      try
+      {      
+         //---
+         // NOTE: ossimChipperUtil::initialize handles the application usage which will
+         // false, to end things if certain options (e.g. "--help") are provided.
+         //
+         // ossimChipperUtil::initialize can throw an exception.
+         //---
+         bool continue_after_init = chipper->initialize(ap);
+         if (continue_after_init)
+         {      
+            // ossimChipperUtil::execute can throw an excepion.
+            chipper->execute();
+            ossimTimer::Timer_t tickEnd = timer.tick();
+            
+            
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "elapsed time in seconds: "
+               << std::setiosflags(ios::fixed)
+               << std::setprecision(3)
+               << timer.delta_s(tickStart, tickEnd) << endl;
+         }
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         exit(1);
+      }
+      
+   } // End: if ( ( ap.argc() > 1 ) ...
+
+   exit(0);
+   
+} // End of main...
diff --git a/apps/ossim-cli/CMakeLists.txt b/apps/ossim-cli/CMakeLists.txt
new file mode 100644
index 0000000..9380b06
--- /dev/null
+++ b/apps/ossim-cli/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-cli INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/apps/ossim-cli/ossim-cli.cpp b/apps/ossim-cli/ossim-cli.cpp
new file mode 100755
index 0000000..9f69a47
--- /dev/null
+++ b/apps/ossim-cli/ossim-cli.cpp
@@ -0,0 +1,167 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <iostream>
+#include <sstream>
+#include <map>
+using namespace std;
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/util/ossimToolRegistry.h>
+#include <ossim/base/ossimException.h>
+
+void showAvailableCommands()
+{
+   ossimToolFactoryBase* factory = ossimToolRegistry::instance();
+   map<string, string> capabilities;
+   factory->getCapabilities(capabilities);
+   map<string, string>::iterator iter = capabilities.begin();
+   cout<<"\nAvailable commands:\n"<<endl;
+   for (;iter != capabilities.end(); ++iter)
+      cout<<"  "<<iter->first<<" -- "<<iter->second<<endl;
+   cout<<endl;
+
+}
+
+void usage(char* appName)
+{
+   cout << "\nUsages: "<<endl;
+   cout << "    "<<appName<<" <command> [command options and parameters]"<<endl;
+   cout << "    "<<appName<<" --spec <command-spec-file>"<<endl;
+   cout << "    "<<appName<<" --version"<<endl;
+   cout << "    "<<appName<<" help <command> -- To get help on specific command."<<endl;
+
+   showAvailableCommands();
+}
+
+bool runCommand(ossimArgumentParser& ap)
+{
+   ossimString command = ap[1];
+   ap.remove(1);
+   ossimToolFactoryBase* factory = ossimToolRegistry::instance();
+   ossimRefPtr<ossimTool> utility = factory->createTool(command);
+
+   if (!utility.valid())
+   {
+      cout << "\nDid not understand command <"<<command<<">"<<endl;
+      showAvailableCommands();
+      return false;
+   }
+
+   if (!utility->initialize(ap))
+   {
+      cout << "\nCould not execute command <"<<command<<"> with arguments and options "
+            "provided."<<endl;
+      return false;
+   }
+
+   if (utility->helpRequested())
+      return true;
+
+   if (!utility->execute())
+   {
+      cout << "\nAn error was encountered executing the command. Check options."<<endl;
+      return false;
+   }
+
+   return true;
+}
+
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap (&argc, argv);
+   ap.getApplicationUsage()->setApplicationName(argv[0]);
+
+   bool status_ok = true;
+   try
+   {
+      // Initialize ossim stuff, factories, plugin, etc.
+      ossimInit::instance()->initialize(ap);
+
+      do
+      {
+         if (argc == 1)
+         {
+            // Blank command line:
+            usage(argv[0]);
+            break;
+         }
+
+         // Spec file provided containing command's arguments and options?
+         ossimString argv1 = argv[1];
+         if (( argv1 == "--spec") && (argc > 2))
+         {
+            // Command line provided in spec file:
+            ifstream ifs (argv[2]);
+            if (ifs.fail())
+            {
+               cout<<"\nCould not open the spec file at <"<<argv[2]<<">\n"<<endl;
+               status_ok = false;
+               break;
+            }
+            ossimString spec;
+            ifs >> spec;
+            ifs.close();
+            ossimArgumentParser new_ap(spec);
+            status_ok = runCommand(new_ap);
+            break;
+         }
+
+         // Need help with app or specific command?
+         if (argv1.contains("help"))
+         {
+            // If no command was specified, then general usage help shown:
+            if (argc == 2)
+            {
+               // Blank command line:
+               usage(argv[0]);
+               break;
+            }
+            else
+            {
+               // rearrange command line for individual utility help:
+               ostringstream cmdline;
+               cmdline<<argv[0]<<" "<<argv[2]<<" --help";
+               ossimArgumentParser new_ap(cmdline.str());
+               status_ok = runCommand(new_ap);
+               break;
+            }
+         }
+
+         if (argv1.string()[0] == '-')
+         {
+            // Treat as info call:
+            ap.insert(1, "info");
+            status_ok = runCommand(ap);
+            break;
+         }
+
+         // Conventional command line, just remove this app's name:
+         status_ok = runCommand(ap);
+
+      } while (false);
+   }
+   catch  (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<e.what()<<endl;
+      exit(1);
+   }
+   catch( ... )
+   {
+      cerr << "Caught unknown exception!" << endl;
+   }
+
+   if (status_ok)
+      exit(0);
+   exit(1);
+}
diff --git a/ossim/src/apps/ossim-cmm/CMakeLists.txt b/apps/ossim-cmm/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-cmm/CMakeLists.txt
rename to apps/ossim-cmm/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-cmm/ossim-cmm.cpp b/apps/ossim-cmm/ossim-cmm.cpp
similarity index 100%
rename from ossim/src/apps/ossim-cmm/ossim-cmm.cpp
rename to apps/ossim-cmm/ossim-cmm.cpp
diff --git a/ossim/src/apps/ossim-computeSrtmStats/CMakeLists.txt b/apps/ossim-computeSrtmStats/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-computeSrtmStats/CMakeLists.txt
rename to apps/ossim-computeSrtmStats/CMakeLists.txt
diff --git a/apps/ossim-computeSrtmStats/ossim-computeSrtmStats.cpp b/apps/ossim-computeSrtmStats/ossim-computeSrtmStats.cpp
new file mode 100644
index 0000000..66a9b50
--- /dev/null
+++ b/apps/ossim-computeSrtmStats/ossim-computeSrtmStats.cpp
@@ -0,0 +1,108 @@
+//**************************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Written by:   David Burken
+// 
+// Description:  This program will open an srtm file.  Compute statistics,
+// then write a ossim meta data (omd) file.
+//
+//**************************************************************************
+// $Id: computeSrtmStats.cpp 13025 2008-06-13 17:06:30Z sbortman $
+
+#include <vector>
+#include <cstdlib>
+#include <fstream>
+#include <iostream>
+#include <iterator>
+
+using namespace std;
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/support_data/ossimSrtmSupportData.h>
+
+static const ossimTrace traceDebug(ossimString("computeStrmStats:debug"));
+
+static void usage()
+{
+   ossimNotify(ossimNotifyLevel_INFO)
+      << "\nNOTES:"
+      << "\n- Output is to a \".omd\" file so if the image was"
+      << " \"N27W081.hgt\" output will be a \"N27W081.omd\" file."
+      << "\n- Example:  computeSrtmStats *.hgt"
+      << endl;
+}
+
+int main(int argc, char* argv[])
+{
+   ossimString tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+
+   // Set the app name.
+   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+
+   // Set usage option.
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
+
+   // Usage...
+   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" <srtm_file>\n");
+   
+   if (argumentParser.read("-h") ||
+       argumentParser.read("--help")||(argumentParser.argc() < 2))
+   {
+      argumentParser.getApplicationUsage()->
+         write(ossimNotify(ossimNotifyLevel_WARN));
+      usage();
+      exit(0);
+   }
+   
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+
+   if(argc == 1)
+   {
+      argumentParser.getApplicationUsage()->
+         write(ossimNotify(ossimNotifyLevel_WARN));
+      usage();
+      exit(1);
+   }
+
+   // Default variables
+
+   ossim_uint32 fileCount = argc - 1;
+   
+   ossim_uint32 idx = 1;
+   for(idx = 1; idx <= fileCount; ++idx)
+   {
+      // Get the srtm file name.
+      ossimFilename srtmFile(argv[idx]);
+
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "Processing srtm file:  " << srtmFile << endl;
+
+      ossimSrtmSupportData ss;
+      if (ss.setFilename(srtmFile, true) == true)
+      {
+         ossimFilename omdFile = srtmFile;
+         omdFile.setExtension(ossimString("omd"));
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Wrote file:            " << omdFile.c_str() << std::endl;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Error processing:      " << srtmFile.c_str() << std::endl;
+      }
+      
+   } // End of loop through file...
+
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-config.in b/apps/ossim-config.in
similarity index 100%
rename from ossim/src/apps/ossim-config.in
rename to apps/ossim-config.in
diff --git a/ossim/src/apps/ossim-correl/CMakeLists.txt b/apps/ossim-correl/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-correl/CMakeLists.txt
rename to apps/ossim-correl/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-correl/ossim-correl.cpp b/apps/ossim-correl/ossim-correl.cpp
similarity index 100%
rename from ossim/src/apps/ossim-correl/ossim-correl.cpp
rename to apps/ossim-correl/ossim-correl.cpp
diff --git a/ossim/src/apps/ossim-create-bitmask/CMakeLists.txt b/apps/ossim-create-bitmask/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-create-bitmask/CMakeLists.txt
rename to apps/ossim-create-bitmask/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-create-bitmask/ossim-create-bitmask.cpp b/apps/ossim-create-bitmask/ossim-create-bitmask.cpp
similarity index 100%
rename from ossim/src/apps/ossim-create-bitmask/ossim-create-bitmask.cpp
rename to apps/ossim-create-bitmask/ossim-create-bitmask.cpp
diff --git a/ossim/src/apps/ossim-create-cg/CMakeLists.txt b/apps/ossim-create-cg/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-create-cg/CMakeLists.txt
rename to apps/ossim-create-cg/CMakeLists.txt
diff --git a/apps/ossim-create-cg/ossim-create-cg.cpp b/apps/ossim-create-cg/ossim-create-cg.cpp
new file mode 100644
index 0000000..b778a2b
--- /dev/null
+++ b/apps/ossim-create-cg/ossim-create-cg.cpp
@@ -0,0 +1,143 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains application definition "create_cg" app.
+//
+// It takes an image filename as input and creates a course grid model.
+//
+//*******************************************************************
+//  $Id$
+
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimCoarseGridModel.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+
+int main(int argc, char *argv[])
+{
+   //---
+   // Get the arg count so we can tell if an arg was consumed by
+   // ossimInit::instance()->initialize
+   //---
+   int originalArgCount = argc;
+   
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+   
+   if ( (argumentParser.argc() == 1) && (originalArgCount > 1) )
+   {
+      exit(0); // ossimInit consumed all options.
+   }
+
+   ossimString appname = argumentParser.getApplicationName();
+   ossimApplicationUsage* appuse = argumentParser.getApplicationUsage();
+   appuse->setApplicationName(appname);
+   appuse->setDescription(appname+" Creates OSSIM coarse grid geometry from rigorous sensor model.");
+   appuse->setCommandLineUsage(appname+" [options] <image_file>");
+   
+   appuse->addCommandLineOption("-d or --support", 
+      "<geom_path> -- Specifies a supplementary directory path to contain the geom and associated "
+      "grid files. The default is to use the image directory.");
+
+   appuse->addCommandLineOption("-e", 
+      "<error> -- default is 0.1.  This is the maximum difference tolerated in pixels between the "
+      "rigorous model and the computed coarse grid. The smaller this value, the bigger the "
+      "resulting grid.");
+
+   appuse->addCommandLineOption("-s",
+      "<min_line_sample_spacing> -- Specifies the min line sample spacing for the coarse grid. "
+      "Helps in converging. Basically will stop splitting if number of pixels per grid cell gets "
+      "below this number.");
+
+   appuse->addCommandLineOption("-o", 
+      "<base_out_name> -- Specifies a new base output name for the geom and associated grid files. "
+      "The default is to use the base name of the image file with .geom and .ocg extensions. "
+      "If specified then the output is <base_out_name>.geom and <base_out_name>.ocg where the "
+      ".ocg contains the coarse grid data. THIS IS NOT COMMON AND MAY PREVENT OSSIM FROM "
+      "SUBSEQUENTLY LOCATING THE GEOMETRY FILE.");
+
+   appuse->addCommandLineOption("-h or --help", "Shows help");
+
+   if(argumentParser.read("-h") || argumentParser.read("--help") || (argc < 2))
+   {
+      appuse->write(std::cout);
+      exit(0);
+   }
+   
+   // The last argument is always the image filename:
+   ossimFilename image_file = argv[argc-1];
+   
+   double error = 0.1;
+   if(argumentParser.read("-e", error))
+   {
+      if (error < 0.0)
+         error = 0.1;
+   }
+
+   ossim_int32 minSpacing = 100;
+   if(argumentParser.read("-s", minSpacing))
+   {
+      if (minSpacing < 1)
+         minSpacing = 100;
+   }
+   
+   ossimFilename outputBaseName;
+   argumentParser.read("-o", outputBaseName.string());
+
+   ossimFilename outputPath;
+   argumentParser.read("-d", outputPath.string());
+   if (outputPath.empty())
+   {
+      argumentParser.read("--support", outputPath);
+      if (outputPath.empty())
+         outputPath = image_file.path();
+   }
+
+   // Establish image handler for access to rigorous model:
+   ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(image_file);
+   if (ih.valid())
+   {
+      // Instantiate the rigorous model:
+      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+      if(geom.valid() && geom->getProjection())
+      {
+         // Compute the coarse grid:
+         ossimRefPtr<ossimCoarseGridModel> cg = new ossimCoarseGridModel;
+         cg->setInterpolationError(error);
+         cg->setMinGridSpacing(minSpacing);
+         ossimNotify(ossimNotifyLevel_NOTICE)<<"\nComputing coarse grid..."<<endl;
+         cg->buildGrid(ih->getBoundingRect(), geom.get());
+
+         // If no basename was provided, use the defaults for geom file. PREFERRED:
+         if (outputBaseName.empty())
+            outputBaseName = ih->createDefaultGeometryFilename().file();
+
+         // Save the coarse grid to appropriate location:
+         ossimFilename filename (outputPath.dirCat(outputBaseName));
+         filename.expand();
+         ossimNotify(ossimNotifyLevel_NOTICE)<<"\nSaving OCG grid and geometry to <"
+            <<filename.path()<<">..."<<endl;
+         cg->saveCoarseGrid(filename); // this saves geom file as well
+      }
+   }
+
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-create-histo/CMakeLists.txt b/apps/ossim-create-histo/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-create-histo/CMakeLists.txt
rename to apps/ossim-create-histo/CMakeLists.txt
diff --git a/apps/ossim-create-histo/ossim-create-histo.cpp b/apps/ossim-create-histo/ossim-create-histo.cpp
new file mode 100644
index 0000000..cbb73f0
--- /dev/null
+++ b/apps/ossim-create-histo/ossim-create-histo.cpp
@@ -0,0 +1,301 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+//*******************************************************************
+//  $Id: create_histo.cpp 11743 2007-09-19 19:57:31Z gpotts $
+
+
+#include <ossim/ossimConfig.h>
+
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+
+
+void usage()
+{
+   cout << "examples:\n"
+	<< " create_histo foo.tif\n"
+	<< "            Will create a histogram for the input image and call\n"
+	<< "            it foo.his\n\n"
+        << " create_histo -i foo.tif -o foo.his\n"
+        << "            this will compute a histogram from the input foo.tif\n"
+        << "            and write it to foo.his\n\n"
+        << " create_histo -p foo2.his -o foo.his\n"
+        << "            will import the proprietary histogram file and output\n"
+        << "            an ossim histogram file to foo.his\n\n"
+        << "NOTE:  If no output is given it will default to output.his\n"
+        << "       unless the special case of a single input image is given\n"
+        << endl;
+}
+
+void importHistogram(const ossimString& importFile,
+                     const ossimString&   outputFile)
+{
+   ossimRefPtr<ossimMultiResLevelHistogram> histo      = new ossimMultiResLevelHistogram;
+
+   histo->importHistogram(importFile);
+   ossimKeywordlist kwl;
+   histo->saveState(kwl);
+   kwl.write(outputFile.c_str());
+}
+
+void computeHistogram(const ossimString& imageOption,
+                      const ossimString& outputOption,
+                      ossim_float64 minValueOverride,
+                      ossim_float64 maxValueOverride,
+                      ossim_int32 numberOfBinsOverride,
+                      ossim_int32 entryNumberOverride,
+                      bool fastMode,
+                      int maxResLevels=1
+		      )
+{
+   theStdOutProgress.setFlushStreamFlag(true);
+   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(ossimFilename(imageOption));
+   if(handler.valid())
+   {
+      ossimFilename histogramFile;
+      std::vector<ossim_uint32> entryList;
+      handler->getEntryList(entryList);
+
+      if(entryNumberOverride >= 0)
+      {
+         std::vector<ossim_uint32>::iterator iter= std::find(entryList.begin(),
+                                                             entryList.end(),
+                                                             (ossim_uint32)entryNumberOverride);
+
+         if(iter != entryList.end())
+         {
+            entryList.clear();
+            entryList.push_back(entryNumberOverride);
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "Invalid entry number " << entryNumberOverride << " passed in.  Returning...." << std::endl;
+            return;
+         }
+      }
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < entryList.size(); ++idx)
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)<<"entry " << entryList[idx] << std::endl;
+         handler->setCurrentEntry(entryList[idx]);
+
+         // Check handler to see if it's filtering bands.
+         if ( handler->isBandSelector() )
+         { 
+            // Set output list to input.
+            handler->setOutputToInputBandList();
+         }
+         
+         ossimRefPtr<ossimProperty> histogramFilename = handler->getProperty("histogram_filename");
+         if(histogramFilename.valid())
+         {
+            if (outputOption == "")
+            {
+              histogramFile = ossimFilename(histogramFilename->valueToString());
+            }
+            else
+            {
+              histogramFile = outputOption;
+            }
+            
+            ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
+            ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
+            if(maxResLevels)
+            {
+               histoSource->setMaxNumberOfRLevels(maxResLevels);
+            }
+            else
+            {
+               histoSource->setMaxNumberOfRLevels(handler->getNumberOfDecimationLevels());
+            }
+            if(!ossim::isnan(minValueOverride))
+            {
+               histoSource->setMinValueOverride(minValueOverride);
+            }
+            if(!ossim::isnan(maxValueOverride))
+            {
+               histoSource->setMaxValueOverride(maxValueOverride);
+            }
+            if(numberOfBinsOverride > 0)
+            {
+               histoSource->setNumberOfBinsOverride(numberOfBinsOverride);
+            }
+            if (fastMode)
+            {
+               histoSource->setComputationMode(OSSIM_HISTO_MODE_FAST);
+            }
+            histoSource->connectMyInputTo(0, handler.get());
+            histoSource->enableSource();
+            writer->connectMyInputTo(0, histoSource.get());
+            
+            writer->setFilename(histogramFile);
+            writer->addListener(&theStdOutProgress);
+            writer->execute();
+            writer=0;
+         }
+      }
+   }
+}
+
+int main(int argc, char *argv[])
+{
+   ossimString tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+   
+   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" creates a histogram from image.");
+   
+   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" <args>");
+   
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help", "Display this information");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-p", "<histogram_file> Imports imagelinks proprietary histogram_file.");
+   
+   argumentParser.getApplicationUsage()->addCommandLineOption("-i", "<image_file> Creates a histogram from the image_file.");
+   
+   argumentParser.getApplicationUsage()->addCommandLineOption("-l", "<res_level> Output the specified number of res levels default is, set to 0 if you want all(not supported for import histogram -i option");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-t", "<tiles for fast histogram>");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--create-histogram-fast", "Computes a histogram in fast mode which samples partial tiles.");
+   
+   argumentParser.getApplicationUsage()->addCommandLineOption("-o", "<output_file> Output the histogram to the indicated file.");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("--min",  "Minimum value to use");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--max",  "Maximum value to use");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--bins", "Number of bins to use");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--entry", "entry number to use");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption("-f", "fast mode");
+   
+   ossimString importOption;
+   ossimString imageOption;
+   ossimString outputOption;
+   ossim_uint32 maxLevels = 1;
+   ossim_int32 entry = -1;
+   
+   ossim_float64 minValueOverride = ossim::nan();
+   ossim_float64 maxValueOverride = ossim::nan();
+   ossim_int32   numberOfBinsOverride = -1;
+
+   bool fastMode = false;
+   
+   if ( (argumentParser.read("-h")) || (argumentParser.read("--help")) )
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage();
+      exit(0);
+    }
+   
+   if (argumentParser.argc() == 2)
+   {
+      ossimFilename inputImage = argv[1];
+      imageOption = inputImage;
+      if(!inputImage.exists())
+      {
+         cerr << "Image does not exist " << inputImage << endl;
+         exit(1);
+      }
+      maxLevels = 1;
+   }
+   else
+   {
+      if(argumentParser.read("--min", stringParam))
+      {
+         minValueOverride = tempString.toDouble();
+      }
+      if(argumentParser.read("--max", stringParam))
+      {
+         maxValueOverride = tempString.toDouble();
+      }
+      if(argumentParser.read("--bins", stringParam))
+      {
+         numberOfBinsOverride = tempString.toInt32();
+      }
+      if(argumentParser.read("--bins", stringParam))
+      {
+         numberOfBinsOverride = tempString.toInt32();
+      }
+      if(argumentParser.read("--entry", stringParam))
+      {
+         entry = tempString.toInt32();
+      }
+
+      if(argumentParser.read("-o", stringParam))
+      {
+         outputOption = tempString;
+      }
+      
+      if ( argumentParser.read("-f") ||
+           argumentParser.read("--create-histogram-fast"))
+      {
+         fastMode = true;
+      }
+
+      if(argumentParser.read("-p", stringParam))
+      {
+         importOption = tempString;
+      }
+      if(argumentParser.read("-l", stringParam))
+      {
+         ossimString s = tempString;
+         maxLevels = s.toUInt32();
+      }
+   }
+
+   if((importOption != "") && (imageOption  != ""))
+   {
+      cout << "you can either import or create a histogram from an image but\n"
+           << "we can't do both" << endl;
+      exit(1);
+   }
+
+   if(importOption != "")
+   {
+      importHistogram(importOption, "");
+   }
+   else if(argc > 1)
+   {
+      ossim_uint32 idx = 1;
+      while(argv[idx])
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            <<"file " << argv[idx] << std::endl;
+
+         computeHistogram(ossimString(argv[idx]), outputOption, minValueOverride, maxValueOverride, numberOfBinsOverride, entry, fastMode, maxLevels);
+         ++idx;
+      }
+   }
+   else
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage();
+   }
+
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-deg2dms/CMakeLists.txt b/apps/ossim-deg2dms/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-deg2dms/CMakeLists.txt
rename to apps/ossim-deg2dms/CMakeLists.txt
diff --git a/apps/ossim-deg2dms/ossim-deg2dms.cpp b/apps/ossim-deg2dms/ossim-deg2dms.cpp
new file mode 100644
index 0000000..866f922
--- /dev/null
+++ b/apps/ossim-deg2dms/ossim-deg2dms.cpp
@@ -0,0 +1,112 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Application to convert decimal degrees, to degrees, minutes,
+// seconds (DMS).
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <cstdlib>
+#include <iostream>
+#include <iomanip>
+#include <cmath>
+#include <string>
+#include <sstream>
+
+using namespace std;
+
+void getDegrees(double& deg)
+{
+   std::string s;
+   cout << "Enter degrees:  " << flush;
+   cin >> s;
+   if ( (s == "q") || (s == "Q") )
+   {
+      exit(0);
+   }
+   else
+   {
+      istringstream is(s);
+      is >> deg;
+      if( is.fail() )
+      {
+         cerr << "Must enter a valid number between -180 and 180 for degrees."
+              << "  Exiting..." << endl;
+         exit(1);
+      }
+      else if ( (deg < -180.0) || (deg > 180.0) ) // Check the range.
+      {
+         cerr << "Degrees must be between -180 and 180.  Exiting..."
+              << endl;
+         exit(1);
+      }
+   }
+}
+   
+int main(int argc, char* argv[])
+{
+   enum
+   {
+      FOREVER=1
+   };
+
+   if (argc != 1)
+   {
+      cout << "Usage: " << argv[0]
+           << "\nThis application will convert decimal degrees to degrees, "
+           << "minutes, seconds.\nIt take no arguments, you will be prompted "
+           << "for the decimal degrees.\n" << endl;
+      return 0;
+   }
+   
+   cout << "\nEnter \"q\" to quit.\n\n";
+
+   double deg = 0.0;
+   double min = 0.0;
+   double sec = 0.0;
+   int degInt = 0;
+   int minInt = 0;
+
+   cout << setiosflags(ios::fixed) << setprecision(15);
+
+   while (FOREVER)
+   {
+      // Get the degrees.
+      getDegrees(deg);
+
+      // Compute the answer.
+      
+      bool isNegative = (deg < 0.0);
+
+      if (isNegative)
+      {
+         deg = fabs(deg);
+      }
+
+      degInt = static_cast<int>(deg);
+      
+      min = (deg - degInt) * 60.0;
+
+      minInt = static_cast<int>(min);
+      
+      sec = (min - minInt) * 60.0;
+
+      if (isNegative)
+      {
+         deg = -deg;
+      }
+      cout << deg << " = "
+           << (isNegative?"-":"") << degInt << " degrees, "
+           << minInt << " minutes, "
+           << sec << " seconds."
+           << endl;
+   }
+      
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-dms2deg/CMakeLists.txt b/apps/ossim-dms2deg/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-dms2deg/CMakeLists.txt
rename to apps/ossim-dms2deg/CMakeLists.txt
diff --git a/apps/ossim-dms2deg/ossim-dms2deg.cpp b/apps/ossim-dms2deg/ossim-dms2deg.cpp
new file mode 100644
index 0000000..f6f7b7f
--- /dev/null
+++ b/apps/ossim-dms2deg/ossim-dms2deg.cpp
@@ -0,0 +1,166 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Application to convert degrees, minutes seconds (DMS) 
+// to decimal degrees.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <cstdlib>
+#include <iostream>
+#include <iomanip>
+#include <cmath>
+#include <string>
+#include <sstream>
+
+using namespace std;
+
+void getDegrees(double& deg)
+{
+   std::string s;
+   cout << "Enter degrees:  " << flush;
+   cin >> s;
+   if ( (s == "q") || (s == "Q") )
+   {
+      exit(0);
+   }
+   else
+   {
+      istringstream is(s);
+      is >> deg;
+      if( is.fail() )
+      {
+         cerr << "Must enter a valid number between -180 and 180 for degrees."
+              << "  Exiting..." << endl;
+         exit(1);
+      }
+      else if ( (deg < -180.0) || (deg > 180.0) ) // Check the range.
+      {
+         cerr << "Degrees must be between -180 and 180.  Exiting..."
+              << endl;
+         exit(1);
+      }
+   }
+}
+   
+void getMinutes(double& min)
+{
+   std::string s;
+   cout << "Enter minutes:  " << flush;
+   cin >> s;
+   if ( (s == "q") || (s == "Q") )
+   {
+      exit(0);
+   }
+   else
+   {
+      istringstream is(s);
+      is >> min;
+      if(is.fail())
+      {
+         cerr << "Must enter a valid number between 0 and 60 for minutes."
+              << "  Exiting..." << endl;
+         exit(1);
+      }
+      else if ( (min < 0.0) || (min > 60.0) ) // Check the range.
+      {
+         cerr << "Minutes must be between 0 and 60.  Exiting\n";
+         exit(1);
+      }
+   }
+}
+
+void getSeconds(double& sec)
+{
+   std::string s;
+   cout << "Enter seconds:  " << flush;
+   cin >> s;
+   if ( (s == "q") || (s == "Q") )
+   {
+      exit(0);
+   }
+   else
+   {
+      istringstream is(s);
+      is >> sec;
+      if( is.fail() )
+      {
+         cerr << "Must enter a valid number between 0 and 60 for seconds."
+              << "  Exiting..." << endl;
+         exit(1);
+      }
+      else if ( (sec < 0.0) || (sec > 60.0) ) // Check the range. 
+      {
+         cerr << "Seconds must be between 0 and 60.  Exiting\n";
+         exit(1);
+      }
+   }
+}
+
+int main(int argc, char* argv[])
+{
+   enum
+   {
+      FOREVER=1
+   };
+
+   if (argc != 1)
+   {
+      cout << "Usage: " << argv[0]
+           << "\nThis application will convert degrees, minutes, seconds to "
+           << "decimal degrees.\nIt take no arguments, you will be prompted "
+           << "for the degrees, minutes, seconds.\n" << endl;
+      return 0;
+   }
+
+   
+   cout << "\nEnter \"q\" to quit.\n\n";
+
+   double deg = 0.0;
+   double min = 0.0;
+   double sec = 0.0;
+
+   cout << setiosflags(ios::fixed) << setprecision(15);
+
+   while (FOREVER)
+   {
+      // Get the degrees.
+      getDegrees(deg);
+
+      // Get the minutes.
+      getMinutes(min);
+
+      // Get the the seconds.
+      getSeconds(sec);
+
+      // Compute the answer.
+      if (deg < 0.0)
+      {
+         double d = fabs(deg);
+         deg = -(d + min/60.0 + sec/3600.0);
+      }
+      else
+      {
+         deg = deg + min/60.0 + sec/3600.0;
+      }
+
+      if ( deg < -180.0 )
+      {
+         deg += 360.0;
+      }
+      else if ( deg > 180.0 )
+      {
+         deg -= 360.0;
+      }
+      cout << "Decimal degrees = " << deg << "\n" << endl;
+      
+   }
+      
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-dump-ocg/CMakeLists.txt b/apps/ossim-dump-ocg/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-dump-ocg/CMakeLists.txt
rename to apps/ossim-dump-ocg/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-dump-ocg/ossim-dump-ocg.cpp b/apps/ossim-dump-ocg/ossim-dump-ocg.cpp
similarity index 100%
rename from ossim/src/apps/ossim-dump-ocg/ossim-dump-ocg.cpp
rename to apps/ossim-dump-ocg/ossim-dump-ocg.cpp
diff --git a/ossim/src/apps/ossim-equation/CMakeLists.txt b/apps/ossim-equation/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-equation/CMakeLists.txt
rename to apps/ossim-equation/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-equation/ossim-equation.cpp b/apps/ossim-equation/ossim-equation.cpp
similarity index 100%
rename from ossim/src/apps/ossim-equation/ossim-equation.cpp
rename to apps/ossim-equation/ossim-equation.cpp
diff --git a/ossim/src/apps/ossim-extract-vertices/CMakeLists.txt b/apps/ossim-extract-vertices/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-extract-vertices/CMakeLists.txt
rename to apps/ossim-extract-vertices/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-extract-vertices/ossim-extract-vertices.cpp b/apps/ossim-extract-vertices/ossim-extract-vertices.cpp
similarity index 100%
rename from ossim/src/apps/ossim-extract-vertices/ossim-extract-vertices.cpp
rename to apps/ossim-extract-vertices/ossim-extract-vertices.cpp
diff --git a/ossim/src/apps/ossim-icp/CMakeLists.txt b/apps/ossim-icp/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-icp/CMakeLists.txt
rename to apps/ossim-icp/CMakeLists.txt
diff --git a/apps/ossim-icp/ossim-icp.cpp b/apps/ossim-icp/ossim-icp.cpp
new file mode 100644
index 0000000..fd47a9d
--- /dev/null
+++ b/apps/ossim-icp/ossim-icp.cpp
@@ -0,0 +1,747 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:  Command line application for copying images "image copy".
+// Can be used to cut images, convert formats.  Works in image space
+// (no resampler).
+//
+//*******************************************************************
+//  $Id: ossim-icp.cpp 3023 2011-11-02 15:02:27Z david.burken $
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimImageTypeLut.h>
+#include <ossim/imaging/ossimJpegWriter.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimRLevelFilter.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactory.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimCacheTileSource.h>
+#include <ossim/imaging/ossimBandSelector.h>
+//#include <ossim/imaging/ossimCibCadrgTileSource.h>
+#include <ossim/imaging/ossimRgbToGreyFilter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/imaging/ossimMaskFilter.h>
+
+#include <iostream>
+#include <algorithm>
+#include <iterator>
+#include <exception>
+
+static ossimTrace traceDebug("icp:main");
+
+static void usage()
+{
+   ossimNotify(ossimNotifyLevel_NOTICE)
+      << "\nValid output writer types:\n\n";
+   ossimImageWriterFactoryRegistry::instance()->
+      printImageTypeList( ossimNotify(ossimNotifyLevel_NOTICE) );
+}
+
+ossimString massageQuotedValue(const ossimString& value)
+{
+   char quote = '\0';
+   if(*value.begin() == '"')
+   {
+      quote = '"';
+   }
+   else if(*value.begin() == '\'')
+   {
+      quote = '\'';
+   }
+   
+   if(quote == '\0')
+   {
+      return value;
+   }
+   std::vector<ossimString> splitString;
+   value.split(splitString, quote);
+   if(splitString.size() == 3)
+   {
+      return splitString[1];
+   }
+   return value;
+}
+
+//*************************************************************************************************
+// FINALIZE -- Convenient location for placing debug breakpoint for catching program exit.
+//*************************************************************************************************
+void finalize(int code)
+{
+   exit (code);
+}
+
+int main(int argc, char* argv[])
+{
+   static const char MODULE[] = "icp:main";
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   
+   au->setApplicationName(ap.getApplicationName());
+   au->setDescription(ap.getApplicationName()+
+      " copies any supported input image format to any supported output image format format");
+   au->setCommandLineUsage(ap.getApplicationName()+
+      " [options] <output_type> <input_file> <output_file>");
+   au->addCommandLineOption("-h or --help",
+      "Display this information");
+   au->addCommandLineOption("-a or --use-scalar-remapper", 
+      "Uses scalar remapper, transforms to 8-bit");
+   au->addCommandLineOption("-o or --create-overview", 
+      "Creates and overview for the output image");
+   au->addCommandLineOption("-b or --bands <n,n...>", 
+      "uses the specified bands: ex. \"1, 2, 4\" will select bands 1 2 and 4 of the input image.  "
+      "Note: it is 1 based");
+   au->addCommandLineOption("-c or --compression-type <type>", 
+      "Uses compression.  Currently valid for only tiff output -c jpeg will use jpeg compression");
+   au->addCommandLineOption("-e or --entry <n>", 
+      "For multi image handlers which entry do you wish to extract");
+   au->addCommandLineOption("-g", "Convert to grey scale.");
+   au->addCommandLineOption("-q or --compression-quality <n>", 
+      "Uses compression.  Valid for jpeg type. default is 75 where 100 is best and 1 is worst");
+   au->addCommandLineOption("--pixel-type <type>", 
+      "Valid values: area or point, this will determine if the tie point is upper left corner of "
+      "the upper left pixel (area) or the center of the upper left corner (point), default=point. "
+      "NOTE: This option will only affect the tiff writer.");
+   au->addCommandLineOption("-r or --res-level <n>", 
+      "Which res level to extract from the input: ex -r 1 will get res level 1");
+   au->addCommandLineOption("-l or --start-line <n>", 
+      "Which start line do you wish to copy from the input. If none is given then 0 is used");
+   au->addCommandLineOption("-L or --end-line <n>", 
+      "Which end line do you wish to copy from the input.  If none is given then max line is used");
+   au->addCommandLineOption("-s or --start-sample <n>", 
+      "Which start sample do you wish to copy from the input.  If none is given then 0 is used");
+   au->addCommandLineOption("-p or --end-sample <n>", 
+      "The end sample you wish to copy from the input. If none is given then max sample is used");
+   au->addCommandLineOption("-t or --create-thumbnail <n>", 
+      "Takes an argument which is the maximum pixel dimension desired.");
+   au->addCommandLineOption("-w or --tile-width <n>", 
+      "Defines the tile width for the handlers that support tiled output");
+
+   au->addCommandLineOption("--reader-prop <string>", 
+      "Adds a property to send to the reader. format is name=value");
+
+   au->addCommandLineOption("--writer-prop <string>", 
+      "Adds a property to send to the writer. format is name=value");
+
+   au->addCommandLineOption("--filter-spec <fname>", 
+      "This is an external file spec that describes a chain for filtering the input image.");
+   au->addCommandLineOption("--use-mask [<fname>]", 
+      "Optionally specify name of mask file to use for masking the input image. If no filename "
+      "given, then the default mask filename is used.");
+   
+   
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
+   
+   // Keyword list to initialize image writers with.
+   ossimKeywordlist kwl;
+   const char* PREFIX = "imagewriter.";
+
+   bool        lineEndIsSpecified       = false;
+   bool        sampEndIsSpecified       = false;
+   bool        lineStartIsSpecified     = false;
+   bool        sampStartIsSpecified     = false;
+   bool        convert_to_greyscale     = false;
+   bool        create_overview          = false;
+   bool        create_thumbnail         = false;
+   bool        use_band_selector        = false;
+   bool        use_scalar_remapper      = false;
+   bool        use_mask                 = false;
+   ossim_int32 tile_width               = 0;
+   ossim_int32 max_thumbnail_dimension  = 0;
+   ossim_int32 rr_level                 = 0;
+   ossim_int32 line_start               = 0;
+   ossim_int32 line_stop                = 0;
+   ossim_int32 sample_start             = 0;
+   ossim_int32 sample_stop              = 0;
+   ossim_int32 cibcadrg_entry           = 0;
+   vector<ossimString> band_list(0);
+   ossimFilename filterSpec, maskFile;
+   std::map<ossimString, ossimString, ossimStringLtstr> readerPropertyMap;
+   std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;
+
+   if (ap.read("-h") ||
+       ap.read("--help")||(ap.argc() < 2))
+   {
+      au->write(ossimNotify(ossimNotifyLevel_NOTICE));
+      usage(); // for writer output types
+      finalize(0);
+   }
+
+   while(ap.read("--reader-prop", stringParam))
+   {
+      std::vector<ossimString> nameValue;
+      ossimString(tempString).split(nameValue, "=");
+      if(nameValue.size() == 2)
+      {
+         readerPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
+      }
+   }   
+   while(ap.read("--writer-prop", stringParam))
+   {
+      std::vector<ossimString> nameValue;
+      ossimString(tempString).split(nameValue, "=");
+      if(nameValue.size() == 2)
+      {
+         writerPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
+      }
+   }
+   while(ap.read("-a") ||
+         ap.read("--use-scalar-remapper"))
+   {
+      use_scalar_remapper = true;        
+   }
+   while(ap.read("--filter-spec",stringParam))
+   {
+      filterSpec = ossimFilename(tempString);        
+   }
+   
+   while(ap.read("--use-mask") ||
+         ap.read("--use-mask",stringParam) )
+   {
+      maskFile = ossimFilename(tempString);     
+      use_mask = true;
+   }
+   
+   while(ap.read("-o") ||
+         ap.read("--create-overview"))
+   {
+      create_overview = true;
+   }
+   
+   while(ap.read("-b", stringParam) ||
+         ap.read("--bands", stringParam))
+   {
+      use_band_selector = true;
+      ossimString s = tempString;
+      band_list = s.split(",");
+   }
+   
+   while(ap.read("-c", stringParam) ||
+         ap.read("--compression-type", stringParam))
+   {
+      ossimString s = tempString;
+      s.downcase();
+      kwl.add(PREFIX, ossimKeywordNames::COMPRESSION_TYPE_KW, s.c_str(), true);
+   }
+   
+   while(ap.read("-e", stringParam) ||
+         ap.read("--entry", stringParam))
+   {
+      cibcadrg_entry = ossimString(tempString).toInt();
+   }
+
+   if ( ap.read("-g") )
+   {
+      convert_to_greyscale = true;
+   }   
+   
+   while(ap.read("-q", stringParam) ||
+         ap.read("--compression-quality", stringParam))
+   {
+      // Set the jpeg compression quality level.
+      kwl.add(PREFIX,
+              ossimKeywordNames::COMPRESSION_QUALITY_KW,
+              tempString.c_str(),
+              true);
+   }
+   while(ap.read("-r", stringParam) ||
+         ap.read("--res-level", stringParam))
+   {
+      rr_level = ossimString(tempString).toInt();
+   }
+   
+   while(ap.read("-l", stringParam) ||
+         ap.read("--start-line", stringParam))
+   {
+      lineStartIsSpecified = true;
+      line_start = ossimString(tempString).toInt();
+   }
+   
+   while(ap.read("-L", stringParam) ||
+         ap.read("--end-line", stringParam))
+   {
+      lineEndIsSpecified = true;
+      line_stop = ossimString(tempString).toInt();
+   }
+   while(ap.read("-s", stringParam) ||
+         ap.read("--start-sample", stringParam))
+   {
+      sampStartIsSpecified = true;
+      sample_start = ossimString(tempString).toInt();
+   }
+   
+   while(ap.read("-p", stringParam) ||
+         ap.read("--end-sample", stringParam))
+   {
+      sampEndIsSpecified = true;
+      sample_stop = ossimString(tempString).toInt();
+   }
+   
+   while(ap.read("-t", stringParam) ||
+         ap.read("--create-thumbnail", stringParam))
+   {
+      create_thumbnail = true;
+      max_thumbnail_dimension=ossimString(tempString).toInt();
+   }
+   
+   while(ap.read("-w", stringParam) ||
+         ap.read("-tile-width", stringParam))
+   {
+      tile_width = ossimString(tempString).toInt();
+      if ((tile_width % 16) != 0)
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << MODULE << " NOTICE:"
+            << "\nTile width must be a multiple of 16!"
+            << "\nDefaulting to 128"
+            << std::endl;
+         tile_width = 0;
+      }
+   }
+   if (ap.read("--pixel-type", stringParam))
+   {
+      ossimString os = tempString;
+      os.downcase();
+      if (os.contains("area"))
+      {
+         kwl.add(PREFIX, ossimKeywordNames::PIXEL_TYPE_KW, "area", true);
+      }
+      else
+      {
+         kwl.add(PREFIX, ossimKeywordNames::PIXEL_TYPE_KW, "point", true);
+ 
+      }
+   }
+   
+   ap.reportRemainingOptionsAsUnrecognized();
+   
+   // Three required args:  output_type, input file, and output file.
+   if (ap.errors())
+   {
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      finalize(0);
+   }
+   if (ap.argc() < 4)
+   {
+      au->write(ossimNotify(ossimNotifyLevel_NOTICE));
+      usage(); // for writer output types
+      finalize(0);
+   }
+   
+   // Set the writer type and the image type.
+   ossimString output_type = ap.argv()[ap.argc()-3];
+   
+   kwl.add(PREFIX, ossimKeywordNames::TYPE_KW, output_type.c_str(), true);
+
+   // Get the input file.
+   const char* input_file = argv[ap.argc()-2];
+   
+   // Get the output file.
+   ossimFilename output_file = argv[ap.argc()-1];
+   
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\noutput type:  "
+           << ap.argv()[ap.argc()-3]
+           << "\ninput file:   "
+           << ap.argv()[ap.argc()-2]
+           << "\noutput file:  "
+           << ap.argv()[ap.argc()-1]
+           << std::endl;
+      
+      if (tile_width)
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE) << "tile_width:  " << tile_width << std::endl;
+      }
+   }
+   
+   // Get an image handler for the input file.
+   ossimRefPtr<ossimImageHandler> ih =
+      ossimImageHandlerRegistry::instance()->open(ossimFilename(input_file));
+   
+   //ossimCibCadrgTileSource* its = PTR_CAST(ossimCibCadrgTileSource, ih.get());
+   
+   //if (its)
+   //{
+      if (cibcadrg_entry > 0)
+      {
+         ih->setCurrentEntry(cibcadrg_entry);
+      }
+   //}
+   
+   if (!ih)
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << "Unsupported image file:  " << input_file
+           << "\nExiting application..." << std::endl;
+      finalize(0);
+   }
+   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "Error reading image:  " << input_file
+         << "Exiting application..." << std::endl; 
+      finalize(1);
+   }
+
+   // Set the reader properties if any.
+   if ( readerPropertyMap.size() )
+   {
+      ossimPropertyInterface* pi = (ossimPropertyInterface*)ih.get();
+      std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = readerPropertyMap.begin();
+      while(iter != readerPropertyMap.end())
+      {
+         pi->setProperty(iter->first, iter->second);
+         ++iter;
+      }
+   }
+   
+   ih->initialize();
+   ossimRefPtr<ossimImageSource> source = ih.get();
+   
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nImage Handler:  " << ih->getLongName()
+           << std::endl;
+   }
+
+   // Start band selector section:
+
+   //---
+   // If image handler is band selector, start with all bands.
+   // Some sources, e.g. ossimEnviTileSource can pick up default
+   // bands and filter out all other bands.
+   //---
+   ih->setOutputToInputBandList();
+
+   if ( use_band_selector && (source->getNumberOfOutputBands() > 1) )
+   {
+      // Build the band list.
+      ossim_uint32 bands = source->getNumberOfOutputBands();
+      vector<ossim_uint32> bl;
+      ossim_uint32 i;
+      for (i=0; i<band_list.size(); ++i)
+      {
+         bl.push_back(band_list[i].toULong()-1);
+      }
+      
+      // Check the list.  Make sure all the bands are within range.
+      for (i=0; i<bl.size(); ++i)
+      {
+         if (bl[i] >= bands)
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << MODULE << " ERROR:"
+               << "\nBand list range error!"
+               << "\nHighest available band:  " << bands
+               << std::endl;
+            finalize(1);
+         }
+      }
+      
+      ossimRefPtr<ossimBandSelector> bs = new ossimBandSelector();
+      bs->connectMyInputTo(source.get());
+      bs->setOutputBandList(bl);
+      bs->enableSource();
+      bs->initialize();
+      source = bs.get();
+      
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nZero based output band list:" << std::endl;
+         for (i=0; i<bl.size(); ++i)
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "   band[" << i << "]:  " << bl[i] << std::endl;
+         }
+         ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
+      }
+      
+   } // Matches: if ( use_band_selector...
+
+   // End of band selection section.
+
+   if ( convert_to_greyscale )
+   {
+      ossimRefPtr<ossimRgbToGreyFilter> rgb2grey = new ossimRgbToGreyFilter();
+      rgb2grey->connectMyInputTo( source.get() );
+      source = rgb2grey.get();
+   }
+   
+   ossimRefPtr<ossimMaskFilter> mask_filter = 0;
+   if (use_mask)
+   {
+      if (maskFile.empty())
+      {
+         maskFile = ih->getFilenameWithThisExtension("mask");
+      }
+      
+      ossimImageHandler* mh = ossimImageHandlerRegistry::instance()->open(maskFile);
+      if (mh == NULL)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)<<"ossim-icp -- Could not open raster mask file <"
+            <<maskFile<<">. Maske request will be ignored. Aborting..."<<endl;
+         finalize(1);
+      }
+      mask_filter = new ossimMaskFilter();
+      mask_filter->connectMyInputTo(source.get());
+      mask_filter->setMaskSource(mh);  // assumes ownership of mask handler object
+      source = mask_filter.get();
+   }
+
+   if(!filterSpec.empty()&&filterSpec.exists())
+   {
+      ossimKeywordlist kwl;
+      if(kwl.addFile(filterSpec))
+      {
+         ossimRefPtr<ossimObject> input = ossimObjectFactoryRegistry::instance()->createObject(kwl);
+         if(input.valid())
+         {
+            ossimImageSource* inputImageSource = dynamic_cast<ossimImageSource*> (input.get());
+            if(inputImageSource)
+            {
+               inputImageSource->connectMyInputTo(source.get());
+               source = inputImageSource;
+            }
+         }
+      }
+   }
+   
+   if (create_thumbnail == true)
+   {
+      // Get the rlevel that <= max thumbnail dimension.
+      int max   = 0;
+      int level = 0;
+      
+      while (level < ((ossim_int32)ih->getNumberOfDecimationLevels()-1))
+      {
+         int lines   = ih->getNumberOfLines(level);
+         int samples = ih->getNumberOfSamples(level);
+         max = lines > samples ? lines : samples;
+         if (max <= max_thumbnail_dimension)
+         {
+            break;
+         }
+         ++level;
+      }
+      
+      if (max > max_thumbnail_dimension)
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE) << " NOTICE:"
+              << "\nLowest rlevel not small enough to fulfill "
+              << "max_thumbnail_dimension requirement!" << std::endl;
+      }
+      
+      // Set the reduced res level.  This will override the -r option.
+      rr_level = level;
+
+   } // end of "if  (create_thumbnail == true)
+
+   // Start rlevel filter section.
+   if( rr_level != 0 )
+   {
+      //---
+      // Check for a valid reduced resolution level.
+      // If the operator entered an invalid rr_level with the -r option,
+      // spit out a warning and set to default "0".
+      //---
+      if (rr_level >= (ossim_int32)(ih->getNumberOfDecimationLevels()))
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << " WARNING:"
+            << "\n\t Selected res level greater than available res levels."
+            << "\n\t Defaulting to res level zero. " << std::endl;
+         rr_level = 0;
+      }
+         
+      ossimRefPtr<ossimRLevelFilter> rlevelFilter = new ossimRLevelFilter;
+      
+      rlevelFilter->connectMyInputTo(source.get());
+      
+      source = rlevelFilter.get();
+      
+      rlevelFilter->setCurrentRLevel(rr_level);
+      if ( rr_level )
+      {
+         rlevelFilter->setOverrideGeometryFlag(true);
+      }
+      
+   } // Matches: if( rr_level != 0 )
+      
+   ossimIrect output_rect = source->getBoundingRect(rr_level);
+      
+   //---
+   // If any of these are true the user wants to cut the rectangle.
+   //---
+   if ( lineStartIsSpecified || lineEndIsSpecified ||
+        sampStartIsSpecified || sampEndIsSpecified)
+   {
+      if (!lineStartIsSpecified) line_start   = output_rect.ul().y;
+      if (!lineEndIsSpecified)   line_stop    = output_rect.lr().y;
+      if (!sampStartIsSpecified) sample_start = output_rect.ul().x;
+      if (!sampEndIsSpecified)   sample_stop  = output_rect.lr().x;
+      
+      //---
+      // Check the start and stop points and make sure they are in
+      // the right order; if not, swap them.
+      //---
+      if (line_stop < line_start)
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << " WARNING:\n"
+            << "\t Line end is less than line start, swapping."
+            << std::endl;
+         int tmp    = line_start;
+         line_start = line_stop;
+         line_stop  = tmp;
+      }
+      if (sample_stop < sample_start)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << " WARNING:\n"
+            << "\t Sample end is less than sample start, swapping."
+            << std::endl;
+         int tmp      = sample_start;
+         sample_start = sample_stop;
+         sample_stop  = tmp;
+      }
+
+      output_rect.set_ulx(sample_start);
+      output_rect.set_lrx(sample_stop);
+      output_rect.set_uly(line_start);
+      output_rect.set_lry(line_stop);
+         
+   } // End of "if ((lineEndIsSpecified) ||..."
+
+   if (traceDebug())
+   {
+      CLOG << "icp:main debug"
+           << "\nrr_level:  " << rr_level
+           << "\noutput_rect:   " << output_rect
+           << "\nkeyword list:  " << kwl << std::endl;
+   }
+   
+   ossimRefPtr<ossimImageFileWriter> writer =
+      ossimImageWriterFactoryRegistry::instance()->createWriter(kwl, PREFIX);
+
+   if( writer == 0 )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "\nCould not create writer of type:  "
+         << output_type
+         << std::endl;
+      usage();
+      finalize(1);
+   }
+
+   writer->connectMyInputTo(0, source.get());
+
+   if (tile_width)
+   {
+      // Set the tile size...
+      writer->setTileSize(ossimIpt(tile_width, tile_width));
+   }
+   
+   writer->open(output_file);
+   
+   // Add a listener to get percent complete.
+   ossimStdOutProgress prog(0, true);
+   writer->addListener(&prog);
+
+   if (writer->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+   {
+      if( (ih->getOutputScalarType() != OSSIM_UCHAR) &&
+          ((PTR_CAST(ossimJpegWriter, writer.get())) ||
+           use_scalar_remapper))
+      {
+         writer->setScaleToEightBitFlag(true);
+      }
+
+      ossimRefPtr<ossimCacheTileSource> cache = new ossimCacheTileSource;
+      ossimIpt tileWidthHeight(ih->getImageTileWidth(),
+                               ih->getImageTileHeight());
+      // only use the cache if its stripped
+      if(static_cast<ossim_uint32>(tileWidthHeight.x) ==
+         ih->getBoundingRect().width())
+      {
+         cache->connectMyInputTo(0, source.get());
+         cache->setTileSize(tileWidthHeight);
+         writer->connectMyInputTo(0, cache.get());
+      }
+      else
+      {
+         writer->connectMyInputTo(0, source.get());
+      }
+      writer->initialize();
+      writer->setAreaOfInterest(output_rect); // Set the output rectangle.
+
+      try
+      {
+         if ( writerPropertyMap.size() )
+         {
+            ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
+            std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = writerPropertyMap.begin();
+            while(iter!=writerPropertyMap.end())
+            {
+               propInterface->setProperty(iter->first, iter->second);
+               ++iter;
+            }
+         }
+         writer->execute();
+      }
+      catch(std::exception& e)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "icp:main ERROR:\n"
+            << "Caught exception!\n"
+            << e.what()
+            << std::endl;
+      }
+      catch(...)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "icp:main ERROR:\n"
+            << "Unknown exception caught!\n"
+            << std::endl;
+      }
+
+      cache = 0;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "Error detected in the image writer..."
+         << "\nExiting application..." << std::endl;
+
+      finalize(1);
+   }
+   
+   if (create_overview == true)
+   {
+      writer->writeOverviewFile();
+   }
+   
+   finalize(0);
+}
diff --git a/ossim/src/apps/ossim-igen/CMakeLists.txt b/apps/ossim-igen/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-igen/CMakeLists.txt
rename to apps/ossim-igen/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-igen/ossim-igen.cpp b/apps/ossim-igen/ossim-igen.cpp
similarity index 100%
rename from ossim/src/apps/ossim-igen/ossim-igen.cpp
rename to apps/ossim-igen/ossim-igen.cpp
diff --git a/ossim/src/apps/ossim-image-compare/CMakeLists.txt b/apps/ossim-image-compare/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-image-compare/CMakeLists.txt
rename to apps/ossim-image-compare/CMakeLists.txt
diff --git a/apps/ossim-image-compare/ossim-image-compare.cpp b/apps/ossim-image-compare/ossim-image-compare.cpp
new file mode 100644
index 0000000..54a19c3
--- /dev/null
+++ b/apps/ossim-image-compare/ossim-image-compare.cpp
@@ -0,0 +1,158 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// File: ossim-foo.cpp
+//
+// Author:  Oscar Kramer
+//
+// Description: Compares pixel data between two images. Returns with 0 if same or 1 of different.
+//              The input formats can be different -- the pixels are compared after any 
+//              unpacking and decompression. Only R0 is compared.
+//
+// $Id: ossim-image-compare.cpp 19753 2011-06-13 15:20:31Z dburken $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/init/ossimInit.h>
+#include <iostream>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+
+using namespace std;
+
+template <typename T> bool tilesAreDifferent(const ossimImageData* t1, const ossimImageData* t2)
+{
+   ossimIpt size1 = t1->getImageRectangle().size();
+   ossimIpt size2 = t2->getImageRectangle().size();
+   int nbands1 = t1->getNumberOfBands();
+   int nbands2 = t2->getNumberOfBands();
+   if ((size1 != size2) || (nbands1 != nbands2))
+      return true;
+
+   ossim_uint32 num_pixels = (ossim_uint32) (size1.x * size1.y);
+   
+   for (int band=0; band<nbands1; band++)
+   {
+      T* buf1 = (T*) t1->getBuf(band);
+      T* buf2 = (T*) t2->getBuf(band);
+      
+      for ( ossim_uint32 p=0; p<num_pixels; ++p)
+      {
+         if (buf1[p] != buf2[p])
+            return true;
+      }
+   }
+   return false;
+}
+
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   try
+   {
+      if (ap.argc() != 3)
+      {
+         cout << "\nUsage: "<<ap.getApplicationName()<<" <image1> <image2>"<<endl;
+         return 1;
+      }
+      
+      ossimFilename f1 (argv[1]);
+      ossimFilename f2 (argv[2]);
+      cout << "\nComparing <"<<f1<<"> to <"<<f2<<">..."<<endl;
+      // Establish input image handlers:
+      ossimImageHandlerRegistry* registry = ossimImageHandlerRegistry::instance();
+      ossimRefPtr<ossimImageHandler> h1 = registry->open(ossimFilename(argv[1]));
+      if (!h1.valid())
+      {
+         cout<<"  Could not open first image at <"<<argv[1]<<">. Aborting..."<<endl;
+         return 1;
+      }
+      ossimRefPtr<ossimImageHandler> h2 = registry->open(ossimFilename(argv[2]));
+      if (!h1.valid())
+      {
+         cout<<"  Could not open second image at <"<<argv[2]<<">. Aborting..."<<endl;
+         h1->close();
+         return 1;
+      }
+
+      // Establish the tile sequencer to loop over all tiles:
+      ossimRefPtr<ossimImageSourceSequencer> sequencer1 = new ossimImageSourceSequencer(h1.get());
+      ossimRefPtr<ossimImageSourceSequencer> sequencer2 = new ossimImageSourceSequencer(h2.get());
+      sequencer1->setToStartOfSequence();
+      sequencer2->setToStartOfSequence();
+      
+      // Begin loop over all tiles, checking them for any non-empty status:
+      int tile_count = 0;
+      bool diff_found = false;
+
+      ossimRefPtr<ossimImageData> tile1 = sequencer1->getNextTile();
+      ossimRefPtr<ossimImageData> tile2 = sequencer2->getNextTile();
+      ossimScalarType stype = tile1->getScalarType();
+      while (tile1.valid() && tile2.valid() && !diff_found)
+      {
+         switch (stype)
+         {
+         case OSSIM_UINT8:
+         case OSSIM_SINT8:
+            diff_found = tilesAreDifferent<ossim_uint8>(tile1.get(), tile2.get());
+            break;
+
+         case OSSIM_UINT16:
+         case OSSIM_SINT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+            diff_found = tilesAreDifferent<ossim_uint16>(tile1.get(), tile2.get());
+            break;
+
+         case OSSIM_UINT32:
+         case OSSIM_SINT32:
+            diff_found = tilesAreDifferent<ossim_uint32>(tile1.get(), tile2.get());
+            break;
+
+         case OSSIM_FLOAT32:
+            diff_found = tilesAreDifferent<ossim_float32>(tile1.get(), tile2.get());
+            break;
+
+         case OSSIM_FLOAT64:
+            diff_found = tilesAreDifferent<ossim_float64>(tile1.get(), tile2.get());
+            break;
+
+         default:
+            cout<<"  This datatype is not supported. Aborting..."<<endl;
+            diff_found = true;
+         }
+
+         tile1 = sequencer1->getNextTile();
+         tile2 = sequencer2->getNextTile();
+         ++tile_count;
+      }
+
+      h1->close();
+      h2->close();
+      
+      if (diff_found)
+      {
+         cout << "  DIFFERENCE FOUND AT TILE "<<tile_count<<"."<<endl;
+         return 1;
+      }
+      cout << "  No differences found."<<endl;
+      return 0;
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      return 1;
+   }
+   
+}
diff --git a/ossim/src/apps/ossim-image-synth/CMakeLists.txt b/apps/ossim-image-synth/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-image-synth/CMakeLists.txt
rename to apps/ossim-image-synth/CMakeLists.txt
diff --git a/apps/ossim-image-synth/ossim-image-synth.cpp b/apps/ossim-image-synth/ossim-image-synth.cpp
new file mode 100644
index 0000000..08fb13d
--- /dev/null
+++ b/apps/ossim-image-synth/ossim-image-synth.cpp
@@ -0,0 +1,125 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Description: Utility to generate custom synthesized image for testing code..
+//
+// $Id: ossim-image-synth.cpp 23163 2015-02-23 16:04:05Z okramer $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <cmath>
+#include <sstream>
+#include <iostream>
+
+using namespace std;
+
+#define USE_UINT8 false
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+   
+   if ( (ap.argc() < 4) || ap.read("-h") || ap.read("--help") )
+   {
+      cout << "\nUsage: "<<ap[0]<<" <dx> <dy> <filename>\n"<<endl;
+      return 0;
+   }
+
+   int dx = atoi(ap[1]);
+   int dy = atoi(ap[2]);
+   ossimFilename filename = ap[3];
+   filename.setExtension(".tif");
+
+   // Establish the image geometry's map projection:
+   ossimIpt image_size (256, 256);
+   ossimGpt observerGpt (0, 0, 0);
+   ossimDpt gsd (1.0, 1.0); // must be same value in both directions
+   ossimRefPtr<ossimEquDistCylProjection> mapProj = new ossimEquDistCylProjection();
+   mapProj->setOrigin(observerGpt);
+   mapProj->setMetersPerPixel(gsd);
+   ossimDpt degPerPixel (mapProj->getDecimalDegreesPerPixel());
+   mapProj->setElevationLookupFlag(false);
+   ossimGpt ulTiePt (observerGpt);
+   ulTiePt.lat += degPerPixel.lat * (image_size.y-1)/2.0;
+   ulTiePt.lon -= degPerPixel.lon * (image_size.x-1)/2.0;
+   mapProj->setUlTiePoints(ulTiePt);
+   ossimRefPtr<ossimImageGeometry> geometry = new ossimImageGeometry(0, mapProj.get());
+   geometry->setImageSize(image_size);
+
+   // Set the destination image size:
+#if USE_UINT8
+   ossimRefPtr<ossimImageData> outImage =
+         ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, image_size.x, image_size.y);
+   typedef unsigned char PIXEL_TYPE;
+   double min = 0.0;
+   double max = 255;
+#else
+   ossimRefPtr<ossimImageData> outImage =
+         ossimImageDataFactory::instance()->create(0, OSSIM_NORMALIZED_DOUBLE, 1, image_size.x, image_size.y);
+   typedef double PIXEL_TYPE;
+   double min = 0.0;
+   double max = 1.0;
+#endif
+
+   if(outImage.valid())
+      outImage->initialize();
+   else
+      return -1;
+   double A = (max - min)/2.0;
+   outImage->fill(min);
+   PIXEL_TYPE* buffer = ( PIXEL_TYPE*) outImage->getBuf(0);
+
+   if ((dx != 0) || (dy != 0))
+   {
+      // Allocate image buffer:
+      ossim_uint32 i = 0;
+      double phase = 0;
+
+      double dpx = 0;
+      if (dx != 0)
+         dpx = 2*M_PI/dx; // phase rate (radians per pixel)
+      double dpy = 0;
+      if (dy != 0)
+         dpy = 2*M_PI/dy; // phase rate (radians per pixel)
+
+      for (int y=0; y<image_size.y; y++)
+      {
+         phase = y*dpy;
+         for (int x=0; x<image_size.x; x++)
+         {
+            // Loops to fill one n x n chip with a single freq (1/lambda) component:
+            buffer[i++] = (PIXEL_TYPE) (A * (cos(phase) + 1.0));
+            phase += dpx;
+         }
+      }
+   }
+
+   // Create output image chain:
+   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
+   memSource->setImage(outImage);
+   memSource->setImageGeometry(geometry.get());
+
+   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
+   writer->connectMyInputTo(0, memSource.get());
+   writer->setFilename(filename);
+   writer->setGeotiffFlag(true);
+   bool success = writer->execute();
+   //writer->writeExternalGeometryFile();
+
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-img2md/CMakeLists.txt b/apps/ossim-img2md/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-img2md/CMakeLists.txt
rename to apps/ossim-img2md/CMakeLists.txt
diff --git a/apps/ossim-img2md/ossim-img2md.cpp b/apps/ossim-img2md/ossim-img2md.cpp
new file mode 100644
index 0000000..d215710
--- /dev/null
+++ b/apps/ossim-img2md/ossim-img2md.cpp
@@ -0,0 +1,159 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  Application to output metadata given meta data type,
+// source image, output file.  Additional keywords can be passed to writer
+// via the "-t" option which takes a keyword list.
+//
+//----------------------------------------------------------------------------
+// $Id: img2md.cpp 9111 2006-06-14 12:34:08Z gpotts $
+
+#include <iostream>
+#include <iterator>
+using namespace std;
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageMetaDataWriterRegistry.h>
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+
+static void outputWriterTypes();
+static void usage();
+
+int main(int argc, char* argv[])
+{
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+   
+   argumentParser.getApplicationUsage()->setApplicationName(
+      argumentParser.getApplicationName());
+   
+   argumentParser.getApplicationUsage()->setDescription(
+      argumentParser.getApplicationName()+" outputs metadata for an image.");
+   
+   argumentParser.getApplicationUsage()->setCommandLineUsage(
+      argumentParser.getApplicationName()+" [options] <metadata_writer> <input_file> <output_file>");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "-h or --help", "Shows help");
+
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "-t or --template", "Template to pass to meta data writer.");
+   
+   //---
+   // Extract optional arguments.
+   //---
+   ossimFilename templateFile = ossimFilename::NIL;
+        
+   if(argumentParser.read("-h") || argumentParser.read("--help"))
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage(); // For metadata writer types.
+      exit(0);
+   }
+   if( argumentParser.read("-t", stringParam) ||
+       argumentParser.read("--template", stringParam) )
+   {
+      templateFile = tempString.c_str();
+   }
+   
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+   if (argumentParser.errors())
+   {
+      argumentParser.writeErrorMessages(std::cout);
+      exit(1);
+   }
+
+   if(argumentParser.argc() < 4)
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage(); // For metadata writer types.
+      exit(1);
+   }
+   
+   ossimString   metaDataWriterType = argumentParser.argv()[1];
+   ossimFilename imageFile          = argumentParser.argv()[2];
+   ossimFilename outputFile         = argumentParser.argv()[3];
+   
+   ossimRefPtr<ossimImageHandler> ih =
+      ossimImageHandlerRegistry::instance()->open(imageFile);
+   if (!ih)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Could not open:  " << imageFile << endl; 
+   }
+
+   metaDataWriterType.downcase();
+   
+   ossimRefPtr<ossimMetadataFileWriter> mw =
+      ossimImageMetaDataWriterRegistry::instance()->createWriter(
+         metaDataWriterType);
+   if (!mw)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Could not create meta data writer of type:  "
+         << metaDataWriterType << endl;
+      exit(1);
+   }
+
+   ossimKeywordlist kwl;
+   kwl.add(ossimKeywordNames::FILENAME_KW, outputFile.c_str());
+
+   if (templateFile != ossimFilename::NIL)
+   {
+      if (kwl.addFile(templateFile) == false)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Could not load template file:  "
+            << templateFile << endl;
+         exit(1);
+      }
+   }
+
+   mw->loadState(kwl);
+
+   mw->connectMyInputTo(ih.get());
+
+   if (mw->execute() == true)
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "Wrote file:  " << outputFile.c_str() << endl;
+   }
+   
+   return 0;
+}
+
+void usage()
+{
+   cout << "\nNOTES:"
+        << "\nValid metadata writer types:"
+        << "\n";
+   outputWriterTypes();
+}
+
+void outputWriterTypes()
+{
+   std::vector<ossimString> metadatatypeList;
+   
+   ossimImageMetaDataWriterRegistry::instance()->getMetadatatypeList(
+      metadatatypeList);
+   
+   std::copy(metadatatypeList.begin(),
+             metadatatypeList.end(),
+             std::ostream_iterator<ossimString>(std::cout, "\t\n"));
+}
diff --git a/ossim/src/apps/ossim-img2rr/CMakeLists.txt b/apps/ossim-img2rr/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-img2rr/CMakeLists.txt
rename to apps/ossim-img2rr/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-img2rr/ossim-img2rr.cpp b/apps/ossim-img2rr/ossim-img2rr.cpp
similarity index 100%
rename from ossim/src/apps/ossim-img2rr/ossim-img2rr.cpp
rename to apps/ossim-img2rr/ossim-img2rr.cpp
diff --git a/ossim/src/apps/ossim-info/CMakeLists.txt b/apps/ossim-info/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-info/CMakeLists.txt
rename to apps/ossim-info/CMakeLists.txt
diff --git a/apps/ossim-info/ossim-info.cpp b/apps/ossim-info/ossim-info.cpp
new file mode 100644
index 0000000..88f92fc
--- /dev/null
+++ b/apps/ossim-info/ossim-info.cpp
@@ -0,0 +1,70 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossim-info.cpp 18619 2011-01-03 10:33:51Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimInfo.h>
+
+#include <iostream>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   //---
+   // Get the arg count so we can tell if an arg was consumed by
+   // ossimInit::instance()->initialize
+   //---
+   int originalArgCount = argc;
+
+   ossimArgumentParser ap(&argc, argv);
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(ap);
+
+   //---
+   // Avoid going on if a global option was consumed by ossimInit::initialize
+   // like -V or --version option and the arg count is down to 1.
+   //---
+   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
+   {
+      // Make the info object.
+      ossimRefPtr<ossimInfo> oi = new ossimInfo;
+
+      try
+      {
+         //---
+         // Initialize will take the options passed in and set things to output
+         // information for.
+         //
+         // ossimInfo::initialize can throw an exception.
+         //---
+         bool continue_after_init = oi->initialize(ap);
+
+         if ( continue_after_init )
+         {
+            // This will actually output the information.
+            oi->execute();
+         }
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         return 1;
+      }
+      
+   }  // End: if ( ( ap.argc() > 1 ) ...
+   
+   return 0;
+   
+} // End of main...
diff --git a/ossim/src/apps/ossim-modopt/CMakeLists.txt b/apps/ossim-modopt/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-modopt/CMakeLists.txt
rename to apps/ossim-modopt/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-modopt/ossim-modopt.cpp b/apps/ossim-modopt/ossim-modopt.cpp
similarity index 100%
rename from ossim/src/apps/ossim-modopt/ossim-modopt.cpp
rename to apps/ossim-modopt/ossim-modopt.cpp
diff --git a/ossim/src/apps/ossim-mosaic/CMakeLists.txt b/apps/ossim-mosaic/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-mosaic/CMakeLists.txt
rename to apps/ossim-mosaic/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-mosaic/mosaic_usage.txt b/apps/ossim-mosaic/mosaic_usage.txt
similarity index 100%
rename from ossim/src/apps/ossim-mosaic/mosaic_usage.txt
rename to apps/ossim-mosaic/mosaic_usage.txt
diff --git a/apps/ossim-mosaic/ossim-mosaic.cpp b/apps/ossim-mosaic/ossim-mosaic.cpp
new file mode 100644
index 0000000..a8da450
--- /dev/null
+++ b/apps/ossim-mosaic/ossim-mosaic.cpp
@@ -0,0 +1,539 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: mosaic.cpp 13312 2008-07-27 01:26:52Z gpotts $
+#include <iostream>
+#include <fstream>
+using namespace std;
+
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimFeatherMosaic.h>
+#include <ossim/imaging/ossimBlendMosaic.h>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageSourceFactory.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageWriter.h>
+#include <ossim/projection/ossimImageViewTransform.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimRtti.h>
+
+static ossimTrace traceDebug(ossimString("mosaic:main"));
+
+void outputTemplateKeywordlist(const ossimFilename &templateFilename)
+{
+   ofstream out(templateFilename.c_str());
+
+   out << "file1.filename: <full path and file name>" << endl
+       << "file2.filename: <full path and file name>" << endl
+       << "// :\n"
+       << "// :\n"
+       << "// fileN: <full path and file name to the Nth file in the list>" << endl
+       << "\n// currently this option has been tested\n"
+       << "// with ossimTiffWriter and ossimJpegWriter\n"
+       << "// writer.type: ossimTiffWriter"            << endl
+       << "// writer.filename: <full path to output file>"  << endl
+       << "\n// Currently, the mosaic application supports\n"
+       << "// SIMPLE mosaics (ie. no blending algorithms)\n"
+       << "// BLEND  for maps or layers that you want to blend together\n"
+       << "// FEATHER for applying a spatial feaher along overlapped regions\n"
+       << "// mosaic.type: SIMPLE"                     << endl
+       << "\n// product type and projection information" << endl
+       << "// is optional.  It will use the first images"<<endl
+       << "// geometry information instead." << endl
+       << "// product.type: "        << endl
+       << "// product.meters_per_pixel_y: "       << endl
+       << "// product.meters_per_pixel_x: "       << endl
+       << "// product.central_meridian:   " << endl
+       << "// product.origin_latitude:"    << endl;
+
+   ossimNotify(ossimNotifyLevel_NOTICE)
+      << "Wrote file: " << templateFilename << std::endl;
+}
+
+ossimMapProjection* buildProductProjection(const ossimKeywordlist& kwl,
+                                           ossimConnectableObject::ConnectableObjectList& inputSources)
+{
+   const char* productType = kwl.find("product.type");
+   const char* productGeom = kwl.find("product.geom_file");
+   ossimRefPtr<ossimMapProjection> result = 0;
+
+   // if we don't have a prduct output specified
+   // we will just use the first image.
+   if(!productType&&!productGeom)
+   {
+      if(inputSources.size() < 1)
+      {
+         return NULL;
+      }
+      ossimKeywordlist geom;
+      ossimImageChain* imageChain = PTR_CAST(ossimImageChain, inputSources[0].get());
+      ossimConnectableObject* source = NULL;
+      
+      if(!imageChain)
+      {
+         source = PTR_CAST(ossimImageHandler, inputSources[0].get());
+      }
+      else
+      {
+         source = imageChain->findFirstObjectOfType(STATIC_TYPE_INFO(ossimImageHandler));
+      }
+
+      if(source)
+      {
+         ossimImageHandler* handler = PTR_CAST(ossimImageHandler, source);
+         if(handler)
+         {
+            ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+            ossimRefPtr<ossimProjection>   temp    = geom->getProjection();
+            result = PTR_CAST(ossimMapProjection, temp.get());
+         }
+      }
+      else
+      {
+         return NULL;
+      }
+   }
+   else
+   {
+      ossimRefPtr<ossimProjection>   temp    = ossimProjectionFactoryRegistry::instance()->createProjection(kwl,
+                                                                                                "product.");
+      result = PTR_CAST(ossimMapProjection, temp.get());
+   }
+
+   return result.release();
+}
+
+bool buildRenderers(const ossimKeywordlist& specFile,
+                    ossimConnectableObject::ConnectableObjectList& imageSources,
+                    ossimMapProjection* productProjection)
+{
+   ossim_int32 index = 0;
+
+   // add the renderer to each chain.  First, look for
+   // the ossimImageHandler and get the image
+   // geometry for this chain.  The add the ossimImageRenderer
+   // to each chain and then connect it up
+   //
+   for(index = 0; index < (ossim_int32)imageSources.size(); ++index)
+   {
+      ossimImageChain* imageChain = PTR_CAST(ossimImageChain, imageSources[index].get());
+      if(imageChain)
+      {
+         ossimConnectableObject* source = imageChain->findFirstObjectOfType(STATIC_TYPE_INFO(ossimImageHandler));
+
+         if(source)
+         {
+            ossimImageHandler* imageHandler = PTR_CAST(ossimImageHandler,
+                                                       source);
+
+
+            ossimRefPtr<ossimImageGeometry> geom = imageHandler->getImageGeometry();
+            // now add the image/view transform to the
+            // renderer.
+            //
+            if(geom.valid())
+            {
+               ossimImageSource* last = imageChain->getFirstSource();
+
+               
+               ossimImageRenderer* renderer = new ossimImageRenderer;
+               renderer->connectMyInputTo(0, PTR_CAST(ossimConnectableObject, last));
+               imageChain->add(renderer);
+               ossimImageViewProjectionTransform* transform = new ossimImageViewProjectionTransform;
+               transform->setImageGeometry(geom.get());
+               ossimRefPtr<ossimImageGeometry> viewGeom = new ossimImageGeometry();
+               viewGeom->setProjection(productProjection);
+               // Make a copy of the view projection for
+               // each chain by passing in the object and not
+               // the pointer.
+               transform->setViewGeometry(viewGeom.get());
+               
+               renderer->setImageViewTransform(transform);
+               imageChain->initialize();
+            }
+            else
+            {
+               return false;
+            }
+         }
+      }
+   }
+
+   return true;
+}
+
+bool buildChains(std::vector<ossimFilename>& fileList,
+                 ossimConnectableObject::ConnectableObjectList& chains)
+{
+   bool result = true;
+   chains.clear();
+
+   for(ossim_int32 index = 0; index < (ossim_int32)fileList.size();++index)
+   {
+      ossimRefPtr<ossimImageSource> handler = ossimImageHandlerRegistry::instance()->open(fileList[index]);
+
+      if(handler.valid())
+      {
+         ossimImageChain* imageChain = new ossimImageChain;
+         imageChain->add(handler.get());
+         chains.push_back(imageChain);
+      }
+      else
+      {
+         cerr << "Error: Unable to load image " << fileList[index] << endl;
+         result = false;
+      }
+   }
+
+   return result;
+}
+
+bool buildChains(const ossimKeywordlist& kwl,
+                 ossimConnectableObject::ConnectableObjectList& chains)
+{
+   ossim_int32 index = 0;
+   ossim_int32 result = kwl.getNumberOfSubstringKeys("file[0-9]+\\.filename");
+   const char* lookup = NULL;
+   ossim_int32 numberOfMatches = 0;
+   vector<ossimFilename> fileList;
+   
+   while(numberOfMatches < result)
+   {
+      ossimString searchValue = "file" + ossimString::toString(index);
+      
+      ossimString filename = searchValue + ".filename";
+      lookup = kwl.find(filename.c_str());
+      if(lookup)
+      {
+         fileList.push_back(ossimFilename(lookup));
+         ++numberOfMatches;
+      }
+      ++index;
+   }
+      
+   return buildChains(fileList,
+                      chains);
+}
+
+ossimRefPtr<ossimImageCombiner> createMosaic(const ossimKeywordlist& kwl,
+                               ossimConnectableObject::ConnectableObjectList& inputSources)
+{
+   const char* mosaicType = kwl.find("mosaic.type");
+   //ossimImageCombiner* mosaic = NULL;
+   ossimRefPtr<ossimImageCombiner> mosaic = 0;
+   if(mosaicType)
+   {
+      if(ossimString(mosaicType).upcase() == "FEATHER")
+      {
+         mosaic  = new ossimFeatherMosaic;
+      }
+      else if(ossimString(mosaicType).upcase() == "BLEND")
+      {
+         mosaic  = new ossimBlendMosaic;
+      }
+      else
+      {
+		 mosaic = PTR_CAST(ossimImageCombiner, ossimObjectFactoryRegistry::instance()->createObject(ossimString(mosaicType)));
+      }
+   }
+   else
+   {
+      mosaic = new ossimImageMosaic;
+   }
+   if (!mosaic) cerr << "Could not create Mosaic!";
+
+   for(ossim_int32 index = 0; index < (ossim_int32)inputSources.size(); ++index)
+   {
+      mosaic->connectMyInputTo(inputSources[index].get());
+   }
+
+   mosaic->initialize();
+
+   return mosaic;
+}
+ossimString massageQuotedValue(const ossimString& value)
+{
+   char quote = '\0';
+   if(*value.begin() == '"')
+   {
+      quote = '"';
+   }
+   else if(*value.begin() == '\'')
+   {
+      quote = '\'';
+   }
+   
+   if(quote == '\0')
+   {
+      return value;
+   }
+   std::vector<ossimString> splitString;
+   value.split(splitString, quote);
+   if(splitString.size() == 3)
+   {
+      return splitString[1];
+   }
+   return value;
+}
+int main(int argc, char *argv[])
+{
+	ossimArgumentParser argumentParser(&argc, argv);
+	ossimInit::instance()->addOptions(argumentParser);
+	ossimInit::instance()->initialize(argumentParser);
+	argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+	argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName() +" Takes a list of images and outputs to mosaic.");
+	argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" [options] <input_file1> <input_file2> <input_file...> <output_file>");
+	argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
+	argumentParser.getApplicationUsage()->addCommandLineOption("-k", "keyword list to load from");
+	argumentParser.getApplicationUsage()->addCommandLineOption("-m", "Mosiac type (SIMPLE, BLEND, FEATHER, or any MosaicCombinerType [ossimClosestToCenter, ossimFeatherMosaic, etc..]) (default=SIMPLE");
+	argumentParser.getApplicationUsage()->addCommandLineOption("-w", "Writer type (tiff_strip, jpeg, etc... see ossim-info --writers) (default=tiff_strip)");
+	argumentParser.getApplicationUsage()->addCommandLineOption("--writer-prop <string>", "Adds a property to send to the writer. format is name=value");
+	argumentParser.getApplicationUsage()->addCommandLineOption("-t", "output a keyword list template");
+
+	// Allocate some stuff up front for use later
+	ossimKeywordlist kwl;
+	ossimString theWriterType = "tiff_strip";
+	bool keywordlistSupplied = false;
+	bool optionGiven = false;
+	ossimFilename outfile = "";
+	std::string tempString;
+	ossimArgumentParser::ossimParameter stringParam(tempString);
+	std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;
+
+	// user input writer props, should use those
+	while(argumentParser.read("--writer-prop", stringParam))
+   {
+      std::vector<ossimString> nameValue;
+      ossimString(tempString).split(nameValue, "=");
+      if(nameValue.size() == 2)
+      {
+         writerPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
+      }
+   }
+
+	// User input a writer type
+	while (argumentParser.read("-w", stringParam))
+   {
+      theWriterType = tempString;
+   }
+
+   // Keyword list to load from
+   while (argumentParser.read("-k", stringParam))
+   {
+      kwl.addFile(tempString.c_str());
+      keywordlistSupplied = true;
+      optionGiven         = true;
+   }
+
+   // Mosiac type
+   while (argumentParser.read("-m", stringParam))
+   {
+      ossimString opt = tempString;
+      opt = opt.upcase();
+      opt = opt.trim();
+      if( (opt != "SIMPLE")&&
+          (opt != "BLEND")&&
+          (opt != "FEATHER"))
+      {
+         opt = tempString;
+      }
+      kwl.add("mosaic.type",
+              opt.c_str(),
+              true);
+   }
+   
+   // Output KWL template
+   while (argumentParser.read("-t", stringParam))
+   {
+      ossimFilename templateFilename = tempString.c_str();
+      outputTemplateKeywordlist(templateFilename);
+      exit(0);
+   }
+   
+   // Display Help - changed 3 to 2, because you can just supply a kwl and an output
+   while (argumentParser.read("-h") ||
+       argumentParser.read("--help") ||
+       (argumentParser.argc() < 2 ))
+   {
+      argumentParser.getApplicationUsage()->write(
+         ossimNotify(ossimNotifyLevel_INFO));
+      exit(0);
+   }
+
+   int argCount = argumentParser.argc();
+
+   // Get the input files.
+   for (int i=1; i< (argCount-1); ++i)
+   {
+      ossimFilename f = argv[i];
+      if(f.exists())
+      {
+         kwl.add((ossimString("file")+ossimString::toString(i)+".").c_str(),
+                 "filename",
+                 f.c_str(),
+                 true);
+      }
+      keywordlistSupplied = true;
+      optionGiven         = true;
+   }
+
+   // Get the output file.
+   outfile = argv[argCount-1];
+
+   if(outfile.exists())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "mosaic ERROR:"
+         << "\nOutput file " << outfile << " exits and will not be overwritten!"
+         << "\nExiting..."
+         << std::endl;
+      exit(1);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "kwl:\n" << kwl
+         << "output file: " << outfile << std::endl;
+   }
+
+   if(keywordlistSupplied)
+   {
+	   // NOTE: Got rid of the separate method writeMosaic and moved the code down here so i didn't have to pass a ton of variables to it.
+		ossimConnectableObject::ConnectableObjectList inputSources;
+
+		if(outfile == "")
+		{
+		   outfile = "./output.tif";
+		}
+		// build the image and a remapper for it.
+		// if we were successful then we will add the image
+		// renderer that will transform it it some output
+		// product projection.
+		//
+		if(buildChains(kwl, inputSources))
+		{
+		   ossimMapProjection* productProjection = buildProductProjection(kwl,
+		                                                                  inputSources);
+		   
+		   if(!productProjection)
+		   {
+		      cerr << "unable to create product projection" << endl;
+		      return false;
+		   }
+		   
+		   // now let's build up the renderers
+		   //
+		   if(buildRenderers(kwl,
+		                     inputSources,
+		                     productProjection))
+		   {
+				
+		      // Create mosaic object
+		      ossimRefPtr<ossimImageCombiner> mosaic = createMosaic(kwl,
+		                                                inputSources);
+			  // Create writer from kwl if supplied
+		      ossimRefPtr<ossimImageFileWriter> writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwl,"writer.");
+
+		      if(!writer)
+		      {
+				  // If no kwl was supplied, then create a writer from the 'theWriterType' string
+				 writer = ossimImageWriterFactoryRegistry::instance()->createWriter(theWriterType);
+		         //writer = new ossimTiffWriter; // the default 'theWriterType' is not 'tiff_strip' which should be this class
+		         writer->open(outfile);
+		      }
+		      
+		      if(writer.valid())
+		      {
+		         ossimStdOutProgress listener;
+		         if(mosaic.valid())
+		         {
+		            writer->addListener(&listener);
+		            writer->connectMyInputTo(0, mosaic.get());
+		            writer->initialize();
+		            
+					if ( writerPropertyMap.size() )
+					{
+					   ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
+					   std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = writerPropertyMap.begin();
+					   while(iter!=writerPropertyMap.end())
+					   {
+					      propInterface->setProperty(iter->first, iter->second);
+					      ++iter;
+					   }
+					}
+					
+					// NOTE: This stuff is copied in anyhow not sure why it was being done in the first place... 
+					// still here because maybe it is required! should be more generic.
+
+					//ossimMapProjectionInfo mapInfo(productProjection,
+		            //                               mosaic->getBoundingRect());
+		            //ossimTiffWriter* tempTiffPtr = PTR_CAST(ossimTiffWriter, writer.get());
+		            //
+		            //if(tempTiffPtr)
+		            //{
+		            //   tempTiffPtr->setProjectionInfo(mapInfo);
+		            //   tempTiffPtr->execute();
+		            //}
+		            //else
+		            //{
+					// Do the hard work here..
+		            if (!writer->execute())
+					{
+						ossimNotify(ossimNotifyLevel_WARN)
+							<< "mosaic ERROR:"
+							<< "\nCould not execute writer!"
+							<< "\nExiting..."
+							<< std::endl;
+						return 1;
+					}
+		            //}
+		            writer->removeListener(&listener);
+		         }
+		         writer->disconnect();
+		         mosaic->disconnect();
+		         mosaic = 0;
+		         writer = 0;
+		      }
+		   }
+		   else
+		   {
+		      return 1;
+		   }
+		}
+   }
+
+   if(!optionGiven)
+   {
+      argumentParser.getApplicationUsage()->write(
+         ossimNotify(ossimNotifyLevel_INFO));
+   }
+
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-ogeom2ogeom/CMakeLists.txt b/apps/ossim-ogeom2ogeom/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-ogeom2ogeom/CMakeLists.txt
rename to apps/ossim-ogeom2ogeom/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp b/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp
similarity index 100%
rename from ossim/src/apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp
rename to apps/ossim-ogeom2ogeom/ossim-ogeom2ogeom.cpp
diff --git a/ossim/src/apps/ossim-orthoigen/CMakeLists.txt b/apps/ossim-orthoigen/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-orthoigen/CMakeLists.txt
rename to apps/ossim-orthoigen/CMakeLists.txt
diff --git a/apps/ossim-orthoigen/ossim-orthoigen.cpp b/apps/ossim-orthoigen/ossim-orthoigen.cpp
new file mode 100644
index 0000000..444912e
--- /dev/null
+++ b/apps/ossim-orthoigen/ossim-orthoigen.cpp
@@ -0,0 +1,167 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossim-orthoigen.cpp 3023 2011-11-02 15:02:27Z david.burken $
+
+#include <iostream>
+#include <cstdlib>
+#include <list>
+#include <fstream>
+#include <iterator>
+#include <iomanip>
+using namespace std;
+
+#include <ossim/util/ossimOrthoIgen.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <sstream>
+
+static ossimTrace traceDebug("orthoigen:debug");
+
+//*************************************************************************************************
+// USAGE
+//*************************************************************************************************
+static void usage()
+{
+   ossimNotify(ossimNotifyLevel_NOTICE) <<
+      "Valid output writer types for \"-w\" or \"--writer\" option:\n\n" << ends;
+   ossimImageWriterFactoryRegistry::instance()->
+      printImageTypeList(ossimNotify(ossimNotifyLevel_NOTICE));
+}
+
+//*************************************************************************************************
+// FINALIZE -- Convenient location for placing debug breakpoint for catching program exit.
+//*************************************************************************************************
+void finalize(int code)
+{
+   exit (code);
+}
+
+//*************************************************************************************************
+// MAIN
+//*************************************************************************************************
+int main(int argc, char* argv[])
+{
+#if OSSIM_HAS_MPI
+   ossimMpi::instance()->initialize(&argc, &argv);
+   if (ossimMpi::instance()->getRank() == 0)
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "MPI running with "
+         << ossimMpi::instance()->getNumberOfProcessors()
+         << " processors..." << std::endl;
+   }
+#endif
+
+   //---
+   // Start the timer.  Note ossimMpi::instance()->getRank() works with or without
+   // mpi being enabled.
+   //---
+   if (ossimMpi::instance()->getRank() == 0) ossimTimer::instance()->setStartTick();
+
+   enum
+   {
+      OK    = 0,
+      ERROR = 1
+   };
+
+   // Turn off the initial load of elevation.  This will be loaded if needed later.
+   ossimInit::instance()->setElevEnabledFlag(false);
+   
+   ossimRefPtr<ossimOrthoIgen> orthoIgen = new ossimOrthoIgen;
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+   ossimApplicationUsage* u = argumentParser.getApplicationUsage();
+   u->setApplicationName(argumentParser.getApplicationName());
+   u->setCommandLineUsage(     
+      "\n\n"
+      "    ossim-orthoigen [options] \"<input_image1>[|switches]\" \"[<input_image2>[|switches]\" ...] <output_image>\n"
+      "\n"
+      "    ossim-orthoigen [options] <input_spec>.src <output_image>");
+
+   u->setDescription(
+      "Creates a product image given an input specification as described below. There are two ways\n"
+      "of specifying the input source list. Switches on explicit form are \n"
+      "\n"
+      "    <N>|<B1,B2,...>|<histo-op>|<ovr_path>. \n"
+      "\n"
+      "The <histo-op> presently can be either \"auto-minmax\" or \"std-stretch-N\" where N=1, 2 or 3.\n"
+      "The <input_spec>.src keyword list contains keyword entries in the form of \n"
+      "\n"
+      "    imageN.<keyword>: value\n"
+      "\n"
+      "Supported keywords are \"file\", \"entry\", \"rgb\", \"hist\", \"ovr\", with values \n"
+      "identical to those specified in the explicit switch form.\n");
+
+   orthoIgen->addArguments(argumentParser);
+   u->addCommandLineOption("-h or --help","Display this information");
+   u->addCommandLineOption(
+      "--enable-entry-decoding","A filename can be separated by a | and a number (NO space).  \n"
+      "Example: a.toc|0 will do entry 0 of a.toc file and on unix you might want to use a \\ since\n"
+      "the separator is a pipe sign. Example: ./a.toc\\|0 will do entry 0 of a.toc.");
+
+   if (argumentParser.read("-h") || argumentParser.read("--help") || (argumentParser.argc() == 1))
+   {
+      u->write(ossimNotify(ossimNotifyLevel_INFO));
+      usage();
+      ossimMpi::instance()->finalize();
+      ossimInit::instance()->finalize();
+      finalize(OK);
+   }
+   bool enableEntryDecoding = false;
+   if(argumentParser.read("--enable-entry-decoding"))
+   {
+      enableEntryDecoding = true;
+   }
+   
+   orthoIgen->initialize(argumentParser);
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+   if (argumentParser.errors())
+   {
+      argumentParser.writeErrorMessages(ossimNotify(ossimNotifyLevel_WARN));
+      ossimMpi::instance()->finalize();
+      finalize(OK);
+   }
+   
+   orthoIgen->clearFilenameList();
+   orthoIgen->addFiles(argumentParser, enableEntryDecoding);
+
+   int status = OK;
+
+   try
+   {
+      orthoIgen->execute();
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      status = ERROR;
+   }
+   
+   if(ossimMpi::instance()->getRank() == 0)
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << std::setiosflags(ios::fixed)
+         << std::setprecision(3)
+         << "Time elapsed : " << ossimTimer::instance()->time_s() 
+         << std::endl;
+   }
+   
+   ossimMpi::instance()->finalize();
+   finalize(status); 
+}
diff --git a/ossim/src/apps/ossim-pc2dem/CMakeLists.txt b/apps/ossim-pc2dem/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-pc2dem/CMakeLists.txt
rename to apps/ossim-pc2dem/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-pc2dem/ossim-pc2dem.cpp b/apps/ossim-pc2dem/ossim-pc2dem.cpp
similarity index 100%
rename from ossim/src/apps/ossim-pc2dem/ossim-pc2dem.cpp
rename to apps/ossim-pc2dem/ossim-pc2dem.cpp
diff --git a/ossim/src/apps/ossim-pixelflip/CMakeLists.txt b/apps/ossim-pixelflip/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-pixelflip/CMakeLists.txt
rename to apps/ossim-pixelflip/CMakeLists.txt
diff --git a/apps/ossim-pixelflip/ossim-pixelflip.cpp b/apps/ossim-pixelflip/ossim-pixelflip.cpp
new file mode 100644
index 0000000..80874c2
--- /dev/null
+++ b/apps/ossim-pixelflip/ossim-pixelflip.cpp
@@ -0,0 +1,426 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+//*******************************************************************
+//  $Id: ossim-pixelflip.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+
+#include <iostream>
+#include <sstream>
+#include <algorithm>
+#include <iterator>
+
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimImageTypeLut.h>
+#include <ossim/base/ossimTimer.h>
+
+#include <ossim/imaging/ossimJpegWriter.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimPixelFlipper.h>
+#include <ossim/imaging/ossimRLevelFilter.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactory.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimBandSelector.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/parallel/ossimImageMpiMWriterSequenceConnection.h>
+#include <ossim/parallel/ossimImageMpiSWriterSequenceConnection.h>
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI
+#    include <mpi.h>
+#  endif
+#endif
+
+static ossimTrace traceDebug("pixelflip:main");
+static void usage();
+static void outputWriterTypes();
+int main(int argc, char* argv[])
+{
+   
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI
+   ossimMpi::instance()->initialize(&argc, &argv);
+   if (ossimMpi::instance()->getRank() == 0)
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "MPI running with "
+         << ossimMpi::instance()->getNumberOfProcessors()
+         << " processors..." << std::endl;
+   }
+#  endif
+#endif
+   
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+   
+   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" flips any null pixels to a valid pixel");
+   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" [options] <output_type> <input_file> <output_file> <target_value> <replacement_value>");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-o or --create-overview", "Creates and overview for the output image");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-c or --clamp-value", "clamp values (any pixel with value larger than input will be clamped to input)");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-m",  "Replacement mode (see notes below)");
+   argumentParser.getApplicationUsage()->addCommandLineOption("-w",  "output tile width(only valid with tiled output types).  Must be a multiply of 16");
+   
+ 
+   static const char MODULE[] = "pixelflip:main";
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
+   ossimInit::instance()->initialize(argc, argv);
+   // Keyword list to initialize image writers with.
+   ossimKeywordlist kwl;
+   const char* PREFIX = "imagewriter.";
+   bool create_overview = false;
+   ossim_int32 tile_width = 0;
+   double clamp_value = 0.0;
+   bool do_clamp = false;
+   ossimPixelFlipper::ReplacementMode replacement_mode =
+      ossimPixelFlipper::REPLACE_BAND_IF_TARGET;
+
+
+   if(argumentParser.read("-h") || argumentParser.read("--help")||(argumentParser.argc() == 1))
+   {
+      argumentParser.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+      usage();
+      exit(0);
+   }
+   while(argumentParser.read("-o") || argumentParser.read("--create-overview"))
+   {
+      create_overview = true;
+   }
+   while(argumentParser.read("-c", stringParam))
+   {
+      clamp_value = ossimString(tempString).toDouble();
+      do_clamp = true;
+   }
+   while(argumentParser.read("-m", stringParam))
+   {
+      ossimString mode = tempString;
+      mode.downcase();
+      if (mode == "replace_band_if_target")
+      {
+         replacement_mode = ossimPixelFlipper::REPLACE_BAND_IF_TARGET;
+      }
+      else if (mode == "replace_band_if_partial_target")
+      {
+         replacement_mode =
+            ossimPixelFlipper::REPLACE_BAND_IF_PARTIAL_TARGET;
+      }
+      else if (mode == "replace_all_bands_if_partial_target")
+      {
+         replacement_mode = ossimPixelFlipper::REPLACE_ALL_BANDS_IF_PARTIAL_TARGET;
+      }
+      else if (mode != "replace_all_targets")
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Invalid mode:  "
+            << mode
+            << "\nMode remains:  replace_band_if_target"
+            << std::endl;
+      }
+   }
+   while(argumentParser.read("-w", stringParam))
+   {
+      tile_width = ossimString(tempString).toInt32();
+      if (tile_width % 16)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE
+            << " NOTICE:"
+            << "\nTile width must be a multiple of 16!"
+            << "\nDefaulting to 128"
+            << std::endl;
+         tile_width = 0;
+      }
+   }
+
+   if(argumentParser.argc() != 6)
+   {
+      ossimMpi::instance()->finalize();
+      
+      exit(0);
+   }
+   //***
+   // Set the writer type and the image type.
+   //***
+   ossimString output_type = argumentParser.argv()[1];
+   output_type.downcase();
+   kwl.add(PREFIX, ossimKeywordNames::TYPE_KW, output_type.c_str());
+   // Get the input file.
+   ossimFilename input_file = argumentParser.argv()[2];
+   // Get the output file.
+   ossimFilename    output_file = argumentParser.argv()[3];
+   // Get the value to replace.
+   double target_value = ossimString(argumentParser.argv()[4]).toDouble();
+   // Get the replacement value.
+   double replacement_value = ossimString(argumentParser.argv()[5]).toDouble();
+   bool master = true;
+
+   if (ossimMpi::instance()->getRank() != 0)
+   {
+      master = false;
+   }
+   if (master)
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "pixelflip settings:"
+         << "\noutput type:        " << output_type
+         << "\ninput file:         " << input_file
+         << "\noutput file:        " << output_file
+         << "\ntarget value:       " << target_value
+         << "\nreplacement value:  " << replacement_value
+         << std::endl;
+      if (tile_width)
+      {
+         ossimNotify(ossimNotifyLevel_INFO)
+            << "tile width:         " << tile_width << std::endl;
+      }
+      if (do_clamp)
+      {
+          ossimNotify(ossimNotifyLevel_INFO)
+             << "clamp value:        " << clamp_value << std::endl;
+      }
+   }
+   // Get an image handler for the input file.
+   ossimRefPtr<ossimImageHandler> ih
+      = ossimImageHandlerRegistry::instance()->open(ossimFilename(input_file));
+   if (!ih)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Unsupported image file:  " << input_file
+         << "\nExiting application..." << std::endl;
+      ossimMpi::instance()->finalize();
+      exit(0);
+   }
+   // Initialize the
+   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Error reading image:  " << input_file
+         << "Exiting application..." << std::endl;
+      ossimMpi::instance()->finalize();
+      exit(1);
+   }
+   ih->initialize();
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nImage Handler:  " << ih->getLongName()
+           << std::endl;
+   }
+   // Capture the bounding rectangle of the image handler.
+   ossimIrect output_rect = ih->getBoundingRect(0);
+   // hook up the pixel flipper to the image handler.
+   ossimRefPtr<ossimPixelFlipper> pf = new ossimPixelFlipper();
+   pf->connectMyInputTo(ih.get());
+   pf->initialize();
+   // Setup the pixel flipper target/replacement values, and replace mode.
+   pf->setTargetValue(target_value);
+   pf->setReplacementValue(replacement_value);
+   pf->setReplacementMode(replacement_mode);
+   // Setup pixel flipper clamp value
+   if (do_clamp)
+   {
+      pf->setClampValue(clamp_value);
+   }
+   if (master)
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "replacement mode:   " << pf->getReplacementModeString()
+         << std::endl;
+   }
+   ossimImageSourceSequencer* sequencer = NULL;
+
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI
+   // only allocate the slave connection if
+   // the number of processors is larger than
+   // 1
+   //
+   if(ossimMpi::instance()->getNumberOfProcessors() > 1)
+   {
+      if(ossimMpi::instance()->getRank()!=0)
+      {
+         sequencer = new ossimImageMpiSWriterSequenceConnection(NULL, 4);
+      }
+      else
+      {
+         sequencer = new ossimImageMpiMWriterSequenceConnection();
+      }
+   }
+   else
+   {
+      sequencer = new ossimImageSourceSequencer();
+   }
+#  else
+   // we will just load a serial connection if MPI is not supported.
+   sequencer = new ossimImageSourceSequencer(NULL);
+#  endif
+#else
+   sequencer = new ossimImageSourceSequencer(NULL);
+#endif
+   
+   ossimRefPtr<ossimImageWriter> writer
+      = ossimImageWriterFactoryRegistry::instance()->createWriter(kwl, PREFIX);
+   ossimImageFileWriter* fileWriter = PTR_CAST(ossimImageFileWriter, writer.get());
+   if( fileWriter == NULL )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Error making an image writer..."
+         << "\nExiting application..." << std::endl;
+      ossimMpi::instance()->finalize();
+      exit(1);
+   }
+   // Change out the sequencer...
+   fileWriter->changeSequencer(sequencer);
+   // Hook up the pixel flipper to the file writer.
+   fileWriter->connectMyInputTo(0, pf.get());
+   if (tile_width)
+   {
+      // Set the tile size...
+      fileWriter->setTileSize(ossimIpt(tile_width, tile_width));
+   }
+   fileWriter->open(output_file);
+   // Add a listener to get percent complete.
+   ossimStdOutProgress prog(0, true);
+   fileWriter->addListener(&prog);
+   if (fileWriter->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+   {
+      fileWriter->initialize();
+      fileWriter->setAreaOfInterest(output_rect); // Set the output rectangle.
+
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI
+      double start_time = 0.0;
+      if(ossimMpi::instance()->getRank() == 0)
+      {
+         // Start the timer.
+         ossimTimer::instance()->setStartTick();
+         //start_time= MPI_Wtime();
+      }
+#  endif
+#endif
+
+      // Filter and write the file...
+      fileWriter->execute();
+
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI
+      if(ossimMpi::instance()->getRank() == 0)
+      {
+	 ossimNotify(ossimNotifyLevel_NOTICE)
+               << "elapsed time in seconds: "
+               << std::setiosflags(ios::fixed)
+               << std::setprecision(3)
+               << ossimTimer::instance()->time_s() << endl;
+         //double stop_time = MPI_Wtime();
+         //cout << "Elapsed time: " << (stop_time-start_time) << std::endl;
+      }
+#  endif
+#endif
+   }
+   else
+   {
+      cerr << "Error detected in the image writer..."
+           << "\nExiting application..." << std::endl;
+      exit(1);
+   }
+   if (create_overview == true)
+   {
+      fileWriter->writeOverviewFile();
+   }
+
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI   
+   ossimMpi::instance()->finalize();
+#  endif
+#endif
+   
+   exit(0);
+}
+void usage()
+{
+   ossimNotify(ossimNotifyLevel_INFO)
+      << "\nNOTES:"
+      << "\n-m Replacement mode option explanation:"
+      << "\n   Valid modes (default=replace_all_targets) :"
+      << "\n     replace_partial_targets"
+      << "\n     replace_partial_targets_all_bands"
+      << "\n     replace_full_targets"
+      << "\n     replace_all_targets"
+      << " (default=all)"
+      << "\n"
+      << "\nIf mode is \"replace_all_targets\" (default):"
+      << "\nAny pixel with dn of target will be replaced."
+      << "\n"
+      << "\nIf mode is \"replace_partial_targets\":"
+      << "\nTarget will be replaced only at least one subpixel(band) does "
+      << "\nnot have the target."
+      << "\n"
+      << "\nIf mode is \"replace_partial_targets_all_bands\":"
+      << "\nTarget will be replaced only at least one subpixel(band) does "
+      << "\nnot have the target.  All bands will be replaced."
+      << "\nThis is a good Landsat7 edge fixer..."
+      << "\n"
+      << "\nIf mode is \"replace_full_targets\":"
+      << "\nTarget will be repaced only if all subpixels(bands) have the "
+      << "target."
+      << "\n"
+      << "\n Example:"
+      << "\n target      = 0"
+      << "\n replacement = 1"
+      << "\n Pixel at (0, 0) r=0, g=0,  b=0"
+      << "\n Pixel at (0, 1) r=0, g=30, b=21"
+      << "\n"
+      << "\n Mode is \"replace_all_targets\":"
+      << "\n Pixel at (0, 0) becomes  r=1, g=1,  b=1"
+      << "\n Pixel at (0, 1) becomes  r=1, g=30, b=21"
+      << "\n"
+      << "\n Mode is \"replace_partial_targets\":"
+      << "\n Pixel at (0, 0) remains  r=0, g=0,  b=0"
+      << "\n Pixel at (0, 1) becomes  r=1, g=30, b=21"
+      << "\n"
+      << "\n Mode is \"replace_partial_targets_all_bands\":"
+      << "\n Pixel at (0, 0) remains  r=0, g=0,  b=0"
+      << "\n Pixel at (0, 1) becomes  r=1, g=1, b=1"
+      << "\n"
+      << "\n Mode is \"replace_full_targets\":"
+      << "\n Pixel at (0, 0) becomes  r=1, g=1,  b=1"
+      << "\n Pixel at (0, 1) remains  r=0, g=30, b=21"
+      << "\n"
+      << "\nValid output writer types:"
+      << std::endl;
+   outputWriterTypes();
+}
+
+void outputWriterTypes()
+{
+   std::vector<ossimString> outputType;
+   
+   ossimImageWriterFactoryRegistry::instance()->getImageTypeList(outputType);
+   std::copy(outputType.begin(),
+             outputType.end(),
+             std::ostream_iterator<ossimString>(std::cout, "\t\n"));
+}
diff --git a/apps/ossim-plot-histo/CMakeLists.txt b/apps/ossim-plot-histo/CMakeLists.txt
new file mode 100644
index 0000000..5168226
--- /dev/null
+++ b/apps/ossim-plot-histo/CMakeLists.txt
@@ -0,0 +1,2 @@
+FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+OSSIM_SETUP_APPLICATION(ossim-plot-histo INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/apps/ossim-plot-histo/ossim-plot-histo.cpp b/apps/ossim-plot-histo/ossim-plot-histo.cpp
new file mode 100644
index 0000000..cf56f8c
--- /dev/null
+++ b/apps/ossim-plot-histo/ossim-plot-histo.cpp
@@ -0,0 +1,172 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+//*******************************************************************
+//  $Id: create_histo.cpp 11743 2007-09-19 19:57:31Z gpotts $
+
+
+#include <ossim/ossimConfig.h>
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <algorithm>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#ifdef WIN32
+#define MY_POPEN(arg1, arg2) _popen(arg1, arg2)
+#else
+#define MY_POPEN(arg1, arg2) popen(arg1, arg2)
+#endif
+
+void usage()
+{
+   cout << "examples:\n"
+	     << " ossim-plot-histo foo.tif\n"
+	     << "            Will create a histogram for the input image and call\n"
+	     << "            it foo.his, then will plot the histogram.\n\n"
+        << " ossim-plot-histo foo.his\n"
+        << "            Simply plots existing histogram.\n\n"
+        << " ossim-plot-histo --with dots foo.his\n"
+        << "            Uses specified symbol for data point. See \"gnuplot plot with\" "
+        << "            documentation.\n\n"
+        << "Note: gnuplot must be installed before using this utility."
+        << endl;
+}
+
+void plotHistogram(const ossimFilename& histoFile, const ossimString& plotWith,
+                   const ossimString& xticstr)
+{
+   // Open the histogram file:
+   ossimRefPtr<ossimMultiResLevelHistogram> h = new ossimMultiResLevelHistogram();
+   if (!h->importHistogram(histoFile))
+   {
+      cout << "Could not read the histogram file <"<<histoFile<<">" << endl;
+      exit(1);
+   }
+
+   // Create temporary data file stream:
+   FILE * gnuplotPipe = MY_POPEN ("gnuplot -persistent", "w");
+   //FILE * gnuplotPipe = fopen("gnuplot.dat", "w");
+   if (!gnuplotPipe)
+   {
+      cout << "Could not create temporary gnuplot pipe. "<< endl;
+      exit(1);
+   }
+
+   if (!xticstr.empty())
+   {
+      ostringstream xticsCmd;
+      xticsCmd<<"set xtics ("<<xticstr<<")";
+      cout << "xticsCmd = "<<xticsCmd.str()<< endl;
+      fprintf(gnuplotPipe, "%s \n",xticsCmd.str().c_str());
+   }
+
+   // Output histogram data to temporary x, y file:
+   ossimString command ("plot '-' with ");
+   command.append(plotWith);
+   fprintf(gnuplotPipe, "%s \n", command.chars());
+   ossim_uint32 band = 0;
+   ossimRefPtr<ossimHistogram> histogram = h->getHistogram(band);
+   int numBins = histogram->GetRes();
+   const float* x = histogram->GetVals();
+   const float* y = histogram->GetCounts();
+   for (int i=0; i<numBins; ++i)
+   {
+      fprintf(gnuplotPipe, "%f %f \n", x[i], y[i]);
+   }
+   fprintf(gnuplotPipe, "e");
+   fclose(gnuplotPipe);
+}
+
+int main(int argc, char *argv[])
+{
+   ossimString tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+   
+   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
+   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" Plots image histogram.");
+   
+   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" <input_file>");
+   
+   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help", "Display this information");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--with <symbol>", "See \"gnuplot plot with\" documentation");
+   argumentParser.getApplicationUsage()->addCommandLineOption("--xtics (<string>)", "See \"gnuplot plot xtics\" documentation");
+   
+   ossim_uint32 maxLevels = 1;
+   ossim_int32 entry = -1;
+   ossimFilename plotFile;
+   
+   ossim_float64 minValueOverride = ossim::nan();
+   ossim_float64 maxValueOverride = ossim::nan();
+   ossim_int32   numberOfBinsOverride = -1;
+
+   bool fastMode = false;
+   ossimString plotWith = "dots";
+   ossimString xtics;
+   
+   if ( (argumentParser.read("-h")) || (argumentParser.read("--help")) )
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage();
+      exit(0);
+   }
+   
+   if(argumentParser.read("--with", stringParam))
+   {
+      plotWith = tempString;
+   }
+   if(argumentParser.read("--xtics", stringParam))
+   {
+      xtics = tempString;
+      cout << "xtics = "<<xtics<< endl;
+   }
+   if (argumentParser.argc() == 2)
+   {
+      ossimFilename inputFile = argv[1];
+      if(!inputFile.exists())
+      {
+         cerr << "Input file does not exist " << inputFile << endl;
+         exit(1);
+      }
+      maxLevels = 1;
+      if (inputFile.ext() != "his")
+      {
+         ostringstream cmd;
+         cmd<<"ossim-create-histo "<<inputFile<<ends;
+         system(cmd.str().c_str());
+         inputFile.setExtension("his");
+      }
+      plotHistogram(inputFile, plotWith, xtics);
+   }
+   else
+   {
+      argumentParser.getApplicationUsage()->write(std::cout);
+      usage();
+   }
+
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-preproc/CMakeLists.txt b/apps/ossim-preproc/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-preproc/CMakeLists.txt
rename to apps/ossim-preproc/CMakeLists.txt
diff --git a/apps/ossim-preproc/ossim-preproc.cpp b/apps/ossim-preproc/ossim-preproc.cpp
new file mode 100644
index 0000000..b695124
--- /dev/null
+++ b/apps/ossim-preproc/ossim-preproc.cpp
@@ -0,0 +1,86 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossim-info.cpp 18619 2011-01-03 10:33:51Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimImageUtil.h>
+
+int main(int argc, char *argv[])
+{
+   // Return 0 on success, something else on error.
+   enum
+   {
+      OK    = 0,
+      ERROR = 1
+   };
+   
+   int result = OK;
+   
+   // Start the timer.
+   ossimTimer::instance()->setStartTick();
+
+   //---
+   // Get the arg count so we can tell if an arg was consumed by
+   // ossimInit::instance()->initialize
+   //---
+   int originalArgCount = argc;
+
+   ossimArgumentParser ap(&argc, argv);
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(ap);
+
+   //---
+   // Avoid going on if a global option was consumed by ossimInit::initialize
+   // like -V or --version option and the arg count is down to 1.
+   //---
+   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
+   {
+      // Make the info object.
+      ossimRefPtr<ossimImageUtil> oiu = new ossimImageUtil();
+      
+      try
+      {
+         //---
+         // Initialize will take the options passed in and set things to output
+         // information for.
+         //
+         // ossimInfo::initialize can throw an exception.
+         //---
+         bool continue_after_init = oiu->initialize(ap);
+         
+         if ( continue_after_init )
+         {
+            // Execute the operation(s).
+            result = oiu->execute();
+
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "elapsed time in seconds: "
+               << std::setiosflags(ios::fixed)
+               << std::setprecision(3)
+               << ossimTimer::instance()->time_s() << endl;
+         }
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         result = ERROR;
+      }
+      
+   }  // End: if ( ( ap.argc() > 1 ) ...
+   
+   return result;
+   
+} // End of main...
diff --git a/ossim/src/apps/ossim-prune/CMakeLists.txt b/apps/ossim-prune/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-prune/CMakeLists.txt
rename to apps/ossim-prune/CMakeLists.txt
diff --git a/apps/ossim-prune/ossim-prune.cpp b/apps/ossim-prune/ossim-prune.cpp
new file mode 100644
index 0000000..92c1b2e
--- /dev/null
+++ b/apps/ossim-prune/ossim-prune.cpp
@@ -0,0 +1,132 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Lucas
+//
+//*******************************************************************
+//  $Id: prune.cpp 10698 2007-04-12 13:59:43Z gpotts $
+
+
+#include <iostream>
+#include <stdlib.h>
+using namespace std;
+
+#include <ossim/ossimConfig.h>
+
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/init/ossimInit.h>
+
+static ossimTrace traceDebug("prune:main");
+
+static void usage()
+{
+   cout << "prune: Displays if image is null or not.\n"
+        << "Usage:\n"
+        << "ossim-prune <image_file>"
+        << "\nMoves image_file to image_file.null if all tiles are null."
+        << "\n";
+   return;
+}
+
+static void move( const ossimFilename& in, const ossimFilename& out )
+{
+#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
+   std::string moveCommand = "ren";
+#else
+   std::string moveCommand = "mv";
+#endif
+
+   std::string command = moveCommand;
+   command += " ";
+   command += in.string();
+   command += " ";
+   command += out.string();
+   cout << "Executing " << command << endl;
+   system(command.c_str());
+}
+
+int main(int argc, char* argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+   
+   // One required arg:  input file
+   if (argc != 2)
+   {
+      usage();
+      exit(0);
+   }
+
+   const char* input_file = argv[1];
+
+   // Get an image handler for the input file.
+   ossimRefPtr<ossimImageHandler> ih
+      = ossimImageHandlerRegistry::instance()->open(ossimFilename(input_file));
+
+   if (!ih)
+   {
+      cout << "ERROR: Unsupported image file: " << input_file
+           << "\nExiting application." << endl;
+      exit(0);
+   }
+
+   // Initialize the 
+   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      cerr << "ERROR: Unable to read image file: " << input_file
+           << "\nExiting application." << endl; 
+      exit(1);
+   }
+
+   ih->initialize();
+
+   int lines   = ih->getNumberOfLines(0);
+   int samples = ih->getNumberOfSamples(0);
+   int tileHeight = ih->getTileHeight();
+   int tileWidth = ih->getTileWidth();
+   int tilesInLineDir = lines / tileHeight;
+   int tilesInSampDir = samples / tileWidth;
+
+   if(lines % tileHeight) ++tilesInLineDir;
+
+   if(samples % tileWidth) ++tilesInSampDir;
+
+   for(int i=0; i<tilesInLineDir; i++)
+   {
+      for(int j=0; j<tilesInSampDir; j++)
+      {
+         ossimIpt origin(j*tileWidth,i*tileHeight);
+         ossimRefPtr<ossimImageData> id=ih->getTile(origin);
+         if( id.valid() && (id->getDataObjectStatus() != OSSIM_EMPTY) )
+         {
+            cout << "RESULT: Image file has data: " << input_file << endl;
+            exit(0);
+         }
+      }
+   }
+
+   // Move the input file:
+   ossimFilename in = input_file;
+   ossimFilename out = in;
+   out += ".null";
+   move( in, out );
+   
+   in = in.fileNoExtension();
+   in += "_readme.txt";
+   if ( in.exists() )
+   {
+      out = in;
+      out += ".null";
+      move( in, out );
+   }
+   
+   exit(0);
+}
diff --git a/ossim/src/apps/ossim-rejout/CMakeLists.txt b/apps/ossim-rejout/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-rejout/CMakeLists.txt
rename to apps/ossim-rejout/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-rejout/ossim-rejout.cpp b/apps/ossim-rejout/ossim-rejout.cpp
similarity index 100%
rename from ossim/src/apps/ossim-rejout/ossim-rejout.cpp
rename to apps/ossim-rejout/ossim-rejout.cpp
diff --git a/ossim/src/apps/ossim-rpf/CMakeLists.txt b/apps/ossim-rpf/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-rpf/CMakeLists.txt
rename to apps/ossim-rpf/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-rpf/ossim-rpf.cpp b/apps/ossim-rpf/ossim-rpf.cpp
similarity index 100%
rename from ossim/src/apps/ossim-rpf/ossim-rpf.cpp
rename to apps/ossim-rpf/ossim-rpf.cpp
diff --git a/ossim/src/apps/ossim-senint/CMakeLists.txt b/apps/ossim-senint/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-senint/CMakeLists.txt
rename to apps/ossim-senint/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-senint/ossim-senint.cpp b/apps/ossim-senint/ossim-senint.cpp
similarity index 100%
rename from ossim/src/apps/ossim-senint/ossim-senint.cpp
rename to apps/ossim-senint/ossim-senint.cpp
diff --git a/ossim/src/apps/ossim-space-imaging/CMakeLists.txt b/apps/ossim-space-imaging/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-space-imaging/CMakeLists.txt
rename to apps/ossim-space-imaging/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-space-imaging/ossim-space-imaging.cpp b/apps/ossim-space-imaging/ossim-space-imaging.cpp
similarity index 100%
rename from ossim/src/apps/ossim-space-imaging/ossim-space-imaging.cpp
rename to apps/ossim-space-imaging/ossim-space-imaging.cpp
diff --git a/ossim/src/apps/ossim-src2src/CMakeLists.txt b/apps/ossim-src2src/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-src2src/CMakeLists.txt
rename to apps/ossim-src2src/CMakeLists.txt
diff --git a/apps/ossim-src2src/ossim-src2src.cpp b/apps/ossim-src2src/ossim-src2src.cpp
new file mode 100644
index 0000000..1016312
--- /dev/null
+++ b/apps/ossim-src2src/ossim-src2src.cpp
@@ -0,0 +1,522 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Mingjie Su
+//
+//*******************************************************************
+//  $Id: ossim-src2src.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimTilingPoly.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/plugin/ossimSharedPluginRegistry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/support_data/ossimInfoFactoryRegistry.h>
+#include <ossim/support_data/ossimSrcRecord.h>
+
+#include <iostream>
+#include <vector>
+using namespace std;
+
+
+//**************************************************************************
+// usage()
+//**************************************************************************
+void usage()
+{
+   ossimNotify(ossimNotifyLevel_INFO)
+      << " examples:\n\n"
+      << "    ossim-create-src --tiling-template ./mytemplate.template ./myfile.tif ./outdir\n"
+      << std::endl;;
+}
+
+//*****************************************************************************************
+// Centralized point to capture all program exits (aids in debugging -- please leave)
+//*****************************************************************************************
+void finalize(int exit_code)
+{
+   exit(exit_code);
+}
+
+void parseSrcFile(const ossimFilename& srcFile, vector<ossimSrcRecord>& srcRecordFiles, ossimString& prefix)
+{
+   if (!srcFile.isReadable())
+      return;
+
+   ossimKeywordlist src_kwl (srcFile);
+   unsigned int image_idx = 0;
+   ossimString lookup = src_kwl.find("dem0.file");
+   if (!lookup.empty())
+   {
+      prefix = "dem";
+   }
+
+   // Loop to read all image file entries:
+   while (true)
+   {
+      ossimSrcRecord srcRecord(src_kwl, image_idx++, prefix);
+      if (!srcRecord.valid()) 
+         break;
+
+      srcRecordFiles.push_back(srcRecord);
+   }
+}
+
+ossimRefPtr<ossimTilingPoly> getTiling(const ossimFilename& templateFile)
+{
+   ossimKeywordlist templateKwl;
+   if (!templateKwl.addFile(templateFile))
+   {
+      return 0;
+   }
+
+   ossimString prefix ("igen.tiling.");
+   while (1)
+   {
+      if (templateKwl.find(prefix.chars(), "tile_source"))
+      {
+         break;
+      }
+      else
+      {
+         return 0;
+      }
+
+      // If we got here, then no matches were found in the template. Try again but without a prefix:
+      if (prefix.empty())
+         break;
+      prefix.clear();
+   }
+
+   // Initialize the tiling object if enabled:
+   ossimRefPtr<ossimTilingPoly> tiling = new ossimTilingPoly;
+  
+   if (!tiling->loadState(templateKwl, prefix))
+   {
+      return 0;
+   }
+
+   return tiling;
+}
+
+ossimDrect getRect(ossimRefPtr<ossimMapProjection> mapProj, 
+   vector<ossimGpt> points)
+{
+   std::vector<ossimDpt> rectTmp;
+   rectTmp.resize(points.size());
+
+   for(std::vector<ossimGpt>::size_type index=0; index < points.size(); ++index)
+   {
+      mapProj->worldToLineSample(points[(int)index], rectTmp[(int)index]);
+   }
+
+   if (rectTmp.size() > 3)
+   {
+      ossimDrect rect2 = ossimDrect(rectTmp[0],
+         rectTmp[1],
+         rectTmp[2],
+         rectTmp[3]);
+
+      return rect2;
+   }
+   return ossimDrect();
+}
+
+//**************************************************************************
+// Main Application
+//**************************************************************************
+int main(int argc, char *argv[])
+{
+   std::string tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+   std::string tempString2;
+   ossimArgumentParser::ossimParameter stringParam2(tempString2);
+
+   ossimArgumentParser argumentParser(&argc, argv);
+   ossimInit::instance()->addOptions(argumentParser);
+   ossimInit::instance()->initialize(argumentParser);
+
+   ossimApplicationUsage* appuse = argumentParser.getApplicationUsage();
+   
+   appuse->setApplicationName(argumentParser.getApplicationName());
+
+   appuse->setDescription(argumentParser.getApplicationName()+
+      " generate src files for polygons.");
+
+   appuse->setCommandLineUsage(argumentParser.getApplicationName()+
+      "ossim-create-src [--tiling-template] <full path to template file>");
+                          
+   appuse->addCommandLineOption("--tiling-template", "Specify an external file that contains tiling information.");
+
+   ossimFilename templateFile = "";
+  
+   if(argumentParser.read("--tiling-template", stringParam1))
+   {
+      templateFile = ossimFilename(tempString1);
+   }
+
+   // End of arg parsing.
+   argumentParser.reportRemainingOptionsAsUnrecognized();
+   if ( argumentParser.errors() )
+   {
+      argumentParser.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      finalize(1);
+   }
+
+   if (argc == 1)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<< "Must supply an input file or info option." << std::endl;
+      finalize(0);
+   }
+
+   ossim_uint32 idx = 0;
+   ossim_uint32 last_idx = argumentParser.argc()-1;
+   ossimFilename inputSrcFile = "";
+   ossimString prefixStr = "image";
+   vector<ossimSrcRecord> inputFiles;
+   while(argumentParser.argv()[idx] && (idx < last_idx))
+   {
+      ossimString file = argumentParser.argv()[idx];
+      if (file.contains(".src"))
+      {
+         // input file spec provided via src file. Need to parse it:
+         inputSrcFile = ossimFilename(file);
+         if (!inputSrcFile.exists() )
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: file does not exist:  " << inputSrcFile
+               << std::endl;
+            finalize(1);
+         }
+         parseSrcFile(inputSrcFile, inputFiles, prefixStr);
+      }
+      ++idx;
+   }
+
+   // The last filename left on the command line should be the product filename:
+   ossimFilename outputFileDir = argumentParser.argv()[last_idx];
+   if (!outputFileDir.isDir())
+   {
+      outputFileDir = outputFileDir.path();
+      if (!outputFileDir.exists() )
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: output directory does not exist:  " << outputFileDir
+            << std::endl;
+         finalize(1);
+      }
+   }
+
+   if (!templateFile.exists())
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: template file does not exist::  " << templateFile
+         << std::endl;
+      finalize(1);
+   }
+
+   ossimRefPtr<ossimTilingPoly> polyTiling = getTiling(templateFile);
+   if (!polyTiling.valid())
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: error generating tiling:  " << templateFile
+         << std::endl;
+      finalize(1);
+   }
+
+   // Open up src file to get coordinate info from each file listed in src file.
+   ossim_float64 minLat = 90.0;
+   ossim_float64 maxLat = -90.0;
+   ossim_float64 minLon = 180.0;
+   ossim_float64 maxLon = -180.0;
+
+   ossimString tileName;
+   ossimIrect clipRect;
+   map<ossimString, ossimSrcRecord> infos;
+   ossimRefPtr<ossimMapProjection> mapProj = 0;
+
+   for (ossim_uint32 i = 0; i < inputFiles.size(); i++)
+   {
+      ossimFilename inputFile = inputFiles[i].getFilename();
+      vector<ossim_uint32> entryList;
+      ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(inputFile);
+      if (ih.valid() )
+      {
+         if(inputFiles[i].getEntryIndex() > -1 )
+         {
+            entryList.push_back(inputFiles[i].getEntryIndex());
+         }
+         else
+         {
+            ih->getEntryList(entryList);
+         }
+
+         for(ossim_uint32 entryIdx = 0; entryIdx < entryList.size(); ++entryIdx)
+         {
+            // Establish the image handler for this particular frame. This may be just
+            // the handler already opened in the case of single image per file:
+            ossimImageHandler* img_handler = 0;
+            if (entryList.size() == 1)
+            {
+               img_handler = ih.get();
+            }
+            else
+            {
+               img_handler = (ossimImageHandler*)ih->dup();
+            }
+
+            img_handler->setCurrentEntry(entryList[entryIdx]);
+
+            ossimDrect outputRect = img_handler->getBoundingRect();
+
+            ossimRefPtr<ossimImageGeometry> geom = img_handler->getImageGeometry();
+            if(geom.valid())
+            {
+               ossimGpt ulg;
+               ossimGpt llg;
+               ossimGpt lrg;
+               ossimGpt urg;
+
+               geom->localToWorld(outputRect.ul(), ulg);
+               geom->localToWorld(outputRect.ll(), llg);
+               geom->localToWorld(outputRect.lr(), lrg);
+               geom->localToWorld(outputRect.ur(), urg);
+
+               //find min and max lat, lon for whole src file
+               if (minLat > llg.lat)
+               {
+                  minLat = llg.lat;
+               }
+
+               if (minLon > llg.lon)
+               {
+                  minLon = llg.lon;
+               }
+
+               if (maxLat < urg.lat)
+               {
+                  maxLat = urg.lat;
+               }
+
+               if (maxLon < urg.lon)
+               {
+                  maxLon = urg.lon;
+               }
+
+               ossimString fileInfo = inputFile + "|" + ossimString::toString(entryIdx) + "|" + 
+                  ossimString::toString(ulg.lon) + "," + ossimString::toString(ulg.lat) + "," + 
+                  ossimString::toString(urg.lon) + "," + ossimString::toString(urg.lat) + "," + 
+                  ossimString::toString(lrg.lon) + "," + ossimString::toString(lrg.lat) + "," + 
+                  ossimString::toString(llg.lon) + "," + ossimString::toString(llg.lat);
+
+               infos[fileInfo] = inputFiles[i];
+
+               if (!mapProj.valid())
+               {
+                  ossimRefPtr<ossimProjection> proj = geom->getProjection();
+                  if (proj.valid())
+                  {
+                     mapProj = PTR_CAST(ossimMapProjection, proj->dup());
+                     if (!mapProj.valid()) //default it to ossimEquDistCylProjection
+                     {
+                        mapProj = new ossimEquDistCylProjection;
+                        mapProj->setMetersPerPixel(geom->getMetersPerPixel());
+                     }
+                  }
+               }
+            }
+            img_handler = 0;
+         }
+         ih = 0;
+      }
+      else
+      {
+         continue;
+      }
+   }
+   inputFiles.clear();
+
+   //get bounding rect for entire image
+   vector<ossimGpt> points;
+   if (points.size() == 0)
+   {
+      points.push_back(ossimGpt(maxLat, minLon));
+      points.push_back(ossimGpt(maxLat, maxLon));
+      points.push_back(ossimGpt(minLat, maxLon));
+      points.push_back(ossimGpt(minLat, minLon));
+   }
+
+   if(mapProj.valid())
+   {
+      ossimGpt tie(maxLat, minLon);
+      mapProj->setUlTiePoints(tie);
+      polyTiling->initialize(*(mapProj.get()), getRect(mapProj, points));
+   }
+
+   while(polyTiling->next(mapProj, clipRect, tileName))
+   {
+      ossimFilename outSrc = outputFileDir + "/" + ossimFilename(tileName).noExtension() + ".src";
+     
+      map<ossimString, ossimSrcRecord>::iterator it = infos.begin();
+      ossim_int32 index = 0;
+      map<ossim_int32, ossimSrcRecord> srcList;
+      while (it != infos.end())
+      {
+         ossimString fileInfo = it->first;
+         vector<ossimString> fileInfos = fileInfo.split("|");
+         ossim_int32 entryId = fileInfos[1].toInt();
+         vector<ossimString> latlonInfo = fileInfos[2].split(",");
+
+         double ulgLon = latlonInfo[0].toDouble();
+         double ulgLat = latlonInfo[1].toDouble();
+         double urgLon = latlonInfo[2].toDouble();
+         double urgLat = latlonInfo[3].toDouble();
+         double lrgLon = latlonInfo[4].toDouble();
+         double lrgLat = latlonInfo[5].toDouble();
+         double llgLon = latlonInfo[6].toDouble();
+         double llgLat = latlonInfo[7].toDouble();
+
+         points.clear();
+         points.push_back(ossimGpt(ulgLat, ulgLon));
+         points.push_back(ossimGpt(urgLat, urgLon));
+         points.push_back(ossimGpt(lrgLat, lrgLon));
+         points.push_back(ossimGpt(llgLat, llgLon));
+
+         //get bounding for each image listed in src file
+         ossimDrect rect = getRect(mapProj, points);
+
+         //check if the rect of image intersect with the rect of tile
+         if (rect.intersects(clipRect))
+         {
+            ossimSrcRecord srcRecord = it->second;
+            srcRecord.setEntryIndex(entryId);
+            srcList[index] = srcRecord;
+            index++;
+         }
+         it++;
+      }
+
+      //write image files which intersect with the tile to a new src file
+      if (srcList.size() > 0)
+      {
+         ofstream outputSrcFile(outSrc.c_str());
+         map<ossim_int32, ossimSrcRecord>::iterator srcIt = srcList.begin();
+         while (srcIt != srcList.end())
+         {
+            ossimString prefix = prefixStr + ossimString::toString(srcIt->first) + ".";
+
+            ossimFilename newSrcFile = srcIt->second.getFilename();
+            ossim_int32 entryId = srcIt->second.getEntryIndex();
+            ossimFilename supportDir = srcIt->second.getSupportDir();
+            ossimString hisOp = srcIt->second.getHistogramOp();
+            vector<ossim_uint32> bands = srcIt->second.getBands();
+            double weight = srcIt->second.getWeight();
+            ossimFilename overviewPath = srcIt->second.getOverviewPath();
+            ossimFilename hisPath = srcIt->second.getHistogramPath();
+            ossimFilename maskPath = srcIt->second.getMaskPath();
+
+            if (!newSrcFile.empty())
+            {
+               ossimString str = prefix + "file: " + newSrcFile;
+               outputSrcFile << str << "\n";
+            }
+
+            if (entryId > -1)
+            {
+               ossimString str = prefix + "entry: " + ossimString::toString(entryId);
+               outputSrcFile << str << "\n";
+            }
+
+            if (!supportDir.empty())
+            {
+               ossimString str = prefix + "support: " + supportDir;
+               outputSrcFile << str << "\n";
+            }
+
+            if (!hisOp.empty())
+            {
+               ossimString str = prefix + "hist-op: " + hisOp;
+               outputSrcFile << str << "\n";
+            }
+
+            if (bands.size())
+            {
+               ossimString str = "";
+               for (ossim_uint32 bandIndex = 0; bandIndex < bands.size(); bandIndex++)
+               {
+                  if (bandIndex == (bands.size()-1))
+                  {
+                     str = str + ossimString::toString(bands[bandIndex]+1);
+                  }
+                  else
+                  {
+                     str = str + ossimString::toString(bands[bandIndex]+1) + ",";
+                  }
+               }
+               str = prefix + "rgb: " + str;
+               outputSrcFile << str << "\n";
+            }
+
+            if (weight > 0)
+            {
+               ossimString str = prefix + "opacity: " + ossimString::toString(weight);
+               outputSrcFile << str << "\n";
+            }
+
+            if (!overviewPath.empty())
+            {
+               ossimString str = prefix + "ovr: " + overviewPath;
+               outputSrcFile << str << "\n";
+            }
+
+            if (!hisPath.empty())
+            {
+               ossimString str = prefix + "hist: " + hisPath;
+               outputSrcFile << str << "\n";
+            }
+
+            if (!maskPath.empty())
+            {
+               ossimString str = prefix + "mask: " + maskPath;
+               outputSrcFile << str << "\n";
+            }
+            outputSrcFile << "\n";
+            srcIt++;
+         }
+         outputSrcFile.close();
+         srcList.clear();
+      }
+   }
+
+   if (polyTiling.valid())
+   {
+      polyTiling = 0;
+   }
+   if (mapProj.valid())
+   {
+      mapProj = 0;
+   }
+   points.clear();
+   infos.clear();
+   
+   finalize(0);
+   return 0; // Never reached, but satisfies return type
+}
diff --git a/ossim/src/apps/ossim-swapbytes/CMakeLists.txt b/apps/ossim-swapbytes/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-swapbytes/CMakeLists.txt
rename to apps/ossim-swapbytes/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-swapbytes/ossim-swapbytes.cpp b/apps/ossim-swapbytes/ossim-swapbytes.cpp
similarity index 100%
rename from ossim/src/apps/ossim-swapbytes/ossim-swapbytes.cpp
rename to apps/ossim-swapbytes/ossim-swapbytes.cpp
diff --git a/ossim/src/apps/ossim-tfw2ogeom/CMakeLists.txt b/apps/ossim-tfw2ogeom/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-tfw2ogeom/CMakeLists.txt
rename to apps/ossim-tfw2ogeom/CMakeLists.txt
diff --git a/ossim/src/apps/ossim-tfw2ogeom/ossim-tfw2ogeom.cpp b/apps/ossim-tfw2ogeom/ossim-tfw2ogeom.cpp
similarity index 100%
rename from ossim/src/apps/ossim-tfw2ogeom/ossim-tfw2ogeom.cpp
rename to apps/ossim-tfw2ogeom/ossim-tfw2ogeom.cpp
diff --git a/ossim/src/apps/ossim-tfw2ogeom/template.kwl b/apps/ossim-tfw2ogeom/template.kwl
similarity index 100%
rename from ossim/src/apps/ossim-tfw2ogeom/template.kwl
rename to apps/ossim-tfw2ogeom/template.kwl
diff --git a/apps/ossim-tool-client/CMakeLists.txt b/apps/ossim-tool-client/CMakeLists.txt
new file mode 100644
index 0000000..93966b4
--- /dev/null
+++ b/apps/ossim-tool-client/CMakeLists.txt
@@ -0,0 +1,4 @@
+IF (UNIX)
+  FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+  OSSIM_SETUP_APPLICATION(ossim-tool-client INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
+ENDIF (UNIX)
\ No newline at end of file
diff --git a/apps/ossim-tool-client/ossim-tool-client.cpp b/apps/ossim-tool-client/ossim-tool-client.cpp
new file mode 100644
index 0000000..17c94c5
--- /dev/null
+++ b/apps/ossim-tool-client/ossim-tool-client.cpp
@@ -0,0 +1,62 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <iostream>
+#include <fstream>
+#include <ossim/base/ossimString.h>
+#include <ossim/sockets/ossimToolClient.h>
+
+using namespace std;
+
+#define MAX_BUF_LEN 4096
+
+int main(int argc, char *argv[])
+{
+   char buffer [MAX_BUF_LEN];
+   if (argc < 2)
+   {
+      cout<<"Usage "<<argv[0]<<" host:port\n"<<endl;;
+      exit(0);
+   }
+
+   int n;
+
+   ossimToolClient otc;
+   int svrsockfd = otc.connectToServer(argv[1]);
+   if (svrsockfd < 0)
+   {
+      cout << "\nossim-client: Bad socket file descriptor returned."<<endl;
+      exit (-1);
+   }
+
+   ossimString command;
+   while (1)
+   {
+      // Fetch message from console:
+      cout<<"\nEnter OSSIM command: "<<ends;
+      cin.getline(buffer, MAX_BUF_LEN);
+      command = buffer;
+      if (command.empty())
+         continue;
+
+      if ((command == "q") || (command == "quit"))
+         break;
+
+      // Send command to the OSSIM tool server:
+      if (!otc.execute(command.chars()))
+      {
+         cout << "\nossim-client: Error encountred on execute."<<endl;
+         break;
+      }
+   }
+
+   cout << "\nossim-client: Closing connection to OSSIM server."<<endl;
+   otc.disconnect();
+
+   return 0;
+}
diff --git a/apps/ossim-tool-server/CMakeLists.txt b/apps/ossim-tool-server/CMakeLists.txt
new file mode 100644
index 0000000..5bcd0f2
--- /dev/null
+++ b/apps/ossim-tool-server/CMakeLists.txt
@@ -0,0 +1,4 @@
+IF (UNIX)
+  FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
+  OSSIM_SETUP_APPLICATION(ossim-tool-server INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
+ENDIF (UNIX)
diff --git a/apps/ossim-tool-server/ossim-tool-server.cpp b/apps/ossim-tool-server/ossim-tool-server.cpp
new file mode 100644
index 0000000..df9c489
--- /dev/null
+++ b/apps/ossim-tool-server/ossim-tool-server.cpp
@@ -0,0 +1,27 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/sockets/ossimToolServer.h>
+
+int main(int argc, char *argv[])
+{
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(argc, argv);
+
+   const char* DEFAULT_PORT = "ossimd";
+   const char* portid = DEFAULT_PORT;
+   if (argc > 1)
+      portid = argv[1];
+
+   ossimToolServer ots;
+   ots.startListening(portid);
+
+   return 0;
+}
diff --git a/ossim/src/apps/ossim-viirs-proc/CMakeLists.txt b/apps/ossim-viirs-proc/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-viirs-proc/CMakeLists.txt
rename to apps/ossim-viirs-proc/CMakeLists.txt
diff --git a/apps/ossim-viirs-proc/ossim-viirs-proc.cpp b/apps/ossim-viirs-proc/ossim-viirs-proc.cpp
new file mode 100644
index 0000000..ded1d21
--- /dev/null
+++ b/apps/ossim-viirs-proc/ossim-viirs-proc.cpp
@@ -0,0 +1,210 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// File: ossim-viirs-proc
+//
+// Description: Application to extract VIIRS Radiance layer, shifting
+// min/max linearly to 16 bit space with coarse grid geometry file.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimMetadataInterface.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimShiftFilter.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimCoarseGridModel.h>
+#include <ossim/projection/ossimProjection.h>
+
+#include <iomanip>
+#include <iostream>
+#include <string>
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+   int status = 0;
+
+   // Timer for elapsed time:
+   ossimTimer::instance()->setStartTick();
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc == 2 )
+   {
+      ossimFilename inputFile = argv[1];
+      if ( inputFile.exists() )
+      {
+         ossimFilename outputFile = inputFile.expand().noExtension();
+         outputFile.string() += "_1.tif";
+         
+         if ( inputFile != outputFile )
+         {
+            std::string command =
+               "ossim-cmm --null -9999.0 --reader-prop layer=/All_Data/VIIRS-DNB-SDR_All/Radiance ";
+            command += inputFile.string();
+            cout << "Executing command: " << command << endl;
+
+            status = system( command.c_str() );
+
+            if ( status == 0 )
+            {
+               ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
+               if ( sic->open( inputFile, false ) )
+               {
+                  cout << "Opened: " << inputFile << endl;
+
+                  // Set the entry to the Radiance layer.
+                  ossimRefPtr<ossimProperty> readerProp = new  ossimStringProperty(
+                     ossimString("layer"),
+                     ossimString("/All_Data/VIIRS-DNB-SDR_All/Radiance") );
+
+                  sic->getImageHandler()->setProperty( readerProp );
+
+                  // Add filter to shift/stretch data uint16 range.
+                  ossimRefPtr<ossimShiftFilter> sf = new ossimShiftFilter();
+                  sf->setNullPixelValue( 0.0 );
+                  sf->setMinPixelValue( 1.0 );
+                  sf->setMaxPixelValue( 65535.0 );
+                  sic->addFirst( sf.get() );
+
+                  // Cast it to uint16:
+                  ossimRefPtr<ossimCastTileSourceFilter> cf =
+                     new ossimCastTileSourceFilter(0, OSSIM_UINT16 );
+                  sic->addFirst( cf.get() );
+
+                  // Put a cache in front of resampler.
+                  sic->addCache();
+                  
+                  // sic->addResampler();
+                  
+                  sic->initialize();
+                  
+                  // Write image:
+                  ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+                  if ( writer->open( outputFile ) )
+                  {
+                     // Turn on overviews and histograms:
+                     writer->setWriteOverviewFlag( true );
+                     writer->setWriteHistogramFlag( true );
+
+                     // Add a listener to get percent complete.
+                     ossimStdOutProgress prog(0, true);
+                     writer->addListener(&prog);
+                     
+                     writer->connectMyInputTo(0, sic.get());
+
+                     ossimIrect rect = writer->getAreaOfInterest();
+                     
+                     writer->execute();
+
+                     cout << "Wrote file: " << outputFile << endl;
+                     
+                     ossimRefPtr<ossimImageHandler> ih = sic->getImageHandler();
+
+                     if ( ih.valid() )
+                     {
+                        //---
+                        // If there is a coarse grid model write it out so the
+                        // oqutput file will pick it up.
+                        //---
+                        ossimRefPtr<ossimImageGeometry> geom = sic->getImageHandler()->
+                           getImageGeometry();
+                        if ( geom.valid() )
+                        {
+                           ossimRefPtr<ossimProjection> proj = geom->getProjection();
+                           if ( proj.valid() )
+                           {
+                              ossimFilename geomFile = outputFile.noExtension();
+                              geomFile.string() += ".geom";
+
+                              ossimRefPtr<ossimCoarseGridModel> cg =
+                                 dynamic_cast<ossimCoarseGridModel*>( proj.get() );
+                              if ( cg.valid() )
+                              {
+                                 // this saves geom file as well
+                                 cg->saveCoarseGrid( geomFile );
+                                 cout << "Wrote file: " << geomFile << endl;
+                              }
+                              else
+                              {
+                                 // Save the state to keyword list.
+                                 ossimKeywordlist geomKwl;
+                                 geom->saveState(geomKwl);
+
+                                 // Write to file:
+                                 geomKwl.write( geomFile.c_str() );
+                                 cout << "Wrote file: " << geomFile << endl;
+                              }
+                           }
+                        }
+
+                        //---
+                        // If the image handler is a metadata interface pass the metadata
+                        // to the dot.omd file and rewrite it.
+                        //---
+                        ossimMetadataInterface* mdi =
+                           dynamic_cast<ossimMetadataInterface*>( ih.get() );
+                        if ( mdi )
+                        {
+                           ossimFilename omdFile = outputFile.noExtension();
+                           omdFile += ".omd";
+                           ossimRefPtr<ossimKeywordlist> kwl = new ossimKeywordlist();
+                           if ( omdFile.exists() )
+                           {
+                              kwl->addFile( omdFile );
+                           }
+                           
+                           std::string prefix = "";
+                           mdi->addMetadata( kwl.get(), prefix );
+                           kwl->write( omdFile.c_str() );
+                           cout << "Wrote file: " << omdFile << endl;
+                        }
+                     }
+                  }
+                  else
+                  {
+                     cerr << "Could not open: " << outputFile << endl;
+                  }
+               }
+            }
+         } 
+         else // Matches: 
+         {
+            cerr << "Input file is same as output file!  Returning..." << endl;
+            status = -1;
+         }
+      }
+      else // Match: if ( inputFile.exists() ){ ... }
+      {
+         cerr << "Input file does not exists!" << endl;
+         status = -1;
+      }
+   }
+   else // Matches: if (argc == 2 ){ ... }
+   {
+      cout << argv[0] << " <image_file>"
+           << "\n\nExtracts VIIRS Radiance layer from hdf5 file, shifting min/max "
+           << "linearly to 16 bit space with coarse grid geometry file.\n" << endl;
+   }
+
+   cout << "Elapsed time in seconds: "
+        << std::setiosflags(ios::fixed)
+        << std::setprecision(3)
+        << ossimTimer::instance()->time_s() << "\n";
+
+   return status;
+}
diff --git a/ossim/src/apps/ossim-ws-cmp/CMakeLists.txt b/apps/ossim-ws-cmp/CMakeLists.txt
similarity index 100%
rename from ossim/src/apps/ossim-ws-cmp/CMakeLists.txt
rename to apps/ossim-ws-cmp/CMakeLists.txt
diff --git a/apps/ossim-ws-cmp/ossim-ws-cmp.cpp b/apps/ossim-ws-cmp/ossim-ws-cmp.cpp
new file mode 100755
index 0000000..5c8d58e
--- /dev/null
+++ b/apps/ossim-ws-cmp/ossim-ws-cmp.cpp
@@ -0,0 +1,230 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description: Application to compare to workspaces.
+//
+// $Id: foo.cpp 14815 2009-07-01 14:59:11Z gpotts $
+//----------------------------------------------------------------------------
+
+#include <cstdlib> /* for system command */
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/init/ossimInit.h>
+#include <iostream>
+using namespace std;
+
+static bool trace = false; // Turn on to see more stuff...
+
+static void cmpDir(const ossimFilename& wsa,
+                   const ossimFilename& wsb,
+                   const ossimFilename& dir);
+
+static void cmpFile(const ossimFilename& wsa,
+                    const ossimFilename& wsb,
+                    const ossimFilename& file);
+
+static bool isIgnoredFile(const ossimFilename& file);
+
+static void usage()
+{
+   cout << "Usage:  ossim-ws-cmp <wsa> <wsb>\n"
+        << "Compares workspace a (wsa) to workspace b (wsb).\n"
+        << "NOTE: requires \"diff\" command."
+        << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   if (argc != 3)
+   {
+      usage();
+      return 0;
+   }
+
+   ossimFilename wsa = argv[1];
+   ossimFilename wsb = argv[2];
+
+   if ( !wsa.isDir() )
+   {
+      cout << "<wsa> is NOT a directory: " << wsa << endl;
+      usage();
+      return 0;
+   }
+
+   if ( !wsb.isDir() )
+   {
+      cout << "<wsb> is NOT a directory: " << wsb << endl;
+      usage();
+      return 0;
+   }
+
+   cout << "wsa: " << wsa
+        << "\nwsb: " << wsb
+        << endl;
+
+   cmpDir(wsa, wsb, wsa);
+   
+   return 0;
+}
+
+void cmpDir(const ossimFilename& wsa,
+            const ossimFilename& wsb,
+            const ossimFilename& dir)
+{
+   ossimDirectory d;
+   if ( d.open(dir) )
+   {
+      ossimFilename f;
+      if (d.getFirst(f))
+      {
+         while ( f != "" )
+         {
+            // cout << f << endl;
+
+            if ( isIgnoredFile(f) == false )
+            {
+               if ( f.isDir() )
+               {
+                  cmpDir(wsa, wsb, f);
+               }
+               else
+               {
+                  cmpFile(wsa, wsb, f);
+               }
+            }
+            d.getNext(f);
+         }
+      }
+   }
+   else
+   {
+      cout << "Could not open: " << wsa << endl;
+   }
+}
+
+void cmpFile(const ossimFilename& wsa,
+             const ossimFilename& wsb,
+             const ossimFilename& file)
+{
+   ossimFilename bFile = file.substitute(wsa, wsb);
+
+   if ( !file.exists() )
+   {
+      cout << "\nnotice: wsb file: " << bFile
+           << "\nnotice: wsa file does not exists: " << file
+           << "\nb -> a copy command:"
+           << "\ncp " << bFile << " " << file << "\n"
+           << endl;
+   }
+   if ( !bFile.exists() )
+   {
+      cout << "\nnotice: wsa file: " << file
+           << "\nnotice: wsb file does not exists: " << bFile
+           << "\na -> b copy command:"
+           << "\ncp " << file << " " << bFile << "\n"
+           << endl;
+   }
+
+   if ( file.exists() && bFile.exists() )
+   {
+      std::string command = "diff -w --ignore-matching-lines=\\$Id ";
+      command += file.string();
+      command += " ";
+      command += bFile.string();
+      
+      int status = system( command.c_str() );
+      
+      if ( status != 0 )
+      {
+         cout << "\nnotice files differ:"
+              << "\nwsa file: " << file
+              << "\nwsb file: " << bFile
+              << "\na -> b copy command:"
+              << "\ncp " << file << " " << bFile
+              << "\nb -> a copy command:"
+              << "\ncp " << bFile << " " << file << "\n"
+              << endl;
+      }
+   }
+}
+
+bool isIgnoredFile(const ossimFilename& file)
+{
+   bool status = false;
+
+   if (trace)
+   {
+      cout << "file: " << file << endl;
+   }
+   
+   if ( file.size() )
+   {
+      ossimFilename f = file.file();
+      ossimFilename e = file.ext();
+      
+      if ( ( f == ".git" )                  ||
+           ( f == ".moc" )                  ||
+           ( f == ".svn" )                  ||
+           ( f == "CMakeCache.txt" )        ||
+           ( f == "CMakeFiles" )            ||
+           ( f == "cmake_install.cmake" )   ||
+           ( f == "cmake_uninstall.cmake" ) ||
+           ( f == "CVS" )                   ||
+           ( f == "doc" )                   || 
+           ( f == ".cvsignore" )            ||
+           ( f == "bin" )                   ||
+           ( f == "build" )                 ||
+           ( f == "builds" )                ||
+           ( f == "configure")              ||
+           ( f == "config.log" )            ||
+           ( f == "config.status")          ||
+           ( f == "lib" )                   ||
+           ( f == "Makefile" )              ||
+           ( f == "Makefile.common" )       ||
+           ( f == "make.out" )              ||
+           ( f == "projects")               ||
+           ( f == "wxmac.icns")             ||
+           ( f == "xcode" )                 ||
+           ( e == "d" )                     || // dot d file
+           ( e == "o" )                     || // object file
+           ( e == "obj" )                   ||
+           ( e == "exe" )                   ||
+           ( e == "tmp" )
+           )
+      {
+         status = true;
+      }
+      else if ( file.contains("apps") || file.contains("test") )
+      {
+         if ( file.isDir() ) // Go into apps and test dir.
+         {
+            status = false;
+         }
+         else if ( (e != "h") && (e != "cpp") )
+         {
+            // Ignore binary files. Only diff headers and source files.
+            status = true;
+         }
+      }
+      if ( file[file.size()-1] == '~' )
+      {
+         status = true; // xemacs
+      }
+      
+   } // if ( file.size() )
+   else
+   {
+      status = true; // empty
+   }
+
+   if ( trace && (status == true) )
+   {
+      cout << "ignoring file: " << file << endl;
+   }
+   
+   return status;
+}
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
new file mode 100644
index 0000000..0ee5b9a
--- /dev/null
+++ b/cmake/CMakeLists.txt
@@ -0,0 +1,365 @@
+PROJECT(ossimlabs)
+
+# Allows developer to customize compiler with their own flags (e.g., "-std=c++11")
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{OSSIM_CXX_FLAGS}" )
+
+IF ("${OSSIM_DEV_HOME}"  STREQUAL "")
+  IF ("$ENV{OSSIM_DEV_HOME}"  STREQUAL "")
+    SET(OSSIM_DEV_HOME "${CMAKE_CURRENT_SOURCE_DIR}/../.." CACHE STRING "Cache the OSSIM dev home" FORCE)
+  ELSE()
+    SET(OSSIM_DEV_HOME "$ENV{OSSIM_DEV_HOME}" CACHE STRING "Cache the OSSIM dev home" FORCE)
+  ENDIF()
+ENDIF()
+
+IF ("$ENV{OSSIM_INSTALL_PREFIX}"  STREQUAL "")
+  SET(OSSIM_INSTALL_PREFIX "${OSSIM_DEV_HOME}/install" CACHE STRING "Cache the OSSIM install prefix" FORCE)
+ELSE()
+  SET(OSSIM_INSTALL_PREFIX "$ENV{OSSIM_INSTALL_PREFIX}" CACHE STRING "Cache the OSSIM install prefix" FORCE)
+ENDIF()
+
+IF ("$ENV{OSSIM_DEPENDENCIES}"  STREQUAL "")
+  SET(OSSIM_DEPENDENCIES "${OSSIM_INSTALL_PREFIX}" CACHE STRING "Cache the OSSIM dependency dir" FORCE)
+ELSE()
+  SET(OSSIM_DEPENDENCIES "$ENV{OSSIM_DEPENDENCIES}" CACHE STRING "Cache the OSSIM dependency dir" FORCE)
+ENDIF()
+
+SET(CMAKE_MODULE_PATH "${OSSIM_DEV_HOME}/ossim/cmake/CMakeModules")
+SET(CMAKE_INSTALL_PREFIX ${OSSIM_INSTALL_PREFIX})
+
+IF(NOT OSSIM_BUILD_ADDITIONAL_DIRECTORIES)
+   SET(OSSIM_BUILD_ADDITIONAL_DIRECTORIES "" CACHE PATH "Specify full paths separated by ; to additional libraries you wish to include into the ossim build framework" FORCE)
+ENDIF(NOT OSSIM_BUILD_ADDITIONAL_DIRECTORIES)
+
+INCLUDE(OssimVersion)
+INCLUDE(OssimUtilities)
+INCLUDE(OssimCommonVariables)
+
+IF(NOT APPLE)
+  cmake_minimum_required(VERSION 2.6)
+ELSE(NOT APPLE)
+    cmake_minimum_required(VERSION 2.8)
+ENDIF(NOT APPLE)
+
+
+if(NOT OSSIM_DEV_HOME)
+   MESSAGE(FATAL_ERROR "Please pass in or define the OSSIM_DEV_HOME root path where all modules are located. This includes ossim, ossim-planet, ... etc.")
+ENDIF(NOT OSSIM_DEV_HOME)
+
+#IF(NOT APPLE)
+#  cmake_minimum_required(VERSION 2.6)
+#ELSE(NOT APPLE)
+#  cmake_minimum_required(VERSION 2.8)
+#ENDIF(NOT APPLE)
+
+IF(EXISTS "$ENV{OSSIM_DEPENDENCIES}")
+   SET(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH};$ENV{OSSIM_DEPENDENCIES}/include")
+   SET(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH};$ENV{OSSIM_DEPENDENCIES}/lib")
+   SET(CMAKE_FRAMEWORK_PATH "${CMAKE_FRAMEWORK_PATH};$ENV{OSSIM_DEPENDENCIES}/Frameworks")
+ENDIF(EXISTS "$ENV{OSSIM_DEPENDENCIES}")
+
+
+#######################################################################################################
+#  Initialize the libraries to be the cmake targets and initialize the includes to the proper dev paths
+#######################################################################################################
+
+IF(NOT OSSIM_LIBRARY)
+   SET(OSSIM_LIBRARY "ossim" CACHE STRING "Caching" FORCE)
+ENDIF(NOT OSSIM_LIBRARY)
+
+IF(NOT OSSIM_HOME)
+   SET(OSSIM_HOME "${OSSIM_DEV_HOME}/ossim" CACHE STRING "Caching" FORCE)
+ENDIF(NOT OSSIM_HOME)
+
+IF(NOT OSSIM_INCLUDE_DIR)
+   SET(OSSIM_INCLUDE_DIR "${OSSIM_HOME}/include" CACHE STRING "Caching" FORCE)
+ENDIF(NOT OSSIM_INCLUDE_DIR)
+
+
+#IF(NOT OSSIMPLANETQT_LIBRARY)
+#   SET(OSSIMPLANETQT_LIBRARY "ossimPlanetQt" CACHE STRING "Caching" FORCE)
+#ENDIF(NOT OSSIMPLANETQT_LIBRARY)
+
+#IF(NOT OSSIMPLANETQT_INCLUDE_DIR)
+#   SET(OSSIMPLANETQT_INCLUDE_DIR "${OSSIM_DEV_HOME}/ossimPlanetQt/include" CACHE STRING "Caching" FORCE)
+#ENDIF(NOT OSSIMPLANETQT_INCLUDE_DIR)
+
+#IF(NOT OSSIMQT_LIBRARY)
+#   SET(OSSIMQT_LIBRARY "ossimQt" CACHE STRING "Caching" FORCE)
+#ENDIF(NOT OSSIMQT_LIBRARY)
+
+############################### Add subdirectories to build based on BUILD variables and presence of repo ###########################
+add_subdirectory(${OSSIM_HOME} ${CMAKE_CURRENT_BINARY_DIR}/ossim) 
+
+IF(BUILD_OSSIM_WMS AND EXISTS ${OSSIM_DEV_HOME}/ossim-wms )
+  IF(NOT OSSIMWMS_LIBRARY)
+     SET(OSSIMWMS_LIBRARY "ossim-wms" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OSSIMWMS_LIBRARY)
+
+  IF(NOT OSSIMWMS_INCLUDE_DIR)
+     SET(OSSIMWMS_INCLUDE_DIR "${OSSIM_DEV_HOME}/ossim-wms/include" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OSSIMWMS_INCLUDE_DIR)
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-wms ${CMAKE_CURRENT_BINARY_DIR}/ossim-wms)
+ENDIF()
+
+IF(BUILD_OSSIM_VIDEO AND EXISTS ${OSSIM_DEV_HOME}/ossim-video)
+  IF(NOT OSSIMVIDEO_LIBRARY)
+      SET(OSSIMVIDEO_LIBRARY "ossim-video" CACHE STRING "Caching" FORCE)
+  ENDIF()
+   
+  IF(NOT OSSIMVIDEO_INCLUDE_DIR)
+      SET(OSSIMVIDEO_INCLUDE_DIR "${OSSIM_DEV_HOME}/ossim-video/include" CACHE STRING "Caching" FORCE)
+  ENDIF()
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-video ${CMAKE_CURRENT_BINARY_DIR}/ossim-video)
+ENDIF()
+
+IF(BUILD_OSSIM_MSP AND EXISTS ${OSSIM_DEV_HOME}/ossim-msp)
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-msp ${CMAKE_CURRENT_BINARY_DIR}/ossim-msp)
+ENDIF()
+
+IF(BUILD_OSSIM_ATP AND EXISTS ${OSSIM_DEV_HOME}/ossim-atp)
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-atp ${CMAKE_CURRENT_BINARY_DIR}/ossim-atp)
+ENDIF()
+
+IF(BUILD_OMS AND EXISTS ${OSSIM_DEV_HOME}/ossim-oms)
+  IF(NOT OMS_LIBRARY)
+     SET(OMS_LIBRARY "ossim-oms" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OMS_LIBRARY)
+
+  IF(NOT OMS_INCLUDE_DIR)
+     SET(OMS_INCLUDE_DIR "${OSSIM_DEV_HOME}/ossim-oms/coms/include" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OMS_INCLUDE_DIR)
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-oms ${CMAKE_CURRENT_BINARY_DIR}/ossim-oms)
+ENDIF()
+
+
+IF(BUILD_OSSIM_PLANET AND EXISTS ${OSSIM_DEV_HOME}/ossim-planet)
+  
+  IF(NOT OSSIMPLANET_LIBRARY)
+     SET(OSSIMPLANET_LIBRARY "ossim-planet" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OSSIMPLANET_LIBRARY)
+  IF(NOT OSSIMPLANET_INCLUDE_DIR)
+     SET(OSSIMPLANET_INCLUDE_DIR "${OSSIM_DEV_HOME}/ossim-planet/include" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OSSIMPLANET_INCLUDE_DIR)
+
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-planet ${CMAKE_CURRENT_BINARY_DIR}/ossim-planet)
+ENDIF()
+
+IF(BUILD_OSSIM_PLANET_GUI AND EXISTS ${OSSIM_DEV_HOME}/ossim-planet-gui)
+  IF(NOT OSSIMPLANETGUI_LIBRARY)
+     SET(OSSIMPLANETGUI_LIBRARY "ossim-planet-gui" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OSSIMPLANETGUI_LIBRARY)
+  IF(NOT OSSIMPLANETGUI_INCLUDE_DIR)
+     SET(OSSIMPLANETGUI_INCLUDE_DIR "${OSSIM_DEV_HOME}/ossim-planet-gui/include" CACHE STRING "Caching" FORCE)
+  ENDIF(NOT OSSIMPLANETGUI_INCLUDE_DIR)
+
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-planet-gui ${CMAKE_CURRENT_BINARY_DIR}/ossim-planet-gui)
+ENDIF()
+
+
+IF(BUILD_OSSIM_GUI AND EXISTS ${OSSIM_DEV_HOME}/ossim-gui)
+     add_subdirectory(${OSSIM_DEV_HOME}/ossim-gui ${CMAKE_CURRENT_BINARY_DIR}/ossim-gui)
+ENDIF()
+
+IF(BUILD_OSSIM_QT4 AND EXISTS ${OSSIM_DEV_HOME}/ossim-qt4)
+     add_subdirectory(${OSSIM_DEV_HOME}/ossim-qt4 ${CMAKE_CURRENT_BINARY_DIR}/ossim-qt4)
+ENDIF()
+
+IF(EXISTS ${OSSIM_DEV_HOME}/ossim-plugins)
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-plugins ${CMAKE_CURRENT_BINARY_DIR}/ossim-plugins)
+ENDIF()
+
+IF(OSSIM_BUILD_ADDITIONAL_DIRECTORIES)
+    FOREACH(it IN LISTS OSSIM_BUILD_ADDITIONAL_DIRECTORIES)
+        MESSAGE(STATUS "**********************Adding additional subdirectory ${it}*************************")
+        SUBDIRS(${it})
+    ENDFOREACH(it)
+ENDIF()
+
+IF(BUILD_CSMAPI AND EXISTS ${OSSIM_DEV_HOME}/csmApi)
+    add_subdirectory(${OSSIM_DEV_HOME}/csmApi ${CMAKE_CURRENT_BINARY_DIR}/csmApi)
+ENDIF()
+
+IF(BUILD_DSMG AND EXISTS ${OSSIM_DEV_HOME}/ossim-dsmg)
+  add_subdirectory(${OSSIM_DEV_HOME}/ossim-dsmg ${CMAKE_CURRENT_BINARY_DIR}/ossim-dsmg)
+ENDIF()
+
+
+############################## Doxygen installation for current ossim core module ###########################################
+FIND_PACKAGE(Doxygen)
+
+MACRO(OSSIM_GENERATE_DOXYGEN  DOXYGEN_OUTPUT_DIRECTORY CONFIGURE_FILE WORKING_DIRECTORY DOXYGEN_INPUT BASE_TARGET_NAME CLASS_PREFIX_TO_IGNORE) 
+   
+     SET(DOXYGEN_IGNORE_PREFIX "${CLASS_PREFIX_TO_IGNORE}")
+
+     IF(NOT EXISTS "${DOXYGEN_OUTPUT_DIRECTORY}")
+         make_directory("${DOXYGEN_OUTPUT_DIRECTORY}")
+     ENDIF()
+     CONFIGURE_FILE("${CONFIGURE_FILE}"
+                    "${DOXYGEN_INPUT}" @ONLY IMMEIDATE)
+
+     ADD_CUSTOM_COMMAND(
+       OUTPUT ${DOXYGEN_OUTPUT_DIRECTORY}
+       COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..."
+       COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
+       COMMAND ${CMAKE_COMMAND} -E echo "Done."
+       WORKING_DIRECTORY ${WORKING_DIRECTORY}
+       DEPENDS ${DOXYGEN_INPUT}
+     )
+
+     ADD_CUSTOM_TARGET(${BASE_TARGET_NAME}-doc ALL DEPENDS ${DOXYGEN_OUTPUT_DIRECTORY})
+
+     ADD_CUSTOM_TARGET(${BASE_TARGET_NAME}-doc-forced
+       COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..."
+       COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
+       COMMAND ${CMAKE_COMMAND} -E echo "Done."
+       WORKING_DIRECTORY "${WORKING_DIRECTORY}")
+ENDMACRO(OSSIM_GENERATE_DOXYGEN)
+
+IF (DOXYGEN_FOUND)
+  OPTION(OSSIM_BUILD_DOXYGEN "Set to ON to generate oxygen documentation files" OFF)
+  IF(OSSIM_BUILD_DOXYGEN)
+
+     SET(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/doc/ossim-${OSSIM_VERSION}/ossimApi")
+     OSSIM_GENERATE_DOXYGEN("${DOXYGEN_OUTPUT_DIRECTORY}"
+                      "${OSSIM_DEV_HOME}/ossim/doc/Doxyfile.in"
+                      "${OSSIM_DEV_HOME}/ossim/doc"
+                      "${CMAKE_BINARY_DIR}/OssimDoxyfile"
+                      "ossim-api"
+                      "ossim")
+     FILE(GLOB ossim_docs "${DOXYGEN_OUTPUT_DIRECTORY}/html/*")
+     INSTALL(FILES ${ossim_docs} DESTINATION "share/ossim/${OSSIM_VERSION}/docs/doxygen/ossimapi/html" COMPONENT ossim-doc)
+
+     IF(BUILD_OSSIM_PLANET)
+        SET(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/doc/ossim-${OSSIM_VERSION}/ossimPlanetApi")
+        OSSIM_GENERATE_DOXYGEN("${DOXYGEN_OUTPUT_DIRECTORY}"
+                         "${OSSIM_DEV_HOME}/ossim/Doxyfile.in"
+                         "${OSSIM_DEV_HOME}/ossim-planet"
+                         "${CMAKE_BINARY_DIR}/OssimPlanetDoxyfile"
+                         "ossimPlanet-api"
+                         "ossimPlanet")
+        FILE(GLOB ossim_docs "${DOXYGEN_OUTPUT_DIRECTORY}/html/*")
+        INSTALL(FILES ${ossim_docs} DESTINATION "share/ossim/${OSSIM_VERSION}/docs/doxygen/ossimPlanetApi/html" COMPONENT ossim-doc)
+     ENDIF(BUILD_OSSIM_PLANET)
+
+   ENDIF(OSSIM_BUILD_DOXYGEN)
+ENDIF (DOXYGEN_FOUND)
+
+############################## Setup shared file installation ##############################
+if(EXISTS ${OSSIM_HOME}/share/ossim/geoids/egm96.grd)
+  INSTALL(FILES ${OSSIM_HOME}/share/ossim/geoids/egm96.grd DESTINATION "share/ossim/geoids" COMPONENT ossim)
+ELSE()
+  MESSAGE(WARNING "File ${OSSIM_HOME}/share/ossim/geoids/egm96.grd not found for install!")
+ENDIF()
+# Fonts removed for rpms
+# INSTALL(FILES ${OSSIM_DEV_HOME}/ossim_package_support/fonts/arial.ttf DESTINATION "share/ossim/fonts" COMPONENT ossim)
+# INSTALL(FILES ${OSSIM_DEV_HOME}/ossim_package_support/fonts/times.ttf DESTINATION "share/ossim/fonts" COMPONENT ossim)
+
+FILE(GLOB ossim_cmake_modules ${OSSIM_DEV_HOME}/ossim/cmake/CMakeModules/*.cmake* )
+INSTALL(FILES ${ossim_cmake_modules} DESTINATION share/ossim/CMakeModules COMPONENT ossim)
+
+FILE(GLOB projection_files "${OSSIM_HOME}/share/ossim/projection/*.csv"  "${OSSIM_HOME}/share/ossim/projection/*.txt")
+INSTALL(FILES ${projection_files} DESTINATION share/ossim/projection COMPONENT ossim)
+
+INSTALL(FILES ${OSSIM_HOME}/share/ossim/templates/ossim_preferences_template DESTINATION "share/ossim" COMPONENT ossim RENAME ossim-preferences-template)
+
+############################## Setup the packages ##############################
+# present the packaging option only if we have the cpack command defined (effectively >= 2.6.0)
+IF(CMAKE_CPACK_COMMAND)
+    OPTION(BUILD_OSSIM_PACKAGES "Set to ON to generate CPack configuration files and packaging targets" OFF)
+    IF(BUILD_OSSIM_PACKAGES)
+      INCLUDE(OssimCPack)
+    ENDIF()
+ENDIF()
+
+set(PKGCONFIG_FILES ossim)
+
+foreach(PKGCONFIG_FILE ${PKGCONFIG_FILES})
+  configure_file(${OSSIM_DEV_HOME}/ossim/cmake/packaging/pkgconfig/${PKGCONFIG_FILE}.pc.in
+    ${${PROJECT_NAME}_BINARY_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc
+    @ONLY
+    )
+  INSTALL(FILES ${${PROJECT_NAME}_BINARY_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc DESTINATION lib${LIBSUFFIX}/pkgconfig COMPONENT ossim)
+ENDFOREACH(PKGCONFIG_FILE)
+
+
+#####################################################################################################
+# We may want to add this as a build step instead so it can capture different output directories
+# Will comment out for now until I figure this out.  This is used to symlink the pre built frameworks to the build
+# dir so you can run things within Xcode
+#
+#####################################################################################################
+#IF(APPLE)
+#    IF(MAKE_APPENDS_BUILD_TYPE)
+#        IF(OSSIM_DEPENDENCIES)
+#             IF(NOT EXISTS ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/OpenThreads.framework AND EXISTS ${OSSIM_DEPENDENCIES}/Frameworks)
+#                  FILE(GLOB framework_files "${OSSIM_DEPENDENCIES}/Frameworks/*.framework")
+#                  foreach(x ${framework_files})
+#                     execute_process(COMMAND ln -s  ${x} .
+#                                     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/)
+#                  endforeach(x)
+#             ENDIF()
+#        ENDIF()
+#    ENDIF()
+#ENDIF()
+
+
+############################ setup common INSTALL support files #############################################
+# SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "YES")
+include(InstallRequiredSystemLibraries)
+################################### SETUP Uninstall TARGETS ####################################################
+OSSIM_ADD_COMMON_MAKE_UNINSTALL()
+
+MESSAGE( STATUS "PROJECT_NAME                    = ${PROJECT_NAME}" )
+MESSAGE( STATUS "OSSIM_DEV_HOME                  = ${OSSIM_DEV_HOME}" )
+MESSAGE( STATUS "OSSIM_INSTALL_PREFIX            = ${OSSIM_INSTALL_PREFIX}" )
+MESSAGE( STATUS "OSSIM_DEPENDENCIES              = ${OSSIM_DEPENDENCIES}" )
+MESSAGE( STATUS "CMAKE_CURRENT_BINARY_DIR        = ${CMAKE_CURRENT_BINARY_DIR}" )
+MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR        = ${CMAKE_CURRENT_SOURCE_DIR}" )
+MESSAGE( STATUS "CMAKE_MODULE_PATH               = ${CMAKE_MODULE_PATH}" )
+MESSAGE( STATUS "CMAKE_BUILD_TYPE                = ${CMAKE_BUILD_TYPE}" )
+MESSAGE( STATUS "CMAKE_C_COMPILER                = ${CMAKE_C_COMPILER}" )
+MESSAGE( STATUS "CMAKE_CXX_COMPILER              = ${CMAKE_CXX_COMPILER}" )
+MESSAGE( STATUS "CMAKE_CXX_FLAGS                 = ${CMAKE_CXX_FLAGS}" )
+MESSAGE( STATUS "CMAKE_CXX_FLAGS_DEBUG           = ${CMAKE_CXX_FLAGS_DEBUG}" )
+MESSAGE( STATUS "CMAKE_CXX_FLAGS_RELEASE         = ${CMAKE_CXX_FLAGS_RELEASE}" )
+MESSAGE( STATUS "CMAKE_CXX_DEFINES_DEBUG         = ${CXX_DEFINES}" )
+MESSAGE( STATUS "CMAKE_CXX_DEFINES_RELEASE       = ${CMAKE_CXX_DEFINES}" )
+MESSAGE( STATUS "CMAKE_DEBUG_POSTFIX             = ${CMAKE_DEBUG_POSTFIX}" )
+MESSAGE( STATUS "CMAKE_INCLUDE_PATH              = ${CMAKE_INCLUDE_PATH}" )
+MESSAGE( STATUS "CMAKE_INSTALL_PREFIX            = ${CMAKE_INSTALL_PREFIX}" )
+MESSAGE( STATUS "CMAKE_SHARED_LINKER_FLAGS       = ${CMAKE_SHARED_LINKER_FLAGS}" )
+MESSAGE( STATUS "CMAKE_EXE_LINKER_FLAGS          = ${CMAKE_EXE_LINKER_FLAGS}" )
+MESSAGE( STATUS "COMPILE_DEFINITIONS_DEBUG       = ${COMPILE_DEFINITIONS_DEBUG}" )
+MESSAGE( STATUS "COMPILE_DEFINITIONS_RELEASE     = ${COMPILE_DEFINITIONS_RELEASE}" )
+MESSAGE( STATUS "KAKADU_ROOT_SRC                 = ${KAKADU_ROOT_SRC}")
+MESSAGE( STATUS "KAKADU_AUX_LIBRARY              = ${KAKADU_AUX_LIBRARY}")
+MESSAGE( STATUS "KAKADU_LIBRARY                  = ${KAKADU_LIBRARY}")
+MESSAGE( STATUS "MPI_LIBRARY                     = ${MPI_LIBRARIES}" )
+MESSAGE( STATUS "MPI_INCLUDE                     = ${MPI_INCLUDE_PATH}" )
+MESSAGE( STATUS "OPENTHREADS_LIBRARY             = ${OPENTHREADS_LIBRARY}" )
+MESSAGE( STATUS "OPENTHREADS_INCLUDE             = ${OPENTHREADS_INCLUDE_DIR}" )
+MESSAGE( STATUS "OSSIM_COMPILE_WITH_FULL_WARNING = ${OSSIM_COMPILE_WITH_FULL_WARNING}" )
+MESSAGE( STATUS "OSSIM_COMMON_COMPILER_FLAGS     = ${OSSIM_COMMON_COMPILER_FLAGS}" )
+MESSAGE( STATUS "OSSIM_LIBRARY                   = ${OSSIM_LIBRARY}" )
+MESSAGE( STATUS "OSSIM_INCLUDE_DIR               = ${OSSIM_INCLUDE_DIR}" )
+MESSAGE( STATUS "TIFF_LIBRARY                    = ${TIFF_LIBRARIES}" )
+MESSAGE( STATUS "TIFF_INCLUDE                    = ${TIFF_INCLUDE_DIR}" )
+MESSAGE( STATUS "ZLIB_LIBRARY                    = ${ZLIB_LIBRARIES}" )
+MESSAGE( STATUS "ZLIB_INCLUDE                    = ${ZLIB_INCLUDE_DIR}" )
+MESSAGE( STATUS "BUILD_OMS                       = ${BUILD_OMS}" )
+MESSAGE( STATUS "BUILD_OSSIM                     = ${BUILD_OSSIM}" )
+MESSAGE( STATUS "BUILD_OSSIM_FREETYPE_SUPPORT    = ${BUILD_OSSIM_FREETYPE_SUPPORT}" )
+MESSAGE( STATUS "BUILD_OSSIM_GUI                 = ${BUILD_OSSIM_GUI}" )
+MESSAGE( STATUS "BUILD_OSSIMJNI                  = ${BUILD_OSSIMJNI}" )
+MESSAGE( STATUS "BUILD_OSSIM_QT4                 = ${BUILD_OSSIM_QT4}" )
+MESSAGE( STATUS "BUILD_OSSIM_MPI_SUPPORT         = ${BUILD_OSSIM_MPI_SUPPORT}" )
+MESSAGE( STATUS "BUILD_OSSIM_PLANET              = ${BUILD_OSSIM_PLANET}" )
+MESSAGE( STATUS "BUILD_OSSIMPLANETQT             = ${BUILD_OSSIMPLANETQT}" )
+MESSAGE( STATUS "BUILD_OSSIM_VIDEO               = ${BUILD_OSSIM_VIDEO}" )
+MESSAGE( STATUS "BUILD_OSSIM_WMS                 = ${BUILD_OSSIM_WMS}" )
+MESSAGE( STATUS "BUILD_LIBRARY_DIR               = ${BUILD_LIBRARY_DIR}" )
+MESSAGE( STATUS "BUILD_RUNTIME_DIR               = ${BUILD_RUNTIME_DIR}" )
+MESSAGE( STATUS "BUILD_DSMG                      = ${BUILD_DSMG}" )
+MESSAGE( STATUS "BUILD_OSSIM_MSP                 = ${BUILD_OSSIM_MSP}" )
+MESSAGE( STATUS "BUILD_OSSIM_ATP                 = ${BUILD_OSSIM_ATP}" )
+MESSAGE( STATUS "Use OSSIM_BUILD_ADDITIONAL_DIRECTORIES to add other cmake builds." )
diff --git a/cmake/CMakeModules/CMakeParseArguments.cmake b/cmake/CMakeModules/CMakeParseArguments.cmake
new file mode 100644
index 0000000..8553f38
--- /dev/null
+++ b/cmake/CMakeModules/CMakeParseArguments.cmake
@@ -0,0 +1,161 @@
+#.rst:
+# CMakeParseArguments
+# -------------------
+#
+#
+#
+# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords>
+# <multi_value_keywords> args...)
+#
+# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions
+# for parsing the arguments given to that macro or function.  It
+# processes the arguments and defines a set of variables which hold the
+# values of the respective options.
+#
+# The <options> argument contains all options for the respective macro,
+# i.e.  keywords which can be used when calling the macro without any
+# value following, like e.g.  the OPTIONAL keyword of the install()
+# command.
+#
+# The <one_value_keywords> argument contains all keywords for this macro
+# which are followed by one value, like e.g.  DESTINATION keyword of the
+# install() command.
+#
+# The <multi_value_keywords> argument contains all keywords for this
+# macro which can be followed by more than one value, like e.g.  the
+# TARGETS or FILES keywords of the install() command.
+#
+# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
+# keywords listed in <options>, <one_value_keywords> and
+# <multi_value_keywords> a variable composed of the given <prefix>
+# followed by "_" and the name of the respective keyword.  These
+# variables will then hold the respective value from the argument list.
+# For the <options> keywords this will be TRUE or FALSE.
+#
+# All remaining arguments are collected in a variable
+# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see
+# whether your macro was called with unrecognized parameters.
+#
+# As an example here a my_install() macro, which takes similar arguments
+# as the real install() command:
+#
+# ::
+#
+#    function(MY_INSTALL)
+#      set(options OPTIONAL FAST)
+#      set(oneValueArgs DESTINATION RENAME)
+#      set(multiValueArgs TARGETS CONFIGURATIONS)
+#      cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}"
+#                            "${multiValueArgs}" ${ARGN} )
+#      ...
+#
+#
+#
+# Assume my_install() has been called like this:
+#
+# ::
+#
+#    my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
+#
+#
+#
+# After the cmake_parse_arguments() call the macro will have set the
+# following variables:
+#
+# ::
+#
+#    MY_INSTALL_OPTIONAL = TRUE
+#    MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
+#    MY_INSTALL_DESTINATION = "bin"
+#    MY_INSTALL_RENAME = "" (was not used)
+#    MY_INSTALL_TARGETS = "foo;bar"
+#    MY_INSTALL_CONFIGURATIONS = "" (was not used)
+#    MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
+#
+#
+#
+# You can then continue and process these variables.
+#
+# Keywords terminate lists of values, e.g.  if directly after a
+# one_value_keyword another recognized keyword follows, this is
+# interpreted as the beginning of the new option.  E.g.
+# my_install(TARGETS foo DESTINATION OPTIONAL) would result in
+# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION
+# would be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
+
+#=============================================================================
+# Copyright 2010 Alexander Neundorf <neundorf at kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+
+if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
+  return()
+endif()
+set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
+
+
+function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
+  # first set all result variables to empty/FALSE
+  foreach(arg_name ${_singleArgNames} ${_multiArgNames})
+    set(${prefix}_${arg_name})
+  endforeach()
+
+  foreach(option ${_optionNames})
+    set(${prefix}_${option} FALSE)
+  endforeach()
+
+  set(${prefix}_UNPARSED_ARGUMENTS)
+
+  set(insideValues FALSE)
+  set(currentArgName)
+
+  # now iterate over all arguments and fill the result variables
+  foreach(currentArg ${ARGN})
+    list(FIND _optionNames "${currentArg}" optionIndex)  # ... then this marks the end of the arguments belonging to this keyword
+    list(FIND _singleArgNames "${currentArg}" singleArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
+    list(FIND _multiArgNames "${currentArg}" multiArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
+
+    if(${optionIndex} EQUAL -1  AND  ${singleArgIndex} EQUAL -1  AND  ${multiArgIndex} EQUAL -1)
+      if(insideValues)
+        if("${insideValues}" STREQUAL "SINGLE")
+          set(${prefix}_${currentArgName} ${currentArg})
+          set(insideValues FALSE)
+        elseif("${insideValues}" STREQUAL "MULTI")
+          list(APPEND ${prefix}_${currentArgName} ${currentArg})
+        endif()
+      else()
+        list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
+      endif()
+    else()
+      if(NOT ${optionIndex} EQUAL -1)
+        set(${prefix}_${currentArg} TRUE)
+        set(insideValues FALSE)
+      elseif(NOT ${singleArgIndex} EQUAL -1)
+        set(currentArgName ${currentArg})
+        set(${prefix}_${currentArgName})
+        set(insideValues "SINGLE")
+      elseif(NOT ${multiArgIndex} EQUAL -1)
+        set(currentArgName ${currentArg})
+        set(${prefix}_${currentArgName})
+        set(insideValues "MULTI")
+      endif()
+    endif()
+
+  endforeach()
+
+  # propagate the result variables to the caller:
+  foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
+    set(${prefix}_${arg_name}  ${${prefix}_${arg_name}} PARENT_SCOPE)
+  endforeach()
+  set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
+
+endfunction()
diff --git a/cmake/CMakeModules/FindAWS.cmake b/cmake/CMakeModules/FindAWS.cmake
new file mode 100644
index 0000000..cb5c0d2
--- /dev/null
+++ b/cmake/CMakeModules/FindAWS.cmake
@@ -0,0 +1,93 @@
+#---
+# File: FindAWS.cmake
+#
+# Find the native AWS(Amazon Web Services) cpp sdk includes and libraries.
+#
+# This module defines:
+#
+# AWS_INCLUDE_DIR, where to find Aws.h and S3Client.h.
+# AWS_LIBRARIES, libraries to link against to use AWS.  Currently there are
+# two looked for, aws-cpp-sdk-core and aws-cpp-sdk-s3 libraries.
+# AWS_FOUND, True if found, false if one of the above are not found.
+# 
+# For ossim, typically geos will be system installed which should be found; 
+# or found in the ossim 3rd party dependencies directory from a geos build 
+# and install.  If the latter it will rely on CMAKE_INCLUDE_PATH and 
+# CMAKE_LIBRARY_PATH having the path to the party dependencies directory.
+# 
+# NOTE: 
+# This script is specialized for ossim.
+#
+# $Id$
+#---
+
+#---
+# Find include path:
+#---
+find_path( AWS_CORE_INCLUDE_DIR aws/core/Aws.h
+           PATHS 
+           ${CMAKE_INSTALL_PREFIX}/include
+           $ENV{AWS_DIR}/include
+           ${AWS_DIR}/include
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+# We need this so check for it:
+find_path( AWS_S3_INCLUDE_DIR aws/s3/S3Client.h
+           PATHS 
+           ${CMAKE_INSTALL_PREFIX}/include
+           $ENV{AWS_DIR}/include
+           ${AWS_DIR}/include
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+# Set the AWS_INCLUDE_DIR:
+if( AWS_CORE_INCLUDE_DIR AND AWS_S3_INCLUDE_DIR )
+   set( AWS_INCLUDE_DIR ${AWS_CORE_INCLUDE_DIR} CACHE STRING INTERNAL )
+endif( AWS_CORE_INCLUDE_DIR AND AWS_S3_INCLUDE_DIR )
+
+# Find AWS CPP SDK CORE library:
+find_library( AWS_CORE_LIB NAMES aws-cpp-sdk-core 
+              PATHS
+              ${CMAKE_INSTALL_PREFIX}/lib64
+              ${CMAKE_INSTALL_PREFIX}/lib
+              /usr/lib64 
+              /usr/lib )
+
+# Find AWS CPP SDK S3 library:
+find_library( AWS_S3_LIB NAMES aws-cpp-sdk-s3
+              PATHS 
+              ${CMAKE_INSTALL_PREFIX}/lib64
+              ${CMAKE_INSTALL_PREFIX}/lib
+              /usr/lib64 
+              /usr/lib )
+
+# Set the AWS_LIBRARY:
+if( AWS_CORE_LIB AND AWS_S3_LIB )
+   set( AWS_LIBRARIES ${AWS_CORE_LIB} ${AWS_S3_LIB} CACHE STRING INTERNAL )
+endif(AWS_CORE_LIB AND AWS_S3_LIB )
+
+#---
+# This function sets AWS_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( AWS DEFAULT_MSG 
+                                   AWS_LIBRARIES
+                                   AWS_INCLUDE_DIR )
+
+if( AWS_FOUND )
+   if( NOT AWS_FIND_QUIETLY )
+      message( STATUS "Found AWS..." )
+   endif( NOT AWS_FIND_QUIETLY )
+else( AWS_FOUND )
+   if( NOT AWS_FIND_QUIETLY )
+      message( WARNING "Could not find AWS" )
+   endif( NOT AWS_FIND_QUIETLY )
+endif( AWS_FOUND )
+
+if( NOT AWS_FIND_QUIETLY )
+   message( STATUS "AWS_INCLUDE_DIR=${AWS_INCLUDE_DIR}" )
+   message( STATUS "AWS_LIBRARIES=${AWS_LIBRARIES}" )
+endif( NOT AWS_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindCPPUNIT.cmake b/cmake/CMakeModules/FindCPPUNIT.cmake
new file mode 100644
index 0000000..e536d4e
--- /dev/null
+++ b/cmake/CMakeModules/FindCPPUNIT.cmake
@@ -0,0 +1,43 @@
+# - Find CPPUNIT
+# Find the native CPPUNIT includes and library
+# This module defines
+#  CPPUNIT_INCLUDE_DIR, where to find jpeglib.h, etc.
+#  CPPUNIT_LIBRARIES, the libraries needed to use CPPUNIT.
+#  CPPUNIT_FOUND, If false, do not try to use CPPUNIT.
+# also defined, but not for general use are
+#  CPPUNIT_LIBRARY, where to find the CPPUNIT library.
+
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/Test.h)
+
+SET(CPPUNIT_NAMES ${CPPUNIT_NAMES} cppunit libcppunit)
+FIND_LIBRARY(CPPUNIT_LIBRARY NAMES ${CPPUNIT_NAMES} )
+
+# handle the QUIETLY and REQUIRED arguments and set CPPUNIT_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR)
+
+IF(CPPUNIT_FOUND)
+  SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY})
+ENDIF(CPPUNIT_FOUND)
+
+# Deprecated declarations.
+SET (NATIVE_CPPUNIT_INCLUDE_PATH ${CPPUNIT_INCLUDE_DIR} )
+IF(CPPUNIT_LIBRARY)
+  GET_FILENAME_COMPONENT (NATIVE_CPPUNIT_LIB_PATH ${CPPUNIT_LIBRARY} PATH)
+ENDIF(CPPUNIT_LIBRARY)
+
+MARK_AS_ADVANCED(CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR )
diff --git a/cmake/CMakeModules/FindCsmApi.cmake b/cmake/CMakeModules/FindCsmApi.cmake
new file mode 100644
index 0000000..1e80ad1
--- /dev/null
+++ b/cmake/CMakeModules/FindCsmApi.cmake
@@ -0,0 +1,48 @@
+# - Find csmApi library
+# Find the native csmApi includes and library
+# This module defines
+#  CSMAPI_INCLUDE_DIRS, where to find cam api headers, etc.
+#  CSMAPI_LIBRARIES, libraries to link against to use csmApi.
+#  CSMAPI_FOUND, If false, do not try to use csmApi.
+# also defined, but not for general use are
+#  CSMAPI_LIBRARY, where to find the CSMAPI library.
+SET(CMAKE_FIND_FRAMEWORK "LAST")
+FIND_PATH(CSMAPI_INCLUDE_DIRS csm/csm.h
+        PATHS
+        $ENV{MSP_HOME}/include/common
+        ${OSSIM_DEPENDENCIES}/include
+		${OSSIM_INSTALL_PREFIX}/include
+)
+
+set(CSMAPI_NAMES ${CSMAPI_NAMES} MSPcsm csmapi )
+find_library(CSMAPI_LIBRARY NAMES ${CSMAPI_NAMES}
+   PATHS
+      $ENV{MSP_HOME}/lib
+      ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX}
+      ${OSSIM_DEPENDENCIES}/lib
+      ${OSSIM_INSTALL_PREFIX}
+)
+
+#---
+# This function sets CSMAPI_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( CSMAPI DEFAULT_MSG 
+                                   CSMAPI_LIBRARY 
+                                   CSMAPI_INCLUDE_DIRS )
+
+if(CSMAPI_FOUND)
+   set( CSMAPI_LIBRARIES ${CSMAPI_LIBRARY} )
+   set( CSMAPI_INCLUDES  ${CSMAPI_INCLUDE_DIRS} )
+else( CSMAPI_FOUND )
+   if( NOT CSMAPI_FIND_QUIETLY )
+      message( WARNING "Could not find CSMAPI" )
+   endif( NOT CSMAPI_FIND_QUIETLY )
+endif(CSMAPI_FOUND)
+
+if( NOT CSMAPI_FIND_QUIETLY )
+   message( STATUS "CSMAPI_INCLUDE_DIRS=${CSMAPI_INCLUDE_DIRS}" )
+   message( STATUS "CSMAPI_LIBRARIES=${CSMAPI_LIBRARIES}" )
+endif( NOT CSMAPI_FIND_QUIETLY )
+
+mark_as_advanced(CSMAPI_INCLUDES CSMAPI_INCLUDE_DIRS CSMAPI_LIBRARIES)
diff --git a/cmake/CMakeModules/FindFFTW3.cmake b/cmake/CMakeModules/FindFFTW3.cmake
new file mode 100644
index 0000000..63f85fd
--- /dev/null
+++ b/cmake/CMakeModules/FindFFTW3.cmake
@@ -0,0 +1,24 @@
+# - Find fftw3 library
+# Find the native fftw3 includes and library
+# This module defines
+#  FFTW3_INCLUDE_DIR, where to find tiff.h, etc.
+#  FFTW3_LIBRARIES, libraries to link against to use FFTW3.
+#  FFTW3_FOUND, If false, do not try to use FFTW3.
+# also defined, but not for general use are
+#  FFTW3_LIBRARY, where to find the FFTW3 library.
+
+FIND_PATH(FFTW3_INCLUDE_DIR fftw3.h)
+
+SET(FFTW3_NAMES ${FFTW3_NAMES} fftw3 libfftw3)
+FIND_LIBRARY(FFTW3_LIBRARY NAMES ${FFTW3_NAMES} )
+
+# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW3  DEFAULT_MSG  FFTW3_LIBRARY  FFTW3_INCLUDE_DIR)
+
+IF(FFTW3_FOUND)
+  SET( FFTW3_LIBRARIES ${FFTW3_LIBRARY} )
+ENDIF(FFTW3_FOUND)
+
+MARK_AS_ADVANCED(FFTW3_INCLUDE_DIR FFTW3_LIBRARY)
diff --git a/cmake/CMakeModules/FindFFmpeg.cmake b/cmake/CMakeModules/FindFFmpeg.cmake
new file mode 100644
index 0000000..5d6cbb1
--- /dev/null
+++ b/cmake/CMakeModules/FindFFmpeg.cmake
@@ -0,0 +1,190 @@
+# Locate ffmpeg
+# This module defines
+# FFMPEG_LIBRARIES
+# FFMPEG_FOUND, if false, do not try to link to ffmpeg
+# FFMPEG_INCLUDE_DIR, where to find the headers
+#
+# $FFMPEG_DIR is an environment variable that would
+# correspond to the ./configure --prefix=$FFMPEG_DIR
+#
+# Created by Robert Osfield.
+
+
+#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
+#In OSG ffmpeg plugin, we use "#include <header.h>" for compatibility with old version of ffmpeg
+
+#We have to search the path which contain the header.h (usefull for old version)
+#and search the path which contain the libname/header.h (usefull for new version)
+
+#Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code)
+#                                                       (in new version case, use by ffmpeg header) 
+#and ${FFMPEG_libname_INCLUDE_DIRS/libname}             (in new version case, use by osg plugin code)
+
+
+# Macro to find header and lib directories
+# example: FFMPEG_FIND(AVFORMAT avformat avformat.h)
+MACRO(FFMPEG_FIND varname shortname headername)
+    # old version of ffmpeg put header in $prefix/include/[ffmpeg]
+    # so try to find header in include directory
+
+    FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS lib${shortname}/${headername}
+        PATHS
+        ${FFMPEG_ROOT}/include
+        $ENV{FFMPEG_DIR}/include
+        ~/Library/Frameworks
+        /Library/Frameworks
+        /usr/local/include
+        /usr/include
+        /sw/include # Fink
+        /opt/local/include # DarwinPorts
+        /opt/csw/include # Blastwave
+        /opt/include
+        /usr/freeware/include
+        PATH_SUFFIXES ffmpeg
+        DOC "Location of FFMPEG Headers"
+    )
+
+    if( FFMPEG_${varname}_INCLUDE_DIRS-NOTFOUND )
+       FIND_PATH(FFMPEG_${varname}_INCLUDE_DIRS ${headername}
+          PATHS
+          ${FFMPEG_ROOT}/include
+          $ENV{FFMPEG_DIR}/include
+          ~/Library/Frameworks
+          /Library/Frameworks
+          /usr/local/include
+          /usr/include
+          /sw/include # Fink
+          /opt/local/include # DarwinPorts
+          /opt/csw/include # Blastwave
+          /opt/include
+          /usr/freeware/include
+          PATH_SUFFIXES ffmpeg
+          DOC "Location of FFMPEG Headers"
+       )
+    endif ( FFMPEG_${varname}_INCLUDE_DIRS-NOTFOUND )
+
+    FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES
+        NAMES ${shortname}
+        PATHS
+        ${FFMPEG_ROOT}/lib
+        $ENV{FFMPEG_DIR}/lib
+        ~/Library/Frameworks
+        /Library/Frameworks
+        /usr/local/lib
+        /usr/local/lib64
+        /usr/lib
+        /usr/lib64
+        /sw/lib
+        /opt/local/lib
+        /opt/csw/lib
+        /opt/lib
+        /usr/freeware/lib64
+        DOC "Location of FFMPEG Libraries"
+    )
+
+    IF (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
+        SET(FFMPEG_${varname}_FOUND 1)
+    ENDIF(FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS)
+
+ENDMACRO(FFMPEG_FIND)
+
+SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
+
+# find stdint.h
+IF(WIN32)
+
+    FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
+        PATHS
+        ${FFMPEG_ROOT}/include
+        $ENV{FFMPEG_DIR}/include
+        ~/Library/Frameworks
+        /Library/Frameworks
+        /usr/local/include
+        /usr/include
+        /sw/include # Fink
+        /opt/local/include # DarwinPorts
+        /opt/csw/include # Blastwave
+        /opt/include
+        /usr/freeware/include
+        PATH_SUFFIXES ffmpeg
+        DOC "Location of FFMPEG stdint.h Header"
+    )
+
+    IF (FFMPEG_STDINT_INCLUDE_DIR)
+        SET(STDINT_OK TRUE)
+    ENDIF()
+
+ELSE()
+
+    SET(STDINT_OK TRUE)
+
+ENDIF()
+
+FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
+FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
+FFMPEG_FIND(LIBAVCODEC  avcodec  avcodec.h)
+FFMPEG_FIND(LIBAVUTIL   avutil   avutil.h)
+# FFMPEG_FIND(LIBAVCORE   avcore   avcore.h)
+FFMPEG_FIND(LIBSWSCALE  swscale  swscale.h)  
+FFMPEG_FIND(LIBSWRESAMPLE  swresample swresample.h)  
+FFMPEG_FIND(LIBAVFILTER avfilter avfilter.h)
+
+SET(FFMPEG_FOUND "NO")
+# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
+IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK)
+
+    SET(FFMPEG_FOUND "YES")
+
+    SET( FFMPEG_INCLUDE_DIRS
+         ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
+         ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}
+         ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
+         ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
+         ${FFMPEG_LIBSWSCALE_INCLUDE_DIRS}
+         ${FFMPEG_LIBAVFILTER_INCLUDE_DIRS}
+         ${FFMPEG_LIBSWRESAMPLE_INCLUDE_DIRS} )
+
+    SET(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBAVFORMAT_LIBRARY_DIRS})
+
+    # Note we don't add FFMPEG_LIBSWSCALE_LIBRARIES here, it will be added if found later.
+    SET(FFMPEG_LIBRARIES
+        ${FFMPEG_LIBAVCODEC_LIBRARIES}
+        ${FFMPEG_LIBAVFORMAT_LIBRARIES}
+        ${FFMPEG_LIBAVDEVICE_LIBRARIES}
+        ${FFMPEG_LIBAVUTIL_LIBRARIES}
+        ${FFMPEG_LIBSWSCALE_LIBRARIES})
+        
+    IF(FFMPEG_LIBAVFILTER_LIBRARIES)
+      SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_LIBAVFILTER_LIBRARIES})
+    ENDIF()
+    IF(FFMPEG_LIBSWRESAMPLE_LIBRARIES)
+      SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_LIBSWRESAMPLE_LIBRARIES})
+    ENDIF()
+
+    IF (FFMPEG_LIBAVCORE_FOUND)
+        SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_LIBAVCORE_LIBRARIES} )
+        SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS}
+              ${FFMPEG_LIBAVCORE_INCLUDE_DIRS} ${FFMPEG_LIBAVCORE_INCLUDE_DIRS}/libavformat
+           )
+    ENDIF()
+   
+#---
+# This function sets FFMPEG_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( FFMPEG DEFAULT_MSG 
+                                   FFMPEG_LIBRARIES
+                                   FFMPEG_INCLUDE_DIRS )
+
+
+#  use aPPEND instead of set.  Seems to work better
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_CONSTANT_MACROS")
+
+ELSE ()
+   MESSAGE(STATUS "Could not find FFMPEG")
+ENDIF()
+
+if( NOT FFMPEG_FIND_QUIETLY )
+   message( STATUS "FFMPEG_INCLUDE_DIRS = ${FFMPEG_INCLUDE_DIRS}" )
+   message( STATUS "FFMPEG_LIBRARIES = ${FFMPEG_LIBRARIES}" )
+endif( NOT FFMPEG_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindFreetype.cmake b/cmake/CMakeModules/FindFreetype.cmake
new file mode 100644
index 0000000..7d46d15
--- /dev/null
+++ b/cmake/CMakeModules/FindFreetype.cmake
@@ -0,0 +1,164 @@
+#.rst:
+# FindFreetype
+# ------------
+#
+# Locate FreeType library
+#
+# This module defines
+#
+# ::
+#
+#   FREETYPE_LIBRARIES, the library to link against
+#   FREETYPE_FOUND, if false, do not try to link to FREETYPE
+#   FREETYPE_INCLUDE_DIRS, where to find headers.
+#   FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
+#   This is the concatenation of the paths:
+#   FREETYPE_INCLUDE_DIR_ft2build
+#   FREETYPE_INCLUDE_DIR_freetype2
+#
+#
+#
+# $FREETYPE_DIR is an environment variable that would correspond to the
+# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE.
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+# Created by Eric Wing.
+# Modifications by Alexander Neundorf.
+# This file has been renamed to "FindFreetype.cmake" instead of the correct
+# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
+
+# Ugh, FreeType seems to use some #include trickery which
+# makes this harder than it should be. It looks like they
+# put ft2build.h in a common/easier-to-find location which
+# then contains a #include to a more specific header in a
+# more specific location (#include <freetype/config/ftheader.h>).
+# Then from there, they need to set a bunch of #define's
+# so you can do something like:
+# #include FT_FREETYPE_H
+# Unfortunately, using CMake's mechanisms like include_directories()
+# wants explicit full paths and this trickery doesn't work too well.
+# I'm going to attempt to cut out the middleman and hope
+# everything still works.
+find_path(
+  FREETYPE_INCLUDE_DIR_ft2build
+  ft2build.h
+  HINTS
+    ENV FREETYPE_DIR
+  PATHS
+    /usr/X11R6
+    /usr/local/X11R6
+    /usr/local/X11
+    /usr/freeware
+    ENV GTKMM_BASEPATH
+    [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
+  PATH_SUFFIXES
+    include/freetype2
+    include
+    freetype2
+)
+
+find_path(
+  FREETYPE_INCLUDE_DIR_freetype2
+  NAMES
+    freetype/config/ftheader.h
+    config/ftheader.h
+  HINTS
+    ENV FREETYPE_DIR
+  PATHS
+    /usr/X11R6
+    /usr/local/X11R6
+    /usr/local/X11
+    /usr/freeware
+    ENV GTKMM_BASEPATH
+    [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
+  PATH_SUFFIXES
+    include/freetype2
+    include
+    freetype2
+)
+
+find_library(FREETYPE_LIBRARY
+  NAMES
+    freetype
+    libfreetype
+    freetype219
+  HINTS
+    ENV FREETYPE_DIR
+  PATHS
+    /usr/X11R6
+    /usr/local/X11R6
+    /usr/local/X11
+    /usr/freeware
+    ENV GTKMM_BASEPATH
+    [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
+    [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
+  PATH_SUFFIXES
+    lib
+)
+
+# set the user variables
+if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
+  set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
+  list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
+endif()
+set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
+
+if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+  set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
+elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
+  set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
+endif()
+
+if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
+  file(STRINGS "${FREETYPE_H}" freetype_version_str
+       REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
+
+  unset(FREETYPE_VERSION_STRING)
+  foreach(VPART MAJOR MINOR PATCH)
+    foreach(VLINE ${freetype_version_str})
+      if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$")
+        set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}")
+        if(FREETYPE_VERSION_STRING)
+          set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
+        else()
+          set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
+        endif()
+        unset(FREETYPE_VERSION_PART)
+      endif()
+    endforeach()
+  endforeach()
+endif()
+
+
+# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
+# all listed variables are TRUE
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+find_package_handle_standard_args(
+  Freetype
+  REQUIRED_VARS
+    FREETYPE_LIBRARY
+    FREETYPE_INCLUDE_DIRS
+  VERSION_VAR
+    FREETYPE_VERSION_STRING
+)
+
+mark_as_advanced(
+  FREETYPE_LIBRARY
+  FREETYPE_INCLUDE_DIR_freetype2
+  FREETYPE_INCLUDE_DIR_ft2build
+)
diff --git a/cmake/CMakeModules/FindGEOS.cmake b/cmake/CMakeModules/FindGEOS.cmake
new file mode 100644
index 0000000..d4f5ec8
--- /dev/null
+++ b/cmake/CMakeModules/FindGEOS.cmake
@@ -0,0 +1,89 @@
+#---
+# File: FindGEOS.cmake
+#
+# Find the native GEOS(Geometry Engine - Open Source) includes and libraries.
+#
+# This module defines:
+#
+# GEOS_INCLUDE_DIR, where to find geos.h, etc.
+# GEOS_LIBRARY, libraries to link against to use GEOS.  Currently there are
+# two looked for, geos and geos_c libraries.
+# GEOS_FOUND, True if found, false if one of the above are not found.
+# 
+# For ossim, typically geos will be system installed which should be found; 
+# or found in the ossim 3rd party dependencies directory from a geos build 
+# and install.  If the latter it will rely on CMAKE_INCLUDE_PATH and 
+# CMAKE_LIBRARY_PATH having the path to the party dependencies directory.
+# 
+# NOTE: 
+# This script is specialized for ossim, e.g. looking in /usr/local/ossim.
+#
+# $Id$
+#---
+
+#---
+# Find include path:
+# Note: Ubuntu 14.04+ did not have geos.h (not included in any ossim src). 
+# Instead looking for Geometry.h
+#---
+
+find_path( GEOS_INCLUDE_DIR geos/geom/Geometry.h
+           PATHS 
+           ${CMAKE_INSTALL_PREFIX}/include
+           $ENV{GEOS_DIR}/include
+           ${GEOS_DIR}/include
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+# Find GEOS library:
+find_library( GEOS_LIB NAMES geos 
+              PATHS
+              ${CMAKE_INSTALL_PREFIX}/lib
+              ${OSSIM_DEPENCIES}/lib
+              $ENV{GEOS_DIR}/lib
+              ${GEOS_DIR}/lib
+              /usr/lib64 
+              /usr/lib
+              /usr/local/lib
+              /usr/local/ossim/lib )
+
+# Find GEOS C library:
+find_library( GEOS_C_LIB NAMES geos_c 
+              PATHS 
+              ${CMAKE_INSTALL_PREFIX}/lib
+              ${OSSIM_DEPENCIES}/lib
+              $ENV{GEOS_DIR}/lib
+              ${GEOS_DIR}/lib
+              /usr/lib64 
+              /usr/lib 
+              /usr/local/lib
+              /usr/local/ossim/lib )
+
+# Set the GEOS_LIBRARY:
+if( GEOS_LIB AND GEOS_C_LIB )
+   set( GEOS_LIBRARY ${GEOS_LIB} ${GEOS_C_LIB} CACHE STRING INTERNAL )
+endif(GEOS_LIB AND GEOS_C_LIB )
+
+#---
+# This function sets GEOS_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( GEOS DEFAULT_MSG 
+                                   GEOS_LIBRARY 
+                                   GEOS_INCLUDE_DIR )
+
+if( GEOS_FOUND )
+   if( NOT GEOS_FIND_QUIETLY )
+      message( STATUS "Found GEOS..." )
+   endif( NOT GEOS_FIND_QUIETLY )
+else( GEOS_FOUND )
+   if( NOT GEOS_FIND_QUIETLY )
+      message( WARNING "Could not find GEOS" )
+   endif( NOT GEOS_FIND_QUIETLY )
+endif( GEOS_FOUND )
+
+if( NOT GEOS_FIND_QUIETLY )
+   message( STATUS "GEOS_INCLUDE_DIR=${GEOS_INCLUDE_DIR}" )
+   message( STATUS "GEOS_LIBRARY=${GEOS_LIBRARY}" )
+endif( NOT GEOS_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindGEOTIFF.cmake b/cmake/CMakeModules/FindGEOTIFF.cmake
new file mode 100644
index 0000000..a06a151
--- /dev/null
+++ b/cmake/CMakeModules/FindGEOTIFF.cmake
@@ -0,0 +1,39 @@
+# - Find geotiff library
+# Find the native geotiff includes and library
+# This module defines
+#  GEOTIFF_INCLUDE_DIR, where to find tiff.h, etc.
+#  GEOTIFF_LIBRARIES, libraries to link against to use GEOTIFF.
+#  GEOTIFF_FOUND, If false, do not try to use GEOTIFF.
+# also defined, but not for general use are
+#  GEOTIFF_LIBRARY, where to find the GEOTIFF library.
+
+FIND_PATH(GEOTIFF_INCLUDE_DIR geotiff.h 
+          PATHS 
+          $ENV{GEOTIFF_DIR}/include
+          ${CMAKE_INSTALL_PREFIX}/include
+          /usr/include/geotiff 
+          /usr/include/libgeotiff 
+          /usr/local/include/libgeotiff 
+          /usr/local/include/geotiff)
+
+SET(GEOTIFF_NAMES ${GEOTIFF_NAMES} geotiff_i geotiff libgeotiff_i libgeotiff)
+FIND_LIBRARY(GEOTIFF_LIBRARY 
+             NAMES ${GEOTIFF_NAMES}
+             PATHS 
+             $ENV{GEOTIFF_DIR}/lib
+             $ENV{GEOTIFF_DIR}/lib64
+             ${CMAKE_INSTALL_PREFIX}/lib 
+             /usr/local/lib 
+             /usr/lib 
+             /usr/lib/x86_64-linux-gnu)
+
+# handle the QUIETLY and REQUIRED arguments and set GEOTIFF_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GEOTIFF  DEFAULT_MSG  GEOTIFF_LIBRARY  GEOTIFF_INCLUDE_DIR)
+
+IF(GEOTIFF_FOUND)
+  SET( GEOTIFF_LIBRARIES ${GEOTIFF_LIBRARY} )
+ENDIF(GEOTIFF_FOUND)
+
+MARK_AS_ADVANCED(GEOTIFF_INCLUDE_DIR GEOTIFF_LIBRARY)
diff --git a/cmake/CMakeModules/FindGPSTK.cmake b/cmake/CMakeModules/FindGPSTK.cmake
new file mode 100644
index 0000000..3f4eadb
--- /dev/null
+++ b/cmake/CMakeModules/FindGPSTK.cmake
@@ -0,0 +1,24 @@
+# - Find gpstk library
+# Find the native gpstk includes and library
+# This module defines
+#  GPSTK_INCLUDE_DIR, where to find tiff.h, etc.
+#  GPSTK_LIBRARIES, libraries to link against to use GPSTK.
+#  GPSTK_FOUND, If false, do not try to use GPSTK.
+# also defined, but not for general use are
+#  GPSTK_LIBRARY, where to find the GPSTK library.
+
+FIND_PATH(GPSTK_INCLUDE_DIR gpstk/Matrix.hpp)
+
+SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk)
+FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} )
+
+# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK  DEFAULT_MSG  GPSTK_LIBRARY  GPSTK_INCLUDE_DIR)
+
+IF(GPSTK_FOUND)
+  SET( GPSTK_LIBRARIES ${GPSTK_LIBRARY} )
+ENDIF(GPSTK_FOUND)
+
+MARK_AS_ADVANCED(GPSTK_INCLUDE_DIR GPSTK_LIBRARY)
diff --git a/cmake/CMakeModules/FindGeotrans.cmake b/cmake/CMakeModules/FindGeotrans.cmake
new file mode 100644
index 0000000..9816af3
--- /dev/null
+++ b/cmake/CMakeModules/FindGeotrans.cmake
@@ -0,0 +1,69 @@
+#---
+# File: FindGeotrans.cmake
+#
+# Find the native GeoTrans includes and libraries.
+#
+# This module defines:
+#
+# GEOTRANS_INCLUDE_DIR, where to find geotrans_config.h, etc.
+# GEOTRANS_LIBRARY, libraries to link against to use Geotrans.
+# GEOTRANS_FOUND, True if found, false if one of the above are not found.
+# 
+# For ossim, typically geos will be system installed which should be found; 
+# or found in the ossim 3rd party dependencies directory from a geos build 
+# and install.  If the latter it will rely on CMAKE_INCLUDE_PATH and 
+# CMAKE_LIBRARY_PATH having the path to the party dependencies directory.
+# 
+# NOTE:
+# 
+# This script is specialized for ossim, e.g. looking in /usr/local/ossim.
+#
+# $Id$
+#---
+
+#---
+# Find include path:
+# Note: Version < 3.3.0 do not have geos.h in the geos sub directory; hence,
+# the check for both "geos/geos.h" and "geos.h".
+#---
+find_path( GEOTRANS_INCLUDE_DIR geotrans/geotrans_config.h
+           PATHS 
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+# Find Geotrans library:
+find_library( Geotrans_LIB NAMES geotrans 
+              PATHS 
+              /usr/lib64 
+              /usr/lib 
+              /usr/local/lib
+              /usr/local/ossim/lib )
+
+# Set the Geotrans_LIBRARY:
+if( Geotrans_LIB )
+   set( GEOTRANS_LIBRARY ${Geotrans_LIB} CACHE STRING INTERNAL )
+endif(Geotrans_LIB )
+
+#---
+# This function sets Geotrans_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( GEOTRANS DEFAULT_MSG 
+                                   GEOTRANS_LIBRARY 
+                                   GEOTRANS_INCLUDE_DIR )
+
+if( GEOTRANS_FOUND )
+   if( NOT GEOTRANS_FIND_QUIETLY )
+      message( STATUS "Found Geotrans..." )
+   endif( NOT GEOTRANS_FIND_QUIETLY )
+else( Geotrans_FOUND )
+   if( NOT GEOTRANS_FIND_QUIETLY )
+      message( WARNING "Could not find Geotrans" )
+   endif( NOT GEOTRANS_FIND_QUIETLY )
+endif( GEOTRANS_FOUND )
+
+if( NOT GEOTRANS_FIND_QUIETLY )
+   message( STATUS "GEOTRANS_INCLUDE_DIR=${GEOTRANS_INCLUDE_DIR}" )
+   message( STATUS "GEOTRANS_LIBRARY=${GEOTRANS_LIBRARY}" )
+endif( NOT GEOTRANS_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindGit.cmake b/cmake/CMakeModules/FindGit.cmake
new file mode 100644
index 0000000..e9c7676
--- /dev/null
+++ b/cmake/CMakeModules/FindGit.cmake
@@ -0,0 +1,126 @@
+# - Extract information from a GIT working copy
+# The module defines the following variables:
+#    GIT_EXECUTABLE - path to git command line client
+#    GIT_FOUND - true if the command line client was found
+#    GIT_VERSION_STRING - the version of git found (since CMake 2.8.8)
+#
+# The minimum required version of Git can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Git 1.4)
+#
+# If the command line client executable is found two macros are defined:
+#  GIT_WC_INFO(<dir> <var-prefix>)
+#  GIT_WC_LOG(<dir> <var-prefix>)
+# GIT_WC_INFO extracts information of a GIT working copy at
+# a given location. This macro defines the following variables:
+#  <var-prefix>_WC_URL - url of the repository (at <dir>)
+#  <var-prefix>_WC_ROOT - root url of the repository
+#  <var-prefix>_WC_REVISION - current revision
+#  <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
+#  <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
+#  <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
+#  <var-prefix>_WC_INFO - output of command `git rev-list HEAD --max-count 1'
+# GIT_WC_LOG retrieves the log message of the base revision of a
+# GIT working copy at a given location. This macro defines the
+# variable:
+#  <var-prefix>_LAST_CHANGED_LOG - last log of base revision
+# Example usage:
+#  FIND_PACKAGE(GIT)
+#  IF(GIT_FOUND)
+#    GIT_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+#    MESSAGE("Current revision is ${Project_WC_REVISION}")
+#    GIT_WC_LOG(${PROJECT_SOURCE_DIR} Project)
+#    MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
+#  ENDIF(GIT_FOUND)
+#
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+# Copyright 2012 Rolf Eike Beer <eike at sf-mail.de>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+# Look for 'git' or 'eg' (easy git)
+#
+set(git_names git eg)
+
+# Prefer .cmd variants on Windows unless running in a Makefile
+# in the MSYS shell.
+#
+if(WIN32)
+  if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+    set(git_names git.cmd git eg.cmd eg)
+    # GitHub search path for Windows
+    set(github_path "$ENV{LOCALAPPDATA}/Github/PortableGit*/bin")
+    file(GLOB github_path "${github_path}")
+  endif()
+endif()
+
+find_program(GIT_EXECUTABLE
+  NAMES ${git_names}
+  PATHS ${github_path}
+  PATH_SUFFIXES Git/cmd Git/bin
+  DOC "git command line client"
+  )
+mark_as_advanced(GIT_EXECUTABLE)
+
+IF(GIT_EXECUTABLE)
+  execute_process(COMMAND ${GIT_EXECUTABLE} --version
+                  OUTPUT_VARIABLE git_version
+                  ERROR_QUIET
+                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+  if (git_version MATCHES "^git version [0-9]")
+    string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
+  endif()
+  unset(git_version)
+
+  MACRO(GIT_WC_INFO dir prefix)
+    # the GIT commands should be executed with the C locale, otherwise
+    # the message (which are parsed) may be translated, Alex
+    # SET(GIT_SAVED_LC_ALL "$ENV{LC_ALL}")
+    # SET(ENV{LC_ALL} C)
+
+    execute_process(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --max-count=1
+      WORKING_DIRECTORY ${dir}
+      OUTPUT_VARIABLE ${prefix}_WC_REVISION
+      ERROR_VARIABLE git_info_error
+      RESULT_VARIABLE git_info_result
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+    IF(NOT ${git_info_result} EQUAL 0)
+      MESSAGE(WARNING "Command \"${GIT_EXECUTABLE} rev-list HEAD --max-count=1\" failed with output:\n${git_info_error}")
+    ELSE(NOT ${git_info_result} EQUAL 0)
+	set(${prefix}_WC_INFO ${git_info_result})
+    ENDIF(NOT ${git_info_result} EQUAL 0)
+
+    # restore the previous LC_ALL
+    # SET(ENV{LC_ALL} ${GIT_SAVED_LC_ALL})
+
+  ENDMACRO(GIT_WC_INFO)
+
+ENDIF(GIT_EXECUTABLE)
+
+# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( GIT DEFAULT_MSG
+                                   GIT_EXECUTABLE 
+                                   GIT_VERSION_STRING )
+
+if( GIT_FOUND )
+   if( NOT GIT_FIND_QUIETLY )
+     message( STATUS "GIT_VERSION_STRING              = ${GIT_VERSION_STRING}" )
+   endif( NOT GIT_FIND_QUIETLY )
+else( GIT_FOUND )
+   if( NOT GIT_FIND_QUIETLY )
+      message( WARNING "Could not find GIT" )
+   endif( NOT GIT_FIND_QUIETLY )
+endif( GIT_FOUND )
+
+
diff --git a/cmake/CMakeModules/FindHDF5.cmake b/cmake/CMakeModules/FindHDF5.cmake
new file mode 100644
index 0000000..d65e32b
--- /dev/null
+++ b/cmake/CMakeModules/FindHDF5.cmake
@@ -0,0 +1,75 @@
+#---
+# File: FindHDF5.cmake
+#
+# Find the native HDF5 includes and libraries.
+#
+# This module defines:
+#
+# HDF5_INCLUDE_DIR, where to find geos.h, etc.
+# HDF5_LIBRARIES, libraries to link against to use HDF5.
+# HDF5_FOUND, True if found, false if one of the above are not found.
+# 
+# NOTE: 
+#
+# This script is specialized for ossim. HDF5 rpm created to fix conflict with
+# system installed hdf5 packages that do NOT have compression(szip) support.
+#
+# $Id$
+#---
+
+# Find include path:
+find_path( HDF5_INCLUDE_DIR hdf5.h
+           PATHS 
+           $ENV{HDF5_DIR}/include
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+# Find HDF5 library:
+find_library( HDF5_LIB NAMES hdf5
+              PATHS
+              $ENV{HDF5_DIR}/lib64
+              $ENV{HDF5_DIR}/lib
+              /usr/lib64
+              /usr/lib
+              /usr/local/lib
+              /usr/local/ossim/lib )
+
+# Find HDF5 CPP library:
+find_library( HDF5_CPP_LIB NAMES hdf5_cpp
+              PATHS
+              $ENV{HDF5_DIR}/lib64
+              $ENV{HDF5_DIR}/lib
+              /usr/lib64
+              /usr/lib
+              /usr/local/lib
+              /usr/local/ossim/lib )
+
+# Set the HDF5_LIBRARIES:
+if( HDF5_LIB AND HDF5_CPP_LIB )
+   set( HDF5_LIBRARIES ${HDF5_LIB} ${HDF5_CPP_LIB} CACHE STRING INTERNAL )
+endif(HDF5_LIB AND HDF5_CPP_LIB )
+
+#---
+# This function sets HDF5_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( HDF5 DEFAULT_MSG 
+                                   HDF5_LIBRARIES 
+                                   HDF5_INCLUDE_DIR )
+
+if( HDF5_FOUND )
+   if( NOT HDF5_FIND_QUIETLY )
+      message( STATUS "Found HDF5..." )
+   endif( NOT HDF5_FIND_QUIETLY )
+else( HDF5_FOUND )
+   if( NOT HDF5_FIND_QUIETLY )
+      message( WARNING "Could not find HDF5" )
+   endif( NOT HDF5_FIND_QUIETLY )
+endif( HDF5_FOUND )
+
+if( NOT HDF5_FIND_QUIETLY )
+   message( STATUS "HDF5_INCLUDE_DIR=${HDF5_INCLUDE_DIR}" )
+   message( STATUS "HDF5_LIBRARIES=${HDF5_LIBRARIES}" )
+endif( NOT HDF5_FIND_QUIETLY )
+
diff --git a/cmake/CMakeModules/FindHDF5A.cmake b/cmake/CMakeModules/FindHDF5A.cmake
new file mode 100644
index 0000000..c2c25b8
--- /dev/null
+++ b/cmake/CMakeModules/FindHDF5A.cmake
@@ -0,0 +1,79 @@
+#---
+# File: FindHDF5A.cmake
+#
+# Find the native HDF5A includes and libraries.
+#
+# This module defines:
+#
+# HDF5A_INCLUDE_DIR, where to find geos.h, etc.
+# HDF5A_LIBRARIES, libraries to link against to use HDF5A.
+# HDF5A_FOUND, True if found, false if one of the above are not found.
+# 
+# NOTE: 
+#
+# This script is specialized for ossim. HDF5A rpm created to fix conflict with
+# system installed hdf5 packages that do NOT have compression(szip) support.
+#
+# $Id$
+#---
+
+# Find include path:
+find_path( HDF5A_INCLUDE_DIR hdf5.h
+           PATHS 
+           ${CMAKE_INSTALL_PREFIX}/include
+           $ENV{HDF5_DIR}/include
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+# Find HDF5A library:
+find_library( HDF5A_LIB NAMES hdf5a hdf5
+              PATHS
+              $ENV{HDF5_DIR}/lib64
+              $ENV{HDF5_DIR}/lib
+              ${CMAKE_INSTALL_PREFIX}/lib64
+              /usr/lib64
+              ${CMAKE_INSTALL_PREFIX}/lib
+              /usr/lib
+              /usr/local/lib
+              /usr/local/ossim/lib )
+
+# Find HDF5A CPP library:
+find_library( HDF5A_CPP_LIB NAMES hdf5a_cpp hdf5_cpp
+              PATHS
+              $ENV{HDF5_DIR}/lib64
+              $ENV{HDF5_DIR}/lib
+              ${CMAKE_INSTALL_PREFIX}/lib64
+              /usr/lib64
+              ${CMAKE_INSTALL_PREFIX}/lib
+              /usr/lib
+              /usr/local/lib
+              /usr/local/ossim/lib )
+
+# Set the HDF5A_LIBRARIES:
+if( HDF5A_LIB AND HDF5A_CPP_LIB )
+   set( HDF5A_LIBRARIES ${HDF5A_LIB} ${HDF5A_CPP_LIB} CACHE STRING INTERNAL )
+endif(HDF5A_LIB AND HDF5A_CPP_LIB )
+
+#---
+# This function sets HDF5A_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( HDF5A DEFAULT_MSG 
+                                   HDF5A_LIBRARIES 
+                                   HDF5A_INCLUDE_DIR )
+
+if( HDF5A_FOUND )
+   if( NOT HDF5A_FIND_QUIETLY )
+      message( STATUS "Found HDF5A..." )
+   endif( NOT HDF5A_FIND_QUIETLY )
+else( HDF5A_FOUND )
+   if( NOT HDF5A_FIND_QUIETLY )
+      message( WARNING "Could not find HDF5A" )
+   endif( NOT HDF5A_FIND_QUIETLY )
+endif( HDF5A_FOUND )
+
+if( NOT HDF5A_FIND_QUIETLY )
+   message( STATUS "HDF5A_INCLUDE_DIR=${HDF5A_INCLUDE_DIR}" )
+   message( STATUS "HDF5A_LIBRARIES=${HDF5A_LIBRARIES}" )
+endif( NOT HDF5A_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindJPEG.cmake b/cmake/CMakeModules/FindJPEG.cmake
new file mode 100644
index 0000000..2fa98ba
--- /dev/null
+++ b/cmake/CMakeModules/FindJPEG.cmake
@@ -0,0 +1,55 @@
+# - Find JPEG
+# Find the native JPEG includes and library
+# This module defines
+#  JPEG_INCLUDE_DIR, where to find jpeglib.h, etc.
+#  JPEG_LIBRARIES, the libraries needed to use JPEG.
+#  JPEG_FOUND, If false, do not try to use JPEG.
+# also defined, but not for general use are
+#  JPEG_LIBRARY, where to find the JPEG library.
+
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h
+           PATHS
+           ${CMAKE_INSTALL_PREFIX}/include
+           /usr/local/include
+           /usr/include )
+
+SET(JPEG_NAMES ${JPEG_NAMES} jpeg libjpeg)
+
+# Added x86_64-linux-gnu path for Ubuntu install
+FIND_LIBRARY(JPEG_LIBRARY
+             NAMES ${JPEG_NAMES}
+             PATHS
+             ${CMAKE_INSTALL_PREFIX}/include
+             /usr/local/lib
+             /usr/lib
+             /usr/lib/x86_64-linux-gnu)
+
+# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
+
+IF(JPEG_FOUND)
+  SET(JPEG_LIBRARIES ${JPEG_LIBRARY})
+ENDIF(JPEG_FOUND)
+
+# Deprecated declarations.
+SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} )
+IF(JPEG_LIBRARY)
+  GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH)
+ENDIF(JPEG_LIBRARY)
+
+MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR )
diff --git a/cmake/CMakeModules/FindJPEG12.cmake b/cmake/CMakeModules/FindJPEG12.cmake
new file mode 100644
index 0000000..0b66d10
--- /dev/null
+++ b/cmake/CMakeModules/FindJPEG12.cmake
@@ -0,0 +1,67 @@
+# - Find JPEG12
+#
+# ---
+# This is a specialized find for custom built jpeg library with 12 samples
+# enabled.
+# Specifically looks for library: /usr/lib64/libjpeg12.so
+# and header file:  /usr/include/jpeg12/jpeglib.h
+# ---
+#
+#
+# Find the native JPEG includes and library
+# This module defines
+#  JPEG12_INCLUDE_DIR, where to find jpeglib.h, etc.
+#  JPEG12_LIBRARIES, the libraries needed to use JPEG.
+#  JPEG12_FOUND, If false, do not try to use JPEG.
+# also defined, but not for general use are
+#  JPEG12_LIBRARY, where to find the JPEG library.
+
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+find_path( JPEG12_INCLUDE_DIR jpeg12/jpeglib.h
+           PATHS
+           ${CMAKE_INSTALL_PREFIX}/include
+           /usr/include
+           /usr/local/include )
+
+set( JPEG12_NAMES ${JPEG12_NAMES} jpeg12 libjpeg12 )
+
+find_library( JPEG12_LIBRARY
+              NAMES ${JPEG12_NAMES}
+              PATHS
+              /usr/lib64
+              /usr/local/lib64
+              /usr/lib
+              /usr/local/lib )
+
+#---
+# This function sets JPEG12_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(JPEG12 DEFAULT_MSG JPEG12_LIBRARY JPEG12_INCLUDE_DIR)
+
+if( JPEG12_FOUND )
+   if( NOT JPEG12_FIND_QUIETLY )
+      message( STATUS "Found JPEG12..." )
+   endif( NOT JPEG12_FIND_QUIETLY )
+else( JPEG12_FOUND )
+   if( NOT JPEG12_FIND_QUIETLY )
+      message( WARNING "Could not find JPEG12" )
+   endif( NOT JPEG12_FIND_QUIETLY )
+endif( JPEG12_FOUND )
+
+if( NOT JPEG12_FIND_QUIETLY )
+   message( STATUS "JPEG12_INCLUDE_DIR=${JPEG12_INCLUDE_DIR}" )
+   message( STATUS "JPEG12_LIBRARY=${JPEG12_LIBRARY}" )
+endif( NOT JPEG12_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindLASzip.cmake b/cmake/CMakeModules/FindLASzip.cmake
new file mode 100644
index 0000000..b405ceb
--- /dev/null
+++ b/cmake/CMakeModules/FindLASzip.cmake
@@ -0,0 +1,118 @@
+###############################################################################
+#
+# CMake module to search for LASzip library
+#
+# On success, the macro sets the following variables:
+# LASZIP_FOUND       = if the library found
+# LASZIP_INCLUDE_DIR = where to find the library headers also defined,
+#                       but not for general use are
+# LASZIP_LIBRARY     = where to find the laszip library.
+# LASZIP_VERSION     = version of library which was found, e.g. "1.2.5"
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz at loskot.net>
+#
+# Module source: http://github.com/mloskot/workshop/tree/master/cmake/
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+###############################################################################
+MESSAGE(STATUS "Searching for LASzip ${LASzip_FIND_VERSION}+ library")
+
+IF(LASZIP_INCLUDE_DIR)
+  # Already in cache, be silent
+  SET(LASZIP_FIND_QUIETLY TRUE)
+ENDIF()
+
+IF(WIN32)
+  SET(OSGEO4W_IMPORT_LIBRARY laszip)
+  IF(DEFINED ENV{OSGEO4W_ROOT})
+    SET(OSGEO4W_ROOT_DIR $ENV{OSGEO4W_ROOT})
+    #MESSAGE(STATUS " FindLASzip: trying OSGeo4W using environment variable OSGEO4W_ROOT=$ENV{OSGEO4W_ROOT}")
+  ELSE()
+    SET(OSGEO4W_ROOT_DIR c:/OSGeo4W)
+    #MESSAGE(STATUS " FindLASzip: trying OSGeo4W using default location OSGEO4W_ROOT=${OSGEO4W_ROOT_DIR}")
+  ENDIF()
+ENDIF()
+
+
+FIND_PATH(LASZIP_INCLUDE_DIR
+  laszip.hpp
+  PATH_PREFIXES laszip
+  PATHS
+  /usr/include
+  /usr/local/include
+  /tmp/lasjunk/include
+  ${OSGEO4W_ROOT_DIR}/include)
+
+SET(LASZIP_NAMES ${OSGEO4W_IMPORT_LIBRARY} laszip)
+
+FIND_LIBRARY(LASZIP_LIBRARY
+  NAMES ${LASZIP_NAMES}
+  PATHS
+  /usr/lib64
+  /usr/lib
+  /usr/local/lib
+  /tmp/lasjunk/lib
+  ${OSGEO4W_ROOT_DIR}/lib)
+
+IF(LASZIP_INCLUDE_DIR)
+  SET(LASZIP_VERSION 0)
+
+  SET(LASZIP_VERSION_H "${LASZIP_INCLUDE_DIR}/laszip/laszip.hpp")
+  FILE(READ ${LASZIP_VERSION_H} LASZIP_VERSION_H_CONTENTS)
+
+  IF (DEFINED LASZIP_VERSION_H_CONTENTS)
+    string(REGEX REPLACE ".*#define[ \t]LASZIP_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" LASZIP_VERSION_MAJOR "${LASZIP_VERSION_H_CONTENTS}")
+    string(REGEX REPLACE ".*#define[ \t]LASZIP_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" LASZIP_VERSION_MINOR "${LASZIP_VERSION_H_CONTENTS}")
+    string(REGEX REPLACE ".*#define[ \t]LASZIP_VERSION_REVISION[ \t]+([0-9]+).*"   "\\1" LASZIP_VERSION_REVISION   "${LASZIP_VERSION_H_CONTENTS}")
+
+    if(NOT ${LASZIP_VERSION_MAJOR} MATCHES "[0-9]+")
+      message(FATAL_ERROR "LASzip version parsing failed for LASZIP_VERSION_MAJOR!")
+    endif()
+    if(NOT ${LASZIP_VERSION_MINOR} MATCHES "[0-9]+")
+      message(FATAL_ERROR "LASzip version parsing failed for LASZIP_VERSION_MINOR!")
+    endif()
+    if(NOT ${LASZIP_VERSION_REVISION} MATCHES "[0-9]+")
+      message(FATAL_ERROR "LASzip version parsing failed for LASZIP_VERSION_REVISION!")
+    endif()
+
+
+    SET(LASZIP_VERSION "${LASZIP_VERSION_MAJOR}.${LASZIP_VERSION_MINOR}.${LASZIP_VERSION_REVISION}"
+      CACHE INTERNAL "The version string for LASzip library")
+
+    IF (LASZIP_VERSION VERSION_EQUAL LASzip_FIND_VERSION OR
+        LASZIP_VERSION VERSION_GREATER LASzip_FIND_VERSION)
+    ELSE()
+      MESSAGE(FATAL_ERROR "LASzip version check failed. Version ${LASZIP_VERSION} was found, at least version ${LASzip_FIND_VERSION} is required")
+    ENDIF()
+  ELSE()
+    MESSAGE(FATAL_ERROR "Failed to open ${LASZIP_VERSION_H} file")
+  ENDIF()
+
+ENDIF()
+
+#---
+# This function sets LASZIP_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LASzip DEFAULT_MSG LASZIP_LIBRARY LASZIP_INCLUDE_DIR)
+
+if( LASZIP_FOUND )
+   if( NOT LASZIP_FIND_QUIETLY )
+      message( STATUS "Found LASzip..." )
+   endif( NOT LASZIP_FIND_QUIETLY )
+else( LASZIP_FOUND )
+   if( NOT LASZIP_FIND_QUIETLY )
+      message( WARNING "Could not find LASzip" )
+   endif( NOT LASZIP_FIND_QUIETLY )
+endif( LASZIP_FOUND )
+
+#---
+# Show the caller what was found regardless of LASZIP_FOUND variable:
+#---
+if( NOT LASZIP_FIND_QUIETLY )
+   message( STATUS "LASZIP_INCLUDE_DIR=${LASZIP_INCLUDE_DIR}" )
+   message( STATUS "LASZIP_LIBRARY=${LASZIP_LIBRARY}" )
+   message( STATUS "Found LASzip version: ${LASZIP_VERSION}")
+endif( NOT LASZIP_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindLIBLAS.cmake b/cmake/CMakeModules/FindLIBLAS.cmake
new file mode 100644
index 0000000..9d1dd15
--- /dev/null
+++ b/cmake/CMakeModules/FindLIBLAS.cmake
@@ -0,0 +1,103 @@
+#---
+# File: FindLIBLAS.cmake
+#
+# Find the native LIBLAS includes and library
+#
+#  LIBLAS_INCLUDE_DIRS - where to find liblas's includes.
+#  LIBLAS_LIBRARIES    - List of libraries when using liblas.
+#  LIBLAS_FOUND        - True if liblas found.
+#---
+
+
+# Set the include dir:
+find_path(LIBLAS_INCLUDE_DIR liblas/liblas.hpp)
+
+# Macro for setting libraries:
+macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+  find_library(
+    "${MYLIBRARY}_DEBUG"
+    NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
+    PATHS
+    ${LIBLAS_DIR}/lib/Debug
+    ${LIBLAS_DIR}/lib64/Debug
+    ${LIBLAS_DIR}/lib
+    ${LIBLAS_DIR}/lib64
+    $ENV{LIBLAS_DIR}/lib/debug
+    $ENV{LIBLAS_DIR}/lib64/debug
+    NO_DEFAULT_PATH
+  )
+
+  find_library(
+    "${MYLIBRARY}_DEBUG"
+    NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
+    PATHS
+    ~/Library/Frameworks
+    /Library/Frameworks
+    /usr/local/lib
+    /usr/local/lib64
+    /usr/lib
+    /usr/lib64
+    /sw/lib
+    /opt/local/lib
+    /opt/csw/lib
+    /opt/lib
+    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
+    /usr/freeware/lib64
+  )
+    
+  find_library(
+    ${MYLIBRARY}
+    NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
+    PATHS
+    ${LIBLAS_DIR}/lib/Release
+    ${LIBLAS_DIR}/lib64/Release
+    ${LIBLAS_DIR}/lib
+    ${LIBLAS_DIR}/lib64
+    $ENV{LIBLAS_DIR}/lib/Release
+    $ENV{LIBLAS_DIR}/lib64/Release
+    $ENV{LIBLAS_DIR}/lib
+    $ENV{LIBLAS_DIR}/lib64
+    $ENV{LIBLAS_DIR}
+    $ENV{LIBLASDIR}/lib
+    $ENV{LIBLASDIR}/lib64
+    $ENV{LIBLASDIR}
+    $ENV{LIBLAS_ROOT}/lib
+    $ENV{LIBLAS_ROOT}/lib64
+    NO_DEFAULT_PATH
+  )
+
+  find_library(
+    ${MYLIBRARY}
+    NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
+    PATHS
+    ~/Library/Frameworks
+    /Library/Frameworks
+    /usr/local/lib
+    /usr/local/lib64
+    /usr/lib
+    /usr/lib64
+    /sw/lib
+    /opt/local/lib
+    /opt/csw/lib
+    /opt/lib
+    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
+    /usr/freeware/lib64
+  )
+    
+  if( NOT ${MYLIBRARY}_DEBUG )
+    if( MYLIBRARY )
+      set( ${MYLIBRARY}_DEBUG ${MYLIBRARY} )
+    endif(MYLIBRARY)	
+  endif( NOT ${MYLIBRARY}_DEBUG )
+           
+endmacro(FIND_LIBLAS_LIBRARY LIBRARY LIBRARYNAME)
+
+FIND_LIBLAS_LIBRARY(LIBLAS_LIBRARY las)
+FIND_LIBLAS_LIBRARY(LIBLASC_LIBRARY las_c)
+
+set(LIBLAS_FOUND "NO")
+if(LIBLAS_LIBRARY AND LIBLASC_LIBRARY AND LIBLAS_INCLUDE_DIR)
+  set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} ${LIBLASC_LIBRARY} )
+  set(LIBLAS_FOUND "YES")
+endif(LIBLAS_LIBRARY AND LIBLASC_LIBRARY AND LIBLAS_INCLUDE_DIR)
diff --git a/cmake/CMakeModules/FindMSP.cmake b/cmake/CMakeModules/FindMSP.cmake
new file mode 100644
index 0000000..1aea2bd
--- /dev/null
+++ b/cmake/CMakeModules/FindMSP.cmake
@@ -0,0 +1,182 @@
+SET(CMAKE_FIND_FRAMEWORK "LAST")
+FIND_PATH(MSP_INCLUDE_DIRS Mensuration/MensurationService.h
+        PATHS
+        /usr/local/msp-1.5/ToolKit/include
+        $ENV{MSP_HOME}/include
+        ${OSSIM_DEPENDENCIES}/include
+		${OSSIM_INSTALL_PREFIX}/include
+)
+
+set (MSP_INCLUDE_DIRS ${MSP_INCLUDE_DIRS} 
+                      ${MSP_INCLUDE_DIRS}/CoordinateConversion
+                      ${MSP_INCLUDE_DIRS}/Terrain
+                      ${MSP_INCLUDE_DIRS}/common
+                      ${MSP_INCLUDE_DIRS}/common/utilities
+                      ${MSP_INCLUDE_DIRS}/common/geometry
+                      ${MSP_INCLUDE_DIRS}/common/math
+                      ${MSP_INCLUDE_DIRS}/common/csmutil
+                      ${MSP_INCLUDE_DIRS}/common/ntmtre
+                      ${MSP_INCLUDE_DIRS}/common/nitf
+                      ${MSP_INCLUDE_DIRS}/common/deiutil
+                      ${MSP_INCLUDE_DIRS}/common/dtcc
+                      ${MSP_INCLUDE_DIRS}/common/csm)
+
+
+MESSAGE("MSP_HOME = $ENV{MSP_HOME}")
+
+find_library(MSP_LIBRARY43 NAMES MSPPointExtractionService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY43})
+
+find_library(MSP_LIBRARY24 NAMES MSPSensorModelService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY24})
+
+find_library(MSP_LIBRARY28 NAMES MSPSourceSelectionService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY28})
+
+find_library(MSP_LIBRARY11 NAMES MSPCovarianceService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY11})
+
+find_library(MSP_LIBRARY34 NAMES MSPSupportDataService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY34})
+
+find_library(MSP_LIBRARY36 NAMES MSPTerrainService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY36})
+
+find_library(MSP_LIBRARY05 NAMES MSPCCSUtils PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY05})
+
+find_library(MSP_LIBRARY09 NAMES MSPCoordinateConversionService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY09})
+
+find_library(MSP_LIBRARY06 NAMES MSPOutputMethodService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY06})
+
+find_library(MSP_LIBRARY03 NAMES MSPasdetre PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY03})
+
+find_library(MSP_LIBRARY07 NAMES MSPcoordconverter PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY07})
+
+find_library(MSP_LIBRARY13 NAMES MSPcsisd PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY13})
+
+find_library(MSP_LIBRARY15 NAMES MSPcsm PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY15})
+
+find_library(MSP_LIBRARY17 NAMES MSPcsmutil PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY17})
+
+find_library(MSP_LIBRARY23 NAMES MSPdtcc PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY23})
+
+find_library(MSP_LIBRARY31 NAMES MSPlas PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY31})
+
+find_library(MSP_LIBRARY25 NAMES MSPgeometry PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY25})
+
+find_library(MSP_LIBRARY33 NAMES MSPmath PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY33})
+
+find_library(MSP_LIBRARY02 NAMES MSPnitf PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY02})
+
+find_library(MSP_LIBRARY04 NAMES MSPntmtre PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY04})
+
+find_library(MSP_LIBRARY12 NAMES MSPrage PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY12})
+
+find_library(MSP_LIBRARY10 NAMES MSPRageServiceUtils PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY10})
+
+find_library(MSP_LIBRARY14 NAMES MSPrageutilities PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY14})
+
+find_library(MSP_LIBRARY30 NAMES MSPSScovmodel PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY30})
+
+find_library(MSP_LIBRARY32 NAMES MSPSSrutil PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY32})
+
+find_library(MSP_LIBRARY38 NAMES MSPutilities PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY38})
+
+find_library(MSP_LIBRARY01 NAMES CSM_PCAPI PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY01})
+
+find_library(MSP_LIBRARY16 NAMES MSPrsme PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY16})
+
+find_library(MSP_LIBRARY18 NAMES MSPRsmGeneratorService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY18})
+
+find_library(MSP_LIBRARY19 NAMES MSPdei PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY19})
+
+find_library(MSP_LIBRARY20 NAMES MSPrsmg PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY20})
+
+find_library(MSP_LIBRARY21 NAMES MSPDEIUtil PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY21})
+
+find_library(MSP_LIBRARY22 NAMES MSPrutil PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY22})
+
+find_library(MSP_LIBRARY26 NAMES MSPSensorSpecificService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY26})
+
+find_library(MSP_LIBRARY27 NAMES MSPImagingGeometryService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY27})
+
+find_library(MSP_LIBRARY29 NAMES MSPjson PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY29})
+
+find_library(MSP_LIBRARY35 NAMES MSPmens PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY35})
+
+find_library(MSP_LIBRARY36 NAMES MSPTerrainService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY36})
+
+find_library(MSP_LIBRARY37 NAMES MSPMensurationService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY37})
+
+find_library(MSP_LIBRARY39 NAMES MSPMensurationSessionRecordService PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY39})
+
+find_library(MSP_LIBRARY40 NAMES MSPwriteRsmNitf PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY40})
+
+find_library(MSP_LIBRARY41 NAMES MSPMSPVersionUtils PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY41})
+
+find_library(MSP_LIBRARY42 NAMES MSPmtdCommon PATHS /usr/local/msp-1.5/ToolKit/lib $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY42})
+
+find_library(MSP_LIBRARY00 NAMES pthread )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY00})
+
+find_library(MSP_LIBRARYDL NAMES dl  )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARYDL})
+
+
+#---
+# This function sets MSP_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( MSP DEFAULT_MSG 
+                                   MSP_LIBRARIES 
+                                   MSP_INCLUDE_DIRS )
+
+if(NOT MSP_FOUND)
+   if( NOT MSP_FIND_QUIETLY )
+      message( WARNING "Could not find MSP" )
+   endif( NOT MSP_FIND_QUIETLY )
+endif(NOT MSP_FOUND)
+
+#if( NOT MSP_FIND_QUIETLY )
+#   message( STATUS "MSP_INCLUDE_DIRS=${MSP_INCLUDE_DIRS}" )
+#   message( STATUS "MSP_LIBRARIES=${MSP_LIBRARIES}" )
+#endif( NOT MSP_FIND_QUIETLY )
+
+mark_as_advanced(MSP_INCLUDE_DIRS MSP_LIBRARIES)
diff --git a/cmake/CMakeModules/FindMiniZip.cmake b/cmake/CMakeModules/FindMiniZip.cmake
new file mode 100644
index 0000000..441c0eb
--- /dev/null
+++ b/cmake/CMakeModules/FindMiniZip.cmake
@@ -0,0 +1,26 @@
+# - Find minizip
+# Find the native MINIZIP includes and library
+#
+#  MINIZIP_INCLUDE_DIRS - where to find minizip's zip.h, etc.
+#  MINIZIP_LIBRARIES    - List of libraries when using minizip.
+#  MINIZIP_FOUND        - True if minizip found.
+
+IF (MINIZIP_INCLUDE_DIR)
+  # Already in cache, be silent
+  SET(MINIZIP_FIND_QUIETLY TRUE)
+ENDIF (MINIZIP_INCLUDE_DIR)
+
+FIND_PATH(MINIZIP_INCLUDE_DIR minizip/zip.h)
+
+SET(MINIZIP_NAMES minizip )
+FIND_LIBRARY(MINIZIP_LIBRARY NAMES ${MINIZIP_NAMES} )
+MARK_AS_ADVANCED( MINIZIP_LIBRARY MINIZIP_INCLUDE_DIR )
+
+# Per-recommendation
+SET(MINIZIP_INCLUDE_DIRS "${MINIZIP_INCLUDE_DIR}")
+SET(MINIZIP_LIBRARIES    "${MINIZIP_LIBRARY}")
+
+# handle the QUIETLY and REQUIRED arguments and set MINIZIP_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MINIZIP DEFAULT_MSG MINIZIP_LIBRARIES MINIZIP_INCLUDE_DIRS)
diff --git a/cmake/CMakeModules/FindMrSid.cmake b/cmake/CMakeModules/FindMrSid.cmake
new file mode 100644
index 0000000..c89b2bb
--- /dev/null
+++ b/cmake/CMakeModules/FindMrSid.cmake
@@ -0,0 +1,90 @@
+# - Find MrSid
+# Find the native MrSid includes and library
+# This module defines
+#  MRSID_INCLUDE_DIR, where to header files.
+#  MRSID_LIBRARIES, the libraries needed to use mrsid.
+#  MRSID_FOUND, If false, do not try to use mrsid.
+
+#=============================================================================
+# Copyright 2001-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+#---
+# Find the include dirs:
+#---
+FIND_PATH( MRSID_RASTER_INCLUDE_DIR MrSIDImageReader.h
+           PATHS
+           ${MRSID_DIR}/Raster_DSDK/include )
+
+FIND_PATH( MRSID_LIDAR_INCLUDE_DIR lidar/MG4PointReader.h
+           PATHS
+           ${MRSID_DIR}/Lidar_DSDK/include )
+
+#---
+# Find the Geo_DSDK (decode) library.
+#----
+# SET(MRSID_RASTER_DSDK_C_NAMES lti_dsdk_cdll ltidsdk_c libltidsdkc)
+# FIND_LIBRARY( MRSID_RASTER_DSDK_C_LIBRARY 
+#	      NAMES ${MRSID_RASTER_DSDK_C_NAMES} 
+#              PATHS
+#              ${MRSID_DIR}/Raster_DSDK/lib )
+
+SET(MRSID_RASTER_DSDK_NAMES lti_dsdk ltidsdk libltidsdk)
+FIND_LIBRARY( MRSID_RASTER_DSDK_LIBRARY 
+	      NAMES ${MRSID_RASTER_DSDK_NAMES} 
+              PATHS
+              ${MRSID_DIR}/Raster_DSDK/lib )
+
+SET(MRSID_LIDAR_DSDK_NAMES lti_lidar_dsdk liblti_lidar_dsdk )
+FIND_LIBRARY( MRSID_LIDAR_DSDK_LIBRARY NAMES ${MRSID_LIDAR_DSDK_NAMES} 
+              PATHS
+              ${MRSID_DIR}/Lidar_DSDK/lib )
+
+# handle the QUIETLY and REQUIRED arguments and set MRSID_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(MRSID DEFAULT_MSG MRSID_RASTER_INCLUDE_DIR MRSID_LIDAR_INCLUDE_DIR MRSID_RASTER_DSDK_LIBRARY MRSID_LIDAR_DSDK_LIBRARY)
+
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(MRSID DEFAULT_MSG MRSID_RASTER_INCLUDE_DIR MRSID_LIDAR_INCLUDE_DIR MRSID_RASTER_DSDK_LIBRARY MRSID_RASTER_DSDK_C_LIBRARY MRSID_LIDAR_DSDK_LIBRARY)
+
+IF(MRSID_FOUND)
+   # Combine the includes into MRSID_INCLUDE_DIR variable:
+   set(MRSID_INCLUDE_DIR ${MRSID_RASTER_INCLUDE_DIR} ${MRSID_LIDAR_INCLUDE_DIR})
+
+   # Combine the libraries into MRSID_LIBRARY variable:
+   set(MRSID_LIBRARY ${MRSID_RASTER_DSDK_LIBRARY} ${MRSID_LIDAR_DSDK_LIBRARY})
+
+   # set(MRSID_LIBRARY ${MRSID_RASTER_DSDK_C_LIBRARY} ${MRSID_RASTER_DSDK_LIBRARY} ${MRSID_LIDAR_DSDK_LIBRARY})
+
+  #---
+  # Find the Geo_ESDK (encode) library.
+  #----
+  SET(MRSID_ESDK_NAMES ${MRSID_ESDK_NAMES} ltiesdk libltiesdk)
+  FIND_LIBRARY(MRSID_ESDK_LIBRARY NAMES ${MRSID_ESDK_NAMES})
+
+  #---
+  # Find the two includes need for the writer.
+  #---
+  FIND_FILE(MG2IMAGEWRITER_H MG2ImageWriter.h ${MRSID_INCLUDE_DIR})
+  FIND_FILE(MG3IMAGEWRITER_H MG3ImageWriter.h ${MRSID_INCLUDE_DIR})
+
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(MRSID_WRITE DEFAULT_MSG MRSID_ESDK_LIBRARY MG2IMAGEWRITER_H MG3IMAGEWRITER_H)  
+
+  IF(MRSID_WRITE_FOUND)
+    add_definitions(-DOSSIM_ENABLE_MRSID_WRITE)
+    SET(MRSID_LIBRARY ${MRSID_DSDK_LIBRARY} ${MRSID_ESDK_LIBRARY})
+  ENDIF(MRSID_WRITE_FOUND)
+  SET(MRSID_LIBRARIES ${MRSID_LIBRARY})
+ENDIF(MRSID_FOUND)
+
+MARK_AS_ADVANCED(MRSID_LIBRARIES MRSID_INCLUDE_DIR )
diff --git a/cmake/CMakeModules/FindOMS.cmake b/cmake/CMakeModules/FindOMS.cmake
new file mode 100644
index 0000000..69c44c5
--- /dev/null
+++ b/cmake/CMakeModules/FindOMS.cmake
@@ -0,0 +1,44 @@
+# - Find ossim library
+# Find the native ossim includes and library
+# This module defines
+#  OMS_INCLUDE_DIR, where to find tiff.h, etc.
+#  OMS_LIBRARIES, libraries to link against to use OSSIM.
+#  OMS_FOUND, If false, do not try to use OSSIM.
+# also defined, but not for general use are
+#  OMS_LIBRARY, where to find the OSSIM library.
+
+SET(CMAKE_FIND_FRAMEWORK "LAST")
+FIND_PATH(OMS_INCLUDE_DIR oms/ossimVersion.h
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/oms/coms/include
+		$ENV{OSSIM_DEV_HOME}/oms/lib
+		$ENV{OSSIM_INSTALL_PREFIX}/include
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/oms/coms
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		include
+)
+SET(OSSIM_NAMES ${OSSIM_NAMES} oms )
+FIND_LIBRARY(OSSIM_LIBRARY NAMES ${OSSIM_NAMES}
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/ossim/lib
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/ossim/lib
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		Frameworks
+)
+
+# handle the QUIETLY and REQUIRED arguments and set OSSIM_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OMS  DEFAULT_MSG  OMS_LIBRARY  OMS_INCLUDE_DIR)
+
+IF(OMS_FOUND)
+  SET( OMS_LIBRARIES ${OMS_LIBRARY} )
+ENDIF(OMS_FOUND)
+
+MARK_AS_ADVANCED(OMS_INCLUDE_DIR OMS_LIBRARY)
diff --git a/cmake/CMakeModules/FindOSG.cmake b/cmake/CMakeModules/FindOSG.cmake
new file mode 100644
index 0000000..b910d31
--- /dev/null
+++ b/cmake/CMakeModules/FindOSG.cmake
@@ -0,0 +1,133 @@
+# Locate gdal
+# This module defines
+# OSG_LIBRARY
+# OSG_FOUND, if false, do not try to link to gdal 
+# OSG_INCLUDE_DIR, where to find the headers
+#
+# $OSG_DIR is an environment variable that would
+# correspond to the ./configure --prefix=$OSG_DIR
+#
+# Created by Robert Osfield. 
+
+FIND_PATH(OSG_INCLUDE_DIR osg/Node
+    ${OSG_DIR}/include
+    $ENV{OSG_DIR}/include
+    $ENV{OSG_DIR}
+    $ENV{OSGDIR}/include
+    $ENV{OSGDIR}
+    $ENV{OSG_ROOT}/include
+    ${CMAKE_INSTALL_PREFIX}/include
+    NO_DEFAULT_PATH
+)
+
+FIND_PATH(OSG_INCLUDE_DIR osg/Node)
+
+MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+    FIND_LIBRARY("${MYLIBRARY}_DEBUG"
+        NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
+        PATHS
+        ${OSG_DIR}/lib/Debug
+        ${OSG_DIR}/lib64/Debug
+        ${OSG_DIR}/lib
+        ${OSG_DIR}/lib64
+        $ENV{OSG_DIR}/lib/debug
+        $ENV{OSG_DIR}/lib64/debug
+        $ENV{OSG_DIR}/lib
+        $ENV{OSG_DIR}/lib64
+        $ENV{OSG_DIR}
+        $ENV{OSGDIR}/lib
+        $ENV{OSGDIR}/lib64
+        $ENV{OSGDIR}
+        $ENV{OSG_ROOT}/lib
+        $ENV{OSG_ROOT}/lib64
+        ${CMAKE_INSTALL_PREFIX}/lib
+        ${CMAKE_INSTALL_PREFIX}/lib64
+        NO_DEFAULT_PATH
+    )
+
+    FIND_LIBRARY("${MYLIBRARY}_DEBUG"
+        NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
+        PATHS
+        ~/Library/Frameworks
+        /Library/Frameworks
+        /usr/local/lib
+        /usr/local/lib64
+        /usr/lib
+        /usr/lib64
+        /sw/lib
+        /opt/local/lib
+        /opt/csw/lib
+        /opt/lib
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+        /usr/freeware/lib64
+        ${CMAKE_INSTALL_PREFIX}/lib
+        ${CMAKE_INSTALL_PREFIX}/lib64
+    )
+    
+    FIND_LIBRARY(${MYLIBRARY}
+        NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
+        PATHS
+        ${OSG_DIR}/lib/Release
+        ${OSG_DIR}/lib64/Release
+        ${OSG_DIR}/lib
+        ${OSG_DIR}/lib64
+        $ENV{OSG_DIR}/lib/Release
+        $ENV{OSG_DIR}/lib64/Release
+        $ENV{OSG_DIR}/lib
+        $ENV{OSG_DIR}/lib64
+        $ENV{OSG_DIR}
+        $ENV{OSGDIR}/lib
+        $ENV{OSGDIR}/lib64
+        $ENV{OSGDIR}
+        $ENV{OSG_ROOT}/lib
+        $ENV{OSG_ROOT}/lib64
+        ${CMAKE_INSTALL_PREFIX}/lib
+        ${CMAKE_INSTALL_PREFIX}/lib64
+        NO_DEFAULT_PATH
+    )
+
+    FIND_LIBRARY(${MYLIBRARY}
+        NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
+        PATHS
+        ~/Library/Frameworks
+        /Library/Frameworks
+        /usr/local/lib
+        /usr/local/lib64
+        /usr/lib
+        /usr/lib64
+        /sw/lib
+        /opt/local/lib
+        /opt/csw/lib
+        /opt/lib
+        ${CMAKE_INSTALL_PREFIX}/lib
+        ${CMAKE_INSTALL_PREFIX}/lib64
+        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
+        /usr/freeware/lib64
+    )
+    
+    IF( NOT ${MYLIBRARY}_DEBUG)
+        IF(MYLIBRARY)
+            SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
+         ENDIF(MYLIBRARY)
+    ENDIF( NOT ${MYLIBRARY}_DEBUG)
+           
+ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
+
+FIND_OSG_LIBRARY(OSG_LIBRARY osg)
+FIND_OSG_LIBRARY(OSGGA_LIBRARY osgGA)
+FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
+FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
+FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
+FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
+FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
+FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
+FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
+FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
+FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
+FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
+
+SET(OSG_FOUND "NO")
+IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
+    SET(OSG_FOUND "YES")
+ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
diff --git a/cmake/CMakeModules/FindOpenCV.cmake b/cmake/CMakeModules/FindOpenCV.cmake
new file mode 100644
index 0000000..b2db884
--- /dev/null
+++ b/cmake/CMakeModules/FindOpenCV.cmake
@@ -0,0 +1,96 @@
+#---
+# File:  FindOpenCV.cmake
+# 
+# Locate OPENCV
+#
+# This module defines:
+#
+# OPENCV_INCLUDE_DIR
+#
+# OPENCV_FOUND, 
+# OPENCV_CORE_FOUND 
+# OPENCV_HIGHGUI_FOUND
+# OPENCV_IMGPROC_FOUND
+# OPENCV_LEGACY_FOUND
+# OPENCV_ML_FOUND 
+#
+# OPENCV_CORE_LIBRARY
+# OPENCV_HIGHGUI_LIBRARY
+# OPENCV_IMGPROC_LIBRARY
+# OPENCV_LEGACY_LIBRARY
+# OPENCV_ML_LIBRARY
+# OPENCV_LIBRARIES
+#
+# Created by Garrett Potts.
+#
+# $Id$
+
+# Find include path:
+find_path(OPENCV_INCLUDE_DIR opencv/cv.hpp PATHS /usr/include /usr/local/include)
+
+macro(FIND_OPENCV_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+   find_library( ${MYLIBRARY}
+      NAMES "${MYLIBRARYNAME}${OPENCV_RELEASE_POSTFIX}"
+      PATHS
+      /usr/lib64
+      /usr/lib
+     /usr/local/lib
+   )
+
+endmacro(FIND_OPENCV_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+FIND_OPENCV_LIBRARY(OPENCV_CALIB3D_LIBRARY opencv_calib3d)
+FIND_OPENCV_LIBRARY(OPENCV_CONTRIB_LIBRARY opencv_contrib)
+FIND_OPENCV_LIBRARY(OPENCV_CORE_LIBRARY opencv_core)
+FIND_OPENCV_LIBRARY(OPENCV_FEATURES2D_LIBRARY opencv_features2d)
+FIND_OPENCV_LIBRARY(OPENCV_FLANN_LIBRARY opencv_flann)
+FIND_OPENCV_LIBRARY(OPENCV_GPU_LIBRARY opencv_gpu)
+FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
+FIND_OPENCV_LIBRARY(OPENCV_IMGPROC_LIBRARY opencv_imgproc)
+FIND_OPENCV_LIBRARY(OPENCV_LEGACY_LIBRARY opencv_legacy)
+FIND_OPENCV_LIBRARY(OPENCV_ML_LIBRARY opencv_ml)
+FIND_OPENCV_LIBRARY(OPENCV_IMGCODECS_LIBRARY opencv_imgcodecs)
+
+message( STATUS "OPENCV_INCLUDE_DIR        = ${OPENCV_INCLUDE_DIR}" )
+message( STATUS "OPENCV_CALIB3D_LIBRARY    = ${OPENCV_CALIB3D_LIBRARY}" )
+message( STATUS "OPENCV_CONTRIB_LIBRARY    = ${OPENCV_CONTRIB_LIBRARY}" )
+message( STATUS "OPENCV_CORE_LIBRARY       = ${OPENCV_CORE_LIBRARY}" )
+message( STATUS "OPENCV_FEATURES2D_LIBRARY = ${OPENCV_FEATURES2D_LIBRARY}" )
+message( STATUS "OPENCV_FLANN_LIBRARY      = ${OPENCV_FLANN_LIBRARY}" )
+message( STATUS "OPENCV_GPU_LIBRARY        = ${OPENCV_GPU_LIBRARY}" )
+message( STATUS "OPENCV_HIGHGUI_LIBRARY    = ${OPENCV_HIGHGUI_LIBRARY}" )
+message( STATUS "OPENCV_IMGPROC_LIBRARY    = ${OPENCV_IMGPROC_LIBRARY}" )
+message( STATUS "OPENCV_LEGACY_LIBRARY     = ${OPENCV_LEGACY_LIBRARY}" )
+message( STATUS "OPENCV_ML_LIBRARY         = ${OPENCV_ML_LIBRARY}" )
+message( STATUS "OPENCV_IMGCODECS_LIBRARY  = ${OPENCV_IMGCODECS_LIBRARY}" )
+
+
+# Removed OPENCV_GPU_LIBRARY AND (drb 20140220)
+
+set(OPENCV_FOUND "NO")
+if(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+   set(OPENCV_FOUND "YES")
+   set(OPENCV_LIBRARIES ${OPENCV_CALIB3D_LIBRARY} ${OPENCV_CONTRIB_LIBRARY} ${OPENCV_CORE_LIBRARY} ${OPENCV_FEATURES2D_LIBRARY} ${OPENCV_FLANN_LIBRARY} ${OPENCV_HIGHGUI_LIBRARY} ${OPENCV_IMGPROC_LIBRARY} ${OPENCV_LEGACY_LIBRARY} ${OPENCV_ML_LIBRARY})
+   message( STATUS "OPENCV_LIBRARIES          = ${OPENCV_LIBRARIES}" )
+else(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+   message( WARNING "Could not find OPENCV" )
+endif(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+
+set(OPENCV_GPU_FOUND "NO")
+if(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)
+   set(OPENCV_GPU_FOUND "YES")
+   set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_GPU_LIBRARY})
+   message( STATUS "OPENCV_GPU_LIBRARY        = ${OPENCV_GPU_LIBRARY}" )
+else(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)
+   message( WARNING "Could not find optional OPENCV GPU Library. " )
+endif(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)
+
+set(OPENCV_IMGCODECS_FOUND "NO")
+if(OPENCV_FOUND AND OPENCV_IMGCODECS_LIBRARY)
+   set(OPENCV_IMGCODECS_FOUND "YES")
+   set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_IMGCODECS_LIBRARY})
+   message( STATUS "OPENCV_IMGCODECS_LIBRARY  = ${OPENCV_IMGCODECS_LIBRARY}" )
+else(OPENCV_FOUND AND OPENCV_IMGCODECS_LIBRARY)
+   message( WARNING "Could not find optional OPENCV Image Codecs Library" )
+endif(OPENCV_FOUND AND OPENCV_IMGCODECS_LIBRARY)
diff --git a/cmake/CMakeModules/FindOpenCV2.cmake b/cmake/CMakeModules/FindOpenCV2.cmake
new file mode 100644
index 0000000..cf58984
--- /dev/null
+++ b/cmake/CMakeModules/FindOpenCV2.cmake
@@ -0,0 +1,94 @@
+#---
+# File:  FindOpenCV.cmake
+# 
+# Locate OPENCV
+#
+# This module defines:
+#
+# OPENCV_INCLUDE_DIR
+#
+# OPENCV_FOUND, 
+# OPENCV_CORE_FOUND 
+# OPENCV_HIGHGUI_FOUND
+# OPENCV_IMGPROC_FOUND
+# OPENCV_LEGACY_FOUND
+# OPENCV_ML_FOUND 
+#
+# OPENCV_CORE_LIBRARY
+# OPENCV_HIGHGUI_LIBRARY
+# OPENCV_IMGPROC_LIBRARY
+# OPENCV_LEGACY_LIBRARY
+# OPENCV_ML_LIBRARY
+# OPENCV_LIBRARIES
+#
+# Created by Garrett Potts.
+#
+# $Id$
+
+# Find include path:
+find_path(OPENCV_INCLUDE_DIR opencv/cv.h PATHS /home/okramer/dev/opencv-2.4.13.2)
+
+macro(FIND_OPENCV_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+   find_library( ${MYLIBRARY}
+      NAMES "${MYLIBRARYNAME}${OPENCV_RELEASE_POSTFIX}"
+      PATHS
+      /home/okramer/dev/opencv-2.4.13.2/lib
+   )
+
+endmacro(FIND_OPENCV_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+FIND_OPENCV_LIBRARY(OPENCV_CALIB3D_LIBRARY opencv_calib3d)
+FIND_OPENCV_LIBRARY(OPENCV_CONTRIB_LIBRARY opencv_contrib)
+FIND_OPENCV_LIBRARY(OPENCV_CORE_LIBRARY opencv_core)
+FIND_OPENCV_LIBRARY(OPENCV_FEATURES2D_LIBRARY opencv_features2d)
+FIND_OPENCV_LIBRARY(OPENCV_FLANN_LIBRARY opencv_flann)
+FIND_OPENCV_LIBRARY(OPENCV_GPU_LIBRARY opencv_gpu)
+FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
+FIND_OPENCV_LIBRARY(OPENCV_IMGPROC_LIBRARY opencv_imgproc)
+FIND_OPENCV_LIBRARY(OPENCV_LEGACY_LIBRARY opencv_legacy)
+FIND_OPENCV_LIBRARY(OPENCV_ML_LIBRARY opencv_ml)
+FIND_OPENCV_LIBRARY(OPENCV_IMGCODECS_LIBRARY opencv_imgcodecs)
+
+message( STATUS "OPENCV_INCLUDE_DIR        = ${OPENCV_INCLUDE_DIR}" )
+message( STATUS "OPENCV_CALIB3D_LIBRARY    = ${OPENCV_CALIB3D_LIBRARY}" )
+message( STATUS "OPENCV_CONTRIB_LIBRARY    = ${OPENCV_CONTRIB_LIBRARY}" )
+message( STATUS "OPENCV_CORE_LIBRARY       = ${OPENCV_CORE_LIBRARY}" )
+message( STATUS "OPENCV_FEATURES2D_LIBRARY = ${OPENCV_FEATURES2D_LIBRARY}" )
+message( STATUS "OPENCV_FLANN_LIBRARY      = ${OPENCV_FLANN_LIBRARY}" )
+message( STATUS "OPENCV_GPU_LIBRARY        = ${OPENCV_GPU_LIBRARY}" )
+message( STATUS "OPENCV_HIGHGUI_LIBRARY    = ${OPENCV_HIGHGUI_LIBRARY}" )
+message( STATUS "OPENCV_IMGPROC_LIBRARY    = ${OPENCV_IMGPROC_LIBRARY}" )
+message( STATUS "OPENCV_LEGACY_LIBRARY     = ${OPENCV_LEGACY_LIBRARY}" )
+message( STATUS "OPENCV_ML_LIBRARY         = ${OPENCV_ML_LIBRARY}" )
+message( STATUS "OPENCV_IMGCODECS_LIBRARY  = ${OPENCV_IMGCODECS_LIBRARY}" )
+
+
+# Removed OPENCV_GPU_LIBRARY AND (drb 20140220)
+
+set(OPENCV_FOUND "NO")
+if(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+   set(OPENCV_FOUND "YES")
+   set(OPENCV_LIBRARIES ${OPENCV_CALIB3D_LIBRARY} ${OPENCV_CONTRIB_LIBRARY} ${OPENCV_CORE_LIBRARY} ${OPENCV_FEATURES2D_LIBRARY} ${OPENCV_FLANN_LIBRARY} ${OPENCV_HIGHGUI_LIBRARY} ${OPENCV_IMGPROC_LIBRARY} ${OPENCV_LEGACY_LIBRARY} ${OPENCV_ML_LIBRARY})
+   message( STATUS "OPENCV_LIBRARIES          = ${OPENCV_LIBRARIES}" )
+else(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+   message( WARNING "Could not find OPENCV" )
+endif(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+
+set(OPENCV_GPU_FOUND "NO")
+if(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)
+   set(OPENCV_GPU_FOUND "YES")
+   set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_GPU_LIBRARY})
+   message( STATUS "OPENCV_GPU_LIBRARY        = ${OPENCV_GPU_LIBRARY}" )
+else(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)
+   message( WARNING "Could not find optional OPENCV GPU Library. " )
+endif(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)
+
+set(OPENCV_IMGCODECS_FOUND "NO")
+if(OPENCV_FOUND AND OPENCV_IMGCODECS_LIBRARY)
+   set(OPENCV_IMGCODECS_FOUND "YES")
+   set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_IMGCODECS_LIBRARY})
+   message( STATUS "OPENCV_IMGCODECS_LIBRARY  = ${OPENCV_IMGCODECS_LIBRARY}" )
+else(OPENCV_FOUND AND OPENCV_IMGCODECS_LIBRARY)
+   message( WARNING "Could not find optional OPENCV Image Codecs Library" )
+endif(OPENCV_FOUND AND OPENCV_IMGCODECS_LIBRARY)
diff --git a/cmake/CMakeModules/FindOpenJPEG.cmake b/cmake/CMakeModules/FindOpenJPEG.cmake
new file mode 100644
index 0000000..f02c967
--- /dev/null
+++ b/cmake/CMakeModules/FindOpenJPEG.cmake
@@ -0,0 +1,59 @@
+###
+# -*- cmake -*-
+#
+# File:  FindOpenJPEG.cmake
+#
+# Original script was copied from:
+# http://code.google.com/p/emeraldviewer/source/browse/indra/cmake
+#
+# $Id$
+###
+
+# - Find OpenJPEG
+# Find the OpenJPEG includes and library
+# This module defines
+#  OPENJPEG_INCLUDE_DIR, where to find openjpeg.h, etc.
+#  OPENJPEG_LIBRARIES, the libraries needed to use OpenJPEG.
+#  OPENJPEG_FOUND, If false, do not try to use OpenJPEG.
+# also defined, but not for general use are
+#  OPENJPEG_LIBRARY, where to find the OpenJPEG library.
+
+FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h
+  PATHS
+    /usr/local/include/openjpeg
+    /usr/local/include/openjpeg-1.5
+    /usr/local/include
+    /usr/include/openjpeg
+    /usr/include
+  PATH_SUFFIXES
+    openjpeg-2.1
+  DOC "Location of OpenJPEG Headers"
+)
+FIND_LIBRARY(MINIZIP_LIBRARY NAMES ${MINIZIP_NAMES} )
+MARK_AS_ADVANCED( MINIZIP_LIBRARY MINIZIP_INCLUDE_DIR )
+
+SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjp2)
+SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg)
+FIND_LIBRARY(OPENJPEG_LIBRARY
+  NAMES ${OPENJPEG_NAMES}
+  PATHS /usr/lib /usr/local/lib
+  )
+
+IF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
+    SET(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
+    SET(OPENJPEG_FOUND "YES")
+ELSE (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
+  SET(OPENJPEG_FOUND "NO")
+ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)
+
+IF (OPENJPEG_FOUND)
+   IF (NOT OPENJPEG_FIND_QUIETLY)
+      MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}")
+   ENDIF (NOT OPENJPEG_FIND_QUIETLY)
+ELSE (OPENJPEG_FOUND)
+   IF (OPENJPEG_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could not find OpenJPEG library")
+   ENDIF (OPENJPEG_FIND_REQUIRED)
+ENDIF (OPENJPEG_FOUND)
+
+MARK_AS_ADVANCED(OPENJPEG_LIBRARY OPENJPEG_INCLUDE_DIR)
diff --git a/cmake/CMakeModules/FindOssimVideo.cmake b/cmake/CMakeModules/FindOssimVideo.cmake
new file mode 100644
index 0000000..febbc2c
--- /dev/null
+++ b/cmake/CMakeModules/FindOssimVideo.cmake
@@ -0,0 +1,45 @@
+# - Find ossimPredator library
+# Find the native ossimPredator includes and library
+# This module defines
+#  OSSIMVIDEO_INCLUDE_DIR, where to find tiff.h, etc.
+#  OSSIMVIDEO_LIBRARIES, libraries to link against to use ossimPredator.
+#  OSSIMVIDEO_FOUND, If false, do not try to use ossimPredator.
+# also defined, but not for general use are
+#  OSSIMVIDEO_LIBRARY, where to find the ossimPredator library.
+SET(CMAKE_FIND_FRAMEWORK "LAST")
+FIND_PATH(OSSIMVIDEO_INCLUDE_DIR ossimPredator/ossimPredatorExport.h
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/ossim-video/include
+		$ENV{OSSIM_DEV_HOME}/ossim-video/lib
+		$ENV{OSSIM_INSTALL_PREFIX}/include
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/ossim
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		include
+)
+SET(OSSIMVIDEO_NAMES ${OSSIMVIDEO_NAMES} ossim-video )
+FIND_LIBRARY(OSSIMVIDEO_LIBRARY NAMES ${OSSIMVIDEO_NAMES}
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/ossim-video/lib
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/ossim-video/lib
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		Frameworks
+)
+
+# handle the QUIETLY and REQUIRED arguments and set OSSIMVIDEO_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSSIMVIDEO  DEFAULT_MSG  OSSIMVIDEO_LIBRARY  OSSIMVIDEO_INCLUDE_DIR)
+
+IF(OSSIMVIDEO_FOUND)
+  SET( OSSIMVIDEO_LIBRARIES ${OSSIMVIDEO_LIBRARY} )
+  SET( OSSIMVIDEO_INCLUDES ${OSSIMVIDEO_INCLUDE_DIR} )
+ENDIF(OSSIMVIDEO_FOUND)
+
+MARK_AS_ADVANCED(OSSIMVIDEO_INCLUDE_DIR OSSIMVIDEO_LIBRARY)
+
diff --git a/cmake/CMakeModules/FindOssimWMS.cmake b/cmake/CMakeModules/FindOssimWMS.cmake
new file mode 100644
index 0000000..c629039
--- /dev/null
+++ b/cmake/CMakeModules/FindOssimWMS.cmake
@@ -0,0 +1,48 @@
+# - Find wms library
+# Find the native wms includes and library
+# This module defines
+#  OSSIMWMS_INCLUDE_DIR, where to find tiff.h, etc.
+#  OSSIMWMS_LIBRARIES, libraries to link against to use WMS.
+#  OSSIMWMS_FOUND, If false, do not try to use WMS.
+# also defined, but not for general use are
+#  WMS_LIBRARY, where to find the WMS library.
+SET(CMAKE_FIND_FRAMEWORK "LAST")
+FIND_PATH(OSSIMWMS_INCLUDE_DIR wms/wms.h
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/ossim-wms/include
+		$ENV{OSSIM_DEV_HOME}/ossim-wms/lib
+		$ENV{OSSIM_INSTALL_PREFIX}/include
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/ossim-wms
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		include
+
+)
+
+SET(OSSIMWMS_NAMES ${OSSIMWMS_NAMES} wms ossim-wms)
+FIND_LIBRARY(OSSIMWMS_LIBRARY NAMES ${OSSIMWMS_NAMES} 
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/ossim-wms/lib
+		$ENV{OSSIM_DEV_HOME}/ossim-wms
+		$ENV{OSSIM_INSTALL_PREFIX}
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/ossim-wms/lib
+		$ENV{OSSIM_DEV_HOME}/ossim-wms
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		Frameworks
+)
+
+# handle the QUIETLY and REQUIRED arguments and set OSSIMWMS_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSSIMWMS  DEFAULT_MSG  OSSIMWMS_LIBRARY  OSSIMWMS_INCLUDE_DIR)
+
+IF(OSSIMWMS_FOUND)
+  SET( OSSIMWMS_LIBRARIES ${OSSIMWMS_LIBRARY} )
+ENDIF(OSSIMWMS_FOUND)
+
+MARK_AS_ADVANCED(OSSIMWMS_INCLUDE_DIR OSSIMWMS_LIBRARY)
diff --git a/cmake/CMakeModules/FindPDAL.cmake b/cmake/CMakeModules/FindPDAL.cmake
new file mode 100644
index 0000000..f3a97df
--- /dev/null
+++ b/cmake/CMakeModules/FindPDAL.cmake
@@ -0,0 +1,66 @@
+#---
+# File: FindPDAL.cmake
+#
+# Find the native Point Data Abstraction Library(PDAL) includes and libraries.
+#
+# This module defines:
+#
+# PDAL_INCLUDE_DIR, where to find pdal.h, etc.
+# PDAL_LIBRARIES, libraries to link against to use PDAL and rialto.
+# PDAL_FOUND, True if found, false if one of the above are not found.
+# 
+# NOTE: 
+# This script is specialized for ossim, e.g. looking in /usr/local/ossim.
+#
+# $Id$
+#---
+#---
+# Find include path:  "pdal_defines.h" installs to install "prefix" with pdal 
+# includes under "pdal" sub directory.
+#---
+find_path( PDAL_INCLUDE_DIR pdal/pdal.hpp
+           PATHS 
+           ${OSSIM_DEPENDENCIES}/include
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+macro(FIND_PDAL_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+   find_library( ${MYLIBRARY}
+      NAMES "${MYLIBRARYNAME}"
+      PATHS
+      ${OSSIM_DEPENDENCIES}/lib
+      /usr/lib64
+      /usr/lib
+     /usr/local/lib
+   )
+
+endmacro(FIND_PDAL_LIBRARY MYLIBRARY MYLIBRARYNAME)
+
+FIND_PDAL_LIBRARY(PDAL_CPP_LIBRARY pdalcpp)
+FIND_PDAL_LIBRARY(PDAL_UTIL_LIBRARY pdal_util)
+FIND_PDAL_LIBRARY(RIALTO_LIBRARY rialto)
+FIND_PDAL_LIBRARY(LASZIP_LIBRARY laszip)
+
+message( STATUS "PDAL_INCLUDE_DIR             = ${PDAL_INCLUDE_DIR}" )
+message( STATUS "PDAL_CPP_LIBRARY             = ${PDAL_CPP_LIBRARY}" )
+message( STATUS "PDAL_UTIL_LIBRARY            = ${PDAL_UTIL_LIBRARY}" )
+message( STATUS "RIALTO_LIBRARY               = ${RIALTO_LIBRARY}" )
+message( STATUS "LASZIP_LIBRARY               = ${LASZIP_LIBRARY}" )
+
+set(PDAL_FOUND "NO")
+
+if (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY AND RIALTO_LIBRARY AND LASZIP_LIBRARY)
+
+   set(PDAL_FOUND "YES")
+   set(PDAL_LIBRARIES ${PDAL_CPP_LIBRARY} ${PDAL_UTIL_LIBRARY} ${RIALTO_LIBRARY} ${LASZIP_LIBRARY})
+   message( STATUS "PDAL_LIBRARIES = ${PDAL_LIBRARIES}" )
+
+else(PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY AND RIALTO_LIBRARY AND LASZIP_LIBRARY)
+
+   message( WARNING "Could not find PDAL" )
+
+endif(PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY AND RIALTO_LIBRARY AND LASZIP_LIBRARY)
+
+
diff --git a/cmake/CMakeModules/FindPackageHandleStandardArgs.cmake b/cmake/CMakeModules/FindPackageHandleStandardArgs.cmake
new file mode 100644
index 0000000..2de1fb3
--- /dev/null
+++ b/cmake/CMakeModules/FindPackageHandleStandardArgs.cmake
@@ -0,0 +1,382 @@
+#.rst:
+# FindPackageHandleStandardArgs
+# -----------------------------
+#
+#
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ...  )
+#
+# This function is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED, QUIET and version-related arguments to
+# find_package().  It also sets the <packagename>_FOUND variable.  The
+# package is considered found if all variables <var1>...  listed contain
+# valid results, e.g.  valid filepaths.
+#
+# There are two modes of this function.  The first argument in both
+# modes is the name of the Find-module where it is called (in original
+# casing).
+#
+# The first simple mode looks like this:
+#
+# ::
+#
+#     FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name>
+#       (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
+#
+# If the variables <var1> to <varN> are all valid, then
+# <UPPERCASED_NAME>_FOUND will be set to TRUE.  If DEFAULT_MSG is given
+# as second argument, then the function will generate itself useful
+# success and error messages.  You can also supply a custom error
+# message for the failure case.  This is not recommended.
+#
+# The second mode is more powerful and also supports version checking:
+#
+# ::
+#
+#     FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME
+#       [FOUND_VAR <resultVar>]
+#       [REQUIRED_VARS <var1>...<varN>]
+#       [VERSION_VAR   <versionvar>]
+#       [HANDLE_COMPONENTS]
+#       [CONFIG_MODE]
+#       [FAIL_MESSAGE "Custom failure message"] )
+#
+# In this mode, the name of the result-variable can be set either to
+# either <UPPERCASED_NAME>_FOUND or <OriginalCase_Name>_FOUND using the
+# FOUND_VAR option.  Other names for the result-variable are not
+# allowed.  So for a Find-module named FindFooBar.cmake, the two
+# possible names are FooBar_FOUND and FOOBAR_FOUND.  It is recommended
+# to use the original case version.  If the FOUND_VAR option is not
+# used, the default is <UPPERCASED_NAME>_FOUND.
+#
+# As in the simple mode, if <var1> through <varN> are all valid,
+# <packagename>_FOUND will be set to TRUE.  After REQUIRED_VARS the
+# variables which are required for this package are listed.  Following
+# VERSION_VAR the name of the variable can be specified which holds the
+# version of the package which has been found.  If this is done, this
+# version will be checked against the (potentially) specified required
+# version used in the find_package() call.  The EXACT keyword is also
+# handled.  The default messages include information about the required
+# version and the version which has been actually found, both if the
+# version is ok or not.  If the package supports components, use the
+# HANDLE_COMPONENTS option to enable handling them.  In this case,
+# find_package_handle_standard_args() will report which components have
+# been found and which are missing, and the <packagename>_FOUND variable
+# will be set to FALSE if any of the required components (i.e.  not the
+# ones listed after OPTIONAL_COMPONENTS) are missing.  Use the option
+# CONFIG_MODE if your FindXXX.cmake module is a wrapper for a
+# find_package(...  NO_MODULE) call.  In this case VERSION_VAR will be
+# set to <NAME>_VERSION and the macro will automatically check whether
+# the Config module was found.  Via FAIL_MESSAGE a custom failure
+# message can be specified, if this is not used, the default message
+# will be displayed.
+#
+# Example for mode 1:
+#
+# ::
+#
+#     find_package_handle_standard_args(LibXml2  DEFAULT_MSG
+#       LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#
+#
+#
+# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
+# LIBXML2_INCLUDE_DIR are valid.  Then also LIBXML2_FOUND is set to
+# TRUE.  If it is not found and REQUIRED was used, it fails with
+# FATAL_ERROR, independent whether QUIET was used or not.  If it is
+# found, success will be reported, including the content of <var1>.  On
+# repeated Cmake runs, the same message won't be printed again.
+#
+# Example for mode 2:
+#
+# ::
+#
+#     find_package_handle_standard_args(LibXslt
+#       FOUND_VAR LibXslt_FOUND
+#       REQUIRED_VARS LibXslt_LIBRARIES LibXslt_INCLUDE_DIRS
+#       VERSION_VAR LibXslt_VERSION_STRING)
+#
+# In this case, LibXslt is considered to be found if the variable(s)
+# listed after REQUIRED_VAR are all valid, i.e.  LibXslt_LIBRARIES and
+# LibXslt_INCLUDE_DIRS in this case.  The result will then be stored in
+# LibXslt_FOUND .  Also the version of LibXslt will be checked by using
+# the version contained in LibXslt_VERSION_STRING.  Since no
+# FAIL_MESSAGE is given, the default messages will be printed.
+#
+# Another example for mode 2:
+#
+# ::
+#
+#     find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+#     find_package_handle_standard_args(Automoc4  CONFIG_MODE)
+#
+# In this case, FindAutmoc4.cmake wraps a call to find_package(Automoc4
+# NO_MODULE) and adds an additional search directory for automoc4.  Here
+# the result will be stored in AUTOMOC4_FOUND.  The following
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
+# success/error message.
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
+
+# internal helper macro
+macro(_FPHSA_FAILURE_MESSAGE _msg)
+  if (${_NAME}_FIND_REQUIRED)
+    message(FATAL_ERROR "${_msg}")
+  else ()
+    if (NOT ${_NAME}_FIND_QUIETLY)
+      message(STATUS "${_msg}")
+    endif ()
+  endif ()
+endmacro()
+
+
+# internal helper macro to generate the failure message when used in CONFIG_MODE:
+macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+  # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
+  if(${_NAME}_CONFIG)
+    _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
+  else()
+    # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
+    # List them all in the error message:
+    if(${_NAME}_CONSIDERED_CONFIGS)
+      set(configsText "")
+      list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+      math(EXPR configsCount "${configsCount} - 1")
+      foreach(currentConfigIndex RANGE ${configsCount})
+        list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+        list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+        set(configsText "${configsText}    ${filename} (version ${version})\n")
+      endforeach()
+      if (${_NAME}_NOT_FOUND_MESSAGE)
+        set(configsText "${configsText}    Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
+      endif()
+      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
+
+    else()
+      # Simple case: No Config-file was found at all:
+      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
+    endif()
+  endif()
+endmacro()
+
+
+function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+
+# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
+# new extended or in the "old" mode:
+  set(options  CONFIG_MODE  HANDLE_COMPONENTS)
+  set(oneValueArgs  FAIL_MESSAGE  VERSION_VAR  FOUND_VAR)
+  set(multiValueArgs REQUIRED_VARS)
+  set(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
+  list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+  if(${INDEX} EQUAL -1)
+    set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+    set(FPHSA_REQUIRED_VARS ${ARGN})
+    set(FPHSA_VERSION_VAR)
+  else()
+
+    CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
+
+    if(FPHSA_UNPARSED_ARGUMENTS)
+      message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+    endif()
+
+    if(NOT FPHSA_FAIL_MESSAGE)
+      set(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
+    endif()
+  endif()
+
+# now that we collected all arguments, process them
+
+  if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
+    set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+  endif()
+
+  # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
+  # when it successfully found the config-file, including version checking:
+  if(FPHSA_CONFIG_MODE)
+    list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+    list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+    set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+  endif()
+
+  if(NOT FPHSA_REQUIRED_VARS)
+    message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+  endif()
+
+  list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
+
+  string(TOUPPER ${_NAME} _NAME_UPPER)
+  string(TOLOWER ${_NAME} _NAME_LOWER)
+
+  if(FPHSA_FOUND_VAR)
+    if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$"  OR  FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
+      set(_FOUND_VAR ${FPHSA_FOUND_VAR})
+    else()
+      message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
+    endif()
+  else()
+    set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
+  endif()
+
+  # collect all variables which were not found, so they can be printed, so the
+  # user knows better what went wrong (#6375)
+  set(MISSING_VARS "")
+  set(DETAILS "")
+  # check if all passed variables are valid
+  unset(${_FOUND_VAR})
+  foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
+    if(NOT ${_CURRENT_VAR})
+      set(${_FOUND_VAR} FALSE)
+      set(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+    else()
+      set(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+    endif()
+  endforeach()
+  if(NOT "${${_FOUND_VAR}}" STREQUAL "FALSE")
+    set(${_FOUND_VAR} TRUE)
+  endif()
+
+  # component handling
+  unset(FOUND_COMPONENTS_MSG)
+  unset(MISSING_COMPONENTS_MSG)
+
+  if(FPHSA_HANDLE_COMPONENTS)
+    foreach(comp ${${_NAME}_FIND_COMPONENTS})
+      if(${_NAME}_${comp}_FOUND)
+
+        if(NOT DEFINED FOUND_COMPONENTS_MSG)
+          set(FOUND_COMPONENTS_MSG "found components: ")
+        endif()
+        set(FOUND_COMPONENTS_MSG "${FOUND_COMPONENTS_MSG} ${comp}")
+
+      else()
+
+        if(NOT DEFINED MISSING_COMPONENTS_MSG)
+          set(MISSING_COMPONENTS_MSG "missing components: ")
+        endif()
+        set(MISSING_COMPONENTS_MSG "${MISSING_COMPONENTS_MSG} ${comp}")
+
+        if(${_NAME}_FIND_REQUIRED_${comp})
+          set(${_FOUND_VAR} FALSE)
+          set(MISSING_VARS "${MISSING_VARS} ${comp}")
+        endif()
+
+      endif()
+    endforeach()
+    set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
+    set(DETAILS "${DETAILS}[c${COMPONENT_MSG}]")
+  endif()
+
+  # version handling:
+  set(VERSION_MSG "")
+  set(VERSION_OK TRUE)
+  set(VERSION ${${FPHSA_VERSION_VAR}})
+
+  # check with DEFINED here as the requested or found version may be "0"
+  if (DEFINED ${_NAME}_FIND_VERSION)
+    if(DEFINED ${FPHSA_VERSION_VAR})
+
+      if(${_NAME}_FIND_VERSION_EXACT)       # exact version required
+        # count the dots in the version string
+        string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${VERSION}")
+        # add one dot because there is one dot more than there are components
+        string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS)
+        if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT)
+          # Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT
+          # is at most 4 here. Therefore a simple lookup table is used.
+          if (${_NAME}_FIND_VERSION_COUNT EQUAL 1)
+            set(_VERSION_REGEX "[^.]*")
+          elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2)
+            set(_VERSION_REGEX "[^.]*\\.[^.]*")
+          elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3)
+            set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*")
+          else ()
+            set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*")
+          endif ()
+          string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${VERSION}")
+          unset(_VERSION_REGEX)
+          if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD)
+            set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+            set(VERSION_OK FALSE)
+          else ()
+            set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+          endif ()
+          unset(_VERSION_HEAD)
+        else ()
+          if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL VERSION)
+            set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+            set(VERSION_OK FALSE)
+          else ()
+            set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+          endif ()
+        endif ()
+        unset(_VERSION_DOTS)
+
+      else()     # minimum version specified:
+        if (${_NAME}_FIND_VERSION VERSION_GREATER VERSION)
+          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+          set(VERSION_OK FALSE)
+        else ()
+          set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
+        endif ()
+      endif()
+
+    else()
+
+      # if the package was not found, but a version was given, add that to the output:
+      if(${_NAME}_FIND_VERSION_EXACT)
+         set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+      else()
+         set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+      endif()
+
+    endif()
+  else ()
+    if(VERSION)
+      set(VERSION_MSG "(found version \"${VERSION}\")")
+    endif()
+  endif ()
+
+  if(VERSION_OK)
+    set(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+  else()
+    set(${_FOUND_VAR} FALSE)
+  endif()
+
+
+  # print the result:
+  if (${_FOUND_VAR})
+    FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
+  else ()
+
+    if(FPHSA_CONFIG_MODE)
+      _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
+    else()
+      if(NOT VERSION_OK)
+        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+      else()
+        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+      endif()
+    endif()
+
+  endif ()
+
+  set(${_FOUND_VAR} ${${_FOUND_VAR}} PARENT_SCOPE)
+
+endfunction()
diff --git a/cmake/CMakeModules/FindPackageMessage.cmake b/cmake/CMakeModules/FindPackageMessage.cmake
new file mode 100644
index 0000000..a0349d3
--- /dev/null
+++ b/cmake/CMakeModules/FindPackageMessage.cmake
@@ -0,0 +1,57 @@
+#.rst:
+# FindPackageMessage
+# ------------------
+#
+#
+#
+# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
+#
+# This macro is intended to be used in FindXXX.cmake modules files.  It
+# will print a message once for each unique find result.  This is useful
+# for telling the user where a package was found.  The first argument
+# specifies the name (XXX) of the package.  The second argument
+# specifies the message to display.  The third argument lists details
+# about the find result so that if they change the message will be
+# displayed again.  The macro also obeys the QUIET argument to the
+# find_package command.
+#
+# Example:
+#
+# ::
+#
+#   if(X11_FOUND)
+#     FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
+#       "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
+#   else()
+#    ...
+#   endif()
+
+#=============================================================================
+# Copyright 2008-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+function(FIND_PACKAGE_MESSAGE pkg msg details)
+  # Avoid printing a message repeatedly for the same find result.
+  if(NOT ${pkg}_FIND_QUIETLY)
+    string(REPLACE "\n" "" details "${details}")
+    set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
+    if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
+      # The message has not yet been printed.
+      message(STATUS "${msg}")
+
+      # Save the find details in the cache to avoid printing the same
+      # message again.
+      set("${DETAILS_VAR}" "${details}"
+        CACHE INTERNAL "Details about finding ${pkg}")
+    endif()
+  endif()
+endfunction()
diff --git a/cmake/CMakeModules/FindPodofo.cmake b/cmake/CMakeModules/FindPodofo.cmake
new file mode 100644
index 0000000..266c66b
--- /dev/null
+++ b/cmake/CMakeModules/FindPodofo.cmake
@@ -0,0 +1,25 @@
+#---
+# File: FindPodofo.cmake
+#
+# Find the native podofo includes and library
+#
+# This module defines:
+#  PODOFO_INCLUDE_DIR, where to find tiff.h, etc.
+#  PODOFO_LIBRARY, library to link against to use PODOFO.
+#  PODOFO_FOUND, If false, do not try to use PODOFO.
+# 
+# $Id$
+#---
+
+# Find include path:
+find_path(PODOFO_INCLUDE_DIR podofo/podofo.h PATHS /usr/include /usr/local/include
+)
+
+# Find library:
+find_library(PODOFO_LIBRARY NAMES podofo PATHS /usr/lib64 /usr/lib /usr/local/lib)
+
+#---
+# This function sets PODOFO_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PODOFO  DEFAULT_MSG  PODOFO_LIBRARY  PODOFO_INCLUDE_DIR)
diff --git a/cmake/CMakeModules/FindPostgreSQL.cmake b/cmake/CMakeModules/FindPostgreSQL.cmake
new file mode 100644
index 0000000..d05d3da
--- /dev/null
+++ b/cmake/CMakeModules/FindPostgreSQL.cmake
@@ -0,0 +1,192 @@
+#.rst:
+# FindPostgreSQL
+# --------------
+#
+# Find the PostgreSQL installation.
+#
+# This module defines
+#
+# ::
+#
+#   PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking
+#   PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers
+#   PostgreSQL_LIBRARY_DIRS  - the link directories for PostgreSQL libraries
+#   PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8)
+
+#=============================================================================
+# Copyright 2004-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+# ----------------------------------------------------------------------------
+# History:
+# This module is derived from the module originally found in the VTK source tree.
+#
+# ----------------------------------------------------------------------------
+# Note:
+# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the
+# version mumber of the implementation of PostgreSQL.
+# In Windows the default installation of PostgreSQL uses that as part of the path.
+# E.g C:\Program Files\PostgreSQL\8.4.
+# Currently, the following version numbers are known to this module:
+# "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0"
+#
+# To use this variable just do something like this:
+# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
+# before calling find_package(PostgreSQL) in your CMakeLists.txt file.
+# This will mean that the versions you set here will be found first in the order
+# specified before the default ones are searched.
+#
+# ----------------------------------------------------------------------------
+# You may need to manually set:
+#  PostgreSQL_INCLUDE_DIR  - the path to where the PostgreSQL include files are.
+#  PostgreSQL_LIBRARY_DIR  - The path to where the PostgreSQL library files are.
+# If FindPostgreSQL.cmake cannot find the include files or the library files.
+#
+# ----------------------------------------------------------------------------
+# The following variables are set if PostgreSQL is found:
+#  PostgreSQL_FOUND         - Set to true when PostgreSQL is found.
+#  PostgreSQL_INCLUDE_DIRS  - Include directories for PostgreSQL
+#  PostgreSQL_LIBRARY_DIRS  - Link directories for PostgreSQL libraries
+#  PostgreSQL_LIBRARIES     - The PostgreSQL libraries.
+#
+# ----------------------------------------------------------------------------
+# If you have installed PostgreSQL in a non-standard location.
+# (Please note that in the following comments, it is assumed that <Your Path>
+# points to the root directory of the include directory of PostgreSQL.)
+# Then you have three options.
+# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to <Your Path>/include and
+#    PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
+# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
+#    to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
+#    set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
+# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have
+#    installed PostgreSQL, e.g. <Your Path>.
+#
+# ----------------------------------------------------------------------------
+
+set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
+set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")
+set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.")
+set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}")
+set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
+
+
+set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
+    "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
+
+# Define additional search paths for root directories.
+set( PostgreSQL_ROOT_DIRECTORIES
+   ENV PostgreSQL_ROOT
+   ${PostgreSQL_ROOT}
+)
+foreach(suffix ${PostgreSQL_KNOWN_VERSIONS})
+  if(WIN32)
+    list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
+        "PostgreSQL/${suffix}/lib")
+    list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
+        "PostgreSQL/${suffix}/include")
+    list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
+        "PostgreSQL/${suffix}/include/server")
+  endif()
+  if(UNIX)
+    list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
+        "postgresql/${suffix}/server")
+  endif()
+endforeach()
+
+#
+# Look for an installation.
+#
+find_path(PostgreSQL_INCLUDE_DIR
+  NAMES libpq-fe.h
+  PATHS
+   # Look in other places.
+   ${PostgreSQL_ROOT_DIRECTORIES}
+  PATH_SUFFIXES
+    pgsql
+    postgresql
+    include
+    ${PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES}
+  # Help the user find it if we cannot.
+  DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
+)
+
+find_path(PostgreSQL_TYPE_INCLUDE_DIR
+  NAMES catalog/pg_type.h
+  PATHS
+   # Look in other places.
+   ${PostgreSQL_ROOT_DIRECTORIES}
+  PATH_SUFFIXES
+    postgresql
+    pgsql/server
+    postgresql/server
+    include/server
+    ${PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES}
+  # Help the user find it if we cannot.
+  DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
+)
+
+# The PostgreSQL library.
+set (PostgreSQL_LIBRARY_TO_FIND pq)
+# Setting some more prefixes for the library
+set (PostgreSQL_LIB_PREFIX "")
+if ( WIN32 )
+  set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib")
+  set (PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND})
+endif()
+
+find_library(PostgreSQL_LIBRARY
+ NAMES ${PostgreSQL_LIBRARY_TO_FIND}
+ PATHS
+   ${PostgreSQL_ROOT_DIRECTORIES}
+ PATH_SUFFIXES
+   lib
+   ${PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES}
+ # Help the user find it if we cannot.
+ DOC "The ${PostgreSQL_LIBRARY_DIR_MESSAGE}"
+)
+get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
+
+if (PostgreSQL_INCLUDE_DIR)
+  # Some platforms include multiple pg_config.hs for multi-lib configurations
+  # This is a temporary workaround.  A better solution would be to compile
+  # a dummy c file and extract the value of the symbol.
+  file(GLOB _PG_CONFIG_HEADERS "${PostgreSQL_INCLUDE_DIR}/pg_config*.h")
+  foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
+    if(EXISTS "${_PG_CONFIG_HEADER}")
+      file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
+           REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
+      if(pgsql_version_str)
+        string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*"
+               "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}")
+        break()
+      endif()
+    endif()
+  endforeach()
+  unset(pgsql_version_str)
+endif()
+
+# Did we find anything?
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(PostgreSQL
+                                  REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR
+                                  VERSION_VAR PostgreSQL_VERSION_STRING)
+set(PostgreSQL_FOUND  ${POSTGRESQL_FOUND})
+
+# Now try to get the include and library path.
+if(PostgreSQL_FOUND)
+  set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ${PostgreSQL_TYPE_INCLUDE_DIR} )
+  set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} )
+  set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY_TO_FIND})
+endif()
+
+mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR PostgreSQL_LIBRARY )
diff --git a/cmake/CMakeModules/FindPotrace.cmake b/cmake/CMakeModules/FindPotrace.cmake
new file mode 100644
index 0000000..68a12de
--- /dev/null
+++ b/cmake/CMakeModules/FindPotrace.cmake
@@ -0,0 +1,46 @@
+#---
+# File: FindPotrace.cmake
+#
+# Find the Potrace includes and libraries.
+#
+# This module defines:
+#
+# POTRACE_INCLUDE_DIR, where to find potracelib.h, etc.
+# POTRACE_LIBRARIES, libraries to link against to use Potrace and rialto.
+# POTRACE_FOUND, True if found, false if one of the above are not found.
+# 
+find_path( POTRACE_INCLUDE_DIR potracelib.h
+           PATHS 
+           ${OSSIM_DEPENDENCIES}/include
+           /usr/include
+           /usr/local/include
+           /usr/local/ossim/include )
+
+find_library( POTRACE_LIBRARY
+      NAMES "potrace"
+      PATHS
+      ${OSSIM_DEPENDENCIES}/lib
+      /usr/lib64
+      /usr/lib
+     /usr/local/lib
+   )
+
+
+message( STATUS "POTRACE_INCLUDE_DIR             = ${POTRACE_INCLUDE_DIR}" )
+message( STATUS "POTRACE_LIBRARY                 = ${POTRACE_LIBRARY}" )
+
+set(POTRACE_FOUND "NO")
+
+if (POTRACE_INCLUDE_DIR AND POTRACE_LIBRARY )
+
+   set(POTRACE_FOUND "YES")
+   set(POTRACE_LIBRARIES ${POTRACE_LIBRARY} )
+   message( STATUS "POTRACE_LIBRARIES = ${POTRACE_LIBRARIES}" )
+
+else(POTRACE_INCLUDE_DIR AND POTRACE_LIBRARY)
+
+   message( WARNING "Could not find Potrace" )
+
+endif(POTRACE_INCLUDE_DIR AND POTRACE_LIBRARY)
+
+
diff --git a/cmake/CMakeModules/FindQt5.cmake b/cmake/CMakeModules/FindQt5.cmake
new file mode 100644
index 0000000..604889d
--- /dev/null
+++ b/cmake/CMakeModules/FindQt5.cmake
@@ -0,0 +1,165 @@
+# - Find Qt5
+# This module can be used to find Qt5.
+# The most important issues are that Qt5 pkgconfig files are installed with PKG_CONFIG_PATH properly
+# set, and that Qt5 qmake is available via the system path.
+# This module defines a number of key variables and macros.
+#
+#  Below is a detailed list of variables that FindQt5.cmake sets.
+#  QT_FOUND                     If false, don't try to use Qt.
+#  QT5_FOUND                    If false, don't try to use Qt5.
+#
+#  QT_VERSION_MAJOR             The major version of Qt found.
+#  QT_VERSION_MINOR             The minor version of Qt found.
+#  QT_VERSION_PATCH             The patch version of Qt found.
+#
+#  QT_BINARY_DIR                Path to "bin" of Qt4
+#  QT_DOC_DIR                   Path to "doc" of Qt4
+#
+#  QT_QTCORE_FOUND              True if QtCore was found.
+#  QT_QTGUI_FOUND               True if QtGui was found.
+#  QT_QTDBUS_FOUND              True if QtDBus was found.
+#  QT_QTNETWORK_FOUND           True if QtNetwork was found.
+#  QT_QTTEST_FOUND              True if QtTest was found.
+#  QT_QTWIDGETS_FOUND           True if QtWidgets was found.
+#  QT_QTXML_FOUND               True if QtXml was found.
+#
+#  QT_INCLUDES                  List of paths to all include directories of Qt5.
+#  QT_INCLUDE_DIR               Path to "include" of Qt4
+#  QT_QTCORE_INCLUDE_DIR        Path to "include/QtCore"
+#  QT_QTDBUS_INCLUDE_DIR        Path to "include/QtDBus"
+#  QT_QTGUI_INCLUDE_DIR         Path to "include/QtGui"
+#  QT_QTNETWORK_INCLUDE_DIR     Path to "include/QtNetwork"
+#  QT_QTTEST_INCLUDE_DIR        Path to "include/QtTest"
+#  QT_QTWIDGETS_INCLUDE_DIR     Path to "include/QtWidgets"
+#  QT_QTXML_INCLUDE_DIR         Path to "include/QtXml"
+#
+#  QT_LIBRARIES                 List of paths to all libraries of Qt5.
+#  QT_LIBRARY_DIR               Path to "lib" of Qt4
+#  QT_QTCORE_LIBRARY            The QtCore library
+#  QT_QTDBUS_LIBRARY            The QtDBus library
+#  QT_QTGUI_LIBRARY             The QtGui library
+#  QT_QTNETWORK_LIBRARY         The QtNetwork library
+#  QT_QTTEST_LIBRARY            The QtTest library
+#  QT_QTWIDGETS_LIBRARY         The QtWidgets library
+#  QT_QTXML_LIBRARY             The QtXml library
+#
+# also defined, but NOT for general use are
+#  QT_MOC_EXECUTABLE            Where to find the moc tool
+#  QT_CONFIG_FLAGS              Flags used when building Qt
+
+# Copyright (C) 2001-2009 Kitware, Inc.
+# Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+# Copyright (C) 2011 Nokia Corporation
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+IF(QT_INCLUDES AND QT_LIBRARIES AND QT_MAJOR_VERSION MATCHES 5)
+  # Already in cache, be silent
+  SET(QT_FOUND TRUE)
+  SET(QT5_FOUND TRUE)
+  RETURN()
+ENDIF(QT_INCLUDES AND QT_LIBRARIES AND QT_MAJOR_VERSION MATCHES 5)
+
+IF(NOT QT_QMAKE_EXECUTABLE)
+  FIND_PROGRAM(QT_QMAKE_EXECUTABLE_FINDQT NAMES qmake qmake5 qmake-qt5
+               PATHS "${QT_SEARCH_PATH}/bin" "$ENV{QTDIR}/bin")
+  SET(QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE_FINDQT} CACHE PATH "Qt qmake program.")
+ENDIF(NOT QT_QMAKE_EXECUTABLE)
+
+EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
+IF(NOT QTVERSION MATCHES "5.*")
+  SET(QT_FOUND FALSE)
+  SET(QT5_FOUND FALSE)
+  IF(Qt5_FIND_REQUIRED)
+    MESSAGE(FATAL_ERROR "CMake was unable to find Qt5, put qmake in your path or set QTDIR/QT_QMAKE_EXECUTABLE.")
+  ENDIF(Qt5_FIND_REQUIRED)
+  RETURN()
+ENDIF(NOT QTVERSION MATCHES "5.*")
+
+# FIND_PACKAGE(PkgConfig REQUIRED)
+
+IF(NOT Qt5_FIND_COMPONENTS)
+  SET(_COMPONENTS QtCore QtDBus QtGui QtNetwork QtTest QtWidgets QtXml)
+ELSE(NOT Qt5_FIND_COMPONENTS)
+  SET(_COMPONENTS ${Qt5_FIND_COMPONENTS})
+ENDIF(NOT Qt5_FIND_COMPONENTS)
+
+FOREACH(_COMPONENT ${_COMPONENTS})
+  STRING(TOUPPER ${_COMPONENT} _COMPONENT_UPPER)
+  IF(NOT QT_${_COMPONENT_UPPER}_FOUND)
+    IF(Qt5_FIND_REQUIRED)
+      PKG_CHECK_MODULES(PC_${_COMPONENT} REQUIRED ${_COMPONENT}>=${QT_MIN_VERSION})
+    ELSE(Qt5_FIND_REQUIRED)
+      PKG_CHECK_MODULES(PC_${_COMPONENT} QUIET ${_COMPONENT}>=${QT_MIN_VERSION})
+    ENDIF(Qt5_FIND_REQUIRED)
+
+    SET(QT_${_COMPONENT_UPPER}_INCLUDE_DIR ${PC_${_COMPONENT}_INCLUDE_DIRS})
+
+    FIND_LIBRARY(QT_${_COMPONENT_UPPER}_LIBRARY
+                 NAMES ${_COMPONENT}
+                 HINTS
+                 ${PC_${_COMPONENT}_LIBDIR})
+
+    SET(QT_${_COMPONENT_UPPER}_FOUND ${PC_${_COMPONENT}_FOUND})
+
+    #MESSAGE(STATUS "COMPONENT ${_COMPONENT_UPPER}:")
+    #MESSAGE(STATUS "  QT_${_COMPONENT_UPPER}_LIBRARY: ${QT_${_COMPONENT_UPPER}_LIBRARY}")
+    #MESSAGE(STATUS "  QT_${_COMPONENT_UPPER}_INCLUDE_DIR: ${QT_${_COMPONENT_UPPER}_INCLUDE_DIR}")
+    #MESSAGE(STATUS "  QT_${_COMPONENT_UPPER}_FOUND: ${QT_${_COMPONENT_UPPER}_FOUND}")
+
+    SET(QT_INCLUDES ${QT_INCLUDES} ${QT_${_COMPONENT_UPPER}_INCLUDE_DIR})
+    SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${_COMPONENT_UPPER}_INCLUDE_DIR})
+    MARK_AS_ADVANCED(QT_${_COMPONENT_UPPER}_LIBRARY QT_${_COMPONENT_UPPER}_INCLUDE_DIR)
+  ENDIF(NOT QT_${_COMPONENT_UPPER}_FOUND)
+ENDFOREACH(_COMPONENT)
+
+#MESSAGE(STATUS "QT_LIBRARIES: ${QT_LIBRARIES}")
+#MESSAGE(STATUS "QT_INCLUDES: ${QT_INCLUDES}")
+
+STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
+STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
+STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
+
+IF(NOT QT_INCLUDE_DIR)
+  EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_HEADERS" OUTPUT_VARIABLE QTHEADERS)
+  SET(QT_INCLUDE_DIR ${QTHEADERS} CACHE INTERNAL "" FORCE)
+ENDIF(NOT QT_INCLUDE_DIR)
+
+IF(NOT QT_LIBRARY_DIR)
+  EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_LIBS" OUTPUT_VARIABLE QTLIBS)
+  SET(QT_LIBRARY_DIR ${QTLIBS} CACHE INTERNAL "" FORCE)
+ENDIF(NOT QT_LIBRARY_DIR)
+
+IF(NOT QT_BINARY_DIR)
+  EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_BINS" OUTPUT_VARIABLE QTBINS)
+  SET(QT_BINARY_DIR ${QTBINS} CACHE INTERNAL "" FORCE)
+ENDIF(NOT QT_BINARY_DIR)
+
+IF(NOT QT_DOC_DIR)
+  EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_DOCS" OUTPUT_VARIABLE QTDOCS)
+  SET(QT_DOC_DIR ${QTDOCS} CACHE INTERNAL "" FORCE)
+ENDIF(NOT QT_DOC_DIR)
+
+IF(NOT QT_MOC_EXECUTABLE)
+  FIND_PROGRAM(QT_MOC_EXECUTABLE NAMES moc moc5 moc-qt5 PATHS ${QT_BINARY_DIR}
+               NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ENDIF(NOT QT_MOC_EXECUTABLE)
+
+MARK_AS_ADVANCED(QT_INCLUDES QT_INCLUDE_DIR
+                 QT_LIBRARIES QT_LIBRARY_DIR
+                 QT_BINARY_DIR
+                 QT_DOC_DIR
+                 QT_QMAKE_EXECUTABLE_FINDQT QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE)
+
+# Invokes pkgconfig, cleans up the result and sets variables
+#EXECUTE_PROCESS(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable qt_config QtCore
+#    OUTPUT_VARIABLE _pkgconfig_flags
+#    RESULT_VARIABLE _pkgconfig_failed)
+#STRING(REPLACE " " ";" QT_CONFIG_FLAGS "${_pkgconfig_flags}")
+
+INCLUDE(Qt5Macros)
+
+SET(QT_FOUND TRUE)
+SET(QT5_FOUND TRUE)
+
diff --git a/cmake/CMakeModules/FindRapier.cmake b/cmake/CMakeModules/FindRapier.cmake
new file mode 100644
index 0000000..067ccc1
--- /dev/null
+++ b/cmake/CMakeModules/FindRapier.cmake
@@ -0,0 +1,47 @@
+#---
+# File: FindRapier.cmake
+#
+# Find the native rapier includes and library
+#
+# This module defines
+#  RAPIER_INCLUDE_DIR, where to find tiff.h, etc.
+#  RAPIER_LIBRARIES, libraries to link against to use RAPIER.
+#  RAPIER_FOUND, If false, do not try to use RAPIER.
+# also defined, but not for general use are
+#  RAPIER_LIBRARY, where to find the RAPIER library.
+# 
+# $Id$
+#---
+
+find_path(RAPIER_INCLUDE_DIR rapier/common/rapierConstants.h
+   HINTS	
+      $ENV{OSSIM_DEV_HOME}/Rapier/include
+      $ENV{OSSIM_INSTALL_PREFIX}/include
+   PATHS
+      $ENV{OSSIM_DEV_HOME}/Rapier
+      $ENV{OSSIM_INSTALL_PREFIX}
+   PATH_SUFFIXES 
+      include
+)
+
+find_library(RAPIER_LIBRARY
+   NAMES rapier
+   HINTS 
+      $ENV{OSSIM_DEV_HOME}/Rapier/lib
+      $ENV{OSSIM_DEV_HOME}/build/lib
+   PATHS
+      $ENV{OSSIM_DEV_HOME}/Rapier/lib
+      $ENV{OSSIM_INSTALL_PREFIX}
+   PATH_SUFFIXES 
+      lib
+)
+
+#---
+# This function sets RAPIER_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(RAPIER  DEFAULT_MSG  RAPIER_LIBRARY  RAPIER_INCLUDE_DIR)
+
+if(RAPIER_FOUND)
+  set( RAPIER_LIBRARIES ${RAPIER_LIBRARY} )
+endif(RAPIER_FOUND)
diff --git a/cmake/CMakeModules/FindRegex.cmake b/cmake/CMakeModules/FindRegex.cmake
new file mode 100644
index 0000000..bcae6f9
--- /dev/null
+++ b/cmake/CMakeModules/FindRegex.cmake
@@ -0,0 +1,64 @@
+#                                               -*- cmake -*-
+#
+#  FindRegex.cmake: Try to find Regex
+#
+#  Copyright (C) 2005-2013 EDF-EADS-Phimeca
+#
+#  This library is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  along with this library.  If not, see <http://www.gnu.org/licenses/>.
+#
+#  @author dutka
+#  @date   2010-02-04 16:44:49 +0100 (Thu, 04 Feb 2010)
+#
+#
+# - Try to find Regex
+# Once done this will define
+#
+#  REGEX_FOUND - System has Regex
+#  REGEX_INCLUDE_DIR - The Regex include directory
+#  REGEX_LIBRARIES - The libraries needed to use Regex
+#  REGEX_DEFINITIONS - Compiler switches required for using Regex
+
+IF (REGEX_INCLUDE_DIR AND REGEX_LIBRARIES)
+   # in cache already
+   SET(Regex_FIND_QUIETLY TRUE)
+ENDIF (REGEX_INCLUDE_DIR AND REGEX_LIBRARIES)
+
+#IF (NOT WIN32)
+#   # use pkg-config to get the directories and then use these values
+#   # in the FIND_PATH() and FIND_LIBRARY() calls
+#   FIND_PACKAGE(PkgConfig)
+#   PKG_CHECK_MODULES(PC_REGEX regex)
+#   SET(REGEX_DEFINITIONS ${PC_REGEX_CFLAGS_OTHER})
+#ENDIF (NOT WIN32)
+
+FIND_PATH(REGEX_INCLUDE_DIR regex.h
+   HINTS
+   ${REGEX_INCLUDEDIR}
+   ${PC_LIBXML_INCLUDE_DIRS}
+   PATH_SUFFIXES regex
+   )
+
+FIND_LIBRARY(REGEX_LIBRARIES NAMES c regex
+   HINTS
+   ${PC_REGEX_LIBDIR}
+   ${PC_REGEX_LIBRARY_DIRS}
+   )
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+# handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if 
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Regex DEFAULT_MSG REGEX_LIBRARIES REGEX_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(REGEX_INCLUDE_DIR REGEX_LIBRARIES)
diff --git a/cmake/CMakeModules/FindSQLITE.cmake b/cmake/CMakeModules/FindSQLITE.cmake
new file mode 100644
index 0000000..cedcb83
--- /dev/null
+++ b/cmake/CMakeModules/FindSQLITE.cmake
@@ -0,0 +1,61 @@
+#---
+# File: FindSQLITE.cmake
+#
+# Find the native SQLite includes and libraries.
+#
+# This module defines:
+#
+# SQLITE_INCLUDE_DIR, where to find sqlite3.h, etc.
+# SQLITE_LIBRARY, libraries to link against to use SQLITE.
+# SQLITE_FOUND, True if found, false if one of the above are not found.
+# 
+# For ossim, typically SQLite will be system installed which should be found; 
+# or found in the ossim 3rd party dependencies directory from a SQLite build 
+# and install.  If the latter it will rely on CMAKE_INCLUDE_PATH and 
+# CMAKE_LIBRARY_PATH having the path to the party dependencies directory.
+# 
+# $Id$
+#---
+
+#---
+# Find include path:
+#---
+find_path( SQLITE_INCLUDE_DIR sqlite3.h
+           PATHS 
+           /usr/include
+           /usr/local/include )
+
+# Find SQLITE library:
+find_library( SQLITE_LIB NAMES sqlite3
+              PATHS 
+              /usr/lib64 
+              /usr/lib 
+              /usr/local/lib )
+
+# Set the SQLITE_LIBRARY:
+if( SQLITE_LIB )
+   set( SQLITE_LIBRARY ${SQLITE_LIB} CACHE STRING INTERNAL )
+endif(SQLITE_LIB )
+
+#---
+# This function sets SQLITE_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( SQLITE DEFAULT_MSG 
+                                   SQLITE_LIBRARY 
+                                   SQLITE_INCLUDE_DIR )
+
+if( SQLITE_FOUND )
+   if( NOT SQLITE_FIND_QUIETLY )
+      message( STATUS "Found SQLITE..." )
+   endif( NOT SQLITE_FIND_QUIETLY )
+else( SQLITE_FOUND )
+   if( NOT SQLITE_FIND_QUIETLY )
+      message( WARNING "Could not find SQLITE" )
+   endif( NOT SQLITE_FIND_QUIETLY )
+endif( SQLITE_FOUND )
+
+if( NOT SQLITE_FIND_QUIETLY )
+   message( STATUS "SQLITE_INCLUDE_DIR=${SQLITE_INCLUDE_DIR}" )
+   message( STATUS "SQLITE_LIBRARY=${SQLITE_LIBRARY}" )
+endif( NOT SQLITE_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindStlPort.cmake b/cmake/CMakeModules/FindStlPort.cmake
new file mode 100755
index 0000000..ee2b969
--- /dev/null
+++ b/cmake/CMakeModules/FindStlPort.cmake
@@ -0,0 +1,26 @@
+#---
+# $Id$
+#
+# Find the stlport includes and library
+# 
+# This module defines:
+#  STLPORT_INCLUDE_DIR, where to find iostream, string, etc.
+#  STLPORT_LIBRARIES, libraries to link against to use StlPort.
+#  STLPORT_FOUND, If false, do not try to use STLPORT.
+#---
+
+FIND_PATH(STLPORT_INCLUDE_DIR iostream PATHS C:/STLport-5.2.1/stlport D:/STLport-5.2.1/stlport)
+
+SET(STLPORT_NAMES ${STLPORT_NAMES} stlport5.2.lib)
+FIND_LIBRARY(STLPORT_LIBRARY NAMES ${STLPORT_NAMES} )
+
+# handle the QUIETLY and REQUIRED arguments and set STLPORT_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(STLPORT  DEFAULT_MSG  STLPORT_LIBRARY  STLPORT_INCLUDE_DIR)
+
+IF(STLPORT_FOUND)
+  SET( STLPORT_LIBRARIES ${STLPORT_LIBRARY} )
+ENDIF(STLPORT_FOUND)
+
+MARK_AS_ADVANCED(STLPORT_INCLUDE_DIR STLPORT_LIBRARY)
diff --git a/cmake/CMakeModules/FindSubversion.cmake b/cmake/CMakeModules/FindSubversion.cmake
new file mode 100644
index 0000000..a88f633
--- /dev/null
+++ b/cmake/CMakeModules/FindSubversion.cmake
@@ -0,0 +1,148 @@
+# - Extract information from a subversion working copy
+# The module defines the following variables:
+#  Subversion_SVN_EXECUTABLE - path to svn command line client
+#  Subversion_VERSION_SVN - version of svn command line client
+#  Subversion_FOUND - true if the command line client was found
+#  SUBVERSION_FOUND - same as Subversion_FOUND, set for compatiblity reasons
+#
+# The minimum required version of Subversion can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
+#
+# If the command line client executable is found two macros are defined:
+#  Subversion_WC_INFO(<dir> <var-prefix>)
+#  Subversion_WC_LOG(<dir> <var-prefix>)
+# Subversion_WC_INFO extracts information of a subversion working copy at
+# a given location. This macro defines the following variables:
+#  <var-prefix>_WC_URL - url of the repository (at <dir>)
+#  <var-prefix>_WC_ROOT - root url of the repository
+#  <var-prefix>_WC_REVISION - current revision
+#  <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
+#  <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
+#  <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
+#  <var-prefix>_WC_INFO - output of command `svn info <dir>'
+# Subversion_WC_LOG retrieves the log message of the base revision of a
+# subversion working copy at a given location. This macro defines the
+# variable:
+#  <var-prefix>_LAST_CHANGED_LOG - last log of base revision
+# Example usage:
+#  FIND_PACKAGE(Subversion)
+#  IF(SUBVERSION_FOUND)
+#    Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+#    MESSAGE("Current revision is ${Project_WC_REVISION}")
+#    Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
+#    MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
+#  ENDIF(SUBVERSION_FOUND)
+#
+# History (yyyymmdd):
+# 20121002 - Modified to "continue on" if svn is not found. (drb) 
+#
+#=============================================================================
+# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006 Tristan Carel
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn
+  DOC "subversion command line client")
+MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
+
+IF(Subversion_SVN_EXECUTABLE)
+  # the subversion commands should be executed with the C locale, otherwise
+  # the message (which are parsed) may be translated, Alex
+  SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
+  SET(ENV{LC_ALL} C)
+
+  EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
+    OUTPUT_VARIABLE Subversion_VERSION_SVN
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+  # restore the previous LC_ALL
+  SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
+
+  STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
+    "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
+
+  MACRO(Subversion_WC_INFO dir prefix)
+    # the subversion commands should be executed with the C locale, otherwise
+    # the message (which are parsed) may be translated, Alex
+    SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
+    SET(ENV{LC_ALL} C)
+
+    EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
+      OUTPUT_VARIABLE ${prefix}_WC_INFO
+      ERROR_VARIABLE Subversion_svn_info_error
+      RESULT_VARIABLE Subversion_svn_info_result
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+    IF(NOT ${Subversion_svn_info_result} EQUAL 0)
+      MESSAGE(WARNING "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
+    ELSE(NOT ${Subversion_svn_info_result} EQUAL 0)
+
+      STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
+        "\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
+      STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+        "\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
+      STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
+        "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
+      STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
+        "\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}")
+      STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
+        "\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}")
+      STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
+        "\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
+
+    ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0)
+
+    # restore the previous LC_ALL
+    SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
+
+  ENDMACRO(Subversion_WC_INFO)
+
+  MACRO(Subversion_WC_LOG dir prefix)
+    # This macro can block if the certificate is not signed:
+    # svn ask you to accept the certificate and wait for your answer
+    # This macro requires a svn server network access (Internet most of the time)
+    # and can also be slow since it access the svn server
+    EXECUTE_PROCESS(COMMAND
+      ${Subversion_SVN_EXECUTABLE} --non-interactive log -r BASE ${dir}
+      OUTPUT_VARIABLE ${prefix}_LAST_CHANGED_LOG
+      ERROR_VARIABLE Subversion_svn_log_error
+      RESULT_VARIABLE Subversion_svn_log_result
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+    IF(NOT ${Subversion_svn_log_result} EQUAL 0)
+      MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Subversion_svn_log_error}")
+    ENDIF(NOT ${Subversion_svn_log_result} EQUAL 0)
+  ENDMACRO(Subversion_WC_LOG)
+
+ENDIF(Subversion_SVN_EXECUTABLE)
+
+#---
+# This function sets GEOS_FOUND if variables are valid.
+#--- 	
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( SUBVERSION DEFAULT_MSG
+                                   Subversion_SVN_EXECUTABLE 
+                                   Subversion_VERSION_SVN )
+
+if( SUBVERSION_FOUND )
+   if( NOT SUBVERSION_FIND_QUIETLY )
+      message( STATUS "Found SUBVERSION..." )
+   endif( NOT SUBVERSION_FIND_QUIETLY )
+else( SUBVERSION_FOUND )
+   if( NOT SUBVERSION_FIND_QUIETLY )
+      message( WARNING "Could not find SUBVERSION" )
+   endif( NOT SUBVERSION_FIND_QUIETLY )
+endif( SUBVERSION_FOUND )
+
+if( NOT SUBVERSION_FIND_QUIETLY )
+   message( STATUS "Subversion_VERSION_SVN=${Subversion_VERSION_SVN}" )
+endif( NOT SUBVERSION_FIND_QUIETLY )
diff --git a/cmake/CMakeModules/FindTIFF.cmake b/cmake/CMakeModules/FindTIFF.cmake
new file mode 100644
index 0000000..a4afe8f
--- /dev/null
+++ b/cmake/CMakeModules/FindTIFF.cmake
@@ -0,0 +1,56 @@
+# - Find TIFF library
+# Find the native TIFF includes and library
+# This module defines
+#  TIFF_INCLUDE_DIR, where to find tiff.h, etc.
+#  TIFF_LIBRARIES, libraries to link against to use TIFF.
+#  TIFF_FOUND, If false, do not try to use TIFF.
+# also defined, but not for general use are
+#  TIFF_LIBRARY, where to find the TIFF library.
+
+#=============================================================================
+# Copyright 2002-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+FIND_PATH(TIFF_INCLUDE_DIR tiff.h
+          PATHS 
+          $ENV{TIFF_DIR}/include
+          $ENV{TIFF_DIR}/include/tiff
+          ${CMAKE_INSTALL_PREFIX}/include
+          /usr/local/include 
+          /usr/local/include/tiff
+          /usr/include/
+          /usr/include/tiff)
+
+
+SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff_i libtiff tiff3 libtiff3)
+
+# Added x86_64-linux-gnu path for Ubuntu install
+FIND_LIBRARY(TIFF_LIBRARY 
+             NAMES ${TIFF_NAMES} 
+             PATHS 
+             $ENV{TIFF_DIR}/lib
+             $ENV{TIFF_DIR}/lib64
+             ${CMAKE_INSTALL_PREFIX}/lib
+             /usr/local/lib
+             /usr/lib 
+             /usr/lib/x86_64-linux-gnu)
+
+# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF  DEFAULT_MSG  TIFF_LIBRARY  TIFF_INCLUDE_DIR)
+
+IF(TIFF_FOUND)
+  SET( TIFF_LIBRARIES ${TIFF_LIBRARY} )
+ENDIF(TIFF_FOUND)
+
+MARK_AS_ADVANCED(TIFF_INCLUDE_DIR TIFF_LIBRARY)
diff --git a/cmake/CMakeModules/Findossim.cmake b/cmake/CMakeModules/Findossim.cmake
new file mode 100644
index 0000000..917ce82
--- /dev/null
+++ b/cmake/CMakeModules/Findossim.cmake
@@ -0,0 +1,61 @@
+#---
+# File: FindOSSIM.cmake
+#
+# Find OSSIM(Open Source Software Image Map) includes and libraries.
+#
+# This module defines:
+# 
+#  OSSIM_INCLUDE_DIR, Where to find ossimVersion.h, etc.
+#  OSSIM_LIBRARIES, Libraries to link against to use OSSIM.
+#  OSSIM_FOUND,  True if found, false if one of the above are not found.
+# also defined, but not for general use are
+#  OSSIM_LIBRARY, where to find the OSSIM library.
+#---
+
+#---
+# Find include path:
+#---
+set(CMAKE_FIND_FRAMEWORK "LAST")
+find_path(OSSIM_INCLUDE_DIR ossim/ossimVersion.h ossimVersion.h
+   PATHS
+      $ENV{OSSIM_DEV_HOME}/core/include
+      $ENV{OSSIM_INSTALL_PREFIX}/include
+   PATH_SUFFIXES 
+      include
+      lib
+)
+
+set(OSSIM_NAMES ${OSSIM_NAMES} ossim libossim)
+find_library(OSSIM_LIBRARY NAMES ${OSSIM_NAMES}
+   PATHS
+      $ENV{OSSIM_BUILD_DIR}/lib${LIBSUFFIX}
+      $ENV{OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX}
+      $ENV{OSSIM_INSTALL_PREFIX}
+   PATH_SUFFIXES 
+      lib
+      Frameworks
+)
+
+#---
+# This function sets OSSIM_FOUND if variables are valid.
+#--- 
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( OSSIM DEFAULT_MSG 
+                                   OSSIM_LIBRARY 
+                                   OSSIM_INCLUDE_DIR )
+
+if(OSSIM_FOUND)
+   set( OSSIM_LIBRARIES ${OSSIM_LIBRARY} )
+   set( OSSIM_INCLUDES  ${OSSIM_INCLUDE_DIR} )
+else( OSSIM_FOUND )
+   if( NOT OSSIM_FIND_QUIETLY )
+      message( WARNING "Could not find OSSIM" )
+   endif( NOT OSSIM_FIND_QUIETLY )
+endif(OSSIM_FOUND)
+
+if( NOT OSSIM_FIND_QUIETLY )
+   message( STATUS "OSSIM_INCLUDE_DIR=${OSSIM_INCLUDE_DIR}" )
+   message( STATUS "OSSIM_LIBRARY=${OSSIM_LIBRARY}" )
+endif( NOT OSSIM_FIND_QUIETLY )
+
+MARK_AS_ADVANCED(OSSIM_INCLUDES OSSIM_INCLUDE_DIR OSSIM_LIBRARY)
diff --git a/cmake/CMakeModules/FindossimPlanet.cmake b/cmake/CMakeModules/FindossimPlanet.cmake
new file mode 100644
index 0000000..3fdface
--- /dev/null
+++ b/cmake/CMakeModules/FindossimPlanet.cmake
@@ -0,0 +1,44 @@
+# - Find ossimPlanet library
+# Find the native ossimPlanet includes and library
+# This module defines
+#  OSSIMPLANET_INCLUDE_DIR, where to find tiff.h, etc.
+#  OSSIMPLANET_LIBRARIES, libraries to link against to use OSSIM.
+#  OSSIMPLANET_FOUND, If false, do not try to use OSSIM.
+# also defined, but not for general use are
+#  OSSIMPLANET_LIBRARY, where to find the OSSIM library.
+SET(CMAKE_FIND_FRAMEWORK "LAST")
+FIND_PATH(OSSIMPLANET_INCLUDE_DIR ossimPlanet/ossimPlanetExport.h ossimPlanetExport.h
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/ossimPlanet/include
+		$ENV{OSSIM_DEV_HOME}/ossimPlanet/lib
+		$ENV{OSSIM_INSTALL_PREFIX}/include
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/ossimPlanet
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		include
+)
+
+SET(OSSIMPLANET_NAMES ${OSSIMPLANET_NAMES} ossimPlanet )
+FIND_LIBRARY(OSSIMPLANET_LIBRARY NAMES ${OSSIMPLANET_NAMES}
+	HINTS 
+		$ENV{OSSIM_DEV_HOME}/ossimPlanet/lib
+	PATHS
+		$ENV{OSSIM_DEV_HOME}/ossimPlanet/lib
+		$ENV{OSSIM_INSTALL_PREFIX}
+    	PATH_SUFFIXES 
+		lib
+		Frameworks
+)
+
+# handle the QUIETLY and REQUIRED arguments and set OSSIMPLANET_FOUND to TRUE if 
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSSIMPLANET  DEFAULT_MSG  OSSIMPLANET_LIBRARY  OSSIMPLANET_INCLUDE_DIR)
+
+IF(OSSIMPLANET_FOUND)
+  SET( OSSIMPLANET_LIBRARIES ${OSSIMPLANET_LIBRARY} )
+ENDIF(OSSIMPLANET_FOUND)
+
+MARK_AS_ADVANCED(OSSIMPLANET_INCLUDE_DIR OSSIMPLANET_LIBRARY)
diff --git a/cmake/CMakeModules/OssimCPack.cmake b/cmake/CMakeModules/OssimCPack.cmake
new file mode 100644
index 0000000..fd58abb
--- /dev/null
+++ b/cmake/CMakeModules/OssimCPack.cmake
@@ -0,0 +1,156 @@
+# This script sets up packaging targets for each "COMPONENT" as specified in INSTALL commands
+#
+# for each component a CPackConfig-<component>.cmake is generated in the build tree
+# and a target is added to call cpack for it (e.g. package_ossim
+# A target for generating a package with everything that gets INSTALLED is generated (package_ossim-all)
+# A target for making all of the above packages is generated (package_ALL)
+#
+# package filenames are created on the form <package>-<platform>-<arch>[-<compiler>]-<build_type>[-static].tgz
+# ...where compiler optionally set using a cmake gui (OSSIM_CPACK_COMPILER). This script tries to guess compiler version for msvc generators
+# ...build_type matches CMAKE_BUILD_TYPE for all generators but the msvc ones
+
+# resolve architecture. The reason i "change" i686 to i386 is that debian packages
+# require i386 so this is for the future
+IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+    SET(SYSTEM_ARCH "i386")
+ELSE()
+    SET(SYSTEM_ARCH ${CMAKE_SYSTEM_PROCESSOR})
+ENDIF()
+
+# set a default system name - use CMake setting (Linux|Windows|...)
+SET(SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
+#message(STATUS "CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}")
+#message(STATUS "CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")
+
+# for msvc the SYSTEM_NAME is set win32/64 instead of "Windows"
+IF(MSVC)
+    IF(CMAKE_CL_64)
+        SET(SYSTEM_NAME "win64")
+    ELSE()
+        SET(SYSTEM_NAME "win32")
+    ENDIF()
+ENDIF()
+# Guess the compiler (is this desired for other platforms than windows?)
+IF(NOT DEFINED OSSIM_CPACK_COMPILER)
+    INCLUDE(OssimDetermineCompiler)
+ENDIF()
+
+# expose the compiler setting to the user
+SET(OSSIM_CPACK_COMPILER "${OSSIM_COMPILER}" CACHE STRING "This ia short string (vc90, vc80sp1, gcc-4.3, ...) describing your compiler. The string is used for creating package filenames")
+
+IF(OSSIM_CPACK_COMPILER)
+  SET(OSSIM_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH}-${OSSIM_CPACK_COMPILER})
+ELSE()
+  SET(OSSIM_CPACK_SYSTEM_SPEC_STRING ${SYSTEM_NAME}-${SYSTEM_ARCH})
+ENDIF()
+
+
+## variables that apply to all packages
+SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${OSSIM_VERSION}")
+
+IF(NOT CPACK_GENERATOR)
+   # these goes for all platforms. Setting these stops the CPack.cmake script from generating options about other package compression formats (.z .tz, etc.)
+   IF(WIN32)
+       SET(CPACK_GENERATOR "ZIP")
+       SET(CPACK_SOURCE_GENERATOR "ZIP")
+   ELSEIF(APPLE)
+#       SET(CPACK_GENERATOR "PackageMaker")
+#       SET(CPACK_SOURCE_GENERATOR "PackageMaker")
+       SET(CPACK_GENERATOR "TGZ")
+       SET(CPACK_SOURCE_GENERATOR "TGZ")
+   ELSE()
+       SET(CPACK_GENERATOR "TGZ")
+       SET(CPACK_SOURCE_GENERATOR "TGZ")
+   ENDIF()
+ENDIF(NOT CPACK_GENERATOR)
+
+# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...) 
+IF(MSVC_IDE)
+    SET(OSSIM_CPACK_CONFIGURATION "$(OutDir)")
+    SET(PACKAGE_TARGET_PREFIX "Package ")
+ELSE()
+    # on un*x an empty CMAKE_BUILD_TYPE means release
+    IF(CMAKE_BUILD_TYPE)
+        SET(OSSIM_CPACK_CONFIGURATION ${CMAKE_BUILD_TYPE})
+    ELSE()
+        SET(OSSIM_CPACK_CONFIGURATION "Release")
+    ENDIF()
+    SET(PACKAGE_TARGET_PREFIX "package_")
+ENDIF()
+
+# Get all defined components
+GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
+IF(NOT CPACK_COMPONENTS_ALL)
+  # cmake 2.6.0 don't supply the COMPONENTS property.
+  # I set it manually to be the packages that can always be packaged
+  MESSAGE("When building packages please consider using cmake version 2.6.1 or above")
+  SET(CPACK_COMPONENTS_ALL ossim)
+ENDIF()
+
+# Create a target that will be used to generate all packages defined below
+SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
+ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})
+
+MACRO(GENERATE_PACKAGING_TARGET package_name)
+    SET(CPACK_PACKAGE_NAME ${package_name})
+
+    # the doc packages don't need a system-arch specification
+    IF(${package} MATCHES -doc)
+        SET(OSSIM_PACKAGE_FILE_NAME ${package_name}-${OSSIM_VERSION})
+    ELSE()
+        SET(OSSIM_PACKAGE_FILE_NAME ${package_name}-${OSSIM_VERSION}-${OSSIM_CPACK_SYSTEM_SPEC_STRING}-${OSSIM_CPACK_CONFIGURATION})
+        IF(NOT BUILD_SHARED_LIBS)
+            SET(OSSIM_PACKAGE_FILE_NAME ${OSSIM_PACKAGE_FILE_NAME}-static)
+        ENDIF()
+    ENDIF()
+
+    CONFIGURE_FILE("${${PROJECT_NAME}_SOURCE_DIR}/CMakeModules/OssimCPackConfig.cmake.in" "${${PROJECT_NAME}_BINARY_DIR}/CPackConfig-${package_name}.cmake" IMMEDIATE)
+
+    SET(PACKAGE_TARGETNAME "${PACKAGE_TARGET_PREFIX}${package_name}")
+
+    # This is naive and will probably need fixing eventually
+    IF(MSVC)
+        SET(MOVE_COMMAND "move")
+    ELSE()
+        SET(MOVE_COMMAND "mv")
+    ENDIF()
+    
+    IF(NOT ACHIVE_EXT)
+       # Set in and out archive filenames. Windows = zip, others = tgz
+       IF(WIN32)
+          SET(ARCHIVE_EXT "zip")
+       ELSEIF(APPLE)
+#           SET(ARCHIVE_EXT "dmg")
+           SET(ARCHIVE_EXT "tar.gz")
+      ELSE()
+           SET(ARCHIVE_EXT "tar.gz")
+       ENDIF()
+    ENDIF(NOT ACHIVE_EXT)
+
+    # Create a target that creates the current package
+    # and rename the package to give it proper filename
+    ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
+    ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_TARGETNAME}
+        COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSSIM_CPACK_CONFIGURATION} --config ${${PROJECT_NAME}_BINARY_DIR}/CPackConfig-${package_name}.cmake
+        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSSIM_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
+        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSSIM_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
+        COMMENT "Run CPack packaging for ${package_name}..."
+    )
+    # Add the exact same custom command to the all package generating target. 
+    # I can't use add_dependencies to do this because it would allow parallel building of packages so am going brute here
+    ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
+        COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSSIM_CPACK_CONFIGURATION} --config ${${PROJECT_NAME}_BINARY_DIR}/CPackConfig-${package_name}.cmake
+        COMMAND "${MOVE_COMMAND}" "${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}" "${OSSIM_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
+        COMMAND ${CMAKE_COMMAND} -E echo "renamed ${CPACK_PACKAGE_FILE_NAME}.${ARCHIVE_EXT} -> ${OSSIM_PACKAGE_FILE_NAME}.${ARCHIVE_EXT}"
+    )
+ENDMACRO(GENERATE_PACKAGING_TARGET)
+
+# Create configs and targets for a package including all components
+SET(OSSIM_CPACK_COMPONENT ALL)
+GENERATE_PACKAGING_TARGET(ossim-all)
+
+# Create configs and targets for each component
+FOREACH(package ${CPACK_COMPONENTS_ALL})
+    SET(OSSIM_CPACK_COMPONENT ${package})
+    GENERATE_PACKAGING_TARGET(${package})
+ENDFOREACH()
diff --git a/cmake/CMakeModules/OssimCPackConfig.cmake.in b/cmake/CMakeModules/OssimCPackConfig.cmake.in
new file mode 100644
index 0000000..1be9bec
--- /dev/null
+++ b/cmake/CMakeModules/OssimCPackConfig.cmake.in
@@ -0,0 +1,73 @@
+# This file will be configured to contain variables for CPack. These variables
+# should be set in the CMake list file of the project before CPack module is
+# included. Example variables are:
+#   CPACK_GENERATOR                     - Generator used to create package
+#   CPACK_INSTALL_CMAKE_PROJECTS        - For each project (path, name, component)
+#   CPACK_CMAKE_GENERATOR               - CMake Generator used for the projects
+#   CPACK_INSTALL_COMMANDS              - Extra commands to install components
+#   CPACK_INSTALL_DIRECTORIES           - Extra directories to install
+#   CPACK_PACKAGE_DESCRIPTION_FILE      - Description file for the package
+#   CPACK_PACKAGE_DESCRIPTION_SUMMARY   - Summary of the package
+#   CPACK_PACKAGE_EXECUTABLES           - List of pairs of executables and labels
+#   CPACK_PACKAGE_FILE_NAME             - Name of the package generated
+#   CPACK_PACKAGE_ICON                  - Icon used for the package
+#   CPACK_PACKAGE_INSTALL_DIRECTORY     - Name of directory for the installer
+#   CPACK_PACKAGE_NAME                  - Package project name
+#   CPACK_PACKAGE_VENDOR                - Package project vendor
+#   CPACK_PACKAGE_VERSION               - Package project version
+#   CPACK_PACKAGE_VERSION_MAJOR         - Package project version (major)
+#   CPACK_PACKAGE_VERSION_MINOR         - Package project version (minor)
+#   CPACK_PACKAGE_VERSION_PATCH         - Package project version (patch)
+
+# There are certain generator specific ones
+
+# NSIS Generator:
+#   CPACK_PACKAGE_INSTALL_REGISTRY_KEY  - Name of the registry key for the installer
+#   CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall
+#   CPACK_NSIS_EXTRA_INSTALL_COMMANDS   - Extra commands used during install
+
+
+SET(CPACK_BINARY_BUNDLE "${CPACK_BINARY_BUNDLE}")
+SET(CPACK_BINARY_CYGWIN "${CPACK_BINARY_CYGWIN}")
+SET(CPACK_BINARY_DEB "${CPACK_BINARY_DEB}")
+SET(CPACK_BINARY_NSIS "${CPACK_BINARY_NSIS}")
+SET(CPACK_BINARY_OSXX11 "${CPACK_BINARY_OSXX11}")
+SET(CPACK_BINARY_PACKAGEMAKER "${CPACK_BINARY_PACKAGEMAKER}")
+SET(CPACK_BINARY_RPM "${CPACK_BINARY_RPM}")
+SET(CPACK_BINARY_STGZ "${CPACK_BINARY_STGZ}")
+SET(CPACK_BINARY_TBZ2 "${CPACK_BINARY_TBZ2}")
+SET(CPACK_BINARY_TGZ "${CPACK_BINARY_TGZ}")
+SET(CPACK_BINARY_TZ "${CPACK_BINARY_TZ}")
+SET(CPACK_BINARY_ZIP "${CPACK_BINARY_ZIP}")
+SET(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
+SET(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL}")
+SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
+SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
+SET(CPACK_GENERATOR "${CPACK_GENERATOR}")
+SET(CPACK_INSTALL_CMAKE_PROJECTS "${${PROJECT_NAME}_BINARY_DIR};ossim;${OSSIM_CPACK_COMPONENT};/")
+SET(CPACK_INSTALL_PREFIX "${CPACK_INSTALL_PREFIX}")
+SET(CPACK_MODULE_PATH "${${PROJECT_NAME}_SOURCE_DIR}/CMakeModules;")
+SET(CPACK_NSIS_DISPLAY_NAME "${CMAKE_PROJECT_NAME} ${OSSIM_VERSION}")
+SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
+SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
+SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSSIM_CPACK_COMPONENT}.cmake")
+SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
+SET(CPACK_PACKAGE_DESCRIPTION_FILE "${${PROJECT_NAME}_SOURCE_DIR}/README.txt")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OSSIM is an open source high performance sensor modeling and image processing library")
+SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}")
+SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CMAKE_PROJECT_NAME}-${OSSIM_VERSION}")
+SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
+SET(CPACK_PACKAGE_RELOCATABLE "true")
+SET(CPACK_PACKAGE_VENDOR "OSSIM")
+SET(CPACK_PACKAGE_VERSION "${OSSIM_VERSION}")
+SET(CPACK_PACKAGE_VERSION_MAJOR "${OSSIM_MAJOR_VERSION}")
+SET(CPACK_PACKAGE_VERSION_MINOR "${OSSIM_MINOR_VERSION}")
+SET(CPACK_PACKAGE_VERSION_PATCH "${OSSIM_PATCH_VERSION}")
+SET(CPACK_RESOURCE_FILE_LICENSE "${${PROJECT_NAME}_SOURCE_DIR}/LICENSE.txt")
+SET(CPACK_RESOURCE_FILE_README "${${PROJECT_NAME}_SOURCE_DIR}/README.txt")
+SET(CPACK_RESOURCE_FILE_WELCOME "${${PROJECT_NAME}_SOURCE_DIR}/NEWS.txt")
+SET(CPACK_SET_DESTDIR "OFF")
+SET(CPACK_STRIP_FILES "ON")
+SET(CPACK_RPM_PACKAGE_DEBUG "1")
+SET(CPACK_OSX_PACKAGE_VERSION "10.6")
diff --git a/cmake/CMakeModules/OssimCommonVariables.cmake b/cmake/CMakeModules/OssimCommonVariables.cmake
new file mode 100644
index 0000000..fb7c32f
--- /dev/null
+++ b/cmake/CMakeModules/OssimCommonVariables.cmake
@@ -0,0 +1,274 @@
+
+##################################################################################
+# This currently sets up the options for the WARNING FLAGS for the compiler we are generating for.
+# Currently only have gnu
+##################################################################################
+MACRO(OSSIM_ADD_COMMON_LIBRARY_FLAGS)
+   OPTION(OSSIM_COMPILE_WITH_FULL_WARNING "OSSIM developers : Compilation with FULL warning (use only for ossim developers)." OFF)
+   MARK_AS_ADVANCED(OSSIM_COMPILE_WITH_FULL_WARNING)
+
+   IF(OSSIM_COMPILE_WITH_FULL_WARNING)
+     IF(CMAKE_COMPILER_IS_GNUCXX)
+       SET(OSSIM_COMMON_COMPILER_FLAGS "${OSSIM_COMMON_COMPILER_FLAGS} -Wall -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter -Wunused-value -Wunused-variable -Wuninitialized -Wsign-compare -Wparentheses -Wunknown-pragmas -Wswitch" CACHE STRING "List of compilation parameters.")
+     ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+   ENDIF(OSSIM_COMPILE_WITH_FULL_WARNING)
+
+   IF(WIN32)
+      #---
+      # This option is to enable the /MP to compile multiple source files by using
+      # multiple processes.
+      #---
+      OPTION(WIN32_USE_MP "Set to ON to build OSSIM with the /MP option (Visual Studio 2005 and above)." OFF)
+      MARK_AS_ADVANCED(WIN32_USE_MP)
+      IF(WIN32_USE_MP)
+         SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+      ENDIF(WIN32_USE_MP)
+
+      set(OSSIM_COMMON_COMPILER_FLAGS "${OSSIM_COMMON_COMPILER_FLAGS} -DNOMINMAX -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE")
+
+      set(DEBUG_BUILD OFF)
+      IF(CMAKE_BUILD_TYPE)
+         string ( COMPARE EQUAL ${CMAKE_BUILD_TYPE} "Debug" DEBUG_BUILD )
+      ENDIF(CMAKE_BUILD_TYPE)
+
+      ###
+      # Currently must set /FORCE:MULTIPLE for Visual Studio 2010. 29 October 2010 - drb
+      ###
+
+      IF(MSVC)
+         message("MSVC_VERSION: ${MSVC_VERSION}")
+
+         if( (MSVC_VERSION GREATER 1600) OR (MSVC_VERSION EQUAL 1600))
+            if (DEBUG_BUILD)
+               SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMTD /NODEFAULTLIB:MSVCRT /FORCE:MULTIPLE /MANIFEST:NO")
+               SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMTD /FORCE:MULTIPLE /MANIFEST:NO")
+
+            else ( )
+               SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMTD /FORCE:MULTIPLE /MANIFEST:NO")
+               SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMTD /FORCE:MULTIPLE /MANIFEST:NO")
+             endif (DEBUG_BUILD)
+
+            SET(OSSIM_COMMON_COMPILER_FLAGS "${OSSIM_COMMON_COMPILER_FLAGS} /EHsc")
+            SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMTD /FORCE:MULTIPLE")
+         else( )
+            SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMTD")
+         endif()
+      ENDIF(MSVC)
+   ENDIF(WIN32)
+
+   OPTION(OSSIM_ADD_FPIC "Compilation with FPIC flag if static library.  The default is on since we have plugins that need to be shared." ON)
+   MARK_AS_ADVANCED(OSSIM_ADD_FPIC)
+   IF(OSSIM_ADD_FPIC)
+       IF(UNIX AND NOT BUILD_SHARED_LIBS)
+          STRING(REGEX MATCH "fPIC" REG_MATCHED "${OSSIM_COMMON_COMPILER_FLAGS}")
+          if(NOT REG_MATCHED)
+             set(OSSIM_COMMON_COMPILER_FLAGS "${OSSIM_COMMON_COMPILER_FLAGS} -fPIC")
+          endif(NOT REG_MATCHED)
+       ENDIF(UNIX AND NOT BUILD_SHARED_LIBS)
+   ENDIF(OSSIM_ADD_FPIC)
+
+   MARK_AS_ADVANCED(OSSIM_COMMON_COMPILER_FLAGS)
+ENDMACRO(OSSIM_ADD_COMMON_LIBRARY_FLAGS)
+
+MACRO(USE_CXX11)
+  if (CMAKE_VERSION VERSION_LESS "3.1")
+    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+      set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
+    elseif (APPLE)
+      set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
+    endif()
+  else ()
+    set (CMAKE_CXX_STANDARD 11)
+  endif ()
+ENDMACRO(USE_CXX11)
+
+MACRO(OSSIM_ADD_COMMON_SETTINGS)
+   ###################################################################################
+   # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
+   # and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
+   # These are just defaults/recommendations, but how we want to build
+   # out of the box. But the user needs to be able to change these options.
+   # So we must only set the values the first time CMake is run, or we
+   # will overwrite any changes the user sets.
+   # FORCE is used because the options are not reflected in the UI otherwise.
+   # Seems like a good place to add version specific compiler flags too.
+   ###################################################################################
+
+   USE_CXX11()
+
+   IF(APPLE)
+      # use, i.e. don't skip the full RPATH for the build tree
+        SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
+
+        # when building, don't use the install RPATH already
+        # (but later on when installing)
+        SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 
+
+        SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
+
+        # add the automatically determined parts of the RPATH
+        # which point to directories outside the build tree to the install RPATH
+        SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+
+
+        # the RPATH to be used when installing, but only if it's not a system directory
+        LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+
+        IF("${isSystemDir}" STREQUAL "-1")
+           SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}")
+        ENDIF("${isSystemDir}" STREQUAL "-1")
+        SET(TEMP_CMAKE_OSX_ARCHITECTURES "")
+        SET(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}")
+        # This is really fragile, but CMake doesn't provide the OS system
+        # version information we need. (Darwin versions can be changed
+        # independently of OS X versions.)
+        # It does look like CMake handles the CMAKE_OSX_SYSROOT automatically.
+        IF(EXISTS /Developer/SDKs/MacOSX10.6.sdk)
+            SET(TEMP_CMAKE_OSX_ARCHITECTURES "i386;x86_64")
+            IF(NOT ("${CMAKE_CXX_FLAGS}" MATCHES "mmacosx-version-min"))
+               SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types.")
+            ENDIF()
+        ELSEIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
+            # 64-bit compiles are not supported with Carbon. We should enable
+            SET(TEMP_CMAKE_OSX_ARCHITECTURES "i386;x86_64")
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types.")
+        ELSEIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
+            SET(TEMP_CMAKE_OSX_ARCHITECTURES "i386;ppc")
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types.")
+        ELSE()
+            # No Universal Binary support
+            # Should break down further to set the -mmacosx-version-min,
+            # but the SDK detection is too unreliable here.
+        ENDIF()
+        IF(NOT CMAKE_OSX_ARCHITECTURES)
+           SET(CMAKE_OSX_ARCHITECTURES "${TEMP_CMAKE_OSX_ARCHITECTURES}" CACHE STRING "Build architectures for OSX" FORCE)
+        ENDIF()
+        OPTION(OSSIM_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" OFF)
+
+       MARK_AS_ADVANCED(CMAKE_OSX_ARCHITECTURES)
+       MARK_AS_ADVANCED(CMAKE_CXX_FLAGS)
+       MARK_AS_ADVANCED(CMAKE_OSX_SYSROOT)
+       MARK_AS_ADVANCED(OSSIM_BUILD_APPLICATION_BUNDLES)
+   ENDIF(APPLE)
+
+  SET(MAKE_APPENDS_BUILD_TYPE "NO")
+  IF(CMAKE_GENERATOR)
+     STRING(TOUPPER ${CMAKE_GENERATOR} CMAKE_GENERATOR_TEST_UPPER)
+     STRING(COMPARE EQUAL "${CMAKE_GENERATOR_TEST_UPPER}" "XCODE" CMAKE_GENERATOR_TEST)
+     IF(CMAKE_GENERATOR_TEST)
+          SET(MAKE_APPENDS_BUILD_TYPE "YES")
+     ELSE()
+          STRING(COMPARE NOTEQUAL "." "${CMAKE_CFG_INTDIR}" CMAKE_GENERATOR_TEST)
+          IF(CMAKE_GENERATOR_TEST)
+             SET(MAKE_APPENDS_BUILD_TYPE "YES")
+          ENDIF()
+     ENDIF()
+  ENDIF(CMAKE_GENERATOR)
+   OSSIM_ADD_COMMON_LIBRARY_FLAGS()
+
+   # Dynamic vs Static Linking
+   OPTION(BUILD_SHARED_LIBS "Set to ON to build OSSIM for dynamic linking.  Use OFF for static." ON)
+   OPTION(BUILD_OSSIM_FRAMEWORKS "Set to ON to build OSSIM for framework if BUILD_SHARED_LIBS is on.  Use OFF for dylib if BUILD_SHARED_LIBS is on." ON)
+   IF(BUILD_SHARED_LIBS)
+       SET(OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
+   ELSE ()
+       SET(OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
+   ENDIF()
+
+#   IF(NOT OSSIM_LIBRARY_BUILD_OUTPUT_DIRECTORY)
+#      SET(OSSIM_LIBRARY_BUILD_OUTPUT_DIRECTORY ${${PROJECT_NAME}_SOURCE_DIR}/lib)
+#   ENDIF(NOT OSSIM_LIBRARY_BUILD_OUTPUT_DIRECTORY)
+#   IF(NOT OSSIM_RUNTIME_BUILD_OUTPUT_DIRECTORY)
+#      SET(OSSIM_RUNTIME_BUILD_OUTPUT_DIRECTORY ${${PROJECT_NAME}_SOURCE_DIR}/bin)
+#   ENDIF(NOT OSSIM_RUNTIME_BUILD_OUTPUT_DIRECTORY)
+
+   # Libraries and archives go to lib or lib64.
+   get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+   if(LIB64)
+      set(LIBSUFFIX 64)
+   else()
+      set(LIBSUFFIX "")
+   endif()
+
+   IF(MAKE_APPENDS_BUILD_TYPE)
+      SET(BUILD_FRAMEWORK_DIR "")
+      SET(BUILD_RUNTIME_DIR   "bin")
+      SET(BUILD_LIBRARY_DIR lib${LIBSUFFIX})
+      SET(BUILD_ARCHIVE_DIR lib${LIBSUFFIX})
+      SET(BUILD_INCLUDE_DIR   "include")
+   ELSE()
+      IF(NOT DEFINED BUILD_FRAMEWORK_DIR)
+         SET(BUILD_FRAMEWORK_DIR "")
+      ENDIF()
+      IF(NOT DEFINED BUILD_RUNTIME_DIR)
+         SET(BUILD_RUNTIME_DIR   "bin")
+      ENDIF()
+      IF(NOT DEFINED BUILD_LIBRARY_DIR)
+         SET(BUILD_LIBRARY_DIR lib${LIBSUFFIX})
+      ENDIF()
+      IF(NOT DEFINED BUILD_ARCHIVE_DIR)
+         SET(BUILD_ARCHIVE_DIR lib${LIBSUFFIX})
+      ENDIF()
+      IF(NOT DEFINED BUILD_INCLUDE_DIR)
+         SET(BUILD_INCLUDE_DIR   "include")
+      ENDIF()
+   ENDIF()
+
+   SET(INSTALL_FRAMEWORK_DIR "Frameworks")
+   SET(INSTALL_RUNTIME_DIR   "bin")
+   SET(INSTALL_INCLUDE_DIR   "include")
+
+   set(INSTALL_LIBRARY_DIR lib${LIBSUFFIX} CACHE PATH "Installation directory for libraries")
+   set(INSTALL_ARCHIVE_DIR lib${LIBSUFFIX} CACHE PATH "Installation directory for archive")
+   mark_as_advanced(LIBSUFFIX)
+   mark_as_advanced(INSTALL_LIBRARY_DIR)
+   mark_as_advanced(INSTALL_ARCHIVE_DIR)
+
+   IF(WIN32)
+       IF(NOT DEFINED CMAKE_DEBUG_POSTFIX)
+          SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Debug variable used to add the postfix to dll's and exe's.  Defaults to 'd' on WIN32 builds and empty on all other platforms" FORCE)
+       ENDIF()
+   ENDIF()
+   IF(NOT CMAKE_BUILD_TYPE)
+     SET(CMAKE_BUILD_TYPE Release)
+   ENDIF(NOT CMAKE_BUILD_TYPE)
+
+   # force some variables that could be defined in the command line to be written to cache
+   SET( CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH
+     "Where to install ${PROJECT_NAME}" FORCE )
+   SET( CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
+     "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE )
+   SET( CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" CACHE PATH
+     "Path to custom CMake Modules" FORCE )
+   SET( INSTALL_DOC "${INSTALL_DOC}" CACHE BOOL
+     "Set to OFF to skip build/install Documentation" FORCE )
+
+   IF(NOT OSSIM_DEV_HOME)
+      SET(OSSIM_DEV_HOME "$ENV{OSSIM_DEV_HOME}")
+      GET_FILENAME_COMPONENT(OSSIM_DEV_HOME "${OSSIM_DEV_HOME}" ABSOLUTE)
+   ENDIF(NOT OSSIM_DEV_HOME)
+   IF(NOT CMAKE_INSTALL_PREFIX)
+      SET(CMAKE_INSTALL_PREFIX "$ENV{OSSIM_INSTALL_PREFIX}")
+       GET_FILENAME_COMPONENT(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
+   ENDIF(NOT CMAKE_INSTALL_PREFIX)
+   IF(NOT OSSIM_DEPENDENCIES)
+      SET(OSSIM_DEPENDENCIES "$ENV{OSSIM_DEPENDENCIES}")
+      GET_FILENAME_COMPONENT(OSSIM_DEPENDENCIES "${OSSIM_DEPENDENCIES}" ABSOLUTE)
+   ENDIF(NOT OSSIM_DEPENDENCIES)
+
+   #################################### ADd some common options for all modules to use ###################################
+   OPTION(BUILD_OSSIM_VIDEO "Set to ON to build the video decoding library.  Use OFF to skip this module." OFF)
+   OPTION(BUILD_OSSIM_PLANET "Set to ON to build the 3-D visualization module.  Use OFF to skip this module." OFF)
+   OPTION(BUILD_OSSIM_GUI "Set to ON to build the new ossimGui library and geocell application." ON)
+   OPTION(BUILD_MRSID_PLUGIN "Set to ON to build the MrSID plugin library." ON)
+   OPTION(BUILD_KAKADU_PLUGIN "Set to ON to build the Kakadu plugin library." ON)
+   OPTION(BUILD_PDAL_PLUGIN "Set to ON to build the PDAL plugin library." ON)
+   OPTION(BUILD_GDAL_PLUGIN "Set to ON to build the GDAL plugin library." ON)
+   OPTION(BUILD_OMS "Set to ON to build the oms api library." ON)
+   OPTION(BUILD_OSSIM_WMS "Set to ON to build the wms api library." ON)
+
+
+ENDMACRO(OSSIM_ADD_COMMON_SETTINGS)
+
+
+OSSIM_ADD_COMMON_SETTINGS()
diff --git a/cmake/CMakeModules/OssimDetermineCompiler.cmake b/cmake/CMakeModules/OssimDetermineCompiler.cmake
new file mode 100644
index 0000000..332eee8
--- /dev/null
+++ b/cmake/CMakeModules/OssimDetermineCompiler.cmake
@@ -0,0 +1,77 @@
+# - If Visual Studio is being used, this script sets the variable OSG_COMPILER
+# The principal reason for this is due to MSVC 8.0 SP0 vs SP1 builds.
+#
+# Variable:
+#   OSG_COMPILER
+# 
+
+# Not currently used...
+#IF(CMAKE_COMPILER_IS_GNUCXX)
+#    EXEC_PROGRAM(
+#        ${CMAKE_CXX_COMPILER}  
+#        ARGS     ${CMAKE_CXX_COMPILER_ARG1} -dumpversion 
+#        OUTPUT_VARIABLE gcc_compiler_version
+#    )
+#    #MESSAGE("GCC Version: ${gcc_compiler_version}")
+
+IF(MSVC60)
+    SET(OSG_COMPILER "vc60")
+ELSEIF(MSVC70)
+    SET(OSG_COMPILER "vc70")
+ELSEIF(MSVC71)
+    SET(OSG_COMPILER "vc71")
+ELSEIF(MSVC80)
+    SET(OSG_COMPILER "vc80")
+ELSEIF(MSVC90)
+    SET(OSG_COMPILER "vc90")
+ELSEIF(MSVC100)
+    SET(OSG_COMPILER "vc100")
+ENDIF()
+
+MESSAGE("OSG_COMPILER ${OSG_COMPILER}")
+
+IF(MSVC80)
+    MESSAGE(STATUS "Checking if compiler has service pack 1 installed...")
+    FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" "int main() {return 0;}\n")
+
+    TRY_COMPILE(_TRY_RESULT
+        ${CMAKE_BINARY_DIR}
+        ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
+        CMAKE_FLAGS -D CMAKE_VERBOSE_MAKEFILE=ON
+        OUTPUT_VARIABLE OUTPUT
+        )
+
+    IF(_TRY_RESULT)
+        # parse for exact compiler version
+        STRING(REGEX MATCH "Compiler Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vc_compiler_version "${OUTPUT}")
+        IF(vc_compiler_version)
+            #MESSAGE("${vc_compiler_version}")
+            STRING(REGEX MATCHALL "[0-9]+" CL_VERSION_LIST "${vc_compiler_version}")
+            LIST(GET CL_VERSION_LIST 0 CL_MAJOR_VERSION)
+            LIST(GET CL_VERSION_LIST 1 CL_MINOR_VERSION)
+            LIST(GET CL_VERSION_LIST 2 CL_PATCH_VERSION)
+            LIST(GET CL_VERSION_LIST 3 CL_EXTRA_VERSION)
+        ENDIF(vc_compiler_version)
+
+        # Standard vc80 is 14.00.50727.42, sp1 14.00.50727.762, sp2?
+        # Standard vc90 is 9.0.30729.1, sp1 ?
+        IF(CL_EXTRA_VERSION EQUAL 762)
+            SET(OSG_COMPILER "vc80sp1")
+        ELSE(CL_EXTRA_VERSION EQUAL 762)
+            SET(OSG_COMPILER "vc80")
+        ENDIF(CL_EXTRA_VERSION EQUAL 762)
+
+        # parse for exact visual studio version
+        #IF(MSVC_IDE)
+        # string(REGEX MATCH "Visual Studio Version [0-9]+.[0-9]+.[0-9]+.[0-9]+" vs_version "${OUTPUT}")
+        # IF(vs_version)
+        # MESSAGE("${vs_version}")
+        # string(REGEX MATCHALL "[0-9]+" VS_VERSION_LIST "${vs_version}")
+        # list(GET VS_VERSION_LIST 0 VS_MAJOR_VERSION)
+        # list(GET VS_VERSION_LIST 1 VS_MINOR_VERSION)
+        # list(GET VS_VERSION_LIST 2 VS_PATCH_VERSION)
+        # list(GET VS_VERSION_LIST 3 VS_EXTRA_VERSION)
+        # ENDIF(vs_version)
+        #ENDIF(MSVC_IDE)
+    ENDIF(_TRY_RESULT)
+ENDIF(MSVC80)
diff --git a/cmake/CMakeModules/OssimQt4Macros.cmake b/cmake/CMakeModules/OssimQt4Macros.cmake
new file mode 100644
index 0000000..c0a6c30
--- /dev/null
+++ b/cmake/CMakeModules/OssimQt4Macros.cmake
@@ -0,0 +1,24 @@
+include(Qt4Macros)
+MACRO (OSSIM_QT4_WRAP_UI outfiles)
+
+  if(CMAKE_VERSION VERSION_LESS 2.8.12)
+    QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
+  else()
+    QT4_EXTRACT_OPTIONS(ui_files ui_options "" ${ARGN})
+  endif()
+  FOREACH (it ${ui_files})
+    GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+    GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+    IF(UI_DESTINATION_DIR)
+      SET(outfile ${UI_DESTINATION_DIR}/ui_${outfile}.h)
+    ELSE(UI_DESTINATION_DIR)
+      SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+    ENDIF(UI_DESTINATION_DIR)
+    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+      COMMAND ${QT_UIC_EXECUTABLE}
+      ARGS ${ui_options} -o ${outfile} ${infile}
+      MAIN_DEPENDENCY ${infile})
+    SET(${outfiles} ${${outfiles}} ${outfile})
+  ENDFOREACH (it)
+
+ENDMACRO (OSSIM_QT4_WRAP_UI)
diff --git a/cmake/CMakeModules/OssimQt5Macros.cmake b/cmake/CMakeModules/OssimQt5Macros.cmake
new file mode 100644
index 0000000..6fc1f0f
--- /dev/null
+++ b/cmake/CMakeModules/OssimQt5Macros.cmake
@@ -0,0 +1,19 @@
+include(Qt5Macros)
+MACRO (OSSIM_QT_WRAP_UI outfiles)
+  QT5_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
+  FOREACH (it ${ui_files})
+    GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+    GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+    IF(UI_DESTINATION_DIR)
+      SET(outfile ${UI_DESTINATION_DIR}/ui_${outfile}.h)
+    ELSE(UI_DESTINATION_DIR)
+      SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+    ENDIF(UI_DESTINATION_DIR)
+    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+      COMMAND ${QT_UIC_EXECUTABLE}
+      ARGS ${ui_options} -o ${outfile} ${infile}
+      MAIN_DEPENDENCY ${infile})
+    SET(${outfiles} ${${outfiles}} ${outfile})
+  ENDFOREACH (it)
+
+ENDMACRO (OSSIM_QT_WRAP_UI)
diff --git a/cmake/CMakeModules/OssimUtilities.cmake b/cmake/CMakeModules/OssimUtilities.cmake
new file mode 100644
index 0000000..a39b99e
--- /dev/null
+++ b/cmake/CMakeModules/OssimUtilities.cmake
@@ -0,0 +1,357 @@
+#################################################################################
+# This was taken from the http://www.cmake.org/Wiki/CMakeMacroParseArguments
+#################################################################################
+MACRO(OSSIM_PARSE_ARGUMENTS prefix arg_names option_names)
+  SET(DEFAULT_ARGS)
+  FOREACH(arg_name ${arg_names})    
+    SET(${prefix}_${arg_name})
+  ENDFOREACH(arg_name)
+  FOREACH(option ${option_names})
+    SET(${prefix}_${option} FALSE)
+  ENDFOREACH(option)
+
+  SET(current_arg_name DEFAULT_ARGS)
+  SET(current_arg_list)
+  FOREACH(arg ${ARGN})            
+    SET(larg_names ${arg_names})    
+    LIST(FIND larg_names "${arg}" is_arg_name)                   
+    IF (is_arg_name GREATER -1)
+      SET(${prefix}_${current_arg_name} ${current_arg_list})
+      SET(current_arg_name ${arg})
+      SET(current_arg_list)
+    ELSE (is_arg_name GREATER -1)
+      SET(loption_names ${option_names})    
+      LIST(FIND loption_names "${arg}" is_option)            
+      IF (is_option GREATER -1)
+	     SET(${prefix}_${arg} TRUE)
+      ELSE (is_option GREATER -1)
+	     SET(current_arg_list ${current_arg_list} ${arg})
+      ENDIF (is_option GREATER -1)
+    ENDIF (is_arg_name GREATER -1)
+  ENDFOREACH(arg)
+  SET(${prefix}_${current_arg_name} ${current_arg_list})
+ENDMACRO(OSSIM_PARSE_ARGUMENTS)
+
+##############################################################################################
+# This was taken from http://www.cmake.org/Wiki/CMakeMacroListOperations#CAR_and_CDR
+##############################################################################################
+MACRO(OSSIM_CAR var)
+  SET(${var} ${ARGV1})
+ENDMACRO(OSSIM_CAR)
+
+#############################################################################################
+# This was taken from http://www.cmake.org/Wiki/CMakeMacroListOperations#CAR_and_CDR
+#############################################################################################
+MACRO(OSSIM_CDR var junk)
+  SET(${var} ${ARGN})
+ENDMACRO(OSSIM_CDR)
+
+#################################################################################
+#  MACRO: TODAYS_DATE
+#  
+#  DESCRIPTION:
+#      MACRO FOR GETTING THE DATE AND TIME INFORMATION
+#################################################################################
+MACRO (TODAYS_DATE RESULT)
+  string(TIMESTAMP  ${RESULT} "%Y%m%d" UTC)
+ENDMACRO (TODAYS_DATE)
+
+#################################################################################
+#  MACRO: GET_GIT_REVISION
+#  
+#  DESCRIPTION:
+#      MACRO FOR GETTING THE GIT revision for this build
+#################################################################################
+MACRO (GET_GIT_REVISION)
+   FIND_PACKAGE(Git)
+   IF(GIT_FOUND)
+      GIT_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+      # MESSAGE("Current revision is ${Project_WC_REVISION}")
+      # Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
+      # MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
+   ENDIF()
+ENDMACRO(GET_GIT_REVISION)
+
+MACRO(LINK_EXTERNAL TRGTNAME)
+    FOREACH(LINKLIB ${ARGN})
+        TARGET_LINK_LIBRARIES(${TRGTNAME} "${LINKLIB}" )
+    ENDFOREACH(LINKLIB)
+ENDMACRO(LINK_EXTERNAL TRGTNAME)
+
+MACRO(LINK_INTERNAL TRGTNAME)
+    IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
+        TARGET_LINK_LIBRARIES(${TRGTNAME} ${ARGN})
+    ELSE(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
+        FOREACH(LINKLIB ${ARGN})
+            IF(MSVC AND OSSIM_MSVC_VERSIONED_DLL)
+                #when using versioned names, the .dll name differ from .lib name, there is a problem with that:
+                #CMake 2.4.7, at least seem to use PREFIX instead of IMPORT_PREFIX  for computing linkage info to use into projects,
+                # so we full path name to specify linkage, this prevent automatic inferencing of dependencies, so we add explicit depemdencies
+                #to library targets used
+                TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_RELEASE_POSTFIX}.lib" debug "${OUTPUT_LIBDIR}/${LINKLIB}${CMAKE_DEBUG_POSTFIX}.lib")
+                ADD_DEPENDENCIES(${TRGTNAME} ${LINKLIB})
+            ELSE(MSVC AND OSSIM_MSVC_VERSIONED_DLL)
+                TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${LINKLIB}${CMAKE_RELEASE_POSTFIX}" debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
+            ENDIF(MSVC AND OSSIM_MSVC_VERSIONED_DLL)
+        ENDFOREACH(LINKLIB)
+    ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4)
+ENDMACRO(LINK_INTERNAL TRGTNAME)
+
+######################################################################
+#
+# This set up the libraries to link to, it assumes there are two variable: one common for a group of examples or plugins
+# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES 
+# they are combined in a single list checked for unicity 
+# the suffix ${CMAKE_DEBUG_POSTFIX} is used for differentiating optimized and debug
+#
+# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of  libraries not differentiated between debug and optimized 
+##################################################################################
+MACRO(SETUP_LINK_LIBRARIES)
+    SET(TARGET_LIBRARIES ${TARGET_COMMON_LIBRARIES})
+
+    FOREACH(LINKLIB ${TARGET_ADDED_LIBRARIES})
+      SET(TO_INSERT TRUE)
+      FOREACH (value ${TARGET_COMMON_LIBRARIES})
+            IF (${value} STREQUAL ${LINKLIB})
+                  SET(TO_INSERT FALSE)
+            ENDIF (${value} STREQUAL ${LINKLIB})
+        ENDFOREACH (value ${TARGET_COMMON_LIBRARIES})
+      IF(TO_INSERT)
+          LIST(APPEND TARGET_LIBRARIES ${LINKLIB})
+      ENDIF(TO_INSERT)
+    ENDFOREACH(LINKLIB)
+
+    LINK_INTERNAL(${TARGET_TARGETNAME} ${TARGET_LIBRARIES})
+    TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} ${TARGET_EXTERNAL_LIBRARIES})
+    IF(TARGET_LIBRARIES_VARS)
+        LINK_WITH_VARIABLES(${TARGET_TARGETNAME} ${TARGET_LIBRARIES_VARS})
+    ENDIF(TARGET_LIBRARIES_VARS)
+ENDMACRO(SETUP_LINK_LIBRARIES)
+
+
+MACRO(OSSIM_SETUP_APPLICATION)
+   OSSIM_PARSE_ARGUMENTS(APPLICATION
+			"COMPONENT_NAME;SOURCE_FILES;HEADERS;TARGET_NAME;TARGET_LABEL" 
+                        "COMMAND_LINE;INSTALL;REQUIRE_WINMAIN_FLAG" 
+                        ${ARGN})
+   OSSIM_CAR(APPLICATION_NAME "${APPLICATION_DEFAULT_ARGS}")
+   OSSIM_CDR(APPLICATION_SOURCES "${APPLICATION_DEFAULT_ARGS}")
+   SET(TARGET_NAME ${APPLICATION_NAME})
+   SET(TARGET_TARGETNAME "${TARGET_DEFAULT_PREFIX}${APPLICATION_NAME}")
+   IF(APPLICATION_TARGET_NAME)
+      set(TARGET_TARGETNAME "${APPLICATION_TARGET_NAME}")
+   ENDIF(APPLICATION_TARGET_NAME)
+
+   SET(TARGET_LABEL "${TARGET_DEFAULT_LABEL_PREFIX} ${APPLICATION_NAME}")
+   IF(APPLICATION_TARGET_LABEL)
+      SET(TARGET_LABEL "${APPLICATION_TARGET_LABEL}")
+   ENDIF(APPLICATION_TARGET_LABEL)
+
+   IF(APPLICATION_COMMAND_LINE)
+        ADD_EXECUTABLE(${TARGET_TARGETNAME} ${APPLICATION_SOURCE_FILES} ${APPLICATION_HEADERS})
+        
+    ELSE(APPLICATION_COMMAND_LINE)
+        IF(APPLE)
+            # SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OSSIM_MAJOR_VERSION}.${OSSIM_MINOR_VERSION}.${OSSIM_PATCH_VERSION}")
+            # Short Version is the "marketing version". It is the version
+            # the user sees in an information panel.
+            SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${OSSIM_MAJOR_VERSION}.${OSSIM_MINOR_VERSION}.${OSSIM_PATCH_VERSION}")
+            # Bundle version is the version the OS looks at.
+            SET(MACOSX_BUNDLE_BUNDLE_VERSION "${OSSIM_MAJOR_VERSION}.${OSSIM_MINOR_VERSION}.${OSSIM_PATCH_VERSION}")
+            SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.ossim.${TARGET_TARGETNAME}" )
+            SET(MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_TARGETNAME}" )
+            # SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
+            # SET(MACOSX_BUNDLE_COPYRIGHT "")
+            # SET(MACOSX_BUNDLE_INFO_STRING "Info string, localized?")
+        ENDIF(APPLE)
+
+        IF(WIN32)
+            IF (APPLICATION_REQUIRE_WINMAIN_FLAG)
+                SET(PLATFORM_SPECIFIC_CONTROL WIN32)
+            ENDIF (APPLICATION_REQUIRE_WINMAIN_FLAG)
+        ENDIF(WIN32)
+
+        IF(APPLE)
+            IF(OSSIM_BUILD_APPLICATION_BUNDLES)
+                SET(PLATFORM_SPECIFIC_CONTROL MACOSX_BUNDLE)
+            ENDIF(OSSIM_BUILD_APPLICATION_BUNDLES)
+        ENDIF(APPLE)
+        ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${APPLICATION_SOURCE_FILES} ${APPLICATION_HEADERS})
+        
+    ENDIF(APPLICATION_COMMAND_LINE)
+
+
+    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
+    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES OUTPUT_NAME ${TARGET_NAME})
+    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_OUTPUT_NAME "${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}")
+    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES RELEASE_OUTPUT_NAME "${TARGET_NAME}${CMAKE_RELEASE_POSTFIX}")
+    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES RELWITHDEBINFO_OUTPUT_NAME "${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}")
+    SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES MINSIZEREL_OUTPUT_NAME "${TARGET_NAME}${CMAKE_MINSIZEREL_POSTFIX}")
+
+    IF(MSVC_IDE AND OSSIM_MSVC_VERSIONED_DLL)
+            SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../")    
+    ENDIF(MSVC_IDE AND OSSIM_MSVC_VERSIONED_DLL)
+    
+
+    SETUP_LINK_LIBRARIES() 
+
+    IF(APPLICATION_INSTALL)  
+        IF(APPLE) 
+            INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} BUNDLE DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT ${APPLICATION_COMPONENT_NAME})
+        ELSE(APPLE)
+            INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} ${INSTALL_COMPONENT_INFO} COMPONENT ${APPLICATION_COMPONENT_NAME})
+        ENDIF(APPLE)
+    ENDIF(APPLICATION_INSTALL)
+
+   SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES 
+                              RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUILD_RUNTIME_DIR}")    
+
+      
+ENDMACRO(OSSIM_SETUP_APPLICATION)
+
+#####################################################################################################
+# MACRO: OSSIM_LINK_LIBRARY
+#
+# Example: 
+#     OSSIM_LINK_LIBRARY(ossim 
+#                        COMPONENT_NAME ossim 
+#                        SOURCE_FILES foo.cpp 
+#                        HEADERS foo.h 
+#                        TYPE SHARED
+#                        LIBRARIES <list of libraries to link against>
+#                        INSTALL_LIB
+#                        INSTALL_HEADERS)
+#
+#    The INSTALL_LIB says to add a default install command for the library by default it will setup the following
+#           install(TARGETS ossim
+#               FRAMEWORK           DESTINATION         ${INSTALL_FRAMEWORK_DIR}
+#               RUNTIME             DESTINATION         ${INSTALL_RUNTIME_DIR}
+#               LIBRARY             DESTINATION         ${INSTALL_LIBRARY_DIR}
+#               ARCHIVE             DESTINATION         ${INSTALL_ARCHIVE_DIR}
+#               PUBLIC_HEADER       DESTINATION         ${INSTALL_INCLUDE_DIR} 
+#               COMPONENT ossim)
+#
+#   The INSTALL_HEADERS will do a default header installation if the option is passed in
+#        install(FILES <list of headers> DESTINATION "include/ossim" COMPONENT ossim)
+#####################################################################################################
+MACRO(OSSIM_LINK_LIBRARY)
+   # The SO_VERSION and VERSION are here for override purpose only so other libraries with their own 
+   # versioning scheme can use the sum linking
+   #
+   OSSIM_PARSE_ARGUMENTS(LINK
+			"COMPONENT_NAME;SOURCE_FILES;HEADERS;TYPE;LIBRARIES;ADDITIONAL_COMPILE_FLAGS;SOVERSION;VERSION;PUBLIC_HEADERS"
+                        "INSTALL_LIB;INSTALL_HEADERS;VERSION_SYMLINKS" 
+                        ${ARGN})
+   OSSIM_CAR(LINK_NAME "${LINK_DEFAULT_ARGS}")
+   OSSIM_CDR(LINK_SOURCES "${LINK_DEFAULT_ARGS}")
+   ADD_DEFINITIONS("${OSSIM_COMMON_COMPILER_FLAGS}")
+   ADD_LIBRARY(${LINK_NAME}
+               ${LINK_TYPE}
+               ${LINK_HEADERS}
+               ${LINK_SOURCE_FILES})
+   IF(NOT LINK_PUBLIC_HEADERS)
+      SET(LINK_PUBLIC_HEADERS ${LINK_HEADERS})
+   ENDIF()
+   IF(LINK_ADDITIONAL_COMPILE_FLAGS)
+      SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES
+                            COMPILE_FLAGS ${LINK_ADDITIONAL_COMPILE_FLAGS})
+   ENDIF(LINK_ADDITIONAL_COMPILE_FLAGS)
+   if(APPLE)
+      IF(BUILD_SHARED_LIBS)
+#        SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+#        SET(CMAKE_INSTALL_RPATH "${OSSIM_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
+        IF(BUILD_OSSIM_FRAMEWORKS)
+          SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES 
+                             FRAMEWORK TRUE
+                             BUILD_WITH_INSTALL_RPATH ON 
+                             INSTALL_NAME_DIR @rpath/Frameworks)
+        ELSE(BUILD_OSSIM_FRAMEWORKS)
+          #---
+          # Given install prefix=/usr/local and 
+          # install lib dir = lib64 and 
+          # link name = libossim.dylib
+          # You get "/usr/local/lib64/libossim.dylib" in the rpath.
+          #---
+          SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES 
+                                FRAMEWORK FALSE
+                                BUILD_WITH_INSTALL_RPATH ON 
+                                INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
+        ENDIF(BUILD_OSSIM_FRAMEWORKS)
+      ELSE(BUILD_SHARED_LIBRARY)
+          SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES 
+                                FRAMEWORK FALSE)
+      ENDIF(BUILD_SHARED_LIBS)
+   ENDIF(APPLE)
+   IF(UNIX AND BUILD_SHARED_LIBS AND NOT APPLE)   
+      IF(LINK_VERSION_SYMLINKS)
+         IF(NOT LINK_SOVERSION)
+             set(LINK_SOVERSION "${OSSIM_SOVERSION}")
+         ENDIF(NOT LINK_SOVERSION)
+         IF(NOT LINK_VERSION)
+             set(LINK_VERSION "${OSSIM_VERSION}")
+         ENDIF(NOT LINK_VERSION)
+      # ADD_CUSTOM_TARGET( lib DEPENDS ${LINK_NAME} )
+      # change lib_target properties
+         SET_TARGET_PROPERTIES( ${LINK_NAME} PROPERTIES
+                                    # create *nix style library versions + symbolic links
+                                   VERSION ${LINK_VERSION}
+                                   SOVERSION ${LINK_SOVERSION}
+                                  # allow creating static and shared libs without conflicts
+                                  CLEAN_DIRECT_OUTPUT 1
+                                  # avoid conflicts between library and binary target names
+                                  OUTPUT_NAME ${LINK_NAME} )
+      ENDIF(LINK_VERSION_SYMLINKS)
+   ENDIF(UNIX AND BUILD_SHARED_LIBS AND NOT APPLE)
+   SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES 
+                              RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUILD_RUNTIME_DIR}")    
+   IF(APPLE AND BUILD_OSSIM_FRAMEWORKS)
+     SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES 
+                              LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUILD_FRAMEWORK_DIR}")    
+   ELSE(APPLE AND BUILD_OSSIM_FRAMEWORKS)
+     SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES 
+                              LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUILD_LIBRARY_DIR}")    
+   ENDIF(APPLE AND BUILD_OSSIM_FRAMEWORKS)
+   SET_TARGET_PROPERTIES(${LINK_NAME} PROPERTIES 
+                              ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUILD_LIBRARY_DIR}")    
+
+   TARGET_LINK_LIBRARIES(${LINK_NAME} ${LINK_LIBRARIES} ${${LINK_NAME}_EXTRA_LIBS})
+
+   IF(LINK_INSTALL_LIB)
+        IF(LINK_INSTALL_HEADERS)
+           SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PUBLIC_HEADER "${LINK_PUBLIC_HEADERS}")
+           install(TARGETS ${LINK_NAME}
+                   FRAMEWORK           DESTINATION         ${INSTALL_FRAMEWORK_DIR} COMPONENT ${LINK_COMPONENT_NAME}
+                   RUNTIME             DESTINATION         ${INSTALL_RUNTIME_DIR} COMPONENT ${LINK_COMPONENT_NAME}
+                   LIBRARY             DESTINATION         ${INSTALL_LIBRARY_DIR} COMPONENT ${LINK_COMPONENT_NAME}
+                   ARCHIVE             DESTINATION         ${INSTALL_ARCHIVE_DIR} COMPONENT ${LINK_COMPONENT_NAME}-dev
+                   PUBLIC_HEADER       DESTINATION         ${INSTALL_INCLUDE_DIR} COMPONENT ${LINK_COMPONENT_NAME}-dev)
+        ELSE(LINK_INSTALL_HEADERS)
+           install(TARGETS ${LINK_NAME}
+                   FRAMEWORK           DESTINATION         ${INSTALL_FRAMEWORK_DIR} COMPONENT ${LINK_COMPONENT_NAME}
+                   RUNTIME             DESTINATION         ${INSTALL_RUNTIME_DIR} COMPONENT ${LINK_COMPONENT_NAME}
+                   LIBRARY             DESTINATION         ${INSTALL_LIBRARY_DIR} COMPONENT ${LINK_COMPONENT_NAME}
+                   ARCHIVE             DESTINATION         ${INSTALL_ARCHIVE_DIR} COMPONENT ${LINK_COMPONENT_NAME}-dev)
+        ENDIF(LINK_INSTALL_HEADERS)
+    ENDIF(LINK_INSTALL_LIB)
+ENDMACRO(OSSIM_LINK_LIBRARY)
+
+MACRO(OSSIM_ADD_COMMON_MAKE_UNINSTALL)
+#   get_target_property(TEST_UNINSTALL uninstall CREATED)
+#   IF(NOT TEST_UNINSTALL)
+      #-----------------------------------------------------------------------------
+      ### uninstall target
+      #-----------------------------------------------------------------------------
+      SET(OSSIM_CMAKE_UNINSTALL_CONFIG "${PROJECT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in")
+      IF(EXISTS ${OSSIM_CMAKE_UNINSTALL_CONFIG})
+         CONFIGURE_FILE(
+           "${OSSIM_CMAKE_UNINSTALL_CONFIG}"
+           "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
+           IMMEDIATE @ONLY)
+         ADD_CUSTOM_TARGET(uninstall
+           "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
+           )
+      set_target_properties(uninstall PROPERTIES CREATED 1)
+      ENDIF(EXISTS ${OSSIM_CMAKE_UNINSTALL_CONFIG})
+#   ENDIF(NOT TEST_UNINSTALL)
+ENDMACRO(OSSIM_ADD_COMMON_MAKE_UNINSTALL)
+
diff --git a/cmake/CMakeModules/OssimVersion.cmake b/cmake/CMakeModules/OssimVersion.cmake
new file mode 100644
index 0000000..3bd1f89
--- /dev/null
+++ b/cmake/CMakeModules/OssimVersion.cmake
@@ -0,0 +1,6 @@
+SET(OSSIM_MAJOR_VERSION_NUMBER "1")
+SET(OSSIM_MINOR_VERSION_NUMBER "9")
+SET(OSSIM_PATCH_VERSION_NUMBER "0")
+SET(OSSIM_RELEASE_NUMBER "1")
+SET(OSSIM_VERSION "${OSSIM_MAJOR_VERSION_NUMBER}.${OSSIM_MINOR_VERSION_NUMBER}.${OSSIM_PATCH_VERSION_NUMBER}" )
+SET(OSSIM_SOVERSION "${OSSIM_MAJOR_VERSION_NUMBER}" )
diff --git a/cmake/CMakeModules/Qt5Macros.cmake b/cmake/CMakeModules/Qt5Macros.cmake
new file mode 100644
index 0000000..fecaac5
--- /dev/null
+++ b/cmake/CMakeModules/Qt5Macros.cmake
@@ -0,0 +1,83 @@
+# This file is included by FindQt5.cmake, don't include it directly.
+
+# Copyright (C) 2001-2009 Kitware, Inc.
+# Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+# Copyright (C) 2011 Nokia Corporation
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+macro (QT5_EXTRACT_OPTIONS _qt5_files _qt5_options)
+  set(${_qt5_files})
+  set(${_qt5_options})
+  set(_QT5_DOING_OPTIONS FALSE)
+  foreach(_currentArg ${ARGN})
+    if ("${_currentArg}" STREQUAL "OPTIONS")
+      set(_QT5_DOING_OPTIONS TRUE)
+    else ()
+      if(_QT5_DOING_OPTIONS)
+        list(APPEND ${_qt5_options} "${_currentArg}")
+      else()
+        list(APPEND ${_qt5_files} "${_currentArg}")
+      endif()
+    endif ()
+  endforeach()
+endmacro ()
+
+
+MACRO (QT5_GET_MOC_FLAGS _moc_flags)
+  SET(${_moc_flags})
+  GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
+
+  FOREACH(_current ${_inc_DIRS})
+    IF("${_current}" MATCHES "\\.framework/?$")
+      STRING(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
+      SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
+    ELSE("${_current}" MATCHES "\\.framework/?$")
+      SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
+    ENDIF("${_current}" MATCHES "\\.framework/?$")
+  ENDFOREACH(_current ${_inc_DIRS})
+
+  GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
+  FOREACH(_current ${_defines})
+    SET(${_moc_flags} ${${_moc_flags}} "-D${_current}")
+  ENDFOREACH(_current ${_defines})
+
+  IF(Q_WS_WIN)
+    SET(${_moc_flags} ${${_moc_flags}} -DWIN32)
+  ENDIF(Q_WS_WIN)
+
+ENDMACRO (QT5_GET_MOC_FLAGS)
+
+# helper macro to set up a moc rule
+MACRO (QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
+  # For Windows, create a parameters file to work around command line length limit
+  IF (WIN32)
+    # Pass the parameters in a file.  Set the working directory to
+    # be that containing the parameters file and reference it by
+    # just the file name.  This is necessary because the moc tool on
+    # MinGW builds does not seem to handle spaces in the path to the
+    # file given with the @ syntax.
+    GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
+    GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
+    IF(_moc_outfile_dir)
+      SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
+    ENDIF(_moc_outfile_dir)
+    SET (_moc_parameters_file ${outfile}_parameters)
+    SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
+    STRING (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}")
+    FILE (WRITE ${_moc_parameters_file} "${_moc_parameters}")
+    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+                       COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
+                       DEPENDS ${infile}
+                       ${_moc_working_dir}
+                       VERBATIM)
+  ELSE (WIN32)
+    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+                       COMMAND ${QT_MOC_EXECUTABLE}
+                       ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
+                       DEPENDS ${infile})
+  ENDIF (WIN32)
+ENDMACRO (QT5_CREATE_MOC_COMMAND)
+
+
diff --git a/cmake/CMakeModules/cmake_uninstall.cmake.in b/cmake/CMakeModules/cmake_uninstall.cmake.in
new file mode 100644
index 0000000..03093e0
--- /dev/null
+++ b/cmake/CMakeModules/cmake_uninstall.cmake.in
@@ -0,0 +1,22 @@
+IF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
+    MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
+ENDIF()
+
+FILE(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
+STRING(REGEX REPLACE "\n" ";" files "${files}")
+
+FOREACH(file ${files})
+    MESSAGE(STATUS "Uninstalling \"${file}\"")
+    IF(EXISTS "${file}")
+        EXEC_PROGRAM(
+            "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\""
+            OUTPUT_VARIABLE rm_out
+            RETURN_VALUE rm_retval
+            )
+        IF(NOT "${rm_retval}" STREQUAL 0)
+            MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"")
+        ENDIF()
+    ELSE()
+        MESSAGE(STATUS "File \"${file}\" does not exist.")
+    ENDIF()
+ENDFOREACH()
diff --git a/cmake/packaging/pkgconfig/ossim.pc.in b/cmake/packaging/pkgconfig/ossim.pc.in
new file mode 100644
index 0000000..a159819
--- /dev/null
+++ b/cmake/packaging/pkgconfig/ossim.pc.in
@@ -0,0 +1,14 @@
+# pkg-config source file
+
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib at LIBSUFFIX@
+includedir=${prefix}/include
+
+Name: ossim
+Description: Open Source Software Image Map
+Version: @OSSIM_VERSION@
+Requires: openthreads tiff jpeg 
+Conflicts:
+Libs: -L${libdir} -lossim
+Cflags: -I${includedir}
diff --git a/cmake/scripts/ossim-cmake-config-WINDOWS.bat b/cmake/scripts/ossim-cmake-config-WINDOWS.bat
new file mode 100644
index 0000000..3e53a0f
--- /dev/null
+++ b/cmake/scripts/ossim-cmake-config-WINDOWS.bat
@@ -0,0 +1,220 @@
+ at echo off
+
+::*************************************************************************************
+::
+::  Windows Batch file for initializing the CMAKE build system for building OSSIM 
+::  with MicroSoft compiler.
+::
+::  This script must be copied into a dedicated build directory.
+::  The script can then be invoked from that directory. DO NOT run this script out of
+::  the ossim_package_support/cmake/build_scripts/windows.
+::  
+::  Optional arguments (in any order):
+::
+::    win32 | win64 | x64 (defaults to x64)
+::    vs2005 | vs2010 | vs2015 (defaults vs2015)
+::    ide | nmake (defaults to ide)
+::
+::  No environment variables need be defined prior to running this script. However,
+::  OSSIM_DEV_HOME, OSSIM_DEPENDENCIES and OSSIM_BUILD_DIR need to be edited below.
+::
+::  Author: Oscar Kramer, GEOEYE (Aug, 2011)
+::
+::*************************************************************************************
+
+setlocal enabledelayedexpansion
+set SCRIPT_DIR="%~dp0"
+
+:: Edit these to your local system:
+if NOT DEFINED OSSIM_DEPENDENCIES (
+  set OSSIM_DEPENDENCIES=C:\GoAgent\pipelines\ossim-windows-temp\ossim-deps-1.0.0
+)
+
+:: Default settings:
+set PLATFORM=x64
+set DEVENV=vs2015
+set GEN_TYPE=NMAKE
+set CMAKE_BUILD_TYPE=Release
+:while_valid_arg
+  if "%1"=="win32" set PLATFORM=Win32
+  if "%1"=="win64" set PLATFORM=x64
+  if "%1"=="vs2005" set DEVENV=vs2005
+  if "%1"=="vs2008" set DEVENV=vs2008
+  if "%1"=="vs2015" set DEVENV=vs2015
+  if "%1"=="nmake" set GEN_TYPE=NMAKE
+  shift
+if not "%1"=="" goto while_valid_arg
+
+if not defined OSSIM_DEV_HOME (
+   pushd %SCRIPT_DIR%..\..
+   set OSSIM_DEV_HOME=!CD!
+   popd
+)
+
+
+IF NOT DEFINED OSSIM_DEPENDENCIES (
+  set OSSIM_DEPENDENCIES=%OSSIM_DEV_HOME\ossim-deps-1.0.0
+)
+IF NOT EXIST %OSSIM_DEPENDENCIES% (
+  echo ERROR: OSSIM_DEPENDENCIES is not set to a valid path. Aborting
+  GOTO ABORTED_END
+)
+
+IF NOT DEFINED OSSIM_BUILD_DIR (
+  set OSSIM_BUILD_DIR=%OSSIM_DEV_HOME%\build
+)
+IF NOT EXIST %OSSIM_BUILD_DIR% MKDIR %OSSIM_BUILD_DIR%
+pushd %OSSIM_BUILD_DIR%
+
+:: Change all backslashes to forward slashes in path env vars:
+set OSSIM_DEV_HOME=%OSSIM_DEV_HOME:\=/%
+set OSSIM_DEPENDENCIES=%OSSIM_DEPENDENCIES:\=/%
+set CMAKE_DIR=%OSSIM_DEV_HOME%\ossim\cmake
+
+echo.
+echo Environment settings:
+echo OSSIM_DEV_HOME = %OSSIM_DEV_HOME%
+echo OSSIM_DEPENDENCIES = %OSSIM_DEPENDENCIES%
+echo PLATFORM = %PLATFORM%
+echo DEVENV = %DEVENV%
+echo OSSIM_BUILD_DIR = %OSSIM_BUILD_DIR%
+echo.
+
+:: Create system specific subdirectory if needed:
+if not exist %DEVENV% mkdir %DEVENV%
+pushd %DEVENV%
+
+:: Create platform and target specific subdirectory if needed:
+if not exist %PLATFORM% mkdir %PLATFORM%
+pushd %PLATFORM%
+if not exist %GEN_TYPE% mkdir %GEN_TYPE%
+pushd %GEN_TYPE%
+
+:: Interpret the target system and set up environment:
+IF %DEVENV%==vs2005 (
+  IF %PLATFORM%==Win32 (
+    set TARGET_SYSTEM="Visual Studio 8 2005"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall" x86
+  ) ELSE (
+    set TARGET_SYSTEM="Visual Studio 8 2005 Win64"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall" x64
+  )
+) 
+IF %DEVENV%==vs2008 (
+  IF %PLATFORM%==Win32 (
+    set TARGET_SYSTEM="Visual Studio 9 Win32"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall" x86
+  ) ELSE (
+    set TARGET_SYSTEM="Visual Studio 9 Win64"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall" x64
+  )
+) 
+IF %DEVENV%==vs2010 (
+  IF %PLATFORM%==Win32 (
+    set TARGET_SYSTEM="Visual Studio 10 Win32"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall" x86
+  ) ELSE (
+    set TARGET_SYSTEM="Visual Studio 10 Win64"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall" x64
+  )
+)
+
+IF %DEVENV%==vs2015 (
+  IF %PLATFORM%==Win32 (
+    set TARGET_SYSTEM="Visual Studio 14 Win32"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall" x86
+  ) ELSE (
+    set TARGET_SYSTEM="Visual Studio 14 Win64"
+    call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall" x64
+  )
+)
+
+set DEPLIBDIR=%OSSIM_DEPENDENCIES%/lib
+set DEPINCDIR=%OSSIM_DEPENDENCIES%/include
+
+:: Here are the cmake options. Everything is about setting variables except the 
+:: the last line (the business end). Make sure that source path points to the
+:: ossim_package_support/cmake directory containing the top-level CMakeLists.txt
+rem set CMAKE_PARAMETERS=^
+rem -D%PLATFORM%_USE_MP=ON ^
+rem -DBUILD_LIBRARY_DIR=lib ^
+rem -DBUILD_OSSIM=ON ^
+rem -DBUILD_OSSIM_MPI_SUPPORT=0 ^
+rem -DBUILD_RUNTIME_DIR=bin ^
+rem -DBUILD_SHARED_LIBS=ON ^
+rem -DOPENTHREADS_LIBRARY=%DEPLIBDIR%/OpenThreadsx64.lib ^
+rem -DTIFF_LIBRARY=%DEPLIBDIR%/libtiff_i.lib ^
+rem -DTIFF_INCLUDE_DIR=%DEPINCDIR%/tiff ^
+rem -DPROJ4_LIBRARY=%DEPLIBDIR%/proj.lib ^
+rem -DPODOFO_INCLUDE_DIR=%DEPINCDIR% ^
+rem -DPODOFO_LIBRARY=%DEPLIBDIR%/podofo.lib ^
+rem -DEXPAT_INCLUDE_DIR=%DEPINCDIR%/expat ^
+rem -DEXPAT_LIBRARY=%DEPLIBDIR%/podofo.lib ^
+rem -DGEOTIFF_LIBRARY=%DEPLIBDIR%/geotiff_i.lib ^
+rem -DGEOTIFF_INCLUDE_DIR=%DEPINCDIR%/geotiff ^
+rem -DFFTW3_LIBRARY=%DEPLIBDIR%/libfftw3-3.lib ^
+rem -DJPEG_LIBRARY=%DEPLIBDIR%/libjpeg.lib ^
+rem -DJPEG_INCLUDE_DIR=%DEPINCDIR%/jpeg8a ^
+rem -DFREETYPE_LIBRARY=%DEPLIBDIR%/freetype237.lib ^
+rem -DFREETYPE_INCLUDE_DIRS=%DEPINCDIR%/freetype ^
+rem -DZLIB_LIBRARY=%DEPLIBDIR%/zlib.lib ^
+rem -DZLIB_INCLUDE_DIR=%DEPINCDIR%/zlib ^
+rem -DOSSIM_COMPILE_WITH_FULL_WARNING=ON ^
+rem -DOSSIM_DEPENDENCIES=%OSSIM_DEPENDENCIES%^
+rem -DBUILD_SHARED_LIBS=ON ^
+rem %OSSIM_BUILD_DIR%
+
+set CMAKE_PARAMETERS=^
+-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
+-DOSSIM_DEV_HOME=%OSSIM_DEV_HOME% ^
+-D%PLATFORM%_USE_MP=ON ^
+-DBUILD_LIBRARY_DIR=lib ^
+-DBUILD_OMS=%BUILD_OMS% ^
+-DBUILD_CNES_PLUGIN=%BUILD_CNES_PLUGIN% ^
+-DBUILD_GEOPDF_PLUGIN=%BUILD_GEOPDF_PLUGIN% ^
+-DBUILD_GDAL_PLUGIN=%BUILD_GDAL_PLUGIN% ^
+-DBUILD_HDF5_PLUGIN=%BUILD_HDF5_PLUGIN% ^
+-DBUILD_KAKADU_PLUGIN=%BUILD_KAKADU_PLUGIN% ^
+-DKAKADU_ROOT_SRC=%KAKADU_ROOT_SRC% ^
+-DKAKADU_AUX_LIBRARY=%KAKADU_AUX_LIBRARY% ^
+-DKAKADU_LIBRARY=%KAKADU_LIBRARY% ^
+-DBUILD_KML_PLUGIN=%BUILD_KML_PLUGIN% ^
+-DBUILD_MRSID_PLUGIN=%BUILD_MRSID_PLUGIN% ^
+-DMRSID_DIR=%MRSID_DIR% ^
+-DOSSIM_PLUGIN_LINK_TYPE=SHARED ^
+-DBUILD_OPENCV_PLUGIN=%BUILD_OPENCV_PLUGIN% ^
+-DBUILD_OPENJPEG_PLUGIN=%BUILD_OPENJPEG_PLUGIN% ^
+-DBUILD_PDAL_PLUGIN=5BUILD_PDAL_PLUGIN% ^
+-DBUILD_PNG_PLUGIN=%BUILD_PNG_PLUGIN% ^
+-DBUILD_SQLITE_PLUGIN=%BUILD_SQLITE_PLUGIN% ^
+-DBUILD_OSSIM_VIDEO=%BUILD_OSSIM_VIDEO% ^
+-DBUILD_OSSIM_GUI=%BUILD_OSSIM_GUI% ^
+-DBUILD_OSSIM_WMS=%BUILD_OSSIM_WMS% ^
+-DBUILD_OSSIM_PLANET=%BUILD_OSSIM_PLANET% ^
+%CMAKE_DIR%
+
+:: Finally the cmake commands themselves:
+echo TARGET_SYSTEM = %TARGET_SYSTEM%
+IF %GEN_TYPE%==IDE (
+  echo Generating IDE solution and project files...
+  cmake -G %TARGET_SYSTEM% %CMAKE_PARAMETERS%
+) ELSE (
+  echo Generating nmake makefiles...
+  cmake -G "NMake Makefiles" %CMAKE_PARAMETERS%
+)
+
+:: Restore environment
+popd
+popd
+popd
+popd
+set OSSIM_DEV_HOME=%OSSIM_DEV_HOME:/=\%
+set OSSIM_DEPENDENCIES=%OSSIM_DEPENDENCIES:/=\%
+echo Successfully configured build environment.
+goto FINISHED
+
+:ABORTED_END
+echo Script terminated prematurely...
+
+:FINISHED
+pause
diff --git a/cmake/scripts/ossim-cmake-config.sh b/cmake/scripts/ossim-cmake-config.sh
new file mode 100755
index 0000000..cca4248
--- /dev/null
+++ b/cmake/scripts/ossim-cmake-config.sh
@@ -0,0 +1,297 @@
+#!/bin/bash
+
+##########################################################################
+#
+# CMake Configuration for OSSIM on Linux
+#
+# DO NOT RELOCATE THIS SCRIPT. Its location is used to resolve relative
+# directory paths.
+#
+# Usage: <this_script_name> [<build_type>] 
+#
+# where the optional <build_type> is one of the following literals 
+# (case-insensitive):
+#
+#     "release" (default), 
+#     "debug", 
+#     "relWithDebInfo", 
+#     "minSizeRel",
+#     "eclipse"
+#
+# If a build type = "eclipse" is specified, cmake will generate a Debug
+# build environment along with Eclipse CDT4 project files (in the build
+# directory) for importing as existing project.
+#
+# Instructions: Run this script to build the repository. This script can be
+# run from any directory, but will assume a default relative directory
+# heirarchy when searching for related items.
+# 
+# No env vars need to be predefined. The build output will be written to
+# $OSSIM_DEV_HOME/build/<build_type> where $OSSIM_DEV_HOME is the top-level
+# folder containing all OSSIM repositories (including this one).
+#
+# For customized output location, you can define the env var OSSIM_BUILD_DIR
+# prior to running this script, and the output will be written there.
+#
+##########################################################################
+
+# Uncomment following line to debug script line by line:
+#set -x; trap read debug
+
+# Fetch the build type from command line:
+BUILD_TYPE_ARG="${1}"
+case "$BUILD_TYPE_ARG" in
+  DEBUG|Debug)
+      CMAKE_BUILD_TYPE="Debug"
+      ;;
+  ECLIPSE)
+      CMAKE_BUILD_TYPE="Debug"
+      ;;
+  RELEASE|Release)
+      CMAKE_BUILD_TYPE="Release"
+      ;;
+  RELWITHDEBINFO|RelWithDebInfo)
+      CMAKE_BUILD_TYPE="RelWithDebInfo"
+      ;;
+  MINSIZEREL|MinSizeRel)
+      CMAKE_BUILD_TYPE="MinSizeRel"
+      ;;
+  *)
+      CMAKE_BUILD_TYPE="Release"
+esac
+
+# Establish location of master CMakeLists.txt file. This is the cmake file
+# used to build all OSSIM-related repos (plugins, tests, oms, etc)
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+pushd $SCRIPT_DIR/.. >/dev/null
+CMAKE_DIR=$PWD
+#echo "@@@@@ CMAKE_DIR=$CMAKE_DIR"
+popd >/dev/null
+
+# Establish the top-level directory above repo containing this script
+#echo "@@@@@ BEFORE OSSIM_DEV_HOME=$OSSIM_DEV_HOME"
+if [ -z $OSSIM_DEV_HOME ]; then
+  pushd $CMAKE_DIR/../.. >/dev/null
+  export OSSIM_DEV_HOME=$PWD
+  #echo "@@@@@ NEW OSSIM_DEV_HOME=$OSSIM_DEV_HOME"
+  popd >/dev/null
+#else
+  #echo "@@@@@ OSSIM_DEV_HOME UNCHANGED!"
+fi 
+
+# Establish CMake's output build directory:
+if [ -z "$OSSIM_BUILD_DIR" ]; then
+  if [ "$BUILD_TYPE_ARG" == "ECLIPSE" ]; then
+     pushd $OSSIM_DEV_HOME/..
+     OSSIM_BUILD_DIR=$PWD/ossimlabs_eclipse_build
+     popd
+  else
+    OSSIM_BUILD_DIR=$OSSIM_DEV_HOME/build
+  fi
+fi
+
+# Establish CMAKE's install directory:
+if [ -z "$OSSIM_INSTALL_PREFIX" ]; then
+  OSSIM_INSTALL_PREFIX=$OSSIM_DEV_HOME/install
+fi
+
+# Additional stuff for ECLIPSE CDT4 users:
+CMAKE_G_ARG="Unix Makefiles"
+if [ "$BUILD_TYPE_ARG" == "ECLIPSE" ]; then
+  echo "Generating eclipse project files."
+  CMAKE_G_ARG="Eclipse CDT4 - Unix Makefiles"
+  cp -f $CMAKE_DIR/CMakeLists.txt $OSSIM_DEV_HOME
+  CMAKE_DIR=$OSSIM_DEV_HOME
+fi
+
+echo "@@@@@ OSSIM_BUILD_DIR=$OSSIM_BUILD_DIR"
+mkdir -p $OSSIM_BUILD_DIR
+pushd $OSSIM_BUILD_DIR >/dev/null
+rm -f CMakeCache.txt
+
+# Check for ENV vars set to override hardcoded plugins switches here:
+if [ -z $BUILD_OSSIM_VIDEO ]; then
+  BUILD_OSSIM_VIDEO=OFF
+fi
+if [ -z $BUILD_OSSIM_PLANET ]; then
+  BUILD_OSSIM_PLANET=OFF
+fi
+if [ -z $BUILD_OSSIM_WMS ]; then
+  BUILD_OSSIM_WMS=OFF
+fi
+if [ -z $BUILD_OSSIM_GUI ]; then
+  BUILD_OSSIM_GUI=OFF
+fi
+if [ -z $BUILD_OSSIM_PLANET_GUI ]; then
+  BUILD_OSSIM_PLANET_GUI=OFF
+fi
+if [ -z $BUILD_OSSIM_QT4 ]; then
+  BUILD_OSSIM_QT4=OFF
+fi
+if [ -z $BUILD_OMS ]; then
+  BUILD_OMS=OFF
+fi
+if [ -z $BUILD_OSSIM_APPS ] ; then
+   export BUILD_OSSIM_APPS=ON
+fi
+if [ -z $BUILD_OSSIM_HDF5_SUPPORT ] ; then
+   export BUILD_OSSIM_HDF5_SUPPORT=OFF
+fi
+if [ -z $BUILD_OSSIM_CURL_APPS ] ; then
+   export BUILD_OSSIM_CURL_APPS=OFF
+fi
+if [ -z $BUILD_OSSIM_MSP ] ; then
+   export BUILD_OSSIM_MSP=OFF
+fi
+if [ -z $BUILD_OSSIM_ATP ] ; then
+   export BUILD_OSSIM_ATP=OFF
+fi
+
+# Plugins:
+if [ -z $BUILD_CNES_PLUGIN ]; then
+  BUILD_CNES_PLUGIN=OFF
+fi
+if [ -z $BUILD_CSM_PLUGIN ]; then
+  BUILD_CSM_PLUGIN=OFF
+fi
+if [ -z $BUILD_FFTW3_PLUGIN ]; then
+  BUILD_FFTW3_PLUGIN=OFF
+fi
+if [ -z $BUILD_GDAL_PLUGIN ]; then
+  BUILD_GDAL_PLUGIN=OFF
+fi
+if [ -z $BUILD_GEOPDF_PLUGIN ]; then
+  BUILD_GEOPDF_PLUGIN=OFF
+fi
+if [ -z $BUILD_HDF5_PLUGIN ]; then
+  BUILD_HDF5_PLUGIN=OFF
+fi
+if [ -z $BUILD_KAKADU_PLUGIN ]; then
+  BUILD_KAKADU_PLUGIN=OFF
+fi
+if [ -z $BUILD_KML_PLUGIN ]; then
+  BUILD_KML_PLUGIN=OFF
+fi
+if [ -z $BUILD_MRSID_PLUGIN ]; then
+  BUILD_MRSID_PLUGIN=OFF
+fi
+if [ -z $BUILD_MSP_PLUGIN ]; then
+  BUILD_MSP_PLUGIN=OFF
+fi
+if [ -z $BUILD_OPENCV_PLUGIN ]; then
+  BUILD_OPENCV_PLUGIN=OFF
+fi
+if [ -z $BUILD_OPENJPEG_PLUGIN ]; then
+  BUILD_OPENJPEG_PLUGIN=OFF
+fi
+if [ -z $BUILD_PDAL_PLUGIN ]; then
+  BUILD_PDAL_PLUGIN=OFF
+fi
+if [ -z $BUILD_PNG_PLUGIN ]; then
+  BUILD_PNG_PLUGIN=OFF
+fi
+if [ -z $BUILD_POTRACE_PLUGIN ]; then
+  BUILD_POTRACE_PLUGIN=OFF
+fi
+if [ -z $BUILD_REG_PLUGIN ]; then
+  BUILD_REG_PLUGIN=OFF
+fi
+if [ -z $BUILD_JPEG12_PLUGIN ]; then
+  BUILD_JPEG12_PLUGIN=OFF
+fi
+if [ -z $BUILD_SQLITE_PLUGIN ]; then
+  BUILD_SQLITE_PLUGIN=OFF
+fi
+if [ -z $BUILD_WEB_PLUGIN ]; then
+  BUILD_WEB_PLUGIN=OFF
+fi
+if [ -z $BUILD_AWS_PLUGIN ] ; then
+   export BUILD_AWS_PLUGIN=OFF
+fi
+
+if [ -z $BUILD_OSSIM_FRAMEWORKS ] ; then
+  export BUILD_OSSIM_FRAMEWORKS=ON
+fi
+
+if [ "${BUILD_OSSIM_GUI}" == "ON" ]; then
+  if [ -z $QT_CMAKE_DIR ]; then
+    if [ -d "/usr/lib64/cmake/Qt5Core" ]; then
+      export QT_CMAKE_DIR="/usr/lib64/cmake" 
+    elif [ -d "/usr/local/opt/qt5/lib/cmake" ]; then
+      export QT_CMAKE_DIR="/usr/local/opt/qt5/lib/cmake"
+    fi
+  fi   
+  if [ -z $Qt5Core_DIR ]; then
+    export Qt5Core_DIR=${QT_CMAKE_DIR}/Qt5Core
+  fi
+
+  if [ -z $Qt5Widgets_DIR ]; then
+    export Qt5Widgets_DIR=${QT_CMAKE_DIR}/Qt5Widgets
+  fi
+
+  if [ -z $Qt5OpenGL_DIR ]; then
+    export Qt5OpenGL_DIR=${QT_CMAKE_DIR}/Qt5OpenGL
+  fi
+fi
+
+if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk ] ; then
+  export CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
+elif [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ ] ; then
+  export CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
+fi
+
+echo "Generating Makefiles in" $OSSIM_BUILD_DIR
+
+
+# CMAKE command 
+cmake -G "$CMAKE_G_ARG" \
+-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
+-DOSSIM_DEV_HOME=$OSSIM_DEV_HOME \
+-DCMAKE_OSX_ARCHITECTURES="x86_64" \
+-DCMAKE_OSX_SYSROOT=$CMAKE_OSX_SYSROOT \
+-DCMAKE_OSX_DEPLOYMENT_TARGET=$CMAKE_OSX_DEPLOYMENT_TARGET \
+-DBUILD_OSSIM_FRAMEWORKS=${BUILD_OSSIM_FRAMEWORKS} \
+-DBUILD_OMS=$BUILD_OMS \
+-DBUILD_OSSIM_PLANET_GUI=${BUILD_OSSIM_PLANET_GUI} \
+-DBUILD_CNES_PLUGIN=$BUILD_CNES_PLUGIN \
+-DBUILD_CSM_PLUGIN=$BUILD_CSM_PLUGIN \
+-DBUILD_DSMG=$BUILD_DSMG \
+-DBUILD_OSSIM_MSP=$BUILD_OSSIM_MSP \
+-DBUILD_OSSIM_ATP=$BUILD_OSSIM_ATP \
+-DBUILD_FFTW3_PLUGIN=$BUILD_FFTW3_PLUGIN \
+-DBUILD_GEOPDF_PLUGIN=$BUILD_GEOPDF_PLUGIN \
+-DBUILD_GDAL_PLUGIN=$BUILD_GDAL_PLUGIN \
+-DBUILD_HDF5_PLUGIN=$BUILD_HDF5_PLUGIN \
+-DBUILD_KAKADU_PLUGIN=$BUILD_KAKADU_PLUGIN \
+-DBUILD_JPEG12_PLUGIN=$BUILD_JPEG12_PLUGIN \
+-DKAKADU_ROOT_SRC=$KAKADU_ROOT_SRC \
+-DKAKADU_AUX_LIBRARY=$KAKADU_AUX_LIBRARY \
+-DKAKADU_LIBRARY=$KAKADU_LIBRARY \
+-DBUILD_KML_PLUGIN=$BUILD_KML_PLUGIN \
+-DBUILD_MRSID_PLUGIN=$BUILD_MRSID_PLUGIN \
+-DMRSID_DIR=$MRSID_DIR \
+-DBUILD_MSP_PLUGIN=$BUILD_MSP_PLUGIN \
+-DOSSIM_PLUGIN_LINK_TYPE=SHARED \
+-DBUILD_OPENCV_PLUGIN=$BUILD_OPENCV_PLUGIN \
+-DBUILD_OPENJPEG_PLUGIN=$BUILD_OPENJPEG_PLUGIN \
+-DBUILD_PDAL_PLUGIN=$BUILD_PDAL_PLUGIN \
+-DBUILD_PNG_PLUGIN=$BUILD_PNG_PLUGIN \
+-DBUILD_AWS_PLUGIN=$BUILD_AWS_PLUGIN \
+-DBUILD_POTRACE_PLUGIN=$BUILD_POTRACE_PLUGIN \
+-DBUILD_REG_PLUGIN=$BUILD_REG_PLUGIN \
+-DBUILD_SQLITE_PLUGIN=$BUILD_SQLITE_PLUGIN \
+-DBUILD_WEB_PLUGIN=$BUILD_WEB_PLUGIN \
+-DBUILD_OSSIM_VIDEO=$BUILD_OSSIM_VIDEO \
+-DBUILD_OSSIM_GUI=$BUILD_OSSIM_GUI \
+-DBUILD_OSSIM_QT4=$BUILD_OSSIM_QT4 \
+-DBUILD_OSSIM_WMS=$BUILD_OSSIM_WMS \
+-DBUILD_OSSIM_PLANET=$BUILD_OSSIM_PLANET \
+-DBUILD_OSSIM_APPS=$BUILD_OSSIM_APPS \
+-DBUILD_OSSIM_CURL_APPS=$BUILD_OSSIM_CURL_APPS \
+-DBUILD_OSSIM_HDF5_SUPPORT=$BUILD_OSSIM_HDF5_SUPPORT \
+-DOSSIM_BUILD_ADDITIONAL_DIRECTORIES=$OSSIM_BUILD_ADDITIONAL_DIRECTORIES \
+-DOSSIM_BUILD_ADDITIONAL_PLUGIN_DIRECTORIES=$OSSIM_BUILD_ADDITIONAL_PLUGIN_DIRECTORIES \
+$CMAKE_DIR
+
+popd >/dev/null
+
diff --git a/doc/Doxyfile b/doc/Doxyfile
new file mode 100644
index 0000000..d6482d0
--- /dev/null
+++ b/doc/Doxyfile
@@ -0,0 +1,1553 @@
+# Doxyfile 1.7.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "OSSIM - Open Source Software Image Map"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         = "Version 1.8.17"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = .
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = ../include \
+                         ../src 
+#                        ../../ossim-plugins (don't forget backslash after src above)
+#                        (other C++ repositories as desired)
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS          = *.cpp \
+                         *.h \
+                         *.cc \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = CVS \
+                         .git
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = *CVS*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = YES
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 4
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = ossim
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML
+# documentation will contain the timesstamp.
+
+HTML_TIMESTAMP         = NO
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME           = FreeSans.ttf
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
diff --git a/doc/dependencies.md b/doc/dependencies.md
new file mode 100644
index 0000000..5b16d65
--- /dev/null
+++ b/doc/dependencies.md
@@ -0,0 +1,16 @@
+# Dependencies for the OSSIM baseline
+
+* [curl-7.46.0](https://s3.amazonaws.com/ossimlabs/dependencies/source/curl-7.46.0.zip)
+* [expat-2.1.0](https://s3.amazonaws.com/ossimlabs/dependencies/source/expat-2.1.0.zip)
+* [gdal-2.0.1](https://s3.amazonaws.com/ossimlabs/dependencies/source/gdal-2.0.1.zip)
+* [geos-3.4.2](https://s3.amazonaws.com/ossimlabs/dependencies/source/geos-3.4.2.zip)
+* [gpstk-2.5](https://s3.amazonaws.com/ossimlabs/dependencies/source/gpstk-2.5.zip)
+* [hdf5-1.8.16](https://s3.amazonaws.com/ossimlabs/dependencies/source/hdf5-1.8.16.zip)
+* [libgeotiff-1.4.1.](https://s3.amazonaws.com/ossimlabs/dependencies/source/libgeotiff-1.4.1.zip)
+* [libjpeg-turbo-1.4.2](https://s3.amazonaws.com/ossimlabs/dependencies/source/libjpeg-turbo-1.4.2.zip)
+* [libpng-1.2.43](https://s3.amazonaws.com/ossimlabs/dependencies/source/libpng-1.2.43.zip)
+* [opencv-3.1.0](https://s3.amazonaws.com/ossimlabs/dependencies/source/opencv-3.1.0.zip)
+* [proj-4.9.2](https://s3.amazonaws.com/ossimlabs/dependencies/source/proj-4.9.2.zip)
+* [sqlite-3100100](https://s3.amazonaws.com/ossimlabs/dependencies/source/sqlite-3100100.zip)
+* [tiff-4.0.6](https://s3.amazonaws.com/ossimlabs/dependencies/source/tiff-4.0.6.zip)
+* [zlib-1.2.5](https://s3.amazonaws.com/ossimlabs/dependencies/source/zlib-1.2.5.zip)
\ No newline at end of file
diff --git a/ossim/include/ossim/base/datum.h b/include/ossim/base/datum.h
similarity index 100%
rename from ossim/include/ossim/base/datum.h
rename to include/ossim/base/datum.h
diff --git a/include/ossim/base/jsoncpp.h b/include/ossim/base/jsoncpp.h
new file mode 100644
index 0000000..585de1d
--- /dev/null
+++ b/include/ossim/base/jsoncpp.h
@@ -0,0 +1,2085 @@
+/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/).
+/// It is intended to be used with #include "json/json.h"
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: LICENSE
+// //////////////////////////////////////////////////////////////////////
+
+/*
+The JsonCpp library's source code, including accompanying documentation,
+tests and demonstration applications, are licensed under the following
+conditions...
+
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+jurisdictions which recognize such a disclaimer. In such jurisdictions,
+this software is released into the Public Domain.
+
+In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
+2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
+released under the terms of the MIT License (see below).
+
+In jurisdictions which recognize Public Domain property, the user of this
+software may choose to accept it either as 1) Public Domain, 2) under the
+conditions of the MIT License (see below), or 3) under the terms of dual
+Public Domain/MIT License conditions described here, as they choose.
+
+The MIT License is about as close to Public Domain as a license can get, and is
+described in clear, concise terms at:
+
+   http://en.wikipedia.org/wiki/MIT_License
+
+The full text of the MIT License follows:
+
+========================================================================
+Copyright (c) 2007-2010 Baptiste Lepilleur
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+========================================================================
+(END LICENSE TEXT)
+
+The MIT license is compatible with both the GPL and commercial
+software, affording one all of the rights of Public Domain with the
+minor nuisance of being required to keep the above copyright notice
+and license text in the source code. Note also that by accepting the
+Public Domain "license" you can re-license your copy using whatever
+license you like.
+
+ */
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: LICENSE
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+#ifndef JSON_AMALGATED_H_INCLUDED
+# define JSON_AMALGATED_H_INCLUDED
+/// If defined, indicates that the source file is amalgated
+/// to prevent private header inclusion.
+#define JSON_IS_AMALGAMATION
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/version.h
+// //////////////////////////////////////////////////////////////////////
+
+// DO NOT EDIT. This file (and "version") is generated by CMake.
+// Run CMake configure step to update it.
+#ifndef JSON_VERSION_H_INCLUDED
+# define JSON_VERSION_H_INCLUDED
+
+# define JSONCPP_VERSION_STRING "1.7.0"
+# define JSONCPP_VERSION_MAJOR 1
+# define JSONCPP_VERSION_MINOR 7
+# define JSONCPP_VERSION_PATCH 0
+# define JSONCPP_VERSION_QUALIFIER
+# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
+
+#endif // JSON_VERSION_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/version.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/config.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef JSON_CONFIG_H_INCLUDED
+#define JSON_CONFIG_H_INCLUDED
+#include <stddef.h>
+#include <string> //typdef String
+
+/// If defined, indicates that json library is embedded in CppTL library.
+//# define JSON_IN_CPPTL 1
+
+/// If defined, indicates that json may leverage CppTL library
+//#  define JSON_USE_CPPTL 1
+/// If defined, indicates that cpptl vector based map should be used instead of
+/// std::map
+/// as Value container.
+//#  define JSON_USE_CPPTL_SMALLMAP 1
+
+// If non-zero, the library uses exceptions to report bad input instead of C
+// assertion macros. The default is to use exceptions.
+#ifndef JSON_USE_EXCEPTION
+#define JSON_USE_EXCEPTION 1
+#endif
+
+/// If defined, indicates that the source file is amalgated
+/// to prevent private header inclusion.
+/// Remarks: it is automatically defined in the generated amalgated header.
+// #define JSON_IS_AMALGAMATION
+
+#ifdef JSON_IN_CPPTL
+#include <cpptl/config.h>
+#ifndef JSON_USE_CPPTL
+#define JSON_USE_CPPTL 1
+#endif
+#endif
+
+#ifdef JSON_IN_CPPTL
+#define JSON_API CPPTL_API
+#elif defined(JSON_DLL_BUILD)
+#if defined(_MSC_VER)
+#define JSON_API __declspec(dllexport)
+#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
+#endif // if defined(_MSC_VER)
+#elif defined(JSON_DLL)
+#if defined(_MSC_VER)
+#define JSON_API __declspec(dllimport)
+#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
+#endif // if defined(_MSC_VER)
+#endif // ifdef JSON_IN_CPPTL
+#if !defined(JSON_API)
+#define JSON_API
+#endif
+
+// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
+// integer
+// Storages, and 64 bits integer support is disabled.
+// #define JSON_NO_INT64 1
+
+#if defined(_MSC_VER) // MSVC
+#  if _MSC_VER <= 1200 // MSVC 6
+// Microsoft Visual Studio 6 only support conversion from __int64 to double
+// (no conversion from unsigned __int64).
+#    define JSON_USE_INT64_DOUBLE_CONVERSION 1
+// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
+// characters in the debug information)
+// All projects I've ever seen with VS6 were using this globally (not bothering
+// with pragma push/pop).
+#    pragma warning(disable : 4786)
+#  endif // MSVC 6
+
+#  if _MSC_VER >= 1500 // MSVC 2008
+/// Indicates that the following function is deprecated.
+#    define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
+#  endif
+
+#endif // defined(_MSC_VER)
+
+
+#ifndef JSON_HAS_RVALUE_REFERENCES
+
+#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
+#define JSON_HAS_RVALUE_REFERENCES 1
+#endif // MSVC >= 2010
+
+#ifdef __clang__
+#if __has_feature(cxx_rvalue_references)
+#define JSON_HAS_RVALUE_REFERENCES 1
+#endif  // has_feature
+
+#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
+#define JSON_HAS_RVALUE_REFERENCES 1
+#endif  // GXX_EXPERIMENTAL
+
+#endif // __clang__ || __GNUC__
+
+#endif // not defined JSON_HAS_RVALUE_REFERENCES
+
+#ifndef JSON_HAS_RVALUE_REFERENCES
+#define JSON_HAS_RVALUE_REFERENCES 0
+#endif
+
+#ifdef __clang__
+#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
+#  if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+#    define JSONCPP_DEPRECATED(message)  __attribute__ ((deprecated(message)))
+#  elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+#    define JSONCPP_DEPRECATED(message)  __attribute__((__deprecated__))
+#  endif  // GNUC version
+#endif // __clang__ || __GNUC__
+
+#if !defined(JSONCPP_DEPRECATED)
+#define JSONCPP_DEPRECATED(message)
+#endif // if !defined(JSONCPP_DEPRECATED)
+
+#if __GNUC__ >= 6
+#  define JSON_USE_INT64_DOUBLE_CONVERSION 1
+#endif
+
+namespace Json {
+typedef int Int;
+typedef unsigned int UInt;
+#if defined(JSON_NO_INT64)
+typedef int LargestInt;
+typedef unsigned int LargestUInt;
+#undef JSON_HAS_INT64
+#else                 // if defined(JSON_NO_INT64)
+// For Microsoft Visual use specific types as long long is not supported
+#if defined(_MSC_VER) // Microsoft Visual Studio
+typedef __int64 Int64;
+typedef unsigned __int64 UInt64;
+#else                 // if defined(_MSC_VER) // Other platforms, use long long
+typedef long long int Int64;
+typedef unsigned long long int UInt64;
+#endif // if defined(_MSC_VER)
+typedef Int64 LargestInt;
+typedef UInt64 LargestUInt;
+#define JSON_HAS_INT64
+#endif // if defined(JSON_NO_INT64)
+#define JSONCPP_STRING        std::string
+#define JSONCPP_OSTRINGSTREAM std::ostringstream
+#define JSONCPP_OSTREAM       std::ostream
+#define JSONCPP_ISTRINGSTREAM std::istringstream
+#define JSONCPP_ISTREAM       std::istream
+} // end namespace Json
+
+#endif // JSON_CONFIG_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/config.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/forwards.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef JSON_FORWARDS_H_INCLUDED
+#define JSON_FORWARDS_H_INCLUDED
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include "config.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+
+namespace Json {
+
+// writer.h
+class FastWriter;
+class StyledWriter;
+
+// reader.h
+class Reader;
+
+// features.h
+class Features;
+
+// value.h
+typedef unsigned int ArrayIndex;
+class StaticString;
+class Path;
+class PathArgument;
+class Value;
+class ValueIteratorBase;
+class ValueIterator;
+class ValueConstIterator;
+
+} // namespace Json
+
+#endif // JSON_FORWARDS_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/forwards.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/features.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
+#define CPPTL_JSON_FEATURES_H_INCLUDED
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include "forwards.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+
+namespace Json {
+
+/** \brief Configuration passed to reader and writer.
+ * This configuration object can be used to force the Reader or Writer
+ * to behave in a standard conforming way.
+ */
+class JSON_API Features {
+public:
+   /** \brief A configuration that allows all features and assumes all strings
+    * are UTF-8.
+    * - C & C++ comments are allowed
+    * - Root object can be any JSON value
+    * - Assumes Value strings are encoded in UTF-8
+    */
+   static Features all();
+
+   /** \brief A configuration that is strictly compatible with the JSON
+    * specification.
+    * - Comments are forbidden.
+    * - Root object must be either an array or an object value.
+    * - Assumes Value strings are encoded in UTF-8
+    */
+   static Features strictMode();
+
+   /** \brief Initialize the configuration like JsonConfig::allFeatures;
+    */
+   Features();
+
+   /// \c true if comments are allowed. Default: \c true.
+   bool allowComments_;
+
+   /// \c true if root must be either an array or an object value. Default: \c
+   /// false.
+   bool strictRoot_;
+
+   /// \c true if dropped null placeholders are allowed. Default: \c false.
+   bool allowDroppedNullPlaceholders_;
+
+   /// \c true if numeric object key are allowed. Default: \c false.
+   bool allowNumericKeys_;
+};
+
+} // namespace Json
+
+#endif // CPPTL_JSON_FEATURES_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/features.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/value.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef CPPTL_JSON_H_INCLUDED
+#define CPPTL_JSON_H_INCLUDED
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include "forwards.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+#include <string>
+#include <vector>
+#include <exception>
+
+#ifndef JSON_USE_CPPTL_SMALLMAP
+#include <map>
+#else
+#include <cpptl/smallmap.h>
+#endif
+#ifdef JSON_USE_CPPTL
+#include <cpptl/forwards.h>
+#endif
+
+// Disable warning C4251: <data member>: <type> needs to have dll-interface to
+// be used by...
+#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma warning(push)
+#pragma warning(disable : 4251)
+#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+
+/** \brief JSON (JavaScript Object Notation).
+ */
+namespace Json {
+
+/** Base class for all exceptions we throw.
+ *
+ * We use nothing but these internally. Of course, STL can throw others.
+ */
+class JSON_API Exception : public std::exception {
+public:
+   Exception(JSONCPP_STRING const& msg);
+   ~Exception() throw(); 
+   char const* what() const throw();
+protected:
+   JSONCPP_STRING msg_;
+};
+
+/** Exceptions which the user cannot easily avoid.
+ *
+ * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
+ *
+ * \remark derived from Json::Exception
+ */
+class JSON_API RuntimeError : public Exception {
+public:
+   RuntimeError(JSONCPP_STRING const& msg);
+};
+
+/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
+ *
+ * These are precondition-violations (user bugs) and internal errors (our bugs).
+ *
+ * \remark derived from Json::Exception
+ */
+class JSON_API LogicError : public Exception {
+public:
+   LogicError(JSONCPP_STRING const& msg);
+};
+
+/// used internally
+void throwRuntimeError(JSONCPP_STRING const& msg);
+/// used internally
+void throwLogicError(JSONCPP_STRING const& msg);
+
+/** \brief Type of the value held by a Value object.
+ */
+enum ValueType {
+   nullValue = 0, ///< 'null' value
+   intValue,      ///< signed integer value
+   uintValue,     ///< unsigned integer value
+   realValue,     ///< double value
+   stringValue,   ///< UTF-8 string value
+   booleanValue,  ///< bool value
+   arrayValue,    ///< array value (ordered list)
+   objectValue    ///< object value (collection of name/value pairs).
+};
+
+enum CommentPlacement {
+   commentBefore = 0,      ///< a comment placed on the line before a value
+   commentAfterOnSameLine, ///< a comment just after a value on the same line
+   commentAfter, ///< a comment on the line after a value (only make sense for
+   /// root value)
+   numberOfCommentPlacement
+};
+
+//# ifdef JSON_USE_CPPTL
+//   typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
+//   typedef CppTL::AnyEnumerator<const Value &> EnumValues;
+//# endif
+
+/** \brief Lightweight wrapper to tag static string.
+ *
+ * Value constructor and objectValue member assignement takes advantage of the
+ * StaticString and avoid the cost of string duplication when storing the
+ * string or the member name.
+ *
+ * Example of usage:
+ * \code
+ * Json::Value aValue( StaticString("some text") );
+ * Json::Value object;
+ * static const StaticString code("code");
+ * object[code] = 1234;
+ * \endcode
+ */
+class JSON_API StaticString {
+public:
+   explicit StaticString(const char* czstring) : c_str_(czstring) {}
+
+   operator const char*() const { return c_str_; }
+
+   const char* c_str() const { return c_str_; }
+
+private:
+   const char* c_str_;
+};
+
+/** \brief Represents a <a HREF="http://www.json.org">JSON</a> value.
+ *
+ * This class is a discriminated union wrapper that can represents a:
+ * - signed integer [range: Value::minInt - Value::maxInt]
+ * - unsigned integer (range: 0 - Value::maxUInt)
+ * - double
+ * - UTF-8 string
+ * - boolean
+ * - 'null'
+ * - an ordered list of Value
+ * - collection of name/value pairs (javascript object)
+ *
+ * The type of the held value is represented by a #ValueType and
+ * can be obtained using type().
+ *
+ * Values of an #objectValue or #arrayValue can be accessed using operator[]()
+ * methods.
+ * Non-const methods will automatically create the a #nullValue element
+ * if it does not exist.
+ * The sequence of an #arrayValue will be automatically resized and initialized
+ * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.
+ *
+ * The get() methods can be used to obtain default value in the case the
+ * required element does not exist.
+ *
+ * It is possible to iterate over the list of a #objectValue values using
+ * the getMemberNames() method.
+ *
+ * \note #Value string-length fit in size_t, but keys must be < 2^30.
+ * (The reason is an implementation detail.) A #CharReader will raise an
+ * exception if a bound is exceeded to avoid security holes in your app,
+ * but the Value API does *not* check bounds. That is the responsibility
+ * of the caller.
+ */
+class JSON_API Value {
+   friend class ValueIteratorBase;
+public:
+   typedef std::vector<JSONCPP_STRING> Members;
+   typedef ValueIterator iterator;
+   typedef ValueConstIterator const_iterator;
+   typedef Json::UInt UInt;
+   typedef Json::Int Int;
+#if defined(JSON_HAS_INT64)
+   typedef Json::UInt64 UInt64;
+   typedef Json::Int64 Int64;
+#endif // defined(JSON_HAS_INT64)
+   typedef Json::LargestInt LargestInt;
+   typedef Json::LargestUInt LargestUInt;
+   typedef Json::ArrayIndex ArrayIndex;
+
+   static const Value& null;  ///< We regret this reference to a global instance; prefer the simpler Value().
+   static const Value& nullRef;  ///< just a kludge for binary-compatibility; same as null
+   /// Minimum signed integer value that can be stored in a Json::Value.
+   static const LargestInt minLargestInt;
+   /// Maximum signed integer value that can be stored in a Json::Value.
+   static const LargestInt maxLargestInt;
+   /// Maximum unsigned integer value that can be stored in a Json::Value.
+   static const LargestUInt maxLargestUInt;
+
+   /// Minimum signed int value that can be stored in a Json::Value.
+   static const Int minInt;
+   /// Maximum signed int value that can be stored in a Json::Value.
+   static const Int maxInt;
+   /// Maximum unsigned int value that can be stored in a Json::Value.
+   static const UInt maxUInt;
+
+#if defined(JSON_HAS_INT64)
+   /// Minimum signed 64 bits int value that can be stored in a Json::Value.
+   static const Int64 minInt64;
+   /// Maximum signed 64 bits int value that can be stored in a Json::Value.
+   static const Int64 maxInt64;
+   /// Maximum unsigned 64 bits int value that can be stored in a Json::Value.
+   static const UInt64 maxUInt64;
+#endif // defined(JSON_HAS_INT64)
+
+private:
+#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
+   class CZString {
+   public:
+      enum DuplicationPolicy {
+         noDuplication = 0,
+         duplicate,
+         duplicateOnCopy
+      };
+      CZString(ArrayIndex index);
+      CZString(char const* str, unsigned length, DuplicationPolicy allocate);
+      CZString(CZString const& other);
+#if JSON_HAS_RVALUE_REFERENCES
+      CZString(CZString&& other);
+#endif
+      ~CZString();
+      CZString& operator=(CZString other);
+      bool operator<(CZString const& other) const;
+      bool operator==(CZString const& other) const;
+      ArrayIndex index() const;
+      //const char* c_str() const; ///< \deprecated
+      char const* data() const;
+      unsigned length() const;
+      bool isStaticString() const;
+
+   private:
+      void swap(CZString& other);
+
+      struct StringStorage {
+         unsigned policy_: 2;
+         unsigned length_: 30; // 1GB max
+      };
+
+      char const* cstr_;  // actually, a prefixed string, unless policy is noDup
+      union {
+         ArrayIndex index_;
+         StringStorage storage_;
+      };
+   };
+
+public:
+#ifndef JSON_USE_CPPTL_SMALLMAP
+   typedef std::map<CZString, Value> ObjectValues;
+#else
+   typedef CppTL::SmallMap<CZString, Value> ObjectValues;
+#endif // ifndef JSON_USE_CPPTL_SMALLMAP
+#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
+
+public:
+   /** \brief Create a default Value of the given type.
+
+    This is a very useful constructor.
+    To create an empty array, pass arrayValue.
+    To create an empty object, pass objectValue.
+    Another Value can then be set to this one by assignment.
+This is useful since clear() and resize() will not alter types.
+
+    Examples:
+\code
+Json::Value null_value; // null
+Json::Value arr_value(Json::arrayValue); // []
+Json::Value obj_value(Json::objectValue); // {}
+\endcode
+    */
+   Value(ValueType type = nullValue);
+   Value(Int value);
+   Value(UInt value);
+#if defined(JSON_HAS_INT64)
+   Value(Int64 value);
+   Value(UInt64 value);
+#endif // if defined(JSON_HAS_INT64)
+   Value(double value);
+   Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
+   Value(const char* begin, const char* end); ///< Copy all, incl zeroes.
+   /** \brief Constructs a value from a static string.
+
+    * Like other value string constructor but do not duplicate the string for
+    * internal storage. The given string must remain alive after the call to this
+    * constructor.
+    * \note This works only for null-terminated strings. (We cannot change the
+    *   size of this class, so we have nowhere to store the length,
+    *   which might be computed later for various operations.)
+    *
+    * Example of usage:
+    * \code
+    * static StaticString foo("some text");
+    * Json::Value aValue(foo);
+    * \endcode
+    */
+   Value(const StaticString& value);
+   Value(const JSONCPP_STRING& value); ///< Copy data() til size(). Embedded zeroes too.
+#ifdef JSON_USE_CPPTL
+   Value(const CppTL::ConstString& value);
+#endif
+   Value(bool value);
+   /// Deep copy.
+   Value(const Value& other);
+#if JSON_HAS_RVALUE_REFERENCES
+   /// Move constructor
+   Value(Value&& other);
+#endif
+   ~Value();
+
+   /// Deep copy, then swap(other).
+   /// \note Over-write existing comments. To preserve comments, use #swapPayload().
+   Value& operator=(Value other);
+   /// Swap everything.
+   void swap(Value& other);
+   /// Swap values but leave comments and source offsets in place.
+   void swapPayload(Value& other);
+
+   ValueType type() const;
+
+   /// Compare payload only, not comments etc.
+   bool operator<(const Value& other) const;
+   bool operator<=(const Value& other) const;
+   bool operator>=(const Value& other) const;
+   bool operator>(const Value& other) const;
+   bool operator==(const Value& other) const;
+   bool operator!=(const Value& other) const;
+   int compare(const Value& other) const;
+
+   const char* asCString() const; ///< Embedded zeroes could cause you trouble!
+   JSONCPP_STRING asString() const; ///< Embedded zeroes are possible.
+   /** Get raw char* of string-value.
+    *  \return false if !string. (Seg-fault if str or end are NULL.)
+    */
+   bool getString(char const** begin, char const** end) const;
+#ifdef JSON_USE_CPPTL
+   CppTL::ConstString asConstString() const;
+#endif
+   Int asInt() const;
+   UInt asUInt() const;
+#if defined(JSON_HAS_INT64)
+   Int64 asInt64() const;
+   UInt64 asUInt64() const;
+#endif // if defined(JSON_HAS_INT64)
+   LargestInt asLargestInt() const;
+   LargestUInt asLargestUInt() const;
+   float asFloat() const;
+   double asDouble() const;
+   bool asBool() const;
+
+   bool isNull() const;
+   bool isBool() const;
+   bool isInt() const;
+   bool isInt64() const;
+   bool isUInt() const;
+   bool isUInt64() const;
+   bool isIntegral() const;
+   bool isDouble() const;
+   bool isNumeric() const;
+   bool isString() const;
+   bool isArray() const;
+   bool isObject() const;
+
+   bool isConvertibleTo(ValueType other) const;
+
+   /// Number of values in array or object
+   ArrayIndex size() const;
+
+   /// \brief Return true if empty array, empty object, or null;
+   /// otherwise, false.
+   bool empty() const;
+
+   /// Return isNull()
+   bool operator!() const;
+
+   /// Remove all object members and array elements.
+   /// \pre type() is arrayValue, objectValue, or nullValue
+   /// \post type() is unchanged
+   void clear();
+
+   /// Resize the array to size elements.
+   /// New elements are initialized to null.
+   /// May only be called on nullValue or arrayValue.
+   /// \pre type() is arrayValue or nullValue
+   /// \post type() is arrayValue
+   void resize(ArrayIndex size);
+
+   /// Access an array element (zero based index ).
+   /// If the array contains less than index element, then null value are
+   /// inserted
+   /// in the array so that its size is index+1.
+   /// (You may need to say 'value[0u]' to get your compiler to distinguish
+   ///  this from the operator[] which takes a string.)
+   Value& operator[](ArrayIndex index);
+
+   /// Access an array element (zero based index ).
+   /// If the array contains less than index element, then null value are
+   /// inserted
+   /// in the array so that its size is index+1.
+   /// (You may need to say 'value[0u]' to get your compiler to distinguish
+   ///  this from the operator[] which takes a string.)
+   Value& operator[](int index);
+
+   /// Access an array element (zero based index )
+   /// (You may need to say 'value[0u]' to get your compiler to distinguish
+   ///  this from the operator[] which takes a string.)
+   const Value& operator[](ArrayIndex index) const;
+
+   /// Access an array element (zero based index )
+   /// (You may need to say 'value[0u]' to get your compiler to distinguish
+   ///  this from the operator[] which takes a string.)
+   const Value& operator[](int index) const;
+
+   /// If the array contains at least index+1 elements, returns the element
+   /// value,
+   /// otherwise returns defaultValue.
+   Value get(ArrayIndex index, const Value& defaultValue) const;
+   /// Return true if index < size().
+   bool isValidIndex(ArrayIndex index) const;
+   /// \brief Append value to array at the end.
+   ///
+   /// Equivalent to jsonvalue[jsonvalue.size()] = value;
+   Value& append(const Value& value);
+
+   /// Access an object value by name, create a null member if it does not exist.
+   /// \note Because of our implementation, keys are limited to 2^30 -1 chars.
+   ///  Exceeding that will cause an exception.
+   Value& operator[](const char* key);
+   /// Access an object value by name, returns null if there is no member with
+   /// that name.
+   const Value& operator[](const char* key) const;
+   /// Access an object value by name, create a null member if it does not exist.
+   /// \param key may contain embedded nulls.
+   Value& operator[](const JSONCPP_STRING& key);
+   /// Access an object value by name, returns null if there is no member with
+   /// that name.
+   /// \param key may contain embedded nulls.
+   const Value& operator[](const JSONCPP_STRING& key) const;
+   /** \brief Access an object value by name, create a null member if it does not
+   exist.
+
+    * If the object has no entry for that name, then the member name used to store
+    * the new entry is not duplicated.
+    * Example of use:
+    * \code
+    * Json::Value object;
+    * static const StaticString code("code");
+    * object[code] = 1234;
+    * \endcode
+    */
+   Value& operator[](const StaticString& key);
+#ifdef JSON_USE_CPPTL
+   /// Access an object value by name, create a null member if it does not exist.
+   Value& operator[](const CppTL::ConstString& key);
+   /// Access an object value by name, returns null if there is no member with
+   /// that name.
+   const Value& operator[](const CppTL::ConstString& key) const;
+#endif
+   /// Return the member named key if it exist, defaultValue otherwise.
+   /// \note deep copy
+   Value get(const char* key, const Value& defaultValue) const;
+   /// Return the member named key if it exist, defaultValue otherwise.
+   /// \note deep copy
+   /// \note key may contain embedded nulls.
+   Value get(const char* begin, const char* end, const Value& defaultValue) const;
+   /// Return the member named key if it exist, defaultValue otherwise.
+   /// \note deep copy
+   /// \param key may contain embedded nulls.
+   Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;
+#ifdef JSON_USE_CPPTL
+   /// Return the member named key if it exist, defaultValue otherwise.
+   /// \note deep copy
+   Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
+#endif
+   /// Most general and efficient version of isMember()const, get()const,
+   /// and operator[]const
+   /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
+   Value const* find(char const* begin, char const* end) const;
+   /// Most general and efficient version of object-mutators.
+   /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
+   /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
+   Value const* demand(char const* begin, char const* end);
+   /// \brief Remove and return the named member.
+   ///
+   /// Do nothing if it did not exist.
+   /// \return the removed Value, or null.
+   /// \pre type() is objectValue or nullValue
+   /// \post type() is unchanged
+   /// \deprecated
+   Value removeMember(const char* key);
+   /// Same as removeMember(const char*)
+   /// \param key may contain embedded nulls.
+   /// \deprecated
+   Value removeMember(const JSONCPP_STRING& key);
+   /// Same as removeMember(const char* begin, const char* end, Value* removed),
+   /// but 'key' is null-terminated.
+   bool removeMember(const char* key, Value* removed);
+   /** \brief Remove the named map member.
+
+      Update 'removed' iff removed.
+      \param key may contain embedded nulls.
+      \return true iff removed (no exceptions)
+    */
+   bool removeMember(JSONCPP_STRING const& key, Value* removed);
+   /// Same as removeMember(JSONCPP_STRING const& key, Value* removed)
+   bool removeMember(const char* begin, const char* end, Value* removed);
+   /** \brief Remove the indexed array element.
+
+      O(n) expensive operations.
+      Update 'removed' iff removed.
+      \return true iff removed (no exceptions)
+    */
+   bool removeIndex(ArrayIndex i, Value* removed);
+
+   /// Return true if the object has a member named key.
+   /// \note 'key' must be null-terminated.
+   bool isMember(const char* key) const;
+   /// Return true if the object has a member named key.
+   /// \param key may contain embedded nulls.
+   bool isMember(const JSONCPP_STRING& key) const;
+   /// Same as isMember(JSONCPP_STRING const& key)const
+   bool isMember(const char* begin, const char* end) const;
+#ifdef JSON_USE_CPPTL
+   /// Return true if the object has a member named key.
+   bool isMember(const CppTL::ConstString& key) const;
+#endif
+
+   /// \brief Return a list of the member names.
+   ///
+   /// If null, return an empty list.
+   /// \pre type() is objectValue or nullValue
+   /// \post if type() was nullValue, it remains nullValue
+   Members getMemberNames() const;
+
+   //# ifdef JSON_USE_CPPTL
+   //      EnumMemberNames enumMemberNames() const;
+   //      EnumValues enumValues() const;
+   //# endif
+
+   /// \deprecated Always pass len.
+   JSONCPP_DEPRECATED("Use setComment(JSONCPP_STRING const&) instead.")
+   void setComment(const char* comment, CommentPlacement placement);
+   /// Comments must be //... or /* ... */
+   void setComment(const char* comment, size_t len, CommentPlacement placement);
+   /// Comments must be //... or /* ... */
+   void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);
+   bool hasComment(CommentPlacement placement) const;
+   /// Include delimiters and embedded newlines.
+   JSONCPP_STRING getComment(CommentPlacement placement) const;
+
+   JSONCPP_STRING toStyledString() const;
+
+   const_iterator begin() const;
+   const_iterator end() const;
+
+   iterator begin();
+   iterator end();
+
+   // Accessors for the [start, limit) range of bytes within the JSON text from
+   // which this value was parsed, if any.
+   void setOffsetStart(ptrdiff_t start);
+   void setOffsetLimit(ptrdiff_t limit);
+   ptrdiff_t getOffsetStart() const;
+   ptrdiff_t getOffsetLimit() const;
+
+private:
+   void initBasic(ValueType type, bool allocated = false);
+
+   Value& resolveReference(const char* key);
+   Value& resolveReference(const char* key, const char* end);
+
+   struct CommentInfo {
+      CommentInfo();
+      ~CommentInfo();
+
+      void setComment(const char* text, size_t len);
+
+      char* comment_;
+   };
+
+   // struct MemberNamesTransform
+   //{
+   //   typedef const char *result_type;
+   //   const char *operator()( const CZString &name ) const
+   //   {
+   //      return name.c_str();
+   //   }
+   //};
+
+   union ValueHolder {
+      LargestInt int_;
+      LargestUInt uint_;
+      double real_;
+      bool bool_;
+      char* string_;  // actually ptr to unsigned, followed by str, unless !allocated_
+      ObjectValues* map_;
+   } value_;
+   ValueType type_ : 8;
+   unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
+   // If not allocated_, string_ must be null-terminated.
+   CommentInfo* comments_;
+
+   // [start, limit) byte offsets in the source JSON text from which this Value
+   // was extracted.
+   ptrdiff_t start_;
+   ptrdiff_t limit_;
+};
+
+/** \brief Experimental and untested: represents an element of the "path" to
+ * access a node.
+ */
+class JSON_API PathArgument {
+public:
+   friend class Path;
+
+   PathArgument();
+   PathArgument(ArrayIndex index);
+   PathArgument(const char* key);
+   PathArgument(const JSONCPP_STRING& key);
+
+private:
+   enum Kind {
+      kindNone = 0,
+      kindIndex,
+      kindKey
+   };
+   JSONCPP_STRING key_;
+   ArrayIndex index_;
+   Kind kind_;
+};
+
+/** \brief Experimental and untested: represents a "path" to access a node.
+ *
+ * Syntax:
+ * - "." => root node
+ * - ".[n]" => elements at index 'n' of root node (an array value)
+ * - ".name" => member named 'name' of root node (an object value)
+ * - ".name1.name2.name3"
+ * - ".[0][1][2].name1[3]"
+ * - ".%" => member name is provided as parameter
+ * - ".[%]" => index is provied as parameter
+ */
+class JSON_API Path {
+public:
+   Path(const JSONCPP_STRING& path,
+        const PathArgument& a1 = PathArgument(),
+        const PathArgument& a2 = PathArgument(),
+        const PathArgument& a3 = PathArgument(),
+        const PathArgument& a4 = PathArgument(),
+        const PathArgument& a5 = PathArgument());
+
+   const Value& resolve(const Value& root) const;
+   Value resolve(const Value& root, const Value& defaultValue) const;
+   /// Creates the "path" to access the specified node and returns a reference on
+   /// the node.
+   Value& make(Value& root) const;
+
+private:
+   typedef std::vector<const PathArgument*> InArgs;
+   typedef std::vector<PathArgument> Args;
+
+   void makePath(const JSONCPP_STRING& path, const InArgs& in);
+   void addPathInArg(const JSONCPP_STRING& path,
+                     const InArgs& in,
+                     InArgs::const_iterator& itInArg,
+                     PathArgument::Kind kind);
+   void invalidPath(const JSONCPP_STRING& path, int location);
+
+   Args args_;
+};
+
+/** \brief base class for Value iterators.
+ *
+ */
+class JSON_API ValueIteratorBase {
+public:
+   typedef std::bidirectional_iterator_tag iterator_category;
+   typedef unsigned int size_t;
+   typedef int difference_type;
+   typedef ValueIteratorBase SelfType;
+
+   bool operator==(const SelfType& other) const { return isEqual(other); }
+
+   bool operator!=(const SelfType& other) const { return !isEqual(other); }
+
+   difference_type operator-(const SelfType& other) const {
+      return other.computeDistance(*this);
+   }
+
+   /// Return either the index or the member name of the referenced value as a
+   /// Value.
+   Value key() const;
+
+   /// Return the index of the referenced Value, or -1 if it is not an arrayValue.
+   UInt index() const;
+
+   /// Return the member name of the referenced Value, or "" if it is not an
+   /// objectValue.
+   /// \note Avoid `c_str()` on result, as embedded zeroes are possible.
+   JSONCPP_STRING name() const;
+
+   /// Return the member name of the referenced Value. "" if it is not an
+   /// objectValue.
+   /// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.
+   JSONCPP_DEPRECATED("Use `key = name();` instead.")
+   char const* memberName() const;
+   /// Return the member name of the referenced Value, or NULL if it is not an
+   /// objectValue.
+   /// \note Better version than memberName(). Allows embedded nulls.
+   char const* memberName(char const** end) const;
+
+protected:
+   Value& deref() const;
+
+   void increment();
+
+   void decrement();
+
+   difference_type computeDistance(const SelfType& other) const;
+
+   bool isEqual(const SelfType& other) const;
+
+   void copy(const SelfType& other);
+
+private:
+   Value::ObjectValues::iterator current_;
+   // Indicates that iterator is for a null value.
+   bool isNull_;
+
+public:
+   // For some reason, BORLAND needs these at the end, rather
+   // than earlier. No idea why.
+   ValueIteratorBase();
+   explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
+};
+
+/** \brief const iterator for object and array value.
+ *
+ */
+class JSON_API ValueConstIterator : public ValueIteratorBase {
+   friend class Value;
+
+public:
+   typedef const Value value_type;
+   //typedef unsigned int size_t;
+   //typedef int difference_type;
+   typedef const Value& reference;
+   typedef const Value* pointer;
+   typedef ValueConstIterator SelfType;
+
+   ValueConstIterator();
+   ValueConstIterator(ValueIterator const& other);
+
+private:
+   /*! \internal Use by Value to create an iterator.
+    */
+   explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
+public:
+   SelfType& operator=(const ValueIteratorBase& other);
+
+   SelfType operator++(int) {
+      SelfType temp(*this);
+      ++*this;
+      return temp;
+   }
+
+   SelfType operator--(int) {
+      SelfType temp(*this);
+      --*this;
+      return temp;
+   }
+
+   SelfType& operator--() {
+      decrement();
+      return *this;
+   }
+
+   SelfType& operator++() {
+      increment();
+      return *this;
+   }
+
+   reference operator*() const { return deref(); }
+
+   pointer operator->() const { return &deref(); }
+};
+
+/** \brief Iterator for object and array value.
+ */
+class JSON_API ValueIterator : public ValueIteratorBase {
+   friend class Value;
+
+public:
+   typedef Value value_type;
+   typedef unsigned int size_t;
+   typedef int difference_type;
+   typedef Value& reference;
+   typedef Value* pointer;
+   typedef ValueIterator SelfType;
+
+   ValueIterator();
+   explicit ValueIterator(const ValueConstIterator& other);
+   ValueIterator(const ValueIterator& other);
+
+private:
+   /*! \internal Use by Value to create an iterator.
+    */
+   explicit ValueIterator(const Value::ObjectValues::iterator& current);
+public:
+   SelfType& operator=(const SelfType& other);
+
+   SelfType operator++(int) {
+      SelfType temp(*this);
+      ++*this;
+      return temp;
+   }
+
+   SelfType operator--(int) {
+      SelfType temp(*this);
+      --*this;
+      return temp;
+   }
+
+   SelfType& operator--() {
+      decrement();
+      return *this;
+   }
+
+   SelfType& operator++() {
+      increment();
+      return *this;
+   }
+
+   reference operator*() const { return deref(); }
+
+   pointer operator->() const { return &deref(); }
+};
+
+} // namespace Json
+
+
+namespace std {
+/// Specialize std::swap() for Json::Value.
+template<>
+inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
+}
+
+
+#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma warning(pop)
+#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+
+#endif // CPPTL_JSON_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/value.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/reader.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef CPPTL_JSON_READER_H_INCLUDED
+#define CPPTL_JSON_READER_H_INCLUDED
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include "features.h"
+#include "value.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+#include <deque>
+#include <iosfwd>
+#include <stack>
+#include <string>
+#include <istream>
+
+// Disable warning C4251: <data member>: <type> needs to have dll-interface to
+// be used by...
+#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma warning(push)
+#pragma warning(disable : 4251)
+#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+
+namespace Json {
+
+/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
+ *Value.
+ *
+ * \deprecated Use CharReader and CharReaderBuilder.
+ */
+class JSON_API Reader {
+public:
+   typedef char Char;
+   typedef const Char* Location;
+
+   /** \brief An error tagged with where in the JSON text it was encountered.
+    *
+    * The offsets give the [start, limit) range of bytes within the text. Note
+    * that this is bytes, not codepoints.
+    *
+    */
+   struct StructuredError {
+      ptrdiff_t offset_start;
+      ptrdiff_t offset_limit;
+      std::string message;
+   };
+
+   /** \brief Constructs a Reader allowing all features
+    * for parsing.
+    */
+   Reader();
+
+   /** \brief Constructs a Reader allowing the specified feature set
+    * for parsing.
+    */
+   Reader(const Features& features);
+
+   /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
+    * document.
+    * \param document UTF-8 encoded string containing the document to read.
+    * \param root [out] Contains the root value of the document if it was
+    *             successfully parsed.
+    * \param collectComments \c true to collect comment and allow writing them
+    * back during
+    *                        serialization, \c false to discard comments.
+    *                        This parameter is ignored if
+    * Features::allowComments_
+    *                        is \c false.
+    * \return \c true if the document was successfully parsed, \c false if an
+    * error occurred.
+    */
+   bool
+   parse(const std::string& document, Value& root, bool collectComments = true);
+
+   /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
+   document.
+    * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
+   document to read.
+    * \param endDoc Pointer on the end of the UTF-8 encoded string of the
+   document to read.
+    *               Must be >= beginDoc.
+    * \param root [out] Contains the root value of the document if it was
+    *             successfully parsed.
+    * \param collectComments \c true to collect comment and allow writing them
+   back during
+    *                        serialization, \c false to discard comments.
+    *                        This parameter is ignored if
+   Features::allowComments_
+    *                        is \c false.
+    * \return \c true if the document was successfully parsed, \c false if an
+   error occurred.
+    */
+   bool parse(const char* beginDoc,
+              const char* endDoc,
+              Value& root,
+              bool collectComments = true);
+
+   /// \brief Parse from input stream.
+   /// \see Json::operator>>(std::istream&, Json::Value&).
+   bool parse(JSONCPP_ISTREAM& is, Value& root, bool collectComments = true);
+
+   /** \brief Returns a user friendly string that list errors in the parsed
+    * document.
+    * \return Formatted error message with the list of errors with their location
+    * in
+    *         the parsed document. An empty string is returned if no error
+    * occurred
+    *         during parsing.
+    * \deprecated Use getFormattedErrorMessages() instead (typo fix).
+    */
+   JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
+   std::string getFormatedErrorMessages() const;
+
+   /** \brief Returns a user friendly string that list errors in the parsed
+    * document.
+    * \return Formatted error message with the list of errors with their location
+    * in
+    *         the parsed document. An empty string is returned if no error
+    * occurred
+    *         during parsing.
+    */
+   std::string getFormattedErrorMessages() const;
+
+   /** \brief Returns a vector of structured erros encounted while parsing.
+    * \return A (possibly empty) vector of StructuredError objects. Currently
+    *         only one error can be returned, but the caller should tolerate
+    * multiple
+    *         errors.  This can occur if the parser recovers from a non-fatal
+    *         parse error and then encounters additional errors.
+    */
+   std::vector<StructuredError> getStructuredErrors() const;
+
+   /** \brief Add a semantic error message.
+    * \param value JSON Value location associated with the error
+    * \param message The error message.
+    * \return \c true if the error was successfully added, \c false if the
+    * Value offset exceeds the document size.
+    */
+   bool pushError(const Value& value, const std::string& message);
+
+   /** \brief Add a semantic error message with extra context.
+    * \param value JSON Value location associated with the error
+    * \param message The error message.
+    * \param extra Additional JSON Value location to contextualize the error
+    * \return \c true if the error was successfully added, \c false if either
+    * Value offset exceeds the document size.
+    */
+   bool pushError(const Value& value, const std::string& message, const Value& extra);
+
+   /** \brief Return whether there are any errors.
+    * \return \c true if there are no errors to report \c false if
+    * errors have occurred.
+    */
+   bool good() const;
+
+private:
+   enum TokenType {
+      tokenEndOfStream = 0,
+      tokenObjectBegin,
+      tokenObjectEnd,
+      tokenArrayBegin,
+      tokenArrayEnd,
+      tokenString,
+      tokenNumber,
+      tokenTrue,
+      tokenFalse,
+      tokenNull,
+      tokenArraySeparator,
+      tokenMemberSeparator,
+      tokenComment,
+      tokenError
+   };
+
+   class Token {
+   public:
+      TokenType type_;
+      Location start_;
+      Location end_;
+   };
+
+   class ErrorInfo {
+   public:
+      Token token_;
+      std::string message_;
+      Location extra_;
+   };
+
+   typedef std::deque<ErrorInfo> Errors;
+
+   bool readToken(Token& token);
+   void skipSpaces();
+   bool match(Location pattern, int patternLength);
+   bool readComment();
+   bool readCStyleComment();
+   bool readCppStyleComment();
+   bool readString();
+   void readNumber();
+   bool readValue();
+   bool readObject(Token& token);
+   bool readArray(Token& token);
+   bool decodeNumber(Token& token);
+   bool decodeNumber(Token& token, Value& decoded);
+   bool decodeString(Token& token);
+   bool decodeString(Token& token, std::string& decoded);
+   bool decodeDouble(Token& token);
+   bool decodeDouble(Token& token, Value& decoded);
+   bool decodeUnicodeCodePoint(Token& token,
+                               Location& current,
+                               Location end,
+                               unsigned int& unicode);
+   bool decodeUnicodeEscapeSequence(Token& token,
+                                    Location& current,
+                                    Location end,
+                                    unsigned int& unicode);
+   bool addError(const std::string& message, Token& token, Location extra = 0);
+   bool recoverFromError(TokenType skipUntilToken);
+   bool addErrorAndRecover(const std::string& message,
+                           Token& token,
+                           TokenType skipUntilToken);
+   void skipUntilSpace();
+   Value& currentValue();
+   Char getNextChar();
+   void
+   getLocationLineAndColumn(Location location, int& line, int& column) const;
+   std::string getLocationLineAndColumn(Location location) const;
+   void addComment(Location begin, Location end, CommentPlacement placement);
+   void skipCommentTokens(Token& token);
+
+   typedef std::stack<Value*> Nodes;
+   Nodes nodes_;
+   Errors errors_;
+   std::string document_;
+   Location begin_;
+   Location end_;
+   Location current_;
+   Location lastValueEnd_;
+   Value* lastValue_;
+   std::string commentsBefore_;
+   Features features_;
+   bool collectComments_;
+};  // Reader
+
+/** Interface for reading JSON from a char array.
+ */
+class JSON_API CharReader {
+public:
+   virtual ~CharReader() {}
+   /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
+   document.
+    * The document must be a UTF-8 encoded string containing the document to read.
+    *
+    * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
+   document to read.
+    * \param endDoc Pointer on the end of the UTF-8 encoded string of the
+   document to read.
+    *        Must be >= beginDoc.
+    * \param root [out] Contains the root value of the document if it was
+    *             successfully parsed.
+    * \param errs [out] Formatted error messages (if not NULL)
+    *        a user friendly string that lists errors in the parsed
+    * document.
+    * \return \c true if the document was successfully parsed, \c false if an
+   error occurred.
+    */
+   virtual bool parse(
+         char const* beginDoc, char const* endDoc,
+         Value* root, std::string* errs) = 0;
+
+   class JSON_API Factory {
+   public:
+      virtual ~Factory() {}
+      /** \brief Allocate a CharReader via operator new().
+       * \throw std::exception if something goes wrong (e.g. invalid settings)
+       */
+      virtual CharReader* newCharReader() const = 0;
+   };  // Factory
+};  // CharReader
+
+/** \brief Build a CharReader implementation.
+
+Usage:
+\code
+  using namespace Json;
+  CharReaderBuilder builder;
+  builder["collectComments"] = false;
+  Value value;
+  std::string errs;
+  bool ok = parseFromStream(builder, std::cin, &value, &errs);
+\endcode
+ */
+class JSON_API CharReaderBuilder : public CharReader::Factory {
+public:
+   // Note: We use a Json::Value so that we can add data-members to this class
+   // without a major version bump.
+   /** Configuration of this builder.
+    These are case-sensitive.
+    Available settings (case-sensitive):
+    - `"collectComments": false or true`
+      - true to collect comment and allow writing them
+        back during serialization, false to discard comments.
+        This parameter is ignored if allowComments is false.
+    - `"allowComments": false or true`
+      - true if comments are allowed.
+    - `"strictRoot": false or true`
+      - true if root must be either an array or an object value
+    - `"allowDroppedNullPlaceholders": false or true`
+      - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
+    - `"allowNumericKeys": false or true`
+      - true if numeric object keys are allowed.
+    - `"allowSingleQuotes": false or true`
+      - true if '' are allowed for strings (both keys and values)
+    - `"stackLimit": integer`
+      - Exceeding stackLimit (recursive depth of `readValue()`) will
+        cause an exception.
+      - This is a security issue (seg-faults caused by deeply nested JSON),
+        so the default is low.
+    - `"failIfExtra": false or true`
+      - If true, `parse()` returns false when extra non-whitespace trails
+        the JSON value in the input string.
+    - `"rejectDupKeys": false or true`
+      - If true, `parse()` returns false when a key is duplicated within an object.
+    - `"allowSpecialFloats": false or true`
+      - If true, special float values (NaNs and infinities) are allowed
+        and their values are lossfree restorable.
+
+    You can examine 'settings_` yourself
+    to see the defaults. You can also write and read them just like any
+    JSON Value.
+    \sa setDefaults()
+    */
+   Json::Value settings_;
+
+   CharReaderBuilder();
+   ~CharReaderBuilder();
+
+   CharReader* newCharReader() const;
+
+   /** \return true if 'settings' are legal and consistent;
+    *   otherwise, indicate bad settings via 'invalid'.
+    */
+   bool validate(Json::Value* invalid) const;
+
+   /** A simple way to update a specific setting.
+    */
+   Value& operator[](std::string key);
+
+   /** Called by ctor, but you can use this to reset settings_.
+    * \pre 'settings' != NULL (but Json::null is fine)
+    * \remark Defaults:
+    * \snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults
+    */
+   static void setDefaults(Json::Value* settings);
+   /** Same as old Features::strictMode().
+    * \pre 'settings' != NULL (but Json::null is fine)
+    * \remark Defaults:
+    * \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
+    */
+   static void strictMode(Json::Value* settings);
+};
+
+/** Consume entire stream and use its begin/end.
+ * Someday we might have a real StreamReader, but for now this
+ * is convenient.
+ */
+bool JSON_API parseFromStream(
+      CharReader::Factory const&,
+      JSONCPP_ISTREAM&,
+      Value* root, std::string* errs);
+
+/** \brief Read from 'sin' into 'root'.
+
+ Always keep comments from the input JSON.
+
+ This can be used to read a file into a particular sub-object.
+ For example:
+ \code
+ Json::Value root;
+ cin >> root["dir"]["file"];
+ cout << root;
+ \endcode
+ Result:
+ \verbatim
+ {
+ "dir": {
+     "file": {
+     // The input stream JSON would be nested here.
+     }
+ }
+ }
+ \endverbatim
+ \throw std::exception on parse error.
+ \see Json::operator<<()
+ */
+JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
+
+} // namespace Json
+
+#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma warning(pop)
+#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+
+#endif // CPPTL_JSON_READER_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/reader.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/writer.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef JSON_WRITER_H_INCLUDED
+#define JSON_WRITER_H_INCLUDED
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include "value.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+#include <vector>
+#include <string>
+#include <ostream>
+
+// Disable warning C4251: <data member>: <type> needs to have dll-interface to
+// be used by...
+#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma warning(push)
+#pragma warning(disable : 4251)
+#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+
+namespace Json {
+
+class Value;
+
+/**
+
+Usage:
+\code
+  using namespace Json;
+  void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {
+    std::unique_ptr<StreamWriter> const writer(
+      factory.newStreamWriter());
+    writer->write(value, &std::cout);
+    std::cout << std::endl;  // add lf and flush
+  }
+\endcode
+ */
+class JSON_API StreamWriter {
+protected:
+   JSONCPP_OSTREAM* sout_;  // not owned; will not delete
+public:
+   StreamWriter();
+   virtual ~StreamWriter();
+   /** Write Value into document as configured in sub-class.
+      Do not take ownership of sout, but maintain a reference during function.
+      \pre sout != NULL
+      \return zero on success (For now, we always return zero, so check the stream instead.)
+      \throw std::exception possibly, depending on configuration
+    */
+   virtual int write(Value const& root, JSONCPP_OSTREAM* sout) = 0;
+
+   /** \brief A simple abstract factory.
+    */
+   class JSON_API Factory {
+   public:
+      virtual ~Factory();
+      /** \brief Allocate a CharReader via operator new().
+       * \throw std::exception if something goes wrong (e.g. invalid settings)
+       */
+      virtual StreamWriter* newStreamWriter() const = 0;
+   };  // Factory
+};  // StreamWriter
+
+/** \brief Write into stringstream, then return string, for convenience.
+ * A StreamWriter will be created from the factory, used, and then deleted.
+ */
+std::string JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);
+
+
+/** \brief Build a StreamWriter implementation.
+
+Usage:
+\code
+  using namespace Json;
+  Value value = ...;
+  StreamWriterBuilder builder;
+  builder["commentStyle"] = "None";
+  builder["indentation"] = "   ";  // or whatever you like
+  std::unique_ptr<Json::StreamWriter> writer(
+      builder.newStreamWriter());
+  writer->write(value, &std::cout);
+  std::cout << std::endl;  // add lf and flush
+\endcode
+ */
+class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
+public:
+   // Note: We use a Json::Value so that we can add data-members to this class
+   // without a major version bump.
+   /** Configuration of this builder.
+    Available settings (case-sensitive):
+    - "commentStyle": "None" or "All"
+    - "indentation":  "<anything>"
+    - "enableYAMLCompatibility": false or true
+      - slightly change the whitespace around colons
+    - "dropNullPlaceholders": false or true
+      - Drop the "null" string from the writer's output for nullValues.
+        Strictly speaking, this is not valid JSON. But when the output is being
+        fed to a browser's Javascript, it makes for smaller output and the
+        browser can handle the output just fine.
+    - "useSpecialFloats": false or true
+      - If true, outputs non-finite floating point values in the following way:
+        NaN values as "NaN", positive infinity as "Infinity", and negative infinity
+        as "-Infinity".
+
+    You can examine 'settings_` yourself
+    to see the defaults. You can also write and read them just like any
+    JSON Value.
+    \sa setDefaults()
+    */
+   Json::Value settings_;
+
+   StreamWriterBuilder();
+   ~StreamWriterBuilder();
+
+   /**
+    * \throw std::exception if something goes wrong (e.g. invalid settings)
+    */
+   StreamWriter* newStreamWriter() const;
+
+   /** \return true if 'settings' are legal and consistent;
+    *   otherwise, indicate bad settings via 'invalid'.
+    */
+   bool validate(Json::Value* invalid) const;
+   /** A simple way to update a specific setting.
+    */
+   Value& operator[](std::string key);
+
+   /** Called by ctor, but you can use this to reset settings_.
+    * \pre 'settings' != NULL (but Json::null is fine)
+    * \remark Defaults:
+    * \snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults
+    */
+   static void setDefaults(Json::Value* settings);
+};
+
+/** \brief Abstract class for writers.
+ * \deprecated Use StreamWriter. (And really, this is an implementation detail.)
+ */
+class JSON_API Writer {
+public:
+   virtual ~Writer();
+
+   virtual std::string write(const Value& root) = 0;
+};
+
+/** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
+ *without formatting (not human friendly).
+ *
+ * The JSON document is written in a single line. It is not intended for 'human'
+ *consumption,
+ * but may be usefull to support feature such as RPC where bandwith is limited.
+ * \sa Reader, Value
+ * \deprecated Use StreamWriterBuilder.
+ */
+class JSON_API FastWriter : public Writer {
+
+public:
+   FastWriter();
+   ~FastWriter() {}
+
+   void enableYAMLCompatibility();
+
+   /** \brief Drop the "null" string from the writer's output for nullValues.
+    * Strictly speaking, this is not valid JSON. But when the output is being
+    * fed to a browser's Javascript, it makes for smaller output and the
+    * browser can handle the output just fine.
+    */
+   void dropNullPlaceholders();
+
+   void omitEndingLineFeed();
+
+public: // overridden from Writer
+   std::string write(const Value& root);
+
+private:
+   void writeValue(const Value& value);
+
+   std::string document_;
+   bool yamlCompatiblityEnabled_;
+   bool dropNullPlaceholders_;
+   bool omitEndingLineFeed_;
+};
+
+/** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
+ *human friendly way.
+ *
+ * The rules for line break and indent are as follow:
+ * - Object value:
+ *     - if empty then print {} without indent and line break
+ *     - if not empty the print '{', line break & indent, print one value per
+ *line
+ *       and then unindent and line break and print '}'.
+ * - Array value:
+ *     - if empty then print [] without indent and line break
+ *     - if the array contains no object value, empty array or some other value
+ *types,
+ *       and all the values fit on one lines, then print the array on a single
+ *line.
+ *     - otherwise, it the values do not fit on one line, or the array contains
+ *       object or non empty array, then print one value per line.
+ *
+ * If the Value have comments then they are outputed according to their
+ *#CommentPlacement.
+ *
+ * \sa Reader, Value, Value::setComment()
+ * \deprecated Use StreamWriterBuilder.
+ */
+class JSON_API StyledWriter : public Writer {
+public:
+   StyledWriter();
+   ~StyledWriter() {}
+
+public: // overridden from Writer
+   /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
+    * \param root Value to serialize.
+    * \return String containing the JSON document that represents the root value.
+    */
+   std::string write(const Value& root);
+
+private:
+   void writeValue(const Value& value);
+   void writeArrayValue(const Value& value);
+   bool isMultineArray(const Value& value);
+   void pushValue(const std::string& value);
+   void writeIndent();
+   void writeWithIndent(const std::string& value);
+   void indent();
+   void unindent();
+   void writeCommentBeforeValue(const Value& root);
+   void writeCommentAfterValueOnSameLine(const Value& root);
+   bool hasCommentForValue(const Value& value);
+   static std::string normalizeEOL(const std::string& text);
+
+   typedef std::vector<std::string> ChildValues;
+
+   ChildValues childValues_;
+   std::string document_;
+   std::string indentString_;
+   unsigned int rightMargin_;
+   unsigned int indentSize_;
+   bool addChildValues_;
+};
+
+/** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
+ human friendly way,
+     to a stream rather than to a string.
+ *
+ * The rules for line break and indent are as follow:
+ * - Object value:
+ *     - if empty then print {} without indent and line break
+ *     - if not empty the print '{', line break & indent, print one value per
+ line
+ *       and then unindent and line break and print '}'.
+ * - Array value:
+ *     - if empty then print [] without indent and line break
+ *     - if the array contains no object value, empty array or some other value
+ types,
+ *       and all the values fit on one lines, then print the array on a single
+ line.
+ *     - otherwise, it the values do not fit on one line, or the array contains
+ *       object or non empty array, then print one value per line.
+ *
+ * If the Value have comments then they are outputed according to their
+ #CommentPlacement.
+ *
+ * \param indentation Each level will be indented by this amount extra.
+ * \sa Reader, Value, Value::setComment()
+ * \deprecated Use StreamWriterBuilder.
+ */
+class JSON_API StyledStreamWriter {
+public:
+   StyledStreamWriter(std::string indentation = "\t");
+   ~StyledStreamWriter() {}
+
+public:
+   /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
+    * \param out Stream to write to. (Can be ostringstream, e.g.)
+    * \param root Value to serialize.
+    * \note There is no point in deriving from Writer, since write() should not
+    * return a value.
+    */
+   void write(JSONCPP_OSTREAM& out, const Value& root);
+
+private:
+   void writeValue(const Value& value);
+   void writeArrayValue(const Value& value);
+   bool isMultineArray(const Value& value);
+   void pushValue(const std::string& value);
+   void writeIndent();
+   void writeWithIndent(const std::string& value);
+   void indent();
+   void unindent();
+   void writeCommentBeforeValue(const Value& root);
+   void writeCommentAfterValueOnSameLine(const Value& root);
+   bool hasCommentForValue(const Value& value);
+   static std::string normalizeEOL(const std::string& text);
+
+   typedef std::vector<std::string> ChildValues;
+
+   ChildValues childValues_;
+   JSONCPP_OSTREAM* document_;
+   std::string indentString_;
+   unsigned int rightMargin_;
+   std::string indentation_;
+   bool addChildValues_ : 1;
+   bool indented_ : 1;
+};
+
+#if defined(JSON_HAS_INT64)
+std::string JSON_API valueToString(Int value);
+std::string JSON_API valueToString(UInt value);
+#endif // if defined(JSON_HAS_INT64)
+std::string JSON_API valueToString(LargestInt value);
+std::string JSON_API valueToString(LargestUInt value);
+std::string JSON_API valueToString(double value);
+std::string JSON_API valueToString(bool value);
+std::string JSON_API valueToQuotedString(const char* value);
+
+/// \brief Output using the StyledStreamWriter.
+/// \see Json::operator>>()
+JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
+
+} // namespace Json
+
+#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+#pragma warning(pop)
+#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
+
+#endif // JSON_WRITER_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/writer.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: include/json/assertions.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
+#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
+
+#include <stdlib.h>
+#include <sstream>
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include "config.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+
+/** It should not be possible for a maliciously designed file to
+ *  cause an abort() or seg-fault, so these macros are used only
+ *  for pre-condition violations and internal logic errors.
+ */
+#if JSON_USE_EXCEPTION
+
+// @todo <= add detail about condition in exception
+# define JSON_ASSERT(condition)                                                \
+      {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
+
+# define JSON_FAIL_MESSAGE(message)                                            \
+      {                                                                            \
+   JSONCPP_OSTRINGSTREAM oss; oss << message;                                    \
+   Json::throwLogicError(oss.str());                                          \
+   abort();                                                                   \
+      }
+
+#else // JSON_USE_EXCEPTION
+
+# define JSON_ASSERT(condition) assert(condition)
+
+// The call to assert() will show the failure message in debug builds. In
+// release builds we abort, for a core-dump or debugger.
+# define JSON_FAIL_MESSAGE(message)                                            \
+      {                                                                            \
+   JSONCPP_OSTRINGSTREAM oss; oss << message;                                    \
+   assert(false && oss.str().c_str());                                        \
+   abort();                                                                   \
+      }
+
+
+#endif
+
+#define JSON_ASSERT_MESSAGE(condition, message)                                \
+      if (!(condition)) {                                                          \
+         JSON_FAIL_MESSAGE(message);                                                \
+      }
+
+#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: include/json/assertions.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+#endif //ifndef JSON_AMALGATED_H_INCLUDED
diff --git a/ossim/include/ossim/base/ossim2dBilinearTransform.h b/include/ossim/base/ossim2dBilinearTransform.h
similarity index 100%
rename from ossim/include/ossim/base/ossim2dBilinearTransform.h
rename to include/ossim/base/ossim2dBilinearTransform.h
diff --git a/ossim/include/ossim/base/ossim2dLinearRegression.h b/include/ossim/base/ossim2dLinearRegression.h
similarity index 100%
rename from ossim/include/ossim/base/ossim2dLinearRegression.h
rename to include/ossim/base/ossim2dLinearRegression.h
diff --git a/include/ossim/base/ossim2dTo2dIdentityTransform.h b/include/ossim/base/ossim2dTo2dIdentityTransform.h
new file mode 100644
index 0000000..fd4da43
--- /dev/null
+++ b/include/ossim/base/ossim2dTo2dIdentityTransform.h
@@ -0,0 +1,68 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:  Contains class definition for ossim2dTo2dIdentityTransform.
+// 
+//*******************************************************************
+//  $Id$
+#ifndef ossim2dTo2dIdentityTransform_HEADER
+#define ossim2dTo2dIdentityTransform_HEADER
+#include "ossim2dTo2dTransform.h"
+/**
+ * This is the identity transform and just passes the input to the output.
+ */
+class OSSIM_DLL ossim2dTo2dIdentityTransform : public ossim2dTo2dTransform
+{
+public:
+   /**
+    * forward transform just passes the point to the output.
+    */
+   virtual void forward(const ossimDpt& input,
+                        ossimDpt& output) const
+   {
+      output = input;
+   }
+   
+   /**
+    * forward transform nothing is modified on the input point.
+    */
+   virtual void forward(ossimDpt&  /* modify_this */) const
+   {
+      // do nothing this is identity
+   }
+   
+   /**
+    * inverse transform just passes the point to the output.
+    */
+   virtual void inverse(const ossimDpt& input,
+                        ossimDpt&       output) const
+   {
+      output = input;
+   }
+   
+   /**
+    * inverse transform nothing is modified on the input point.
+    */
+   virtual void inverse(ossimDpt&  /* modify_this */) const
+   {
+      // do nothing this is identity
+   }
+   
+   /**
+    * Pass equality to the parent
+    */
+   virtual const ossim2dTo2dIdentityTransform& operator=(
+                                                 const ossim2dTo2dIdentityTransform& rhs)
+   {
+      ossim2dTo2dTransform::operator =(rhs);
+      
+      return *this;
+   }
+   
+protected:
+   TYPE_DATA
+};
+#endif
diff --git a/include/ossim/base/ossim2dTo2dMatrixTransform.h b/include/ossim/base/ossim2dTo2dMatrixTransform.h
new file mode 100644
index 0000000..349deba
--- /dev/null
+++ b/include/ossim/base/ossim2dTo2dMatrixTransform.h
@@ -0,0 +1,220 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:
+//
+// Description: 
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossim2dTo2dMatrixTransform_HEADER
+#define ossim2dTo2dMatrixTransform_HEADER 1
+
+#include <ossim/base/ossim2dTo2dTransform.h>
+#include <algorithm>
+
+/**
+ * ossim2dTo2dMatrixTransform allows one to specify a set of input points and output points
+ * and will fit a bilinear transform to those points.  Function of the form is solved for each  
+ * output dimension.
+ *
+ * z(x,y) = a + b*x + c*y + d*x*y
+ *
+ * We use the ossimLeastSquareBilin solver to solve for the coefficients.
+ *
+ */
+class OSSIM_DLL ossim2dTo2dMatrixTransform : public ossim2dTo2dTransform
+{
+public: 
+
+   /**
+    * Initialize to the identity
+    */
+   ossim2dTo2dMatrixTransform();
+   
+   /**
+    * Initialize the transform that best fits the input and output arrays.  
+    * If the input and output are well dispersed and are 4 points it should fit
+    * exactly.  Both arrays should be of equal number of points
+    *
+    * @param input the list of input points
+    * @param output the list of output points to transform the input to
+    * @param arraySize the number of points for the arrays.
+    */
+   ossim2dTo2dMatrixTransform(const ossimDpt* input,
+                            const ossimDpt* output, 
+                            ossim_uint32 arraySize)
+   {
+      setFromPoints(input, output, arraySize);
+   }
+   
+   /**
+    * Mapping 4 corners to an output 4 corners.
+    *
+    */
+   ossim2dTo2dMatrixTransform(const ossimDpt& in1, const ossimDpt& in2, const ossimDpt& in3, const ossimDpt& in4,
+                            const ossimDpt& out1, const ossimDpt& out2, const ossimDpt& out3, const ossimDpt& out4)
+   {
+      setFromPoints(in1, in2, in3, in4, out1, out2, out3, out4);
+   }
+   
+   /**
+    * Copy constructor
+    */
+   ossim2dTo2dMatrixTransform(const ossim2dTo2dMatrixTransform& src);
+   
+   /**
+    * Duplication method that duplicates this object
+    */
+   virtual ossimObject* dup()const{return new ossim2dTo2dMatrixTransform(*this);}
+   
+   /**
+    * Overloaded operator equal that allows for assignment.
+    *
+    * @param src the src data to copy into this object.  It will call the base classes
+    * equal operator.
+    */
+   const ossim2dTo2dMatrixTransform& operator =(const ossim2dTo2dMatrixTransform& src)
+   {
+      if(this == &src) return *this;
+      
+      ossim2dTo2dTransform::operator =(*this); // call base classes equal operator
+      std::copy(src.m_coefficientsXTerm, src.m_coefficientsXTerm+4, m_coefficientsXTerm);
+      std::copy(src.m_coefficientsYTerm, src.m_coefficientsYTerm+4, m_coefficientsYTerm);
+      std::copy(src.m_inverseCoefficientsXTerm, src.m_inverseCoefficientsXTerm+4, m_inverseCoefficientsXTerm);
+      std::copy(src.m_inverseCoefficientsYTerm, src.m_inverseCoefficientsYTerm+4, m_inverseCoefficientsYTerm);
+      
+      return *this;
+   }
+   
+   /**
+    * Mapping 4 corners to an output 4 corners.  Will use the ossimLeastSquareBilin class to solve 
+    * the bilinear coefficients that maps the given input points to the output points.
+    */
+   void setFromPoints(const ossimDpt& in1, const ossimDpt& in2, const ossimDpt& in3, const ossimDpt& in4,
+                      const ossimDpt& out1, const ossimDpt& out2, const ossimDpt& out3, const ossimDpt& out4);
+
+   /**
+    * Initialize the transform that best fits the input and output arrays.  
+    * If the input and output are well dispersed and are 4 points it should fit
+    * exactly.  Both arrays should be of equal number of points
+    *
+    * @param input the list of input points
+    * @param output the list of output points to transform the input to
+    * @param arraySize the number of points for the arrays.
+    */
+   void setFromPoints(const ossimDpt* input,
+                      const ossimDpt* output, 
+                      ossim_uint32 arraySize);
+ 
+   /**
+    * forward transform will transform an input point to the output.  
+    */
+   virtual void forward(const ossimDpt& input,
+                        ossimDpt& output) const
+   {
+      output.x = (m_coefficientsXTerm[0] + 
+                  m_coefficientsXTerm[1]*input.x + 
+                  m_coefficientsXTerm[2]*input.y + 
+                  m_coefficientsXTerm[3]*input.x*input.y);
+      output.y = (m_coefficientsYTerm[0] + 
+                  m_coefficientsYTerm[1]*input.x + 
+                  m_coefficientsYTerm[2]*input.y + 
+                  m_coefficientsYTerm[3]*input.x*input.y);
+   }
+   
+   /**
+    * forward transform will transform an input point to the output and modify the passed in point
+    * to the new value
+    */
+   virtual void forward(ossimDpt&  modify_this) const
+   {
+      double saveX = modify_this.x;
+      modify_this.x = (m_coefficientsXTerm[0] + 
+                       m_coefficientsXTerm[1]*modify_this.x + 
+                       m_coefficientsXTerm[2]*modify_this.y + 
+                       m_coefficientsXTerm[3]*modify_this.x*modify_this.y);
+      modify_this.y = (m_coefficientsYTerm[0] + 
+                       m_coefficientsYTerm[1]*saveX + 
+                       m_coefficientsYTerm[2]*modify_this.y + 
+                       m_coefficientsYTerm[3]*saveX*modify_this.y);
+   }
+   
+   /**
+    * Inverts the point back to the original input value.
+    */
+   virtual void inverse(const ossimDpt& input,
+                        ossimDpt&       output) const
+   {
+      output.x = (m_inverseCoefficientsXTerm[0] + 
+                  m_inverseCoefficientsXTerm[1]*input.x + 
+                  m_inverseCoefficientsXTerm[2]*input.y + 
+                  m_inverseCoefficientsXTerm[3]*input.x*input.y);
+      output.y = (m_inverseCoefficientsYTerm[0] + 
+                  m_inverseCoefficientsYTerm[1]*input.x + 
+                  m_inverseCoefficientsYTerm[2]*input.y + 
+                  m_inverseCoefficientsYTerm[3]*input.x*input.y);
+   }
+   
+   /**
+    * Inverts the point back to the original input value and modifies the passed in point
+    * to the new value.
+    */
+   virtual void inverse(ossimDpt&  modify_this) const
+   {
+      double saveX = modify_this.x;
+      modify_this.x = (m_inverseCoefficientsXTerm[0] + 
+                       m_inverseCoefficientsXTerm[1]*modify_this.x + 
+                       m_inverseCoefficientsXTerm[2]*modify_this.y + 
+                       m_inverseCoefficientsXTerm[3]*modify_this.x*modify_this.y);
+      modify_this.y = (m_inverseCoefficientsYTerm[0] + 
+                       m_inverseCoefficientsYTerm[1]*saveX + 
+                       m_inverseCoefficientsYTerm[2]*modify_this.y + 
+                       m_inverseCoefficientsYTerm[3]*saveX*modify_this.y);
+   }
+   
+   /**
+    * Saves the state of this object.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0)const;
+   
+   /**
+    * loads the state of this object from a keywordlist.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+   
+   /**
+    * prints the contents of this object.  Will also cal the base classes
+    * print method.
+    */
+   virtual std::ostream& print(std::ostream& out) const
+   {
+      ossim2dTo2dTransform::print(out);
+      out << "xTerm: " << m_coefficientsXTerm[0] << ", " << m_coefficientsXTerm[1] << ", "
+          << m_coefficientsXTerm[2] << ", " << m_coefficientsXTerm[3] << "\n";
+      out << "yTerm: " << m_coefficientsYTerm[0] << ", " << m_coefficientsYTerm[1] << ", "
+          << m_coefficientsYTerm[2] << ", " << m_coefficientsYTerm[3] << "\n";
+      
+      out << "xInverseTerm: " << m_inverseCoefficientsXTerm[0] << ", " << m_inverseCoefficientsXTerm[1] << ", "
+          << m_inverseCoefficientsXTerm[2] << ", " << m_inverseCoefficientsXTerm[3] << "\n";
+      out << "yInverseTerm: " << m_inverseCoefficientsYTerm[0] << ", " << m_inverseCoefficientsYTerm[1] << ", "
+          << m_inverseCoefficientsYTerm[2] << ", " << m_inverseCoefficientsYTerm[3] << "\n";
+      
+      return out;
+   }
+   
+protected:
+   ossim_float64 m_coefficientsXTerm[4]; // constant, linear x, linear y, cross xy
+   ossim_float64 m_coefficientsYTerm[4]; // constant, linear x, linear y, cross xy
+
+   ossim_float64 m_inverseCoefficientsXTerm[4]; // constant, linear x, linear y, cross xy
+   ossim_float64 m_inverseCoefficientsYTerm[4]; // constant, linear x, linear y, cross xy
+   TYPE_DATA;   
+};
+
+#endif 
diff --git a/include/ossim/base/ossim2dTo2dShiftTransform.h b/include/ossim/base/ossim2dTo2dShiftTransform.h
new file mode 100644
index 0000000..7c74694
--- /dev/null
+++ b/include/ossim/base/ossim2dTo2dShiftTransform.h
@@ -0,0 +1,126 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossim2dTo2dShiftTransform_HEADER
+#define ossim2dTo2dShiftTransform_HEADER
+#include <ossim/base/ossim2dTo2dTransform.h>
+
+class OSSIM_DLL ossim2dTo2dShiftTransform : public ossim2dTo2dTransform
+{
+public:
+   /**
+    * Constructor to initialize the shift transform
+    */
+   ossim2dTo2dShiftTransform(const ossimDpt& shift = ossimDpt(0.0,0.0))
+   :ossim2dTo2dTransform(),
+   m_shift(shift)
+   {}
+   
+   /**
+    * Copy constructor
+    */
+   ossim2dTo2dShiftTransform(const ossim2dTo2dShiftTransform& src)
+   :ossim2dTo2dTransform(src),
+   m_shift(src.m_shift)
+   {}
+   
+   /**
+    * Duplication method that duplicates this object
+    */
+   virtual ossimObject* dup()const{return new ossim2dTo2dShiftTransform(*this);}
+   
+   /**
+    * operator = allows one to copy the contents of the class through a common = 
+    * operator.  The = is passed to the derived class.
+    */
+   const ossim2dTo2dShiftTransform& operator =(const ossim2dTo2dShiftTransform& src)
+   {
+      if(this == &src) return *this;
+      
+      ossim2dTo2dTransform::operator =(*this); // call base classes equal operator
+      m_shift = src.m_shift;
+      
+      return *this;
+   }
+   
+   /**
+    * Apply the shift to the input.
+    *
+    * @param input The value to shift.
+    * @param output the shifted value.
+    */
+   virtual void forward(const ossimDpt& input,
+                        ossimDpt& output) const
+   {
+      output = input + m_shift;
+   }
+   /**
+    * Apply the shift to the input and put the result in the same variable
+    *
+    * @param modify_this The value to shift.  The result is placed back into this value.
+    */
+   virtual void forward(ossimDpt&  modify_this) const
+   {
+      modify_this.x += m_shift.x;
+      modify_this.y += m_shift.y;
+   }
+
+   /**
+    * Negate the shift to the input and put the result in output.
+    *
+    * @param input The value to apply the negated shift.
+    * @param output the shifted value.
+    */
+   virtual void inverse(const ossimDpt& input,
+                        ossimDpt& output) const
+   {
+      output = input - m_shift;
+   }
+   
+   /**
+    * Negate the shift operation and put the result in the same variable
+    *
+    * @param modify_this The value to shift.  The result is placed back into this value.
+    */
+   virtual void inverse(ossimDpt&  modify_this) const
+   {
+      modify_this.x -= m_shift.x;
+      modify_this.y -= m_shift.y;
+   }
+   /**
+    * Saves the state of this object.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0)const;
+   
+   /**
+    * loads the state of this object from a keywordlist.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+   
+   /**
+    * Print the contents of the class and pass to the derived class.
+    */
+   virtual std::ostream& print(std::ostream& out) const
+   {
+      ossim2dTo2dTransform::print(out);
+      
+      out << "shift: " << m_shift;
+      
+      return out;
+   }
+   
+protected:
+   virtual ~ossim2dTo2dShiftTransform(){}
+   
+   ossimDpt m_shift;
+   
+TYPE_DATA;
+};
+#endif
diff --git a/include/ossim/base/ossim2dTo2dTransform.h b/include/ossim/base/ossim2dTo2dTransform.h
new file mode 100644
index 0000000..33e1ae9
--- /dev/null
+++ b/include/ossim/base/ossim2dTo2dTransform.h
@@ -0,0 +1,64 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossim2dTo2dTransform.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossim2dTo2dTransform_HEADER
+#define ossim2dTo2dTransform_HEADER
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimDpt.h>
+
+class OSSIMDLLEXPORT ossim2dTo2dTransform : public ossimObject
+{
+public:
+   virtual void forward(const ossimDpt& input,
+                        ossimDpt& output) const=0;
+   
+   virtual void forward(ossimDpt&  modify_this) const;
+      
+   virtual void inverse(const ossimDpt& input,
+                        ossimDpt&       output) const;
+
+   virtual void inverse(ossimDpt&  modify_this) const;
+      
+   virtual const ossim2dTo2dTransform& operator=(
+      const ossim2dTo2dTransform& rhs);
+   
+   /*!
+    * Used by the inverse iterator.  This will give it a good initial value
+    * that is within the input transforms
+    */
+   virtual ossimDpt getOrigin() const;
+
+   virtual std::ostream& print(std::ostream& out) const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                   const char* prefix = 0)const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                  const char* prefix = 0);
+   
+   void setConvergenceThreshold(const double& new_threshold);
+   
+   void setMaxIterations(int new_max_iters);
+
+   void setDxDy(const ossimDpt& dxdy);
+
+protected:
+   ossim2dTo2dTransform();
+   virtual ~ossim2dTo2dTransform(){}
+   double theConvergenceThreshold;
+   int    theMaxIterations;
+
+   ossimDpt theDxDy;
+   
+TYPE_DATA      
+};
+
+#endif
diff --git a/include/ossim/base/ossim2dTo2dTransformFactory.h b/include/ossim/base/ossim2dTo2dTransformFactory.h
new file mode 100644
index 0000000..8694443
--- /dev/null
+++ b/include/ossim/base/ossim2dTo2dTransformFactory.h
@@ -0,0 +1,44 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class declaration of ossim2dTo2dTransformFactory.
+//
+//**************************************************************************************************
+// $Id$
+#ifndef ossim2dTo2dTransformFactory_HEADER
+#define ossim2dTo2dTransformFactory_HEADER
+#include <ossim/base/ossim2dTo2dTransformFactoryBase.h>
+
+class ossim2dTo2dTransform;
+class OSSIM_DLL ossim2dTo2dTransformFactory : public ossim2dTo2dTransformFactoryBase
+{
+public:
+   ossim2dTo2dTransformFactory(){}
+   static ossim2dTo2dTransformFactory* instance();
+   
+   /**
+    * Take a transform type name.
+    */
+   virtual ossim2dTo2dTransform* createTransform(const ossimString& name)const;
+   
+   /**
+    * Take a keywordlist.
+    */
+   virtual ossim2dTo2dTransform* createTransform(const ossimKeywordlist& kwl,
+                                                 const char* prefix)const;
+   
+   /*!
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+  
+protected:
+   static ossim2dTo2dTransformFactory* m_instance;
+};
+
+#endif
diff --git a/include/ossim/base/ossim2dTo2dTransformFactoryBase.h b/include/ossim/base/ossim2dTo2dTransformFactoryBase.h
new file mode 100644
index 0000000..24a8d51
--- /dev/null
+++ b/include/ossim/base/ossim2dTo2dTransformFactoryBase.h
@@ -0,0 +1,49 @@
+#ifndef ossim2dTo2dTransformFactoryBase_HEADER
+#define ossim2dTo2dTransformFactoryBase_HEADER
+#include <ossim/base/ossimObjectFactory.h>
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class declaration of ossim2dTo2dTransformFactoryBase.
+//
+//**************************************************************************************************
+// $Id$
+#include <ossim/base/ossim2dTo2dTransform.h>
+
+class OSSIM_DLL ossim2dTo2dTransformFactoryBase : public ossimObjectFactory
+{
+public:
+   
+   /**
+    * Creates an object given a type name.
+    */
+   virtual ossimObject* createObject(const ossimString& typeName)const
+   {
+      return createTransform(typeName);
+   }
+   
+   /**
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const
+   {
+      return createTransform(kwl, prefix);
+   }
+   
+   /**
+    * Take a transform type name.
+    */
+   virtual ossim2dTo2dTransform* createTransform(const ossimString& name)const=0;
+   
+   /**
+    * Take a keywordlist.
+    */
+   virtual ossim2dTo2dTransform* createTransform(const ossimKeywordlist& kwl,
+                                                 const char* prefix)const=0;
+protected:
+};
+#endif
diff --git a/include/ossim/base/ossim2dTo2dTransformRegistry.h b/include/ossim/base/ossim2dTo2dTransformRegistry.h
new file mode 100644
index 0000000..9bf06de
--- /dev/null
+++ b/include/ossim/base/ossim2dTo2dTransformRegistry.h
@@ -0,0 +1,84 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class declaration of ossim2dTo2dTransformRegistry.
+//
+//**************************************************************************************************
+// $Id$
+#ifndef ossim2dTo2dTransformRegistry_HEADER
+#define ossim2dTo2dTransformRegistry_HEADER
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossim2dTo2dTransformFactoryBase.h>
+#include <ossim/base/ossim2dTo2dTransform.h>
+#include <vector>
+#include <ossim/base/ossimFactoryListInterface.h>
+
+class OSSIM_DLL ossim2dTo2dTransformRegistry : public ossimObjectFactory,
+                                               public ossimFactoryListInterface<ossim2dTo2dTransformFactoryBase,
+                                                                                ossim2dTo2dTransform>
+{
+public:
+   virtual ~ossim2dTo2dTransformRegistry(){}
+   static ossim2dTo2dTransformRegistry* instance();
+   
+   /*!
+    * Creates an object given a type name.
+    */
+   virtual ossimObject* createObject(const ossimString& typeName)const
+   {
+      return createObjectFromRegistry(typeName);
+   }
+   
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const
+   {
+      return createObjectFromRegistry(kwl, prefix);
+   }
+   /*!
+    * Creates an object given a type name.
+    */
+   virtual ossim2dTo2dTransform* createTransform(const ossimString& typeName)const
+   {
+      return createNativeObjectFromRegistry(typeName);
+   }
+   
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossim2dTo2dTransform* createTransform(const ossimKeywordlist& kwl,
+                                                 const char* prefix=0)const
+   {
+      return createNativeObjectFromRegistry(kwl, prefix);
+   }
+   
+   /*!
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const
+   {
+      getAllTypeNamesFromRegistry(typeList);
+   }
+   
+protected:
+   ossim2dTo2dTransformRegistry()
+   :ossimObjectFactory()
+   {}
+   
+   ossim2dTo2dTransformRegistry( const ossim2dTo2dTransformRegistry& rhs )
+   :ossimObjectFactory(rhs)
+   {}
+   void operator =(const ossim2dTo2dTransformRegistry&){}
+   static ossim2dTo2dTransformRegistry* m_instance;
+   
+   TYPE_DATA
+};
+#endif
diff --git a/ossim/include/ossim/base/ossimActiveEdgeTable.h b/include/ossim/base/ossimActiveEdgeTable.h
similarity index 100%
rename from ossim/include/ossim/base/ossimActiveEdgeTable.h
rename to include/ossim/base/ossimActiveEdgeTable.h
diff --git a/ossim/include/ossim/base/ossimAdjSolutionAttributes.h b/include/ossim/base/ossimAdjSolutionAttributes.h
similarity index 100%
rename from ossim/include/ossim/base/ossimAdjSolutionAttributes.h
rename to include/ossim/base/ossimAdjSolutionAttributes.h
diff --git a/ossim/include/ossim/base/ossimAdjustableParameterInfo.h b/include/ossim/base/ossimAdjustableParameterInfo.h
similarity index 100%
rename from ossim/include/ossim/base/ossimAdjustableParameterInfo.h
rename to include/ossim/base/ossimAdjustableParameterInfo.h
diff --git a/ossim/include/ossim/base/ossimAdjustableParameterInterface.h b/include/ossim/base/ossimAdjustableParameterInterface.h
similarity index 100%
rename from ossim/include/ossim/base/ossimAdjustableParameterInterface.h
rename to include/ossim/base/ossimAdjustableParameterInterface.h
diff --git a/ossim/include/ossim/base/ossimAdjustmentExecutive.h b/include/ossim/base/ossimAdjustmentExecutive.h
similarity index 100%
rename from ossim/include/ossim/base/ossimAdjustmentExecutive.h
rename to include/ossim/base/ossimAdjustmentExecutive.h
diff --git a/ossim/include/ossim/base/ossimAdjustmentInfo.h b/include/ossim/base/ossimAdjustmentInfo.h
similarity index 100%
rename from ossim/include/ossim/base/ossimAdjustmentInfo.h
rename to include/ossim/base/ossimAdjustmentInfo.h
diff --git a/ossim/include/ossim/base/ossimAffineTransform.h b/include/ossim/base/ossimAffineTransform.h
similarity index 100%
rename from ossim/include/ossim/base/ossimAffineTransform.h
rename to include/ossim/base/ossimAffineTransform.h
diff --git a/ossim/include/ossim/base/ossimApplicationUsage.h b/include/ossim/base/ossimApplicationUsage.h
similarity index 100%
rename from ossim/include/ossim/base/ossimApplicationUsage.h
rename to include/ossim/base/ossimApplicationUsage.h
diff --git a/include/ossim/base/ossimArgumentParser.h b/include/ossim/base/ossimArgumentParser.h
new file mode 100644
index 0000000..ccc5c68
--- /dev/null
+++ b/include/ossim/base/ossimArgumentParser.h
@@ -0,0 +1,249 @@
+//-------------------------------------------------------------------------
+//
+// This code was taken from Open Scene Graph and incorporated from into
+// OSSIM.
+//
+//-------------------------------------------------------------------------
+// $Id: ossimArgumentParser.h 22491 2013-11-26 18:17:29Z dburken $
+#ifndef ossimArgumentParser_HEADER
+#define ossimArgumentParser_HEADER 1
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <map>
+#include <string>
+#include <iosfwd>
+
+class ossimApplicationUsage;
+
+class OSSIMDLLEXPORT ossimArgumentParser
+{
+public:
+   
+   class ossimParameter
+   {
+   public:
+      enum ossimParameterType
+      {
+         OSSIM_FLOAT_PARAMETER,
+         OSSIM_DOUBLE_PARAMETER,
+         OSSIM_INT_PARAMETER,
+         OSSIM_UNSIGNED_INT_PARAMETER,
+         OSSIM_STRING_PARAMETER,
+      };
+      
+      union ossimValueUnion
+      {
+         float*          theFloat;
+         double*         theDouble;
+         int*            theInt;
+         unsigned int*   theUint;
+         std::string*    theString;
+      };
+      
+      ossimParameter(float& value)
+      {
+         theType = OSSIM_FLOAT_PARAMETER; theValue.theFloat = &value;
+      }
+      
+      ossimParameter(double& value)
+      {
+         theType = OSSIM_DOUBLE_PARAMETER; theValue.theDouble = &value;
+      }
+      
+      ossimParameter(int& value)
+      {
+         theType = OSSIM_INT_PARAMETER; theValue.theInt = &value;
+      }
+      
+      ossimParameter(unsigned int& value)
+      {
+         theType = OSSIM_UNSIGNED_INT_PARAMETER; theValue.theUint = &value;
+      }
+      
+      ossimParameter(std::string& value)
+      {
+         theType = OSSIM_STRING_PARAMETER; theValue.theString = &value;
+      }
+      
+      ossimParameter(ossimString& value)
+      {
+         theType = OSSIM_STRING_PARAMETER; theValue.theString =
+                                              &(value.string());
+      }
+      
+      bool valid(const char* str) const;
+      bool assign(const char* str);
+
+   protected:
+      
+      ossimParameterType   theType;
+      ossimValueUnion      theValue;
+   };
+   
+   /** return return true if specified string is an option in the form of
+    * -option or --option .
+    */
+   static bool isOption(const char* str);
+   
+   /** return return true if string is any other string apart from an option.*/
+   static bool isString(const char* str);
+   
+   /** return return true if specified parameter is an number.*/
+   static bool isNumber(const char* str);
+   
+public:
+   
+   ossimArgumentParser(int* argc,char **argv);
+   ossimArgumentParser(const ossimString& commandLine);
+
+   ~ossimArgumentParser();
+
+   /** @brief Initialize from command arguments. */
+   void initialize(int* argc, const char **argv); 
+   
+   void setApplicationUsage(ossimApplicationUsage* usage) { theUsage = usage; }
+   ossimApplicationUsage* getApplicationUsage() { return theUsage; }
+   const ossimApplicationUsage* getApplicationUsage() const { return theUsage; }
+   
+   /** return the argument count.*/
+   int& argc() { return *theArgc; }
+   
+   /** return the argument array.*/
+   char** argv() { return theArgv; }
+   
+   /** return char* argument at specificed position.*/
+   char* operator [] (int pos) { return theArgv[pos]; }
+   
+   /** return const char* argument at specificed position.*/
+   const char* operator [] (int pos) const { return theArgv[pos]; }
+   
+   /** return the application name, as specified by argv[0] */
+   std::string getApplicationName() const;
+   
+   /** return the position of an occurence of a string in the argument list.
+    * return -1 when no string is found.*/      
+   int find(const std::string& str) const;
+   
+   /** return return true if specified parameter is an option in the form of -option or --option .*/
+   bool isOption(int pos) const;
+   
+   /** return return true if specified parameter is an string, which can be any other string apart from an option.*/
+   bool isString(int pos) const;
+   
+   /** return return true if specified parameter is an number.*/
+   bool isNumber(int pos) const;
+   
+   bool containsOptions() const;
+   
+   /** remove one or more arguments from the argv argument list, and decrement the argc respectively.*/
+   void remove(int pos,int num=1);
+   
+   /** Inserts string into the argv argument list, and increment the argc respectively.
+    * If string contains spaces, it will be split up into component simple strings. */
+   void insert(int pos, const ossimString& arg);
+
+   /** return true if specified argument matches string.*/        
+   bool match(int pos, const std::string& str) const;
+   
+   /**
+    * search for an occurance of a string in the argument list, on sucess
+    * remove that occurance from the list and return true, otherwise
+    * return false.
+    */
+   bool read(const std::string& str);
+   bool read(const std::string& str, ossimParameter value1);
+   bool read(const std::string& str, ossimParameter value1,
+             ossimParameter value2);
+   bool read(const std::string& str, ossimParameter value1,
+             ossimParameter value2, ossimParameter value3);
+   bool read(const std::string& str, ossimParameter value1,
+             ossimParameter value2, ossimParameter value3,
+             ossimParameter value4);
+   bool read(const std::string& str, ossimParameter value1,
+             ossimParameter value2, ossimParameter value3,
+             ossimParameter value4, ossimParameter value5);
+   bool read(const std::string& str, ossimParameter value1,
+             ossimParameter value2, ossimParameter value3,
+             ossimParameter value4, ossimParameter value5,
+             ossimParameter value6);
+   
+   /**
+    * Alternate form for reading variable length arguments (must be comma-separated), e.g.,
+    *
+    *    --input_files file1, file2, file3,file4 next_arg
+    *
+    * Note that spaces between arguments are optional. The next_arg entry will not be considered
+    * part of the list since there's no comma separator and will be left on the argument array.
+    * @param str The option string (with "-" or "--")
+    * @param param_list Vector to contain results as strings. Always cleared before populating
+    * @return True if option found (param_list may be empty f no args followed).
+    */
+   bool read(const std::string& str, std::vector<ossimString>& param_list);
+
+   /**
+    * @return The number of parameters of type value associated with specified
+    * option, or -1 if option not found
+    */
+   int numberOfParams(const std::string& str,
+                      const ossimParameter value) const;
+   
+   /**
+    * if the argument value at the position pos matches specified string, and
+    * subsequent paramters are also matched then set the paramter values and
+    * remove the from the list of arguments.
+    */
+   bool read(int pos, const std::string& str);
+   bool read(int pos, const std::string& str, ossimParameter value1);
+   bool read(int pos, const std::string& str, ossimParameter value1,
+             ossimParameter value2);
+   bool read(int pos, const std::string& str, ossimParameter value1,
+             ossimParameter value2, ossimParameter value3);
+   bool read(int pos, const std::string& str, ossimParameter value1,
+             ossimParameter value2, ossimParameter value3,
+             ossimParameter value4);
+   
+   
+   enum ossimErrorSeverity
+   {
+      OSSIM_BENIGN = 0,
+      OSSIM_CRITICAL = 1
+   };
+   
+   typedef std::map<std::string,ossimErrorSeverity> ossimErrorMessageMap;
+   
+   /**
+    * @return The error flag, true if an error has occured when
+    * reading arguments.
+    */
+   bool errors(ossimErrorSeverity severity=OSSIM_BENIGN) const;
+   
+   /** report an error message by adding to the ErrorMessageMap.*/
+   void reportError(const std::string& message,
+                    ossimErrorSeverity severity=OSSIM_CRITICAL);
+   
+   /** for each remaining option report it as an unrecongnized.*/
+   void reportRemainingOptionsAsUnrecognized(
+      ossimErrorSeverity severity=OSSIM_BENIGN);
+   
+   /** @return The error message, if any has occured.*/
+   ossimErrorMessageMap& getErrorMessageMap();
+   
+   /** @return The error message, if any has occured.*/
+   const ossimErrorMessageMap& getErrorMessageMap() const;
+   
+   /** write out error messages at an above specified .*/
+   void writeErrorMessages(std::ostream& output,
+                           ossimErrorSeverity sevrity=OSSIM_BENIGN);
+   
+   
+protected:
+   
+   int*                     theArgc;
+   char**                   theArgv;
+   ossimErrorMessageMap     theErrorMessageMap;
+   ossimApplicationUsage*   theUsage;
+   bool                     theMemAllocated;
+        
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimAxes.h b/include/ossim/base/ossimAxes.h
similarity index 100%
rename from ossim/include/ossim/base/ossimAxes.h
rename to include/ossim/base/ossimAxes.h
diff --git a/ossim/include/ossim/base/ossimBaseObjectFactory.h b/include/ossim/base/ossimBaseObjectFactory.h
similarity index 100%
rename from ossim/include/ossim/base/ossimBaseObjectFactory.h
rename to include/ossim/base/ossimBaseObjectFactory.h
diff --git a/ossim/include/ossim/base/ossimBilSplitter.h b/include/ossim/base/ossimBilSplitter.h
similarity index 100%
rename from ossim/include/ossim/base/ossimBilSplitter.h
rename to include/ossim/base/ossimBilSplitter.h
diff --git a/ossim/include/ossim/base/ossimBinaryDataProperty.h b/include/ossim/base/ossimBinaryDataProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimBinaryDataProperty.h
rename to include/ossim/base/ossimBinaryDataProperty.h
diff --git a/ossim/include/ossim/base/ossimBooleanProperty.h b/include/ossim/base/ossimBooleanProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimBooleanProperty.h
rename to include/ossim/base/ossimBooleanProperty.h
diff --git a/ossim/include/ossim/base/ossimByteStreamBuffer.h b/include/ossim/base/ossimByteStreamBuffer.h
similarity index 100%
rename from ossim/include/ossim/base/ossimByteStreamBuffer.h
rename to include/ossim/base/ossimByteStreamBuffer.h
diff --git a/include/ossim/base/ossimCallback1.h b/include/ossim/base/ossimCallback1.h
new file mode 100644
index 0000000..3375676
--- /dev/null
+++ b/include/ossim/base/ossimCallback1.h
@@ -0,0 +1,81 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimCallback1wRet.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Simple templated callback class that takes a single parameter(argument) "P1"
+// with void return.
+//
+// See link for more detail description:
+// http://www.tutok.sk/fastgl/callback.html
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimCallback1_HEADER
+#define ossimCallback1_HEADER 1
+
+/**
+ * @class ossimCallback1
+ *
+ * Usage example, note template params can be anything:
+ *
+ * Caller interface to register callback:
+ *
+ * @code
+ * void registerCallback(ossimCallback1<const ossimFilename&>* cb);
+ * @endcode
+ *
+ * Callee creation of call back mechanism:
+ *
+ * @code
+ * class ProcessFileCB: public ossimCallback1<const ossimFilename&>
+ * {
+ * public:
+ *    ProcessFileCB(
+ *       ossimImageElevationDatabase* obj,
+ *       void (ossimImageElevationDatabase::*func)(const ossimFilename&))
+ *       :
+ *       m_obj(obj),
+ *       m_func(func)
+ *    {}
+ *       
+ *    virtual void operator()(const ossimFilename& file) const
+ *    {
+ *       ( m_obj->*m_func)(file);
+ *    }
+ * 
+ * private:
+ *    ossimImageElevationDatabase* m_obj;
+ *    void (ossimImageElevationDatabase::*m_func)(const ossimFilename& file);
+ * };
+ * @endcode
+ *
+ * Making/registering a callback.
+ *
+ * @code
+ * ossimFileWalker* fw = new ossimFileWalker();
+ *
+ * ossimCallback1wRet<const ossimFilename&>* cb =
+ *    new ProcessFileCB(this, &ossimImageElevationDatabase::processFile);
+ *
+ * fw->registerProcessFileCallback(cb);
+ *
+ * @endcode
+ */
+template <class P1> class ossimCallback1
+{
+public:
+   ossimCallback1(){}
+   virtual ~ossimCallback1(){}
+   virtual void operator()(P1 p1) const = 0;
+};
+
+#endif /* #ifndef ossimCallback1_HEADER */
diff --git a/include/ossim/base/ossimCallback1wRet.h b/include/ossim/base/ossimCallback1wRet.h
new file mode 100644
index 0000000..4599662
--- /dev/null
+++ b/include/ossim/base/ossimCallback1wRet.h
@@ -0,0 +1,81 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimCallback1wRet.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Simple templated callback class that takes a single parameter(argument) "P1"
+// and has a return "RT".
+//
+// See link for more detail description:
+// http://www.tutok.sk/fastgl/callback.html
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimCallback1wRet_HEADER
+#define ossimCallback1wRet_HEADER 1
+
+/**
+ * @class ossimCallback1wRet
+ *
+ * Usage example, note template params can be anything:
+ *
+ * Caller interface to register callback:
+ *
+ * @code
+ * void registerCallback(ossimCallback1wRet<const ossimFilename&, bool>* cb);
+ * @endcode
+ *
+ * Callee creation of call back mechanism:
+ *
+ * @code
+ * class ProcessFileCB: public ossimCallback1wRet<const ossimFilename&, bool>
+ * {
+ * public:
+ *    ProcessFileCB(
+ *       ossimImageElevationDatabase* obj,
+ *       bool (ossimImageElevationDatabase::*func)(const ossimFilename&))
+ *       :
+ *       m_obj(obj),
+ *       m_func(func)
+ *    {}
+ *       
+ *    virtual bool operator()(const ossimFilename& file) const
+ *    {
+ *       return ( m_obj->*m_func)(file);
+ *    }
+ * 
+ * private:
+ *    ossimImageElevationDatabase* m_obj;
+ *    bool (ossimImageElevationDatabase::*m_func)(const ossimFilename& file);
+ * };
+ * @endcode
+ *
+ * Making/registering a callback.
+ *
+ * @code
+ * ossimFileWalker* fw = new ossimFileWalker();
+ *
+ * ossimCallback1wRet<const ossimFilename&, bool>* cb =
+ *    new ProcessFileCB(this, &ossimImageElevationDatabase::processFile);
+ *
+ * fw->registerProcessFileCallback(cb);
+ *
+ * @endcode
+ */
+template <class P1, class RT> class ossimCallback1wRet
+{
+public:
+   ossimCallback1wRet(){}
+   virtual ~ossimCallback1wRet(){}
+   virtual RT operator()(P1 p1) const = 0;
+};
+
+#endif /* #ifndef ossimCallback1wRet_HEADER */
diff --git a/include/ossim/base/ossimCallback2wRet.h b/include/ossim/base/ossimCallback2wRet.h
new file mode 100644
index 0000000..cd03bab
--- /dev/null
+++ b/include/ossim/base/ossimCallback2wRet.h
@@ -0,0 +1,82 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimCallback2wRet.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Simple templated callback class that takes a two parameters(arguments) "P1"
+// and has a return "RT".
+//
+// See link for more detail description:
+// http://www.tutok.sk/fastgl/callback.html
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimCallback2wRet_HEADER
+#define ossimCallback2wRet_HEADER 1
+
+/**
+ * @class ossimCallback2wRet
+ *
+ * Usage example, note template params can be anything:
+ *
+ * Caller interface to register callback:
+ *
+ * @code
+ * void registerCallback(ossimCallback2wRet<const ossimFilename&, bool&, bool>* cb);
+ * @endcode
+ *
+ * Callee creation of call back mechanism:
+ *
+ * @code
+ * class ProcessFileCB: public ossimCallback2wRet<const ossimFilename&, bool&, bool>
+ * {
+ * public:
+ *    ProcessFileCB(
+ *       ossimImageElevationDatabase* obj,
+ *       bool (ossimImageElevationDatabase::*func)(const ossimFilename&, bool&))
+ *       :
+ *       m_obj(obj),
+ *       m_func(func)
+ *    {}
+ *       
+ *    virtual bool operator()(const ossimFilename& file, bool& flag) const
+ *    {
+ *       return ( m_obj->*m_func)(file, flag);
+ *    }
+ * 
+ * private:
+ *    ossimImageElevationDatabase* m_obj;
+ *    bool (ossimImageElevationDatabase::*m_func)(const ossimFilename& file, bool& flag);
+ * };
+ * @endcode
+ *
+ * Making/registering a callback.
+ *
+ * @code
+ * ossimFileWalker* fw = new ossimFileWalker();
+ *
+ * ossimCallback2wRet<const ossimFilename&, bool&, bool>* cb =
+ *    new ProcessFileCB(this, &ossimImageElevationDatabase::processFile);
+ *
+ * fw->registerProcessFileCallback(cb);
+ *
+ * @endcode
+ */
+
+template <class P1, class P2, class RT> class ossimCallback2wRet
+{
+public:
+   ossimCallback2wRet(){}
+   virtual ~ossimCallback2wRet(){}
+   virtual RT operator()(P1 p1, P2 p2) const = 0;
+};
+
+#endif /* #ifndef ossimCallback2wRet_HEADER */
diff --git a/ossim/include/ossim/base/ossimCmyVector.h b/include/ossim/base/ossimCmyVector.h
similarity index 100%
rename from ossim/include/ossim/base/ossimCmyVector.h
rename to include/ossim/base/ossimCmyVector.h
diff --git a/ossim/include/ossim/base/ossimColorProperty.h b/include/ossim/base/ossimColorProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimColorProperty.h
rename to include/ossim/base/ossimColorProperty.h
diff --git a/include/ossim/base/ossimColumnVector3d.h b/include/ossim/base/ossimColumnVector3d.h
new file mode 100644
index 0000000..a4e30ee
--- /dev/null
+++ b/include/ossim/base/ossimColumnVector3d.h
@@ -0,0 +1,288 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+// Description: This is a 3-D vector without the homogeneous
+//              coordinate.
+//
+//*******************************************************************
+//  $Id: ossimColumnVector3d.h 20074 2011-09-08 16:16:27Z gpotts $
+#ifndef ossimColumnVector3d_HEADER
+#define ossimColumnVector3d_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <float.h> // for FLT_EPSILON
+#include <iomanip>
+#include <iostream>
+#include <cmath>
+using namespace std;
+
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimString.h>
+
+class OSSIMDLLEXPORT ossimColumnVector3d
+{
+public:
+   ossimColumnVector3d()
+      {
+         data[0]=0;
+         data[1]=0;
+         data[2]=0;
+      }
+
+   ossimColumnVector3d(double x, double y, double z=0)
+      {
+         data[0]=x;
+         data[1]=y;
+         data[2]=z;
+      }
+
+   // Default copy-constructor is perfect
+   // ossimColumnVector3d(const ossimColumnVector3d &rhs) = default;
+   
+   explicit ossimColumnVector3d(const NEWMAT::ColumnVector& rhs)
+   {
+      if ( (rhs.Ncols() == 1) && (rhs.Nrows() > 2) )
+      {
+         data[0] = rhs[0];
+         data[1] = rhs[1];
+         data[2] = rhs[2];
+      }
+      else
+      {
+         data[0]=0;
+         data[1]=0;
+         data[2]=0;
+      }
+   }
+
+   const ossimColumnVector3d& operator=(const NEWMAT::ColumnVector& rhs)
+   {
+      if ( (rhs.Ncols() == 1) && (rhs.Nrows() == 3) )
+      {
+         data[0] = rhs[0];
+         data[1] = rhs[1];
+         data[2] = rhs[2];
+      }
+      return *this;
+   }
+
+   friend ostream& operator <<(ostream& out, const ossimColumnVector3d& v)
+      {
+         return out << setiosflags(ios::fixed) << setprecision(15)
+                    << v[0] << " " << v[1] <<" "
+                    << v[2];
+      }
+
+   friend ossimColumnVector3d operator*(double scalar,
+					const ossimColumnVector3d &v)
+      {
+         return ossimColumnVector3d(v.data[0]*scalar,
+                                    v.data[1]*scalar,
+                                    v.data[2]*scalar);
+      }
+
+   /*!
+    *  Multiplies column vector times matrix.
+    *  Note:
+    *  If "lhs" is not a 3x3 that's an error and a blank column vector
+    *  is returned.
+    */
+   friend ossimColumnVector3d operator*(const NEWMAT::Matrix& lhs,
+                                        const ossimColumnVector3d& rhs)
+   {
+      if ((lhs.Ncols() == 3) && (lhs.Nrows() == 3))
+      {
+         return ossimColumnVector3d( (lhs[0][0]*rhs[0] + lhs[0][1]*rhs[1] + lhs[0][2]*rhs[2]),
+                                     (lhs[1][0]*rhs[0] + lhs[1][1]*rhs[1] + lhs[1][2]*rhs[2]),
+                                     (lhs[2][0]*rhs[0] + lhs[2][1]*rhs[1] + lhs[2][2]*rhs[2]));
+      }
+      else if((lhs.Ncols() == 4) && (lhs.Nrows() == 4))
+      {
+         return ossimColumnVector3d( (lhs[0][0]*rhs[0] + lhs[0][1]*rhs[1] + lhs[0][2]*rhs[2] + lhs[0][3]) ,
+                                     (lhs[1][0]*rhs[0] + lhs[1][1]*rhs[1] + lhs[1][2]*rhs[2] + lhs[1][3]) ,
+                                     (lhs[2][0]*rhs[0] + lhs[2][1]*rhs[1] + lhs[2][2]*rhs[2] + lhs[2][3]));
+      }
+      ossimNotify(ossimNotifyLevel_WARN) << "Multiplying a 3 row column vector by an invalid matrix" << std::endl;
+      return rhs;
+   }
+
+   double& operator [](int index)
+      {
+         return data[index];
+      }
+
+   const double& operator [](int index)const
+      {
+         return data[index];
+      }
+
+   ossimColumnVector3d operator*(double scalar)const
+      {
+         return ossimColumnVector3d(data[0]*scalar,
+                                    data[1]*scalar,
+                                    data[2]*scalar);
+      }
+
+   ossimColumnVector3d operator +(const ossimColumnVector3d &rhs)const
+      {
+         return ossimColumnVector3d( data[0]+rhs[0],
+                                     data[1]+rhs[1],
+                                     data[2]+rhs[2]);
+      }
+
+   const ossimColumnVector3d& operator +=(const ossimColumnVector3d &rhs)
+      {
+         data[0] += rhs[0];
+         data[1] += rhs[1];
+         data[2] += rhs[2];
+
+         return *this;
+      }
+
+   ossimColumnVector3d operator - ()const
+      {
+         return ossimColumnVector3d(-data[0],
+                                    -data[1],
+                                    -data[2]);
+      }
+
+   ossimColumnVector3d operator /(double scalar)const
+      {
+         return ossimColumnVector3d( data[0]/scalar,
+                                     data[1]/scalar,
+                                     data[2]/scalar);
+      }
+
+   const ossimColumnVector3d& operator /=(double scalar)
+      {
+         data[0]/=scalar;
+         data[1]/=scalar;
+         data[2]/=scalar;
+
+         return *this;
+      }
+
+   ossimColumnVector3d operator -(const ossimColumnVector3d &rhs)const
+      {
+         return ossimColumnVector3d( data[0]-rhs[0],
+                                     data[1]-rhs[1],
+                                     data[2]-rhs[2]);
+      }
+
+   const ossimColumnVector3d& operator -=(const ossimColumnVector3d &rhs)
+      {
+         data[0] -= rhs[0];
+         data[1] -= rhs[1];
+         data[2] -= rhs[2];
+
+         return *this;
+      }
+
+   bool operator ==(const ossimColumnVector3d &rhs) const
+      { return ((fabs(data[0] - rhs[0]) <= FLT_EPSILON) &&
+		(fabs(data[1] - rhs[1]) <= FLT_EPSILON) &&
+		(fabs(data[2] - rhs[2]) <= FLT_EPSILON));
+      }
+
+   bool operator !=(const ossimColumnVector3d &rhs) const
+      { return !(*this == rhs); }
+
+   double magnitude()const
+      {
+         return sqrt(data[0]*data[0] +
+                     data[1]*data[1] +
+                     data[2]*data[2]);
+      }
+   inline double norm2()const //!speedup
+      {
+          return data[0]*data[0] +
+                 data[1]*data[1] +
+                 data[2]*data[2];
+      }
+   double dot(const ossimColumnVector3d &rhs) const
+      {
+         return (data[0]*rhs[0]+
+                 data[1]*rhs[1]+
+                 data[2]*rhs[2]);
+      }
+
+   ossimColumnVector3d unit() const
+   {
+      double mag = magnitude();
+
+      if(fabs(mag) > FLT_EPSILON)
+      {
+         mag = 1.0/mag;
+         return (*this *mag);
+      }
+
+      return *this;
+   }
+
+   ossimColumnVector3d cross(const ossimColumnVector3d &rhs) const
+      {
+         return ossimColumnVector3d( data[1]*rhs[2] - data[2]*rhs[1],
+                               data[2]*rhs[0] - data[0]*rhs[2],
+                               data[0]*rhs[1] - data[1]*rhs[0]);
+      }
+
+   const ossimColumnVector3d& xAligned()
+      {
+         data[0] = 1;
+         data[1] = 0;
+         data[2] = 0;
+
+         return *this;
+      }
+   const ossimColumnVector3d& yAligned()//
+      {
+         data[0] = 0;
+         data[1] = 1;
+         data[2] = 0;
+
+         return *this;
+      }
+   const ossimColumnVector3d& zAligned() //
+      {
+         data[0] = 0;
+         data[1] = 0;
+         data[2] = 1;
+
+         return *this;
+      }
+
+   /**
+    * @brief To string method.
+    * 
+    * @param precision Output floating point precision.
+    * 
+    * @return ossimString representing point.
+    *
+    * Output format:
+    * ( 0.0000000,  0.0000000,  0.00000000 )
+    *   -----x----  -----y----  ------z----
+    */
+   ossimString toString(ossim_uint32 precision=15) const;
+
+   /**
+    * @brief Initializes this point from string.
+    *
+    * Expected format:
+    * 
+    * ( 0.0000000,  0.0000000,  0.00000000 )
+    *   -----x----  -----y----  ------z----
+    *
+    * @param s String to initialize from.
+    */
+   void toPoint(const std::string& s);
+   
+private:
+   double data[3];
+};
+
+
+
+#endif
diff --git a/ossim/include/ossim/base/ossimColumnVector4d.h b/include/ossim/base/ossimColumnVector4d.h
similarity index 100%
rename from ossim/include/ossim/base/ossimColumnVector4d.h
rename to include/ossim/base/ossimColumnVector4d.h
diff --git a/include/ossim/base/ossimCommon.h b/include/ossim/base/ossimCommon.h
new file mode 100644
index 0000000..01b2266
--- /dev/null
+++ b/include/ossim/base/ossimCommon.h
@@ -0,0 +1,689 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts, with some additions and modifciations by
+// Patrick Melody
+//
+// Description: Common file for utility functions.
+//
+//*************************************************************************
+// $Id: ossimCommon.h 23131 2015-02-06 13:35:55Z gpotts $
+#ifndef ossimCommon_HEADER
+#define ossimCommon_HEADER 1
+
+
+// XXX nullify these for now, but eventually replace with a #include 
+#define ossimREQUIRE(expr) 
+#define ossimENSURE(expr)  
+#define ossimCHECK(expr) 
+#define ossimSTATIC_CHECK(expr,msg)  
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <cfloat>
+#include <cmath>
+#include <istream>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <iostream>
+#include <algorithm>
+#include <iterator>
+
+class ossimIpt;
+class ossimIrect;
+class ossimDpt;
+class ossimGpt;
+namespace NEWMAT
+{
+   class Matrix;
+}
+
+namespace ossim
+{
+   OSSIM_DLL std::istream& skipws(std::istream& in);
+   OSSIM_DLL bool isWhiteSpace(int c);
+    template<class T>
+/*     inline bool almostEqual(T x, T y, T tolerence = std::numeric_limits<T>::epsilon()) */
+/*         // are x and y within tolerance distance of each other? */
+/*         { return std::abs(x - y) <= tolerence; } */
+    inline bool almostEqual(T x, T y, T tolerance = FLT_EPSILON)
+        // are x and y within tolerance distance of each other?
+        { return std::fabs(x - y) <= tolerance; }
+
+    template <class T>
+    inline bool inInterval(T x, T a, T b)
+	// is x in the closed interval [a,b]?
+	{ return x >= a && x <= b; }
+
+    template <class T>
+    inline bool inOpenInterval(T x, T a, T b)
+	// is x in the open interval (a,b)?
+	{ return x > a && x < b; }
+
+   
+    /**
+     * isnan Test for floating point Not A Number (NAN) value.
+     * This should be used test for nan.
+     * DO NOT USE operator==.  Like "if (height == ossim::nan())"
+     *
+     * @return true if nan, false if not.
+     *
+     * @see nan()
+     */
+#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
+    inline bool isnan(const float& v) { return _isnan(v); }
+    inline bool isnan(const double& v) { return _isnan(v); }
+#elif defined(sun) || defined(__sun)
+#    if defined(__SVR4) || defined(__svr4__)
+/* Solaris */
+    inline bool isnan(const float& v)  { return ( ::isnan(v) ); }
+    inline bool isnan(const double& v) { return ( ::isnan(v) ); }
+#    else
+/* SunOS */
+    inline bool isnan(const float& v)  { return ( ::isnan(v) ); }
+    inline bool isnan(const double& v) { return ( ::isnan(v) ); }
+#   endif
+#else
+    inline bool isnan(const float& v)  { return ( std::isnan(v) ); }
+    inline bool isnan(const double& v) { return ( std::isnan(v) ); }
+#endif
+
+/* #if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__) */
+/*     inline bool isnan(const float& v) { return _isnan(v); } */
+/*     inline bool isnan(const double& v) { return _isnan(v); } */
+/* #else */
+/*     inline bool isnan(const float& v)  { return ( std::isnan(v) ); } */
+/*     inline bool isnan(const double& v) { return ( std::isnan(v) ); } */
+/* #endif */
+
+    /** @brief Class lets us see bit patterns of floats. */
+    class OSSIM_DLL IntFloatBitCoercion
+    {
+    public:
+       union
+       { 
+          ossim_int64 intname;
+          ossim_float64 floatname;
+       } bits;
+       IntFloatBitCoercion(ossim_int64 x)   { bits.intname = x;   }
+       IntFloatBitCoercion(ossim_float64 x) { bits.floatname = x; }
+    };
+    
+    /**
+     * @brief Declaration of nan part of nan() declared here for inline
+     * ossim::nan().
+     */
+    extern OSSIM_DLL_DATA(const IntFloatBitCoercion) nanValue;
+    
+    /**
+     * @brief Method to return ieee floating point double precision NAN.
+     *
+     * @return ieee floating point double precision NAN.
+     *
+     * @see isnan()
+     *
+     * @note casts seamlessly to float and long double.
+     *
+     * @note Use ossim::isnan(v) to test for nan.
+     * Like "if (isnan(myDoubleValue)) { doSomething; }"
+     * DO NOT USE operator==.  Like "if (myDoubleValue == ossim::nan())"
+     */
+    inline double nan() { return nanValue.bits.floatname; }
+
+   template <class T>
+   inline T abs(const T& value)
+   {
+      if(value < 0)
+      {
+         return -value;
+      }
+      return value;
+   }
+    template <class S, class T> 
+    inline T lerp(S x, T begin, T end)
+	// linear interpolation from begin to end by x
+	{ return x*(end - begin) + begin; }
+    
+    template <class T> 
+    inline T inverseLerp(T x, T begin, T end)
+	// inverse of lerp: if lerp(z,begin,end) = x, then inverseLerp(x,begin,end) = z.
+        // when begin=end, inverseLerp is underconstrained, so we define it to be 0.
+	{ return begin == end ? (ossim::isnan(x) ? x : T(0)) : (x - begin)/(end - begin); }
+
+    template <class S, class T> 
+    T quaderp(S x, T begin, T middle, T end)
+	// quadratic interpolation through begin,middle,end by x
+	{
+	    // newton interpolation
+	    const T a1 = S(2)*(middle - begin);
+	    const T a2 = S(2)*(end - middle) - a1;
+	    return x*((x - S(0.5))*a2 + a1) + begin;
+	}
+
+    template <class T> 
+    inline T clamp(T x, T a, T b)
+	// clamp x to [a, b]
+	{
+	    ossimREQUIRE(a <= b);  // input must make sense, disallow nans 
+	    
+            if (ossim::isnan(x)) return x;
+            if (x < a) return a;
+            if (b < x) return b;
+            return x;
+	}
+    
+    template <class T>
+    T wrap(T x, T a, T b)
+	// wrap x modularly into [a,b)
+	{
+	    ossimREQUIRE(a <= b);  // input must make sense, disallow nans 
+	    
+	    if (a == b && !ossim::isnan(x))
+		return a;
+	    else {
+		T z = x < a ? b : a;
+		return std::fmod(x - z, b - a) + z;
+	    }
+	}
+
+    // XXX to Garrett from PJM:
+    //     min and max routines. std::min/max do not in fact correctly handle nan.  
+    //     this is troublesome, i think my code always was asserting no nans before values got
+    //     through std::min/std::max.  i agree with you that if any of the input is nan,
+    //     then the result should be nan, but the STL doesn't really consider the possibility
+    //     that inputs to min/max have a "strange" ordering to them.  we could overload
+    //     std::min/max to do this behavior but that's evil. for all my whining, i think
+    //     we should have ossim::max/max that do the right thing wrt nan.  however:
+    //     if we "correctly" handle nans like this, does that subtly break any existing code?
+    template <class T>
+    inline T min(T a, T b)
+       // min of a,b; nan if either a or b are nan
+    {
+       return (a < b) ? a : b;
+    }
+    
+    template <>
+    inline ossim_float32 min<ossim_float32>(ossim_float32 a, ossim_float32 b)
+    {
+       if (ossim::isnan(a)||ossim::isnan(b))
+       {
+          return ossim::nan();
+       }
+       else
+       {
+          return (a < b) ? a : b;
+       }
+    }
+    
+    template <>
+    inline ossim_float64  min<ossim_float64>(ossim_float64  a, ossim_float64 b)
+    {
+       if (ossim::isnan(a)||ossim::isnan(b))
+       {
+          return ossim::nan();
+       }
+       else
+       {
+          return (a < b) ? a : b;
+       }
+    }
+    
+    template <class T>
+    inline T max(T a, T b)
+       // max of a,b; nan if either a or b are nan
+    {
+       return (a < b) ? b : a;
+    }
+    template <>
+    inline ossim_float32 max<ossim_float32>(ossim_float32 a, ossim_float32 b)
+    {
+       if (ossim::isnan(b))
+          return b;
+       else
+          return (a < b) ? b : a;       
+    }
+    template <>
+    inline ossim_float64 max<ossim_float64>(ossim_float64 a, ossim_float64 b)
+    {
+       if (ossim::isnan(b))
+          return b;
+       else
+          return (a < b) ? b : a;       
+    }
+    inline double radiansToDegrees(double x) { return x*DEG_PER_RAD;}
+    inline double degreesToRadians(double x) { return x*RAD_PER_DEG;}
+    inline double cosd(double x)             { return std::cos(x*RAD_PER_DEG); }
+    inline double sind(double x)             { return std::sin(x*RAD_PER_DEG); }
+    inline double tand(double x)             { return std::tan(x*RAD_PER_DEG); }
+        // trig fncs with parameter in degrees
+        
+    inline double acosd(double x)            { return DEG_PER_RAD*std::acos(x); }
+    inline double asind(double x)            { return DEG_PER_RAD*std::asin(x); }
+    inline double atand(double x)            { return DEG_PER_RAD*std::atan(x); }
+    inline double atan2d(double y, double x) { return DEG_PER_RAD*std::atan2(y,x); }
+        // trig fncs with result in degrees
+
+    template <class IntType>
+    IntType gcd(IntType n, IntType m)
+        // greatest common divisor of two ints
+        // NB: We use n and m as temporaries in this function, so there is no value
+        //     in using const IntType& as we would only need to make a copy anyway...
+        {
+            IntType zero(0);    // Avoid repeated construction
+            
+            // This is abs() - given the existence of broken compilers with Koenig
+            // lookup issues and other problems, I code this explicitly. (Remember,
+            // IntType may be a user-defined type).
+            if (n < zero)
+                n = -n;
+            if (m < zero)
+                m = -m;
+            
+            // As n and m are now positive, we can be sure that %= returns a
+            // positive value (the standard guarantees this for built-in types,
+            // and we require it of user-defined types).
+            for (;;) {
+                if (m == zero)
+                    return n;
+                n %= m;
+                if (n == zero)
+                    return m;
+                m %= n;
+            }
+        }
+
+    template <>
+    inline int gcd<int>(int n, int m)
+        // greatest common divisor specialize for int.
+        // XXX this is the old gcd, the above code is the old ossimGcd().
+        //     i made this a specialization of the template above,
+        //     is this really necessary or more efficient, or can we safely delete this specialization?
+        //     i don't know why this fnc must be decled inline, otherwise there's a compile error.
+        //     the simple test case doesn't have this problem.
+        { 
+            if (m == 0)
+                return n;
+            else
+                return gcd(m, n % m);  // gcc can optimize tail calls right?
+        }
+
+    template <class IntType>
+    IntType lcm(IntType n, IntType m)
+        // least common multiple
+        // NB: We use n and m as temporaries in this function, so there is no value
+        //     in using const IntType& as we would only need to make a copy anyway...
+        {
+            IntType zero(0);    // Avoid repeated construction
+            
+            if (n == zero || m == zero) {
+                return zero;
+            } else {
+                n /= gcd(n, m);
+                n *= m;
+                if (n < zero)
+                    n = -n;
+                return n;
+            }
+        }
+    
+    template<class T> 
+    inline T square(T x)
+        { return x*x; }
+        
+    // identical to copysign() but usable in templates
+    template <class T>
+    inline T sgn(T x) 
+        // signum function, returns 0, 1, -1, or nan
+        {
+            const T table[] = {T(0), T(1), T(-1)};
+            return table[((x < T(0)) << 1) | (x > T(0))];
+        }
+    template <>
+    inline ossim_float32 sgn<ossim_float32>(ossim_float32 x) 
+        // signum function, returns 0, 1, -1, or nan
+        {
+            const ossim_float32 table[] = {ossim_float32(0), ossim_float32(1), ossim_float32(-1)};
+            return ossim::isnan(x) ? x : table[((x < ossim_float32(0)) << 1) | (x > ossim_float32(0))];
+        }
+    template <>
+    inline ossim_float64 sgn(ossim_float64 x) 
+        // signum function, returns 0, 1, -1, or nan
+        {
+            const ossim_float64 table[] = {ossim_float64(0), ossim_float64(1), ossim_float64(-1)};
+            return ossim::isnan(x) ? x : table[((x < ossim_float64(0)) << 1) | (x > ossim_float64(0))];
+        }
+
+    template <class R, class F>    
+    inline R round(F x)
+        // correctly round a float, and cast to desired type R
+        {
+            R result = static_cast<R>((x < F(0)) ? std::ceil(x - F(0.5)) : std::floor(x + F(0.5)));
+            
+            ossimENSURE(ossim::isnan(x) == ossim::isnan(result));   // if x is nan, R must be a float type
+            return result;
+            
+            // XXX is this better than use of ceil/floor?:    return static_cast<long long>((x < T(0)) ? x - T(0.5) : x + T(0.5));
+        }
+
+    inline double ft2mtrs(double feet)      { return (feet * MTRS_PER_FT); }
+    inline double usft2mtrs(double feet)    { return (feet * US_METERS_PER_FT); }
+    inline double mtrs2ft(double meters)    { return (meters / MTRS_PER_FT); }
+    inline double mtrs2usft(double meters)  { return (meters / US_METERS_PER_FT); }
+        // Common conversion functions
+
+    template <class T>
+    std::pair<T, T> quadraticRoots(T a, T b, T c)
+	// evaluates quadradic formula (positive sqrt is first)
+	{
+            // XXX could suffer from catastrophic cancellation, 
+            // see David Goldberg's "What Every Computer Scientist Should Know About Floating-Point Arithmetic"
+	    T s = std::sqrt(b*b - T(4)*a*c);
+	    T twoA = T(2)*a;
+            return std::pair<T, T>((-b + s)/twoA, (-b - s)/twoA); 
+	}
+
+    template <class T>
+    inline void memClear(T& var, int z = 0)
+	// zero out a variable's memory (for a given value of zero)
+	{ memset(&var, z, sizeof(T)); }
+
+    template <class T>
+    inline void memClear(T* var)
+        // prevent user from accidentally passing in a pointer to his struct
+        { ossimSTATIC_CHECK(false, YOU_PROBABLY_WANT_TO_MEMCLEAR_WHAT_THE_POINTER_POINTS_TO_NOT_THE_POINTER_ITSELF); }
+
+    OSSIM_DLL ossimByteOrder byteOrder();
+        // test endianness of current machine 
+
+    // values for various scalar types
+    OSSIM_DLL double defaultMin(ossimScalarType scalarType);
+    OSSIM_DLL double defaultMax(ossimScalarType scalarType);
+    OSSIM_DLL double defaultNull(ossimScalarType scalarType);
+    OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType);
+    
+    /** @brief @return true if scalar type is signed, false if not. */
+    OSSIM_DLL bool isSigned(ossimScalarType scalarType);
+
+    /**
+     * @brief Get actual bits per pixel for a given scalar type.
+     * 
+     * This is bits used.  (OSSIM_USHORT11 = 11)
+     * 
+     * @returns The actual bits per pixel.  This will return 0 if the
+     * input connection is not hooked up or there is an unhandled scalar type.
+     */
+    OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType);
+    
+    /**
+     * @brief Get bits per pixel for a given scalar type.
+     * 
+     * This the total bits per pixel.  (OSSIM_USHORT11 = 16)
+     * 
+     * @returns The bits per pixel.  This will return 0 if the
+     * input connection is not hooked up or there is an unhandled scalar type.
+     */
+    OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType);  
+        
+    OSSIM_DLL void defaultTileSize(ossimIpt& tileSize);
+
+    OSSIM_DLL std::string convertHtmlSpecialCharactersToNormalCharacter(const std::string& src);
+
+    /** Heading pitch roll extraction from a matrix. */
+    OSSIM_DLL bool matrixToHpr( ossim_float64 hpr[3],
+                                const NEWMAT::Matrix& rotation );
+
+    /** Heading pitch roll extraction from a matrix. */
+    OSSIM_DLL bool matrixToHpr( ossim_float64 hpr[3],
+                                const NEWMAT::Matrix& lsrMatrix,
+                                const NEWMAT::Matrix& rotationalMatrix);
+    
+    OSSIM_DLL void lexQuotedTokens(const std::string& str,
+                                   ossim_uint32 start,
+                                   const char* whitespace,
+                                   const char* quotes,
+                                   std::vector<std::string>& tokens, bool& unbalancedQuotes);
+   /**
+    * Will take a vector of ossimDpt and convert to a string list separated by spaces
+    * For example: 
+    *      (45,34) (12,34)
+    */
+   
+   OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
+                               const std::vector<ossimDpt>& pointList,
+                               char separator=' ');
+   OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
+                               const std::vector<ossimIpt>& pointList,
+                               char separator = ' ');
+   OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
+                               const std::vector<ossimGpt>& pointList,
+                               char seaprator = ' ');
+   
+   /**
+    * Will take a string list separated by spaces and convert to a vector of ossimDpts.  It will not clear
+    * the passed in list but will append all points found.
+    */
+   OSSIM_DLL void toVector(std::vector<ossimDpt>& result,
+                           const ossimString& stringOfPoints);
+   OSSIM_DLL void toVector(std::vector<ossimIpt>& result,
+                           const ossimString& stringOfPoints);
+   OSSIM_DLL void toVector(std::vector<ossimGpt>& result,
+                           const ossimString& stringOfPoints);
+   
+   /**
+    * This will output a vector of values inst a string
+    *
+    *  (value1,...,valueN)
+    *
+    * Parenthesis are required
+    */ 
+   template <class T>
+   void toSimpleStringList(ossimString& result,
+                           const std::vector<T>& valuesList)
+   {
+      std::ostringstream out;
+      
+      if(!valuesList.empty())
+      {
+         ossim_uint32 idx = 0;
+         ossim_uint32 size = (ossim_uint32) (valuesList.size()-1);
+         for(idx = 0; idx < size; ++idx)
+         {
+            out << valuesList[idx] << ",";
+         }
+         out << valuesList[size];
+      }
+      
+      result = "("+out.str()+")";
+   }
+   
+   /**
+    * This will output a vector of values inst a string
+    *
+    *  (value1,...,valueN)
+    *
+    * Specialize the char for it will output the actual ascii char instead of the numeric value
+    *
+    * Parenthesis are required
+    */ 
+   template <>
+   OSSIM_DLL void toSimpleStringList(ossimString& result,
+                                     const std::vector<ossim_uint8>& valuesList);
+   template <>
+   OSSIM_DLL void toSimpleStringList(ossimString& result,
+                                     const std::vector<ossim_float64>& valuesList);
+   template <>
+   OSSIM_DLL void toSimpleStringList(ossimString& result,
+                                     const std::vector<ossim_float32>& valuesList);
+   template <>
+   OSSIM_DLL void toSimpleStringList(ossimString& result,
+                                     const std::vector<ossimString>& valuesList);
+   
+   /**
+    * Generic function to extract a list of values into a vector of string where
+    * the string of points is of the form:
+    *
+    * (value1,value2, ... , )
+    *
+    * Parenthesis are required
+    */ 
+   OSSIM_DLL bool extractSimpleValues(std::vector<ossimString>& values,
+                                      const ossimString& stringOfPoints);
+
+   
+  template <class T>  bool toSimpleVector(std::vector<T>& result, const ossimString& stringOfPoints)
+  {
+     std::istringstream in(stringOfPoints);
+     ossim::skipws(in);
+     bool returnValue = true;
+     char c = in.get();
+     ossimString value = "";
+     if(c == '(')
+     {
+        c = (char)in.get();
+        while( (c!=')') && (c!= '\n') && (in.good()) )
+        {
+           if(c!= ',')
+           {
+              value += ossimString(c);
+           }
+           else
+           {
+              result.push_back(static_cast<T>(value.toDouble()));
+              value = "";
+           }
+           c = in.get();
+        }
+     }
+     if(c!= ')')
+     {
+        returnValue = false;
+     }
+     else
+     {
+        if(!value.empty())
+        {
+           result.push_back(static_cast<T>(value.toDouble()));
+        }
+     }
+     
+     return returnValue;
+  }
+   
+   /**
+    *  Takes input format of the form:
+    *  (value1,value2,...,valueN)
+    */
+  OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint32>& result,
+                                const ossimString& stringOfPoints);
+   /**
+    *  Takes input format of the form:
+    *  (value1,value2,...,valueN)
+    */
+  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int32>& result,
+                                const ossimString& stringOfPoints);
+   /**
+    *  Takes input format of the form:
+    *  (value1,value2,...,valueN)
+    */
+   OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint16>& result,
+                                 const ossimString& stringOfPoints);
+   /**
+    *  Takes input format of the form:
+    *  (value1,value2,...,valueN)
+    */
+  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int16>& result,
+                                const ossimString& stringOfPoints);
+   /**
+    *  Takes input format of the form:
+    *  (value1,value2,...,valueN)
+    */
+   OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint8>& result,
+                                 const ossimString& stringOfPoints);
+   /**
+    *  Takes input format of the form:
+    *  (value1,value2,...,valueN)
+    */
+   OSSIM_DLL bool toSimpleVector(std::vector<ossim_int8>& result,
+                                 const ossimString& stringOfPoints);
+
+    /**
+    *  Takes input format of the form:
+    *  (value1,value2,...,valueN)
+    */
+  OSSIM_DLL bool toSimpleVector(std::vector<ossimString>& result,
+                                 const ossimString& stringOfStrings);
+   
+        // lex str into tokens starting at position start using whitespace  
+	//    chars as delimiters and quotes[0] and quotes[1] as the opening
+	//    and closing quotation chars (for quoting tokens containing whitespace).
+	//    unbalancedQuotes is true iff it aborted when detecting unbalanced quoting.
+	// REQUIRE(whitespace != NULL);
+	// REQUIRE(quotes != NULL);
+	// REQUIRE(tokens != NULL);
+	// REQUIRE(unbalancedQuotes != NULL);
+
+   /**
+    * @brief Get the number threads to use from ossimPreferences or OpenThreads.
+    *
+    * Keyword searched for is:  "ossim_threads"
+    *
+    * If keyword is not found OpenThreads::GetNumberOfProcessors() is used.
+    *
+    * @return Number of threads. Default=1
+    */
+   OSSIM_DLL ossim_uint32 getNumberOfThreads();
+
+   /**
+    * @brief Gets the current time.
+    *
+    * Example formats and output:
+    * format = "%Y-%m-%dT%H:%M:%SZ" output = "2014-03-06T13:55:10Z"
+    *
+    * @param format E.g. "%Y-%m-%dT%H:%M:%SZ"
+    *
+    * @param gmtFlag If true get the zulu time; else, gets the local time.
+    *
+    * @param result Initialized by this with result.
+    *
+    * E.g. "2014-03-06T13:55:10Z"
+    * 
+    * @note If an error occurs result will be empty.
+    */
+   OSSIM_DLL void getFormattedTime( const std::string& format,
+                                    bool gmtFlag,
+                                    std::string& result );
+
+   /**
+    * @brief Gets the current time.
+    *
+    * Wrapper around time.h time_t time(time_t *t) with a mutex lock.
+    *
+    * Note that time_t is a long int.  Returning ossim_int64 to avoid include
+    * of time.h.
+    *
+    * @return The time  as  the  number of seconds since the Epoch,
+    * 1970-01-01 00:00:00 +0000 (UTC).  
+    */
+   OSSIM_DLL ossim_int64 getTime();
+
+   /**
+    * @brief Computes the number of decimation levels to get to the overview
+    * stop dimension.
+    *
+    * This uses ossim preferences "overview_stop_dimension" value if set else
+    * it uses the default tile size to compute the number of levels.
+    * 
+    * @param rect The rectangle of the first level.
+    *
+    * @return The number of decimation levels needed.
+    */
+   OSSIM_DLL ossim_uint32 computeLevels(const ossimIrect& rect);   
+
+} // End: namespace ossim
+
+
+#endif /* #ifndef ossimCommon_HEADER */
diff --git a/ossim/include/ossim/base/ossimConnectableContainer.h b/include/ossim/base/ossimConnectableContainer.h
similarity index 100%
rename from ossim/include/ossim/base/ossimConnectableContainer.h
rename to include/ossim/base/ossimConnectableContainer.h
diff --git a/ossim/include/ossim/base/ossimConnectableContainerInterface.h b/include/ossim/base/ossimConnectableContainerInterface.h
similarity index 100%
rename from ossim/include/ossim/base/ossimConnectableContainerInterface.h
rename to include/ossim/base/ossimConnectableContainerInterface.h
diff --git a/include/ossim/base/ossimConnectableDisplayListener.h b/include/ossim/base/ossimConnectableDisplayListener.h
new file mode 100644
index 0000000..07649b0
--- /dev/null
+++ b/include/ossim/base/ossimConnectableDisplayListener.h
@@ -0,0 +1,109 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2004, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ossimConnectableDisplayListener
+// 
+// This class is intended for connectable displays that wants to be a
+// ossimConnectableObjectListener and a ossimDisplayEventListener to avoid
+// a triangle inheritance.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimConnectableDisplayListener.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef ossimConnectableDisplayListener_HEADER
+#define ossimConnectableDisplayListener_HEADER
+
+#include <ossim/base/ossimListener.h>
+
+class ossimConnectionEvent;
+class ossimObjectDestructingEvent;
+class ossimPropertyEvent;
+class ossimContainerEvent;
+class oossimDisplayListEvent;
+class ossimRefreshEvent;
+class ossimDisplayListEvent;
+class ossimDisplayRefreshEvent;
+
+/**
+ * This class is intended for connectable displays that wants to be a
+ * ossimConnectableObjectListener and a ossimDisplayEventListener to avoid
+ * a triangle inheritance.
+ */
+class OSSIMDLLEXPORT ossimConnectableDisplayListener : public ossimListener
+{
+public:
+
+   /** default constructor */
+   ossimConnectableDisplayListener();
+
+   /**
+    * Method called by listener managers.  This will in turn call the correct
+    * xxxEvent method.
+    *
+    * @param event Event to handle.
+    */
+   virtual void processEvent(ossimEvent& event);
+
+   /** @param event Event to handle signifying an object destroying. */
+   virtual void objectDestructingEvent(ossimObjectDestructingEvent& event);
+
+   /** @param event Event to handle signifying an object connecting. */
+   virtual void connectionEvent(ossimConnectionEvent& event);
+
+   /** @param event Event to handle signifying a disconnect input event. */
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+
+   /** @param event Event to handle signifying an output disconnect event. */
+   virtual void disconnectOutputEvent(ossimConnectionEvent& event);
+
+   /** @param event Event to handle signifying a connect input event. */
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+
+   /** @param event Event to handle signifying a connect  output event. */
+   virtual void connectOutputEvent(ossimConnectionEvent& event);
+
+   /**
+    * @param event Event to handle signifying a property has changed  event.
+    */
+   virtual void propertyEvent(ossimPropertyEvent& event);
+
+   /**
+    * @param event Event to handle signifying a dislay list  has changed
+    * event.
+    */
+   virtual void displayListEvent(ossimDisplayListEvent&);
+
+   /**
+    * @param event Event to handle signifying a dislay refresh
+    * is needed.
+    */
+   virtual void displayRefreshEvent(ossimDisplayRefreshEvent&);
+
+   /**
+    * @param event Event to handle signifying a refresh is needed.
+    */
+   virtual void refreshEvent(ossimRefreshEvent& event);
+
+   /**
+    * Container Events:
+    * Typically isued by objects that contain children.  If anyone is
+    * interested, can latch on to this event.  Other objects within the
+    * system might be interest in this event even 
+    */
+
+   /** @param event Event signifying an object was added to a container. */
+   virtual void addObjectEvent(ossimContainerEvent& event);
+
+   /** @param event Event signifying an object was removed from a container. */
+   virtual void removeObjectEvent(ossimContainerEvent& event);
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/base/ossimConnectableObject.h b/include/ossim/base/ossimConnectableObject.h
new file mode 100644
index 0000000..44a4b59
--- /dev/null
+++ b/include/ossim/base/ossimConnectableObject.h
@@ -0,0 +1,600 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+// Description:
+// 
+// Contains class declaration for ossimConnectableObject the base class for
+// all connectable objects.
+//
+//*************************************************************************
+// $Id$
+
+#ifndef ossimConnectableObject_HEADER
+#define ossimConnectableObject_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimId.h>
+#include <ossim/base/ossimListenerManager.h>
+#include <ossim/base/ossimPropertyInterface.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <vector>
+
+class ossimVisitor;
+class ossimConnectableContainer;
+
+class  OSSIMDLLEXPORT  ossimConnectableObject : public ossimObject,
+                                                public ossimListenerManager,
+                                                public ossimPropertyInterface
+{
+public:
+   typedef std::vector<ossimRefPtr<ossimConnectableObject> > ConnectableObjectList;
+   enum ossimConnectableObjectDirectionType
+   {
+      CONNECTABLE_DIRECTION_NONE   = 0,
+      CONNECTABLE_DIRECTION_INPUT  = 1,
+      CONNECTABLE_DIRECTION_OUTPUT = 2
+   };
+   /**
+    * Base constructor of this object.
+    */
+   ossimConnectableObject(ossimObject* owner=0);
+   ossimConnectableObject(ossimObject* owner,
+                          ossim_int32 inputListSize,
+                          ossim_int32 outputListSize,
+                          bool inputListIsFixedFlag=true,
+                          bool outputListIsFixedFlag=true);
+
+   virtual ~ossimConnectableObject();
+   /**
+    * All connectable objects will have id's.  This allows us to
+    * set the id of this object.
+    */
+   void setId(const ossimId& id);
+
+   /**
+    * Will allow us to get this object's id.
+    */
+   const ossimId& getId()const;
+   
+   /**
+    * Fetches the current owner, most likely a container but not limited to one.
+    */
+   const ossimObject* getOwner() const;
+
+   /**
+    * Permits changing the object's owner.
+    */
+   virtual void changeOwner(ossimObject* owner);
+
+   virtual void setDescription(const ossimString& description);
+   virtual ossimString getDescription()const;
+   
+   /**
+    * will check the direction specified to see if all slots are full.
+    * If any slot is null then false is returned.
+    * If a filter requires options testing they
+    * need to override this method.  The argument can be ored together. If you
+    * want both checked then pass
+    * CONNECTABLE_DIRECTION_INPUT | CONNECTABLE_DIRECTION_OUTPUT
+    */
+   virtual bool isConnected(
+      ossimConnectableObjectDirectionType direction = CONNECTABLE_DIRECTION_INPUT)const;
+
+
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not achieve exactly
+    * what you want then you can derive new rules by overriding the virtual
+    * visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimIdVisitor visitor(id, false, ossimVisitor::VISIT_CHILDREN |
+    *    ossimVisitor::VISIT_INPUTS);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findConnectableObject(
+                             const ossimId& id));
+
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not achieve exactly
+    * what you want then you can derive new rules by overriding the virtual
+    * visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeIdVisitor visitor(typeId, true, ossimVisitor::VISIT_CHILDREN |
+    *    ossimVisitor::VISIT_INPUTS);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObjectOfType(
+                             RTTItypeid typeId,
+                             ossimConnectableObjectDirectionType directionType,
+                             bool recurse = true));
+
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding
+    * the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeNameVisitor visitor(typeName, true,
+    *    ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObjectOfType(
+                             const ossimString& obj,
+                             ossimConnectableObjectDirectionType directionType,
+                             bool recurse = true));
+   
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding
+    * the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeNameVisitor visitor(typeName, true,
+    *    ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findInputObjectOfType(
+                             const ossimString& className));
+   
+   /**
+    * Return a valid index of the input list if the passed in object
+    * is found else return -1.
+    */
+   virtual ossim_int32 findInputIndex(const ossimConnectableObject* object);
+
+   /**
+    * Return a valid index of the input list if the passed id
+    * is found else return -1.
+    */
+   virtual ossim_int32 findInputIndex(const ossimId& id);
+
+   /**
+    * Return a valid index of the output list if the passed in object
+    * is found else return -1.
+    */
+   virtual ossim_int32 findOutputIndex(const ossimConnectableObject* object);
+
+   /**
+    * Return a valid index of the output list if the passed in object
+    * is found else return -1.
+    */   
+   virtual ossim_int32 findOutputIndex(const ossimId& id);
+   
+   /**
+    * Should return the first available index to connect to.  The
+    * connectMyInputTo that just takes another ossimConnectableObject as input
+    * and not an index will call this method.  By default this method will find
+    * the first open slot (not null) or append o the list if it's dynamic. If
+    * the list is dynamic it calls conConnectMyInputTo(index, object) on an
+    * index = to listSize.
+    */
+   virtual ossim_int32 getMyInputIndexToConnectTo(
+      ossimConnectableObject* object)const;
+   
+
+   /**
+    * Should return the first available index to connect to.  The
+    * connectMyOutputTo that just takes another ossimConnectableObject as input\
+    * and not an index will call this method.  By default this method will find
+    * the first open slot (not null) or append to the list if it's dynamic. If
+    * the list is dynamic it calls canConnectMyOutputTo(index, object) on an
+    * index = to listSize.
+    */
+   virtual ossim_int32 getMyOutputIndexToConnectTo(
+      ossimConnectableObject* object)const;
+   
+   /**
+    * required to be overriden by derived classes
+    */
+   virtual bool canConnectMyInputTo(
+      ossim_int32 myInputIndex, const ossimConnectableObject* object)const=0;
+   
+   /**
+    * default implementation is to allow anyone to connect to us.
+    */
+   virtual bool canConnectMyOutputTo(ossim_int32 myOutputIndex,
+                                     const ossimConnectableObject* object)const;
+   
+   /**
+    * Will disconnect the object passed in.
+    */
+   virtual void disconnect(ossimConnectableObject* object=0);
+
+   /**
+    * Will disconnect the object passed in.
+    */
+   virtual void disconnect(const ossimId& id);
+   
+   /**
+    * Will disconnect the object at the given input index and generate
+    * a connection event.
+    */
+   virtual ossimRefPtr<ossimConnectableObject> disconnectMyInput(
+      ossim_int32 inputIndex,
+      bool disconnectOutputFlag=true,
+      bool createEventFlag = true);
+   
+  /**
+   * Finds the index of the passed in input and calls
+   * disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);
+   */
+   virtual void disconnectMyInput(ossimConnectableObject* input,
+                                  bool disconnectOutputFlag=true,
+                                  bool createEventFlag = true);
+   /**
+    *
+    */
+   virtual void disconnectMyInputs(
+      ConnectableObjectList& inputList,
+      bool disconnectOutputFlag=true,
+      bool createEventFlag=true);
+   
+   /**
+    * Will disconnect the object at the given output index and generate
+    * a connection event.  If there is no object at that index then no
+    * event is generated and NULL is returned.  The disconnectOutputFlag
+    * says do you want this method to disconnect the output pointer to
+    * this object.
+    */
+   virtual ossimRefPtr<ossimConnectableObject> disconnectMyOutput(
+      ossim_int32 outputIndex,
+      bool disconnectInputFlag=true,
+      bool createEventFlag = true);
+   
+   /**
+    * Will disconnect the output object.  It will get the index of
+    * the object and call disconnectMyOutput(index, disconnectOutputFlag).
+    */
+   virtual void disconnectMyOutput(ossimConnectableObject* output,
+                                   bool disconnectInputFlag=true,
+                                   bool createEventFlag=true);
+
+   virtual void disconnectMyOutputs(
+      ConnectableObjectList& outputList,
+      bool disconnectOutputFlag=true,
+      bool createEventFlag=true);
+   
+   /**
+    * Will disconnect all of the input objects.
+    */
+   virtual void disconnectAllInputs();
+
+   /**
+    * Will disconnect all of the output objects.
+    */
+   virtual void disconnectAllOutputs();
+
+   /**
+    * Will try to connect this objects input to the passed in object.
+    * It will return a valid index >= 0 if successful.  Will use the
+    * getMyInputIndexToConnectTo method to implement the connection
+    */
+   virtual ossim_int32 connectMyInputTo(ossimConnectableObject* inputObject,
+                                        bool makeOutputConnection=true,
+                                        bool createEventFlag=true);
+
+   /**
+    * Will connect the specified input to the passed in object
+    */
+   virtual ossim_int32 connectMyInputTo(ossim_int32 inputIndex,
+                                        ossimConnectableObject* inputObject,
+                                        bool makeOutputConnection=true,
+                                        bool createEventFlag=true);
+   
+   virtual bool connectMyInputTo(
+      ConnectableObjectList& inputList,
+      bool makeOutputConnection=true,
+      bool createEventFlag = true);   
+
+   /**
+    * Will try to connect this objects output to the passed in object.
+    * It will return a valid index >= 0 if successful.  It will in turn call
+    * the passed in objects connect input command if makeInputConnection
+    * is set to true.
+    *
+    * Will use the getMyOutputIndexToConnectTo to implement this method
+    */
+   virtual ossim_int32 connectMyOutputTo(ossimConnectableObject* outputObject,
+                                         bool makeInputConnection=true,
+                                         bool createEventFlag=true);
+   
+   virtual bool connectMyOutputTo(
+      ConnectableObjectList& outputList,
+      bool makeInputConnection=true,
+      bool createEventFlag=true);
+   
+   /**
+    * Will disconnect itself from all inputs and reset to the passed in
+    * input list.  It will return true if all objects were successfully
+    * added.
+    */
+   virtual bool connectInputList(
+      ConnectableObjectList& inputList);
+   
+   /**
+    * Will disconnect itself from all outputs and reset to the passed in
+    * output list.  It will return true if all objects were successfully
+    * added.
+    */
+   virtual bool connectOutputList(
+      ConnectableObjectList& outputList);
+   
+   /**
+    * Returns the number of input objects.
+    */
+   virtual ossim_uint32 getNumberOfInputs()const;
+
+   /**
+    * Return the number of output objects
+    */
+   virtual ossim_uint32 getNumberOfOutputs()const;
+   
+   /**
+    * returns the object at the specified index.
+    * if the index is not valid then NULL is
+    * returned
+    */
+   ossimConnectableObject* getInput(ossim_uint32 index=0);   
+
+   /**
+    * returns the object at the specified index.
+    * if the index is not valid then NULL is
+    * returned
+    */
+   const ossimConnectableObject* getInput(ossim_uint32 index=0)const;
+
+   /**
+    * returns the object at the specified index.
+    * if the index is not valid then NULL is
+    * returned
+    */
+   ossimConnectableObject* getOutput(ossim_uint32 index=0);
+
+   /**
+    * returns the object at the specified index.
+    * if the index is not valid then NULL is
+    * returned
+    */
+   const ossimConnectableObject* getOutput(ossim_uint32 index=0)const;
+   
+   /**
+    * Will set the number of inputs.  This will expand the list if the number
+    * of inputs is larger than the current number of inputs.  Will shrink
+    * the list if the current number of inputs is larger than the passed in
+    * inputs.
+    */
+   virtual void setNumberOfInputs(ossim_int32 numberOfInputs);
+
+   virtual bool getInputListIsFixedFlag()const;
+   
+   virtual bool getOutputListIsFixedFlag()const;
+
+   /**
+    * Will set the number of outputs.  This will expand the list if the
+    * number of outputs is larger than the current number of outputs.
+    * Will shrink the list if the current number of outputs is larger than
+    * the passed in outputs.
+    */
+   virtual void setNumberOfOutputs(ossim_int32 numberOfInputs);
+   
+   const ConnectableObjectList& getInputList()const;
+
+   const ConnectableObjectList& getOutputList()const;
+
+   ConnectableObjectList& getInputList();
+
+   ConnectableObjectList& getOutputList();
+
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not achieve exactly
+    * what you want then you can derive new rules by overriding the virtual
+    * visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeNameVisitor visitor("<put type name here>",
+    *    false, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
+    * </pre>
+    */
+    OSSIM_DEPRECATE_METHOD(virtual void findAllObjectsOfType(
+                              ConnectableObjectList& result,
+                              const RTTItypeid& typeInfo, bool recurse=true) );
+    
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not achieve exactly
+    * what you want then you can derive new rules by overriding the virtual
+    * visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeNameVisitor visitor("<put type name here>", false,
+    *    ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual void findAllObjectsOfType(
+                             ConnectableObjectList& result,
+                             const ossimString& className,
+                             bool recurse=true));
+
+#if 0 /* Deprecated code. Left here until thoroughly debugged. (drb) */
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding
+    * the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeIdVisitor visitor(<put type id here>, false,
+    *    ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
+    *    connectableObject->accept(visitor);
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual void findAllInputsOfType(
+      ConnectableObjectList& result,
+      const RTTItypeid& typeInfo,
+      bool propagateToInputs=true,
+      bool recurseChildren=false));
+   
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by
+    * using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding
+    * the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeNameVisitor visitor("<put type name here>",
+    *    false, ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
+    *    connectableObject->accept(visitor);
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
+    * </pre>
+    */
+   
+   OSSIM_DEPRECATE_METHOD(virtual void findAllInputsOfType(
+                             ConnectableObjectList& result,
+                             const ossimString& className,
+                             bool propagateToInputs=true,
+                             bool recurseChildren=false));
+#endif  /* deprecated code. (drb) */
+
+   virtual void propagateEventToOutputs(ossimEvent& event);
+   virtual void propagateEventToInputs(ossimEvent& event);
+
+   /* ------------------- PROPERTY INTERFACE -------------------- */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual void setProperty(const ossimString& name, const ossimString& value);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   /* ------------------ PROPERTY INTERFACE END ------------------- */
+
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0)const;
+
+   /**
+    * Save the state of all inputs to a keyword list.  This will do a
+    * recursive call through all inputs and save their state to a
+    * keyword list.
+    *
+    * @param kwl Keyword list to save state to.
+    *
+    * @param saveThisStateFlag If the true the state of this object will be
+    * saved as well as all inputs. Default = true.
+    *
+    * @param  objectIndex Index to be used for prefix.  So if
+    * objectIndex = 1, the first object will have a prefix of: "object1."
+    * Default = 1.
+    *
+    * @param prefix Prefix to tack onto keyword.  If prefix = "myChain." and
+    * objectIndex = 1, then the first keyword would be
+    * "myChain.object1.some_keyword".
+    *
+    * @return Returns the next object index.  This is the last index used
+    * plus one.  Used internally to keep track of index to use for prefix.
+    */
+   virtual ossim_uint32 saveStateOfAllInputs(ossimKeywordlist& kwl,
+                                             bool saveThisStateFlag=true,
+                                             ossim_uint32 objectIndex=1,
+                                             const char* prefix=0) const;
+
+   /**
+    * Inserts this object and all of its children and inputs into the container
+    * provided.
+    * @return Returns TRUE if successful.
+    */
+   virtual bool fillContainer(ossimConnectableContainer& container);
+
+   /**
+    * Moves the input connection matching id up one in the connection list.
+    * @param id The id to move.
+    * @return true if action was performed, false if not.
+    */
+   bool moveInputUp(const ossimId& id);
+
+   /**
+    * Moves the input connection matching id down one in the connection list.
+    * @param id The id to move.
+    * @return true if action was performed, false if not.
+    */
+   bool moveInputDown(const ossimId& id);
+
+   /**
+    * Moves the input connection matching id to the top of the connection list.
+    * @param id The id to move.
+    * @return true if action was performed, false if not.
+    */   
+   bool moveInputToTop(const ossimId& id);
+
+   /**
+    * Moves the input connection matching id to the bottom of the connection
+    * list.
+    * @param id The id to move.
+    * @return true if action was performed, false if not.
+    */     
+   bool moveInputToBottom(const ossimId& id);
+   
+   /**
+    * We will add a visitor interface for all connectable objects.
+    */
+   virtual void accept(ossimVisitor& visitor);
+   
+protected:
+
+   ossimConnectableObject* findObjectOfType(
+      ConnectableObjectList* connectableList,
+      ossimVisitor& visitor );
+   
+   ossimId      theId;
+   ossimString  theDescription;
+   ossimObject* theOwner;
+
+   /**
+    * Indicates whether the theInputObjectList is fixed
+    */
+   bool theInputListIsFixedFlag;
+
+   /**
+    * Indicates whether the theOutputObjectList is fixed
+    */
+   bool theOutputListIsFixedFlag;
+   
+   /**
+    * Holds a list of input objects.
+    */
+   ConnectableObjectList theInputObjectList;
+   
+   /**
+    * Holds a list of output objects.
+    */
+   ConnectableObjectList theOutputObjectList;
+
+private:
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimConnectableObject_HEADER */
diff --git a/ossim/include/ossim/base/ossimConnectableObjectListener.h b/include/ossim/base/ossimConnectableObjectListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimConnectableObjectListener.h
rename to include/ossim/base/ossimConnectableObjectListener.h
diff --git a/include/ossim/base/ossimConnectionEvent.h b/include/ossim/base/ossimConnectionEvent.h
new file mode 100644
index 0000000..d86471c
--- /dev/null
+++ b/include/ossim/base/ossimConnectionEvent.h
@@ -0,0 +1,79 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//*************************************************************************
+// $Id: ossimConnectionEvent.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimConnectionEvent_HEADER
+#define ossimConnectionEvent_HEADER
+
+#include <vector>
+
+#include <ossim/base/ossimEventIds.h>
+#include <ossim/base/ossimEvent.h>
+#include <ossim/base/ossimConnectableObject.h>
+
+class OSSIMDLLEXPORT ossimConnectionEvent : public ossimEvent
+{
+public:
+   enum ossimConnectionDirectionType
+   {
+      OSSIM_DIRECTION_UNKNOWN  = 0,
+      OSSIM_INPUT_DIRECTION    = 1,
+      OSSIM_OUTPUT_DIRECTION   = 2,
+      OSSIM_INPUT_OUTPUT_DIRECTION = 3
+   };
+   
+   ossimConnectionEvent(ossimObject* object=NULL,
+                        long id=OSSIM_EVENT_NULL_ID);
+
+   ossimConnectionEvent(ossimObject* object,
+                        long id,
+                        const ossimConnectableObject::ConnectableObjectList& newList,
+                        const ossimConnectableObject::ConnectableObjectList& oldList,
+                        ossimConnectionDirectionType whichDirection);
+
+   ossimConnectionEvent(ossimObject* object,
+                        long id,
+                        ossimConnectableObject* newConnectableObject,
+                        ossimConnectableObject* oldConnectableObject,
+                        ossimConnectionDirectionType whichDirection);
+   
+   ossimConnectionEvent(const ossimConnectionEvent& rhs);
+
+   ossimObject* dup()const;
+   
+   virtual void setDirection(ossimConnectionDirectionType direction);
+   
+   virtual ossimConnectionDirectionType getDirection()const;
+
+   virtual ossim_uint32 getNumberOfNewObjects()const;
+   
+   virtual ossim_uint32 getNumberOfOldObjects()const;
+   
+   virtual ossimConnectableObject* getOldObject(ossim_uint32 i=0);
+
+   virtual ossimConnectableObject* getNewObject(ossim_uint32 i=0);
+
+   virtual bool isDisconnect()const;
+   
+   virtual bool isConnect()const;
+      
+   virtual bool isInputDirection()const;
+   
+   virtual bool isOutputDirection()const;
+   
+protected:
+   ossimConnectableObject::ConnectableObjectList theNewObjectList;
+   ossimConnectableObject::ConnectableObjectList theOldObjectList;
+   ossimConnectionDirectionType         theDirectionType;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/base/ossimConstants.h b/include/ossim/base/ossimConstants.h
new file mode 100644
index 0000000..d220bda
--- /dev/null
+++ b/include/ossim/base/ossimConstants.h
@@ -0,0 +1,569 @@
+/********************************************************************
+ *
+ * License:  See top level LICENSE.txt file.
+ *
+ * Author: Ken Melero
+ * 
+ * Description: Common file for global constants.
+ *
+ **************************************************************************
+ * $Id: ossimConstants.h 22476 2013-11-07 16:08:32Z dburken $
+ */
+#ifndef ossimConstants_HEADER
+#define ossimConstants_HEADER 1
+
+#include <ossim/ossimConfig.h>
+
+#ifdef __cplusplus
+#  include <cfloat>
+#else
+#  include <float.h>
+#endif
+
+/**
+ * WARNINGS SECTION:
+ */
+#ifdef _MSC_VER /* Quiet a bunch of MSVC warnings... */
+#  pragma warning(disable:4786) /* visual c6.0 compiler */
+#  pragma warning(disable:4251)/* for std:: member variable to have dll interface */
+#  pragma warning(disable:4275) /* for std:: base class to have dll interface */
+#  pragma warning(disable:4800) /* int forcing value to bool */
+#  pragma warning(disable:4244) /* conversion, possible loss of data */
+#endif
+#if defined(__GNUC__)
+#   define OSSIM_DEPRECATE_METHOD(func) func __attribute__ ((deprecated))
+#elif defined(_MSC_VER)
+#   define OSSIM_DEPRECATE_METHOD(func)  __declspec(deprecated) func 
+#else
+#   define OSSIM_DEPRECATE_METHOD(func)
+#endif
+   
+/**
+ * DLL IMPORT/EXORT SECTION
+ */
+#if defined(OSSIM_STATIC)
+#  define OSSIMEXPORT
+#  define OSSIMIMPORT
+#  define OSSIMDLLEXPORT
+#  define OSSIM_DLL
+#  define OSSIMDLLEXPORT_DATA(type) type
+#  define OSSIM_DLL_DATA(type) type
+#  define OSSIMDLLEXPORT_CTORFN 
+#elif defined(__MINGW32__) || defined(__CYGWIN__) || defined(_MSC_VER) || defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
+#  define OSSIMEXPORT __declspec(dllexport)
+#  define OSSIMIMPORT __declspec(dllimport)
+#  ifdef OSSIMMAKINGDLL
+#    define OSSIMDLLEXPORT OSSIMEXPORT
+#    define OSSIM_DLL       OSSIMEXPORT
+#    define OSSIMDLLEXPORT_DATA(type) OSSIMEXPORT type
+#    define OSSIM_DLL_DATA(type) OSSIMEXPORT type
+#    define OSSIMDLLEXPORT_CTORFN
+#  else
+#    define OSSIMDLLEXPORT OSSIMIMPORT
+#    define OSSIM_DLL      OSSIMIMPORT
+#    define OSSIMDLLEXPORT_DATA(type) OSSIMIMPORT type
+#    define OSSIM_DLL_DATA(type) OSSIMIMPORT type
+#    define OSSIMDLLEXPORT_CTORFN
+#  endif
+#else /* not #if defined(_MSC_VER) */
+#  define OSSIMEXPORT
+#  define OSSIMIMPORT
+#  define OSSIMDLLEXPORT
+#  define OSSIM_DLL
+#  define OSSIMDLLEXPORT_DATA(type) type
+#  define OSSIM_DLL_DATA(type) type
+#  define OSSIMDLLEXPORT_CTORFN
+#endif /* #if defined(_MSC_VER) */
+   
+/**
+ * Previous DLL import export section.  Commented out, but left just in case.
+ */
+#if 0 /* Comment out ALL this mess! */
+#if defined(_MSC_VER) || defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
+#  if (_MSC_VER >= 1300)	/* MSVC .NET 2003 version */
+#    define OSSIMEXPORT __declspec(dllexport)
+#    define OSSIMIMPORT __declspec(dllimport)
+#  else
+#    define OSSIMEXPORT __declspec(dllexport)
+#    define OSSIMIMPORT __declspec(dllimport)
+#  endif
+#else /* compiler doesn't support __declspec() */
+#   define OSSIMEXPORT
+#   define OSSIMIMPORT
+#endif
+
+#if defined(__WXPM__)
+#  if defined (__WATCOMC__)
+#    define OSSIMEXPORT __declspec(dllexport)
+ /*
+   __declspec(dllimport) prepends __imp to imported symbols. We do NOT
+   want that!
+ */
+#    define OSSIMIMPORT
+#  elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
+#    define OSSIMEXPORT _Export
+#    define OSSIMIMPORT _Export
+#  endif
+#elif defined(__OSSIMMAC__)
+#  ifdef __MWERKS__
+#    define OSSIMEXPORT __declspec(export)
+#    define OSSIMIMPORT __declspec(import)
+#  endif
+#endif
+
+#if defined(_MSC_VER)
+#  pragma warning(disable:4786) /* visual c6.0 compiler */
+#  pragma warning(disable:4251) /* for std:: member variable to have dll interface */
+#  pragma warning(disable:4275) /* for std:: base class to have dll interface */
+#  pragma warning(disable:4800) /* int forcing value to bool */
+#  pragma warning(disable:4244) /* conversion, possible loss of data */
+
+#  ifdef OSSIMSINGLEDLL /* one gigantic dll, all declared export */
+#    ifdef EXPORT_OSMMATRIX
+#      define EXPORT_OSMMATRIX  OSSIMEXPORT
+#    endif
+#    ifndef OSSIMDLLEXPORT
+#      define OSSIMDLLEXPORT    OSSIMEXPORT
+#    endif
+#    ifdef EXPORT_OSMELEV
+#      define EXPORT_OSMELEV    OSSIMEXPORT
+#    endif
+#    ifdef EXPORT_OSMSPTDATA
+#      define EXPORT_OSMSPTDATA OSSIMEXPORT
+#    endif
+#    ifdef EXPORT_ISO8211
+#      define EXPORT_ISO8211    OSSIMEXPORT
+#    endif
+#    ifdef EXPORT_OSMPROJ
+#      define EXPORT_OSMPROJ    OSSIMEXPORT
+#    endif
+#    ifndef EXPORT_OSMIMAGING
+#      define EXPORT_OSMIMAGING OSSIMEXPORT
+#    endif
+#  else /* individual dlls, each with their own import/export symbols */
+#    ifndef EXPORT_OSMMATRIX
+#      ifdef OSMMATRIX_EXPORTS
+#        define EXPORT_OSMMATRIX OSSIMEXPORT
+#      else
+#        define EXPORT_OSMMATRIX OSSIMIMPORT
+#      endif
+#    endif
+#    ifndef OSSIMDLLEXPORT
+#      ifdef OSMBASE_EXPORTS
+#        define OSSIMDLLEXPORT OSSIMEXPORT
+#      else
+#        define OSSIMDLLEXPORT OSSIMIMPORT
+#      endif
+#    endif
+#    ifndef EXPORT_OSMELEV
+#      ifdef OSMELEV_EXPORTS
+#        define EXPORT_OSMELEV OSSIMEXPORT
+#      else
+#        define EXPORT_OSMELEV OSSIMIMPORT
+#      endif
+#    endif
+#    ifndef EXPORT_OSMSPTDATA
+#      ifdef OSMSPTDATA_EXPORTS
+#        define EXPORT_OSMSPTDATA OSSIMEXPORT
+#      else
+#        define EXPORT_OSMSPTDATA OSSIMIMPORT
+#      endif
+#    endif
+#    ifndef EXPORT_OSMPROJ
+#      ifdef OSMPROJ_EXPORTS
+#        define EXPORT_OSMPROJ OSSIMEXPORT
+#      else
+#        define EXPORT_OSMPROJ OSSIMIMPORT
+#      endif
+#    endif
+#    ifndef EXPORT_ISO8211
+#      ifdef ISO8211_EXPORTS
+#        define EXPORT_ISO8211 OSSIMEXPORT
+#      else
+#        define EXPORT_ISO8211 OSSIMIMPORT
+#      endif
+#    endif
+#    ifndef EXPORT_OSMIMAGING
+#      ifdef OSMIMAGING_EXPORTS
+#        define EXPORT_OSMIMAGING OSSIMEXPORT
+#      else
+#        define EXPORT_OSMIMAGING OSSIMIMPORT
+#      endif
+#    endif
+#  endif
+#else /* defined(_MSC_VER) */
+#  ifdef OSSIMMAKINGDLL
+#    define OSSIMDLLEXPORT OSSIMEXPORT
+#    define OSSIM_DLL       OSSIMEXPORT
+#    define OSSIMDLLEXPORT_DATA(type) OSSIMEXPORT type
+#    define OSSIM_DLL_DATA(type) OSSIMEXPORT type
+#    define OSSIMDLLEXPORT_CTORFN
+#  elif defined(OSSIMUSINGDLL)
+#    define OSSIMDLLEXPORT OSSIMIMPORT
+#    define OSSIM_DLL      OSSIMIMPORT
+#    define OSSIMDLLEXPORT_DATA(type) OSSIMIMPORT type
+#    define OSSIM_DLL_DATA(type) OSSIMIMPORT type
+#    define OSSIMDLLEXPORT_CTORFN
+#  else /* not making nor using DLL */
+#    define OSSIMDLLEXPORT
+#    define OSSIM_DLL
+#    define OSSIM_DLL_DATA(type) type
+#    define OSSIMDLLEXPORT_DATA(type) type
+#    define OSSIMDLLEXPORT_CTORFN
+#  endif
+#  define EXPORT_OSMMATRIX  OSSIMDLLEXPORT
+#  define EXPORT_OSMELEV    OSSIMDLLEXPORT
+#  define EXPORT_OSMSPTDATA OSSIMDLLEXPORT
+#  define EXPORT_OSMPROJ    OSSIMDLLEXPORT
+#  define EXPORT_OSMIMAGING OSSIMDLLEXPORT
+#endif
+#endif /* End of commented out "#if 0" old DLL import/export section. */
+
+/*
+  we know that if this is defined all other types are defined
+  since its included from ossimConfig.h
+*/
+typedef char                   ossim_int8;
+typedef unsigned char          ossim_uint8;
+typedef signed char            ossim_sint8;
+
+typedef short                  ossim_int16;
+typedef unsigned short         ossim_uint16;
+typedef signed short           ossim_sint16;
+
+typedef int                    ossim_int32;
+typedef unsigned int           ossim_uint32;
+typedef signed int             ossim_sint32;
+
+typedef float                  ossim_float32;
+typedef double                 ossim_float64;
+
+
+typedef long long              ossim_int64;
+typedef unsigned long long     ossim_uint64;
+typedef signed long long       ossim_sint64;
+   
+typedef ossim_int32            ossimErrorCode;
+
+enum ossimVertexOrdering
+{
+   OSSIM_VERTEX_ORDER_UNKNOWN    = 0,
+   OSSIM_CLOCKWISE_ORDER         = 1,
+   OSSIM_COUNTERCLOCKWISE_ORDER  = 2
+};
+
+//---
+// For histogram builders.  Note that FAST computation mode will not sample all tiles.
+//---   
+enum ossimHistogramMode
+{
+   OSSIM_HISTO_MODE_UNKNOWN = 0,
+   OSSIM_HISTO_MODE_NORMAL  = 1,
+   OSSIM_HISTO_MODE_FAST    = 2
+};
+
+/*
+ Corner coordinates are relative to center (0) of pixel
+ or relative to the upper left of pixel (1).
+*/
+enum ossimPixelType
+{
+   OSSIM_PIXEL_IS_POINT = 0,
+   OSSIM_PIXEL_IS_AREA  = 1
+};
+
+/*
+ Definitions for scalar type identification.
+*/
+enum ossimScalarType
+{
+   OSSIM_SCALAR_UNKNOWN    =  0, 
+   OSSIM_UINT8             =  1, /**< 8 bit unsigned integer        */
+   OSSIM_SINT8             =  2, /**< 8 bit signed integer          */
+   OSSIM_UINT16            =  3, /**< 16 bit unsigned integer       */
+   OSSIM_SINT16            =  4, /**< 16 bit signed integer         */
+   OSSIM_UINT32            =  5, /**< 32 bit unsigned integer       */
+   OSSIM_SINT32            =  6, /**< 32 bit signed integer         */
+   OSSIM_UINT64            =  7, /**< 64 bit unsigned integer       */
+   OSSIM_SINT64            =  8, /**< 64 bit signed integer         */
+   OSSIM_FLOAT32           =  9, /**< 32 bit floating point         */
+   OSSIM_FLOAT64           = 10, /**< 64 bit floating point         */
+   OSSIM_CINT16            = 11, /**< 16 bit complex integer        */
+   OSSIM_CINT32            = 12, /**< 32 bit complex integer        */
+   OSSIM_CFLOAT32          = 13, /**< 32 bit complex floating point */
+   OSSIM_CFLOAT64          = 14, /**< 64 bit complex floating point */
+   OSSIM_NORMALIZED_FLOAT  = 15, /**< 32 bit normalized floating point */
+   OSSIM_NORMALIZED_DOUBLE = 16, /**< 64 bit normalized floating point */
+   OSSIM_UINT11            = 17, /**< 16 bit unsigned integer (11 bits used) */
+   OSSIM_UINT12            = 18, /**< 16 bit unsigned integer (12 bits used) */
+   OSSIM_UINT13            = 19, /**< 16 bit unsigned integer (13 bits used) */
+   OSSIM_UINT14            = 20, /**< 16 bit unsigned integer (14 bits used) */
+   OSSIM_UINT15            = 21, /**< 16 bit unsigned integer (15 bits used) */
+   //---
+   // Below for backward compatibility only.  Please use above enums in
+   // conjunction with null, min, max settings to determine bit depth.
+   //---
+   OSSIM_USHORT11          = 17, /**< 16 bit unsigned integer (11 bits used) */
+   OSSIM_USHORT12          = 18, /**< 16 bit unsigned integer (12 bits used) */
+   OSSIM_USHORT13          = 19, /**< 16 bit unsigned integer (13 bits used) */
+   OSSIM_USHORT14          = 20, /**< 16 bit unsigned integer (14 bits used) */
+   OSSIM_USHORT15          = 21, /**< 16 bit unsigned integer (15 bits used) */
+   OSSIM_UCHAR             = 1,  /**< 8 bit unsigned iteger  */
+   OSSIM_USHORT16          = 3,  /**< 16 bit unsigned iteger */
+   OSSIM_SSHORT16          = 4,  /**< 16 bit signed integer  */
+   OSSIM_FLOAT             = 9,  /**< 32 bit floating point  */
+   OSSIM_DOUBLE            = 10, /**< 64 bit floating point  */
+};
+
+/*
+ Definitions for interleave type identification.
+*/
+enum ossimInterleaveType
+{
+   OSSIM_INTERLEAVE_UNKNOWN = 0,
+   OSSIM_BIL                = 1,  /* band interleaved by line */
+   OSSIM_BIP                = 2,  /* band interleaved by pixel */
+   OSSIM_BSQ                = 3,  /* band sequential */
+   OSSIM_BSQ_MULTI_FILE     = 4   /* band sequential in separate files */
+};
+
+/*
+ Definitions for origin location.
+*/
+enum ossimOriginLocationType
+{
+   OSSIM_ORIGIN_LOCATION_UNKNOWN = 0,
+   OSSIM_CENTER                  = 1,
+   OSSIM_UPPER_LEFT              = 2,
+   OSSIM_UPPER_LEFT_CENTER       = 3,
+   OSSIM_LOWER_LEFT              = 4,
+   OSSIM_LOWER_LEFT_CENTER       = 5
+};
+
+/*
+ Definitions for coordinate system type.
+*/
+enum ossimCoordinateSystemType
+{
+   OSSIM_COORDINATE_SYSTEM_UNKNOWN = 0,
+   OSSIM_IMAGE_SPACE               = 1,
+   OSSIM_GEOGRAPHIC_SPACE          = 2,
+   OSSIM_PROJECTED_SPACE           = 3,
+   OSSIM_GEOCENTRIC_SPACE          = 4
+};
+
+/*
+ Definitions for coordinate system orientation mode .
+*/
+enum ossimCoordSysOrientMode
+{
+   OSSIM_LEFT_HANDED  = 0,
+   OSSIM_RIGHT_HANDED = 1
+};
+
+/*
+ Definitions for unit type.
+*/
+enum ossimUnitType
+{
+   OSSIM_UNIT_UNKNOWN    = 0,
+   OSSIM_METERS          = 1,
+   OSSIM_FEET            = 2,
+   OSSIM_US_SURVEY_FEET  = 3,
+   OSSIM_DEGREES         = 4,
+   OSSIM_RADIANS         = 5,
+   OSSIM_NAUTICAL_MILES  = 6,
+   OSSIM_SECONDS         = 7,
+   OSSIM_MINUTES         = 8,
+   OSSIM_PIXEL           = 9,
+   OSSIM_MILES           = 10,
+   OSSIM_MILLIMETERS     = 11,
+   OSSIM_MICRONS         = 12,
+   OSSIM_CENTIMETERS     = 13,
+   OSSIM_YARDS           = 14,
+   OSSIM_INCHES          = 15,
+   OSSIM_KILOMETERS      = 16
+};
+
+/** Definitions for data object status. */
+enum ossimDataObjectStatus
+{
+   OSSIM_STATUS_UNKNOWN = 0,
+   OSSIM_NULL           = 1, // not initialized
+   OSSIM_EMPTY          = 2, // initialized but blank or empty
+   OSSIM_PARTIAL        = 3, // contains some null/invalid values
+   OSSIM_FULL           = 4  // all valid data
+};
+
+/** Definitions for image type identification. */
+enum ossimImageType
+{
+   OSSIM_IMAGE_TYPE_UNKNOWN       = 0,
+   OSSIM_TIFF_STRIP               = 1,
+   OSSIM_TIFF_STRIP_BAND_SEPARATE = 2,
+   OSSIM_TIFF_TILED               = 3,
+   OSSIM_TIFF_TILED_BAND_SEPARATE = 4,
+   OSSIM_GENERAL_RASTER_BIP       = 5,
+   OSSIM_GENERAL_RASTER_BIL       = 6,
+   OSSIM_GENERAL_RASTER_BSQ       = 7,
+   OSSIM_JPEG                     = 8,
+   OSSIM_PDF                      = 9
+};
+
+/** Definitions for metadata type identification. */
+enum ossimMetadataType
+{
+   OSSIM_META_UNKNOWN   = 0,
+   OSSIM_META_TFW       = 1,
+   OSSIM_META_JGW       = 2,
+   OSSIM_META_GEOM      = 3,
+   OSSIM_META_README    = 4,
+   OSSIM_META_FGDC      = 5,
+   OSSIM_META_ENVI      = 6
+};
+
+enum ossimByteOrder
+{
+   OSSIM_LITTLE_ENDIAN = 0,
+   OSSIM_BIG_ENDIAN    = 1
+};
+
+enum ossimCompareType
+{
+   OSSIM_COMPARE_FULL=0,      // compares full traversal if supported.  Not just instance pointers
+   OSSIM_COMPARE_IMMEDIATE=1  // Only immediate attributes are compared
+};
+
+#ifndef FLT_EPSILON
+#  define FLT_EPSILON __FLT_EPSILON__
+#endif
+   
+#ifndef DBL_EPSILON
+#  define DBL_EPSILON __DBL_EPSILON__
+#endif
+   
+#ifndef M_PI
+#  define M_PI             ((ossim_float64)3.141592653589793238462643)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI           ((ossim_float64)(2.0 * M_PI))
+#endif
+#ifndef DEG_PER_RAD
+#  define DEG_PER_RAD      ((ossim_float64)(180.0/M_PI))
+#endif
+#ifndef SEC_PER_RAD
+#  define SEC_PER_RAD      ((ossim_float64)206264.8062471)
+#endif
+#ifndef RAD_PER_DEG
+#  define RAD_PER_DEG      ((ossim_float64)(M_PI/180.0))
+#endif
+#ifndef MTRS_PER_FT
+#  define MTRS_PER_FT      ((ossim_float64)0.3048)
+#endif
+#ifndef FT_PER_MTRS
+#  define FT_PER_MTRS      ((ossim_float64)3.280839895013122)
+#endif
+#ifndef FT_PER_MILE
+#  define FT_PER_MILE      ((ossim_float64)5280.0)
+#endif
+#ifndef SQRT_TWO_PI
+#  define SQRT_TWO_PI      ((ossim_float64)2.50662827463100050242)
+#endif
+#ifndef SQRT_TWO_PI_DIV2
+#  define SQRT_TWO_PI_DIV2 ((ossim_float64)7.07106781186547524401E-1)
+#endif
+
+#define TIFFTAG_OSSIM_METADATA 50955
+#define OSSIM_DEFAULT_TILE_HEIGHT  ((ossim_int32)64)
+#define OSSIM_DEFAULT_TILE_WIDTH   ((ossim_int32)64)
+
+/*
+ NOTE Reference for U.S. feet value:
+ U.S.G.S. "Map Projections - A Working Manual"
+ USGS Professional paper 1395 page 51
+*/
+#ifndef US_METERS_PER_FT
+#  define  US_METERS_PER_FT ((ossim_float64)0.3048006096)
+#endif
+
+//---
+// Integer nan kept for ossimIpt.
+// This should be the most negative int: -2147483648
+//---
+#define OSSIM_INT_NAN ((ossim_sint32)0x80000000)
+
+#define OSSIM_DEFAULT_NULL_PIX_UCHAR  ((ossim_uint8)0)
+#define OSSIM_DEFAULT_MIN_PIX_UCHAR   ((ossim_uint8)1)
+#define OSSIM_DEFAULT_MAX_PIX_UCHAR   ((ossim_uint8)255)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT8  ((ossim_uint8)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT8   ((ossim_uint8)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT8   ((ossim_uint8)255)
+
+#define OSSIM_DEFAULT_NULL_PIX_SINT8  ((ossim_sint8)0x80)
+#define OSSIM_DEFAULT_MIN_PIX_SINT8   ((ossim_sint8)0x81)
+#define OSSIM_DEFAULT_MAX_PIX_SINT8   ((ossim_sint8)0x7F)
+
+#define OSSIM_DEFAULT_NULL_PIX_SINT16 ((ossim_sint16)0x8000)
+#define OSSIM_DEFAULT_MIN_PIX_SINT16  ((ossim_sint16)0x8001)
+#define OSSIM_DEFAULT_MAX_PIX_SINT16  ((ossim_sint16)0x7FFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT16 ((ossim_uint16)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT16  ((ossim_uint16)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT16  ((ossim_uint16)0xFFFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_SINT32 ((ossim_sint32)0x80000000)
+#define OSSIM_DEFAULT_MIN_PIX_SINT32  ((ossim_sint32)0x80000001)
+#define OSSIM_DEFAULT_MAX_PIX_SINT32  ((ossim_sint32)0x7FFFFFFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT32 ((ossim_uint32)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT32  ((ossim_uint32)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT32  ((ossim_uint32)0xFFFFFFFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_SINT64 ((ossim_sint32)0x8000000000000000)
+#define OSSIM_DEFAULT_MIN_PIX_SINT64  ((ossim_sint32)0x8000000000000001)
+#define OSSIM_DEFAULT_MAX_PIX_SINT64  ((ossim_sint32)0x7FFFFFFFFFFFFFFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT64 ((ossim_uint32)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT64  ((ossim_uint32)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT64  ((ossim_uint32)0xFFFFFFFFFFFFFFFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT11 ((ossim_uint16)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT11  ((ossim_uint16)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT11  ((ossim_uint16)0x07FF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT12 ((ossim_uint16)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT12  ((ossim_uint16)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT12  ((ossim_uint16)0x0FFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT13 ((ossim_uint16)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT13  ((ossim_uint16)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT13  ((ossim_uint16)0x1FFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT14 ((ossim_uint16)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT14  ((ossim_uint16)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT14  ((ossim_uint16)0x3FFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_UINT15 ((ossim_uint16)0)
+#define OSSIM_DEFAULT_MIN_PIX_UINT15  ((ossim_uint16)1)
+#define OSSIM_DEFAULT_MAX_PIX_UINT15  ((ossim_uint16)0x7FFF)
+
+#define OSSIM_DEFAULT_NULL_PIX_FLOAT  ((ossim_float32)-1.0/FLT_EPSILON)
+#define OSSIM_DEFAULT_MIN_PIX_FLOAT   ((ossim_float32)((-1.0/FLT_EPSILON) + 1))
+#define OSSIM_DEFAULT_MAX_PIX_FLOAT   ((ossim_float32)((1.0/FLT_EPSILON)))
+
+#define OSSIM_DEFAULT_NULL_PIX_NORM_FLOAT  ((ossim_float32)0)
+#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT   ((ossim_float32)((2*FLT_EPSILON)))
+#define OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT   ((ossim_float32)1.0)
+
+#define OSSIM_DEFAULT_NULL_PIX_DOUBLE      ((ossim_float64)-1.0/DBL_EPSILON)
+#define OSSIM_DEFAULT_MIN_PIX_DOUBLE       ((ossim_float64)((-1.0/DBL_EPSILON) + 1))
+#define OSSIM_DEFAULT_MAX_PIX_DOUBLE       ((ossim_float64)((1.0/DBL_EPSILON)))
+
+#define OSSIM_DEFAULT_NULL_PIX_NORM_DOUBLE ((ossim_float64)0)
+#define OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE  ((ossim_float64)((2*DBL_EPSILON)))
+#define OSSIM_DEFAULT_MAX_PIX_NORM_DOUBLE  ((ossim_float64)(1.0))
+
+#define OSSIM_DEFAULT_MEAN_SEA_LEVEL ((ossim_float64)0.0)
+
+#endif /* #ifndef ossimConstants_HEADER */
diff --git a/include/ossim/base/ossimContainerEvent.h b/include/ossim/base/ossimContainerEvent.h
new file mode 100644
index 0000000..d7485c3
--- /dev/null
+++ b/include/ossim/base/ossimContainerEvent.h
@@ -0,0 +1,45 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimContainerEvent.h 19966 2011-08-16 18:12:56Z gpotts $
+#ifndef ossimContainerEvent_HEADER
+#define ossimContainerEvent_HEADER
+#include <ossim/base/ossimEvent.h>
+#include <ossim/base/ossimEventIds.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <vector>
+
+class OSSIMDLLEXPORT ossimContainerEvent : public ossimEvent
+{
+public:
+
+   typedef std::vector<ossimRefPtr<ossimObject> > ObjectList;
+   
+   /** constuctor */
+   ossimContainerEvent(ossimObject* obj1,// the object firing the event.
+                       long id);
+
+   void setObjectList(ossimObject* obj);
+   void setObjectList(ObjectList& objects);
+   ObjectList& getObjectList(){return m_objectList;}
+   const ObjectList& getObjectList()const{return m_objectList;}
+   
+protected:
+   
+   /*!
+    * This is the object associated with the container event.
+    * if this was an add then it s the object added to the
+    * container.
+    */
+      ObjectList m_objectList;
+
+TYPE_DATA
+};
+
+#endif /* end of: "#ifndef ossimContainerEvent_HEADER" */
diff --git a/ossim/include/ossim/base/ossimContainerProperty.h b/include/ossim/base/ossimContainerProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimContainerProperty.h
rename to include/ossim/base/ossimContainerProperty.h
diff --git a/ossim/include/ossim/base/ossimCplUtil.h b/include/ossim/base/ossimCplUtil.h
similarity index 100%
rename from ossim/include/ossim/base/ossimCplUtil.h
rename to include/ossim/base/ossimCplUtil.h
diff --git a/ossim/include/ossim/base/ossimCsvFile.h b/include/ossim/base/ossimCsvFile.h
similarity index 100%
rename from ossim/include/ossim/base/ossimCsvFile.h
rename to include/ossim/base/ossimCsvFile.h
diff --git a/ossim/include/ossim/base/ossimCustomEditorWindow.h b/include/ossim/base/ossimCustomEditorWindow.h
similarity index 100%
rename from ossim/include/ossim/base/ossimCustomEditorWindow.h
rename to include/ossim/base/ossimCustomEditorWindow.h
diff --git a/ossim/include/ossim/base/ossimCustomEditorWindowFactoryBase.h b/include/ossim/base/ossimCustomEditorWindowFactoryBase.h
similarity index 100%
rename from ossim/include/ossim/base/ossimCustomEditorWindowFactoryBase.h
rename to include/ossim/base/ossimCustomEditorWindowFactoryBase.h
diff --git a/ossim/include/ossim/base/ossimCustomEditorWindowRegistry.h b/include/ossim/base/ossimCustomEditorWindowRegistry.h
similarity index 100%
rename from ossim/include/ossim/base/ossimCustomEditorWindowRegistry.h
rename to include/ossim/base/ossimCustomEditorWindowRegistry.h
diff --git a/include/ossim/base/ossimDataObject.h b/include/ossim/base/ossimDataObject.h
new file mode 100644
index 0000000..b2102d3
--- /dev/null
+++ b/include/ossim/base/ossimDataObject.h
@@ -0,0 +1,115 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimDataObject.h 23505 2015-09-08 19:04:19Z dburken $
+
+#ifndef ossimDataObject_HEADER
+#define ossimDataObject_HEADER
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDpt3d.h>
+
+class ossimSource;
+
+class OSSIMDLLEXPORT ossimDataObject : public ossimObject
+{
+public:
+   ossimDataObject(ossimSource* source=0,
+                   ossimDataObjectStatus status=OSSIM_STATUS_UNKNOWN);
+   
+   ossimDataObject(const ossimDataObject& rhs);
+   virtual ~ossimDataObject();
+
+
+
+   virtual ossim_uint32 getHashId()const=0;
+   
+   /**
+    * Sets the owner of this Data object.
+    */
+   virtual void setOwner(ossimSource* aSource);
+
+   virtual ossimSource* getOwner();
+
+   virtual const ossimSource* getOwner() const;
+
+   /**
+    * Full list found in ossimConstants.h
+    *
+    * OSSIM_STATUS_UNKNOWN
+    * OSSIM_NULL            Null data.  The buffers are never allocated
+    * OSSIM_EMPTY           Allocated data but its empty.  Most of the
+    *                       time this will be the default for an initialized
+    *                       data object.
+    * OSSIM_PARTIAL         Says that some of the object is empty and is only
+    *                       partially full
+    * OSSIM_FULL            This data is completey full
+    */
+   virtual void  setDataObjectStatus(ossimDataObjectStatus status) const;
+
+   /**
+    * @return Returns enumerated status:
+    * OSSIM_STATUS_UNKNOWN = 0
+    * OSSIM_NULL           = 1
+    * OSSIM_EMPTY          = 2
+    * OSSIM_PARTIAL        = 3
+    * OSSIM_FULL           = 4
+    */
+   virtual ossimDataObjectStatus getDataObjectStatus() const;
+
+   /**
+    * @return Returns the status as a string, like "OSSIM_NULL".
+    */
+   virtual ossimString getDataObjectStatusString() const;
+
+   virtual ossim_uint32 getObjectSizeInBytes()const;
+
+   virtual ossim_uint32 getDataSizeInBytes()const=0;
+
+   /**
+    * This is to be overriden in the derived classes so they can check
+    * If their data is null.
+    */
+   virtual bool isInitialize() const;
+
+   /**
+    * Will allow derived classes to initialize their buffers.  This class
+    * does nothing with this and reset any internal attributes.
+    */
+   virtual void initialize()=0;
+   
+   virtual void assign(const ossimDataObject* rhs);
+
+   virtual const ossimDataObject* operator =(const ossimDataObject* rhs);
+   
+   virtual const ossimDataObject& operator=(const ossimDataObject& rhs);
+
+   virtual bool operator==(const ossimDataObject& rhs) const;
+   virtual bool operator!=(const ossimDataObject& rhs) const;
+
+   virtual std::ostream& print(std::ostream& out) const;
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+protected:
+
+   //***
+   // Note:  This object is not responsible for deletion of the ossimSource*
+   //        "theSource".  It is simply a hook to his owner for things
+   //        like unregister and so forth...
+   //***
+   ossimSource*                      theOwner;
+   mutable ossimDataObjectStatus     theDataObjectStatus;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/base/ossimDate.h b/include/ossim/base/ossimDate.h
new file mode 100644
index 0000000..fe25729
--- /dev/null
+++ b/include/ossim/base/ossimDate.h
@@ -0,0 +1,279 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimDate.h 22765 2014-05-08 15:20:10Z gpotts $
+#ifndef ossimDate_HEADER
+#define ossimDate_HEADER
+#include <ctime>
+#include <iosfwd>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <OpenThreads/Mutex>
+#include <OpenThreads/ScopedLock>
+
+class OSSIM_DLL ossimLocalTm : public std::tm
+{
+public:
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimLocalTm& src);
+   friend OSSIM_DLL int operator== (const ossimLocalTm& t1,
+                                    const ossimLocalTm& src);
+   friend OSSIM_DLL int operator!= (const ossimLocalTm& t1,
+                                    const ossimLocalTm& src);
+   friend OSSIM_DLL int operator<  (const ossimLocalTm& t1,
+                                    const ossimLocalTm& src);
+   friend OSSIM_DLL int operator<= (const ossimLocalTm& t1,
+                                    const ossimLocalTm& src);
+   friend OSSIM_DLL int operator>  (const ossimLocalTm& t1,
+                                    const ossimLocalTm& src);
+   friend OSSIM_DLL int operator>= (const ossimLocalTm& t1,
+                                    const ossimLocalTm& src);
+   
+   ossimLocalTm (time_t t=0);     // Set to time, 0 is magic for 'now'
+   ossimLocalTm (tm const & t); // Copy constructor
+   ossimLocalTm (const ossimLocalTm& t); // Copy constructor
+   
+   ossimLocalTm & operator= (tm const & t);            // Assignment
+   ossimLocalTm & operator= (const ossimLocalTm & t);            // Assignment
+   operator time_t (void) const;        // Conversion operator
+   
+   int isValid (void) const;             // Test for validity
+   
+   void now();
+   int compare (ossimLocalTm const & t) const;      // Compare times
+   int compare (std::time_t const tt) const;       // Compare times
+   
+   enum ossimLocalTmFormat     // Date format flags
+   {
+      ossimLocalTmFormatYear          = (int)0x0001,            // Print year
+      ossimLocalTmFormatYearShort     = (int)0x0002, // Print last two digits
+      ossimLocalTmFormatPadYear       = (int)0x0004,    // Pad year to 2 or 4
+      ossimLocalTmFormatZeroYear      = (int)0x0008,        // Zero fill year
+      ossimLocalTmFormatMonth         = (int)0x0010,           // Print month
+      ossimLocalTmFormatMonText       = (int)0x0020,   // Print month in text
+      ossimLocalTmFormatPadMon        = (int)0x0040, // Pad to 2 (trunc to 3)
+      ossimLocalTmFormatZeroMon       = (int)0x0080,       // Zero fill month
+      ossimLocalTmFormatDay           = (int)0x0100,            // Print date
+      ossimLocalTmFormatDayOfWeek     = (int)0x0200,     // Print day of week
+      ossimLocalTmFormatPadDay        = (int)0x0400,         // Pad date to 2
+      ossimLocalTmFormatZeroDay       = (int)0x0800,         // Zero fill day
+      ossimLocalTmFormatDMY           = (int)0x0111, // Print date, mth, year
+      ossimLocalTmFormatPadDMY        = (int)0x0444,         // Pad all three
+      ossimLocalTmFormatZeroDMY       = (int)0x0888,   // Zero fill all three
+      ossimLocalTmFormatYearFirst     = (int)0x1000,      // Print year first
+      ossimLocalTmFormatMonFirst      = (int)0x2000,     // Print month first
+      ossimLocalTmFormatSepChar       = (int)0x4000,// Separate fields datech
+      ossimLocalTmFormatSepSpace      = (int)0x8000,  // Separate fields space
+      ossimLocalTmFormatInternational = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatMonText|ossimLocalTmFormatPadMon|
+                                              ossimLocalTmFormatSepSpace),
+      ossimLocalTmFormatIntlShort     = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatMonText|ossimLocalTmFormatPadMon|
+                                              ossimLocalTmFormatSepSpace|ossimLocalTmFormatYearShort),
+      ossimLocalTmFormatUsa           = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatMonFirst|ossimLocalTmFormatPadDMY|
+                                              ossimLocalTmFormatZeroDMY|ossimLocalTmFormatYearShort|ossimLocalTmFormatSepChar),
+      ossimLocalTmFormatEnglish       = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatYearShort|ossimLocalTmFormatPadDMY|
+                                              ossimLocalTmFormatZeroDMY|ossimLocalTmFormatSepChar),
+      ossimLocalTmFormatJapanese      = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatYearFirst|ossimLocalTmFormatPadDMY|
+                                              ossimLocalTmFormatZeroDMY|ossimLocalTmFormatYearShort|ossimLocalTmFormatMonFirst|
+                                              ossimLocalTmFormatSepChar),
+      ossimLocalTmFormatFull          = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatDayOfWeek|ossimLocalTmFormatMonText|
+                                              ossimLocalTmFormatSepSpace)
+   };
+   
+   enum ossimTimeFormat  // Time format (nb: time zones not implemented)
+   {
+      ossimTimeFormatSecs          = (int)0x0001,         // Print seconds
+      ossimTimeFormatZeroSecs      = (int)0x0002,     // Zero fill seconds
+      ossimTimeFormatPadSecs       = (int)0x0004,      // Pad seconds to 2
+      ossimTimeFormatSecsAll       = (int)0x0007,
+      ossimTimeFormatTimeZone      = (int)0x0008,        // Print timezone
+      ossimTimeFormatMins          = (int)0x0010,         // Print minutes
+      ossimTimeFormatZeroMins      = (int)0x0020,     // Zero fill minutes
+      ossimTimeFormatPadMins       = (int)0x0040,      // Pad minutes to 2
+      ossimTimeFormatMinsAll       = (int)0x0070,
+      ossimTimeFormatTZNumeric     = (int)0x0080,      // Print numeric TZ
+      ossimTimeFormatHour          = (int)0x0100,            // Print hour
+      ossimTimeFormatZeroHour      = (int)0x0200,        // Zero fill hour
+      ossimTimeFormatPadHour       = (int)0x0400,  // Pad hour to 2 digits
+      ossimTimeFormatHourAll       = (int)0x0700,
+      ossimTimeFormat24hour        = (int)0x0800,          // 24hour clock
+      ossimTimeFormatSepChar       = (int)0x1000, // Separate field timech
+      ossimTimeFormatSepSpace      = (int)0x2000, // Separate fields space
+      ossimTimeFormatSepAbbrev     = (int)0x4000,     // Add abbreviations
+      ossimTimeFormatAmPm          = (int)0x8000,       // Add 'am' or 'pm'
+      ossimTimeFormatInternational = (int)(ossimTimeFormatHourAll|ossimTimeFormatMinsAll|ossimTimeFormatSecsAll|
+                                           ossimTimeFormat24hour|ossimTimeFormatSepChar),
+      ossimTimeFormatShortTime     = (int)(ossimTimeFormatHourAll|ossimTimeFormatMinsAll|ossimTimeFormat24hour|
+                                           ossimTimeFormatSepChar),
+      ossimTimeFormatClockTime     = (int)(ossimTimeFormatHour|ossimTimeFormatPadHour|ossimTimeFormatMinsAll|
+                                           ossimTimeFormatAmPm|ossimTimeFormatSepChar),
+      ossimTimeFormatLongTime      = (int)(ossimTimeFormatHour|ossimTimeFormatPadHour|ossimTimeFormatMinsAll|
+                                           ossimTimeFormatSecsAll|ossimTimeFormatSepAbbrev|ossimTimeFormatSepSpace),
+      ossimTimeFormatMillitary     = (int)(ossimTimeFormatHourAll|ossimTimeFormatMinsAll|ossimTimeFormat24hour)
+   };
+   
+   
+   static char timech;    // Character used for time separator
+   static char datech;    // Character used for date separator
+   static int datefmt;                  // Default date format
+   static int timefmt;                  // Default time format
+   
+   // Output methods
+   std::ostream& print(std::ostream & os,
+                       int df =datefmt,
+                       int tf =timefmt) const;
+   std::ostream& printTime(std::ostream & os, int f =timefmt) const;
+   std::ostream& printDate(std::ostream & os, int f =datefmt) const;
+   
+   /**
+    * @brief method to dump all the data members.  This is the tm struct +
+    * the theFractionalSecond from this class.
+    *
+    * @note: tm_gmtoff and  tm_zone from tm struct are not printed as they
+    * are not standard.
+    *
+    * @param os Stream to dump to.
+    *
+    * @return stream.
+    */
+   std::ostream& dump(std::ostream& os) const;
+   
+   
+   int getYear()const;
+   
+   int getShortYear()const;
+   
+   /*!
+    * This is one based i.e. values are returned between 1-12
+    */
+   int getMonth()const;
+   
+   /*!
+    * returns the day 1-31
+    */
+   int getDay()const;
+   double getJulian()const;
+   double getModifiedJulian()const;
+   
+   ossimLocalTm& setDay(int day);
+   /*!
+    * The month is a number bewteen 1 and 12.  We will shift it to the internal
+    * representation
+    */
+   ossimLocalTm& setMonth(int month);
+   ossimLocalTm& setYear(int year);
+   ossimLocalTm& setDateFromJulian(double jd);
+   ossimLocalTm& setDateFromModifiedJulian(double mjd);
+   
+   void setFractionalDay(double fractionalDay);
+   static void extractHmsFromFractionalDay(double fractionalDay,
+                                           int &h,
+                                           int &m,
+                                           int &s,
+                                           double& fractionalSecond);
+   int getHour()const;
+   int getMin()const;
+   int getSec()const;
+   double getFractionalSecond()const;
+   ossimLocalTm& setHour(int h);
+   ossimLocalTm& setMin(int m);
+   ossimLocalTm& setSec(int s);
+   ossimLocalTm& setFloatSec(double s);
+   ossimLocalTm& setFractionalSecond(double fractS);
+   
+   /**
+    * getTicks() will call getEpoc.  This is te number of microseconds passed
+    * since (00:00:00 UTC, January 1, 1970)
+    */ 
+   time_t getTicks()const;
+   time_t getEpoc()const;
+   
+   void addSeconds(ossim_float64 n);
+   void addMinutes(ossim_float64 n);
+   void addHours(ossim_float64 n);
+   void addDays(ossim_float64 n);
+   
+   ossim_float64 deltaInSeconds(const ossimLocalTm& d)const;
+   ossim_float64 deltaInMinutes(const ossimLocalTm& d)const;
+   ossim_float64 delatInHours(const ossimLocalTm& d)const;
+   ossim_float64 deltaInDays(const ossimLocalTm& d)const;
+   
+   ossimLocalTm convertToGmt()const;
+   /**
+    * Will not adjust for timezone.  The passed in value is based on seconds.
+    */ 
+   void setTimeNoAdjustmentGivenEpoc(time_t ticks);
+   
+   /**
+    * Will adjust for timezone. The passed in value is based on seconds.
+    */ 
+   void setTimeGivenEpoc(time_t ticks);
+   
+   bool setIso8601(const std::string& timeString, bool shiftToGmtOffsetZero=false);
+   
+   ossimRefPtr<ossimXmlNode> saveXml()const;
+   bool loadXml(ossimRefPtr<ossimXmlNode> dateNode);
+   
+protected:
+   // Time suffix
+   void tSfx(std::ostream & os, int fmt, char ch) const;
+   // Time field formatters
+   void pHour(std::ostream & os, int fmt) const;
+   void pMins(std::ostream & os, int fmt) const;
+   void pSecs(std::ostream & os, int fmt) const;
+   // Date suffix
+   void dSfx(std::ostream & os, int fmt) const;
+   // Date field formatters
+   void pDate(std::ostream & os, int fmt) const;
+   void pMonth(std::ostream & os, int fmt) const;
+   void pYear(std::ostream & os, int fmt) const;
+   
+   void setTimezoneOffsetFromGmt();
+   static OpenThreads::Mutex m_mutex;
+   double theFractionalSecond;
+   mutable int m_timezoneOffset;
+};
+
+
+class OSSIM_DLL ossimDate : public ossimLocalTm
+{
+public:
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimDate& src);
+   
+   ossimDate(int datefmt =ossimLocalTm::datefmt);
+   ossimDate (ossimLocalTm const & t,
+              int dtfmt =ossimLocalTm::datefmt);
+   ossimDate (time_t t, int dtfmt =ossimLocalTm::datefmt);
+   ossimDate(int month, int day, int year,int dtfmt=ossimLocalTm::datefmt);
+   
+   int fmt(int f);
+   int fmt(void) const;
+   
+   std::ostream & print (std::ostream & os) const;
+   
+private:
+   int _fmt;
+};
+
+class OSSIM_DLL ossimTime :public ossimLocalTm
+{
+public:
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimTime& src);
+   ossimTime(int tmfmt =ossimLocalTm::timefmt);
+   ossimTime (ossimTime const & t,
+              int tmfmt =ossimLocalTm::timefmt);
+   ossimTime (time_t t, int tmfmt =ossimLocalTm::timefmt);
+   
+   int fmt (int f);
+   int fmt (void) const;
+   
+   std::ostream& print (std::ostream & os) const;
+   
+private:
+   int _fmt;   
+};
+#endif
diff --git a/include/ossim/base/ossimDateProperty.h b/include/ossim/base/ossimDateProperty.h
new file mode 100644
index 0000000..211563f
--- /dev/null
+++ b/include/ossim/base/ossimDateProperty.h
@@ -0,0 +1,37 @@
+//*******************************************************************
+//
+// LICENSE: LGPL see top level license.txt
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimDateProperty.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimDateProperty_HEADER
+#define ossimDateProperty_HEADER
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimDate.h>
+
+class OSSIM_DLL ossimDateProperty : public ossimProperty
+{
+public:
+   ossimDateProperty();
+   ossimDateProperty(const ossimString& name,
+                     const ossimString& value);
+   ossimDateProperty(const ossimString& name,
+                     const ossimLocalTm& value);
+   ossimDateProperty(const ossimDateProperty& src);
+   virtual ossimObject* dup()const;
+   
+   void setDate(const ossimLocalTm& localTm);
+   const ossimLocalTm& getDate()const;
+   virtual bool setValue(const ossimString& value);
+   virtual void valueToString(ossimString& valueResult)const;
+   virtual const ossimProperty& assign(const ossimProperty& rhs);
+   
+protected:
+   ossimLocalTm theValue;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimDatum.h b/include/ossim/base/ossimDatum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDatum.h
rename to include/ossim/base/ossimDatum.h
diff --git a/ossim/include/ossim/base/ossimDatumFactory.h b/include/ossim/base/ossimDatumFactory.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDatumFactory.h
rename to include/ossim/base/ossimDatumFactory.h
diff --git a/ossim/include/ossim/base/ossimDatumFactoryInterface.h b/include/ossim/base/ossimDatumFactoryInterface.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDatumFactoryInterface.h
rename to include/ossim/base/ossimDatumFactoryInterface.h
diff --git a/ossim/include/ossim/base/ossimDatumFactoryRegistry.h b/include/ossim/base/ossimDatumFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDatumFactoryRegistry.h
rename to include/ossim/base/ossimDatumFactoryRegistry.h
diff --git a/include/ossim/base/ossimDblGrid.h b/include/ossim/base/ossimDblGrid.h
new file mode 100644
index 0000000..3961fb3
--- /dev/null
+++ b/include/ossim/base/ossimDblGrid.h
@@ -0,0 +1,233 @@
+//*****************************************************************************
+//                                   O S S I M
+//
+// FILE: ossimDblGrid.h
+//
+// License:  See top level LICENSE.txt file.
+//
+// AUTHOR:  Oscar Kramer
+//
+// DESCRIPTION:
+//   Contains declaration of class ossimDblGrid. This object class maintains
+//   a regular grid of floating point (double) values. Access methods to the
+//   grid include interpolation between grid nodes. Capability is included
+//   to address the grid in an arbitrary, floating-point u, v coordinate
+//   system which is related to the integer grid x, y system by scale and
+//   offset:
+//
+//          u = Sx*(x + Xo),   v = Sy*(y + Y0)
+//
+//   where Xo, Yo is the origin of the U/V cood system. Sx, Sy are the scale
+//   relations. For example, if the grid is being used to hold a grid of
+//   elevation posts, then the origin will be the SW corner post ground point,
+//   and the scale will be derived from the post spacing. Both origin and
+//   spacing are specified to the constructor.
+//
+//*****************************************************************************
+//  $Id: ossimDblGrid.h 20044 2011-09-06 15:02:43Z oscarkramer $
+
+#ifndef ossimDblGrid_HEADER
+#define ossimDblGrid_HEADER
+
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimCommon.h>
+
+class ossimDrect;
+
+/*!****************************************************************************
+ *
+ * CLASS:  ossimDblGrid
+ *
+ *****************************************************************************/
+class OSSIMDLLEXPORT ossimDblGrid 
+{
+public:
+   /*!
+    * Default Constructor.
+    */
+   ossimDblGrid ();
+
+   /*!
+    * Copy Constructor.
+    */
+   ossimDblGrid (const ossimDblGrid& source_to_copy);
+
+   /*!
+    * Constructs given a U/V origin and spacing, and a grid size.
+    */
+   ossimDblGrid (const ossimIpt&  size, 
+                 const ossimDpt&  origin,
+                 const ossimDpt&  spacing,
+                 double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
+
+   /*!
+    * Constructs given a rectangle in U/V space and grid spacing. The origin is
+    * taken as the upper-left corner of the rectangle. The lower-rightmost grid
+    * point may not coincide with the rectangles LR corner if the side is not
+    * evenly divisible by the corresponding spacing.
+    */
+   ossimDblGrid (const ossimDrect&  uv_rect, 
+                 const ossimDpt&    spacing,
+                 double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
+
+   ~ossimDblGrid ();
+
+   /*!
+    * When constructed with default, permits initialization afterward.
+    */
+   void         initialize(const ossimIpt&  size, 
+                           const ossimDpt&  origin,
+                           const ossimDpt&  spacing,
+                           double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE );
+   void         initialize(const ossimDrect&  uv_rect, 
+                           const ossimDpt&    spacing,
+                           double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
+   /*!
+   * Enables/disables extrapolation functionality. If extrapolation is enabled, then calls to 
+   * operator() will handle points outside of the grid. 
+   */
+   void enableExtrapolation(bool arg=true) { theExtrapIsEnabled = arg;}
+
+   void deallocate();
+   /*!
+    * Fills the current grid with the value specified.
+    */
+   void         fill(double fill_value);
+
+   /*!
+    * Fills the current grid with null values.
+    */
+   void         clear() { fill(theNullValue); }
+   
+   /*!
+    * Access individual node value by node index in the X/Y (grid) coord system.
+    */
+   void         setNode (const ossimIpt& p,
+                         const double& value)   { setNode(p.x, p.y, value); }
+   void         setNode (int x, int y, const double&  value);
+
+   double       getNode (const ossimIpt& p) const { return getNode(p.x, p.y); }
+   double       getNode (int x, int y) const;
+
+   /*!
+    * Sets the node nearest the U,V point specified to the value given. This is
+    * different from setNode() in that the UV coordinate system is used to
+    * address a node instead of an XY grid point.
+    */
+   void         setNearestNode(const ossimDpt& uv_point,
+                               const double&   value);
+   
+   /*!
+    * This method performs a resampling of the defined grid nodes in order to
+    * compute interpolated values for those uninitialized nodes. This is
+    * necessary when only a subset of nodes are available for initializing the
+    * grid.
+    */
+   void interpolateNullValuedNodes(const double& decay_rate=10.0);
+
+   /*!
+    * Passes the grid data through a convolution filter given the kernel array.
+    * The grid must not contain any NULL nodes as these are treated as valid
+    * quantities. The kernel sizes should be odd numbers. To avoid shrinking
+    * the grid by the kernel radius, the edge nodes outside of the filter's
+    * reach are computed by extrapolation. X is the contiguous
+    * axis in the kernel array, i.e., kernel(x,y) = kernel[y*size_x + x].
+    */
+   void filter(int size_x, int size_y, double* kernel);
+   
+   /*!
+    * Interpolate between grid nodes given arbitrary u/v coord system:
+    */
+   enum InterpType
+   {
+      BILINEAR
+   };
+   void  setInterpolationType (InterpType interp);
+
+   enum DomainType
+   {
+      CONTINUOUS = 0, // Default continuous grid with no limits on values
+      SAWTOOTH_90= 1, // For angles between -90 and 90 deg such as latitude
+      WRAP_180   = 2, // For angles between -180 and 180 with discontinuity at limits (typically used for longitude)
+      WRAP_360   = 3  // For angles between 0 and 360 with discontinuity at limits (typically used for rotations)
+   };
+   void setDomainType(DomainType dt) { theDomainType = dt; }
+
+   /*!
+    * Access an interpolated value in the U/V (output) coordinate system.
+    */
+   double operator() (const ossimDpt& uv_point) const {return (*this)(uv_point.u, uv_point.v);}
+   double value      (const ossimDpt& uv_point) const {return (*this)(uv_point.u, uv_point.v);}
+
+   double operator() (const double& u, const double& v) const;
+   double value (const double& u, const double& v) const {return (*this)(u,v);}
+
+   /*!
+    * operator for initializing this grid with another.
+    */
+   const ossimDblGrid& operator = (const ossimDblGrid& grid);
+   
+   /*!
+    *Statistics methods:
+    */
+   double minValue()   const { return theMinValue; }
+   double maxValue()   const { return theMaxValue; }
+   double nullValue()  const { return theNullValue; }
+   double meanValue();
+   double meanStdDev();
+
+   void setMinValue(double value) {theMinValue = value;}
+   void setMaxValue(double value) {theMaxValue = value;}
+   void setNullValue(double value) {theNullValue = value;}
+   /*!
+    * Other member access methods:
+    */
+   const ossimIpt& size()    const { return theSize; }
+   const ossimDpt& origin()  const { return theOrigin; }
+   const ossimDpt& spacing() const { return theSpacing; }
+   unsigned long   getSizeInBytes() const { return theSize.x*theSize.y*sizeof(double); }
+   
+   /*!
+    * Returns true if double point lies within world space coverage:
+    */
+   bool  isInside(const ossimDpt& p) const {return isInside(p.u, p.v);}
+   bool  isInside(const double& u, const double& v) const;
+
+   /*!
+    * Loads and saves the grid from/to a stream. Returns TRUE if successful.
+    */
+   bool  save(std::ostream& os, const char* descr) const;
+   bool  load(std::istream& is);
+   
+   friend std::ostream& operator << (std::ostream& os, const ossimDblGrid& grid);
+   
+private:
+   
+   void  computeMean();
+   double interpolate(double x, double y) const;
+   double extrapolate(double x, double y) const;
+
+   //! Constrains the value to the numerical domain specified in theDomainType.
+   void constrain(double& value) const;
+
+   ossim_uint32   index(int x, int y) const { return y*theSize.x + x; }
+   
+   double*      theGridData;
+   ossimIpt     theSize;
+   ossimDpt     theOrigin;
+   ossimDpt     theSpacing;
+   double       theMinValue;
+   double       theMaxValue;
+   double       theNullValue;
+   double       theMeanValue;
+   double       theDeviation;
+   bool         theMeanIsComputed;
+   bool         theExtrapIsEnabled;
+   DomainType   theDomainType;
+   
+};
+
+#endif
+
diff --git a/include/ossim/base/ossimDirectory.h b/include/ossim/base/ossimDirectory.h
new file mode 100644
index 0000000..619dfdd
--- /dev/null
+++ b/include/ossim/base/ossimDirectory.h
@@ -0,0 +1,105 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: 
+//
+//*************************************************************************
+// $Id: ossimDirectory.h 22656 2014-02-28 17:51:42Z dburken $
+#ifndef ossimDirectory_HEADER
+#define ossimDirectory_HEADER
+
+#include <ossim/base/ossimFilename.h>
+
+#ifndef _WIN32
+class ossimDirectoryData;
+#endif
+
+class  OSSIMDLLEXPORT ossimDirectory
+{
+public:
+   
+   /*!
+    * These flags define what kind of filenames is included in the list
+    * of files enumerated by GetFirst/GetNext.
+    */
+   enum
+   {
+      OSSIM_DIR_FILES     = 0x0001,       // include files
+      OSSIM_DIR_DIRS      = 0x0002,       // include directories
+      OSSIM_DIR_HIDDEN    = 0x0004,       // include hidden files
+      OSSIM_DIR_DOTDOT    = 0x0008,       // include '.' and '..'
+      
+      // by default, enumerate everything except '.' and '..'
+      OSSIM_DIR_DEFAULT   = OSSIM_DIR_FILES | OSSIM_DIR_DIRS | OSSIM_DIR_HIDDEN
+   };
+
+
+   ossimDirectory();
+   
+   ossimDirectory(const ossimFilename& dir);
+   
+   ~ossimDirectory();
+   
+   bool open(const ossimFilename& dir);
+   
+   bool isOpened() const;
+   
+   bool getFirst(ossimFilename &filename,
+                 int flags = OSSIM_DIR_DEFAULT);
+   
+   /*!
+    * Get next file in the enumeration started with either GetFirst() or
+    * GetFirstNormal().
+    */
+   bool getNext(ossimFilename &filename) const;
+   
+   void findAllFilesThatMatch(std::vector<ossimFilename>& result,
+                              const ossimString& regularExpressionPattern,
+                              int flags = OSSIM_DIR_DEFAULT);
+   
+#if defined (_WIN32)
+   void setFlags(int flags) { theFlags = flags; };
+   bool fileMatched(ossimFilename &filename) const;
+#endif    
+
+   // ESH 07/2008, Trac #234: OSSIM is case sensitive 
+   // when using worldfile templates during ingest
+   /*!
+    * Case insensitive search for files with the same name but 
+    * with letters that have different case than the input name. 
+    *
+    * On Windows there can only be one match, but the case can be 
+    * different than the input name. On UNIX there can be multiple 
+    * matches.
+    *
+    * If the bExcludeExactMatch input parameter is set to false, 
+    * the original input name will be included in the 'result'
+    * vector if it is found in the directory. Otherwise (the default),
+    * the input name is excluded from the 'result' vector even if it
+    * is found in the directory.
+    *
+    * Returns true if a name has been added to the result vector.
+    */
+   bool findCaseInsensitiveEquivalents( const ossimFilename &filename, 
+                                        std::vector<ossimFilename>& result,
+                                        bool bExcludeExactMatch = true );
+   
+   // TODO using scandir() when available later, emulating it otherwise
+   
+private:
+#if defined (_WIN32)
+   intptr_t      theData;
+   ossimFilename theDirectoryName;
+   int           theFlags;
+#else
+   ossimDirectoryData* theData;
+#endif
+};
+
+#endif /* #ifndef ossimDirectory_HEADER */
diff --git a/ossim/include/ossim/base/ossimDirectoryData.h b/include/ossim/base/ossimDirectoryData.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDirectoryData.h
rename to include/ossim/base/ossimDirectoryData.h
diff --git a/ossim/include/ossim/base/ossimDirectoryTree.h b/include/ossim/base/ossimDirectoryTree.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDirectoryTree.h
rename to include/ossim/base/ossimDirectoryTree.h
diff --git a/ossim/include/ossim/base/ossimDisplayEventListener.h b/include/ossim/base/ossimDisplayEventListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDisplayEventListener.h
rename to include/ossim/base/ossimDisplayEventListener.h
diff --git a/include/ossim/base/ossimDisplayInterface.h b/include/ossim/base/ossimDisplayInterface.h
new file mode 100644
index 0000000..9953db9
--- /dev/null
+++ b/include/ossim/base/ossimDisplayInterface.h
@@ -0,0 +1,40 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimDisplayInterface.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimDisplayInterface_HEADER
+#define ossimDisplayInterface_HEADER
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossimString.h>
+
+class OSSIMDLLEXPORT ossimDisplayInterface
+{
+public:
+   ossimDisplayInterface();
+
+   virtual ~ossimDisplayInterface();
+
+   /*!
+    * Returns the display back to the caller
+    */
+   virtual void* getDisplayDevice()=0;
+
+   virtual void setTitle(const ossimString& title)=0;
+   virtual void getTitle(ossimString& title)const=0;
+   virtual ossimString getTitle()const;
+   virtual void close()=0;
+   virtual bool isOpen() const=0;
+   virtual bool open()=0;
+   virtual bool isMinimized()const=0;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimDisplayListEvent.h b/include/ossim/base/ossimDisplayListEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDisplayListEvent.h
rename to include/ossim/base/ossimDisplayListEvent.h
diff --git a/ossim/include/ossim/base/ossimDisplayRefreshEvent.h b/include/ossim/base/ossimDisplayRefreshEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDisplayRefreshEvent.h
rename to include/ossim/base/ossimDisplayRefreshEvent.h
diff --git a/ossim/include/ossim/base/ossimDms.h b/include/ossim/base/ossimDms.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDms.h
rename to include/ossim/base/ossimDms.h
diff --git a/ossim/include/ossim/base/ossimDoubleGridProperty.h b/include/ossim/base/ossimDoubleGridProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimDoubleGridProperty.h
rename to include/ossim/base/ossimDoubleGridProperty.h
diff --git a/include/ossim/base/ossimDpt.h b/include/ossim/base/ossimDpt.h
new file mode 100644
index 0000000..51db80e
--- /dev/null
+++ b/include/ossim/base/ossimDpt.h
@@ -0,0 +1,166 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for ossimDpt.
+// Used to represent an double point containing an x and y data member.
+// 
+//*******************************************************************
+//  $Id: ossimDpt.h 19793 2011-06-30 13:26:56Z gpotts $
+#ifndef ossimDpt_HEADER
+#define ossimDpt_HEADER
+
+#include <iosfwd>
+#include <string>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimString.h>
+
+// Forward class declarations.
+class ossimIpt;
+class ossimFpt;
+class ossimDpt3d;
+class ossimGpt;
+
+class OSSIMDLLEXPORT ossimDpt
+{
+public:
+
+   ossimDpt() : x(0), y(0) {}
+
+   ossimDpt(double anX, double aY) : x(anX), y(aY) {}
+         
+   // trust the default generated copy-constructor
+   // ossimDpt(const ossimDpt& pt) = default;
+
+   ossimDpt(const ossimFpt& pt);
+   
+   ossimDpt(const ossimIpt& pt);
+
+   ossimDpt(const ossimDpt3d &pt);
+
+   ossimDpt(const ossimGpt &pt); // assigns lat, lon only
+
+   // trust the default generated copy-constructor
+   // const ossimDpt& operator=(const ossimDpt&) = default;
+
+   const ossimDpt& operator=(const ossimFpt&);
+   
+   const ossimDpt& operator=(const ossimIpt&);
+
+   const ossimDpt& operator=(const ossimDpt3d&);
+
+   const ossimDpt& operator=(const ossimGpt&); // assigns lat, lon only
+
+   bool operator==(const ossimDpt& pt) const
+   { return ( ossim::almostEqual(x, pt.x) && ossim::almostEqual(y, pt.y) ); } 
+
+   bool operator!=(const ossimDpt& pt) const
+   { return !(*this == pt ); }
+
+   void makeNan(){x = ossim::nan(); y=ossim::nan();}
+   
+   bool hasNans()const
+   {
+      return (ossim::isnan(x) || ossim::isnan(y));
+   }
+
+   bool isNan()const
+   {
+      return (ossim::isnan(x) && ossim::isnan(y));
+   }
+
+   /*!
+    * METHOD: length()
+    * Returns the RSS of the components.
+    */
+   double length() const { return sqrt(x*x + y*y); }
+   
+   //***
+   // OPERATORS: +, -, +=, -=
+   // Point add/subtract with other point:
+   //***
+   ossimDpt operator+(const ossimDpt& p) const
+      { return ossimDpt(x+p.x, y+p.y); }
+   ossimDpt operator-(const ossimDpt& p) const
+      { return ossimDpt(x-p.x, y-p.y); }
+   const ossimDpt& operator+=(const ossimDpt& p)
+      { x += p.x; y += p.y; return *this; }
+   const ossimDpt& operator-=(const ossimDpt& p)
+      { x -= p.x; y -= p.y; return *this; }
+
+   //***
+   // OPERATORS: *, /
+   // Scale point components by scalar:
+   //***
+   ossimDpt operator*(const double& d) const
+      { return ossimDpt(d*x, d*y); }
+   ossimDpt operator/(const double& d) const
+      { return ossimDpt(x/d, y/d); }
+  ossim_float64 operator*(const ossimDpt& pt)const
+      { return (x*pt.x+y*pt.y); }
+
+   std::ostream& print(std::ostream& os, ossim_uint32 precision=15) const;
+   
+   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
+                                                  const ossimDpt& pt);
+
+   /**
+    * @param precision Output floating point precision.
+    * 
+    * @return ossimString representing point.
+    *
+    * Output format:  ( 30.00000000000000, -90.00000000000000 )
+    *                   --------x--------  ---------y--------
+    */
+   ossimString toString(ossim_uint32 precision=15) const;
+
+   /**
+    * Initializes this point from string.  This method opens an istream to
+    * s and then calls operator>>.
+    *
+    * Expected format:  ( 30.00000000000000, -90.00000000000000 )
+    *                     --------x--------  ---------y--------
+    *
+    * @param s String to initialize from.
+    *
+    * @see operator>>
+    */
+   void toPoint(const std::string& s);
+   
+   /**
+    * Method to input the formatted string of the "operator<<".
+    *
+    * Expected format:  ( 30.00000000000000, -90.00000000000000 )
+    *                     --------x--------  ---------y--------
+    * 
+    * This method starts by doing a "makeNan" on pt.  So if anything goes
+    * wrong with the stream or parsing pt could be all or partially nan.
+    *
+    * @param is Input stream istream to formatted text.
+    * @param pt osimDpt to be initialized from stream.
+    * @return istream pass in.
+    */
+   friend OSSIMDLLEXPORT std::istream& operator>>(std::istream& is,
+                                                  ossimDpt& pt);
+   bool isEqualTo(const ossimDpt& rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
+
+   /**
+    * Returns the average of x and y
+    */
+   double mean() const { return (x + y) / 2.0; }
+
+   //***
+   // Public data members:
+   //***
+   union {double x; double samp; double u; double lon;};
+   union {double y; double line; double v; double lat;};
+
+};
+
+
+#endif /* #ifndef ossimDpt_HEADER */
diff --git a/include/ossim/base/ossimDpt3d.h b/include/ossim/base/ossimDpt3d.h
new file mode 100644
index 0000000..7964442
--- /dev/null
+++ b/include/ossim/base/ossimDpt3d.h
@@ -0,0 +1,148 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:  
+//
+// Contains class declaration for dpt3d
+// Used to represent a 3d double point containing an x, y and z data member.
+//*******************************************************************
+//  $Id: ossimDpt3d.h 22937 2014-11-01 11:30:13Z okramer $
+
+#ifndef ossimDpt3d_HEADER
+#define ossimDpt3d_HEADER
+
+#include <cmath>
+#include <iosfwd>
+#include <string>
+
+#include <ossim/base/ossimCommon.h> /* for ossim::isnan */
+#include <ossim/base/ossimColumnVector3d.h>
+
+class ossimIpt;
+class ossimDpt;
+
+class OSSIMDLLEXPORT ossimDpt3d
+{
+public:
+   friend OSSIMDLLEXPORT std::ostream & operator <<(std::ostream &out,
+                                                    const ossimDpt3d &rhs);
+   
+   ossimDpt3d(const double &aX=0, const double &aY=0, const double &aZ=0)
+      :x(aX), y(aY), z(aZ) {}
+
+   ossimDpt3d(const ossimDpt &aPt);
+   ossimDpt3d(const ossimIpt &aPt);
+
+   //! Argument gPt is converted to WGS84 datum before coordinates are stored in x, y, z.
+   //! Likewise, ossimGpt has a constructor that accepts an ossimDpt3d with assumed WGS84 datum.
+   ossimDpt3d(const ossimGpt &gPt);
+   
+   ossimDpt3d(const ossimColumnVector3d &pt)
+      : x(pt[0]), y(pt[1]), z(pt[2]) {}
+   
+   bool operator ==(const ossimDpt3d &rhs) const
+      {
+         return ( (x == rhs.x) &&
+                  (y == rhs.y) &&
+                  (z == rhs.z));
+      }
+   bool operator !=(const ossimDpt3d &rhs) const
+   {
+      return ( (x != rhs.x) ||
+               (y != rhs.y) ||
+               (z != rhs.z) );
+   }
+   
+   void makeNan(){x = ossim::nan(); y=ossim::nan(); z=ossim::nan();}
+
+   bool hasNans()const
+   {
+      return (ossim::isnan(x) || ossim::isnan(y) || ossim::isnan(z));
+   }
+   /*!
+    * METHOD: length()
+    * Returns the RSS of the components.
+    */
+   double length() const { return std::sqrt(x*x + y*y + z*z); }
+   double length2() const { return x*x + y*y + z*z; }
+   
+   //***
+   // OPERATORS: +, -, +=, -=
+   // Point add/subtract with other point:
+   //***
+   ossimDpt3d operator+(const ossimDpt3d& p) const
+      { return ossimDpt3d(x+p.x, y+p.y, z+p.z); }
+   ossimDpt3d operator-(const ossimDpt3d& p) const
+      { return ossimDpt3d(x-p.x, y-p.y, z-p.z); }
+   const ossimDpt3d& operator+=(const ossimDpt3d& p)
+      { x += p.x; y += p.y; z += p.z; return *this; }
+   const ossimDpt3d& operator-=(const ossimDpt3d& p)
+      { x -= p.x; y -= p.y; z -= p.z; return *this; }
+
+   //***
+   // OPERATORS: *, /
+   // Scale point components by scalar:
+   //***
+   ossimDpt3d operator*(const double& d) const
+      { return ossimDpt3d(d*x, d*y, d*z); }
+   ossimDpt3d operator/(const double& d) const
+      { return ossimDpt3d(x/d, y/d, z/d); }
+  void operator /=(double value)
+      {
+         x /= value;
+         y /= value;
+         z /= value;
+      }
+   void operator *=(double value) 
+      {
+         x *= value;
+         y *= value;
+         z *= value;
+      }
+   double operator *(const ossimDpt3d& src)const
+   {
+      return (x*src.x + y*src.y + z*src.z);
+   }
+   inline const ossimDpt3d operator ^ (const ossimDpt3d& rhs) const
+   {
+      return ossimDpt3d(y*rhs.z-z*rhs.y,
+                        z*rhs.x-x*rhs.z ,
+                        x*rhs.y-y*rhs.x);
+   }
+
+   /**
+    * @brief To string method.
+    * 
+    * @param precision Output floating point precision.
+    * 
+    * @return std::string representing point.
+    *
+    * Output format:
+    * ( 0.0000000,  0.0000000,  0.00000000 )
+    *   -----x----  -----y----  ------z----
+    */
+   std::string toString(ossim_uint32 precision=15) const;
+   
+   /**
+    * @brief Initializes this point from string.
+    *
+    * Expected format:
+    * 
+    * ( 0.0000000,  0.0000000,  0.00000000 )
+    *   -----x----  -----y----  ------z----
+    *
+    * @param s String to initialize from.
+    */
+   void toPoint(const std::string& s); 
+   
+   double x;
+   double y;
+   double z;
+};
+
+#endif
diff --git a/include/ossim/base/ossimDrect.h b/include/ossim/base/ossimDrect.h
new file mode 100644
index 0000000..b67251c
--- /dev/null
+++ b/include/ossim/base/ossimDrect.h
@@ -0,0 +1,859 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for drect.
+// Container class for four double points representing a rectangle.
+// 
+//*******************************************************************
+//  $Id: ossimDrect.h 22197 2013-03-12 02:00:55Z dburken $
+
+#ifndef ossimDrect_HEADER
+#define ossimDrect_HEADER
+
+#include <iosfwd>
+#include <vector>
+
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimFpt.h>
+
+//***
+// NOTE:  A word on corner points...
+//
+// There is the concept of "pixel is area" and "pixel is point".
+// - Pixel is area means the (x,y) pixel coordinate refers to the upper left
+//   corner of the pixel, NOT the center of the pixel.
+// - Pixel is point means the (x,y) pixel coordinate refers to the center
+//   of the pixel, NOT the upper left corner.
+//
+// For the uniformity purposes, all pixel points  should be in the
+// "pixel is point" form; therefore, the (x,y) point should represent the
+// CENTER of the pixel.
+//***
+
+//***
+// Forward class declarations.
+//***
+class ossimIrect;
+class ossimPolygon;
+class ossimKeywordlist;
+
+//*******************************************************************
+// CLASS:  ossimDrect
+//*******************************************************************
+
+class OSSIMDLLEXPORT ossimDrect
+{
+public:
+   enum
+   {
+      UPPER_LEFT  = 1,
+      LOWER_LEFT  = 2,
+      LOWER_RIGHT = 4,
+      UPPER_RIGHT = 8
+   };
+
+   ossimDrect()
+      :
+         theUlCorner(0.0, 0.0),
+         theUrCorner(0.0, 0.0),
+         theLrCorner(0.0, 0.0),
+         theLlCorner(0.0, 0.0),
+         theOrientMode(OSSIM_LEFT_HANDED)
+      {}
+
+   ossimDrect(const ossimDpt&   ul_corner,
+              const ossimDpt&   lr_corner,
+              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED)
+      :
+         theUlCorner(ul_corner),
+         theUrCorner(lr_corner.x, ul_corner.y),
+         theLrCorner(lr_corner),
+         theLlCorner(ul_corner.x, lr_corner.y),
+         theOrientMode(mode)
+      {
+      }
+
+   ossimDrect(const double& ul_corner_x,
+              const double& ul_corner_y,
+              const double& lr_corner_x,
+              const double& lr_corner_y,
+              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED)
+      :
+         theUlCorner(ul_corner_x, ul_corner_y),
+         theUrCorner(lr_corner_x, ul_corner_y),
+         theLrCorner(lr_corner_x, lr_corner_y),
+         theLlCorner(ul_corner_x, lr_corner_y),
+         theOrientMode(mode)
+      {}
+   
+   ossimDrect(const ossimDrect& rect)
+      :
+         theUlCorner(rect.ul()),
+         theUrCorner(rect.ur()),
+         theLrCorner(rect.lr()),
+         theLlCorner(rect.ll()),
+         theOrientMode(rect.orientMode())
+      {}
+
+   ossimDrect(const ossimIrect& rect);
+
+   /*!
+    * Must compute a bounding rect given a collection of points or polygon:
+    */
+   ossimDrect(const std::vector<ossimDpt>& points,
+              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
+   ossimDrect(const ossimDpt& p1,
+              const ossimDpt& p2,
+              const ossimDpt& p3,
+              const ossimDpt& p4,
+              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
+   ossimDrect(const ossimPolygon& polygon, 
+              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
+
+   /** destructor */
+   ~ossimDrect();
+   
+   //! Constructs an Drect surrounding the specified point, and of specified size.
+   ossimDrect(const ossimDpt& center, 
+              const double&   size_x, 
+              const double&   size_y,
+              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
+
+   inline const ossimDrect& operator=  (const ossimDrect& rect);
+   const ossimDrect&        operator=  (const ossimIrect& rect);
+   inline bool              operator!= (const ossimDrect& rect) const;
+   inline bool              operator== (const ossimDrect& rect) const;
+
+   friend ossimDrect operator*(double scalar, const ossimDrect& rect)
+   {
+      ossimDpt ul(rect.theUlCorner.x*scalar,
+                  rect.theUlCorner.y*scalar);
+      
+      if(rect.theOrientMode == OSSIM_LEFT_HANDED)
+      {
+         return ossimDrect(ul.x,
+                           ul.y,
+                           ul.x+rect.width()*scalar-1,
+                           ul.y+rect.height()*scalar-1,
+                           rect.theOrientMode);
+      }
+      return ossimDrect(ul.x,
+                        ul.y,
+                        ul.x+rect.width()*scalar-1,
+                        ul.y-(rect.height()*scalar-1),
+                        rect.theOrientMode);
+      
+   }
+   
+   const ossimDrect& operator *=(double scalar)
+      {
+          ossimDpt ul(theUlCorner.x*scalar,
+                      theUlCorner.y*scalar);
+
+          if(theOrientMode == OSSIM_LEFT_HANDED)
+          {
+             *this = ossimDrect(ul.x,
+                                ul.y,
+                                (ul.x+width()*scalar-1),
+                                (ul.y+height()*scalar-1),
+                                theOrientMode);
+          }
+          else
+          {
+             *this = ossimDrect(ul.x,
+                                ul.y,
+                                (ul.x+width()*scalar-1),
+                                (ul.y-(height()*scalar-1)),
+                                theOrientMode);
+                                
+          }
+         return *this;
+      }
+   
+   ossimDrect operator *(double scalar)const
+      {
+         ossimDpt ul((theUlCorner.x*scalar),
+                     (theUlCorner.y*scalar));
+
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            return ossimDrect(ul.x,
+                              ul.y,
+                              (ul.x+width()*scalar-1),
+                              (ul.y+height()*scalar-1),
+                              theOrientMode);
+         }
+
+         return ossimDrect(ul.x,
+                           ul.y,
+                           (ul.x+width()*scalar-1),
+                           ul.y-(height()*scalar-1),
+                           theOrientMode);
+      }
+   const ossimDrect& operator *=(const ossimDpt& scalar)
+      {
+         ossimDpt ul((theUlCorner.x*scalar.x),
+                     (theUlCorner.y*scalar.y));
+         
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            *this = ossimDrect(ul.x,
+                               ul.y,
+                               (ul.x+width()*scalar.x - 1),
+                               (ul.y+height()*scalar.y - 1),
+                               theOrientMode);
+         }
+         else
+         {
+            *this = ossimDrect(ul.x,
+                               ul.y,
+                               (ul.x+width()*scalar.x - 1),
+                               (ul.y-(height()*scalar.y - 1)),
+                               theOrientMode);            
+         }
+         return *this;
+      }
+   
+   ossimDrect operator *(const ossimDpt& scalar)const
+      {
+         ossimDpt ul((theUlCorner.x*scalar.x),
+                     (theUlCorner.y*scalar.y));
+         
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            return ossimDrect(ul.x,
+                              ul.y,
+                              (ul.x+width()*scalar.x-1),
+                              (ul.y+height()*scalar.y-1),
+                              theOrientMode);
+         }
+         return ossimDrect(ul.x,
+                           ul.y,
+                           (ul.x+width()*scalar.x-1),
+                           (ul.y-(height()*scalar.y-1)),
+                           theOrientMode);
+      }
+   const ossimDrect& operator +=(const ossimDpt& shift)
+      {
+         ossimDpt ul((theUlCorner.x+shift.x),
+                     (theUlCorner.y+shift.y));
+                     
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            *this = ossimDrect(ul.x,
+                               ul.y,
+                               ul.x+width()-1,
+                               ul.y+height()-1,
+                               theOrientMode);
+         }
+         else
+         {
+            *this = ossimDrect(ul.x,
+                               ul.y,
+                               ul.x+width()-1,
+                               ul.y-(height()-1),
+                               theOrientMode);            
+         }
+         return *this;
+      }
+   
+   const ossimDrect& operator -=(const ossimDpt& shift)
+      {
+         ossimDpt ul((theUlCorner.x-shift.x),
+                     (theUlCorner.y-shift.y));
+         
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            *this = ossimDrect(ul.x,
+                               ul.y,
+                               ul.x+width()-1,
+                               ul.y+height()-1,
+                               theOrientMode);
+         }
+         else
+         {
+            *this = ossimDrect(ul.x,
+                               ul.y,
+                               ul.x+width()-1,
+                               ul.y-(height()-1),
+                               theOrientMode);
+         }
+         return *this;
+      }
+   
+   ossimDrect operator +(const ossimDpt& shift)const
+      {
+         ossimDpt ul((theUlCorner.x+shift.x),
+                     (theUlCorner.y+shift.y));
+                     
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            return ossimDrect(ul.x,
+                              ul.y,
+                              ul.x+width()-1,
+                              ul.y+height()-1,
+                              theOrientMode);
+         }
+         else
+         {
+            return ossimDrect(ul.x,
+                              ul.y,
+                              ul.x+width()-1,
+                              ul.y-(height()-1),
+                              theOrientMode);
+         }
+      }  
+
+   ossimDrect operator -(const ossimDpt& shift)const
+      {
+         ossimIpt ul(ossim::round<int>(theUlCorner.x-shift.x),
+                     ossim::round<int>(theUlCorner.y-shift.y));
+                     
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            return ossimDrect(ul.x,
+                              ul.y,
+                              ul.x+width()-1,
+                              ul.y+height()-1,
+                              theOrientMode);
+         }
+         else
+         {
+            return ossimDrect(ul.x,
+                              ul.y,
+                              ul.x+width()-1,
+                              ul.y-(height()-1),
+                              theOrientMode);            
+         }
+      }  
+
+   const ossimDpt& ul() const { return theUlCorner; }
+   const ossimDpt& ur() const { return theUrCorner; }
+   const ossimDpt& lr() const { return theLrCorner; }
+   const ossimDpt& ll() const { return theLlCorner; }
+
+   const ossimDrect& changeOrientationMode(ossimCoordSysOrientMode mode)
+   {
+      // if we are already in the orientation then return
+      //
+      if(mode == theOrientMode) return *this;
+      if(mode == OSSIM_LEFT_HANDED)
+      {
+         // we must be right handed so change to left handed
+         *this = ossimDrect(theUlCorner.x,
+                            theLlCorner.y,
+                            theLrCorner.x,
+                            theUlCorner.y,
+                            OSSIM_LEFT_HANDED);
+      }
+      else
+      {
+         // we must be left handed so change to RIGHT handed
+         *this = ossimDrect(theUlCorner.x,
+                            theLlCorner.y,
+                            theLrCorner.x,
+                            theUlCorner.y,
+                            OSSIM_RIGHT_HANDED);
+      }
+      theOrientMode = mode;
+      
+      return *this;
+   }
+   
+   void getBounds(double& minx, double& miny,
+                  double& maxx, double& maxy)const
+      {
+         minx = theUlCorner.x;
+         maxx = theUrCorner.x;
+         if(theOrientMode == OSSIM_LEFT_HANDED)
+         {
+            miny = theUlCorner.y;
+            maxy = theLrCorner.y;
+         }
+         else
+         {
+            maxy = theUlCorner.y;
+            miny = theLrCorner.y;
+         }
+      }
+   void makeNan()
+      {
+         theUlCorner.makeNan();
+         theLlCorner.makeNan();
+         theLrCorner.makeNan();
+         theUrCorner.makeNan();
+      }
+   
+   bool hasNans()const{ return (theUlCorner.hasNans() ||
+                                theLlCorner.hasNans() ||
+                                theLrCorner.hasNans() ||
+                                theUrCorner.hasNans());}
+   
+   bool isNan()const{ return (theUlCorner.hasNans() &&
+                              theLlCorner.hasNans() &&
+                              theLrCorner.hasNans() &&
+                              theUrCorner.hasNans());}
+
+   double area()const
+      {
+         return width()*height();
+      }
+   //***
+   // This class supports both left and right-handed coordinate systems. For
+   // both, the positive x-axis extends to the "right".
+   //***
+   ossimCoordSysOrientMode orientMode() const { return theOrientMode; }
+   void setOrientMode(ossimCoordSysOrientMode mode) { theOrientMode = mode; }
+   
+   /*!
+    * Sets the upper left corner to "pt".  Adjusts the remaining corners
+    * accordingly.
+    */
+   inline void set_ul(const ossimDpt& pt);
+
+   /*!
+    * Sets the upper right corner to "pt".  Adjusts the remaining corners
+    * accordingly.
+    */
+   inline void set_ur(const ossimDpt& pt);
+
+   /*!
+    * Sets the lower right corner to "pt".  Adjusts the remaining corners
+    * accordingly.
+    */
+   inline void set_lr(const ossimDpt& pt);
+
+   /*!
+    * Sets the lower left corner to "pt".  Adjusts the remaining corners
+    * accordingly.
+    */
+   inline void set_ll(const ossimDpt& pt);
+
+   /*!
+    * Sets the upper left x.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_ulx(ossim_float64 x);
+
+   /*!
+    * Sets the upper left y.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_uly(ossim_float64 y);
+
+   /*!
+    * Sets the upper right x.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_urx(ossim_float64 x);
+
+   /*!
+    * Sets the upper right y.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_ury(ossim_float64 y);
+
+   /*!
+    * Sets the lower right x.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_lrx(ossim_float64 x);
+
+   /*!
+    * Sets the lower right y.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_lry(ossim_float64 y);
+
+   /*!
+    * Sets the lower left x.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_llx(ossim_float64 x);
+
+   /*!
+    * Sets the lower left y.  Adjusts the remaining corners accordingly.
+    */
+   inline void set_lly(ossim_float64 y);
+
+   /*!
+    * METHOD: initBoundingRect(points)
+    * Initializes this rect to the bounding rect containing all points in the
+    * collection passed in.
+    */
+   void initBoundingRect(const std::vector<ossimDpt>& points);
+
+   /*!
+    * Returns true if "pt" falls within rectangle.  Fall on an edge is also
+    * considered to be within.  The edge is expanded by epsilon value so any value
+    * within epsilon is inside
+    */
+   bool pointWithin(const ossimDpt& pt, double epsilon=0.0) const;
+
+   /*!
+    * Returns true if "pt" falls within rectangle.  Fall on an edge is also
+    * considered to be within.
+    */
+   bool pointWithin(const ossimFpt& pt, double epsilon=0.0) const;
+
+   /*!
+    * Returns true if any portion of an input rectangle "rect" intersects
+    * "this" rectangle.  
+    */
+   bool intersects(const ossimDrect& rect) const;
+
+   /*!
+    * Returns true if "this" rectangle is contained completely within the
+    * input rectangle "rect".
+    */
+   bool completely_within(const ossimDrect& rect) const;
+
+   ossimCoordSysOrientMode orientationMode()const{return theOrientMode;}
+   /*!
+    * Returns the height of a rectangle.
+    */
+   ossim_float64 height() const { return fabs(theLlCorner.y - theUlCorner.y) + 1.0; }
+
+   /*!
+    * Returns the width of a rectangle.
+    */
+   ossim_float64 width()  const { return fabs(theLrCorner.x - theLlCorner.x) + 1.0; }
+
+   ossimDpt size() const { return ossimDpt(width(), height()); }
+
+   /*!
+    * Stretches this rectangle out to integer boundaries.
+    */
+   void stretchOut();
+
+   /*!
+    * Will stretch the rect to the passed in tiled boundary.
+    */
+   void stretchToTileBoundary(const ossimDpt& widthHeight);
+
+   const ossimDrect& expand(const ossimDpt& padding);
+
+   /**
+    * @return ossimString representing ossimIrect.
+    *
+    * Format:  ( 30, -90, 512, 512, [LH|RH] )
+    *            -x- -y-  -w-  -h-   -Right or left handed-
+    *
+    * where:
+    *     x and y are origins either upper left if LEFT HANDED (LH) or
+    *                                lower left if RIGHT HANDED (RH)
+    *     w and h are width and height respectively
+    *     The last value is LH or RH to indicate LeftHanded or RightHanded
+    *    
+    */
+   ossimString toString()const;
+   /**
+    * expected Format:  form 1: ( 30, -90, 512, 512, [LH|RH] )
+    *                            -x- -y-  -w-  -h-   -Right or left handed-
+    * 
+    *                   form 2: ( 30, -90, 512, 512)
+    *                            -x- -y-  -w-  -h-
+    *
+    * NOTE: Form 2 assumes Left handed were x,y is origin upper left and y positive down.
+    *
+    * This method starts by doing a "makeNan" on rect. 
+    *
+    * @param rectString String to initialize from.
+    * @return true or false to indicate successful parsing.
+    */
+   bool toRect(const ossimString& rectString);
+
+   bool saveState(ossimKeywordlist& kwl,
+                  const char* prefix=0)const;
+   bool loadState(const ossimKeywordlist& kwl,
+                  const char* prefix=0);
+
+   /*!
+    * Will subdivide this rect into four partitions.
+    */
+   void splitToQuad(ossimDrect& ulRect,
+                    ossimDrect& urRect,
+                    ossimDrect& lrRect,
+                    ossimDrect& llRect);
+   
+   /*!
+   * Finds the point on the rect boundary that is closest to the arg_point. Closest is defined as
+   * the minimum perpendicular distance.
+   */
+   ossimDpt findClosestEdgePointTo(const ossimDpt& arg_point) const;
+   
+   ossimDrect clipToRect(const ossimDrect& rect)const;
+
+   inline ossimDpt midPoint()const;
+
+   void print(std::ostream& os) const;
+
+   ossimDrect combine(const ossimDrect& rect)const;
+   
+   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
+                                                  const ossimDrect& rect);
+
+   bool clip(ossimDpt &p1,
+             ossimDpt  &p2)const;
+
+   static long getCode(const ossimDpt& aPoint,
+                       const ossimDrect& clipRect);
+private:
+
+   enum ossimCohenSutherlandClipCodes
+   {
+      NONE   = 0,
+      LEFT   = 1,
+      RIGHT  = 2,
+      BOTTOM = 4,
+      TOP    = 8
+   };
+   
+   //***
+   // Private data members representing the rectangle corners.
+   //***
+   ossimDpt theUlCorner;
+   ossimDpt theUrCorner;
+   ossimDpt theLrCorner;
+   ossimDpt theLlCorner;
+
+   ossimCoordSysOrientMode  theOrientMode;
+};
+
+//*******************************************************************
+// Inline Method: ossimDrect::operator=(ossimDrect)
+//*******************************************************************
+inline const ossimDrect& ossimDrect::operator=(const ossimDrect& rect)
+{
+   if (this != &rect)
+   {
+      theUlCorner   = rect.theUlCorner;
+      theUrCorner   = rect.theUrCorner;
+      theLrCorner   = rect.theLrCorner;
+      theLlCorner   = rect.theLlCorner;
+      theOrientMode = rect.theOrientMode;
+   }
+
+   return *this;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::operator!=
+//*******************************************************************
+inline bool ossimDrect::operator!=(const ossimDrect& rect) const
+{
+   return ( (theUlCorner   != rect.theUlCorner) ||
+            (theUrCorner   != rect.theUrCorner) ||
+            (theLrCorner   != rect.theLrCorner) ||
+            (theLlCorner   != rect.theLlCorner) ||
+            (theOrientMode != rect.theOrientMode));
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::operator==
+//*******************************************************************
+inline bool ossimDrect::operator==(const ossimDrect& rect) const
+{
+   return ( (theUlCorner   == rect.theUlCorner) &&
+            (theUrCorner   == rect.theUrCorner) &&
+            (theLrCorner   == rect.theLrCorner) &&
+            (theLlCorner   == rect.theLlCorner) &&
+            (theOrientMode == rect.theOrientMode));
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_ul
+//*******************************************************************
+inline void ossimDrect::set_ul(const ossimDpt& pt)
+{
+   theUlCorner   = pt;
+   theUrCorner.y = pt.y;
+   theLlCorner.x = pt.x;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_ur
+//*******************************************************************
+inline void ossimDrect::set_ur(const ossimDpt& pt)
+{
+   theUrCorner   = pt;
+   theUlCorner.y = pt.y;
+   theLrCorner.x = pt.x;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_lr
+//*******************************************************************
+inline void ossimDrect::set_lr(const ossimDpt& pt)
+{
+   theLrCorner   = pt;
+   theUrCorner.x = pt.x;
+   theLlCorner.y = pt.y;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_ll
+//*******************************************************************
+inline void ossimDrect::set_ll(const ossimDpt& pt)
+{
+   theLlCorner   = pt;
+   theUlCorner.x = pt.x;
+   theLrCorner.y = pt.y;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_ulx
+//*******************************************************************
+inline void ossimDrect::set_ulx(ossim_float64 x)
+{
+   theUlCorner.x = x;
+   theLlCorner.x = x;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_uly
+//*******************************************************************
+inline void ossimDrect::set_uly(ossim_float64 y)
+{
+   theUlCorner.y = y;
+   theUrCorner.y = y;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_urx
+//*******************************************************************
+inline void ossimDrect::set_urx(ossim_float64 x)
+{
+   theUrCorner.x = x;
+   theLrCorner.x = x;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_ury
+//*******************************************************************
+inline void ossimDrect::set_ury(ossim_float64 y)
+{
+   theUrCorner.y = y;
+   theUlCorner.y = y;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_lrx
+//*******************************************************************
+inline void ossimDrect::set_lrx(ossim_float64 x)
+{
+   theLrCorner.x = x;
+   theUrCorner.x = x;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_lry
+//*******************************************************************
+inline void ossimDrect::set_lry(ossim_float64 y)
+{
+   theLrCorner.y = y;
+   theLlCorner.y = y;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_llx
+//*******************************************************************
+inline void ossimDrect::set_llx(ossim_float64 x)
+{
+   theLlCorner.x = x;
+   theUlCorner.x = x;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::set_lly
+//*******************************************************************
+inline void ossimDrect::set_lly(ossim_float64 y)
+{
+   theLlCorner.y = y;
+   theLrCorner.y = y;
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::pointWithin(const ossimDpt& pt) 
+//*******************************************************************
+inline bool ossimDrect::pointWithin(const ossimDpt& pt, double epsilon) const
+{
+   if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      return ((pt.x >= (ul().x-epsilon)) &&
+              (pt.x <= (ur().x+epsilon)) &&
+              (pt.y >= (ul().y-epsilon)) &&
+              (pt.y <= (ll().y+epsilon)));
+   }
+   return ((pt.x >= (ul().x-epsilon)) &&
+           (pt.x <= (ur().x+epsilon)) &&
+           (pt.y <= (ul().y+epsilon)) &&
+           (pt.y >= (ll().y-epsilon)));
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::pointWithin(const ossimFpt& pt)
+//*******************************************************************
+inline bool ossimDrect::pointWithin(const ossimFpt& pt, double epsilon) const
+{
+   if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      return ((pt.x >= (ul().x-epsilon)) &&
+              (pt.x <= (ur().x+epsilon)) &&
+              (pt.y >= (ul().y-epsilon)) &&
+              (pt.y <= (ll().y+epsilon)));
+   }
+   return ((pt.x >= (ul().x-epsilon)) &&
+           (pt.x <= (ur().x+epsilon)) &&
+           (pt.y <= (ul().y+epsilon)) &&
+           (pt.y >= (ll().y-epsilon)));
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::midPoint()
+//*******************************************************************
+inline ossimDpt ossimDrect::midPoint()const
+{
+   return ossimDpt( (ul().x + ur().x + ll().x + lr().x)*.25,
+                    (ul().y + ur().y + ll().y + lr().y)*.25);
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::combine(const ossimDrect& rect)
+//*******************************************************************
+inline ossimDrect ossimDrect::combine(const ossimDrect& rect)const
+{
+   if(rect.hasNans() || hasNans())
+   {
+      ossimDrect result;
+
+      result.makeNan();
+
+      return result;
+   }
+   if (theOrientMode != rect.theOrientMode)
+      return(*this);
+   
+   ossimDpt ulCombine;
+   ossimDpt lrCombine;
+
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
+      ulCombine.y = ((ul().y <= rect.ul().y)?ul().y:rect.ul().y);
+      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
+      lrCombine.y = ((lr().y >= rect.lr().y)?lr().y:rect.lr().y);
+   }
+   else
+   {
+      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
+      ulCombine.y = ((ul().y >= rect.ul().y)?ul().y:rect.ul().y);
+      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
+      lrCombine.y = ((lr().y <= rect.lr().y)?lr().y:rect.lr().y);
+   }
+
+   return ossimDrect(ulCombine, lrCombine, theOrientMode);
+}
+#endif
diff --git a/include/ossim/base/ossimDuration.h b/include/ossim/base/ossimDuration.h
new file mode 100644
index 0000000..c61921b
--- /dev/null
+++ b/include/ossim/base/ossimDuration.h
@@ -0,0 +1,166 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id$
+#ifndef ossimDuration_HEADER
+#define ossimDuration_HEADER
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <iostream>
+
+class OSSIM_DLL ossimDuration
+{
+public:
+   /**
+    * This will take an iso8601 encoded duration string and parse out
+    * the individual values
+    */
+   ossimDuration(const ossimString& iso8601Duration = ossimString(""));
+   
+   
+   /**
+    * zero out all fields
+    */
+   void clearFields();
+   
+   /**
+    * This will take an iso8601 encoded duration stream and parse out
+    * the individual values it will stop when a blank character or whitespace is found
+    */
+   bool readIso8601Encoding(std::istream& in);
+   
+   /**
+    * This will take an iso8601 encoded duration stream and parse out
+    * the individual values it will stop when a blank character or whitespace is found
+    */
+   bool setByIso8601DurationString(const ossimString& iso8601Duration);
+   
+   /**
+    * Will take the field values and encode into a iso8601 string format.
+    * Note, anything that is 0 will not be output.
+    *
+    */
+   void toIso8601DurationString(ossimString& result);
+   
+   /**
+    * this will not use the months field or the years field but will use all other
+    * fields to calculate a total value in seconds.  We can not determine leap years
+    * and how many days are in a month so those are omitted and so this serves as
+    * a utility method to just calculate the total seconds if you give a duration string
+    * that contains only one or all or any of the following: weeks, days, minutes, hours,
+    * and/or seconds.
+    *
+    * If the sign is set to negative it will return a negative value.
+    */
+   ossim_float64 toSeconds()const;
+   
+   void setSign(ossim_int32 value)
+   {
+      theSign = ((value < 0)?-1:1);
+   }
+   /**
+    * returns the sign.  Should be either -1 or 1 for the return
+    */
+   ossim_int32 sign()const
+   {
+      return theSign;
+   }
+   void setYears(ossim_uint64 value)
+   {
+      theYears = value;
+   }
+   ossim_int64 years()const
+   {
+      return theYears;
+   }
+   void setMonths(ossim_uint64 value)
+   {
+      theMonths = value;
+   }
+   ossim_int64 months()const
+   {
+      return theMonths;
+   }
+   void setWeeks(ossim_uint64 value)
+   {
+      theWeeks = value;
+   }
+   ossim_int64 weeks()const
+   {
+      return theWeeks;
+   }
+   void setDays(ossim_uint64 value)
+   {
+      theDays = value;
+   }
+   ossim_int64 days()const
+   {
+      return theDays;
+   }
+   void setHours(ossim_uint64 value)
+   {
+      theHours = value;
+   }
+   ossim_int64 hours()const
+   {
+      return theHours;
+   }
+   void setMinutes(ossim_uint64 value)
+   {
+      theMinutes = value;
+   }
+   ossim_int64 minutes()const
+   {
+      return theMinutes;
+   }
+   void setSeconds(ossim_float64 value)
+   {
+      theSeconds = value;
+   }
+   ossim_float64 seconds()const
+   {
+      return theSeconds;
+   }
+   
+   /**
+    * Sets all values in one call
+    */
+   void setAll(ossim_int32 signValue,
+               ossim_uint64 yearsValue,
+               ossim_uint64 monthsValue,
+               ossim_uint64 weeksValue,
+               ossim_uint64 daysValue,
+               ossim_uint64 hoursValue,
+               ossim_uint64 minutesValue,
+               ossim_float64 secondsValue)
+   {
+      theSign    = ((signValue < 0)?-1:1);
+      theYears   = yearsValue;
+      theMonths  = monthsValue;
+      theWeeks   = weeksValue;
+      theDays    = daysValue;
+      theHours   = hoursValue;
+      theMinutes = minutesValue;
+      theSeconds = secondsValue;
+   }
+               
+   
+protected:
+   ossim_int32 theSign; // indicates -1 for negative and anything else is positive
+   ossim_int64 theYears; // number of years
+   ossim_int64 theMonths; // number of months
+   ossim_int64 theWeeks; // number of months
+   ossim_int64 theDays;   // number of days
+   ossim_int64 theHours;  // number of hours
+   ossim_int64 theMinutes; // number of minutes
+   ossim_float64 theSeconds; // umber of Seconds
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimEbcdicToAscii.h b/include/ossim/base/ossimEbcdicToAscii.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEbcdicToAscii.h
rename to include/ossim/base/ossimEbcdicToAscii.h
diff --git a/include/ossim/base/ossimEcefPoint.h b/include/ossim/base/ossimEcefPoint.h
new file mode 100644
index 0000000..b89749d
--- /dev/null
+++ b/include/ossim/base/ossimEcefPoint.h
@@ -0,0 +1,210 @@
+//*****************************************************************************
+// FILE: ossimEcefPoint.h
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION:
+//   Contains declaration of a 3D point object in the Earth-centered, earth
+//   fixed (ECEF) coordinate system.
+//
+// SOFTWARE HISTORY:
+//>
+//   08Aug2001  Oscar Kramer (http://www.oscarkramer.com)
+//              Initial coding.
+//<
+//*****************************************************************************
+//  $Id: ossimEcefPoint.h 20043 2011-09-06 15:00:55Z oscarkramer $
+
+#ifndef ossimEcefPoint_HEADER
+#define ossimEcefPoint_HEADER
+#include <iosfwd>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimColumnVector3d.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/matrix/newmat.h>
+
+class ossimGpt;
+class ossimEcefVector;
+class ossimDpt3d;
+
+//*****************************************************************************
+//  CLASS: ossimEcefPoint
+//
+//*****************************************************************************
+class OSSIMDLLEXPORT ossimEcefPoint
+{
+public:
+   /*!
+    * CONSTRUCTORS: 
+    */
+   ossimEcefPoint()
+      : theData(0,0,0) {}
+
+   // Default definition is perfect
+   // ossimEcefPoint(const ossimEcefPoint& copy_this) = default;
+
+   ossimEcefPoint(const ossimGpt& convert_this);
+
+   ossimEcefPoint(const double& x,
+                  const double& y,
+                  const double& z)
+      : theData(x, y, z) {}
+
+   ossimEcefPoint(const ossimColumnVector3d& assign_this)
+      : theData(assign_this) {}
+
+   ossimEcefPoint(const NEWMAT::ColumnVector& assign_this)
+      : theData(assign_this) {}
+
+   ossimEcefPoint(const ossimDpt3d& pt);
+   
+   void makeNan()
+      {
+         theData[0] = ossim::nan();
+         theData[1] = ossim::nan();
+         theData[2] = ossim::nan();
+      }
+   
+   bool hasNans()const
+      {
+         return ( ossim::isnan(theData[0]) ||
+                  ossim::isnan(theData[1]) ||
+                  ossim::isnan(theData[2]) );
+                           
+      }
+
+   bool isNan()const
+      {
+         return ( ossim::isnan(theData[0]) &&
+                  ossim::isnan(theData[1]) &&
+                  ossim::isnan(theData[2]) );
+         
+      }
+   /*!
+    * OPERATORS:
+    */
+   ossimEcefVector       operator- (const ossimEcefPoint&)  const;
+   ossimEcefPoint        operator+ (const ossimEcefVector&) const;
+   ossimEcefPoint        operator- (const ossimEcefVector&) const;
+   // ossimEcefPoint&       operator= (const ossimEcefPoint&) = default;
+   bool                  operator==(const ossimEcefPoint&)  const; // inline
+   bool                  operator!=(const ossimEcefPoint&)  const; // inline
+   
+   /*!
+    * COMPONENT ACCESS METHODS: 
+    */
+   double    x() const { return theData[0]; }
+   double&   x()       { return theData[0]; }
+   double    y() const { return theData[1]; }
+   double&   y()       { return theData[1]; }
+   double    z() const { return theData[2]; }
+   double&   z()       { return theData[2]; }
+   double&   operator[](int idx){return theData[idx];}
+   const double&   operator[](int idx)const{return theData[idx];}
+   const ossimColumnVector3d& data() const { return theData; }
+   ossimColumnVector3d&       data()       { return theData; }
+
+   double getMagnitude() const
+      {
+         return theData.magnitude();
+      }
+   double magnitude()const
+   {
+      return theData.magnitude();
+   }
+   double length()const
+   {
+      return theData.magnitude();
+   }
+   double normalize()
+   {
+      double result = magnitude();
+
+      if(result > 1e-15)
+      {
+         theData[0]/=result;
+         theData[1]/=result;
+         theData[2]/=result;
+      }
+      
+      return result;
+   }
+
+   /**
+    * @brief To string method.
+    * 
+    * @param precision Output floating point precision.
+    * 
+    * @return ossimString representing point.
+    *
+    * Output format:
+    * ( 0.0000000,  0.0000000,  0.00000000 )
+    *   -----x----  -----y----  ------z----
+    */
+   ossimString toString(ossim_uint32 precision=15) const;
+
+   /**
+    * @brief Initializes this point from string.
+    *
+    * Expected format:
+    * 
+    * ( 0.0000000,  0.0000000,  0.00000000 )
+    *   -----x----  -----y----  ------z----
+    *
+    * @param s String to initialize from.
+    */
+   void toPoint(const std::string& s);
+   
+   //! Converts this point to a 3D column vector.
+   NEWMAT::ColumnVector toVector() const
+   {
+      NEWMAT::ColumnVector v (3);
+      v(0) = theData[0];
+      v(1) = theData[1];
+      v(2) = theData[2];
+      return v;
+   }
+   
+   //! Converts 3D column vector to this point.
+   void toPoint(const NEWMAT::ColumnVector& v)
+   {
+      if (v.Nrows() == 3)
+      {
+         theData[0] = v[0];
+         theData[1] = v[1];
+         theData[2] = v[2];
+      }
+   }
+
+   /*!
+    * Debug Dump: 
+    */
+   void print(std::ostream& os = ossimNotify(ossimNotifyLevel_INFO)) const;
+   
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& os ,
+                                             const ossimEcefPoint& instance);
+
+protected:
+   ossimColumnVector3d theData;
+};
+
+//================== BEGIN DEFINITIONS FOR INLINE METHODS =====================
+
+//*****************************************************************************
+//  INLINE METHOD: ossimEcefPoint::operator==(ossimEcefPoint)
+//*****************************************************************************
+inline bool ossimEcefPoint::operator==(const ossimEcefPoint& p) const
+{
+   return (theData == p.theData);
+}
+
+//*****************************************************************************
+//  INLINE METHOD: ossimEcefPoint::operator!=(ossimEcefPoint)
+//*****************************************************************************
+inline bool ossimEcefPoint::operator!=(const ossimEcefPoint& p) const
+{
+   return (theData != p.theData);
+}
+
+#endif
diff --git a/ossim/include/ossim/base/ossimEcefRay.h b/include/ossim/base/ossimEcefRay.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEcefRay.h
rename to include/ossim/base/ossimEcefRay.h
diff --git a/ossim/include/ossim/base/ossimEcefVector.h b/include/ossim/base/ossimEcefVector.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEcefVector.h
rename to include/ossim/base/ossimEcefVector.h
diff --git a/ossim/include/ossim/base/ossimElevationManagerEvent.h b/include/ossim/base/ossimElevationManagerEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimElevationManagerEvent.h
rename to include/ossim/base/ossimElevationManagerEvent.h
diff --git a/ossim/include/ossim/base/ossimElevationManagerEventListener.h b/include/ossim/base/ossimElevationManagerEventListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimElevationManagerEventListener.h
rename to include/ossim/base/ossimElevationManagerEventListener.h
diff --git a/ossim/include/ossim/base/ossimEllipsoid.h b/include/ossim/base/ossimEllipsoid.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEllipsoid.h
rename to include/ossim/base/ossimEllipsoid.h
diff --git a/ossim/include/ossim/base/ossimEllipsoidFactory.h b/include/ossim/base/ossimEllipsoidFactory.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEllipsoidFactory.h
rename to include/ossim/base/ossimEllipsoidFactory.h
diff --git a/include/ossim/base/ossimEndian.h b/include/ossim/base/ossimEndian.h
new file mode 100644
index 0000000..f40523a
--- /dev/null
+++ b/include/ossim/base/ossimEndian.h
@@ -0,0 +1,277 @@
+//******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+// 
+// Description: This file contains the interface to the
+//              endian byte swap
+//
+//***********************************
+// $ID$
+#ifndef ossimEndian_HEADER
+#define ossimEndian_HEADER
+
+// for OSSIM_LITTLE_ENDIAN AND BIG_ENDIAN
+#include <ossim/base/ossimConstants.h>
+
+class OSSIMDLLEXPORT ossimEndian
+{
+public:
+   ossimEndian();
+
+   /*!
+    *  Swap bytes methods that work on a single pixel.
+    */
+   inline void swap(ossim_sint8    &/*data*/){}
+   inline void swap(ossim_uint8    &/*data*/){}
+   inline void swap(ossim_int16   &data) const;
+   inline void swap(ossim_uint16  &data) const;
+   inline void swap(ossim_int32   &data) const;
+   inline void swap(ossim_uint32  &data) const;
+   inline void swap(ossim_uint64  &data) const;
+   inline void swap(ossim_sint64  &data) const;
+   inline void swap(ossim_float32 &data) const;
+   inline void swap(ossim_float64 &data) const;
+
+   /*!
+    *  Swap bytes methods that work on arrays of pixels.
+    *
+    *  @note size is number of pixels, not number of bytes.
+    */
+   inline void swap(ossimScalarType scalar, void* data, ossim_uint32 size) const;
+   // only here to allow template based swaps to compile correctly
+   //
+   inline void swap(ossim_sint8* data, ossim_uint32 size)const;
+   inline void swap(ossim_uint8* data, ossim_uint32 size)const;
+   
+   inline void swap(ossim_int16* data, ossim_uint32 size) const;
+   inline void swap(ossim_uint16* data, ossim_uint32 size) const;
+
+   inline void swap(ossim_int32* data, ossim_uint32 size) const;
+   inline void swap(ossim_uint32* data, ossim_uint32 size) const;
+
+   inline void swap(ossim_int64* data, ossim_uint32 size) const;
+   inline void swap(ossim_uint64* data, ossim_uint32 size) const;
+
+   inline void swap(ossim_float32* data, ossim_uint32 size) const;
+   inline void swap(ossim_float64* data, ossim_uint32 size) const;
+
+   inline void swapTwoBytes(void* data, ossim_uint32 size) const;
+   inline void swapFourBytes(void* data, ossim_uint32 size) const;
+   inline void swapEightBytes(void* data, ossim_uint32 size) const;
+   inline ossimByteOrder getSystemEndianType() const;
+
+private:
+
+   // Holds the Endian of the architecture that you are running on.
+   ossimByteOrder  theSystemEndianType;  
+   
+   void swapTwoBytes(void *data) const;
+   void swapFourBytes(void *data) const;
+   void swapEightBytes(void *data) const;
+
+   void swapPrivate(ossim_uint8 *c1,
+                    ossim_uint8 *c2) const;
+};
+
+inline ossimByteOrder ossimEndian::getSystemEndianType() const
+{
+   return theSystemEndianType;
+}
+
+inline void ossimEndian::swap(ossim_sint8* /* data */,
+                              ossim_uint32 /* size */ )const
+{
+   //intentionally left blank
+}
+
+inline void ossimEndian::swap(ossim_uint8* /* data */,
+                              ossim_uint32 /* size */ )const
+{
+   //intentionally left blank
+}
+
+inline void ossimEndian::swap(ossim_int16 &data) const
+{
+   swapTwoBytes(reinterpret_cast<void*>(&data));   
+} 
+
+inline void ossimEndian::swap(ossim_uint16 &data) const
+{
+   swapTwoBytes(reinterpret_cast<void*>(&data));
+}
+
+inline void ossimEndian::swap(ossim_int32 &data) const
+{
+   swapFourBytes(reinterpret_cast<void*>(&data));
+}
+
+inline void ossimEndian::swap(ossim_uint32 &data) const
+{
+   swapFourBytes(reinterpret_cast<void*>(&data));
+}
+
+inline void ossimEndian::swap(ossim_uint64 &data) const
+{
+   swapEightBytes(reinterpret_cast<void*>(&data));
+}
+
+inline void ossimEndian::swap(ossim_sint64 &data) const
+{
+   swapEightBytes(reinterpret_cast<void*>(&data));
+}
+
+inline void ossimEndian::swap(ossim_float32 &data) const
+{
+   swapFourBytes(reinterpret_cast<void*>(&data));
+}
+
+inline void ossimEndian::swap(ossim_float64 &data) const
+{
+   swapEightBytes(reinterpret_cast<void*>(&data));
+}
+
+inline void ossimEndian::swapTwoBytes(void *data) const
+{
+   unsigned char *c = reinterpret_cast<unsigned char*>(data);
+
+   swapPrivate(&c[0], &c[1]);
+}
+
+inline void ossimEndian::swapFourBytes(void* data) const
+{
+   unsigned char *c = reinterpret_cast<unsigned char*>(data);
+
+   swapPrivate(&c[0], &c[3]);
+   swapPrivate(&c[1], &c[2]);
+}
+
+inline void ossimEndian::swapEightBytes(void* data) const
+{
+   unsigned char *c = reinterpret_cast<unsigned char*>(data);
+
+   swapPrivate(&c[0], &c[7]);
+   swapPrivate(&c[1], &c[6]);
+   swapPrivate(&c[2], &c[5]);
+   swapPrivate(&c[3], &c[4]);
+}
+
+inline void ossimEndian::swapPrivate(ossim_uint8 *c1,                       
+                                     ossim_uint8 *c2) const
+{
+   ossim_uint8 temp_c = *c1;
+   *c1 = *c2;
+   *c2 = temp_c;
+}
+
+inline void ossimEndian::swap(ossimScalarType scalar,
+                              void* data, ossim_uint32 size) const
+{
+   switch (scalar)
+   {
+      case OSSIM_USHORT16:
+      case OSSIM_SSHORT16:
+      case  OSSIM_USHORT11:
+      case  OSSIM_USHORT12:
+      case  OSSIM_USHORT13:
+      case  OSSIM_USHORT14:
+      case  OSSIM_USHORT15:
+         swapTwoBytes(data, size);
+         return;
+         
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+         swapFourBytes(data, size);
+         return;
+         
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+         swapEightBytes(data, size);
+         break;
+         
+      default:
+         return;
+   }
+}
+
+inline void ossimEndian::swap(ossim_int16* data, ossim_uint32 size) const
+{
+   swapTwoBytes(data, size);
+}
+
+inline void ossimEndian::swap(ossim_uint16* data, ossim_uint32 size) const
+{
+   swapTwoBytes(data, size);
+}
+
+inline void ossimEndian::swap(ossim_int32* data, ossim_uint32 size) const
+{
+   swapFourBytes(data, size);
+}
+
+inline void ossimEndian::swap(ossim_uint32* data, ossim_uint32 size) const
+{
+   swapFourBytes(data, size);
+}
+
+inline void ossimEndian::swap(ossim_int64* data, ossim_uint32 size) const
+{
+   swapEightBytes(data, size);
+}
+
+inline void ossimEndian::swap(ossim_uint64* data, ossim_uint32 size) const
+{
+   swapEightBytes(data, size);
+}
+
+inline void ossimEndian::swap(ossim_float32* data, ossim_uint32 size) const
+{
+   swapFourBytes(data, size);
+}
+
+inline void ossimEndian::swap(ossim_float64* data, ossim_uint32 size) const
+{
+   swapEightBytes(data, size);
+}
+
+inline void ossimEndian::swapTwoBytes(void* data, ossim_uint32 size) const
+{
+   ossim_uint16* buf = reinterpret_cast<ossim_uint16*>(data);
+   for (ossim_uint32 i=0; i<size; ++i)
+   {
+      buf[i] = ((buf[i] & 0x00ff) << 8) | ((buf[i] & 0xff00) >> 8);
+   }
+}
+
+inline void ossimEndian::swapFourBytes(void* data, ossim_uint32 size) const
+{
+   ossim_uint32* buf = reinterpret_cast<ossim_uint32*>(data);
+   for (ossim_uint32 i=0; i<size; ++i)
+   {
+      buf[i]
+         = (  ((buf[i] & 0xff000000) >> 24)
+            | ((buf[i] & 0x00ff0000) >> 8)
+            | ((buf[i] & 0x0000ff00) << 8)
+            | ((buf[i] & 0x000000ff) << 24));
+   }
+}
+
+inline void ossimEndian::swapEightBytes(void* data, ossim_uint32 size) const
+{
+   ossim_uint64* buf = reinterpret_cast<ossim_uint64*>(data);
+   for (ossim_uint32 i=0; i<size; ++i)
+   {
+      buf[i]
+         = (  ((buf[i] & 0xff00000000000000ull) >> 56)
+            | ((buf[i] & 0x00ff000000000000ull) >> 40)
+            | ((buf[i] & 0x0000ff0000000000ull) >> 24)
+            | ((buf[i] & 0x000000ff00000000ull) >> 8)
+            | ((buf[i] & 0x00000000ff000000ull) << 8)
+            | ((buf[i] & 0x0000000000ff0000ull) << 24)
+            | ((buf[i] & 0x000000000000ff00ull) << 40)
+            | ((buf[i] & 0x00000000000000ffull) << 56));
+   }
+}
+
+#endif /* End of #ifndef ossimEndian_HEADER */
diff --git a/include/ossim/base/ossimEnvironmentUtility.h b/include/ossim/base/ossimEnvironmentUtility.h
new file mode 100644
index 0000000..e014d86
--- /dev/null
+++ b/include/ossim/base/ossimEnvironmentUtility.h
@@ -0,0 +1,61 @@
+#ifndef ossimEnvironmentUtility_HEADER
+#define ossimEnvironmentUtility_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+
+class OSSIM_DLL ossimEnvironmentUtility
+{
+public:
+   typedef std::vector<ossimFilename> FilenameListType;
+   
+   
+   static ossimEnvironmentUtility* instance();
+
+   ossimString getEnvironmentVariable(const ossimString& variable)const;
+   void setEnvironmentVariable(const char* variable, const char* value) const;
+
+   ossimFilename getUserDir()const;
+   ossimString   getUserName()const;
+   ossimFilename getUserOssimSupportDir()const;
+   ossimFilename getUserOssimPreferences()const;
+   ossimFilename getUserOssimPluginDir()const;
+   
+   ossimFilename getInstalledOssimSupportDir()const;
+   ossimFilename getInstalledOssimPluginDir()const;
+   ossimFilename getInstalledOssimPreferences()const;
+
+   /**
+    * @return The current working dir which is $(PWD) for unix $(CD) for
+    * windows.
+    */
+   ossimFilename getCurrentWorkingDir()const;
+
+   ossimFilename searchAllPaths(const ossimFilename& file)const;
+   
+   ossimFilename findPlugin(const ossimFilename& plugin)const;
+   ossimFilename findData(const ossimFilename& data)const;
+
+   void addDataSearchPath(const ossimFilename& path);
+   void addDataSearchPathToFront(const ossimFilename& path);
+   void addPluginSearchPath(const ossimFilename& path);
+   void addPluginSearchPathToFront(const ossimFilename& path);
+ 
+   ossimEnvironmentUtility::FilenameListType& getPluginSearchPath();
+   const ossimEnvironmentUtility::FilenameListType& getPluginSearchPath()const;
+   ossimEnvironmentUtility::FilenameListType& getDataSearchPath();
+   const ossimEnvironmentUtility::FilenameListType& getDataSearchPath()const;
+   
+private:
+   static ossimEnvironmentUtility* theInstance;
+
+   ossimEnvironmentUtility::FilenameListType thePluginSearchPath;
+   ossimEnvironmentUtility::FilenameListType theDataSearchPath;
+
+   ossimEnvironmentUtility();
+   ossimEnvironmentUtility(const ossimEnvironmentUtility& obj);
+   const ossimEnvironmentUtility& operator=
+      (const ossimEnvironmentUtility& rhs);
+};
+
+
+#endif
diff --git a/ossim/include/ossim/base/ossimEpsgDatumFactory.h b/include/ossim/base/ossimEpsgDatumFactory.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEpsgDatumFactory.h
rename to include/ossim/base/ossimEpsgDatumFactory.h
diff --git a/ossim/include/ossim/base/ossimEquTokenDefines.h b/include/ossim/base/ossimEquTokenDefines.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEquTokenDefines.h
rename to include/ossim/base/ossimEquTokenDefines.h
diff --git a/ossim/include/ossim/base/ossimEquTokenizer.h b/include/ossim/base/ossimEquTokenizer.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEquTokenizer.h
rename to include/ossim/base/ossimEquTokenizer.h
diff --git a/ossim/include/ossim/base/ossimErrorCodes.h b/include/ossim/base/ossimErrorCodes.h
similarity index 100%
rename from ossim/include/ossim/base/ossimErrorCodes.h
rename to include/ossim/base/ossimErrorCodes.h
diff --git a/ossim/include/ossim/base/ossimErrorContext.h b/include/ossim/base/ossimErrorContext.h
similarity index 100%
rename from ossim/include/ossim/base/ossimErrorContext.h
rename to include/ossim/base/ossimErrorContext.h
diff --git a/ossim/include/ossim/base/ossimErrorStatusInterface.h b/include/ossim/base/ossimErrorStatusInterface.h
similarity index 100%
rename from ossim/include/ossim/base/ossimErrorStatusInterface.h
rename to include/ossim/base/ossimErrorStatusInterface.h
diff --git a/ossim/include/ossim/base/ossimEvent.h b/include/ossim/base/ossimEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEvent.h
rename to include/ossim/base/ossimEvent.h
diff --git a/ossim/include/ossim/base/ossimEventIds.h b/include/ossim/base/ossimEventIds.h
similarity index 100%
rename from ossim/include/ossim/base/ossimEventIds.h
rename to include/ossim/base/ossimEventIds.h
diff --git a/ossim/include/ossim/base/ossimException.h b/include/ossim/base/ossimException.h
similarity index 100%
rename from ossim/include/ossim/base/ossimException.h
rename to include/ossim/base/ossimException.h
diff --git a/ossim/include/ossim/base/ossimFactoryBaseTemplate.h b/include/ossim/base/ossimFactoryBaseTemplate.h
similarity index 100%
rename from ossim/include/ossim/base/ossimFactoryBaseTemplate.h
rename to include/ossim/base/ossimFactoryBaseTemplate.h
diff --git a/include/ossim/base/ossimFactoryListInterface.h b/include/ossim/base/ossimFactoryListInterface.h
new file mode 100644
index 0000000..f96001c
--- /dev/null
+++ b/include/ossim/base/ossimFactoryListInterface.h
@@ -0,0 +1,265 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class declaration of ossimFactoryListInterface.
+//
+//**************************************************************************************************
+// $Id$
+#ifndef ossimFactoryListInterface_HEADER
+#define ossimFactoryListInterface_HEADER
+#include <OpenThreads/Mutex>
+#include <OpenThreads/ScopedLock>
+#include <vector>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+/**
+ * The is a factory list interface that allows registries to be accessed in a common way.  
+ */
+template <class T, class NativeType>
+class ossimFactoryListInterface
+   {
+   public:
+      typedef std::vector<T*> FactoryListType;
+      typedef T FactoryType;
+      typedef NativeType NativeReturnType;
+      
+      ossimFactoryListInterface(){}
+      
+      /**
+       * This is for backward compatability and calls registerFactory for simple adds.
+       */
+      void addFactory(T* factory)
+      {
+         registerFactory(factory);
+      }
+      
+      /**
+       * Public access method to determine if a factory is already registered to this
+       * list
+       */
+      bool isFactoryRegistered(T* factory)const
+      {
+         if(!factory) return false;
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+         
+         return findFactory(factory);
+      }
+      
+      /**
+       * Will register a factory to the factory list.  Will append the passed in factory if not
+       * already registered to the list.
+       */
+      void registerFactory(T* factory, bool pushToFrontFlag=false)
+      {
+         if(!factory) return;
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+         if(!findFactory(factory))
+         {
+            if (pushToFrontFlag)
+            {
+               m_factoryList.insert(m_factoryList.begin(), factory);
+            }
+            else
+            {
+               m_factoryList.push_back(factory);
+            }
+         }
+      }
+      /**
+       * Will remove the factory from the registry.
+       */
+      void unregisterFactory(T* factory)
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+         ossim_uint32 idx = 0;
+         for(idx = 0; idx < m_factoryList.size(); ++idx)
+         {
+            if(factory == m_factoryList[idx])
+            {
+               m_factoryList.erase(m_factoryList.begin() + idx);
+               return;
+            }
+         }
+      }
+      
+      /**
+       * Will remove all factories from the registry.
+       */
+      void unregisterAllFactories()
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+         m_factoryList.clear();
+      }
+      
+      /**
+       * Inserts the factory to the front of the list.
+       */
+      void registerFactoryToFront(T* factory)
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+         if(!findFactory(factory))
+         {
+            m_factoryList.insert(m_factoryList.begin(), factory);
+         }
+      }
+      
+      /**
+       * Will insert the factory before the beforeThisFactory.  If not found
+       * it will do a simple append.
+       */
+      void registerFactoryBefore(T* factory, T* beforeThisFactory)
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+         if(!findFactory(factory))
+         {
+            ossim_uint32 idx = 0;
+            for(idx = 0; idx < m_factoryList.size(); ++idx)
+            {
+               if(beforeThisFactory == m_factoryList[idx])
+               {
+                  m_factoryList.insert(m_factoryList.begin() + idx, factory);
+                  return;
+               }
+            }
+            m_factoryList.push_back(factory);
+         }
+      }
+      
+      /**
+       *
+       * Will add all object types the factories can allocate.  Typically a list of classnames are returned
+       *
+       */
+      void getAllTypeNamesFromRegistry(std::vector<ossimString>& typeList)const;
+      
+      /**
+       * This is the base object return for all objects in the system.  This is used for 
+       * backward compatability.
+       */
+      ossimObject* createObjectFromRegistry(const ossimString& typeName)const;
+      
+      /**
+       * This is the base object return for all objects in the system.  This is used for 
+       * backward compatability.
+       */
+      ossimObject* createObjectFromRegistry(const ossimKeywordlist& kwl,
+                                            const char* prefix=0)const;
+
+      /**
+       * This is a helper method that calls the createObject and makes sure that the
+       * returned object is of the NativeType base type this registry supports.
+       */
+      NativeType* createNativeObjectFromRegistry(const ossimString& typeName)const;
+      
+      /**
+       * This is a helper method that calls the createObject and makes sure that the
+       * returned object is of the NativeType base type this registry supports.
+       *
+       * @param kwl is a state keywordlist allowing one to instantiate an object 
+       *        defined by a set of name value pairs.  It will use the type 
+       *        keyword to create an object of the defined type and then load the 
+       *        state.
+       */
+      NativeType* createNativeObjectFromRegistry(const ossimKeywordlist& kwl,
+                                                 const char* prefix=0)const;
+   protected:
+      /**
+       * Utility to find a factory in the list
+       */
+      bool findFactory(T* factory)const
+      {
+         if(!factory) return false;
+         ossim_uint32 idx = 0;
+         for(;idx < m_factoryList.size();++idx)
+         {
+            if(m_factoryList[idx] == factory)
+            {
+               return true;
+            }
+         }
+         
+         return false;
+      }
+      mutable OpenThreads::Mutex m_factoryListMutex;
+      FactoryListType m_factoryList;
+   };
+
+template <class T, class NativeType>
+void ossimFactoryListInterface<T, NativeType>::getAllTypeNamesFromRegistry(std::vector<ossimString>& typeList)const
+{
+   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+   ossim_uint32 idx = 0;
+   for(; idx<m_factoryList.size(); ++idx)
+   {
+      m_factoryList[idx]->getTypeNameList(typeList);
+   }
+}
+template <class T, class NativeType>
+ossimObject* ossimFactoryListInterface<T, NativeType>::createObjectFromRegistry(const ossimString& typeName)const
+{
+   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+   ossimObject* result = 0;
+   ossim_uint32 idx = 0;
+   for(;((idx<m_factoryList.size())&&!result); ++idx)
+   {
+      result = m_factoryList[idx]->createObject(typeName);
+   }
+   return result;
+}
+
+template <class T, class NativeType>
+ossimObject* ossimFactoryListInterface<T, NativeType>::createObjectFromRegistry(const ossimKeywordlist& kwl,
+                                                                                const char* prefix)const
+{
+   // OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+   ossimObject* result = 0;
+   ossim_uint32 idx = 0;
+   for(;((idx<m_factoryList.size())&&!result); ++idx)
+   {
+      result = m_factoryList[idx]->createObject(kwl, prefix);
+   }
+   return result;
+}
+
+template <class T, class NativeType>
+NativeType* ossimFactoryListInterface<T, NativeType>::createNativeObjectFromRegistry(const ossimString& typeName)const
+{
+   NativeType* result = 0;
+   ossimRefPtr<ossimObject> tempObject = createObjectFromRegistry(typeName);
+   if(tempObject.valid())
+   {
+      result = dynamic_cast<NativeType*>(tempObject.get());
+      if(result)
+      {
+         tempObject.release();
+      }
+   }
+   
+   return result;
+}
+
+template <class T, class NativeType>
+NativeType* ossimFactoryListInterface<T, NativeType>::createNativeObjectFromRegistry(const ossimKeywordlist& kwl,
+                                                                                     const char* prefix)const
+{
+   NativeType* result = 0;
+   ossimRefPtr<ossimObject> tempObject = createObjectFromRegistry(kwl, prefix);
+   if(tempObject.valid())
+   {
+      result = dynamic_cast<NativeType*>(tempObject.get());
+      if(result)
+      {
+         tempObject.release();
+      }
+   }
+   
+   return result;
+}
+
+#endif
diff --git a/include/ossim/base/ossimFileProcessorInterface.h b/include/ossim/base/ossimFileProcessorInterface.h
new file mode 100644
index 0000000..1611c4d
--- /dev/null
+++ b/include/ossim/base/ossimFileProcessorInterface.h
@@ -0,0 +1,41 @@
+//----------------------------------------------------------------------------
+// File: ossimFileProcessorInterface.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class interface ossimFileProcessorInterface.
+//
+// Has pure virtual "processFile" method that derived classes must
+// implement to be concrete. 
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimFileProcessorInterface_HEADER
+#define ossimFileProcessorInterface_HEADER 1
+
+class ossimFilename;
+
+/** @class ossimFileProcessorInterface */
+class ossimFileProcessorInterface
+{
+public:
+   
+   /** @brief default constructor */
+   ossimFileProcessorInterface(){}
+
+   /** @brief virtual destructor. */
+   virtual ~ossimFileProcessorInterface(){}
+
+   /**
+    * @brief Pure virtual processFile method. Derived classed must implement.
+    * @param file to process.
+    */
+   virtual void processFile(const ossimFilename& file) = 0;
+};
+
+#endif /* #ifndef ossimFileProcessorInterface_HEADER */
diff --git a/include/ossim/base/ossimFilename.h b/include/ossim/base/ossimFilename.h
new file mode 100644
index 0000000..6101f17
--- /dev/null
+++ b/include/ossim/base/ossimFilename.h
@@ -0,0 +1,293 @@
+//---
+//
+// License: MIT
+//
+// Author: Ken Melero
+//
+// Description: This class provides manipulation of filenames.
+//
+//---
+// $Id$
+
+#ifndef ossimFilename_HEADER
+#define ossimFilename_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+
+class ossimLocalTm;
+
+class OSSIM_DLL ossimFilename : public ossimString
+{
+public:
+   enum AccessModes
+   {
+      OSSIM_READ_WRITE = 6,
+      OSSIM_READ       = 4,
+      OSSIM_WRITE      = 2,
+      OSSIM_EXE	       = 1, // The PC docs say that this is ignored
+      OSSIM_EXIST      = 0
+   };
+   ossimFilename();
+   ossimFilename(const ossimFilename& src);
+   ossimFilename(const ossimString& src);
+   ossimFilename(const std::string& src);
+   ossimFilename(const char* src);
+   const ossimFilename& operator=(const ossimFilename& f);
+
+   template <class Iter> ossimFilename(Iter s, Iter e);
+
+   static const ossimFilename NIL;
+
+   bool operator == (const ossimFilename& rhs)const;
+   
+   bool operator == (const ossimString& rhs)const;
+   bool operator == (const char* rhs)const;
+
+   /** @brief Writes f to the output stream os. */
+//    friend std::ostream& operator<<(std::ostream& os,
+   //                                const ossimFilename& s);
+   
+   // void convertBackToForwardSlashes();
+   // void convertForwardToBackSlashes();
+
+   bool setTimes(ossimLocalTm* accessTime,
+                 ossimLocalTm* modTime,
+                 ossimLocalTm* createTime)const;
+   bool getTimes(ossimLocalTm* accessTime,
+                 ossimLocalTm* modTime,
+                 ossimLocalTm* createTime)const;
+   /**
+    * @brief Time in seconds since last accessed.
+    * 
+    * @return The number of seconds since last accessed or -1 if file does not
+    * exist.
+    */
+   ossim_int64 lastAccessed() const;
+   
+   bool touch()const;
+   
+   /**
+    * Method to do file name expansion.
+    *
+    * Like: ~/docs will be expanded to /home/user/docs
+    *
+    * @return The expanded file name.
+    *
+    * @note METHOD IS NOT COMPLETE YET.
+    */
+   ossimFilename expand() const;
+   
+   // Methods to test ossimFilename for various states.
+   bool        exists()       const;
+   bool        isFile()       const;
+   bool        isDir()        const;
+   bool        isReadable()   const;
+   bool        isUrl()        const;
+   bool        isWriteable()  const;
+   bool        isExecutable() const;
+   
+   ossim_int64 fileSize()     const;
+   
+   // Methods to access parts of the ossimFilename.
+
+   /**
+    * @return "tif" if file is "/data/images/t1.tif".
+    *
+    * @note The '.' (dot) is not returned.
+    */
+   ossimString   ext() const;
+
+   /**
+    * @return @return "/data/images" if file is "/data/images/t1.tif".
+    */
+   ossimFilename path() const;
+
+   /**
+    * @return @return "c:" if file is "c:\data\images\t1.tif".
+    */
+   ossimFilename drive() const;
+   
+   /**
+    * @return @return "t1.tif" if file is "/data/images/t1.tif".
+    */
+   ossimFilename file() const;
+
+   /**
+    * @return @return "t1" if file is "/data/images/t1.tif".
+    */
+   ossimFilename fileNoExtension() const;
+
+   /**
+    * @return @return "/data/images/t1" if file is "/data/images/t1.tif".
+    *
+    * @note  The '.' (dot) is not returned.
+    */
+   ossimFilename noExtension() const;
+
+   /**
+    * Sets the extension of a file name.
+    *
+    * Given:
+    * ossimFilename f = "foo";
+    * f.setExtension("tif");
+    * f now equals "foo.tif"
+    *
+    * Given: 
+    * ossimFilename f = "foo.jpg";
+    * f.setExtension("tif");
+    * f now equals "foo.tif"
+    * 
+    * Given: 
+    * ossimFilename f = "foo.jpg";
+    * f.setExtension(".tif");
+    * f now equals "foo.tif"
+    *
+    * Given: 
+    * ossimFilename f = "foo.";
+    * ossimFilename f2;
+    * f2 = f.setExtension("tif");
+    * f now equals "foo.tif"
+    * f2 now equals "foo.tif"
+    *
+    * @param e Extension to add or replace.
+    *
+    * @returns a reference to this.
+    */
+   ossimFilename& setExtension(const ossimString& e);
+
+   /**
+	* Sets the file path and drive.
+	* Input: the drive to be set (this should come from the user's preferences)
+	* Example: "x:"
+	* Given: "/filepath/file.ext"
+    * @return @return "c:\filepath\file.ext".
+    */
+   ossimFilename& setDrive(const ossimString& d);
+   ossimFilename& setPath(const ossimString& p);
+   ossimFilename& setFile(const ossimString& f);
+   
+   void split(ossimString& drivePart,
+              ossimString& pathPart,
+              ossimString& filePart,
+              ossimString& extPart)const;
+   
+   void merge(const ossimString& drivePart,
+              const ossimString& pathPart,
+              const ossimString& filePart,
+              const ossimString& extPart);
+   /*!
+    * Returns file appended onto this string. Path seperator is always placed
+    * between this and file.  Returns file if this string is empty.
+    * Given: this = /foo  and file  = bar output  = /foo/bar
+    * Given: this = /foo/ and file  = bar output  = /foo/bar
+    */
+   ossimFilename dirCat(const ossimFilename& file) const;
+
+   /*!
+    */
+   bool createDirectory(bool recurseFlag=true,
+                        int perm=0775)const;
+
+   /*!
+    * @brief Removes pathname from filesystem if supported by platform.
+    *
+    * If pathname is a directory it will only be removed if empty. If supported
+    * will set errno and output equivalent string if one occurs.
+    *
+    * @return true on success, false on error.
+    */
+   static bool remove(const ossimFilename& pathname);
+
+   /**
+    * Will use a wildcard remove.  NOTE:  This is in
+    * a regular expression format so if you want all
+    * files with prefix myfile to be erased then you would give
+    * it <path>/myfile.*
+    *
+    * The . here is a regular expression '.' character which says any character
+    * and the * "is any number of"
+    * 
+    */ 
+   static bool wildcardRemove(const ossimFilename& pathname);
+
+   bool rename(const ossimFilename& destFile, bool overwriteDestinationFlag=true)const;
+   
+   bool remove()const;
+   bool wildcardRemove()const;
+
+   /**
+    * @brief Copies this file to output file.
+    *
+    * Copies this to output file. If output file is a directory, this->file() is
+    * appended to output file.
+    * 
+    * @param outputFile File name to copy to.
+    * 
+    * @return True on success, false on error.
+    */
+   bool copyFileTo(const ossimFilename& outputFile) const;
+
+   /**
+    * @brief Checks whether file name is relative or absolute.
+    * 
+    * @return true if file name has a relative path, false if absolute.
+    *
+    * @note This will return true if file name is empty.
+    */
+   bool isRelative() const;
+   
+   /**
+    * @brief Method to check if expansion is needed.
+    *
+    * This checks if file isRelative() first if isRelative is false (has
+    * absolute path) it then walks the file and looks for '$'.
+    * 
+    * @return true if file name is relative or has environment vars.
+    *
+    * @note This will return false if file name is empty.
+    */
+   bool needsExpansion() const;
+
+   /** @return The path separator. */
+   char getPathSeparator() const;
+   
+   /**
+    * Convenience method to append a generic timestamp to the base-name portion of the filename.
+    * This is useful for establishing rolling names for temporary files and logs. Returns this.
+    */
+   ossimFilename& appendTimestamp();
+
+   /**
+    * Convenience method to append a string to the base-name portion of the filename. Returns this.
+    */
+   ossimFilename& append(const ossimString& append_this_to_filename);
+
+   /**
+    * @return This as a string converted to native slashes.
+    */
+   std::string native() const;
+
+protected:
+
+   /**
+    * @brief Converts slashes of this to internal '/' format.
+    */
+   void converPathSeparator();
+
+   //    void convertToNative();
+
+   /*!
+    * since windows uses \ for path separation
+    * and unix / we need to be consistent.
+    */
+   static const char OSSIM_NATIVE_PATH_SEPARATOR;
+   static const char OSSIM_FILENAME_PATH_SEPARATOR;
+};
+
+// inline std::ostream& operator<<(std::ostream& os, const ossimFilename& f)
+// {
+//   return os << f.string().c_str();
+// }
+
+#endif
diff --git a/ossim/include/ossim/base/ossimFilenameProperty.h b/include/ossim/base/ossimFilenameProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimFilenameProperty.h
rename to include/ossim/base/ossimFilenameProperty.h
diff --git a/ossim/include/ossim/base/ossimFlexLexer.h b/include/ossim/base/ossimFlexLexer.h
similarity index 100%
rename from ossim/include/ossim/base/ossimFlexLexer.h
rename to include/ossim/base/ossimFlexLexer.h
diff --git a/ossim/include/ossim/base/ossimFontInformation.h b/include/ossim/base/ossimFontInformation.h
similarity index 100%
rename from ossim/include/ossim/base/ossimFontInformation.h
rename to include/ossim/base/ossimFontInformation.h
diff --git a/ossim/include/ossim/base/ossimFontProperty.h b/include/ossim/base/ossimFontProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimFontProperty.h
rename to include/ossim/base/ossimFontProperty.h
diff --git a/ossim/include/ossim/base/ossimFpt.h b/include/ossim/base/ossimFpt.h
similarity index 100%
rename from ossim/include/ossim/base/ossimFpt.h
rename to include/ossim/base/ossimFpt.h
diff --git a/ossim/include/ossim/base/ossimFpt3d.h b/include/ossim/base/ossimFpt3d.h
similarity index 100%
rename from ossim/include/ossim/base/ossimFpt3d.h
rename to include/ossim/base/ossimFpt3d.h
diff --git a/ossim/include/ossim/base/ossimGeoPolygon.h b/include/ossim/base/ossimGeoPolygon.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeoPolygon.h
rename to include/ossim/base/ossimGeoPolygon.h
diff --git a/ossim/include/ossim/base/ossimGeoTiffCoordTransformsLut.h b/include/ossim/base/ossimGeoTiffCoordTransformsLut.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeoTiffCoordTransformsLut.h
rename to include/ossim/base/ossimGeoTiffCoordTransformsLut.h
diff --git a/include/ossim/base/ossimGeoTiffDatumLut.h b/include/ossim/base/ossimGeoTiffDatumLut.h
new file mode 100644
index 0000000..5d0ae0d
--- /dev/null
+++ b/include/ossim/base/ossimGeoTiffDatumLut.h
@@ -0,0 +1,74 @@
+//*******************************************************************
+// Copyright (C) 2001 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for GeoTiffDatumLut. Used to map a
+// geotiff coordinate transformation code to an ossim projection.
+//*******************************************************************
+//  $Id: ossimGeoTiffDatumLut.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef ossimGeoTiffDatumLut_HEADER
+#define ossimGeoTiffDatumLut_HEADER
+
+#include <ossim/base/ossimLookUpTable.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+class OSSIMDLLEXPORT ossimGeoTiffDatumLut : public ossimLookUpTable
+{
+public:
+
+   enum
+   {
+      //---
+      // Datum codes cut from geotiff specification section 6.3.2.1.
+      //---
+      GCS_Adindan                     = 4201,
+      GCS_Arc_1950                    = 4209,
+      GCS_Arc_1960                    = 4210,
+      GCS_ED50                        = 4230,
+      GCS_NAD27                       = 4267,
+      GCS_NAD83                       = 4269,
+      GCS_OSGB_1936                   = 4277,
+      GCS_WGS_72                      = 4322,
+      GCS_WGS_84                      = 4326,
+      GCS_Tokyo                       = 4301,
+      GCS_NAD83_HARN                  = 4152,
+
+      //---
+      // Datum codes cut from geotiff specification section 6.3.2.1.
+      // NOTE:  These codes imply an ellipsoid only!
+      //---
+      GCS_Clark_1866                  = 4008,
+      
+      //---
+      // Datum codes cut from geotiff specification section 6.3.2.2.
+      //---
+      DatumE_WGS84                    = 6030,
+      Datum_Adindan                   = 6201,
+      Datum_Arc_1950                  = 6209,
+      Datum_Arc_1960                  = 6210,
+      Datum_European_Datum_1950       = 6230,
+      Datum_North_American_Datum_1927 = 6267,
+      Datum_North_American_Datum_1983 = 6269,
+      Datum_OSGB_1936                 = 6277,
+      Datum_Tokyo                     = 6301,
+      Datum_WGS72                     = 6322,
+      Datum_WGS84                     = 6326,
+      Datum_NAD83_HARN                = 6152
+   };
+   
+   ossimGeoTiffDatumLut();
+
+   virtual ~ossimGeoTiffDatumLut();
+   
+   virtual ossimKeyword getKeyword() const;
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimGeocent.h b/include/ossim/base/ossimGeocent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeocent.h
rename to include/ossim/base/ossimGeocent.h
diff --git a/ossim/include/ossim/base/ossimGeodeticEvaluator.h b/include/ossim/base/ossimGeodeticEvaluator.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeodeticEvaluator.h
rename to include/ossim/base/ossimGeodeticEvaluator.h
diff --git a/ossim/include/ossim/base/ossimGeoid.h b/include/ossim/base/ossimGeoid.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeoid.h
rename to include/ossim/base/ossimGeoid.h
diff --git a/include/ossim/base/ossimGeoidEgm96.h b/include/ossim/base/ossimGeoidEgm96.h
new file mode 100644
index 0000000..8fd90bc
--- /dev/null
+++ b/include/ossim/base/ossimGeoidEgm96.h
@@ -0,0 +1,65 @@
+//*******************************************************************
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimGeoidEgm96 which is
+// "Earth Gravity Model 1996".
+//
+//*******************************************************************
+//  $Id: ossimGeoidEgm96.h 22900 2014-09-30 09:56:11Z dburken $
+
+#ifndef ossimGeoidEgm96_HEADER
+#define ossimGeoidEgm96_HEADER
+
+#include <ossim/base/ossimGeoid.h>
+#include <vector>
+
+#define GEOID_NO_ERROR              0x0000
+#define GEOID_FILE_OPEN_ERROR       0x0001
+#define GEOID_INITIALIZE_ERROR      0x0002
+#define GEOID_NOT_INITIALIZED_ERROR 0x0004
+#define GEOID_LAT_ERROR             0x0008
+#define GEOID_LON_ERROR             0x0010
+
+class ossimGpt;
+
+class OSSIMDLLEXPORT ossimGeoidEgm96 : public ossimGeoid
+{
+
+public:
+   ossimGeoidEgm96();
+   ossimGeoidEgm96(const ossimFilename& grid_file,
+                   ossimByteOrder byteOrder=OSSIM_BIG_ENDIAN);
+   
+   virtual ~ossimGeoidEgm96();
+
+   virtual bool open(const ossimFilename& grid_file,
+                     ossimByteOrder byteOrder=OSSIM_BIG_ENDIAN);
+
+   virtual ossimString getShortName()const;
+   
+   /**
+    *  @return The offset from the ellipsoid to the geoid or ossim::nan()
+    *  (IEEE NAN) if grid does not contain the point.
+    */
+   virtual double offsetFromEllipsoid(const ossimGpt& gpt);
+
+   double geoidToEllipsoidHeight(double lat,
+                                 double lon,
+                                 double geoidHeight);
+   
+   double ellipsoidToGeoidHeight(double lat,
+                           double lon,
+                           double ellipsoidHeight);
+protected:
+
+   std::vector<float> theGeoidHeightBuffer;
+   mutable float* theGeoidHeightBufferPtr;
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/base/ossimGeoidImage.h b/include/ossim/base/ossimGeoidImage.h
new file mode 100644
index 0000000..fb4bb4a
--- /dev/null
+++ b/include/ossim/base/ossimGeoidImage.h
@@ -0,0 +1,116 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Generic geoid source which uses an image handler for reading the grid.
+// 
+//----------------------------------------------------------------------------
+#ifndef ossimGeoidImage_HEADER
+#define ossimGeoidImage_HEADER 1
+   
+#include <ossim/base/ossimGeoid.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+
+class ossimFilename;
+
+/**
+ * @class ossimGeoidImage
+ *
+ * Generic geoid source which uses a image handler for reading the grid.
+ *
+ * The settable keyword "geoid.type", e.g. "egm2008" is used to attach a given geoid
+ * to an elevation source.
+ *
+ * The keyword "type" is fixed for this object as "geoid_image".
+ */
+class OSSIM_DLL ossimGeoidImage : public ossimGeoid
+{
+
+public:
+   
+   /** @brief default constructor */
+   ossimGeoidImage();
+
+   /** @brief destructor */
+   virtual ~ossimGeoidImage();
+
+   /**
+    * @brief open method
+    * @param file This can be any image that ossim can open and get geometry
+    * info for.
+    * @param byteOrder Not used by this object.
+    * @return true on success, false on erro.
+    */
+   virtual bool open( const ossimFilename& file,
+                      ossimByteOrder byteOrder=OSSIM_BIG_ENDIAN );
+
+   /**
+    * @return The short name which represents the "geoid.type" keyword which is
+    * used by ossimGeoidFactory.
+    */
+   virtual ossimString getShortName() const;
+   
+   /** @brief Sets the geoid type name string. */
+   void setShortName( const std::string& geoidTypeName );
+
+   /**
+    * @brief Gets the memory map flag.
+    * @return true if geoid image is memory mapped; else, false.
+    */
+   bool getMemoryMapFlag() const;
+
+   /**
+    * @brief Set the memory map flag.
+    */
+   void setMemoryMapFlag( bool flag );
+   
+   /**
+    * Method to save the state of the object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   /**
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   /**
+    *  @return The offset from the ellipsoid to the geoid or ossim::nan()
+    *  (IEEE NAN) if grid does not contain the point.
+    */
+   virtual double offsetFromEllipsoid(const ossimGpt& gpt);
+
+   bool getEnableFlag() const;
+
+   void setEnableFlag(bool flag);
+
+protected:
+
+   template <class T>
+   double offsetFromEllipsoidTemplate(T dummy, const ossimGpt& gpt);
+
+   ossimRefPtr<ossimImageGeometry> m_geom;
+   ossimRefPtr<ossimImageHandler>  m_handler;
+   ossimRefPtr<ossimImageData>     m_cacheTile;
+   std::string                     m_connectionString;
+   ossimString                     m_geoidTypeName;
+   bool                            m_memoryMapFlag;
+   bool                            m_enabledFlag;
+   ossimIrect                      m_imageRect;
+   ossimScalarType                 m_scalarType;
+};
+
+#endif /* #define ossimGeoidImage_HEADER 1 */
diff --git a/include/ossim/base/ossimGeoidManager.h b/include/ossim/base/ossimGeoidManager.h
new file mode 100644
index 0000000..3fcb041
--- /dev/null
+++ b/include/ossim/base/ossimGeoidManager.h
@@ -0,0 +1,93 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimGeoidManager. Maintains
+//   a list of geoids.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimGeoidManager.h 22900 2014-09-30 09:56:11Z dburken $
+
+#ifndef ossimGeoidManager_HEADER
+#define ossimGeoidManager_HEADER
+
+#include <vector>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimGeoid.h>
+/*****************************************************************************
+ *
+ * CLASS: ossimGeoidManager 
+ *
+ *****************************************************************************/
+class OSSIMDLLEXPORT ossimGeoidManager : public ossimGeoid
+{
+public:
+
+
+   virtual ~ossimGeoidManager();
+      
+   /**
+    * Implements singelton pattern:
+    */
+   static ossimGeoidManager* instance();
+
+   
+   /**
+    * Permits initialization of geoids from directory name. Should never be
+    * called since called on specific geoid types:
+    */
+   virtual bool open(const ossimFilename& dir, ossimByteOrder byteOrder);
+
+   /**
+    *  @return The offset from the ellipsoid to the geoid or ossim::nan()
+    *  if grid does not contain the point.
+    */
+   virtual double offsetFromEllipsoid(const ossimGpt& gpt);
+
+   /**
+    * Method to save the state of the object to a keyword list.
+    * Return true if ok or false on error. DO NOTHING
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+
+   /**
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * Permits adding additional geoids to the list: 
+    */
+   virtual void addGeoid(ossimRefPtr<ossimGeoid> geoid, bool toFrontFlag=false);
+
+   ossimGeoid* findGeoidByShortName(const ossimString& shortName, bool caseSensitive=true);
+
+  /**
+   * Permits to clear the GeoidList
+   */
+   virtual void clear();
+
+private:
+   /**
+    *  Private constructor.  Use "instance" method.
+    */
+   ossimGeoidManager();
+
+   //static ossimGeoidManager* theInstance;
+   mutable std::vector< ossimRefPtr<ossimGeoid> > theGeoidList;
+   
+   // will use this as a identity if one wants but don't want it part of the internal list
+   //
+   ossimRefPtr<ossimGeoid> theIdentityGeoid;
+   
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimGeoidNgs.h b/include/ossim/base/ossimGeoidNgs.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeoidNgs.h
rename to include/ossim/base/ossimGeoidNgs.h
diff --git a/ossim/include/ossim/base/ossimGeoidNgsHeader.h b/include/ossim/base/ossimGeoidNgsHeader.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeoidNgsHeader.h
rename to include/ossim/base/ossimGeoidNgsHeader.h
diff --git a/ossim/include/ossim/base/ossimGeoref.h b/include/ossim/base/ossimGeoref.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGeoref.h
rename to include/ossim/base/ossimGeoref.h
diff --git a/ossim/include/ossim/base/ossimGpt.h b/include/ossim/base/ossimGpt.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGpt.h
rename to include/ossim/base/ossimGpt.h
diff --git a/include/ossim/base/ossimGrect.h b/include/ossim/base/ossimGrect.h
new file mode 100644
index 0000000..6b445ca
--- /dev/null
+++ b/include/ossim/base/ossimGrect.h
@@ -0,0 +1,310 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimGrect.h 23461 2015-08-05 20:20:20Z okramer $
+#ifndef ossimGrect_HEADER
+#define ossimGrect_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimCommon.h>
+
+#include <vector>
+#include <iostream>
+
+class OSSIM_DLL ossimGrect
+{
+public:
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& os, const ossimGrect& rect);
+
+   /**
+    * Will default to 0,0,0,0.
+    */
+    ossimGrect()
+      :
+         theUlCorner(0.0, 0.0, 0.0),
+         theLrCorner(0.0, 0.0, 0.0)
+      {}
+
+   /**
+    * Copies the passed in rectangle to this
+    * object.
+    */
+   ossimGrect(const ossimGrect& rect)
+      :
+         theUlCorner(rect.ul()),
+         theLrCorner(rect.lr())
+      {}
+
+   /**
+    * WIll take two ground points and fill the
+    * bounding rect appropriately.
+    */
+   ossimGrect(const ossimGpt& p1, const ossimGpt& p2);
+
+   /**
+    * Takes the upper left and lower right ground
+    * points
+    */
+   ossimGrect(double ulLat,
+              double ulLon,
+              double lrLat,
+              double lrLon,
+              const ossimDatum* aDatum=ossimDatumFactory::instance()->wgs84())
+      : 
+         theUlCorner(ulLat, ulLon,0, aDatum),
+         theLrCorner(lrLat, lrLon, 0, aDatum)
+      {}
+   ossimGrect(const ossimGpt& point,
+              double latSpacingInDegrees,
+              double lonSpacingInDegrees)
+      :
+         theUlCorner(point),
+         theLrCorner(point)
+      {
+         std::vector<ossimGrect> v;
+         computeEvenTiles(v, latSpacingInDegrees, lonSpacingInDegrees);
+         if(v.size())
+            *this = v[0];
+      }
+   ossimGrect(std::vector<ossimGpt>& points);
+   ossimGrect(const ossimGpt& p1,
+              const ossimGpt& p2,
+              const ossimGpt& p3,
+              const ossimGpt& p4);
+              
+
+   const ossimGrect& operator=(const ossimGrect& rect)
+      {
+         theUlCorner = rect.ul();
+         theLrCorner = rect.lr();
+         return *this;
+      }
+
+   inline ossimGpt midPoint()const;
+   
+   /** Returns the height of a rectangle in deg. */
+   inline ossim_float64 height() const;
+
+   /** Returns the width of a rectangle in deg. */
+   inline ossim_float64 width()  const;
+   
+   /** Returns the height of a rectangle in meters. */
+   ossim_float64 heightMeters() const;
+
+   /** Returns the width of a rectangle in meters using the center lat for scaling EW direction. */
+   ossim_float64 widthMeters()  const;
+
+   inline const ossimGpt& ul()const;
+   inline const ossimGpt& lr()const;
+   inline ossimGpt ur() const;
+   inline ossimGpt ll() const;
+
+   inline ossimGpt& ul();
+   inline ossimGpt& lr();
+	
+   inline void makeNan();
+   
+   inline bool isLonLatNan()const;
+	
+   inline bool hasNans()const;
+   
+   inline bool isNan()const;
+   
+   /*!
+    * Returns true if "this" rectangle is contained completely within the
+    * input rectangle "rect".
+    */
+   bool completely_within(const ossimGrect& rect) const;
+	
+   /*!
+    * Returns true if any portion of an input rectangle "rect" intersects
+    * "this" rectangle.  
+    */
+   bool intersects(const ossimGrect& rect) const;
+
+   inline ossimGrect clipToRect(const ossimGrect& rect)const;
+
+   inline ossimGrect combine(const ossimGrect& rect)const;
+
+   /**
+    * Expands existing rect to accommodate argument point. If this object contains NaNs
+    * (uninitialized), then the rect is set to 0-area with the arg point as both UL and LR --
+    * convenient for establishing bounds in a loop over collection of points. This method does not
+    * consider height.
+    * @param gpt Argument point.
+    */
+   void expandToInclude(const ossimGpt& gpt);
+   void expandToInclude(const ossimGrect& rect);
+
+   /**
+    * METHOD: pointWithin(ossimGpt)
+    *
+    * @param gpt Point to test for withinness.
+    * @param considerHgt true if the height is to be compared to be between ul.hgt and lr.hgt
+    * @return true if argument is inside rectangle (or cuboid when hgt considered)
+    *
+    * @note There is no datum shift applied if
+    * gpt is of a different datum than this datum.
+    */
+   inline bool pointWithin(const ossimGpt& gpt, bool considerHgt=false) const; //inline below
+
+   ossimGrect stretchToEvenBoundary(double latSpacingInDegrees,
+                                    double lonSpacingInDegrees)const;
+   
+   void computeEvenTiles(std::vector<ossimGrect>& result,
+                         double latSpacingInDegrees,
+                         double lonSpacingInDegrees,
+                         bool clipToGeographicBounds = true)const;
+private:
+   ossimGpt theUlCorner; // Contains max height as well
+   ossimGpt theLrCorner; // Contains min height as well
+  
+};
+
+//==================== BEGIN INLINE DEFINITIONS ===============================
+
+//*****************************************************************************
+//  INLINE METHOD: ossimGrect::midPoint()
+//*****************************************************************************
+inline ossimGpt ossimGrect::midPoint()const
+{
+   return ossimGpt((ul().latd() + ur().latd() + ll().latd() + lr().latd())*.25,
+                   (ul().lond() + ur().lond() + ll().lond() + lr().lond())*.25,
+                   (ul().height()+ur().height()+ll().height()+
+                    lr().height())*.25,
+                   ul().datum() );
+}
+
+//*****************************************************************************
+//  INLINE METHOD: ossimGrect::clipToRect()
+//*****************************************************************************
+inline ossimGrect ossimGrect::clipToRect(const ossimGrect& rect)const
+{
+    double     ulx, uly, lrx, lry;
+
+    ulx = ossim::max<ossim_float64>(rect.ul().lond(),ul().lond());
+    uly = ossim::min<ossim_float64>(rect.ul().latd(),ul().latd());
+    lrx = ossim::min<ossim_float64>(rect.lr().lond(),lr().lond());
+    lry = ossim::max<ossim_float64>(rect.lr().latd(),lr().latd());
+
+    if( lrx < ulx || lry > uly )
+    {
+       return ossimGrect(ossimGpt(0,0,0),ossimGpt(0,0,0));
+    }
+    else
+    {
+       return ossimGrect(ossimGpt(uly, ulx, 0, rect.ul().datum()),
+                         ossimGpt(lry, lrx, 0, rect.ul().datum()));
+    }
+}
+
+//*******************************************************************
+// Inline Method: ossimDrect::combine(const ossimDrect& rect)
+//*******************************************************************
+inline ossimGrect ossimGrect::combine(const ossimGrect& rect)const
+{
+   if (isLonLatNan())
+      return rect;
+
+   ossimGpt ulCombine;
+   ossimGpt lrCombine;
+	
+	ulCombine.lon = ((ul().lon <= rect.ul().lon)?ul().lon:rect.ul().lon);
+   ulCombine.lat = ((ul().lat >= rect.ul().lat)?ul().lat:rect.ul().lat);
+   lrCombine.lon = ((lr().lon >= rect.lr().lon)?lr().lon:rect.lr().lon);
+   lrCombine.lat = ((lr().lat <= rect.lr().lat)?lr().lat:rect.lr().lat);
+	
+   return ossimGrect(ulCombine, lrCombine);
+}
+
+//*****************************************************************************
+//  INLINE METHOD: ossimGrect::pointWithin()
+//*****************************************************************************
+inline bool ossimGrect::pointWithin(const ossimGpt& gpt, bool considerHgt) const
+{
+   bool within = (gpt.lat <= theUlCorner.lat) && (gpt.lat >= theLrCorner.lat) &&
+                 (gpt.lon >= theUlCorner.lon) && (gpt.lon <= theLrCorner.lon);
+   if (considerHgt)
+      within &= (gpt.hgt <= theUlCorner.hgt) && (gpt.hgt >= theLrCorner.hgt);
+
+   return within;
+}
+
+inline ossim_float64 ossimGrect::height() const
+{
+   return (theUlCorner.latd() - theLrCorner.latd());
+}
+
+inline ossim_float64 ossimGrect::width() const
+{
+   return (theLrCorner.lond() - theUlCorner.lond());
+}
+
+inline const ossimGpt& ossimGrect::ul() const
+{
+   return theUlCorner;
+}
+
+inline ossimGpt ossimGrect::ur() const
+{
+   ossimGpt gpt (theUlCorner.lat, theLrCorner.lon, theUlCorner.hgt, theUlCorner.datum());
+   return gpt;
+}
+
+inline ossimGpt ossimGrect::ll() const
+{
+   ossimGpt gpt (theLrCorner.lat, theUlCorner.lon, theLrCorner.hgt, theLrCorner.datum());
+   return gpt;
+}
+
+inline const ossimGpt& ossimGrect::lr() const
+{
+   return theLrCorner;
+}
+   
+inline ossimGpt& ossimGrect::ul()
+{
+   return theUlCorner;
+}
+
+inline ossimGpt& ossimGrect::lr()
+{
+   return theLrCorner;
+}
+	
+inline void ossimGrect::makeNan()
+{
+   theUlCorner.makeNan();
+   theLrCorner.makeNan();
+}
+
+inline bool ossimGrect::isLonLatNan() const
+{
+   return ( ossim::isnan(theUlCorner.lat) ||
+            ossim::isnan(theUlCorner.lon) ||
+            ossim::isnan(theLrCorner.lat) ||
+            ossim::isnan(theLrCorner.lon) );
+}
+
+inline bool ossimGrect::hasNans() const
+{
+   return ( theUlCorner.hasNans() ||
+            theLrCorner.hasNans() );
+}
+
+inline bool ossimGrect::isNan()const
+{
+   return ( theUlCorner.hasNans() &&
+            theLrCorner.hasNans() );
+}
+
+#endif /* End of "#ifndef ossimGrect_HEADER" */
diff --git a/ossim/include/ossim/base/ossimGzStream.h b/include/ossim/base/ossimGzStream.h
similarity index 100%
rename from ossim/include/ossim/base/ossimGzStream.h
rename to include/ossim/base/ossimGzStream.h
diff --git a/ossim/include/ossim/base/ossimHexString.h b/include/ossim/base/ossimHexString.h
similarity index 100%
rename from ossim/include/ossim/base/ossimHexString.h
rename to include/ossim/base/ossimHexString.h
diff --git a/include/ossim/base/ossimHistogram.h b/include/ossim/base/ossimHistogram.h
new file mode 100644
index 0000000..68b315d
--- /dev/null
+++ b/include/ossim/base/ossimHistogram.h
@@ -0,0 +1,209 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Ken Melero 
+//         Orginally developed by:
+//                   Copyright (c) 1997 TargetJr Consortium
+//               GE Corporate Research and Development (GE CRD)
+//                             1 Research Circle
+//                            Niskayuna, NY 12309
+//         Adapted from:  IUE v4.1.2
+// Description: 
+//      A Histogram contains an array of "buckets", which represent finite
+// segments of some value axis, along with a corresponding array of
+// frequency m_counts for each of these buckets.
+//
+//********************************************************************
+// $Id: ossimHistogram.h 19799 2011-06-30 18:41:26Z gpotts $
+//
+
+#ifndef ossimHistogram_HEADER
+#define ossimHistogram_HEADER
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimXmlNode.h>
+class OSSIMDLLEXPORT ossimHistogram : public ossimObject
+{
+  private:
+
+    mutable int m_statsConsistent; // A 2 bit state flag  Mean =1 | StandDev = 2
+
+  protected:
+
+   
+   virtual void deleteAll();
+   
+    float * m_vals;            // histogram x array
+                             // (value = midpoint of each bucket)
+    float * m_counts;          // histogram y array ie. count[i] is
+                             // the number of pixels with value within range
+                             // of bucket i
+
+    int m_num;                 // number of indices
+
+    float m_delta;             // "Width" of each bucket on value axis
+    float m_vmin, m_vmax;        // Maximum and minimum values on plot
+    mutable float m_mean;               // Mean value of the distribution
+    mutable float m_standardDev;       // 
+  protected:
+
+
+   class ossimProprietaryHeaderInformation
+   {
+   public:
+      ossimProprietaryHeaderInformation(){clear();}
+
+      bool parseStream(istream& in);
+
+      long getNumberOfBins()
+         {
+            return m_numberOfBins.toLong();
+         }
+      void clear()
+         {
+            m_fileType      = "";
+            m_version       = "";
+            m_mapperType    = "";
+            m_numberOfBins  = "";
+         }
+      ossimString m_fileType;
+      ossimString m_version;
+      ossimString m_mapperType;
+      ossimString m_numberOfBins;
+   };
+   
+  public:
+   enum FillAlgorithmType
+   {
+      HISTOGRAM_FILL_DEFAULT    = 0,
+      HISTOGRAM_FILL_THIN_PLATE = 1
+   };
+// Constructors
+    ossimHistogram();
+    ossimHistogram(int xres, float min, float max);
+    ossimHistogram(float*, float*, int);
+    ossimHistogram(const ossimHistogram& his); // Copy constructor
+    ossimHistogram(const ossimHistogram*, float width); // Resampling constructor
+
+    /**
+     * Uses samples array to establish a histogram with numBins:
+     */
+    ossimHistogram(const double* samples, ossim_uint32 size, ossim_uint32 numBins);
+
+    virtual int GetIndex(float)const;
+// Other histogram formation operations    
+   ossimHistogram* fillInteriorEmptyBins(int type=HISTOGRAM_FILL_THIN_PLATE)const;
+    ossimHistogram* Scale(float scale_factor); // Scale Transformation
+    ossimHistogram* CumulativeGreaterThanEqual()const;// From density to cumulative
+    ossimHistogram* CumulativeLessThanEqual()const;// From density to cumulative
+    //Suppress non-peak values.
+   ossimHistogram* NonMaximumSupress(int radius = 1, bool cyclic = false);
+   void create(int xres, float val1, float val2);
+  
+// Attribute accessors
+    void UpCount(float newval, float occurences=1);
+    float GetCount(float uval)const;
+    float SetCount(float pixelval, float count);
+
+    float GetMinVal()const;
+    float GetMaxVal()const;
+    float GetMaxCount()const;
+
+    float GetRangeMin()const
+    {
+       return m_vmin;
+    }
+    float GetRangeMax()const
+    {
+       return m_vmax;
+    }
+    float * GetVals()
+    {
+      m_statsConsistent = 0; // Values might change.
+      return m_vals; 
+    }
+    const float * GetVals()const
+    {
+      m_statsConsistent = 0; // Values might change.
+      return m_vals; 
+    }
+
+    float * GetCounts()
+    { 
+      m_statsConsistent = 0; // m_counts might change.
+      return m_counts; 
+    }
+
+   const float * GetCounts()const
+    { 
+      //m_statsConsistent = 0; // m_counts might change.
+      return m_counts; 
+    }
+
+    int GetRes()const
+    { return m_num; }
+
+    float GetBucketSize()const { return m_delta; }
+
+    float * GetMinValAddr()
+    { return m_vals+GetIndex(GetMinVal());  }
+
+    float * GetMinCountAddr()
+    { return m_counts+GetIndex(GetMinVal());  }
+
+    const float * GetMinValAddr()const
+    { return m_vals+GetIndex(GetMinVal());  }
+
+    const float * GetMinCountAddr()const
+    { return m_counts+GetIndex(GetMinVal());  }
+
+    float ComputeArea(float low, float high)const;// bounded area
+    float ComputeArea()const;//total area
+
+    /*!
+     * Returns the fraction of accumulation up to and including "val" bucket
+     * from min divided by the total accumulation.
+     * returns OSSIM_FLT_NAN if "val" is not between GetMinVal and GetMaxVal.
+     */
+    float getLowFractionFromValue(float val) const;
+    
+    /*!
+     * Returns the fraction of accumulation down to and including "val" bucket
+     * from max divided by the total accumulation.
+     * returns OSSIM_FLT_NAN if "val" is not between GetMin() and GetMax().
+     */
+    float getHighFractionFromValue(float val) const;
+    
+    //Find bounds that clip off a given percent of the area
+    float LowClipVal(float clip_fraction)const;
+    float HighClipVal(float clip_fraction)const;
+
+    float GetValFromIndex(ossim_uint32 idx)const;
+    float GetMinValFromIndex(ossim_uint32 idx)const;
+    float GetMaxValFromIndex(ossim_uint32 idx)const;
+    int GetValIndex(float val)const;
+
+    float GetMean()const;
+    float GetStandardDev()const;
+
+    void Print()const;
+    void Dump(char *)const;
+    int  WritePlot(const char* fname)const;
+   virtual ~ossimHistogram();
+
+
+   virtual bool importHistogram(const ossimFilename& inputFile);
+   virtual bool importHistogram(istream& in);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual bool saveState(ossimRefPtr<ossimXmlNode> xmlNode)const;
+   virtual bool loadState(const ossimRefPtr<ossimXmlNode> xmlNode);
+TYPE_DATA   
+};
+
+#endif
\ No newline at end of file
diff --git a/include/ossim/base/ossimHistogramSource.h b/include/ossim/base/ossimHistogramSource.h
new file mode 100644
index 0000000..f0d400b
--- /dev/null
+++ b/include/ossim/base/ossimHistogramSource.h
@@ -0,0 +1,57 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHistogramSource.h 11721 2007-09-13 13:19:34Z gpotts $
+#ifndef ossimHistogramSource_HEADER
+#define ossimHistogramSource_HEADER
+
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+
+class OSSIM_DLL ossimHistogramSource : public ossimSource
+{
+public:
+   
+   virtual ~ossimHistogramSource();
+   
+   virtual ossimRefPtr<ossimMultiResLevelHistogram> getHistogram();
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+protected:
+   ossimHistogramSource(ossimObject* owner=NULL,
+                        ossim_uint32 numberOfInputs=0,
+                        ossim_uint32 numberOfOutputs=0,
+                        bool inputListFixedFlag=true,
+                        bool outputListFixedFlag=true);
+   
+   ossimRefPtr<ossimMultiResLevelHistogram> theHistogram;
+   
+   /*!
+    * if the filename is not "" then it will use
+    * this to store the histogram outside the keywordlist.
+    *
+    * it will set the filename keyword to the filename and
+    * during a save state will save it out to the file
+    * instead of inline to the keyword list.
+    */
+   ossimFilename                theFilename;
+   
+private:
+   /** Hidden from use copy constructor. */
+   ossimHistogramSource(const ossimHistogramSource&);
+
+TYPE_DATA
+};
+
+#endif /* End of "#ifndef ossimHistogramSource_HEADER" */
diff --git a/ossim/include/ossim/base/ossimHsiVector.h b/include/ossim/base/ossimHsiVector.h
similarity index 100%
rename from ossim/include/ossim/base/ossimHsiVector.h
rename to include/ossim/base/ossimHsiVector.h
diff --git a/ossim/include/ossim/base/ossimHsvVector.h b/include/ossim/base/ossimHsvVector.h
similarity index 100%
rename from ossim/include/ossim/base/ossimHsvVector.h
rename to include/ossim/base/ossimHsvVector.h
diff --git a/ossim/include/ossim/base/ossimHttpRequest.h b/include/ossim/base/ossimHttpRequest.h
similarity index 100%
rename from ossim/include/ossim/base/ossimHttpRequest.h
rename to include/ossim/base/ossimHttpRequest.h
diff --git a/include/ossim/base/ossimHttpResponse.h b/include/ossim/base/ossimHttpResponse.h
new file mode 100644
index 0000000..c098140
--- /dev/null
+++ b/include/ossim/base/ossimHttpResponse.h
@@ -0,0 +1,82 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file
+//
+// Author: Garrett Potts
+//
+// Description: This is an initial cut at an http response object.  The HttpResponse is
+//              returned from the HttpRequest base object.
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimHttpResponse_HEADER
+#define ossimHttpResponse_HEADER
+
+#include <iostream>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimByteStreamBuffer.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimWebResponse.h>
+
+class OSSIM_DLL ossimHttpResponse : public ossimWebResponse
+{
+public:
+   ossimHttpResponse()
+   :m_headerStream(&m_headerBuffer),
+   m_bodyStream(&m_bodyBuffer)
+   {
+      clear();
+   }
+   
+   ossimByteStreamBuffer& headerBuffer(){return m_headerBuffer;}
+   const ossimByteStreamBuffer& headerBuffer()const{return m_headerBuffer;}
+   ossimByteStreamBuffer& bodyBuffer(){return m_bodyBuffer;}
+   const ossimByteStreamBuffer& bodyBuffer()const{return m_bodyBuffer;}
+   
+   std::iostream& headerStream(){return m_headerStream;}
+   std::iostream& bodyStream(){return m_bodyStream;}
+   
+   virtual std::istream* getInputStream()
+         {return static_cast<std::istream*>(&m_bodyStream);}
+   
+   /**
+    * Clears out the Response and prepares for a new response.
+    */
+   virtual void clear()
+   {
+      m_headerBuffer.clear();
+      m_bodyBuffer.clear();
+      m_headerKwl.clear();
+      m_statusLine = "";
+      m_statusCode = 200;
+   }
+   
+   /**
+    * This will parse out the response code from the status line and initialize
+    * the header variables into a keywordlist.
+    */
+   void convertHeaderStreamToKeywordlist();
+   virtual void clearLastError(){m_statusCode = 200;m_statusLine="";}
+   
+   virtual ossimString getLastError()const{return ((m_statusCode == 200)?ossimString(""):m_statusLine);}
+   
+   ossimKeywordlist& headerKwl(){return m_headerKwl;}
+   const ossimKeywordlist& headerKwl()const{return m_headerKwl;}
+   ossim_int64 getContentLength()const;
+   ossimString getHeaderValue(const ossimString& headerName)const;
+   const ossimString& statusLine()const{return m_statusLine;}
+   ossim_uint32 getStatusCode()const{return m_statusCode;}
+   
+protected:
+   ossimKeywordlist      m_headerKwl;
+   ossimByteStreamBuffer m_headerBuffer;
+   ossimByteStreamBuffer m_bodyBuffer;
+   std::iostream         m_headerStream;
+   std::iostream         m_bodyStream;
+   ossimString           m_statusLine;
+   ossim_uint32          m_statusCode;
+   
+TYPE_DATA;
+};
+#endif
+
diff --git a/ossim/include/ossim/base/ossimId.h b/include/ossim/base/ossimId.h
similarity index 100%
rename from ossim/include/ossim/base/ossimId.h
rename to include/ossim/base/ossimId.h
diff --git a/ossim/include/ossim/base/ossimIdManager.h b/include/ossim/base/ossimIdManager.h
similarity index 100%
rename from ossim/include/ossim/base/ossimIdManager.h
rename to include/ossim/base/ossimIdManager.h
diff --git a/ossim/include/ossim/base/ossimImageAoiListener.h b/include/ossim/base/ossimImageAoiListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimImageAoiListener.h
rename to include/ossim/base/ossimImageAoiListener.h
diff --git a/ossim/include/ossim/base/ossimImageGeometryEvent.h b/include/ossim/base/ossimImageGeometryEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimImageGeometryEvent.h
rename to include/ossim/base/ossimImageGeometryEvent.h
diff --git a/ossim/include/ossim/base/ossimImageGeometryEventListener.h b/include/ossim/base/ossimImageGeometryEventListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimImageGeometryEventListener.h
rename to include/ossim/base/ossimImageGeometryEventListener.h
diff --git a/ossim/include/ossim/base/ossimImagePolygonEvent.h b/include/ossim/base/ossimImagePolygonEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimImagePolygonEvent.h
rename to include/ossim/base/ossimImagePolygonEvent.h
diff --git a/ossim/include/ossim/base/ossimImageRectangleEvent.h b/include/ossim/base/ossimImageRectangleEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimImageRectangleEvent.h
rename to include/ossim/base/ossimImageRectangleEvent.h
diff --git a/include/ossim/base/ossimImageTypeLut.h b/include/ossim/base/ossimImageTypeLut.h
new file mode 100644
index 0000000..2835f0b
--- /dev/null
+++ b/include/ossim/base/ossimImageTypeLut.h
@@ -0,0 +1,33 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken (dburken at imagelinks.com)
+//
+// Description:
+//
+// Contains class declaration for ImageTypeLut.  Currently has mapping of
+// output image writes from enumeration to string and string to
+// enumeration.
+//
+//*******************************************************************
+//  $Id: ossimImageTypeLut.h 9968 2006-11-29 14:01:53Z gpotts $
+
+#ifndef ImageTypeLUT_HEADER
+#define ImageTypeLUT_HEADER
+
+#include <ossim/base/ossimLookUpTable.h>
+
+class OSSIMDLLEXPORT ossimImageTypeLut : public ossimLookUpTable
+{
+public:
+
+   ossimImageTypeLut();
+
+   virtual ~ossimImageTypeLut(){}
+
+   virtual ossimKeyword getKeyword() const { return IMAGE_TYPE_KW; }
+
+   static const ossimKeyword IMAGE_TYPE_KW;
+};
+#endif
diff --git a/ossim/include/ossim/base/ossimInterleaveTypeLut.h b/include/ossim/base/ossimInterleaveTypeLut.h
similarity index 100%
rename from ossim/include/ossim/base/ossimInterleaveTypeLut.h
rename to include/ossim/base/ossimInterleaveTypeLut.h
diff --git a/include/ossim/base/ossimIoStream.h b/include/ossim/base/ossimIoStream.h
new file mode 100644
index 0000000..4e7043d
--- /dev/null
+++ b/include/ossim/base/ossimIoStream.h
@@ -0,0 +1,248 @@
+//---
+//
+// License: MIT
+//
+// Author: Garrett Potts
+//
+// Description:
+// 
+// Class declarations for:
+//
+// ossimIStream
+// ossimOStream
+// ossimIOStream
+// ossimIOMemoryStream
+// ossimIMemoryStream
+// ossimOMemoryStream
+// ossimIOFStream
+// ossimIFStream
+// ossimOFStream
+//
+//---
+// $Id$
+
+#ifndef ossimIoStream_HEADER
+#define ossimIoStream_HEADER 1
+
+#include <ossim/base/ossimIosFwd.h>
+
+// NOTE: All below includes will go away once deprecated code is replaced.
+// drb 04 Nov. 2016
+
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimStreamBase.h>
+#include <ossim/base/ossimString.h>
+
+#include <istream>
+#include <iostream>
+#include <ostream>
+#include <fstream>
+#include <sstream>
+
+//---
+// Depreciated:
+//---
+class OSSIM_DLL ossimIStream : public ossimStreamBase, public std::basic_istream<char>   
+{
+public:
+   //ossimIStream();
+   ossimIStream(std::streambuf* sb);
+   virtual ~ossimIStream();
+};
+
+
+class OSSIM_DLL ossimOStream : public ossimStreamBase, public std::basic_ostream<char>
+{
+public:
+   //ossimOStream();
+   ossimOStream(std::streambuf* sb);   
+   virtual ~ossimOStream();
+};
+
+class OSSIM_DLL ossimIOStream : public ossimStreamBase, public std::basic_iostream<char>
+{
+public:
+   //ossimIOStream();
+   ossimIOStream(std::streambuf* sb);   
+   virtual ~ossimIOStream();
+};
+
+class OSSIM_DLL ossimIOMemoryStream : public ossimIOStream
+{
+public:
+   ossimIOMemoryStream();
+
+   virtual ~ossimIOMemoryStream();
+
+   // ??? (drb)
+   bool is_open()const;
+
+   // ??? (drb)
+   virtual void open(const char* /* protocolString */,
+                     int /* openMode */);
+
+   ossimString str();
+
+   // ??? (drb)
+   virtual void close();
+
+   // ??? (drb) std::streamsize
+   ossim_uint64 size()const;
+
+protected:
+   std::stringbuf theBuf;
+};
+
+class OSSIM_DLL ossimIMemoryStream : public ossimIStream
+{
+public:
+   
+   ossimIMemoryStream(const ossimString& inputBuf);
+   
+   virtual ~ossimIMemoryStream();
+   
+   bool is_open()const;
+   
+   ossim_uint64 size()const;
+   
+   virtual void open(const char* /* protocolString */,
+                     int /* openMode */ );
+
+   virtual void close();
+   
+   ossimString str();
+
+protected:
+   std::stringbuf theBuf;
+   
+};
+
+class OSSIM_DLL ossimOMemoryStream : public ossimOStream
+{
+public:
+   ossimOMemoryStream();
+   virtual ~ossimOMemoryStream();   
+
+   bool is_open()const;
+
+   ossim_uint64 size()const;
+
+   virtual void open(const char* /* protocolString */,
+                     int /* openMode */ );
+
+   virtual void close();
+
+   ossimString str();
+
+protected:
+   std::stringbuf theBuf;
+};
+
+class OSSIM_DLL ossimIOFStream : public ossimStreamBase, public std::basic_fstream<char>
+{
+public:
+   ossimIOFStream();
+
+   ossimIOFStream(const char* name,
+                  std::ios_base::openmode mode =
+                  std::ios_base::in | std::ios_base::out);
+
+   virtual ~ossimIOFStream();
+};
+
+class OSSIM_DLL ossimIFStream : public ossimStreamBase, public std::basic_ifstream<char>
+{
+public:
+   ossimIFStream();
+   
+   ossimIFStream(const char* file,
+                 std::ios_base::openmode mode = std::ios_base::in);
+
+   virtual ~ossimIFStream();
+
+};
+
+class OSSIM_DLL ossimOFStream : public ossimStreamBase, public std::basic_ofstream<char>
+{
+public:
+   ossimOFStream();
+
+   ossimOFStream(const char* name,
+                 std::ios_base::openmode mode =
+                 std::ios_base::out|std::ios_base::trunc);
+
+   virtual ~ossimOFStream();
+
+};
+
+
+#ifdef _MSC_VER
+
+class ossimIFStream64 : public std::basic_ifstream<char>
+{
+public:
+   ossimIFStream64(const char* pFilename, 
+      std::ios_base::openmode mode = ios_base::in, 
+      int prot = ios_base::_Openprot);
+
+   virtual ~ossimIFStream64();
+   void seekg64(off_type off, ios_base::seekdir way);
+
+   void seekg64(streampos pos, ios_base::seekdir way);
+
+   static void seekg64(std::istream& str, off_type off, ios_base::seekdir way);
+ 
+   static void seekg64(std::istream& str, std::streampos pos, ios_base::seekdir way);
+private:
+   FILE* theFile;
+};
+
+class ossimOFStream64 : public std::basic_ofstream<char>
+{
+public:
+   ossimOFStream64(const char* pFilename, 
+                   std::ios_base::openmode mode = ios_base::out, 
+                   int prot = ios_base::_Openprot);
+   virtual ~ossimOFStream64();
+
+   ossim_uint64 tellp64();
+};
+
+#else
+
+class ossimIFStream64 : public std::basic_ifstream<char>
+{
+public:
+   ossimIFStream64(const char* pFilename, std::ios_base::openmode mode = ios_base::in, long prot = 0666);
+
+   virtual ~ossimIFStream64();
+
+   void seekg64(off_type off, ios_base::seekdir way);
+
+   static void seekg64(std::istream& str, off_type off, ios_base::seekdir way);
+};
+
+class ossimOFStream64 : public std::basic_ofstream<char>
+{
+public:
+   ossimOFStream64(const char* pFilename, std::ios_base::openmode mode = ios_base::out, long prot = 0666);
+
+   virtual ~ossimOFStream64();
+
+   ossim_uint64 tellp64();
+};
+
+#endif // _MSC_VER
+
+OSSIM_DLL void operator >> (ossimIStream& in,ossimOStream& out);
+OSSIM_DLL ossimIOStream& operator >> (ossimIStream& in,ossimIOStream& out);
+OSSIM_DLL void operator >> (ossimIOStream& in,ossimOStream& out);
+OSSIM_DLL ossimIOStream& operator >> (ossimIOStream& in,ossimIOStream& out);
+OSSIM_DLL void operator << (ossimOStream& out, ossimIStream& in);
+OSSIM_DLL void operator << (ossimOStream& out, ossimIOStream& in);
+OSSIM_DLL ossimIOStream& operator << (ossimIOStream& out, ossimIStream& in);
+OSSIM_DLL ossimIOStream& operator << (ossimIOStream& out, ossimIOStream& in);
+
+
+#endif
diff --git a/include/ossim/base/ossimIosFwd.h b/include/ossim/base/ossimIosFwd.h
new file mode 100644
index 0000000..8e061b8
--- /dev/null
+++ b/include/ossim/base/ossimIosFwd.h
@@ -0,0 +1,54 @@
+//---
+// License: MIT
+// Description: Forward ossim stream declarations.
+// $Id$
+//---
+
+#ifndef ossimIosFwd_H
+#define ossimIosFwd_H 1
+
+#include <iosfwd>
+
+namespace ossim
+{
+   //---
+   // Straight from <iosfwd> include.  ossim namespace so we have a common
+   // factory stream return that can be derived from.
+   //---
+
+   /// Base class for @c char input streams.
+   typedef std::basic_istream<char>          istream;
+
+   /// Base class for @c char output streams.
+   typedef std::basic_ostream<char>          ostream;
+   
+   /// Base class for @c char mixed input and output streams.
+   typedef std::basic_iostream<char>         iostream;
+   
+   /// Class for @c char memory buffers.
+   typedef std::basic_stringbuf<char>        stringbuf;
+   
+   /// Class for @c char input memory streams.
+   typedef std::basic_istringstream<char>    istringstream;
+   
+   /// Class for @c char output memory streams.
+   typedef std::basic_ostringstream<char>    ostringstream;
+   
+   /// Class for @c char mixed input and output memory streams.
+   typedef std::basic_stringstream<char>     stringstream;
+   
+   /// Class for @c char file buffers.
+   typedef std::basic_filebuf<char>          filebuf;
+   
+   /// Class for @c char input file streams.
+   typedef std::basic_ifstream<char>         ifstream;
+   
+   /// Class for @c char output file streams.
+   typedef std::basic_ofstream<char>         ofstream;
+   
+   /// Class for @c char mixed input and output file streams.
+   typedef std::basic_fstream<char>          fstream;
+
+} // End: namespace ossim
+
+#endif /* #ifndef ossimIosFwd_H */
diff --git a/ossim/include/ossim/base/ossimIpt.h b/include/ossim/base/ossimIpt.h
similarity index 100%
rename from ossim/include/ossim/base/ossimIpt.h
rename to include/ossim/base/ossimIpt.h
diff --git a/ossim/include/ossim/base/ossimIrect.h b/include/ossim/base/ossimIrect.h
similarity index 100%
rename from ossim/include/ossim/base/ossimIrect.h
rename to include/ossim/base/ossimIrect.h
diff --git a/ossim/include/ossim/base/ossimJpegYCbCrVector.h b/include/ossim/base/ossimJpegYCbCrVector.h
similarity index 100%
rename from ossim/include/ossim/base/ossimJpegYCbCrVector.h
rename to include/ossim/base/ossimJpegYCbCrVector.h
diff --git a/include/ossim/base/ossimKMeansClustering.h b/include/ossim/base/ossimKMeansClustering.h
new file mode 100644
index 0000000..6ace54e
--- /dev/null
+++ b/include/ossim/base/ossimKMeansClustering.h
@@ -0,0 +1,95 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+#ifndef ossimKmeansClassifier_HEADER
+#define ossimKmeansClassifier_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimReferenced.h>
+#include <vector>
+
+/***************************************************************************************************
+ *
+ * This class provides a sample set clustering capability using the traditional K-means scheme for
+ * partitioning datasets into K distinct groups according to sample value.
+ *
+ * The samples can be provided as a simple array of samples, or as a histogram when the
+ * populations of the corresponding samples are provided as well. The latter scheme is used by the
+ * ossimKMeansFilter for clustering pixel values given the image histogram.
+ *
+ **************************************************************************************************/
+class OSSIM_DLL ossimKMeansClustering : public ossimReferenced
+{
+public:
+   class Cluster
+   {
+   public:
+      Cluster() :
+         min(0), max(0), mean(0), sigma(0), new_mean(0), n(0) {}
+
+      double min;      // samples in group are => this, used for detecting convergence
+      double max;      // samples in group are < this, used for detecting convergence
+      double mean;
+      double sigma;
+      double new_mean;
+      double n;        // number of samples collected for running mean
+   };
+
+   ossimKMeansClustering();
+   ~ossimKMeansClustering();
+
+   void setNumClusters(ossim_uint32 K);
+   template<class T> void setSamples(T* samples, ossim_uint32 num_entries);
+   template<class T> void setPopulations(T* populations, ossim_uint32 num_entries);
+   bool computeKmeans();
+
+   ossim_uint32 getNumClusters() const { return m_clusters.size(); }
+   double getMean(ossim_uint32 groupId) const;
+   double getSigma(ossim_uint32 groupId) const;
+   double getMinValue(ossim_uint32 groupId) const;
+   double getMaxValue(ossim_uint32 groupId) const;
+
+   const ossimKMeansClustering::Cluster* getCluster(ossim_uint32 i) const;
+
+   void setVerbose(bool v=true) const  { m_verbose = v; }
+
+private:
+   ossim_uint32 m_numEntries;
+   double* m_samples;
+   double* m_populations; // use double to handle arbitrarily large datasets
+   std::vector<Cluster> m_clusters;
+   bool m_clustersValid;
+   mutable bool m_verbose;
+};
+
+template<class T> void ossimKMeansClustering::setSamples(T* samples, ossim_uint32 num_entries)
+{
+   if ((num_entries == 0) || (samples == 0))
+      return;
+
+   m_clustersValid = false;
+   m_numEntries = num_entries;
+   m_samples = new double[num_entries];
+   for (ossim_uint32 i=0; i<num_entries; i++)
+      m_samples[i] = (double) samples[i];
+}
+
+template<class T> void ossimKMeansClustering::setPopulations(T* populations,
+                                                             ossim_uint32 num_entries)
+{
+   if ((num_entries == 0) || (populations == 0))
+      return;
+
+   m_clustersValid = false;
+   m_populations = new double[num_entries];
+   for (ossim_uint32 i=0; i<num_entries; i++)
+      m_populations[i] = (double) populations[i];
+}
+
+
+
+#endif /* ossimKMeansClassifier_HEADER */
diff --git a/ossim/include/ossim/base/ossimKeyword.h b/include/ossim/base/ossimKeyword.h
similarity index 100%
rename from ossim/include/ossim/base/ossimKeyword.h
rename to include/ossim/base/ossimKeyword.h
diff --git a/include/ossim/base/ossimKeywordNames.h b/include/ossim/base/ossimKeywordNames.h
new file mode 100644
index 0000000..6c26ce2
--- /dev/null
+++ b/include/ossim/base/ossimKeywordNames.h
@@ -0,0 +1,210 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file
+//
+// Author: Ken Melero (kmelero at remotesensing.org)
+//
+// Description: Common file for global Keywors.
+//
+//*************************************************************************
+// $Id: ossimKeywordNames.h 23037 2014-12-11 20:37:51Z okramer $
+
+#ifndef ossimKeywordNames_HEADER
+#define ossimKeywordNames_HEADER
+
+#include <ossim/base/ossimConstants.h>
+
+class OSSIMDLLEXPORT ossimKeywordNames
+{
+public:
+   //***
+   // NOTE:  List keyword in alphabetical order.
+   //***
+   static const char* AZIMUTH_ANGLE_KW;
+   static const char* BAND_KW;
+   static const char* BANDS_KW;
+   static const char* BORDER_SIZE_KW;
+   static const char* BRUSH_COLOR_KW;
+   static const char* BYTE_ORDER_KW;
+   static const char* CE90_ABSOLUTE_KW;
+   static const char* CE90_RELATIVE_KW;
+   static const char* CENTER_PIXEL_X_KW;
+   static const char* CENTER_PIXEL_Y_KW;
+   static const char* CENTRAL_MERIDIAN_KW;
+   static const char* CENTRAL_POINT1_LAT_KW;
+   static const char* CENTRAL_POINT1_LON_KW;
+   static const char* CENTRAL_POINT2_LAT_KW;
+   static const char* CENTRAL_POINT2_LON_KW;
+   static const char* COMPRESS_KW;
+   static const char* COMPRESSION_QUALITY_KW;
+   static const char* COMPRESSION_TYPE_KW;
+   static const char* CONVERGENCE_THRESHOLD_KW;
+   static const char* CREATE_EX_KW;
+   static const char* CREATE_EXTERNAL_GEOMETRY_KW;
+   static const char* CREATE_IMAGE_KW;
+   static const char* CREATE_HISTOGRAM_KW;   
+   static const char* CREATE_OVERVIEW_KW;
+   static const char* DATA_FILE_KW;
+   static const char* DATE_KW;
+   static const char* DATE_YEAR_KW;
+   static const char* DATE_MONTH_KW;
+   static const char* DATE_DAY_KW;
+   static const char* DATE_HOUR_KW;
+   static const char* DATE_MIN_KW;
+   static const char* DATE_SEC_KW;
+   static const char* DATE_FRACT_SEC_KW;
+   static const char* DATUM_KW;
+   static const char* DECIMAL_DEGREES_PER_PIXEL_LAT;
+   static const char* DECIMAL_DEGREES_PER_PIXEL_LON;
+   static const char* DESCRIPTION_KW;
+   static const char* ELEVATION_ANGLE_KW;
+   static const char* ELEVATION_CELL_KW;
+   static const char* ELEVATION_SOURCE_KW;
+   static const char* ELEVATION_LOOKUP_FLAG_KW;
+   static const char* ELLIPSE_CODE_KW;
+   static const char* ELLIPSE_EPSG_CODE_KW;
+   static const char* ELLIPSE_NAME_KW;
+   static const char* ENABLED_KW;
+   static const char* ENABLE_CACHE_KW;
+   static const char* EXTRACT_VERTICES_KW;  
+   static const char* ENTRY_KW;
+   static const char* FALSE_EASTING_NORTHING_KW;
+   static const char* FALSE_EASTING_NORTHING_UNITS_KW;
+   static const char* FALSE_EASTING_KW;
+   static const char* FALSE_NORTHING_KW;
+   static const char* FEATURE_NAME_KW;
+   static const char* FILE_KW;
+   static const char* FILENAME_KW;
+   static const char* FILEPATH_KW;
+   static const char* FILL_FLAG_KW;
+   static const char* FRAME_INDEX_KW;       
+   static const char* GCS_CODE_KW;
+   static const char* GEOM_FILE_KW;
+   static const char* HEMISPHERE_KW;
+   static const char* HORIZONTAL_SIZE_KW;
+   static const char* ID_KW;
+   static const char* IMAGE_CE90_KW;
+   static const char* IMAGE_FILE_KW;
+   static const char* IMAGE_ID_KW;
+   static const char* IMAGE_MODEL_TRANSFORM_MATRIX_KW;
+   static const char* IMAGE_MODEL_TRANSFORM_UNIT_KW;
+   static const char* IMAGE_PATH_KW;
+   static const char* IMAGE_TYPE_KW;
+   static const char* IMAGE_DATE_KW;
+   static const char* IMAGE_FILE_SIZE_KW;
+   static const char* INPUT_RR_LEVEL_KW;
+   static const char* INTERLEAVE_TYPE_KW;
+   static const char* JULIAN_DAY_KW;
+   static const char* LAT_INCREMENT_KW;
+   static const char* LL_LAT_KW;
+   static const char* LL_LON_KW;
+   static const char* LR_LAT_KW;
+   static const char* LR_LON_KW;
+   static const char* LL_X_KW;
+   static const char* LL_Y_KW;
+   static const char* LR_X_KW;
+   static const char* LR_Y_KW;
+   static const char* LON_INCREMENT_KW;
+   static const char* MAJOR_AXIS_KW;
+   static const char* MAX_VALUE_KW;
+   static const char* MAX_ITERATIONS_KW;
+   static const char* MAX_QUADTREE_LEVELS_KW;
+   static const char* METADATA_TYPE_KW;
+   static const char* METERS_PER_PIXEL_KW;
+   static const char* METERS_PER_PIXEL_X_KW;
+   static const char* METERS_PER_PIXEL_Y_KW;
+   static const char* MINOR_AXIS_KW;
+   static const char* MIN_VALUE_KW;
+   static const char* NULL_VALUE_KW;
+   static const char* NUMBER_BANDS_KW;
+   static const char* NUMBER_ENTRIES_KW;
+   static const char* NUMBER_INPUT_BANDS_KW;
+   static const char* NUMBER_INPUTS_KW;
+   static const char* NUMBER_OUTPUTS_KW;
+   static const char* NUMBER_OUTPUT_BANDS_KW;
+   static const char* NUMBER_LINES_KW;
+   static const char* NUMBER_REDUCED_RES_SETS_KW;
+   static const char* NUMBER_SAMPLES_KW;
+   static const char* ORIGIN_LATITUDE_KW;
+   static const char* ORIGIN_X_KW;
+   static const char* ORIGIN_Y_KW;
+   static const char* ORIGINAL_MAP_UNITS_KW;
+   static const char* OUTPUT_FILE_KW;
+   static const char* OUTPUT_FILE_PREFIX_KW;
+   static const char* OUTPUT_FILE_EXTENSION_KW;
+   static const char* OUTPUT_TILE_SIZE_KW;
+   static const char* OVERVIEW_COMPRESSION_QUALITY_KW;
+   static const char* OVERVIEW_COMPRESSION_TYPE_KW;
+   static const char* OVERVIEW_FILE_KW;
+   static const char* OVERVIEW_STOP_DIMENSION_KW;
+   static const char* PCS_CODE_KW;
+   static const char* PEN_COLOR_KW;
+   static const char* PHOTOMETRIC_KW;
+   static const char* PIXEL_SCALE_XY_KW;
+   // static const char* PIXEL_SCALE_Y_KW;
+   static const char* PIXEL_SCALE_UNITS_KW;
+   static const char* PIXEL_TYPE_KW;
+   static const char* PLANAR_CONFIG_KW;
+   static const char* POINT_WIDTH_HEIGHT_KW;
+   static const char* PROJECTION_KW;
+   static const char* QUALITY_KW;
+   static const char* QUERY_KW;
+   static const char* RADIOMETRY_KW;
+   static const char* REDUCED_RES_LEVEL_KW;
+   static const char* REF_GPT_LAT_KW;
+   static const char* REF_GPT_LON_KW;
+   static const char* REF_GPT_HGT_KW;
+   static const char* REF_IPT_LINE_KW;
+   static const char* REF_IPT_SAMP_KW;
+   static const char* ROTATION_KW;
+   static const char* SCALAR_TYPE_KW;
+   static const char* SCALE_PER_PIXEL_X_KW;
+   static const char* SCALE_PER_PIXEL_Y_KW;
+   static const char* SCALE_FACTOR_KW;
+   static const char* SCALE_X_KW;
+   static const char* SCALE_Y_KW;
+   static const char* SCALE_FACTOR_X_KW;
+   static const char* SCALE_FACTOR_Y_KW;
+   static const char* SENSOR_ID_KW;
+   static const char* SRS_NAME_KW;
+   static const char* STD_PARALLEL_1_KW;
+   static const char* STD_PARALLEL_2_KW;
+   static const char* THICKNESS_KW;
+   static const char* THREADS_KW;
+   static const char* TIE_POINT_EASTING_KW;
+   static const char* TIE_POINT_NORTHING_KW;
+   static const char* TIE_POINT_XY_KW;
+   // static const char* TIE_POINT_Y_KW;
+   static const char* TIE_POINT_UNITS_KW;
+   
+   static const char* TIE_POINT_LAT_KW;
+   static const char* TIE_POINT_LON_KW;
+   static const char* TILE_SOURCE_KW;
+   static const char* TILE_TYPE_KW;
+   static const char* TILE_SIZE_X_KW;
+   static const char* TILE_SIZE_Y_KW;
+   static const char* TRANSLATION_X_KW;
+   static const char* TRANSLATION_Y_KW;
+   static const char* TYPE_KW;
+   static const char* UL_LAT_KW;
+   static const char* UL_LON_KW;
+   static const char* UNITS_KW;
+  
+   static const char* UR_LAT_KW;
+   static const char* UR_LON_KW;
+   static const char* UL_X_KW;
+   static const char* UL_Y_KW;
+   static const char* UR_X_KW;
+   static const char* UR_Y_KW;
+   static const char* VALID_VERTICES_KW;
+   static const char* VERTICAL_SIZE_KW;
+   static const char* ZONE_KW;
+
+protected:
+   ossimKeywordNames();
+   ossimKeywordNames(const ossimKeywordNames& rhs);
+   const ossimKeywordNames& operator =(const ossimKeywordNames &rhs);
+};
+
+#endif
diff --git a/include/ossim/base/ossimKeywordlist.h b/include/ossim/base/ossimKeywordlist.h
new file mode 100644
index 0000000..16f2412
--- /dev/null
+++ b/include/ossim/base/ossimKeywordlist.h
@@ -0,0 +1,560 @@
+//---
+//
+// License: MIT
+//
+// Author: Ken Melero
+// 
+// Description: This class provides capabilities for keywordlists.
+//
+//---
+// $Id$
+
+#ifndef ossimKeywordlist_HEADER
+#define ossimKeywordlist_HEADER 1
+
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimFilename.h>
+#include <map>
+#include <vector>
+#include <algorithm>
+
+static const char DEFAULT_DELIMITER = ':';
+
+class ossimFilename;
+
+/**
+ * Represents serializable keyword/value map. The format is
+ *
+ *   [<prefix>.]<keyword>: value [value ...]
+ *
+ * The map is not a multimap, i.e., the keywords must be unique. Only the last occurrence of
+ * identical keywords will be saved in the map. Methods are provided for reading from and writing
+ * to an ascii file. Methods are also provided for merging multiple maps (a.k.a. "lists" or "KWLs")
+ * as well as assorted operations for pruning and counting.
+ *
+ * Disk files representing a KWL can use the C-style "#include <filename>" preprocessor directive,
+ * where <filename> specifies another external KWL file that will be merged with the current list.
+ * This is convenient for sourcing common settings needed by multiple KWL files. Instead of
+ * duplicating all common keywords/value pairs, the various KWL files can all specify, for example,
+ *
+ *      #include common_prefs.kwl
+ *      #include "common config.kwl"
+ *
+ * The second form with quotes can be used, especially if the filename has spaces.
+ */
+class OSSIM_DLL ossimKeywordlist : public ossimErrorStatusInterface,
+   public ossimReferenced
+{
+public:
+
+   typedef std::map<std::string, std::string> KeywordMap;
+
+   ossimKeywordlist(const ossimKeywordlist& src);
+   ossimKeywordlist(const std::map<std::string, std::string>& keywordMap);
+   ossimKeywordlist(char delimiter = DEFAULT_DELIMITER,
+                    bool expandEnvVars = false);
+
+   ossimKeywordlist(const char* file,
+                    char        delimiter = DEFAULT_DELIMITER,
+                    bool        ignoreBinaryChars = false,
+                    bool        expandEnvVars = false );
+
+   ossimKeywordlist(const ossimFilename& fileName,
+                    char                 delimiter = DEFAULT_DELIMITER,
+                    bool                 ignoreBinaryChars = false,
+                    bool                 expandEnvVars = false);
+
+   ~ossimKeywordlist();
+
+   static const std::string NULL_KW;
+
+   /*!
+    *  Reads file and adds keywords to the KeywordMap.
+    *  Returns true if file was parsed, false on error.
+    */
+   bool addFile(const char* file);
+
+   /*!
+    *  Reads file and adds keywords to the KeywordMap.
+    *  Returns true if file was parsed, false on error.
+    */
+   bool addFile(const ossimFilename& file); 
+
+   /*!
+    *  Method to change default delimiter.  Handy when parsing
+    *  files similar to a ossimKeywordlist.  (DEFAULT = ':')
+    */
+   void change_delimiter(char del);
+
+   ossimString delimiter_str() const;
+
+   /*!
+    * If set to true, then strings found having the format
+    * "$(env_var_name)" are expanded in place.
+    */
+   void setExpandEnvVarsFlag( bool flag );
+   /*!
+    * Returns the flag that determines whether or not
+    * environment variables are expanded.
+    */
+   bool getExpandEnvVarsFlag( void ) const;
+
+   void add(const char* prefix,
+            const ossimKeywordlist& kwl,
+            bool overwrite=true);
+
+   /**
+    * This is a generic find method that takes a comparator type and iterates through 
+    * the map executing the overloaded operator ().
+    * Typical code example format
+    <pre>
+    typedef std::unary_function<std::pair<ossimString, ossimString>, bool> KwlCompareFunctionType;
+    
+    class KwlKeyCaseInsensitiveEquals : public KwlCompareFunctionType
+    {
+    public:
+       KwlKeyCaseInsensitiveEquals(const ossimString& key):m_key(key){}
+       virtual bool operator()(const KwlComparePairType& rhs)const
+       {
+          return (m_key == rhs.first.downcase());
+       }
+       ossimString m_key;
+    };
+
+    // now for use case example:
+    kwl.findValue(value, KwlKeyCaseInsensitiveEquals("foo"));
+    </pre>
+    
+    This example shows how to supplly your own comparator and do a case insensitive
+    search for the key foo and the value is set to the variable value.
+    *
+    */
+   template<class CompareType>
+   bool findValue(ossimString& value, const CompareType& compare)const
+   {
+      KeywordMap::const_iterator iter = std::find_if(m_map.begin(), m_map.end(), compare);
+      bool result = (iter != m_map.end());
+      if(result) value = iter->second;
+      return result;
+   }
+   
+   std::string& operator[](const std::string& key)
+   {
+      return m_map[key];
+   }
+   std::string operator[](const std::string& key)const
+   {
+      ossimString result = find(key.c_str());
+      
+      return result.c_str();
+   }
+
+   // Methods to add keywords to list.
+   void addPair(const std::string& key,
+                const std::string& value,
+                bool               overwrite = true);
+
+   void addPair(const std::string& prefix,
+                const std::string& key,
+                const std::string& value,
+                bool               overwrite = true);
+   
+   /*!
+    * Allows you to extract out a sub keywordlist from another
+    * you can also collapse the hieracrchy by setting
+    * strip prefix to true.
+    */
+   void add(const ossimKeywordlist& kwl,
+            const char* prefix=0,
+            bool stripPrefix=true);
+  
+   void add(const char*   key,
+            const char*   value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            const char*   value,
+            bool          overwrite = true);
+
+   void add(const char*   key,
+            char          value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            char          value,
+            bool          overwrite = true);
+
+   void add(const char*   key,
+            ossim_int16   value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_int16   value,
+            bool          overwrite = true);
+
+   void add(const char*   key,
+            ossim_uint16  value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_uint16  value,
+            bool          overwrite = true);
+
+   void add(const char*   key,
+            ossim_int32   value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_int32   value,
+            bool          overwrite = true);
+
+   void add(const char*   key,
+            ossim_uint32  value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_uint32  value,
+            bool          overwrite = true);
+
+   void add(const char*   key,
+            ossim_int64   value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_int64   value,
+            bool          overwrite = true);
+
+   void add(const char*   key,
+            ossim_uint64  value,
+            bool          overwrite = true);
+
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_uint64  value,
+            bool          overwrite = true);
+
+   /**
+    * @param key Key for key-value pair.
+    *
+    * @param value Value to pair with key.  Note this will be stored as a
+    * string.
+    * 
+    * @param precision Decimal point precision of the output. (default = 8)
+    *
+    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
+    * be trimmed from the converted string.  (default = false)
+    *
+    * @param scientific If true output will be in scientific notation else
+    * fixed is used. (default = false)
+    */
+   void add(const char*   key,
+            ossim_float32 value,
+            bool          overwrite    = true,
+            int           precision    = 8);
+
+   /**
+    * @param key Key for key-value pair.
+    *
+    * @param value Value to pair with key.  Note this will be stored as a
+    * string.
+    * 
+    * @param precision Decimal point precision of the output. (default = 8)
+    *
+    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
+    * be trimmed from the converted string.  (default = false)
+    *
+    * @param scientific If true output will be in scientific notation else
+    * fixed is used. (default = false)
+    */
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_float32 value,
+            bool          overwrite    = true,
+            int           precision    = 8);
+
+   /**
+    * @param key Key for key-value pair.
+    *
+    * @param value Value to pair with key.  Note this will be stored as a
+    * string.
+    * 
+    * @param precision Decimal point precision of the output. (default = 15)
+    *
+    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
+    * be trimmed from the converted string.  (default = false)
+    *
+    * @param scientific If true output will be in scientific notation else
+    * fixed is used. (default = false)
+    */
+   void add(const char*   key,
+            ossim_float64 value,
+            bool          overwrite    = true,
+            int           precision    = 15);
+
+   /**
+    * @param key Key for key-value pair.
+    *
+    * @param value Value to pair with key.  Note this will be stored as a
+    * string.
+    * 
+    * @param precision Decimal point precision of the output. (default = 15)
+    *
+    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
+    * be trimmed from the converted string.  (default = false)
+    *
+    * @param scientific If true output will be in scientific notation else
+    * fixed is used. (default = false)
+    */
+   void add(const char*   prefix,
+            const char*   key,
+            ossim_float64 value,
+            bool          overwrite    = true,
+            int           precision    = 15);
+
+   /**
+    * @brief Checks for key in map.
+    *
+    * Note that "find" and findKey will alway return an empty string even if
+    * the key in not in the map.
+    *
+    * @return true if key is in map even if value is empty; false, if not.
+    */
+   bool hasKey( const std::string& key ) const;
+   
+   /**
+    *  @brief Find methods that take std::string(s).
+    *  Searches the map for key(/prefix) and returns the resulting value
+    *  or an empty string if the key was not found.
+    *  @param key e.g. "number_line"
+    *  @param prefix e..g "image0."
+    *  @return Reference to string.  This will be emptry if not found or
+    *  if value is empty.
+    */
+   const std::string& findKey(const std::string& key) const;
+   const std::string& findKey(const std::string& prefix,
+                              const std::string& key) const;
+   
+   const char* find(const char* key) const;
+   const char* find(const char* prefix,
+                    const char* key) const;
+
+   void remove(const char * key);
+   void remove(const char* prefix, const char * key);
+
+   /*!
+    *  Searches the map for the number of keys containing the string.
+    */
+   ossim_uint32 numberOf(const char* str) const;
+
+   /*!
+    *  Searches the map for the number of keys containing the prefix+key.
+    *  
+    *  Given the keyword list contains:
+    *
+    *  source.type1: foo
+    *  source.type2: you
+    *
+    *  This:
+    *
+    *  int number_of_sources = numberOf("source", "type");
+    *
+    *  number_of_sources equals 2
+    */
+   ossim_uint32 numberOf(const char* prefix, const char* key) const;
+
+   /**
+    * Methods to dump the ossimKeywordlist to a file on disk.
+    *
+    * @param file Name of output file.
+    * @param comment Optional string that will be written to line 1
+    * as a C++-style comment. A "//" is prepended to the input string.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool write(const char* file, const char* comment = 0) const;
+
+   virtual ossimString toString()const;
+   virtual void toString(ossimString& result)const;
+
+   virtual void writeToStream(std::ostream &out)const;
+
+   virtual std::ostream& print(std::ostream& os) const;
+   OSSIMDLLEXPORT friend std::ostream& operator<<(std::ostream& os,
+                                                  const ossimKeywordlist& kwl);
+   bool operator ==(ossimKeywordlist& kwl)const;
+
+    /*!
+     * Clear all contents out of the ossimKeywordlist.
+     */
+
+    void clear();
+
+    /*!
+     * Add contents of another keyword list to this one.
+     *
+     * @param src the keyword list to copy items from.
+     * @param overwrite true if keys existing in this and src should have
+     * their value overwritten by the src value, otherwise false to preserve
+     * the original value.  Defaults to true.
+     */
+
+   void addList( const ossimKeywordlist &src, bool overwrite = true );
+
+   /** deprecated method */
+   virtual bool parseStream(ossim::istream& is,
+                            bool ignoreBinaryChars);
+   
+   virtual bool parseStream(ossim::istream& is);
+   virtual bool parseString(const std::string& inString);
+
+   /*!
+    *  Will return a list of keys that contain the string passed in.
+    *  Later we will need to allow a user to specify regular expresion
+    *  searches.
+    */
+   std::vector<ossimString> findAllKeysThatContains(
+      const ossimString &searchString)const;
+
+   /**
+    * @brief Finds keys that match regular expression.
+    *
+    * Note: This does not clear vector passed to it.
+    *
+    * @param result Initialized by this.
+    * @param regularExpression e.g. "image[0-9]*\\.file"
+    */
+   void findAllKeysThatMatch( std::vector<ossimString>& result,
+                              const ossimString &regularExpression ) const;
+
+   /**
+    * @brief Gets number keys that match regular expression.
+    * @param regularExpression e.g. "image[0-9]*\\.file"
+    * @return Number of keys matching regular expression.
+    */
+   ossim_uint32 getNumberOfKeysThatMatch(
+      const ossimString &regularExpression ) const;
+
+   void extractKeysThatMatch(ossimKeywordlist& kwl,
+                             const ossimString &regularExpression)const;
+
+   void removeKeysThatMatch(const ossimString &regularExpression);
+
+   /*!
+    * Will return only the portion of the key that
+    * matches the regular expression.
+    *
+    * example:
+    *
+    *  source1.source1.a:
+    *  source1.source2.a:
+    *  source1.source3.a:
+    *  source1.source4.a:
+    *  source1.source10.a:
+    *
+    *  kwl.getSubstringKeyList("source1.source[0-9]*\\.");
+    *
+    *  will return:
+    *
+    *  source1.source1.
+    *  source1.source2.
+    *  source1.source3.
+    *  source1.source4.
+    *  source1.source10.
+    *
+    */
+   std::vector<ossimString> getSubstringKeyList(const ossimString& regularExpression)const;
+   void getSubstringKeyList(std::vector<ossimString>& result,
+                            const ossimString& regularExpression)const;
+
+   ossim_uint32 getNumberOfSubstringKeys(
+      const ossimString& regularExpression)const;
+
+   void addPrefixToAll(const ossimString& prefix);
+   void addPrefixToKeysThatMatch(const ossimString& prefix,
+                                 const ossimString& regularExpression);
+   void stripPrefixFromAll(const ossimString& regularExpression);
+
+   /*!
+    * Returns the number of elements.
+    */
+   ossim_uint32 getSize()const;
+
+   const ossimKeywordlist::KeywordMap& getMap()const;
+   ossimKeywordlist::KeywordMap& getMap();
+   
+   ossimKeywordlist& downcaseKeywords();
+   ossimKeywordlist& upcaseKeywords();
+   
+   ossimKeywordlist& trimAllValues(const ossimString& valueToTrim= ossimString(" \t\n\r"));
+   ossimKeywordlist trimAllValues(const ossimString& valueToTrim= ossimString(" \t\n\r"))const;
+
+
+   //! [OLK, Aug/2008]
+   //! Sets the boolean  <rtn_val> depending on value associated with keyword for values = 
+   //! (yes|no|true|false|1|0). Returns TRUE if keyword found, otherwise false. Also returns false
+   //! if none of the above permitted values are specified (rtn_val left unchanged in this case).
+   bool getBoolKeywordValue(bool& rtn_val, 
+                            const char* keyword, 
+                            const char* prefix=0) const;
+
+protected:
+   enum KeywordlistParseState
+   {
+      KeywordlistParseState_OK         = 0,
+      
+      // Used to say this set of token has failed the rules.
+      KeywordlistParseState_FAIL       = 1,
+
+      // Means an error occured that is a mal formed stream for Keywordlist.
+      KeywordlistParseState_BAD_STREAM = 2, 
+   };
+   /*!
+    *  Method to parse files to initialize the list.  Method will error on
+    *  binary characters if "ignoreBinaryChars = false".  This is used by
+    *  ImageHandler factories that can be passed a binary file inadvertently
+    *  by a user.  The "ignoreBinaryChars" flag should be set to true if
+    *  a text file contains mixed ascii/binary values.
+    *  Returns true if file was parsed, false on error.
+    */
+   bool parseFile(const ossimFilename& file,
+                  bool  ignoreBinaryChars = false);
+
+   bool isValidKeywordlistCharacter(ossim_uint8 c)const;
+   void skipWhitespace(ossim::istream& in)const;
+   KeywordlistParseState readComments(ossimString& sequence, ossim::istream& in)const;
+   KeywordlistParseState readPreprocDirective(ossim::istream& in);
+   KeywordlistParseState readKey(ossimString& sequence, ossim::istream& in)const;
+   KeywordlistParseState readValue(ossimString& sequence, ossim::istream& in)const;
+   KeywordlistParseState readKeyAndValuePair(ossimString& key,
+                                             ossimString& value, ossim::istream& in)const;
+   
+   // Method to see if keyword exists in list.
+   KeywordMap::iterator getMapEntry(const std::string& key);
+   KeywordMap::iterator getMapEntry(const ossimString& key);
+   KeywordMap::iterator getMapEntry(const char* key);
+
+   KeywordMap               m_map;
+   char                     m_delimiter;
+
+   // enables preserving empty field values, multi lines, ... etc
+   bool                     m_preserveKeyValues; 
+
+   bool                     m_expandEnvVars;
+
+   // enables relative paths in #include directive
+   ossimFilename            m_currentlyParsing; 
+};
+
+#endif /* #ifndef ossimKeywordlist_HEADER */
diff --git a/ossim/include/ossim/base/ossimLagrangeInterpolator.h b/include/ossim/base/ossimLagrangeInterpolator.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLagrangeInterpolator.h
rename to include/ossim/base/ossimLagrangeInterpolator.h
diff --git a/ossim/include/ossim/base/ossimLeastSquaresBilin.h b/include/ossim/base/ossimLeastSquaresBilin.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLeastSquaresBilin.h
rename to include/ossim/base/ossimLeastSquaresBilin.h
diff --git a/ossim/include/ossim/base/ossimLeastSquaresPlane.h b/include/ossim/base/ossimLeastSquaresPlane.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLeastSquaresPlane.h
rename to include/ossim/base/ossimLeastSquaresPlane.h
diff --git a/ossim/include/ossim/base/ossimLine.h b/include/ossim/base/ossimLine.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLine.h
rename to include/ossim/base/ossimLine.h
diff --git a/include/ossim/base/ossimListener.h b/include/ossim/base/ossimListener.h
new file mode 100644
index 0000000..041b284
--- /dev/null
+++ b/include/ossim/base/ossimListener.h
@@ -0,0 +1,51 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimListener.h 14789 2009-06-29 16:48:14Z dburken $
+#ifndef ossimListener_HEADER
+#define ossimListener_HEADER
+#include <ossim/base/ossimObject.h>
+
+class ossimEvent;
+
+/*!
+ * Base class for all listners.  Listners nned to derive from this
+ * class and override the processEvent method.
+ */
+class OSSIMDLLEXPORT ossimListener
+{
+public:
+
+   ossimListener();
+
+   virtual ~ossimListener();
+
+   /**
+    * ProcessEvent.  The defaul is to do nothing.  Derived
+    * classes need to override this class.
+    */
+   virtual void processEvent(ossimEvent& event);
+
+   void enableListener();
+
+   void disableListener();
+
+   void setListenerEnableFlag(bool flag);
+
+   bool isListenerEnabled() const;
+
+   bool getListenerEnableFlag() const;
+
+protected:
+   bool theListenerEnableFlag;
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimListenerManager.h b/include/ossim/base/ossimListenerManager.h
similarity index 100%
rename from ossim/include/ossim/base/ossimListenerManager.h
rename to include/ossim/base/ossimListenerManager.h
diff --git a/include/ossim/base/ossimLookUpTable.h b/include/ossim/base/ossimLookUpTable.h
new file mode 100644
index 0000000..1b3d904
--- /dev/null
+++ b/include/ossim/base/ossimLookUpTable.h
@@ -0,0 +1,116 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for LookUpTable. 
+//*******************************************************************
+//  $Id: ossimLookUpTable.h 19448 2011-04-26 15:15:07Z dburken $
+
+#ifndef ossimLookUpTable_HEADER
+#define ossimLookUpTable_HEADER
+
+#include <vector>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeyword.h>
+
+class ossimKeywordlist;
+
+//*******************************************************************
+// CLASS:  LookUpTable
+//*******************************************************************
+class OSSIMDLLEXPORT ossimLookUpTable
+{
+public:
+
+   enum
+   {
+      NOT_FOUND    = -1
+   };
+   
+   virtual ~ossimLookUpTable();
+
+   /*!
+    *  @return
+    *  Returns the entry string associated with the entry number (key) passed
+    *  in. Returns empty string if entry number is not in the list.
+    */
+   virtual ossimString getEntryString(ossim_int32 entry_number) const;
+
+   /*!
+    *  @param table_index Index into the table
+    *  Note:  This is not the key mapped to the but the index into the table.
+    *  @return
+    *  Returns the entry string associated with the table index passed in.
+    *  Returns empty string if index is out of range.
+    */
+   virtual ossimString getTableIndexString(ossim_uint32 table_index) const;
+
+   /*!
+    *  Returns the entry string associated with the entry number passed in.
+    *  Returns empty string if entry number is not in the list.
+    */
+   virtual ossimString operator[](ossim_int32 entry_number) const;
+
+   /*!
+    *  Returns the entry string associated with lookup table keyword entry
+    *  in the Keywordlist passed in.
+    *  Returns empty string if keyword entry is not in the Keywordlist.
+    */
+   virtual ossimString getEntryString(const ossimKeywordlist& kwl,
+                                      const char* prefix=0) const;
+
+   /*!
+    *  Returns the entry number associated with the entry string passed in.
+    *  Returns NOT_FOUND(-1) if entry string is not in the list.
+    *  If case_insensitive == true(default), the test is case insensitive;
+    *  else, the test will be case sensitive.
+    */
+   virtual ossim_int32 getEntryNumber(const char* entry_string,
+                                      bool case_insensitive = true) const;
+
+   /*!
+    *  Returns the entry number associated with the lookup table keyword
+    *  entry in the Keywordlist passed in.  Returns NOT_FOUND(-1) if no
+    *  matching entry.
+    *  If case_insensitive == true(default), the test is case insensitive;
+    *  else, the test will be case sensitive.
+    */
+   virtual ossim_int32 getEntryNumber(const ossimKeywordlist& kwl,
+                                      const char* prefix=0,
+                                      bool case_insensitive = true) const;
+
+   /*!
+    *  Returns keyword for lookups from a Keywordlist.
+    */
+   virtual ossimKeyword getKeyword() const=0;
+
+   virtual ossim_uint32 getTableSize() const;
+  
+  void dumpValues(std::ostream& out)const;
+protected:
+
+   ossimLookUpTable(ossim_int32 table_size);
+
+   class ossimKeyValueMap
+   {
+   public:
+      void init (ossim_int32 key, const ossimString& value) { theKey=key; theValue=value; }
+      ossim_int32  theKey;
+      ossimString theValue;
+   };
+
+   std::vector<ossimKeyValueMap>  theTable;
+   
+   ossimLookUpTable(){}
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimLsrPoint.h b/include/ossim/base/ossimLsrPoint.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLsrPoint.h
rename to include/ossim/base/ossimLsrPoint.h
diff --git a/ossim/include/ossim/base/ossimLsrRay.h b/include/ossim/base/ossimLsrRay.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLsrRay.h
rename to include/ossim/base/ossimLsrRay.h
diff --git a/ossim/include/ossim/base/ossimLsrSpace.h b/include/ossim/base/ossimLsrSpace.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLsrSpace.h
rename to include/ossim/base/ossimLsrSpace.h
diff --git a/ossim/include/ossim/base/ossimLsrVector.h b/include/ossim/base/ossimLsrVector.h
similarity index 100%
rename from ossim/include/ossim/base/ossimLsrVector.h
rename to include/ossim/base/ossimLsrVector.h
diff --git a/ossim/include/ossim/base/ossimMatrix3x3.h b/include/ossim/base/ossimMatrix3x3.h
similarity index 100%
rename from ossim/include/ossim/base/ossimMatrix3x3.h
rename to include/ossim/base/ossimMatrix3x3.h
diff --git a/ossim/include/ossim/base/ossimMatrix4x4.h b/include/ossim/base/ossimMatrix4x4.h
similarity index 100%
rename from ossim/include/ossim/base/ossimMatrix4x4.h
rename to include/ossim/base/ossimMatrix4x4.h
diff --git a/ossim/include/ossim/base/ossimMatrixProperty.h b/include/ossim/base/ossimMatrixProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimMatrixProperty.h
rename to include/ossim/base/ossimMatrixProperty.h
diff --git a/include/ossim/base/ossimMetadataInterface.h b/include/ossim/base/ossimMetadataInterface.h
new file mode 100644
index 0000000..3986941
--- /dev/null
+++ b/include/ossim/base/ossimMetadataInterface.h
@@ -0,0 +1,45 @@
+//----------------------------------------------------------------------------
+// File: ossimFileProcessorInterface.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class interface ossimMetadataInterface.
+//
+// Has pure virtual "addMetadata" method that derived classes must
+// implement to be concrete.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimMetadataInterface_HEADER
+#define ossimMetadataInterface_HEADER 1
+
+#include <string>
+
+class ossimKeywordlist;
+
+/** @class ossimMetadataInterface */
+class ossimMetadataInterface
+{
+public:
+   
+   /** @brief default constructor */
+   ossimMetadataInterface(){}
+
+   /** @brief virtual destructor. */
+   virtual ~ossimMetadataInterface(){}
+
+   /**
+    * @brief Pure virtual addMetadata method. Derived classed must implement.
+    * @param kwl Initialized by this.
+    * @param prefix e.g. "image0." (can be empty)
+    */
+   virtual void addMetadata( ossimKeywordlist* kwl,
+                             const std::string& prefix ) const = 0;
+};
+
+#endif /* #ifndef ossimMetadataInterface_HEADER */
diff --git a/ossim/include/ossim/base/ossimMouseEvent.h b/include/ossim/base/ossimMouseEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimMouseEvent.h
rename to include/ossim/base/ossimMouseEvent.h
diff --git a/ossim/include/ossim/base/ossimMouseListener.h b/include/ossim/base/ossimMouseListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimMouseListener.h
rename to include/ossim/base/ossimMouseListener.h
diff --git a/ossim/include/ossim/base/ossimMultiBandHistogram.h b/include/ossim/base/ossimMultiBandHistogram.h
similarity index 100%
rename from ossim/include/ossim/base/ossimMultiBandHistogram.h
rename to include/ossim/base/ossimMultiBandHistogram.h
diff --git a/include/ossim/base/ossimMultiResLevelHistogram.h b/include/ossim/base/ossimMultiResLevelHistogram.h
new file mode 100644
index 0000000..6b284dd
--- /dev/null
+++ b/include/ossim/base/ossimMultiResLevelHistogram.h
@@ -0,0 +1,103 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+// Description: 
+//
+//*******************************************************************
+//  $Id: ossimMultiResLevelHistogram.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimMultiResLevelHistogram_HEADER
+#define ossimMultiResLevelHistogram_HEADER
+#include <vector>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+
+class OSSIMDLLEXPORT ossimMultiResLevelHistogram : public ossimReferenced
+{
+public:
+   ossimMultiResLevelHistogram();
+   ossimMultiResLevelHistogram(ossim_uint32 numberOfResLevels);
+   ossimMultiResLevelHistogram(const ossimMultiResLevelHistogram& rhs);
+   virtual ~ossimMultiResLevelHistogram();
+   
+
+   ossimRefPtr<ossimHistogram> getHistogram(ossim_uint32 band,
+                                            ossim_uint32 resLevel=0);
+   const ossimRefPtr<ossimHistogram> getHistogram(ossim_uint32 band,
+                                                  ossim_uint32 resLevel=0)const;
+   ossim_uint32 getNumberOfResLevels()const;
+   ossim_uint32 getNumberOfBands(ossim_uint32 resLevel=0) const;
+   void create(ossim_uint32 numberOfResLevels);
+   ossimRefPtr<ossimMultiBandHistogram> getMultiBandHistogram(ossim_uint32 resLevel) const;
+   ossimRefPtr<ossimMultiResLevelHistogram> createAccumulationLessThanEqual()const;
+   ossimRefPtr<ossimMultiResLevelHistogram> createAccumulationGreaterThanEqual()const;
+
+   void setBinCount(double binNumber, double count);
+   /*!
+    * Will append to the list the passed in histogram.
+    */
+   virtual void addHistogram(ossimMultiBandHistogram* histo);
+
+   /*!
+    * This will create and append a histogram to the
+    * list and return a pointer to the new histogram.
+    */
+   virtual ossimRefPtr<ossimMultiBandHistogram> addHistogram();
+
+   /*!
+    * Will set the histogram to the passed in res level.
+    * It will delete the histogram at the res level before
+    * setting the pointer to the passed in histogram.  if
+    * the resLevel is out of range it will return false meaning
+    * it was unable to assign the pointer.
+    */
+   virtual bool setHistogram(ossimRefPtr<ossimMultiBandHistogram> histo, ossim_uint32 resLevel);
+
+   virtual ossimFilename getHistogramFile() const;
+   virtual bool importHistogram(const ossimFilename& inputFile);
+   virtual bool importHistogram(std::istream& in);
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+protected:
+  class  ossimProprietaryHeaderInformation
+   {
+   public:
+      ossimProprietaryHeaderInformation(){clear();}
+
+      bool parseStream(std::istream& in);
+
+      ossim_uint32 getNumberOfResLevels()
+         {
+            return theNumberOfResLevels.toUInt32();
+         }
+      void clear()
+         {
+            theFileType          = "";
+            theVersion           = "";
+            theCreatorId         = "";
+            theNumberOfResLevels = "";
+         }
+      ossimString theFileType;
+      ossimString theVersion;
+      ossimString theCreatorId;
+      ossimString theNumberOfResLevels;
+   };
+
+   std::vector<ossimRefPtr<ossimMultiBandHistogram> > theHistogramList;
+   ossimFilename                    theHistogramFile;
+   
+   void deleteHistograms();
+   bool parseProprietaryHistogram(std::istream& in);
+};
+
+#endif
diff --git a/include/ossim/base/ossimNBandLutDataObject.h b/include/ossim/base/ossimNBandLutDataObject.h
new file mode 100644
index 0000000..be9aa66
--- /dev/null
+++ b/include/ossim/base/ossimNBandLutDataObject.h
@@ -0,0 +1,489 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// LICENSE: LGPL See top level license file.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimNBandLutDataObject.h 19732 2011-06-06 22:24:54Z dburken $
+#ifndef ossimNBandLutDataObject_HEADER
+#define ossimNBandLutDataObject_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimFilename.h>
+#include <iostream>
+#include <map>
+
+/**
+ * class ossimNBandLutDataObject
+ *
+ * Sample CADRG LUT taken from an arbitrary CADRG image entry.  This is a keywordlist
+ * support by the loadstate of this class.
+ *
+ * <pre>
+ * entry0:  25 39 116 
+ * entry1:  245 242 242 
+ * entry10:  92 89 115 
+ * entry100:  74 55 85 
+ * entry101:  233 165 53 
+ * entry102:  75 2 4 
+ * entry103:  162 118 42 
+ * entry104:  233 159 130 
+ * entry105:  189 129 40 
+ * entry106:  154 109 66 
+ * entry107:  145 97 85 
+ * entry108:  121 86 31 
+ * entry109:  238 151 118 
+ * entry11:  52 31 76 
+ * entry110:  239 167 42 
+ * entry111:  236 137 100 
+ * entry112:  179 112 88 
+ * entry113:  92 37 33 
+ * entry114:  121 66 24 
+ * entry115:  120 133 151 
+ * entry116:  76 92 192 
+ * entry117:  36 50 117 
+ * entry118:  57 75 191 
+ * entry119:  125 45 50 
+ * entry12:  235 217 204 
+ * entry120:  102 65 81 
+ * entry121:  172 148 199 
+ * entry122:  204 145 95 
+ * entry123:  81 19 5 
+ * entry124:  91 4 1 
+ * entry125:  109 54 31 
+ * entry126:  137 114 118 
+ * entry127:  230 150 52 
+ * entry128:  82 38 87 
+ * entry129:  190 120 76 
+ * entry13:  244 218 172 
+ * entry130:  170 109 45 
+ * entry131:  95 20 22 
+ * entry132:  150 80 61 
+ * entry133:  225 122 82 
+ * entry134:  122 37 16 
+ * entry135:  146 88 49 
+ * entry136:  122 94 122 
+ * entry137:  230 135 63 
+ * entry138:  137 73 75 
+ * entry139:  119 46 29 
+ * entry14:  189 167 141 
+ * entry140:  190 142 128 
+ * entry141:  242 216 187 
+ * entry142:  176 125 95 
+ * entry143:  193 117 143 
+ * entry144:  19 0 0 
+ * entry145:  12 1 42 
+ * entry146:  24 4 26 
+ * entry147:  38 40 52 
+ * entry148:  8 24 175 
+ * entry149:  40 23 45 
+ * entry15:  245 213 142 
+ * entry150:  39 11 58 
+ * entry151:  10 0 22 
+ * entry152:  236 148 41 
+ * entry153:  101 41 11 
+ * entry154:  230 113 67 
+ * entry155:  148 44 46 
+ * entry156:  225 144 133 
+ * entry157:  115 2 13 
+ * entry158:  159 79 49 
+ * entry159:  164 95 33 
+ * entry16:  246 241 205 
+ * entry160:  97 6 22 
+ * entry161:  175 90 133 
+ * entry162:  112 23 20 
+ * entry163:  105 22 6 
+ * entry164:  148 59 33 
+ * entry165:  215 118 104 
+ * entry166:  211 122 41 
+ * entry167:  233 129 34 
+ * entry168:  153 73 25 
+ * entry169:  208 102 39 
+ * entry17:  240 215 89 
+ * entry170:  206 101 133 
+ * entry171:  229 113 96 
+ * entry172:  127 16 25 
+ * entry173:  224 104 28 
+ * entry174:  171 76 74 
+ * entry175:  221 94 78 
+ * entry176:  229 86 94 
+ * entry177:  213 80 57 
+ * entry178:  161 44 36 
+ * entry179:  155 54 19 
+ * entry18:  115 92 157 
+ * entry180:  130 25 5 
+ * entry181:  150 29 24 
+ * entry182:  198 54 34 
+ * entry183:  224 61 70 
+ * entry184:  213 82 37 
+ * entry185:  186 28 31 
+ * entry186:  200 64 15 
+ * entry187:  110 2 2 
+ * entry188:  195 38 12 
+ * entry189:  151 6 8 
+ * entry19:  160 163 37 
+ * entry190:  193 13 10 
+ * entry191:  205 1 3 
+ * entry192:  44 62 193 
+ * entry193:  35 14 16 
+ * entry194:  15 30 118 
+ * entry195:  28 47 189 
+ * entry196:  25 3 80 
+ * entry197:  7 16 118 
+ * entry198:  33 10 6 
+ * entry199:  39 24 95 
+ * entry2:  216 212 237 
+ * entry20:  38 29 21 
+ * entry200:  82 58 159 
+ * entry201:  55 29 142 
+ * entry202:  33 4 23 
+ * entry203:  17 14 36 
+ * entry204:  58 26 41 
+ * entry205:  11 13 14 
+ * entry206:  74 87 85 
+ * entry207:  50 60 41 
+ * entry208:  119 123 98 
+ * entry209:  193 187 172 
+ * entry21:  208 202 156 
+ * entry210:  124 126 128 
+ * entry211:  47 68 84 
+ * entry212:  110 119 60 
+ * entry213:  63 145 121 
+ * entry214:  154 166 147 
+ * entry215:  107 156 104 
+ * entry22:  242 202 152 
+ * entry23:  168 148 140 
+ * entry24:  31 22 25 
+ * entry25:  245 205 114 
+ * entry26:  245 191 137 
+ * entry27:  175 161 172 
+ * entry28:  17 6 11 
+ * entry29:  172 170 137 
+ * entry3:  247 230 113 
+ * entry30:  51 27 20 
+ * entry31:  239 210 73 
+ * entry32:  185 176 129 
+ * entry33:  35 2 13 
+ * entry34:  60 52 51 
+ * entry35:  101 78 70 
+ * entry36:  141 124 101 
+ * entry37:  206 184 107 
+ * entry38:  244 174 106 
+ * entry39:  82 98 136 
+ * entry4:  246 231 132 
+ * entry40:  190 191 239 
+ * entry41:  241 188 161 
+ * entry42:  67 51 38 
+ * entry43:  244 184 122 
+ * entry44:  211 201 142 
+ * entry45:  61 27 16 
+ * entry46:  182 182 82 
+ * entry47:  243 188 87 
+ * entry48:  86 83 60 
+ * entry49:  61 40 43 
+ * entry5:  204 198 166 
+ * entry50:  146 141 93 
+ * entry51:  44 4 4 
+ * entry52:  231 210 51 
+ * entry53:  85 74 39 
+ * entry54:  197 169 127 
+ * entry55:  182 151 60 
+ * entry56:  121 98 73 
+ * entry57:  243 182 145 
+ * entry58:  58 18 21 
+ * entry59:  241 157 91 
+ * entry6:  2 0 2 
+ * entry60:  59 4 1 
+ * entry61:  155 162 223 
+ * entry62:  154 133 80 
+ * entry63:  73 21 16 
+ * entry64:  195 183 116 
+ * entry65:  76 51 29 
+ * entry66:  234 181 63 
+ * entry67:  58 59 98 
+ * entry68:  42 22 79 
+ * entry69:  134 143 219 
+ * entry7:  204 204 239 
+ * entry70:  106 117 205 
+ * entry71:  48 65 117 
+ * entry72:  63 54 117 
+ * entry73:  125 93 62 
+ * entry74:  137 138 41 
+ * entry75:  104 68 59 
+ * entry76:  113 99 41 
+ * entry77:  76 30 11 
+ * entry78:  239 184 48 
+ * entry79:  161 129 98 
+ * entry8:  31 4 66 
+ * entry80:  241 170 126 
+ * entry81:  145 109 105 
+ * entry82:  207 163 116 
+ * entry83:  79 41 40 
+ * entry84:  175 138 41 
+ * entry85:  10 0 56 
+ * entry86:  180 151 77 
+ * entry87:  72 12 24 
+ * entry88:  242 154 105 
+ * entry89:  91 26 15 
+ * entry9:  246 238 162 
+ * entry90:  160 118 53 
+ * entry91:  228 166 141 
+ * entry92:  231 160 69 
+ * entry93:  61 2 11 
+ * entry94:  132 83 60 
+ * entry95:  86 46 24 
+ * entry96:  243 143 86 
+ * entry97:  108 60 46 
+ * entry98:  109 76 38 
+ * entry99:  96 86 84 
+ * null_value:  -1
+ * number_bands:  3
+ * number_entries:  216
+ * scalar_type:  ossim_uint8
+ * type:  ossimNBandLutDataObject
+ *
+ *
+ * NOTES:
+ * 
+ * - The null_value keyword above is the index in the lut that correspnds to an invalid pixel value.
+ * - Each entry will have number_bands.  SO if number of bands is 3 then there will be 3 values
+ *   Where the first value is for band 1, ... etc.
+ * - scalar_type is a hint as to the scalar type of the entries.  Is the resulting lut for 8 bit, 16 bit , etc data.
+ * - You should always use the LUT_ENTRY_TYPE when getting values from the lut.  This value could change to an
+ *   ossim_float32 precision and if you use the LUT_ENTRY_TYPE then your code will not have to change.
+ *   
+ * </pre>
+ */
+class OSSIM_DLL ossimNBandLutDataObject : public ossimObject
+{
+public:
+   
+   typedef ossim_int32 LUT_ENTRY_TYPE;
+   
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNBandLutDataObject& lut);
+   /*!
+    * Will allocate 256 values for the color table
+    */
+   ossimNBandLutDataObject(ossim_uint32 numberOfEntries=0,
+                           ossim_uint32 numberOfBands=0,
+                           ossimScalarType bandScalarType = OSSIM_UINT8,
+                           ossim_int32 nullPixelIndex=-1);
+   ossimNBandLutDataObject(const ossimNBandLutDataObject& lut);
+   ossimObject* dup()const
+   {
+      return new ossimNBandLutDataObject(*this);
+   }
+   void create(ossim_uint32 numberOfEntries,
+               ossim_uint32 numberOfBands=3);
+   const LUT_ENTRY_TYPE* operator[](ossim_uint32 idx)const
+   {
+      if(theLut)
+      {
+         return &theLut[idx*theNumberOfBands];
+      }
+      
+      return 0;
+   }
+   LUT_ENTRY_TYPE* operator[](ossim_uint32 idx)
+   {
+      if(theLut)
+      {
+         return &theLut[idx*theNumberOfBands];
+      }
+      
+      return 0;
+   }
+   const LUT_ENTRY_TYPE* operator[](ossim_int32 idx)const
+   {
+      if(theLut)
+      {
+         return &theLut[idx*theNumberOfBands];
+      }
+      
+      return 0;
+   }
+   LUT_ENTRY_TYPE* operator[](ossim_int32 idx)
+   {
+      if(theLut)
+      {
+         return &theLut[idx*theNumberOfBands];
+      }
+      
+      return 0;
+   }
+   const LUT_ENTRY_TYPE* operator[](double normalizedIndex)const
+   {
+      int idx = int(normalizedIndex*theNumberOfEntries);
+      if (idx < 0)
+      {
+         idx = 0;
+      }
+      return (*this)[idx];
+   }
+
+   /**
+    * @param normalizedIndex  If a double precision value is passed in then it is
+    *                         assumed to be in normalized space where the value ranges from 0.0 to 1.0
+    * @return the starting address of the band values.
+    */ 
+   LUT_ENTRY_TYPE* operator[](double normalizedIndex)
+   {
+      ossim_uint32 idx = int(normalizedIndex*(theNumberOfEntries-1));
+      if (idx >= theNumberOfEntries)
+      {
+         idx = theNumberOfEntries-1;
+      }
+      return (*this)[idx];
+   }
+   
+   bool hasNullPixelIndex()const
+   {
+      return (theNullPixelIndex >= 0);
+   }
+   /**
+    * Will return the min max value for a given band
+    *
+    * @param band band number to query.  This is 0 based so the first band
+    *        is indicated by the value of 0.
+    * @param minValue is the minimum value returned for the passed in band
+    * @param maxValue is the maximum value returned for the passed in band
+    */
+   void getMinMax(ossim_uint32 band,
+                  LUT_ENTRY_TYPE& minValue,
+                  LUT_ENTRY_TYPE& maxValue);
+
+   /**
+    * @return First index with alpha of 0 or -1 if not found or there is no alpha.
+    *
+    * Currently only works on 4 band data.  May consider adding an alpha channel
+    * class data member in the future.
+    */
+   ossim_int32 getFirstNullAlphaIndex() const;
+   
+   /**
+    * Allows you to specify which entry is to be designated as an invalid
+    * entry.  Note: setting this to -1 indicates no null entry is set.
+    *
+    * @param idx is the entry number that will be used for the null value
+    */
+   void setNullPixelIndex(ossim_int32 idx){theNullPixelIndex = idx;}
+
+   /**
+    * @return Return either a positive value indicating the entry designated for
+    *         a null pixel value or a -1 to say no null pixel has been designated
+    *         yet.
+    */ 
+   ossim_int32 getNullPixelIndex()const{return theNullPixelIndex;}
+
+   /**
+    * @return Return the number of bands this lut is indexed for.
+    */ 
+   ossim_uint32 getNumberOfBands()const{return theNumberOfBands;}
+
+   /**
+    * @return Return the number of entries in the lut.
+    */ 
+   ossim_uint32 getNumberOfEntries()const{return theNumberOfEntries;}
+
+   /**
+    * This method gives you a way to find an entry index closest to the passed in
+    * band values.
+    * 
+    * @param values Is an array of band values.  This array must be equal to the number
+    *        of bands for the lut.
+    * @return Returns the nearest index to the passed in value.  
+    */ 
+   ossim_uint32 findIndex(ossim_int32* values) const;
+
+   /**
+    * @brief This method gives you a way to find an entry index closest to the
+    * passed in band values.
+    * 
+    * @param values Is an array of band values.
+    * @param size Size of values array.  Note if size is less than the LUT
+    * number of bands, the trailing bands get dropped.  This allows finding
+    * an index dropping the alpha channel.
+    * 
+    * @return Returns the nearest index to the passed in value.  
+    */ 
+   ossim_uint32 findIndex(ossim_int32* values, ossim_uint32 size) const;
+
+   /**
+    * Will do a simple memset to '\0' all 
+    */ 
+   void clearLut();
+   /**
+    * does a deep copy from the passed in lut to the object.
+    *
+    * @param lut The lut to copy.
+    */ 
+   const ossimNBandLutDataObject& operator =(const ossimNBandLutDataObject& lut);
+
+   /**
+    * Determines if the state of this lut is identical to the passed in lut
+    *
+    * @param lut Checks equality of the this object to the lut parameter.
+    * @return True if equal and false otherwise
+    */ 
+   bool operator ==(const ossimNBandLutDataObject& lut)const;
+
+   /**
+    * Reads in an external lut file.  The external file is in a keywordlist format specified by the saveState.
+    */ 
+   bool open(const ossimFilename& lutFile);
+
+   /**
+    * <pre>
+    * 
+    * Keywords:
+    *  
+    * entry0:
+    * entry1:
+    * :
+    * entry<number_entries-1>:
+    * null_value:  -1
+    * number_bands:  3
+    * number_entries:  216
+    * scalar_type:  ossim_uint8
+    * type:  ossimNBandLutDataObject
+    *
+    * Where entry<idx> is repeasted for each entry number where idx start from 0 and goes to number_entries-1
+    * each entry must have number_bands values.
+    * </pre>
+    *
+    * @param kwl The keyword list to store the keywords to.  Each keyword could be prefixed by an optional
+    *            prefix parameter.
+    * @param prefix The optional prefix parameter used to prefix each keyword.
+    * 
+    */ 
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   std::vector<ossimString> getEntryLabels(ossim_uint32 band);
+
+   void setEntryLables(ossim_uint32 band, std::vector<ossimString> entryLabels);
+
+   
+   /**
+    * Loads the state of the object by reading in the keywords listed in the save state.
+    *
+    * @param kwl The keywordlist to extract the classes keywords from to restore its state.
+    * @param prefix  Optional prefix value used to prefix each keyword.
+    */ 
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+protected:
+   virtual ~ossimNBandLutDataObject();
+
+   LUT_ENTRY_TYPE *theLut;
+   ossim_uint32    theNumberOfEntries;
+   ossim_uint32    theNumberOfBands;
+   ossimScalarType theBandScalarType;
+   ossim_int32     theNullPixelIndex;
+   std::map<ossim_uint32, std::vector<ossimString> >  m_entryLabels;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimNadconGridDatum.h b/include/ossim/base/ossimNadconGridDatum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNadconGridDatum.h
rename to include/ossim/base/ossimNadconGridDatum.h
diff --git a/ossim/include/ossim/base/ossimNadconGridFile.h b/include/ossim/base/ossimNadconGridFile.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNadconGridFile.h
rename to include/ossim/base/ossimNadconGridFile.h
diff --git a/ossim/include/ossim/base/ossimNadconGridHeader.h b/include/ossim/base/ossimNadconGridHeader.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNadconGridHeader.h
rename to include/ossim/base/ossimNadconGridHeader.h
diff --git a/ossim/include/ossim/base/ossimNadconNarDatum.h b/include/ossim/base/ossimNadconNarDatum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNadconNarDatum.h
rename to include/ossim/base/ossimNadconNarDatum.h
diff --git a/ossim/include/ossim/base/ossimNadconNasDatum.h b/include/ossim/base/ossimNadconNasDatum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNadconNasDatum.h
rename to include/ossim/base/ossimNadconNasDatum.h
diff --git a/include/ossim/base/ossimNormRgbVector.h b/include/ossim/base/ossimNormRgbVector.h
new file mode 100644
index 0000000..b5f4b25
--- /dev/null
+++ b/include/ossim/base/ossimNormRgbVector.h
@@ -0,0 +1,109 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License: LGPL
+// Author: Garrett Potts 
+// Description:
+//
+//*************************************************************************
+// $Id: ossimNormRgbVector.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimNormRgbVector_HEADER
+#define ossimNormRgbVector_HEADER
+#include <iostream>
+#include <ossim/base/ossimConstants.h>
+
+class ossimJpegYCbCrVector;
+class ossimHsiVector;
+class ossimHsvVector;
+class ossimCmyVector;
+class ossimRgbVector;
+
+class OSSIM_DLL ossimNormRgbVector
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out, const ossimNormRgbVector& data)
+   {
+      out << "<" << data.theBuf[0] << ", "
+          << data.theBuf[1] << ", "
+          << data.theBuf[2] << ">";
+
+         return out;
+      }
+   ossimNormRgbVector(ossim_float64 r=0, ossim_float64 g=0, ossim_float64 b=0)
+      {
+         theBuf[0] = r;
+         theBuf[1] = g;
+         theBuf[2] = b;
+      }
+   ossimNormRgbVector(ossim_float64 grey)
+      {
+         theBuf[0] = grey;
+         theBuf[1] = grey;
+         theBuf[2] = grey;
+      }
+   ossimNormRgbVector(ossim_float64 colorData[3])
+      {
+         theBuf[0] = colorData[0];
+         theBuf[1] = colorData[1];
+         theBuf[2] = colorData[2];
+      }
+   ossimNormRgbVector(const ossimNormRgbVector& rgb)
+   {
+      theBuf[0] = rgb.theBuf[0];
+      theBuf[1] = rgb.theBuf[1];
+      theBuf[2] = rgb.theBuf[2];
+   }
+   ossimNormRgbVector(const ossimRgbVector& rgb);
+   ossimNormRgbVector(const ossimJpegYCbCrVector& YCbCr);
+   ossimNormRgbVector(const ossimHsiVector& hsi);
+   ossimNormRgbVector(const ossimHsvVector& hsv);
+   ossimNormRgbVector(const ossimCmyVector& cmy);
+   ossimNormRgbVector operator -(const ossimNormRgbVector& rgb)const
+   {
+      return ossimNormRgbVector(clamp(theBuf[0] - rgb.theBuf[0]),
+                                clamp(theBuf[1] - rgb.theBuf[1]),
+                                clamp(theBuf[2] - rgb.theBuf[2]));
+   }
+   ossimNormRgbVector operator *(ossim_float64 t)const
+   {
+      return ossimNormRgbVector(clamp(theBuf[0]*t),
+                                clamp(theBuf[1]*t),
+                                clamp(theBuf[2]*t));
+   }
+   
+   const ossimNormRgbVector& operator =(const ossimJpegYCbCrVector& data);
+   const ossimNormRgbVector& operator =(const ossimHsiVector& hsi);
+   const ossimNormRgbVector& operator =(const ossimHsvVector& hsv);
+   const ossimNormRgbVector& operator =(const ossimCmyVector& cmy);
+   bool operator ==(const ossimNormRgbVector& rgb)
+      {
+         return ( (rgb.theBuf[0] == theBuf[0])&&
+                  (rgb.theBuf[1] == theBuf[1])&&
+                  (rgb.theBuf[2] == theBuf[2]));
+      }
+   bool operator !=(const ossimNormRgbVector& rgb)
+      {
+         return ( (rgb.theBuf[0] != theBuf[0])||
+                  (rgb.theBuf[1] != theBuf[1])||
+                  (rgb.theBuf[2] != theBuf[2]));
+      }
+   static ossim_float64 clamp(ossim_float64 colorValue, ossim_float64 min=0.0, ossim_float64 max=1.0)
+      {
+         colorValue = colorValue > max? max:colorValue;
+         colorValue = colorValue < min? min:colorValue;
+         
+         return colorValue;
+      }
+   ossim_float64 getR() const { return theBuf[0]; }
+   ossim_float64 getG()const  { return theBuf[1]; }
+   ossim_float64 getB()const  { return theBuf[2]; }
+   void setR(ossim_float64 r) { theBuf[0] = r; }
+   void setG(ossim_float64 g) { theBuf[1] = g; }
+   void setB(ossim_float64 b) { theBuf[2] = b; }
+   
+protected:
+   ossim_float64 theBuf[3];
+   
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimNotify.h b/include/ossim/base/ossimNotify.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNotify.h
rename to include/ossim/base/ossimNotify.h
diff --git a/ossim/include/ossim/base/ossimNotifyContext.h b/include/ossim/base/ossimNotifyContext.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNotifyContext.h
rename to include/ossim/base/ossimNotifyContext.h
diff --git a/ossim/include/ossim/base/ossimNumericProperty.h b/include/ossim/base/ossimNumericProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimNumericProperty.h
rename to include/ossim/base/ossimNumericProperty.h
diff --git a/ossim/include/ossim/base/ossimObject.h b/include/ossim/base/ossimObject.h
similarity index 100%
rename from ossim/include/ossim/base/ossimObject.h
rename to include/ossim/base/ossimObject.h
diff --git a/ossim/include/ossim/base/ossimObjectDestructingEvent.h b/include/ossim/base/ossimObjectDestructingEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimObjectDestructingEvent.h
rename to include/ossim/base/ossimObjectDestructingEvent.h
diff --git a/ossim/include/ossim/base/ossimObjectEvents.h b/include/ossim/base/ossimObjectEvents.h
similarity index 100%
rename from ossim/include/ossim/base/ossimObjectEvents.h
rename to include/ossim/base/ossimObjectEvents.h
diff --git a/ossim/include/ossim/base/ossimObjectFactory.h b/include/ossim/base/ossimObjectFactory.h
similarity index 100%
rename from ossim/include/ossim/base/ossimObjectFactory.h
rename to include/ossim/base/ossimObjectFactory.h
diff --git a/ossim/include/ossim/base/ossimObjectFactoryRegistry.h b/include/ossim/base/ossimObjectFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/base/ossimObjectFactoryRegistry.h
rename to include/ossim/base/ossimObjectFactoryRegistry.h
diff --git a/ossim/include/ossim/base/ossimObservationSet.h b/include/ossim/base/ossimObservationSet.h
similarity index 100%
rename from ossim/include/ossim/base/ossimObservationSet.h
rename to include/ossim/base/ossimObservationSet.h
diff --git a/ossim/include/ossim/base/ossimOutputSource.h b/include/ossim/base/ossimOutputSource.h
similarity index 100%
rename from ossim/include/ossim/base/ossimOutputSource.h
rename to include/ossim/base/ossimOutputSource.h
diff --git a/ossim/include/ossim/base/ossimPackedBits.h b/include/ossim/base/ossimPackedBits.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPackedBits.h
rename to include/ossim/base/ossimPackedBits.h
diff --git a/include/ossim/base/ossimPointHash.h b/include/ossim/base/ossimPointHash.h
new file mode 100644
index 0000000..9ac9859
--- /dev/null
+++ b/include/ossim/base/ossimPointHash.h
@@ -0,0 +1,28 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description: Point Hash is a base for hashing functions
+//              
+//*******************************************************************
+//  $Id: ossimPointHash.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef ossimPointHash_HEADER
+#define ossimPointHash_HEADER
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimFpt.h>
+
+class OSSIMDLLEXPORT ossimPointHash
+{
+public:
+   virtual ~ossimPointHash(){}
+   virtual long operator ()(const ossimDpt &aPoint)=0;
+   virtual long operator ()(const ossimFpt &aPoint)=0;
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimPointObservation.h b/include/ossim/base/ossimPointObservation.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPointObservation.h
rename to include/ossim/base/ossimPointObservation.h
diff --git a/include/ossim/base/ossimPolyArea2d.h b/include/ossim/base/ossimPolyArea2d.h
new file mode 100644
index 0000000..6e6a6c8
--- /dev/null
+++ b/include/ossim/base/ossimPolyArea2d.h
@@ -0,0 +1,152 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//*******************************************************************
+//$Id: ossimPolyArea2d.h 23608 2015-10-28 13:51:35Z gpotts $
+
+#ifndef ossimPolyArea2d_HEADER
+#define ossimPolyArea2d_HEADER 1
+
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimReferenced.h>
+#include <vector>
+
+class ossimDrect;
+class ossimIrect;
+class OssimPolyArea2dPrivate;
+
+namespace geos
+{
+   namespace geom
+   {
+      class Geometry;
+   }
+}
+
+class OSSIM_DLL ossimPolyArea2d : public ossimReferenced
+{
+public:
+   friend class OssimPolyArea2dPrivate;
+   friend OSSIM_DLL std::ostream& operator <<(std::ostream& out, const ossimPolyArea2d& data);
+   
+   ossimPolyArea2d();
+   ossimPolyArea2d(const vector<ossimGpt>& polygon);
+   ossimPolyArea2d(const vector<ossimDpt>& polygon);
+   ossimPolyArea2d(const ossimPolygon& shell, const vector<ossimPolygon>& holes); 
+   
+   ossimPolyArea2d(const ossimDpt& p1,
+                   const ossimDpt& p2,
+                   const ossimDpt& p3,
+                   const ossimDpt& p4);
+   ossimPolyArea2d(const ossimPolyArea2d& rhs);
+   
+   ossimPolyArea2d(const ossimIrect& rect);
+   ossimPolyArea2d(const ossimDrect& rect);
+   ossimPolyArea2d(const ossimPolygon& polygon);
+   ~ossimPolyArea2d();
+   
+   void clear()
+   {
+      clearPolygons();
+   }
+   const ossimPolyArea2d& operator =(const ossimPolyArea2d& rhs);
+   const ossimPolyArea2d& operator =(const ossimPolygon& rhs);
+   const ossimPolyArea2d& operator =(const ossimIrect& rect);
+   const ossimPolyArea2d& operator =(const ossimDrect& rect);
+   const ossimPolyArea2d& operator =(const vector<ossimGpt>& polygon);
+   const ossimPolyArea2d& operator =(const vector<ossimDpt>& polygon);
+   const ossimPolyArea2d& operator &=(const ossimPolyArea2d& rhs);
+   ossimPolyArea2d operator &(const ossimPolyArea2d& rhs)const;
+   ossimPolyArea2d operator +(const ossimPolyArea2d& rhs)const;
+   const ossimPolyArea2d& operator +=(const ossimPolyArea2d& rhs);
+   ossimPolyArea2d operator -(const ossimPolyArea2d& rhs)const;
+   const ossimPolyArea2d& operator -=(const ossimPolyArea2d& rhs);
+   
+   bool intersects(const ossimPolyArea2d& rhs)const;
+   
+   void add(const ossimPolyArea2d& rhs);
+   bool getVisiblePolygons(vector<ossimPolygon>& polyList)const;
+   bool getPolygonHoles(vector<ossimPolygon>& polyList)const;
+   
+   /**
+    * @brief Gets all of the polygons stored with their holes embedded. This
+    * may be useful if an operation was performed on the original ossimPolyArea2d 
+    * that caused multiple polygons to be created internally.
+    *	 
+    * For example, if a rectangle is intersected with a U shape, the two top
+    * portions of the U would be their own separate polygon. It's also possible 
+    * for these polygons to contain their own holes. This function will return 
+    * the two top polygons as separate ossimPolyArea2d objects (with any of 
+    * their holes embedded inside them).
+    *
+    *  --------------------------------		 
+    * |                                |
+    * |                                |
+    * | ........           .........   |
+    * | .      .           .       .   |
+    *  -.------.-----------.-------.---
+    *   .      .           .       .
+    *   .      .............       .
+    *   .                          .
+    *   ............................
+    *   
+    * @param polylist an empty vector of ossimPolyArea2d that will be filled
+    * @return returns true if it successfully places polygons in the input vector
+    */
+   bool getCompletePolygons(vector<ossimPolyArea2d>& polyList)const;
+   
+   bool isEmpty()const;
+   bool isValid(bool displayValidationError = false)const;
+   bool isPointWithin(const ossimDpt& point)const;
+   bool isPointWithin(double x, double y)const;
+   void getBoundingRect(ossimDrect& rect);
+   
+   /**
+   * Returns the Well Known Text string
+   */
+   std::string toString()const;
+
+   /**
+    * @brief Buffers the ossimPolyArea2d shape and returns a copy. This method
+    * does not alter polygon.
+    *  
+    * @param distance is the distance to buffer the shape by. Positive values
+    * will expand the shape, and negative values will shrink the shape.
+    * @return A shape that is a buffered (expanded/contracted) version of this
+    * shape
+    */
+   ossimPolyArea2d getBufferedShape(double distance=FLT_EPSILON) const;
+   
+   ossimPolyArea2d& setToBufferedShape(double distance=FLT_EPSILON);
+
+   ossimPolyArea2d& toMultiPolygon();
+   bool saveState(ossimKeywordlist& kwl,
+                  const char* prefix=0)const;
+   bool loadState(const ossimKeywordlist& kwl,
+                  const char* prefix=0);
+   
+protected:
+   
+   void clearPolygons();
+   void recurseVisibleGeometries(ossimPolygon::Vector& polyList,
+                                 const geos::geom::Geometry* geom) const;
+   
+   void recurseHoles(ossimPolygon::Vector& polyList,
+                     const geos::geom::Geometry* geom) const;
+   
+   /**
+    * @brief Recurses over the Geometry object to load all complete polygons
+    * (a shell and any internal holes) into the ossimPolyArea2d.
+    */
+   void recurseCompleteGeometries(std::vector<ossimPolyArea2d>& polyList,
+                                  const geos::geom::Geometry* geom) const;
+   
+   OssimPolyArea2dPrivate* m_privateData;
+};
+
+#endif /* #ifndef ossimPolyArea2d_HEADER */
diff --git a/ossim/include/ossim/base/ossimPolyLine.h b/include/ossim/base/ossimPolyLine.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPolyLine.h
rename to include/ossim/base/ossimPolyLine.h
diff --git a/include/ossim/base/ossimPolygon.h b/include/ossim/base/ossimPolygon.h
new file mode 100644
index 0000000..c3feb59
--- /dev/null
+++ b/include/ossim/base/ossimPolygon.h
@@ -0,0 +1,249 @@
+//*****************************************************************************
+// FILE: ossimPolygon.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimPolygon.
+//   This class provides utilities associated with N-vertex, convex
+//   (i.e., only two intersections for any line passing through the polygon).
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimPolygon.h 22333 2013-07-26 15:55:36Z dlucas $
+
+#ifndef ossimPolygon_HEADER
+#define ossimPolygon_HEADER
+#include <iostream>
+#include <vector>
+using namespace std;
+
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <vector>
+class ossimLine;
+
+/******************************************************************************
+ *
+ * CLASS:  ossimPolygon
+ *
+ *****************************************************************************/
+class OSSIMDLLEXPORT ossimPolygon
+{
+public:
+  typedef std::vector<ossimPolygon> Vector;
+   ossimPolygon();
+   ossimPolygon(const vector<ossimIpt>& polygon);
+   ossimPolygon(const vector<ossimDpt>& polygon);
+   ossimPolygon(const vector<ossimGpt>& polygon);
+   ossimPolygon(int numVertices, const ossimDpt* vertex_array);
+
+   ossimPolygon(const ossimPolygon& copy_this);
+   
+   /**
+    * CONSTRUCTOR: Provided for convenience. Does not imply the polygon is
+    * limited to four vertices:
+    */
+   ossimPolygon(ossimDpt v1,
+                ossimDpt v2,
+                ossimDpt v3,
+                ossimDpt v4);
+   
+   ossimPolygon(const ossimIrect& rect);
+   ossimPolygon(const ossimDrect& rect);
+
+   ~ossimPolygon();
+
+   ossimDpt& operator[](int index);
+   
+   const ossimDpt& operator[](int index)const;
+
+   ossim_uint32 getVertexCount()const;
+   
+   ossim_uint32 getNumberOfVertices()const;
+
+   //! Returns polygon area. Negative indicates CW ordering of vertices (in right-handed coordinates)
+   double area()const;
+
+   void getIntegerBounds(ossim_int32& minX,
+                         ossim_int32& minY,
+                         ossim_int32& maxX,
+                         ossim_int32& maxY)const;
+   void getFloatBounds(ossim_float64& minX,
+                       ossim_float64& minY,
+                       ossim_float64& maxX,
+                       ossim_float64& maxY)const;
+
+   void getBoundingRect(ossimIrect& rect)const;
+   void getBoundingRect(ossimDrect& rect)const;
+
+   /**
+    * Initializes minRect with the minimum area rect (not-necessarily
+    * aligned with axes) that bounds this polygon.
+    *
+    * @param minRect Polygon to initialize with the minimum rect.
+    */
+   void getMinimumBoundingRect(ossimPolygon& minRect) const;
+   
+   void roundToIntegerBounds(bool compress=false);
+
+   void clear();
+
+   void addPoint(const ossimDpt& pt);
+   void addPoint(double x, double y);
+
+   ossimDpt midPoint()const;
+   
+   /**
+    * will sequence through the polygon and check to see if any values are NAN
+    */
+   bool hasNans()const;
+
+   const vector<ossimDpt>& getVertexList()const;
+      
+   /**
+    * Uses the ossimPolyArea2d class for the intersection
+    */
+   bool clipToRect(vector<ossimPolygon>& result,
+                   const ossimDrect& rect)const;
+
+   
+   /**
+    * METHOD: clipLineSegment(p1, p2)
+    * Implements Cyrus-Beck clipping algorithm as described in:
+    * http://www.daimi.au.dk/~mbl/cgcourse/wiki/cyrus-beck_line-clipping_.html
+    * Clips the line segment defined by thw two endpoints provided. The
+    * endpoints are modified as needed to represent the clipped line. Returnes
+    * true if intersection present.
+    */
+   bool clipLineSegment(ossimDpt& p1, ossimDpt& p2) const;
+
+   /**
+    * METHOD: pointWithin(ossimDpt)
+    * Returns TRUE if point is inside polygon.
+    */
+   bool pointWithin(const ossimDpt& point) const;
+
+   bool isPointWithin(const ossimDpt& point) const;
+
+   /**
+   * METHOD: isRectWithin()
+   * Returns true if all the corner points of the given rect fit within.
+   */
+   bool isRectWithin(const ossimIrect &rect) const;
+
+   /**
+   * METHOD: isPolyWithin()
+   * Returns true if all the vertices of the given polygon fit within.
+   */
+   bool isPolyWithin(const ossimPolygon &poly) const;
+
+   /**
+    * METHOD: vertex(index)
+    * Returns the ossimDpt vertex given the index. Returns false if no vertex
+    * defined.
+    */
+   bool vertex(int index, ossimDpt& tbd_vertex) const;
+
+   /**
+    * METHOD: nextVertex()
+    * Assigns the ossimDpt tbd_vertex following the current vertex. The current
+    * vertex is initialized with a call to vertex(int), or after the last
+    * vertex is reached. Returns false if no vertex defined. Intended to be
+    * when cycling through all vertices.
+    */
+   bool nextVertex(ossimDpt& tbd_vertex) const;
+
+   void reverseOrder();
+   /**
+    * OPERATORS: (Some are inlined at bottom) 
+    */
+   const ossimPolygon& operator= (const ossimPolygon& copy_this);
+   const ossimPolygon& operator= (const vector<ossimDpt>& vertexList);
+   const ossimPolygon& operator= (const vector<ossimGpt>& vertexList);
+   const ossimPolygon& operator= (const vector<ossimIpt>& vertexList);
+   const ossimPolygon& operator= (const ossimIrect& rect);
+   const ossimPolygon& operator= (const ossimDrect& rect);
+   bool                operator==(const ossimPolygon& compare_this) const;
+   bool                operator!=(const ossimPolygon& compare_this) const;
+
+   const ossimPolygon& operator *=(const ossimDpt& scale);
+   const ossimPolygon& operator *=(double scale);
+   
+   ossimPolygon operator *(const ossimDpt& scale)const;
+   ossimPolygon operator *(double scale)const;
+   
+   void resize(ossim_uint32 newSize);
+
+   /**
+    * METHOD: print()
+    */
+   void print(ostream& os) const;
+   friend ostream& operator<<(ostream&, const ossimPolygon&);
+
+
+   bool saveState(ossimKeywordlist& kwl,
+                  const char* prefix=0)const;
+   
+   bool loadState(const ossimKeywordlist& kwl,
+                  const char* prefix=0);
+
+   ossimVertexOrdering checkOrdering()const;
+
+   ossimVertexOrdering getOrdering()const;
+
+protected:
+   /**
+   * METHOD: getCentroid()
+   * Assigns the ossimDpt centroid the polygon.
+   * Warning: centroid is not guaranteed to be inside the polygon!
+    */
+   void getCentroid(ossimDpt &centroid) const;
+
+   /**
+   * METHOD: shrink()
+   * Shrinks the current polygon by inset, return true if success.
+    */
+   bool shrink(ossimPolygon &dest, double inset) const;
+   
+   /**
+   * METHOD: remove()
+   * Removes the vertex from the polygon.
+
+    */
+   void removeVertex(int vertex);
+   /**
+   * METHOD: removeSmallestContributingVertex()
+   * Removes the vertex that contributes the smallest area to the polygon.
+    */
+   void removeSmallestContributingVertex();
+
+   void intersectEdge(ossimDpt& result,
+                      const ossimLine& segment,
+                      const ossimDrect& rect,
+                      int edge);
+   
+   bool isInsideEdge(const ossimDpt& pt,
+                     const ossimDrect& rect,
+                     int edge)const;
+
+   /**
+   * Assigns destPt the point that fits a circle of given radius inside the polygon vertex.
+   * Warning: destPt is not guaranteed to be inside the polygon!
+   * (you may not be able to fit a circle of the given radius inside the polygon)
+   */
+   void fitCircleInsideVertex(ossimDpt &destPt, unsigned int vertex, double radius) const;
+
+   mutable ossimVertexOrdering theOrderingType;
+   vector<ossimDpt> theVertexList;
+   mutable ossim_int32 theCurrentVertex;
+};
+
+#endif /* End of "#ifndef ossimPolygon_HEADER" */
diff --git a/ossim/include/ossim/base/ossimPolynom.h b/include/ossim/base/ossimPolynom.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPolynom.h
rename to include/ossim/base/ossimPolynom.h
diff --git a/ossim/include/ossim/base/ossimPool.h b/include/ossim/base/ossimPool.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPool.h
rename to include/ossim/base/ossimPool.h
diff --git a/ossim/include/ossim/base/ossimPoolObject.h b/include/ossim/base/ossimPoolObject.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPoolObject.h
rename to include/ossim/base/ossimPoolObject.h
diff --git a/ossim/include/ossim/base/ossimPreferences.h b/include/ossim/base/ossimPreferences.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPreferences.h
rename to include/ossim/base/ossimPreferences.h
diff --git a/ossim/include/ossim/base/ossimProcessInterface.h b/include/ossim/base/ossimProcessInterface.h
similarity index 100%
rename from ossim/include/ossim/base/ossimProcessInterface.h
rename to include/ossim/base/ossimProcessInterface.h
diff --git a/include/ossim/base/ossimProcessListener.h b/include/ossim/base/ossimProcessListener.h
new file mode 100644
index 0000000..c32504c
--- /dev/null
+++ b/include/ossim/base/ossimProcessListener.h
@@ -0,0 +1,29 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// $Id: ossimProcessListener.h 14799 2009-06-30 08:54:44Z dburken $
+//----------------------------------------------------------------------------
+#ifndef ossimProcessListener_HEADER
+#define ossimProcessListener_HEADER
+#include <ossim/base/ossimListener.h>
+
+class ossimProcessProgressEvent;
+
+class OSSIMDLLEXPORT ossimProcessListener : public ossimListener
+{
+public:
+   ossimProcessListener();
+   virtual ~ossimProcessListener();
+   virtual void processEvent(ossimEvent& event);
+   virtual void processProgressEvent(ossimProcessProgressEvent& event);
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/base/ossimProcessProgressEvent.h b/include/ossim/base/ossimProcessProgressEvent.h
new file mode 100644
index 0000000..4483f27
--- /dev/null
+++ b/include/ossim/base/ossimProcessProgressEvent.h
@@ -0,0 +1,51 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description: Event for process progress.
+//
+// $Id: ossimProcessProgressEvent.h 9094 2006-06-13 19:12:40Z dburken $
+//----------------------------------------------------------------------------
+#ifndef ossimProcessProgressEvent_HEADER
+#define ossimProcessProgressEvent_HEADER
+
+#include <ossim/base/ossimEvent.h>
+#include <ossim/base/ossimString.h>
+
+class OSSIMDLLEXPORT ossimProcessProgressEvent : public ossimEvent
+{
+public:
+   ossimProcessProgressEvent(ossimObject* owner=NULL,
+                             double percentComplete=0.0,
+                             const ossimString message="",
+                             bool outputMessageFlag=false);
+
+   virtual ossimObject* dup()const;
+   
+   double getPercentComplete()const;
+   
+   ossimString getMessage()const;
+
+   void getMessage(ossimString& message)const;
+   
+   void setPercentComplete(double percentComplete);
+   
+   void setMessage(const ossimString& message);
+
+   void setOutputMessageFlag(bool flag);
+
+   bool getOutputMessageFlag() const;
+      
+protected:
+   double      thePercentComplete;
+   ossimString theMessage;
+   bool        theOutputMessageFlag;
+
+TYPE_DATA
+};
+#endif
diff --git a/ossim/include/ossim/base/ossimProperty.h b/include/ossim/base/ossimProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimProperty.h
rename to include/ossim/base/ossimProperty.h
diff --git a/ossim/include/ossim/base/ossimPropertyEvent.h b/include/ossim/base/ossimPropertyEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPropertyEvent.h
rename to include/ossim/base/ossimPropertyEvent.h
diff --git a/include/ossim/base/ossimPropertyInterface.h b/include/ossim/base/ossimPropertyInterface.h
new file mode 100644
index 0000000..97b1234
--- /dev/null
+++ b/include/ossim/base/ossimPropertyInterface.h
@@ -0,0 +1,41 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: LGPL see top level license.txt
+//
+// Author: Garrett Potts (gpotts at imagelinks)
+//
+//*************************************************************************
+// $Id: ossimPropertyInterface.h 12989 2008-06-04 17:05:41Z gpotts $
+#ifndef ossimPropertyInterface_HEADER
+#define ossimPropertyInterface_HEADER
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimProperty.h>
+
+
+class OSSIM_DLL ossimPropertyInterface
+{
+public:
+   ossimPropertyInterface()
+      {}
+   
+   virtual ~ossimPropertyInterface()
+      {}
+
+   virtual void setProperty(const ossimString& name,
+                            const ossimString& value);
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const; 
+	virtual ossimString getPropertyValueAsString(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   void getPropertyList(std::vector<ossimRefPtr<ossimProperty> >& propertyList)const;
+   void setProperties(std::vector<ossimRefPtr<ossimProperty> >& propertyList);
+   
+protected:
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimPropertyInterfaceFactory.h b/include/ossim/base/ossimPropertyInterfaceFactory.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPropertyInterfaceFactory.h
rename to include/ossim/base/ossimPropertyInterfaceFactory.h
diff --git a/ossim/include/ossim/base/ossimPropertyInterfaceRegistry.h b/include/ossim/base/ossimPropertyInterfaceRegistry.h
similarity index 100%
rename from ossim/include/ossim/base/ossimPropertyInterfaceRegistry.h
rename to include/ossim/base/ossimPropertyInterfaceRegistry.h
diff --git a/ossim/include/ossim/base/ossimProtocolStream.h b/include/ossim/base/ossimProtocolStream.h
similarity index 100%
rename from ossim/include/ossim/base/ossimProtocolStream.h
rename to include/ossim/base/ossimProtocolStream.h
diff --git a/ossim/include/ossim/base/ossimQuadTreeWarp.h b/include/ossim/base/ossimQuadTreeWarp.h
similarity index 100%
rename from ossim/include/ossim/base/ossimQuadTreeWarp.h
rename to include/ossim/base/ossimQuadTreeWarp.h
diff --git a/ossim/include/ossim/base/ossimQuadrilateralMap.h b/include/ossim/base/ossimQuadrilateralMap.h
similarity index 100%
rename from ossim/include/ossim/base/ossimQuadrilateralMap.h
rename to include/ossim/base/ossimQuadrilateralMap.h
diff --git a/ossim/include/ossim/base/ossimQuaternion.h b/include/ossim/base/ossimQuaternion.h
similarity index 100%
rename from ossim/include/ossim/base/ossimQuaternion.h
rename to include/ossim/base/ossimQuaternion.h
diff --git a/ossim/include/ossim/base/ossimROIEvent.h b/include/ossim/base/ossimROIEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimROIEvent.h
rename to include/ossim/base/ossimROIEvent.h
diff --git a/ossim/include/ossim/base/ossimROIEventListener.h b/include/ossim/base/ossimROIEventListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimROIEventListener.h
rename to include/ossim/base/ossimROIEventListener.h
diff --git a/ossim/include/ossim/base/ossimRationalNumber.h b/include/ossim/base/ossimRationalNumber.h
similarity index 100%
rename from ossim/include/ossim/base/ossimRationalNumber.h
rename to include/ossim/base/ossimRationalNumber.h
diff --git a/include/ossim/base/ossimRectanglePartitioner.h b/include/ossim/base/ossimRectanglePartitioner.h
new file mode 100644
index 0000000..321befc
--- /dev/null
+++ b/include/ossim/base/ossimRectanglePartitioner.h
@@ -0,0 +1,147 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2004 David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// Utility class to partition up a rectangle.
+//
+// $Id: ossimRectanglePartitioner.h 9094 2006-06-13 19:12:40Z dburken $
+//----------------------------------------------------------------------------
+#ifndef ossimRectanglePartitioner_HEADER
+#define ossimRectanglePartitioner_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <vector>
+
+class ossimIrect;
+
+/**
+ * class ossimRectanglePartitioner
+ * Utility class to partition up a rectangle.
+ */
+class OSSIMDLLEXPORT ossimRectanglePartitioner
+{
+public:
+
+   /** default construtor */
+   ossimRectanglePartitioner();
+
+   /** destructor */
+   ~ossimRectanglePartitioner();
+
+   /**
+    * Partitions the rectangle doing a binary split on the longest dimension
+    * until the total size is less than or equal to the "maxSizeInBytes".
+    * Initializes "result" with the resulting rectangles starting at the
+    * upper left corner.
+    *
+    * @param inputRectangle The source rectangle usually the bounding rectangle
+    * of a scene.
+    *
+    * @param result The vector of ossimIrects to hold the result.
+    *
+    * @param maxSizeInBytes Maximum size of the resulting rectangle partitions
+    * in bytes.
+    *
+    * @param bands The number of bands in the image.
+    *
+    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
+    *
+    * @param internalOverlapPixels Overlap in pixels for desired partitions.
+    * (default = 0) This is added to all four sides of the rectangle so 
+    *
+    * @note The result rectangle passed in will be cleared for starters.
+    *
+    * @note Edge rectangles will be clipped to the inputRectangle.
+    */
+   void binaryPartition(const ossimIrect& inputRectangle,
+                        std::vector<ossimIrect>& result,
+                        ossim_uint64 maxSizeInBytes,
+                        ossim_uint32 bands,
+                        ossim_uint32 bytesPerPixel,
+                        ossim_uint32 internalOverlapPixels = 0) const;
+
+private:
+
+   /**
+    * Recursively splits the input rectangle until the size is less than
+    * or equal to maxSizeInBytes.
+    * 
+    * @param rect Input rectangle to split.
+    *
+    * @param maxSizeInBytes Maximum size of the resulting rectangle partitions
+    * in bytes.
+    *
+    * @param bands The number of bands in the image.
+    *
+    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
+    *
+    * @param internalOverlapPixels Overlap in pixels for desired partitions.
+    * (default = 0)
+    *
+    * @note Will split the longest dimension.  If square will split in the
+    * lengthwise direction.
+    */
+   void splitUntilLessThanMax(ossimIrect& rect,
+                              ossim_uint64 maxSizeInBytes,
+                              ossim_uint32 bands,
+                              ossim_uint32 bytesPerPixel,
+                              ossim_uint32 internalOverlapPixels = 0) const;
+
+   /**
+    * Splits rectangle in half rounding up if needed.
+    *
+    * @param input Rectangle to split.
+    *
+    * @note output will be a zero base rect.
+    *
+    * @notes Will split the longest dimension.  If square will split in the
+    * lengthwise direction.
+    */
+   void splitRect(ossimIrect& rect) const;
+
+   /**
+    * @param rect Rectangle to give size for in bytes.
+    *
+    * @param bands The number of bands in the image.
+    *
+    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
+    *
+    * @param internalOverlapPixels Overlap in pixels.
+    * (default = 0)
+    * 
+    * @return size of rectangle in bytes.
+    */
+   ossim_uint64 getSize(const ossimIrect& rect,
+                        ossim_uint32 bands,
+                        ossim_uint32 bytesPerPixel,
+                        ossim_uint32 internalOverlapPixels = 0) const;
+
+   /**
+    * Convenience trace method.
+    *
+    * @param r Input rectangle.
+    *
+    * @param v Vector of resulting partitioned rectangles.
+    *
+    * @param maxSizeInBytes Maximum size of the resulting rectangle partitions
+    * in bytes.
+    *
+    * @param bands The number of bands in the image.
+    *
+    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
+    */
+   void trace(const ossimIrect& r,
+              const std::vector<ossimIrect>& v,
+              ossim_uint64 maxSizeInBytes,
+              ossim_uint32 bands,
+              ossim_uint32 bytesPerPixel) const;
+   
+};
+
+#endif /* End of "#ifndef ossimRectanglePartitioner_HEADER" */
diff --git a/include/ossim/base/ossimRectilinearDataObject.h b/include/ossim/base/ossimRectilinearDataObject.h
new file mode 100644
index 0000000..ad4ff66
--- /dev/null
+++ b/include/ossim/base/ossimRectilinearDataObject.h
@@ -0,0 +1,155 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRectilinearDataObject.h 22828 2014-07-11 15:56:19Z dburken $
+#ifndef ossimRectilinearDataObject_HEADER
+#define ossimRectilinearDataObject_HEADER
+#include <ossim/base/ossimDataObject.h>
+
+class OSSIMDLLEXPORT ossimRectilinearDataObject : public ossimDataObject
+{
+public:
+
+   /** default constructor */
+   ossimRectilinearDataObject();
+
+   ossimRectilinearDataObject(const ossimRectilinearDataObject&rhs);
+      
+   ossimRectilinearDataObject(ossim_uint32 numberOfSpatialComponents,
+                              ossimSource* owner,
+                              ossim_uint32 numberOfDataComponents,
+                              ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN,
+                              ossimDataObjectStatus status=OSSIM_NULL);
+   
+   /**
+    * This is a helper constructor that allows one to instantiate a one
+    * dimensional Spatial component with N number of data components.
+    * It will internally allocate theSpatialExtent to 1 and set the
+    * contents equal to the value passed in to length.
+    */
+   ossimRectilinearDataObject(ossimSource* owner,
+                              ossim_uint32 numberOfDataComponents,
+                              ossim_uint32 length,
+                              ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN,
+                              ossimDataObjectStatus status=OSSIM_NULL);
+
+   /**
+    * This is a helper constructor that allows one to instantiate a two
+    * dimensional Spatial component (WidthxHeight) with N number of
+    * data components.  It will internally allocate theSpatialExtent
+    * to 2 and set the contents equal to the value passed in to width, and
+    * height.
+    */
+   ossimRectilinearDataObject(ossimSource* owner,
+                              ossim_uint32 numberOfDataComponents,
+                              ossim_uint32 width,
+                              ossim_uint32 height,
+                              ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN,
+                              ossimDataObjectStatus status=OSSIM_NULL);
+
+   /**
+    * This is a helper constructor that allows one to instantiate a two
+    * dimensional Spatial component (WidthxHeightxDepth) with N number of
+    * data components.  It will internally allocate theSpatialExtent
+    * to 3 and set the contents equal to the value passed in to width,
+    * height, and depth.
+    */
+   ossimRectilinearDataObject(ossimSource* owner,
+                              ossim_uint32 numberOfDataComponents,
+                              ossim_uint32 width,
+                              ossim_uint32 height,
+                              ossim_uint32 depth,
+                              ossimScalarType   scalarType=OSSIM_SCALAR_UNKNOWN,
+                              ossimDataObjectStatus status=OSSIM_NULL);
+   
+
+   virtual ~ossimRectilinearDataObject();
+   /**
+    * How many components make up this data object.  For
+    * example:  If this were an RGB image data object then
+    * the number of components would be set to 3 and the
+    * RGB would be seen as a single data object being
+    * passed through.
+    */
+   virtual void setNumberOfDataComponents(ossim_uint32 n);
+   
+   virtual void setSpatialExtents(ossim_uint32* extents, ossim_uint32  size);
+
+   /**
+    *  See ossimScalarType in ossimConstants for a full list
+    *
+    *  OSSIM_SCALAR_UNKNOWN
+    *  OSSIM_UCHAR          Unsigned char
+    *  OSSIM_USHORT16       16bit unsigned short
+    *  OSSIM_SSHORT16       16bit signed short
+    *  OSSIM_USHORT11       11bit unsigned short
+    *  OSSIM_FLOAT          float
+    *  OSSIM_NORMALIZED_DOUBLE normalized 0 to 1 data
+    */
+   virtual void setScalarType(ossimScalarType type);
+
+   virtual ossim_uint32 getNumberOfDataComponents() const;
+
+   virtual ossim_uint32 getNumberOfSpatialComponents() const;
+
+   virtual const ossim_uint32* getSpatialExtents() const;
+
+   virtual ossimScalarType getScalarType() const;
+
+   virtual ossim_uint32 getScalarSizeInBytes()const;
+
+   virtual void*   getBuf();
+
+   virtual const void* getBuf() const;
+
+   virtual void assign(const ossimRectilinearDataObject* data);
+
+   /**
+    *  Initializes m_dataBuffer to current spatial extents.
+    *  
+    *  @notes
+    *
+    *  1) The underlying std::vector::resize() call with only be performed if
+    *  m_dataBuffer.size() is not equal to getDataSizeInBytes().
+    *
+    *  2) The status will be set to OSSIM_STATUS_UNKNOWN if a resize was
+    *  performed.
+    *
+    *  3) On error: catches std::bad_alloc exception and rethrows as
+    *  ossimException.
+    */
+   virtual void initialize();
+
+   virtual ossim_uint32 computeSpatialProduct()const;
+
+   virtual ossim_uint32 getDataSizeInBytes()const;
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief assignment operator=
+    * @param rhs The data to assign from.
+    * @param A reference to this object.
+    */
+   virtual const ossimRectilinearDataObject& operator=(
+      const ossimRectilinearDataObject& rhs);
+
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+protected:
+   ossim_uint32              m_numberOfDataComponents;
+   ossimScalarType           m_scalarType;
+   std::vector<ossim_uint8>  m_dataBuffer;
+   std::vector<ossim_uint32> m_spatialExtents;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/base/ossimRefPtr.h b/include/ossim/base/ossimRefPtr.h
new file mode 100644
index 0000000..38b2c9d
--- /dev/null
+++ b/include/ossim/base/ossimRefPtr.h
@@ -0,0 +1,93 @@
+/* -*-c++-*- ossim - Copyright (C) since 2004 Garrett Potts 
+ *
+ * This was taken directly from OpenSceneGraph and will retain OSGGPL license.
+ * This is basically an LGPL.
+ * 
+*/
+#ifndef ossimRefPtr_HEADER
+#define ossimRefPtr_HEADER
+#include <ossim/base/ossimConstants.h>
+
+template<class T> class ossimRefPtr
+{
+ public:
+   typedef T element_type;
+   
+   ossimRefPtr() :m_ptr(0) {}
+   ossimRefPtr(T* t):m_ptr(t)              { if (m_ptr) m_ptr->ref(); }
+   ossimRefPtr(const ossimRefPtr& rp):m_ptr(rp.m_ptr)  { if (m_ptr) m_ptr->ref(); }
+   ~ossimRefPtr()                           { if (m_ptr) m_ptr->unref(); m_ptr=0; }
+   
+   inline ossimRefPtr& operator = (const ossimRefPtr& rp)
+      {
+         if (m_ptr==rp.m_ptr)
+            return *this;
+         T* tmpPtr = m_ptr;
+         m_ptr = rp.m_ptr;
+         if (m_ptr)
+            m_ptr->ref();
+         // unref second to prevent any deletion of any object which might
+         // be referenced by the other object. i.e rp is child of the
+         // original _ptr.
+         if (tmpPtr)
+            tmpPtr->unref();
+         return *this;
+      }
+   
+   inline ossimRefPtr& operator = (T* ptr)
+      {
+         if (m_ptr==ptr)
+            return *this;
+         T* tmpPtr = m_ptr;
+         m_ptr = ptr;
+         if (m_ptr)
+            m_ptr->ref();
+         // unref second to prevent any deletion of any object which might
+         // be referenced by the other object. i.e rp is child of the
+         // original m_ptr.
+         if (tmpPtr)
+            tmpPtr->unref();
+         return *this;
+      }
+   
+   // comparison operators for ossimRefPtr.
+   inline bool operator == (const ossimRefPtr& rp) const { return (m_ptr==rp.m_ptr); }
+   inline bool operator != (const ossimRefPtr& rp) const { return (m_ptr!=rp.m_ptr); }
+   inline bool operator < (const ossimRefPtr& rp) const { return (m_ptr<rp.m_ptr); }
+   inline bool operator > (const ossimRefPtr& rp) const { return (m_ptr>rp.m_ptr); }
+   
+   // comparion operator for const T*.
+   inline bool operator == (const T* ptr) const { return (m_ptr==ptr); }
+   inline bool operator != (const T* ptr) const { return (m_ptr!=ptr); }
+   inline bool operator < (const T* ptr) const { return (m_ptr<ptr); }
+   inline bool operator > (const T* ptr) const { return (m_ptr>ptr); }
+   
+   inline T& operator*()  { return *m_ptr; }
+   
+   inline const T& operator*() const { return *m_ptr; }
+   
+   inline T* operator->() { return m_ptr; }
+   
+   inline const T* operator->() const   { return m_ptr; }
+   
+   inline bool operator!() const	{ return m_ptr==0L; }
+   
+   inline bool valid() const	{ return m_ptr!=0L; }
+   
+   inline T* get() { return m_ptr; }
+   
+   inline const T* get() const { return m_ptr; }
+   
+   /** take control over the object pointed to by ref_ptr, unreference but do not delete even if ref count goes to 0,
+    * return the pointer to the object.
+    * Note, do not use this unless you are 100% sure your code handles the deletion of the object correctly, and
+    * only use when absolutely required.*/
+   inline T* take() { return release();}
+   
+   inline T* release() { T* tmp=m_ptr; if (m_ptr) m_ptr->unref_nodelete(); m_ptr=0; return tmp;}
+   
+ private:
+   T* m_ptr;
+};
+
+#endif
diff --git a/include/ossim/base/ossimReferenced.h b/include/ossim/base/ossimReferenced.h
new file mode 100644
index 0000000..db20a80
--- /dev/null
+++ b/include/ossim/base/ossimReferenced.h
@@ -0,0 +1,107 @@
+/* -*-c++-*- libossim - Copyright (C) since 2004 Garrett Potts 
+ * LICENSE: LGPL
+ * Author: Garrett Potts
+*/
+#ifndef ossimReferenced_HEADER
+#define ossimReferenced_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <OpenThreads/ScopedLock>
+#include <OpenThreads/Mutex>
+
+class OSSIMDLLEXPORT ossimReferenced
+{
+ public:
+   ossimReferenced()
+   : theRefMutex(new OpenThreads::Mutex),
+     theRefCount(0)
+      {}
+   
+   ossimReferenced(const ossimReferenced&)
+   : theRefMutex(new OpenThreads::Mutex),
+   theRefCount(0)
+   {}
+   inline ossimReferenced& operator = (const ossimReferenced&) { return *this; }
+   
+
+   /*! increment the reference count by one, indicating that 
+       this object has another pointer which is referencing it.*/
+   inline void ref() const;
+   
+   /*! decrement the reference count by one, indicating that 
+       a pointer to this object is referencing it.  If the
+       reference count goes to zero, it is assumed that this object
+       is no longer referenced and is automatically deleted.*/
+   inline void unref() const;
+   
+   /*! decrement the reference count by one, indicating that 
+       a pointer to this object is referencing it.  However, do
+       not delete it, even if ref count goes to 0.  Warning, unref_nodelete() 
+       should only be called if the user knows exactly who will
+       be resonsible for, one should prefer unref() over unref_nodelete() 
+       as the later can lead to memory leaks.*/
+   inline void unref_nodelete() const 
+   { 
+      if (theRefMutex)
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*theRefMutex); 
+         --theRefCount;
+      }
+      else
+      {
+         --theRefCount;
+      }
+   }
+   
+   /*! return the number pointers currently referencing this object. */
+   inline int referenceCount() const { return theRefCount; }
+   
+   
+ protected:
+   virtual ~ossimReferenced();
+   mutable OpenThreads::Mutex*     theRefMutex;
+   mutable int theRefCount;
+};
+
+inline void ossimReferenced::ref() const
+{
+   if (theRefMutex)
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*theRefMutex); 
+      ++theRefCount;
+   }
+   else
+   {
+      ++theRefCount;
+   }
+}
+
+inline void ossimReferenced::unref() const
+{
+   bool needDelete = false;
+   if (theRefMutex)
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*theRefMutex); 
+      --theRefCount;
+      needDelete = theRefCount<=0;
+   }
+   else
+   {
+      --theRefCount;
+      needDelete = theRefCount<=0;
+   }
+   
+   if (needDelete)
+   {
+      delete this;
+   }
+   
+#if 0
+    --theRefCount;
+    if (theRefCount==0)
+    {
+        delete this;
+    }
+#endif
+}
+
+#endif
diff --git a/ossim/include/ossim/base/ossimRefreshEvent.h b/include/ossim/base/ossimRefreshEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimRefreshEvent.h
rename to include/ossim/base/ossimRefreshEvent.h
diff --git a/include/ossim/base/ossimRegExp.h b/include/ossim/base/ossimRegExp.h
new file mode 100644
index 0000000..d50745a
--- /dev/null
+++ b/include/ossim/base/ossimRegExp.h
@@ -0,0 +1,264 @@
+//
+// Copyright (C) 1991 Texas Instruments Incorporated.
+//
+// Permission is granted to any individual or institution to use, copy, modify,
+// and distribute this software, provided that this complete copyright and
+// permission notice is maintained, intact, in all copies and supporting
+// documentation.
+//
+// Texas Instruments Incorporated provides this software "as is" without
+// express or implied warranty.
+//
+// .NAME CoolRegExp - Pattern matching with regular expressions.
+// .LIBRARY cool
+// .HEADER String Classes
+// .INCLUDE cool/RegExp.h
+// .FILE cool/RegExp.C
+// .FILE cool/RegExp.h
+// .EXAMPLE examples/ex_RegExp.C
+//
+//
+// .SECTION Description
+//  A regular expression allows a programmer to specify  complex
+//  patterns  that  can  be searched for and matched against the
+//  character string of a string object. In its simplest form, a
+//  regular  expression  is  a  sequence  of  characters used to
+//  search for exact character matches. However, many times  the
+//  exact  sequence to be found is not known, or only a match at
+//  the beginning or end of a string is desired. The cool  regu-
+//  lar  expression  class implements regular expression pattern
+//  matching as is found and implemented in many  UNIX  commands
+//  and utilities.
+//
+//  The regular expression class provides a convenient mechanism
+//  for  specifying  and  manipulating  regular expressions. The
+//  regular expression object allows specification of such  pat-
+//  terns  by using the following regular expression metacharac-
+//  ters:
+// 
+//   ^        Matches at beginning of a line
+//
+//   $        Matches at end of a line
+//
+//  .         Matches any single character
+//
+//  [ ]       Matches any character(s) inside the brackets
+//
+//  [^ ]      Matches any character(s) not inside the brackets
+//
+//   -        Matches any character in range on either side of a dash
+//
+//   *        Matches preceding pattern zero or more times
+//
+//   +        Matches preceding pattern one or more times
+//
+//   ?        Matches preceding pattern zero or once only
+//
+//  ()        Saves a matched expression and uses it in a  later match
+// 
+//  Note that more than one of these metacharacters can be  used
+//  in  a  single  regular expression in order to create complex
+//  search patterns. For example, the pattern [^ab1-9]  says  to
+//  match  any  character  sequence that does not begin with the
+//  characters "ab"  followed  by  numbers  in  the  series  one
+//  through nine.
+ 
+
+#ifndef ossimRegExph
+#define ossimRegExph
+
+#include <ossim/base/ossimString.h>
+
+const int NSUBEXP = 10;
+
+
+class OSSIMDLLEXPORT ossimRegExp {
+public:
+  inline ossimRegExp ();			// ossimRegExp with program=NULL
+  inline ossimRegExp (const char*);	// ossimRegExp with compiled char*
+  ossimRegExp (const ossimRegExp&);	// Copy constructor
+  inline ~ossimRegExp();			// Destructor 
+
+  void compile (const char*);		// Compiles char* --> regexp
+  bool find (const char*);		// true if regexp in char* arg
+  inline ossim_uint32 start() const;	// Index to start of first find
+  inline ossim_uint32 end() const;	// Index to end of first find
+
+  bool operator== (const ossimRegExp&) const;	// Equality operator
+  inline bool operator!= (const ossimRegExp&) const; // Inequality operator
+  bool deep_equal (const ossimRegExp&) const;	// Same regexp and state?
+  
+  inline bool is_valid() const;		// true if compiled regexp
+  inline void set_invalid();		// Invalidates regexp
+
+  // awf added
+  ossim_uint32 start(ossim_uint32 n) const;
+  ossim_uint32 end(ossim_uint32 n) const;
+  std::string match(ossim_uint32 n) const;
+  
+private: 
+  const char* startp[NSUBEXP];
+  const char* endp[NSUBEXP];
+  char  regstart;			// Internal use only
+  char  reganch;			// Internal use only
+  const char* regmust;			// Internal use only
+  ossim_uint32 regmlen;			// Internal use only
+  char* program;   
+  ossim_uint32 progsize;
+  const char* searchstring;
+
+ // work variables
+  mutable const char* regparse;
+  mutable int   regnpar;	// () count.
+  mutable char  regdummy;
+  mutable char* regcode;	// Code-emit pointer; &regdummy = don't.
+  mutable long  regsize;	// Code size.
+  const char*  reginput;	// String-input pointer.
+  const char*  regbol;	// Beginning of input, for ^ check.
+  const char* *regstartp;	// Pointer to startp array.
+  const char* *regendp;	// Ditto for endp.
+
+  char* reg (int, int*);
+  char* regbranch (int*);
+  char* regpiece (int*);
+  char* regatom (int*);
+  char* regnode (char);
+  const char* regnext (const char*);
+  char* regnext (char*);
+  void        regc (unsigned char);
+  void        reginsert (char, char*);
+  void        regtail (char*, const char*);
+  void        regoptail (char*, const char*);
+  int regtry (const char*, const char* *,
+              const char* *, const char*);
+  int regmatch (const char*);
+  int regrepeat (const char*);
+#ifdef STRCSPN
+  int strcspn ();
+#endif
+  
+}; 
+
+// ossimRegExp -- Creates an empty regular expression.
+
+inline ossimRegExp::ossimRegExp ():
+  regstart(0),     // Internal use only
+  reganch(0),      // Internal use only
+  regmust(0),      // Internal use only
+  regmlen(0),     // Internal use only
+  program(0),   
+  progsize(0),
+  searchstring(0),
+
+ // work variables
+  regparse(0),
+  regnpar(0),  // () count.
+  regdummy(0),
+  regcode(0),  // Code-emit pointer; &regdummy = don't.
+  regsize(0),  // Code size.
+  reginput(0),  // String-input pointer.
+  regbol(0),  // Beginning of input, for ^ check.
+  regstartp(0), // Pointer to startp array.
+  regendp(0) // Ditto for endp.
+{ 
+}
+
+
+// ossimRegExp -- Creates a regular expression from string s, and
+// compiles s.
+
+
+inline ossimRegExp::ossimRegExp (const char* s) :
+  regstart(0),     // Internal use only
+  reganch(0),      // Internal use only
+  regmust(0),      // Internal use only
+  regmlen(0),     // Internal use only
+  program(0),   
+  progsize(0),
+  searchstring(0),
+
+ // work variables
+  regparse(0),
+  regnpar(0),  // () count.
+  regdummy(0),
+  regcode(0),  // Code-emit pointer; &regdummy = don't.
+  regsize(0),  // Code size.
+  reginput(0),  // String-input pointer.
+  regbol(0),  // Beginning of input, for ^ check.
+  regstartp(0), // Pointer to startp array.
+  regendp(0) // Ditto for endp.
+{  
+  this->program = NULL;
+  compile(s);
+}
+
+// ~ossimRegExp -- Frees space allocated for regular expression.
+
+inline ossimRegExp::~ossimRegExp () {
+//#ifndef WIN32
+   if(program)
+   {
+      delete [] this->program;
+      this->program = 0;
+   }
+//#endif
+}
+
+// Start -- 
+
+inline ossim_uint32 ossimRegExp::start () const {
+  return(this->startp[0] - searchstring);
+}
+
+
+// End -- Returns the start/end index of the last item found.
+
+
+inline ossim_uint32 ossimRegExp::end () const {
+  return(this->endp[0] - searchstring);
+}
+
+
+// operator!= //
+
+inline bool ossimRegExp::operator!= (const ossimRegExp& r) const {
+  return(!(*this == r));
+}
+
+
+// is_valid -- Returns true if a valid regular expression is compiled
+// and ready for pattern matching.
+
+inline bool ossimRegExp::is_valid () const {
+  return (this->program != NULL);
+}
+
+
+// set_invalid -- Invalidates regular expression.
+
+inline void ossimRegExp::set_invalid () {
+//#ifndef WIN32
+  delete [] this->program;
+//#endif
+  this->program = NULL;
+}
+
+// -- Return start index of nth submatch. start(0) is the start of the full match.
+inline ossim_uint32 ossimRegExp::start(ossim_uint32 n) const
+{
+  return this->startp[n] - searchstring;
+}
+
+// -- Return end index of nth submatch. end(0) is the end of the full match.
+inline ossim_uint32 ossimRegExp::end(ossim_uint32 n) const
+{
+  return this->endp[n] - searchstring;
+}
+
+// -- Return nth submatch as a string.
+inline std::string ossimRegExp::match(ossim_uint32 n) const
+{
+	return std::string(this->startp[n], this->endp[n] - this->startp[n]);
+}
+
+#endif // CoolRegExph
diff --git a/ossim/include/ossim/base/ossimRgbLutDataObject.h b/include/ossim/base/ossimRgbLutDataObject.h
similarity index 100%
rename from ossim/include/ossim/base/ossimRgbLutDataObject.h
rename to include/ossim/base/ossimRgbLutDataObject.h
diff --git a/ossim/include/ossim/base/ossimRgbVector.h b/include/ossim/base/ossimRgbVector.h
similarity index 100%
rename from ossim/include/ossim/base/ossimRgbVector.h
rename to include/ossim/base/ossimRgbVector.h
diff --git a/ossim/include/ossim/base/ossimRtti.h b/include/ossim/base/ossimRtti.h
similarity index 100%
rename from ossim/include/ossim/base/ossimRtti.h
rename to include/ossim/base/ossimRtti.h
diff --git a/ossim/include/ossim/base/ossimScalarTypeLut.h b/include/ossim/base/ossimScalarTypeLut.h
similarity index 100%
rename from ossim/include/ossim/base/ossimScalarTypeLut.h
rename to include/ossim/base/ossimScalarTypeLut.h
diff --git a/ossim/include/ossim/base/ossimSevenParamDatum.h b/include/ossim/base/ossimSevenParamDatum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimSevenParamDatum.h
rename to include/ossim/base/ossimSevenParamDatum.h
diff --git a/ossim/include/ossim/base/ossimSource.h b/include/ossim/base/ossimSource.h
similarity index 100%
rename from ossim/include/ossim/base/ossimSource.h
rename to include/ossim/base/ossimSource.h
diff --git a/ossim/include/ossim/base/ossimStateChangedEvent.h b/include/ossim/base/ossimStateChangedEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimStateChangedEvent.h
rename to include/ossim/base/ossimStateChangedEvent.h
diff --git a/include/ossim/base/ossimStdOutProgress.h b/include/ossim/base/ossimStdOutProgress.h
new file mode 100644
index 0000000..950350c
--- /dev/null
+++ b/include/ossim/base/ossimStdOutProgress.h
@@ -0,0 +1,36 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimStdOutProgress.h 10422 2007-02-06 04:03:13Z gpotts $
+#ifndef ossimStdOutProgress_HEADER
+#define ossimStdOutProgress_HEADER
+
+#include <ossim/base/ossimProcessListener.h>
+#include <ossim/base/ossimProcessProgressEvent.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+class OSSIM_DLL ossimStdOutProgress : public ossimProcessListener
+{
+public:
+   ossimStdOutProgress(ossim_uint32 precision = 0, bool flushStream=false);
+
+   virtual void processProgressEvent(ossimProcessProgressEvent& event);
+      
+   virtual void setFlushStreamFlag(bool flag);
+
+protected:
+   ossim_uint32 thePrecision;
+   bool         theFlushStreamFlag;
+   bool         theRunningInConsoleFlag;
+TYPE_DATA
+};
+
+OSSIM_DLL extern ossimStdOutProgress theStdOutProgress;
+#endif
diff --git a/ossim/include/ossim/base/ossimStreamBase.h b/include/ossim/base/ossimStreamBase.h
similarity index 100%
rename from ossim/include/ossim/base/ossimStreamBase.h
rename to include/ossim/base/ossimStreamBase.h
diff --git a/include/ossim/base/ossimStreamFactory.h b/include/ossim/base/ossimStreamFactory.h
new file mode 100644
index 0000000..e59943c
--- /dev/null
+++ b/include/ossim/base/ossimStreamFactory.h
@@ -0,0 +1,91 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//
+//*******************************************************************
+// $Id$
+
+#ifndef ossimStreamFactory_HEADER
+#define ossimStreamFactory_HEADER 1
+
+#include <ossim/base/ossimStreamFactoryBase.h>
+#include <ossim/base/ossimIoStream.h>
+
+namespace ossim
+{
+   class OSSIM_DLL StreamFactory : public StreamFactoryBase
+   {
+   public:
+      static StreamFactory* instance();
+      
+      virtual ~StreamFactory();
+
+      virtual std::shared_ptr<ossim::istream>
+         createIstream(const std::string& connectionString,
+                       const ossimKeywordlist& options=ossimKeywordlist(),
+                       std::ios_base::openmode mode=
+                       std::ios_base::in|std::ios_base::binary) const;
+      
+      virtual std::shared_ptr<ossim::ostream>
+         createOstream(const std::string& connectionString,
+                       const ossimKeywordlist& options=ossimKeywordlist(),
+                       std::ios_base::openmode mode=
+                       std::ios_base::out|std::ios_base::binary) const;
+      
+      virtual std::shared_ptr<ossim::iostream>
+         createIOstream(const std::string& connectionString,
+                        const ossimKeywordlist& options=ossimKeywordlist(),
+                        std::ios_base::openmode mode=
+                        std::ios_base::in|std::ios_base::out|std::ios_base::binary) const;
+
+      /**
+       * @brief Methods to test if connection exists.
+       *
+       * @param connectionString
+       * 
+       * @param continueFlag Initializes by this, if set to false, indicates factory
+       * handles file/url and no more factory checks are necessary.  If true,
+       * connection is not handled by this factory.
+       * 
+       * @return true on success, false, if not.  
+       */
+      virtual bool exists(const std::string& connectionString,
+                          bool& continueFlag) const;
+
+   protected:
+      StreamFactory();
+      StreamFactory(const StreamFactory&);
+
+      static StreamFactory* m_instance;
+   };
+}
+
+// Deprecated code...
+class OSSIM_DLL ossimStreamFactory : public ossimStreamFactoryBase
+{
+public:
+   static ossimStreamFactory* instance();
+   virtual ~ossimStreamFactory();
+
+   virtual std::shared_ptr<ossim::ifstream>
+      createIFStream(const ossimFilename& file,
+                     std::ios_base::openmode mode) const;
+   
+   virtual ossimRefPtr<ossimIFStream>
+      createNewIFStream(const ossimFilename& file,
+                        std::ios_base::openmode mode) const;
+   
+protected:
+   ossimStreamFactory();
+   ossimStreamFactory(const ossimStreamFactory&);
+   static ossimStreamFactory* theInstance;
+   
+};
+
+#endif
diff --git a/include/ossim/base/ossimStreamFactoryBase.h b/include/ossim/base/ossimStreamFactoryBase.h
new file mode 100644
index 0000000..9fd39ec
--- /dev/null
+++ b/include/ossim/base/ossimStreamFactoryBase.h
@@ -0,0 +1,78 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*******************************************************************
+// $Id$
+
+#ifndef ossimStreamFactoryBase_HEADER
+#define ossimStreamFactoryBase_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <iosfwd>
+#include <memory>
+#include <string>
+
+class ossimFilename;
+
+namespace ossim
+{
+   class OSSIM_DLL StreamFactoryBase
+   {
+   public:
+      virtual ~StreamFactoryBase(){}
+      
+      virtual std::shared_ptr<ossim::istream>
+         createIstream(const std::string& connectionString,
+                       const ossimKeywordlist& options,
+                       std::ios_base::openmode mode) const=0;
+
+      virtual std::shared_ptr<ossim::ostream>
+         createOstream(const std::string& connectionString,
+                       const ossimKeywordlist& options,
+                       std::ios_base::openmode mode) const=0;
+
+      virtual std::shared_ptr<ossim::iostream>
+         createIOstream(const std::string& connectionString,
+                        const ossimKeywordlist& options,
+                        std::ios_base::openmode mode) const=0;
+
+      /**
+       * @brief Methods to test if connection exists.
+       *
+       * @param connectionString
+       * 
+       * @param continueFlag Initializes by this, if set to false, indicates factory
+       * handles file/url and no more factory checks are necessary.  If true,
+       * connection is not handled by this factory.
+       * 
+       * @return true on success, false, if not.  
+       */
+      virtual bool exists(const std::string& connectionString,
+                          bool& continueFlag) const = 0;
+   };
+}
+
+class OSSIM_DLL ossimStreamFactoryBase
+{
+public:
+   virtual ~ossimStreamFactoryBase(){}
+
+   virtual std::shared_ptr<ossim::ifstream>
+      createIFStream(const ossimFilename& file,
+                     std::ios_base::openmode openMode) const=0;
+   
+   virtual ossimRefPtr<ossimIFStream> createNewIFStream(
+      const ossimFilename& file,
+      std::ios_base::openmode openMode)const=0;
+};
+
+#endif
diff --git a/include/ossim/base/ossimStreamFactoryRegistry.h b/include/ossim/base/ossimStreamFactoryRegistry.h
new file mode 100644
index 0000000..3cf36a8
--- /dev/null
+++ b/include/ossim/base/ossimStreamFactoryRegistry.h
@@ -0,0 +1,109 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*******************************************************************
+// $Id$
+
+#ifndef ossimStreamFactoryRegistry_HEADER
+#define ossimStreamFactoryRegistry_HEADER 1
+
+#include <ossim/base/ossimFactoryListInterface.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimStreamFactoryBase.h>
+
+#include <memory>
+#include <vector>
+
+namespace ossim
+{
+   class OSSIM_DLL StreamFactoryRegistry : public StreamFactoryBase
+   {
+   public:
+      static StreamFactoryRegistry* instance();
+      virtual ~StreamFactoryRegistry();
+   
+      void registerFactory(StreamFactoryBase* factory);
+      void unregisterFactory(StreamFactoryBase* factory);
+
+      virtual std::shared_ptr<ossim::istream>
+         createIstream(const std::string& connectionString,
+                       const ossimKeywordlist& options=ossimKeywordlist(),
+                       std::ios_base::openmode mode=
+                       std::ios_base::in|std::ios_base::binary) const;
+      
+      virtual std::shared_ptr<ossim::ostream>
+         createOstream(const std::string& connectionString,
+                       const ossimKeywordlist& options=ossimKeywordlist(),
+                       std::ios_base::openmode mode=
+                       std::ios_base::out|std::ios_base::binary) const;
+      
+      virtual std::shared_ptr<ossim::iostream>
+         createIOstream(const std::string& connectionString,
+                        const ossimKeywordlist& options=ossimKeywordlist(),
+                        std::ios_base::openmode mode=
+                        std::ios_base::in|std::ios_base::out|std::ios_base::binary) const;
+
+      /**
+       * @brief Methods to test if connection exists.
+       * @return true on success, false, if not.  
+       */
+      bool exists(const std::string& connectionString) const;
+
+      /**
+       * @brief Methods to test if connection exists.
+       * @param connectionString
+       * @param continueFlag Initializes by this, if set to true, indicates factory
+       * handles file/url and no more factory checks are necessary.
+       * @return true on success, false, if not.  
+       */
+      virtual bool exists(const std::string& connectionString,
+                          bool& continueFlag) const;
+   
+   protected:
+      StreamFactoryRegistry();
+      
+   private:
+      
+      /** @brief copy constructor hidden from use */
+      StreamFactoryRegistry(const StreamFactoryRegistry&);
+      
+      std::vector<StreamFactoryBase*> m_factoryList;
+
+      static StreamFactoryRegistry*   m_instance;
+   };
+   
+} // End: namespace ossim
+
+// Deprecated code...
+class OSSIM_DLL ossimStreamFactoryRegistry : public ossimStreamFactoryBase
+{
+public:
+   static ossimStreamFactoryRegistry* instance();
+   virtual ~ossimStreamFactoryRegistry();
+   
+   void registerFactory(ossimStreamFactoryBase* factory);
+
+   virtual std::shared_ptr<ossim::ifstream>
+      createIFStream(const ossimFilename& file,
+                     std::ios_base::openmode openMode) const;
+   
+   virtual ossimRefPtr<ossimIFStream> createNewIFStream(
+      const ossimFilename& file, std::ios_base::openmode openMode) const;
+   
+protected:
+   ossimStreamFactoryRegistry();
+private:
+   /** @brief copy constructor hidden from use */
+   ossimStreamFactoryRegistry(const ossimStreamFactoryRegistry&);
+   
+   std::vector<ossimStreamFactoryBase*> theFactoryList;
+   static ossimStreamFactoryRegistry* theInstance;
+};
+
+#endif
diff --git a/include/ossim/base/ossimString.h b/include/ossim/base/ossimString.h
new file mode 100644
index 0000000..b7cfe95
--- /dev/null
+++ b/include/ossim/base/ossimString.h
@@ -0,0 +1,938 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: This class extends the stl's string class.
+//
+//********************************************************************
+// $Id: ossimString.h 20491 2012-01-23 20:10:06Z dburken $
+#ifndef ossimString_HEADER
+#define ossimString_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <string>
+#include <vector>
+#include <iostream>
+
+
+class OSSIM_DLL ossimString
+{
+public:
+
+   typedef std::string::const_iterator const_iterator;
+   typedef std::string::iterator       iterator;
+   typedef std::string::size_type      size_type;
+
+   /** @brief default constructor */
+   ossimString(): m_str() {}
+
+   /** @brief constructor that takes a std::string */
+   ossimString(const std::string& s):m_str(s) {}
+
+   /**
+    * @brief constructor that takes char*
+    * NOTE: std::string construtor throws exception given null pointer;
+    * hence, the null check.
+    */
+   ossimString(const char *aString):m_str( aString?aString:"" ){}
+
+   /** @brief copy constructor */
+   ossimString(const ossimString& aString):m_str(aString.m_str){}
+
+   /** @brief constructor - constructs with n copies of c */
+   ossimString(std::string::size_type n, char c):m_str(n,c){}
+
+   /** @brief constructor - constructs with 1 c. */
+   ossimString(char aChar):m_str(1, aChar){}
+
+   template <class Iter>
+   ossimString(Iter startIter, Iter endIter):m_str(startIter, endIter){}
+
+   /** @brief destructor */
+   ~ossimString(){}
+
+   bool contains(char aChar) const
+   { return m_str.find(aChar)!=std::string::npos; }
+
+   bool contains(const ossimString& aString) const
+   { return m_str.find(aString.m_str)!=std::string::npos; }
+
+   bool contains(const char* aString) const
+   { return m_str.find(aString)!=std::string::npos; }
+
+   /** @brief Type conversion operator to a const std::string&. */
+   operator const std::string&() const { return m_str; }
+
+   /** @brief Type conversion operator to a std::string&. */
+   operator std::string&() { return m_str; }
+
+   /** @brief Type conversion operator to a const char*. */
+   operator const char*() const { return m_str.c_str(); }
+
+   /** @brief For backward compatibility. */
+   const char* chars() const { return m_str.c_str(); }
+
+   /** @brief Reads s from the input stream is. */
+   friend OSSIM_DLL std::istream& operator>>(std::istream&  is, ossimString& s);
+
+   /** @brief Writes s to the output stream os. */
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& os,
+                                             const ossimString& s);
+
+   /**
+    * @brief Reads a string from the input stream is, stopping when it
+    * reaches delim.
+    */
+   friend OSSIM_DLL std::istream& getline( std::istream& is,
+                                           ossimString& str,
+                                           char delim );
+
+   /** @brief Reads a single line from the input stream is. */
+   friend OSSIM_DLL std::istream& getline( std::istream& is, ossimString& str );
+
+   const ossimString& operator=(const std::string& s)
+   {
+      m_str = s;
+      return *this;
+   }
+
+   const ossimString& operator=(const char* s)
+   {
+      if (s) // std::string::operator= throws exception given null pointer.
+      {
+         m_str = s;
+      }
+      else
+      {
+         m_str = "";
+      }
+      return *this;
+   }
+
+   const ossimString& operator=(char c)
+   {
+      m_str = c;
+      return *this;
+   }
+
+   const ossimString& operator=(const ossimString& s)
+   {
+      if ( this != &s )
+      {
+         m_str = s.m_str;
+      }
+      return *this;
+   }
+
+   const ossimString& operator+=(const ossimString& s)
+   {
+      m_str.append(s.m_str);
+      return *this;
+   }
+
+   const ossimString& operator+=(const std::string& s)
+   {
+      m_str.append(s);
+      return *this;
+   }
+
+   const ossimString& operator+=(const char* s)
+   {
+      if ( s ) m_str.append(s);
+      return *this;
+   }
+
+   const ossimString& operator+=(char c)
+   {
+      m_str.append(1, c);
+      return *this;
+   }
+
+   const ossimString& append(const ossimString& s);
+
+   const ossimString& append(const std::string& s);
+
+   const ossimString& append(const char* s);
+
+   /**
+    *  @brief  Provides access to the data contained in the %string.
+    *  @param n The index of the character to access.
+    *  @return  Read-only (const) reference to the character.
+    *  @throw  std::out_of_range  If @a n is an invalid index.
+    *
+    *  This function provides for safer data access.  The parameter is
+    *  first checked that it is in the range of the string.  The function
+    *  throws out_of_range if the check fails.
+    */
+   const char& at(std::string::size_type n) const;
+
+   /**
+    *  @brief  Provides access to the data contained in the %string.
+    *  @param n The index of the character to access.
+    *  @return  Read/write reference to the character.
+    *  @throw  std::out_of_range  If @a n is an invalid index.
+    *
+    *  This function provides for safer data access.  The parameter is
+    *  first checked that it is in the range of the string.  The function
+    *  throws out_of_range if the check fails.  Success results in
+    *  unsharing the string.
+    */
+   char& at(std::string::size_type n);
+
+   /** @brief Append n copies of c to *this. */
+   const ossimString& append(std::string::size_type n, char c);
+
+   ossimString operator+(const ossimString& s)const
+   {
+      ossimString returnS(*this);
+      returnS.m_str.append(s.m_str);
+      return returnS;
+   }
+
+   ossimString operator+(const std::string& s)const
+   {
+      ossimString returnS(*this);
+      returnS.m_str.append(s);
+      return returnS;
+   }
+
+   ossimString operator+(const char* s)const
+   {
+      ossimString returnS(*this);
+      if ( s ) returnS.m_str.append(s);
+      return returnS;
+   }
+
+   ossimString operator+(char c)const
+   {
+      ossimString returnS(*this);
+      returnS.m_str.append(1, c);
+      return returnS;
+   }
+
+   friend OSSIM_DLL ossimString operator+(const char* s1, const ossimString& s2);
+
+   friend OSSIM_DLL ossimString operator+(const std::string s1, const ossimString& s2);
+
+   friend OSSIM_DLL ossimString operator+(char c, const ossimString& s2);
+   friend OSSIM_DLL bool operator==(const char* lhs, const ossimString& rhs);
+   friend OSSIM_DLL bool operator==(const std::string& lhs, const ossimString& rhs);
+
+   /**
+    *  @brief  Test if this ossimString is equal to another ossimString.
+    *  @param rhs ossimString to compare.
+    *  @return  True if strings are equal.  False otherwise.
+    */
+   bool operator==(const ossimString& rhs) const
+   {
+      return (m_str.compare( rhs.m_str ) == 0);
+   }
+
+   /**
+    *  @brief  Test if this ossimString is equal to a C sting.
+    *  @param rhs C string to compare.
+    *  @return  True if strings are equal.
+    *  False if rhs is not equal null or null.
+    */
+   bool operator==(const char* rhs) const
+   {
+      bool result = false;
+      if (rhs)
+      {
+         result = (m_str.compare(std::string(rhs)) == 0);
+      }
+      return result;
+   }
+
+   /**
+    *  @brief  Test if this ossimString is not equal to another ossimString.
+    *  @param rhs ossimString to compare.
+    *  @return  True if strings are not equal.  False otherwise.
+    */
+   bool operator!=(const ossimString& rhs) const
+   {
+      return !(m_str.compare(rhs.m_str) == 0);
+   }
+
+   /**
+    *  @brief  Test if this ossimString is not equal to a C sting.
+    *  @param rhs C string to compare.
+    *  @return  True if strings are not equal or rhs is null.
+    *  False if rhs equal to this string.
+    */
+   bool operator!=(const char* rhs) const
+   {
+      bool result = true;
+      if (rhs)
+      {
+         result = !(m_str.compare(std::string(rhs)) == 0);
+      }
+      return result;
+   }
+
+   char& operator[](std::string::size_type i)
+   {
+      return m_str[i];
+      // return *( const_cast<char*>(m_strc_str())+i);
+   }
+
+   const char& operator[](std::string::size_type i)const
+   {
+      return m_str[i];
+   }
+
+   /**
+    * @brief If pos > size(), throws out_of_range. Otherwise, equivalent to
+    * insert(begin() + pos, s, s + traits::length(s)).
+    */
+   std::string& insert(std::string::size_type pos, const char* s);
+
+   /** @brief Equivalent to insert(end(), c). */
+   void push_back(char c);
+
+   /** @brief Equivalent to basic_string(*this, pos, n). */
+   std::string substr(std::string::size_type pos = 0,
+                      std::string::size_type n = std::string::npos) const;
+
+   /**
+    * this will strip lead and trailing character passed in.
+    * So if you want to remove blanks:
+    *    ossimString temp("       asdfasdf      ");
+    *    ossimString trimmedString = temp.trim(" \n\t\r");
+    *
+    *    this will now contain "asdfasdf" without the blanks.
+    *
+    */
+   ossimString trim(const ossimString& valueToTrim= ossimString(" \t\n\r"))const;
+   ossimString& trim(const ossimString& valueToTrim= ossimString(" \t\n\r"));
+
+   ossimString beforePos(std::string::size_type pos)const;
+    ossimString afterPos(std::string::size_type pos)const;
+
+   /**
+    *  Substitutes searchKey string with replacementValue and returns a
+    *  string.  Will replace all occurrences found if "replaceAll" is true.
+    */
+   ossimString substitute(const ossimString &searchKey,
+                                  const ossimString &replacementValue,
+                                  bool replaceAll=false)const;
+
+   /**
+    *  Substitutes searchKey string with replacementValue and returns a
+    *  reference to *this.  Will replace all occurrences found if
+    *  "replaceAll" is true.  (like substitute only works on "this")
+    */
+   ossimString& gsub(const ossimString &searchKey,
+                             const ossimString &replacementValue,
+                             bool replaceAll=false);
+
+   std::vector<ossimString> explode(const ossimString& delimeter) const;
+
+   /**
+    * If the variable "$(env_var_name)" is found in the string, where
+    * "env_var_name" is any system environment variable resolvable by
+    * the getenv() function, the variable is expanded in place and the
+    * result returned.
+    */
+   ossimString expandEnvironmentVariable() const;
+
+   /**
+    * @param aString String to make an upcased copy of.
+    *
+    * @return An upcased version of aString.
+    */
+   static ossimString upcase(const ossimString& aString);
+
+   /**
+    * @param aString String to make an downcased copy of.
+    *
+    * @return A downcased version of aString.
+    */
+   static ossimString downcase(const ossimString& aString);
+
+   /**
+    * Upcases this string.
+    *
+    * @return Reference to this.
+    */
+   ossimString& upcase();
+   ossimString upcase()const;
+
+   /**
+    * Downcases this string.
+    *
+    * @return Reference to this.
+    */
+   ossimString& downcase();
+   ossimString downcase()const;
+
+   /**
+    * @brief Returns a pointer to a null-terminated array of characters
+    * representing the string's contents.
+    */
+   const char* c_str() const { return m_str.c_str(); }
+
+   /**
+    * @brief Returns a pointer to an array of characters (not necessarily
+    * null-terminated) representing the string's contents.
+    */
+   const char* data() const { return m_str.data(); }
+
+   /** @return The size of the string. */
+   std::string::size_type size() const { return m_str.size(); }
+
+   /** @return The size of the string. */
+   std::string::size_type length() const { return m_str.size(); }
+
+   /** @return True if size is 0. */
+   bool empty() const { return m_str.empty(); }
+
+   /** @return The underlying std::string container. */
+   const std::string& string() const { return m_str; }
+
+   /** @return The underlying std::string container. */
+   std::string& string() { return m_str; }
+
+   /** @return An iterator pointing to the beginning of the string. */
+   std::string::iterator begin() { return m_str.begin(); }
+
+   /** @return An iterator pointing to the end of the string. */
+   std::string::iterator end() { return m_str.end(); }
+
+   /** @return An const_iterator pointing to the beginning of the string. */
+   std::string::const_iterator begin() const { return m_str.begin(); }
+
+   /** @return An const_iterator pointing to the end of the string. */
+   std::string::const_iterator end() const { return m_str.end(); }
+
+   /** @brief Erases the entire container. */
+   void clear() { m_str.clear(); }
+
+   /** @brief Erases the character at position p. */
+   std::string::iterator erase(std::string::iterator p);
+
+   /** @brief Erases the range [first, last). */
+   std::string::iterator erase(std::string::iterator first,
+                               std::string::iterator last);
+
+   /** @brief Erases a range. */
+   std::string& erase(std::string::size_type pos = 0,
+                      std::string::size_type n = std::string::npos);
+
+   /**
+    * @brief Searches for s as a substring of *this, beginning at character
+    * pos of *this.
+    */
+   std::string::size_type find(const std::string& s,
+                               std::string::size_type pos = 0) const;
+
+   /**
+    * @brief Searches for the first n characters of s as a substring of *this,
+    * beginning at character pos of *this.
+    */
+   std::string::size_type find(const char* s,
+                               std::string::size_type pos,
+                               std::string::size_type n) const;
+
+   /**
+    * @brief Searches for a null-terminated character array as a substring
+    * of *this, beginning at character pos of *this.
+    */
+   std::string::size_type find(const char* s,
+                               std::string::size_type pos = 0) const;
+
+   /**
+    * @brief Searches for the character c, beginning at character position
+    * pos.
+    */
+   std::string::size_type find(char c, std::string::size_type pos = 0) const;
+
+    /**
+    * @brief Searches backward for s as a substring of *this, beginning at
+    * character position min(pos, size()).
+    */
+   std::string::size_type rfind(const std::string& s,
+                                std::string::size_type pos = 0) const;
+
+   /**
+    * @brief Searches backward for the first n characters of s as a substring
+    * of *this, beginning at character position min(pos, size()).
+    */
+   std::string::size_type rfind(const char* s,
+                                std::string::size_type pos,
+                                std::string::size_type n) const;
+
+   /**
+    * @brief Searches backward for a null-terminated character array as a
+    * substring of *this, beginning at character min(pos, size()).
+    */
+   std::string::size_type rfind(const char* s,
+                                std::string::size_type pos = 0) const;
+
+   /**
+    * @brief Searches backward for the character c, beginning at character
+    * position min(pos, size().
+    */
+   std::string::size_type rfind(char c, std::string::size_type pos = 0) const;
+
+   /** @brief Equivalent to find(c, pos). */
+   std::string::size_type find_first_of(
+      char c, std::string::size_type pos = 0) const;
+
+   /**
+    * @brief Returns the smallest character position N such that
+    * pos <= N < size(), and such that (*this)[N] does not compare equal to c.
+    * Returns npos if no such character position exists.
+    */
+   std::string::size_type find_first_not_of(
+      char c, std::string::size_type pos = 0) const;
+
+   /**
+    * @brief Equivalent to find_first_of(s, pos, traits::length(s)).
+    */
+   std::string::size_type find_first_of(
+      const char* s, std::string::size_type pos = 0) const;
+
+      /**
+    * @brief Equivalent to find_first_not_of(s, pos, traits::length(s)).
+    */
+   std::string::size_type find_first_not_of(
+      const char* s, std::string::size_type pos = 0) const;
+
+   /** @brief Equivalent to rfind(c, pos). */
+   std::string::size_type find_last_of(
+      char c, std::string::size_type pos = std::string::npos) const;
+
+   /**
+    * @brief Erases the existing characters and replaces them by n copies
+    * of c.
+    */
+   std::string& assign(std::string::size_type n, char c);
+
+   /** @brief Replaces a substring of *this with the string s. */
+   std::string& replace(std::string::size_type pos,
+                        std::string::size_type n,
+                        const std::string& s);
+
+   /** brief Equivalent to insert(erase(first, last), s.begin(), s.end()). */
+   std::string& replace(std::string::iterator first,
+                        std::string::iterator last,
+                        const std::string& s);
+
+   /** @brief Replaces a substring of *this with a substring of s. */
+   std::string& replace(std::string::size_type pos,
+                        std::string::size_type n,
+                        const std::string& s,
+                        std::string::size_type pos1,
+                        std::string::size_type n1);
+
+   /** @brief Requests that the string's capacity be changed. */
+   void reserve(std::string::size_type n);
+
+   /**
+    * METHOD: before(str, pos)
+    * Returns string beginning at pos and ending one before the token str
+    * If string not found or pos out of range the whole string will be
+    * returned.
+    */
+   ossimString before(const ossimString& str, std::string::size_type pos=0)const;
+
+   /**
+    * METHOD: after(str, pos)
+    * Returns string immediately after the token str. The search for str
+    * begins at pos.  Returns an empty string if not found or pos out of
+    * range.
+    */
+   ossimString after (const ossimString& str, std::string::size_type pos=0)const;
+
+   char* stringDup()const;
+
+   /**
+    * String to numeric methods.
+    */
+   bool                 toBool()const;
+   static bool          toBool(const ossimString& aString);
+
+   ossim_uint8          toUInt8()const;
+   static ossim_uint8   toUInt8(const ossimString& aString);
+
+   int                  toInt()const;
+   static int           toInt(const ossimString& aString);
+
+   ossim_int16          toInt16()const;
+   static ossim_int16   toInt16(const ossimString& aString);
+   ossim_uint16         toUInt16()const;
+   static ossim_uint16  toUInt16(const ossimString& aString);
+
+   ossim_int32          toInt32()const;
+   static ossim_int32   toInt32(const ossimString& aString);
+   ossim_uint32         toUInt32()const;
+   static ossim_uint32  toUInt32(const ossimString& aString);
+
+   ossim_int64          toInt64()const;
+   static ossim_int64   toInt64(const ossimString& aString);
+   ossim_uint64         toUInt64()const;
+   static ossim_uint64  toUInt64(const ossimString& aString);
+
+   /**
+    * toLong's deprecated, please use the toInts...
+    */
+   long                 toLong()const;
+   static long          toLong(const ossimString& aString);
+   unsigned long        toULong()const;
+   static unsigned long toULong(const ossimString& aString);
+
+   ossim_float32        toFloat32()const;
+   static ossim_float32 toFloat32(const ossimString& aString);
+   ossim_float64        toFloat64()const;
+   static ossim_float64 toFloat64(const ossimString& aString);
+   double               toDouble()const;
+   static double        toDouble(const ossimString& aString);
+
+   /**
+    * Numeric to string methods.
+    */
+   static ossimString toString(bool aValue);
+   static ossimString toString(ossim_int16   aValue);
+   static ossimString toString(ossim_uint16  aValue);
+   static ossimString toString(ossim_int32   aValue);
+   static ossimString toString(ossim_uint32  aValue);
+   static ossimString toString(ossim_int64   aValue);
+   static ossimString toString(ossim_uint64  aValue);
+
+   /**
+    * @param aValue Value to convert to string.
+    *
+    * @param precision Decimal point precision of the output.
+    *
+    * @param fixed If true setiosflags(std::ios::fixed) will be called.
+    */
+   static ossimString toString(ossim_float32 aValue,
+                               ossim_int32 precision = 8,
+                               bool fixed = false);
+
+   /**
+    * @param aValue Value to convert to string.
+    *
+    * @param precision Decimal point precision of the output.
+    *
+    * @param fixed If true setiosflags(std::ios::fixed) will be called.
+    */
+   static ossimString toString(ossim_float64 aValue,
+                               ossim_int32 precision = 15,
+                               bool fixed = false);
+
+   static ossimString stripLeading(const ossimString &value,
+                                   char characterToStrip);
+
+
+   /**
+    * Splits this string into a vector of strings (fields) using the delimiter list specified.
+    * If a delimiter is encountered at the beginning or the end of this, or two delimiters are
+    * contiguous, a blank field is inserted in the vector, unless skipBlankFields is true.
+    */
+   void split(std::vector<ossimString>& result,
+              const ossimString& separatorList,
+              bool skipBlankFields=false)const;
+
+   std::vector<ossimString> split(const ossimString& separatorList,
+                                  bool skipBlankFields=false)const;
+
+   const ossimString& join(const std::vector<ossimString>& stringList,
+                           const ossimString& separator);
+
+   //---
+   // Regular expression pattern utilities
+   //---
+
+   /**
+    * Returns from start of string up to but not including found pattern.
+    * Returns "" if pattern not found.
+    */
+   ossimString beforeRegExp(const char *regularExpressionPattern) const;
+
+   /**
+    * Returns from position of found pattern to end of string.
+    * Returns "" if pattern not found.
+    */
+   ossimString fromRegExp(const char *regularExpressionPattern) const;
+
+   /**
+    * Returns from position after found pattern to end of string.
+    * Returns "" if pattern not found.
+    */
+   ossimString afterRegExp(const char *regularExpressionPattern) const;
+
+   /**
+    * Returns from found pattern to end of pattern.
+    * Returns "" if pattern not found.
+    */
+   ossimString match(const char *regularExpressionPattern) const;
+
+   ossimString replaceAllThatMatch(const char *regularExpressionPattern,
+                                   const char *value="") const;
+
+   ossimString replaceStrThatMatch(const char *regularExpressionPattern,
+                                   const char *value="") const;
+
+   ossimString urlEncode()const;
+
+   /**
+    * If OSSIM_ID_ENABLED returns the OSSIM_ID which currently is the
+    * expanded cvs $Id: ossimString.h 20491 2012-01-23 20:10:06Z dburken $ macro; else, an empty string.
+    */
+   ossimString getOssimId() const;
+
+protected:
+
+   std::string m_str;
+};
+
+inline std::string::iterator ossimString::erase(std::string::iterator p)
+{
+   return m_str.erase(p);
+}
+
+inline std::string::iterator ossimString::erase(std::string::iterator first,
+                                                std::string::iterator last)
+{
+   return m_str.erase(first, last);
+}
+
+inline std::string& ossimString::erase(std::string::size_type pos,
+                                       std::string::size_type n)
+{
+   return m_str.erase(pos, n);
+}
+
+inline std::string::size_type ossimString::find(
+   const std::string& s, std::string::size_type pos) const
+{
+   return m_str.find(s, pos);
+}
+
+inline std::string::size_type ossimString::find(
+   const char* s, std::string::size_type pos, std::string::size_type n) const
+{
+   return m_str.find(s, pos, n);
+}
+
+inline std::string::size_type ossimString::find(
+   const char* s, std::string::size_type pos) const
+{
+   return m_str.find(s, pos);
+}
+
+inline std::string::size_type ossimString::find(
+   char c, std::string::size_type pos) const
+{
+   return m_str.find(c, pos);
+}
+
+inline std::string::size_type ossimString::rfind(
+   const std::string& s, std::string::size_type pos) const
+{
+   return m_str.rfind(s, pos);
+}
+
+inline std::string::size_type ossimString::rfind(
+   const char* s, std::string::size_type pos, std::string::size_type n) const
+{
+   return m_str.rfind(s, pos, n);
+}
+
+inline std::string::size_type ossimString::rfind(
+   const char* s, std::string::size_type pos) const
+{
+   return m_str.rfind(s, pos);
+}
+
+inline std::string::size_type ossimString::rfind(
+   char c, std::string::size_type pos) const
+{
+   return m_str.rfind(c, pos);
+}
+
+inline std::string::size_type ossimString::find_first_of(
+   char c, std::string::size_type pos) const
+{
+   return m_str.find_first_of(c, pos);
+}
+
+inline std::string::size_type ossimString::find_first_of(
+   const char* s, std::string::size_type pos) const
+{
+   return m_str.find_first_of(s, pos);
+}
+
+inline std::string::size_type ossimString::find_first_not_of(
+   const char c, std::string::size_type pos) const
+{
+   return m_str.find_first_not_of(c, pos);
+}
+
+inline std::string::size_type ossimString::find_first_not_of(
+   const char* s, std::string::size_type pos) const
+{
+   return m_str.find_first_not_of(s, pos);
+}
+
+inline std::string::size_type ossimString::find_last_of(
+   char c, std::string::size_type pos) const
+{
+   return m_str.find_last_of(c, pos);
+}
+
+inline const ossimString& ossimString::append(const ossimString& s)
+{
+   m_str.append(s.m_str);
+   return *this;
+}
+
+inline const ossimString& ossimString::append(const std::string& s)
+{
+   m_str.append(s);
+   return *this;
+}
+
+inline const ossimString& ossimString::append(const char* s)
+{
+   if ( s ) m_str.append(s);
+   return *this;
+}
+
+inline const ossimString& ossimString::append(std::string::size_type n, char c)
+{
+   m_str.append(n, c);
+   return *this;
+}
+
+inline const char& ossimString::at(std::string::size_type n) const
+{
+   return m_str.at(n); 
+}
+
+inline char& ossimString::at(std::string::size_type n)
+{
+   return m_str.at(n);
+}
+
+inline std::string& ossimString::assign(std::string::size_type n, char c)
+{
+   return m_str.assign(n, c);
+}
+
+inline std::string& ossimString::replace(
+   std::string::size_type pos, std::string::size_type n, const std::string& s)
+{
+   return m_str.replace(pos, n, s);
+}
+
+inline std::string& ossimString::replace(std::string::iterator first,
+                                         std::string::iterator last,
+                                         const std::string& s)
+{
+   return m_str.replace(first, last, s);
+}
+
+inline std::string& ossimString::replace(std::string::size_type pos,
+                                         std::string::size_type n,
+                                         const std::string& s,
+                                         std::string::size_type pos1,
+                                         std::string::size_type n1)
+{
+   return m_str.replace(pos, n, s, pos1, n1);
+}
+
+inline void ossimString::reserve(std::string::size_type n)
+{
+   m_str.reserve(n);
+}
+
+
+inline std::string& ossimString::insert(std::string::size_type pos,
+                                        const char* s)
+{
+   if (s) m_str.insert(pos, s);
+   return m_str;
+}
+
+inline void ossimString::push_back(char c)
+{
+   m_str.push_back(c);
+}
+
+inline std::string ossimString::substr(std::string::size_type pos,
+                                       std::string::size_type n) const
+{
+   return m_str.substr(pos, n);
+}
+
+inline std::istream& getline( std::istream& is, ossimString& str, char delim )
+{
+   return std::getline( is, str.string(), delim );
+}
+
+inline std::istream& getline( std::istream& is, ossimString& str )
+{
+   // Not sure why getline( is, str.string()) doesn't work. (drb)
+   return std::getline( is, str.string(), '\n' );
+}
+
+inline std::istream& operator>>(std::istream&  is, ossimString& s)
+{
+   return is >> s.string();
+}
+
+inline std::ostream& operator<<(std::ostream& os, const ossimString& s)
+{
+   return os << s.string();
+}
+
+inline ossimString operator+(const char* s1, const ossimString& s2)
+{
+   ossimString result;
+   if ( s1 ) result = ossimString( s1 + s2.string() );
+   else result = s2;
+   return result;
+}
+
+inline ossimString operator+(const std::string s1, const ossimString& s2)
+{
+   return ossimString( s1 + s2.string() );
+}
+
+inline ossimString operator+(char c, const ossimString& s2)
+{
+   return ossimString( c + s2.string() );
+}
+
+inline bool operator==(const char* lhs, const ossimString& rhs)
+{
+   return (rhs.operator ==(lhs));
+}
+
+inline bool operator==(const std::string& lhs, const ossimString& rhs)
+{
+   return (rhs.operator ==(lhs));
+}
+
+/**
+ * @brief For use with std::map as a compare operator:
+ * std::map<ossimString, ossimString, ossimStringLtstr>
+ *
+ * This will allow the find method on map to work.
+ */
+struct ossimStringLtstr
+{
+   bool operator()(const ossimString& s1, const ossimString& s2) const
+   {
+      return s1.string().compare(s2.string()) < 0;
+   }
+};
+
+#endif /* #ifndef ossimString_HEADER */
diff --git a/ossim/include/ossim/base/ossimStringListProperty.h b/include/ossim/base/ossimStringListProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimStringListProperty.h
rename to include/ossim/base/ossimStringListProperty.h
diff --git a/include/ossim/base/ossimStringProperty.h b/include/ossim/base/ossimStringProperty.h
new file mode 100644
index 0000000..cb3cd61
--- /dev/null
+++ b/include/ossim/base/ossimStringProperty.h
@@ -0,0 +1,73 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: LGPL see top level license.txt
+//
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+//*************************************************************************
+// $Id: ossimStringProperty.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimStringProperty_HEADER
+#define ossimStringProperty_HEADER
+#include <ossim/base/ossimProperty.h>
+#include <vector>
+
+class OSSIMDLLEXPORT ossimStringProperty : public ossimProperty
+{
+public:
+   ossimStringProperty(const ossimString& name = ossimString(""),
+                       const ossimString& value = ossimString(""),
+                       bool editableFlag = true,
+                       const std::vector<ossimString>& constraintList = std::vector<ossimString>());
+   
+   ossimStringProperty(const ossimStringProperty& rhs);
+
+   /*!
+    * Duplicates the object and returns a new one
+    */
+   virtual ossimObject* dup()const;
+
+   virtual const ossimProperty& assign(const ossimProperty& rhs);
+   
+   void setEditableFlag(bool flag);
+   bool getEditableFlag()const;
+   bool isEditable()const;
+   
+   /*!
+    * Clears the constraints for this string.  You can constrain
+    * it to a string list by calling setConstraints.
+    */
+   void clearConstraints();
+
+   /*!
+    * Sets the constraints for this property.  If the editable
+    * flag is present then this says the editing is not readonly
+    * and one can hand type the value in without only selecting
+    * from a choice list.
+    */
+   void setConstraints(const std::vector<ossimString>& constraintList);
+
+   void addConstraint(const ossimString& value);
+   const std::vector<ossimString>& getConstraints()const;
+   
+   bool hasConstraints()const;
+   
+   /*!
+    * will try to set the value.  If the constraints are set
+    * it will make sure that the value is in the list and
+    * if its not then it will return false 
+    */
+   virtual bool setValue(const ossimString& value);
+   
+   virtual void valueToString(ossimString& valueResult)const;
+  
+   
+protected:
+   ossimString theValue;
+   bool        theEditableFlag;
+   std::vector<ossimString> theConstraints;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimTDpt.h b/include/ossim/base/ossimTDpt.h
similarity index 100%
rename from ossim/include/ossim/base/ossimTDpt.h
rename to include/ossim/base/ossimTDpt.h
diff --git a/include/ossim/base/ossimTempFilename.h b/include/ossim/base/ossimTempFilename.h
new file mode 100644
index 0000000..270281b
--- /dev/null
+++ b/include/ossim/base/ossimTempFilename.h
@@ -0,0 +1,42 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// Description: This is a tmeporary filename class it will create a temporary
+//              file and will also delete it upon destruction
+//
+//*************************************************************************
+// $Id: ossimTempFilename.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimTempFilename_HEADER
+#define ossimTempFilename_HEADER
+#include <ossim/base/ossimFilename.h>
+
+class OSSIM_DLL ossimTempFilename : public ossimFilename
+{
+public:
+   ossimTempFilename(const ossimString& tempDir="",
+                     const ossimString& prefix = "",
+                     const ossimString& extension = "",
+                     bool autodelete=true,
+                     bool useWildcardDelete=true);
+
+   void generateRandomFile();
+   void generateRandomDir();
+   
+   ~ossimTempFilename();
+   
+protected:
+   ossimString theTempDir;
+   ossimString thePrefix;
+   ossimString theExtension;
+   bool theAutoDeleteFlag;
+   bool theWildCardDeleteFlag;
+   
+
+   void generate(bool createAsDirectoryFlag);
+};
+#endif
diff --git a/ossim/include/ossim/base/ossimTextProperty.h b/include/ossim/base/ossimTextProperty.h
similarity index 100%
rename from ossim/include/ossim/base/ossimTextProperty.h
rename to include/ossim/base/ossimTextProperty.h
diff --git a/ossim/include/ossim/base/ossimThinPlateSpline.h b/include/ossim/base/ossimThinPlateSpline.h
similarity index 100%
rename from ossim/include/ossim/base/ossimThinPlateSpline.h
rename to include/ossim/base/ossimThinPlateSpline.h
diff --git a/ossim/include/ossim/base/ossimThreeParamDatum.h b/include/ossim/base/ossimThreeParamDatum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimThreeParamDatum.h
rename to include/ossim/base/ossimThreeParamDatum.h
diff --git a/ossim/include/ossim/base/ossimTieGpt.h b/include/ossim/base/ossimTieGpt.h
similarity index 100%
rename from ossim/include/ossim/base/ossimTieGpt.h
rename to include/ossim/base/ossimTieGpt.h
diff --git a/ossim/include/ossim/base/ossimTieGptSet.h b/include/ossim/base/ossimTieGptSet.h
similarity index 100%
rename from ossim/include/ossim/base/ossimTieGptSet.h
rename to include/ossim/base/ossimTieGptSet.h
diff --git a/include/ossim/base/ossimTieMeasurementGeneratorInterface.h b/include/ossim/base/ossimTieMeasurementGeneratorInterface.h
new file mode 100644
index 0000000..a1f28e8
--- /dev/null
+++ b/include/ossim/base/ossimTieMeasurementGeneratorInterface.h
@@ -0,0 +1,84 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimTieMeasurementGeneratorInterface.h
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David hicks
+//
+// Description: OSSIM interface for tie measurement generator plugin.
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimTieMeasurementGeneratorInterface_HEADER
+#define ossimTieMeasurementGeneratorInterface_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <iosfwd>
+
+
+class ossimImageSource;
+
+class ossimTieMeasurementGeneratorInterface
+{
+public:
+
+   /** @brief Virtual destructor defined to squash compiler errors. */
+   virtual ~ossimTieMeasurementGeneratorInterface(){}
+
+   // Initializer
+   virtual bool init(std::ostream& report = std::cout) = 0;
+
+   virtual bool setImageList(std::vector<ossimImageSource*> src) = 0;
+
+   // Define collection ROIs, coordinate system depends on derived class use. List of AOIs
+   // must correspond to the list of images.
+   virtual bool setROIs(std::vector<ossimIrect> roi) = 0;
+
+   virtual bool isValidCollectionBox() const = 0;
+
+   // Measurement collection
+   virtual bool run() = 0;
+
+   // Report run parameters
+   virtual void summarizeRun() const = 0;
+   
+   // Patch grid configuration accessors
+   virtual void setUseGrid(const bool useGrid) = 0;
+   virtual bool getUseGrid() const = 0;
+   virtual bool setGridSize(const ossimIpt& gridDimensions) = 0;
+   virtual ossimIpt getGridSize() const = 0;
+
+   // Max matches in patch accessors
+   virtual bool setMaxMatches(const int& maxMatches) = 0;
+   virtual int getMaxMatches() const = 0;
+
+   // Set the feature detector
+   virtual bool setFeatureDetector(const ossimString& name) = 0;
+   virtual ossimString getFeatureDetector() const  = 0;
+   
+   // Set the descriptor-extractor
+   virtual bool setDescriptorExtractor(const ossimString& name) = 0;
+   virtual ossimString getDescriptorExtractor() const  = 0;
+   
+   // Set the matcher
+   virtual bool setDescriptorMatcher(const ossimString& name) = 0;
+   virtual ossimString getDescriptorMatcher() const  = 0;
+   
+   // Measured point access
+   virtual int numMeasurements() const = 0;
+   virtual ossimDpt pointIndexedAt(const ossim_uint32 imgIdx,
+                                   const ossim_uint32 measIdx) = 0;
+
+   // OpenCV drawMatches window
+   virtual void closeCvWindow(const bool waitKeyPress = false) = 0;
+   virtual void setShowCvWindow(const bool showCvWindow) = 0;
+   virtual bool getShowCvWindow() const = 0;
+
+};
+
+#endif /* #ifndef ossimTieMeasurementGeneratorInterface_HEADER */
diff --git a/include/ossim/base/ossimTiffConstants.h b/include/ossim/base/ossimTiffConstants.h
new file mode 100644
index 0000000..aeaf217
--- /dev/null
+++ b/include/ossim/base/ossimTiffConstants.h
@@ -0,0 +1,186 @@
+//---
+//
+// License: MIT
+//
+// Description: TIFF constants. Here for stand alone code; i.e.,
+// code that does not use libtiff.
+// 
+//---
+// $Id$
+
+#ifndef ossimTiffConstants_HEADER
+#define ossimTiffConstants_HEADER 1
+
+namespace ossim
+{
+   /**
+    * Anonymous enumerations.  Note prefixed with 'O' to avoid conflict with
+    * libtiff.
+    */
+   enum
+   {
+      OPIXEL_IS_AREA                      = 1,
+      OPIXEL_IS_POINT                     = 2,
+      OTIFFTAG_SUBFILETYPE                = 254,
+      OTIFFTAG_IMAGEWIDTH                 = 256,
+      OTIFFTAG_IMAGELENGTH                = 257,
+      OTIFFTAG_BITSPERSAMPLE              = 258,
+      OTIFFTAG_COMPRESSION                = 259,
+      OTIFFTAG_PHOTOMETRIC                = 262,
+      OTIFFTAG_FILLORDER                  = 266,
+      OTIFFTAG_IMAGEDESCRIPTION           = 270,
+      OTIFFTAG_MAKE                       = 271,
+      OTIFFTAG_MODEL                      = 272,
+      OTIFFTAG_STRIPOFFSETS               = 273,
+      OTIFFTAG_ORIENTATION                = 274,
+      OTIFFTAG_SAMPLESPERPIXEL            = 277,
+      OTIFFTAG_ROWSPERSTRIP               = 278,
+      OTIFFTAG_STRIPBYTECOUNTS            = 279,
+      OTIFFTAG_MINSAMPLEVALUE             = 280,
+      OTIFFTAG_MAXSAMPLEVALUE             = 281,
+      OTIFFTAG_XRESOLUTION                = 282,
+      OTIFFTAG_YRESOLUTION                = 283,
+
+      OTIFFTAG_PLANARCONFIG               = 284,
+      OTIFFTAG_PLANARCONFIG_CONTIG        = 1,
+      OTIFFTAG_PLANARCONFIG_SEPARATE      = 2,
+      
+      OTIFFTAG_RESOLUTIONUNIT             = 296,
+      OTIFFTAG_PAGENUMBER                 = 297,
+      OTIFFTAG_SOFTWARE                   = 305,
+
+      // FORMAT is YYYY:MM:DD HH:MM:SS
+      OTIFFTAG_DATETIME                   = 306,
+      
+      OTIFFTAG_ARTIST                     = 315,
+      OTIFFTAG_PREDICTOR                  = 317,      
+      OTIFFTAG_SUBIFD                     = 330,
+      OTIFFTAG_TILEWIDTH                  = 322,
+      OTIFFTAG_TILELENGTH                 = 323,
+      OTIFFTAG_TILEOFFSETS                = 324,
+      OTIFFTAG_TILEBYTECOUNTS             = 325,
+      OTIFFTAG_EXTRASAMPLES               = 338,
+      OTIFFTAG_SAMPLEFORMAT               = 339,
+      OTIFFTAG_SMINSAMPLEVALUE            = 340,
+      OTIFFTAG_SMAXSAMPLEVALUE            = 341,
+      OTIFFTAG_XMLPACKET                  = 700,
+      OSAMPLEFORMAT_UINT                  = 1,
+      OSAMPLEFORMAT_INT                   = 2,
+      OSAMPLEFORMAT_IEEEFP                = 3,
+      OSAMPLEFORMAT_VOID                  = 4,
+      OSAMPLEFORMAT_COMPLEXINT            = 5,
+      OSAMPLEFORMAT_COMPLEXIEEEFP         = 6,
+
+      OGT_MODEL_TYPE_GEO_KEY              = 1024,
+      OGT_RASTER_TYPE_GEO_KEY             = 1025,
+      OGT_CITATION_GEO_KEY                = 1026,
+      OGEOGRAPHIC_TYPE_GEO_KEY            = 2048,
+      OGEOG_CITATION_GEO_KEY              = 2049,
+      OGEOG_GEODETIC_DATUM_GEO_KEY        = 2050,
+      OGEOG_PRIME_MERIDIAN_GEOKEY         = 2051,
+      OGEOG_LINEAR_UNITS_GEO_KEY          = 2052,
+      OGEOG_ANGULAR_UNITS_GEO_KEY         = 2054,
+      OGEOG_ANGULAR_UNIT_SIZE_GEO_KEY     = 2055,
+      OGEOG_ELLIPSOID_GEO_KEY             = 2056,
+      OGEOG_SEMI_MAJOR_AXIS               = 2057,
+      OGEOG_SEMI_MINOR_AXIS               = 2058,
+      OGEOG_INV_FLATTENING_GEO_KEY        = 2059,
+      OGEOG_PRIME_MERIDIAN_LONG_GEO_KEY   = 2061,
+      OPROJECTED_CS_TYPE_GEO_KEY          = 3072,
+      OPCS_CITATION_GEO_KEY               = 3073,
+      OPROJECTION_GEO_KEY                 = 3074,
+      OPROJ_COORD_TRANS_GEO_KEY           = 3075,
+      OPROJ_LINEAR_UNITS_GEO_KEY          = 3076,
+      OPROJ_LINEAR_UNIT_SIZE_GEO_KEY      = 3077,
+      OPROJ_STD_PARALLEL1_GEO_KEY         = 3078,
+      OPROJ_STD_PARALLEL2_GEO_KEY         = 3079,
+      OPROJ_NAT_ORIGIN_LONG_GEO_KEY       = 3080,
+      OPROJ_NAT_ORIGIN_LAT_GEO_KEY        = 3081,
+      OPROJ_FALSE_EASTING_GEO_KEY         = 3082,
+      OPROJ_FALSE_NORTHING_GEO_KEY        = 3083,
+      OPROJ_FALSE_ORIGIN_LONG_GEO_KEY     = 3084,
+      OPROJ_FALSE_ORIGIN_LAT_GEO_KEY      = 3085,
+      OPROJ_FALSE_ORIGIN_EASTING_GEO_KEY  = 3086,
+      OPROJ_FALSE_ORIGIN_NORTHING_GEO_KEY = 3087,
+      OPROJ_CENTER_LONG_GEO_KEY           = 3088,
+      OPROJ_CENTER_LAT_GEO_KEY            = 3089,
+      OPROJ_SCALE_AT_NAT_ORIGIN_GEO_KEY   = 3092,
+      OPROJ_SCALE_AT_CENTER_GEO_KEY       = 3093,
+      OVERTICAL_Cs_TYPE_GEO_KEY           = 4096,
+      OVERTICAL_CITATION_GEO_KEY          = 4097,
+      OVERTICAL_DATUM_GEO_KEY             = 4098,
+      OVERTICAL_UNITS_GEO_KEY             = 4099,
+      OLINEAR_METER                       = 9001,
+      OLINEAR_FOOT                        = 9002,
+      OLINEAR_FOOT_US_SURVEY              = 9003,
+      OANGULAR_DEGREE                     = 9102,
+      OANGULAR_ARC_MINUTE                 = 9103,
+      OANGULAR_ARC_SECOND                 = 9104,
+      OANGULAR_GRAD                       = 9105,
+      OANGULAR_GON                        = 9106,
+      OANGULAR_DMS                        = 9107,
+      OANGULAR_DMS_HEMISPHERE             = 9108,
+      OPCS_BRITISH_NATIONAL_GRID          = 27700,
+      OUSER_DEFINED                       = 32767,
+      OTIFFTAG_COPYRIGHT                  = 33432,
+      OMODEL_PIXEL_SCALE_TAG              = 33550,
+      OMODEL_TIE_POINT_TAG                = 33922,
+      OMODEL_TRANSFORM_TAG                = 34264,
+      OTIFFTAG_PHOTOSHOP                  = 34377,
+      OGEO_KEY_DIRECTORY_TAG              = 34735,
+      OGEO_DOUBLE_PARAMS_TAG              = 34736,
+      OGEO_ASCII_PARAMS_TAG               = 34737,
+      OGDAL_METADATA_TAG                  = 42112,
+      OGDAL_NODATA                        = 42113,
+      ORPC_COEFFICIENT_TAG                = 50844
+   };
+
+   enum CompressType
+   {
+      COMPRESSION_NONE = 1
+   };
+ 
+   enum PhotoInterpretation
+   {
+      OPHOTO_MINISWHITE  = 0,   // min value is white 
+      OPHOTO_MINISBLACK  = 1,   // min value is black 
+      OPHOTO_RGB         = 2,   // RGB color model 
+      OPHOTO_PALETTE     = 3,   // color map indexed 
+      OPHOTO_MASK        = 4,   // $holdout mask 
+      OPHOTO_SEPARATED   = 5,   // !color separations 
+      OPHOTO_YCBCR       = 6,   // !CCIR 601 
+      OPHOTO_CIELAB      = 7    // !1976 CIE L*a*b*
+   };
+
+   enum ModelType
+   {
+      UNKNOWN                = 0,
+      OMODEL_TYPE_PROJECTED  = 1,  // Projection Coordinate System
+      OMODEL_TYPE_GEOGRAPHIC = 2,  // Geographic latitude-longitude System 
+      OMODEL_TYPE_GEOCENTRIC = 3
+   };
+
+   enum
+   {
+      OTIFF_NOTYPE = 0,      /* placeholder */
+      OTIFF_BYTE = 1,        /* 8-bit unsigned integer */
+      OTIFF_ASCII = 2,       /* 8-bit bytes w/ last byte null */
+      OTIFF_SHORT = 3,       /* 16-bit unsigned integer */
+      OTIFF_LONG = 4,        /* 32-bit unsigned integer */
+      OTIFF_RATIONAL = 5,    /* 64-bit unsigned fraction */
+      OTIFF_SBYTE = 6,       /* !8-bit signed integer */
+      OTIFF_UNDEFINED = 7,   /* !8-bit untyped data */
+      OTIFF_SSHORT = 8,      /* !16-bit signed integer */
+      OTIFF_SLONG = 9,       /* !32-bit signed integer */
+      OTIFF_SRATIONAL = 10,  /* !64-bit signed fraction */
+      OTIFF_FLOAT = 11,      /* !32-bit IEEE floating point */
+      OTIFF_DOUBLE = 12,     /* !64-bit IEEE floating point */
+      OTIFF_IFD = 13,        /* %32-bit unsigned integer (offset) */
+      OTIFF_LONG8 = 16,      /* BigTIFF 64-bit unsigned integer */
+      OTIFF_SLONG8 = 17,     /* BigTIFF 64-bit signed integer */
+      OTIFF_IFD8 = 18        /* BigTIFF 64-bit unsigned integer (offset) */
+   };
+   
+} // End: namespace ossim
+
+#endif /* End of "#ifndef ossimTiffConstants_HEADER" */
diff --git a/include/ossim/base/ossimTileHash.h b/include/ossim/base/ossimTileHash.h
new file mode 100644
index 0000000..faf0b36
--- /dev/null
+++ b/include/ossim/base/ossimTileHash.h
@@ -0,0 +1,46 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken Copied from TiledImageHash.
+//
+// Description: Hashing function for tiled rectangles.  Will hash a
+//              dpt or fpt to a single index value.
+//
+// NOTE:  Works on rectangles that are positive in the line up (y)
+//        direction.  Use TiledImageHash for rectangles that are positive
+//        in the line down direction.
+//              
+//*******************************************************************
+//  $Id: ossimTileHash.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef TileHash_HEADER
+#define TileHash_HEADER
+
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimPointHash.h>
+
+class OSSIMDLLEXPORT ossimTileHash : public ossimPointHash
+{
+public:
+   ossimTileHash(const ossimDrect &imageRect,
+                 double tileWidth,
+                 double tileHeight);
+
+   virtual ~ossimTileHash();
+
+   virtual long operator()(const ossimDpt &aPoint);
+   virtual long operator()(const ossimFpt &aPoint);
+   
+private:
+   ossimDrect   theImageRect;
+   double  theTileWidth;
+   double  theTileHeight;
+   long    theNumberOfHorizTiles;
+   long    theNumberOfVertTiles;
+};
+
+#endif
diff --git a/include/ossim/base/ossimTiledImageHash.h b/include/ossim/base/ossimTiledImageHash.h
new file mode 100644
index 0000000..6531c45
--- /dev/null
+++ b/include/ossim/base/ossimTiledImageHash.h
@@ -0,0 +1,40 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description: Hashing function for tiled rectangles.  Will hash a
+//              dpt to a single index value.
+//              
+//*******************************************************************
+//  $Id: ossimTiledImageHash.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimTiledImageHash_HEADER
+#define ossimTiledImageHash_HEADER
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimPointHash.h>
+
+class OSSIMDLLEXPORT ossimTiledImageHash : public ossimPointHash
+{
+public:
+   ossimTiledImageHash(const ossimDrect &imageRect,
+                       double tileWidth,
+                       double tileHeight);
+
+   virtual ~ossimTiledImageHash();
+
+   virtual long operator()(const ossimDpt &aPoint);
+   virtual long operator()(const ossimFpt &aPoint);
+   
+private:
+   ossimDrect   theImageRect;
+   double  theTileWidth;
+   double  theTileHeight;
+   long    theNumberOfHorizTiles;
+   long    theNumberOfVertTiles;
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimTimer.h b/include/ossim/base/ossimTimer.h
similarity index 100%
rename from ossim/include/ossim/base/ossimTimer.h
rename to include/ossim/base/ossimTimer.h
diff --git a/ossim/include/ossim/base/ossimTrace.h b/include/ossim/base/ossimTrace.h
similarity index 100%
rename from ossim/include/ossim/base/ossimTrace.h
rename to include/ossim/base/ossimTrace.h
diff --git a/include/ossim/base/ossimTraceManager.h b/include/ossim/base/ossimTraceManager.h
new file mode 100644
index 0000000..d01829f
--- /dev/null
+++ b/include/ossim/base/ossimTraceManager.h
@@ -0,0 +1,69 @@
+//*****************************************************************************
+// Copyright (C) 2005 Garrett Potts, all rights reserved.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+// 
+// DESCRIPTION:
+//   Contains declaration of class ossimTraceManager.
+//
+//*****************************************************************************
+// $Id: ossimTraceManager.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimTraceManager_HEADER
+#define ossimTraceManager_HEADER
+
+#include <ossim/base/ossimString.h>
+
+class ossimTrace;
+
+class OSSIMDLLEXPORT ossimTraceManager
+{
+public:
+   /**
+    * @return ossimTraceManager* to instance of the ossim trace manager.
+    */
+   static ossimTraceManager* instance();
+
+   /**
+    * Sets "thePattern" to "pattern", then calls setTraceFlags(true).
+    *
+    * @param pattern Regular expression to enable trace for.
+    */
+   void setTracePattern(const ossimString& pattern);
+
+   /**
+    * @param traceObj ossimTrace* to add to "theTraceList".
+    */
+   void addTrace(ossimTrace* traceObj);
+
+   /**
+    * @param traceObj ossimTrace* to remove from "theTraceList".
+    */
+   void removeTrace(ossimTrace* traceObj);
+   
+protected:
+   /** Protected default constructor. */
+   ossimTraceManager();
+
+private:
+   /**
+    * Loops through "theTraceList" and sets any trace object's enable flag to
+    * flag if it matches regular expression of "thePattern".
+    * For trace objects not matching "thePattern" no action is taken.
+    */
+   void setTraceFlags(bool flag);
+
+   /** The instance of this manager. */
+   static ossimTraceManager* theInstance;
+
+   /** The regular expression pattern like "ossimDynamic|ossimGdal". */
+   ossimString               thePattern;
+
+   /** The list of trace objects. */
+   std::vector<ossimTrace*>  theTraceList;
+};
+
+#endif
diff --git a/include/ossim/base/ossimUnitConversionTool.h b/include/ossim/base/ossimUnitConversionTool.h
new file mode 100644
index 0000000..274e7e4
--- /dev/null
+++ b/include/ossim/base/ossimUnitConversionTool.h
@@ -0,0 +1,80 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimUnitConversionTool.h 10378 2007-01-26 14:27:21Z gpotts $
+#ifndef ossimUnitConversionTool_HEADER
+#define ossimUnitConversionTool_HEADER
+#include <iostream>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimGpt.h>
+
+class OSSIM_DLL ossimUnitConversionTool
+{
+public:
+   friend std::ostream& operator<<(std::ostream& out,
+                                   const ossimUnitConversionTool& data);
+
+   ossimUnitConversionTool(double value=1.0,
+                           ossimUnitType unitType=OSSIM_METERS);
+
+   ossimUnitConversionTool(const ossimGpt& origin,
+                           double value,
+                           ossimUnitType unitType=OSSIM_METERS);
+
+   void setOrigin(const ossimGpt& gpt);
+
+   ossimGpt getOrigin()const;
+
+   void getOrigin(ossimGpt& result)const;
+
+   void setValue(double value, ossimUnitType unitType=OSSIM_METERS);
+
+   double getValue(ossimUnitType unitType=OSSIM_METERS) const;
+   
+   void setMeters(double value);
+   void setRadians(double value);
+   void setDegrees(double value);
+   void setMinutes(double value);
+   void setSeconds(double value);
+   void setUsSurveyFeet(double value);
+   void setFeet(double value);
+   void setNauticalMiles(double value);
+   void setMiles(double value);
+   void setMillimeters(double value);
+   void setMicrons(double value);
+   void setCentimeters(double value);
+   void setYards(double value);
+   void setInches(double value);
+   void setKilometers(double value);
+   double getMeters()const;
+   double getRadians()const;
+   double getDegrees()const;
+   double getMinutes()const;
+   double getSeconds()const;
+   double getUsSurveyFeet()const;
+   double getFeet()const;
+   double getNauticalMiles()const;
+   double getMiles()const;
+   double getMillimeters()const;
+   double getMicrons()const;
+   double getCentimeters()const;
+   double getYards()const;
+   double getInches()const;
+   double getKilometers()const;
+   
+protected:
+   double         theValue;
+   ossimUnitType  theUnitType;
+   ossimGpt       theOrigin;
+
+   double computeMeters()const;
+};
+
+#endif
diff --git a/ossim/include/ossim/base/ossimUnitTypeLut.h b/include/ossim/base/ossimUnitTypeLut.h
similarity index 100%
rename from ossim/include/ossim/base/ossimUnitTypeLut.h
rename to include/ossim/base/ossimUnitTypeLut.h
diff --git a/ossim/include/ossim/base/ossimUrl.h b/include/ossim/base/ossimUrl.h
similarity index 100%
rename from ossim/include/ossim/base/ossimUrl.h
rename to include/ossim/base/ossimUrl.h
diff --git a/ossim/include/ossim/base/ossimUsgsQuad.h b/include/ossim/base/ossimUsgsQuad.h
similarity index 100%
rename from ossim/include/ossim/base/ossimUsgsQuad.h
rename to include/ossim/base/ossimUsgsQuad.h
diff --git a/ossim/include/ossim/base/ossimViewController.h b/include/ossim/base/ossimViewController.h
similarity index 100%
rename from ossim/include/ossim/base/ossimViewController.h
rename to include/ossim/base/ossimViewController.h
diff --git a/ossim/include/ossim/base/ossimViewEvent.h b/include/ossim/base/ossimViewEvent.h
similarity index 100%
rename from ossim/include/ossim/base/ossimViewEvent.h
rename to include/ossim/base/ossimViewEvent.h
diff --git a/ossim/include/ossim/base/ossimViewInterface.h b/include/ossim/base/ossimViewInterface.h
similarity index 100%
rename from ossim/include/ossim/base/ossimViewInterface.h
rename to include/ossim/base/ossimViewInterface.h
diff --git a/ossim/include/ossim/base/ossimViewListener.h b/include/ossim/base/ossimViewListener.h
similarity index 100%
rename from ossim/include/ossim/base/ossimViewListener.h
rename to include/ossim/base/ossimViewListener.h
diff --git a/ossim/include/ossim/base/ossimVisitor.h b/include/ossim/base/ossimVisitor.h
similarity index 100%
rename from ossim/include/ossim/base/ossimVisitor.h
rename to include/ossim/base/ossimVisitor.h
diff --git a/include/ossim/base/ossimVrect.h b/include/ossim/base/ossimVrect.h
new file mode 100644
index 0000000..3948e41
--- /dev/null
+++ b/include/ossim/base/ossimVrect.h
@@ -0,0 +1,167 @@
+//*******************************************************************
+//
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Contains class declaration for vrect.
+// Container class for four double points representing a rectangle
+// where y is up
+// 
+//*******************************************************************
+//  $Id: ossimVrect.h 11955 2007-10-31 16:10:22Z gpotts $
+#ifndef ossimVrect_HEADER
+#define ossimVrect_HEADER
+#include <iostream>
+
+#include <ossim/base/ossimDpt.h>
+
+class OSSIMDLLEXPORT ossimVrect
+{
+public:
+   ossimVrect()
+      :theUlCorner(0.0, 0.0),
+       theLlCorner(0.0, 0.0),
+       theLrCorner(0.0, 0.0),
+       theUrCorner(0.0, 0.0)
+      {}
+   ossimVrect(const ossimDpt &ul,
+         const ossimDpt &lr)
+      :theUlCorner(ul),
+       theLlCorner(ul.x, lr.y),
+       theLrCorner(lr),
+       theUrCorner(lr.x, ul.y)
+      {}
+   ossimVrect(double ul_corner_x,
+         double ul_corner_y,
+         double lr_corner_x,
+         double lr_corner_y)
+      :
+         theUlCorner(ul_corner_x, ul_corner_y),
+         theLlCorner(ul_corner_x, lr_corner_y),
+         theLrCorner(lr_corner_x, lr_corner_y),
+         theUrCorner(lr_corner_x, ul_corner_y)
+      {}
+   ossimVrect(const ossimVrect& rect)
+      :
+         theUlCorner(rect.ul()),
+         theLlCorner(rect.ll()),
+         theLrCorner(rect.lr()),
+         theUrCorner(rect.ur())
+      {}
+
+   ~ossimVrect();
+
+   const ossimVrect& operator=  (const ossimVrect& rect);
+   bool         operator!= (const ossimVrect& rect) const;
+   bool         operator== (const ossimVrect& rect) const;
+   
+   const ossimDpt &ul() const { return theUlCorner; }
+   const ossimDpt &ur() const { return theUrCorner; }
+   const ossimDpt &lr() const { return theLrCorner; }
+   const ossimDpt &ll() const { return theLlCorner; }
+   /*!
+    * Returns the height of a rectangle.
+    */
+   ossim_float64 height() const
+      { return fabs(theLlCorner.y - theUlCorner.y) + 1.0; }
+
+   /*!
+    * Returns the width of a rectangle.
+    */
+   ossim_float64 width()  const
+      { return fabs(theLrCorner.x - theLlCorner.x) + 1.0; }
+   
+   inline ossimDpt midPoint()const;
+   void print(std::ostream& os) const;
+   
+   ossimVrect combine(const ossimVrect& rect)const;
+   inline ossimVrect clipToRect(const ossimVrect& rect)const;
+
+   friend std::ostream& operator<<(std::ostream& os, const ossimVrect& rect);
+
+private:
+   ossimDpt theUlCorner;
+   ossimDpt theLlCorner;
+   ossimDpt theLrCorner;
+   ossimDpt theUrCorner;
+};
+
+inline const ossimVrect& ossimVrect::operator=(const ossimVrect& rect)
+{
+   if (this != &rect)
+   {
+      theUlCorner = rect.ul();
+      theUrCorner = rect.ur();
+      theLrCorner = rect.lr();
+      theLlCorner = rect.ll();
+   }
+
+   return *this;
+}
+
+inline bool ossimVrect::operator!=(const ossimVrect& rect) const
+{
+   return ( (theUlCorner != rect.ul()) ||
+            (theUrCorner != rect.ur()) ||
+            (theLrCorner != rect.lr()) ||
+            (theLlCorner != rect.ll()) );
+}
+
+inline bool ossimVrect::operator==(const ossimVrect& rect) const
+{
+   return ( (theUlCorner == rect.ul()) &&
+            (theUrCorner == rect.ur()) &&
+            (theLrCorner == rect.lr()) &&
+            (theLlCorner == rect.ll()) );
+}
+
+
+inline ossimVrect ossimVrect::clipToRect(const ossimVrect& rect)const
+{
+    ossim_float64     ulx, uly, lrx, lry;
+
+    // XXX not replaced with std::max or ossim::max since the test is backward 
+    //     here and will give a different answer in the case of nan.
+    #define d_MAX(a,b)      (((a)>(b)) ? a : b)
+
+    ulx = d_MAX(rect.ul().x,ul().x);
+    uly = d_MAX(rect.ul().y,ul().y);
+
+    #undef d_MAX
+
+    lrx = std::min(rect.lr().x,lr().x);
+    lry = std::min(rect.lr().y,lr().y);
+
+    if( lrx <= ulx || lry <= uly )
+        return ossimVrect(ossimDpt(0,0),ossimDpt(0,0));
+    else
+       return ossimVrect(ulx,uly,lrx,lry);
+}
+
+inline ossimDpt ossimVrect::midPoint()const
+{
+   return ossimDpt( (ul().x + ur().x + ll().x + lr().x)*.25,
+               (ul().y + ur().y + ll().y + lr().y)*.25);
+}
+
+inline ossimVrect ossimVrect::combine(const ossimVrect& rect)const
+{
+   ossimDpt ulCombine;
+   ossimDpt lrCombine;
+   
+   ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
+   ulCombine.y = ((ul().y >= rect.ul().y)?ul().y:rect.ul().y);
+   lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
+   lrCombine.y = ((lr().y <= rect.lr().y)?lr().y:rect.lr().y);
+
+   return ossimVrect(ulCombine, lrCombine);
+}
+
+#endif
diff --git a/ossim/include/ossim/base/ossimWLSBundleSolution.h b/include/ossim/base/ossimWLSBundleSolution.h
similarity index 100%
rename from ossim/include/ossim/base/ossimWLSBundleSolution.h
rename to include/ossim/base/ossimWLSBundleSolution.h
diff --git a/include/ossim/base/ossimWebRequest.h b/include/ossim/base/ossimWebRequest.h
new file mode 100644
index 0000000..d46090b
--- /dev/null
+++ b/include/ossim/base/ossimWebRequest.h
@@ -0,0 +1,28 @@
+#ifndef ossimWebRequest_HEADER
+#define ossimWebRequest_HEADER
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimUrl.h>
+#include <ossim/base/ossimWebResponse.h>
+
+class OSSIM_DLL ossimWebRequest : public ossimObject
+{
+public:
+   ossimWebRequest(){}
+   ossimWebRequest(const ossimUrl& url)
+   :m_url(url)
+   {}
+   const ossimUrl& getUrl()const{return m_url;}
+   virtual bool setUrl(const ossimUrl& url){m_url = url; return true;}
+   void clearLastError(){m_lastError = "";}
+   void clearLastError()const{m_lastError = "";}
+   const ossimString getLastError(){return m_lastError;}
+   virtual ossimRefPtr<ossimWebResponse> getResponse(){return 0;}
+   
+protected:
+   ossimUrl m_url;
+   mutable ossimString m_lastError;
+   
+   TYPE_DATA;
+};
+#endif
diff --git a/ossim/include/ossim/base/ossimWebRequestFactoryBase.h b/include/ossim/base/ossimWebRequestFactoryBase.h
similarity index 100%
rename from ossim/include/ossim/base/ossimWebRequestFactoryBase.h
rename to include/ossim/base/ossimWebRequestFactoryBase.h
diff --git a/ossim/include/ossim/base/ossimWebRequestFactoryRegistry.h b/include/ossim/base/ossimWebRequestFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/base/ossimWebRequestFactoryRegistry.h
rename to include/ossim/base/ossimWebRequestFactoryRegistry.h
diff --git a/ossim/include/ossim/base/ossimWebResponse.h b/include/ossim/base/ossimWebResponse.h
similarity index 100%
rename from ossim/include/ossim/base/ossimWebResponse.h
rename to include/ossim/base/ossimWebResponse.h
diff --git a/ossim/include/ossim/base/ossimWgs72Datum.h b/include/ossim/base/ossimWgs72Datum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimWgs72Datum.h
rename to include/ossim/base/ossimWgs72Datum.h
diff --git a/ossim/include/ossim/base/ossimWgs84Datum.h b/include/ossim/base/ossimWgs84Datum.h
similarity index 100%
rename from ossim/include/ossim/base/ossimWgs84Datum.h
rename to include/ossim/base/ossimWgs84Datum.h
diff --git a/ossim/include/ossim/base/ossimWms.h b/include/ossim/base/ossimWms.h
similarity index 100%
rename from ossim/include/ossim/base/ossimWms.h
rename to include/ossim/base/ossimWms.h
diff --git a/ossim/include/ossim/base/ossimXmlAttribute.h b/include/ossim/base/ossimXmlAttribute.h
similarity index 100%
rename from ossim/include/ossim/base/ossimXmlAttribute.h
rename to include/ossim/base/ossimXmlAttribute.h
diff --git a/ossim/include/ossim/base/ossimXmlDocument.h b/include/ossim/base/ossimXmlDocument.h
similarity index 100%
rename from ossim/include/ossim/base/ossimXmlDocument.h
rename to include/ossim/base/ossimXmlDocument.h
diff --git a/include/ossim/base/ossimXmlNode.h b/include/ossim/base/ossimXmlNode.h
new file mode 100644
index 0000000..f96b04c
--- /dev/null
+++ b/include/ossim/base/ossimXmlNode.h
@@ -0,0 +1,129 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  Oscar Kramer <okramer at imagelinks.com> (ossim port by D. Burken)
+//
+// Description:  
+//
+// Contains declaration of class ossimXmlNode.
+// 
+//*****************************************************************************
+// $Id: ossimXmlNode.h 12527 2008-03-04 17:02:55Z gpotts $
+#ifndef ossimXmlNode_HEADER
+#define ossimXmlNode_HEADER
+
+#include <vector>
+using namespace std;
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimXmlAttribute.h>
+#include <ossim/base/ossimString.h>
+
+
+class OSSIMDLLEXPORT ossimXmlNode : public ossimObject,
+                                    public ossimErrorStatusInterface
+{
+public:
+   typedef std::vector<ossimRefPtr<ossimXmlNode> > ChildListType;
+   typedef std::vector<ossimRefPtr<ossimXmlAttribute> > AttributeListType;
+   
+   ossimXmlNode(istream& xml_stream, ossimXmlNode* parent=0);
+   ossimXmlNode();
+   ossimXmlNode(const ossimXmlNode& src);
+   virtual ossimObject* dup() const
+   {
+      return new ossimXmlNode(*this);
+   }
+	void duplicateAttributes(ossimXmlNode::AttributeListType result)const;
+   void duplicateChildren(ossimXmlNode::ChildListType& result)const;
+   bool read(std::istream& in);
+   // Appends any matching nodes to the list supplied
+   void findChildNodes(const ossimString& rel_xpath,
+                       ossimXmlNode::ChildListType& nodelist)const;
+   // Prefer this version when possible
+   const ossimRefPtr<ossimXmlNode> & findFirstNode(const ossimString& rel_xpath)const;
+   ossimRefPtr<ossimXmlNode> findFirstNode(const ossimString& rel_xpath);
+
+   ossimRefPtr<ossimXmlAttribute> findAttribute(const ossimString& name);
+   const ossimRefPtr<ossimXmlAttribute> findAttribute(const ossimString& name)const;
+   void setTag(const ossimString& tag);
+   ossimString const&               getTag()        const { return theTag; }
+   const ossimXmlNode*              getParentNode() const;
+   ossimXmlNode*              getParentNode();
+   void setParent(ossimXmlNode* parent);
+   const ossimXmlNode::ChildListType&      getChildNodes() const;
+   ossimXmlNode::ChildListType&      getChildNodes();
+   const  ossimXmlNode::AttributeListType& getAttributes() const;
+   bool getAttributeValue(ossimString& value, const ossimString& name)const;
+   ossimString getAttributeValue(const ossimString& name)const
+   {
+      ossimString value;
+      getAttributeValue(value, name);
+      return value;
+   }
+   bool getChildTextValue(ossimString& value,
+                          const ossimString& relPath)const;
+   ossimString getChildTextValue(const ossimString& relPath)const
+   {
+      ossimString value;
+      getChildTextValue(value, relPath);
+      return value;
+   }
+   void addAttribute(ossimRefPtr<ossimXmlAttribute> attribute);
+   void addAttribute(const ossimString& name, const ossimString& value);
+   bool setAttribute(const ossimString& name,
+                     const ossimString& value,
+                     bool addIfNotPresentFlag=false);
+   ossimRefPtr<ossimXmlNode> addNode(const ossimString& relPath,
+                                     const ossimString& text = "");
+   ossimRefPtr<ossimXmlNode> addOrSetNode(const ossimString& relPath,
+                                          const ossimString& text = "");
+   void addChildNode(ossimRefPtr<ossimXmlNode> node);
+   ossimRefPtr<ossimXmlNode> addChildNode(const ossimString& tagName,
+                                          const ossimString& text="");
+   void addChildren(ossimXmlNode::ChildListType& children);
+   void setChildren(ossimXmlNode::ChildListType& children);
+   void addAttributes(ossimXmlNode::AttributeListType& children);
+   void setAttributes(ossimXmlNode::AttributeListType& children);
+   void setText(const ossimString& text);
+   const ossimString&                      getText()       const { return theText; }
+   bool cdataFlag()const;
+   void setCDataFlag(bool value);
+   OSSIMDLLEXPORT friend ostream& operator << (ostream& os, const ossimXmlNode* xml_node);
+   OSSIMDLLEXPORT friend ostream& operator << (ostream& os, const ossimXmlNode& xml_node);
+
+   ossimRefPtr<ossimXmlNode> removeChild(ossimRefPtr<ossimXmlNode> node);
+   ossimRefPtr<ossimXmlNode> removeChild(const ossimString& tag);
+   void clear();
+   void clearChildren();
+   void clearAttributes();
+   
+   void toKwl(ossimKeywordlist& kwl,
+              const ossimString& prefix="")const;
+   void fromKwl(const ossimKeywordlist& kwlToConvert);
+  
+protected:
+   ~ossimXmlNode();
+   bool readTag(std::istream& in,
+                ossimString& tag);
+   bool readTextContent(std::istream& in);
+   bool readEndTag(std::istream& in,
+                   ossimString& endTag);
+
+   void skipCommentTag(std::istream& in);
+   bool readCDataContent(std::istream& in);
+   ossimString                 theTag;
+   ossimXmlNode*         theParentNode;
+   vector<ossimRefPtr<ossimXmlNode> >      theChildNodes;
+   vector<ossimRefPtr<ossimXmlAttribute> >  theAttributes;
+   ossimString                 theText;
+   bool                        theCDataFlag;
+/*    ossimString                 theCData; */
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimXmlNode_HEADER */
diff --git a/ossim/include/ossim/base/ossimXmlString.h b/include/ossim/base/ossimXmlString.h
similarity index 100%
rename from ossim/include/ossim/base/ossimXmlString.h
rename to include/ossim/base/ossimXmlString.h
diff --git a/include/ossim/elevation/ossimDtedElevationDatabase.h b/include/ossim/elevation/ossimDtedElevationDatabase.h
new file mode 100644
index 0000000..1697485
--- /dev/null
+++ b/include/ossim/elevation/ossimDtedElevationDatabase.h
@@ -0,0 +1,87 @@
+#ifndef ossimDtedElevationDatabase_HEADER
+#define ossimDtedElevationDatabase_HEADER 1
+
+#include <ossim/elevation/ossimElevationCellDatabase.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/elevation/ossimDtedHandler.h>
+#include <OpenThreads/Mutex>
+
+class OSSIM_DLL ossimDtedElevationDatabase : public ossimElevationCellDatabase
+{
+public:
+   typedef std::vector<ossimRefPtr<CellInfo> > DirectMap; // 360x180 cell grid
+   
+   ossimDtedElevationDatabase();
+
+   ossimDtedElevationDatabase(const ossimDtedElevationDatabase& rhs);
+
+   virtual ~ossimDtedElevationDatabase();
+
+   virtual ossimObject* dup() const;
+
+   virtual bool open(const ossimString& connectionString);
+   virtual bool pointHasCoverage(const ossimGpt& gpt) const
+   {
+      ossimFilename filename;
+      createFullPath(filename, gpt);
+      
+      return filename.exists();
+   }
+   
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
+   virtual double getHeightAboveMSL(const ossimGpt&);
+   virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
+   virtual ossim_uint64 createId(const ossimGpt& pt)const
+   {
+      ossim_uint64 y = static_cast<ossim_uint64>(ossim::wrap(pt.latd(), -90.0, 90.0)+90.0);
+      ossim_uint64 x = static_cast<ossim_uint64>(ossim::wrap(pt.lond(),-180.0,180.0)+180.0);
+      // map the extreme edge to the same ID ax the 179 west cell and the same for the 89
+      // degree north cell.
+      //
+      x = x==360?359:x;
+      y = y==180?179:y;
+      // dted databases are 1x1 degree cells and we will use a world 
+      // grid for id generation.
+      //
+      return (y*360+x);
+   }
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix = 0)const;
+   
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+   bool openDtedDirectory(const ossimFilename& dir);
+
+   void createRelativePath(ossimFilename& file, const ossimGpt& gpt)const;
+
+   void createFullPath(ossimFilename& file, const ossimGpt& gpt)const
+   {
+      ossimFilename relativeFile;
+      createRelativePath(relativeFile, gpt);
+      file = ossimFilename(m_connectionString).dirCat(relativeFile);
+   }
+
+   virtual ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& gpt);
+
+   /**
+    * @brief Scans directory and set m_extension to extension of first dted
+    * file found.
+    * @param dir Directory to scan.
+    * @return true on success, false on error.
+    */
+   bool inititializeExtension( const ossimFilename& dir );
+
+   // DTED extension. E.g. ".dt2", ".dt1", ".dt0"
+   ossimString m_extension;
+
+   // Upcase or not when scanning for file.  E.g. E045/N34.DT2 or e045/n34.dt2
+   bool m_upcase;
+
+   ossimRefPtr<ossimElevCellHandler> m_lastHandler;
+   mutable OpenThreads::Mutex m_mutex;
+    
+
+TYPE_DATA
+};
+#endif
diff --git a/include/ossim/elevation/ossimDtedFactory.h b/include/ossim/elevation/ossimDtedFactory.h
new file mode 100644
index 0000000..62e47c9
--- /dev/null
+++ b/include/ossim/elevation/ossimDtedFactory.h
@@ -0,0 +1,38 @@
+//*****************************************************************************
+// FILE: ossimDtedFactory.cc
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration for ossimDtedFactory.
+// This is the base class interface for elevation cell factories.
+//*****************************************************************************
+// $Id: ossimDtedFactory.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimDtedFactory_HEADER
+#define ossimDtedFactory_HEADER
+
+#include <ossim/elevation/ossimElevSourceFactory.h>
+
+/** CLASS:  ossimDtedFactory */
+class OSSIM_DLL ossimDtedFactory : public ossimElevSourceFactory
+{
+public:
+
+   ossimDtedFactory();
+   ossimDtedFactory(const ossimFilename& dir);
+      
+
+   virtual ossimElevSource* getNewElevSource(const ossimGpt& gpt) const;
+   virtual void createIndex();
+protected:
+   virtual ~ossimDtedFactory();
+
+TYPE_DATA
+};
+
+#endif /* End of "#ifndef ossimDtedFactory_HEADER" */
diff --git a/include/ossim/elevation/ossimDtedHandler.h b/include/ossim/elevation/ossimDtedHandler.h
new file mode 100644
index 0000000..5a10142
--- /dev/null
+++ b/include/ossim/elevation/ossimDtedHandler.h
@@ -0,0 +1,247 @@
+//*****************************************************************************
+// FILE: ossimDtedHandler.h
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION:
+//   Contains declaration of class ossimDtedHandler. This class derives from
+//   ossimElevHandler. It is responsible for loading an individual DTED cell
+//   from disk. This elevation files are memory mapped.
+//
+// SOFTWARE HISTORY:
+//>
+//   05Feb2001  Ken Melero
+//              Initial coding of ossimDted.h
+//   19Apr2001  Oscar Kramer
+//              Derived from ossimElevCellHandler.
+//<
+//*****************************************************************************
+// $Id: ossimDtedHandler.h 23497 2015-08-28 15:28:59Z okramer $
+
+#ifndef ossimDtedHandler_HEADER
+#define ossimDtedHandler_HEADER
+
+#include <fstream>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/elevation/ossimElevCellHandler.h>
+#include <OpenThreads/Mutex>
+#include <ossim/support_data/ossimDtedVol.h>
+#include <ossim/support_data/ossimDtedHdr.h>
+#include <ossim/support_data/ossimDtedUhl.h>
+#include <ossim/support_data/ossimDtedDsi.h>
+#include <ossim/support_data/ossimDtedAcc.h>
+#include <ossim/support_data/ossimDtedRecord.h>
+
+class OSSIM_DLL ossimDtedHandler : public ossimElevCellHandler
+{
+public:
+
+   /// number of Dted posts per point.
+   static const int TOTAL_POSTS = 4;
+   /// number of Dted posts per block
+   static const int NUM_POSTS_PER_BLOCK= 2;
+
+   /// ossimDtedHandler
+   ossimDtedHandler()
+   {
+   }
+
+   ossimDtedHandler(const ossimFilename& dted_file, bool memoryMapFlag=false);
+
+   enum
+   {
+      DATA_RECORD_OFFSET_TO_POST = 8,     // bytes
+      DATA_RECORD_CHECKSUM_SIZE  = 4,     // bytes
+      POST_SIZE                  = 2,     // bytes
+      NULL_POST                  = -32767 // Fixed by DTED specification.
+   };
+
+   virtual bool open(const ossimFilename& file, bool memoryMapFlag=false);
+   virtual bool open(std::shared_ptr<ossim::istream>& fileStr, const std::string& connectionString, bool memoryMapFlag=false);
+   virtual void close();
+   
+   /*!
+    * METHOD: getHeightAboveMSL
+    * Height access methods.
+    */
+   virtual double getHeightAboveMSL(const ossimGpt&);
+
+   /*!
+    *  METHOD:  getSizeOfElevCell
+    *  Returns the number of post in the cell.  Satisfies pure virtual.
+    *  Note:  x = longitude, y = latitude
+    */
+   virtual ossimIpt getSizeOfElevCell() const;
+      
+   /*!
+    *  METHOD:  getPostValue
+    *  Returns the value at a given grid point as a double.
+    *  Satisfies pure virtual.
+    */
+   virtual double getPostValue(const ossimIpt& gridPt) const;
+
+   ossimString  edition()         const;
+   ossimString  productLevel()    const;
+   ossimString  compilationDate() const;
+
+   virtual bool isOpen()const;
+   
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
+   
+   const ossimDtedVol& vol()const
+   {
+      return *m_vol;
+   }
+   const ossimDtedHdr& hdr()const
+   {
+      return *m_hdr;
+   }
+   const ossimDtedUhl& uhl()const
+   {
+      return *m_uhl;
+   }
+   const ossimDtedDsi& dsi()const
+   {
+      return *m_dsi;
+   }
+   const ossimDtedAcc& acc()const
+   {
+      return *m_acc;
+   }
+
+   virtual ossimObject* dup () const
+   {
+      return new ossimDtedHandler(this->getFilename(), (m_memoryMap.size() != 0));
+   }
+
+   virtual ~ossimDtedHandler();
+
+protected:
+
+   /// DtedPost, this class contains the height, weighting factor and status
+   class DtedPost
+   {
+   public:
+     // constructor - initialise variables
+     DtedPost():
+       m_height(0),
+       m_weight(0),
+       m_status(false)
+     {
+     }
+     // destructor
+     virtual ~DtedPost();
+     // member variables
+     double m_height;
+     double m_weight;
+     bool m_status;
+   };
+
+   /// DtedHeight is a class for storing DTED information
+   /// - 4 posts are used to generate an interpolated height value.
+   class DtedHeight
+   {
+   public:
+     // constructor
+     DtedHeight();
+     // destructor
+     virtual ~DtedHeight();
+     // calculate the interpolated Height for the posts
+     double calcHeight();
+     // debug
+     void debug();
+     // post data
+     DtedPost m_posts[TOTAL_POSTS];
+   };
+
+
+  // Disallow operator= and copy construction...
+   const ossimDtedHandler& operator=(const ossimDtedHandler& rhs);
+   ossimDtedHandler(const ossimDtedHandler&);
+
+   /*!
+    *  If statistics file exist, stats will be initialized from that; else,
+    *  this scans the dted cell and gets stats, then, writes new stats file.
+    *  The statistics file will be named accordingly:
+    *  If dted cell = n27.dt1 then the stats file = n27.statistics.
+    *  Currently method only grabs the min and max posts value.
+    */
+   void gatherStatistics();
+
+   ossim_sint16 convertSignedMagnitude(ossim_uint16& s) const;
+   virtual double getHeightAboveMSL(const ossimGpt&, bool readFromFile);
+
+  /**
+   * read the height posts from the File
+   * @param postData - post heights, status & weight
+   * @param offset - file contents offset to start reading from
+   */
+   void readPostsFromFile(DtedHeight &postData, int offset);
+
+   mutable OpenThreads::Mutex m_fileStrMutex;
+  // mutable std::ifstream m_fileStr;
+   mutable std::shared_ptr<ossim::istream> m_fileStr;
+   mutable std::string m_connectionString;
+
+   ossim_int32      m_numLonLines;  // east-west dir
+   ossim_int32      m_numLatPoints; // north-south
+   ossim_int32      m_dtedRecordSizeInBytes;
+   ossimString      m_edition;
+   ossimString      m_productLevel;
+   ossimString      m_compilationDate;
+   ossim_int32      m_offsetToFirstDataRecord;
+   double           m_latSpacing;   // degrees
+   double           m_lonSpacing;   // degrees
+   ossimDpt         m_swCornerPost; // cell origin;
+
+   // Indicates whether byte swapping is needed.
+   bool m_swapBytesFlag;
+
+   mutable OpenThreads::Mutex m_memoryMapMutex;
+   mutable std::vector<ossim_uint8> m_memoryMap;
+   
+   std::shared_ptr<ossimDtedVol> m_vol;
+   std::shared_ptr<ossimDtedHdr> m_hdr;
+   std::shared_ptr<ossimDtedUhl> m_uhl;
+   std::shared_ptr<ossimDtedDsi> m_dsi;
+   std::shared_ptr<ossimDtedAcc> m_acc;
+   
+   TYPE_DATA
+};
+
+inline ossim_sint16 ossimDtedHandler::convertSignedMagnitude(ossim_uint16& s) const
+{
+   // DATA_VALUE_MASK 0x7fff = 0111 1111 1111 1111
+   // DATA_SIGN_MASK  0x8000 = 1000 0000 0000 0000
+   
+   // First check to see if the bytes need swapped.
+   s = (m_swapBytesFlag ? ( ((s & 0x00ff) << 8) | ((s & 0xff00) >> 8) ) : s);
+   
+   // If the sign bit is set, mask it out then multiply by negative one.
+   if (s & 0x8000)
+   {
+      return (static_cast<ossim_sint16>(s & 0x7fff) * -1);
+   }
+   
+   return static_cast<ossim_sint16>(s);
+}
+
+inline bool ossimDtedHandler::isOpen()const
+{
+
+  if(!m_memoryMap.empty()) return true;
+  OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_fileStrMutex);
+
+
+  return (m_fileStr != 0);
+}
+
+inline void ossimDtedHandler::close()
+{
+   m_fileStr.reset();
+   m_memoryMap.clear();
+}
+
+#endif
diff --git a/ossim/include/ossim/elevation/ossimElevCellHandler.h b/include/ossim/elevation/ossimElevCellHandler.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevCellHandler.h
rename to include/ossim/elevation/ossimElevCellHandler.h
diff --git a/ossim/include/ossim/elevation/ossimElevCellHandlerFactory.h b/include/ossim/elevation/ossimElevCellHandlerFactory.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevCellHandlerFactory.h
rename to include/ossim/elevation/ossimElevCellHandlerFactory.h
diff --git a/ossim/include/ossim/elevation/ossimElevLess.h b/include/ossim/elevation/ossimElevLess.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevLess.h
rename to include/ossim/elevation/ossimElevLess.h
diff --git a/include/ossim/elevation/ossimElevManager.h b/include/ossim/elevation/ossimElevManager.h
new file mode 100644
index 0000000..add6721
--- /dev/null
+++ b/include/ossim/elevation/ossimElevManager.h
@@ -0,0 +1,196 @@
+//*****************************************************************************
+// FILE: ossimElevManager.h
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION:
+//   Contains declaration of class ossimElevManager. This object provides a
+//   single interface to an imaging chain for accessing multiple elevation
+//   sources. This object owns one or more elevation sources in an ordered
+//   list. When queried for an elevation at a particular point, it searches
+//   the available sources for the best result, instantiating new sources if
+//   necessary.
+//
+// SOFTWARE HISTORY:
+//>
+//   13Apr2001  Oscar Kramer
+//              Initial coding.
+//<
+//*****************************************************************************
+#ifndef ossimElevManager_HEADER
+#define ossimElevManager_HEADER
+
+#include <vector>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/elevation/ossimElevSource.h>
+#include <ossim/elevation/ossimElevationDatabase.h>
+#include <OpenThreads/ReadWriteMutex>
+
+class OSSIM_DLL ossimElevManager : public ossimElevSource
+{
+public: 
+   typedef std::vector<ossimRefPtr<ossimElevationDatabase> > ElevationDatabaseListType;
+   
+   class OSSIM_DLL ConnectionStringVisitor : public ossimVisitor
+   {
+   public:
+      ConnectionStringVisitor(const ossimString& value);
+      virtual ossimRefPtr<ossimVisitor> dup()const{return new ConnectionStringVisitor(*this);}
+      const ossimString& getConnectionString()const{return m_connectionString;}
+      virtual void visit(ossimObject* obj);
+      ossimElevationDatabase* getElevationDatabase(){return m_database.get();}
+      
+   protected:
+      ossimString m_connectionString;
+      ossimRefPtr<ossimElevationDatabase> m_database;
+   };
+   
+   virtual ~ossimElevManager();
+   
+   /**
+    * METHOD: instance()
+    * Implements singelton pattern
+    */
+   static ossimElevManager* instance();
+   
+   virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
+   virtual double getHeightAboveMSL(const ossimGpt& gpt);
+   virtual bool pointHasCoverage(const ossimGpt&) const;
+
+   /**
+    * Returns the mean post spacing (in meters) for the highest resolution DEM in the list or NaN
+    * if no DEMs have been loaded. Recommended to perform a getHeight() call for a central
+    * ground pt first to load the relevant cells before calling this method.
+    */
+   virtual double getMeanSpacingMeters() const;
+
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
+  
+   ossim_uint32 getNumberOfElevationDatabases()const
+   {
+      return (ossim_uint32) m_dbRoundRobin[0].size();
+   }
+   ossimElevationDatabase* getElevationDatabase(ossim_uint32 idx)
+   {
+      return m_dbRoundRobin[0][idx].get();
+   }
+   const ossimElevationDatabase* getElevationDatabase(ossim_uint32 idx)const
+   {
+      return m_dbRoundRobin[0][idx].get();
+   }
+
+   /**
+    * Adds a new elevation database to the collection. Normally pushed on to the tail of the list,
+    * unless set_as_first=true, in which case this database will receive the first requests.
+    */
+   void addDatabase(ossimElevationDatabase* database, bool set_as_first=false);
+
+   /**
+    * Adds a new elevation file (or multiple files if path is a directory) to the collection.
+    * Normally pushed on to the tail of the list, unless set_as_first=true, in which case this
+    * source will receive the first requests.
+    */
+   bool loadElevationPath(const ossimFilename& path, bool set_as_first=false);
+   
+   void setDefaultHeightAboveEllipsoid(double meters) {m_defaultHeightAboveEllipsoid=meters;}
+   void setElevationOffset(double meters) {m_elevationOffset=meters;}
+   double getElevationOffset() const { return m_elevationOffset; }
+   
+   void getOpenCellList(std::vector<ossimFilename>& list) const;
+
+   /**
+    * @brief Gets a list of elevation cells needed to cover bounding box.
+    * @param connectionString Typically elevation repository, e.g.:
+    * "/data1/elevation/srtm/1arc"
+    * @param minLat Minimum latitude of bounding box.
+    * @param minLon Minimum longitude of bounding box.
+    * @param maxLat Maximum latitude of bounding box.
+    * @param maxLon Maximum longitude of bounding box.
+    * @param cells Initialized by this.
+    * @param maxNumberOfCells Value of 0 indicates return as many as you can.  Any positive
+    *        number will only return that number of cells.
+    */
+   void getCellsForBounds( const std::string& connectionString,
+                           const ossim_float64& minLat,
+                           const ossim_float64& minLon,
+                           const ossim_float64& maxLat,
+                           const ossim_float64& maxLon,
+                           std::vector<ossimFilename>& cells,
+                           ossim_uint32 maxNumberOfCells=0 );
+
+   /**
+    * @brief Gets a list of elevation cells needed to cover bounding box.
+    *
+    * This implementation sorts elevation repositories by resolution, best
+    * first, then searches cells for bounds. Search is stopped on the first
+    * repository that has cells.
+    * 
+    * @param minLat Minimum latitude of bounding box.
+    * @param minLon Minimum longitude of bounding box.
+    * @param maxLat Maximum latitude of bounding box.
+    * @param maxLon Maximum longitude of bounding box.
+    * @param cells Initialized by this.
+    * @param maxNumberOfCells Value of 0 indicates return as many as you can.  Any positive
+    *        number will only return that number of cells.
+    */
+   void getCellsForBounds( const ossim_float64& minLat,
+                           const ossim_float64& minLon,
+                           const ossim_float64& maxLat,
+                           const ossim_float64& maxLon,
+                           std::vector<ossimFilename>& cells,
+                           ossim_uint32 maxNumberOfCells=0 );
+   void getCellsForBounds( const ossimGrect& bounds,
+                           std::vector<ossimFilename>& cells,
+                           ossim_uint32 maxNumberOfCells=0 );
+
+   void setUseGeoidIfNullFlag(bool flag) { m_useGeoidIfNullFlag = flag; }
+   bool getUseGeoidIfNullFlag() const { return m_useGeoidIfNullFlag; }
+   void setRoundRobinMaxSize(ossim_uint32 size);
+
+   void clear();
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   
+   virtual void accept(ossimVisitor& visitor);
+   
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+   virtual ossimObject* dup() const { return 0; } // required to implement but not permitted to call
+
+   ossimElevManager();
+   void loadStandardElevationPaths();
+
+   ElevationDatabaseListType& getNextElevDbList() const; // for multithreading
+   
+   //static ossimElevManager* m_instance;
+   mutable std::vector<ElevationDatabaseListType> m_dbRoundRobin;
+   ossim_uint32 m_maxRoundRobinSize;
+   ossim_float64 m_defaultHeightAboveEllipsoid;
+   ossim_float64 m_elevationOffset;
+   
+   // if an elevation is returned that's null for ellipsoid then use the geoid manager to calculate a shift
+   bool m_useGeoidIfNullFlag;
+   bool m_useStandardPaths;
+   
+   mutable ossim_uint32 m_currentDatabaseIdx;
+   
+   /**
+    * I have tried the readwrite lock interfaces but have found it unstable.  I am using the standard Mutex
+    * and it seems to be much more stable across all platforms.  More testing needs to occur for the ReadWriteMutex.
+    * For now we will use Mutex.
+    */
+   mutable OpenThreads::Mutex m_mutex;
+};
+
+#endif
diff --git a/ossim/include/ossim/elevation/ossimElevSource.h b/include/ossim/elevation/ossimElevSource.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevSource.h
rename to include/ossim/elevation/ossimElevSource.h
diff --git a/include/ossim/elevation/ossimElevSourceFactory.h b/include/ossim/elevation/ossimElevSourceFactory.h
new file mode 100644
index 0000000..28c87ec
--- /dev/null
+++ b/include/ossim/elevation/ossimElevSourceFactory.h
@@ -0,0 +1,74 @@
+//----------------------------------------------------------------------------
+// FILE: ossimElevSourceFactory.cc
+//
+// Copyright (C) 2002 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration for ossimElevSourceFactory.
+//
+// This is the base class interface for elevation source factories which main
+// function is to return an elevation source that covers the ground point
+// passed to the "getElevSource" method.
+//
+// Note the caller of "getElevSource" is responsible for managing the memory
+// new'd from the method.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimElevSourceFactory.h 13269 2008-07-25 14:27:36Z dburken $
+
+#ifndef ossimElevSourceFactory_HEADER
+#define ossimElevSourceFactory_HEADER
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimFilename.h>
+
+class ossimElevSource;
+class ossimGpt;
+
+/*!****************************************************************************
+ * CLASS:  ossimElevSourceFactory
+ *
+ *****************************************************************************/
+class OSSIM_DLL ossimElevSourceFactory : public ossimObject
+{
+public:
+
+   /** default constructor */
+   ossimElevSourceFactory();
+
+   /** virtual destructor */
+   virtual ~ossimElevSourceFactory();
+
+   /**
+    *  Pure virtual method.
+    *  return an elevation source pointer that has elevation coverage for the
+    *  ground point passed in.
+    *  Note the caller of this method is responsible for managing the memory
+    *  allocated.
+    */
+   virtual ossimElevSource* getNewElevSource(const ossimGpt& gpt)const=0;
+
+   /**
+    * @return The directory the factory returns data from.
+    */
+   virtual ossimFilename getDirectory() const;
+
+   /**
+    * @param directory The directory to return data from.
+    */
+   virtual void setDirectory(const ossimFilename& directory);
+
+protected:
+   ossimFilename theDirectory;
+   
+TYPE_DATA
+}; 
+
+#endif /* End of "#ifndef ossimElevSourceFactory_HEADER" */
diff --git a/ossim/include/ossim/elevation/ossimElevationAccuracyInfo.h b/include/ossim/elevation/ossimElevationAccuracyInfo.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevationAccuracyInfo.h
rename to include/ossim/elevation/ossimElevationAccuracyInfo.h
diff --git a/include/ossim/elevation/ossimElevationCellDatabase.h b/include/ossim/elevation/ossimElevationCellDatabase.h
new file mode 100644
index 0000000..799ae1a
--- /dev/null
+++ b/include/ossim/elevation/ossimElevationCellDatabase.h
@@ -0,0 +1,170 @@
+#ifndef ossimElevationCellDatabase_HEADER
+#define ossimElevationCellDatabase_HEADER 1
+#include <ossim/elevation/ossimElevationDatabase.h>
+
+class OSSIM_DLL ossimElevationCellDatabase : public ossimElevationDatabase
+{
+public:
+   struct CellInfo : ossimReferenced
+   {
+      CellInfo(ossim_uint64 id, ossimElevCellHandler* handler = 0)
+         :ossimReferenced(),
+          m_id(id),
+          m_handler(handler),
+          m_timestamp(0)
+      {
+            m_timestamp = ossimTimer::instance()->tick();
+      }
+      CellInfo(const CellInfo& src)
+         :ossimReferenced(src),
+          m_id(src.m_id),
+          m_handler(src.m_handler),
+          m_timestamp(src.m_timestamp)
+      {
+      }
+      CellInfo()
+         :ossimReferenced(),
+          m_id(0),
+          m_handler(0),
+          m_timestamp(0)
+      {
+      }
+      const CellInfo& operator =(const CellInfo& src)
+      {
+         if (this != &src)
+         {
+            m_id = src.m_id;
+            m_handler = src.m_handler;
+            m_timestamp = src.m_timestamp;
+         }
+         return *this;
+      }
+      void updateTimestamp()
+      {
+         m_timestamp = ossimTimer::instance()->tick();
+      }
+      ossim_uint64 id()const
+      {
+         return m_id;
+      }
+      ossim_uint64                      m_id;
+      ossimRefPtr<ossimElevCellHandler> m_handler;
+      ossimTimer::Timer_t               m_timestamp;
+   };
+
+   typedef std::map<ossim_uint64, ossimRefPtr<CellInfo> > CellMap;
+   
+   ossimElevationCellDatabase()
+      :ossimElevationDatabase(),
+      m_minOpenCells(5),
+      m_maxOpenCells(10),
+      m_memoryMapCellsFlag(false)
+   {
+   }
+   ossimElevationCellDatabase(const ossimElevationCellDatabase& src)
+      :ossimElevationDatabase(src),
+      m_minOpenCells(src.m_minOpenCells),
+      m_maxOpenCells(src.m_maxOpenCells),
+      m_cacheMap(src.m_cacheMap),
+      m_memoryMapCellsFlag(src.m_memoryMapCellsFlag)
+   {
+   }
+
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   virtual ossim_uint32 getMinOpenCells()const
+   {
+      return m_minOpenCells;
+   }
+   virtual ossim_uint32 getMaxOpenCells()const
+   {
+      return m_maxOpenCells;
+   }
+   virtual void setMinMaxOpenCells(ossim_uint64 minCellCount,
+                                   ossim_uint64 maxCellCount)
+   {
+      m_minOpenCells = minCellCount;
+      m_maxOpenCells = maxCellCount;
+   }
+   virtual bool getMemoryMapCellsFlag()const
+   {
+      return m_memoryMapCellsFlag;
+   }
+   virtual void setMemoryMapCellsFlag(bool flag)
+   {
+      m_memoryMapCellsFlag = flag;
+   }
+
+   virtual void getOpenCellList(std::vector<ossimFilename>& list) const;
+
+   /**
+    * @brief Gets a list of elevation cells needed to cover bounding box.
+    * @param connectionString Typically elevation repository, e.g.:
+    * "/data1/elevation/srtm/1arc"
+    * @param minLat Minimum latitude of bounding box.
+    * @param minLon Minimum longitude of bounding box.
+    * @param maxLat Maximum latitude of bounding box.
+    * @param maxLon Maximum longitude of bounding box.
+    * @param cells Initialized by this.
+    * @param maxNumberOfCells Value of 0 indicates return as many as you can.  Any positive
+    *        number will only return that number of cells.
+    */   
+   void getCellsForBounds( const ossim_float64& minLat,
+                           const ossim_float64& minLon,
+                           const ossim_float64& maxLat,
+                           const ossim_float64& maxLon,
+                           std::vector<ossimFilename>& cells,
+                           ossim_uint32 maxNumberOfCells=0 );
+
+   virtual ossim_uint64 createId(const ossimGpt& /* pt */)const
+   {
+      return 0;
+   }
+   virtual ossimRefPtr<ossimElevCellHandler> getOrCreateCellHandler(const ossimGpt& gpt);
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+   virtual ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& /* gpt */)
+   {
+      return 0;
+   }
+   virtual void remove(ossim_uint64 id)
+   {
+      CellMap::iterator iter = m_cacheMap.find(id);
+      if(iter != m_cacheMap.end())
+      {
+         m_cacheMap.erase(iter);
+      }
+   }
+   void flushCacheToMinOpenCells()
+   {
+      // lets flush the cache from least recently used to recent.
+      //
+      CellMap sortedMap;
+      CellMap::iterator iter = m_cacheMap.begin();
+      
+      while(iter != m_cacheMap.end())
+      {
+         sortedMap.insert(std::make_pair(iter->second->m_timestamp, iter->second));
+         ++iter;
+      }
+      
+      iter = sortedMap.begin();
+      while((iter!=sortedMap.end())&&(m_cacheMap.size() > m_minOpenCells))
+      {
+         remove(iter->second->id());
+         ++iter;
+      }
+   }
+   
+   ossim_uint32               m_minOpenCells;
+   ossim_uint32               m_maxOpenCells;
+   mutable OpenThreads::Mutex m_cacheMapMutex;
+   CellMap                    m_cacheMap;
+   ossim_uint32               m_memoryMapCellsFlag;
+   
+   TYPE_DATA;
+};
+
+#endif /* #ifndef ossimElevationCellDatabase_HEADER */
diff --git a/ossim/include/ossim/elevation/ossimElevationDatabase.h b/include/ossim/elevation/ossimElevationDatabase.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevationDatabase.h
rename to include/ossim/elevation/ossimElevationDatabase.h
diff --git a/ossim/include/ossim/elevation/ossimElevationDatabaseFactory.h b/include/ossim/elevation/ossimElevationDatabaseFactory.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevationDatabaseFactory.h
rename to include/ossim/elevation/ossimElevationDatabaseFactory.h
diff --git a/ossim/include/ossim/elevation/ossimElevationDatabaseFactoryBase.h b/include/ossim/elevation/ossimElevationDatabaseFactoryBase.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevationDatabaseFactoryBase.h
rename to include/ossim/elevation/ossimElevationDatabaseFactoryBase.h
diff --git a/ossim/include/ossim/elevation/ossimElevationDatabaseRegistry.h b/include/ossim/elevation/ossimElevationDatabaseRegistry.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimElevationDatabaseRegistry.h
rename to include/ossim/elevation/ossimElevationDatabaseRegistry.h
diff --git a/ossim/include/ossim/elevation/ossimGeneralRasterElevFactory.h b/include/ossim/elevation/ossimGeneralRasterElevFactory.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimGeneralRasterElevFactory.h
rename to include/ossim/elevation/ossimGeneralRasterElevFactory.h
diff --git a/ossim/include/ossim/elevation/ossimGeneralRasterElevHandler.h b/include/ossim/elevation/ossimGeneralRasterElevHandler.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimGeneralRasterElevHandler.h
rename to include/ossim/elevation/ossimGeneralRasterElevHandler.h
diff --git a/ossim/include/ossim/elevation/ossimGeneralRasterElevationDatabase.h b/include/ossim/elevation/ossimGeneralRasterElevationDatabase.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimGeneralRasterElevationDatabase.h
rename to include/ossim/elevation/ossimGeneralRasterElevationDatabase.h
diff --git a/ossim/include/ossim/elevation/ossimHgtRef.h b/include/ossim/elevation/ossimHgtRef.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimHgtRef.h
rename to include/ossim/elevation/ossimHgtRef.h
diff --git a/include/ossim/elevation/ossimImageElevationDatabase.h b/include/ossim/elevation/ossimImageElevationDatabase.h
new file mode 100644
index 0000000..99a333d
--- /dev/null
+++ b/include/ossim/elevation/ossimImageElevationDatabase.h
@@ -0,0 +1,219 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimImageElevationDatabase.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: See description for class below.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimImageElevationDatabase_HEADER
+#define ossimImageElevationDatabase_HEADER 1
+
+#include <ossim/elevation/ossimElevationCellDatabase.h>
+#include <ossim/base/ossimFileProcessorInterface.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimRtti.h>
+#include <map>
+
+class ossimString;
+
+/**
+ * @class ossimTiledElevationDatabase
+ *
+ * Elevation source used for working with generic images opened by an
+ * ossimImageHandler. This class is typically utilized through the
+ * ossimElevManager.
+ */
+class OSSIM_DLL ossimImageElevationDatabase :
+   public ossimElevationCellDatabase, public ossimFileProcessorInterface
+{
+public:
+
+   /** default constructor */
+   ossimImageElevationDatabase();
+
+   /**
+    * @brief Open a connection to a database.
+    *
+    * @param connectionString File or directory to open.  In most cases this
+    * will point to a directory containing DEMs. Satisfies pure virtual
+    * ossimElevationDatabase::open().
+    *
+    * @return true on success, false on error.
+    */   
+   virtual bool open(const ossimString& connectionString);
+
+   /** @brief close method. Unreferences all data. */
+   virtual void close();
+
+   virtual ossimObject* dup() const
+   {
+      ossimImageElevationDatabase* duped = new ossimImageElevationDatabase;
+      duped->open(m_connectionString);
+      return duped;
+   }
+
+   /**
+    * @brief Maps elevation data for region to a grid.
+    *
+    * This uses connectionString passed to open method as starting point.
+    */
+   void mapRegion(const ossimGrect& region);
+
+   /**
+    * @brief Get height above MSL for point.
+    *
+    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
+    * 
+    * @return Height above MSL.
+    */
+   virtual double getHeightAboveMSL(const ossimGpt& gpt);
+
+   /**
+    * @brief Get height above ellipsoid for point.
+    *
+    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
+    * 
+    * @return Height above MSL.
+    */
+   virtual double getHeightAboveEllipsoid(const ossimGpt&);
+   
+   /**
+    * Satisfies pure virtual ossimElevSource::pointHasCoverage
+    * 
+    * @return true if database has coverage for point.
+    */
+   virtual bool pointHasCoverage(const ossimGpt& gpt) const;
+
+
+   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
+
+
+   /**
+    * Statisfies pure virtual ossimElevSource::getAccuracyLE90.
+    * @return The vertical accuracy (90% confidence) in the
+    * region of gpt:
+    */
+   //virtual double getAccuracyLE90(const ossimGpt& gpt) const;
+   
+   /**
+    * Statisfies pure virtual ossimElevSource::getAccuracyCE90.
+    * @return The horizontal accuracy (90% confidence) in the
+    * region of gpt.
+    */
+   //virtual double getAccuracyCE90(const ossimGpt& gpt) const;
+
+   /** @brief Initialize from keyword list. */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /** @brief Save the state to a keyword list. */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   /**
+    * @brief Gets the bounding rectangle/coverage of elevation.
+    *
+    * @param rect Rectangle to initialize.
+    */
+   void getBoundingRect(ossimGrect& rect) const;
+
+   /**
+    * @brief ProcessFile method.
+    *
+    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
+    *
+    * This method is linked to the ossimFileWalker::walk method via a pointer
+    * to this class.
+    * 
+    * @param file to process.
+    */
+   virtual void processFile(const ossimFilename& file);
+   
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+   /**
+    * @Brief Protected destructor.
+    *
+    * This class is derived from ossimReferenced so users should always use
+    * ossimRefPtr<ossimImageElevationDatabase> to hold instance.
+    */
+   virtual ~ossimImageElevationDatabase();
+
+   virtual ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& gpt);
+
+   // virtual ossim_uint64 createId(const ossimGpt& pt) const;
+
+   /**
+    * @brief Gets cell for point.
+    *
+    * This override ossimElevationCellDatabase::getOrCreateCellHandler as we cannot use
+    * the createId as our cells could be of any size.
+    */
+   virtual ossimRefPtr<ossimElevCellHandler> getOrCreateCellHandler(const ossimGpt& gpt);
+
+   /**
+    * @brief Removes an entry from the m_cacheMap and m_entryMap maps.
+    */
+   virtual void remove(ossim_uint64 id);
+
+private:
+
+   // Private container to hold bounding rect, nominal GSD, and image handler.
+   struct ossimImageElevationFileEntry
+   {
+      /** @brief default constructor */
+      ossimImageElevationFileEntry();
+
+      /** @brief Constructor that takes a file name. */
+      ossimImageElevationFileEntry(const ossimFilename& file);
+
+      ossimImageElevationFileEntry(const ossimImageElevationFileEntry& copy_this);
+
+      /** file name */
+      ossimFilename m_file;
+
+      /** Bounding rectangle in decimal degrees. */
+      ossimGrect m_rect;
+      ossimDpt m_nominalGSD; // post spacing at center
+
+      /** True if in ossimElevationCellDatabase::m_cacheMap. */
+      bool m_loadedFlag;
+   };  
+
+   /**
+    * @brief Initializes m_entryMap with all loadable files from
+    * m_connectionString.
+    */
+   void loadFileMap();
+
+   /** Hidden from use copy constructor */
+   ossimImageElevationDatabase(const ossimImageElevationDatabase& copy_this);
+   
+   std::map<ossim_uint64, ossimImageElevationFileEntry> m_entryMap;
+   ossim_uint64       m_lastMapKey;
+   ossim_uint64       m_lastAccessedId;
+
+   TYPE_DATA 
+};
+
+inline void ossimImageElevationDatabase::remove(ossim_uint64 id)
+{
+   std::map<ossim_uint64, ossimImageElevationFileEntry>::iterator entryIter = m_entryMap.find(id);
+   if ( entryIter != m_entryMap.end() )
+   {
+      (*entryIter).second.m_loadedFlag = false;
+   }
+   ossimElevationCellDatabase::remove(id);
+}
+
+#endif /* ossimImageElevationDatabase_HEADER */
diff --git a/include/ossim/elevation/ossimImageElevationHandler.h b/include/ossim/elevation/ossimImageElevationHandler.h
new file mode 100644
index 0000000..963130f
--- /dev/null
+++ b/include/ossim/elevation/ossimImageElevationHandler.h
@@ -0,0 +1,154 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimImageElevationHandler.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: See description for class below.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimImageElevationHandler_HEADER
+#define ossimImageElevationHandler_HEADER 1
+
+#include <ossim/elevation/ossimElevCellHandler.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimTileCache.h>
+#include <OpenThreads/ReadWriteMutex>
+
+/**
+ * @class ossimImageElevationHandler
+ *
+ * Elevation source for a generic image opened via ossimImageHandler.
+ */
+class OSSIM_DLL ossimImageElevationHandler : public ossimElevCellHandler
+{
+public:
+
+   /** default constructor */
+   ossimImageElevationHandler();
+   ossimImageElevationHandler(const ossimFilename& file);
+
+   /**
+    * METHOD: getHeightAboveMSL
+    * Height access methods.
+    */
+   virtual double getHeightAboveMSL(const ossimGpt&);
+
+   /**
+    *  METHOD:  getSizeOfElevCell
+    *  Returns the number of post in the cell.  Satisfies pure virtual.
+    *  Note:  x = longitude, y = latitude
+    */
+   virtual ossimIpt getSizeOfElevCell() const;
+      
+   /**
+    *  METHOD:  getPostValue
+    *  Returns the value at a given grid point as a double.
+    *  Satisfies pure virtual.
+    */
+   virtual double getPostValue(const ossimIpt& gridPt) const;
+
+   /** @return True if open, false if not. */
+   virtual bool isOpen()const;
+   
+   /**
+    * Opens a stream to the srtm cell.
+    *
+    * @return Returns true on success, false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+
+   /** @brief Closes the stream to the file. */
+   virtual void close();
+
+   /**
+    * @brief pointHasCoverage(gpt)
+    *
+    * Overrides ossimElevCellHandler::pointHasCoverage
+    * @return TRUE if coverage exists over gpt.
+    */
+   virtual bool pointHasCoverage(const ossimGpt&) const;
+
+   virtual ossimObject* dup () const { return new ossimImageElevationHandler(this->getFilename()); }
+
+protected:
+   /**
+    * @Brief Protected destructor.
+    *
+    * This class is derived from ossimReferenced so users should always use
+    * ossimRefPtr<ossimImageElevationHandler> to hold instance.
+    */
+   virtual ~ossimImageElevationHandler();
+   
+private:
+
+   class TileCacheEntry
+   {
+   public:
+      TileCacheEntry() : id(99999) {}
+      TileCacheEntry(ossim_uint32 xid, ossimImageData* xdata) : id(xid), data(xdata) {}
+      TileCacheEntry(const TileCacheEntry& copy) : id(copy.id), data(copy.data) {}
+
+      const TileCacheEntry& operator=(const TileCacheEntry& copy)
+      {  id = copy.id; data = copy.data; return *this;  }
+
+      ossim_uint32 id;
+      ossimRefPtr<ossimImageData> data;
+   };
+
+   /** Hidden from use copy constructor */
+   ossimImageElevationHandler(const ossimImageElevationHandler&);
+   
+   /** Hidden from use assignment operator */
+   const ossimImageElevationHandler& operator= (const ossimImageElevationHandler& rhs);
+
+   /** Looks for an elevation tile in the cache first before reading the tile from the input handler */
+   ossimImageData* getTile(ossim_uint32 x, ossim_uint32 y) const;
+
+   /** Pointers to links in chain. */
+   mutable ossimRefPtr<ossimImageHandler> m_ih;
+   ossimRefPtr<ossimImageGeometry>     m_geom;
+   mutable std::vector<TileCacheEntry> m_tileCache;
+
+   /** Image space rect stored as drect for inlined pointHasCoverage method. */
+   ossimDrect                          m_rect;
+   ossimIpt                            m_tileSize;
+   ossim_uint32                        m_numTilesPerRow;
+
+   mutable OpenThreads::ReadWriteMutex  m_mutex;
+
+   TYPE_DATA
+};
+
+inline bool ossimImageElevationHandler::isOpen() const
+{
+   return m_ih.valid();
+}
+
+inline void ossimImageElevationHandler::close()
+{
+   m_geom  = 0;
+   m_ih    = 0;
+}
+
+inline bool ossimImageElevationHandler::pointHasCoverage(const ossimGpt& gpt) const
+{
+   if ( m_geom.valid() )
+   {
+      ossimDpt dpt;
+      m_geom->worldToLocal(gpt, dpt);
+      return m_rect.pointWithin(dpt);
+   }
+   return false;
+}
+
+#endif /* ossimImageElevationHandler_HEADER */
diff --git a/include/ossim/elevation/ossimSrtmElevationDatabase.h b/include/ossim/elevation/ossimSrtmElevationDatabase.h
new file mode 100644
index 0000000..ac472c5
--- /dev/null
+++ b/include/ossim/elevation/ossimSrtmElevationDatabase.h
@@ -0,0 +1,71 @@
+//---
+//
+// License: MIT
+//
+//---
+// $Id$
+
+#ifndef ossimSrtmElevationDatabase_HEADER
+#define ossimSrtmElevationDatabase_HEADER 1
+
+#include <ossim/elevation/ossimElevationCellDatabase.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/elevation/ossimSrtmHandler.h>
+#include <OpenThreads/Mutex>
+
+class OSSIM_DLL ossimSrtmElevationDatabase : public ossimElevationCellDatabase
+{
+public:
+   typedef std::vector<ossimRefPtr<CellInfo> > DirectMap; // 360x180 cell grid
+   
+   ossimSrtmElevationDatabase();
+
+   ossimSrtmElevationDatabase(const ossimSrtmElevationDatabase& rhs);
+
+   virtual ~ossimSrtmElevationDatabase();
+
+   virtual ossimObject* dup() const;
+
+   virtual bool open(const ossimString& connectionString);
+   bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& /*gpt*/) const;
+   virtual bool pointHasCoverage(const ossimGpt& gpt) const
+   {
+      ossimFilename filename;
+      createFullPath(filename, gpt);
+      
+      return filename.exists();
+   }
+   virtual double getHeightAboveMSL(const ossimGpt&);
+   virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
+   virtual ossim_uint64 createId(const ossimGpt& pt)const
+   {
+      ossim_uint64 y = static_cast<ossim_uint64>(ossim::wrap(pt.latd(), -90.0, 90.0)+90.0);
+      ossim_uint64 x = static_cast<ossim_uint64>(ossim::wrap(pt.lond(),-180.0,180.0)+180.0);
+      // map the extreme edge to the same ID ax the 179 west cell and the same for the 89
+      // degree north cell.
+      //
+      x = x==360?359:x;
+      y = y==180?179:y;
+      // Srtm databases are 1x1 degree cells and we will use a world 
+      // grid for id generation.
+      //
+      return (y*360+x);
+   }
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix = 0)const;
+   
+protected:
+   bool openSrtmDirectory(const ossimFilename& dir);
+   void createRelativePath(ossimFilename& file, const ossimGpt& gpt)const;
+   void createFullPath(ossimFilename& file, const ossimGpt& gpt)const
+   {
+      ossimFilename relativeFile;
+      createRelativePath(relativeFile, gpt);
+      file = ossimFilename(m_connectionString).dirCat(relativeFile);
+   }
+
+   ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& gpt);
+
+   TYPE_DATA
+};
+#endif
diff --git a/include/ossim/elevation/ossimSrtmFactory.h b/include/ossim/elevation/ossimSrtmFactory.h
new file mode 100644
index 0000000..026bc95
--- /dev/null
+++ b/include/ossim/elevation/ossimSrtmFactory.h
@@ -0,0 +1,57 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Shuttle Radar Topography Mission (SRTM) factory to return an
+// ossimSrtmElevSource given a ground point.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimSrtmFactory.h 13269 2008-07-25 14:27:36Z dburken $
+#ifndef ossimSrtmFactory_HEADER
+#define ossimSrtmFactory_HEADER
+
+#include <ossim/elevation/ossimElevSourceFactory.h>
+
+/**
+ * @class ossimSrtmFactory Used by the elevation manager, this class returns
+ * an ossimSrtmElevSource given a ground point and some directory with srtm
+ * files in it.
+ */
+class OSSIM_DLL ossimSrtmFactory : public ossimElevSourceFactory
+{
+public:
+
+   /** default constructor */
+   ossimSrtmFactory();
+
+   /** Constructor that takes a directory name. */
+   ossimSrtmFactory(const ossimFilename& dir);
+
+   /** destructor */
+   virtual ~ossimSrtmFactory();
+
+   /**
+    * Open the appropriate ossimSrtmElevSource that covers given a
+    * ground point.
+    *
+    * @param gpt Ground point that an elevation source is need for.
+    *
+    * @return Returns a pointer to an ossimElevSource if an srtm file is found
+    * that can cover the ground point.  Returns NULL if no cell is found
+    * for the point.
+    */
+   virtual ossimElevSource* getNewElevSource(const ossimGpt& gpt) const;
+   
+protected:
+
+TYPE_DATA
+};
+
+#endif /* End of "#ifndef ossimSrtmFactory_HEADER" */
diff --git a/ossim/include/ossim/elevation/ossimSrtmHandler.h b/include/ossim/elevation/ossimSrtmHandler.h
similarity index 100%
rename from ossim/include/ossim/elevation/ossimSrtmHandler.h
rename to include/ossim/elevation/ossimSrtmHandler.h
diff --git a/include/ossim/elevation/ossimTiledElevationDatabase.h b/include/ossim/elevation/ossimTiledElevationDatabase.h
new file mode 100644
index 0000000..0506d5d
--- /dev/null
+++ b/include/ossim/elevation/ossimTiledElevationDatabase.h
@@ -0,0 +1,222 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimTiledElevationDatabase.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: See description for class below.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimTiledElevationDatabase_HEADER
+#define ossimTiledElevationDatabase_HEADER 1
+
+#include <ossim/elevation/ossimElevationDatabase.h>
+#include <ossim/base/ossimFileProcessorInterface.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimRtti.h>
+#include <vector>
+
+class ossimDblGrid;
+class ossimFilename;
+class ossimFileWalker;
+class ossimImageData;
+class ossimImageGeometry;
+class ossimImageHandler;
+class ossimProjection;
+class ossimSingleImageChain;
+class ossimString;
+
+/**
+ * @class ossimTiledElevationDatabase
+ *
+ * Elevation source used for working with generic images opened by an
+ * ossimImageHandler.  This class supplies a mapRegion method used to map a
+ * region of elevation to a grid.  The grid in turn is used for the
+ * getHeightAboveMSL.  This class is for applications that know their region
+ * of interest up front and want to bypass the ossimElevManager and grid the
+ * elevation prior to processing for speed.  Can work on a file or a
+ * directory of files.
+ */
+class OSSIM_DLL ossimTiledElevationDatabase :
+   public ossimElevationDatabase, public ossimFileProcessorInterface
+{
+public:
+
+   /** default constructor */
+   ossimTiledElevationDatabase();
+
+   /**
+    * @brief Open a connection to a database.
+    *
+    * @param connectionString File or directory to open.  In most cases this
+    * will point to a directory containing DEMs. Satisfies pure virtual
+    * ossimElevationDatabase::open().
+    *
+    * @return true on success, false on error.
+    */   
+   virtual bool open(const ossimString& connectionString);
+
+   /** @brief close method. Unreferences all data. */
+   virtual void close();
+
+   /**
+    * @brief Maps elevation data for region to a grid.
+    *
+    * This uses connectionString passed to open method as starting point.
+    */
+   void mapRegion(const ossimGrect& region);
+
+   /**
+    * @brief Get height above MSL for point.
+    *
+    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
+    * 
+    * @return Height above MSL.
+    */
+   virtual double getHeightAboveMSL(const ossimGpt& gpt);
+
+   /**
+    * @brief Get height above ellipsoid for point.
+    *
+    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
+    * 
+    * @return Height above MSL.
+    */
+   virtual double getHeightAboveEllipsoid(const ossimGpt&);
+   
+   /**
+    * Satisfies pure virtual ossimElevSource::pointHasCoverage
+    * 
+    * @return true if database has coverage for point.
+    */
+   virtual bool pointHasCoverage(const ossimGpt& gpt) const;
+
+
+   /** @brief Initialize from keyword list. */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /** @brief Save the state to a keyword list. */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   
+   bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& /*gpt*/) const
+   {
+      info.makeNan();
+      
+      return false;
+   }
+   
+   /**
+    * @brief ProcessFile method.
+    *
+    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
+    *
+    * This method is linked to the ossimFileWalker::walk method via a callback
+    * mechanism.  It is called by the ossimFileWalk (caller).  This class
+    * (callee) sets recurse and return flags accordingly to control
+    * the ossimFileWalker, e.g. don't recurse, stop altogether.
+    * 
+    * @param file to process.
+    */
+   virtual void processFile(const ossimFilename& file);
+   
+   virtual std::ostream& print(std::ostream& out) const;
+
+   virtual ossimObject* dup() const
+   {
+      ossimTiledElevationDatabase* duped = new ossimTiledElevationDatabase;
+      duped->open(m_connectionString);
+      return duped;
+   }
+
+protected:
+   /** Protected destructor as this is derived from ossimRefenced. */
+   virtual ~ossimTiledElevationDatabase();
+
+private:
+
+   // Private container to hold bounding rect and image handler.
+   struct ossimTiledElevationEntry
+   {
+      /** @brief default constructor */
+      ossimTiledElevationEntry();
+
+      /** @brif Constructor that takes rectangle and chain. */
+      ossimTiledElevationEntry(const ossimGrect& rect,
+                               ossimRefPtr<ossimSingleImageChain> sic );
+
+      /** Bounding rectangle in decimal degrees. */
+      ossimGrect m_rect;
+
+      /** Hold pointer to single image chain. */
+      ossimRefPtr<ossimSingleImageChain> m_sic;
+   };
+
+   /**
+    * @brief adds entry to the list checking for duplicates.
+    */
+   void addEntry(const ossimTiledElevationEntry& entry);
+
+   /**
+    * @brief Initializes m_referenceProj from the first entry.
+    */
+   void initializeReferenceProjection();
+
+   /**
+    * @return true if file is a directory based image and the stager should go
+    * on to next directory; false if stager should continue with directory.
+    */
+   bool isDirectoryBasedImage(ossimRefPtr<ossimImageHandler> ih);
+
+   /**
+    * @brief Check for match of the following against the first entry of:
+    *  bands, projection, scalar type and scale.
+    * @returns true if good, false if not the same.
+    */
+   bool isCompatible(ossimImageHandler* ih,
+                     ossimImageGeometry* geom,
+                     ossimProjection* proj) const;
+
+   /**
+    * @brief Initialize bounding rectangle from image handler.
+    *
+    * Sets boundingRect to nan if ossimImageGeometry::getCornerGpts returns false.
+    * 
+    * @param ih Image handler.
+    * @param boundingRect Initialized by method.
+    */
+   void getBoundingRect(ossimRefPtr<ossimImageGeometry> geom, ossimGrect& boundingRect) const;
+
+   /** @brief Loads m_requestedRect into m_grid from m_entries. */
+   void mapRegion();
+
+   /** @brief Templated fill grid method. */
+   template <class T> void fillGrid(T dummyTemplate, ossimRefPtr<ossimImageData> data);
+
+   /** Hidden from use copy constructor */
+   ossimTiledElevationDatabase(const ossimTiledElevationDatabase& copy_this);
+
+   std::vector<ossimTiledElevationEntry> m_entries;
+
+   /** Hold region of elevation. */
+   ossimDblGrid* m_grid;
+
+   /** Projection of the first entry.  Stored for convenience. */
+   ossimRefPtr<ossimProjection> m_referenceProj;
+
+   ossimGrect m_requestedRect;
+   ossimGrect m_entryListRect;
+   ossimGrect m_mappedRect; // Requested expanded to even post boundary.
+
+   ossimFileWalker* m_fileWalker;
+
+   TYPE_DATA 
+};
+
+#endif /* ossimTiledElevationDatabase_HEADER */
diff --git a/ossim/include/ossim/font/ossimFont.h b/include/ossim/font/ossimFont.h
similarity index 100%
rename from ossim/include/ossim/font/ossimFont.h
rename to include/ossim/font/ossimFont.h
diff --git a/include/ossim/font/ossimFontFactoryBase.h b/include/ossim/font/ossimFontFactoryBase.h
new file mode 100644
index 0000000..014a6f1
--- /dev/null
+++ b/include/ossim/font/ossimFontFactoryBase.h
@@ -0,0 +1,41 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//********************************************************************
+// $Id: ossimFontFactoryBase.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimFontFactoryBase_HEADER
+#define ossimFontFactoryBase_HEADER
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimFontInformation.h>
+class ossimFont;
+
+class ossimFontFactoryBase
+{
+public:
+
+   virtual ~ossimFontFactoryBase(){}
+   
+   /*!
+    * Will find the best font for the passed in infromation.
+    * If none is found a default font should be returned.
+    */
+   virtual ossimFont* createFont(const ossimFontInformation& information)const=0;
+
+   /*!
+    * Usually for trutype fonts but any font stored in a file it
+    * will try to create a font from it.
+    */
+   virtual ossimFont* createFont(const ossimFilename& file)const=0;
+
+   virtual void getFontInformation(std::vector<ossimFontInformation>& informationList)const=0;
+
+};
+
+#endif
diff --git a/ossim/include/ossim/font/ossimFontFactoryRegistry.h b/include/ossim/font/ossimFontFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/font/ossimFontFactoryRegistry.h
rename to include/ossim/font/ossimFontFactoryRegistry.h
diff --git a/ossim/include/ossim/font/ossimFreeTypeFont.h b/include/ossim/font/ossimFreeTypeFont.h
similarity index 100%
rename from ossim/include/ossim/font/ossimFreeTypeFont.h
rename to include/ossim/font/ossimFreeTypeFont.h
diff --git a/ossim/include/ossim/font/ossimFreeTypeFontFactory.h b/include/ossim/font/ossimFreeTypeFontFactory.h
similarity index 100%
rename from ossim/include/ossim/font/ossimFreeTypeFontFactory.h
rename to include/ossim/font/ossimFreeTypeFontFactory.h
diff --git a/ossim/include/ossim/font/ossimGdBitmapFont.h b/include/ossim/font/ossimGdBitmapFont.h
similarity index 100%
rename from ossim/include/ossim/font/ossimGdBitmapFont.h
rename to include/ossim/font/ossimGdBitmapFont.h
diff --git a/ossim/include/ossim/font/ossimGdSansBold.inc b/include/ossim/font/ossimGdSansBold.inc
similarity index 100%
rename from ossim/include/ossim/font/ossimGdSansBold.inc
rename to include/ossim/font/ossimGdSansBold.inc
diff --git a/include/ossim/hdf5/ossimHdf5.h b/include/ossim/hdf5/ossimHdf5.h
new file mode 100644
index 0000000..142c011
--- /dev/null
+++ b/include/ossim/hdf5/ossimHdf5.h
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ *                                                                            *
+ *                                 O S S I M                                  *
+ *            Open Source, Geospatial Image Processing Project                *
+ *          License: MIT, see LICENSE at the top-level directory              *
+ *                                                                            *
+ ******************************************************************************/
+
+#ifndef ossimHdf5_HEADER
+#define ossimHdf5_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/plugin/ossimPluginConstants.h>
+#include <ostream>
+#include <iosfwd>
+#include <string>
+#include <vector>
+#include <H5Cpp.h>
+
+/**
+ * Low-level OSSIM interface to HDF5 libraries. Catches HDF5 exceptions on common operations.
+ * Note, all methods return by value as that is the way HDF5 returns objects. This seems very
+ * inefficient, particularly for large datasets. Hopefully they are shallow copies.
+ */
+class OSSIM_DLL ossimHdf5 : public ossimReferenced
+{
+public:
+   ossimHdf5();
+   ~ossimHdf5();
+
+   /** Opens specified HDF5 file. */
+   bool open(const ossimFilename& hdf5File);
+
+   bool isOpen() const { return (m_h5File != NULL); }
+
+   /** Closes the file and deletes all pointers.
+    * @return True if close successful. */
+   bool close();
+
+   /** Assigns the root group.
+    * @return True if result valid */
+   bool getRoot(H5::Group& root) const;
+
+
+   /** Assigns list of groups under specified group.
+    * @param recursive If true, recursively visits all subgroups
+    * @return True if result valid */
+   static bool getChildGroups(H5::Group group,
+                              std::vector<H5::Group>& groupList,
+                              bool recursive=false);
+
+   /** Assigns list of datasets under specified group.
+    * @param recursive If true, recursively visits all datasets for this group and subgroups
+    * @return True if result valid */
+   static bool getDatasets(H5::Group group,
+                           std::vector<H5::DataSet>& datasetList,
+                           bool recursive=false);
+
+   /** Assigns list of all multi-dimensional datasets under current active group.
+    * @param recursive If true, recursively visits all datasets for this group and subgroups
+    * @return True if result valid */
+   static bool getNdimDatasets(H5::Group group,
+                               std::vector<H5::DataSet>& datasetList,
+                               bool recursive=false);
+
+   /** 
+    * @param objPath Either relative or absolute path in file to object.
+    * @return True if result valid */
+   static bool getAttributes(const H5::H5Object& obj, std::vector<H5::Attribute>& attrList);
+
+   /** Finds a group by name. The first object with specified name (can be relative path -- a
+    * naive string comparison is performed) under the specified parent group is returned.
+    * @param group If null, implies root group.
+    * @param recursive If true, recursively visits all subgroups.
+    * @return result Set to valid dataset object if found (caller assumes ownership), else NULL. */
+   H5::Group* findGroupByName(const std::string& group_name,
+                              const H5::Group* parent_group=0,
+                              bool recursive=false)const;
+
+   /** Finds a dataset by name. The first object with specified name (can be relative path -- a
+    * naive string comparison is performed) under the specified group is returned.
+    * @param group If null, implies root group.
+    * @param recursive If true, recursively visits all subgroups.
+    * @return result Set to valid dataset object if found (caller assumes ownership), else NULL.
+    *         The return value must be deleted by the caller  
+    */
+   H5::DataSet* findDatasetByName(const std::string& dataset_name,
+                                  const H5::Group* group=0,
+                                  bool recursive=false)const ;
+
+
+   static ossimByteOrder getByteOrder( const H5::AbstractDs* obj );
+   static ossimByteOrder getByteOrder( const H5::AtomType& obj );
+   static std::string getDatatypeClassType( ossim_int32 type );
+
+   static void getExtents( const H5::DataSet& dataset, std::vector<ossim_uint32>& extents );
+
+   static ossimScalarType getScalarType( const H5::DataSet& dataset );
+   static ossimScalarType getScalarType( const H5::DataType& datatype );
+   static bool floatTypeToString(std::string& result,
+                        const H5::FloatType& dataType,
+                        const char* dataPtr);
+   static bool intTypeToString(std::string& result,
+                        const H5::IntType& dataType,
+                        const char* dataPtr);
+   static bool stringTypeToString(std::string& result,
+                        const H5::StrType& dataType,
+                        const char* dataPtr);
+private:
+   ossimFilename m_filename;
+   H5::H5File* m_h5File;
+};
+
+#endif /* #ifndef ossimHdf5_HEADER */
diff --git a/include/ossim/hdf5/ossimHdf5GridModel.h b/include/ossim/hdf5/ossimHdf5GridModel.h
new file mode 100644
index 0000000..6d54580
--- /dev/null
+++ b/include/ossim/hdf5/ossimHdf5GridModel.h
@@ -0,0 +1,69 @@
+//*****************************************************************************
+// FILE: ossimHdf5GridModel.h
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: David Burken
+//
+// Copied from Mingjie Su's ossimHdfGridModel.
+//
+// DESCRIPTION:
+//   Contains declaration of class ossimHdfGridModel. This is an
+//   implementation of an interpolation sensor model.
+//
+//*****************************************************************************
+//  $Id$
+
+#ifndef ossimHdf5GridModel_HEADER
+#define ossimHdf5GridModel_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/projection/ossimCoarseGridModel.h>
+#include <ossim/plugin/ossimPluginConstants.h>
+#include <ossim/hdf5/ossimHdf5.h>
+#include <string>
+
+
+/******************************************************************************
+ *
+ * CLASS:  ossimHdf5GridModel
+ *
+ *****************************************************************************/
+class OSSIM_DLL ossimHdf5GridModel : public ossimCoarseGridModel
+{
+public:
+
+   /** @brief default constructor. */
+   ossimHdf5GridModel();
+   
+   /** @brief virtual destructor */
+   virtual ~ossimHdf5GridModel();
+
+   /** Initializes from an open HDF5 file */
+   bool initialize(ossimHdf5* hdf5, const ossimString& projDataPath="");
+
+   /** Makes sure that the "type" keyword entry reflects the base class, not this one. */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix) const;
+
+protected:
+
+   bool initCoarseGrid(const char* datasetName, ossimDblGrid& coarseGrid);
+
+   bool crossesDateline();
+
+   // This polygon differs from base "theBoundGndPolygon" in that if the
+   // scene crosses the dateline the longitude values are stored between
+   // 0 and 360 degress as opposed to -180 to 180.
+   ossimPolygon m_boundGndPolygon;
+
+   ossimRefPtr<ossimHdf5> m_hdf5;
+   ossimIpt m_imageSize;
+   ossimString m_projDataPath;
+   
+   TYPE_DATA
+};
+
+#endif /* Matches: #ifndef ossimHdf5GridModel_HEADER */
diff --git a/include/ossim/hdf5/ossimHdf5ImageDataset.h b/include/ossim/hdf5/ossimHdf5ImageDataset.h
new file mode 100644
index 0000000..1189b37
--- /dev/null
+++ b/include/ossim/hdf5/ossimHdf5ImageDataset.h
@@ -0,0 +1,153 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: OSSIM HDF5 Image DataSet.
+//
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimHdf5ImageDataset_HEADER
+#define ossimHdf5ImageDataset_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIrect.h>
+#include <iosfwd>
+#include <string>
+#include <ossim/hdf5/ossimHdf5.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+
+// Forward class declarations:
+class ossimImageData;
+class ossimEndian;
+class ossimIpt;
+class ossimIrect;
+class ossimHdf5ImageHandler;
+
+/**
+ * @brief Class encapsulates a HDF5 Data set that can be loaded as an image.
+ */
+class OSSIM_DLL ossimHdf5ImageDataset : public ossimReferenced
+{
+public:
+   /** default constructor */
+   ossimHdf5ImageDataset(ossimHdf5ImageHandler* owner=0);
+   
+   /** copy constructor */
+   ossimHdf5ImageDataset( const ossimHdf5ImageDataset& obj );
+   
+   /** destructor */
+   ~ossimHdf5ImageDataset();
+
+   /** @brief Calls H5::DataSet::close then deletes data set. */
+   void close();
+
+   const ossimHdf5ImageDataset& operator=( const ossimHdf5ImageDataset& rhs );
+
+   /**
+    * @brief Opens datasetName and initializes all data members on success.
+    * @return true on success, false on error.
+    */
+   bool initialize( const H5::DataSet& dataset);
+
+   /**
+    * @brief Get const pointer to dataset.
+    *
+    * This can be null if not open.
+    * 
+    * @return const pointer to dataset.
+    */
+   const H5::DataSet* getDataset() const;
+   
+   /**
+    * @brief Get pointer to dataset.
+    *
+    * This can be null if not open.
+    * 
+    * @return pointer to dataset.
+    */
+   H5::DataSet* getDataset();
+
+   /** @return The dataset name.  This is the full path used for open. */
+   std::string getName() const;
+
+   /** @return The output scalar type. */
+   ossimScalarType getScalarType() const;
+
+   /** @return the number of . */
+   ossim_uint32 getNumberOfBands() const;
+
+   /** @return The number of lines. */
+   ossim_uint32 getNumberOfLines() const;
+   
+   /** @return The number of samples. */
+   ossim_uint32 getNumberOfSamples() const;
+
+   /** @return The swap flag. */
+   bool getSwapFlag() const;
+
+   const ossimIpt& getSubImageOffset() const;
+
+   const ossimIrect& getValidImageRect() const;
+
+   double getMaxPixelValue(ossim_uint32 band=0) const;
+   double getMinPixelValue(ossim_uint32 band=0) const;
+
+   bool isMinPixelSet()const;
+   bool isMaxPixelSet()const;
+   
+   /**
+    *  @brief Method to grab a tile(rectangle) from image.
+    *
+    *  @param buffer Buffer for data for this method to copy data to.
+    *  Should be the size of rect * bytes_per_pixel for scalar type.
+    *
+    *  @param rect The zero based rectangle to grab.  Rectangle is relative to
+    *  any sub image offset. E.g. A request for 0,0 is the upper left corner
+    *  of the valid image rect.
+    *
+    *  @param scale If true, uses min and max to stretch the data to a UINT16 range.
+    */
+   void getTileBuf(void* buffer, const ossimIrect& rect, ossim_uint32 band, bool scale=true);
+
+
+   /**
+    * @brief print method.
+    * @return std::ostream&
+    */
+   std::ostream& print(std::ostream& out) const;
+
+   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& out,
+                                                  const ossimHdf5ImageDataset& obj);
+private:
+   /** Returns true if datasets's endianness differs from this platform */
+   bool determineExtents();
+   bool scanForValidImageRect();
+   bool determineScalarType();
+   bool scanForMinMax();
+   
+   ossimRefPtr<ossimHdf5ImageHandler> m_handler;
+   ossimRefPtr<ossimHdf5> m_hdf5;
+   H5::DataSet     m_dataset;
+   H5::DataSpace   m_dataSpace;
+   ossimScalarType m_scalar;
+   ossim_uint32    m_bands;   
+   ossim_uint32    m_lines;
+   ossim_uint32    m_samples;
+   ossimEndian*    m_endian; // For byte swapping if needed.
+   std::vector<ossim_float32> m_minValue;
+   std::vector<ossim_float32> m_maxValue;
+
+
+   /** H5 data can have null rows on the front or end.  The valid rect is the scanned rectangle
+    * disregarding leading or trailing nulls. This doesn't handle nulls in the middle of image. */
+   ossimIrect      m_validRect; // image rect offset relative to full image
+   
+}; // End: class ossimH5ImageDataset
+
+#endif /* #ifndef ossimH5ImageDataset_HEADER */
diff --git a/include/ossim/hdf5/ossimHdf5ImageHandler.h b/include/ossim/hdf5/ossimHdf5ImageHandler.h
new file mode 100644
index 0000000..0d7f19c
--- /dev/null
+++ b/include/ossim/hdf5/ossimHdf5ImageHandler.h
@@ -0,0 +1,229 @@
+/*****************************************************************************
+ *                                                                            *
+ *                                 O S S I M                                  *
+ *            Open Source, Geospatial Image Processing Project                *
+ *          License: MIT, see LICENSE at the top-level directory              *
+ *                                                                            *
+ *****************************************************************************/
+
+#ifndef ossimHdf5ImageHandler_HEADER
+#define ossimHdf5ImageHandler_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/hdf5/ossimHdf5.h>
+#include <ossim/hdf5/ossimHdf5ImageDataset.h>
+#include <OpenThreads/Mutex>
+#include <vector>
+#include <string>
+
+/**
+ * This is the base class for all imagery using HDF5 as the file format. HDF5 is unique in that it
+ * represents a variety of subformats for raster and projection information. The derived classes
+ * will need to specify the group and dataset names where the needed data lives.
+ */
+class OSSIM_DLL ossimHdf5ImageHandler : public ossimImageHandler
+{
+   friend class ossimHdf5ImageDataset;
+
+public:
+
+   /** default constructor */
+   ossimHdf5ImageHandler();
+
+   /** virtual destructor */
+   virtual ~ossimHdf5ImageHandler();
+
+   /** @return "hdf5" */
+   virtual ossimString getShortName() const;
+
+   /** @return "ossim hdf5" */
+   virtual ossimString getLongName()  const;
+
+   /** @return "ossimH5Reader" */
+   virtual ossimString getClassName()    const;
+
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper
+    *  left corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+
+   /**
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+
+   /**
+    * Returns the number of bands in a tile returned from this TileSource.
+    * Note: we are supporting sources that can have multiple data objects.
+    * If you want to know the scalar type of an object you can pass in the
+    */
+   virtual ossim_uint32 getNumberOfOutputBands()const;
+
+   /**
+    *  Returns the number of lines in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    *  Returns the number of samples in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    * Returns the zero based image rectangle for the reduced resolution data
+    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   virtual bool isOpen() const;
+
+   /** Close method. */
+   virtual void close();
+   virtual void loadMetaData();
+   /**
+    * @return The number of entries (images) in the image file.
+    */
+   virtual ossim_uint32 getNumberOfEntries()const;
+
+   /**
+    * @brief Get the name of entry as a string.
+    *
+    * Example given from HDF5 file:
+    * 
+    * entry_name: /All_Data/VIIRS-IMG-GTM-EDR-GEO_All/QF1_VIIRSGTMGEO
+    *
+    * @param entryIdx Zero based entry index. If out of range name will
+    * be cleared.
+    * 
+    * @param name Initialized by this.
+    */
+   virtual void getEntryNames(std::vector<ossimString>& entryNames) const;
+
+   /**
+    * @param entryList This is the list to initialize with entry indexes.
+    *
+    * @note This implementation returns puts one entry "0" in the list.
+    */
+   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
+
+   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
+
+   /**
+    * @return The current entry number.
+    */
+   virtual ossim_uint32 getCurrentEntry() const;
+
+   ossimRefPtr<ossimHdf5ImageDataset> getCurrentDataset();
+
+   /** @return Null pixel value. */
+   virtual double getNullPixelValue(ossim_uint32 band=0) const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0) const;
+   virtual double getMinPixelValue(ossim_uint32 band=0) const;
+
+   /**
+    * @brief Set propterty method. Overrides ossimImageHandler::setProperty.
+    *
+    * Current property name handled:
+    * "scale" One double value representing the scale in meters per pixel. It is
+    * assumed the scale is same for x and y direction.
+    * 
+    * @param property to set.
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /**
+    * @brief Get propterty method. Overrides ossimImageHandler::getProperty.
+    * @param name Property name to get.
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
+
+   /**
+    * @brief Get propterty names. Overrides ossimImageHandler::getPropertyNames.
+    * @param propertyNames Array to initialize.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames) const;
+
+   /**  The derived class needs to initialize the raster dataset names m_renderableNames in their
+    * constructor, for this method to work. This should be implemented by the derived HDF5-format
+    * readers defined in plugins.
+    * @return true on success, false on error. */
+   virtual bool open();
+
+   const std::vector<ossimString>& getRenderableSetNames() { return m_renderableNames; }
+
+   /** Adds the dataset name, either the full HDF5 path or the simple object name, to the list of
+    * renderable datasets */
+   void addRenderable(const ossimString& datasetName) { m_renderableNames.push_back(datasetName); }
+
+protected:
+   /** @brief Allocates the tile. */ 
+   void allocate();
+
+   std::vector<ossimString>         m_renderableNames;
+   ossimRefPtr<ossimHdf5>           m_hdf5;
+   std::vector<ossimRefPtr<ossimHdf5ImageDataset> > m_entries;
+   ossim_uint32                     m_currentEntry;
+   ossimRefPtr<ossimImageData>      m_tile;
+   OpenThreads::Mutex               m_mutex;
+
+   TYPE_DATA
+};
+
+#endif /* #ifndef ossimH5Reader_HEADER */
diff --git a/include/ossim/hdf5/ossimHdf5Info.h b/include/ossim/hdf5/ossimHdf5Info.h
new file mode 100644
index 0000000..1974988
--- /dev/null
+++ b/include/ossim/hdf5/ossimHdf5Info.h
@@ -0,0 +1,131 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: HDF5 Info class.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimH5Info_HEADER
+#define ossimH5Info_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/plugin/ossimPluginConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/hdf5/ossimHdf5.h>
+#include <H5Cpp.h>
+
+class ossimEndian;
+
+/**
+ * @brief TIFF info class.
+ *
+ * Encapsulates the listgeo functionality.
+ */
+class OSSIM_DLL ossimHdf5Info : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimHdf5Info();
+
+   /** Accepts already opened HDF5 file object. */
+   ossimHdf5Info(ossimHdf5* hdf5);
+
+   /** virtual destructor */
+   virtual ~ossimHdf5Info();
+
+   /**
+    * @param file File name to open.
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+   
+   /**
+    * @param out Stream to print to.
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   virtual bool getKeywordlist(ossimKeywordlist& kwl) const;
+   virtual bool getKeywordlistDataset(ossimKeywordlist& kwl, const std::string& datasetName) const;
+   virtual bool getKeywordlistGroup(ossimKeywordlist& kwl, const std::string& groupName) const;
+
+   // Methods for printing collections. These are public to enable dumping debug information:
+   std::ostream& printSubGroups (std::ostream& out, const H5::Group& obj,    const ossimString& lm=ossimString()) const;
+   std::ostream& printAttributes(std::ostream& out, const H5::H5Object& obj, const ossimString& lm=ossimString()) const;
+   std::ostream& printDatasets  (std::ostream& out, const H5::Group& obj,    const ossimString& lm=ossimString()) const;
+
+   // Methods for printing individual objects:
+   std::ostream& print(std::ostream& out, const H5::Group&     obj, const ossimString& lm=ossimString()) const;
+   std::ostream& print(std::ostream& out, const H5::DataSet&   obj, const ossimString& lm=ossimString()) const;
+   std::ostream& print(std::ostream& out, const H5::DataType&  obj, const ossimString& lm=ossimString()) const;
+   std::ostream& print(std::ostream& out, const H5::DataSpace& obj, const ossimString& lm=ossimString()) const;
+   std::ostream& print(std::ostream& out, const H5::Attribute& obj, const ossimString& lm=ossimString()) const;
+
+
+private:
+   void dumpGroup(const H5::Group& group,
+                  const std::string& prefix,
+                  ossim_uint32& recursedCount) const;
+
+   void dumpDataset(const H5::DataSet& dataset, const std::string& prefix) const;
+
+   void dumpCompound(const H5::DataSet& dataset,
+                     const H5::CompType& compound,
+                     const std::string& prefix)const;
+   void dumpCompoundTypeInfo(const H5::CompType& compound, 
+                             const std::string& prefix) const;
+   void dumpEnumTypeInfo(H5::EnumType datatype, const std::string& prefix) const;
+   void dumpArrayTypeInfo(H5::ArrayType datatype, const std::string& prefix) const;
+   void dumpNumericalTypeInfo(const H5::DataSet& dataset,
+                              ossimByteOrder order,
+                              const std::string& prefix) const;
+   void dumpIntType( const H5::IntType& dataType,
+                     const char* dataPtr,
+                     const std::string& prefix)const;
+   void dumpFloatType(const H5::FloatType& dataType,
+                                  const char* dataPtr,
+                                  const std::string& prefix)const;
+   void dumpStringType(const H5::StrType& dataType,
+                       const char* dataPtr,
+                       const std::string& prefix)const;
+   void dumpArrayType( H5::ArrayType& dataType,
+                       const char* dataPtr,
+                       const std::string& prefix)const;
+   void dumpNumerical(const H5::DataSet& dataset,
+                      const char* dataPtr,
+                      const std::string& prefix) const;
+
+   void dumpStr(const H5::DataSet& dataset,
+                const H5::StrType& dataType,
+                const char* dataPtr,
+                const std::string& prefix) const;
+
+   void dumpAttributes(const H5::H5Object& container, const std::string& prefix) const;
+   void dumpAttribute(const H5::Attribute& attr, const std::string& prefix) const;
+
+   bool getGroupAttributeValue(const std::string& group,
+                               const std::string& key,
+                               std::string& value ) const;
+
+   bool getDatasetAttributeValue(const std::string& objectName,
+                                const std::string& key,
+                                std::string& value ) const;
+
+   ossimString getObjectPrefix(const ossimString& prefix, const ossimString& fullPathName) const;
+
+   ossimRefPtr<ossimHdf5>  m_hdf5;
+   mutable ossimKeywordlist m_kwl;
+   mutable bool m_byteOrder;
+};
+
+#endif
diff --git a/include/ossim/hdf5/ossimHdf5ProjectionFactory.h b/include/ossim/hdf5/ossimHdf5ProjectionFactory.h
new file mode 100644
index 0000000..a29ed03
--- /dev/null
+++ b/include/ossim/hdf5/ossimHdf5ProjectionFactory.h
@@ -0,0 +1,63 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimH5ProjectionFactory_HEADER
+#define ossimH5ProjectionFactory_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/projection/ossimProjectionFactoryBase.h>
+
+class OSSIM_DLL ossimHdf5ProjectionFactory : public ossimProjectionFactoryBase
+{
+public:
+
+   static ossimHdf5ProjectionFactory* instance();
+
+   /**
+    * @bief Takes a filename. This filename can be an image file or
+    * it can also be a ossim .geom file.  It could be other
+    * forms of geom files as well.  The factories job will be to
+    * determine what parser to use and return a projection if
+    * successful.
+    */
+   virtual ossimProjection* createProjection(const ossimFilename& filename,
+                                             ossim_uint32 entryIdx)const;
+   
+   /** @brief Take a projection type name. */
+   virtual ossimProjection* createProjection(const ossimString& name)const;
+
+   /** @brief Take a keywordlist. */
+   virtual ossimProjection* createProjection(const ossimKeywordlist& kwl,
+                                             const char* prefix=0)const;
+   
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+   
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const;
+   
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+
+   /**
+    * Specifies which HDF5 internal paths to search through to locate geometry information. This
+    * can be either explicit dataset names, or group names containing known datasets, such as
+    * "Latitude" and "longitude". The plugins depending on HDF5 should register their geometry
+    * groups here in the same order as image entries.
+    */
+   void addProjDataPath(const ossimString& projPath) { m_projDataPaths.push_back(projPath); }
+
+protected:
+   
+   ossimHdf5ProjectionFactory();
+   
+   std::vector<ossimString> m_projDataPaths; // List of paths (groups or datasets) containing proj info
+
+}; // End: class ossimH5ProjectionFactory{ ... }
+
+#endif /* #ifndef ossimH5ProjectionFactory_HEADER */
diff --git a/include/ossim/hdf5/ossimHdf5Tool.h b/include/ossim/hdf5/ossimHdf5Tool.h
new file mode 100644
index 0000000..c598993
--- /dev/null
+++ b/include/ossim/hdf5/ossimHdf5Tool.h
@@ -0,0 +1,74 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimHdf5Tool_HEADER
+#define ossimHdf5Tool_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/hdf5/ossimHdf5.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/util/ossimChipProcTool.h>
+
+// class ossimHdf5;
+
+/*!
+ *  Class for computing the slope on each elevation post and generatinga corresponding slope image.
+ *  The output scalar type is a normalized float unless unsigned 8-bit is selected via the options.
+ */
+class OSSIM_DLL ossimHdf5Tool : public ossimChipProcTool
+{
+public:
+   ossimHdf5Tool();
+   ~ossimHdf5Tool();
+
+   /**
+    * Initializes the aurgument parser with expected parameters and options. It does not output
+    * anything. To see the usage, the caller will need to do something like:
+    *
+    *   ap.getApplicationUsage()->write(<ostream>);
+    */
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   /**
+    * Initializes from command line arguments.
+    * @return FALSE if --help option requested or no params provided, so that derived classes can
+    * @note Throws ossimException on error.
+    */
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   /**
+    * Reads processing params from KWL and prepares for execute. Returns TRUE if successful.
+    * @note Throws ossimException on error.
+    */
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   virtual bool execute();
+
+   virtual ossimString getClassName() const { return "ossimHdf5Tool"; }
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+protected:
+   virtual void initProcessingChain();
+   virtual void loadImageFiles();
+
+
+   ossimString m_imageDataPath;
+   ossimString m_geomDataPath;
+   bool m_dumpInfo;
+   bool m_dumpKwl;
+   bool m_listDatasets;
+   bool m_listNdimDatasets;
+   ossimFilename m_geomFilename;
+   ossimRefPtr<ossimHdf5> m_hdf5;
+};
+
+#endif
diff --git a/include/ossim/hdf5/ossimViirsHandler.h b/include/ossim/hdf5/ossimViirsHandler.h
new file mode 100644
index 0000000..dd2f16f
--- /dev/null
+++ b/include/ossim/hdf5/ossimViirsHandler.h
@@ -0,0 +1,32 @@
+/*****************************************************************************
+*                                                                            *
+*                                 O S S I M                                  *
+*            Open Source, Geospatial Image Processing Project                *
+*          License: MIT, see LICENSE at the top-level directory              *
+*                                                                            *
+*****************************************************************************/
+
+#ifndef ossimViirsHandler_HEADER
+#define ossimViirsHandler_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/hdf5/ossimHdf5ImageHandler.h>
+
+/**
+ * Concrete class for reading VIIRS data from HDF5 file
+ */
+class OSSIM_DLL ossimViirsHandler : public ossimHdf5ImageHandler
+{
+public:
+   ossimViirsHandler();
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+};
+
+
+
+#endif /* #ifndef ossimViirsHandler_HEADER */
diff --git a/ossim/include/ossim/imaging/gdfontg.inc b/include/ossim/imaging/gdfontg.inc
similarity index 100%
rename from ossim/include/ossim/imaging/gdfontg.inc
rename to include/ossim/imaging/gdfontg.inc
diff --git a/ossim/include/ossim/imaging/gdfontl.inc b/include/ossim/imaging/gdfontl.inc
similarity index 100%
rename from ossim/include/ossim/imaging/gdfontl.inc
rename to include/ossim/imaging/gdfontl.inc
diff --git a/ossim/include/ossim/imaging/gdfontmb.inc b/include/ossim/imaging/gdfontmb.inc
similarity index 100%
rename from ossim/include/ossim/imaging/gdfontmb.inc
rename to include/ossim/imaging/gdfontmb.inc
diff --git a/ossim/include/ossim/imaging/gdfonts.inc b/include/ossim/imaging/gdfonts.inc
similarity index 100%
rename from ossim/include/ossim/imaging/gdfonts.inc
rename to include/ossim/imaging/gdfonts.inc
diff --git a/ossim/include/ossim/imaging/gdfontt.inc b/include/ossim/imaging/gdfontt.inc
similarity index 100%
rename from ossim/include/ossim/imaging/gdfontt.inc
rename to include/ossim/imaging/gdfontt.inc
diff --git a/include/ossim/imaging/ossim3x3ConvolutionFilter.h b/include/ossim/imaging/ossim3x3ConvolutionFilter.h
new file mode 100644
index 0000000..63637ba
--- /dev/null
+++ b/include/ossim/imaging/ossim3x3ConvolutionFilter.h
@@ -0,0 +1,97 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossim3x3ConvolutionFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossim3x3ConvolutionFilter_HEADER
+#define ossim3x3ConvolutionFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+
+class ossim3x3ConvolutionFilter : public ossimImageSourceFilter
+{
+public:
+   ossim3x3ConvolutionFilter(ossimObject* owner=NULL);
+
+   virtual ossimString getShortName()const{return ossimString("3x3 Convolution");}
+   virtual ossimString getLongName()const{return ossimString("Convolves the input image with a 3x3 kernel");}
+
+   virtual void getKernel(double kernel[3][3]);
+   
+   virtual void setKernel(double kernel[3][3]);
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+
+   virtual double getNullPixelValue(ossim_uint32 band=0) const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)  const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)  const;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0)const;
+   
+protected:
+   virtual ~ossim3x3ConvolutionFilter();
+
+   /**
+    * Allocates theTile.
+    */
+   void allocate();
+
+   /**
+    * Clears data members theNullPixValue, theMinPixValue, and
+    * theMaxPixValue.
+    */
+   void clearNullMinMax();
+
+   /**
+    * Computes null, min, and max considering input connection and theKernel.
+    */
+   void computeNullMinMax();
+   
+   ossimRefPtr<ossimImageData> theTile;
+   double theKernel[3][3];
+
+   vector<double> theNullPixValue;
+   vector<double> theMinPixValue;
+   vector<double> theMaxPixValue;   
+   
+   /*!
+    * Convolve full means that the input data is full and has
+    * no null data.  We don't have to compare for nulls here
+    */
+   template<class T>
+   void convolveFull(T,
+                     ossimRefPtr<ossimImageData> inputData,
+                     ossimRefPtr<ossimImageData> outputData);
+   
+   /*!
+    * Convolve partial means that the input data is has some
+    * null data.  We will have to compare nulls
+    */
+   template<class T>
+   void convolvePartial(T,
+                        ossimRefPtr<ossimImageData> inputData,
+                        ossimRefPtr<ossimImageData> outputData);
+                       
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossim3x3ConvolutionFilter_HEADER */
diff --git a/include/ossim/imaging/ossimAOD.h b/include/ossim/imaging/ossimAOD.h
new file mode 100644
index 0000000..074c555
--- /dev/null
+++ b/include/ossim/imaging/ossimAOD.h
@@ -0,0 +1,66 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kathy Minear
+//
+// Description:
+// 
+// Class to compute Aerosol Optical Depth (AOD) for with atmospheric
+// correction.
+//
+//*************************************************************************
+// $Id: ossimAOD.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimAOD_HEADER
+#define ossimAOD_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimAOD : public ossimImageSourceFilter
+{
+public:
+
+   ossimAOD(ossimObject* owner=NULL);
+   ossimAOD(ossimImageSource* inputSource);
+   ossimAOD(ossimObject* owner, ossimImageSource* inputSource);
+
+
+   virtual ossimString getShortName() const;
+
+   virtual void initialize();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+   
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   virtual ostream& print(ostream& os) const;
+   friend ostream& operator << (ostream& os,  const ossimAOD& hr);
+
+   static void writeTemplate(ostream& os);
+
+protected:
+   virtual ~ossimAOD();
+
+   void allocate();
+   
+   /*!
+    * Method to set unset the enable flag.
+    */
+   void verifyEnabled();
+
+   ossimRefPtr<ossimImageData> theTile;
+
+   TYPE_DATA
+};
+
+#endif /* #ifndef ossimAOD_HEADER */
+
diff --git a/ossim/include/ossim/imaging/ossimAdrgHeader.h b/include/ossim/imaging/ossimAdrgHeader.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAdrgHeader.h
rename to include/ossim/imaging/ossimAdrgHeader.h
diff --git a/include/ossim/imaging/ossimAdrgTileSource.h b/include/ossim/imaging/ossimAdrgTileSource.h
new file mode 100644
index 0000000..0f157bb
--- /dev/null
+++ b/include/ossim/imaging/ossimAdrgTileSource.h
@@ -0,0 +1,196 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Ken Melero
+// 
+// Description: This class give the capability to access tiles from an
+//              ADRG file.
+//
+//********************************************************************
+// $Id: ossimAdrgTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+
+#ifndef ossimAdrgTileSource_HEADER
+#define ossimAdrgTileSource_HEADER
+
+#include <fstream>
+
+#include <ossim/imaging/ossimImageHandler.h>
+
+class ossimImageData;
+class ossimAdrgHeader;
+
+class OSSIM_DLL ossimAdrgTileSource : public ossimImageHandler
+{
+public:
+   
+   enum
+   {
+      ADRG_TILE_WIDTH  = 128,
+      ADRG_TILE_HEIGHT = 128,
+      ADRG_TILE_SIZE   = 16384, // 128 * 128,
+      BAND_OFFSET      = 16384, // 8 * 2048,
+      NUMBER_OF_BANDS  = 3
+   };
+   
+   enum ADRG_COLOR
+   {
+      RED_BAND    = 0,  // the ADRG rgb value
+      GREEN_BAND  = 1,
+      BLUE_BAND   = 2
+   };
+      
+   ossimAdrgTileSource();
+
+   virtual ossimString getShortName()const;
+   virtual ossimString getLongName()const;
+
+   /**
+    *  @return Returns true on success, false on error.
+    *
+    *  @note This method relies on the data member ossimImageData::theImageFile
+    *  being set.  Callers should do a "setFilename" prior to calling this
+    *  method or use the ossimImageHandler::open that takes a file name and an
+    *  entry index.
+    */
+   virtual bool open();
+
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper
+    *  left corner of the tile to grab from the image.
+    *  Satisfies pure virtual requirement from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);   
+
+   /**
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+   virtual ossim_uint32 getNumberOfOutputBands()const;
+
+   /**
+    *  Returns the number of lines in the image.
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    *  Returns the number of samples in the image.  
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    * Returns the zero based image rectangle for the reduced resolution data
+    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   /**
+    *  Returns the image geometry object associated with this tile source or NULL if non defined.
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+
+   virtual void close();
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   virtual bool isOpen()const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width, which can be different than the
+    * internal image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileHeight which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   /**
+    * @brief Gets a property for matching name.
+    * @param name The name of the property to get.
+    * @return Returns property matching "name".
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   
+   /**
+    * @brief Gets a list of property names available.
+    * @param propertyNames The list to push back names to.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+protected:
+   virtual ~ossimAdrgTileSource();
+   
+   /**
+    *  Adjust point to even 128 boundary.  Assumes 0,0 origin.
+    */
+   void adjustToStartOfTile(ossimIpt& pt) const;
+   
+   /**
+    *  Returns true on success, false on error.
+    */
+   bool fillBuffer(const ossimIrect& tile_rect,
+                   const ossimIrect& clip_rect,
+                   ossimImageData* tile);
+   
+   ossimRefPtr<ossimImageData>  m_Tile;
+   ossim_uint8*                 m_TileBuffer;
+   std::ifstream                m_FileStr;
+   ossimAdrgHeader*             m_AdrgHeader;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimAnnotationEllipseObject.h b/include/ossim/imaging/ossimAnnotationEllipseObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationEllipseObject.h
rename to include/ossim/imaging/ossimAnnotationEllipseObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationFontObject.h b/include/ossim/imaging/ossimAnnotationFontObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationFontObject.h
rename to include/ossim/imaging/ossimAnnotationFontObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationGdBitmapFont.h b/include/ossim/imaging/ossimAnnotationGdBitmapFont.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationGdBitmapFont.h
rename to include/ossim/imaging/ossimAnnotationGdBitmapFont.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationLineObject.h b/include/ossim/imaging/ossimAnnotationLineObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationLineObject.h
rename to include/ossim/imaging/ossimAnnotationLineObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationMapGridSource.h b/include/ossim/imaging/ossimAnnotationMapGridSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationMapGridSource.h
rename to include/ossim/imaging/ossimAnnotationMapGridSource.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationMultiEllipseObject.h b/include/ossim/imaging/ossimAnnotationMultiEllipseObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationMultiEllipseObject.h
rename to include/ossim/imaging/ossimAnnotationMultiEllipseObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationMultiLineObject.h b/include/ossim/imaging/ossimAnnotationMultiLineObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationMultiLineObject.h
rename to include/ossim/imaging/ossimAnnotationMultiLineObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationMultiPolyLineObject.h b/include/ossim/imaging/ossimAnnotationMultiPolyLineObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationMultiPolyLineObject.h
rename to include/ossim/imaging/ossimAnnotationMultiPolyLineObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationMultiPolyObject.h b/include/ossim/imaging/ossimAnnotationMultiPolyObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationMultiPolyObject.h
rename to include/ossim/imaging/ossimAnnotationMultiPolyObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationObject.h b/include/ossim/imaging/ossimAnnotationObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationObject.h
rename to include/ossim/imaging/ossimAnnotationObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationObjectFactory.h b/include/ossim/imaging/ossimAnnotationObjectFactory.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationObjectFactory.h
rename to include/ossim/imaging/ossimAnnotationObjectFactory.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationPolyObject.h b/include/ossim/imaging/ossimAnnotationPolyObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationPolyObject.h
rename to include/ossim/imaging/ossimAnnotationPolyObject.h
diff --git a/ossim/include/ossim/imaging/ossimAnnotationSource.h b/include/ossim/imaging/ossimAnnotationSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAnnotationSource.h
rename to include/ossim/imaging/ossimAnnotationSource.h
diff --git a/include/ossim/imaging/ossimAppFixedTileCache.h b/include/ossim/imaging/ossimAppFixedTileCache.h
new file mode 100644
index 0000000..9470b4b
--- /dev/null
+++ b/include/ossim/imaging/ossimAppFixedTileCache.h
@@ -0,0 +1,117 @@
+//******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: This file contains the Application cache algorithm
+//
+//***********************************
+// $Id: ossimAppFixedTileCache.h 20127 2011-10-12 11:27:10Z gpotts $
+#ifndef ossimAppFixedTileCache_HEADER
+#define ossimAppFixedTileCache_HEADER
+#include <map>
+#include <list>
+#include <iostream>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIrect.h>
+#include <OpenThreads/ReadWriteMutex>
+
+class ossimFixedTileCache;
+class ossimImageData;
+
+class OSSIM_DLL ossimAppFixedTileCache
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimAppFixedTileCache& rhs);
+   static const ossim_uint32 DEFAULT_SIZE;
+   typedef ossim_int32 ossimAppFixedCacheId;
+   static ossimAppFixedTileCache *instance(ossim_uint32  maxSize   = 0);
+   virtual ~ossimAppFixedTileCache();
+   
+   /*!
+    * Will flush all cache registered
+    */
+   virtual void flush();
+   virtual void flush(ossimAppFixedCacheId cacheId);
+   virtual void deleteCache(ossimAppFixedCacheId cacheId);
+   /*!
+    * Will create a new Tile cache for this application if the tile size is 0,0 it will
+    * use the default tile size.  Will
+    * return 0 if not successful.
+    */
+   ossimAppFixedCacheId newTileCache(const ossimIrect& tileBoundaryRect,
+                                     const ossimIpt& tileSize=ossimIpt(0,0));
+   ossimAppFixedCacheId newTileCache();
+
+   virtual void setRect(ossimAppFixedCacheId cacheId,
+                        const ossimIrect& boundaryTileRect);
+   virtual void setTileSize(ossimAppFixedCacheId cacheId,
+                            const ossimIpt& tileSize);
+   
+   ossimRefPtr<ossimImageData> getTile(ossimAppFixedCacheId cacheId,
+                           const ossimIpt& origin);
+   ossimRefPtr<ossimImageData> addTile(ossimAppFixedCacheId cacheId,
+                                       ossimRefPtr<ossimImageData> data,
+                                       bool duplicateData=true);
+   
+   ossimRefPtr<ossimImageData> removeTile(ossimAppFixedCacheId cacheId,
+                                          const ossimIpt& origin);
+   void deleteTile(ossimAppFixedCacheId cacheId,
+                   const ossimIpt& origin);
+   
+   const ossimIpt& getTileSize(ossimAppFixedCacheId cacheId);
+   
+   virtual void setMaxCacheSize(ossim_uint32 cacheSize);
+   
+protected:
+//    struct ossimAppFixedCacheTileInfo
+//    {
+//    public:
+//       ossimAppFixedCacheTileInfo(ossimAppFixedCacheId appId,
+//                                  const ossimIpt& origin)
+//          :theAppCacheId(appId),
+//           theOrigin(origin)
+//          {}
+//       ossimAppFixedCacheId  theAppCacheId;
+//       ossimIpt       theOrigin;
+      
+//       bool operator ==(const ossimAppFixedCacheTileInfo &rhs)const
+//          {
+//             return (theAppCacheId == rhs.theAppCacheId &&
+//                     theOrigin     == rhs.theOrigin);
+//          } 
+//    };
+   
+   ossimAppFixedTileCache();
+   
+   ossimFixedTileCache* getCache(ossimAppFixedCacheId cacheId);
+
+   void shrinkGlobalCacheSize(ossim_int32 byteCount);
+   void shrinkCacheSize(ossimAppFixedCacheId id,
+                        ossim_int32 byteCount);
+   void shrinkCacheSize(ossimFixedTileCache* cache,
+                        ossim_int32 byteCount);
+   void deleteAll();
+   
+   static ossimAppFixedTileCache *theInstance;
+   
+   /*!
+    * Will hold the current unique Application id.
+    */
+   static ossimAppFixedCacheId    theUniqueAppIdCounter;
+   ossimIpt                       theTileSize;
+   ossim_uint32                   theMaxCacheSize;
+   ossim_uint32                   theMaxGlobalCacheSize;
+   ossim_uint32                   theCurrentCacheSize;
+
+   std::map<ossimAppFixedCacheId, ossimFixedTileCache*> theAppCacheMap;
+
+   OpenThreads::Mutex theMutex;
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimAppTileCache.h b/include/ossim/imaging/ossimAppTileCache.h
new file mode 100644
index 0000000..382ffe0
--- /dev/null
+++ b/include/ossim/imaging/ossimAppTileCache.h
@@ -0,0 +1,170 @@
+//******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: This file contains the Application cache algorithm
+//
+//***********************************
+// $Id: ossimAppTileCache.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimAppTileCache_HEADER
+#define ossimAppTileCache_HEADER
+#include <map>
+#include <list>
+using namespace std;
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimRefPtr.h>
+// class ossimTile;
+class ossimTileCache;
+class ossimDataObject;
+
+class ossimAppTileCache
+{
+public:
+   static const ossim_uint32 DEFAULT_SIZE;
+
+   static const ossim_uint32 DEFAULT_BUCKET_SIZE;
+
+   typedef ossim_int32 ossimAppCacheId;
+   typedef ossim_int32 ossimTileId;
+   typedef map<ossimAppCacheId, ossimTileCache*>::iterator AppIdIterator;
+
+   ~ossimAppTileCache();
+
+   /*!
+    *  We will force a singleton on this class.
+    */
+   static ossimAppTileCache *instance(ossim_uint32  maxSize   = 0);
+
+   /*!
+    * Will create a new Tile cache for this application.  Will
+    * return 0 if not successful.
+    */
+   ossimAppCacheId newTileCache(ossim_uint32 bucketSize=DEFAULT_BUCKET_SIZE);
+
+   /*!
+    * Will retrieve a tile from the cache.  Will return NULL
+    * if not found.
+    */
+   ossimDataObject *get(ossimAppCacheId id,
+                        const ossimDpt3d &origin,
+                        ossim_uint32 resLevel=0);
+
+   /*!
+    * Will remove a tile completly from the cache.  The
+    * returned tile is no longer owned by the cache.
+    */
+   ossimRefPtr<ossimDataObject> removeTile(ossimAppCacheId id,
+                                           const ossimDpt3d &origin,
+                                           unsigned long resLevel);
+   /*!
+    * Will insert a tile into the cache.
+    */
+   ossimRefPtr<ossimDataObject> insert(ossimAppCacheId id,
+                                       const ossimDpt3d &origin,
+                                       const ossimDataObject* data,
+                                       ossim_uint32 resLevel=0);
+   
+   /*!
+    * This will delete the specified cache. The LRU queue will
+    * be updated accordingly
+    */
+   void deleteCache(ossimAppCacheId appId);
+protected:
+
+   struct ossimAppCacheTileInfo
+   {
+   public:
+      ossimAppCacheTileInfo(ossimAppCacheId appId,
+                       const ossimDpt3d& origin,
+                       ossim_uint32    resLevel)
+         :theAppCacheId(appId),
+          theOrigin(origin),
+          theResLevel(resLevel)
+         {}
+      ossimAppCacheId  theAppCacheId;
+      ossimDpt3d         theOrigin;
+      ossim_uint32     theResLevel;
+
+      bool operator ==(const ossimAppCacheTileInfo &rhs)
+         {
+            return (theAppCacheId == rhs.theAppCacheId &&
+                    theOrigin     == rhs.theOrigin &&
+                    theResLevel   == rhs.theResLevel);
+         } 
+  
+   };
+
+   ossimAppTileCache(ossim_uint32  maxSize   = DEFAULT_SIZE)
+      :
+         theMaxCacheSize(maxSize),
+         theCurrentCacheSize(0)
+      {}
+
+   void deleteAll();
+   /*!
+    * Used to get access to the App cache.
+    */
+  ossimTileCache* get(ossimAppCacheId id);
+
+   /*!
+    * will remove all occurances of the appId from the
+    * queue
+    */
+   void deleteAppCacheFromQueue(ossimAppCacheId appId);
+
+   /*!
+    * Will remove a single instance of a tile from the queue.
+    */
+   void removeTileFromQueue(ossimAppCacheId appId,
+                            const ossimDpt3d &origin,
+                            ossim_uint32 resLevel);
+
+   void adjustQueue(ossimAppCacheId id,
+                    const ossimDpt3d &origin,
+                    ossim_uint32 resLevel);
+   /*!
+    * will pop the queue and remove that tile from its cache
+    * and return it to the caller. This is used by the insert
+    * when the max cache size is exceeded.
+    */
+   ossimRefPtr<ossimDataObject> removeTile();
+
+
+   static ossimAppTileCache *theInstance;
+   /*!
+    * Will hold the current unique Application id.
+    */
+   static ossimAppCacheId                   theUniqueAppIdCounter;
+   /*!
+    * Will hold the list of application caches
+    */
+   map<ossimAppCacheId, ossimTileCache*>  theAppCache;
+
+   /*!
+    * Is the maximum size of the cache.
+    */
+   ossim_uint32                      theMaxGlobalCacheSize;
+   ossim_uint32                      theMaxCacheSize;
+   
+
+   /*!
+    * This holds the current cache size.
+    */
+   ossim_uint32                      theCurrentCacheSize;
+   
+
+   /*!
+    * Is used in an Least recently used algorithm
+    */
+   list<ossimAppCacheTileInfo>      theUsedQueue;
+   
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimArcInfoGridWriter.h b/include/ossim/imaging/ossimArcInfoGridWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimArcInfoGridWriter.h
rename to include/ossim/imaging/ossimArcInfoGridWriter.h
diff --git a/ossim/include/ossim/imaging/ossimAtCorrGridRemapper.h b/include/ossim/imaging/ossimAtCorrGridRemapper.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAtCorrGridRemapper.h
rename to include/ossim/imaging/ossimAtCorrGridRemapper.h
diff --git a/ossim/include/ossim/imaging/ossimAtCorrKeywords.h b/include/ossim/imaging/ossimAtCorrKeywords.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAtCorrKeywords.h
rename to include/ossim/imaging/ossimAtCorrKeywords.h
diff --git a/include/ossim/imaging/ossimAtCorrRemapper.h b/include/ossim/imaging/ossimAtCorrRemapper.h
new file mode 100644
index 0000000..be043a0
--- /dev/null
+++ b/include/ossim/imaging/ossimAtCorrRemapper.h
@@ -0,0 +1,88 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kathy Minear
+//
+// Description:
+// Takes in DNs for any number of bands
+// Converts DNs to Radiance at the satellite values Lsat
+// Converts Lsat to Surface Reflectance values
+//
+//*************************************************************************
+// $Id: ossimAtCorrRemapper.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimAtCorrRemapper_HEADER
+#define ossimAtCorrRemapper_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimAtCorrRemapper : public ossimImageSourceFilter
+{
+public:
+
+   ossimAtCorrRemapper(ossimObject* owner = NULL,
+                       ossimImageSource* inputSource =  NULL,
+                       const ossimString& sensorType = "");
+
+
+   virtual ossimString getShortName() const;
+
+   virtual void initialize();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+   
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   virtual ostream& print(ostream& os) const;
+   friend ostream& operator << (ostream& os,  const ossimAtCorrRemapper& hr);
+
+   vector<double> getNormMinPixelValues() const;
+   vector<double> getNormMaxPixelValues() const;
+
+   void getNormMinPixelValues(vector<double>& v) const;
+   void getNormMaxPixelValues(vector<double>& v) const;
+
+   const ossimString& getSensorType() const;
+
+   void setSensorType(const ossimString& sensorType);
+
+protected:
+   virtual ~ossimAtCorrRemapper();
+
+   /*!
+    * Method to set unset the enable flag.
+    */
+   void verifyEnabled();
+   virtual void interpolate(const ossimDpt& pt,
+                            int band,
+                            double& a,
+                            double& b,
+                            double& c)const;
+                            
+   ossimRefPtr<ossimImageData> theTile;
+   double*            theSurfaceReflectance;
+   bool               theUseInterpolationFlag;
+   vector<double>     theMinPixelValue;
+   vector<double>     theMaxPixelValue;
+   vector<double>     theXaArray;
+   vector<double>     theXbArray;
+   vector<double>     theXcArray;
+   vector<double>     theBiasArray;
+   vector<double>     theGainArray;
+   vector<double>     theCalCoefArray;
+   vector<double>     theBandWidthArray;
+   ossimString        theSensorType;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimAtCorrRemapper_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimAtbController.h b/include/ossim/imaging/ossimAtbController.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAtbController.h
rename to include/ossim/imaging/ossimAtbController.h
diff --git a/ossim/include/ossim/imaging/ossimAtbMatchPoint.h b/include/ossim/imaging/ossimAtbMatchPoint.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAtbMatchPoint.h
rename to include/ossim/imaging/ossimAtbMatchPoint.h
diff --git a/ossim/include/ossim/imaging/ossimAtbPointSource.h b/include/ossim/imaging/ossimAtbPointSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimAtbPointSource.h
rename to include/ossim/imaging/ossimAtbPointSource.h
diff --git a/include/ossim/imaging/ossimBandAverageFilter.h b/include/ossim/imaging/ossimBandAverageFilter.h
new file mode 100644
index 0000000..2ebf11f
--- /dev/null
+++ b/include/ossim/imaging/ossimBandAverageFilter.h
@@ -0,0 +1,110 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBandAverageFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimBandAverageFilter_HEADER
+#define ossimBandAverageFilter_HEADER
+#include <vector>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/**
+ * This filter outputs a single band that is the weighted average of all the
+ * input bands retrieved from the getTile.  This filter will work with any
+ * input scalar type.  Note the OSSIMDLLEXPORT is used for the different
+ * compilers that require importing and exporting symbols for shared library
+ * support.
+ */
+class OSSIMDLLEXPORT ossimBandAverageFilter : public ossimImageSourceFilter
+{
+public:
+   ossimBandAverageFilter();
+   ossimBandAverageFilter(ossimImageSource* input,
+                          const std::vector<double>& weights);
+
+   /**
+    * The data object argument is deprecated and should not be used.
+    * eventually we will remove it from the base classes.  This method will
+    * return 1 if our source is enabled else it calls the base class
+    * getNumberOfOutputBands.
+    */
+   virtual ossim_uint32 getNumberOfOutputBands()const;
+   
+   /**
+    * Since this filter is going to operate in native pixel type we will use
+    * a tmeplate method to do this.  It will check the scalar tpe of the input
+    * and then cat it to set the template variabel to be used within the
+    * template method averageInput.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Since we are merging all bands we will use the null pix of the
+    * first input band as our null pix.  If we are disabled we just
+    * return the input s null
+    */
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * We will use the min of all bands as our min.  If we aredisabled
+    * we just return the inputs min
+    */
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   
+   /**
+    * We will use the max of all bands as our max.  If we aredisabled
+    * we just return the inputs max
+    */
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * simple access method to get a weight
+    */
+   double getWeight(ossim_uint32 band)const;
+
+   /**
+    * Sinple access method to set the weight of a band,
+    * We make sure that it is a positive weight
+    */
+   void setWeight(ossim_uint32 band, double weight);
+
+   /**
+    * allocates its tile buffer
+    */
+   virtual void initialize();
+
+   /**
+    * loads its weights to a keywordlist
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   /**
+    * Saves its weights to a keywordlist
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+protected:
+   virtual ~ossimBandAverageFilter();
+   
+  ossimRefPtr<ossimImageData> theTile;
+   std::vector<double>         theWeights;
+
+   void checkWeights();
+   
+   template<class T> void averageInput(
+      T dummyVariable, // used only for template type, value ignored
+      ossimRefPtr<ossimImageData> inputDataObject);
+
+// for Runtime Type Info (RTTI)
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimBandClipFilter.h b/include/ossim/imaging/ossimBandClipFilter.h
new file mode 100644
index 0000000..f925082
--- /dev/null
+++ b/include/ossim/imaging/ossimBandClipFilter.h
@@ -0,0 +1,92 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBandClipFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimBandClipFilter_HEADER
+#define ossimBandClipFilter_HEADER
+#include <vector>
+using namespace std;
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimBandClipFilter : public ossimImageSourceFilter
+{
+public:
+   /*!
+    * Specifies the type of clipping.  The first will
+    * just clip and 
+    */
+   enum ossimBandClipType
+   {
+      ossimBandClipType_NONE             = 0,
+      ossimBandClipType_CLIP             = 1,
+      ossimBandClipType_CLAMP            = 2,
+      ossimBandClipType_LINEAR_STRETCH   = 3,
+      ossimBandClipType_MEDIAN_STRETCH   = 4 
+   };
+
+   ossimBandClipFilter();
+   ossimBandClipFilter(ossimImageSource*,
+                        const vector<double>& minPix,
+                        const vector<double>& maxPix,
+                        ossimBandClipType clipType=ossimBandClipType_NONE);
+   
+   ossimBandClipFilter(ossimImageSource*,
+                        double minPix,
+                        double maxPix,
+                        ossimBandClipType clipType=ossimBandClipType_NONE);
+
+
+   void setClipType(ossimBandClipType clipType);
+
+   ossimBandClipType getClipType()const;
+
+   virtual ossim_uint32 getNumberOfValues()const;
+
+   void setNumberOfValues(ossim_uint32 size);
+   
+   void setMinMaxPix(const vector<double>& minPix,
+                     const vector<double>& maxPix);
+
+   const std::vector<double>& getMinPixList()const;
+   const std::vector<double>  getMaxPixList()const;
+
+   double getMinPix(ossim_uint32 index)const;
+   double getMaxPix(ossim_uint32 index)const;
+
+   ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                       ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = NULL);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = NULL)const;
+protected:
+   virtual ~ossimBandClipFilter();
+
+   void runClip();
+   void runClamp();
+   void runLinearStretch();
+   void runMedianStretch();
+
+   std::vector<double> theMinPix; // normalized min
+   std::vector<double> theMaxPix; // normalized max
+   std::vector<double> theMedian; // normalized median.
+
+   ossimBandClipType           theClipType;
+   ossimRefPtr<ossimImageData> theTile;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimBandLutFilter.h b/include/ossim/imaging/ossimBandLutFilter.h
new file mode 100644
index 0000000..8565a21
--- /dev/null
+++ b/include/ossim/imaging/ossimBandLutFilter.h
@@ -0,0 +1,152 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************
+// $Id: ossimBandLutFilter.h 23616 2015-11-11 19:50:29Z dburken $
+#ifndef ossimBandLutFilter_HEADER
+#define ossimBandLutFilter_HEADER
+
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+
+class ossimImageData;
+
+/***************************************************************************************************
+ *
+ * This class provides a look-up-table remap capability for performing band-separate remapping to
+ * an output with the same number of bands. This is similar to ossimIndexToRgbLutFilter except it
+ * works independently on the input bands. The number of output bands is necessarily equal to the
+ * number of input bands, but the scalar data type between input and output can be different (just
+ * like with the ossimScalarRemapper).
+ *
+ * The LUT is provided as a KWL with several remapping modes supported:
+ *
+ * Literal: Only those indices represented in the KWL are remapped to the values indicated. All
+ * other pixel values are mapped to the NULL pixel (0,0,0). Note that this is only meaningful for
+ * integer input scalar types since a normalized input will likely not find an exact match.
+ *
+ * Arbitrary piecewise linear ("vertices"): The LUT KWL provides vertices to contiguous line
+ * segments. Pixel values falling between specified indices are linearly interpolated between
+ * adjacent vertices. Any index pixel values falling outside the range between min and max vertex
+ * indices will be mapped to the NULL pixel.
+ *
+ * Regular piecewise linear ("regular"): The entries in the KWL do not correspond to any specific
+ * index (except the first and the last entries that correspond to the min and max pixel values).
+ * Remaining intermediate entries are equally spaced in index space so that the line segments are of
+ * equal length. The min and max values are queried from the input source, but can be overriden with
+ * the "min_value" and "max_value" keywords in the LUT KWL.
+ *
+ * Here are example KWLs for the three modes, Note that the band identifier is optional if the input
+ * image is single band, or if the same LUT is to be applied to all bands.
+ *
+ * If the input is multi-band, the same mode applies to all bands. The band numbers are 0-based.
+ * If band-specific entries are being provided (i.e., the "band" prefix is being used) then at least
+ * one entry for each band must be provided, otherwise remaining bands will be ignored.
+ *
+ * First for the "literal" remap:
+ *
+ *    type: ossimBandLutFilter
+ *    mode: literal
+ *    [band0.]entry0.in: 0
+ *    [band0.]entry0.out: 1
+ *    [band0.]entry1.in: 128
+ *    [band0.]entry1.out: 2
+ *    [band0.]entry2.in: 255
+ *    [band0.]entry2.out: 3
+ *
+ * The above KWL will map only pixels with input values of 0, 128, and 255. All other indices will
+ * map to the null value. This mode is not appropriate for floating-point input scalar types.
+ * However, no checks are made so pay attention to what you put in your LUT!
+ *
+ * Example for arbitrary piecewise linear, a.k.a. "interpolated" mode:
+ *
+ *    type: ossimBandLutFilter
+ *    mode: interpolated
+ *    [band0.]entry0.in: 0.1
+ *    [band0.]entry0.out: 255
+ *    [band0.]entry1.in: 0.5
+ *    [band0.]entry1.out: 128
+ *    [band0.]entry2.in: 0.90
+ *    [band0.]entry2.out: 1
+ *
+ * The above KWL is a sort of heat map where input values between 0 and 0.5 will linearly map to
+ * discrete numbers 255 to 128. Then values between 0.5 to 1.0 will linearly map to
+ * values 128 down to 0. Effectively this inverts the colors and performs a scalar remap to UInt8.
+ * Note that any input values below 0.1 ad above 0.9 are outside of the remap range and will map to
+ * the null pixel. This mode is appropriate for both integer and floating-point inputs.
+ *
+ * The table can be contained in a separate file from the main KWL state file. In this case, the
+ * loadState can accept a file name in place of a complete table:
+ *
+ *    type: ossimBandLutFilter
+ *    lut_file: <path to LUT KWL file>
+ * 
+ * The format of the LUT KWL file is just as specified above for the inline case.
+ *
+ * If you want an output scalar type different from the input scalar type, you will need to indicate
+ * that either programmatically or via the keyword (specified in the state KWL or LUT KWL file:
+ *
+ * scalar_type: <ossimScalarType> (see ossimScalarTypeLut for list of enumerated strings)
+ *
+ **************************************************************************************************/
+class OSSIM_DLL ossimBandLutFilter : public ossimImageSourceFilter
+{
+public:
+   enum Mode  { UNKNOWN=0, LITERAL = 1, INTERPOLATED  = 2 };
+
+   ossimBandLutFilter();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   void           setMode(Mode mode) { theMode = mode; }
+   Mode           getMode() const { return theMode; }
+
+   virtual ossimScalarType getOutputScalarType() const { return theOutputScalarType; }
+
+   /**
+    *  Sets the output scalar type.
+    */
+   virtual void setOutputScalarType(ossimScalarType scalarType);
+   virtual void setOutputScalarType(ossimString scalarType);
+
+   /**
+    * This opens the keyword list and initializes lut.
+    * @param file Keyword list containing lut.
+    */
+   void           setLut(const ossimFilename& file);
+
+   virtual void initialize();
+
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
+
+protected:
+   virtual ~ossimBandLutFilter();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   bool initializeLut(const ossimKeywordlist& kwl, const char* prefix=0);
+   
+   std::vector< std::map<double, double> > theLut;
+
+   Mode   theMode;
+   ossimRefPtr<ossimImageData> theTile;
+   ossimFilename   theLutFile;
+   ossimScalarType  theOutputScalarType;
+   
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimBandLutFilter_HEADER */
diff --git a/include/ossim/imaging/ossimBandMergeSource.h b/include/ossim/imaging/ossimBandMergeSource.h
new file mode 100644
index 0000000..b7b0e16
--- /dev/null
+++ b/include/ossim/imaging/ossimBandMergeSource.h
@@ -0,0 +1,62 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBandMergeSource.h 23108 2015-01-27 17:00:20Z okramer $
+#ifndef ossimBandMergeSource_HEADER
+#define ossimBandMergeSource_HEADER
+#include <ossim/imaging/ossimImageCombiner.h>
+
+class ossimImageSourceConnection;
+class ossimImageSource;
+
+class OSSIM_DLL ossimBandMergeSource : public ossimImageCombiner
+{
+public:
+   ossimBandMergeSource();
+   ossimBandMergeSource(ossimConnectableObject::ConnectableObjectList& inputSources);
+   
+   /**
+    * This will merge all the bands from the input source list
+    * into one contiguous ossimImageData object.  This is very
+    * useful when you want to split off an intesity channel in
+    * HSI and then run some algorithms on it and then merge it back.
+    * You can also try to do fusions by converting to an YCbCr and
+    * replace the Y or intensity channel with maybe a high-pass
+    * convolution on the pan.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0);
+   virtual bool getTile(ossimImageData* tile, ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+   
+   /**
+    * Returns the number of bands in a tile returned from this TileSource.
+    * Note: we are supporting sources that can have multiple data objects.
+    * If you want to know the scalar type of an object you can pass in the 
+    */
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   
+protected:
+   virtual ~ossimBandMergeSource();
+   /** Performs allocation of "theTile". */
+   void allocate();
+   
+   ossim_uint32                theNumberOfOutputBands;
+   ossimRefPtr<ossimImageData> theTile;
+   
+   ossim_uint32 computeNumberOfInputBands()const;
+
+TYPE_DATA
+};
+#endif /* #ifndef ossimBandMergeSource_HEADER */
diff --git a/include/ossim/imaging/ossimBandSelector.h b/include/ossim/imaging/ossimBandSelector.h
new file mode 100644
index 0000000..814166a
--- /dev/null
+++ b/include/ossim/imaging/ossimBandSelector.h
@@ -0,0 +1,189 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author:  Garrett Potts
+//
+// Description:  Contains class declaration for ossimBandSelector.
+// 
+//*******************************************************************
+//  $Id$
+#ifndef ossimBandSelector_HEADER
+#define ossimBandSelector_HEADER 1
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+ 
+class ossimImageData;
+class ossimImageHandler;
+
+class OSSIM_DLL ossimBandSelector : public ossimImageSourceFilter
+{
+   
+public:
+   enum ossimBandSelectorWithinRangeFlagState
+   {
+      ossimBandSelectorWithinRangeFlagState_NOT_SET      = 0,
+      ossimBandSelectorWithinRangeFlagState_IN_RANGE     = 1,
+      ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE = 2,
+   };
+
+   ossimBandSelector();
+   virtual ~ossimBandSelector();
+   
+   virtual ossimString getLongName()  const;
+   virtual ossimString getShortName() const;
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Initializes bandList to the zero based order of output bands.
+    */
+   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
+
+
+   /**
+    * @brief Will set to three bands (rgb) out.
+    *
+    * This will attempt to auto detect the zero based rgb band order from the
+    * input image handler.  If the result is < 3 bands we will
+    * not increase the band output by adding more bands.  For example,  
+    * if the input is grey or thermal then it will just output one band for
+    * a default allocation.  Note,  this can be overriden by explicitly setting
+    * the output band list.  
+    * 
+    * If the image handler implemented getRgbBandList(...) it will use that:
+    *    bands = 2,1,0 ( or whatever handler thinks rgb is )
+    * else if 3 band or greater and can't determine rgb:
+    *    bands = 0,1,2
+    * else (less than three bands)
+    *    bands = 0
+    */
+   virtual void setThreeBandRgb();
+    
+   /**
+    * Sets the output band list.
+    *
+    * @param outputBandList List of zero based bands.
+    * @param disablePassThru If true, forces the band selection to be performed by this filter.
+    *        Otherwise, the image handler to the left is directed to select bands if it has that
+    *        capability (default behavior).
+    *
+    * @note The input connection should be established prior to calling this.
+    *
+    * @note Bands can be duplicated.  So if you have a single band input you
+    * can do a band list like "1, 1, 1".   Any band within the list must be
+    * available from the input.  So if you have a 3 band input bands must be
+    * constrained to zero based bands "0, 1, or 2".
+    *
+    * @note Calling this method does not enable filter so callers should do:
+    * theBandSelector->enableSource();
+    * theBandSelector->setOutputBandList(bandList);
+    */
+   virtual void setOutputBandList(const vector<ossim_uint32>& outputBandList,
+                                  bool disablePassThru=false);
+   
+   /**
+    * Returns the number of bands in a tile returned from this TileSource.
+    */
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+
+   /**
+    * @brief Returns the number of input bands.
+    *
+    * Overrides ossimImageSourceFilter::getNumberOfInputBands to check for a
+    * single image chain band selectable image handler on the input.  If one
+    * is present it returns it's number of input bands instead of the number
+    * of the input connection's output bands(our input).  This is needed so
+    * callers, e.g. band selector dialog box can query the number of bands
+    * available.
+    *
+    * @return Number of bands available.
+    */
+   virtual ossim_uint32 getNumberOfInputBands()const;   
+
+   virtual void initialize();
+   
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+   /**
+    *   Override base class so that a disableSource event does not
+    *   reinitialize the object and enable itself.
+    */
+   //virtual void propertyEvent(ossimPropertyEvent& event);
+   //virtual void refreshEvent(ossimRefreshEvent& event);   
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;						  
+   virtual bool isSourceEnabled()const;
+
+protected:
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+
+   /**
+    * Will check all combinations of the band list to see if its 
+    */
+   void checkPassThrough();
+
+   /**
+    * @return true if all bands in theOutputBandList are less than the
+    * number of input's bands.
+    */
+   bool outputBandsWithinInputRange() const;
+
+   /**
+    * @brief Finds and returns band selectable image handler.
+    *
+    * To get a valid pointer there must be one and only one image handler on
+    * the input connection and it must be a band selector.  In other words,
+    * must be a single image chain input and
+    * ossimImageHandler::isBandSelector() must return true.
+    *
+    * @return Pointer to image handler wrapped in an ossimRefPtr on success;
+    * null, on error.
+    */
+   ossimRefPtr<ossimImageHandler> getBandSelectableImageHandler() const;
+
+   /**
+    * @brief Attempts to derive rgb bands from image handler to the left of the
+    * band selector.
+    *
+    * Must be one and only one image handler on the input connection.
+    * In other words, must be a single image chain input.
+    *
+    * @return true on success, false on error.
+    */
+   bool getRgbBandList(std::vector<ossim_uint32>& bandList) const;
+   
+   ossimRefPtr<ossimImageData>           m_tile;
+   std::vector<ossim_uint32>             m_outputBandList;
+   ossimBandSelectorWithinRangeFlagState m_withinRangeFlag;
+   bool                                  m_passThroughFlag;
+   bool                                  m_delayLoadRgbFlag;
+   bool                                  m_inputIsSelectable;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimBandSelector_HEADER */
diff --git a/include/ossim/imaging/ossimBandSeparateHandler.h b/include/ossim/imaging/ossimBandSeparateHandler.h
new file mode 100644
index 0000000..4beaac3
--- /dev/null
+++ b/include/ossim/imaging/ossimBandSeparateHandler.h
@@ -0,0 +1,97 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+// 
+// Description:
+//
+// Image handler used when the multi-band image has each band represented by a different disk file.
+// This is the case for some Ikonos imagery. 
+//
+//**************************************************************************************************
+// $Id: ossimBandSeparateHandler.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+#ifndef ossimBandSeparateHandler_HEADER
+#define ossimBandSeparateHandler_HEADER
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimBandMergeSource.h>
+
+/**
+ *  This class defines an abstract Handler which all image handlers(loaders)
+ *  should derive from.
+ */
+class OSSIMDLLEXPORT ossimBandSeparateHandler : public ossimImageHandler
+{
+public:
+   //!  Constructor (default):
+   ossimBandSeparateHandler();
+   
+   //! Destructor:
+   virtual ~ossimBandSeparateHandler();
+   
+   //! Opens multiple band-files based on info in metadata file.
+   //! @return Returns true on success, false on error.
+   virtual bool open();
+
+   //! Closes all band-files and clears input handler list.
+   virtual void close();
+
+   //! @return true if open, false if not.
+   virtual bool isOpen()const;
+
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+   //! @param resLevel Reduced resolution level to return lines of.
+   //! Default = 0
+   //! @return The number of lines for specified reduced resolution level.
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
+
+   //! @param resLevel Reduced resolution level to return samples of.
+   //! Default = 0
+   //! @return The number of samples for specified reduced resolution level.
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+   
+   //! Method to save the state of an object to a keyword list.
+   //! Return true if ok or false on error.
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   //! Method to the load (recreate) the state of an object from a keyword
+   //! list.  Return true if ok or false on error.
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   //! Fills the requested tile by pulling pixels from multiple file tiles as needed.
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel);
+
+   //! Returns scalar type of first band (should be the same for all bands)
+   virtual ossimScalarType getOutputScalarType() const;
+
+   //! Overrides base connection method to connect output of merge source.
+   virtual bool canConnectMyOutputTo(ossim_int32 index, const ossimConnectableObject* obj);
+
+   //! Returns the geometry of the first band:
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   //! These images are not tiled
+   virtual ossim_uint32 getImageTileWidth()  const { return 0; }
+   virtual ossim_uint32 getImageTileHeight() const { return 0; }
+
+protected:
+   //! Fetches the list of band file names from the header file. The header file name is contained
+   //! in ossimImageHandler::theImageFile.
+   //! NOTE TO PROGRAMMER: This class is presently tailored to the Ikonos metadata file specifying
+   //! the individual band files. If other "metadata" formats are to be supported, then this class
+   //! should be derived from. This method would therefore be pure virtual in this base-class and 
+   //! only this method would need to be implemented in the derived classes.
+   virtual void getBandFileNames(vector<ossimFilename>& file_names);
+
+  vector<ossimRefPtr<ossimImageHandler> > m_bandFiles;
+  ossimRefPtr<ossimBandMergeSource>       m_mergeSource;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimBandSeparateHandler_HEADER */
diff --git a/include/ossim/imaging/ossimBitMaskTileSource.h b/include/ossim/imaging/ossimBitMaskTileSource.h
new file mode 100644
index 0000000..3799de3
--- /dev/null
+++ b/include/ossim/imaging/ossimBitMaskTileSource.h
@@ -0,0 +1,133 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+//*******************************************************************
+//  $Id: ossimBitMaskTileSource.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#ifndef ossimBitMaskTileSource_HEADER
+#define ossimBitMaskTileSource_HEADER
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimBitMaskWriter.h>
+
+class ossimImageGeometry;
+
+//*************************************************************************************************
+//! This is the image handler for providing mask pixels to an ossimMaskFilter object.
+//!
+//! This class takes care of reading the custom, bit-compressed OSSIM bit mask file format. 
+//! 
+//! When the developer needs to mask an image, the following needs to be done:
+//!
+//!   Creating the Mask:
+//!   1. A mask file first needs to be created using ossimBitMaskWriter and a source image. The app
+//!      "img2rr --create-mask" directs that program to use ossimBitMaskWriter to generate a mask  
+//!      during overview generation. There is also create-bitmask app that will generate the mask.
+//!   2. An OSSIM ".mask" file should exist on disk after step 0. This is typically the same base 
+//!      name as the source image file being masked.
+//!   
+//!   Using the Mask:
+//!   1. An ossimBitMaskTileSource (derived from ossimImageHandler) needs to be instantiated and
+//!      the mask file name used to open it. 
+//!   3. An ossimMaskFilter (derived from ossimImageCombiner) is the actual filter that combines
+//!      the source image handler and the ossimBitMaskTileSource object to provide the resultant 
+//!      masked tiles.
+//!      
+//! The OSSIM bit mask file contains a small header that consists of:
+//!    magic number,
+//!    starting res level,
+//!    number of res levels
+//!    num columns at starting res level,
+//!    num rows at starting res level, 
+//!    num columns at 2nd res level,
+//!    num rows at 2nd res level, 
+//!    etc., for all res levels
+//!    <space> 
+//!    <compressed binary mask data>
+//!
+//! The number of rows and columns represents the number of bytes in the mask, with each byte
+//! containing 8 alpha mask bits representing 8 pixels in the original image.
+//!
+//! This class functions as an image handler, returning 255 for unmasked pixels, and 0 for masked 
+//! pixels. 
+//! 
+//! For debug purposes, this code initializes the tile to all 128's so that the 
+//! ossimMaskFilter can recognize uninitialized mask data.
+//!
+//*************************************************************************************************
+
+class OSSIM_DLL ossimBitMaskTileSource : public ossimImageHandler
+{
+public:
+
+   ossimBitMaskTileSource();
+
+   //! Return a tile of masks. These are "bit masks", i.e., either 0 (hide) or 1 (show).
+   //! The pixels' remaining 7 bits are cleared and should not be used.
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect, ossim_uint32 rLevel=0);
+   
+   virtual bool         isValidRLevel     (ossim_uint32 res_level)   const;
+   virtual ossim_uint32 getNumberOfLines  (ossim_uint32 res_level=0) const;
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 res_level=0) const;
+
+   virtual ossim_uint32    getNumberOfInputBands()  const { return 1; }
+   virtual ossim_uint32    getNumberOfOutputBands() const { return 1; }
+   virtual ossimScalarType getOutputScalarType()    const { return OSSIM_UINT8; }
+   virtual ossim_uint32    getImageTileWidth()      const { return 0; }
+   virtual ossim_uint32    getImageTileHeight()     const { return 0; }   
+
+   virtual bool isOpen() const;
+   virtual bool open();
+   virtual void close();
+
+   virtual double getNullPixelValue(ossim_uint32 /*band=0*/) const { return 0; }
+   virtual double getMinPixelValue (ossim_uint32 /*band=0*/) const { return 0; }
+   virtual double getMaxPixelValue (ossim_uint32 /*band=0*/) const { return 1.0; }
+
+   //! There is no geometry associated with a mask file -- it is pixel-for-pixel mapped to
+   //! an image file. The image file must have the valid geometry.
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   //! Overrides base class implementation.
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+
+   //! For backward compatibility with older mask format ("Ming Mask"), provide for associating
+   //! the mask with an image handler:
+   void setAssociatedImageHandler(ossimImageHandler* handler);
+
+   //! This class can be used during overview generation, in which case there will be a simultaneous
+   //! mask writing. Instead of accessing a mask file (which may not yet exist), the mask buffer
+   //! of the writer will be accessed directly instead of our own buffer.
+   void setAssociatedMaskWriter(ossimBitMaskWriter* maskWriter);
+
+protected:
+   virtual ~ossimBitMaskTileSource();
+   
+   //! Returns true if this handler recognizes the file name extension as an OSSIM raster mask file.
+   bool isSupportedExtension();
+
+   virtual void establishDecimationFactors();
+
+   ossimRefPtr<ossimImageData>  m_tile;
+   vector<ossim_uint8*>         m_buffers;
+   vector<ossimIpt>             m_bufferSizes;
+   
+   //! For backward compatibility with older mask format ("Ming Mask"), provide for associating
+   //! the mask with an image handler:
+   ossimRefPtr<ossimImageHandler>  m_handler;
+
+   //! This class can be used during overview generation, in which case there will be a simultaneous
+   //! mask writing. Instead of accessing a mask file (which may not yet exist), the mask buffer
+   //! of the writer will be accessed directly instead of our own buffer.
+   ossimRefPtr<ossimBitMaskWriter>  m_maskWriter;
+
+   TYPE_DATA
+};
+
+#endif
+
diff --git a/include/ossim/imaging/ossimBitMaskWriter.h b/include/ossim/imaging/ossimBitMaskWriter.h
new file mode 100644
index 0000000..794669f
--- /dev/null
+++ b/include/ossim/imaging/ossimBitMaskWriter.h
@@ -0,0 +1,133 @@
+//*************************************************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+//*************************************************************************************************
+//  $Id: ossimBitMaskWriter.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#ifndef ossimBitMaskWriter_HEADER
+#define ossimBitMaskWriter_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimOutputSource.h>
+#include <ossim/imaging/ossimPixelFlipper.h>
+#include <vector>
+
+class ossimFilename;
+class ossimKeywordlist;
+class ossimImageHandler;
+class ossimBitMaskTileSource;
+
+//*************************************************************************************************
+//! 
+//! Class for computing a mask from an input image source and writing the mask file to disk.
+//!
+//! This class takes care of all details associated with computing, writing and reading the custom,
+//! bit-compressed OSSIM bit mask file format. 
+//! 
+//! When the developer needs to mask an image, the following needs to be done:
+//!
+//!   Creating the Mask:
+//!   1. A mask file first needs to be created using ossimBitMaskWriter and a source image. The app
+//!      "img2rr --create-mask" directs that program to use ossimBitMaskWriter to generate a mask  
+//!      during overview generation. There is also create-bitmask app that will generate the mask.
+//!   2. An OSSIM ".mask" file should exist on disk after step 0. This is typically the same base 
+//!      name as the source image file being masked.
+//!   
+//!   Using the Mask:
+//!   1. An ossimBitMaskTileSource (derived from ossimImageHandler) needs to be instantiated and
+//!      the mask file name used to open it. 
+//!   3. An ossimMaskFilter (derived from ossimImageCombiner) is the actual filter that combines
+//!      the source image handler and the ossimBitMaskTileSource object to provide the resultant 
+//!      masked tiles.
+//!      
+//! The OSSIM bit mask file contains a small header that consists of:
+//!    magic number,
+//!    starting res level,
+//!    number of res levels
+//!    num columns at starting res level,
+//!    num rows at starting res level, 
+//!    num columns at 2nd res level,
+//!    num rows at 2nd res level, 
+//!    etc., for all res levels
+//!    <space> 
+//!    <compressed binary mask data>
+//!
+//! The number of rows and columns represents the number of bytes in the mask, with each byte
+//! containing 8 alpha mask bits representing 8 pixels in the original image.
+//!
+//! The mask is computed here using the specified values for bogus pixels. If a pixel in the source
+//! image is in the range of bogus values, a mask of 0 is assigned to that pixel, otherwise 1. 
+//!
+//*************************************************************************************************
+class OSSIM_DLL ossimBitMaskWriter : public ossimOutputSource
+{
+public:
+   static const char* BM_STARTING_RLEVEL_KW;
+   static const char* MASK_FILE_MAGIC_NUMBER;
+
+   //! Default constructor typically used when reading a mask from disk.
+   ossimBitMaskWriter();
+
+   ~ossimBitMaskWriter();
+
+   //! Sets the NULL pixel value to consider when computing mask:
+   void setBogusPixel(double pixel_value);
+
+   //! Sets the range of pixels (inclusive) to be regarded as NULL pixels when computing mask
+   void setBogusPixelRange(double min, double max);
+
+   //! Sets the starting resolution level for the mask.
+   void setStartingResLevel(ossim_uint32 res_level) { m_startingResLevel = res_level; }
+
+   //! Given a source's tile, derives the alpha mask and saves it in buffer for later writing to 
+   //! disk.
+   void generateMask(ossimRefPtr<ossimImageData> tile, ossim_uint32 rLevel);
+
+   //! For imagery that already has overviews built, but with artifact edge pixels (such as JP2-
+   //! compressed data), it is preferred to build the mask overviews directly from the R0 mask.
+   //! This method will build the remaining number of R-levels from the last defined mask buffer
+   //! such that the total number of R-levels (counting R0) are represented. Returns TRUE if successful.
+   bool buildOverviews(ossim_uint32 total_num_rlevels);
+
+   //! Computes and writes the mask file according to the specification in the KWL.
+   //! Returns TRUE if successful.
+   virtual bool loadState(const ossimKeywordlist& spec, const char* prefix=0);
+
+   virtual bool isOpen() const;
+   virtual bool open();
+   virtual void close();
+
+   virtual bool canConnectMyInputTo(ossim_int32 myInputIndex, 
+                                    const ossimConnectableObject* object) const;
+   virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, 
+                                         bool makeOutputConnection=true, 
+                                         bool createEventFlag=true);
+
+protected:
+   friend class ossimBitMaskTileSource;
+
+   //! Initializes the flipper (used for identifying pixels for masking) to default values
+   void initializeFlipper();
+
+   //! Deletes allocated buffers and resets all values to defaults.
+   void reset();
+
+   //! Since overviews may not yet exist when the mask is being written, we must compute the
+   //! size of the source image based on the original R0 image size.
+   ossimIpt computeImageSize(ossim_uint32 rlevel, ossimImageData* tile) const;
+
+   ossimRefPtr<ossimPixelFlipper>  m_flipper;
+   vector<ossim_uint8*>            m_buffers;
+   vector<ossimIpt>                m_bufferSizes;
+   ossim_uint32                    m_startingResLevel;
+   ossimIpt                        m_imageSize; //!< Size of full res source image
+};
+
+#endif
+
diff --git a/include/ossim/imaging/ossimBlendMosaic.h b/include/ossim/imaging/ossimBlendMosaic.h
new file mode 100644
index 0000000..f9a7bbe
--- /dev/null
+++ b/include/ossim/imaging/ossimBlendMosaic.h
@@ -0,0 +1,78 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBlendMosaic.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimBlendMosaic_HEADER
+#define ossimBlendMosaic_HEADER
+#include <ossim/imaging/ossimImageMosaic.h>
+
+class OSSIMDLLEXPORT ossimBlendMosaic : public ossimImageMosaic
+{
+public:
+   ossimBlendMosaic();
+   ossimBlendMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
+   virtual void initialize();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+
+   void setWeight(ossim_uint32 index, double weight);
+   void setWeights(const std::vector<double>& weights);
+   
+   double getWeight(ossim_uint32 index) const;
+   const std::vector<double>& getWeights()const;
+
+
+   void setNumberOfWeights(ossim_uint32 numberOfWeights);
+   void setAllWeightsTo(double value);
+   
+   /**
+    * Will find the min and max values and then
+    * normalize all weights to be from 0 to 1
+    */
+   void normalizeWeights();
+   void findMinMax(double& minValue, double& maxValue)const;
+   
+protected:
+   virtual ~ossimBlendMosaic();
+   vector<double>              theWeights;
+   ossimRefPtr<ossimImageData> theNormResult;
+   /**
+    * If our inputs have output of different scalar
+    * types then we must normalize so we can blend
+    * different scalar data together.
+    */
+   
+
+   template <class T>
+      ossimRefPtr<ossimImageData> combine(T,
+                                          const ossimIrect& tileRect,
+                                          ossim_uint32);
+   template <class T>
+      ossimRefPtr<ossimImageData> combineNorm(T,
+                                              const ossimIrect& tileRect,
+                                              ossim_uint32);
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimBlendMosaic_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimBrightnessContrastSource.h b/include/ossim/imaging/ossimBrightnessContrastSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimBrightnessContrastSource.h
rename to include/ossim/imaging/ossimBrightnessContrastSource.h
diff --git a/include/ossim/imaging/ossimBrightnessMatch.h b/include/ossim/imaging/ossimBrightnessMatch.h
new file mode 100644
index 0000000..3708f84
--- /dev/null
+++ b/include/ossim/imaging/ossimBrightnessMatch.h
@@ -0,0 +1,57 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: A brief description of the contents of the file.
+//
+//*************************************************************************
+// $Id: ossimBrightnessMatch.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimBrightnessMatch_HEADER
+#define ossimBrightnessMatch_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimBrightnessContrastSource.h>
+
+class ossimBrightnessMatch : public ossimImageSourceFilter
+{
+public:
+   ossimBrightnessMatch();
+
+
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+
+   virtual void initialize();
+   /*---------------------- PROPERTY INTERFACE ---------------------------*/
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   /*--------------------- PROPERTY INTERFACE END ------------------------*/
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+protected:
+   virtual ~ossimBrightnessMatch();
+   
+   double          theTargetBrightness;
+   double          theInputBrightness;
+   ossimRefPtr<ossimImageData> theNormTile;
+
+   ossimRefPtr<ossimBrightnessContrastSource> theBrightnessContrastSource;
+   
+   ossimRefPtr<ossimImageData> runBrightnessMatch();
+
+   void computeInputBrightness();
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimBumpShadeTileSource.h b/include/ossim/imaging/ossimBumpShadeTileSource.h
new file mode 100644
index 0000000..d6646b7
--- /dev/null
+++ b/include/ossim/imaging/ossimBumpShadeTileSource.h
@@ -0,0 +1,283 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBumpShadeTileSource.h 23108 2015-01-27 17:00:20Z okramer $
+#ifndef ossimBumpShadeTileSource_HEADER
+#define ossimBumpShadeTileSource_HEADER
+#include <ossim/imaging/ossimImageCombiner.h>
+#include <ossim/base/ossimPropertyEvent.h>
+#include <ossim/matrix/newmat.h>
+
+class ossimImageData;
+
+class ossimImageSourceConnection;
+
+/**
+ * This uses a derivative of Blinn's bump function to compute a 3-D
+ * looking image.  The elevation data can be from Grey Scale image or from
+ * a Dted file.  This class can take one or two inputs.  The First input is an
+ * elevation input that is used to compute a perturbed Normal which is
+ * used in a simple lambertian shading equation.  The second input is some
+ * color source (Grey or RGB) that defines the diffuse color used within
+ * the illumination equation for each pixel. If the diffuse color input is not
+ * supplied then an all white color is used for the color.  There are several
+ * adjustable parameters that can be set:
+ * 1) the Incident light vector described by the Azimuth and Elevation Angle,
+ * 2) the pixel scale used along the x and y direction, and
+ * 3) the partial derivative matrix used for the partial derivative
+ * computation along the x and y direction.
+ *
+ * <pre>
+ * 
+ * Some examples of good values:
+ *
+ * If we are using dted 90 meters as input for shading then:
+ * 1) set pixel scale to 180.  Since the partials do 2*dx and 2*dy then
+ *    the scale is 2*90meters = 180.
+ * 2) set azimuth angle to 45 and set elevation angle to 45 degrees.  Change
+ *    them to see the effects.
+ * 3) use the following matrix -1 0 1
+ *                             -1 0 1
+ *                             -1 0 1
+ *                                &
+ *                              1  1  1
+ *                              0  0  0
+ *                             -1 -1 -1
+ * 
+ *    for the partials along x and y directions respectively.  These matrices
+ *
+ *    (f(x+dx, y) - f(x-dx, y))/2*dx and
+ *    (f(x, y+dy) - f(x, y-dy))/2*dy
+ *
+ *    for an apprximate derivative about some point x, y
+ *
+ * If we are using pixel intesity (1 - 255) then set the scales to around
+ * 100.
+ *
+ *  Note: varying the scales will vary the smoothness/roughness of the surface
+ *        Smaller the scale the rougher the surface will look.
+ *
+ * The output of this source is always a 3-band 8-bit image.
+ *
+ * Keywords:
+ *   type:               ossimBumpShadeTileSource
+ *   azimuth_angle:      45.000000000000000
+ *   elevation_angle:    45.000000000000000
+ *   scale_per_pixel_x:  180.000000000000000  // this is the 2*dx defined above
+ *   scale_per_pixel_y:  180.000000000000000  // this is the 2*dy defined above
+ *
+ *   the next set of keywords are optional and the default is as defined above.
+ *   these define the matrix.
+ *
+ *
+ * A typical chain would look something like this:
+ * 
+ * OrthoMosaicOfElevation-->Normals-->Renderer-->|
+ *                                               |--> BumpShade-->Output 
+ * ColorSource----------------------->Renderer-->|
+ *
+ * NOTES:
+ *
+ * 1) "Normals" is an ossimImageToPlaneNormalFilter class
+ *
+ * 2) The bump map input source is used to bump or shade the input color
+ * source.  The input color source currently must be a 1 or 3 band
+ * image.  Note that the output of this source is always
+ * 3 bands (r, g, b).
+ *
+ * 3) If no color source (2nd input layer) is present the r,g,b values will be
+ * used.  The method setRgbColorSource can be used to control this.
+ * 
+ * </pre>
+ * 
+ */
+class OSSIMDLLEXPORT ossimBumpShadeTileSource : public ossimImageCombiner
+{
+public:
+   ossimBumpShadeTileSource();
+
+   ossimString getShortName()const;
+   ossimString getLongName()const;
+
+   ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                       ossim_uint32 resLevel=0);
+
+   virtual bool getTile(ossimImageData* tile, ossim_uint32 resLevel=0);
+
+   /**
+    * This should always return 3
+    */
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+
+   /**
+    * The output scalar type should always be 8-bit
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+   
+   /**
+    * the null pixel is 0.0.
+    * \return null pixel value is always 0
+    *
+    */
+   virtual double getNullPixelValue()const;
+
+   /**
+    * the min pixel is 1.0.
+    * \return min pixel value is always 1
+    *
+    */
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * the max pixel is 255.
+    * \return max pixel value is always 255
+    *
+    */
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * \return Returns the rotation of the incident vector..
+    */
+   virtual double getAzimuthAngle()const;
+
+   /**
+    * \return Returns the elevation of the incident vector.
+    */
+   virtual double getElevationAngle()const;
+
+   /**
+    *
+    */
+   virtual void setAzimuthAngle(double angle);
+
+   /**
+    *
+    */
+   virtual void setElevationAngle(double angle);
+
+   /**
+    *
+    */
+   virtual void initialize();
+
+   /**
+    *
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    *
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    *
+    */
+   bool canConnectMyInputTo(ossim_int32 inputIndex,
+                            const ossimConnectableObject* object)const;
+      
+   /**
+    *
+    */
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+
+   /**
+    *
+    */
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+
+   /**
+    *
+    */
+   virtual void propertyEvent(ossimPropertyEvent& event);
+
+   virtual void refreshEvent(ossimRefreshEvent& event);
+
+   /**
+    * Will re-compute the light direction given the elevation angle and
+    * azimuth angle.
+    */
+   void computeLightDirection();
+
+   /* ------------------- PROPERTY INTERFACE -------------------- */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   /* ------------------ PROPERTY INTERFACE END ------------------- */
+
+   /**
+    * @brief Set the red, green and blue color source values.
+    *
+    * This sets the rgb value used when no second layer is present.
+    *
+    * The default is: r = 255, g = 255, b = 255
+    *
+    * @param r red
+    * @param g green
+    * @param b blue
+    */
+   void setRgbColorSource(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b);
+
+   /**
+    * Gets the red, green and blue color source values.
+    * @param r red
+    * @param g green
+    * @param b blue
+    */
+   void getRgbColorSource(ossim_uint8& r, ossim_uint8& g, ossim_uint8& b) const;
+   
+protected:
+   virtual ~ossimBumpShadeTileSource();
+   void allocate();
+   /**
+    * The result of the illumination equation is stored in
+    * here.  This is populated on each call to getTile.
+    */
+   ossimRefPtr<ossimImageData> m_tile;
+
+   /**
+    * Used for the light vector computation.
+    */
+   double m_lightSourceElevationAngle;
+
+   /**
+    * Used for the light vector computation.
+    */
+   double m_lightSourceAzimuthAngle;
+
+   /**
+    * This is computed from the elevation and
+    * azimuth angles of the light source.
+    */
+   NEWMAT::ColumnVector m_lightDirection;
+
+   /**
+    * rgb values used when no color source (2nd layer) is present.
+    */
+   ossim_uint8 m_r;
+   ossim_uint8 m_g;
+   ossim_uint8 m_b;
+
+   void computeColor(ossim_uint8& r,
+                     ossim_uint8& g,
+                     ossim_uint8& b,
+                     ossim_float64 normalX,
+                     ossim_float64 normalY,
+                     ossim_float64 normalZ,
+                     ossim_uint8 dr,
+                     ossim_uint8 dg,
+                     ossim_uint8 db)const;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimCacheTileSource.h b/include/ossim/imaging/ossimCacheTileSource.h
new file mode 100644
index 0000000..6c74bae
--- /dev/null
+++ b/include/ossim/imaging/ossimCacheTileSource.h
@@ -0,0 +1,91 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// Author:  Garrett Potts
+//
+// Description:  ossimCacheTileSource
+// 
+//*******************************************************************
+//  $Id$
+#ifndef ossimCacheTileSource_HEADER
+#define ossimCacheTileSource_HEADER 1
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimAppFixedTileCache.h>
+#include <ossim/base/ossimProcessProgressEvent.h>
+#include <OpenThreads/Mutex>
+
+/** Cache Tile Source */
+class OSSIMDLLEXPORT ossimCacheTileSource : public ossimImageSourceFilter
+{
+public:
+   typedef std::vector<ossimAppFixedTileCache::ossimAppFixedCacheId> RLevelCacheList;
+   /**
+    * Will construct a new Application cache
+    */
+   ossimCacheTileSource();
+   // ossimCacheTileSource(ossimImageSource* inputSource);
+
+   virtual ossimString getLongName()  const;
+   virtual ossimString getShortName() const;
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   virtual void initialize();
+   virtual void flush();
+   virtual void setCachingEnabledFlag(bool value);
+   virtual void setEventProgressFlag(bool value);
+
+   void getTileSize(ossimIpt& size) const;
+
+   /**
+    * @brief Set the tile size.  This changes underlying cache tile size.
+    * @param Size of cache tile.
+    */
+   void setTileSize(const ossimIpt& size);
+   
+   virtual ossim_uint32 getTileWidth() const;
+   virtual ossim_uint32 getTileHeight() const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+
+   
+protected:
+   virtual ~ossimCacheTileSource();
+
+   void allocate();
+   void deleteRlevelCache();
+   void initializeRlevelCache();
+   
+   ossimAppFixedTileCache::ossimAppFixedCacheId getCacheId(ossim_uint32 resLevel);
+
+      virtual void fireProgressEvent(double percentComplete);
+   
+   // virtual ossimRefPtr<ossimImageData> fillTile(ossim_uint32 resLevel);
+   virtual ossimRefPtr<ossimImageData> fillTile(
+      const ossimIrect& tileRect, ossim_uint32 resLevel,
+      ossimAppFixedTileCache::ossimAppFixedCacheId cacheId );
+                                                
+
+   ossimRefPtr<ossimImageData> theTile;
+   ossimIpt                    theFixedTileSize;
+   bool                        theCachingEnabled;
+   bool                        theEventProgressFlag;
+   bool                        theUseInputTileSizeFlag;
+   RLevelCacheList             theRLevelCacheList;
+   ossimIpt                    theTileSizeXY;
+   
+   /** For lock and unlock. */
+
+TYPE_DATA
+};
+
+#endif /* end of "#ifndef ossimCacheTileSource_HEADER" */
diff --git a/include/ossim/imaging/ossimCastTileSourceFilter.h b/include/ossim/imaging/ossimCastTileSourceFilter.h
new file mode 100644
index 0000000..1981010
--- /dev/null
+++ b/include/ossim/imaging/ossimCastTileSourceFilter.h
@@ -0,0 +1,93 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimCastTileSourceFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimCastTileSourceFilter_HEADER
+#define ossimCastTileSourceFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIMDLLEXPORT ossimCastTileSourceFilter : public ossimImageSourceFilter
+{
+public:
+   ossimCastTileSourceFilter(ossimImageSource* inputSource=NULL,
+			     ossimScalarType scalarType=OSSIM_UCHAR);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   virtual void initialize();
+   virtual ossimScalarType getOutputScalarType() const;
+
+   virtual ossimString getOutputScalarTypeString()const;
+
+   /**
+    *  Sets the output scalar type.
+    */
+   virtual void setOutputScalarType(ossimScalarType scalarType);
+   virtual void setOutputScalarType(ossimString scalarType);
+   
+   /**
+    *  Sets the current resolution level.  Returns true on success, false
+    *  on error.
+    */
+   virtual double getNullPixelValue(ossim_uint32 band)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   ossimRefPtr<ossimImageData> applyCast(ossimRefPtr<ossimImageData> input);
+   
+   /**
+    *  Method to save the state of an object to a keyword list.
+    *  Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+
+   /**
+    *   Override base class so that a disableSource event does not
+    *   reinitialize the object and enable itself.
+    */
+   virtual void propertyEvent(ossimPropertyEvent& event);
+   virtual void refreshEvent(ossimRefreshEvent& event);   
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+     
+protected:
+   virtual ~ossimCastTileSourceFilter();
+
+   void allocate(const ossimRefPtr<ossimImageData> inputTile);
+   
+   ossimRefPtr<ossimImageData> theTile;
+   ossimScalarType             theOutputScalarType;
+
+   template<class inType>
+   void castInputToOutput(inType **inBuffer,
+                          const double  *nullPix,
+                          bool   inPartialFlag);
+   
+   template<class inType, class outType>
+   void castInputToOutput(inType *inBuffer[],
+                          const double  *nullInPix,
+                          bool   inPartialFlag,
+                          outType *outBuffer[],
+                          const double  *nullOutPix,
+                          ossim_uint32   numberOfBands);
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimCastTileSourceFilter_HEADER */
diff --git a/include/ossim/imaging/ossimCcfHead.h b/include/ossim/imaging/ossimCcfHead.h
new file mode 100644
index 0000000..1994b92
--- /dev/null
+++ b/include/ossim/imaging/ossimCcfHead.h
@@ -0,0 +1,192 @@
+//---
+//
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for CcfHead.
+//
+// Notes:
+// - This is not a full blown CCF header class as it only captures the
+//   data needed for loading.
+// - Currently only version 6 is supported.
+//
+//---
+//  $Id$
+#ifndef ossimCcfHead_HEADER
+#define ossimCcfHead_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+#include <vector>
+
+class ossimIrect;
+
+//***************************************************************************
+// CLASS:  ossimCcfHead
+//***************************************************************************
+class OSSIM_DLL ossimCcfHead : public ossimErrorStatusInterface
+{
+public:
+
+   ossimCcfHead();
+   
+   ossimCcfHead(const char* ccf_file);
+   ossimCcfHead(std::shared_ptr<ossim::istream>& str, 
+                const std::string& connectionString);
+
+   ~ossimCcfHead ();
+
+   /*!
+    *  Reads the ccf header and initializes data members.  Returns true on
+    *  successful read, false on error.
+    */
+   bool parseCcfHeader(const char* ccf_file);
+   bool parseCcfHeader(std::shared_ptr<ossim::istream>& str, const std::string& connectionString);
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+   ossim_uint32 numberOfReducedResSets() const { return theNumberOfRLevels; }
+
+   ossim_uint32 numberOfLines(ossim_uint32 reduced_res_level) const;
+
+   ossim_uint32 numberOfSamples(ossim_uint32 reduced_res_level) const;
+
+   ossim_uint32 chunksInLineDir(ossim_uint32 reduced_res_level) const;
+   
+   ossim_uint32 chunksInSampleDir(ossim_uint32 reduced_res_level) const;
+
+   std::streampos startOfData(ossim_uint32 reduced_res_level) const;
+
+   /*!
+    *  Returns the highest available reduced resolution level.
+    *  Zero based.
+    */
+   ossim_uint32 highestReducedResSet() const
+      { return !theNumberOfRLevels ? 0 : (theNumberOfRLevels - 1); }
+
+   /*!
+    *  Returns the zero based image rectangle for the reduced resolution
+    *  level passed in.  Returns a rectangle of (0,0,0,0) if reduced_res_level
+    *  is out of range.
+    */
+   ossimIrect imageRect(ossim_uint32 reduced_res_level) const;
+
+   /*!
+    *  Returns the ccf file name as a String.
+    */
+   ossimString imageFile() const { return m_connectionString; }
+
+   /*!
+    *  Returns the radiometry string.
+    */
+   ossimString radiometry() const { return theRadiometryString; }
+
+   /*!
+    *  Returns the number of bands.
+    */
+   ossim_uint32 numberOfBands() const { return theNumberOfBands; }
+
+   /*!
+    *  Returns the enumerated pixel type.
+    */
+   ossimScalarType pixelType() const { return thePixelType; }
+
+   /*!
+    *  Returns the bytes per chunk.
+    */
+   ossim_uint32 bytesPerChunk() const { return theBytesPerChunk; }
+
+   /*!
+    *  Returns the bytes per chip.
+    */
+   ossim_uint32 bytesPerChip() const { return theBytesPerChip; }
+
+   /*!
+    *  Returns the number of chips in sample direction of a chunk.
+    */
+   ossim_uint32 sampleChipsPerChunk() const { return theSampleChipsPerChunk; }
+
+   /*!
+    *  Returns the number of chips in line direction of a chunk.
+    */
+   ossim_uint32 lineChipsPerChunk() const { return theLineChipsPerChunk; }
+
+   /*!
+    *  Returns the samples per chip.
+    */
+   ossim_uint32 samplesPerChip() const { return theSamplesPerChip; }
+
+   /*!
+    *  Returns the lines per chip.
+    */
+   ossim_uint32 linesPerChip() const { return theLinesPerChip; }
+
+   /*!
+    *  Returns the number of pixels in a single band of a chip.
+    *  Note:  This is not in bytes but in pixels.
+    */
+   ossim_uint32 chipSizePerBand() const
+      { return theLinesPerChip * theSamplesPerChip; }
+
+   const std::vector<ossimIpt>& getValidImageVertices()const
+      {
+         return theValidImageVertices;
+      }
+private:
+
+   /*!
+    *  Parses a version five header.
+    */
+   bool parseV5CcfHeader(std::istream& is);
+
+   /*!
+    *  Parses a version six header.
+    */
+   bool parseV6CcfHeader(std::istream& is);
+
+   /*!
+    *  Parses the radiometry string and initializes "theNumberOfBands" and
+    *  "thePixelType".
+    */
+   void parseRadString();
+
+   std::shared_ptr<ossim::istream> m_ccfStr;
+   std::string            m_connectionString;
+   ossim_uint32           theNumberOfBands;
+   ossimScalarType        thePixelType;
+   ossimString            theFileType;
+   ossim_uint32           theVersionNumber;
+   ossim_uint32           theLinesPerChip;
+   ossim_uint32           theSamplesPerChip;
+   ossim_uint32           theLineChipsPerChunk;
+   ossim_uint32           theSampleChipsPerChunk;
+   ossim_uint32           theRectInFullImageStartLine;
+   ossim_uint32           theRectInFuleImageStartSample;
+   ossim_uint32           theRectInFullImageStopLine;
+   ossim_uint32           theRectInFuleImageStopSample;
+   ossim_uint32           theNumberOfValidImageVertices;
+   std::vector<ossimIpt>  theValidImageVertices;
+   ossim_uint32           theFirstBandHeaderPointer;
+   ossimString            theRadiometryString;
+   ossim_uint32           theBytesPerPixel;
+   ossim_uint32           theBytesPerChip;
+   ossim_uint32           theBytesPerChunk;
+   ossimString            theCompressionType;
+   ossim_uint32           theNumberOfRLevels;
+   std::vector<bool>           theOccupiedFlag;
+   std::vector<std::streampos> theStartOfData;
+   std::vector<ossim_uint32>   theNumberOfLines;
+   std::vector<ossim_uint32>   theNumberOfSamples;
+   std::vector<ossim_uint32>   theChunksInLineDir;
+   std::vector<ossim_uint32>   theChunksInSampleDir;
+};
+
+
+#endif // #ifndef CcfHead_HEADER
diff --git a/include/ossim/imaging/ossimCcfTileSource.h b/include/ossim/imaging/ossimCcfTileSource.h
new file mode 100644
index 0000000..70e4cd0
--- /dev/null
+++ b/include/ossim/imaging/ossimCcfTileSource.h
@@ -0,0 +1,232 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for CcfTileSource.
+//
+// A ccf (Chip Chunk Format) is a double tiled format.  Image data is
+// arranged in chips and chunks.  Each chip is 32 x 32 pixels.  Each chunk
+// is 8 x 8 chips for a single band image.  Bands are interleaved by chip
+// so a rgb image has a red chip a green chip, then a blue chip which
+// would make the chunk 24 x 8 chips.
+//
+//*******************************************************************
+//  $Id: ossimCcfTileSource.h 16075 2009-12-10 15:46:43Z gpotts $
+
+#ifndef ossimCcfTileSource_HEADER
+#define ossimCcfTileSource_HEADER
+
+#include <fstream>
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimCcfHead.h>
+
+class  ossimImageData;
+
+class OSSIM_DLL ossimCcfTileSource : public ossimImageHandler
+{
+public:
+
+   ossimCcfTileSource();
+   
+   virtual ossimString getShortName()const;
+   virtual ossimString getLongName()const;
+
+   /**
+    *  @return Returns true on success, false on error.
+    *
+    *  @note This method relies on the data member ossimImageData::theImageFile
+    *  being set.  Callers should do a "setFilename" prior to calling this
+    *  method or use the ossimImageHandler::open that takes a file name and an
+    *  entry index.
+    */
+   virtual bool open();
+   
+   virtual void close();
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+    /**
+     *  Returns the number of bands in the image.
+     *  Satisfies pure virtual from ImageHandler class.
+     */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   virtual ossim_uint32 getNumberOfOutputBands()const;
+
+   /**
+     *  Returns the number of lines in the image.
+     *  Satisfies pure virtual from ImageHandler class.
+     */
+   virtual ossim_uint32 getNumberOfLines(
+      ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    *  Returns the number of samples in the image.  
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(
+      ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    *  Returns the number of reduced resolution data sets (rrds).
+    *  Note:  The full res image is counted as a data set so an image with no
+    *         reduced resolution data set will have a count of one.
+    */
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+   
+   /**
+    *  Returns the zero based image rectangle for the reduced resolution data
+    *  set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(
+      ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    *  Set the output band list.  Use to set the number and order of output
+    *  bands.  Will set an error if out of range.
+    */
+   bool setOutputBandList(const vector<ossim_uint32>& outputBandList);
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+      
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+   
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   virtual bool isOpen()const;
+
+   /**
+    * @brief Gets a property for matching name.
+    * @param name The name of the property to get.
+    * @return Returns property matching "name".
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+   
+   /**
+    * @brief Gets a list of property names available.
+    * @param propertyNames The list to push back names to.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+	
+   
+protected:
+   virtual ~ossimCcfTileSource();
+
+   void initVerticesFromHeader();
+   
+   // Disallow these...
+   ossimCcfTileSource(const ossimCcfTileSource& source);
+   ossimCcfTileSource& operator=(const ossimCcfTileSource& source); 
+   
+   /**
+    *  Returns true on success, false on error.
+    */
+   bool fillBuffer(const  ossimIrect& tile_rect,
+                   const  ossimIrect& clip_rect,
+                   const  ossimIrect& image_rect,
+                   ossim_uint32 reduced_res_level,
+                   ossimImageData* tile);
+
+   /**
+    *  Returns true on success, false on error.
+    */
+   bool fillUshortBuffer(const  ossimIrect& tile_rect,
+                         const  ossimIrect& clip_rect,
+                         const  ossimIrect& image_rect,
+                         ossim_uint32 reduced_res_level,
+                         ossimImageData* tile);
+   
+   /**
+    *  Returns true on success, false on error.
+    */
+   bool fillUcharBuffer(const  ossimIrect& tile_rect,
+                        const  ossimIrect& clip_rect,
+                        const  ossimIrect& image_rect,
+                        ossim_uint32 reduced_res_level,
+                        ossimImageData* tile);
+
+   /**
+    *  Adjust point to even 256 boundary.  Assumes 0,0 origin.
+    */
+   void adjustToStartOfChunk(ossimIpt& pt) const;
+
+   /**
+    *  Adjust point to even 32 boundary.  Assumes 0,0 origin.
+    */
+   void adjustToStartOfChip(ossimIpt& pt) const;
+
+   bool isEcgGeom(const ossimFilename& filename)const;
+
+   ossimCcfHead                theCcfHead;
+   ossimRefPtr<ossimImageData> theTile;
+   ossim_uint8*                theChipBuffer;
+   ifstream*                   theFileStr;
+   vector<ossim_uint32>        theOutputBandList;
+   ossim_int32                 theByteOrder;
+
+
+TYPE_DATA
+};
+   
+#endif
diff --git a/include/ossim/imaging/ossimCibCadrgTileSource.h b/include/ossim/imaging/ossimCibCadrgTileSource.h
new file mode 100644
index 0000000..0dc1f18
--- /dev/null
+++ b/include/ossim/imaging/ossimCibCadrgTileSource.h
@@ -0,0 +1,601 @@
+//-----------------------------------------------------------------------
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+// Description: This class give the capability to access tiles from an
+//              CADRG file.
+//
+//-----------------------------------------------------------------------
+//$Id: ossimCibCadrgTileSource.h 17954 2010-08-21 20:39:47Z dburken $
+#ifndef ossimCibCadrgTileSource_HEADER
+#define ossimCibCadrgTileSource_HEADER 1
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/support_data/ossimRpfFrameEntry.h>
+
+class ossimRpfToc;
+class ossimRpfTocEntry;
+class ossimRpfFrame;
+
+/**
+ * CIB/CADRG formats are encoded the same except that the CIB is a grey
+ * scale image and the CADRG is a color image.  Both are VQ compressed.
+ * The images are encoded into an NITF format with embedded RPF headers.
+ * It reads the embedded RPF tags from the NITF file and parses the data.
+ * It allows for you to select which CIB/CADRG entry to render.  The handler
+ * is opened by giving it the associated a.toc file.  This is a table of
+ * contents file that describes all the entries found in the CIB/CADRG
+ * product.  You must set which entry you wish to render.  By default it
+ * will render the first product it comes to.
+ *
+ * Note:  This handler will eventually merge into the nitf handler.
+ */
+class OSSIMDLLEXPORT ossimCibCadrgTileSource : public ossimImageHandler
+{
+public:
+   friend class ossimMultiEntryCibCadrg;
+
+   /**
+    * Basic enumeration.  This should
+    * be either a CIB or a CADRG product
+    * type.
+    */
+   enum ossimCibCadrgProductType
+   {
+      OSSIM_PRODUCT_TYPE_UNKNOWN = 0,
+      OSSIM_PRODUCT_TYPE_CIB     = 1,
+      OSSIM_PRODUCT_TYPE_CADRG   = 2
+   };
+
+   /**
+    * Default constructor.
+    *
+    * Initializes all internal attributes to a default state.
+    */
+   ossimCibCadrgTileSource();
+
+   /**
+    * This method is defined in the base class ossimObject.
+    * This class overrides the default implementation
+    * to return its own short name.
+    * 
+    * @return The short name for this class as an ossimString.
+    */
+   virtual ossimString getShortName()const;
+
+   /**
+    * This method is defined in the base class ossimObject.
+    * This class overrides the default implementation
+    * to return its own long name.
+    * 
+    * @return The long name for this class as an ossimString.
+    */
+   virtual ossimString getLongName()const;
+
+   /**
+    * Closes this image handler and deletes any allocated data.
+    */
+   virtual void close();
+   
+   /**
+    */
+   virtual bool open();
+
+  /**
+    * Changes the way the open() routine functions slightly.
+    *
+    * @param bSkipEmptyCheck If true, the RPF file is opened even 
+    * if all the frame files are missing. By default this is 
+    * set to false.
+    */
+   void setSkipEmptyCheck( bool bSkipEmptyCheck = false );
+
+   /**
+    *  Returns a pointer to an ossimImageDataObject given a rectangluar
+    *  region of interest.
+    *
+    *  @param rect The region of interest to return.
+    *  @param resLevel From which resolution set are we querying
+    *  (default is 0 full res).
+    *
+    *  @return The ossimImageData object to the caller.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                               ossim_uint32 resLevel = 0);
+
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+
+   /**
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    *
+    *  @param reduced_res_level The reduced res level to query number of lines from.
+    *  @return The number of lines in the image.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    *
+    *  @param reduced_res_level The reduced res level to query number of samples from.
+    *  @return The number of samples in the image.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    * @param reduced_res_level Which res level to get the bounds for.  0 represents
+    *                          the default and is the full resolution.
+    * 
+    * @return A rectangle representing the bounds for the passed in resolution level.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
+   
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    *
+    * Saving data without a prefix.
+    * @code
+    *  ossimCibCadrgTileSource* cibCadrgHandler = new ossimCibCadrgTileSource;
+    *  ossimKeywordlist kwl;
+    *  cibCadrgHandler->open(filename);
+    *  cibCadrgHandler->saveState(kwl);
+    * @endcode
+    *
+    * and saving data with a prefix.
+    * @code
+    *  ossimCibCadrgTileSource* cibCadrgHandler = new ossimCibCadrgTileSource;
+    *  ossimKeywordlist kwl;
+    *  cibCadrgHandler->open(filename);
+    *  cibCadrgHandler->saveState(kwl, "handler1.");
+    * @endcode
+    *
+    * Saving with a prefix will help uniquely identify objects in the kwl.
+    * To see what is in the keywordlist after a save state then do:
+    *
+    * @code
+    * cout << kwl << endl;
+    * @endcode
+    *
+    * There is only 1 keyword for this object:
+    * 
+    * entry: <entry number>
+    *
+    * where <entry number> is the index value for the current entry.
+    *
+    * @see ossimImageHandler for additional keywords.
+    *
+    * @param kwl Keywordlist to save the state of the object to.
+    * @param prefix prefix to prepend to the keywords.  This will
+    *               help uniquely identify each keyword if multiple
+    *               objects are saved to the same list.
+    * @return True if successfully saved the state of the object and
+    *         false otherwise.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to load the state of an object from a keyword list.
+    *
+    * Loading with a prefix.
+    * @code
+    *  cibCadrgHandler->laodState(kwl, "handler1.");
+    * @endcode
+    * 
+    * Loading without a prefix.
+    * @code
+    *  cibCadrgHandler->laodState(kwl);
+    * @endcode
+    *
+    * Since all objects are factory created you can go through the
+    * registry and pass the keyword list in.
+    * @code
+    * ossimImageHandler* handler = ossimImageHandlerRegistry::instance()->open(kwl, prefix);
+    * @endcode
+    * 
+    * @param kwl Keywordlist that holds the state information for this
+    *            object.
+    *
+    *
+    * @param prefix prefix value prepended to all keywords to uniquely
+    *                      locate the state attributes for this object.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   /**
+    *  Populates the geometry object with image geometry information.  This
+    *  method is used to relay projection/model information to users.
+    *  Returns true if geometry info is present, false if not.
+    *  Keywords supported by this class are:
+    *  @verbatim
+    *  datum:    // datum code>   // Datum code
+    *  ul_lat:   // upper left latitude
+    *  ul_lon:   // upper left longitude
+    *  ll_lat:   // lower left latitude
+    *  ll_lon:   // lower left longitude
+    *  lr_lat:   // lower right latitude
+    *  lr_lon:   // lower right longitude
+    *  ur_lat:   // upper right latitude
+    *  ur_lon:   // upper right longitude
+    *  number_input_bands:     
+    *  number_output_bands:    
+    *  number_lines:           
+    *  number_samples:
+    *  decimal_degrees_per_pixel_lat:  // specifies the spacing per pixel along Y direction
+    *  decimal_degrees_per_pixel_lon:  // specifies the spacing per pixel along X direction
+    *  origin_latitude:                // specifies the origin or center of the projector for the latitude
+    *  central_meridian:               // specifies the origin or center of the projector for the longitude
+    *  tie_point_lat:     // tie point lat.  Represents the latitude of the upper left center of pixel
+    *  tie_point_lon:     // tie point lon.  Represents the longitude of the upper left center of pixel
+    *  zone:              // zone read from the CIB/CADRG boundary info
+    *  type:              // class name of the object for factory driven reconstruction
+    *  map_scale:         // Map scale of the image
+    *  @endverbatim
+    *  @see ossimImageSource for further code example on using the geometry.
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   
+   /**
+    * This method allows you to query the scalar type of the output data.
+    * This is simply the data type, i.e. whether its OSSIM_FLOAT, OSSIM_DOUBLE,
+    * OSSIM_UCHAR, ... etc.  This means that if there are bands of different
+    * scalar types from a single image then they must be casted to the highest
+    * precision type. @see ossimConstants.h for all ossimScalarType.
+    * 
+    * @return The output scalar type.
+    *         
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * This method allows you to query the number of input bands.  If an image
+    * is band selectable this will allow one to select the bands you wish
+    * to read in.  This indicates that the number of input bands might not
+    * match the number of output bands.
+    * @return number of input bands.
+    */
+   virtual ossim_uint32 getNumberOfInputBands()const;
+
+   /**
+    * This method allows one to query the number of output bands.  This might not
+    * be the same as the n umber of input bands.
+    *
+    * @see getNumberOfInputBands().
+    * @return number of output bands.
+    */
+   virtual ossim_uint32 getNumberOfOutputBands()const;
+   
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+   
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   virtual ossim_uint32 getCurrentEntry()const;
+   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
+   virtual void getEntryList(std::vector<ossim_uint32>& entryList)const;
+   
+
+   /**
+    * Returns -1 if invalid
+    */
+   virtual ossim_int32 getCurrentEntryIndex()const;
+   
+   /**
+    * @return The current entry being rendered
+    */
+   virtual const ossimRpfTocEntry* getCurrentTocEntry()const;
+
+   /**
+    * @return The table of contents object.
+    */
+   virtual const ossimRpfToc*      getToc()const;
+
+   /**
+    * @param reduced_res_level passed in resolution level.
+    * @return True if the reduced_res_level is within an acceptable range
+    *         and false otherwise.
+    */
+   bool isValidRLevel(ossim_uint32 reduced_res_level) const;
+
+   /**
+    * Determines if its open if there eists a table of contents object.
+    * 
+    * @return True if the handler is open and flase otherwise.
+    */
+   bool isOpen()const;
+
+   /** @return true if CIB */
+   bool isCib() const;
+
+   /** @return true if CADRG */
+   bool isCadrg() const;
+
+   /** @return Scale string ( like 1:24000 ) for current entry. */
+   ossimString getProductScale() const;
+
+   /**
+    * This retrieves all product scales that are within the Table of contents.
+    * I make no assumptions that a CIB/CADRG has only one product.  A product
+    * here is 1meter, 5 meter, 10 meter ... etc for CIB and 1:24000, 1:50000,
+    * ... etc for CADRG.
+    *
+    * @return The prduct list as a vector of strings.
+    */
+   vector<ossimString> getProductScaleList()const;
+
+   /**
+    * Using the product scales from getProductScaleList() you can pass each string
+    * in so you can get all associated indices for a given product.
+    * 
+    * @return Entry indices for a passed in product scale.
+    */
+   vector<ossim_int32>      getProductEntryList(const ossimString& productScale)const;
+
+   ossimString getSecurityClassification()const;
+   
+	/**
+    * @brief Gets a property for matching name.
+    * @param name The name of the property to get.
+    * @return Returns property matching "name".
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   
+   /**
+    * @brief Gets a list of property names available.
+    * @param propertyNames The list to push back names to.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+	/**
+    * CONSTANT representing the width of a Frame.  This should be 1536.
+    */
+   static const ossim_uint32 CIBCADRG_FRAME_WIDTH;
+   
+   /**
+    * CONSTANT representing the height of a Frame.  This should be 1536.
+    */
+   static const ossim_uint32 CIBCADRG_FRAME_HEIGHT;
+   
+
+protected:
+   /**
+    * Destructor.
+    *
+    * Will return allocated memory back to the heap.
+    */
+   virtual ~ossimCibCadrgTileSource();
+   
+   void updatePropertiesToFirstValidFrame();
+
+   /**
+    * Sets the entry to be renderer.  The entry within the table
+    * of contents are stored in an Toc entry object.
+    *
+    * @param entry the Rpf toc entry object to set to.
+    */
+   virtual void setTocEntryToRender(const ossimRpfTocEntry* entry);
+   
+   /**
+    * Protected structure that is only used internally by this class.
+    * 
+    * This is used to establish which entry data is being used.
+    * all we need is the ro, col of the entry.  We can compute the
+    * image rect from this since the CibCadrg are 1536x1536 frame.
+    * 
+    */
+   struct ossimFrameEntryData
+   {
+      ossimFrameEntryData()
+         :theRow(-1),
+          theCol(-1),
+          thePixelRow(-1),
+          thePixelCol(-1)
+         {}
+      ossimFrameEntryData(ossim_int32 row,
+                          ossim_int32 col,
+                          ossim_int32 pixelRow,
+                          ossim_int32 pixelCol,
+                          const ossimRpfFrameEntry& entry)
+         :theRow(row),
+          theCol(col),
+          thePixelRow(pixelRow),
+          thePixelCol(pixelCol),
+          theFrameEntry(entry)
+         {}
+      ossimFrameEntryData(const ossimFrameEntryData& rhs)
+         :theRow(rhs.theRow),
+          theCol(rhs.theCol),
+          thePixelRow(rhs.thePixelRow),
+          thePixelCol(rhs.thePixelCol),
+          theFrameEntry(rhs.theFrameEntry)
+         {}
+      ossim_int32 theRow;
+      ossim_int32 theCol;
+      ossim_int32 thePixelRow;
+      ossim_int32 thePixelCol;
+      ossimRpfFrameEntry theFrameEntry;
+   };
+
+   /**
+    * Sets the entry to render.
+    *
+    */
+   virtual bool setEntryToRender(ossim_uint32 index);
+   
+   /**
+    * It is important to note that each frame is organized into an easting northing
+    * type orientation.  This means that a frame at 0,0 is at the lower left corner.
+    * Each frame's pixel data is has 0,0 at the upper left.
+    *
+    * It will take the curent region to render and then find all entries that intersect
+    * that region.
+    *
+    * @param rect the current region to render.
+    * @return The list of entry data objects found for this rect.
+    */
+   vector<ossimFrameEntryData> getIntersectingEntries(const ossimIrect& rect);
+
+   /**
+    * This is a wrapper for the fill cib and fill cadrg.  It takes the frames
+    * involved that were found in the getIntersectingEntries and call the
+    * appropriate fill cib or fill cadrg on each frame entry data.  It will
+    * loop through making sure that the frame file exists before calling
+    * the associated fill routines.
+    *
+    * @param tileRect Region to fill.
+    * @param framesInvolved All intersecting frames used to render the region.
+    */
+   void fillTile(const ossimIrect& tileRect,
+                 const vector<ossimFrameEntryData>& framesInvolved,
+                 ossimImageData* tile);
+
+   /**
+    * Will uncompress the CIB file using a VQ decompression algorithm.
+    *
+    * @param aFrame Frame that overlaps the requested tile rect.
+    * @param tileRect The region requested to render.
+    * @param frameEntryData The frame entry data.
+    */
+   void fillSubTileCib(const ossimRpfFrame& aFrame,
+                       const ossimIrect& tileRect,
+                       const ossimFrameEntryData& frameEntryData,
+                       ossimImageData* tile);
+   
+   /**
+    * Will uncompress the CADRG file using a VQ decompression algorithm.
+    *
+    * @param aFrame Frame that overlaps the requested tile rect.
+    * @param tileRect The region requested to render.
+    * @param frameEntryData The frame entry data.
+    */
+   void fillSubTileCadrg(const ossimRpfFrame& aFrame,
+                         const ossimIrect& tileRect,
+                         const ossimFrameEntryData& frameEntryData,
+                         ossimImageData* tile);
+   
+   /**
+    * Will allocate an internal buffer for the given product.  If the product is
+    * a CIB then it is a single band OSSIM_UCHAR buffer and if its a CADRG it
+    * is a 3 band OSSIM_UCHAR buffer.
+    */
+   void allocateForProduct();
+   
+   /**
+    * This will search each entry in the table and look for a certain
+    * entry.  The first entry it comes to that has Geographic coverage
+    * will be the frame to render.  This method is best here instead of
+    * in the ossimRpfToc.  I am not sure, but I feel these types of
+    * searches are specific to the product (CADRG, CIB ...).  This
+    * is called immediately after a succesful open of the ossimRpfToc
+    */
+   const ossimRpfTocEntry* findFirstFrame();
+
+   void deleteAll();
+
+   void populateLut();
+
+   /**
+    * This is for storage of a single compressed buffer.
+    */
+   unsigned char*               theCompressedBuffer;
+
+   /**
+    * This is used as a buffer to uncompress the data to
+    */
+   unsigned char*               theUncompressedBuffer;
+   
+   /**
+    * This will be computed based on the frames organized within
+    * the directory.  The CibCadrg have fixed size frames of 1536x1536
+    * and we must count how many there are.  
+    */
+   ossim_uint32                theNumberOfLines;
+
+   /**
+    * This will be computed based on the frames organized within
+    * the directory.  The CibCadrg have fixed size frames of 1536x1536
+    * and we must count how many there are.  
+    */
+   ossim_uint32                theNumberOfSamples;
+   
+   /**
+    * This is the actual data returned from a getTile request.
+    */
+   ossimRefPtr<ossimImageData>  theTile;
+
+   /**
+    * Will own a table of contents.  This describes all entries within
+    * the CIB/CADRG.
+    */
+   ossimRpfToc*                 theTableOfContents;
+
+   /**
+    * This is the actual frame file to render.  This should be
+    * divided into frames where each frame is 1536x1536 in
+    * size.
+    */
+   const ossimRpfTocEntry*      theEntryToRender;
+
+   /**
+    * This will be the entry number that we are currently
+    * rendering.  This will mainly be used when using
+    * overviews.
+    */
+   ossim_int32                  theEntryNumberToRender;
+   
+   /**
+    * Holds the enumeration specifying the product type.
+    * The product type can be a CIB or a CADRG product.
+    */
+   ossimCibCadrgProductType     theProductType;
+   
+   mutable ossimRpfFrame*       theWorkFrame;
+
+   /**
+    * If true during the call to open(), the RPF file is opened even 
+    * if all the frame files are missing. By default this is set to false.
+    */
+   bool                         theSkipEmptyCheck;
+
+	// data to use in property retrieval
+	
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimCibCadrgTileSource_HEADER */
diff --git a/include/ossim/imaging/ossimClosestToCenterCombiner.h b/include/ossim/imaging/ossimClosestToCenterCombiner.h
new file mode 100644
index 0000000..03e0b68
--- /dev/null
+++ b/include/ossim/imaging/ossimClosestToCenterCombiner.h
@@ -0,0 +1,60 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimClosestToCenterCombiner.h 22162 2013-02-26 01:37:48Z gpotts $
+#ifndef ossimClosestToCenterCombiner_HEADER
+#define ossimClosestToCenterCombiner_HEADER
+#include <vector>
+#include <ossim/imaging/ossimImageMosaic.h>
+/**
+  * This implements a closest to center combiner.
+  *
+  * It will first grab all images overlapping a given rectangle query.  The first non-null
+  * closest pixel to the center of the image is used.  This basically uses only pixels along
+  * the "sweet" spot of the image.  This combiner is typically used when there is overlapping
+  * sensor data.
+  * 
+  */
+class OSSIM_DLL ossimClosestToCenterCombiner : public ossimImageMosaic
+{
+public:
+   ossimClosestToCenterCombiner();
+
+   /**
+    * Executes the ossimClosestToCenterCombiner algorithm. sets the pixels to the closest
+    * Valid value.  This simulates a sweet spot cutter.
+    * 
+    * @param rect The region of interest.
+    * @param resLevel.  For this combiner this is assumed to always be 0
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+protected:
+   class ossimClosestToCenterCombinerInfo
+   {
+   public:
+      ossimClosestToCenterCombinerInfo(ossimRefPtr<ossimImageData> tile,
+                                       ossim_int32 idx)
+         :theTile(tile),
+         theIndex(idx)
+         {
+         }
+      ossimRefPtr<ossimImageData> theTile;
+      ossim_int32                 theIndex;
+   };
+
+   
+   ossim_int32 findIdx(const std::vector<ossimClosestToCenterCombinerInfo >& normTileList,
+                       const ossimIpt& pt, ossim_uint32 offset)const;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimCodecBase.h b/include/ossim/imaging/ossimCodecBase.h
new file mode 100644
index 0000000..6e5620c
--- /dev/null
+++ b/include/ossim/imaging/ossimCodecBase.h
@@ -0,0 +1,66 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: class declaration for base codec(encoder/decoder).
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimCodecBase_HEADER
+#define ossimCodecBase_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimPropertyInterface.h>
+#include <ossim/imaging/ossimImageData.h>
+class OSSIM_DLL ossimCodecBase
+   : public ossimObject, public ossimPropertyInterface
+{
+public:
+
+    /**
+    * Will return the identifier used to identify the codec type.  For example the Jpeg codec
+    * will have "jpeg" as the identifier
+    *
+    * @return Codec identifier
+    */
+	virtual ossimString getCodecType()const=0;
+
+   /**
+    * @brief Encode method.
+    *
+    * Pure virtual method that encodes the passed in buffer to this codec.
+    *
+    * @param in Input data to encode.
+    * 
+    * @param out Encoded output data.
+    *
+    * @return true on success, false on failure.
+    */
+
+   virtual bool encode( const ossimRefPtr<ossimImageData>& in,
+                        std::vector<ossim_uint8>& out ) const=0;
+
+  /**
+    * @brief Decode method.
+    *
+    * @param in Input data to decode.
+    * 
+    * @param out Output tile.  If the pointer to ossimImageData is null
+    * internally it will be created.  For code loops it is better to pre
+    * initialized to correct size.
+    *
+    * @note Caller should set "out's" image rectangle upon successful
+    * decode.
+    *
+    * @return true on success, false on failure.
+    */
+   virtual bool decode( const std::vector<ossim_uint8>& in,
+                        ossimRefPtr<ossimImageData>& out ) const=0;
+
+TYPE_DATA;
+
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimCodecFactory.h b/include/ossim/imaging/ossimCodecFactory.h
new file mode 100644
index 0000000..f7b491f
--- /dev/null
+++ b/include/ossim/imaging/ossimCodecFactory.h
@@ -0,0 +1,73 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Factory class declaration for codec(encoder/decoder).
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimCodecFactory_HEADER
+#define ossimCodecFactory_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimCodecFactoryInterface.h>
+
+class ossimFilename;
+class ossimCodecBase;
+
+/**
+ * @brief Codec factory.
+ */
+class OSSIM_DLL ossimCodecFactory : public ossimCodecFactoryInterface
+{
+public:
+
+   /** virtual destructor */
+   virtual ~ossimCodecFactory();
+
+   /**
+   * @return instance
+   */
+   static ossimCodecFactory* instance();
+
+   /**
+   * createCodec takes a type and will return a new codec to encode decode image buffers
+   *
+   * @param in type.  Type identifer used to allocate the proper codec.
+   * @return ossimCodecBase type.
+   */
+   virtual ossimCodecBase* createCodec(const ossimString& type)const;
+
+
+   /**
+   * createCodec takes a type in the keywordlist and will return a new codec to encode decode image buffers
+   *
+   * @param in kwl.  Type identifer used to allocate the proper codec.
+   * @param in prefix.  prefix used to prefix keywords during the construction
+   *                    of the codec
+   * @return ossimCodecBase type.
+   */
+   virtual ossimCodecBase* createCodec(const ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   virtual void getTypeNameList(std::vector<ossimString>& typeNames)const;
+   
+private:
+   
+   /** hidden from use default constructor */
+   ossimCodecFactory();
+
+   /** hidden from use copy constructor */
+   ossimCodecFactory(const ossimCodecFactory& obj);
+
+   /** hidden from use operator = */
+   const ossimCodecFactory& operator=(const ossimCodecFactory& rhs);
+
+   /** The single instance of this class. */
+   static ossimCodecFactory* theInstance;
+};
+
+#endif /* End of "#ifndef ossimCodecFactory_HEADER" */
diff --git a/include/ossim/imaging/ossimCodecFactoryInterface.h b/include/ossim/imaging/ossimCodecFactoryInterface.h
new file mode 100644
index 0000000..ee5b19b
--- /dev/null
+++ b/include/ossim/imaging/ossimCodecFactoryInterface.h
@@ -0,0 +1,90 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Interface for codec(encoder/decoder) factories.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimCodecFactoryInterface_HEADER
+#define ossimCodecFactoryInterface_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <vector>
+
+class ossimObject;
+class ossimCodecBase;
+/**
+ * @brief Codec factory interface.
+ */
+class OSSIM_DLL ossimCodecFactoryInterface // : public ossimObjectFactory
+{
+public:
+
+   /** default constructor */
+   ossimCodecFactoryInterface(){}
+
+   /** virtual destructor */
+   virtual ~ossimCodecFactoryInterface(){}
+   
+   /**
+   * This is a bridge to the generic factory list interface that trys to call createObject
+   * 
+   * We will bridge it in this interface to just call createCodec.  These are not pure virtual.
+   *
+   */
+   virtual ossimObject* createObject(const ossimString& type)const;
+
+  /**
+   * This is a bridge to the generic factory list interface that trys to call createObject
+   * 
+   * We will bridge it in this interface to just call createCodec.  These are not pure virtual.
+   *
+   */
+  virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix=0)const;
+   
+
+   
+   virtual ossimCodecBase* createCodec(const ossimString& type)const=0;
+   virtual ossimCodecBase* createCodec(const ossimKeywordlist& kwl, const char* prefix=0)const=0;
+
+
+   virtual void getTypeNameList(std::vector<ossimString>& typeNames)const=0;
+
+   /**
+    * @brief Pure virtual decode method. Derived classes must implement to
+    * be concrete.
+    *
+    * @param in Input data to decode.
+    * 
+    * @param out Output tile.
+    *
+    * @return true on success, false on failure.
+    */
+//   virtual bool decode( const std::vector<ossim_uint8>& in,
+//                        ossimRefPtr<ossimImageData>& out ) const = 0;
+
+   /**
+    * @brief Pure virtual encode method. Derived classes must implement to
+    * be concrete.
+    *
+    * @param in Input data to encode.
+    * 
+    * @param out Encoded output data.
+    *
+    * @return true on success, false on failure.
+    */
+
+//   virtual bool encode( const ossimKeywordlist& options,
+//                        const ossimRefPtr<ossimImageData>& in,
+//                        std::vector<ossim_uint8>& out ) const = 0;
+};
+
+#endif /* End of "#ifndef ossimCodecFactoryInterface_HEADER" */
diff --git a/ossim/include/ossim/imaging/ossimCodecFactoryRegistry.h b/include/ossim/imaging/ossimCodecFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimCodecFactoryRegistry.h
rename to include/ossim/imaging/ossimCodecFactoryRegistry.h
diff --git a/include/ossim/imaging/ossimColorNormalizedFusion.h b/include/ossim/imaging/ossimColorNormalizedFusion.h
new file mode 100644
index 0000000..d9f52a1
--- /dev/null
+++ b/include/ossim/imaging/ossimColorNormalizedFusion.h
@@ -0,0 +1,32 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Color normalized fusion
+//
+//*************************************************************************
+// $Id: ossimColorNormalizedFusion.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimColorNormalizedFusion_HEADER
+#define ossimColorNormalizedFusion_HEADER
+#include <ossim/imaging/ossimFusionCombiner.h>
+
+class ossimColorNormalizedFusion : public ossimFusionCombiner
+{
+public:
+
+   ossimColorNormalizedFusion();
+   ossimColorNormalizedFusion(ossimObject* owner);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+protected:
+   virtual ~ossimColorNormalizedFusion();
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimConvolutionFilter1D.h b/include/ossim/imaging/ossimConvolutionFilter1D.h
new file mode 100644
index 0000000..3a7f741
--- /dev/null
+++ b/include/ossim/imaging/ossimConvolutionFilter1D.h
@@ -0,0 +1,124 @@
+//*******************************************************************
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// class ossimImageGaussianFilter : tile source
+// class ossimConvolutionFilter1D
+// one dimensional convolution
+//
+// efficient for gradients & separable convolution kernels (like gaussian)
+//*******************************************************************
+// $Id: ossimConvolutionFilter1D.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimConvolutionFilter1D_HEADER
+#define ossimConvolutionFilter1D_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/**
+ * class for vertical or horizontal convolution
+ *
+ * PROPERTIES:
+ *  -KernelSize   : length of linear kernel (>=1)
+             NOTE - you need to exit the property editor for the kernel to be resized
+ *  -Kernel       : Kernel vector (line matrix)
+ *  -Horizontal   : boolean, otherwise vertical kernel
+ *  -CenterOffset : center pixel position in the kernel, starting at 0
+ *  -StrictNoData : controls NODATA use
+ *      true  : any NODATA pixel in the convolution will make the center pixel NODATA
+ *      false : if center is NODATA, then output center is NODATA,
+ *              other NODATA pixels are processed as if they were zero in the convolution
+ */
+class OSSIM_DLL ossimConvolutionFilter1D : public ossimImageSourceFilter
+{
+public:
+  /**
+   * own class methods
+   */
+   ossimConvolutionFilter1D(ossimObject* owner=NULL);
+
+   virtual inline const std::vector<ossim_float64>& getKernel()const { return theKernel; }
+   virtual void setKernel(const std::vector<ossim_float64>& aKernel);
+
+   virtual inline bool isHorizontal()const         { return theIsHz; }
+   virtual inline void setIsHorizontal(bool aIsHz) { theIsHz = aIsHz; }
+
+   virtual inline ossim_int32 getCenterOffset()const              { return theCenterOffset; }
+   virtual inline void setCenterOffset(ossim_int32 aCenterOffset) { theCenterOffset = aCenterOffset; }
+   
+   virtual inline bool isStrictNoData()const         { return theStrictNoData; }
+   virtual inline void setStrictNoData(bool aStrict) { theStrictNoData = aStrict; }
+
+  /** 
+   * inherited methods
+   */
+   virtual ossimString getShortName()const{return ossimString("1D Convolution");}
+   virtual ossimString getLongName()const{return ossimString("Convolves the input image with a one dimensional convolution kernel");}
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+
+   virtual double getNullPixelValue(ossim_uint32 band=0) const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)  const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)  const;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,const char* prefix = 0);
+   virtual bool saveState(ossimKeywordlist& kwl,const char* prefix = 0)const;
+   
+protected:
+   virtual ~ossimConvolutionFilter1D();
+
+   /**
+    * Allocates theTile.
+    */
+   void allocate();
+
+   /**
+    * Clears data members theNullPixValue, theMinPixValue, and
+    * theMaxPixValue.
+    */
+   void clearNullMinMax();
+
+   /**
+    * Computes null, min, and max considering input connection and theKernel.
+    */
+   void computeNullMinMax();
+      
+   /*!
+    * Convolve full means that the input data is full and has
+    * no null data.  We don't have to compare for nulls here
+    */
+   template<class T>
+   void convolveFull(T,
+                     ossimRefPtr<ossimImageData> inputData,
+                     ossimRefPtr<ossimImageData> outputData);
+   
+   /*!
+    * Convolve partial means that the input data is has some
+    * null data.  We will have to compare nulls
+    */
+   template<class T>
+   void convolvePartial(T,
+                        ossimRefPtr<ossimImageData> inputData,
+                        ossimRefPtr<ossimImageData> outputData);
+
+   //! offset of center point in the Kernel
+   ossim_int32                theCenterOffset;
+   ossimRefPtr<ossimImageData> theTile;
+   std::vector<ossim_float64>  theKernel;
+   bool                        theIsHz; //! isHorizontal convolution?
+   bool                        theStrictNoData; //! strictly no NODATA values used
+
+   std::vector<double> theNullPixValue;
+   std::vector<double> theMinPixValue;
+   std::vector<double> theMaxPixValue;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimConvolutionFilter1D_HEADER */
diff --git a/include/ossim/imaging/ossimConvolutionSource.h b/include/ossim/imaging/ossimConvolutionSource.h
new file mode 100644
index 0000000..597389a
--- /dev/null
+++ b/include/ossim/imaging/ossimConvolutionSource.h
@@ -0,0 +1,72 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimConvolutionSource.h 22233 2013-04-15 15:12:54Z gpotts $
+#ifndef ossimConvolutionSource_HEADER
+#define ossimConvolutionSource_HEADER
+#include <vector>
+#include <iostream>
+#include <ossim/matrix/newmat.h>
+using namespace std;
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimTilePatch;
+class ossimDiscreteConvolutionKernel;
+
+class OSSIM_DLL ossimConvolutionSource : public ossimImageSourceFilter
+{
+public:
+   ossimConvolutionSource();
+   ossimConvolutionSource(ossimImageSource* inputSource,
+                          const NEWMAT::Matrix& convolutionMatix);
+   ossimConvolutionSource(ossimImageSource* inputSource,
+                          const vector<NEWMAT::Matrix>& convolutionList);
+   
+   virtual void setConvolution(const double* kernel, int nrows, int ncols, bool doWeightedAverage=false);
+   virtual void setConvolution(const NEWMAT::Matrix& convolutionMatrix, bool doWeightedAverage=false);
+   virtual void setConvolutionList(const vector<NEWMAT::Matrix>& convolutionList, bool doWeightedAverage=false);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+   
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+
+   ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect, ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+protected:
+   virtual ~ossimConvolutionSource();
+
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theTile;
+   ossim_int32                 theMaxKernelWidth;
+   ossim_int32                 theMaxKernelHeight;
+   
+   std::vector<ossimDiscreteConvolutionKernel* > theConvolutionKernelList;
+   virtual void setKernelInformation();
+   virtual void deleteConvolutionList();
+
+   template<class T>
+   void convolve(T dummyVariable,
+                 ossimRefPtr<ossimImageData> inputTile,
+                 ossimDiscreteConvolutionKernel* kernel);
+   
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimConvolutionSource_HEADER */
diff --git a/include/ossim/imaging/ossimDespeckleFilter.h b/include/ossim/imaging/ossimDespeckleFilter.h
new file mode 100644
index 0000000..0385850
--- /dev/null
+++ b/include/ossim/imaging/ossimDespeckleFilter.h
@@ -0,0 +1,48 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+//*******************************************************************
+//  $Id: ossimDespeckleFilter.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+#ifndef ossimDespeckleFilter_HEADER
+#define ossimDespeckleFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimDespeckleFilter : public ossimImageSourceFilter
+{
+public:
+   ossimDespeckleFilter();
+   ossimDespeckleFilter(ossimImageSource* inputSource, ossim_uint32 filter_radius=1);
+   
+   virtual void setRadius(ossim_uint32 radius) { theFilterRadius = (ossim_int32) radius; }
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
+
+   ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect, ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+   /* ------------------- PROPERTY INTERFACE -------------------- */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   /* ------------------ PROPERTY INTERFACE END ------------------- */
+
+protected:
+   virtual ~ossimDespeckleFilter();
+   template<class T> void despeckle(T dummyVariable, ossimRefPtr<ossimImageData> inputTile);
+
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theTile;
+   ossim_int32                theFilterRadius;
+   
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimDespeckleFilter_HEADER */
diff --git a/include/ossim/imaging/ossimDilationFilter.h b/include/ossim/imaging/ossimDilationFilter.h
new file mode 100644
index 0000000..fb06be8
--- /dev/null
+++ b/include/ossim/imaging/ossimDilationFilter.h
@@ -0,0 +1,74 @@
+//**************************************************************************************************
+//
+//                                            OSSIM
+//
+//       License: LGPL. See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+//  $Id$
+#ifndef ossimDilationFilter_HEADER
+#define ossimDilationFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimPolygon.h>
+
+/*!
+ * class ossimDilationFilter
+ *
+ * Allows you to change between a median or mean filter.  You can
+ * also specify a window size which the median or mean is computed and
+ * the center pixel is replaced.
+ *
+ */
+class OSSIM_DLL ossimDilationFilter : public ossimImageSourceFilter
+{
+public:
+   ossimDilationFilter(ossimObject* owner=NULL);
+   virtual void initialize();
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0);
+
+   /**
+    * Size of resampling kernel width & height
+    */
+   void setWindowSize(ossim_uint32 windowSize) { theWindowSize = windowSize; }
+   ossim_uint32 getWindowSize() const          { return theWindowSize; }
+
+   /**
+    * Set if getTile is to be called recursively until all pixels have been assigned non-null.
+    * This is only valid for "fill null" modes.
+    */
+   void setRecursiveFlag(bool flag=true) { theRecursiveFlag = flag; }
+   bool getRecursiveFlag() const         { return theRecursiveFlag; }
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+protected:
+   virtual ~ossimDilationFilter();
+   
+   ossimRefPtr<ossimImageData> theTile;
+   ossimRefPtr<ossimImageData> theTempTile; //!> Used for recursion when recursive fill enabled
+   ossim_uint32                theWindowSize;
+   bool                        theRecursiveFlag;
+   ossimPolygon                theValidImagePoly;
+   bool                        theNullFoundFlag;
+
+   template <class T> void doDilation(T scalarType, ossimRefPtr<ossimImageData>& inputData);
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimDiscrete3x3HatFilter.h b/include/ossim/imaging/ossimDiscrete3x3HatFilter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimDiscrete3x3HatFilter.h
rename to include/ossim/imaging/ossimDiscrete3x3HatFilter.h
diff --git a/ossim/include/ossim/imaging/ossimDiscreteConvolutionKernel.h b/include/ossim/imaging/ossimDiscreteConvolutionKernel.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimDiscreteConvolutionKernel.h
rename to include/ossim/imaging/ossimDiscreteConvolutionKernel.h
diff --git a/ossim/include/ossim/imaging/ossimDiscreteNearestNeighbor.h b/include/ossim/imaging/ossimDiscreteNearestNeighbor.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimDiscreteNearestNeighbor.h
rename to include/ossim/imaging/ossimDiscreteNearestNeighbor.h
diff --git a/include/ossim/imaging/ossimDoqqTileSource.h b/include/ossim/imaging/ossimDoqqTileSource.h
new file mode 100644
index 0000000..568fdb2
--- /dev/null
+++ b/include/ossim/imaging/ossimDoqqTileSource.h
@@ -0,0 +1,58 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimDoqqTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+#ifndef ossimDoqqTileSource_HEADER
+#define ossimDoqqTileSource_HEADER
+#include <ossim/imaging/ossimGeneralRasterTileSource.h>
+#include <ossim/support_data/ossimDoqq.h>
+
+class OSSIM_DLL ossimDoqqTileSource: public ossimGeneralRasterTileSource
+{
+public:
+   ossimDoqqTileSource();
+   
+   ossimString getShortName()const;
+   ossimString getLongName()const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = NULL);
+   
+   //! Returns the image geometry object associated with this tile source or NULL if non defined.
+   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   bool open(const ossimFilename& filename);
+   bool open(const ossimGeneralRasterInfo& info);
+
+   ossimString acqdate() const;
+	
+   /**
+    * @brief Gets a property for matching name.
+    * @param name The name of the property to get.
+    * @return Returns property matching "name".
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   
+   /**
+    * @brief Gets a list of property names available.
+    * @param propertyNames The list to push back names to.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+	
+protected:
+   virtual ~ossimDoqqTileSource();
+  ossimRefPtr<ossimDoqq>   theHeaderInformation;
+  ossimString  theAcqDate;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimDtedTileSource.h b/include/ossim/imaging/ossimDtedTileSource.h
new file mode 100644
index 0000000..a120e62
--- /dev/null
+++ b/include/ossim/imaging/ossimDtedTileSource.h
@@ -0,0 +1,263 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: David Burken
+//
+// Description:
+//
+// Contains class declaration of ossimDtedTileSource.  The ossimDtedTileSource
+// class is derived from ossimImageHandler and is intended to be an image
+// handler for DTED files.
+//
+//********************************************************************
+// $Id: ossimDtedTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+
+#ifndef ossimDtedTileSource_HEADER
+#define ossimDtedTileSource_HEADER
+
+#include <fstream>
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/support_data/ossimDtedInfo.h>
+#include <ossim/support_data/ossimDtedVol.h>
+#include <ossim/support_data/ossimDtedHdr.h>
+#include <ossim/support_data/ossimDtedUhl.h>
+#include <ossim/support_data/ossimDtedDsi.h>
+#include <ossim/support_data/ossimDtedAcc.h>
+#include <ossim/base/ossimIoStream.h>
+
+class ossimImageData;
+
+class OSSIM_DLL ossimDtedTileSource : public ossimImageHandler
+{
+public:
+      
+   ossimDtedTileSource();
+
+   enum
+   {
+      DATA_RECORD_OFFSET_TO_POST = 8,  // bytes
+      DATA_RECORD_CHECKSUM_SIZE  = 4,  // bytes
+      POST_SIZE                  = 2,  // bytes
+      NULL_PIXEL                 = -32767
+   };
+   
+   virtual ossimString getShortName()const;
+   virtual ossimString getLongName()const;
+
+   /**
+    *  Returns true if "theImageFile" can be opened and is a valid adrg file.
+    */
+   virtual bool open();
+   virtual void close();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+   
+  /**
+   * Method to get a tile.   
+   *
+   * @param result The tile to stuff.  Note The requested rectangle in full
+   * image space and bands should be set in the result tile prior to
+   * passing.  It will be an error if:
+   * result.getNumberOfBands() != this->getNumberOfOutputBands()
+   *
+   * @return true on success false on error.  If return is false, result
+   *  is undefined so caller should handle appropriately with makeBlank or
+   * whatever.
+   */
+  virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+  
+   /**
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+   virtual ossim_uint32 getNumberOfOutputBands()const;
+   
+   /**
+    *  Returns the number of lines in the image.
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfLines(
+      ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    *  Returns the number of samples in the image.  
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(
+      ossim_uint32 reduced_res_level = 0) const;
+
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * Returns the zero based image rectangle for the reduced resolution data
+    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(
+      ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   //! Returns the image geometry object associated with this tile source or NULL if not defined.
+   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   virtual bool isOpen()const;
+
+   /**
+    * Initializes spacing to the post spacing of the cell.
+    *
+    * @param postSpacing ossimDpt to initialize with spacing where
+    * postspacing.x = longitude interval and postspacing.y = latitude interval.
+    */
+   void getPostSpacing(ossimDpt& postSpacing) const;
+
+   /**
+    * @brief Gets a property for name.
+    * @param name Property name to get.
+    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
+    * property for name was not found.
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   /**
+    * @brief Adds this class's properties to list.
+    * @param propertyNames list to append to.
+    */
+   virtual void getPropertyNames(
+      std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief Sets the min/max.
+    *
+    * looks for an omd or statistics file for min/max.  If not found
+    * calls gatherStatistics method.  Overrides ossimImageHandler::loadMetaData
+    * called by completeOpen.
+    */
+   virtual void loadMetaData();  
+   
+protected:
+   virtual ~ossimDtedTileSource();
+
+   // Disallow operator= and copy constrution...
+   const ossimDtedTileSource& operator=(const  ossimDtedTileSource& rhs);
+   ossimDtedTileSource(const ossimDtedTileSource&);
+
+   /**
+    * Allocated the tiles.
+    */
+   void allocate();
+
+   /**
+    *  Returns true on success, false on error.
+    */
+   bool fillBuffer(const ossimIrect& tile_rect,
+                   const ossimIrect& clip_rect,
+                   ossimImageData* tile);
+
+   
+   /**
+    * @brief Scans for min and max.
+    * @param writeStatsFile If true and statistics file does not exists it
+    * will write one; else, no file will be written.
+    */
+   void gatherStatistics(bool writeStatsFile);
+   
+   ossim_sint16 convertSignedMagnitude(ossim_uint16& s) const;
+   
+   ossimRefPtr<ossimImageData> theTile;
+   mutable std::shared_ptr<ossim::istream>      m_fileStr;
+   mutable std::shared_ptr<ossimDtedInfo>       m_dtedInfo;
+
+   ossim_uint32               theTileWidth;
+   ossim_uint32               theTileHeight;   
+   ossim_uint32               theNumberOfLines;
+   ossim_uint32               theNumberOfSamps;
+   ossim_uint32               theOffsetToFirstDataRecord;
+   ossim_uint32               theDataRecordSize;
+   ossim_sint16               theMinHeight;
+   ossim_sint16               theMaxHeight;
+   ossimDpt                   thePostSpacing;
+   
+   ossimDtedVol m_vol;
+   ossimDtedHdr m_hdr;
+   ossimDtedUhl m_uhl;
+   ossimDtedDsi m_dsi;
+   ossimDtedAcc m_acc;
+   /**
+    *  DTED data is always stored as BIG_ENDIAN.  This flag indicates that
+    *  byte swapping is needed (LITTLE_ENDIAN machine).
+    */
+   bool  theSwapBytesFlag;    
+
+TYPE_DATA
+};
+
+inline ossim_sint16 ossimDtedTileSource::convertSignedMagnitude(ossim_uint16& s) const
+{
+   // DATA_VALUE_MASK 0x7fff = 0111 1111 1111 1111
+   // DATA_SIGN_MASK  0x8000 = 1000 0000 0000 0000
+   
+   // First check to see if the bytes need swapped.
+   s = (theSwapBytesFlag ? ( ((s&0x00ff) << 8) | ((s&0xff00) >> 8) ) : s);
+
+   // If the sign bit is set, mask it out then multiply by negative one.
+   if (s & 0x8000)
+   {
+      return (static_cast<ossim_sint16>(s & 0x7fff) * -1);
+   }
+   
+   return static_cast<ossim_sint16>(s);
+}
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimERSFileWriter.h b/include/ossim/imaging/ossimERSFileWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimERSFileWriter.h
rename to include/ossim/imaging/ossimERSFileWriter.h
diff --git a/include/ossim/imaging/ossimERSTileSource.h b/include/ossim/imaging/ossimERSTileSource.h
new file mode 100644
index 0000000..c63ec77
--- /dev/null
+++ b/include/ossim/imaging/ossimERSTileSource.h
@@ -0,0 +1,56 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Chong-Ket Chuah
+//
+// Description:
+//
+// Contains class definition for the class "ossimERSTileSource".
+//
+//*******************************************************************
+//  $Id: ossimERSTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+
+#ifndef ossimERSTileSource_HEADER
+#define ossimERSTileSource_HEADER
+
+#include <ossim/imaging/ossimGeneralRasterTileSource.h>
+#include <ossim/support_data/ossimERS.h>
+
+
+class OSSIM_DLL ossimERSTileSource : public ossimGeneralRasterTileSource
+{
+public:
+   ossimERSTileSource();
+
+   ossimERSTileSource(const ossimKeywordlist& kwl, const char* prefix=0);
+   
+
+   virtual ossimString getShortName() const;
+   virtual ossimString getLongName() const;
+   virtual ossimString className() const;
+
+   virtual bool open(const ossimFilename& filename);
+  
+   //! Returns the image geometry object associated with this tile source or NULL if not defined.
+   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = NULL);
+protected:
+   virtual ~ossimERSTileSource();
+
+private:
+
+   void openHeader(const ossimFilename& file);
+   
+   ossimERS* theHdr;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimEastingNorthingCutter.h b/include/ossim/imaging/ossimEastingNorthingCutter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimEastingNorthingCutter.h
rename to include/ossim/imaging/ossimEastingNorthingCutter.h
diff --git a/include/ossim/imaging/ossimEdgeFilter.h b/include/ossim/imaging/ossimEdgeFilter.h
new file mode 100644
index 0000000..dbc4427
--- /dev/null
+++ b/include/ossim/imaging/ossimEdgeFilter.h
@@ -0,0 +1,86 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimEdgeFilter.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimEdgeFilter_HEADER
+#define ossimEdgeFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/**
+ * class ossimEdgeFilter
+ *
+ * This has default implementation for the certain filter types.  For the
+ * different filter type please see method setFilterType.
+ *
+ *
+ */
+class ossimEdgeFilter : public ossimImageSourceFilter
+{
+public:
+   ossimEdgeFilter(ossimObject* owner=NULL);
+   ossimEdgeFilter(ossimImageSource* inputSource);
+   ossimEdgeFilter(ossimObject* owner,
+                    ossimImageSource* inputSource);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   virtual void initialize();
+   virtual void getFilterTypeNames(std::vector<ossimString>& filterNames)const;
+   virtual ossimString getFilterType()const;
+   /**
+    * The filter type can be one of the following strings.  It is
+    * case insensitive for the compares.
+    *
+    *  Sobel
+    *  Laplacian
+    *  Prewitt
+    *  
+    */
+   virtual void setFilterType(const ossimString& filterType);
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   virtual bool saveState(ossimKeywordlist& kwl,const char* prefix=0)const;
+   virtual bool loadState(const ossimKeywordlist& kwl,const char* prefix=0);
+   
+protected:
+   ossimRefPtr<ossimImageData> theTile;
+   ossimString                 theFilterType;
+   
+   void adjustRequestRect(ossimIrect& requestRect)const;
+   
+   template <class T>
+   void runFilter(T dummyVariable,
+                  ossimRefPtr<ossimImageData> inputData);
+   template <class T>
+   void runSobelFilter(T dummyVariable,
+                       ossimRefPtr<ossimImageData> inputData);
+   template <class T>
+   void runPrewittFilter(T dummyVariable,
+                         ossimRefPtr<ossimImageData> inputData);
+   template <class T>
+   void runLaplacianFilter(T dummyVariable,
+                           ossimRefPtr<ossimImageData> inputData);
+   template <class T>
+   void runRobertsFilter(T dummyVariable,
+                           ossimRefPtr<ossimImageData> inputData);
+   template <class T>
+   void runSimpleFilter(T dummyVariable,
+                           ossimRefPtr<ossimImageData> inputData);
+   template <class T>
+   void runLocalMax8Filter(T dummyVariable,
+                          ossimRefPtr<ossimImageData> inputData);
+   
+TYPE_DATA
+};
+
+
+#endif
diff --git a/include/ossim/imaging/ossimElevImageSource.h b/include/ossim/imaging/ossimElevImageSource.h
new file mode 100644
index 0000000..92cdb4f
--- /dev/null
+++ b/include/ossim/imaging/ossimElevImageSource.h
@@ -0,0 +1,146 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+// 
+// Description:  Class provides an elevation image source from the elevation
+// manager.
+//
+//********************************************************************
+// $Id: ossimElevImageSource.h 17108 2010-04-15 21:08:06Z dburken $
+
+#ifndef ossimElevImageSource_HEADER
+#define ossimElevImageSource_HEADER
+
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimGrect.h>
+
+class ossimElevSource;
+
+class ossimElevImageSource : public ossimImageSource
+{
+public:
+
+   ossimElevImageSource();
+   ossimElevImageSource(ossimObject* owner);
+   ossimElevImageSource(ossimObject* owner,
+                        const ossimGpt& tie,
+                        double latSpacing,  // decimal degrees
+                        double lonSpacing ,
+                        ossim_uint32 numberLines,
+                        ossim_uint32 numberSamples);
+   ossimElevImageSource(ossimObject* owner,
+                        const ossimKeywordlist& kwl,
+                        const char* prefix=0);
+   
+
+   /*!
+    *  Returns a pointer to a tile given an origin representing the upper left
+    *  corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                   ossim_uint32 resLevel=0);
+
+   /*!
+    *  Populates the keyword list with image geometry information.  This
+    *  method is used to relay projection/model information to users.
+    *  Returns true if geometry info is present, false if not.
+    */
+   virtual bool getImageGeometry(ossimKeywordlist& kwl,
+                                 const char* prefix=0);
+   
+   /*!
+    *  Returns the number of bands in the image.  Alway one for this source.
+    */
+   virtual ossim_uint32 getNumberOfOutputBands()const { return 1; }
+
+
+   /*!
+    * Returns the zero-based (relative) image rectangle for the reduced
+    * resolution data set (rrds) passed in.  Note that rrds 0 is the highest
+    * resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const; 
+
+   /*!
+    * Returns the absolute bounding rectangle of the image. The upper left
+    * corner may be non-zero if this is a subimage.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel = 0) const
+      {
+         return getImageRectangle(resLevel);
+      }
+   
+   /*!
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   bool canConnectMyInputTo(ossim_int32 /* inputIndex */,
+                            const ossimConnectableObject* /* object */ )const
+   {      
+      return false;
+   }
+      
+   virtual void initialize();
+
+   /*!
+    *  Satisfy pure virtuals from base classes...
+    */
+   virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const;
+   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
+   virtual ossim_uint32 getNumberOfDecimationLevels()const;
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual ossim_uint32 getTileWidth() const;
+   virtual ossim_uint32 getTileHeight() const;
+   virtual void changeTileSize(const ossimIpt& size);
+
+   // access methods
+   virtual ossimGpt getTiePoint()         const { return theTiePoint; }
+   virtual ossim_float64 getLatitudeSpacing()  const { return theLatSpacing; }
+   virtual ossim_float64 getLongitudeSpacing() const { return theLonSpacing; }
+   virtual ossim_uint32  getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   
+   // set methods
+   virtual void setTiePoint(const ossimGpt& gpt) { theTiePoint = gpt; }
+   virtual void setLatitudeSpacing(ossim_float64 sp) { theLatSpacing = sp; }
+   virtual void setLongitudeSpacing(ossim_float64 sp) { theLonSpacing = sp; }
+   virtual void setNumberOfLines(ossim_uint32 lines) { theNumberOfLines = lines; }
+   virtual void setNumberOfSamples(ossim_uint32 samps) { theNumberOfSamps = samps;}
+   virtual void setMinPixelValue(ossim_float64 min_pix);
+   virtual void setMaxPixelValue(ossim_float64 max_pix);
+   
+protected:
+   virtual ~ossimElevImageSource();
+
+   ossimElevSource*            theElevManager;
+   ossimRefPtr<ossimImageData> theTile;
+   ossimGpt                    theTiePoint;      // upper left tie point
+   ossim_float64               theLatSpacing;    // in decimal degrees
+   ossim_float64               theLonSpacing;    // in decimal degrees
+   ossim_uint32                theNumberOfLines;
+   ossim_uint32                theNumberOfSamps;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimElevRemapper.h b/include/ossim/imaging/ossimElevRemapper.h
new file mode 100644
index 0000000..bd51101
--- /dev/null
+++ b/include/ossim/imaging/ossimElevRemapper.h
@@ -0,0 +1,45 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  RP
+//
+// Description:
+//
+// 
+//*******************************************************************
+//  $Id$
+#ifndef ossimElevRemapper_HEADER
+#define ossimElevRemapper_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIM_DLL ossimElevRemapper : public ossimImageSourceFilter
+{
+public:
+   static const char REMAP_MODE_KW[];
+
+   enum ReplacementType
+   {
+      ReplacementType_ELLIPSOID = 0,
+      ReplacementType_GEOID = 1
+   };
+   
+   ossimElevRemapper();
+   virtual void initialize();
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+   
+protected:
+   virtual ~ossimElevRemapper();
+   template <class T> void elevRemap(T dummy,
+                                      ossimImageData* inpuTile,
+                                      ossim_uint32 resLevel);
+   
+   ReplacementType m_replacementType;
+   bool saveState(ossimKeywordlist& kwl, const char* prefix)const;
+   bool loadState(const ossimKeywordlist& kwl, const char* prefix);
+   ossimRefPtr<ossimImageGeometry> m_imageGeometry;
+
+TYPE_DATA   
+};
+#endif
diff --git a/include/ossim/imaging/ossimElevationMosaic.h b/include/ossim/imaging/ossimElevationMosaic.h
new file mode 100644
index 0000000..f617f49
--- /dev/null
+++ b/include/ossim/imaging/ossimElevationMosaic.h
@@ -0,0 +1,73 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: 
+//
+//*************************************************************************
+// $Id: ossimElevationMosaic.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimElevationMosaic_HEADER
+#define ossimElevationMosaic_HEADER
+#include <vector>
+using namespace std;
+
+#include <ossim/imaging/ossimImageCombiner.h>
+
+
+/**
+ * An image mosaic is a simple combiner that will
+ * just do a simple mosaic.  It just checks NULL pix values until it finds a
+ * pixel that is not empty and copies it out to the output.  The list will
+ * have same size tiles and have the same number of bands.
+ */
+class OSSIMDLLEXPORT ossimElevationMosaic : public ossimImageCombiner
+{
+public:
+   ossimElevationMosaic();
+   ossimElevationMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+protected:
+   virtual ~ossimElevationMosaic();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theTile;
+
+   template <class T> ossimRefPtr<ossimImageData> combine(
+      T, // dummy template variable not used
+      const ossimIrect& tileRect,
+      ossim_uint32 resLevel=0);
+   template <class T> ossimRefPtr<ossimImageData> combineNorm(
+      T, // dummy template variable not used
+      const ossimIrect& tileRect,
+      ossim_uint32 resLevel=0);
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimElevationMosaic_HEADER */
diff --git a/include/ossim/imaging/ossimEnviHeaderFileWriter.h b/include/ossim/imaging/ossimEnviHeaderFileWriter.h
new file mode 100644
index 0000000..b5c599c
--- /dev/null
+++ b/include/ossim/imaging/ossimEnviHeaderFileWriter.h
@@ -0,0 +1,78 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Class declaration for ossimEnviHeaderFileWriter.  Meta data class for
+// writing an ENVI (The Environment for Visualizing Images) header file.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimEnviHeaderFileWriter.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimEnviHeaderFileWriter_H
+#define ossimEnviHeaderFileWriter_H
+
+#include <fstream>
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+
+/**
+ * Class for writing a "ENVI" style header.
+ */
+class OSSIMDLLEXPORT ossimEnviHeaderFileWriter : public ossimMetadataFileWriter
+{
+public:
+
+   /** default constructor */
+   ossimEnviHeaderFileWriter();
+
+
+   /**
+    * Initializes the state of the writer.  Users should use this to set
+    * the envi header fields that are not taken from theInputConnection prior
+    * to calling execute.
+    *
+    * @return true on success, false on failure.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * Appends the writers image types to the "metadatatypeList".
+    * 
+    * @param metadatatypeList stl::vector<ossimString> list to append to.
+    *
+    * @note Appends to the list, does not clear it first.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList) const;
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * @param imageType string representing image type.
+    *
+    * @return true if "metadataType" is supported by writer.
+    */
+   virtual bool hasMetadataType(const ossimString& metadataType)const;   
+protected:
+   /** virtual destructor */
+   virtual ~ossimEnviHeaderFileWriter();
+
+private:
+   
+   virtual bool writeFile();
+
+   ossimEnviHeader theHdr;
+   
+TYPE_DATA
+};
+#endif /* End of #ifndef ossimEnviHeaderFileWriter_H */
diff --git a/include/ossim/imaging/ossimEnviTileSource.h b/include/ossim/imaging/ossimEnviTileSource.h
new file mode 100644
index 0000000..fdd0d11
--- /dev/null
+++ b/include/ossim/imaging/ossimEnviTileSource.h
@@ -0,0 +1,110 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Image handler class for a raster files with an ENVI header file.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimEnviTileSource_HEADER
+#define ossimEnviTileSource_HEADER 1
+
+#include <ossim/imaging/ossimGeneralRasterTileSource.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+
+
+class OSSIMDLLEXPORT ossimEnviTileSource : public ossimGeneralRasterTileSource
+{
+public:
+
+   /** @brief default constructor */
+   ossimEnviTileSource();
+
+   /** @return "ENVI" */
+   virtual ossimString getShortName() const;
+
+   /** @return "ENVI reader" */
+   virtual ossimString getLongName()  const;
+
+   /** @brief open method. */
+   virtual bool open();
+
+   /**
+    * @return The image geometry object associated with this tile source or
+    * NULL if not defined.  The geometry contains full-to-local image transform
+    * as well as projection (image-to-world).
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * @return true on success, false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = NULL);
+
+   /**
+    * @brief Gets a property.
+    * @param The name of the property to get.
+    * @return The property if found.
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+
+   /**
+    * @brief Adds property names to array.
+    * @param propertyNames Array to populate with property names.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief Get the zero based rgb output band list from envi header.
+    * 
+    * @param bandList Initialized by this on success.
+    * 
+    * @return true on success; false, on error.
+    */
+   virtual bool getRgbBandList(std::vector<ossim_uint32>& bandList) const;
+
+protected:
+   
+   /** @brief Hidden from use destructor.  This is a ref ptr. */
+   virtual ~ossimEnviTileSource();
+
+private:
+
+   /**
+    * @brief Sets default output band list if we are a band selector and
+    * "default bands" is found in the header file.
+    */
+   void setDefaultBandList();
+
+   /**
+    * @brief Creates geometry from known support data, i.e. envi header,
+    * and so on if found.
+    */
+   ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const;
+   
+   ossimEnviHeader m_enviHdr;
+   
+TYPE_DATA
+   
+}; // End: class ossimEnviTileSource
+
+#endif /* #ifndef ossimEnviTileSource_HEADER */
diff --git a/include/ossim/imaging/ossimEquationCombiner.h b/include/ossim/imaging/ossimEquationCombiner.h
new file mode 100644
index 0000000..03421d1
--- /dev/null
+++ b/include/ossim/imaging/ossimEquationCombiner.h
@@ -0,0 +1,323 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimEquationCombiner.h 23649 2015-12-08 15:00:50Z gpotts $
+#ifndef ossimEquationCombiner_HEADER
+#define ossimEquationCombiner_HEADER
+#include <ossim/imaging/ossimImageCombiner.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/base/ossimEquTokenizer.h>
+#include <stack>
+
+//class ossimCastTileSourceFilter;
+
+/**
+ * Will combine the input data based on a supplied equation.
+ *
+ * This combiner uses the ossimEquTokenizer to create unique id's
+ * for all tokens in the formula.  The parser is based on the following
+ * rules:
+ *
+ * <pre>
+ * 
+ * Prog -> Expr EOF 
+ * Expr -> Term RestExpr 
+ * RestExpr -> + Term RestExpr | - Term RestExpr | <null> 
+ * Term -> Storable RestTerm 
+ * RestTerm -> * Factor RestTerm | / Factor RestTerm | <null> 
+ * Factor -> number | R | ( Expr )
+ *
+ *
+ * The equation string represents input images as in[i] for i = 0, 1, ..., n.
+ * The following tokens are supported, where I, I1, I2, ..., In are inputs (either input images or
+ * image solutions of other equations):
+ *
+ * sin(I)                 takes the sine of the input
+ * sind(I)                takes the sin of the input and assumes degree input
+ * asin(I)                computes the arc-sine of input in radians (input must be normalized)
+ * asind(I)               computes the arc-sine of input in degrees (input must be normalized)
+ * cos(I)                 takes cosine of input
+ * cosd(I)                takes the cosine of input and assumes input in degrees
+ * acos(I)                computes the arc-cosine of input in radians (input must be normalized)
+ * acosd(I)               computes the arc-cosine of input in degrees (input must be normalized)
+ * tan(I)                 takes tangent of input
+ * tand(I)                takes the tangent of input and assumes input in degrees
+ * atan(I)                computes the arc-tangent of input in radians
+ * atand(I)               computes the arc-tangent of input in degrees
+ * sqrt(I)                takes square root of input
+ * log(I)                 takes the natural log of input
+ * log10(I)               takes the log base 10 of the input
+ * exp(I)                 takes the e raised to the passed in argument
+ * abs(I)                 takes the absolute value of the passed in value
+ * min(I1, I2, ... In)    takes the min of all values in the list
+ * max(I1, I2, ... In)    takes the max of all values in the list.
+ *
+ * clamp(I, min, max)     will clamp all data to be between the min max values.
+ *                        will set anything less than min to min and anythin
+ *                        larger than max to max
+ *
+ * band(I, band_index)    returns a single band image object
+ *                        by selecting band num from input image I.  Note
+ *                        the first argument must be an image
+ *                        and the second argument must be a number
+ *
+ * shift(I, rows, cols)
+ *                        currently, the first argument must be an image
+ *                        variable and rows, cols must be numbers
+ *                        indicating the delta in that direction to shift the
+ *                        input.
+ *
+ * blurr(I, rows, cols)   Will blurr the input image I with a
+ *                        rows-by-cols kernel.  All values are equal
+ *                        weight.  Note the fist argument must by an image
+ *                        variable (ex: i1, i2,....in).
+ *
+ * conv(index, rows, cols, <row ordered list of values> )
+ *                        this allows you to define an arbitrary matrix.  The
+ *                        <row ordered list of values> is a comma separated
+ *                        list of constant values.
+ *
+ * assign_band(I1, num1, I2, num2)
+ *                        will take band num2 from image data I2 and assign it to
+ *                        band num1 in image data I1.
+ *
+ * assign_band(I1, num1, I2)
+ *                        will take band 1 from image data I2 and assign it to
+ *                        band num1 in image data I1.
+ *
+ * assign_band(I, num1, num2)
+ *                        will assin to band num1 of data I the value of num2
+ *
+ * I1 * I2                will multiply I1 and I2
+ * I1 + I2                will add I1 and I2
+ * I1 - I2                will subtract I1 and I2
+ * I1 / I2                will divide I1 and I2
+ * I1 ^ I2                will do a power, raises I1 to I2
+ * I1 | I2                will do a bitwise or operation
+ *                        ( will do it in unisgned char precision)
+ *
+ * I1 & I2                will do a bitwise and operation
+ *                        ( will do it in unsigned char precision)
+ *
+ * ~I1                    will do the ones complement of the input
+ *
+ * I1 xor I2              will do an exclusive or operation
+ *                        (will do it in unsigned char precision)
+ *
+ * - I1                   will negative of I1
+ *
+ * Boolean ops: 1=true, 0=false
+ * I1 > I2
+ * I1 >= I2
+ * I1 == I2
+ * I1 <= I2
+ * I1 < I2
+ * I1 <> I2
+ *
+ * Note:
+ *
+ * Currently an image input is reference by the variable "in[i]" where i
+ * represents the input image index starting from 0.  So in[1] referes to the second image
+ * in the input source list.
+ *
+ * Some examples:
+ *
+ *  (in[0] + in[1])/2
+ *  Will take image 0 and add it to image 1 and average them.
+ *
+ *  exp(sqrt(in[0])/4)
+ *  Will take the root of the image and divide by 4 and then raise e to that
+ *  amount.
+ *
+ *  128
+ *  Will return a constant value of 128 for all input bands.
+ *
+ * shift(0, 1, 1) - in[0]
+ * Will shift the first input (0) by 1 pixel along the diagonal and then subtract
+ * the original from the shifted (edge detect).
+ *
+ * assign_band(in[1], 1, blurr(in[1], 5, 5), 2)
+ * Will assign to the first band of input 1 the 2nd band of the 5x5 blurr of same image.
+ *
+ * conv(0, 3, 3, -1, -2, -1, 0, 0, 0, 1, 2, 1)
+ * Will convolve the first input connection with a 3x3 matrix.
+ * The args are row ordered:
+ *                          -1, -2, -1
+ *                           0,  0,  0
+ *                           1,  2,  1
+ *
+ * NDVI:
+ * N=(in[0]-in[1])/(in[0]+in[1])
+ *
+ * For indexed-type values,like NDVI, (with limited values) it is better
+ * to rescale between 0.0 and 1.0 and use type NormalizedFloat.
+ * 
+ * Rescaled NDVI between 0 and 1:
+ * (N+1)/2 = in[0]/(in[0]+in[1])
+ * 
+ * With an ossimImageToPlaneNormalFilter feeding the DEM-image input, the slope at each pixel,
+ * normalized so that 1.0 = 90 deg from vertical, is computed with:
+ * "acosd(band(in[0],2))/90"
+ *
+ * </pre>
+ */
+class OSSIMDLLEXPORT ossimEquationCombiner : public ossimImageCombiner
+{
+public:
+   ossimEquationCombiner();
+   ossimEquationCombiner(ossimConnectableObject::ConnectableObjectList& inputSources);
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+
+   virtual void setEquation(const ossimString& equ)
+      {
+         theEquation = equ;
+      }
+   virtual ossimString getEquation()const
+      {
+         return theEquation;
+      }
+   
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   virtual ossimScalarType getOutputScalarType() const;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   
+   virtual void setOutputScalarType(ossimScalarType scalarType);
+   /*!
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   class ossimBinaryOp
+   {
+   public:
+      virtual ~ossimBinaryOp(){}
+      virtual double apply(double v1, double v2)const=0;
+   };
+   class ossimUnaryOp
+   {
+   public:
+      virtual ~ossimUnaryOp(){}
+      virtual double apply(double v)const=0;
+   };
+   
+protected:
+   enum ossimEquValueType
+   {
+      OSSIM_EQU_TYPE_UNKNOWN    = 0,
+      OSSIM_EQU_DOUBLE_TYPE     = 1,
+      OSSIM_EQU_IMAGE_DATA_TYPE = 2
+   };
+   
+   union ossimEquDataType
+   {
+      double           doubleValue;
+      ossimImageData* imageDataValue;
+   };
+   
+   struct ossimEquValue
+   {
+      int              type;
+      ossimEquDataType d;
+   };
+
+   virtual ~ossimEquationCombiner();
+   
+   
+   ossimScalarType             theOutputScalarType;
+   ossimString                 theEquation;
+   mutable ossimEquTokenizer  *theLexer;
+   ossimRefPtr<ossimImageData> theTile;
+   ossimRefPtr<ossimCastTileSourceFilter>  theCastFilter;
+   ossimRefPtr<ossimCastTileSourceFilter> theCastOutputFilter;
+   
+   mutable int                theCurrentId;
+   mutable std::stack<ossimEquValue> theValueStack;
+   ossim_uint32                     theCurrentResLevel;
+   virtual void assignValue();
+   virtual void clearStacks();
+   virtual void clearArgList(vector<ossimEquValue>& argList);
+
+   virtual ossimRefPtr<ossimImageData> getImageData(ossim_uint32 index);
+   virtual ossimRefPtr<ossimImageData> getNewImageData(ossim_uint32 index);
+
+   virtual void deleteArgList(vector<ossimEquValue>& args);
+   virtual bool parseArgList(vector<ossimEquValue>& args,
+                             bool popValueStack = true);
+   
+   virtual ossimRefPtr<ossimImageData> parseEquation();
+  
+   virtual bool parseAssignBand();
+   virtual bool parseExpression();
+   virtual bool parseRestOfExp();
+   virtual bool parseTerm();
+   virtual bool parseRestOfTerm();
+   virtual bool parseFactor();
+   virtual bool parseStdFuncs();
+   virtual bool parseUnaryFactor();
+
+   virtual bool applyClamp(ossimImageData* &result,
+                           const vector<ossimEquValue>& argList);
+                           
+   virtual bool applyConvolution(ossimImageData* &result,
+                                 const vector<ossimEquValue>& argList);
+   
+   virtual bool applyBlurr(ossimImageData* &result,
+                           const vector<ossimEquValue>& argList);
+   
+   virtual bool applyShift(ossimImageData* &result,
+                           const vector<ossimEquValue>& argList);
+   
+   virtual bool applyOp(const ossimBinaryOp& op,
+                        ossimEquValue& result,
+                        ossimEquValue& v1,
+                        ossimEquValue& v2);
+   
+   virtual bool applyOp(const ossimBinaryOp& op,
+                        ossimImageData* v1,
+                        double          v2);
+
+   virtual bool applyOp(const ossimBinaryOp& op,
+                        double          v1,
+                        ossimImageData* v2);
+
+   virtual bool applyOp(const ossimBinaryOp& op,
+                        ossimImageData* v1,
+                        ossimImageData* v2);      
+
+   
+   virtual bool applyOp(const ossimUnaryOp& op,
+                        ossimEquValue& result,
+                        ossimEquValue& v1);
+   
+   virtual bool applyOp(const ossimUnaryOp& op,
+                        ossimImageData* v);
+   
+TYPE_DATA
+};
+#endif
diff --git a/include/ossim/imaging/ossimErosionFilter.h b/include/ossim/imaging/ossimErosionFilter.h
new file mode 100644
index 0000000..fffdeaf
--- /dev/null
+++ b/include/ossim/imaging/ossimErosionFilter.h
@@ -0,0 +1,62 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimErosionFilter_HEADER
+#define ossimErosionFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimPolygon.h>
+
+/*!
+ * class ossimErosionFilter
+ *
+ * Causes null pixels to erode neighboring valid pixels. This is the opposite of dilation.
+ * If a null pixel is detected inside the sampling window, the center pixel is set to null.
+ */
+class OSSIM_DLL ossimErosionFilter : public ossimImageSourceFilter
+{
+public:
+   ossimErosionFilter(ossimObject* owner=NULL);
+   virtual void initialize();
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0);
+
+   /**
+    * Size of resampling kernel width & height
+    */
+   void setWindowSize(ossim_uint32 windowSize) { theWindowSize = windowSize; }
+   ossim_uint32 getWindowSize() const          { return theWindowSize; }
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+protected:
+   virtual ~ossimErosionFilter();
+   
+   ossimRefPtr<ossimImageData> theTile;
+   ossimRefPtr<ossimImageData> theTempTile; //!> Used for recursion when recursive fill enabled
+   ossim_uint32                theWindowSize;
+   ossimPolygon                theValidImagePoly;
+
+   template <class T> void doErosion(T scalarType, ossimRefPtr<ossimImageData>& inputData);
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimEsriShapeFileInterface.h b/include/ossim/imaging/ossimEsriShapeFileInterface.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimEsriShapeFileInterface.h
rename to include/ossim/imaging/ossimEsriShapeFileInterface.h
diff --git a/include/ossim/imaging/ossimFeatherMosaic.h b/include/ossim/imaging/ossimFeatherMosaic.h
new file mode 100644
index 0000000..b0fff9a
--- /dev/null
+++ b/include/ossim/imaging/ossimFeatherMosaic.h
@@ -0,0 +1,87 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimFeatherMosaic.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimFeatherMosaic_HEADER
+#define ossimFeatherMosaic_HEADER
+#include <vector>
+#include <iterator>
+
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/base/ossimDpt.h>
+
+
+/**
+ * Performs a spatial blend accross overlapping regions
+ */
+class OSSIMDLLEXPORT ossimFeatherMosaic : public ossimImageMosaic
+{
+public:
+   ossimFeatherMosaic();
+   ossimFeatherMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                   ossim_uint32 resLevel=0);
+   virtual void initialize();
+       
+protected:
+   virtual ~ossimFeatherMosaic();
+   /**
+    * This is only visible by this class and will remain here
+    * unless we want to move it later.
+    */
+   class ossimFeatherInputInformation
+   {
+      
+   public:
+      ossimFeatherInputInformation(const vector<ossimIpt>& validVertices=vector<ossimIpt>());
+
+      void setVertexList(const vector<ossimIpt>& validVertices);
+      
+      ossimDpt        theCenter;
+      ossimDpt        theAxis1;
+      ossimDpt        theAxis2;
+      double          theAxis1Length;
+      double          theAxis2Length;
+      std::vector<ossimIpt> theValidVertices;
+      
+   };
+
+   friend ostream& operator<<(ostream& out,
+                              const ossimFeatherInputInformation& data);
+   
+
+   /**
+    * will hold an array of input information
+    *
+    */
+   ossimFeatherInputInformation* theInputFeatherInformation;
+   ossimRefPtr<ossimImageData> theAlphaSum;
+   ossimRefPtr<ossimImageData> theResult;
+   
+   /**
+    * Will hold the count for the feather information list.
+    */
+   long                          theFeatherInfoSize;
+
+   /**
+    * The dummy variable is used for the template type.  See the getTile
+    * method for the call.
+    */
+   template <class T>
+   ossimRefPtr<ossimImageData> combine(T dummyVariableNotUsed,
+                                       const ossimIrect& tileRect,
+                                       ossim_uint32 resLevel);
+   
+   virtual double computeWeight(long index,
+                                const ossimDpt& point)const;
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimFeatherMosaic_HEADER */
diff --git a/include/ossim/imaging/ossimFftFilter.h b/include/ossim/imaging/ossimFftFilter.h
new file mode 100644
index 0000000..ba744a6
--- /dev/null
+++ b/include/ossim/imaging/ossimFftFilter.h
@@ -0,0 +1,81 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimFftFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimFftFilter_HEADER
+#define ossimFftFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimScalarRemapper;
+
+class OSSIM_DLL ossimFftFilter : public ossimImageSourceFilter
+{
+public:
+   enum ossimFftFilterDirectionType { FORWARD = 0, INVERSE  };
+
+   ossimFftFilter(ossimObject* owner=NULL);
+   ossimFftFilter(ossimImageSource* inputSource);
+   ossimFftFilter(ossimObject* owner,
+                  ossimImageSource* inputSource);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                   ossim_uint32 resLevel=0);
+   virtual void initialize();
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+  /*!
+   * Returns the max pixel of the band.
+   */
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+  /*!
+   * Each band has a null pixel associated with it.  The null pixel 
+   * represents an invalid value.
+   */ 
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   
+   void setForward();
+   void setInverse();
+   ossimString getDirectionTypeAsString()const;
+   void setDirectionType(const ossimString& directionType);
+   void setDirectionType(ossimFftFilterDirectionType directionType);
+      
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0)const;
+protected:
+   virtual ~ossimFftFilter();
+   ossimRefPtr<ossimImageData> theTile;
+   ossimFftFilterDirectionType theDirectionType;
+   ossimRefPtr<ossimScalarRemapper>        theScalarRemapper;
+   virtual void runFft(ossimRefPtr<ossimImageData>& input,
+                       ossimRefPtr<ossimImageData>& output);
+
+   template <class T>
+   void fillMatrixForward(T *realPart,
+                          T nullPix,
+                          NEWMAT::Matrix& real,
+                          NEWMAT::Matrix& img)const;
+   template <class T>
+   void fillMatrixInverse(T *realPart,
+                          T *imgPart,
+                          NEWMAT::Matrix& real,
+                          NEWMAT::Matrix& img)const;
+
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimFgdcFileWriter.h b/include/ossim/imaging/ossimFgdcFileWriter.h
new file mode 100644
index 0000000..5df2704
--- /dev/null
+++ b/include/ossim/imaging/ossimFgdcFileWriter.h
@@ -0,0 +1,157 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  Class to write out meta data in a Federal Geographic Data
+// Committe (FGDC) format.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimFgdcFileWriter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimFgdcFileWriter_HEADER
+#define ossimFgdcFileWriter_HEADER
+
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/base/ossimXmlDocument.h>
+
+/**
+ * Class to write out meta data in a Federal Geographic Data
+ * Committe (FGDC) format.
+ */
+class OSSIMDLLEXPORT ossimFgdcFileWriter : public ossimMetadataFileWriter
+{
+public:
+   
+   /** constructor */
+   ossimFgdcFileWriter();
+
+   
+   /**
+    * Method to load the state from a keyword list.
+    *
+    * @param kwl Keyword list to load state from.
+    *
+    * @param prefix Prefix to attatch to keyword (like "object1.").
+    * default=NULL
+    *
+    * @return true if ok or false on error.
+    *
+    * Keywords picked up by this loadState:
+    * 
+    * source_image_filename: foo.ntf
+    * tab_string:            "\t"
+    * fgdc_template_doc:     fgdc_template.xml
+    * 
+    */
+   virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0);
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * Appends the writers image types to the "metadatatypeList".
+    * 
+    * @param metadatatypeList stl::vector<ossimString> list to append to.
+    *
+    * @note Appends to the list, does not clear it first.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList) const;
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * @param imageType string representing image type.
+    *
+    * @return true if "metadataType" is supported by writer.
+    */
+   virtual bool hasMetadataType(const ossimString& metadataType)const;
+
+   
+   /** @return Returns the current indentation level. */
+   ossim_uint32 getIndentionLevel() const;
+
+   /**
+    * Sets the current indentation level.
+    *
+    * @param level Indentation level.  "0" equals no indentation.
+    */
+   void setIndentionLevel(ossim_uint32 level);
+
+   /**
+    * @return The current tab string e.g.: "\t".
+    */
+   ossimString getTabString() const;
+
+   /**
+    * Sets the tab string.  Usually "\t" or spaces "  ".
+    *
+    * @param tabString  String to use for indentation.
+    */
+   void setTabString(const ossimString& tabString);
+
+   /**
+    * @param title Tile of data usually the image file name.
+    */
+   void setTitle(const ossimString& pubDate);
+
+   void setTemplate(const ossimFilename& xmlTemplateFile);
+
+   ossimString find(const ossimString& xpath) const;
+
+   bool writeTemplate(const ossimFilename& file) const;
+
+protected:
+   /** destructor */
+   virtual ~ossimFgdcFileWriter();
+
+   /**
+    * Writes file to disk.
+    *
+    * @return true on success, false on failure.
+    */
+   virtual bool writeFile();
+
+private:
+
+   /**
+    * Writes openning tag adding any indentation and brackets.  Increments
+    * indentation level.
+    *
+    * @param os otream to write to.
+    *
+    * @param tag String representing tag with no brackets, i.e. "metadata".
+    *
+    * @param newLine If true a new line "\n" is added.
+    */
+   void openTag(std::ostream& os,
+                const ossimString& tag,
+                bool newLine) const;
+
+   /**
+    * Closes tag decrementing indentation.
+    * e.g.: <metadata>
+    *
+    * @param os otream to write to.
+    *
+    * @param tag String representing tag with no brackets.
+    *
+    * @param decrementLevel If true indentation level is decremented.
+    */
+   void closeTag(std::ostream& os,
+                 const ossimString& tag,
+                 bool decrementLevel) const;
+   
+   mutable ossim_uint32 theIndentionLevel;
+   ossimString          theTabString;
+   ossimXmlDocument     theTemplate;
+   ossimFilename        theSourceImageFilename;
+
+TYPE_DATA
+};
+
+#endif /* End of "#ifndef ossimFgdcFileWriter_HEADER" */
diff --git a/ossim/include/ossim/imaging/ossimFilter.h b/include/ossim/imaging/ossimFilter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimFilter.h
rename to include/ossim/imaging/ossimFilter.h
diff --git a/include/ossim/imaging/ossimFilterResampler.h b/include/ossim/imaging/ossimFilterResampler.h
new file mode 100644
index 0000000..96a84fb
--- /dev/null
+++ b/include/ossim/imaging/ossimFilterResampler.h
@@ -0,0 +1,151 @@
+//*******************************************************************
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Contributor:
+//         David A. Horner (DAH) http://dave.thehorners.com
+//
+//*************************************************************************
+// $Id: ossimFilterResampler.h 23586 2015-10-19 10:45:22Z gpotts $
+#ifndef ossimFilterResampler_HEADER
+#define ossimFilterResampler_HEADER
+
+#include <vector>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimFilter.h>
+#include <ossim/imaging/ossimFilterTable.h>
+
+class OSSIMDLLEXPORT ossimFilterResampler
+{
+public:
+   enum ossimFilterResamplerType
+   {
+      ossimFilterResampler_NEAREST_NEIGHBOR = 0,
+      ossimFilterResampler_BOX              = 1,
+      ossimFilterResampler_GAUSSIAN         = 2,
+      ossimFilterResampler_CUBIC            = 3,
+      ossimFilterResampler_HANNING          = 4,
+      ossimFilterResampler_HAMMING          = 5,
+      ossimFilterResampler_LANCZOS          = 6,
+      ossimFilterResampler_MITCHELL         = 7,
+      ossimFilterResampler_CATROM           = 8,
+      ossimFilterResampler_BLACKMAN         = 9,
+      ossimFilterResampler_BLACKMAN_SINC    = 10,
+      ossimFilterResampler_BLACKMAN_BESSEL  = 11,
+      ossimFilterResampler_QUADRATIC        = 12,
+      ossimFilterResampler_TRIANGLE         = 13,
+      ossimFilterResampler_BILINEAR         = 13,
+      ossimFilterResampler_HERMITE          = 14,
+      ossimFilterResampler_BELL             = 15,
+      ossimFilterResampler_BSPLINE          = 16,
+      ossimFilterResampler_MAGIC            = 17
+      
+   };
+   ossimFilterResampler();
+   virtual ~ossimFilterResampler();
+
+  virtual void resample(const ossimRefPtr<ossimImageData>& input,
+			ossimRefPtr<ossimImageData>& output,
+			const ossimDpt& ul,
+			const ossimDpt& ur,
+			const ossimDpt& deltaUl,
+			const ossimDpt& deltaUr,
+			const ossimDpt& length);
+
+  virtual void resample(const ossimRefPtr<ossimImageData>& input,
+			ossimRefPtr<ossimImageData>& output,
+			const ossimIrect& outputSubRect,
+			const ossimDpt& ul,
+			const ossimDpt& ur,
+			const ossimDpt& deltaUl,
+			const ossimDpt& deltaUr,
+			const ossimDpt& length);
+
+  void setFilterType(ossimFilterResamplerType filterType);
+  void setFilterType(ossimFilterResamplerType minifyFilterType,
+		     ossimFilterResamplerType magnifyFilterType);
+  void setFilterType(const ossimString& type);
+  void setFilterType(const ossimString& minifyType,
+		     const ossimString& magnifyType);
+
+  void setMinifyFilterType(const ossimString& minifyType);
+  void setMagnifyFilterType(const ossimString& magnifyType);
+  void setMinifyFilterType(ossimFilterResamplerType filterType);
+  void setMagnifyFilterType(ossimFilterResamplerType filterType);
+  ossimString getMinifyFilterTypeAsString()const;
+  ossimString getMagnifyFilterTypeAsString()const;
+  void setScaleFactor(const ossimDpt& scale);
+  void setBlurFactor(ossim_float64 blur);
+
+  void setBoundingInputRect(const ossimIrect& rect)
+  {
+    theInputRect = rect;
+  }
+  ossimIrect getBoundingInputRect()const
+  {
+    return theInputRect;
+  }
+
+  ossim_float64 getBlurFactor()const;
+
+  const ossimDpt& getScaleFactor()const
+  {
+    return theScaleFactor;
+  }
+  /*!
+   * Saves the state of this object.
+   */
+  virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+  
+  /*!
+   * Loads the state of this object.
+   */
+  virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+  
+  virtual void getKernelSupport(double& x,
+				double & y)const;
+
+  virtual void getFilterTypes(std::vector<ossimString>& filterTypes)const;
+
+private:
+  const ossimFilter* getHorizontalFilter()const;
+  const ossimFilter* getVerticalFilter()const;
+
+  template <class T>
+  void resampleBilinearTile(T dummy,
+			    const ossimRefPtr<ossimImageData>& input,
+			    ossimRefPtr<ossimImageData>& output,
+			    const ossimIrect& outputSubRect,
+			    const ossimDpt& inputUl,
+			    const ossimDpt& inputUr,
+			    const ossimDpt& deltaUl,
+			    const ossimDpt& deltaUr,
+			    const ossimDpt& outLength);
+  
+   void computeTable();
+   ossimString getFilterTypeAsString(ossimFilterResamplerType type)const;
+   ossimFilterResamplerType getFilterType(const ossimString& type)const;
+   ossimFilter* createNewFilter(ossimFilterResamplerType filterType,
+                                ossimFilterResamplerType& result);
+
+
+   ossimFilter*             theMinifyFilter;
+   ossimFilter*             theMagnifyFilter;
+   ossimFilterTable         theFilterTable;
+   
+   ossimFilterResamplerType theMinifyFilterType;
+   ossimFilterResamplerType theMagnifyFilterType;
+   ossimDpt                 theScaleFactor;
+   ossimDpt                 theInverseScaleFactor;
+   
+   ossimIrect               theInputRect;
+   ossim_float64            theBlurFactor;
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimFilterTable.h b/include/ossim/imaging/ossimFilterTable.h
new file mode 100644
index 0000000..ecdad50
--- /dev/null
+++ b/include/ossim/imaging/ossimFilterTable.h
@@ -0,0 +1,97 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimFilterTable.h 23353 2015-06-01 19:19:10Z dburken $
+#ifndef ossimFilterTable_HEADER
+#define ossimFilterTable_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <cmath>
+
+class ossimFilter;
+
+class OSSIM_DLL ossimFilterTable
+{
+public:
+   /** default constructor */
+   ossimFilterTable();
+
+   /** destructor */
+   ~ossimFilterTable();
+
+   /** Builds a table with filter being used in both x and y direction. */
+   void buildTable(ossim_uint32  filterSteps,
+                   const ossimFilter& filter);
+
+   /** Builds a table. */
+   void buildTable(ossim_uint32  filterSteps,
+                   const ossimFilter& xFilter,
+                   const ossimFilter& yFilter);
+
+   /** @return theWidth*theHeight */
+   ossim_uint32 getWidthByHeight() const;
+
+   /** @return theXSupport */
+   ossim_uint32 getXSupport()      const;
+
+   /** @return theYSupport */
+   ossim_uint32 getYSupport()      const;
+
+   /** @return theWidth */
+   ossim_uint32 getWidth()         const;
+
+   /** @return theHeight */
+   ossim_uint32 getHeight()        const;
+
+   /**
+    * Inlined below.
+    *
+    * @return const double* to the closest weight of x and y.
+    */
+   const double* getClosestWeights(const double& x, const double& y)const;
+
+protected:
+
+   /**
+    * Creates the weight array "theWeights".  Will delete if previously
+    * allocated.
+    */
+   void allocateWeights();
+
+   double*      theWeights;
+   ossim_uint32 theWidth;
+   ossim_uint32 theHeight;
+   ossim_uint32 theWidthHeight;
+   ossim_uint32 theXSupport;
+   ossim_uint32 theYSupport;
+   ossim_uint32 theFilterSteps;
+};
+
+/**
+ * Method inlined for speed as it is used in the inner pixel loop of
+ * ossimFilterResampler::resampleBilinearTile method.
+ */
+inline const double* ossimFilterTable::getClosestWeights(const double& x,
+                                                         const double& y)const
+{
+   // Extract the decimal part of x and y.
+   double intPartDummy;
+   double decimalPrecisionX = fabs(modf(x, &intPartDummy));
+   double decimalPrecisionY = fabs(modf(y, &intPartDummy));
+   
+   ossim_int32 kernelLine =
+      (ossim_int32)(theFilterSteps*decimalPrecisionY);
+   ossim_int32 kernelSamp =
+      (ossim_int32)(theFilterSteps*decimalPrecisionX);
+  
+  return &theWeights[(kernelLine*theFilterSteps +
+                      kernelSamp)*theWidthHeight];
+}
+
+#endif /* End of "#ifndef ossimFilterTable_HEADER" */
diff --git a/include/ossim/imaging/ossimFixedTileCache.h b/include/ossim/imaging/ossimFixedTileCache.h
new file mode 100644
index 0000000..2560719
--- /dev/null
+++ b/include/ossim/imaging/ossimFixedTileCache.h
@@ -0,0 +1,146 @@
+//******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: This file contains the Application cache algorithm
+//
+//***********************************
+// $Id: ossimFixedTileCache.h 16276 2010-01-06 01:54:47Z gpotts $
+#ifndef ossimFixedTileCache_HEADER
+#define ossimFixedTileCache_HEADER
+#include <map>
+#include <list>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <OpenThreads/Mutex>
+
+class  ossimFixedTileCacheInfo
+{
+public:
+   ossimFixedTileCacheInfo(ossimRefPtr<ossimImageData>& tile,
+                           ossim_int32 tileId=-1)
+      :theTile(tile),
+      theTileId(tileId)
+      {
+      }
+   
+   bool operator <(const ossimFixedTileCacheInfo& rhs)const
+      {
+         return (theTileId < rhs.theTileId);
+      }
+   bool operator <(ossim_int32 tileId)const
+      {
+         return (theTileId < tileId);
+      }
+   bool operator >(const ossimFixedTileCacheInfo& rhs)const
+      {
+         return (theTileId > rhs.theTileId);
+      }
+   bool operator >(ossim_int32 tileId)const
+      {
+         return (theTileId > tileId);
+      }
+   bool operator ==(const ossimFixedTileCacheInfo& rhs)const
+      {
+         return (theTileId == rhs.theTileId);
+      }
+   bool operator ==(ossim_int32 tileId)const
+      {
+         return (theTileId == tileId);
+      }
+   
+   ossimRefPtr<ossimImageData> theTile;
+   ossim_int32 theTileId;
+};
+
+class ossimFixedTileCache : public ossimReferenced
+{
+public:
+   ossimFixedTileCache();
+   virtual void setRect(const ossimIrect& rect);
+   virtual void setRect(const ossimIrect& rect,
+                        const ossimIpt& tileSize);
+   void keepTilesWithinRect(const ossimIrect& rect);
+   virtual ossimRefPtr<ossimImageData> addTile(ossimRefPtr<ossimImageData> imageData,
+                                               bool duplicateData=true);
+   virtual ossimRefPtr<ossimImageData> getTile(ossim_int32 id);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIpt& origin)
+      {
+         return getTile(computeId(origin));
+      }
+   virtual void setUseLruFlag(bool flag)
+      {
+         theUseLruFlag = flag;
+      }
+   virtual bool getUseLruFlag()const
+      {
+         return theUseLruFlag;
+      }
+   virtual void flush();
+   virtual void deleteTile(const ossimIpt& origin)
+      {
+         deleteTile(computeId(origin));
+      }
+   virtual void deleteTile(ossim_int32 tileId);
+   virtual ossimRefPtr<ossimImageData> removeTile(const ossimIpt& origin)
+      {
+         return removeTile(computeId(origin));
+      }
+   virtual ossimRefPtr<ossimImageData> removeTile(ossim_int32 tileId);
+   virtual const ossimIrect& getTileBoundaryRect()const
+      {
+         return theTileBoundaryRect;
+      }
+   virtual ossim_uint32 getNumberOfTiles()const
+      {
+         return (ossim_uint32)theTileMap.size();
+      }
+   virtual const ossimIpt& getTileSize()const
+      {
+         return theTileSize;
+      }
+   virtual ossim_uint32 getCacheSize()const
+      {
+         return theCacheSize;
+      }
+   virtual void deleteTile();
+   virtual ossimRefPtr<ossimImageData> removeTile();
+   
+   virtual void setMaxCacheSize(ossim_uint32 cacheSize)
+      {
+         theMaxCacheSize = cacheSize;
+      }
+
+   ossim_uint32 getMaxCacheSize()const
+      {
+         return theMaxCacheSize;
+      }
+   
+   virtual ossimIpt getTileOrigin(ossim_int32 tileId);
+   virtual ossim_int32 computeId(const ossimIpt& tileOrigin)const;
+   virtual void setTileSize(const ossimIpt& tileSize);
+protected:
+   virtual ~ossimFixedTileCache();
+   OpenThreads::Mutex theMutex;
+   ossimIrect   theTileBoundaryRect;
+   ossimIpt     theTileSize;
+   ossimIpt     theBoundaryWidthHeight;
+   ossim_uint32 theTilesHorizontal;
+   ossim_uint32 theTilesVertical;
+   ossim_uint32 theCacheSize;
+   ossim_uint32 theMaxCacheSize;
+   std::map<ossim_int32, ossimFixedTileCacheInfo> theTileMap;
+   std::list<ossim_int32> theLruQueue;
+   bool                   theUseLruFlag;
+   virtual void eraseFromLru(ossim_int32 id);
+   void adjustLru(ossim_int32 id);
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimFusionCombiner.h b/include/ossim/imaging/ossimFusionCombiner.h
new file mode 100644
index 0000000..d08aff4
--- /dev/null
+++ b/include/ossim/imaging/ossimFusionCombiner.h
@@ -0,0 +1,47 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Implementation for Base fusion.
+//              This base class assumes two inputs where the second input is
+//              the intensity source.
+//
+//*************************************************************************
+// $Id: ossimFusionCombiner.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimFusionCombiner_HEADER
+#define ossimFusionCombiner_HEADER
+
+#include <ossim/imaging/ossimImageCombiner.h>
+
+class OSSIMDLLEXPORT ossimFusionCombiner : public ossimImageCombiner
+{
+public:
+  ossimFusionCombiner();
+  ossimFusionCombiner(ossimObject* owner);
+  virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
+  bool canConnectMyInputTo(ossim_int32 inputIndex,
+			   const ossimConnectableObject* object)const;
+   ossimScalarType getOutputScalarType() const;
+   
+  virtual void initialize();
+protected:
+   virtual ~ossimFusionCombiner();   
+  ossimRefPtr<ossimImageData> theTile;
+  ossimRefPtr<ossimImageData> theNormTile;
+  ossimRefPtr<ossimImageData> theNormIntensity;
+  ossimImageSource*  theInputConnection;
+  ossimImageSource*  theIntensityConnection;
+  
+  ossimRefPtr<ossimImageData> getNormIntensity(const ossimIrect& rect,
+                                               ossim_uint32 resLevel);
+  ossimRefPtr<ossimImageData> getNormTile(const ossimIrect& rect,
+                                          ossim_uint32 resLevel);
+TYPE_DATA  
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimGammaRemapper.h b/include/ossim/imaging/ossimGammaRemapper.h
new file mode 100644
index 0000000..95b6a96
--- /dev/null
+++ b/include/ossim/imaging/ossimGammaRemapper.h
@@ -0,0 +1,71 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kathy Minear
+//
+// Description:
+//
+// Gamma remapper.
+//
+//*************************************************************************
+// $Id: ossimGammaRemapper.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimGammaRemapper_HEADER
+#define ossimGammaRemapper_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimGammaRemapper : public ossimImageSourceFilter
+{
+public:
+
+   ossimGammaRemapper(ossimObject* owner=NULL);
+   ossimGammaRemapper(ossimImageSource* inputSource);
+   ossimGammaRemapper(ossimObject* owner, ossimImageSource* inputSource);
+
+
+   virtual ossimString getShortName()const;
+
+   virtual void initialize();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                   ossim_uint32 resLevel=0);
+   
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   virtual ostream& print(ostream& os) const;
+   friend ostream& operator<< (ostream& os,  const ossimGammaRemapper& hr);
+
+   void setMinMaxPixelValues(const vector<double>& v_min,
+                             const vector<double>& v_max);
+
+   virtual void enableSource();
+   
+protected:
+   virtual ~ossimGammaRemapper();
+
+   /*!
+    * Method to set unset the enable flag.
+    */
+
+   void verifyEnabled();
+
+   ossimRefPtr<ossimImageData> theTile;
+   double*         theBuffer;
+   vector<double>  theMinPixelValue;
+   vector<double>  theMaxPixelValue;
+   vector<double>  theGamma;
+   bool            theUserDisabledFlag;
+
+   TYPE_DATA
+};
+
+#endif /* #ifndef ossimGammaRemapper_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimGdFont.h b/include/ossim/imaging/ossimGdFont.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGdFont.h
rename to include/ossim/imaging/ossimGdFont.h
diff --git a/ossim/include/ossim/imaging/ossimGdFontExterns.h b/include/ossim/imaging/ossimGdFontExterns.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGdFontExterns.h
rename to include/ossim/imaging/ossimGdFontExterns.h
diff --git a/include/ossim/imaging/ossimGeneralRasterInfo.h b/include/ossim/imaging/ossimGeneralRasterInfo.h
new file mode 100644
index 0000000..6bec188
--- /dev/null
+++ b/include/ossim/imaging/ossimGeneralRasterInfo.h
@@ -0,0 +1,431 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for ossimGeneralRasterInfo
+//*******************************************************************
+//  $Id: ossimGeneralRasterInfo.h 22197 2013-03-12 02:00:55Z dburken $
+
+#ifndef ossimGeneralRasterInfo_HEADER
+#define ossimGeneralRasterInfo_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageMetaData.h>
+#include <vector>
+
+//---
+// Forward class declarations.
+//---
+class ossimEnviHeader;
+class ossimKeywordlist;
+
+/**
+ * @class ossimGeneralRasterInfo
+ *
+ */
+class OSSIMDLLEXPORT ossimGeneralRasterInfo : public ossimObject
+{
+public:
+
+   enum ossimFillMode
+   {
+      NONE,
+      ZEROES_TO_MIN,
+      ZEROES_TO_NULL_EDGES_ONLY
+   };
+
+   enum
+   {
+      UNKNOWN = -1
+   };
+
+   /* @brief default constructor */
+   ossimGeneralRasterInfo();
+   
+   ossimGeneralRasterInfo(const std::vector<ossimFilename>& imageFileList,
+                          ossimScalarType      pixelType,
+                          ossimInterleaveType  il_type,
+                          ossim_int32          numberOfBands,
+                          ossim_int32          lines,
+                          ossim_int32          samples,
+                          ossim_int32          headerSize,
+                          ossimFillMode        nullsMode,
+                          ossim_int32          pixelsToChop);
+   
+   ossimGeneralRasterInfo(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /* @brief copy constructor */
+   ossimGeneralRasterInfo( const ossimGeneralRasterInfo& obj );
+
+   /** @brief Assignment operator=. */
+   const ossimGeneralRasterInfo& operator=( const ossimGeneralRasterInfo& rhs );
+   
+   virtual ~ossimGeneralRasterInfo ();
+
+   /**
+    *  Zero based rectangle of the valid image.
+    */
+   const ossimIrect& imageRect() const;
+
+   /**
+    *  Returns the rectangle of where the image is within the raster file.
+    *  In most cases this will be the same as the rawImageRect. (zero based)
+    */
+   const ossimIrect& validImageRect() const;
+
+   /**
+    *  Zero based rectangle of the raw image.
+    */
+   const ossimIrect& rawImageRect() const;
+
+   /**
+    * Returns the offset of this image's origin to a full-image's origin, in
+    * the case where this image is a sub-image of a larger full-image.
+    */
+   const ossimIpt& subImageOffset() const;
+
+   /**
+    *  Returns the size of header in bytes.
+    */
+   ossim_int32 headerSize() const;
+
+   /**
+    *  Returns the fill mode.  This is used to flip values on ingest.
+    *  Valid Mode Enumerations:
+    *  - 0  Do nothing to the pixels on ingest.
+    *  - 1  Flip all zeroes to the minimum pixel value.
+    *  - 2  Flip zeroes within the image line to minimum pixel value.
+    *       This is used by edge walking code.
+    */
+   ossim_uint32 fillToNullsMode() const;
+
+   /**
+    *  Sets theSetNullsMode.
+    */
+   void setFillToNullsMode(ossim_uint32 mode);
+
+   /**
+    * @brief Number of bands. Inlined below.
+    * @return Number of bands from theMetaData class member cast to an int32.
+    */
+   inline ossim_int32 numberOfBands() const;
+   
+   /**
+    * @brief Bytes per pixel.  Inlined below.
+    * @return Bytes per pixel from theMetaData class member cast to an int32.
+    */   
+   inline ossim_int32 bytesPerPixel() const;
+   
+   /**
+    *  Returns the number of pixels from the edge of a line
+    *  to set to the fill value.  This can be used to eliminate
+    *  resampling error on the edge of an image and still keep
+    *  the image demensions relative to the geometry file.
+    */
+   ossim_int32 pixelsToChop() const;
+   
+   /**
+    *  Enumerated in InterleaveTypeLUT. Should be either bip,
+    *  bil or bsq.  Defaulted to bip.
+    */
+   ossimInterleaveType interleaveType() const;
+
+   /**
+    *  Returns the number of lines within "theValidImageRect".
+    */
+   inline ossim_int32 validLines() const;
+
+   /**
+    *  Returns the number of lines within "theRawImageRect".
+    */
+   inline ossim_int32 rawLines() const;
+
+   /**
+    *  Returns the number of bytes in a raw line.
+    */
+   inline ossim_int32 bytesPerRawLine() const;
+
+   /**
+    *  Returns the number of bytes in a valid line.
+    */
+   inline ossim_int32 bytesPerValidLine() const;
+
+   /**
+    *  Returns the number of samples within "theValidImageRect".
+    */
+   inline ossim_int32 validSamples() const;
+
+   /**
+    *  Returns the number of samples within "theRawImageRect".
+    */
+   inline ossim_int32 rawSamples() const;
+
+   /**
+    *  Returns the offset in bytes to the first valid sample in the image.
+    */
+   inline std::streamoff offsetToFirstValidSample() const;
+   
+   const std::vector<ossimFilename>& getImageFileList() const;
+
+   void setImageFileList(const std::vector<ossimFilename>& list);
+
+   /**
+    * @brief Sets the image file list to file.  Performs a clear, prior to
+    * setting.
+    * @param file Image file.
+    */
+   void setImageFile(const ossimFilename& file);
+
+   void setHeaderSize(ossim_int32 headerSize);
+   
+   void setInterleaveType(ossimInterleaveType il_type);
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+   void setImageRect(const ossimIrect& imageRect);
+   
+   void setValidImageRect(const ossimIrect &imageRect);
+
+   void setRawImageRect(const ossimIrect &imageRect);
+
+   void setSubImageOffset(const ossimIpt& d);
+
+   ossimByteOrder getImageDataByteOrder() const;
+
+   void setImageDataByteOrder(ossimByteOrder byteOrder);
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * @brief Takes image file and attempts to derive/find header file to
+    * parse for general raster data, i.e. lines, samples, bands and so on.
+    * @param image file.
+    * @return true on success, false on error.
+    */
+   bool open( const ossimFilename& imageFile );
+
+   /** @return Const reference to theMetaData class member. */
+   inline const ossimImageMetaData& getImageMetaData() const;
+
+   /** @return Reference to theMetaData class member. */
+   inline ossimImageMetaData& getImageMetaData();
+
+   /**
+    * @brief Initialize from envi header file.
+    * @param enviHeader
+    * @return true on success, false on error.
+    */  
+   bool initializeFromEnviHdr( const ossimEnviHeader& enviHdr );
+
+private:
+
+   /**
+    * @brief Initialize from header file.
+    * @param headerFile
+    * @return true on success, false on error.
+    */
+   bool initializeFromHdr( const ossimFilename& imageFile,
+                           const ossimFilename& headerFile );
+
+   /**
+    * @brief Initialize from envi header file.
+    * @param headerFile
+    * @return true on success, false on error.
+    */  
+   bool initializeFromEnviHdr( const ossimFilename& headerFile );
+
+   /**
+    * @brief Initialize from omd file.
+    * @param file
+    * @return true on success, false on error.
+    */  
+   bool initializeFromXml( const ossimFilename& imageFile,
+                           const ossimFilename& headerFile );
+
+   /**
+    * @brief Private method to get bits per pixel from file size,
+    * lines, samples and bands.  Method created to avoid duplicate code
+    * in "initizeFrom" methods.
+    *
+    * This assumes that "theRawImageRect" and "theNumberOfBands" has been
+    * set.
+    *
+    * @param imageFile This image file.
+    * @param Calculated bits per pixel.
+    * @return bits per pixel or 0 on error.
+    */
+   ossim_int32 getBitsPerPixel( const ossimFilename& imageFile ) const;
+
+   /** @brief Clears data members. */
+   void clear();
+   
+   ossimImageMetaData          theMetaData;
+   std::vector<ossimFilename>  theImageFileList;
+   ossimInterleaveType         theInterleaveType;
+
+   /**
+    *  The zero based rectangle of the entire image not including any header.
+    */
+   ossimIrect theRawImageRect;
+
+   /**
+    *  The rectangle representing where the valid part of the image lies
+    *  within "theRawImageRect".
+    */
+   ossimIrect theValidImageRect;
+
+   /**
+    *  The valid image rectangle normalized to be zero based.
+    */
+   ossimIrect theImageRect;
+
+   /**
+    *  The offset from the full-image origin to this image's origin
+    */
+   ossimIpt theSubImageOffset;
+
+   /**
+    *  Size of header in bytes.
+    */
+   ossim_int32 theHeaderSize;
+
+   /**
+    *  Mode of how to handle pixels on import.
+    *   0 = Do nothing the pixels.
+    *   1 = Set any zeroes to min value of radiometry.
+    *   2 = Set zeroes on line edges only to nulls; any other zeroes are
+    *       set to min value of radiometry.
+    */
+   ossimFillMode theSetNullsMode;
+
+   /**
+    *  Amount of pixels to chop for each line edge.
+    */
+   ossim_int32 thePixelsToChop;
+
+   /**
+    *  The byte order the image data is stored in.
+    */
+  ossimByteOrder theImageDataByteOrder;
+};
+
+
+//---
+// Inlines:
+// 
+// These methods are used throughout raster read/write code; hence, inlines.
+// Note that most of these are used in calculating std::streamoff which is
+// a signed 64 bit integer on most machines; hence, the cast to an int from
+// an unsigned int for convenience.
+//---
+inline const ossimImageMetaData& ossimGeneralRasterInfo::getImageMetaData() const
+{
+   return theMetaData;
+}
+
+inline ossimImageMetaData& ossimGeneralRasterInfo::getImageMetaData()
+{
+   return theMetaData;
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::numberOfBands() const
+{
+   return static_cast<ossim_int32>( theMetaData.getNumberOfBands() );
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::bytesPerPixel() const
+{
+   return static_cast<ossim_int32>( theMetaData.getBytesPerPixel() );
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::validLines() const
+{
+   return static_cast<ossim_int32>(theValidImageRect.height());
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::rawLines() const
+{
+   return static_cast<ossim_int32>(theRawImageRect.height());
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::bytesPerRawLine() const
+{
+   if (interleaveType() == OSSIM_BIP)
+   {
+      return rawSamples() * bytesPerPixel() * numberOfBands();
+   }
+   else
+   {
+      return rawSamples() * bytesPerPixel();
+   }
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::bytesPerValidLine() const
+{
+   if (interleaveType() == OSSIM_BIP)
+   {
+      return validSamples() * bytesPerPixel() * numberOfBands();
+   }
+   else
+   {
+      return validSamples() * bytesPerPixel();
+   }
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::validSamples() const
+{
+   return static_cast<ossim_int32>(theValidImageRect.width());
+}
+
+inline ossim_int32 ossimGeneralRasterInfo::rawSamples() const
+{
+   return static_cast<ossim_int32>(theRawImageRect.width());
+}
+
+inline std::streamoff ossimGeneralRasterInfo::offsetToFirstValidSample() const
+{
+   if (interleaveType() == OSSIM_BIP)
+   {
+      return headerSize() +
+         ( bytesPerRawLine() * validImageRect().ul().y ) +
+         ( validImageRect().ul().x * numberOfBands() * bytesPerPixel() );
+   }
+   else if (interleaveType() == OSSIM_BIL)
+   {
+      return headerSize() +
+         ( bytesPerRawLine() * validImageRect().ul().y * numberOfBands() ) +
+         ( validImageRect().ul().x * bytesPerPixel() );
+   }
+   else // BSQ
+   {
+      return headerSize() +
+         ( bytesPerRawLine() * validImageRect().ul().y ) +
+         ( validImageRect().ul().x * bytesPerPixel() );
+   }
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimGeneralRasterTileSource.h b/include/ossim/imaging/ossimGeneralRasterTileSource.h
new file mode 100644
index 0000000..9fab0b5
--- /dev/null
+++ b/include/ossim/imaging/ossimGeneralRasterTileSource.h
@@ -0,0 +1,212 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for ossimGeneralRasterTileSource.
+// ossimGeneralRasterTileSource is derived from ImageHandler which is
+// derived from ossimTileSource.
+//*******************************************************************
+//  $Id: ossimGeneralRasterTileSource.h 21631 2012-09-06 18:10:55Z dburken $
+
+#ifndef ossimGeneralRasterTileSource_HEADER
+#define ossimGeneralRasterTileSource_HEADER 1
+
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/imaging/ossimGeneralRasterInfo.h>
+#include <memory>
+#include <vector>
+
+class  ossimImageData;
+
+class OSSIM_DLL ossimGeneralRasterTileSource : public ossimImageHandler
+{
+public:
+
+   ossimGeneralRasterTileSource();
+
+   virtual ossimString getShortName()const;
+   virtual ossimString getLongName()const;
+   
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper
+    *  left corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);   
+   
+   /**
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+   /**
+    * Returns the number of bands in a tile returned from this TileSource.
+    * Note: we are supporting sources that can have multiple data objects.
+    * If you want to know the scalar type of an object you can pass in the 
+    */
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+   
+   /**
+    *  Returns the number of lines in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    *  Returns the number of samples in the image.  
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32    getTileWidth() const;
+   
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32    getTileHeight() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    * Note:  This handler will always return 0 for this method.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    * Note:  This handler will always return 0 for this method.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;   
+   
+   bool isValidRLevel(ossim_uint32 reduced_res_level) const;
+   
+   virtual void close();
+   virtual bool isOpen() const;
+   virtual bool open();
+   virtual bool open(const ossimGeneralRasterInfo& info);
+   
+   /**
+    * Override base getXXXXPixValue methods since the null/min/max can be set
+    * to something different.  Currently returns the same value for all bands.
+    */
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /**
+    * @brief Indicates whether or not the image handler can control output
+    * band selection via the setOutputBandList method.
+    *
+    * Overrides: ossimImageHandler::isBandSelector
+    *
+    * @return true
+    */
+   virtual bool isBandSelector() const;
+
+   /**
+    * @brief If the image handler "isBandSeletor()" then the band selection
+    * of the output chip can be controlled.
+    *
+    * Overrides: ossimImageHandler::setOutputBandList
+    * 
+    * @return true on success, false on error.
+    */
+   virtual bool setOutputBandList(const std::vector<ossim_uint32>& band_list);
+
+   /** @brief Initializes bandList to the zero based order of output bands. */
+   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
+
+protected:
+   virtual ~ossimGeneralRasterTileSource();
+   /**
+    *  Methods return true on succes false on error.
+    */
+   virtual bool fillBuffer(const ossimIpt& origin, const ossimIpt& size);
+   virtual bool fillBIP(const ossimIpt& origin, const ossimIpt& size);
+   virtual bool fillBIL(const ossimIpt& origin, const ossimIpt& size);
+   virtual bool fillBSQ(const ossimIpt& origin, const ossimIpt& size);
+   virtual bool fillBsqMultiFile(const ossimIpt& origin, const ossimIpt& size);
+
+   virtual ossimKeywordlist getHdrInfo(ossimFilename hdrFile);
+   virtual ossimKeywordlist getXmlInfo(ossimFilename xmlFile);
+
+   bool initializeHandler();
+   
+   ossimRefPtr<ossimImageData>              m_tile;
+   ossim_uint8*                             m_buffer;
+   ossim_uint8*                             m_lineBuffer;
+   ossimInterleaveType                      m_bufferInterleave;
+   std::vector< std::shared_ptr<ossim::ifstream> > m_fileStrList;
+   // std::vector< std::ifstream* >            m_fileStrList;   
+   ossimGeneralRasterInfo                   m_rasterInfo;
+   ossimIrect                               m_bufferRect;
+   bool                                     m_swapBytesFlag;
+   ossim_uint32                             m_bufferSizeInPixels;
+   std::vector<ossim_uint32>                m_outputBandList;
+
+private:
+   
+   /** @brief Allocates m_tile. */
+   void allocateTile();
+
+   /** @brief Allocates m_buffer */
+   void allocateBuffer( const ossimImageData* tile );
+   
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimGeneralRasterTileSource_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimGeneralRasterWriter.h b/include/ossim/imaging/ossimGeneralRasterWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeneralRasterWriter.h
rename to include/ossim/imaging/ossimGeneralRasterWriter.h
diff --git a/include/ossim/imaging/ossimGeoAnnotationBitmap.h b/include/ossim/imaging/ossimGeoAnnotationBitmap.h
new file mode 100644
index 0000000..f32820e
--- /dev/null
+++ b/include/ossim/imaging/ossimGeoAnnotationBitmap.h
@@ -0,0 +1,54 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimGeoAnnotationBitmap.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimGeoAnnotationBitmap_HEADER
+#define ossimGeoAnnotationBitmap_HEADER
+#include <ossim/imaging/ossimGeoAnnotationObject.h>
+
+class OSSIMDLLEXPORT ossimGeoAnnotationBitmap: public ossimGeoAnnotationObject
+{
+public:
+
+   ossimGeoAnnotationBitmap(const ossimGpt& center= ossimGpt(0,0,0),
+                            ossimRefPtr<ossimImageData> imageData=0,
+                            unsigned char r = 255,
+                            unsigned char g = 255,
+                            unsigned char b = 255);
+   
+   ossimGeoAnnotationBitmap(const ossimGeoAnnotationBitmap& rhs);
+   
+   virtual ossimObject* dup()const;
+
+   virtual bool intersects(const ossimDrect& rect) const;
+
+   virtual ossimGeoAnnotationBitmap* getNewClippedObject(const ossimDrect& rect)const;
+
+   virtual void applyScale(double x, double y);
+
+   virtual std::ostream& print(std::ostream& out)const;
+   virtual void draw(ossimRgbImage& anImage)const;
+   virtual void getBoundingRect(ossimDrect& rect)const;
+   virtual void transform(ossimImageGeometry* projection);
+
+   virtual void setImageData(ossimRefPtr<ossimImageData>& imageData);
+   virtual void computeBoundingRect();
+
+protected:
+   virtual ~ossimGeoAnnotationBitmap();
+   
+   ossimGpt                    theCenterPoint;
+   ossimDpt                    theProjectedPoint;
+   ossimRefPtr<ossimImageData> theImageData;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationEllipseObject.h b/include/ossim/imaging/ossimGeoAnnotationEllipseObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationEllipseObject.h
rename to include/ossim/imaging/ossimGeoAnnotationEllipseObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationFontObject.h b/include/ossim/imaging/ossimGeoAnnotationFontObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationFontObject.h
rename to include/ossim/imaging/ossimGeoAnnotationFontObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationGdBitmapFont.h b/include/ossim/imaging/ossimGeoAnnotationGdBitmapFont.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationGdBitmapFont.h
rename to include/ossim/imaging/ossimGeoAnnotationGdBitmapFont.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationLineObject.h b/include/ossim/imaging/ossimGeoAnnotationLineObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationLineObject.h
rename to include/ossim/imaging/ossimGeoAnnotationLineObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationMultiEllipseObject.h b/include/ossim/imaging/ossimGeoAnnotationMultiEllipseObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationMultiEllipseObject.h
rename to include/ossim/imaging/ossimGeoAnnotationMultiEllipseObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationMultiPolyLineObject.h b/include/ossim/imaging/ossimGeoAnnotationMultiPolyLineObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationMultiPolyLineObject.h
rename to include/ossim/imaging/ossimGeoAnnotationMultiPolyLineObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationMultiPolyObject.h b/include/ossim/imaging/ossimGeoAnnotationMultiPolyObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationMultiPolyObject.h
rename to include/ossim/imaging/ossimGeoAnnotationMultiPolyObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationObject.h b/include/ossim/imaging/ossimGeoAnnotationObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationObject.h
rename to include/ossim/imaging/ossimGeoAnnotationObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationPolyLineObject.h b/include/ossim/imaging/ossimGeoAnnotationPolyLineObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationPolyLineObject.h
rename to include/ossim/imaging/ossimGeoAnnotationPolyLineObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationPolyObject.h b/include/ossim/imaging/ossimGeoAnnotationPolyObject.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationPolyObject.h
rename to include/ossim/imaging/ossimGeoAnnotationPolyObject.h
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationSource.h b/include/ossim/imaging/ossimGeoAnnotationSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoAnnotationSource.h
rename to include/ossim/imaging/ossimGeoAnnotationSource.h
diff --git a/ossim/include/ossim/imaging/ossimGeoPolyCutter.h b/include/ossim/imaging/ossimGeoPolyCutter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeoPolyCutter.h
rename to include/ossim/imaging/ossimGeoPolyCutter.h
diff --git a/ossim/include/ossim/imaging/ossimGeographicAnnotationGrid.h b/include/ossim/imaging/ossimGeographicAnnotationGrid.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGeographicAnnotationGrid.h
rename to include/ossim/imaging/ossimGeographicAnnotationGrid.h
diff --git a/include/ossim/imaging/ossimGeomFileWriter.h b/include/ossim/imaging/ossimGeomFileWriter.h
new file mode 100644
index 0000000..3b273e5
--- /dev/null
+++ b/include/ossim/imaging/ossimGeomFileWriter.h
@@ -0,0 +1,57 @@
+//*******************************************************************
+// Copyright (C) 2003 Storage Area Networks, Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kenneth Melero (kmelero at sanz.com)
+//
+//*******************************************************************
+//  $Id: ossimGeomFileWriter.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimGeomFileWriter_H
+#define ossimGeomFileWriter_H
+
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+
+/** ossimGeomFileWriter */
+class OSSIMDLLEXPORT ossimGeomFileWriter : public ossimMetadataFileWriter
+{
+public:
+   /** default constructor */
+   ossimGeomFileWriter();
+
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * Appends the writers image types to the "metadatatypeList".
+    * 
+    * @param metadatatypeList stl::vector<ossimString> list to append to.
+    *
+    * @note Appends to the list, does not clear it first.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList) const;
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * @param imageType string representing image type.
+    *
+    * @return true if "metadataType" is supported by writer.
+    */
+   virtual bool hasMetadataType(const ossimString& metadataType)const;
+
+protected:
+   /** virtual destructor */
+   virtual ~ossimGeomFileWriter();
+
+   /** Write a geometry file to "theFilename". */
+   virtual bool writeFile();
+   
+TYPE_DATA
+};
+
+#endif /* End of #ifndef ossimGeomFileWriter_H */
diff --git a/include/ossim/imaging/ossimGpkgWriterInterface.h b/include/ossim/imaging/ossimGpkgWriterInterface.h
new file mode 100644
index 0000000..ebf4a83
--- /dev/null
+++ b/include/ossim/imaging/ossimGpkgWriterInterface.h
@@ -0,0 +1,79 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Interface for GeoPackage(gpkg) writers.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimGpkgWriterInterface_HEADER
+#define ossimGpkgWriterInterface_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimImageData;
+class ossimKeywordlist;
+
+/**
+ * @class GeoPackage writer interface.
+ *
+ * This interface is for using the ossimGeopackageWriter in a connectionless
+ * manner.  See ossim-gpkg-writer-test.cpp for example usage.
+ */
+class OSSIM_DLL ossimGpkgWriterInterface
+{
+public:
+
+   /**
+    * GP:  I had to add this or windows would not link with the latest
+    * compiler. Also had to put in dot.cpp for debug mode(again windows).
+    * (drb)
+    */
+   ossimGpkgWriterInterface();
+
+   /**
+    * @brief Opens file for writing, appending, merging without an input
+    * connection. I.e. opening, then calling writeTile directly.
+    * 
+    * @param options.  Keyword list containing all options.
+    */
+   virtual bool openFile( const ossimKeywordlist& options ) = 0;
+
+   /**
+    * @brief Calls initial sqlite3_prepare_v2 statement.  Must be called
+    * prior to calling writeTile.
+    * @return SQLITE_OK(0) on success, something other(non-zero) on failure.
+    */
+   virtual ossim_int32 beginTileProcessing() = 0;
+   
+   /**
+    * @brief Direct interface to writing a tile to database.
+    * @param tile to write.
+    * @param zoolLevel
+    * @param row
+    * @param col
+    * @return true on success, false on error.
+    */   
+   virtual bool writeTile( ossimRefPtr<ossimImageData>& tile,
+                           ossim_int32 zoomLevel,
+                           ossim_int64 row,
+                           ossim_int64 col ) = 0;
+   virtual bool writeCodecTile( ossim_uint8* codecTile,
+                                ossim_int32 codecTileSize,
+                                ossim_int32 zoomLevel,
+                                ossim_int64 row,
+                                ossim_int64 col ) = 0;
+
+   /**
+    * @brief Calls sqlite3_finalize(pStmt) terminating tile processing.
+    */
+   virtual void finalizeTileProcessing() = 0;
+   
+};
+
+#endif /* End of "#ifndef ossimGpkgWriterInterface_HEADER" */
diff --git a/include/ossim/imaging/ossimGridRemapEngine.h b/include/ossim/imaging/ossimGridRemapEngine.h
new file mode 100644
index 0000000..a2d26c7
--- /dev/null
+++ b/include/ossim/imaging/ossimGridRemapEngine.h
@@ -0,0 +1,70 @@
+//*****************************************************************************
+// FILE: ossimGridRemapEngine.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class 
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimGridRemapEngine.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimGridRemapEngine_HEADER
+#define ossimGridRemapEngine_HEADER
+
+#include <vector>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimDpt;
+class ossimGridRemapSource;
+class ossimImageData;
+class ossimAtbPointSource;
+
+/*!****************************************************************************
+ *
+ * CLASS: ossimGridRemapEngine 
+ *
+ *****************************************************************************/
+class ossimGridRemapEngine : public ossimObject
+{
+public:
+   virtual ossimObject* dup() const = 0;
+   
+   virtual void remapTile(const ossimDpt&       origin_point,
+                          ossimGridRemapSource* remapper,
+                          ossimRefPtr<ossimImageData>& tile) = 0;
+
+   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources)=0;
+
+   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
+                                   void* result) = 0;
+
+   int  getNumberOfParams() const { return theNumberOfParams; }
+   
+   int  getNumberOfBands()  const { return theNumberOfBands; }
+   
+protected:
+   ossimGridRemapEngine(int numParams, int numBands)
+      : theNumberOfParams(numParams), theNumberOfBands(numBands) {}
+
+   ossimGridRemapEngine() {}
+   virtual ~ossimGridRemapEngine() {}
+
+   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
+                                 void*                 source_value,
+                                 void*                 target_value) = 0;
+   int  theNumberOfParams;
+   int  theNumberOfBands;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimGridRemapEngineFactory.h b/include/ossim/imaging/ossimGridRemapEngineFactory.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimGridRemapEngineFactory.h
rename to include/ossim/imaging/ossimGridRemapEngineFactory.h
diff --git a/include/ossim/imaging/ossimGridRemapSource.h b/include/ossim/imaging/ossimGridRemapSource.h
new file mode 100644
index 0000000..b3eb061
--- /dev/null
+++ b/include/ossim/imaging/ossimGridRemapSource.h
@@ -0,0 +1,144 @@
+//*****************************************************************************
+// FILE: ossimGridRemapSource.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimGridRemapSource. This is
+//   a spacially variant remapper that utilizes a grid for interpolating the
+//   remap value given an image x, y. 
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimGridRemapSource.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimGridRemapSource_HEADER
+#define ossimGridRemapSource_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+#include <ossim/imaging/ossimGridRemapEngine.h>
+#include <ossim/base/ossimFilename.h>
+
+class ossimDblGrid;
+class ossimDrect;
+class ossimDpt;
+class ossimImageData;
+
+/*!****************************************************************************
+ *
+ * CLASS:  ossimGridRemapSource
+ *
+ *****************************************************************************/
+class ossimGridRemapSource : public ossimImageSourceFilter
+{
+public:
+   /*!
+    * Constructors: 
+    */
+   ossimGridRemapSource();
+   ossimGridRemapSource(ossimImageSource* inputSource,
+                        ossimGridRemapEngine* engine);
+
+   /*!ossimAtbPointSource
+    * Initializes the remap engine. This object implements specific algorithms
+    * for interpreting the grids owned by this remapper. It actually performs
+    * the remapping.
+    */
+   void setRemapEngine(ossimGridRemapEngine* engine);
+   
+   /*!
+    * Provides access to the remap engine:
+    */
+   ossimGridRemapEngine* getRemapEngine() { return theRemapEngine; }
+   
+   /*!
+    * Permits initializing the remap grid after construction. 
+    */
+   virtual void initialize(const ossimDrect& uv_rect,
+			   const ossimDpt&   grid_spacing);
+
+  /*!
+   * Sets a node of the member grid to the value specified. The grid is flagged
+   * as unfilled.
+   */
+  void setGridNode(const ossimDpt& view_pt,
+		   const double*    value);
+  
+   /*!
+    * Implementation of virtual method to return remapped tile.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& origin,
+                                   ossim_uint32 resLevel=0);
+
+   /*!
+    * Restore the state of the object from a keywordlist.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /*!
+    * Save the state of the object to a keywordlist.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /*!
+    * Locks the image to prevent grid adjustment. The remapper continues to
+    * remap given the current grid (if enabled), but all target values computed
+    * are such that no change in the grids will occur in an adjsutment. If more
+    * than one overlapping image is locked, the target will may be influenced
+    * by all locked images, but the remap grids will not be updated.
+    */
+   void lock() { theRemapIsLockedFlag = true; }
+
+   /*!
+    * Unlocks the grids for adjustment.
+    */
+   void unlock() { theRemapIsLockedFlag = false; }
+   
+   /*!
+    * Returns the status of the lock flag.
+    */
+   bool isLocked() const { return theRemapIsLockedFlag; }
+
+   /*!
+    * Provides access to individual grids (pointer) given an index. Null pointer
+    * returned if index out of range.
+    */
+   ossimDblGrid* getGrid(unsigned int index);
+
+   /*!
+    * Returns grid filename (may be empty)
+    */
+   const ossimFilename& getGridFilename() const { return theGridFilename; }
+
+   /*!
+    * Sets the grid filename and initiates read.
+    */
+   void setGridFilename(const ossimFilename& grid_filename);
+   
+protected:
+   virtual ~ossimGridRemapSource();
+
+   /*!
+    * Deallocates grid memory.
+    */
+   void deallocateGrids();
+   
+   vector<ossimDblGrid*> theGrids;
+   ossimFilename         theGridFilename;
+   ossimGridRemapEngine* theRemapEngine;
+   bool                  theRemapIsLockedFlag;
+   bool                  theGridIsFilled;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimHistoMatchRemapper.h b/include/ossim/imaging/ossimHistoMatchRemapper.h
new file mode 100644
index 0000000..90fbb52
--- /dev/null
+++ b/include/ossim/imaging/ossimHistoMatchRemapper.h
@@ -0,0 +1,97 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimHistoMatchRemapper.h 23353 2015-06-01 19:19:10Z dburken $
+#ifndef ossimHistoMatchRemapper_HEADER
+#define ossimHistoMatchRemapper_HEADER 1
+#include <vector>
+using namespace std;
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIM_DLL ossimHistoMatchRemapper: public ossimImageSourceFilter
+{
+public:
+   ossimHistoMatchRemapper();
+   ossimHistoMatchRemapper(ossimImageSource* inputSource,
+                           const vector<double>& targetMeanPerBand  = vector<double>(),
+                           const vector<double>& targetSigmaPerBand = vector<double>(),
+                           const vector<double>& inputMeanPerBand   = vector<double>(),
+                           const vector<double>& inputSigmaPerBand  = vector<double>()
+                           );
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   virtual void initialize();
+   
+   const vector<double>& getInputMeanValues()const;
+   const vector<double>& getInputSigmaValues()const;
+   const vector<double>& getTargetMeanValues()const;
+   const vector<double>& getTargetSigmaValues()const;
+
+   void setInputMeanValues(const vector<double>& newValues);
+   void setInputSigmaValues(const vector<double>& newValues);
+   void setTargetMeanValues(const vector<double>& newValues);
+   void setTargetSigmaValues(const vector<double>& newValues);
+   
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+
+protected:
+   virtual ~ossimHistoMatchRemapper();
+   
+   ossimRefPtr<ossimImageData> theBlankTile;
+   
+   vector<double> theTargetMeanPerBand;
+   vector<double> theTargetSigmaPerBand;
+   vector<double> theInputMeanPerBand;
+   vector<double> theInputSigmaPerBand;
+
+   /**
+    * transLean
+    * @param vIn input value to be transformed
+    * @param vBias bias value to be removed
+    * @param vTarget value that will replace bias
+    * @param vMin minimum valid value of vIn (inclusive)
+    * @param vMax maximum valid value of vIn (inclusive)
+    * @return vOut
+    */
+   double transLean(double vIn,
+                    double vBias,
+                    double vTarget,
+                    double vMin,
+                    double vMax);
+
+   /**
+    * transLeanStretch
+    * @param vin Input value to be transformed.
+    * @param vBias Bias value to be removed.
+    * @param vBiasStretch dispersion (+/-) about vBias
+    * @param vTarget value that will replace bias
+    * @param vTargetStretch dispersion (+/-) about vTarget
+    * @param vMin minimum valid value of vIn (inclusive)
+    * @param vMax maximum valid value of vIn (inclusive)
+    * @return vOut
+    */
+   double transLeanStretch(double vIn,
+                           double vBias,
+                           double vBiasStretch,
+                           double vTarget,
+                           double vTargetStretch,
+                           double vMin,
+                           double vMax);
+   
+};
+
+#endif /* #ifndef ossimHistoMatchRemapper_HEADER */
diff --git a/include/ossim/imaging/ossimHistogramEqualization.h b/include/ossim/imaging/ossimHistogramEqualization.h
new file mode 100644
index 0000000..cee88f8
--- /dev/null
+++ b/include/ossim/imaging/ossimHistogramEqualization.h
@@ -0,0 +1,99 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHistogramEqualization.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimHistogramEqualization_HEADER
+#define ossimHistogramEqualization_HEADER
+#include <ossim/imaging/ossimImageSourceHistogramFilter.h>
+
+class OSSIMDLLEXPORT ossimHistogramEqualization : public ossimImageSourceHistogramFilter
+{
+public:
+   ossimHistogramEqualization();
+   ossimHistogramEqualization(ossimImageSource* inputSource,
+                              ossimRefPtr<ossimMultiResLevelHistogram> histogram);
+   ossimHistogramEqualization(ossimImageSource* inputSource,
+                              ossimRefPtr<ossimMultiResLevelHistogram> histogram,
+                              bool inverseFlag);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual void setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram);
+   virtual bool setHistogram(const ossimFilename& filename);
+
+   virtual bool getInverseFlag()const;
+   virtual void initialize();
+   virtual void setInverseFlag(bool inverseFlag);
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+   virtual ~ossimHistogramEqualization();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+  ossimRefPtr<ossimImageData> theTile;
+   /*!
+    * This will be used in some of the histogram
+    * based operations.
+    */
+   ossimRefPtr<ossimMultiResLevelHistogram> theAccumulationHistogram;
+
+   /*!
+    * Indicates if you should equalize or unequalize an input stream.
+    * If the inverse flag is true then it will indicate that we should
+    * assume that the input stream is already equalized and we should
+    * invert based on the current accumulation histogram.
+    *
+    *
+    * This flag is defaulted to false.
+    */
+   bool                         theInverseFlag;
+   /*!
+    * We will create a LUT for each band that directly maps
+    * an input value to an equalized output.
+    */
+   vector<double*> theForwardLut;
+   
+   /*!
+    * We will create a LUT for each band that directly maps
+    * an input value to an un-equalized output.
+    */
+   vector<double*> theInverseLut;
+
+   
+  std::vector<ossim_uint32> theBandList;
+   virtual void computeAccumulationHistogram();
+
+  template<class T>
+  ossimRefPtr<ossimImageData> runEqualizationAlgorithm(T dummyVariable,
+                                                       ossimRefPtr<ossimImageData> tile);
+
+   /*!
+    * We will pre-compute the luts for the forward and inverse
+    * equalization.  Note: the inverse is a little more tricky
+    * and since we must fill the empty spots missed by the
+    * inverse.  We use a linear interpolation between valid
+    * values for this.
+    */
+   virtual void initializeLuts();
+   virtual void deleteLuts();
+
+TYPE_DATA
+};
+#endif /* #ifndef ossimHistogramEqualization_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimHistogramMatchFilter.h b/include/ossim/imaging/ossimHistogramMatchFilter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimHistogramMatchFilter.h
rename to include/ossim/imaging/ossimHistogramMatchFilter.h
diff --git a/include/ossim/imaging/ossimHistogramRemapper.h b/include/ossim/imaging/ossimHistogramRemapper.h
new file mode 100644
index 0000000..2b15ec0
--- /dev/null
+++ b/include/ossim/imaging/ossimHistogramRemapper.h
@@ -0,0 +1,586 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Histogram remapper class declaration.  Derived from ossimTableRemapper.
+//
+// Remaps a tile based on mode and histogram clip points.  This object uses
+// a precomputed remap table for speed; hence, derived from the
+// ossimTableRemapper
+//
+// NOTE on bands:
+// 
+// - All methods take zero based bands.  In other words the first
+//   band is band "0".  
+//
+// - This objects band 0 is the same band 0 as it's input connection.  If
+//   the band order was changed by a ossimBandSelector then this band 0 will
+//   not map to the histogram files band 0.  To handle this,
+//   the "getOutputBandList()" method is used to get the correct histogram for
+//   the input band.
+//   
+// - The "get" methods that do not take a band, simply return the average of
+//   all bands.  This really only makes sense if all bands are the same
+//   but is provided for convenience.
+//   
+//*************************************************************************
+// $Id: ossimHistogramRemapper.h 22746 2014-04-23 16:16:28Z gpotts $
+#ifndef ossimHistogramRemapper_HEADER
+#define ossimHistogramRemapper_HEADER 1
+
+#include <ossim/imaging/ossimTableRemapper.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+
+
+class OSSIMDLLEXPORT ossimHistogramRemapper : public ossimTableRemapper
+{
+public:
+   enum StretchMode
+   {
+      LINEAR_ONE_PIECE       = 0,
+      LINEAR_1STD_FROM_MEAN  = 1,
+      LINEAR_2STD_FROM_MEAN  = 2,
+      LINEAR_3STD_FROM_MEAN  = 3,
+      LINEAR_AUTO_MIN_MAX    = 4,
+      LINEAR_AUTO_PERCENTILE = 5,
+      STRETCH_UNKNOWN = 6 // Alway last as used for number of modes method.
+   };
+
+   /** default constructor */
+   ossimHistogramRemapper();
+
+
+   virtual ossimString getLongName()  const;
+   virtual ossimString getShortName() const;
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+   /**
+    * - Disables this source.
+    * - Sets all clip points to default.
+    * - Removes current table.
+    */
+   void reset();
+   
+   /**
+    * Sets remap mode to mode.  If rebuildTableFlag is true, the table will
+    * be built at this time; else just the dirty flag is set.
+    *
+    * @param mode The stretch mode.
+    * 
+    * @param rebuildTableFlag If the true the table will be rebuilt; else,
+    * just the dirty flag will be set.
+    */
+   void setStretchMode(StretchMode mode, bool rebuildTableFlag=false);
+
+   /**
+    * Stretch mode values can be linear_one_piece, linear_1std_from_mean,
+    * linear_2std_from_mean, linear_3std_from_mean, linear_auto_min_max,
+    * If rebuildTableFlag is true, the table will
+    * be built at this time; else just the dirty flag is set.
+    *
+    * @param mode The stretch mode.
+    * 
+    * @param rebuildTableFlag If the true the table will be rebuilt; else,
+    * just the dirty flag will be set.
+    */
+   void setStretchModeAsString(const ossimString& mode,
+                               bool rebuildTableFlag=false);
+   
+   /**
+    * Returns the current enumerated node.
+    */
+   StretchMode   getStretchMode() const;
+
+   /**
+    * Returns the string for current remap mode.
+    */
+   ossimString getStretchModeString() const;
+
+   /**
+    * Returns the number of stretch modes.
+    */
+   ossim_uint32 getNumberOfStretchModes() const;
+
+   /**
+    * Returns the mode string for a given index.
+    * Returns "stretch_unknown" if index is out of range.
+    * 
+    * NOTE:
+    * - If you're building gui buttons you can:
+    *   // pseudo code...
+    *   ossim_uint32 number_of_modes = remapper->getNumberOfModes()
+    *   for (ossim_uint32 i = 0; i < number_of_modes; ++i)
+    *   {
+    *      addButton(getModeString(i).c_str());
+    *   }
+    */
+   ossimString getStretchModeString(ossim_uint32 index) const;
+   
+   /**
+    * Sets the low clip point.
+    *
+    * Note on null bin:
+    * - The null bin is ignored when considering a percent of penetration from
+    *   the low end.
+    *
+    * Notes on clip point:
+    * - If input chip source is mutiband this will set all band to same
+    *   percentage of clip.
+    * - Clip points should be normalized between zero and one.
+    * - A low clip point of 0.0 means no penetration.
+    * - A low clip point of 0.02 means penetrate in two percent.
+    */
+   void setLowNormalizedClipPoint(const ossim_float64& clip);
+
+   /**
+    * Sets the low clip point for band.
+    *
+    * Note on null bin:
+    * - The null bin is ignored when considering a percent of penetration from
+    *   the low end.
+    *
+    * Notes on clip points:
+    * - Clip point should be normalized between zero and one.
+    * - A low clip point of 0.0 means no penetration.
+    * - A low clip point of 0.02 means penetrate in two percent.
+    */
+   void setLowNormalizedClipPoint(const ossim_float64& clip,
+                                  ossim_uint32 zero_based_band);
+
+   /**
+    * Sets the high clip point.
+    * 
+    * Notes on clip points:
+    * - If input chip source is mutiband this will set all band to same
+    *   percentage of clip.
+    * - Clip point should be normalized between zero and one.
+    * - A high clip point of 1.0 means no penetration.
+    * - A high clip point of .98 mean a 2 % penetration from the high end.
+    */
+   void setHighNormalizedClipPoint(const ossim_float64& clip);
+
+   /**
+    * Sets the high clip point.
+    *
+    * Notes on clip points:
+    * - Clip point should be normalized between zero and one.
+    * - A high clip point of 1.0 means no penetration.
+    * - A high clip point of .98 mean a 2 % penetration from the high end.
+    */
+   void setHighNormalizedClipPoint(const ossim_float64& clip,
+                                   ossim_uint32 zero_based_band);
+
+   /**
+    * Sets the low clip point.
+    *
+    * Notes on clip point:
+    * - If input chip source is mutiband this will set all band to same
+    *   percentage of clip.
+    * - Clip points are in DN values.
+    * - If histogram is not set no action is taken. 
+    */
+   void setLowClipPoint(const ossim_float64& clip);
+
+   /**
+    * Sets the low clip point for band.
+    *
+    * Notes on clip points:
+    * - Clip points are DN values.
+    * - If histogram is not set no action is taken. 
+    */
+   void setLowClipPoint(const ossim_float64& clip,
+                        ossim_uint32 zero_based_band);
+
+   /**
+    * Sets the high clip point.
+    * 
+    * Notes on clip points:
+    * - If input chip source is mutiband this will set all band to same
+    *   percentage of clip.
+    * - Clip points are DN values.
+    * - If histogram is not set no action is taken. 
+    */
+   void setHighClipPoint(const ossim_float64& clip);
+
+   /**
+    * Sets the high clip point.
+    *
+    * Notes on clip points:
+    * - Clip points are DN values.
+    * - If histogram is not set no action is taken. 
+    */
+   void setHighClipPoint(const ossim_float64& clip,
+                         ossim_uint32 zero_based_band);
+
+   /**
+    * Sets the mid clip point.
+    * 
+    * Notes on clip points:
+    * - If input chip source is mutiband this will set all band to same
+    *   percentage of clip.
+    */
+   void setMidPoint(const ossim_float64& value);
+
+   /**
+    * Sets the mid clip point for band.
+    */
+   void setMidPoint(const ossim_float64& value,
+                    ossim_uint32 zero_based_band);
+
+   /**
+    * Sets the min output value.
+    * 
+    * Notes on clip points:
+    * - If input chip source is mutiband this will set all band to same
+    *   percentage of clip.
+    */
+   void setMinOutputValue(const ossim_float64& value);
+
+   /**
+    * Sets the min output value for band.
+    */
+   void setMinOutputValue(const ossim_float64& value,
+                          ossim_uint32 zero_based_band);
+
+   /**
+    * Sets the max output value.
+    * 
+    * Notes on clip points:
+    * - If input chip source is mutiband this will set all band to same
+    *   percentage of clip.
+    */
+   void setMaxOutputValue(const ossim_float64& value);
+
+   /**
+    * Sets the min output value for band.
+    */
+   void setMaxOutputValue(const ossim_float64& value,
+                          ossim_uint32 zero_based_band);
+   
+   /**
+    * Returns the normalized low clip point for band.
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getLowNormalizedClipPoint(ossim_uint32 zero_based_band) const;
+
+   /**
+    * Returns the normalized low clip point which is the average of all bands.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getLowNormalizedClipPoint() const;
+
+   /**
+    * Returns the normalized high clip point for band.
+    *
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getHighNormalizedClipPoint(ossim_uint32 zero_based_band) const;
+   /**
+    * Returns the normalized High clip point which is the average of all bands.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getHighNormalizedClipPoint() const;
+
+   /**
+    * Returns the low clip point for band.
+    * Clip points are DN values relative to the scalar type.
+    *
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getLowClipPoint(ossim_uint32 zero_based_band) const;
+
+   /**
+    * Returns the low clip point which is the average of all bands.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getLowClipPoint() const;
+
+   /**
+    * Returns the high clip point for band.
+    * Clip points are DN values relative to the scalar type.
+    *
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getHighClipPoint(ossim_uint32 zero_based_band) const;
+
+   /**
+    * Returns the high clip point which is the average of all bands.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getHighClipPoint() const;
+
+   
+   /**
+    * Returns the mid point for band
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getMidPoint(ossim_uint32 zero_based_band) const;
+   
+   /**
+    * Returns the mid clip point which is the average of all bands.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    * - Histogram has not been set.
+    */
+   ossim_float64 getMidPoint() const;
+   
+   /**
+    * Returns the minimum output value for band.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    */
+   ossim_float64 getMinOutputValue(ossim_uint32 zero_based_band) const;
+
+   /**
+    * Returns the minimum output value which is the average of all bands.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    */
+   ossim_float64 getMinOutputValue() const;
+
+   /**
+    * Returns the maximum output value for band.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    */
+   ossim_float64 getMaxOutputValue(ossim_uint32 zero_based_band) const;
+
+   /**
+    * Returns the maximum output value which is the average of all bands.
+    * 
+    * Will return OSSIM_DBL_NAN if:
+    * - Band is out of range.
+    * - Connection is not complete.
+    */
+   ossim_float64 getMaxOutputValue() const;
+   
+   /**
+    * Sets the histogram.
+    * If (own_histogram == true) this object will delete theHistogram
+    * on destruction.
+    */
+   void setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram);
+   
+   ossimRefPtr<ossimMultiResLevelHistogram> getHistogram();
+   ossimRefPtr<const ossimMultiResLevelHistogram> getHistogram()const;
+   
+   /**
+    * Returns pointer to histogram for band and reduced res level.
+    * - Band is zero based relative to the input connection.  This will be
+    *   remapped to the histogram band using the "getOutputBandList()" to
+    *   get the correct histogram band.
+    *   
+    * Will return NULL if:
+    * - band is out range
+    * - res_level is out of range
+    * - theHistogram has not been initialized yet.
+    */
+   ossimRefPtr<ossimHistogram> getHistogram(ossim_uint32 zero_based_band,
+                                ossim_uint32 res_level=0) const;
+
+   /**
+    * Open the histogram file.
+    * With this method the histogram is owned by this object.
+    * Returns true on success, false on error.
+    */
+   bool openHistogram(const ossimFilename& histogram_file);
+
+   /**
+    * Compute the histogram from input connection and region of interest.
+    * With this method the histogram is owned by this object.
+    *
+    * @param roi Region of inte
+    * Returns true on success, false on error.
+    */
+   bool computeHistogram(const ossimIrect& roi);
+
+   /**
+    * Returns the currently opened histogram.
+    * Returns ossimFilename::NIL if no histogram is loaded.
+    */
+   ossimFilename getHistogramFile() const;
+   
+   /**
+    * Method to the save the state to a keyword list.
+    * Returns true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.
+    * Returns true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   
+   virtual ostream& print(ostream& os) const;
+
+   /**
+    * Returns the min pixel of the band.
+    */
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   
+   /**
+    * Returns the max pixel of the band.
+    */
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * Will test for the input being a ossimHistogramSource and allow pulling the histogram
+    * from a histogram source.
+    */
+   bool canConnectMyInputTo(ossim_int32 inputIndex,
+                            const ossimConnectableObject* object)const;
+
+protected:
+   /** virtual destructor */
+   virtual ~ossimHistogramRemapper();
+
+private:
+   // Do not allow copy constructor, operator=.
+   ossimHistogramRemapper(const ossimHistogramRemapper& hr);
+   ossimHistogramRemapper& operator=(const ossimHistogramRemapper& hr);
+
+   void buildTable();
+   void buildLinearTable();
+   void buildAutoLinearMinMaxTable();
+   void buildAutoLinearPercentileTable();
+   template <class T> void buildLinearTable(T dummy);
+   template <class T> void buildAutoLinearMinMaxTableTemplate(T dummy);
+   template <class T> void buildAutoLinearPercentileTableTemplate(T dummy);
+
+   /**
+    * Sets clip points using mean and standard deviations then calls
+    * buildLinearTable method.
+    */
+   void buildLinearTableStdFromMean();
+   
+   /**
+    * Uses getNumberOfInputBands() to determine BANDS then calls
+    * initializeClips(BANDS)
+    */
+   void initializeClips();
+
+   /**
+    * Initializes data members to some default state and size.
+    */
+   void initializeClips(ossim_uint32 bands);
+
+   /*
+    * Sets the count of the null bin to 0 so that clips from the low end
+    * ignore the null bin.
+    */
+   void setNullCount();
+
+   void initializeMinMaxOutput();
+   
+   /**
+    * Initialized base class (ossimTableRemapper) values:
+    * - theTableBinCount
+    * - theTableBandCount
+    * - theTableType
+    * - theTable (resizes if not correct size.
+    */
+   void setupTable();
+
+   /**
+    * This set theBypassFlag.  This is an internally used flag to signal that
+    * there is nothing to do in this filter; hence, bypass.
+    */
+   void verifyEnabled();
+
+   /**
+    * Returns the histogram band that maps to the input band.
+    * Note:
+    * - This uses the current band list from "getOutputBandList()".
+    */
+   ossim_uint32 getHistogramBand(ossim_uint32 input_band) const;
+
+   /**
+    * Sets theBypassFlag.  If the start changes from bypassed to not bypassed
+    * this will set theDirtyFlag to true.
+    */
+   void setBypassFlag(bool flag);
+
+   /**
+   * If we are dirty then it will init what it needs and then set
+   * the dirty back to false;
+   */
+   void makeClean();
+
+   template <class T> void applyLinearStretch(
+      T dummy,
+      ossimRefPtr<ossimImageData>& inputTile);
+
+
+   StretchMode                   theStretchMode;
+   bool                          theDirtyFlag;
+   mutable ossimRefPtr<ossimMultiResLevelHistogram>  theHistogram;
+   vector<ossim_float64>         theNormalizedLowClipPoint;
+   vector<ossim_float64>         theNormalizedHighClipPoint;
+   vector<ossim_float64>         theMidPoint;
+   vector<ossim_float64>         theMinOutputValue;
+   vector<ossim_float64>         theMaxOutputValue;
+
+   // Maps zero based band to histogram band.
+   vector<ossim_uint32>          theBandList;
+
+   // Internally bypassed flag.
+   bool theBypassFlag;
+   bool theResetBandIndicesFlag;
+
+   TYPE_DATA
+};
+
+#endif  /* #ifndef ossimHistogramRemapper_HEADER */
diff --git a/include/ossim/imaging/ossimHistogramThreshholdFilter.h b/include/ossim/imaging/ossimHistogramThreshholdFilter.h
new file mode 100644
index 0000000..9d8121e
--- /dev/null
+++ b/include/ossim/imaging/ossimHistogramThreshholdFilter.h
@@ -0,0 +1,51 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHistogramThreshholdFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimHistogramThreshholdFilter_HEADER
+#define ossimHistogramThreshholdFilter_HEADER
+#include <ossim/imaging/ossimImageSourceHistogramFilter.h>
+
+class ossimHistogramThreshholdFilter : public ossimImageSourceHistogramFilter
+{
+public:
+   ossimHistogramThreshholdFilter();
+   ossimHistogramThreshholdFilter(double minValuePercent,
+                                  double maxValuePercent,
+                                  ossimImageSource* inputSource,
+                                  ossimMultiResLevelHistogram* histogram);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual void setMinValuePercent(double minValue);
+   virtual void setMaxValuePercent(double maxValue);
+   
+   virtual double getMinValuePercent()const;
+   virtual double getMaxValuePercent()const;
+
+   virtual void initialize();
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+protected:
+   virtual ~ossimHistogramThreshholdFilter();
+   
+   double theMinValuePercent;
+   double theMaxValuePercent;
+   template <class T>
+   ossimRefPtr<ossimImageData> runThreshholdStretchAlgorithm(
+      T dummyVariable,
+      ossimRefPtr<ossimImageData>& tile);
+   
+TYPE_DATA
+};
+#endif
diff --git a/ossim/include/ossim/imaging/ossimHistogramWriter.h b/include/ossim/imaging/ossimHistogramWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimHistogramWriter.h
rename to include/ossim/imaging/ossimHistogramWriter.h
diff --git a/include/ossim/imaging/ossimHsiRemapper.h b/include/ossim/imaging/ossimHsiRemapper.h
new file mode 100644
index 0000000..172fcfd
--- /dev/null
+++ b/include/ossim/imaging/ossimHsiRemapper.h
@@ -0,0 +1,256 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Remapper to adjust hue, saturation and intensity.
+//
+//*************************************************************************
+// $Id: ossimHsiRemapper.h 19689 2011-05-31 15:55:21Z gpotts $
+
+#ifndef ossimHsiRemapper_HEADER
+#define ossimHsiRemapper_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIMDLLEXPORT ossimHsiRemapper : public ossimImageSourceFilter
+{
+public:
+   enum
+   {
+      RED      = 0,
+      YELLOW   = 1,
+      GREEN    = 2,
+      CYAN     = 3,      
+      BLUE     = 4,
+      MAGENTA  = 5,
+      ALL      = 6
+   };
+   
+   ossimHsiRemapper();
+
+   virtual ossimString getLongName()  const;
+   virtual ossimString getShortName() const;
+
+   virtual void initialize();
+   /*---------------------- PROPERTY INTERFACE ---------------------------*/
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   /*---------------------- END PROPERTY INTERFACE ---------------------------*/
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                   ossim_uint32 resLevel=0);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   
+   ossim_uint32 getNumberOfOutputBands() const;
+
+   virtual ostream& print(ostream& os) const;
+
+   friend ostream& operator << (ostream& os,  const ossimHsiRemapper& hr);
+   
+   void setHueOffset               (int color_group, double offset);
+   void setHueLowRange             (int color_group, double range);
+   void setHueHighRange            (int color_group, double range);
+   void setHueBlendRange           (int color_group, double range);
+   void setSaturationOffset        (int color_group, double offset);
+   void setIntensityOffset         (int color_group, double offset);
+   
+   void setMasterHueOffset         (double offset);
+   void setMasterSaturationOffset  (double offset);
+   void setMasterIntensityOffset   (double offset);
+   void setMasterIntensityLowClip  (double clip);
+   void setMasterIntensityHighClip (double clip);
+
+   void setRedHueOffset            (double offset);
+   void setRedHueLowRange          (double range);
+   void setRedHueHighRange         (double range);
+   void setRedHueBlendRange        (double range);
+   void setRedSaturationOffset     (double offset);
+   void setRedIntensityOffset      (double offset);
+
+   void setYellowHueOffset         (double offset);
+   void setYellowHueLowRange       (double range);
+   void setYellowHueHighRange      (double range);
+   void setYellowHueBlendRange     (double range);
+   void setYellowSaturationOffset  (double offset);
+   void setYellowIntensityOffset   (double offset);
+
+   void setGreenHueOffset          (double offset);
+   void setGreenHueLowRange        (double range);
+   void setGreenHueHighRange       (double range);
+   void setGreenHueBlendRange      (double range);
+   void setGreenSaturationOffset   (double offset);
+   void setGreenIntensityOffset    (double offset);
+
+   void setCyanHueOffset           (double offset);
+   void setCyanHueLowRange         (double range);
+   void setCyanHueHighRange        (double range);
+   void setCyanHueBlendRange       (double range);
+   void setCyanSaturationOffset    (double offset);
+   void setCyanIntensityOffset     (double offset);
+
+   void setBlueHueOffset           (double offset);
+   void setBlueHueLowRange         (double range);
+   void setBlueHueHighRange        (double range);
+   void setBlueHueBlendRange       (double range);
+   void setBlueSaturationOffset    (double offset);
+   void setBlueIntensityOffset     (double offset);
+
+   void setMagentaHueOffset        (double offset);
+   void setMagentaHueLowRange      (double range);
+   void setMagentaHueHighRange     (double range);
+   void setMagentaHueBlendRange    (double range);
+   void setMagentaSaturationOffset (double offset);
+   void setMagentaIntensityOffset  (double offset);
+
+   double getHueOffset             (int color_group) const;
+   double getHueLowRange           (int color_group) const;
+   double getHueHighRange          (int color_group) const;
+   double getHueBlendRange         (int color_group) const;
+   double getSaturationOffset      (int color_group) const;
+   double getIntensityOffset       (int color_group) const;
+   
+   double getMasterHueOffset          () const;
+   double getMasterSaturationOffset   () const;
+   double getMasterIntensityOffset    () const;
+   double getMasterIntensityLowClip   () const;
+   double getMasterIntensityHighClip  () const;
+   
+   double getRedHueOffset             () const;
+   double getRedHueLowRange           () const;
+   double getRedHueHighRange          () const;
+   double getRedHueBlendRange         () const;
+   double getRedSaturationOffset      () const;
+   double getRedIntensityOffset       () const;
+
+   double getYellowHueOffset          () const;
+   double getYellowHueLowRange        () const;
+   double getYellowHueHighRange       () const;
+   double getYellowHueBlendRange      () const;
+   double getYellowSaturationOffset   () const;
+   double getYellowIntensityOffset    () const;
+
+   double getGreenHueOffset           () const;
+   double getGreenHueLowRange         () const;
+   double getGreenHueHighRange        () const;
+   double getGreenHueBlendRange       () const;
+   double getGreenSaturationOffset    () const;
+   double getGreenIntensityOffset     () const;
+
+   double getCyanHueOffset            () const;
+   double getCyanHueLowRange          () const;
+   double getCyanHueHighRange         () const;
+   double getCyanHueBlendRange        () const;
+   double getCyanSaturationOffset     () const;
+   double getCyanIntensityOffset      () const;
+
+   double getBlueHueOffset            () const;
+   double getBlueHueLowRange          () const;
+   double getBlueHueHighRange         () const;
+   double getBlueHueBlendRange        () const;
+   double getBlueSaturationOffset     () const;
+   double getBlueIntensityOffset      () const;
+
+   double getMagentaHueOffset         () const;
+   double getMagentaHueLowRange       () const;
+   double getMagentaHueHighRange      () const;
+   double getMagentaHueBlendRange     () const;
+   double getMagentaSaturationOffset  () const;
+   double getMagentaIntensityOffset   () const;
+
+   void   setWhiteObjectClip          (double clip);
+   double getWhiteObjectClip          () const;
+   void   resetWhiteObjectClip        ();
+
+   void resetGroup(int color_group);
+   void resetAll();
+   void resetMaster();
+   void resetRed();
+   void resetYellow();
+   void resetGreen();
+   void resetCyan();
+   void resetBlue();
+   void resetMagenta();
+   
+protected:
+   virtual ~ossimHsiRemapper();
+   void   allocate(const ossimIrect& rect);
+   void   verifyEnabled();
+   double calculateMinNormValue();
+
+   bool theValidFlag;
+   ossimRefPtr<ossimImageData> theTile;
+   double*                     theBuffer;
+   double                      theNormalizedMinPix;
+
+   double theMasterHueOffset;
+   double theMasterSaturationOffset;
+   double theMasterIntensityOffset;
+   double theMasterIntensityLowClip;
+   double theMasterIntensityHighClip;
+
+   double theRedHueOffset;
+   double theRedHueLowRange;
+   double theRedHueHighRange;
+   double theRedHueBlendRange;
+   double theRedSaturationOffset;
+   double theRedIntensityOffset;
+
+   double theYellowHueOffset;
+   double theYellowHueLowRange;
+   double theYellowHueHighRange;
+   double theYellowHueBlendRange;
+   double theYellowSaturationOffset;
+   double theYellowIntensityOffset;
+
+   double theGreenHueOffset;
+   double theGreenHueLowRange;
+   double theGreenHueHighRange;
+   double theGreenHueBlendRange;
+   double theGreenSaturationOffset;
+   double theGreenIntensityOffset;
+
+   double theCyanHueOffset;
+   double theCyanHueLowRange;
+   double theCyanHueHighRange;
+   double theCyanHueBlendRange;
+   double theCyanSaturationOffset;
+   double theCyanIntensityOffset;
+
+   double theBlueHueOffset;
+   double theBlueHueLowRange;
+   double theBlueHueHighRange;
+   double theBlueHueBlendRange;
+   double theBlueSaturationOffset;
+   double theBlueIntensityOffset;
+
+   double theMagentaHueOffset;
+   double theMagentaHueLowRange;
+   double theMagentaHueHighRange;
+   double theMagentaHueBlendRange;
+   double theMagentaSaturationOffset;
+   double theMagentaIntensityOffset;
+
+   double theWhiteObjectClip;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimHsiToRgbSource.h b/include/ossim/imaging/ossimHsiToRgbSource.h
new file mode 100644
index 0000000..4cdc91e
--- /dev/null
+++ b/include/ossim/imaging/ossimHsiToRgbSource.h
@@ -0,0 +1,49 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHsiToRgbSource.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimHsiToRgbSource_HEADER
+#define ossimHsiToRgbSource_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimHsiToRgbSource : public ossimImageSourceFilter
+{
+public:
+   ossimHsiToRgbSource();
+   ossimHsiToRgbSource(ossimImageSource* inputSource);
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual ossimScalarType getOutputScalarType() const;
+
+   virtual double getNullPixelValue()const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual void initialize();
+protected:
+   virtual ~ossimHsiToRgbSource();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theBlankTile;
+   ossimRefPtr<ossimImageData> theTile;
+
+   void initializeBuffers(ossimRefPtr<ossimImageData>& data);
+   
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimHsiToRgbSource_HEADER */
+
diff --git a/include/ossim/imaging/ossimHsvGridRemapEngine.h b/include/ossim/imaging/ossimHsvGridRemapEngine.h
new file mode 100644
index 0000000..1d5d605
--- /dev/null
+++ b/include/ossim/imaging/ossimHsvGridRemapEngine.h
@@ -0,0 +1,54 @@
+//*****************************************************************************
+// FILE: ossimHsvGridRemapEngine.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimHsvGridRemapEngine
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimHsvGridRemapEngine.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef ossimHsvGridRemapEngine_HEADER
+#define ossimHsvGridRemapEngine_HEADER
+
+#include <ossim/imaging/ossimGridRemapEngine.h>
+
+/*!****************************************************************************
+ *
+ * CLASS: ossimHsvGridRemapEngine 
+ *
+ *****************************************************************************/
+class ossimHsvGridRemapEngine : public ossimGridRemapEngine
+{
+public:
+   ossimHsvGridRemapEngine()
+      : ossimGridRemapEngine(3, 3) {}
+   
+   virtual ossimObject* dup() const;
+   
+   virtual void remapTile(const ossimDpt& origin_point,
+                          ossimGridRemapSource* remapper,
+                          ossimRefPtr<ossimImageData>& tile);
+
+   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources);
+
+   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
+                                   void* result);
+
+protected:
+   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
+                                 void*                 source_value,
+                                 void*                 target_value);
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimHsvToRgbSource.h b/include/ossim/imaging/ossimHsvToRgbSource.h
new file mode 100644
index 0000000..aa34e07
--- /dev/null
+++ b/include/ossim/imaging/ossimHsvToRgbSource.h
@@ -0,0 +1,42 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHsvToRgbSource.h 22874 2014-08-26 10:21:34Z dburken $
+#ifndef ossimHsvToRgbSource_HEADER
+#define ossimHsvToRgbSource_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIM_DLL ossimHsvToRgbSource : public ossimImageSourceFilter
+{
+public:
+   ossimHsvToRgbSource();
+   ossimHsvToRgbSource(ossimImageSource* inputSource);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual double          getNullPixelValue()const;
+   virtual double          getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double          getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual void initialize();
+
+protected:
+   virtual ~ossimHsvToRgbSource();
+
+   virtual void allocate();
+
+   ossimRefPtr<ossimImageData> theBlankTile;
+   ossimRefPtr<ossimImageData> theTile;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimIgenGenerator.h b/include/ossim/imaging/ossimIgenGenerator.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimIgenGenerator.h
rename to include/ossim/imaging/ossimIgenGenerator.h
diff --git a/ossim/include/ossim/imaging/ossimImageCacheBase.h b/include/ossim/imaging/ossimImageCacheBase.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageCacheBase.h
rename to include/ossim/imaging/ossimImageCacheBase.h
diff --git a/ossim/include/ossim/imaging/ossimImageCacheTileSource.h b/include/ossim/imaging/ossimImageCacheTileSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageCacheTileSource.h
rename to include/ossim/imaging/ossimImageCacheTileSource.h
diff --git a/include/ossim/imaging/ossimImageChain.h b/include/ossim/imaging/ossimImageChain.h
new file mode 100644
index 0000000..6cbb06a
--- /dev/null
+++ b/include/ossim/imaging/ossimImageChain.h
@@ -0,0 +1,416 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageChain.h 20316 2011-12-02 15:56:38Z oscarkramer $
+#ifndef ossimImageChain_HEADER
+#define ossimImageChain_HEADER
+#include <vector>
+#include <map>
+using namespace std;
+
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimId.h>
+#include <ossim/base/ossimConnectableContainerInterface.h>
+
+class OSSIMDLLEXPORT ossimImageChain : public ossimImageSource,
+                                       public ossimConnectableObjectListener,
+                                       public ossimConnectableContainerInterface
+{
+public:
+   ossimImageChain();
+   virtual ~ossimImageChain();
+
+   ossimConnectableObject::ConnectableObjectList& getChainList(){return theImageChainList;}
+   const ossimConnectableObject::ConnectableObjectList& getChainList()const{return theImageChainList;}
+   
+   /**
+    * @param index Index of object to get.
+    *
+    * @see getNumberOfObjects(false) to get the number of objects inside
+    * the container.
+    *
+    * @return Container's object at that index or NULL if out of range.
+    */
+   ossimConnectableObject* operator[](ossim_uint32 index);
+
+   /**
+    * Same as operator[](ossim_uint32 i)
+    * 
+    * @param index Index of object to get.
+    *
+    * @see getNumberOfObjects(false) to get the number of objects inside
+    * the container.
+    *
+    * @return Container's object at that index or NULL if out of range.
+    *
+    * @note This does not recurse into other containers.
+    */
+   virtual ossimConnectableObject* getConnectableObject(ossim_uint32 index);
+   
+   virtual ossim_int32 indexOf(ossimConnectableObject* obj)const;
+   /**
+    * Return the first source which is the one that first receives the
+    * getTile request
+    */
+   virtual ossimImageSource* getFirstSource();
+   virtual const ossimImageSource* getFirstSource() const;
+   
+   virtual ossimObject* getFirstObject();
+
+   /**
+    * Return the last source which is the one that last receives the
+    * getTile request.
+    */
+   virtual ossimImageSource* getLastSource();
+   virtual const ossimImageSource* getLastSource() const;
+   
+   virtual ossimObject* getLastObject();
+
+
+   /**
+    * Adds it to the start of the chain.  This is the first one to receive
+    * the getTile request.  This basically inserts it to the right of the
+    * right most filter.
+    * Returns true on success, false on error.
+    */
+   bool addFirst(ossimConnectableObject* obj);
+
+   /**
+    * Adds it to the end.  this is the last one to receive the getTile
+    * request.  This basically inserts it to the left of the left most filter.
+    * Returns true on success, false on error.
+    */
+   bool addLast(ossimConnectableObject* obj);
+   
+   /**
+    * Deletes the first object.
+    * Note this is really most right of the chain.
+    * Returns true if deletion occurred, false if the chain is empty.
+    */
+   bool deleteFirst();
+
+   /**
+    * Deletes the last object.
+    * Note this is really most left of the chain.
+    * Returns true if deletion occurred, false if the chain is empty.
+    */
+   bool deleteLast();
+
+   /**
+    * 
+    */
+   bool insertRight(ossimConnectableObject* newObj,
+                    ossimConnectableObject* rightOfThisObj);
+
+   /**
+    *
+    */
+   bool insertRight(ossimConnectableObject* newObj,
+                    const ossimId& id);
+
+   /**
+    *
+    */
+   bool insertLeft(ossimConnectableObject* newObj,
+                   const ossimId& id);
+   /**
+    *
+    */
+   bool insertLeft(ossimConnectableObject* newObj,
+                   ossimConnectableObject* leftOfThisObj);
+   
+   bool replace(ossimConnectableObject* newObj,
+                ossimConnectableObject* oldObj);
+   /**
+    * Will return true or false if an image source was
+    * added to the chain.  It will add and do a connection
+    * to the previous source automatically.  This is a
+    * chain and the order of insertion matters. It adds it to the beginning
+    * of the list.  The last one added is the first one to receive
+    * the getTile.  Basically inserts to the right of the rightmost filter
+    *
+    */
+   virtual bool add(ossimConnectableObject* source);
+
+   /**
+    * Within the image chain will pass the head of the
+    * list.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   /**
+    * this call is passed to the head of the list.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+   /**
+    * This call is passed to the head of the list.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   
+   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
+
+   /**
+    * This call is passed to the head of the list.
+    */
+   virtual ossim_uint32 getTileWidth()const;
+
+   /**
+    * This call is passed to the head of the list.
+    */
+   virtual ossim_uint32 getTileHeight()const;
+   
+   /**
+    * Will pass this call to the head of the list.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
+                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+                                      ossim_uint32 resLevel=0)const;
+   
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   virtual void getDecimationFactor(ossim_uint32 resLevel,
+                                    ossimDpt& result) const;
+   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
+   virtual ossim_uint32 getNumberOfDecimationLevels()const;
+   
+   /**
+    * Will save the state of the chain.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+
+   /**
+    * Will load the state.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+   
+   virtual void initialize();
+   virtual void enableSource();
+   virtual void disableSource();
+   
+   bool canConnectMyInputTo(ossim_int32 myInputIndex,
+                            const ossimConnectableObject* object)const
+      {
+         if(theImageChainList.size()&&
+            theImageChainList[theImageChainList.size()-1].valid())
+         {
+            ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject, theImageChainList[theImageChainList.size()-1].get());
+            if(obj)
+            {
+               return obj->canConnectMyInputTo(myInputIndex,
+                                               object);
+            }
+         }
+         else if(!theImageChainList.size())
+         {
+            return true;
+         }
+         return false;
+      }
+      
+//    bool canConnectMyOutputTo(int32 myOutputIndex,
+//                              const ossimConnectableObject* object)const
+//       {
+//          if(theImageChainList.size()&&theImageChainList[0])
+//          {
+// 	   ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject, theImageChainList[0]);
+// 	   if(obj)
+// 	     {
+// 	       return obj->canConnectMyOutputTo(myOutputIndex,
+// 						object);
+// 	     }
+//          }
+         
+//          return false;
+//       }
+   
+   // ________________________CONNECTABLE CONTAINER DEFINTIONS_________________
+   //
+   
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeIdVisitor visitor(tyeId, false, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD( virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const RTTItypeid& typeInfo,
+                                                                     bool recurse=true));
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeNameVisitor visitor(typeName, false, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const ossimString& className,
+                                                                     bool recurse=true));
+
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeIdVisitor visitor(tyeId, true, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findFirstObjectOfType(const RTTItypeid& typeInfo,
+                                                         bool recurse=true));
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimTypeNameVisitor visitor(className, true, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findFirstObjectOfType(const ossimString& className,
+                                                         bool recurse=true));
+
+   /*!
+    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
+    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
+    *
+    * <pre>
+    *    ossimIdVisitor visitor(tyeId, true, ossimVisitor::VISIT_CHILDREN);
+    *    connectableObject->accept(visitor);
+    *    ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();
+    * </pre>
+    */
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObject(const ossimId& id,
+                                              bool recurse=true));
+
+   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObject(const ossimConnectableObject* obj,
+                                              bool recurse=true));
+
+   /**
+    * Will cycle through all sources setting their ids. the idLast wlil
+    * be updated
+    * so we can recurse into other containers.
+    */
+   virtual void makeUniqueIds();
+
+   /**
+    * Returns the number of objects within this container and all child
+    * containers.
+    *
+    * @param recurse If true and object is a contains containers; all objects
+    * will be conter.  If false only the objects of this container will be
+    * counted (theImageChainList.size()).
+    */
+   virtual ossim_uint32 getNumberOfObjects(bool recurse=true)const;
+
+   /**
+    * Deprecated! Please use getNumberOfObjects(false).
+    *
+    * @return The number of objects in this container or
+    * (theImageChainList.size()).
+    */
+   virtual ossim_uint32 getNumberOfSources() const;
+   
+   /**
+    * Will add an object to the container and then set the added objects owner
+    * to this.
+    */
+   virtual bool addChild(ossimConnectableObject* attachableObject);
+
+   /**
+    * Will remove the child from the container.  Changes the owner of the
+    * child to be NULL;
+    */
+   virtual bool removeChild(ossimConnectableObject* object);
+   virtual ossimConnectableObject* removeChild(const ossimId& id);
+   
+   virtual void getChildren(vector<ossimConnectableObject*>& children,
+                            bool immediateChildrenOnlyFlag);
+   //______________END CONNECTABLE CONTAINER INTERFACE____________
+   
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+   virtual void disconnectOutputEvent(ossimConnectionEvent& event);
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+   virtual void connectOutputEvent(ossimConnectionEvent& event);
+   virtual void objectDestructingEvent(ossimObjectDestructingEvent& event);
+
+   virtual void propagateEventToOutputs(ossimEvent& event);
+   virtual void propagateEventToInputs(ossimEvent& event);
+ 
+   virtual void processEvent(ossimEvent& event);
+
+   virtual void accept(ossimVisitor& visitor);
+   void deleteList();
+
+   /**
+    * These access methods greatly facilitate the implementation of an image chain adaptor class.
+    * They shouldn't be accessed directly by any other classes.  These methods really should be 
+    * "protected" but the compiler complains if this base class' declarations are "protected".
+    */
+   virtual ossimConnectableObject::ConnectableObjectList& imageChainList() { return theImageChainList; }
+   virtual const ossimConnectableObject::ConnectableObjectList& imageChainList() const { return theImageChainList; }
+   
+   /**
+    * Inserts all of this object's children and inputs into the container provided. Since this is
+    * itself a form of container, this method will consolidate this chain with the argument
+    * container. Consequently, this chain object will not be represented in the container, but its
+    * children will be, with correct input and output connections to external objects. Ownership
+    * of children will pass to the argument container.
+    * @return Returns TRUE if successful.
+    */
+   //virtual bool fillContainer(ossimConnectableContainer& container);
+
+protected:
+   void prepareForRemoval(ossimConnectableObject* connectableObject);
+   
+  /**
+    * This will hold a sequence of image sources.
+    * theFirst one in the list will be the head of the
+    * list and the last one is the tail.
+    */
+   ossimConnectableObject::ConnectableObjectList theImageChainList;
+   
+   ossimRefPtr<ossimImageData>     theBlankTile;
+  // mutable bool                    thePropagateEventFlag;
+   mutable bool                    theLoadStateFlag;
+   /**
+    * For dynamic loading to take place we must allocate all objects first and
+    * then assign id's later.  We must remember the id's so we can do this.
+    * we will create a map that takes the id of the source as a key and a
+    * vector of input id's to connect it's inputs to.
+    */
+   bool addAllSources(map<ossimId, vector<ossimId> >& idMapping,
+                      const ossimKeywordlist& kwl,
+                      const char* prefix = NULL);
+   void findInputConnectionIds(vector<ossimId>& result,
+                               const ossimKeywordlist& kwl,
+                               const char* prefix=NULL);
+   bool connectAllSources(const map<ossimId, vector<ossimId> >& idMapping);
+   
+   
+TYPE_DATA
+};
+#endif /* #ifndef ossimImageChain_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimImageCombiner.h b/include/ossim/imaging/ossimImageCombiner.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageCombiner.h
rename to include/ossim/imaging/ossimImageCombiner.h
diff --git a/include/ossim/imaging/ossimImageData.h b/include/ossim/imaging/ossimImageData.h
new file mode 100644
index 0000000..fb6263a
--- /dev/null
+++ b/include/ossim/imaging/ossimImageData.h
@@ -0,0 +1,1299 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Container class for a tile of image data.
+//
+//*******************************************************************
+// $Id: ossimImageData.h 23371 2015-06-12 13:08:34Z gpotts $
+#ifndef ossimImageData_HEADER
+#define ossimImageData_HEADER 1
+
+#include <vector>
+#include <iosfwd> /* for ostream */
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimRectilinearDataObject.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+
+class ossimMultiBandHistogram;
+
+class OSSIMDLLEXPORT ossimImageData : public ossimRectilinearDataObject
+{
+public:
+
+   /** Definitions for the unloadBand routines. */
+   enum OverwriteBandRule
+   {
+      /*
+       * The COLOR_DISCREPANCY rule directs that the selected band of a pixel
+       * of the destination buffer is to be overwritten if *any* one of the
+       * other bands of the same destination pixel have color values that 
+       * deviate from its color. 
+       * Deprecated in favor of COLOR_DISCREPANCY_OF_ANY_FROM_DEST.
+       */
+      COLOR_DISCREPANCY = 0,
+
+      /*
+       * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected 
+       * band of a pixel of the destination buffer is to be overwritten if 
+       * *any* one of the other bands of the same destination pixel have color 
+       * values that deviate from its color. 
+       * Same as the deprecated COLOR_DISCREPANCY.
+       */
+      COLOR_DISCREPANCY_OF_ANY_FROM_DEST = 1,
+
+      /*
+       * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected 
+       * band of a pixel of the destination buffer is to be overwritten only if 
+       * *all* of the other bands of the same destination pixel have color 
+       * values that deviate from its color. 
+       */
+      COLOR_DISCREPANCY_OF_ALL_FROM_DEST = 2,
+
+      /*
+       * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected 
+       * band of a pixel of the destination buffer is to be overwritten if 
+       * *any* one of the other bands of the same destination pixel have color 
+       * values that are equal to the color of the selected band of the source
+       * pixel. 
+       */
+      COLOR_EQUALITY_OF_ANY_TO_SRC = 3,
+
+      /*
+       * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected 
+       * band of a pixel of the destination buffer is to be overwritten only if 
+       * *all* of the other bands of the same destination pixel have color 
+       * values that are equal to the color of the selected band of the source
+       * pixel. 
+       */
+      COLOR_EQUALITY_OF_ALL_TO_SRC = 4,
+
+      /*
+       * The selected band of the destination buffer is to be overwritten 
+       * by the selected band of the source image data (no questions asked).
+       */
+      NULL_RULE = 5
+   };
+
+   /** @brief copy constructor */
+   ossimImageData(const ossimImageData &rhs);
+   
+   ossimImageData();
+
+   /**
+    * @brief Constructor
+    * @param source The owner.  This can be null.
+    * @param scalar The Scalar type like OSSIM_UINT8, OSSIM_UINT16...
+    * @param bands  The number of bands.
+    * 
+    * @note This does not initialize the undelying data buffer.
+    *       Call the initialize method to allocate storage.
+    */
+   ossimImageData(ossimSource* source,
+                  ossimScalarType scalar,
+                  ossim_uint32 bands = 1);
+
+   /**
+    * @brief Constructor
+    * @param source The owner.  This can be null.
+    * @param scalar The Scalar type like OSSIM_UINT8, OSSIM_UINT16...
+    * @param bands  The number of bands.
+    * @param width  The width or number of samples in the buffer.
+    * @param height The height or numer of lines in the buffer.
+    * 
+    * @note This does not initialize the undelying data buffer.
+    *       Call the initialize method to allocate storage.
+    */
+   ossimImageData(ossimSource* source,
+                  ossimScalarType scalar,
+                  ossim_uint32 bands,
+                  ossim_uint32 width,
+                  ossim_uint32 height);
+
+   /** @brief virtual destructor */
+   virtual ~ossimImageData();
+
+   /**
+    * @brief assignment operator=
+    * @param rhs The data to assign from.
+    * @param A reference to this object.
+    */
+   virtual const ossimImageData& operator=(const ossimImageData &rhs);
+
+
+   /**
+    * @return The width of the data object.
+    */
+   virtual ossim_uint32 getWidth()const;
+
+   /**
+    * @return The height of the data object.
+    */
+   virtual ossim_uint32 getHeight()const;
+
+   /**
+    * @return The image rectangle relative to origin, height and width.
+    */
+   virtual ossimIrect getImageRectangle() const;
+   virtual void getWidthHeight(ossim_uint32& w, ossim_uint32& h);
+   virtual void setWidth(ossim_uint32 width);
+   virtual void setHeight(ossim_uint32 height);
+   virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h);
+   virtual void setImageRectangleAndBands(const ossimIrect& rect,
+                                          ossim_uint32 numberOfBands);
+   virtual void setImageRectangle(const ossimIrect& rect);
+   virtual void setOrigin(const ossimIpt& origin);   
+                                    
+   virtual void assign(const ossimDataObject* data);
+   virtual void assign(const ossimImageData* data);
+   virtual void assignBand(const ossimImageData* data,
+                           ossim_uint32 source_band,
+                           ossim_uint32 output_band);
+   
+   virtual ossimObject* dup() const;
+
+  /**
+   * Uses prime numbers as coefficients for this summation.  
+   * Take the the fours bytes of each origin and multiply 
+   * by the prime numbers and sum together.  This has
+   * been proven by others to give nicely distributed 
+   * id number.
+   */
+   virtual ossim_uint32 getHashId()const;
+   
+   virtual void setNullPix(ossim_float64 null_pix);
+   virtual void setNullPix(ossim_float64 null_pix, ossim_uint32 band);
+   virtual void setNullPix(const ossim_float64* nullPixArray,
+                           ossim_uint32 numberOfValues);
+   virtual void setMinPix(ossim_float64 min_pix);
+   virtual void setMinPix(ossim_float64 min_pix, ossim_uint32 band);
+   virtual void setMinPix(const ossim_float64* minPixArray,
+                          ossim_uint32 numberOfValues);
+   virtual void setMaxPix(ossim_float64 max_pix);
+   virtual void setMaxPix(ossim_float64 max_pix, ossim_uint32 band);
+   virtual void setMaxPix(const ossim_float64* maxPixArray,
+                          ossim_uint32 numberOfValues);
+
+   virtual const ossimIpt& getOrigin()const{return m_origin;}
+
+   /**
+    * If the minBands and maxBands are empty or not equal to the imageData's
+    * current number of bands it will erase the contents, resize, and then
+    * replace the values in the passed in array with this objects min max
+    * values.  If the arrays are the same size as this objects number of
+    * bands it will just update the values and use the current values in the
+    * arrays as initial min max values.
+    *
+    * If the status of this object(getDataObjectStatus()) is OSSIM_NULL or
+    * OSSIM_EMPTY no action is performed.
+    */
+   virtual void computeMinMaxPix(std::vector<ossim_float64>& minBands,
+                                 std::vector<ossim_float64>& maxBands) const;
+
+   /**
+    * @brief Scans tile for min, max, nulls.
+    * 
+    * If the nullBands, minBands and maxBands are empty or not equal to the
+    * imageData's current number of bands it will erase the contents, resize,
+    * and then replace the values in the passed in array with this objects
+    * min max values.  If the arrays are the same size as this objects number
+    * of bands it will just update the values and use the current values in the
+    * arrays as initial min max values.
+    *
+    * If the status of this object(getDataObjectStatus()) is OSSIM_NULL no
+    * action is performed.
+    */
+   virtual void computeMinMaxNulPix(
+      std::vector<ossim_float64>& minBands,
+      std::vector<ossim_float64>& maxBands,
+      std::vector<ossim_float64>& nulBands) const;
+   
+   virtual const ossim_float64* getNullPix()const;
+   virtual const ossim_float64* getMinPix()const;
+   virtual const ossim_float64* getMaxPix()const;
+   virtual ossim_float64        getNullPix(ossim_uint32 band) const;
+   virtual ossim_float64        getMinPix(ossim_uint32 band)  const;
+   virtual ossim_float64        getMaxPix(ossim_uint32 band)  const;
+
+   /**
+    * returns normalized minimum pixel value of band zero.
+    */
+   virtual ossim_float64   getMinNormalizedPix() const;
+   virtual ossimString     getScalarTypeAsString()const;
+   virtual ossim_uint32    getNumberOfBands() const;
+   virtual void            setNumberOfBands(ossim_uint32 bands,
+                                            bool reallocate=false);
+
+   /**
+    * Will return the pixel at location position.  Note it will first get
+    * the passed in position relative to the origin or upper left
+    * corner of this tile and then return the result.
+    */
+   virtual ossim_float64 getPix(const ossimIpt& position,
+                                ossim_uint32 band=0) const;
+
+   /**
+    * Will return the pixel at offset and band number.
+    */
+   virtual ossim_float64 getPix(ossim_uint32 offset,
+                                ossim_uint32 band = 0) const;
+   
+   /**
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, ossim_float64 value);
+
+   /**
+    * will fill all bands with the passed in
+    * value.
+    */
+   void fill(ossim_float64 value);
+
+   /**
+    * @brief Creates a step wedge for testing only.
+    *
+    * Writes line at a time of a single value, starting at scalar null,
+    * and going to scalar max in increments of scalar range/tile_lines.
+    */
+   void createTestTile();
+   
+   bool isNull(ossim_uint32 offset)const;
+   bool isNull(ossim_uint32 offset, ossim_uint32 band)const;
+   void setNull(ossim_uint32 offset);
+   void setNull(ossim_uint32 offset, ossim_uint32 band);
+
+   bool isNull(const ossimIpt& pt)const;
+   void setNull(const ossimIpt& pt);
+   bool isNull(const ossimIpt& pt, ossim_uint32 band)const;
+   void setNull(const ossimIpt& pt, ossim_uint32 band);
+   
+   virtual bool   isValidBand(ossim_uint32 band) const;
+   virtual ossimDataObjectStatus validate() const;
+
+   /**
+    * Will take this tile and normalize it to a newly
+    * allocated floating point tile.
+    */
+   virtual ossimRefPtr<ossimImageData> newNormalizedFloat()const;
+
+   /**
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   ossim_float32& result)const;
+
+   /**
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   ossim_float32 input);
+
+   /**
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+
+   /**
+    * Will take this tile and normalize it to a newly
+    * allocated double point tile.
+    */
+   virtual ossimImageData* newNormalizedDouble()const;
+
+   /**
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   template <class T> void copyTileToFloatBuffer(
+      T /* dummyTemplate*/, ossim_float32* buf)const
+   {
+     const ossim_uint32 SIZE  = getSizePerBand();
+     const ossim_uint32 BANDS = getNumberOfBands();
+
+     for(ossim_uint32 band = 0; band < BANDS; ++band)
+     {
+       const T* s = (T*)getBuf(band);  // source
+       ossim_float32* d = (ossim_float32*)(buf + (band*SIZE));  // destination
+
+       for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+       {
+         ossim_float32 p = s[offset];
+         d[offset] = p;
+       }
+     }
+   }
+
+   /**
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /**
+    * This will compute the average value for the band.
+    */
+   virtual ossim_float64 computeAverageBandValue(
+      ossim_uint32 bandNumber = 0) const;
+
+   /**
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  
+    */
+   virtual ossim_float64 computeMeanSquaredError(
+      ossim_float64 meanValue,
+      ossim_uint32 bandNumber = 0) const;
+  
+   virtual void populateHistogram(ossimRefPtr<ossimMultiBandHistogram> histo);
+
+   virtual void setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histo);
+   ossimRefPtr<ossimMultiResLevelHistogram> getHistogram();
+
+   /**
+    * @return true if alpha channel is initialized, false if not.
+    */
+   virtual bool hasAlpha() const;
+   
+   /**
+    * @return const ossim_uint8* to the alpha channel or null if the alpha
+    * channel was not computed.
+    */
+   virtual const ossim_uint8* getAlphaBuf() const;
+
+   /**
+    * @return ossim_uint8* to the alpha channel or null if the alpha channel
+    * was not computed.
+    */
+   virtual ossim_uint8* getAlphaBuf();
+
+   /**
+    * @return const void* to theDataBuffer
+    */
+   virtual const void* getBuf() const;
+   
+   /**
+    * @return const ossim_uint8* to theDataBuffer if scalar is of type
+    * OSSIM_UCHAR; else, NULL.
+    */
+   virtual const ossim_uint8*    getUcharBuf()  const;
+
+   /**
+    * @return const ossim_uint16* to theDataBuffer if scalar is of type
+    * OSSIM_USHORT16 or USHORT11; else, NULL.
+    */
+   virtual const ossim_uint16*   getUshortBuf() const;
+
+   /**
+    * @return const ossim_sint16* to theDataBuffer if scalar is of type
+    * OSSIM_SSHORT16; else, NULL.
+    */
+   virtual const ossim_sint16*   getSshortBuf() const;
+
+   /**
+    * @return const ossim_float32* to theDataBuffer if scalar is of type
+    * OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
+    */
+   virtual const ossim_float32*  getFloatBuf()  const;
+
+   /**
+    * @return const ossim_float64* to theDataBuffer if scalar is of type
+    * OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.
+    */
+   virtual const ossim_float64*  getDoubleBuf() const;
+
+   /**
+    * @return void* to theDataBuffer
+    */
+   virtual void* getBuf();
+   
+   /**
+    * @return ossim_uint8* to theDataBuffer if scalar is of type
+    * OSSIM_UCHAR; else, NULL.
+    */
+   virtual ossim_uint8*    getUcharBuf();
+   
+   /**
+    * @return ossim_uint16* to theDataBuffer if scalar is of type
+    * OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.
+    */
+   virtual ossim_uint16*   getUshortBuf();
+   
+   /**
+    * @return ossim_sint16* to theDataBuffer if scalar is of type
+    * OSSIM_SSHORT16; else, NULL.
+    */
+   virtual ossim_sint16*   getSshortBuf();
+
+   /**
+    * @return ossim_float32* to theDataBuffer if scalar is of type
+    * OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
+    */
+   virtual ossim_float32*  getFloatBuf();
+   
+   /**
+    * @return float64* to theDataBuffer if scalar is of type OSSIM_DOUBLE or
+    * OSSIM_NORMALIZED_DOUBLE; else, NULL.
+    */
+   virtual ossim_float64*  getDoubleBuf();
+
+   /**
+    * @param band (zero based)
+    * @return void* to theDataBuffer positioned at band.
+    */
+   virtual const void*           getBuf(ossim_uint32 band) const;
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_uint8* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_UCHAR; else, NULL.
+    */
+   virtual const ossim_uint8*    getUcharBuf(ossim_uint32 band) const;
+
+   /**
+    * @param band (zero based)
+    * @return ossim_uint16* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.
+    */
+   virtual const ossim_uint16*   getUshortBuf(ossim_uint32 band) const;
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_sint16* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_SSHORT16; else, NULL.
+    */
+   virtual const ossim_sint16*   getSshortBuf(ossim_uint32 band) const;
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_float32* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
+    */
+   virtual const ossim_float32*  getFloatBuf(ossim_uint32 band) const;
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_float64* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.
+    */
+   virtual const ossim_float64*  getDoubleBuf(ossim_uint32 band) const;
+
+   /**
+    * @param band (zero based)
+    * @return void* to theDataBuffer positioned at band.
+    */
+   virtual void*           getBuf(ossim_uint32 band);
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_uint8* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_UCHAR; else, NULL.
+    */
+   virtual ossim_uint8*    getUcharBuf(ossim_uint32 band);
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_uint16* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.
+    */
+   virtual ossim_uint16*   getUshortBuf(ossim_uint32 band);
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_sint16* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_SSHORT16; else, NULL.
+    */
+   virtual ossim_sint16*   getSshortBuf(ossim_uint32 band);
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_float32* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
+    */
+   virtual ossim_float32*  getFloatBuf(ossim_uint32 band);
+   
+   /**
+    * @param band (zero based)
+    * @return ossim_float64* to theDataBuffer positioned at band if scalar is
+    * of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.
+    */
+   virtual ossim_float64*  getDoubleBuf(ossim_uint32 band);
+   
+   /**
+    *  Returns the total number of pixels in a tile for all bands.
+    *  Note:  This is not in bytes but in pixels.
+    */
+   virtual ossim_uint32 getSize() const;
+
+   /**
+    *  Returns the number of pixels in a single band in a tile.
+    *  Note:  This is not in bytes but in pixels.
+    */
+   virtual ossim_uint32 getSizePerBand()const;
+
+   /**
+    *  Returns the number of bytes in single band of the tile.
+    */
+   virtual ossim_uint32 getSizePerBandInBytes() const;
+
+   virtual ossim_uint32 getDataSizeInBytes()const;
+
+   /**
+    * Returns the total number of bytes for all bands.
+    */
+   virtual ossim_uint32  getSizeInBytes() const;
+
+   /**
+    *  Initializes data to null pixel values.
+    */
+   virtual void makeBlank();
+
+   /**
+    *  Initialize the data buffer.
+    */
+   virtual void initialize();
+
+   /**
+    * @brief Writes tile to stream.
+    *
+    * This will write the buffer to file with an associated header file.
+    * Assuming a contiguous buffer in BSQ format.  Currently does not
+    * support converting to BIP or BIL or byte swapping but probably
+    * should add at some point.
+    *
+    * @param f File to write.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool write(const ossimFilename& f) const;
+
+   /**
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_float64* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_float32* buf)const;
+
+   /**
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    *
+    * @param band Zero based band to copy.
+    *
+    * @param buf Buffer to copy to.
+    */
+   virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band,
+                                               ossim_float64* buf) const;
+   
+   /**
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    *
+    * @param band Zero based band to copy.
+    *
+    * @param buf Buffer to copy to.
+    */
+   virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band,
+                                               ossim_float32* buf)const;
+
+   /**
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(ossim_float64* buf);
+   virtual void copyNormalizedBufferToTile(ossim_float32* buf);
+
+   /**
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    *
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           ossim_float64* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           ossim_float32* buf);
+
+   virtual bool isWithin(ossim_int32 x, ossim_int32 y);
+   virtual void setValue(ossim_int32 x, ossim_int32 y, ossim_float64 color);
+
+   virtual void loadBand(const void* src,
+                         const ossimIrect& src_rect,
+                         ossim_uint32 band);
+
+   virtual void loadBand(const void* src,
+                         const ossimIrect& src_rect,
+                         const ossimIrect& clip_rect,
+                         ossim_uint32 band);
+   
+   virtual void loadTile(const void* src,
+                         const ossimIrect& src_rect,
+                         ossimInterleaveType il_type);
+   virtual void loadTileWithAlpha(const void* src,
+                         const ossimIrect& src_rect,
+                         ossimInterleaveType il_type);
+
+   virtual void loadTile(const void* src,
+                         const ossimIrect& src_rect,
+                         const ossimIrect& clip_rect,                         
+                         ossimInterleaveType il_type);
+
+   virtual void nullTileAlpha(const ossim_uint8* src,
+                              const ossimIrect& src_rect,
+                              bool mutliplyAlphaFlag=false);
+   virtual void nullTileAlpha(const ossim_uint8* src,
+                              const ossimIrect& src_rect,
+                              const ossimIrect& clip_rect,
+                              bool multiplyAlphaFlag=false);
+   /**
+    * Will load a tile of different types.  If they
+    * are the same then it will call loadTile(void*...)
+    * method.  Note if they are of different types we
+    * will have to go through a much slower assign
+    * process by normalizing the right side and then
+    * unnormalizing to the destination type. For this
+    * method to work they both must have the same
+    * number of bands.
+    */
+   virtual void loadTile(const ossimImageData* src);
+   
+   virtual void loadTileFrom1Band(const ossimImageData* data);
+
+   virtual void loadTileFrom1Band(const void* src,
+                                  const ossimIrect& src_rect);
+   /**
+    * Specialized to load a tile from a short (16 bit scalar type) buffer.
+    * Performs byte swapping if swap_bytes is set to true.
+    */
+   virtual void loadShortBand(const void* src,
+                              const ossimIrect& src_rect,
+                              ossim_uint32 band,
+                              bool swap_bytes=false);
+
+   /**
+    * This routine is designed for overwriting a selected band of the 
+    * destination buffer 'dest' by an independent selected band of the
+    * source buffer according to a user-selected rule, defined by 
+    * OverwriteBandRule.
+    *
+    * Currently the rules available in OverwriteBandRule are: 
+    *
+    * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten if *any* 
+    * one of the other bands of the same destination pixel have color values 
+    * that deviate from its color. Same as the deprecated COLOR_DISCREPANCY.
+    *
+    * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten only if 
+    * *all* of the other bands of the same destination pixel have color values
+    * that deviate from its color. 
+    *
+    * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten if 
+    * *any* one of the other bands of the same destination pixel have color 
+    * values that are equal to the color of the selected band of the source
+    * pixel. 
+    *
+    * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten only if 
+    * *all* of the other bands of the same destination pixel have color 
+    * values that are equal to the color of the selected band of the source
+    * pixel. 
+    *
+    * The NULL_RULE rule directs that the selected band of the 
+    * destination buffer is to be overwritten by the selected band of the 
+    * source image data (no questions asked).
+    *
+    * @note: The 'dest' buffer should have at least the same number of bands 
+    * as the 'src' object. 
+    *
+    * Currently this routine is only implemented for il_type set to OSSIM_BSQ.
+    *
+    * @param dest      The destination buffer, which should have at least the 
+    * same number of bands as the 'src' object.
+    * @param src_band  The 0-based band of the source image data.
+    * @param dest_band The 0-based band of the dest buffer.
+    * @param dest_rect The rectangle of the destination buffer.
+    * @param il_type   The interleave type. Only OSSIM_BSQ available.
+    * @param ow_type   The rule for overwriting the destination buffer.
+    */
+   virtual void unloadBand( void* dest,
+                            ossim_uint32 src_band,
+                            ossim_uint32 dest_band,
+                            const ossimIrect& dest_rect,
+                            ossimInterleaveType il_type=OSSIM_BSQ,
+                            OverwriteBandRule ow_type=NULL_RULE ) const;
+
+   /**
+    * This routine is designed for overwriting a selected band of the 
+    * destination buffer 'dest' by an independent selected band of the
+    * source buffer according to a user-selected rule, defined by 
+    * OverwriteBandRule.
+    *
+    * Currently the rules available in OverwriteBandRule are: 
+    *
+    * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten if *any* 
+    * one of the other bands of the same destination pixel have color values 
+    * that deviate from its color. Same as the deprecated COLOR_DISCREPANCY.
+    *
+    * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten only if 
+    * *all* of the other bands of the same destination pixel have color values
+    * that deviate from its color. 
+    *
+    * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten if 
+    * *any* one of the other bands of the same destination pixel have color 
+    * values that are equal to the color of the selected band of the source
+    * pixel. 
+    *
+    * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected 
+    * band of a pixel of the destination buffer is to be overwritten only if 
+    * *all* of the other bands of the same destination pixel have color 
+    * values that are equal to the color of the selected band of the source
+    * pixel. 
+    *
+    * The NULL_RULE rule directs that the selected band of the 
+    * destination buffer is to be overwritten by the selected band of the 
+    * source image data (no questions asked).
+    *
+    * @note: The 'dest' buffer should have at least the same number of bands 
+    * as the 'src' object. 
+    *
+    * Currently this routine is only implemented for il_type set to OSSIM_BSQ.
+    *
+    * @param dest      The destination buffer, which should have at least the 
+    * same number of bands as the 'src' object.
+    * @param src_band  The 0-based band of the source image data.
+    * @param dest_band The 0-based band of the dest buffer.
+    * @param dest_rect The rectangle of the destination buffer.
+    * @param clip_rect Only data within will be copied.
+    * @param il_type   The interleave type. Only OSSIM_BSQ available.
+    * @param ow_type   The rule for overwriting the destination buffer.
+    */
+   virtual void unloadBand( void* dest,
+                            ossim_uint32 src_band,
+                            ossim_uint32 dest_band,
+                            const ossimIrect& dest_rect,
+                            const ossimIrect& clip_rect,
+                            ossimInterleaveType il_type=OSSIM_BSQ,
+                            OverwriteBandRule ow_type=NULL_RULE ) const;
+
+   /**
+    * @param dest The destination buffer.  It is assumed this is a single band
+    * and the size of dest_rect.
+    * @param dest_rect The rectangle of the destination buffer.
+    * @param src_band The band to copy (unload) from the tile.
+    */
+   virtual void unloadBand(void* dest,
+                           const ossimIrect& dest_rect,
+                           ossim_uint32 src_band) const;
+
+   /**
+    * @param dest The destination buffer.  It is assumed this is a single band
+    * and the size of dest_rect.
+    * @param dest_rect The rectangle of the destination buffer.
+    * param clip_rect Only data within the clip_rect will be copied.
+    * @param src_band The band to copy (unload) from the tile.
+    */
+   virtual void unloadBand(void* dest,
+                           const ossimIrect& dest_rect,
+                           const ossimIrect& clip_rect,
+                           ossim_uint32 src_band) const;
+   
+   virtual void unloadTile(void* dest,
+                           const ossimIrect& dest_rect,
+                           ossimInterleaveType il_type ) const;
+
+   virtual void unloadTile(void* dest,
+                           const ossimIrect& dest_rect,
+                           const ossimIrect& clip_rect,
+                           ossimInterleaveType il_type) const;
+
+   /**
+    * @param dest The destination buffer.
+    * @param dest_rect The rectangle of the destination buffer.
+    * param clip_rect Only data within the clip_rect will be copied.
+    * @param src_band The band to copy (unload) from the tile.
+    */
+   virtual void unloadTileToBipAlpha(void* dest,
+                                     const ossimIrect& dest_rect,
+                                     const ossimIrect& clip_rect) const;
+   
+   virtual bool isPointWithin(const ossimIpt& point)const;
+   virtual bool isPointWithin(ossim_int32 x,
+                              ossim_int32 y)const;
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief Performs linear stretch on tile data from min/max to limits of
+    * scalar type.
+    */
+   virtual void stretchMinMax();
+
+   /**
+    * @brief Computes the alpha channel.
+    *
+    * For each pixel if any band value is not null then alpha will be 255;
+    * else, 0.
+    */
+   virtual void computeAlphaChannel();
+
+   /**
+    * @brief Method to copy a single line to the tile.
+    *
+    * This will copy a line to the tile.  It is assumed that all bands are in
+    * the buffer "src".  Only pixels within the tile rect will be copied.
+    * Note that all coordinates are relative to the tile coordinates.
+    * Clipping will be performed on pixels outside of the tile rectangle.
+    * No fill is added if a partial tile line is copied so callers
+    * should do a ossimImageData::makeBlank if the whole tile is not to be
+    * stuffed.  ossimImageData::validate should be called after all lines
+    * are copied if in doubt of a full tile.
+    *
+    * @param src The source buffer or line to copy containing all bands.
+    *
+    * @param lineNumber Line number to copy.
+    *
+    * @param lineStartSample The start sample of the source buffer relative
+    * to tile coordinates.
+    *
+    * @param lineStopSample The stop sample of the source buffer relative
+    * to tile coordinates.
+    *
+    * @param lineInterleave Interleave of src buffer.  If OSSIM_BIP assumed
+    * rgbrgbrgb; else, red row, green row, blue row.
+    *
+    * Usage example in method: ossimTiffTileSource::loadFromScanLine
+    */
+   virtual void copyLine(const void* src,
+                         ossim_int32 lineNumber,
+                         ossim_int32 lineStartSample,
+                         ossim_int32 lineStopSample,
+                         ossimInterleaveType lineInterleave);
+
+   /**
+    * @brief Sets the indexed flag.
+    *
+    * This indicates the data contains palette indexes.  Default is false.
+    * 
+    * @param flag If true data is indexed.
+    */
+   void setIndexedFlag(bool flag);
+
+   /** @return The indexed flag. */
+   bool getIndexedFlag() const;
+   
+   /**
+    * Returns the percentage (0-100) of data buffer containing non-null (valid) entries.
+    * Undefined until validate() is called.
+    */
+   ossim_float64 percentFull() const { return m_percentFull; }
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+protected:
+   /** @brief Templated copy line method. */
+   template <class T> void copyLineTemplate(T dummyTemplate,
+                                            const void* src,
+                                            ossim_int32 lineNumber,
+                                            ossim_int32 lineStartSample,
+                                            ossim_int32 lineStopSample,
+                                            ossimInterleaveType lineInterleave);
+   
+   /**
+    * @brief Templated stretch method.
+    *
+    * Performs linear stretches on tile data from min/max to limits of
+    * scalar type.
+    */
+   template <class T> void stretchMinMax(T dummyTemplate);
+
+   /**
+    * @brief Templated compute alpha channel.
+    *
+    * For each pixel if any band value is not null then alpha will be 255;
+    * else, 0.
+    */
+   template <class T> void computeAlphaChannel(T dummyTemplate);   
+
+   /**
+    * Templated validate method.
+    *
+    * @return The status of the ossimImageDataMethod.
+    *
+    * @note See ossimConstants.h for ossimDataObjectStatus enumerations.
+    */
+   template <class T> ossimDataObjectStatus validate(T dummyTemplate) const;
+
+   /**
+    * Templated makeBlank method.
+    */
+   template <class T> void makeBlank(T dummyTemplate);
+
+   /**
+    * Templated computeMeanSquaredError method.
+    */
+   template <class T>
+      ossim_float64 computeMeanSquaredError(T dummyTemplate,
+                                            ossim_float64 meanValue,
+                                            ossim_uint32 bandNumber) const;
+
+   /**
+    * Templated computeAverageBandValue method.
+    */
+   template <class T>
+      ossim_float64 computeAverageBandValue(T dummyTemplate,
+                                            ossim_uint32 bandNumber) const;
+   
+   void loadTileFromBip(const void* src, const ossimIrect& src_rect);
+   void loadTileFromBipAlpha(const void* src, const ossimIrect& src_rect);
+   void loadTileFromBil(const void* src, const ossimIrect& src_rect);
+   void loadTileFromBsq(const void* src, const ossimIrect& src_rect);
+
+   void loadTileFromBip(const void* src,
+                        const ossimIrect& src_rect,
+                        const ossimIrect& clip_rect);
+   void loadTileFromBil(const void* src,
+                        const ossimIrect& src_rect,
+                        const ossimIrect& clip_rect);
+   void loadTileFromBsq(const void* src,
+                        const ossimIrect& src_rect,
+                        const ossimIrect& clip_rect);
+
+   void unloadTileToBip(void* dest,
+                        const ossimIrect& dest_rect,
+                        const ossimIrect& clip_rect) const;
+   void unloadTileToBil(void* dest,
+                        const ossimIrect& dest_rect,
+                        const ossimIrect& clip_rect) const;
+   void unloadTileToBsq(void* dest,
+                        const ossimIrect& dest_rect,
+                        const ossimIrect& clip_rect) const;
+
+   /**
+    * Called from public unloadBand() routines that have an 
+    * OverwriteBandRule interface.
+    *
+    * @param dest      The destination buffer.
+    * @param src_band  The 0-based band of the source image data.
+    * @param dest_band The 0-based band of the destination buffer.
+    * @param dest_rect The rectangle of the destination buffer.
+    * @param clip_rect Only data within will be copied.
+    * @param ow_type   The rule for overwriting the destination buffer.
+    */
+   virtual void unloadBandToBsq( void* dest,
+                                 ossim_uint32 src_band,
+                                 ossim_uint32 dest_band,
+                                 const ossimIrect& dest_rect,
+                                 const ossimIrect& clip_rect,
+                                 OverwriteBandRule ow_type=NULL_RULE ) const;
+
+   /**
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   template <class T>
+   void copyTileToNormalizedBuffer(T dummyTemplate,
+                                   ossim_float64* buf) const;
+   template <class T>
+   void copyTileToNormalizedBuffer(T dummyTemplate,
+                                   ossim_float32* buf)const;
+
+   /**
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   template <class T>
+   void copyTileToNormalizedBuffer(T dummyTemplate,
+                                   ossim_uint32 band, ossim_float64* buf) const;
+   template <class T>
+   void copyTileToNormalizedBuffer(T dummyTemplate,
+                                   ossim_uint32 band, ossim_float32* buf)const;
+
+   /**
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   template <class T>
+   void copyNormalizedBufferToTile(T dummyTemplate,
+                                   ossim_float64* buf);
+   template <class T>
+   void copyNormalizedBufferToTile(T dummyTemplate,
+                                   ossim_float32* buf);
+   template <class T>
+   void copyNormalizedBufferToTile(T dummyTemplate,
+                                   ossim_uint32 band,
+                                   ossim_float64* buf);
+   template <class T>
+   void copyNormalizedBufferToTile(T dummyTemplate,
+                                   ossim_uint32 band,
+                                   ossim_float32* buf);
+
+   
+   template <class T>
+   void computeMinMaxPix(T dummyValue,
+                         std::vector<ossim_float64>& minBands,
+                         std::vector<ossim_float64>& maxBands) const;
+
+   template <class T>
+   void computeMinMaxNulPix(T dummyValue,
+                            std::vector<ossim_float64>& minBands,
+                            std::vector<ossim_float64>& maxBands,
+                            std::vector<ossim_float64>& nulBands) const;
+   
+   template <class T> void loadBandTemplate(T, // dummy template variable
+                                            const void* src,
+                                            const ossimIrect& src_rect,
+                                            ossim_uint32 band);
+
+   template <class T> void loadBandTemplate(T, // dummy template variable
+                                            const void* src,
+                                            const ossimIrect& src_rect,
+                                            const ossimIrect& clip_rect,
+                                            ossim_uint32 band);
+
+   template <class T> void nullTileAlphaTemplate(T,
+                                                 const ossim_uint8* src,
+                                                 const ossimIrect& src_rect,
+                                                 const ossimIrect& clip_rect,
+                                                 bool multiplyAlphaFlag=false);
+   
+   template <class T> void loadTileFromBipTemplate(T, // dummy template variable
+                                                   const void* src,
+                                                   const ossimIrect& src_rect);
+   template <class T> void loadTileFromBipAlphaTemplate(T, // dummy template variable
+                                                   const void* src,
+                                                   const ossimIrect& src_rect);
+
+   template <class T> void loadTileFromBipTemplate(T, // dummy template variable
+                                                   const void* src,
+                                                   const ossimIrect& src_rect,
+                                                   const ossimIrect& clip_rect);
+    template <class T>
+    void loadTileFromBipAlphaTemplate(T, // dummy template variable
+                                                 const void* src,
+                                                 const ossimIrect& src_rect,
+                                                 const ossimIrect& clip_rect);
+   
+   template <class T> void loadTileFromBilTemplate(T, // dummy template variable
+                                                   const void* src,
+                                                   const ossimIrect& src_rect);
+   
+   template <class T> void loadTileFromBilTemplate(T, // dummy template variable
+                                                   const void* src,
+                                                   const ossimIrect& src_rect,
+                                                   const ossimIrect& clip_rect);
+   
+   template <class T> void loadTileFromBsqTemplate(T, // dummy template variable
+                                                   const void* src,
+                                                   const ossimIrect& src_rect);
+   
+   template <class T> void loadTileFromBsqTemplate(T, // dummy template variable
+                                                   const void* src,
+                                                   const ossimIrect& src_rect,
+                                                   const ossimIrect& clip_rect);
+   
+   template <class T> void unloadTileToBipTemplate(T, // dummy template variable
+                                                   void* dest,
+                                                   const ossimIrect& dest_rect,
+                                                   const ossimIrect& clip_rect) const;
+
+   template <class T> void unloadTileToBipAlphaTemplate(T, // dummy template variable
+                                                        void* dest,
+                                                        const ossimIrect& dest_rect,
+                                                        const ossimIrect& clip_rect) const;
+
+   template <class T> void unloadTileToBilTemplate(T, // dummy template variable
+                                                   void* dest,
+                                                   const ossimIrect& dest_rect,
+                                                   const ossimIrect& clip_rect) const;
+
+   template <class T> void unloadTileToBsqTemplate(T, // dummy template variable
+                                                   void* dest,
+                                                   const ossimIrect& dest_rect,
+                                                   const ossimIrect& clip_rect) const;
+
+   template <class T> void unloadBandTemplate(T, // dummy template variable
+                                              void* dest,
+                                              const ossimIrect& dest_rect,
+                                              const ossimIrect& clip_rect,
+                                              ossim_uint32 band) const;
+
+   template <class T> void unloadBandToBsqTemplate(T, // dummy template variable
+                                                   void* dest,
+                                                   ossim_uint32 src_band,
+                                                   ossim_uint32 dest_band,
+                                                   const ossimIrect& dest_rect,
+                                                   const ossimIrect& clip_rect,
+                                                   OverwriteBandRule ow_type=NULL_RULE) const;
+
+   /**
+    * @brief Creates a test tile for scalar type for testing only.
+    *
+    * Protected template implementation of matching public createTestTile.
+    */
+   template <class T> void createTestTile(T);
+   
+   /**
+    * @brief initializeDefaults() Resizes and sets min/max/null arrays to
+    * number of bands and some default value for scalar type.
+    */
+   virtual void initializeDefaults();
+
+   /**
+    * @brief initializeMinDefault() Resizes theMinPixelValue array to number
+    * of bands and initializes to the default min for scalar type.
+    */
+   virtual void initializeMinDefault();
+
+   /**
+    * @brief initializeMaxDefault() Resizes theMaxPixelValue array to number
+    * of bands and initializes to the default max for scalar type.
+    */
+   virtual void initializeMaxDefault();
+
+   /**
+    * @brief initializeNullDefault() Resizes theNullPixelValue array to number
+    * of bands and initializes to the default null for scalar type.
+    */
+   virtual void initializeNullDefault();
+
+   virtual bool isEqualTo(const ossimDataObject& rhs,
+                          bool deepTest=false)const;
+   
+   bool hasSameDimensionsAs(ossimImageData* data)const
+   {
+      bool result = false;
+      if(data)
+      {
+         result = ((m_spatialExtents.size() ==
+                    data->m_spatialExtents.size())&&
+                   (m_spatialExtents[0] == data->m_spatialExtents[0])&&
+                   (m_spatialExtents[1] == data->m_spatialExtents[1])&&
+                   (m_scalarType == data->m_scalarType));
+      }
+      return result;
+   }
+   
+   /**  Null pixel value for each band. */
+   std::vector<ossim_float64> m_nullPixelValue;
+
+   /** Min pixel value for each band. */
+   std::vector<ossim_float64> m_minPixelValue;
+
+   /** Max pixel value for each band. */
+   std::vector<ossim_float64> m_maxPixelValue;
+
+   /** Alpha channel */
+   std::vector<ossim_uint8> m_alpha;
+   
+   ossimIpt m_origin;
+
+   /** Indicates data contains palette indexes. */
+   bool m_indexedFlag;
+
+   ossimRefPtr<ossimMultiResLevelHistogram> m_histogram;
+
+   /** percentage (0-100) of image tile that has valid (non-null) pixel values. This is computed
+    * in validate() method.
+    */
+   mutable ossim_float64 m_percentFull;
+
+private:
+
+   
+TYPE_DATA
+};
+
+inline bool ossimImageData::hasAlpha() const
+{
+   return (m_alpha.size()?true:false);
+}
+
+inline ossimIrect ossimImageData::getImageRectangle() const
+{
+   ossimIpt lr(m_origin.x + getWidth()  - 1,
+               m_origin.y + getHeight() - 1);
+   
+   return ossimIrect(m_origin, lr);
+}
+
+inline const ossim_float64* ossimImageData::getNullPix()const
+{
+   return ( m_nullPixelValue.size() > 0 ? &m_nullPixelValue.front() : 0 );
+}
+
+inline const ossim_float64* ossimImageData::getMinPix()const
+{
+   return ( m_minPixelValue.size() > 0 ? &m_minPixelValue.front() : 0 );
+}
+
+inline const ossim_float64* ossimImageData::getMaxPix()const
+{
+   return ( m_maxPixelValue.size() > 0 ? &m_maxPixelValue.front() : 0 );
+}
+
+inline ossim_float64 ossimImageData::getNullPix(ossim_uint32 band) const
+{
+   return ( band < m_nullPixelValue.size() ? m_nullPixelValue[band] :
+            ossim::defaultNull( getScalarType() ) );
+}
+      
+inline ossim_float64 ossimImageData::getMinPix(ossim_uint32 band) const
+{
+   return ( band < m_minPixelValue.size() ? m_minPixelValue[band] :
+            ossim::defaultMin( getScalarType() ) );
+}
+
+inline ossim_float64 ossimImageData::getMaxPix(ossim_uint32 band) const
+{
+   return ( band < m_maxPixelValue.size() ? m_maxPixelValue[band] :
+            ossim::defaultMax( getScalarType() ) );
+}
+
+inline ossim_uint32 ossimImageData::getHashId()const
+{
+   const unsigned char *bufx = (unsigned char*)(&m_origin.x);
+   const unsigned char *bufy = (unsigned char*)(&m_origin.y);
+   return (ossim_uint32)(bufx[0]*101 + bufx[1]*103 +
+                         bufx[2]*107 + bufx[3]*109 +
+                         bufy[0]*139 + bufy[1]*149 +
+                         bufy[2]*151 + bufy[3]*157);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimImageDataFactory.h b/include/ossim/imaging/ossimImageDataFactory.h
new file mode 100644
index 0000000..d04110c
--- /dev/null
+++ b/include/ossim/imaging/ossimImageDataFactory.h
@@ -0,0 +1,63 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description:
+//
+//*************************************************************************
+// $Id: ossimImageDataFactory.h 13474 2008-08-22 14:20:42Z gpotts $
+#ifndef ossimImageDataFactory_HEADER
+#define ossimImageDataFactory_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <OpenThreads/Mutex>
+class ossimSource;
+class ossimImageSource;
+
+
+/*!
+ * This factory should be called by all image source producers to allocate
+ * an image tile.
+ */
+class OSSIM_DLL ossimImageDataFactory
+{
+public:
+   virtual ~ossimImageDataFactory();
+   static ossimImageDataFactory* instance();
+
+   virtual ossimRefPtr<ossimImageData> create(ossimSource* owner,
+                                              ossimScalarType scalar,
+                                              ossim_uint32 bands = 1)const;
+
+   virtual ossimRefPtr<ossimImageData> create(ossimSource* owner,
+                                              ossimScalarType scalar,
+                                              ossim_uint32 bands,
+                                              ossim_uint32 width,
+                                              ossim_uint32 height)const;
+   
+   virtual ossimRefPtr<ossimImageData> create(
+      ossimSource* owner,
+      ossim_uint32 bands,
+      ossimImageSource* inputSource)const;
+   
+   
+   virtual ossimRefPtr<ossimImageData> create(
+      ossimSource* owner,
+      ossimImageSource* inputSource)const;
+   
+protected:
+   ossimImageDataFactory(); // hide
+   ossimImageDataFactory(const ossimImageDataFactory&){}//hide
+   void operator = (ossimImageDataFactory&){}// hide
+   
+   static ossimImageDataFactory* theInstance;
+   static OpenThreads::Mutex theInstanceMutex;
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimImageDataHelper.h b/include/ossim/imaging/ossimImageDataHelper.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageDataHelper.h
rename to include/ossim/imaging/ossimImageDataHelper.h
diff --git a/ossim/include/ossim/imaging/ossimImageDisplayWriter.h b/include/ossim/imaging/ossimImageDisplayWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageDisplayWriter.h
rename to include/ossim/imaging/ossimImageDisplayWriter.h
diff --git a/include/ossim/imaging/ossimImageFileWriter.h b/include/ossim/imaging/ossimImageFileWriter.h
new file mode 100644
index 0000000..b345917
--- /dev/null
+++ b/include/ossim/imaging/ossimImageFileWriter.h
@@ -0,0 +1,499 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Frank Warmerdam (warmerdam at pobox.com)
+//
+// Description:
+//
+// Contains class declaration for ossimImageWriter
+//*******************************************************************
+//  $Id: ossimImageFileWriter.h 21963 2012-12-04 16:28:12Z dburken $
+
+#ifndef ossimImageFileWriter_HEADER
+#define ossimImageFileWriter_HEADER
+#include <fstream>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/imaging/ossimImageWriter.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimObjectEvents.h>
+#include <ossim/base/ossimProcessProgressEvent.h>
+#include <ossim/base/ossimViewController.h>
+
+/**
+ * Pure virtual base class for image file writers.
+ *
+ * There is normally one subclass of this class for each format supported
+ * for writing.  This class roughly corresponds to the ImageHandler class
+ * used for reading images.  Format specific ossimImageWriter's are normally
+ * instantiated by the ossimImageWriterFactory::createWriterInstance() method.
+ * ossimImageWriters should not be directly instantiated by application code.
+ */
+class OSSIMDLLEXPORT ossimImageFileWriter
+   :  public ossimImageWriter,
+      public ossimProcessInterface,
+      public ossimConnectableObjectListener
+{   
+public:
+
+   /**
+    * The writer will own the sequencer.
+    */
+   ossimImageFileWriter(const ossimFilename& filename = ossimFilename(),
+                        ossimImageSource* inputSource=0,
+                        ossimObject* owner=0);
+   virtual ~ossimImageFileWriter();
+   
+   
+   virtual ossimObject* getObject();
+
+   virtual const ossimObject* getObject()const;
+
+   /**
+    * void getImageTypeList(std::vector<ossimString>& imageTypeList)const
+    *
+    * pure virtual
+    * 
+    * Appends the writers image types to the "imageTypeList".
+    * 
+    * This is the actual image type name.  So for
+    * example, ossimTiffWriter has several image types.  Some of these
+    * include TIFF_TILED, TIFF_TILED_BAND_SEPARATE ... etc.
+    * The ossimGdalWriter
+    * may include GDAL_IMAGINE_HFA, GDAL_RGB_NITF, GDAL_JPEG20000, ... etc.
+    *
+    * @param imageTypeList stl::vector<ossimString> list to append to.
+    *
+    * @note All writers should append to the list, not, clear it and then add
+    * their types.
+    */
+   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const=0;
+
+   /**
+    * Returns a 3-letter extension from the image type descriptor 
+    * (theOutputImageType) that can be used for image file extensions.
+    *
+    * @param imageType string representing image type.
+    *
+    * @return the 3-letter string extension.
+    */
+   virtual ossimString getExtension() const;
+
+   /**
+    * Examples of writers that always generate internal
+    * overviews are ossim_kakadu_jp2 and ossim_kakadu_nitf_j2k.
+    *
+    * @return true if the output of the writer will have
+    * internal overviews. The default is false. 
+    */
+   virtual bool getOutputHasInternalOverviews( void ) const;
+
+   /**
+    * bool hasImageType(const ossimString& imageType) const
+    *
+    * @param imageType string representing image type.
+    *
+    * @return true if "imageType" is supported by writer.
+    */
+   virtual bool hasImageType(const ossimString& imageType) const;
+
+   /**
+    * Sets the output image tiling size if supported by the writer.  If not
+    * supported this simply sets the sequencer(input) tile size.
+    */
+   virtual void setTileSize(const ossimIpt& tileSize);
+
+   /**
+    * Will write an envi header file.  If "theFilename" is "foo.tif"
+    * then this will write out "foo.hdr".
+    */
+   virtual bool writeEnviHeaderFile() ;
+
+   /**
+    * Will write an ER Mapper header file.  If "theFilename" is "foo.tif"
+    * then this will write out "foo.hdr".
+    */
+   virtual bool writeErsHeaderFile() ;
+
+   /**
+    * Will write an external geometry file.  If "theFilename" is "foo.tif"
+    * then this will write out "foo.geom".
+    */
+   virtual bool writeExternalGeometryFile() ;
+
+   /**
+    * Will write an fgdc file.  If "theFilename" is "foo.tif"
+    * then this will write out "foo.xml".
+    */
+   virtual bool writeFgdcFile() ;
+
+   /**
+    * Returns true on success, false on error.
+    */
+   virtual bool writeHistogramFile() ;
+
+   /**
+    * Will write a jpeg world file.  If "theFilename" is "foo.tif"
+    * then this will write out "foo.jpw".
+    */
+   virtual bool writeJpegWorldFile() ;
+
+   /**
+    * Write out an ossim overview file from the source_file.
+    * If source file is "foo.tif", this will create a "foo.ovr" in
+    * the same directory.
+    *
+    * @param source_file The file to create overview from.
+    *
+    * @param tiff_compress_type valid types:
+    * - COMPRESSION_JPEG
+    * - COMPRESSION_DEFLATE
+    * - COMPRESSION_PACKBITS
+    * - COMPRESSION_NONE=1 (default)
+    *
+    * @param jpeg_compress_quality Compression quality.  Only valid with
+    * COMPRESSION_JPEG. Range 1 to 100 with 100 being the best.
+    * default = 75
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool writeOverviewFile(ossim_uint16 tiff_compress_type = 1,
+                                  ossim_int32 jpeg_compress_quality = 75,
+                                  bool includeR0 = false );
+
+   /**
+    * Will write a readme file.  If "theFilename" is "foo.tif"
+    * then this will write out "foo_readme.txt".
+    */
+   virtual bool writeReadmeFile() ;
+
+   /**
+    * Will write a world file.  If "theFilename" is "foo.tif"
+    * then this will write out "foo.tfw".
+    */
+   virtual bool writeTiffWorldFile() ;
+
+   /**
+    * Will write a world file.  The extension will be derived from the
+    * image extension.
+    *
+    * Currently handles the following image extensions:
+    * 
+    * "tif" or "tiff" -> "tfw"
+    * "jpg" of "jpeg" -> "jpw"
+    * "png" -> "pgw"
+    * "sid" -> "sdw"
+    *
+    * If extension does not match one of the above no file will be written
+    * and false will be returned.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool writeWorldFile() ;
+
+   /**
+    * Convenience method that calls meta data write methods that are flagged
+    * to be called.  Attempts to write all files flagged to be written even
+    * if one file writer returns false.
+    *
+    * Currently calls these methods if flagged:
+    * writeEnviHeaderFile
+    * writeExternalGeometryFile
+    * writeFgdcFile
+    * writeJpegWorldFile
+    * writeReadmeFile
+    * writeTiffWorldFile
+    * writeOverviewFile
+    * writeHistogramFile
+    *
+    * @return true if all files flagged are written, false if not.
+    */
+   virtual bool writeMetaDataFiles() ;
+
+   virtual void setAreaOfInterest(const ossimIrect& inputRect);
+
+   /**
+    * @brief Sets the sequencer and connects it to the input of this.
+    *
+    * This does not set the area of interest.  Note stored as an ossimRefPtr.
+    *
+    * @param sequencer Pointer to a sequencer.
+    */
+   virtual void changeSequencer(ossimImageSourceSequencer* sequencer);
+
+   virtual ossimImageSourceSequencer* getSequencer();
+
+   /**
+    * @brief Initialize method.
+    *
+    * Calls theInputConnection->initialize() then syncs area of interest(AOI)
+    * with ossimImageWriter::theAreaOfInterest taking precedence over
+    * ossimImageSourceSequencer::theAreaOfInterest.
+    */
+   virtual void initialize();
+
+   /**
+    * Calls:
+    * writeFile()
+    * writeMetaDataFiles()
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool execute();
+
+   /**
+    * @brief Method to write the image to a stream.
+    *
+    * This implementation does nothing and returns false.
+    * Derived classed should implement as needed.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool writeStream();
+
+   /**
+    * @brief Sets the output stream to write to.
+    *
+    * This implementation in this class does nothing and returns false.
+    * Derived classed should implement as needed.
+    *
+    * @param stream The stream to write to.
+    *
+    * @return true if object can write to stream, false if not.
+    */
+   virtual bool setOutputStream(ossimRefPtr<ossimOStream> stream);
+
+   /** tmp drb */
+   virtual bool setOutputStream(std::ostream& str);
+
+   /**
+    * @brief Method to return the stream attached to output.
+    *
+    * This implementation in this class does nothing and returns an empty
+    * ossimRefPtr<ossimOStream>.
+    * Derived classed should implement as needed.
+    * 
+    * @return The stream wrapped around a ref pointer.
+    */
+   virtual ossimRefPtr<ossimOStream> getOutputStream() const;
+   
+   virtual void setPercentComplete(double percentComplete);
+
+   virtual void  setOutputImageType(ossim_int32 type);
+   virtual void  setOutputImageType(const ossimString& type);
+   virtual ossim_int32 getOutputImageType() const;
+   virtual ossimString getOutputImageTypeString() const;
+   
+   virtual void setOutputName(const ossimString& outputName);
+
+   virtual void setFilename(const ossimFilename& file);
+
+   virtual const ossimFilename& getFilename()const;
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+
+   virtual bool canConnectMyInputTo(ossim_int32 inputIndex,
+                                    const ossimConnectableObject* object)const;
+   
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+   virtual void propertyEvent(ossimPropertyEvent& event);
+
+   /**
+    * Control flags...
+    */
+
+   virtual bool         getWriteImageFlag()            const;
+   virtual bool         getWriteHistogramFlag()        const;
+   virtual bool         getWriteOverviewFlag()         const;
+   virtual bool         getScaleToEightBitFlag()       const;
+
+   virtual bool         getWriteEnviHeaderFlag()       const;
+   virtual bool         getWriteErsHeaderFlag()        const;   
+   virtual bool         getWriteExternalGeometryFlag() const;
+   virtual bool         getWriteFgdcFlag()             const;
+   virtual bool         getWriteJpegWorldFileFlag()    const;
+   virtual bool         getWriteReadmeFlag()           const;
+   virtual bool         getWriteTiffWorldFileFlag()    const;
+   virtual bool         getWriteWorldFileFlag()        const;
+
+   virtual void         setWriteImageFlag(bool flag);
+   virtual void         setWriteOverviewFlag(bool flag);
+   virtual void         setWriteHistogramFlag(bool flag);
+   virtual void         setScaleToEightBitFlag(bool flag);
+
+   virtual void         setWriteEnviHeaderFlag(bool flag);
+   virtual void         setWriteErsHeaderFlag(bool flag); 
+   virtual void         setWriteExternalGeometryFlag(bool flag);
+   virtual void         setWriteFgdcFlag(bool flag);
+   virtual void         setWriteJpegWorldFile(bool flag);
+   virtual void         setWriteReadme(bool flag);
+   virtual void         setWriteTiffWorldFile(bool flag);
+   virtual void         setWriteWorldFile(bool flag);
+   
+   virtual ossim_uint16 getOverviewCompressType() const;
+   virtual ossim_int32  getOverviewJpegCompressQuality() const;
+
+   virtual void         setOverviewCompressType(ossim_uint16 type);
+   virtual void         setOverviewJpegCompressQuality(ossim_int32 quality);
+
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * Overrides base "addListener" this will capture the pointer and then call
+    * the base class "addListener".  If overview building is enabled, the
+    * listener will be passed to the overview builder::addListener, and
+    * subsequently removed from the overview builder after the build overview
+    * call is complete.  This it transparent to the caller of this method.
+    *
+    * @param listener The listener to add.
+    *
+    * @return Currently always returns true.
+    *
+    * @note Callers still should call "removeListener" after the writing
+    * process is complete.
+    *
+    * @note If called more than once, theProgressListener will contain
+    * the latest listener.
+    */
+   virtual bool addListener(ossimListener* listener);
+
+   /**
+    * Overrides base "removeListener".  Calls base "removeListener which will
+    * find and removes the listener.
+    * If "theProgressListener" pointer matches listener "theProgressListener"
+    * will be set to NULL.
+    *
+    * @param listener The listener to remove.
+    *
+    * @return Currently always returns true.
+    */
+   virtual bool removeListener(ossimListener* listener);
+
+   /**
+    * If "point" the coordinate tie points are relative to the center of the
+    * pixel.  If "area" the coordinate tie points are relative to the upper
+    * left corner of the pixel.
+    *
+    * For image types that are keyed, tiff for instance, this will set the
+    * geotiff key: GTRasterTypeGeoKey
+    *
+    * If meta data writers are enabled, world file writers for instance,
+    * this will also be propagated to them.
+    *
+    * Default in this writer is:  OSSIM_PIXEL_IS_POINT
+    * 
+    * @param type
+    * OSSIM_PIXEL_IS_POINT = center of pixel
+    * OSSIM_PIXEL_IS_AREA  = upper left corner of pixel
+    */
+   virtual void setPixelType(ossimPixelType type);
+
+   /**
+    * If "point" the coordinate tie points are relative to the center of the
+    * pixel.  If "area" the coordinate tie points are relative to the upper
+    * left corner of the pixel.
+    *
+    * For image types that are keyed, tiff for instance, this will set the
+    * geotiff key: GTRasterTypeGeoKey
+    *
+    * If meta data writers are enabled, world file writers for instance,
+    * this will also be propagated to them.
+
+    * Default in this writer is:  OSSIM_PIXEL_IS_POINT
+    * 
+    * @param type
+    * "point" = center of pixel
+    * "area"  = upper left corner of pixel
+    *
+    * @note If the downcased "type" is not equal to "point" or "area" pixel
+    * type will remain unchanged.
+    */
+   virtual void setPixelType(const ossimString& type);
+
+   /**
+    * @return The pixel type as either OSSIM_PIXEL_IS_POINT or
+    * OSSIM_PIXEL_IS_AREA.
+    */
+   virtual ossimPixelType getPixelType() const;
+   
+   /**
+    * @param type ossimString to initialize which will either be "point" or
+    * "area".
+    */
+   virtual void getPixelTypeString(ossimString& type) const;
+   
+protected:
+
+   /**
+    * Common world file writer method.
+    *
+    * @param file The file to write like "foo.tfw" or "foo.jpw".
+    *
+    * @return true on success, false on error.
+    */
+   bool writeWorldFile(const ossimFilename& file);
+   
+   /**
+    * Write out the file.
+    * @return true on success, false on error.
+    */
+   virtual bool writeFile() = 0;
+   
+   ossimRefPtr<ossimImageSourceSequencer> theInputConnection;
+   ossimRefPtr<ossimViewController>       theViewController;
+   ossimListener*             theProgressListener;
+   ossimFilename              theFilename;
+   ossimString                theOutputImageType;
+   bool                       theWriteImageFlag;
+   bool                       theWriteOverviewFlag;
+   bool                       theWriteHistogramFlag;
+   bool                       theScaleToEightBitFlag;
+   ossim_uint16               theOverviewCompressType;
+   ossim_int32                theOverviewJpegCompressQuality;
+
+   /**
+    * External meta data writer flags.  Not really part of an image writer, put
+    * here for convenience.  If true the writer will do the connection work
+    * for you.
+    */
+   bool                       theWriteEnviHeaderFlag;
+   bool                       theWriteErsHeaderFlag; 
+   bool                       theWriteExternalGeometryFlag;
+   bool                       theWriteFgdcFlag;
+   bool                       theWriteJpegWorldFileFlag;
+   bool                       theWriteReadmeFlag;
+   bool                       theWriteTiffWorldFileFlag;
+   bool                       theWriteWorldFileFlag;
+   bool                       theAutoCreateDirectoryFlag;
+   
+   /**
+    * If not a geographic projection this allows the user to set the linear
+    * units of the output tag to be:
+    * 
+    * meters (default)
+    * us_survey_feet
+    * feet
+    *
+    * This will be propagated to writers that can switch types and to the
+    * associated metadata writers.
+    */
+   ossimUnitType              theLinearUnits;
+
+   /** OSSIM_PIXEL_IS_POINT = 0, OSSIM_PIXEL_IS_AREA  = 1 */
+   ossimPixelType             thePixelType;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimImageGaussianFilter.h b/include/ossim/imaging/ossimImageGaussianFilter.h
new file mode 100644
index 0000000..cd55cfb
--- /dev/null
+++ b/include/ossim/imaging/ossimImageGaussianFilter.h
@@ -0,0 +1,80 @@
+//*******************************************************************
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// class ossimImageGaussianFilter : tile source
+//*******************************************************************
+// $Id: ossimImageGaussianFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimImageGaussianFilter_HEADER
+#define ossimImageGaussianFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimConvolutionFilter1D.h>
+
+/**
+ * class for symmetric Gaussian filtering
+ * implemented as two separable horizontal/vertical gaussian filters
+ *
+ * PROPERTIES:
+ * -GaussStd is the standard deviation of the gaussian
+ *  (filter widths are equal to 2*floor(2.5*GaussStd+0.5)+1)
+ * -strictNoData selects the behaviour for NODATA pixels
+ *   true  : any NODATA pixels in the convolution will Nullify the center pixel
+ *   false : center pixel will be NODATA only if it was NODATA before 
+ *     other NODATA pixels are processed as zero in the convolution calculation
+ */
+class OSSIM_DLL ossimImageGaussianFilter : public ossimImageSourceFilter
+{
+public:
+  /** 
+   * own methods
+   */
+   ossimImageGaussianFilter();
+
+   inline ossim_float64 getGaussStd()const { return theGaussStd; }
+   void setGaussStd(const ossim_float64& v);
+
+   inline bool isStrictNoData()const { return theStrictNoData; }
+   void setStrictNoData(bool aStrict);
+
+  /** 
+   * inherited methods
+   */
+   virtual void initialize();
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect &tileRect,ossim_uint32 resLevel=0);
+
+   virtual void connectInputEvent(ossimConnectionEvent &event);
+   virtual void disconnectInputEvent(ossimConnectionEvent &event);
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,const char* prefix = 0);   
+   virtual bool saveState(ossimKeywordlist& kwl,const char* prefix = 0)const;
+   
+protected:
+   virtual ~ossimImageGaussianFilter();
+  /**
+   * protected methods
+   */
+   void initializeProcesses();
+   void updateKernels();
+
+  /**
+   * parameters
+   */
+   ossim_float64 theGaussStd;
+   bool          theStrictNoData;
+
+  /**
+   * subprocesses
+   */
+   ossimRefPtr<ossimConvolutionFilter1D> theHF; //horizontal filter
+   ossimRefPtr<ossimConvolutionFilter1D> theVF; //vertical filter
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageGaussianFilter_HEADER */
diff --git a/include/ossim/imaging/ossimImageGeometry.h b/include/ossim/imaging/ossimImageGeometry.h
new file mode 100644
index 0000000..242eec3
--- /dev/null
+++ b/include/ossim/imaging/ossimImageGeometry.h
@@ -0,0 +1,482 @@
+//***********************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer (oscarkramer at yahoo.com)
+//
+// Description: Class declaration of ossimImageGeometry.
+//
+//***********************************************************************************************
+// $Id: ossimImageGeometry.h 3102 2012-01-18 15:30:20Z oscar.kramer $
+
+#ifndef ossimImageGeometry_HEADER
+#define ossimImageGeometry_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/base/ossim2dTo2dTransform.h>
+#include <vector>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimAdjustableParameterInterface.h>
+
+// Forward class declarations:
+class ossimDrect;
+class ossimIrect;
+class ossimGrect;
+
+//***********************************************************************************************
+//! Container class that holds both 2D transform and 3D projection information for an image
+//! Only one instance of this is alive per image. This is  the object that is returned from
+//! a call to ossimImageSource::getImageGeometry()
+//! 
+//! All images in OSSIM have at least a 2D transformation from local (relative to start of file)
+//! to full-image coordinates. Often this transform is an identity transform (does nothing). In 
+//! some cases however, the first pixel in the file does not correspond to the upper-left pixel of
+//! the original, full image. Since the image's sensor model may only apply to full-image pixel 
+//! coordinates, it is necessary to reference the latter when making computing ground point 
+//! location.  Also the local image could be a reduced resolution level of the full image.  So
+//! the image could be a decimated sub image of the full image.
+//!
+//! Additionally, images typically are accompanied by some form of metadata that defines the mapping
+//! from 2D image coordinates to 3D world coordinates. This mapping may be in the form of a map
+//! projection for orthorectified images, or a perspective projection such as a sensor model.
+//! 
+//! This object class maintains both 2D transform and 3D projection information for the associated
+//! image. This object will typically be created and "owned" by the image handler object. Therefore,
+//! only one copy per image will exist at a time.
+//!
+//! Notes:
+//! 1) Shifts are relative to "full image space".  So if you have a sub image from r2 the shift
+//!    given to the transform should be relative to "full image space".
+//
+//! 2) A decimation of 1.0 is the full image.  This may or may not be r0 as r0 can be decimated.
+//!
+//***********************************************************************************************
+class OSSIM_DLL ossimImageGeometry : public ossimObject
+{
+public:
+   typedef std::vector<ossim_float64> DeltaParamList;
+   
+   //! Default constructor defaults to unity transform with no projection.
+   ossimImageGeometry();
+   virtual ~ossimImageGeometry();
+   
+   //! Copy constructor -- performs a deep copy. This is needed when an imageSource in the chain
+   //! needs to modify the image geometry at that point in the chain. The image geometry to the 
+   //! left of that imageSource must remain unchanged. This constructor permits that imageSource to 
+   //! maintain its own geometry based on the input geometry. All chained objects to the right
+   //! would see this alternate geometry. See ossimScaleFilter for an example of this case.
+   ossimImageGeometry(const ossimImageGeometry& copy_this);
+
+   //! Constructs with projection and transform objects available for referencing. Either pointer
+   //! can be NULL -- the associated mapping would be identity.
+   ossimImageGeometry(ossim2dTo2dTransform* transform, ossimProjection* projection);
+
+   //! Shortcut way of getting to an image's geometry when access to pixels is not needed.
+   //! @param image Image to open
+   //! @return true if open was successful and a valid geometry was initialized.
+   bool open(const ossimFilename& image);
+
+   //! rnToRn is a utility method that takes a rn resolution image point and maps it to the another
+   //! rn resolution image point.
+   //!
+   //! @param inRnPt Is a point in resolution n.
+   //! @param inResolutionLevel Is the resolution of the point inRnPt.
+   //! @param outResolutionLevel Is the resolution of the point outRnPt.
+   //! @param outRnPt Is the result of the transform.
+   //!
+   void rnToRn(const ossimDpt& inRnPt, ossim_uint32 inResolutionLevel,
+               ossim_uint32 outResolutionLevel,ossimDpt& outRnPt) const;
+   
+   //! rnToFull is a utility method that takes a rn resolution image point and maps it to the full
+   //! image point.
+   //!
+   //! @param rnPt Is a point in resolution n.
+   //! @param resolutionLevel Is the resolution of the point rnPt.  a value of 0 is the local image
+   //! @param fullPt Is the result of the transform
+   //!
+   void rnToFull(const ossimDpt& rnPt, ossim_uint32 resolutionLevel, ossimDpt& fullPt) const;
+
+   //! @brief fullToRn is a utility method that takes a full image point and maps it to a rn
+   //! resolution image point.
+   //! 
+   //! @param fullPt Is a point in full image space.
+   //! @param resolutionLevel Is the resolution of the point rnPt. A value of 0 is the local image.
+   //! @param fullPt Is the result of the transform
+   void fullToRn(const ossimDpt& fullPt, ossim_uint32 resolutionLevel, ossimDpt& rnPt) const;
+
+   //! rnToWorld is a utility method that takes a rn resolution image point and maps it to the 
+   //! world point.
+   //!
+   //! @param rnPt Is a point in resolution n.
+   //! @param resolutionLevel Is the resolution of the point rnPt.  a value of 0 is the local image
+   //! @param wpt Is the result of the transform
+   //!
+   void rnToWorld(const ossimDpt& rnPt, ossim_uint32 resolutionLevel, ossimGpt& wpt) const;
+   
+   //! worldToRn is a utility method that takes a world point allows one to transform all the way back to
+   //! an rn point.
+   //!
+   //! @param wpt Ground point.
+   //! @param resolutionLevel Is the resolution of the point rnPt.  a value of 0 is the local image
+   //! @param rnPt Is the resoltion point.
+   //!
+   void worldToRn(const ossimGpt& wpt, ossim_uint32 resolutionLevel, ossimDpt& rnPt) const;
+
+   //! Exposes the 3D projection from image to world coordinates. The caller should verify that
+   //! a valid projection exists before calling this method. Returns TRUE if a valid ground point
+   //! is available in the ground_pt argument. This method depends on the existence of elevation
+   //! information. If no DEM is available, the results will be incorrect or inaccurate.
+   bool localToWorld(const ossimDpt& local_pt, ossimGpt& world_pt) const;
+   bool localToWorld(const ossimDrect& local_rect, ossimGrect& world_rect) const;
+
+   //! Exposes the 3D projection from image to world coordinates given a constant height above 
+   //! ellipsoid. The caller should verify that a valid projection exists before calling this
+   //! method. Returns TRUE if a valid ground point is available in the ground_pt argument.
+   bool localToWorld(const ossimDpt& local_pt, const double& h_ellipsoid, ossimGpt& world_pt) const;
+
+   //! Exposes the 3D world-to-local image coordinate reverse projection. The caller should verify 
+   //! that a valid projection exists before calling this method. Returns TRUE if a valid image 
+   //! point is available in the local_pt argument.
+   bool worldToLocal(const ossimGpt& world_pt, ossimDpt& local_pt) const;
+   bool worldToLocal(const ossimGrect& world_rect, ossimDrect& local_rect) const;
+
+   //! Sets the transform to be used for local-to-full-image coordinate transformation
+   void setTransform(ossim2dTo2dTransform* transform);
+
+   //! Sets the projection to be used for local-to-world coordinate transformation
+   void setProjection(ossimProjection* projection);
+
+   //! Access methods for transform (may be NULL pointer).
+   const ossim2dTo2dTransform* getTransform() const { return m_transform.get(); }
+   ossim2dTo2dTransform*       getTransform()       { return m_transform.get(); }
+
+   //! Access methods for projection (may be NULL pointer).
+   const ossimProjection* getProjection() const { return m_projection.get(); }
+   ossimProjection*       getProjection()       { return m_projection.get(); }
+
+   /**
+    * @return const ossimMapProjection* or NULL if projection not set or not
+    * derived from ossimMapProjection.
+    */
+   const ossimMapProjection* getAsMapProjection() const
+   { return dynamic_cast<const ossimMapProjection*>( m_projection.get() ); }
+
+   /**
+    * @return ossimMapProjection* or NULL if projection not set or not
+    * derived from ossimMapProjection.
+    */
+   ossimMapProjection*       getAsMapProjection()
+   { return dynamic_cast<ossimMapProjection*>( m_projection.get() ); }
+
+   //! Returns TRUE if valid projection defined
+   bool hasProjection() const { return m_projection.valid(); }
+   
+   //! Returns TRUE if valid transform defined
+   bool hasTransform() const { return m_transform.valid(); }
+
+   //! Returns TRUE if this geometry is sensitive to elevation
+   bool isAffectedByElevation() const;
+
+   //! Returns the GSD associated with this image in the active projection. Note that this only
+   //! makes sense if there is a projection associated with the image. Returns NaNs if no 
+   //! projection defined.
+   ossimDpt getMetersPerPixel() const;
+
+   /**
+    * @brief Get the ground sample distance(GSD) associated with this image
+    * in the active projection.
+    *
+    * GSD is taken from projection if there is no transform set; else,
+    * taken from three localToWorld calls (one pixel apart) at the image
+    * center.  If the projection or the image size(if needed) is not set the
+    * point will be set to NaNs.
+    * 
+    * @param gsd Point to intialize with GSD.
+    * 
+    * @note This only makes sense if there is a projection associated with
+    * the image.
+    *
+    * @note Result should be checked for NaNs after call.
+    */
+   void getMetersPerPixel( ossimDpt& gsd ) const;
+
+   //! Returns the resolution of this image in degrees/pixel. Note that this only
+   //! makes sense if there is a projection associated with the image. Returns NaNs if no 
+   //! projection defined.
+   ossimDpt getDegreesPerPixel() const;
+
+   /**
+    * @brief Get the resolution of this image in degrees/pixel.
+    *
+    * Degrees/pixel is taken from projection if there is no transform set;
+    * else, taken from three localToWorld calls (one pixel apart) at the image
+    * center.  If the projection or the image size(if needed) is not set the
+    * point will be set to NaNs.
+    * 
+    * @param dpp Point to intialize with degrees/pixel.
+    * 
+    * @note This only makes sense if there is a projection associated with
+    * the image.
+    *
+    * @note Result should be checked for NaNs after call.
+    */
+   void getDegreesPerPixel( ossimDpt& dpp ) const;
+
+   //! Assigns the ossimGpts with the ground coordinates of the four corresponding image 
+   //! corner points. Returns true if points are valid.
+   bool getCornerGpts(ossimGpt& ul, ossimGpt& ur, ossimGpt& lr, ossimGpt& ll) const;
+
+   /**
+    * @brief Get the latitude, longitude of the tie point.
+    *
+    * This is the bounding upper left point of the image which is not
+    * necessarily the image (0, 0) point.
+    * 
+    * @param tie ossimGpt to assign.
+    *
+    * @param edge If true the tie point is shifted up and to the right by
+    * half the gsd.
+    *
+    * @note Requires projection and image size to be initialized or the
+    * latitude and longitue will be set to nan.
+    *
+    * @note The height parameter of the ossimGpt is not touched by this method.
+    */
+   void getTiePoint(ossimGpt& tie, bool edge) const;
+
+   /**
+    * @brief Get the easting, northing of the tie point.
+    *
+    * This is the bounding upper left point of the image which is not
+    * necessarily the image (0, 0) point.
+    * 
+    * @param tie ossimDpt to assign.
+    *
+    * @param edge If true the tie point is shifted up and to the right by
+    * half the gsd.
+    * 
+    * @note Requires projection and image size to be initialized or the
+    * easting and northing will be set to nan.
+    */
+   void getTiePoint(ossimDpt& tie, bool edge) const;
+
+   //! Prints contents to output stream.
+   std::ostream& print(std::ostream& out) const;
+
+   //! Returns TRUE if argument geometry has exactly the same instances for transform and 
+   //! m_projection. This should be expanded to permit different instances of same transforms
+   bool operator==(const ossimImageGeometry& compare_this) const;
+
+   //! Replaces any existing transform and projection with those in the copy_this object
+   const ossimImageGeometry& operator=(const ossimImageGeometry& copy_this);
+
+   //! Returns the decimation factor from R0 for the resolution level specified. For r_index=0, the 
+   //! decimation factor is by definition 1.0. For the non-discrete case, r_index=1 returns a 
+   //! decimation of 0.5. If the vector of discrete decimation factors (m_decimationFactors) is 
+   //! empty, the factor will be computed as f=1/2^n
+   ossimDpt decimationFactor(ossim_uint32 r_index) const;
+
+   /**
+    * @brief Method to get the decimation factor for a given resolution
+    * level.
+    *
+    * If the array of decimations is not initialized by owner, the default is:
+    * r_index=0 is by definition 1.0.
+    * r_index=n Where n is some level the factor will be computed as f=1/2^n.
+    *
+    * @param resLevel Reduced resolution set for requested decimation.
+    *
+    * @param result ossimDpt to initialize with requested decimation.
+    */
+   void decimationFactor(ossim_uint32 r_index, ossimDpt& result) const;
+
+   /**
+    * @brief Gets array of all decimation levels.
+    * @param decimations Array to initialiaze.
+    */
+   void decimationFactors(std::vector<ossimDpt>& decimations) const;
+
+   //! Sets the decimation scheme to a discrete list of decimation factors.
+   void setDiscreteDecimation(const std::vector<ossimDpt>& decimation_list) 
+      { m_decimationFactors = decimation_list; }
+
+   //! @return The number of decimation factors
+   ossim_uint32 getNumberOfDecimations()const
+   {
+      return (ossim_uint32)m_decimationFactors.size();
+   }
+   void setImageSize(const ossimIpt& size)
+   {
+      m_imageSize = size;
+   }
+   const ossimIpt& getImageSize()const
+   {
+      return m_imageSize;
+   }
+
+   bool getCrossesDateline()const;
+   
+
+   void getImageEdgePoints(std::vector<ossimDpt>& result, ossim_uint32 partitions = 25)const;
+
+   /**
+   * This is the first stage implementation.   It will determine if it crosses the dateline
+   * and do a special multi polygon for the ossimPolyArea2d result.  For each edge
+   * of the image we walk "partitions" number of points.   If we cross a dateline we calculate
+   * the crossing lat by using the parametric form of the equation.   For example, if we
+   * are crossing from positive to negative that means we are going through the 180 degree lon
+   * location and we will need to solve for the paramtetric parameter t and plug back into the parametric
+   * equation to solve for the latitude.  Basic form:  start + (end-start)*t = 180.  If we are coming from
+   * negative to positive then we solve basic form: start + (end-start)*t = -180.  Where deltaPoint is (end-start) 
+   *
+   *                   ossim_float64 t = ((180-start.x)/deltaPoint.x);
+   *                   ossim_float64 lat = (start.y+deltaPoint.y*t);
+   *
+   * If we do not cross the dateline then if the image is affected by elevation (i.e. a sensor model) then we use the partitions
+   * parameter to calculate that number of partitions to sample along each edge.
+   *
+   * if The geometry is not affected by elevation then we just use the corner points and ignore the partitions parameter
+   *
+   * @param poly holds the resulting polygon.  This could be a MultiPolygon depending on the geometry
+   * @param partitions These are the number of steps you want when walking the border.
+   */
+   void calculatePolyBounds(ossimPolyArea2d& result, ossim_uint32 partitions = 25)const;
+
+   /**
+    * @brief Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
+    *
+    * Relies on image size being initialized.
+    *
+    * @param bounding_rect Initialized by this method.  Will do a
+    * ossimIrect::makeNan() if the image size is not initialized.
+    */
+   void getBoundingRect(ossimIrect& bounding_rect) const;
+   void getBoundingRect(ossimDrect& bounding_rect) const; // Overloaded for drect.
+   
+   void getBoundingGroundRect(ossimGrect& bounding_grect) const;
+
+   //! Creates a new instance of ossimImageGeometry with the same transform and projection.
+   //! Overrides base-class version requiring loadState() and saveState() (not implemented yet)
+   virtual ossimObject* dup() const { return new ossimImageGeometry(*this); }
+
+   //! Attempts to initialize a transform and a projection given the KWL. Returns TRUE if no
+   //! error encountered.
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   //! Saves the transform (if any) and projection (if any) states to the KWL.
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+
+   /**
+    * @brief Set m_targetRrds data member.
+    *
+    * This is used by methods worldToRn and localToWorld that do not take a rrds
+    * argument and methods rnToWorld and worldToRn.  If the target rrds is set to 2,
+    * then the resulting point from worldToLocal is relative to reduced
+    * resolution level 2.  Vice versa for localToWorld it is assumed the local
+    * point is relative to the target
+    * reduced resolution data set.
+    *
+    * @param rrds Target (zero based) reduced resolution data set.
+    */
+   void setTargetRrds(ossim_uint32 rrds);
+
+   /**
+    * @return The target zero based reduced resolution data set used for localToWorld and
+    * worldToLocal.
+    * @see setTargetRrds 
+    */
+   ossim_uint32 getTargetRrds() const;
+
+   //! @brief  Changes the GSD and image size to reflect the scale provided.
+   //! @param scale  The scale to be applied in x and y directions
+   //! @param recenterTiePoint If true the will adjust the tie point by shifting the original tie 
+   //! to the upper left corner, applying scale, then shifting back by half of either the new
+   //! theDeltaLat/lon or theMetersPerPixel depending on if underlying projection isGeographic.
+   void applyScale(const ossimDpt& scale, bool recenterTiePoint);
+
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType = OSSIM_COMPARE_FULL)const;
+
+
+
+   // If we have an adjustable parameter interface return one.
+   //
+   // @return a pointer to an ossimAdjustableParameterInterface or NULL if no
+   //         adjustable paramters exist
+   //
+   virtual ossimAdjustableParameterInterface* getAdjustableParameterInterface();
+   virtual const ossimAdjustableParameterInterface* getAdjustableParameterInterface()const;
+   
+   
+   // Compute partials from image to ground with respect to the adjustable parameters.
+   //
+   //
+   bool computeImageToGroundPartialsWRTAdjParam(ossimDpt& result,
+                                                          const ossimGpt& gpt,
+                                                          ossim_uint32 idx,
+                                                          ossim_float64 paramDelta=1.0);
+   bool computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result,
+                                                           const ossimGpt& gpt,
+                                                           ossim_float64 paramDelta=1.0);
+   bool computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result,
+                                                           const ossimGpt& gpt,
+                                                           const DeltaParamList& deltas);
+   
+   bool computeGroundToImagePartials(NEWMAT::Matrix& result,
+                                     const ossimGpt& gpt,
+                                     const ossimDpt3d& deltaLlh);
+   
+   bool computeGroundToImagePartials(NEWMAT::Matrix& result,
+                                     const ossimGpt& gpt);
+
+   /**
+    * @return Returns the angle to "up is up" in decimal degrees, 0.0 if image
+    * is not affected by elevation, ossim::nan on error.
+    */
+   ossim_float64 upIsUpAngle() const;
+
+   /**
+    * @return Returns the angle to "north up" in decimal degrees, ossim::nan
+    * on error.
+    */
+   ossim_float64 northUpAngle() const;
+   
+protected:
+   //! @brief Method to back out decimation of a point.
+   //! @param rnPt Is a point in resolution n.
+   //! @param resolutionLevel Is the resolution of the point rnPt.
+   //! @param outPt Is the result of the transform a non-decimated point.
+   void undecimatePoint(const ossimDpt& rnPt,
+                        ossim_uint32 resolutionLevel,
+                        ossimDpt& outPt) const;
+
+   //! @brief Method to apply decimation of a point.
+   //! @param inPt Is a point with no decimation.
+   //! @param resolutionLevel Is the resolution of the point rnPt.
+   //! @param rnPt Is the result of the transform
+   void decimatePoint(const ossimDpt& inPt,
+                      ossim_uint32 resolutionLevel,
+                      ossimDpt& rnPt) const;
+
+   ossimRefPtr<ossim2dTo2dTransform> m_transform;   //!< Maintains local_image-to-full_image transformation 
+   ossimRefPtr<ossimProjection>      m_projection;  //!< Maintains full_image-to-world_space transformation
+   std::vector<ossimDpt>             m_decimationFactors; //!< List of decimation factors for R-levels
+   ossimIpt                          m_imageSize; // Image width and height
+
+   /** @brief Target rrds for localToWorld and worldToLocal methods. */
+   ossim_uint32                      m_targetRrds; 
+
+   TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageGeometry_HEADER */
diff --git a/include/ossim/imaging/ossimImageGeometryFactory.h b/include/ossim/imaging/ossimImageGeometryFactory.h
new file mode 100644
index 0000000..4c20353
--- /dev/null
+++ b/include/ossim/imaging/ossimImageGeometryFactory.h
@@ -0,0 +1,53 @@
+//*****************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class declaration of ossimImageGeometryFactory.
+//
+//*****************************************************************************
+// $Id$
+#ifndef ossimImageGeometryFactory_HEADER
+#define ossimImageGeometryFactory_HEADER 1
+
+#include <ossim/imaging/ossimImageGeometryFactoryBase.h>
+
+class ossim2dTo2dTransform;
+class ossimNitfTileSource;
+class ossimProjection;
+
+class OSSIM_DLL ossimImageGeometryFactory : public ossimImageGeometryFactoryBase
+{
+public:
+   static ossimImageGeometryFactory* instance();
+   virtual ossimImageGeometry* createGeometry(const ossimString& typeName)const;
+   virtual ossimImageGeometry* createGeometry(const ossimKeywordlist& kwl,
+                                              const char* prefix=0)const;
+   virtual ossimImageGeometry* createGeometry(const ossimFilename& filename,
+                                              ossim_uint32 entryIdx)const;
+   virtual bool extendGeometry(ossimImageHandler* handler)const;
+   
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+   
+   /**
+    * This is a utility method used by crateGeoemtry that takes an image handler
+    */
+   virtual ossim2dTo2dTransform* createTransform(ossimImageHandler* handler)const;
+
+   /**
+    * @brief Utility method to create a projection from an image handler.
+    * @param handler The image handler to create projection from.
+    * @return Pointer to an ossimProjection on success, null on error.
+    */
+   virtual ossimProjection* createProjection(ossimImageHandler* handler) const;
+   
+protected:
+   ossimImageGeometryFactory();
+
+   virtual ossim2dTo2dTransform* createTransformFromNitf(ossimNitfTileSource* handler)const;
+   
+   static ossimImageGeometryFactory* m_instance;
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimImageGeometryFactoryBase.h b/include/ossim/imaging/ossimImageGeometryFactoryBase.h
new file mode 100644
index 0000000..1f732de
--- /dev/null
+++ b/include/ossim/imaging/ossimImageGeometryFactoryBase.h
@@ -0,0 +1,44 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class declaration of ossimImageGeometryFactoryBase. See .h file for class documentation.
+//
+//**************************************************************************************************
+// $Id$
+#ifndef ossimImageGeometryFactoryBase_HEADER
+#define ossimImageGeometryFactoryBase_HEADER
+#include <ossim/base/ossimBaseObjectFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+class ossimImageHandler;
+class OSSIM_DLL ossimImageGeometryFactoryBase : public ossimBaseObjectFactory
+{
+public: 
+   /**
+    * Creates an object given a type name.
+    */
+   virtual ossimObject* createObject(const ossimString& typeName)const
+   {
+      return createGeometry(typeName);
+   }
+   
+   /**
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const
+   {
+      return createGeometry(kwl, prefix);
+   }
+   
+   virtual ossimImageGeometry* createGeometry(const ossimString& typeName)const=0;
+   virtual ossimImageGeometry* createGeometry(const ossimKeywordlist& kwl,
+                                              const char* prefix=0)const=0;
+   virtual ossimImageGeometry* createGeometry(const ossimFilename& filename,
+                                              ossim_uint32 entryIdx)const = 0;
+   virtual bool extendGeometry(ossimImageHandler* handler)const=0;
+};
+#endif
diff --git a/include/ossim/imaging/ossimImageGeometryRegistry.h b/include/ossim/imaging/ossimImageGeometryRegistry.h
new file mode 100644
index 0000000..5ae90ca
--- /dev/null
+++ b/include/ossim/imaging/ossimImageGeometryRegistry.h
@@ -0,0 +1,74 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class declaration of ossimImageGeometryRegistry. See .h file for class documentation.
+//
+//**************************************************************************************************
+// $Id$
+#ifndef ossimImageGeometryRegistry_HEADER
+#define ossimImageGeometryRegistry_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimImageGeometryFactoryBase.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/base/ossimFactoryListInterface.h>
+class OSSIM_DLL ossimImageGeometryRegistry : public ossimImageGeometryFactoryBase,
+                                             public ossimFactoryListInterface<ossimImageGeometryFactoryBase,
+                                                                              ossimImageGeometry>
+{
+public:
+   virtual ~ossimImageGeometryRegistry(){m_instance=0;}
+   static ossimImageGeometryRegistry* instance();
+   
+   
+   virtual ossimImageGeometry* createGeometry(const ossimString& typeName)const;
+   virtual ossimImageGeometry* createGeometry(const ossimKeywordlist& kwl,
+                                              const char* prefix=0)const;
+   virtual ossimImageGeometry* createGeometry(const ossimFilename& filename,
+                                              ossim_uint32 entryIdx)const;
+#if 0
+   /*!
+    * Creates an object given a type name.
+    */
+   virtual ossimObject* createObject(const ossimString& typeName)const
+   {
+      return createObjectFromRegistry(typeName);
+   }
+   
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const
+   {
+      return createObjectFromRegistry(kwl, prefix);
+   }
+#endif
+   virtual bool extendGeometry(ossimImageHandler* handler)const;
+   
+   /*!
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const
+   {
+      getAllTypeNamesFromRegistry(typeList);
+   }
+   
+protected:
+   ossimImageGeometryRegistry()
+   :ossimImageGeometryFactoryBase()
+   {}
+   
+   ossimImageGeometryRegistry( const ossimImageGeometryRegistry& rhs )
+   :ossimImageGeometryFactoryBase(rhs)
+   {}
+   void operator =(const ossimImageGeometryRegistry&){}
+   static ossimImageGeometryRegistry* m_instance;
+   
+   TYPE_DATA
+};
+#endif
diff --git a/include/ossim/imaging/ossimImageHandler.h b/include/ossim/imaging/ossimImageHandler.h
new file mode 100644
index 0000000..9c6d05b
--- /dev/null
+++ b/include/ossim/imaging/ossimImageHandler.h
@@ -0,0 +1,849 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description:
+//
+// This class defines an abstract image handler which all loaders should
+// derive from.
+//
+//********************************************************************
+// $Id: ossimImageHandler.h 22960 2014-11-06 15:42:13Z okramer $
+#ifndef ossimImageHandler_HEADER
+#define ossimImageHandler_HEADER 1
+
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimNBandLutDataObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimImageMetaData.h>
+
+class ossimMultiResLevelHistogram;
+
+/**
+ *  This class defines an abstract Handler which all image handlers(loaders)
+ *  should derive from.
+ */
+class OSSIMDLLEXPORT ossimImageHandler : public ossimImageSource
+{
+public:
+
+   enum ossimImageHandlerOverviewCompressionType
+   {
+      OSSIM_OVERVIEW_COMPRESSION_NONE= 0,
+      OSSIM_OVERVIEW_COMPRESSION_JPEG,
+      OSSIM_OVERVIEW_COMPRESSION_LZW,
+      OSSIM_OVERVIEW_COMPRESSION_DEFLATE,
+      OSSIM_OVERVIEW_COMPRESSION_PACKBITS
+   };
+
+   /** Constructor (default): */
+   ossimImageHandler();
+   
+   /**
+    * Destructor:
+    * Derived classes should implement.
+    */
+   virtual ~ossimImageHandler();
+   
+   /**
+    * initialize
+    * Does nothing in this class.  Implemented to satisfy pure virtual.
+    */
+   virtual void initialize();
+   
+   /**
+    *  Searches for an overview.  Uses theImageFile as a key.
+    *  If theImageFile = "foo.tif" it will look for "foo.ovr" first,
+    *  then "foo_ovr.tif" next.
+    *  Calls openOverview(const ossimFilename& overview_file)
+    *  @return true on success, false on error.
+    *  @see openOverview(const ossimFilename& overview_file)
+    */
+   virtual bool openOverview();
+
+   /**
+    *  Calls closeOverview(), then attempts to open the overview_file.
+    *  On success, theOverviewFile will be set and theOverview will be
+    *  initialized.  On failure, theOverviewFile will be cleared and
+    *  theOverview deleted and set to NULL.
+    *  @param overview_file ossimFilename representing overview file.
+    *  @return true on success, false on error.
+    *  @see closeOverview()
+    */
+   virtual bool openOverview(const ossimFilename& overview_file);
+
+   /**
+    *  If theOverview is initialized it will be deleted and set to NULL. Also
+    *  clears theOverviewFile.
+    *  @return void
+    */
+   virtual void closeOverview();
+   
+   /**
+    *  @return the image handler of the overview, if it has been
+    *  successfully opened.
+    */
+   virtual const ossimImageHandler* getOverview() const;
+
+   /**
+    *  @return true if getNumberOfReducedResSets > 1, false if not.
+    *  @see getNumberOfReducedResSets()
+    */
+   virtual bool hasOverviews() const;
+
+   /**
+    *  @return ossimFilename represents an external OSSIM overview filename.
+    */
+   virtual ossimFilename createDefaultOverviewFilename() const;
+   
+   /**
+    *  @return ossimFilename represents an external OSSIM geometry filename.
+    */
+   virtual ossimFilename createDefaultGeometryFilename() const;
+
+   /**
+    *  @return ossimFilename represents an external OSSIM metadata filename.
+    */
+   virtual ossimFilename createDefaultMetadataFilename() const;
+
+   /**
+    *  @return ossimFilename represents an external OSSIM histogram filename.
+    */
+   virtual ossimFilename createDefaultHistogramFilename() const;
+
+   /**
+    *  @return ossimFilename represents an external OSSIM valid vertices filename.
+    */
+   virtual ossimFilename createDefaultValidVerticesFilename() const;
+   
+   /**
+    *  Outputs vertices to file and updates the internal vertex
+    *  array variable "theValidImageVertices".
+    *  @param vertices Array of ossimIpts to write.
+    *  @param file Name of output file to write to.  If file is empty, the
+    *  output file will be the image file with no extension + _vertices.kwl.
+    *  So if the image is "foo.tif" you'll get "foo_vertices.kwl".
+    *  @return true on success, false on error.
+    */
+   virtual bool writeValidImageVertices(const std::vector<ossimIpt>& vertices, 
+					const ossimFilename& file=ossimFilename(""));
+
+   /**
+    *  Opens the valid image vertices file and sets theValidImageVerticesFile
+    *  variable.
+    *  @param vertices_file File name containing valid vertices for image.
+    *  @return true on success, false on error.
+    */
+   virtual bool openValidVertices(const ossimFilename& vertices_file);
+
+   /**
+    *  Creates vertices file name based on image, then tries to open.
+    *  If theImageFile = "foo.tif" it will look for "foo_vertices.kwl".
+    *  @return true on success, false on error.
+    */
+   virtual bool openValidVertices();
+
+   /**
+    *  Pure virtual open.  Derived classes must implement.
+    *  
+    *  @return Returns true on success, false on error.
+    *
+    *  @note This method relies on the data member ossimImageData::theImageFile
+    *  being set.  Callers should do a "setFilename" prior to calling this
+    *  method or use the ossimImageHandler::open that takes a file name and an
+    *  entry index.
+    */
+   virtual bool open() = 0;
+
+   /**
+    *  Opens the image file.
+    *  
+    *  @param imageFile File to open.
+    *
+    *  @param entryIndex
+    *  @return true on success, false on error.
+    */
+   virtual bool open(const ossimFilename& imageFile,
+                     ossim_uint32 entryIndex);
+
+   virtual bool open(const ossimFilename& imageFile);
+
+   /**
+    *  Deletes the overview and clears the valid image vertices.  Derived
+    *  classes should implement.
+    */
+   virtual void close();
+
+   /**
+    *  Derived classes must implement this method to be concrete.
+    *
+    *  @return true if open, false if not.
+    */
+   virtual bool isOpen()const=0;
+
+   /**
+    *  Build a histogram for image file.
+    *
+    *  @param numberOfRLevels sets the maximum number of reduced resolution
+    *  level to compute histogram for.
+    *
+    *  @param mode OSSIM_HISTO_MODE_NORMAL or OSSIM_HISTO_MODE_FAST.
+    *
+    *  @return true on success, false if not open.
+    */
+   virtual bool buildHistogram(
+      int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL );
+   
+   /**
+    *  Build a histograms for all image entries.
+    *
+    *  @param numberOfRLevels sets the maximum number of reduced resolution
+    *  level to compute histogram for.
+    *
+    *  @param mode OSSIM_HISTO_MODE_NORMAL or OSSIM_HISTO_MODE_FAST.
+    *
+    *  @return true on success, false if not open.
+    */
+   virtual bool buildAllHistograms(
+      int numberOfRLevels=0, ossimHistogramMode mode=OSSIM_HISTO_MODE_NORMAL );
+   
+   /**
+    *  Will build over file for theImageFile.
+    *
+    *  @param includeFullResFlag if true the full resolution layer will also
+    *  be put in the overview format.  This is handly for inefficeint formats.
+    */
+   virtual bool buildOverview(ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
+                              ossim_uint32 quality = 75,
+                              ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
+                              bool includeFullResFlag=false);
+
+   /**
+    *  Will build over file for all image entries.
+    *
+    *  @param includeFullResFlag if true the full resolution layer will also
+    *  be put in the overview format.  This is handly for inefficeint formats.
+    */
+   virtual bool buildAllOverviews(ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
+                                  ossim_uint32 quality = 75,
+                                  ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
+                                  bool includeFullResFlag=false);
+   
+   /**
+    *  Will build an over file for filename.
+    *  @param filename Name of image file.
+    *
+    *  @param includeFullResFlag if true the full resolution layer will also
+    *  be put in the overview format.  This is handly for inefficeint formats.
+    */
+   virtual bool buildOverview(const ossimFilename& filename,
+                              ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
+                              ossim_uint32 quality = 75,
+                              ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
+                              bool includeFullResFlag=false);
+   
+   /**
+    * @brief Fetches the current entry image's histogram.
+    * 
+    * @return Ref pointer to histogram or null if histogram does not exist.
+    *
+    * @note Old behaviour: "If none exists, it will be created." taken out.
+    *
+    * Do:
+    * ossimRefPtr<ossimMultiResLevelHistogram> his = ih->getImageHistogram();
+    * if ( ih.valid() )
+    * {
+    * }
+    * else
+    * {
+    *    ih->buildHistogram();
+    * }
+    * 
+    */
+   ossimRefPtr<ossimMultiResLevelHistogram> getImageHistogram() const;
+
+   /**
+    * Returns the image geometry object associated with this tile source or
+    * NULL if non defined.  The geometry contains full-to-local image
+    * transform as well as projection (image-to-world).
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   
+   /**
+    * Sets the image geometry object.
+    *
+    * @note Callers should note that this will override any existing
+    *       geometry.
+    *
+    * @note This does not write the geometry to disk, to do so call
+    *       one of the saveImageGeometry methods. 
+    */
+   virtual void setImageGeometry(ossimImageGeometry* geom);
+
+   /**
+    * Saves the image geometry to a file that will be made based on the image
+    * file name.
+    */
+   virtual void saveImageGeometry() const;
+   
+   /**
+    * Saves the image geometry to a file that will be made based on the image
+    * file name.
+    */
+   virtual void saveImageGeometry(const ossimFilename& geometry_file) const;   
+   
+   /**
+    *  Pure virtual, derived classes must implement.
+    *
+    *  @param resLevel Reduced resolution level to return lines of.
+    *  Default = 0
+    *
+    *  @return The number of lines for specified reduced resolution level.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const = 0;
+
+   /**
+    *  Pure virtual, derived classes must implement.
+    *
+    *  @param resLevel Reduced resolution level to return samples of.
+    *  Default = 0
+    *
+    *  @return The number of samples for specified reduced resolution level.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const = 0;
+   
+   /**
+    * @brief Returns zero-based bounding rectangle of the image.
+    * Note sub-image offset now in ossimImageGeometry class.
+    * 
+    * @param resLevel Reduced resolution level for rectangle.
+    *
+    * @return Rectangle of reduced resolution level.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 resLevel = 0) const; 
+
+   /**
+    * @brief Returns zero-based bounding rectangle of the image.
+    * Same as getImageRectangle() call.  Note sub-image offset now
+    * in ossimImageGeometry class.
+    * 
+    * @param resLevel Reduced resolution level for rectangle.
+    *
+    * @return Rectangle of reduced resolution level.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel = 0) const;
+
+   /**
+    * @param resLevel Reduced resolution set for requested decimation.
+    *
+    * @param result ossimDpt to initialize with requested decimation.
+    * 
+    * @note Initialized "result" with the decimation factor for the passed in
+    * resLevel.
+    * Most of the time the returned factor is a square decimation along x
+    * and y indicated by result.x and .y  = 1.0/(resLevel^2) where ^
+    * means rasing to the power of.  If the resLevel is 1 then the return
+    * decimation .5, .5. this is not the decimation to each resolution
+    * level but the total decimation from res level 0.
+    * So if resLevel is 2 then the return is .25, .25.
+    *
+    * @note Derived classes should override if the decimation is anything other
+    * than a power of two change in each direction per res level.
+    */
+   virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const;
+
+   /**
+    * This returns all decimation for all levels.
+    */
+   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
+
+   /**
+    * This returns the total number of decimation levels.  It is important to
+    * note that res level 0 or full resolution is included in the list and has
+    * decimation values 1.0, 1.0
+    */
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+
+   /**
+    * This method is obsolete.  Please use getNumberOfDecimationLevels.
+    *
+    * For backwards compatibility this calls getNumberOfDecimationLevels.
+    */
+   virtual ossim_uint32 getNumberOfReducedResSets()const;
+   
+   /**
+    * Sets the filename
+    */
+   virtual void setFilename(const ossimFilename& filename);
+
+   /**
+    * Returns the filename
+    */
+   virtual const ossimFilename& getFilename()const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * @brief Determines if the passed in reslution level is valid.
+    *
+    * If this reader is used as an overview the caller should pass in a
+    * resLevel relative to the full image.
+    * 
+    * @param resLevel zero base resolution level.
+    * @return true on success, false on error.
+    */
+   virtual bool isValidRLevel(ossim_uint32 resLevel) const;
+
+   /**
+    * Connection rule.  Since image handler currently don't have any
+    * inputs this will just return false saying we can't connect anything
+    * to an image handler.
+    */
+   bool canConnectMyInputTo(ossim_int32 inputIndex,
+                            const ossimConnectableObject* object) const;
+      
+   /**
+    * ordering specifies how the vertices should be arranged.
+    * valid image vertices is basically the tightly fit convex hull
+    * of the image.  Usually an image has NULL values and are
+    * internally not upright rectangular.  This can cause
+    * problems some spatial filters.
+    *
+    * The default implementation is to return the bounding rect.
+    */
+   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
+                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+                                      ossim_uint32 resLevel=0)const;
+
+   /**
+    * @brief Indicates whether or not the image handler can control output
+    * band selection via the setOutputBandList method.
+    * @return true if band selector; false, if not.
+    */
+   virtual bool isBandSelector() const;
+
+   /**
+    * @brief If the image handler "isBandSeletor()" then the band selection
+    * of the output chip can be controlled.
+    *
+    * This method returns false. Derived classes that are band selectors should
+    * override.
+    *
+    * @param band_list Requested bands.
+    * 
+    * @return true on success, false on error.
+    */
+   virtual bool setOutputBandList(const std::vector<ossim_uint32>& band_list);
+ 
+   /**
+    * @brief If the image handler "isBandSeletor()" then the band selection
+    * of the output are set to input or identity.  Does nothing and returns
+    * false if not a band selector.
+    * 
+    * @return If band selector, returns the output of setOutputBandList; if
+    * not, returns false.
+    */
+   virtual bool setOutputToInputBandList();
+ 
+   /**
+    * @brief Convenience method to see if band list is identity.
+    * @param bandList List to check.
+    * @return true if band selector; false, if not.
+    */
+   virtual bool isIdentityBandList( const std::vector<ossim_uint32>& bandList ) const;
+   
+   /**
+    * Indicates whether or not the image is tiled internally.
+    * This implementation returns true if (getImageTileWidth() &&
+    * getImageTileHeight()) are both non zero.
+    * Override in the image handler if something else is desired.
+    * Returns true if tiled, false if not.
+    */
+   virtual bool isImageTiled() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const = 0;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const = 0;
+
+   virtual bool hasMetaData() const;
+
+   virtual ossimRefPtr<ossimNBandLutDataObject> getLut()const;
+
+   virtual bool hasLut() const;
+   
+   /**
+    * There is an external file with an omd extension.  this file contains
+    * additional information about the image such as the null pixel, min and
+    * max values.
+    * For general raster it will contain much more than that.
+    */
+   virtual void loadMetaData();
+
+   /**
+    * Retuns the min pixel value.  If there was an external eta data file
+    * then use the meta data from that file.  If not given then we will
+    * return the default min
+    */
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * @brief convenience method to set min pixel value.
+    *
+    * Added for overview readers so that the image handler that owns the
+    * overview reader can pass on it's min value.
+    *
+    * @param band Zero based band to set.
+    *
+    * @param pix Min pixel value.
+    */
+   virtual void setMinPixelValue(ossim_uint32 band, const ossim_float64& pix);
+
+   /**
+    * @brief convenience method to set max pixel value.
+    *
+    * Added for overview readers so that the image handler that owns the
+    * overview reader can pass on it's max value.
+    *
+    * @param band Zero based band to set.
+    *
+    * @param pix Max pixel value.
+    */
+   virtual void setMaxPixelValue(ossim_uint32 band, const ossim_float64& pix);
+
+   /**
+    * @brief convenience method to set null pixel value.
+    *
+    * Added for overview readers so that the image handler that owns the
+    * overview reader can pass on it's max value.
+    *
+    * @param band Zero based band to set.
+    *
+    * @param pix Null pixel value.
+    */
+   virtual void setNullPixelValue(ossim_uint32 band, const ossim_float64& pix);
+    
+   /**
+    * @return The current entry number.
+    *
+    * @note This implementation returns 0.  Derived classes should override
+    * if of multiple entry image type.
+    */
+   virtual ossim_uint32 getCurrentEntry()const;
+   
+   /**
+    * @return The number of entries (images) in the image file.
+    */
+   virtual ossim_uint32 getNumberOfEntries()const;
+
+   /**
+    * @brief Get the name of entry as a string.
+    *
+    * This implementation clears name. Derived classes that support multiple
+    * entries and have "named" entries should re-implement to provide entry
+    * names.  Example given from HDF5 file:
+    * 
+    * entry_name: /All_Data/VIIRS-IMG-GTM-EDR-GEO_All/QF1_VIIRSGTMGEO
+    *
+    * @param entryIdx Zero based entry index. If out of range name will
+    * be cleared.
+    * 
+    * @param name Initialized by this.
+    */
+   virtual void getEntryName( ossim_uint32 entryIdx,
+                              std::string& name ) const;
+   
+   /**
+    * @param entryList This is the list to initialize with entry indexes.
+    *
+    * @note This implementation returns puts one entry "0" in the list.
+    */
+   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
+   
+   /**
+    * @param getEntryNames List to initialize with strings associated with
+    * entries.
+    *
+    * @note This implementation calls getEntryList and converts entries in
+    * the list to strings.  Derived classes that support multiple entries
+    * with associated strings should re-implement.
+    */
+   virtual void getEntryNames(std::vector<ossimString>& entryNames) const;
+
+   /**
+    * @brief Convenience method to determine if entry index should be used for
+    * support files, e.g. file.his or file_e1.his.
+    * 
+    * @returns true if file is open, &&
+    * ( (entryList.size() > 1) || (entryList[0] != 0) )
+    * false otherwise.
+    *
+    * @note This is just a hint.  Put here as code was duplicated everywhere.
+    * Callers can do what they wish.
+    */
+   bool useEntryIndex() const;
+   
+   ossimFilename getOverviewFile()const;
+
+   /**
+    * @param entryIdx Entry number to select.
+    *
+    * @note The implementation does nothing.  Derived classes that handle
+    * multiple images should override.
+    *
+    * @return true if it was able to set the current entry and false otherwise.
+    */
+   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   /**
+    * @brief Returns the image file with extension set using supplentary
+    * directory for dirname if set.
+    *
+    * Default behaviour is to add the "_en.ext" only if the file is
+    * multi-entry. Use set_e0_prefix to override this.
+    *
+    * Examples:
+    * 
+    * - theImageFile          = "foo.hdf"
+    * - The number of entries = 1
+    * - ext parameter         = "geom"
+    * - return of method will = "foo.geom"
+    *
+    * - theImageFile          = "foo.hdf"
+    * - The number of entries = 12
+    * - The current entry     = 3
+    * - ext parameter         = "geom"
+    * - return of method will = "foo_e3.geom"
+    *
+    * @param ext Extension to tack onto file.  Can have or have not ".", it
+    * will be added if "." is not the first character.
+    *
+    * @param set_e0_prefix If true and the number of entries = 1 then
+    * "foo.geom" would come out "foo_e0.geom" instead. Default = false.
+    * 
+    * @return theImageFile with the extension replaced with ext.
+    */
+   ossimFilename getFilenameWithThisExtension(const ossimString& ext,
+                                              bool set_e0_prefix=false) const;
+
+   /**
+    * Returns the image file with extension set using supplentary directory
+    * for dirname if set. This is like the getFilenameWithThisExtension(...)
+    * method except it does NOT add the "_en" if image is multi entry.
+    *
+    * Examples:
+    * 
+    * - theImageFile          = "foo.tif"
+    * - ext parameter         = "geom"
+    * - return of method will = "foo.geom"
+    *
+    * @param ext Extension to tack onto file.  Can have or have not ".", it
+    * will be added if "." is not the first character.
+    *
+    * @param f Initialized by this.
+    */
+   void getFilenameWithThisExt( const ossimString& ext,
+                                ossimFilename& f ) const;
+     
+   ossim_uint32 getStartingResLevel() const;
+   
+   void setStartingResLevel(ossim_uint32 level);
+   
+   /** @return theOpenOverviewFlag */
+   bool getOpenOverviewFlag() const;
+   
+   /**
+    * @brief Sets theOpenOverviewFlag.
+    *
+    * If true opening of overviews will be attempted on normal open.  If
+    * false only the base image will be opened (shallow open).
+    * Defaulted to true in constructor.
+    */
+   void setOpenOverviewFlag(bool flag);
+   
+   /**
+    * Sets the supplementary directory
+    */
+   virtual void setSupplementaryDirectory(const ossimFilename& dir);
+   
+   /**
+    * Returns the supplementary directory
+    */
+   virtual const ossimFilename& getSupplementaryDirectory()const;
+   
+   //! Fetches the image ID. This is initialized to -1 in the constructor but is searched for in 
+   //! loadState():
+   const ossimString& getImageID() const { return theImageID; }
+   
+   //! Sets the image ID in case it is externally generated
+   void setImageID(const ossimString&  id) { theImageID = id; }
+
+   //! Returns the raster pixel alignment type. OSSIM treats all alignments internally as
+   //! pixel-is-point. This is only a flag to identify the source's alignment type.
+   ossimPixelType getPixelType() const { return thePixelType; }
+   
+   /**
+    * @brief Convenience method to get the zero based rgb output band list.
+    *
+    * This method returns false and is here only so derived classes can
+    * override.
+    * 
+    * @param bandList
+    * @return false
+    */
+   virtual bool getRgbBandList(std::vector<ossim_uint32>& bandList) const;
+
+protected:
+   
+   /**
+    * Returns the image geometry object associated with this tile source or
+    * NULL if non defined.  The geometry contains full-to-local image
+    * transform as well as projection (image-to-world).
+    *
+    * This method just looks for external .geom style override only.
+    * If you want to go through a registry then call getImageGeometry().
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getExternalImageGeometry() const;
+   
+   virtual ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const;
+   
+   /**
+    * @brief Method to get an overview tile.  Derived classes should override if
+    * they have built in overviews or something different than the standard
+    * external overview file.  Image handlers can call this method from getTile
+    * in place of inlining code or if derived class needs to override this
+    * method.
+    *
+    * @param resLevel The resolution level to pull from with resLevel 0 being
+    * full res.
+    * 
+    * @param result The tile to stuff. 
+    * passing. 
+    *
+    * @return true on success false on error.  Typically this will return false
+    * if resLevel==0 unless the overview has r0.  If return is false, result
+    * is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData* result);  
+   
+   /**
+    *  Opens file and attempts to initialize the valid image vertices.
+    *  Returns true on success, false on error.
+    */
+   bool initVertices(const char* file);
+   
+   /**
+    * Will complete the opening process.  
+    * If there are overviews it will open them. 
+    * If there is meta data it will open that and if there
+    * is valid vertices it will open that.
+    */
+   virtual void completeOpen();
+   
+   /**
+    * @brief Convenience method to set things needed in the image geometry from
+    * the image handler.  At time of writing sets the decimation and image size.
+    * @param geom ossimImageGeometry to initiale.
+    */
+   void initImageParameters(ossimImageGeometry* geom) const;
+   
+   /**
+    * @brief Virtual method determines the decimation factors at each resolution level. This
+    * base class implementation computes the decimation by considering the ratios in image size
+    * between resolution levels, with fuzzy logic for rounding ratios to the nearest power of 2
+    * if possible. Derived classes need to override this method if the decimations are provided
+    * as part of the image metadata.
+    */
+   virtual void establishDecimationFactors();
+
+   /**
+    * @brief Convenience method to set output band list.
+    *
+    * This performs range checking and calls theOverview->setOutputBandList
+    * on success.
+    * 
+    * @param inBandList The new band list.
+    * @param outBandList Band list to initialize.
+    * @return true on success, false on error.
+    */
+   virtual bool setOutputBandList(const std::vector<ossim_uint32>& inBandList,
+                                  std::vector<ossim_uint32>& outBandList);
+
+   
+   /**
+    * @brief Get filename with no extension, using supplentary directory for
+    * dirname if set.
+    *
+    * Examples:
+    * 
+    * f = "foo.tif"
+    * f = "foo"
+    */
+   void getFilenameWithNoExtension( ossimFilename& f ) const;
+
+   ossimFilename theImageFile;
+   ossimFilename theOverviewFile;
+   ossimFilename theSupplementaryDirectory;
+   ossimRefPtr<ossimImageHandler> theOverview;
+   vector<ossimIpt> theValidImageVertices;
+   ossimImageMetaData theMetaData;
+   mutable ossimRefPtr<ossimImageGeometry> theGeometry;
+   ossimRefPtr<ossimNBandLutDataObject> theLut;
+   std::vector<ossimDpt> theDecimationFactors;
+   ossimString theImageID;
+
+   /**
+    * theStartingResLevel If set to something other than zero(default) this is
+    * indicative that the reader is an overview.
+    */
+   ossim_uint32 theStartingResLevel; // 0 being full or highest res.
+
+   /**
+    * If true opening of overviews will be attempted.  If false only the base
+    * image will be opened (shallow open). Defaulted to true in constructor.
+    */
+   bool theOpenOverviewFlag;
+   mutable ossimPixelType thePixelType; // pixel-is-point or pixel-is-area
+   
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageHandler_HEADER */
diff --git a/include/ossim/imaging/ossimImageHandlerFactory.h b/include/ossim/imaging/ossimImageHandlerFactory.h
new file mode 100644
index 0000000..df94754
--- /dev/null
+++ b/include/ossim/imaging/ossimImageHandlerFactory.h
@@ -0,0 +1,130 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for ossimImageHandlerFactoryMaker.
+//*******************************************************************
+// $Id$
+
+#ifndef ossimImageHandlerFactory_HEADER
+#define ossimImageHandlerFactory_HEADER 1
+
+#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
+#include <ossim/base/ossimString.h>
+
+class ossimImageHandler;
+class ossimFilename;
+class ossimKeywordlist;
+
+//*******************************************************************
+// CLASS:  ossimImageHandlerFactory
+//*******************************************************************
+class OSSIMDLLEXPORT ossimImageHandlerFactory : public ossimImageHandlerFactoryBase
+{
+public:
+   virtual ~ossimImageHandlerFactory();
+   static ossimImageHandlerFactory* instance();
+
+   /**
+    * @param openOverview If true image handler will attempt to open overview.
+    * default = true
+    */
+   virtual ossimImageHandler* open(const ossimFilename& fileName,
+                                   bool openOverview=true)const;
+   virtual ossimImageHandler* open(const ossimKeywordlist& kwl,
+                                   const char* prefix=0)const;
+   
+   /**
+    * @brief Open method that takes a stream.
+    * @param str Open stream to image.
+    * @param connectionString
+    * @param openOverview If true attempt to open overview file. 
+    * @return ossimImageHandler
+    */
+   virtual ossimRefPtr<ossimImageHandler> open(
+      std::shared_ptr<ossim::istream>& str,
+      const std::string& connectionString,
+      bool openOverview ) const;
+
+   /**
+    * @brief Open overview that takes a file name.
+    * 
+    * @param file File to open.
+    * 
+    * @return ossimRefPtr to image handler on success or null on failure.
+    */
+   virtual ossimRefPtr<ossimImageHandler> openOverview(
+      const ossimFilename& file ) const;
+   
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+   
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const;
+   
+   /*!
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+   virtual void getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const;
+   virtual void getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& ext)const;
+   virtual void getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const;
+   
+protected:
+
+   /**
+    * @brief Open dot.src (ossimSrcRecord).
+    *
+    * Currently only opens a single image.  Can be used for split base image
+    * with overviews and histograms in a separate "support" directory.
+    *
+    * Input record example:
+    * 
+    * ossim_src_record_version: 1.0
+    * image0.entry: 0
+    * image0.file: s3://your_bucket/data1/test/data/public/tif/ls7-ff-fusion.tif
+    * image0.ovr: /data1/s3_test/ls7-ff-fusion.ovr
+    * image0.hist: /data1/s3_test/ls7-ff-fusion.his
+    * image0.support: /data1/s3_test
+    *
+    * @param str Open stream to src record.
+    * @param connectionString Path to src file.
+    * @param openOverview If true attempt to open overview file.
+    * @return ossimRefPtr to image handler on success or null on failure.
+    */
+   ossimRefPtr<ossimImageHandler> openSrcRecord(std::shared_ptr<ossim::istream>& str,
+                                                const std::string& connectionString,
+                                                bool openOverview ) const;
+
+   /**
+    * @brief Open method that looks at extension e.g. "tif", "jpg" to select
+    * class to open.
+    *
+    * This is to be called by standard open before just going down the list
+    * of classes the brute force hard way.
+    * 
+    * @param fileName The filename to open.
+    * 
+    * @return Pointer to image handler or null if nothing opened.
+    */
+//   virtual ossimImageHandler* openFromExtension(
+//      const ossimFilename& fileName) const;
+  
+   ossimImageHandlerFactory(){}
+   ossimImageHandlerFactory(const ossimImageHandlerFactory&){}
+   void operator = (const ossimImageHandlerFactory&){}
+
+   static ossimImageHandlerFactory* theInstance;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimImageHandlerFactoryBase.h b/include/ossim/imaging/ossimImageHandlerFactoryBase.h
new file mode 100644
index 0000000..cb81cec
--- /dev/null
+++ b/include/ossim/imaging/ossimImageHandlerFactoryBase.h
@@ -0,0 +1,142 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author:  Garrett Potts
+//
+//*******************************************************************
+// $Id$
+
+#ifndef ossimImageHandlerFactoryBase_HEADER
+#define ossimImageHandlerFactoryBase_HEADER 1
+
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <algorithm>
+#include <iosfwd>
+#include <memory>
+#include <vector>
+
+class ossimFilename;
+class ossimKeywordlist;
+
+class OSSIM_DLL ossimImageHandlerFactoryBase : public ossimObjectFactory
+{
+public:
+   template <class T> class UniqueList
+   {
+   public:
+      
+      void push_back(const T& value)
+      {
+         if(std::find(theList.begin(),theList.end(), value) == theList.end())
+         {
+            theList.push_back(value);
+         }
+      }
+
+      const std::vector<T>& getList()const
+      {
+         return theList;
+      }
+      ossim_uint32 size()const
+      {
+         return theList.size();
+      }
+      const T& operator[](ossim_uint32 idx)const
+      {
+         return theList[idx];
+      }
+      T& operator[](ossim_uint32 idx)
+      {
+         return theList[idx];
+      }
+   protected:
+      std::vector<T> theList;
+   };
+   
+   typedef UniqueList<ossimString> UniqueStringList;
+   typedef std::vector<ossimRefPtr<ossimImageHandler> > ImageHandlerList;
+   
+   virtual ossimImageHandler* open(const ossimFilename& fileName,
+                                   bool openOverview=true)const = 0;
+   virtual ossimImageHandler* open(const ossimKeywordlist& kwl,
+                                   const char* prefix=0)const = 0;
+#if 0
+   /**
+    *  @brief Open method.
+    *
+    *  This open takes a stream, position and a flag.
+    *
+    *  @param str Open stream to image.
+    *
+    *  @param restartPosition Typically 0, this is the stream offset to the
+    *  front of the image.
+    *
+    *  @param youOwnIt If true the opener takes ownership of the stream
+    *  pointer and will destroy on close.
+    *  
+    *  @return This implementation returns an ossimRefPtr with a null pointer.
+    */
+   virtual ossimRefPtr<ossimImageHandler> open( ossim::istream* str,
+                                                std::streamoff restartPosition,
+                                                bool youOwnIt ) const;
+#endif
+   
+   /**
+    * @brief Open method that takes a stream.
+    *
+    * This implementation returns an ossimRefPtr with a null pointer.
+    * 
+    * @param str Open stream to image.
+    * @param connectionString
+    * @param openOverview If true attempt to open overview file. 
+    * @return ossimImageHandler
+    */
+   virtual ossimRefPtr<ossimImageHandler> open(
+      std::shared_ptr<ossim::istream>& str,
+      const std::string& connectionString,
+      bool openOverview=true ) const;
+
+   /**
+    * @brief Open overview that takes a file name.
+    *
+    * This default implementation returns a null ref pointer.
+    * Derived factories that have overview readers should override.
+    * 
+    * @param file File to open.
+    *
+    * @return This default implementation returns a null ref pointer.
+    */
+   virtual ossimRefPtr<ossimImageHandler> openOverview(
+      const ossimFilename& file ) const;
+
+   /**
+    * @brief Open method that takes a stream.
+    *
+    * This implementation returns an ossimRefPtr with a null pointer.
+    * 
+    * @param str Open stream to image.
+    * @param connectionString
+    * @return ossimImageHandler
+    */
+   virtual ossimRefPtr<ossimImageHandler> openOverview(
+      std::shared_ptr<ossim::istream>& str,
+      const ossimString& connectionString ) const;
+
+
+   virtual void getImageHandlersBySuffix(ImageHandlerList& result,
+                                         const ossimString& ext)const;
+
+   virtual void getImageHandlersByMimeType(ImageHandlerList& result,
+                                           const ossimString& mimeType)const;
+
+   virtual void getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const=0;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimImageHandlerRegistry.h b/include/ossim/imaging/ossimImageHandlerRegistry.h
new file mode 100644
index 0000000..b0e5674
--- /dev/null
+++ b/include/ossim/imaging/ossimImageHandlerRegistry.h
@@ -0,0 +1,175 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  Garrett Potts
+//
+// Description:  Contains class definition for the class
+//               ImageHandlerRegistry.
+//
+//*******************************************************************
+//  $Id: ossimImageHandlerRegistry.h 22636 2014-02-23 17:55:50Z dburken $
+
+#ifndef ossimImageHandlerRegistry_HEADER
+#define ossimImageHandlerRegistry_HEADER 1
+
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
+#include <ossim/base/ossimFactoryListInterface.h>
+#include <iosfwd>
+#include <vector>
+#include <memory>
+
+class ossimImageHandler;
+class ossimFilename;
+class ossimKeywordlist;
+
+class OSSIMDLLEXPORT ossimImageHandlerRegistry : public ossimObjectFactory,
+                                                public ossimFactoryListInterface<ossimImageHandlerFactoryBase, ossimImageHandler>
+{
+public:
+   virtual ~ossimImageHandlerRegistry();
+   
+   static ossimImageHandlerRegistry* instance();
+
+   ossimRefPtr<ossimImageHandler> openConnection(
+      const ossimString& connectionString, bool openOverview=true  )const;
+   
+   /**
+    * @brief open that takes a filename.
+    * @param fileName File to open.
+    * @param trySuffixFirst If true calls code to try to open by suffix first,
+    * then goes through the list of available handlers. default=true.
+    * @param openOverview If true image handler will attempt to open overview.
+    * default = true
+    * @return Pointer to image handler or null if cannot open.
+    */
+   virtual ossimImageHandler* open(const ossimFilename& fileName,
+                                   bool trySuffixFirst=true,
+                                   bool openOverview=true)const;
+   
+   /**
+    *  Given a keyword list return a pointer to an ImageHandler.  Returns
+    *  null if a valid handler cannot be found.
+    */
+   virtual ossimImageHandler* open(const ossimKeywordlist& kwl,
+                                   const char* prefix=0)const;
+   
+   /**
+    * @brief Open method that takes a stream.
+    * @param str Open stream to image.
+    * @param connectionString
+    * @param openOverview If true attempt to open overview file. 
+    * @return ossimImageHandler
+    */
+   virtual ossimRefPtr<ossimImageHandler> open(
+      std::shared_ptr<ossim::istream>& str,
+      const std::string& connectionString,
+      bool openOverview ) const;
+   
+#if 0   
+   /**
+    *  @brief Open method.
+    *
+    *  This open takes a stream, position and a flag.
+    *
+    *  @param str Open stream to image.
+    *
+    *  @param restartPosition Typically 0, this is the stream offset to the
+    *  front of the image.
+    *
+    *  @param youOwnIt If true the opener takes ownership of the stream
+    *  pointer and will destroy on close.
+    *  
+    *  @return This implementation returns an ossimRefPtr with a null pointer.
+    */
+   virtual ossimRefPtr<ossimImageHandler> open(
+      ossim::istream* str,
+      std::streamoff restartPosition,
+      bool youOwnIt ) const;   
+#endif
+   
+   /**
+    * @brief Open overview that takes a file name.
+    *
+    * This will only check readers that can be overview handlers.
+    * 
+    * @param file File to open.
+    * 
+    * @return ossimRefPtr to image handler on success or null on failure.
+    */
+   virtual ossimRefPtr<ossimImageHandler> openOverview(
+      const ossimFilename& file ) const;
+
+   /*!
+    * Creates an object given a type name.
+    */
+   virtual ossimObject* createObject(const ossimString& typeName) const;
+   
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const;
+
+   /**
+    * openBySuffix will call the mthod getImageHandlersBySuffix and go through
+    * each handler to try and open the file.  This should be a faster open
+    * for we do not have to do a magic number compare on all prior files and
+    * keep opening and closing files.
+    * @param openOverview If true image handler will attempt to open overview.
+    * default = true
+    */
+   virtual ossimRefPtr<ossimImageHandler> openBySuffix(const ossimFilename& file,
+                                                       bool openOverview=true)const; 
+   
+   /**
+    *
+    * Will add to the result list any handler that supports the passed in extensions
+    *
+    */
+   virtual void getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result,
+                                         const ossimString& ext)const;
+   /**
+    *
+    * Will add to the result list and handler that supports the passed in mime type
+    *
+    */
+   virtual void getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result,
+                                           const ossimString& mimeType)const;
+   
+   /*!
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList( std::vector<ossimString>& typeList ) const;
+
+   virtual void getSupportedExtensions(
+      ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const;
+
+   /**
+    * @brief Prints list of readers and properties.
+    * @param  out Stream to print to.
+    * @return std::ostream&
+    */
+   std::ostream& printReaderProps(std::ostream& out) const;
+   
+protected:
+   ossimImageHandlerRegistry();
+   ossimImageHandlerRegistry(const ossimImageHandlerRegistry& rhs);
+   const ossimImageHandlerRegistry&
+      operator=(const ossimImageHandlerRegistry& rhs);
+   
+   //static ossimImageHandlerRegistry*            theInstance;
+   
+TYPE_DATA
+};
+
+extern "C"
+{
+   OSSIM_DLL  void* ossimImageHandlerRegistryGetInstance();
+}
+
+#endif /* #ifndef ossimImageHandlerRegistry_HEADER */
diff --git a/include/ossim/imaging/ossimImageHistogramSource.h b/include/ossim/imaging/ossimImageHistogramSource.h
new file mode 100644
index 0000000..d82ce92
--- /dev/null
+++ b/include/ossim/imaging/ossimImageHistogramSource.h
@@ -0,0 +1,107 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageHistogramSource.h 22737 2014-04-16 18:53:57Z gpotts $
+#ifndef ossimImageHistogramSource_HEADER
+#define ossimImageHistogramSource_HEADER
+#include <ossim/base/ossimHistogramSource.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimObjectEvents.h>
+#include <ossim/base/ossimIrect.h>
+
+/*!
+ * This source expects as input an ossimImageSource.
+ * it will slice up the requested region into tiles and compute
+ * the histogram of the passed in rectangle.
+ */
+class OSSIMDLLEXPORT ossimImageHistogramSource : public ossimHistogramSource,
+                                                 public ossimConnectableObjectListener,
+                                                 public ossimProcessInterface
+{
+public:
+
+   ossimImageHistogramSource(ossimObject* owner = 0);
+   
+   virtual ossimObject* getObject();
+   virtual const ossimObject* getObject()const;
+
+   void setAreaOfInterest(const ossimIrect& rect);
+
+   ossimIrect getAreaOfInterest()const;
+
+   void getAreaOfInterest(ossimIrect& rect)const;
+
+   virtual ossim_uint32 getMaxNumberOfRLevels()const;
+
+   virtual void setMaxNumberOfRLevels(ossim_uint32 number);
+
+   /*!
+    * The first argument is the region of interest that you wish to
+    * use for the histogram.  If the region is different than
+    * what it has already computed before then the histogram is considered
+    * dirty and will be re-computed.  The returned object is a
+    * multi-reslevel histogram
+    */
+   virtual ossimRefPtr<ossimMultiResLevelHistogram> getHistogram(const ossimIrect& rect);
+
+   virtual ossimRefPtr<ossimMultiResLevelHistogram> getHistogram();
+   virtual bool execute();
+   
+   virtual bool canConnectMyInputTo(ossim_int32 myInputIndex,
+                                    const ossimConnectableObject* object)const;
+
+   void setNumberOfBinsOverride(ossim_int32 numberOfBinsOverride);
+
+   void setMinValueOverride(ossim_float32 minValueOverride);
+
+   void setMaxValueOverride(ossim_float32 maxValueOverride);
+   void setNumberOfTiles(ossim_uint32 numberOfTiles);
+
+   ossimHistogramMode getComputationMode()const;
+   void setComputationMode(ossimHistogramMode mode);
+	
+   virtual void propertyEvent(ossimPropertyEvent& event);
+   
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+	
+protected:
+   virtual ~ossimImageHistogramSource();
+
+   void getBinInformation(ossim_uint32& numberOfBins,
+                          ossim_float64& minValue,
+                          ossim_float64& maxValue,
+                          ossim_uint32 band)const;
+   virtual void computeNormalModeHistogram();
+   virtual void computeFastModeHistogram();
+   
+   /*!
+    * Initialized to ossimNAN'S
+    */
+   ossimIrect theAreaOfInterest;
+   bool       theHistogramRecomputeFlag;
+   
+   /*!
+    * Will default to 1.  This means it will use up to max
+    * number of res levels for the histogram.
+    */
+   ossim_uint32       theMaxNumberOfResLevels; 
+   ossim_float64      theMinValueOverride;
+   ossim_float64      theMaxValueOverride;
+   ossim_int32        theNumberOfBinsOverride;
+   ossimHistogramMode theComputationMode;
+   // ossim_uint32       theNumberOfTilesToUseInFastMode;
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimImageMetaData.h b/include/ossim/imaging/ossimImageMetaData.h
new file mode 100644
index 0000000..88cdcfe
--- /dev/null
+++ b/include/ossim/imaging/ossimImageMetaData.h
@@ -0,0 +1,167 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Contains class declaration for ossimImageMetaData.
+// 
+//*******************************************************************
+//  $Id: ossimImageMetaData.h 21527 2012-08-26 16:50:49Z dburken $
+#ifndef ossimImageMetaData_HEADER
+#define ossimImageMetaData_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+class ossimKeywordlist;
+
+class OSSIM_DLL ossimImageMetaData
+{
+public:
+   ossimImageMetaData();
+   ossimImageMetaData(ossimScalarType aType,
+                      ossim_uint32 numberOfBands);
+   ossimImageMetaData(const ossimImageMetaData& rhs);
+
+   const ossimImageMetaData& operator=(const ossimImageMetaData& rhs);
+   
+   ~ossimImageMetaData();
+   
+   void clear();
+
+   void setDefaultsForArrays();
+   
+   void setNumberOfBands(ossim_uint32 numberOfBands);
+   
+   ossim_uint32 getNumberOfBands()const;
+
+   /**
+    * @return string reference containing rgb band order, e.g. "(2,1,0)".
+    * Will be an emptry string if not set.
+    */
+   const std::string& getRgbBands() const;
+
+   /**
+    * @brief Convenience method to get the zero based rgb output band list.
+    *
+    * This method returns true on success; false, if rgb_bands key is not set
+    * in dot omd file.
+    *
+    * @note: Current ossimImageMetaData logic requires key "number_bands" to
+    * be set and at least 3.
+    * 
+    * @param bandList Initialized by this on success.
+    * 
+    * @return false
+    */
+   bool getRgbBands(std::vector<ossim_uint32>& bandList) const;
+   
+   void setScalarType(ossimScalarType aType);
+   
+   ossimScalarType getScalarType()const;
+
+   /** @return The bytes per pixel. This is for a single band. */
+   ossim_uint32 getBytesPerPixel() const;
+   
+   double getMinPix(ossim_uint32 band)const;
+   
+   void setMinPix(ossim_uint32 band, double pix);
+   
+   void setMaxPix(ossim_uint32 band, double pix);
+   
+   void setNullPix(ossim_uint32 band, double pix);
+   
+   double getMaxPix(ossim_uint32 band)const;
+   
+   double getNullPix(ossim_uint32 band)const;
+   
+   const double* getMinPixelArray()const;
+   
+   const double* getMaxPixelArray()const;
+   
+   const double* getNullPixelArray()const;
+
+   void setMinValuesValid(bool flag);
+   
+   void setMaxValuesValid(bool flag);
+   
+   void setNullValuesValid(bool flag);
+
+   bool getMinValuesValidFlag()const;
+
+   bool getMaxValuesValidFlag()const;
+
+   bool getNullValuesValidFlag()const;
+
+   bool isValid()const;
+   
+   bool loadState(const ossimKeywordlist& kwl,
+                  const char* prefix=0);
+   bool saveState(ossimKeywordlist& kwl,
+                  const char* prefix=0)const;
+
+   /**
+    * @brief Method to update band values.
+    *
+    * Assumes a previous initialization and does not error out if band data is
+    * not found.  This does NOT clear the object prior to loading like the
+    * loadState(...) method.  Can be used to update min/max values from a
+    * "compute min max".  
+    *
+    * @param kwl Keyword list to initialize from.
+    *
+    * @param prefix Prefix, e.g. "image0.".
+    */
+   void updateMetaData( const ossimKeywordlist& kwl,
+                        const std::string& prefix );
+
+   /**
+    * @brief Print method.
+    * @return std::ostream&
+    */
+   std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @note  Since the print method is virtual, derived classes only need
+    *        to implement that, not an addition operator<<.
+    */
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out,
+                                             const ossimImageMetaData& obj);
+   
+private:
+
+   /**
+    * Looks for ossimKeywordNames::NUMBER_BANDS_KW, if not found looks for.
+    */
+   ossim_uint32 getBandCount(const ossimKeywordlist& kwl,
+                             const std::string& prefix) const;
+   
+   double*         theNullPixelArray;
+   double*         theMinPixelArray;
+   double*         theMaxPixelArray;
+  
+   bool            theMinValuesValidFlag;
+   bool            theMaxValuesValidFlag;
+   bool            theNullValuesValidFlag;
+   
+   ossimScalarType theScalarType;
+   ossim_uint32    theBytesPerPixel;
+   ossim_uint32    theNumberOfBands;
+
+   //---
+   // String containing rgb bands, e.g. (2,1,0);
+   // Added to allow tiled tiffs to set band selection correctly by picking
+   // up order from omd file.
+   //---
+   std::string theRgbBands; 
+};
+
+#endif /* #ifndef ossimImageMetaData_HEADER */
diff --git a/include/ossim/imaging/ossimImageMetaDataWriterFactory.h b/include/ossim/imaging/ossimImageMetaDataWriterFactory.h
new file mode 100644
index 0000000..e9493e8
--- /dev/null
+++ b/include/ossim/imaging/ossimImageMetaDataWriterFactory.h
@@ -0,0 +1,87 @@
+//*******************************************************************
+// Copyright (C) 2003 Storage Area Networks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kenneth Melero (kmelero at sanz.com)
+//
+//*******************************************************************
+//  $Id: ossimImageMetaDataWriterFactory.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef ossimImageMetaDataWriterFactory_HEADER
+#define ossimImageMetaDataWriterFactory_HEADER
+
+#include <ossim/imaging/ossimImageMetaDataWriterFactoryBase.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimMetadataFileWriter;
+
+class OSSIMDLLEXPORT ossimImageMetaDataWriterFactory:
+   public ossimImageMetaDataWriterFactoryBase
+{
+public:
+   ~ossimImageMetaDataWriterFactory();
+
+   static ossimImageMetaDataWriterFactory* instance();
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const;
+
+   /**
+    * Creates a writer from either a class name or a string representing the
+    * meta data type like "tiff_world_file".
+    *
+    * @return ossimRefPtr<ossimMetadataFileWriter>
+    *
+    * @note Return can have a null pointer if type is not found in a factory so
+    * the caller should always check the pointer like:
+    * ossimRefPtr<ossimMetadataFileWriter> mw =
+    *    ossimImageMetaDataWriterRegistry::instance("ossim_readme");
+    * if (!mw.valid())
+    * {
+    *    // not in factory
+    * }
+    */
+   virtual ossimRefPtr<ossimMetadataFileWriter> createWriter(
+      const ossimString& type)const;
+
+   /**
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+
+   /**
+    * Satisfies pure virtual from ossimImageMetaDataWriterFactoryBase.
+    * 
+    * Appends the meta data writers types from each of the supported meta
+    * data writers in this factor to the "metadatatypeList".
+    * 
+    * This is the actual metadata type name like:
+    *   ossim_geometry
+    *   envi_header
+    *   tiff_world_file
+    *   jpeg_world_file
+    *   
+    * @param metadatatypeList stl::vector<ossimString> List to append to.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList) const;
+ 
+protected:
+   static ossimImageMetaDataWriterFactory* theInstance;
+
+   ossimImageMetaDataWriterFactory();
+
+   ossimImageMetaDataWriterFactory(const ossimImageMetaDataWriterFactory& rhs);
+
+   const ossimImageMetaDataWriterFactory& operator =(
+      const ossimImageMetaDataWriterFactory& rhs);
+   
+TYPE_DATA 
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimImageMetaDataWriterFactoryBase.h b/include/ossim/imaging/ossimImageMetaDataWriterFactoryBase.h
new file mode 100644
index 0000000..cb1013d
--- /dev/null
+++ b/include/ossim/imaging/ossimImageMetaDataWriterFactoryBase.h
@@ -0,0 +1,67 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//----------------------------------------------------------------------------
+// $Id: ossimImageMetaDataWriterFactoryBase.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimImageMetaDataWriterFactoryBase_HEADER
+#define ossimImageMetaDataWriterFactoryBase_HEADER
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimMetadataFileWriter;
+
+class ossimImageMetaDataWriterFactoryBase : public ossimObjectFactory
+{
+public:
+   /**
+    * Pure virtual.  All ossimImageMetaDataWriterFactories must implement.
+    * 
+    * Creates a writer from either a class name or a string representing the
+    * meta data type like "tiff_world_file".
+    *
+    * @return ossimRefPtr<ossimMetadataFileWriter>
+    *
+    * @note Return can have a null pointer if type is not found in a factory so
+    * the caller should always check the pointer like:
+    * ossimRefPtr<ossimMetadataFileWriter> mw =
+    *    ossimImageMetaDataWriterRegistry::instance("ossim_readme");
+    * if (!mw.valid())
+    * {
+    *    // not in factory
+    * }
+    */
+   virtual ossimRefPtr<ossimMetadataFileWriter> createWriter(
+      const ossimString& type)const=0;
+
+   /**
+    * Pure virtual.  All ossimImageMetaDataWriterFactories must implement.
+    * 
+    * Appends the meta data writers types to the "metadatatypeList".
+    * 
+    * This is the actual metadata type name like:
+    *   ossim_geometry
+    *   envi_header
+    *   tiff_world_file
+    *   jpeg_world_file
+    *   
+    * @param metadatatypeList stl::vector<ossimString> List to append to.
+    *
+    * @note All writers should append to the list, not, clear it and then add
+    * their types.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList) const=0;
+
+protected:
+   ossimImageMetaDataWriterFactoryBase();
+   
+   ossimImageMetaDataWriterFactoryBase(
+      const ossimImageMetaDataWriterFactoryBase&);
+   
+   const ossimImageMetaDataWriterFactoryBase& operator=(
+      const ossimImageMetaDataWriterFactoryBase&);
+
+TYPE_DATA
+};
+#endif
diff --git a/include/ossim/imaging/ossimImageMetaDataWriterRegistry.h b/include/ossim/imaging/ossimImageMetaDataWriterRegistry.h
new file mode 100644
index 0000000..ea62f65
--- /dev/null
+++ b/include/ossim/imaging/ossimImageMetaDataWriterRegistry.h
@@ -0,0 +1,98 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//----------------------------------------------------------------------------
+// $Id: ossimImageMetaDataWriterRegistry.h 13508 2008-08-27 15:51:38Z gpotts $
+
+#ifndef ossimImageMetaDataWriterRegistry_HEADER
+#define ossimImageMetaDataWriterRegistry_HEADER
+#include <ossim/imaging/ossimImageMetaDataWriterFactoryBase.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimMetadataFileWriter;
+
+class OSSIMDLLEXPORT ossimImageMetaDataWriterRegistry :
+   public ossimImageMetaDataWriterFactoryBase
+{
+public:
+   ~ossimImageMetaDataWriterRegistry();
+   
+   static ossimImageMetaDataWriterRegistry* instance();
+   
+   void registerFactory(ossimImageMetaDataWriterFactoryBase* factory);
+   void unregisterFactory(ossimImageMetaDataWriterFactoryBase* factory);
+   bool findFactory(ossimImageMetaDataWriterFactoryBase* factory)const;
+   /**
+    * Creates an object given a type name.
+    */
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+
+   /**
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const;
+
+   /**
+    * Creates a writer from either a class name or a string representing the
+    * meta data type like "tiff_world_file".
+    *
+    * @return ossimRefPtr<ossimMetadataFileWriter>
+    *
+    * @note Return can have a null pointer if type is not found in a factory so
+    * the caller should always check the pointer like:
+    * ossimRefPtr<ossimMetadataFileWriter> mw =
+    *    ossimImageMetaDataWriterRegistry::instance("ossim_readme");
+    * if (!mw.valid())
+    * {
+    *    // not in factory
+    * }
+    */
+   virtual ossimRefPtr<ossimMetadataFileWriter> createWriter(
+      const ossimString& type)const;
+   
+   /**
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+
+   /**
+    * Initializes list with meta data types from all registered
+    * metadata factories.
+    * 
+    * This is the actual image type name like:
+    *   ossim_geometry
+    *   envi_header
+    *   tiff_world_file
+    *   jpeg_world_file
+    *   
+    * @param metadatatypeList stl::vector<ossimString> list to append to.
+    *
+    * @note Since this is the master registry for all meta data factories
+    * this method starts by clearing the metadatatypeList.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList)const;
+   
+protected:
+   ossimImageMetaDataWriterRegistry();
+
+   ossimImageMetaDataWriterRegistry(
+      const ossimImageMetaDataWriterRegistry& rhs);
+   
+   const ossimImageMetaDataWriterRegistry& operator=(
+      const ossimImageMetaDataWriterRegistry &rhs);
+
+  // static ossimImageMetaDataWriterRegistry* theInstance;
+   std::vector<ossimImageMetaDataWriterFactoryBase*> theFactoryList;
+};
+
+
+extern "C"
+{
+   OSSIMDLLEXPORT void* ossimImageMetaDataWriterRegistryGetInstance();
+}
+#endif
diff --git a/include/ossim/imaging/ossimImageModel.h b/include/ossim/imaging/ossimImageModel.h
new file mode 100644
index 0000000..3ab9c98
--- /dev/null
+++ b/include/ossim/imaging/ossimImageModel.h
@@ -0,0 +1,189 @@
+//-----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class declaration of ossimImageModel.
+//
+//-----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimImageModel_HEADER
+#define ossimImageModel_HEADER 1
+
+#include <vector>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimRtti.h>
+
+class ossimDrect;
+class ossimImageHandler;
+
+/**
+ * @brief Class to handle transforming image points, rectangles, and offsets
+ * from one reduced resolution data set (rrds) level to another.
+ *
+ * Derived from ossimObject only so users can pass via the
+ * ossimViewInterface::setView method.
+ */
+class OSSIM_DLL ossimImageModel : public ossimObject
+{
+public:
+   
+   /** @brief default constructor */
+   ossimImageModel();
+
+
+   /**
+    * @brief Method to initialize class from an image handler.
+    *
+    * @param ih Image handler.
+    */
+   virtual void initialize(const ossimImageHandler& ih);
+
+   /**
+    * @brief Get r0 point from rn point.
+    * 
+    * @param rrds Source (rnPt) reduced resolution data set.
+    *
+    * @param rnPt The image point to tranform.
+    *
+    * @param r0Pt the Point to initialize.
+    *
+    * @note Throws ossimException on out of range rrds.
+    */
+   void rnToR0(ossim_uint32 rrds,
+               const ossimDpt& rnPt,
+               ossimDpt& r0Pt) const;
+
+   /**
+    * @brief Get r0 point from rn point.
+    *
+    * This requires calling setTargetRrds(ossim_uint32 rrds) to the level
+    * for rnPt.
+    * 
+    * @param rnPt The image point to tranform.
+    *
+    * @param r0Pt the Point to initialize.
+    *
+    * @note Throws ossimException on out of range rrds.
+    *
+    * @see setTargetRrds
+    */
+   void rnToR0(const ossimDpt& rnPt, ossimDpt& r0Pt) const;
+   
+   /**
+    * @brief Get rn point from r0 point.
+    * 
+    * @param rrds Target (rnPt) reduced resolution data set.
+    *
+    * @param r0Pt The image point to tranform.
+    *
+    * @param rnPt the Point to initialize.
+    *
+    * @note Throws ossimException on out of range rrds.
+    */
+   void r0ToRn(ossim_uint32 rrds,
+               const ossimDpt& r0Pt,
+               ossimDpt& rnPt) const;
+
+   /**
+    * @brief Get rn point from r0 point.
+    *
+    * This requires calling setTargetRrds(ossim_uint32 rrds) to the level
+    * for rnPt.
+    * 
+    * @param r0Pt The image point to tranform.
+    *
+    * @param rnPt the Point to initialize.
+    *
+    * @note Throws ossimException on out of range rrds.
+    *
+    * @see setTargetRrds
+    */
+   void r0ToRn(const ossimDpt& r0Pt,
+               ossimDpt& rnPt) const;
+
+   /**
+    * @brief Get the sub image offset for a given resolution level.
+    * 
+    * @param rrds The reduced resolution data set.
+    *
+    * @param offset the Point to initialize.
+    *
+    * @note Throws ossimException on out of range rrds.
+    */
+   void getSubImageOffset(ossim_uint32 rrds, ossimDpt& offset) const;
+
+   /**
+    * @brief Gets the zero-based image rectangle for a given reduced resolution
+    * data set.
+    *
+    * @param rrds The reduced resolution data set.
+    *
+    * @param rect Initialized with image rectangle for rrds.
+    *
+    * @note Throws ossimException on out of range rrds.
+    */
+   void getImageRectangle(ossim_uint32 rrds, ossimDrect& rect) const; 
+   
+   /**
+    * @brief Gets the model-based image rectangle for a given reduced
+    * resolution data set.
+    *
+    * If this image is a sub image the offset is applied.  So if the image
+    * has a sub image offset of (1024, 1024), and has 1024 lines and 1024
+    * samples the rectangle for r0 will be:  (1024, 1024) (2047, 2047)
+    *
+    * @param rrds The reduced resolution data set.
+    *
+    * @param rect Initialized with image rectangle for rrds.
+    *
+    * @note Throws ossimException on out of range rrds.
+    */
+   void getBoundingRectangle(ossim_uint32 rrds, ossimDrect& rect) const;
+
+   /**
+    * @return This returns the total number of decimation levels.
+    */
+   ossim_uint32 getNumberOfDecimationLevels()const;
+
+   /**
+    * @brief Set theTargetRrds data member.
+    *
+    * This is used by methods rnToR0 and r0ToRn that do not take a rrds
+    * argument.
+    *
+    * @param rrds Target reduced resolution data set.
+    */
+   void setTargetRrds(ossim_uint32 rrds);
+
+   /**
+    * @return The target reduced resolution data set.
+    */
+   ossim_uint32 getTargetRrds() const;
+   
+ 
+
+protected:
+   /** @brief virtual destructor */
+   virtual ~ossimImageModel();
+
+   /** Offset from the full image. */
+   ossimDpt theSubImageOffset;
+
+   /** Decimation factors for each rrds level. */
+   std::vector<ossimDpt> theDecimationFactors;
+
+   ossim_uint32 theLines;
+   ossim_uint32 theSamples;
+   ossim_uint32 theTargetRrds;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageModel_HEADER */
diff --git a/include/ossim/imaging/ossimImageMosaic.h b/include/ossim/imaging/ossimImageMosaic.h
new file mode 100644
index 0000000..e5afb34
--- /dev/null
+++ b/include/ossim/imaging/ossimImageMosaic.h
@@ -0,0 +1,73 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageMosaic.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimImageMosaic_HEADER
+#define ossimImageMosaic_HEADER
+#include <vector>
+using namespace std;
+
+#include <ossim/imaging/ossimImageCombiner.h>
+
+
+/**
+ * An image mosaic is a simple combiner that will
+ * just do a simple mosaic.  It just checks NULL pix values until it finds a
+ * pixel that is not empty and copies it out to the output.  The list will
+ * have same size tiles and have the same number of bands.
+ */
+class OSSIMDLLEXPORT ossimImageMosaic : public ossimImageCombiner
+{
+public:
+   ossimImageMosaic();
+   ossimImageMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+protected:
+   virtual ~ossimImageMosaic();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theTile;
+
+   template <class T> ossimRefPtr<ossimImageData> combine(
+      T, // dummy template variable not used
+      const ossimIrect& tileRect,
+      ossim_uint32 resLevel=0);
+   template <class T> ossimRefPtr<ossimImageData> combineNorm(
+      T, // dummy template variable not used
+      const ossimIrect& tileRect,
+      ossim_uint32 resLevel=0);
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageMosaic_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimImageReconstructionFilterFactory.h b/include/ossim/imaging/ossimImageReconstructionFilterFactory.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageReconstructionFilterFactory.h
rename to include/ossim/imaging/ossimImageReconstructionFilterFactory.h
diff --git a/ossim/include/ossim/imaging/ossimImageReconstructionFilterRegistry.h b/include/ossim/imaging/ossimImageReconstructionFilterRegistry.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageReconstructionFilterRegistry.h
rename to include/ossim/imaging/ossimImageReconstructionFilterRegistry.h
diff --git a/include/ossim/imaging/ossimImageRenderer.h b/include/ossim/imaging/ossimImageRenderer.h
new file mode 100644
index 0000000..5816938
--- /dev/null
+++ b/include/ossim/imaging/ossimImageRenderer.h
@@ -0,0 +1,500 @@
+//*******************************************************************
+// Copyright (C) 2001 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*******************************************************************
+// $Id: ossimImageRenderer.h 23548 2015-09-28 21:01:36Z dburken $
+
+#ifndef ossimImageRenderer_HEADER
+#define ossimImageRenderer_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/projection/ossimImageViewTransform.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/base/ossimViewInterface.h>
+#include <ossim/base/ossimRationalNumber.h>
+
+class ossimImageData;
+class ossimDiscreteConvolutionKernel;
+class ossimFilterResampler;
+
+class OSSIMDLLEXPORT ossimImageRenderer : public ossimImageSourceFilter,
+                                          public ossimViewInterface
+{
+public:
+   ossimImageRenderer();
+   ossimImageRenderer(ossimImageSource* inputSource,
+                      ossimImageViewTransform* imageViewTrans = NULL);
+
+   virtual ossimString getLongName()  const;
+   virtual ossimString getShortName() const;
+
+   /**
+    * the resampler will need the tile request to come from the view.
+    * It will use the view to transoform this to world and then use the
+    * image's projection to get it into final line sample.  This way
+    * the resampler can fill a tile width by height on the screen
+    * correctly.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+
+   /**
+    * m_Resampler will adjust the rect to whatever the view is.  So it
+    * will project the full image rect onto the view and return the upright
+    * bounding rect.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+
+   /**
+    * @brief Gets the bounding rectangle of the source.
+    *
+    * This is the output view bounds.
+    * 
+    * @param rect Initialized with bounding rectangle by this.
+    * @param resLevel Reduced resolution level if applicable.
+    */
+   virtual void getBoundingRect(ossimIrect& rect,
+                                ossim_uint32 resLevel=0) const;
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   void setImageViewTransform(ossimImageViewTransform* transform);
+   ossimImageViewTransform* getImageViewTransform() { return m_ImageViewTransform.get(); }
+
+   //! Returns instance to the input image geometry. This may be a NULL pointer.
+   //! This is only valid if the IVT is a projection type IVT (IVPT) 
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   virtual bool setView(ossimObject* baseObject);
+   ossimFilterResampler* getResampler() { return m_Resampler; }
+   virtual ossimObject* getView();
+   virtual const ossimObject* getView()const;
+
+   virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result)const;
+  virtual void getDecimationFactors(vector<ossimDpt>& decimations)const;
+  virtual ossim_uint32 getNumberOfDecimationLevels()const;
+  
+   virtual void setAutoUpdateInputTransformFlag(bool flag){ m_AutoUpdateInputTransform = flag; }
+   
+   /**
+    * ordering specifies how the vertices should be arranged.
+    * valid image vertices is basically the tightly fit convex hull
+    * of the image.  Usually an image has NULL values and are
+    * internally not upright rectangular.  This can cause
+    * problems some spatial filters.
+    *
+    * We need to make sure that the resampler overrides this method.
+    * it needs to transform the vertices to the view's side.
+    */
+   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
+                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+                                      ossim_uint32 resLevel=0)const;
+
+   void setMaxLevelsToCompute(ossim_uint32 maxLevels);
+   ossim_uint32 getMaxLevelsToCompute()const;
+   
+   void connectInputEvent(ossimConnectionEvent& event);
+   void disconnectInputEvent(ossimConnectionEvent& event);
+   void propertyEvent(ossimPropertyEvent& event);
+   virtual void refreshEvent(ossimRefreshEvent& event);
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief Enables source.
+    *
+    * Overrides ossimSource::enableSource so bounding rects are recomputed on
+    * state change.
+    */
+   virtual void enableSource();
+
+   /**
+    * @brief Disables source.
+    *
+    * Overrides ossimSource::disableSource so bounding rects are recomputed on
+    * state change.
+    */
+   virtual void disableSource();
+
+   /**
+    * @brief Sets the enable flag.
+    *
+    * @param flag True to enable, false to disable.
+    * 
+    * Overrides ossimSource::setEnableFlag so bounding rects are recomputed on
+    * state change.
+    */
+   virtual void setEnableFlag(bool flag);
+
+   
+protected:
+   virtual ~ossimImageRenderer();
+
+private:
+   
+   class ossimRendererSubRectInfo
+   {
+    enum SplitFlag{
+      SPLIT_NONE = 0,
+      UPPER_LEFT_SPLIT_FLAG  = 1,
+      UPPER_RIGHT_SPLIT_FLAG = 2,
+      LOWER_RIGHT_SPLIT_FLAG = 4,
+      LOWER_LEFT_SPLIT_FLAG  = 8,
+      SPLIT_ALL = UPPER_LEFT_SPLIT_FLAG|UPPER_RIGHT_SPLIT_FLAG|LOWER_RIGHT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG
+    };
+   public:
+      friend std::ostream& operator <<(std::ostream& out, const ossimRendererSubRectInfo& rhs)
+      {
+         return out << "vul:   " << rhs.m_Vul << endl
+            << "vur:   " << rhs.m_Vur << endl
+            << "vlr:   " << rhs.m_Vlr << endl
+            << "vll:   " << rhs.m_Vll << endl
+            << "iul:   " << rhs.m_Iul << endl
+            << "iur:   " << rhs.m_Iur << endl
+            << "ilr:   " << rhs.m_Ilr << endl
+            << "ill:   " << rhs.m_Ill << endl
+            << "scale: " << rhs.m_ViewToImageScale << endl;
+
+      }
+
+      ossimRendererSubRectInfo(ossimImageViewTransform* transform=0);
+      ossimRendererSubRectInfo(ossimImageViewTransform* transform,
+                               const ossimDpt& vul,
+                               const ossimDpt& vur,
+                               const ossimDpt& vlr,
+                               const ossimDpt& vll);
+         
+      bool imageHasNans()const;
+      bool imageIsNan()const;
+      bool viewHasNans()const;
+      bool viewIsNan()const;
+
+      void splitView(std::vector<ossimRendererSubRectInfo>& result)const;
+      //void splitView(ossimRendererSubRectInfo& ulRect,
+      //               ossimRendererSubRectInfo& urRect,
+      //               ossimRendererSubRectInfo& lrRect,
+      //               ossimRendererSubRectInfo& llRect)const;
+      
+      void transformViewToImage();
+      void transformImageToView();
+      bool tooBig()const;
+      void roundToInteger();
+      void stretchImageOut(bool enableRound=false);
+      ossimDrect getViewRect()const;
+      ossimDrect getImageRect()const;
+      void roundImageToInteger();
+      void roundViewToInteger();
+      bool isViewEqual(const ossimRendererSubRectInfo& infoRect)const;
+      bool isViewEqual(const ossimDrect& viewRect)const;
+      ossimDpt computeViewToImageScale(const ossimDpt& viewPt, const ossimDpt& delta=ossimDpt(1.0,1.0))const;
+      ossimDpt getAbsValueViewToImageScales()const;
+      ossimDpt getAbsValueImageToViewScales()const;
+      ossimDpt computeRoundTripErrorViewPt(const ossimDpt& dpt)const;
+      bool isViewAPoint()const;
+      bool isIdentity()const;
+      bool canBilinearInterpolate(double error)const;
+
+      ossimDpt getParametricCenter(const ossimDpt& ul, const ossimDpt& ur, 
+				    const ossimDpt& lr, const ossimDpt& ll)const;
+
+     void getViewMids(ossimDpt& upperMid,
+		      ossimDpt& rightMid,
+		      ossimDpt& bottomMid,
+		      ossimDpt& leftMid,
+		      ossimDpt& center)const;
+
+     void getImageMids(ossimDpt& upperMid,
+		       ossimDpt& rightMid,
+		       ossimDpt& bottomMid,
+		       ossimDpt& leftMid,
+		       ossimDpt& center)const;
+     ossim_uint16 getSplitFlags()const;
+
+      ossimDpt m_Iul;
+      ossimDpt m_Iur;
+      ossimDpt m_Ilr;
+      ossimDpt m_Ill;
+
+      ossimIpt m_Vul;
+      ossimIpt m_Vur;
+      ossimIpt m_Vlr;
+      ossimIpt m_Vll;
+
+      ossimDpt m_ViewToImageScale;
+      ossimDpt m_ImageToViewScale;
+
+
+      ossimDpt m_VulScale;
+      ossimDpt m_VurScale;
+      ossimDpt m_VlrScale;
+      ossimDpt m_VllScale;
+
+      ossimDpt m_ulRoundTripError;
+      ossimDpt m_urRoundTripError;
+      ossimDpt m_lrRoundTripError;
+      ossimDpt m_llRoundTripError;
+
+      mutable ossimRefPtr<ossimImageViewTransform> m_transform;
+      mutable const ossimPolyArea2d* m_viewBounds;
+
+    private:
+      void splitHorizontal(std::vector<ossimRendererSubRectInfo>& result)const;
+      void splitVertical(std::vector<ossimRendererSubRectInfo>& result)const;
+      void splitAll(std::vector<ossimRendererSubRectInfo>& result)const;
+   };
+
+   void recursiveResample(ossimRefPtr<ossimImageData> outputData,
+                          const ossimRendererSubRectInfo& rectInfo,
+			  ossim_uint32 level);
+   
+
+   void fillTile(ossimRefPtr<ossimImageData> outputData,
+                 const ossimRendererSubRectInfo& rectInfo);
+                 
+   ossimIrect getBoundingImageRect()const;
+
+   
+   //! this is called on a property event and on input connection changes.
+   void checkIVT();
+
+   /**
+    * @brief Initializes m_inputR0Rect and m_viewBoundingRect and sets
+    * m_rectsDirty appropriately.
+    */
+   void initializeBoundingRects();
+
+   ossimRefPtr<ossimImageData> getTileAtResLevel(const ossimIrect& boundingRect,
+                                     ossim_uint32 resLevel);
+  template <class T>
+  void resampleTileToDecimation(T dummyVariable,
+				ossimRefPtr<ossimImageData> result,
+				ossimRefPtr<ossimImageData> tile,
+				ossim_uint32 multiplier);
+
+   long computeClosestResLevel(const std::vector<ossimDpt>& decimationFactors,
+                               double scale)const;
+   void stretchQuadOut(const ossimDpt& amount,
+                       ossimDpt& ul,
+                       ossimDpt& ur,
+                       ossimDpt& lr,
+                       ossimDpt& ll);
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+
+   /**
+    *  Deletes all allocated tiles.
+    */
+   void deallocate();
+
+   ossimFilterResampler*       m_Resampler;
+   ossimRefPtr<ossimImageData> m_BlankTile;
+   ossimRefPtr<ossimImageData> m_Tile;
+   ossimRefPtr<ossimImageData> m_TemporaryBuffer;
+
+   /**
+    * This is going to allow us to chain multiple
+    * renderers together.  So if we have one
+    * renderer doing a scale and they pass an r-level
+    * down and we have another renderer within the
+    * chain he will be starting at a different r-level.
+    * The default will be r-level 0 request coming
+    * from the right.
+    */
+   ossim_uint32             m_StartingResLevel;
+   ossimRefPtr<ossimImageViewTransform> m_ImageViewTransform;
+
+   ossimIrect               m_inputR0Rect;
+   ossimIrect               m_viewRect;
+   bool                     m_rectsDirty;
+
+   ossim_uint32             m_MaxRecursionLevel;
+   bool                     m_AutoUpdateInputTransform;
+   ossim_uint32             m_MaxLevelsToCompute;
+
+   ossimPolyArea2d          m_viewArea;
+   bool                     m_crossesDateline;
+   
+TYPE_DATA
+};
+
+inline ossimImageRenderer::ossimRendererSubRectInfo::ossimRendererSubRectInfo(ossimImageViewTransform* transform)
+:m_transform(transform),
+m_viewBounds(0)
+{
+   m_Vul.makeNan();
+   m_Vur.makeNan();
+   m_Vlr.makeNan();
+   m_Vll.makeNan();
+   m_Iul.makeNan();
+   m_Iur.makeNan();
+   m_Ilr.makeNan();
+   m_Ill.makeNan();
+   m_ViewToImageScale.makeNan();
+   m_ImageToViewScale.makeNan();            
+}
+
+inline ossimImageRenderer::ossimRendererSubRectInfo::ossimRendererSubRectInfo(ossimImageViewTransform* transform,
+                         const ossimDpt& vul,
+                         const ossimDpt& vur,
+                         const ossimDpt& vlr,
+                         const ossimDpt& vll)
+                         :m_Vul(vul),
+                         m_Vur(vur),
+                         m_Vlr(vlr),
+                         m_Vll(vll),
+                         m_transform(transform),
+                         m_viewBounds(0)
+{
+   m_Iul.makeNan();
+   m_Iur.makeNan();
+   m_Ilr.makeNan();
+   m_Ill.makeNan();
+   m_ViewToImageScale.makeNan();
+   m_ImageToViewScale.makeNan();            
+}
+
+inline bool ossimImageRenderer::ossimRendererSubRectInfo::imageHasNans()const
+{
+   return ( m_Iul.hasNans()||
+      m_Iur.hasNans()||
+      m_Ilr.hasNans()||
+      m_Ill.hasNans());
+}
+
+inline bool ossimImageRenderer::ossimRendererSubRectInfo::imageIsNan()const
+{
+   return ( m_Iul.hasNans()&&
+      m_Iur.hasNans()&&
+      m_Ilr.hasNans()&&
+      m_Ill.hasNans());
+}
+
+inline bool ossimImageRenderer::ossimRendererSubRectInfo::viewHasNans()const
+{
+   return ( m_Vul.hasNans()||
+      m_Vur.hasNans()||
+      m_Vlr.hasNans()||
+      m_Vll.hasNans());
+}
+
+inline bool ossimImageRenderer::ossimRendererSubRectInfo::viewIsNan()const
+{
+   return ( m_Vul.hasNans()&&
+      m_Vur.hasNans()&&
+      m_Vlr.hasNans()&&
+      m_Vll.hasNans());
+}
+
+inline void ossimImageRenderer::ossimRendererSubRectInfo::roundToInteger()
+{
+   m_Iul = ossimIpt(m_Iul);
+   m_Iur = ossimIpt(m_Iur);
+   m_Ilr = ossimIpt(m_Ilr);
+   m_Ill = ossimIpt(m_Ill);
+
+   m_Vul = ossimIpt(m_Vul);
+   m_Vur = ossimIpt(m_Vur);
+   m_Vlr = ossimIpt(m_Vlr);
+   m_Vll = ossimIpt(m_Vll);
+}
+
+inline ossimDrect ossimImageRenderer::ossimRendererSubRectInfo::getViewRect()const
+{
+   return ossimDrect(m_Vul,
+      m_Vur,
+      m_Vlr,
+      m_Vll);            
+}
+
+inline ossimDrect ossimImageRenderer::ossimRendererSubRectInfo::getImageRect()const
+{
+   return ossimDrect(m_Iul,
+      m_Iur,
+      m_Ilr,
+      m_Ill);
+}
+
+inline void ossimImageRenderer::ossimRendererSubRectInfo::roundImageToInteger()
+{
+   m_Iul = ossimIpt(m_Iul);
+   m_Iur = ossimIpt(m_Iur);
+   m_Ilr = ossimIpt(m_Ilr);
+   m_Ill = ossimIpt(m_Ill);
+}
+
+inline void ossimImageRenderer::ossimRendererSubRectInfo::roundViewToInteger()
+{
+   m_Vul = ossimIpt(m_Vul);
+   m_Vur = ossimIpt(m_Vur);
+   m_Vlr = ossimIpt(m_Vlr);
+   m_Vll = ossimIpt(m_Vll);
+}
+
+inline bool ossimImageRenderer::ossimRendererSubRectInfo::isViewEqual(const ossimRendererSubRectInfo& infoRect)const
+{
+   return ( (m_Vul == infoRect.m_Vul)&&
+      (m_Vur == infoRect.m_Vur)&&
+      (m_Vlr == infoRect.m_Vlr)&&
+      (m_Vll == infoRect.m_Vll));
+}
+
+inline bool ossimImageRenderer::ossimRendererSubRectInfo::isViewEqual(const ossimDrect& viewRect)const
+{
+   return ( (m_Vul == viewRect.ul())&&
+      (m_Vur == viewRect.ur())&&
+      (m_Vlr == viewRect.lr())&&
+      (m_Vll == viewRect.ll()));
+}
+
+inline ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getAbsValueViewToImageScales()const
+{
+   if(m_ViewToImageScale.hasNans())
+   {
+      return m_ImageToViewScale;
+   }
+   return ossimDpt(fabs(m_ViewToImageScale.x), fabs(m_ViewToImageScale.y));
+}
+
+inline ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getAbsValueImageToViewScales()const
+{
+   if(m_ImageToViewScale.hasNans())
+   {
+      return m_ImageToViewScale;
+   }
+
+   return ossimDpt(fabs(m_ImageToViewScale.x), fabs(m_ImageToViewScale.y));
+}
+
+inline bool ossimImageRenderer::ossimRendererSubRectInfo::isViewAPoint()const
+{
+   return ((m_Vul == m_Vur)&&
+      (m_Vul == m_Vlr)&&
+      (m_Vul == m_Vll));
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimImageSharpenFilter.h b/include/ossim/imaging/ossimImageSharpenFilter.h
new file mode 100644
index 0000000..efbce71
--- /dev/null
+++ b/include/ossim/imaging/ossimImageSharpenFilter.h
@@ -0,0 +1,83 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageSharpenFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimImageSharpenFilter_HEADER
+#define ossimImageSharpenFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimConvolutionSource.h>
+class OSSIMDLLEXPORT ossimImageSharpenFilter : public ossimImageSourceFilter
+{
+public:
+   ossimImageSharpenFilter(ossimObject* owner=NULL);
+
+   virtual ossimString getShortName()const;
+   virtual ossimString getLongName()const;
+   
+   ossim_uint32 getWidth()const;
+   ossim_float64 getSigma()const;
+   void setWidthAndSigma(ossim_uint32 w, ossim_float64 sigma);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+   virtual void connectInputEvent(ossimConnectionEvent &event);
+   virtual void disconnectInputEvent(ossimConnectionEvent &event);
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+protected:
+   virtual ~ossimImageSharpenFilter();
+   inline double laplacianOfGaussian(double x, double y, double sigma)
+   {
+      double r2 = x*x+y*y;
+      double sigma2 = sigma*sigma;
+      return ((1.0/(M_PI*sigma2*sigma2))*
+              (1.0-r2/(2.0*sigma2))*
+              (exp(-r2/(2.0*sigma2))));
+      
+   }
+   
+   void buildConvolutionMatrix();
+   
+
+   /*!
+    * Convolve full means that the input data is full and has
+    * no null data.  We don't have to compare for nulls here
+    */
+   template<class T>
+   void sharpenFull(T,
+                    const ossimRefPtr<ossimImageData>& inputData,
+                    ossimRefPtr<ossimImageData>& outputData);
+   
+   /*!
+    * Convolve partial means that the input data is has some
+    * null data.  We will have to compare nulls
+    */
+   template<class T>
+   void sharpenPartial(T,
+                       const ossimRefPtr<ossimImageData>& inputData,
+                       ossimRefPtr<ossimImageData>& outputData);
+
+   ossimRefPtr<ossimConvolutionSource> theConvolutionSource;
+   ossim_uint32 theWidth;
+   ossim_float64 theSigma;
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageSharpenFilter_HEADER */
diff --git a/include/ossim/imaging/ossimImageSource.h b/include/ossim/imaging/ossimImageSource.h
new file mode 100644
index 0000000..6ce3b1a
--- /dev/null
+++ b/include/ossim/imaging/ossimImageSource.h
@@ -0,0 +1,246 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageSource.h 23100 2015-01-26 19:43:08Z okramer $
+#ifndef ossimImageSource_HEADER
+#define ossimImageSource_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+class ossimDpt;
+
+class OSSIMDLLEXPORT ossimImageSource : public ossimSource
+{
+public:
+   ossimImageSource(ossimObject* owner = 0);
+   ossimImageSource(ossimObject* owner,
+                    ossim_uint32 inputListSize,
+                    ossim_uint32 outputListSize,
+                    bool inputListIsFixedFlag=true,
+                    bool outputListIsFixedFlag=true);
+   virtual ~ossimImageSource();
+
+   /**
+    * @return from origin out to tile_width-1, and tile_height-1.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIpt& origin,
+                                               ossim_uint32 resLevel=0);
+   
+  /**
+   * @return the requested region of interest
+   */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing. This is the default implementation that is not thread-friendly as it uses the
+    * object's tile then simply copies its buffer to the provided tile. Eventually, all image
+    * sources should override this method.
+    *
+    * @return true on success false on error.  If return is false, result
+    * is undefined so caller should handle appropriately with makeBlank or whatever.
+    *
+    * @note Derived classes should override this method to most efficiently stuff result.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+  /**
+   * For RTTI support. overrides ossimImageSource
+   * get object to return the correct casted base pointer
+   * for RTTI casting
+   */
+   virtual ossimObject* getObject() { return this; }
+   
+   /**
+    * For RTTI support. overrides ossimImageSource
+    * get object to return the correct casted base pointer
+    * for RTTI casting
+    */
+   virtual const ossimObject* getObject() const { return this; }
+
+ 
+  /**
+   * Will return the decimation factor for the given resolution 
+   * level.  the decimation is the scale from Resolution 0 or full 
+   * res.  Usually this is a power of 2 decimation where
+   * the decimation result is 1.0/2^resoltion.
+   */
+   virtual void getDecimationFactor(ossim_uint32 resLevel,
+                                    ossimDpt& result)const;
+  
+   /**
+    * Will return an array of all decimations for each resolution level.
+    */
+   virtual void getDecimationFactors(std::vector<ossimDpt>& decimations) const;
+
+   /**
+    * Will return the number of resolution levels.  Note: resolution
+    * level 0 is included in the return count.
+    */
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+   
+   /*!
+    * Returns the number of bands available from the input.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const = 0;
+   
+   /**
+    * Returns the number of bands in a tile returned from this TileSource.
+    */
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+
+   /**
+    * @brief Initializes bandList.
+    * 
+    * This implementation initializes to the zero based order of input bands.
+    * Derived classes that are band selectors should override.
+    *
+    * @param bandList Initialized by this.
+    */
+   virtual void getOutputBandList( std::vector<ossim_uint32>& bandList ) const;
+
+   /**
+    * This will be used to query the output pixel type of the tile source.
+    * Please ignore the argument.  It will soon be removed.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the default processing tile width
+    */
+   virtual ossim_uint32 getTileWidth() const;
+
+   /**
+    * Returns the default processing tile height
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /**
+    * Each band has a null pixel associated with it.  The null pixel 
+    * represents an invalid value.
+    */ 
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   
+   /**
+    * Returns the min pixel of the band.
+    */
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   
+   /**
+    * Returns the max pixel of the band.
+    */
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   
+   /**
+    * This will return the bounding rect of the source.  We can have several
+    * sources which are in a chain to modify the bounding image rect.
+    * lets say you are next to an image handler then it will return the
+    * bounding rect for that image.  If you are at the right side of a
+    * resampler then you will get a bounding rect along the image view plane.
+    * This is going to be a very import method for both image writers,
+    * mosaics or anything that needs to operate only within the bounds of an
+    * image.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
+   
+   /**
+    * @brief Gets the bounding rectangle of the source.
+    *
+    * This default implementation calls the getBoundingRect interface that
+    * returns a rectangle.  Derived classes should override as needed.
+    * 
+    * @param rect Initialized with bounding rectangle by this.
+    * @param resLevel Reduced resolution level if applicable.
+    */
+   virtual void getBoundingRect(ossimIrect& rect,
+                                ossim_uint32 resLevel=0) const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * ordering specifies how the vertices should be arranged.
+    * valid image vertices is basically the tightly fit convex hull
+    * of the image.  Usually an image has NULL values and are
+    * internally not upright rectangular.  This can cause
+    * problems some spatial filters.
+    *
+    * The default implementation is to return the bounding rect.
+    */
+   virtual void getValidImageVertices(
+      std::vector<ossimIpt>& validVertices,
+      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+      ossim_uint32 resLevel=0)const;
+
+   /**
+    * Returns the image geometry object associated with this tile source or
+    * NULL if not defined. The geometry contains full-to-local image transform
+    * as well as projection (image-to-world). Default implementation returns
+    * the image geometry object associated with the next  
+    * (left) input source (if any) connected to this source in the chain, or
+    * NULL.
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /**
+    * Default implementation sets geometry of the first input to the geometry
+    * specified.
+    */
+   virtual void setImageGeometry(const ossimImageGeometry* geom);
+       
+   /** Default method to call input's saveImageGeometry. */
+   virtual void saveImageGeometry() const;
+   
+   /** Default method to call input's saveImageGeometry. */
+   virtual void saveImageGeometry(const ossimFilename& geometry_file) const;
+   
+   virtual void initialize()=0;
+   
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @return Flag indicating the data contains pallete indexes.
+    *
+    * This should be replaced by a getPhotoInterpretation().
+    */
+   virtual bool isIndexedData() const;
+   
+protected:
+
+   ossimImageSource (const ossimImageSource& rhs);
+   const ossimImageSource& operator= (const ossimImageSource&);
+
+private:
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageSource_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimImageSourceFactory.h b/include/ossim/imaging/ossimImageSourceFactory.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageSourceFactory.h
rename to include/ossim/imaging/ossimImageSourceFactory.h
diff --git a/ossim/include/ossim/imaging/ossimImageSourceFactoryBase.h b/include/ossim/imaging/ossimImageSourceFactoryBase.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageSourceFactoryBase.h
rename to include/ossim/imaging/ossimImageSourceFactoryBase.h
diff --git a/ossim/include/ossim/imaging/ossimImageSourceFactoryRegistry.h b/include/ossim/imaging/ossimImageSourceFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageSourceFactoryRegistry.h
rename to include/ossim/imaging/ossimImageSourceFactoryRegistry.h
diff --git a/include/ossim/imaging/ossimImageSourceFilter.h b/include/ossim/imaging/ossimImageSourceFilter.h
new file mode 100644
index 0000000..41809ae
--- /dev/null
+++ b/include/ossim/imaging/ossimImageSourceFilter.h
@@ -0,0 +1,66 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+//*******************************************************************
+//  $Id: ossimImageSourceFilter.h 17932 2010-08-19 20:34:35Z dburken $
+#ifndef ossimImageSourceFilter_HEADER
+#define ossimImageSourceFilter_HEADER
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimConnectionEvent.h>
+
+class OSSIMDLLEXPORT ossimImageSourceFilter : public ossimImageSource,
+     public ossimConnectableObjectListener
+{
+public:
+   ossimImageSourceFilter(ossimObject* owner=NULL);
+   ossimImageSourceFilter(ossimImageSource* inputSource);
+   ossimImageSourceFilter(ossimObject* owner,
+                          ossimImageSource* inputSource);
+
+   /*!
+    * Returns the input connection's output band list.
+    * If not connected calls ossimImageSource::getOutputBandList.
+    */
+   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
+   
+   /*!
+    * Returns the number of bands available from the input.
+    */
+   virtual ossim_uint32 getNumberOfInputBands()const;   
+
+   virtual void initialize();
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   bool canConnectMyInputTo(ossim_int32 inputIndex,
+                            const ossimConnectableObject* object)const;
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+   virtual void propertyEvent(ossimPropertyEvent& event);
+   virtual void refreshEvent(ossimRefreshEvent& event);
+   
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+protected:
+   virtual ~ossimImageSourceFilter();
+   ossimImageSource* theInputConnection;
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageSourceFilter_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimImageSourceHistogramFilter.h b/include/ossim/imaging/ossimImageSourceHistogramFilter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageSourceHistogramFilter.h
rename to include/ossim/imaging/ossimImageSourceHistogramFilter.h
diff --git a/include/ossim/imaging/ossimImageSourceSequencer.h b/include/ossim/imaging/ossimImageSourceSequencer.h
new file mode 100644
index 0000000..a2162f6
--- /dev/null
+++ b/include/ossim/imaging/ossimImageSourceSequencer.h
@@ -0,0 +1,179 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimImageSourceSequencer.h 23081 2015-01-14 21:38:42Z dburken $
+#ifndef ossimImageSourceSequencer_HEADER
+#define ossimImageSourceSequencer_HEADER 1
+
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimHistogramSource.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+
+
+class OSSIMDLLEXPORT ossimImageSourceSequencer
+   :
+      public ossimImageSource,
+      public ossimConnectableObjectListener
+{
+public:
+   ossimImageSourceSequencer(ossimImageSource* inputSource=NULL,
+                             ossimObject* owner=NULL);
+
+   virtual ~ossimImageSourceSequencer();
+  /*!
+    * This will return the number of tiles within the
+    * area of interest.
+    */
+   ossim_int64 getNumberOfTiles()const;
+
+   /*!
+    * Will return the number of tiles along the
+    * x or horizontal direction.
+    */
+   ossim_int64 getNumberOfTilesHorizontal()const;
+
+   /*!
+    * Will return the number of tiles along the
+    * y or vertical direction.
+    */
+   ossim_int64 getNumberOfTilesVertical()const;
+
+   /*!
+    * This must be called.  We can only initialize this
+    * object completely if we know all connections
+    * are valid.  Some other object drives this and so the
+    * connection's initialize will be called after.  The job
+    * of this connection is to set up the sequence.  It will
+    * default to the bounding rect.  The area of interest can be
+    * set to some other rectagle (use setAreaOfInterest).
+    */
+   virtual void initialize();
+
+   /*!
+    * Will set the current area of interest.
+    */
+   virtual void setAreaOfInterest(const ossimIrect& areaOfInterest);
+
+   /*!
+    * Just returns the current area of interest.
+    */
+   const ossimIrect& getAreaOfInterest()const;
+
+   /*!
+    * Will set the internal pointers to the upperleft
+    * tile number.  To go to the next tile in the sequence
+    * just call getNextTile.
+    */
+   virtual void setToStartOfSequence();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+   /*!
+    * Will allow you to get the next tile in the sequence.
+    * Note the last tile returned will be an invalid
+    * ossimRefPtr<ossimImageData>.  Callers should be able to do:
+    * 
+    * ossimRefPtr<ossimImageData> id = sequencer->getNextTile();
+    * while (id.valid())
+    * {
+    *    doSomething;
+    *    id = sequencer->getNextTile();
+    * }
+    * 
+    */
+   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
+   virtual bool getNextTileStream(std::ostream& bos);
+
+   virtual bool getTileOrigin(ossim_int64 id, ossimIpt& origin)const;
+
+   /*!
+    * @brief Establishes a tile rect given tile ID.
+    * @param tile_id
+    * @param rect Rectangle to initialize.
+    * @return true if valid; else, false.
+    */
+   bool getTileRect(ossim_int64 tile_id, ossimIrect& rect) const;
+
+   virtual ossimRefPtr<ossimImageData> getTile(ossim_int64 id,
+                                               ossim_uint32 resLevel=0);
+
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+   virtual void getDecimationFactor(ossim_uint32 resLevel,
+                                    ossimDpt& result) const;
+   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
+   virtual ossim_uint32 getNumberOfDecimationLevels()const;
+   
+   /*!
+    * Returns the number of bands available from the input.
+    */
+   virtual ossim_uint32 getNumberOfInputBands()const;   
+
+   virtual ossimScalarType getOutputScalarType() const;
+      
+   virtual ossim_uint32 getTileWidth() const;
+   virtual ossim_uint32 getTileHeight() const;
+   
+   virtual void slaveProcessTiles();
+   virtual bool isMaster()const;
+
+   virtual ossimIpt getTileSize()const;
+   virtual void setTileSize(const ossimIpt& tileSize);
+   virtual void setTileSize(ossim_int32 width, ossim_int32 height);
+   
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+   
+   virtual bool canConnectMyInputTo(ossim_int32 inputIndex,
+                                    const ossimConnectableObject* object)const;
+   
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   void setCreateHistogram(bool create_histogram);
+   bool loadState(const ossimKeywordlist& kwl, const char* prefix);
+
+   void getBinInformation(ossim_uint32& numberOfBins,
+                          ossim_float64& minValue,
+                          ossim_float64& maxValue, ossimScalarType stype)const;
+   
+protected:
+   ossimImageSource*  theInputConnection;
+   ossimRefPtr<ossimImageData> theBlankTile;
+   ossimRefPtr<ossimMultiResLevelHistogram> theHistogram;
+   /*!
+    * Is the area of interest.  The default will
+    * 
+    */
+   ossimIrect theAreaOfInterest;
+
+   /*!
+    * Called during initialize.
+    */
+   ossimIpt theTileSize;
+
+   //---
+   // These need to be big(64 bit) for high resolution tile servers. Made
+   // signed for ease of going to/from ipt and irect which are both signed.
+   //---
+   ossim_int64 theNumberOfTilesHorizontal;
+   ossim_int64 theNumberOfTilesVertical;
+   ossim_int64 theCurrentTileNumber;
+   bool theCreateHistogram;
+
+   virtual void updateTileDimensions();
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimImageStatisticsSource.h b/include/ossim/imaging/ossimImageStatisticsSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageStatisticsSource.h
rename to include/ossim/imaging/ossimImageStatisticsSource.h
diff --git a/include/ossim/imaging/ossimImageToPlaneNormalFilter.h b/include/ossim/imaging/ossimImageToPlaneNormalFilter.h
new file mode 100644
index 0000000..4de7145
--- /dev/null
+++ b/include/ossim/imaging/ossimImageToPlaneNormalFilter.h
@@ -0,0 +1,74 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageToPlaneNormalFilter.h 20078 2011-09-09 12:25:50Z gpotts $
+#ifndef ossimImageToPlaneNormalFilter_HEADER
+#define ossimImageToPlaneNormalFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIMDLLEXPORT ossimImageToPlaneNormalFilter : public ossimImageSourceFilter
+{
+public:
+   ossimImageToPlaneNormalFilter();
+   ossimImageToPlaneNormalFilter(ossimImageSource* inputSource);
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual ossim_uint32    getNumberOfOutputBands() const;
+   
+   void setXScale(const double& scale);
+   void setYScale(const double& scale);
+   
+   double getXScale()const;
+   double getYScale()const;
+
+   void setTrackScaleFlag(bool flag);
+   bool getTrackScaleFlag()const;
+   
+   void   setSmoothnessFactor(double value);
+   double getSmoothnessFactor()const;
+   
+   bool loadState(const ossimKeywordlist& kwl,
+                  const char* prefix);
+   bool saveState(ossimKeywordlist& kwl,
+                  const char* prefix)const;
+   virtual void initialize();
+   /* ------------------- PROPERTY INTERFACE -------------------- */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   /* ------------------ PROPERTY INTERFACE END ------------------- */
+   
+protected:
+   ossimRefPtr<ossimImageData> theTile;
+   ossimRefPtr<ossimImageData> theBlankTile;
+   ossimIrect      theInputBounds;
+   bool            theTrackScaleFlag;
+   double          theXScale;
+   double          theYScale;
+   double          theSmoothnessFactor;
+   
+   void initializeTile();
+   virtual void computeNormals(ossimRefPtr<ossimImageData>& inputTile,
+                               ossimRefPtr<ossimImageData>& outputTile);
+
+   template <class T>
+   void computeNormalsTemplate(T inputScalarTypeDummy,
+                               ossimRefPtr<ossimImageData>& inputTile,
+                               ossimRefPtr<ossimImageData>& outputTile);
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimImageWriter.h b/include/ossim/imaging/ossimImageWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageWriter.h
rename to include/ossim/imaging/ossimImageWriter.h
diff --git a/include/ossim/imaging/ossimImageWriterFactory.h b/include/ossim/imaging/ossimImageWriterFactory.h
new file mode 100644
index 0000000..3d50792
--- /dev/null
+++ b/include/ossim/imaging/ossimImageWriterFactory.h
@@ -0,0 +1,63 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Frank Warmerdam (warmerda at home.com)
+//
+//*******************************************************************
+//  $Id: ossimImageWriterFactory.h 18002 2010-08-30 18:01:10Z gpotts $
+
+#ifndef ossimImageWriterFactory_HEADER
+#define ossimImageWriterFactory_HEADER
+#include <ossim/imaging/ossimImageWriterFactoryBase.h>
+
+class ossimImageWriter;
+class ossimKeywordlist;
+
+class ossimImageWriterFactory: public ossimImageWriterFactoryBase
+{   
+public:
+   virtual ~ossimImageWriterFactory();
+   static ossimImageWriterFactory* instance();
+   
+   ossimImageFileWriter *createWriterFromExtension(const ossimString& fileExtension)const;
+   virtual ossimImageFileWriter* createWriter(const ossimKeywordlist& kwl,
+                                              const char *prefix=0)const;
+   virtual ossimImageFileWriter* createWriter(const ossimString& typeName)const;
+   
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char *prefix=0)const;
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+   
+   virtual void getExtensions(std::vector<ossimString>& result)const;
+   
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+   
+   /*!
+    * getImageTypeList.  This is the actual image type name.  So for
+    * example, ossimTiffWriter has several image types.  Some of these
+    * include TIFF_TILED, TIFF_TILED_BAND_SEPARATE ... etc.  The
+    * ossimGdalWriter
+    * may include GDAL_IMAGINE_HFA, GDAL_RGB_NITF, GDAL_JPEG20000, ... etc
+    * A writer should be able to be instantiated by this name as well as a
+    * class name
+    */
+   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
+   
+   virtual void getImageFileWritersBySuffix(ossimImageWriterFactoryBase::ImageFileWriterList& result,
+                                            const ossimString& ext)const;
+   virtual void getImageFileWritersByMimeType(ossimImageWriterFactoryBase::ImageFileWriterList& result,
+                                              const ossimString& mimeType)const;
+protected:
+   ossimImageWriterFactory() {}
+
+   static ossimImageWriterFactory* theInstance;
+
+	ossimImageFileWriter* createFromMimeType(const ossimString& mimeType)const;
+   bool isImageTypeName(const ossimString& name)const;
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimImageWriterFactoryBase.h b/include/ossim/imaging/ossimImageWriterFactoryBase.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimImageWriterFactoryBase.h
rename to include/ossim/imaging/ossimImageWriterFactoryBase.h
diff --git a/include/ossim/imaging/ossimImageWriterFactoryRegistry.h b/include/ossim/imaging/ossimImageWriterFactoryRegistry.h
new file mode 100644
index 0000000..e30db31
--- /dev/null
+++ b/include/ossim/imaging/ossimImageWriterFactoryRegistry.h
@@ -0,0 +1,89 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Frank Warmerdam (warmerda at home.com)
+//
+//*******************************************************************
+//  $Id: ossimImageWriterFactoryRegistry.h 22865 2014-08-06 11:17:03Z gpotts $
+
+#ifndef ossimImageWriterFactoryRegistry_HEADER
+#define ossimImageWriterFactoryRegistry_HEADER
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/imaging/ossimImageWriterFactoryBase.h>
+#include <ossim/base/ossimFactoryListInterface.h>
+#include <vector>
+#include <iosfwd>
+
+class ossimImageFileWriter;
+class ossimKeywordlist;
+
+class OSSIMDLLEXPORT ossimImageWriterFactoryRegistry :
+   public ossimObjectFactory,
+   public ossimFactoryListInterface<ossimImageWriterFactoryBase, ossimImageFileWriter>
+{   
+public:
+   static ossimImageWriterFactoryRegistry* instance();
+
+   ossimImageFileWriter *createWriter(const ossimFilename& filename)const;
+   ossimImageFileWriter *createWriterFromExtension(const ossimString& fileExtension)const;
+   ossimImageFileWriter *createWriter(const ossimKeywordlist &kwl,
+                                      const char *prefix=0)const;
+   ossimImageFileWriter* createWriter(const ossimString& typeName)const;
+   
+   ossimObject* createObject(const ossimKeywordlist &kwl,
+                             const char *prefix=0)const;
+
+   ossimObject* createObject(const ossimString& typeName)const;
+   
+   /**
+    * getTypeNameList.  This should return the class type of the object being
+    * used to perform the writting.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+   
+   /**
+    * getImageTypeList.  This is the actual image type name.  So for
+    * example, ossimTiffWriter has several image types.  Some of these
+    * include TIFF_TILED, TIFF_TILED_BAND_SEPARATE ... etc.
+    * The ossimGdalWriter
+    * may include GDAL_IMAGINE_HFA, GDAL_RGB_NITF, GDAL_JPEG20000, ... etc
+    * A writer should be able to be instantiated by this name as well as a
+    * class name
+    */
+   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
+
+   virtual void getImageFileWritersBySuffix(ossimImageWriterFactoryBase::ImageFileWriterList& result,
+                                            const ossimString& ext)const;
+   virtual void getImageFileWritersByMimeType(ossimImageWriterFactoryBase::ImageFileWriterList& result,
+                                              const ossimString& mimeType)const;
+   /**
+    * @brief Prints list of writers from getImageTypeList.
+    * @param  out Stream to print to.
+    * @return std::ostream&
+    */
+   std::ostream& printImageTypeList(std::ostream& out)const;
+
+   /**
+    * @brief Prints list of writers from getImageTypeList.
+    * @param  out Stream to print to.
+    * @return std::ostream&
+    */
+   std::ostream& printWriterProps(std::ostream& out)const;
+   
+protected:
+   ossimImageWriterFactoryRegistry();
+   ossimImageWriterFactoryRegistry(const ossimImageWriterFactoryRegistry&);
+   void operator=(const ossimImageWriterFactoryRegistry&);
+   
+   //static ossimImageWriterFactoryRegistry*    theInstance;
+};
+
+extern "C"
+{
+  OSSIMDLLEXPORT void* ossimImageWriterFactoryRegistryGetInstance();
+}
+#endif
diff --git a/include/ossim/imaging/ossimIndexToRgbLutFilter.h b/include/ossim/imaging/ossimIndexToRgbLutFilter.h
new file mode 100644
index 0000000..910221f
--- /dev/null
+++ b/include/ossim/imaging/ossimIndexToRgbLutFilter.h
@@ -0,0 +1,171 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************
+// $Id: ossimIndexToRgbLutFilter.h 23616 2015-11-11 19:50:29Z dburken $
+#ifndef ossimIndexToRgbLutFilter_HEADER
+#define ossimIndexToRgbLutFilter_HEADER
+
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+
+class ossimImageData;
+
+/***************************************************************************************************
+ *
+ * This class provides a look-up-table remap from a single band input (the index), to a 3-band RGB
+ * output. The LUT is provided as a KWL with several remapping modes supported:
+ *
+ * Literal: Only those indices represented in the KWL are remapped to the values indicated. All
+ * other pixel values are mapped to the NULL pixel (0,0,0). Note that this is only meaningful for
+ * integer input scalar types since a normalized input will likely not find an exact match.
+ *
+ * Arbitrary piecewise linear ("vertices"): The LUT KWL provides vertices to contiguous line
+ * segments. Pixel values falling between specified indices are linearly interpolated between
+ * adjacent vertices. Any index pixel values falling outside the range between min and max vertex
+ * indices will be mapped to the NULL pixel.
+ *
+ * Regular piecewise linear ("regular"): The entries in the KWL do not correspond to any specific
+ * index (except the first and the last entries that correspond to the min and max pixel values).
+ * Remaining intermediate entries are equally spaced in index space so that the line segments are of
+ * equal length. The min and max values are queried from the input source, but can be overriden with
+ * the "min_value" and "max_value" keywords in the LUT KWL.
+ *
+ * Here are example KWLs for the three modes, first for the literal remap:
+ *
+ *    type: ossimIndexToRgbLutFilter
+ *    mode: literal
+ *    entry0.index: 0
+ *    entry0.color: 1 1 1
+ *    entry1.index: 128
+ *    entry1.color: 255 0 0
+ *    entry2.index: 255
+ *    entry2.color: 0 255 0
+ *
+ * The above KWL will map only pixels with input values of 0, 128, and 255. All other indices will
+ * map to the null value.
+ *
+ * Example for arbitrary piecewise linear:
+ *
+ *    type: ossimIndexToRgbLutFilter
+ *    mode: vertices
+ *    entry0.index: 1
+ *    entry0.color: 0 0 255
+ *    entry1.index: 128
+ *    entry1.color: 0 255 0
+ *    entry2.index: 250
+ *    entry2.color: 255 0 0
+ *
+ * The above KWL is a sort of heat map where indices between 1 and 128 will linearly map from blue
+ * to green, and then 128 to 250 will map from green (through yellow) to red. Note that any value
+ * above 250 as well as 0 are outside of the remap range and will map to the null pixel (0,0,0).
+ *
+ * Example of regular piecewise linear. This is the default mode. For backward compatibility, the
+ * mode keyword here is optional and if omitted will imply this mode. Also, unlike previous form,
+ * the number_of_entries keyword is not required and is ignored if present.
+ *
+ *    type: ossimIndexToRgbLutFilter
+ *    mode: regular
+ *    entry0: 0 0 255
+ *    entry1: 0 255 0
+ *    entry2: 255 0 0
+ *    max_value:  250
+ *    min_value:  1
+ *
+ * The above KWL is almost equivalent to the "vertices" example above, i.e., a heat map. However,
+ * the individual vertices are not specified. Instead, three entries will define two line segments.
+ * The first line segment will commence with index 1 (min_value) and finish at:
+ *
+ *    [(max_value-min_value)/(number_of_entries-1)] + min_value
+ *
+ * In this case it will be 125.5. The quantity in square-brackets (124.5) is the interval, or
+ * length of each line segment, so the second line segment will go from 125.5 to 250. Input pixel
+ * values below the min_value will clamp to the min value (except the null pixel) and those above
+ * the max value will clamp to the max value.
+ *
+ * The table can be contained in a separate file from the main KWL state file. In this case, the
+ * loadState can accept a file name in place of a complete table:
+ *
+ *    type: ossimIndexToRgbLutFilter
+ *    lut_file: <path to LUT KWL file>
+ * 
+ * The format of the LUT KWL file is just as specified above for the inline case.
+ *
+ **************************************************************************************************/
+class OSSIM_DLL ossimIndexToRgbLutFilter : public ossimImageSourceFilter
+{
+public:
+   enum Mode  { LITERAL = 0, VERTICES  = 1, REGULAR = 2 };
+
+   ossimIndexToRgbLutFilter();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   ossim_uint32 getNumberOfOutputBands() const;
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   
+   void           setMode(Mode mode) { theMode = mode; }
+   Mode           getMode() const { return theMode; }
+
+   /**
+    * @brief Set lookup table(lut) method.
+    *
+    * This opens the keyword list and initializes lut.
+    *
+    * CAUTION: Requires theMinValue, theMaxValue, and theMode to be set.  Typically a
+    * connection is made prior to this call.  If not connected to an input, "min",
+    * "max" and "mode" keywords should be passed in the keyword list file.
+    *
+    * @param file Keyword list containing lut.
+    */
+   void           setLut(const ossimFilename& file);
+   
+   double         getMinValue()const;
+   double         getMaxValue()const;
+   
+   void           setMinValue(double value);
+   void           setMaxValue(double value);
+   
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual void initialize();
+
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
+
+protected:
+   virtual ~ossimIndexToRgbLutFilter();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   bool initializeLut(const ossimKeywordlist* kwl, const char* prefix=0);
+   
+   std::map<double, ossimRgbVector> theLut;
+
+   double theMinValue;
+   double theMaxValue;
+   bool   theMinValueOverride;
+   bool   theMaxValueOverride;
+   Mode   theMode;
+   ossimRefPtr<ossimImageData> theTile;
+   ossimFilename   theLutFile;
+   
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimIndexToRgbLutFilter_HEADER */
diff --git a/include/ossim/imaging/ossimIntensityAdjustmentFilter.h b/include/ossim/imaging/ossimIntensityAdjustmentFilter.h
new file mode 100644
index 0000000..6b83809
--- /dev/null
+++ b/include/ossim/imaging/ossimIntensityAdjustmentFilter.h
@@ -0,0 +1,74 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+// $Id: ossimIntensityAdjustmentFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimIntensityAdjustmentFilter_HEADER
+#define ossimIntensityAdjustmentFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimDblGrid.h>
+
+class ossimIntensityAdjustmentFilter : public ossimImageSourceFilter
+{
+public:
+   ossimIntensityAdjustmentFilter();
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+   const ossimIrect& getGridBounds()const
+      {
+         return theGridBounds;
+      }
+   virtual void setIntensityGrid(const ossimDblGrid& grid)
+      {
+         theMeanIntensityGrid = grid;
+      }
+   void setMeanIntensityTarget(double targetMean)
+      {
+         theMeanIntensityTarget = targetMean;
+      }
+   double getMeanIntensityTarget()const
+      {
+         return theMeanIntensityTarget;
+      }
+   ossimDblGrid& getMeanIntensityGrid()
+      {
+         return theMeanIntensityGrid;
+      }
+   const ossimDblGrid& getMeanIntensityGrid()const
+      {
+         return theMeanIntensityGrid;
+      }
+   void createAndPopulateGrid(const ossimIpt& spacing, double targetMean = .5);
+   
+   virtual void initialize();
+protected:
+   virtual ~ossimIntensityAdjustmentFilter();
+
+   virtual void allocate();
+   
+   ossimDblGrid                theMeanIntensityGrid;
+   double                      theMeanIntensityTarget;
+   ossimRefPtr<ossimImageData> theNormTile;
+   ossimRefPtr<ossimImageData> theTile;
+   ossimRefPtr<ossimImageData> theBlankTile;
+
+   ossimIrect   theGridBounds;
+
+   double computeMeanIntensity(ossimRefPtr<ossimImageData>& data);
+   void loadNormTile(ossimRefPtr<ossimImageData>& data);
+   double matchTargetMean(double inputValue,
+                          double meanValue,
+                          double targetMean,
+                          double minValue,
+                          double maxValue);
+   
+TYPE_DATA
+};
+#endif
diff --git a/ossim/include/ossim/imaging/ossimIso8211.h b/include/ossim/imaging/ossimIso8211.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimIso8211.h
rename to include/ossim/imaging/ossimIso8211.h
diff --git a/include/ossim/imaging/ossimJpegCodec.h b/include/ossim/imaging/ossimJpegCodec.h
new file mode 100644
index 0000000..55e3853
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegCodec.h
@@ -0,0 +1,133 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: class declaration for base codec(encoder/decoder).
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimJpegCodec_HEADER
+#define ossimJpegCodec_HEADER 1
+#include <ossim/imaging/ossimCodecBase.h>
+
+class OSSIM_DLL ossimJpegCodec : public ossimCodecBase
+{
+public:
+   
+   ossimJpegCodec();
+   virtual ~ossimJpegCodec();
+
+   /**
+    * @return Codec type.  "jpeg"
+    */  
+   virtual ossimString getCodecType()const;
+   
+   /**
+    * @brief Encode jpeg method.
+    *
+    * Current options handled by this factory:
+    *
+    * type: jpeg
+    * quality: 75
+    *
+    * @param in Input data to encode.
+    * 
+    * @param out Encoded output data.
+    *
+    * @return true on success, false on failure.
+    */   
+   virtual bool encode( const ossimRefPtr<ossimImageData>& in,
+                        std::vector<ossim_uint8>& out ) const;
+
+   /**
+    * @brief Decode jpeg method.
+    *
+    * @param in Input data to decode.
+    * 
+    * @param out Output tile.  If the pointer to ossimImageData is null
+    * internally it will be created.  For code loops it is better to pre
+    * initialized to correct size.
+    *
+    * @note Caller should set "out's" image rectangle upon successful
+    * decode.
+    *
+    * @return true on success, false on failure.
+    */
+   virtual bool decode( const std::vector<ossim_uint8>& in,
+                        ossimRefPtr<ossimImageData>& out ) const;
+
+   /**
+    * Ineterface to allow for specific properties to be set.
+    *
+    */ 
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   
+   /**
+    * Interface to get the value of a specific property
+    *
+    * @param in name.  Property name to retrieve
+    *
+    * @return property value
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const; 
+   
+   /**
+    * Get a list of all supported property names.  Currently only "quality" property 
+    * is exposed
+    *
+    * @param out proeprtyNames.  push the list of proeprty names to the list
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   /**
+    * Allocate the state of the object thorugh a factory load/keywordlist
+    *
+    * @param in kwl. Input keywordlist that holds the values.
+    *
+    * @param in prefix. prefix to use for all keywords.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   
+   /**
+    * Save the state of the codec to the keywordlist
+    *
+    * @param out kwl. Input keywordlist that holds the values.
+    *
+    * @param in prefix. prefix to use for all keywords.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   
+protected:
+
+   /**
+    * @brief For decoding standard jpeg block.
+    * Curently only handles CMYK.
+    * @param in Input jpeg buffer.
+    * @param out Initialized by this.
+    * @return true on success, false on error.
+    */
+   bool decodeJpeg(const std::vector<ossim_uint8>& in,
+                   ossimRefPtr<ossimImageData>& out ) const;
+   
+   /**
+    * @brief For decoding color spaces other that mono and rgb.
+    * Curently only handles CMYK.
+    * @param in Input jpeg buffer.
+    * @param out Initialized by this.
+    * @return true on success, false on error.
+    */
+   bool decodeJpegToRgb(const std::vector<ossim_uint8>& in,
+                        ossimRefPtr<ossimImageData>& out ) const;
+
+   /**
+    * @return The enumerated libjpeg out_color_space.
+    */
+   ossim_int32 getColorSpace( const std::vector<ossim_uint8>& in ) const;
+   
+   ossim_uint32 m_quality;
+   TYPE_DATA;
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimJpegDefaultTable.h b/include/ossim/imaging/ossimJpegDefaultTable.h
new file mode 100644
index 0000000..a49fe6f
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegDefaultTable.h
@@ -0,0 +1,162 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Mingjie Su
+// 
+// Description: Default JPEG Huffman tables. Values from: MIL-STD-188-198, APPENDIX B
+//              Default JPEG quantization tables. Values from: MIL-STD-188-198, APPENDIX A
+//
+//********************************************************************
+// $Id: ossimJpegDefaultTable.h 958 2010-06-03 23:00:32Z ming.su $
+
+#ifndef ossimJpegDefaultTable_HEADER
+#define ossimJpegDefaultTable_HEADER
+
+static const int AC_BITS[16] = 
+{
+  0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125
+};
+
+static const int DC_BITS[16] = 
+{
+  0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
+};
+
+static const int AC_HUFFVAL[256] =
+{
+  0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,          
+  0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
+  0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08,
+  0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0,
+  0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16,
+  0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28,
+  0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
+  0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
+  0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
+  0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
+  0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
+  0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
+  0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
+  0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
+  0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
+  0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5,
+  0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4,
+  0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2,
+  0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA,
+  0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8,
+  0xF9, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static const int DC_HUFFVAL[256] =
+{
+  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+  0x08, 0x09, 0x0A, 0x0B, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const static int Q1table[64] = 
+{
+  8,    72,  72,  72,  72,  72,  72,  72, // 0 - 7
+  72,   72,  78,  74,  76,  74,  78,  89, // 8 - 15
+  81,   84,  84,  81,  89, 106,  93,  94, // 16 - 23
+  99,   94,  93, 106, 129, 111, 108, 116, // 24 - 31
+  116, 108, 111, 129, 135, 128, 136, 145, // 32 - 39
+  136, 128, 135, 155, 160, 177, 177, 160, // 40 - 47
+  155, 193, 213, 228, 213, 193, 255, 255, // 48 - 55
+  255, 255, 255, 255, 255, 255, 255, 255  // 56 - 63
+};
+
+const static int Q2table[64] = 
+{ 
+  8,   36,  36,  36,  36,  36,  36,  36, // 0 - 7
+  36,   36,  39,  37,  38,  37,  39,  45, // 8 - 15
+  41,   42,  42,  41,  45,  53,  47,  47, // 16 -23
+  50,   47,  47,  53,  65,  56,  54,  59, // 24 - 31
+  59,   54,  56,  65,  68,  64,  69,  73, // 32 - 39
+  69,   64,  68,  78,  81,  89,  89,  81, // 40 - 47
+  78,   98, 108, 115, 108,  98, 130, 144, // 48 - 55
+  144, 130, 178, 190, 178, 243, 243, 255  // 56 - 63
+};
+
+const static int Q3table[64] = 
+{ 
+  8,  10, 10, 10, 10, 10, 10, 10,  // 0 - 7
+  10, 10, 11, 10, 11, 10, 11, 13,  // 8 - 15
+  11, 12, 12, 11, 13, 15, 13, 13,  // 16 - 23
+  14, 13, 13, 15, 18, 16, 15, 16,  // 24 - 31
+  16, 15, 16, 18, 19, 18, 19, 21,  // 32 - 39
+  19, 18, 19, 22, 23, 25, 25, 23,  // 40 - 47
+  22, 27, 30, 32, 30, 27, 36, 40,  // 48 - 56
+  40, 36, 50, 53, 50, 68, 68, 91   // 57 - 63
+};
+
+const static int Q4table[64] = 
+{
+  8,   7,  7,  7,  7,  7,  7,  7, // 0 - 7
+  7,   7,  8,  7,  8,  7,  8,  9, // 8 - 15
+  8,   8,  8,  8,  9, 11,  9,  9, // 16 - 23
+  10,  9,  9, 11, 13, 11, 11, 12, // 24 - 31
+  12, 11, 11, 13, 14, 13, 14, 15, // 32 - 39
+  14, 13, 14, 16, 16, 18, 18, 16, // 40 - 47
+  16, 20, 22, 23, 22, 20, 26, 29, // 48 - 55
+  29, 26, 36, 38, 36, 49, 49, 65  // 56 - 63
+};
+
+const static int Q5table[64] = 
+{
+  4,   4,  4,  4,  4,  4,  4,  4, // 0 - 7
+  4,   4,  4,  4,  4,  4,  4,  5, // 8 - 15
+  5,   5,  5,  5,  5,  6,  5,  5, // 16 - 23
+  6,   5,  5,  6,  7,  6,  6,  6, // 24 - 31
+  6,   6,  6,  7,  8,  7,  8,  8, // 32 - 39
+  8,   7,  8,  9,  9, 10, 10,  9, // 40 - 47
+  9,  11, 12, 13, 12, 11, 14, 16, // 48 - 55
+  16, 14, 20, 21, 20, 27, 27, 36  // 56 - 63
+};
+
+const static int* QTABLE_ARRAY[5]={Q1table,Q2table,Q3table,Q4table,Q5table};
+
+#endif
diff --git a/include/ossim/imaging/ossimJpegMemDest.h b/include/ossim/imaging/ossimJpegMemDest.h
new file mode 100644
index 0000000..71d07c9
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegMemDest.h
@@ -0,0 +1,44 @@
+//----------------------------------------------------------------------------
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer, original code from Thomas G. Lane
+//
+// Most of code and comments below are from jpeg-6b "example.c" file. See 
+// http://www4.cs.fau.de/Services/Doc/graphics/doc/jpeg/libjpeg.html
+//
+// Description:
+// Code interfaces to use with jpeg-6b library to write a jpeg image from memory.
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimJpegMemDest_HEADER
+#define ossimJpegMemDest_HEADER 1
+
+#include <ossim/base/ossimConstants.h> /** for OSSIM_DLL export macro */
+#include <iosfwd> /* ostream& */
+
+// Forward declaration:
+struct jpeg_compress_struct;
+
+#if 0 /* Avoiding jpeg library includes in header files. */
+#include <ostream>                     /** for std::ostream */
+#include <cstdio>                      /** for size_t  */
+#include <csetjmp>                     /** for jmp_buf */
+extern "C"
+{
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#  ifndef XMD_H
+#    define XMD_H
+#  endif
+#endif
+// #include <jpeglib.h> /** for jpeg stuff */
+}
+#endif /* End: #if 0 */
+
+/**
+ * @brief Method which uses memory instead of a FILE* to write to.
+ * @note Used in place of "jpeg_stdio_dest(&cinfo, outfile)".
+ */
+// OSSIM_DLL void jpeg_cpp_stream_dest (j_compress_ptr cinfo, std::ostream& stream);
+OSSIM_DLL void jpeg_cpp_stream_dest (jpeg_compress_struct* cinfo, std::ostream& stream);
+
+#endif /* #ifndef ossimJpegMemDest_HEADER */
diff --git a/include/ossim/imaging/ossimJpegMemSrc.h b/include/ossim/imaging/ossimJpegMemSrc.h
new file mode 100644
index 0000000..c3f5ecb
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegMemSrc.h
@@ -0,0 +1,38 @@
+//----------------------------------------------------------------------------
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken, original code from Thomas G. Lane
+//
+// Description:
+// Code interfaces to use with jpeg-6b library to read a jpeg image from
+// memory.
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimJpegMemSrc_HEADER
+#define ossimJpegMemSrc_HEADER 1
+
+#include <ossim/base/ossimConstants.h> /** for OSSIM_DLL export macro */
+#include <cstdlib> /* size_t */
+
+// Forward declaration:
+struct jpeg_common_struct;
+struct jpeg_decompress_struct;
+
+extern "C"
+{
+
+/**
+ * @brief Error routine that will replace jpeg's standard error_exit method.
+ */
+OSSIM_DLL void ossimJpegErrorExit (jpeg_common_struct* cinfo);
+
+/**
+ * @brief Method which uses memory instead of a FILE* to read from.
+ * @note Used in place of "jpeg_stdio_src(&cinfo, infile)".
+ * @note "unsigned char = JOCTET
+ */
+OSSIM_DLL void ossimJpegMemorySrc (jpeg_decompress_struct* cinfo,
+                                   const ossim_uint8* buffer,
+                                   std::size_t bufsize);
+}
+#endif /* #ifndef ossimJpegMemSrc_HEADER */
diff --git a/include/ossim/imaging/ossimJpegStdIOSrc.h b/include/ossim/imaging/ossimJpegStdIOSrc.h
new file mode 100644
index 0000000..e1bd405
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegStdIOSrc.h
@@ -0,0 +1,39 @@
+//----------------------------------------------------------------------------
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken, original code from Thomas G. Lane
+//
+// Description:
+// Code interfaces to use with jpeg-6b library to read a jpeg image from
+// memory.
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimJpegStdIOSrc_HEADER
+#define ossimJpegStdIOSrc_HEADER
+
+#include <ossim/base/ossimConstants.h> /** for OSSIM_DLL export macro */
+#include <cstdio> /* For FILE* */
+
+struct jpeg_decompress_struct;
+
+extern "C"
+{
+// #include <cstdio>                      /** for size_t  */
+// #include <csetjmp>                     /** for jmp_buf */
+// #include <jpeglib.h>                   /** for jpeg stuff */
+   //#include <jinclude.h>
+   //#include <jerror.h>
+   /**
+    * @brief Method which uses memory instead of a FILE* to read from.
+    * @note Used in place of "jpeg_stdio_src(&cinfo, infile)".
+    */
+   /*
+   OSSIM_DLL void ossimJpegStdIOSrc ( j_decompress_ptr cinfo,
+                                     FILE* infile);
+   */
+
+   OSSIM_DLL void ossimJpegStdIOSrc ( jpeg_decompress_struct* cinfo,
+                                      FILE* infile);
+   
+}
+#endif /* #ifndef ossimJpegMemSrc_HEADER */
diff --git a/include/ossim/imaging/ossimJpegTileSource.h b/include/ossim/imaging/ossimJpegTileSource.h
new file mode 100644
index 0000000..a12fa7d
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegTileSource.h
@@ -0,0 +1,215 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for JpegTileSource.
+// JpegTileSource is derived from ImageHandler which is derived from
+// TileSource.
+//*******************************************************************
+//  $Id: ossimJpegTileSource.h 22117 2013-01-18 21:04:23Z dburken $
+
+#ifndef ossimJpegTileSource_HEADER
+#define ossimJpegTileSource_HEADER
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimAppFixedTileCache.h>
+
+class  ossimImageData;
+
+class OSSIM_DLL ossimJpegTileSource : public ossimImageHandler
+{
+public:
+
+   ossimJpegTileSource();
+
+   ossimJpegTileSource(const ossimKeywordlist& kwl,
+                       const char* prefix=0);
+
+   ossimJpegTileSource(const char* jpeg_file);
+
+
+   virtual ossimString getShortName() const;
+   virtual ossimString getLongName()  const;
+
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper
+    *  left corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+
+   /**
+     *  Returns the number of bands in the image.
+     *  Satisfies pure virtual from ImageHandler class.
+     */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+
+   /**
+    * Returns the number of bands in a tile returned from this TileSource.
+    * Note: we are supporting sources that can have multiple data objects.
+    * If you want to know the scalar type of an object you can pass in the
+    */
+   virtual ossim_uint32 getNumberOfOutputBands()const;
+
+   /**
+     *  Returns the number of lines in the image.
+     *  Satisfies pure virtual from ImageHandler class.
+     */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    *  Returns the number of samples in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    * Returns the zero based image rectangle for the reduced resolution data
+    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32    getTileWidth() const;
+
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32    getTileHeight() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   bool isValidRLevel(ossim_uint32 reduced_res_level) const;
+
+
+   bool isOpen()const;
+   /**
+    *  Returns true if the image_file can be opened and is a valid tiff file.
+    */
+   bool open(const ossimFilename& jpeg_file);
+   virtual void close();
+
+   /**
+    * @brief Gets a property for matching name.
+    * @param name The name of the property to get.
+    * @return Returns property matching "name".
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   
+   /**
+    * @brief Gets a list of property names available.
+    * @param propertyNames The list to push back names to.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * Returns the image geometry object associated with this tile source or
+    * NULL if non defined.  The geometry contains full-to-local image
+    * transform as well as projection (image-to-world).
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   
+protected:
+
+   /**
+    * @param Method to get geometry from the xml file or internal geotiff
+    * tags.
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const; 
+   
+   virtual ~ossimJpegTileSource();
+	class PrivateData;
+   /**
+    *  Returns true if no errors initializing object.
+    *
+    *  Notes:
+    *  - Callers of this method must ensure "theTiffPtr" data member
+    *    is initialized.
+    *  - This method was added to consolidate object initialization code
+    *    between constructor and public open method.
+    */
+   virtual bool open();
+
+   void allocate();
+   void destroy();
+   void restart();
+
+   /**
+    * @note this method assumes that setImageRectangle has been called on
+    * theTile.
+    */
+   void fillTile(const ossimIrect& clip_rect, ossimImageData* tile);
+
+   ossimRefPtr<ossimImageData>  theTile;
+   ossimRefPtr<ossimImageData>  theCacheTile;
+   ossim_uint8*                 theLineBuffer;
+   FILE*                        theFilePtr;
+   ossimIrect                   theBufferRect;
+   ossimIrect                   theImageRect;
+   ossim_uint32                 theNumberOfBands;
+   ossimIpt                     theCacheSize;
+
+   PrivateData*                 thePrivateData;
+
+   ossimAppFixedTileCache::ossimAppFixedCacheId theCacheId;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimJpegWriter.h b/include/ossim/imaging/ossimJpegWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimJpegWriter.h
rename to include/ossim/imaging/ossimJpegWriter.h
diff --git a/include/ossim/imaging/ossimJpegYCbCrToRgbSource.h b/include/ossim/imaging/ossimJpegYCbCrToRgbSource.h
new file mode 100644
index 0000000..6436edd
--- /dev/null
+++ b/include/ossim/imaging/ossimJpegYCbCrToRgbSource.h
@@ -0,0 +1,37 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimJpegYCbCrToRgbSource.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimJpegYCbCrToRgbSource_HEADER
+#define ossimJpegYCbCrToRgbSource_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimJpegYCbCrToRgbSource : public ossimImageSourceFilter
+{
+public:
+   ossimJpegYCbCrToRgbSource();
+   ossimJpegYCbCrToRgbSource(ossimImageSource* inputSource);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+       
+protected:
+   virtual ~ossimJpegYCbCrToRgbSource();
+
+   virtual void allocate();
+   
+   ossimRefPtr<ossimImageData> theBlankTile;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimKMeansFilter.h b/include/ossim/imaging/ossimKMeansFilter.h
new file mode 100644
index 0000000..2c918af
--- /dev/null
+++ b/include/ossim/imaging/ossimKMeansFilter.h
@@ -0,0 +1,139 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+#ifndef ossimKMeansFilter_HEADER
+#define ossimKMeansFilter_HEADER
+
+#include <ossim/base/ossimKMeansClustering.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+
+class ossimImageData;
+class ossimImageSourceSequencer;
+class ossimHistogram;
+
+/***************************************************************************************************
+ *
+ * This class provides a pixel classification capability using the traditional K-means scheme for
+ * partitioning datasets into K distinct clusters according to pixel value. The output tile consists
+ * of the input pixels remapped according to their classification to a digital number representing
+ * the cluster. Null pixels are ignored and left null.
+ *
+ * The caller can set the digital values representing the classification clusters. Otherwise they are
+ * mapped to integers 1, 2, ..., K.
+ *
+ * The output pixel type will be the minimum necessary to hold K clusters + null pixel. Typically
+ * this would be UInt8. Multiple bands are treated separately, so the number of output bands is
+ * the same as the number of input bands.
+ *
+ * This filter requires a histogram for the input source. If none is provided, one is computed.
+ *
+ * A common use for this class is for thresholding an image based on the histogram. This corresponds
+ * to K=2. The threshold point can be left at the default boundary between the two clusters, or
+ * alternatively, can be set to some standard deviation departure from one of the cluster's mean.
+ * See setThreshold() for this specific use case.
+ *
+ * Important Note:
+ * The histogram provided (or computed) should reflect all of the pixels that will be processed
+ * over multiple calls to getTile(). In other words, it doesn't compute the clustering on
+ * a per-tile basis, since that would cause each tile running through to use a different
+ * classification criteria. Therefore, it is important that if a sub-image AOI is being used by the
+ * output sink, the cut-rect filter needs to be inserted on the input-side of this filter so that it
+ * only considers pixels in the AOI. Alternatively, the AOI (in pixel coordinates) can be specified
+ * to this class directly and only those pixels in the AOI will be used in computing a histogram
+ * for use in the clustering.
+ *
+ **************************************************************************************************/
+class OSSIM_DLL ossimKMeansFilter : public ossimImageSourceFilter
+{
+public:
+   enum ThresholdMode { NONE=0, MEAN=1, SIGMA_WEIGHTED=2, VARIANCE_WEIGHTED=3 };
+
+   ossimKMeansFilter();
+
+   /**
+    * Quicker constructor handles connections to source and optional histogram.
+    */
+   ossimKMeansFilter(ossimImageSource* input_source, ossimMultiBandHistogram* histogram=0);
+
+   ~ossimKMeansFilter();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin, ossim_uint32 resLevel=0);
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   
+   /**
+    * Sets the input source's histogram for quicker K-means analysis.
+    */
+   void setInputHistogram(ossimMultiBandHistogram* histo);
+
+   /**
+    * Defines how many classification clusters will be resolved. The input connection should be made
+    * prior so that the number of bands is known.
+    * LIMITATION: Curently, only K values < 256 are supported.
+    */
+   void setNumClusters(ossim_uint32 K);
+   
+   /**
+    * Optionally define the output digital numbers for each cluster to be used for remapping the
+    * input pixels. K is the size of the array, resetting any previously set K value. If
+    * thresholding enabled (see setThreshold()), then only the first two values are referenced.
+    * LIMITATION: Curently, only UInt8 supported, so dns and K values must be 0-255.
+    */
+   void setClusterPixelValues(const ossim_uint32* dns, ossim_uint32 K);
+   
+   /**
+    * Special use case is to use K-means for thresholding an image into two values based on
+    * the histogram's clustering. The threshold point can be left at the default boundary between
+    * clusters, or alternatively, can be computed according to predefined modes. Currently support
+    * the following modes (where mn and sn is the mean and sigma of nth cluster, respectively):
+    *
+    *    NONE              Implies MEAN for multiple clusters.
+    *    MEAN              (m0 + m1)/2
+    *    SIGMA_WEIGHTED    (s1*m0 + s0*m1)/(s0 + s1)
+    *    VARIANCE_WEIGHTED (s1*s1*m0 + s0*s0*m1)/(s0*s0 + s1*s1)
+    */
+   void setThresholdMode(ThresholdMode mode);
+
+   /**
+    * Callers may be interested in reporting the cluster statistics computed by this class. Returns
+    * the clusters (of size K) for the band index specified.
+    */
+   const ossimKMeansClustering* getBandClassifier(ossim_uint32 band=0) const;
+
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual void initialize();
+
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
+
+protected:
+   bool computeKMeans();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   void clear();
+   
+   std::vector<ossimRefPtr<ossimKMeansClustering> > m_classifiers; //! Have num_bands entries
+   ossimRefPtr<ossimMultiBandHistogram> m_histogram;
+   ossim_uint32 m_numClusters; // a.k.a. K
+   std::vector<ossim_uint32> m_pixelValues;
+   std::vector<double> m_minPixelValue;
+   std::vector<double> m_maxPixelValue;
+   ossimRefPtr<ossimImageData> m_tile;
+   ossimScalarType m_outputScalarType;
+   bool m_initialized;
+   ThresholdMode m_thresholdMode;
+   std::vector<double> m_thresholds;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimKMeansFilter_HEADER */
diff --git a/include/ossim/imaging/ossimKakaduCompressorInterface.h b/include/ossim/imaging/ossimKakaduCompressorInterface.h
new file mode 100644
index 0000000..2f08748
--- /dev/null
+++ b/include/ossim/imaging/ossimKakaduCompressorInterface.h
@@ -0,0 +1,137 @@
+//---
+//
+// License: MIT
+// Author:  David Burken
+// Description: Interface for Kakadu compressor.
+// 
+//---
+// $Id$
+
+#ifndef ossimKakaduCompressorInterface_HEADER
+#define ossimKakaduCompressorInterface_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimImageData;
+class ossimIpt;
+class ossimIrect;
+class ossimNitfJ2klraTag;
+class ossimProperty;
+
+/**
+ * @class GeoPackage writer interface.
+ *
+ * This interface is for using the ossimKakaduCompressor outside of the
+ * kakadu plugin.
+ */
+class OSSIM_DLL ossimKakaduCompressorInterface
+{
+public:
+
+   // Matches static "COMPRESSION_QUALITY" string array in .cpp.
+   enum ossimKakaduCompressionQuality
+   {
+      // Prefixed with OKP for OSSIM Kakadu Plugin to avoid clashes.
+      OKP_UNKNOWN              = 0,
+      OKP_USER_DEFINED         = 1,
+      OKP_NUMERICALLY_LOSSLESS = 2,
+      OKP_VISUALLY_LOSSLESS    = 3,
+      OKP_LOSSY                = 4,
+      OKP_LOSSY2               = 5,
+      OKP_LOSSY3               = 6,
+      OKP_EPJE                 = 7,  // Exploitation Preferred J2K Encoding      
+   };
+
+   /**
+    * GP:  I had to add this or windows would not link with the latest
+    * compiler. Also had to put in dot.cpp for debug mode(again windows).
+    * (drb)
+    */
+   ossimKakaduCompressorInterface();
+
+   /**
+    * @brief Create method.
+    * @param os Stream to write to.
+    * @param scalar Scalar type of source tiles to be fed to compressor.
+    * @param bands Number of bands in source tiles to be fed to compressor.
+    * @param imageRect The image rectangle.
+    * @param tileSize The size of a tile.
+    * @param tilesTileWrite The number of tiles to be written.
+    * If zero, the tlm marker segment will not be used.
+    * @param jp2 If true jp2 header and jp2 geotiff block will be written out.
+    * @note Throws ossimException on error.
+    */
+   virtual void create(ossim::ostream* os,
+                       ossimScalarType scalar,
+                       ossim_uint32 bands,
+                       const ossimIrect& imageRect,
+                       const ossimIpt& tileSize,
+                       ossim_uint32 tilesToWrite,
+                       bool jp2) = 0;
+
+   /**
+    * @brief Write tile method.
+    *
+    * Writes tiles stream provided to create method.  Note that tiles should
+    * be fed to compressor in left to right, top to bottom order.
+    * 
+    * @param srcTile The source tile to write.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool writeTile(ossimImageData& srcTile) = 0;
+
+   /**
+    * @brief Finish method.  Every call to "create" should be matched by a
+    * "finish".  Note the destructor calls finish.
+    */
+   virtual void finish() = 0;
+
+   /**
+    * Set the writer to add an alpha channel to the output.
+    *
+    * @param flag true to create an alpha channel.
+    */
+   virtual void setAlphaChannelFlag( bool flag ) = 0;
+
+   /**
+    * @brief Sets the number of levels.
+    *
+    * This must be positive and at least 1.
+    * Default = 5 ( r0 - r5 )
+    *
+    * @param levels Levels to set.
+    */
+   virtual void setLevels(ossim_int32 levels) = 0;
+
+   /**
+    * Will set the property whose name matches the argument
+    * "property->getName()".
+    *
+    * @param property Object containing property to set.
+    *
+    * @return true if property was consumed, false if not.
+    */
+   virtual bool setProperty(ossimRefPtr<ossimProperty> property) = 0;
+
+   /**
+    * @brief Sets the quality type.
+    *
+    * Type enumerations:
+    *   OKP_UNKNOWN              = 0,
+    *   OKP_USER_DEFINED         = 1,
+    *   OKP_NUMERICALLY_LOSSLESS = 2,
+    *   OKP_VISUALLY_LOSSLESS    = 3,
+    *   OKP_EPJE                 = 4
+    *
+    * @param type See enumeration for types.
+    */
+   virtual void setQualityType(ossimKakaduCompressionQuality type) = 0;
+
+   
+   
+};
+
+#endif /* End of "#ifndef ossimKakaduCompressorInterface_HEADER" */
diff --git a/ossim/include/ossim/imaging/ossimLandsatTileSource.h b/include/ossim/imaging/ossimLandsatTileSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimLandsatTileSource.h
rename to include/ossim/imaging/ossimLandsatTileSource.h
diff --git a/ossim/include/ossim/imaging/ossimLandsatTopoCorrectionFilter.h b/include/ossim/imaging/ossimLandsatTopoCorrectionFilter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimLandsatTopoCorrectionFilter.h
rename to include/ossim/imaging/ossimLandsatTopoCorrectionFilter.h
diff --git a/include/ossim/imaging/ossimLasReader.h b/include/ossim/imaging/ossimLasReader.h
new file mode 100644
index 0000000..eebae11
--- /dev/null
+++ b/include/ossim/imaging/ossimLasReader.h
@@ -0,0 +1,330 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasReader.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasReader_HEADER
+#define ossimLasReader_HEADER 1
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/projection/ossimProjection.h>
+
+class ossimLasHdr;
+class ossimLasPointRecordInterface;
+
+/**
+ * @class ossimLasReader
+ *
+ * OSSIM LAS LIDAR reader.
+ */
+class ossimLasReader : public ossimImageHandler
+{
+public:
+
+   /** default constructor */
+   ossimLasReader();
+
+   /** virtual destructor */
+   virtual ~ossimLasReader();
+
+   /**
+    *  @brief open method.
+    *
+    *  Satisfies ossimImageHandler::open pure virtual.
+    *  
+    *  @return Returns true on success, false on error.
+    *
+    *  @note This method relies on the data member ossimImageData::theImageFile
+    *  being set.  Callers should do a "setFilename" prior to calling this
+    *  method or use the ossimImageHandler::open that takes a file name and an
+    *  entry index.
+    */
+   virtual bool open();
+
+   /**
+    *  @brief is open method.
+    *
+    *  Satisfies ossimImageHandler::isOpen pure virtual.
+    *
+    *  @return true if open, false if not.
+    */
+   virtual bool isOpen()const;
+
+   /**
+    * @brief Close method.
+    */
+   virtual void close();
+
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper left
+    *  corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+   /**
+    * @brief Gets bands.
+    *
+    * Satisfies ossimImageSource::getNumberOfInputBands pure virtual.
+    * 
+    * @retrun Number of bands.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+
+   /**
+    * @brief Gets lines.
+    *
+    * Satisfies ossimImageHandler::getNumberOfLines pure virtual.
+    *
+    * @param resLevel Reduced resolution level to return lines of.
+    * Default = 0
+    *
+    * @return The number of lines for specified reduced resolution level.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
+
+   /**
+    * @brief Gets samples.
+    *
+    * Satisfies ossimImageHandler::getNumberOfSamples
+    *
+    * @param resLevel Reduced resolution level to return samples of.
+    * Default = 0
+    *
+    * @return The number of samples for specified reduced resolution level.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+    
+   /**
+    * @brief Gets tile width.
+    *
+    * Satisfies ossimImageHandler::getImageTileWidth pure virtual.
+    * 
+    * @return The tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * @brief Gets tile height.
+    *
+    * Satisfies ossimImageHandler::getImageTileHeight pure virtual.
+    * 
+    * @return The tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   /** @return The width of the output tile. */
+   virtual ossim_uint32 getTileWidth() const;
+   
+   /** @returns The height of the output tile. */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /** @return The output pixel type of the tile source. */
+   ossimScalarType getOutputScalarType() const;
+
+   /**
+    * @brief Gets entry list.
+    * @param entryList This is the list to initialize with entry indexes.
+    */
+   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
+
+   /** @return The current entry number. */
+   virtual ossim_uint32 getCurrentEntry() const;
+
+   /**
+    * @param entryIdx Entry number to select.
+    * @return true if it was able to set the current entry and false otherwise.
+    */
+   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
+
+   /** @return "las" */
+   virtual ossimString getShortName() const;
+   
+   /** @return "ossim las (liblas) reader" */
+   virtual ossimString getLongName()  const;
+
+   /**
+    * Returns the image geometry object associated with this tile source or
+    * NULL if non defined.  The geometry contains full-to-local image
+    * transform as well as projection (image-to-world).
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /** @return Min pixel value. */
+   virtual double getMinPixelValue(ossim_uint32 band=0) const;
+
+   /** @return Min pixel value. */
+   virtual double getMaxPixelValue(ossim_uint32 band=0) const;
+
+   /** @return Min pixel value. */
+   virtual double getNullPixelValue(ossim_uint32 band=0) const;
+
+   /**
+    * @brief Method to save the state of an object to a keyword list.
+    * @return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+  
+   /**
+    * @brief Method to the load (recreate) the state of an object from a keyword list.
+    * @return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /**
+    * @brief Set propterty method. Overrides ossimImageHandler::setProperty.
+    *
+    * Current property name handled:
+    * "scale" One double value representing the scale in meters per pixel. It is
+    * assumed the scale is same for x and y direction.
+    * 
+    * @param property to set.
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /**
+     * @brief Get propterty method. Overrides ossimImageHandler::getProperty.
+    * @param name Property name to get.
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
+
+   /**
+    * @brief Get propterty names. Overrides ossimImageHandler::getPropertyNames.
+    * @param propertyNames Array to initialize.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames) const;
+
+   /** @return The total number of decimation levels. */
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+
+protected:
+   /**
+    * @brief Will complete the opening process.
+    *
+    * Overrides ossimImageHandler::completeOpen() as we do not ever have overviews.
+    */
+   virtual void completeOpen();
+   
+private:
+
+   /**
+    * @brief Container class to hold accumulated point data.  Currently single
+    * band.
+    */
+   class Bucket
+   {
+   public:
+      Bucket(): a(0.0), c(0), red(0), green(0), blue(0) {}
+         
+      void add(const ossim_float64& point) { a += point; ++c; }
+      ossim_float64 getValue() const { return ( c ? a/c : -99999.0 ); }
+      void setRed(const ossim_uint16& value) { red = value; }
+      void setGreen(const ossim_uint16& value) { green = value; }
+      void setBlue(const ossim_uint16& value) { blue = value; }
+      void setIntensity(const ossim_uint16& value) { intensity = value; }
+      ossim_uint16 getRed() const { return red; }
+      ossim_uint16 getGreen() const { return green; }
+      ossim_uint16 getBlue() const { return blue; }
+      ossim_uint16 getIntensity() const { return intensity; }
+
+      ossim_float64 a; // accumulation
+      ossim_uint32  c; // count
+      ossim_uint16 red;
+      ossim_uint16 green;
+      ossim_uint16 blue;
+      ossim_uint16 intensity;
+   };
+
+   bool init();
+   
+   void initValues(); // m_ul, m_lr, m_minZ
+   bool initProjection();
+   void initTile();
+   void initUnits(const ossimKeywordlist& geomKwl);
+   bool parseVarRecords();
+
+   /**
+    * @brief Looks for external FGDC text file to initialize projection from.
+    */
+   bool initFromExternalMetadata();
+   
+   /** @brief Get the scale for resLevel. */
+   void getScale(ossimDpt& scale, ossim_uint32 resLevel) const;
+
+   /** @brief Sets m_gsd data member and projection if projection is set. */
+   void setGsd( const ossim_float64& gsd );
+
+   void convertToMeters(ossim_float64& value) const;
+
+   /**
+    * Returns a point of type.
+    */
+   ossimLasPointRecordInterface* getNewPointRecord() const;
+
+   std::ifstream                m_str;
+   ossimLasHdr*                 m_hdr;
+   ossimRefPtr<ossimProjection> m_proj;
+   ossimDpt                     m_ul;
+   ossimDpt                     m_lr;
+   ossim_float64                m_maxZ;
+   ossim_float64                m_minZ;
+   ossimDpt                     m_gsd;
+   ossimRefPtr<ossimImageData>  m_tile;
+   ossim_uint8                  m_entry;
+   OpenThreads::Mutex           m_mutex;
+   bool                         m_scan;  // Scan for bounds at open.
+   ossimUnitType                m_units;
+   ossimUnitConversionTool*     m_unitConverter;
+TYPE_DATA
+};
+
+inline bool ossimLasReader::isOpen()const
+{
+   return ( m_str.is_open() && m_hdr );
+}
+
+inline void ossimLasReader::convertToMeters(ossim_float64& value) const
+{
+   if ( value )
+   {
+      m_unitConverter->setValue(value, m_units);
+      value = m_unitConverter->getMeters();
+   }
+}
+
+#endif /* #ifndef ossimLasReader_HEADER */
diff --git a/include/ossim/imaging/ossimLinearStretchRemapper.h b/include/ossim/imaging/ossimLinearStretchRemapper.h
new file mode 100644
index 0000000..bd005bf
--- /dev/null
+++ b/include/ossim/imaging/ossimLinearStretchRemapper.h
@@ -0,0 +1,72 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************
+// $Id: ossimLinearRemapper.h 23616 2015-11-11 19:50:29Z dburken $
+#ifndef ossimLinearRemapper_HEADER
+#define ossimLinearRemapper_HEADER
+
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+
+class ossimImageData;
+
+/***************************************************************************************************
+ *
+ * This class provides a linear remap between a min and a max value. Default is to do a linear
+ * stretch between the input connection's min and max, but the user can also define specific min
+ * and max. In the latter case, the input pixels outside the range will be clamped.
+ *
+ * If non-default min and max values are to be used, the min and max values must be set for all
+ * bands, otherwise the defaults will be used for all bands.
+ *
+ * The output scalar type is normalized double.
+ *
+ **************************************************************************************************/
+class OSSIM_DLL ossimLinearStretchRemapper : public ossimImageSourceFilter
+{
+public:
+
+   ossimLinearStretchRemapper();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   void           setMinPixelValue(double value, ossim_uint32 band=0);
+   void           setMaxPixelValue(double value, ossim_uint32 band=0);
+   
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual void initialize();
+
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
+
+   virtual ossimScalarType getOutputScalarType() const { return OSSIM_NORMALIZED_DOUBLE; }
+
+protected:
+   virtual ~ossimLinearStretchRemapper();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+
+   std::vector<double> m_minValues;
+   std::vector<double> m_maxValues;
+   ossimRefPtr<ossimImageData> m_tile;
+   
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimLinearRemapper_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimLocalCorrelationFusion.h b/include/ossim/imaging/ossimLocalCorrelationFusion.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimLocalCorrelationFusion.h
rename to include/ossim/imaging/ossimLocalCorrelationFusion.h
diff --git a/include/ossim/imaging/ossimMapCompositionSource.h b/include/ossim/imaging/ossimMapCompositionSource.h
new file mode 100644
index 0000000..eae1552
--- /dev/null
+++ b/include/ossim/imaging/ossimMapCompositionSource.h
@@ -0,0 +1,336 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimMapCompositionSource.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimMapCompositionSource_HEADER
+#define ossimMapCompositionSource_HEADER
+#include <ossim/imaging/ossimAnnotationSource.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/font/ossimFont.h>
+#include <ossim/base/ossimFontInformation.h>
+
+class ossimFont;
+class ossimMapProjection;
+class ossimU8ImageData;
+
+class ossimMapCompositionSource : public ossimAnnotationSource
+{
+public:
+   enum ossimGridLineType
+   {
+      OSSIM_GRID_NONE    = 0,
+      OSSIM_GRID_LINE    = 1,
+      OSSIM_GRID_RESEAUX = 2
+   };
+
+   ossimMapCompositionSource();
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual ossim_uint32    getNumberOfOutputBands() const;
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+
+   ossimIpt getViewWidthHeight()const;
+
+   void getViewWidthHeight(ossimIpt& widthHeight)const;
+   
+   void setViewWidthHeight(const ossimIpt& widthHeight);
+   
+   // all borders here
+   virtual ossim_int32 getTopBorderLength()const;
+   virtual ossim_int32 getBottomBorderLength()const;
+   virtual ossim_int32 getLeftBorderLength()const;
+   virtual ossim_int32 getRightBorderLength()const;
+
+   virtual void setTopBorderLength(ossim_int32 length);
+   virtual void setBottomBorderLength(ossim_int32 length);
+   virtual void setLeftBorderLength(ossim_int32 length);
+   virtual void setRightBorderLength(ossim_int32 length);
+
+   //all spacing here
+   void setGeographicSpacingLat(double value);
+   void setGeographicSpacingLon(double value);
+   void setMeterSpacingX(double value);
+   void setMeterSpacingY(double value);
+   void setMeterSpacing(double x, double y);
+   void setGeographicSpacing(double lat, double lon);
+
+   ossimDpt getGeographicSpacing()const;
+   ossimDpt getMeterSpacing()const;
+   
+   // All geographic formatting here
+   virtual ossimString getTopGeographicLabelFormat()const;
+   virtual ossimString getBottomGeographicLabelFormat()const;
+   virtual ossimString getLeftGeographicLabelFormat()const;
+   virtual ossimString getRightGeographicLabelFormat()const;
+
+   virtual void setGeographicLabelFormat(const ossimString format);
+   virtual void setTopGeographicLabelFormat(const ossimString& format);
+   virtual void setBottomGeographicLabelFormat(const ossimString& format);
+   virtual void setLeftGeographicLabelFormat(const ossimString& format);
+   virtual void setRightGeographicLabelFormat(const ossimString& format);
+   
+   // All font funtions here.
+   virtual ossimString    getTitle()const;
+   virtual ossimRgbVector getTitleColor()const;
+
+   virtual void setTitleFont(const ossimFontInformation& fontInfo);
+   virtual void setTitleColor(const ossimRgbVector& color);
+   virtual void setTitle(const ossimString& s);
+   virtual void setGeographicTopLabelFont(const ossimFontInformation& fontInfo);
+   virtual void setGeographicBottomLabelFont(const ossimFontInformation& fontInfo);
+   virtual void setGeographicLeftLabelFont(const ossimFontInformation& fontInfo);
+   virtual void setGeographicRightLabelFont(const ossimFontInformation& fontInfo);
+
+   virtual void setMeterTopLabelFont(const ossimFontInformation& fontInfo);
+   virtual void setMeterBottomLabelFont(const ossimFontInformation& fontInfo);
+   virtual void setMeterLeftLabelFont(const ossimFontInformation& fontInfo);
+   virtual void setMeterRightLabelFont(const ossimFontInformation& fontInfo);
+
+   virtual ossimFontInformation getTitleFont()const;
+   virtual ossimFontInformation getGeographicTopLabelFontInfo()const;
+   virtual ossimFontInformation getGeographicBottomLabelFontInfo()const;
+   virtual ossimFontInformation getGeographicLeftLabelFontInfo()const;
+   virtual ossimFontInformation getGeographicRightLabelFontInfo()const;
+   virtual ossimFontInformation getMeterTopLabelFontInfo()const;
+   virtual ossimFontInformation getMeterBottomLabelFontInfo()const;
+   virtual ossimFontInformation getMeterLeftLabelFontInfo()const;
+   virtual ossimFontInformation getMeterRightLabelFontInfo()const;
+
+   // All color funtions here
+   virtual ossimRgbVector getBorderColor()const;
+   virtual void setBorderColor(const ossimRgbVector& color);
+
+   virtual ossimRgbVector getGeographicGridColor()const;
+   virtual ossimRgbVector getMeterGridColor()const;
+   virtual ossimRgbVector getTopGeographicLabelColor()const;
+   virtual ossimRgbVector getBottomGeographicLabelColor()const;
+   virtual ossimRgbVector getLeftGeographicLabelColor()const;
+   virtual ossimRgbVector getRightGeographicLabelColor()const;
+
+   virtual void setGeographicGridColor(const ossimRgbVector& color);
+   virtual void setTopGeographicLabelColor(const ossimRgbVector& color);
+   virtual void setBottomGeographicLabelColor(const ossimRgbVector& color);
+   virtual void setLeftGeographicLabelColor(const ossimRgbVector& color);
+   virtual void setRightGeographicLabelColor(const ossimRgbVector& color);
+   virtual void setGeographicLabelColor(const ossimRgbVector& color);
+
+   virtual ossimRgbVector getTopMeterLabelColor()const;
+   virtual ossimRgbVector getBottomMeterLabelColor()const;
+   virtual ossimRgbVector getLeftMeterLabelColor()const;
+   virtual ossimRgbVector getRightMeterLabelColor()const;
+   
+   virtual void setTopMeterLabelColor(const ossimRgbVector& color);
+   virtual void setBottomMeterLabelColor(const ossimRgbVector& color);
+   virtual void setLeftMeterLabelColor(const ossimRgbVector& color);
+   virtual void setRightMeterLabelColor(const ossimRgbVector& color);
+   virtual void setMeterLabelColor(const ossimRgbVector& color);
+   virtual void setMeterGridColor(const ossimRgbVector& color);
+
+   // All grid types here
+   virtual void setMeterGridType(ossimGridLineType gridType);
+   virtual void setGeographicGridType(ossimGridLineType gridType);
+   virtual void setBorderColor(ossimRgbVector& color);
+
+   virtual ossimGridLineType getGeographicGridType()const;
+   virtual ossimGridLineType getMeterGridType()const;
+   
+   // all grid flags here
+   void setGeographicTickMarkFlag(bool flag);
+   void setTopGeographicTickMarkFlag(bool flag);
+   void setBottomGeographicTickMarkFlag(bool flag);
+   void setLeftGeographicTickMarkFlag(bool flag);
+   void setRightGeographicTickMarkFlag(bool flag);
+   void setTopGeographicLabelFlag(bool flag);
+   void setBottomGeographicLabelFlag(bool flag);
+   void setLeftGeographicLabelFlag(bool flag);
+   void setRightGeographicLabelFlag(bool flag);
+
+   virtual bool getTopGeographicTickMarkFlag()const;
+   virtual bool getBottomGeographicTickMarkFlag()const;
+   virtual bool getLeftGeographicTickMarkFlag()const;
+   virtual bool getRightGeographicTickMarkFlag()const;
+   virtual bool getTopGeographicLabelFlag()const;
+   virtual bool getBottomGeographicLabelFlag()const;
+   virtual bool getLeftGeographicLabelFlag()const;
+   virtual bool getRightGeographicLabelFlag()const;
+
+   void setMeterTickMarkFlag(bool flag);
+   virtual void setTopMeterTickMarkFlag(bool flag);
+   virtual void setBottomMeterTickMarkFlag(bool flag);
+   virtual void setLeftMeterTickMarkFlag(bool flag);
+   virtual void setRightMeterTickMarkFlag(bool flag);
+   virtual void setTopMeterLabelFlag(bool flag);
+   virtual void setBottomMeterLabelFlag(bool flag);
+   virtual void setLeftMeterLabelFlag(bool flag);
+   virtual void setRightMeterLabelFlag(bool flag);
+   
+   virtual bool getTopMeterTickMarkFlag()const;
+   virtual bool getBottomMeterTickMarkFlag()const;
+   virtual bool getLeftMeterTickMarkFlag()const;
+   virtual bool getRightMeterTickMarkFlag()const;
+   virtual bool getTopMeterLabelFlag()const;
+   virtual bool getBottomMeterLabelFlag()const;
+   virtual bool getLeftMeterLabelFlag()const;
+   virtual bool getRightMeterLabelFlag()const;
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+
+   virtual void initialize();
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+protected:
+   virtual ~ossimMapCompositionSource();
+   ossimIpt            theViewWidthHeight;
+   ossimGridLineType   theMeterGridType;
+   ossimGridLineType   theGeographicGridType;
+   
+   ossim_uint32        theTopBorderLength;
+   ossim_uint32        theBottomBorderLength;
+   ossim_uint32        theLeftBorderLength;
+   ossim_uint32        theRightBorderLength;
+   
+   ossimRgbVector      theBorderColor;
+
+   ossimRgbVector      theGeographicGridColor;
+   ossimRgbVector      theMeterGridColor;
+
+   // title info
+   //
+   ossimString          theTitleString;
+   ossimRefPtr<ossimFont>           theTitleFont;
+   ossimFontInformation theTitleFontInfo;
+   ossimRgbVector       theTitleColor;
+   
+   // grid label colors
+   //
+   ossimRgbVector      theTopGeographicLabelColor;
+   ossimRgbVector      theBottomGeographicLabelColor;
+   ossimRgbVector      theLeftGeographicLabelColor;
+   ossimRgbVector      theRightGeographicLabelColor;
+   ossimRgbVector      theTopMeterLabelColor;
+   ossimRgbVector      theBottomMeterLabelColor;
+   ossimRgbVector      theLeftMeterLabelColor;
+   ossimRgbVector      theRightMeterLabelColor;
+
+   // grid label font
+   //
+   ossimFontInformation theGeographicTopLabelFontInfo;
+   ossimRefPtr<ossimFont>           theGeographicTopLabelFont;
+   ossimFontInformation theGeographicBottomLabelFontInfo;
+   ossimRefPtr<ossimFont>           theGeographicBottomLabelFont;
+   ossimFontInformation theGeographicLeftLabelFontInfo;
+   ossimRefPtr<ossimFont>           theGeographicLeftLabelFont;
+   ossimFontInformation theGeographicRightLabelFontInfo;
+   ossimRefPtr<ossimFont>           theGeographicRightLabelFont;
+
+   ossimFontInformation theMeterTopLabelFontInfo;
+   ossimRefPtr<ossimFont>           theMeterTopLabelFont;
+   ossimFontInformation theMeterBottomLabelFontInfo;
+   ossimRefPtr<ossimFont>           theMeterBottomLabelFont;
+   ossimFontInformation theMeterLeftLabelFontInfo;
+   ossimRefPtr<ossimFont>           theMeterLeftLabelFont;
+   ossimFontInformation theMeterRightLabelFontInfo;
+   ossimRefPtr<ossimFont>           theMeterRightLabelFont;
+   
+   // grid label dms format strings
+   //
+   ossimString         theTopGeographicFormat;
+   ossimString         theBottomGeographicFormat;
+   ossimString         theLeftGeographicFormat;
+   ossimString         theRightGeographicFormat;
+
+   // grid label flag
+   //
+   bool                theTopGeographicLabelFlag;
+   bool                theBottomGeographicLabelFlag;
+   bool                theLeftGeographicLabelFlag;
+   bool                theRightGeographicLabelFlag;
+
+   bool                theTopGeographicTickFlag;
+   bool                theBottomGeographicTickFlag;
+   bool                theLeftGeographicTickFlag;
+   bool                theRightGeographicTickFlag;
+
+   bool                theTopMeterLabelFlag;
+   bool                theBottomMeterLabelFlag;
+   bool                theLeftMeterLabelFlag;
+   bool                theRightMeterLabelFlag;
+
+   bool                theTopMeterTickFlag;
+   bool                theBottomMeterTickFlag;
+   bool                theLeftMeterTickFlag;
+   bool                theRightMeterTickFlag;
+   
+   
+   ossimIrect          theTopBorder;
+   ossimIrect          theBottomBorder;
+   ossimIrect          theLeftBorder;
+   ossimIrect          theRightBorder;
+
+   // geo-tick spacing in lat lon
+   ossimDpt            theGeographicSpacing;
+
+   //  tick spacing in meter units
+   ossimDpt            theMeterSpacing;
+   
+   ossimAnnotationSource::AnnotationObjectListType theFixedAnnotationList;
+
+   /*!
+    * Override base classes drawAnnotations so we can layout
+    * any fixed annotations first.
+    */
+   virtual void drawAnnotations(ossimRefPtr<ossimImageData> tile);
+   
+   virtual void computeBorderRects();
+   virtual void drawBorders();
+   virtual void addGridLabels();
+   
+   virtual void addGeographicTopGridLabels();
+   virtual void addGeographicBottomGridLabels();
+   virtual void addGeographicLeftGridLabels();
+   virtual void addGeographicRightGridLabels();
+
+   virtual void addGeographicGridLines();
+   virtual void addGeographicGridReseaux();
+   
+   virtual void addMeterGridLabels();
+   
+   virtual void addMeterGridLines();
+   virtual void addMeterGridReseaux();
+
+   
+   virtual void addTitle();
+   
+   virtual void layoutAnnotations();
+
+   virtual void addFixedAnnotation(ossimAnnotationObject* obj);
+      
+   virtual void deleteFixedAnnotations();
+   
+   ossimIrect getViewingRect()const;
+   
+   //! Fetches the input connection's image geometry and verifies that it is a map projection.
+   //! Returns NULL if no valid projection found.
+   const ossimMapProjection* inputMapProjection() const;
+
+// For RTTI
+TYPE_DATA
+};
+#endif /* #ifndef ossimMapCompositionSource_HEADER */
+
diff --git a/include/ossim/imaging/ossimMaskFilter.h b/include/ossim/imaging/ossimMaskFilter.h
new file mode 100644
index 0000000..d0a90aa
--- /dev/null
+++ b/include/ossim/imaging/ossimMaskFilter.h
@@ -0,0 +1,266 @@
+//*******************************************************************
+  // Copyright (C) 2000 ImageLinks Inc. 
+  //
+  // License:  LGPL
+  // 
+  // See LICENSE.txt file in the top level directory for more details.
+  //
+  // Author: Garrett Potts
+  // Modified by: Elan Sharghi (1/20/2009)
+  // Description: Class declaration for ossimMaskFilter.
+  //
+  //*************************************************************************
+    // $Id: ossimMaskFilter.h 20409 2011-12-22 16:57:05Z dburken $
+#ifndef  ossimMaskFilter_HEADER
+#define  ossimMaskFilter_HEADER 1
+#include <ossim/imaging/ossimImageSource.h>
+
+    /**
+     * <pre>
+     * class ossimMaskFilter
+     *
+     *    Requires 2 inputs.  The first input is assumed to be the image input
+     *    and the second input is assumed to be the mask data.  It will only
+     *    use one band of the mask and multi band masks are not supported.
+     *
+     *    the number of bands, min pix, max pix, null pix ...etc are mapped
+     *    to the first input.
+     *
+     * Keywords:
+     *    mask_type:
+     *
+     * keywords description: This keyword can have the following values:
+     *    select, select_clamp, invert, weighted, binary, or binary_inverse
+     *         
+     *    - select will use the input data and every where
+     *      the mask is greater than 0 it will copy the input to the output.
+     *
+     *    - select_clamp_min If mask pixel is non zero, output pixel is input
+     *      pixel; else, null pixel value. Differs from select in that output
+     *      pixel is clamped to min pixel if input pixel is used. 
+     *      
+     *    - invert will use the input data and every where the mask is 0 it
+     *      will copy the input to the output else it will place a null in
+     *      the output.
+     *      
+     *    - weighted will normalize the mask between 0 and 1 and then multiply
+     *      the input by that normalized value and copy to the output.
+     *
+     *    - binary If mask pixel is non zero, output pixel is max pixel value;
+     *      else, null.
+     *
+     *    - binary_inverse If mask pixel is non zero, output pixel is max pixel
+     *      value; else, null pixel value. 
+     *    
+     * example of keywords:
+     *
+     *      mask_type: select
+     *
+     * </pre>
+     */
+class OSSIMDLLEXPORT ossimMaskFilter : public ossimImageSource
+{
+public:
+   /**
+    * Enumeration used to identify what the selection type for this mask is to
+    * be used:
+    * 
+    * - OSSIM_MASK_TYPE_SELECT
+    *   If the mask is non zero then the input is kept if it's 0 then the input
+    *   is nulled out.
+    * - OSSIM_MASK_TYPE_INVERT
+    *   If the input is non zero then the output is nulled else the input is kept
+    * - OSSIM_MASK_TYPE_WEIGHTED
+    *   works as a multiplier of the input data.  The mask is normalized to be
+    *   between 0 and 1 and multiplies the input by that normalized value.
+    * - OSSIM_MASK_TYPE_BINARY
+    *   If mask pixel is non zero, output pixel is null pixel value; else, max
+    *   pixel value.
+    * - OSSIM_MASK_TYPE_BINARY_INVERSE
+    *   If mask pixel is non zero, output pixel is max pixel value; else, null
+    *   pixel value.
+    * - OSSIM_MASK_TYPE_SELECT_CLAMP_MIN
+    *   If mask pixel is non zero, output pixel is input pixel; else, null pixel
+    *   value. Differs from OSSIM_MASK_TYPE_SELECT in that output pixel is
+    *   clamped to min pixel if input pixel is used. The clampling has the
+    *   affect of flipping null pixels to min pixel value if the mask pixel is
+    *   non zero and input pixel is a null.
+    */
+  enum ossimFileSelectionMaskType
+  {
+     /**< standard select if mask is true then keep */
+     OSSIM_MASK_TYPE_SELECT         = 1,
+     /**< standard invert if mask is true the don't keep */
+     OSSIM_MASK_TYPE_INVERT         = 2,
+     /**< weighted operation.  Normalize the mask and multiply the input */
+     OSSIM_MASK_TYPE_WEIGHTED       = 3,
+     /**< binary image> */
+     OSSIM_MASK_TYPE_BINARY         = 4,
+     /**< inverse binary image> */
+     OSSIM_MASK_TYPE_BINARY_INVERSE = 5,
+     /**< Standard select if mask is true then keep with min. */
+     OSSIM_MASK_TYPE_SELECT_CLAMP_MIN = 6,
+  };
+
+   /**
+    * Default Constructor.
+    */
+   ossimMaskFilter(ossimObject* owner=NULL);
+
+   /**
+    * This set method is necessary when this object is being added to an ossimImageChain because
+    * ossimImageChain::addLast() performs a disconnect of all the input sources, thus losing the
+    * assignments made via constructor accepting source pointers. If the intent is to insert this
+    * object in place of the image handler in a chain, First remove the handler from the chain, then
+    * add a default-constructed mask filter object, then call this method to assign the inputs.
+    */
+   void setMaskSource(ossimImageSource* maskSource);
+
+   /**
+    * Sets the mask type.
+    * @param type The mask algorithm type to be used.
+    * see ossimFileSelectionMaskType
+    */
+   virtual void setMaskType(ossimFileSelectionMaskType type);
+   
+   /**
+    * @brief Sets the mask type from string.
+    *
+    * Valid strings are:  "select", "invert" and "weighted".
+    * 
+    * @param type The mask algorithm type to be used.
+    */
+   virtual void setMaskType(const ossimString& type);
+
+   /**
+    * Returns the current mask algorithm used.
+    * \return the current ossimFileSelectionMaskType used.
+    */
+   virtual ossimFileSelectionMaskType getMaskType() const;
+
+   /**
+    * @brief Returns the current mask algorithm used as a string.
+    * @return the current ossimFileSelectionMaskType used.
+    */
+   virtual ossimString getMaskTypeString() const;
+
+   /**
+    * Main entry point for the algorithm.
+    * \param rect 
+    *
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   virtual bool canConnectMyInputTo(ossim_int32 index, const ossimConnectableObject* object)const;
+   
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+
+   virtual ossimRefPtr<ossimImageData> executeMaskFilter(
+      ossimRefPtr<ossimImageData> imageSourceData,
+      ossimRefPtr<ossimImageData> maskSourceData);
+
+   /** @brief Interface to set the mask type. */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /** @return "mask_type" property. */
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+
+   /** @brief Adds "mask_type" to list. */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+protected:
+   /**
+    * Will delete its owned tile.
+    */
+   virtual ~ossimMaskFilter();
+   
+   void allocate();
+   
+   /**
+    * will execute the section algorithm.  everywhere the mask is not 0 it
+    * copies the input data to the output and everywhere the input is null it
+    * writes a null pixel to the output.
+    */
+   ossimRefPtr<ossimImageData> executeMaskFilterSelect(
+      ossimRefPtr<ossimImageData> imageSourceData,
+      ossimRefPtr<ossimImageData> maskSourceData);
+
+   /**
+    * will execute the invert selection algorithm.  everywhere the mask is 0
+    * it copies the input data to the output else it outputs null.
+    */
+   ossimRefPtr<ossimImageData> executeMaskFilterInvertSelect(
+      ossimRefPtr<ossimImageData> imageSourceData,
+      ossimRefPtr<ossimImageData> maskSourceData);
+
+   /**
+    * will execute the weighted algorithm.  It normalizes the mask value to
+    * be between 0 and 1 and multiplies the input data by that value and
+    * outputs it.  
+    */
+   ossimRefPtr<ossimImageData> executeMaskFilterWeighted(
+      ossimRefPtr<ossimImageData> imageSourceData,
+      ossimRefPtr<ossimImageData> maskSourceData);
+
+   /**
+    * Will execute the binary algorithm. Copies the values in the mask to each 
+    * tile. Values will be either NULL or MAX pixel value, typically 0 or 255.
+    */
+   ossimRefPtr<ossimImageData> executeMaskFilterBinary(
+      ossimRefPtr<ossimImageData> imageSourceData,
+      ossimRefPtr<ossimImageData> maskSourceData);
+   
+   template <class inputT, class maskT>
+      ossimRefPtr<ossimImageData> executeMaskFilterSelection(
+         inputT dummyInput,
+         maskT  dummyMask,
+         ossimRefPtr<ossimImageData> imageSourceData,
+         ossimRefPtr<ossimImageData> maskSourceData);
+   
+   template <class inputT, class maskT>
+      ossimRefPtr<ossimImageData> executeMaskFilterInvertSelection(
+         inputT dummyInput,
+         maskT  dummyMask,
+         ossimRefPtr<ossimImageData> imageSourceData,
+         ossimRefPtr<ossimImageData> maskSourceData);
+   
+   template <class inputT, class maskT>
+      ossimRefPtr<ossimImageData> executeMaskFilterWeighted(
+         inputT dummyInput,
+         maskT  dummyMask,
+         ossimRefPtr<ossimImageData> imageSourceData,
+         ossimRefPtr<ossimImageData> maskSourceData);
+
+   template <class inputT, class maskT>
+   ossimRefPtr<ossimImageData> executeMaskFilterBinarySelection(
+      inputT dummyInput,
+      maskT  dummyMask,
+      ossimRefPtr<ossimImageData> imageSourceData,
+      ossimRefPtr<ossimImageData> maskSourceData);
+
+   /**
+    * Member variable that holds the algorithm type to run on the calls to getTile.
+    */
+   ossimFileSelectionMaskType  theMaskType;
+
+   /**
+    * Member used to store the result of the applied algorithm type.  This is returned
+    * from the call to getTile.
+    */
+   ossimRefPtr<ossimImageData> theTile;
+   ossimRefPtr<ossimImageSource> theMaskSource;
+
+   TYPE_DATA
+};
+
+#endif /* #ifndef ossimMaskFilter_HEADER */
diff --git a/include/ossim/imaging/ossimMaxMosaic.h b/include/ossim/imaging/ossimMaxMosaic.h
new file mode 100644
index 0000000..af13fd1
--- /dev/null
+++ b/include/ossim/imaging/ossimMaxMosaic.h
@@ -0,0 +1,78 @@
+//*******************************************************************
+// Copyright (C) 2005 SANZ Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Kenneth Melero (kmelero at sanz.com)
+//
+// Description: This combiner is designed to "float" the maximum pixel value
+//              of all inputs to the top of the mosaic output. 
+//
+//*************************************************************************
+// $Id: ossimMaxMosaic.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimMaxMosaic_HEADER
+#define ossimMaxMosaic_HEADER
+
+#include <vector>
+#include <ossim/imaging/ossimImageCombiner.h>
+
+
+/**
+ * An image mosaic is a simple combiner that will
+ * just do a simple mosaic.  It just checks NULL pix values until it finds a
+ * pixel that is not empty and copies it out to the output.  The list will
+ * have same size tiles and have the same number of bands.
+ */
+class OSSIMDLLEXPORT ossimMaxMosaic : public ossimImageCombiner
+{
+public:
+   ossimMaxMosaic();
+   ossimMaxMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual ossimString getShortName() const;
+   virtual ossimString getLongName()  const;
+   virtual ossimString getDescription()const;
+
+protected:
+   virtual ~ossimMaxMosaic();
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theTile;
+
+   template <class T> ossimRefPtr<ossimImageData> combine(
+      T, // dummy template variable not used
+      const ossimIrect& tileRect,
+      ossim_uint32 resLevel=0);
+   template <class T> ossimRefPtr<ossimImageData> combineNorm(
+      T, // dummy template variable not used
+      const ossimIrect& tileRect,
+      ossim_uint32 resLevel=0);
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimMeanMedianFilter.h b/include/ossim/imaging/ossimMeanMedianFilter.h
new file mode 100644
index 0000000..9e50e9b
--- /dev/null
+++ b/include/ossim/imaging/ossimMeanMedianFilter.h
@@ -0,0 +1,129 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimMeanMedianFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimMeanMedianFilter_HEADER
+#define ossimMeanMedianFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/*!
+ * class ossimMeanMedianFilter
+ *
+ * Allows you to change between a median or mean filter.  You can
+ * also specify a window size which the median or mean is computed and
+ * the center pixel is replaced.
+ *
+ */
+class OSSIM_DLL ossimMeanMedianFilter : public ossimImageSourceFilter
+{
+public:
+
+   enum ossimMeanMedianFilterType
+   {
+      /** Applies filter to any non-null center pixel. */
+      OSSIM_MEDIAN                  = 0,
+
+      /** Applies filter to all pixels including null center pixels. */
+      OSSIM_MEDIAN_FILL_NULLS       = 1,
+
+      /** Applies filter to only null center pixels. */
+      OSSIM_MEDIAN_NULL_CENTER_ONLY = 2,
+
+      /** Applies filter to any non-null center pixel. */
+      OSSIM_MEAN                    = 3,
+
+      /* Applies filter to all pixels including null center pixels. */
+      OSSIM_MEAN_FILL_NULLS         = 4,
+
+      /** Applies filter to only null center pixels. */
+      OSSIM_MEAN_NULL_CENTER_ONLY   = 5
+   };
+
+   ossimMeanMedianFilter(ossimObject* owner=NULL);
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   virtual void initialize();
+
+   void setWindowSize(ossim_uint32 windowSize);
+   ossim_uint32 getWindowSize()const;
+
+   /**
+    * @param flag Set "theAutoGrowRectFlag".  This only affects filter types
+    * that set nulls.  Will have a growing affect on the edges.
+    */
+   void setAutoGrowRectFlag(bool flag);
+   bool getAutoGrowRectFlag() const;
+
+   void setFilterType(ossimMeanMedianFilterType type);
+   void setFilterType(const ossimString& type);
+   ossimString getFilterTypeString() const;
+   void getFilterTypeList(std::vector<ossimString>& list) const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * @return Returns the bounding rectangle which is the input bounding
+    * rectangle with any expansion (from autogrow) added in.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+
+protected:
+   virtual ~ossimMeanMedianFilter();
+   
+   ossimRefPtr<ossimImageData> theTile;
+   ossimMeanMedianFilterType   theFilterType;
+   ossim_uint32                theWindowSize;
+
+   /** Used by applyMean and applyMedian for "fill null" modes. */
+   bool theEnableFillNullFlag;
+
+   /**
+    * If true rectangle is expanded by half filter in each direction if the
+    * theFilterType fills nulls.
+    */
+   bool theAutoGrowRectFlag;
+
+   void applyFilter(ossimRefPtr<ossimImageData>& input);
+
+   template <class T>
+      void applyMean(T dummyVariable,
+                     ossimRefPtr<ossimImageData>& inputData);
+   template <class T>
+      void applyMeanNullCenterOnly(T dummyVariable,
+                                   ossimRefPtr<ossimImageData>& inputData);
+
+   template <class T>
+      void applyMedian(T dummyVariable,
+                       ossimRefPtr<ossimImageData>& inputData);
+   template <class T>
+      void applyMedianNullCenterOnly(T dummyVariable,
+                                     ossimRefPtr<ossimImageData>& inputData);
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimMemoryImageSource.h b/include/ossim/imaging/ossimMemoryImageSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimMemoryImageSource.h
rename to include/ossim/imaging/ossimMemoryImageSource.h
diff --git a/include/ossim/imaging/ossimMetadataFileWriter.h b/include/ossim/imaging/ossimMetadataFileWriter.h
new file mode 100644
index 0000000..04d44ec
--- /dev/null
+++ b/include/ossim/imaging/ossimMetadataFileWriter.h
@@ -0,0 +1,176 @@
+//*******************************************************************
+// Copyright (C) 2003 Storage Area Networks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kenneth Melero (kmelero at sanz.com)
+//
+//*******************************************************************
+//  $Id: ossimMetadataFileWriter.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimMetadataFileWriter_H
+#define ossimMetadataFileWriter_H
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimObjectEvents.h>
+#include <ossim/base/ossimProcessProgressEvent.h>
+
+class ossimImageSource;
+
+/**
+ * ossimMetadataFileWriter
+ *
+ * Typical usage something like this:
+ *
+ * ossimObject* obj = ossimImageMetaDataWriterRegistry::instance()->
+ *     createObject(ossimString("ossimReadmeFileWriter"));
+ * if (!obj)
+ * {
+ *    return;
+ * }
+ * ossimMetadataFileWriter* mw = PTR_CAST(ossimMetadataFileWriter, obj);
+ * if (!mw)
+ * {
+ *    return;
+ * }
+ * 
+ * mw->setFilename(xmlFile);
+ * mw->loadState(kwl);
+ * mw->connectMyInputTo(ih.get());
+ * mw->execute();
+ * delete mw;
+ */
+class OSSIMDLLEXPORT ossimMetadataFileWriter :
+   public ossimConnectableObject,
+   public ossimProcessInterface,
+   public ossimConnectableObjectListener
+{   
+public:
+   ossimMetadataFileWriter();
+   
+
+   virtual ossimObject*       getObject();
+   virtual const ossimObject* getObject() const;
+
+   virtual void initialize();
+   
+   virtual bool execute();
+   
+   virtual void setPercentComplete(double percentComplete);
+   
+   virtual void setFilename(const ossimFilename& file);
+   
+   const ossimFilename& getFilename()const;
+
+   /**
+    * Load state method:
+    *
+    * This method call base class ossimConnectableObject::loadState then
+    * looks for its keywords.
+    *
+    * @param kwl Keyword list to initialize from.
+    *
+    * @param prefix Usually something like: "object1."
+    *
+    * @return This method will alway return true as it is intended to be
+    * used in conjuction with the set methods.
+    *
+    * Keywords picked up by loadState:
+    *
+    * filename: foo.tfw
+    *
+    * (pixel_type should be area or point)
+    * 
+    * pixel_type: area
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
+   
+   bool canConnectMyInputTo(ossim_int32 inputIndex,
+                            const ossimConnectableObject* object) const;
+   
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+   virtual void propertyEvent(ossimPropertyEvent& event);
+
+   /**
+    * Ossim uses a concept of "pixel is point" internally.
+    * 
+    * This means that if you say a tie point is 30.0N -81.0W, the center of
+    * the pixel at the tie point is 30.0N -81.0W.
+    *
+    */ 
+   virtual void setPixelType(ossimPixelType pixelType);
+   virtual ossimPixelType getPixelType() const;
+
+   /**
+    * Sets the area of interest to write the meta data for.
+    * 
+    * @param areaOfInterest Sets theAreaOfInterest.
+    *
+    * @note By default the writers will use
+    * "theInputConnection->getBoundingRect()" if theAreaOfInterest has nans.
+    */
+   virtual void setAreaOfInterest(const ossimIrect& areaOfInterest);
+
+   /**
+    * @returns theAreaOfInterest.
+    */
+   virtual ossimIrect getAreaOfInterest() const;
+
+   /**
+    * void getMetadatatypeList(std::vector<ossimString>& metadatatypeList)const
+    *
+    * pure virtual
+    * 
+    * Appends the writers metadata types to the "metadatatypeList".
+    * 
+    * This is the actual image type name.  So for
+    * example, ossimTiffWorldFileWriter has tiff_world_file type.
+    *
+    * @param metadatatypeList stl::vector<ossimString> list to append to.
+    *
+    * @note All writers should append to the list, not, clear it and then add
+    * their types.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList)const=0;
+
+   /**
+    * bool hasMetadataType(const ossimString& metadataType) const
+    *
+    * @param imageType string representing image type.
+    *
+    * @return true if "metadataType" is supported by writer.
+    */
+   virtual bool hasMetadataType(const ossimString& metadataType)const=0;
+   
+   /*!
+    * property interface
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+protected:
+   virtual ~ossimMetadataFileWriter();
+   /**
+    * Write out the file.
+    * @return true on success, false on error.
+    */
+   virtual bool writeFile() = 0;
+
+   ossimImageSource* theInputConnection;
+   ossimFilename              theFilename;
+   ossimPixelType             thePixelType;
+   ossimIrect                 theAreaOfInterest;
+   
+TYPE_DATA
+};
+
+#endif /* End of #ifndef ossimMetadataFileWriter_H */
diff --git a/include/ossim/imaging/ossimMonoGridRemapEngine.h b/include/ossim/imaging/ossimMonoGridRemapEngine.h
new file mode 100644
index 0000000..78385da
--- /dev/null
+++ b/include/ossim/imaging/ossimMonoGridRemapEngine.h
@@ -0,0 +1,54 @@
+//*****************************************************************************
+// FILE: ossimMonoGridRemapEngine.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimMonoGridRemapEngine
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimMonoGridRemapEngine.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef ossimMonoGridRemapEngine_HEADER
+#define ossimMonoGridRemapEngine_HEADER
+
+#include <ossim/imaging/ossimGridRemapEngine.h>
+
+/*!****************************************************************************
+ *
+ * CLASS: ossimMonoGridRemapEngine 
+ *
+ *****************************************************************************/
+class ossimMonoGridRemapEngine : public ossimGridRemapEngine
+{
+public:
+   ossimMonoGridRemapEngine()
+      : ossimGridRemapEngine(1, 1) {}
+   
+   virtual ossimObject* dup() const;
+   
+   virtual void remapTile(const ossimDpt& origin_point,
+                          ossimGridRemapSource* remapper,
+                          ossimRefPtr<ossimImageData>& tile);
+
+   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources);
+
+   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
+                                   void* result);
+
+protected:
+   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
+                                 void*                 source_value,
+                                 void*                 target_value);
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimMultiBandHistogramTileSource.h b/include/ossim/imaging/ossimMultiBandHistogramTileSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimMultiBandHistogramTileSource.h
rename to include/ossim/imaging/ossimMultiBandHistogramTileSource.h
diff --git a/include/ossim/imaging/ossimNBandToIndexFilter.h b/include/ossim/imaging/ossimNBandToIndexFilter.h
new file mode 100644
index 0000000..0ec580d
--- /dev/null
+++ b/include/ossim/imaging/ossimNBandToIndexFilter.h
@@ -0,0 +1,129 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimNBandToIndexFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimNBandToIndexFilter_HEADER
+#define ossimNBandToIndexFilter_HEADER
+#include <ossim/base/ossimNBandLutDataObject.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+
+class ossimImageData;
+
+/*!
+ * It will map the input data to an 8-bit index table.  The table
+ * <pre>
+ *
+ * Example keyword list:
+ *
+ * type:  ossimNBandToIndexFilter
+ *
+ * If you want to load from a file then just do:
+ *
+ * lut.filename: <full path to lut file>
+ *
+ * If you have the lut table in line then it must look like this:
+ *
+ * lut.entry0:  204 102 1
+ * lut.entry1:  255 204 153
+ * lut.entry2:  51 204 204
+ * lut.number_of_entries:  3
+ * lut.type:  ossimNBandLutDataObject
+ *
+ * </pre>
+ */
+class OSSIM_DLL ossimNBandToIndexFilter : public ossimImageSourceFilter
+{
+public:
+   /*!
+    * Initializes the min value to 0 and the max value to 4000.
+    */
+   ossimNBandToIndexFilter();
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   
+   void setLut(ossimNBandLutDataObject& lut);
+
+   void setLut(const ossimFilename& file);
+
+   virtual bool isSourceEnabled()const;
+   virtual void disableSource();
+   
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   
+   virtual void initialize();
+
+   /*!
+    * Saves the state of this object.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   /*!
+    * Loads the state of this object.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /**
+    * Will set the property whose name matches the argument
+    * "property->getName()".
+    *
+    * @param property Object containing property to set.
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /**
+    * @param name Name of property to return.
+    * 
+    * @returns A pointer to a property object which matches "name".  Returns
+    * NULL if no match is found.
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+
+   /**
+    * Pushes this's names onto the list of property names.
+    *
+    * @param propertyNames array to add this's property names to.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+protected:
+   virtual ~ossimNBandToIndexFilter();
+   void allocate();
+
+   
+   virtual ossimRefPtr<ossimImageData> convertInputTile(ossimImageData* inputTile);
+
+   template <class T> ossimRefPtr<ossimImageData> convertOutputTileTemplate(T inputDummy,
+                                                                            ossimImageData* inputTile);
+   template <class T1, class T2> ossimRefPtr<ossimImageData> convertInputTileToOutputTemplate(T1 inputDummy,
+                                                                                              T2 outputDummy,
+                                                                                              ossimImageData* inputTile);
+   
+   ossimRefPtr<ossimNBandLutDataObject> theLut;
+   ossimRefPtr<ossimImageData>          theTile;
+   ossimFilename                        theLutFilename;
+   bool                                 theKeepQuantizedValueFlag;
+   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> theMinValues;
+   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> theMaxValues;
+   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> theNullValues;
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimNitf20Writer.h b/include/ossim/imaging/ossimNitf20Writer.h
new file mode 100644
index 0000000..c26ba01
--- /dev/null
+++ b/include/ossim/imaging/ossimNitf20Writer.h
@@ -0,0 +1,135 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimNitfWriter.h 9256 2006-07-14 15:28:19Z dburken $
+#ifndef ossimNitf20Writer_HEADER
+#define ossimNitf20Writer_HEADER
+
+#include <iosfwd>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimNitfWriterBase.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/base/ossimRgbLutDataObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
+
+class ossimProjection;
+
+class OSSIM_DLL ossimNitf20Writer : public ossimNitfWriterBase
+{
+public:
+   ossimNitf20Writer(const ossimFilename& filename=ossimFilename(""),
+                   ossimImageSource* inputSource = (ossimImageSource*)NULL);
+   virtual ~ossimNitf20Writer();
+   virtual bool isOpen()const;
+   virtual bool open();
+   virtual void close();
+   
+   /**
+    * void getImageTypeList(std::vector<ossimString>& imageTypeList)const
+    *
+    * Appends this writer image types to list "imageTypeList".
+    *
+    * This writer has the following types:
+    * nitf_block_band_separate
+    * nitf_block_band_sequential
+    *
+    * @param imageTypeList stl::vector<ossimString> list to append to.
+    */   
+   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+
+   /**
+    * @param propertyNames Array to populate with property names.
+    *
+    * @note The following names are handled:
+    *  file_header
+    *  image_header
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag);
+
+   /**
+    * Saves the state of the writer to kwl with prefix then calls
+    * base class ossimImageFileWriter::saveState
+    *
+    * @param kwl Keyword list to save to.
+    *
+    * @param prefix Usually something like: "object2."
+
+    * @return true on success, false on failure.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+
+   /**
+    * Initializes the state of the writer from kwl with prefix then calls
+    * base class ossimImageFileWriter::loadState
+    *
+    * @param kwl Keyword list to initialize from.
+    *
+    * @param prefix Usually something like: "object2."
+
+    * @return true on success, false on failure.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+protected:
+   
+   /**
+    * @return true on success false on error.
+    */
+   virtual bool writeFile();
+   
+   /**
+    * write out block band separate
+    * 
+    * @return true on success and false on error
+    */
+   virtual bool writeBlockBandSeparate();
+   
+   /**
+    * Outputs in band sequential format.  Band 1 is followed by band
+    * 2, ... etc.
+    */
+   virtual bool writeBlockBandSequential();
+
+   void addTags();
+
+   std::ofstream* theOutputStream;
+   
+   ossimRefPtr<ossimNitfFileHeaderV2_0>  theFileHeader;
+   ossimRefPtr<ossimNitfImageHeaderV2_0> theImageHeader;
+
+   /** If true user wants to set RPC00B tag. (DEFAULT = false) */
+   bool theEnableRpcbTagFlag;
+
+   /**
+    * If true user wants to set BLOCKA tag. (DEFAULT = true)
+    * Currently only valid for map projected images.
+    */
+   bool theEnableBlockaTagFlag;
+
+   /**
+    *
+    * If true this will enable searching the input connnection for another NITF handler and 
+    * bring the fields to this writers output fields and will maintin as many field values as possible
+    *
+    */
+   bool theCopyFieldsFlag;
+   
+TYPE_DATA   
+};
+
+#endif /* #ifndef ossimNitfWriter_HEADER */
diff --git a/include/ossim/imaging/ossimNitfTileSource.h b/include/ossim/imaging/ossimNitfTileSource.h
new file mode 100644
index 0000000..001f652
--- /dev/null
+++ b/include/ossim/imaging/ossimNitfTileSource.h
@@ -0,0 +1,553 @@
+//---
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for NitfTileSource.
+//
+//---
+// $Id$
+
+#ifndef ossimNitfTileSource_HEADER
+#define ossimNitfTileSource_HEADER 1
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/imaging/ossimAppFixedTileCache.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <memory>
+
+struct jpeg_decompress_struct;
+
+class OSSIM_DLL ossimNitfTileSource : public ossimImageHandler
+{
+public:
+
+   enum ReadMode
+   {
+      READ_MODE_UNKNOWN = 0,
+      
+      /** IMODE = B "Band Interleaved By Block or a single band" */
+      READ_BIB_BLOCK = 1,
+
+      /** IMODE = P "Band Interleaved By Pixel" */
+      READ_BIP_BLOCK = 2,
+
+      /** IMODE = R "Band Interleaved By Row" */
+      READ_BIR_BLOCK = 3,
+
+      /** IMODE = S "Band Sequential" */
+      READ_BSQ_BLOCK = 4,
+
+      /** IMODE = B of S "single block or one block for each band" */
+      READ_BIB       = 5,
+
+      /** IMODE = P "single block Band Interleaved By Pixel" */
+      READ_BIP       = 6,
+
+      /** IMODE = R "single block Band Interleaved By Row" */
+      READ_BIR       = 7,
+
+      /** IMODE = B, IC = C3 "JPEG compressed blocks" */
+      READ_JPEG_BLOCK = 8
+   };
+
+   ossimNitfTileSource();
+   
+   
+   virtual ossimString getShortName() const;
+   virtual ossimString getLongName()  const;
+
+   /**
+    *  Returns true if the image_file can be opened and is a valid nitf file.
+    */
+   virtual bool open();
+
+   /**
+    *  @brief This open takes a stream and stores/captures the shared pointer
+    *  on success.
+    *  @param str Open stream to image.
+    *  @param connectionString Stored on success as the file name.
+    *  @return true on success, false on error.
+    */
+   bool open( std::shared_ptr<ossim::istream>& str,
+              const std::string& connectionString );
+
+   /** @brief Closes file and destroys all memory allocated. */
+   virtual void close();
+
+   /**
+    * @param tileRect Requested rectangle.
+    *
+    * @param resLevel Reduced resolution level to grab tileRect from.
+    * Default = 0 or the full resolution data set.
+    *
+    * @return Returns an image data object with requested rectangle from the
+    * image.  Depending on the overlap of tileRect with respect to the image
+    * rectangle, the returned tile could be full, partial, or an empty(blank)
+    * tile.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+    /**
+     * @return Returns the number of bands in the image.
+     * Satisfies pure virtual from ImageHandler class.
+     */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+
+   /**
+    * @return Number of output bands.
+    */
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+
+   /**
+     *  Returns the number of lines in the image.
+     *  Satisfies pure virtual from ImageHandler class.
+     */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
+   
+   /**
+    *  Returns the number of samples in the image.  
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+   
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;   
+
+   virtual bool isOpen()const;
+
+   /**
+    * @return The current entry number.
+    *
+    * @note NITF's can contain multiple images in a single file.  This returns
+    * the index of the current image being read.
+    */
+   virtual ossim_uint32 getCurrentEntry() const;
+
+   /**
+    * @param entryList This is the list to initialize with entry indexes.
+    */
+   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
+
+   /**
+    * @return Returns the number of entries (or images) within the nitf
+    * file.
+    */
+   ossim_uint32 getNumberOfEntries() const;
+   
+   /**
+    * @param entryIdx Zero base entry number to select.  Sets data member
+    * "theCurrentEntry".
+    *
+    * @note "theCurrentEntry" will not be set if "entryIdx" is out of range.
+    */
+   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
+
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   ossimString getSecurityClassification()const;
+   
+   /**
+    * @return Returns theCacheEnabledFlag.
+    */
+   bool getCacheEnabledFlag() const;
+
+   /**
+    * @param flag Sets theCacheEnabledFlag and disables/enables caching
+    * accordingly.  If cache is disabled it is also flushed at the same time.
+    * If cache is enabled, blocks read from the image will be cached.
+    */
+   void setCacheEnabledFlag(bool flag);
+
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   const ossimNitfFileHeader* getFileHeader()const;
+   ossimNitfFileHeader* getFileHeader();
+   /**
+    * @return The image header for the current entry.
+    */
+   const ossimNitfImageHeader* getCurrentImageHeader() const;
+   ossimNitfImageHeader* getCurrentImageHeader();
+
+   /**
+    * @brief Convenience method to get the zero based rgb output band list.
+    *
+    * Attempts to derive RGB bands from nitf fields.
+    * 
+    * @param bandList Initialized by this.
+    * @return true on success, false if number of bands is less than 3 or if
+    * rgb bands could not be derived from nitf fields.
+    */
+   virtual bool getRgbBandList(std::vector<ossim_uint32>& bandList) const;
+
+protected:
+   virtual ~ossimNitfTileSource();
+
+   /**
+    * @param imageRect The full resolution image rectangle.
+    *
+    * @note Should contain offsets if there are any.
+    */
+   void setBoundingRectangle(const ossimIrect& imageRect);
+   
+   /** Copy constructor, disallow... */
+   ossimNitfTileSource(const ossimNitfTileSource& obj);
+
+   /** Operator=, disallow... */
+   ossimNitfTileSource& operator=(const ossimNitfTileSource& rhs); 
+
+   /**
+    *  Returns true on success, false on error.
+    */
+   bool loadTile(const ossimIrect& clipRect);
+
+   /**
+    * @return Returns the block number given an origin.
+    */
+   ossim_uint32 getBlockNumber(const ossimIpt& block_origin) const;
+
+   /**
+    * Deletes all memory allocated by this object.
+    */
+   void destroy();
+
+   /**
+    * @brief Parses "theImageFile" and initializes all nitf headers.
+    * @return true on success, false on error.
+    */
+   virtual bool parseFile();
+
+   /**
+    * @brief Allocates everything for current entry.
+    *
+    * This is called on an open() or a entry change to an already open nitf
+    * file.
+    *
+    * This does not allocate buffers and tiles to keep open and
+    * setCurrentEntry times to a minimum.  Buffers are allocated on first
+    * grab of pixel data by allocatBuffers method.
+    * 
+    * @return True on success, false on error.
+    */
+   virtual bool allocate();
+
+   /**
+    * @brief Allocates buffers for current entry.
+    *
+    * This is called on first getTile().
+    * 
+    * @return True on success, false on error.
+    */
+   virtual bool allocateBuffers();
+
+   /**
+    * @param hdr Pointer to image header.
+    * @return true if reader can uncompress nitf.
+    * */
+   virtual bool canUncompress(const ossimNitfImageHeader* hdr) const;
+
+   /**
+    * Initializes the data member "theScalarType" from the current entry.
+    */
+   virtual void initializeScalarType();
+
+   /**
+    * Initializes the data member "theSwapBytesFlag" from the current entry.
+    */
+   virtual void initializeSwapBytesFlag();
+   
+   /**
+    * Initializes the data member "theReadMode" from the current entry.
+    */
+   virtual void initializeReadMode();
+
+   /**
+    * Initializes the data member "theNumberOfBands" from the current entry.
+    */
+   void initializeBandCount();
+
+   /**
+    * Initializes the data member "theBlockSize" from the current entry.
+    *
+    * @note This should be performed after setting the read mode and
+    * band count.
+    *
+    * @note This is the size of a single block read.  So if the bands are
+    * separated by block, a read of this size will get one block.
+    *
+    * @return true on success, false on error.
+    */
+   bool initializeBlockSize();
+
+   /**
+    * Initializes the data members "theImageRect" and "theBlockRect"
+    * from the current entry.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool initializeImageRect();
+
+   /**
+    * Initializes the data member "theCacheSize".
+    */
+   void initializeCacheSize();
+
+   /**
+    * Initializes the data member "theCacheTileInterLeaveType".
+    */
+   virtual void initializeCacheTileInterLeaveType();
+   
+   /**
+    * Initializes the cache tile size(width and height).  For block images
+    * this will be the size of one block.  For images that are a single block,
+    * this will be the image width by the height of one tile.
+    */
+   void initializeCacheTile();
+
+   /**
+    * Initializes the data member theCompressedBuf.
+    */
+   virtual void initializeCompressedBuf();
+
+   /**
+    * Initializes the output tile size(width and height).
+    */
+   virtual void initializeOutputTile();
+
+   /**
+    * @brief Initializes "theLut" if applicable.
+    */
+   void initializeLut();
+
+   /**
+    * Loads a block of data to theCacheTile.
+    * 
+    * @param x Starting x position of block to load.
+    *
+    * @param y Starting y position of block to load.
+    *
+    * @return true on success, false on error.
+    *
+    * @note x and y are zero based relative to the upper left corner so any
+    * sub image offset should be subtracted off.
+    */
+   bool loadBlockFromCache(ossim_uint32 x, ossim_uint32 y,
+                           const ossimIrect& clipRect);
+
+   /**
+    * Loads a block of data to theCacheTile.
+    * 
+    * @param x Starting x position of block to load.
+    *
+    * @param y Starting y position of block to load.
+    *
+    * @return true on success, false on error.
+    *
+    * @note x and y are zero based relative to the upper left corner so any
+    * sub image offset should be subtracted off.
+    */
+   virtual bool loadBlock(ossim_uint32 x, ossim_uint32 y);
+
+   /**
+    * @param x Horizontal upper left pixel position of the requested block.
+    *
+    * @param y Vertical upper left pixel position of the requested block.
+    *
+    * @param band Band of block.  Only relative with IMODES that have bands
+    * in separate blocks.
+    *
+    * @return true if the stream offset was settable and false otherwise.
+    */
+   bool getPosition(std::streamoff& position,
+                    ossim_uint32 x,
+                    ossim_uint32 y,
+                    ossim_uint32 band) const;
+
+   /**
+    * @return the total number of blocks for the current entry.
+    *
+    * @note For band separated blocks, all bands will be counted as on block.
+    */
+   ossim_uint32 getNumberOfBlocks() const;
+
+   /**
+    * @return The number of bytes to get from one block band to the next band.
+    */
+   std::streampos getBandOffset() const;
+
+   /**
+    * @return The number of bytes to get from one block to the next block.
+    */
+   std::streampos getBlockOffset() const;
+   
+
+   void explodePackedBits(ossimRefPtr<ossimImageData> packedBuffer)const;
+
+   void convertTransparentToNull(ossimRefPtr<ossimImageData> tile)const;
+   
+   ossim_uint32 getPartialReadSize(const ossimIpt& blockOrigin)const;
+   bool isVqCompressed(const ossimString& compressionCode)const;
+
+   /**
+    * @brief Uncompresses Vector Quantization unmasked image data.
+    * IC field = C4
+    * @param destination tile to stuff.
+    * @param source Pointer to compressed data.
+    */
+   void vqUncompressC4(ossimRefPtr<ossimImageData> destination,
+                       ossim_uint8* source);
+   
+   /**
+    * @brief Uncompresses Vector Quantization masked image data.
+    * IC field = M4
+    * @param destination tile to stuff.
+    * @param source Pointer to compressed data.
+    */
+   void vqUncompressM4(ossimRefPtr<ossimImageData> destination,
+                       ossim_uint8* source);
+
+   void lutUncompress(ossimRefPtr<ossimImageData> destination,
+                     ossim_uint8* source);
+
+   /**
+    * @brief scans the file storing in offsets in "theNitfBlockOffset" and
+    * block sizes in "theNitfBlockSize".
+    * @return true on success, false on error.  This checks for arrays being
+    * the same size as number of blocks.
+    */
+   virtual bool scanForJpegBlockOffsets();
+
+   /**
+    * @brief Uncompresses a jpeg block using the jpeg-6b library.
+    * This method does eight bit jpeg compressed blocks. Note there is
+    * specialized jpeg12 plugin for 12 bit.
+    * @param x sample location in image space.
+    * @param y line location in image space.
+    * @return true on success, false on error.
+    */
+   virtual bool uncompressJpegBlock(ossim_uint32 x, ossim_uint32 y);
+
+   /**
+    * @brief Loads one of the default tables based on COMRAT value.
+    *
+    * @return true if comrat had valid table value(1-5) and table was loaded,
+    * false if COMRAT value did not contain a valid value.  Will also return
+    * false if there is already a table loaded.
+    * 
+    * @note COMRAT is nitf compression rate code field:
+    * -  "00.2" == default compression table 2
+    * -  "00.5" == default compression table 5 and so on.
+    */
+   bool loadJpegQuantizationTables(jpeg_decompress_struct& cinfo) const;
+
+   /**
+    * @brief Loads default huffman tables.
+    *
+    * @return true success, false on error.
+    */
+   bool loadJpegHuffmanTables(jpeg_decompress_struct& cinfo) const;
+   
+   /**
+   * @brief Virtual method determines the decimation factors at each resolution level. 
+   * This method derives the decimations from the image metadata.
+   */
+   virtual void establishDecimationFactors();
+
+   ossimRefPtr<ossimImageData>   theTile;
+   ossimRefPtr<ossimImageData>   theCacheTile;
+   ossimRefPtr<ossimNitfFile>    theNitfFile;
+   std::vector<ossimRefPtr<ossimNitfImageHeader> > theNitfImageHeader;
+   ReadMode                      theReadMode;
+   ossimScalarType               theScalarType;
+   bool                          theSwapBytesFlag;
+   ossim_uint32                  theNumberOfInputBands;
+   ossim_uint32                  theNumberOfOutputBands;
+   ossim_uint32                  theBlockSizeInBytes;
+   ossim_uint32                  theReadBlockSizeInBytes;
+   ossim_uint32                  theNumberOfImages;
+   ossim_uint32                  theCurrentEntry;
+   ossimIrect                    theImageRect;
+   std::shared_ptr<ossim::istream> theFileStr;
+   std::vector<ossim_uint32>     theSelectorBandList;
+   std::vector<ossim_uint32>     theOutputBandList;
+   ossimIpt                      theCacheSize;
+   ossimInterleaveType           theCacheTileInterLeaveType;
+   bool                          theCacheEnabledFlag;
+   std::vector<ossim_uint32>     theEntryList;
+   ossimAppFixedTileCache::ossimAppFixedCacheId theCacheId;
+   bool                          thePackedBitsFlag;
+   ossimIrect                    theBlockImageRect;
+   std::vector<ossim_uint8>      theCompressedBuf;
+
+   //---
+   // Have compressed jpeg blocks of variable length so we must scan and
+   // capture the offsetts and block sizes for reading.
+   //---
+   std::vector<std::streamoff>   theNitfBlockOffset;
+   std::vector<ossim_uint32>     theNitfBlockSize;
+   
+   //---
+   // If set to true indicates scanForJpegBlockOffsets() needs to be called
+   // prior to grabbing a block.
+   //---
+   bool m_jpegOffsetsDirty;
+   
+TYPE_DATA
+};
+   
+#endif /* #ifndef ossimNitfTileSource_HEADER */
diff --git a/include/ossim/imaging/ossimNitfWriter.h b/include/ossim/imaging/ossimNitfWriter.h
new file mode 100644
index 0000000..d5b3523
--- /dev/null
+++ b/include/ossim/imaging/ossimNitfWriter.h
@@ -0,0 +1,174 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id$
+
+#ifndef ossimNitfWriter_HEADER
+#define ossimNitfWriter_HEADER 1
+
+#include <ossim/imaging/ossimNitfWriterBase.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRgbLutDataObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfTextHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfTextHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h>
+#include <iosfwd>
+#include <memory>
+
+class ossimProjection;
+
+class OSSIM_DLL ossimNitfWriter : public ossimNitfWriterBase
+{
+public:
+   ossimNitfWriter(const ossimFilename& filename=ossimFilename(""),
+                   ossimImageSource* inputSource = (ossimImageSource*)NULL);
+   virtual ~ossimNitfWriter();
+   virtual bool isOpen()const;
+   virtual bool open();
+   virtual void close();
+   
+   /**
+    * void getImageTypeList(std::vector<ossimString>& imageTypeList)const
+    *
+    * Appends this writer image types to list "imageTypeList".
+    *
+    * This writer has the following types:
+    * nitf_block_band_separate
+    * nitf_block_band_sequential
+    *
+    * @param imageTypeList stl::vector<ossimString> list to append to.
+    */   
+   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+
+   /**
+    * @param propertyNames Array to populate with property names.
+    *
+    * @note The following names are handled:
+    *  file_header
+    *  image_header
+    *  des_header
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag, bool unique = true);
+   void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag, bool unique,
+      const ossim_uint32& ownerIndex, const ossimString& tagType);
+
+   /**
+    * Saves the state of the writer to kwl with prefix then calls
+    * base class ossimImageFileWriter::saveState
+    *
+    * @param kwl Keyword list to save to.
+    *
+    * @param prefix Usually something like: "object2."
+
+    * @return true on success, false on failure.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+
+   /**
+    * Initializes the state of the writer from kwl with prefix then calls
+    * base class ossimImageFileWriter::loadState
+    *
+    * @param kwl Keyword list to initialize from.
+    *
+    * @param prefix Usually something like: "object2."
+
+    * @return true on success, false on failure.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   virtual bool addTextToNitf(std::string& inputText);
+
+   /** @brief Gets the block size. */
+   virtual void getTileSize(ossimIpt& size) const;
+
+   /**
+    * Sets the nitf output block size.  Must be divisible by 16.
+    *
+    * Note:  This is not called setBlockSize just because there was already
+    * a virtual setTileSize.
+    *
+    * @param tileSize Block size.
+    */
+   virtual void setTileSize(const ossimIpt& tileSize);
+
+   /**
+    * Get the image header used for export.
+    *
+    * @warning Many values will be overwritten at export time.  This includes the 
+    *          ossimNitfImageBandV2_1, if the number of bands on the image header
+    *          does not match that on the writer.
+    *
+    * @return The image header.
+    */
+   virtual ossimNitfImageHeaderV2_1 *getImageHeader();
+
+   /**
+    * Get the file header used for export.
+    *
+    * @warning Many values will be overwritten at export time.
+    *
+    * @return The file header.
+    */
+   virtual ossimNitfFileHeaderV2_1 *getFileHeader();
+
+   /**
+    * Add a DES to the file.
+    *
+    * @param des The DES to add to the file.
+    */
+   virtual void addDataExtensionSegment(const ossimNitfDataExtensionSegmentV2_1& des, bool allowTreOverflow);
+protected:
+   
+   /**
+    * @return true on success false on error.
+    */
+   virtual bool writeFile();
+   
+   /**
+    * write out block band separate
+    * 
+    * @return true on success and false on error
+    */
+   virtual bool writeBlockBandSeparate();
+   
+   /**
+    * Outputs in band sequential format.  Band 1 is followed by band
+    * 2, ... etc.
+    */
+   virtual bool writeBlockBandSequential();
+
+   /** Currently disabled... */
+   // virtual void addStandardTags();
+
+   std::shared_ptr<ossim::ofstream>      m_str;
+   ossimRefPtr<ossimNitfFileHeaderV2_1>  m_fileHeader;
+   ossimRefPtr<ossimNitfImageHeaderV2_1> m_imageHeader;
+   std::vector<ossimNitfDataExtensionSegmentV2_1> m_dataExtensionSegments;
+   ossimRefPtr<ossimNitfTextHeaderV2_1>  m_textHeader;
+   std::string                           m_textEntry;
+   ossimIpt                              m_blockSize;
+
+TYPE_DATA 
+private:
+   void takeOverflowTags(bool useFileHeader, bool userDefinedTags);
+
+};
+
+#endif /* #ifndef ossimNitfWriter_HEADER */
diff --git a/include/ossim/imaging/ossimNitfWriterBase.h b/include/ossim/imaging/ossimNitfWriterBase.h
new file mode 100644
index 0000000..ea17167
--- /dev/null
+++ b/include/ossim/imaging/ossimNitfWriterBase.h
@@ -0,0 +1,195 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: OSSIM nitf writer base class to hold methods common to
+// all nitf writers.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfWriterBase.h 2981 2011-10-10 21:14:02Z david.burken $
+#ifndef ossimNitfWriterBase_HEADER
+#define ossimNitfWriterBase_HEADER
+
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
+
+class ossimFilename;
+class ossimImageSourceSequencer;
+class ossimMapProjectionInfo;
+class ossimNitfFileHeaderV2_X;
+class ossimNitfImageHeaderV2_X;
+class ossimProjection;
+
+/**
+ * @brief OSSIM nitf writer base class to hold methods common to
+ * all nitf writers.
+ */
+class OSSIM_DLL ossimNitfWriterBase : public ossimImageFileWriter
+{
+public:
+
+   /** @brief default constructor */
+   ossimNitfWriterBase();
+
+   /**
+    * @brief Constructor that takes filename and input source.
+    * @param filename The output file name.
+    * @param inputSource The input source to write to file.
+    */
+   ossimNitfWriterBase(const ossimFilename& filename,
+                       ossimImageSource* inputSource);
+
+   /* @brief virtual destructor */
+   virtual ~ossimNitfWriterBase();
+
+   /**
+    * @brief Set the properties.
+    * @param property The property to set.
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /**
+    * @brief Gets a property.
+    * @param The name of the property to get.
+    * @return The property if found.
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+
+   /**
+    * @param propertyNames Array to populate with property names.
+    *
+    * @note The following names are handled:
+    *  enable_rpcb_tag
+    *  enable_blocka_tag
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+ 
+
+   /**
+    * Saves the state of the writer to kwl with prefix then calls
+    * base class ossimImageFileWriter::saveState
+    *
+    * @param kwl Keyword list to save to.
+    *
+    * @param prefix Usually something like: "object2."
+
+    * @return true on success, false on failure.
+    *
+    * Keywords saved by saveState:
+    * 
+    * enable_rpcb_tag: true
+    *
+    * enable_blocka_tag: true
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+
+   /**
+    * Initializes the state of the writer from kwl with prefix then calls
+    * base class ossimImageFileWriter::loadState
+    *
+    * @param kwl Keyword list to initialize from.
+    *
+    * @param prefix Usually something like: "object2."
+
+    * @return true on success, false on failure.
+    *
+    * Keywords picked up by loadState:
+    * 
+    * enable_rpcb_tag: true
+    *
+    * enable_blocka_tag: true
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /**
+    * Returns a 3-letter extension from the image type descriptor 
+    * (theOutputImageType) that can be used for image file extensions.
+    *
+    * @param imageType string representing image type.
+    *
+    * @return the 3-letter string extension.
+    */
+   virtual ossimString getExtension() const;
+
+   virtual void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag);
+   virtual void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag, bool unique);
+   virtual void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag, bool unique, const ossim_uint32& ownerIndex, const ossimString& tagType);
+
+   virtual void setFileHeaderV2_1(ossimRefPtr<ossimNitfFileHeaderV2_1>, bool preferSource=false);
+   virtual void setImageHeaderV2_1(ossimRefPtr<ossimNitfImageHeaderV2_1>, bool preferSource=false);
+
+protected:
+
+   /**
+    * @brief Populates tags with geometry info from projection.  Will write an
+    * rpcb tag if theEnableRpcbTagFlag if set to true.
+    * @param hdr The header to write to.
+    * @param seq The input connection or image source.
+    */
+   void writeGeometry(ossimNitfImageHeaderV2_X* hdr,
+                      ossimImageSourceSequencer* seq);
+
+   /**
+    * @brief Adds the BLOCKA tag.
+    *
+    * @param mapInfo ossimMapProjectionInfo to use to set tag with.
+    * @param hdr The header to write to.
+    *
+    * @note Currently only used with map projected images.
+    */
+   void addBlockaTag(ossimMapProjectionInfo& mapInfo,
+                     ossimNitfImageHeaderV2_X* hdr);
+
+   /**
+    * @brief Adds the RPC00B tag.
+    *
+    * @param rect Requested rectangle of image to write.
+    *
+    * @param proj The output projection.
+    */
+   void addRpcbTag(const ossimIrect& rect,
+                   ossimProjection* proj,
+                   ossimNitfImageHeaderV2_X* hdr);
+
+   /**
+    * @brief Sets the complexity level of theFileHeader.
+    *
+    * @param endPosition This should be the end seek position of the file.
+    */
+   void setComplexityLevel(std::streamoff,
+                           ossimNitfFileHeaderV2_X* hdr);
+
+   void setComplexityLevel(ossimNitfFileHeaderV2_X* hdr, ossim_uint64 width=0, ossim_uint64 height=0);
+
+   /**
+    * @brief Sets file header and image header defaults from config file if
+    * found in preferences.
+    */
+   virtual void initializeDefaultsFromConfigFile(
+      ossimNitfFileHeaderV2_X* fileHdr,
+      ossimNitfImageHeaderV2_X* imgHdr );   
+
+   /** @brief If true user wants to set RPC00B tag. (DEFAULT = false) */
+   bool theEnableRpcbTagFlag;
+   
+   /**
+    * @brief If true user wants to set BLOCKA tag. (DEFAULT = true)
+    * Currently only valid for map projected images.
+    */
+   bool theEnableBlockaTagFlag;
+
+   
+
+private:
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimKakaduNitfVoid Writer_HEADER */
diff --git a/include/ossim/imaging/ossimNormalizedRemapTable.h b/include/ossim/imaging/ossimNormalizedRemapTable.h
new file mode 100644
index 0000000..88b6e6d
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedRemapTable.h
@@ -0,0 +1,84 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for base class ossimNormalizedRemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedRemapTable.h 15742 2009-10-17 12:59:43Z dburken $
+
+
+#ifndef ossimNormalizedRemapTable_HEADER
+#define ossimNormalizedRemapTable_HEADER
+
+#include <ossim/base/ossimConstants.h>
+
+/**
+ * @class ossimNormalizedRemapTable
+ *
+ * @brief Base class implemetation of normalized remap tables to go to/from
+ * normalized value to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedRemapTable
+{
+public:
+
+   /** default constructor */
+   ossimNormalizedRemapTable();
+
+   /** virtual destructor */
+   virtual ~ossimNormalizedRemapTable();
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const = 0;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const = 0;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const = 0;
+
+   /**
+    * @brief Pure virtual method to get the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const = 0;
+
+   /**
+    * @brief Get the value used to normalize and un-normalize table entries.
+    * @return Value used to normalize and un-normalize table entries.
+    */
+   virtual ossim_float64 getNormalizer() const;
+
+private:
+
+   // Forbid copy constructor and asignment operator.
+   ossimNormalizedRemapTable(const ossimNormalizedRemapTable& source);
+   ossimNormalizedRemapTable& operator=(const ossimNormalizedRemapTable&);  
+
+ };
+
+inline ossim_float64 ossimNormalizedRemapTable::getNormalizer() const
+{
+   return static_cast<ossim_float64>(getEntries()-1);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedS16RemapTable.h b/include/ossim/imaging/ossimNormalizedS16RemapTable.h
new file mode 100644
index 0000000..ce87f86
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedS16RemapTable.h
@@ -0,0 +1,146 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedS16RemapTable.  Table for
+// normalizing signed 16 bit data.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedS16RemapTable.h 10456 2007-02-08 14:17:50Z gpotts $
+
+#ifndef ossimNormalizedS16RemapTable_HEADER
+#define ossimNormalizedS16RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedS16RemapTable
+ *
+ * @brief Signed 16 bit normalized remap tables to go to/from
+ * normalized value to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedS16RemapTable : public ossimNormalizedRemapTable
+{
+public:
+   
+   /** @brief default constructor */
+   ossimNormalizedS16RemapTable();
+
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedS16RemapTable();
+
+   enum
+   {
+      TABLE_ENTRIES  = 65536,  // 2^16 32767-(-32768)+1
+      OFFSET_TO_ZERO = 32768,  // Gets -32768 to zero.
+      NULL_PIX       = -32768,
+      MIN_PIX        = -32767 
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+
+   /**
+    * @brief Gets normalized value (between '0.0' and '1.0') from an
+    * int which should in scalar range of a signed 16 bit.
+    *
+    * @note This table is specialized to map both -32768 and -32767 to 0 since
+    * dted data has a null of -32767.
+    * 
+    * @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    * @brief Gets normalized value (between '0.0' and '1.0') from an
+    * int which should in scalar range of a signed 16 bit.
+    *
+    * @note This table is specialized to map both -32768 and -32767 to 0 since
+    * dted data has a null of -32767.
+    *
+    * @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Gets pixel value from normalized value.
+    *
+    * Valid returns range is signed 16 bit range or -32768 to 32767.
+    *
+    * @return Value between -32768 to 32767.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;
+
+private:
+
+   static ossim_float64  theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+
+};
+
+inline ossim_int32 ossimNormalizedS16RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedS16RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   ossim_float64 result = 0;
+
+   // Move pix into table range.  This will take -32768 to 0.
+   ossim_int32 p = pix + OFFSET_TO_ZERO;
+
+   result = (p < TABLE_ENTRIES ? ( p >= 0 ? theTable[p] : 0.0) : 1.0);
+
+   return result;
+}
+
+inline ossim_float64 ossimNormalizedS16RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   ossim_float64 result = 0;
+
+   // Move pix into table range.  This will take -32768 to 0.
+   ossim_int32 p = pix + OFFSET_TO_ZERO;
+
+   result = (p < TABLE_ENTRIES ? ( p >= 0 ? theTable[p] : 0.0) : 1.0);
+
+   return result;
+}
+
+inline ossim_int32 ossimNormalizedS16RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return NULL_PIX;
+   
+   // Clamp between 0 and 1 on the way in.
+   ossim_float64 p = (normPix<1.0) ? ( (normPix>0.0) ? normPix : 0.0) : 1.0;
+
+   // Un-normalize.
+   p = p * getNormalizer(); // TABLE_ENTRIES - 1;
+
+   //---
+   // Move pixel into sign range then round it.  This will take  65535 to
+   // 32767 which is the max pixel for this scalar type.
+   //---
+   p = ossim::round<ossim_int32>(p - OFFSET_TO_ZERO);
+
+   if (p == NULL_PIX)
+   {
+      // norm pixel came in just above zero so should be at least min.
+      p = MIN_PIX; 
+   }
+
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedU11RemapTable.h b/include/ossim/imaging/ossimNormalizedU11RemapTable.h
new file mode 100644
index 0000000..e5a6ded
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedU11RemapTable.h
@@ -0,0 +1,117 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedU11RemapTable.  Table for
+// normalizing unsigned 11 bit data.
+//
+//*******************************************************************
+//  $Id: ossimNormalizedU11RemapTable.h 16034 2009-12-03 14:49:25Z dburken $
+
+#ifndef ossimNormalizedU11RemapTable_HEADER
+#define ossimNormalizedU11RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedU11RemapTable
+ *
+ * @brief Eleven bit normalized remap table to go to/from normalized value
+ * to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedU11RemapTable : public ossimNormalizedRemapTable
+{
+public:
+
+   /** @brief default constructor */
+   ossimNormalizedU11RemapTable();
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedU11RemapTable();
+
+
+   enum
+   {
+      TABLE_ENTRIES = 2048 //  2^11
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;   
+
+private:
+
+   static ossim_float64  theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+   
+};
+
+inline ossim_int32 ossimNormalizedU11RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedU11RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
+}
+
+inline ossim_float64 ossimNormalizedU11RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
+}
+
+inline ossim_int32 ossimNormalizedU11RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return 0;
+   
+   // un-normalize...
+   ossim_float64 p = normPix * getNormalizer();
+
+   // Ensure pixel is in range.
+   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
+
+   // Since going from double to int round...
+   p = ossim::round<ossim_int32>(p);
+
+   if(p == 0.0)
+   {
+      p = 1.0;
+   }
+   
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedU12RemapTable.h b/include/ossim/imaging/ossimNormalizedU12RemapTable.h
new file mode 100644
index 0000000..09946d0
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedU12RemapTable.h
@@ -0,0 +1,117 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedU12RemapTable.  Table for
+// normalizing unsigned 11 bit data.
+//
+//*******************************************************************
+//  $Id: ossimNormalizedU12RemapTable.h 16034 2009-12-03 14:49:25Z dburken $
+
+#ifndef ossimNormalizedU12RemapTable_HEADER
+#define ossimNormalizedU12RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedU12RemapTable
+ *
+ * @brief Twelve bit normalized remap table to go to/from normalized value
+ * to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedU12RemapTable : public ossimNormalizedRemapTable
+{
+public:
+
+   /** @brief default constructor */
+   ossimNormalizedU12RemapTable();
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedU12RemapTable();
+
+
+   enum
+   {
+      TABLE_ENTRIES = 4096 //  2^12
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;   
+
+private:
+
+   static ossim_float64  theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+   
+};
+
+inline ossim_int32 ossimNormalizedU12RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedU12RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
+}
+
+inline ossim_float64 ossimNormalizedU12RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
+}
+
+inline ossim_int32 ossimNormalizedU12RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return 0;
+   
+   // un-normalize...
+   ossim_float64 p = normPix * getNormalizer();
+
+   // Ensure pixel is in range.
+   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
+
+   // Since going from double to int round...
+   p = ossim::round<ossim_int32>(p);
+
+   if(p == 0.0)
+   {
+      p = 1.0;
+   }
+   
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedU13RemapTable.h b/include/ossim/imaging/ossimNormalizedU13RemapTable.h
new file mode 100644
index 0000000..b220762
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedU13RemapTable.h
@@ -0,0 +1,117 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedU13RemapTable.  Table for
+// normalizing unsigned 11 bit data.
+//
+//*******************************************************************
+//  $Id: ossimNormalizedU13RemapTable.h 16034 2009-12-03 14:49:25Z dburken $
+
+#ifndef ossimNormalizedU13RemapTable_HEADER
+#define ossimNormalizedU13RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedU13RemapTable
+ *
+ * @brief Thirteen bit normalized remap table to go to/from normalized value
+ * to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedU13RemapTable : public ossimNormalizedRemapTable
+{
+public:
+
+   /** @brief default constructor */
+   ossimNormalizedU13RemapTable();
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedU13RemapTable();
+
+
+   enum
+   {
+      TABLE_ENTRIES = 8192 //  2^13
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;   
+
+private:
+
+   static ossim_float64  theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+   
+};
+
+inline ossim_int32 ossimNormalizedU13RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedU13RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
+}
+
+inline ossim_float64 ossimNormalizedU13RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
+}
+
+inline ossim_int32 ossimNormalizedU13RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return 0;
+   
+   // un-normalize...
+   ossim_float64 p = normPix * getNormalizer();
+
+   // Ensure pixel is in range.
+   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
+
+   // Since going from double to int round...
+   p = ossim::round<ossim_int32>(p);
+
+   if(p == 0.0)
+   {
+      p = 1.0;
+   }
+   
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedU14RemapTable.h b/include/ossim/imaging/ossimNormalizedU14RemapTable.h
new file mode 100644
index 0000000..b2b4e12
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedU14RemapTable.h
@@ -0,0 +1,117 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedU14RemapTable.  Table for
+// normalizing unsigned 11 bit data.
+//
+//*******************************************************************
+//  $Id: ossimNormalizedU14RemapTable.h 16034 2009-12-03 14:49:25Z dburken $
+
+#ifndef ossimNormalizedU14RemapTable_HEADER
+#define ossimNormalizedU14RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedU14RemapTable
+ *
+ * @brief Fourteen bit normalized remap table to go to/from normalized value
+ * to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedU14RemapTable : public ossimNormalizedRemapTable
+{
+public:
+
+   /** @brief default constructor */
+   ossimNormalizedU14RemapTable();
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedU14RemapTable();
+
+
+   enum
+   {
+      TABLE_ENTRIES = 16384 //  2^14
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;   
+
+private:
+
+   static ossim_float64  theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+   
+};
+
+inline ossim_int32 ossimNormalizedU14RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedU14RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
+}
+
+inline ossim_float64 ossimNormalizedU14RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
+}
+
+inline ossim_int32 ossimNormalizedU14RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return 0;
+   
+   // un-normalize...
+   ossim_float64 p = normPix * getNormalizer();
+
+   // Ensure pixel is in range.
+   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
+
+   // Since going from double to int round...
+   p = ossim::round<ossim_int32>(p);
+
+   if(p == 0.0)
+   {
+      p = 1.0;
+   }
+   
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedU15RemapTable.h b/include/ossim/imaging/ossimNormalizedU15RemapTable.h
new file mode 100644
index 0000000..0952495
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedU15RemapTable.h
@@ -0,0 +1,117 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedU15RemapTable.  Table for
+// normalizing unsigned 11 bit data.
+//
+//*******************************************************************
+//  $Id: ossimNormalizedU15RemapTable.h 16034 2009-12-03 14:49:25Z dburken $
+
+#ifndef ossimNormalizedU15RemapTable_HEADER
+#define ossimNormalizedU15RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedU15RemapTable
+ *
+ * @brief Fifteen bit normalized remap table to go to/from normalized value
+ * to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedU15RemapTable : public ossimNormalizedRemapTable
+{
+public:
+
+   /** @brief default constructor */
+   ossimNormalizedU15RemapTable();
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedU15RemapTable();
+
+
+   enum
+   {
+      TABLE_ENTRIES = 32768 //  2^15
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;   
+
+private:
+
+   static ossim_float64  theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+   
+};
+
+inline ossim_int32 ossimNormalizedU15RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedU15RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
+}
+
+inline ossim_float64 ossimNormalizedU15RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
+}
+
+inline ossim_int32 ossimNormalizedU15RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return 0;
+   
+   // un-normalize...
+   ossim_float64 p = normPix * getNormalizer();
+
+   // Ensure pixel is in range.
+   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
+
+   // Since going from double to int round...
+   p = ossim::round<ossim_int32>(p);
+
+   if(p == 0.0)
+   {
+      p = 1.0;
+   }
+   
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedU16RemapTable.h b/include/ossim/imaging/ossimNormalizedU16RemapTable.h
new file mode 100644
index 0000000..5435a66
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedU16RemapTable.h
@@ -0,0 +1,116 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedU16RemapTable.  Table for
+// normalizing unsigned 16 bit data.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU16RemapTable.h 16034 2009-12-03 14:49:25Z dburken $
+
+#ifndef ossimNormalizedU16RemapTable_HEADER
+#define ossimNormalizedU16RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedU16RemapTable
+ *
+ * @brief Unsigned 16 bit normalized remap table to go to/from normalized value
+ * to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedU16RemapTable : public ossimNormalizedRemapTable
+{
+public:
+
+   /** @brief default constructor */
+   ossimNormalizedU16RemapTable();
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedU16RemapTable();
+
+   enum
+   {
+      TABLE_ENTRIES   = 65536 // 2^16
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+   
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;
+   
+protected:
+
+   static ossim_float64  theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+   
+};
+
+inline ossim_int32 ossimNormalizedU16RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedU16RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
+}
+
+inline ossim_float64 ossimNormalizedU16RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
+}
+
+inline ossim_int32 ossimNormalizedU16RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return 0;
+   
+   // un-normalize...
+   ossim_float64 p = normPix * getNormalizer();
+
+   // Ensure pixel is in range.
+   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
+
+   // Since going from double to int round...
+   p = ossim::round<ossim_int32>(p);
+       
+   if(p == 0.0)
+   {
+      p = 1.0;
+   }
+   
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimNormalizedU8RemapTable.h b/include/ossim/imaging/ossimNormalizedU8RemapTable.h
new file mode 100644
index 0000000..050b1cf
--- /dev/null
+++ b/include/ossim/imaging/ossimNormalizedU8RemapTable.h
@@ -0,0 +1,116 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class declaration for  ossimNormalizedU8RemapTable.  Table for
+// normalizing unsigned 8 bit data.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU8RemapTable.h 16034 2009-12-03 14:49:25Z dburken $
+
+#ifndef ossimNormalizedU8RemapTable_HEADER
+#define ossimNormalizedU8RemapTable_HEADER
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+#include <ossim/base/ossimCommon.h> /* for round */
+
+/**
+ * @class ossimNormalizedU8RemapTable
+ *
+ * @brief Eight bit normalized remap table to go to/from normalized value
+ * to pixel value.
+ */
+class OSSIM_DLL ossimNormalizedU8RemapTable : public ossimNormalizedRemapTable
+{
+public:
+
+   /** @brief default constructor */
+   ossimNormalizedU8RemapTable();
+   /** @brief virtual destructor */
+   virtual ~ossimNormalizedU8RemapTable();
+
+ 
+   enum
+   {
+      TABLE_ENTRIES = 256 // 2^8
+   };
+
+   /**
+    * @brief Gets the number of table entries.
+    * @return The number of entries in a table.
+    */
+   virtual ossim_int32 getEntries() const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 operator[](ossim_int32 pix) const;
+
+   /**
+    *  @brief Gets a normalized value (between '0.0' and '1.0') from
+    *  a pixel value.
+    *
+    *  @return Value between 0.0 and 1.0.
+    */
+   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
+
+   /**
+    * @brief Returns an pixel value as an int from a normalized value.
+    *
+    * @return Value between scalar range of remap table.
+    */
+   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;
+
+protected:
+
+   static ossim_float64 theTable[TABLE_ENTRIES];
+   static bool theTableIsInitialized;
+
+};
+
+inline ossim_int32 ossimNormalizedU8RemapTable::getEntries() const
+{
+   return TABLE_ENTRIES;
+}
+
+inline ossim_float64 ossimNormalizedU8RemapTable::operator[](
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
+}
+
+inline ossim_float64 ossimNormalizedU8RemapTable::normFromPix(
+   ossim_int32 pix) const
+{
+   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
+}
+
+inline ossim_int32 ossimNormalizedU8RemapTable::pixFromNorm(
+   ossim_float64 normPix) const
+{
+   if(normPix <= 0.0) return 0;
+   
+   ossim_float64 p = normPix * getNormalizer();
+
+   // Ensure pixel is in range.
+   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
+
+   // Since going from double to int round...
+   p = ossim::round<ossim_int32>(p);
+       
+   if(p == 0.0)
+   {
+      p = 1;
+   }
+   
+   return static_cast<ossim_int32>(p);
+}
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimNullPixelFlip.h b/include/ossim/imaging/ossimNullPixelFlip.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimNullPixelFlip.h
rename to include/ossim/imaging/ossimNullPixelFlip.h
diff --git a/include/ossim/imaging/ossimOrthoImageMosaic.h b/include/ossim/imaging/ossimOrthoImageMosaic.h
new file mode 100644
index 0000000..be01411
--- /dev/null
+++ b/include/ossim/imaging/ossimOrthoImageMosaic.h
@@ -0,0 +1,61 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimOrthoImageMosaic.h 17932 2010-08-19 20:34:35Z dburken $
+#ifndef ossimOrthoImageMosaic_HEADER
+#define ossimOrthoImageMosaic_HEADER
+
+#include <ossim/imaging/ossimImageMosaic.h>
+
+class OSSIMDLLEXPORT ossimOrthoImageMosaic : public ossimImageMosaic
+{
+public:
+   ossimOrthoImageMosaic();
+   ossimOrthoImageMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
+   virtual void initialize();
+
+   //! Returns the geometry associated with the full mosaic. This object maintains it's own 
+   //! geometry instance.
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   //! Used to retrieve the number of overlapping images withint the given rect.
+   virtual ossim_uint32 getNumberOfOverlappingImages(const ossimIrect& rect, ossim_uint32 resLevel=0)const;
+
+   //! Used to populate the result with the index of the overlapping images.
+   virtual void getOverlappingImages(std::vector<ossim_uint32>& result,
+                                     const ossimIrect& rect,
+                                     ossim_uint32 resLevel=0)const;
+   
+   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32& returnedIdx,
+                                                   const ossimIrect& origin,
+                                                   ossim_uint32 resLevel=0);
+   
+   ossimIrect getRelativeRect(ossim_uint32 index,
+                              ossim_uint32 resLevel = 0)const;
+protected:
+   virtual ~ossimOrthoImageMosaic();   
+   void computeBoundingRect(ossim_uint32 resLevel=0);
+   
+   //! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
+   //! each time the contents of the mosaic changes.
+   void updateGeometry();
+
+   std::vector<ossimDpt>  m_InputTiePoints;
+   ossimDpt    m_Delta; //!< Holds R0 delta and will be scaled for different r-level requests
+   ossimDpt    m_UpperLeftTie; //!< Will hold the upper left tie of the mosaic.
+   ossimIrect  m_BoundingRect;
+   ossimString m_Units;
+   ossimRefPtr<ossimImageGeometry> m_Geometry; //!< The input image geometry, altered by the map tiepoint
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimOverviewBuilderBase.h b/include/ossim/imaging/ossimOverviewBuilderBase.h
new file mode 100644
index 0000000..8731981
--- /dev/null
+++ b/include/ossim/imaging/ossimOverviewBuilderBase.h
@@ -0,0 +1,240 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  Base class for overview builders.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimOverviewBuilderBase.h 21653 2012-09-07 15:03:08Z dburken $
+#ifndef ossimOverviewBuilderBase_HEADER
+#define ossimOverviewBuilderBase_HEADER 1
+
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimBitMaskWriter.h>
+#include <ossim/imaging/ossimMaskFilter.h>
+#include <vector>
+
+class ossimImageFileWriter;
+class ossimFilename;
+
+class OSSIM_DLL ossimOverviewBuilderBase
+   :
+      public ossimSource,
+      public ossimProcessInterface,
+      public ossimConnectableObjectListener
+{
+public:
+
+   /** default constructor */
+   ossimOverviewBuilderBase();
+
+   /**
+    * @brief Sets an optional file writer to the builder.
+    * Currently used by the virtual overview builder.
+    * 
+    * @param outputWriter The file writer of the builder.
+    * 
+    * @return True on successful initialization, false on error.
+    */
+   virtual bool setOutputWriter(ossimImageFileWriter* outputWriter);
+
+   /**
+    * @brief Sets the input to the builder.
+    * 
+    * @param imageSource The input to the builder.
+    * 
+    * @return True on successful initialization, false on error.
+    */
+   virtual bool setInputSource(ossimImageHandler* imageSource);
+
+   /**
+    * @brief Sets the output file name. (pure virtual)
+    * @prama file This will be the output file name like foo.ovr
+    */
+   virtual void setOutputFile(const ossimFilename& file)=0;
+
+   /**
+    * @brief Gets the output file name. (pure virtual)
+    *
+    * @return The output file name or ossimFilename::NIL if it was not set
+    * yet and the image handle has not been initialized.
+    *
+    * @note This will return ossimFilename::NIL unless one of was called,
+    * setInputSource or setOutputFile.
+    */
+   virtual ossimFilename getOutputFile() const=0;
+
+   /**
+    * @brief Sets the overview output type. (pure virtual)
+    * @param type This should be the string representing the type.  This method
+    * will do nothing if type is not handled and return false.
+    * @return true if type is handled, false if not.
+
+    * @note Currently handled types are 
+    */
+   virtual bool setOverviewType(const ossimString& type)=0;
+
+   /**
+    * @brief Gets the overview type. (pure virtual)
+    * @return The overview output type as a string. */
+   virtual ossimString getOverviewType() const=0;
+
+   /**
+    * @brief Method to check if builder can handle type.
+    * @return true if type is handled by builder, false if not.
+    */
+   virtual bool hasOverviewType(const ossimString& type) const;
+
+   /**
+    * @brief Method to populate class supported types. (pure virtual)
+    * Example:
+    * ossimTiffOverviewNearest
+    * ossimTiffOverviewBox
+    *
+    * @param typeList List of ossimStrings to add to.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const=0;
+
+   /**
+    * @brief Get the overview stop dimension.
+    * @return The overview stop dimension.
+    */
+   virtual ossim_uint32 getOverviewStopDimension() const;
+
+   /**
+    * @brief Sets the overview stop dimension.
+    *
+    * This controls how many layers will be built. If set to 64 then the
+    * builder will stop when height and width for current level are less
+    * than or equal to 64.  Note a default can be set in the ossim preferences
+    * file, setting the keyword "overview_stop_dimension".
+    * 
+    * @param dim The overview stop dimension
+    */
+   virtual void setOverviewStopDimension(ossim_uint32 dim);
+
+   /**
+    * @brief Gets the histogram accumulation mode.
+    * @return mode NONE, NORMAL or FAST.
+    */
+   ossimHistogramMode getHistogramMode() const;
+
+   /**
+    * @brief Sets the histogram accumulation mode.
+    * @param mode NONE, NORMAL or FAST.
+    */
+   void setHistogramMode(ossimHistogramMode mode);
+ 
+   /**
+    * @brief Builds the overviews. (pure virtual)
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool execute()=0;
+
+   /**
+    * @brief Finalize method.  Should be called at end of execute.
+    *
+    * This implementation will reset the the output band list if the source
+    * image handler is a band selector.
+    */
+   virtual void finalize();
+
+   /**
+    * @brief Specifies parameters (in KWL) for generation of an alpha (bit)
+    * mask such that any full or partial null pixels will be masked out. A
+    * mask file will be written to the source image directory with the image
+    * file name and extension ".mask". 
+    */
+   void setBitMaskSpec(const ossimKeywordlist& bit_mask_spec);
+
+   /**
+    * @brief Turn on/off scan for min max flag.
+    * This method assumes the null is known.
+    * @param flag true turns scan on, false off. Default=off.
+    */
+   void setScanForMinMax(bool flag);
+
+   /** @return scan for min max flag. */
+   bool getScanForMinMax() const;
+
+   /**
+    * @brief Turn on/off scan for min, max, null flag.
+    * Attempts to find null, min and max where null is the minimum value found,
+    * min is the second most min and max is max.
+    * @param flag true turns scan on, false off. Default=off.
+    */
+   void setScanForMinMaxNull(bool flag);
+
+   /** @return scan for min max flag. */
+   bool getScanForMinMaxNull() const;
+
+protected:
+   /** virtual destructor */
+   virtual ~ossimOverviewBuilderBase();
+
+   /**
+    *  @brief Gets the required number of res levels.
+    *
+    *  Convenience method to get the required number of reduced resolution
+    *  data sets to get to the smallest dimension of the output tile size.
+    *  Note that this include r0.
+    *
+    *  @param ih Pointer to the image handler.
+    *
+    *  @return number of res levels.
+    */
+   ossim_uint32 getRequiredResLevels(const ossimImageHandler* ih) const;
+  
+   /**
+    * @brief Initializes preference settings.
+    *
+    * Currently:
+    *
+    * 1) Gets the default stop dimension.
+    *
+    * Looks for overview_stop_dimension, then will use minimum default tile
+    * size if that is not found.
+    * 
+    * 2) Set scan float data flag.
+    *
+    * Looks for overview_builder.scan_for_min_max_null_if_float.
+    *
+    * If true this will turn the m_scanForMinMaxNull on if the scalar type of
+    * image handler is float.
+    */
+   void initializePreferenceSettings();
+
+   /**
+    * @brief Checks scalar type and turns on scanning for min, max, nulls if
+    * needed.
+    */
+   void initializeScanOptions();
+   
+   ossim_uint32 m_overviewStopDimension;
+   ossimHistogramMode m_histoMode; 
+   ossimKeywordlist m_bitMaskSpec;
+   ossimRefPtr<ossimImageHandler>  m_imageHandler;
+   std::vector<ossim_uint32>       m_originalBandList;
+   ossimRefPtr<ossimBitMaskWriter> m_maskWriter;
+   ossimRefPtr<ossimMaskFilter>    m_maskFilter;
+   ossimFilename                   m_outputFile;
+   bool                            m_scanForMinMax;
+   bool                            m_scanForMinMaxNull;
+   bool                            m_scanFloatData;
+
+   /** for rtti stuff */
+   TYPE_DATA
+};
+
+#endif /* End of "#ifndef ossimOverviewBuilderBase_HEADER" */
diff --git a/ossim/include/ossim/imaging/ossimOverviewBuilderFactory.h b/include/ossim/imaging/ossimOverviewBuilderFactory.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimOverviewBuilderFactory.h
rename to include/ossim/imaging/ossimOverviewBuilderFactory.h
diff --git a/ossim/include/ossim/imaging/ossimOverviewBuilderFactoryBase.h b/include/ossim/imaging/ossimOverviewBuilderFactoryBase.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimOverviewBuilderFactoryBase.h
rename to include/ossim/imaging/ossimOverviewBuilderFactoryBase.h
diff --git a/ossim/include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h b/include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h
rename to include/ossim/imaging/ossimOverviewBuilderFactoryRegistry.h
diff --git a/ossim/include/ossim/imaging/ossimOverviewSequencer.h b/include/ossim/imaging/ossimOverviewSequencer.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimOverviewSequencer.h
rename to include/ossim/imaging/ossimOverviewSequencer.h
diff --git a/ossim/include/ossim/imaging/ossimPdfWriter.h b/include/ossim/imaging/ossimPdfWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimPdfWriter.h
rename to include/ossim/imaging/ossimPdfWriter.h
diff --git a/include/ossim/imaging/ossimPiecewiseRemapper.h b/include/ossim/imaging/ossimPiecewiseRemapper.h
new file mode 100644
index 0000000..d0c1fa4
--- /dev/null
+++ b/include/ossim/imaging/ossimPiecewiseRemapper.h
@@ -0,0 +1,272 @@
+//---
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Piecewise remapper class declaration.
+// 
+//---
+// $Id$
+
+#ifndef ossimPiecewiseRemapper_HEADER
+#define ossimPiecewiseRemapper_HEADER 1
+
+#include <ossim/imaging/ossimTableRemapper.h>
+#include <ossim/base/ossimRtti.h>
+#include <vector>
+
+/**
+ * @class ossimPiecewiseRemapper
+ *
+ * This class provides piecewise linear remapping of input pixels to output pixels. The
+ * object's state is represented as:
+ *
+ *   band0.remap0:  ( <segment0>, <segment1>, ...)
+ *   band0.remap1:  ( <segment0>, ... )
+ *
+ * The vertices of each linear segment are specified as four numbers in parentheses:
+ *
+ *   (<min_in>, <max_in>, <min_out>, <max_out>)
+ *
+ * A linear function is computed to map min_in to min_out and likewise max_in to max_out,
+ * with all intermediate points distributed linearly between the two extremes. Multiple
+ * remaps are cascaded: if an input pixel's value falls outside the ranges defined in the
+ * first remapper, then the second remapper's table is referenced. The cascading continues
+ * until a value is found. If no lookup is available, the output pixel is assigned to the
+ * NULL value.
+ *
+ * Example: Given object2 with a state of:
+ * 
+ *   object2.type: ossimPiecewiseRemapper
+ *   object2.remap_type: linear_native
+ *   object2.band0.remap0:  ( (0, 127, 0, 127), (128, 255, 128, 382) )
+ *   object2.band0.remap1:  ( (0, 382, 0, 255) )
+ *
+ * remap0 applied:   
+ * The input range 0 <-> 127 passes through with a one-to-one mapping.
+ * 128 <-> 255 is stretched out to 128 <-> 382.
+ * 
+ * remap0 output is fed to remap1:
+ * 0 maps to 0 and 382 maps to 255 (compression).
+ * 
+ * Notes:
+ * 
+ * 1) Currently there is only one remap type (linear_native) is supported so it's not
+ *    needed but left in the code for future type remaps, e.g. a remap where there is
+ *    a linear and a logarithmic section.
+ *
+ * 2) Any number of "remaps" are allowed.
+ * 
+ */
+class OSSIMDLLEXPORT ossimPiecewiseRemapper : public ossimTableRemapper
+{
+public:
+
+   enum PiecewiseRemapType
+   {
+      UNKNOWN       = 0,
+      LINEAR_NATIVE = 1
+   };
+   
+   /** default constructor */
+   ossimPiecewiseRemapper();
+
+   /** @return "ossimPiecewiseRemapper" */
+   virtual ossimString getClassName()const;
+
+   /** @return "OSSIM Piecewise Remapper" */
+   virtual ossimString getLongName()  const;
+
+   /** @return "Piecewise Remapper" */
+   virtual ossimString getShortName() const;
+
+   /**
+    * @brief Get tile method.
+    * @param tileRect Region of interest.
+    * @param resLevel Resolution level.
+    * @param The requested region of interest for resolution level.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel = 0);
+
+   /** @brief Initialization method.  Called on state change of chain. */ 
+   virtual void initialize();
+
+   /**
+    * @brief Sets remap type.
+    *
+    * Current types: "linear_native"
+    *
+    * @param type
+    */
+   void setRemapType( const std::string& type );
+   
+   /**
+    * @brief Saves the state to a keyword list.
+    * @return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * @brief Loads (recreates) the state of an object from a keyword
+    * list.
+    * @return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+
+   /** @brief Print method.  Called by ossimObject::operator<<. */
+   virtual ostream& print(ostream& os) const;
+
+   /** @return The min pixel of the band. */
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   
+   /** @return The max pixel of the band. */
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+protected:
+
+   /**
+    * @brief Protected virtual destructor.
+    *
+    * This class is derived from ossimReferenced; hence, will auto destruct
+    * provided it is wrapped/stored in an ossimRefPtr. Example usage:
+    *
+    * ossimRefPtr<ossimPiecewiseRemapper> pwr = new ossimPiecewiseRemapper();
+    */
+   virtual ~ossimPiecewiseRemapper();
+
+private:
+
+   /**
+    * @class ossimRemapSet
+    *
+    * Private container class. Currently hold an array of doubles.
+    */
+   class ossimRemapSet
+   {
+   public:
+      ossimRemapSet();
+      ossimRemapSet(const ossimRemapSet& obj);
+      const ossimRemapSet& operator=(const ossimRemapSet& rhs);
+      std::vector<ossim_float64> m_set;
+   };
+   
+   /**
+    * @class ossimBandRemap
+    *
+    * Private container class. Holds array of ossimRemapSets for a given band.
+    */
+   class ossimBandRemap
+   {
+   public:
+      ossimBandRemap();
+      ossimBandRemap(const ossimBandRemap& obj);
+      const ossimBandRemap& operator=(const ossimBandRemap& rhs);
+
+      void loadState( const ossimKeywordlist& kwl,
+                      const std::string& prefix,
+                      ossim_uint32 band );
+      
+      void saveState( ossimKeywordlist& kwl,
+                      const std::string& prefix,
+                      ossimPiecewiseRemapper::PiecewiseRemapType remapType,
+                      ossim_uint32 band ) const;
+
+      /**
+       * @brief Initializes set from string.
+       *
+       * Example input: ((0, 127, 0, 127), (128, 255, 128, 382))
+       * 
+       * @param s String to initialize from.
+       * @param set Initialized by this.
+       */
+      bool initRemapSetFromString( const std::string& s,
+                                   ossimPiecewiseRemapper::ossimRemapSet& set ) const;
+
+      /**
+       * @brief Gets a string from remap set for type.
+       * @param remapType
+       * @param set
+       * @param s Initialized by this.
+       */
+      void getRemapSetString( ossimPiecewiseRemapper::PiecewiseRemapType remapType,
+                              const ossimPiecewiseRemapper::ossimRemapSet& set, 
+                              std::string& s ) const;
+
+      void getLinearRemapSetString( const ossimPiecewiseRemapper::ossimRemapSet& set, 
+                                    std::string& s ) const;
+         
+      std::vector<ossimRemapSet> m_remap;
+      
+   }; // End: class ossimBandRemap 
+   
+   /**
+    * @brief Gets a string from remap type.
+    * @param remapType
+    * @param s Initialized by this.
+    */
+   void getRemapTypeString( ossimPiecewiseRemapper::PiecewiseRemapType remapType,
+                            std::string& s ) const;
+
+   /**
+    * @brief Gets a string from remap set.
+    *
+    * Example output: ((0, 127, 0, 127), (128, 255, 128, 382))
+    * 
+    * @param set
+    * @param s Initialized by this.
+    */   
+   void getLinearRemapSetString(
+      const ossimPiecewiseRemapper::ossimRemapSet& set, 
+      std::string& s ) const;
+
+   /** @brief Builds the table. */
+   void buildTable();
+
+   /** @brief Builds the linear native table. */
+   void buildLinearNativeTable();
+
+   /** @brief Builds the linear native table for scalar type T. */
+   template <class T> void buildLinearNativeTable(T dummy);
+   
+   /**
+    * @brief Initialized base class (ossimTableRemapper) values:
+    * - theTableBinCount
+    * - theTableBandCount
+    * - theTableType
+    * - theTable (resizes if not correct size.
+    */
+   void setupTable();
+
+   /** @brief Computes min/max from remaps in m_bandRemap. */
+   void initMinMax();
+
+   /** @private(not allowed) copy constructor. */
+   ossimPiecewiseRemapper(const ossimPiecewiseRemapper& obj);
+
+   /** @private(not allowed) assignment(operator=) */
+   ossimPiecewiseRemapper& operator=(const ossimPiecewiseRemapper& hr);
+
+   /** @brief Dirty flag to indicate table needs to be rebuilt. */
+   bool m_dirty;
+   
+   PiecewiseRemapType m_remapType;
+
+   // One set per band.
+   std::vector<ossimPiecewiseRemapper::ossimBandRemap> m_bandRemap;
+
+#if 1 /* Not sure if we need min/max right now.(drb) */
+   // Stores the min/max from the table for each band.
+   vector<ossim_float64> m_min;
+   vector<ossim_float64> m_max;
+#endif
+
+   TYPE_DATA
+};
+
+#endif  /* #ifndef ossimPiecewiseRemapper_HEADER */
diff --git a/include/ossim/imaging/ossimPixelFlipper.h b/include/ossim/imaging/ossimPixelFlipper.h
new file mode 100644
index 0000000..5659834
--- /dev/null
+++ b/include/ossim/imaging/ossimPixelFlipper.h
@@ -0,0 +1,272 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class to scan pixels and flip target dn pixel value to new dn pixel value.
+// This was written to fix partial null pixels.
+// 
+//*************************************************************************
+// $Id: ossimPixelFlipper.h 19728 2011-06-06 21:31:17Z dburken $
+#ifndef ossimPixelFlipper_HEADER
+#define ossimPixelFlipper_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimPolygon.h>
+#include <OpenThreads/ReentrantMutex>
+
+/**
+ *  Class to scan pixels and flip target dn value to a replacement dn
+ *  value.
+ *
+ *  This was written to fix problems with null pixels, i.e. an image has a
+ *  digital number(dn) of 255 for null and it is desired to use a dn of 0 as
+ *  a null.  This can really be used to flip any pixel value to another.
+ *
+ *  @note This filter currently works on the input tile directly and does
+ *  not copy the data.
+ *
+ *  @see theReplacementMode data member documentation for more info.
+ */
+class OSSIM_DLL ossimPixelFlipper : public ossimImageSourceFilter
+{
+public:
+   static const char PF_TARGET_VALUE_KW[];     
+   static const char PF_TARGET_RANGE_KW[];     
+   static const char PF_REPLACEMENT_VALUE_KW[];
+   static const char PF_REPLACEMENT_MODE_KW[];
+   static const char PF_CLAMP_VALUE_KW[];
+   static const char PF_CLAMP_VALUE_LO_KW[];   
+   static const char PF_CLAMP_VALUE_HI_KW[];   
+   static const char PF_CLIP_MODE_KW[];
+
+   /**
+    * Target Replacement Mode:
+    * 
+    * Examples given for 3-band pixel values as (R, G, B) with target = 0, and replacement = 1
+
+    * If mode is REPLACE_BAND_IF_TARGET (default):
+    * Any pixel band with value of target will be replaced.
+    * (0, 0, 0) becomes (1, 1, 1)
+    * (0, 3, 2) becomes (1, 3, 2)
+    *
+    * If mode is REPLACE_BAND_IF_PARTIAL_TARGET:
+    * A band with target value will be replaced only if at least one other band in the pixel does 
+    * not have the target.
+    * (0, 0, 0) remains (0, 0, 0)
+    * (0, 3, 2) becomes (1, 3, 2)
+    *
+    * If mode is REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
+    * All bands of the pixel will be replaced if any but not all bands in the pixel have the
+    * target value.
+    * (0, 0, 0) remains (0, 0, 0)
+    * (0, 3, 2) becomes (1, 1, 1)
+    *
+    * If mode is REPLACE_ONLY_FULL_TARGETS:
+    * All bands in the pixel will be replaced only if they all have the target.
+    * (0, 0, 0) becomes (1, 1, 1)
+    * (0, 3, 2) remains (0, 3, 2)
+    *
+    * If mode is REPLACE_ALL_BANDS_IF_ANY_TARGET:
+    * All bands in the pixel will be replaced if even one band has the target.
+    * (0, 0, 0) becomes (1, 1, 1)
+    * (0, 3, 2) remains (1, 1, 1)
+    */
+   enum ReplacementMode
+   {
+      REPLACE_BAND_IF_TARGET               = 0,
+      REPLACE_BAND_IF_PARTIAL_TARGET       = 1,
+      REPLACE_ALL_BANDS_IF_PARTIAL_TARGET  = 2,
+      REPLACE_ONLY_FULL_TARGETS            = 3,
+      REPLACE_ALL_BANDS_IF_ANY_TARGET      = 4,
+   };
+
+   /** 
+    * When either a lo and/or hi clamp value is set, the clamping mode will be enabled accordingly
+    * and override any target replacement defined
+    */
+   enum ClampingMode
+   {
+      DISABLED                           = 0,
+      CLAMPING_LO                        = 1,
+      CLAMPING_HI                        = 2,
+      CLAMPING_LO_AND_HI                 = 3,
+   };
+
+   enum ClipMode
+   {
+      NONE = 0,
+      BOUNDING_RECT  = 1,
+      VALID_VERTICES = 2
+   };
+
+   /** default constructor */
+   ossimPixelFlipper(ossimObject* owner=NULL);
+
+
+   /** @return "Pixel flipper" as an ossimString. */
+   virtual ossimString getShortName()const;
+
+   /** Initializes the state of the object from theInputConnection. */
+   virtual void initialize();
+
+   /**
+    * @param tile_rect Rectangle to fill tile with.
+    * 
+    * @param resLevel Reduced resolution level to grab from.
+    * 
+    * @return ossimRefPtr<ossimImageData> This is tile that was filled with
+    * tile_rect.
+    *
+    * @note Callers should check the ossimRefPtr::valid method.
+    * The internal pointer of the ossimRefPtr<ossimImageData> can be
+    * null if the tile_rect did not intersect the input connection's
+    * bounding rectangle.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual ossim_float64 getMaxPixelValue (ossim_uint32 band = 0 ) const;
+   virtual ossim_float64 getMinPixelValue (ossim_uint32 band = 0 ) const;
+      
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /** 
+    * @param target_value This is the value to flip. 
+    * @note If clamping is specified, it will take precedence over any target value (or range) test
+    */
+   void setTargetValue(ossim_float64 target_value);
+
+   /** 
+    * Instead of a single value for a target, this method allows for specifying a range of values
+    * to flip to the replacement. The replacement mode is still referenced.
+    * @param  This is the value to flip. 
+    * @note If clamping is specified, it will take precedence over any target range test.
+    */
+   void setTargetRange(ossim_float64 target_min, ossim_float64 target_max);
+
+   /**
+    * @param replacement_value This is the value to flip target to.
+    * @note If clamping is specified, it will take precedence over any target replacement.
+    */
+ void setReplacementValue(ossim_float64 replacement_value);
+
+   /**
+    * @param clamp_value If set all pixel values above this range will (or below if clamp_max_value
+    * = false) be clamped to clamp_value. Must be less than max pixel (or greater than the min 
+    * pixel) value of the input and cannot be null. 
+    * @note If any clamp limit is defined, it will take precedence over any target value (or range)
+    * replacement. The replacement mode is referenced when deciding whether a pixel should be 
+    * clamped or left alone.
+    */
+   void setClampValue(ossim_float64 clamp_value, bool is_high_clamp_value=true);
+   void setClampValues(ossim_float64 clamp_value_lo, ossim_float64 clamp_value_hi);
+
+   /** @see enum ReplacementMode */
+   void setReplacementMode(ossimPixelFlipper::ReplacementMode mode);
+
+   /** Accepts a string that must match the enumerator's label (can be lower case) and sets the 
+    * replacement mode accordingly. If the string is not understood, the mode remains unchanged and
+    * FALSE is returned. */
+   bool setReplacementMode(const ossimString& modeString);
+
+   /** 
+    * Clipping here refers to bounding rect or valid polygon (spacial) clipping, where all pixels
+    * outside the valid area are mapped to the replacement value.
+    */
+   void setClipMode(const ossimString& modeString);
+   void setClipMode(ClipMode mode);
+
+   //ossim_float64 getTargetValue()      const;
+   ossim_float64 getReplacementValue() const;
+   //ossim_float64 getClampValue() const;
+   ossimPixelFlipper::ReplacementMode getReplacementMode()  const;
+   ossimString getReplacementModeString() const;
+   ossimString getClipModeString() const;
+   ClipMode getClipMode() const;
+
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   //! This object can be used outside of an image chain for offline processing of existing tile.
+   template <class T> void flipPixels(T dummy, ossimImageData* inpuTile, ossim_uint32 resLevel);
+
+protected:
+   /** destructor */
+   virtual ~ossimPixelFlipper();
+   template <class T> void clipTile(T dummy,
+                                    ossimImageData* inpuTile,
+                                    ossim_uint32 resLevel);
+
+   /**
+    * Verifies pixel is in range.
+    * @return Returns true if in range else false.
+    */
+   bool inRange(ossim_float64 value) const;
+
+   void allocateClipTileBuffer(ossimRefPtr<ossimImageData> inputImage);
+   
+   /** The value range to replace. For a single value replacement, both Lo and Hi are equal. Any
+    * pixel within this range will be remapped to the replacement value */
+   ossim_float64 theTargetValueLo;
+   ossim_float64 theTargetValueHi;
+
+    /** When target values are defined, this is the value the pixel will assume if the pixel falls 
+     *  within the target range (according to the rules for replacement mode) */
+   ossim_float64 theReplacementValue;
+   ReplacementMode theReplacementMode; //!< See documentation for ReplacementMode enum above
+
+  /** The range of desired pixel values. Any pixels outside this range are set to the corresponding
+    * clamp value. Note that theReplacementValue is not referenced when clamping. */
+   ossim_float64 theClampValueLo;
+   ossim_float64 theClampValueHi;
+   ClampingMode  theClampingMode;
+
+   /**
+    * Border Clip mode
+    *
+    * This will flip to nulls any pixel value outside the specified mode.
+    *
+    * Valid modes are:
+    *
+    * none
+    * bounding_rect
+    * valid_vertices
+    *
+    * if the mode is "none" then nothing is done.
+    * if the mode is "bounding_rect" then the bounding rect for the requested rlevel
+    *                is used and every pixel outside that   
+    */
+   ClipMode        theClipMode;
+   
+   /** For lock and unlock. */
+   mutable OpenThreads::ReentrantMutex      theMutex;
+
+   mutable std::vector<ossimPolygon> theValidVertices;
+   mutable std::vector<ossimIrect>   theBoundingRects;
+
+   ossimRefPtr<ossimImageData> theClipTileBuffer;
+   
+   TYPE_DATA
+};
+
+
+#endif
diff --git a/include/ossim/imaging/ossimPolyCutter.h b/include/ossim/imaging/ossimPolyCutter.h
new file mode 100644
index 0000000..a0afc16
--- /dev/null
+++ b/include/ossim/imaging/ossimPolyCutter.h
@@ -0,0 +1,108 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimPolyCutter.h 19907 2011-08-05 19:55:46Z dburken $
+#ifndef ossimPolyCutter_HEADER
+#define ossimPolyCutter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/imaging/ossimImageDataHelper.h>
+#include <vector>
+
+//class ossimPolyArea2d;
+class ossimImageData;
+
+class OSSIMDLLEXPORT ossimPolyCutter : public ossimImageSourceFilter
+{
+public:
+   enum ossimPolyCutterCutType
+   {
+      OSSIM_POLY_NULL_INSIDE  = 0,
+      OSSIM_POLY_NULL_OUTSIDE = 1
+   };
+   
+   ossimPolyCutter();
+    ossimPolyCutter(ossimImageSource* inputSource,
+                    const ossimPolygon& polygon);
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+
+   virtual void initialize();
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual void setPolygon(const vector<ossimDpt>& polygon,
+                           ossim_uint32 i = 0);
+   
+   virtual void setPolygon(const vector<ossimIpt>& polygon,
+                           ossim_uint32 i = 0);
+   
+   virtual void addPolygon(const vector<ossimIpt>& polygon);
+   virtual void addPolygon(const vector<ossimDpt>& polygon);
+   virtual void addPolygon(const ossimPolygon& polygon);
+   
+   virtual void setNumberOfPolygons(ossim_uint32 count);
+   
+   virtual std::vector<ossimPolygon>& getPolygonList();
+
+   virtual const std::vector<ossimPolygon>& getPolygonList()const;
+   
+   void setCutType(ossimPolyCutterCutType cutType);
+   
+   ossimPolyCutterCutType getCutType()const;
+
+   void clear();
+
+   const ossimIrect& getRectangle() const;
+
+   void setRectangle(const ossimIrect& rect);
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+protected:
+   virtual ~ossimPolyCutter();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   void computeBoundingRect();
+
+   ossimRefPtr<ossimImageData> theTile;
+
+   /*!
+    * Will hold a pre-computed bounding rect of the
+    * polygon data.
+    */
+   ossimIrect theBoundingRect;
+
+   std::vector<ossimPolygon> thePolygonList;
+
+   /*!
+    * theDefault fill will be outside.
+    */
+   ossimPolyCutterCutType theCutType;
+   ossimImageDataHelper theHelper;
+   bool m_boundingOverwrite;
+
+TYPE_DATA  
+};
+#endif /* #ifndef ossimPolyCutter_HEADER */
diff --git a/include/ossim/imaging/ossimQbTileFilesHandler.h b/include/ossim/imaging/ossimQbTileFilesHandler.h
new file mode 100644
index 0000000..5fa1484
--- /dev/null
+++ b/include/ossim/imaging/ossimQbTileFilesHandler.h
@@ -0,0 +1,44 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+// 
+//**************************************************************************************************
+// $Id: ossimQbTileFilesHandler.h 2669 2011-06-06 12:28:20Z oscar.kramer $
+#ifndef ossimQbTileFilesHandler_HEADER
+#define ossimQbTileFilesHandler_HEADER
+
+#include <ossim/imaging/ossimTiledImageHandler.h>
+
+// Enable this flag to utilize the system of separate overviews for each tile-file
+#define USING_SUB_OVRS 0
+
+//! Image handler used for tiled Quickbird imagery. 
+class OSSIMDLLEXPORT ossimQbTileFilesHandler : public ossimTiledImageHandler
+{
+public:
+   //!  Constructor (default):
+   ossimQbTileFilesHandler();
+   
+   //! Destructor:
+   virtual ~ossimQbTileFilesHandler();
+   
+   //! @return Returns true on success, false on error.
+   //! @note This method relies on the data member ossimImageData::theImageFile being set.  
+   virtual bool open();
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   
+protected:
+
+   //! Initializes tile image rects by considering adjacent row/col offsets. Called when TIL
+   //! doesn't contain the info. Returns true if successful.
+   bool computeImageRects();
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimQbTileFilesHandler_HEADER */
diff --git a/include/ossim/imaging/ossimQuickbirdNitfTileSource.h b/include/ossim/imaging/ossimQuickbirdNitfTileSource.h
new file mode 100644
index 0000000..fa2b883
--- /dev/null
+++ b/include/ossim/imaging/ossimQuickbirdNitfTileSource.h
@@ -0,0 +1,44 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts (gpotts at imagelinks.com)
+//
+// Description:
+//
+//*******************************************************************
+//  $Id: ossimQuickbirdNitfTileSource.h 22836 2014-07-25 15:13:47Z dburken $
+#ifndef ossimQuickbirdNitfTileSource_HEADER
+#define ossimQuickbirdNitfTileSource_HEADER
+#include <ossim/imaging/ossimNitfTileSource.h>
+#include <ossim/base/ossim2dTo2dTransform.h>
+
+class ossimQuickbirdNitfTileSource : public ossimNitfTileSource
+{
+public:
+   virtual bool open();
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+protected:
+   ossimRefPtr<ossim2dTo2dTransform> m_transform;
+TYPE_DATA   
+};
+#endif
diff --git a/include/ossim/imaging/ossimQuickbirdTiffTileSource.h b/include/ossim/imaging/ossimQuickbirdTiffTileSource.h
new file mode 100644
index 0000000..6e9bd90
--- /dev/null
+++ b/include/ossim/imaging/ossimQuickbirdTiffTileSource.h
@@ -0,0 +1,36 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+// 
+// Copied from ossimQuickbirdNitfTileSource written by Garrett Potts.
+//
+// Description:
+//
+// Class declaration for specialized image handler to pick up offsets from
+// Quick Bird ".TIL" files.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimQuickbirdTiffTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+#ifndef ossimQuickbirdTiffTileSource_HEADER
+#define ossimQuickbirdTiffTileSource_HEADER
+
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/base/ossim2dTo2dShiftTransform.h>
+
+class OSSIM_DLL ossimQuickbirdTiffTileSource : public ossimTiffTileSource
+{
+public:
+   virtual bool open();
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   
+protected:
+   ossimFilename m_tileInfoFilename;
+   
+TYPE_DATA   
+};
+#endif
diff --git a/include/ossim/imaging/ossimRLevelFilter.h b/include/ossim/imaging/ossimRLevelFilter.h
new file mode 100644
index 0000000..9a3319f
--- /dev/null
+++ b/include/ossim/imaging/ossimRLevelFilter.h
@@ -0,0 +1,99 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRLevelFilter.h 17932 2010-08-19 20:34:35Z dburken $
+#ifndef ossimRLevelFilter_HEADER
+#define ossimRLevelFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/*!
+ * This filter is used to adjust the RLevel.  If you would like to
+ * continually change between RLevels or Reslolutions then you can use this
+ * filter to do so.  You can also specify whether or not the rLevel
+ * passed in from the getTile request is added to this classes current
+ * Rlevel.  This is so if you concatenate multiple filters that reduce
+ * the RLevels then it will keep reducing.  For example if I have
+ * 2 filters that both go to RLevel 1 then it actually will go to
+ * 2 since there are 2 decimations happening.  This can be turned off
+ * by specifying the Rlevel not to be additive.
+ */
+class OSSIMDLLEXPORT ossimRLevelFilter : public ossimImageSourceFilter
+{
+public:
+
+   /** @brief default constructor */
+   ossimRLevelFilter();
+
+
+   virtual void getDecimationFactor(ossim_uint32 resLevel,
+                                    ossimDpt& result)const;
+
+   //! Returns a pointer reference to the active image geometry at this filter. The input source
+   //! geometry is modified, so we need to maintain our own geometry object as a data member.
+   ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   virtual void setCurrentRLevel(ossim_uint32 rlevel);
+
+   virtual ossim_uint32 getCurrentRLevel()const;
+
+   /*!
+    * Get/set of the data member "theOverrideGeometryFlag".
+    * If set this will override the "getImageGeometry" method and adjust
+    * the getMetersPerPixel or the getDecimalDegreesPerPixel.
+    * Default behavior is to not override method.
+    */
+   virtual bool getOverrideGeometryFlag() const;
+   virtual void setOverrideGeometryFlag(bool override);
+
+   /**
+    * @brief Returns the bounding rectangle.
+    *
+    * @param resLevel This argument is only passed onto the input connection
+    * if this filter is disabled.  @see disableSource().
+    *
+    * To get the bounding rectangle of an rlevel when source is enabled do:
+    * myRLevelFilter->setCurrentRLevel(level);
+    * myRLevelFilter->getBoundingRect();
+    *
+    * @return Rectangle of the current rlevel if enabled; else, the rectangle
+    * of the input connection for resLevel.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+protected:
+   /** @brief virtual destructor. */
+   virtual ~ossimRLevelFilter();
+   
+   /*!
+    * Initializes result with the sum of decimations from rlevel one to
+    * theCurrentRLevel.
+    */
+   void getSummedDecimation(ossimDpt& result) const;
+   
+   //! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
+   //! a scale change so that the geometry's projection is modified accordingly.
+   void updateGeometry();
+
+   ossim_uint32 theCurrentRLevel;
+   bool         theOverrideGeometryFlag;
+   ossimRefPtr<ossimImageGeometry> m_ScaledGeometry; //!< The input image geometry, altered by the scale
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimRangeDomeTileSource.h b/include/ossim/imaging/ossimRangeDomeTileSource.h
new file mode 100755
index 0000000..1ae0e63
--- /dev/null
+++ b/include/ossim/imaging/ossimRangeDomeTileSource.h
@@ -0,0 +1,123 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id: ossimRangeDomeTileSource.h 23464 2015-08-07 18:39:47Z okramer $
+
+#ifndef ossimRangeDomeTileSource_HEADER
+#define ossimRangeDomeTileSource_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimGrect.h>
+#include <vector>
+
+class ossimImageData;
+
+struct ossimRangeDome
+{
+   enum Classification
+   {
+      UNASSIGNED = 0,
+      FRIENDLY_UNSPECIFIED = 1,
+      FRIENDLY_LEVEL_1= 2,
+      FRIENDLY_LEVEL_2 = 3,
+      FRIENDLY_LEVEL_3 = 4,
+      THREAT_UNSPECIFIED = 101,
+      THREAT_LEVEL_1 = 102,
+      THREAT_LEVEL_2 = 103,
+      THREAT_LEVEL_3 = 104
+   };
+
+   ossimRangeDome(std::vector<ossimString>& tokens);
+   ossimGrect boundingRect() const;
+
+   bool valid;
+   ossim_uint32 id;
+   ossimGpt centerGpt;
+   ossimDpt centerIpt;
+   double radiusMeters;
+   ossim_uint32 radiusPixelsSq;
+   Classification classification;
+   double startAz;
+   double endAz;
+   ossimString description;
+};
+
+
+/**
+ * Class used for rendering range domes (a.k.a. "threat domes") as 2-D ortho-images.
+ *
+ * This base class has the rudimentary capability of reading range dome specifications as a CSV file
+ * in the following format (one line per dome object):
+ *
+ *    id, lat, lon, hgt, R, C [,Az0, Az1] [, description]
+ *
+ * where
+ *
+ *    id -- integer ID of data object
+ *    lat, lon, hgt -- Location of center of dome (actually sphere) in WGS84
+ *    R -- radius (in meters) of dome boundary
+ *    C -- classification id (unsigned 8-bit) corresponding to area inside r
+ *    Az0, Az1 -- [optional] starting and ending azimuth (clockwise from Az0 in degrees). If both
+ *         Az0 and Az1 are equal, then 360 deg is implied.
+ *    description -- [optional] string
+ */
+class OSSIMDLLEXPORT ossimRangeDomeTileSource : public ossimImageHandler
+{
+public:
+   ossimRangeDomeTileSource();
+   virtual ~ossimRangeDomeTileSource();
+
+   /**  @brief Reads CSV file representing range domes.  */
+   virtual bool open();
+
+   virtual bool isOpen() const;
+
+   virtual void close();
+
+   virtual void initialize();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect, ossim_uint32 resLevel=0);
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+
+   virtual ossim_uint32    getNumberOfInputBands() const;
+   virtual ossim_uint32    getNumberOfLines(ossim_uint32 resLevel = 0) const;
+   virtual ossim_uint32    getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+   virtual ossim_uint32    getImageTileWidth() const { return 0; }
+   virtual ossim_uint32    getImageTileHeight() const { return 0; }
+   virtual ossimScalarType getOutputScalarType() const { return OSSIM_UINT8; }
+
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry() { return theGeometry; }
+
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /**
+    * The reader properties are:
+    * -- the GSD ("meters_per_pixel")
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
+
+   virtual void getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const;
+   virtual void setGSD( const ossim_float64& gsd );
+
+   ossim_uint32 getNumRangeDomes() const { return (ossim_uint32)m_rangeDomes.size(); }
+
+protected:
+   std::vector<ossimRangeDome>       m_rangeDomes;
+   ossimDpt                     m_gsd;
+
+   static const ossimString OSSIM_RANGE_DOME_SPEC_MAGIC_NUMBER;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimReadmeFileWriter.h b/include/ossim/imaging/ossimReadmeFileWriter.h
new file mode 100644
index 0000000..a02a1ba
--- /dev/null
+++ b/include/ossim/imaging/ossimReadmeFileWriter.h
@@ -0,0 +1,57 @@
+//*******************************************************************
+// Copyright (C) 2003 Storage Area Networks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kenneth Melero (kmelero at sanz.com)
+//
+//*******************************************************************
+//  $Id: ossimReadmeFileWriter.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimReadmeFileWriter_H
+#define ossimReadmeFileWriter_H
+
+#include <fstream>
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+
+/** ossimReadmeFileWriter */
+class OSSIMDLLEXPORT ossimReadmeFileWriter : public ossimMetadataFileWriter
+{
+public:
+
+   /** default constructor */
+   ossimReadmeFileWriter();
+
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * Appends the writers image types to the "metadatatypeList".
+    * 
+    * @param metadatatypeList stl::vector<ossimString> list to append to.
+    *
+    * @note Appends to the list, does not clear it first.
+    */
+   virtual void getMetadatatypeList(
+      std::vector<ossimString>& metadatatypeList) const;
+
+   /**
+    * Satisfies pure virtual from ossimMetadataWriter base.
+    *
+    * @param imageType string representing image type.
+    *
+    * @return true if "metadataType" is supported by writer.
+    */
+   virtual bool hasMetadataType(const ossimString& metadataType)const;
+   
+protected:
+   /** virtual destructor */
+   virtual ~ossimReadmeFileWriter();
+   virtual bool writeFile();
+   
+TYPE_DATA
+};
+
+#endif /* End of #ifndef ossimReadmeFileWriter_H */
diff --git a/include/ossim/imaging/ossimRectangleCutFilter.h b/include/ossim/imaging/ossimRectangleCutFilter.h
new file mode 100644
index 0000000..a831cb2
--- /dev/null
+++ b/include/ossim/imaging/ossimRectangleCutFilter.h
@@ -0,0 +1,57 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRectangleCutFilter.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimRectangleCutFilter_HEADER
+#define ossimRectangleCutFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIM_DLL ossimRectangleCutFilter : public ossimImageSourceFilter
+{
+public:
+   enum ossimRectangleCutType
+   {
+      OSSIM_RECTANGLE_NULL_INSIDE  = 0,
+      OSSIM_RECTANGLE_NULL_OUTSIDE = 1
+   };
+
+   ossimRectangleCutFilter(ossimObject* owner,
+                     ossimImageSource* inputSource=NULL);
+   ossimRectangleCutFilter(ossimImageSource* inputSource=NULL);
+
+   void setRectangle(const ossimIrect& rect);
+
+   const ossimIrect&     getRectangle()const;
+   ossimRectangleCutType getCutType()const;
+   void                  setCutType(ossimRectangleCutType cutType);
+   
+   ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
+                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+                                      ossim_uint32 resLevel=0)const;
+
+   ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                       ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+   
+protected:
+   ossimIrect            theRectangle;
+   ossimRectangleCutType theCutType;
+   vector<ossimDpt>      theDecimationList;
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimRectangleCutFilter_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimResampler.h b/include/ossim/imaging/ossimResampler.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimResampler.h
rename to include/ossim/imaging/ossimResampler.h
diff --git a/include/ossim/imaging/ossimRgbGridRemapEngine.h b/include/ossim/imaging/ossimRgbGridRemapEngine.h
new file mode 100644
index 0000000..e0a1d04
--- /dev/null
+++ b/include/ossim/imaging/ossimRgbGridRemapEngine.h
@@ -0,0 +1,54 @@
+//*****************************************************************************
+// FILE: ossimRgbGridRemapEngine.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimRgbGridRemapEngine
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimRgbGridRemapEngine.h 9094 2006-06-13 19:12:40Z dburken $
+
+#ifndef ossimRgbGridRemapEngine_HEADER
+#define ossimRgbGridRemapEngine_HEADER
+
+#include <ossim/imaging/ossimGridRemapEngine.h>
+
+/*!****************************************************************************
+ *
+ * CLASS: ossimRgbGridRemapEngine 
+ *
+ *****************************************************************************/
+class ossimRgbGridRemapEngine : public ossimGridRemapEngine
+{
+public:
+   ossimRgbGridRemapEngine()
+      : ossimGridRemapEngine(3, 3) {}
+   
+   virtual ossimObject* dup() const;
+   
+   virtual void remapTile(const ossimDpt& origin_point,
+                          ossimGridRemapSource* remapper,
+                          ossimRefPtr<ossimImageData>& tile);
+
+   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources);
+
+   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
+                                   void* result);
+
+protected:
+   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
+                                 void*                 source_value,
+                                 void*                 target_value);
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimRgbImage.h b/include/ossim/imaging/ossimRgbImage.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimRgbImage.h
rename to include/ossim/imaging/ossimRgbImage.h
diff --git a/include/ossim/imaging/ossimRgbToGreyFilter.h b/include/ossim/imaging/ossimRgbToGreyFilter.h
new file mode 100644
index 0000000..a274034
--- /dev/null
+++ b/include/ossim/imaging/ossimRgbToGreyFilter.h
@@ -0,0 +1,70 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToGreyFilter.h 20197 2011-11-03 13:22:02Z dburken $
+#ifndef ossimRgbToGreyFilter_HEADER
+#define ossimRgbToGreyFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIMDLLEXPORT ossimRgbToGreyFilter : public ossimImageSourceFilter
+{
+public:
+   ossimRgbToGreyFilter(ossimObject* owner=NULL);
+   ossimRgbToGreyFilter(ossimImageSource* inputSource,
+                        double c1 = 1.0/3.0,
+                        double c2 = 1.0/3.0,
+                        double c3 = 1.0/3.0);
+   ossimRgbToGreyFilter(ossimObject* owner,
+                        ossimImageSource* inputSource,
+                        double c1 = 1.0/3.0,
+                        double c2 = 1.0/3.0,
+                        double c3 = 1.0/3.0);
+   
+   virtual ossimString getShortName()const;
+   virtual ossimString getLongName()const;
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual void initialize();
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   
+   ossim_uint32 getNumberOfOutputBands() const;
+ 
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+protected:
+   virtual ~ossimRgbToGreyFilter();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theBlankTile;
+   ossimRefPtr<ossimImageData> theTile;
+   void runUcharTransformation(ossimRefPtr<ossimImageData>& tile);
+   double theC1;
+   double theC2;
+   double theC3;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimRgbToGreyFilter_HEADER */
diff --git a/include/ossim/imaging/ossimRgbToHsiSource.h b/include/ossim/imaging/ossimRgbToHsiSource.h
new file mode 100644
index 0000000..5105111
--- /dev/null
+++ b/include/ossim/imaging/ossimRgbToHsiSource.h
@@ -0,0 +1,47 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToHsiSource.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimRgbToHsiSource_HEADER
+#define ossimRgbToHsiSource_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimRgbToHsiSource : public ossimImageSourceFilter
+{
+public:
+   ossimRgbToHsiSource();
+   ossimRgbToHsiSource(ossimImageSource* inputSource);
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual ossim_uint32    getNumberOfOutputBands()const;
+   virtual double          getNullPixelValue()const;
+   virtual double          getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double          getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual void initialize();
+
+protected:
+   virtual ~ossimRgbToHsiSource();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theBlankTile;
+   ossimRefPtr<ossimImageData> theTile;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimRgbToHsiSource_HEADER */
diff --git a/include/ossim/imaging/ossimRgbToHsvSource.h b/include/ossim/imaging/ossimRgbToHsvSource.h
new file mode 100644
index 0000000..6b8f542
--- /dev/null
+++ b/include/ossim/imaging/ossimRgbToHsvSource.h
@@ -0,0 +1,47 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToHsvSource.h 22724 2014-04-10 16:27:46Z gpotts $
+#ifndef ossimRgbToHsvSource_HEADER
+#define ossimRgbToHsvSource_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimRgbToHsvSource : public ossimImageSourceFilter
+{
+public:
+   ossimRgbToHsvSource();
+   ossimRgbToHsvSource(ossimImageSource* inputSource);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual ossim_uint32    getNumberOfOutputBands()const;
+   virtual double getNullPixelValue()const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual void initialize();
+       
+protected:
+   virtual ~ossimRgbToHsvSource();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   ossimRefPtr<ossimImageData> theBlankTile;
+   ossimRefPtr<ossimImageData> theTile;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimRgbToIndexFilter.h b/include/ossim/imaging/ossimRgbToIndexFilter.h
new file mode 100644
index 0000000..d66c192
--- /dev/null
+++ b/include/ossim/imaging/ossimRgbToIndexFilter.h
@@ -0,0 +1,96 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToIndexFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimRgbToIndexFilter_HEADER
+#define ossimRgbToIndexFilter_HEADER
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimRgbLutDataObject.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <vector>
+
+class ossimImageData;
+
+/*!
+ * It will map the input data to an 8-bit index table.  The table
+ * <pre>
+ *
+ * Example keyword list:
+ *
+ * type:  ossimRgbToIndexFilter
+ *
+ * If you want to load from a file then just do:
+ *
+ * lut.filename: <full path to lut file>
+ *
+ * If you have the lut table in line then it must look like this:
+ *
+ * lut.entry0:  204 102 1
+ * lut.entry1:  255 204 153
+ * lut.entry2:  51 204 204
+ * lut.number_of_entries:  3
+ * lut.type:  ossimRgbLutDataObject
+ *
+ * </pre>
+ */
+class ossimRgbToIndexFilter : public ossimImageSourceFilter
+{
+public:
+   /*!
+    * Initializes the min value to 0 and the max value to 4000.
+    */
+   ossimRgbToIndexFilter();
+   ossimRgbToIndexFilter(ossimImageSource* inputSource,
+                           const ossimRgbLutDataObject& rgbLut);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
+                                               ossim_uint32 resLevel=0);
+   
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+   
+   virtual ossimScalarType getOutputScalarType() const;
+   
+   void setLut(ossimRgbLutDataObject& lut);
+
+   void setLut(const ossimFilename& file);
+
+   virtual void disableSource();
+   
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+   
+   virtual void initialize();
+
+   /*!
+    * Saves the state of this object.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   /*!
+    * Loads the state of this object.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+protected:
+   virtual ~ossimRgbToIndexFilter();
+   void allocate();
+   
+   virtual ossimRefPtr<ossimImageData> convertInputTile(ossimRefPtr<ossimImageData>& tile);
+
+   ossimRefPtr<ossimRgbLutDataObject>       theLut;
+   ossimRefPtr<ossimImageData> theTile;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimRgbToJpegYCbCrSource.h b/include/ossim/imaging/ossimRgbToJpegYCbCrSource.h
new file mode 100644
index 0000000..2422b80
--- /dev/null
+++ b/include/ossim/imaging/ossimRgbToJpegYCbCrSource.h
@@ -0,0 +1,32 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToJpegYCbCrSource.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimRgbToJpegYCbCrSource_HEADER
+#define ossimRgbToJpegYCbCrSource_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class ossimRgbToJpegYCbCrSource : public ossimImageSourceFilter
+{
+public:
+   
+   ossimRgbToJpegYCbCrSource();
+   ossimRgbToJpegYCbCrSource(ossimImageSource* inputSource);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+       
+protected:
+   virtual ~ossimRgbToJpegYCbCrSource();
+   ossimRefPtr<ossimImageData> theBlankTile;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimRpfCacheTileSource.h b/include/ossim/imaging/ossimRpfCacheTileSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimRpfCacheTileSource.h
rename to include/ossim/imaging/ossimRpfCacheTileSource.h
diff --git a/include/ossim/imaging/ossimS16ImageData.h b/include/ossim/imaging/ossimS16ImageData.h
new file mode 100644
index 0000000..2df4e18
--- /dev/null
+++ b/include/ossim/imaging/ossimS16ImageData.h
@@ -0,0 +1,184 @@
+//*******************************************************************
+// Copyright (C) 2001 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimS16ImageData.  Specialized image data object for
+// signed short data.
+//
+//*************************************************************************
+// $Id: ossimS16ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimS16ImageData_HEADER
+#define ossimS16ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedS16RemapTable.h>
+
+class OSSIMDLLEXPORT ossimS16ImageData : public ossimImageData
+{
+public:
+   ossimS16ImageData(ossimSource* source,
+                     ossim_uint32 bands = 1);
+
+   ossimS16ImageData(ossimSource* source,
+                    ossim_uint32 bands,
+                    ossim_uint32 width,
+                    ossim_uint32 height);
+
+   ossimS16ImageData(const ossimS16ImageData &rhs);
+   
+
+   /*!
+    * Perform object duplication.
+    */
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+
+
+   bool isNull(ossim_uint32 offset)const;
+   void setNull(ossim_uint32 offset);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+  
+   virtual void setValue(ossim_int32 x, ossim_int32 y, double color);
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, float* buf)const;
+   
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(float* buf);
+   
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */
+   virtual ossim_float64 getMinNormalizedPix() const;
+   
+protected:
+   virtual ~ossimS16ImageData();
+   ossimS16ImageData();
+
+private:
+
+   static const ossimNormalizedS16RemapTable m_remapTable;
+
+TYPE_DATA
+};
+
+inline ossim_float64 ossimS16ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimSFIMFusion.h b/include/ossim/imaging/ossimSFIMFusion.h
new file mode 100644
index 0000000..eef34a9
--- /dev/null
+++ b/include/ossim/imaging/ossimSFIMFusion.h
@@ -0,0 +1,86 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// LICENSE:  See top level LICENSE.txt
+// 
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimSFIMFusion.h 19827 2011-07-15 19:47:30Z gpotts $
+#ifndef ossimSFIMFusion_HEADER
+#define ossimSFIMFusion_HEADER
+#include <ossim/imaging/ossimFusionCombiner.h>
+#include <ossim/imaging/ossimConvolutionSource.h>
+#include <ossim/imaging/ossimImageGaussianFilter.h>
+#include <ossim/base/ossimAdjustableParameterInterface.h>
+
+/**
+ * This class imlements the fusion algorithm from the paper:
+ *
+ * "Smoothing Filter-based Intesity Modulation: a spectral preserve
+ *  image fusion technique for improving spatial details"
+ *
+ *  Pulished in INT. J. Remote Sensing, 2000, Vol. 21 NO. 18, 3461-3472
+ *
+ *  By J. G. LIU
+ *
+ *
+ * Auther: Garrett Potts
+ * LICENSE: LGPL
+ */
+class OSSIM_DLL ossimSFIMFusion : public ossimFusionCombiner,
+                                  public ossimAdjustableParameterInterface
+{
+public:
+   ossimSFIMFusion();
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   virtual void initialize();
+
+   virtual ossimObject* getBaseObject()
+   {
+      return this;
+   }
+   virtual const ossimObject* getBaseObject()const
+   {
+      return this;
+   }
+   virtual void initAdjustableParameters();
+   virtual void adjustableParametersChanged();
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+protected:
+   virtual ~ossimSFIMFusion();
+   void setFilters();
+   bool computeRegression(ossim_float64& slopeResult,
+                          const ossimIpt& origin,
+                          ossimRefPtr<ossimImageData> panData,
+                          ossimRefPtr<ossimImageData> colorData,
+                          ossim_uint32 colorBandIdx);
+   
+   ossim_float64 theLowPassKernelWidth;
+   ossim_uint32 theHighPassKernelWidth;
+   // These are low and high pass filters for the single pan band
+   //
+   ossimRefPtr<ossimImageGaussianFilter> theLowPassFilter;
+   ossimRefPtr<ossimConvolutionSource>   theHighPassFilter;
+   ossimRefPtr<ossimImageData>           theNormLowPassTile;
+   ossimRefPtr<ossimImageData>           theNormHighPassTile;
+   ossimRefPtr<ossimImageData>           theNormColorData;
+
+   NEWMAT::Matrix                        theHighPassMatrix;
+   bool                                  theAutoAdjustScales;
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimSICDToDetectedImage.h b/include/ossim/imaging/ossimSICDToDetectedImage.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimSICDToDetectedImage.h
rename to include/ossim/imaging/ossimSICDToDetectedImage.h
diff --git a/include/ossim/imaging/ossimScalarRemapper.h b/include/ossim/imaging/ossimScalarRemapper.h
new file mode 100644
index 0000000..7601afd
--- /dev/null
+++ b/include/ossim/imaging/ossimScalarRemapper.h
@@ -0,0 +1,110 @@
+//*******************************************************************
+// Copyright (C) 2001 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declartion for ossimScalarRemapper.
+// This class is used to remap image data from one scalar type to another.
+//
+//*******************************************************************
+//  $Id: ossimScalarRemapper.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimScalarRemapper_HEADER
+#define ossimScalarRemapper_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIMDLLEXPORT ossimScalarRemapper : public ossimImageSourceFilter
+{
+public:
+   ossimScalarRemapper();
+   ossimScalarRemapper(ossimImageSource* inputSource,
+                       ossimScalarType outputScalarType);
+
+   virtual void initialize();
+
+   virtual ossimString getLongName()  const;
+   virtual ossimString getShortName() const;
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    *  Returns the output pixel type of the tile source.  This override the
+    *  base class since it simply returns it's input scalar type which is
+    *  not correct with this object.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    *  Returns the output pixel type of the tile source as a string.
+    */
+   virtual ossimString getOutputScalarTypeString() const;
+   
+   /**
+    *  Sets the output scalar type.
+    */
+   virtual void setOutputScalarType(ossimScalarType scalarType);
+   virtual void setOutputScalarType(ossimString scalarType);
+
+   virtual void setPreserveMagnitude(bool value);
+     
+   /**
+    *  Sets the current resolution level.  Returns true on success, false
+    *  on error.
+    */
+   virtual double getNullPixelValue(ossim_uint32 band)  const;
+   virtual double getMinPixelValue(ossim_uint32 band=0) const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0) const;
+
+   /**
+    *  Method to save the state of an object to a keyword list.
+    *  Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+
+   /**
+    *   Override base class so that a disableSource event does not
+    *   reinitialize the object and enable itself.
+    */
+   virtual void propertyEvent(ossimPropertyEvent& event);
+   virtual void refreshEvent(ossimRefreshEvent& event);   
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+protected:
+   virtual ~ossimScalarRemapper();
+
+   /**
+    *  Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+
+   /**
+    *  Deletes allocated memory.  Used by both allocate and destructor.
+    */
+   void destroy();
+   
+   double*                     theNormBuf;
+   ossimRefPtr<ossimImageData> theTile;
+   ossimScalarType             theOutputScalarType;
+
+   bool                        theByPassFlag;
+   bool                        thePreserveMagnitudeFlag;
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimScalarRemapper_HEADER */
diff --git a/include/ossim/imaging/ossimScaleFilter.h b/include/ossim/imaging/ossimScaleFilter.h
new file mode 100644
index 0000000..1a7a3bb
--- /dev/null
+++ b/include/ossim/imaging/ossimScaleFilter.h
@@ -0,0 +1,184 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimScaleFilter.h 22874 2014-08-26 10:21:34Z dburken $
+#ifndef ossimScaleFilter_HEADER
+#define ossimScaleFilter_HEADER
+#include <vector>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/matrix/newmatio.h>
+#include <ossim/imaging/ossimFilter.h>
+
+/*!
+ */
+class OSSIM_DLL ossimScaleFilter : public ossimImageSourceFilter
+{
+public:
+   enum ossimScaleFilterType
+   {
+      ossimScaleFilter_NEAREST_NEIGHBOR = 0,
+      ossimScaleFilter_BOX              = 1,
+      ossimScaleFilter_GAUSSIAN         = 2,
+      ossimScaleFilter_CUBIC            = 3,
+      ossimScaleFilter_HANNING          = 4,
+      ossimScaleFilter_HAMMING          = 5,
+      ossimScaleFilter_LANCZOS          = 6,
+      ossimScaleFilter_MITCHELL         = 7,
+      ossimScaleFilter_CATROM           = 8,
+      ossimScaleFilter_BLACKMAN         = 9,
+      ossimScaleFilter_BLACKMAN_SINC    = 10,
+      ossimScaleFilter_BLACKMAN_BESSEL  = 11,
+      ossimScaleFilter_QUADRATIC        = 12,
+      ossimScaleFilter_TRIANGLE         = 13,
+      ossimScaleFilter_HERMITE          = 14
+   };
+   
+   ossimScaleFilter();
+   ossimScaleFilter(ossimImageSource* inputSource,
+                    const ossimDpt& scaleFactor);
+   
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                   ossim_uint32 resLevel=0);
+   
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+   virtual void initialize();
+   virtual void getDecimationFactor(ossim_uint32 resLevel,
+                                    ossimDpt& result)const
+      {
+         result.makeNan();
+
+         if(resLevel == 0)
+         {
+            result.x = 1.0;
+            result.y = 1.0;
+         }
+      }
+   virtual void getDecimationFactors(vector<ossimDpt>& decimations)const
+      {
+         decimations.push_back(ossimDpt(1.0, 1.0));
+      }
+   virtual ossim_uint32 getNumberOfDecimationLevels()const
+      {
+         // only full res output since we are scaling
+         //
+         return 1;
+      }
+   void setFilterType(ossimScaleFilterType filterType);
+   void setFilterType(ossimScaleFilterType minifyFilterType,
+                      ossimScaleFilterType magnifyFilterType);
+   
+   void setFilterType(const ossimString& minifyType,
+                      const ossimString& magnifyType)
+      {
+         setFilterType(getFilterType(minifyType),
+                       getFilterType(magnifyType));
+      }
+   void setMinifyFilterType(const ossimString& minifyType)
+      {
+         setMinifyFilterType(getFilterType(minifyType));
+      }
+   void setMagnifyFilterType(const ossimString& magnifyType)
+      {
+         setMagnifyFilterType(getFilterType(magnifyType));
+      }
+   void setMinifyFilterType(ossimScaleFilterType filterType)
+      {
+         setFilterType(filterType,
+                       m_MagnifyFilterType);
+      }
+   void setMagnifyFilterType(ossimScaleFilterType filterType)
+      {
+         setFilterType(m_MinifyFilterType,filterType);
+      }
+   ossimString getMinifyFilterTypeAsString()const
+      {
+         return getFilterTypeAsString(m_MinifyFilterType);
+      }
+   ossimString getMagnifyFilterTypeAsString()const
+      {
+         return getFilterTypeAsString(m_MagnifyFilterType);
+      }
+   void setScaleFactor(const ossimDpt& scale);
+   void setBlurFactor(ossim_float64 blur)
+      {
+         m_BlurFactor = blur;
+      }
+   ossim_float64 getBlurFactor()const
+      {
+         return m_BlurFactor;
+      }
+   const ossimDpt& getScaleFactor()const
+      {
+         return m_ScaleFactor;
+      }
+   /*!
+    * Saves the state of this object.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   /*!
+    * Loads the state of this object.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   
+protected:
+   virtual ~ossimScaleFilter();
+  void allocate();
+
+   //! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
+   //! a scale change so that the geometry's projection is modified accordingly.
+   void updateGeometry();
+   
+   ossimRefPtr<ossimImageData> m_BlankTile;
+   ossimRefPtr<ossimImageData> m_Tile;
+   ossimFilter*                m_MinifyFilter;
+   ossimFilter*                m_MagnifyFilter;
+   ossimScaleFilterType        m_MinifyFilterType;
+   ossimScaleFilterType        m_MagnifyFilterType;
+   ossimDpt                    m_ScaleFactor;
+   ossimDpt                    m_InverseScaleFactor;
+   ossimIpt                    m_TileSize;
+   ossimIrect                  m_InputRect;
+   ossim_float64               m_BlurFactor;
+   ossimRefPtr<ossimImageGeometry> m_ScaledGeometry; //!< The input image geometry, altered by the scale
+
+   template <class T>
+   void runFilterTemplate(T dummy,
+                          const ossimIrect& imageRect,
+                          const ossimIrect& viewRect);
+   template <class T>
+   void runHorizontalFilterTemplate(T dummy,
+                                    const ossimRefPtr<ossimImageData>& input,
+                                    ossimRefPtr<ossimImageData>& output);
+   template <class T>
+   void runVerticalFilterTemplate(T dummy,
+                                  const ossimRefPtr<ossimImageData>& input,
+                                  ossimRefPtr<ossimImageData>& output);
+    void runFilter(const ossimIrect& imageRect,
+                   const ossimIrect& viewRect);
+
+   void getSupport(double& x, double& y);
+   const ossimFilter* getHorizontalFilter()const;
+   const ossimFilter* getVerticalFilter()const;
+   
+   ossimString getFilterTypeAsString(ossimScaleFilterType type)const;
+   ossimScaleFilterType getFilterType(const ossimString& type)const;
+   
+   ossimIrect scaleRect(const ossimIrect input,
+                        const ossimDpt& scaleFactor)const;
+   ossimFilter* createNewFilter(ossimScaleFilterType filterType,
+                                ossimScaleFilterType& result);
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimShiftFilter.h b/include/ossim/imaging/ossimShiftFilter.h
new file mode 100644
index 0000000..bf5e6d5
--- /dev/null
+++ b/include/ossim/imaging/ossimShiftFilter.h
@@ -0,0 +1,105 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Filter for shifting input to an output range.  See class description
+// below for more.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimShiftFilter_HEADER
+#define ossimShiftFilter_HEADER 1
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimImageData.h>
+
+/**
+ * @class ossimShiftFilter
+ *
+ * Class to shift/stretch input values to given min/max.  Callers must set
+ * the min, max, null output values.  Input data shifted stretch base on:
+ *
+ * pix = outMin + (inPix - inMin) * (outMax-outMin)/(inMax-inMin)
+ *
+ * See ossim-shift-filter-test.cpp for concrete example of usage.
+ */
+class OSSIMDLLEXPORT ossimShiftFilter : public ossimImageSourceFilter
+{
+public:
+
+   /** default constructor */
+   ossimShiftFilter();
+
+   virtual void initialize();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   /** @return "ossimShiftFilter" */
+   virtual ossimString getClassName() const;
+
+   /** @return "OSSIM shift filter" */
+   virtual ossimString getLongName()  const;
+
+   /** @return "shift filter" */
+   virtual ossimString getShortName() const;
+
+   
+   /** @return The null pixel of the band. */
+   virtual double getNullPixelValue(ossim_uint32 band)const;
+
+   /** @return The min pixel of the band. */
+   virtual double getMinPixelValue(ossim_uint32 band)const;
+   
+   /** @return The max pixel of the band. */
+   virtual double getMaxPixelValue(ossim_uint32 band)const;
+
+   /** @brief Set the null output pixel. */
+   void setNullPixelValue(double null);
+
+   /** @brief Set the min output pixel. */
+   void setMinPixelValue(double min);
+
+   /** @brief Set the max output pixel. */
+   void setMaxPixelValue(double max);
+
+protected:
+
+   /** virtual protected destructor */
+   virtual ~ossimShiftFilter();
+
+private:
+   
+   /** @brief Private to disallow use... */
+   ossimShiftFilter(const ossimShiftFilter&);
+
+   /** @brief Private to disallow use... */
+   ossimShiftFilter& operator=(const ossimShiftFilter&);
+
+   /** @brief Allocates the tile.  Called on first getTile. */
+   void allocate();
+
+   /**
+    * @brief Template to fill the tile.
+    * @param dummy template type.
+    * @param inputTile
+    * @param outputTile
+    */
+   template <class T> void fillTile(T dummy,
+                                    const ossimImageData* inputTile,
+                                    ossimImageData* outputTile) const;
+   
+   ossimRefPtr<ossimImageData> m_tile;
+   double m_min;
+   double m_max;
+   double m_null;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimShiftFilter_HEADER */
diff --git a/include/ossim/imaging/ossimSingleImageChain.h b/include/ossim/imaging/ossimSingleImageChain.h
new file mode 100644
index 0000000..e797492
--- /dev/null
+++ b/include/ossim/imaging/ossimSingleImageChain.h
@@ -0,0 +1,562 @@
+//---
+//
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description: Utility class declaration for a single image chain.
+// 
+//---
+// $Id$
+#ifndef ossimSingleImageChain_HEADER
+#define ossimSingleImageChain_HEADER 1
+
+#include <ossim/base/ossimConstants.h> /* OSSIM_DLL */
+#include <ossim/imaging/ossimBandSelector.h>
+#include <ossim/imaging/ossimBrightnessContrastSource.h>
+#include <ossim/imaging/ossimCacheTileSource.h>
+#include <ossim/imaging/ossimGeoPolyCutter.h>
+#include <ossim/imaging/ossimHistogramRemapper.h>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageSharpenFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <vector>
+
+// Forward class declarations:
+class ossimFilename;
+class ossimGeoPolygon;
+class ossimSrcRecord;
+
+/**
+ * @class ossimSingleImageChain
+ * 
+ * @brief Single image chain class.
+ *
+ * Convenience class for a single image chain.
+ * 
+ * For code example see: ossim/src/test/ossim-single-image-chain-test.cpp  
+ *
+ * Just a clarification on "start of chain" versus "end of chain" in this
+ * file.
+ *
+ * Given chain of:
+ * 1) image handler
+ * 2) band selector (optional)
+ * 3) histogram remapper(optional)
+ * 4) scalar remapper (optional)
+ * 5) resampler cache
+ * 6) resampler
+ * 7) band selector (optional when going one band to three)
+ * 8) chain cache
+ *
+ * The "image handle" is the "start of chain".
+ * The "chain cache" is the "end of chain".
+ */
+class OSSIM_DLL ossimSingleImageChain : public ossimImageChain
+{
+public:
+
+   /** default constructor */
+   ossimSingleImageChain();
+
+   /** Constructor that takes flags.*/
+   ossimSingleImageChain(bool addHistogramFlag,
+                         bool addResamplerCacheFlag,
+                         bool addChainCacheFlag,
+                         bool remapToEightBitFlag,
+                         bool threeBandFlag,
+                         bool threeBandReverseFlag,
+                         bool brightnessContrastFlag=false,
+                         bool sharpenFlag=false,
+                         bool geoPolyCutterFlag=false);
+   
+   /** virtual destructor */
+   virtual ~ossimSingleImageChain();
+
+   /**
+    * @brief reset method
+    * This deletes all links in the chain, zero's out all data members, and
+    * sets all flags back to default.
+    */
+   void reset();
+   
+   /**
+    * @brief open method that takes an image file.
+    *
+    * Opens file and creates a simple chain with ossimImageHandler.
+    *
+    * @param file File to open.
+
+    * @param openOverview If true image handler will attempt to open overview.
+    * Note that if you are planning on doing a rendered chain or want to go
+    * between res levels you should set this to true.  default = true
+    *
+    * @return true on success, false on error.
+    *
+    * @note This will close previous chain if one was opened.
+    */
+   bool open(const ossimFilename& file, bool openOverview=true);
+
+   /**
+    * @brief open method that takes an ossimSrcRecord.
+    *
+    * Opens file and creates a simple chain with ossimImageHandler.
+    *
+    * @return true on success, false on error.
+    *
+    * @note This will close previous chain if one was opened.
+    */
+   bool open(const ossimSrcRecord& src);
+   
+   /** @return true if image handler is opened. */
+   bool isOpen() const;
+
+   /** @brief close method to delete the image handler. */
+   void close();
+
+   /** @return The filename of the image. */
+   ossimFilename getFilename() const;
+
+   /**
+    * @brief Create a rendered image chain.
+    *
+    * Typical usage is to call this after "open" method returns true like:
+    * if ( myChain->open(myFile) == true )
+    * {
+    *    myChain->createRenderedChain();
+    *    code-goes-here();
+    * }
+    *
+    * Typical chain is:
+    * 
+    * 1) image handler
+    * 2) band selector (optional)
+    * 3) histogram remapper(optional)
+    * 4) scalar remapper (optional)
+    * 5) resampler cache
+    * 6) resampler
+    * 7) band selector (optional when going one band to three)
+    * 8) chain cache
+    *
+    * NOTES:
+    * 1) Cache on left hand side of resampler is critical to speed if you
+    *    have the ossimImageRender enabled.
+    *    
+    * 2) If doing a sequential write where tiles to the right of the
+    *    resampler will not be revisited the chain cache could be
+    *    disabled to save memory.
+    */
+   void createRenderedChain();
+
+   /**
+    * @brief Create a rendered image chain that takes an ossimSrcRecord.
+    */
+   void createRenderedChain(const ossimSrcRecord& src);
+
+   /**
+    * @brief Adds an image handler for file.
+    * 
+    * @param file File to open.
+    *
+    * @param openOverview If true image handler will attempt to open overview.
+    * Note that if you are planning on doing a rendered chain or want to go
+    * between res levels you should set this to true. default = true
+    *
+    * @return true on success, false on error.
+    */
+   bool addImageHandler(const ossimFilename& file,
+                        bool openOverview=true);
+
+   /**
+    * @brief Adds an image handler from src record.
+    *
+    * This take an ossimSrcRecord which can contain a supplemental directory
+    * to look for overviews.
+    * 
+    * @param rec Record to open.
+    * @return true on success, false on error.
+    */
+   bool addImageHandler(const ossimSrcRecord& src);
+   
+   /** @brief Adds a band selector to the end of the chain. */
+   void addBandSelector();
+
+   /**
+    * @brief Adds a band selector.
+    *
+    * This takes an ossimSrcRecord which can contain a band selection list.
+    * 
+    * @param src Record to initialize band selector from.
+    * 
+    */
+   void addBandSelector(const ossimSrcRecord& src);
+
+   /** @brief Adds histogram remapper to the chain. */
+   void addHistogramRemapper();
+
+   /**
+    * @brief Adds a band selector.
+    *
+    * This takes an ossimSrcRecord which can contain a histogram
+    * operation to be performed.
+    * 
+    * @param src Record to initialize band selector from.
+    */
+   void addHistogramRemapper(const ossimSrcRecord& src);
+
+   /**
+    * @brief Adds a new cache to the current end of the chain.
+    * @return Pointer to cache.
+    */
+   ossimRefPtr<ossimCacheTileSource> addCache();
+
+   /** @brief Adds a resampler (a.k.a. "renderer") to the end of the chain. */
+   void addResampler();
+
+   /**
+    * @brief Adds a resampler (a.k.a. "renderer") to the end of the chain.
+    * This method in turn calls "addResampler()".
+    */
+   void addRenderer();
+
+   /**
+    * @brief Adds scalar remapper either to the left of the resampler cache
+    * or at the end of the chain if not present.
+    */
+   void addScalarRemapper();
+
+   /**
+    * @brief Adds brightness contrast filter the end of the chain if not
+    * present.
+    */
+   void addBrightnessContrast();
+
+   /**
+    * @brief Adds sharpen filter the end of the chain if not present.
+    */
+   void addSharpen();
+
+
+   /**
+   *
+   * @brief Adds a geo polycutter to allow for cropping imagery or nulling out
+   * regions.  This has no affect on modification of the bounds
+   *
+   */
+   void addGeoPolyCutter();
+
+   void addGeoPolyCutterPolygon(const vector<ossimGpt>& polygon);
+   void addGeoPolyCutterPolygon(const ossimGeoPolygon& polygon);
+
+   /**
+    * @return ossimRefPtr containing the image handler.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimImageHandler> getImageHandler() const;
+
+   /**
+    * @return ossimRefPtr containing the image handler.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimImageHandler> getImageHandler();
+
+   /**
+    * @return ossimRefPtr containing  the band selector.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimBandSelector> getBandSelector() const;
+
+   /**
+    * @return ossimRefPtr containing  the band selector.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimBandSelector> getBandSelector();
+
+   /**
+    * @return ossimRefPtr containing the histogram remapper.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimHistogramRemapper> getHistogramRemapper() const;
+
+   /**
+    * @return ossimRefPtr containing the histogram remapper.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimHistogramRemapper> getHistogramRemapper();
+
+   /**
+    * @return  ossimRefPtr containing the resampler cache.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimCacheTileSource> getResamplerCache() const;
+
+   /**
+    * @return  ossimRefPtr containing the resampler cache.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimCacheTileSource> getResamplerCache();
+
+   /**
+    * @return ossimRefPtr containing the resampler (a.k.a. "renderer").
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimImageRenderer> getImageRenderer() const;
+
+   /**
+    * @return ossimRefPtr containing the resampler (a.k.a. "renderer").
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimImageRenderer> getImageRenderer();
+
+   /**
+    * @return ossimRefPtr containing the scalar remapper.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimScalarRemapper> getScalarRemapper() const;
+
+   /**
+    * @return ossimRefPtr containing the scalar remapper.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimScalarRemapper> getScalarRemapper();
+
+   /**
+    * @return ossimRefPtr containing the brightness contrast filter.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimBrightnessContrastSource>
+      getBrightnessContrast() const;
+
+   /**
+    * @return ossimRefPtr containing the brightness contrast filter.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimBrightnessContrastSource> getBrightnessContrast();
+
+   /**
+    * @return ossimRefPtr containing the sharpen filter.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimImageSharpenFilter> getSharpenFilter() const;
+
+   /**
+    * @return ossimRefPtr containing the sharpen.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimImageSharpenFilter> getSharpenFilter();
+   
+   /**
+    * @return ossimRefPtr containing the chain cache.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<const ossimCacheTileSource> getChainCache() const;
+
+   /**
+    * @return ossimRefPtr containing the chain cache.
+    * @note Can contain a null pointer so callers should validate.
+    */
+   ossimRefPtr<ossimCacheTileSource> getChainCache();
+
+   /**
+    * @brief If flag is true a histogram will be added to the chain at create time.
+    * @param flag
+    */
+   void setAddHistogramFlag(bool flag);
+
+   /**
+    * @brief Gets the add histogram flag.
+    * @return true or false.
+    */
+   bool getAddHistogramFlag() const;
+
+   /**
+    * @brief If flag is true a resampler cache will be added to the chain at create time.
+    * This is a cache to the left of the resampler.
+    * @param flag
+    */
+   void setAddResamplerCacheFlag(bool flag);
+
+   /**
+    * @brief Gets the add resampler cache flag.
+    * @return true or false.
+    */
+   bool getAddResamplerCacheFlag() const;
+
+   /**
+    * @brief If flag is true a chain cache will be added to the chain at create time.
+    * This is a cache at the end of the chain.
+    * @param flag
+    */
+   void setAddChainCacheFlag(bool flag);
+
+   /**
+    * @brief Gets the add chain cache flag.
+    * @return true or false.
+    */
+   bool getAddChainCacheFlag() const;
+
+   /**
+    * @brief Sets remap to eigth bit flag.
+    * @param flag
+    */
+   void setRemapToEightBitFlag(bool flag);
+
+   /**
+    * @brief Get the remap to eight bit flag.
+    * @return true or false.
+    */
+   bool getRemapToEightBitFlag() const;
+   
+   /**
+    * @brief Sets the three band flag.
+    *
+    * If set will for a three band output.  So if one band it will duplicate
+    * so that rgb = b1,b1,b1. An attempt is made to derive rgb bands from the
+    * image handler.
+    * 
+    * @param flag
+    */
+   void setThreeBandFlag(bool flag);
+
+   /**
+    * @brief Get the three band flag.
+    * @return true or false.
+    */
+   bool getThreeBandFlag() const;
+   
+   /**
+    * @brief Sets the three band reverse flag.
+    *
+    * @param flag
+    */
+   void setThreeBandReverseFlag(bool flag);
+
+   /**
+    * @brief Get the three band reverse flag.
+    * @return true or false.
+    */
+   bool getThreeBandReverseFlag() const;
+   
+   /**
+    * @brief Sets the brightness contrast flag.
+    *
+    * @param flag
+    */
+   void setBrightnessContrastFlag(bool flag);
+
+   /**
+    * @brief Get the brightness constrast flag.
+    * @return true or false.
+    */
+   bool getBrightnessContrastFlag() const;
+
+   /**
+    * @brief Sets the sharpenflag.
+    *
+    * @param flag
+    */
+   void setSharpenFlag(bool flag);
+
+   /**
+    * @brief Get the sharpen flag.
+    * @return true or false.
+    */
+   bool getSharpenFlag() const;
+
+   /**
+    * @brief Utility method to force 3 band output.
+    *
+    * Set band selector to a three band (rgb) output. If image has less than
+    * three bands it will set to rgb = b1,b1,b1.  If image has three or
+    * more bands the band selector will be see to rgb = b1, b2, b3.
+    *
+    * @note This will not work unless the image handler is initialized.
+    */
+   void setToThreeBands();
+   
+   /**
+    * @brief Utility method to set to 3 bandsand reverse them.  This is
+    * mainly used by NITF and Lndsat color data where the bands are in bgr
+    * format and you want it in rgb combination.  If image has less than
+    * three bands it will set to rgb = b1,b1,b1.  If image has three or
+    * more bands the band selector will be see to rgb = b3, b2, b1.
+    *
+    * @note This will not work unless the image handler is initialized.
+    */
+   void setToThreeBandsReverse();
+
+   /**
+    * @brief method to set band selector.
+    *
+    * This will set the band selection to bandList.  If a band selector is
+    * not in the chain yet it will be added.
+    *
+    * @param bandList The list of bands.
+    */
+   void setBandSelection(const std::vector<ossim_uint32>& bandList);
+
+   void setDefaultBandSelection();
+   
+   /**
+    * @brief Convenience method to return the scalar type of the image handler.
+    * 
+    * @return Scalar type of the image handler.
+    *
+    * This can return OSSIM_SCALAR_UNKNOWN if the image handler has not been
+    * set yet.  Also, this is NOT the same as calling getOutputScalarType
+    * which could have a different scalar type than the image if the
+    * m_remapToEightBitFlag has been set.
+    */
+   ossimScalarType getImageHandlerScalarType() const;
+
+   /**
+    * @brief Convenience method to open the histogram and apply a default
+    * stretch.
+    *
+    * This will only work if the image is open, there is a histogram remapper
+    * in the chain, and there was a histogram created.
+    * 
+    * Valid stretches (from ossimHistogramRemapper.h):
+    *
+    @verbatim
+      ossimHistogramRemapper::LINEAR_ONE_PIECE
+      ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN
+      ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN
+      ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN
+      ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX
+    @endverbatim
+    *
+    * @return true on success, false on error.
+    */
+   bool openHistogram( ossimHistogramRemapper::StretchMode mode );
+
+private:
+
+   /**  Pointers to links in chain. */
+   ossimRefPtr<ossimImageHandler>             m_handler;
+   ossimRefPtr<ossimBandSelector>             m_bandSelector;
+   ossimRefPtr<ossimHistogramRemapper>        m_histogramRemapper;
+   ossimRefPtr<ossimBrightnessContrastSource> m_brightnessContrast;
+   ossimRefPtr<ossimImageSharpenFilter>       m_sharpen;   
+   ossimRefPtr<ossimScalarRemapper>           m_scalarRemapper;
+   ossimRefPtr<ossimCacheTileSource>          m_resamplerCache;
+   ossimRefPtr<ossimImageRenderer>            m_resampler;
+   ossimRefPtr<ossimGeoPolyCutter>            m_geoPolyCutter;
+   ossimRefPtr<ossimCacheTileSource>          m_chainCache;
+
+   /** control flags */
+   bool m_addHistogramFlag;
+   bool m_addResamplerCacheFlag;
+   bool m_addChainCacheFlag;
+   bool m_remapToEightBitFlag;
+   bool m_threeBandFlag;
+   bool m_threeBandReverseFlag;
+   bool m_brightnessContrastFlag;
+   bool m_sharpenFlag;
+   bool m_geoPolyCutterFlag;
+
+};
+
+#endif /* #ifndef ossimSingleImageChain_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimSlopeFilter.h b/include/ossim/imaging/ossimSlopeFilter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimSlopeFilter.h
rename to include/ossim/imaging/ossimSlopeFilter.h
diff --git a/include/ossim/imaging/ossimSrtmTileSource.h b/include/ossim/imaging/ossimSrtmTileSource.h
new file mode 100644
index 0000000..7ddde03
--- /dev/null
+++ b/include/ossim/imaging/ossimSrtmTileSource.h
@@ -0,0 +1,74 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Image handler class for a Shuttle Radar Topography Mission (SRTM) file.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimSrtmTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+#ifndef ossimSrtmTileSource_HEADER
+#define ossimSrtmTileSource_HEADER
+
+#include <ossim/imaging/ossimGeneralRasterTileSource.h>
+#include <ossim/support_data/ossimSrtmSupportData.h>
+
+
+class OSSIMDLLEXPORT ossimSrtmTileSource : public ossimGeneralRasterTileSource
+{
+public:
+   ossimSrtmTileSource();
+
+   virtual ossimString getShortName() const;
+   virtual ossimString getLongName()  const;
+
+   virtual bool open();
+
+   //! Returns the image geometry object associated with this tile source or NULL if not defined.
+   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * @return true on success, false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = NULL);
+
+   /**
+    * @brief Gets a property.
+    * @param The name of the property to get.
+    * @return The property if found.
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+
+   /**
+    * @brief Adds property names to array.
+    * @param propertyNames Array to populate with property names.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+protected:
+   virtual ~ossimSrtmTileSource();
+   ossimSrtmSupportData m_SrtmSupportData;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimStreamReaderInterface.h b/include/ossim/imaging/ossimStreamReaderInterface.h
new file mode 100644
index 0000000..de40e76
--- /dev/null
+++ b/include/ossim/imaging/ossimStreamReaderInterface.h
@@ -0,0 +1,50 @@
+//----------------------------------------------------------------------------
+// File: ossimStreamReaderInterface.h
+// 
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class interface ossimMetadataInterface.
+//
+// Has pure virtual "open" method that derived classes must
+// implement to be concrete.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimStreamReaderInterface_HEADER
+#define ossimStreamReaderInterface_HEADER 1
+
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+#include <string>
+
+/** @class ossimStreamReaderInterface */
+class ossimStreamReaderInterface
+{
+public:
+   
+   /** @brief default constructor */
+   ossimStreamReaderInterface(){}
+
+   /** @brief virtual destructor. */
+   virtual ~ossimStreamReaderInterface(){}
+
+   /**
+    *  @brief Pure virtual open method that takes a stream.
+    *  @param str Open stream to image.
+    *  @param connectionString
+    *  @return true on success, false on error.
+    */
+   virtual bool open( std::shared_ptr<ossim::istream>& str,
+                      const std::string& connectionString ) = 0;
+   
+#if 0
+   virtual bool open( std::istream* str,
+                      std::streamoff restartPosition,
+                      bool youOwnIt ) = 0;
+#endif
+};
+
+#endif /* #ifndef ossimStreamReaderInterface_HEADER */
diff --git a/include/ossim/imaging/ossimSubImageTileSource.h b/include/ossim/imaging/ossimSubImageTileSource.h
new file mode 100644
index 0000000..152a06a
--- /dev/null
+++ b/include/ossim/imaging/ossimSubImageTileSource.h
@@ -0,0 +1,90 @@
+//*****************************************************************************
+// FILE: ossimSubImageTileSource.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimSubImageTileSource.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimSubImageTileSource.h 22233 2013-04-15 15:12:54Z gpotts $
+
+#ifndef ossimSubImageTileSource_HEADER
+#define ossimSubImageTileSource_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/*!****************************************************************************
+ *
+ *  CLASS: ossimSubImageTileSource
+ *
+ *  This tile source permits specifying an offset that is to be applied to the
+ *  tile origin for all getTile() requests. It is intended for converting
+ *  a full-image space coordinate to a sub-image coordinate.
+ *
+ *****************************************************************************/
+class OSSIM_DLL ossimSubImageTileSource : public ossimImageSourceFilter
+{
+public:
+   /*!
+    * Default constructor initializes the sub-image offset to zero.
+    */
+   ossimSubImageTileSource();
+
+   /*!
+    * Constructor accepts an input source pointer. Offset is defaulted to (0,0).
+    */
+   ossimSubImageTileSource(ossimImageSource* inputSource);
+
+   /*!
+    * Constructs with specified input source and offset.
+    */
+   ossimSubImageTileSource(ossimImageSource* inputSource,
+                           const ossimIpt&   offset);
+
+   /*!
+    * Permits setting the image's offset relative to the full image space.
+    */
+   void setSubImageOffset(const ossimIpt& offset) { theSubImageOffset=offset; }
+
+   ossimIpt getSubImageOffset()const{ return theSubImageOffset;}
+ 
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32  rr_level=0);
+
+   /*!
+    * Fetches the sub-image's bounding rect in FULL-IMAGE SPACE.
+    */
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
+   
+   /*!
+    * Fetches the sub-image's valid image vertices in FULL-IMAGE SPACE.
+    */
+   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
+                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+                                      ossim_uint32 resLevel=0)const;
+
+   virtual void initialize();
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+private:
+   virtual ~ossimSubImageTileSource();
+   
+   ossimIpt                    theSubImageOffset;
+   ossimRefPtr<ossimImageData> theTile;
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimTableRemapper.h b/include/ossim/imaging/ossimTableRemapper.h
new file mode 100644
index 0000000..718d699
--- /dev/null
+++ b/include/ossim/imaging/ossimTableRemapper.h
@@ -0,0 +1,97 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Table remapper class declaration.
+// 
+// Takes input tile, remaps it through a table, then output tile in the desired
+// scalar type.
+//
+// Two modes one that works on native remap tables, that being of the same
+// scalar type (like ossim_uint8) of the input connection, and another that
+// uses a normalized remap table (more scalar independent).
+//
+//*************************************************************************
+// $Id: ossimTableRemapper.h 22479 2013-11-12 02:18:55Z dburken $
+#ifndef ossimTableRemapper_HEADER
+#define ossimTableRemapper_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+class OSSIMDLLEXPORT ossimTableRemapper : public ossimImageSourceFilter
+{
+public:
+   enum RemapTableType
+   {
+      UKNOWN     = 0,
+      NATIVE     = 1,
+      MIN_MAX    = 2,  // the data is native but must use min max for scale
+      NORMALIZED = 3
+   };
+
+   /** default constructor */
+   ossimTableRemapper();
+
+   virtual ossimScalarType getOutputScalarType() const;
+    
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+
+
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   
+   virtual ostream& print(ostream& os) const;
+
+   friend ostream& operator << (ostream& os,  const ossimTableRemapper& tr);
+
+protected:
+   /** virtual destructor */
+   virtual ~ossimTableRemapper();
+
+   ossimRefPtr<ossimImageData> theTile;
+   ossimRefPtr<ossimImageData> theTmpTile;
+   std::vector<ossim_uint8>    theTable;
+   ossim_float64*  theNormBuf;
+   ossim_uint32    theTableBinCount;
+   ossim_uint32    theTableBandCount;
+   RemapTableType  theTableType;
+   ossimScalarType theInputScalarType;
+   ossimScalarType theOutputScalarType;
+   
+   void allocate(const ossimIrect& rect);
+   void destroy();
+
+   void remapFromNativeTable(ossimRefPtr<ossimImageData>& inputTile);
+
+   template <class T> void remapFromNativeTable(
+      T dummy,
+      ossimRefPtr<ossimImageData>& inputTile);
+
+   void remapFromNormalizedTable(ossimRefPtr<ossimImageData>& inputTile);
+
+   template <class T> void dumpTable(T dummy, ostream& os) const;
+
+   // Do not allow copy constructor, operator=.
+   ossimTableRemapper(const ossimTableRemapper& tr);
+   ossimTableRemapper& operator=(const ossimTableRemapper& tr);
+   
+   TYPE_DATA
+};
+
+#endif  /* #ifndef ossimTableRemapper_HEADER */
diff --git a/include/ossim/imaging/ossimTiffOverviewBuilder.h b/include/ossim/imaging/ossimTiffOverviewBuilder.h
new file mode 100644
index 0000000..4c3179d
--- /dev/null
+++ b/include/ossim/imaging/ossimTiffOverviewBuilder.h
@@ -0,0 +1,304 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for TiffOverviewBuilder.
+//
+//*******************************************************************
+//  $Id: ossimTiffOverviewBuilder.h 22232 2013-04-13 20:06:19Z dburken $
+
+#ifndef ossimTiffOverviewBuilder_HEADER
+#define ossimTiffOverviewBuilder_HEADER
+
+#include <vector>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+
+#include <ossim/imaging/ossimOverviewBuilderBase.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+
+#include <tiffio.h>
+
+class ossimConnectableObject;
+class ossimFilename;
+class ossimImageGeometry;
+
+class OSSIM_DLL ossimTiffOverviewBuilder
+   :
+      public ossimOverviewBuilderBase
+{
+public:
+
+   enum
+   {
+      DEFAULT_COMPRESS_QUALITY=75
+   };
+
+   /** default constructor */
+   ossimTiffOverviewBuilder();
+   
+   /** virtual destructor */
+   virtual ~ossimTiffOverviewBuilder();
+
+   /**
+    * Supports BOX or NEAREST NEIGHBOR.  When indexed you should probably use nearest neighbor
+    */ 
+   void setResampleType(ossimFilterResampler::ossimFilterResamplerType resampleType);
+   
+   /**
+    *  Builds overview file and sets "theOutputFile" to that of
+    *  the overview_file.
+    *
+    *  @param overview_file The overview file name to output.
+    *
+    *  @param copy_all  If set to true the entire image will be
+    *  copied.  This can be used to convert an image to a tiled tif.
+    *  
+    *  @return trueon success, false on error.
+    */
+   bool buildOverview(const ossimFilename& overview_file,
+                      bool copy_all=false);
+
+   /**
+    * Calls buildOverview.  This method uses "theOutputFile" for the file
+    * name.
+    *
+    * If the copy_all flag is set the entire image will be copied.  This can
+    * be used to convert an image to a tiled tif.
+    *
+    * @return true on success, false on error.
+    *
+    * @note If setOutputFile was not called the output name will be derived
+    * from the image name.  If image was "foo.tif" the overview file will
+    * be "foo.ovr".
+    */
+   virtual bool execute();
+
+   /**
+    *  Sets the compression type to use when building overviews.
+    *  
+    *  @param compression_type Current supported types:
+    * - COMPRESSION_JPEG
+    * - COMPRESSION_LZW
+    * - COMPRESSION_DEFLATE
+    * - COMPRESSION_PACKBITS
+    * - COMPRESSION_NONE (default)
+    */
+   void setCompressionType(ossim_uint16 compression_type);
+
+   /**
+    *  Sets the compression quality for use when using a compression type
+    *  of COMPRESSION_JPEG.
+    *
+    *  @param quality Range 1 to 100 with 100 being best quality.
+    */
+   void setJpegCompressionQuality(ossim_int32 quality);
+
+   /**
+    * @brief Method to return copy all flag.
+    * @return The copy all flag.  If true all data will be written to the
+    * overview including R0.
+    */
+   bool getCopyAllFlag() const;
+
+   /**
+    * @brief Sets internal overviews flag.
+    * @param flag If true, and input source is tiff format, overviews will be
+    * built internally.
+    */
+   void setInternalOverviewsFlag(bool flag);
+
+   /** @return The intenal overview flag. */
+   bool getInternalOverviewsFlag() const;
+
+   /**
+    * @brief Sets theCopyAllFlag.
+    * @param flag The flag. If true all data will be written to the
+    * overview including R0.
+    */
+   void setCopyAllFlag(bool flag);
+
+   /** @return ossimObject* to this object. */
+   virtual ossimObject* getObject();
+
+   /**
+    * @return const ossimObject* to this object.
+    */
+   virtual const ossimObject* getObject() const;
+
+   /**
+    * @return true if input is an image handler.
+    */
+   virtual bool canConnectMyInputTo(ossim_int32 index,
+                                    const ossimConnectableObject* obj) const;
+
+   /**
+    * @brief Sets the input to the builder. Satisfies pure virtual from
+    * ossimOverviewBuilderBase.
+    *
+    * @param imageSource The input to the builder.
+    *
+    * @return True on successful initializion, false on error.
+    */
+   virtual bool setInputSource(ossimImageHandler* imageSource);
+   
+   /**
+    * @brief Sets the output filename.
+    * Satisfies pure virtual from ossimOverviewBuilderBase.
+    * @param file The output file name.
+    */
+   virtual void  setOutputFile(const ossimFilename& file);
+
+   /**
+    * @brief Gets the output file name. (pure virtual)
+    *
+    * @return The output file name or ossimFilename::NIL if it was not set
+    * yet and the image handle has not been initialized.
+    *
+    * @note This is non-const as a call to this may force initialization of
+    * overview builder output file name if the it was not set already.
+    *
+    * @note This will return ossimFilename::NIL unless one of was called,
+    * setInputSource or setOutputFile.
+    */
+   virtual ossimFilename getOutputFile() const;
+
+   void setOutputTileSize(const ossimIpt& tileSize);
+
+   /**
+    * @brief Sets the overview output type.
+    *
+    * Satisfies pure virtual from ossimOverviewBuilderBase.
+    * 
+    * Currently handled types are:
+    * "ossim_tiff_nearest" and "ossim_tiff_box"
+    *
+    * @param type This should be the string representing the type.  This method
+    * will do nothing if type is not handled and return false.
+    *
+    * @return true if type is handled, false if not.
+    */
+   virtual bool setOverviewType(const ossimString& type);
+
+   /**
+    * @brief Gets the overview type.
+    * Satisfies pure virtual from ossimOverviewBuilderBase.
+    * @return The overview output type as a string.
+    */
+   virtual ossimString getOverviewType() const;
+
+   /**
+    * @brief Method to populate class supported types.
+    * Satisfies pure virtual from ossimOverviewBuilderBase.
+    * @param typeList List of ossimStrings to add to.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+
+   /**
+    * @brief Method to set properties.
+    * @param property Property to set.
+    *
+    * @note Currently supported property:
+    * name=levels, value should be list of levels separated by a comma with
+    * no spaces. Example: "2,4,8,16,32,64"
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /**
+    * @brief Method to populate the list of property names.
+    * @param propertyNames List to populate.  This does not clear the list
+    * just adds to it.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+  
+private:
+
+   /**
+    *  Copy the full resolution image data to the output tif image.
+    */
+  bool writeR0(TIFF* tif);
+
+   /**
+    *  Write reduced resolution data set to the tif file.
+    *
+    *  @param firstRestLevel used to tell method that if a histogram is needed, do it on
+    *  that res level.
+    */
+   bool writeRn(ossimImageHandler* imageHandler,
+                TIFF* tif,
+                ossim_uint32 resLevel,
+                bool firstResLevel);
+   
+   /**
+    *  Set the tiff tags for the appropriate resLevel.  Level zero is the
+    *  full resolution image.
+    *
+    *  @param tif Pointer to the tif file.
+    *  @param outputRect The dimensions (zero based) of res set.
+    *  @param rrds_level The current reduced res level.
+    */
+   bool setTags(TIFF* tif,
+                const ossimIrect& outputRect,
+                ossim_int32 resLevel) const;
+
+   /**
+    *  Writes geotiff tags.
+    *  @param geom
+    *  @param boundingRect
+    *  @param resLevel Zero base, 0 being full res.
+    *  @param tif
+    *  @return true on success, false on error.
+    */
+   bool setGeotiffTags(const ossimImageGeometry* geom,
+                       const ossimDrect& boundingRect,
+                       ossim_uint32 resLevel,
+                       TIFF* tif);
+
+   TIFF* openTiff( const ossimString& filename ) const;
+
+   void closeTiff(TIFF* tif);
+
+   /**
+    * @returns true if m_internalOverviewsFlag and input image supports
+    * building internal overviews.  Currently only tiff reader.
+    */
+   bool buildInternalOverviews() const;
+
+   /**
+    * @return true if m_copyAllFlag is set and build internal overviews is not
+    * set.
+    */
+   bool copyR0() const;
+
+   // Disallow these...
+   ossimTiffOverviewBuilder(const ossimTiffOverviewBuilder& source);
+   ossimTiffOverviewBuilder& operator=(const ossimTiffOverviewBuilder& rhs); 
+
+   std::vector<ossim_uint8>                           m_nullDataBuffer;
+   ossim_int32                                        m_bytesPerPixel;
+   ossim_int32                                        m_bitsPerSample;
+   ossim_int32                                        m_tileWidth;
+   ossim_int32                                        m_tileHeight;
+   ossim_int32                                        m_tileSizeInBytes;
+   ossim_int32                                        m_sampleFormat;
+   ossim_int32                                        m_currentTiffDir;
+   ossim_uint16                                       m_tiffCompressType;
+   ossim_int32                                        m_jpegCompressQuality;
+   ossimFilterResampler::ossimFilterResamplerType     m_resampleType;
+   std::vector<double>                                m_nullPixelValues;
+   bool                                               m_copyAllFlag;
+   ossimString                                        m_tempExtension;
+   bool                                               m_outputTileSizeSetFlag;
+   bool                                               m_internalOverviewsFlag;
+
+TYPE_DATA   
+};
+   
+#endif
diff --git a/include/ossim/imaging/ossimTiffTileSource.h b/include/ossim/imaging/ossimTiffTileSource.h
new file mode 100644
index 0000000..3fc96e7
--- /dev/null
+++ b/include/ossim/imaging/ossimTiffTileSource.h
@@ -0,0 +1,382 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//          Frank Warmerdam (warmerdam at pobox.com)
+//
+// Description:
+//
+// Contains class declaration for ossimTiffTileSource.
+// ossimTiffTileSource  is derived from ImageHandler which is derived from
+// TileSource.
+//*******************************************************************
+// $Id$
+
+#ifndef ossimTiffTileSource_HEADER
+#define ossimTiffTileSource_HEADER 1
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimIrect.h>
+#include <vector>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+
+/*
+ * TIFF is defined as an incomplete type to hide the tiff library's internal
+ * data structures from clients.
+ */
+typedef struct tiff TIFF;  
+
+class ossimImageData;
+class ossimTiffOverviewTileSource;
+class TiffStreamAdaptor;
+class OSSIMDLLEXPORT ossimTiffTileSource : public ossimImageHandler
+{
+public:
+  friend class TiffStreamAdaptor; 
+   enum ReadMethod
+   {
+      UNKNOWN,
+      READ_RGBA_U8_TILE,
+      READ_RGBA_U8_STRIP,
+      READ_RGBA_U8A_STRIP,
+      READ_SCAN_LINE,
+      READ_TILE,
+      READ_U16_STRIP
+   };
+
+   ossimTiffTileSource();
+
+   virtual ossimString getLongName()  const;
+   virtual ossimString getShortName() const;
+
+   /**
+    *  Returns true if the image_file can be opened and is a valid tiff file.
+    */
+   virtual bool open(const ossimFilename& image_file);
+
+   /**
+    *  @brief This open takes a stream and stores/captures the shared pointer
+    *  on success.
+    *  @param str Open stream to image.
+    *  @param connectionString Stored on success as the file name.
+    *  @return true on success, false on error.
+    */
+   bool open( std::shared_ptr<ossim::istream>& str,
+              const std::string& connectionString );
+
+   virtual void close();
+   
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper left
+    *  corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+   /**
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   virtual ossim_uint32 getNumberOfOutputBands () const;
+
+   /**
+    * @brief Indicates whether or not the image handler can control output
+    * band selection via the setOutputBandList method.
+    *
+    * Overrides: ossimImageHandler::isBandSelector
+    *
+    * @return true
+    */
+   virtual bool isBandSelector() const;
+
+   /**
+    * @brief If the image handler "isBandSeletor()" then the band selection
+    * of the output chip can be controlled.
+    *
+    * Overrides: ossimImageHandler::setOutputBandList
+    * 
+    * @return true on success, false on error.
+    */
+   virtual bool setOutputBandList(const std::vector<ossim_uint32>& band_list);
+
+   /** @brief Initializes bandList to the zero based order of output bands. */
+   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
+   
+   /**
+    *  Returns the number of lines in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
+   
+   /**
+    *  Returns the number of samples in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+
+   /**
+    *  Returns the number of image file directories in the tiff image.
+    */
+   virtual ossim_uint32 getNumberOfDirectories() const;
+   
+   /**
+    * Returns the number of reduced resolution data sets (rrds).
+    * Notes:
+    *
+    * - The full res image is counted as a data set so an image with no
+    *   reduced resolution data set will have a count of one.
+    * - This method counts R0 as a res set even if it does not have one.
+    *   This was done deliberately so as to not screw up code down the
+    *   line.
+    */
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual bool isOpen()const;
+
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+   
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /**
+    *  Returns true if the first directory of the tiff image did not have
+    *  the reduced resolution file type set.
+    */
+   bool hasR0() const;
+  
+   virtual ossim_float64 getMinPixelValue(ossim_uint32 band=0)const;
+   virtual ossim_float64 getMaxPixelValue(ossim_uint32 band=0)const;
+   virtual ossim_float64 getNullPixelValue(ossim_uint32 band=0)const;
+   
+   virtual bool isValidRLevel(ossim_uint32 resLevel) const;
+
+   /**
+    * @return The tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width, which can be different than the
+    * internal image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * @return The tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileHeight which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   void setApplyColorPaletteFlag(bool flag);
+   bool getApplyColorPaletteFlag()const;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   bool isColorMapped() const;
+   
+   virtual std::ostream& print(std::ostream& os) const;
+
+   TIFF* tiffPtr()
+   {
+      return theTiffPtr;
+   }
+#if 0
+   /**
+    * @brief Method to get the image geometry object associated with this
+    * image.
+    *
+    * The geometry contains full-to-local image transform as well as
+    * projection (image-to-world).
+    *
+    * @return ossimImageGeometry* or null if not defined.
+    */
+   virtual ossimImageGeometry* getImageGeometry();
+#endif   
+protected:
+   virtual ~ossimTiffTileSource();
+   /**
+    *  Returns true if no errors initializing object.
+    *
+    *  Notes:
+    *  - Callers of this method must ensure "theTiffPtr" data member
+    *    is initialized.
+    *  - This method was added to consolidate object initialization code
+    *    between constructor and public open method.
+    */
+   bool open();
+
+   // Must be protected for derived ossimTerraSarTiffReader.
+   TIFF* theTiffPtr; 
+
+
+private:
+
+   /**
+    *  Adjust point to even tile boundary.  Assumes 0,0 origin.
+    *  Shifts in the upper left direction.
+    */
+   void adjustToStartOfTile(ossimIpt& pt) const;
+
+   /**
+    *  If the tiff source has R0 then this returns the current tiff directory
+    *  that the tiff pointer is pointing to; else, it returns the current
+    *  directory + 1.
+    */
+   ossim_uint32 getCurrentTiffRLevel() const;
+   
+   ossimString getReadMethod(ossim_uint32 directory) const;
+   
+   bool loadTile(const ossimIrect& tile_rect,
+                 const ossimIrect& clip_rect,
+                 ossimImageData* result);
+   
+   bool loadFromRgbaU8Tile(const ossimIrect& tile_rect,
+                           const ossimIrect& clip_rect,
+                           ossimImageData* result);
+   
+   bool loadFromRgbaU8Strip(const ossimIrect& tile_rect,
+                            const ossimIrect& clip_rect,
+                            ossimImageData* result);
+   
+   bool loadFromRgbaU8aStrip(const ossimIrect& tile_rect,
+                             const ossimIrect& clip_rect,
+                             ossimImageData* result);
+
+   bool loadFromU16Strip(const ossimIrect& clip_rect,
+                         ossimImageData* result);
+   
+   bool loadFromScanLine(const ossimIrect& clip_rect,
+                         ossimImageData* result);
+
+   bool loadFromTile(const ossimIrect& clip_rect,
+                     ossimImageData* result);
+   
+   void setReadMethod();
+   
+   /**
+    * Change tiff directory and sets theCurrentDirectory.
+    *
+    * @return true on success, false on error.
+    */
+   bool setTiffDirectory(ossim_uint16 directory);
+
+   void populateLut();
+
+   /**
+    * @brief validateMinMaxNull Checks min, max and null to make sure they are not equal
+    * to the scalar type nan or double nan; sets to default min max if so.
+    */
+   void validateMinMaxNull();
+
+   /**
+    * @brief Checks line/samples of level for power of two decimation from the
+    * previous rlevel.
+    *
+    * Used to weed out thumbnail directories being used as a reduced
+    * resolution layer.
+    *
+    * Note this shuts off the thumbnail which someone may
+    * want to see.  We could make this a reader prop if it becomes an issue.
+    * drb - 09 Jan. 2012.
+    *
+    * @param dir The tiff directory index.
+    * 
+    * @return true is so; else, false.  If level is zero returns false.
+    */
+   bool isPowerOfTwoDecimation(ossim_uint32 dir) const;
+
+   /** @brief Allocates theTile. */
+   void allocateTile();
+
+   /**
+    * @brief Allocates theBuffer
+    * @return true on success; false, on error.
+    */
+   bool allocateBuffer();  
+   
+   ossimRefPtr<ossimImageData> theTile;
+   
+   ossim_uint8*         theBuffer;
+   ossim_uint32         theBufferSize;
+   ossimIrect           theBufferRect;
+   ossim_uint32         theBufferRLevel;
+   ossim_uint32         theCurrentTileWidth;
+   ossim_uint32         theCurrentTileHeight;
+
+   ossim_uint16         theSamplesPerPixel;
+   ossim_uint16         theBitsPerSample;
+   ossim_uint16         theSampleFormatUnit;
+
+   ossim_float64        theMaxSampleValue;
+   ossim_float64        theMinSampleValue;
+   ossim_float64        theNullSampleValue;
+
+   ossim_uint16         theNumberOfDirectories;
+   ossim_uint16         theCurrentDirectory;
+   bool                 theR0isFullRes;
+   ossim_uint32         theBytesPerPixel;
+   ossimScalarType      theScalarType;
+   bool                 theApplyColorPaletteFlag;
+
+   // Things we need from each directory as they can be different.
+   std::vector<ossim_uint32> theImageWidth;
+   std::vector<ossim_uint32> theImageLength;
+   std::vector<ReadMethod>   theReadMethod;
+   std::vector<ossim_uint16> thePlanarConfig;
+   std::vector<ossim_uint16> thePhotometric;
+   std::vector<ossim_uint32> theRowsPerStrip;
+   std::vector<ossim_uint32> theImageTileWidth;
+   std::vector<ossim_uint32> theImageTileLength;
+   std::vector<ossim_uint32> theImageDirectoryList;
+   
+   ossim_uint32              theCurrentTiffRlevel;
+   ossim_int32               theCompressionType;
+   std::vector<ossim_uint32> theOutputBandList;
+   shared_ptr<TiffStreamAdaptor> m_streamAdaptor;
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimTiffTileSource_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimTiffWriter.h b/include/ossim/imaging/ossimTiffWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimTiffWriter.h
rename to include/ossim/imaging/ossimTiffWriter.h
diff --git a/include/ossim/imaging/ossimTileCache.h b/include/ossim/imaging/ossimTileCache.h
new file mode 100644
index 0000000..e6f1c64
--- /dev/null
+++ b/include/ossim/imaging/ossimTileCache.h
@@ -0,0 +1,105 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts
+// Description: This file contains the cache algorithm
+//
+//***********************************
+// $Id: ossimTileCache.h 17207 2010-04-25 23:21:14Z dburken $
+
+#ifndef DataCache_HEADER
+#define DataCache_HEADER
+#include <map>
+#include <stack>
+using namespace std;
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimDataObject.h>
+class OSSIM_DLL ossimTileCache
+{
+public:
+   
+   ossimTileCache(long numberOfBuckets  = 10);
+   virtual ~ossimTileCache();
+
+   /*!
+    * This will return a tile if found.  Note this tile is still
+    * owned by the cache.
+    */
+   virtual ossimDataObject* get(const ossimDpt3d &origin,
+                               unsigned long resLevel=0);
+
+   /*!
+    * Will remove the tile from the cache and will not delete.  Note:
+    * the cache no longer owns the tile.
+    */
+   virtual ossimDataObject* remove(const ossimDpt3d &origin,
+                                  unsigned long resLevel=0);
+   /*!
+    * This will not duplicate the tile.  Note the tile is owned
+    * by the cache.
+    */
+   virtual ossimDataObject* insert(const ossimDpt3d &origin,
+                                  ossimDataObject* data,
+                                  unsigned long resLevel=0);
+   /*!
+    * Not implemented
+    */
+   void invalidate();
+   /*!
+    * Not implemented
+    */
+   virtual void invalidate(const ossimDpt3d &origin,
+                           ossim_uint32 resLevel);
+
+
+   
+   virtual long numberOfItems()const{return theCache?(long)theCache->size():(long)0;}
+   virtual void display()const;
+
+   virtual ossim_uint32 sizeInBytes(){return theSizeInBytes;}
+   
+protected:
+
+   struct ossimTileInformation
+   {
+   public:
+      friend ostream& operator <<(ostream &out,
+                                  const ossimTileInformation& /* info */)
+         {
+
+            return out;
+         }
+      ossimTileInformation(ossimDataObject* aTile,
+                           const ossimDpt3d &origin = ossimDpt(0,0),
+                           unsigned long resLevel = 0)
+         : theCachedTile(aTile),
+           theOrigin(origin),
+           theResLevel(resLevel)
+         {}
+      ossimRefPtr<ossimDataObject>    theCachedTile;
+      ossimDpt3d         theOrigin;
+      unsigned long      theResLevel;
+   };
+
+   typedef multimap<ossim_uint32, ossimTileInformation*>::iterator Iterator;
+   typedef ossimTileInformation* CacheDataPtr;
+   typedef ossimTileInformation  CacheData;
+   
+   void deleteAll();
+   virtual ossim_uint32 bucketHash(const ossimDpt3d &aPt);
+   virtual ossim_uint32 tileId(const ossimDpt3d &aPt);
+   
+   multimap<ossim_uint32, ossimTileInformation*>  *theCache;
+   long                                            theNumberOfBuckets;
+   ossim_uint32                                    theSizeInBytes;
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimTilePatch.h b/include/ossim/imaging/ossimTilePatch.h
new file mode 100644
index 0000000..4f6203e
--- /dev/null
+++ b/include/ossim/imaging/ossimTilePatch.h
@@ -0,0 +1,136 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimTilePatch.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimTilePatch_HEADER
+#define ossimTilePatch_HEADER
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/imaging/ossimDiscreteNearestNeighbor.h>
+#include <ossim/imaging/ossimImageData.h>
+
+class ossimImageSource;
+
+class ossimTilePatch : public ossimObject
+{
+public:
+   ossimTilePatch(ossimImageSource* input);
+   /*!
+    * The rect is assumed up right and all we need
+    * to do is compute the even tile boundary rect
+    */
+   ossimTilePatch(ossimScalarType scalarType = OSSIM_UCHAR,
+                  long numberOfComponents = 1,
+                  long width=128,
+                  long height=128);
+   
+   /*!
+    * return the tile boundary aligned rectangle for this
+    * patch.
+    */
+   virtual ossimIrect getRect()const;
+
+   /*!
+    * The padding is for any convolution that must take
+    * place.  
+    */
+   virtual void setRect(const ossimDpt &p1,
+                        const ossimDpt &p2,
+                        const ossimDpt &p3,
+                        const ossimDpt &p4,
+                        const ossimDpt &tile_size,
+                        const ossimDpt &padding=ossimDpt(0,0));
+
+   virtual void setRect(const ossimDrect &aRect,
+                        const ossimDpt &tile_size,
+                        const ossimDpt &padding=ossimDpt(0,0));
+
+   virtual void setRect(const ossimDpt &center_of_rect,
+                        const ossimDpt &rect_size,
+                        const ossimDpt &tile_size,
+                        const ossimDpt &padding=ossimDpt(0,0));
+
+   /*!
+    * This will fill the tile from the tile patch.
+    */
+   virtual void fillTile(ossimRefPtr<ossimImageData>& aTile)const;
+
+   /*!
+    * This will fill the tile from the tile patch and apply the convolution
+    * kernel.  This is optimized for upright rectangles.  Use the bilinear
+    * fill tile bellow for arbitrary 4-sided polygons.
+    */
+   virtual void fillTile(ossimRefPtr<ossimImageData>& result,
+                         ossimDiscreteConvolutionKernel* kernel)const;
+
+   /*!
+    * We will assume that the patch is already
+    * big enough to satisfy the kernel size.
+    */
+   virtual void fillTile(ossimRefPtr<ossimImageData>& result,
+                         const ossimDpt   &ul,
+                         const ossimDpt   &ur,
+                         const ossimDpt   &deltaUl,
+                         const ossimDpt   &deltaUr,
+                         const ossimDpt   &length)const;
+
+
+   virtual void fillPatch(ossimImageSource *imageSource,
+                          long resLevel = 0);
+   
+   
+   
+//    static ossimIrect alignRectToBoundary(const ossimDrect &aRect,
+//                                          const ossimDpt &tile_size);
+   static ossimDrect findBoundingRect(const ossimDpt &p1,
+                                      const ossimDpt &p2,
+                                      const ossimDpt &p3,
+                                      const ossimDpt &p4);
+   /*!
+    * Do not delete this data.  We give raw access to the buffer
+    * if there are special things you wish to have done.
+    */
+   ossimRefPtr<ossimImageData> getData(){return thePatchData;}
+
+   void setData(ossimRefPtr<ossimImageData>& patchData);
+   /*!
+    *  This will implement an in place convolution.  It will
+    *  allocate a buffer pass it to the convolution algorithm
+    * and then replace the internal buffer.
+    */
+   void convolve(ossimDiscreteConvolutionKernel* kernel);
+   
+protected:
+   virtual ~ossimTilePatch();
+   
+   ossimRefPtr<ossimImageData>         thePatchData;
+   static ossimDiscreteNearestNeighbor nearestNeighborKernel;
+   
+
+
+   template<class T>
+   void fillTileTemplate(T dummyVariable,
+                         ossimRefPtr<ossimImageData>& result,
+                         const ossimDpt   &ul,
+                         const ossimDpt   &ur,
+                         const ossimDpt   &deltaUl,
+                         const ossimDpt   &deltaUr,
+                         const ossimDpt   &length)const;
+   
+   template<class T>
+   void fillTileTemplate(T dummyVariable,
+                         ossimRefPtr<ossimImageData>& result,
+                         ossimDiscreteConvolutionKernel* kernel)const;
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimTiledImageHandler.h b/include/ossim/imaging/ossimTiledImageHandler.h
new file mode 100644
index 0000000..f86d5a2
--- /dev/null
+++ b/include/ossim/imaging/ossimTiledImageHandler.h
@@ -0,0 +1,160 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+// 
+// Description:
+//
+// Image handler used  when the full image is distributed across multiple files,
+// As is the case for tiled Quickbird imagery. This is not for use with band-separate formats,
+// but only "spatially-separate" schemes. Throughout, MFT = multiple file tiles, the disk storage
+// scheme handled by this class.
+//
+//**************************************************************************************************
+// $Id: ossimTiledImageHandler.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+#ifndef ossimTiledImageHandler_HEADER
+#define ossimTiledImageHandler_HEADER
+
+#include <ossim/imaging/ossimImageHandler.h>
+
+// Enable this flag to utilize the system of separate overviews for each tile-file
+#define USING_SUB_OVRS 0
+
+/**
+ *  This class defines an abstract Handler which all image handlers(loaders)
+ *  should derive from.
+ */
+class OSSIMDLLEXPORT ossimTiledImageHandler : public ossimImageHandler
+{
+public:
+   //!  Constructor (default):
+   ossimTiledImageHandler();
+   
+   //! Destructor:
+   virtual ~ossimTiledImageHandler();
+   
+   //! @return Returns true on success, false on error.
+   //! @note This method relies on the data member ossimImageData::theImageFile
+   //! being set.  
+   virtual bool open() = 0;
+
+   //! Deletes the overview and clears the valid image vertices.  Derived
+   //! classes should implement. */
+   virtual void close();
+
+   //! Derived classes must implement this method to be concrete.
+   //! @return true if open, false if not.
+   virtual bool isOpen()const;
+
+   virtual ossim_uint32 getNumberOfInputBands() const;
+   
+   //! @param resLevel Reduced resolution level to return lines of.
+   //! Default = 0
+   //! @return The number of lines for specified reduced resolution level.
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
+
+   //! @param resLevel Reduced resolution level to return samples of.
+   //! Default = 0
+   //! @return The number of samples for specified reduced resolution level.
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+   
+   //! Method to save the state of an object to a keyword list.
+   //! Return true if ok or false on error.
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   //! Method to the load (recreate) the state of an object from a keyword
+   //! list.  Return true if ok or false on error.
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   //! Indicates whether or not the image is tiled internally.
+   //! This implementation returns true if (getImageTileWidth() &&
+   //! getImageTileHeight()) are both non zero.
+   //! Override in the image handler if something else is desired.
+   //! Returns true if tiled, false if not.
+   virtual bool isImageTiled() const;
+
+   //! Returns the tile width of the image or 0 if the image is not tiled.
+   //! Note: this is not the same as the ossimImageSource::getTileWidth which
+   //! returns the output tile width which can be different than the internal
+   //! image tile width on disk.
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   //! Returns the tile height of the image or 0 if the image is not tiled.
+   //! Note: this is not the same as the ossimImageSource::getTileHeight which
+   //! returns the output tile height which can be different than the internal
+   //! image tile height on disk.
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   //! Fills the requested tile by pulling pixels from multiple file tiles as needed.
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel);
+
+   //! Returns scalar type of first tile (should be the same for all tiles)
+   virtual ossimScalarType getOutputScalarType() const;
+
+   //! Returns overall bounding rect in image space.
+   virtual ossimIrect getImageRectangle(ossim_uint32 resLevel = 0) const;
+
+protected:
+
+   //! Class for record of one tile file:
+   class ossimTileFile
+   {
+   public:
+      ossimTileFile() : overviewIsOpen(false) {}
+
+      ossimFilename tileFilename;
+      vector<ossimIrect>  subImageRects; // one rect per resolution level
+      ossimRefPtr<ossimImageHandler> imageHandler;
+      bool overviewIsOpen;
+   };
+
+   //!  Initialize tile buffer to match image datatype.
+   void allocate();
+
+  vector<ossimTileFile> m_tileFiles;
+  ossimRefPtr<ossimImageData> m_tile;
+  ossimRefPtr<ossimImageData> m_blankTile;
+  ossimIrect  m_fullImgRect;
+  ossim_uint32 m_startOvrResLevel;
+
+#if USING_SUB_OVRS
+public:
+   //! Will build over files, one for each tile file.
+   //! @param includeFullResFlag if true the full resolution layer will also
+   //! be put in the overview format.  This is handy for inefficient formats.
+   virtual bool buildOverview(
+      ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
+      ossim_uint32 quality = 75,
+      ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
+      bool includeFullResFlag=false);
+
+   virtual bool openOverview();
+   virtual void closeOverview();
+
+   //! This is not an allowed operation since there are many overviews (one per tile) and the
+   //! precise overview being requested is ambiguous:
+   virtual const ossimImageHandler* getOverview() const { return NULL; }
+
+   //!  @return true if getNumberOfReducedResSets > 1, false if not.
+   //!  @see getNumberOfReducedResSets()
+   virtual bool hasOverviews() const;
+   
+   //! Returns the number of decimation (reduced resolution) levels. This is the minimum number
+   //! among all sub-image tile-files.
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+
+protected:
+   //! Will complete the opening process. If there are overviews it will open them. 
+   virtual void completeOpen();
+  
+   bool m_lockSubOvrs;
+
+#endif /* #if USING_SUB_OVRS */
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimTiledImageHandler_HEADER */
diff --git a/include/ossim/imaging/ossimTiledImagePatch.h b/include/ossim/imaging/ossimTiledImagePatch.h
new file mode 100644
index 0000000..8109edf
--- /dev/null
+++ b/include/ossim/imaging/ossimTiledImagePatch.h
@@ -0,0 +1,124 @@
+//---
+// License: MIT
+//
+// Author: David Burken
+// 
+// Description: See class declaration below.
+// 
+//---
+// $Id$
+
+#ifndef ossimTiledImagePatch_HEADER
+#define ossimTiledImagePatch_HEADER 1
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <vector>
+
+class ossimIrect;
+
+/**
+ * @class ossimTiledImagePatch
+ *
+ * Class to fill a patch from input tiles requested on even tile boundaries
+ * with a tile size typically matching the input, with some output tile size
+ * different from the input.
+ */
+class OSSIMDLLEXPORT ossimTiledImagePatch : public ossimImageSourceFilter
+{
+public:
+
+   /** default constructor */
+   ossimTiledImagePatch();
+
+   /**
+    * @brief Initializes bounding rects and tile size(if not set) from input.
+    */
+   virtual void initialize();
+
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper left
+    *  corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.
+    *
+    * @return true on success false on error.  If return is false, result
+    * is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+   /** @return "ossimTiledImagePatch" */
+   virtual ossimString getClassName() const;
+
+   /** @return "OSSIM tiled image patch" */
+   virtual ossimString getLongName()  const;
+
+   /** @return "tiled_image_patch" */
+   virtual ossimString getShortName() const; 
+   
+   /** @return The reference to the input tile size. */
+   const ossimIpt& getInputTileSize() const;
+
+   /**
+    * @brief Sets the input tile size.
+    * @param tileSize
+    * @return true on success, false on error.
+    * On error m_inpuTileSize is set to nans.
+    */
+   bool setInputTileSize( const ossimIpt& tileSize );
+
+   /**
+    * @biref Method to the load the class state from a keyword list.
+    * @param kwl
+    * @param prefix
+    * @return true on success, false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   /**
+    * Method to save the state of an object to a keyword list.
+    * @param kwl
+    * @param prefix
+    * @return true on success, false on error.        
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+protected:
+
+   /** virtual protected destructor */
+   virtual ~ossimTiledImagePatch();
+
+private:
+
+   /** @brief Allocates the tile.  Called on first getTile. */
+   void allocateTile();
+
+   /** @brief Test the bounds of resLevel. */
+   bool isValidRLevel(ossim_uint32 resLevel) const;
+   
+   /** @brief Private to disallow use... */
+   ossimTiledImagePatch(const ossimTiledImagePatch&);
+
+   /** @brief Private to disallow use... */
+   ossimTiledImagePatch& operator=(const ossimTiledImagePatch&);
+   
+   ossimRefPtr<ossimImageData> m_tile;
+   ossimIpt                    m_inputTileSize;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimTiledImagePatch_HEADER */
diff --git a/include/ossim/imaging/ossimTiling.h b/include/ossim/imaging/ossimTiling.h
new file mode 100644
index 0000000..21acd77
--- /dev/null
+++ b/include/ossim/imaging/ossimTiling.h
@@ -0,0 +1,200 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: implementation for image generator
+//
+//*************************************************************************
+// $Id: ossimTiling.h 20103 2011-09-17 16:10:42Z dburken $
+#ifndef ossimTiling_HEADER
+#define ossimTiling_HEADER
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class OSSIM_DLL ossimTiling : public ossimObject
+{
+public:
+
+   enum ossimTilingDeltaType
+   {
+      ossimTilingDeltaType_TOTAL_PIXELS,
+      ossimTilingDeltaType_PER_PIXEL
+   };
+
+   ossimTiling();
+
+   bool initialize(const ossimMapProjection& proj,
+                   const ossimIrect& boundingRect);
+
+   bool next(ossimRefPtr<ossimMapProjection>& resultProjection,
+             ossimIrect& resultingBounds,
+             ossimString& resultingName)const;
+   
+   void reset();
+   
+   /**
+    * 
+    * @param tilingDistance Distance in the specified units.
+    * @param unitType Currently only angular unit degrees,
+    *                 and linear unit meters are supported.
+    *                 If unitType is pixel unit then the
+    *                 delta per unit will be set to 1.
+    *                 
+    */
+   void setTilingDistance(const ossimDpt& tilingDistance,
+                          ossimUnitType unitType);
+
+   /**
+    * This sets the pixel delta.  The delta can either be TOTAL_PIXELS or
+    * UNIT_PER_PIXEL.
+    *
+    * If the delta type is TOTAL_PIXELS then the unit per pixel is calculated
+    * from the theTilingDistance.  This is very useful when wanting to be on
+    * even geographic boundaries and would like to have a fixed width and
+    * height for
+    * the pixels.  Flight simulators use this tiling scheme for power of 2
+    * outputs.
+    *
+    * if the delta type is unit per pixel then the total pixels is computed
+    * form the
+    * theTilingDistance.  This is useful when you might want whole number
+    * GSD's and whole numbered tile boundaries.
+    */
+   void setDelta(const ossimDpt& delta,
+                 ossimTilingDeltaType deltaType);
+
+   /**
+    * This sets the tilename mask.  The key tokens that are supported are.
+    *
+    * %r%         Replaces with the row number of the current tile
+    * %c%         Replaces with the column number of the current tile
+    * %i%         Replaces with the current tile id.
+    * %or%        Replaces with the origin of the row
+    * %oc%        Replaces with the origin of the col
+    * %SRTM%      Replaces all filenames with the SRTM file name convention
+    *
+    * 
+    * Examples:
+    *   tile%r%_%c%  assume r = 0 and c = 100 then
+    *              this is replaced with tile0_100
+    *   
+    */
+   void setTileNameMask(const ossimString& mask);
+   ossimString getTileNameMask()const;
+   
+   bool getRowCol(ossim_int64& row,
+                  ossim_int64& col,
+                  ossim_int64 tileId)const;
+   bool getOrigin(ossimDpt& origin,
+                  ossim_int64 tileId)const;
+   bool getOrigin(ossimDpt& origin,
+                  ossim_int64 row,
+                  ossim_int64 col)const;
+   
+   void setPaddingSizeInPixels(const ossimIpt& pizelOverlap);
+   ossimDpt getDeltaPerPixel()const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+
+   /**
+    * @return The tiling distance converted to either degrees or meters.
+    */
+   void getConvertedTilingDistance(ossimDpt& pt) const;
+
+   /** The size of a tile in theTilingDistanceUnitType. */
+   ossimDpt             theTilingDistance;
+
+   /** The unit type for "theDelta", and "theTilingDistance". */
+   ossimUnitType        theTilingDistanceUnitType;
+
+   /**
+    * If (theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS) then
+    * this is the size of the tile in pixels like 1024 x 1024.
+    *
+    * If (theDeltaType == ossimTilingDeltaType_PER_PIXEL) then
+    * this is the size of a single pixel like 1.0 meter.
+    */
+   ossimDpt             theDelta;
+
+   /** @see theDelta */
+   ossimTilingDeltaType theDeltaType;
+
+   /**
+    * @brief If set tiling size is controlled by the desired output size in
+    * bytes.  Set by one of output_size_in_bytes, output_size_in_kilo_bytes, or
+    * output_size_in_mega_bytes.  Always stored in bytes.
+    *
+    * @note kilo_byte = 1024 X 1024, mega_byte = 1024 X 1024 X 1024.
+    *
+    * @note If set this relys on theNumberOfBands and theNumberOfBytesPerPixel
+    * need to alse be set correctly.
+    */
+   ossim_int64 theOutputSizeInBytes;
+
+   /**
+    * @brief Output number of bands.  Needed to tile by output size in bytes.
+    *
+    * default = 1
+    *
+    * @see theOutputSizeInBytes
+    */
+   ossim_uint32 theNumberOfBands;
+
+   /**
+    * @brief Output number of bytes per pixel.
+    * Needed to tile by output size in bytes.
+    *
+    * default = 1
+    *
+    * @see theOutputSizeInBytes
+    *
+    * @note This bytes per single pixel, not all bands.
+    */
+   ossim_uint32 theNumberOfBytesPerPixelPerBand;
+   
+   ossimDpt             thePaddingSizeInPixels;
+   mutable ossimRefPtr<ossimMapProjection>  theMapProjection;
+   ossimIrect                       theImageRect;
+   ossimDrect                       theTilingRect;
+   mutable ossim_int64 theTileId;
+   ossim_int64         theTotalHorizontalTiles;
+   ossim_int64         theTotalVerticalTiles;
+   ossim_int64         theTotalTiles;
+   ossimString         theTileNameMask;
+
+   /**
+    * This flags the code to shift the tie point so that the edge of the pixel
+    * falls on the tile boundary.  default=false
+    */
+   bool theEdgeToEdgeFlag; 
+   
+   bool validate()const;
+   bool isAngularUnit(ossimUnitType unitType)const;
+   bool isLinearUnit(ossimUnitType unitType)const;
+   void getTileName(ossimString& resultingName,
+                    ossim_int64 row,
+                    ossim_int64 col,
+                    ossim_int64 id)const;
+   void clampGeographic(ossimDrect& rect)const;
+                    
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimTilingPoly.h b/include/ossim/imaging/ossimTilingPoly.h
new file mode 100644
index 0000000..295ca53
--- /dev/null
+++ b/include/ossim/imaging/ossimTilingPoly.h
@@ -0,0 +1,96 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Mingjie Su
+// 
+// Description: implementation for image generator
+//
+//*************************************************************************
+// $Id: ossimTilingPoly.h 2725 2011-06-15 18:13:07Z david.burken $
+#ifndef ossimTilingPoly_HEADER
+#define ossimTilingPoly_HEADER 1
+
+#include <ossim/imaging/ossimTilingRect.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimGeoPolyCutter.h>
+
+class OSSIM_DLL ossimTilingPoly : public ossimTilingRect
+{
+public:
+
+   ossimTilingPoly();
+
+   virtual ~ossimTilingPoly();
+
+   virtual bool initialize(const ossimMapProjection& proj,
+                           const ossimIrect& boundingRect);
+
+   virtual bool next(ossimRefPtr<ossimMapProjection>& resultProjection,
+                     ossimIrect& resultingBounds,
+                     ossimString& resultingName);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+      const char* prefix=0)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+      const char* prefix=0);
+
+   bool useMbr() const;
+
+   /** return true if exterior cut is initialized. */
+   bool hasExteriorCut() const;
+
+   /** return true if interior cut is initialized. */
+   bool hasInteriorCut() const;
+   
+   ossimRefPtr<ossimGeoPolyCutter>& getExteriorCut();
+   
+   ossimRefPtr<ossimGeoPolyCutter>& getInteriorCut();
+
+   bool isFeatureBoundingIntersect() const;
+
+protected:
+
+   struct ossimShpFeature
+   {
+      ossimShpFeature(ossim_int32 fid,
+         ossim_int32 polyType,
+         std::vector<ossimGpt> polygon,
+         std::vector<ossimGeoPolygon> multiPolys)
+
+         :m_fid(fid),
+         m_polyType(polyType),
+         m_polygon(polygon),
+         m_multiPolys(multiPolys)
+      {}
+
+      ossim_int32 m_fid;
+      ossim_int32 m_polyType;
+      std::vector<ossimGpt> m_polygon;
+      std::vector<ossimGeoPolygon> m_multiPolys;
+   };
+
+   bool parseShpFile();
+
+   bool nextFeature();
+
+   void setRect();
+
+   ossimFilename          m_shpFilename;
+   bool                   m_useMbr;
+   ossim_float64          m_bufferDistance;
+   
+   ossimRefPtr<ossimGeoPolyCutter> m_exteriorCut;
+   ossimRefPtr<ossimGeoPolyCutter> m_interiorCut;
+   
+   std::vector<ossimShpFeature> m_features;
+   bool m_featureBoundingIntersect;
+                    
+TYPE_DATA
+};
+
+#endif
+
diff --git a/include/ossim/imaging/ossimTilingRect.h b/include/ossim/imaging/ossimTilingRect.h
new file mode 100644
index 0000000..9e451c9
--- /dev/null
+++ b/include/ossim/imaging/ossimTilingRect.h
@@ -0,0 +1,67 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Mingjie Su
+// 
+// Description: implementation for image generator
+//
+//*************************************************************************
+// $Id: ossimTilingRect.h 2725 2011-06-15 18:13:07Z david.burken $
+#ifndef ossimTilingRect_HEADER
+#define ossimTilingRect_HEADER 1
+
+#include <ossim/imaging/ossimTiling.h>
+#include <ossim/imaging/ossimGeoPolyCutter.h>
+#include <ossim/imaging/ossimGeoAnnotationPolyObject.h>
+#include <ossim/imaging/ossimGeoAnnotationMultiPolyObject.h>
+
+
+class OSSIM_DLL ossimTilingRect : public ossimTiling
+{
+public:
+
+   ossimTilingRect();
+
+   virtual ~ossimTilingRect();
+
+   virtual bool initialize(const ossimMapProjection& proj,
+                           const ossimIrect& boundingRect);
+
+   virtual bool next(ossimRefPtr<ossimMapProjection>& resultProjection,
+                     ossimIrect& resultingBounds,
+                     ossimString& resultingName);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+      const char* prefix=0)const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+      const char* prefix=0);
+
+protected:
+
+   bool initializeBase(const ossimMapProjection& proj, 
+                       const ossimIrect& boundingRect,
+                       ossimDpt& convertedTilingDistance);
+
+   void getConvertedDistance(ossimDpt& pt, ossimDpt inputDistance) const;
+
+   ossimDpt getPaddingSize() const;
+
+   bool                   m_clipToAoi;
+   ossim_float64          m_lastWidth;
+   ossim_float64          m_lastHeight;
+   bool                   m_useOffset;
+   ossimDpt               m_offsetInPixels;
+   ossimDpt               m_tilingDistanceInPixels;
+   ossimDpt               m_tilinResolutionDistance;
+   ossimUnitType          m_tilingResolutionUnitType;
+   ossimDpt               m_fractionalPixelMisalignment;
+                    
+TYPE_DATA
+};
+
+#endif
+
diff --git a/include/ossim/imaging/ossimTopographicCorrectionFilter.h b/include/ossim/imaging/ossimTopographicCorrectionFilter.h
new file mode 100644
index 0000000..f137139
--- /dev/null
+++ b/include/ossim/imaging/ossimTopographicCorrectionFilter.h
@@ -0,0 +1,224 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimTopographicCorrectionFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimTopographicCorrectionFilter_HEADER
+#define ossimTopographicCorrectionFilter_HEADER
+#include <ossim/imaging/ossimImageCombiner.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimColumnVector3d.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimPropertyEvent.h>
+#include <ossim/base/ossim2dLinearRegression.h>
+
+class ossimImageData;
+
+class ossimImageSourceConnection;
+class ossimImageToPlaneNormalFilter;
+/*!
+ *
+ * class ossimTopographicCorrectionFilter
+ *
+ * This clas is used to execute terrain correction.  I t requires 2 inputs
+ * where the first input is a multi band data source to correct and the
+ * second is elevation normals used in light incident calculations.
+ *
+ * A sample chain might look like:
+ *
+ *  landsatHandler ---> Cache ---> renderer ---> cache ---------------------------------------
+ *                                                                                            |--> Topo correction filter ---> Output
+ *  ortho mosaic of elevation data----> imageToPlaneNormals --> Cache ---> Renderer -->Cache --
+ *
+ * the ossimImageToPlaneNormalsFilter is used to take a single band elevation source and compute normals at each post.  I suggest that you
+ * set the renderer to use a higher order convolution than just nearest neighbor, maybe Cubic.  This way you have smoother interpolation
+ * as you change zoom levels.
+ *
+ *
+ * Correction Types:
+ *
+ *   Cosine correction:     In order for this to run it does not need any additional informat but the multi band source and
+ *                          an normal calculation input.
+ *
+ *   Cosine-C correction:   In order for this to run it will need theC array populated for each band.  It defaults
+ *                          to 0 forcing a default Cosine correction to take place.
+ *
+ *   Minnaert correction:   In order for this to run it will need theK array populated for each band.  The defaults should work pretty good
+ *  
+ */
+class OSSIMDLLEXPORT ossimTopographicCorrectionFilter : public ossimImageCombiner
+{
+public:
+   enum ossimTopoCorrectionType
+   {
+      TOPO_CORRECTION_COSINE    = 0,
+      TOPO_CORRECTION_COSINE_C  = 1,
+      TOPO_CORRECTION_MINNAERT  = 2
+   };
+   ossimTopographicCorrectionFilter();
+
+   ossimTopographicCorrectionFilter(ossimImageSource* colorSource,
+                                    ossimImageSource* elevSource);
+   
+   ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tileRect,
+                                       ossim_uint32 resLevel=0);
+   
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+
+   virtual ossimScalarType getOutputScalarType() const;
+
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+
+   virtual void getDecimationFactor(ossim_uint32 resLevel,
+                                    ossimDpt& result) const;
+   
+   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
+
+   virtual ossim_uint32 getNumberOfDecimationLevels()const;
+
+   virtual double getAzimuthAngle()const;
+
+   virtual double getElevationAngle()const;
+
+   virtual void setAzimuthAngle(double angle);
+
+   virtual void setElevationAngle(double angle);
+
+   virtual void initialize();
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   bool canConnectMyInputTo(ossim_int32 inputIndex,
+                            const ossimConnectableObject* object)const;
+      
+   virtual void connectInputEvent(ossimConnectionEvent& event);
+
+   virtual void disconnectInputEvent(ossimConnectionEvent& event);
+
+   virtual void propertyEvent(ossimPropertyEvent& event);
+
+   virtual void refreshEvent(ossimRefreshEvent& event);
+
+   virtual ossimTopoCorrectionType getTopoCorrectionType()const;
+
+   virtual void setTopoCorrectionType(ossimTopoCorrectionType topoType);
+
+   const std::vector<double>& getGainValues()const;
+
+   void setGainValues(const std::vector<double>& gainValues);
+  
+   const vector<double>& getBiasValues()const;
+
+   void setBiasValues(const std::vector<double>& biasValues);
+
+   const vector<double>& getKValues()const;
+
+   double getK(int idx)const;
+
+   void setK(int idx, double value);
+
+   void setKValues(const vector<double>& kValues);
+
+   double getC(int idx)const;
+
+   void setC(int idx, double value);
+
+   void setCValues(const vector<double>& cValues);
+   
+   void computeLightDirection();
+
+protected:
+   virtual ~ossimTopographicCorrectionFilter();
+   virtual void allocate();
+   
+   /*!
+    * The result of the illumination equation is stored in
+    * here.  This is populated on each call to getTile.
+    */
+   ossimRefPtr<ossimImageData>   theTile;
+
+   std::vector<ossim_uint32> theBandMapping;
+   
+//   ossimImageToPlaneNormalFilter* theNormalFilter;
+//   ossimScalarRemapper*           theScalarRemapper;
+   std::vector<double> theC;
+   std::vector<double> theK;
+   std::vector<double> theBias;
+   std::vector<double> theGain;
+   
+   /*!
+    * Used for the light vector computation.
+    */
+   double theLightSourceElevationAngle;
+
+   /*!
+    * Used for the light vector computation.
+    */
+   double theLightSourceAzimuthAngle;
+
+   /*!
+    * This is computed from the elevation and
+    * azimuth angles of the light source.
+    */
+   double theLightDirection[3];
+
+   double         theJulianDay;
+   mutable bool   theCComputedFlag;
+   ossimTopoCorrectionType theTopoCorrectionType;   
+   double         theNdviLowTest;
+   double         theNdviHighTest;
+   
+   virtual void executeTopographicCorrection(
+      ossimRefPtr<ossimImageData>& outputData,
+      ossimRefPtr<ossimImageData>& colorData,
+      ossimRefPtr<ossimImageData>& normalData);
+
+   template <class T> void executeTopographicCorrectionTemplate(
+      T dummy,
+      ossimRefPtr<ossimImageData>& outputData,
+      ossimRefPtr<ossimImageData>& colorData,
+      ossimRefPtr<ossimImageData>& normalData);
+
+   template <class T> void executeTopographicCorrectionMinnaertTemplate(
+      T dummy,
+      ossimRefPtr<ossimImageData>& outputData,
+      ossimRefPtr<ossimImageData>& colorData,
+      ossimRefPtr<ossimImageData>& normalData);
+  
+//    virtual void computeC();
+
+//    template<class T>
+//    void addRegressionPointsTemplate(T, //dummy
+//                                     std::vector<ossim2dLinearRegression>& regressionPoints,
+//                                     std::vector<int>& cosineIBucketCount,
+//                                     ossim_int32 maxCountPerBucket,
+//                                     ossimImageData* colorData,
+//                                     ossimImageData* normalData);
+   template <class T> bool computeNdvi(T dummy,
+                                       ossim_float64& result,
+                                       ossim_uint32 offset,
+                                       const std::vector<T*>& bands)const;
+
+   void resizeArrays(ossim_uint32 newSize);
+
+   bool setCCmputedFlag();
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimTrimFilter.h b/include/ossim/imaging/ossimTrimFilter.h
new file mode 100644
index 0000000..2cf239f
--- /dev/null
+++ b/include/ossim/imaging/ossimTrimFilter.h
@@ -0,0 +1,71 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimTrimFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimTrimFilter_HEADER
+#define ossimTrimFilter_HEADER
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimPolyCutter.h>
+
+class ossimTrimFilter : public ossimImageSourceFilter
+{
+public:
+   ossimTrimFilter();
+
+   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
+   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
+                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+                                      ossim_uint32 resLevel=0)const;
+
+   ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                       ossim_uint32 resLevel=0);
+
+   virtual void initialize();
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+   
+
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+
+   /**
+    * Set property.
+    *
+    * @param property Property to set if property->getName() matches a
+    * property name of this object.
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /**
+    * Adds this objects properties to the list.
+    *
+    * @param propertyNames Array to add to.
+    *
+    * @note This method does not clear propertyNames prior to adding it's
+    * names.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+protected:
+   virtual ~ossimTrimFilter();
+   double theLeftPercent;
+   double theRightPercent;
+   double theTopPercent;
+   double theBottomPercent;
+   std::vector<ossimIpt>  theValidVertices;
+   ossimRefPtr<ossimPolyCutter> theCutter;
+   
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimTrimFilter_HEADER */
diff --git a/include/ossim/imaging/ossimTwoColorView.h b/include/ossim/imaging/ossimTwoColorView.h
new file mode 100644
index 0000000..c578b38
--- /dev/null
+++ b/include/ossim/imaging/ossimTwoColorView.h
@@ -0,0 +1,105 @@
+//-------------------------------------------------------------------
+// License:  LGPL.  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//-------------------------------------------------------------------
+//  $Id$
+#ifndef ossimTwoColorView_HEADER
+#define ossimTwoColorView_HEADER 1
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimImageCombiner.h>
+
+/**
+ * This is a 2 color view of the input.  It basically allows for a change detection and by default will take the first input and map
+ * it to the blue channel and takes the second input and maps to the red channel.  The unused channel is mapped to a min pixel value.
+ */
+class OSSIM_DLL ossimTwoColorView : public ossimImageCombiner
+{
+public:
+
+   /**
+    * @brief Enumerations for mapping inputs to red, green and blue
+    * output channels.
+    */
+   enum ossimTwoColorMultiViewOutputSource
+   {
+      UNKNOWN = 0,
+      MIN     = 1,
+      OLD     = 2,
+      NEW     = 3
+   };
+   
+   ossimTwoColorView();
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+   /**
+    * @return the requested region of interest
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   ossimScalarType getOutputScalarType() const;
+   
+   double getNullPixelValue(ossim_uint32 band)const;
+   double getMinPixelValue(ossim_uint32 band)const;
+   double getMaxPixelValue(ossim_uint32 band)const;
+   
+   /**
+    * @brief Sets which bands to use from inputs, and which inputs to use for
+    * output red, green and blue channels.
+    *
+    * This method does no error checking as the inputs may or may not be set
+    * prior to this call.  ossimTwoColorView::initialize() will verify once
+    * inputs are established.  So if an input band is out of range band
+    * 0 (first band) will be used.
+    *
+    * Callers should ensure initialize is called after this.
+    *
+    * @param oldInputBandIndex Zero based band index for old input. Default=0
+    * * 
+    * @param newInputBandIndex Zero based band index for new input. Default=0.
+    * 
+    * @param redOutputSource default=OLD.  Can be:
+    *    ossimTwoColorMultiViewOutputSource::OLD
+    *    ossimTwoColorMultiViewOutputSource::NEW
+    *    ossimTwoColorMultiViewOutputSource::MIN
+    *    
+    * @param grnOutputSource default=NEW.  Can be:
+    *    ossimTwoColorMultiViewOutputSource::OLD
+    *    ossimTwoColorMultiViewOutputSource::NEW
+    *    ossimTwoColorMultiViewOutputSource::MIN
+    *    
+    * @param bluOutputSource default=NEW.  Can be:
+    *    ossimTwoColorMultiViewOutputSource::OLD
+    *    ossimTwoColorMultiViewOutputSource::NEW
+    *    ossimTwoColorMultiViewOutputSource::MIN   
+    */
+   void setBandIndexMapping(
+      ossim_uint32 oldInputBandIndex,
+      ossim_uint32 newInputBandIndex,
+      ossimTwoColorMultiViewOutputSource redOutputSource,
+      ossimTwoColorMultiViewOutputSource grnOutputSource,
+      ossimTwoColorMultiViewOutputSource bluOutputSource);
+
+   virtual void initialize();
+   
+protected:
+   void allocate();
+   void runAlgorithm(ossimImageData* newData, ossimImageData* oldData);
+   void runNative8(ossimImageData* newData,   ossimImageData* oldData);
+   void runNorm(ossimImageData* newData,   ossimImageData* oldData);
+   
+   bool                               m_byPassFlag;
+   bool                               m_nativeFlag;
+   ossimRefPtr<ossimImageData>        m_twoColorTile;
+   ossimRefPtr<ossimImageSource>      m_newInput;
+   ossimRefPtr<ossimImageSource>      m_oldInput;
+   ossim_uint32                       m_newInputBandIndex;
+   ossim_uint32                       m_oldInputBandIndex;
+   ossimTwoColorMultiViewOutputSource m_redSource;
+   ossimTwoColorMultiViewOutputSource m_grnSource;
+   ossimTwoColorMultiViewOutputSource m_bluSource;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimTwoColorView_HEADER */
diff --git a/include/ossim/imaging/ossimU11ImageData.h b/include/ossim/imaging/ossimU11ImageData.h
new file mode 100644
index 0000000..0e1035d
--- /dev/null
+++ b/include/ossim/imaging/ossimU11ImageData.h
@@ -0,0 +1,188 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimU16ImageData.  Specialized image data object for
+// unsigned short data with an 11 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 2047.0  (2^11 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU11ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimU11ImageData_HEADER
+#define ossimU11ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedU11RemapTable.h>
+
+class OSSIMDLLEXPORT ossimU11ImageData : public ossimImageData
+{
+public:
+   ossimU11ImageData(ossimSource* source,
+                     ossim_uint32 bands = 1);
+
+   ossimU11ImageData(ossimSource* source,
+                     ossim_uint32 bands,
+                     ossim_uint32 width,
+                     ossim_uint32 height);
+
+   ossimU11ImageData(const ossimU11ImageData &rhs);
+   
+
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+
+   bool isNull(ossim_uint32 offset)const;
+   void setNull(ossim_uint32 offset);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+
+   virtual void setValue(long x, long y, double color);
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           float* buf)const;
+
+      /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(float* buf);
+
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */
+   virtual ossim_float64 getMinNormalizedPix() const;
+
+protected:
+   virtual ~ossimU11ImageData();
+   ossimU11ImageData();
+
+private:
+
+   static const ossimNormalizedU11RemapTable m_remapTable;
+   
+TYPE_DATA
+};
+
+inline ossim_float64 ossimU11ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimU12ImageData.h b/include/ossim/imaging/ossimU12ImageData.h
new file mode 100644
index 0000000..8d0e877
--- /dev/null
+++ b/include/ossim/imaging/ossimU12ImageData.h
@@ -0,0 +1,188 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimU16ImageData.  Specialized image data object for
+// unsigned short data with an 12 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 4095.0  (2^12 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU12ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimU12ImageData_HEADER
+#define ossimU12ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedU12RemapTable.h>
+
+class OSSIMDLLEXPORT ossimU12ImageData : public ossimImageData
+{
+public:
+   ossimU12ImageData(ossimSource* source,
+                     ossim_uint32 bands = 1);
+
+   ossimU12ImageData(ossimSource* source,
+                     ossim_uint32 bands,
+                     ossim_uint32 width,
+                     ossim_uint32 height);
+
+   ossimU12ImageData(const ossimU12ImageData &rhs);
+   
+
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+
+   bool isNull(ossim_uint32 offset)const;
+   void setNull(ossim_uint32 offset);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+
+   virtual void setValue(long x, long y, double color);
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           float* buf)const;
+
+      /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(float* buf);
+
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */
+   virtual ossim_float64 getMinNormalizedPix() const;
+
+protected:
+   virtual ~ossimU12ImageData();
+   ossimU12ImageData();
+
+private:
+
+   static const ossimNormalizedU12RemapTable m_remapTable;
+   
+TYPE_DATA
+};
+
+inline ossim_float64 ossimU12ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimU13ImageData.h b/include/ossim/imaging/ossimU13ImageData.h
new file mode 100644
index 0000000..f7594bc
--- /dev/null
+++ b/include/ossim/imaging/ossimU13ImageData.h
@@ -0,0 +1,188 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimU16ImageData.  Specialized image data object for
+// unsigned short data with an 13 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 8191.0  (2^13 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU13ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimU13ImageData_HEADER
+#define ossimU13ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedU13RemapTable.h>
+
+class OSSIMDLLEXPORT ossimU13ImageData : public ossimImageData
+{
+public:
+   ossimU13ImageData(ossimSource* source,
+                     ossim_uint32 bands = 1);
+
+   ossimU13ImageData(ossimSource* source,
+                     ossim_uint32 bands,
+                     ossim_uint32 width,
+                     ossim_uint32 height);
+
+   ossimU13ImageData(const ossimU13ImageData &rhs);
+   
+
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+
+   bool isNull(ossim_uint32 offset)const;
+   void setNull(ossim_uint32 offset);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+
+   virtual void setValue(long x, long y, double color);
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           float* buf)const;
+
+      /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(float* buf);
+
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */
+   virtual ossim_float64 getMinNormalizedPix() const;
+
+protected:
+   virtual ~ossimU13ImageData();
+   ossimU13ImageData();
+
+private:
+
+   static const ossimNormalizedU13RemapTable m_remapTable;
+   
+TYPE_DATA
+};
+
+inline ossim_float64 ossimU13ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimU14ImageData.h b/include/ossim/imaging/ossimU14ImageData.h
new file mode 100644
index 0000000..f551104
--- /dev/null
+++ b/include/ossim/imaging/ossimU14ImageData.h
@@ -0,0 +1,188 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimU16ImageData.  Specialized image data object for
+// unsigned short data with an 14 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 16383.0  (2^14 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU14ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimU14ImageData_HEADER
+#define ossimU14ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedU14RemapTable.h>
+
+class OSSIMDLLEXPORT ossimU14ImageData : public ossimImageData
+{
+public:
+   ossimU14ImageData(ossimSource* source,
+                     ossim_uint32 bands = 1);
+
+   ossimU14ImageData(ossimSource* source,
+                     ossim_uint32 bands,
+                     ossim_uint32 width,
+                     ossim_uint32 height);
+
+   ossimU14ImageData(const ossimU14ImageData &rhs);
+   
+
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+
+   bool isNull(ossim_uint32 offset)const;
+   void setNull(ossim_uint32 offset);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+
+   virtual void setValue(long x, long y, double color);
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           float* buf)const;
+
+      /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(float* buf);
+
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */
+   virtual ossim_float64 getMinNormalizedPix() const;
+
+protected:
+   virtual ~ossimU14ImageData();
+   ossimU14ImageData();
+
+private:
+
+   static const ossimNormalizedU14RemapTable m_remapTable;
+   
+TYPE_DATA
+};
+
+inline ossim_float64 ossimU14ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimU15ImageData.h b/include/ossim/imaging/ossimU15ImageData.h
new file mode 100644
index 0000000..5bddbb1
--- /dev/null
+++ b/include/ossim/imaging/ossimU15ImageData.h
@@ -0,0 +1,188 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimU16ImageData.  Specialized image data object for
+// unsigned short data with an 15 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 32767.0  (2^15 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU15ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimU15ImageData_HEADER
+#define ossimU15ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedU15RemapTable.h>
+
+class OSSIMDLLEXPORT ossimU15ImageData : public ossimImageData
+{
+public:
+   ossimU15ImageData(ossimSource* source,
+                     ossim_uint32 bands = 1);
+
+   ossimU15ImageData(ossimSource* source,
+                     ossim_uint32 bands,
+                     ossim_uint32 width,
+                     ossim_uint32 height);
+
+   ossimU15ImageData(const ossimU15ImageData &rhs);
+   
+
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+
+   bool isNull(ossim_uint32 offset)const;
+   void setNull(ossim_uint32 offset);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+
+   virtual void setValue(long x, long y, double color);
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
+                                           float* buf)const;
+
+      /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(float* buf);
+
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */
+   virtual ossim_float64 getMinNormalizedPix() const;
+
+protected:
+   virtual ~ossimU15ImageData();
+   ossimU15ImageData();
+
+private:
+
+   static const ossimNormalizedU15RemapTable m_remapTable;
+   
+TYPE_DATA
+};
+
+inline ossim_float64 ossimU15ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimU16ImageData.h b/include/ossim/imaging/ossimU16ImageData.h
new file mode 100644
index 0000000..e1926df
--- /dev/null
+++ b/include/ossim/imaging/ossimU16ImageData.h
@@ -0,0 +1,192 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimU16ImageData.  Specialized image data object for
+// unsigned short data.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 65536.0  (2^16 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU16ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimU16ImageData_HEADER
+#define ossimU16ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedU16RemapTable.h>
+
+class OSSIMDLLEXPORT ossimU16ImageData : public ossimImageData
+{
+public:
+   ossimU16ImageData(ossimSource* source,
+                     ossim_uint32 bands = 1);
+
+   ossimU16ImageData(ossimSource* source,
+                    ossim_uint32 bands,
+                    ossim_uint32 width,
+                    ossim_uint32 height);
+
+   ossimU16ImageData(const ossimU16ImageData &rhs);
+
+
+   /*!
+    * Perform object duplication.
+    */
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+
+   /*!
+    * will fill all bands with the passed in
+    * value.
+    */
+   void fill(double value);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+
+   virtual void setValue(long x, long y, double color);
+   
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, float* buf)const;
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+   
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(float* buf);
+
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */
+   virtual ossim_float64 getMinNormalizedPix() const;
+   
+protected:
+   virtual ~ossimU16ImageData();
+   ossimU16ImageData();
+
+private:
+
+   static const ossimNormalizedU16RemapTable m_remapTable;
+   
+TYPE_DATA
+};
+
+inline ossim_float64 ossimU16ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimU8ImageData.h b/include/ossim/imaging/ossimU8ImageData.h
new file mode 100644
index 0000000..70487be
--- /dev/null
+++ b/include/ossim/imaging/ossimU8ImageData.h
@@ -0,0 +1,175 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class declaration of ossimU8ImageData.  Specialized image data object for
+// unsigned char data.
+//
+// NOTE:  This object is optimized for unsigned char data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 255.0
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU8ImageData.h 16052 2009-12-08 22:20:40Z dburken $
+
+#ifndef ossimU8ImageData_HEADER
+#define ossimU8ImageData_HEADER
+
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimNormalizedU8RemapTable.h>
+
+class OSSIMDLLEXPORT ossimU8ImageData : public ossimImageData
+{
+public:
+   ossimU8ImageData(ossimSource* source=NULL,
+                    ossim_uint32 bands = 1);
+   
+   ossimU8ImageData(ossimSource* source,
+                    ossim_uint32 bands,
+                    ossim_uint32 width,
+                    ossim_uint32 height);
+   
+   ossimU8ImageData(const ossimU8ImageData& rhs)
+      :ossimImageData(rhs)
+      {}
+
+
+   virtual ossimObject* dup()const;
+
+   /*!
+    * will fill the entire band with
+    * the value.
+    */
+   void fill(ossim_uint32 band, double value);
+   void fill(double value);
+
+   bool isNull(ossim_uint32 offset)const;
+   void setNull(ossim_uint32 offset);
+
+   virtual ossimDataObjectStatus validate() const;
+
+   /*!
+    * will go to the band and offset and compute the
+    * normalized float and return it back to the
+    * caller through the result argument.
+    */
+   virtual void getNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float& result)const;
+
+   /*!
+    * This will assign to this object a normalized
+    * value by unnormalizing to its native type.
+    */
+   virtual void setNormalizedFloat(ossim_uint32 offset,
+                                   ossim_uint32 bandNumber,
+                                   float input);
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedFloat(ossimImageData* result)const;
+   
+   /*!
+    * Will use the memory that you pass in to normalize
+    * this data object.
+    */
+   virtual void convertToNormalizedDouble(ossimImageData* result)const;
+
+   /*!
+    * Will take the normalized input and convert it
+    * to this tile's data type.  Example:  if this
+    * tile is of type UCHAR and its input is of type
+    * NORALIZED_FLOAT it will unnormalize the data by
+    * doing:
+    *
+    * minPix + normalizedInput*(maxPix-minPix)
+    *
+    * on a per band basis.
+    */
+   virtual void unnormalizeInput(ossimImageData* normalizedInput);
+
+   /*!
+    * This will compute the average value for the band.
+    */
+   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
+
+   /*!
+    * This will call the compute average band value and then
+    * use that in the calculation of:
+    
+    * It will then do a SUM[(Mean - Actual)^2]/width*height.
+    *
+    * This is the average variance from the passed in
+    * mean.  Basically think of the mean as a completely
+    * grey image and we would like to see how this
+    * image varies from the passed in mean.
+    */
+   virtual double computeMeanSquaredError(double meanValue,
+                                          ossim_uint32 bandNumber = 0);
+  
+   virtual void setValue(ossim_int32 x, ossim_int32 y, double color);
+
+   /*!
+    * Copies entire tile to buf passed in.  Data put in buf is normalized.
+    * The "buf" passed to method is assumed to be at least as big as:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyTileToNormalizedBuffer(double* buf) const;
+   virtual void copyTileToNormalizedBuffer(float* buf) const;
+
+   /*!
+    * Will copy this tiles specified band number to the normalized buffer.
+    * if the band is out of range then nothing is done and returns.
+    */
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, double* buf) const;
+   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, float* buf)const;
+
+   /*!
+    * Copies buf passed in to tile.  Data is unnormalized to the tile's
+    * scalar type.
+    * The "buf" passed to method is assumed to be at least as big as the tiles:
+    * "getSize() * sizeof(double)"
+    */
+   virtual void copyNormalizedBufferToTile(double* buf);
+   virtual void copyNormalizedBufferToTile(float* buf);
+
+   /*!
+    * Will copy the normalized buffer to this tiles
+    * specified band.  If band is out of range then nothing
+    * is done and returns.
+    */
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           double* buf);
+   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
+                                           float* buf);
+
+   /** @return The first non-null index of the normalized remap table. */   
+   virtual ossim_float64 getMinNormalizedPix() const;
+   
+protected:
+   virtual ~ossimU8ImageData();
+
+private:
+
+   static const ossimNormalizedU8RemapTable m_remapTable;
+   
+TYPE_DATA
+};
+
+inline ossim_float64 ossimU8ImageData::getMinNormalizedPix() const
+{
+   return m_remapTable[1];
+}
+
+#endif
diff --git a/include/ossim/imaging/ossimUsgsDemTileSource.h b/include/ossim/imaging/ossimUsgsDemTileSource.h
new file mode 100644
index 0000000..7b19497
--- /dev/null
+++ b/include/ossim/imaging/ossimUsgsDemTileSource.h
@@ -0,0 +1,194 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Contains class declaration of ossimUsgsDemTileSource.
+// The ossimUsgsDemTileSource class is derived from ossimImageHandler and
+// is intended to be an image handler for USGS dem files.
+//
+//********************************************************************
+// $Id: ossimUsgsDemTileSource.h 19640 2011-05-25 15:58:00Z oscarkramer $
+
+#ifndef ossimUsgsDemTileSource_HEADER
+#define ossimUsgsDemTileSource_HEADER
+
+#include <ossim/imaging/ossimImageHandler.h>
+
+class ossimImageData;
+class ossimDemGrid;
+
+class OSSIM_DLL ossimUsgsDemTileSource : public ossimImageHandler
+{
+public:
+      
+   ossimUsgsDemTileSource();
+
+   virtual ossimString getShortName() const;
+   virtual ossimString getLongName()  const;
+
+   /**
+    *  Returns true if the "theImageFile can be opened.
+    *
+    *  If the extension is not equal to ".dem" this will attempt to look for
+    *  an ".omd" file with the keyword pair "dem_type:  usgs_dem" in it.
+    *
+    *  Optionally users can change the scalar type from signed 16 bit to
+    *  float with the keyword pair "scalar_type: ossim_float32"
+    */
+   virtual bool open();
+
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+
+   /**
+    * Method to get a tile.   
+    *
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    *
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+   /**
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfInputBands()  const;
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+   
+   /**
+    *  Returns the number of lines in the image.
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    *  Returns the number of samples in the image.  
+    *  Satisfies pure virtual requirement from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   /**
+    * Returns the zero based image rectangle for the reduced resolution data
+    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
+   
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    *
+    * Keywords picked up by this method:
+    * dem_type: usgs_dem
+    * scalar_type: ossim_sint16 (default)
+    * or
+    * scalar_type: ossim_float32
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   
+   /**
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /**
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+
+   /**
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;   
+
+   virtual bool isOpen()const;
+   
+   /**
+    * Override base-class method to make sure the internal geometry is explored before extending.
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+protected:
+
+   /**
+    * @brief Initializes theGeometry from USGS DEM header.
+    *
+    * This is called by base ossimImageHandler::getImageGeometry if
+    * theGeometry is not set.  External callers should not go through this
+    * method but call "getImageGeometry" instead for efficiency reasons.
+    * 
+    * @return Pointer to geometry or null if header not found.
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const;
+   
+   virtual ~ossimUsgsDemTileSource();
+   // Disallow operator= and copy constrution...
+   const ossimUsgsDemTileSource& operator=(const  ossimUsgsDemTileSource& rhs);
+   ossimUsgsDemTileSource(const ossimUsgsDemTileSource&);
+   
+   /**
+    *  Returns true on success, false on error.
+    */
+   template <class T> bool fillBuffer(T, // dummy template variable
+                                      const ossimIrect& tile_rect,
+                                      const ossimIrect& clip_rect,
+                                      ossimImageData* tile);
+
+   void gatherStatistics();
+
+   ossimDemGrid*               theDem;
+   ossimRefPtr<ossimImageData> theTile;
+   ossim_float64               theNullValue;
+   ossim_float64               theMinHeight;
+   ossim_float64               theMaxHeight;
+   bool                        theFeetFlag;  // elevation units = feet
+   bool                        theIsDemFlag;
+
+   /**
+    * This can be either OSSIM_SINT16 or OSSIM_FLOAT32.  Default = OSSIM_SINT16
+    * Can be changed via ".omd" file keyword:
+    */
+   ossimScalarType             theScalarType;
+   
+TYPE_DATA
+};
+
+#endif  // #ifndef ossimUsgsDemTileSource_HEADER
diff --git a/include/ossim/imaging/ossimValueAssignImageSourceFilter.h b/include/ossim/imaging/ossimValueAssignImageSourceFilter.h
new file mode 100644
index 0000000..40dda54
--- /dev/null
+++ b/include/ossim/imaging/ossimValueAssignImageSourceFilter.h
@@ -0,0 +1,102 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimValueAssignImageSourceFilter.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimValueAssignImageSourceFilter_HEADER
+#define ossimValueAssignImageSourceFilter_HEADER
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/**
+ * This allows one to assign a value to a group of bands.  It will test
+ * for equality band separate or as group. For example:
+ *
+ * if we are testing as a group then the assign will not happen unless
+ * all values equal theInputValue array
+ *
+ *  inputValue = <1, 2, 3>
+ *  outputValue = <100, 100, 100>
+ *
+ *  then it will only convert to 100, 100, 100 if the input equals all
+ *  values of the output.
+ *
+ * input <1, 55, 3>  would become <1, 55, 3>
+ * input <1, 2, 3>   would become <100, 100, 100>
+ *
+ *  Now for band separate it means you want to change on a per band and
+ *  not as a group.  For example:
+ *
+ * inputValue = <1, 2, 3>
+ * outputValue = <100, 100, 100>
+ *
+ * input <1, 55, 3>  would become <100, 55, 100>
+ *
+ */
+class OSSIMDLLEXPORT ossimValueAssignImageSourceFilter : public ossimImageSourceFilter
+{
+public:
+   enum ossimValueAssignType
+   {
+      ossimValueAssignType_SEPARATE = 1,
+      ossimValueAssignType_GROUP    = 2
+   };
+   
+   ossimValueAssignImageSourceFilter(ossimObject* owner=NULL);
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                   ossim_uint32 resLevel=0);
+
+   void setInputOutputValues(const vector<double>& inputValues,
+                             const vector<double>& outputValues);
+
+   const vector<double>& getInputValues()const;
+   const vector<double>& getOutputValues()const;
+   ossimValueAssignType getValueAssignType()const;
+   void setValueAssignType(ossimValueAssignType type);
+
+   virtual void initialize();
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=NULL)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=NULL);
+   
+protected:
+   virtual ~ossimValueAssignImageSourceFilter();
+
+   /**
+    * Called on first getTile, will initialize all data needed.
+    */
+   void allocate();
+   
+   vector<double>              theInputValueArray;
+   vector<double>              theOutputValueArray;
+   ossimValueAssignType        theAssignType;
+   ossimRefPtr<ossimImageData> theTile;
+   
+   void validateArrays();
+   
+   template <class T>
+      void executeAssign(T, ossimRefPtr<ossimImageData>& data);
+   
+   template <class T>
+      void executeAssignSeparate(T, ossimRefPtr<ossimImageData>& data);
+   
+   template <class T>
+      void executeAssignGroup(T, ossimRefPtr<ossimImageData>& data);
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimValueAssignImageSourceFilter_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimVectorRenderer.h b/include/ossim/imaging/ossimVectorRenderer.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimVectorRenderer.h
rename to include/ossim/imaging/ossimVectorRenderer.h
diff --git a/ossim/include/ossim/imaging/ossimVertexExtractor.h b/include/ossim/imaging/ossimVertexExtractor.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimVertexExtractor.h
rename to include/ossim/imaging/ossimVertexExtractor.h
diff --git a/include/ossim/imaging/ossimVpfAnnotationCoverageInfo.h b/include/ossim/imaging/ossimVpfAnnotationCoverageInfo.h
new file mode 100644
index 0000000..074f01d
--- /dev/null
+++ b/include/ossim/imaging/ossimVpfAnnotationCoverageInfo.h
@@ -0,0 +1,77 @@
+//*************************************************************************
+// Copyright (C) 2004 Intelligence Data Systems, Inc.  All rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//**************************************************************************
+// $Id: ossimVpfAnnotationCoverageInfo.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimVpfAnnotationCoverageInfo_HEADER
+#define ossimVpfAnnotationCoverageInfo_HEADER
+#include <ossim/imaging/ossimVpfAnnotationFeatureInfo.h>
+#include <ossim/vec/ossimVpfCoverage.h>
+class ossimVpfLibrary;
+
+class ossimRgbImage;
+
+class ossimVpfAnnotationCoverageInfo
+{
+public:
+  ossimVpfAnnotationCoverageInfo(const ossimString& name="")
+    :theName(name)
+  {
+    
+  }
+  virtual ~ossimVpfAnnotationCoverageInfo()
+  {
+    deleteAllFeatures();
+  }
+  bool hasRenderableFeature()const;
+  void getEnabledFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result);
+  void getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result);
+
+  void transform(ossimImageGeometry* geom);
+  ossimIrect getBoundingProjectedRect()const;
+  void buildCoverage();
+  void buildCoverage(const ossimString& feature);
+  void setName(const ossimString& name)
+  {
+    theName = name;
+  }
+  ossimString getName()const
+     {
+        return theName;
+     }
+  void setLibrary(ossimVpfLibrary* library)
+  {
+    theLibrary = library;
+  }
+  ossimVpfLibrary* getLibrary()
+  {
+    return theLibrary;
+  }
+  const ossimVpfLibrary* getLibrary()const
+  {
+    return theLibrary;
+  }
+  void drawAnnotations(ossimRgbImage* tile);
+   void deleteAllFeatures();
+
+  virtual bool saveState(ossimKeywordlist& kwl,
+			 const char* prefix=0)const;
+  virtual bool loadState(const ossimKeywordlist& kwl,
+			 const char* prefix=0);
+protected:
+  ossimString theName;
+
+  /*!
+   * Not owned.
+   */
+  ossimVpfLibrary* theLibrary;
+  std::vector<ossimVpfAnnotationFeatureInfo*>           theFeatureInfoArray;
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h b/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h
new file mode 100644
index 0000000..6833c32
--- /dev/null
+++ b/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h
@@ -0,0 +1,229 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimVpfAnnotationFeatureInfo.h 19636 2011-05-24 16:48:45Z gpotts $
+#ifndef ossimVpfAnnotationFeatureInfo_HEADER
+#define ossimVpfAnnotationFeatureInfo_HEADER
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimGeoPolygon.h>
+#include <ossim/imaging/ossimGeoAnnotationObject.h>
+#include <ossim/vec/ossimVpfCoverage.h>
+#include <ossim/base/ossimFontInformation.h>
+
+class ossimGeoAnnotationObject;
+class ossimVpfCoverage;
+class ossimVpfFeatureClassSchema;
+class ossimPolyLine;
+
+class OSSIMDLLEXPORT ossimVpfAnnotationFeatureInfo : public ossimObject
+{
+public:
+  enum ossimVpfAnnotationFeatureType
+    {
+      ossimVpfAnnotationFeatureType_UNKNOWN  = 0,
+      ossimVpfAnnotationFeatureType_POINT    = 1,
+      ossimVpfAnnotationFeatureType_LINE     = 2,
+      ossimVpfAnnotationFeatureType_POLYGON  = 3,
+      ossimVpfAnnotationFeatureType_TEXT     = 4,
+    };
+
+  ossimVpfAnnotationFeatureInfo(const ossimString& featureName   = "",
+				const ossimRgbVector& penColor   = ossimRgbVector(255,255,255),
+				const ossimRgbVector& brushColor = ossimRgbVector(255,255,255),
+                                const ossimDpt& pointRadius=ossimDpt(1,1),
+                                int   thickness=0,
+				bool enabledFlag = true);
+  ~ossimVpfAnnotationFeatureInfo();
+
+  void setCoverage(const ossimVpfCoverage& coverage)
+  {
+    theCoverage = coverage;
+  }
+
+  const ossimVpfCoverage& getCoverage()const
+  {
+    return theCoverage;
+  }
+  ossimVpfCoverage& getCoverage()
+  {
+    return theCoverage;
+  }
+
+   void setColor(const ossimRgbVector& color)
+      {
+         setPenColor(color);
+         setBrushColor(color);
+      }
+  void setPenColor(const ossimRgbVector& penColor)
+  {
+    thePenColor = penColor;
+  }
+
+  ossimRgbVector getPenColor()const
+  {
+    return thePenColor;
+  }
+
+  void setBrushColor(const ossimRgbVector& brushColor)
+  {
+    theBrushColor = brushColor;
+  }
+
+  ossimRgbVector getBrushColor()const
+  {
+    return theBrushColor;
+  }
+
+  void setFillEnabledFlag(bool flag)
+  {
+     theFillEnabledFlag = flag;
+  }
+  bool getFillEnabledFlag()const
+  {
+     return theFillEnabledFlag;
+  }
+  void setEnabledFlag(bool flag);
+  bool getEnabledFlag()const
+  {
+    return theEnabledFlag;
+  }
+
+  void setThickness(int thickness)
+  {
+     theThickness = thickness;
+  }
+
+  int getThickness()const
+  {
+     return theThickness;
+  }
+  
+  void setName(const ossimString& name)
+  {
+    theName = name;
+  }
+  const ossimString& getName()const
+  {
+    return theName;
+  }
+   
+  bool isPoint()const
+  {
+     return (theFeatureType == ossimVpfAnnotationFeatureType_POINT);
+  }
+  bool isLine()const
+  {
+     return (theFeatureType == ossimVpfAnnotationFeatureType_LINE);
+  }
+  bool isPolygon()const
+  {
+     return (theFeatureType == ossimVpfAnnotationFeatureType_POLYGON);
+  }
+  bool isText()const
+  {
+     return (theFeatureType == ossimVpfAnnotationFeatureType_TEXT);
+  }
+  void getFontInformation(ossimFontInformation& fontInfo)const
+  {
+     fontInfo = theFontInformation;
+  }
+  void setFontInformation(const ossimFontInformation& fontInfo)
+  {
+     theFontInformation = fontInfo;
+  }
+
+  void setPointRadius(const ossimDpt& radius)
+  {
+    thePointRadius = radius;
+  }
+  ossimDpt getPointRadius()const
+  {
+    return thePointRadius;
+  }
+  void setDrawingFeaturesToAnnotation();
+  ossimIrect getBoundingProjectedRect()const;
+  void transform(ossimImageGeometry* proj);
+  void buildFeature();
+  void deleteAllObjects();
+  void drawAnnotations(ossimRgbImage* tile);
+
+  bool saveState(ossimKeywordlist& kwl,
+		 const char* prefix=0)const;
+  bool loadState(const ossimKeywordlist& kwl,
+		 const char* prefix=0);
+  ossimString getFeatureTypeAsString()const;
+  ossimVpfAnnotationFeatureType getFeatureTypeFromString(const ossimString& featureType)const;
+
+private:
+  void readAttributes(ossimPolyLine& polyLine, ossimVpfTable& table, int row);
+  void readAttributes(ossimGeoPolygon& polygon, ossimVpfTable& table, int row);
+
+protected:
+  ossimString                   theName;
+  ossimString                   theDescription;
+  ossimRgbVector                thePenColor;
+  ossimRgbVector                theBrushColor;
+  ossimVpfCoverage              theCoverage;
+  ossimDpt                      thePointRadius;
+  int                           theThickness; 
+  bool                          theFillEnabledFlag;
+  bool                          theEnabledFlag;
+  ossimVpfAnnotationFeatureType theFeatureType;
+  ossimFontInformation          theFontInformation;
+   
+  std::vector<ossimRefPtr<ossimGeoAnnotationObject> > theAnnotationArray;
+
+  void buildTxtFeature(const ossimFilename& table,
+                       const ossimString&   tableKey,
+                       const ossimFilename& primitive,
+                       const ossimString&   primitiveKey);
+   
+  void buildEdgFeature(const ossimFilename& table,
+                       const ossimString&   tableKey,
+		       const ossimFilename& primitive,
+		       const ossimString&   primitiveKey);
+
+  void buildPointFeature(const ossimString& primitiveName,
+			 const ossimFilename& table,
+			 const ossimString&   tableKey,
+			 const ossimFilename& primitive,
+			 const ossimString&   primitiveKey);
+  void buildFaceFeature(const ossimFilename& table,
+                        const ossimString&   tableKey,
+                        const ossimFilename& primitive,
+			const ossimString&   primitiveKey);
+  
+
+  void readEdge(ossimPolyLine& polyLine,
+		int rowNumber,
+		int colPosition,
+		ossimVpfTable& edgeTable);
+  int readTableCellAsInt (int rowNumber, // should replace calls to readRngId, readStartEdgeId with this
+			  int colNumber,
+			  ossimVpfTable& table);
+  int readRngId(int rowNumber,
+		int colNumber,
+		ossimVpfTable& faceTable);
+  int readStartEdgeId(int rowNumber,
+		      int colNumber,
+		      ossimVpfTable& rngTable);
+  void readGeoPolygon(ossimGeoPolygon& polygon,
+		      int faceId,
+		      int startEdgeId,
+		      ossimVpfTable& edgTable);
+
+  ossimDpt* getXy(vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32* count);
+  int getEdgeKeyId (vpf_table_type& table, row_type& row, int col);
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/imaging/ossimVpfAnnotationLibraryInfo.h b/include/ossim/imaging/ossimVpfAnnotationLibraryInfo.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimVpfAnnotationLibraryInfo.h
rename to include/ossim/imaging/ossimVpfAnnotationLibraryInfo.h
diff --git a/ossim/include/ossim/imaging/ossimVpfAnnotationSource.h b/include/ossim/imaging/ossimVpfAnnotationSource.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimVpfAnnotationSource.h
rename to include/ossim/imaging/ossimVpfAnnotationSource.h
diff --git a/include/ossim/imaging/ossimVpfTileSource.h b/include/ossim/imaging/ossimVpfTileSource.h
new file mode 100644
index 0000000..23988dd
--- /dev/null
+++ b/include/ossim/imaging/ossimVpfTileSource.h
@@ -0,0 +1,164 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2004 Garrett Potts, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// $Id: ossimVpfTileSource.h 17932 2010-08-19 20:34:35Z dburken $
+//----------------------------------------------------------------------------
+#ifndef ossimVpfTileSource_HEADER
+#define ossimVpfTileSource_HEADER
+
+#include <ossim/imaging/ossimVpfAnnotationSource.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimViewInterface.h>
+
+
+class OSSIMDLLEXPORT ossimVpfTileSource : public ossimImageHandler,
+                                          public ossimViewInterface
+{
+public:
+   
+   ossimVpfTileSource();
+
+   virtual void close();
+
+   /**
+    *  @return Returns true on success, false on error.
+    *
+    *  @note This method relies on the data member ossimImageData::theImageFile
+    *  being set.  Callers should do a "setFilename" prior to calling this
+    *  method or use the ossimImageHandler::open that takes a file name and an
+    *  entry index.
+    */   
+   virtual bool open();
+
+   /*!
+    *  Returns a pointer to a tile given an origin representing the upper
+    *  left corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+
+   /*!
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+
+    /*!
+    * Returns the number of bands in a tile returned from this TileSource.
+    * Note: we are supporting sources that can have multiple data objects.
+    * If you want to know the scalar type of an object you can pass in the 
+    */
+   virtual ossim_uint32 getNumberOfOutputBands() const;
+  
+   /*!
+    *  Returns the number of bands in the image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
+
+   /*!
+    *  Returns the number of bands available from an image.
+    *  Satisfies pure virtual from ImageHandler class.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
+
+   /*!
+    * Returns the number of reduced resolution data sets (rrds).
+    * Note:  The full res image is counted as a data set so an image with no
+    *        reduced resolution data set will have a count of one.
+    */
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+
+   /*!
+    * Returns the zero based image rectangle for the reduced resolution data
+    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
+    */
+   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
+
+   /*!
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix);
+   
+   //! Returns the image geometry object associated with this tile source or NULL if non defined.
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /*!
+    * Returns the output pixel type of the tile source.
+    */
+   virtual ossimScalarType getOutputScalarType() const;
+
+   /*!
+    * Returns the width of the output tile.
+    */
+   virtual ossim_uint32 getTileWidth() const;
+   
+   /*!
+    * Returns the height of the output tile.
+    */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /*!
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /*!
+    * Returns the tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   virtual bool isOpen()const;
+   
+   virtual double getNullPixelValue(ossim_uint32 band=0)const;
+
+   virtual double getMinPixelValue(ossim_uint32 band=0)const;
+      
+   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
+
+   virtual ossimObject* getView();
+
+   virtual const ossimObject* getView()const;
+   
+   virtual bool setView(ossimObject*  baseObject);
+
+   void getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& featureList);
+  
+   void setAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& featureList);
+
+   void transformObjects();
+
+   void computeBoundingRect();
+
+protected:
+   virtual ~ossimVpfTileSource();
+   ossimRefPtr<ossimVpfAnnotationSource> m_AnnotationSource;
+   
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/imaging/ossimWatermarkFilter.h b/include/ossim/imaging/ossimWatermarkFilter.h
new file mode 100644
index 0000000..8f7bdf4
--- /dev/null
+++ b/include/ossim/imaging/ossimWatermarkFilter.h
@@ -0,0 +1,347 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class declaration of ossimWatermarkFilter.
+// Applies an image or watermark to image.  Positioning is based on mode.
+// Density is base on alpha weight.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimWatermarkFilter.h 16276 2010-01-06 01:54:47Z gpotts $
+#ifndef ossimWatermarkFilter_HEADER
+#define ossimWatermarkFilter_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+
+/**
+ * class ossimWatermarkFilter
+ * Applies an image or watermark to image.
+ * Positioning is based on mode.
+ * Density is base on alpha weight.
+ */
+class OSSIMDLLEXPORT ossimWatermarkFilter : public ossimImageSourceFilter
+{
+public:
+
+   enum WatermarkMode
+   {
+      UPPER_LEFT     = 0,
+      UPPER_CENTER   = 1,
+      UPPER_RIGHT    = 2,
+      CENTER         = 3,
+      LOWER_LEFT     = 4,
+      LOWER_CENTER   = 5,
+      LOWER_RIGHT    = 6,
+      UNIFORM_DENSE  = 7,
+      UNIFORM_SPARSE = 8,
+      END            = 9 //< Number of modes.
+   };
+      
+   /** contructor */
+   ossimWatermarkFilter();
+
+   /** @return Short name of filter. */
+   virtual ossimString getShortName()   const;
+
+   /** @return Long name of filter. */
+   virtual ossimString getLongName()    const;
+
+   /** @return Descriptive name of filter. */
+   virtual ossimString getDescription() const;
+
+   /**
+    * @param tile_rect Rectangle to fill tile with.
+    * 
+    * @param resLevel Reduced resolution level to grab from.
+    * 
+    * @return ossimRefPtr<ossimImageData> This is tile that was filled with
+    * tile_rect.
+    *
+    * @note Callers should check the ossimRefPtr::valid method.
+    * The internal pointer of the ossimRefPtr<ossimImageData> can be
+    * null if the tile_rect did not intersect the input connection's
+    * bounding rectangle.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
+                                               ossim_uint32 resLevel=0);
+   
+   /**
+    * Initializes state of the object from the input connection.
+    */
+   virtual void initialize();
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    *
+    * Keywords picked saved by saveState
+    * 
+    * filename: my_colormap_file.jpg
+    *
+    * weight: .25
+    * 
+    * watermark_mode:  upper_left
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /**
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.
+    *
+    * @param kwl Keyword list to initialize from.
+    *
+    * @param prefix Usually something like: "object1."
+    *
+    * @return This method will alway return true as it is intended to be
+    * used in conjuction with the set methods.
+    *
+    * Keywords picked up by loadState:
+    * 
+    * filename: my_colormap_file.jpg
+    *
+    * weight: .25
+    * 
+    * watermark_mode:  upper_left
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * @param The property to get as a string like "watermark_mode".
+    *
+    * @return ossimRefPt<ossimProperty> holding pointer to ossimProperty
+    * matching string or null pointer if string does not match.
+    *
+    * @note Internal pointer can be null so callers should check prior to
+    * accessing like:
+    * ossimRefPtr<ossimProperty> p = myFilter->getProperty(ossimString("foo"));
+    * if (p.valid() == NULL)
+    * {
+    *    some_error;
+    * }
+    */
+   virtual ossimRefPtr<ossimProperty> getProperty(
+      const ossimString& name)const;
+
+   /**
+    * Set property.
+    *
+    * @param property Property to set if property->getName() matches a
+    * property name of this object.
+    */
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+
+   /**
+    * Adds this objects properties to the list.
+    *
+    * @param propertyNames Array to add to.
+    *
+    * @note This method does not clear propertyNames prior to adding it's
+    * names.
+    */
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @param list List initialized with watermark mode strings.
+    *
+    * @note This method clears the "list" prior to stuffing.
+    */
+   void getModeList(vector<ossimString>& list) const;
+
+   /** @return theMode */
+   ossimWatermarkFilter::WatermarkMode getMode() const;
+
+   /** @return theMode as a string like "upper_left". */
+   ossimString getModeString() const;
+
+   /**
+    * Sets theFilename to file.
+    *
+    * @param file The watermark image file.
+    */
+   void setFilename(const ossimFilename& file);
+
+   /**
+    * Sets the filter mode.
+    *
+    * @param mode String representing mode.
+    */
+   void setMode(const ossimString& mode);
+
+   /**
+    * Sets the weight.
+    *
+    * @param weight Weight to use for watermark pixels normalize between
+    * 0.0 and 1.0.
+    */
+   void setWeight(ossim_float64 weight);
+   
+   /**
+    * Print method.  Called by: friend operator<<
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+   /** destructor */
+   virtual ~ossimWatermarkFilter();
+
+   /**
+    * Allocates / recomputes things that are needed.  Clears theDirtyFlag
+    * by setting it to false on success.
+    *
+    * @return true on success, false on error.
+    */
+   bool allocate();
+
+   /**
+    * Attempts to open "theFilename".  This will load "theWatermark" with
+    * the image converting it to the scalar type of the input connection.
+    *
+    * @return true on success, false if no image handler is found for the
+    * image or theInputConnection has not been established.
+    */
+   bool openWatermarkFile();
+   
+   // void verifyEnable();
+
+   /**
+    * Writes watermark(s) to theTile.
+    * Performs theTile->validate() at the end if theTile was touched.
+    */
+   template <class T> void fill(T dummy);
+
+   /**
+    * Computes the bounding rectangles.  These are the rectangles in image
+    * space of the input connection to paint the watermark(s) on.  The start of
+    * each rectangle will be the start of where "theWatermark" is painted.
+    */
+   void getIntersectingRects(vector<ossimIrect>& rects);
+
+   /**
+    * Addes upper left watermark rectangle to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getUpperLeftRect(vector<ossimIrect>& rects);
+   
+   /**
+    * Addes upper center watermark rectangle to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getUpperCenterRect(vector<ossimIrect>& rects);
+   
+   /**
+    * Addes upper right watermark rectangle to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getUpperRightRect(vector<ossimIrect>& rects);
+
+   /**
+    * Addes center watermark rectangle to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getCenterRect(vector<ossimIrect>& rects);
+
+   /**
+    * Addes lower left watermark rectangle to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getLowerLeftRect(vector<ossimIrect>& rects);
+
+   /**
+    * Addes lower center watermark rectangle to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getLowerCenterRect(vector<ossimIrect>& rects);
+   
+   /**
+    * Addes lower right watermark rectangle to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getLowerRightRect(vector<ossimIrect>& rects);
+   
+   /**
+    * Addes rectangles to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * This will repeat the watermark throughout the input bounding rect.
+    *
+    * @param rects Array to add rect to.
+    */
+   void getUniformDenseRects(vector<ossimIrect>& rects);
+   
+   /**
+    * Addes rectangles to rects if it intersects
+    * theTile rect clipped to input bounding rect.
+    *
+    * This will repeat the watermark sparsly throughout the input bounding
+    * rect.
+    * 
+    * @param rects Array to add rect to.
+    */
+   void getUniformSparceRects(vector<ossimIrect>& rects);
+   
+   /** File name of watermark image. */
+   ossimFilename      theFilename;
+
+   /** Normalized between 0.0 and 1.0. */
+   ossim_float64      theWatermarkWeight;
+
+   /** The returned tile. */
+   ossimRefPtr<ossimImageData> theTile;
+
+   /** Tile storage for watermark image. */
+   ossimRefPtr<ossimImageData> theWatermark;
+
+   /** The number of watermark bands. */
+   ossim_uint32 theWatermarkNumberOfBands;
+
+   /** The filter mode. */
+   WatermarkMode      theMode;
+
+   /** The bounding rectangle of the input connection. */
+   ossimIrect theInputBoundingRect;
+
+   /** The number of input bands. */
+   ossim_uint32 theInputNumberOfBands;
+
+   /** The input scalar type. */
+   ossimScalarType theInputScalarType;
+
+   /**
+    * Set in the initialize method this instructs the getTile that something
+    * has changes and it need to call initialize.
+    */
+   bool theDirtyFlag;
+
+
+TYPE_DATA
+      
+}; // End of class ossimWatermarkFilter.
+
+#endif /* #ifndef ossimWatermarkFilter_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimWorldFileWriter.h b/include/ossim/imaging/ossimWorldFileWriter.h
similarity index 100%
rename from ossim/include/ossim/imaging/ossimWorldFileWriter.h
rename to include/ossim/imaging/ossimWorldFileWriter.h
diff --git a/include/ossim/imaging/ossimWriter.h b/include/ossim/imaging/ossimWriter.h
new file mode 100644
index 0000000..5880b9c
--- /dev/null
+++ b/include/ossim/imaging/ossimWriter.h
@@ -0,0 +1,208 @@
+//---
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Generic image writer class.
+// 
+//---
+// $Id$
+#ifndef ossimWriter_HEADER
+#define ossimWriter_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <iosfwd>
+#include <vector>
+
+/**
+ * @brief ossimWriter - Generic image writer.
+ *
+ * Please do NOT add any external library dependencies. drb - 26 May 2016
+ */
+class OSSIM_DLL ossimWriter : public ossimImageFileWriter
+{
+public:
+   
+   /** default constructor */
+   ossimWriter();
+
+   /** virtual destructor */
+   virtual ~ossimWriter();
+
+   /** @return "ossim_writer" */
+   virtual ossimString getShortName() const;
+
+   /** @return "ossim writer" */
+   virtual ossimString getLongName() const;
+
+   /** @return "ossimWriter" */
+   virtual ossimString getClassName() const;
+
+   /**
+    * Returns a 3-letter extension from the image type descriptor 
+    * (theOutputImageType) that can be used for image file extensions.
+    *
+    * @param imageType string representing image type.
+    *
+    * @return the 3-letter string extension.
+    */
+   virtual ossimString getExtension() const;
+   
+   /**
+    * @brief getImageTypeList method.
+    *
+    * Satisfies ossimImageFileWriter::getImageTypeList pure virtual.
+    * 
+    * Appends the writers image types to the "imageTypeList".
+    * 
+    * Current write type:
+    * ossim_ttbs - tiled tiff band separate, big tiff format.
+    *
+    * @param imageTypeList list to append to.
+    */
+   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList) const;
+
+   /**
+    * @brief isOpen
+    * @return true if open; else, false.
+    */
+   virtual bool isOpen()const; 
+
+   /**
+    * @brief open
+    * @return true on success, false on error.
+    */
+   virtual bool open();
+
+   /** @brief close Flushes and deletes stream if we own it. */
+   virtual void close();
+   
+   bool hasImageType(const ossimString& imageType) const;
+
+   /**
+    * @brief Method to write the image to a stream.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool writeStream();
+
+   /**
+    * @brief Sets the output stream to write to.
+    *
+    * This sets the stream and sets m_ownsStreamFlag to false. So destructor
+    * will not delete the stream if this method is used.
+    * 
+    * @param stream The stream to write to.
+    * @return true if object can write to stream, false if not.
+    */
+   virtual bool setOutputStream(std::ostream& str);
+
+protected:
+   
+   /**
+    * @brief Write out the file.
+    * @return true on success, false on error.
+    */
+   virtual bool writeFile();
+
+private:
+
+   /**
+    * @brief Writes a tiled tiff band separate to stream.
+    * @return true on success, false on error.
+    */
+   bool writeStreamTtbs();
+
+   /**
+    * @brief Writes tiff header to stream.
+    * @return true on success, false on error.
+    */
+   bool writeTiffHdr();
+
+   /**
+    * @brief Writes tags to image file directory(IFD).
+    * @param tile_offsets
+    * @param tile_byte_counts
+    * @param minBands
+    * @param maxBands
+    * @return true on success, false on error.
+    */
+   bool writeTiffTags( const std::vector<ossim_uint64>& tile_offsets,
+                       const std::vector<ossim_uint64>& tile_byte_counts,
+                       const std::vector<ossim_float64>& minBands,
+                       const std::vector<ossim_float64>& maxBands );
+
+   /**
+    * @brief Writes tags TIFFTAG_MINSAMPLEVALUE(280) and
+    * TIFFTAG_MAXSAMPLEVALUE(281).  Only written if scalar type is an unsigned
+    * byte or short.
+    * @param minBands Array of min values from image write.
+    * @param maxBands Array of max values from image write.
+    * @return true on success, false on error.
+    */
+   bool writeMinMaxTiffTags( const std::vector<ossim_float64>& minBands,
+                             const std::vector<ossim_float64>& maxBands,
+                             std::streamoff& arrayWritePos  );
+
+
+   /**
+    * @brief Writes tags TIFFTAG_SMINSAMPLEVALUE(340) and
+    * TIFFTAG_SMAXSAMPLEVALUE(341).  Only written if scalar type is not an
+    * unsigned byte or short.
+    * @param minBands Array of min values from image write.
+    * @param maxBands Array of max values from image write.
+    * @return true on success, false on error.
+    */
+   bool writeSMinSMaxTiffTags( const std::vector<ossim_float64>& minBands,
+                             const std::vector<ossim_float64>& maxBands,
+                             std::streamoff& arrayWritePos  );
+
+   /**
+    * @brief Writes tiff tag to image file directory(IFD).
+    * @param tag
+    * @param type
+    * @param count
+    * @param value(s) or offset to array.
+    * @param arrayWritePos Position to write array to.  This will be updated
+    * if array is written with new offset.
+    */   
+   template <class T> void writeTiffTag(ossim_uint16 tag, ossim_uint16 type,
+                                        ossim_uint64 count,
+                                        const T* value,
+                                        std::streamoff& arrayWritePos );
+
+   /**
+    * @brief Writes image data to stream.
+    *
+    * Data is in a band separate tile layout(PLANARCONFIG_SEPARATE), i.e. all
+    * the red tiles, all the green tiles, all the blue tiles.
+    * 
+    * @param tile_offsets Initialized by this with offset for each tile.
+    * @param tile_byte_counts Initialized by this with the byte count of each
+    * tile.
+    * @param minBands Initialized by this with the min values for each band.
+    * @param maxBands Initialized by this with the max values for each band.
+    * @return true on success, false on error.
+    */
+   bool writeTiffTilesBandSeparate( std::vector<ossim_uint64>& tile_offsets,
+                                    std::vector<ossim_uint64>& tile_byte_counts,
+                                    std::vector<ossim_float64>& minBands,
+                                    std::vector<ossim_float64>& maxBands );
+
+   /**
+    * @brief Gets the tiff sample format based on scalar type.
+    * E.g SAMPLEFORMAT_UINT, SAMPLEFORMAT_INT or SAMPLEFORMAT_IEEEFP.
+    * @return TIFF sample format or 0 if not mapped to a scalar type.
+    */
+   ossim_uint16 getTiffSampleFormat() const;
+  
+   std::ostream* m_str;
+   bool          m_ownsStreamFlag; 
+   
+}; // End: class ossimWriter
+
+#endif /* End of "#ifndef ossimWriter_HEADER" */
diff --git a/include/ossim/init/ossimInit.h b/include/ossim/init/ossimInit.h
new file mode 100644
index 0000000..38a2c1b
--- /dev/null
+++ b/include/ossim/init/ossimInit.h
@@ -0,0 +1,154 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// DESCRIPTION:
+//   Contains declaration of class ossimInit. This object handles all aspects
+//   of initialization for OSSIM applications. These tasks include:
+//
+//      1. Parsing the command line.
+//      2. Instantiating all class factories as declared in ossimFactories.h
+//      3. Initializing the "trace" code execution tracing functionality.
+//      4. Scanning the preferences file for relevant values.
+//
+// SOFTWARE HISTORY:
+//>
+//   24Apr2001  Oscar Kramer
+//              Initial coding.
+//<
+//*****************************************************************************
+// $Id: ossimInit.h 19440 2011-04-25 16:41:28Z dburken $
+#ifndef ossimInit_HEADER
+#define ossimInit_HEADER 1
+
+#include <ossim/base/ossimFilename.h>
+
+class ossimPreferences;
+class ossimArgumentParser;
+
+class OSSIMDLLEXPORT ossimInit
+{
+public:
+
+   ~ossimInit();
+   /*!
+    * Returns the static instance of an ossimInit object. This is of no use
+    * until non-static methods are implemented.
+    */
+   static ossimInit* instance();
+
+   void addOptions(ossimArgumentParser& parser);
+
+   /*!
+    * METHOD: initialize()
+    * This method shall be called from the application's main module with
+    * the command-line arguments. Every OSSIM application should have the
+    * following line early in the main module:
+    *
+    *   ossimInit::initialize(argc, argv);
+    *
+    * OR
+    *
+    *   ossimInit::instance()->initialize(argc, argv);
+    *
+    * The two forms are functionally identical. Pick the latter form if you
+    * like to type. The argv command line options are parsed and may be
+    * stripped. the value of argc will be adjusted to account for stripped
+    * options.
+    */
+   void initialize(int& argc, char** argv);
+
+   void initialize(ossimArgumentParser& parser);
+   
+   void initialize();
+
+   void finalize();
+
+   /*!
+    * METHOD: usage()
+    * Prints to stdout the list of command line options that this object parses
+    */
+   void usage();
+
+   /** @return theElevEnabledFlag */
+   bool getElevEnabledFlag() const;
+
+   /**
+    * @brief Sets theElevEnabledFlag.
+    * @param flag If true ossimElevManager will be initialized. Set to false
+    * to NOT initialize the ossimElevManager from preferences.
+    * Default in class is true.
+    */
+   void setElevEnabledFlag(bool flag);
+
+   void setPluginLoaderEnabledFlag(bool flag);
+
+   /**
+    * Can take a file or a directory.  If a directory is givien then it will check all files in
+    * the directory and add each file that is detected to be a valid plugin.
+    *
+    * @param plugin Is the filename of the plugin to load
+    * @param options Is a keywordlist of plugin specific options
+    
+    */ 
+   void loadPlugins(const ossimFilename& plugin, const char* options=0);
+   
+   void initializePlugins();
+   void initializeDefaultFactories();
+   void initializeElevation();
+
+   /**
+    * @brief Initializes log file from preferences keyword lookup
+    * of "ossim.log.file" if log file has not already been set and
+    * keyword is set in preferences.
+    *
+    * So this should be called after parse options as the --ossim-logfile
+    * should override any preferences setting.
+    */
+   void initializeLogFile();
+
+   /**
+    * @return The version in the form of:
+    * "version major.minor.release (yyyymmdd)"
+    * where
+    * yyyymmdd is the build date.
+    *
+    * e.g. "version 1.7.0 (20071003)"
+    */
+   ossimString version() const;
+
+   ossimFilename appName()const;
+
+protected:
+   /** protected default constructor. */
+   ossimInit();
+
+   /** Hidden from use copy constructor. */
+   ossimInit(const ossimInit& obj);
+   
+   /** Hidden from use assignment operator. */
+   void operator=(const ossimInit& rhs) const;
+   
+   void parseOptions(ossimArgumentParser& parser);
+
+   void parseNotifyOption(ossimArgumentParser& parser);
+   void parseEnvOptions(ossimArgumentParser& parser);
+   void parsePrefsOptions(ossimArgumentParser& parser);
+   /*!
+    * METHOD: removeOptions()
+    * Utility for stripping from argv all characters associated with a
+    * particular option:
+    */
+   void removeOption(int&   argc, 
+                     char** argv,
+                     int    argToRemove);
+   
+   static ossimInit*  theInstance;
+   bool               theInitializedFlag;  
+   ossimFilename      theAppName;
+   ossimPreferences*  thePreferences;
+   bool               theElevEnabledFlag;
+   bool               thePluginLoaderEnabledFlag;
+};
+
+#endif
diff --git a/ossim/include/ossim/matrix/controlw.h b/include/ossim/matrix/controlw.h
similarity index 100%
rename from ossim/include/ossim/matrix/controlw.h
rename to include/ossim/matrix/controlw.h
diff --git a/ossim/include/ossim/matrix/include.h b/include/ossim/matrix/include.h
similarity index 100%
rename from ossim/include/ossim/matrix/include.h
rename to include/ossim/matrix/include.h
diff --git a/ossim/include/ossim/matrix/myexcept.h b/include/ossim/matrix/myexcept.h
similarity index 100%
rename from ossim/include/ossim/matrix/myexcept.h
rename to include/ossim/matrix/myexcept.h
diff --git a/ossim/include/ossim/matrix/newmat.h b/include/ossim/matrix/newmat.h
similarity index 100%
rename from ossim/include/ossim/matrix/newmat.h
rename to include/ossim/matrix/newmat.h
diff --git a/ossim/include/ossim/matrix/newmatap.h b/include/ossim/matrix/newmatap.h
similarity index 100%
rename from ossim/include/ossim/matrix/newmatap.h
rename to include/ossim/matrix/newmatap.h
diff --git a/ossim/include/ossim/matrix/newmatio.h b/include/ossim/matrix/newmatio.h
similarity index 100%
rename from ossim/include/ossim/matrix/newmatio.h
rename to include/ossim/matrix/newmatio.h
diff --git a/ossim/include/ossim/matrix/newmatnl.h b/include/ossim/matrix/newmatnl.h
similarity index 100%
rename from ossim/include/ossim/matrix/newmatnl.h
rename to include/ossim/matrix/newmatnl.h
diff --git a/ossim/include/ossim/matrix/newmatrc.h b/include/ossim/matrix/newmatrc.h
similarity index 100%
rename from ossim/include/ossim/matrix/newmatrc.h
rename to include/ossim/matrix/newmatrc.h
diff --git a/ossim/include/ossim/matrix/newmatrm.h b/include/ossim/matrix/newmatrm.h
similarity index 100%
rename from ossim/include/ossim/matrix/newmatrm.h
rename to include/ossim/matrix/newmatrm.h
diff --git a/ossim/include/ossim/matrix/precisio.h b/include/ossim/matrix/precisio.h
similarity index 100%
rename from ossim/include/ossim/matrix/precisio.h
rename to include/ossim/matrix/precisio.h
diff --git a/ossim/include/ossim/matrix/solution.h b/include/ossim/matrix/solution.h
similarity index 100%
rename from ossim/include/ossim/matrix/solution.h
rename to include/ossim/matrix/solution.h
diff --git a/include/ossim/ossimConfig.h.vc b/include/ossim/ossimConfig.h.vc
new file mode 100644
index 0000000..3da1248
--- /dev/null
+++ b/include/ossim/ossimConfig.h.vc
@@ -0,0 +1,57 @@
+/*  $Id: ossimConfig.h.vc 13809 2008-10-30 13:28:17Z gpotts $ */
+#ifndef ossimConfig_HEADER
+#define ossimConfig_HEADER
+
+/* Define if you have dirent.h.  */
+#define HAVE_DIRENT_H 0
+
+/* Define as 1 if you have unistd.h.  */
+#define HAVE_UNISTD_H 0
+
+/* Define as 1 if you have getopt.h.  */
+#define HAVE_GETOPT_H 0
+
+/* 
+ * Define as 1 if you have fcntl.h. Note this is defined on windows in gdal.
+ * #define HAVE_FCNTL_H 0 
+ */
+
+/* Define as 1 if you have dbmalloc.h.  */
+#define HAVE_DBMALLOC_H 0
+
+/* Define as 1 if you have malloc.h.  */
+#define HAVE_MALLOC_H 1
+
+/* Define as 1 if you have dlfcn.h.  */
+#define HAVE_DLFCN_H 0
+
+#define OSSIM_HAS_LIBZ 1
+
+/* Define if you have support for large (64 bit size) files */
+#define HAVE_LARGEFILE_SUPPORT 0
+
+/* Define to "1" if you have MPI(lam/mpi), "0" if not. */
+#define OSSIM_HAS_MPI 0
+
+/* Define to "1" if you have FREETYPE, "0" if not. */
+#define OSSIM_HAS_FREETYPE 1
+
+/* Define to "1" if you have GEOTIFF, "0" if not. */
+#define OSSIM_HAS_GEOTIFF 1
+
+/* Define to "1" if you have HDF5, "0" if not. */
+#define OSSIM_HAS_HDF5 0
+
+/* Define to "1" if you have OpenThreads for mutex support, "0" if not. */
+#define OSSIM_HAS_OPEN_THREADS 1
+
+/* Enable cvs id strings for use with "ident" application. */
+#define OSSIM_ID_ENABLED 1
+
+/* Enable dynamic library support for plugins.
+ * Usually set to 0 for static applications.
+ */
+#define OSSIM_DYNAMIC_ENABLED 1
+
+
+#endif /* End of "#ifndef ossimConfig_HEADER" */
diff --git a/include/ossim/parallel/ossimIgen.h b/include/ossim/parallel/ossimIgen.h
new file mode 100644
index 0000000..b25cc19
--- /dev/null
+++ b/include/ossim/parallel/ossimIgen.h
@@ -0,0 +1,71 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Class declaration for image generator.
+//
+//*************************************************************************
+// $Id: ossimIgen.h 20303 2011-11-29 16:11:46Z oscarkramer $
+#ifndef ossimIgen_HEADER
+#define ossimIgen_HEADER
+
+#include <iostream>
+#include <list>
+#include <fstream>
+
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimConnectableContainer.h>
+#include <ossim/imaging/ossimTiling.h>
+
+class ossimImageChain;
+class ossimImageFileWriter;
+class ossimMapProjection;
+class ossimImageViewTransform;
+class ossimImageSource;
+class ossimImageMpiMWriterSequenceConnection;
+class ossimImageMpiSWriterSequenceConnection;
+class ossimObject;
+class ossimArgumentParser;
+
+class OSSIM_DLL ossimIgen : public ossimReferenced
+{
+public:
+   ossimIgen();
+   virtual ~ossimIgen();
+
+   virtual void initialize(const ossimKeywordlist& kwl);
+   virtual void outputProduct();
+   
+protected:
+   void initializeAttributes();
+   void slaveSetup();
+   bool loadProductSpec();
+   void setView();
+   void initThumbnailProjection();
+   void initializeChain();
+   bool writeToFile(ossimImageFileWriter* writer);
+
+   ossimRefPtr<ossimConnectableContainer> theContainer;
+   ossimRefPtr<ossimMapProjection>  theProductProjection;
+   ossimRefPtr<ossimImageChain>  theProductChain;
+   ossimRefPtr<ossimTiling>      theTiling;
+   ossimDrect        theOutputRect;
+   bool              theBuildThumbnailFlag;
+   ossimIpt          theThumbnailSize;
+   long              theNumberOfTilesToBuffer;
+   ossimKeywordlist  theKwl;
+   bool              theTilingEnabled;
+   bool              theProgressFlag;
+   bool              theStdoutFlag;
+   ossim_uint32      theThreadCount;
+
+};
+
+#endif
diff --git a/include/ossim/parallel/ossimImageChainMtAdaptor.h b/include/ossim/parallel/ossimImageChainMtAdaptor.h
new file mode 100644
index 0000000..df78dea
--- /dev/null
+++ b/include/ossim/parallel/ossimImageChainMtAdaptor.h
@@ -0,0 +1,127 @@
+//*************************************************************************************************
+//                                            OSSIM
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************************************
+// $Id$
+#ifndef ossimImageChainMtAdaptor_HEADER
+#define ossimImageChainMtAdaptor_HEADER
+
+#include <vector>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
+#include <ossim/base/ossimId.h>
+#include <ossim/base/ossimConnectableContainer.h>
+
+//*************************************************************************************************
+//! This class supports multi-threading of image chain getTile() requests and associated chain
+//! updating. It accepts an original ossimImageChain object which is then cloned (replicated). 
+//! One clone per thread is created, counting the original as clone(0), with all clones
+//! sharing a common input handler (if directed) so that disk access is serialized and thread-safe.
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimImageChainMtAdaptor : public ossimImageChain
+{
+   friend class ossimMultiThreadSequencer; //### FOR DEBUG ONLY
+
+public:
+   ossimImageChainMtAdaptor();
+
+   //! Full constructor accepts the original image chain to clone. 
+   //! @param num_threads  Total number of cloned chains to make available.
+   //! 
+   ossimImageChainMtAdaptor(ossimImageChain* original, ossim_uint32 num_threads=0, bool use_shared_handlers=false, bool use_cache=false, ossim_uint32 cache_tile_size=64);
+   ~ossimImageChainMtAdaptor();
+
+   //! Alternate way of specifying number of threads to support. This is the same as the number of 
+   //! clones that will be available after replicating the original chain. 
+   //! @param num_threads  Total number of cloned chains to make available.
+   void setNumberOfThreads(ossim_uint32 num_threads);
+   void setUseSharedHandlers(bool use_shared_handlers);
+   void setCacheTileSize(ossim_uint32 cache_tile_size);
+   void setUseCache(bool use_cache);
+
+   //! Alternate way of specifying the original chain being adapted for multi-threading.
+   //! @param original  Image chain to be adapted.
+   void setOriginalChain(ossimImageChain* original);
+
+   //! Intercepts the getTile because it should never be called directly. The tile request must go
+   //! to the specific chain clone.
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
+                                               ossim_uint32 resLevel=0);
+   
+   //! Adapts call to original chain so that all clones are initialized.
+   virtual void initialize();
+
+   //! Adapts call to original chain so that clones are replicated after original's loadState.
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
+
+   //! Adapts call to original chain so that adapter-specific keywords can be added to KWL.
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
+
+   //! Adapts the image chain event handler. If the event involves a change to the original image 
+   //! chain, then the clones will need to be regenerated here.
+   virtual void processEvent(ossimEvent& event);
+
+   //! Returns pointer to a specific clone image chain, or NULL if index exceeds the max available.
+   //! The clone at index=0 corresponds to the original, though this detail should be ignored.
+   ossimImageSource* getClone(ossim_uint32 index);
+
+   //! Returns the number of clones available. The original chain always counts as the first clone.
+   ossim_uint32 getNumberOfClones() const { return (ossim_uint32) m_clones.size(); }
+
+   //! These overriding access methods greatly facilitate the implementation of an image chain
+   //! adapter class operating on the member original chain. These methods really should be 
+   //! "protected" but the compiler complains if the base class declarations are "protected".
+   virtual ossimConnectableObject::ConnectableObjectList& imageChainList();
+   virtual const ossimConnectableObject::ConnectableObjectList& imageChainList() const;
+
+   //! Overrides base class implementation in order to make the connection to each clone. This 
+   //! connection is typically to the multi-thread sequencer object.
+   virtual ossim_int32 connectMyOutputTo(ossimConnectableObject* outputObject,
+                                         bool makeInputConnection=true,
+                                         bool createEventFlag=true);
+
+protected:
+   //! Deletes instances of all replicas from the clone list and leaves only the original.
+   void deleteReplicas();
+
+   //! Creates clones of original and pushes them onto the clone list. Returns TRUE if successful.
+   bool replicate();
+
+   //! Manages reconnecting shared image handlers to a cloned image chain (identified by index)
+   //! after its creation. This is in support of shared image handlers. Returns TRUE if successful.
+   bool connectSharedHandlers(ossim_uint32 index);
+
+   //! This is the adaptee image chain.
+   ossimRefPtr<ossimImageChain> m_adaptedChain;
+
+   //! List of replicated child chains' first source (the one receiving the getTile call). The
+   //! first in the list is always the original (adaptee) source. These are owned by the 
+   //! m_chainContainers that are maintained here.
+   std::vector< ossimRefPtr<ossimImageSource> > m_clones;
+   
+   //! The container objects must be kept alive in this vector while their child chains in
+   //! m_clones are used. Containers are used because they are the only way of "duping" a complete 
+   //! chain with all connections properly done. The containers need to persist in order for the 
+   //! chain connections to be maintained (apparent bug in connectable object code). I found it 
+   //! impossible to dissociate the chain from its container. As soon as the container disappeared,
+   //! the chain's internal connections would be disrupted. (OLK 11/11)
+   std::vector< ossimRefPtr<ossimConnectableContainer> > m_chainContainers;
+
+   //! List of handlers that are being shared among all clones (if requested). It is a list since 
+   //! the original chain may involve a combiner with multiple image inputs.
+   typedef std::vector<ossimRefPtr<ossimImageHandlerMtAdaptor> > SharedHandlerList;
+   SharedHandlerList m_sharedHandlers;
+
+   ossim_uint32 m_numThreads;
+
+   bool d_useSharedHandlers;
+   ossim_uint32 d_cacheTileSize;
+   bool d_useCache;
+   bool d_debugEnabled;
+
+};
+#endif /* #ifndef ossimImageChain_HEADER */
diff --git a/include/ossim/parallel/ossimImageHandlerMtAdaptor.h b/include/ossim/parallel/ossimImageHandlerMtAdaptor.h
new file mode 100644
index 0000000..bbab136
--- /dev/null
+++ b/include/ossim/parallel/ossimImageHandlerMtAdaptor.h
@@ -0,0 +1,105 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+//**************************************************************************************************
+//  $Id$
+#ifndef ossimImageHandlerMtAdaptor_HEADER
+#define ossimImageHandlerMtAdaptor_HEADER 1
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimCacheTileSource.h>
+#include <OpenThreads/Thread>
+
+//**************************************************************************************************
+//! Intended mainly to provide a mechanism for mutex-locking access to a shared resource during
+//! a getTile operation on an ossimImageHandler. This is needed for multi-threaded implementation.
+//**************************************************************************************************
+class OSSIMDLLEXPORT ossimImageHandlerMtAdaptor : public ossimImageHandler
+{
+public:
+   static const char* ADAPTEE_ID_KW;
+
+   ossimImageHandlerMtAdaptor(ossimImageHandler* adaptee = 0, bool use_cache=false, ossim_uint32 cache_tile_size=64);
+
+   //! Sets the handler being adapted.
+   void setAdaptee(ossimImageHandler* handler);
+
+   //! Only an ossimImageHandler is allowed as input here.
+   virtual bool canConnectMyInputTo(ossim_int32 i, const ossimConnectableObject* obj) const;
+
+   //! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
+   //! adaptee's getTile call.
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIpt& origin, ossim_uint32 resLevel=0);
+   
+   //! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
+   //! adaptee's getTile call.
+   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0);
+
+   //! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
+   //! adaptee's getTile call.
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+   //! Method to save the state of an object to a keyword list.
+   //! Return true if ok or false on error.
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   //! Method to the load (recreate) the state of an object from a keyword
+   //! list.  Return true if ok or false on error.
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   // The following are virtuals in the base class. Implemented here as pass-through to adaptee
+   virtual ossim_uint32    getNumberOfInputBands() const;
+   virtual bool            isOpen() const;
+   virtual bool            open();
+   virtual ossim_uint32    getNumberOfLines(ossim_uint32 resLevel = 0) const;
+   virtual ossim_uint32    getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+   virtual ossim_uint32    getImageTileWidth() const;
+   virtual ossim_uint32    getImageTileHeight() const;
+   virtual ossimString     getLongName()  const;
+   virtual ossimString     getShortName() const;
+   virtual void            close();
+   virtual ossim_uint32    getNumberOfOutputBands() const;
+   virtual ossim_uint32    getNumberOfDecimationLevels() const;
+   virtual ossimScalarType getOutputScalarType() const;
+   virtual ossim_uint32    getTileWidth() const;
+   virtual ossim_uint32    getTileHeight() const;
+   virtual ossim_float64   getMinPixelValue(ossim_uint32 band=0)const;
+   virtual ossim_float64   getMaxPixelValue(ossim_uint32 band=0)const;
+   virtual ossim_float64   getNullPixelValue(ossim_uint32 band=0)const;
+   void setCacheTileSize(ossim_uint32 cache_tile_size);
+   void setUseCache(bool use_cache);
+   void writeTime() const;
+
+   double       d_getTileT;
+   ossim_uint32 d_cacheTileSize;
+
+protected:
+   //! Protected destructor forces using reference pointer for instantiation.
+   virtual ~ossimImageHandlerMtAdaptor();
+
+   ossimRefPtr<ossimImageHandler>    m_adaptedHandler;
+   ossimRefPtr<ossimCacheTileSource> m_cache;
+   mutable OpenThreads::Mutex        m_mutex;   
+
+   bool                        d_useCache;
+   bool                        d_useFauxTile;
+   ossimRefPtr<ossimImageData> d_fauxTile;
+   friend class ossimMtDebug;
+
+TYPE_DATA
+};
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/include/ossim/parallel/ossimImageMpiMWriterSequenceConnection.h b/include/ossim/parallel/ossimImageMpiMWriterSequenceConnection.h
new file mode 100644
index 0000000..52bcc21
--- /dev/null
+++ b/include/ossim/parallel/ossimImageMpiMWriterSequenceConnection.h
@@ -0,0 +1,60 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// This class is specific to the Master connection and is optimized
+// for the writer sequence and batch processing chain.  For the Slave
+// implementation look for the ossimImageMpiSWriterSequenceConnection.cc and .h
+// files.  The Master connection is currently implemented to allways do
+// a recieve and does no processing itself.  The slave connection does
+// all the actual work and processing.
+//
+//*******************************************************************
+//  $Id: ossimImageMpiMWriterSequenceConnection.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimImageMpiMWriterSequenceConnection_HEADER
+#define ossimImageMpiMWriterSequenceConnection_HEADER
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+class ossimImageData;
+class ossimImageMpiMWriterSequenceConnection : public ossimImageSourceSequencer
+{
+public:
+   ossimImageMpiMWriterSequenceConnection(ossimObject* owner=NULL);
+   ossimImageMpiMWriterSequenceConnection(ossimImageSource* inputSource,
+                                          ossimObject* owner=NULL);
+  virtual ~ossimImageMpiMWriterSequenceConnection();
+
+   /*!
+    * This is a virtual method that can be overriden
+    * by derived classes (MPI, or PVM or other
+    * parallel connections.  This method is to indicate
+    * whether or not this connection is the master/
+    * controlling connection.
+    */
+   virtual void initialize();
+   virtual void setToStartOfSequence();
+
+   virtual bool isMaster()const
+      {
+         return true;
+      }
+   /*!
+    * Will allow you to get the next tile in the sequence.
+    */
+   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
+protected:
+   int theNumberOfProcessors;
+   int theRank;
+   bool theNeedToSendRequest;
+   ossimRefPtr<ossimImageData> theOutputTile;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/parallel/ossimImageMpiSWriterSequenceConnection.h b/include/ossim/parallel/ossimImageMpiSWriterSequenceConnection.h
new file mode 100644
index 0000000..f15f84d
--- /dev/null
+++ b/include/ossim/parallel/ossimImageMpiSWriterSequenceConnection.h
@@ -0,0 +1,53 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimImageMpiSWriterSequenceConnection.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimImageMpiSWriterSequenceConnection_HEADER
+#define ossimImageMpiSWriterSequenceConnection_HEADER
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+class ossimImageData;
+class ossimImageMpiSWriterSequenceConnection : public ossimImageSourceSequencer
+{
+public:
+   ossimImageMpiSWriterSequenceConnection(ossimObject* owner=NULL,
+                                          long numberOfTilesToBuffer = 2);
+   
+   ossimImageMpiSWriterSequenceConnection(ossimImageSource* inputSource,
+                                          ossimObject* owner=NULL,
+                                          long numberOfTilesToBuffer = 2);
+   
+  virtual ~ossimImageMpiSWriterSequenceConnection();
+   virtual bool isMaster()const
+      {
+         return false;
+      }
+
+   virtual void initialize();
+   virtual void setToStartOfSequence();
+   /*!
+    * Will allow you to get the next tile in the sequence.
+    */
+   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
+
+   virtual void slaveProcessTiles();
+   
+protected:
+   int theNumberOfProcessors;
+   int theRank;
+   int theNumberOfTilesToBuffer;
+   
+   ossimRefPtr<ossimImageData>* theOutputTile;
+
+   void deleteOutputTiles();
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/parallel/ossimJob.h b/include/ossim/parallel/ossimJob.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimJob.h
rename to include/ossim/parallel/ossimJob.h
diff --git a/ossim/include/ossim/parallel/ossimJobMultiThreadQueue.h b/include/ossim/parallel/ossimJobMultiThreadQueue.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimJobMultiThreadQueue.h
rename to include/ossim/parallel/ossimJobMultiThreadQueue.h
diff --git a/ossim/include/ossim/parallel/ossimJobQueue.h b/include/ossim/parallel/ossimJobQueue.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimJobQueue.h
rename to include/ossim/parallel/ossimJobQueue.h
diff --git a/ossim/include/ossim/parallel/ossimJobThreadQueue.h b/include/ossim/parallel/ossimJobThreadQueue.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimJobThreadQueue.h
rename to include/ossim/parallel/ossimJobThreadQueue.h
diff --git a/ossim/include/ossim/parallel/ossimMpi.h b/include/ossim/parallel/ossimMpi.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimMpi.h
rename to include/ossim/parallel/ossimMpi.h
diff --git a/ossim/include/ossim/parallel/ossimMpiMasterOverviewSequencer.h b/include/ossim/parallel/ossimMpiMasterOverviewSequencer.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimMpiMasterOverviewSequencer.h
rename to include/ossim/parallel/ossimMpiMasterOverviewSequencer.h
diff --git a/ossim/include/ossim/parallel/ossimMpiSlaveOverviewSequencer.h b/include/ossim/parallel/ossimMpiSlaveOverviewSequencer.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimMpiSlaveOverviewSequencer.h
rename to include/ossim/parallel/ossimMpiSlaveOverviewSequencer.h
diff --git a/ossim/include/ossim/parallel/ossimMtDebug.h b/include/ossim/parallel/ossimMtDebug.h
similarity index 100%
rename from ossim/include/ossim/parallel/ossimMtDebug.h
rename to include/ossim/parallel/ossimMtDebug.h
diff --git a/include/ossim/parallel/ossimMultiThreadSequencer.h b/include/ossim/parallel/ossimMultiThreadSequencer.h
new file mode 100644
index 0000000..379f1d5
--- /dev/null
+++ b/include/ossim/parallel/ossimMultiThreadSequencer.h
@@ -0,0 +1,149 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+//  $Id$
+//**************************************************************************************************
+#ifndef ossimMultiThreadSequencer_HEADER
+#define ossimMultiThreadSequencer_HEADER
+
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/parallel/ossimJobMultiThreadQueue.h>
+#include <ossim/parallel/ossimImageChainMtAdaptor.h>
+#include <OpenThreads/Thread>
+
+//*************************************************************************************************
+//! This class manages the sequencing of tile requests across multiple threads. Note that multi-
+//! threading can only be achieved through the use of getNextTile() method for sequencing. 
+//! Conventional getTiles will not be multi-threaded.
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimMultiThreadSequencer : public ossimImageSourceSequencer
+{
+public:
+   ossimMultiThreadSequencer(ossimImageSource* inputSource=NULL, 
+                             ossim_uint32 num_threads=0,
+                             ossimObject* owner=NULL);
+
+   virtual ~ossimMultiThreadSequencer();
+
+   //! Overrides base class implementation. This call initiates the multi-threaded getTile jobs for
+   //! the first N tiles.
+   virtual void setToStartOfSequence();
+
+   //! Overrides base class in order to implement multi-threaded tile requests. The output tile 
+   //! should be available in the tile cache, otherwise, method waits until it becomes available.
+   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
+
+   //! Specifies number of thread to support. Default behavior (if this method is never called) is
+   //! to query the system for number of cores available.
+   void setNumberOfThreads(ossim_uint32 num_threads);
+
+   //! Fetches the number of threads being used. Useful when this object decides the quantity.
+   ossim_uint32 getNumberOfThreads() const { return m_numThreads; }
+
+   //! Accessed for performance logging.
+   ossim_uint32 maxCacheSize() const { return m_maxCacheSize; }
+   bool loadState(const ossimKeywordlist& kwl, const char* prefix);
+   void setUseSharedHandlers(bool use_shared_handlers);
+   void setCacheTileSize(ossim_uint32 cache_tile_size);
+   void setUseCache(bool use_cache);
+
+   // FOR DEBUG:
+   ossim_uint32 d_maxCacheUsed;
+   ossim_uint32 d_cacheEmptyCount;
+   double       d_idleTime1;
+   double       d_idleTime2;
+   double       d_idleTime3;
+   double       d_idleTime4;
+   double       d_idleTime5;
+   double       d_idleTime6;
+   double       d_jobGetTileT;
+   double       handlerGetTileT();
+   bool         d_useSharedHandlers;
+   ossim_uint32 d_cacheTileSize;
+   bool d_useCache;
+
+protected:
+
+   // Associates a job with a tile ID for quick access to its tile data when finished:
+   typedef std::map<ossim_uint32 /*tile_ID*/, ossimRefPtr<ossimImageData> >  TileCache;
+
+   //! Private class representing a getTile job.
+   class ossimGetTileJob : public ossimJob
+   {
+   public:
+      ossimGetTileJob(ossim_uint32 tile_id,  ossim_uint32 chain_id,  ossimMultiThreadSequencer& sequencer) 
+         :  m_tileID(tile_id), 
+            m_chainID(chain_id), 
+            m_sequencer(sequencer),
+            t_launchNewJob(true) {}
+
+      virtual void start();
+
+   private:
+      ossim_uint32                 m_tileID;
+      ossim_uint32                 m_chainID;
+      ossimMultiThreadSequencer&   m_sequencer;
+
+      bool t_launchNewJob;                    //### for experimental purposes
+      friend class ossimMultiThreadSequencer; //### for experimental purposes
+   };
+   friend class ossimGetTileJob;
+
+   //! Private class for getTile job callbacks.
+   class ossimGetTileCallback : public ossimJobCallback
+   {
+   public:
+      ossimGetTileCallback() {}
+      virtual void finished(ossimJob* job)
+      {
+         if (job != NULL)
+            job->finished();
+      }
+   };
+
+   //! Queues up the optimum amount of jobs given the availability of thread chains and space in
+   //! the output tile cache.
+   void initJobs();
+
+   //! Access method to tile cache with scope lock to avoid multiple threads writing to
+   //! the cache simultaneously. 
+   //! NOTE: chain_id being passed only for debug. To be removed.
+   void setTileInCache(ossim_uint32 tile_id, ossimImageData* tile, ossim_uint32 chain_id, double dt /*for debug*/);
+
+   //! Method to job queue with scope lock to avoid multiple threads modifying the queue
+   //! simultaneously.
+   void nextJob(ossim_uint32 chain_id);
+
+   //! For debug -- thread-safe console output
+   void print(ostringstream& msg) const;
+
+   ossimRefPtr<ossimImageChainMtAdaptor> m_inputChain; //!< Same as base class' theInputConnection
+   ossimRefPtr<ossimJobMultiThreadQueue> m_jobMtQueue;
+   ossim_uint32                          m_numThreads;
+   ossimRefPtr<ossimGetTileCallback>     m_callback;
+   ossim_uint32                          m_nextTileID; //!< ID of next tile to be threaded, different from base class' theCurrentTileNumber
+   TileCache                             m_tileCache;  //!< Saves tiles output by threaded jobs
+   ossim_uint32                          m_maxCacheSize;
+   ossim_uint32                          m_maxTileCacheFactor;
+   mutable OpenThreads::Mutex            m_cacheMutex;   
+   mutable OpenThreads::Mutex            m_jobMutex;   
+   ossim_uint32                          m_totalNumberOfTiles;
+   OpenThreads::Block                    m_getTileBlock; //<! Blocks execution of main thread while waiting for tile to become available
+   OpenThreads::Block                    m_nextJobBlock; //<! Blocks execution of worker threads
+
+   // FOR DEBUG:
+   mutable OpenThreads::Mutex d_printMutex;
+   mutable OpenThreads::Mutex d_timerMutex;
+   bool d_debugEnabled;
+   ossim_uint32 d_timedBlocksDt;
+   bool d_timeMetricsEnabled;
+   double d_t1;
+};
+
+#endif
diff --git a/include/ossim/plugin/ossimDynamicLibrary.h b/include/ossim/plugin/ossimDynamicLibrary.h
new file mode 100644
index 0000000..6612003
--- /dev/null
+++ b/include/ossim/plugin/ossimDynamicLibrary.h
@@ -0,0 +1,65 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// LICENSE: LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimDynamicLibrary.h 23380 2015-06-19 16:37:45Z dburken $
+#ifndef ossimDynamicLibrary_HEADER
+#define ossimDynamicLibrary_HEADER 1
+
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimReferenced.h>
+
+
+#if defined(_WIN32) || defined(__WIN32__)
+#include <windows.h>
+#else 
+#include <dlfcn.h>
+#endif
+
+class OSSIM_DLL ossimDynamicLibrary : public ossimReferenced
+{
+public:
+   ossimDynamicLibrary();
+   ossimDynamicLibrary(const ossimString& name);
+   virtual ~ossimDynamicLibrary();
+   // return TRUE if the library was loaded successfully
+   bool isLoaded() const { return theLibrary != 0; }
+
+   // load the library with the given name (full or not), return TRUE on
+   // success
+   bool load(const ossimString& name);
+
+   bool load();
+   // unload the library, also done automatically in dtor
+   void unload();
+
+   // load a symbol from the library, return NULL if an error occured or
+   // symbol wasn't found
+   void *getSymbol(const ossimString& name) const;
+
+   const ossimString& getName()const
+   {
+      return theLibraryName;
+   }
+   
+protected:
+   // the handle to DLL or NULL
+#if defined(_WIN32)
+   HINSTANCE theLibrary;
+#else
+   void* theLibrary;
+#endif
+   ossimString theLibraryName;
+
+};
+
+#endif
+
diff --git a/include/ossim/plugin/ossimPluginConstants.h b/include/ossim/plugin/ossimPluginConstants.h
new file mode 100644
index 0000000..64e979a
--- /dev/null
+++ b/include/ossim/plugin/ossimPluginConstants.h
@@ -0,0 +1,42 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Constants file for ossim plugins.
+//
+// $Id: ossimPluginConstants.h 20616 2012-02-27 13:22:24Z gpotts $
+//----------------------------------------------------------------------------
+#ifndef ossimPluginConstants_HEADER
+#define ossimPluginConstants_HEADER
+
+/**
+ * DLL IMPORT/EXORT SECTION
+ */
+#if defined(OSSIM_STATIC)
+#  define OSSIMPLUGINSEXPORT
+#  define OSSIMPLUGINSIMPORT
+#  define OSSIMPLUGINSDLLEXPORT
+#  define OSSIM_PLUGINS_DLL
+#elif defined(__MINGW32__) || defined(__CYGWIN__) || defined(_MSC_VER) || defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
+#  define OSSIMPLUGINSEXPORT __declspec(dllexport)
+#  define OSSIMPLUGINSIMPORT __declspec(dllimport)
+#  ifdef OSSIMPLUGINSMAKINGDLL
+#    define OSSIMPLUGINSDLLEXPORT OSSIMPLUGINSEXPORT
+#    define OSSIM_PLUGINS_DLL       OSSIMPLUGINSEXPORT
+#  else
+#    define OSSIMPLUGINSDLLEXPORT OSSIMPLUGINSIMPORT
+#    define OSSIM_PLUGINS_DLL      OSSIMPLUGINSIMPORT
+#  endif
+#else /* not #if defined(_MSC_VER) */
+#  define OSSIMPLUGINSEXPORT
+#  define OSSIMPLUGINSIMPORT
+#  define OSSIMPLUGINSDLLEXPORT
+#  define OSSIM_PLUGINS_DLL
+#endif /* #if defined(_MSC_VER) */
+
+#endif /* #ifndef ossimPluginConstants_HEADER */
diff --git a/ossim/include/ossim/plugin/ossimPluginLibrary.h b/include/ossim/plugin/ossimPluginLibrary.h
similarity index 100%
rename from ossim/include/ossim/plugin/ossimPluginLibrary.h
rename to include/ossim/plugin/ossimPluginLibrary.h
diff --git a/ossim/include/ossim/plugin/ossimSharedObjectBridge.h b/include/ossim/plugin/ossimSharedObjectBridge.h
similarity index 100%
rename from ossim/include/ossim/plugin/ossimSharedObjectBridge.h
rename to include/ossim/plugin/ossimSharedObjectBridge.h
diff --git a/ossim/include/ossim/plugin/ossimSharedPluginRegistry.h b/include/ossim/plugin/ossimSharedPluginRegistry.h
similarity index 100%
rename from ossim/include/ossim/plugin/ossimSharedPluginRegistry.h
rename to include/ossim/plugin/ossimSharedPluginRegistry.h
diff --git a/include/ossim/point_cloud/ossimGenericPointCloudHandler.h b/include/ossim/point_cloud/ossimGenericPointCloudHandler.h
new file mode 100644
index 0000000..8b802da
--- /dev/null
+++ b/include/ossim/point_cloud/ossimGenericPointCloudHandler.h
@@ -0,0 +1,40 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id: ossimGenericPointCloudHandler.h 23654 2015-12-08 19:04:09Z gpotts $
+
+#ifndef ossimGenericPointCloudHandler_HEADER
+#define ossimGenericPointCloudHandler_HEADER 1
+
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+#include <ossim/point_cloud/ossimPointBlock.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimGrect.h>
+#include <vector>
+
+using namespace std;
+
+class OSSIM_DLL ossimGenericPointCloudHandler : public ossimPointCloudHandler
+{
+public:
+   ossimGenericPointCloudHandler(vector<ossimEcefPoint>& ecef_points);
+   ossimGenericPointCloudHandler(vector<ossimGpt>& ground_points);
+   virtual ~ossimGenericPointCloudHandler();
+   virtual ossim_uint32 getNumPoints() const;
+   virtual void getFileBlock(ossim_uint32 offset,
+                             ossimPointBlock& block,
+                             ossim_uint32 maxNumPoints=0xFFFFFFFF)const;
+   virtual ossim_uint32 getFieldCode() const;
+   virtual bool open(const ossimFilename& pointsFile);
+   virtual void close();
+
+protected:
+   ossimGenericPointCloudHandler() {}
+   ossimPointBlock m_pointBlock;
+};
+
+#endif /* #ifndef ossimPdalReader_HEADER */
diff --git a/include/ossim/point_cloud/ossimPointBlock.h b/include/ossim/point_cloud/ossimPointBlock.h
new file mode 100755
index 0000000..54462aa
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointBlock.h
@@ -0,0 +1,97 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+#ifndef ossimPointBlock_HEADER
+#define ossimPointBlock_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h> /* for ossim::isnan */
+#include <ossim/base/ossimDataObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/point_cloud/ossimPointRecord.h>
+#include <vector>
+
+class ossimSource;
+
+/***************************************************************************************************
+ * Base class for all Point Cloud data sources, including input file handlers and processing nodes.
+ **************************************************************************************************/
+class OSSIMDLLEXPORT ossimPointBlock: public ossimDataObject
+{
+public:
+   typedef std::vector< ossimRefPtr<ossimPointRecord> > PointList;
+
+   ossimPointBlock(ossimSource* owner=0, ossim_uint32 fields=0);
+
+   virtual ~ossimPointBlock();
+
+   /** Returns allocated size. The pointList may contain only null points if not assigned */
+   virtual ossim_uint32 size() const { return (ossim_uint32)m_pointList.size(); }
+
+   bool empty() const { return (size() == 0); }
+
+   /**
+    * Returns OR'd mash-up of ossimPointRecord field codes being stored (or desired to be stored)
+    */
+   ossim_uint32 getFieldCode() const;
+   vector<ossimPointRecord::FIELD_CODES> getFieldCodesAsList() const;
+
+   /**
+    * Initializes the desired fields to be stored. This will affect future getBlock() calls. If
+    * the point list contains points from prior read, they will be deleted unless the points field
+    * code matches the code argument.
+    */
+   void setFieldCode(ossim_uint32 code);
+
+   /** Adds single point to the tail of the list. */
+   virtual void addPoint(ossimPointRecord* point);
+
+   virtual const ossimPointRecord* getPoint(ossim_uint32 point_offset) const;
+   virtual ossimPointRecord* getPoint(ossim_uint32 point_offset);
+
+   const ossimPointRecord* operator[](ossim_uint32 i) const { return getPoint(i); }
+   ossimPointRecord* operator[](ossim_uint32 i) { return getPoint(i); }
+
+   virtual const PointList&  getPoints() const { return m_pointList; }
+   virtual PointList&  getPoints()  { return m_pointList; }
+
+   void getFieldMin(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const;
+   void getFieldMax(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const;
+   void getBounds(ossimGrect& block_bounds) const;
+
+   virtual const ossimPointBlock& operator=(const ossimPointBlock &rhs);
+
+   virtual ossimObject* dup() const;
+
+   /** Resets any storage to empty. */
+   virtual void clear() { m_pointList.clear(); m_isNormalized = false; m_minMaxValid = false;}
+
+   /**
+    *  Fulfills base class pure virtual. TODO: Needs to be correctly implemented
+    */
+   virtual bool isEqualTo(const ossimDataObject& /*rhs*/, bool /*deep_copy*/) const { return false; }
+   virtual ossim_uint32 getHashId() const { return 0; }
+   virtual ossim_uint32 getDataSizeInBytes() const { return 0; };
+   virtual void initialize() {};
+
+protected:
+   ossimPointBlock(const ossimPointBlock& rhs);
+   void scanForMinMax() const;
+
+   ossimPointRecord m_nullPCR;
+   mutable ossimPointRecord m_minRecord;
+   mutable ossimPointRecord m_maxRecord;
+   mutable bool m_minMaxValid;
+   PointList m_pointList;
+   mutable ossim_uint32 m_fieldCode; // OR'd mash-up of ossimPointRecord::FIELD_CODES
+   bool m_isNormalized;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimPointBlock_HEADER */
diff --git a/include/ossim/point_cloud/ossimPointCloudGeometry.h b/include/ossim/point_cloud/ossimPointCloudGeometry.h
new file mode 100644
index 0000000..d21f6ac
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointCloudGeometry.h
@@ -0,0 +1,88 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#ifndef ossimPointCloudGeometry_HEADER
+#define ossimPointCloudGeometry_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/projection/ossimMapProjection.h>
+
+
+/***************************************************************************************************
+ * This class represents the 3D geometry of the point cloud dataset.
+ * NOTE: See below for details on position format. It is the responsibility of the derived
+ * ossimPointCloudHandlers to convert the ray point positions into either geographic or map-meters
+ * before storing a point in ossimPointCloudRecord.
+ **************************************************************************************************/
+class OSSIMDLLEXPORT ossimPointCloudGeometry : public ossimObject
+{
+public:
+   enum PositionFormat
+   {
+      UNKNOWN,
+      GEOGRAPHIC,     // x=lon, y=lat, z=ellipsoid height
+      MAP_PROJECTED, // x=easting, y=northing, z=ellipsoid height
+      ECF_METERS      // X, Y, Z (see base/ossimEcef)
+   };
+
+   /**
+    * Constructs from WKT specification. Since the projection units are unknown
+    * when the bounds are established, the caller will not know the units of the point coordinates
+    * for establishing the bounds.
+    */
+   ossimPointCloudGeometry(const ossimString& wkt);
+
+   /**
+    * If arg left to default GEOGRAPHIC, this geometry is essentially unity transform except for a
+    * possible datum change if requested.
+    */
+   ossimPointCloudGeometry(PositionFormat f=GEOGRAPHIC)
+         : m_format(f),
+           m_projection(0),
+           m_datum (ossimDatumFactory::instance()->wgs84()) {}
+
+   ~ossimPointCloudGeometry() {}
+
+   bool operator==(const ossimPointCloudGeometry& other) const;
+
+   /**
+   * While the raw point positions may be specified in the data file as either geographic, map
+   * projected (feet or meters), or ECF meters, the point positions are stored in OSSIM as either as
+   * geographic or map (meters) only. This method is used by the Point cloud handler object for
+   * interpreting the input file's raw position format.
+   */
+   PositionFormat getRawPosFormat() const { return m_format; }
+
+   /**
+    * This method will return either GEOGRAPHIC or MAP_PROJECTION. For the latter, the stored
+    * coordinates will be in meters.
+    */
+   PositionFormat getStoredPosFormat() const { return (m_format==ECF_METERS) ? GEOGRAPHIC : m_format; }
+
+   const ossimMapProjection* getProjection()   const { return m_projection.get(); }
+   const ossimDatum*         getDatum()        const { return m_datum; }
+
+   /**
+    * Method converts a generic 3D point as stored in the argument ossim3Dpt object,
+    * and converts it to an ossimGpt, using the preset datum provided in the argument gpt.
+    */
+   void convertPos(const ossimDpt3d& stored_pos, ossimGpt& converted_gpos) const;
+
+private:
+   PositionFormat m_format;
+   ossimRefPtr<ossimMapProjection> m_projection;
+   const ossimDatum* m_datum;
+
+TYPE_DATA
+};
+
+#endif /* ossimPointCloudGeometry_HEADER */
diff --git a/include/ossim/point_cloud/ossimPointCloudHandler.h b/include/ossim/point_cloud/ossimPointCloudHandler.h
new file mode 100644
index 0000000..73d1f26
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointCloudHandler.h
@@ -0,0 +1,97 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#ifndef ossimPointCloudHandler_HEADER
+#define ossimPointCloudHandler_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/point_cloud/ossimPointCloudSource.h>
+#include <ossim/point_cloud/ossimPointBlock.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/point_cloud/ossimPointCloudGeometry.h>
+#include <vector>
+
+
+/**
+ * Base class for all point-cloud file readers
+ */
+class OSSIMDLLEXPORT ossimPointCloudHandler: public ossimPointCloudSource
+{
+public:
+   static ossim_uint32 DEFAULT_BLOCK_SIZE;
+
+   ossimPointCloudHandler();
+   ossimPointCloudHandler(ossimObject* owner);
+
+   virtual ~ossimPointCloudHandler();
+
+   /**
+    *  @brief Method to open input point cloud dataset.
+    *  @param imageFile Name of point data file to be opened. (or basename for multi-file sets.)
+    *  @return Returns true on success, false on error.
+    */
+   virtual bool open(const ossimFilename& imageFile) = 0;
+
+   /**
+    * Closes the point cloud file(s).
+    */
+   virtual void close() = 0;
+
+   /**
+    * Fetches up to maxNumPoints points starting at the dataset's <offset> in the order they
+    * appear in the data file. Thread-safe implementation accepts an allocated block from the
+    * calling method. caller can check block.size() to see if block is full.
+    */
+   virtual void getFileBlock(ossim_uint32 offset,
+                             ossimPointBlock& block,
+                             ossim_uint32 maxNumPoints=0xFFFFFFFF) const = 0;
+
+   /**
+    * @see getFileBlock.
+    */
+   virtual void getNextFileBlock(ossimPointBlock& block,
+                                 ossim_uint32 maxNumPoints=0xFFFFFFFF) const;
+
+   virtual void rewind() const { m_currentPID = 0; }
+
+   /**
+    * Fetches the block of points inside the block bounds. If the height components of the bounds
+    * are NaN, then only the horizontal bounds are considered. Thread-safe version accepts data
+    * block object from caller. The block object is cleared before points are pushed on the vector.
+    * The block size will be non-zero if points were found.
+    */
+   virtual void getBlock(const ossimGrect& bounds, ossimPointBlock& block) const;
+
+   virtual const ossimPointRecord*  getMinPoint() const { return m_minRecord.get(); }
+   virtual const ossimPointRecord*  getMaxPoint() const { return m_maxRecord.get(); }
+
+   virtual void getBounds(ossimGrect& bounds) const;
+
+   /**
+    * Handler is always on the start of the pipeline
+    */
+   virtual bool canConnectMyInputTo(ossim_int32, const ossimConnectableObject*) const
+   { return false; }
+
+   void normalizeBlock(ossimPointBlock& block);
+
+protected:
+
+   ossimFilename m_inputFilename;
+   ossimRefPtr<ossimPointCloudGeometry> m_geometry;
+   ossimRefPtr<ossimPointRecord> m_minRecord;
+   ossimRefPtr<ossimPointRecord>  m_maxRecord;
+   mutable ossim_uint32 m_currentPID;
+
+TYPE_DATA
+};
+
+#endif /* ossimPointCloudHandler_HEADER */
diff --git a/include/ossim/point_cloud/ossimPointCloudHandlerFactory.h b/include/ossim/point_cloud/ossimPointCloudHandlerFactory.h
new file mode 100644
index 0000000..a2c29f8
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointCloudHandlerFactory.h
@@ -0,0 +1,43 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#ifndef ossimPointCloudHandlerFactory_HEADER
+#define ossimPointCloudHandlerFactory_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimFilename.h>
+
+class ossimPointCloudHandler;
+
+class OSSIMDLLEXPORT ossimPointCloudHandlerFactory: public ossimObjectFactory
+{
+public:
+   virtual ~ossimPointCloudHandlerFactory() {}
+
+   virtual ossimPointCloudHandler* open(const ossimFilename& fileName) const = 0;
+   virtual ossimPointCloudHandler* open(const ossimKeywordlist& kwl, const char* prefix = 0) const = 0;
+
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix = 0) const
+   {
+      return (ossimObject*) open(kwl, prefix);
+   }
+
+   virtual ossimObject* createObject(const ossimString& typeName) const = 0;
+
+   virtual void getSupportedExtensions(std::vector<ossimString>& extList) const = 0;
+
+protected:
+
+};
+
+#endif /* ossimPointCloudHandlerFactory_HEADER */
diff --git a/include/ossim/point_cloud/ossimPointCloudHandlerRegistry.h b/include/ossim/point_cloud/ossimPointCloudHandlerRegistry.h
new file mode 100644
index 0000000..b1dc8df
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointCloudHandlerRegistry.h
@@ -0,0 +1,57 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#ifndef ossimPointCloudHandlerRegistry_HEADER
+#define ossimPointCloudHandlerRegistry_HEADER 1
+
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimFactoryListInterface.h>
+#include <ossim/base/ossimFilename.h>
+
+#include <ossim/point_cloud/ossimPointCloudHandlerFactory.h>
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+
+class OSSIMDLLEXPORT ossimPointCloudHandlerRegistry :
+      public ossimObjectFactory,
+      public ossimFactoryListInterface<ossimPointCloudHandlerFactory, ossimPointCloudHandler>
+{
+public:
+   virtual ~ossimPointCloudHandlerRegistry();
+
+   static ossimPointCloudHandlerRegistry* instance();
+
+   virtual ossimPointCloudHandler* open(const ossimFilename& fileName) const;
+
+   virtual ossimPointCloudHandler* open(const ossimKeywordlist& kwl, const char* prefix = 0) const;
+
+   virtual ossimRefPtr<ossimPointCloudHandler> open(std::istream* str,
+                                                    std::streamoff restartPosition,
+                                                    bool youOwnIt) const;
+
+   /*!
+    * Creates an object given a type name.
+    */
+   virtual ossimObject* createObject(const ossimString& typeName) const;
+
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix = 0) const;
+
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+
+protected:
+   ossimPointCloudHandlerRegistry();
+   const ossimPointCloudHandlerRegistry& operator=(const ossimPointCloudHandlerRegistry& rhs);
+   static ossimPointCloudHandlerRegistry* m_instance;
+
+TYPE_DATA
+};
+
+#endif /* ossimPointCloudHandlerRegistry_HEADER */
diff --git a/include/ossim/point_cloud/ossimPointCloudImageHandler.h b/include/ossim/point_cloud/ossimPointCloudImageHandler.h
new file mode 100644
index 0000000..1879bbe
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointCloudImageHandler.h
@@ -0,0 +1,254 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#ifndef ossimPointCloudImageSource_HEADER
+#define ossimPointCloudImageSource_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+#include <vector>
+
+class ossimImageData;
+class ossimTiffOverviewTileSource;
+class ossimPoinCloudHandler;
+
+/**
+ * Class used for rendering point cloud data into a raster tile. It is derived from
+ * ossimImageHandler so that it can be included in the available file formats for reading as
+ * maintained by the ossimImageHandlerRegistry. This base class implementation exposes the data
+ * elements represented by the base-class ossimPointCloudSource and the individual point base-class
+ * ossimPointCloudRecord, namely, intensity, RGB color, elevation, and number of returns.
+ *
+ * For sensor systems providing additional renderable data items, a derived class will be required
+ * to expose those components.
+ */
+class OSSIMDLLEXPORT ossimPointCloudImageHandler : public ossimImageHandler
+{
+public:
+   enum Components { INTENSITY=0, HIGHEST, LOWEST, RETURNS, RGB, NUM_COMPONENTS /*not a component*/ };
+
+   ossimPointCloudImageHandler();
+   virtual ~ossimPointCloudImageHandler();
+
+   /**
+    *  @brief open method.
+    *  Satisfies ossimImageHandler::open pure virtual.
+    *  @return Returns true on success, false on error.
+    *  @note This method relies on the data member ossimImageData::theImageFile
+    *  being set.  Callers should do a "setFilename" prior to calling this
+    *  method or use the ossimImageHandler::open that takes a file name and an
+    *  entry index.
+    */
+   virtual bool open();
+
+   /**
+    *  @brief is open method.
+    *  Satisfies ossimImageHandler::isOpen pure virtual.
+    *  @return true if open, false if not.
+    */
+   virtual bool isOpen() const { return m_pch.valid(); }
+
+
+   /**
+    * @brief Close method.
+    */
+   virtual void close();
+
+   /**
+    *  Returns a pointer to a tile given an origin representing the upper left
+    *  corner of the tile to grab from the image.
+    *  Satisfies pure virtual from TileSource class.
+    */
+   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
+                                               ossim_uint32 resLevel=0);
+   
+   /**
+    * Method to get a tile.   
+    * @param result The tile to stuff.  Note The requested rectangle in full
+    * image space and bands should be set in the result tile prior to
+    * passing.  It will be an error if:
+    * result.getNumberOfBands() != this->getNumberOfOutputBands()
+    * @return true on success false on error.  If return is false, result
+    *  is undefined so caller should handle appropriately with makeBlank or
+    * whatever.
+    */
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+   /**
+    * @brief Gets bands.
+    * Satisfies ossimImageSource::getNumberOfInputBands pure virtual.
+    * @retrun Number of bands.
+    */
+   virtual ossim_uint32 getNumberOfInputBands() const;
+
+   /**
+    * @brief Gets lines.
+    * Satisfies ossimImageHandler::getNumberOfLines pure virtual.
+    * @param resLevel Reduced resolution level to return lines of.
+    * Default = 0
+    * @return The number of lines for specified reduced resolution level.
+    */
+   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
+
+   /**
+    * @brief Gets samples.
+    * Satisfies ossimImageHandler::getNumberOfSamples
+    * @param resLevel Reduced resolution level to return samples of.
+    * Default = 0
+    * @return The number of samples for specified reduced resolution level.
+    */
+   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
+
+   /**
+    * @brief Gets tile width.
+    * Satisfies ossimImageHandler::getImageTileWidth pure virtual.
+    * @return The tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileWidth() const;
+
+   /**
+    * @brief Gets tile height.
+    * Satisfies ossimImageHandler::getImageTileHeight pure virtual.
+    * @return The tile width of the image or 0 if the image is not tiled.
+    * Note: this is not the same as the ossimImageSource::getTileWidth which
+    * returns the output tile width which can be different than the internal
+    * image tile width on disk.
+    */
+   virtual ossim_uint32 getImageTileHeight() const;
+
+   /** @return The width of the output tile. */
+   virtual ossim_uint32 getTileWidth() const;
+   
+   /** @returns The height of the output tile. */
+   virtual ossim_uint32 getTileHeight() const;
+
+   /** @return The output pixel type of the tile source. */
+   ossimScalarType getOutputScalarType() const;
+
+   /**
+    * @brief Gets entry list.
+    * This list reflects the data component entry list provided by the derived point-cloud handler.
+    * This base class understands the basic (LIDAR-biased) entries: "Intensity", "RGB",
+    * "Elevation", and "Return". If a sensor provides other components, then a derived image handler
+    * will be needed to rasterize that data channel as well.
+    * @param entryList This is the list to initialize with entry indexes.
+    */
+   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
+
+   virtual void getEntryNames(std::vector<ossimString>& entryNames) const;
+
+   /** @return The current entry number. */
+   virtual ossim_uint32 getCurrentEntry() const;
+
+   /**
+    * @param entryIdx Entry number to select.
+    * @return true if it was able to set the current entry and false otherwise.
+    */
+   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
+
+   /** @return "point-cloud" */
+   virtual ossimString getShortName() const;
+   
+   /** @return "ossim point cloud to image renderer" */
+   virtual ossimString getLongName()  const;
+
+   /**
+    * Returns the image geometry object associated with this tile source or
+    * NULL if non defined.  The geometry contains full-to-local image
+    * transform as well as projection (image-to-world).
+    */
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+   /** @return Min pixel value. */
+   virtual double getMinPixelValue(ossim_uint32 band=0) const;
+
+   /** @return Min pixel value. */
+   virtual double getMaxPixelValue(ossim_uint32 band=0) const;
+
+   /** @return Min pixel value. */
+   virtual double getNullPixelValue(ossim_uint32 band=0) const;
+
+   /** @return The total number of decimation levels. */
+   virtual ossim_uint32 getNumberOfDecimationLevels() const;
+
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   virtual void getValidImageVertices(std::vector<ossimIpt>& validVertices,
+                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
+                                      ossim_uint32 resLevel=0) const;
+
+   /**
+    * The reader properties are:
+    * -- the GSD ("meters_per_pixel") which overrides computed nominal GSD
+    * -- the GSD factor ("gsd_factor") scales the computed nominal GSD, defaults to 1.0.
+    * -- the active component as entry number ("entry") with possible values [0 - 4] corresponding
+    *    to "component" property (listed below)
+    * -- the active component ("component") as string with possible values
+    *    "intensity", "highest", "lowest", "returns", or "rgb", respectively (case insensitive)
+    */
+   void setProperty(ossimRefPtr<ossimProperty> property);
+   ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
+
+   /**
+    * Permits backdoor for setting the input point cloud handler object. Useful for debug
+    */
+   bool setPointCloudHandler(ossimPointCloudHandler* pch);
+
+   /** @brief Get the GSD for resLevel. */
+   void getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const;
+
+   /** @brief Sets m_gsd data member and projection if projection is set. */
+   void setGSD( const ossim_float64& gsd );
+
+
+protected:
+   class PcrBucket
+   {
+   public:
+      PcrBucket() : m_bucket(0), m_numSamples(0) {}
+      PcrBucket(const ossim_float32* init_value, ossim_uint32 numBands);
+      PcrBucket(const ossim_float32& R, const ossim_float32& G, const ossim_float32& B);
+      PcrBucket(const ossim_float32& init_value);
+      ~PcrBucket();
+      ossim_float32* m_bucket;
+      int m_numSamples;
+   };
+
+   void initTile();
+
+   void addSample(std::map<ossim_int32, PcrBucket*>& accumulator,
+                  ossim_int32 index,
+                  const ossimPointRecord* sample);
+
+   void normalize(std::map<ossim_int32, PcrBucket*>& accumulator);
+
+   ossim_uint32 componentToFieldCode() const;
+
+   ossimRefPtr<ossimPointCloudHandler> m_pch;
+   ossim_float32                m_maxPixel;
+   ossim_float32                m_minPixel;
+   ossimDpt                     m_gsd;
+   ossim_float64                m_gsdFactor;
+   ossimRefPtr<ossimImageData>  m_tile;
+   OpenThreads::Mutex           m_mutex;
+   Components                   m_activeComponent;
+   std::vector<ossimString>     m_componentNames;
+
+   TYPE_DATA
+};
+
+#endif /* ossimPointCloudRenderer_HEADER */
diff --git a/ossim/include/ossim/point_cloud/ossimPointCloudImageHandlerFactory.h b/include/ossim/point_cloud/ossimPointCloudImageHandlerFactory.h
similarity index 100%
rename from ossim/include/ossim/point_cloud/ossimPointCloudImageHandlerFactory.h
rename to include/ossim/point_cloud/ossimPointCloudImageHandlerFactory.h
diff --git a/include/ossim/point_cloud/ossimPointCloudSource.h b/include/ossim/point_cloud/ossimPointCloudSource.h
new file mode 100644
index 0000000..9fa47e3
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointCloudSource.h
@@ -0,0 +1,83 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+#ifndef ossimPointCloudSource_HEADER
+#define ossimPointCloudSource_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h> /* for ossim::isnan */
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/point_cloud/ossimPointBlock.h>
+#include <ossim/point_cloud/ossimPointRecord.h>
+#include <vector>
+
+/***************************************************************************************************
+ * Base class for all Point Cloud data sources, including input file handlers and processing nodes.
+ **************************************************************************************************/
+class OSSIMDLLEXPORT ossimPointCloudSource: public ossimSource
+{
+public:
+   ossimPointCloudSource(ossimObject* owner = 0);
+   virtual ~ossimPointCloudSource();
+
+   /**
+    * Fetches the block of points inside the block bounds. If the height components of the bounds
+    * are NaN, then only the horizontal bounds are considered. Thread-safe version accepts data
+    * block object from caller.
+    */
+   virtual void getBlock(const ossimGrect& bounds, ossimPointBlock& block) const = 0;
+
+   /**
+    * Returns the total number of points in the dataset (not just the block returned in getPoints)
+    */
+   virtual ossim_uint32 getNumPoints() const = 0;
+
+   /**
+    * Assigns the two points with fields representing the extremes of the dataset. Useful for
+    * normalizing and establishing bounds.
+    */
+   virtual const ossimPointRecord*  getMinPoint() const;
+   virtual const ossimPointRecord*  getMaxPoint() const;
+
+   /**
+    * Fetches the data fields ids available from this source, OR'd together for testing against
+    * specific field (@see ossimPointRecord::FIELD_CODES). e.g. (though should use hasField()),
+    *
+    * bool hasIntensity = getFields() & ossimPointRecord::Intensity;
+    */
+   virtual ossim_uint32 getFieldCode() const;
+
+   /**
+    * Sets the data fields ID of interest for this source, and all input sources connected to this.
+    * This is an OR'd mash-up of @see ossimPointRecord::FIELD_CODES
+    */
+   virtual void setFieldCode (ossim_uint32 fieldCode);
+
+   /**
+    * Returns true if the data field is available from this source. The argument can be OR'd
+    * together for testing multiple fileds simultaneously. Example:
+    *
+    * bool hasRGB = hasField(ossimPointRecord::Red|ossimPointRecord::Green|ossimPointRecord::Blue);
+    */
+   virtual bool hasFields(ossim_uint32 id) const { return getFieldCode()&id; }
+
+   /** Special for convenience */
+   bool hasRGB() const
+   { return hasFields(ossimPointRecord::Red|ossimPointRecord::Green|ossimPointRecord::Blue); }
+
+   virtual bool canConnectMyInputTo(ossim_int32, const ossimConnectableObject*) const;
+
+protected:
+   ossimPointCloudSource(const ossimPointCloudSource& rhs);
+   ossimPointRecord m_nullPCR;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimPointCloudSource_HEADER */
diff --git a/include/ossim/point_cloud/ossimPointCloudUtilityFilter.h b/include/ossim/point_cloud/ossimPointCloudUtilityFilter.h
new file mode 100644
index 0000000..0425cee
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointCloudUtilityFilter.h
@@ -0,0 +1,67 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#ifndef ossimPointCloudUtilityFilter_HEADER
+#define ossimPointCloudUtilityFilter_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+#include <ossim/point_cloud/ossimPointCloudImageHandler.h>
+#include <ossim/projection/ossimImageViewTransform.h>
+#include <vector>
+
+class ossimImageData;
+class ossimPointCloudUtil;
+
+class OSSIMDLLEXPORT ossimPointCloudUtilityFilter : public ossimImageSourceFilter
+{
+public:
+   ossimPointCloudUtilityFilter( ossimPointCloudUtil* pc_util);
+   virtual ~ossimPointCloudUtilityFilter() {}
+
+   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
+   
+   ossimScalarType getOutputScalarType() const { return OSSIM_FLOAT32; }
+;
+   virtual ossim_uint32 getNumberOfOutputBands() const { return 1; }
+
+   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
+
+protected:
+   class PcrBucket
+   {
+   public:
+      PcrBucket() : m_bucket(0), m_numSamples(0) {}
+      PcrBucket(const ossim_float32* init_value, ossim_uint32 numBands);
+      PcrBucket(const ossim_float32& R, const ossim_float32& G, const ossim_float32& B);
+      PcrBucket(const ossim_float32& init_value);
+      ~PcrBucket();
+      ossim_float32* m_bucket;
+      int m_numSamples;
+   };
+
+   void initTile();
+
+   void addSample(std::map<ossim_int32, PcrBucket*>& accumulator,
+                  ossim_int32 index,
+                  const ossimPointRecord* sample);
+
+   void normalize(std::map<ossim_int32, PcrBucket*>& accumulator);
+
+   ossim_uint32 componentToFieldCode() const;
+
+   ossimRefPtr<ossimPointCloudUtil> m_util;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/point_cloud/ossimPointRecord.h b/include/ossim/point_cloud/ossimPointRecord.h
new file mode 100644
index 0000000..a448117
--- /dev/null
+++ b/include/ossim/point_cloud/ossimPointRecord.h
@@ -0,0 +1,90 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id: ossimPointRecord.h 23352 2015-05-29 17:38:12Z okramer $
+
+#ifndef ossimPointCloudRecord_HEADER
+#define ossimPointCloudRecord_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimGpt.h>
+#include <vector>
+#include <map>
+
+/***************************************************************************************************
+ * This class represents a single sample (point) in a point cloud.
+ **************************************************************************************************/
+class OSSIMDLLEXPORT ossimPointRecord : public ossimReferenced
+{
+public:
+   // Field codes intended to be OR'd to indicate fields present in point record. All point records
+   // have at least an X, Y, Z position so those fields are implied.
+   enum FIELD_CODES // and associated types
+   {
+      Intensity       = 0x0008, // float 32
+      ReturnNumber    = 0x0010, // unsigned int 32
+      NumberOfReturns = 0x0020, // unsigned int 32
+      Red             = 0x0040, // float 32
+      Green           = 0x0080, // float 32
+      Blue            = 0x0100, // float 32
+      GpsTime         = 0x0200, // unsigned long Unix epoch (microsec from 01/01/1970)
+      Infrared        = 0x0400, // float 32
+      All             = 0x0777
+   };
+
+   ossimPointRecord(ossim_uint32 fields_code=0);
+   ossimPointRecord(const ossimPointRecord& pcr);
+   ossimPointRecord(const ossimGpt& pos);
+
+   /** Creates a point record with fields set to null values */
+   ~ossimPointRecord();
+
+   ossimPointRecord& operator=(const ossimPointRecord& pcr);
+
+   ossim_uint32 getPointId() const { return m_pointId; }
+   void         setPointId(ossim_uint32 id) {m_pointId = id; }
+
+   /**
+    * Returns the 3D position vector in the dataset's coodinate reference system (available from
+    * the ossimPointCloudSource object. This is either map/meters (x, y, z) or geog (lat, lon, hgt).
+    * Refer to the ossimPointCloudGeometry::getStoredPosFormat() available from the associated
+    * ossimPointCloudSource->getGeometry()
+    */
+   const ossimGpt& getPosition() const { return m_position; }
+   void setPosition(const ossimGpt& p)  { m_position = p; }
+
+   /** Argument can be mash-up of OR'd codes for check of multiple fields. Returns TRUE if ALL
+    * fields are present. */
+   virtual bool hasFields(ossim_uint32 code_mashup) const;
+
+   /** Returns mash-up of OR'd codes of multiple fields being stored*/
+   virtual ossim_uint32 getFieldCode() const;
+
+   /** Return the float value of the requested field */
+   ossim_float32 getField(FIELD_CODES fc) const;
+
+   const std::map<FIELD_CODES, ossim_float32>& getFieldMap() const { return m_fieldMap; }
+
+   void setField(FIELD_CODES fc, ossim_float32 value);
+
+   friend std::ostream& operator << (std::ostream& ostr, const ossimPointRecord& p);
+
+   /**
+    * Initializes point to undefined state:
+    */
+   void clear();
+   bool isValid() const;
+
+protected:
+   ossim_uint32 m_pointId;
+   ossimGpt     m_position;
+   std::map<FIELD_CODES, ossim_float32> m_fieldMap;
+};
+
+#endif /* ossimPointCloudRecord_HEADER */
diff --git a/include/ossim/projection/ossimAdjMapModel.h b/include/ossim/projection/ossimAdjMapModel.h
new file mode 100644
index 0000000..0637f46
--- /dev/null
+++ b/include/ossim/projection/ossimAdjMapModel.h
@@ -0,0 +1,137 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, Oscar Kramer, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+// 
+// Special "sensor model" that provides a conventional map projection but
+// with additional capability for adjusting the map x,y coordinates with
+// offset, scale, and rotation transform.  Funtions to control notifications,
+// information and error output.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimAdjMapModel.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimAdjMapModel_HEADER
+#define ossimAdjMapModel_HEADER
+
+#include <ossim/matrix/newmat.h>
+#include <ossim/projection/ossimSensorModel.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimRefPtr.h>
+
+using namespace NEWMAT;
+
+class ossimMapProjection;
+
+//----------------------------------------------------------------------------
+//  CLASS DESCRIPTION: ossimAdjMapModel
+//! Special "sensor model" that provides a conventional map projection but with
+//  additional
+//! capability for adjusting the map x,y coordinates with offset, scale, and
+//  rotation transform.
+//----------------------------------------------------------------------------
+class OSSIMDLLEXPORT ossimAdjMapModel : public ossimSensorModel
+{
+public:
+   //! Constructs to uninitialized state (needed by factory).
+   ossimAdjMapModel();
+
+   //! Constructs with map projection and image rectangle size.
+   ossimAdjMapModel(ossimMapProjection* map_proj, const ossimIpt& image_size);
+
+   //! Copy constructor
+   ossimAdjMapModel(const ossimAdjMapModel& copy_this);
+
+   //! Constructs given geom KWL.
+   ossimAdjMapModel(const ossimKeywordlist& kwl, const char* prefix);
+
+   //! Constructs given geom filename.
+   ossimAdjMapModel(const ossimFilename& geom_filename);
+
+   //! Initializes base class data members after map model established.
+   //  Returns TRUE if all's well.
+   bool initializeFromMap();
+
+   //! Returns pointer to a new instance, copy of this.
+   virtual ossimObject* dup() const;
+   
+   //! Extends base-class implementation. Dumps contents of object to ostream.
+   virtual std::ostream& print(std::ostream& out) const;
+   
+   //! Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+   //! KWL files. Returns true if successful.
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+   
+   //! Writes a template of geom keywords processed by loadState and saveState
+   //  to output stream.
+   static void writeGeomTemplate(ostream& os);
+   
+   //! Overrides base class pure virtual.
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPoint) const;
+   
+   //! Overrides base class virtual.
+   virtual void lineSampleToWorld(const ossimDpt& image_point,
+                                  ossimGpt&       worldPoint) const;
+   
+   //! Rigorous inverse transform implented, overrides base-class' iterative
+   //  solution.
+   virtual void worldToLineSample(const ossimGpt& world_point,
+                                  ossimDpt&       image_point) const;
+      
+   //! Following a change to the adjustable parameter set, this virtual is
+   //  called to permit 
+   //! instances to compute derived quantities after parameter change.
+   virtual void updateModel();
+
+   //! Initializes adjustable parameters to their default values.
+   //! Overrides ossimAdjustableParameterInterface virtual method.
+   virtual void initAdjustableParameters();
+
+   //! Fetches the GSD from the internal map projection.
+   virtual ossimDpt 	getMetersPerPixel () const;
+
+   //! Enumeration for adjustable parameter positions in theAdjParams vector
+   enum AdjParamIndex
+   {
+      OFFSET_X = 0,         // meters
+      OFFSET_Y,             // meters
+      ROTATION,             // degrees CCW
+      SCALE_X,              // ratio
+      SCALE_Y,              // ratio
+      NUM_ADJ_PARAMS // not an index
+   };
+
+   /*!
+    * ossimOptimizableProjection
+    */
+   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM)
+
+private:
+   //! Destructor only deletes the map projection.
+   virtual ~ossimAdjMapModel();
+   
+   //! This is the vector of UNNORMALIZED, BIASED parameters as used in the
+   //! model. The collection of normalized, 0-biased, parameters used in
+   //! registration are found in the
+   //! ossimAdjustableParameterInterface and related classes.
+   //!  The quantities here are computed given the base class quantities.
+   ColumnVector                    theAdjParams;
+
+   ossimRefPtr<ossimMapProjection> theMapProjection;
+   double                          theCosTheta;
+   double                          theSinTheta;
+
+TYPE_DATA
+};
+
+#endif /* End of "#ifndef ossimAdjMapModel_HEADER" */
diff --git a/ossim/include/ossim/projection/ossimAffineProjection.h b/include/ossim/projection/ossimAffineProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimAffineProjection.h
rename to include/ossim/projection/ossimAffineProjection.h
diff --git a/ossim/include/ossim/projection/ossimAlbersProjection.h b/include/ossim/projection/ossimAlbersProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimAlbersProjection.h
rename to include/ossim/projection/ossimAlbersProjection.h
diff --git a/ossim/include/ossim/projection/ossimAlphaSensor.h b/include/ossim/projection/ossimAlphaSensor.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimAlphaSensor.h
rename to include/ossim/projection/ossimAlphaSensor.h
diff --git a/ossim/include/ossim/projection/ossimAlphaSensorHRI.h b/include/ossim/projection/ossimAlphaSensorHRI.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimAlphaSensorHRI.h
rename to include/ossim/projection/ossimAlphaSensorHRI.h
diff --git a/ossim/include/ossim/projection/ossimAlphaSensorHSI.h b/include/ossim/projection/ossimAlphaSensorHSI.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimAlphaSensorHSI.h
rename to include/ossim/projection/ossimAlphaSensorHSI.h
diff --git a/include/ossim/projection/ossimApplanixEcefModel.h b/include/ossim/projection/ossimApplanixEcefModel.h
new file mode 100644
index 0000000..2c8ac0d
--- /dev/null
+++ b/include/ossim/projection/ossimApplanixEcefModel.h
@@ -0,0 +1,102 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// LGPL
+// 
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimApplanixEcefModel.h 20496 2012-01-25 17:15:43Z gpotts $
+#ifndef ossimApplanixEcefModel_HEADER
+#define ossimApplanixEcefModel_HEADER
+#include <ossim/projection/ossimFcsiModel.h>
+#include <ossim/projection/ossimMeanRadialLensDistortion.h>
+#include <ossim/base/ossimDpt3d.h>
+
+class OSSIM_DLL ossimApplanixEcefModel : public ossimSensorModel
+{
+public:
+   ossimApplanixEcefModel();
+   ossimApplanixEcefModel(const ossimDrect& imageRect, // center in image space
+                          const ossimGpt& platformPosition,
+                          double roll,
+                          double pitch,
+                          double heading,
+                          const ossimDpt& principalPoint, // in millimeters
+                          double focalLength, // in millimeters
+                          const ossimDpt& pixelSize); // in millimeters
+   ossimApplanixEcefModel(const ossimApplanixEcefModel& src);
+   virtual ossimObject* dup()const;
+   
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+
+   void lineSampleToWorld(const ossimDpt& image_point,
+                          ossimGpt&       gpt) const;
+  
+   
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPoint) const;
+   virtual void worldToLineSample(const ossimGpt& world_point,
+                                  ossimDpt&       image_point) const;
+   
+   virtual void updateModel();
+
+   void setPrincipalPoint(ossimDpt principalPoint);
+
+   virtual bool insideImage(const ossimDpt& p) const
+   {
+      /*          return( (p.u>=(0.0-FLT_EPSILON)) && */
+      /*                  (p.u<=(double)(theImageSize.u-(1-FLT_EPSILON))) && */
+      /*                  (p.v>=(0.0-FLT_EPSILON)) && */
+      /*                  (p.v<=(double)(theImageSize.v-(1-FLT_EPSILON))) ); */
+      // if it's close to the edge we will consider it inside the image
+      //
+      return theImageClipRect.pointWithin(p, theImageClipRect.width());
+   }
+
+
+   void setRollPitchHeading(double roll,
+                            double pitch,
+                            double heading);
+   
+   void setPixelSize(const ossimDpt& pixelSize);
+   void setImageRect(const ossimDrect& rect);
+   void setFocalLength(double focalLength);
+   void setPlatformPosition(const ossimGpt& gpt);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual void initAdjustableParameters();
+   
+   /*!
+    * ossimOptimizableProjection
+    */
+//   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM)
+   inline virtual bool useForward()const {return false;} //!ground to image faster (you don't need DEM)
+   virtual bool setupOptimizer(const ossimString& init_file); //!uses file path to init model
+
+protected:
+   
+   NEWMAT::Matrix theCompositeMatrix;
+   NEWMAT::Matrix theCompositeMatrixInverse;
+   double         theRoll;
+   double         thePitch;
+   double         theHeading;
+   ossimDpt       thePrincipalPoint;
+   ossimDpt       thePixelSize;
+   double         theFocalLength;
+   ossimEcefPoint theEcefPlatformPosition;
+   ossimRefPtr<ossimMeanRadialLensDistortion> theLensDistortion;
+
+
+   ossimEcefPoint theAdjEcefPlatformPosition;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/projection/ossimApplanixUtmModel.h b/include/ossim/projection/ossimApplanixUtmModel.h
new file mode 100644
index 0000000..21b01ad
--- /dev/null
+++ b/include/ossim/projection/ossimApplanixUtmModel.h
@@ -0,0 +1,83 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// LGPL
+// 
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimApplanixUtmModel.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimApplanixUtmModel_HEADER
+#define ossimApplanixUtmModel_HEADER
+#include <ossim/projection/ossimFcsiModel.h>
+#include <ossim/projection/ossimMeanRadialLensDistortion.h>
+#include <ossim/base/ossimDpt3d.h>
+
+class OSSIM_DLL ossimApplanixUtmModel : public ossimSensorModel
+{
+public:
+   ossimApplanixUtmModel();
+   ossimApplanixUtmModel(const ossimApplanixUtmModel& src);
+   virtual ossimObject* dup()const;
+   
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+
+   void lineSampleToWorld(const ossimDpt& image_point,
+                          ossimGpt&       gpt) const;
+  
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPoint) const;
+   virtual void worldToLineSample(const ossimGpt& world_point,
+                                  ossimDpt&       image_point) const;
+   
+   virtual void updateModel();
+
+   void setPrincipalPoint(ossimDpt principalPoint);
+
+   void setPixelSize(const ossimDpt& pixelSize);
+   void setImageRect(const ossimDrect& rect);
+   void setFocalLength(double focalLength);
+   void setPlatformPosition(const ossimGpt& gpt);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual void initAdjustableParameters();
+   
+   /*!
+    * ossimOptimizableProjection
+    */
+//   inline virtual bool useForward()const {return false;} 
+   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM) //TBC
+   virtual bool setupOptimizer(const ossimString& init_file); //!uses file path to init model
+
+protected:
+   NEWMAT::Matrix theCompositeMatrix;
+   NEWMAT::Matrix theCompositeMatrixInverse;
+   double         theOmega;
+   double         thePhi;
+   double         theKappa;
+   double         theBoreSightTx;
+   double         theBoreSightTy;
+   double         theBoreSightTz;
+   ossimDpt       thePrincipalPoint;
+   ossimDpt       thePixelSize;
+   double         theFocalLength;
+   ossimEcefPoint theEcefPlatformPosition;
+   ossimGpt       thePlatformPosition;
+   ossim_int32    theUtmZone;
+   ossim_int8     theUtmHemisphere;
+   ossimDpt3d     theUtmPlatformPosition;
+   ossimEcefVector theShiftValues;
+   
+   ossimRefPtr<ossimMeanRadialLensDistortion> theLensDistortion;
+   ossimEcefPoint theAdjEcefPlatformPosition;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimAzimEquDistProjection.h b/include/ossim/projection/ossimAzimEquDistProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimAzimEquDistProjection.h
rename to include/ossim/projection/ossimAzimEquDistProjection.h
diff --git a/ossim/include/ossim/projection/ossimBilinearProjection.h b/include/ossim/projection/ossimBilinearProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimBilinearProjection.h
rename to include/ossim/projection/ossimBilinearProjection.h
diff --git a/ossim/include/ossim/projection/ossimBngProjection.h b/include/ossim/projection/ossimBngProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimBngProjection.h
rename to include/ossim/projection/ossimBngProjection.h
diff --git a/ossim/include/ossim/projection/ossimBonneProjection.h b/include/ossim/projection/ossimBonneProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimBonneProjection.h
rename to include/ossim/projection/ossimBonneProjection.h
diff --git a/ossim/include/ossim/projection/ossimBuckeyeSensor.h b/include/ossim/projection/ossimBuckeyeSensor.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimBuckeyeSensor.h
rename to include/ossim/projection/ossimBuckeyeSensor.h
diff --git a/include/ossim/projection/ossimCadrgProjection.h b/include/ossim/projection/ossimCadrgProjection.h
new file mode 100644
index 0000000..38048cb
--- /dev/null
+++ b/include/ossim/projection/ossimCadrgProjection.h
@@ -0,0 +1,90 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimCadrgProjection.h 17815 2010-08-03 13:23:14Z dburken $
+#ifndef ossimCadrgProjection_HEADER
+#define ossimCadrgProjection_HEADER
+#include <ossim/projection/ossimMapProjection.h>
+
+class OSSIM_DLL ossimCadrgProjection : public ossimMapProjection
+{
+public:
+   ossimCadrgProjection();
+
+                       
+   virtual ossimObject *dup()const;
+   virtual ossimGpt inverse(const ossimDpt &eastingNorthing)const;
+   virtual ossimDpt forward(const ossimGpt &latLon)const;
+   
+   virtual ossimDpt worldToLineSample(const ossimGpt &worldPoint)    const;
+   virtual ossimGpt lineSampleToWorld(const ossimDpt &projectedPoint)const;
+   virtual void worldToLineSample(const ossimGpt &worldPoint,
+                                  ossimDpt&       lineSample)const;
+   virtual void lineSampleToWorld(const ossimDpt &projectedPoint,
+                                  ossimGpt& gpt)const;
+
+   double computeXPixConstant(double scale, long zone)const;
+   double computeYPixConstant(double scale)const;
+   /*!
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+
+   /*!
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   
+   ossimString getProjectionName()const
+      {
+         return getClassName();
+      }
+      
+   //! Returns TRUE if principal parameters are within epsilon tolerance.
+   virtual bool operator==(const ossimProjection& projection) const;
+
+protected:
+   virtual ~ossimCadrgProjection();
+   /*
+    * Are from the ADRG Mil spec for 1:1,000,000 and
+    * are scales for each zone.
+    */
+   static double theCadrgArcA[8];
+   
+
+   static double theOldZoneExtents[10];
+
+   static double theNorthLimit;
+   static double theSouthLimit;
+
+   ossim_int32   theCadrgZone;
+
+   ossimDpt thePixelConstant;
+   double   theMapScale;
+
+   double theWidth;
+   double theHeight;
+
+   ossimDpt theUlLineSample;
+
+   ossimGpt theUlGpt;
+   ossimGpt theLlGpt;
+   ossimGpt theLrGpt;
+   ossimGpt theUrGpt;
+   
+   void computeParameters();
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimCassiniProjection.h b/include/ossim/projection/ossimCassiniProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimCassiniProjection.h
rename to include/ossim/projection/ossimCassiniProjection.h
diff --git a/include/ossim/projection/ossimCoarseGridModel.h b/include/ossim/projection/ossimCoarseGridModel.h
new file mode 100644
index 0000000..bf24bba
--- /dev/null
+++ b/include/ossim/projection/ossimCoarseGridModel.h
@@ -0,0 +1,145 @@
+//*****************************************************************************
+// FILE: ossimCoarseGridModel.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION:
+//   Contains declaration of class ossimCoarseGridModel. This is an
+//   implementation of an interpolation sensor model.
+//
+//*****************************************************************************
+//  $Id: ossimCoarseGridModel.h 22825 2014-07-07 23:14:52Z dburken $
+
+#ifndef ossimCoarseGridModel_HEADER
+#define ossimCoarseGridModel_HEADER 1
+
+#include <ossim/projection/ossimSensorModel.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDblGrid.h>
+#include <ossim/base/ossimFilename.h>
+
+class ossimImageGeometry;
+
+/******************************************************************************
+ *
+ * CLASS:  ossimCoarseGridModel
+ *
+ *****************************************************************************/
+class OSSIMDLLEXPORT ossimCoarseGridModel : public ossimSensorModel
+{
+public:
+   ossimCoarseGridModel();
+   ossimCoarseGridModel(const ossimCoarseGridModel& copy_this);
+
+   /** Accepts name of geometry file. This can be either MET ECG geom file, or
+    * OSSIM keywordlist geometry file.*/
+   ossimCoarseGridModel(const ossimFilename& geom_file);
+
+   /** Accepts OSSIM keywordlist geometry file. */
+   ossimCoarseGridModel(const ossimKeywordlist& geom_kwl);
+   
+   ~ossimCoarseGridModel();
+
+   /** This method will build a grid from any projector. The accuracy of the grid can be
+    * controlled by the static method setInterpolationError().
+    * @param imageBounds Must be the image space bounds for the projection.
+    * @param proj The projector that will be used to approximate a bilinear grid over. */
+   virtual void buildGrid(const ossimDrect& imageBounds,
+                          ossimProjection* proj,
+                          double heightDelta=500.0,
+                          bool enableHeightFlag=false,
+                          bool makeAdjustableFlag=true);
+   virtual void buildGrid(const ossimDrect& imageBounds,
+                          ossimImageGeometry* geom,
+                          double heightDelta=500.0,
+                          bool enableHeightFlag=false,
+                          bool makeAdjustableFlag=true);
+   
+   /** This is used when building a grid from a projector. You can set the interpolation error.
+    * The default is subpixel accuracy (within .1 of a pixel). */
+   static void setInterpolationError(double error=.1);
+   static void setMinGridSpacing(ossim_int32 minSpacing = 100);
+
+   /** Extends base-class implementation. Dumps contents of object to ostream. */
+   virtual std::ostream& print(std::ostream& out) const;
+   
+   /** Fulfills ossimObject base-class pure virtuals. Saves geometry KWL files.
+    * @return Returns true if successful. */
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
+
+   /** Fulfills ossimObject base-class pure virtuals. Loads geometry KWL files.
+    * @return Returns true if successful. */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /** Writes a template of geometry keywords processed by loadState and
+    * saveState to output stream. */
+   static void writeGeomTemplate(ostream& os);
+
+   /** Returns pointer to a new instance, copy of this. */
+   virtual ossimObject* dup() const { return new ossimCoarseGridModel(*this); }
+   
+   /** Saves the coarse grid to the specified file.
+    * @return Returns true if successful. */
+   bool saveCoarseGrid(const ossimFilename& cgFileName) const;
+
+   /** Loads the coarse grid from the specified file.
+    * @return Returns true if successful. */
+   bool loadCoarseGrid(const ossimFilename& cgFileName);
+
+   virtual void imagingRay(const ossimDpt& image_point, ossimEcefRay& image_ray) const;
+
+   
+   virtual void lineSampleToWorld(const ossimDpt& image_point, ossimGpt& gpt) const;
+
+   /** This is the virtual that performs the actual work of projecting the image point
+    * to the earth at some specified elevation. */
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       world_pt) const;
+
+   virtual void initAdjustableParameters();
+
+   /*!
+    * ossimOptimizableProjection
+    */
+   inline virtual bool useForward()const {return false;} //!image to ground faster
+
+   /** Overrides base ossimSensorModel::isAffectedByElevation method.
+    * @return true if height enabled, false if not. */
+   virtual bool isAffectedByElevation() const;
+   
+protected:
+
+   /** Deletes existing allocated memory and reallocates
+    * new space. This may happen if a new grid is loaded over an existing one. */
+   void reallocateGrid(const ossimIpt& size);
+   
+   //! Initializes base class data members after grids have been assigned.
+   void initializeModelParams(ossimIrect irect);
+
+   //! Implements its own extrapolation since this can be handled by ossimDblGrid.
+   virtual ossimGpt extrapolate (const ossimDpt& imgPt, const double& height=ossim::nan()) const;
+
+   mutable ossimFilename theGridFilename;
+   ossimDblGrid  theLatGrid;         // degrees
+   ossimDblGrid  theLonGrid;         // degrees
+   ossimDblGrid  theDlatDhGrid;      // degrees/meter
+   ossimDblGrid  theDlonDhGrid;      // degrees/meter
+   ossimDblGrid* theDlatDparamGrid;  // degrees/(units-of-param)
+   ossimDblGrid* theDlonDparamGrid;  // degrees/(units-of-param)
+
+   static double       theInterpolationError;
+   static ossim_int32  theMinGridSpacing;
+   ossimAdjustmentInfo theInitialAdjustment;
+   bool                theHeightEnabledFlag;
+   
+   TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimCylEquAreaProjection.h b/include/ossim/projection/ossimCylEquAreaProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimCylEquAreaProjection.h
rename to include/ossim/projection/ossimCylEquAreaProjection.h
diff --git a/ossim/include/ossim/projection/ossimEckert4Projection.h b/include/ossim/projection/ossimEckert4Projection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimEckert4Projection.h
rename to include/ossim/projection/ossimEckert4Projection.h
diff --git a/ossim/include/ossim/projection/ossimEckert6Projection.h b/include/ossim/projection/ossimEckert6Projection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimEckert6Projection.h
rename to include/ossim/projection/ossimEckert6Projection.h
diff --git a/include/ossim/projection/ossimEpsgProjectionDatabase.h b/include/ossim/projection/ossimEpsgProjectionDatabase.h
new file mode 100644
index 0000000..dd50b6b
--- /dev/null
+++ b/include/ossim/projection/ossimEpsgProjectionDatabase.h
@@ -0,0 +1,132 @@
+//*************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************************************
+//  $Id: ossimEpsgProjectionDatabase.h 22924 2014-10-27 16:32:58Z okramer $
+
+#ifndef ossimEpsgProjectionDatabase_HEADER
+#define ossimEpsgProjectionDatabase_HEADER 1
+
+#include <ossim/projection/ossimProjectionFactoryBase.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <OpenThreads/Mutex>
+#include <fstream>
+
+
+class ossimProjection;
+class ossimString;
+class ossimEpsgProjectionFactory;
+class ossimUtmProjection;
+
+//*************************************************************************************************
+//! Projection Database for coded projections defined in database files and specified via some 
+//! coordinate reference system group:code, such as EPSG:26715.
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimEpsgProjectionDatabase : public ossimReferenced
+{
+   friend class ossimEpsgProjectionFactory;
+
+public:
+   //! Instantiates singleton instance of this class:
+   static ossimEpsgProjectionDatabase* instance();
+
+   //! Destructor
+   virtual ~ossimEpsgProjectionDatabase();
+
+   //! Returns a projection corresponding to the projection specified, or NULL if no entry found.
+   //! Normally <proj_spec> takes the form of <group>:<code> (e.g., "EPSG:26715"). Other forms 
+   //! accepted are <code> (assumed EPSG), or <proj_name> to match a name in the database.
+   ossimProjection* findProjection(const ossimString& proj_spec) const;
+
+   //! Returns a projection corresponding to the epsg code specified, or NULL if no entry found.
+   ossimProjection* findProjection(ossim_uint32 epsg_code) const;
+
+   //! Given a projection name, assigns the group (e.g., "EPSG") and code of the projection. 
+   //! Returns integer EPSG code if match was found or 0 if not found.
+   ossim_uint32 findProjectionCode(const ossimString& projection_name) const;
+
+   //! Given a projection instance, this method determines the corresponding EPSG code. Obviously
+   //! this is only needed if the projection does not have its PCS code assigned (it is NULL). This
+   //! happens when the projection was constructed with full parameters instead of the EPSG code.
+   //! Returns integer EPSG code if match was found or 0 if not found.
+   ossim_uint32 findProjectionCode(const ossimMapProjection& lost_proj) const;
+
+   //! ### NECESSARY HACK ### (originally implemented by ESH)
+   //! ArcMap (9.2 and less) doesn't understand the non-meters HARN codes.  
+   //! This method provides acess to the projection name given the EPSG code. The name provides 
+   //! enough info for recognizing a non-meters HARN-based projection. 
+   ossimString findProjectionName(ossim_uint32 epsg_code) const;
+
+   //! Populates caller's list with all projections currently represented in the database.
+   //! The format is: 
+   //!    EPSG:<code>  "<Name as appears in Db>"
+   //! There may be duplicate entries if the projection is duplicated in the various Db files.
+   void getProjectionsList(std::vector<ossimString>& typeList) const;
+
+   //! ENGINEERING CODE. Used for testing
+   size_t numRecords() const { return m_projDatabase.size(); }
+
+   //! Given UTM projection, derives the associated EPSG code. This is faster than a Db lookup.
+   ossim_uint32 getCodeFromUtmProj(const ossimUtmProjection* proj) const;
+
+protected:
+   enum RecordFormat
+   {  
+      NOT_ASSIGNED=0,
+      FORMAT_A,
+      FORMAT_B,
+      FORMAT_C,
+      CUSTOM
+   };
+
+   //! Type for database record consists of EPSG code and serialized form of corresponding OSSIM 
+   //! projection (as a keywordlist)
+   class ProjDbRecord : public ossimReferenced
+   {
+   public:
+      ProjDbRecord() : 
+            code(0), 
+            name(""), 
+            datumValid(false), 
+            csvFormat(NOT_ASSIGNED), 
+            proj(0) {}
+
+      ossim_uint32     code;
+      ossimString      name;
+      bool             datumValid; //!< FALSE if the datum code was not parsed and WGS84 defaulted
+      RecordFormat     csvFormat;
+      std::vector<ossimString>        csvRecord;
+      ossimRefPtr<ossimMapProjection> proj;
+   };
+
+   //! Constructor loads all Db files specified in the ossim prefs. Protected as part of
+   //! singleton implementation.
+   ossimEpsgProjectionDatabase();
+
+   //! Parses the "Spadac EPSG" Db record format and produces a projection (or NULL if invalid)   
+   ossimMapProjection* createProjFromFormatARecord(ProjDbRecord* record) const;
+
+   //! Parses the State Plane Db record format and produce a projection (or NULL if invalid)
+   ossimMapProjection* createProjFromFormatBRecord(ProjDbRecord* record) const;
+
+   //!  ### HACK ###
+   //! UTM projections as specified in the EPSG are indistinguishable from regular TM.
+   //! Unfortunately OSSIM does make a distinction. For the time being, parse the code and
+   //! programmatically arrives at the UTM projection.
+   ossimMapProjection* createProjFromUtmCode(ossim_uint32 code) const;
+
+   //! Populates the database with contents of DB files as specified in ossim_preferences.
+   void initialize() const;
+
+   mutable std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> > m_projDatabase;
+   mutable OpenThreads::Mutex m_mutex;
+   //static ossimEpsgProjectionDatabase*  m_instance; //!< Singleton implementation
+   
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimEpsgProjectionFactory.h b/include/ossim/projection/ossimEpsgProjectionFactory.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimEpsgProjectionFactory.h
rename to include/ossim/projection/ossimEpsgProjectionFactory.h
diff --git a/ossim/include/ossim/projection/ossimEquDistCylProjection.h b/include/ossim/projection/ossimEquDistCylProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimEquDistCylProjection.h
rename to include/ossim/projection/ossimEquDistCylProjection.h
diff --git a/ossim/include/ossim/projection/ossimFcsiModel.h b/include/ossim/projection/ossimFcsiModel.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimFcsiModel.h
rename to include/ossim/projection/ossimFcsiModel.h
diff --git a/ossim/include/ossim/projection/ossimGnomonicProjection.h b/include/ossim/projection/ossimGnomonicProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimGnomonicProjection.h
rename to include/ossim/projection/ossimGnomonicProjection.h
diff --git a/include/ossim/projection/ossimGoogleProjection.h b/include/ossim/projection/ossimGoogleProjection.h
new file mode 100644
index 0000000..73d0816
--- /dev/null
+++ b/include/ossim/projection/ossimGoogleProjection.h
@@ -0,0 +1,34 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//
+//*******************************************************************
+#ifndef ossimGoogleProjection_HEADER
+#define ossimGoogleProjection_HEADER 1
+#include <ossim/projection/ossimMapProjection.h>
+
+class OSSIM_DLL ossimGoogleProjection : public ossimMapProjection
+{
+public:
+   ossimGoogleProjection(const ossimEllipsoid& ellipsoid = ossimEllipsoid(),
+                        const ossimGpt& origin = ossimGpt());
+   ossimGoogleProjection(const ossimGoogleProjection&);
+   ~ossimGoogleProjection();
+   virtual ossimObject *dup()const{return new ossimGoogleProjection(*this);}
+
+   virtual ossimDpt forward(const ossimGpt &worldPoint)    const;
+   virtual ossimGpt inverse(const ossimDpt &projectedPoint)const;
+   virtual void update();
+
+	virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+	virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
+   virtual bool operator==(const ossimProjection& projection) const;
+
+protected:
+
+	TYPE_DATA;
+};
+#endif
diff --git a/include/ossim/projection/ossimIkonosRpcModel.h b/include/ossim/projection/ossimIkonosRpcModel.h
new file mode 100644
index 0000000..3943aa3
--- /dev/null
+++ b/include/ossim/projection/ossimIkonosRpcModel.h
@@ -0,0 +1,76 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimIkonosRpcModel. This 
+//    derived class implements the capability of reading Ikonos RPC support
+//    data.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimIkonosRpcModel.h 20606 2012-02-24 12:29:52Z gpotts $
+
+#ifndef ossimIkonosRpcModel_HEADER
+#define ossimIkonosRpcModel_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/projection/ossimRpcModel.h>
+#include <ossim/support_data/ossimIkonosMetaData.h>
+
+class ossimFilename;
+
+/*!****************************************************************************
+ *
+ * CLASS:  ossimIkonosRpcModel
+ *
+ *****************************************************************************/
+class OSSIM_DLL ossimIkonosRpcModel : public ossimRpcModel
+{
+public:
+  ossimIkonosRpcModel();
+   ossimIkonosRpcModel(const ossimFilename& geom_file);
+
+   ossimIkonosRpcModel(const ossimFilename& metadata,
+                       const ossimFilename& rpcdata);
+
+  virtual bool saveState(ossimKeywordlist& kwl,
+			 const char* prefix=0)const;
+
+  /**
+    * @brief loadState
+    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+    * KWL files. Returns true if successful.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+  
+   /*!
+    * STATIC METHOD: writeGeomTemplate(ostream)
+    * Writes a template of an ossimIkonosRpcModel geometry file.
+    */
+   static void writeGeomTemplate(ostream& os);
+
+   virtual bool parseFile(const ossimFilename& file);
+   
+protected:
+   virtual ~ossimIkonosRpcModel();
+   void finishConstruction();
+   void parseMetaData(const ossimFilename& metadata);
+   void parseRpcData (const ossimFilename& rpcdata);
+
+   bool isNitf(const ossimFilename& filename);
+   bool parseTiffFile(const ossimFilename& filename);
+/*    bool parseNitfFile(const ossimFilename& geom_file); */
+   bool parseHdrData(const ossimFilename& data_file);
+
+   ossimRefPtr<ossimIkonosMetaData> theSupportData;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/projection/ossimImageProjectionModel.h b/include/ossim/projection/ossimImageProjectionModel.h
new file mode 100644
index 0000000..4ce5f86
--- /dev/null
+++ b/include/ossim/projection/ossimImageProjectionModel.h
@@ -0,0 +1,61 @@
+//-----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class declaration of ossimImageProjectionModel.
+//
+//-----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimImageProjectionModel_HEADER
+#define ossimImageProjectionModel_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/imaging/ossimImageModel.h>
+
+class ossimProjection;
+
+/**
+ * @brief Class derived from ossimImageModel, this adds an image projection
+ * for lineSampleToWorld and worldToLineSample.
+ *
+ * Note that image points fed to projection methods should be full
+ * resolution with any sub image offset applied.
+ */
+class OSSIM_DLL ossimImageProjectionModel : public ossimImageModel
+{
+public:
+   
+   /** @brief default constructor */
+   ossimImageProjectionModel();
+
+
+   /**
+    * @brief Method to initialize class from an image handler.
+    *
+    * @param ih Image handler.
+    */
+   virtual void initialize(const ossimImageHandler& ih);
+
+   /**
+    * @brief Method to get projection.
+    *
+    * @return Constant pointer to projection or 0 if not initialized.
+    */
+   const ossimProjection* getProjection() const;
+
+protected:
+   /** @brief virtual destructor */
+   virtual ~ossimImageProjectionModel();
+
+   ossimProjection* theProjection;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimImageProjectionModel_HEADER */
diff --git a/include/ossim/projection/ossimImageViewAffineTransform.h b/include/ossim/projection/ossimImageViewAffineTransform.h
new file mode 100644
index 0000000..4f4c9d7
--- /dev/null
+++ b/include/ossim/projection/ossimImageViewAffineTransform.h
@@ -0,0 +1,187 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimImageViewAffineTransform.h 23477 2015-08-26 14:39:12Z gpotts $
+#ifndef ossimImageViewAffineTransform_HEADER
+#define ossimImageViewAffineTransform_HEADER
+#include <ossim/projection/ossimImageViewTransform.h>
+#include <ossim/matrix/newmat.h>
+
+class OSSIMDLLEXPORT ossimImageViewAffineTransform: public ossimImageViewTransform
+{
+public:
+   ossimImageViewAffineTransform(double rotateDegrees = 0.0,
+                                 double imageScaleX = 1.0,
+                                 double imageScaleY = 1.0,
+                                 double scaleXValue = 1.0,
+                                 double scaleYValue = 1.0,
+                                 double translateXValue = 0.0,
+                                 double translateYValue = 0.0,
+                                 double pivotXValue = 0.0,
+                                 double pivotYValue = 0.0 );
+   virtual ~ossimImageViewAffineTransform();
+   
+   ossimImageViewAffineTransform(const ossimImageViewAffineTransform& src)
+   :ossimImageViewTransform(src),
+   m_transform(src.m_transform),
+   m_inverseTransform(src.m_inverseTransform),
+   m_rotation(src.m_rotation),
+   m_imageSpaceScale(src.m_imageSpaceScale),
+   m_scale(src.m_scale),
+   m_translate(src.m_translate),
+   m_pivot(src.m_pivot)
+   {
+   }
+   virtual ossimObject* dup()const
+   {
+      return new ossimImageViewAffineTransform(*this);
+   }
+//   virtual void inverse(const ossimDpt& input,
+//                        ossimDpt&       output) const
+//   {
+//      viewToImage(input, output);
+ //  }
+   
+   virtual void imageToView(const ossimDpt& imagePoint,
+                            ossimDpt&       viewPoint)const;
+   virtual void viewToImage(const ossimDpt& viewPoint,
+                            ossimDpt&       imagePoint)const;
+   void setMatrix(NEWMAT::Matrix& matrix);
+   const NEWMAT::Matrix& getMatrix()const;
+   
+   virtual bool isIdentity()const
+   {
+      return ((m_transform[0][0] == 1.0)&&
+              (m_transform[0][1] == 0.0)&&
+              (m_transform[0][2] == 0.0)&&
+              (m_transform[1][0] == 0.0)&&
+              (m_transform[1][1] == 1.0)&&
+              (m_transform[1][2] == 0.0)&&
+              (m_transform[2][0] == 0.0)&&
+              (m_transform[2][1] == 0.0)&&
+              (m_transform[2][2] == 1.0));
+   }
+
+   virtual bool isValid()const;
+   virtual bool setView(ossimObject* obj);
+   virtual ossimObject* getView();
+   virtual const ossimObject* getView()const;
+   
+   /** @return (1, 1) ???????(drb) */
+   virtual ossimDpt getInputMetersPerPixel()const;
+
+   /** @return (nan, nan) ????????? (drb) */
+   virtual ossimDpt getOutputMetersPerPixel()const;
+   
+   /*!
+    * Translate in the x and y direction.
+    */ 
+   virtual void translate(double deltaX, double deltaY);
+   
+   /*!
+    * Translate in the x direction.
+    */
+   virtual void translateX(double deltaX);
+   
+   /*!
+    * Translate in the Y direction.
+    */
+   virtual void translateY(double deltaY);
+   
+   /*!
+    * Translate the origin for rotation in the x and y direction.
+    */
+   virtual void pivot(double originX, double originY);
+   
+   /*!
+    * Translate the origin for rotation in the x direction.
+    */
+   virtual void pivotX(double originX);
+   
+   /*!
+    * Translate the origin for rotation in the y direction.
+    */
+   virtual void pivotY(double originY);
+
+   /*!
+    * Will allow you to specify an image scale
+    * for both the x and y direction.
+    */
+   virtual void imageSpaceScale(double x, double y);
+   
+   /*!
+    * Will allow you to specify an image scale along the X direction.
+    */
+   virtual void imageSpaceScaleX(double x);
+
+   /*!
+    * Will allow you to an image scale along the Y direction.
+    */
+   virtual void imageSpaceScaleY(double y);
+    
+   /*!
+    * will allow you to specify a scale
+    * for both the x and y direction.
+    */
+   virtual void scale(double x, double y);
+    
+   /*!
+    * will alow you to specify a scale
+    * along the X direction.
+    */
+   virtual void scaleX(double x);
+   
+   /*!
+    * Will allow you to scale along the Y
+    * direction.
+    */
+   virtual void scaleY(double y);
+   
+   /*!
+    * Will apply a rotation
+    */
+   virtual void rotate(double degrees);
+   
+   ossim_float64 getRotation()const{return m_rotation;}
+   const ossimDpt& getScale()const{return m_scale;}
+   const ossimDpt& getTranslate()const{return m_translate;}
+   const ossimDpt& getPivot()const{return m_pivot;}
+   
+   
+   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType = OSSIM_COMPARE_FULL)const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix =0);
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix =0)const;
+   
+   
+protected:
+   void buildCompositeTransform();
+   
+   /*!
+    * This is the transformation from image to
+    * viewing coordinates.  If this matrix is
+    * changed it will perform an inverse to solve
+    * the inverse transform.
+    */
+   NEWMAT::Matrix m_transform;
+   NEWMAT::Matrix m_inverseTransform;
+   ossim_float64  m_rotation;
+   ossimDpt       m_imageSpaceScale;
+   ossimDpt       m_scale;
+   ossimDpt       m_translate;
+   ossimDpt       m_pivot;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/projection/ossimImageViewProjectionTransform.h b/include/ossim/projection/ossimImageViewProjectionTransform.h
new file mode 100644
index 0000000..d42d109
--- /dev/null
+++ b/include/ossim/projection/ossimImageViewProjectionTransform.h
@@ -0,0 +1,130 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// AUTHOR: Garrett Potts (gpotts at imagelinks.com)  
+//         Oscar Kramer (oscar at krameranalytic.com)
+//
+// DESCRIPTION: Contains declaration of ossimImageViewProjectionTransform.
+//    This class provides an image to view transform that utilizes two
+//    independent 2D-to-3D projections. Intended for transforming view to
+//    geographic "world" space to input image space.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimImageViewProjectionTransform.h 20352 2011-12-12 17:24:52Z dburken $
+
+#ifndef ossimImageViewProjectionTransform_HEADER
+#define ossimImageViewProjectionTransform_HEADER 1
+
+#include <ossim/projection/ossimImageViewTransform.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/base/ossimPolyArea2d.h>
+
+class OSSIMDLLEXPORT ossimImageViewProjectionTransform : public ossimImageViewTransform
+{
+public:
+   ossimImageViewProjectionTransform(ossimImageGeometry* imageGeometry=0,
+                                     ossimImageGeometry* viewGeometry=0);
+
+   //! copy constructor 
+   ossimImageViewProjectionTransform(const ossimImageViewProjectionTransform& src);
+
+   virtual ossimObject* dup() const { return new ossimImageViewProjectionTransform(*this); }
+   virtual ~ossimImageViewProjectionTransform();
+
+   //! Satisfies base class pure virtual. Returns TRUE if both input and output geoms exist.
+   virtual bool isValid() const { return (m_imageGeometry.valid() && m_viewGeometry.valid()); }
+
+   //! Returns TRUE if both input and output geometries are identical. Presently implemented as
+   //! limited compare of geometry pointers
+   virtual bool isIdentity() const { return (m_imageGeometry == m_viewGeometry); }
+
+   //! Assigns the geometry to use for output view. This object does NOT own the geometry.
+   void setViewGeometry(ossimImageGeometry* g);   
+
+   //! Assigns the geometry to use for input image. This object does NOT own the geometry.
+   void setImageGeometry(ossimImageGeometry* g);  
+
+   //! Workhorse of the object. Converts image-space to view-space.
+   virtual void imageToView(const ossimDpt& imagePoint, ossimDpt& viewPoint) const;
+
+   //! Other workhorse of the object. Converts view-space to image-space.
+   virtual void viewToImage(const ossimDpt& viewPoint, ossimDpt& imagePoint) const;
+
+   //! Dumps contents to stream
+   virtual std::ostream& print(std::ostream& out) const;
+   
+   ossimImageGeometry* getImageGeometry()  { return m_imageGeometry.get(); }
+   ossimImageGeometry* getViewGeometry()   { return m_viewGeometry.get(); }
+   const ossimImageGeometry* getImageGeometry()const  { return m_imageGeometry.get(); }
+   const ossimImageGeometry* getViewGeometry()const   { return m_viewGeometry.get(); }
+   
+   /**
+   * Because of the fact we can have dateline crossings there exist on the view
+   * plane both positive and negative bounds.  We need a generalized interface that allows
+   * us to calculate the valid bounds of an image transformed to the view.
+   *
+   *
+   * @param viewBounds Returns bounds for each segment
+   * @param polyArea   Returns the polygons for each segment.
+   * @param numberOfEdgePoints If the value is 0 it will do a standard bounds check.  If
+   *                           the paramter is greater than 0 this will only be used if the
+   *                           input projection is affected by elevation.  If it's not affected
+   *                           by elevation then the default bounds will be calculated.
+   */
+   virtual void getViewSegments(std::vector<ossimDrect>& viewBounds, 
+                                ossimPolyArea2d& polyArea,
+                                ossim_uint32 numberOfEdgePoints=25)const; 
+
+
+   /**
+   * This is used a a general access point for setting a view to a chain.  
+   * There are multiple locations that need a projector in order to run properly.  
+   * When a "Set View" event is sent through the chain.  Typically this is passed
+   * down from The renderer.
+   */
+   virtual bool setView(ossimObject* baseObject);
+   
+   virtual       ossimObject* getView()       { return m_viewGeometry.get(); }
+   virtual const ossimObject* getView() const { return m_viewGeometry.get(); }
+
+   //! Returns the GSD of input image.
+   virtual ossimDpt getInputMetersPerPixel()const;
+
+   //! Returns the GSD of the output view.
+   virtual ossimDpt getOutputMetersPerPixel() const;
+
+   //! Gets the image bounding rect in view-space coordinates
+   virtual ossimDrect getImageToViewBounds(const ossimDrect& imageRect)const;
+   
+   //! After rewrite for incorporating ossimImageGeometry: No longer needed.  
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix =0);
+   
+   //! After rewrite for incorporating ossimImageGeometry: No longer needed.  
+   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix = 0)const;
+
+protected:
+
+   /**
+    * @brief Initializes the view geometry image size from image geometry
+    * bounding rect.
+    *
+    * This is needed for the ossimImageGeometry::worldToLocal if the underlying
+    * projection is geographic to handle images that cross the date line.
+    * 
+    * @param Input image rectangle.
+    * @return true on success, false on error.
+    */
+   bool initializeViewSize();  
+   void initializeDatelineCrossing();
+
+   ossimRefPtr<ossimImageGeometry> m_imageGeometry;
+   ossimRefPtr<ossimImageGeometry> m_viewGeometry;
+
+   bool m_crossesDateline;
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimImageViewTransform.h b/include/ossim/projection/ossimImageViewTransform.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimImageViewTransform.h
rename to include/ossim/projection/ossimImageViewTransform.h
diff --git a/ossim/include/ossim/projection/ossimImageViewTransformFactory.h b/include/ossim/projection/ossimImageViewTransformFactory.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimImageViewTransformFactory.h
rename to include/ossim/projection/ossimImageViewTransformFactory.h
diff --git a/ossim/include/ossim/projection/ossimIpodSensor.h b/include/ossim/projection/ossimIpodSensor.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimIpodSensor.h
rename to include/ossim/projection/ossimIpodSensor.h
diff --git a/ossim/include/ossim/projection/ossimLambertConformalConicProjection.h b/include/ossim/projection/ossimLambertConformalConicProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimLambertConformalConicProjection.h
rename to include/ossim/projection/ossimLambertConformalConicProjection.h
diff --git a/ossim/include/ossim/projection/ossimLandSatModel.h b/include/ossim/projection/ossimLandSatModel.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimLandSatModel.h
rename to include/ossim/projection/ossimLandSatModel.h
diff --git a/include/ossim/projection/ossimLensDistortion.h b/include/ossim/projection/ossimLensDistortion.h
new file mode 100644
index 0000000..988bef1
--- /dev/null
+++ b/include/ossim/projection/ossimLensDistortion.h
@@ -0,0 +1,53 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// LGPL
+// 
+// Author:  Garrett Potts (gpotts at imagelinks.com)
+//
+// Description:
+//
+// ossimLensDistortion
+//*******************************************************************
+//  $Id: ossimLensDistortion.h 15929 2009-11-16 18:20:46Z gpotts $
+
+#ifndef ossimLensDistortion_HEADER
+#define ossimLensDistortion_HEADER
+#include <ossim/base/ossim2dTo2dTransform.h>
+class OSSIM_DLL ossimLensDistortion : public ossim2dTo2dTransform
+{
+public:
+   ossimLensDistortion(const ossimDpt& callibratedCenter=ossimDpt(0,0))
+      :theCenter(callibratedCenter)
+   {
+   }
+   void setCenter(const ossimDpt& center)
+   {
+      theCenter = center;
+   }
+   const ossimDpt& getCenter()const{return theCenter;}
+   virtual void forward(const ossimDpt& input,
+                        ossimDpt& output) const
+   {
+      distort(input, output);
+   }
+   virtual void inverse(const ossimDpt& input,
+                        ossimDpt& output)
+   {
+      undistort(input, output);
+   }
+   virtual void distort(const ossimDpt& input, ossimDpt& output)const;
+   virtual void undistort(const ossimDpt& input, ossimDpt& output)const=0;
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0)const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+   
+protected:
+   ossimDpt theCenter;
+
+TYPE_DATA   
+};
+#endif
diff --git a/ossim/include/ossim/projection/ossimLlxyProjection.h b/include/ossim/projection/ossimLlxyProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimLlxyProjection.h
rename to include/ossim/projection/ossimLlxyProjection.h
diff --git a/ossim/include/ossim/projection/ossimMapProjection.h b/include/ossim/projection/ossimMapProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimMapProjection.h
rename to include/ossim/projection/ossimMapProjection.h
diff --git a/include/ossim/projection/ossimMapProjectionFactory.h b/include/ossim/projection/ossimMapProjectionFactory.h
new file mode 100644
index 0000000..38b1d26
--- /dev/null
+++ b/include/ossim/projection/ossimMapProjectionFactory.h
@@ -0,0 +1,66 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  Garrett Potts
+//
+// Description:
+//
+// class ossimProjectionFactory maintains a static list of projection
+// makers.  If a user wants to create a projection they can pass in
+// a projection name and a datum if desired.  Currently the default
+// datum will be WGS84.
+//*******************************************************************
+//  $Id: ossimMapProjectionFactory.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimMapProjectionFactory_HEADER
+#define ossimMapProjectionFactory_HEADER
+
+#include <ossim/projection/ossimProjectionFactoryBase.h>
+
+class ossimProjection;
+class ossimString;
+
+class OSSIMDLLEXPORT ossimMapProjectionFactory : public ossimProjectionFactoryBase
+{
+public:
+   /*!
+    * METHOD: instance()
+    * Instantiates singleton instance of this class:
+    */
+   static ossimMapProjectionFactory* instance();
+
+   virtual ossimProjection* createProjection(const ossimFilename& filename,
+                                             ossim_uint32 entryIdx)const;
+   /*!
+    * METHOD: create()
+    * Attempts to create an instance of the projection specified by name.
+    * Returns successfully constructed projection or NULL.
+    */
+   virtual ossimProjection* createProjection(const ossimString& name)const;
+   virtual ossimProjection* createProjection(const ossimKeywordlist& kwl,
+                                             const char* prefix = 0)const;
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0)const;
+   
+   /*!
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamially and this
+    * name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+
+protected:
+   ossimMapProjectionFactory() {}
+   static ossimMapProjectionFactory*  theInstance;
+ 
+};
+
+#endif
diff --git a/include/ossim/projection/ossimMapProjectionInfo.h b/include/ossim/projection/ossimMapProjectionInfo.h
new file mode 100644
index 0000000..f2e2a6b
--- /dev/null
+++ b/include/ossim/projection/ossimMapProjectionInfo.h
@@ -0,0 +1,276 @@
+//*******************************************************************
+// Copyright (C) 2001 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// Class for encapsulate projection info given a projection, datum, and
+// output rectangle.
+//
+// NOTE:
+// - Output rectangle should be relative to the center of pixels.
+//   Shifts will be made for "pixel is area" internally.
+//
+//*******************************************************************
+//  $Id: ossimMapProjectionInfo.h 11959 2007-10-31 19:22:56Z gpotts $
+
+#ifndef ossimMapProjectionInfo_HEADER
+#define ossimMapProjectionInfo_HEADER
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimString.h>
+
+class ossimMapProjection;
+class ossimImageChain;
+
+class OSSIMDLLEXPORT ossimMapProjectionInfo : public ossimObject
+{
+public:
+
+   ossimMapProjectionInfo(const ossimMapProjection* proj,
+                          const ossimDrect& output_rect);
+
+   virtual ~ossimMapProjectionInfo();
+
+   /**
+    *  Returns true on error false if ok.
+    */
+   bool errorStatus() const;
+
+   /**
+    * Adds tie point to keyword list.  This will be latitude, longitude if
+    * projection is geographic; else, easting, northing.
+    */
+   void getGeom(ossimKeywordlist& kwl, const char* prefix=0)const;
+
+   /**
+    *  Returns the pixel size in meters.
+    *  x = sample direction
+    *  y = line direction
+    */
+   ossimDpt getMetersPerPixel() const;
+   
+   /**
+    *  Returns the pixel size in U.S. Survey feet.
+    *  x = sample direction
+    *  y = line direction
+    *
+    *  NOTE:
+    *  The US survey feet per meter converion (0.3048006096 feet per meter)
+    *  is NOT the same as the standard feet per meter conversion
+    *  (0.3048 feet per meter).
+    */
+   ossimDpt getUsSurveyFeetPerPixel() const;
+
+   /**
+    *  Returns the decimal degrees per pixel.
+    *  x = sample direction
+    *  y = line direction
+    */
+   ossimDpt getDecimalDegreesPerPixel() const;
+   
+   /**
+    *  Returns the upper left easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v". Units are in meters.
+    */
+   ossimDpt ulEastingNorthingPt() const;
+
+   /**
+    *  Returns the upper right easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v". Units are in meters.
+    */
+   ossimDpt urEastingNorthingPt() const;
+
+   /**
+    *  Returns the lower right easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v". Units are in meters.
+    */
+   ossimDpt lrEastingNorthingPt() const;
+
+   /**
+    *  Returns the lower left easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v". Units are in meters.
+    */
+   ossimDpt llEastingNorthingPt() const;
+   
+   /**
+    *  Returns the upper left easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v".
+    *  Units are in U.S. Survey feet.
+    */
+   ossimDpt ulEastingNorthingPtInFt() const;
+
+   /**
+    *  Returns the upper right easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v".
+    *  Units are in U.S. Survey feet.
+    */
+   ossimDpt urEastingNorthingPtInFt() const;
+
+   /**
+    *  Returns the lower right easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v".
+    *  Units are in U.S. Survey feet.
+    */
+   ossimDpt lrEastingNorthingPtInFt() const;
+
+   /**
+    *  Returns the lower left easting and northing as a ossimDpt.
+    *  The easting is "u" and the northing is "v". 
+    *  Units are in U.S. Survey feet.
+    */
+   ossimDpt llEastingNorthingPtInFt() const;
+   
+   /**
+    * Returns the upper left ground point.
+    */
+   ossimGpt ulGroundPt() const;
+
+   /**
+    * Returns the upper right ground point.
+    */
+   ossimGpt urGroundPt() const;
+
+   /**
+    * Returns the lower right ground point.
+    */
+   ossimGpt lrGroundPt() const;
+ 
+   /**
+    * Returns the lower left ground point.
+    */
+   ossimGpt llGroundPt() const;
+
+   /**
+    * Returns the center ground point.
+    */
+   ossimGpt centerGroundPt() const;
+
+   /** @return The center ground point. */
+   ossimDpt centerEastingNorthingPt() const;
+
+   /** @return The lines per image. */
+   ossim_int32 linesPerImage() const;
+
+   /** @return The pixels per line (samples). */
+   ossim_int32 pixelsPerLine() const;
+
+   /**
+    * Formatted print of data members.  Used by operator <<.
+    */
+   std::ostream& print(std::ostream& os) const;
+
+   /**
+    *  Sets the data member "thePixelType".
+    *  NOTE:
+    *  PIXEL_IS_POINT (ennumerated to a "0"):
+    *  Corner coordinates are relative to the center of pixel.
+    *  PIXEL_IS_AREA (ennumerated to a "1"):
+    *  Corner coordinates are relative to the outer edge of the pixel.
+    */
+   void setPixelType (ossimPixelType type);
+
+   /**
+    *  Returns data member "thePixelType".
+    *  NOTE:
+    *  OSSIM_PIXEL_IS_POINT (ennumerated to a "0"):
+    *  Corner coordinates are relative to the center of pixel.
+    *  OSSIM_PIXEL_IS_AREA (ennumerated to a "1"):
+    *  Corner coordinates are relative to the outer of the pixel.
+    */
+   ossimPixelType  getPixelType () const;
+
+   /**
+    * Sets the data member "theOutputInfoInFeetFlag".
+    */
+   void setOutputFeetFlag (bool flag);
+
+   /**
+    *  Returns the data member "theOutputInfoInFeetFlag".
+    *  True = feet, false = meters.
+    */
+   bool unitsInFeet() const;
+
+   /**
+    * Returns theImageInfoString.
+    */
+   ossimString getImageInfoString () const;
+
+   /**
+    *  Used to set data member "theImageInfoString".  This will be output
+    *  in the "Image: " field of the README file.
+    */
+   void setImageInfoString (const ossimString& string);
+
+   /**
+    * Returns reference to "theProjection".
+    */
+   const ossimMapProjection* getProjection() const;
+
+   //****
+   // Keywords for getStateFrom/saveStateTo.
+   //***
+   static const char* README_IMAGE_STRING_KW;
+   static const char* PIXEL_TYPE_KW;
+   static const char* OUTPUT_US_FT_INFO_KW;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+   
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0) const;
+   
+private:
+
+   // Do not permit construction with void args.
+   ossimMapProjectionInfo();
+   ossimMapProjectionInfo& operator=(const ossimMapProjectionInfo&);
+   
+   void initializeMembers(const ossimDrect& output_rect);
+   
+   const ossimMapProjection* theProjection;
+   mutable bool              theErrorStatus;
+   int                       theLinesPerImage;
+   int                       thePixelsPerLine;
+   ossimGpt                  theCornerGroundPt[4];
+   ossimDpt                  theCornerEastingNorthingPt[4];
+   ossimGpt                  theCenterGroundPt;
+   ossimDpt                  theCenterEastingNorthingPt;
+   ossimDrect                theBoundingRect;
+   
+   /**
+    *   "thePixelType" defines whether the tie point coordinates are
+    *   relative to the center of the pixel(which is PIXEL_IS_POINT) or
+    *   the upper left corner of the pixel(PIXEL_IS_AREA).  The default
+    *   pixle type is PIXEL_IS_POINT.
+    */
+   ossimPixelType                 thePixelType;
+
+   /**
+    *   If "theOutputInfoInFeetFlag" is true the readme file tie point
+    *   info will be output in both meters and U.S. feet.
+    *   NOTE:
+    *   U.S. feet conversion is "meters/0.3048006096" not the standard
+    *   "meters/0.3048".
+    *   Reference for U.S. feet value:
+    *   U.S.G.S. "Map Projections - A Working Manual" USGS Professional
+    *   paper 1395 page 51.
+    */
+   bool                      theOutputInfoInFeetFlag;
+
+   /**
+    *   "theImageInfoString" goes in the README file "Image:" field
+    *   to identify the image.
+    */
+   ossimString               theImageInfoString;
+};
+
+#endif /* End of #ifndef ossimMapProjectionInfo_HEADER */
diff --git a/ossim/include/ossim/projection/ossimMapViewController.h b/include/ossim/projection/ossimMapViewController.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimMapViewController.h
rename to include/ossim/projection/ossimMapViewController.h
diff --git a/include/ossim/projection/ossimMeanRadialLensDistortion.h b/include/ossim/projection/ossimMeanRadialLensDistortion.h
new file mode 100644
index 0000000..46449c6
--- /dev/null
+++ b/include/ossim/projection/ossimMeanRadialLensDistortion.h
@@ -0,0 +1,119 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// LGPL
+// 
+// Author:  Garrett Potts (gpotts at imagelinks.com)
+//
+// Description:
+//
+// MeanRadialLensDistortion
+//*******************************************************************
+//  $Id: ossimMeanRadialLensDistortion.h 15929 2009-11-16 18:20:46Z gpotts $
+#ifndef ossimMeanRadialLensDistortion_HEADER
+#define ossimMeanRadialLensDistortion_HEADER
+#include <vector>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/projection/ossimLensDistortion.h>
+class ossimMeanRadialLensDistortion : public ossimLensDistortion
+{
+public:
+   ossimMeanRadialLensDistortion()
+   {
+      theCoefficients.resize(4);
+      theCoefficients[0] = 0.0;
+      theCoefficients[1] = 0.0;
+      theCoefficients[2] = 0.0;
+      theCoefficients[3] = 0.0;
+   }
+
+  /*!
+   * Instantiate a ossimMeanRadialLens with the calibrated data.
+   * The data consists of the Principal point,
+   * focal distance, radialDistance measures for the distortion
+   * deltas, the radial distortion values.
+   * 
+   * example of construction:
+   *
+   * lets say we have the following:
+   *
+   * principal point = (.008 , -.001) mm
+   *
+   * and
+   *
+   * field angle       radial distance       deltaR (distortion)
+   *_____________________________________________________________
+   *  7.5 deg.             .004 mm             .0202 mm
+   *  15 deg.              .007 mm             .0411 mm
+   *  22.5 deg.            .007 mm             .0635 mm
+   *  :
+   *  :
+   *  :
+   *
+   * then construct the ossimMeanRadialLensDistortion class to construct the
+   * given focal length and principal point and the middle column as
+   * the radial distance column vector and the third column as the
+   * distortion values.
+   */
+/*    ossimMeanRadialLensDistortion(ossimDpt    calibratedPrincipalPoint, */
+/*                                  const NEWMAT::ColumnVector &radialDistance, */
+/*                                  const NEWMAT::ColumnVector &radialDistortion) */
+   ossimMeanRadialLensDistortion(ossimDpt    calibratedPrincipalPoint,
+                                 const NEWMAT::ColumnVector &radialDistance,
+                                 const NEWMAT::ColumnVector &radialDistortion)
+      :ossimLensDistortion(calibratedPrincipalPoint)
+  {
+     theCoefficients.resize(4);
+     solveCoefficients(radialDistance, radialDistortion);
+  }
+      
+  /*!
+   * Returns the coefficients (k1, k2, k3, k4) for the deltaR polynomial:
+   *
+   *    deltaR = k1*r + k2*r^3 + k3*r^5 + k4*r^7
+   */
+  const std::vector<double>& getCoefficients()const{return theCoefficients;}
+  std::vector<double>& getCoefficients(){return theCoefficients;}
+
+
+//  ossimDpt adjustPoint(const ossimDpt &position)const;
+  virtual std::ostream& print(std::ostream& out) const
+  {return out;}
+
+  /*!
+   * dletaR computes how much we should adjust r.  The
+   * return value is the adjustment amount.  This method is used
+   * by adjustPoint.
+   */
+  double deltaR(double r)const;
+
+  virtual void undistort(const ossimDpt& input, ossimDpt& output)const;
+  
+  /*!
+   * solves the coefficients given the radial distances and distortion
+   * for each distance.
+   */
+  void solveCoefficients(const NEWMAT::ColumnVector &radialDistance,
+			 const NEWMAT::ColumnVector &radialDistortion);
+  /*!
+   * solves the coefficients given the radial distances and distortion
+   * for each distance.
+   */
+  void solveCoefficients(const std::vector<double>& radialDistance,
+			 const std::vector<double>& radialDistortion);
+  
+  virtual bool saveState(ossimKeywordlist& kwl,
+                         const char* prefix = 0)const;
+  
+  virtual bool loadState(const ossimKeywordlist& kwl,
+                         const char* prefix = 0);
+  
+protected:
+  std::vector<double> theCoefficients;
+  
+TYPE_DATA  
+};
+
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimMercatorProjection.h b/include/ossim/projection/ossimMercatorProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimMercatorProjection.h
rename to include/ossim/projection/ossimMercatorProjection.h
diff --git a/ossim/include/ossim/projection/ossimMgrs.h b/include/ossim/projection/ossimMgrs.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimMgrs.h
rename to include/ossim/projection/ossimMgrs.h
diff --git a/ossim/include/ossim/projection/ossimMillerProjection.h b/include/ossim/projection/ossimMillerProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimMillerProjection.h
rename to include/ossim/projection/ossimMillerProjection.h
diff --git a/ossim/include/ossim/projection/ossimMiscProjectionFactory.h b/include/ossim/projection/ossimMiscProjectionFactory.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimMiscProjectionFactory.h
rename to include/ossim/projection/ossimMiscProjectionFactory.h
diff --git a/ossim/include/ossim/projection/ossimMollweidProjection.h b/include/ossim/projection/ossimMollweidProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimMollweidProjection.h
rename to include/ossim/projection/ossimMollweidProjection.h
diff --git a/ossim/include/ossim/projection/ossimNewZealandMapGridProjection.h b/include/ossim/projection/ossimNewZealandMapGridProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimNewZealandMapGridProjection.h
rename to include/ossim/projection/ossimNewZealandMapGridProjection.h
diff --git a/include/ossim/projection/ossimNgaProjectionFactory.h b/include/ossim/projection/ossimNgaProjectionFactory.h
new file mode 100644
index 0000000..9f3db5a
--- /dev/null
+++ b/include/ossim/projection/ossimNgaProjectionFactory.h
@@ -0,0 +1,65 @@
+//*******************************************************************
+// Copyright (C) 2014 RadiantBlue, Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+//*******************************************************************
+//  $Id$
+#ifndef ossimNgaProjectionFactory_HEADER
+#define ossimNgaProjectionFactory_HEADER
+
+#include <ossim/projection/ossimProjectionFactoryBase.h>
+
+class OSSIM_DLL ossimNgaProjectionFactory : public ossimProjectionFactoryBase
+{
+public:
+   
+   static ossimNgaProjectionFactory* instance();
+
+   /**
+    * takes a filename. This filename can be an image file or
+    * it can also be a ossim .geom file.  It could be other
+    * forms of geom files as well.  The factories job will be to
+    * determine what parser to use and return a projection if
+    * successful.
+    */
+   virtual ossimProjection* createProjection(const ossimFilename& filename,
+                                             ossim_uint32 entryIdx)const;
+
+   /**
+    * Take a projection type name.
+    */
+   virtual ossimProjection* createProjection(const ossimString& name)const;
+
+   /**
+    * Take a keywordlist.
+    */
+   virtual ossimProjection* createProjection(const ossimKeywordlist& kwl,
+                                             const char* prefix)const;
+   
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+
+   /*!
+    * Creates and object given a keyword list.
+    */
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
+                                     const char* prefix=0) const;
+
+   /*!
+     * This should return the type name of all objects in all factories.
+     * This is the name used to construct the objects dynamially and this
+     * name must be unique.
+     */
+    virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
+
+protected:
+    //! Constructor loads all SRS CSV files specified in the ossim prefs. Protected as part of
+    //! singleton implementation.
+    ossimNgaProjectionFactory() {}
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimNitfMapModel.h b/include/ossim/projection/ossimNitfMapModel.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimNitfMapModel.h
rename to include/ossim/projection/ossimNitfMapModel.h
diff --git a/ossim/include/ossim/projection/ossimNitfProjectionFactory.h b/include/ossim/projection/ossimNitfProjectionFactory.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimNitfProjectionFactory.h
rename to include/ossim/projection/ossimNitfProjectionFactory.h
diff --git a/include/ossim/projection/ossimNitfRpcModel.h b/include/ossim/projection/ossimNitfRpcModel.h
new file mode 100644
index 0000000..9f6ed16
--- /dev/null
+++ b/include/ossim/projection/ossimNitfRpcModel.h
@@ -0,0 +1,115 @@
+//*****************************************************************************
+// FILE: ossimNitfRpcModel.h
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains declaration of class ossimNitfRpcModel. This 
+//    derived class implements the capability of reading Nitf RPC support
+//    data.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimNitfRpcModel.h 15766 2009-10-20 12:37:09Z gpotts $
+
+#ifndef ossimNitfRpcModel_HEADER
+#define ossimNitfRpcModel_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/projection/ossimRpcModel.h>
+
+class ossimFilename;
+class ossimNitfImageHeader;
+
+/*!****************************************************************************
+ *
+ * CLASS:  ossimNitfRpcModel
+ *
+ *****************************************************************************/
+class OSSIM_DLL ossimNitfRpcModel : public ossimRpcModel
+{
+public:
+   ossimNitfRpcModel();
+   ossimNitfRpcModel(const ossimNitfRpcModel& rhs);
+   ossimNitfRpcModel(const ossimFilename& nitfFile);
+   virtual ossimObject* dup() const;
+
+   /**
+    * @brief worldToLineSample()
+    * Calls ossimRpcModel::worldToLineSample(), then applies (if needed)
+    * decimation.
+    * This is a temp work around for decimation RPC NITFs.
+    */
+   virtual void  worldToLineSample(const ossimGpt& world_point,
+                                   ossimDpt&       image_point) const;
+
+   /**
+    * @brief lineSampleHeightToWorld()
+    * Backs out decimation of image_point (if needed) then calls:
+    * ossimRpcModel::lineSampleHeightToWorld
+    * This is a temp work around for decimation RPC NITFs.
+    */
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPoint) const;
+
+   /**
+    * @brief Saves "decimation".  Then calls ossimRpcModel::saveState.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+
+   /**
+    * @brief Looks for decimation. Then calls ossimRpcModel::loadState.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * @brief Method to parse an nitf file and initialize model.
+    * @param entryIndex The entry to get model for.  Note the nitf's can have
+    * multiple entries; each with a different projection.
+    * @return true on success, false on error.
+    */
+   virtual bool parseFile(const ossimFilename& nitfFile,
+                          ossim_uint32 entryIndex=0);
+   
+   virtual bool parseImageHeader(const ossimNitfImageHeader* ih);
+private:
+
+   /**
+    * Attempts to get gsd from nitf tags and initialize
+    * ossimSensorModel::theGsd.
+    * 
+    * If unsuccessful  theGsd will be initialized to OSSIM_DBL_NAN.
+    */
+   void getGsd(const ossimNitfImageHeader* ih);
+
+   /**
+    * Attempts to get sensor ID from nitf tags and initialize
+    * ossimSensorModel::theSensorID.
+    * 
+    * If unsuccessful  theGsd will be initialized to UNKNOWN.
+    */
+   void getSensorID(const ossimNitfImageHeader* ih);
+
+   /**
+    * Get model information from either the RPC00A or RPC00B tag.
+    * @return true on success, false on error.
+    */
+   bool getRpcData(const ossimNitfImageHeader* ih);
+
+   /**
+    * Stored from header field "IMAG".  This is a temp work around to handle
+    * decimated rpc nitf's.
+    */
+   ossim_float64 theDecimation;
+
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/projection/ossimNitfRsmModel.h b/include/ossim/projection/ossimNitfRsmModel.h
new file mode 100644
index 0000000..aed6e74
--- /dev/null
+++ b/include/ossim/projection/ossimNitfRsmModel.h
@@ -0,0 +1,74 @@
+//---
+// File: ossimNitfRsmModel.h
+//---
+#ifndef ossimNitfRsmModel_HEADER
+#define ossimNitfRsmModel_HEADER 1
+
+#include <ossim/projection/ossimRsmModel.h>
+
+class ossimNitfImageHeader;
+class ossimNitfRsmecaTag;
+class ossimNitfRsmidaTag;
+class ossimNitfRsmpcaTag;
+class ossimNitfRsmpiaTag;
+
+/**
+ * @class ossimNitfRsmModel
+ */
+class OSSIM_DLL ossimNitfRsmModel : public ossimRsmModel
+{
+public:
+
+   /** @brief default constructor */
+   ossimNitfRsmModel();
+
+   /** @brief copy constructor */
+   ossimNitfRsmModel( const ossimNitfRsmModel& obj );
+
+   /** @brief assignment operator */
+   const ossimNitfRsmModel& operator=( const ossimNitfRsmModel& rhs );
+
+   virtual bool parseFile(const ossimFilename& nitfFile,
+                          ossim_uint32 entryIndex=0);
+
+   virtual bool parseImageHeader(const ossimNitfImageHeader* ih);
+
+   bool getRsmData(const ossimNitfImageHeader* ih);
+
+   /**
+    * @brief saveState
+    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+    * KWL files. Returns true if successful.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   /**
+    * @brief loadState
+    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+    * KWL files. Returns true if successful.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * @brief dup()
+    * Returns pointer to a new instance, copy of this.
+    */
+   virtual ossimObject* dup() const;
+
+   /**
+    * @brief Initializes model from RSMECA tag.
+    * @param rsmecaTag
+    */
+   bool initializeModel( const ossimNitfRsmecaTag* rsmecaTag );
+
+protected:
+   /** @brief virtual destructor */
+   virtual ~ossimNitfRsmModel();
+
+   TYPE_DATA
+      
+}; // End: class ossimRsmModel
+
+#endif /* #ifndef ossimNitfRsmModel_HEADER */
diff --git a/ossim/include/ossim/projection/ossimObliqueMercatorProjection.h b/include/ossim/projection/ossimObliqueMercatorProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimObliqueMercatorProjection.h
rename to include/ossim/projection/ossimObliqueMercatorProjection.h
diff --git a/ossim/include/ossim/projection/ossimOptimizableProjection.h b/include/ossim/projection/ossimOptimizableProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimOptimizableProjection.h
rename to include/ossim/projection/ossimOptimizableProjection.h
diff --git a/ossim/include/ossim/projection/ossimOrthoGraphicProjection.h b/include/ossim/projection/ossimOrthoGraphicProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimOrthoGraphicProjection.h
rename to include/ossim/projection/ossimOrthoGraphicProjection.h
diff --git a/ossim/include/ossim/projection/ossimPolarStereoProjection.h b/include/ossim/projection/ossimPolarStereoProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimPolarStereoProjection.h
rename to include/ossim/projection/ossimPolarStereoProjection.h
diff --git a/ossim/include/ossim/projection/ossimPolarst.h b/include/ossim/projection/ossimPolarst.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimPolarst.h
rename to include/ossim/projection/ossimPolarst.h
diff --git a/ossim/include/ossim/projection/ossimPolyconicProjection.h b/include/ossim/projection/ossimPolyconicProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimPolyconicProjection.h
rename to include/ossim/projection/ossimPolyconicProjection.h
diff --git a/ossim/include/ossim/projection/ossimPolynomProjection.h b/include/ossim/projection/ossimPolynomProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimPolynomProjection.h
rename to include/ossim/projection/ossimPolynomProjection.h
diff --git a/ossim/include/ossim/projection/ossimPositionQualityEvaluator.h b/include/ossim/projection/ossimPositionQualityEvaluator.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimPositionQualityEvaluator.h
rename to include/ossim/projection/ossimPositionQualityEvaluator.h
diff --git a/ossim/include/ossim/projection/ossimPpjFrameSensor.h b/include/ossim/projection/ossimPpjFrameSensor.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimPpjFrameSensor.h
rename to include/ossim/projection/ossimPpjFrameSensor.h
diff --git a/ossim/include/ossim/projection/ossimProjection.h b/include/ossim/projection/ossimProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimProjection.h
rename to include/ossim/projection/ossimProjection.h
diff --git a/ossim/include/ossim/projection/ossimProjectionFactoryBase.h b/include/ossim/projection/ossimProjectionFactoryBase.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimProjectionFactoryBase.h
rename to include/ossim/projection/ossimProjectionFactoryBase.h
diff --git a/ossim/include/ossim/projection/ossimProjectionFactoryRegistry.h b/include/ossim/projection/ossimProjectionFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimProjectionFactoryRegistry.h
rename to include/ossim/projection/ossimProjectionFactoryRegistry.h
diff --git a/ossim/include/ossim/projection/ossimProjectionViewControllerFactory.h b/include/ossim/projection/ossimProjectionViewControllerFactory.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimProjectionViewControllerFactory.h
rename to include/ossim/projection/ossimProjectionViewControllerFactory.h
diff --git a/ossim/include/ossim/projection/ossimQuadProjection.h b/include/ossim/projection/ossimQuadProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimQuadProjection.h
rename to include/ossim/projection/ossimQuadProjection.h
diff --git a/include/ossim/projection/ossimQuickbirdRpcModel.h b/include/ossim/projection/ossimQuickbirdRpcModel.h
new file mode 100644
index 0000000..736e346
--- /dev/null
+++ b/include/ossim/projection/ossimQuickbirdRpcModel.h
@@ -0,0 +1,85 @@
+//*****************************************************************************
+// FILE: ossimQuickbirdRpcModel.h
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// DESCRIPTION: Contains declaration of class ossimQuickbirdRpcModel. This 
+//    derived class implements the capability of reading Quickbird RPC support
+//    data.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimQuickbirdRpcModel.h 20606 2012-02-24 12:29:52Z gpotts $
+#ifndef ossimQuickbirdRpcModel_HEADER
+#define ossimQuickbirdRpcModel_HEADER
+
+#include <ossim/projection/ossimRpcModel.h>
+#include <ossim/support_data/ossimQuickbirdMetaData.h>
+
+class ossimFilename;
+class ossimQuickbirdMetaData;
+class ossimQbTileFilesHandler;
+
+/*!****************************************************************************
+ *
+ * CLASS:  ossimQuickbirdRpcModel
+ *
+ *****************************************************************************/
+class ossimQuickbirdRpcModel : public ossimRpcModel
+{
+public:
+   ossimQuickbirdRpcModel();
+   ossimQuickbirdRpcModel(const ossimQuickbirdRpcModel& rhs);
+
+   //! Initializes
+   ossimQuickbirdRpcModel(const ossimQbTileFilesHandler* handler);
+   ~ossimQuickbirdRpcModel();
+
+   virtual ossimObject* dup() const;
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual bool parseFile(const ossimFilename& file);
+   
+   void setSupportData(ossimQuickbirdMetaData* supportData)
+   {
+      theSupportData = supportData;
+   }
+   ossimQuickbirdMetaData* getSupportData()
+   {
+      return theSupportData.get();
+   }
+   const ossimQuickbirdMetaData* getSupportData()const
+   {
+      return theSupportData.get();
+   }
+protected:
+   bool parseNitfFile(const ossimFilename& file);
+   bool parseTiffFile(const ossimFilename& file);
+   bool parseMetaData(const ossimFilename& file);
+   bool parseRpcData (const ossimFilename& file);
+   bool parseTileData(const ossimFilename& file);
+
+   //! Given an initial filename with case-agnostic extension, this method searches first for an
+   //! image-specific instance of that file (i.e., with _R*C* in the filename) before considering
+   //! the mosaic-global support file (_R*C* removed). If a file is found, the argument is modified 
+   //! to match the actual filename and TRUE is returned. Otherwise, argument filename is left 
+   //! unchanged and FALSE is returned.
+   bool findSupportFile(ossimFilename& file) const;
+
+void finishConstruction();
+
+   ossimRefPtr<ossimQuickbirdMetaData> theSupportData;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimRS1SarModel.h b/include/ossim/projection/ossimRS1SarModel.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimRS1SarModel.h
rename to include/ossim/projection/ossimRS1SarModel.h
diff --git a/ossim/include/ossim/projection/ossimRadialDecentLensDistortion.h b/include/ossim/projection/ossimRadialDecentLensDistortion.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimRadialDecentLensDistortion.h
rename to include/ossim/projection/ossimRadialDecentLensDistortion.h
diff --git a/ossim/include/ossim/projection/ossimRpcModel.h b/include/ossim/projection/ossimRpcModel.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimRpcModel.h
rename to include/ossim/projection/ossimRpcModel.h
diff --git a/include/ossim/projection/ossimRpcProjection.h b/include/ossim/projection/ossimRpcProjection.h
new file mode 100644
index 0000000..4e32397
--- /dev/null
+++ b/include/ossim/projection/ossimRpcProjection.h
@@ -0,0 +1,238 @@
+//*****************************************************************************
+// FILE: ossimRpcProjection.h
+//
+// LGPL
+//
+// DESCRIPTION: Contains declaration of class ossimRpcProjection.
+//   This is a replacement model utilizing the Rational Polynomial Coefficients
+//   (RPC), a.k.a. Rapid Positioning Capability, and Universal Sensor Model
+//   (USM).
+//
+//*****************************************************************************
+//  $Id: ossimRpcProjection.h 11805 2007-10-05 14:54:28Z dburken $
+
+#ifndef ossimRpcProjection_HEADER
+#define ossimRpcProjection_HEADER
+
+#include <ossim/projection/ossimOptimizableProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/base/ossimAdjustableParameterInterface.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/matrix/newmat.h>
+
+/*!****************************************************************************
+ *
+ * CLASS:  ossimRpcProjection
+ *
+ *****************************************************************************/
+class OSSIM_DLL ossimRpcProjection : public ossimProjection,
+                                     public ossimOptimizableProjection,
+                                     public ossimAdjustableParameterInterface
+{
+public:
+   //***
+   // Enumeration of supported RPC polynomial formats:
+   //***
+   enum PolynomialType
+   {
+      A='A',  // corresponds to "RPC00A"
+      B='B'   // corresponds to "RPC00B"
+   };
+   
+   /*!
+    * CONSTRUCTORS:
+    */
+   ossimRpcProjection();
+   ossimRpcProjection(const ossimRpcProjection& copy_this);
+   ~ossimRpcProjection();
+
+   ossimRpcProjection& operator=(const ossimRpcProjection& source);
+
+   void initAdjustableParameters();
+   virtual void adjustableParametersChanged();
+   
+   virtual ossimObject* getBaseObject();
+   virtual const ossimObject* getBaseObject()const;
+   
+   void setAttributes(ossim_float64 theSampleOffset,
+                      ossim_float64 theLineOffset,
+                      ossim_float64 theSampleScale,
+                      ossim_float64 theLineScale,
+                      ossim_float64 theLatOffset,
+                      ossim_float64 theLonOffset,
+                      ossim_float64 theHeightOffset,
+                      ossim_float64 theLatScale,
+                      ossim_float64 theLonScale,
+                      ossim_float64 theHeightScale,
+                      const std::vector<double>& xNumeratorCoeffs,
+                      const std::vector<double>& xDenominatorCoeffs,
+                      const std::vector<double>& yNumeratorCoeffs,
+                      const std::vector<double>& yDenominatorCoeffs,
+                      PolynomialType polyType = B);
+                      
+   /*!
+    * METHOD: worldToLineSample()
+    * Overrides base class implementation. Directly computes line-sample from
+    * the polynomials.
+    */
+   virtual void  worldToLineSample(const ossimGpt& world_point,
+                                   ossimDpt&       image_point) const;
+   /*!
+    * METHOD: print()
+    * Extends base-class implementation. Dumps contents of object to ostream.
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /*!
+    * METHODS:  saveState, loadState
+    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+    * KWL files. Returns true if successful.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual void  lineSampleToWorld(const ossimDpt& image_point,
+                                   ossimGpt&       world_point) const;
+   //***
+   // METHOD: lineSampleHeightToWorld()
+   // Overrides base class pure virtual. Height understood to be relative to
+   // standard ellipsoid.
+   //***
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPoint) const;
+
+   /*!
+    * METHOD: dup()
+    * Returns pointer to a new instance, copy of this.
+    */
+   virtual ossimObject* dup() const { return new ossimRpcProjection(*this); }
+
+   virtual ossimGpt origin()const;
+   virtual ossimDpt getMetersPerPixel() const;
+   virtual bool operator==(const ossimProjection& projection) const;
+   
+   /*
+    * optimizable interface
+    */
+    virtual bool setupOptimizer(const ossimString& setup);
+    inline virtual bool useForward()const {return true;}
+    virtual ossim_uint32 degreesOfFreedom()const;
+    virtual double optimizeFit(const ossimTieGptSet& tieSet, double* targetVariance=NULL);
+   /*!
+    * METHOD: getForwardDeriv()
+    * gives forward() partial derivative regarding parameter parmIdx (>=0)
+    * default implementation is centered finite difference
+    * -should be reimplemented with formal derivative in child class
+    */
+   virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta=1e-11);
+
+   /*!
+    * METHOD: getInverseDeriv()
+    * gives inverse() partial derivative regarding parameter parmIdx (>=0)
+    * default implementation is centered finite difference
+    * -should be reimplemented with formal derivative in child class
+    */
+   virtual ossimGpt getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta=1e-11);
+
+   /**
+    * @brief Implementation of pure virtual
+    * ossimProjection::isAffectedByElevation method.
+    * @return true.
+    */
+   virtual bool isAffectedByElevation() const { return true; }
+
+protected:
+   //***
+   // Methods for computing RPC polynomial and its derivatives:
+   //***
+   double polynomial(const double& nlat,
+                     const double& nlon,
+                     const double& nhgt,
+                     const double* coeffs) const;
+   double dPoly_dLat(const double& nlat,
+                     const double& nlon,
+                     const double& nhgt,
+                     const double* coeffs) const;
+   double dPoly_dLon(const double& nlat,
+                     const double& nlon,
+                     const double& nhgt,
+                     const double* coeffs) const;
+   
+   /*!
+    * METHOD: buildNormalEquation
+    * builds linearized system  (LMS equivalent)
+    * A*dp = projResidue
+    * 
+    * A: symetric matrix = tJ*J
+    * dp: system parameter shift that we want to estimate
+    * projResidue = tJ * residue
+    *
+    * t: transposition operator
+    * J = jacobian of transform relative to parameters p, transform can be forward() or inverse()
+    * jacobian is obtained via finite differences
+    * residue can be image (2D) or ground residue(3D)
+    *
+    * TODO: use image/ground points covariance matrices
+    */
+   void buildNormalEquation(const ossimTieGptSet& tieSet,
+                                      NEWMAT::SymmetricMatrix& A,
+                                      NEWMAT::ColumnVector& residue,
+                                      NEWMAT::ColumnVector& projResidue,
+                                      double pstep_scale);
+
+   /*!
+    * METHOD: getResidue()
+    * returns ground opr image residue
+    */
+   NEWMAT::ColumnVector getResidue(const ossimTieGptSet& tieSet);
+
+   NEWMAT::ColumnVector solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const;
+
+   /*!
+    * stable invert stolen from ossimRpcSolver
+    */
+   NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
+
+   PolynomialType thePolyType;
+   //***
+   // Quantities for zero-biasing and normalizing the image point and
+   // ground point coordinates referenced in the polynomials:
+   //***
+   double theLineScale;
+   double theSampScale;
+   double theLatScale;
+   double theLonScale;
+   double theHgtScale;
+   double theLineOffset;
+   double theSampOffset;
+   double theLatOffset;
+   double theLonOffset;
+   double theHgtOffset;
+
+   //***
+   // Coefficients:
+   //***
+   double theLineNumCoef[20];
+   double theLineDenCoef[20];
+   double theSampNumCoef[20];
+   double theSampDenCoef[20];
+
+   //*
+   // Quantities derived from the adjustable parameters:
+   //*
+   double theIntrackOffset;
+   double theCrtrackOffset;
+   double theIntrackScale;
+   double theCrtrackScale;
+   double theYawSkew;  // = sin(theYawOffset)
+   double theCosMapRot;
+   double theSinMapRot;
+   
+   TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/projection/ossimRpcSolver.h b/include/ossim/projection/ossimRpcSolver.h
new file mode 100644
index 0000000..2a281f3
--- /dev/null
+++ b/include/ossim/projection/ossimRpcSolver.h
@@ -0,0 +1,243 @@
+//*****************************************************************************
+// FILE: ossimRpcModel.h
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Garrett Potts
+//
+//*****************************************************************************
+//  $Id: ossimRpcSolver.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimRpcSolver_HEADER
+#define ossimRpcSolver_HEADER
+
+#include <vector>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/projection/ossimRpcModel.h>
+#include <ossim/projection/ossimRpcProjection.h>
+
+class ossimProjection;
+class ossimImageGeometry;
+class ossimNitfRegisteredTag;
+
+/**
+ * This currently only support Rational poilynomial B format.  This can be
+ * found in the NITF registered commercial tag document.
+ *
+ * @note x=longitude, y=latitude, z=height
+ * 
+ * <pre>
+ * Format is:
+ *  coeff[ 0]       + coeff[ 1]*x     + coeff[ 2]*y     + coeff[ 3]*z     +
+ *  coeff[ 4]*x*y   + coeff[ 5]*x*z   + coeff[ 6]*y*z   + coeff[ 7]*x*x   +
+ *  coeff[ 8]*y*y   + coeff[ 9]*z*z   + coeff[10]*x*y*z + coeff[11]*x*x*x +
+ *  coeff[12]*x*y*y + coeff[13]*x*z*z + coeff[14]*x*x*y + coeff[15]*y*y*y +
+ *  coeff[16]*y*z*z + coeff[17]*x*x*z + coeff[18]*y*y*z + coeff[19]*z*z*z;
+ *
+ *       where coeff is one of XNum, XDen, YNum, and YDen.  So there are 80
+ *       coefficients all together.
+ *
+ *       
+ * Currently we use a linear least squares fit to solve the coefficients.
+ * This is the simplest to implement.  We probably relly need a nonlinear
+ * minimizer to fit the coefficients but I don't have time to experiment.
+ * Levenberg Marquardt might be a solution to look into.
+ *
+ *
+ * 
+ * HOW TO USE:
+ * 
+ *        ossimRpcSolver solver;
+ *        solver.solveCoefficients(rect,
+ *                                 *proj.get());
+ *                                 
+ * We can also call solve coefficients with a list of ground control points.
+ * First is the list of image points followed by the ground points.
+ * NOTE: Thes must be equal in size.
+ * 
+ *        solver.solveCoefficients(imagePoints,
+ *                                 groundPoints);
+ *                                 
+ *                                 
+ * Once you call solveCoefficients you can create the projector:
+ *                                 
+ *        ossimRefPtr<ossimRpcProjection> rpc = solver.createRpcProjection();
+ *
+ * </pre>
+ * 
+ */ 
+class OSSIM_DLL ossimRpcSolver : public ossimReferenced
+{
+public:
+   /**
+    * The use elvation flag will deterimne if we force the height t be 0.
+    * If the elevation is enabled then we use the height field of the control
+    * points to determine the coefficients of the RPC00 polynomial.  If its
+    * false then we will ignore the height by setting the height field to 0.0.
+    *
+    * Note:  even if the elevation is enabled all NAN heights are set to 0.0.
+    */
+   ossimRpcSolver(bool useElevation=false,
+                  bool useHeightAboveMSLFlag=false);
+
+   
+   /**
+    * This will convert any projector to an RPC model
+    */
+   void solveCoefficients(const ossimDrect& imageBouunds,
+                          ossimProjection* imageProj,
+                          ossim_uint32 xSamples=8,
+                          ossim_uint32 ySamples=8,
+                          bool shiftTo0Flag=true);
+   
+   void solveCoefficients(const ossimDrect& imageBouunds,
+                          ossimImageGeometry* geom,
+                          ossim_uint32 xSamples=8,
+                          ossim_uint32 ySamples=8,
+                          bool shiftTo0Flag=true);
+   
+   /**
+    * takes associated image points and ground points
+    * and solves the coefficents for the rational polynomial for
+    * line and sample calculations from world points.
+    *
+    * Note: All data will be normalized between -1 and 1 for
+    *       numerical robustness.
+    */ 
+   void solveCoefficients(const std::vector<ossimDpt>& imagePoints,
+                          const std::vector<ossimGpt>& groundControlPoints,
+                          const ossimDpt& imageShift = ossimDpt(0.0,0.0));
+
+   /**
+    * Creates and Rpc model from the coefficients
+    */
+   ossimImageGeometry* createRpcModel()const;
+
+   /**
+    * Create a simple rpc projection which is a dumbed down
+    * rpc model.
+    */
+   ossimImageGeometry* createRpcProjection()const;
+
+
+   /**
+    * Gives access to the solved coefficients.  For the image
+    * X numerator
+    */
+   const std::vector<double>& getImageXNumCoefficients()const;
+
+   /**
+    * Gives access to the solved coefficients.  For the image
+    * X denominator
+    */
+   const std::vector<double>& getImageXDenCoefficients()const;
+
+   /**
+    * Gives access to the solved coefficients.  For the image
+    * Y numerator
+    */
+   const std::vector<double>& getImageYNumCoefficients()const;
+
+   /**
+    * Gives access to the solved coefficients. For the image
+    * Y denominator
+    */
+   const std::vector<double>& getImageYDenCoefficients()const;
+
+   
+   double getImageXOffset()const;
+   double getImageYOffset()const;
+   double getLatOffset()const;
+   double getLonOffset()const;
+   double getHeightOffset()const;
+   double getImageXScale()const;
+   double getImageYScale()const;
+   double getLatScale()const;
+   double getLonScale()const;
+   double getHeightScale()const;
+
+   double getRmsError()const;
+
+   /**
+    * @return ossimRefPtr<ossimNitfRegisteredTag>
+    *
+    * @note one of the solve methods should have been called prior to this.
+    */
+   ossimRefPtr<ossimNitfRegisteredTag> getNitfRpcBTag() const;
+   
+protected:
+	virtual ~ossimRpcSolver(){}
+   
+   virtual void solveInitialCoefficients(NEWMAT::ColumnVector& coeff,
+                                         const std::vector<double>& f,
+                                         const std::vector<double>& x,
+                                         const std::vector<double>& y,
+                                         const std::vector<double>& z)const;
+                                         
+   virtual void solveCoefficients(NEWMAT::ColumnVector& coeff,
+                                  const std::vector<double>& f,
+                                  const std::vector<double>& x,
+                                  const std::vector<double>& y,
+                                  const std::vector<double>& z)const;
+   
+   double eval(const std::vector<double>& coeff,
+               double x,
+               double y,
+               double z)const;
+
+   /**
+    * Inverts using the SVD method
+    */
+   NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
+   
+   void setupSystemOfEquations(NEWMAT::Matrix& equations,
+                               const NEWMAT::ColumnVector& f,
+                               const std::vector<double>& x,
+                               const std::vector<double>& y,
+                               const std::vector<double>& z)const;
+
+   void setupWeightMatrix(NEWMAT::DiagonalMatrix& result, // holds the resulting weights
+                          const NEWMAT::ColumnVector& coefficients,
+                          const NEWMAT::ColumnVector& f,
+                          const std::vector<double>& x,
+                          const std::vector<double>& y,
+                          const std::vector<double>& z)const;
+
+   bool theUseElevationFlag;
+   bool theHeightAboveMSLFlag;
+   ossimDpt      theImageOffset;
+   ossimGpt      theGroundOffset;
+   ossimDpt      theImageScale;
+   ossim_float64 theLatScale;
+   ossim_float64 theLonScale;
+   ossim_float64 theHeightScale;
+   ossim_float64 theError;
+   /**
+    * there are 20 coefficients in the cubic RPC model
+    */ 
+   std::vector<ossim_float64> theXNumCoeffs;
+
+   /**
+    * there are 20 coefficients in the cubic RPC model
+    */ 
+   std::vector<ossim_float64> theXDenCoeffs;
+
+   /**
+    * there are 20 coefficients in the cubic RPC model
+    */ 
+   std::vector<ossim_float64> theYNumCoeffs;
+
+   /**
+    * there are 20 coefficients in the cubic RPC model
+    */ 
+   std::vector<ossim_float64> theYDenCoeffs;
+   
+};
+
+#endif
diff --git a/include/ossim/projection/ossimRsmModel.h b/include/ossim/projection/ossimRsmModel.h
new file mode 100644
index 0000000..43da43e
--- /dev/null
+++ b/include/ossim/projection/ossimRsmModel.h
@@ -0,0 +1,173 @@
+//---
+// File: ossimRsmModel.h
+//---
+#ifndef ossimRsmModel_H
+#define ossimRsmModel_H 1
+
+#include <ossim/projection/ossimSensorModel.h>
+#include <ossim/support_data/ossimRsmida.h>
+#include <ossim/support_data/ossimRsmpca.h>
+#include <ossim/support_data/ossimRsmpia.h>
+#include <iosfwd>
+#include <vector>
+
+/**
+ * @class ossimRsmModel
+ */
+class OSSIM_DLL ossimRsmModel : public ossimSensorModel
+{
+public:
+
+   /** @brief default constructor */
+   ossimRsmModel();
+
+   /** @brief copy constructor */
+   ossimRsmModel( const ossimRsmModel& obj );
+
+   /** @brief assignment operator */
+   const ossimRsmModel& operator=( const ossimRsmModel& rhs );
+
+   /**
+    * @brief worldToLineSample()
+    * Overrides base class implementation. Directly computes line-sample from
+    * the polynomials.
+    */
+   virtual void  worldToLineSample(const ossimGpt& world_point,
+                                   ossimDpt&       image_point) const;
+ 
+
+   /**
+    * @brief lineSampleToWorld()
+    * Overrides base class pure virtual.  Intersects DEM.
+    */
+   virtual void  lineSampleToWorld(const ossimDpt& image_point,
+                                   ossimGpt&       world_point) const;
+   /**
+    * @brief lineSampleHeightToWorld()
+    * Overrides base class pure virtual. Height understood to be relative to
+    * standard ellipsoid.
+    */
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPoint) const;
+   
+   /**
+    * @brief imagingRay()
+    * Overrides base class pure virtual.
+    */
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+
+   virtual void updateModel();
+   virtual void initAdjustableParameters();
+
+   /**
+    * @brief dup()
+    * Returns pointer to a new instance, copy of this.
+    */
+   virtual ossimObject* dup() const;
+
+   inline virtual bool useForward()const {return false;}
+
+
+   /**
+    * @brief print()
+    * Extends base-class implementation. Dumps contents of object to ostream.
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief saveState
+    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+    * KWL files. Returns true if successful.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   /**
+    * @brief loadState
+    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+    * KWL files. Returns true if successful.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+protected:
+
+   /**
+    * @brief Gets index into RSM Polynomial Coefficients(rsmpca) container
+    * array for a given ground point.
+    *
+    * @param x Longitude in radians.
+    * @param y Latitude, in radians.
+    * @param z Height in meters.
+    * @return Index into m_pca vector.
+    */
+   ossim_uint32 getPcaIndex( const double& x, const double& y, const double& z ) const;
+
+   /**
+    * @brief Gets index into RSM Polynomial Coefficients(rsmpca) container
+    * array for a given image point.
+    *
+    * @note (0,0) in ossim space is (0.5, 0.5) in rsm space.
+    *
+    * @param ipt Image line, sample.
+    * 
+    * @param shiftPoint If true ipt is shifted +0.5 to go from ossim
+    * space(0 is center of pixel) to RSM space(0 is upper left of pixel).
+    * If false point is coming from rsm space and does not need to be shifted.
+    * 
+    * @return Index into m_pca vector.
+    */    
+   ossim_uint32 getPcaIndex( const ossimDpt& ipt, bool shiftPoint ) const;
+
+   /**
+    * @brief Gets index into RSM Polynomial Coefficients(rsmpca) container
+    * array for a given ground point.
+    *
+    * @param x Longitude in radians.
+    * @param y Latitude, in radians.
+    * @param z Height in meters.
+    * @parma ipt Initialized by this.
+    */    
+   void lowOrderPolynomial( const double& x, const double& y, const double& z,
+                            ossimDpt& ipt ) const;
+   
+   double polynomial( const double& x, const double& y, const double& z,
+                      const ossim_uint32& maxx, const ossim_uint32& maxy,
+                      const ossim_uint32& maxz,
+                      std::vector<double> pcf ) const;
+   
+   double dPoly_dLat( const double& x, const double& y, const double& z,
+                      const ossim_uint32& maxx, const ossim_uint32& maxy,
+                      const ossim_uint32& maxz,
+                      std::vector<double> pcf) const;
+   
+   double dPoly_dLon( const double& x, const double& y, const double& z,
+                      const ossim_uint32& maxx, const ossim_uint32& maxy,
+                      const ossim_uint32& maxz,
+                      std::vector<double> pcf ) const;
+   
+   double dPoly_dHgt( const double& x, const double& y, const double& z,
+                      const ossim_uint32& maxx, const ossim_uint32& maxy,
+                      const ossim_uint32& maxz,
+                      std::vector<double> pcf ) const;
+
+   /**
+    * @brief Performs sanity check on key/required rsm data.
+    * @return true on success, false on error.
+    */
+   bool validate() const;
+   
+   /** @brief virtual destructor */
+   virtual ~ossimRsmModel();
+
+   ossimRsmida m_ida;
+   ossimRsmpia m_pia;
+   std::vector<ossimRsmpca> m_pca;
+
+   TYPE_DATA
+      
+}; // End: class ossimRsmModel
+
+#endif /* #ifndef ossimRsmModel_H */
diff --git a/include/ossim/projection/ossimSarModel.h b/include/ossim/projection/ossimSarModel.h
new file mode 100644
index 0000000..d8ed57a
--- /dev/null
+++ b/include/ossim/projection/ossimSarModel.h
@@ -0,0 +1,345 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Base class for Synthetic Aperture Radar model.
+//
+//              This model represents a standard model using relatively
+//              generic support data based on the following references:
+//                [1] Modern Photogrammetry; Mikhail, Bethel, & McGlone;
+//                    Sections 11.7-11.9
+//                [2] The Compendium of Controlled Extensions for NITFS
+//                    21 Mar 2006, paragraph E.3.8, SAR MPDSR
+//
+//----------------------------------------------------------------------------
+// $Id: ossimSarModel.h 15766 2009-10-20 12:37:09Z gpotts $
+#ifndef ossimSarModel_HEADER
+#define ossimSarModel_HEADER
+
+#include <ossim/projection/ossimSensorModel.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimEcefVector.h>
+
+class ossimHgtRef;
+
+
+class OSSIM_DLL ossimSarModel : public ossimSensorModel
+{
+public:
+
+   enum AcquisitionMode
+   {
+      UNKNOWN = 0,
+      SCAN    = 1,
+      SPOT    = 2
+   };
+
+   enum AdjustParamIndex
+   {
+      X_POS = 0,
+      Y_POS,
+      Z_POS,
+      NUM_ADJUSTABLE_PARAMS // not an index
+   };
+
+   /** @brief default constructor */
+   ossimSarModel();
+
+   /**
+    * @brief Method to load or recreate the state of an ossimSarModel from
+    * a keyword list.
+    *
+    * @param kwl    Keyword list to load from.
+    * @param prefix Prefix for keywords, like "image01.".
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   /**
+    * @brief Method to save the state of this object to a keyword list.
+    *
+    * @param kwl    Keyword list to save to.
+    * @param prefix Prefix for keywords, like "image01.".
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   /*!
+    * Writes a template of geom keywords processed by loadState and saveState
+    * to output stream.
+    */
+   static void writeGeomTemplate(ostream& os);
+                          
+                          
+   /*!
+    * Returns pointer to a new instance, copy of this.
+    */
+   virtual ossimObject* dup() const { return 0; } // TBR
+
+   /**
+    * @brief print method.
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+
+   /**
+    * @brief 
+    */
+   virtual void lineSampleToWorld(const ossimDpt& image_point,
+                                  ossimGpt&       world_point) const;
+   virtual void worldToLineSample(const ossimGpt& world_point,
+                                  ossimDpt&       image_point) const;
+   virtual void lineSampleHeightToWorld(const ossimDpt& lineSampPt,
+                                        const double&   heightAboveEllipsoid,
+                                        ossimGpt&       worldPt) const;
+   /**
+    * METHOD: imagingRay(image_point, &ossimEcefRay)
+    *  Given an image point, returns a ray originating at the ARP position
+    *  and pointing towards the target's position in the Output
+    *  Plane.
+    *  This DOES NOT provide the conventional definition for an imaging ray
+    *  because the imaging locus for SAR is not a ray.
+    *
+    *  It DOES provide a radius vector for the range/Doppler circle.
+    */
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+
+   virtual double sensorAzimuth(const ossimDpt& image_point) const;
+   
+   /**
+    * @brief Compute partials of range/Doppler WRT ground point
+    *
+    * @param parmIdx computational mode:
+    *        OBS_INIT, EVALUATE, P_WRT_X, P_WRT_X, P_WRT_X.
+    * @param gpos Current ground point estimate.
+    * @param h Not used.
+    *
+    * @return OBS_INT: n/a, EVALUATE: residuals, P_WRT_X/Y/Z: partials.
+    */
+   virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt& gpos, double h);
+
+   /**
+    * ossimOptimizableProjection
+    */
+   inline virtual bool useForward() const
+   {
+      return false; //!image to ground faster
+   } 
+
+   /**
+    * @brief Compute other parameters & update the model.
+    */
+   virtual void updateModel();
+
+   /*!
+    * METHOD: getObsCovMat()
+    * gives 2X2 covariance matrix of observations
+    */
+   virtual ossimSensorModel::CovMatStatus getObsCovMat(
+      const ossimDpt& ipos, NEWMAT::SymmetricMatrix& Cov);
+   
+protected:
+   /** @brief virtual destructor */
+   virtual ~ossimSarModel();
+   
+   
+   /*!
+    * Assigns initial default values to adjustable parameters and related
+    * members.
+    */
+   void initAdjustableParameters();
+
+   /**
+    * @brief Get ARP time for SPOT mode (constant time).
+    */
+   virtual ossim_float64 getArpTime() const;
+
+   /**
+    * @brief Get ARP time for SCAN mode (varying time).
+    *
+    * @param imgPt The image coordinates.
+    */
+   virtual ossim_float64 getArpTime(const ossimDpt& imgPt) const;
+
+   /**
+    * @brief Get ARP position for SPOT mode (constant time).
+    */
+   virtual ossimEcefPoint  getArpPos() const;
+
+   /**
+    * @brief Get ARP position for SCAN mode (varying time).
+    */
+   virtual ossimEcefPoint  getArpPos(const ossim_float64& time) const;
+
+   /**
+    * @brief Get ARP velocity for SPOT mode (constant time).
+    */
+   virtual ossimEcefVector getArpVel() const;
+
+   /**
+    * @brief Get ARP velocity for SPOT mode (constant time).
+    */
+   virtual ossimEcefVector getArpVel(const ossim_float64& time) const;
+   
+   /**
+    * @brief Method to compute range & Doppler.
+    *
+    * @param pt ECF ground point coordinates.
+    * @param arpPos ECF ARP position.
+    * @param arpVel ECF ARP velocity.
+    * @param range  range.
+    * @param arpVel Doppler.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool computeRangeDoppler(const ossimEcefPoint& pt,
+                                    const ossimEcefPoint& arpPos,
+                                    const ossimEcefVector& arpVel,
+                                    ossim_float64& range,
+                                    ossim_float64& doppler) const;
+
+  /**
+    * @brief Method to compute image coordinates from output plane coordinates.
+    *
+    * @param opPt  ECF output plane position of point.
+    * @param imgPt image position of point.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool computeImageFromOP(const ossimEcefPoint& opPt, ossimDpt& imgPt) const;
+   
+   /**
+    * @brief Method to compute output plane coordinates from image coordinates.
+    *
+    * @param imgPt image position of point.
+    * @param opPt  ECF output plane position of point.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool computeOPfromImage(const ossimDpt& imgPt, ossimEcefPoint& opPt) const;
+   
+   /**
+    * @brief Method to project output plane coordinates to surface.
+    *
+    * @param opPt   ECF output plane point coordinates.
+    * @param range  range.
+    * @param arpVel Doppler.
+    * @param arpPos ECF ARP position.
+    * @param arpVel ECF ARP velocity.
+    * @param hgtRef Height reference defining intersection surface.
+    * @param ellPt  ECF point coordinates.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool projOPtoSurface(const ossimEcefPoint& opPt,
+                                const ossim_float64& range,
+                                const ossim_float64& doppler,
+                                const ossimEcefPoint& arpPos,
+                                const ossimEcefVector& arpVel,
+                                const ossimHgtRef* hgtRef,
+                                ossimEcefPoint& ellPt) const;
+
+   /**
+    * @brief Method to project ellipsoid coordinates to output plane.
+    *
+    * @param ellPt ECF ellipsoid position.
+    * @param opPt  ECF output plane position of point.
+    *
+    * @return true on success, false on error.
+    */
+   virtual bool projEllipsoidToOP(const ossimEcefPoint& ellPt,
+                                  ossimEcefPoint& opPt) const;
+
+
+
+   /**
+    * Returns the acquisition mode as a string.
+    */
+   ossimString getAcquistionModeString() const;
+
+   /**
+    * @brief Sets the acquisition mode from string.
+    *
+    * @param mode The string representing mode.
+    */
+   void setAcquisitionMode(const ossimString& mode);
+
+   /** acquisition mode */
+   AcquisitionMode theAcquisitionMode;
+
+   /** Output/Ground Reference Point (ORP) position */
+   ossimEcefPoint theOrpPosition;
+
+   /** sample (x)/line(y) image coordinates of ORP  */
+   ossimDpt theOrpCenter;
+
+   /** output plane normal */
+   ossimEcefVector theOutputPlaneNormal;
+
+   /** output plane x-axis */
+   ossimEcefVector theOutputPlaneXaxis;
+
+   /** output impulse response */
+   ossim_float64 theOipr;
+
+   /** pixel size */
+   ossim_float64 thePixelSize;
+
+   /** Aperture Reference/Center Point (ARP) time in seconds. */
+   ossim_float64 theArpTime;
+
+   /**
+    * Aperture Reference Point (ARP) Polynomials.
+    * Note: Size is derived dependent.
+    */
+   vector<ossim_float64> theArpXPolCoeff;
+   vector<ossim_float64> theArpYPolCoeff;
+   vector<ossim_float64> theArpZPolCoeff;
+
+   /** Time Coefficients.  Note: Size is derived dependent. */
+   vector<ossim_float64> theTimeCoeff;
+
+   /**
+    * Other computed parameters
+    */
+    
+   /** Pixel spacing */
+   ossim_float64 thePixelSpacing;
+   
+   /** Output/slant plane unit vectors */
+   ossimEcefVector theOPX;
+   ossimEcefVector theOPY;
+   ossimEcefVector theOPZ;
+   
+   
+   /**
+    * Adjustment-related data used and set by getForwardDeriv
+    */
+   /** Observations for current point */
+   ossim_float64   theObsRng;
+   ossim_float64   theObsDop;
+   ossim_float64   theObsTime;
+   ossimEcefPoint  theObsPosition;
+   ossimEcefPoint  theObsOP;
+   ossimEcefPoint  theObsArpPos;
+   ossimEcefVector theObsArpVel;
+   ossimEcefVector theObsArpVel_U;
+   ossim_float64   theObsArpVel_Mag;
+   
+   /** Partials for current point */
+   ossim_float64 theParDopWRTaz;
+
+   /** Adjustable parameters */
+   ossimEcefVector theLsrOffset;      // meters
+
+   TYPE_DATA
+};
+
+#endif /* #ifndef ossimSarModel_HEADER */
diff --git a/include/ossim/projection/ossimSensorModel.h b/include/ossim/projection/ossimSensorModel.h
new file mode 100644
index 0000000..7360f9b
--- /dev/null
+++ b/include/ossim/projection/ossimSensorModel.h
@@ -0,0 +1,393 @@
+//*****************************************************************************
+// FILE: ossimSensorModel.h
+//
+// License:  See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION:
+//   Contains declaration of class ossimSensorModel. This is the base class to
+//   all sensor model-related projections including replacement models such as
+//   coarse grids and polynomial models. This base class supports adjustable
+//   parameters for registration adjustment.
+//
+//   Important note to sensor model implementors: In order to avoid a separate
+//   set of "initial adjustable parameters," this design assumes ALL initial
+//   values are 0. When designing the derived-class model, insure that the
+//   adjustable parameters are 0-based. This applies to theAdjustableParams
+//   array declared in this base class only. The derived classes can declare
+//   their own adjstable params that are more descriptive and that can be
+//   assigned an initial value that is non-zero, but that are linearly related
+//   to the adjustable params of this class. In that case, the updateModel()
+//   method will compute the derived-class's parameters based on
+//   theAdjustableParams array, after an adjustment is made.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimSensorModel.h 23297 2015-05-05 20:32:16Z dburken $
+
+#ifndef ossimSensorModel_HEADER
+#define ossimSensorModel_HEADER 1
+
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <ossim/projection/ossimOptimizableProjection.h>
+#include <ossim/base/ossimEcefRay.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimCommon.h> /* for ossim::nan() */
+#include <ossim/elevation/ossimElevSource.h>
+#include <ossim/base/ossimAdjustableParameterInterface.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/matrix/newmatap.h>
+#include <ossim/base/ossimException.h>
+class ossimKeywordlist;
+class ossimTieGptSet;
+
+/*!****************************************************************************
+ *
+ * CLASS:  ossimSensorModel
+ *
+ *****************************************************************************/
+class OSSIMDLLEXPORT ossimSensorModel : public ossimProjection,
+                                        public ossimOptimizableProjection,
+                                        public ossimAdjustableParameterInterface
+{
+public:
+
+   enum CovMatStatus
+   {
+      COV_INVALID = 0,
+      COV_PARTIAL = 1,
+      COV_FULL    = 2
+   };
+
+   enum DeriveMode
+   {
+      OBS_INIT =-99,
+      EVALUATE =-98,
+      P_WRT_X = -1,
+      P_WRT_Y = -2,
+      P_WRT_Z = -3
+   };
+   
+   /*!
+    * CONSTRUCTORS:
+    */
+   ossimSensorModel();
+   ossimSensorModel(const ossimSensorModel& copy_this);
+   ossimSensorModel(const ossimKeywordlist& geom_kwl);
+
+   /** @brief assignment operator */
+   const ossimSensorModel& operator=( const ossimSensorModel& rhs );
+
+   virtual ossimObject* getBaseObject();
+   virtual const ossimObject* getBaseObject()const;
+   
+   /*!
+    * ACCESS METHODS:
+    */
+   virtual ossimGpt origin()            const {return theRefGndPt; }
+   virtual ossimDpt getMetersPerPixel() const {return ossimDpt(fabs(theGSD.x),
+                                                               fabs(theGSD.y));}
+   
+   //! Returns the estimated Absolute horizontal position error (CE90) of the sensor model.
+   virtual const double& getNominalPosError() const { return theNominalPosError; }
+
+   //! Returns the estimated RELATIVE horizontal position error (CE90) of the sensor model.
+   virtual const double& getRelativePosError() const { return theRelPosError; }
+
+   //! Assigns the absolute image position error uncertainty (abs CE90)
+   virtual void setNominalPosError(const double& ce90) { theNominalPosError = ce90; }
+
+   //! Assigns the relative image position error uncertainty (rel CE90)
+   virtual void setRelativePosError(const double& ce90) { theRelPosError = ce90; }
+
+   /*!
+    * Implementation of base-class pure virtual projection methods. These
+    * methods may be overriden by derived classes if those have more efficient
+    * schemes. The implementations here are iterative (relatively slow). Both
+    * depend on calls to the pure virtual lineSampleHeightToWorld() method.
+    */
+   virtual void  lineSampleToWorld(const ossimDpt& image_point,
+                                   ossimGpt&       world_point) const;
+   virtual void  worldToLineSample(const ossimGpt& world_point,
+                                   ossimDpt&       image_point) const;
+
+   /*!
+    * METHOD: lineSampleHeightToWorld
+    * This is the pure virtual that performs the actual work of projecting
+    * the image point to the given elevation above Ellipsoid. 
+    */
+   virtual void lineSampleHeightToWorld(const ossimDpt& lineSampPt,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPt) const = 0;
+   /*!
+    * METHOD: imagingRay(image_point, &ossimEcefRay)
+    * Given an image point, returns a ray originating at some arbitrarily high
+    * point (ideally at the sensor position) and pointing towards the target.
+    * Implemented here but should be overriden for more efficient solution.
+    */
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+
+   /*!
+    * METHOD: print()
+    * Fulfills base-class pure virtual. Dumps contents of object to ostream.
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief Sets the center line sampe of the image.
+    *
+    * @param pt Image center point (x = sample, y = line).
+    */
+   void setRefImgPt(const ossimDpt& pt);
+
+   /**
+    * @brief Sets the center latitude, longitude, height of the image.
+    *
+    * @param pt Image center point.
+    */
+   void setRefGndPt(const ossimGpt& pt);
+   
+
+   void setImageRect(const ossimDrect& imageRect);
+   void setGroundRect(const ossimGpt& ul,
+                      const ossimGpt& ur,
+                      const ossimGpt& lr,
+                      const ossimGpt& ll);
+   /*!
+    * METHOD: imageSize()
+    * Returns the maximum line/sample rigorously defined by this model.
+    */
+   ossimDpt imageSize() const { return theImageSize; }
+   void setImageSize(const ossimDpt& size){theImageSize = size;}
+   /*!
+    * This is from the adjustable parameter interface.  It is
+    * called when a paraemter adjustment is made.
+    */
+   virtual void adjustableParametersChanged()
+      {
+         updateModel();
+      }
+   /*!
+    * VIRTUAL METHOD: updateModel()
+    * Following a change to the adjustable parameter set, this virtual
+    * is called to permit instances to compute derived quantities after
+    * parameter change.
+    */
+   virtual void updateModel() {}
+
+   /*!
+    * METHODS:  saveState, loadState
+    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
+    * KWL files.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /*!
+    * METHOD: insideImage(image_point)
+    * Returns true if the image_point lies inside the image rectangle.
+    */
+   virtual bool insideImage(const ossimDpt& p) const
+      {
+/*          return( (p.u>=(0.0-FLT_EPSILON)) && */
+/*                  (p.u<=(double)(theImageSize.u-(1-FLT_EPSILON))) && */
+/*                  (p.v>=(0.0-FLT_EPSILON)) && */
+/*                  (p.v<=(double)(theImageSize.v-(1-FLT_EPSILON))) ); */
+         // if it's close to the edge we will consider it inside the image
+         //
+         return theImageClipRect.pointWithin(p, 2.0);
+      }
+
+   /*!
+    * STATIC METHOD: writeGeomTemplate(ostream)
+    * Writes a template of keywords processed by loadState and saveState to
+    * output stream.
+    */
+   static void writeGeomTemplate(ostream& os);
+
+   /*!
+    * OPERATORS: 
+    */
+   virtual bool operator==(const ossimProjection& proj) const; //inline below
+
+    //! Access methods:
+    const ossimString&   getImageID()               const { return theImageID; }
+    const ossimDrect&    getImageClipRect()         const { return theImageClipRect; }
+
+   /*!
+    * optimizableProjection implementation
+    */
+   virtual ossim_uint32 degreesOfFreedom()const;
+   inline virtual bool needsInitialState()const {return true;}
+   virtual double optimizeFit(const ossimTieGptSet& tieSet,
+                              double* targetVariance=0);
+
+   /*!
+    * METHOD: getForwardDeriv()
+    * gives forward() partial derivative regarding parameter parmIdx (>=0)
+    * default implementation is centered finite difference
+    * -should be reimplemented with formal derivative in child class
+    */
+   virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta=1e-11);
+
+   /*!
+    * METHOD: getInverseDeriv()
+    * gives inverse() partial derivative regarding parameter parmIdx (>=0)
+    * default implementation is centered finite difference
+    * -should be reimplemented with formal derivative in child class
+    */
+   virtual ossimGpt getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta=1e-11);
+
+   /*!
+    * METHOD: getObsCovMat()
+    * @brief Gives 2X2 covariance matrix of observations
+    */
+   virtual ossimSensorModel::CovMatStatus getObsCovMat(
+      const ossimDpt& ipos, NEWMAT::SymmetricMatrix& Cov,
+      const ossim_float64 defPointingSigma = 0.5);
+
+   /**
+    * @brief Implementation of pure virtual
+    * ossimProjection::isAffectedByElevation method.
+    * @return true.
+    */
+   virtual bool isAffectedByElevation() const { return true; }
+
+   /**
+    * This method computes the ground sample distance(gsd) and sets class
+    * attributes theGSD and theMeanGSD by doing a lineSampleHeightToWorld on
+    * four points and calculating the distance from them.
+    *
+    * @return Nothing but throws ossimException on error.
+    */
+   void computeGsd();
+
+   /**
+    * @brief Extracts geometry info from a non-ossim key,value pair 
+    * to an ossim keyword list.
+    *
+    * @param key non-ossim-based input ossimString 
+    * @param value non-ossim-based input ossimString
+    * @param geomKwl The keyword list to fill in.
+    */
+   virtual bool getImageGeometry( 
+      const ossimString& /* key */, const ossimString& /* value */, 
+      ossimKeywordlist& /* geomKwl */ ) const { return false; }
+
+protected:
+   virtual ~ossimSensorModel();
+
+   
+   /*!
+    * METHOD: extrapolate()
+    * Extrapolates solutions for points outside of the image. The second
+    * version accepts a height value -- if left at the default, the elevation
+    * will be looked up via theElevation object.
+    */
+   virtual ossimDpt extrapolate (const ossimGpt& gp) const;
+   virtual ossimGpt extrapolate (const ossimDpt& ip,
+				 const double& height=ossim::nan()) const;
+
+   /*!
+    * METHOD: buildNormalEquation
+    * builds linearized system  (LMS equivalent)
+    * A*dp = projResidue
+    * 
+    * A: symetric matrix = tJ*J
+    * dp: system parameter shift that we want to estimate
+    * projResidue = tJ * residue
+    *
+    * t: transposition operator
+    * J = jacobian of transform relative to parameters p, transform can be forward() or inverse()
+    * jacobian is obtained via finite differences
+    * residue can be image (2D) or ground residue(3D)
+    *
+    * TODO: use image/ground points covariance matrices
+    */
+   void buildNormalEquation(const ossimTieGptSet& tieSet,
+                                      NEWMAT::SymmetricMatrix& A,
+                                      NEWMAT::ColumnVector& residue,
+                                      NEWMAT::ColumnVector& projResidue,
+                                      double pstep_scale);
+
+   /*!
+    * METHOD: getResidue()
+    * returns ground opr image residue
+    */
+   NEWMAT::ColumnVector getResidue(const ossimTieGptSet& tieSet);
+
+   NEWMAT::ColumnVector solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const;
+
+   /*!
+    * stable invert stolen from ossimRpcSolver
+    */
+   NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
+
+   ossimIpt       theImageSize;       // pixels
+
+   /*!
+    * Support sub-image of larger full image by maintaining offset to UL corner
+    */
+   ossimDpt       theSubImageOffset;  // pixels
+   
+   ossimString    theImageID;
+   ossimString    theSensorID;
+   ossimDpt       theGSD;             // meters
+   ossim_float64  theMeanGSD;         // meters
+   ossimGpt       theRefGndPt;        // should be image center
+   ossimDpt       theRefImgPt;        // should be image center
+   ossimPolygon   theBoundGndPolygon;
+   ossimDrect     theImageClipRect;
+   ossim_float64  theRelPosError; 	// meters, relative to other models in the set
+   ossim_float64  theNominalPosError; // meters
+
+   /** Partials for current point */
+   ossimDpt theParWRTx;
+   ossimDpt theParWRTy;
+   ossimDpt theParWRTz;
+   
+   /** Observations & residuals for current point */
+   ossimDpt theObs;
+   ossimDpt theResid;
+
+   /**
+    * Used as an initial guess for iterative solutions and a guess for points outside the support
+    * bounds.
+    */ 
+   ossimRefPtr<ossimProjection> theSeedFunction;
+   
+   mutable bool theExtrapolateImageFlag;
+   mutable bool theExtrapolateGroundFlag;
+   
+TYPE_DATA
+};
+
+//================= BEGIN INLINE DEFINITIONS =================================
+
+//*****************************************************************************
+//  OPERATOR == 
+//*****************************************************************************
+inline bool ossimSensorModel::operator==(const ossimProjection& proj) const
+{
+   // const  ossimSensorModel* model
+   //    = PTR_CAST(ossimSensorModel, (const ossimProjection*) &proj);
+   const ossimSensorModel* model = dynamic_cast<const ossimSensorModel*>( &proj );
+   if ( (!model) ||
+	(theSensorID != model->theSensorID) ||
+	(theImageID != model->theImageID) ||
+	(theSubImageOffset != model->theSubImageOffset) )
+      return false;
+
+   return true;
+}
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimSensorModelFactory.h b/include/ossim/projection/ossimSensorModelFactory.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSensorModelFactory.h
rename to include/ossim/projection/ossimSensorModelFactory.h
diff --git a/ossim/include/ossim/projection/ossimSensorModelTuple.h b/include/ossim/projection/ossimSensorModelTuple.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSensorModelTuple.h
rename to include/ossim/projection/ossimSensorModelTuple.h
diff --git a/ossim/include/ossim/projection/ossimSinusoid.h b/include/ossim/projection/ossimSinusoid.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSinusoid.h
rename to include/ossim/projection/ossimSinusoid.h
diff --git a/ossim/include/ossim/projection/ossimSinusoidalProjection.h b/include/ossim/projection/ossimSinusoidalProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSinusoidalProjection.h
rename to include/ossim/projection/ossimSinusoidalProjection.h
diff --git a/ossim/include/ossim/projection/ossimSkyBoxLearSensor.h b/include/ossim/projection/ossimSkyBoxLearSensor.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSkyBoxLearSensor.h
rename to include/ossim/projection/ossimSkyBoxLearSensor.h
diff --git a/ossim/include/ossim/projection/ossimSmacCallibrationSystem.h b/include/ossim/projection/ossimSmacCallibrationSystem.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSmacCallibrationSystem.h
rename to include/ossim/projection/ossimSmacCallibrationSystem.h
diff --git a/ossim/include/ossim/projection/ossimSonomaSensor.h b/include/ossim/projection/ossimSonomaSensor.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSonomaSensor.h
rename to include/ossim/projection/ossimSonomaSensor.h
diff --git a/ossim/include/ossim/projection/ossimSpaceObliqueMercatorProjection.h b/include/ossim/projection/ossimSpaceObliqueMercatorProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSpaceObliqueMercatorProjection.h
rename to include/ossim/projection/ossimSpaceObliqueMercatorProjection.h
diff --git a/include/ossim/projection/ossimSpectraboticsRedEdgeModel.h b/include/ossim/projection/ossimSpectraboticsRedEdgeModel.h
new file mode 100644
index 0000000..5a91975
--- /dev/null
+++ b/include/ossim/projection/ossimSpectraboticsRedEdgeModel.h
@@ -0,0 +1,100 @@
+#ifndef ossimSpectraboticsRedEdgeModel_HEADER
+#define ossimSpectraboticsRedEdgeModel_HEADER 1
+#include <ossim/projection/ossimFcsiModel.h>
+#include <ossim/projection/ossimMeanRadialLensDistortion.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/projection/ossimTangentialRadialLensDistortion.h>
+
+class OSSIM_DLL ossimSpectraboticsRedEdgeModel : public ossimSensorModel
+{
+public:
+   ossimSpectraboticsRedEdgeModel();
+   ossimSpectraboticsRedEdgeModel(const ossimDrect& imageRect, // center in image space
+                          const ossimGpt& platformPosition,
+                          double roll,
+                          double pitch,
+                          double heading,
+                          const ossimDpt& principalPoint, // in millimeters
+                          double focalLength, // in millimeters
+                          const ossimDpt& pixelSize); // in millimeters
+   ossimSpectraboticsRedEdgeModel(const ossimSpectraboticsRedEdgeModel& src);
+   virtual ossimObject* dup()const;
+   
+   virtual void imagingRay(const ossimDpt& image_point,
+                           ossimEcefRay&   image_ray) const;
+
+   void lineSampleToWorld(const ossimDpt& image_point,
+                          ossimGpt&       gpt) const;
+  
+   
+   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
+                                        const double&   heightEllipsoid,
+                                        ossimGpt&       worldPoint) const;
+   virtual void worldToLineSample(const ossimGpt& world_point,
+                                  ossimDpt&       image_point) const;
+   
+   virtual void updateModel();
+
+   void setPrincipalPoint(ossimDpt principalPoint);
+
+   virtual bool insideImage(const ossimDpt& p) const
+   {
+      /*          return( (p.u>=(0.0-FLT_EPSILON)) && */
+      /*                  (p.u<=(double)(theImageSize.u-(1-FLT_EPSILON))) && */
+      /*                  (p.v>=(0.0-FLT_EPSILON)) && */
+      /*                  (p.v<=(double)(theImageSize.v-(1-FLT_EPSILON))) ); */
+      // if it's close to the edge we will consider it inside the image
+      //
+      return theImageClipRect.pointWithin(p, theImageClipRect.width());
+   }
+
+
+   void setRollPitchHeading(double roll,
+                            double pitch,
+                            double heading);
+   
+   void setPixelSize(const ossimDpt& pixelSize);
+   void setImageRect(const ossimDrect& rect);
+   void setFocalLength(double focalLength);
+   void setPlatformPosition(const ossimGpt& gpt);
+
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   virtual void initAdjustableParameters();
+   
+   /*!
+    * ossimOptimizableProjection
+    */
+//   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM)
+   inline virtual bool useForward()const {return false;} //!ground to image faster (you don't need DEM)
+   virtual bool setupOptimizer(const ossimString& init_file); //!uses file path to init model
+
+protected:
+   
+   NEWMAT::Matrix m_compositeMatrix;
+   NEWMAT::Matrix m_compositeMatrixInverse;
+   double         m_roll;
+   double         m_pitch;
+   double         m_heading;
+   double         m_fov;
+   ossimDpt       m_principalPoint;
+   ossimDpt       m_calibratedCenter;
+   ossimDpt       m_pixelSize;
+   double         m_focalLength;
+   double         m_norm; // for lens normalization
+   double         m_focalX;
+   double         m_focalY;
+   ossimEcefPoint m_ecefPlatformPosition;
+   ossimRefPtr<ossimTangentialRadialLensDistortion> m_lensDistortion;
+
+
+   ossimEcefPoint m_adjEcefPlatformPosition;
+   
+TYPE_DATA
+};
+
+#endif
\ No newline at end of file
diff --git a/ossim/include/ossim/projection/ossimSpot5Model.h b/include/ossim/projection/ossimSpot5Model.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimSpot5Model.h
rename to include/ossim/projection/ossimSpot5Model.h
diff --git a/ossim/include/ossim/projection/ossimStatePlaneProjectionInfo.h b/include/ossim/projection/ossimStatePlaneProjectionInfo.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimStatePlaneProjectionInfo.h
rename to include/ossim/projection/ossimStatePlaneProjectionInfo.h
diff --git a/ossim/include/ossim/projection/ossimStereographicProjection.h b/include/ossim/projection/ossimStereographicProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimStereographicProjection.h
rename to include/ossim/projection/ossimStereographicProjection.h
diff --git a/include/ossim/projection/ossimTangentialRadialLensDistortion.h b/include/ossim/projection/ossimTangentialRadialLensDistortion.h
new file mode 100644
index 0000000..b5738ef
--- /dev/null
+++ b/include/ossim/projection/ossimTangentialRadialLensDistortion.h
@@ -0,0 +1,66 @@
+#ifndef ossimTangentialRadialLensDistortion_HEADER
+#define ossimTangentialRadialLensDistortion_HEADER 1
+#include <vector>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/projection/ossimLensDistortion.h>
+
+/***
+This is taken from the site:
+
+http://www.mathworks.com/products/symbolic/code-examples.html?file=/products/demos/symbolictlbx/Pixel_location/Camera_Lens_Undistortion.html
+
+Developing an Algorithm to Undistort Pixel Locations of an Image
+This example uses Symbolic Math Toolbox to develop an algorithm that undistorts pixel locations of an image.
+
+Background
+
+When a camera captures an image, it does not precisely capture 
+the real points, but rather a slightly distorted version of the real points that can be denoted (x2, y2). The distorted pixel locations can be described using the following equations:
+
+x2 = x1(1 + k1*r^2 + k2*r^4 + k3*r^6) +2*p1*x1*y1 + p2*(r^2 + 2*x1^2)
+y2 = y1(1 + k1*r^2 + k2*r^4 + k3*r^6) +2*p2*x1*y1 + p1*(r^2 + 2*y1^2)
+ 
+
+where:
+x1, y2     = undistorted pixel locations
+k1, k2, k3 = radial distortion coefficients of the lens
+p1, p2     = tangential distortion coefficients of the lens
+r = sqrt(x1^2 + y1^2)
+
+
+***/
+
+class ossimTangentialRadialLensDistortion : public ossimLensDistortion
+{
+public:
+   ossimTangentialRadialLensDistortion();
+
+   ossimTangentialRadialLensDistortion(const ossimDpt& calibratedCenter,
+                                 double k1 = 0.0, double k2 = 0.0, double k3 = 0.0,
+                                 double p1 = 0.0, double p2 = 0.0);
+   ossimTangentialRadialLensDistortion(const ossimDpt& calibratedCenter,
+                                 std::vector<double> k,
+                                 std::vector<double> p);
+
+//  ossimDpt adjustPoint(const ossimDpt &position)const;
+  virtual std::ostream& print(std::ostream& out) const
+  {return out;}
+
+  virtual void undistort(const ossimDpt& input, ossimDpt& output)const;
+  
+  
+  virtual bool saveState(ossimKeywordlist& kwl,
+                         const char* prefix = 0)const;
+  
+  virtual bool loadState(const ossimKeywordlist& kwl,
+                         const char* prefix = 0);
+  
+protected:
+
+  std::vector<ossim_float64> m_k;
+  std::vector<ossim_float64> m_p;
+  
+TYPE_DATA  
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimTiffProjectionFactory.h b/include/ossim/projection/ossimTiffProjectionFactory.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimTiffProjectionFactory.h
rename to include/ossim/projection/ossimTiffProjectionFactory.h
diff --git a/ossim/include/ossim/projection/ossimTranmerc.h b/include/ossim/projection/ossimTranmerc.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimTranmerc.h
rename to include/ossim/projection/ossimTranmerc.h
diff --git a/ossim/include/ossim/projection/ossimTransCylEquAreaProjection.h b/include/ossim/projection/ossimTransCylEquAreaProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimTransCylEquAreaProjection.h
rename to include/ossim/projection/ossimTransCylEquAreaProjection.h
diff --git a/ossim/include/ossim/projection/ossimTransMercatorProjection.h b/include/ossim/projection/ossimTransMercatorProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimTransMercatorProjection.h
rename to include/ossim/projection/ossimTransMercatorProjection.h
diff --git a/ossim/include/ossim/projection/ossimUps.h b/include/ossim/projection/ossimUps.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimUps.h
rename to include/ossim/projection/ossimUps.h
diff --git a/ossim/include/ossim/projection/ossimUpsProjection.h b/include/ossim/projection/ossimUpsProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimUpsProjection.h
rename to include/ossim/projection/ossimUpsProjection.h
diff --git a/ossim/include/ossim/projection/ossimUpspt.h b/include/ossim/projection/ossimUpspt.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimUpspt.h
rename to include/ossim/projection/ossimUpspt.h
diff --git a/ossim/include/ossim/projection/ossimUtm.h b/include/ossim/projection/ossimUtm.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimUtm.h
rename to include/ossim/projection/ossimUtm.h
diff --git a/include/ossim/projection/ossimUtmProjection.h b/include/ossim/projection/ossimUtmProjection.h
new file mode 100644
index 0000000..b2b006f
--- /dev/null
+++ b/include/ossim/projection/ossimUtmProjection.h
@@ -0,0 +1,228 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Utm projection code.  
+//*******************************************************************
+//  $Id: ossimUtmProjection.h 17815 2010-08-03 13:23:14Z dburken $
+#ifndef ossimUtmProjection_HEADER
+#define ossimUtmProjection_HEADER
+#include <ossim/projection/ossimMapProjection.h>
+
+class OSSIMDLLEXPORT ossimUtmProjection : public ossimMapProjection
+{
+public:
+   ossimUtmProjection(const ossimEllipsoid& ellipsoid = ossimEllipsoid(),
+                      const ossimGpt& origin = ossimGpt());
+   
+   ossimUtmProjection(const ossimEllipsoid& ellipsoid,
+                      const ossimGpt& origin,
+                      ossim_int32 zone,
+                      char hemisphere);
+   ossimUtmProjection(ossim_int32 zone);
+   ossimUtmProjection(const ossimUtmProjection& src);
+   
+   virtual ossimObject* dup()const;
+
+   virtual ossimGpt inverse(const ossimDpt &eastingNorthing)const;
+   virtual ossimDpt forward(const ossimGpt &latLon)const;
+   virtual void update();
+
+   /**
+    * This will set the utm zone and utm origin base on origin passed in.
+    *
+    * @note If the origin latitude is not 0.0 it will also set the
+    * hemisphere.  If 0.0 hemisphere is unchanged from previous stored value.
+    */
+   virtual void setOrigin(const ossimGpt& origin);
+   
+   void setZone(const ossimGpt& ground);
+   void setZone(ossim_int32 zone);
+   void setHemisphere(const ossimGpt& ground);
+   void setHemisphere(char hemisphere);
+   static ossim_int32 computeZone(const ossimGpt& gpt);
+
+   /**
+    * Return in decimal degrees the zone meridian.
+    */
+   static double computeZoneMeridian(ossim_int32 zone);
+
+   ossim_int32 getZone()const;
+
+   char getHemisphere()const;
+
+   /**
+    * Method to save the state of an object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0)const;
+   
+   /**
+    * Method to the load (recreate) the state of an object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   /**
+    * Prints data members to stream.  Returns stream&.
+    */
+   virtual std::ostream& print(std::ostream& out) const;   
+
+   /**
+    * @return The false easting.
+    */
+   virtual double getFalseEasting() const;
+
+   /**
+    * @return The false northing.
+    */
+   virtual double getFalseNorthing() const;
+
+   //! Returns TRUE if principal parameters are within epsilon tolerance.
+   virtual bool operator==(const ossimProjection& projection) const;
+
+   /**
+    * @brief Returns the EPSG PCS code based on datum, zone, and hemisphere.
+    *
+    * This overrides ossimMapProjection::getPcsCode(). Sets
+    * ossimMapProjection::thePcsCode on success.
+    *
+    * @return code on success, 0 if datum is not set.
+    */
+   virtual ossim_uint32 getPcsCode() const;
+   
+private:
+   
+   /*_____________GEOTRANS_______________*/
+   
+   /**
+    * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
+    * parameters and Tranverse Mercator projection parameters as inputs, and
+    * sets the corresponding state variables. If any errors occur, the error
+    * code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
+    * returned.
+    *
+    * a                 : Semi-major axis of ellipsoid, in meters    (input)
+    * f                 : Flattening of ellipsoid                    (input)
+    * Origin_Latitude   : Latitude in radians at the origin of the   (input)
+    *                      projection
+    * Central_Meridian  : Longitude in radians at the center of the  (input)
+    *                      projection
+    * False_Easting     : Easting/X at the center of the projection  (input)
+    * False_Northing    : Northing/Y at the center of the projection (input)
+    * Scale_Factor      : Projection scale factor                    (input) 
+    */
+   ossim_int32 Set_Transverse_Mercator_Parameters(double a,      
+                                                  double f,
+                                                  double Origin_Latitude,
+                                                  double Central_Meridian,
+                                                  double False_Easting,
+                                                  double False_Northing,
+                                                  double Scale_Factor);
+   /**
+    * The function Get_Transverse_Mercator_Parameters returns the current
+    * ellipsoid and Transverse Mercator projection parameters.
+    *
+    * a                 : Semi-major axis of ellipsoid, in meters    (output)
+    * f                 : Flattening of ellipsoid                    (output)
+    * Origin_Latitude   : Latitude in radians at the origin of the   (output)
+    *                      projection
+    * Central_Meridian  : Longitude in radians at the center of the  (output)
+    *                      projection
+    * False_Easting     : Easting/X at the center of the projection  (output)
+    * False_Northing    : Northing/Y at the center of the projection (output)
+    * Scale_Factor      : Projection scale factor                    (output) 
+    */
+   void Get_Transverse_Mercator_Parameters(double *a,
+                                           double *f,
+                                           double *Origin_Latitude,
+                                           double *Central_Meridian,
+                                           double *False_Easting,
+                                           double *False_Northing,
+                                           double *Scale_Factor)const;
+   
+   
+   /**
+    * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
+    * (latitude and longitude) coordinates to Transverse Mercator projection
+    * (easting and northing) coordinates, according to the current ellipsoid
+    * and Transverse Mercator projection coordinates.  If any errors occur, the
+    * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
+    * returned.
+    *
+    * Latitude      : Latitude in radians                         (input)
+    * Longitude     : Longitude in radians                        (input)
+    * Easting       : Easting/X in meters                         (output)
+    * Northing      : Northing/Y in meters                        (output)
+    */
+   ossim_int32 Convert_Geodetic_To_Transverse_Mercator (double Latitude,
+                                                        double Longitude,
+                                                        double *Easting,
+                                                        double *Northing)const;
+   
+   
+   /**
+    * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
+    * Mercator projection (easting and northing) coordinates to geodetic
+    * (latitude and longitude) coordinates, according to the current ellipsoid
+    * and Transverse Mercator projection parameters.  If any errors occur, the
+    * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
+    * returned.
+    *
+    *    Easting       : Easting/X in meters                         (input)
+    *    Northing      : Northing/Y in meters                        (input)
+    *    Latitude      : Latitude in radians                         (output)
+    *    Longitude     : Longitude in radians                        (output)
+    */
+   ossim_int32 Convert_Transverse_Mercator_To_Geodetic(double Easting,
+                                                       double Northing,
+                                                       double *Latitude,
+                                                       double *Longitude)const;
+   
+   double theTranMerc_a;  /* Semi-major axis of ellipsoid i meters */
+   double theTranMerc_f;  /* Flattening of ellipsoid  */
+   
+   /* Eccentricity (0.08181919084262188000) squared */
+   double theTranMerc_es;
+   
+   double theTranMerc_ebs;   /* Second Eccentricity squared */
+   
+   /* Transverse_Mercator projection Parameters */
+   
+   double theTranMerc_Origin_Lat;     /* Latitude of origin in radians */
+   double theTranMerc_Origin_Long;    /* Longitude of origin in radians */
+   double theTranMerc_False_Northing; /* False northing in meters */
+   double theTranMerc_False_Easting;  /* False easting in meters */
+   double theTranMerc_Scale_Factor;   /* Scale factor  */
+   
+   /* Isometeric to geodetic latitude parameters, default to WGS 84 */
+   double theTranMerc_ap;
+   double theTranMerc_bp;
+   double theTranMerc_cp;
+   double theTranMerc_dp;
+   double theTranMerc_ep;
+   
+   /* Maximum variance for easting and northing values for WGS 84. */
+   double theTranMerc_Delta_Easting;
+   double theTranMerc_Delta_Northing;  
+   
+   /** 
+    * zone can be from 1 through 60 (0 == NOT SET)
+    */
+   ossim_int32 theZone;
+   
+   /**
+    * can be N or S.
+    */
+   char   theHemisphere;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/projection/ossimUtmpt.h b/include/ossim/projection/ossimUtmpt.h
new file mode 100644
index 0000000..dcbd93d
--- /dev/null
+++ b/include/ossim/projection/ossimUtmpt.h
@@ -0,0 +1,89 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// This is the Universal Transverse Mercator (UTM) point.  Allows
+// easy onversion between different coordinates.
+//*******************************************************************
+//  $Id: ossimUtmpt.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimUtmpt_HEADER
+#define ossimUtmpt_HEADER
+
+#include <ossim/base/ossimConstants.h>
+
+class ossimGpt;
+class ossimEcefPoint;
+class ossimUpspt;
+class ossimDatum;
+
+class OSSIMDLLEXPORT ossimUtmpt
+{
+public:
+   ossimUtmpt(const ossimGpt &aPt);
+   ossimUtmpt(const ossimEcefPoint &aPt);
+   ossimUtmpt(long         zone,
+              char         hemisphere,  // N or S
+              double       easting,
+              double       northing,
+              const ossimDatum* datum);
+   
+   // ossimUtmpt(const ossimUpspt &aPt);
+
+   /**
+    * Return the zone for this utm point.
+    */
+   long zone() const { return theZone; }
+
+   /**
+    * Return the hemisphere ( Northern or Southern).
+    * We store this as a char value N or S.  We store it
+    * like this because we are interfacing to geotrans
+    * and geotrans stores their values in this manner.
+    */
+   char hemisphere() const { return theHemisphere; }
+
+   /**
+    * return the easting value in meters.
+    */
+   double easting() const { return theEasting; }
+
+   /**
+    * return the northing value in meters.
+    */
+   double northing() const { return theNorthing; }
+
+   /**
+    * return the reference datum for this point.
+    */
+   const ossimDatum* datum() const { return theDatum; }
+
+   /**
+    * Initializes this point to utm coordinates for the ground point.
+    *
+    * @param aPt Ground point to initialize from.
+    */
+   void convertFromGround(const ossimGpt &aPt);
+
+   /**
+    * Initializes the ground point from the utm coordinates of this point.
+    *
+    * @param aPt Ground point to initialize.
+    */
+   void convertToGround(ossimGpt &aPt);
+   
+private:
+   long               theZone;
+   char               theHemisphere;
+   double             theEasting;
+   double             theNorthing;
+   const ossimDatum*  theDatum;
+};
+
+#endif
diff --git a/ossim/include/ossim/projection/ossimVanDerGrintenProjection.h b/include/ossim/projection/ossimVanDerGrintenProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimVanDerGrintenProjection.h
rename to include/ossim/projection/ossimVanDerGrintenProjection.h
diff --git a/ossim/include/ossim/projection/ossimWarpProjection.h b/include/ossim/projection/ossimWarpProjection.h
similarity index 100%
rename from ossim/include/ossim/projection/ossimWarpProjection.h
rename to include/ossim/projection/ossimWarpProjection.h
diff --git a/include/ossim/projection/ossimWktProjectionFactory.h b/include/ossim/projection/ossimWktProjectionFactory.h
new file mode 100644
index 0000000..6069086
--- /dev/null
+++ b/include/ossim/projection/ossimWktProjectionFactory.h
@@ -0,0 +1,78 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  Oscar Kramer
+//
+//*******************************************************************
+//  $Id: ossimWktProjectionFactory.h 22924 2014-10-27 16:32:58Z okramer $
+
+#ifndef ossimWktProjectionFactory_HEADER
+#define ossimWktProjectionFactory_HEADER
+
+#include <ossim/projection/ossimProjectionFactoryBase.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimProjection;
+class ossimString;
+class ossimMapProjection;
+class ossimDatum;
+
+//*************************************************************************************************
+//! Projection Factory for coded projections defined in database. These are projections
+//! that are fully defined in database files and specified via a projection coordinate system (PCS)
+//! code, such as EPSG codes.
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimWktProjectionFactory : public ossimProjectionFactoryBase
+{
+public:
+   /*!
+    * METHOD: instance()
+    * Instantiates singleton instance of this class:
+    */
+   static ossimWktProjectionFactory* instance();
+
+   virtual ossimProjection* createProjection(const ossimFilename& filename,
+                                             ossim_uint32 entryIdx) const;
+
+   //! This is the principal factory method. It accepts a WKT string, for example 
+   //! "Anguilla_1957_British_West_Indies_Grid"
+   virtual ossimProjection* createProjection(const ossimString& name) const;
+
+   virtual ossim_uint32 getCode(const ossimString& name);
+
+   //! Looks for presence of "projection" keyword with the value in WKT format,
+   //! for example "Anguilla_1957_British_West_Indies_Grid" 
+   virtual ossimProjection* createProjection(const ossimKeywordlist& kwl,
+                                             const char* prefix = 0)const;
+
+   virtual ossimObject* createObject(const ossimString& typeName)const;
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix=0)const;
+   
+    //! This returns the type name of all objects in all factories. This is the name used to 
+    //! construct the objects dynamically and this name must be unique.
+   virtual void getTypeNameList(std::vector<ossimString>& typeList) const;
+
+protected:
+
+   //! Constructor loads the WKT CSV file specified in the ossim prefs with "wkt_database_file"
+   //! keyword.
+   ossimWktProjectionFactory() {}
+
+   ossimProjection* doTransverseMercator(const ossimKeywordlist& kwl)const;
+   ossimProjection* doMercator(const ossimKeywordlist& kwl)const;
+   ossimProjection* doLambertConformalConic(const ossimKeywordlist& kwl) const;
+   ossimProjection* doEquiDistCylindrical(const ossimKeywordlist& kwl) const;
+   ossimProjection* doEquiAreaCylindrical(const ossimKeywordlist& kwl) const;
+
+   void loadRecords() const;
+
+   template<class T> void doMapCommon(const ossimKeywordlist& kwl, T proj) const;
+
+   static ossimWktProjectionFactory*  m_instance; //!< Singleton implementation
+   mutable std::map<std::string, ossim_uint32> m_wktProjRecords;
+
+};
+
+#endif
diff --git a/include/ossim/sockets/ossimToolClient.h b/include/ossim/sockets/ossimToolClient.h
new file mode 100644
index 0000000..96fa93e
--- /dev/null
+++ b/include/ossim/sockets/ossimToolClient.h
@@ -0,0 +1,88 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimToolClient_HEADER
+#define ossimToolClient_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+
+/**
+ * Utility class providing an interface to ossimTool-derived functionality via TCP sockets
+ * Results are returned either as streamed text (for non-image responses such as image info) or
+ * streamed binary file representing imagery or vector products. Code interfacing to this class
+ * should know the commands available (or execute the command "help" and view the text response).
+ */
+class OSSIM_DLL ossimToolClient
+{
+public:
+
+   ossimToolClient();
+
+   /**
+    * Closes any open connections.
+    */
+   ~ossimToolClient();
+
+   /**
+    * Accepts hostname and portname as a string. Returns socket file descriptor or -1 if error.
+    */
+   int connectToServer(char* hostname, char* portname=NULL);
+
+   /**
+    * Sets the local destination directory for file product. The product file name used
+    * will match the server-side's file name. This method must be called prior to execute() for
+    * operations generating file products, otherwise the products are written to the client's temp
+    * directory. If the path directory specified does not exist, it will be created.
+    * Returns true if successful.
+    */
+   bool setProductFilePath(const char* filepath);
+
+    /**
+    * Returns the filename (including full client-side path) of the local product file waiting
+    * after execute(), or NULL if none.
+    */
+   const char* getProductFilePath() const { return m_prodFilePath; }
+
+   /**
+    * Executes OSSIM tool command with options. Examples:
+    *
+    *    "info -p <server-side-filename>" -- Fetches projection info for server side file specified
+    *    "shoreline -i <server/path/band3.tif>, <server/path/band6.tif> <server/path/output.json>"
+    *
+    * Returns TRUE if product generated and received. setProductFilePath() must be called prior to
+    * execute() for operations generating file products, otherwise the products are written to the
+    * client's temp directory.
+    */
+   bool execute(const char* command_spec);
+
+   /**
+    * Returns the server's text response generated by the execute() call, or NULL if no response
+    * available. Some operations generate both text and file products.
+    */
+   const char* getTextResponse() const { return m_textResponse.chars(); }
+
+   /**
+    * Closes connection to server and ready to connect again.
+    */
+   bool disconnect();
+
+protected:
+
+   void error(const char *msg);
+
+   bool receiveText();
+   bool receiveFile();
+   bool acknowledgeRcv();
+
+   int m_svrsockfd;
+   char* m_buffer;
+   ossimFilename m_prodFilePath;
+   ossimString m_textResponse;
+};
+
+#endif
diff --git a/include/ossim/sockets/ossimToolServer.h b/include/ossim/sockets/ossimToolServer.h
new file mode 100644
index 0000000..b865d8a
--- /dev/null
+++ b/include/ossim/sockets/ossimToolServer.h
@@ -0,0 +1,45 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimToolServer_HEADER
+#define ossimToolServer_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+
+/**
+ * Utility class provides the server interface to ossimTool-derived functionality via TCP sockets
+ * Results are returned either as streamed text (for non-image responses such as image info) or
+ * streamed binary file representing imagery or vector products. Clients interfacing to this class
+ * should know the commands available (or execute the command "help" and view the text response).
+ * @see ossimToolClient for concrete client implementation.
+ */
+class OSSIM_DLL ossimToolServer
+{
+public:
+   ossimToolServer();
+   ~ossimToolServer();
+   void startListening(const char* portid);
+
+private:
+   void initSocket(const char* portid);
+   bool processOssimRequest(struct sockaddr_in& cli_addr);
+   bool runCommand(ossimString& command);
+   void writeSocket(const char* buf, int bufsize);
+   bool sendFile(const ossimFilename& fname);
+   void error(const char* msg);
+   bool acknowledgeRcvd();
+
+   static void sigchld_handler(int s);
+
+   int m_svrsockfd;
+   int m_clisockfd;
+   char* m_buffer;
+};
+
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimAigBounds.h b/include/ossim/support_data/ossimAigBounds.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimAigBounds.h
rename to include/ossim/support_data/ossimAigBounds.h
diff --git a/ossim/include/ossim/support_data/ossimAigDataFileHeader.h b/include/ossim/support_data/ossimAigDataFileHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimAigDataFileHeader.h
rename to include/ossim/support_data/ossimAigDataFileHeader.h
diff --git a/ossim/include/ossim/support_data/ossimAigHeader.h b/include/ossim/support_data/ossimAigHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimAigHeader.h
rename to include/ossim/support_data/ossimAigHeader.h
diff --git a/ossim/include/ossim/support_data/ossimAigIndexFileHeader.h b/include/ossim/support_data/ossimAigIndexFileHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimAigIndexFileHeader.h
rename to include/ossim/support_data/ossimAigIndexFileHeader.h
diff --git a/ossim/include/ossim/support_data/ossimAigStatistics.h b/include/ossim/support_data/ossimAigStatistics.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimAigStatistics.h
rename to include/ossim/support_data/ossimAigStatistics.h
diff --git a/ossim/include/ossim/support_data/ossimAlphaSensorSupportData.h b/include/ossim/support_data/ossimAlphaSensorSupportData.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimAlphaSensorSupportData.h
rename to include/ossim/support_data/ossimAlphaSensorSupportData.h
diff --git a/include/ossim/support_data/ossimApplanixEOFile.h b/include/ossim/support_data/ossimApplanixEOFile.h
new file mode 100644
index 0000000..47264b5
--- /dev/null
+++ b/include/ossim/support_data/ossimApplanixEOFile.h
@@ -0,0 +1,213 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License: MIT
+// 
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id$
+
+#ifndef ossimApplanixEOFile_HEADER
+#define ossimApplanixEOFile_HEADER 1
+
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+
+#include <map>
+#include <vector>
+
+class OSSIM_DLL ossimApplanixEORecord : public ossimReferenced
+{
+public:
+
+   OSSIM_DLL friend std::ostream& operator <<(std::ostream& out, const ossimApplanixEORecord& src);
+   ossimApplanixEORecord(const ossimApplanixEORecord& src)
+      :theField(src.theField)
+   {
+   }
+   ossimApplanixEORecord(ossim_uint32 size=0)
+   {
+      setSize(size);
+   }
+
+   void setSize(ossim_uint32 size)
+   {
+      theField.resize(size);
+   }
+   const ossimString& operator [](ossim_uint32 idx)const
+   {
+      return theField[idx];
+   }
+   ossimString& operator [](ossim_uint32 idx)
+   {
+      return theField[idx];
+   }
+
+   std::vector<ossimString> theField;
+};
+
+class OSSIM_DLL ossimApplanixEOFile : public ossimReferenced
+{
+public:
+   OSSIM_DLL friend std::ostream& operator <<(std::ostream& out, const ossimApplanixEOFile& src);
+   ossimApplanixEOFile();
+
+   /**
+    * Will parse the entire Exterior orientation file and then index any record
+    * ID's found.  This calls the parseStream method.
+    *
+    * @param file  The exterior orientation file
+    */ 
+   bool parseFile(const ossimFilename& file);
+
+   /**
+    * Will parse the stream and set internal queriable parameters.
+    * @param inThe input stream containing the Applanix format exterior orientation file
+    * 
+    */
+   bool parseStream(ossim::istream& in);
+   
+
+   /**
+    * Utility method that just checks for an APPlanix exterior orientation header.
+    * Will call the isEOFile(istream) method.
+    *
+    * @param file theExterior orientation file.
+    */ 
+   bool isEOFile(const ossimFilename& file)const;
+
+   /**
+    * Utility method that just checks for an APPlanix exterior orientation header.
+    */ 
+   bool isEOFile(ossim::istream& in)const;
+
+   /**
+    * Parses the header of the exterior orientation file.
+    * Calls the parseHeader(istream, header) method.
+    *
+    * @param file The filename that is an Applanix Exterior orientation file.
+    * @param header The resulting header that was parsed out.
+    */
+   bool parseHeader(const ossimFilename& file,
+                    ossimString& header)const;
+
+   /**
+    * Parses the header of the exterior orientation file.
+    * Calls the parseHeader(istream, header) method.
+    *
+    * @param in The input stream That contains an exterior orientation 
+    * @param header The resulting header that was parsed out.
+    */
+   bool parseHeader(ossim::istream& in,
+                    ossimString& header)const;
+
+   /**
+    * Is a case insensitive parse of the column names for the orientation
+    * record.  Note this will check to see if the search key is contained
+    * within any column heading.  So if a Heading has something like
+    * "ID MORE TEXT"  then you can call this with just "ID" and get a match
+    *
+    * @param searchKey  the substring to search for
+    * @return The id of the column or -1 if can't find the column
+    */
+   ossim_int32 getFieldIdxLike(const ossimString& searchKey)const;
+   
+   
+   /**
+    * Is a case insensitive parse of the column names for the orientation
+    * record.  Note this will check to see if the search key exactly matches
+    * a column heading.  So if a Heading has something like
+    * "ID MORE TEXT"  then you can call this with just "ID MORE TEXT" to have a match
+    *
+    * @param searchKey  the substring to search for
+    *
+    * @return The id of the column or -1 if can't find the column
+    */
+   ossim_int32 getFieldIdx(const ossimString& searchKey)const;
+   
+   /** 
+    * Will index all records based on the "ID #" field for fast searching.
+    */ 
+   void indexRecordIds();
+
+   /**
+    *  Given an ID it will search and find an EO record that matches the ID.
+    *
+    *  If the records are not indexed it will do a linear search on the record array.
+    *
+    *  @param id  The id of the record to find.
+    *  
+    *  @return The exterior orientation for that record.
+    */
+   const ossimRefPtr<ossimApplanixEORecord> getRecordGivenId(const ossimString& id)const;
+
+   ossim_uint32 getNumberOfRecords()const;
+   const ossimRefPtr<ossimApplanixEORecord> getRecord(ossim_uint32 idx)const;
+      
+   bool isHeightAboveMSL()const;
+   bool isEcefModel()const;
+   bool isUtmFrame()const;
+   ossim_int32 getUtmZone()const;
+   ossimString getUtmHemisphere()const;
+
+   ossimString getSbetField()const;
+   double getBoreSightTx()const;
+   double getBoreSightTy()const;
+   double getBoreSightTz()const;
+   double getLeverArmLx()const;
+   double getLeverArmLy()const;
+   double getLeverArmLz()const;
+   double getKardinalKappa()const;
+   double getShiftValuesX()const;
+   double getShiftValuesY()const;
+   double getShiftValuesZ()const;
+
+   ossimString getMappingFrameDatum()const;
+   ossimString getMappingFrameProjection()const;
+   double getMappingFrameCentralMeridian()const;
+   double getMappingFrameOriginLatitude()const;
+   double getMappingFrameGridScaleFactor()const;
+   double getMappingFrameFalseEasting()const;
+   double getMappingFrameFalseNorthing()const;
+
+   ossimString convertToOssimDatumCode(const ossimString& datum)const;
+   
+protected:
+   ossimString theHeader;
+   ossimString theVersion;
+   ossimString theBoreSightTx;
+   ossimString theBoreSightTy;
+   ossimString theBoreSightTz;
+   ossimString theKappaCardinal;
+   ossimString theLeverArmLx;
+   ossimString theLeverArmLy;
+   ossimString theLeverArmLz;
+   ossimString theShiftValuesX;
+   ossimString theShiftValuesY;
+   ossimString theShiftValuesZ;
+   ossimString theSbetField;
+
+   ossimString theMappingFrameDatum;
+   ossimString theMappingFrameProjection;
+   ossimString theCentralMeridian;
+   ossimString theOriginLatitude;
+   ossimString theGridScaleFactor;
+   ossimString theFalseEasting;
+   ossimString theFalseNorthing;
+   ossimString theUtmZone;
+   ossimString theUtmHemisphere;
+
+   ossim_float64 theMinLat;
+   ossim_float64 theMinLon;
+   ossim_float64 theMaxLat;
+   ossim_float64 theMaxLon;
+   std::vector<ossimString> theRecordFormat;
+   std::vector< ossimRefPtr<ossimApplanixEORecord> > theApplanixRecordList;
+   std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>, ossimStringLtstr> theRecordIdMap;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimAuxFileHandler.h b/include/ossim/support_data/ossimAuxFileHandler.h
new file mode 100644
index 0000000..d28cbba
--- /dev/null
+++ b/include/ossim/support_data/ossimAuxFileHandler.h
@@ -0,0 +1,230 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: SPADAC Inc
+//         Adaptd from the GDAL package hfa dataset
+// Description: This class provides some simple utilities for aux file.
+//
+//********************************************************************
+// $Id: ossimAuxFileHandler.h 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#ifndef ossimAuxFileHandler_HEADER
+#define ossimAuxFileHandler_HEADER
+
+#include <cstring>
+#include <cstdlib>
+#include <string>
+#include <iostream>
+#include <fstream>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+
+#define EPT_u1	0
+#define EPT_u2	1
+#define EPT_u4	2
+#define EPT_u8	3
+#define EPT_s8	4
+#define EPT_u16	5
+#define EPT_s16	6
+#define EPT_u32	7
+#define EPT_s32	8
+#define EPT_f32	9
+#define EPT_f64	10
+#define EPT_c64	11
+#define EPT_c128 12
+
+class ossimFilename;
+class ossimAuxEntry;
+class ossimAuxType;
+class ossimAuxDictionary;
+
+class ossimAuxInfo{
+
+public:
+  ossimAuxInfo();
+
+  virtual ~ossimAuxInfo();   
+
+  FILE *fp;
+
+  ossim_uint32  nEndOfFile;
+  ossim_uint32	nRootPos;
+  ossim_uint32	nDictionaryPos;
+
+  ossim_int16	nEntryHeaderLength;
+  ossim_int32	nVersion;
+
+  ossimAuxEntry* m_Root;
+
+  ossimAuxDictionary*  m_Dictionary;
+  char* dictionaryData;
+};
+
+
+class ossimAuxEntry
+{
+  ossim_uint32	nFilePos;
+
+  ossimAuxInfo*   m_auxInfo;
+  ossimAuxEntry*  m_Parent;
+  ossimAuxEntry*  m_Prev;
+  ossimAuxEntry*  m_Next;
+  ossimAuxEntry*  m_Child;
+
+  ossim_uint32	  nNextPos;
+  ossim_uint32	  nChildPos;
+  
+  char	entryNodeName[64];
+  char	entryType[32];
+
+  ossimAuxType* m_Type;
+  ossim_uint32	nDataPos;
+  ossim_uint32	nDataSize;
+  char*  entryData;
+
+  void	     loadData();
+
+  int 	     getFieldValue(const char* auxFieldPath,
+                           char chReqType, void *reqReturn);
+
+public:
+  ossimAuxEntry( ossimAuxInfo* auxInfoIn, ossim_uint32 nPos,
+    ossimAuxEntry* parentIn, ossimAuxEntry* prevIn);
+
+  virtual     ~ossimAuxEntry();                
+
+  ossim_uint32	getFilePos() { return nFilePos; }
+
+  const char*   getName() { return entryNodeName; }
+  void          setName( const char *nodeName );
+
+  const char*   getType() { return entryType; }
+
+  char*  getData() { loadData(); return entryData; }
+  ossim_uint32	getDataPos() { return nDataPos; }
+  ossim_uint32	getDataSize() { return nDataSize; }
+
+  ossimAuxEntry*     getChild();
+  ossimAuxEntry*     getNext();
+  ossimAuxEntry*     getNamedChild( const char * name);
+
+  ossim_int16	  getIntField( const char * auxFieldPath);
+  const char*   getStringField( const char * auxFieldPath);
+
+};
+
+class ossimAuxField
+{
+public:
+  int		nBytes;
+
+  int		nItemCount;
+  char	chPointer; 	/* '\0', '*' or 'p' */
+  char	chItemType;	/* 1|2|4|e|... */
+
+  char	*itemObjectType; /* if chItemType == 'o' */
+  ossimAuxType* m_auxItemObjectType;
+
+  char** enumNames; /* normally NULL if not an enum */
+
+  char	*fieldName;
+
+  ossimAuxField();
+  ~ossimAuxField();
+
+  int 	extractInstValue( const char * auxField, int nIndexValue,
+    char *entryData, ossim_uint32 nDataOffset, int nDataSize,
+    char chReqType, void *reqReturn );
+
+  int		getInstCount( char * entryData, int nDataSize );
+
+  int   getInstBytes( char *entryData, int nDataSize );
+
+  const char* initialize( const char * fieldInput );
+
+  void completeDefn( ossimAuxDictionary * auxDict );
+};
+
+
+class ossimAuxType
+{
+public:
+  int		nBytes;
+  int		nFields;
+
+  ossimAuxField** m_auxFields;
+
+  char* auxTypeName;
+
+  ossimAuxType();
+  ~ossimAuxType();
+
+  const char* initialize( const char * typeInput);
+
+  void	completeDefn( ossimAuxDictionary * auxDict);
+
+  int		getInstBytes(char *entryData, int nDataSize );
+
+  int   extractInstValue( const char * auxField,
+    char *entryData, ossim_uint32 nDataOffset, int nDataSize,
+    char chReqType, void *reqReturn );
+};
+
+class ossimAuxDictionary
+{
+public:
+  int		nTypes;
+  int   nTypesMax;
+  ossimAuxType**  m_auxTypes;
+
+  ossimAuxDictionary(const char *auxDictStr);
+  ~ossimAuxDictionary();
+
+  ossimAuxType* findType( const char * name);
+  void          addType( ossimAuxType * type);
+
+  static int	  getItemSize( char chType);
+};
+
+
+class OSSIM_DLL ossimAuxFileHandler
+{
+public:
+
+
+  ossimAuxFileHandler();
+  virtual ~ossimAuxFileHandler();
+  /**
+  * @read .aux file
+  */
+  bool isAuxFile(const ossimFilename& file);
+
+  /**
+  * @open the file for reading
+  */
+  bool open(const ossimFilename& file);
+
+  /**
+  *  Reads a single record from a aux file.
+  *  Returns true if succesful. Returns false if EOF or error.
+  */
+  const ossimString& getProjectionName() const { return m_projName; }
+
+  const ossimString& getDatumName() const { return m_datumName; }
+
+  const ossimString& getUnitType() const { return m_unitsType; }
+
+private:
+
+  ossimAuxInfo* m_auxInfo;
+  ossimString m_projName;
+  ossimString m_datumName;
+  ossimString m_unitsType;
+};
+
+#endif  // #ifndef ossimAuxFileHandlerl_HEADER
diff --git a/include/ossim/support_data/ossimAuxXmlSupportData.h b/include/ossim/support_data/ossimAuxXmlSupportData.h
new file mode 100644
index 0000000..6b17d89
--- /dev/null
+++ b/include/ossim/support_data/ossimAuxXmlSupportData.h
@@ -0,0 +1,93 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: See class description below.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimAuxXmlSupportData_HEADER
+#define ossimAuxXmlSupportData_HEADER 1
+
+#include <ossim/base/ossimRefPtr.h>
+#include <iosfwd>
+#include <string>
+
+// Forward class declarations:
+class ossimDrect;
+class ossimFilename;
+class ossimProjection;
+class ossimString;
+class ossimXmlDocument;
+
+/**
+ * @class ossimAuxXmlSupportData
+ *
+ * Utility/support data class to extract the projection from a dot aux dot xml
+ * file commonly found with mrsid data.
+ */
+class OSSIM_DLL ossimAuxXmlSupportData
+{
+public:
+   
+   /** default constructor */
+   ossimAuxXmlSupportData();
+
+   /** virtual destructor */
+   virtual ~ossimAuxXmlSupportData();
+
+   /**
+    * @brief Method to get a projection if possible.
+    * @param file File name to open.
+    * @return Projection pointer wrapped in ref pointer.  Can be null if
+    * projection cannot be established.
+    */
+   ossimRefPtr<ossimProjection> getProjection(const ossimFilename& file) const;
+
+private:
+
+   /**
+    * @brief Gets path from doc and initializes string.
+    * @param path Xml path to look for.
+    * @param xdoc Xml doc to look in.
+    * @param s String to initialize.
+    * @return true on success and false if path is not found or if there
+    * are more than one of path.
+    */
+   bool getPath( const ossimString& path,
+                 const ossimXmlDocument& xdoc,
+                 ossimString& s ) const;
+
+   /**
+    * @brief Sets tie and scale.
+    * @param xdoc Xml document.
+    * @param wkt Well known tet string.
+    * @return True on success, false on error.
+    */
+   bool initializeProjection( const ossimXmlDocument xdoc,
+                              const std::string& wkt,
+                              ossimProjection* proj ) const;
+
+   /**
+    * @brief Get first parameter from PROJCS[ ... ] string.
+    * @param wkt Well known tet string.
+    * @param name Initialized by this with name if found.
+    * @return true on success, false on error.
+    */
+   bool getProjcsName( const std::string& wkt, std::string& name ) const;
+
+   /**
+    * @brief Gets units of Projected Coordinate System.
+    * @param wkt Well known tet string.
+    * @return Units.
+    */
+   ossimUnitType getUnits( const std::string& wkt ) const;
+
+};
+
+#endif /* End of "#ifndef ossimAuxXmlSupportData_HEADER" */
diff --git a/include/ossim/support_data/ossimCcfInfo.h b/include/ossim/support_data/ossimCcfInfo.h
new file mode 100644
index 0000000..bb9cb76
--- /dev/null
+++ b/include/ossim/support_data/ossimCcfInfo.h
@@ -0,0 +1,65 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CCF Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimCcfInfo_HEADER
+#define ossimCcfInfo_HEADER
+
+#include <iosfwd>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+
+class ossimNitfFile;
+
+/**
+ * @brief NITF info class.
+ *
+ * Encapsulates the dumpnitf functionality.
+ */
+class OSSIM_DLL ossimCcfInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimCcfInfo();
+
+   /** virtual destructor */
+   virtual ~ossimCcfInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+
+   virtual bool open(std::shared_ptr<ossim::istream>& str,
+                     const std::string& connectionString);
+   
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+   //ossimFilename theFile;
+   mutable std::shared_ptr<ossim::istream> m_fileStr;
+   std::string m_connectionString;
+};
+
+#endif /* End of "#ifndef ossimCcfInfo_HEADER" */
diff --git a/ossim/include/ossim/support_data/ossimCeosData.h b/include/ossim/support_data/ossimCeosData.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimCeosData.h
rename to include/ossim/support_data/ossimCeosData.h
diff --git a/include/ossim/support_data/ossimDemGrid.h b/include/ossim/support_data/ossimDemGrid.h
new file mode 100644
index 0000000..f98f098
--- /dev/null
+++ b/include/ossim/support_data/ossimDemGrid.h
@@ -0,0 +1,109 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class defines a DEM grid.
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimDemGrid_HEADER
+#define ossimDemGrid_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/support_data/ossimDemHeader.h>
+#include <ossim/support_data/ossimDemProfile.h>
+#include <vector>
+
+/*!
+ *  class ossimDemGrid
+ *  This class uses the DEM library to read a DEM and construct a rectangular
+ *  grid of signed 16 bit point values.
+ */
+class ossimDemGrid
+{
+public:
+
+   /*!
+    *  Missing or void data is replaced with missingDataValue.
+    */
+   ossimDemGrid(ossim_float32 missingDataValue = -32768.0);
+
+   ~ossimDemGrid();
+
+   /*!
+    *  Convertes a DEM to a rectangular grid.
+    *
+    *  If incrementalRead is false, the entire DEM will be converted
+    *  with just one call to read. 0 (zero) is returned if successful, -1
+    *  if error.
+    *
+    *  If incrementalRead is true, multiple calls to read are
+    *  required, and the return value is as follows:
+    *     >0  --  Number of calls remaining until conversion is complete.
+    *    ==0  --  Conversion was successful. No more calls to read required.
+    *     -1  --  Error during conversion.
+    */
+   long read(ossim::istream& dem, bool incrementalRead = false);
+
+   // Accessors
+   ossimDemHeader const& getHeader() const;
+
+   /*!
+    *  Returns the number of columns in the grid.
+    */
+   long getWidth() const;
+
+   /*!
+    *  Returns the number of rows in the grid.
+    */
+   long getHeight() const;
+
+   /*!
+    *  Returns the elevation value at (x,y). (0,0) is in the upper left
+    *  corner, x is positive to the right, y is positive down.
+    */
+   ossim_float32 getElevation(long x, long y) const;
+
+   /*!
+    *  Returns the value used to indicate missing data.
+    */
+   ossim_float32 getMissingDataValue() const;
+
+   /*!
+    *  (x,y) are the coordinates of a elevation value in the dem.
+    *  (ground_x, ground_y) are the coordinates of that value in the
+    *  units of the horizontal projection system used by the dem.
+    */
+   void getGroundCoords(long x, long y, double& ground_x, double& ground_y);
+
+private:
+
+   ossim_float32   _missDataVal;
+   ossimDemHeader  _header;
+   long            _width;
+   long            _height;
+   ossim_float32*  _grid;
+   bool            _firstTime; // Whether or not we've started reading the DEM.
+   long            _curProfile;
+   std::vector<ossimDemProfile> _profiles;  // Used by fillUTM()
+   double _northwest_x, _northwest_y;
+
+   void setElevation(long x, long y, ossim_float32 val);
+   long fillGeographic(ossim::istream& dem, bool incrementalRead);
+   long fillUTM(ossim::istream& dem, bool incrementalRead);
+};
+
+inline void ossimDemGrid::setElevation(long x, long y, ossim_float32 val)
+{
+   if (_grid == 0)
+      return;
+
+   _grid[(_width * y) + x] = val;
+}
+
+#endif  // #ifndef ossimDemGrid_HEADER
diff --git a/include/ossim/support_data/ossimDemHeader.h b/include/ossim/support_data/ossimDemHeader.h
new file mode 100644
index 0000000..d2ccf10
--- /dev/null
+++ b/include/ossim/support_data/ossimDemHeader.h
@@ -0,0 +1,387 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class parses a DEM header.
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimDemHeader_HEADER
+#define ossimDemHeader_HEADER 1
+
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/support_data/ossimDemPoint.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+#include <string>
+
+class ossimFilename;
+class ossimString;
+class ossimKeywordlist;
+
+class OSSIM_DLL ossimDemHeader
+{
+public:
+   
+   ossimDemHeader();
+   
+   friend OSSIM_DLL std::ostream& operator<<(ossim::ostream& s,
+                                             const ossimDemHeader& header);
+   friend OSSIM_DLL ossim::istream& operator>>(ossim::istream& s,
+                                               ossimDemHeader& header);
+
+   /**
+    * @brief open method that takes a file.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   bool open(const ossimFilename& file);
+
+   bool open(std::shared_ptr<ossim::istream>& str,  const std::string& connectionString);
+
+   /**
+    * @brief open method that takes a stream.
+    *
+    * @param is The input stream to read from.
+    *
+    * @return stream
+    */
+   ossim::istream& open(ossim::istream& is);
+
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */   
+   std::ostream& print(std::ostream& out) const;
+   
+   // Accessors
+
+   /*! Quadrangle name. */
+   std::string const& getQuadName() const;
+
+   /*! Free format desciptor field containing process information. */
+   std::string const& getProcessInfo () const;
+
+   /*!
+    *  SE geographic corner orderd as:
+    *  x == Longitude == SDDDMMSS.SSSS
+    *  (neg sign (s) right justified, no leading zeros,
+    *  plus sign (s) implied
+    */
+   double getSEGeoCornerX () const;
+
+   /*!
+    *  SE geographic corner orderd as:
+    *  y == Latitude == SDDMMSS.SSSS
+    *  (neg sign (s) right justified, no leading zeros,
+    *  plus sign (s) implied
+    */
+   double getSEGeoCornerY () const;
+
+   /*!
+    *  1 == Autocorrelation resample simple bilinear
+    *  2 == Manual profile GRIDEM simple bilinear
+    *  3 == DLG/hypsography CTOG 8-direction bilinear
+    *  4 == Interpolation from photogrammetic system contours DCASS 
+    *  4-direction bilinear
+    *  5 == DLG/hypsography LINETRACE, LT4X complex linear
+    *  6 == DLG/hypsography CPS-3, ANUDEM, GRASS complex polynomial
+    *  7 == Electronic imaging (non-photogrammetric), active or passive
+    *  sensor systems
+    */
+   ossim_int32 getProcessCode () const;
+
+   /*!
+    *  Used for 30 minute DEMs - Identifies 1:100,000 scale sections
+    *  Formatted as XNN, wher X is "S" == 7.5 min. & "F" == 15 min.
+    *  NN is a two digit sequence number
+    */
+   std::string const& getSectionIndicator() const;
+
+   /*!
+    *  Mapping Center origin code. "EMC","WMC","MCMC","RMMC","FS" and "GPM2"
+    */
+   std::string const& getMappingCenterCode() const;
+
+   /*!
+    *  1 == DEM-1
+    *  2 == DEM-2
+    *  3 == DEM-3
+    */
+   ossim_int32 getLevelCode() const;
+
+   /*!
+    *  1 == Regular
+    *  2 == Random (reserved for future use).
+    */
+   ossim_int32 getElevPattern() const;
+
+   /*!
+    *  Code defining ground planimetric reference system.
+    *  0 == Geographic
+    *  1 == UTM
+    *  2 == State Plane
+    */
+   ossim_int32 getGroundRefSysCode() const;
+
+   /*!
+    * @return The projection type as a string.
+    */
+   ossimString getProjectionType() const;
+
+   /*!
+    *  Code defining zone in ground planimetric reference system.
+    */
+   ossim_int32 getGroundRefSysZone() const;
+
+   /*!
+    *  Code defining unit of measure for ground planimetric coordinates
+    *  used throughout the file.
+    *  0 == Radians
+    *  1 == Feet
+    *  2 == Meters
+    *  3 == Arc Seconds
+    */
+   ossim_int32 getGroundRefSysUnits() const;
+
+   /*!
+    *  Code defining unit of measure for elevation coordinates used
+    *  throughout the file.
+    *  1 == Feet
+    *  2 == Meters
+    */
+   ossim_int32 getElevationUnits() const;
+
+   /*!
+    *  Set n == 4
+    */
+   ossim_int32 getNumPolySides() const;
+
+   /*!
+    *  The coordinates of the quadrangle corners are ordered in a clockwise
+    *  direction beginning with the southwest corner.
+    */
+   const ossimDemPointVector& getDEMCorners() const;
+
+   /*!
+    *  In Radians the counterclockwise angle from the primary axis of ground
+    *  planimetric reference to the primary axis of the DEM local reference
+    *  system. Set to 0 to align with the coordinate system
+    */
+   double getCounterclockAngle() const;
+
+   /*!
+    *  0 == unknown accuracy
+    *  1 == accuracy info is given in logical record type C
+    */
+   ossim_int32 getElevAccuracyCode() const;
+
+   /*!
+    *  Minimum elevation in the DEM.
+    */
+   double getMinimumElev() const;
+
+   /*!
+    *  Maximum elevation in the DEM.
+    */
+   double getMaximumElev() const;
+
+   double getSpatialResX() const;
+   double getSpatialResY() const;
+   double getSpatialResZ() const;
+
+   /*!
+    *  The number of rows and columns in profiles in the DEM. 
+    *  NOTE: When profile rows == 1, profile columns is the number of profiles
+    *  in the DEM.
+    */
+   ossim_int32 getProfileRows() const;
+   ossim_int32 getProfileColumns() const;      
+
+   /*!
+    *  Present only if two or more primary intervals exist (level 2 DEM's only)
+    */
+   ossim_int32 getLargeContInt() const;
+
+   /*!
+    *  0 == NA
+    *  1 == feet
+    *  2 == meters
+    *  (level two DEM's only)
+    */
+   ossim_int32 getMaxSourceUnits() const;
+
+   /*!
+    *  Smallest or only primary contour interval (level 2 DEM's only)
+    */
+   ossim_int32 getSmallContInt() const;
+
+   /*!
+    *  1 == feet
+    *  2 == meters
+    */
+   ossim_int32 getMinSourceUnits() const;
+
+   /*!
+    *  YYY
+    */
+   ossim_int32 getSourceDate() const;
+
+   /*!
+    *  YYY
+    */
+   ossim_int32 getInspRevDate() const;
+
+   /*!
+    *  "I" indicates all processes of part3, Quality Control have been
+    *  performed.
+    */
+   std::string const& getInspFlag() const;
+
+   /*!
+    *  0 == No Validation
+    *  1 == RSME computed from test points, no quantative test or interactive
+    *       editing/review
+    *  2 == Batch process water body edit and RSME computed from test points
+    *  3 == Review and edit, including water edit. No RSME computed from test
+    *       points
+    *  4 == Level 1 DEM's reviewed & edited. RSME computed from test points
+    *  5 == Level 2 & 3 DEM's reviewed & edited. RSME computed from test points
+    */
+   ossim_int32 getDataValFlag() const;
+
+   /*!
+    *  0 == none
+    *  1 == suspect areas
+    *  2 == void areas
+    *  3 == suspect & void areas
+    */
+   ossim_int32 getSuspectVoidFlag() const;
+
+   /*!
+    *  1 == local mean sea level
+    *  2 == National Geodetic Vertical Datum 1929
+    *  3 == North American Vertical Datum 1988
+    */
+   ossim_int32 getVertDatum() const;
+
+   /*!
+    *  1 == North Amercian Datum 1927 (NAD 27)
+    *  2 == World Geoditic System 1972 (WGS 72)
+    *  3 == WGS 84
+    *  4 == NAD 83
+    *  5 == Old Hawaii Datum
+    *  6 == Puerto Rico Datum
+    */
+   ossim_int32 getHorizDatum() const;
+
+   /**
+    * @return The ossim datum code as a string.
+    */
+   ossimString getHorizDatumCode() const;
+
+   /*!
+    *  01-99 Primarily a DMA specfic field. (For USGS use set to 01)
+    */
+   ossim_int32 getDataEdition() const;
+
+   /*!
+    *  Contains the percentage of nodes in the file set to void
+    */
+   ossim_int32 getPerctVoid() const;
+
+   /*!
+    *  West edge match status flag
+    */
+   ossim_int32 getWestEdgeFlag() const;
+
+   /*!
+    *  North edge match status flag
+    */
+   ossim_int32 getNorthEdgeFlag() const;
+
+   /*!
+    *  East edge match staus flag
+    */
+   ossim_int32 getEastEdgeFlag() const;
+
+   /*!
+    *  South edge match status flag
+    */
+   ossim_int32 getSouthEdgeFlag() const;
+
+   /*!
+    *  Vertical datum shift - value is in the form of SFFF.DD Value is
+    *  the average shift value for the four quadrangle corners obtained
+    *  from program VERTCOM.
+    */
+   double getVertDatumShift() const;
+
+   /*!
+    * Populates keyword list with geometry info.
+    * 
+    * @return true on success, false on error.
+    */
+   bool getImageGeometry(ossimKeywordlist& kwl,
+                         const char* prefix=NULL) const;
+	 
+private:
+
+   std::string _quadName;
+   std::string _processInfo;
+   double _seGeoCornerX;
+   double _seGeoCornerY;
+   ossim_int32 _processCode;
+   std::string _sectionIndicator;
+   std::string _mapCenterCode;
+   ossim_int32 _levelCode;
+   ossim_int32 _elevPattern;
+   ossim_int32 _groundRefSysCode;
+   ossim_int32 _groundRefSysZone;
+   ossim_int32 _groundRefSysUnits;
+   ossim_int32 _elevUnits;
+   ossim_int32 _numPolySides;
+   ossimDemPointVector _demCorners;
+   double _counterclockAngle;
+   ossim_int32 _elevAccuracyCode;
+   double _minElevation;
+   double _maxElevation;
+   double _spatialResX;
+   double _spatialResY;
+   double _spatialResZ;
+   ossim_int32 _profileRows;
+   ossim_int32 _profileColumns;
+   ossim_int32 _largeContInt;
+   ossim_int32 _maxSourceUnits;
+   ossim_int32 _smallContInt;
+   ossim_int32 _minSourceUnits;
+   ossim_int32 _sourceDate;
+   ossim_int32 _inspRevDate;
+   std::string _inspFlag;
+   ossim_int32 _valFlag;
+   ossim_int32 _suspectVoidFlg;
+   ossim_int32 _vertDatum;
+   ossim_int32 _horizDatum;
+   ossim_int32 _dataEdition;
+   ossim_int32 _perctVoid;
+   ossim_int32 _westEdgeFlag;
+   ossim_int32 _northEdgeFlag;
+   ossim_int32 _eastEdgeFlag;
+   ossim_int32 _southEdgeFlag;
+   double _vertDatumShift;
+};
+
+#endif  // #ifndef ossimDemHeader_HEADER
diff --git a/include/ossim/support_data/ossimDemInfo.h b/include/ossim/support_data/ossimDemInfo.h
new file mode 100644
index 0000000..e4263c5
--- /dev/null
+++ b/include/ossim/support_data/ossimDemInfo.h
@@ -0,0 +1,63 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: USGS DEM Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimDemInfo_HEADER
+#define ossimDemInfo_HEADER
+
+#include <iosfwd>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/support_data/ossimInfoBase.h>
+
+/**
+ * @brief USGS DEM info class.
+ *
+ * Encapsulates the dumpnitf functionality.
+ */
+class OSSIM_DLL ossimDemInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimDemInfo();
+
+   /** virtual destructor */
+   virtual ~ossimDemInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+   
+   virtual bool open(std::shared_ptr<ossim::istream>& str,
+                     const std::string& connectionString);
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+   //ossimFilename theFile;
+
+   mutable std::shared_ptr<ossim::istream> m_fileStr;
+   std::string m_connectionString;  
+};
+
+#endif /* End of "#ifndef ossimDemInfo_HEADER" */
diff --git a/ossim/include/ossim/support_data/ossimDemPoint.h b/include/ossim/support_data/ossimDemPoint.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimDemPoint.h
rename to include/ossim/support_data/ossimDemPoint.h
diff --git a/include/ossim/support_data/ossimDemProfile.h b/include/ossim/support_data/ossimDemProfile.h
new file mode 100644
index 0000000..ca7c017
--- /dev/null
+++ b/include/ossim/support_data/ossimDemProfile.h
@@ -0,0 +1,97 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class defines a DEM profile.
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimDemProfile_HEADER
+#define ossimDemProfile_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/support_data/ossimDemPoint.h>
+#include <vector>
+
+typedef std::vector<ossim_int32> ossimDemElevationVector;
+
+class ossimDemProfile
+{
+public:
+
+   ossimDemProfile();
+   ossimDemProfile(ossimDemProfile const& right);
+   ossimDemProfile const& operator=(ossimDemProfile const& right);
+
+   friend std::ostream& operator<<(std::ostream& s, ossimDemProfile& demp);
+   friend std::istream& operator>>(std::istream& s, ossimDemProfile& demp);
+
+   // Accessors
+
+   /*!
+    *  Row identification number. Typically set to 1.
+    */
+   ossim_int32 getRowNumber() const;
+
+   /*!
+    *  Column identification number. This is the profile sequence number.
+    */
+   ossim_int32 getColumnNumber() const;
+
+   /*!
+    *  Number of elevations in this profile.
+    */
+   ossim_int32 getNumberOfElevations() const;
+
+   /*!
+    *  Location (in ground planimetric coordinates) of the first
+    */
+   ossimDemPoint const& getProfileLocation() const;
+
+   /*!
+    *  Elevation of local datum for the profile.
+    *  Value is in units of measure given by the Elevation Units field
+    *  found in the DEM header.
+    */
+   double getLocalDatumElevation() const;
+
+   /*!
+    *  Minimum elevation for this profile.
+    */
+   double getMinimumElev() const;
+
+   /*!
+    *  Maximum elevation for this profile.
+    */
+   double getMaximumElev() const;
+
+   /*!
+   *  Elevation values.
+   *  From the DEM standard:
+   *  "A value in this array would be multiplied by the spatial resolution
+   *  value and added to the elevation of the local elevation datum for the
+   *  element profile to obtain the elevation for the point."
+   */
+   ossimDemElevationVector const& getElevations() const;
+
+private:
+
+   ossim_int32 _row;
+   ossim_int32 _column;
+   ossim_int32 _numberElevations;
+   ossimDemPoint _profileLocation;
+   double _locDatumElev;
+   double _minElev;
+   double _maxElev;
+   ossimDemElevationVector _elevations;
+};
+
+#endif  // #ifndef ossimDemProfile_HEADER
diff --git a/include/ossim/support_data/ossimDemStats.h b/include/ossim/support_data/ossimDemStats.h
new file mode 100644
index 0000000..f678e74
--- /dev/null
+++ b/include/ossim/support_data/ossimDemStats.h
@@ -0,0 +1,88 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class provides some statistics for DEMs.
+//
+//********************************************************************
+// $Id: ossimDemStats.h 7174 2005-01-11 18:10:38Z dburken $
+
+#ifndef ossimDemStats_HEADER
+#define ossimDemStats_HEADER
+
+#include <iostream>
+
+class ossimDemStats
+{
+public:
+
+   ossimDemStats();
+   ~ossimDemStats();
+
+   friend std::ostream& operator<<(std::ostream& s,
+                                   ossimDemStats const& stats);
+   friend std::istream& operator>>(std::istream& s, ossimDemStats& stats);
+
+   //Accessors
+
+   /*!
+    *  1 = available
+    *  2 = unavailable
+    *  The code defines the availability of statics
+    */
+   long getAvailCodeDE2() const;
+
+   long getRSMEDE2x () const;
+
+   long getRSMEDE2y () const;
+
+   long getRSMEDE2z () const;
+
+   /*!
+    *  This code defines the sample size use
+    *  to compute the accuracy, if 0 then the
+    *  accuracy is estimated.
+    */
+   long getSampleSizeDE2() const;
+
+   /*!
+    *  1 = available
+    *  2 = unavailable
+    *  The code defines the availability of statics
+    */
+   long getAvailCodeDE5() const;
+
+   long getRSMEDE5x () const;
+
+   long getRSMEDE5y () const;
+
+   long getRSMEDE5z () const;
+	
+   /*!
+    *  This code defines the sample size use
+    *  to compute the accuracy, if 0 then the
+    *  accuracy is estimated.
+    */
+   long getSampleSizeDE5() const;
+
+private:
+
+   long _availCodeDE2;
+   long _rsmeDE2x;
+   long _rsmeDE2y;
+   long _rsmeDE2z;
+   long _sampleSizeDE2;
+   long _availCodeDE5;
+   long _rsmeDE5x;
+   long _rsmeDE5y;
+   long _rsmeDE5z;
+   long _sampleSizeDE5;
+};
+
+#endif // #ifndef ossimDemStats_HEADER
diff --git a/include/ossim/support_data/ossimDemUtil.h b/include/ossim/support_data/ossimDemUtil.h
new file mode 100644
index 0000000..06fd5b0
--- /dev/null
+++ b/include/ossim/support_data/ossimDemUtil.h
@@ -0,0 +1,76 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class provides some simple utilities for DEMs.
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimDemUtil_HEADER
+#define ossimDemUtil_HEADER 1
+
+#include <ossim/base/ossimIosFwd.h>
+#include <string>
+#include <memory>
+
+class ossimFilename;
+
+class ossimDemUtil
+{
+public:
+
+   /**
+    * @brief Does basic sanity checks to see if file is a dem.
+    *
+    * 1) Check extension for .dem
+    *
+    * 2) Look for file.omd (ossim meta data) file containing keyword
+    *    "dem_type" with value of "usgs_dem".
+    *
+    * 3) Check 512 bytes and make sure there is no binary data.
+    *
+    * @note
+    * There is a keyword list template stored in the templates directory:
+    * "ossim/etc/templates/usgs_dem_template.kwl"
+    *
+    * @param file The file to check.
+    *
+    * @return true on success, false on error.
+    */
+   static bool isUsgsDem(const ossimFilename& file);
+   
+   static bool isUsgsDem(std::shared_ptr<ossim::istream> str, const std::string& connectionString);
+
+   /**
+    *  Reads a single record from a DEM.
+    *  Returns true if succesful. Returns false if EOF or error.
+    */
+   static bool getRecord(ossim::istream& s, std::string& strbuf, long reclength = 1024);
+
+   /**
+    *  Same as getRecord above. buf should be at least reclength+1 in size.
+    */
+   static bool getRecord(ossim::istream& s, char* buf, long reclength = 1024);
+
+   static long getLong(char* const strbuf, // string to extract long from
+                       long const startpos,  // starting position of field
+                       long const width);     // width of field
+
+   static bool getDouble(std::string const& strbuf, // string to extract double from
+                         long const startpos,  // starting position of field
+                         long const width,     // width of field
+                         double& val);         // value extracted from field.
+
+private:
+
+   ossimDemUtil();
+};
+
+#endif /* #ifndef ossimDemUtil_HEADER */
diff --git a/include/ossim/support_data/ossimDoqq.h b/include/ossim/support_data/ossimDoqq.h
new file mode 100644
index 0000000..1a59e5d
--- /dev/null
+++ b/include/ossim/support_data/ossimDoqq.h
@@ -0,0 +1,135 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//
+// Description: This class parses a Digital Ortho Quarter Quad (DOQQ)
+//              header.
+//
+//********************************************************************
+// $Id: ossimDoqq.h 19900 2011-08-04 14:19:57Z dburken $
+
+#ifndef ossimDoqq_HEADER
+#define ossimDoqq_HEADER
+
+//#include <iostream>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fstream>
+#include <iostream>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/support_data/ossimInfoBase.h>
+
+class OSSIM_DLL ossimDoqq : public ossimInfoBase
+{
+public:
+   ossimDoqq();
+   ossimDoqq(ossimFilename file);
+   ~ossimDoqq();
+   
+   enum ossimErrorStatus
+   {
+      OSSIM_OK    = 0,
+      OSSIM_ERROR = 1
+   };
+
+   enum
+   {
+      GSD_X_OFFSET            = 59,
+      GSD_Y_OFFSET            = 59,
+      DATA_ORDER_OFFSET       = 142,      
+      LINE_OFFSET             = 145,
+      SAMPLE_OFFSET           = 151,
+      PROJECTION_OFFSET       = 196,
+      RGB_OFFSET              = 157,
+      UL_EASTING_OFFSET       = 288,
+      UL_NORTHING_OFFSET      = 312,
+      UTM_ZONE_OFFSET         = 199,
+      DATUM_OFFSET            = 168,
+
+      DATA_ORDER_SIZE         = 3,
+      LINE_SIZE               = 8,
+      SAMPLE_SIZE             = 8,  
+      PROJECTION_SIZE         = 3,
+      RGB_SIZE                = 3,
+      MARKING_U_SIZE          = 5,
+      MARKING_V_SIZE          = 5,
+      UL_EASTING_SIZE         = 24,
+      UL_NORTHING_SIZE        = 24,
+      UTM_ZONE_SIZE           = 6,
+      DATUM_SIZE              = 2,
+      RADIOMETRY_SIZE         = 3,
+      GSD_SIZE              = 12
+   };
+
+   /**
+    * @brief open method.
+    *
+    * @param str stream to test.
+    * @param connectionString original string for the stream.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(std::shared_ptr<ossim::istream>& str,
+                     const std::string& connectionString);
+
+   //! Implementation of ossimInfoBase class pure virtual.
+   virtual std::ostream& print(std::ostream& out) const;
+
+   ossimString theProjection;
+   ossimString theDatum;
+   ossimString theQuadName;
+   ossimString theQuad;
+   ossimString theNation;
+   ossimString theState;
+   ossimString theDataOrder;
+   ossimString theMarkU;
+   ossimString theMarkV;
+   ossimString theImageSource;
+   ossimString theSourceImageID;
+
+   ossim_int32 theUtmZone;
+   ossim_int32 theLine;
+   ossim_int32 theSample;
+   ossim_int32 theRgb;
+
+   ossimString theAcqYear;
+   ossimString theAcqMonth;
+   ossimString theAcqDay;
+   ossimString theAcqYearMonthDay;
+
+   ossim_float64 theRMSE;
+
+   ossim_float64   theEasting;
+   ossim_float64   theNorthing;
+   ossim_float64   theUN;
+   ossim_float64   theUE;
+   ossim_float64   theLN;
+   ossim_float64   theLE;
+   ossimDpt        theGsd;
+   ossim_int32     theHeaderSize;
+   ossim_int32     theRecordSize;
+
+   ossim_int32 errorStatus() const { return theErrorStatus; }
+   
+private:
+
+   mutable std::shared_ptr<ossim::istream> m_doqqFileStr;
+   std::string                     m_connectionString;
+   ossimErrorStatus   theErrorStatus;
+   
+   ossim_float64 convertStr(const char* str) const;
+
+   void ldstr_v1(std::istream& in);
+   void ldstr_v2(std::istream& in);
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimDtedAcc.h b/include/ossim/support_data/ossimDtedAcc.h
new file mode 100644
index 0000000..5674d64
--- /dev/null
+++ b/include/ossim/support_data/ossimDtedAcc.h
@@ -0,0 +1,136 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the Accuracy Description
+//               (ACC) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedAcc.h 16104 2009-12-17 18:09:59Z gpotts $
+
+#ifndef ossimDtedAcc_H
+#define ossimDtedAcc_H
+#include <iosfwd>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+
+class ossimProperty;
+
+class OSSIM_DLL ossimDtedAcc : public ossimErrorStatusInterface
+{
+public:
+  ossimDtedAcc();
+  ossimDtedAcc(std::shared_ptr<ossim::istream>& str, ossim_int64 offset=0);
+   enum
+   {
+      ACC_LENGTH = 2700,
+      ACC_ABSOLUTE_CE = 4,
+      ACC_ABSOLUTE_LE = 8,
+      ACC_RELATIVE_CE = 12,
+      ACC_RELATIVE_LE = 16,
+      ACC_RESERVED_1 = 20,
+      ACC_RESERVED_2 = 24,
+      ACC_RESERVED_3 = 25,
+      ACC_MULTIPLE_FLAG = 56,
+      ACC_RESERVED = 58,
+      FIELD1_SIZE           = 3,
+      FIELD2_SIZE           = 4,
+      FIELD3_SIZE           = 4,
+      FIELD4_SIZE           = 4,
+      FIELD5_SIZE           = 4,
+      FIELD6_SIZE           = 4,
+      FIELD7_SIZE           = 1,
+      FIELD8_SIZE           = 31,
+      FIELD9_SIZE           = 2,
+      FIELD10_SIZE          = 4,
+      FIELD11_SIZE          = 4,
+      FIELD12_SIZE          = 4,
+      FIELD13_SIZE          = 4,
+      FIELD14_SIZE          = 2,
+      FIELD15_SIZE          = 9,
+      FIELD16_SIZE          = 10,
+      FIELD17_SIZE          = 18,
+      FIELD18_SIZE          = 69
+   };
+
+   // The Recoginition Sentinel signifies if the ACC record exists.
+
+   ossim_int32 absCE() const;
+   ossim_int32 absLE() const;
+   ossim_int32 relCE() const;
+   ossim_int32 relLE() const;
+   
+   ossim_int32 startOffset() const;
+   ossim_int32 stopOffset()  const;
+   
+   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
+                                              const ossimDtedAcc& acc);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix) const;
+   
+   void parse(std::istream& in);
+
+   void clearFields();
+
+   /**
+    * @brief Gets a property for name.
+    * @param name Property name to get.
+    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
+    * property for name was not found.
+    */
+   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+
+   /**
+    * @brief Adds this class's properties to list.
+    * @param propertyNames list to append to.
+    */
+   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+private:
+   // Do not allow...
+   ossimDtedAcc(const ossimDtedAcc& source);
+   const ossimDtedAcc& operator=(const ossimDtedAcc& rhs);
+
+   
+   char theRecSen[FIELD1_SIZE+1];
+   char theAbsoluteCE[FIELD2_SIZE+1];
+   char theAbsoluteLE[FIELD3_SIZE+1];
+   char theRelativeCE[FIELD4_SIZE+1];
+   char theRelativeLE[FIELD5_SIZE+1];
+   char theField6[FIELD6_SIZE+1];
+   char theField7[FIELD7_SIZE+1];
+   char theField8[FIELD8_SIZE+1];
+   char theField9[FIELD9_SIZE+1];
+   char theField10[FIELD10_SIZE+1];
+   char theField11[FIELD11_SIZE+1];
+   char theField12[FIELD12_SIZE+1];
+   char theField13[FIELD13_SIZE+1];
+   char theField14[FIELD14_SIZE+1];
+   char theField15[FIELD15_SIZE+1];
+   char theField16[FIELD16_SIZE+1];
+   char theField17[FIELD17_SIZE+1];
+   
+   ossim_int32 theStartOffset;
+   ossim_int32 theStopOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimDtedDsi.h b/include/ossim/support_data/ossimDtedDsi.h
new file mode 100644
index 0000000..dd20410
--- /dev/null
+++ b/include/ossim/support_data/ossimDtedDsi.h
@@ -0,0 +1,239 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the Data Set Identification
+//               (DSI) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedDsi.h 16104 2009-12-17 18:09:59Z gpotts $
+
+#ifndef ossimDtedDsi_H
+#define ossimDtedDsi_H
+#include <iosfwd>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+
+class ossimProperty;
+
+class OSSIM_DLL ossimDtedDsi : public ossimErrorStatusInterface
+{
+public:
+   ossimDtedDsi();
+  ossimDtedDsi(std::shared_ptr<ossim::istream>& str, ossim_int64 offset=0);
+
+   enum
+   {
+      DSI_LENGTH = 648,
+      DSI_SECURITY_CODE = 4,
+      DSI_SECURITY_CONTROL = 5,
+      DSI_SECURITY_HANDLING = 7,
+      DSI_RESERVED_1 = 34,
+      DSI_DMA_SERIES = 60,
+      DSI_RESERVED_2 = 65,
+      DSI_RESERVED_3 = 80,
+      DSI_DATA_EDITION = 88,
+      DSI_MATCH_MERGE_VERSION = 90,
+      DSI_MAINTENANCE_DATE = 91,
+      DSI_MATCH_MERGE_DATE = 95,
+      DSI_MAINTENANCE_CODE = 99,
+      DSI_PRODUCER_CODE = 103,
+      DSI_RESERVED_4 = 111,
+      DSI_PRODUCT_SPEC_STOCK_NUMBER = 127, 
+      DSI_PRODUCT_SPEC_NUMBER = 136,
+      DSI_PRODUCT_SPEC_DATE = 138,
+      DSI_VERTICAL_DATUM = 142,
+      DSI_HORIZ_DATUM = 145,
+      DSI_DIGITIZING_SYSTEM = 150,
+      DSI_COMPILATION_DATE = 160,
+      DSI_RESERVED_5 = 164,
+      DSI_LAT_ORIGIN = 186,
+      DSI_LON_ORIGIN = 195,
+      DSI_LAT_SW = 205,
+      DSI_LON_SW = 212,
+      DSI_LAT_NW = 220,
+      DSI_LON_NW = 227,
+      DSI_LAT_NE = 235,
+      DSI_LON_NE = 242,
+      DSI_LAT_SE = 250,
+      DSI_LON_SE = 257,
+      DSI_ORIENTATION = 265,
+      DSI_LAT_INTERVAL = 274,
+      DSI_LON_INTERVAL = 278,
+      DSI_NUM_LAT_LINES = 282,
+      DSI_NUM_LON_LINES = 286,
+      DSI_PARTIAL_CELL_INDICATOR = 290,
+      DSI_RESERVED = 292,
+      FIELD1_SIZE           = 3,
+      FIELD2_SIZE           = 1,
+      FIELD3_SIZE           = 2,
+      FIELD4_SIZE           = 27,
+      FIELD5_SIZE           = 26,
+      FIELD6_SIZE           = 5,
+      FIELD7_SIZE           = 15,
+      FIELD8_SIZE           = 8,
+      FIELD9_SIZE           = 2,
+      FIELD10_SIZE          = 1,
+      FIELD11_SIZE          = 4,
+      FIELD12_SIZE          = 4,
+      FIELD13_SIZE          = 4,
+      FIELD14_SIZE          = 8,
+      FIELD15_SIZE          = 16,
+      FIELD16_SIZE          = 9,
+      FIELD17_SIZE          = 2,
+      FIELD18_SIZE          = 4,
+      FIELD19_SIZE          = 3,
+      FIELD20_SIZE          = 5,
+      FIELD21_SIZE          = 10,
+      FIELD22_SIZE          = 4,
+      FIELD23_SIZE          = 22,
+      FIELD24_SIZE          = 9,
+      FIELD25_SIZE          = 10,
+      FIELD26_SIZE          = 7,
+      FIELD27_SIZE          = 8,
+      FIELD28_SIZE          = 7,
+      FIELD29_SIZE          = 8,
+      FIELD30_SIZE          = 7,
+      FIELD31_SIZE          = 8,
+      FIELD32_SIZE          = 7,
+      FIELD33_SIZE          = 8,
+      FIELD34_SIZE          = 9,
+      FIELD35_SIZE          = 4,
+      FIELD36_SIZE          = 4,
+      FIELD37_SIZE          = 4,
+      FIELD38_SIZE          = 4,
+      FIELD39_SIZE          = 2,
+      FIELD40_SIZE          = 101,
+      FIELD41_SIZE          = 100,
+      FIELD42_SIZE          = 156
+   };
+
+   // The Recognition Sentinel signifies if the DSI record exists.
+   ossimString recognitionSentinel() const;
+
+   ossimString securityCode()           const;
+   ossimString productLevel()           const;
+   ossimString edition()                const;
+   ossimString matchMergeVersion()      const;
+   ossimString maintanenceDate()        const;
+   ossimString matchMergeDate()         const;
+   ossimString maintenanceCode()        const;
+   ossimString producerCode()           const;
+   ossimString productStockSpecNumber() const;
+   ossimString productSpecNumber()      const;
+   ossimString productSpecDate()        const;
+   ossimString verticalDatum()          const;
+   ossimString horizontalDatum()        const;
+   ossimString compilationDate()        const;
+   ossimString latOrigin()              const;
+   ossimString lonOrigin()              const;
+   ossimString latSW()                  const;
+   ossimString lonSW()                  const;
+   ossimString latNW()                  const;
+   ossimString lonNW()                  const;
+   ossimString latNE()                  const;
+   ossimString lonNE()                  const;
+   ossimString latSE()                  const;
+   ossimString lonSE()                  const;
+
+   ossimString orientation()    const;
+   ossimString latInterval()    const;
+   ossimString lonInterval()    const;
+   ossim_int32 numLatPoints()   const;
+   ossim_int32 numLonLines()    const;
+   ossim_int32 cellIndicator()  const;
+   ossim_int32 startOffset()    const;
+   ossim_int32 stopOffset()     const;
+   
+   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
+                                              const ossimDtedDsi& dsi);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix) const;   
+   
+   void parse(std::istream& in);
+
+   /**
+    * @brief Gets a property for name.
+    * @param name Property name to get.
+    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
+    * property for name was not found.
+    */
+   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   
+   /**
+    * @brief Adds this class's properties to list.
+    * @param propertyNames list to append to.
+    */
+   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+private:
+   // Do not allow...
+   ossimDtedDsi(const ossimDtedDsi& source);
+   const ossimDtedDsi& operator=(const ossimDtedDsi& rhs);
+
+   
+   char theRecSen[FIELD1_SIZE+1];
+   char theSecurityCode[FIELD2_SIZE+1];
+   char theField3[FIELD3_SIZE+1];
+   char theField4[FIELD4_SIZE+1];
+   char theProductLevel[FIELD6_SIZE+1];
+   char theField7[FIELD7_SIZE+1];
+   char theField8[FIELD8_SIZE+1];
+   char theEdition[FIELD9_SIZE+1];
+   char theMatchMergeVersion[FIELD10_SIZE+1];
+   char theMaintenanceDate[FIELD11_SIZE+1];
+   char theMatchMergeDate[FIELD12_SIZE+1];
+   char theMaintenanceCode[FIELD13_SIZE+1];
+   char theProducerCode[FIELD14_SIZE+1];
+   char theField15[FIELD15_SIZE+1];
+   char theProductStockSpecNumber[FIELD16_SIZE+1];
+   char theProductSpecNumber[FIELD17_SIZE+1];
+   char theProductSpecDate[FIELD18_SIZE+1];
+   char theVerticalDatum[FIELD19_SIZE+1];
+   char theHorizontalDatum[FIELD20_SIZE+1];
+   char theField21[FIELD21_SIZE+1];
+   char theCompilationDate[FIELD22_SIZE+1];
+   char theField23[FIELD23_SIZE+1];
+   char theLatOrigin[FIELD24_SIZE+1];
+   char theLonOrigin[FIELD25_SIZE+1];
+   char theLatSW[FIELD26_SIZE+1];
+   char theLonSW[FIELD27_SIZE+1];
+   char theLatNW[FIELD28_SIZE+1];
+   char theLonNW[FIELD29_SIZE+1];
+   char theLatNE[FIELD30_SIZE+1];
+   char theLonNE[FIELD31_SIZE+1];
+   char theLatSE[FIELD32_SIZE+1];
+   char theLonSE[FIELD33_SIZE+1];
+   char theOrientation[FIELD34_SIZE+1];
+   char theLatInterval[FIELD35_SIZE+1];
+   char theLonInterval[FIELD36_SIZE+1];
+   char theNumLatPoints[FIELD37_SIZE+1];
+   char theNumLonLines[FIELD38_SIZE+1];
+   char theCellIndicator[FIELD39_SIZE+1];
+   char theField40[FIELD40_SIZE+1];
+   char theField41[FIELD41_SIZE+1];
+   char theField42[FIELD42_SIZE+1];
+   
+   ossim_int32       theStartOffset;
+   ossim_int32       theStopOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimDtedHdr.h b/include/ossim/support_data/ossimDtedHdr.h
new file mode 100644
index 0000000..df8e933
--- /dev/null
+++ b/include/ossim/support_data/ossimDtedHdr.h
@@ -0,0 +1,129 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the File Header Label
+//               (HDR) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedHdr.h 16104 2009-12-17 18:09:59Z gpotts $
+
+#ifndef ossimDtedHdr_H
+#define ossimDtedHdr_H
+#include <iosfwd>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+
+class ossimProperty;
+
+class OSSIM_DLL ossimDtedHdr : public ossimErrorStatusInterface
+{
+public:
+  ossimDtedHdr();
+  ossimDtedHdr(std::shared_ptr<ossim::istream>& str, ossim_int64 offset=0);
+
+   enum
+   {
+      HDR_LENGTH            = 80,
+      HDR_ONE_LABEL_1       =  4,
+      HDR_FILENAME          =  5,
+      HDR_UNIVAC            = 22,
+      HDR_REEL              = 28,
+      HDR_FILE_NUM          = 32,
+      HDR_GENERATION_NUM    = 36,
+      HDR_VERSION_NUM       = 40,
+      HDR_CREATION_DATE     = 42,
+      HDR_EXPIRATION_DATE   = 48,
+      HDR_ACCESS            = 54,
+      HDR_BLOCK_COUNT       = 55,
+      HDR_QUALIFIER         = 61,
+      HDR_BLANKS            = 74,
+      FIELD1_SIZE           = 3,
+      FIELD2_SIZE           = 1,
+      FIELD3_SIZE           = 17,
+      FIELD4_SIZE           = 6,
+      FIELD5_SIZE           = 4,
+      FIELD6_SIZE           = 4,
+      FIELD7_SIZE           = 4,
+      FIELD8_SIZE           = 2,
+      FIELD9_SIZE           = 6,
+      FIELD10_SIZE          = 6,
+      FIELD11_SIZE          = 1,
+      FIELD12_SIZE          = 6,
+      FIELD13_SIZE          = 13,
+      FIELD14_SIZE          = 7
+   };
+
+   // The Recognition Sentinel signifies if the HDR record exists.
+   ossimString recognitionSentinel() const;
+
+   ossimString fileName()     const;
+   ossimString version()      const;
+   ossimString creationDate() const;
+   ossim_int32 startOffset()  const;
+   ossim_int32 stopOffset()   const;
+
+   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
+                                              const ossimDtedHdr& hdr);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix) const;
+
+   void parse(std::istream& in);
+
+   /**
+    * @brief Gets a property for name.
+    * @param name Property name to get.
+    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
+    * property for name was not found.
+    */
+   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+
+   /**
+    * @brief Adds this class's properties to list.
+    * @param propertyNames list to append to.
+    */
+   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+private:
+   // Do not allow...
+   ossimDtedHdr(const ossimDtedHdr& source);
+   const ossimDtedHdr& operator=(const ossimDtedHdr& rhs);
+   
+   char theRecSen[FIELD1_SIZE+1];
+   char theField2[FIELD2_SIZE+1];
+   char theFilename[FIELD3_SIZE+1];
+   char theField4[FIELD4_SIZE+1];
+   char theField5[FIELD5_SIZE+1];
+   char theField6[FIELD6_SIZE+1];
+   char theVersion[FIELD7_SIZE+1];
+   char theCreationDate[FIELD8_SIZE+1];
+   char theField9[FIELD9_SIZE+1];
+   char theField10[FIELD10_SIZE+1];
+   char theField11[FIELD11_SIZE+1];
+   char theField12[FIELD12_SIZE+1];
+   char theField13[FIELD13_SIZE+1];
+   char theField14[FIELD14_SIZE+1];
+   
+   ossim_int32 theStartOffset;
+   ossim_int32 theStopOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimDtedInfo.h b/include/ossim/support_data/ossimDtedInfo.h
new file mode 100644
index 0000000..46c27fa
--- /dev/null
+++ b/include/ossim/support_data/ossimDtedInfo.h
@@ -0,0 +1,92 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: DTED Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimDtedInfo_HEADER
+#define ossimDtedInfo_HEADER
+
+#include <iosfwd>
+#include <vector>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/support_data/ossimDtedVol.h>
+#include <ossim/support_data/ossimDtedHdr.h>
+#include <ossim/support_data/ossimDtedUhl.h>
+#include <ossim/support_data/ossimDtedDsi.h>
+#include <ossim/support_data/ossimDtedAcc.h>
+
+class ossimNitfFile;
+class ossimProperty;
+
+/**
+ * @brief DTED Info class.
+ *
+ * Encapsulates the dtedInfo functionality.
+ */
+class OSSIM_DLL ossimDtedInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimDtedInfo();
+
+   /** virtual destructor */
+   virtual ~ossimDtedInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param str stream to test.
+    * @param connectionString original string for the stream.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(std::shared_ptr<ossim::istream>& str,
+                     const std::string& connectionString);
+   
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief Gets a property for name.
+    * @param name Property name to get.
+    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
+    * property for name was not found.
+    */
+   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   
+   /**
+    * @brief Adds this class's properties to list.
+    * @param propertyNames list to append to.
+    */
+   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+private:
+  mutable std::shared_ptr<ossim::istream> m_dtedFileStr;
+  std::string  m_connectionString;
+  ossimDtedVol m_vol;
+  ossimDtedHdr m_hdr;
+  ossimDtedUhl m_uhl;
+  ossimDtedDsi m_dsi;
+  ossimDtedAcc m_acc;
+
+   //ossimFilename theFile;
+};
+
+#endif /* End of "#ifndef ossimDtedInfo_HEADER" */
diff --git a/include/ossim/support_data/ossimDtedRecord.h b/include/ossim/support_data/ossimDtedRecord.h
new file mode 100644
index 0000000..9772b23
--- /dev/null
+++ b/include/ossim/support_data/ossimDtedRecord.h
@@ -0,0 +1,164 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the Data Record Description
+//               of a DTED Level 1 file.
+//
+// Notes:  Each elevation is a true value referenced to meas sea level
+//         (MSL) datum recorded to the nearest meter.  The horizontal
+//         position is referenced to precise longitude-latitiude
+//         locations in terms of the current World Geodetic System
+//         (WGS84) determined for each file by reference to the origin
+//         at the southwest corner.  The elevations are evenly spaced
+//         in latitude and longitude at the interval designated in the
+//         User Header Label (UHL) in South to North profile sequence.
+//
+//********************************************************************
+// $Id: ossimDtedRecord.h 14248 2009-04-08 19:38:11Z dburken $
+#ifndef ossimDtedRecord_H
+#define ossimDtedRecord_H
+#include <iosfwd>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+
+class OSSIM_DLL ossimDtedRecord : public ossimErrorStatusInterface
+{
+public:
+   ossimDtedRecord(std::istream& in,
+                   ossim_int32 offest,
+                   ossim_int32 num_points);
+   // NOTE:  When using this class be sure that as you cycle through
+   //        all the points within a record, that you verify they are
+   //        sequential.  According to the DTED Specification
+   //        (MIL-PRF-89020A) issued in 19 April 1996, page 22 all
+   //        records must be sequential.  If not, file may be corrupt.
+   //
+   //        To verify this, you can do the following:
+   //
+   //        int count = 0;
+   //        for(int i = 0; i < num_lon_lines; i++)
+   //          rec[i] = new ossimDtedRecord(theFileDesc, offset,
+   //                       num_lat_points);
+   //          if(count != (rec[i]->dataBlockCount() + 1))
+   //             ERROR -- Records are not sequential
+   //          count = rec[i]->dataBlockCount();
+
+   ~ossimDtedRecord();
+   
+   enum
+   {
+      DATA_LENGTH = 12,
+      DATA_BLOCK_COUNT = 2,
+      DATA_LON_COUNT = 4,
+      DATA_LAT_COUNT = 6,
+      DATA_ELEV_START = 8,
+      DATA_BYTES_PER_POINT = 2,
+   };
+
+   // The Recognition Sentinel signifies if the Data Record exists.
+   ossimString recognitionSentinel() const;
+
+   ossim_int32  dataBlockCount()   const;
+   ossim_int32  lonCount()         const;
+   ossim_int32  latCount()         const;
+   ossim_uint32 checkSum()         const;
+   ossim_uint32 computedCheckSum() const;
+   ossim_int32  numPoints()        const;
+
+   // Access methods for the elevation data
+   ossim_int32   getPoint(ossim_int32 i)     const;
+   ossim_uint16  getPointData(ossim_int32 i) const;
+   ossim_int32*  points()                    const;
+   ossim_uint16* pointsData()                const;
+   
+   ossim_int32 startOffset() const;
+   ossim_int32 stopOffset()  const;
+
+   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
+                                              const ossimDtedRecord& rec);
+   void parse(std::istream& in);
+
+private:
+   // prevent use
+   ossimDtedRecord(const ossimDtedRecord& source);
+
+   ossim_int32  theFile;
+
+   /*!
+    * 252 (8 bit)
+    */
+   ossimString theRecSen;
+
+   /*!
+    *  Sequential count of the block within the file.
+    */
+   ossim_int32  theDataBlockCount;
+
+   /*!
+    *  Count of the meridian.
+    *  True longitude = longitude count x data interval + origin
+    *  (Offset from the SW corner longitude)
+    */
+   ossim_int32  theLonCount;
+
+   /*!
+    *  Count of the parallel.
+    *  True latitude = latitude count x data interval + origin
+    *  (Offset from the SW corner latitude)
+    */
+   ossim_int32  theLatCount;
+
+   /*!
+    *  Algebraic addition of contents of block.
+    *  The checksum is computed algebraically using integer arithmetic by
+    *  summing all header and elevation bytes contained int the record as
+    *  8-bit values.  Each byte is considered an unsigned, 8-bit value for
+    *  checksum calculation.
+    */
+   ossim_uint32  theCheckSum;
+
+   /*!
+    *  All the elevation points in a Data Record as ints.
+    *  (ie. all the latitudal points in a longitudinal line)
+    */
+   ossim_int32* thePoints;
+
+   /*!
+    *  All the elevation points in a Data Record as unsigned shorts.
+    *  (ie. all the latitudal points in a longitudinal line)
+    */
+   ossim_uint16* thePointsData;
+
+   /*!
+    *  Our computed check sum.  This should match the checksum
+    *  at the end of the Data Record.
+    */
+   ossim_uint32  theComputedCheckSum;
+
+   /*!
+    *  The number of points in a longitudinal line.
+    */
+   ossim_int32  theNumPoints;
+
+   ossim_int32  theStartOffset;
+   ossim_int32  theStopOffset;
+
+   /*!
+    *  Compute the check sum for the Data Record and compare against
+    *  the parsed check sum from the data record. This must be correct
+    *  to be a valid data record. If not, there is a chance of a
+    *  corrupted elevation cell.
+    *
+    *  @return true if check sum validates, false if not.
+    */
+   bool validateCheckSum(std::istream& in);
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimDtedUhl.h b/include/ossim/support_data/ossimDtedUhl.h
new file mode 100644
index 0000000..ff5c34a
--- /dev/null
+++ b/include/ossim/support_data/ossimDtedUhl.h
@@ -0,0 +1,132 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the User Header Label
+//               (UHL) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedUhl.h 16104 2009-12-17 18:09:59Z gpotts $
+#ifndef ossimDtedUhl_H
+#define ossimDtedUhl_H
+#include <iosfwd>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+
+class ossimProperty;
+
+class OSSIM_DLL ossimDtedUhl : public ossimErrorStatusInterface
+{
+public:
+  ossimDtedUhl();
+  ossimDtedUhl(std::shared_ptr<ossim::istream>& str, ossim_int64 offset=0);
+
+   enum
+   {
+      UHL_LENGTH        = 80,
+      UHL_LON_ORIGIN    =  5,
+      UHL_LAT_ORIGIN    = 13,
+      UHL_LON_INTERVAL  = 21,
+      UHL_LAT_INTERVAL  = 25,
+      UHL_ABSOLUTE_LE   = 29,
+      UHL_SECURITY_CODE = 33,
+      UHL_REFERENCE_NUM = 33,
+      UHL_NUM_LON_LINES = 48,
+      UHL_NUM_LAT_LINES = 52,
+      UHL_MULTIPLE_ACC  = 56,
+      UHL_RESERVED      = 57,
+      FIELD1_SIZE       = 3,
+      FIELD2_SIZE       = 1,
+      FIELD3_SIZE       = 8,
+      FIELD4_SIZE       = 8,
+      FIELD5_SIZE       = 4,
+      FIELD6_SIZE       = 4,
+      FIELD7_SIZE       = 4,
+      FIELD8_SIZE       = 3,
+      FIELD9_SIZE       = 12,
+      FIELD10_SIZE      = 4,
+      FIELD11_SIZE      = 4,
+      FIELD12_SIZE      = 1,
+      FIELD13_SIZE      = 24
+   };
+   
+   // The Recognition Sentinel signifies if the UHL record exists.
+   ossimString recognitionSentinel() const;
+
+   double      lonOrigin()        const;
+   double      latOrigin()        const;
+   double      lonInterval()      const;
+   double      latInterval()      const;
+   double      absoluteLE()       const;
+   ossimString securityCode()     const;
+   ossim_int32 numLonLines()      const;
+   ossim_int32 numLatPoints()     const;
+   ossim_int32 mulitpleAccuracy() const;
+   ossim_int32 startOffset()      const;
+   ossim_int32 stopOffset()       const;
+   
+   friend OSSIM_DLL std::ostream& operator<<( std::ostream& out,
+                                              const ossimDtedUhl& uhl);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix) const;
+
+   void parse(std::istream& in);
+
+   /**
+    * @brief Gets a property for name.
+    * @param name Property name to get.
+    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
+    * property for name was not found.
+    */
+   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+
+   /**
+    * @brief Adds this class's properties to list.
+    * @param propertyNames list to append to.
+    */
+   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+private:
+   // Do not allow...
+   ossimDtedUhl(const ossimDtedUhl& source);
+   const ossimDtedUhl& operator=(const ossimDtedUhl& rhs);
+
+   double degreesFromString(const char* str) const;
+   double spacingFromString(const char* str) const;
+   
+   char theRecSen[FIELD1_SIZE+1];
+   char theField2[FIELD2_SIZE+1];
+   char theLonOrigin[FIELD3_SIZE+1];
+   char theLatOrigin[FIELD4_SIZE+1];
+   char theLonInterval[FIELD5_SIZE+1];
+   char theLatInterval[FIELD6_SIZE+1];
+   char theAbsoluteLE[FIELD7_SIZE+1];
+   char theSecurityCode[FIELD8_SIZE+1];
+   char theField9[FIELD9_SIZE+1];
+   char theNumLonLines[FIELD10_SIZE+1];
+   char theNumLatPoints[FIELD11_SIZE+1];
+   char theMultipleAccuracy[FIELD12_SIZE+1];
+   
+   ossim_int32 theStartOffset;
+   ossim_int32 theStopOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimDtedVol.h b/include/ossim/support_data/ossimDtedVol.h
new file mode 100644
index 0000000..40e6829
--- /dev/null
+++ b/include/ossim/support_data/ossimDtedVol.h
@@ -0,0 +1,110 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the Volume Header Label
+//               (VOL) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedVol.h 16104 2009-12-17 18:09:59Z gpotts $
+
+#ifndef ossimDtedVol_H
+#define ossimDtedVol_H
+
+#include <iosfwd>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+
+class ossimProperty;
+
+class OSSIM_DLL ossimDtedVol : public ossimErrorStatusInterface
+{
+public:
+  ossimDtedVol();
+  ossimDtedVol(std::shared_ptr<ossim::istream>& str, ossim_int64 offset=0);
+
+   enum
+   {
+      VOL_LENGTH            = 80,
+      VOL_ONE_LABEL_1       =  4,
+      VOL_REEL_NUMBER       =  5,
+      VOL_REEL_ACCESS       = 11,
+      VOL_SPACE             = 12,
+      VOL_ACCOUNT_NUMBER    = 38,
+      VOL_BLANKS            = 52,
+      VOL_ONE_LABEL_2       = 80,
+      FIELD1_SIZE           = 3,
+      FIELD2_SIZE           = 1,
+      FIELD3_SIZE           = 6,
+      FIELD4_SIZE           = 1,
+      FIELD5_SIZE           = 26,
+      FIELD6_SIZE           = 14,
+      FIELD7_SIZE           = 28,
+      FIELD8_SIZE           = 1
+   };
+   
+   // The Recognition Sentinel signifies if the VOL record exists.
+   ossimString getRecognitionSentinel() const;
+   ossimString getReelNumber()           const;
+   ossimString getAccountNumber()        const;
+   ossim_int32 startOffset()             const;
+   ossim_int32 stopOffset()              const;
+   
+   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
+                                              const ossimDtedVol& vol);
+   
+   void parse(std::istream& in);
+
+   /**
+    * @brief Gets a property for name.
+    * @param name Property name to get.
+    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
+    * property for name was not found.
+    */
+   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+
+   /**
+    * @brief Adds this class's properties to list.
+    * @param propertyNames list to append to.
+    */
+   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix) const;
+private:
+   // Do not allow...
+   ossimDtedVol(const ossimDtedVol& source);
+   const ossimDtedVol& operator=(const ossimDtedVol& rhs);
+
+   char theRecSen[FIELD1_SIZE+1];
+   char theField2[FIELD2_SIZE+1];
+   char theReelNumber[FIELD3_SIZE+1];
+   char theField4[FIELD4_SIZE+1];
+   char theField5[FIELD5_SIZE+1];
+   char theAccountNumber[FIELD6_SIZE+1];
+   char theField7[FIELD7_SIZE+1];
+   char theField8[FIELD8_SIZE+1];
+  
+   ossim_int32 theStartOffset;
+   ossim_int32 theStopOffset;
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimERS.h b/include/ossim/support_data/ossimERS.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimERS.h
rename to include/ossim/support_data/ossimERS.h
diff --git a/include/ossim/support_data/ossimEnviHeader.h b/include/ossim/support_data/ossimEnviHeader.h
new file mode 100644
index 0000000..a24edc8
--- /dev/null
+++ b/include/ossim/support_data/ossimEnviHeader.h
@@ -0,0 +1,415 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Class for reading and writing an ENVI (The Environment for Visualizing
+// Images) header file.  This parses envi header and places in a keyword
+// list.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimEnviHeader.h 22349 2013-08-01 21:38:29Z dburken $
+
+#ifndef ossimEnviHeader_HEADER
+#define ossimEnviHeader_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimReferenced.h>
+#include <iosfwd>
+
+/**
+ * Class for reading and writing an ENVI (The Environment for Visualizing
+ * Images) header file.
+ */
+class OSSIM_DLL ossimEnviHeader : public ossimReferenced
+{
+public:
+   /** default construtor */
+   ossimEnviHeader();
+
+   /** virtual destructor */
+   virtual ~ossimEnviHeader();
+
+   virtual void reset();
+
+   /** @return Const reference to map. */
+   const ossimKeywordlist& getMap() const;
+   
+   /** @return Reference to map. */
+   ossimKeywordlist& getMap();
+
+   /**
+    * @brief Gets value for key.
+    * @param key To search for.
+    * @param value Initialized by this.
+    * @return true on success, false on error. This will return true if key is
+    * found, even if value is empty.
+    */
+   bool getValue( const ossimString& key, ossimString& value ) const;
+
+   /**
+    * @brief Gets value for key.
+    * @param key
+    * @param value
+    * @return true if key is in map even if value is empty; false, if not.
+    */
+   bool findCaseInsensitive( const ossimString& key,
+                             ossimString& value ) const;
+
+   /**
+    * @brief Gets value for key.
+    * @param key
+    * @param value
+    * @return true if key is in map even if value is empty; false, if not.
+    */
+   bool findSubStringCaseInsensitive( const ossimString& key,
+                                      ossimString& value) const;
+
+   /**
+    * Opens an envi header.
+    * 
+    * @return true on success, false on error.
+    */
+   bool open(const ossimFilename& file);
+
+   /**
+    * Writes header to file in a standard envi format.
+    *
+    * @param file File to write to.
+    *
+    * @return true on success, false on error.
+    */
+   bool writeFile(const ossimFilename& file);
+   
+   /**
+    * Prints header to out in a standard envi format.
+    *
+    * @param out Stream to write to.
+    *
+    * @return Reference to the stream passed.
+    */
+   std::ostream& print(std::ostream& out) const;
+
+   /** @brief friend operator<< */
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out,
+                                             const ossimEnviHeader& obj);
+
+   /**
+    * @return The description of the file.
+    */
+   ossimString getDescription() const;
+
+   /**
+    * @param description The description of the file.
+    */
+   void setDescription(const ossimString& description);
+
+   /**
+    * @return The number of samples.
+    */
+   ossim_uint32 getSamples() const;
+
+   /**
+    * Sets the number of samples.
+    * 
+    * @param samples The number of samples.
+    */
+   void setSamples(ossim_uint32 samples);
+
+   /**
+    * @return The number of lines.
+    */
+   ossim_uint32 getLines() const;
+
+   /**
+    * Sets the number of lines.
+    * 
+    * @param lines The number of lines.
+    */
+   void setLines(ossim_uint32 lines);
+
+   /**
+    * @return The number of bands.
+    */
+   ossim_uint32 getBands() const;
+
+   /**
+    * Sets the number of bands.
+    * 
+    * @param bands The number of bands.
+    */
+   void setBands(ossim_uint32 bands);
+
+   /**
+    * @brief Gets default bands if "default bands" keyword is present.
+    * @param bands Initialized by this.
+    * @return true on success, false if keyword not found. "bands" will be
+    * zeroed out on failure. 
+    */
+   bool getDefaultBands( std::vector<ossim_uint32>& bands ) const;
+
+   /**
+    * @brief Gets rgb bands if "wavelength" keyword is present.
+    * @param bands Initialized by this.
+    * @return true on success, false if keyword not found.  "bands" will be
+    * zeroed out on failure.
+    */   
+   bool getRgbBandsFromWaveLength( std::vector<ossim_uint32>& bands ) const;
+
+   /**
+    * @return The number of header offset in bytes.
+    */
+   ossim_uint32 getHeaderOffset() const;
+
+   /**
+    * Sets the header offset in bytes.
+    * 
+    * @param headerOffset The number of header offset in bytes.
+    */
+   void setHeaderOffset(ossim_uint32 headerOffset);
+
+   /**
+    * @return The file type
+    */
+   ossimString getFileType() const;
+
+   /**
+    * Sets the file type.
+    * 
+    * @param fileType The sensor type as a string.
+    */
+   void setFileType(const ossimString& fileType);
+
+   /**
+    * @return The envi data type..
+    */
+   ossim_uint32 getDataType() const;
+
+   /**
+    * @return The ossimScalarType from the envi data type..
+    */
+   ossimScalarType getOssimScalarType() const;
+
+   /**
+    * Sets the envi data type based on the ossimScalarType.
+    * 
+    * @param scalar The ossimScalarType of the image.
+    */
+   void setDataType(ossimScalarType scalar);
+
+   /**
+    * @return The envi interleave type.
+    */
+   ossimString getInterleaveType() const;
+
+   /**
+    * @return The ossimInterleaveType from the envi interleave..
+    */
+   ossimInterleaveType getOssimInterleaveType() const;
+
+   /**
+    * Sets the envi interleave type string based on the ossimInterleaveType.
+    * 
+    * @param interleave The ossimInterleaveType of the image.
+    */
+   void setInterleaveType(ossimInterleaveType interleave);
+
+   /**
+    * @return The sensor type..
+    */
+   ossimString getSensorType() const;
+
+   /**
+    * Sets the envi sensor type string.
+    * 
+    * @param sensorType The sensor type as a string.
+    */
+   void setSensorType(const ossimString& sensorType);
+
+   /**
+    * @return If key "byte order" found returns the envi byte order; else,
+    * system byte order.  
+    *
+    * @note (Same as the ossimByteOrder enumeration):
+    * 0 = LITTLE_ENDIAN,
+    * 1 = BIG_ENDIAN
+    */
+   ossimByteOrder getByteOrder() const;
+   
+   /**
+    * Sets the envi byte order from the ossimByteOrder.
+    * 
+    * @param byteorder The ossimByteOrder of the image.
+    */
+   void setByteorder(ossimByteOrder byteOrder);
+   
+   /**
+    * @return The x start.
+    */
+   ossim_int32 getXStart() const;
+   
+   /**
+    * Sets the x start.
+    * 
+    * @param xStart
+    */
+   void setXStart(ossim_int32 xstart);
+   
+   /**
+    * @return The x start.
+    */
+   ossim_int32 getYStart() const;
+   
+   /**
+    * Sets the y start.
+    * 
+    * @param ystart
+    */
+   void setYStart(ossim_int32 ystart);
+
+   /**
+    * @return The envi map info string.
+    */
+   ossimString getMapInfo() const;
+
+   /**
+    * Sets the envi map info string.
+    * 
+    * @param mapInfo envi map info string.
+    */
+   void setMapInfo(const ossimString& mapInfo);
+
+   /**
+    * Sets the envi map info string from a keyword list containing geometry
+    * information.
+    * 
+    * @param kwl Keyword list containing geometry information.
+    */
+   void setMapInfo(const ossimKeywordlist& kwl,  const char* prefix=0);
+
+   /**
+    * @return The env wavelength units..
+    */
+   ossimString getWavelengthUnits() const;
+
+   /**
+    * Sets the envi wavelength units string.
+    * 
+    * @param wavelengthUnits envi wavelength units string.
+    */
+   void setWavelengthUnits(const ossimString& wavelenghtUnits);
+
+   /**
+    * @param bandNames Vector of strings to initialize with band names.
+    */
+   void getBandNames(std::vector<ossimString>& bandNames) const;
+
+   /**
+    * Sets the band name string vector.
+    * 
+    * @param bandNames Vector of band name strings.
+    */
+   void setBandNames(const std::vector<ossimString>& bandNames);
+
+   /**
+    * @param wavelengths Vector of strings to initialize with wave lengths.
+    */
+   void getWavelengths(std::vector<ossimString>& wavelengths) const;
+
+   /**
+    * Sets the envi band name string.
+    * 
+    * @param wavelengths Vector of band name strings.
+    */
+   void setWavelengths(const std::vector<ossimString>& wavelengths);
+
+   /**
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.
+    *
+    * @param kwl Keyword list to initialize from.
+    *
+    * @param prefix Usually something like: "object1."
+    *
+    * @return This method will alway return true as it is intended to be
+    * used in conjuction with the set methods.
+    *
+    * Keywords picked up by loadState:
+    * 
+    * description: My_file
+    *
+    * number_samples: 1024
+    *
+    * number_lines: 512
+    *
+    * number_bands: 3
+    *
+    * header_offset: 0
+    *
+    * file_type: ENVI Standard
+    *
+    * data_type: 1
+    *
+    * interleave_type: bil
+    *
+    * sensor_type:  Unknown
+    *
+    * (little_endian or big_endian)
+    * byte_order: little_endian
+    * 
+    * map_info: Unknown
+    *
+    * wavelength_units: 
+    *
+    * band_name0: Red band
+    * band_name1: Green band
+    * band_name2: Blue band
+    *
+    * wavelength0:  620.25
+    * wavelength1:  514.5
+    * wavelength2:  470.0
+    */
+   bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /**
+    * @brief Global method to test first line of file for "ENVI".
+    * @return true on success, false on error.
+    */
+   static bool isEnviHeader( const ossimFilename& file );
+
+   /**
+    * @brief Global method to test first line of stream for "ENVI".
+    * @return true on success, false on error.
+    */
+   static bool isEnviHeader( std::istream& in );
+
+   /** @return Path to envi header file. */
+   const ossimFilename& getFile() const;
+   
+private:
+
+   /**
+    * @brief Check band list to see if any are outside of range of bands.
+    * Bands should be zero base.
+    * @return true if all bands are less than number of bands; false, if
+    * outside range or if "bands" key is not found.
+    */
+   bool rangeCheckBands( const std::vector<ossim_uint32>& bands ) const;
+
+   /**
+    * @brief Parses stream.
+    * @return true on success, false on error.
+    */
+   bool readStream(std::istream& in);
+   
+   ossimFilename       m_file; // Name of header file.
+   ossimKeywordlist    m_keywords;
+};
+#endif /* #ifndef ossimEnviHeader_HEADER */
+
diff --git a/include/ossim/support_data/ossimEnviInfo.h b/include/ossim/support_data/ossimEnviInfo.h
new file mode 100644
index 0000000..3de69f0
--- /dev/null
+++ b/include/ossim/support_data/ossimEnviInfo.h
@@ -0,0 +1,54 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ENVI Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimEnviInfo_HEADER
+#define ossimEnviInfo_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+
+/** @brief ENVI info class. */
+class OSSIM_DLL ossimEnviInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimEnviInfo();
+
+   /** virtual destructor */
+   virtual ~ossimEnviInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+
+   ossimFilename m_file;
+};
+
+#endif /* End of "#ifndef ossimEnviInfo_HEADER" */
diff --git a/include/ossim/support_data/ossimFfL5.h b/include/ossim/support_data/ossimFfL5.h
new file mode 100644
index 0000000..549ac15
--- /dev/null
+++ b/include/ossim/support_data/ossimFfL5.h
@@ -0,0 +1,43 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Ken Melero (kmelero at imagelinks.com)
+//         Orginally written by Oscar Kramer (SoBe Software)
+// Description: Container class for LandSat5 Fast Format header files (RevB & C)
+//
+// ********************************************************************
+// $Id$
+
+#ifndef ossimFfL5_HEADER
+#define ossimFfL5_HEADER 1
+
+#include <ossim/support_data/ossimFfL7.h>
+#include <ossim/support_data/ossimFfRevb.h>
+#include <iosfwd>
+
+// ***************************************************************************
+// CLASS: ossimFfL5
+// ***************************************************************************
+
+class OSSIM_DLL ossimFfL5 : public ossimFfL7
+{
+   friend std::ostream& operator<<(std::ostream& os, const ossimFfL5& head);
+
+public:
+   ossimFfL5();
+   ossimFfL5(const char* headerFile);
+   ossimRefPtr<ossimFfRevb> revb();
+   const ossimRefPtr<ossimFfRevb> revb()const;
+ 
+protected:
+   virtual ~ossimFfL5();
+
+private:
+   void    readHeaderRevB(const ossimString& header_name);
+   int     convertGeoPoint(const char* sptr, ossimGpt& geo_point);
+
+   ossimRefPtr<ossimFfRevb> theRevb;
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimFfL7.h b/include/ossim/support_data/ossimFfL7.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimFfL7.h
rename to include/ossim/support_data/ossimFfL7.h
diff --git a/include/ossim/support_data/ossimFfRevb.h b/include/ossim/support_data/ossimFfRevb.h
new file mode 100644
index 0000000..dafb1ab
--- /dev/null
+++ b/include/ossim/support_data/ossimFfRevb.h
@@ -0,0 +1,290 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Ken Melero (kmelero at imagelinks.com)
+//         Orginally written by Dave Burken (dburken at imagelinks.com)
+// Description: This class parses an EOSAT Fast Format rev b header.
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimFfRevb_HEADER
+#define ossimFfRevb_HEADER 1
+
+#include <ossim/base/ossimReferenced.h>
+#include <iosfwd>
+
+//***************************************************************************
+// CLASS: ossimFfRevb.h
+//***************************************************************************
+class ossimFfRevb : public ossimReferenced
+{
+public:
+   ossimFfRevb  ();
+   ossimFfRevb  (const char* headerFile);
+   ~ossimFfRevb (){};
+
+   enum ErrorStatus
+   {
+      OSSIM_OK    = 0,
+      OSSIM_ERROR = 1
+   };
+
+   //***
+   // Enumerations for parsing header.  Contains size in bytes
+   // for all fields.
+   // 
+   // NOTE:  Sizes are the actual number of bytes for that field so add
+   //        one for trailing '\0' to get the string length for the
+   //        data member that are character arrays.
+   //***
+   enum
+   {
+      NUMBER_OF_PROJECTION_PARAMETERS = 15,
+      NUMBER_OF_BANDS                 = 7
+   };
+   
+   enum
+   {
+      PRODUCT_ORDER_NUMBER_DESC_SIZE      = 9,
+      PRODUCT_ORDER_NUMBER_SIZE           = 11,
+      WRS_DESC_SIZE                       = 6,
+      PATH_ROW_NUMBER_SIZE                = 9,
+      DATE_DESC_SIZE                      = 19,
+      DATE_SIZE                           = 8,
+      SAT_NUMBER_DESC_SIZE                = 12,
+      SAT_NUMBER_SIZE                     = 2,
+      INSTRUMENT_TYPE_DESC_SIZE           = 13,
+      INSTRUMENT_TYPE_SIZE                = 4,
+      PRODUCT_TYPE_DESC_SIZE              = 15,
+      PRODUCT_TYPE_SIZE                   = 14,
+      PRODUCT_SIZE_DESC_SIZE              = 15,
+      PRODUCT_SIZE_SIZE                   = 10,
+      MAP_SHEET_SIZE                      = 78,
+      PROCESSING_TYPE_DESC_SIZE           = 30,
+      PROCESSING_TYPE_SIZE                = 10,
+      RESAMPLING_ALGO_DESC_SIZE           = 13,
+      RESAMPLING_ALGO_SIZE                = 2,
+      RADIANCE_DESC_SIZE                  = 20,
+      RADIANCE_SIZE                       = 16,
+      VOLUME_NUMBER_DESC_SIZE             = 20,
+      VOLUME_NUMBER_SIZE                  = 3,
+      FIRST_LINE_DESC_SIZE                = 14,
+      FIRST_LINE_IN_VOLUME_SIZE           = 5,
+      LINES_PER_VOLUME_DESC_SIZE          = 15,
+      LINES_PER_VOLUME_SIZE               = 5,
+      ORIENTATION_ANGLE_DESC_SIZE         = 14,
+      ORIENTATION_ANGLE_SIZE              = 6,
+      MAP_PROJ_NAME_DESC_SIZE             = 13,
+      MAP_PROJ_NAME_SIZE                  = 4,
+      USGS_PROJ_NUMBER_DESC_SIZE          = 20,
+      USGS_PROJ_NUMBER_SIZE               = 6,
+      USGS_MAP_ZONE_DESC_SIZE             = 16,
+      USGS_MAP_ZONE_SIZE                  = 6,
+      USGS_PROJ_PARAMS_DESC_SIZE          = 29,
+      USGS_PROJ_PARAMS_SIZE               = 24,
+      ELLIPSOID_DESC_SIZE                 = 18,
+      ELLIPSOID_SIZE                      = 20,
+      MAJOR_AXIS_DESC_SIZE                = 18,
+      MAJOR_AXIS_SIZE                     = 11,
+      MINOR_AXIS_DESC_SIZE                = 18,
+      MINOR_AXIS_SIZE                     = 11,
+      PIXEL_GSD_DESC_SIZE                 = 13,
+      PIXEL_GSD_SIZE                      = 5,
+      PIXELS_PER_LINE_DESC_SIZE           = 17,
+      PIXELS_PER_LINE_SIZE                = 5,
+      LINES_PER_IMAGE_DESC_SIZE           = 17,
+      LINES_PER_IMAGE_SIZE                = 5,
+      CORNER_DESC_SIZE                    = 4,
+      LON_SIZE                            = 13,
+      LAT_SIZE                            = 12,
+      EASTING_SIZE                        = 13,
+      NORTHING_SIZE                       = 13,
+      BANDS_PRESENT_DESC_SIZE             = 16,
+      BANDS_PRESENT_SIZE                  = 7,
+      BLOCKING_FACTOR_DESC_SIZE           = 18,
+      BLOCKING_FACTOR_SIZE                = 4,
+      RECORD_LENGTH_DESC_SIZE             = 16,
+      RECORD_LENGTH_SIZE                  = 5,
+      SUN_ELEVATION_DESC_SIZE             = 16,
+      SUN_ELEVATION_SIZE                  = 2,
+      SUN_AZIMUTH_DESC_SIZE               = 14,
+      SUN_AZIMUTH_SIZE                    = 3,
+      CENTER_DESC_SIZE                    = 8,
+      CENTER_SAMPLE_SIZE                  = 6,
+      CENTER_LINE_SIZE                    = 6,
+      OFFSET_DESC_SIZE                    = 8,
+      OFFSET_SIZE                         = 4,
+      REV_DESC_SIZE                       = 4,
+      FORMAT_VERSION_SIZE                 = 1
+   };
+      
+   //***
+   // Enumerations for byte offsets in header.  All offsets are relative to
+   // the first byte of the first record which is byte 0.
+   //***
+   enum
+   {
+      // One record:  bytes 0 - 1535
+      PRODUCT_ORDER_NUMBER_OFFSET           = 9,
+      PATH_ROW_NUMBER_OFFSET                = 26,
+      DATE_OFFSET                           = 54,
+      SAT_NUMBER_OFFSET                     = 74,
+      INSTRUMENT_TYPE_OFFSET                 = 89,
+      PRODUCT_TYPE_OFFSET                   = 108,
+      PRODUCT_SIZE_OFFSET                   = 137,
+      MAP_SHEET_NAME_OFFSET                 = 147,
+      PROCESSING_TYPE_OFFSET                = 255,
+      RESAMPLING_ALGO_OFFSET                = 278,
+      VOLUME_NUMBER_OFFSET                  = 438,
+      FIRST_LINE_IN_VOLUME_OFFSET           = 455,
+      LINES_PER_VOLUME_OFFSET               = 475,
+      ORIENTATION_ANGLE_OFFSET              = 494,
+      MAP_PROJ_NAME_OFFSET                  = 513,
+      USGS_PROJ_NUMBER_OFFSET               = 537,
+      USGS_MAP_ZONE_OFFSET                  = 559,
+      ELLIPSOID_OFFSET                      = 972,
+      MAJOR_AXIS_OFFSET                     = 1010,
+      MINOR_AXIS_OFFSET                     = 1039,
+      PIXEL_GSD_OFFSET                      = 1063,
+      PIXELS_PER_LINE_OFFSET                = 1085,
+      LINES_PER_IMAGE_OFFSET                = 1107, 
+      UL_LON_OFFSET                         = 1116,
+      UL_LAT_OFFSET                         = 1130,
+      UL_EASTING_OFFSET                     = 1143,
+      UL_NORTHING_OFFSET                    = 1157,
+      UR_LON_OFFSET                         = 1174,
+      UR_LAT_OFFSET                         = 1188,
+      UR_EASTING_OFFSET                     = 1201,
+      UR_NORTHING_OFFSET                    = 1215,
+      LR_LON_OFFSET                         = 1232,
+      LR_LAT_OFFSET                         = 1246,
+      LR_EASTING_OFFSET                     = 1259,
+      LR_NORTHING_OFFSET                    = 1273,
+      LL_LON_OFFSET                         = 1290,
+      LL_LAT_OFFSET                         = 1304,
+      LL_EASTING_OFFSET                     = 1317,
+      LL_NORTHING_OFFSET                    = 1331,
+      BANDS_PRESENT_OFFSET                  = 1360,
+      BLOCKING_FACTOR_OFFSET                = 1385,
+      RECORD_LENGTH_OFFSET                  = 1405,
+      SUN_ELEVATION_OFFSET                  = 1426, 
+      SUN_AZIMUTH_OFFSET                    = 1442,
+      CENTER_LON_OFFSET                     = 1453,
+      CENTER_LAT_OFFSET                     = 1467,
+      CENTER_EASTING_OFFSET                 = 1480,
+      CENTER_NORTHING_OFFSET                = 1494,
+      CENTER_SAMPLE_OFFSET                  = 1507,
+      CENTER_LINE_OFFSET                    = 1513,
+      OFFSET_OFFSET                         = 1527,
+      FORMAT_VERSION_OFFSET                 = 1535 };
+
+   int errorStatus() const { return theErrorStatus; }
+
+   void print(std::ostream& os) const;
+
+   void write(std::ostream& os) const;
+
+   int    path() const;
+      //> Returns the path as an int.
+      //<
+   int    row() const;
+      //> Returns the row as an int from the pathRowString.
+      //<
+   int    fraction() const;
+      //> Returns the fraction as an int from the pathRowString.
+      //<
+   double projParam(int paramNumber) const;
+      //>  Converts the USGS Projection Parameter string, which has a
+      //   "D" to denote the exponent, to a double.
+      //<
+
+   friend std::ostream& operator<<(std::ostream& os, const ossimFfRevb& head);
+     
+   char   theProductOrderNumber[PRODUCT_ORDER_NUMBER_SIZE + 1];
+   char   thePathRowNumber[PATH_ROW_NUMBER_SIZE + 1];   
+   char   theAcquisitionDate[DATE_SIZE + 1];
+      //> yyyyddmm
+      //<
+   char   theSatNumber[SAT_NUMBER_SIZE + 1];
+      //> L4, L5, 1B, 1C
+      //<
+   char   theInstrumentType[INSTRUMENT_TYPE_SIZE + 1];
+      //> TM, LISS1 LISS2, LISS3, PAN, WIFS
+      //<
+   char   theProductType[PRODUCT_TYPE_SIZE + 1]; // MAP or ORBIT oriented
+   char   theProductSize[PRODUCT_SIZE_SIZE + 1]; // FULL, SUB, MAP
+      //> SYSTEMATIC, PRECISION, TERRAIN RADIOMETRIC
+      //<
+   char   theMapSheetName[MAP_SHEET_SIZE + 1];
+   char   theProcessingType[PROCESSING_TYPE_SIZE + 1];
+      //> SYSTEMATIC, PRECISION, TERRAIN RADIOMETRIC
+      //<
+   char   theResampAlgorithm[RESAMPLING_ALGO_SIZE + 1]; // CC, NN or BL
+   char   theBandRadiance[NUMBER_OF_BANDS][RADIANCE_SIZE + 1];
+   char   theVolumeNumber[VOLUME_NUMBER_SIZE + 1];
+   int    the1stLineInVolume;
+   int    theLinesPerVolume;
+   double theOrientationAngle;   // degrees
+   char   theMapProjName[MAP_PROJ_NAME_SIZE + 1];
+   int    theUsgsProjNumber;
+   int    theUsgsMapZone;
+   char   theUsgsProjParam[NUMBER_OF_PROJECTION_PARAMETERS]
+                          [USGS_PROJ_PARAMS_SIZE + 1];
+      //>  USGS Projection Parameters.  These are actually a string
+      //   representing doubles; however, EOSAT uses a "D" for the
+      //   exponent notation, so they are read in as a char*.
+      //   To convert to double use the method "projParam".
+      //<
+   char   theEllipsoid[ELLIPSOID_SIZE + 1];
+   double theSemiMajorAxis;
+   double theSemiMinorAxis;
+   double theGsd;             // pixel size in meters
+   int    thePixelsPerLine;   // samples
+   int    theLinesPerImage;   // lines
+
+   char    theUlLon[LON_SIZE + 1]; // deg, min, sec
+   char    theUlLat[LAT_SIZE + 1]; // deg, min, sec
+   double  theUlEasting;           // meters
+   double  theUlNorthing;          // meters
+   
+   char    theUrLon[LON_SIZE + 1]; // deg, min, sec
+   char    theUrLat[LAT_SIZE + 1]; // deg, min, sec
+   double  theUrEasting;           // meters
+   double  theUrNorthing;          // meters
+   
+   char    theLrLon[LON_SIZE + 1]; // deg, min, sec
+   char    theLrLat[LAT_SIZE + 1]; // deg, min, sec
+   double  theLrEasting;           // meters
+   double  theLrNorthing;          // meters
+   
+   char    theLlLon[LON_SIZE + 1]; // deg, min, sec
+   char    theLlLat[LAT_SIZE + 1]; // deg, min, sec
+   double  theLlEasting;           // meters
+   double  theLlNorthing;          // meters
+
+   char    theBandsPresentString[BANDS_PRESENT_SIZE + 1];
+   int     theBlockingFactor;
+   int     theRecordSize;
+   int     theSunElevation;        // degrees
+   int     theSunAzimuth;          // degrees
+
+   char    theCenterLon[LON_SIZE + 1]; // deg, min, sec
+   char    theCenterLat[LAT_SIZE + 1]; // deg, min, sec
+   double  theCenterEasting;           // meters
+   double  theCenterNorthing;          // meters
+   int     theCenterSample;       // Nearest whole pixel.
+   int     theCenterLine;         // Nearest whole pixel.
+   int     theOffset;   // pixels
+   char    theFormatVersion[FORMAT_VERSION_SIZE + 1];
+
+private:
+   void loadFromStream(std::istream& is);
+
+   int checkStream(std::istream& is);
+
+   ErrorStatus theErrorStatus;
+};
+   
+#endif
diff --git a/include/ossim/support_data/ossimFfRevc.h b/include/ossim/support_data/ossimFfRevc.h
new file mode 100644
index 0000000..20fbdf3
--- /dev/null
+++ b/include/ossim/support_data/ossimFfRevc.h
@@ -0,0 +1,346 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Ken Melero (kmelero at imagelinks.com)
+//         Orginally written by Dave Burken (dburken at imagelinks.com)
+// Description: This class parses an EOSAT Fast Format rev c header.
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimFfRevc_HEADER
+#define ossimFfRevc_HEADER 1
+
+#include <ossim/base/ossimIosFwd.h>
+
+// Forward class declarations.
+class ossimString;
+      
+//***************************************************************************
+// CLASS: ossimFfRevc.h
+//***************************************************************************
+
+class ossimFfRevc
+{
+public:
+   ossimFfRevc  ();
+   ossimFfRevc  (const char* headerFile);
+   ~ossimFfRevc (){};
+
+   enum ErrorStatus
+   {
+      OSSIM_OK    = 0,
+      OSSIM_ERROR = 1
+   };
+
+   //>
+   // Enumerations for parsing header.  Contains size in bytes
+   // for all fields.
+   // 
+   // NOTE:  Sizes are the actual number of bytes for that field so add
+   //        one for trailing '\0' to get the string length for the
+   //        data member that are character arrays.
+   //<
+
+   enum
+   {
+      NUMBER_OF_BANDS                 = 8,
+      NUMBER_OF_SCENES                = 4,
+      NUMBER_OF_PROJECTION_PARAMETERS = 15
+   };
+   
+   enum
+   {
+      // Adminstrative record:
+      PRODUCT_ORDER_NUMBER_DESC_SIZE      = 12,
+      PRODUCT_ORDER_NUMBER_SIZE           = 11,
+      LOCATION_DESC_SIZE                  = 11,
+      PATH_ROW_NUMBER_SIZE                = 17,
+      DATE_DESC_SIZE                      = 19,
+      DATE_SIZE                           = 8,
+      SAT_NAME_DESC_SIZE                  = 11,
+      SAT_NAME_SIZE                       = 10,
+      SENSOR_NAME_DESC_SIZE               = 9,
+      SENSOR_NAME_SIZE                    = 10,
+      SENSOR_MODE_DESC_SIZE               = 14,
+      SENSOR_MODE_SIZE                    = 6,
+      LOOK_ANGLE_DESC_SIZE                = 13,
+      OFF_NADIR_ANGLE_SIZE                = 6,
+      PRODUCT_TYPE_DESC_SIZE              = 14,
+      PRODUCT_TYPE_SIZE                   = 18,
+      PRODUCT_SIZE_DESC_SIZE              = 15,
+      PRODUCT_SIZE_SIZE                   = 10,
+      PROCESSING_TYPE_DESC_SIZE           = 20,
+      PROCESSING_TYPE_SIZE                = 11,
+      RESAMPLING_ALGO_DESC_SIZE           = 13,
+      RESAMPLING_ALGO_SIZE                = 2,
+      TAPE_VOLUME_NUMBER_DESC_SIZE        = 19,
+      TAPE_VOLUME_NUMBER_SIZE             = 2,
+      VOLUMES_PER_TAPE_SIZE               = 2,
+      PIXELS_PER_LINE_DESC_SIZE           = 18,
+      PIXELS_PER_LINE_SIZE                = 5,
+      LINES_PER_IMAGE_DESC_SIZE           = 17,
+      LINES_PER_IMAGE_SIZE                = 5,
+      FIRST_LINE_DESC_SIZE                = 14,
+      FIRST_LINE_IN_VOLUME_SIZE           = 5,
+      BLOCKING_FACTOR_DESC_SIZE           = 18,
+      BLOCKING_FACTOR_SIZE                = 2,
+      RECORD_LENGTH_DESC_SIZE             = 16,
+      RECORD_LENGTH_SIZE                  = 5,
+      PIXEL_GSD_DESC_SIZE                 = 13,
+      PIXEL_GSD_SIZE                      = 6,
+      BITS_PER_PIXEL_DESC_SIZE            = 23,
+      BITS_PER_PIXEL_SIZE                 = 2,  // Output and Acquired
+      AQUIRED_BITS_PER_PIXEL_DESC_SIZE    = 26,
+      BANDS_PRESENT_DESC_SIZE             = 15,
+      BANDS_PRESENT_SIZE                  = 33,
+      REV_DESC_SIZE                       = 15,
+      FORMAT_VERSION_SIZE                 = 1,
+      // Radiometric record:
+      BIAS_GAIN_DESC_SIZE                 = 50, 
+      BIAS_SIZE                           = 24,
+      GAIN_SIZE                           = 24,
+      // Geometric record:
+      GEO_DESC_SIZE                       = 14,
+      MAP_PROJECTION_NAME_DESC_SIZE       = 17,
+      MAP_PROJECTION_NAME_SIZE            = 4,
+      ELLIPSOID_DESC_SIZE                 = 12,
+      ELLIPSOID_SIZE                      = 18,
+      DATUM_DESC_SIZE                     = 8,
+      DATUM_SIZE                          = 6,
+      PROJECTION_PARAMETER_DESC_SIZE      = 28,
+      PROJECTION_PARAMETER_SIZE           = 24,
+      CORNER_DESC_SIZE                    = 4,
+      CENTER_DESC_SIZE                    = 8,
+      LON_SIZE                            = 13,
+      LAT_SIZE                            = 12,
+      EASTING_SIZE                        = 13,
+      NORTHING_SIZE                       = 13,
+      CENTER_SAMPLE_SIZE                  = 5,
+      CENTER_LINE_SIZE                    = 5,
+      HORIZONTAL_OFFSET_DESC_SIZE         = 8,
+      HORIZONTAL_OFFSET_SIZE              = 6,
+      ORIENTATION_ANGLE_DESC_SIZE         = 20,
+      ORIENTATION_ANGLE_SIZE              = 6,
+      SUN_ELEVATION_DESC_SIZE             = 21,
+      SUN_ELEVATION_SIZE                  = 4,
+      SUN_AZIMUTH_DESC_SIZE               = 20,
+      SUN_AZIMUTH_SIZE                    = 5
+   };
+
+   //---
+   //>
+   // Enumerations for byte offsets in header.  All offsets are relative to
+   // the first byte of the first record which is byte 0.
+   //<
+   
+   enum
+   {
+      // Administrative record:  bytes 0 - 1535
+      PRODUCT_ORDER_NUMBER_OFFSET           = 12,
+      PRODUCT_TYPE_OFFSET                   = 654,
+      PRODUCT_SIZE_OFFSET                   = 687,
+      PROCESSING_TYPE_OFFSET                = 740,
+      RESAMPLING_ALGO_OFFSET                = 764,
+      TAPE_VOLUME_NUMBER_OFFSET             = 819,
+      VOLUMES_PER_TAPE_OFFSET               = 822,
+      PIXELS_PER_LINE_OFFSET                = 842,
+      LINES_PER_IMAGE_OFFSET                = 864,
+      FIRST_LINE_IN_VOLUME_OFFSET           = 894,
+      BLOCKING_FACTOR_OFFSET                = 917,
+      RECORD_LENGTH_OFFSET                  = 935,
+      PIXEL_GSD_OFFSET                      = 954,
+      BITS_PER_PIXEL_OFFSET                 = 983,
+      ACQUIRED_BITS_PER_PIXEL_OFFSET        = 1011,
+      BANDS_PRESENT_OFFSET                  = 1055,
+      FORMAT_VERSION_OFFSET                 = 1535,
+      // Radiometric record:  bytes 1536 - 3071
+      // See file scope constants for bias and gain OFFSET positions.
+      // Geometric record:  bytes 3072 - 4607
+      MAP_PROJECTION_NAME_OFFSET    = 3103,
+      ELLIPSOID_OFFSET              = 3119,  
+      DATUM_OFFSET                  = 3145,
+      UL_LON_OFFSET                 = 3637,
+      UL_LAT_OFFSET                 = 3651,
+      UL_EASTING_OFFSET             = 3664,
+      UL_NORTHING_OFFSET            = 3678,
+      UR_LON_OFFSET                 = 3717,
+      UR_LAT_OFFSET                 = 3731,
+      UR_EASTING_OFFSET             = 3744,
+      UR_NORTHING_OFFSET            = 3758,
+      LR_LON_OFFSET                 = 3797,
+      LR_LAT_OFFSET                 = 3811,
+      LR_EASTING_OFFSET             = 3824,
+      LR_NORTHING_OFFSET            = 3838,
+      LL_LON_OFFSET                 = 3877,
+      LL_LAT_OFFSET                 = 3891,
+      LL_EASTING_OFFSET             = 3904,
+      LL_NORTHING_OFFSET            = 3918,
+      CENTER_LON_OFFSET             = 3961,
+      CENTER_LAT_OFFSET             = 3975,
+      CENTER_EASTING_OFFSET         = 3988,
+      CENTER_NORTHING_OFFSET        = 4002,
+      CENTER_SAMPLE_OFFSET          = 4016,
+      CENTER_LINE_OFFSET            = 4022,
+      HORIZONTAL_OFFSET_OFFSET      = 4040,
+      ORIENTATION_ANGLE_OFFSET      = 4066, 
+      SUN_ELEVATION_OFFSET          = 4133, 
+      SUN_AZIMUTH_OFFSET            = 4157
+   };
+
+   //---
+   //>
+   // An EOSAT Fast Format Rev C header consists of three
+   // records:  administrative, radiometric and geometric
+   // each record has a class defined for it to hold the pertinent
+   // data.
+   //<
+   
+   class AdminRecord
+   {
+   public:
+      AdminRecord();
+      ~AdminRecord(){}
+
+      //  Data Members for record.
+      
+      char   theProductOrderNumber[PRODUCT_ORDER_NUMBER_SIZE + 1];
+
+      char   thePathRowNumber[NUMBER_OF_SCENES][PATH_ROW_NUMBER_SIZE + 1];   
+      char   theAcquisitionDate[NUMBER_OF_SCENES][DATE_SIZE + 1];
+         //> yyyyddmm
+         //<
+      char   theSatName[NUMBER_OF_SCENES][SAT_NAME_SIZE + 1];
+         //> L4, L5, 1B, 1C
+         //<
+      char   theSensorName[NUMBER_OF_SCENES][SENSOR_NAME_SIZE + 1];
+         //> TM, LISS1 LISS2, LISS3, PAN, WIFS
+         //<
+      char   theSensorMode[NUMBER_OF_SCENES][SENSOR_MODE_SIZE + 1];
+      double theOffNadirAngle[NUMBER_OF_SCENES];  // degrees
+
+      char   theProductType[PRODUCT_TYPE_SIZE + 1]; // MAP or ORBIT oriented
+      char   theProductSize[PRODUCT_SIZE_SIZE + 1]; // FULL, SUB, MAP
+         //> SYSTEMATIC, PRECISION, TERRAIN RADIOMETRIC
+         //<
+      char   theProcessingType[PROCESSING_TYPE_SIZE + 1];
+      char   theResampAlgorithm[RESAMPLING_ALGO_SIZE + 1]; // CC or NN
+      int    theTapeVolumeNumber;
+      int    theNumberVolumesPerTape;
+      int    thePixelsPerLine;
+      int    theLinesPerImage;
+      int    the1stLineInVolume;
+      int    theTapeBlockingFactor;
+      int    theRecordSize;
+      double theGsd; // pixel size in meters
+      int    theOutputBitsPerPixel;
+      int    theAcquiredBitsPerPixel;
+      char   theBandsPresentString[BANDS_PRESENT_SIZE + 1];
+      char   theFormatVersion[FORMAT_VERSION_SIZE + 1];
+   };
+
+   class RadiomRecord
+   {
+   public:
+      RadiomRecord();
+      ~RadiomRecord(){}
+      
+
+      double theBias[8];
+      double theGain[8];
+   };
+
+   class GeoRecord
+   {
+   public:
+      GeoRecord();
+      ~GeoRecord(){}
+      
+      char    theMapProjectionName[MAP_PROJECTION_NAME_SIZE + 1];
+      char    theEllipsoid[ELLIPSOID_SIZE + 1];
+      char    theDatum[DATUM_SIZE + 1];
+      double  theProjectionParams[15];
+   
+      char    theUlLon[LON_SIZE + 1]; // deg, min, sec
+      char    theUlLat[LAT_SIZE + 1]; // deg, min, sec
+      double  theUlEasting;
+      double  theUlNorthing;
+   
+      char    theUrLon[LON_SIZE + 1]; // deg, min, sec
+      char    theUrLat[LAT_SIZE + 1]; // deg, min, sec
+      double  theUrEasting;
+      double  theUrNorthing;
+   
+      char    theLrLon[LON_SIZE + 1]; // deg, min, sec
+      char    theLrLat[LAT_SIZE + 1]; // deg, min, sec
+      double  theLrEasting;
+      double  theLrNorthing;
+   
+      char    theLlLon[LON_SIZE + 1]; // deg, min, sec
+      char    theLlLat[LAT_SIZE + 1]; // deg, min, sec
+      double  theLlEasting;
+      double  theLlNorthing;
+
+      char    theCenterLon[LON_SIZE + 1]; // deg, min, sec
+      char    theCenterLat[LAT_SIZE + 1]; // deg, min, sec
+      double  theCenterEasting;
+      double  theCenterNorthing;
+      int     theCenterSample;       // Nearest whole pixel.
+      int     theCenterLine;         // Nearest whole pixel.
+
+      int     theHorizontalOffset;   // pixels
+      double  theOrientationAngle;   // degrees
+      double  theSunElevationAngle;  // degrees
+      double  theSunAzimuth;         // degrees
+   };
+
+   AdminRecord  theAdminRecord;
+   RadiomRecord theRadiomRecord;
+   GeoRecord    theGeoRecord;
+   
+   int errorStatus() const { return theErrorStatus; }
+
+   void print(std::ostream& os) const;
+
+   void write(std::ostream& os) const;
+
+   friend std::ostream& operator<<(std::ostream& os, const ossimFfRevc& head);
+
+
+   //>
+   // Convenience methods.
+   //<
+   
+   int    path(int sceneNbr=0) const;
+      //> Returns the path as an int.
+      //  Currently uses the1stPathRowNumber string.
+      //<
+   int    row(int sceneNbr=0) const;
+      //> Returns the row as an int from the pathRowString.
+      //  Currently uses the1stPathRowNumber string.
+      //<
+   int    fraction(int sceneNbr=0) const;
+      //> Returns the fraction as an int from the pathRowString.
+      //  Currently uses the1stPathRowNumber string.
+      //<
+   ossimString subScene(int sceneNbr=0) const;
+      //> Returns the sub scene as an string from the pathRowString.
+      //  Currently uses the1stPathRowNumber string.
+      //<
+
+   ossimString pathRow(int sceneNbr=0) const;
+      //> Returns a string represnting the path and row as a name.
+      //  i.e.: 287/05100D0 will be returned as p287r05100D0
+      //  This method will remove any spaces.
+      //<
+
+private:
+   void loadFromStream(ossim::istream& is);
+
+   int checkStream(ossim::istream& is);
+
+   ErrorStatus theErrorStatus;
+};
+   
+#endif
diff --git a/include/ossim/support_data/ossimFgdcTxtDoc.h b/include/ossim/support_data/ossimFgdcTxtDoc.h
new file mode 100644
index 0000000..19a603f
--- /dev/null
+++ b/include/ossim/support_data/ossimFgdcTxtDoc.h
@@ -0,0 +1,129 @@
+//----------------------------------------------------------------------------
+//
+// File ossimFgdcTxtDoc.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ossimFgdcTxtDoc class declaration.
+//
+// FGDC = "Federal Geographic Data Committee"
+//
+// See: http://www.fgdc.gov/
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimFgdcTxtDoc.h 2673 2011-06-06 14:57:24Z david.burken $
+#ifndef ossimFgdcTxtDoc_HEADER
+#define ossimFgdcTxtDoc_HEADER 1
+
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/projection/ossimProjection.h>
+
+/**
+ * @class ossimFgdcTxtDoc
+ * @brief Support data container for FGDC in text format.
+ *
+ * Has minimum parse support to get Spatial_Reference_Information section to
+ * extract projection information.
+ *
+ * TODO: Make an ossimFgdcBase and consolidate code from
+ * ossimFgdcXmlDoc and this class. (drb - 15 Aug. 2011)
+ */
+class OSSIM_DLL ossimFgdcTxtDoc : public ossimReferenced
+{
+public:
+
+   /** default constructor */
+   ossimFgdcTxtDoc();
+
+   /** virtual destructor */
+   virtual ~ossimFgdcTxtDoc();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   bool open(const ossimFilename& file);
+
+   /**
+    * @brief Close method.
+    *
+    * This doesn't really do anything.  Here only because I think every open()
+    * should have a matching close().
+    */
+   void close();
+
+   /**
+    * @brief Gets projection from Spatial_Reference_Information block.
+    * @param proj Intialized by this method.  Set to null on projection cannot
+    * be created.
+    */   
+   void getProjection(ossimRefPtr<ossimProjection>& proj);
+
+   /**
+    * @brief Gets units from Altitude_Distance_Units.
+    * @return Units if found, OSSIM_UNIT_UNKNOWN if not.
+    */
+   void getAltitudeDistanceUnits(std::string& units) const;
+
+private:
+
+   /**
+    * @brief Gets projection from Spatial_Reference_Information block for
+    * version FGDC-STD-001-1998.
+    * @param str Stream to read from.
+    * @param proj Intialized by this method.  Set to null on projection cannot
+    * be created.
+    */ 
+   void getProjectionV1(std::ifstream& str,
+                        ossimRefPtr<ossimProjection>& proj);
+
+   /**
+    * @brief Finds key and returns true if present.
+    *
+    * Leaves stream at position of last getline.
+    * 
+    * @param str Stream to read from.
+    * @param key Key to find.
+    * @return true if present false if not.
+    */
+   bool findKey( std::ifstream& str, const std::string& key);
+
+   /**
+    * @brief Finds key and returns and intializes value if present.
+    *
+    * Stream position at end of call is dependent on seekBack flag.
+    * 
+    * @param str Stream to read from.
+    * @param seekBack If true the stream will be repositioned to original
+    * position at beginning of the call.
+    * @param key Key to find.
+    * @param value Intialized with value if key is found.
+    * @return true if present false if not.
+    */
+   bool findKey( std::ifstream& str,
+                 bool seekBack,
+                 const std::string& key,
+                 std::string& value);
+
+   /**
+    * Gets ossim datum string from fgdc datum string.
+    */
+   void getOssimDatum( const std::string& fgdcDatumString,
+                       std::string& ossimDatumCode ) const;
+
+   // Container for relevant data from FGDC file.
+   ossimRefPtr<ossimKeywordlist> m_kwl;
+   
+}; // End: class ossimFgdcTxtDoc
+
+#endif /* #ifndef ossimFgdcTxtDoc_HEADER */
diff --git a/include/ossim/support_data/ossimFgdcXmlDoc.h b/include/ossim/support_data/ossimFgdcXmlDoc.h
new file mode 100644
index 0000000..a28896f
--- /dev/null
+++ b/include/ossim/support_data/ossimFgdcXmlDoc.h
@@ -0,0 +1,188 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Mingjie Su
+//
+// Description: Utility class to encapsulate parsing projection info in the xml file.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimFgdcXmlDoc.h 2063 2011-01-19 19:38:12Z ming.su $
+#ifndef ossimFgdcXmlDoc_HEADER
+#define ossimFgdcXmlDoc_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/projection/ossimProjection.h>
+
+class ossimDatum;
+class ossimDrect;
+
+/** @brief Class for FGDC XML doc parsing. */
+class OSSIMDLLEXPORT ossimFgdcXmlDoc
+{
+public:
+   /** @brief default constructor */
+   ossimFgdcXmlDoc();
+   
+   /** @brief destructor */
+   ~ossimFgdcXmlDoc();
+
+   /**
+    * @brief Open method.
+    * @return true on success, false on error.
+    */
+   bool open(const ossimFilename& xmlFileName);
+
+   /** @return true if m_xmlDocument is open; false if not. */
+   bool isOpen() const;
+
+   /** @brief close method. */
+   void close();
+
+   /** @brief Gets projection from document. */
+   ossimRefPtr<ossimProjection> getProjection();
+
+   /** @return Unit type. Note meters is the default if not found in doc. */
+   ossimUnitType getUnitType() const;
+
+   /**
+    * @return text for path "/metadata/spref/horizsys/cordsysn/geogcsn"
+    */
+   bool getGeoCsn(ossimString& s) const;
+
+   /**
+    * @return text for path "/metadata/spref/horizsys/cordsysn/projcsn"
+    */
+   bool getProjCsn(ossimString& s) const;
+
+   /**
+    * @brief Get the Altitude Distance Units
+    *
+    * Path: "/metadata/spref/vertdef/altsys/altunits"
+    *
+    * Domain: "meters" "feet"
+    * 
+    * @return Text for path.
+    */
+   bool getAltitudeDistantUnits(ossimString& s) const;
+
+   /**
+    * @brief Get the Grid Coordinate system
+    *
+    * Path: "/metadata/spref/horizsys/planar/gridsys/gridsysn"
+    *
+    * @return Text for path.
+    */
+   bool getGridCoordinateSystem(ossimString& s) const;
+
+   /**
+    * @brief Gets projection from Grid Coordinate system node.
+    *
+    * Throws ossimException on error.
+    *
+    * @return Refptr with projection pointer.  Underlying pointer may be null.
+    */
+   ossimRefPtr<ossimProjection> getGridCoordSysProjection();
+
+   /**
+    * @brief Get the Grid Coordinate system
+    *
+    * Path: "/metadata/spref/horizsys/planar/gridsys/gridsysn"
+    *
+    * @return Text for path.
+    */
+   bool getHorizontalDatum(ossimString& s) const;
+
+   /**
+    * @brief Get the Planar Distant Units
+    * 
+    * Path: "/metadata/spref/horizsys/planar/planci/plandu"
+    *
+    * Domain: "meters" "international feet" "survey feet"
+    *
+    * @return Text for path.
+    */
+   bool getPlanarDistantUnits(ossimString& s) const;
+
+   /**
+    * @brief Get UTM false Northing.
+    * 
+    * Path: "/metadata/spref/horizsys/planar/gridsys/utm/transmer/fnorth"
+    *
+    * @return Text for path.
+    */
+   bool getUtmFalseNorthing(ossimString& s) const;
+   
+   /**
+    * @brief Get UTM zone.
+    * 
+    * Path: "/metadata/spref/horizsys/planar/gridsys/utm/utmzone"
+    *
+    * Domain: 1 <= UTM Zone Number <= 60 for the northern hemisphere;
+    * -60 <= UTM Zone Number <= -1 for the southern hemisphere
+     *
+    * @return Text for path.
+    */
+   bool getUtmZone(ossimString& s) const;
+
+   /**
+    * @brief Get Bands.
+    * 
+    * Path: "/metadata/spdoinfo/rastinfo/vrtcount"
+    *
+    * the maximum number of raster objects along the vertical (z) axis. 
+    * For use with rectangular volumetric raster objects (voxels). 
+     *
+    * @return int for path.
+    */
+   ossim_uint32 getNumberOfBands();
+
+    /**
+    * @brief Gets path from doc and initializes string.
+    *
+    * This method errors if multiple nodes are found for path.
+    * 
+    * @param path Xml path to look for.
+    * @param s String to initialize.
+    * @return true on success and false if path is not found or if there
+    * are more than one of path.
+    */
+   bool getPath(const ossimString& path, ossimString& s) const;
+
+   bool getImageSize(ossimIpt& size) const;
+
+private:
+
+   bool getXRes(ossim_float64& v) const;
+   
+   bool getYRes(ossim_float64& v) const;
+
+   void getBoundingBox(ossimDrect& rect) const;
+
+   /**
+    * @brief Gets path from doc and initializes string.
+    * @param path Xml path to look for.
+    * @param v Value to initialize.
+    * @return true on success and false if path is not found or if there
+    * are more than one of path.
+    */
+   bool getPath(const ossimString& path, ossim_float64& v) const;
+
+   /**
+    * Gets the ossimDatum from string.
+    */
+   const ossimDatum* createOssimDatum(const ossimString& s) const;
+   
+   ossimFilename                 m_xmlFilename;
+   ossimRefPtr<ossimXmlDocument> m_xmlDocument;
+   ossimRefPtr<ossimProjection>  m_projection;
+   mutable bool                  m_boundInDegree;
+};
+
+#endif /* matches: #ifndef ossimFgdcXmlDoc */
diff --git a/include/ossim/support_data/ossimGeoTiff.h b/include/ossim/support_data/ossimGeoTiff.h
new file mode 100644
index 0000000..052f9e9
--- /dev/null
+++ b/include/ossim/support_data/ossimGeoTiff.h
@@ -0,0 +1,289 @@
+//***************************************************************************
+// FILE: ossimGeoTiff.h
+//
+// License:  See top level LICENSE.txt file.
+//
+// Description:
+// 
+// Class declaration for ossimGeoTiff which is designed to read and hold tag
+// information.
+//
+//***************************************************************************
+// $Id: ossimGeoTiff.h 21023 2012-05-29 20:32:22Z dburken $
+
+#ifndef ossimGeoTiff_HEADER
+#define ossimGeoTiff_HEADER 1
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorStatusInterface.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/base/ossimRefPtr.h>
+
+#include <vector>
+
+#include <tiffio.h>
+#include <OpenThreads/Mutex>
+#include <OpenThreads/ScopedLock>
+
+class ossimFilename;
+class ossimKeywordlist;
+class ossimPrivateGtifDef;
+class ossimProjection;
+class ossimTieGptSet;
+
+class OSSIM_DLL ossimGeoTiff : public ossimErrorStatusInterface
+{
+public:
+   /** default constructor */
+   ossimGeoTiff();
+
+   ossimGeoTiff(const ossimFilename& file, ossim_uint32 entryIdx=0);
+
+   ~ossimGeoTiff();
+  
+   enum
+   {
+      UNDEFINED                        = 0,
+      PIXEL_IS_AREA                    = 1,
+      PIXEL_IS_POINT                   = 2,
+      GT_MODEL_TYPE_GEO_KEY            = 1024,
+      GT_RASTER_TYPE_GEO_KEY           = 1025,
+      GEOGRAPHIC_TYPE_GEO_KEY          = 2048,
+      GEOG_GEODETIC_DATUM_GEO_KEY      = 2050,
+      GEOG_ANGULAR_UNITS_GEO_KEY       = 2054,
+      PROJECTED_CS_TYPE_GEO_KEY        = 3072,
+      PCS_CITATION_GEO_KEY             = 3073,
+      PROJECTION_GEO_KEY               = 3074,
+      PROJ_COORD_TRANS_GEO_KEY         = 3075,
+      LINEAR_UNITS_GEO_KEY             = 3076,
+      PROJ_STD_PARALLEL1_GEO_KEY       = 3078,
+      PROJ_STD_PARALLEL2_GEO_KEY       = 3079,
+      PROJ_NAT_ORIGIN_LONG_GEO_KEY     = 3080,
+      PROJ_NAT_ORIGIN_LAT_GEO_KEY      = 3081,
+      PROJ_FALSE_EASTING_GEO_KEY       = 3082,
+      PROJ_FALSE_NORTHING_GEO_KEY      = 3083,
+      PROJ_CENTER_LONG_GEO_KEY         = 3088,
+      PROJ_CENTER_LAT_GEO_KEY          = 3089,
+      PROJ_SCALE_AT_NAT_ORIGIN_GEO_KEY = 3092,
+      LINEAR_METER                     = 9001,
+      LINEAR_FOOT                      = 9002,
+      LINEAR_FOOT_US_SURVEY            = 9003,
+      ANGULAR_DEGREE                   = 9102,
+      ANGULAR_ARC_MINUTE               = 9103,
+      ANGULAR_ARC_SECOND               = 9104,
+      ANGULAR_GRAD                     = 9105,
+      ANGULAR_GON                      = 9106,
+      ANGULAR_DMS                      = 9107,
+      ANGULAR_DMS_HEMISPHERE           = 9108,
+      PCS_BRITISH_NATIONAL_GRID        = 27700,
+      USER_DEFINED                     = 32767
+   };
+
+/*    enum CompressType */
+/*    { */
+/*       NOT_COMPRESSED = 0, */
+/*       COMPRESSED     = 1 */
+/*    }; */
+ 
+/*    enum PhotoInterpretation */
+/*    { */
+/*       PHOTO_MINISWHITE  = 0,   // min value is white  */
+/*       PHOTO_MINISBLACK  = 1,   // min value is black  */
+/*       PHOTO_RGB         = 2,   // RGB color model  */
+/*       PHOTO_PALETTE     = 3,   // color map indexed  */
+/*       PHOTO_MASK        = 4,   // $holdout mask  */
+/*       PHOTO_SEPARATED   = 5,   // !color separations  */
+/*       PHOTO_YCBCR       = 6,   // !CCIR 601  */
+/*       PHOTO_CIELAB      = 8    // !1976 CIE L*a*b* */
+/*    }; */
+   enum ModelType
+   {
+      UNKNOWN               = 0,
+      MODEL_TYPE_PROJECTED  = 1,  // Projection Coordinate System
+      MODEL_TYPE_GEOGRAPHIC = 2,  // Geographic latitude-longitude System 
+      MODEL_TYPE_GEOCENTRIC = 3
+   };
+
+   static int getPcsUnitType(ossim_int32 pcsCode);
+
+   static bool writeTags(TIFF* tiffOut,
+                         const ossimRefPtr<ossimMapProjectionInfo> projectionInfo,
+                         bool imagineNad27Flag=false);
+
+   /**
+    * @brief Writes a geotiff box to a buffer.
+    *
+    * This will write a degenerate GeoTIFF file to a temp file, copy file to
+    * the buffer and then delete the temp file.
+    *
+    * @param tmpFile The temporary filename.
+    * @param rect The output image rect.
+    * @param proj Pointer to output projection.
+    * @param buf The buffer to stuff with data.
+    * @param pixelType OSSIM_PIXEL_IS_POINT(0) or OSSIM_PIXEL_IS_AREA(1)
+    * @return true on success, false on error.
+    */
+   static bool writeJp2GeotiffBox(const ossimFilename& tmpFile,
+                                  const ossimIrect& rect,
+                                  const ossimProjection* proj,
+                                  std::vector<ossim_uint8>& buf,
+                                  ossimPixelType pixelType);
+   
+   /**
+    *  Reads tags.
+    *  Returns true on success, false on error.
+    */
+   bool readTags(const ossimFilename& file, ossim_uint32 entryIdx=0);
+
+   /**
+    * @brief Method to parse the tiff file from an open tiff pointer for a
+    * given index.
+    *
+    * This will initialize this container for a subsequent call to
+    * addImageGeometry.
+    * 
+    * @param tiff The opened TIFF* to read from.
+    * 
+    * @param entryIdx Entry (tiff directory) to read.
+    *
+    * @param ownTiffPtrFlag If true the tiff pointer will be deleted by this
+    * object; else, it will simply zero out the pointer at the end of method.
+    * This allows for external code to pass in their open tiff pointer
+    * without this object closing it.
+    *
+    * @return true on success, false on error.
+    */
+   bool readTags(TIFF* tiff, ossim_uint32 entryIdx, bool ownTiffPtrFlag);
+
+   /**
+    *  Returns the map zone as an interger.
+    */
+   int mapZone() const;
+
+   /**
+    *  Add geometry info from tags to keword list.
+    *  Returns true on success, false on error.
+    */
+   bool addImageGeometry(ossimKeywordlist& kwl,
+                         const char* prefix=0) const;
+
+   /**
+    *  Returns an ossimString representing the ossim projection name.
+    *  Returns "unknown" if it can't find a match.
+    */
+   ossimString getOssimProjectionName() const;
+
+   /**
+    *  Attempts to set the ossim projection name from keys read.
+    */
+   void setOssimProjectionName();
+
+   /**
+    *  Returns an ossimString representing the ossim datum name code.
+    *  Returns "unknown" if it can't find a match.
+    */
+   ossimString getOssimDatumName() const;
+
+   /**
+    *  Attempts to set the ossim datum code.
+    */
+   void setOssimDatumName();
+
+   void getScale(std::vector<double>& scale) const;
+   void getTiePoint(std::vector<double>& tie_point) const;
+   void getModelTransformation(std::vector<double>& transform) const;
+
+   const std::vector<double>& getTiePoint() const;
+   const std::vector<double>& getModelTransformation() const;
+   const std::vector<double>& getScale() const;
+   ossimPixelType getRasterType() const;
+
+   int getWidth() const;
+   int getLength() const;
+/*    int getSamplesPerPixel() const; */
+
+   /** Prints data members. */
+   virtual std::ostream& print(std::ostream& out) const;
+   
+private:
+
+   // Disallow ...
+   ossimGeoTiff& operator=(const ossimGeoTiff& /*rhs*/) { return *this; }
+
+   //! Initializes data members given a projection code. Returns TRUE if valid PCS code specified.
+   //! Resets the PCS code to 0 if invalid.
+   bool  parsePcsCode();
+
+   //! Initializes data members given a projection. Returns TRUE if successful.
+   bool parseProjection(ossimMapProjection* map_proj);
+
+   /**
+    *  Converts double passed in to meters if needed.  The conversion is
+    *  base on "theLiniarUnitsCode".
+    */
+   double convert2meters(double d) const;
+
+   /**
+    * @return true if conditions are present to use model transform; false
+    * if not.
+    */
+   bool usingModelTransform() const;
+
+   /**
+    * Initializes tieSet from theTiePoints.  Has logic to shift one based
+    * ties to be zero based like the rest of the code.
+    */
+   void getTieSet(ossimTieGptSet& tieSet) const;
+
+   /**
+    * Attempts to detect if tie points are one or zero based.
+    * @return true if one base, false if not.
+    */
+   bool hasOneBasedTiePoints() const;
+
+   TIFF*                 theTiffPtr;
+   ossim_uint32          theGeoKeyOffset;
+   int                   theGeoKeyLength;
+   bool                  theGeoKeysPresentFlag;
+   int                   theZone;
+   ossimString           theHemisphere;
+   int                   theDoubleParamLength;
+   int                   theAsciiParamLength;
+   ossimString           theProjectionName;
+   ossimString           theDatumName;
+   
+   std::vector<double>   theScale;                         // tag 33550
+   std::vector<double>   theTiePoint;                      // tag 33922
+   std::vector<double>   theModelTransformation;           // tag 34264
+   std::vector<double>   theDoubleParam;                   // tag 34736
+   ossimString           theAsciiParam;                    // tag 34737
+   
+   ossim_uint32          theWidth;                         // tag 256
+   ossim_uint32          theLength;                        // tag 257
+   ossim_uint16          theBitsPerSample;                 // tag 258
+
+   ossim_uint16          theModelType;                     // key 1024
+   ossim_uint16          theRasterType;                    // key 1025 undefined=0, area=1, point=2
+   ossim_uint16          theGcsCode;                       // key 2048
+   ossim_uint16          theDatumCode;                     // key 2050
+   ossim_uint16          theAngularUnits;                  // key 2054
+   ossim_uint32          thePcsCode;                       // key 3072
+   ossimString           thePcsCitation;                   // key 3073
+   ossim_uint16          theCoorTransGeoCode;              // key 3075
+   ossim_uint16          theLinearUnitsCode;               // key 3076
+   double                theStdPar1;                       // key 3078 
+   double                theStdPar2;                       // key 3079
+   mutable double        theOriginLon;                     // key 3080
+   mutable double        theOriginLat;                     // key 3081
+   double                theFalseEasting;                  // key 3082
+   double                theFalseNorthing;                 // key 3083
+   double                theScaleFactor;                   // key 3092
+   
+   ossimPrivateGtifDef*  thePrivateDefinitions;
+   
+   static OpenThreads::Mutex theMutex;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimGmlSupportData.h b/include/ossim/support_data/ossimGmlSupportData.h
new file mode 100644
index 0000000..c872936
--- /dev/null
+++ b/include/ossim/support_data/ossimGmlSupportData.h
@@ -0,0 +1,170 @@
+//---
+//
+// License:  MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: GML support data object.
+// 
+//---
+// $Id$
+#ifndef ossimGmlSupportData_HEADER
+#define ossimGmlSupportData_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <iosfwd>
+
+class ossimImageGeometry;
+class ossimIpt;
+class ossimIrect;
+class ossimKeywordlist;
+class ossimXmlDocument;
+class ossimXmlNode;
+
+/** @brief GML support data class. */
+class OSSIM_DLL ossimGmlSupportData
+{
+public:
+   
+   /** default constructor */
+   ossimGmlSupportData();
+
+   /** destructor */
+   ~ossimGmlSupportData();
+
+   /**
+    * @brief Initializes gml block from geometry file.
+    * @param geom
+    * @param rect Output rectangle (view rect).
+    */
+   bool initialize( const ossimImageGeometry* geom,
+                    const ossimIrect& rect );
+
+   /**
+    * @brief Initializes from stream assumed to be a gml block.
+    * @param in
+    */   
+   bool initialize( std::istream& in );
+
+   /** @brief Write xml doc to stream. */
+   bool write( std::ostream& os );
+
+   /** @return Reference to xml doc. */
+   ossimRefPtr<ossimXmlDocument> getXmlDoc() const;
+
+   /**
+    *  @brief Extracts geometry info to keyword list.
+    *  
+    *  Populates the keyword list with image geometry information.  This
+    *  method is used to relay projection/model information to users.
+    *
+    *  @param geomKwl Keyword list that will be initialized with geometry info.
+    *
+    *  @return true if geometry info is present, false if not.
+    */
+   bool getImageGeometry( ossimKeywordlist& geomKwl ) const;
+  
+
+private:
+   
+   ossimRefPtr<ossimXmlNode> getGmljp2V1RootNode() const;
+   ossimRefPtr<ossimXmlNode> getGmljp2V2RootNode() const;
+
+   void getGeoOrigin( const ossimImageGeometry* geom,
+                      const ossimIpt& ul,
+                      ossimString& originString,
+                      ossimString& offsetVector1String, 
+                      ossimString& offsetVector2String ) const;
+
+   void getMapOrigin( const ossimImageGeometry* geom,
+                      const ossimIpt& ul,
+                      ossimString& originString,
+                      ossimString& offsetVector1String, 
+                      ossimString& offsetVector2String ) const;
+
+   void getLimits( const ossimIrect& rect,
+                   ossimString& gridHighString,
+                   ossimString& gridLowString ) const;
+
+   void getGeoBounds( const ossimImageGeometry* geom,
+                      const ossimIrect& rect,
+                      ossimString& upperCornerString,
+                      ossimString& lowerCornerString ) const;
+#if 0
+   bool configureGmljp2V1( ossimRefPtr<ossimXmlNode> node,
+                           const ossimImageGeometry* geom,
+                           const ossimIrect& rect );
+#endif
+   
+   bool configureGmljp2V2( ossimRefPtr<ossimXmlNode> node,
+                           const ossimImageGeometry* geom,
+                           const ossimIrect& rect );
+   
+   bool configureBounds  ( ossimRefPtr<ossimXmlNode> node,
+                           const ossimImageGeometry* geom,
+                           const ossimIrect& rect );
+
+   /**
+    * @brief For sensor model data:
+    * @param geomKwl Initialized by this.
+    */   
+   bool getImageGeometryFromSeonsorModel( ossimKeywordlist& geomKwl ) const;
+
+   /**
+    * @brief For map projected data:
+    * @param geomKwl Initialized by this.
+    */   
+   bool getImageGeometryFromRectifiedGrid( ossimKeywordlist& geomKwl ) const;
+   
+   /**
+    * @brief Adds line and sample to keyword list.
+    * @param xpath0
+    * @param useGmlPrefix If true tack on "gml:" to paths.
+    * @param geomKwl Initialized by this.
+    */
+   bool addLineSamps( const ossimString& xpath0,
+                      bool useGmlPrefix,
+                      ossimKeywordlist& geomKwl ) const;
+
+   /**
+    * @brief Adds tie point to keyword list.
+    * @param xpath0
+    * @param useGmlPrefix If true tack on "gml:" to paths.
+    * @param geomKwl Initialized by this.
+    */
+   bool addTie( const ossimString& xpath0,
+                bool useGmlPrefix,
+                ossim_uint32 pcsCode,
+                ossimKeywordlist& geomKwl ) const;
+
+   /**
+    * @brief Adds tie and scale to keyword list.
+    * @param xpath0
+    * @param useGmlPrefix If true tack on "gml:" to paths.
+    * @param geomKwl Initialized by this.
+    */
+   bool addScale( const ossimString& xpath0,
+                  bool useGmlPrefix,
+                  ossim_uint32 pcsCode,
+                  ossimKeywordlist& geomKwl ) const;
+                  
+   ossimRefPtr<ossimXmlDocument> m_xmlDocument;
+
+   // bool         m_use_gmljp2_version2;
+   ossim_uint32 m_pcsCodeMap;
+   ossim_uint32 m_pcsCodeGeo;
+   ossimString  m_srsNameStringMap;
+   ossimString  m_srsNameStringGeo;
+   ossimString  m_srsDimensionString;
+   ossimString  m_axisLabelsStringMap;
+   ossimString  m_axisLabelsStringGeo;
+   ossimString  m_uomLabelsStringMap;
+   ossimString  m_uomLabelsStringGeo;
+
+};
+
+#endif /* End of "#ifndef ossimGmlSupportData_HEADER" */
diff --git a/include/ossim/support_data/ossimIkonosMetaData.h b/include/ossim/support_data/ossimIkonosMetaData.h
new file mode 100644
index 0000000..d6aae7b
--- /dev/null
+++ b/include/ossim/support_data/ossimIkonosMetaData.h
@@ -0,0 +1,120 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Class declaration for ossimIkonosMetaData.
+// 
+// This class parses a Space Imaging Ikonos meta data file.
+//
+//********************************************************************
+// $Id: ossimIkonosMetaData.h 15828 2009-10-28 13:11:31Z dburken $
+
+#ifndef ossimIkonosMetaData_HEADER
+#define ossimIkonosMetaData_HEADER
+
+#include <iosfwd>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimString.h>
+
+class ossimFilename;
+class ossimKeywordlist;
+
+
+class OSSIMDLLEXPORT ossimIkonosMetaData : public ossimObject
+{
+public:
+
+   /** @brief default constructor */
+   ossimIkonosMetaData();
+
+
+   /**
+    * @brief Open method that takes the image file, derives the metadata,
+    * header and rpc files, then calls parse methods parseMetaData,
+    * parseHdrData, and parseRpcData.
+    *
+    * @param imageFile Usually in the form of "po_2619900_pan_0000000.tif".
+    *
+    * @return true on success, false on error.
+    */
+   bool open(const ossimFilename& imageFile);
+
+   void clearFields();
+   
+   ossimString   getSensorID() const;
+
+   //---
+   // Convenient method to print important image info:
+   //---
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * Method to save the state of the object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0) const;
+   
+   /**
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+
+   /**
+    * @brief Method to parse Ikonos metadata file.
+    *
+    * @param metadata File name usually in the form of
+    * "po_149875_metadata.txt."
+    *
+    * @return true on success, false on error.
+    */
+   bool parseMetaData(const ossimFilename& metadata);
+
+   /**
+    * @brief Method to parse Ikonos header file.
+    *
+    * @param metadata File name usually in the form of
+    * "po_149875_pan_0000000.hdr"
+    *
+    * @return true on success, false on error.
+    */
+   bool parseHdrData(const ossimFilename& data_file);
+
+   /**
+    * @brief Method to parse Ikonos rpc file.
+    *
+    * @param metadata File name usually in the form of
+    * "po_149875_pan_0000000_rpc.txt"
+    *
+    * @return true on success, false on error.
+    *
+    * @note Currently NOT implemented.
+    */
+   bool parseRpcData(const ossimFilename& data_file);
+
+protected:
+   /** virtual destructor */
+   virtual ~ossimIkonosMetaData();
+
+private:
+   ossim_float64 theNominalCollectionAzimuth;
+   ossim_float64 theNominalCollectionElevation;
+   ossim_float64 theSunAzimuth;
+   ossim_float64 theSunElevation;
+   ossim_uint32  theNumBands;
+   ossimString   theBandName;
+   ossimString   theProductionDate;
+   ossimString   theAcquisitionDate;
+   ossimString   theAcquisitionTime;
+   ossimString   theSensorID;
+   
+TYPE_DATA   
+};
+
+#endif /* #ifndef ossimIkonosMetaData_HEADER */
diff --git a/include/ossim/support_data/ossimInfoBase.h b/include/ossim/support_data/ossimInfoBase.h
new file mode 100755
index 0000000..25d1980
--- /dev/null
+++ b/include/ossim/support_data/ossimInfoBase.h
@@ -0,0 +1,105 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Base class for Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimInfoBase_HEADER
+#define ossimInfoBase_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <iosfwd>
+#include <ossim/base/ossimIosFwd.h>
+#include <memory>
+#include <string>
+
+class ossimFilename;
+class ossimKeywordlist;
+
+/**
+ * @brief Info Base.
+ *
+ * This is the base class for all info objects.  The purpose of an Info object
+ * is to dump whatever info is available for a given file name to user.
+ */
+class OSSIM_DLL ossimInfoBase : public ossimReferenced
+{
+public:
+   
+   /** default constructor */
+   ossimInfoBase();
+
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+
+   /**
+    * @brief open method.
+    *
+    * @param str File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(std::shared_ptr<ossim::istream>& str,
+                     const std::string& connectionString);
+
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const = 0;
+
+   /**
+    * @brief Sets the overview flag.
+    * @param flag If true overview info is processed also.
+    */
+   void setProcessOverviewFlag(bool flag);
+   
+   /**
+    * @brief Method to get the overview flag.
+    * @return The overview flag.
+    */
+   bool getProcessOverviewFlag() const;
+
+   /**
+    * @brief Method to dump info to a keyword list.
+    * @param kwl The keyword list to initialize.
+    * @return true on success, false on error.
+    */
+   virtual bool getKeywordlist(ossimKeywordlist& kwl)const;
+
+   /**
+    * @brief Method to dump info to a keyword list.
+    * @param kwl The keyword list to initialize.
+    * @param entryIndex Entry to print.  Not supported by all info objects
+    * yet.
+    * @return true on success, false on error.
+    */
+   virtual bool getKeywordlist(ossimKeywordlist& kwl,
+                               ossim_uint32 entryIndex)const;
+
+protected:
+   /** virtual destructor */
+   virtual ~ossimInfoBase();
+   
+   bool theOverviewFlag; // If true overview information should be processed.
+   
+};
+
+#endif /* End of "#ifndef ossimInfoBase_HEADER" */
diff --git a/include/ossim/support_data/ossimInfoFactory.h b/include/ossim/support_data/ossimInfoFactory.h
new file mode 100644
index 0000000..54b6330
--- /dev/null
+++ b/include/ossim/support_data/ossimInfoFactory.h
@@ -0,0 +1,62 @@
+//---
+//
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description: Factory for info objects.
+// 
+//---
+// $Id$
+
+#ifndef ossimInfoFactory_HEADER
+#define ossimInfoFactory_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoFactoryInterface.h>
+
+class ossimFilename;
+class ossimInfoBase;
+
+/**
+ * @brief Info factory.
+ */
+class OSSIM_DLL ossimInfoFactory : public ossimInfoFactoryInterface
+{
+public:
+
+   /** virtual destructor */
+   virtual ~ossimInfoFactory();
+
+   static ossimInfoFactory* instance();
+
+   /**
+    * @brief create method.
+    *
+    * @param file Some file you want info for.
+    *
+    * @return ossimInfoBase* on success 0 on failure.  Caller is responsible
+    * for memory.
+    */
+   // virtual ossimInfoBase* create(const ossimFilename& file) const;
+   virtual std::shared_ptr<ossimInfoBase> create(const ossimFilename& file) const;
+   
+   virtual std::shared_ptr<ossimInfoBase> create(std::shared_ptr<ossim::istream>& str,
+                                                 const std::string& connectionString)const;
+   
+private:
+   
+   /** hidden from use default constructor */
+   ossimInfoFactory();
+
+   /** hidden from use copy constructor */
+   ossimInfoFactory(const ossimInfoFactory& obj);
+
+   /** hidden from use operator = */
+   const ossimInfoFactory& operator=(const ossimInfoFactory& rhs);
+
+   /** The single instance of this class. */
+   static ossimInfoFactory* theInstance;
+};
+
+#endif /* End of "#ifndef ossimInfoFactory_HEADER" */
diff --git a/include/ossim/support_data/ossimInfoFactoryInterface.h b/include/ossim/support_data/ossimInfoFactoryInterface.h
new file mode 100644
index 0000000..194e718
--- /dev/null
+++ b/include/ossim/support_data/ossimInfoFactoryInterface.h
@@ -0,0 +1,60 @@
+//---
+//
+// License: MIT
+//
+// Author: David Burken
+//
+// Description: Interface for info factories.
+// 
+//---
+// $Id$
+
+#ifndef ossimInfoFactoryInterface_HEADER
+#define ossimInfoFactoryInterface_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+
+class ossimFilename;
+
+//---
+// Note: Deriving from ossimObjectFactory is being backed out as no
+// ossimObjectFactory interfaces were ever called and it introduces warning in
+// the header file so anyone who #includes this gets warnings...
+//
+// We can add back if there is a interface from ossimObjectFactory needed;
+// else, please leave out.
+// 
+// drb 20120518
+//---
+
+/**
+ * @brief Info factory.
+ */
+class OSSIM_DLL ossimInfoFactoryInterface
+{
+public:
+
+   /** default constructor */
+   ossimInfoFactoryInterface(){}
+
+   /** virtual destructor */
+   virtual ~ossimInfoFactoryInterface(){}
+
+   /**
+    * @brief Pure virtual create method.  Derived classes must implement to
+    * be concrete.
+    *
+    * @param file Some file you want info for.
+    *
+    * @return ossimInfoBase* on success 0 on failure.  Caller is responsible
+    * for memory.
+    */
+    virtual std::shared_ptr<ossimInfoBase> create(const ossimFilename& file) const = 0;
+
+    virtual std::shared_ptr<ossimInfoBase> create(std::shared_ptr<ossim::istream>& str,
+                                                  const std::string& connectionString) const = 0;
+
+};
+
+#endif /* End of "#ifndef ossimInfoFactoryInterface_HEADER" */
diff --git a/include/ossim/support_data/ossimInfoFactoryRegistry.h b/include/ossim/support_data/ossimInfoFactoryRegistry.h
new file mode 100644
index 0000000..d286eb8
--- /dev/null
+++ b/include/ossim/support_data/ossimInfoFactoryRegistry.h
@@ -0,0 +1,103 @@
+//---
+//
+// License: MIT
+//
+// Author: David Burken
+//
+// Description: Class declaration of Registry (singleton) for info factories.
+//
+//---
+// $Id$
+
+#ifndef ossimInfoFactoryRegistry_HEADER
+#define ossimInfoFactoryRegistry_HEADER 1
+
+#include <ossim/base/ossimConstants.h> /* for OSSIM_DLL macro */
+#include <ossim/base/ossimIosFwd.h> 
+#include <ossim/support_data/ossimInfoBase.h> 
+#include <OpenThreads/Mutex>
+#include <memory>
+#include <vector>
+
+// Forward class declarations.
+class ossimInfoFactoryInterface;
+class ossimInfoBase;
+class ossimFilename;
+
+class OSSIM_DLL ossimInfoFactoryRegistry
+{
+public:
+   
+   /** destructor */
+   ~ossimInfoFactoryRegistry();
+
+   /**
+    * instance method
+    *
+    * @return Pointer to the instance of the registry.
+    */
+   static ossimInfoFactoryRegistry* instance();
+
+   /**
+    * @brief Method to add factory to registry.
+    * @param factory Factory to register.
+    */
+   void registerFactory(ossimInfoFactoryInterface* factory);
+
+   /**
+    * @brief Adds factory to the front of the registry.
+    * @param factory Factory to register.
+    */
+   void registerFactoryToFront( ossimInfoFactoryInterface* factory );
+                               
+   /**
+    * Method to remove a factory from the registry.  Used by plugins when they
+    * are unloaded.
+    * @param factory Factory to remove.
+    */
+   void unregisterFactory(ossimInfoFactoryInterface* factory);
+
+   /**
+    * @brief Create method.
+    *
+    * @param file Some file you want info for.
+    *
+    * @return ossimInfoBase* on success 0 on failure.  Caller is responsible
+    * for memory.
+    */
+   std::shared_ptr<ossimInfoBase> create(const ossimFilename& file) const;
+
+   /**
+    * @brief Create method.
+    *
+    * @param file Some file you want info for.
+    *
+    * @return ossimInfoBase* on success 0 on failure.  Caller is responsible
+    * for memory.
+    */
+   std::shared_ptr<ossimInfoBase> create( std::shared_ptr<ossim::istream>& str,
+                                          const std::string& connectionString) const;
+
+protected:
+
+   /**
+    * @brief Hidden from use default constructor.
+    * @note Adds ossimInfoFactory to registry.
+    */
+   ossimInfoFactoryRegistry();
+
+   /** @brief hidden from use copy constructor */
+   ossimInfoFactoryRegistry(const ossimInfoFactoryRegistry& obj);
+
+   /** @brief hidden from use assignment operator */
+   const ossimInfoFactoryRegistry& operator=(
+      const ossimInfoFactoryRegistry& rhs);
+   
+   std::vector<ossimInfoFactoryInterface*> m_factoryList;
+
+   OpenThreads::Mutex m_mutex;
+
+   static ossimInfoFactoryRegistry* m_instance;
+};
+
+#endif /* #ifndef ossimInfoFactoryRegistry_HEADER */
diff --git a/include/ossim/support_data/ossimJ2kCodRecord.h b/include/ossim/support_data/ossimJ2kCodRecord.h
new file mode 100644
index 0000000..dd41837
--- /dev/null
+++ b/include/ossim/support_data/ossimJ2kCodRecord.h
@@ -0,0 +1,103 @@
+//---
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Container class for J2K Coding style default (COD) record.
+//
+// See document BPJ2K01.00 Table 7-7 Image and tile size (15444-1 Annex A5.1)
+// 
+//---
+// $Id$
+#ifndef ossimJ2kCodRecord_HEADER
+#define ossimJ2kCodRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+
+#include <iosfwd>
+#include <string>
+
+class OSSIM_DLL ossimJ2kCodRecord
+{
+public:
+   
+   /** default constructor */
+   ossimJ2kCodRecord();
+
+   /** destructor */
+   ~ossimJ2kCodRecord();
+
+   /**
+    * Parse method.  Performs byte swapping as needed.
+    *
+    * @param in Stream to parse.
+    *
+    * @note COD Marker (0xff52) is not read.
+    */
+   void parseStream(std::istream& in);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+
+   /**
+    * @return LRCP, RLCP, RPCL, PCRL, CPRL or unknown.
+    */
+   std::string getProgressionOrderAsString(
+      ossim_uint8 progressionOrder ) const;
+
+   ossim_uint8 getProgressionOrder() const;
+
+   /** operator<< */
+   friend OSSIM_DLL std::ostream& operator<<(
+      std::ostream& out, const ossimJ2kCodRecord& obj);
+
+   /** segmet marker 0xff52 (big endian) */
+   ossim_uint16 m_marker;
+
+   /** length of segment minus marker */
+   ossim_uint16 m_lcod;
+
+   /** Coding style */
+   ossim_uint8 m_scod;
+
+   /** SGcod - Progression order */
+   ossim_uint8 m_progressionOrder;
+
+   /** SGcod - Number of layers */
+   ossim_uint16 m_numberOfLayers;
+
+   /** SGcod - Multiple component transform */
+   ossim_uint8 m_multipleComponentTransform;
+
+   /** SPcod - Number of decomposition levels */
+   ossim_uint8 m_numberOfDecompositionLevels;
+
+   /** SPcod - Code-block width */
+   ossim_uint8 m_codeBlockWidth;
+   
+   /** SPcod - Code-block height */
+   ossim_uint8 m_codeBlockHeight;
+
+   /** SPcod - Code-block height */
+   ossim_uint8 m_codeBlockStyle;
+
+   /** SPcod - transformation (wavelet filter) */
+   ossim_uint8 m_transformation;
+
+    /** SPcod - precinct size (only is defined, Scod = xxxx xxx1) */
+   ossim_uint8 m_precinctSize;
+};
+
+#endif /* End of "#ifndef ossimJ2kCodRecord_HEADER" */
diff --git a/include/ossim/support_data/ossimJ2kInfo.h b/include/ossim/support_data/ossimJ2kInfo.h
new file mode 100644
index 0000000..38e8956
--- /dev/null
+++ b/include/ossim/support_data/ossimJ2kInfo.h
@@ -0,0 +1,124 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: J2K Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimJ2kInfo_HEADER
+#define ossimJ2kInfo_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+
+class ossimEndian;
+
+/**
+ * @brief TIFF info class.
+ *
+ * Encapsulates the listgeo functionality.
+ */
+class OSSIM_DLL ossimJ2kInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimJ2kInfo();
+
+   /** virtual destructor */
+   virtual ~ossimJ2kInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+   
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+protected:
+
+   /** Initializes s reference.  Does byte swapping as needed. */
+   void readUInt16(ossim_uint16& s, std::ifstream& str) const;
+
+   /**
+    * @brief Prints 0xff52 COD_MARKER (0xff52).
+    * @param out Stream to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
+    * "j2k.file_name:"
+    * @param str Input stream to pass to j2k record for parsing.  Should be
+    * just pass the marker.
+    * @return output stream.
+    */
+   std::ostream& printCodMarker(std::ostream& out,
+                                const std::string& prefix,
+                                std::ifstream& str) const;
+
+   /**
+    * @brief Prints 0xff51 SIZ_MARKER (0xff51).
+    * @param out Stream to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
+    * "j2k.file_name:"
+    * @param str Input stream to pass to j2k record for parsing.  Should be
+    * just pass the marker.
+    * @return output stream.
+    */
+   std::ostream& printSizMarker(std::ostream& out,
+                                const std::string& prefix,
+                                std::ifstream& str) const;
+
+   /**
+    * @brief Prints 0xff90 SOT_MARKER (0xff90)
+    * @param out Stream to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
+    * "j2k.file_name:"
+    * @param str Input stream to pass to j2k record for parsing.  Should be
+    * just pass the marker.
+    * @return output stream.
+    */
+   std::ostream& printSotMarker(std::ostream& out,
+                                const std::string& prefix,
+                                std::ifstream& str) const;
+
+   /**
+    * @brief Prints unhandle segment.  This will only print the marker and
+    * record length.
+    * @param out Stream to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
+    * "j2k.file_name:"
+    * @param str Input stream to pass to j2k record for parsing.  Should be
+    * just pass the marker.
+    * @param marker.  The marker.
+    * @return output stream.
+    */
+   std::ostream& printUnknownMarker(std::ostream& out,
+                                    const std::string& prefix,
+                                    std::ifstream& str,
+                                    ossim_uint16 marker) const;
+
+   
+   ossimFilename  m_file;
+   ossimEndian*   m_endian;
+};
+
+#endif /* End of "#ifndef ossimJ2kInfo_HEADER" */
diff --git a/include/ossim/support_data/ossimJ2kSizRecord.h b/include/ossim/support_data/ossimJ2kSizRecord.h
new file mode 100644
index 0000000..a5ecf14
--- /dev/null
+++ b/include/ossim/support_data/ossimJ2kSizRecord.h
@@ -0,0 +1,143 @@
+//---
+// License: MIT
+// Description: Container class for J2K Image and tile size (SIZ) record.
+// See document BPJ2K01.00 Table 7-6 Image and tile size (15444-1 Annex A5.1)
+// $Id$
+//---
+
+#ifndef ossimJ2kSizRecord_HEADER
+#define ossimJ2kSizRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <string>
+#include <vector>
+
+class OSSIM_DLL ossimJ2kSizRecord
+{
+public:
+   
+   /** default constructor */
+   ossimJ2kSizRecord();
+
+   /** destructor */
+   ~ossimJ2kSizRecord();
+
+   /**
+    * Parse method.  Performs byte swapping as needed.
+    *
+    * @param in Stream to parse.
+    *
+    * @note SIZ Marker (0xff51) is not read.
+    */
+   void parseStream(ossim::istream& in);
+
+   /**
+    * Write method.
+    *
+    * @param out Stream to write to.
+    */
+   void writeStream(std::ostream& out);
+
+   /**
+    * @brief Gets the scalar type.
+    * 
+    * Currently assumes all components are the same scalar type.
+    * I.e., only looks at first component.
+    *
+    * @return scalar type based on bit depth and signed bit from theSsiz.
+    */
+   ossimScalarType getScalarType() const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+
+   /** operator<< */
+   friend OSSIM_DLL std::ostream& operator<<(
+      std::ostream& out, const ossimJ2kSizRecord& obj);
+
+   /** segmet marker 0xff51 (big endian) */
+   ossim_uint16 m_marker;
+
+   /** length of segment minus marker */
+   ossim_uint16 m_Lsiz;
+
+   /** profile */
+   ossim_uint16 m_Rsiz;
+
+   /** width of reference grid */
+   ossim_uint32 m_Xsiz;
+
+   /** height of reference grid */
+   ossim_uint32 m_Ysiz;
+
+   /**
+    * Horizontal offset from the orgin of reference grid to the left side
+    * of image.
+    */
+   ossim_uint32 m_XOsiz;
+
+   /**
+    * Vertical offset from the orgin of reference grid to the top
+    * of image.
+    */
+   ossim_uint32 m_YOsiz;
+
+   /** width of one reference tile */
+   ossim_uint32 m_XTsiz;
+   
+   /** height of one reference tile */   
+   ossim_uint32 m_YTsiz;
+
+   /**
+    * Horizontal offset from the orgin of reference grid to the left edge
+    * of first tile.
+    */
+   ossim_uint32 m_XTOsiz;
+
+   /**
+    * Vertical offset from the orgin of reference grid to the top
+    * edge of first tile.
+    */
+   ossim_uint32 m_YTOsiz;
+
+   /** number of component in the image */
+   ossim_uint16 m_Csiz;
+
+   /**
+    * One for each component:
+    * 
+    * sign bit and bit depth of data
+    * unsigned = 0xxx xxxx (msb == 0)
+    * signed   = 1xxx xxxx (msb == 1)
+    * bit depth = x000 0000 + 1 (first seven bits plus one)
+    */
+   std::vector<ossim_uint8> m_Ssiz;
+
+   /**
+    * One for each component:
+    * 
+    * Horizontal separation of a sample of the component with respect to the
+    * reference grid.
+    */
+   std::vector<ossim_uint8> m_XRsiz;
+
+   /**
+    * One for each component:
+    * 
+    * Vertical separation of a sample of the component with respect to the
+    * reference grid.
+    */
+   std::vector<ossim_uint8> m_YRsiz;
+};
+
+#endif /* End of "#ifndef ossimJ2kSizRecord_HEADER" */
diff --git a/include/ossim/support_data/ossimJ2kSotRecord.h b/include/ossim/support_data/ossimJ2kSotRecord.h
new file mode 100644
index 0000000..784c0c6
--- /dev/null
+++ b/include/ossim/support_data/ossimJ2kSotRecord.h
@@ -0,0 +1,89 @@
+//---
+// License: MIT
+// Description: Container class for J2K "Start Of Tile" (SOT) record.
+// marker: FF90
+// See document BPJ2K01.00 Table 7-3 Image and tile size (15444-1 Annex A.4.2)
+// $Id$
+//---
+
+#ifndef ossimJ2kSotRecord_HEADER
+#define ossimJ2kSotRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <string>
+
+class OSSIM_DLL ossimJ2kSotRecord
+{
+public:
+   
+   /** default constructor */
+   ossimJ2kSotRecord();
+
+   /** destructor */
+   ~ossimJ2kSotRecord();
+
+   /**
+    * Parse method.  Performs byte swapping as needed.
+    *
+    * @param in Stream to parse.
+    *
+    * @note Marker is not read.
+    */
+   void parseStream(ossim::istream& in);
+
+   /**
+    * Write method.
+    *
+    * Note: Write includes two marker bytes.
+    *
+    * @param out Stream to write to.
+    */
+   void writeStream(std::ostream& out);
+
+   /**
+    * @brief Sets the tile index.
+    * @param isot
+    */
+   void setIsot( ossim_uint16 isot );
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+   
+   /**
+    * operator<<.
+    */
+   friend OSSIM_DLL std::ostream& operator<<(
+      std::ostream& out, const ossimJ2kSotRecord& obj);
+
+   /** Length in bytes of the marker segment. */
+   ossim_uint16 theLsot;
+
+   /** Tile index. Tiles are in raster order starting at 0. */
+   ossim_uint16 theIsot;
+
+   /** The length in bytes of this record including the SOT marker. */
+   ossim_uint32 thePsot;
+
+   /** Tile-Part index. */
+   ossim_uint8  theTpsot;
+
+   /**
+    * 0 = Number of tile-parts of this tile in the codestream is not defined
+    * in this header.
+    *
+    * 1-255 number of tile-parts of this tile in the codestream.
+    */
+   ossim_uint8  theTnsot;
+};
+
+#endif /* End of "#ifndef ossimJ2kSotRecord_HEADER" */
diff --git a/include/ossim/support_data/ossimJ2kTlmRecord.h b/include/ossim/support_data/ossimJ2kTlmRecord.h
new file mode 100644
index 0000000..138ea10
--- /dev/null
+++ b/include/ossim/support_data/ossimJ2kTlmRecord.h
@@ -0,0 +1,219 @@
+//---
+// 
+// License: MIT
+//
+// Author: David Burken
+// 
+// Description: Container class declaration for J2K Tile-part lengths record.
+// See document BPJ2K01.10 Table 7-21 for detailed description.
+//
+// $Id$
+//---
+
+#ifndef ossimJ2kTlmRecord_HEADER
+#define ossimJ2kTlmRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <string>
+
+class OSSIM_DLL ossimJ2kTlmRecord
+{
+public:
+   
+   /** default constructor */
+   ossimJ2kTlmRecord();
+
+   /** destructor */
+   ~ossimJ2kTlmRecord();
+
+   /**
+    * Parse method.  Performs byte swapping as needed.
+    *
+    * @param in Stream to parse.
+    *
+    * @note SIZ Marker (0xff51) is not read.
+    */
+   void parseStream(ossim::istream& in);
+
+   /**
+    * Write method.
+    *
+    * Note: Write include two marker bytes.
+    *
+    * @param out Stream to write to.
+    */
+   void writeStream(std::ostream& out);
+
+   /**
+    * @return Index of this marker segment relative to other marker
+    * segments in the header.
+    */
+   ossim_uint8 getZtlm() const;
+   
+   /**
+    * @brief Get the ST portion of STLM field( bits 5 and 6).
+    * @return ST bits as an unsigned char.
+    * */
+   ossim_uint8 getSt() const;
+
+   /**
+    * @brief Set the ST bits of STLM field.
+    *
+    * @param bits Either 0, 1, or 2.
+    *
+    * 0 = Ttlm parameter is not present.  Tiles are in order.
+    * 1 = Ttlm parameter 8 bits.
+    * 2 = Ttlm parameter 16 bits.
+    *
+    * @return true if in range; false, if not.
+    */
+   bool setSt(ossim_uint8 bits );
+
+   /** @return The higher order 4 bits of m_Stlm as an unsigned char. */
+   ossim_uint8 getSp() const;
+
+   /**
+    * @brief Set the SP bit of Stlm field.
+    *
+    * @param bit Either 0 or 1.
+    *
+    * 0 = Ptlm parameter 16 bits
+    * 1 = Ptlm parameter 32 bits
+    *
+    * @return true if in range; false, if not.
+    */
+   bool setSp(ossim_uint8 bit );
+
+   /** @return The tile count derived from m_Ltml, sd and sp. */
+   ossim_uint16 getTileCount() const;
+
+   /**
+    * @brief Get the tile length for tile at index from ptlm array.
+    * @param index
+    * @param length Initialized by this to of tile legnth or 0 out of array
+    * bounds.
+    * @return true on success, false if out of bounds.
+    */
+   bool getTileLength( ossim_int32 index,
+                       ossim_uint32& length ) const;
+
+   /**
+    * @brief Sets the tile length for tile at x,y in ptlm array.
+    * @param index
+    * @param length of tile
+    * @return true on success, false if out of bounds.
+    */
+   bool setTileLength( ossim_int32 index,
+                       ossim_uint32 length );
+
+   /**
+    * @brief Adds Ptlm array from first to last.
+    *
+    * The range used is [first,last), which contains all the elements between
+    * first and last, including the element pointed by first but not the
+    * element pointed by last.
+    * 
+    * @param first array index
+    * @param last array index
+    * @param init Initialized by this. This is added to so whatever it starts
+    * with you get that plus the accumlated indexes.
+    * @return true on success; false, on errors.
+    */
+   bool accumulate( ossim_int32 first, ossim_int32 last, std::streampos& init ) const;
+
+   /**
+    * @brief Sets SP bit, initializes ptlm array, and ltlm(size).
+    *
+    * Note: Ptlm array is cleared on this call.
+    *
+    * @param spBit 0 = 16 bit Ptlm parameter, 1 = 32 bit Ptlm parameter.
+    * @param count of ptlm array or tiles.
+    */
+   bool initPtlmArray( ossim_uint8 spBit, ossim_uint16 count );
+
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+
+   /** operator<< */
+   friend OSSIM_DLL std::ostream& operator<<(
+      std::ostream& out, const ossimJ2kTlmRecord& obj);
+
+private:
+   
+   /** @brief Deletes m_Ttlm and m_Ptlm arrays. */
+   void clear();
+
+   /** @brief Deletes m_Ttlm array. */
+   void clearTtlm();
+
+   /** @brief Deletes m_Ptlm array. */
+   void clearPtlm();
+   
+   /**
+    * @brief Computes length of this segment minus marker itself.
+    * @return Length of this segment.
+    */
+   ossim_uint16 computeLength( ossim_uint16 tileCount ) const;
+   
+   /** NOTE: tml segmet marker 0xff55 not stored. */
+
+   /** Length of segment minus marker. */
+   ossim_uint16 m_Ltlm;
+
+   /**
+    * Index of marker segment relative to all other TLM marker segments
+    * present in the current header. 0 - 255
+    */
+   ossim_uint8 m_Ztlm;
+
+   /**
+    *  Indicator for Ttlm and Ptlm field sizes. Two variable in one byte.
+    *
+    *  ST Ttlm is lower order bytes.
+    *  
+    *  0 = Ttlm size = 0  bits, tiles in order. Ttlm size = 0 bits
+    *  1 = Ttlm size = 8  bits, range 0 - 254
+    *  2 = Ttlm size = 16 bits, range 0 - 65535
+    *
+    *  SP Ptlm is upper order bytes.
+    *  
+    *  16 bits if SP = 0, range 14 - 65535
+    *  32 bits if SP = 1, range 14 - (2^31-1)
+    */
+   ossim_uint8 m_Stlm;
+
+   /**
+    * Tile index for tile-parts.  Either none or one value for every tile-part.
+    * 0  bits if ST = 0
+    * 8  bits if ST = 1, range 0 - 254
+    * 16 bits if ST = 2, range 0 - 65534
+    */
+   void* m_Ttlm;
+
+   /**
+    * The length, in bytes, from the beginning of the SOT marker of the
+    * tile-part to the end of the codestream data for that tile-part.
+    * There should be one Ptlm for every tile-part.
+    *
+    * 16 bits if SP = 0, range 14 - 65535
+    * 32 bits if SP = 1, range 14 - (2^32-1)
+    *
+    */
+   void* m_Ptlm;
+
+
+
+};
+
+#endif /* End of "#ifndef ossimJ2kTlmRecord_HEADER" */
diff --git a/include/ossim/support_data/ossimJp2Info.h b/include/ossim/support_data/ossimJp2Info.h
new file mode 100644
index 0000000..594ab61
--- /dev/null
+++ b/include/ossim/support_data/ossimJp2Info.h
@@ -0,0 +1,134 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: JP2 Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimJp2Info.h 23220 2015-04-04 15:39:49Z dburken $
+#ifndef ossimJp2Info_HEADER
+#define ossimJp2Info_HEADER 1
+
+#include <ossim/support_data/ossimJ2kInfo.h>
+
+/**
+ * @brief JP2 info class.
+ */
+class OSSIM_DLL ossimJp2Info : public ossimJ2kInfo
+{
+public:
+
+   /** Anonymous enumerations: */
+   enum
+   {
+      SIGNATURE_BOX_SIZE = 12,
+      GEOTIFF_UUID_SIZE  = 16
+   };
+   
+   /** default constructor */
+   ossimJp2Info();
+
+   /** virtual destructor */
+   virtual ~ossimJp2Info();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief This gets a box of type and stuffs in box.
+    *
+    * Code for copying a box to a buffer. Currently used in ossimOpjWriter
+    * to overcome short falls of trying to write in between the uuid box in
+    * between the jp2h and start of jp2c written by opj_start_compress.
+    *
+    * @param type Defines box type. E.g. 0x6A703268 (jp2h)
+    * @param includeAll if true the length fields are copied. If false
+    * just the DBox is copied.
+    * @param box Initialized by this. LBox and XLBox fields
+    * are NOT copied to the box.
+    * @return is the start position of the box. At the LBox.
+    */
+   std::streamoff getBox( const ossim_uint32 type,
+                          bool includeAll,
+                          std::vector<ossim_uint8>& box ) const;
+
+   /**
+    * @brief This gets a box of type and stuffs in box.
+    *
+    * Code for copying a box to a buffer. Note that stream is not rewound or
+    * cleared if it hits EOF.
+    *
+    * @param type Defines box type. E.g. 0x6A703268 (jp2h)
+    * @param includeAll if true the length fields are copied. If false
+    * just the DBox is copied.
+    * @param str Stream to read from.
+    * @param box Initialized by this. LBox and XLBox fields
+    * are NOT copied to the box.
+    * @return The start position of the box (LBox) or zero if not found.
+    */
+   std::streamoff getBox( const ossim_uint32& type,
+                          bool includeAll,
+                          std::ifstream& str,
+                          std::vector<ossim_uint8>& box ) const;
+   /**
+    * @brief Method to get the embedded JP2 GeoTIFF box. This includes the 16
+    * GEOTIFF_UUID bytes.
+    * @param str Stream to read from.
+    * @return  The start position of the box (LBox) or zero if not found.
+    */
+   std::streamoff getGeotiffBox( std::ifstream& str,
+                                 std::vector<ossim_uint8>& box ) const;
+
+   /**
+    * @brief Method to get the embedded JP2 GML Box.
+    * @param str Stream to read from.
+    * @return  The start position of the box (LBox) or zero if not found.
+    */
+   std::streamoff getGmlBox( std::ifstream& str,
+                             std::vector<ossim_uint8>& box ) const;
+   
+   /**
+    * @brief This finds a box of type and returns the location of its data.
+    *
+    * @param type Defines box type. E.g. 0x6A703268 (jp2h)
+    * @param str Stream to read from.
+    * @param length Number of bytes in the data.
+    * @return The start position of the box (LBox) or zero if not found.
+    */
+   std::streamoff findBoxData( const ossim_uint32& type,
+                               std::ifstream& str,
+                               ossim_uint32& length ) const;
+
+protected:
+
+   /** @brief Print tbox type as string if known. */
+   void printTboxType( ossim_uint32 tbox, std::ostream& out) const;
+
+   /** Initializes i reference.  Does byte swapping as needed. */
+   void readUInt32(ossim_uint32& i, std::ifstream& str) const;
+
+   /** Initializes i reference.  Does byte swapping as needed. */
+   void readUInt64(ossim_uint64& i, std::ifstream& str) const;
+
+};
+
+#endif /* End of "#ifndef ossimJp2Info_HEADER" */
diff --git a/include/ossim/support_data/ossimJpipMessage.h b/include/ossim/support_data/ossimJpipMessage.h
new file mode 100644
index 0000000..88838de
--- /dev/null
+++ b/include/ossim/support_data/ossimJpipMessage.h
@@ -0,0 +1,36 @@
+/*********************************************************************************************
+ *
+ * License: LGPL Please see the top level LICENSE.txt
+ *
+ * Author: Garrett Potts
+ * 
+ *********************************************************************************************/
+#ifndef ossimJpipMessage_HEADER
+#define ossimJpipMessage_HEADER
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/support_data/ossimJpipMessageHeader.h>
+#include <vector>
+class OSSIM_DLL ossimJpipMessage : public ossimReferenced
+{
+public:
+    typedef std::vector<ossim_uint8> MessageBodyType;
+    
+    ossimJpipMessage();
+    void reset();
+    void setHeaderLength(ossim_uint64 length){m_headerLength = length;}
+    ossimJpipMessageHeader* header(){return m_header.get();}
+    const ossimJpipMessageHeader* header()const{return m_header.get();}
+    MessageBodyType& messageBody(){return m_messageBody;}
+    const MessageBodyType& messageBody()const{return m_messageBody;}
+    void dumpBodyAsHex(std::ostream& out)const;
+    void dumpBodyAsText(std::ostream& out)const;
+    
+protected:
+    ossimRefPtr<ossimJpipMessageHeader> m_header;
+    ossim_uint64             m_headerLength;
+    MessageBodyType m_messageBody;
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimJpipMessageDecoder.h b/include/ossim/support_data/ossimJpipMessageDecoder.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimJpipMessageDecoder.h
rename to include/ossim/support_data/ossimJpipMessageDecoder.h
diff --git a/ossim/include/ossim/support_data/ossimJpipMessageHeader.h b/include/ossim/support_data/ossimJpipMessageHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimJpipMessageHeader.h
rename to include/ossim/support_data/ossimJpipMessageHeader.h
diff --git a/include/ossim/support_data/ossimLasHdr.h b/include/ossim/support_data/ossimLasHdr.h
new file mode 100644
index 0000000..5d9a1c7
--- /dev/null
+++ b/include/ossim/support_data/ossimLasHdr.h
@@ -0,0 +1,187 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasHdr.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Container class for LAS LIDAR format public header block.
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasHdr_HEADER
+#define ossimLasHdr_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+
+#include <iosfwd>
+#include <string>
+class ossimKeywordlist;
+
+class OSSIM_DLL ossimLasHdr
+{
+public:
+   
+   /* @brief default constructor */
+   ossimLasHdr();
+
+   /* @brief copy constructor */
+   ossimLasHdr(const ossimLasHdr& hdr);
+
+   /* @brief assignment operator= */
+   const ossimLasHdr& operator=(const ossimLasHdr& hdr);
+
+   /* destructor */
+   ~ossimLasHdr();
+
+   /**
+    * @brief Checks for LASF in first four bytes.
+    * @return true if first four bytes are LASF.
+    */
+   bool checkSignature(std::istream& in) const;   
+
+   /**
+    * @brief Method to initialize from input stream.
+    *
+    * Input stream should be at beginning of file.
+    * 
+    * @param in Stream to read from.
+    */
+   void readStream(std::istream& in);
+
+   /** @brief Writes header to stream. */
+   void writeStream(std::ostream& out);
+
+   /**
+    * @brief print method.
+    * @return std::ostream&
+    */
+   std::ostream& print(std::ostream& out) const;
+
+   /** @brief Convenience operator<< method. */
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimLasHdr& hdr);
+   
+   void getKeywordlist(ossimKeywordlist& kwl) const;
+
+   /** @return True if bit 0 of m_globalEncoding is set, false if not. */
+   bool getGpsTimeTypeBit() const;
+
+   /** @return True if bit 1 of m_globalEncoding is set, false if not. */
+   bool getWaveforDataPacketsInternalBit() const;
+
+   /** @return True if bit 2 of m_globalEncoding is set, false if not. */
+   bool getWaveforDataPacketsExternalBit() const;
+   
+   /** @return True if bit 3 of m_globalEncoding is set, false if not. */
+   bool getReturnsSyntheticallyGeneratedBit() const;
+
+   /** @return True if bit 4 of m_globalEncoding is set, false if not. */
+   bool getWktBit() const;
+   
+   /**
+    * @return The project ID GUID data, e.g.: 55b44da7-7c23-4f86-a54ec39e8f1d1ea1
+    */
+   std::string getProjectIdGuid() const;
+
+   /** @return The major and minor version, e.g.: 1.2 */
+   std::string getVersion() const;
+
+   /** @return The system identifier string. */
+   std::string  getSystemIndentifier() const;
+
+   /** @return The generating software string. */
+   std::string  getGeneratingSoftware() const;
+
+   /** @return Size of this header in bytes. */
+   ossim_uint16 getHeaderSize() const;
+
+   /** @return Offset to point data. */
+   ossim_uint32 getOffsetToPointData() const;
+
+   /** @return The number fo variable length records. */
+   ossim_uint32 getNumberOfVlrs() const;
+
+   /** @return Point data format ID */
+   ossim_uint8 getPointDataFormatId() const;
+
+   /** @return The number of total points. */
+   ossim_uint64 getNumberOfPoints() const;
+
+   /**
+    * @brief Gets number of points for entry where entry is synonymous returns.
+    * @return The number of points for entries 0 through 4.
+    */
+   ossim_uint64 getNumberOfPoints(ossim_uint32 entry) const;
+
+   const ossim_float64& getScaleFactorX() const;
+   const ossim_float64& getScaleFactorY() const;
+   const ossim_float64& getScaleFactorZ() const;
+   const ossim_float64& getOffsetX() const;
+   const ossim_float64& getOffsetY() const;
+   const ossim_float64& getOffsetZ() const;
+   const ossim_float64& getMinX() const;
+   const ossim_float64& getMinY() const;
+   const ossim_float64& getMinZ() const;
+   const ossim_float64& getMaxX() const;
+   const ossim_float64& getMaxY() const;
+   const ossim_float64& getMaxZ() const;
+   
+   
+private:
+
+   /** @brief Performs a swap if system byte order is not little endian. */
+   void swap();
+
+   /**
+    * @brief Test version.
+    * @param major
+    * @param minor
+    * @return true if m_versionMajor and m_versionMinor are greater than major and minor
+    * args.
+    */
+   bool versionGreaterThan( ossim_uint8 major, ossim_uint8 minor ) const;
+
+   char          m_fileSignature[5];
+   ossim_uint16  m_fileSourceId;
+   ossim_uint16  m_globalEncoding;
+   ossim_uint32  m_projectIdGuidData1;
+   ossim_uint16  m_projectIdGuidData2;
+   ossim_uint16  m_projectIdGuidData3;
+   ossim_uint8   m_projectIdGuidData4[8];
+   ossim_uint8   m_versionMajor;
+   ossim_uint8   m_versionMinor;
+   char          m_systemIndentifier[32];
+   char          m_generatingSoftware[32];
+   ossim_uint16  m_fileCreationDay;
+   ossim_uint16  m_fileCreateionYear;
+   ossim_uint16  m_headerSize;
+   ossim_uint32  m_offsetToPointData;
+   ossim_uint32  m_numberOfVariableLengthRecords;
+   ossim_uint8   m_pointDataFormatId;
+   ossim_uint16  m_pointDataRecordLength;
+   ossim_uint32  m_legacyNumberOfPointRecords;            // deprecated 1_4
+   ossim_uint32  m_legacyNumberOfPointsByReturn[5];       // deprecated 1_4
+   ossim_float64 m_xScaleFactor;
+   ossim_float64 m_yScaleFactor;
+   ossim_float64 m_zScaleFactor;
+   ossim_float64 m_xOffset;
+   ossim_float64 m_yOffset;
+   ossim_float64 m_zOffset;
+   ossim_float64 m_maxX;
+   ossim_float64 m_minX;
+   ossim_float64 m_maxY;
+   ossim_float64 m_minY;
+   ossim_float64 m_maxZ;
+   ossim_float64 m_minZ;
+   ossim_uint64  m_startOfWaveformDataPacket;             // Added 1_3
+   ossim_uint64  m_startOfExtendedVariableLengthRecords;  // Added 1_4
+   ossim_uint32  m_numberOfExtendedVariableLengthRecords; // Added 1_4
+   ossim_uint64  m_numberOfPointRecords;                  // Added 1_4
+   ossim_uint64  m_numberOfPointsByReturn[15];            // Added 1_4
+   
+};
+
+#endif /* End of "#ifndef ossimLasHdr_HEADER" */
diff --git a/include/ossim/support_data/ossimLasInfo.h b/include/ossim/support_data/ossimLasInfo.h
new file mode 100644
index 0000000..5a542de
--- /dev/null
+++ b/include/ossim/support_data/ossimLasInfo.h
@@ -0,0 +1,57 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLibLasInfo.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: LAS LIDAR info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasInfo_HEADER
+#define ossimLasInfo_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+
+#include <iosfwd>
+
+/** @brief LAS LIDAR info object. */
+class OSSIM_DLL ossimLasInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimLasInfo();
+
+   /** virtual destructor */
+   virtual ~ossimLasInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+   ossimFilename m_file;
+};
+
+#endif /* End of "#ifndef ossimLasInfo_HEADER" */
diff --git a/include/ossim/support_data/ossimLasPointRecord0.h b/include/ossim/support_data/ossimLasPointRecord0.h
new file mode 100644
index 0000000..dbb1e83
--- /dev/null
+++ b/include/ossim/support_data/ossimLasPointRecord0.h
@@ -0,0 +1,105 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord0.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasPointRecord0_HEADER
+#define ossimLasPointRecord0_HEADER 1
+
+#include <ossim/support_data/ossimLasPointRecordInterface.h>
+
+/**
+ * @class ossimLasPointRecord0
+ *
+ * Container class for LAS point record type 1.
+ */
+class ossimLasPointRecord0 : public ossimLasPointRecordInterface
+{
+public:
+
+   /** @brief default constructor */
+   ossimLasPointRecord0();
+
+   /* @brief copy constructor */
+   ossimLasPointRecord0(const ossimLasPointRecord0& obj);
+
+   /* @brief assignment operator= */
+   const ossimLasPointRecord0& operator=(const ossimLasPointRecord0& copy_this);
+
+   /** @brief destructor */
+   virtual ~ossimLasPointRecord0();
+
+   /** @brief Initialize record from stream. */
+   virtual void readStream(std::istream& in);
+
+   /** @brief Writes record to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @return x */
+   virtual ossim_int32 getX() const;
+
+   /** @return y */
+   virtual ossim_int32 getY() const;
+   
+   /** @return z */
+   virtual ossim_int32 getZ() const;
+
+   /** @return red */
+   virtual ossim_uint16 getRed() const;
+
+   /** @return green */
+   virtual ossim_uint16 getGreen() const;
+
+   /** @return blue */
+   virtual ossim_uint16 getBlue() const;
+
+   /** @return intensity */
+   virtual ossim_uint16 getIntensity() const;
+
+   /** @return return number */
+   virtual ossim_uint8 getReturnNumber() const;
+
+   virtual ossim_uint8 getNumberOfReturns() const;
+   
+   virtual ossim_uint8 getEdgeFlag() const;
+      
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+
+   /** @brief Performs a swap if system byte order is not little endian. */
+   void swap();
+
+   //---
+   // Private structure so we can do a single read/write in the readStream
+   // and writeStream methods.  This sped the code up 5X when doing an ossim-icp
+   // from a LAS file to a tif.
+   //---
+   struct ossimLasPointRecord0Data
+   {
+      ossimLasPointRecord0Data();
+      ossimLasPointRecord0Data(const ossimLasPointRecord0Data& obj);
+      const ossimLasPointRecord0Data& operator=(const ossimLasPointRecord0Data& obj);
+      ossim_int32   m_x;
+      ossim_int32   m_y;
+      ossim_int32   m_z;
+      ossim_uint16  m_intensity;
+      ossim_uint8   m_returnByte;
+      ossim_uint8   m_classification;
+      ossim_int8    m_scanAngleRank;
+      ossim_uint8   m_userData;
+      ossim_uint16  m_pointSourceID;
+   };
+   
+   ossimLasPointRecord0Data m_record;
+};
+
+#endif /* #ifndef ossimLasPointRecord0_HEADER */
+
diff --git a/include/ossim/support_data/ossimLasPointRecord1.h b/include/ossim/support_data/ossimLasPointRecord1.h
new file mode 100644
index 0000000..641b74d
--- /dev/null
+++ b/include/ossim/support_data/ossimLasPointRecord1.h
@@ -0,0 +1,106 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord1.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasPointRecord1_HEADER
+#define ossimLasPointRecord1_HEADER 1
+
+#include <ossim/support_data/ossimLasPointRecordInterface.h>
+
+/**
+ * @class ossimLasPointRecord1
+ *
+ * Container class for LAS point record type 1.
+ */
+class ossimLasPointRecord1 : public ossimLasPointRecordInterface
+{
+public:
+
+   /** @brief default constructor */
+   ossimLasPointRecord1();
+
+   /* @brief copy constructor */
+   ossimLasPointRecord1(const ossimLasPointRecord1& obj);
+
+   /* @brief assignment operator= */
+   const ossimLasPointRecord1& operator=(const ossimLasPointRecord1& copy_this);
+
+   /** @brief destructor */
+   virtual ~ossimLasPointRecord1();
+
+   /** @brief Initialize record from stream. */
+   virtual void readStream(std::istream& in);
+
+   /** @brief Writes record to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @return x */
+   virtual ossim_int32 getX() const;
+
+   /** @return y */
+   virtual ossim_int32 getY() const;
+   
+   /** @return z */
+   virtual ossim_int32 getZ() const;
+
+   /** @return red */
+   virtual ossim_uint16 getRed() const;
+
+   /** @return green */
+   virtual ossim_uint16 getGreen() const;
+
+   /** @return blue */
+   virtual ossim_uint16 getBlue() const;
+
+   /** @return intensity */
+   virtual ossim_uint16 getIntensity() const;
+
+   /** @return return number */
+   virtual ossim_uint8 getReturnNumber() const;
+
+   virtual ossim_uint8 getNumberOfReturns() const;
+   
+   virtual ossim_uint8 getEdgeFlag() const;
+      
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+
+   /** @brief Performs a swap if system byte order is not little endian. */
+   void swap();
+
+   //---
+   // Private structure so we can do a single read/write in the readStream
+   // and writeStream methods.  This sped the code up 5X when doing an ossim-icp
+   // from a LAS file to a tif.
+   //---
+   struct ossimLasPointRecord1Data
+   {
+      ossimLasPointRecord1Data();
+      ossimLasPointRecord1Data(const ossimLasPointRecord1Data& obj);
+      const ossimLasPointRecord1Data& operator=(const ossimLasPointRecord1Data& obj);
+      ossim_int32   m_x;
+      ossim_int32   m_y;
+      ossim_int32   m_z;
+      ossim_uint16  m_intensity;
+      ossim_uint8   m_returnByte;
+      ossim_uint8   m_classification;
+      ossim_int8    m_scanAngleRank;
+      ossim_uint8   m_userData;
+      ossim_uint16  m_pointSourceID;
+      ossim_float64 m_gpsTime;
+   };
+   
+   ossimLasPointRecord1Data m_record;
+};
+
+#endif /* #ifndef ossimLasPointRecord1_HEADER */
+
diff --git a/include/ossim/support_data/ossimLasPointRecord2.h b/include/ossim/support_data/ossimLasPointRecord2.h
new file mode 100644
index 0000000..dcde108
--- /dev/null
+++ b/include/ossim/support_data/ossimLasPointRecord2.h
@@ -0,0 +1,123 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord2.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasPointRecord2_HEADER
+#define ossimLasPointRecord2_HEADER 1
+
+#include <ossim/support_data/ossimLasPointRecordInterface.h>
+
+/**
+ * @class ossimLasPointRecord2
+ *
+ * Container class for LAS point record type 2.
+ */
+class ossimLasPointRecord2 : public ossimLasPointRecordInterface
+{
+public:
+
+   /** @brief default constructor */
+   ossimLasPointRecord2();
+
+   /* @brief copy constructor */
+   ossimLasPointRecord2(const ossimLasPointRecord2& obj);
+
+   /* @brief assignment operator= */
+   const ossimLasPointRecord2& operator=(const ossimLasPointRecord2& copy_this);
+
+   /** @brief destructor */
+   virtual ~ossimLasPointRecord2();
+
+   /** @brief Initialize record from stream. */
+   virtual void readStream(std::istream& in);
+
+   /** @brief Writes record to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @return x */
+   virtual ossim_int32 getX() const;
+
+   /** @return y */
+   virtual ossim_int32 getY() const;
+   
+   /** @return z */
+   virtual ossim_int32 getZ() const;
+
+   /** @return red */
+   virtual ossim_uint16 getRed() const;
+
+   /** @return green */
+   virtual ossim_uint16 getGreen() const;
+
+   /** @return blue */
+   virtual ossim_uint16 getBlue() const;
+
+   /** @return intensity */
+   virtual ossim_uint16 getIntensity() const;
+
+   /** @return return number */
+   virtual ossim_uint8 getReturnNumber() const;
+
+   virtual ossim_uint8 getNumberOfReturns() const;
+   
+   virtual ossim_uint8 getEdgeFlag() const;
+      
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+
+   /** @brief Performs a swap if system byte order is not little endian. */
+   void swap();
+
+   union BitFlags
+   {
+      BitFlags(const BitFlags& obj):m_bits(obj.m_bits){}
+      BitFlags(ossim_uint8 value):m_bits((ossim_uint8)value){}
+      const BitFlags& operator =(const BitFlags& obj){m_bits = obj.m_bits;return *this;}
+      struct
+      {
+         ossim_uint8 m_returnNumber     : 3;
+         ossim_uint8 m_numberOfReturns  : 3;
+         ossim_uint8 m_scanDirection    : 1;
+         ossim_uint8 m_edgeOfFlightLine : 1;
+      };
+      ossim_uint8 m_bits;
+   };
+
+   //---
+   // Private structure so we can do a single read/write in the readStream
+   // and writeStream methods.  This sped the code up 5X when doing an ossim-icp
+   // from a LAS file to a tif.
+   //---
+   struct ossimLasPointRecord2Data
+   {
+      ossimLasPointRecord2Data();
+      ossimLasPointRecord2Data(const ossimLasPointRecord2Data& obj);
+      const ossimLasPointRecord2Data& operator=(const ossimLasPointRecord2Data& obj);
+      ossim_int32   m_x;
+      ossim_int32   m_y;
+      ossim_int32   m_z;
+      ossim_uint16  m_intensity;
+      BitFlags      m_bitFlags;
+      ossim_uint8   m_classification;
+      ossim_int8    m_scanAngleRank;
+      ossim_uint8   m_userData;
+      ossim_uint16  m_pointSourceId;
+      ossim_uint16  m_red;
+      ossim_uint16  m_green;
+      ossim_uint16  m_blue;
+   };
+   
+   ossimLasPointRecord2Data m_record;
+};
+
+#endif /* #ifndef ossimLasPointRecord2_HEADER */
+
diff --git a/include/ossim/support_data/ossimLasPointRecord3.h b/include/ossim/support_data/ossimLasPointRecord3.h
new file mode 100644
index 0000000..e082a49
--- /dev/null
+++ b/include/ossim/support_data/ossimLasPointRecord3.h
@@ -0,0 +1,124 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord3.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasPointRecord3_HEADER
+#define ossimLasPointRecord3_HEADER 1
+
+#include <ossim/support_data/ossimLasPointRecordInterface.h>
+
+/**
+ * @class ossimLasPointRecord3
+ *
+ * Container class for LAS point record type 3.
+ */
+class ossimLasPointRecord3 : public ossimLasPointRecordInterface
+{
+public:
+
+   /** @brief default constructor */
+   ossimLasPointRecord3();
+
+   /* @brief copy constructor */
+   ossimLasPointRecord3(const ossimLasPointRecord3& obj);
+
+   /* @brief assignment operator= */
+   const ossimLasPointRecord3& operator=(const ossimLasPointRecord3& copy_this);
+
+   /** @brief destructor */
+   virtual ~ossimLasPointRecord3();
+
+   /** @brief Initialize record from stream. */
+   virtual void readStream(std::istream& in);
+
+   /** @brief Writes record to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @return x */
+   virtual ossim_int32 getX() const;
+
+   /** @return y */
+   virtual ossim_int32 getY() const;
+   
+   /** @return z */
+   virtual ossim_int32 getZ() const;
+
+   /** @return red */
+   virtual ossim_uint16 getRed() const;
+
+   /** @return green */
+   virtual ossim_uint16 getGreen() const;
+
+   /** @return blue */
+   virtual ossim_uint16 getBlue() const;
+
+   /** @return intensity */
+   virtual ossim_uint16 getIntensity() const;
+
+   /** @return return number */
+   virtual ossim_uint8 getReturnNumber() const;
+
+   virtual ossim_uint8 getNumberOfReturns() const;
+   
+   virtual ossim_uint8 getEdgeFlag() const;
+      
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+
+   /** @brief Performs a swap if system byte order is not little endian. */
+   void swap();
+
+   union BitFlags
+   {
+      BitFlags(const BitFlags& obj):m_bits(obj.m_bits){}
+      BitFlags(ossim_uint8 value):m_bits((ossim_uint8)value){}
+      const BitFlags& operator =(const BitFlags& obj){m_bits = obj.m_bits;return *this;}
+      struct
+      {
+         ossim_uint8 m_returnNumber     : 3;
+         ossim_uint8 m_numberOfReturns  : 3;
+         ossim_uint8 m_scanDirection    : 1;
+         ossim_uint8 m_edgeOfFlightLine : 1;
+      };
+      ossim_uint8 m_bits;
+   };
+
+   //---
+   // Private structure so we can do a single read/write in the readStream
+   // and writeStream methods.  This sped the code up 5X when doing an ossim-icp
+   // from a LAS file to a tif.
+   //---
+   struct ossimLasPointRecord3Data
+   {
+      ossimLasPointRecord3Data();
+      ossimLasPointRecord3Data(const ossimLasPointRecord3Data& obj);
+      const ossimLasPointRecord3Data& operator=(const ossimLasPointRecord3Data& obj);
+      ossim_int32   m_x;
+      ossim_int32   m_y;
+      ossim_int32   m_z;
+      ossim_uint16  m_intensity;
+      BitFlags      m_bitFlags;
+      ossim_uint8   m_classification;
+      ossim_int8    m_scanAngleRank;
+      ossim_uint8   m_userData;
+      ossim_uint16  m_pointSourceId;
+      ossim_float64 m_gpsTime;
+      ossim_uint16  m_red;
+      ossim_uint16  m_green;
+      ossim_uint16  m_blue;
+   };
+   
+   ossimLasPointRecord3Data m_record;
+};
+
+#endif /* #ifndef ossimLasPointRecord3_HEADER */
+
diff --git a/include/ossim/support_data/ossimLasPointRecord4.h b/include/ossim/support_data/ossimLasPointRecord4.h
new file mode 100644
index 0000000..b4fcd76
--- /dev/null
+++ b/include/ossim/support_data/ossimLasPointRecord4.h
@@ -0,0 +1,128 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord4.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: David Burken
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasPointRecord4_HEADER
+#define ossimLasPointRecord4_HEADER 1
+
+#include <ossim/support_data/ossimLasPointRecordInterface.h>
+
+/**
+ * @class ossimLasPointRecord4
+ *
+ * Container class for LAS point record type 4.
+ */
+class ossimLasPointRecord4 : public ossimLasPointRecordInterface
+{
+public:
+
+   /** @brief default constructor */
+   ossimLasPointRecord4();
+
+   /* @brief copy constructor */
+   ossimLasPointRecord4(const ossimLasPointRecord4& obj);
+
+   /* @brief assignment operator= */
+   const ossimLasPointRecord4& operator=(const ossimLasPointRecord4& copy_this);
+
+   /** @brief destructor */
+   virtual ~ossimLasPointRecord4();
+
+   /** @brief Initialize record from stream. */
+   virtual void readStream(std::istream& in);
+
+   /** @brief Writes record to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @return x */
+   virtual ossim_int32 getX() const;
+
+   /** @return y */
+   virtual ossim_int32 getY() const;
+   
+   /** @return z */
+   virtual ossim_int32 getZ() const;
+
+   /** @return red */
+   virtual ossim_uint16 getRed() const;
+
+   /** @return green */
+   virtual ossim_uint16 getGreen() const;
+
+   /** @return blue */
+   virtual ossim_uint16 getBlue() const;
+
+   /** @return intensity */
+   virtual ossim_uint16 getIntensity() const;
+
+   /** @return return number */
+   virtual ossim_uint8 getReturnNumber() const;
+
+   virtual ossim_uint8 getNumberOfReturns() const;
+   
+   virtual ossim_uint8 getEdgeFlag() const;
+      
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+
+   /** @brief Performs a swap if system byte order is not little endian. */
+   void swap();
+
+   union BitFlags
+   {
+      BitFlags(const BitFlags& obj):m_bits(obj.m_bits){}
+      BitFlags(ossim_uint8 value):m_bits((ossim_uint8)value){}
+      const BitFlags& operator =(const BitFlags& obj){m_bits = obj.m_bits;return *this;}
+      struct
+      {
+         ossim_uint8 m_returnNumber     : 3;
+         ossim_uint8 m_numberOfReturns  : 3;
+         ossim_uint8 m_scanDirection    : 1;
+         ossim_uint8 m_edgeOfFlightLine : 1;
+      };
+      ossim_uint8 m_bits;
+   };
+
+   //---
+   // Private structure so we can do a single read/write in the readStream
+   // and writeStream methods.  This sped the code up 5X when doing an ossim-icp
+   // from a LAS file to a tif.
+   //---
+   struct ossimLasPointRecord4Data
+   {
+      ossimLasPointRecord4Data();
+      ossimLasPointRecord4Data(const ossimLasPointRecord4Data& obj);
+      const ossimLasPointRecord4Data& operator=(const ossimLasPointRecord4Data& obj);
+      ossim_int32   m_x;
+      ossim_int32   m_y;
+      ossim_int32   m_z;
+      ossim_uint16  m_intensity;
+      BitFlags      m_bitFlags;
+      ossim_uint8   m_classification;
+      ossim_int8    m_scanAngleRank;
+      ossim_uint8   m_userData;
+      ossim_uint16  m_pointSourceId;
+      ossim_float64 m_gpsTime;
+      ossim_uint8   m_wavePacketDescriptorIndex;
+      ossim_uint64  m_byteOffsetToWaveformData;
+      ossim_uint32  m_waveformPacketSizeInBytes;
+      ossim_float64 m_returnPointWaveformLocation;
+      ossim_uint16  m_red;
+      ossim_uint16  m_green;
+      ossim_uint16  m_blue;
+   };
+   
+   ossimLasPointRecord4Data m_record;
+};
+
+#endif /* #ifndef ossimLasPointRecord4_HEADER */
+
diff --git a/include/ossim/support_data/ossimLasPointRecordInterface.h b/include/ossim/support_data/ossimLasPointRecordInterface.h
new file mode 100644
index 0000000..a11d167
--- /dev/null
+++ b/include/ossim/support_data/ossimLasPointRecordInterface.h
@@ -0,0 +1,49 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecordInterface.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimLasPointRecordInterface_HEADER
+#define ossimLasPointRecordInterface_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <iosfwd>
+
+/**
+ * @class ossimLasPointRecordInterface
+ *
+ * OSSIM Interface for LAS point record types.
+ */
+class ossimLasPointRecordInterface
+{
+public:
+
+   /** @brief Virtual destructor defined to squash compiler errors. */
+   virtual ~ossimLasPointRecordInterface(){}
+   
+   virtual void readStream(std::istream& in) = 0;
+   virtual void writeStream(std::ostream& out) = 0;
+
+   virtual ossim_uint16 getRed() const = 0;
+   virtual ossim_uint16 getGreen() const = 0;
+   virtual ossim_uint16 getBlue() const = 0;
+   virtual ossim_uint16 getIntensity() const = 0;
+   virtual ossim_int32  getX() const = 0;
+   virtual ossim_int32  getY() const = 0;
+   virtual ossim_int32  getZ() const = 0;
+   virtual ossim_uint8  getReturnNumber() const = 0;
+   virtual ossim_uint8  getNumberOfReturns() const = 0;
+   virtual ossim_uint8  getEdgeFlag() const = 0;
+   
+   virtual std::ostream& print(std::ostream& out) const = 0;
+};
+
+#endif /* #ifndef ossimLasPointRecordInterface_HEADER */
+
diff --git a/include/ossim/support_data/ossimNitfAcftbTag.h b/include/ossim/support_data/ossimNitfAcftbTag.h
new file mode 100644
index 0000000..e9301a6
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfAcftbTag.h
@@ -0,0 +1,403 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ACFTB - Aircraft Infomation Extension Format tag class
+// declaration.
+//
+// See document STDI-0002 (version 3), Appendix E, Table E-6 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimNitfAcftbTag_HEADER
+#define ossimNitfAcftbTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfAcftbTag : public ossimNitfRegisteredTag
+{
+public:
+
+   enum 
+   {
+      CEL_SIZE               = 207,
+      AC_MSN_ID_SIZE         = 20,
+      AC_TAIL_NO_SIZE        = 10,
+      AC_TO_SIZE             = 12,
+      SENSOR_ID_TYPE_SIZE    = 4,
+      SENSOR_ID_SIZE         = 6,
+      SCENE_SOURCE_SIZE      = 1,
+      SCNUM_SIZE             = 6,
+      PDATE_SIZE             = 8,
+      IMHOSTNO_SIZE          = 6,
+      IMREQID_SIZE           = 5,
+      MPLAN_SIZE             = 3,
+      ENTLOC_SIZE            = 25,
+      LOC_ACCY_SIZE          = 6,
+      ENTELV_SIZE            = 6,
+      ELV_UNIT_SIZE          = 1,
+      EXITLOC_SIZE           = 25,
+      EXITELV_SIZE           = 6,
+      TMAP_SIZE              = 7,
+      ROW_SPACING_SIZE       = 7,
+      ROW_SPACING_UNITS_SIZE = 1,
+      COL_SPACING_SIZE       = 7,
+      COL_SPACING_UINTS_SIZE = 1,
+      FOCAL_LENGTH_SIZE      = 6,
+      SENSERIAL_SIZE         = 6,
+      ABSWVER_SIZE           = 7,
+      CAL_DATE_SIZE          = 8,
+      PATCH_TOT_SIZE         = 4,
+      MTI_TOT_SIZE           = 3
+   };
+   
+   /** @brief default constructor */
+   ossimNitfAcftbTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfAcftbTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(ossim::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(ossim::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   ossimString getFocalLength()const;
+   ossimString getColumnSpacing()const;
+   ossimString getColumnSpacingUnits()const;
+   ossimString getRowSpacing()const;
+   ossimString getRowSpacingUnits()const;
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+protected:
+
+   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
+   
+   /**
+    * FIELD: AC_MSN_ID
+    *
+    * TYPE: R
+    * 
+    * 20 byte field
+    *
+    * Aircraft Mission Identification
+    */
+   char theAcMsnId[AC_MSN_ID_SIZE+1];
+
+   /**
+    * FIELD: AC_TAIL_NO
+    *
+    * TYPE: <R>
+    * 
+    * 10 byte field
+    *
+    * Aircraft Tail Number
+    */
+   char theAcTailNo[AC_TAIL_NO_SIZE+1];
+   
+   /**
+    * FIELD: AC_TO
+    *
+    * TYPE: <R>
+    * 
+    * 12 byte field
+    *
+    * Aircraft Take-off, CCYYMMDDhhmm
+    */
+   char theAcTo[AC_TO_SIZE+1];
+
+   /**
+    * FIELD: SENSOR_ID_TYPE
+    *
+    * TYPE: R
+    * 
+    * 4 byte field
+    *
+    * Sensor ID Type
+    */
+   char theSensorIdType[SENSOR_ID_TYPE_SIZE+1];
+   
+   /**
+    * FIELD: SENSOR_ID
+    *
+    * TYPE: R
+    * 
+    * 6 byte field
+    *
+    * Sensor ID 
+    */
+   char theSensorId[SENSOR_ID_SIZE+1];
+
+   /**
+    * FIELD: SCENE_SOURCE
+    *
+    * TYPE: <R>
+    * 
+    * 1 byte field
+    *
+    * Scene Source, 0 to 9
+    */
+   char theSceneSource[SCENE_SOURCE_SIZE+1];
+   
+   /**
+    * FIELD: SCNUM
+    *
+    * TYPE: R
+    * 
+    * 6 byte field
+    *
+    * Scene Number, 000000 to 999999
+    */
+   char theScNum[SCNUM_SIZE+1];
+
+   /**
+    * FIELD: PDATE
+    *
+    * TYPE: R
+    * 
+    * 8 byte field
+    *
+    * Processing Date, CCYYMMDD
+    */
+   char thePDate[PDATE_SIZE+1];
+   
+   /**
+    * FIELD: IMHOSTNO
+    *
+    * TYPE: R
+    * 
+    * 6 byte field
+    *
+    * Immediate Scene Host
+    */
+   char theImHostNo[IMHOSTNO_SIZE+1];
+
+   /**
+    * FIELD: IMREQID
+    *
+    * TYPE: R
+    * 
+    * 5 byte field
+    *
+    * Immediate Scene Request ID, 00000, 00001 to 99999
+    */
+   char theImReqID[IMREQID_SIZE+1];
+   
+   /**
+    * FIELD: MPLAN
+    *
+    * TYPE: R
+    * 
+    * 3 byte field
+    *
+    * Mission Plan Mode, 001 to 999
+    */
+   char theMPlan[MPLAN_SIZE+1];
+
+   /**
+    * FIELD: ENTLOC
+    *
+    * TYPE: <R>
+    * 
+    * 25 byte field
+    *
+    * Entry Location
+    */
+   char theEntLoc[ENTLOC_SIZE+1];
+
+   /**
+    * FIELD: LOC_ACCY
+    *
+    * TYPE: R
+    * 
+    * 6 byte field
+    *
+    * Location Accuracy, feet, 000.01 to 999.99, 000000, 000.00
+    */
+   char theLocAccy[LOC_ACCY_SIZE+1];
+   
+   /**
+    * FIELD: ENTELV
+    *
+    * TYPE: <R>
+    * 
+    * 6 byte field
+    *
+    * Entry Elevation, feet or meters, -01000 to +30000
+    */
+   char theEntelv[ENTELV_SIZE+1];
+
+   /**
+    * FIELD: ELV_UNIT
+    *
+    * TYPE: <R>
+    * 
+    * 1 byte field
+    *
+    * Unit of Elevation, f or m
+    */
+   char theElvUnit[ELV_UNIT_SIZE+1];
+   
+   /**
+    * FIELD: EXITLOC
+    *
+    * TYPE: <R>
+    * 
+    * 25 byte field
+    *
+    * Exit Location
+    */
+   char theExitLoc[EXITLOC_SIZE+1];
+
+   /**
+    * FIELD: EXITELV
+    *
+    * TYPE: <R>
+    * 
+    * 6 byte field
+    *
+    * Exit Elevation
+    */
+   char theExitElev[EXITELV_SIZE+1];
+   
+   /**
+    * FIELD: TMAP
+    *
+    * TYPE: <R>
+    * 
+    * 7 byte field
+    *
+    * True Map Angle, degrees, 000.000 to 180.000
+    */
+   char theTMap[TMAP_SIZE+1];
+
+   /**
+    * FIELD: ROW_SPACING
+    *
+    * TYPE: R
+    * 
+    * 7 byte field
+    *
+    * Row Spacing, feet, meters, rads. 
+    */
+   char theRowSpacing[ROW_SPACING_SIZE+1];
+
+   /**
+    * FIELD: ROW_SPACING_UNITS
+    *
+    * TYPE: R
+    * 
+    * 1 byte field
+    *
+    * Unit of Row Spacing, f, m, r or u
+    */
+   char theRowSpacingUnits[ROW_SPACING_UNITS_SIZE+1];
+
+   /**
+    * FIELD: COL_SPACING
+    *
+    * TYPE: R
+    * 
+    * 7 byte field
+    *
+    * Column Spacing
+    */
+   char theColSpacing[COL_SPACING_SIZE+1];
+
+   /**
+    * FIELD: COL_SPACING_UINTS
+    *
+    * TYPE: R
+    * 
+    * 1 byte field
+    *
+    * Unit of Column Spacing
+    */
+   char theColSpacingUnits[COL_SPACING_UINTS_SIZE+1];
+   
+   /**
+    * FIELD: FOCAL_LENGTH
+    *
+    * TYPE: R
+    * 
+    * 6 byte field
+    *
+    * Sensor Focal Length, cm, 000.01 to 899.99, 999.99
+    */
+   char theFocalLength[FOCAL_LENGTH_SIZE+1];
+
+   /**
+    * FIELD: SENSERIAL
+    *
+    * TYPE: <R>
+    * 
+    * 6 byte field
+    *
+    * Sensor vendor's serial number, 000001 to 999999
+    */
+   char theSenserial[SENSERIAL_SIZE+1];
+   
+   /**
+    * FIELD: ABSWVER
+    *
+    * TYPE: <R>
+    * 
+    * 7byte field
+    *
+    * Airborne Software Version
+    */
+   char theAbSwVer[ABSWVER_SIZE+1];
+
+   /**
+    * FIELD: CAL_DATE
+    *
+    * TYPE: <R>
+    * 
+    * 8 byte field
+    *
+    * Calibration Date, CCYYMMDD
+    */
+   char theCalDate[CAL_DATE_SIZE+1];
+   
+   /**
+    * FIELD: PATCH_TOT
+    *
+    * TYPE: R
+    * 
+    * 4 byte field
+    *
+    * Patch Total
+    */
+   char thePatchTot[PATCH_TOT_SIZE+1];
+
+   /**
+    * FIELD: MTI_TOT
+    *
+    * TYPE: R
+    * 
+    * 3 byte field
+    *
+    * MTI Total, SAR: 000 to 999, EO-IR: 000
+    */
+   char theMtiTot[MTI_TOT_SIZE+1];
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfAcftbTag_HEADER */
diff --git a/include/ossim/support_data/ossimNitfAimidbTag.h b/include/ossim/support_data/ossimNitfAimidbTag.h
new file mode 100644
index 0000000..4c8095f
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfAimidbTag.h
@@ -0,0 +1,278 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: AIMIDB - Additional Image ID Extension Format
+// tag class declaration.
+//
+// See document STDI-0002 (version 3), Appendix E, Table E-3 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimNitfAimidbTag_HEADER
+#define ossimNitfAimidbTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfAimidbTag : public ossimNitfRegisteredTag
+{
+public:
+
+   enum 
+   {
+      CEL_SIZE                    = 89,
+      ACQUISITION_DATE_SIZE       = 14,
+      MISSION_NO_SIZE             = 4,
+      MISSION_IDENTIFICATION_SIZE = 10,
+      FLIGHT_NO_SIZE              = 2,
+      OP_NUM_SIZE                 = 3,
+      CURRENT_SEGMENT_SIZE        = 2,
+      REPRO_NUM_SIZE              = 2,
+      REPLAY_SIZE                 = 3,
+      RESERVED_1_SIZE             = 1,
+      START_TILE_COLUMN_SIZE      = 3,
+      START_TILE_ROW_SIZE         = 5,
+      END_SEGMENT_SIZE            = 2,
+      END_TILE_COLUMN_SIZE        = 3,
+      END_TILE_ROW_SIZE           = 5,
+      COUNTRY_SIZE                = 2,
+      RESERVED_2_SIZE             = 4,
+      LOCATION_SIZE               = 11,
+      RESERVED_3_SIZE             = 13
+    };
+   
+   /** @brief default constructor */
+   ossimNitfAimidbTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfAimidbTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(ossim::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(ossim::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+protected:
+
+   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
+   
+   /**
+    * FIELD: ACQUISITION_DATE
+    *
+    * TYPE: R
+    * 
+    * 14 byte field
+    *
+    * CCYYMMDDhhmmss
+    */
+   char theAcquisitionDate[ACQUISITION_DATE_SIZE+1];
+
+   /**
+    * FIELD: MISSION_NO
+    *
+    * TYPE: R
+    *
+    * 4 byte field
+    *
+    * Mission Number
+    */
+   char theMissionNumber[MISSION_NO_SIZE+1];
+
+   /**
+    * FIELD: MISSION_IDENTIFICATION
+    *
+    * TYPE: R
+    *
+    * 10 byte field
+    *
+    * Name of the Mission.
+    */
+   char theMissionIdentification[MISSION_IDENTIFICATION_SIZE+1];
+   
+   /**
+    * FIELD: FLIGHT_NO
+    *
+    * TYPE: R
+    *
+    * 2 byte field
+    *
+    * Flight Number
+    */
+   char theFlightNo[FLIGHT_NO_SIZE+1];
+
+   /**
+    * FIELD: OP_NUM
+    *
+    * TYPE: R
+    *
+    * 3 byte field
+    *
+    * Image Operation Number 000 to 999
+    */
+   char theOpNum[OP_NUM_SIZE+1];
+   
+   /**
+    * FIELD: CURRENT_SEGMENT
+    *
+    * TYPE: R
+    *
+    * 2 byte field
+    *
+    * Current Segment ID, AA to ZZ
+    */
+   char theCurrentSegment[CURRENT_SEGMENT_SIZE+1];
+
+   /**
+    * FIELD: REPRO_NUM
+    *
+    * TYPE: R
+    *
+    * 2 byte field
+    *
+    * Reprocess Number, 00 to 99
+    */
+   char theReproNum[REPRO_NUM_SIZE+1];
+   
+   /**
+    * FIELD: REPLAY
+    *
+    * TYPE: <R>
+    *
+    * 3 byte field
+    *
+    * Replay
+    */
+   char theReplay[REPLAY_SIZE+1];
+
+   /**
+    * FIELD: RESERVED_1
+    *
+    * TYPE: R
+    *
+    * 1 byte field
+    *
+    * 1 space
+    */
+   char theReserved1[RESERVED_1_SIZE+1];
+   
+   /**
+    * FIELD: START_TILE_COLUMN
+    *
+    * TYPE: R
+    *
+    * 3 byte field
+    *
+    * Starting Tile Column Number, 001 to 099
+    */
+   char theStartTileColumn[START_TILE_COLUMN_SIZE+1];
+
+   /**
+    * FIELD: START_TILE_ROW
+    *
+    * TYPE: R
+    *
+    * 5 byte field
+    *
+    * Starting Tile Row Number, 00001 to 99999
+    */
+   char theStartTileRow[START_TILE_ROW_SIZE+1];
+   
+   /**
+    * FIELD: END_SEGMENT
+    *
+    * TYPE: R
+    *
+    * 2 byte field
+    *
+    * Ending Segment, 00, AA to ZZ
+    */
+   char theEndSegment[END_SEGMENT_SIZE+1];
+
+   /**
+    * FIELD: END_TILE_COLUMN
+    *
+    * TYPE: R
+    *
+    * 3 byte field
+    *
+    * Ending Tile Column Number, 001 to 099
+    */
+   char theTileColumn[END_TILE_COLUMN_SIZE+1];
+   
+   /**
+    * FIELD: END_TILE_ROW
+    *
+    * TYPE: R
+    *
+    * 5 byte field
+    *
+    * Ending Tile Row Number, 00001 to 99999
+    */
+   char theTileRow[END_TILE_ROW_SIZE+1];
+
+   /**
+    * FIELD: COUNTRY
+    *
+    * TYPE: <R>
+    *
+    * 2 byte field
+    *
+    * Country Code, AA to ZZ
+    */
+   char theCountry[COUNTRY_SIZE+1];
+   
+   /**
+    * FIELD: RESERVED_2
+    *
+    * TYPE: R
+    *
+    * 4 byte field
+    *
+    * 4 spaces
+    */
+   char theReserved2[RESERVED_2_SIZE+1];
+
+   /**
+    * FIELD: LOCATION
+    *
+    * TYPE: <R>
+    *
+    * 11 byte field
+    *
+    * Location, ddmmXdddmmY, spaces
+    */
+   char theLocation[LOCATION_SIZE+1];
+
+   /**
+    * FIELD: RESERVED_3
+    *
+    * TYPE: R
+    *
+    * 13 byte field
+    *
+    * 13 spaces
+    */
+   char theReserved3[RESERVED_3_SIZE+1];
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfAimidbTag_HEADER */
diff --git a/include/ossim/support_data/ossimNitfBlockaTag.h b/include/ossim/support_data/ossimNitfBlockaTag.h
new file mode 100644
index 0000000..a1431c1
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfBlockaTag.h
@@ -0,0 +1,336 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: BLOCKA tag class declaration.
+//
+// See document STDI-0002 Table 8-9 for more info.
+// 
+// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimNitfBlockaTag_HEADER
+#define ossimNitfBlockaTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class ossimDpt;
+
+class OSSIM_DLL ossimNitfBlockaTag : public ossimNitfRegisteredTag
+{
+public:
+   enum 
+   {
+      BLOCK_INSTANCE_SIZE = 2,
+      N_GRAY_SIZE         = 5,
+      L_LINES_SIZE        = 5,
+      LAYOVER_ANGLE_SIZE  = 3,
+      SHADOW_ANGLE_SIZE   = 3,
+      FIELD_6_SIZE        = 16, // reserved
+      FRLC_LOC_SIZE       = 21,
+      LRLC_LOC_SIZE       = 21,
+      LRFC_LOC_SIZE       = 21,
+      FRFC_LOC_SIZE       = 21,
+      FIELD_11_SIZE       = 5,  // reserved
+      //                -----
+      //                  123
+   };
+   
+   /** default constructor */
+   ossimNitfBlockaTag();
+  
+   /**
+    * Parse method.
+    *
+    * @param in Stream to parse.
+    */
+   virtual void parseStream(ossim::istream& in);
+   
+   /**
+    * Write method.
+    *
+    * @param out Stream to write to.
+    */
+   virtual void writeStream(ossim::ostream& out);
+   
+   /**
+    * Clears all string fields within the record to some default nothingness.
+    */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+
+   /** @param block number to set block instance to.  Valid range 01 to 99. */
+   void setBlockInstance(ossim_uint32 block);
+
+   
+   /** @return theBlockInstance as a string. */
+   ossimString getBlockInstance() const;
+   
+   /**
+    * @param grayCount Count of gray fill.
+    *
+    * Valid range:  0 to 99999
+    */
+   void setNGray(ossim_uint32 grayCount);
+   
+   /** @return theNGray as a string. */
+   ossimString getNGray() const;
+   
+   /**
+    * @param lines Number of rows.
+    *
+    * Valid range:  0 to 99999
+    */
+   void setLLines(ossim_uint32 lines);
+   
+   /** @return theLLines as a string. */
+   ossimString getLLines() const;
+   
+   /**
+    * @param angle Value to set theLayoverAngle to.
+    *
+    * Valid range: 000 to 359 or spaces
+    */
+   void setLayoverAngle(ossim_uint32 angle);
+   
+   /** @return theLayoverAngle as a string. */
+   ossimString getLayoverAngle() const;
+   
+   /**
+    * @param angle Value to set theLayoverAngle to.
+    *
+    * Valid range: 000 to 359 or spaces
+    */
+   void setShadowAngle(ossim_uint32 angle);
+   
+   /** @return theLayoverAngle as a string. */
+   ossimString getShadowAngle() const;
+   
+   /**
+    * Convert latitude and logitude to theFrlcLoc string.
+    * 
+    * @param pt Ground point of first row, last column.
+    *
+    * @param longitude Longitude portion in decimal degrees.
+    */
+   void setFrlcLoc(const ossimDpt& pt);
+   
+   /** @return theFrlcLoc as a string. */
+   ossimString getFrlcLoc() const;
+   
+   /** @param pt Ground point to initialize with location. */
+   void getFrlcLoc(ossimDpt& pt) const;
+
+   /**
+    * Convert latitude and logitude to theLrlcLoc string.
+    * 
+    * @param pt Ground point of last row, last column.
+    *
+    * @param longitude Longitude portion in decimal degrees.
+    */
+   void setLrlcLoc(const ossimDpt& pt);
+   
+   /** @return theLrlcLoc as a string. */
+   ossimString getLrlcLoc() const;
+   
+   /** @param pt Ground point to initialize with location. */
+   void getLrlcLoc(ossimDpt& pt) const;
+
+      /**
+    * Convert latitude and logitude to theLrfcLoc string.
+    * 
+    * @param pt Ground point of last row, first column.
+    *
+    * @param longitude Longitude portion in decimal degrees.
+    */
+   void setLrfcLoc(const ossimDpt& pt);
+   
+   /** @return theLrfcLoc as a string. */
+   ossimString getLrfcLoc() const;
+   
+   /** @param pt Ground point to initialize with location. */
+   void getLrfcLoc(ossimDpt& pt) const;
+
+   /**
+    * Convert latitude and logitude to theFrfcLoc string.
+    * 
+    * @param pt Ground point of first row, first column.
+    *
+    * @param longitude Longitude portion in decimal degrees.
+    */
+   void setFrfcLoc(const ossimDpt& pt);
+   
+   /** @return theFrfcLoc as a string. */
+   ossimString getFrfcLoc() const;
+   
+   /** @param pt Ground point to initialize with location. */
+   void getFrfcLoc(ossimDpt& pt) const;
+   
+protected:
+
+   /**
+    * Parses location string and initializes pt with result.
+    *
+    * @param locationString String to parse.
+    *
+    * @param pt Point to initialize.
+    */
+   void converLocStringToPt(const ossimString& locationString,
+                            ossimDpt& pt) const;
+                            
+   
+   /**
+    * FIELD: BLOCK_INSTANCE
+    *
+    * required 2 byte field
+    *
+    * 01 to 99
+    * 
+    * Block number of the image.
+    */
+   char theBlockInstance[BLOCK_INSTANCE_SIZE+1];
+   
+   /**
+    * FIELD: N_GRAY
+    *
+    * required 5 byte field
+    *
+    * 00000 to 99999
+    *
+    * SAR The number of gray fill pixels.
+    *
+    * EO-IR: 00000
+    */
+   char theNGray[N_GRAY_SIZE+1];
+   
+   /**
+    * FIELD: L_LINES
+    *
+    * required 5 byte field
+    *
+    * 00000 to 99999
+    *
+    * Row count.
+    */
+   char theLLines[L_LINES_SIZE+1];
+   
+   /**
+    * FIELD: LAYOVER_ANGLE
+    *
+    * required 3 byte field
+    *
+    * 000 to 359 or spaces
+    * 
+    * SAR: Angle between the first row of pixels and the layover direction in
+    * the image, measured in a clockwise direction.
+    *
+    * EO-IR: spaces
+    */
+   char theLayoverAngle[LAYOVER_ANGLE_SIZE+1];
+   
+   /**
+    * FIELD: SHADOW_ANGLE
+    *
+    * required 3 byte field
+    *
+    * 000 to 359 or spaces
+    *
+    * SAR: Angle between the first row of pixels and the radar shadow in
+    * the image, measured in a clockwase direction.
+    *
+    * EO-IR: spaces
+    */
+   char theShadowAngle[SHADOW_ANGLE_SIZE+1];
+   
+   /**
+    * FIELD: FIELD_6
+    *
+    * Reserved field of 16 spaces.
+    */
+   char theField6[FIELD_6_SIZE+1];
+   
+   /**
+    * FIELD: FRLC_LOC
+    *
+    * required 21 byte field
+    *
+    * XDDMMSS.SSYDDDMMSS.SS
+    * OR
+    * +-dd.dddddd+-ddd.dddddd
+    * OR
+    * 21 spaces
+    *
+    * Location of the first row, last column of the image block.
+    */
+   char theFrlcLoc[FRLC_LOC_SIZE+1];
+   
+   /**
+    * FIELD: LRLC_LOC
+    *
+    * required 21 byte field
+    *
+    * XDDMMSS.SSYDDDMMSS.SS
+    * OR
+    * +-dd.dddddd+-ddd.dddddd
+    * OR
+    * 21 spaces
+    *
+    * Location of the last row, last column of the image block.
+    */
+   char theLrlcLoc[LRLC_LOC_SIZE+1];
+   
+   /**
+    * FIELD: LRFC_LOC
+    *
+    * required 21 byte field
+    *
+    * XDDMMSS.SSYDDDMMSS.SS
+    * OR
+    * +-dd.dddddd+-ddd.dddddd
+    * OR
+    * 21 spaces
+    *
+    * Location of the last row, first column of the image block.
+    */
+   char theLrfcLoc[LRFC_LOC_SIZE+1];
+   
+   /**
+    * FIELD: FRFC_LOC
+    *
+    * required 21 byte field
+    *
+    * XDDMMSS.SSYDDDMMSS.SS
+    * OR
+    * +-dd.dddddd+-ddd.dddddd
+    * OR
+    * 21 spaces
+    *
+    * Location of the first row, first column of the image block.
+    */
+   char theFrfcLoc[FRFC_LOC_SIZE+1];
+   
+   /**
+    * FIELD: FIELD_11
+    *
+    * Reserved field of 5 bytes containing: 010.0 
+    */
+   char theField11[FIELD_11_SIZE+1];
+   
+TYPE_DATA   
+};
+
+#endif /* End of "#ifndef ossimNitfBlockaTag_HEADER" */
diff --git a/include/ossim/support_data/ossimNitfCommon.h b/include/ossim/support_data/ossimNitfCommon.h
new file mode 100644
index 0000000..d3b4102
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCommon.h
@@ -0,0 +1,182 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Utility class for global nitf methods.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfCommon.h 15410 2009-09-11 19:45:38Z dburken $
+#ifndef ossimNitfCommon_HEADER
+#define ossimNitfCommon_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimString.h>
+#include <iostream>
+
+class ossimDpt;
+class ossimIrect;
+
+/** class ossimNitfCommon for global utility methods */   
+class OSSIM_DLL ossimNitfCommon
+{
+public:
+
+   /** default constructor */
+   ossimNitfCommon();
+
+   /** destructor */
+   ~ossimNitfCommon();
+
+   /**
+    * This method takes a value and a size(or width) and converts it to a
+    * scientific notation sting in the format: ±0.999999E±9
+    *
+    * @note If the value is positive, currently there is no + added to the
+    * front.
+    *
+    * @param aValue Value to convert to string.
+    *
+    * @param size total size of the string.  This must be at least 7 if
+    * aValue is positive and at least 8 if aValue is negative; else,
+    * no action is taken and an empty string is returned.
+    */
+   static ossimString convertToScientificString(const ossim_float64& aValue,
+                                                ossim_uint32 size);
+
+   /**
+    * This method takes a value and converts to a string of size with
+    * requested precision with a '0' fill.
+    *
+    * Format example: 00925.00
+    * 
+    * @param aValue Value to convert to string.
+    *
+    * @param precision The floating point precision.
+    *
+    * @param size total size of the string.
+    */
+   static ossimString convertToDoubleString(const ossim_float64& aValue,
+                                            ossim_uint32 precision,
+                                            ossim_uint32 size);
+
+   /**
+    * This method takes a value and converts to a string of size with
+    * with a '0' fill.
+    *
+    * Format example: 00925
+
+    * @param aValue Value to convert to string.
+    *
+    * @param size total size of the string.
+    */
+   static ossimString convertToUIntString(ossim_uint32 aValue,
+                                          ossim_uint32 size);
+   
+   /**
+    * Just like convertToUIntString only takes a signed value.
+    * 
+    * This method takes a value and converts to a string of size with
+    * with a '0' fill.
+    *
+    * Format example: 00925
+
+    * @param aValue Value to convert to string.
+    *
+    * @param size total size of the string.
+    */
+   static ossimString convertToIntString(ossim_int32 aValue,
+                                         ossim_uint32 size);
+
+   /**
+    * Converts pt to a decimal degrees latitude longitude location string.
+    *
+    * Format example: +-dd.dddddd+-ddd.dddddd
+    *
+    * @param pt Point to convert where pt.x = longitude and pt.y = latitude.
+    *
+    * @param  precision The floating point precision. This will determine the
+    * size of the string.
+    */
+   static ossimString convertToDdLatLonLocString(const ossimDpt& pt,
+                                                 ossim_uint32 precision);
+
+   /**
+    * Sets a field with a given string, width, and IOS flags.
+    *
+    * @param fieldDestination
+    *        The member NITF field to set.
+    * @param src
+    *        The source string.
+    * @param width
+    *        The number of characters in fieldDestination to copy from the
+    *        source string.
+    * @param ioflags
+    *        Formatting flags for the destination string.
+    * @param fill
+    *        If the size of the string is smaller than the field size,
+    *        this character specifies what the excess character values are.
+    */
+   static void setField(void* fieldDestination,
+                        const ossimString& src,
+                        std::streamsize width,
+                        std::ios_base::fmtflags ioflags = std::ios::left,
+                        char fill = ' ');
+   /**
+    * This will encode a 60 character IGEOLO field.
+    */
+   static ossimString encodeUtm(
+                                ossim_uint32 zone,
+                                const ossimDpt& ul,
+                                const ossimDpt& ur,
+                                const ossimDpt& lr,
+                                const ossimDpt& ll);
+   static ossimString encodeGeographicDms(
+                                          const ossimDpt& ul,
+                                          const ossimDpt& ur,
+                                          const ossimDpt& lr,
+                                          const ossimDpt& ll);
+   static ossimString encodeGeographicDecimalDegrees(
+                                                     const ossimDpt& ul,
+                                                     const ossimDpt& ur,
+                                                     const ossimDpt& lr,
+                                                     const ossimDpt& ll);
+
+   /**
+    * @brief Get the nitf pixel type string from scalar type.
+    *
+    * @param scalarType The scalar type.
+    *
+    * @return Pixel type as string, e.g.: "INT", "SI", "R"
+    */
+   static ossimString getNitfPixelType(ossimScalarType scalarType);
+
+   /**
+    * @brief Get compression rate (COMRAT) which is bits perpixel per band.
+    *
+    * This corresponds to the nitf image header COMRAT field.  Return is in
+    * the form of Nxyz "N" for numerically lossles, where "xyz"
+    * indicates the expected achieved bit rate (in bits per pixel per band)
+    * for the final layer of each tile. The decimal point is implicit and
+    * assumed to be one digit from the right (i.e. xy.z).
+    * 
+    * @param rect Image rectangles.
+    * @param bands
+    * @param scalar
+    * @param lengthInBytes Compressed length of image pixels.
+    * @return Approximate number of bits per pixel for the compressed image as
+    * a string which follows the nitf comrat field convention.  This will
+    * return an empty string if comrat is bigger than three digits.
+    */
+   static ossimString getCompressionRate(const ossimIrect& rect,
+                                         ossim_uint32 bands,
+                                         ossimScalarType scalar,
+                                         ossim_uint64 lengthInBytes);
+   
+   
+}; // End of class ossimNitfCommon.
+   
+#endif /* #ifndef ossimNitfCommon_HEADER */
diff --git a/include/ossim/support_data/ossimNitfCompressionHeader.h b/include/ossim/support_data/ossimNitfCompressionHeader.h
new file mode 100644
index 0000000..dbe2f55
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCompressionHeader.h
@@ -0,0 +1,39 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts
+//
+// LICENSE: MIT
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfCompressionHeader_HEADER
+#define ossimNitfCompressionHeader_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimString.h>
+
+#include <iosfwd>
+#include <string>
+
+class OSSIM_DLL ossimNitfCompressionHeader : public ossimObject
+{
+public:
+   virtual void parseStream(ossim::istream& in) = 0;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const=0;
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+protected:
+
+TYPE_DATA;   
+};
+#endif
diff --git a/include/ossim/support_data/ossimNitfCsccgaTag.h b/include/ossim/support_data/ossimNitfCsccgaTag.h
new file mode 100644
index 0000000..3f5b9c4
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCsccgaTag.h
@@ -0,0 +1,146 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+//
+// Author:  Garrett Potts
+//
+// Description: CSCCGA tag class definition
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+/**
+* All comments in this document were taken from the online resource found at:
+*
+* http://jitc.fhu.disa.mil/nitf/tag_reg
+*
+* The Cloud Cover Grid Data TRE (CSCCGA) provides support data that identifies 
+* which image segment and sensors were used to create the cloud grid. CSCCGA 
+* also geometrically registers the cloud grid to the pixel grid of one of the image segments.
+* 1. The format and content of the CSCCGA TRE shall be as detailed in Table 3.1-1.
+* 2. When cloud cover information is included in the dataset (see Section 2.1.4.2 for an exception) 
+*    both the CSCCGA TRE and the Cloud Cover Shapefile DES (Section 2.6.2) shall be 
+*    included in each dataset even though they both express similar information.
+*/
+class OSSIM_DLL ossimNitfCsccgaTag : public ossimNitfRegisteredTag
+{
+public:
+   enum
+   {
+      CCG_SOURCE_SIZE    = 18,
+      REG_SENSOR_SIZE    = 6,
+      ORIGIN_LINE_SIZE   = 7,
+      ORIGIN_SAMPLE_SIZE = 5,
+      AS_CELL_SIZE_SIZE  = 7,
+      CS_CELL_SIZE_SIZE  = 5,
+      CCG_MAX_LINE_SIZE  = 7,
+      CCG_MAX_SAMPLE_SIZE= 5,
+      CEL_SIZE           = 60 
+
+   };
+   ossimNitfCsccgaTag();
+
+   virtual void parseStream(ossim::istream& in);
+   virtual void writeStream(ossim::ostream& out);
+
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   virtual void clearFields();
+
+protected:
+   /**
+    * Field: CCG_SOURCE
+    *
+    * BCS-A 18 byte field.
+    *
+    * Values: PAN or MS or PAN, MS
+    *
+    * Source of Grid Concatenation of all sensors used to create 
+    * cloud cover grid separated by commas
+    */
+   char m_ccgSource[CCG_SOURCE_SIZE+1];
+	
+   /**
+    * Field: REG_SENSOR
+    *
+    * BCS-A 6 bytes.
+    *
+    Values: PAN or MS
+    *
+    * Image Segment Sensor to which Cloud Cover Grid is registered 
+    * (CCG is always registered to the synthetic array)
+    */
+   char m_regSensor[REG_SENSOR_SIZE+1];
+
+   /**
+    * Field: ORIGIN_LINE
+    *
+    * BCS-N 7 bytes.
+    *
+    * Values: 0000001
+    *
+    * Cloud Cover Grid Origin – Line 
+    * (Corresponding line in registered image segment)
+    */
+   char m_originLine[ORIGIN_LINE_SIZE+1];
+
+   /**
+    * Field: ORIGIN_SAMPLE
+    *
+    * BCS-N 5 bytes
+    *
+    * Values: 00001
+    *
+    * Cloud Cover Grid Origin – Sample 
+    * (Corresponding sample in registered image segment)
+    */
+   char m_originSample[ORIGIN_SAMPLE_SIZE+1];
+
+   /**
+    * Field: AS_CELL_SIZE
+    *
+    * BCS-N 7 bytes
+    *
+    * Value Range: 0000001 - 9999999
+    *
+    * Along Scan Cell Size – Lines (Cloud Cover Grid spacing in 
+    * registered image segment lines)
+    */
+   char m_asCellSize[AS_CELL_SIZE_SIZE+1];
+
+   /**
+    * Field: CS_CELL_SIZE
+    *
+    * BCS-N 5 bytes
+    *
+    * Value Range: 00001 - 99999
+    *
+    * Cross Scan Cell Size – Samples 
+    * (Cloud Cover Grid spacing in registered image segment samples)
+    */
+   char m_csCellSize[CS_CELL_SIZE_SIZE+1];
+	
+   /**
+    * Field: CCG_MAX_LINE
+    *
+    * BCS-N 7 bytes
+    *
+    * Value Range: 0000001 - 9999999
+    *
+    * Number of Rows in CC Grid (Number of Cells in "lines" direction)
+    */
+   char m_ccgMaxLine[CCG_MAX_LINE_SIZE+1];
+
+   /**
+    * Field: CCG_MAX_SAMPLE
+    *
+    * BCS-N 5 bytes
+    *
+    * Value Range: 00001 - 99999
+    *
+    * Number of Columns in CC Grid (Number of Cells in "sample" direction)
+    */
+   char m_ccgMaxSample[CCG_MAX_SAMPLE_SIZE+1];
+};
diff --git a/include/ossim/support_data/ossimNitfCscrnaTag.h b/include/ossim/support_data/ossimNitfCscrnaTag.h
new file mode 100644
index 0000000..07eb738
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCscrnaTag.h
@@ -0,0 +1,184 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CSCRNA tag class declaration.
+//
+// Corner Footprint TRE.
+//
+// See document STDI-0006-NCDRD Table 3.2-13 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimNitfCscrnaTag_HEADER
+#define ossimNitfCscrnaTag_HEADER 1
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfCscrnaTag : public ossimNitfRegisteredTag
+{
+public:
+   /** @brief default constructor */
+   ossimNitfCscrnaTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfCscrnaTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(std::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+   
+protected:
+
+   //---
+   // NOTE:  Spec says corner points are project from image plane to
+   // reference ellipsoid NOT ellipsoid + height.
+   //---
+
+   /**
+    * FIELD: PREDICT_CORNERS
+    * 
+    * 1 byte field BCS-A
+    *
+    * Y = predicted, N = actual
+    */
+   char thePredictedCornerFlag[2];
+
+   /**
+    * FIELD: ULCRN_LAT
+    *
+    * 9 byte field BCS-N Degrees
+    *
+    * -90.000000 ti +90.000000
+    */
+   char theUlLat[10];
+
+   /**
+    * FIELD: ULCRN_LON
+    *
+    * 10 byte field BCS-N Degrees
+    *
+    * -179.999999 ti +180.000000
+    */
+   char theUlLon[11];
+
+   /**
+    * FIELD: ULCRN_HT
+    *
+    * 8 byte field BCS-N Meters
+    *
+    * Height referenced to the reference ellipsoid.
+    *
+    * -00610.0 to +10668.0
+    */
+   char theUlHt[9];
+
+    /**
+    * FIELD: URCRN_LAT
+    *
+    * 9 byte field BCS-N Degrees
+    *
+    * -90.000000 ti +90.000000
+    */
+   char theUrLat[10];
+
+   /**
+    * FIELD: URCRN_LON
+    *
+    * 10 byte field BCS-N Degrees
+    *
+    * -179.999999 ti +180.000000
+    */
+   char theUrLon[11];
+
+   /**
+    * FIELD: URCRN_HT
+    *
+    * 8 byte field BCS-N Meters
+    *
+    * Height referenced to the reference ellipsoid.
+    *
+    * -00610.0 to +10668.0
+    */
+   char theUrHt[9];
+
+   /**
+    * FIELD: LRCRN_LAT
+    *
+    * 9 byte field BCS-N Degrees
+    *
+    * -90.000000 ti +90.000000
+    */
+   char theLrLat[10];
+
+   /**
+    * FIELD: LRCRN_LON
+    *
+    * 10 byte field BCS-N Degrees
+    *
+    * -179.999999 ti +180.000000
+    */
+   char theLrLon[11];
+
+   /**
+    * FIELD: LRCRN_HT
+    *
+    * 8 byte field BCS-N Meters
+    *
+    * Height referenced to the reference ellipsoid.
+    *
+    * -00610.0 to +10668.0
+    */
+   char theLrHt[9];
+
+   /**
+    * FIELD: LLCRN_LAT
+    *
+    * 9 byte field BCS-N Degrees
+    *
+    * -90.000000 ti +90.000000
+    */
+   char theLlLat[10];
+
+   /**
+    * FIELD: LLCRN_LON
+    *
+    * 10 byte field BCS-N Degrees
+    *
+    * -179.999999 ti +180.000000
+    */
+   char theLlLon[11];
+
+   /**
+    * FIELD: LLCRN_HT
+    *
+    * 8 byte field BCS-N Meters
+    *
+    * Height referenced to the reference ellipsoid.
+    *
+    * -00610.0 to +10668.0
+    */
+   char theLlHt[9];
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfCscrnaTag_HEADER */
diff --git a/include/ossim/support_data/ossimNitfCsdidaTag.h b/include/ossim/support_data/ossimNitfCsdidaTag.h
new file mode 100644
index 0000000..661e11b
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCsdidaTag.h
@@ -0,0 +1,209 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CSDIDA tag class declaration.
+//
+// Dataset Indentification TRE.
+//
+// See document STDI-0006-NCDRD Table 3.3-14 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimNitfCsdidaTag_HEADER
+#define ossimNitfCsdidaTag_HEADER 1
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfCsdidaTag : public ossimNitfRegisteredTag
+{
+public:
+   /** @brief default constructor */
+   ossimNitfCsdidaTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfCsdidaTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(std::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+   
+protected:
+
+   /**
+    * FIELD: DAY
+    * 
+    * 2 byte field BCS-N
+    *
+    * 01 TO 31 (UTC)
+    */
+   char theDay[3];
+
+   /**
+    * FIELD: MONTH
+    *
+    * 3 byte field BCS-A
+    *
+    * JAN to DEC (UTC)
+    */
+   char theMonth[4];
+
+
+   /**
+    * FIELD: YEAR
+    *
+    * 4 byte field BCS-N
+    * 
+    * 0000 to 9999 (UTC)
+    */
+   char theYear[5];
+
+   /**
+    * FIELD: PLATFORM CODE
+    *
+    * 2 byte field BCS-A
+    * 
+    * QB, IK, OV, WV ...
+    */
+   char thePlatformCode[3];
+
+   /**
+    * FIELD: VEHICLE ID
+    *
+    * 2 byte field BCS-N
+    * 
+    * 00 TO 99
+    */
+   char theVehicleId[3];
+
+   /**
+    * FIELD: PASS
+    *
+    * 2 byte field BCS-N
+    * 
+    * 01 to 99
+    */
+   char thePass[3];
+
+   /**
+    * FIELD: OPERATION
+    *
+    * 3 byte field BCS-N
+    * 
+    * 001 to 999
+    */
+   char theOperation[4];
+
+   /**
+    * FIELD: SENSOR_ID
+    * 
+    * 2 byte field BCS-A
+    * 
+    * AA = pan only, GA = multispectral and pan sharpened only, NA =
+    * panchroomatic & multispectral together.
+    */
+   char theSensorId[3];
+
+   /**
+    * FIELD: PRODUCT_ID
+    *
+    * 2 byte field BCS-A
+    * 
+    * See table 2.1-7 
+    */
+   char theProductId[3];
+
+   /**
+    * FIELD: Reserved
+    * 
+    * 4 bytes BCS-A
+    *
+    * fill "00  "
+    */
+   char theReservedField1[5];
+
+   /**
+    * FIELD: TIME
+    *
+    * 14 byte field BCS-N
+    * 
+    * Image start time (UTC) YYYYMMDDhhmmss Corresponds to ACQUISITION_DATE
+    * in STDI-0002
+    */
+   char theTime[15];
+
+   /**
+    * FIELD: PROCESS_TIME
+    *
+    * 14 byte field BCS-N
+    * 
+    * Image start time (UTC) YYYYMMDDhhmmss
+    */
+   char theProcessTime[15];
+
+   /** FIELD: Reserved
+    *
+    * 2 bytes BCS-N
+    * 
+    * Fill "00"
+    */
+   char theReservedField2[3];
+
+   /**
+    * FIELD: Reserved
+    *
+    * 2 bytes BCS-N 
+    *
+    * Fill "01"
+    */
+   char theReservedField3[3];
+
+   /**
+    * FIELD: Reserved
+    *
+    * 1 byte BCS-A
+    *
+    * Fill "N"
+    */
+   char theReservedField4[1];
+
+   /**
+    * FIELD: Reserved
+    *
+    * 1 byte BCS-A
+    *
+    * BCS-A "N"
+    */
+   char theReservedField5[1];
+
+   /**
+    * FIELD: SOFTWARE_VERSION_NUMBER
+    *
+    * 10 byte field BCS-A
+    * 
+    * Software version used.
+    */
+   char theSoftwareVersionNumber[11]; 
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfCsdidaTag_HEADER */
diff --git a/include/ossim/support_data/ossimNitfCsexraTag.h b/include/ossim/support_data/ossimNitfCsexraTag.h
new file mode 100644
index 0000000..3c97b9a
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfCsexraTag.h
@@ -0,0 +1,477 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CSEXRA tag class declaration.
+//
+// Exploitation Reference Data TRE.
+//
+// See document STDI-0006-NCDRD Table 3.5-16 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimNitfCsexraTag_HEADER
+#define ossimNitfCsexraTag_HEADER 1
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfCsexraTag : public ossimNitfRegisteredTag
+{
+public:
+   /** @brief default constructor */
+   ossimNitfCsexraTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfCsexraTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(std::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+   
+   /**
+    * @brief Get the SENSOR field.
+    * @return The SENSOR field as a string.
+    */
+   ossimString getSensor() const;
+   
+   /**
+    * @brief Get the TIME_FIRST_LINE_IMAGE field.
+    * @return The TIME_FIRST_LINE_IMAGE field as a string.
+    */
+   ossimString getTimeFirstLineImage() const;
+   
+   /**
+    * @brief Get the TIME_IMAGE_DURATION field.
+    * @return The TIME_IMAGE_DURATION field as a string.
+    */
+   ossimString getTimeImageDuration() const;
+   
+   /**
+    * @brief Get the MAX_GSDfield.
+    * @return The MAX_GSD field as a string.
+    */
+   ossimString getMaxGsd() const;
+   
+   /**
+    * @brief Get the ALONG_SCAN_GSD field.
+    * @return The ALONG_SCAN_GSD field as a string.
+    */
+   ossimString getAlongScanGsd() const;
+   
+   /**
+    * @brief Get the CROSS_SCAN_GSD field.
+    * @return TheCROSS_SCAN_GSD field as a string.
+    */
+   ossimString getCrossScanGsd() const;
+   
+   /**
+    * @brief Get the GEO_MEAN_GSD field.
+    * @return The GEO_MEAN_GSD field as a string.
+    */
+   ossimString getGeoMeanGsd() const;
+   
+   /**
+    * @brief Get the A_S_VERT_GSD field.
+    * @return The A_S_VERT_GSD field as a string.
+    */
+   ossimString getAlongScanVerticalGsd() const;
+   
+   /**
+    * @brief Get the C_S_VERT_GSD field.
+    * @return The C_S_VERT_GSD field as a string.
+    */
+   ossimString getCrossScanVerticalGsd() const;
+
+   /**
+    * @brief Get the GEO_MEAN_VERT_GSD field.
+    * @return The GEO_MEAN_VERT_GSD field as a string.
+    */
+   ossimString getGeoMeanVerticalGsd() const;
+   
+   /**
+    * @brief Get the GEO_BETA_ANGLEfield.
+    * @return The GEO_BETA_ANGLE field as a string.
+    */
+   ossimString getGeoBetaAngle() const;
+
+   /**
+    * @brief Get the DYNAMIC_RANGE field.
+    * @return The DYNAMIC_RANGE field as a string.
+    */
+   ossimString getDynamicRange() const;
+   
+   /**
+    * @brief Get the NUM_LINES field.
+    * @return The NUM_LINES field as a string.
+    */
+   ossimString getNumLines() const;
+   
+   
+   /**
+    * @brief Get the NUM_SAMPLES field.
+    * @return The NUM_SAMPLES field as a string.
+    */
+   ossimString getNumSamples() const;
+   
+   /**
+    * @brief Get the ANGLE_TO_NORTH field.
+    * @return The ANGLE_TO_NORTH field as a string.
+    */
+   ossimString getAngleToNorth() const;
+   
+   /**
+    * @brief Get the OBLIQUITY_ANGLE field.
+    * @return The OBLIQUITY_ANGLE field as a string.
+    */
+   ossimString getObliquityAngle() const;
+
+   /**
+    * @brief Get the AZ_OF_OBLIQUITY field.
+    * @return The AZ_OF_OBLIQUITY field as a string.
+    */
+   ossimString getAzimuthOfObliquity() const;
+   
+   /**
+    * @brief Get the GRD_COVER field.
+    * @return The GRD_COVER field as a string.
+    */
+   ossimString getGroundCover() const;
+
+   /**
+    * @brief Get the SNOW_DEPTH_CAT field.
+    * @return The SNOW_DEPTH_CAT field as a string.
+    */
+   ossimString getSnowDepth() const;
+   
+   /**
+    * @brief Get the SUN_AZIMUTH field.
+    * @return The SUN_AZIMUTH field as a string.
+    */
+   ossimString getSunAzimuth() const;
+
+   /**
+    * @brief Get the SUN_ELEVATION field.
+    * @return The SUN_ELEVATION field as a string.
+    */
+   ossimString getSunElevation() const;
+
+   /**
+    * @brief Get the PREDICTED_NIIRS field.
+    * @return The PREDICTED_NIIRS field as a string.
+    */
+   ossimString getPredictedNiirs() const;
+   
+   /**
+    * @brief Get the CIRCL_ERR field.
+    * @return The CIRCL_ERR field as a string.
+    */
+   ossimString getCE90() const;
+
+   /**
+    * @brief Get the LINEAR_ERR field.
+    * @return The LINEAR_ERR field as a string.
+    */
+   ossimString getLE90() const;
+
+protected:
+
+   /**
+    * FIELD: SENSOR
+    * 
+    * 6 byte field BCS-A
+    *
+    * PAN MS
+    */
+   char theSensor[7];
+
+   /**
+    * FIELD: TIME_FIRST_LINE_IMAGE
+    *
+    * 12 byte field BCS-N Seconds (UTC)
+    *
+    * Time in seconds from midnight for the first line, synthetic array,
+    * of the Dataset collection.
+    * 
+    * 00000.000000 to 86400.000000
+    */
+   char theTileFirstLine[13];
+
+   /**
+    * FIELD: TIME_IMAGE_DURATION
+    *
+    * 12 byte field BCS-N Seconds (UTC)
+    *
+    * Time Difference in seconds between the first line, synthetic array,
+    * and the last line, synthetic array.
+    * 
+    * 00000.000000 to 86400.000000
+    */
+   char theImageTimeDuration[13];
+
+   /**
+    * FIELD: MAX_GSD
+    *
+    * 5 byte field BCS-N inches
+    *
+    * Predicted maximum mean ground sample distance (GSD)for the primary
+    * target.
+    *
+    * 000.0 to 999.9
+    */
+   char theMaxGsd[6];
+
+   /**
+    * FIELD: ALONG_SCAN_GSD
+    *
+    * 5 byte field BCS-A inches
+    *
+    * Measured along scan GSD for the primary target.
+    *
+    * 000.0 to 999.9 or N/A
+    */
+   char theAlongScanGsd[6];
+
+   /**
+    * FIELD: CROSS_SCAN_GSD
+    *
+    * 5 byte field BCS-A inches
+    *
+    * Measured cross scan GSD for the primary target.
+    *
+    * 000.0 to 999.9 or N/A
+    */
+   char theCrossScanGsd[6];
+
+   /**
+    * FIELD: GEO_MEAN_GSD
+    *
+    * 5 byte field BCS-A inches
+    *
+    * Measured mean GSD for the primary target.
+    *
+    * 000.0 to 999.9 or N/A
+    */
+   char theGeoMeanGsd[6];
+
+   /**
+    * FIELD: A_S_VERT_GSD
+    *
+    * 5 byte field BCS-A inches
+    *
+    * Measured along scan vertical GSD for the primary target.
+    *
+    * 000.0 to 999.9 or N/A
+    */
+   char theAlongScanVertGsd[6];
+
+   /**
+    * FIELD: C_S_VERT_GSD
+    *
+    * 5 byte field BCS-A inches
+    *
+    * Measured cross scan vertical GSD for the primary target.
+    *
+    * 000.0 to 999.9 or N/A
+    */
+   char theCrossScanVertGsd[6];
+
+   /**
+    * FIELD: GEO_MEAN_VERT_GSD
+    *
+    * 5 byte field BCS-A inches
+    *
+    * Measured mean vertical GSD for the primary target.
+    *
+    * 000.0 to 999.9 or N/A
+    */
+   char theGeoMeanVertGsd[6];
+
+   /**
+    * FIELD: GEO_BETA_ANGLE
+    *
+    * 5 byte field BCS-A Degrees
+    *
+    * Angle on ground (Earth tangent plane) between along scan and cross scan
+    * directions.
+    *
+    * 00.0 to 180.0 or N/A
+    */
+   char theGeoBetaAngle[6];
+   
+   /**
+    * FIELD: DYNAMIC_RANGE
+    *
+    * 5 byte field BCS-N
+    *
+    * Dynamic range extent of pixel values in the image.
+    *
+    * 00000 to 02047 for PAN and MS.
+    */
+   char theDynamicRange[6];  
+
+   /**
+    * FIELD: NUM_LINES
+    *
+    * 7 byte field BCS-N
+    *
+    * 0000101 to 9999999
+    */
+   char theLine[8];
+   
+   /**
+    * FIELD: NUM_SAMPLES
+    *
+    * 5 byte field BCS-N
+    *
+    * 00101 to 99999
+    */
+   char theSamples[6];  
+
+   /**
+    * FIELD: ANGLE_TO_NORTH
+    *
+    * 7 byte field BCS-N Degrees
+    *
+    * Angle in degrees measured clockwise from the first row of the image to
+    * true North at image start time.
+    * 
+    * 000.000 to 360.000
+    */
+   char theAngleToNorth[8];
+
+   /**
+    * FIELD: OBLIQUITY_ANGLE
+    *
+    * 6 byte field BCS-N Degrees
+    *
+    * Obliquity angle measured from target local vertical.  I.e., the angle
+    * betweent the local North-Earth-Down (NED) horizontal and the optical
+    * axis of the image at the time of closest approach.
+    * 
+    * 00.000 to 90.000
+    */
+   char theObliquityAngle[7];
+
+   /**
+    * FIELD: AZ_OF_OBLIQUITY
+    *
+    * 7 byte field BCS-N Degrees
+    *
+    * Azimuth of the target-SV line-of-sight vectory projected in the target
+    * local horizontal plane, measured clockwise from True North, computed
+    * at Image Start Time.  The Velocity Control Point on the focal plane
+    * is projected to this azimuth projection in the target local
+    * horizontal plane.
+    * 
+    * 000.000 to 360.000
+    */
+   char theAzOfObliquity[8];
+   
+   /**
+    * FIELD: GRD_COVER
+    *
+    * 1 byte field BCS-N
+    *
+    * Snow or no snow
+    *
+    * 1 = snow, 0 = no snow, 9 = not available.
+    */
+   char theGrdCover[2];
+
+    /**
+    * FIELD: SNOW_DEPTH_CAT
+    *
+    * 1 byte field BCS-N
+    *
+    * Provides the weighted average of the snow depth values for all of
+    * the grids that overlap the tasked image area.
+    *
+    * 0 = 0 inches,
+    * 1 = 1-8 inches or ice,
+    * 2 = 9-17 inches,
+    * 3 = greater than 17 inches
+    * 9 = Not Available
+    */
+   char theSnowDepthCategory[2];
+
+   /**
+    * FIELD: SUN_AZIMUTH   
+    *
+    * 7 byte field BCS-N Degrees
+    *
+    * Azimuth of the target-sun line-of-sight vector projected in the
+    * target local horizontal plane, measured clockwise from True North,
+    * calculated at Image Start Time.
+    * 
+    * 000.000 to 360.000
+    */
+   char theSunAzimuth[8];
+
+   /**
+    * FIELD: SUN_ELEVATION  
+    *
+    * 7 byte field BCS-N Degrees
+    *
+    * The sun elevation angle from the local target plane to the sun
+    * calculated at Image_Start_Time, where the local target plane is
+    * referenced by the Target Centered - Earth Fixed, ST coordinate frame.
+    * 
+    * -90.000 to +90.000
+    */
+   char theSunElevation[8];
+   
+   /**
+    * FIELD: PREDICTED_NIIRS
+    *
+    * 3 byte field BCS-A
+    *
+    * Imagery NIIRS value. 
+    *
+    * 0.0 to 9.0 or N/A
+    */
+   char thePredictedNiirs[4];
+
+   /**
+    * FIELD: CIRCL_ERR
+    *
+    * 3 byte field BCS-N Feet
+    *
+    * Predicted CE/90 in the geolocation in the scene.
+    *
+    * 000 to 999
+    */
+   char theCircularError[4];
+
+   /**
+    * FIELD: LINEAR_ERR
+    *
+    * 3 byte field BCS-N Feet
+    *
+    * Predicted LE/90 in the geolocation in the scene
+    *
+    * 000 to 999
+    */
+   char theLinearError[4];
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfCsexraTag_HEADER */
diff --git a/ossim/include/ossim/support_data/ossimNitfCsproaTag.h b/include/ossim/support_data/ossimNitfCsproaTag.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfCsproaTag.h
rename to include/ossim/support_data/ossimNitfCsproaTag.h
diff --git a/ossim/include/ossim/support_data/ossimNitfDataExtensionSegment.h b/include/ossim/support_data/ossimNitfDataExtensionSegment.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfDataExtensionSegment.h
rename to include/ossim/support_data/ossimNitfDataExtensionSegment.h
diff --git a/ossim/include/ossim/support_data/ossimNitfDataExtensionSegmentV2_0.h b/include/ossim/support_data/ossimNitfDataExtensionSegmentV2_0.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfDataExtensionSegmentV2_0.h
rename to include/ossim/support_data/ossimNitfDataExtensionSegmentV2_0.h
diff --git a/ossim/include/ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h b/include/ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h
rename to include/ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h
diff --git a/include/ossim/support_data/ossimNitfDesFactory.h b/include/ossim/support_data/ossimNitfDesFactory.h
new file mode 100644
index 0000000..8fe59e5
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfDesFactory.h
@@ -0,0 +1,38 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfDesFactory.h 17207 2010-04-25 23:21:14Z dburken $
+#ifndef ossimNitfDesFactory_HEADER
+#define ossimNitfDesFactory_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+
+class ossimNitfRegisteredDes;
+
+class OSSIM_DLL ossimNitfDesFactory : public ossimObject
+{
+public:
+   ossimNitfDesFactory();
+   virtual ~ossimNitfDesFactory();
+   virtual ossimRefPtr<ossimNitfRegisteredDes> create(const ossimString &desName)const=0;
+private:
+   /*!
+    * Hide this.
+    */
+   ossimNitfDesFactory(const ossimNitfDesFactory & /* rhs */){}
+
+   /*!
+    * Hide this.
+    */ 
+   ossimNitfDesFactory& operator =(const ossimNitfDesFactory & /* rhs */){return *this;}
+TYPE_DATA
+};
+#endif
diff --git a/include/ossim/support_data/ossimNitfDesFactoryRegistry.h b/include/ossim/support_data/ossimNitfDesFactoryRegistry.h
new file mode 100644
index 0000000..da6e3cf
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfDesFactoryRegistry.h
@@ -0,0 +1,49 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfDesFactoryRegistry.h 22875 2014-08-27 13:52:03Z dburken $
+#ifndef ossimNitfDesFactoryRegistry_HEADER
+#define ossimNitfDesFactoryRegistry_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimNitfRegisteredDes.h>
+#include <vector>
+
+class ossimString;
+class ossimNitfDesFactory;
+
+class OSSIM_DLL ossimNitfDesFactoryRegistry
+{
+public:
+   virtual ~ossimNitfDesFactoryRegistry();
+   void registerFactory(ossimNitfDesFactory* aFactory);
+   void unregisterFactory(ossimNitfDesFactory* aFactory);
+   
+   static ossimNitfDesFactoryRegistry* instance();
+   
+   ossimRefPtr<ossimNitfRegisteredDes> create(const ossimString &desName)const;
+   bool exists(ossimNitfDesFactory* factory)const;
+   
+protected:
+   ossimNitfDesFactoryRegistry();
+
+private:
+   /** hidden copy constructory */
+   ossimNitfDesFactoryRegistry(const ossimNitfDesFactoryRegistry& factory);
+
+   /** hidden operator= */
+   const ossimNitfDesFactoryRegistry& operator=(
+      const ossimNitfDesFactoryRegistry& factory);
+
+   void initializeDefaults();
+   
+   std::vector<ossimNitfDesFactory*> theFactoryList;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfDesInformation.h b/include/ossim/support_data/ossimNitfDesInformation.h
new file mode 100644
index 0000000..d988a20
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfDesInformation.h
@@ -0,0 +1,134 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfDesInformation.h 22418 2013-09-26 15:01:12Z gpotts $
+#ifndef ossimNitfDesInformation_HEADER
+#define ossimNitfDesInformation_HEADER
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/support_data/ossimNitfRegisteredDes.h>
+
+class ossimString;
+
+class OSSIMDLLEXPORT ossimNitfDesInformation : public ossimObject
+{
+
+public:
+   enum{
+      DE_SIZE = 2,
+      DESID_SIZE = 25,
+      DESVER_SIZE = 2,
+      DECLAS_SIZE = 1,
+      DESCLSY_SIZE = 2,
+      DESCODE_SIZE = 11,
+      DESCTLH_SIZE = 2,
+      DESREL_SIZE = 20,
+      DESDCTP_SIZE = 2,
+      DESDCDT_SIZE = 8,
+      DESDCXM_SIZE = 4,
+      DESDG_SIZE = 1,
+      DESDGDT_SIZE = 8,
+      DESCLTX_SIZE = 43,
+      DESCATP_SIZE = 1,
+      DESCAUT_SIZE = 40,
+      DESCRSN_SIZE = 1,
+      DESSRDT_SIZE = 8,
+      DESCTLN_SIZE = 15,
+      DESOFLW_SIZE = 6,
+      DESITEM_SIZE = 3,
+      DESSHL_SIZE = 4
+   };
+
+   ossimNitfDesInformation(ossimRefPtr<ossimNitfRegisteredDes> desData = 0);
+   virtual ~ossimNitfDesInformation();
+   
+   //virtual void parseStream(std::istream& in);
+   virtual void parseStream(std::istream &in, ossim_uint64 dataLength=0);
+   virtual void writeStream(std::ostream& out);
+
+   void setDesName(const ossimString& desName);
+   void setDesLength(ossim_uint32 desLength);
+
+   /**
+    * Length of the 5 byte des length the 6 byte des name and
+    * the data length.
+    * So we have Data length + 11 bytes.
+    */
+   ossim_uint32 getTotalDesLength()const;
+
+   /**
+    * Should return the value of theDesLength which is the length of
+    * the data in bytes.
+    */
+   ossim_uint32 getDesLength()const;
+   ossim_uint64 getDesOffset()const;
+   ossim_uint64 getDesDataOffset()const;
+   
+   ossimString   getDesId()const;
+   virtual std::ostream& print(std::ostream& out, const std::string& prefix)const;
+   void clearFields();
+   
+   ossimRefPtr<ossimNitfRegisteredDes> getDesData();
+   const ossimRefPtr<ossimNitfRegisteredDes> getDesData()const;
+   void setDesData(ossimRefPtr<ossimNitfRegisteredDes> desData);
+
+   bool operator<(const ossimNitfDesInformation& rhs) const
+   {
+      return getTotalDesLength() < rhs.getTotalDesLength();
+   }
+   
+private:
+
+   char           m_de[DE_SIZE+1];
+   char           m_desid[DESID_SIZE+1];
+   char 	  m_desver[DESVER_SIZE+1];
+   char           m_declas[DECLAS_SIZE+1];
+   char           m_desclsy[DESCLSY_SIZE+1];
+   char           m_descode[DESCODE_SIZE+1];
+   char           m_desctlh[DESCTLH_SIZE+1];
+   char           m_desrel[DESREL_SIZE+1];
+   char           m_desdctp[DESDCTP_SIZE+1];
+   char           m_desdcdt[DESDCDT_SIZE+1];
+   char           m_desdcxm[DESDCXM_SIZE+1];
+   char           m_desdg[DESDG_SIZE+1];
+   char           m_desdgdt[DESDGDT_SIZE+1];
+   char           m_descltx[DESCLTX_SIZE+1];
+   char           m_descatp[DESCATP_SIZE+1];
+   char           m_descaut[DESCAUT_SIZE+1];
+   char           m_descrsn[DESCRSN_SIZE+1];
+   char           m_dessrdt[DESSRDT_SIZE+1];
+   char           m_desctln[DESCTLN_SIZE+1];
+   char           m_desoflw[DESOFLW_SIZE+1];
+   char           m_desitem[DESITEM_SIZE+1];
+   char           m_desshl[DESSHL_SIZE+1];
+
+   /**
+    * This will hold the offset to the start of the above information
+    * This is just a work variable.
+    */
+   ossim_uint64 m_desOffset;
+   ossim_uint64 m_desLength;
+
+
+   /**
+    * This will hold the start to the data.  This is just the
+    * position in the file just past the des length field.
+    * This is just a work variable
+    */
+   ossim_uint64 m_desDataOffset;
+   ossim_uint64 m_desDataSize;
+
+   /**
+    * Used to hold the des data.
+    */
+   ossimRefPtr<ossimNitfRegisteredDes> m_desData;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h b/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h
new file mode 100644
index 0000000..b9edb5c
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h
@@ -0,0 +1,43 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfEmbeddedRpfDes.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfEmbeddedRpfDes_HEADER
+#define ossimNitfEmbeddedRpfDes_HEADER 1
+
+#include <iosfwd>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+class ossimNitfFileHeader;
+
+class OSSIMDLLEXPORT ossimNitfEmbeddedRpfDes : public ossimNitfRegisteredTag
+{
+public:
+   ossimNitfEmbeddedRpfDes();
+   
+   virtual void parseStream(std::istream &in);
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+protected:
+   virtual ~ossimNitfEmbeddedRpfDes();
+
+TYPE_DATA
+private:
+
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfEngrdaTag.h b/include/ossim/support_data/ossimNitfEngrdaTag.h
new file mode 100644
index 0000000..76c0759
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfEngrdaTag.h
@@ -0,0 +1,215 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ENGRDA - Engineering Data tag class declaration.
+//
+// See document STDI-0002 (version 4), Appendix N for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimNitfEngrdaTag_HEADER
+#define ossimNitfEngrdaTag_HEADER 1
+
+#include <string>
+#include <vector>
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfEngrdaTag : public ossimNitfRegisteredTag
+{
+public:
+
+   enum 
+   {
+      RESRC_SIZE   = 20,
+      RECNT_SIZE   = 3,
+      ENGLN_SIZE   = 2,
+      ENGMTXC_SIZE = 4,
+      ENGMTXR_SIZE = 4,
+      ENGTYP_SIZE  = 1,
+      ENGDTS_SIZE  = 1,
+      ENGDATU_SIZE = 2,
+      ENGDATC_SIZE = 8,
+      TMP_BUF_SIZE = 128
+   };
+   
+   /** @brief default constructor */
+   ossimNitfEngrdaTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfEngrdaTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(std::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+protected:
+
+   /** @brief Container class for an Engineering Data Element Record. */
+   class ossimEngDataElement
+   {
+   public:
+      
+      /**
+       * FIELD: ENGLN
+       *
+       * TYPE: BCS-N
+       * 
+       * 2 byte field
+       *
+       * Engineering Data Label Length 01 - 99
+       */
+      char m_engLn[ENGLN_SIZE+1];
+      
+      /**
+       * FIELD: ENGLBL
+       *
+       * TYPE: BCS-A
+       * 
+       * Engineering Label - variable length
+       */
+      std::string m_engLbl;
+
+      /**
+       * FIELD: ENGMTXC
+       *
+       * TYPE: BCS-N
+       * 
+       * 4 byte field
+       *
+       * Engineering Matrix Data Column Count 0001 - 9999
+       */
+      char m_engMtxC[ENGMTXC_SIZE+1];
+
+      /**
+       * FIELD: ENGMTXR
+       *
+       * TYPE: BCS-N
+       * 
+       * 4 byte field
+       *
+       * Engineering Matrix Data Row Count 0001 - 9999
+       */
+      char m_engMtxR[ENGMTXR_SIZE+1];
+
+      /**
+       * FIELD: ENGTYP
+       *
+       * TYPE: BCS
+       * 
+       * 1 byte field
+       *
+       * Value Type of Engineering Data Element
+       */
+      char m_engTyp;
+
+      /**
+       * FIELD: ENGDTS
+       *
+       * TYPE: BCS-N
+       * 
+       * 1 byte field
+       *
+       * Engineering Data Element Size
+       */
+      char m_engDts;
+
+      /**
+       * FIELD: ENGDATU
+       *
+       * TYPE: BCS-A
+       * 
+       * 2 byte field
+       *
+       * Engineering Data Units
+       */
+      char m_engDatU[ENGDATU_SIZE+1];
+
+      /**
+       * FIELD: ENGDATC
+       *
+       * TYPE: BCS-N
+       * 
+       * 8 byte field
+       *
+       * Engineering Data Count
+       */
+      char m_engDatC[ENGDATC_SIZE+1];
+
+      /** ENGDATA - data */
+      std::vector<ossim_uint8> m_engDat;
+   };
+
+   /**
+    * @brief Method to print out a ossimEngDataElement object.
+    * @param out Stream to print to.
+    * @param element The element to print.
+    * @param elIndex The index of the element array index.
+    * @param prefix  The prefix to add to key.
+    */
+   std::ostream& printData(std::ostream& out,
+                           const ossimEngDataElement& element,
+                           ossim_uint32 elIndex,
+                           const std::string& prefix) const;
+
+   /**
+    * @brief Method to convert value to a string, padding with zero's,
+    * left justified.
+    * @param v The value to convert.
+    * @param w The width of the string field.
+    * @param s The string to stuff.
+    */
+   template <class T> void getValueAsString(T v,
+                                            ossim_uint16 w,
+                                            std::string& s) const;
+
+   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
+   
+   /**
+    * FIELD: RESRC
+    *
+    * TYPE: BCS-A
+    * 
+    * 20 byte field
+    *
+    * Unique Source System Name.
+    */
+   char m_reSrc[RESRC_SIZE+1];
+   
+   /**
+    * FIELD: RECNT
+    *
+    * TYPE: BCS-N
+    * 
+    * 3 byte field
+    *
+    * Record Entry Count 001 - 999
+    */
+   char m_reCnt[RECNT_SIZE+1];
+
+   std::vector<ossimEngDataElement> m_data;
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfEngrdaTag_HEADER */
diff --git a/ossim/include/ossim/support_data/ossimNitfExoptaTag.h b/include/ossim/support_data/ossimNitfExoptaTag.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfExoptaTag.h
rename to include/ossim/support_data/ossimNitfExoptaTag.h
diff --git a/include/ossim/support_data/ossimNitfFile.h b/include/ossim/support_data/ossimNitfFile.h
new file mode 100644
index 0000000..eadcd0d
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfFile.h
@@ -0,0 +1,127 @@
+//---
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//---
+// $Id$
+#ifndef ossimNitfFile_HEADER
+#define ossimNitfFile_HEADER 1
+
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+
+class ossimNitfImageHeader;
+class ossimNitfSymbolHeader;
+class ossimNitfLabelHeader;
+class ossimNitfTextHeader;
+class ossimNitfDataExtensionSegment;
+
+class OSSIMDLLEXPORT ossimNitfFile : public ossimReferenced
+{
+public:
+   friend OSSIMDLLEXPORT std::ostream& operator <<(std::ostream& out,
+                                                   const ossimNitfFile &data);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out Stream to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @param printOverviews If true overview, if present(e.g. rpf's) will be
+    * printed.
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string(),
+                       bool printOverviews=true) const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out Stream to output to.
+    * @param entryIndex Entry to print.  Not supported by all info objects
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @param printOverviews If true overview, if present(e.g. rpf's) will be 
+    * printed.
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       ossim_uint32 entryIndex, 
+                       const std::string& prefix=std::string(),
+                       bool printOverviews=false) const;
+   
+   ossimNitfFile();
+   virtual ~ossimNitfFile();
+
+   /*!
+    *  Opens the nitf file and attempts to parse.
+    *  Returns true on success, false on error.
+    */
+   bool parseFile(const ossimFilename& file);
+
+   /**
+    * @brief Parse stream method.
+    * @param file Filename from opened stream.
+    * @param in Stream to parse.
+    * @return true on success, false on error.
+    */
+   bool parseStream(const ossimFilename& file,
+                    ossim::istream& in);
+   
+   /*!
+    * Will return the header.
+    */
+   const ossimNitfFileHeader* getHeader()const;
+   ossimNitfFileHeader* getHeader();
+   ossimIrect getImageRect()const;
+   
+   ossimNitfImageHeader*  getNewImageHeader(ossim_uint32 imageNumber)const;
+   ossimNitfImageHeader*  getNewImageHeader(ossim::istream& in,
+                                            ossim_uint32 imageNumber)const;
+   
+   ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber)const;
+   ossimNitfSymbolHeader* getNewSymbolHeader(ossim::istream& in,
+                                             ossim_uint32 symbolNumber)const;
+   
+   ossimNitfLabelHeader*  getNewLabelHeader(ossim_uint32 labelNumber)const;
+   ossimNitfLabelHeader*  getNewLabelHeader(ossim::istream& in,
+                                            ossim_uint32 labelNumber)const;
+   
+   ossimNitfTextHeader*   getNewTextHeader(ossim_uint32 textNumber)const;
+   ossimNitfTextHeader*   getNewTextHeader(ossim::istream& in,
+                                           ossim_uint32 textNumber)const;
+   
+   ossimNitfDataExtensionSegment* getNewDataExtensionSegment(ossim_uint32 dataExtNumber)const;   
+   ossimNitfDataExtensionSegment* getNewDataExtensionSegment(ossim::istream& in,
+                                                             ossim_uint32 dataExtNumber)const;
+
+   ossimString getVersion()const;
+
+   /** @return The filename parsed by this object. */
+   ossimFilename getFilename() const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix)const;
+
+protected:
+   ossimNitfImageHeader* allocateImageHeader()const;
+   
+   ossimFilename                    theFilename;
+   ossimRefPtr<ossimNitfFileHeader> theNitfFileHeader;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfFileHeader.h b/include/ossim/support_data/ossimNitfFileHeader.h
new file mode 100644
index 0000000..a3ac9d1
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfFileHeader.h
@@ -0,0 +1,230 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfFileHeader_HEADER
+#define ossimNitfFileHeader_HEADER 1
+
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimPropertyInterface.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/support_data/ossimNitfTagInformation.h>
+#include <ossim/support_data/ossimNitfDesInformation.h>
+
+#include <vector>
+
+class ossimNitfImageHeader;
+class ossimNitfSymbolHeader;
+class ossimNitfTextHeader;
+class ossimNitfLabelHeader;
+class ossimNitfRegisteredTag;
+class ossimNitfDataExtensionSegment;
+// These structures are just data holders and will
+// not be used directly by outside users.  This is for internal use
+//
+class OSSIM_DLL ossimNitfImageOffsetInformation : public ossimObject
+{
+public:
+   virtual std::ostream& print(std::ostream& out) const;
+
+   ossimNitfImageOffsetInformation(ossim_uint64 headerOffset,
+                                   ossim_uint64 dataOffset)
+      :theImageHeaderOffset(headerOffset),
+       theImageDataOffset(dataOffset)
+      {
+      }
+   
+   ossim_uint64 theImageHeaderOffset;
+   ossim_uint64 theImageDataOffset;
+};
+
+
+class OSSIMDLLEXPORT ossimNitfSymbolOffsetInformation : public ossimObject
+{
+public:
+   ossimNitfSymbolOffsetInformation(ossim_uint64 headerOffset,
+                                    ossim_uint64 dataOffset)
+      :theSymbolHeaderOffset(headerOffset),
+       theSymbolDataOffset(dataOffset)
+      {
+      }
+   
+   ossim_uint64 theSymbolHeaderOffset;
+   ossim_uint64 theSymbolDataOffset;
+};
+
+class OSSIMDLLEXPORT ossimNitfGraphicOffsetInformation : public ossimObject
+{
+public:
+   ossimNitfGraphicOffsetInformation(ossim_uint64 headerOffset,
+                                    ossim_uint64 dataOffset)
+      :theGraphicHeaderOffset(headerOffset),
+       theGraphicDataOffset(dataOffset)
+      {
+      }
+   
+   ossim_uint64 theGraphicHeaderOffset;
+   ossim_uint64 theGraphicDataOffset;
+};
+
+class OSSIMDLLEXPORT ossimNitfLabelOffsetInformation : public ossimObject
+{
+public:
+   ossimNitfLabelOffsetInformation(ossim_uint64 headerOffset,
+                                   ossim_uint64 dataOffset)
+      :theLabelHeaderOffset(headerOffset),
+       theLabelDataOffset(dataOffset)
+      {
+      }
+   
+   ossim_uint64 theLabelHeaderOffset;
+   ossim_uint64 theLabelDataOffset;
+};
+
+class OSSIMDLLEXPORT ossimNitfTextOffsetInformation : public ossimObject
+{
+public:
+   ossimNitfTextOffsetInformation(ossim_uint64 headerOffset,
+                                  ossim_uint64 dataOffset)
+      :theTextHeaderOffset(headerOffset),
+       theTextDataOffset(dataOffset)
+      {
+      }
+   
+   ossim_uint64 theTextHeaderOffset;
+   ossim_uint64 theTextDataOffset;
+   
+};
+
+class OSSIMDLLEXPORT ossimNitfDataExtSegOffsetInformation : public ossimObject
+{
+public:
+   ossimNitfDataExtSegOffsetInformation(ossim_uint64 headerOffset,
+                                        ossim_uint64 dataOffset)
+      :theDataExtSegHeaderOffset(headerOffset),
+       theDataExtSegDataOffset(dataOffset)
+      {
+      }
+   
+   ossim_uint64 theDataExtSegHeaderOffset;
+   ossim_uint64 theDataExtSegDataOffset;   
+};
+
+class OSSIM_DLL ossimNitfFileHeader : public ossimObject,
+                                      public ossimPropertyInterface
+{
+public:
+   friend class ossimNitfFile;
+
+   ossimNitfFileHeader();
+   virtual ~ossimNitfFileHeader();
+
+   virtual void parseStream(ossim::istream& in)= 0;
+   virtual void writeStream(ossim::ostream& out)=0;
+   
+   virtual bool isEncrypted()const=0;
+   virtual ossim_int32 getNumberOfImages()const=0;
+   virtual ossim_int32 getNumberOfLabels()const=0;
+   virtual ossim_int32 getNumberOfSymbols()const=0;
+   virtual ossim_int32 getNumberOfGraphics()const=0;
+   virtual ossim_int32 getNumberOfTextSegments()const=0;
+   virtual ossim_int32 getNumberOfDataExtSegments()const=0;
+   virtual ossim_int32 getNumberOfReservedExtSegments()const=0;
+   virtual ossim_int32 getHeaderSize()const=0;
+   
+   void addTag(const ossimNitfTagInformation& tag, bool unique=true);
+   virtual void removeTag(const ossimString& tagName);
+   virtual bool  getTagInformation(ossimNitfTagInformation& tag,
+                                   int idx)const;
+
+   virtual std::vector<ossimNitfTagInformation> getAllTags() { return theTagList; }
+   virtual void setAllTags(std::vector<ossimNitfTagInformation> tagList) { theTagList = tagList; }
+
+   virtual int getNumberOfTags()const;
+
+   virtual bool getTag(ossimNitfTagInformation& tagInfo,
+                       const ossimString& tagName)const;
+   
+   virtual ossim_int64 getFileSize()const=0;
+   virtual const char* getVersion()const=0;
+   virtual const char* getDateTime()const=0;
+   virtual ossimDrect getImageRect()const=0;
+   virtual ossimString getSecurityClassification()const=0;
+   
+   /**
+   * isValid will test if the fields are valid and will return true or false.
+   */
+   virtual bool isValid()const=0;
+   
+   bool hasImages()const;
+   bool hasSymbols()const;
+   bool hasGraphics()const;
+   bool hasText()const;
+   bool hasLabels()const;
+   bool hasDataExtSegments()const;
+
+   virtual ossimNitfImageHeader* getNewImageHeader(ossim_uint32 imageNumber,
+                                                   ossim::istream& in)const=0;
+   virtual ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber,
+                                                    ossim::istream& in)const=0;
+   virtual ossimNitfLabelHeader* getNewLabelHeader(ossim_uint32 labelNumber,
+                                                   ossim::istream& in)const=0;
+   virtual ossimNitfTextHeader* getNewTextHeader(ossim_uint32 textNumber,
+                                                ossim::istream& in)const=0;
+   virtual ossimNitfDataExtensionSegment* getNewDataExtensionSegment(
+      ossim_int32 dataExtNumber, ossim::istream& in)const=0;
+   
+   virtual ossimNitfImageHeader*    allocateImageHeader()const=0;
+   virtual ossimNitfSymbolHeader*   allocateSymbolHeader()const=0;
+   virtual ossimNitfLabelHeader*    allocateLabelHeader()const=0;
+   virtual ossimNitfTextHeader*     allocateTextHeader()const=0;
+   virtual ossimNitfDataExtensionSegment *allocateDataExtSegment()const=0;
+
+   virtual ossim_uint32 getTotalTagLength()const;
+
+   /** @brief Sets file length (FL) field. */
+   virtual void setFileLength(ossim_uint64 fileLength) = 0;
+
+   /** @brief Sets header length (HL) field. */
+   virtual void setHeaderLength(ossim_uint64 headerLength) = 0;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+   /**
+    * @brief print tags method that outputs a key/value type format adding
+    * prefix to keys.
+    */
+   virtual std::ostream& printTags(
+      std::ostream& out,
+      const std::string& prefix=std::string()) const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+   
+protected:
+   std::vector<ossimNitfTagInformation> theTagList;
+   std::vector<ossimNitfDesInformation> theDesList;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfFileHeaderV2_0.h b/include/ossim/support_data/ossimNitfFileHeaderV2_0.h
new file mode 100644
index 0000000..5832476
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfFileHeaderV2_0.h
@@ -0,0 +1,618 @@
+//*******************************************************************
+//
+//  License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$ 
+
+#ifndef ossimNitfFileHeaderV2_0_HEADER
+#define ossimNitfFileHeaderV2_0_HEADER 1
+
+#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/support_data/ossimNitfTagInformation.h>
+
+class ossimNitfRegisteredTag;
+
+class ossimNitfImageInfoRecordV2_0
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfImageInfoRecordV2_0 &data);
+
+   ossim_uint32 getHeaderLength()const;
+   ossim_uint64 getImageLength()const;
+   ossim_uint64 getTotalLength()const;
+   void setSubheaderLength(ossim_uint32 length);
+   void setImageLength(ossim_uint64 length);
+
+   /*!
+    * Is a 6 byte numeric 0-999999
+    */
+   char theImageSubheaderLength[7];
+
+   /*!
+    * Is a 10 byte numeric 0-999999999
+    */
+   char theImageLength[11];
+};
+
+struct ossimNitfSymbolInfoRecordV2_0
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfSymbolInfoRecordV2_0 &data);
+
+   ossim_int32 getHeaderLength()const;
+   ossim_int32 getImageLength()const;
+   ossim_int32 getTotalLength()const;
+   
+   /*!
+    * Is a 4 byte numeric 0-9999
+    */
+   char theSymbolSubheaderLength[5];
+
+   /*!
+    * Is a 6 byte numeric 0-999999
+    */
+   char theSymbolLength[7];
+};
+
+struct ossimNitfLabelInfoRecordV2_0
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfLabelInfoRecordV2_0 &data);
+
+   ossim_int32 getHeaderLength()const;
+   ossim_int32 getImageLength()const;
+   ossim_int32 getTotalLength()const;
+   
+   /*!
+    * Is a 4 byte numeric 0-9999
+    */
+   char theLabelSubheaderLength[5];
+
+   /*!
+    * Is a 3 byte numeric 0-320
+    */
+   char theLabelLength[4];
+};
+
+struct ossimNitfTextInfoRecordV2_0
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfTextInfoRecordV2_0 &data);
+
+   ossim_int32 getHeaderLength()const;
+   ossim_int32 getImageLength()const;
+   ossim_int32 getTotalLength()const;
+   /*!
+    * Is a 4 byte numeric 0-9999
+    */
+   char theTextSubheaderLength[5];
+
+   /*!
+    * Is a 5 byte numeric 0-99999
+    */
+   char theTextLength[6];
+};
+
+struct ossimNitfDataExtSegInfoRecordV2_0
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfDataExtSegInfoRecordV2_0 &data);
+
+   ossim_int32 getHeaderLength()const;
+   ossim_int32 getImageLength()const;
+   ossim_int32 getTotalLength()const;
+   /*!
+    * Is a 4 byte numeric 0-9999
+    */
+   char theDataExtSegSubheaderLength[5];
+
+   /*!
+    * Is a 9 byte numeric 0-999999999
+    */
+   char theDataExtSegLength[10];
+};
+
+struct ossimNitfResExtSegInfoRecordV2_0
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfResExtSegInfoRecordV2_0 &data);
+
+   /*!
+    * Is a 4 byte numeric 0-9999
+    */
+   char theResExtSegSubheaderLength[5];
+
+   /*!
+    * Is a 7 byte numeric 0-9999999
+    */
+   char theResExtSegLength[8];
+};
+
+class OSSIMDLLEXPORT ossimNitfFileHeaderV2_0 : public ossimNitfFileHeaderV2_X
+{
+public:
+   
+   ossimNitfFileHeaderV2_0();
+   virtual ~ossimNitfFileHeaderV2_0();
+
+   /**
+    * @brief parse method.
+    * @return This method returns void but will throw an std::exception in
+    * certain instances if the stream goes bad on seeks.
+    */
+   virtual void parseStream(ossim::istream& in);
+   
+   virtual void writeStream(ossim::ostream& out);
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+   virtual bool isEncrypted()const;
+   virtual ossim_int32 getNumberOfImages()const;
+   virtual ossim_int32 getNumberOfLabels()const;
+   virtual ossim_int32 getNumberOfSymbols()const;
+   virtual ossim_int32 getNumberOfGraphics()const;
+   virtual ossim_int32 getNumberOfTextSegments()const;
+   virtual ossim_int32 getNumberOfDataExtSegments()const;
+   virtual ossim_int32 getNumberOfReservedExtSegments()const;
+   virtual ossim_int32 getHeaderSize()const;
+   virtual ossim_int64 getFileSize()const;
+   virtual ossimString getSecurityClassification()const;
+   
+   virtual const char* getDateTime()const;
+   virtual const char* getVersion()const;
+
+   virtual ossimDrect getImageRect()const;
+  
+   virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_0& recordInfo);
+   virtual void replaceImageInfoRecord(ossim_uint32 i, const ossimNitfImageInfoRecordV2_0& recordInfo);
+
+   virtual ossimNitfImageHeader*  getNewImageHeader(ossim_uint32 imageNumber,
+                                                    ossim::istream& in)const;
+   virtual ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber,
+                                                     ossim::istream& in)const;
+   virtual ossimNitfLabelHeader* getNewLabelHeader(ossim_uint32 labelNumber,
+                                                   ossim::istream& in)const;
+   virtual ossimNitfTextHeader*   getNewTextHeader(ossim_uint32 textNumber,
+                                                   ossim::istream& in)const;
+   virtual ossimNitfDataExtensionSegment* getNewDataExtensionSegment(
+      ossim_int32 dataExtNumber, ossim::istream& in)const;
+   
+   virtual ossimNitfImageHeader*  allocateImageHeader()const;
+   virtual ossimNitfSymbolHeader* allocateSymbolHeader()const;
+   virtual ossimNitfLabelHeader*  allocateLabelHeader()const;
+   virtual ossimNitfTextHeader*   allocateTextHeader()const;
+   virtual ossimNitfDataExtensionSegment *allocateDataExtSegment()const;
+
+   virtual void setCodeWords(const ossimString& codeWords);
+   virtual void setControlAndHandling(const ossimString& controlAndHandling);
+   virtual void setReleasingInstructions(const ossimString& releasingInstructions);
+   virtual void setClassificationAuthority(const ossimString& classAuth);
+   virtual void setSecurityControlNumber(const ossimString& controlNo);
+   virtual void setOriginatorsName(const ossimString& originatorName);
+   virtual void setOriginatorsPhone(const ossimString& origniatorPhone);
+
+   virtual ossimString getCodeWords()const;
+   virtual ossimString getControlAndHandling()const;
+   virtual ossimString getReleasingInstructions()const;
+   virtual ossimString getClassificationAuthority()const;
+   virtual ossimString getSecurityControlNumber()const;
+   virtual ossimString getOriginatorsName()const;
+   virtual ossimString getOriginatorsPhone()const;
+
+   /**
+   * isValid will test if the fields are valid and will return true or false.
+   */
+   virtual bool isValid()const;
+
+   ossimString getComplianceLevel()const;
+   ossimString getSecurityDowngrade()const;
+   ossimString getDowngradingEvent()const;
+
+   void setComplianceLevel(const ossimString& complianceLevel);
+   void setSecurityDowngrade(const ossimString& securityDowngrade);
+   void setDowngradingEvent(const ossimString& downgradeEvent);
+
+   virtual void setFileLength(ossim_uint64 fileLength);
+   virtual void setHeaderLength(ossim_uint64 headerLength);
+   /**
+    * Properties of a NITF 2.0 Header file. See MIL-STD-2500A for details.
+    *
+    * To access these, pass the constant to getProperty().
+    */
+   static const ossimString FSDWNG_KW;
+   static const ossimString FSDEVT_KW;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+TYPE_DATA
+private:
+
+   struct ossimNitfDisplayInfo
+   {
+   public:
+      ossimNitfDisplayInfo(const ossimString &filePartType,
+                           ossim_int32 displayLevel,
+                           ossim_int32 indexIntoList)
+         :theFilePartType(filePartType),
+          theDisplayLevel(displayLevel),
+          theIndex(indexIntoList)
+         {
+         }
+      
+      /*!
+       * Since NITF already has unique ids for the file
+       * part types we will just use them.
+       *
+       *  IM  indicates image part
+       *  LA  indicates a label part
+       *  SY   indicates a symbol part
+       */
+      ossimString theFilePartType;
+
+      /*!
+       * This is the display level of the renderable data.  Note the
+       * display level is like a painters algorithm.  The lowest level
+       * is drawn first followed by the next level.
+       */
+      ossim_int32        theDisplayLevel;
+
+      /*!
+       * This is an index into the array that has all the offsets
+       * pre-computed.
+       */
+      ossim_int32        theIndex;
+      
+   };
+
+   void clearFields();
+   /**
+    * Sets the number of image records in the NITF 2.0 File Header.
+    *
+    * @param num
+    *        The number of image records for the entire NITF 2.0 file.
+    *
+    * @throw std::out_of_range
+    */
+   void setNumberOfImageInfoRecords(ossim_uint64 num);
+   
+  /*!
+    * This method will be used to setup information about the file.
+    * Example: NITF files have display levels where the lowest number is the
+    * back most image and the highes number is the front most image.  We
+    * are not guranteed that they will be in order in the file so we must
+    * parse the file and sort the images.  The images include image data,
+    * symbols and labels.  Each of these are renderable.  The lowest
+    * display level should have the larges rect and this will be used
+    * to send back to the user an image rect.  During rasterization we must
+    * know the order to draw the data.
+    */
+   void precomputeValues();
+   
+   void readImageInfoRecords(ossim::istream& in);
+   void readSymbolInfoRecords(ossim::istream& in);
+   void readLabelInfoRecords(ossim::istream& in);
+   void readTextFileInfoRecords(ossim::istream& in);
+   void readDataExtSegInfoRecords(ossim::istream& in);
+   void readResExtSegInfoRecords(ossim::istream& in);
+   /*!
+    * If the header was parsed this method will initialize the offsets
+    * to whare all data resides within the file.  Example:  NITF files
+    * have several sections (Image, Symbol, Labels, Text and Extended data) and
+    * each of these sections have subsections.  The offsets stored are just offsets
+    * from the start of the file to each major section and eqach subsection.
+    */
+   void initializeAllOffsets();
+
+  /*!
+    * If the header was parsed and the offsets have been initialized, this method will
+    * parse all overflow tags and put them into theTagList.
+    */
+   void readOverflowTags(ossim::istream& in);
+
+   /*!
+    * This method will be called after the header is read
+    * in and the offsets have been initialized.  It will
+    * sort in order all renderable data based on their
+    * display level.
+    */
+   void initializeDisplayLevels(ossim::istream& in);
+
+   void insertIntoDisplayInfoList(const ossimNitfDisplayInfo &displayInformation);
+
+   
+   /*!
+    * This is the current file we are operating on.
+    */
+   ossimFilename theFilename;
+   
+   /*!
+    * This will be pre-computed when the header file is opened.  This is computed
+    * after we have found the display order.  We will use the rectangle of the
+    * smallest display number.
+    */
+   ossimDrect theImageRect;
+   
+   /*!
+    * This will hold some pre-computed information about the display
+    * order of the images.  It will be populated by scanning the
+    * file and sorting display levels.
+    */
+   std::vector<ossimNitfDisplayInfo>             theDisplayInformationList;
+   
+   /*!
+    * This will hold pre-computed offsets to the start of all image headers
+    * and start to their data.
+    */
+   std::vector<ossimNitfImageOffsetInformation>  theImageOffsetList;
+
+   /*!
+    * This will hold pre-computed offsets to the start of all symbol headers
+    * and start to their data.
+    */
+   std::vector<ossimNitfSymbolOffsetInformation> theSymbolOffsetList;
+
+   /*!
+    * This will hold pre-computed offsets to the start of all Label headers
+    * and start to their data.
+    */
+   std::vector<ossimNitfLabelOffsetInformation>  theLabelOffsetList;
+
+   /*!
+    * This will hold pre-computed offsets to the start of all text headers
+    * and start to their data.
+    */
+   std::vector<ossimNitfTextOffsetInformation>   theTextOffsetList;
+
+   /*!
+    * This will hold pre-coputed offsets to the start of all the data
+    * extension segments.
+    */
+   std::vector<ossimNitfDataExtSegOffsetInformation> theDataExtSegOffsetList;
+
+
+
+   
+   // Note: these are work variables and not part of the
+   // ossimNitf header.  These variables will be used to quickly
+   // access various parts of the file.
+   /*!
+    * This is not part of the NITF file header.  This will be
+    * computed since somethimes the header size will not be
+    * given in the header field.  This value will hold a count of
+    * all the bytes read for the header portion.  This can be used
+    * to skip past the header data.
+    */
+   ossim_int32 theHeaderSize;
+   
+   /*!
+    * FSCODE: This is a 40 byte Alphanumeric field
+    */
+   char theCodewords[41]; 
+
+   /*!
+    * FSCTLH: This is a 40 byte Alphanumeric field.
+    */
+   char theControlAndHandling[41]; 
+
+   /*!
+    * FSREL: This is a 40 byte Alphanumeric field.
+    */
+   char theReleasingInstructions[41]; 
+
+   /*!
+    * FSCAUT: This is a 20 byte alphanumeric field.
+    */ 
+   char theClassificationAuthority[21];
+
+   /*!
+    * FSCTLN: This is a 20 byte Alphanumeric field.
+    */
+   char theSecurityControlNumber[21]; 
+
+   /*!
+    * FSDWNG:
+    *
+    * This is a 6 byte Alphanumeric.  If this field
+    * is not blank then it will have the form:
+    *
+    *   YYMMDD
+    *
+    *   Where YY is the last 2 chars of the year and will be
+    *            00 to 59 represents 2000 to 2059
+    *            60 to 99 represents 1960 to 1999
+    *
+    *
+    *   if the field is 999999 then the Originating agency field
+    *   is required. If te field is 999998 then the downgrade event
+    *   is required
+    */
+   char theSecurityDowngrade[7];
+
+   /**
+    * FSDEVT:
+    * This is a conditional field and is a 40 byte
+    * Alphanumeric field.  This field exists if the
+    * security downgrade is 999998.
+    */
+   char theDowngradingEvent[41];
+
+   /**
+    * ONAME:
+    *
+    * This is a 27 byte Alphanumeric number
+    */
+   char theOriginatorsName[28];
+
+   /*!
+    * OPHONE:
+    * This is an 18 byte Alphanumeric value. 
+    */
+   char theOriginatorsPhone[19]; 
+
+   /*!
+    * FL:
+    *
+    * This is a required field.
+    *
+    * Is a 12 byte number of the form
+    * 000000000388-999999999998 indicates the
+    * file length and a value of 999999999999
+    * indicates that the file length was not
+    * available.
+    */
+   char theFileLength[13];
+
+   /**
+    * HL:
+    *
+    * This is a reqired field.
+    *
+    * Will hold the header length. The values
+    * range up to 999998 and a value of
+    * 999999 indicates that the length of the
+    * header was not available upon creation.
+    */
+   char theHeaderLength[7];
+
+   /**
+    * NUMI:
+    *
+    * This is a 3 byte field that specifies the number
+    * of images in the file.  0-999
+    */
+   char theNumberOfImageInfoRecords[4];
+
+   /*!
+    * This information is conditional on the number of image
+    * info records field.  If the field is greater than 0 then
+    * the record information is read in up to the indicated number
+    */
+   std::vector<ossimNitfImageInfoRecordV2_0> theNitfImageInfoRecords;
+
+   /*!
+    * This is a 3 byte numeric 0-999.
+    */
+
+   char theNumberOfSymbolInfoRecords[4];
+   /*!
+    * This information is conditional on the number of symbol
+    * info records field.  If the field is greater than 0 then
+    * the record information is read in up to the indicated number
+    */
+   std::vector<ossimNitfSymbolInfoRecordV2_0> theNitfSymbolInfoRecords;
+
+   /**
+    * NUML
+    *
+    * This is a 3 byte numeric 0-999.
+    */
+
+   char theNumberOfLabelInfoRecords[4];
+   
+   /*!
+    * This information is conditional on the number of label
+    * info records field.  If the field is greater than 0 then
+    * the record information is read in up to the indicated number
+    */
+   std::vector<ossimNitfLabelInfoRecordV2_0> theNitfLabelInfoRecords;
+
+   /**
+    * NUMT:
+    *
+    * This is a 3 byte numeric 0-999.
+    */
+   char theNumberOfTextFileInfoRecords[4];
+
+   /*!
+    * This information is conditional on the number of text file
+    * info records field.  If the field is greater than 0 then
+    * the record information is read in up to the indicated number
+    */
+   std::vector<ossimNitfTextInfoRecordV2_0> theNitfTextInfoRecords;
+
+   /**
+    * NUMDES:
+    *
+    * This is a 3 byte numeric 0-999.
+    */
+   char theNumberOfDataExtSegInfoRecords[4];
+
+   /*!
+    * This information is conditional on the number of 
+    * info records field.  If the field is greater than 0 then
+    * the record information is read in up to the indicated number
+    */
+   std::vector<ossimNitfDataExtSegInfoRecordV2_0> theNitfDataExtSegInfoRecords;
+
+   /**
+    * NUMRES:
+    *
+    * This is a 3 byte numeric 0-999. Reserved Extension Segments
+    */
+   char theNumberOfResExtSegInfoRecords[4];
+
+   /*!
+    * This information is conditional on the number of Res Ext Seg
+    * info records field.  If the field is greater than 0 then
+    * the record information is read in up to the indicated number
+    */
+   std::vector<ossimNitfResExtSegInfoRecordV2_0> theNitfResExtSegInfoRecords;
+
+   /**
+    * UDHDL:
+    * 
+    * This is a required field and is a 5 byte numeric ranging
+    * from 0-99999.  This is 0 if there is no data.
+    */
+   char theUserDefinedHeaderDataLength[6];
+
+   /*!
+    * This is a conditional field.  It will exist if the
+    * user defined header length is not 0.  If it exists
+    * then it may contain an overflow into one of the data
+    * extension segments above and will hold the number of that
+    * segment.
+    */
+   char theUserDefinedHeaderOverflow[4];
+
+   /**
+    * XHDL:
+    *
+    * This is a required field.  It is 5 bytes long and
+    * ranges from 0-99999.  0 means there is no data
+    */
+   char theExtendedHeaderDataLength[6];
+
+   /*!
+    * This is a required field.  It is 5 bytes long and
+    * ranges from 0-99999.  0 means there is no data
+    */
+   char theExtendedHeaderOverflow[4];
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfFileHeaderV2_1.h b/include/ossim/support_data/ossimNitfFileHeaderV2_1.h
new file mode 100644
index 0000000..c34ffde
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfFileHeaderV2_1.h
@@ -0,0 +1,649 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfFileHeaderV2_1_HEADER
+#define ossimNitfFileHeaderV2_1_HEADER 1
+
+#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
+#include <ossim/base/ossimDate.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+class OSSIMDLLEXPORT ossimNitfImageInfoRecordV2_1
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfImageInfoRecordV2_1 &data);
+   
+   ossim_uint64 getHeaderLength()const;
+   ossim_uint64 getImageLength()const;
+   ossim_uint64 getTotalLength()const;
+   
+   void setSubheaderLength(ossim_uint32 length);
+   void setImageLength(ossim_uint64 length);
+   
+   /**
+    * Is a 6 byte numeric 000439-999999
+    */
+   char theImageSubheaderLength[7];
+   
+   /**
+    * Is a 10 byte numeric 0000000001-9999999999
+    */
+   char theImageLength[11];
+};
+
+
+struct ossimNitfGraphicInfoRecordV2_1
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfGraphicInfoRecordV2_1 &data);
+   
+   ossim_uint64 getHeaderLength()const;
+   ossim_uint64 getGraphicLength()const;
+   ossim_uint64 getTotalLength()const;
+   /**
+    * Is a 4 byte numeric 0258-9999
+    */
+   char theGraphicSubheaderLength[5];
+   
+   /**
+    * Is a 6 byte numeric 0000001-9999999
+    */
+   char theGraphicLength[7];
+};
+
+
+class OSSIMDLLEXPORT ossimNitfTextFileInfoRecordV2_1
+{
+public:
+   friend std::ostream& operator<<(std::ostream& out,
+                                   const ossimNitfTextFileInfoRecordV2_1 &data);
+
+
+   ossim_uint64 getHeaderLength()const;
+   ossim_uint64 getTextLength()const;
+   ossim_uint64 getTotalLength()const;
+
+   void setSubheaderLength(ossim_uint64 length);
+   void setTextLength(ossim_uint64 length);
+   
+   /**
+    * Is a 4 byte numeric 0282-9999
+    */
+   char theTextFileSubheaderLength[5];
+
+   /**
+    * Is a 5 byte numeric 0-99999
+    */
+   char theTextFileLength[6];
+};
+
+struct ossimNitfDataExtSegInfoRecordV2_1
+{
+public:
+   friend std::ostream& operator<<(std::ostream& out,
+                                   const ossimNitfDataExtSegInfoRecordV2_1 &data);
+
+   ossim_uint64 getHeaderLength()const;
+   ossim_uint64 getDataExtSegLength()const;
+   ossim_uint64 getTotalLength()const;
+   /**
+    * Is a 4 byte numeric 200-9999
+    */
+   char theDataExtSegSubheaderLength[5];
+
+   /**
+    * Is a 9 byte numeric 0-999999999
+    */
+   char theDataExtSegLength[10];
+};
+
+struct ossimNitfResExtSegInfoRecordV2_1
+{
+public:
+   friend std::ostream& operator<<(std::ostream& out,
+                                   const ossimNitfResExtSegInfoRecordV2_1 &data);
+
+   ossim_uint64 getHeaderLength()const;
+   ossim_uint64 getResExtSegLength()const;
+   ossim_uint64 getTotalLength()const;
+  /**
+    * Is a 4 byte numeric 0-9999
+    */
+   char theResExtSegSubheaderLength[5];
+
+   /**
+    * Is a 7 byte numeric 0-9999999
+    */
+   char theResExtSegLength[8];
+};
+
+class OSSIMDLLEXPORT ossimNitfFileHeaderV2_1 : public ossimNitfFileHeaderV2_X
+{
+public:
+   
+   ossimNitfFileHeaderV2_1();
+   virtual ~ossimNitfFileHeaderV2_1();
+   virtual void parseStream(ossim::istream& in);
+   virtual void writeStream(ossim::ostream& out);
+   virtual bool isEncrypted()const;
+   virtual ossim_int32 getNumberOfImages()const;
+   virtual ossim_int32 getNumberOfLabels()const;
+   virtual ossim_int32 getNumberOfSymbols()const;
+   virtual ossim_int32 getNumberOfGraphics()const;
+   virtual ossim_int32 getNumberOfTextSegments()const;
+   virtual ossim_int32 getNumberOfDataExtSegments()const;
+  virtual ossim_int32 getNumberOfReservedExtSegments()const;
+   virtual ossim_int32 getHeaderSize()const;
+   virtual ossim_int64 getFileSize()const;
+   virtual const char* getVersion()const;
+   virtual const char* getDateTime()const;
+   virtual ossimDrect getImageRect()const;
+
+   virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_1& recordInfo);
+   virtual void deleteLastImageInfoRecord();
+   virtual void deleteLastDataExtSegInfoRecord();
+
+   virtual void addTextInfoRecord(const ossimNitfTextFileInfoRecordV2_1& recordInfo);
+	virtual void addDataExtSegInfoRecord(const ossimNitfDataExtSegInfoRecordV2_1& recordInfo);
+
+   virtual void replaceImageInfoRecord(int i, const ossimNitfImageInfoRecordV2_1& recordInfo);
+   
+   virtual ossimNitfImageHeader*  getNewImageHeader(ossim_uint32 imageNumber,
+                                                    ossim::istream& in)const;
+   virtual ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber,
+                                                     ossim::istream& in)const;
+   virtual ossimNitfLabelHeader* getNewLabelHeader(ossim_uint32 labelNumber,
+                                                   ossim::istream& in)const;
+   virtual ossimNitfTextHeader* getNewTextHeader(ossim_uint32 textNumber,
+                                                 ossim::istream& in)const;
+   virtual ossimNitfDataExtensionSegment* getNewDataExtensionSegment(
+      ossim_int32 dataExtNumber, ossim::istream& in)const;
+
+   virtual ossimNitfImageHeader*  allocateImageHeader()const;
+   virtual ossimNitfSymbolHeader* allocateSymbolHeader()const;
+   virtual ossimNitfLabelHeader*  allocateLabelHeader()const;
+   virtual ossimNitfTextHeader*   allocateTextHeader()const;
+   virtual ossimNitfDataExtensionSegment *allocateDataExtSegment()const;
+
+   virtual ossimString getSecurityClassificationSys()const;
+   virtual ossimString getCodeWords()const;
+   virtual ossimString getControlAndHandling()const;
+   virtual ossimString getReleasingInstructions()const;
+   virtual ossimString getDeclassificationType()const;
+   virtual ossimString getDeclassificationDate()const;
+   virtual ossimString getDeclassificationExemption()const;
+   virtual ossimString getDowngrade()const;
+   virtual ossimString getDowngradingDate()const;
+   virtual ossimString getClassificationText()const;
+   virtual ossimString getClassificationAuthorityType()const;
+   virtual ossimString getClassificationAuthority()const;
+   virtual ossimString getClassificationReason()const;
+   virtual ossimString getSecuritySourceDate()const;
+   virtual ossimString getSecurityControlNumber()const;
+   virtual void getBackgroundColor(ossim_uint8& r,
+                                   ossim_uint8& g,
+                                   ossim_uint8& b)const;
+   virtual ossimString getOriginatorsName()const;
+   virtual ossimString getOriginatorsPhone()const;
+   
+   virtual void setFileLength(ossim_uint64 fileLength);
+   virtual void setHeaderLength(ossim_uint64 headerLength);
+   
+   virtual void setSecurityClassificationSys(const ossimString& value);
+   virtual void setCodeWords(const ossimString& codeWords);
+   virtual void setControlAndHandling(const ossimString& controlAndHandling);
+   virtual void setReleasingInstructions(const ossimString& releasingInstructions);
+   virtual void setDeclassificationType(const ossimString& declassType);
+   virtual void setDeclassificationDate(const ossimLocalTm& declassDate);
+   virtual void setDeclassificationDate(const ossimString& declassDate);
+   virtual void setDeclassificationExemption(const ossimString& exemption);
+   virtual void setDowngrade(const ossimString& downgrade);
+   virtual void setDowngradingDate(const ossimLocalTm& date);
+   virtual void setDowngradingDate(const ossimString& date);
+   virtual void setClassificationText(const ossimString& classificationText);
+   virtual void setClassificationAuthorityType(const ossimString& authorityType);
+   virtual void setClassificationAuthority(const ossimString& authorityType);
+   virtual void setClassificationReason(const ossimString& reason);
+   virtual void setSecuritySourceDate(const ossimLocalTm& date);
+   virtual void setSecuritySourceDate(const ossimString& date);
+   virtual void setSecurityControlNumber(const ossimString& number);
+   virtual void setFileBackgroundColor(ossim_uint8 r,
+                                       ossim_uint8 g,
+                                       ossim_uint8 b);
+   virtual void setOriginatorsName(const ossimString& name);
+   virtual void setOriginatorsPhone(const ossimString& phone);
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   /**
+   * isValid will test if the fields are valid and will return true or false.
+   */
+   virtual bool isValid()const;
+
+   /*!
+    * @brief Method to set fields from a keyword list.
+    *
+    * This is not a true loadState as it does not lookup/initialize all class
+    * members.  This was added to allow defaults, e.g OSTAID, to be set via a
+    * site configuration file.
+    * Code does not return false if a field(key) is not found..
+    *
+    * @return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+
+   /**
+    * Properties of a NITF 2.1 Header file. See MIL-STD-2500B for details.
+    *
+    * To access these, pass the constant to getProperty().
+    */
+   static const ossimString FSCLSY_KW;
+   static const ossimString FSDCTP_KW;
+   static const ossimString FSDCDT_KW;
+   static const ossimString FSDCXM_KW;
+   static const ossimString FSDG_KW;
+   static const ossimString FSDGDT_KW;
+   static const ossimString FSCLTX_KW;
+   static const ossimString FSCATP_KW;
+   static const ossimString FSCRSN_KW;
+   static const ossimString FSSRDT_KW;
+   static const ossimString FBKGC_KW;
+   
+   void clearFields();
+
+   void addTag(ossimNitfTagInformation tag, bool unique = true);
+   void removeTag(const ossimString& tagName);
+   bool takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
+                         ossim_uint32 potentialDesIndex, bool userDefinedTags = false);
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+private:
+   /**
+    * Sets the number of image records in the NITF 2.1 File Header.
+    *
+    * @param num
+    *        The number of image records for the entire NITF 2.1 file.
+    *
+    * @throw std::out_of_range
+    */
+   void setNumberOfImageInfoRecords(ossim_uint64 num);
+   void setNumberOfTextInfoRecords(ossim_uint64 num);
+   void setNumberOfGraphicInfoRecords(ossim_uint64 num);
+   void setNumberOfDataExtSegInfoRecords(ossim_uint64 num);
+
+   void readImageInfoRecords(ossim::istream& in);
+   void readGraphicInfoRecords(ossim::istream& in);
+   void readTextFileInfoRecords(ossim::istream& in);
+   void readDataExtSegInfoRecords(ossim::istream& in);
+   void readResExtSegInfoRecords(ossim::istream& in);
+
+   /**
+    * If the header was parsed this method will initialize the offsets
+    * to whare all data resides within the file.  Example:  NITF files
+    * have several sections (Image, Symbol, Labels, Text and Extended data) and
+    * each of these sections have subsections.  The offsets stored are just offsets
+    * from the start of the file to each major section and eqach subsection.
+    */
+   void initializeAllOffsets();
+   
+   /**
+    * If the header was parsed and the offsets have been initialized, this method will
+    * parse all overflow tags and put them into theTagList.
+    */
+   void readOverflowTags(ossim::istream& in);
+   void readDes(std::istream& in);     
+
+   // Note: these are work variables and not part of the
+   // Nitf header.  These variables will be used to quickly
+   // access various parts of the file.
+   /**
+    * This is not part of the NITF file header.  This will be
+    * computed since somethimes the header size will not be
+    * given in the header field.  This value will hold a count of
+    * all the bytes read for the header portion.  This can be used
+    * to skip past the header data.
+    */
+   ossim_uint32 theHeaderSize;
+
+   /**
+    * This will be pre-computed when the header file is opened.  This is
+    * computed after we have found the display order.  We will use the
+    * rectangle of the smallest display number.
+    */
+   ossimDrect theImageRect;
+   
+   /**
+    * This will hold pre-computed offsets to the start of all image headers
+    * and start to their data.
+    */
+   std::vector<ossimNitfImageOffsetInformation>  theImageOffsetList;
+   
+   std::vector<ossimNitfGraphicOffsetInformation> theGraphicOffsetList;
+   std::vector<ossimNitfTextOffsetInformation> theTextFileOffsetList;
+   std::vector<ossimNitfDataExtSegOffsetInformation> theDataExtSegOffsetList;
+   
+   // START Of header variables
+   /**
+    * Field: FSCLSY
+    * 
+    * Is a 2 byte field.  Required but can be blank:
+    *
+    */
+   char theSecurityClassificationSys[3];
+
+   /**
+    * Field: FSCODE
+    * 
+    * This is a 11 byte Alphanumeric field
+    */
+   char theCodewords[12]; 
+
+   /**
+    * Field: FSCTLH
+    * 
+    * This is a 2 byte Alphanumeric field.
+    */
+   char theControlAndHandling[3]; 
+
+   /**
+    * Field: FSREL
+    * 
+    * This is a 20 byte Alphanumeric field.
+    */
+   char theReleasingInstructions[21]; 
+
+   /**
+    * Field: FSDCTP
+    * 
+    * This is a 2 byte alphanumeric field.
+    * 
+    * DD    declassify on a specific date
+    * DE    declassify upon occurrence of an event
+    * GD    downgrade to a specified level on a specific date)
+    * GE    downgrade to a specified level upon occurrence of an event)
+    * O     OADR
+    * X     exempt from automatic declassification
+    *
+    * NOTE: If this field is all BCS spaces (0x20), it shall imply that no
+    *       file security declassification or
+    */ 
+   char theDeclassificationType[3];
+
+   /**
+    * Field: FSDCDT
+    * 
+    * This is a 8 byte field and has the form
+    * CCYYMMDD where:
+    *
+    * CC is the firs 2 chars of the year 00-99
+    * YY is the second 2 chars of the year 00-99
+    * MM is the month 01-12
+    * DD is the day 01-31
+    */
+   char theDeclassificationDate[9]; 
+
+   /**
+    * Field: FSDCXM
+    * 
+    * Is a 4 byte field
+    */
+   char theDeclassificationExemption[5];
+   
+   /**
+    * Field: FSDG
+    * 
+    * Can be blank.  Is a 1 byte field valid
+    * values are:
+    *
+    * S = secret
+    * C = Confidential
+    * R = Restricted
+    * 0x20 or BCS spaces.
+    *
+    * if spaces then security downgrading does not apply.
+    */
+   char theDowngrade[2];
+
+   /**
+    * Field: FSDGDT
+    * 
+    * Is an 8 byte field of the form
+    * CCYYMMDD.
+    */
+   char theDowngradingDate[9];
+
+   /**
+    * Field: FSCLTX
+    * 
+    * Is a 43 byte field and can contain BCS spaces (0x20).
+    */
+   char theClassificationText[44];
+
+   /**
+    * Field: FSCATP
+    *
+    * Values can be:
+    * 
+    * O  Original classification authority
+    * D  derivative from a single source
+    * M  derivative from multiple sources
+    * 
+    * Is a 1 byte field and can contain BCS spaces (0x20).
+    */
+   char theClassificationAuthorityType[2];
+
+   /**
+    * Field: FSCAUT
+    * 
+    * Is a 40 byte field and can contain BCS spaces (0x20).
+    */
+   char theClassificationAuthority[41];
+
+   /**
+    * Field: FSCRSN
+    * 
+    * Is a 1 byte field and can contain BCS spaces (0x20).
+    *
+    * Valid values are A-G
+    */
+   char theClassificationReason[2];
+
+   /**
+    * Field: FSSRDT
+    * 
+    * Is a 8 byte field of the form CCYYMMDD and can be
+    * BCS space (0x20).
+    */
+   char theSecuritySourceDate[9];
+
+   /**
+    * Field: FSCTLN
+    * 
+    * Is a 15 byte field and can be blank (0x20)
+    */
+   char theSecurityControlNumber[16];
+   
+   /**
+    * Field: FBKGC
+    * 
+    * Required.  Is a 3 byte field and is reuqired.  Note:  This
+    * field is binary and has range
+    *
+    *      (0x00-0xff, 0x00-0xff, 0x00-0xff)
+    *
+    * each byte can range from 0 to 255 binary
+    */
+   ossim_uint8 theFileBackgroundColor[3];
+   
+   /**
+    * Field: ONAME
+    * 
+    * This is a 24 byte Alphanumeric number
+    */
+   char theOriginatorsName[25];
+
+   /**
+    * Field: OPHONE
+    * 
+    * This is an 18 byte Alphanumeric value. 
+    */
+   char theOriginatorsPhone[19]; 
+
+   /**
+    * Field: FL
+    * 
+    * This is a required field.
+    *
+    * Is a 12 byte number of the form
+    * 000000000388-999999999998 indicates the
+    * file length and a value of 999999999999
+    * indicates that the file length was not
+    * available.
+    */
+   char theFileLength[13];
+
+   /**
+    * Field: HL
+    * 
+    * This is a reqired field.
+    *
+    * ranges from 000388-999999.
+    */
+   char theHeaderLength[7];
+
+   /**
+    * Field: NUMI
+    * 
+    * This is a 3 byte field that specifies the number
+    * of images in the file.  0-999
+    */
+   char theNumberOfImageInfoRecords[4];
+
+   /**
+    * This information is conditional on the number of image
+    * info records field.  If the filed is greater than 0 then
+    * the record information is read in up t the indicated number
+    */
+   std::vector<ossimNitfImageInfoRecordV2_1> theNitfImageInfoRecords;
+
+   /**
+    * Field: NUMS
+    * 
+    * This info is required and ranges from 000-999.
+    */
+   char theNumberOfGraphicInfoRecords[4];
+
+   /**
+    * This is an optional field and will depend on
+    * theNumberOfGraphicInfoRecords.  If 0 then does not exist.
+    */
+   std::vector<ossimNitfGraphicInfoRecordV2_1> theNitfGraphicInfoRecords;
+
+   /**
+    * Field: NUMX
+    * 
+    * Is a 3 byte field and is reserved for future use.
+    */
+   char theReservedForFutureUse1[4];
+   
+   /**
+    * Field: NUMT
+    * 
+    * This is a 3 byte numeric 0-999.
+    */
+   char theNumberOfTextFileInfoRecords[4];
+
+   /**
+    * This information is conditional on the number of text file
+    * info records field.  If the filed is greater than 0 then
+    * the record information is read in up t the indicated number
+    */
+   std::vector<ossimNitfTextFileInfoRecordV2_1> theNitfTextFileInfoRecords;
+
+   /**
+    * Field: NUMDES
+    * 
+    * This is a 3 byte numeric 0-999.
+    */
+   char theNumberOfDataExtSegInfoRecords[4];
+
+   /**
+    * This information is conditional on the number of 
+    * info records field.  If the filed is greater than 0 then
+    * the record information is read in up t the indicated number
+    */
+   std::vector<ossimNitfDataExtSegInfoRecordV2_1> theNitfDataExtSegInfoRecords;
+
+   /**
+    * Field: NUMRES
+    * 
+    * This is a 3 byte numeric 0-999. Reserved Extension Segments
+    */
+   char theNumberOfResExtSegInfoRecords[4];
+
+   /**
+    * This information is conditional on the number of Res Ext Seg
+    * info records field.  If the filed is greater than 0 then
+    * the record information is read in up t the indicated number
+    */
+   std::vector<ossimNitfResExtSegInfoRecordV2_1> theNitfResExtSegInfoRecords;
+
+   /**
+    * Field: UDHDL
+    * 
+    * This is a required field and is a 5 byte numeric ranging
+    * from 0-99999.  This is 0 if there is no data.  Valid values
+    * are 00000 or 00003-99999
+    */
+   char theUserDefinedHeaderDataLength[6];
+
+   /**
+    * Field: UDHOFL
+    * 
+    * This exists if theUserDefinedHeaderDataLength is not 0.
+    */
+   char theUserDefinedHeaderOverflow[4];
+
+   /**
+    * Field: XHDL
+    * 
+    * This is a required field.  It is 5 bytes long and
+    * ranges from 0-99999.  0 means there is no data
+    */
+   char theExtendedHeaderDataLength[6];
+
+   /**
+    * Field: XHDLOFL
+    * 
+    * This is conditional on theExtendedHeaderDataLength.  If
+    * that field is 0 then this does not exist.  This is a 3
+    * byte field.
+    */
+   char theExtendedHeaderDataOverflow[4];
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfFileHeaderV2_X.h b/include/ossim/support_data/ossimNitfFileHeaderV2_X.h
new file mode 100644
index 0000000..9018b05
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfFileHeaderV2_X.h
@@ -0,0 +1,260 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimNitfFileHeaderV2_X_HEADER
+#define ossimNitfFileHeaderV2_X_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+
+class ossimKeywordlist;
+class ossimLocalTm;
+
+class OSSIM_DLL ossimNitfFileHeaderV2_X : public ossimNitfFileHeader
+{
+public:
+   ossimNitfFileHeaderV2_X();
+
+   static ossimString formatDate(const ossimString& version,
+                                 const ossimLocalTm& d);
+
+   virtual void setCodeWords(const ossimString& codeWords) = 0;
+   virtual void setControlAndHandling(const ossimString& controlAndHandling) = 0;
+   virtual void setReleasingInstructions(const ossimString& releasingInstructions) = 0;
+   virtual void setClassificationAuthority(const ossimString& classAuth) = 0;
+   virtual void setSecurityControlNumber(const ossimString& controlNo) = 0;
+   virtual void setOriginatorsName(const ossimString& originatorName) = 0;
+   virtual void setOriginatorsPhone(const ossimString& origniatorPhone) = 0;
+
+   virtual ossimString getCodeWords()const = 0;
+   virtual ossimString getControlAndHandling()const = 0;
+   virtual ossimString getReleasingInstructions()const = 0;
+   virtual ossimString getClassificationAuthority()const = 0;
+   virtual ossimString getSecurityControlNumber()const = 0;
+   virtual ossimString getOriginatorsName()const = 0;
+   virtual ossimString getOriginatorsPhone()const = 0;
+
+   virtual ossimString getSecurityClassification()const;
+   void setComplexityLevel(const ossimString& level);
+   void setSystemType(const ossimString& systemType);
+   void setOriginatingStationId(const ossimString& originationId);
+
+   /**
+    * @brief Sets field FDT.
+    *
+    * Version 2.0 format: DDHHMMSSZMONYY
+    * Version 2.1 format: CCYYMMDDhhmmss
+    *
+    * @param ossimLocalTm Local time.  Note that this will be converted to
+    * GMT(ZULU).
+    */
+   void setDate(const ossimLocalTm& d);
+
+   
+   /**
+    * @brief Sets field FDT.
+    *
+    * @param d Date string to copy to FDT field.
+    *
+    * @note No conversions performed. 
+    */
+   void setDate(const ossimString& d);
+
+   /**
+    * @brief Sets field FDT to current time converted to GMT(ZULU).
+    *
+    * Version 2.0 format: DDHHMMSSZMONYY
+    * Version 2.1 format: CCYYMMDDhhmmss
+    */
+   virtual void setDate();
+
+   void setTitle(const ossimString& title);
+   void setFileSecurityClassification(const ossimString& securityClassification);
+   void setCopyNumber(const ossimString& copyNumber);
+   void setNumberOfCopies(const ossimString& numberOfCopies);
+   void setEncryption(const ossimString& encryption);
+
+   ossimString getComplexityLevel()const;
+   ossimString getSystemType()const;
+   ossimString getOriginatingStationId()const;
+   ossimString getDate()const;
+   ossimString getTitle()const;
+   ossimString getCopyNumber()const;
+   ossimString getNumberOfCopies()const;
+   ossimString getEncryption()const;
+
+   /**
+   * isValid will test if the fields are valid and will return true or false.
+   */
+   virtual bool isValid()const;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+
+   /*!
+    * @brief Method to set fields from a keyword list.
+    *
+    * This is not a true loadState as it does not lookup/initialize all class
+    * members.  This was added to allow defaults, e.g OSTAID, to be set via a
+    * site configuration file.
+    * Code does not return false if a field(key) is not found..
+    *
+    * @return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   /**
+    * Properties of a NITF 2.x Header file. See MIL-STD-2500A or
+    * MIL-STD-2500B for details.
+    *
+    * To access these, pass the constant to getProperty().
+    */
+   static const ossimString FILE_TYPE_KW;
+   static const ossimString FHDR_KW;
+   static const ossimString VERSION_KW;
+   static const ossimString CLEVEL_KW;
+   static const ossimString STYPE_KW;
+   static const ossimString OSTAID_KW;
+   static const ossimString FDT_KW;
+   static const ossimString FTITLE_KW;
+   static const ossimString FSCLAS_KW;
+   static const ossimString FSCODE_KW;
+   static const ossimString FSCTLH_KW;
+   static const ossimString FSREL_KW;
+   static const ossimString FSCAUT_KW;
+   static const ossimString FSCTLN_KW;
+   static const ossimString FSCOP_KW;
+   static const ossimString FSCPYS_KW;
+   static const ossimString ENCRYP_KW;
+   static const ossimString ONAME_KW;
+   static const ossimString OPHONE_KW;
+
+protected:
+
+   /**
+    * Field: FHDR
+    * Required field for NITF and is a 9 byte value
+    *
+    * format is NITFNN.NN where NN.NN is the version
+    * number. The valid version number for this class
+    * is NITF02.10.
+    *
+    * NOTE: This field may contain NSIF01.00 which is also the same as NITF02.10
+    * 
+    */
+   char  theFileTypeVersion[10]; // nine bytes
+
+   /**
+    * Field: CLEVEL
+    * 
+    * Required field. 2 byte field ranges from 01-99
+    */
+   char  theComplexityLevel[3];  // 2 bytes
+
+   /**
+    * Field: STYPE
+    * 
+    * Required field. 4 bytes
+    */
+   char  theSystemType[5];      // four bytes
+
+   /**
+    * Field: OSTAID
+    * 
+    * Is required 10 byte field and can't be blank
+    * 
+    */
+   char  theOriginatingStationId[11]; // ten bytes
+
+   /**
+    * Field: FDT
+    * 
+    * for NITF 2.1 format we have
+    *
+    * Has the form CCYYMMDDhhmmss and is a required field
+    *
+    * where CC is the first two digits of the year 00-99
+    *       YY is the last 2 digits of the year 00-99
+    *       MM is the month 01-12
+    *       DD is the day 01-31
+    *       hh is the hour 00-23
+    *       mm is the minutes 00-59
+    *       ss is the seconds 00-59
+    *
+    * For NITF 2.0 format we have
+    *
+    * DDHHMMSSZMONYY
+    *
+    * where  DD is the day
+    *        HH is the hour
+    *        MM is the minutes
+    *        SS is the seconds
+    *        MON is the first 3 characters of the month
+    *        YY is the 2 digit year
+    */
+   char  theDateTime[15];  // 14 bytes
+
+   /**
+    * Field: FTITLE
+    * 
+    * Is a required field and is an 80 byte
+    * Alphanumeric value this can be all BCS spaces.
+    */
+   char  theFileTitle[81]; // 80 bytes
+
+   /**
+    * Field: FSCLAS
+    * 
+    * This is a reqired field and is 1 byte long and
+    * can contain one of the following:
+    *
+    *  T      Top secret
+    *  S      Secret
+    *  C      Confidential
+    *  R      Restricted
+    *  U      Unclassified
+    */
+   char theSecurityClassification[2];
+
+   /**
+    * Field: FSCOP
+    * 
+    * This is the copy number and is a 5 byte
+    * numeric of the form 00000-99999.  This field
+    * is required.
+    */
+   char theCopyNumber[6];
+
+   /**
+    * Field: FSCOPYS
+    * 
+    * This is the total number of copies that exist.
+    * This is a 5 byte numeric of the form 00000-99999.  This
+    * field is required.
+    */
+   char theNumberOfCopies[6];
+
+   /**
+    * Field: ENCRYP
+    * 
+    * This is a reqired field and is a 1 byte numeric
+    * where 0 is not encrypted and 1 is encrypted.  This field
+    * is reuqired.
+    */
+   char theEncryption[2];
+
+TYPE_DATA
+};
+
+#endif
+
diff --git a/include/ossim/support_data/ossimNitfGeoPositioningTag.h b/include/ossim/support_data/ossimNitfGeoPositioningTag.h
new file mode 100644
index 0000000..dbf5c84
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfGeoPositioningTag.h
@@ -0,0 +1,229 @@
+//********************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:      Garrett Potts
+// 
+// Description: Nitf support class
+//
+// Documentation reference:
+// DIGEST Part 2 Annex D - Appendix 1, Table D1-3
+// 
+//********************************************************************
+// $Id: ossimNitfGeoPositioningTag.h 22013 2012-12-19 17:37:20Z dburken $
+//
+#ifndef ossimNitfGeoPositioningTag_HEADER
+#define ossimNitfGeoPositioningTag_HEADER 1
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfGeoPositioningTag : public ossimNitfRegisteredTag
+{
+public:
+   ossimNitfGeoPositioningTag();
+   virtual ~ossimNitfGeoPositioningTag();
+
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+protected:
+   /**
+    * FIELD: TYP
+    *
+    * required 3 byte field.
+    * 
+    * Coordinate System Type
+    *
+    * This field shall contain the type of coordinate system to which the Image
+    * Segment refers.  Valid values are GEO for a geographic coordinate
+    * system (longitude & latitude), MAP for a cartographic (grid)
+    * coordinate system (easting & northing) and DIG for a geographic or
+    * cartographic coordinate system registered through location grids or
+    * registration points.
+    * See clause D1.2.2 for details.
+    * The default value is MAP.
+    *
+    *
+    * Values: MAP, GEO or DIG 
+    */
+   char theType[4];
+
+   /**
+    * FIELD: UNI
+    *
+    * required 3 byte field.
+    *
+    * Coordinate Units This field shall contain the units of measure to which
+    * the Image Segment refers.  Valid values are SEC (Decimal seconds of arc),
+    * DEG (Decimal degrees) and M (Metres).  The value must be consistent with
+    * the coordinate system type.  SEC and DEG are not allowed when the
+    * coordinate system type is MAP.  M is not allowed when the coordinate system
+    * type is GEO.  The PRJPS extension is expected when the value is M.
+    * The default value is M.
+    */
+   char theCoordinateUnits[4];
+
+
+   /**
+    * FIELD: DAG
+    * 
+    * required 80 byte field.
+    * 
+    * Geodetic Datum Name
+    *
+    * This field shall contain the name of the geodetic datum to which the
+    * Image Segment refers.
+    * The default value is World Geodetic System 1984.
+    * 
+    */
+   char theGeodeticDatumName[81];
+
+   /**
+    * FIELD: DCD
+    *
+    * required 4 byte field.
+    * 
+    * Geodetic Datum Code This field shall contain the code of the geodetic
+    * datum to which the Image Segment refers. The default value is WGE.
+    * 
+    */
+   char theGeodeticDatumCode[5];
+
+   /**
+    * FIELD: ELL
+    *
+    * required 80 byte field.
+    *
+    * Ellipsoid Name
+    *
+    * This field shall contain the name of the ellipsoid to which the
+    * Image Segment refers. The default value is World Geodetic System 1984.
+    * 
+    */
+   char theEllipsoidName[81];
+
+   /**
+    * FIELD: ELC
+    *
+    * required 3 byte field.
+    *
+    * Ellipsoid Code This field shall contain the code of the ellipsoid to
+    * which the Image Segment refers.
+    * The default value is WE.
+    * 
+    */
+   char theEllipsoidCode[4];
+
+   /**
+    * FIELD: DVR
+    *
+    * required 80 byte field.
+    *
+    * Vertical Datum Reference This field shall contain the name of the vertical
+    * datum reference to which the Image Segment refers, or BCS Spaces if no elevation value
+    * appears in the Image Segment. The default name is Geodetic. 
+    */
+   char theVerticalDatumReference[81];
+
+   /**
+    * FIELD: VDCDVR
+    *
+    * required 4 byte field.
+    * 
+    * Code (Category) of Vertical Reference This field shall contain the code
+    * (or category) of the vertical reference to which the Image Segment
+    * refers, or BCS Spaces if no elevation value appears in the Image Segment.
+    * The default code is GEOD.
+    * 
+    */
+   char theVerticalReferenceCode[5];
+
+   /**
+    * FIELD: SDA
+    *
+    * required 80 byte field.
+    * 
+    * Sounding Datum Name This field shall contain the name of the sounding datum
+    * to which the Image Segment refers, or BCS Spaces i
+    * f no sounding appears in the Image Segment.
+    * The default value is Mean Sea.
+    */
+   char theSoundingDatumName[81];
+
+   /**
+    * FIELD: VDCSDA
+    *
+    * required 4 byte field.
+    * 
+    * Code for  Sounding Datum This field shall contain the code of the
+    * sounding datum to which the Image Segment refers, or BCS Spaces
+    * if no sounding appears in the Image Segment.
+    * The default valid code is MSL. 4BCS-A See Part 3-6 <R> 
+    */
+   char theSoundingDatumCode[5];
+
+   /**
+    * FIELD ZOR
+    *
+    * required 15 byte field
+    *
+    * Z values False Origin
+    *
+    * This field shall contain the elevation and depth false origin for Z values
+    * to which the Image Segment refers. The default value is 000000000000000,
+    * which implies that there is no projection false Z origin. 15 BCS-N positive integer
+    * 
+    */
+   char theZFalseOrigin[16];
+
+   /**
+    * FIELD: GRD
+    *
+    * required 3 byte field.
+    * 
+    * Grid Code This field shall contain the identification code of the grid system
+    * to which the Image Segment refers, or BCS Spaces. The default value is
+    * BCS Spaces. 3BCS-A See Part 3-6 <R> 
+    */
+   char theGridCode[4];
+
+   /**
+    * FIELD: GRN
+    *
+    * required 80 byte field.
+    *
+    * Grid Description If the GRD Field value is not BCS Spaces, this field can
+    * contain a text description of the grid system.
+    * The default value is BCS Spaces. 80 BCS-A <R> 
+    */
+   char theGridDescription[81];
+
+   /**
+    * FIELD: ZNA
+    *
+    * required 4 byte field.
+    *
+    * Grid Zone number This field shall contain the zone number when the GRD
+    * Field contains a significant grid code and the corresponding grid system
+    * comprises more than one zone. Defaulted to 0000 otherwise.
+    * 4 BCS-N integer See Part 3-6 R 
+    */
+   char theGridZoneNumber[5];
+
+   
+TYPE_DATA   
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfHistoaTag.h b/include/ossim/support_data/ossimNitfHistoaTag.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfHistoaTag.h
rename to include/ossim/support_data/ossimNitfHistoaTag.h
diff --git a/include/ossim/support_data/ossimNitfIchipbTag.h b/include/ossim/support_data/ossimNitfIchipbTag.h
new file mode 100644
index 0000000..55fc330
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfIchipbTag.h
@@ -0,0 +1,567 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description: ICHIPB tag class declaration.
+//
+// See document STDI-0002 Table 5-2 for more info.
+// 
+// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfIchipbTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfIchipbTag_HEADER
+#define ossimNitfIchipbTag_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class ossimDpt;
+class ossimDrect;
+class ossim2dTo2dTransform;
+class OSSIM_DLL ossimNitfIchipbTag : public ossimNitfRegisteredTag
+{
+public:
+   enum 
+   {
+      XFRM_FLAG_SIZE    =  2,
+      
+      SCALE_FACTOR_SIZE = 10,
+      
+      ANAMRPH_CORR_SIZE =  2,
+      
+      SCANBLK_NUM_SIZE  =  2,
+
+      OP_ROW_11_SIZE    = 12,
+      OP_COL_11_SIZE    = 12,
+
+      OP_ROW_12_SIZE    = 12,
+      OP_COL_12_SIZE    = 12,
+
+      OP_ROW_21_SIZE    = 12,
+      OP_COL_21_SIZE    = 12,
+
+      OP_ROW_22_SIZE    = 12,
+      OP_COL_22_SIZE    = 12,
+      
+      FI_ROW_11_SIZE    = 12,
+      FI_COL_11_SIZE    = 12,
+
+      FI_ROW_12_SIZE    = 12,
+      FI_COL_12_SIZE    = 12,
+
+      FI_ROW_21_SIZE    = 12,
+      FI_COL_21_SIZE    = 12,
+
+      FI_ROW_22_SIZE    = 12,
+      FI_COL_22_SIZE    = 12,
+
+      FI_ROW_SIZE       =  8,
+      FI_COL_SIZE       =  8
+      //                ------
+      //                 224
+   };
+   
+   /** default constructor */
+   ossimNitfIchipbTag();
+
+   /**
+    * Parse method.
+    *
+    * @param in Stream to parse.
+    */
+   virtual void parseStream(std::istream& in);
+   
+   /**
+    * Write method.
+    *
+    * @param out Stream to write to.
+    */
+   virtual void writeStream(std::ostream& out);
+   
+   /**
+    * Clears all string fields within the record to some default nothingness.
+    */
+   virtual void clearFields();
+   
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+
+   /**
+    * @return The Non-linear transformation flag.
+    */
+   bool getXfrmFlag() const;
+
+   /**
+    * @return Scale factor relative to R0 (original full res image resolution).
+    */
+   ossim_float64 getScaleFactor() const;
+
+   /**
+    * @return Anamophic correction indicator.
+    */
+   bool getAnamrphCorrFlag() const;
+
+   /**
+    * @return Scan block number or scan block index.
+    */
+   ossim_uint32 getScanBlock() const;
+
+   /**
+    * @return Output product row number component of grid point index (1,1) for
+    * intelligent data,
+    */
+   ossim_float64 getOpRow11() const;
+
+   /**
+    * Output product column number component of grid point index (1,1) for
+    * intelligent data.
+    */
+   ossim_float64 getOpCol11() const;
+
+   /**
+    * @return Output product row number component of grid point index (1,2) for
+    * intelligent data,
+    */
+   ossim_float64 getOpRow12() const;
+
+   /**
+    * Output product column number component of grid point index (1,2) for
+    * intelligent data.
+    */
+   ossim_float64 getOpCol12() const;
+
+   /**
+    * @return Output product row number component of grid point index (2,1) for
+    * intelligent data,
+    */
+   ossim_float64 getOpRow21() const;
+
+   /**
+    * Output product column number component of grid point index (2,1) for
+    * intelligent data.
+    */
+   ossim_float64 getOpCol21() const;
+
+   /**
+    * @return Output product row number component of grid point index (2,2) for
+    * intelligent data,
+    */
+   ossim_float64 getOpRow22() const;
+   
+   /**
+    * @return Output product row number component of grid point index (2,2) for
+    * intelligent data,
+    */
+   ossim_float64 getOpCol22() const;
+
+   /**
+    * @return Grid point (1,1) row number in full image coordinate system.
+    */
+   ossim_float64 getFiRow11() const;
+   
+   /**
+    * @return Grid point (1,1) column number in full image coordinate system.
+    */
+   ossim_float64 getFiCol11() const;
+   
+   /**
+    * @return Grid point (1,2) row number in full image coordinate system.
+    */
+   ossim_float64 getFiRow12() const;
+   
+   /**
+    * @return Grid point (1,2) row number in full image coordinate system.
+    */
+   ossim_float64 getFiCol12() const;
+   
+   /**
+    * @return Grid point (2,1) row number in full image coordinate system.
+    */
+   ossim_float64 getFiRow21() const;
+
+   /**
+    * @return Grid point (2,1) row number in full image coordinate system.
+    */
+   ossim_float64 getFiCol21() const;
+
+   /**
+    * @return Grid point (2,2) row number in full image coordinate system.
+    */
+   ossim_float64 getFiRow22() const;
+
+   /**
+    * @return Grid point (2,2) row number in full image coordinate system.
+    */
+   ossim_float64 getFiCol22() const;
+
+   /**
+    * @return Full image number of rows.
+    */
+   ossim_uint32 getFullImageRows() const;
+
+   /**
+    * @return Full image number of cols.
+    */
+   ossim_uint32 getFullImageCols() const;
+
+   /**
+    * Initializes rect with the image rectangle without any sub image offset
+    * applied.   This is the rectangle of the chip starting at (0,0).
+    *
+    * @param rect The rect to initialize.
+    *
+    * @note Rectangle is shifted by -0.5 since per spec (0,0) is the
+    * considered the upper left corner of the upper left pixel and we use a
+    * point method where (0,0) refers to the center of the pixel.
+    */
+   void getImageRect(ossimDrect& rect) const;
+
+    /**
+    * Initializes rect with the image rectangle with sub image offset
+    * applied.   This is the rectangle of the chip relative to the full
+    * image or starting at the sub image offset.
+    *
+    * @param rect The rect to initialize.
+    *
+    * @note Rectangle is shifted by -0.5 since per spec (0,0) is the
+    * considered the upper left corner of the upper left pixel and we use a
+    * point method where (0,0) refers to the center of the pixel.
+    */
+   void getFullImageRect(ossimDrect& rect) const;
+
+   ossim2dTo2dTransform* newTransform()const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   bool loadState(const ossimKeywordlist& kwl, const char* prefix);
+   
+protected:
+
+
+   /**
+    * FIELD: XFRM_FLAG
+    *
+    * required 2 byte field
+    *
+    * 00 or 01
+    * 
+    * Non-linear transformation flag.
+    *
+    * NOTE:  If 01 remaining data zero filled.
+    */
+   char theXfrmFlag[XFRM_FLAG_SIZE+1];
+
+   
+   /**
+    * FIELD: SCALE_FACTOR
+    *
+    * required 10 byte field
+    *
+    * xxxx.xxxxx
+    *
+    * Scale factor relative to R0 (original full res image resolution).
+    */
+   char theScaleFactor[SCALE_FACTOR_SIZE+1];
+      
+  
+   /**
+    * FIELD: ANAMRPH_CORR
+    *
+    * required 2 byte field
+    *
+    * 00 or 01
+    * 
+    * Anamophic correction indicator.
+    */
+   char theAnamrphCorr[ANAMRPH_CORR_SIZE+1];
+   
+   /**
+    * FIELD: SCANBLK_NUM
+    *
+    * required 2 byte field
+    *
+    * 00-99, 00 if not applicable
+    * 
+    * Scan block number or scan block index.
+    */
+   char theScanBlock[SCANBLK_NUM_SIZE+1];
+   
+   /**
+    * FIELD: OP_ROW_11
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy typically 00000000.500
+    * 
+    * Output product row number component of grid point index (1,1) for
+    * intelligent data.
+    */
+   char theOpRow11[OP_ROW_11_SIZE+1];
+
+   /**
+    * FIELD: OP_COL_11
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy typically 00000000.500
+    * 
+    * Output product column number component of grid point index (1,1) for
+    * intelligent data.
+    * 
+    */
+   char theOpCol11[OP_COL_11_SIZE+1];
+
+   /**
+    * FIELD: OP_ROW_12
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Output product row number component of grid point index (1,2) for
+    * intelligent data.
+    */
+   char theOpRow12[OP_ROW_12_SIZE+1];
+
+   /**
+    * FIELD: OP_COL_12
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Output product column number component of grid point index (1,2) for
+    * intelligent data.
+    */
+   char theOpCol12[OP_COL_12_SIZE+1];
+   
+   /**
+    * FIELD: OP_ROW_21
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Output product row number component of grid point index (2,1) for
+    * intelligent data.
+    */
+   char theOpRow21[OP_ROW_21_SIZE+1];
+
+   /**
+    * FIELD: OP_COL_21
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Output product column number component of grid point index (2,1) for
+    * intelligent data.
+    */
+   char theOpCol21[OP_COL_21_SIZE+1];
+   
+   /**
+    * FIELD: OP_ROW_22
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Output product row number component of grid point index (2,2) for
+    * intelligent data.
+    */
+   char theOpRow22[OP_ROW_22_SIZE+1];
+
+   /**
+    * FIELD: OP_COL_22
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Output product column number component of grid point index (2,2) for
+    * intelligent data.
+    */
+   char theOpCol22[OP_COL_22_SIZE+1];
+
+   /**
+    * FIELD: FI_ROW_11
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy typically 00000000.500
+    * 
+    * Grid point (1,1) row number in full image coordinate system.
+    */
+   char theFiRow11[FI_ROW_11_SIZE+1];
+
+   /**
+    * FIELD: FI_COL_11
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy typically 00000000.500
+    * 
+    * Grid point (1,1) column number in full image coordinate system.
+    */
+   char theFiCol11[FI_COL_11_SIZE+1];
+
+   /**
+    * FIELD: FI_ROW_12
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Grid point (1,2) row number in full image coordinate system.
+    */
+   char theFiRow12[FI_ROW_12_SIZE+1];
+
+   /**
+    * FIELD: FI_COL_12
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Grid point (1,2) column number in full image coordinate system.
+    */
+   char theFiCol12[FI_COL_12_SIZE+1];
+   
+   /**
+    * FIELD: FI_ROW_21
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Grid point (2,1) row number in full image coordinate system.
+    */
+   char theFiRow21[FI_ROW_21_SIZE+1];
+
+   /**
+    * FIELD: FI_COL_21
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Grid point (2,1) column number in full image coordinate system.
+    */
+   char theFiCol21[FI_COL_21_SIZE+1];
+   
+   /**
+    * FIELD: FI_ROW_22
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Grid point (2,2) row number in full image coordinate system.
+    */
+   char theFiRow22[FI_ROW_22_SIZE+1];
+
+   /**
+    * FIELD: FI_COL_22
+    *
+    * required 12 byte field
+    *
+    * xxxxxxxx.yyy
+    * 
+    * Grid point (2,2) column number in full image coordinate system.
+    */
+   char theFiCol22[FI_COL_22_SIZE+1];
+
+   /**
+    * FIELD:  FI_ROW
+    *
+    * required 8 byte field
+    *
+    * 00000000 and 00000002 to 99999999
+    * 
+    * Full image number of rows.
+    */
+   char theFullImageRow[FI_ROW_SIZE+1];
+   
+   /**
+    * FIELD:  FI_COL
+    *
+    * required 8 byte field
+    *
+    * 00000000 and 00000002 to 99999999
+    * 
+    * Full image number of cols.
+    */
+   char theFullImageCol[FI_COL_SIZE+1];
+
+   
+   
+   
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   
+                            
+   /**
+    * FIELD: 
+    *
+    * required  byte field
+    *
+    * 01 to 99
+    * 
+    * 
+    */
+   /**
+    * FIELD: 
+    *
+    * required  byte field
+    *
+    * 01 to 99
+    * 
+    * 
+    */
+   /**
+    * FIELD: 
+    *
+    * required  byte field
+    *
+    * 01 to 99
+    * 
+    * 
+    */
+   
+   
+TYPE_DATA   
+};
+
+#endif /* End of "#ifndef ossimNitfIchipbTag_HEADER" */
diff --git a/include/ossim/support_data/ossimNitfImageBand.h b/include/ossim/support_data/ossimNitfImageBand.h
new file mode 100644
index 0000000..d013997
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageBand.h
@@ -0,0 +1,52 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfImageBand_HEADER
+#define ossimNitfImageBand_HEADER 1
+
+#include <ossim/support_data/ossimNitfImageLut.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <string>
+
+class ossimNitfImageBand : public ossimObject
+{
+public:
+   ossimNitfImageBand();
+   virtual ~ossimNitfImageBand();
+   virtual void parseStream(ossim::istream& in)=0;
+   virtual void writeStream(ossim::ostream& out)=0;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out Stream to output to.
+    * @param prefix Like "image0."
+    * @param band zero based band.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix,
+                               ossim_uint32 band)const=0;
+
+   virtual ossim_uint32 getNumberOfLuts()const=0;
+   virtual const ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx)const=0;
+   virtual ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx)=0;
+
+   /** @return The band representation as an ossimString. */
+   virtual ossimString getBandRepresentation() const = 0;
+
+TYPE_DATA;
+};
+
+#endif /* #ifndef ossimNitfImageBand_HEADER */
diff --git a/include/ossim/support_data/ossimNitfImageBandV2_0.h b/include/ossim/support_data/ossimNitfImageBandV2_0.h
new file mode 100644
index 0000000..d025e1b
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageBandV2_0.h
@@ -0,0 +1,116 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfImageBandV2_0_HEADER
+#define ossimNitfImageBandV2_0_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimNitfImageBand.h>
+#include <ossim/support_data/ossimNitfImageLutV2_0.h>
+#include <string>
+
+
+class OSSIM_DLL ossimNitfImageBandV2_0 : public ossimNitfImageBand
+{
+public:
+   
+   /** default constructor */
+   ossimNitfImageBandV2_0();
+
+   /** virtual destructory */
+   virtual ~ossimNitfImageBandV2_0();
+   
+   virtual void parseStream(ossim::istream& in);
+   virtual void writeStream(ossim::ostream& out);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out Stream to output to.
+    * @param prefix Like "image0."
+    * @param band zero based band.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string(),
+                               ossim_uint32 band=0) const;   
+   
+   virtual ossim_uint32 getNumberOfLuts()const;
+   virtual const ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx)const;
+   virtual ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx);
+
+   /** @return The band representation as an ossimString. */
+   virtual ossimString getBandRepresentation()const;
+
+   /**
+    * Sets the band representation.
+    *
+    * @param rep The band representation.
+    */
+   virtual void setBandRepresentation(const ossimString& rep);
+
+   /** @return The band significance as an ossimString. */
+   virtual ossimString getBandSignificance()const;
+
+   /**
+    * Sets the band significance.
+    *
+    * @param rep The band significance.
+    */
+   virtual void setBandSignificance(const ossimString& rep);
+
+   bool loadState(const ossimKeywordlist& kwl, const char* prefix, ossim_uint32 index=0);
+
+protected:
+   void clearFields();
+   void printLookupTables(std::ostream& out)const;
+   /*!
+    * FIELD: IREPBAND,,
+    * Is a required 2 byte field.  When theNumberOfBands is
+    * 1 this field will contain all spaces.
+    */
+   char theBandRepresentation[3];
+
+   /*!
+    * FIELD:  ISUBCATnn
+    * Is a required 6 byte field.
+    */
+   char theBandSignificance[7];
+
+   /*!
+    * FIELD:  IFCnn
+    * Is an required 1 byte field.  Will be N
+    */
+   char theBandImageFilterCondition[2];
+
+   /*!
+    * FIELD:  IMFLTnn
+    * is a required 3 byte field.  This is a reserved field
+    */
+   char theBandStandardImageFilterCode[4];
+
+   /*!
+    * FIELD:  NLUTSnn
+    * This is a required 1 byte field.  Has value 0-4
+    */
+   char theBandNumberOfLuts[2];
+
+   /*!
+    * NELUTnn
+    * This is a conditional field.
+    */
+   char theBandNumberOfLutEntries[6];
+
+   std::vector<ossimRefPtr<ossimNitfImageLut> > theLookupTables;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfImageBandV2_1.h b/include/ossim/support_data/ossimNitfImageBandV2_1.h
new file mode 100644
index 0000000..1251e58
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageBandV2_1.h
@@ -0,0 +1,27 @@
+//*******************************************************************
+//
+// LICENSE: MIT
+//
+// Author:  David Burken <dburken at imagelinks.com>
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfImageBandV2_1_HEADER
+#define ossimNitfImageBandV2_1_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimNitfImageBandV2_0.h>
+
+class OSSIM_DLL ossimNitfImageBandV2_1 : public ossimNitfImageBandV2_0
+{
+public:
+
+   /** default constructor */
+   ossimNitfImageBandV2_1();
+
+   /** virtual destructory */
+   virtual ~ossimNitfImageBandV2_1();
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfImageDataMaskV2_1.h b/include/ossim/support_data/ossimNitfImageDataMaskV2_1.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfImageDataMaskV2_1.h
rename to include/ossim/support_data/ossimNitfImageDataMaskV2_1.h
diff --git a/include/ossim/support_data/ossimNitfImageHeader.h b/include/ossim/support_data/ossimNitfImageHeader.h
new file mode 100644
index 0000000..90de613
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageHeader.h
@@ -0,0 +1,204 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfImageHeader_HEADER
+#define ossimNitfImageHeader_HEADER 1
+
+#include <ossim/base/ossimNBandLutDataObject.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimPropertyInterface.h>
+#include <ossim/support_data/ossimNitfTagInformation.h>
+#include <ossim/support_data/ossimNitfCompressionHeader.h>
+#include <ossim/support_data/ossimNitfImageBand.h>
+#include <vector>
+
+class ossimString;
+class ossimDpt;
+class ossimIpt;
+class ossimIrect;
+
+class OSSIMDLLEXPORT ossimNitfImageHeader : public ossimObject,
+                                            public ossimPropertyInterface
+{
+public:
+   ossimNitfImageHeader();
+   virtual ~ossimNitfImageHeader();
+
+   virtual bool getTagInformation(ossimNitfTagInformation& tagInfo,
+                                  ossim_uint32 idx) const;
+
+   virtual std::vector<ossimNitfTagInformation> getAllTags() { return theTagList; }
+
+   virtual void setAllTags(std::vector<ossimNitfTagInformation> tagList) { theTagList = tagList; }
+   
+   virtual bool getTagInformation(ossimNitfTagInformation& tagInfo,
+                                  const ossimString& tagName) const;
+   
+   ossimRefPtr<ossimNitfRegisteredTag> getTagData(const ossimString& tagName);
+   
+   
+   const ossimRefPtr<ossimNitfRegisteredTag> getTagData(
+      const ossimString& tagName) const;
+
+   /**
+    * @brief Returns all tags of type tagName.
+    *
+    * Vector passed in "tags" is cleared, then initialized with all tags
+    * found of "tagName".  Size of vector is returned.
+    * 
+    * @param tagName E.g. "RSMPCA"
+    * @param tags Initialized by this.
+    */
+   void getTagData(
+      const ossimString& tagName,
+      std::vector< const ossimNitfRegisteredTag*> &tags ) const;
+   
+   virtual ossim_uint32 getNumberOfTags()const;
+
+   virtual void addTag(const ossimNitfTagInformation& tag, bool unique=true);
+   virtual void removeTag(const ossimString& tagName);
+   
+   virtual void parseStream(ossim::istream& in)= 0;
+   virtual void writeStream(ossim::ostream& out)= 0;
+
+   virtual bool isCompressed()const=0;
+   virtual bool isEncrypted()const=0;
+
+   /**
+   * isValid will test if the fields are valid and will return true or false.
+   */
+   virtual bool isValid()const=0;
+
+   virtual ossimString getCompressionCode()const=0;
+   virtual ossimString getCompressionRateCode()const=0;
+   virtual ossim_uint32 getDisplayLevel()const=0;
+   virtual ossim_uint32 getAttachmentLevel()const=0;
+   
+   virtual ossim_int32 getNumberOfRows()const=0;
+   virtual ossim_int32 getNumberOfBands()const=0;
+   virtual ossim_int32 getNumberOfCols()const=0;
+   virtual ossim_int32 getNumberOfBlocksPerRow()const=0;
+   virtual ossim_int32 getNumberOfBlocksPerCol()const=0;
+   virtual ossim_int32 getNumberOfPixelsPerBlockHoriz()const=0;
+   virtual ossim_int32 getNumberOfPixelsPerBlockVert()const=0;
+   virtual ossimString getImageId()const=0;
+   virtual ossimString getTitle()const=0;
+   virtual ossim_int32 getActualBitsPerPixelPerBand()const=0;
+   virtual ossim_int32 getBitsPerPixelPerBand()const=0;
+   virtual ossimIrect  getImageRect()const=0;
+   /**
+    * Blocks might not be the same size as the significant rows and cols used
+    * by the getImageRect.
+    */
+   virtual ossimIrect   getBlockImageRect()const=0;
+   virtual ossimString  getIMode()const=0;
+   virtual ossim_uint64 getDataLocation()const=0;
+
+   /** @return The IDATIM field unparsed. */
+   virtual ossimString  getImageDateAndTime() const=0;
+   
+   virtual ossimString  getAcquisitionDateMonthDayYear(ossim_uint8 separationChar='-')const=0;
+   virtual ossimString  getSecurityClassification()const=0;
+   virtual ossimString  getCategory()const=0;
+   virtual ossimString  getImageSource()const=0;
+   virtual ossimString  getRepresentation()const=0;
+   virtual ossimString  getCoordinateSystem()const=0;
+   virtual ossimString  getGeographicLocation()const=0;
+   virtual ossimString  getPixelValueType()const=0;
+
+   /** @return IMAG field */
+   virtual ossimString  getImageMagnification()const=0;
+
+   /**
+    * @brief Gets the ILOC field as an ossimIpt.
+    * @param loc Initialized with the field.
+    * @note: Do not confuse with "data location".
+    */
+   virtual void getImageLocation(ossimIpt& loc)const=0;
+
+   /**
+    * @brief Convenience method to get the decimation factor as a double from
+    * the string returned be the getImageMagnification() method.
+    *
+    * @param result Initialized with the decimation factor as a double.
+    * Will return an ossim::nan() if something bad happens like the string is
+    * empty so callers should check result with ossim::isnan(result).
+    */
+   virtual void getDecimationFactor(ossim_float64& result) const;
+   
+   virtual bool hasBlockMaskRecords()const=0;
+   virtual bool hasPadPixelMaskRecords()const=0;
+   virtual bool hasTransparentCode()const=0;
+   virtual ossim_uint32 getTransparentCode()const=0;
+   virtual ossim_uint32 getBlockMaskRecordOffset(ossim_uint32 blockNumber,
+                                                 ossim_uint32 bandNumber)const=0;
+   
+   virtual ossim_uint32 getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
+                                                    ossim_uint32 bandNumber)const=0;
+   virtual const ossimRefPtr<ossimNitfCompressionHeader> getCompressionHeader()const=0;
+   virtual const ossimRefPtr<ossimNitfImageBand> getBandInformation(ossim_uint32 idx)const=0;
+   bool hasLut()const;
+   ossimRefPtr<ossimNBandLutDataObject> createLut(ossim_uint32 bandIdx)const;
+   virtual bool isSameAs(const ossimNitfImageHeader* hdr) const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   virtual ossim_uint32 getTotalTagLength()const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& printTags(
+      std::ostream& out, const std::string& prefix=std::string()) const;
+   
+   /**
+    * @brief Populates keyword list with metadata.
+    * expample:  country_code: US
+    * 
+    * @param kwl Keywordlist to populate with metadata.
+    *
+    * @param prefix Optional prefix to put in front of key, like: "image1.".
+    */
+   virtual void getMetadata(ossimKeywordlist& kwl,
+                            const char* prefix=0) const;
+
+   /**
+    * @brief pure virtual print method that outputs a key/value type format
+    * adding prefix to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const = 0;
+
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+protected:
+
+   /**
+    * Method to check tie point to see if it will be truncated in field
+    * IGEOLO which has only arc second resolution.
+    * 
+    * Spits out warning if tie does not evenly divide by an arc second.
+    *
+    * @param tie Tie point to check.
+    */
+   void checkForGeographicTiePointTruncation(const ossimDpt& tie) const;
+   
+   std::vector<ossimNitfTagInformation> theTagList;
+
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfImageHeaderV2_0.h b/include/ossim/support_data/ossimNitfImageHeaderV2_0.h
new file mode 100644
index 0000000..0dd6807
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageHeaderV2_0.h
@@ -0,0 +1,168 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfImageHeaderV2_0_HEADER
+#define ossimNitfImageHeaderV2_0_HEADER 1
+
+#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
+#include <ossim/support_data/ossimNitfImageBandV2_0.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <iterator>
+
+class OSSIMDLLEXPORT ossimNitfImageHeaderV2_0 : public ossimNitfImageHeaderV2_X
+{
+public:
+   ossimNitfImageHeaderV2_0();
+   virtual ~ossimNitfImageHeaderV2_0();
+
+   virtual void parseStream(ossim::istream& in);
+   virtual void writeStream(ossim::ostream& out);
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+   virtual bool        isCompressed()const;
+   virtual bool        isEncrypted()const;
+
+   virtual ossim_int32  getNumberOfBands()const;
+   virtual ossim_int32  getNumberOfRows()const;
+   virtual ossim_int32  getNumberOfCols()const;
+   virtual ossim_int32  getNumberOfBlocksPerRow()const;
+   virtual ossim_int32  getNumberOfBlocksPerCol()const;
+   virtual ossim_int32  getNumberOfPixelsPerBlockHoriz()const;
+   virtual ossim_int32  getNumberOfPixelsPerBlockVert()const;
+   virtual ossimString  getImageId()const;
+   virtual ossim_int32  getBitsPerPixelPerBand()const;
+   virtual ossim_int32  getActualBitsPerPixelPerBand()const;
+   virtual ossimString  getIMode()const;
+   virtual ossimString  getSecurityClassification()const;
+
+   /** @return The IDATIM field unparsed. */
+   virtual ossimString  getImageDateAndTime() const;
+   virtual ossimString  getAcquisitionDateMonthDayYear(
+      ossim_uint8 separationChar='-')const;
+   virtual ossimString  getCategory()const;
+   virtual ossimString  getImageSource()const;
+   virtual ossimString  getRepresentation()const;
+   virtual ossimString  getCoordinateSystem()const;
+
+   virtual ossimString  getPixelValueType()const;
+   virtual bool         hasBlockMaskRecords()const;
+   virtual bool         hasPadPixelMaskRecords()const;
+   virtual bool         hasTransparentCode()const;
+   virtual ossim_uint32 getTransparentCode()const;
+   virtual ossim_uint32 getBlockMaskRecordOffset(ossim_uint32 blockNumber,
+                                                 ossim_uint32 bandNumber)const;
+   virtual ossim_uint32 getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
+                                                    ossim_uint32 bandNumber)const;
+   
+   virtual const ossimRefPtr<ossimNitfCompressionHeader> getCompressionHeader()const;
+   virtual const ossimRefPtr<ossimNitfImageBand> getBandInformation(ossim_uint32 idx)const;
+
+   virtual void setNumberOfBands(ossim_uint32 nbands);
+   virtual void setBandInfo(ossim_uint32 idx,
+                            const ossimNitfImageBandV2_0& info);
+   virtual void setNumberOfRows(ossim_uint32 rows);
+   virtual void setNumberOfCols(ossim_uint32 cols);
+   virtual bool isValid()const;
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+   
+   static const ossimString ISCODE_KW;
+   static const ossimString ISCTLH_KW;
+   static const ossimString ISREL_KW;
+   static const ossimString ISCAUT_KW;
+   static const ossimString CTLN_KW;
+   static const ossimString ISDWNG_KW;
+   static const ossimString ISDEVT_KW;
+   
+TYPE_DATA
+private:
+   //
+   
+   void clearFields();
+
+   /*!
+    * FIELD ISCODE:
+    * is a 40 byte field
+    */
+   char theCodewords[41];
+
+   /*!
+    * FIELD ISCTLH:
+    * is a 40 byte field
+    */
+   char theControlAndHandling[41];
+
+   /*!
+    * FIELD ISREL:
+    * Is a 40 byte field.
+    */
+   char theReleasingInstructions[41];
+
+   /*!
+    * FIELD ISCAUT:
+    * Is a 20 byte field
+    */
+   char theClassificationAuthority[21];
+
+   /*!
+    * FIELD CTLN:
+    */
+   char theSecurityControlNumber[21];
+
+   /*!
+    * FIELD ISDWNG:
+    * Is a 6 byte field with form:
+    *
+    *  YYMMDD.  Year month day
+    *
+    * 999999 indicates that he Originating
+    *        agencies determination is required
+    *        (OADR)
+    * 999998 downgrade event will specify at what
+    *        point and time the declassification
+    *        or downgrading is to take place.
+    */
+   char theSecurityDowngrade[7];
+
+   /*!
+    * FIELD ISDEVT:
+    * This is a conditional field and is present
+    * if the Security downgrade is 999998.
+    */
+   char theDowngradingEvent[41];
+
+   /**
+    * Will contain also the field NBANDS and we will have to recreate the prefix for
+    * 
+    * Container for repetitive fields:
+    * IREPBAND
+    * ISUBCAT
+    * IFC
+    * IMFLT
+    * NLUTS
+    * NELUT1
+    * LUTD
+    */ 
+   std::vector<ossimRefPtr<ossimNitfImageBandV2_0> > theImageBands;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfImageHeaderV2_1.h b/include/ossim/support_data/ossimNitfImageHeaderV2_1.h
new file mode 100644
index 0000000..90c61d0
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageHeaderV2_1.h
@@ -0,0 +1,427 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: MIT
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfImageHeaderV2_1_HEADER
+#define ossimNitfImageHeaderV2_1_HEADER 1
+
+#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
+#include <ossim/support_data/ossimNitfImageBandV2_1.h>
+
+class ossimNitfFileHeaderV2_1;
+class OSSIMDLLEXPORT ossimNitfImageHeaderV2_1 : public ossimNitfImageHeaderV2_X
+{
+public:
+   ossimNitfImageHeaderV2_1();
+   virtual ~ossimNitfImageHeaderV2_1();
+
+   virtual void parseStream(std::istream &in, const ossimNitfFileHeaderV2_1 *file);
+   virtual void parseStream(std::istream &in);
+   virtual void writeStream(std::ostream &out);
+   virtual bool isValid()const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+   
+   virtual ossimIrect  getImageRect()const;   
+   virtual ossimIrect  getBlockImageRect()const;   
+   virtual bool        isCompressed()const;
+   virtual bool        isEncrypted()const;
+
+   virtual ossim_int32 getNumberOfBands()const;
+   virtual ossim_int32 getNumberOfRows()const;
+   virtual ossim_int32 getNumberOfCols()const;
+   virtual ossim_int32 getNumberOfBlocksPerRow()const;
+   virtual ossim_int32 getNumberOfBlocksPerCol()const;
+   virtual ossim_int32 getNumberOfPixelsPerBlockHoriz()const;
+   virtual ossim_int32 getNumberOfPixelsPerBlockVert()const;
+   virtual ossimString getImageId()const;
+   virtual ossim_int32 getBitsPerPixelPerBand()const;
+   virtual ossim_int32 getActualBitsPerPixelPerBand()const;
+   virtual ossimString getIMode()const;
+
+   /** @return The IDATIM field unparsed. */
+   virtual ossimString  getImageDateAndTime() const;
+   
+   virtual ossimString getAcquisitionDateMonthDayYear(ossim_uint8 separationChar='-')const;
+   virtual ossimString getSecurityClassification()const;
+   virtual ossimString getCategory()const;
+   virtual ossimString getRepresentation()const;
+   virtual ossimString getCoordinateSystem()const;
+   virtual ossimString getGeographicLocation()const;
+   virtual ossimString getPixelValueType()const;
+
+  virtual bool takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
+      ossim_uint32 potentialDesIndex, bool userDefinedTags = false);
+
+   virtual bool hasBlockMaskRecords()const;
+   virtual bool hasPadPixelMaskRecords()const;
+   virtual bool hasTransparentCode()const;
+   virtual ossim_uint32 getTransparentCode()const;
+   virtual ossim_uint32 getBlockMaskRecordOffset(ossim_uint32 blockNumber,
+                                                 ossim_uint32 bandNumber)const;
+   virtual ossim_uint32 getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
+                                                    ossim_uint32 bandNumber)const;
+   
+   virtual void setNumberOfBands(ossim_uint32 nbands);
+   virtual void setBandInfo(ossim_uint32 idx,
+                            const ossimNitfImageBandV2_1& info);
+   
+   virtual void setNumberOfRows(ossim_uint32 rows);
+   virtual void setNumberOfCols(ossim_uint32 cols);
+
+   virtual void setGeographicLocationDms(const ossimDpt& ul,
+                                         const ossimDpt& ur,
+                                         const ossimDpt& lr,
+                                         const ossimDpt& ll);
+   
+   virtual void setGeographicLocationDecimalDegrees(const ossimDpt& ul,
+                                                    const ossimDpt& ur,
+                                                    const ossimDpt& lr,
+                                                    const ossimDpt& ll);
+   virtual void setUtmNorth(ossim_uint32 zone,
+                            const ossimDpt& ul,
+                            const ossimDpt& ur,
+                            const ossimDpt& lr,
+                            const ossimDpt& ll);
+   virtual void setUtmSouth(ossim_uint32 zone,
+                            const ossimDpt& ul,
+                            const ossimDpt& ur,
+                            const ossimDpt& lr,
+                            const ossimDpt& ll);
+
+   virtual void setSecurityClassificationSystem(const ossimString& value);
+   virtual void setCodewords(const ossimString& value);
+   virtual void setControlAndHandling(const ossimString& value);
+   virtual void setReleasingInstructions(const ossimString& value);
+   virtual void setDeclassificationType(const ossimString& value);
+   virtual void setDeclassificationDate(const ossimString& value);
+   virtual void setDeclassificationExempt(const ossimString& value);
+   virtual void setDowngrade(const ossimString& value);
+   virtual void setDowngradeDate(const ossimString& value);
+   virtual void setClassificationText(const ossimString& value);
+   virtual void setClassificationAuthorityType(const ossimString& value);
+   virtual void setClassificationAuthority(const ossimString& value);
+   virtual void setClassificationReason(const ossimString& value);
+   virtual void setSecuritySourceDate(const ossimString& value);
+   virtual void setSecurityControlNumber(const ossimString& value);
+   virtual void setImageMagnification(const ossimString& value);
+   
+   virtual ossimString getImageSource()const; 
+   
+   virtual const ossimRefPtr<ossimNitfCompressionHeader> getCompressionHeader()const;
+   virtual const ossimRefPtr<ossimNitfImageBand> getBandInformation(ossim_uint32 idx)const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+
+   /*!
+    * @brief Method to set fields from a keyword list.
+    *
+    * This is not a true loadState as it does not lookup/initialize all class
+    * members.  This was added to allow defaults, e.g ISCLAS, to be set via a
+    * site configuration file.
+    * Code does not return false if a field(key) is not found..
+    *
+    * @return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   static const ossimString ISCLSY_KW;
+   static const ossimString ISCODE_KW;
+   static const ossimString ISCTLH_KW;
+   static const ossimString ISREL_KW;
+   static const ossimString ISDCTP_KW;
+   static const ossimString ISDCDT_KW;
+   static const ossimString ISDCXM_KW;
+   static const ossimString ISDG_KW;
+   static const ossimString ISDGDT_KW;
+   static const ossimString ISCLTX_KW;
+   static const ossimString ISCATP_KW;
+   static const ossimString ISCAUT_KW;
+   static const ossimString ISCRSN_KW;
+   static const ossimString ISSRDT_KW;
+   static const ossimString ISCTLN_KW;
+   static const ossimString XBANDS_KW;
+
+private:
+   void clearFields();
+
+   ossimString encodeUtm(ossim_uint32 zone,
+                         const ossimDpt& ul,
+                         const ossimDpt& ur,
+                         const ossimDpt& lr,
+                         const ossimDpt& ll)const;
+
+   /**
+    * FIELD: ISCLSY
+    * 
+    * Is a required 2 byte field.
+    *
+    * Image Security Classification System.
+    *
+    * This field shall contain valid values indicating the
+    * national or multinational security system used to classify the image.
+    * Country Codes per FIPS 10-4 shall be used to indicate national security
+    * systems; codes found in DIAM 65-19
+    * shall be used to indicate multinational security systems.
+    * If this field is all BCS spaces (0x20), it shall imply that no security
+    * classification system applies to the image. 
+    */
+   char theSecurityClassificationSys[3];
+
+   /**
+    * FIELD: ISCODE
+    * 
+    * is a 11 byte field
+    *
+    * Image Codewords.
+    *
+    * This field shall contain a valid indicator of the security compartments
+    * associated with the image. Values include one or more of the
+    * tri/digraphs found
+    * in DIAM 65-19 and/or Table A-4. Multiple entries shall be separated by
+    * single
+    * BCS spaces (0x20): The selection of a relevant set of codewords is
+    * application
+    * specific.  If this field is all BCS spaces (0x20), it shall imply that no
+    * codewords apply to the image.
+    */
+   char theCodewords[12];
+
+   /**
+    * FIELD: ISCTLH
+    * 
+    * is a 2 byte field.
+    *
+    * Image Control and Handling.  This field shall contain valid additional
+    * security control and/or handling instructions (caveats) associated with
+    * the image.
+    * Values include digraphs found in DIAM 65-19 and/or Table A4.
+    * The digraph may indicate single or multiple caveats. The selection of a
+    * relevant caveat(s) is application specific.  If this field is all BCS
+    * spaces (0x20),
+    * it shall imply that no additional control and handling instructions
+    * apply to the image. 
+    */
+   char theControlAndHandling[3];
+
+   /**
+    * FIELD: ISREL
+    * 
+    * Is a 20 byte field.
+    *
+    * Image Releasing Instructions.  This field shall contain a valid list of
+    * country and/or multilateral entity codes to which countries and/or
+    * multilateral entities the image is authorized for release.  Valid items
+    * in the list are one or
+    * more country codes as found in FIPS 10-4 and/or codes identifying
+    * multilateral
+    * entities as found in DIAM 65-19. If this field is all BCS spaces (0x20),
+    * it shall imply that no image release instructions apply.
+    */
+   char theReleasingInstructions[21];
+
+
+   /**
+    * FIELD: ISDCTP
+    * 
+    * Is a required 2 byte field.  The valid
+    * values are
+    * DD = declassify on a specific date
+    * DE = Declassify upon occurence of an event
+    * GD = downgrade to a specified level upon
+    *      occurence of an event
+    * O  = OADR
+    * X  = exempt from automatic declassification
+    * spaces = no image security declassification or
+    *          downgrade instruction apply.
+    */
+   char theDeclassificationType[3];
+   
+
+   /**
+    * FIELD: ISDCDT
+    * 
+    * Is a required 8 byte field.
+    *  CCYYMMDD
+    *
+    * CC   is the first 2 chars of the year 00-99
+    * YY   is the second 2 chars of the year 00-99
+    * MM   is the month 01-12
+    * DD   is the day 00-31
+    */
+   char theDeclassificationDate[9];
+
+   /**
+    * FIELD: ISDCXM
+    * 
+    * is a required 4 byte field.
+    * 
+    * Image Declassification Exemption.
+    *
+    * This field shall indicate the reason the image is exempt from automatic
+    * declassification if the value in Image Declassification Type is X. Valid
+    * values are X1 through X8 and X251 through X259. X1 through X8 correspond
+    * to the declassification exemptions found in DOD 5200.1-R, paragraphs
+    * 4-202b(1) through (8) for material exempt from the 10-year rule.
+    * X251 through X259 correspond to the declassification exemptions found in
+    * DOD 5200.1-R, paragraphs 4-301a(1) through (9) for permanently valuable
+    * material exempt from the 25-year declassification system. If this field is
+    * all BCS spaces (0x20), it shall imply that a image declassification exemption
+    * does not apply. 
+    */
+   char theDeclassificationExempt[5];
+   
+   /**
+    * FIELD: ISDG
+    * 
+    * Is a required 1 byte field with form:
+    *
+    *
+    * Image Downgrade.  This field shall indicate the classification level
+    * to which a image is to be downgraded if the values in Image Declassification Type
+    * are GD or GE.
+    *
+    * Valid values are
+    *    S (=Secret),
+    *    C (=Confidential),
+    *    R (= Restricted).
+    *
+    * If this field is all BCS spaces (0x20), it shall imply that image security
+    * downgrading does not apply.  
+    */
+   char theDowngrade[2];
+
+   /**
+    * FIELD: ISDGDT
+    * 
+    * is a required 8 byte field
+    *
+    * CCYYMMDD
+    *
+    * CC   is the first 2 chars of the year 00-99
+    * YY   is the second 2 chars of the year 00-99
+    * MM   is the month 01-12
+    * DD   is the day 00-31
+    */
+   char theDowngradeDate[9];
+
+   /**
+    * FIELD: ISCLTX
+    * 
+    * is a required 43 byte field.
+    *
+    * Image Classification Text.
+    *
+    * This field shall be used to provide additional information
+    * about image classification to include identification of a declassification or downgrading
+    * event if the values in Image Declassification Type are DE or GE.. It may also be used
+    * to identify multiple classification sources and/or any other special handling rules.
+    * Values are user defined free text. If this field is all BCS spaces (0x20), it shall
+    * imply that additional information about image classification does not apply. 
+    */
+   char theClassificationText[44];
+
+   /**
+    * FIELD: ISCATP
+    * 
+    * Is a required 1 byte field.
+    *
+    * O  = original classification Authority
+    * D  = derivative from a single source
+    * M  = derivative from multiple sources
+    * 
+    */
+   char theClassificationAuthType[2];
+
+   /**
+    * FIELD: ISCAUT
+    * 
+    * Is a required 40 byte field.
+    *
+    * Image Classification Authority.
+    *
+    * This field shall identify the classification authority for the image dependent upon the
+    * value in Image Classification Authority Type. Values are user defined free text which
+    * should contain the following information: original classification authority name and
+    * position or personal identifier if the value in Image Classification Authority Type is O;
+    * title of the document or security classification guide used to classify the image
+    * if the value in Image Classification Authority Type is D;
+    * and Derive-Multiple if the image classification was derived from multiple sources.
+    * In the latter case, the image originator will maintain a record of the sources used
+    * in accordance with existing security directives. One of the multiple sources may also
+    * be identified in Image Classification Text if desired. If this field is all BCS spaces
+    * (0x20), it shall imply that no image classification authority applies.
+    */
+   char theClassificationAuthority[41];
+
+   /**
+    * FIELD: ISCRSN
+    * 
+    * This is a required 1 byte field and indicates
+    * the classification reason.
+    *
+    * Image Classification Reason.
+    *
+    * This field shall contain values indicating the reason for classifying the image.
+    * Valid values are A through G. These correspond to the reasons for
+    * original classification per E.O. 12958, Section 1.5.(a) through (g).
+    * If this field is all BCS spaces (0x20), it shall imply that no image classification
+    * reason applies. 
+    */
+   char theClassificationReason[2];
+
+   /**
+    * FIELD: ISSRDT
+    * 
+    * This is a required 8 byte field.
+    *
+    * CCYYMMDD
+    *
+    * CC   is the first 2 chars of the year 00-99
+    * YY   is the second 2 chars of the year 00-99
+    * MM   is the month 01-12
+    * DD   is the day 00-31
+    *
+    */
+   char theSecuritySourceDate[9];
+
+   /**
+    * FIELD: ISCTLN
+    * 
+    * is a required 15 byte field.
+    */
+   char theSecurityControlNumber[16];
+
+  
+   /**
+    * FIELD: XBANDS
+    * 
+    * This is a conditional 5 byte field and ranges from
+    * 00010-99999.  This exists if theNumberOfBands is 0.
+    */
+   char theNumberOfMultispectralBands[6];
+
+   std::vector<ossimRefPtr<ossimNitfImageBandV2_1> > theImageBands;
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfImageHeaderV2_X.h b/include/ossim/support_data/ossimNitfImageHeaderV2_X.h
new file mode 100644
index 0000000..80cd92e
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageHeaderV2_X.h
@@ -0,0 +1,948 @@
+#ifndef ossimNitfImageHeaderV2_X_HEADER
+#define ossimNitfImageHeaderV2_X_HEADER 1
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <string>
+
+class OSSIM_DLL ossimNitfImageHeaderV2_X : public ossimNitfImageHeader
+{
+public:
+   ossimNitfImageHeaderV2_X();
+
+   /** @brief Returns the zero based image rectangle. */
+   virtual ossimIrect  getImageRect()const;
+
+   /**
+    * @brief Returns the zero based image rectangle expanded out to block boundaries.
+    * @note  This may or may not be the same as the rect from getImageRect.
+    */
+   virtual ossimIrect  getBlockImageRect()const;
+   
+   void setImageId(const ossimString& value);
+   void setAquisitionDateTime(const ossimString& value);
+   void setTargetId(const ossimString& value);
+   void setTitle(const ossimString& value);
+   void setSecurityClassification(const ossimString& value);
+   void setEncryption(const ossimString& value);
+   void setImageSource(const ossimString& value);
+   void setJustification(const ossimString& value);
+   void setCoordinateSystem(const ossimString& value);
+   void setGeographicLocation(const ossimString& value);
+   void setNumberOfComments(const ossimString& value);
+   void setCompression(const ossimString& value);
+   void setCompressionRateCode(const ossimString& value);
+   void setDisplayLevel(const ossimString& value);
+   void setAttachmentLevel(const ossimString& value);
+   void setPixelType(const ossimString& pixelType = ossimString("INT"));
+   void setBitsPerPixel(ossim_uint32 bitsPerPixel);
+   void setActualBitsPerPixel(ossim_uint32 bitsPerPixel);
+   void setImageMode(char mode);
+   void setCategory(const ossimString& category);
+   void setRepresentation(const ossimString& rep);
+   void setBlocksPerRow(ossim_uint32 blocks);
+   void setBlocksPerCol(ossim_uint32 blocks);
+   void setNumberOfPixelsPerBlockRow(ossim_uint32 pixels);
+   void setNumberOfPixelsPerBlockCol(ossim_uint32 pixels);
+
+   ossim_uint64 getDataLocation()const;
+   ossimString getImageId()const;
+   ossimString getAquisitionDateTime()const;
+   ossimString getTargetId()const;
+   ossimString getTitle()const;
+   ossimString getSecurityClassification()const;
+   ossimString getEncryption()const;
+   ossimString getImageSource()const;
+   ossimString getJustification()const;
+   ossimString getCoordinateSystem()const;
+   ossimString getGeographicLocation()const;
+
+   
+   ossimString getNumberOfComments()const;
+   ossimString getCompressionCode()const;
+   ossimString getCompressionRateCode()const;
+   ossim_uint32 getDisplayLevel()const;
+   ossim_uint32 getAttachmentLevel()const;
+   ossimString getPixelType()const;
+   ossim_uint32 getBitsPerPixel()const;
+   ossim_uint32 getActualBitsPerPixel()const;
+   char getImageMode()const;
+   ossimString getCategory()const;
+   ossimString getRepresentation()const;
+   ossim_uint32 getBlocksPerRow()const;
+   ossim_uint32 getBlocksPerCol()const;
+   ossim_uint32 getNumberOfPixelsPerBlockRow()const;
+   ossim_uint32 getNumberOfPixelsPerBlockCol()const;
+   virtual bool isValid()const;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief Gets the IMAG field as a string.  Satisfies pure virtual.
+    * @return IMAG field
+    */
+   virtual ossimString  getImageMagnification()const;
+
+   /**
+    * @brief Gets the ILOC field as an ossimIpt. Satisfies pure virtual.
+    * @param loc Initialized with the field.
+    * @note: Do not confuse with "data location".
+    */
+   virtual void getImageLocation(ossimIpt& loc)const;
+   
+   virtual void setGeographicLocationDms(const ossimDpt& ul,
+                                         const ossimDpt& ur,
+                                         const ossimDpt& lr,
+                                         const ossimDpt& ll);
+   
+   virtual void setGeographicLocationDecimalDegrees(const ossimDpt& ul,
+                                                    const ossimDpt& ur,
+                                                    const ossimDpt& lr,
+                                                    const ossimDpt& ll);
+   virtual void setUtmNorth(ossim_uint32 zone,
+                            const ossimDpt& ul,
+                            const ossimDpt& ur,
+                            const ossimDpt& lr,
+                            const ossimDpt& ll);
+   
+   virtual void setUtmSouth(ossim_uint32 zone,
+                            const ossimDpt& ul,
+                            const ossimDpt& ur,
+                            const ossimDpt& lr,
+                            const ossimDpt& ll);
+  
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+
+   /*!
+    * @brief Method to set fields from a keyword list.
+    *
+    * This is not a true loadState as it does not lookup/initialize all class
+    * members.  This was added to allow defaults, e.g ISCLAS, to be set via a
+    * site configuration file.
+    * Code does not return false if a field(key) is not found..
+    *
+    * @return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+
+   static const ossimString IM_KW;
+   static const ossimString IID1_KW;
+   static const ossimString IDATIM_KW;
+   static const ossimString TGTID_KW;
+   static const ossimString IID2_KW;
+   static const ossimString ITITLE_KW; // also IID2 in 2.1 spec and ITITLE in 2.0 spec
+   static const ossimString ISCLAS_KW;
+   static const ossimString ENCRYP_KW;
+   static const ossimString ISORCE_KW;
+   static const ossimString NROWS_KW;
+   static const ossimString NCOLS_KW;
+   static const ossimString PVTYPE_KW;
+   static const ossimString IREP_KW;
+   static const ossimString ICAT_KW;
+   static const ossimString ABPP_KW;
+   static const ossimString PJUST_KW;
+   static const ossimString ICORDS_KW;
+   static const ossimString IGEOLO_KW;
+   static const ossimString NICOM_KW;
+   static const ossimString ICOM_KW;
+   static const ossimString IC_KW;
+   static const ossimString COMRAT_KW;
+   static const ossimString NBANDS_KW;
+   static const ossimString ISYNC_KW;
+   static const ossimString IMODE_KW;
+   static const ossimString NBPR_KW;
+   static const ossimString NBPC_KW;
+   static const ossimString NPPBH_KW;
+   static const ossimString NPPBV_KW;
+   static const ossimString NBPP_KW;
+   static const ossimString IDLVL_KW;
+   static const ossimString IALVL_KW;
+   static const ossimString ILOC_KW;
+   static const ossimString IMAG_KW;
+   static const ossimString UDIDL_KW;
+   static const ossimString UDOFL_KW;
+   static const ossimString IXSHDL_KW;
+   static const ossimString IXSOFL_KW;
+   static const ossimString IMDATOFF_KW;
+   static const ossimString BMRLNTH_KW;
+   
+protected:
+   /*!
+    * FIELD IM:
+    * Is a required 2 byte value and is IM.
+    */
+   char theType[3];
+
+   /**
+    * FIELD: IID1
+    * Is a required 10 Alphanumeric value.
+    */
+   char theImageId[11];
+
+   /*!
+    * FIELD IDATIM:
+    * Contains the time of acquisition of the image.
+    * this is a 14 byte field and has the format:
+    *
+    * DDHHMMSSZMONYY
+    *
+    * DD   is the day of the month
+    * HH   is the Hour
+    * MM   is the minutes
+    * SS   is the seconds
+    * Z    is fixed (Zulu time)
+    * MON  is the first 3 chars of the month
+    * YY   is the year
+    */
+   char theDateTime[15];
+
+   /**
+    * FIELD: TGTID
+    * 
+    * is a 17 byte field.  Has the form
+    *
+    * BBBBBBBBBBFFFFFCC
+    *
+    * where:
+    *
+    * B     is the encyclopedia id
+    * F     is the functional category code
+    * C     is the country code.
+    */
+   char theTargetId[18];
+
+   /**
+    * FIELD: IID2
+    * 
+    * Is 80 bytes and contains the title
+    */
+   char theTitle[81];
+
+   /**
+    * FIELD: ISCLAS
+    * 
+    * Is a required 1 byte field and has value:
+    *
+    * T    = Top secret
+    * S    = Secrect
+    * C    = confidential
+    * R    = Restricted
+    * U    = Unclassified
+    */
+   char theSecurityClassification[2];
+
+   /*!
+    * FIELD ENCRYP:
+    * Is arequired 1 byte field.
+    *
+    * 0  = no encryption
+    * 1  = encryption
+    */
+   char theEncryption[2];
+
+   /**
+    * FIELD: ISORCE
+    * 
+    * Is a 42 byte optional field.
+    */
+   char theImageSource[43];
+
+   /**
+    * FIELD: NROWS
+    * 
+    * Required 8 byte number 00000002-99999999
+    */
+   char theSignificantRows[9];
+
+   /**
+    * FIELD: NCOLS
+    * 
+    * Required 8 byte number 00000002-99999999
+    */
+   char theSignificantCols[9];
+
+   /**
+    * FIELD: PVTYPE
+    * 
+    * Required 3 byte value.
+    * Values:
+    *
+    * INT   integer 16 bits
+    * B     for bi-level represented as single bits 1 or 0
+    * SI    signend 16 bit integer
+    * R     32 bit float
+    * C     for complex (32 bit float real part, 32 bit float imag part)
+    *       Adjacent 4 byte blocks
+    * U     for user defined.
+    */
+   char thePixelValueType[4];
+
+   /**
+    * FIELD: IREP
+    * 
+    * This is required 8 byte field.
+    *
+    * Values:
+    *
+    * MONO    indicates monnochrome
+    * RGB     indicates true color red green blue
+    * RGB/LUT indicates RGB lookup table.
+    * 1D      indicates monoband data.
+    * 2D      indicates for 2 dimensional data
+    * NM      indicates multidimensional data
+    * MULTI   indicates multiband imgery
+    * YCbCr601 indicates compressed in CCIR 601
+    *          color space using JPEG (field IC=C3)
+    */
+   char theRepresentation[9];
+
+   /**
+    * FIELD: ABPP
+    * 
+    * Is optional and indicates the number of
+    * bits per band 01-96
+    */
+   char theActualBitsPerPixelPerBand[3];
+
+   /**
+    * FIELD: ICAT
+    *
+    * This is a required 8 byte field.  Contains info
+    * about the specific category of the image.
+    *
+    * VIS    visible imagery
+    * SL     side looking infrared
+    * TI     thermal infrared
+    * FL     forward looking infrared
+    * RD     radar
+    * EO     elctro-optical
+    * OP     optical
+    * HR     high resolution radar
+    * HS     hyperspectral
+    * CP     color frame photography
+    * BP     black/white frame photography
+    * SAR    Synthetic Aperture Radar
+    * SARIQ  SAR radio hologram
+    * IR     infrared.
+    * MS     multispectral
+    * FP     fingerprints
+    * MRI    Magnetic Resonance imagery
+    * XRAY   x-rays
+    * CAT    cat scans
+    * MAP    maps
+    * PAT    patch
+    * LEG    legends
+    * DTEM   elevation models
+    * MATR   matrix data
+    * LOCG   location grids
+    * VD     video
+    * 
+    *
+    * default value is VIS
+    */
+   char theCategory[9];
+
+   /**
+    * FIELD: PJUST
+    * 
+    * Is 1 byte optional field.  Can have
+    * values L (left) or R (right).  Any other value
+    * is to interpreted as right justified.
+    *
+    * This indicates how the significant bits are justified
+    * in the field
+    */
+   char theJustification[2];
+
+   /**
+    * FIELD: ICORDS
+    * 
+    * Is a 1 byte required field and can have
+    * values 
+    *
+    * U indicates UTM MGRS format
+    * G indicates Geodetic (Geographic)
+    * N indicates UTM Northern hemisphere
+    * S indicates UTM SOuthern hemisphere
+    * D Decimal degrees
+    *
+    * spaces means no coordinate system
+    *
+    * Geodetic reference system is WGS84.
+    */
+   char theCoordinateSystem[2];
+
+   /*!
+    * FIELD NICOM:
+    * this is a required 1 byte field and indicates the number of comments.
+    */
+   char theNumberOfComments[2];
+
+   /*!
+   * FIELD ICOMnn:
+   * Dynamic buffer for the comments.  Each comment is 80 bytes
+   */
+   std::vector<ossimString> theImageComments;
+
+   /**
+    * FIELD: IGEOLO
+    * 
+    * This is a conditional field.  If theCoordinateSystem
+    * is blank then it does not exist.  If it's any other
+    * value then it's given in image coordinate order
+    *
+    * (0, 0) (0, MaxCol) (MaxRow, MaxCol) (MaxRow, 0)
+    *
+    * if its geodetic or geocentric it will have a lat lon coordinate
+    * with each coordinate as:
+    * Lat = ddmmssX
+    *       where d is degrees and m is minutes
+    *       and s is seconds and X is either N (North) or S (South).
+    * Lon = dddmmssX
+    *       where d is degrees and m is minutes
+    *       and s is seconds and X is either N (North) or S (South).
+    *
+    *       
+    * if its UTM then zzeeeeeennnnnnn where
+    *
+    * z is the zone number
+    * e is the easting
+    * n is the northing
+    *
+    * if its decimal degrees then +-dd.ddd +-dd.ddd four times where
+    * + is northern hemispher and - is souther hemisphere for lat
+    * and longitude + is easting and - is westing.
+    *
+    */
+   char theGeographicLocation[61];
+
+   /**
+    * FIELD: IC
+    * 
+    * This is a required 2 byte field and indicates the compression
+    * type of the image.
+    *
+    * NC  indicates not compressed
+    * C1  indicates bi-level
+    * C2  indicates ARIDPCM
+    * C3  inidates JPEG
+    * C4  inidcates Vector Quantization
+    * C5  indicates lossless jpeg
+    * I1  indicates a downsampled jpeg
+    * M0  indicates compressed images
+    * M3  indicates compressed images
+    * M4  indicates compressed images
+    * M5  indicates compression
+    * NM  indicates uncompressed
+    *
+    * The M's and NM are blocked images that contain
+    * block mask and/or transparent pixel mask.  There
+    * will be an Image Data Mask Subheader ath the beginning
+    * of the image data area.
+    *
+    */
+   char theCompression[3];
+
+   /**
+    * FIELD COMRAT
+    * 
+    * This is a conditional 4 byte  field.  if theCompression is
+    * not equal to NC then this field exists.
+    *
+    * Compression Rate Code.
+    *
+    * If the Image Compression (IC) field contains, C1, C4, M1, or M4,
+    * this field shall be present and contain a code indicating the
+    * compression rate for the image.
+    * If the value in IC is C1 or M1, the valid codes are 1D, 2DS, and 2DH,
+    * where: 1D represents One-dimensional Coding
+    *        2DS represents Two-dimensional Coding Standard Vertical
+    *        Resolution (K=2)
+    *        2DH represents Two-dimensional Coding High Vertical Resolution
+    *        (K=4)
+    *        
+    * A BCS zero (0x30) will be used for the Y value when custom Q-Tables are
+    * used.
+    * Explanation of these codes can be found in ITU-T T-4, AMD2 08/95.
+    *
+    * If the value in IC is C3, C5, I1, or M5, the value of this field shall
+    * be 00.0.
+    * The value 00.0 represents embedded tables and is required by JPEG.
+    * Explanation of embedded tables can be found in MIL-STD-188-198A and
+    * NIMA N0105-97.
+    * If the value in IC is C4 or M4, this field shall contain a value given
+    * in the
+    * form nn.n representing the number of bits-per-pixel for the compressed
+    * image.
+    * Explanation of the compression rate for vector quantization can be
+    * found in MIL-STD-188-199.
+    * This field is omitted if the value in IC is NC or NM. If IC = I1, value
+    * = 00.0.
+    * 4 BCS-A See description for constraints C 
+    */
+   char theCompressionRateCode[5];
+
+   /**
+    * FIELD: NBANDS
+    * 
+    * Is required 1 byte field  and will have value 1-9
+    *
+    * If theRepresentation is MONO this should be 1
+    * if theRepresentation is RGB  this should be 3
+    * if theRepresentation is RGB/LUT this should be 1
+    * if theRepresentation YCbCr601 this should be 3
+    * if theRepresentation is MULTI this should be 2-9
+    *
+    * if this field is 0 then it's multi spectral data
+    * larger than 9
+    */
+   char theNumberOfBands[2];
+
+   /**
+    * FIELD: ISYNC
+    * 
+    * Required 1 byte field.  Has value 0 or 4
+    */
+   char theImageSyncCode[2];
+
+   /**
+    * FIELD: IMODE
+    *
+    * Required 1 byte field.
+    *
+    *
+    * Image Mode.  This field shall contain an indicator of whether the image
+    * bands are stored in the
+    * file sequentially or band interleaved by block or band interleaved by
+    * pixel format or
+    * band interleaved by row.
+    *
+    * Valid values are B, P, R, and S.  The significance of the IMODE value
+    * must be interpreted
+    * with the knowledge of whether the image is:
+    *     JPEG compressed (IC=C3, C5, M3, or M5),
+    *     VQ compressed (IC=C4, or M4),
+    *     or uncompressed (IC=NC or NM).
+    * When IC=C1 or M1, the use of IMODE defaults to B.  When IC=I1, IMODE is
+    * B.
+    *
+    * For the uncompressed case:  The value R represents band interleaved by
+    * row,
+    * where the ordering mechanism stores the pixel values of each band in
+    * row sequential order.
+    * Within each block, all pixel values of the first row of the first band
+    * are followed by
+    * pixel values of the first row of the second band continuing until all
+    * values of the
+    * first row are stored.  The remaining rows are stored in a similar
+    * fashion until the last
+    * row of values has been stored.  Each block shall be zero filled to the
+    * next octet boundary
+    * when necessary.  The value S represents band sequential, where all
+    * blocks for the first band
+    * are followed by all blocks for the second band, and so on:
+    * [(block1, band1), (block2, band1), ... (blockM, band1)],
+    * [(block1, band2), (block2, band 2), ... (blockM, band2)] ...
+    * [(block1, bandN), (block2, bandN), ... (blockM, bandN)].
+    *
+    * The values B and P indicate variations on block sequential where all
+    * data from all bands
+    * for the first block is followed by all data from all bands for the
+    * second block, and so on.
+    * The variations are based on the way the bands are organized within each
+    * block.
+    * B represents band interleaved by block.
+    *
+    * This means that within each block, the bands follow one 1 BCS-A B, P,
+    * R, S R
+    *
+    *
+    * another:  [(block1, band1), (block1, band2), ...
+    *           (block1, bandN)],
+    *           [(block2, band1),
+    *           (block2, band2), ...
+    *           (block2, bandN)], ...
+    *           [(blockM, band1),
+    *           (blockM, band2), ...
+    *           (blockM, bandN)].
+    *
+    * P represents band interleaved by pixel within each block:  such as, for
+    * each block,
+    * one after the other, the full pixel vector (all band values) appears
+    * for every pixel in
+    * the block, one pixel after another, the block column index varying
+    * faster than the block
+    * row index.  If the NBANDS field is 1, the cases B and S coincide.
+    * In this case, this field shall contain B.  If the Number of Blocks is
+    * 1(NBPR = NBPC = 1),
+    * this field shall contain B for non-interleaved by pixel, and P for
+    * interleaved by pixel.
+    * The value S is only valid for images with multiple blocks and multiple
+    * bands.
+    * For the JPEG-compressed case:  The presence of B, P, or S implies
+    * specific ordering of
+    * data within the JPEG image data representation.  The interpretation of
+    * the values of IMODE
+    * for this case is specified in MIL-STD188-198A.
+    *
+    * For the Vector Quantization compressed case:  VQ compressed images are
+    * normally either RGB with a
+    * color look-up table or monochromatic.  In either case, the image is
+    * single band, and the IMODE
+    * field defaults to B.  However, it is possible to have a multiband VQ
+    * compressed image in band sequential,
+    * band interleaved by block, or band interleaved by pixel format.
+    * 
+    */
+   char theImageMode[2];
+
+   /**
+    * FIELD: NBPR
+    * 
+    * Required 4 byte value.  ranges from
+    * 0001-9999
+    */
+   char theNumberOfBlocksPerRow[5];
+   
+   /**
+    * FIELD: NBPC
+    * 
+    * Required 4 byte value. Ranges from
+    * 0001-9999
+    */
+   char theNumberOfBlocksPerCol[5];
+
+   /**
+    * FIELD: NPPBH
+    * 
+    * Reuqired 4 byte field
+    */
+   char theNumberOfPixelsPerBlockHoriz[5];
+
+   /**
+    * FIELD: NPPBV
+    * 
+    * Reuqired 4 byte field
+    */
+   char theNumberOfPixelsPerBlockVert[5];
+
+   /**
+    * FIELD: NBPP
+    * 
+    * Required 2 byte field.
+    *
+    * Number of Bits Per Pixel Per Band.  If IC contains NC, NM, C4, or M4,
+    * this field shall contain the number of storage bits used for the value
+    * from each component of a pixel vector.  The value in this field always
+    * shall be greater than or equal to Actual Bits Per Pixel (ABPP).
+    * For example, if 11-bit pixels are stored in 16 bits,
+    * this field shall contain 16 and Actual Bits Per Pixel shall contain 11.
+    * If IC = C3, M3, C5, M5, or I1 this field shall contain the value 8 or
+    * the value 12.
+    * If IC = C1, this field shall contain the value 1. 2 BCS-N 01-96 R 
+    */
+   char theNumberOfBitsPerPixelPerBand[3];
+
+   /**
+    * FIELD: IDLVL
+    *
+    * Display Level.
+    * 
+    * Required 3 byte field.  Ranges from 001-999
+    *
+    * This field shall contain a valid value that indicates the graphic display
+    * level of the image relative to other displayed file components in a
+    * composite
+    * display.  The display level of each displayable file component (image
+    * or graphic)
+    * within a file shall be unique; that is, each number from 001 to 999 is
+    * the display
+    * level of, at most, one item.  The meaning of display level is fully
+    * discussed in
+    * paragraph 5.3.3.  The image or graphic component in the file having the
+    * minimum
+    * display level shall have attachment level 0.
+    * 
+    */
+   char theDisplayLevel[4];
+
+   /**
+    * FIELD: IALVL
+    *
+    * Attachment Level
+    * 
+    * Required 3 byte field.  Ranges from 000-998
+    *
+    * This field shall contain a valid value that indicates the attachment
+    * level of the image.
+    * Valid values for this field are 0, and the display level value of any
+    * other image or
+    * graphic in the file.  The meaning of attachment level is fully discussed
+    * in
+    * paragraph 5.3.4. The image, graphic, or text component in the file
+    * having the
+    * minimum display level shall have attachment level 0.
+    * 
+    */
+   char theAttachmentLevel[4];
+
+   /**
+    * FIELD: ILOC
+    * 
+    * Required 10 byte field.
+    *
+    * Image Location.  The image location is the location of the first pixel
+    * of the first line of
+    * the image.  This field shall contain the image location represented as
+    * rrrrrccccc, where rrrrr and ccccc are the row and column offset from the
+    * ILOC or SLOC value of the item to which the image is attached.  A row or
+    * column
+    * value of 00000 indicates no offset.  Positive row and column values
+    * indicate offsets down
+    * and to the right and range from 00001 to 99999, while negative row and
+    * column
+    * values indicate offsets up and to the left and must be within the range
+    * -0001 to -9999.
+    * The location in the common coordinate system of all displayable graphic
+    * components can be computed from the offsets given in the ILOC and SLOC
+    * fields. 10 BCS-N -9999
+    * 
+    */
+   char theImageLocation[11];
+
+   /**
+    * FIELD: IMAG
+    * 
+    * Required 4 byte field
+    *
+    * Image Magnification.
+    *
+    * This field shall contain the magnification (or reduction) factor of the
+    * image
+    * relative to the original source image.  Decimal values are used to
+    * indicate magnification,
+    * and decimal fraction values indicate reduction.
+    * For example, 2.30 indicates the original image has been magnified by a
+    * factor of
+    * �2.30,� while �0.5� indicates the original image has been reduced by a
+    * factor of 2.
+    * The default value is 1.0, indicating no magnification or reduction.
+    * In addition, the following values shall be used for reductions that are
+    * reciprocals of
+    * nonnegative powers of 2: /2 (for 1/2), /4 (for 1/4), /8 (for 1/8), /16
+    * (for 1/16), /32 (for 1/32),
+    * /64 (for 1/64), /128 (for 1/128). 4 BCS-A /2, /4, /8, /16, /32, /64,
+    * /128 or
+    * decimal value (Default is 1.0 followed by BCS space (0x20)) R
+    * 
+    */
+   char theImageMagnification[5];
+
+   /**
+    * FIELD: UDIDL
+    * 
+    * Required 5 byte field. 00000 or 00003-99999
+    *
+    * User Defined Image Data Length.  A value of 0 shall represent that no
+    * tagged record extensions
+    * are included in the UDID field.  If a tagged record extension exists,
+    * the field shall contain
+    * the sum of the length of all the tagged record extensions (see
+    * paragraph 5.7.l.l) appearing in
+    * the UDID field plus 3 bytes (length of UDOFL field).  If a tagged
+    * record extension is too long
+    * to fit in the UDID field, it may be put in a data extension segment
+    * (see paragraph 5.8.1.3.1.)
+    *
+    */
+   char theUserDefinedImageDataLength[6];
+
+   /**
+    * FIELD: UDOFL
+    * 
+    * conditional 3 byte field. if theUserDefinedImageDataLength
+    * is not 0
+    *
+    * User Defined Overflow.  If present, this field shall contain 000 if the
+    * tagged record extensions
+    * in UDID do not overflow into a DES, or shall contain the sequence number
+    * of the DES into which
+    * they do overflow.  This field shall be omitted if the field UDIDL
+    * contains BCS zeros (0x30).
+    *
+    * 
+    */
+   char theUserDefinedOverflow[4];
+
+   /**
+    * FIELD: IXSHDL
+    * 
+    * Is a required 5 byte field. 00000 or 00003-99999
+    *
+    * Extended Subheader Data Length.  This field shall contain the length in
+    * bytes in
+    * IXSHD plus 3 (length of IXSOFL).  The length is 3 plus sum of the
+    * lengths of all the
+    * tagged record extensions (see paragraph 5.7.1.2) appearing in the IXSHD
+    * field.  A value of
+    * BCS zeros (0x30) shall represent that no tagged record extensions are
+    * included in the IXSHD field.
+    * If a tagged record extension exists, the field shall contain the sum of
+    * the length of all the tagged
+    * record extensions (see paragraph 5.7.1.2) appearing in the IXSHD field
+    * plus 3 bytes (length of
+    * IXSOFL field).  If a tagged record extension is too long to fit in the
+    * IXSHD field, it shall may
+    * be put in a data extension segment (see paragraph 5.7.1.4). 
+    */
+   char theExtendedSubheaderDataLen[6];
+
+   /**
+    * FIELD: IXSOFL
+    * 
+    * Is a conditional 3 byte field.  This depends on
+    * theExtendedSubheaderDataLen not being 0.
+    *
+    * Extended Subheader Data.  If present, this field shall contain tagged
+    * record
+    * extensions (see paragraph 5.8.1.2) approved and under configuration
+    * management by the ISMC.
+    * The length of this field shall be the length specified by the field
+    * IXSHDL minus 3.  Tagged
+    * record extensions in this field for an image shall contain information
+    * pertaining specifically
+    * to the image.  Tagged record extensions shall appear one after the other
+    * in this field with no
+    * intervening bytes.  The first byte of this field shall be the first byte
+    * of the  first tagged record
+    * extension appearing in the field.  The last byte of this field shall be
+    * the last byte of the last
+    * tagged record extension to appear in the field.  This field shall be
+    * omitted if the field IXSHDL
+    * contains 0.
+    */
+   char theExtendedSubheaderOverflow[4];
+
+   /**************************************************************************
+    *                    THIS IS THE MASK TABLE IF PRESENT
+    */
+   
+   /**
+    * FIELD NAME: IMDATOFF
+    * 
+    * Blocked Image Data Offset.
+    * 
+    * 4 byte Binary integer: 0x00000000 to 0xFFFFFFFF
+    * 
+    * This field is included if the IC value equals NM, M1, M3, M4, or M5.
+    * It identifies the offset from the beginning of the Image Data Mask to
+    * the first byte of the blocked image data.
+    * This offset, when used in combination with the offsets provided in the
+    * BMR fields,
+    * can provide random access to any recorded image block in any image band.
+    * 
+    */
+   ossim_uint32 theBlockedImageDataOffset;
+
+   /**
+    * FIELD NAME: BMRLNTH
+    *
+    * Block Mask Record Length.
+    *
+    * 2 byte Unsigned binary integer
+    * 0x0000=No Block mask record; 0x0004=Block mask
+    * records (4 bytes each) are present  
+    * 
+    * This field is included if the IC value equals NM, M1, M3, M4, or M5.
+    * It identifies the length of each Block Mask Record in bytes.
+    * When present, the length of each Block Mask Record is 4 bytes.
+    * The total length of all the block Mask Records is equal to
+    *
+    * For S mode BMRLNTH x NBPR x NBPC x NBANDS  (one 4 byte record for each
+    * block of each band in the image).
+    * and for all other modes BMRLNTH x NBPR x NBPC
+    * 
+    * If all of the image blocks are recorded,
+    * this value may be set to 0, and the conditional BMR fields are not
+    * recorded/transmitted.
+    * Otherwise, the value may be set to 4, and the conditional BMR fields
+    * are
+    * recorded/transmitted and can be used as an off-set index for each
+    * image block in each band of the image.
+    * If this field is present, but coded as 0, then only a pad pixel mask is
+    * included.
+    */
+   ossim_uint16 theBlockMaskRecordLength;
+
+   /**
+    * FIELD: TMRLNTH
+    *
+    * Pad Pixel Mask Record Length.
+    *
+    * 2 byte Unsigned binary integer a value of
+    * 0x0000=No Pad pixel mask records and 
+    * 0x0004=Pad pixel mask records (4 bytes each) are present
+    * 
+    * This field is included if the IC value equals NM, M1, M3, M4, or M5 
+    * It identifies the length of each Pad Pixel Mask Record in bytes.
+    * When present, the length of each Pad Pixel Mask Record is 4 bytes.
+    * The total length of the Pad Pixel Mask Records is equal to
+    * 
+    * For image mode S then TMRLNTH x NBPR x NBPC x NBANDS (one 4 byte record
+    * for each block for each band in the image).
+    * else for all other modes TMRLNTH x NBPR x NBPC
+    * 
+    * If none of the image blocks contain pad pixels, this value is set to 0,
+    * and the conditional TMR fields are not recorded/transmitted.
+    * For IC value of M3, the value shall be set to 0.
+    * If this field is present, but coded as 0, then a Block Mask is included.
+    */
+   ossim_uint16 thePadPixelMaskRecordLength;
+   
+   /**
+    *  FIELD: TPXCDLNTH
+    *
+    *  Transparent Output Pixel Code Length.
+    *
+    *  2 byte Unsigned binary integer;
+    *  0x0000=No pad pixels; 0x0001 to 0x0010=pad pixel code length in bits
+    *  
+    *  This field is included if the IC value equals NM, M1, M3, M4, M5.
+    *  It identifies the length in bits of the Transparent Output Pixel Code.
+    *  If coded as 0, then no transparent pixels are present,
+    *  and the TPXCD field is not recorded.  For IC value of M3, the
+    *  value shall be set to 0..
+    *  
+    */
+   ossim_uint16 theTransparentOutputPixelCodeLength;
+
+   /**
+    * FIELD: TPXCD
+    *
+    * Pad Output Pixel Code.
+    *
+    * This field is included if the IC value equals NM, M1, M3, M4, M5, M0 and
+    * TPXCDLNTH is not 0.  It contains the output pixel code that represents a
+    * pad pixel in the image.  This value is unique within the image, and
+    * allows the user to identify pad pixels.  The pad output pixel code
+    * length is determined by TPXCDLNTH, but the value is stored in a maximum
+    * of 2 bytes.  If the number of bits used by TPXCD is less than the number
+    * of bits available for storage,
+    * the value shall be justified in accordance with the PJUST field in the
+    * image subheader. �
+    * 3A Binary integer; 0 to 2^n -1 where n=TPXCDLNTH
+    */
+   ossim_uint16 thePadOutputPixelCode;
+
+   std::vector<ossim_uint32> theBlockMaskRecords;
+   std::vector<ossim_uint32> thePadPixelMaskRecords;
+   ossimRefPtr<ossimNitfCompressionHeader> theCompressionHeader;
+   ossim_uint64 theDataLocation;
+
+TYPE_DATA
+   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfImageLut.h b/include/ossim/support_data/ossimNitfImageLut.h
new file mode 100644
index 0000000..aa0d3b8
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfImageLut.h
@@ -0,0 +1,35 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfImageLut_HEADER
+#define ossimNitfImageLut_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimObject.h>
+
+class ossimNitfImageLut : public ossimObject
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimNitfImageLut &data);
+   ossimNitfImageLut();
+   virtual ~ossimNitfImageLut();
+   virtual void parseStream(ossim::istream& in)=0;
+   virtual std::ostream& print(std::ostream& out)const=0;
+   virtual ossim_uint32 getNumberOfEntries()const=0;
+   virtual void setNumberOfEntries(ossim_uint32 numberOfEntries)=0;
+   virtual ossim_uint8 getValue(ossim_uint32 idx)const=0;
+
+TYPE_DATA;
+};
+#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfImageLutV2_0.h b/include/ossim/support_data/ossimNitfImageLutV2_0.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfImageLutV2_0.h
rename to include/ossim/support_data/ossimNitfImageLutV2_0.h
diff --git a/ossim/include/ossim/support_data/ossimNitfImageLutV2_1.h b/include/ossim/support_data/ossimNitfImageLutV2_1.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfImageLutV2_1.h
rename to include/ossim/support_data/ossimNitfImageLutV2_1.h
diff --git a/include/ossim/support_data/ossimNitfInfo.h b/include/ossim/support_data/ossimNitfInfo.h
new file mode 100644
index 0000000..a943f41
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfInfo.h
@@ -0,0 +1,69 @@
+//---
+//
+// License: MIT
+// 
+// Description: NITF Info object.
+// 
+//---
+// $Id$
+
+#ifndef ossimNitfInfo_HEADER
+#define ossimNitfInfo_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <iosfwd>
+
+/**
+ * @brief NITF info class.
+ *
+ * Encapsulates the dumpnitf functionality.
+ */
+class OSSIM_DLL ossimNitfInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimNitfInfo();
+
+   /** virtual destructor */
+   virtual ~ossimNitfInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+   virtual bool open(std::shared_ptr<ossim::istream>& str,
+                     const std::string& connectionString);
+   
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief Method to dump info to a keyword list.
+    * @param kwl The keyword list to initialize.
+    * @param entryIndex Entry to print.  Not supported by all info objects
+    * yet.
+    * @return true on success, false on error.
+    */
+   virtual bool getKeywordlist( ossimKeywordlist& kwl,
+                                ossim_uint32 entryIndex )const;
+   
+private:
+  std::shared_ptr<ossimNitfFile> m_nitfFile;
+};
+
+#endif /* End of "#ifndef ossimNitfInfo_HEADER" */
diff --git a/include/ossim/support_data/ossimNitfJ2klraTag.h b/include/ossim/support_data/ossimNitfJ2klraTag.h
new file mode 100644
index 0000000..5902809
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfJ2klraTag.h
@@ -0,0 +1,296 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimNitfJ2klraTag.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: NITF J2KLRA tag.
+//
+// See:  ISO/IEC BIIF Profile BPJ2K01.00 Table 9-3.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#ifndef ossimNitfJ2klraTag_HEADER
+#define ossimNitfJ2klraTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/base/ossimConstants.h>
+
+#include <iosfwd>
+#include <vector>
+
+class OSSIM_DLL ossimNitfJ2klraTag : public ossimNitfRegisteredTag
+{
+public:
+   enum 
+   {
+      ORIG_SIZE      = 1,
+      NLEVELS_O_SIZE = 2,
+      NBANDS_O_SIZE  = 5,
+      NLAYERS_O_SIZE = 3,
+      
+      LAYER_ID_SIZE  = 3, // repeating
+      BITRATE_SIZE   = 9, // repeating
+
+      NLEVELS_I_SIZE = 2, // conditional
+      NBANDS_I_SIZE  = 5, // conditional
+      NLAYERS_I_SIZE = 3  // conditional
+   };
+   
+   /** default constructor */
+   ossimNitfJ2klraTag();
+  
+   /**
+    * Parse method.
+    *
+    * @param in Stream to parse.
+    */
+   virtual void parseStream(std::istream& in);
+   
+   /**
+    * Write method.
+    *
+    * @param out Stream to write to.
+    */
+   virtual void writeStream(std::ostream& out);
+   
+   /** @return The size of this record in bytes (123) within a nitf file. */
+   virtual ossim_uint32 getSizeInBytes()const;
+   
+   /**
+    * Clears all string fields within the record to some default nothingness.
+    */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out, const std::string& prefix) const;
+
+   /** @return ORIG field as a number. */
+   ossim_uint32 getOriginNumber() const;
+
+   /** @return NLAYERS_O field as a number. */
+   ossim_uint32 getNumberOfLayersOriginal() const;
+
+   /**
+    * @brief Sets origin:
+    *
+    * Range is 0 to 9
+    *
+    * 0 - Original NPJE
+    * 1 – Parsed NPJE
+    * 2 – Original EPJE
+    * 3 – Parsed EPJE*
+    * 4 - Original TPJE
+    * 5 - Parsed TPJE
+    * 6 - Original LPJE
+    * 7 - Parsed LPJE
+    * 8 – Original other
+    * 9 – Parsed other
+    *
+    * @param origin 0 to 9
+    * @return true on success, false if out of range.
+    */
+   bool setOrigin( ossim_uint32 origin );
+
+   /**
+    * @brief Sets the number of wavelet levels in the original image.
+    *
+    * Range: 00 to 32
+
+    * @param levels
+    * @return true on success, false if out of range.
+    */
+   bool setLevelsO( ossim_uint32 levels );
+
+   /**
+    * @brief Sets the number of bands in the original image.
+    *
+    * Range: 00001 to 16384
+    *
+    * @param levels
+    * @return true on success, false if out of range.
+    */   
+   bool setBandsO( ossim_uint32 bands );
+
+  /**
+    * @brief Sets the number of layers in the original image.
+    *
+    * Range: 001 to 999
+    *
+    * @param levels
+    * @return true on success, false if out of range.
+    */   
+   bool setLayersO( ossim_uint32 layers );
+   
+   /**
+    * @brief Sets the number of wavelet levels in this image.
+    *
+    * Range: 00 to 32
+
+    * @param levels
+    * @return true on success, false if out of range.
+    */
+   bool setLevelsI( ossim_uint32 levels );
+
+   /**
+    * @brief Sets the number of bands in this image.
+    *
+    * Range: 00001 to 16384
+    *
+    * @param levels
+    * @return true on success, false if out of range.
+    */   
+   bool setBandsI( ossim_uint32 bands );
+
+  /**
+    * @brief Sets the number of layers in this image.
+    *
+    * Range: 001 to 999
+    *
+    * @param levels
+    * @return true on success, false if out of range.
+    */   
+   bool setLayersI( ossim_uint32 layers );
+
+
+   /**
+    * @brief Sets the layer id for index.
+    *
+    * Range: 001 to 999
+    *
+    * @note Requires call to "setLayersO" prior to this to size the container
+    * m_layer.
+    *
+    * @param index 
+    * @param id
+    * @return true on success, false if out of range.
+    */
+   bool setLayerId( ossim_uint32 index, ossim_uint32 id );
+   
+   /**
+    * @brief Sets the bitrate from index.
+    *
+    * Range: 00.000000 – 37.000000 
+    *
+    * @note Requires call to "setLayersO" prior to this to size the container
+    * m_layer.
+    *
+    * @param index 
+    * @param id
+    * @return true on success, false if out of range.
+    */
+   bool setLayerBitRate( ossim_uint32 index, ossim_float64 bitRate );
+   
+   
+protected:
+
+   /**
+    * @return true if origin byte is parsed; false if not.
+    */
+   bool isParsed() const;
+
+   // Container for repeating fields.
+   class ossimJ2klraLayer
+   {
+   public:
+      /**
+       * FIELD: LAYER_ID
+       * required 3 byte field
+       * 000 - 999
+       * Layer ID Number. Repeating.
+       */
+      char m_layer_id[LAYER_ID_SIZE+1];
+      
+      /**
+       * FIELD: BITRATE
+       * required 9 byte
+       * 00.000000 – 37.000000
+       * Bitrate
+       */
+      char m_bitrate[BITRATE_SIZE+1];
+   };
+
+   /**
+    * FIELD: ORIG
+    *
+    * Required 1 byte.
+    * 
+    * 0 - Original NPJE
+    * 1 – Parsed NPJE
+    * 2 – Original EPJE
+    * 3 – Parsed EPJE*
+    * 4 - Original TPJE
+    * 5 - Parsed TPJE
+    * 6 - Original LPJE
+    * 7 - Parsed LPJE
+    * 8 – Original other
+    * 9 – Parsed other
+    *
+    * Original compressed data.
+    */
+   char m_orig[ORIG_SIZE+1];
+   
+   /**
+    * FIELD: NLEVELS_O
+    * required 2 bytes
+    * 00 - 32
+    * Number of wavelet levels in original image.
+    */
+   char m_levels_o[NLEVELS_O_SIZE+1];
+   
+   /**
+    * FIELD: NBANDS_O
+    * required 5 bytes
+    * 00000 - 16384
+    * Number of bands in original image.
+    */
+   char m_bands_o[NBANDS_O_SIZE+1];
+   
+   /**
+    * FIELD: NLAYERS_O
+    * required 3 bytes
+    * 000 - 999
+    * Number of layers in original image.
+    */
+   char m_layers_o[NLAYERS_O_SIZE+1];
+
+   /** repeating fields */
+   std::vector<ossimJ2klraLayer> m_layer;
+   
+   /**
+    * FIELD: NLEVELS_I
+    * Conditional 2 bytes if ORIG=1, 3, or 9.
+    * 00 - 32
+    * Number of wavelet levels in this image.
+    */
+   char m_nlevels_i[NLEVELS_I_SIZE+1];
+   
+   /**
+    * FIELD: NBANDS_I
+    * Conditional 5 bytes if ORIG=1, 3,or 9.
+    * 00000 = 16384
+    * Number of bands in this image.
+    */
+   char m_nbands_i[NBANDS_I_SIZE+1];
+   
+   /**
+    * FIELD: NLAYERS_I
+    * Conditional 3 bytes if ORIG=1, 3, or 9.
+    * 000 - 999
+    * Number of Layers in this image.
+    */
+   char m_nlayers_i[NLAYERS_I_SIZE+1];
+   
+TYPE_DATA   
+};
+
+#endif /* End of "#ifndef ossimNitfJ2klraTag_HEADER_HEADER" */
diff --git a/ossim/include/ossim/support_data/ossimNitfLabelHeader.h b/include/ossim/support_data/ossimNitfLabelHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfLabelHeader.h
rename to include/ossim/support_data/ossimNitfLabelHeader.h
diff --git a/ossim/include/ossim/support_data/ossimNitfLabelHeaderV2_0.h b/include/ossim/support_data/ossimNitfLabelHeaderV2_0.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfLabelHeaderV2_0.h
rename to include/ossim/support_data/ossimNitfLabelHeaderV2_0.h
diff --git a/ossim/include/ossim/support_data/ossimNitfLocalCartographicTag.h b/include/ossim/support_data/ossimNitfLocalCartographicTag.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfLocalCartographicTag.h
rename to include/ossim/support_data/ossimNitfLocalCartographicTag.h
diff --git a/include/ossim/support_data/ossimNitfLocalGeographicTag.h b/include/ossim/support_data/ossimNitfLocalGeographicTag.h
new file mode 100644
index 0000000..4b0cf85
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfLocalGeographicTag.h
@@ -0,0 +1,81 @@
+//*******************************************************************
+// Copyright (C) 2004 Intelligence Data Systems. 
+//
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfLocalGeographicTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfLocalGeographicTag_HEADER
+#define ossimNitfLocalGeographicTag_HEADER
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfLocalGeographicTag : public ossimNitfRegisteredTag
+{
+public:
+   ossimNitfLocalGeographicTag();
+   virtual ~ossimNitfLocalGeographicTag();
+
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+
+   virtual void clearFields();
+
+   virtual void setDegreesPerPixelLat(double deltaLat);
+   virtual void setDegreesPerPixelLon(double deltaLon);
+   virtual void setLatOrigin(double origin);
+   virtual void setLonOrigin(double origin);
+   
+protected:
+   /**
+    * FIELD: ARV
+    *
+    * required 9 byte field
+    *
+    * Longitude density
+    *
+    * This field shall contain the pixel ground spacing in E/W direction that is
+    * the number of pixels or elements intervals in 360 degrees.
+    * 9 BCS-N positive integer 000000002 to 999999999. 
+    */
+   char theLonDensity[10];
+
+   /**
+    * FIELD: BRV
+    *
+    * required 9 byte field
+    *
+    * Latitude density
+    *
+    * This field shall contain the pixel ground spacing in N/S direction that is the number of
+    * pixels or elements intervals in 360 degrees. 9 BCS-N positive integer 000000002 to 999999999 R 
+    */ 
+   char theLatDensity[10];
+
+   /**
+    * FIELD: LSO
+    * 
+    * required 15 byte field
+    *
+    * Longitude of Reference Origin This field shall contain the longitude of the origin pixel
+    * (row number 0, column number 0) in the absolute coordinate system. 15 BCS-N R 
+    */
+   char theLonOrigin[16];
+
+   /**
+    * FIELD: PSO
+    *
+    * required 15 byte field
+    *
+    * Latitude of Reference Origin This field shall contain the latitude of the origin
+    * pixel (row number 0, column number 0) in the absolute coordinate system. 15 BCS-N R 
+    */
+   char theLatOrigin[15];
+
+TYPE_DATA   
+};
+#endif
diff --git a/include/ossim/support_data/ossimNitfMstgtaTag.h b/include/ossim/support_data/ossimNitfMstgtaTag.h
new file mode 100644
index 0000000..b1e8e4a
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfMstgtaTag.h
@@ -0,0 +1,217 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: MSTGTA Mission Target Information Extension Format
+// tag class declaration.
+//
+// See document STDI-0002 Table 8-16 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimNitfMstgtaTag_HEADER
+#define ossimNitfMstgtaTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfMstgtaTag : public ossimNitfRegisteredTag
+{
+public:
+
+   enum 
+   {
+      TGT_NUM_SIZE       = 5,
+      TGT_ID_SIZE        = 12,
+      TGT_BE_SIZE        = 15,
+      TGT_PRI_SIZE       = 3,
+      TGT_REQ_SIZE       = 12,
+      TGT_LTIOV_SIZE     = 12,
+      TGT_TYPE_SIZE      = 1,
+      TGT_COLL_SIZE      = 1,
+      TGT_CAT_SIZE       = 5,
+      TGT_UTC_SIZE       = 7,
+      TGT_ELEV_SIZE      = 6,
+      TGT_ELEV_UNIT_SIZE = 1,
+      TGT_LOC_SIZE       = 21
+    };
+   
+   /** @brief default constructor */
+   ossimNitfMstgtaTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfMstgtaTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(std::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+protected:
+
+   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
+   
+   /**
+    * FIELD: TGT_NUM
+    *
+    * TYPE: R
+    * 
+    * 5 byte field
+    *
+    * 00001 ti 99999
+    */
+   char theTgtNum[TGT_NUM_SIZE+1];
+
+   /**
+    * FIELD: TGT_ID
+    *
+    * TYPE: <R>
+    *
+    * 12 byte field
+    *
+    * Disignator of Target, alphnumeric.
+    */
+   char theTgtId[TGT_ID_SIZE+1];
+
+   /**
+    * FIELD: TGT_BE
+    *
+    * TYPE: <R>
+    * 
+    * 15 byte field
+    * 
+    * alphnumeric
+    */
+   char theTgtBe[TGT_BE_SIZE+1];
+
+   /**
+    * FIELD: TGT_PRI
+    *
+    * TYPE: <R>
+    *
+    * 3 byte field
+    * 
+    * Target priority, 1 = top, 2 = 2nd...  001 to 999
+    */
+   char theTgtPri[TGT_PRI_SIZE+1];
+
+   /**
+    * FIELD: TGT_REQ
+    *
+    * TYPE: <R>
+    *
+    * 12 byte field
+    * 
+    * Target requester. alphnumeric 
+    */
+   char theTgtReq[TGT_REQ_SIZE+1];
+
+   /**
+    * FIELD: TGT_LTIOV
+    *
+    * TYPE: <R>
+    * 
+    * 12 byte field
+    * 
+    * Latest Time Information of Value CCYYMMDDhhmm
+    */
+   char theTgtLtiov[TGT_LTIOV_SIZE+1];
+
+   /**
+    * FIELD: TGT_TYPE
+    *
+    * TYPE: <R>
+    *
+    * 1 byte field
+    * 
+    * Pre-Planned Target Type: 0 = point, 1 = strip, 2 = area, 0 to 9.
+    */
+   char theTgtType[TGT_TYPE_SIZE+1];
+
+   /**
+    * FIELD: TGT_COLL
+    *
+    * TYPE: R
+    * 
+    * 1 byte field
+    * 
+    * Pre-Planned Collection Technique: 0 to 9
+    */
+   char theTgtColl[TGT_COLL_SIZE+1];
+
+   /**
+    * FIELD: TGT_CAT
+    *
+    * TYPE: <R>
+    *
+    * 5 byte field
+    * 
+    * Target Functional Category Code 10000 to 99999
+    */
+   char theTgtCat[TGT_CAT_SIZE+1];
+
+   /**
+    * FIELD: TGT_UTC
+    *
+    * TYPE: <R>
+    * 
+    * 7 byte field
+    *
+    * Planned Time at Target hhmmssZ
+    */
+   char theTgtUtc[TGT_UTC_SIZE+1];
+
+   /**
+    * FIELD: TGT_ELEV
+    *
+    * TYPE: <R>
+    * 
+    * 6 byte field
+    * 
+    * Target Elevation -01000 to +30000 feet or meters
+    */
+   char theTgtElev[TGT_ELEV_SIZE+1];
+
+   /**
+    * FIELD: TGT_ELEV_UNIT
+    *
+    * TYPE: <R>
+    * 
+    * 1 byte field
+    * 
+    * Unit of Target Elevation, f = feet, m = meters
+    */
+   char theTgtElevUnit[TGT_ELEV_UNIT_SIZE+1];
+
+   /**
+    * FIELD: TGT_LOC
+    *
+    * TYPE: R
+    *
+    * 21 byte field
+    * 
+    * Target Location
+    */
+   char theTgtLoc[TGT_LOC_SIZE+1];
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfMstgtaTag_HEADER */
diff --git a/include/ossim/support_data/ossimNitfNameConversionTables.h b/include/ossim/support_data/ossimNitfNameConversionTables.h
new file mode 100644
index 0000000..cad4d09
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfNameConversionTables.h
@@ -0,0 +1,29 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimNitfNameConversionTables.h 9094 2006-06-13 19:12:40Z dburken $
+#ifndef ossimNitfNameConversionTables_HEADER
+#define ossimNitfNameConversionTables_HEADER
+#include <ossim/base/ossimConstants.h>
+
+class ossimString;
+
+class OSSIM_DLL ossimNitfNameConversionTables
+{
+public:
+   ossimNitfNameConversionTables();
+
+   ossimString convertMapProjectionNameToNitfCode(const ossimString& mapProjectionName)const;
+   ossimString convertNitfCodeToOssimProjectionName(const ossimString& nitfProjectionCode)const;
+   ossimString convertNitfCodeToNitfProjectionName(const ossimString& nitfProjectionCode)const;
+   ossimString convertNitfProjectionNameToNitfCode(const ossimString& nitfProjectionName)const;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfPiaimcTag.h b/include/ossim/support_data/ossimNitfPiaimcTag.h
new file mode 100644
index 0000000..df30dce
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfPiaimcTag.h
@@ -0,0 +1,427 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: PIAIMC tag class declaration.
+// 
+// "Profile for Imagery Access Image Support Extensions"
+//
+// See document STDI-0002 Table 6-1 for more info.
+// 
+// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfPiaimcTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfPiaimcTag_HEADER
+#define ossimNitfPiaimcTag_HEADER
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/base/ossimConstants.h>
+
+class ossimString;
+
+class OSSIM_DLL ossimNitfPiaimcTag : public ossimNitfRegisteredTag
+{
+public:
+   enum 
+   {
+      CLOUDCVR_SIZE   =   3,
+      SRP_SIZE        =   1,
+      SENSMODE_SIZE   =  12,
+      SENSNAME_SIZE   =  18,
+      SOURCE_SIZE     = 255,
+      COMGEN_SIZE     =   2,
+      SUBQUAL_SIZE    =   1,
+      PIAMSNNUM_SIZE  =   7,
+      CAMSPECS_SIZE   =  32,
+      PROJID_SIZE     =   2,
+      GENERATION_SIZE =   1,
+      ESD_SIZE        =   1,
+      OTHERCOND_SIZE  =   2,
+      MEANGSD_SIZE    =   7,
+      IDATUM_SIZE     =   3,
+      IELLIP_SIZE     =   3,
+      PREPROC_SIZE    =   2,
+      IPROJ_SIZE      =   2,
+      SATTRACK_SIZE   =   8
+      //             -------
+      //                362
+   };
+   
+   /** default constructor */
+   ossimNitfPiaimcTag();
+  
+   /**
+    * Parse method.
+    *
+    * @param in Stream to parse.
+    */
+   virtual void parseStream(std::istream& in);
+   
+   /**
+    * Write method.
+    *
+    * @param out Stream to write to.
+    */
+   virtual void writeStream(std::ostream& out);
+   
+   /**
+    * Clears all string fields within the record to some default nothingness.
+    */
+   virtual void clearFields();
+   
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+   /**
+    * @return CLOUDCVR field as an ossimString.
+    */
+   ossimString getCloudcvrString() const;
+
+   /**
+    * @return SRP field as an ossimString.
+    */
+   ossimString getSrpString() const;
+   
+   /**
+    * @return SENSMODE field as an ossimString.
+    */
+   ossimString getSensmodeString() const;
+   
+   /**
+    * @return SENSNAME field as an ossimString.
+    */
+   ossimString getSensnameString() const;
+   
+    /**
+    * @return SOURCE field as an ossimString.
+    */
+   ossimString getSourceString() const;
+  
+   /**
+    * @return COMGEN field as an ossimString.
+    */
+   ossimString getComgenString() const;
+   
+   /**
+    * @return SUBQUAL field as an ossimString.
+    */
+   ossimString getSubqualString() const;
+
+   /**
+    * @return PIAMSNNUM field as an ossimString.
+    */
+   ossimString getPiamsnnumString() const;
+
+   /**
+    * @return field as an ossimString.
+    */
+   ossimString getString() const;
+
+   /**
+    * @return CAMSPECS field as an ossimString.
+    */
+   ossimString getCamspecsString() const;
+
+   /**
+    * @return PROJID field as an ossimString.
+    */
+   ossimString getProjidString() const;
+
+   /**
+    * @return GENERATION field as an ossimString.
+    */
+   ossimString getGenerationString() const;
+
+   /**
+    * @return ESD field as an ossimString.
+    */
+   ossimString getEsdString() const;
+   
+   /**
+    * @return OTHERCONDfield as an ossimString.
+    */
+   ossimString getOthercondString() const;
+
+   /**
+    * @return MEANGSD field as an ossimString.
+    */
+   ossimString getMeadGsdString() const;
+
+   /**
+    * @return MEANGSD field as a double converted to meters.
+    *
+    * @note Conversion used: gsd_in_meters = gsd / 12.0 * MTRS_PER_FT
+    */
+   ossim_float64 getMeanGsdInMeters() const;
+
+   /**
+    * @return IDATUM field as an ossimString.
+    */
+   ossimString getIdatumString() const;
+   
+   /**
+    * @return IELLIP field as an ossimString.
+    */
+   ossimString getIellipString() const;
+   
+   /**
+    * @return PREPROC field as an ossimString.
+    */
+   ossimString getPreprocString() const;
+   
+   /**
+    * @return IPROJ field as an ossimString.
+    */
+   ossimString getIprojString() const;
+   
+   /**
+    * @return SATTRACK field as an ossimString.
+    */
+   ossimString getSattrackString() const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+protected:
+
+   /**
+    * FIELD: CLOUDCVR
+    *
+    * 3 byte field
+    *
+    * Indicates the precentage of the image that is obscured by cloud. A value
+    * os 999 indicates an unknown condition.
+    *
+    * 000 to 100, or 999
+    */
+   char theCloudcvr[CLOUDCVR_SIZE+1];
+   
+   /**
+    * FIELD: SRP
+    *
+    * 1 byte field
+    *
+    * Indicates whether or not standard radiometric product data is available.
+    *
+    * Y,N
+    */
+   char theSrp[SRP_SIZE+1];
+   
+   /**
+    * FIELD: SENSMODE
+    *
+    * 12 byte field
+    *
+    * Indentifies the sensor mode used in capturing the image.
+    *
+    * WHISKBROOM, PUSHROOM, FRAMING, SPOT, SWATH, TBD
+    */
+   char thesSensmode[SENSMODE_SIZE+1];
+   
+   /**
+    * FIELD: SENSNAME
+    *
+    * 18 byte field
+    *
+    * Indentifies the name of sensor used in capturing the image.
+    *
+    * USIGS DM, SENSORTYPE Name
+    */
+   char theSensname[SENSNAME_SIZE+1];
+   
+   /**
+    * FIELD: SOURCE
+    *
+    * 18 byte field
+    *
+    * Indicated where the image came from.
+    *
+    * alphanumeric
+    */
+   char theSource[SOURCE_SIZE+1];
+   
+   /**
+    * FIELD: COMGEN
+    *
+    * 2 byte field
+    *
+    * Compression Generation.
+    *
+    * 00 to 99
+    */
+   char theComgen[COMGEN_SIZE+1];
+   
+   /**
+    * FIELD: SUBQUAL
+    *
+    * 1 byte field
+    *
+    * Subjective Quality
+    *
+    * P-Poor, G-Good, E-Excellent, F-Fair
+    */
+   char theSubqual[SUBQUAL_SIZE+1];
+   
+   /**
+    * FIELD: PIAMSNNUM
+    *
+    * 7 byte field
+    *
+    * Indicates the mission number assigned to the reconnaissance mission.
+    *
+    * EARS 1.1 page 4-28
+    */
+   char thePiamsnnum[PIAMSNNUM_SIZE+1];
+   
+   /**
+    * FIELD: CAMSPECS
+    *
+    * 32 byte field
+    *
+    * Specifies the brand name of the camera used and the focal length of the
+    * lens.
+    *
+    * alphanumeric
+    */
+   char theCamspecs[CAMSPECS_SIZE+1];
+   
+   /**
+    * FIELD: PROJID
+    *
+    * 2 byte field
+    *
+    * Indentifies collection platform project identifier code.
+    *
+    * EARS Appendix 9
+    */
+   char theProjid[PROJID_SIZE+1];
+   
+   /**
+    * FIELD: GENERATION
+    *
+    * 1 byte field
+    *
+    * Specifies the number of image generations of the product.  The number(0)
+    * is reserved for the original product.
+    *
+    * 0 to 9
+    */
+   char theGeneration[GENERATION_SIZE+1];
+
+   /**
+    * FIELD: ESD
+    *
+    * 1 byte field
+    *
+    * Indicates whether or not Exploitation Support Data is available and
+    * contained withing the product data.
+    *
+    * Y,N
+    */
+   char theEsd[ESD_SIZE+1];
+
+   /**
+    * FIELD: OTHERCOND
+    *
+    * 2 byte field
+    *
+    * Indicates other conditions that affect the imagery over the target.
+    *
+    * EARS 1.1 page 4 to 28
+    */
+   char theOthercond[OTHERCOND_SIZE+1];
+
+   /**
+    * FIELD: MEANGSD
+    *
+    * 7 byte field
+    *
+    * The geometric mean of the across and along scan center-to-center distance
+    * between contiguous ground samples.
+    *
+    * 00000.0 to 99999.9 Expressed in inches, accuracy=10%
+    */
+   char theMeanGsd[MEANGSD_SIZE+1];
+
+   /**
+    * FIELD: IDATUM
+    *
+    * 3 byte field
+    *
+    * Identifies the mathematical representation of the earth used to
+    * geo-correct/or to rectify the image.
+    * (Identifies the Datum assiciated with IGEOLO.)
+    *
+    * Horizontal_Reference_Datum_Code(refer to DDDS element)
+    */
+   char theIdatum[IDATUM_SIZE+1];
+
+   /**
+    * FIELD: IELLIP
+    *
+    * 3 byte field
+    *
+    * Identifies the mathematical representation of the earth used to
+    * geo-correct/or to rectify the image.
+    * (Identifies the Ellipsoid assiciated with IGEOLO.)
+    */
+   char theIellip[IELLIP_SIZE+1];
+  
+   /**
+    * FIELD: PREPROC
+    *
+    * 2 byte field
+    *
+    * Identifies the level of radiometric and geometric processing applied to
+    * the product by the commercial vendor.
+    *
+    * USIGS DM, IMAGEDATASET Processing Level Code.
+    */
+   char thePreproc[PREPROC_SIZE+1];
+  
+   /**
+    * FIELD: IPROJ
+    *
+    * 2 byte field
+    *
+    * Identifies the 2D-map projection used by commercial vendors to
+    * geo-correct/or to rectify the image.
+    *
+    * DIGEST, Part 3 table 6-1
+    */
+   char theIproj[IPROJ_SIZE+1];
+
+   /**
+    * FIELD: SATTRACK
+    *
+    * 8 byte field
+    *
+    * Identifies location of an image acquired by LANDSAT or SPOT (only) along
+    * the satellite path.
+    *
+    * Minimum values:
+    *  PATH(J)=0001
+    *  ROW(K) =0001
+    * Maximum values:
+    *  PATH(J)=9999
+    *  ROW(K) =9999
+    *
+    *  Recorded as PATH/ROW 00010001
+    */
+   char theSattrack[SATTRACK_SIZE+1];
+   
+TYPE_DATA   
+};
+
+#endif /* End of "#ifndef ossimNitfPiaimcTag_HEADER" */
diff --git a/include/ossim/support_data/ossimNitfProjectionParameterTag.h b/include/ossim/support_data/ossimNitfProjectionParameterTag.h
new file mode 100644
index 0000000..283aaea
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfProjectionParameterTag.h
@@ -0,0 +1,332 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfProjectionParameterTag.h 22013 2012-12-19 17:37:20Z dburken $
+
+#ifndef ossimNitfProjectionParameterTag_HEADER
+#define ossimNitfProjectionParameterTag_HEADER
+#include <vector>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfProjectionParameterTag : public ossimNitfRegisteredTag
+{
+public:
+   ossimNitfProjectionParameterTag();
+   virtual ~ossimNitfProjectionParameterTag();
+
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+
+   virtual ossim_uint32 getSizeInBytes()const;
+   virtual void clearFields();
+   virtual void clearParameters();
+   virtual void addParameter(const ossimString& param);
+   virtual void addParameter(const ossim_float64& param);
+   void setName(const ossimString& name);
+   void setCode(const ossimString& code);
+   ossimString getName()const;
+   ossimString getCode()const;
+   void setFalseX(double falseX);
+   void setFalseY(double falseY);
+   double getFalseX()const;
+   double getFalseY()const;
+   
+protected:
+   /**
+    * FIELD: PRN
+    *
+    * required 80 byte field.
+    * 
+    * Projection Name
+    *
+    * This field shall contain the name of the projection to which the Image Segment refers.
+    * The default value is Transverse Mercator.
+    */
+   char theProjectionName[81];
+
+   /**
+    *
+    * FIELD: PCO
+    *
+    * required 2 byte field.
+    * 
+    * Projection Code
+    *
+    * This field shall contain the code of the projection to which the Image Segment refers.
+    * The default value is TC.
+    *
+    * Code values:
+    *
+    * AC           Albers Equal-Area Conic
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. std. parallel nearer to equator
+    *                3. std parallel farther from equator
+    *                4. latitude of origin
+    *              
+    * AK           (Lambert) Azimuthal Equal-Area
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *              
+    * AL           Azimuthal Equidistant
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    * 
+    * BF           Bonne
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Scale factor at projection origin
+    *                
+    * CC           Equidistant Conic with 1 Standard Parallel
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Latitude of Std. Parallel
+    *                
+    * CP           Equirectangular
+    *              Parameters:
+    *                1. Longitude of central meridian 
+    *                2. Latitude of true scale
+    *                3. Radius of sphere
+    *                
+    * CS           Cassini-Soldner
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *            
+    * ED           Eckert VI
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Radius of sphere
+    * 
+    * EF           Eckert IV
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Radius of sphere
+    * 
+    * GN           Gnomonic
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    * 
+    * HX           Hotine Oblique Mercator based on 2 Points 
+    *              Parameters:
+    *                1. Scale factor at projection origin
+    *                2. latitude of projection origin
+    *                3. longitude of first point defining center line
+    *                4. latitude of fist point defining center line
+    *                
+    * KA           Equidistant Conic with 2 Standard Parallels 
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Latitude of origin
+    *                3. Latitude of standard parallel Nearer to equator
+    *                4. Latitude of standard parallel farther from equator
+    *
+    * LA           Laborde
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Scale factor at proj origin
+    *                4. Azimuth at origin of axis of constant scale
+    * 
+    * LE           Lambert Conformal Conic
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. std. parallel nearer to equator
+    *                3. std. parallel farther from equator
+    *                4. Latitude of origin
+    * 
+    * LI           Cylindrical Equal Area
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Latitude of origin
+    *                
+    * LJ           Lambert Equal-Area Meridional
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Latitude of origin
+    *                
+    * MC           Mercator
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of true scale
+    *                3. Latitude of reference origin
+    *                
+    * MH           Miller Cylindrical
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Radius of sphere
+    *                
+    * MJ           French Lambert
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Scale factor at proj origin
+    *                
+    * MP           Mollweide
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Radius of sphere
+    *                
+    * NT           New Zealand Map Grid
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                
+    * OC           Oblique Mercator
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Azimuth
+    *                4. radius of sphere
+    *                
+    * OD           Orthographic
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Radius of sphere
+    *                
+    * PG           Polar Stereographic
+    *              Parameters:
+    *                1. Latitude of true scale
+    *                
+    * PH           Polyconic
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Latitude of origin
+    *                
+    * RS or RB     Hotine Oblique Mercator (Rectified Skew Orthomorphic)
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Azimuth East of North for Central Line (Skew X-Axis at Proj. origin)
+    *                4. Scale factor at proj origin
+    *                
+    * RX           Robinson
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Radius of sphere
+    *                
+    * SA           Sinusoidal
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Radius of sphere
+    *               
+    * SD           Oblique Stereographic
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Scale factor at origin
+    *                
+    * SX           Space Oblique Mercator
+    *              Parameters:
+    *                1. Application code:
+    *                     1 = Landsat, USGS equations
+    *                     2 = Landsat, EOSAT equations
+    *                2. Vehicle number
+    *                3. Orbital path number
+    *                
+    * TC           Transverse Mercator
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Central Scale Factor
+    *                3. Latitude of origin
+    *                
+    * TX           Transverse Cylindrical Equal Area
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Latitude of origin
+    *                3. Scale factor along central meridian
+    *                
+    * VA           Van der Grinten
+    *              Parameters:
+    *                1. Longitude of central meridian
+    *                2. Radius of sphere
+    * 
+    * VX           General Vertical NearSide Perspective
+    *              Parameters:
+    *                1. Longitude of origin
+    *                2. Latitude of origin
+    *                3. Heigh of perspective map above surface
+    *
+    * ZY           Other Known Projection
+    */
+   char theProjectionCode[3];
+
+   /**
+    * FIELD: NUM_PRJ
+    *
+    * required 1 byte field ranging from 0-9
+    * 
+    * Number of Projection Parameters
+    *
+    * This field shall contain the number of projection parameters.
+    * The PRJ Field should be repeated as necessary depending on the
+    * projection code (see Part 3-6).  If the number of projection parameters
+    * provided is lower than specified in Part 3-6, the
+    * missing parameters value is 0.
+    *
+    */
+   char              theNumberOfParameters[2];
+   
+   /**
+    * FIELD(S): PRJn
+    *
+    * Conditional 15 byte field each.
+    *
+    * Projection Parameter Each occurrence of this field provides an appropriate
+    * parameter to accurately describe the projection.  See Part 3-6 to know the
+    * kind of parameters needed for each projection code. 15 BCS-N C 
+    */
+   std::vector<ossimString> theProjectionParameters;
+   
+   /**
+    * FIELD: XOR
+    *
+    * required  15 byte field.
+    * 
+    * Projection False X (Easting) Origin
+    *
+    * This field shall contain the projection false X (easting) origin.
+    * The default value is 000000000000000, which implies that there is no projection false X origin.
+    * 
+    */
+   char theFalseXOrigin[16];
+
+
+   /**
+    * FIELD: YOR
+    *
+    * required 15 byte field.
+    *
+    * Projection False Y (Northing) Origin
+    *
+    * This field shall contain the projection false Y (northing) origin.
+    * The default value is 000000000000000, which implies that there is
+    * no projection false Y origin.
+    * 
+    */
+   char theFalseYOrigin[16];
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRegisteredDes.h b/include/ossim/support_data/ossimNitfRegisteredDes.h
new file mode 100644
index 0000000..692f8fb
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRegisteredDes.h
@@ -0,0 +1,124 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: 
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRegisteredDes.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfRegisteredDes_HEADER
+#define ossimNitfRegisteredDes_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimPropertyInterface.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <string>
+
+class ossimKeywordlist;
+class ossimString;
+
+class OSSIM_DLL ossimNitfRegisteredDes : public ossimObject ,
+                                         public ossimPropertyInterface
+{
+public:
+   /** @brief default constructor */
+   ossimNitfRegisteredDes();
+   
+   /** @brief Constructor that takes name and size. */
+   ossimNitfRegisteredDes(const std::string& desName, ossim_uint32 desLength);
+
+   /** @brief destructor */
+   virtual ~ossimNitfRegisteredDes();
+   
+   /**
+    * @brief This will return the name of the registered des for this user
+    * defined header.
+    *
+    * @note Deprecated - Use getDesName()
+    */
+   virtual std::string getRegisterDesName() const;
+   
+   /**
+    * @brief This will return the name of the registered des for this user
+    * defined header.
+    */
+   virtual const std::string& getDesName() const;
+
+   /**
+    * @param desName Name of des.
+    *
+    * @note Users should set des name as this is an unknown des.
+    */
+   virtual void setDesName(const std::string& desName);
+ 
+   /**
+    * @brief Returns the length in bytes of the des from the CEL or REL field.
+    * 
+    * @note Depricated use: getDesLength()
+    *
+    * The entire TRE length is 11 plus this(the size of the CEL or REL field).
+    *
+    * @return Length of REDATA or CEDATA.
+    */
+   virtual ossim_uint32 getSizeInBytes()const;
+
+  /**
+    * @brief Returns the length in bytes of the des from the CEL or REL field.
+    *
+    * The entire TRE length is 11 plus this(the size of the CEL or REL field).
+    *
+    * @return Length of REDATA or CEDATA.
+    */
+   virtual ossim_uint32 getDesLength()const;
+
+  /**
+    * @brief Set the des length.
+    *
+    * @param length Length of des.
+    */
+   virtual void setDesLength(ossim_uint32 length);
+    
+   /**
+    * This will allow the user defined data to parse the stream.
+    */
+   virtual void parseStream(std::istream& in)=0;
+   virtual void writeStream(std::ostream& out)=0;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief Default interface to populate keyword list with metadata.
+    * expample:  country_code: US
+    * This implementation does nothing.  Derived classes should implement as
+    * they see fit.
+    * 
+    * @param kwl Keywordlist to populate with metadata.
+    *
+    * @param prefix Optional prefix to put in front of key, like: "image1.".
+    */
+   virtual void getMetadata(ossimKeywordlist& kwl,
+                            const char* prefix=0) const;
+
+   /**
+    * @brief Pure virtual print method that outputs a key/value type format
+    * adding prefix to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix)const;
+   
+protected:
+   std::string  m_desName;
+   ossim_uint32 m_desLength;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRegisteredDesFactory.h b/include/ossim/support_data/ossimNitfRegisteredDesFactory.h
new file mode 100644
index 0000000..6659c64
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRegisteredDesFactory.h
@@ -0,0 +1,30 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: LGPL see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRegisteredDesFactory.h 22875 2014-08-27 13:52:03Z dburken $
+#ifndef ossimNitfRegisteredDesFactory_HEADER
+#define ossimNitfRegisteredDesFactory_HEADER 1
+
+#include <ossim/support_data/ossimNitfDesFactory.h>
+
+class ossimNitfRegisteredDesFactory : public ossimNitfDesFactory
+{
+public:
+   virtual ~ossimNitfRegisteredDesFactory();
+   static ossimNitfRegisteredDesFactory* instance();
+   
+   virtual ossimRefPtr<ossimNitfRegisteredDes> create(const ossimString &desName)const;
+
+protected:
+   ossimNitfRegisteredDesFactory();
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRegisteredTag.h b/include/ossim/support_data/ossimNitfRegisteredTag.h
new file mode 100644
index 0000000..9af8af0
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRegisteredTag.h
@@ -0,0 +1,126 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfRegisteredTag_HEADER
+#define ossimNitfRegisteredTag_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimPropertyInterface.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <string>
+
+class ossimKeywordlist;
+class ossimString;
+
+class OSSIM_DLL ossimNitfRegisteredTag : public ossimObject ,
+                                         public ossimPropertyInterface
+{
+public:
+   /** @brief default constructor */
+   ossimNitfRegisteredTag();
+   
+   /** @brief Constructor that takes name and size. */
+   ossimNitfRegisteredTag(const std::string& tagName, ossim_uint32 tagLength);
+
+   /** @brief destructor */
+   virtual ~ossimNitfRegisteredTag();
+   
+   /**
+    * @brief This will return the name of the registered tag for this user
+    * defined header.
+    *
+    * @note Deprecated - Use getTagName()
+    */
+   virtual std::string getRegisterTagName() const;
+   
+   /**
+    * @brief This will return the name of the registered tag for this user
+    * defined header.
+    */
+   virtual const std::string& getTagName() const;
+
+   /**
+    * @param tagName Name of tag.
+    *
+    * @note Users should set tag name as this is an unknown tag.
+    */
+   virtual void setTagName(const std::string& tagName);
+ 
+   /**
+    * @brief Returns the length in bytes of the tag from the CEL or REL field.
+    * 
+    * @note Depricated use: getTagLength()
+    *
+    * The entire TRE length is 11 plus this(the size of the CEL or REL field).
+    *
+    * @return Length of REDATA or CEDATA.
+    */
+   virtual ossim_uint32 getSizeInBytes()const;
+
+  /**
+    * @brief Returns the length in bytes of the tag from the CEL or REL field.
+    *
+    * The entire TRE length is 11 plus this(the size of the CEL or REL field).
+    *
+    * @return Length of REDATA or CEDATA.
+    */
+   virtual ossim_uint32 getTagLength()const;
+
+  /**
+    * @brief Set the tag length.
+    *
+    * @param length Length of tag.
+    */
+   virtual void setTagLength(ossim_uint32 length);
+    
+   /**
+    * This will allow the user defined data to parse the stream.
+    */
+   virtual void parseStream(ossim::istream& in)=0;
+   virtual void writeStream(ossim::ostream& out)=0;
+
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+   /**
+    * @brief Default interface to populate keyword list with metadata.
+    * expample:  country_code: US
+    * This implementation does nothing.  Derived classes should implement as
+    * they see fit.
+    * 
+    * @param kwl Keywordlist to populate with metadata.
+    *
+    * @param prefix Optional prefix to put in front of key, like: "image1.".
+    */
+   virtual void getMetadata(ossimKeywordlist& kwl,
+                            const char* prefix=0) const;
+
+   /**
+    * @brief Pure virtual print method that outputs a key/value type format
+    * adding prefix to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix)const;
+   
+protected:
+   std::string  m_tagName;
+   ossim_uint32 m_tagLength;
+   
+TYPE_DATA
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRegisteredTagFactory.h b/include/ossim/support_data/ossimNitfRegisteredTagFactory.h
new file mode 100644
index 0000000..39b9668
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRegisteredTagFactory.h
@@ -0,0 +1,30 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: LGPL see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRegisteredTagFactory.h 22875 2014-08-27 13:52:03Z dburken $
+#ifndef ossimNitfRegisteredTagFactory_HEADER
+#define ossimNitfRegisteredTagFactory_HEADER 1
+
+#include <ossim/support_data/ossimNitfTagFactory.h>
+
+class ossimNitfRegisteredTagFactory : public ossimNitfTagFactory
+{
+public:
+   virtual ~ossimNitfRegisteredTagFactory();
+   static ossimNitfRegisteredTagFactory* instance();
+   
+   virtual ossimRefPtr<ossimNitfRegisteredTag> create(const ossimString &tagName)const;
+
+protected:
+   ossimNitfRegisteredTagFactory();
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRpcATag.h b/include/ossim/support_data/ossimNitfRpcATag.h
new file mode 100644
index 0000000..f95f166
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRpcATag.h
@@ -0,0 +1,35 @@
+//*******************************************************************
+// Copyright (C) 2000 Intelligence Data Systems. 
+//
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+//
+// Description: Nitf support class for RPC00A -
+// Rational Polynomial Coefficient extension.
+//
+//********************************************************************
+// $Id: ossimNitfRpcATag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfRpcATag_HEADER
+#define ossimNitfRpcATag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRpcBase.h>
+
+/**
+ * The layout of RPC00B is the same as RPC00A.  The difference is how the
+ * coefficients are used; hence, all the code is in the ossimNitfRpcBase class.
+ */
+class OSSIM_DLL ossimNitfRpcATag : public ossimNitfRpcBase
+{
+public:
+   
+   ossimNitfRpcATag();
+   
+protected:
+   
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRpcBTag.h b/include/ossim/support_data/ossimNitfRpcBTag.h
new file mode 100644
index 0000000..f792086
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRpcBTag.h
@@ -0,0 +1,30 @@
+//*******************************************************************
+// Copyright (C) 2000 Intelligence Data Systems. 
+//
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRpcBTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfRpcBTag_HEADER
+#define ossimNitfRpcBTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRpcBase.h>
+
+/**
+ * The layout of RPC00B is the same as RPC00A.  The difference is how the
+ * coefficients are used; hence, all the code is in the ossimNitfRpcBase class.
+ */
+class OSSIM_DLL ossimNitfRpcBTag : public ossimNitfRpcBase
+{
+public:
+   ossimNitfRpcBTag();
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRpcBase.h b/include/ossim/support_data/ossimNitfRpcBase.h
new file mode 100644
index 0000000..e85cfe2
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRpcBase.h
@@ -0,0 +1,545 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: Nitf base support data class for RPC tags.
+// 
+// Rational Polynomial Coefficient extension.
+//
+// See: http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
+//
+//********************************************************************
+// $Id: ossimNitfRpcBase.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfRpcBase_HEADER
+#define ossimNitfRpcBase_HEADER 1
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfRpcBase : public ossimNitfRegisteredTag
+{
+ public:
+  enum 
+  {
+    SUCCESS_SIZE                         = 1,
+    ERROR_BIAS_SIZE                      = 7,
+    ERR_RAND_SIZE                        = 7,
+    LINE_OFFSET_SIZE                     = 6,
+    SAMPLE_OFFSET_SIZE                   = 5,
+    GEODETIC_LAT_OFFSET_SIZE             = 8,
+    GEODETIC_LON_OFFSET_SIZE             = 9,
+    GEODETIC_HEIGHT_OFFSET_SIZE          = 5,
+    LINE_SCALE_SIZE                      = 6,
+    SAMPLE_SCALE_SIZE                    = 5,
+    GEODETIC_LAT_SCALE_SIZE              = 8,
+    GEODETIC_LON_SCALE_SIZE              = 9,
+    GEODETIC_HEIGHT_SCALE_SIZE           = 5,
+    LINE_NUMERATOR_COEFFICIENT_SIZE      = 12,
+    LINE_NUMERATOR_COEFFICIENT_COUNT     = 20,
+    LINE_DENOMINATOR_COEFFICIENT_SIZE    = 12,
+    LINE_DENOMINATOR_COEFFICIENT_COUNT   = 20,
+    SAMPLE_NUMERATOR_COEFFICIENT_SIZE    = 12,
+    SAMPLE_NUMERATOR_COEFFICIENT_COUNT   = 20,
+    SAMPLE_DENOMINATOR_COEFFICIENT_SIZE  = 12,
+    SAMPLE_DENOMINATOR_COEFFICIENT_COUNT = 20
+    //                                  -----
+    //                                   1041
+  };
+
+  /** default constructor */
+  ossimNitfRpcBase();
+
+  /**
+   * Parse method.
+   *
+   * @param in Stream to parse.
+   */
+  virtual void parseStream(std::istream& in);
+
+  /**
+   * Write method.
+   *
+   * @param out Stream to write to.
+   */
+  virtual void writeStream(std::ostream& out);
+
+  /**
+   * Clears all string fields within the record to some default nothingness.
+   */
+  virtual void clearFields();
+
+  /**
+   * @return The success record as a boolean.
+   */
+  bool getSuccess()const;
+
+  /** @param success Sets data member theSuccess to success. */
+  void setSuccess(bool success);
+
+  /** @return theErrorBias as a string. */
+  ossimString getErrorBias()const;
+
+  //---
+  // The set methods below taking ossimString args will truncate and
+  // pad with spaces, as necessary, to match enumed size.
+  //---
+
+  /**
+   * @param errorBias Error bias to set theErrorBias to.  This will be
+   * converted to a string with two digit precision.
+   */
+  void setErrorBias(const ossim_float64& errorBias);
+
+  /** @param errorBias bias string to set theErrorBias to. */
+  void setErrorBias(const ossimString& errorBias);
+
+  /** @return theErrorBias as a string. */
+  ossimString getErrorRand()const;
+
+  /**
+   * @param errorRand The random error to set theErrRand to.  This will be
+   * converted to a string with two digit precision.
+   */
+  void setErrorRand(const ossim_float64& errorRand);
+
+  
+  /** @param errorRand error random  string to set theErrorRand to. */
+  void setErrorRand(const ossimString& errorRand);
+
+  /** @return The line offset as a string. */
+  ossimString getLineOffset()const;
+
+  /**
+   * @param lineOffset Sets the line offset to a string truncated to an int.
+   */
+  void setLineOffset(ossim_uint32 lineOffset);
+
+  /**
+   * @param lineOffset Sets theLineOffset to lineOffset string.
+   */
+  void setLineOffset(const ossimString& lineOffset);
+
+  /** @return The sample offset as a string. */
+  ossimString getSampleOffset()const;
+
+  /**
+   * @param sampleOffset Sets the sample offset to a string truncated to an
+   * int.
+   */
+  void setSampleOffset(ossim_uint32 sampleOffset);
+
+  /** @param sampleOffset Sets the sample offset to a string. */
+  void setSampleOffset(const ossimString& sampleOffset);
+
+  /** @return Geodetic latitude offset as a string. */
+  ossimString getGeodeticLatOffset()const;
+
+  /**
+   * @param geodeticLatOffset Value to Set the geodedic latitude offset to.
+   * Converted to a string with four digit precision.
+   */
+  void setGeodeticLatOffset(const ossim_float64& geodeticLatOffset);
+
+  /**
+   * @param geodeticLatOffset geodedic latitude offset string to set
+   * theGeodeticLatOffset to.
+   */
+  void setGeodeticLatOffset(const ossimString& geodeticLatOffset);
+
+  /** @return Geodetic longitude offset as a string. */
+  ossimString getGeodeticLonOffset()const;
+
+  /**
+   * @param geodeticLonOffset Value to Set the geodedic longitude offset to.
+   * Converted to a string with four digit precision.
+   */
+  void setGeodeticLonOffset(const ossim_float64& geodeticLonOffset);
+
+  /**
+   * @param geodeticLonOffset Value to Set the geodedic longitude offset to.
+   */
+  void setGeodeticLonOffset(const ossimString& geodeticLonOffset);
+
+  /** @return Geodetic height offset as a string. */
+  ossimString getGeodeticHeightOffset()const;
+
+  /**
+   * @param geodeticHeightOffset value to Set the height offset to.
+   * Converted to a string truncated to an int.
+   */
+  void setGeodeticHeightOffset(ossim_int32 geodeticHeightOffset);
+  
+  /** @param geodeticHeightOffset value to Set the height offset to. */
+  void setGeodeticHeightOffset(const ossimString& geodeticHeightOffset);
+
+  /** @return The line scale as a string. */
+  ossimString getLineScale()const;
+  
+  /**
+   * @param lineScale The value to set the line scale to.
+   * Converted to a string.
+   */
+  void setLineScale(ossim_uint32 lineScale);
+
+  /**
+   * @param lineScale The value to set the line scale to.
+   */
+  void setLineScale(const ossimString& lineScale);
+
+  /**
+   * @return the sample scale as a string.
+   */
+  ossimString getSampleScale()const;
+
+  /**
+   * @param sampleScale The value to set the sample scale to.
+   * Converted to a string truncated to an int.
+   */
+  void setSampleScale(ossim_uint32 sampleScale);
+
+  /**
+   * @param sampleScale The value to set the sample scale to.
+   */
+  void setSampleScale(const ossimString& sampleScale);
+
+  /** @return The Geodetic latitude scale as a string. */
+  ossimString getGeodeticLatScale()const;
+
+  /**
+   * @param geodeticLatScale The value to set the geodedic latitude scale to.
+   * Converted to a string with four digit precision.
+   */
+  void setGeodeticLatScale(const ossim_float64& geodeticLatScale);
+
+  /**
+   * @param geodeticLatScale The value to set the geodedic latitude scale to.
+   */
+  void setGeodeticLatScale(const ossimString& geodeticLatScale);
+
+  /** @return Geodetic longitude scale as a string. */
+  ossimString getGeodeticLonScale()const;
+
+  /**
+   * @param geodeticLonScale The value to set the geodedic longitude scale to.
+   * Converted to a string with four digit precision.
+   */
+  void setGeodeticLonScale(const ossim_float64& geodeticLonScale);
+
+  /**
+   * @param geodeticLonScale The value to set the geodedic longitude scale to.
+   */
+  void setGeodeticLonScale(const ossimString& geodeticLonScale);
+
+  /** @return The geodetic height scale as a string. */
+  ossimString getGeodeticHeightScale()const;
+
+  /**
+   * @param geodeticHeightScale The value to set the height scale to.
+   * Converted to a string truncated to an int.
+   */
+  void setGeodeticHeightScale(ossim_int32 geodeticHeightScale);
+  
+  /**
+   * @param geodeticHeightScale The value to set the height scale to.
+   */
+  void setGeodeticHeightScale(const ossimString& geodeticHeightScale);
+
+  /**
+   * @param idx Index of line numerator coefficient to get.
+   * Range: 0 - 19
+   *
+   * @return The line numerator coefficient as a string.
+   */
+  ossimString getLineNumeratorCoeff(ossim_uint32 idx)const;
+
+  /**
+   * @param coeff This should be an array of 20 line numerator coefficients.
+   * Coefficients will be converted to a scientific string to conform to
+   * specification.
+   *
+   * @note if (coeff.size() != 20) no action is taken.
+   */  
+  void setLineNumeratorCoeff(const std::vector<ossim_float64>& coeff);
+  
+  /**
+   * @param idx index of line numerator coefficient to set.
+   * Range: 0 - 19
+   *
+   * @param coeff Value to set line numerator coefficient to for
+   * idx or index.
+   */  
+  void setLineNumeratorCoeff(ossim_uint32 idx,
+                             const ossimString& coeff);
+
+  /**
+   * @param idx index of line denominator coefficient to get.
+   * Range: 0 - 19
+   *
+   * @return line  denominator coefficient as a string.
+   */
+  ossimString getLineDenominatorCoeff(ossim_uint32 idx)const;
+  
+  /**
+   * @param coeff This should be an array of 20 line denominator coefficients.
+   * Coefficients will be converted to a scientific string to conform to
+   * specification.
+   *
+   * @note if (coeff.size() != 20) no action is taken.
+   */  
+  void setLineDenominatorCoeff(const std::vector<ossim_float64>& coeff);
+  
+  /**
+   * @param idx index of line denominator coefficient to set.
+   * Range: 0 - 19
+   *
+   * @param lineDenominatorCoeff Value to set line denominator coefficient
+   * to for idx or index.
+   */  
+  void setLineDenominatorCoeff(ossim_uint32 idx,
+                               const ossimString& coeff);
+
+  /**
+   * @param idx Index of sample numerator coefficient to get.
+   * Range: 0 - 19
+   *
+   * @return The sample numerator coefficient as a string.
+   */
+  ossimString getSampleNumeratorCoeff(ossim_uint32 idx)const;
+
+  /**
+   * @param coeff This should be an array of 20 sample numerator coefficients.
+   * Coefficients will be converted to a scientific string to conform to
+   * specification.
+   *
+   * @note if (coeff.size() != 20) no action is taken.
+   */  
+  void setSampleNumeratorCoeff(const std::vector<ossim_float64>& coeff);
+  
+  /**
+   * @param idx index of sample numerator coefficient to set.
+   * Range: 0 - 19
+   *
+   * @param coeff Value to set sample numerator coefficient to for
+   * idx or index.
+   */  
+  void setSampleNumeratorCoeff(ossim_uint32 idx,
+                             const ossimString& coeff);
+
+  /**
+   * @param idx index of sample denominator coefficient to get.
+   * Range: 0 - 19
+   *
+   * @return sample  denominator coefficient as a string.
+   */
+  ossimString getSampleDenominatorCoeff(ossim_uint32 idx)const;
+  
+  /**
+   * @param coeff This should be an array of 20 sample denominator coefficients.
+   * Coefficients will be converted to a scientific string to conform to
+   * specification.
+   *
+   * @note if (coeff.size() != 20) no action is taken.
+   */  
+  void setSampleDenominatorCoeff(const std::vector<ossim_float64>& coeff);
+  
+  /**
+   * @param idx index of sample denominator coefficient to set.
+   * Range: 0 - 19
+   *
+   * @param sampleDenominatorCoeff Value to set sample denominator coefficient
+   * to for idx or index.
+   */  
+  void setSampleDenominatorCoeff(ossim_uint32 idx,
+                               const ossimString& coeff);
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+
+  virtual void setProperty(ossimRefPtr<ossimProperty> property);
+  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+  virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+  bool loadState(const ossimKeywordlist& kwl, const char* prefix);
+
+protected:
+
+  /**
+   * FIELD: SUCCESS
+   *
+   * Required 1 byte field.
+   * 
+   * Value is 1
+   * 
+   */
+  char theSuccess[SUCCESS_SIZE+1];
+   
+  /**
+   * FIELD: ERR_BIAS
+   *
+   * required 7 byte field
+   * 
+   * Error - Bias. 68% non time-varying error estimate assumes
+   * correlated images.
+   *
+   * Values range from 0000.00 to 9999.99 meters
+   */
+  char theErrorBias[ERROR_BIAS_SIZE+1];
+
+  /**
+   * FIELD ERR_RAND
+   *
+   * Required 7 byte field
+   * 
+   * Error - Random. 68% time-varying error estimate assumes
+   * correlated images. 0000.00 to 9999.99 meters
+   */
+  char theErrRand[ERR_RAND_SIZE+1];
+
+  /**
+   * FIELD: LINE_OFF
+   *
+   * required 6 byte field.
+   * 
+   * value is in pixels and ranges from 000000-999999
+   */
+  char theLineOffset[LINE_OFFSET_SIZE+1];
+
+  /**
+   * FIELD: SAMP_OFF
+   *
+   * required 5 byte field.
+   *
+   * value is in pixels and ranges from 00000-99999
+   */
+  char theSampleOffset[SAMPLE_OFFSET_SIZE+1];
+
+  /**
+   * FIELD: LAT_OFF
+   *
+   * required 8 byte field.
+   *
+   * Holds the lat offset in degrees and ranges from +-90.0000
+   */
+  char theGeodeticLatOffset[GEODETIC_LAT_OFFSET_SIZE+1];
+
+  /**
+   * FIELD: LONG_OFF
+   *
+   * required 9 byte field.
+   *
+   * holds the lon offset in degrees and ranges from +-180.0000
+   */
+  char theGeodeticLonOffset[GEODETIC_LON_OFFSET_SIZE+1];
+
+  /**
+   * FIELD: HEIGHT_OFF
+   *
+   * required 5 byte field.
+   *
+   * holds the height offset in meters and ranges from +-9999
+   */
+  char theGeodeticHeightOffset[GEODETIC_HEIGHT_OFFSET_SIZE+1];
+
+  /**
+   * FIELD: LINE_SCALE
+   *
+   * required 6 byte field.
+   *
+   * holds the line scale in pixels and ranges from 000001-999999
+   * 
+   */
+  char theLineScale[LINE_SCALE_SIZE+1];
+
+  /**
+   * FIELD: SAMP_SCALE
+   *
+   * required 5 byte field.
+   *
+   * holds the line scale in pixels and ranges from 00001-99999
+   * 
+   */
+  char theSampleScale[SAMPLE_SCALE_SIZE+1];
+
+  /**
+   * FIELD: LAT_SCALE
+   *
+   * required 8 byte field
+   *
+   * holds the lat scale in degrees and ranges from +-90.0000 degrees
+   */
+  char theGeodeticLatScale[GEODETIC_LAT_SCALE_SIZE+1];
+
+  /**
+   * FIELD: LON_SCALE
+   *
+   * required 9 byte field
+   *
+   * holds the lon scale in degrees and ranges from +-180.0000 degrees
+   */
+  char theGeodeticLonScale[GEODETIC_LON_SCALE_SIZE+1];
+
+  /**
+   * FIELD: HEIGHT_SCALE
+   *
+   * required 5 byte field
+   *
+   * holds the geodetic height scale and ranges from +-9999 meters.
+   */
+  char theGeodeticHeightScale[GEODETIC_HEIGHT_SCALE_SIZE+1];
+
+  /**
+   * FIELD: LINE_NUM_COEFF_1 through LINE_NUM_COEFF_20
+   *
+   * Line Numerator Coefficients.
+   *
+   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
+   * polynomial
+   *
+   */     
+  std::vector<ossimString> theLineNumeratorCoefficient;
+
+  /**
+   * FIELD: LINE_DEN_COEFF_1 through LINE_DEN_COEFF_20
+   *
+   * Line Denominato Coefficients.
+   *
+   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
+   * polynomial
+   *
+   */     
+  std::vector<ossimString> theLineDenominatorCoefficient;
+
+  /**
+   * FIELD: SAMP_NUM_COEFF_1 through SAMP_NUM_COEFF_20
+   *
+   * samp Numerator Coefficients.
+   *
+   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
+   * polynomial
+   *
+   */     
+  std::vector<ossimString> theSampleNumeratorCoefficient;
+
+  /**
+   * FIELD: SAMP_DEN_COEFF_1 through SAMP_DEN_COEFF_20
+   *
+   * samp Denominator Coefficients.
+   *
+   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
+   * polynomial
+   *
+   */     
+  std::vector<ossimString> theSampleDenominatorCoefficient;
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfRpfTagFactory.h b/include/ossim/support_data/ossimNitfRpfTagFactory.h
new file mode 100644
index 0000000..520b592
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfRpfTagFactory.h
@@ -0,0 +1,40 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: LGPL  see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRpfTagFactory.h 22875 2014-08-27 13:52:03Z dburken $
+#ifndef ossimNitfRpfTagFactory_HEADER
+#define ossimNitfRpfTagFactory_HEADER 1
+
+#include <ossim/support_data/ossimNitfTagFactory.h>
+class ossimNitfRegisteredTag;
+
+class ossimNitfRpfTagFactory : public ossimNitfTagFactory
+{
+public:
+   virtual ~ossimNitfRpfTagFactory();
+   static ossimNitfRpfTagFactory* instance();
+   virtual ossimRefPtr<ossimNitfRegisteredTag> create(const ossimString &tagName)const;
+   
+protected:
+   ossimNitfRpfTagFactory();
+
+private:
+   /*!
+    * Hide this.
+    */
+   ossimNitfRpfTagFactory(const ossimNitfRpfTagFactory & /* rhs */){}
+
+   /*!
+    * Hide this.
+    */ 
+   ossimNitfRpfTagFactory& operator =(const ossimNitfRpfTagFactory & /* rhs */){return *this;}
+
+TYPE_DATA
+};
+#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfRsmecaTag.h b/include/ossim/support_data/ossimNitfRsmecaTag.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfRsmecaTag.h
rename to include/ossim/support_data/ossimNitfRsmecaTag.h
diff --git a/ossim/include/ossim/support_data/ossimNitfRsmidaTag.h b/include/ossim/support_data/ossimNitfRsmidaTag.h
old mode 100755
new mode 100644
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfRsmidaTag.h
rename to include/ossim/support_data/ossimNitfRsmidaTag.h
diff --git a/ossim/include/ossim/support_data/ossimNitfRsmpcaTag.h b/include/ossim/support_data/ossimNitfRsmpcaTag.h
old mode 100755
new mode 100644
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfRsmpcaTag.h
rename to include/ossim/support_data/ossimNitfRsmpcaTag.h
diff --git a/ossim/include/ossim/support_data/ossimNitfRsmpiaTag.h b/include/ossim/support_data/ossimNitfRsmpiaTag.h
old mode 100755
new mode 100644
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfRsmpiaTag.h
rename to include/ossim/support_data/ossimNitfRsmpiaTag.h
diff --git a/include/ossim/support_data/ossimNitfSensraTag.h b/include/ossim/support_data/ossimNitfSensraTag.h
new file mode 100644
index 0000000..5e159ab
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfSensraTag.h
@@ -0,0 +1,268 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Walt Bunch
+//
+// Description: Nitf support class for SENSRA - Sensor parameters extension.
+// 
+//********************************************************************
+// $Id: ossimNitfSensraTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfSensraTag_HEADER
+#define ossimNitfSensraTag_HEADER
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfSensraTag : public ossimNitfRegisteredTag
+{
+public:
+
+   enum
+   {
+      REF_ROW_SIZE         = 8,
+      REF_COL_SIZE         = 8,
+      SENSOR_MODEL_SIZE    = 6,
+      SENSOR_MOUNT_SIZE    = 3,
+      SENSOR_LOC_SIZE      = 21,
+      SENSOR_ALT_SRC_SIZE  = 1,
+      SENSOR_ALT_SIZE      = 6,
+      SENSOR_ALT_UNIT_SIZE = 1,
+      SENSOR_AGL_SIZE      = 5,
+      SENSOR_PITCH_SIZE    = 7,
+      SENSOR_ROLL_SIZE     = 8,
+      SENSOR_YAW_SIZE      = 8,
+      PLATFORM_PITCH_SIZE  = 7,
+      PLATFORM_ROLL_SIZE   = 8,
+      PLATFORM_HDG_SIZE    = 5,
+      GROUND_SPD_SRC_SIZE  = 1,
+      GROUND_SPEED_SIZE    = 6,
+      GROUND_SPD_UNIT_SIZE = 1,
+      GROUND_TRACK_SIZE    = 5,
+      VERTICAL_VEL_SIZE    = 5,
+      VERT_VEL_UNIT_SIZE   = 1,
+      SWATH_FRAMES_SIZE    = 4,
+      N_SWATHS_SIZE        = 4,
+      SPOT_NUM_SIZE        = 3
+      //                  -----
+      //                   132
+   };
+
+   ossimNitfSensraTag();
+   virtual ~ossimNitfSensraTag();
+
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+   
+  // The set methods below taking ossimString args will truncate and
+  // pad with spaces, as necessary, to match enumed size
+   void setRefRow(ossimString refRow);
+   ossimString getRefRow()const;
+   void setRefCol(ossimString refCol);
+   ossimString getRefCol()const;
+   void setSensorModel(ossimString sensorModel);
+   ossimString getSensorModel()const;
+   void setSensorMount(ossimString sensorMount);
+   ossimString getSensorMount()const;
+   void setSensorLoc(ossimString sensorLoc);
+   ossimString getSensorLoc()const;
+   void setSensorAltSrc(ossimString sensorAltSrc);
+   ossimString getSensorAltSrc()const;
+   void setSensorAlt(ossimString sensorAlt);
+   ossimString getSensorAlt()const;
+   void setSensorAltUnit(ossimString sensorAltUnit);
+   ossimString getSensorAltUnit()const;
+   void setSensorAgl(ossimString sensorAgl);
+   ossimString getSensorAgl()const;
+   void setSensorPitch(ossimString sensorPitch);
+   ossimString getSensorPitch()const;
+   void setSensorRoll(ossimString sensorRoll);
+   ossimString getSensorRoll()const;
+   void setSensorYaw(ossimString sensorYaw);
+   ossimString getSensorYaw()const;
+   void setPlatformPitch(ossimString platformPitch);
+   ossimString getPlatformPitch()const;
+   void setPlatformRoll(ossimString platformRoll);
+   ossimString getPlatformRoll()const;
+   void setPlatformHdg(ossimString platformHdg);
+   ossimString getPlatformHdg()const;
+   void setGroundSpdSrc(ossimString groundSpdSrc);
+   ossimString getGroundSpdSrc()const;
+   void setGroundSpeed(ossimString groundSpeed);
+   ossimString getGroundSpeed()const;
+   void setGroundSpdUnit(ossimString groundSpdUnit);
+   ossimString getGroundSpdUnit()const;
+   void setGroundTrack(ossimString groundTrack);
+   ossimString getGroundTrack()const;
+   void setVerticalVel(ossimString verticalVel);
+   ossimString getVerticalVel()const;
+   void setVertVelUnit(ossimString vertVelUnit);
+   ossimString getVertVelUnit()const;
+   void setSwathFrames(ossimString swathFrames);
+   ossimString getSwathFrames()const;
+   void setNSwaths(ossimString nSwaths);
+   ossimString getNSwaths()const;
+   void setSpotNum(ossimString spotNum);
+   ossimString getSpotNum()const;
+
+protected:
+
+   /**
+    * FIELD: REFROW
+    *
+    */
+   char theRefRow[REF_ROW_SIZE+1];
+
+   /**
+    * FIELD: REFCOL
+    *
+    */
+   char theRefCol[REF_COL_SIZE+1];
+
+   /**
+    * FIELD: SENSORMODEL
+    *
+    */
+   char theSensorModel[SENSOR_MODEL_SIZE+1];
+
+   /**
+    * FIELD: SENSORMOUNT
+    *
+    */
+   char theSensorMount[SENSOR_MOUNT_SIZE+1];
+
+   /**
+    * FIELD: SENSORLOC
+    *
+    */
+   char theSensorLoc[SENSOR_LOC_SIZE+1];
+
+   /**
+    * FIELD: SENSORALTSRC
+    *
+    */
+   char theSensorAltSrc[SENSOR_ALT_SRC_SIZE+1];
+
+   /**
+    * FIELD: SENSORALT
+    *
+    */
+   char theSensorAlt[SENSOR_ALT_SIZE+1];
+
+   /**
+    * FIELD: SENSORALTUNIT
+    *
+    */
+   char theSensorAltUnit[SENSOR_ALT_UNIT_SIZE+1];
+
+   /**
+    * FIELD: SENSORAGL
+    *
+    */
+   char theSensorAgl[SENSOR_AGL_SIZE+1];
+
+   /**
+    * FIELD: SENSORPITCH
+    *
+    */
+   char theSensorPitch[SENSOR_PITCH_SIZE+1];
+
+   /**
+    * FIELD: SENSORROLL
+    *
+    */
+   char theSensorRoll[SENSOR_ROLL_SIZE+1];
+
+   /**
+    * FIELD: SENSORYAW
+    *
+    */
+   char theSensorYaw[SENSOR_YAW_SIZE+1];
+
+   /**
+    * FIELD: PLATFORMPITCH
+    *
+    */
+   char thePlatformPitch[PLATFORM_PITCH_SIZE+1];
+
+   /**
+    * FIELD: PLATFORMROLL
+    *
+    */
+   char thePlatformRoll[PLATFORM_ROLL_SIZE+1];
+
+   /**
+    * FIELD: PLATFORMHDG
+    *
+    */
+   char thePlatformHdg[PLATFORM_HDG_SIZE+1];
+
+   /**
+    * FIELD: GROUNDSPDSRC
+    *
+    */
+   char theGroundSpdSrc[GROUND_SPD_SRC_SIZE+1];
+
+   /**
+    * FIELD: GROUNDSPEED
+    *
+    */
+   char theGroundSpeed[GROUND_SPEED_SIZE+1];
+
+   /**
+    * FIELD: GROUNDSPDUNIT
+    *
+    */
+   char theGroundSpdUnit[GROUND_SPD_UNIT_SIZE+1];
+
+   /**
+    * FIELD: GROUNDTRACK
+    *
+    */
+   char theGroundTrack[GROUND_TRACK_SIZE+1];
+
+   /**
+    * FIELD: VERTICALVEL
+    *
+    */
+   char theVerticalVel[VERTICAL_VEL_SIZE+1];
+
+   /**
+    * FIELD: VERTVELUNIT
+    *
+    */
+   char theVertVelUnit[VERT_VEL_UNIT_SIZE+1];
+
+   /**
+    * FIELD: SWATHFRAMES
+    *
+    */
+   char theSwathFrames[SWATH_FRAMES_SIZE+1];
+
+   /**
+    * FIELD: NSWATHS
+    *
+    */
+   char theNSwaths[N_SWATHS_SIZE+1];
+
+   /**
+    * FIELD: SPOTNUM
+    *
+    */
+   char theSpotNum[SPOT_NUM_SIZE+1];
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfStdidcTag.h b/include/ossim/support_data/ossimNitfStdidcTag.h
new file mode 100644
index 0000000..2eb681c
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfStdidcTag.h
@@ -0,0 +1,203 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  Walt Bunch
+// 
+// Description:   NITF support data class for STDIDC - Standard ID extension.
+//
+// See:  STDI-000_v2.1 Table 7-3 for detailed description.
+// 
+//********************************************************************
+// $Id: ossimNitfStdidcTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfStdidcTag_HEADER
+#define ossimNitfStdidcTag_HEADER 1
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfStdidcTag : public ossimNitfRegisteredTag
+{
+public:
+
+   enum
+   {
+      ACQ_DATE_SIZE         = 14,
+      MISSION_SIZE          = 14,
+      PASS_SIZE             = 2,
+      OP_NUM_SIZE           = 3,
+      START_SEGMENT_SIZE    = 2,
+      REPRO_NUM_SIZE        = 2,
+      REPLAY_REGEN_SIZE     = 3,
+      BLANK_FILL_SIZE       = 1,
+      START_COLUMN_SIZE     = 3,
+      START_ROW_SIZE        = 5,
+      END_SEGMENT_SIZE      = 2,
+      END_COLUMN_SIZE       = 3,
+      END_ROW_SIZE          = 5,
+      COUNTRY_SIZE          = 2,
+      WAC_SIZE              = 4,
+      LOCATION_SIZE         = 11,
+      FIELD17_SIZE          = 5,
+      FIELD18_SIZE          = 8
+      //                   -----
+      //                     89 bytes
+   };
+      
+   ossimNitfStdidcTag();
+   virtual ~ossimNitfStdidcTag();
+
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+
+   virtual void clearFields();
+
+  // The set methods below taking ossimString args will truncate and
+  // pad with spaces, as necessary, to match enumed size
+   void setAcqDate(ossimString acqDate);
+   ossimString getAcqDate()const;
+   void setMission(ossimString mission);
+   ossimString getMission()const;
+   void setPass(ossimString pass);
+   ossimString getPass()const;
+   void setOpNum(ossimString opNum);
+   ossimString getOpNum()const;
+   void setStartSegment(ossimString startSegment);
+   ossimString getStartSegment()const;
+   void setReproNum(ossimString reproNum);
+   ossimString getReproNum()const;
+   void setReplayRegen(ossimString replayRegen);
+   ossimString getReplayRegen()const;
+   void setBlankFill(ossimString blankFill);
+   ossimString getBlankFill()const;
+   void setStartColumn(ossimString startColumn);
+   ossimString getStartColumn()const;
+   void setStartRow(ossimString startRow);
+   ossimString getStartRow()const;
+   void setEndSegment(ossimString endSegment);
+   ossimString getEndSegment()const;
+   void setEndColumn(ossimString endColumn);
+   ossimString getEndColumn()const;
+   void setEndRow(ossimString endRow);
+   ossimString getEndRow()const;
+   void setCountry(ossimString country);
+   ossimString getCountry()const;
+   void setWac(ossimString wac);
+   ossimString getWac()const;
+   void setLocation(ossimString location);
+   ossimString getLocation()const;
+   void setField17(ossimString field17);
+   ossimString getField17()const;
+   void setField18(ossimString field18);
+   ossimString getField18()const;
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+
+
+protected:
+
+   /**
+    * FIELD: ACQDATE
+    */
+   char theAcqDate[ACQ_DATE_SIZE+1];
+   
+   /**
+    * FIELD: MISSION
+    */
+   char theMission[MISSION_SIZE+1];
+   
+   /**
+    * FIELD: PASS
+    */
+   char thePass[PASS_SIZE+1];
+   
+   /**
+    * FIELD: OPNUM
+    */
+   char theOpNum[OP_NUM_SIZE+1];
+   
+   /**
+    * FIELD: STARTSEGMENT
+    */
+   char theStartSegment[START_SEGMENT_SIZE+1];
+   
+   /**
+    * FIELD: REPRONUM
+    */
+   char theReproNum[REPRO_NUM_SIZE+1];
+   
+   /**
+    * FIELD: REPLAYREGEN
+    */
+   char theReplayRegen[REPLAY_REGEN_SIZE+1];
+   
+   /**
+    * FIELD: BLANKFILL
+    */
+   char theBlankFill[BLANK_FILL_SIZE+1];
+   
+   /**
+    * FIELD: STARTCOLUMN
+    */
+   char theStartColumn[START_COLUMN_SIZE+1];
+   
+   /**
+    * FIELD: STARTROW
+    */
+   char theStartRow[START_ROW_SIZE+1];
+   
+   /**
+    * FIELD: ENDSEGMENT
+    */
+   char theEndSegment[END_SEGMENT_SIZE+1];
+   
+   /**
+    * FIELD: ENDCOLUMN
+    */
+   char theEndColumn[END_COLUMN_SIZE+1];
+   
+   /**
+    * FIELD: ENDROW
+    */
+   char theEndRow[END_ROW_SIZE+1];
+   
+   /**
+    * FIELD: COUNTRY
+    */
+   char theCountry[COUNTRY_SIZE+1];
+   
+   /**
+    * FIELD: WAC
+    */
+   char theWac[WAC_SIZE+1];
+   
+   /**
+    * FIELD: LOCATION
+    */
+   char theLocation[LOCATION_SIZE+1];
+   
+   /**
+    * FIELD: FIELD17
+    */
+   char theField17[FIELD17_SIZE+1];
+   
+   /**
+    * FIELD: FIELD18
+    */
+   char theField18[FIELD18_SIZE+1];
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfStreobTag.h b/include/ossim/support_data/ossimNitfStreobTag.h
new file mode 100644
index 0000000..ffe0c20
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfStreobTag.h
@@ -0,0 +1,181 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+//
+// Description: STREOB tag class declaration.
+//
+// Dataset Indentification TRE.
+//
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#ifndef ossimNitfStreobTag_HEADER
+#define ossimNitfStreobTag_HEADER 1
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfStreobTag : public ossimNitfRegisteredTag
+{
+public:
+   /** @brief default constructor */
+   ossimNitfStreobTag();
+
+   /** @brief destructor */
+   virtual ~ossimNitfStreobTag();
+
+   /** @brief Method to parse data from stream. */
+   virtual void parseStream(std::istream& in);
+
+   /** @brief Method to write data to stream. */
+   virtual void writeStream(std::ostream& out);
+
+   /** @brief Method to clear all fields including null terminating. */
+   virtual void clearFields();
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;
+   
+protected:
+
+   /**
+    * FIELD: ST_ID
+    * 
+    * 60 byte field string
+    *
+    * alphanumeric
+    *
+    * The image ID of the first stereo mate. The fields ACQUISITION_DATE 
+    * through END_ROW in the STDIDC tag constitute the image ID
+    * 
+    */
+   char m_stdId[61];
+
+   /**
+    * FIELD: N_MATES
+    *
+    * 1 byte integer
+    *
+    * values: 1 to 3
+    *
+    * Number of Stereo Mates. If there are no stereo mates, 
+    * there will not be any STREOB (TBR) extensions in the file. 
+    * If there is a STREOB (TBR) extension, then there will be at 
+    * least 1 stereo mate.
+    */
+   char n_nMates[2];
+
+
+   /**
+    * FIELD: MATE_INSTANCE
+    *
+    * 1 byte integer
+    * 
+    * values: 1 to 3
+    *
+    * Mate Instance identifies which stereo mate is described in 
+    * that extension. For example, this field contains a 2 for 
+    * the second stereo mate.
+    */
+    char m_mateInstance[2];
+
+   /**
+    * FIELD: B_CONV
+    *
+    * 5 byte field in degrees
+    * 
+    * Value: 00.00 to 90.00
+    *
+    * Beginning Convergence Angle defined at the first lines of 
+    * the fore/left and aft/right images, unless those images are 
+    * more than 90 degrees apart. If the images are more than 90 degrees 
+    * apart, the first line of the fore and the last line of the 
+    * aft shall be used.
+    *
+    */
+   char m_bConv[6];
+
+   /**
+    * FIELD: E_CONV
+    *
+    * 5 byte field in degrees
+    * 
+    * Values: 00.00 to 90.00
+    *
+    * Ending Convergence Angle defined at the last lines of the fore/left 
+    * and aft/right images, unless those images are more than 90 degrees apart. 
+    * If the images are more than 90 degrees apart, the last line of the fore and 
+    * the first line of the aft shall be used.
+    */
+   char m_eConv[6];
+
+   /**
+    * FIELD: B_ASYM
+    *
+    * 5 byte field
+    * 
+    * Values: 00.00 to 90.00
+    * 
+    * Beginning Asymmetry Angle defined at the first lines of the fore/left and 
+    * aft/right images, unless those images are more than 90 degrees apart. 
+    * If the images are more than 90 degrees apart, the first line of 
+    * the fore and the last line of the aft shall be used.
+    */
+   char m_bAsym[6];
+
+   /**
+    * FIELD: E_ASYM
+    *
+    * 5 byte field 
+    * 
+    * Values: 00.00 to 90.00
+    * 
+    * Ending Asymmetry Angle defined at the last lines of the fore/left and aft/right 
+    * images, unless those images are more than 90 degrees apart. If the 
+    * images are more than 90 degrees apart, the last line of the fore and 
+    * the first line of the aft shall be used.
+    */
+   char m_eAsym[6];
+
+   /**
+    * FIELD: B_BIE
+    * 
+    * 6 byte field 
+    *
+    * Values: +- 90.00
+    *
+    * Beginning BIE less Convergence Angle of Stereo Mate, defined at the first 
+    * lines of the fore/left and aft/right images, unless those images are 
+    * more than 90 degrees apart. If the images are more than 90 degrees apart,
+    * the first line of the fore and the last line of the aft shall be used.
+    */
+   char m_bBie[7];
+
+   /**
+    * FIELD: E_BIE
+    *
+    * 6 byte field 
+    *
+    * Values: +- 90.00
+    * 
+    * Ending BIE less Convergence Angle of Stereo Mate, 
+    * defined at the last lines of the fore/left and aft/right images, 
+    * unless those images are more than 90 degrees apart. 
+    * If the images are more than 90 degrees apart, the last 
+    * line of the fore and the first line of the aft shall be used.
+    */
+   char m_eBie[7];
+
+   
+TYPE_DATA   
+};
+
+#endif /* matches #ifndef ossimNitfStreobTag_HEADER */
diff --git a/ossim/include/ossim/support_data/ossimNitfSymbolHeader.h b/include/ossim/support_data/ossimNitfSymbolHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfSymbolHeader.h
rename to include/ossim/support_data/ossimNitfSymbolHeader.h
diff --git a/ossim/include/ossim/support_data/ossimNitfSymbolHeaderV2_0.h b/include/ossim/support_data/ossimNitfSymbolHeaderV2_0.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfSymbolHeaderV2_0.h
rename to include/ossim/support_data/ossimNitfSymbolHeaderV2_0.h
diff --git a/ossim/include/ossim/support_data/ossimNitfTagFactory.h b/include/ossim/support_data/ossimNitfTagFactory.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfTagFactory.h
rename to include/ossim/support_data/ossimNitfTagFactory.h
diff --git a/ossim/include/ossim/support_data/ossimNitfTagFactoryRegistry.h b/include/ossim/support_data/ossimNitfTagFactoryRegistry.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfTagFactoryRegistry.h
rename to include/ossim/support_data/ossimNitfTagFactoryRegistry.h
diff --git a/include/ossim/support_data/ossimNitfTagInformation.h b/include/ossim/support_data/ossimNitfTagInformation.h
new file mode 100644
index 0000000..428ee23
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfTagInformation.h
@@ -0,0 +1,101 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimNitfTagInformation_HEADER
+#define ossimNitfTagInformation_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class ossimString;
+
+class OSSIMDLLEXPORT ossimNitfTagInformation : public ossimObject
+{
+public:
+   ossimNitfTagInformation(ossimRefPtr<ossimNitfRegisteredTag> tagData = 0);
+   virtual ~ossimNitfTagInformation();
+   
+   virtual void parseStream(ossim::istream& in);
+   virtual void writeStream(ossim::ostream& out);
+
+   void setTagName(const ossimString& tagName);
+   void setTagLength(ossim_uint32 tagLength);
+
+   /**
+    * Length of the 5 byte tag length the 6 byte tag name and
+    * the data length.
+    * So we have Data length + 11 bytes.
+    */
+   ossim_uint32 getTotalTagLength()const;
+
+   /**
+    * Should return the value of theTagLength which is the length of
+    * the data in bytes.
+    */
+   ossim_uint32 getTagLength()const;
+   ossim_uint64 getTagOffset()const;
+   ossim_uint64 getTagDataOffset()const;
+   
+   ossimString   getTagName()const;
+   virtual std::ostream& print(std::ostream& out)const;
+   void clearFields();
+   
+   ossimRefPtr<ossimNitfRegisteredTag> getTagData();
+   const ossimRefPtr<ossimNitfRegisteredTag> getTagData()const;
+   void setTagData(ossimRefPtr<ossimNitfRegisteredTag> tagData);
+   ossimString getTagType() const;
+   void setTagType(const ossimString& tagType) const;
+
+   bool operator<(const ossimNitfTagInformation& rhs) const
+   {
+      return getTotalTagLength() < rhs.getTotalTagLength();
+   }
+   
+private:
+
+   /**
+    * This is a 6 byte field
+    */
+   char          theTagName[7];
+
+   /**
+    * This is a 5 byte field
+    */
+   char           theTagLength[6];
+
+   /**
+    * This is a 6 byte field which should be UDHD, UDID, XHD, IXSHD, SXSHD, or TXSHD.
+    * This is declared as mutable since changing the tag type doesn't change the contents of the tag.
+    */
+   mutable char theTagType[7];
+
+   /**
+    * This will hold the offset to the start of the above information
+    * This is just a work variable.
+    */
+   ossim_uint64 theTagOffset;
+
+   /**
+    * This will hold the start to the data.  This is just the
+    * position in the file just past the tag length field.
+    * This is just a work variable
+    */
+   ossim_uint64 theTagDataOffset;
+
+   /**
+    * Used to hold the tag data.
+    */
+   ossimRefPtr<ossimNitfRegisteredTag> theTagData;
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfTextHeader.h b/include/ossim/support_data/ossimNitfTextHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfTextHeader.h
rename to include/ossim/support_data/ossimNitfTextHeader.h
diff --git a/ossim/include/ossim/support_data/ossimNitfTextHeaderV2_0.h b/include/ossim/support_data/ossimNitfTextHeaderV2_0.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfTextHeaderV2_0.h
rename to include/ossim/support_data/ossimNitfTextHeaderV2_0.h
diff --git a/ossim/include/ossim/support_data/ossimNitfTextHeaderV2_1.h b/include/ossim/support_data/ossimNitfTextHeaderV2_1.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNitfTextHeaderV2_1.h
rename to include/ossim/support_data/ossimNitfTextHeaderV2_1.h
diff --git a/include/ossim/support_data/ossimNitfUnknownTag.h b/include/ossim/support_data/ossimNitfUnknownTag.h
new file mode 100644
index 0000000..1ea6504
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfUnknownTag.h
@@ -0,0 +1,84 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Unknown tag class declaration.
+//
+// Note: By "unknown" this means that the tag name was not found in any of
+// the tag factories.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfUnknownTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfUnknownTag_HEADER
+#define ossimNitfUnknownTag_HEADER 1
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfUnknownTag : public ossimNitfRegisteredTag
+{
+public:
+   /** default constructor */
+   ossimNitfUnknownTag();
+
+   /** destructor */
+   virtual ~ossimNitfUnknownTag();
+  
+   /**
+    * Parse method.
+    *
+    * @param in Stream to parse.  This will read the entire tag length into
+    * an array.
+    */
+   virtual void parseStream(std::istream& in);
+   
+   /**
+    * Write method.
+    *
+    * @param out Stream to write to.
+    */
+   virtual void writeStream(std::ostream& out);
+   
+   /**
+    * Clears all string fields within the record to some default nothingness.
+    */
+   virtual void clearFields();
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+
+   /**
+    * @param length Length of tag.
+    *
+    * @note The tag length must be set prior to calling "parseStream".
+    *
+    * @note Since you must have a length to read theTagData, if theTagData
+    * exist it will be deleted by this method.
+    * Subsequent "parseStream" calls will allocate theTagData as needed.
+    */
+   virtual void setTagLength(ossim_uint32 length);
+   
+protected:
+
+   /**
+    * @return true if all characters in theTagData are printable.
+    */
+   bool tagDataIsAscii() const;
+   bool tagDataIsXml() const;
+
+   /**
+    * Holds entire tag data(theTagLength) plus one byte for null terminator.
+    */
+   char* m_tagData;
+   
+TYPE_DATA   
+};
+
+#endif /* End of "#ifndef ossimNitfUnknownTag_HEADER" */
diff --git a/include/ossim/support_data/ossimNitfUse00aTag.h b/include/ossim/support_data/ossimNitfUse00aTag.h
new file mode 100644
index 0000000..cdbcfb9
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfUse00aTag.h
@@ -0,0 +1,282 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Walt Bunch
+//
+// Description: Nitf support class for USE00A -
+// Exploitation Usability extension.
+// 
+//********************************************************************
+// $Id: ossimNitfUse00aTag.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimNitfUse00aTag_HEADER
+#define ossimNitfUse00aTag_HEADER
+
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+class OSSIM_DLL ossimNitfUse00aTag : public ossimNitfRegisteredTag
+{
+public:
+   
+   enum
+   {
+      ANGLE_TO_NORTH_SIZE  = 3,
+      MEAN_GSD_SIZE        = 5,
+      FIELD3_SIZE          = 1,
+      DYNAMIC_RANGE_SIZE   = 5,
+      FIELD5_SIZE          = 3,
+      FIELD6_SIZE          = 1,
+      FIELD7_SIZE          = 3,
+      OBL_ANG_SIZE         = 5,
+      ROLL_ANG_SIZE        = 6,
+      FIELD10_SIZE         = 12,
+      FIELD11_SIZE         = 15,
+      FIELD12_SIZE         = 4,
+      FIELD13_SIZE         = 1,
+      FIELD14_SIZE         = 3,
+      FIELD15_SIZE         = 1,
+      FIELD16_SIZE         = 1,
+      N_REF_SIZE           = 2,
+      REV_NUM_SIZE         = 5,
+      N_SEG_SIZE           = 3,
+      MAX_LP_SEG_SIZE      = 6,
+      FIELD20_SIZE         = 6,
+      FIELD21_SIZE         = 6,
+      SUN_EL_SIZE          = 5,
+      SUN_AZ_SIZE          = 5
+      //                  -----
+      //                  107 bytes
+   };
+   
+   ossimNitfUse00aTag();
+   virtual ~ossimNitfUse00aTag();
+
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+
+   virtual void clearFields();
+   
+  // The set methods below taking ossimString args will truncate and
+  // pad with spaces, as necessary, to match enumed size
+   void setAngleToNorth(const ossimString& angleToNorth);
+   ossimString getAngleToNorth()const;
+   void setMeanGsd(const ossimString& meanGsd);
+   ossimString getMeanGsd()const;
+
+   /**
+    * @return MEANGSD field as a double converted to meters.
+    *
+    * @note Conversion used: gsd_in_meters = gsd / 12.0 * MTRS_PER_FT
+    */
+   ossim_float64 getMeanGsdInMeters() const;
+
+   void setField3(const ossimString& field3);
+   ossimString getField3()const;
+   void setDynamicRange(const ossimString& dynamicRange);
+   ossimString getDynamicRange()const;
+   void setField5(const ossimString& field5);
+   ossimString getField5()const;
+   void setField6(const ossimString& field6);
+   ossimString getField6()const;
+   void setField7(const ossimString& field7);
+   ossimString getField7()const;
+   void setOblAng(const ossimString& oblAng);
+   ossimString getOblAng()const;
+   void setRollAng(const ossimString& rollAng);
+   ossimString getRollAng()const;
+   void setField10(const ossimString& field10);
+   ossimString getField10()const;
+   void setField11(const ossimString& field11);
+   ossimString getField11()const;
+   void setField12(const ossimString& field12);
+   ossimString getField12()const;
+   void setField13(const ossimString& field13);
+   ossimString getField13()const;
+   void setField14(const ossimString& field14);
+   ossimString getField14()const;
+   void setField15(const ossimString& field15);
+   ossimString getField15()const;
+   void setField16(const ossimString& field16);
+   ossimString getField16()const;
+   void setNRef(const ossimString& nRef);
+   ossimString getNRef()const;
+   void setRevNum(const ossimString& revNum);
+   ossimString getRevNum()const;
+   void setNSeg(const ossimString& nSeg);
+   ossimString getNSeg()const;
+   void setMaxLpSeg(const ossimString& maxLpSeg);
+   ossimString getMaxLpSeg()const;
+   void setField20(const ossimString& field20);
+   ossimString getField20()const;
+   void setField21(const ossimString& field21);
+   ossimString getField21()const;
+   void setSunEl(const ossimString& sunEl);
+   ossimString getSunEl()const;
+   void setSunAz(const ossimString& sunAz);
+   ossimString getSunAz()const;
+
+   /**
+    * @brief Print method that outputs a key/value type format
+    * adding prefix to keys.
+    * @param out Stream to output to.
+    * @param prefix Prefix added to key like "image0.";
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   
+   virtual void setProperty(ossimRefPtr<ossimProperty> property);
+   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
+   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
+   
+protected:
+   
+   /**
+    * FIELD: ANGLETONORTH
+    *
+    */
+   char theAngleToNorth[ANGLE_TO_NORTH_SIZE+1];
+   
+   /**
+    * FIELD: MEANGSD
+    *
+    */
+   char theMeanGsd[MEAN_GSD_SIZE+1];
+   
+   /**
+    * FIELD: FIELD3
+    *
+    */
+   char theField3[FIELD3_SIZE+1];
+
+   /**
+    * FIELD: DYNAMICRANGE
+    *
+    */
+   char theDynamicRange[DYNAMIC_RANGE_SIZE+1];
+
+   /**
+    * FIELD: FIELD5
+    *
+    */
+   char theField5[FIELD5_SIZE+1];
+
+   /**
+    * FIELD: FIELD6
+    *
+    */
+   char theField6[FIELD6_SIZE+1];
+
+   /**
+    * FIELD: FIELD7
+    *
+    */
+   char theField7[FIELD7_SIZE+1];
+
+   /**
+    * FIELD: OBLANG
+    *
+    */
+   char theOblAng[OBL_ANG_SIZE+1];
+
+   /**
+    * FIELD: ROLLANG
+    *
+    */
+   char theRollAng[ROLL_ANG_SIZE+1];
+
+   /**
+    * FIELD: FIELD10
+    *
+    */
+   char theField10[FIELD10_SIZE+1];
+
+   /**
+    * FIELD: FIELD11
+    *
+    */
+   char theField11[FIELD11_SIZE+1];
+
+   /**
+    * FIELD: FIELD12
+    *
+    */
+   char theField12[FIELD12_SIZE+1];
+
+   /**
+    * FIELD: FIELD13
+    *
+    */
+   char theField13[FIELD13_SIZE+1];
+
+   /**
+    * FIELD: FIELD14
+    *
+    */
+   char theField14[FIELD14_SIZE+1];
+
+   /**
+    * FIELD: FIELD15
+    *
+    */
+   char theField15[FIELD15_SIZE+1];
+
+   /**
+    * FIELD: FIELD16
+    *
+    */
+   char theField16[FIELD16_SIZE+1];
+
+   /**
+    * FIELD: NREF
+    *
+    */
+   char theNRef[N_REF_SIZE+1];
+
+   /**
+    * FIELD: REVNUM
+    *
+    */
+   char theRevNum[REV_NUM_SIZE+1];
+
+   /**
+    * FIELD: NSEG
+    *
+    */
+   char theNSeg[N_SEG_SIZE+1];
+
+   /**
+    * FIELD: MAXLPSEG
+    *
+    */
+   char theMaxLpSeg[MAX_LP_SEG_SIZE+1];
+
+   /**
+    * FIELD: FIELD20
+    *
+    */
+   char theField20[FIELD20_SIZE+1];
+
+   /**
+    * FIELD: FIELD21
+    *
+    */
+   char theField21[FIELD21_SIZE+1];
+
+   /**
+    * FIELD: SUNEL
+    *
+    */
+   char theSunEl[SUN_EL_SIZE+1];
+
+   /**
+    * FIELD: SUNAZ
+    *
+    */
+   char theSunAz[SUN_AZ_SIZE+1];
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfVqCompressionHeader.h b/include/ossim/support_data/ossimNitfVqCompressionHeader.h
new file mode 100644
index 0000000..da09281
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfVqCompressionHeader.h
@@ -0,0 +1,79 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts
+//
+// LICENSE: LGPL see top level LICENSE.txt for more details
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfVqCompressionHeader.h 18413 2010-11-11 19:56:22Z gpotts $
+#ifndef ossimNitfVqCompressionHeader_HEADER
+#define ossimNitfVqCompressionHeader_HEADER
+
+#include <vector>
+#include <ossim/support_data/ossimNitfCompressionHeader.h>
+
+class OSSIM_DLL ossimNitfVqCompressionOffsetTableData
+{
+public:
+
+   ossimNitfVqCompressionOffsetTableData();
+   ossimNitfVqCompressionOffsetTableData(const ossimNitfVqCompressionOffsetTableData& rhs);
+   ~ossimNitfVqCompressionOffsetTableData();
+   const ossimNitfVqCompressionOffsetTableData& operator =(const ossimNitfVqCompressionOffsetTableData& rhs);
+   ossim_uint32 getDataLengthInBytes()const;
+   void clearFields();
+   void parseStream(std::istream& in);
+   
+   ossim_uint16 theTableId;
+   ossim_uint32 theNumberOfCompressionLookupRecords;
+   ossim_uint16 theNumberOfValuesPerCompressionLookup;
+   ossim_uint16 theCompressionLookupValueBitLength;
+   ossim_uint32 theCompressionLookupTableOffset;
+   ossim_uint8* theData;
+};
+
+class OSSIM_DLL ossimNitfVqCompressionHeader : public ossimNitfCompressionHeader
+{
+public:
+   ossimNitfVqCompressionHeader();
+   virtual void parseStream(std::istream &in);
+
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    */
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix) const;  
+
+   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
+   virtual ossim_uint32 getBlockSizeInBytes()const;
+   virtual ossim_uint32 getNumberOfImageRows()const;
+   virtual ossim_uint32 getNumberOfImageCodesPerRow()const;
+   virtual ossim_uint32 getCompressionAlgorithmId()const;
+   virtual ossim_uint32 getImageCodeBitLength()const;
+   virtual ossim_uint32 getNumberOfTables()const;
+   const std::vector<ossimNitfVqCompressionOffsetTableData>& getTable()const;
+   
+protected:
+   ossim_uint32 theNumberOfImageRows;
+   ossim_uint32 theNumberOfImageCodesPerRow;
+   ossim_uint8  theImageCodeBitLength;
+
+   ossim_uint16 theCompressionAlgorithmId;
+   ossim_uint16 theNumberOfCompressionLookupOffsetRecords;
+   ossim_uint16 theNumberOfCompressionParameterOffsetRecords;
+
+   ossim_uint32 theCompressionLookupOffsetTableOffset;
+   ossim_uint16 theCompressionLookupTableOffsetRecordLength;
+
+   std::vector<ossimNitfVqCompressionOffsetTableData> theTable;
+   void clearFields();
+
+TYPE_DATA   
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimNitfXmlDataContentDes.h b/include/ossim/support_data/ossimNitfXmlDataContentDes.h
new file mode 100644
index 0000000..1915f41
--- /dev/null
+++ b/include/ossim/support_data/ossimNitfXmlDataContentDes.h
@@ -0,0 +1,64 @@
+#include <ossim/support_data/ossimNitfRegisteredDes.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/base/ossimXmlNode.h>
+
+class OSSIM_DLL ossimNitfXmlDataContentDes : public ossimNitfRegisteredDes
+{
+public:
+   enum
+   {
+      DESSHL_SIZE = 4,
+      DESCRC_SIZE = 5,
+      DESSHFT_SIZE = 8,
+      DESSHDT_SIZE = 20,
+      DESSHRP_SIZE = 40,
+      DESSHSI_SIZE = 60,
+      DESSHSV_SIZE = 10,
+      DESSHSD_SIZE = 20,
+      DESSHTN_SIZE = 120
+   };
+   ossimNitfXmlDataContentDes();
+
+   virtual void parseStream(std::istream& in);
+   virtual void writeStream(std::ostream& out);
+
+   virtual std::ostream& print(std::ostream& out,
+                               const std::string& prefix=std::string()) const;
+   virtual void clearFields();
+   bool loadState(const ossimKeywordlist& kwl, const char* prefix);
+   bool loadValueFromXml(const ossimRefPtr<ossimXmlDocument>, const ossimString& xpath, ossimString& target) const;
+
+   ossimString getDesshl() const;
+   ossim_uint32 getDesshlAsUint32() const;
+
+   ossimString getDescrc() const;
+
+   ossimString getDesshft() const;
+
+   ossimString getDesshdt() const;
+
+   ossimString getDesshrp() const;
+
+   ossimString getDesshsi() const;
+
+   ossimString getDesshsv() const;
+
+   ossimString getDesshsd() const;
+
+   ossimString getDesshtn() const;
+
+
+protected:
+   char m_desshl[DESSHL_SIZE+1];
+   char m_descrc[DESCRC_SIZE+1];
+   char m_desshft[DESSHFT_SIZE+1];
+   char m_desshdt[DESSHDT_SIZE+1];
+   char m_desshrp[DESSHRP_SIZE+1];
+   char m_desshsi[DESSHSI_SIZE+1];
+   char m_desshsv[DESSHSV_SIZE+1];
+   char m_desshsd[DESSHSD_SIZE+1];
+   char m_desshtn[DESSHTN_SIZE+1];
+
+   ossimString m_xmlString;
+   ossimRefPtr<ossimXmlDocument> m_xmlDocument;
+};
diff --git a/include/ossim/support_data/ossimNmeaMessage.h b/include/ossim/support_data/ossimNmeaMessage.h
new file mode 100644
index 0000000..51223a6
--- /dev/null
+++ b/include/ossim/support_data/ossimNmeaMessage.h
@@ -0,0 +1,86 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL See top level LICENSE.txt file.
+//
+// File: ossimNmeaMessage.h
+//
+// Author:  Garrett Potts
+//
+// Description: Contains a general parser for NMEA messages.
+//
+//
+// $Id$
+//----------------------------------------------------------------------------
+#ifndef ossimNmeaMessage_HEADER
+#define ossimNmeaMessage_HEADER
+
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimException.h>
+#include <iostream>
+#include <algorithm>
+#include <vector>
+
+
+class OSSIM_DLL ossimNmeaMessage : public ossimReferenced
+{
+public:
+   typedef std::vector<ossimString> FieldListType;
+   
+   ossimNmeaMessage(const std::string& acceptedStartingCharacters="!$"):m_startChars(acceptedStartingCharacters){}
+   
+   /**
+    * Parses a standard formatted NMEA message.  No exceptions are created for checksums.  The checksum needs
+    * to be checked after parsing by calling validCheckSum().
+    */
+   virtual void parseMessage(std::istream& in)throw(ossimException);
+   
+   virtual bool valid()const{return validCheckSum();}
+   bool validCheckSum()const{return m_validCheckSum;}
+   
+   
+   ossim_uint32 numberOfFields()const{return m_fields.size();}
+   
+   const std::string& getField(ossim_uint32 idx)
+   {
+      static ossimString empty="";
+      
+      if(idx < m_fields.size()) return m_fields[idx];
+      
+      return empty;
+   }
+   const std::string& operator [](int idx)const
+   {
+      static ossimString empty="";
+      
+      if ( idx < static_cast<int>( m_fields.size() ) ) return m_fields[idx];
+      
+      return empty;
+   }
+   void setStartChars(const std::string& acceptedStartingCharacters="!$"){m_startChars = acceptedStartingCharacters;}
+   
+   virtual void reset()
+   {
+      m_fields.clear();
+      m_message = "";
+      m_validCheckSum = false;
+   }
+   const std::string& message()const{return m_message;}
+   
+   static ossim_uint32 checksum(std::string::const_iterator start, std::string::const_iterator end);
+   
+protected:
+   virtual void setFields(std::string::const_iterator start, std::string::const_iterator end);
+   
+   bool isValidStartChar(char c)const;
+   
+   std::string m_message;
+   FieldListType m_fields;
+   
+   bool m_validCheckSum;
+   std::string m_startChars;
+};
+
+#endif
+
diff --git a/ossim/include/ossim/support_data/ossimNmeaMessageSequencer.h b/include/ossim/support_data/ossimNmeaMessageSequencer.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimNmeaMessageSequencer.h
rename to include/ossim/support_data/ossimNmeaMessageSequencer.h
diff --git a/ossim/include/ossim/support_data/ossimPpjFrameSensorFile.h b/include/ossim/support_data/ossimPpjFrameSensorFile.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimPpjFrameSensorFile.h
rename to include/ossim/support_data/ossimPpjFrameSensorFile.h
diff --git a/include/ossim/support_data/ossimQuickbirdMetaData.h b/include/ossim/support_data/ossimQuickbirdMetaData.h
new file mode 100644
index 0000000..bafe186
--- /dev/null
+++ b/include/ossim/support_data/ossimQuickbirdMetaData.h
@@ -0,0 +1,132 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Class declaration for ossimQuickbirdMetaData.
+// 
+// This class parses a Space Imaging Quickbird meta data file.
+//
+//********************************************************************
+// $Id: ossimQuickbirdMetaData.h 14412 2009-04-27 16:58:46Z dburken $
+
+#ifndef ossimQuickbirdMetaData_HEADER
+#define ossimQuickbirdMetaData_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimString.h>
+
+#include <iosfwd>
+
+class ossimFilename;
+class ossimKeywordlist;
+
+class OSSIMDLLEXPORT ossimQuickbirdMetaData : public ossimObject
+{
+public:
+
+   /** @brief default constructor */
+   ossimQuickbirdMetaData();
+
+   /** virtual destructor */
+   virtual ~ossimQuickbirdMetaData();
+
+   /**
+    * @brief Open method that takes the image file, derives the metadata,
+    * header and rpc files, then calls parse methods parseMetaData,
+    * parseHdrData, and parseRpcData.
+    *
+    * @param imageFile Usually in the form of "po_2619900_pan_0000000.tif".
+    *
+    * @return true on success, false on error.
+    */
+   bool open(const ossimFilename& imageFile);
+
+   void clearFields();
+
+   //---
+   // Convenient method to print important image info:
+   //---
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * Method to save the state of the object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix = 0) const;
+   
+   /**
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix = 0);
+
+   /**
+    * @brief Method to parse Quickbird metadata file.
+    *
+    * @param metadata File name usually in the form of
+    * ".IMD."
+    *
+    * @return true on success, false on error.
+    */
+   bool parseMetaData(const ossimFilename& metadata);
+
+   /**
+    * @brief Method to parse Quickbird rpc file.
+    *
+    * @param metadata File name usually in the form of
+    * ".GEO.txt"
+    *
+    * @return true on success, false on error.
+    *
+    * @note Currently NOT implemented.
+    */
+   bool parseGEOData(const ossimFilename& data_file);
+
+   bool parseATTData(const ossimFilename& data_file);
+
+   bool parseEPHData(const ossimFilename& data_file);
+
+   /** @return theSatID */
+   ossimString getSatID() const;
+
+   bool getEndOfLine( char * fileBuf,
+                      ossimString lineBeginning,
+                      const char * format,
+                      ossimString & name );
+
+   const ossimIpt& getImageSize() const;
+
+   bool getMapProjectionKwl( const ossimFilename& imd_file,
+                             ossimKeywordlist& kwl );
+
+/*****************************************
+*parseATTData EPH GEO IMD RPB TIL
+*
+****************************************/
+   
+private:
+
+   ossimString         theGenerationDate;
+   ossimString         theBandId;
+   int                 theBitsPerPixel;	
+   ossimString         theSatID;
+   ossimString         theTLCDate;
+   ossim_float64       theSunAzimuth;
+   ossim_float64       theSunElevation;
+   ossim_float64       theSatAzimuth;
+   ossim_float64       theSatElevation;
+   int                 theTDILevel;
+   std::vector<double> theAbsCalFactors;
+   ossimString         theBandNameList;
+   ossimIpt            theImageSize;
+
+TYPE_DATA
+};
+
+#endif /* #ifndef ossimQuickbirdMetaData_HEADER */
diff --git a/ossim/include/ossim/support_data/ossimQuickbirdRpcHeader.h b/include/ossim/support_data/ossimQuickbirdRpcHeader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimQuickbirdRpcHeader.h
rename to include/ossim/support_data/ossimQuickbirdRpcHeader.h
diff --git a/ossim/include/ossim/support_data/ossimQuickbirdTile.h b/include/ossim/support_data/ossimQuickbirdTile.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimQuickbirdTile.h
rename to include/ossim/support_data/ossimQuickbirdTile.h
diff --git a/include/ossim/support_data/ossimRpfAttributeOffsetRecord.h b/include/ossim/support_data/ossimRpfAttributeOffsetRecord.h
new file mode 100644
index 0000000..d14a272
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfAttributeOffsetRecord.h
@@ -0,0 +1,274 @@
+#ifndef ossimRpfAttributeOffsetRecord_HEADER
+#define ossimRpfAttributeOffsetRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfAttributeOffsetRecord
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimRpfAttributeOffsetRecord& data);
+
+   ossimRpfAttributeOffsetRecord();
+   virtual ~ossimRpfAttributeOffsetRecord(){}
+
+   ossimErrorCode parseStream(ossim::istream& in, ossimByteOrder byteOrder);
+   void print(std::ostream& out)const;
+   ossim_uint16  getAttributeId()const{return theAttributeId;}
+   ossim_uint8   getParamterId()const{return theParameterId;}
+   ossim_uint32  getAttributeRecordOffset()const{return theAttributeRecordOffset;}
+   
+private:
+   void clearFields();
+   /*!
+    * The attribute Id.  The Id and descriptions are taken from
+    * MIL-STD-2411-1 and can have one of the following values:
+    *
+    * ID     Description
+    * _________________________________________________________________
+    * 1      Currency Date, 1 parameter:
+    *          1. Date of most recent revision to the RPF
+    *             YYYYMMDD
+    *             8 byte ascii value
+    *
+    * 2      Production Date, 1 parameter:
+    *          1. Date the source data was transformed to RPF format
+    *             YYYYMMDD
+    *             8 byte ascii value
+    *  
+    * 3      Significant Date, 1 parameter:
+    *          1. Most accurately describes the date of
+    *             the source data.
+    *             YYYYMMDD
+    *             8 byte ascii value
+    *
+    * 4      Map/Chart source, 4 parameters:
+    *          1. Short title for the id of a group of
+    *             products.  ex: JOG 1501A ...
+    *             10 byte ascii value
+    *          2. The designation of the hardcopy source
+    *             8 byte ascii value
+    *          3. Old horizontal datum code.  Original
+    *             horizontal datum of the hardcopy product
+    *             4 byte ascii value
+    *          4. Edition number of the source graphic
+    *             7 byte ascii value.
+    *
+    * 5      Projection Systemd, 5 parameters: p. 38 of MIL-STD-2411-1
+    *          1. Projection Code. 2 byte ascii value
+    *             AC    Albers Equal area
+    *                   Requires Parameters A B C D
+    *             AL    Azimuthal Equal Dist.
+    *                   Requires Parameters A B
+    *             RB    Hotline Oblique Mercator
+    *                   Requires Parameters A B C 
+    *             LE    Lambert Conformal Conic
+    *                   Requires Parameters A B C D
+    *             MC    Mercator
+    *                   Requires Parameters A B
+    *             OC    Oblique Mercator
+    *                   Requires Parameters A B C
+    *             OD    Orthographic
+    *                   Requires Parameters A B
+    *             PG    Polar Stereo-graphic
+    *                   Requires Parameters A B C D
+    *             PH    Poly conic
+    *                   Requires Parameters A B
+    *             TC    Transverse Mercator
+    *                   Requires Parameters A B C
+    *             UT    Universal Transverse Mercator
+    *                   Requires Parameters A
+    *          2. Projection Param A: real 4 byte value
+    *          3. Projeciton Param B: real 4 byte value
+    *          4. Projection Param C: real 4 byte value
+    *          5. Projection Param D: real 4 byte value
+    * 6      Vertical Datum (1 parameter) p. 37 MIL-STD-2411-1
+    *         4 byte ascii
+    *
+    *          MSL     Mean Sea Level.  All elevations in th data set
+    *                  are referenced to the geoid of the specified datum
+    *          GEOD    Geodetic (All elevations in the data set
+    *                  are referenced to the ellipsoid of the specified
+    *                  datum
+    * 7      Horizontal Datum (1 parameter)
+    *        4 byte ascii
+    *
+    *            Look on p.33 of MIL-STD-2411-1.  Too big to list
+    *            we will need a translation table for these
+    *            codes
+    * 8      Vertical Absolute Accurracy (2 parameters)
+    *        1. vertical absolute accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    *
+    * 9      Horizontal Absolute Accuracy (2 parameters)
+    *        1. Horizontal absolute accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    *
+    * 10     Vertical Relative Accuracy (2 parameters)
+    *        1. Vertical relative accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    *
+    * 11     Horizontal Relative Accuracy (2 parameters)
+    *        1. Horizontal relative accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    *
+    * 12     Ellipsoid, 1 parameter:
+    *        1. Ellipsoid code.  3 byte ascii
+    *           See p. 40 of MIL-STD-2411-1
+    * 13     Sounding Datumm, 1 parameter: 4 byte ascii
+    *        See p. 33 MIL-STD-2411-1 5.3.2.2
+    * 14     Navigation System, 1 parameter: 
+    *        1. Navigation code. 2 byte unsigned int
+    *           See MIL-STD-2411-1 5.3.2.4
+    * 15     Grid, 1 parameter:
+    *        1. Grid code. 2 byte ascii
+    *           See MIL-STD-2411-1 5.3.2.7
+    * 16     Easterly Annual Magnetic Change, 2 parameters:
+    *        1. Easterly annual magnetic change. 4 byte real
+    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
+    * 17     Westerly Annual Magnetic Change, 2 parameters:
+    *        1. Westerly annual magnetic change. 4 byte real
+    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
+    * 18     Grid North Magnetic North ANgle, 2 paramters:
+    *        1. Grid North - Magnetic North.  4 byte real
+    *        2. Units of angle. 2 byte unsigned int
+    *           see 5.3.2.6
+    * 19     Grid convergence angle, 2 parameters:
+    *        1. Grid convergence angle.  4 byte Real
+    *        2. Units of angle. 2 byte unsigned int 5.3.2.6
+    * 20     Highest known elevation (4 parameters)
+    *        1. Highest known elevation: 8 byte real
+    *        2. Units of elevation: See 5.3.2.6 of MIL-STD-2411-1
+    *        3. Lat of elevation: 8 byte real in decimal degrees
+    *        4. Lon of elevation: 8 byte real in decimal degrees
+    * 21     Multiple legend, 1 paraemter:
+    *        1. Name of legend file that applies to this
+    *           12 byte ascii
+    * 22     Image source, 2 parameters:
+    *        1. Source of data from which this
+    *           RPF was derived. ex: SPOT. Landsat7, Landsat4.
+    *           for CDTED: "imagery, "carto"
+    *           12 byte ascii
+    *        2. GSD.  Ground sample or post distance.
+    *           4 byte unsigned int
+    * 23     Data Level, 1 parameter:
+    *        1. The level of the source.  For example:
+    *           if this is a DTED or CDTED it would
+    *           distinguish between level 1 and 2
+    */
+   ossim_uint16 theAttributeId;
+
+   /*!
+    * This defines which parameter number for theAttrributeId
+    */
+   ossim_uint8  theParameterId;
+
+   /*!
+    * This is a 1 byte field.  If the value is 0 then
+    * the attribute applies to the entire geographic coverage
+    * of this frame.  If it's > 0 then the areal coverage
+    * where the given attribute applies is defined in the corresponding
+    * explicit areal coverage record in the explicit areal
+    * coverage table.
+    */
+    ossim_uint8 theArealCoverageSequenceNumber;
+
+   /*!
+    * a 4-byte unsigned integer.  displacement in bytes measured
+    * from the beginning of the [attribute subsection] and the first
+    * byte of the [attribute record].
+    */
+   ossim_uint32 theAttributeRecordOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfAttributeSectionSubheader.h b/include/ossim/support_data/ossimRpfAttributeSectionSubheader.h
new file mode 100644
index 0000000..bd818c2
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfAttributeSectionSubheader.h
@@ -0,0 +1,53 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimRpfAttributeSectionSubheader_HEADER
+#define ossimRpfAttributeSectionSubheader_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimErrorContext.h>
+
+class ossimRpfAttributeSectionSubheader
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimRpfAttributeSectionSubheader& data);
+   ossimRpfAttributeSectionSubheader();
+
+   virtual ~ossimRpfAttributeSectionSubheader(){}
+   ossimErrorCode parseStream(ossim::istream& in, ossimByteOrder byteOrder);
+   virtual void print(std::ostream& out)const;
+   ossim_uint16 getNumberOfAttributeOffsetRecords()const
+      {
+         return theNumberOfAttributeOffsetRecords;
+      }
+   ossim_uint16 getAttributeOffsetTableOffset()const
+      {
+         return theAttributeOffsetTableOffset;
+      }
+
+   ossim_uint64 getSubheaderStart()const;
+   ossim_uint64 getSubheaderEnd()const;
+   
+private:
+   void clearFields();
+   
+   ossim_uint16 theNumberOfAttributeOffsetRecords;
+   ossim_uint16 theNumberOfExplicitArealCoverageRecords;
+   ossim_uint32 theAttributeOffsetTableOffset;
+   ossim_uint16 theAttribteOffsetRecordLength;
+
+
+   mutable ossim_uint64 theAttributeSectionSubheaderStart;
+   mutable ossim_uint64 theAttributeSectionSubheaderEnd;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfAttributes.h b/include/ossim/support_data/ossimRpfAttributes.h
new file mode 100644
index 0000000..6cb64b0
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfAttributes.h
@@ -0,0 +1,370 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfAttributes.h 14241 2009-04-07 19:59:23Z dburken $
+
+#ifndef ossimRpfAttributes_HEADER
+#define ossimRpfAttributes_HEADER
+#include <map>
+
+#include <ossim/base/ossimString.h>
+
+class OSSIM_DLL ossimRpfAttributes
+{
+
+public:
+   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out,
+                                             const ossimRpfAttributes& data);
+   ossimRpfAttributes();
+   ~ossimRpfAttributes();
+
+   void setAttributeFlag(ossim_uint32 id,
+                         bool flag);
+   bool getAttributeFlag(ossim_uint32 id)const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+   
+   bool isEmpty()const;
+   void clearFields();
+   
+   /*!
+    * The attribute Id.  The Id and descriptions are taken from
+    * MIL-STD-2411-1 and can have one of the following values:
+    * _________________________________________________________________
+    * 1      Currency Date, 1 parameter:
+    *          1. Date of most recent revision to the RPF
+    *             YYYYMMDD
+    *             8 byte ascii value
+    */
+   ossimString theCurrencyDate;
+
+   /*! 2      Production Date, 1 parameter:
+    *          1. Date the source data was transformed to RPF format
+    *             YYYYMMDD
+    *             8 byte ascii value
+    */
+   ossimString theProductionDate;
+   
+   /*! 3      Significant Date, 1 parameter:
+    *          1. Most accurately describes the date of
+    *             the source data.
+    *             YYYYMMDD
+    *             8 byte ascii value
+    */
+   ossimString theSignificantDate;
+   
+   /*!
+    * 4      Map/Chart source, 4 parameters:
+    *          1. Short title for the id of a group of
+    *             products.  ex: JOG 1501A ...
+    *             10 byte ascii value
+    *          2. The designation of the hardcopy source
+    *             8 byte ascii value
+    *          3. Old horizontal datum code.  Original
+    *             horizontal datum of the hardcopy product
+    *             4 byte ascii value
+    *          4. Edition number of the source graphic
+    *             7 byte ascii value.
+    */
+   ossimString theChartSeriesCode; 
+   ossimString theMapDesignationCode; 
+   ossimString theOldHorDatum;   
+   ossimString theEdition;
+   
+   /*!
+    * 5      Projection Systemd, 5 parameters: p. 38 of MIL-STD-2411-1
+    *          1. Projection Code. 2 byte ascii value
+    *             AC    Albers Equal area
+    *                   Requires Parameters A B C D
+    *             AL    Azimuthal Equal Dist.
+    *                   Requires Parameters A B
+    *             RB    Hotline Oblique Mercator
+    *                   Requires Parameters A B C 
+    *             LE    Lambert Conformal Conic
+    *                   Requires Parameters A B C D
+    *             MC    Mercator
+    *                   Requires Parameters A B
+    *             OC    Oblique Mercator
+    *                   Requires Parameters A B C
+    *             OD    Orthographic
+    *                   Requires Parameters A B
+    *             PG    Polar Stereo-graphic
+    *                   Requires Parameters A B C D
+    *             PH    Poly conic
+    *                   Requires Parameters A B
+    *             TC    Transverse Mercator
+    *                   Requires Parameters A B C
+    *             UT    Universal Transverse Mercator
+    *                   Requires Parameters A
+    *          2. Projection Param A: real 4 byte value
+    *          3. Projeciton Param B: real 4 byte value
+    *          4. Projection Param C: real 4 byte value
+    *          5. Projection Param D: real 4 byte value
+    */
+   ossimString theProjectionCode;
+   float theProjectionA;
+   float theProjectionB;
+   float theProjectionC;
+   float theProjectionD;
+
+   /*!
+    * 6      Vertical Datum (1 parameter) p. 37 MIL-STD-2411-1
+    *         4 byte ascii
+    *
+    *          MSL     Mean Sea Level.  All elevations in th data set
+    *                  are referenced to the geoid of the specified datum
+    *          GEOD    Geodetic (All elevations in the data set
+    *                  are referenced to the ellipsoid of the specified
+    *                  datum
+    */
+   ossimString theVertDatumCode;
+
+   /*!
+    * 7      Horizontal Datum (1 parameter)
+    *        4 byte ascii
+    *
+    *            Look on p.33 of MIL-STD-2411-1.  Too big to list
+    *            we will need a translation table for these
+    *            codes
+    */
+   ossimString theHorDatumCode;
+   
+   /*!
+    * 8      Vertical Absolute Accurracy (2 parameters)
+    *        1. vertical absolute accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    */
+   ossim_uint32  theVertAbsAccuracy;
+   ossim_uint16 theVertAbsUnits;
+   
+   /*!
+    * 9      Horizontal Absolute Accuracy (2 parameters)
+    *        1. Horizontal absolute accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    */
+   ossim_uint32  theHorAbsAccuracy;
+   ossim_uint16 theHorAbsUnits;
+   
+   /*!
+    * 10     Vertical Relative Accuracy (2 parameters)
+    *        1. Vertical relative accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    */
+   ossim_uint32  theVertRelAccuracy;
+   ossim_uint16 theVertRelUnits;
+   
+   /*!
+    * 11     Horizontal Relative Accuracy (2 parameters)
+    *        1. Horizontal relative accuracy: 4 byte unsigned int
+    *        2. Accuracy units of measure:  2 byte value 
+    *             0   unknown
+    *             1   meters (Length area Volume)
+    *             2   Kilopounds
+    *             3   Seconds (of time)
+    *             4   Meters/Second (speed)
+    *             5   Cubic Meters per second (Flow)
+    *             6   Volt (Electrical potential)
+    *             7   Watt (Ten to 6 electirical power)
+    *             8   Hertz
+    *             9   +- DD MM SS.S (Angular)
+    *             10  +- HH MM SS.S (Time)
+    *             11  International Nautical Mile (1852 meters)
+    *             12  knot
+    *             13  Nautical mile per day
+    *             14  Feet
+    *             15  Fathom
+    *             16  Micrometers (microns)
+    *             17  Mils
+    *             18  Seconds of Arc
+    *             19  Minutes of Arc
+    *             20  Degrees of arc
+    *             999 Other
+    */
+   ossim_uint32  theHorRelAccuracy;
+   ossim_uint16 theHorRelUnits; 
+
+   /*!
+    * 12     Ellipsoid, 1 parameter:
+    *        1. Ellipsoid code.  3 byte ascii
+    *           See p. 40 of MIL-STD-2411-1
+    */
+   ossimString ellipsoidCode;
+
+   /*!
+    * 13     Sounding Datumm, 1 parameter: 4 byte ascii
+    *        See p. 33 MIL-STD-2411-1 5.3.2.2
+    */
+   ossimString theSoundingDatumCode;
+   
+   /*!
+    * 14     Navigation System, 1 parameter: 
+    *        1. Navigation code. 2 byte unsigned int
+    *           See MIL-STD-2411-1 5.3.2.4
+    */
+   ossim_uint16 theNavSystemCode; 
+
+   /*!
+    * 15     Grid, 1 parameter:
+    *        1. Grid code. 2 byte ascii
+    *           See MIL-STD-2411-1 5.3.2.7
+    */
+   ossimString theGridCode;
+
+   /*!
+    * 16     Easterly Annual Magnetic Change, 2 parameters:
+    *        1. Easterly annual magnetic change. 4 byte real
+    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
+    */
+   float          theEeasterlyMagChange; 
+   ossim_uint16 theEasterlyMagChangeUnits;
+
+   /*!
+    * 17     Westerly Annual Magnetic Change, 2 parameters:
+    *        1. Westerly annual magnetic change. 4 byte real
+    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
+    */
+   float          theWesterlyMagChange;
+   ossim_uint16 theWesterlyMagChangeUnits;
+
+   /*!
+    * 18     Grid North Magnetic North ANgle, 2 paramters:
+    *        1. Grid North - Magnetic North.  4 byte real
+    *        2. Units of angle. 2 byte unsigned int
+    *           see 5.3.2.6
+    */
+   float          theMagAngle; 
+   ossim_uint16 theMagAngleUnits;
+
+   /*!
+    * 19     Grid convergence angle, 2 parameters:
+    *        1. Grid convergence angle.  4 byte Real
+    *        2. Units of angle. 2 byte unsigned int 5.3.2.6
+    */
+   float          theGridConver; 
+   ossim_uint16 theGridConverUnits;
+
+   /*!
+    * 20     Highest known elevation (4 parameters)
+    *        1. Highest known elevation: 8 byte real
+    *        2. Units of elevation: See 5.3.2.6 of MIL-STD-2411-1
+    *        3. Lat of elevation: 8 byte real in decimal degrees
+    *        4. Lon of elevation: 8 byte real in decimal degrees
+    */
+   double         theHighElevation;
+   ossim_uint16   theHighElevationUnits;
+   double         theHighLat;
+   double         theHighLon;
+
+   /*! 21     Multiple legend, 1 paraemter:
+    *        1. Name of legend file that applies to this
+    *           12 byte ascii
+    */
+   ossimString theLegendFileName;
+   
+   /*!
+    * 22     Image source, 2 parameters:
+    *        1. Source of data from which this
+    *           RPF was derived. ex: SPOT. Landsat7, Landsat4.
+    *           for CDTED: "imagery, "carto"
+    *           12 byte ascii
+    *
+    *        2. GSD.  Ground sample or post distance.
+    *           4 byte unsigned int
+    */
+    ossimString theDataSource; // [12];
+    ossim_uint32 theGsd; // uint
+
+   /*!
+    * 23     Data Level, 1 parameter:
+    *        1. The level of the source.  For example:
+    *           if this is a DTED or CDTED it would
+    *           distinguish between level 1 and 2
+    */
+   ossim_uint16 theDataLevel; // ushort
+
+protected:
+   std::map<ossim_uint32, bool> theAttributeIdBoolMap;
+   
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfBoundaryRectRecord.h b/include/ossim/support_data/ossimRpfBoundaryRectRecord.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfBoundaryRectRecord.h
rename to include/ossim/support_data/ossimRpfBoundaryRectRecord.h
diff --git a/ossim/include/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h b/include/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h
rename to include/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h
diff --git a/ossim/include/ossim/support_data/ossimRpfBoundaryRectTable.h b/include/ossim/support_data/ossimRpfBoundaryRectTable.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfBoundaryRectTable.h
rename to include/ossim/support_data/ossimRpfBoundaryRectTable.h
diff --git a/include/ossim/support_data/ossimRpfColorConverterOffsetRecord.h b/include/ossim/support_data/ossimRpfColorConverterOffsetRecord.h
new file mode 100644
index 0000000..1efd2aa
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfColorConverterOffsetRecord.h
@@ -0,0 +1,61 @@
+#ifndef ossimRpfColorConverterOffsetRecord_HEADER
+#define ossimRpfColorConverterOffsetRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimErrorContext.h>
+
+class ossimRpfColorConverterOffsetRecord
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream& out, const ossimRpfColorConverterOffsetRecord& data);
+
+   ossimRpfColorConverterOffsetRecord();
+   
+   ossimErrorCode parseStream(ossim::istream& in,
+                              ossimByteOrder byteOrder);
+
+   void clearFields();
+   /*!
+    * Is a two byte field as is described in Mil-STD-2411-1.
+    * The id can be one of:
+    *
+    * 1       CCT/1--->1
+    * 2       CCT/1--->2
+    * 3       CCT/1--->3
+    * 4       CCT/1--->4
+    * 5       CCT/2--->2
+    * 6       CCT/2--->3
+    * 7       CCT/2--->4
+    * 8       CCT/3--->3
+    *
+    * where CCT stands for Color Converter Table
+    */
+   ossim_uint16 theColorConverterTableId;
+
+   /*!
+    * Is a 4 byte field.
+    */
+   ossim_uint32  theNumberOfColorConverterRecords;
+
+   /*!
+    * Is a 4 byte field indicating the offset from the start of
+    * the color converter subsection to the color converter table.
+    */
+   ossim_uint32  theColorConverterTableOffset;
+
+   /*!
+    * Is a 4 byte field indicating the offset from the colormap
+    * subsection to the source color/grayscale offset table.
+    */
+   ossim_uint32  theSourceColorGrayscaleOffsetTableOffset;
+
+   /*!
+    * Is a 4 byte field indicating the offset from the colormap
+    * subsection to the color/graysscale offset table.
+    */
+   ossim_uint32  theTargetColorGrayscaleOffsetTableOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfColorConverterSubsection.h b/include/ossim/support_data/ossimRpfColorConverterSubsection.h
new file mode 100644
index 0000000..c660782
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfColorConverterSubsection.h
@@ -0,0 +1,52 @@
+#ifndef ossimRpfColorConverterSubsection_HEADER
+#define ossimRpfColorConverterSubsection_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/support_data/ossimRpfColorConverterTable.h>
+#include <vector>
+
+class ossimRpfColorConverterSubsection
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream& out, const ossimRpfColorConverterSubsection& data);
+
+   ossimRpfColorConverterSubsection();
+   virtual ~ossimRpfColorConverterSubsection(){}
+
+   ossimErrorCode parseStream(ossim::istream& in,
+                              ossimByteOrder byteOrder);
+   
+   ossim_uint32 getStartOffset()const{return theStartOffset;}
+   ossim_uint32 getEndOffset()const{return theEndOffset;}
+
+   const std::vector<ossimRpfColorConverterTable>& getColorConversionTable()const
+   {
+      return theTableList;
+   }
+   const ossimRpfColorConverterTable* getColorConversionTable(ossim_uint32 givenThisNumberOfEntires)const;
+   
+   void setNumberOfColorConverterOffsetRecords(ossim_uint16 numberOfRecords);
+   void print(std::ostream& out)const;
+
+   void clearFields();
+   
+private:
+   ossimRpfColorConverterSubsection(const ossimRpfColorConverterSubsection&){}//hide
+   void operator =(const ossimRpfColorConverterSubsection&){}//hide
+
+   ossim_uint32  theStartOffset;
+   ossim_uint32  theEndOffset;
+   
+   ossim_uint16  theNumberOfColorConverterOffsetRecords;
+   
+   ossim_uint32  theColorConverterOffsetTableOffset;
+   ossim_uint16  theColorConverterOffsetRecordLength;
+   ossim_uint16  theConverterRecordLength;
+
+   std::vector<ossimRpfColorConverterTable> theTableList;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfColorConverterTable.h b/include/ossim/support_data/ossimRpfColorConverterTable.h
new file mode 100644
index 0000000..79b971e
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfColorConverterTable.h
@@ -0,0 +1,44 @@
+#ifndef ossimRpfColorConverterTable_HEADER
+#define ossimRpfColorConverterTable_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfColorConverterTable
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream& out, const ossimRpfColorConverterTable& data);
+   
+   ossimRpfColorConverterTable();
+   virtual ~ossimRpfColorConverterTable();
+
+   ossimErrorCode parseStream(ossim::istream& in,
+                              ossimByteOrder byteOrder);
+   void print(std::ostream& out)const;
+   ossim_uint32 getEntry(ossim_uint32 entry){return theColorGrayscaleTableEntryList[entry];}
+   void setNumberOfEntries(ossim_uint32 entries);
+   void setTableId(ossim_uint16 id);
+   const ossim_uint32* getEntryList()const{return theColorGrayscaleTableEntryList;}
+   ossim_uint32 getNumberOfEntries()const{return theNumberOfEntries;}
+   
+private:
+   /*!
+    * This will not be a field read from the stream this is
+    * the value in the color converter offset table.
+    */
+   ossim_uint16 theTableId;
+
+   /*!
+    * Holds the number of entries
+    */ 
+   ossim_uint32  theNumberOfEntries;
+
+   /*!
+    * This will hold the lookup table values.
+    */
+   ossim_uint32* theColorGrayscaleTableEntryList;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h b/include/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h
new file mode 100644
index 0000000..1e2217e
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h
@@ -0,0 +1,43 @@
+#ifndef ossimRpfColorGrayscaleOffsetRecord_HEADER
+#define ossimRpfColorGrayscaleOffsetRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfColorGrayscaleOffsetRecord
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream& out, const ossimRpfColorGrayscaleOffsetRecord& data);
+   
+   ossimRpfColorGrayscaleOffsetRecord();
+
+   ossimErrorCode parseStream(ossim::istream& in,
+                              ossimByteOrder byteOrder);
+   
+   void print(std::ostream& out)const;
+
+   void clearFields();
+   ossim_uint16 getColorGrayscaleTableId()const
+      {
+         return theColorGrayscaleTableId;
+      }
+   ossim_uint32 getNumberOfColorGrayscaleRecords()const
+      {
+         return theNumberOfColorGrayscaleRecords;
+      }
+   ossim_uint32 getColorGrayscaleTableOffset()const
+      {
+         return theColorGrayscaleTableOffset;
+      }
+private:
+   ossim_uint16  theColorGrayscaleTableId;
+   ossim_uint32  theNumberOfColorGrayscaleRecords;
+   unsigned char theColorGrayscaleElementLength;
+   ossim_uint16  theHistogramRecordLength;
+   ossim_uint32  theColorGrayscaleTableOffset;
+   ossim_uint32  theHistogramTableOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfColorGrayscaleSubheader.h b/include/ossim/support_data/ossimRpfColorGrayscaleSubheader.h
new file mode 100644
index 0000000..a6f6530
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfColorGrayscaleSubheader.h
@@ -0,0 +1,52 @@
+#ifndef ossimRpfColorGrayscaleSubheader_HEADER
+#define ossimRpfColorGrayscaleSubheader_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfColorGrayscaleSubheader
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream& out, const ossimRpfColorGrayscaleSubheader& data);
+   
+   ossimRpfColorGrayscaleSubheader();
+   ~ossimRpfColorGrayscaleSubheader(){}
+   
+   ossimErrorCode parseStream(ossim::istream& in,
+                              ossimByteOrder byteOrder);
+   void print(std::ostream& out)const;
+   unsigned long getStartOffset()const
+      {
+         return theStartOffset;
+      }
+   unsigned long getEndOffset()const
+      {
+         return theEndOffset;
+      }
+   unsigned long getNumberOfColorGreyscaleOffsetRecords()const
+      {
+         return theNumberOfColorGreyscaleOffsetRecords;
+      }
+   unsigned long getNumberOfColorConverterOffsetRecords()const
+      {
+         return theNumberOfColorConverterOffsetRecords;
+      }
+   
+private:
+   void clearFields();
+
+   unsigned long theStartOffset;
+   unsigned long theEndOffset;
+   
+   unsigned char theNumberOfColorGreyscaleOffsetRecords;
+   unsigned char theNumberOfColorConverterOffsetRecords;
+
+   /*!
+    * 12 byte field.
+    */
+   ossimString         theColorGrayscaleFilename;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfColorGrayscaleTable.h b/include/ossim/support_data/ossimRpfColorGrayscaleTable.h
new file mode 100644
index 0000000..1a92806
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfColorGrayscaleTable.h
@@ -0,0 +1,49 @@
+#ifndef ossimRpfColorGrayscaleTable_HEADER
+#define ossimRpfColorGrayscaleTable_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfColorGrayscaleTable
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream& out, const ossimRpfColorGrayscaleTable& data);
+   
+   ossimRpfColorGrayscaleTable();
+   ossimRpfColorGrayscaleTable(const ossimRpfColorGrayscaleTable& rhs);
+   virtual ~ossimRpfColorGrayscaleTable();
+
+   ossimErrorCode parseStream(std::istream& in, ossimByteOrder byteOrder);
+   
+   void setTableData(unsigned short id,
+                     unsigned long  numberOfElements);
+   
+   const ossimRpfColorGrayscaleTable& operator =(const ossimRpfColorGrayscaleTable&);
+
+   const unsigned char* getData()const{return theData;}
+   const unsigned char* getStartOfData(unsigned long entry)const;
+   unsigned short getTableId()const{return theTableId;}
+   unsigned long getNumberOfElements()const{return theNumberOfElements;}
+   
+private:   
+   unsigned long theNumberOfElements;
+
+   unsigned long theTotalNumberOfBytes;
+   
+   /*!
+    * This will not be parsed from the stream.  This is set when
+    * reading the offset record for this table.  The id defines
+    * the format of the data buffer. if the id is :
+    *
+    * 1           then the buffer is in the format of RGB
+    * 2                     ""                        RGBM
+    * 3                     ""                        M
+    * 4                     ""                        CMYK
+    */
+   unsigned short theTableId;
+   unsigned char* theData;
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfComponentIdLut.h b/include/ossim/support_data/ossimRpfComponentIdLut.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfComponentIdLut.h
rename to include/ossim/support_data/ossimRpfComponentIdLut.h
diff --git a/include/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h b/include/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h
new file mode 100644
index 0000000..2af7cb0
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h
@@ -0,0 +1,49 @@
+#ifndef ossimRpfCompressionLookupOffsetRecord_HEADER
+#define ossimRpfCompressionLookupOffsetRecord_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfCompressionLookupOffsetRecord
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream &out, const ossimRpfCompressionLookupOffsetRecord& data);
+   
+   ossimRpfCompressionLookupOffsetRecord();
+   ossimErrorCode parseStream(ossim::istream& in,
+                              ossimByteOrder byteOrder);
+   void print(std::ostream& out)const;
+   ossim_uint16 getCompressionLookupTableId()const
+      {
+         return theCompressionLookupTableId;
+      }
+   ossim_uint32 getNumberOfCompressionLookupRecords()const
+      {
+         return theNumberOfCompressionLookupRecords;
+      }
+   ossim_uint16 getNumberOfValuesPerCompressionLookupRecord()const
+      {
+         return theNumberOfValuesPerCompressionLookupRecord;
+      }
+   ossim_uint16 getCompressionLookupValueBitLength()const
+      {
+         return theCompressionLookupValueBitLength;
+      }
+   ossim_uint32 getCompressionLookupTableOffset()const
+      {
+         return theCompressionLookupTableOffset;
+      }
+   
+private:
+   void clearFields();
+   
+   ossim_uint16 theCompressionLookupTableId;
+   ossim_uint32 theNumberOfCompressionLookupRecords;
+   ossim_uint16 theNumberOfValuesPerCompressionLookupRecord;
+   ossim_uint16 theCompressionLookupValueBitLength;
+   ossim_uint32 theCompressionLookupTableOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfCompressionSection.h b/include/ossim/support_data/ossimRpfCompressionSection.h
new file mode 100644
index 0000000..bc2d703
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfCompressionSection.h
@@ -0,0 +1,56 @@
+#ifndef ossimRpfCompressionSection_HEADER
+#define ossimRpfCompressionSection_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <vector>
+
+class ossimRpfCompressionSectionSubheader;
+
+struct ossimRpfCompressionOffsetTableData
+{
+   friend std::ostream& operator<<(
+      std::ostream& out, const ossimRpfCompressionOffsetTableData& data);
+   ossimRpfCompressionOffsetTableData();
+   ossimRpfCompressionOffsetTableData(const ossimRpfCompressionOffsetTableData& rhs);
+   ~ossimRpfCompressionOffsetTableData();
+   const ossimRpfCompressionOffsetTableData& operator =(const ossimRpfCompressionOffsetTableData& rhs);
+   
+   ossim_uint16 theTableId;
+   ossim_uint32 theNumberOfLookupValues;
+   ossim_uint16 theCompressionLookupValueBitLength;
+   ossim_uint16 theNumberOfValuesPerLookup;
+   ossim_uint8* theData;
+};
+
+class ossimRpfCompressionSection
+{
+public:
+   friend std::ostream& operator << (
+      std::ostream& out, const ossimRpfCompressionSection& data);
+   ossimRpfCompressionSection();
+   virtual ~ossimRpfCompressionSection();
+   ossimErrorCode parseStream(ossim::istream& in,
+                              ossimByteOrder byteOrder);
+   void print(std::ostream& out)const;
+   const std::vector<ossimRpfCompressionOffsetTableData>& getTable()const
+      {
+         return theTable;
+      }
+   const ossimRpfCompressionSectionSubheader* getSubheader()const
+   {
+      return theSubheader;
+   }
+private:
+   void clearTable();
+   
+   ossimRpfCompressionSectionSubheader* theSubheader;
+   
+   ossim_uint32 theCompressionLookupOffsetTableOffset;
+   ossim_uint16 theCompressionLookupTableOffsetRecordLength;
+
+   std::vector<ossimRpfCompressionOffsetTableData> theTable;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfCompressionSectionSubheader.h b/include/ossim/support_data/ossimRpfCompressionSectionSubheader.h
new file mode 100644
index 0000000..7f829e8
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfCompressionSectionSubheader.h
@@ -0,0 +1,62 @@
+#ifndef ossimRpfCompressionSectionSubheader_HEADER
+#define ossimRpfCompressionSectionSubheader_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfCompressionSectionSubheader
+{
+public:
+   friend std::ostream& operator<<(
+      std::ostream& out, const ossimRpfCompressionSectionSubheader& data);
+   ossimRpfCompressionSectionSubheader();
+   virtual ~ossimRpfCompressionSectionSubheader(){}
+
+   ossimErrorCode parseStream(ossim::istream& in, ossimByteOrder byteOrder);
+
+   unsigned long getStartOffset()const{return theStartOffset;}
+   unsigned long getEndOffset()const{return theEndOffset;}
+   unsigned short getCompressionAlgorithmId()const
+      {
+         return theCompressionAlgorithmId;
+      }
+   unsigned short getNumberOfCompressionLookupOffsetRecords()const
+      {
+         return theNumberOfCompressionLookupOffsetRecords;
+      }
+   unsigned short getNumberOfCompressionParameterOffsetRecords()const
+      {
+         return theNumberOfCompressionParameterOffsetRecords;
+      }
+   void print(std::ostream& out)const;
+   
+private:
+   void clearFields();
+
+   /*!
+    * helper varible that holds the starting absolute
+    * offset to the start of the this data.
+    */
+   unsigned long theStartOffset;
+
+   /*!
+    * helper varible that holds the starting absolute
+    * offset to the end of the this data.
+    */
+   unsigned long theEndOffset;
+   /*!
+    * Current ids are:
+    *
+    * 1  VQ
+    * 2 Jpeg Lossless
+    */
+   unsigned short theCompressionAlgorithmId;
+
+   unsigned short theNumberOfCompressionLookupOffsetRecords;
+
+   unsigned short theNumberOfCompressionParameterOffsetRecords;
+   
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfConstants.h b/include/ossim/support_data/ossimRpfConstants.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfConstants.h
rename to include/ossim/support_data/ossimRpfConstants.h
diff --git a/include/ossim/support_data/ossimRpfCoverageSection.h b/include/ossim/support_data/ossimRpfCoverageSection.h
new file mode 100644
index 0000000..d0cd294
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfCoverageSection.h
@@ -0,0 +1,162 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfCoverageSection.h 16997 2010-04-12 18:53:48Z dburken $
+#ifndef ossimRpfCoverageSection_HEADER
+#define ossimRpfCoverageSection_HEADER
+
+#include <iosfwd>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimRpfConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+
+class ossimRpfCoverageSection
+{
+public:
+   friend std::ostream& operator <<(std::ostream &out,
+                                    const ossimRpfCoverageSection &data);
+   
+   ossimRpfCoverageSection();
+   ossimRpfCoverageSection(const ossimRpfCoverageSection& obj);
+   const ossimRpfCoverageSection& operator=(const ossimRpfCoverageSection& rhs);
+   
+   ~ossimRpfCoverageSection(){}
+
+   ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder);
+
+   /**
+    * @brief Write method.
+    *
+    * @param out Stream to write to.
+    */
+   void writeStream(std::ostream& out);
+
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+   
+   void clearFields();
+
+   bool isGeographicRectNull()const
+   {
+      return ((theUpperLeftLat  == OSSIM_RPF_ULONG_NULL) &&
+              (theUpperLeftLon  == OSSIM_RPF_ULONG_NULL) &&
+              (theLowerLeftLat  == OSSIM_RPF_ULONG_NULL) &&
+              (theLowerLeftLon  == OSSIM_RPF_ULONG_NULL) &&
+              (theLowerRightLat == OSSIM_RPF_ULONG_NULL) &&
+              (theLowerRightLon == OSSIM_RPF_ULONG_NULL) &&
+              (theUpperRightLat == OSSIM_RPF_ULONG_NULL) &&
+              (theUpperRightLon == OSSIM_RPF_ULONG_NULL));
+   }
+   bool isIntervalNull()const
+   {
+      return ((theVerticalInterval   == OSSIM_RPF_ULONG_NULL)&&
+              (theHorizontalInterval == OSSIM_RPF_ULONG_NULL));
+   }
+
+   ossim_float64 getUlLat()const{return theUpperLeftLat;}
+   ossim_float64 getUlLon()const{return theUpperLeftLon;}
+   ossim_float64 getLlLat()const{return theLowerLeftLat;}
+   ossim_float64 getLlLon()const{return theLowerLeftLon;}
+   ossim_float64 getLrLat()const{return theLowerRightLat;}
+   ossim_float64 getLrLon()const{return theLowerRightLon;}
+   ossim_float64 getUrLat()const{return theUpperRightLat;}
+   ossim_float64 getUrLon()const{return theUpperRightLon;}
+
+   ossim_float64 getVerticalResolution()const{return theVerticalResolution;}
+   ossim_float64 getHorizontalResolution()const{return theHorizontalResolution;}
+
+   /*!
+    * This indicates the lat increment per pixel in degrees.
+    */
+   ossim_float64 getVerticalInterval()const{return theVerticalInterval;}
+
+   /*!
+    * This indicates the lon increment per pixel in degrees.
+    */
+   ossim_float64 getHorizontalInterval()const{return theHorizontalInterval;}
+
+   /** @brief Sets theUpperLeftLat to value. */
+   void setUlLat(ossim_float64 value);
+
+   /** @brief Sets theUpperLeftLon to value. */
+   void setUlLon(ossim_float64 value);
+
+   /** @brief Sets theLowerLeftLat to value. */
+   void setLlLat(ossim_float64 value);
+
+   /** @brief Sets theLowerLeftLon to value. */
+   void setLlLon(ossim_float64 value);
+   
+   /** @brief Sets theLowerRightLat to value. */
+   void setLrLat(ossim_float64 value);
+   
+   /** @brief Sets theLowerRightLon to value. */
+   void setLrLon(ossim_float64 value);
+
+   /** @brief Sets theUpperRightLat to value. */
+   void setUrLat(ossim_float64 value);
+
+   /** @brief Sets theUpperRightLon to value. */
+   void setUrLon(ossim_float64 value);
+
+   /** @brief Sets theVerticalResolution to value. */
+   void setVerticalResolution(ossim_float64 value);
+
+   /** @brief Sets theHorizontalResolution to value. */
+   void setHorizontalResolution(ossim_float64 value);
+   
+   /** @brief Sets theVerticalInterval to value. */
+   void setVerticalInterval(ossim_float64 value);
+   
+   /** @brief Sets theHorizontalInterval to value. */
+   void setHorizontalInterval(ossim_float64 value);
+   
+private:   
+   /*!
+    * 8 byte ossim_float64 and is the upper left lat or
+    * North West portion of the image.
+    */
+   ossim_float64 theUpperLeftLat;
+
+   /*!
+    * 8 byte ossim_float64 and is the upper left lon
+    * (North west)
+    */
+   ossim_float64 theUpperLeftLon;
+
+   ossim_float64 theLowerLeftLat;
+   ossim_float64 theLowerLeftLon;
+
+   ossim_float64 theUpperRightLat;
+   ossim_float64 theUpperRightLon;
+
+   ossim_float64 theLowerRightLat;
+   ossim_float64 theLowerRightLon;
+
+   ossim_float64 theVerticalResolution;
+   ossim_float64 theHorizontalResolution;
+
+   ossim_float64 theVerticalInterval;
+   ossim_float64 theHorizontalInterval;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfFrame.h b/include/ossim/support_data/ossimRpfFrame.h
new file mode 100644
index 0000000..0629955
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfFrame.h
@@ -0,0 +1,207 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: This class give the capability to access tiles from an
+//              rpf file.
+//
+//********************************************************************
+// $Id: ossimRpfFrame.h 20324 2011-12-06 22:25:23Z dburken $
+
+#ifndef ossimRpfFrame_HEADER
+#define ossimRpfFrame_HEADER 1
+
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/support_data/ossimRpfColorGrayscaleTable.h>
+#include <ossim/support_data/ossimRpfReplaceUpdateTable.h>
+#include <iosfwd>
+#include <vector>
+
+class ossimRpfHeader;
+class ossimRpfAttributes;
+class ossimRpfCoverageSection;
+class ossimRpfImageDescriptionSubheader;
+class ossimRpfImageDisplayParameterSubheader;
+class ossimRpfMaskSubheader;
+class ossimRpfCompressionSection;
+class ossimRpfColorGrayscaleSubheader;
+class ossimRpfColorConverterSubsection;
+
+class OSSIM_DLL ossimRpfFrame : public ossimReferenced
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimRpfFrame& data);
+   ossimRpfFrame();
+   ~ossimRpfFrame();
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;  
+
+   ossimErrorCode parseFile(const ossimFilename& filename,
+                            bool minimalParse = false);
+   
+   const ossimRpfHeader* getRpfHeader()const{return theHeader;}
+
+   bool hasSubframeMaskTable()const;
+
+   const vector< vector<ossim_uint32> >& getSubFrameMask(
+      ossim_uint32 spectralGroup)
+   {
+      return theSubframeMaskTable[spectralGroup];
+   }
+   
+   bool fillSubFrameBuffer(ossim_uint8* buffer,
+                           ossim_uint32 spectralGroup,
+                           ossim_uint32 row,
+                           ossim_uint32 col)const;
+   
+   const ossimRpfCompressionSection* getCompressionSection()const
+   {
+      return theCompressionSection;
+   }
+   const vector<ossimRpfColorGrayscaleTable>& getColorGrayscaleTable()const
+   {
+      return theColorGrayscaleTable;
+   }
+   const ossimRpfColorConverterSubsection* getColorConverterSubsection()const
+   {
+      return theColorConverterSubsection;
+   }
+   const ossimRpfAttributes* getAttributes()const
+   {
+      return theAttributes;
+   }
+   const ossimNitfFile* getNitfFile()const
+   {
+      return theNitfFile.get();
+   }
+
+   /**
+    * @return The RPF replace / update table.  The ossimRefPtr can have a null
+    * internal pointer if record was not found. Callers should check
+    * ossimRefPtr<ossimRpfReplaceUpdateTable>::valid() before using pointer.
+    */
+   ossimRefPtr<ossimRpfReplaceUpdateTable> getRpfReplaceUpdateTable() const;
+
+private:
+   void clearFields();
+   void deleteAll();
+   ossimErrorCode populateCoverageSection(std::istream& in);
+   ossimErrorCode populateCompressionSection(std::istream& in);
+   ossimErrorCode populateImageSection(std::istream& in);
+   ossimErrorCode populateAttributeSection(std::istream& in);
+   ossimErrorCode populateColorGrayscaleSection(std::istream& in);
+   ossimErrorCode populateMasks(std::istream& in);
+   ossimErrorCode populateReplaceUpdateTable(std::istream& in);
+
+   /*!
+    * The header will be instantiated during the opening of the
+    * frame file.
+    */
+   ossimRpfHeader *theHeader;
+
+   /*!
+    * The filename is set if its a successful open.
+    */
+   ossimFilename   theFilename;
+
+   /*!
+    * This will hold the coverage.
+    */
+   ossimRpfCoverageSection* theCoverage;
+
+   /*!
+    * This will hold the attributes of this frame.
+    */
+   ossimRpfAttributes *theAttributes;
+
+   /*!
+    * This is the subheader for the image.  It will have
+    * some general information about the image.
+    */
+   ossimRpfImageDescriptionSubheader* theImageDescriptionSubheader;
+
+   /*!
+    * This is the mask subheader.
+    */
+   ossimRpfMaskSubheader* theMaskSubheader;
+   
+   /*!
+    * This is the subheader for the display parameters
+    * for this frame.
+    */
+   ossimRpfImageDisplayParameterSubheader* theImageDisplayParameterSubheader;
+
+   /*!
+    * Will hold a pointer to the compression information section.
+    */
+   ossimRpfCompressionSection*             theCompressionSection;
+   
+   /*!
+    * If present, it will hold the color grayscale subheader.
+    */
+   ossimRpfColorGrayscaleSubheader*        theColorGrayscaleSubheader;
+
+   /*!
+    * 
+    */
+   ossimRpfColorConverterSubsection*       theColorConverterSubsection;
+
+   /*!
+    * 
+    */
+   vector<ossimRpfColorGrayscaleTable>     theColorGrayscaleTable;
+
+   /*!
+    * 
+    */
+   ossimRefPtr<ossimNitfFile>              theNitfFile;
+
+   /*!
+    * We have a 3-D array.  For the most part the numberof spectral groups
+    * should be one.  The indexes are as follows:
+    *
+    * theSubframeMasKTable[spectralGroup][row][col]
+    *
+    *  It will hold RPF_NULL(0xffffffff) if the subframe does not exist
+    *  and it will hold an offset value from the start of the
+    * [spatial data section] to the first byte of the subframe table.
+    */
+   vector< vector< vector< ossim_uint32> > > theSubframeMaskTable;
+
+   /*!
+    * We have a 3-D array.  For the most part the numberof spectral groups
+    * should be one.  The indexes are as follows:
+    *
+    * theSubframeTransparencyMaskTable[spectralGroup][row][col]
+    *
+    *  It will hold RPF_NULL(0xffffffff) if the subframe does not exist
+    *  and it will hold an offset value from the start of the
+    * [spatial data section] to the first byte of the subframe table.
+    */
+   vector< vector< vector< ossim_uint32> > > theSubframeTransparencyMaskTable;
+
+   /** Holds table of "replace / update" records if present. */
+   ossimRefPtr<ossimRpfReplaceUpdateTable> theReplaceUpdateTable;
+
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfFrameEntry.h b/include/ossim/support_data/ossimRpfFrameEntry.h
new file mode 100644
index 0000000..9397efd
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfFrameEntry.h
@@ -0,0 +1,61 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfFrameEntry.h 23172 2015-03-02 13:44:54Z dburken $
+#ifndef ossimRpfFrameEntry_HEADER
+#define ossimRpfFrameEntry_HEADER
+
+#include <iosfwd>
+#include <ossim/base/ossimFilename.h>
+
+class OSSIM_DLL ossimRpfFrameEntry
+{
+public:
+   friend std::ostream& operator<<(std::ostream& out,
+                                   const ossimRpfFrameEntry& data);
+   ossimRpfFrameEntry(const ossimFilename& rootDirectory=ossimFilename(""),
+                      const ossimFilename& pathToFrameFileFromRoot=ossimFilename(""));
+
+   /** @brief copy constructor */
+   ossimRpfFrameEntry(const ossimRpfFrameEntry& obj);
+
+   /** @brief operator= */
+   const ossimRpfFrameEntry& operator=(const ossimRpfFrameEntry& rhs);
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;  
+
+   bool exists() const;
+   
+   void setEntry(const ossimFilename& rootDirectory,
+                 const ossimFilename& pathToFrameFileFromRoot);
+   
+   const ossimFilename& getFullPath() const;
+   const ossimString&   getRootDirectory() const;
+   const ossimString    getPathToFrameFileFromRoot() const;
+   
+private:
+   bool          m_exists;
+   ossimFilename m_rootDirectory;
+   ossimFilename m_pathToFrameFileFromRoot;
+   ossimFilename m_fullValidPath;
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfFrameFileIndexRecord.h b/include/ossim/support_data/ossimRpfFrameFileIndexRecord.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfFrameFileIndexRecord.h
rename to include/ossim/support_data/ossimRpfFrameFileIndexRecord.h
diff --git a/ossim/include/ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h b/include/ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h
rename to include/ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h
diff --git a/ossim/include/ossim/support_data/ossimRpfFrameFileIndexSubsection.h b/include/ossim/support_data/ossimRpfFrameFileIndexSubsection.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfFrameFileIndexSubsection.h
rename to include/ossim/support_data/ossimRpfFrameFileIndexSubsection.h
diff --git a/ossim/include/ossim/support_data/ossimRpfFrameFileReader.h b/include/ossim/support_data/ossimRpfFrameFileReader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfFrameFileReader.h
rename to include/ossim/support_data/ossimRpfFrameFileReader.h
diff --git a/include/ossim/support_data/ossimRpfHeader.h b/include/ossim/support_data/ossimRpfHeader.h
new file mode 100644
index 0000000..502fccd
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfHeader.h
@@ -0,0 +1,181 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfHeader.h 22013 2012-12-19 17:37:20Z dburken $
+#ifndef ossimRpfHeader_HEADER
+#define ossimRpfHeader_HEADER 1
+
+#include <iosfwd>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/support_data/ossimRpfConstants.h>
+
+class ossimRpfLocationSection;
+class ossimRpfCoverageSection;
+class ossimRpfBoundaryRectTable;
+class ossimRpfBoundaryRectSectionSubheader;
+class ossimRpfFrameFileIndexSectionSubheader;
+class ossimRpfFrameFileIndexSubsection;
+class ossimRpfColorTableIndexSectionSubheader;
+class ossimRpfImageDescriptionSubheader;
+class ossimRpfMaskSubsection;
+class ossimRpfAttributeSectionSubheader;
+class ossimRpfImageDisplayParameterSubheader;
+class ossimRpfCompressionSection;
+class ossimRpfCompressionSectionSubheader;
+class ossimRpfColorGrayscaleSubheader;
+
+class ossimRpfHeader : public ossimNitfRegisteredTag
+{
+public:
+
+   /** default constructor */
+   ossimRpfHeader();
+
+   /** copy constructor */
+   ossimRpfHeader(const ossimRpfHeader& obj);
+
+   /** assignment operator */
+   const ossimRpfHeader& operator=(const ossimRpfHeader& rhs);
+
+   virtual ~ossimRpfHeader();
+
+   /**
+    * @brief Parse method.
+    *
+    * @param in Stream to parse.
+    */
+   virtual void parseStream(std::istream& in);
+
+   /**
+    * @brief Write method.
+    *
+    * @param out Stream to write to.
+    */
+   virtual void writeStream(std::ostream& out);
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+
+   virtual ossimByteOrder getByteOrder()const;
+   
+   const ossimRpfLocationSection* getLocationSection() const;
+
+   ossimRpfLocationSection* getLocationSection();
+
+   bool hasComponent(ossimRpfComponentId componentId)const;
+   ossimString getSecurityClassification()const;
+   
+   /*!
+    * This will return a new coverage section.  It will return NULL if
+    * one does not exist.
+    */
+   ossimRpfCoverageSection*
+      getNewCoverageSection(const ossimFilename& file)const;
+   ossimRpfCoverageSection*
+      getNewCoverageSection(std::istream& in)const;
+
+   ossimRpfColorGrayscaleSubheader*
+      getNewColorGrayscaleSubheader(std::istream& in)const;
+   ossimRpfCompressionSection*
+      getNewCompressionSection(std::istream& in)const;
+   ossimRpfCompressionSectionSubheader*
+      getNewCompressionSectionSubheader(std::istream& in)const;
+   ossimRpfImageDisplayParameterSubheader*
+      getNewImageDisplayParameterSubheader(std::istream& in)const;
+   ossimRpfAttributeSectionSubheader*
+      getNewAttributeSectionSubheader(std::istream& in)const;
+   ossimRpfImageDescriptionSubheader*
+      getNewImageDescriptionSubheader(std::istream& in)const;
+   ossimRpfMaskSubsection*
+      getNewMaskSubsection(std::istream& in)const;
+   ossimRpfBoundaryRectSectionSubheader*
+      getNewBoundaryRectSectSubheader(std::istream& in)const;
+   ossimRpfBoundaryRectTable*
+      getNewBoundaryRectTable(std::istream& in)const;
+   ossimRpfFrameFileIndexSectionSubheader*
+      getNewFrameFileIndexSectionSubheader(std::istream& in)const;
+   ossimRpfFrameFileIndexSubsection*
+      getNewFileIndexSubsection(std::istream& in)const;
+   ossimRpfColorTableIndexSectionSubheader*
+      getNewColorTableIndexSectionSubheader(std::istream& in)const;
+
+   ossimRpfCompressionSection*
+      getNewCompressionSection(const ossimFilename& file)const;
+   ossimRpfBoundaryRectSectionSubheader*
+      getNewBoundaryRectSectSubheader(const ossimFilename& file)const;
+   ossimRpfBoundaryRectTable*
+      getNewBoundaryRectTable(const ossimFilename& file)const;
+   ossimRpfFrameFileIndexSectionSubheader*
+      getNewFrameFileIndexSectionSubheader(const ossimFilename& file)const;
+   ossimRpfFrameFileIndexSubsection*
+      getNewFileIndexSubsection(const ossimFilename& file)const;
+   ossimRpfColorTableIndexSectionSubheader*
+      getNewColorTableIndexSectionSubheader(const ossimFilename& file)const;
+
+   ossimString getDate()const;
+
+   /** @brief returns the byte position of the location section. */
+   ossim_uint32 getLocationSectionLocation() const;
+   
+   void setFilename(const ossimString& file);
+   void setNewRepUpIndicator(const ossimString& s);
+   void setGovSpecNumber(const ossimString& s);
+   void setGovSpecDate(const ossimString& s);
+   void setSecurityClassification(const ossimString& s);
+   void setCountryCode(const ossimString& s);
+   void setSecurityReleaseMarking(const ossimString& s);
+   void setLocationSectionPos(std::streamoff off);
+
+   /*!
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
+
+private:
+
+   /** 0x00 = big, 0xff = little */
+   ossim_uint8  m_littleBigEndianIndicator; // 1 byte bool
+   ossim_uint16 m_headerSectionLength;      // 2 bytes uint
+   char         m_fileName[13];             // 12 byte ascii
+   ossim_uint8  m_newRepUpIndicator;        // 1 byte unsigned int
+   char         m_govSpecNumber[16];        // 15 byte ascii
+   char         m_govSpecDate[9];           // 8 byte ascii
+   /**
+    * 1 byte field that can have the values
+    *
+    * U   Unclassified
+    * R   Restricted
+    * C   Confidential
+    * S   Secret
+    * T   Top Secret
+    */ 
+   char         m_securityClassification[2]; // 1 byte ascii
+   char         m_countryCode[3];            // 2 byte ascii
+   char         m_securityReleaseMarking[3]; // 2 byte ascii
+   ossim_uint32 m_locSectionLoc;             // 4 byte unsigned int
+   
+   ossimRpfLocationSection* m_locationSection;
+};
+
+#endif
+ 
diff --git a/include/ossim/support_data/ossimRpfImageDescriptionSubheader.h b/include/ossim/support_data/ossimRpfImageDescriptionSubheader.h
new file mode 100644
index 0000000..1ed8554
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfImageDescriptionSubheader.h
@@ -0,0 +1,127 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfImageDescriptionSubheader.h 14241 2009-04-07 19:59:23Z dburken $
+#ifndef ossimRpfImageDescriptionSubheader_HEADER
+#define ossimRpfImageDescriptionSubheader_HEADER
+
+#include <iosfwd>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimRpfConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+
+class ossimRpfImageDescriptionSubheader
+{
+public:
+   friend std::ostream& operator <<(
+      std::ostream& out, const ossimRpfImageDescriptionSubheader& data);
+
+   ossimRpfImageDescriptionSubheader();
+   ~ossimRpfImageDescriptionSubheader(){}
+
+   ossimErrorCode parseStream(std::istream& in, ossimByteOrder byteOrder);
+   
+   ossim_uint32 getStartOffset()const{return theStartOffset;}
+   ossim_uint32 getEndOffset()const{return theEndOffset;}
+
+   bool isSubframeMaskTableOffsetNull()const
+   {
+      return (theSubframeMaskTableOffset == OSSIM_RPF_ULONG_NULL);
+   }
+   bool isTransparencyMaskTableOffsetNull()const
+   {
+      return (theTransparencyMaskTableOffset == OSSIM_RPF_ULONG_NULL);
+   }
+   ossim_uint16 getNumberOfSpectralGroups()const
+   {
+      return theNumberOfSpectralGroups;
+   }
+   ossim_uint16 getNumberOfSubframeTables()const
+   {
+      return theNumberOfSubframeTables;
+   }
+   ossim_uint16 getNumberOfSpectralBandTables()const
+   {
+      return theNumberOfSpectralBandTables;
+   }
+   ossim_uint16 getNumberOfSpectralBandLinesPerImageRow()const
+   {
+      return theNumberOfSpectralBandLinesPerImageRow;
+   }
+   ossim_uint16 getNumberOfSubframesHorizontal()const
+   {
+      return theNumberOfSubframesHorizontal;
+   }
+   ossim_uint16 getNumberOfSubframesVertical()const
+   {
+      return theNumberOfSubframesVertical;
+   }
+   ossim_uint32  getNumberOfOutputColumnsPerSubframe()const
+   {
+      return theNumberOfOutputColumnsPerSubframe;
+   }
+   ossim_uint32  getNumberOfOutputRowsPerSubframe()const
+   {
+      return theNumberOfOutputRowsPerSubframe;
+   }
+   ossim_uint32  getSubframeMaskTableOffset()const
+   {
+      return theSubframeMaskTableOffset;
+   }
+   ossim_uint32  getTransparencyMaskTableOffset()const
+   {
+      return theTransparencyMaskTableOffset;
+   }
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+   
+private:
+   void clearFields();
+   // work variables to store useful information.
+   ossim_uint32 theStartOffset;
+   ossim_uint32 theEndOffset;
+
+   ossim_uint16 theNumberOfSpectralGroups;
+   ossim_uint16 theNumberOfSubframeTables;
+   ossim_uint16 theNumberOfSpectralBandTables;
+   ossim_uint16 theNumberOfSpectralBandLinesPerImageRow;
+
+   /*!
+    * Each frame file could be divided into sub frames.
+    * This identifies the number of subframes in the
+    * horizontal direction.
+    */
+   ossim_uint16 theNumberOfSubframesHorizontal;
+
+   /*!
+    * Each frame file could be divided into sub frames.
+    * This identifies the number of subframes in the
+    * vertical direction.
+    */
+   ossim_uint16 theNumberOfSubframesVertical;
+   ossim_uint32 theNumberOfOutputColumnsPerSubframe;
+   ossim_uint32 theNumberOfOutputRowsPerSubframe;
+   ossim_uint32 theSubframeMaskTableOffset;
+   ossim_uint32 theTransparencyMaskTableOffset;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfImageDisplayParameterSubheader.h b/include/ossim/support_data/ossimRpfImageDisplayParameterSubheader.h
new file mode 100644
index 0000000..acb5674
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfImageDisplayParameterSubheader.h
@@ -0,0 +1,60 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id$
+
+#ifndef ossimRpfImageDisplayParameterSubheader_HEADER
+#define ossimRpfImageDisplayParameterSubheader_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIosFwd.h>
+
+class ossimRpfImageDisplayParameterSubheader
+{
+public:
+   friend std::ostream& operator<<(
+      std::ostream& out, const ossimRpfImageDisplayParameterSubheader& data);
+   ossimRpfImageDisplayParameterSubheader();
+   ossimErrorCode parseStream(ossim::istream& in, ossimByteOrder byteOrder);
+   
+   void print(std::ostream& out)const;
+
+   ossim_uint32 getStartOffset()const
+      {
+         return theStartOffset;
+      }
+   ossim_uint32 getEndOffset()const
+      {
+         return theEndOffset;
+      }
+   ossim_uint32 getNumberOfImageRows()const
+      {
+         return theNumberOfImageRows;
+      }
+   ossim_uint32 getNumberOfImageCodesPerRow()const
+      {
+         return theNumberOfImageCodesPerRow;
+      }
+   ossim_uint32 getImageCodeLength()const
+      {
+         return theImageCodeBitLength;
+      }
+   
+private:
+   void clearFields();
+
+   ossim_uint32 theStartOffset;
+   ossim_uint32 theEndOffset;
+   
+   ossim_uint32 theNumberOfImageRows;
+   ossim_uint32 theNumberOfImageCodesPerRow;
+   ossim_uint8  theImageCodeBitLength;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfInfo.h b/include/ossim/support_data/ossimRpfInfo.h
new file mode 100644
index 0000000..290924d
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfInfo.h
@@ -0,0 +1,62 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Mingjie Su
+//
+// Description: Rpf Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfInfo.h 1236 2010-08-05 19:45:44Z ming.su $
+#ifndef ossimRpfInfo_HEADER
+#define ossimRpfInfo_HEADER
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+
+class ossimKeywordlist;
+/**
+ * @brief HDF info class.
+ *
+ * Encapsulates the HDF functionality.
+ */
+class ossimRpfInfo : public ossimInfoBase
+{
+public:
+
+   /** default constructor */
+   ossimRpfInfo();
+
+   /** virtual destructor */
+   virtual ~ossimRpfInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   bool isOpen();
+
+   private: 
+   
+     ossimFilename                       theFile;
+     ossimFilename                       m_infoFile;
+};
+
+#endif /* End of "#ifndef ossimRpfInfo_HEADER" */
diff --git a/include/ossim/support_data/ossimRpfLocationSection.h b/include/ossim/support_data/ossimRpfLocationSection.h
new file mode 100644
index 0000000..a1eeaaf
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfLocationSection.h
@@ -0,0 +1,167 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfLocationSection.h 16997 2010-04-12 18:53:48Z dburken $
+#ifndef ossimRpfLocationSection_HEADER
+#define ossimRpfLocationSection_HEADER
+
+#include <iosfwd>
+#include <vector>
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimRpfConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+
+//  10 byte record
+class ossimRpfComponentLocationRecord
+{
+public:
+   friend std::ostream& operator<<(
+      std::ostream& out, const ossimRpfComponentLocationRecord& data);
+
+   /** default constructor */
+   ossimRpfComponentLocationRecord();
+
+   /** copy constructor */
+   ossimRpfComponentLocationRecord(const ossimRpfComponentLocationRecord& record);
+
+   /** assignment operator */
+   const ossimRpfComponentLocationRecord& operator=(const ossimRpfComponentLocationRecord& rhs);
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+
+   ossimErrorCode parseStream(std::istream& in, ossimByteOrder endianOrder);
+
+   /**
+    * @brief Write method.
+    *
+    * @param out Stream to write to.
+    */
+   void writeStream(std::ostream& out);
+
+   /*!
+    * The component is a 2-Byte unsigned value which
+    * identitfies a level-2 component.  The table can be
+    * found in MIL-STD-2411-1 in section 5.1.1 and in ossimRpfConstants.h.
+    */
+   ossim_uint16 m_componentId;
+
+   /*!
+    * Is a 4 byte unsigned integer indicating the length in
+    * bytes of the component.
+    */
+   ossim_uint32  m_componentLength;
+
+   /*!
+    * Is a 4 byte value defining the absolute address (byte number)
+    * of the first byte of the component measured
+    * from the beginning of the RPF Frame file.
+    */ 
+   ossim_uint32  m_componentLocation;
+};
+
+class ossimRpfLocationSection
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimRpfLocationSection &data);
+   ossimRpfLocationSection();
+   virtual ~ossimRpfLocationSection(){}
+
+   virtual ossimErrorCode parseStream(std::istream& in,
+                                      ossimByteOrder endianOrder);
+
+   /**
+    * @brief Write method.
+    *
+    * @param out Stream to write to.
+    */
+   void writeStream(std::ostream& out);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+
+   /*!
+    * Will let you know if a component exists within the location section.
+    * these component Ids' are defined in the MIL-STD-2411-1 standards doc.
+    * the ossimRpfComponentId is in ossimRpfConstants.h
+    */
+   bool hasComponent(ossimRpfComponentId componentId)const;
+
+   bool getComponent(ossimRpfComponentId componentId,
+                     ossimRpfComponentLocationRecord& result)const;
+
+   /**
+    * @brief Method to add a component location record.
+    *
+    * This will push the record onto the back of theComponentLocationList array.
+    *
+    * @param record Record to add to array.
+    */
+   void addComponentRecord(const ossimRpfComponentLocationRecord& record);
+
+   void setLocationSectionLength(ossim_uint16 length);
+   void setLocationTableOffset(ossim_uint32 offset);
+   void setNumberOfComponentLocationRecords(ossim_uint16 count);
+   void setLocationRecordLength(ossim_uint16 length);
+   void setComponentAggregateLength(ossim_uint32 length);
+
+   /** @brief Clears records and fields. Public interface to clearFields. */
+   void clearFields();
+
+   /** Brief Direct access to the list of records. */
+   std::vector<ossimRpfComponentLocationRecord>& getLocationRecordList();
+   
+private:
+
+   /*!
+    * This is a 2 byte unsigned short >= 34 indicatin
+    * the length in bytes of the entire location section
+    */
+   ossim_uint16 m_locationSectionLength;
+
+   ossim_uint32 m_locationTableOffset;
+
+   ossim_uint16 m_numberOfComponentLocationRecords;
+
+   ossim_uint16 m_locationRecordLength;
+
+   ossim_uint32 m_componentAggregateLength;
+
+   /*!
+    * Since there are not very many components within an Rpf file
+    * it would be overkill to sort these components into an stl
+    * map.  We will just use an array (stl vector) and do linear searches
+    * for components when we need to.
+    */
+   std::vector<ossimRpfComponentLocationRecord> m_componentLocationList;
+};
+
+#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfMaskSubheader.h b/include/ossim/support_data/ossimRpfMaskSubheader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfMaskSubheader.h
rename to include/ossim/support_data/ossimRpfMaskSubheader.h
diff --git a/ossim/include/ossim/support_data/ossimRpfMaskSubsection.h b/include/ossim/support_data/ossimRpfMaskSubsection.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfMaskSubsection.h
rename to include/ossim/support_data/ossimRpfMaskSubsection.h
diff --git a/ossim/include/ossim/support_data/ossimRpfPathnameRecord.h b/include/ossim/support_data/ossimRpfPathnameRecord.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfPathnameRecord.h
rename to include/ossim/support_data/ossimRpfPathnameRecord.h
diff --git a/ossim/include/ossim/support_data/ossimRpfReplaceUpdateRecord.h b/include/ossim/support_data/ossimRpfReplaceUpdateRecord.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfReplaceUpdateRecord.h
rename to include/ossim/support_data/ossimRpfReplaceUpdateRecord.h
diff --git a/ossim/include/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h b/include/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h
rename to include/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h
diff --git a/ossim/include/ossim/support_data/ossimRpfReplaceUpdateTable.h b/include/ossim/support_data/ossimRpfReplaceUpdateTable.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimRpfReplaceUpdateTable.h
rename to include/ossim/support_data/ossimRpfReplaceUpdateTable.h
diff --git a/include/ossim/support_data/ossimRpfToc.h b/include/ossim/support_data/ossimRpfToc.h
new file mode 100644
index 0000000..95d6b77
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfToc.h
@@ -0,0 +1,262 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRpfToc.h 18044 2010-09-06 14:20:52Z dburken $
+#ifndef osimRpfToc_HEADER
+#define osimRpfToc_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimRpfHeader.h>
+
+#include <vector>
+#include <iosfwd>
+
+class ossimRpfFrameFileIndexSubsection;
+class ossimRpfTocEntry;
+class ossimRpfFrameEntry;
+
+class OSSIM_DLL ossimRpfToc : public ossimReferenced
+{
+public:
+   friend OSSIM_DLL std::ostream& operator <<(std::ostream& out,
+                                              const ossimRpfToc& data);
+   ossimRpfToc();
+
+   virtual ~ossimRpfToc();
+
+   /**
+    * @brief Parses a.toc file.
+    * @param fileName File to parse.
+    * @param keepFileHeader If true the ossimNitfFileHeader will be kept.
+    * @return ossimErrorCodes::OSSIM_OK on success, ossimErrorCodes::OSSIM_ERROR on error.
+    */
+   ossimErrorCode parseFile(const ossimFilename &fileName,
+                            bool keepFileHeader = false);
+
+   /**
+    * @brief Creates a new a.toc file from list of rpf frames in output directory.
+    *
+    * @param dotRpfFile File containing list of rpf frames wanted.
+    *
+    * @param outputDir Directory to write a.toc file and rpf frames to.
+    *
+    * @see ossim-rpf application usage for dotRpfFile format.
+    *
+    * @note Throws ossimException on error.
+    */
+   void createTocAndCopyFrames( const ossimFilename& dotRpfFile,
+                                const ossimFilename& outputDir);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf.rpf." and key is "file_name" key becomes:
+    * "nitf.rpm.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print( std::ostream& out,
+                        const std::string& prefix=std::string(),
+                        bool printOverviews=false ) const;
+   
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    *
+    * This prints the rpf header part only.
+    * 
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf.rpf." and key is "file_name" key becomes:
+    * "nitf.rpf.file_name:"
+    * @return output stream.
+    */   
+   std::ostream& printHeader( std::ostream& out,
+                              const std::string& prefix=std::string() ) const;
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    *
+    * This prints the specific rpf toc entry.
+    * 
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf.rpf." and key is "file_name" key becomes:
+    * "nitf.rpf.file_name:"
+    * @return output stream.
+    */   
+   std::ostream& printTocEntry( std::ostream& out,
+                                ossim_uint32 entryIndex,
+                                const std::string& prefix=std::string(),
+                                bool printOverviews=false ) const;
+   
+   
+   ossim_uint32 getNumberOfEntries()const;
+   
+   const ossimRpfTocEntry* getTocEntry(ossim_uint32 index)const;
+
+   /**
+    * Returns -1 if not found.
+    */
+   ossim_int32 getTocEntryIndex(const ossimRpfTocEntry* entry);
+
+   /**
+    * @brief Get the nitf file header.
+    *
+    * @return The nitf file header or 0 if not set.
+    */
+   const ossimNitfFileHeader* getNitfFileHeader()const;
+   
+   const ossimRpfHeader* getRpfHeader() const;
+
+   /**
+    * For the given entry index, this routine returns the number of 
+    * frames that exist in the horizontal direction. If the entry index
+    * is invalid, 0 frames are returned.
+    *
+    * @param idx the entry index.
+    * @return number of frames in the horizontal direction
+    */
+   ossim_uint32 getNumberOfFramesHorizontal(ossim_uint32 idx)const;
+
+   /**
+    * For the given entry index, this routine returns the number of 
+    * frames that exist in the vertical direction. If the entry index
+    * is invalid, 0 frames are returned.
+    *
+    * @param idx the entry index.
+    * @return number of frames in the vertical direction
+    */
+   ossim_uint32 getNumberOfFramesVertical(ossim_uint32 idx)const;
+
+   /**
+    * For the given entry index, frame row, and frame column, this 
+    * routine returns the corresponding ossimRpfFrameEntry instance. 
+    *
+    * @param entryIdx the entry index.
+    * @param row the frame row.
+    * @param col the frame col.
+    * @return true if successful
+    */
+   bool getRpfFrameEntry(ossim_uint32 entryIdx, 
+                         ossim_uint32 row,
+                         ossim_uint32 col,
+                         ossimRpfFrameEntry& result)const;
+
+   /**
+    * For the given entry index, frame row, and frame column, this 
+    * routine returns the corresponding name of the frame image
+    * with respect to the location of the toc file. 
+    *
+    * @param entryIdx the entry index.
+    * @param row the frame row.
+    * @param col the frame col.
+    * @return the name of the frame image
+    */
+   const ossimString getRelativeFramePath( ossim_uint32 entryIdx,
+                                           ossim_uint32 row,
+                                           ossim_uint32 col)const;
+
+   /**
+    * @brief Method to get the root directory from the a.toc file name.
+    * @param dir This initializes dir.
+    */
+   void getRootDirectory(ossimFilename& dir) const;
+
+private:
+   void deleteAll();
+   void clearAll();
+   void deleteTocEntryList();
+   void buildTocEntryList(ossimRpfHeader* rpfHeader);
+   void allocateTocEntryList(ossim_uint32 numberOfEntries);
+
+   /** @brief Walks through frames to find the first entry that exists... */
+   void getFirstEntry(const ossimRpfTocEntry* rpfTocEntry,
+                      ossimRpfFrameEntry& frameEntry) const;
+
+   /**
+    * @brief Writes the frame file sub section of an a.toc.
+    * 
+    * This is a utility method for createTocAndCopyFrames method. 
+    */
+   void writeFrameFileIndexSection(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
+                                   std::ifstream& dotRpfStr,
+                                   std::ofstream& dotTocStr);
+
+   /**
+    * @brief Copies frame to output directory.
+    * 
+    * This is a utility method for createTocAndCopyFrames method. 
+    */
+   void copyFrames(std::ifstream& dotRpfStr, const ossimFilename& outputDir);
+
+   
+
+   /**
+    * @brief Get the number of frames from the dot rpf file.
+    * This is a utility method for createTocAndCopyFrames method.
+    */
+   ossim_uint32 getNumberOfFrames(std::ifstream& dotRpfStr) const;
+
+   /**
+    * @brief Get a.toc file from the dot rpf file.
+    * This is a utility method for createTocAndCopyFrames method.
+    */
+   ossimFilename getSourceTocFile(std::ifstream& dotRpfStr) const;
+
+   /**
+    * @brief Gets the zero based entry number for the first file in the dot rpf file.
+    * This is a utility method for createTocAndCopyFrames method.
+    */
+   bool getCorespondingEntry(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
+                             std::ifstream& dotRpfStr,
+                             ossim_uint32& entry) const;
+   
+   /**
+    * @brief Gets the filename from line in.
+    *
+    * Line format:
+    *
+    * /data/spadac/rpf-frame-test/t1/N03E030/005FNU1B.I21|30.9141787715578,3.03831480449669|30.9889225265623,3.10741371349693
+    *
+    * @param line Line to extract filename from.
+    *
+    * @param out Filename to initialize.
+    *
+    * This is a utility method for createTocAndCopyFrames method.
+    */
+   bool getFile(const std::string& line, ossimFilename& file) const;
+
+   /*!
+    * This will hold a list of table of content entries.  There is one entry
+    * per directory.  Each entry will have its geographic coverage.
+    * Each directory is then divided into frames.  There could be 30 or
+    * more frame images that make up an entire image.
+    */
+   std::vector<ossimRpfTocEntry*> m_tocEntryList;
+   
+   /*!
+    * We will remember the file that we opened
+    */
+   ossimFilename m_filename;
+
+   ossimRefPtr<const ossimNitfFileHeader> m_nitfFileHeader;
+   
+   ossimRefPtr<ossimRpfHeader> m_rpfHeader;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRpfTocEntry.h b/include/ossim/support_data/ossimRpfTocEntry.h
new file mode 100644
index 0000000..9debe6c
--- /dev/null
+++ b/include/ossim/support_data/ossimRpfTocEntry.h
@@ -0,0 +1,113 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfTocEntry.h 19900 2011-08-04 14:19:57Z dburken $
+#ifndef ossimRpfTocEntry_HEADER
+#define ossimRpfTocEntry_HEADER
+
+#include <vector>
+#include <iosfwd>
+
+#include <ossim/support_data/ossimRpfBoundaryRectRecord.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/support_data/ossimRpfFrameEntry.h>
+
+class ossimIrect;
+
+class OSSIMDLLEXPORT ossimRpfTocEntry
+{
+public:
+   friend std::ostream& operator <<(std::ostream& out,
+                                    const ossimRpfTocEntry& data);
+   ossimRpfTocEntry();
+   ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder);
+
+   /**
+    * @brief print method that outputs a key/value type format adding prefix
+    * to keys.
+    * @param out String to output to.
+    * @param prefix This will be prepended to key.
+    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
+    * "nitf.file_name:"
+    * @return output stream.
+    */
+   std::ostream& print(std::ostream& out,
+                       const std::string& prefix=std::string()) const;
+   
+   void setEntry(const ossimRpfFrameEntry& entry,
+                 long row,
+                 long col);
+
+   bool getEntry(long row,
+                 long col,
+                 ossimRpfFrameEntry& result)const;
+
+   ossimString getProductType() const;
+   
+   /*!
+    * returns how many subimges or frames exist in the horizontal
+    * direction.
+    */
+   ossim_uint32 getNumberOfFramesHorizontal()const;
+
+   /*!
+    * returns how many subimges or frames exist in the vertical
+    * direction.
+    */
+   ossim_uint32 getNumberOfFramesVertical()const;
+
+   /** @return The number of lines (frames vertical * 1536). */
+   ossim_uint32 getNumberOfLines() const;
+
+   /** @return The number of samples (frames horizontal * 1536). */
+   ossim_uint32 getNumberOfSamples() const;
+
+   /** @return Number of bands. */
+   ossim_uint32 getNumberOfBands() const;
+   
+   /**
+    * @brief Get the bounding rect of entry.
+    * @param rect Gets initialized with rect.
+    */
+   void getBoundingRect(ossimIrect& rect) const;
+   
+   const ossimRpfBoundaryRectRecord& getBoundaryInformation()const;
+
+   /*!
+    * If there is an entry and all the files don't exist we will return
+    * true.
+    */
+   bool isEmpty()const;
+
+   /**
+    * Returns the image geometry object associated with this tile source or
+    * NULL if non defined.  The geometry contains full-to-local image
+    * transform as well as projection (image-to-world).
+    */
+   ossimRefPtr<ossimImageGeometry> getImageGeometry() const;
+
+   /** @brief Get the scale in decimal degrees per pixel. */
+   void getDecimalDegreesPerPixel(ossimDpt& scale) const;
+
+   /** @brief Get the scale in meters per pixel. */
+   void getMetersPerPixel(ossimDpt& scale) const;
+   
+private:
+   void allocateFrameEntryArray();
+   
+   ossimRpfBoundaryRectRecord theBoundaryInformation;
+   ossim_uint32  theNumSamples; //!> May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10)
+   std::vector< std::vector<ossimRpfFrameEntry> > theFrameEntryArray;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimRsmida.h b/include/ossim/support_data/ossimRsmida.h
new file mode 100644
index 0000000..760dc07
--- /dev/null
+++ b/include/ossim/support_data/ossimRsmida.h
@@ -0,0 +1,173 @@
+//---
+// File: ossimRsmida.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//---
+#ifndef ossimRsmida_H
+#define ossimRsmida_H 1
+
+#include <ossim/base/ossimConstants.h>
+#include <string>
+
+class ossimKeywordlist;
+class ossimNitfRsmidaTag;
+
+/**
+ * @class Public container RSM Identification(RSMIDA) TRE.
+ *
+ * Reference:
+ * Replacement Sensor Model Tagged Record Extensions Specification for NITF 2.1
+ * section 7.0(RSMIDA).
+ */
+class ossimRsmida
+{
+public:
+   
+   /** @brief default constructor */
+   ossimRsmida();
+
+   /** @brief copy constructor */
+   ossimRsmida( const ossimRsmida& obj );
+
+   /** @brief assignment operator */
+   const ossimRsmida& operator=( const ossimRsmida& rhs );
+
+   /**
+    * @brief saveState Saves state to keyword list.
+    * @param kwl
+    * @param prefix
+    */
+   void saveState( ossimKeywordlist& kwl,
+                   const std::string& prefix ) const;
+
+   /**
+    * @brief loadState Loads state from keyword list.
+    * @param kwl
+    * @param prefix
+    * @return true on success; false, on error.
+    */
+   bool loadState( const ossimKeywordlist& kwl,
+                   const std::string& prefix );
+
+   /**
+    * @brief initialize Initializes from nitf rsmida tag.
+    * @param rsmidaTag
+    * @return true on success; false, on error.
+    */
+   bool initialize( const ossimNitfRsmidaTag* rsmidaTag );
+   
+   std::string m_iid;
+   std::string m_edition;
+
+   std::string m_isid;
+   std::string m_sid;
+   std::string m_stid;
+   
+   ossim_uint32  m_year;
+   ossim_uint32  m_month;
+   ossim_uint32  m_day;
+   ossim_uint32  m_hour;
+   ossim_uint32  m_minute;
+   ossim_float64 m_second;
+
+   ossim_uint32 m_nrg;
+   ossim_uint32 m_ncg;
+   
+   ossim_float64 m_trg;
+   ossim_float64 m_tcg;
+
+   char m_grndd;
+
+   ossim_float64 m_xuor;
+   ossim_float64 m_yuor;
+   ossim_float64 m_zuor;
+
+   ossim_float64 m_xuxr;
+   ossim_float64 m_xuyr;
+   ossim_float64 m_xuzr;
+
+   ossim_float64 m_yuxr;
+   ossim_float64 m_yuyr;
+   ossim_float64 m_yuzr;
+
+   ossim_float64 m_zuxr;
+   ossim_float64 m_zuyr;
+   ossim_float64 m_zuzr;
+
+   ossim_float64 m_v1x;
+   ossim_float64 m_v1y;
+   ossim_float64 m_v1z;
+
+   ossim_float64 m_v2x;
+   ossim_float64 m_v2y;
+   ossim_float64 m_v2z;
+
+   ossim_float64 m_v3x;
+   ossim_float64 m_v3y;
+   ossim_float64 m_v3z;
+
+   ossim_float64 m_v4x;
+   ossim_float64 m_v4y;
+   ossim_float64 m_v4z;
+
+   ossim_float64 m_v5x;
+   ossim_float64 m_v5y;
+   ossim_float64 m_v5z;
+
+   ossim_float64 m_v6x;
+   ossim_float64 m_v6y;
+   ossim_float64 m_v6z;
+
+   ossim_float64 m_v7x;
+   ossim_float64 m_v7y;
+   ossim_float64 m_v7z;
+
+   ossim_float64 m_v8x;
+   ossim_float64 m_v8y;
+   ossim_float64 m_v8z;
+
+   ossim_float64 m_grpx;
+   ossim_float64 m_grpy;
+   ossim_float64 m_grpz;
+
+   ossim_uint32 m_fullr;
+   ossim_uint32 m_fullc;
+
+   ossim_uint32 m_minr;
+   ossim_uint32 m_maxr;
+   ossim_uint32 m_minc;
+   ossim_uint32 m_maxc;
+
+   ossim_float64 m_ie0;
+   ossim_float64 m_ier;
+   ossim_float64 m_iec;
+   
+   ossim_float64 m_ierr;
+   ossim_float64 m_ierc;
+   ossim_float64 m_iecc;
+
+   ossim_float64 m_ia0;
+   ossim_float64 m_iar;
+   ossim_float64 m_iac;
+   
+   ossim_float64 m_iarr;
+   ossim_float64 m_iarc;
+   ossim_float64 m_iacc;
+
+   ossim_float64 m_spx;
+   ossim_float64 m_svx;
+   ossim_float64 m_sax;
+
+   ossim_float64 m_spy;
+   ossim_float64 m_svy;
+   ossim_float64 m_say;
+
+   ossim_float64 m_spz;
+   ossim_float64 m_svz;
+   ossim_float64 m_saz;
+
+}; // End: class ossimRsmida()
+
+#endif /* #ifndef ossimRsmida!_H */
diff --git a/include/ossim/support_data/ossimRsmpca.h b/include/ossim/support_data/ossimRsmpca.h
new file mode 100644
index 0000000..e5c0161
--- /dev/null
+++ b/include/ossim/support_data/ossimRsmpca.h
@@ -0,0 +1,118 @@
+//---
+// File: ossimRsmpca.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//---
+#ifndef ossimRsmpca_H
+#define ossimRsmpca_H 1
+
+#include <ossim/base/ossimConstants.h>
+#include <string>
+#include <vector>
+
+class ossimKeywordlist;
+class ossimNitfRsmpcaTag;
+
+/**
+ * @class Public container for RSM Polynomial Coefficients(RSMPCA) TRE.
+ *
+ * Reference:
+ * Replacement Sensor Model Tagged Record Extensions Specification for NITF 2.1
+ * section 9.0(RSMPCA).
+ * 
+ */
+class ossimRsmpca
+{
+public:
+   
+   /** @brief default constructor */
+   ossimRsmpca();
+
+   /** @brief copy constructor */
+   ossimRsmpca( const ossimRsmpca& obj );
+
+   /** @brief assignment operator */
+   const ossimRsmpca& operator=( const ossimRsmpca& rhs );
+
+   /**
+    * @brief saveState Saves state to keyword list.
+    * @param kwl
+    * @param prefix
+    * @param index
+    */
+   void saveState( ossimKeywordlist& kwl,
+                   const std::string& prefix,
+                   ossim_uint32 index ) const;
+   
+   /**
+    * @brief loadState Loads state from keyword list.
+    * @param kwl
+    * @param prefix
+    * @param index
+    * @return true on success; false, on error.
+    */
+   bool loadState( const ossimKeywordlist& kwl,
+                   const std::string& prefix,
+                   ossim_uint32 index );
+   
+   /**
+    * @brief initialize Initializes from nitf rsmpia tag.
+    * @param rsmpiaTag
+    * @return true on success; false, on error.
+    */
+   bool initialize( const ossimNitfRsmpcaTag* rsmpcaTag );
+
+   std::string m_iid;
+   std::string m_edition;
+
+   ossim_uint32 m_rsn;
+   ossim_uint32 m_csn;
+
+   ossim_float64 m_rfep;
+   ossim_float64 m_cfep;
+
+   ossim_float64 m_rnrmo;
+   ossim_float64 m_cnrmo;
+   ossim_float64 m_xnrmo;
+   ossim_float64 m_ynrmo;
+   ossim_float64 m_znrmo;
+
+   ossim_float64 m_rnrmsf;
+   ossim_float64 m_cnrmsf;
+   ossim_float64 m_xnrmsf;
+   ossim_float64 m_ynrmsf;
+   ossim_float64 m_znrmsf;
+   
+   ossim_uint32 m_rnpwrx;
+   ossim_uint32 m_rnpwry;
+   ossim_uint32 m_rnpwrz;
+   ossim_uint32 m_rntrms;
+
+   std::vector<ossim_float64> m_rnpcf;
+
+   ossim_uint32 m_rdpwrx;
+   ossim_uint32 m_rdpwry;
+   ossim_uint32 m_rdpwrz;
+   ossim_uint32 m_rdtrms;
+
+   std::vector<ossim_float64> m_rdpcf;
+
+   ossim_uint32 m_cnpwrx;
+   ossim_uint32 m_cnpwry;
+   ossim_uint32 m_cnpwrz;
+   ossim_uint32 m_cntrms;
+
+   std::vector<ossim_float64> m_cnpcf;
+
+   ossim_uint32 m_cdpwrx;
+   ossim_uint32 m_cdpwry;
+   ossim_uint32 m_cdpwrz;
+   ossim_uint32 m_cdtrms;
+
+   std::vector<ossim_float64> m_cdpcf;
+
+}; // End: class ossimRsmpca()
+
+#endif /* #ifndef ossimRsmpca_H */
diff --git a/include/ossim/support_data/ossimRsmpia.h b/include/ossim/support_data/ossimRsmpia.h
new file mode 100644
index 0000000..775a1ad
--- /dev/null
+++ b/include/ossim/support_data/ossimRsmpia.h
@@ -0,0 +1,99 @@
+//---
+// File: ossimRsmpia.h
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//---
+#ifndef ossimRsmpia_H
+#define ossimRsmpia_H 1
+
+#include <ossim/base/ossimConstants.h>
+#include <string>
+
+class ossimKeywordlist;
+class ossimNitfRsmpiaTag;
+
+/**
+ * @class Public container RSM Polynomial Identification(RSMPIA) TRE.
+ *
+ * Reference:
+ * Replacement Sensor Model Tagged Record Extensions Specification for NITF 2.1
+ * section 8.0(RSMPIA).
+ */
+class ossimRsmpia
+{
+public:
+   
+   /** @brief default constructor */
+   ossimRsmpia();
+
+   /** @brief copy constructor */
+   ossimRsmpia( const ossimRsmpia& obj );
+
+   /** @brief assignment operator */
+   const ossimRsmpia& operator=( const ossimRsmpia& rhs );
+
+   /**
+    * @brief saveState Saves state to keyword list.
+    * @param kwl
+    * @param prefix
+    */
+   void saveState( ossimKeywordlist& kwl,
+                   const std::string& prefix ) const;
+
+   /**
+    * @brief loadState Loads state from keyword list.
+    * @param kwl
+    * @param prefix
+    * @return true on success; false, on error.
+    */
+   bool loadState( const ossimKeywordlist& kwl,
+                   const std::string& prefix );
+
+   /**
+    * @brief initialize Initializes from nitf rsmpia tag.
+    * @param rsmpiaTag
+    * @return true on success; false, on error.
+    */
+   bool initialize( const ossimNitfRsmpiaTag* rsmpiaTag );
+   
+   std::string   m_iid;
+   std::string   m_edition;
+
+   ossim_float64 m_r0;
+   ossim_float64 m_rx;
+   ossim_float64 m_ry;
+   ossim_float64 m_rz;
+
+   ossim_float64 m_rxx;
+   ossim_float64 m_rxy;
+   ossim_float64 m_rxz;
+
+   ossim_float64 m_ryy;
+   ossim_float64 m_ryz;
+   ossim_float64 m_rzz;
+
+   ossim_float64 m_c0;
+   ossim_float64 m_cx;
+   ossim_float64 m_cy;
+   ossim_float64 m_cz;
+
+   ossim_float64 m_cxx;
+   ossim_float64 m_cxy;
+   ossim_float64 m_cxz;   
+
+   ossim_float64 m_cyy;
+   ossim_float64 m_cyz;
+   ossim_float64 m_czz;
+
+   ossim_uint32  m_rnis;
+   ossim_uint32  m_cnis;
+   ossim_uint32  m_tnis;
+
+   ossim_uint32  m_rssiz;
+   ossim_uint32  m_cssiz;
+
+}; // End: class ossimRsmpia()
+
+#endif /* #ifndef ossimRsmpia_H */
diff --git a/ossim/include/ossim/support_data/ossimSpaceImagingGeom.h b/include/ossim/support_data/ossimSpaceImagingGeom.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimSpaceImagingGeom.h
rename to include/ossim/support_data/ossimSpaceImagingGeom.h
diff --git a/ossim/include/ossim/support_data/ossimSpotDimapSupportData.h b/include/ossim/support_data/ossimSpotDimapSupportData.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimSpotDimapSupportData.h
rename to include/ossim/support_data/ossimSpotDimapSupportData.h
diff --git a/ossim/include/ossim/support_data/ossimSrcRecord.h b/include/ossim/support_data/ossimSrcRecord.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimSrcRecord.h
rename to include/ossim/support_data/ossimSrcRecord.h
diff --git a/ossim/include/ossim/support_data/ossimSrtmFilename.h b/include/ossim/support_data/ossimSrtmFilename.h
similarity index 100%
rename from ossim/include/ossim/support_data/ossimSrtmFilename.h
rename to include/ossim/support_data/ossimSrtmFilename.h
diff --git a/include/ossim/support_data/ossimSrtmSupportData.h b/include/ossim/support_data/ossimSrtmSupportData.h
new file mode 100644
index 0000000..2d97a0f
--- /dev/null
+++ b/include/ossim/support_data/ossimSrtmSupportData.h
@@ -0,0 +1,206 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Support data class for a Shuttle Radar Topography Mission (SRTM) file.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimSrtmSupportData_HEADER
+#define ossimSrtmSupportData_HEADER 1
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/projection/ossimProjection.h>
+#include <memory>
+
+/**
+ * @class ossimStrmSupportData
+ * Support data class for a Shuttle Radar Topography Mission (SRTM) file.
+ * Provides lines, samples, post spacing and geometry info given a valid
+ * srtm file.  This class will set an error if the file is not deemed to
+ * be valid.
+ */
+class OSSIMDLLEXPORT ossimSrtmSupportData : public ossimObject
+{
+public:
+   /** default constructor */
+   ossimSrtmSupportData();
+
+   /** destructor */
+   virtual ~ossimSrtmSupportData();
+
+   /**
+    * Initializes object from file.  File is expected to be in a format like
+    * N27W081.hgt or n27w081.hgt where "N27" is the South West latitude of
+    * the cell and "W081" is the South West longitude of the cell.
+    *
+    * @param srtmFile File to set.
+    *
+    * @param scanForMinMax If true and there is no ossim meta data file with
+    * the min and max keywords in it, this will call computeMinMax which will
+    * scan the file for min and max.
+    *
+    * @return Returns true if file is deemed to be an srtm, false if not.
+    *
+    * @note This will write an ossim meta data (.omd) if one does not exists.
+    */
+   bool setFilename(const ossimFilename& srtmFile,
+                    bool scanForMinMax = false);
+
+   /** @return Returns the srtm file name. */
+   ossimFilename getFilename() const;
+
+   /**
+    * @return Returns the number of lines or rows.  Returns  OSSIM_UINT_NAN
+    * if not initialized or file was invalid.
+    */
+   ossim_uint32 getNumberOfLines() const;
+   
+   /**
+    * @return Returns the number of samples or columns. Returns
+    * OSSIM_UINT_NAN if not initialized or file was invalid.
+    */
+   ossim_uint32 getNumberOfSamples() const;
+
+   /**
+    *  Populates the keyword list with image geometry information.  This
+    *  method is used to relay projection information to users.
+    *
+    *  @param kwl Keyword list that will be initialized with geometry info.
+    *  Returns true if geometry info is present, false if not.
+    *
+    *  @param prefix The prefix is added to the resulting keyword list
+    *  keywords.  So is you if you pass in a prefix of "image01.", the
+    *  keyword ul_lat will be like:  "image01.ul_lat:  -40.00000"
+    */
+   virtual bool getImageGeometry(ossimKeywordlist& kwl, const char* prefix=0);
+
+   /**
+    * @brief Gets the projection for srtm cell.
+    * @return  The projection for srtm cell.
+    */
+   ossimRefPtr<ossimProjection> getProjection() const;
+
+   /**
+    * Method to save the state of the object to a keyword list.
+    * Return true if ok or false on error.
+    */
+   virtual bool saveState(ossimKeywordlist& kwl,
+                          const char* prefix=0) const;
+   
+   /**
+    * Method to the load (recreate) the state of the object from a keyword
+    * list.  Return true if ok or false on error.
+    */
+   virtual bool loadState(const ossimKeywordlist& kwl,
+                          const char* prefix=0);
+   
+   /**
+    * @return Returns the Southwest latitude in decimal degrees. Returns
+    * OSSIM_DBL_NAN if not initialized or file was invalid.
+    */
+   ossim_float64 getSouthwestLatitude() const;
+
+   /**
+    * @return Returns the Southwest longitude in decimal degrees.  Returns
+    * OSSIM_DBL_NAN if not initialized or file was invalid.
+    */
+   ossim_float64 getSouthwestLongitude() const;
+   
+   /**
+    * @return Returns the latitude spacing in decimal degrees. Returns
+    * OSSIM_DBL_NAN if not initialized or file was invalid.
+    */
+   ossim_float64 getLatitudeSpacing() const;
+
+   /**
+    * @return Returns the longitude spacing in decimal degrees.  Returns
+    * OSSIM_DBL_NAN if not initialized or file was invalid.
+    */
+   ossim_float64 getLongitudeSpacing() const;
+
+   /**
+    * @return Returns the minimum pixel value.  This is also
+    * the minimum height above sea level.  Returns
+    * OSSIM_SSHORT_NAN if not initialized or file was invalid.
+    */
+   ossim_float64 getMinPixelValue() const;
+
+   /**
+    * @return Returns the maximum pixel value.  This is also
+    * the minimum height above sea level.  Returns
+    * OSSIM_SSHORT_NAN if not initialized or file was invalid.
+    */
+   ossim_float64 getMaxPixelValue() const;
+
+   ossimScalarType getScalarType()const;
+   /**
+    * Prints data members for debug.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+private:
+
+   /**
+    * This is a loadState called by setFilename that does not reset "theFile".
+    */
+   bool loadOmd(const ossimKeywordlist& kwl, const char* prefix=0);
+
+   /** Sets all data members to an unitialized state. */
+   void clear();
+
+   /**
+    * Sets corner points from "theFile".
+    *
+    * @return true on success, false on error.
+    */
+   bool setCornerPoints();
+   
+   /**
+    * Sets lines and samples from "theFile" size.
+    *
+    * @return true on success, false on error.
+    */
+   bool setSize();
+
+   /**
+    * Scans file for min and max pixels.
+    *
+    * @retun true on success, false on error.
+    */
+   bool computeMinMax();
+  
+   ossimFilename m_file;
+   ossim_uint32  m_numberOfLines;
+   ossim_uint32  m_numberOfSamples;
+   ossim_float64 m_southwestLatitude;  //< decimal degrees
+   ossim_float64 m_southwestLongitude; //< decimal degrees
+   ossim_float64 m_latSpacing;         //< decimal degrees
+   ossim_float64 m_lonSpacing;         //< decimal degrees
+   ossim_float64 m_minPixelValue;      //< meters
+   ossim_float64 m_maxPixelValue;      //< meters
+
+   ossimScalarType m_scalarType;
+
+   // mutable ossimRefPtr<ossimIFStream> theFileStream;
+   mutable std::shared_ptr<ossim::ifstream> m_str;
+   
+   template <class T>
+   bool computeMinMaxTemplate(T dummy, double defaultNull);
+};
+
+#endif /* #ifndef ossimSrtmSupportData */
diff --git a/include/ossim/support_data/ossimSupportFilesList.h b/include/ossim/support_data/ossimSupportFilesList.h
new file mode 100644
index 0000000..0a46e38
--- /dev/null
+++ b/include/ossim/support_data/ossimSupportFilesList.h
@@ -0,0 +1,44 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+// 
+//********************************************************************
+// $Id$
+#ifndef ossimSupportFilesList_HEADER
+#define ossimSupportFilesList_HEADER
+
+#include <vector>
+#include <ossim/base/ossimFilename.h>
+
+class ossimKeywordlist;
+
+//*************************************************************************************************
+//! Singleton class for logging all support data files opened during a session.
+//*************************************************************************************************
+class OSSIMDLLEXPORT ossimSupportFilesList
+{
+public:
+   static ossimSupportFilesList* instance();
+
+   //! Add support data filename to the list:
+   void add(const ossimFilename& f) { m_list.push_back(f); }
+
+   //! Output list to the kwl.
+   void save(ossimKeywordlist& kwl, const char* prefix) const;
+   
+   //! Clears the list to ready for new accumulation:
+   void clear() { m_list.clear(); }
+
+private:
+   ossimSupportFilesList()  { }
+   ~ossimSupportFilesList() { m_instance=0; }
+
+   std::vector<ossimFilename>       m_list;
+   static ossimSupportFilesList*    m_instance;
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimTiffInfo.h b/include/ossim/support_data/ossimTiffInfo.h
new file mode 100644
index 0000000..5f0df38
--- /dev/null
+++ b/include/ossim/support_data/ossimTiffInfo.h
@@ -0,0 +1,638 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: TIFF Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimTiffInfo_HEADER
+#define ossimTiffInfo_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIosFwd.h>
+#include <iosfwd>
+#include <string>
+#include <vector>
+#include <memory>
+
+class ossimDpt;
+class ossimEndian;
+class ossimKeywordlist;
+class ossimTieGptSet;
+
+/**
+ * @brief TIFF info class.
+ *
+ * Encapsulates the listgeo functionality.
+ */
+class OSSIM_DLL ossimTiffInfo : public ossimInfoBase
+{
+public:
+
+   enum WordType
+   {
+      TWO_OR_EIGHT  = 0,
+      FOUR_OR_EIGHT = 1
+   };
+   
+   /** default constructor */
+   ossimTiffInfo();
+
+   /** virtual destructor */
+   virtual ~ossimTiffInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+   virtual bool open( std::shared_ptr<ossim::istream>& str,
+                      const std::string& connectionString );
+
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /**
+    * @brief Print method.
+    * 
+    * Print method that takes a stream that should be positions at the start
+    * of tiff stream. This was added to see embedded information on embedded
+    * geotiff's in a geojp2 file.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::istream& inStr,
+                               std::ostream& outStr) const;
+
+   /**
+    *  @brief Extracts geometry info to keyword list.  This method assumes
+    *  that open has been called and theFile is set.
+    *  
+    *  Populates the keyword list with image geometry information.  This
+    *  method is used to relay projection/model information to users.
+    *
+    *  @param geomKwl Keyword list that will be initialized with geometry info.
+    *  Returns true if geometry info is present, false if not.
+    *
+    *  @param entryIndex Entry to get geometry from. 
+    */
+   bool getImageGeometry(ossimKeywordlist& geomKwl,
+                         ossim_uint32 entryIndex) const;
+
+   /**
+    *  @brief Extracts geometry info from stream to keyword list.
+    *  
+    *  Populates the keyword list with image geometry information.  This
+    *  method is used to relay projection/model information to users.
+    *
+    *  @note The str should be position at start of tiff portion. This
+    *  was written to allow passing a stream positioned at an embedded tiff
+    *  image in a jp2 file.
+    *
+    *  @param str Stream position at start of tiff image.
+    *
+    *  @param geomKwl Keyword list that will be initialized with geometry info.
+    *  Returns true if geometry info is present, false if not.
+    *
+    *  @param entryIndex Entry to get geometry from. 
+    */
+   bool getImageGeometry(std::istream& str,
+                         ossimKeywordlist& geomKwl,
+                         ossim_uint32 entryIndex) const;
+
+   /**
+    * @brief extracts geometry info from stream to keyword list.
+    *  
+    * Populates geomKwl from gtiffKwl.
+    *
+    * @param gtiffKwl Raw keywordlist extracted from tiff/geotiff keys.
+    * 
+    * @param geomKwl Keyword list that will be initialized with geometry info.
+    * Returns true if geometry info is present, false if not.
+    *
+    * @param entryIndex Entry to get geometry from. 
+    */
+   bool getImageGeometry(const ossimKeywordlist& gtiffKwl,
+                         ossimKeywordlist& geomKwl,
+                         ossim_uint32 entryIndex) const;
+
+   /**
+    * @brief Extracts geometry info from geotiff keys to keyword list.
+    *
+    * Helper method used to extract keywords from geotiff keys embedded in
+    * files, e.g. LAS data.  Because this is just the geotiff keys, the output
+    * will be missing the image part, i.e. line, samples, radiometry...
+    *
+    * This output is intended to be usable to get a projection from a call to
+    * ossimProjectionFactoryRegistry::createProjection(kwl).
+    *
+    * Internally calls printGeoKeys and then the private getImageGeometry.
+    *
+    * @param geoKeyLength Length of geoKeyBlock.
+    * @param geoKeyBlock Pointer to array of keys.
+    * @param geoDoubleLength Length of geoDoubleBlock.
+    * @param geoDoubleBlock Pointer to array of double values.
+    * @param geoAsciiLength Length of geoAsciiBlock.
+    * @param geoAsciiBlock Pointer to array of ascii values.
+    * @param projKwl The keyword list to initialize.
+    *
+    * @return Because the resulting keyword list (geomKwl) is not complete
+    * there will be no return.
+    */
+   void getImageGeometry(ossim_uint64   geoKeyLength,
+                         ossim_uint16*  geoKeyBlock,
+                         ossim_uint64   geoDoubleLength,
+                         ossim_float64* geoDoubleBlock,
+                         ossim_uint64   geoAsciiLength,
+                         ossim_int8*    geoAsciiBlock,
+                         ossimKeywordlist& geomKwl) const;
+
+   /**
+    * @brief Prints geo keys to stream.
+    *
+    * Helper method used to extract keywords from geotiff keys embedded in
+    * files, e.g. LAS data.  Because this is just the geotiff keys, the output
+    * will be missing the image part, i.e. line, samples, radiometry...
+    *
+    * This output is the raw tiff tags/geotiff keys not necessarily useable to construct
+    * a projection from.
+    *
+    * @param out Stream to dump to.
+    * @param prefix if any.  This will be added to the keys, e.g.
+    * tiff0.coord_trans where "tiff0." is the prefix and "coord_trans" the key.
+    * @param geoKeyLength Length of geoKeyBlock.
+    * @param geoKeyBlock Pointer to array of keys.
+    * @param geoDoubleLength Length of geoDoubleBlock.
+    * @param geoDoubleBlock Pointer to array of double values.
+    * @param geoAsciiLength Length of geoAsciiBlock.
+    * @param geoAsciiBlock Pointer to array of ascii values.
+    */
+   std::ostream& printGeoKeys(std::ostream& out,
+                              const std::string& prefix,
+                              ossim_uint64   geoKeyLength,
+                              ossim_uint16*  geoKeyBlock,
+                              ossim_uint64   geoDoubleLength,
+                              ossim_float64* geoDoubleBlock,
+                              ossim_uint64   geoAsciiLength,
+                              ossim_int8*    geoAsciiBlock) const;
+
+   /**
+    * @brief Prints tag 50844
+    *
+    * Note: This is in RPC00B polynomial format.
+    *
+    * http://geotiff.maptools.org/rpc_prop.html 
+    */
+   std::ostream& printRpcs(std::ostream& out,
+                           const std::string& prefix,
+                           ossim_uint16 type,
+                           ossim_uint64 count,
+                           ossim_uint8* valueArray) const;
+
+private:
+   
+   /** Initializes s reference.  Does byte swapping as needed. */
+   void readShort(ossim_uint16& s, std::istream& str) const;
+   
+   /** Initializes l reference.  Does byte swapping as needed. */
+   void readLong(ossim_uint32& l, std::istream& str) const;
+   
+   /** Initializes l reference.  Does byte swapping as needed. */
+   void readLongLong(ossim_uint64& l, std::istream& str) const;
+   
+   /** Attempts to parse the pcs code (3072). */
+   void parsePcsCode(int code);
+   
+   /** Attempts to parse the projection geo key (3074). */
+   void parseProjGeoCode(int code);
+   
+   /**
+    *  Converts double passed in to meters if needed.  The conversion is
+    *  base on "theLiniarUnitsCode".
+    */
+   double convert2meters(double d) const;
+   
+   /**
+    * This will read either 4 or 8 bytes depending on the version and
+    * initialize offset.
+    *
+    * @return true if stream is good, false if not.
+    */
+   bool getOffset(std::streamoff& offset, std::istream& str,
+                  ossim_uint16 version) const;
+   
+   /**
+    * This will read either 2 , 4 or 8 bytes depending on the version and
+    * WORD_TYPE.
+    *
+    * @return true if stream is good, false if not.
+    */
+   bool getValue(ossim_uint64& val, std::istream& str, WordType type,
+                 ossim_uint16 version) const;
+   
+   ossim_uint64 getArraySizeInBytes(ossim_uint64 length,
+                                    ossim_uint16 type) const;
+   
+   /**
+    * @return The byte size of each tiff type or 0 if unhandled.
+    */
+   ossim_uint16 getTypeByteSize(ossim_uint16 type) const;
+   
+   /**
+    * Eats the value field.  Either 4 or 8 bytes depending on the version.
+    */
+   void eatValue(std::istream& str, ossim_uint16 version) const;
+   
+   void swapBytes(ossim_uint8* v, ossim_uint16 type, ossim_uint64 count) const;
+   
+   /** Initializes v. */
+   template <class T> void getArrayValue(T& v,
+                                         ossim_uint8* array,
+                                         ossim_uint64 position) const;
+   
+   std::ostream& print(std::ostream& out,
+                       const std::string&  prefix,
+                       ossim_uint64   tagIdx,
+                       ossim_uint16   tag,
+                       ossim_uint16   type,
+                       ossim_uint64   count,
+                       ossim_uint64   arraySizeInBytes,
+                       ossim_uint8*   valueArray) const;
+   
+   std::ostream& printValue(std::ostream& out,
+                            ossim_uint16 type,
+                            ossim_uint8* valueArray) const;
+   
+   std::ostream& printArray(std::ostream& out,
+                            ossim_uint16 type,
+                            ossim_uint64 count,
+                            ossim_uint8* valueArray) const;
+   
+   std::ostream& printGdalMetadata(std::ostream& out,
+                                   const std::string& prefix,
+                                   ossim_uint64 count,
+                                   ossim_uint8* valueArray) const;
+
+   /** @brief Prints OTIFFTAG_XMLPACKET (700) */ 
+   std::ostream& printXmpMetadata(std::ostream& out,
+                                  const std::string& prefix,
+                                  ossim_uint64 count,
+                                  ossim_uint8* valueArray) const;
+
+   /** @brief Prints key 1024 */
+   std::ostream& printModelType(std::ostream& out,
+                                const std::string& prefix,
+                                ossim_uint16 code) const;
+
+   /** @brief Prints key 1025 */
+   std::ostream& printRasterType(std::ostream& out,
+                                 const std::string& prefix,
+                                 ossim_uint16 code) const;
+
+   /** @brief Prints key 2054 */
+   std::ostream& printAngularUnits(std::ostream& out,
+                                   const std::string& prefix,
+                                   ossim_uint16 code) const;
+
+   /** @brief Prints key 3075 */
+   std::ostream& printCoordTrans(std::ostream& out,
+                                  const std::string& prefix,
+                                  ossim_uint16 code) const;
+
+   /** @brief Prints key from code from section 6.3.1.3 */
+   std::ostream& printLinearUnits(std::ostream& out,
+                                  const std::string& prefix,
+                                  const std::string& key,
+                                  ossim_uint16 code) const;
+
+   /** @brief Prints tag 274 */
+   std::ostream& printOrientation(std::ostream& out,
+                                  const std::string& prefix,
+                                  ossim_uint16 code) const;
+  
+   /** @brief adds imageN. to prefix where N is zero base directory index. */
+   void getDirPrefix(ossim_int32 dirIndex, std::string& prefix) const;
+
+   /**
+    * @brief Gets the required pixel scale from keyword list looking for the
+    * key model_pixel_scale.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param scale The point to initialize.
+    * @return true on success, false on error.
+    */
+   bool getPixelScale(const ossimString& gtiffPrefix,
+                      const ossimKeywordlist& gtiffKwl,
+                      ossimDpt& scale) const;
+   
+   /**
+    * @brief Gets the model_tie_point array.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param ties The array to initialize.
+    * @return true on success, false on error.
+    */
+   bool getTiePoint(const ossimString& gtiffPrefix,
+                    const ossimKeywordlist& gtiffKwl,
+                    std::vector<ossim_float64>& ties) const;
+
+   /**
+    * @brief Gets the model_transform array.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param ties The array to initialize.
+    * @return true on success, false on error.
+    */
+   bool getModelTransform(const ossimString& gtiffPrefix,
+                          const ossimKeywordlist& gtiffKwl,
+                          std::vector<ossim_float64>& xfrm) const;
+
+   /**
+    * @brief Extracts float values from keyword list that match key.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param key to look for.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param floats Array to stuff.  Will have size of zero on failure.
+    * @return true on success, false on error.  If size of array is zero it
+    * will return false.
+    */
+   bool  getFloats(const ossimString& gtiffPrefix,
+                   const ossimString& key,
+                   const ossimKeywordlist& gtiffKwl,
+                   std::vector<ossim_float64>& floats) const;
+
+   /**
+    * @brief Extracts float values from lookup line and puts in floats array.
+    * @param lookup Line to parse like:
+    * "0.00138888888889 0.00138888888889, 0.0"
+    * @param floats Array to stuff.  Will have size of zero on failure.
+    */
+   bool getFloats(const ossimString& line,
+                  std::vector<ossim_float64>& floats) const;
+
+   /**
+    * @brief Gets the datum code matching code from the keyword list as a
+    * string.
+    *
+    * This checks for "geodetic_datum"(geotiff key 2050), then
+    * "gcs_code"(geotiff key 2048) if first lookup faild.
+    * 
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param datumCode The code to initialize.
+    * @return true on success, false on error.
+    */
+   bool getDatumCode(const ossimString& gtiffPrefix,
+                     const ossimKeywordlist& gtiffKwl,
+                     ossimString& datumCode) const;
+
+   /**
+    * @brief Gets the datum code.
+    * @param code Code from either "geodetic_datum"(geotiff key 2050),
+    * or "gcs_code"(geotiff key 2048).
+    * @param datumCode The code to initialize.
+    * @return true on success, false on error.
+    */
+   bool getDatumCode(ossim_int32 code, ossimString& datumCode) const;
+
+   /**
+    * @brief Gets the pcs code from the keyword list as a string.
+    *
+    * If the lookup of "pcs_code" returns false then the "pcs_citation" is then
+    * checked.
+    * 
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param pcsCode The code to initialize.
+    * @return true on success, false on error.
+    */
+   bool getPcsCode(const ossimString& gtiffPrefix,
+                   const ossimKeywordlist& gtiffKwl,
+                   ossimString& pcsCode) const;
+
+   /**
+    * @brief Gets units from keyword list as a string. This will be angular
+    * or linear base on the model type.  The default is meters if not found.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param linearUnits The string to initialize with units.
+    * @return true on success, false on error.
+    */
+   bool getUnits(const ossimString& gtiffPrefix,
+                 const ossimKeywordlist& gtiffKwl,
+                 ossimString& units) const;
+   /**
+    * @brief Gets the linear units from keyword list as a string.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param linearUnits The string to initialize with units.
+    * @return true on success, false on error.
+    */
+   bool getLinearUnits(const ossimString& gtiffPrefix,
+                       const ossimKeywordlist& gtiffKwl,
+                       ossimString& linearUnits) const;
+
+   /**
+    * @brief Gets the vertical units from keyword list as a string.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param linearUnits The string to initialize with units.
+    * @return true on success, false on error.
+    */
+   bool getVerticalUnits(const ossimString& gtiffPrefix,
+                         const ossimKeywordlist& gtiffKwl,
+                         ossimString& verticalUnits) const;
+
+   /**
+    * @brief Gets the units from keyword list as a string.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param angularUnit The string to initialize with units.
+    * @return true on success, false on error.
+    */
+   bool getAngularUnits(const ossimString& gtiffPrefix,
+                        const ossimKeywordlist& gtiffKwl,
+                        ossimString& units) const;
+
+
+   /**
+    * @brief Gets the pixel type (point or area) from keyword list as a string.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param unit The string to initialize with pixel type.
+    * @return true on success, false on error.
+    */   
+   bool getPixelType(const ossimString& gtiffPrefix,
+                     const ossimKeywordlist& gtiffKwl,
+                     ossimString& pixelType) const;
+
+   /**
+    * @brief Gets the model type from keyword list as a string.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param modelType The string to initialize with pixel type.
+    * @return true on success, false on error.
+    */   
+   bool getModelType(const ossimString& gtiffPrefix,
+                     const ossimKeywordlist& gtiffKwl,
+                     ossimString& modeType) const;
+
+   /**
+    * @brief Gets the ossimProjection from keyword list as a string.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param ossimProj The string to initialize with pixel type.
+    * @return true on success, false on error.
+    */   
+   bool getOssimProjectionName(const ossimString& gtiffPrefix,
+                               const ossimKeywordlist& gtiffKwl,
+                               ossimString& ossimProj) const;
+   
+   /**
+    * @brief Gets the number of lines from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @return Number of lines or 0 if lines not found.
+    */   
+   ossim_uint32 getLines(const ossimString& gtiffPrefix,
+                         const ossimKeywordlist& gtiffKwl) const;
+
+   /**
+    * @brief Gets the number of samples from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @return Number of lines or 0 if lines not found.
+    */   
+   ossim_uint32 getSamples(const ossimString& gtiffPrefix,
+                           const ossimKeywordlist& gtiffKwl) const;
+
+   /**
+    * @brief Gets the first standard parallel from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param value Initialized with result.
+    */   
+   bool getStdParallelOne(const ossimString& gtiffPrefix,
+                          const ossimKeywordlist& gtiffKwl,
+                          ossimString& value) const;
+
+   /**
+    * @brief Gets the second standard parallel from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param value Initialized with result.
+    */
+   bool getStdParallelTwo(const ossimString& gtiffPrefix,
+                          const ossimKeywordlist& gtiffKwl,
+                          ossimString& value) const;
+   
+   /**
+    * @brief Gets the false easting from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param value Initialized with result.
+    */
+   bool getFalseEasting(const ossimString& gtiffPrefix,
+                        const ossimKeywordlist& gtiffKwl,
+                        ossimString& value) const;
+
+   /**
+    * @brief Gets the false northing from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param value Initialized with result.
+    */
+   bool getFalseNorthing(const ossimString& gtiffPrefix,
+                         const ossimKeywordlist& gtiffKwl,
+                         ossimString& value) const;
+
+   /**
+    * @brief Gets the false easting/northing from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param eastingNorthing Initialized with result.
+    */
+   bool getFalseEastingNorthing(const ossimString& gtiffPrefix,
+                                const ossimKeywordlist& gtiffKwl,
+                                ossimDpt& eastingNorthing) const;
+
+   /**
+    * @brief Gets the scale factor from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param value Initialized with result.
+    */
+   bool getScaleFactor(const ossimString& gtiffPrefix,
+                       const ossimKeywordlist& gtiffKwl,
+                       ossim_float64& value) const;
+
+   /**
+    * @brief Gets the origin of latitude from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param value Initialized with result.
+    */
+   bool getOriginLat(const ossimString& gtiffPrefix,
+                     const ossimKeywordlist& gtiffKwl,
+                     ossim_float64& value) const;
+
+   /**
+    * @brief Gets the central meridian from keyword list.
+    * @param gtiffPrefix Prefix for gtiffKwl.
+    * @param gtiffKwl The keyword list with all tiff keywords.
+    * @param value Initialized with result.
+    */
+   bool getCentralMeridian(const ossimString& gtiffPrefix,
+                           const ossimKeywordlist& gtiffKwl,
+                           ossim_float64& value) const;
+
+   /**
+    * @brief Split tie points into sets of six tie sets.
+    * @param tie points.
+    * @param width Image width.
+    * @param height Image height.
+    * @param tieSet Initialized with result.
+    */
+   void getTieSets(const std::vector<ossim_float64>& ties,
+                   ossim_uint32 width,
+                   ossim_uint32 height,
+                   ossimTieGptSet& tieSet) const;
+
+
+   /**
+    * @brief Check tie points to see if they are zero base or one based.
+    * @param tie points.
+    * @param width Image width.
+    * @param height Image height.
+    * @return true if one based, false if not.
+    */
+   bool hasOneBasedTiePoints(const std::vector<ossim_float64>& ties,
+                             ossim_uint32 width,
+                             ossim_uint32 height) const;
+   
+   std::string m_connectionString;
+   mutable std::shared_ptr<ossim::istream> m_inputStream;
+   //ossimFilename          theFile;
+   mutable ossimEndian* m_endian;
+};
+
+#endif /* End of "#ifndef ossimTiffInfo_HEADER" */
diff --git a/include/ossim/support_data/ossimTiffWorld.h b/include/ossim/support_data/ossimTiffWorld.h
new file mode 100644
index 0000000..57e0643
--- /dev/null
+++ b/include/ossim/support_data/ossimTiffWorld.h
@@ -0,0 +1,80 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description: Container class for a tiff world file data.
+//
+//********************************************************************
+// $Id$
+
+#ifndef ossimTiffWorld_HEADER
+#define ossimTiffWorld_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDpt.h>
+#include <iosfwd>
+
+//***************************************************************************
+// CLASS:  ossimTiffWorld
+//***************************************************************************
+class OSSIMDLLEXPORT ossimTiffWorld
+{
+public:
+   ossimTiffWorld();
+   ossimTiffWorld(const char* source, 
+		  ossimPixelType ptype = OSSIM_PIXEL_IS_POINT,
+		  ossimUnitType  unit = OSSIM_METERS);
+   
+   ~ossimTiffWorld();
+   
+   bool open(const ossimFilename& file,
+             ossimPixelType ptype,
+             ossimUnitType unit);
+   
+   bool saveToOssimGeom(ossimKeywordlist& kwl, const char* prefix=NULL)const;
+   bool loadFromOssimGeom(const ossimKeywordlist& kwl, const char* prefix=NULL);
+   
+   std::ostream& print(std::ostream& out) const;
+   
+   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& out,
+                                                  const ossimTiffWorld& obj);
+   
+   /*!
+    * transformed.x =
+    * imagePoint.x*theX_scale + imagePoint.y*the3rdValue + theTranslateX
+    * 
+    * transformed.y =
+    * imagePoint.x*the2ndValue + imagePoint.y*theY_scale + theTranslateY
+    */
+   void forward(const ossimDpt& imagePoint,
+                ossimDpt& transformedPoint);
+   
+   //! Converts world file parameters into x, y scale (for use in affine transform) 
+   const ossimDpt& getScale() const { return theComputedScale; }
+   
+   //! Converts world file parameters into RH rotation in radians (for use in affine transform) 
+   double getRotation() const { return theComputedRotation; }
+   
+   //! Provides access to the translation (for use in affine transform) 
+   const ossimDpt& getTranslation() const { return theTranslation; }
+
+protected:
+   double theXform1;     
+   double theXform2;   
+   double theXform3;   
+   double theXform4;   
+   ossimDpt theTranslation;
+
+   ossimPixelType thePixelType;
+   ossimUnitType  theUnit;
+   ossimDpt theComputedScale;
+   double   theComputedRotation;  //!< Radians
+};
+
+#endif
diff --git a/include/ossim/support_data/ossimWavelength.h b/include/ossim/support_data/ossimWavelength.h
new file mode 100644
index 0000000..6535960
--- /dev/null
+++ b/include/ossim/support_data/ossimWavelength.h
@@ -0,0 +1,106 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class declaration for ossimWavelength.
+// See class description below.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimWavelength_HEADER
+#define ossimWavelength_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <iostream>
+#include <map>
+#include <vector>
+
+
+class ossimEnviHeader;
+
+/**
+ * @class ossimWavelenght class.
+ *
+ * Simple container class encapsulating a std::map of wavelengths(key) and associated
+ * bands(value), with convenience methods.  Wavelengths values are 64 bit
+ * floating point in nanometers. Bands are zero based
+ * 32 bit unsigned integers. 
+ */
+class OSSIM_DLL ossimWavelength 
+{
+public:
+   
+   typedef std::map< ossim_float64, ossim_uint32 > WavelengthMap;
+   
+   /** @brief default constructor */
+   ossimWavelength();
+
+   /** @brief copy constructor */
+   ossimWavelength( const ossimWavelength& obj );
+
+   /** @brief assignment operator= */
+   const ossimWavelength& operator=( const ossimWavelength& rhs );
+
+   /** @brief virtual destructor */
+   ~ossimWavelength();
+   
+   const ossimWavelength::WavelengthMap& getMap() const;
+   
+   ossimWavelength::WavelengthMap& getMap();
+
+   /**
+    * @brief Initializes map from ENVI header class.
+    *
+    * This will clear any existing map, look for the keywords
+    * "wavelength units" and "wavelength".
+    * 
+    * @param header to initialize from.
+    * @return true on success, false on error.
+    */
+   bool initialize( const ossimEnviHeader& hdr );
+
+   /**
+    * @brief Finds iterator closest to wavelength.
+    * @param requestedWavelength Requested wavelength in nanometers.
+    * @param thresholdFromCenter in nanometers.
+    * @return WavelengthMap::const_iterator if not found will return. 
+    */
+   WavelengthMap::const_iterator findClosestIterator(
+      const ossim_float64& requestedWavelength,
+      const ossim_float64& thresholdFromCenter  ) const;
+   
+   /**
+    * @brief Finds index closest to wavelength.
+    * @param requestedWavelength Requested wavelength in nanometers.
+    * @param thresholdFromCenter in nanometers.
+    * @return Closest zero based index to wavelength or -1 if not found. 
+    */
+   ossim_int32 findClosestIndex(
+      const ossim_float64& requestedWavelength,
+      const ossim_float64& thresholdFromCenter  ) const;
+   
+   /**
+    * @brief Gets rgb bands if "wavelength" keyword is present.
+    * @param bands Initialized by this with zero base rbg band
+    * indexes.
+    * @return true on success, false if bands not found.
+    */   
+   bool getRgbBands( std::vector<ossim_uint32>& bands ) const;
+
+   /** @return WavelengthMap::const_iterator of underlying map. */
+   WavelengthMap::const_iterator end() const;
+
+   /** @return WavelengthMap::iterator of underlying map. */
+   WavelengthMap::iterator end();
+
+private:
+   
+   WavelengthMap m_map;
+};
+
+#endif /* End of "#ifndef ossimWavelength_HEADER" */
diff --git a/include/ossim/support_data/ossimWkt.h b/include/ossim/support_data/ossimWkt.h
new file mode 100644
index 0000000..58241c3
--- /dev/null
+++ b/include/ossim/support_data/ossimWkt.h
@@ -0,0 +1,111 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// ossimWkt class declaration. A well known text(WKT) utility class.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimWkt_HEADER
+#define ossimWkt_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+/**
+ * @class ossimWkt
+ *
+ * Utility/support data class to parse WKT text string to an ossimKeywordlist.
+ *
+ * Example keyword list( WKT string dependent ):
+ *
+ * PROJCS.AUTHORITY.name:  EPSG
+ * PROJCS.AUTHORITY.param0:  "32641"
+ * PROJCS.GEOGCS.AUTHORITY.name:  EPSG
+ * PROJCS.GEOGCS.AUTHORITY.param0:  "4326"
+ * PROJCS.GEOGCS.DATUM.AUTHORITY.name:  EPSG
+ * PROJCS.GEOGCS.DATUM.AUTHORITY.param0:  "6326"
+ * PROJCS.GEOGCS.DATUM.SPHEROID.AUTHORITY.name:  EPSG
+ * PROJCS.GEOGCS.DATUM.SPHEROID.AUTHORITY.param0:  "7030"
+ * PROJCS.GEOGCS.DATUM.SPHEROID.name:  WGS 84
+ * PROJCS.GEOGCS.DATUM.SPHEROID.param0:  6378137
+ * PROJCS.GEOGCS.DATUM.SPHEROID.param1:  298.2572235630016
+ * PROJCS.GEOGCS.DATUM.name:  WGS_1984
+ * PROJCS.GEOGCS.PRIMEM.name:  Greenwich
+ * PROJCS.GEOGCS.PRIMEM.param0:  0
+ * PROJCS.GEOGCS.UNIT.name:  degree
+ * PROJCS.GEOGCS.UNIT.param0:  0.0174532925199433
+ * PROJCS.GEOGCS.name:  WGS 84
+ * PROJCS.PARAMETER0.name:  latitude_of_origin
+ * PROJCS.PARAMETER0.param0:  0
+ * PROJCS.PARAMETER1.name:  central_meridian
+ * PROJCS.PARAMETER1.param0:  63
+ * PROJCS.PARAMETER2.name:  scale_factor
+ * PROJCS.PARAMETER2.param0:  0.9996
+ * PROJCS.PARAMETER3.name:  false_easting
+ * PROJCS.PARAMETER3.param0:  500000
+ * PROJCS.PARAMETER4.name:  false_northing
+ * PROJCS.PARAMETER4.param0:  0
+ * PROJCS.PROJECTION.name:  Transverse_Mercator
+ * PROJCS.UNIT.AUTHORITY.name:  EPSG
+ * PROJCS.UNIT.AUTHORITY.param0:  "9001"
+ * PROJCS.UNIT.name:  metre
+ * PROJCS.UNIT.param0:  1
+ * PROJCS.name:  WGS 84 / UTM zone 41N 
+ *
+ */
+class OSSIM_DLL ossimWkt
+{
+public:
+   
+   /** default constructor */
+   ossimWkt();
+
+   /** destructor */
+   ~ossimWkt();
+
+   /**
+    * @brief Parses string to keyword list.
+    * @param wkt String to parse.
+    */
+   bool parse( const std::string& wkt );
+
+   /** @return Refeerence to keyword list. */
+   const ossimKeywordlist& getKwl() const;
+
+private:
+   bool parseWktGroup( std::istringstream& is, ossimKeywordlist& kwl );
+
+   bool parseObject( std::istringstream& is,
+                     const std::string& prefix,
+                     const std::string& object,
+                     ossimKeywordlist& kwl );
+   
+   bool parseName( std::istringstream& is,
+                   const std::string& prefix,
+                   const std::string& object,
+                   ossimKeywordlist& kwl );
+   
+   bool parseParam( std::istringstream& is,
+                    const std::string& prefix,
+                    const std::string& object,
+                    ossim_uint32& objectIndex,
+                    ossim_uint32& paramIndex,
+                    ossimKeywordlist& kwl );
+
+   ossimKeywordlist m_kwl;
+
+};
+
+#endif /* End of "#ifndef ossimWkt_HEADER" */
diff --git a/include/ossim/support_data/ossimXmpInfo.h b/include/ossim/support_data/ossimXmpInfo.h
new file mode 100644
index 0000000..9a49de5
--- /dev/null
+++ b/include/ossim/support_data/ossimXmpInfo.h
@@ -0,0 +1,120 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Extensible Metadata Platform (XMP) Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimXmpInfo_HEADER
+#define ossimXmpInfo_HEADER 1
+
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/projection/ossimProjection.h>
+#include <string>
+
+// Forward class declarations:
+class ossimDrect;
+class ossimString;
+class ossimXmlDocument;
+
+/** @class Extensible Metadata Platform (XMP) Info object. */
+class OSSIM_DLL ossimXmpInfo : public ossimInfoBase
+{
+public:
+   
+   /** default constructor */
+   ossimXmpInfo();
+
+   /** virtual destructor */
+   virtual ~ossimXmpInfo();
+
+   /**
+    * @brief open method.
+    *
+    * @param file File name to open.
+    *
+    * @return true on success false on error.
+    */
+   virtual bool open(const ossimFilename& file);
+   
+   /**
+    * Print method.
+    *
+    * @param out Stream to print to.
+    * 
+    * @return std::ostream&
+    */
+   virtual std::ostream& print(std::ostream& out) const;
+
+   /** @return XMP APP1 XML block. */ 
+   const std::string& getXmpApp1XmlBlock() const;
+
+   /**
+    * @brief Method to get a projection if possible.
+    * @param imageRect Require image rectangle of associated meta data
+    * parsed by this class.
+    * @return Projection pointer wrapped in ref pointer.  Can be null if
+    * projection cannot be established.
+    */
+   ossimRefPtr<ossimProjection> getProjection(
+      const ossimDrect& imageRect ) const;
+
+   /**
+    *  @brief Gets the date if available in ISO8601 format:
+    *  YYYY-MM-DDThh:mm:ss.sssZ
+    *
+    *  @param date Initialized by this.  Will be cleared if date not found.
+    */
+   void getDate( std::string& date ) const;
+   
+   /**
+    *  @brief Gets the mission ID if available.
+    *
+    *  @param mission Initialized by this.  Will be cleared if date not found.
+    */
+   void getMissionId( std::string& mission ) const;
+
+   /**
+    *  @brief Gets the sensor ID if available.
+    *
+    *  @param sensor Initialized by this.  Will be cleared if date not found.
+    */
+   void getSensorId( std::string& sensor ) const;
+   
+private:
+
+   /**
+    * @brief Gets the xml block as a string from stream.
+    * @param str Input stream.
+    * @param xmpApp1XmlBlock String initialized by this.
+    * @return true on success, false on error.
+    */
+   bool getXmpApp1XmlBlock( std::ifstream& str,
+                            std::string& xmpApp1XmlBlock ) const;
+
+   /**
+    * @brief Gets path from doc and initializes string.
+    * @param path Xml path to look for.
+    * @param xdoc Xml doc to look in.
+    * @param s String to initialize.
+    * @return true on success and false if path is not found or if there
+    * are more than one of path.
+    */
+   bool getPath( const ossimString& path,
+                 const ossimXmlDocument& xdoc,
+                 ossimString& s ) const;
+
+   ossimFilename  m_file;
+   std::string    m_xmpApp1XmlBlock;
+};
+
+#endif /* End of "#ifndef ossimXmpInfo_HEADER" */
diff --git a/include/ossim/util/ossimAutRegUtil.h b/include/ossim/util/ossimAutRegUtil.h
new file mode 100644
index 0000000..4de0a48
--- /dev/null
+++ b/include/ossim/util/ossimAutRegUtil.h
@@ -0,0 +1,288 @@
+//----------------------------------------------------------------------------
+// File: ossimAutRegUtil.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Hicks
+//
+// Description: Utility class for autonomous registration.
+//----------------------------------------------------------------------------
+#ifndef ossimAutRegUtil_HEADER
+#define ossimAutRegUtil_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimTieMeasurementGeneratorInterface.h>
+
+#include <ctime>
+#include <vector>
+#include <iostream>
+
+
+// Forward class declarations:
+class ossimArgumentParser;
+class ossimImageHandler;
+class ossimKeywordlist;
+class ossimImageViewAffineTransform;
+class ossimAdjustmentExecutive;
+class ossimObservationSet;
+
+/**
+ * @brief ossimAutRegUtil class.
+ *
+ * This is a utility class to register two images.
+ *
+ * @note Almost all methods use throw for stack unwinding.  This is not in
+ * method declarations to alleviate build errors on windows.
+ */
+class OSSIM_DLL ossimAutRegUtil : public ossimReferenced
+{
+public:
+   /** emumerated operations */
+   enum ossimAutRegOperation
+   {
+      OSSIM_AUTREG_OP_UNKNOWN = 0,
+      OSSIM_AUTREG_OP_COREG   = 1,
+      OSSIM_AUTREG_OP_MASREG  = 2
+   };
+
+   /**
+    * @brief default constructor
+    */
+   ossimAutRegUtil();
+   
+   /**
+    * @brief virtual destructor
+    */
+   ~ossimAutRegUtil();
+
+   /**
+    * @brief Disconnects and clears the dem and image layers?????????????.
+    */
+   void clear();
+   
+   /**
+    * @brief Initialize method, using arguments, to be run prior to execute.
+    * @param ap Arg parser to initialize from.
+    * @note Throws ossimException on error.
+    * @note A throw with an error message of "usage" is used to get out when
+    * a usage is printed.
+    */
+   bool initialize(ossimArgumentParser& ap);
+
+
+   /**
+    * @brief Initialize method, using predefined kwl, to be run prior to execute.
+    * @note Throws ossimException on error.
+    */
+   void initialize(const ossimKeywordlist& kwl);
+
+
+   /**
+    * @brief Execute method.  Performs the registration process.
+    * @note Throws ossimException on error.
+    */
+   void execute();
+
+
+   // /**
+   //  * @brief Summarize method
+   //  */
+   void summarizeSolution() const;
+
+
+   // /**
+   //  * @brief saveAdjustment method
+   //  */
+   void saveAdjustment();
+
+   /**
+    * @brief Gets the output file name.
+    * @param f Initialized by this with the filename.
+    */
+   void getOutputFilename(ossimFilename& f) const;
+
+private:
+
+   /**
+    * @brief Internal initialize method.
+    * @note Throws ossimException on error.
+    */
+   void initialize();
+
+   /**
+    * @brief Internal load image pair method.
+    * @return true if succsessful.
+    */
+   bool loadImages();
+
+   /**
+    * @brief Internal correlation region determination.
+    * @return true if succsessful.
+    */
+   bool delineateROIs();
+
+   /**
+    * @brief Internal observation set poplulate method.
+    * @return true if succsessful.
+    */
+   bool populateObsSet();
+
+
+   /** @return true if key is set to true; false, if not. */
+   bool keyIsTrue(ossimRefPtr<ossimKeywordlist> kwl, const std::string& key ) const;
+                                  
+
+   /** @return true if file extension is "src" */
+   bool isSrcFile(const ossimFilename& file) const;
+
+   /** @brief Initializes m_srcKwl if option was set. */
+   void initializeSrcKwl();
+
+   /** @brief Initializes m_ocvKwl if option was set. */
+   void initializeOcvKwl();
+
+   /** @brief Initializes m_oaxKwl if option was set. */
+   void initializeOaxKwl();
+
+   /**
+    * @brief Adds application arguments to the argument parser.
+    * @param ap Parser to add to.
+    */
+   void addArguments(ossimArgumentParser& ap);
+
+   /**
+    * @brief Configures tie measurement generator
+    */
+   void configureTieMeasGenerator();
+
+   /**
+    * @brief Configures adjustment executive
+    */
+   void configureAdjustmentExecutive();
+
+
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
+
+
+   /**
+    * @brief Passes reader properties to single image handler if any.
+    * @param ih Image handler to set properties on.
+    */
+   void setReaderProps( ossimImageHandler* ih ) const;
+
+   /**
+    * @brief Sets entry for a chain.
+    * @param chain Chain to set up.
+    * @param entryIndex Zero based index.
+    * @return true on success, false on error.
+    */
+   bool setChainEntry( ossimRefPtr<ossimSingleImageChain>& chain,
+                       ossim_uint32 entryIndex ) const;
+   
+   /**
+    * @brief Method to create a chain and add to img layers from file.
+    * @param file Image to open.
+    * @parm entryIndex Entry to open.
+    */
+   bool addImgSource(const ossimFilename& file,
+                     ossim_uint32 entryIndex);
+
+
+   /**
+    * @brief Creates a ossimSingleImageChain from file.
+    * @param file File to open.
+    * @param entryIndex Entry to open.
+    * options like histogram stretches.
+    * @return Ref pointer to ossimSingleImageChain.
+    * @note Throws ossimException on error.
+    */
+   ossimRefPtr<ossimSingleImageChain> createChain(const ossimFilename& file,
+                                                  ossim_uint32 entryIndex) const;
+   
+   /**
+    * @brief Sets the single image chain for identity operations view to
+    * an ossimImageViewAffineTransform.
+    */
+   void createIdentityProjection(int idx);
+
+   /** @brief Hidden from use copy constructor. */
+   ossimAutRegUtil( const ossimAutRegUtil& obj );
+
+   /** @brief Hidden from use assignment operator. */
+   const ossimAutRegUtil& operator=( const ossimAutRegUtil& rhs );
+
+   /**
+    * @brief Tie point generator interface
+    */
+   ossimTieMeasurementGeneratorInterface* m_tGen;
+   ossimRefPtr<ossimObject> m_tGenObj;
+   
+   /** @brief Correlation ROIs */
+   std::vector<ossimIrect> m_roiRects;
+   
+   /** @brief OpenCV match window display flag */
+   bool m_showMatchWindow;
+   
+   /**
+    * @brief Adjustment executive interface
+    */
+   /** @brief Executive object */
+   ossimRefPtr<ossimAdjustmentExecutive> m_adjExec;
+
+   /** @brief Observation set */
+   ossimRefPtr<ossimObservationSet> m_obsSet;
+
+   /** @brief A priori tie point sigmas */
+   ossimColumnVector3d m_LatLonHgtSigmas;
+   ossimColumnVector3d m_LatLonHgtControlSigmas;
+
+
+   /** @brief Report stream pointer */
+   std::ostream* m_rep;
+
+
+   /**  @brief Array of image source chains. */
+   std::vector< ossimRefPtr<ossimSingleImageChain> > m_imgLayer;
+
+   /** Hold all options passed into intialize. */
+   ossimRefPtr<ossimKeywordlist> m_kwl;
+
+   /** Hold contents of OpenCV config file if --ocv_config_file is used. */
+   ossimRefPtr<ossimKeywordlist> m_ocvKwl;
+
+   /** Hold contents of oax config file if --oax_config_file is used. */
+   ossimRefPtr<ossimKeywordlist> m_oaxKwl;
+
+   /** Hold contents of src file if --src is used. */
+   ossimRefPtr<ossimKeywordlist> m_srcKwl;
+   
+   /** Enumerated operation to perform. */
+   ossimAutRegOperation m_operation;
+   
+   /**
+    * Image view transform(IVT). Only set/used in "chip"(identity) operation as
+    * the IVT for the resampler(ossimImageRenderer).
+    */
+   ossimRefPtr<ossimImageViewAffineTransform> m_ivt[2];
+
+   /**
+    * The image geometry.  In chip mode this will be from the input image. So
+    * this may or may not have a map projection. In any other mode it
+    * will the view or output geometry which will be a map projection.
+    */
+   ossimRefPtr<ossimImageGeometry> m_geom[2];
+   
+   /** Control image flags. */
+   bool m_controlImage[2];
+};
+
+#endif // #ifndef ossimAutRegUtil_HEADER
diff --git a/include/ossim/util/ossimBandMergeTool.h b/include/ossim/util/ossimBandMergeTool.h
new file mode 100644
index 0000000..25bbe7a
--- /dev/null
+++ b/include/ossim/util/ossimBandMergeTool.h
@@ -0,0 +1,46 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimBandMergeUtil_HEADER
+#define ossimBandMergeUtil_HEADER
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/util/ossimChipProcTool.h>
+
+/*!
+ *  Class for determining the active image corner vertices inside larger null-filled image rectangle.
+ */
+class OSSIMDLLEXPORT ossimBandMergeTool : public ossimChipProcTool
+{
+public:
+   ossimBandMergeTool();
+   ~ossimBandMergeTool();
+
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   virtual ossimString getClassName() const { return "ossimBandMergeUtil"; }
+
+   virtual void getKwlTemplate(ossimKeywordlist& kwl);
+
+   virtual bool execute();
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+protected:
+   virtual void initProcessingChain();
+   virtual void initHistogramStretch(ossimSingleImageChain* image);
+
+   bool m_stretchProduct;
+};
+
+#endif
diff --git a/include/ossim/util/ossimBatchTest.h b/include/ossim/util/ossimBatchTest.h
new file mode 100644
index 0000000..1af5e46
--- /dev/null
+++ b/include/ossim/util/ossimBatchTest.h
@@ -0,0 +1,148 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken, Oscar Kramer
+//
+// Description: Test code application utility class.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimBatchTest_HEADER
+#define ossimBatchTest_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimFilename.h>
+#include <vector>
+#include <map>
+#include <fstream>
+
+// Forward class declarations:
+class ossimArgumentParser;
+class ossimDpt;
+class ossimString;
+class ossimGpt;
+class ossimImageFileWriter;
+class ossimImageGeometry;
+class ossimIrect;
+class ossimKeywordlist;
+class ossimTilingRect;
+
+class OSSIM_DLL ossimBatchTest : public ossimReferenced
+{
+public:
+   enum TEST_STATUS
+   {
+      TEST_TBD      = 0x00, // initial state: no test yet attempted
+      TEST_PASSED   = 0x01,
+      TEST_FAILED   = 0x02,
+      TEST_ERROR    = 0x04,
+      TEST_DISABLED = 0x08
+   };
+
+   //! This constructor only initializes data members to null/defaults
+   ossimBatchTest();
+   
+   //! Initializes the test session given the command line.
+   bool initialize(ossimArgumentParser& ap);
+
+   //! Performs the actual test with the config filename previously set in initialize() or
+   //! processConfigList() when config is a list of subordinate test config files.
+   //! @return The overall bit-wise status of all tests (see TEST_STATUS enum for bit definitions).
+   ossim_uint8 execute();
+
+private:
+   //! Writes template test config file, either exhaustive long form for flexibility, or simple
+   //! short-form for easier test creation.
+   void writeTemplate(const ossimFilename& templateFile, bool long_form);
+   
+   //! Fetches string from OS for naming and tagging the log file.
+   void getDateString(ossimString& date);
+   
+   //! Establishes name of output log file.
+   void getLogFilename(ossimFilename& logFile);
+
+   //! When the config file consists of a list of subordinate test config files, this method manages
+   //! processing multiple configs.
+   //! @return The overall bit-wise status of all configs (see TEST_STATUS enum for bit definitions).
+   ossim_uint8 processConfigList(const ossimKeywordlist& kwl);
+
+   //! Within a single config file can be multiple tests, distinguished by the "test*." prefix. This
+   //! method manages the execution of a single test.
+   //! @return The overall bit-wise status of test (see TEST_STATUS enum for bit definitions).
+   ossim_uint8 processTest(const ossimString& prefix, const ossimKeywordlist& kwl);
+
+   //! Runs a single command within a test.
+   //! @return The bit-wise status of command (see TEST_STATUS enum for bit definitions).
+   ossim_uint8 processCommands(const ossimString& prefix,
+                               const ossimKeywordlist& kwl,
+                               const ossimString& testName,
+                               bool logTime,
+                               const ossimFilename& tempFile=ossimFilename(""));
+
+   //! Modifies the config's KWL to explicitly declare implied keywords.
+   void preprocessKwl(const std::vector<std::string>& testList,
+                      const std::string& testCommand,
+                      ossimKeywordlist& kwl);
+
+   //! Default preprocessing step makes expected and output results directories. Returns 
+   //! @return TRUE if successful.
+   bool makeDefaultResultsDir();
+
+   //! Default clean step deletes all files in out and exp dirs.
+   //! @return TRUE if successful.
+   bool doDefaultClean();
+
+   /**
+    * @brief Gets the temp file name.
+    *
+    * This will either be from the config file lookup of "temp_file" or derived under
+    * $(OSSIM_BATCH_TEST_RESULTS)/tmp if the lookup fails.  Note that this will create
+    * the $(OSSIM_BATCH_TEST_RESULTS)/tmp directory if needed.
+    *
+    * @param prefix Like "test1."
+    * @param kwl Keyword list to look for temp_file in.
+    * @param tempFile Initialized by this.
+    *
+    * @return true on success.  False if derived temp file directory could
+    * not be created.
+    */
+   bool getTempFileName( const ossimString& prefix,
+                         const ossimKeywordlist& kwl,
+                         ossimFilename& tempFile ) const;
+
+   /**
+    * @brief Gets the default temp directory $(OSSIM_BATCH_TEST_RESULTS)/tmp.
+    * @param tempDir Initialized by this.
+    *
+    * @return true on success, false on error.
+    */
+   bool getDefaultTempFileDir( ossimFilename& tempDir ) const;
+
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
+
+   /**
+    * @brief Converts string slashes to either forward or backward taking
+    * into account that windows commands with forward slashes in them.
+    * @param s String to convert.
+    */
+   std::string convertToNative( const char* lookup ) const;
+
+   std::vector<std::string> m_acceptTestList;
+   std::vector<std::string> m_cleanTestList;
+   std::vector<std::string> m_preprocessTestList;
+   std::vector<std::string> m_runTestList;
+   std::map<ossim_uint32, std::string> m_statusLabels;
+
+   bool          m_templateModeActive;
+   ossimFilename m_configFileName;
+   ossimFilename m_outDir;
+   ossimFilename m_expDir;
+   std::ofstream m_logStr;
+};
+
+#endif /* #ifndef ossimBatchTest_HEADER */
diff --git a/include/ossim/util/ossimChipProcTool.h b/include/ossim/util/ossimChipProcTool.h
new file mode 100644
index 0000000..bf82857
--- /dev/null
+++ b/include/ossim/util/ossimChipProcTool.h
@@ -0,0 +1,230 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimChipProcUtil_HEADER
+#define ossimChipProcUtil_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimListenerManager.h>
+#include <ossim/util/ossimTool.h>
+#include <map>
+#include <vector>
+
+/**************************************************************************************************
+ * Base class for all utilities that process chips of image (or DEM) pixels.
+ *
+ * Many utilities share parameters in common, especially ROI (bounding box), input imagery,
+ * color look-up tables, DEM file specification, etc. This class does the following:
+ *   * Consolidates the parsing of common parameters,
+ *   * Provides for creating input chains with needed handlers and resamplers. The derived classes
+ *     would finish populating the processing chain(s) according to their requirements.
+ *   * Inserts the chipper filter at the end of the processing chain
+ *   * Appends the appropriate writer
+ *   * Provides a functional, default implementation of execute() and getChip()
+ *
+ * @note Almost all methods use throw for stack unwinding.  This is not in
+ * method declarations to alleviate build errors on windows.  Sorry...
+ **************************************************************************************************/
+class OSSIM_DLL ossimChipProcTool : public ossimTool,
+                                    public ossimProcessInterface,
+                                    public ossimListenerManager
+
+{
+public:
+   /** default constructor */
+   ossimChipProcTool();
+
+   /** virtual destructor */
+   virtual ~ossimChipProcTool();
+
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   /** Disconnects and clears the dem and image layers. */
+   virtual void clear();
+   
+   /** Initial method to be ran prior to execute. Intended for command-line app usage.
+    * @param ap Arg parser to initialize from.
+    * @return FALSE if --help option requested or no params provided, so that derived classes can
+    * @note Throws ossimException on error.
+    * @note A throw with an error message of "usage" is used to get out when a usage is printed. */
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   /** This method is responsible for completely setting up the full processing chain according to
+    * the specifications given in the kwl passed in. If the utility is run from a command line,
+    * the initialize(ossimArgumentParser) will assign the member master KWL and pass it to this
+    * method. Web service calls will fill a KWL and pass it.
+    *
+    * This base class implementation should be called by the derived class implementation (assuming
+    * the derived class needs to pull some parameters out of the KWL before the chains are set up.
+    *
+    * This method will instantiate the output projection and define the output bounding rect and
+    * product size in pixels. The processing chain (stored in m_procChain) will be completely
+    * initialized and ready for calls to getTile(). Then either getChip() or execute() can be called
+    * depending on usage to fetch product.
+    * @note Throws ossimException on error. */
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   /** Performs the actual product write.
+    * @note Throws ossimException on error. */
+   virtual bool execute();
+
+   virtual void abort();
+
+   /** Overrides base class implementation to indicate this class supports getChip() calls.
+    * Can be done with dunamic cast and pointer test, but not sure how that is supported in SWIG
+    * (OLK 11/2015). */
+   virtual bool isChipProcessor() const { return true; }
+
+   virtual ossimListenerManager* getManager();
+   virtual ossimObject* getObject();
+   virtual const ossimObject* getObject() const;
+
+   /** The meat and potatos of this class. Performs an execute on specified rect. */
+   virtual ossimRefPtr<ossimImageData> getChip(const ossimIrect& img_rect);
+   virtual ossimRefPtr<ossimImageData> getChip(const ossimGrect& gnd_rect);
+   ossimRefPtr<ossimImageData> getChip(const ossimDrect& map_bounding_rect, const ossimDpt& gsd);
+
+   const ossimFilename& getProductFilename() const { return m_productFilename; }
+
+protected:
+   /** Intended to be called after derived class has picked off its own options from the parser, and
+    * arguments remain (such as input and output filenames).
+    * @note Throws ossimException on error. */
+   void processRemainingArgs(ossimArgumentParser& ap);
+
+   /** Derived classes initialize their custom chains here. */
+   virtual void initProcessingChain() = 0;
+
+   /** Called after initProcessingChain() to append common items to the processing chain.
+    * Sets up the AOI box cutter filter and related stuff and initializes area of interest(aoi).
+    * The filter is appended to the current m_procChain. Derived class should override if not
+    * applicable to its processing chain. */
+   virtual void finalizeChain();
+
+   /** Creates chains for image entries associated with specified keyword. This is usually
+    * the input image sources but could also be used for reading list of color sources.
+    * @note Throws ossimException on error. */
+   virtual void loadImageFiles();
+   
+   /** Loads all DEM files specified in master KWL into the elev manager's database */
+   virtual void loadDemFiles();
+
+   /** Creates the ossimSingleImageChain from image filename and populates the chain with resampler
+    * and product output projection on view-side of resampler's IVT.
+    * @param file File to open.
+    * @param entryIndex Entry to open.
+    * @return Ref pointer to ossimSingleImageChain.
+    * @note Throws ossimException on error. */
+   ossimRefPtr<ossimSingleImageChain> createInputChain(const ossimFilename& image_file,
+                                                       ossim_uint32 entry_index=0);
+
+   /** Creates the output or view projection.
+    * @note All chains must be constructed prior to calling this. */
+   void createOutputProjection();
+   
+   /** Sets the single image chain for identity operations view to a ossimImageViewAffineTransform.
+    *  This will have a rotation if up is up is selected.  Also set m_outputProjection to the
+    *  input's for area of interest. */
+   ossimRefPtr<ossimMapProjection>  newIdentityProjection();
+
+   /** Convenience method to get a utm projection.
+    * @return new ossimUtmProjection. */
+   ossimRefPtr<ossimMapProjection> newUtmProjection();
+
+   /** Initializes the projection gsd. This loops through all chains to find the minimum gsd.
+    * @note Throws ossimException on error. */
+   virtual void initializeProjectionGsd();
+
+   /** Initializes m_aoiViewRect with the output area of interest as specified in master KWL.
+    *  Initialization will either come from user defined cut options or the
+    *  source bounding rect with user options taking precidence.
+    * @note Throws ossimException on error. */
+   virtual void initializeAOI();
+
+   /** Reads the KWL for origin latitude and central meridian.
+    * @param gpt Point to initialize. Set to 0 unless lat or lon specified in KWL
+    * @return false if no items found in KWL.
+    * @note Throws ossimException on error. */
+   bool getProjectionOrigin(ossimGpt& gpt);
+
+   /** Creates a new writer. This will use the writer option (-w or --writer), if present; else,
+    * it will be derived from the output file extention. This will also set any writer properties
+    * passed in.
+    * @return new ossimImageFileWriter.
+    * @note Throws ossimException on error. */
+   ossimRefPtr<ossimImageFileWriter> newWriter();
+
+   /** Loops through all chains and sets the output projection.
+    * @note Throws ossimException on error. */
+   void propagateGeometryToChains();
+
+   /** When multiple input sources are present, this method instantiates a combiner and adds inputs
+    * @return Reference to the combiner. */
+   ossimRefPtr<ossimImageSource>
+   combineLayers(std::vector< ossimRefPtr<ossimSingleImageChain> >& layers) const;
+
+   /** Initializes m_aoiViewRect given m_aoiGroundRect. */
+   void computeAdjustedViewFromGrect();
+
+   /** Assigns the AOI to be the bounding rect of the union of all inputs. */
+   void setAoiToInputs();
+
+   /** Gets the band list if BANDS keyword is set.
+    * NOTE: BANDS keyword values are ONE based.  bandList values are ZERO based.
+    * @param input image index for which the band selection applies
+    * @param bandList List initialized by this. */
+   void getBandList(ossim_uint32 image_idx, std::vector<ossim_uint32>& bandList ) const;
+
+   /** Passes reader properties to single image handler if any.
+    * @param ih Image handler to set properties on. */
+   void setReaderProps( ossimImageHandler* ih ) const;
+   
+   /** Hidden from use copy constructor. */
+   ossimChipProcTool( const ossimChipProcTool& obj );
+
+   /** Hidden from use assignment operator. */
+   const ossimChipProcTool& operator=( const ossimChipProcTool& /*rhs*/ ) { return *this; }
+
+   ossimRefPtr<ossimGeoPolygon>  createClipPolygon()const;
+
+   /** Tries to determine the AOI center point based on KWL entries, else returns NaNs in gpt.
+    * Needed for bootstrapping the GSD computation when information in KWL is sparse */
+   void findCenterGpt(ossimGpt& gpt);
+
+   /**
+    * Some utilities need to work on DEMs as images. This method determines which DEMs cover the AOI
+    * and creates an image mosaic with the DEMS serving as pixel sources. Throws exceptions.
+    */
+   ossimRefPtr<ossimImageSource>  mosaicDemSources();
+
+   ossimRefPtr<ossimImageGeometry> m_geom; //> Product chip/image geometry
+   ossimIrect m_aoiViewRect;
+   ossimGrect m_aoiGroundRect;
+   std::vector< ossimRefPtr<ossimSingleImageChain> > m_imgLayers;
+   std::vector< ossimFilename > m_demSources; //> Stores list of DEMs provided to the utility (versus pulled from the elevation database)
+   mutable ossimRefPtr<ossimImageFileWriter> m_writer;
+   ossimRefPtr<ossimImageChain> m_procChain;
+   ossimRefPtr<ossimRectangleCutFilter> m_cutRectFilter;
+   bool m_projIsIdentity;
+   ossimDpt m_gsd; // meters
+   bool m_geoScaled;
+   ossimFilename m_productFilename;
+   ossimScalarType m_productScalarType;
+   bool m_needCutRect; // True when a specific AOI, different from the input, was requested
+};
+
+#endif /* #ifndef ossimChipProcUtil_HEADER */
diff --git a/include/ossim/util/ossimChipperUtil.h b/include/ossim/util/ossimChipperUtil.h
new file mode 100644
index 0000000..73baf45
--- /dev/null
+++ b/include/ossim/util/ossimChipperUtil.h
@@ -0,0 +1,823 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimChipperUtil.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Utility class to for chipping out images. Orthorectifying imagery with an
+// added slant toward doing digital elevation model(DEM) operations.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimChipperUtil.h 23423 2015-07-13 19:07:38Z dburken $
+
+#ifndef ossimChipperUtil_HEADER
+#define ossimChipperUtil_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/projection/ossimMapProjection.h>
+
+#include <map>
+#include <vector>
+
+// Forward class declarations:
+class ossimAnnotationSource;
+class ossimArgumentParser;
+class ossimDpt;
+class ossimFilename;
+class ossimGeoPolygon;
+class ossimGpt;
+class ossimImageData;
+class ossimImageFileWriter;
+class ossimImageGeometry;
+class ossimImageViewAffineTransform;
+class ossimIrect;
+class ossimKeywordlist;
+
+/**
+ * @brief ossimChipperUtil class.
+ *
+ * This is a utility class to orthorectify imagery with an added slant toward
+ * doing digital elevation model(DEM) operations.
+ *
+ * See the ossim-dem application for a code usage example.
+ *
+ * @note Almost all methods use throw for stack unwinding.  This is not in
+ * method declarations to alleviate build errors on windows.  Sorry...
+ *
+ * @note "bumpshade" and "hillshade" intermixed throughout.  The class to do
+ * a hillshade is the ossimBumpShadeTileSource.
+ */
+class OSSIM_DLL ossimChipperUtil : public ossimReferenced
+{
+public:
+
+   /** emumerated operations */
+   enum ossimChipperOperation
+   {
+      OSSIM_CHIPPER_OP_UNKNOWN      = 0,
+      OSSIM_CHIPPER_OP_HILL_SHADE   = 1,
+      OSSIM_CHIPPER_OP_COLOR_RELIEF = 2,
+      OSSIM_CHIPPER_OP_ORTHO        = 3,
+      OSSIM_CHIPPER_OP_2CMV         = 4, // two color multiview
+      OSSIM_CHIPPER_OP_CHIP         = 5, // image space
+      OSSIM_CHIPPER_OP_PSM          = 6  // pan sharpened multispectral
+   };
+
+   /** emumerated output projections */
+   enum ossimChipperOutputProjection
+   {
+      OSSIM_CHIPPER_PROJ_UNKNOWN    = 0,
+      OSSIM_CHIPPER_PROJ_GEO        = 1,
+      OSSIM_CHIPPER_PROJ_GEO_SCALED = 2,
+      OSSIM_CHIPPER_PROJ_INPUT      = 3,
+      OSSIM_CHIPPER_PROJ_UTM        = 4
+   };
+
+   /** default constructor */
+   ossimChipperUtil();
+
+   /** virtual destructor */
+   virtual ~ossimChipperUtil();
+
+   /**
+    * @brief Disconnects and clears the dem and image layers.
+    */
+   void clear();
+   
+   /**
+    * @brief Initial method to be ran prior to execute.
+    * @param ap Arg parser to initialize from.
+    * @note Throws ossimException on error.
+    * @note A throw with an error message of "usage" is used to get out when
+    * a usage is printed.
+    */
+   bool initialize(ossimArgumentParser& ap);
+
+
+   /**
+    * @brief Initialize method to be ran prior to execute.
+    * 
+    * @note Throws ossimException on error.
+    */
+   void initialize(const ossimKeywordlist& kwl);
+
+   /**
+    * @brief execute method.  Performs the actual product write.
+    * @note Throws ossimException on error.
+    */
+   void execute();
+
+   void abort();
+
+   /**
+    * @brief Gets initialized area of interest(aoi) from chain.
+    * @return Pointer to ossimImageData holding chip.  Pointer
+    * can be null if not initialized properly so caller should
+    * check.
+    */
+//   ossimRefPtr<ossimImageData> getChip();
+
+   /**
+   * The options will only support a couple modifications while chipping.  
+   * this is mainly here to support a moving chip window so we do not need to do
+   * a full initialize for every chip.  We can specify a new cut bounds and
+   * cut width height in pixels if desired.
+   *
+   *  cut_wms_bbox: ..........
+   *  cut_width:
+   *  cut_height:
+   *
+   *
+   *
+   */
+   ossimRefPtr<ossimImageData> getChip(const ossimKeywordlist& optionsKwl= ossimKeywordlist());
+
+   /**
+    * @brief Gets the output file name.
+    * @param f Initialized by this with the filename.
+    */
+   void getOutputFilename(ossimFilename& f) const;
+
+private:
+
+   /**
+    * @brief Initial method to be ran prior to execute.
+    *
+    * @note Throws ossimException on error.
+    */
+   void initialize();
+
+   /**
+    * @brief Builds image chains returns ref pointer to image source
+    * and initializes area of interest(aoi).
+    * @return Ref pointer to image chain.
+    */
+   ossimRefPtr<ossimImageSource> initializeChain( ossimIrect& aoi );
+
+   void setOptionsToChain( ossimIrect& aoi, const ossimKeywordlist& kwl );
+
+   /**
+    * @brief Initializes a color relief chain.
+    * @return Ref pointer to image chain.
+    */
+   ossimRefPtr<ossimImageSource> initializeColorReliefChain();
+
+   /**
+    * @brief Initializes a bump shade chain.
+    * @return Ref pointer to image chain.
+    */
+   ossimRefPtr<ossimImageSource> initializeBumpShadeChain();
+
+   /**
+    * @brief Combines two images into a two color multi view chain.
+    * @return ossimRefPtr with pointer to ossimImageSource.  Can be null.
+    */
+   ossimRefPtr<ossimImageSource> initialize2CmvChain();
+
+   /**
+    * @brief Initializes a psm (pan sharpening multispectra) chain.
+    * @return Ref pointer to image chain.
+    */
+   ossimRefPtr<ossimImageSource> initializePsmChain();
+
+   /**
+    * @brief Initializes the output projection and propagates to image chains.
+    * @note Throws ossimException on error.
+    */
+   void initializeOutputProjection();
+   
+   /** @brief Create chains for all dems. */
+   void addDemSources();
+   
+   /**
+    * @brief Method to create a chain and add to dem layers from file.
+    * @param file Image to open.
+    * @parm entryIndex Entry to open.
+    */
+   void addDemSource(const ossimFilename& file,
+                     ossim_uint32 entryIndex);
+
+   /**
+    * @brief  Method to create a chain and add to dem layers from a
+    * ossimSrcRecord.
+    */
+   void addDemSource(const ossimSrcRecord& rec);
+
+   /** @brief Creates chains for all images. */
+   void addImgSources();
+   
+   /**
+    * @brief Method to create a chain and add to img layers from file.
+    * @param file Image to open.
+    * @parm entryIndex Entry to open.
+    */
+   void addImgSource(const ossimFilename& file,
+                     ossim_uint32 entryIndex);
+
+   /**
+    * @brief  Method to create a chain and add to img layers from a
+    * ossimSrcRecord.
+    */
+   void addImgSource(const ossimSrcRecord& rec);
+
+   /**
+    * @brief Creates a ossimSingleImageChain from file.
+    * @param file File to open.
+    * @param entryIndex Entry to open.
+    * @param isDemSource True if dem source, false if not. This controls chain
+    * options like histogram stretches.
+    * @return Ref pointer to ossimSingleImageChain.
+    * @note Throws ossimException on error.
+    */
+   ossimRefPtr<ossimSingleImageChain> createChain(const ossimFilename& file,
+                                                  ossim_uint32 entryIndex,
+                                                  bool isDemSource) const;
+
+   /**
+    * @brief Creates a ossimSingleImageChain from ossimSrcRecord.
+    * @param src Record.
+    * @param isDemSource True if dem source, false if not. This controls chain
+    * options like histogram stretches.
+    * @return Ref pointer to ossimSingleImageChain.
+    * @note Throws ossimException on error.
+    */
+   ossimRefPtr<ossimSingleImageChain> createChain(const ossimSrcRecord& rec,
+                                                  bool isDemSource) const;
+
+   /**
+    * @brief Creates the output or view projection.
+    * @note All chains should be constructed prior to calling this.
+    */
+   void createOutputProjection();
+   
+   /**
+    * @brief Sets the single image chain for identity operations view to
+    * a ossimImageViewAffineTransform.  This will have a rotation if
+    * up is up is selected.  Also set m_outputProjection to the input's
+    * for area of interest.
+    */
+   void createIdentityProjection();
+
+   /**
+    * @brief Gets the first input projection.
+    *
+    * This gets the output projection of the first dem layer if present;
+    * if not, the first image layer.
+    * 
+    * @return ref ptr to projection, could be null.
+    */
+   ossimRefPtr<ossimMapProjection> getFirstInputProjection();
+
+   /**
+    * @brief Convenience method to get geographic projection.
+    * @return new ossimEquDistCylProjection.
+    */
+   ossimRefPtr<ossimMapProjection> getNewGeoProjection();
+
+   /**
+    * @brief Convenience method to get geographic projection.
+    *
+    * This method sets the origin to the center of the scene bounding rect
+    * of all layers.
+    * @return new ossimEquDistCylProjection.
+    */
+   ossimRefPtr<ossimMapProjection> getNewGeoScaledProjection();
+
+    /**
+    * @brief Convenience method to get a projection from an srs code.
+    * @return new ossimMapProjection.
+    */  
+   ossimRefPtr<ossimMapProjection> getNewProjectionFromSrsCode(
+      const std::string& code );
+
+   /**
+    * @brief Convenience method to get a utm projection.
+    * @return new ossimUtmProjection.
+    */     
+   ossimRefPtr<ossimMapProjection> getNewUtmProjection();
+
+   /**
+    * @brief Convenience method to get a pointer to the  output map
+    * projection.
+    *
+    * Callers should check for valid() as the pointer could be
+    * 0 if not initialized.
+    * 
+    * @returns The ossimMapProjection* from the m_outputGeometry as a ref
+    * pointer.
+    */
+   ossimRefPtr<ossimMapProjection> getMapProjection();
+
+   /**
+    * @brief Sets the projection tie point to the scene bounding rect corner.
+    * @note Throws ossimException on error.
+    */
+   void intiailizeProjectionTiePoint();
+
+   /**
+    * @brief Initializes the projection gsd.
+    *
+    * This loops through all chains to find the best resolution gsd.
+    *
+    * @note Throws ossimException on error.
+    */
+   void initializeProjectionGsd();   
+
+   /**
+    * @brief Initializes the image view transform(IVT) scale.
+    *
+    * Chip mode only. Sets IVT scale to output / input.
+    * 
+    * @note Throws ossimException on error.
+    */
+   void initializeIvtScale();   
+
+   /**
+    * @brief Loops through all layers to get the upper left tie point.
+    * @param tie Point to initialize.
+    */
+   void getTiePoint(ossimGpt& tie);
+
+   /**
+    * @brief Gets the upper left tie point from a chain.
+    * @param chain The chain to get tie point from.
+    * @param tie Point to initialize.
+    * @note Throws ossimException on error.
+    */
+   void getTiePoint(ossimSingleImageChain* chain, ossimGpt& tie);
+
+   /**
+    * @brief Loops through all layers to get the upper left tie point.
+    * @param tie Point to initialize.
+    */
+   void getTiePoint(ossimDpt& tie);
+
+   /**
+    * @brief Gets the upper left tie point from a chain.
+    * @param chain The chain to get tie point from.
+    * @param tie Point to initialize.
+    * @note Throws ossimException on error.
+    */
+   void getTiePoint(ossimSingleImageChain* chain, ossimDpt& tie);
+
+   /**
+    * @brief Loops through all layers to get the best gsd.
+    * @param gsd Point to initialize.
+    */
+   void getMetersPerPixel(ossimDpt& gsd);
+
+   /**
+    * @brief Gets the gsd from a chain.
+    * @param chain The chain to get gsd from.
+    * @param gsd Point to initialize.
+    * @note Throws ossimException on error.
+    */   
+   void getMetersPerPixel(ossimSingleImageChain* chain, ossimDpt& gsd);
+
+   /**
+    * @brief Gets value of key "central_meridan" if set, nan if not.
+    *
+    * @return Value as a double or nan if keyord is not set.
+    * 
+    * @note Throws ossimException on range error.
+    */
+   ossim_float64 getCentralMeridian() const;
+
+   /**
+    * @brief Gets value of key "origin_latitude" if set, nan if not.
+    *
+    * @return Value as a double or nan if keyord is not set.
+    * 
+    * @note Throws ossimException on range error.
+    */
+   ossim_float64 getOriginLatitude() const;
+
+   /**
+    * @brief Loops through all layers to get the scene center ground point.
+    * @param gpt Point to initialize.
+    * @note Throws ossimException on error.
+    */
+   void getSceneCenter(ossimGpt& gpt);
+
+   /**
+    * @brief Gets the scene center from a chain.
+    * @param chain The chain to get scene center from.
+    * @param gpt Point to initialize.
+    * @note Throws ossimException on error.
+    */   
+   void getSceneCenter(ossimSingleImageChain* chain, ossimGpt& gpt);
+
+   /**
+    * @brief Creates a new writer.
+    *
+    * This will use the writer option (-w or --writer), if present; else,
+    * it will be derived from the output file extension.
+    *
+    * This will also set any writer properties passed in.
+    *
+    * @return new ossimImageFileWriter.
+    * @note Throws ossimException on error.
+    */
+   ossimRefPtr<ossimImageFileWriter> createNewWriter() const;
+
+   /**
+    * @brief loops through all chains and sets the output projection.
+    * @note Throws ossimException on error.
+    */
+   void propagateOutputProjectionToChains();
+
+   /**
+    * @brief Combines all layers into an ossimImageMosaic.
+    * @return ossimRefPtr with pointer to ossimImageSource.  Can be null.
+    */
+   ossimRefPtr<ossimImageSource> combineLayers(
+      std::vector< ossimRefPtr<ossimSingleImageChain> >& layers) const;
+
+   /** @brief Combines dems(m_demLayer) and images(m_imgLayer). */
+   ossimRefPtr<ossimImageSource> combineLayers();
+
+   /**
+    * @brief Creates ossimIndexToRgbLutFilter and connects to source.
+    * @param Source to connect to.
+    * @return End of chain with lut filter on it.
+    * @note Throws ossimException on error.
+    */
+   ossimRefPtr<ossimImageSource> addIndexToRgbLutFilter(
+      ossimRefPtr<ossimImageSource> &source) const;
+
+   /**
+    * @brief Creates ossimScalarRemapper and connects to source.
+    * @param Source to connect to.
+    * @param scalar Scalar type.
+    * @return End of chain with remapper on it.
+    * @note Throws ossimException on error.
+    */
+   ossimRefPtr<ossimImageSource> addScalarRemapper(
+      ossimRefPtr<ossimImageSource> &source,
+      ossimScalarType scalar) const;
+
+   /**
+    * @brief Add annotation source to chain.
+    * @param Source to connect to.
+    * @return End of chain with annotion source on it.
+    */
+   ossimRefPtr<ossimImageSource> addAnnotations(
+      ossimRefPtr<ossimImageSource> &source) const;
+
+   /**
+    * @brief Adds cross hair graphic to annotation source.
+    * @param Annotator to add objects to.
+    * @param prefix e.g. annotation0.
+    */
+   void addCrossHairAnnotation(
+      ossimRefPtr<ossimAnnotationSource> annotator,
+      const std::string& prefix ) const;
+
+   /**
+    * @brief Set up ossimHistogramRemapper for a chain.
+    * @param chain Chain to set up.
+    * @return true on success, false on error.
+    */
+   bool setupChainHistogram( ossimRefPtr<ossimSingleImageChain>& chain) const;
+
+   /**
+    * @brief Sets entry for a chain.
+    * @param chain Chain to set up.
+    * @param entryIndex Zero based index.
+    * @return true on success, false on error.
+    */
+   bool setChainEntry( ossimRefPtr<ossimSingleImageChain>& chain,
+                       ossim_uint32 entryIndex ) const;
+
+   /**
+    * @brief Initializes "rect" with the output area of interest.
+    *
+    * Initialization will either come from user defined cut options or the
+    * source bounding rect with user options taking precidence.
+    *
+    * @param source Should be the end of the processing chain.
+    * @param rect Rectangle to initialize.  This is in output (view) space.
+    *
+    * @note Throws ossimException on error.
+    */
+   void getAreaOfInterest( ossimImageSource* source, ossimIrect& rect ) const;
+
+   /**
+    * Gets rect from string in the form of <x>,<y>,<w>,<h>.
+    * @param s String to parse.
+    * @rect Initialized by this.
+    * @return true on success, false, on error.
+    */
+   bool getIrect( const std::string& s, ossimIrect& rect ) const;
+
+   /**
+    * Gets image rect from string in the form of <lat>,<lon>,<w>,<h>.
+    *
+    * Computes image rect from world point assumed to be center of aoi.
+    *
+    * @param chain
+    * @param s String to parse.
+    * @rect Initialized by this.
+    * @return true on success, false, on error.
+    */
+   bool getIrect( ossimRefPtr<ossimSingleImageChain>& chain,
+                  const std::string& s, ossimIrect& rect ) const;
+   
+   /**
+    * Gets 256 x 256 image rect from center of the image.
+    *
+    * Computes image rect from world point assumed to be center of aoi.
+    *
+    * @param chain
+    * @rect Initialized by this.
+    * @return true on success, false, on error.
+    */
+   bool getIrect( ossimRefPtr<ossimSingleImageChain>& chain,
+                  ossimIrect& rect ) const;
+   
+   /**
+    * @brief Method to calculate and initialize scale and area of interest
+    * for making a thumbnail.
+    *
+    * Sets the scale of the output projection so that the adjusted rectangle
+    * meets the cut rect and demension requirements set in options.
+    *
+    * @param originalRect Original scene area of interest.
+    * @param adjustedRect New rect for thumbnail.
+    *
+    * @note Throws ossimException on error.
+    */
+   void initializeThumbnailProjection(const ossimIrect& originalRect,
+                                      ossimIrect& adjustedRect);
+
+   /** @return true if BANDS keyword is set; false, if not. */
+   bool hasBandSelection() const;
+
+   /**
+    * @brief Gets the band list if BANDS keyword is set.
+    *
+    * NOTE: BANDS keyword values are ONE based.  bandList values are
+    * ZERO based.
+    *
+    * @param bandList List initialized by this.
+    */
+   void getBandList( std::vector<ossim_uint32>& bandList ) const;
+
+   /** @return true if annotation options are set; false, if not. */
+   bool hasAnnotations() const;
+
+   /** @return true if color table (lut) is set; false, if not. */
+   bool hasLutFile() const;
+
+   /** @return true if brightness or contrast option is set; false, if not. */
+   bool hasBrightnesContrastOperation() const;
+
+   /** @return true if any Geo Poly cutter option is set */
+   bool hasGeoPolyCutterOption()const;
+   
+   /**
+    * @return true if any bump share options have been set by user; false,
+    * if not.
+    */
+   bool hasBumpShadeArg() const;
+
+   /** @return true if thumbnail option is set; false, if not. */
+   bool hasThumbnailResolution() const;
+
+   /** @return true if histogram option is set; false, if not. */
+   bool hasHistogramOperation() const;
+
+   /** @return true if file extension is "hgt", "dem" or contains "dtN" (dted). */
+   bool isDemFile(const ossimFilename& file) const;
+
+   /** @return true if file extension is "src" */
+   bool isSrcFile(const ossimFilename& file) const;
+
+   /** @brief Initializes m_srcKwl if option was set. */
+   void initializeSrcKwl();
+
+   /**
+    * @return The number of DEM_KW and IMG_KW found in the m_kwl and m_srcKwl
+    * keyword list.
+    */
+   ossim_uint32 getNumberOfInputs() const;
+
+   /**
+    * @brief Gets the emumerated output projection type.
+    *
+    * This looks in m_kwl for ossimKeywordNames::PROJECTION_KW.
+    * @return The enumerated output projection type.
+    * @note This does not cover SRS keyword which could be any type of projection.
+    */
+   ossimChipperOutputProjection getOutputProjectionType() const;
+
+   /**
+    * @brief Returns the scalar type from OUTPUT_RADIOMETRY_KW keyword if
+    * present. Deprecated SCALE_2_8_BIT_KW is also checked.
+    *
+    * @return ossimScalarType Note this can be OSSIM_SCALAR_UNKNOWN if the
+    * keywords are not present.
+    */
+   ossimScalarType getOutputScalarType() const;
+
+   /** @return true if scale to eight bit option is set; false, if not. */
+   bool scaleToEightBit() const;
+
+   /** @return true if snap tie to origin option is set; false, if not. */
+   bool snapTieToOrigin() const;
+
+   /**
+    * @brief Gets the image space scale.
+    *
+    * This is a "chip" operation only.
+    *
+    * Keys: 
+    * IMAGE_SPACE_SCALE_X_KW
+    * IMAGE_SPACE_SCALE_Y_KW
+    *
+    * Scale will be 1.0, 1.0 if keys not found. 
+    */
+   void getImageSpaceScale( ossimDpt& imageSpaceScale ) const;
+   
+   /**
+    * @brief Gets rotation.
+    *
+    * @return Rotation in decimal degrees if ROTATION_KW option is set;
+    * ossim::nan, if not.
+    *
+    * @note Throws ossimException on range error.
+    */
+   ossim_float64 getRotation() const;
+
+   /** @return true if ROTATION_KW option is set; false, if not. */
+   bool hasRotation() const;
+
+   /** @return true if UP_IS_UP_KW option is set; false, if not. */
+   bool upIsUp() const;
+
+   /** @return true if NORTH_UP_KW option is set; false, if not. */
+   bool northUp() const;
+
+   /** @return true if operation is "chip" or identity; false, if not. */
+   bool isChipMode() const;
+
+   /** @return true if key is set to true; false, if not. */
+   bool keyIsTrue( const std::string& key ) const;
+
+   /**
+    * @return The entry number if set.  Zero if ossimKeywordNames::ENTRY_KW not
+    * found.
+    */
+   ossim_uint32 getEntryNumber() const;
+
+   /**
+    * @return The zone if set.  Zero if ossimKeywordNames::ZONE_KW not
+    * found.
+    */
+   ossim_int32 getZone() const;
+
+   /**
+    * @return The hemisphere if set. Empty string if
+    * ossimKeywordNames::HEMISPHERE_KW not found.
+    */
+   std::string getHemisphere() const;
+
+   /**
+    * @return True if any input has a sensor model input, false if all input
+    * projections are map projections.
+    */
+   bool hasSensorModelInput();
+
+   /**
+    * @return true if all size cut box width height keywords are true.
+    */
+   bool hasCutBoxWidthHeight() const;
+
+   /**
+   *  @return true if the WMS style cut and the width and height keywords are set
+   */
+   bool hasWmsBboxCutWidthHeight() const;
+
+   /**
+    * @return true if meters, degrees or cut box with width and height option.
+    */  
+   bool hasScaleOption() const;
+   
+   /**
+    * @return true if three band out is true, false if not.
+    */  
+   bool isThreeBandOut() const;
+
+   /**
+    * @return true if pad thumbnail is true, false if not.
+    */  
+   bool padThumbnail() const;
+
+   /**
+    * @brief Passes reader properties to single image handler if any.
+    * @param ih Image handler to set properties on.
+    */
+   void setReaderProps( ossimImageHandler* ih ) const;
+   
+   /**
+    * @brief Adds application arguments to the argument parser.
+    * @param ap Parser to add to.
+    */
+   void addArguments(ossimArgumentParser& ap);
+
+   void getClipPolygon(ossimGeoPolygon& polygon)const;
+   /**
+    * @brief Gets the brightness level.
+    * 
+    * This will return 0.0 if the keyword is not found or if the range check
+    * is not between -1.0 and 1.0.
+    *
+    * @return brightness
+    */
+   ossim_float64 getBrightness() const;
+
+   /**
+    * @brief Gets the contrast level.
+    * 
+    * This will return 1.0 if the keyword is not found or if the range check
+    * is not between 0.0 and 20.0.
+    *
+    * @return brightness
+    */   
+   ossim_float64 getContrast() const;
+
+   /**
+    * @brief Gets the sharpen mode.
+    *
+    * Valid modes: light, heavy
+    * 
+    * @return sharpness mode
+    */   
+   std::string getSharpenMode() const;
+
+   int getHistoMode() const;
+
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
+
+   /** @brief Hidden from use copy constructor. */
+   ossimChipperUtil( const ossimChipperUtil& obj );
+
+   /** @brief Hidden from use assignment operator. */
+   const ossimChipperUtil& operator=( const ossimChipperUtil& rhs );
+
+   ossimRefPtr<ossimImageSource> createCombiner()const;
+
+   /** Enumerated operation to perform. */
+   ossimChipperOperation m_operation;
+   
+   /** Hold all options passed into intialize. */
+   ossimRefPtr<ossimKeywordlist> m_kwl;
+
+   /** Hold contents of src file if --src is used. */
+   ossimRefPtr<ossimKeywordlist> m_srcKwl;
+
+   /**
+    * The image geometry.  In chip mode this will be from the input image. So
+    * this may or may not have a map projection. In any other mode it
+    * will the view or output geometry which will be a map projection.
+    */
+   ossimRefPtr<ossimImageGeometry> m_geom;
+
+   /**
+    * Image view transform(IVT). Only set/used in "chip"(identity) operation as
+    * the IVT for the resampler(ossimImageRenderer).
+    */
+   ossimRefPtr<ossimImageViewAffineTransform> m_ivt;
+
+   /**  Array of dem chains. */
+   std::vector< ossimRefPtr<ossimSingleImageChain> > m_demLayer;
+
+   /**  Array of image source chains. */
+   std::vector< ossimRefPtr<ossimSingleImageChain> > m_imgLayer;
+   
+   /**
+    *  We need access to the writer so we can support aborting
+    */
+   mutable ossimRefPtr<ossimImageFileWriter> m_writer;
+
+   /**
+   * We need to support changing clips without doing a full initilization.  
+   * we will save the ImageSource pointer on first initialization
+   */
+    ossimRefPtr<ossimImageSource> m_source;
+
+};
+
+#endif /* #ifndef ossimChipperUtil_HEADER */
diff --git a/ossim/include/ossim/util/ossimEquationUtil.h b/include/ossim/util/ossimEquationUtil.h
similarity index 100%
rename from ossim/include/ossim/util/ossimEquationUtil.h
rename to include/ossim/util/ossimEquationUtil.h
diff --git a/include/ossim/util/ossimFileWalker.h b/include/ossim/util/ossimFileWalker.h
new file mode 100644
index 0000000..c7c1f7a
--- /dev/null
+++ b/include/ossim/util/ossimFileWalker.h
@@ -0,0 +1,222 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimFileWalker.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  See description for class below.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimFileWalker_HEADER
+#define ossimFileWalker_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/parallel/ossimJob.h>
+#include <ossim/parallel/ossimJobMultiThreadQueue.h>
+#include <OpenThreads/Mutex>
+#include <string>
+#include <vector>
+
+class ossimFilename;
+class ossimFileProcessorInterface;
+
+/**
+ * @class ossimFileWalker
+ *
+ * Utility class to walk through directories and get a list of files to
+ * process. For each file found the ossimFileProcessorInterface::processFile
+ * method is excecuted.  Internally the processFile calls are placed in a job
+ * queue.
+ *
+ * Typical usage (snip from ossimTiledElevationDatabase):
+ *
+ * ossimFileWalker* fw = new ossimFileWalker();
+ * fw->initializeDefaultFilterList();
+ * fw->setFileProcessor( this ); 
+ * fw->walk(f);
+ */
+class OSSIM_DLL ossimFileWalker
+{
+public:
+   
+   /** default constructor */
+   ossimFileWalker();
+
+   /** destructor */
+   ~ossimFileWalker();
+
+   /**
+    * @brief Takes an array of files.
+    *
+    * For each file in array:  If files is a directory, it will walk it. Files
+    * found in walk or files(not directories) in the array will be processed
+    * via a job queue.
+    *
+    * Files are filter prior to the callback execution.  The filtering is to
+    * eliminate sending unwanted files to the callback.  There is a default
+    * filter table.  This can be edited by calling the non-const
+    * getFilteredExtensions method.
+    *
+    * Each callback is placed in a threaded job queue.  So users should ensure
+    * their callback is thread safe.
+    */
+   void walk(const std::vector<ossimFilename>& files);
+
+   /**
+    * @brief This will walk "root" and execute a callback for each file found.
+    *
+    * Files are filter prior to the callback execution.  The filtering is to
+    * eliminate sending unwanted files to the callback.  There is a default
+    * filter table.  This can be edited by calling the non-const
+    * getFilteredExtensions method.
+    *
+    * Each callback is placed in a threaded job queue.  So users should ensure
+    * their callback is thread safe.
+    */
+   void walk(const ossimFilename& root);
+
+   /**
+    * @brief Sets ossimFileProcessorInterfacecallback method to process files.
+    *
+    * @param fpi ossimFileProcessorInterface pointer
+    */   
+   void setFileProcessor(ossimFileProcessorInterface* fpi);
+
+   /** @return The list of filtered out files. */
+   const std::vector<std::string>& getFilteredExtensions() const;
+
+   /**
+    * @brief Non const method to allow access for
+    * adding or deleting extensions from the list.
+    *
+    * The list is used by the private isFiltered method to avoid trying to
+    * process unwanted files.
+    */
+   std::vector<std::string>& getFilteredExtensions();
+
+   /** @brief Dumps filtered image extenstions to std out. */
+   void dumpFilteredExtensionList() const;
+
+   /**
+    * @brief Initializes the filter list with a default set of filtered out
+    * file names.
+    */
+   void initializeDefaultFilterList();
+
+   /**
+    * @brief Sets recurse flag.
+    *
+    * If set to true this stops recursing of the
+    * current directory.  Defaulted to true in the constructor.
+    * Typically used to indicate the directory being processed holds a
+    * directory based image, e.g. RPF data.
+    *
+    * @param flag True to recurse, false to stop recursion of current
+    * directory.
+    */
+   void setRecurseFlag(bool flag);
+
+   /**
+    * @brief Sets waitOnDir flag.
+    *
+    * If set to true each directory is processed in entirety before sub
+    * directories are recursed.  This allows callers of setRecurseFlag
+    * to disable directory walking.  If your code is calling setRecurseFlag
+    * this flag should be set to true.
+    *
+    * @param flag true to wait, false to not wait. Defaulted to false in the constructor. 
+    */   
+   void setWaitOnDirFlag(bool flag);
+
+   /**
+    * @brief If set to true this stops files walking (aborts).
+    * @param flag True to abort current "walk".
+    */
+   void setAbortFlag(bool flag);
+
+   /** @brief Sets the max number of threads(jobs) to run at one time. */
+   void setNumberOfThreads(ossim_uint32 nThreads);
+   
+private:
+
+   /** @brief Private ossimJob class. */
+   class ossimFileWalkerJob : public ossimJob
+   {
+   public:
+      /**
+       * @brief Constructor that takes file processor pointer and file.
+       * @param fpi ossimFileProcessorInterface pointer
+       * @param file The file to process.
+       */
+      ossimFileWalkerJob(ossimFileProcessorInterface* fpi,
+                         const ossimFilename& file);
+      /**
+       * @brief Defines pure virtual ossimJob::start.
+       *
+       * This executes the call to m_processFileCallBackPtr.
+       */
+      virtual void start();
+      
+   private:
+      ossimFileProcessorInterface* m_fileProcessor;
+      ossimFilename                m_file;
+      
+   }; // End: class ossimFileWalkerJob
+
+   /** @brief Private ossimJobCallback class. */
+   class ossimFileWalkerJobCallback : public ossimJobCallback
+   {
+   public:
+      ossimFileWalkerJobCallback();
+      virtual void started(ossimJob* job);
+      virtual void finished(ossimJob* job);
+      virtual void canceled(ossimJob* job);
+   };
+
+   /**
+    * @brief Processes files in directory.
+    *
+    * If a file in the directory is itself a directory this will do a recursive
+    * call to itself.  Individual files are processed in a job queue...
+    */
+   void walkDir(const ossimFilename& dir);
+   
+   /**
+    * @brief Convenience method for file walker code to check file to see is
+    * it should be processed.
+    *
+    * @param f File to check.
+    * 
+    * @return true if f is in filter list, false if not.
+    */
+   bool isFiltered(const ossimFilename& f) const;
+   
+   /**
+    * @brief isDotFile method.
+    * @param f File/directory to check.
+    * @return true if file is a dot file.
+    */   
+   bool isDotFile(const ossimFilename& f) const;
+   
+   /**
+    * @brief Callback to method to process a file.
+    *
+    * @param const ossimFilename& First parameter(argument) file to process.
+    */
+   ossimFileProcessorInterface*          m_fileProcessor;
+   ossimRefPtr<ossimJobMultiThreadQueue> m_jobQueue;
+   std::vector<std::string>              m_filteredExtensions;
+   bool                                  m_recurseFlag;
+   bool                                  m_waitOnDirFlag;
+   bool                                  m_abortFlag;
+   OpenThreads::Mutex                    m_mutex;
+};
+
+#endif /* #ifndef ossimFileWalker_HEADER */
diff --git a/include/ossim/util/ossimHillshadeTool.h b/include/ossim/util/ossimHillshadeTool.h
new file mode 100644
index 0000000..d0489f4
--- /dev/null
+++ b/include/ossim/util/ossimHillshadeTool.h
@@ -0,0 +1,62 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimHillshadeUtil_HEADER
+#define ossimHillshadeUtil_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/util/ossimChipProcTool.h>
+
+// Forward class declarations:
+class ossimArgumentParser;
+class ossimDpt;
+class ossimFilename;
+class ossimGeoPolygon;
+class ossimGpt;
+class ossimImageData;
+class ossimImageFileWriter;
+class ossimImageGeometry;
+class ossimImageViewAffineTransform;
+class ossimIrect;
+class ossimKeywordlist;
+
+class OSSIM_DLL ossimHillshadeTool : public ossimChipProcTool
+{
+public:
+   /** default constructor */
+   ossimHillshadeTool();
+
+   /** virtual destructor */
+   virtual ~ossimHillshadeTool();
+
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   virtual ossimString getClassName() const { return "ossimHillshadeUtil"; }
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+protected:
+
+   virtual void initProcessingChain();
+
+   /** @brief Hidden from use copy constructor. */
+   ossimHillshadeTool( const ossimHillshadeTool& obj );
+
+   /** @brief Hidden from use assignment operator. */
+   const ossimHillshadeTool& operator=( const ossimHillshadeTool& rhs );
+};
+
+#endif /* #ifndef ossimHillshadeUtil_HEADER */
diff --git a/include/ossim/util/ossimHlzTool.h b/include/ossim/util/ossimHlzTool.h
new file mode 100644
index 0000000..7f4850a
--- /dev/null
+++ b/include/ossim/util/ossimHlzTool.h
@@ -0,0 +1,141 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimHLZUtil_HEADER
+#define ossimHLZUtil_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimLeastSquaresPlane.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/parallel/ossimJob.h>
+#include <ossim/parallel/ossimJobMultiThreadQueue.h>
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+#include <ossim/util/ossimChipProcTool.h>
+#include <OpenThreads/ReadWriteMutex>
+#include <vector>
+
+/*!
+ *  Class for finding helicopter landing zones (HLZ) on a DEM given the final destination and max
+ *  range from destination.
+ */
+class OSSIMDLLEXPORT ossimHlzTool : public ossimChipProcTool
+{
+public:
+   ossimHlzTool();
+   ~ossimHlzTool();
+
+   virtual void setUsage(ossimArgumentParser& ap);
+   virtual bool initialize(ossimArgumentParser& ap);
+   virtual void initialize(const ossimKeywordlist& kwl);
+   virtual bool execute();
+   virtual ossimRefPtr<ossimImageData> getChip(const ossimIrect& img_rect);
+
+   virtual ossimString getClassName() const { return "ossimHlzUtil"; }
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+protected:
+   class MaskSource
+   {
+   public:
+      MaskSource(ossimHlzTool* hlzUtil, const ossimFilename& mask_image, bool exclude);
+      ossimRefPtr<ossimSingleImageChain> image;
+      bool exclude;
+   };
+
+   virtual void initProcessingChain();
+
+   /** @brief Hidden from use copy constructor. */
+   ossimHlzTool( const ossimHlzTool& obj );
+
+   /** @brief Hidden from use assignment operator. */
+   const ossimHlzTool& operator=( const ossimHlzTool& rhs );
+
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
+   void addArguments(ossimArgumentParser& ap);
+   void loadPcFiles(); // throws exception
+   void loadMaskFiles(); // throws exception
+   void writeSlopeImage();
+   void setProductGSD(const double& meters_per_pixel);
+   bool computeHLZ();
+
+   double m_slopeThreshold; // (degrees)
+   double m_roughnessThreshold; // peak deviation from plane (meters)
+   double m_hlzMinRadius; // meters
+   ossimFilename m_slopeFile; // optional byproduct output
+   ossimIpt m_demFilterSize;
+   ossimRefPtr<ossimImageData> m_demBuffer;
+   ossimRefPtr<ossimImageData> m_outBuffer;
+   ossimRefPtr<ossimMemoryImageSource> m_memSource;
+   ossim_uint8 m_badLzValue;
+   ossim_uint8 m_marginalLzValue;
+   ossim_uint8 m_goodLzValue;
+   bool m_useLsFitMethod;
+   ossimRefPtr<ossimImageSource> m_combinedElevSource;
+   std::vector< ossimRefPtr<ossimPointCloudHandler> > m_pcSources;
+   std::vector<MaskSource> m_maskSources;
+
+   // For debugging:
+   ossim_uint32 m_numThreads;
+   double d_accumT;
+
+   class PatchProcessorJob : public ossimJob
+   {
+   public:
+      PatchProcessorJob(ossimHlzTool* hlzUtil, const ossimIpt& origin, ossim_uint32 chip_id=0);
+
+      virtual void start();
+      virtual bool level1Test() = 0;
+      bool level2Test();
+      bool maskTest();
+
+      ossimHlzTool* m_hlzUtil;
+      ossimIpt m_demPatchUL;
+      ossimIpt m_demPatchLR;
+      ossim_uint8 m_status;
+      float m_nullValue;
+
+      // ossim_uint32 m_chipId; // for debug
+      static OpenThreads::ReadWriteMutex m_bufMutex;
+   };
+
+   class LsFitPatchProcessorJob : public PatchProcessorJob
+   {
+   public:
+      LsFitPatchProcessorJob(ossimHlzTool* hlzUtil, const ossimIpt& origin, ossim_uint32 chip_id=0)
+         : PatchProcessorJob(hlzUtil, origin, chip_id),
+           m_plane (new ossimLeastSquaresPlane) {}
+
+      ~LsFitPatchProcessorJob() { delete m_plane; }
+      virtual bool level1Test();
+      ossimLeastSquaresPlane* m_plane;
+   };
+
+   class NormPatchProcessorJob : public PatchProcessorJob
+   {
+   public:
+      NormPatchProcessorJob(ossimHlzTool* hlzUtil, const ossimIpt& origin, ossim_uint32 chip_id=0)
+         : PatchProcessorJob(hlzUtil, origin, chip_id) {}
+
+      virtual bool level1Test();
+   };
+
+};
+
+#endif
diff --git a/include/ossim/util/ossimImageUtil.h b/include/ossim/util/ossimImageUtil.h
new file mode 100644
index 0000000..86364d1
--- /dev/null
+++ b/include/ossim/util/ossimImageUtil.h
@@ -0,0 +1,510 @@
+//----------------------------------------------------------------------------
+// File: ossimImageUtil.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ossimImageUtil
+//
+// See class descriptions below for more.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimImageUtil_HEADER
+#define ossimImageUtil_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFileProcessorInterface.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimOverviewBuilderBase.h>
+#include <OpenThreads/Mutex>
+#include <ostream>
+#include <vector>
+
+class ossimArgumentParser;
+class ossimFileWalker;
+class ossimGpt;
+class ossimPropertyInterface;
+class ossimApplicationUsage;
+/**
+ * @brief ossimImageUtil class.
+ *
+ * Utility class for processing image recursively.  This is for doing things like:
+ * 
+ * building overview, histograms, compute min/max, extract vertices.
+ */
+class OSSIM_DLL ossimImageUtil :
+   public ossimReferenced, public ossimFileProcessorInterface
+{
+public:
+
+   /** default constructor */
+   ossimImageUtil();
+
+   /** virtual destructor */
+   virtual ~ossimImageUtil();
+
+   void addOptions(ossimApplicationUsage* au);
+   /**
+    * @brief Adds application arguments to the argument parser.
+    * @param ap Parser to add to.
+    */
+   void addArguments(ossimArgumentParser& ap);
+
+   /**
+    * @brief Initial method.
+    *
+    * Typically called from application prior to execute.  This parses
+    * all options and put in keyword list m_kwl.
+    * 
+    * @param ap Arg parser to initialize from.
+    *
+    * @return true, indicating process should continue with execute.
+    */
+   bool initialize(ossimArgumentParser& ap);
+
+   /**
+    * @brief Execute method.
+    *
+    * This launches file walking mechanism.
+    *
+    * @return int, 0 = good, non-zero something happened.  Because this can
+    * process multiple files a non-zero return may indicate just one file
+    * did not complete, e.g. building overviews.
+    * 
+    * @note Throws ossimException on error.
+    */
+   ossim_int32 execute();
+
+   /**
+    * @brief ProcessFile method.
+    *
+    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
+    *
+    * This method is linked to the ossimFileWalker::walk method via a callback
+    * mechanism.  It is called by the ossimFileWalk (caller).  In turn this
+    * class (callee) calls ossimFileWalker::setRecurseFlag and
+    * ossimFileWalker::setAbortFlag to control the waking process.
+    * 
+    * @param file to process.
+    */
+   virtual void processFile(const ossimFilename& file);
+
+   /**
+    * @brief Sets create overviews flag keyword CREATE_OVERVIEWS_KW used by
+    * processFile method.
+    *
+    * @param flag If true overview will be created if image does not already
+    * have the required or if the REBUILD_OVERVIEWS_KW is set.
+    *
+    * @note Number of required overviews is controlled by the ossim preferences
+    * keyword overview_stop_dimension.
+    */
+   void setCreateOverviewsFlag( bool flag );
+
+   /** @return true if CREATE_OVERVIEWS_KW is found and set to true. */
+   bool createOverviews() const;
+   
+   /**
+    * @brief Sets the rebuild overview flag keyword REBUILD_OVERVIEWS_KW used by
+    * processFile method.
+    *
+    * @param flag If true forces a rebuild of overviews even if image has
+    * required number of reduced resolution data sets.
+    *
+    * @note Number of required overviews is controlled by the ossim preferences
+    * keyword overview_stop_dimension.
+    */
+   void setRebuildOverviewsFlag( bool flag );
+
+   /** @return true if REBUILD_OVERVIEWS_KW is found and set to true. */
+   bool rebuildOverviews() const;
+
+   /**
+    * @brief Sets the rebuild histogram flag keyword REBUILD_HISTOGRAM_KW used by
+    * processFile method.
+    *
+    * @param flag If true forces a rebuild of histogram even if image has one already.
+    */
+   void setRebuildHistogramFlag( bool flag );
+
+   /** @return true if REBUILD_HISTOGRAM_KW is found and set to true. */
+   bool rebuildHistogram() const;
+
+   /**
+    * @brief Sets key OVERVIEW_TYPE_KW.
+    *
+    * Available types depens on plugins.  Know types:
+    * ossim_tiff_box ( defualt )
+    * ossim_tiff_nearest
+    * ossim_kakadu_nitf_j2k ( kakadu plugin )
+    * gdal_tiff_nearest	    ( gdal plugin )
+    * gdal_tiff_average	    ( gdal plugin )
+    * gdal_hfa_nearest      ( gdal plugin )	
+    * gdal_hfa_average      ( gdal plugin )	
+    * 
+    * @param type One of the above.
+    */
+   void setOverviewType( const std::string& type );
+   
+   /**
+    * @brief sets the overview stop dimension.
+    *
+    * The overview builder will decimate the image until both dimensions are
+    * at or below this dimension.
+    *
+    * @param dimension
+    *
+    * @note Recommend a power of 2 value, i.e. 8, 16, 32 and so on.
+    */
+   void setOverviewStopDimension( ossim_uint32 dimension );
+   void setOverviewStopDimension( const std::string& dimension );
+
+   /**
+    * @brief Sets the tile size.
+    *
+    * @param tileSize
+    *
+    * @note Must be a multiple of 16, i.e. 64, 128, 256 and so on.
+    */
+   void setTileSize( ossim_uint32 tileSize );
+
+   /**
+    * @brief Gets the tile size.
+    * @param tileSize Initialized by this.
+    * @return true on success, false if not in options list.
+    */
+   bool getTileSize( ossimIpt& tileSize ) const;
+
+   /**
+    * @return Overview stop dimension or 0 if OVERVIEW_STOP_DIM_KW is not
+    * found.
+    */
+   ossim_uint32 getOverviewStopDimension() const;
+
+   /**
+    * @brief Sets create histogram flag keyword CREATE_HISTOGRAM_KW used by
+    * processFile method.
+    *
+    * @param flag If true a full histogram will be created.
+    */
+   void setCreateHistogramFlag( bool flag );
+   
+   /** @return true if CREATE_HISTOGRAM_KW is found and set to true. */
+   bool createHistogram() const;
+
+   /**
+    * @brief Sets create histogram flag keyword CREATE_HISTOGRAM_FAST_KW used by
+    * processFile method.
+    *
+    * @param flag If true a histogram will be created in fast mode.
+    */
+   void setCreateHistogramFastFlag( bool flag );
+
+   /** @return true if CREATE_HISTOGRAM_FAST_KW is found and set to true. */
+   bool createHistogramFast() const;
+
+   /**
+    * @brief Sets create histogram "R0" flag keyword CREATE_HISTOGRAM_R0_KW used by
+    * processFile method.
+    *
+    * @param flag If true a histogram will be created from R0.
+    */
+   void setCreateHistogramR0Flag( bool flag );
+
+   /** @return true if CREATE_HISTOGRAM_R0_KW is found and set to true. */
+   bool createHistogramR0() const;
+
+   /** @return true if any of the histogram options are set. */
+   bool hasHistogramOption() const;
+
+   /** @return Histogram mode or OSSIM_HISTO_MODE_UNKNOWN if not set. */
+   ossimHistogramMode getHistogramMode() const;
+
+   /**
+    * @brief Sets scan for min/max flag keyword SCAN_MIN_MAX_KW used by
+    * processFile method.
+    *
+    * @param flag If true a file will be scanned for min/max and a file.omd
+    * will be written out.
+    */
+   void setScanForMinMax( bool flag );
+   
+   /** @return true if SCAN_MIN_MAX_KW is found and set to true. */
+   bool scanForMinMax() const;
+
+   /**
+    * @brief Sets scan for min/max/null flag keyword SCAN_MIN_MAX_KW used by
+    * processFile method.
+    *
+    * @param flag If true a file will be scanned for min/max/null and a file.omd
+    * will be written out.
+    */
+   void setScanForMinMaxNull( bool flag );
+
+   /** @return true if SCAN_MIN_MAX_NULL_KW is found and set to true. */
+   bool scanForMinMaxNull() const;
+
+   /**
+    * @brief Sets the writer property for compression quality.
+    *
+    * @param quality For TIFF JPEG takes values from 1
+    * to 100, where 100 is best.  For J2K plugin (if available),
+    * numerically_lossless, visually_lossless, lossy.
+    */
+   void setCompressionQuality( const std::string& quality );
+
+   /**
+    * @brief Sets the compression type to use when building overviews.
+    *  
+    * @param compression_type Current supported types:
+    * - deflate 
+    * - jpeg
+    * - lzw
+    * - none
+    * - packbits
+    */
+   void setCompressionType( const std::string& type );
+
+   /**
+    * @brief Sets the overview builder copy all flag.
+    * @param flag
+    */
+   void setCopyAllFlag( bool flag );
+
+   /**
+    * @return true if COPY_ALL_FLAG_KW key is found and value is true; else,
+    * false.
+    */
+   bool getCopyAllFlag() const;
+
+   /**
+    * @brief Sets the dump filteredImageList flag.
+    * @param flag
+    */
+   void setDumpFilteredImageListFlag( bool flag );
+
+   /**
+    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
+    * false.
+    * 
+    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
+    */
+   bool getDumpFilterImagesFlag() const;
+
+   /**
+    * @brief Sets the overview builder internal overviews flag.
+    * @param flag
+    */
+   void setInternalOverviewsFlag( bool flag );
+
+   /**
+    * @return true if INTERNAL_OVERVIEWS_FLAG_KW key is found and value is true; else,
+    * false.
+    */
+   bool getInternalOverviewsFlag() const;
+   
+   /**
+    * @brief Sets the output directory.  Typically overviews and histograms
+    * are placed parallel to image file.  This overrides.
+    *  
+    * @param directory
+    */
+   void setOutputDirectory( const std::string& directory );
+ 
+   /**
+    * @brief Sets the output file name flag OUTPUT_FILENAMES_KW.
+    *
+    * If set to true all files that we can successfully open will be output.
+    *  
+    * @param flag
+    */
+   void setOutputFileNamesFlag( bool flag );
+
+   /**
+    * @return true if OUTPUT_FILENAMES_KW key is found and value is true; else,
+    * false.
+    */
+   bool getOutputFileNamesFlag() const;
+
+   /**
+    * @brief Sets the override filtered images flag.
+    * @param flag
+    */
+   void setOverrideFilteredImagesFlag( bool flag );
+
+   /**
+    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
+    * false.
+    * 
+    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
+    */
+   bool getOverrideFilteredImagesFlag() const;
+   
+   /**
+    * @brief Set number of threads to use.
+    *
+    * This is only used in execute method if a directory is given to
+    * application to walk.
+    *
+    * @param threads Defaults to 1 if THREADS_KW is not found.
+    */
+   void setNumberOfThreads( ossim_uint32 threads );
+   void setNumberOfThreads( const std::string& threads );
+
+   /** @return The list of filtered out files. */
+   const std::vector<std::string>& getFilteredImages() const;
+
+   /**
+    * @brief Non const method to allow access for
+    * adding or deleting extensions from the list.
+    *
+    * The list is used by the private isFiltered method to avoid trying to
+    * process unwanted files.
+    */
+   std::vector<std::string>& getFilteredImages();
+
+private:
+
+   /** @return true if key is set to true; false, if not. */
+   bool keyIsTrue( const std::string& key ) const;
+
+   /**
+    * @brief Convenience method to check file to see is if file should be
+    * processed.
+    *
+    * @param f File to check.
+    * 
+    * @return true if f is in filter list, false if not.
+    */
+   bool isFiltered(const ossimFilename& f) const;
+   
+   /**
+    * @brief Initializes the filter list with a default set of filtered out
+    * file names.
+    */
+   void initializeDefaultFilterList();
+
+   /** @brief Dumps filtered image list to std out. */
+   void dumpFilteredImageList() const;
+
+   void createOverview(ossimRefPtr<ossimImageHandler>& ih,
+                       bool& consumedHistogramOptions,
+                       bool& consumedCmmOptions);
+
+   void createOverview(ossimRefPtr<ossimImageHandler>& ih,
+                       ossimRefPtr<ossimOverviewBuilderBase>& ob,
+                       ossim_uint32 entry,
+                       bool useEntryIndex,
+                       bool& consumedHistogramOptions);
+
+   /** @return true if entry has required overviews. */
+   bool hasRequiredOverview( ossimRefPtr<ossimImageHandler>& ih,
+                             ossimRefPtr<ossimOverviewBuilderBase>& ob );
+
+   /** @return true if any compute min, max or null options are set. */
+   bool hasCmmOption() const;
+
+   void createHistogram(ossimRefPtr<ossimImageHandler>& ih);
+
+   void createHistogram(ossimRefPtr<ossimImageHandler>& ih,
+                       ossim_uint32 entry,
+                       bool useEntryIndex);
+
+   void computeMinMax(ossimRefPtr<ossimImageHandler>& ih);
+
+   void computeMinMax(ossimRefPtr<ossimImageHandler>& ih,
+                      ossim_uint32 entry,
+                      bool useEntryIndex);
+   
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
+
+   void outputOverviewWriterTypes() const;
+
+   /**
+    * @return true if file is a directory based image and the stager should go
+    * on to next directory; false if stager should continue with directory.
+    */
+   bool isDirectoryBasedImage(const ossimImageHandler* ih) const;
+
+   /**
+    * @brief Initializes type from OVERVIEW_TYPE_KW or sets to default
+    * ossim_tiff_box if not found.
+    */
+   void getOverviewType(std::string& type) const;
+
+   /** @brief set reader or writer properties based on cast of pi. */
+   void setProps(ossimPropertyInterface* pi) const;
+   
+   /**
+    * @return Threads to use.  Defaults to 1 if THREADS_KW is not found.
+    */
+   ossim_uint32 getNumberOfThreads() const;
+
+   /** @return the next writer prop index. */
+   ossim_uint32 getNextWriterPropIndex() const;
+
+   /** @return the next reader prop index. */   
+   ossim_uint32 getNextReaderPropIndex() const;
+
+   /**
+    * @brief Adds option to m_kwl with mutex lock.
+    * @param key
+    * @param value
+    */
+   void addOption( const std::string& key, ossim_uint32 value );
+   void addOption( const std::string& key, const std::string& value );
+
+   /**
+    * @brief Sets the m_errorStatus for return on execute.
+    */
+   void setErrorStatus( ossim_int32 status );
+
+   /** @brief run prep system commands. */
+   void executePrepCommands() const;
+
+   /** @brief run per file system commands. */
+   void executeFileCommands( const ossimFilename& file ) const;
+
+   /** @brief run post system commands. */
+   void executePostCommands() const;
+
+   /** @brief system commands. */
+   void executeCommands( const std::string& prefix,
+                         const ossimFilename& file ) const;
+
+    /** @brief Expands variables in a command string. */
+   void substituteCommandString( const ossimFilename& file,
+                                 const std::string& prefix,
+                                 const std::string& commandKey,
+                                 ossimString& command ) const;
+
+   /** @brief Expands file level variables in a command string. */
+   void substituteFileStrings( const ossimFilename& file,
+                               ossimString& command ) const;
+
+    /** @brief Expands date variables in a command string. */
+   void gsubDate( const std::string& commandPrefix,
+                  ossimString& command ) const;
+   
+   /** Holds all options passed into intialize except writer props. */
+   ossimRefPtr<ossimKeywordlist> m_kwl;
+
+   ossimFileWalker*   m_fileWalker;
+   OpenThreads::Mutex m_mutex;
+
+   ossim_int32 m_errorStatus;
+
+   /** Hold images we never want to process. */
+   std::vector<std::string> m_filteredImages; 
+};
+
+#endif /* #ifndef ossimImageUtil_HEADER */
diff --git a/include/ossim/util/ossimInfo.h b/include/ossim/util/ossimInfo.h
new file mode 100644
index 0000000..9dda4d1
--- /dev/null
+++ b/include/ossim/util/ossimInfo.h
@@ -0,0 +1,791 @@
+//---
+// File: ossimInfo.h
+// 
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description: ossimInfo class declaration
+//
+// See class doxygen descriptions below for more.
+// 
+//---
+// $Id$
+
+#ifndef ossimInfo_HEADER
+#define ossimInfo_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/util/ossimTool.h>
+#include <ostream>
+
+class ossimGpt;
+
+/**
+ * @brief ossimInfo class.
+ *
+ * This is a utility class for getting information from the ossim library.
+ * This includes information from an image, general library queries, like
+ * loaded plugins, and just general stuff like height for point, conversions
+ * and so on that are easily obtained through the library.
+ */
+class OSSIM_DLL ossimInfo : public ossimTool
+{
+public:
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+   /** default constructor */
+   ossimInfo();
+
+   /** virtual destructor */
+   virtual ~ossimInfo();
+
+   /**
+    * @brief Adds application arguments to the argument parser.
+    * @param ap Parser to add to.
+    */
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   /**
+    * @brief Initial method.
+    *
+    * Typically called from application prior to execute.  This parses
+    * all options and put in keyword list m_kwl.
+    * 
+    * @param ap Arg parser to initialize from.
+    *
+    * @return true, indicating process should continue with execute.
+    */
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   /**
+    * @brief execute method.
+    *
+    * Performs the actual dump of information.  This executes any options
+    * set including image operations, i.e. -i -p --dno and so on.
+    * 
+    * @note Throws ossimException on error.
+    */
+   virtual bool execute();
+
+   virtual ossimString getClassName() const { return "ossimInfo"; }
+
+   /**
+    * @brief handles image options.
+    *
+    * Handles image type info opions,  i.e. -i -p --dno and so on.
+    *
+    * @return Number of consumed options.
+    */
+   ossim_uint32 executeImageOptions(const ossimFilename& file);
+
+   /**
+    * @brief getImageInfo Method to open image "file" and get image info
+    * in the form of a ossimKeywordlist.
+    *
+    * Flags turn on various pieces of info.  These equate to options in
+    * ossim-info for image information.
+    *
+    * @param file Image file to get information for.
+    * @param dumpFlag      ossim-info -d
+    * @param dnoFlag       ossim-info --dno
+    * @param imageGeomFlag ossim-info -p
+    * @param imageInfoFlag ossim-info -i 
+    * @param metaDataFlag  ossim-info -m 
+    * @param paletteFlag   ossim-info --palette
+    * @param kwl Initialized by this method.
+    */
+   void getImageInfo( const ossimFilename& file,
+                      bool dumpFlag,
+                      bool dnoFlag,
+                      bool imageGeomFlag,
+                      bool imageInfoFlag,
+                      bool metaDataFlag,
+                      bool paletteFlag,
+                      ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief getImageInfo Method to open image "file" and get image info
+    * for entry in the form of a ossimKeywordlist.
+    *
+    * Equivalent of ossim-info -i -p <image> for entry. 
+    *
+    * Throws ossimException on error if file cannot be opened or entry is
+    * invalid.
+    *
+    * @param file Image file to get information for.
+    * @param entry Entry index to open.
+    * @return true on success, false on error.
+    */
+   bool getImageInfo( const ossimFilename& file,
+                      ossim_uint32 entry,
+                      ossimKeywordlist& kwl ) const;
+   
+   /**
+    * @brief Opens image handler and stores in m_img data member.
+    * @param Image to open.
+    * @note Throws ossimException if image cannot be opened.
+    */
+   void openImage(const ossimFilename& file);
+
+   /** @brief Closes image if open. */
+   void closeImage();
+
+   /**
+    * @return Ref pointer to the image handler.  Can be null if an image is
+    * not open.
+    */
+   ossimRefPtr<ossimImageHandler> getImageHandler();
+
+   /** @brief Dumps the image information from ossimInfoFactoryRegistry */
+   void prettyPrint(const ossimFilename& file) const;
+
+   /**
+    * @brief Dumps the image information from ossimInfoFactoryRegistry to
+    * keyword list.
+    * @param file Image to dump.
+    * @param dnoFlag Dump no overviews. If true do not dump overviews.
+    * @param kwl Initialized by this method.
+    */
+   void dumpImage(const ossimFilename& file,
+                  bool dnoFlag,
+                  ossimKeywordlist& kwl) const;
+
+   /**
+    * @brief Prints factories.
+    * @param keywordListFlag If true the result of a saveState will be output
+    * for each factory.
+    * */
+   void printFactories(bool keywordListFlag) const;
+
+   /**
+    * @brief Populates keyword list with metadata.
+    * This requires open image.
+    *
+    * @param kwl Keyword list to populate.
+    */
+   void getImageMetadata(ossimKeywordlist& kwl) const;
+
+   /**
+    * @brief Populates keyword list with palette data.
+    * This requires open image.
+    *
+    * @param kwl Keyword list to populate.
+    */
+   void getImagePalette(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with general image information.
+    *
+    * This requires open image.
+    *
+    * @param kwl Keyword list to populate.
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    */
+   void getImageInfo(ossimKeywordlist& kwl, bool dnoFlag);
+
+   /**
+    * @brief Populates keyword list with general image information.
+    *
+    * @param entry Entry number to select.  Note this is the entry number from
+    * the getEntryList call not a simple zero based entry index.
+    * 
+    * @param kwl Keyword list to populate.
+    *
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    *
+    * This requires open image.
+    *
+    * @return true if entry info was saved to keyword list false if not.
+    */
+   bool getImageInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag);
+
+   /**
+    * @brief Populates keyword list with image geometry/projection information.
+    *
+    * This requires open image.
+    *
+    * @param kwl Keyword list to populate.
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    */
+   void getImageGeometryInfo(ossimKeywordlist& kwl, bool dnoFlag);
+
+   /**
+    * @brief Populates keyword list with image geometry/projection information.
+    *
+    * @param entry Entry number to select.  Note this is the entry number
+    * from the getEntryList call not a simple zero based entry index.
+    * 
+    * @param kwl Keyword list to populate.
+    *
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    *
+    * This requires open image.
+    *
+    * @return true if entry info was saved to keyword list false if not.
+    */
+   bool getImageGeometryInfo( ossim_uint32 entry, 
+                              ossimKeywordlist& kwl, 
+                              bool dnoFlag );
+
+   /**
+    * @brief Populates keyword list with image center point..
+    * @param kwl Keyword list to populate.
+    */
+   void getCenterImage(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with edge to edge image bounds.
+    * @param kwl Keyword list to populate.
+    */  
+   void getImageBounds(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with image center ground point..
+    * @param kwl Keyword list to populate.
+    */  
+   void getCenterGround(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with ground point for image point.
+    *
+    * Associated input key values: "img2grd: <x> <y>"
+    * Output key: image0.ground_point:  (lat,lon,hgt,datum)
+    * 
+    * @param kwl Keyword list to populate.
+    */
+   void getImg2grd(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with image point for grund point.
+    *
+    * Associated input key values: "grd2img: (lat,lon,hgt,datum)"
+    * Output key: image0.image_point:  (x, y)
+    * 
+    * @param kwl Keyword list to populate.
+    */
+   void getGrd2img(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with up_is_up_angle.
+    *
+    * @param kwl Keyword list to populate.
+    *
+    * This requires open image.
+    */
+   void getUpIsUpAngle(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with up_is_up_angle.
+    *
+    * @param entry Entry number to select.  Note this is the entry number
+    * from the getEntryList call not a simple zero based entry index.
+    * 
+    * @param kwl Keyword list to populate.
+    *
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    *
+    * This requires open image.
+    */
+   void getUpIsUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with image_to_ground. It will outoput image_point and ground_point
+    *
+    * @param kwl Keyword list to populate.
+    *
+    * This requires open image.
+    */
+   void getImageToGround(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with image_to_ground. It will outoput image_point and ground_point
+    *
+    * @param entry Entry number to select.  Note this is the entry number
+    * from the getEntryList call not a simple zero based entry index.
+    * 
+    * @param kwl Keyword list to populate.
+    *
+    * This requires open image.
+    */
+   void getImageToGround(ossim_uint32 entry, ossimKeywordlist& kwl);
+   
+   /**
+    * @brief Populates keyword list with north_up_angle.
+    *
+    * @param kwl Keyword list to populate.
+    *
+    * This requires open image.
+    */
+   void getNorthUpAngle(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with north_up_angle.
+    *
+    * @param entry Entry number to select.  Note this is the entry number
+    * from the getEntryList call not a simple zero based entry index.
+    * 
+    * @param kwl Keyword list to populate.
+    *
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    *
+    * This requires open image.
+    */
+   void getNorthUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl);
+   
+   /**
+    * @brief Populates keyword list with image rectangle.
+    *
+    * This requires open image.
+    *
+    * @param kwl Keyword list to populate.
+    */
+   void getImageRect(ossimKeywordlist& kwl);
+
+   /**
+    * @brief Populates keyword list with image rectangle.
+    *
+    * @param entry Entry number to select.  Note this is the entry number from
+    * the getEntryList call not a simple zero based entry index.
+    * 
+    * @param kwl Keyword list to populate.
+    *
+    * This requires open image.
+    */
+   void getImageRect(ossim_uint32 entry, ossimKeywordlist& kwl);
+
+   /**
+    * @return true if current open image entry is an overview.
+    */
+   bool isImageEntryOverview() const;
+
+   /** @brief Dumps ossim preferences/configuration data. */
+   void printConfiguration() const;
+
+   /**
+    * @brief Dumps ossim preferences/configuration data.
+    * @param out Output to write to.
+    * @return stream
+    */
+   std::ostream& printConfiguration(std::ostream& out) const;
+
+   /** @brief Dumps datum list to stdout. */
+   void printDatums() const;
+
+   /** @brief Dumps datum list to stream. */
+   std::ostream& printDatums(std::ostream& out) const;
+
+   /** @brief Prints fonts list to stdout. */
+   void printFonts() const;
+
+   /** @brief Prints fonts list to stream. */
+   std::ostream& printFonts(std::ostream& out) const;
+
+   /** @brief Converts degrees to radians and outputs to stdout. */
+   void deg2rad(const ossim_float64& degrees) const;
+
+   /**
+    * @brief Converts degrees to radians and outputs to stream.
+    * @param out Output to write to.
+    * @return stream
+    */
+   std::ostream& deg2rad(const ossim_float64& degrees, std::ostream& out) const;
+   
+   /**
+    * @brief Converts ecef point to lat lon height.
+    * @param out Output to write to.
+    * @return stream
+    */
+   std::ostream& ecef2llh(const ossimEcefPoint& ecefPoint, std::ostream& out) const;
+
+   /** @brief Converts radians to degrees and outputs to stdout. */
+   void rad2deg(const ossim_float64& radians) const;
+
+   /**
+    * @brief Converts radians to degrees and outputs to stream. 
+    * @param out Output to write to.
+    * @return stream
+    */
+   std::ostream& rad2deg(const ossim_float64& radians, std::ostream& out) const;
+
+   /** @brief Converts feet to meters and outputs to stdout. */
+   void ft2mtrs(const ossim_float64& feet, bool us_survey) const;
+
+   /**
+    * @brief Converts feet to meters and outputs to stream.
+    * @param out Output to write to out.
+    * @return stream
+    */
+   std::ostream& ft2mtrs(const ossim_float64& feet, bool us_survey, std::ostream& out) const;
+
+   /** @brief Converts meters to feet and outputs to stdout. */
+   void mtrs2ft(const ossim_float64& meters, bool us_survey) const;
+
+   /**
+    * @brief Converts meters to feet and outputs to stream.
+    * @param out Output to write to out.
+    * @return stream
+    */   
+   std::ostream& mtrs2ft(const ossim_float64& meters, bool us_survey, std::ostream& out) const;
+
+   /**
+    * @brief Get meters per degree for a given latitude and outputs to stdout.
+    * @param latitude
+    */
+   void mtrsPerDeg(const ossim_float64& latitude) const;
+
+   /**
+    * @brief Get meters per degree for a given latitude and outputs to stream.
+    * @param latitude
+    * @param out Output to write to out.
+    * @return stream
+    */   
+   std::ostream& mtrsPerDeg(const ossim_float64& latitude, std::ostream& out) const;
+
+   /**
+    * @brief Gets the height for ground point (latitude, longitude). Outputs
+    * to stdout.
+    * @param gpt Ground point.
+    */
+   void outputHeight(const ossimGpt& gpt) const;
+
+   /**
+    * @brief Gets the height for ground point (latitude, longitude). Outputs
+    * to out.
+    * @param out Output to write to out.
+    * @return stream
+    */
+   std::ostream& outputHeight(const ossimGpt& gpt, std::ostream& out) const;
+
+   /** @brief Prints loaded plugins to stdout. */
+   void printPlugins() const;
+
+   /**
+    * @brief Prints loaded plugins to stream.
+    * @param out Output to write to out.
+    * @return stream
+    */
+   std::ostream& printPlugins(std::ostream& out) const;
+
+   /**
+    * @brief Test a plugin load  and outputs to stdout.
+    * 
+    * @param plugin Plugin to test.
+    */
+   void testPlugin(const ossimFilename& plugin) const;
+
+   /**
+    * @brief Test a plugin load outputs to stream.
+    * 
+    * @param plugin Plugin to test.
+    * @param out Stream to write to.
+    * @param stream
+    */
+   std::ostream& testPlugin(const ossimFilename& plugin, std::ostream& out) const;
+
+   /** @brief Prints overview types to stdout. */
+   void printOverviewTypes() const;
+
+   /** @brief Prints overview types to stream. */
+   std::ostream& printOverviewTypes(std::ostream& out) const;
+
+   /** @breif Prints projections to stdout. */
+   void printProjections() const;
+
+   /** @breif Prints projections to stream. */
+   std::ostream& printProjections(std::ostream& out) const;
+
+   /** @brief Prints reader properties to stdout. */
+   void printReaderProps() const;
+
+   /** @brief Prints reader properties to stream. */
+   std::ostream& printReaderProps(std::ostream& out) const;
+
+   /** @brief Prints resampler filters to stdout. */
+   void printResamplerFilters() const;
+
+   /** @brief Prints resampler filters to stream. */
+   std::ostream& printResamplerFilters(std::ostream& out) const;
+
+   /** @brief Prints list of available writers to stdout. */
+   void printWriters() const;
+
+   /** @brief Prints list of available writers to stream. */
+   std::ostream& printWriters(std::ostream& out) const;
+
+   /** @brief Prints writer properties to stdout. */
+   void printWriterProps() const;
+
+   /** @brief Prints writer properties to stream. */
+   std::ostream& printWriterProps(std::ostream& out) const;
+
+   /** @brief Prints zoom levels to stdout. */
+   void printZoomLevelGsds() const;
+
+   /** @brief Prints zoom levels to stream. */
+   std::ostream& printZoomLevelGsds(std::ostream& out) const;
+
+   /**
+    * @brief Gets the radiometry string, i.e. "8-bit" and so on, from scalar.
+    * @param scalar Scalar type.
+    * @param s String to initialize.
+    */
+   void getRadiometry(ossimScalarType scalar, std::string& s) const;
+
+   /**
+    * @brief Gets build date.
+    * @param s String to initialize.
+    */
+   void getBuildDate(std::string& s) const;
+
+   /**
+    * @brief Gets revision number.
+    * @param s String to initialize.
+    */
+   void getRevisionNumber(std::string& s) const;
+
+   /**
+    * @brief Gets version.
+    * @param s String to initialize.
+    */
+   void getVersion(std::string& s) const;
+
+private:
+
+   /**
+    * @brief Populates keyword list with metadata.
+    * @param ih Pointer to an image handler.
+    * @param kwl Keyword list to populate.
+    */
+   void getImageMetadata( const ossimImageHandler* ih, 
+                          ossimKeywordlist& kwl ) const;
+ 
+  /**
+   * @brief Populates keyword list with palette data.
+   * @param ih Pointer to an image handler.
+   * @param kwl Keyword list to populate.
+   */
+   void getImagePalette( ossimImageHandler* ih, 
+                         ossimKeywordlist& kwl ) const;
+  
+   /**
+    * @brief Populates keyword list with general image information.
+    * @param ih Pointer to an image handler.
+    * @param kwl Keyword list to populate.
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    */
+   void getImageInfo( ossimImageHandler* ih, 
+                      ossimKeywordlist& kwl, 
+                      bool dnoFlag ) const;
+
+   /**
+    * @brief Populates keyword list with general image information.
+    * @param ih Pointer to an image handler.
+    * @param entry Entry number to select.  Note this is the entry number from
+    * the getEntryList call not a simple zero based entry index.
+    * @param kwl Keyword list to populate.
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    * @return true if entry info was saved to keyword list false if not.
+    */
+   bool getImageInfo( ossimImageHandler* ih, 
+                      ossim_uint32 entry, 
+                      ossimKeywordlist& kwl, 
+                      bool dnoFlag ) const;
+   
+   /**
+    * @brief Populates keyword list with image geometry/projection information.
+    * @param ih Pointer to an image handler.
+    * @param kwl Keyword list to populate.
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    */
+   void getImageGeometryInfo( ossimImageHandler* ih,
+                              ossimKeywordlist& kwl, 
+                              bool dnoFlag ) const;
+
+   /**
+    * @brief Populates keyword list with image geometry/projection information.
+    * @param ih Pointer to an image handler.
+    * @param entry Entry number to select.  Note this is the entry number
+    * from the getEntryList call not a simple zero based entry index.
+    * @param kwl Keyword list to populate.
+    * @param dnoFlag If true no entries flaged as overviews will be output.
+    * @return true if entry info was saved to keyword list false if not.
+    */
+   bool getImageGeometryInfo( ossimImageHandler* ih,
+                              ossim_uint32 entry, 
+                              ossimKeywordlist& kwl, 
+                              bool dnoFlag ) const;
+
+   void getCenterImage( ossimImageHandler* ih,
+                        ossimKeywordlist& kwl ) const;
+   void getCenterImage( ossimImageHandler* ih,
+                        ossim_uint32 entry, 
+                        ossimKeywordlist& kwl ) const;
+
+   void getImageBounds( ossimImageHandler* ih,
+                        ossimKeywordlist& kwl ) const;
+   void getImageBounds( ossimImageHandler* ih,
+                        ossim_uint32 entry, 
+                        ossimKeywordlist& kwl ) const;
+
+   void getCenterGround( ossimImageHandler* ih,
+                         ossimKeywordlist& kwl ) const;
+   void getCenterGround( ossimImageHandler* ih,
+                         ossim_uint32 entry, 
+                         ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Gets gound point from image point.
+    *
+    * Input key:value "img2grd: <x> <y>"
+    *
+    * @param Pointer to an image handler.
+    * @param kwl Keyword list to populate.
+    */
+   void getImg2grd( ossimImageHandler* ih,
+                    ossimKeywordlist& kwl ) const;
+   /**
+    * @brief Gets gound point from image point.
+    *
+    * Input key:value "img2grd: <x> <y>"
+    *
+    * @param Pointer to an image handler.
+    * @param entry Entry number to select. Note this is the entry number
+    * from the getEntryList call not a simple zero based entry index.
+    * @param kwl Keyword list to populate.
+    */
+   void getImg2grd( ossimImageHandler* ih,
+                    ossim_uint32 entry, 
+                    ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Gets gound point from image point.
+    *
+    * Input key:value "img2grd: <x> <y>"
+    *
+    * @param Pointer to an image handler.
+    * @param kwl Keyword list to populate.
+    */
+   void getGrd2img( ossimImageHandler* ih,
+                    ossimKeywordlist& kwl ) const;
+   /**
+    * @brief Gets gound point from image point.
+    *
+    * Input key:value "img2grd: <x> <y>"
+    *
+    * @param Pointer to an image handler.
+    * @param entry Entry number to select. Note this is the entry number
+    * from the getEntryList call not a simple zero based entry index.
+    * @param kwl Keyword list to populate.
+    */
+   void getGrd2img( ossimImageHandler* ih,
+                    ossim_uint32 entry, 
+                    ossimKeywordlist& kwl ) const;
+   
+   /**
+    * @brief Populates keyword list with up_is_up_angle.
+    * @param kwl Keyword list to populate.
+    */
+   void getUpIsUpAngle( ossimImageHandler* ih,
+                        ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Populates keyword list with up_is_up_angle.
+    * @param entry Entry number to select.  Note this is the entry number from
+    * the getEntryList call not a simple zero based entry index.
+    * @param kwl Keyword list to populate.
+    */  
+   void getUpIsUpAngle( ossimImageHandler* ih,
+                        ossim_uint32 entry, 
+                        ossimKeywordlist& kwl ) const;
+   
+  /**
+    * @brief Populates keyword list with north_up_angle.
+    * @param kwl Keyword list to populate.
+    */
+   void getNorthUpAngle( ossimImageHandler* ih,
+                         ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Populates keyword list with north_up_angle.
+    * @param entry Entry number to select.  Note this is the entry number from
+    * the getEntryList call not a simple zero based entry index.
+    * @param kwl Keyword list to populate.
+    */  
+   void getNorthUpAngle( ossimImageHandler* ih,
+                         ossim_uint32 entry, 
+                         ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Populates keyword list with image rectangle.
+    *
+    * @param kwl Keyword list to populate.
+    */
+   void getImageRect( ossimImageHandler* ih,
+                      ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Populates keyword list with image rectangle.
+    * @param entry Entry number to select.  Note this is the entry number from
+    * the getEntryList call not a simple zero based entry index.
+    * @param kwl Keyword list to populate.
+    */
+   void getImageRect( ossimImageHandler* ih,
+                      ossim_uint32 entry, 
+                      ossimKeywordlist& kwl ) const;
+
+   /**
+    * @brief Populates keyword list with rgb bands if available.
+    *
+    * This is image handler specific and within image handler specific to
+    * internal metadata, e.g. NITF IREPBAND keys.
+    *
+    * Example of key:value:
+    * rgb_bands:(2,1,0)
+    *
+    * @param ih Pointer to image handler.
+    * @param entry Current entry of image handler.
+    * @param kwl Keyword list to populate.
+    * @return true on success; false, on error.
+    */
+   bool getRgbBands( ossimImageHandler* ih,
+                     ossim_uint32 entry,
+                     ossimKeywordlist& kwl ) const;
+
+   /** @return true if current open image entry is an overview. */
+   bool isImageEntryOverview( const ossimImageHandler* ih ) const;
+
+   /**
+    * @brief Convert keyword list to xml then outputs to standard out.
+    * @param kwl Keyword list to output.
+    */
+   void outputXml( const ossimKeywordlist& kwl ) const;
+   
+   /**
+    * @brief Convert keyword list to xml then outputs to file.
+    * @param kwl Keyword list to output.
+    * @param file Output file to write to.
+    */
+   void outputXml( const ossimKeywordlist& kwl, const ossimFilename& file ) const;
+  
+  /**
+   * @brief Opens image.
+   * @param Image to open.
+   * @return ossimRefPtr with image handler.
+   * @note Throws ossimException if image cannot be opened.
+   */
+   ossimRefPtr<ossimImageHandler> openImageHandler(const ossimFilename& file) const;
+   
+   /** @return true if key is set to true; false, if not. */
+   bool keyIsTrue( const std::string& key ) const;
+
+   /** Holds the open image. */
+   ossimRefPtr<ossimImageHandler> m_img;
+};
+
+#endif /* #ifndef ossimInfo_HEADER */
diff --git a/include/ossim/util/ossimOrthoIgen.h b/include/ossim/util/ossimOrthoIgen.h
new file mode 100644
index 0000000..09be91d
--- /dev/null
+++ b/include/ossim/util/ossimOrthoIgen.h
@@ -0,0 +1,252 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Class declaration for ortho-image generator.
+//
+//*************************************************************************
+// $Id: ossimOrthoIgen.h 22813 2014-06-04 19:52:08Z okramer $
+
+#ifndef ossimOrthoIgen_HEADER
+#define ossimOrthoIgen_HEADER
+
+#include <ossim/parallel/ossimIgen.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimConnectableContainer.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimSrcRecord.h>
+#include <map>
+
+class ossimConnectableObject;
+class ossimMapProjection;
+class ossimImageSource;
+class ossimImageHandler;
+class ossimImageCombiner;
+
+class OSSIM_DLL ossimOrthoIgen : public ossimIgen
+{
+public:
+   enum ossimOrthoIgenProjectionType
+   {
+      OSSIM_UNKNOWN_PROJECTION = 0,
+      OSSIM_UTM_PROJECTION,
+      OSSIM_SRS_PROJECTION,
+      OSSIM_GEO_PROJECTION,
+      OSSIM_INPUT_PROJECTION,
+      OSSIM_EXTERNAL_PROJECTION
+   };
+   enum OriginType
+   {
+      OSSIM_CENTER_ORIGIN     = 0,
+      OSSIM_UPPER_LEFT_ORIGIN = 1
+   };
+   typedef std::map<ossimString,ossimString, ossimStringLtstr> PropertyMap;
+   
+   ossimOrthoIgen();
+
+   /**
+    * Will add command line arguments to initialize this object from a command line application
+    *
+    * <pre>
+    * Command Line Arguments:
+    *
+    * -t or --thumbnail  Takes an integer argument that is used to set both width
+    *                    and height.
+    *                    example: -t 1024 will produce an image that is 1024x1024
+    * --meters           Takes a double precision argument that is used for meters per pixel
+    *                    override.
+    *                    example: --meters 5 will create a 5 meter product.
+    * --slave-buffers    Takes an integer as an argument that specifies the number of slave tile buffers per
+    *                    slave node.  The slave nodes are suppose to be asynch send.  It will
+    *                    not wait for the send to finish.  It will got to the next buffer and check to
+    *                    see if it's been sent and if not it will then wait for the buffer to be free.
+    *                    example: --slave-buffers 10  will create 10 buffers per slave node.
+    * --chain-template   Takes a file name that is a kewyord list that is used as a template for every
+    *                    input file.
+    *                    example:
+    * 
+    * @param argumentParser Argument parser object to add command line options to
+    *
+    */ 
+   void addArguments(ossimArgumentParser& argumentParser);
+   virtual void initialize(ossimArgumentParser& argumentParser);
+   void addFiles(ossimArgumentParser& argumentParser,
+                 bool withDecoding,
+                 ossim_uint32 startIdx = 1);
+   void clearFilenameList();
+
+   //! Parses the .src file specified in the command line. These contain an alternate specification
+   //! of input file and associated attributes as a KWL.
+   void addSrcFile(const ossimFilename& fileName);
+
+   bool execute();
+   void setDefaultValues();
+
+protected:
+   //! Used to parse command line filename specs with piped switches (in lieu of *.src file).
+   //! Returns TRUE if successful.
+   bool parseFilename(const ossimString& file_spec, bool decodeEntry);
+
+   //! Determines the UL corner tiepoint of the product projection as the overall UL corner of the
+   //! mosaic.
+   void establishMosaicTiePoint();
+
+   //! Computes the center latitude of the mosaic for use as the geographic scaling latitude
+   void computeGeoScalingLatitude();
+
+   ossimUnitType theDeltaPerPixelUnit;
+   ossimDpt      theDeltaPerPixelOverride;
+   ossimOrthoIgenProjectionType theProjectionType;
+   ossimString   theProjectionName;
+   ossimString   theCrsString;
+   ossim_float64 theGeoScalingLatitude;
+   ossimString   theCombinerType;
+   ossimString   theResamplerType;
+   ossimString   theWriterType;
+   ossimFilename theTemplateView;
+   ossimFilename theTilingTemplate;
+   ossimFilename theTilingFilename;
+   ossimFilename theChainTemplate;
+   ossimFilename theCombinerTemplate;
+   ossimFilename theAnnotationTemplate;
+   ossimFilename theWriterTemplate;
+   ossimFilename theSupplementaryDirectory;
+   ossimString   theSlaveBuffers;
+   OriginType    theCutOriginType;
+   ossimDpt      theCutOrigin;
+   ossimDpt      theCutDxDy;
+   ossimUnitType theCutOriginUnit;
+   ossimUnitType theCutDxDyUnit;
+   ossim_float64 theLowPercentClip;
+   ossim_float64 theHighPercentClip;
+   ossim_int32   theStdDevClip;
+   bool          theUseAutoMinMaxFlag;
+   bool          theClipToValidRectFlag;
+   PropertyMap   theReaderProperties;
+   PropertyMap   theWriterProperties;   
+   ossimFilename theTargetHistoFileName;
+   std::vector<ossimSrcRecord> theSrcRecords;
+   ossimFilename theProductFilename;
+   ossimRefPtr<ossimProjection> theReferenceProj;
+   ossimFilename theMaskShpFile;
+   bool          theCacheExcludedFlag;
+   ossimString   thePixelReplacementMode;
+   ossim_float64 theClampPixelMin;
+   ossim_float64 theClampPixelMax;
+   ossim_float64 theClipPixelMin;
+   ossim_float64 theClipPixelMax;
+   ossimString   theOutputRadiometry;
+   ossimPixelType thePixelAlignment;
+
+   /**
+   * @brief Sets up the igen keyword list for the process.
+   *
+   * This throws ossimException on error.
+   */
+   void setupIgenChain();
+
+   bool setupTiling();
+   void setupCutter();
+
+   /** 
+   * Checks for the presence of a raster mask file alongside the image, and inserts the mask 
+   * filter in the chain if mask file exists. Returns with current_src pointing to masker object 
+   */
+   ossimImageSource* setupRasterMask(ossimImageChain* single_image_chain,
+                        const ossimSrcRecord& src_record);
+
+   /**
+   * Insert a partial-pixel flipper to remap null-valued pixels to min according to info in the
+   * source record and/or command line. Returns with current_src pointing to flipper object.
+   */
+   ossimImageSource* setupPixelFlipper(ossimImageChain* single_image_chain, 
+                          const ossimSrcRecord& src_record);
+
+   /**
+    * @brief Set up the writer for the process.
+    * This throws ossimException on error.
+    */
+   void setupWriter();
+
+   /**
+    * @brief Set up the output projection for the process.
+    * This throws ossimException on error.
+    */
+   void setupProjection();
+
+   /**
+    * Sets up any annotation from --annotate option.
+    * @note This must be called after "setupView" as it needs a projection.
+    */
+   void setupAnnotation();
+
+   void addFiles(ossimString fileInfoStr, 
+                 std::vector<ossimString> fileInfos,
+                 bool withEncodedEntry);
+
+   /**
+   * Consolidates specification of bounding rect given various ways of specifying on the command
+   * line. This avoids multiple, redundant checks scattered throughout the code.
+   */
+   void consolidateCutRectSpec();
+
+   /**
+   * Called when histogram operation is requested. Sets up additional filters in image chain
+   * for performing matching, stretching or clipping. If chain=0,
+   * this implies that the target histogram is being enabled for the output mosaic. */
+   void setupHistogram(ossimImageChain* chain=0, const ossimSrcRecord& src_record=ossimSrcRecord());
+
+   //! Utility method for creating a histogram for an input image. Returns TRUE if successful.
+   bool createHistogram(ossimImageChain* chain, const ossimFilename& histo_filename);
+
+   /**
+    * @brief Adds cache to the left of resampler.
+    * @param chain The chain to add to.
+    */
+   void addChainCache(ossimImageChain* chain) const;
+
+   /**
+   * @brief Generates a log KWL file that could be fed directly to Igen. Used for verifying chain.
+   */
+   void generateLog();
+  
+   /**
+   * @brief Adds a scalar remapper to the extreme right of the chain is specified by the 
+   * --output-radiometry option.
+   */
+   void setupOutputRadiometry();
+
+   /**
+    * @brief Checks all input image projections to see if elevation is needed.
+    * @return true if affected, false if not.
+    */
+   bool isAffectedByElevation();
+
+   /**
+    * @brief Recomputes image gsds.
+    *
+    * Calls ossimImageGeometry::computeGsd() on all image handlers
+    * that have projections affected by elevation.  Used to recompute after a
+    * delayed load of elevation.
+    */
+   void reComputeChainGsds();
+
+   /**
+    * GSD Determination is nontrivial since there are various command-line options that control
+    * this quantity. This method considers all information before setting the product's GSD.
+    */
+   void setProductGsd();
+};
+#endif
diff --git a/include/ossim/util/ossimOrthoTool.h b/include/ossim/util/ossimOrthoTool.h
new file mode 100644
index 0000000..216de6f
--- /dev/null
+++ b/include/ossim/util/ossimOrthoTool.h
@@ -0,0 +1,57 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimOrthoUtil_HEADER
+#define ossimOrthoUtil_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/util/ossimChipProcTool.h>
+
+/*!
+ *  Class for computing the slope on each elevation post and generatinga corresponding slope image.
+ *  The output scalar type is a normalized float unless unsigned 8-bit is selected via the options.
+ */
+class OSSIMDLLEXPORT ossimOrthoTool : public ossimChipProcTool
+{
+public:
+   ossimOrthoTool();
+   ~ossimOrthoTool();
+
+   /**
+    * Initializes the aurgument parser with expected parameters and options. It does not output
+    * anything. To see the usage, the caller will need to do something like:
+    *
+    *   ap.getApplicationUsage()->write(<ostream>);
+    */
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   /**
+    * Initializes from command line arguments.
+    * @return FALSE if --help option requested or no params provided, so that derived classes can
+    * @note Throws ossimException on error.
+    */
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   /**
+    * Reads processing params from KWL and prepares for execute. Returns TRUE if successful.
+    * @note Throws ossimException on error.
+    */
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   virtual ossimString getClassName() const { return "ossimOrthoUtil"; }
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+protected:
+   virtual void initProcessingChain();
+};
+
+#endif
diff --git a/include/ossim/util/ossimPointCloudUtil.h b/include/ossim/util/ossimPointCloudUtil.h
new file mode 100644
index 0000000..c2570dc
--- /dev/null
+++ b/include/ossim/util/ossimPointCloudUtil.h
@@ -0,0 +1,81 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************
+// $Id$
+
+#ifndef ossimPointCloudUtil_HEADER
+#define ossimPointCloudUtil_HEADER
+
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimListenerManager.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+#include <ossim/point_cloud/ossimPointCloudUtilityFilter.h>
+
+
+/**
+ * Utility class for generating point-cloud-derived image products
+ */
+class OSSIMDLLEXPORT ossimPointCloudUtil : public ossimObject,
+                                           public ossimProcessInterface,
+                                           public ossimListenerManager
+{
+   friend class ossimPointCloudUtilityFilter;
+
+public:
+   ossimPointCloudUtil();
+   virtual ~ossimPointCloudUtil();
+
+   /**
+    * Initializes from command line arguments.
+    */
+   bool initialize(ossimArgumentParser& ap);
+
+   /*
+    * Initializes after parameter set-methods have been called (in lieu of argument parser init)
+    */
+   bool initialize();
+
+   /**
+    * Returns true if successful
+    */
+   virtual bool execute();
+
+   /**
+    * Sets the nominal output resolution in meters
+    */
+   void setGSD(const double& meters_per_pixel);
+
+   virtual ossimObject* getObject() { return this; }
+   virtual const ossimObject* getObject() const  { return this; }
+   virtual ossimListenerManager* getManager()  { return this; };
+
+protected:
+   void usage(ossimArgumentParser& ap);
+   void addArguments(ossimArgumentParser& ap);
+   bool loadPC();
+   bool loadDem();
+
+   enum Operation { HIGHEST_DEM, LOWEST_DEM, HIGHEST_LOWEST } m_operation;
+   ossimRefPtr<ossimImageGeometry> m_prodGeom;
+   ossimRefPtr<ossimPointCloudHandler> m_pcHandler;
+   ossimRefPtr<ossimPointCloudImageHandler> m_pciHandler;
+   ossimRefPtr<ossimPointCloudUtilityFilter> m_pcuFilter;
+   double m_gsd;
+   ossimFilename m_lutFile;
+   ossimFilename m_prodFile;
+   ossimFilename m_demFile;
+   ossimFilename m_pcFile;
+
+};
+
+#endif /* ossimPointCloudUtil_HEADER */
diff --git a/include/ossim/util/ossimRpfUtil.h b/include/ossim/util/ossimRpfUtil.h
new file mode 100644
index 0000000..95842e3
--- /dev/null
+++ b/include/ossim/util/ossimRpfUtil.h
@@ -0,0 +1,85 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  ossimRpfUtil.h
+// 
+// Utility class to stuff with rpf files.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#ifndef ossimRpfUtil_HEADER
+#define ossimRpfUtil_HEADER 1
+
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/imaging/ossimImageGeometry.h> 
+
+class ossimFilename;
+class ossimGpt;
+class ossimRpfToc;
+class ossimRpfTocEntry;
+
+class OSSIM_DLL ossimRpfUtil : public ossimReferenced
+{
+public:
+
+   /** @brief default constructor */
+   ossimRpfUtil();
+
+
+   /**
+    * @brief Write dot rpf file(s) to output directory from a.toc file.
+    *
+    * This creates a dot rpf file for each entry.
+    *
+    * @param aDotFile The a.toc file.
+    *
+    * @param outputDir Directory to write dot rpf file(s) to.
+    *
+    * throws ossimException on error.
+    */
+   void writeDotRpfFiles( const ossimFilename& aDotTocFile,
+                          const ossimFilename& outputDir);
+
+   void writeDotRpfFile( const ossimRpfToc* toc,
+                         const ossimRpfTocEntry* tocEntry,
+                         const ossimFilename& outputDir,
+                         ossim_uint32 entry);
+
+protected:
+
+   /**
+    * @brief protected virtual destructor
+    *
+    * Do not call directly.  Use as a ref ptr.
+    */
+   virtual ~ossimRpfUtil();
+
+private:
+
+   /**
+    * @brief Method to test for 360 spread, 180.0 <--> 180.00 and set
+    * leftLon to -180 if both left and right are 180.0 degrees.
+    *
+    * This adds a small tolerance to the test.
+    * 
+    * @param left Left hand side of scene.  This is the value
+    * that will be flipped to -180 if test is true.
+    *
+    * @param right Right hand side of scene.
+    */
+   void checkLongitude(ossimGpt& left, ossimGpt& right) const;
+
+   /** @brief Method to get the file for entry. */
+   void getDotRfpFilenameForEntry(const ossimFilename& outputDir,
+                                  ossim_uint32 entry,
+                                  ossimFilename& outFile) const;
+   
+}; // Matches: class ossimRpfUtil
+
+#endif /* #ifndef ossimRpfUtil_HEADER */
diff --git a/include/ossim/util/ossimShorelineTool.h b/include/ossim/util/ossimShorelineTool.h
new file mode 100644
index 0000000..5d5f452
--- /dev/null
+++ b/include/ossim/util/ossimShorelineTool.h
@@ -0,0 +1,90 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimShorelineUtil_HEADER
+#define ossimShorelineUtil_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimLeastSquaresPlane.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/parallel/ossimJob.h>
+#include <ossim/parallel/ossimJobMultiThreadQueue.h>
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+#include <ossim/util/ossimChipProcTool.h>
+#include <OpenThreads/ReadWriteMutex>
+#include <vector>
+
+/*!
+ *  Class for finding helicopter landing zones (HLZ) on a DEM given the final destination and max
+ *  range from destination.
+ */
+class OSSIMDLLEXPORT ossimShorelineTool : public ossimChipProcTool
+{
+public:
+   enum AlgorithmId { UNKNOWN, NDWI, AWEI, PAN_THRESHOLD };
+   enum ThresholdMode { NONE=0, MEAN=1, SIGMA=2, VARIANCE=3, VALUE=4 };
+
+   ossimShorelineTool();
+   ~ossimShorelineTool();
+
+   virtual void setUsage(ossimArgumentParser& ap);
+   virtual bool initialize(ossimArgumentParser& ap);
+   virtual void initialize(const ossimKeywordlist& kwl);
+   virtual ossimRefPtr<ossimImageData> getChip(const ossimIrect& img_rect);
+   virtual bool execute();
+
+   virtual ossimString getClassName() const { return "ossimShorelineUtil"; }
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+
+protected:
+   virtual void initProcessingChain();
+   void initLandsat8();
+
+   /** @brief Hidden from use copy constructor. */
+   ossimShorelineTool( const ossimShorelineTool& obj );
+
+   /** @brief Hidden from use assignment operator. */
+   const ossimShorelineTool& operator=( const ossimShorelineTool& rhs );
+
+   /** @brief Initializes arg parser and outputs usage. */
+   void usage(ossimArgumentParser& ap);
+   void addArguments(ossimArgumentParser& ap);
+   bool addPropsToJSON();
+   void doThreshold();
+   void autoComputeThreshold();
+
+   ossim_uint8 m_waterValue;
+   ossim_uint8 m_marginalValue;
+   ossim_uint8 m_landValue;
+   ossimString m_sensor;
+   double m_threshold;
+   double m_tolerance;
+   AlgorithmId m_algorithm;
+   ThresholdMode m_thresholdMode;
+   double m_smoothing;
+   ossimFilename m_vectorFilename;
+   ossimFilename m_indexFilename;
+   ossimFilename m_threshFilename;
+   ossimFilename m_maskFilename;
+   std::map<ossimString, ossimString> m_geoJsonProps;
+   bool m_noVector;
+};
+
+#endif
diff --git a/include/ossim/util/ossimSlopeTool.h b/include/ossim/util/ossimSlopeTool.h
new file mode 100644
index 0000000..8b1abfe
--- /dev/null
+++ b/include/ossim/util/ossimSlopeTool.h
@@ -0,0 +1,58 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimSlopeUtil_HEADER
+#define ossimSlopeUtil_HEADER
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/util/ossimChipProcTool.h>
+
+/*!
+ *  Class for computing the slope on each elevation post and generatinga corresponding slope image.
+ *  The output scalar type is a normalized float unless unsigned 8-bit is selected via the options.
+ */
+class OSSIMDLLEXPORT ossimSlopeTool : public ossimChipProcTool
+{
+public:
+   ossimSlopeTool();
+   ~ossimSlopeTool();
+
+   /**
+    * Initializes the aurgument parser with expected parameters and options. It does not output
+    * anything. To see the usage, the caller will need to do something like:
+    *
+    *   ap.getApplicationUsage()->write(<ostream>);
+    */
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   /**
+    * Initializes from command line arguments.
+    * @return FALSE if --help option requested or no params provided, so that derived classes can
+    * @note Throws ossimException on error.
+    */
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   /**
+    * Reads processing params from KWL and prepares for execute. Returns TRUE if successful.
+    * @note Throws ossimException on error.
+    */
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   virtual ossimString getClassName() const { return "ossimSlopeUtil"; }
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+protected:
+   virtual void initProcessingChain();
+   bool m_recursiveCall;
+};
+
+#endif
diff --git a/include/ossim/util/ossimTool.h b/include/ossim/util/ossimTool.h
new file mode 100644
index 0000000..19c020e
--- /dev/null
+++ b/include/ossim/util/ossimTool.h
@@ -0,0 +1,153 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimUtility_HEADER
+#define ossimUtility_HEADER 1
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <iostream>
+
+/*!
+ *  Base class for all OSSIM tool applications. These are utilities providing high-level
+ *  functionality via the OSSIM library.
+ */
+class OSSIM_DLL ossimTool : public ossimObject
+{
+public:
+   ossimTool();
+   virtual ~ossimTool();
+
+   /**
+    * Initializes from command line arguments.
+    * This base class has some common arguments to read. The derived class should call this
+    * implementation in addition to setting its own arguments.
+    * @param ap Represents command line.
+    * @return FALSE if --help option requested or no params provided, so that derived classes can
+    * exit without error.
+    * @note Throws ossimException on error.
+    */
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   /**
+    * Reads processing params from KWL and prepares for execute. Returns TRUE if successful.
+    * @param kwl Full keyword-list representing state
+    * @note Throws ossimException on error.
+    */
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   /**
+    * Reads processing params from string provided (usually JSON-formatted, though that's up to the
+    * derived class to implement and contract with consumer). If all good, the object is ready for
+    * subsequent call to execute().
+    * @note Throws ossimException on error.
+    */
+   virtual void initialize(const std::string& request);
+
+   /**
+    * Writes product to output file if applicable. The product may also beAlways returns true since using exception on error.
+    * @note Throws ossimException on error.
+    */
+   virtual bool execute() = 0;
+
+   /**
+    * Fetch product as string (typically JSON) when applicable, otherwise passes back empty string.
+    * Always returns true since using exception on error.
+    * @return Returns non-empty string if valid response available.
+    */
+   virtual const std::string& getResponse() const { return m_response; }
+
+   /**
+    * Disconnects and clears the DEM and image layers. Leaves OSSIM initialized.
+    */
+   virtual void clear();
+
+   /**
+    * Kills current (asynchronous) process. Defaults to do nothing.
+    */
+   virtual void abort();
+
+   /**
+    * Assigns a template keywordlist to string for initializing derived classes.
+    */
+   virtual void getKwlTemplate(ossimKeywordlist& kwl);
+
+   /**
+    * Outputs a JSON representation of the Utility's API.
+    */
+   void getAPI(std::string& out) const;
+   std::string getAPI() const;
+
+   virtual ossimString getClassName() const;
+
+   /**
+    * @brief Gets build date.
+    * @param s String to initialize.
+    */
+   void getBuildDate(std::string& s) const;
+
+   /**
+    * @brief Gets revision.
+    * @param s String to initialize.
+    */
+   void getRevision(std::string& s) const;
+
+   /**
+    * @brief Gets version.
+    * @param s String to initialize.
+    */
+   void getVersion(std::string& s) const;
+
+   // NOTE: The ossimToolFactory::getCapabilities() needs to access a brief description of each
+   // utility. For convenience, the ossimTool-derived (final) classes should declare a public
+   // static member to hold the description string. See ossimViewshedTool for an example.
+   // static const char* DESCRIPTION;
+
+   /** Overrides base class implementation to indicate this class supports getChip() calls.
+    * Can be done with dynamic cast and pointer test, but not sure how that is supported in SWIG
+    * (OLK 11/2015). */
+   virtual bool isChipProcessor() const { return false; }
+
+   /**
+    * Redirects any console output to the supplied stream for logging or JNI application.
+    */
+   void setOutputStream(std::ostream* os) { m_consoleStream = os; }
+
+   /**
+    * Returns true when the initialization detects a "--help" option, so caller can avoid
+    * subsequent execute() call. If execute() is called, it will return true after trivial execute.
+    */
+   bool helpRequested() const { return m_helpRequested; }
+
+protected:
+   /**
+    * Initializes the aurgument parser with expected parameters and options. It does not output
+    * anything. To see the usage, the caller will need to do something like:
+    *
+    *   ap.getApplicationUsage()->write(<ostream>);
+    *
+    * This base class has some common arguments to add. The derived class should call this
+    * implementation in addition to setting its own arguments.
+    */
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   ossimKeywordlist m_kwl;
+   std::ostream* m_consoleStream;
+   bool m_helpRequested;
+   std::string m_response;
+
+private:
+   /**
+    * Used for reading text files of template and JSON API from disk ONLY.
+    */
+   bool readTextFile(const ossimFilename& filename, std::string& contents) const;
+
+};
+
+#endif
diff --git a/include/ossim/util/ossimToolFactory.h b/include/ossim/util/ossimToolFactory.h
new file mode 100644
index 0000000..94c9352
--- /dev/null
+++ b/include/ossim/util/ossimToolFactory.h
@@ -0,0 +1,49 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimUtilityFactory_HEADER
+#define ossimUtilityFactory_HEADER 1
+
+#include <ossim/base/ossimString.h>
+#include <ossim/util/ossimToolFactoryBase.h>
+
+class ossimCoreUtility;
+class ossimFilename;
+class ossimKeywordlist;
+
+class OSSIMDLLEXPORT ossimToolFactory : public ossimToolFactoryBase
+{
+public:
+   virtual ~ossimToolFactory();
+   static ossimToolFactory* instance();
+
+   virtual ossimTool* createTool(const std::string& typeName) const;
+
+   /*!
+    * This should return the type name of all objects in all factories.
+    * This is the name used to construct the objects dynamically and this name must be unique.
+    */
+   virtual void getTypeNameList(std::vector<ossimString>& typeList) const;
+
+   /**
+    * Appends map with available utilities along with descriptions as <name, description> pairs.
+    * The names are the human-readable name of the utility/service, typically the utility's class
+    * name without the "ossim" prefix nor "Tool" suffix, all lowercase.
+    */
+   virtual void getCapabilities(std::map<std::string, std::string>& capabilities) const;
+   virtual std::map<std::string, std::string> getCapabilities() const;
+
+protected:
+   ossimToolFactory();
+   ossimToolFactory(const ossimToolFactory&){}
+   void operator = (const ossimToolFactory&){}
+
+   static ossimToolFactory* s_Instance;
+
+};
+
+#endif
diff --git a/include/ossim/util/ossimToolFactoryBase.h b/include/ossim/util/ossimToolFactoryBase.h
new file mode 100644
index 0000000..00e5f66
--- /dev/null
+++ b/include/ossim/util/ossimToolFactoryBase.h
@@ -0,0 +1,43 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimUtilityFactoryBase_HEADER
+#define ossimUtilityFactoryBase_HEADER
+
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/util/ossimTool.h>
+#include <string>
+
+class OSSIM_DLL ossimToolFactoryBase : public ossimObjectFactory
+{
+public:
+   virtual ossimObject* createObject(const ossimString& typeName) const
+   { return (ossimObject*) createTool(typeName); }
+
+   virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix=0) const
+   { return (ossimObject*) createTool(kwl, prefix); }
+
+   virtual ossimTool* createTool(const std::string& typeName) const=0;
+
+   virtual ossimTool* createTool(const ossimKeywordlist& kwl, const char* prefix=0) const
+   {
+      ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+      return createTool(type);
+   }
+
+   /**
+    * Appends map with available utilities along with descriptions as <name, decription> pairs.
+    * The names are the human-readable name of the utility/service, typically the utility's class
+    * name without the "ossim" prefix nor "Util" suffix, all lowercase.
+    */
+   virtual void getCapabilities(std::map<std::string, std::string>& capabilities) const = 0;
+   virtual std::map<std::string, std::string> getCapabilities() const = 0;
+};
+
+#endif
diff --git a/include/ossim/util/ossimToolRegistry.h b/include/ossim/util/ossimToolRegistry.h
new file mode 100644
index 0000000..53752e5
--- /dev/null
+++ b/include/ossim/util/ossimToolRegistry.h
@@ -0,0 +1,55 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimUtilityManager_HEADER
+#define ossimUtilityManager_HEADER
+
+#include <ossim/base/ossimFactoryListInterface.h>
+#include <ossim/util/ossimToolFactoryBase.h>
+#include <map>
+#include <string>
+
+class ossimTool;
+
+/**
+ * Registry of all utility factories. Presently only one factory exists, ossimUtilityFactory, but
+ * eventually plugins can provide their own utilities and corresponding factories.
+ */
+class OSSIMDLLEXPORT ossimToolRegistry : public ossimToolFactoryBase,
+                                           public ossimFactoryListInterface<ossimToolFactoryBase, ossimTool>
+{
+public:
+   ossimToolRegistry();
+   ~ossimToolRegistry();
+
+   static ossimToolRegistry* instance();
+
+   /**
+    * Initializes the utility factory. Returns TRUE if successful.
+    * @note Throws ossimException on error.
+    */
+   virtual bool initialize();
+
+   /**
+    * Appends map with available utilities along with descriptions as <name, decription> pairs.
+    * The names are the human-readable name of the utility/service, typically the utility's class
+    * name without the "ossim" prefix nor "Util" suffix, all lowercase.
+    */
+   virtual void getCapabilities(std::map<std::string, std::string>& capabilities) const;
+   virtual std::map<std::string, std::string> getCapabilities() const;
+
+   virtual ossimTool* createTool(const std::string& typeName) const;
+
+   virtual ossimString getClassName() const { return "ossimToolRegistry"; }
+
+   virtual void getTypeNameList(std::vector<ossimString>& typeList) const;
+
+private:
+   static ossimToolRegistry* s_instance;
+};
+
+#endif
diff --git a/include/ossim/util/ossimVerticesFinderTool.h b/include/ossim/util/ossimVerticesFinderTool.h
new file mode 100644
index 0000000..b62c7fa
--- /dev/null
+++ b/include/ossim/util/ossimVerticesFinderTool.h
@@ -0,0 +1,45 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimVerticesFinderUtil_HEADER
+#define ossimVerticesFinderUtil_HEADER
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/util/ossimTool.h>
+
+/*!
+ *  Class for determining the active image corner vertices inside larger null-filled image rectangle.
+ */
+class OSSIMDLLEXPORT ossimVerticesFinderTool : public ossimTool
+{
+public:
+   ossimVerticesFinderTool();
+   ~ossimVerticesFinderTool();
+
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   virtual bool execute();
+
+   virtual ossimString getClassName() const { return "ossimVerticesFinderUtil"; }
+
+   virtual void getKwlTemplate(ossimKeywordlist& kwl);
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+protected:
+   ossimFilename m_inputFile;
+   ossimFilename m_outputFile;
+   ossim_uint32 m_entryIndex;
+};
+
+#endif
diff --git a/include/ossim/util/ossimViewshedTool.h b/include/ossim/util/ossimViewshedTool.h
new file mode 100644
index 0000000..e3f0b65
--- /dev/null
+++ b/include/ossim/util/ossimViewshedTool.h
@@ -0,0 +1,175 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#ifndef ossimViewshedUtil_HEADER
+#define ossimViewshedUtil_HEADER
+
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/parallel/ossimJob.h>
+#include <ossim/parallel/ossimJobMultiThreadQueue.h>
+#include <ossim/util/ossimChipProcTool.h>
+#include <OpenThreads/ReadWriteMutex>
+
+/*!
+ *  Class for computing the viewshed on a DEM given the viewer location and max range of visibility
+ */
+
+class OSSIMDLLEXPORT ossimViewshedTool : public ossimChipProcTool
+{
+   friend class SectorProcessorJob;
+   friend class RadialProcessorJob;
+   friend class RadialProcessor;
+
+public:
+   ossimViewshedTool();
+   ~ossimViewshedTool();
+
+   /**
+    * Initializes the aurgument parser with expected parameters and options. It does not output
+    * anything. To see the usage, the caller will need to do something like:
+    *
+    *   ap.getApplicationUsage()->write(<ostream>);
+    */
+   virtual void setUsage(ossimArgumentParser& ap);
+
+   /** Initializes from command line arguments.
+    * @return FALSE if --help option requested or no params provided, so that derived classes can
+    * @note Throws ossimException on error. */
+   virtual bool initialize(ossimArgumentParser& ap);
+
+   /** Reads processing params from KWL and prepares for execute. Returns TRUE if successful.
+    * @note Throws ossimException on error. */
+   virtual void initialize(const ossimKeywordlist& kwl);
+
+   /** Computes the viewshed for the area represented by argument AOI. */
+   virtual ossimRefPtr<ossimImageData> getChip(const ossimIrect& img_rect);
+
+   /** Writes product to output file. Returns true if successful.
+    * @note Throws ossimException on error. */
+   virtual bool execute();
+
+   /** Disconnects and clears the DEM and image layers. Leaves OSSIM initialized. */
+   virtual void clear();
+
+   virtual ossimString getClassName() const { return "ossimViewshedUtil"; }
+
+   /** Used by ossimUtilityFactory */
+   static const char* DESCRIPTION;
+
+   /** For engineering/debug */
+   void test();
+
+protected:
+   class Radial
+   {
+   public:
+      Radial() : azimuth (0), elevation (-99999999.0), insideAoi(false) {}
+
+      // Angles are stored as arctangents: azimuth = dy/dx,  elevation = dz/dx
+      double azimuth;
+      double elevation;
+      bool insideAoi;
+   };
+
+   virtual void initProcessingChain();
+   virtual void initializeProjectionGsd();
+   virtual void initializeAOI();
+   void paintReticle();
+   void initRadials();
+   bool writeHorizonProfile();
+   void computeRadius();
+   bool optimizeFOV();
+   bool computeViewshed(); // assigns m_outBuffer with single-band viewshed image
+
+   ossimGpt  m_observerGpt;
+   ossimDpt  m_observerVpt;
+   double m_obsHgtAbvTer; // meters above the terrain
+   double m_visRadius; // meters
+   Radial** m_radials;
+   bool m_obsInsideAoi;
+   bool m_displayAsRadar; // True when explicit visRadius is supplied
+   ossim_uint32 m_halfWindow; // visRadius adjusted by GSD (in pixels)
+   ossimRefPtr<ossimImageData> m_outBuffer;
+   ossimRefPtr<ossimMemoryImageSource> m_memSource;
+   ossim_uint8 m_visibleValue;
+   ossim_uint8 m_hiddenValue;
+   ossim_uint8 m_overlayValue;
+   ossim_int32 m_reticleSize;
+   bool m_simulation;
+   ossimRefPtr<ossimJobMultiThreadQueue> m_jobMtQueue;
+   ossim_uint32 m_numThreads;
+   double m_startFov;
+   double m_stopFov;
+   bool m_threadBySector;
+   ossimFilename m_horizonFile;
+   std::map<double, double> m_horizonMap;
+
+   // For debugging:
+   double d_accumT;
+   OpenThreads::Mutex d_mutex;
+};
+
+/**
+ * For support of multithreading. The --tbs option directs ossimViewshedUtil to create a thread
+ * for each sector (using the SectorProcessorJob). Otherwise, the threads are mapped to a single
+ * radial. There are 8 sectors total (45 deg each) so a max of 8 threads are launched. Thus it may
+ * be faster to use the RadialProcessorJob scheme (default) when the number of available cores > 8.
+ */
+class SectorProcessorJob : public ossimJob
+{
+   friend class ossimViewshedTool;
+
+private:
+   SectorProcessorJob(ossimViewshedTool* vs_util, ossim_uint32 sector, ossim_uint32 numRadials)
+   : m_vsUtil (vs_util), m_sector (sector), m_numRadials (numRadials)  {}
+
+   virtual void start();
+
+   ossimViewshedTool* m_vsUtil;
+   ossim_uint32 m_sector;
+   ossim_uint32 m_numRadials;
+};
+
+
+class RadialProcessorJob : public ossimJob
+{
+   friend class ossimViewshedTool;
+
+private:
+   RadialProcessorJob(ossimViewshedTool* vs_util,
+                      ossim_uint32 sector,
+                      ossim_uint32 radial,
+                      ossim_uint32 numRadials)
+   : m_vsUtil (vs_util), m_sector (sector), m_radial (radial), m_numRadials (numRadials) {}
+
+   virtual void start();
+
+   ossimViewshedTool* m_vsUtil;
+   ossim_uint32 m_sector;
+   ossim_uint32 m_radial;
+   ossim_uint32 m_numRadials;
+};
+
+/**
+ * This class provides a common entry point for both SectorProcessorJob and RadialProcessorJob for
+ * processing a single radial. Eventually, SectorProcessorJob can likely go away (invoked with the
+ * "--tbs" command-line option, and doRadial() method can be moved into RadialProcessorJob class.
+ * In the meantime, both Sector/thread and Radial/thread schemes are supported to continue
+ * evaluating performance.
+ */
+class RadialProcessor
+{
+public:
+   static void doRadial(ossimViewshedTool* vs, ossim_uint32 s, ossim_uint32 r);
+
+private:
+   static OpenThreads::ReadWriteMutex m_bufMutex;
+   RadialProcessor() {};
+};
+
+#endif
diff --git a/ossim/include/ossim/vec/ossimVpfBoundingRecordTable.h b/include/ossim/vec/ossimVpfBoundingRecordTable.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfBoundingRecordTable.h
rename to include/ossim/vec/ossimVpfBoundingRecordTable.h
diff --git a/ossim/include/ossim/vec/ossimVpfCoverage.h b/include/ossim/vec/ossimVpfCoverage.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfCoverage.h
rename to include/ossim/vec/ossimVpfCoverage.h
diff --git a/ossim/include/ossim/vec/ossimVpfDatabase.h b/include/ossim/vec/ossimVpfDatabase.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfDatabase.h
rename to include/ossim/vec/ossimVpfDatabase.h
diff --git a/ossim/include/ossim/vec/ossimVpfDatabaseHeader.h b/include/ossim/vec/ossimVpfDatabaseHeader.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfDatabaseHeader.h
rename to include/ossim/vec/ossimVpfDatabaseHeader.h
diff --git a/include/ossim/vec/ossimVpfDatabaseHeaderTableValidator.h b/include/ossim/vec/ossimVpfDatabaseHeaderTableValidator.h
new file mode 100644
index 0000000..cb9a195
--- /dev/null
+++ b/include/ossim/vec/ossimVpfDatabaseHeaderTableValidator.h
@@ -0,0 +1,17 @@
+//-----------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//-----------------------------------------------------------------
+#ifndef ossimVpfDatabaseHeaderTableValidator_HEADER
+#define ossimVpfDatabaseHeaderTableValidator_HEADER
+#include <ossim/vec/ossimVpfTableValidator.h>
+class ossimVpfTable;
+class ossimVpfDatabaseHeaderTableValidator : public ossimVpfTableValidator
+{
+public:
+   virtual ~ossimVpfDatabaseHeaderTableValidator();
+   virtual bool isValid(ossimVpfTable& aTable)const;
+};
+
+#endif
diff --git a/ossim/include/ossim/vec/ossimVpfExtent.h b/include/ossim/vec/ossimVpfExtent.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfExtent.h
rename to include/ossim/vec/ossimVpfExtent.h
diff --git a/ossim/include/ossim/vec/ossimVpfFeatureClass.h b/include/ossim/vec/ossimVpfFeatureClass.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfFeatureClass.h
rename to include/ossim/vec/ossimVpfFeatureClass.h
diff --git a/ossim/include/ossim/vec/ossimVpfFeatureClassSchema.h b/include/ossim/vec/ossimVpfFeatureClassSchema.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfFeatureClassSchema.h
rename to include/ossim/vec/ossimVpfFeatureClassSchema.h
diff --git a/ossim/include/ossim/vec/ossimVpfLibrary.h b/include/ossim/vec/ossimVpfLibrary.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfLibrary.h
rename to include/ossim/vec/ossimVpfLibrary.h
diff --git a/ossim/include/ossim/vec/ossimVpfLibraryAttributeTableValidator.h b/include/ossim/vec/ossimVpfLibraryAttributeTableValidator.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfLibraryAttributeTableValidator.h
rename to include/ossim/vec/ossimVpfLibraryAttributeTableValidator.h
diff --git a/ossim/include/ossim/vec/ossimVpfTable.h b/include/ossim/vec/ossimVpfTable.h
similarity index 100%
rename from ossim/include/ossim/vec/ossimVpfTable.h
rename to include/ossim/vec/ossimVpfTable.h
diff --git a/include/ossim/vec/ossimVpfTableValidator.h b/include/ossim/vec/ossimVpfTableValidator.h
new file mode 100644
index 0000000..6b72705
--- /dev/null
+++ b/include/ossim/vec/ossimVpfTableValidator.h
@@ -0,0 +1,18 @@
+//-----------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//-----------------------------------------------------------------
+#ifndef ossimVpfTableValidator_HEADER
+#define ossimVpfTableValidator_HEADER
+
+class ossimVpfTable;
+
+class ossimVpfTableValidator
+{
+public:
+   virtual ~ossimVpfTableValidator(){}
+   virtual bool isValid(ossimVpfTable& aTable)const=0;
+};
+
+#endif
diff --git a/include/ossim/vec/vpf.h b/include/ossim/vec/vpf.h
new file mode 100644
index 0000000..aaf85e3
--- /dev/null
+++ b/include/ossim/vec/vpf.h
@@ -0,0 +1,35 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: This class give the capability to access tiles from an
+//              vpf file.
+//
+//********************************************************************
+// $Id: vpf.h 13586 2008-09-17 01:35:25Z gpotts $
+#ifndef VPF_HEADER
+#define VPF_HEADER
+
+#include <ossim/ossimConfig.h>
+
+#if __OSSIM_CARBON__
+#define MAXINT INT_MAX
+#endif
+
+extern "C"
+{
+#include <ossim/vpfutil/vpfapi.h>
+#include <ossim/vpfutil/vpfview.h>
+#include <ossim/vpfutil/vpfselec.h>
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfprim.h>
+#include <ossim/vpfutil/vpfmisc.h>
+#include <ossim/vpfutil/vpfdisp.h>
+}
+
+#endif
diff --git a/ossim/include/ossim/video/ossimVideoGeometry.h b/include/ossim/video/ossimVideoGeometry.h
similarity index 100%
rename from ossim/include/ossim/video/ossimVideoGeometry.h
rename to include/ossim/video/ossimVideoGeometry.h
diff --git a/ossim/include/ossim/video/ossimVideoHandler.h b/include/ossim/video/ossimVideoHandler.h
similarity index 100%
rename from ossim/include/ossim/video/ossimVideoHandler.h
rename to include/ossim/video/ossimVideoHandler.h
diff --git a/ossim/include/ossim/video/ossimVideoImageHandler.h b/include/ossim/video/ossimVideoImageHandler.h
similarity index 100%
rename from ossim/include/ossim/video/ossimVideoImageHandler.h
rename to include/ossim/video/ossimVideoImageHandler.h
diff --git a/ossim/include/ossim/video/ossimVideoImageSource.h b/include/ossim/video/ossimVideoImageSource.h
similarity index 100%
rename from ossim/include/ossim/video/ossimVideoImageSource.h
rename to include/ossim/video/ossimVideoImageSource.h
diff --git a/ossim/include/ossim/video/ossimVideoSource.h b/include/ossim/video/ossimVideoSource.h
similarity index 100%
rename from ossim/include/ossim/video/ossimVideoSource.h
rename to include/ossim/video/ossimVideoSource.h
diff --git a/ossim/include/ossim/vpfutil/linklist.h b/include/ossim/vpfutil/linklist.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/linklist.h
rename to include/ossim/vpfutil/linklist.h
diff --git a/ossim/include/ossim/vpfutil/machine.h b/include/ossim/vpfutil/machine.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/machine.h
rename to include/ossim/vpfutil/machine.h
diff --git a/ossim/include/ossim/vpfutil/mapgraph.h b/include/ossim/vpfutil/mapgraph.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/mapgraph.h
rename to include/ossim/vpfutil/mapgraph.h
diff --git a/ossim/include/ossim/vpfutil/polygrf.h b/include/ossim/vpfutil/polygrf.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/polygrf.h
rename to include/ossim/vpfutil/polygrf.h
diff --git a/ossim/include/ossim/vpfutil/projectn.h b/include/ossim/vpfutil/projectn.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/projectn.h
rename to include/ossim/vpfutil/projectn.h
diff --git a/ossim/include/ossim/vpfutil/protomas.h b/include/ossim/vpfutil/protomas.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/protomas.h
rename to include/ossim/vpfutil/protomas.h
diff --git a/ossim/include/ossim/vpfutil/set.h b/include/ossim/vpfutil/set.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/set.h
rename to include/ossim/vpfutil/set.h
diff --git a/ossim/include/ossim/vpfutil/system.h b/include/ossim/vpfutil/system.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/system.h
rename to include/ossim/vpfutil/system.h
diff --git a/ossim/include/ossim/vpfutil/values.h b/include/ossim/vpfutil/values.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/values.h
rename to include/ossim/vpfutil/values.h
diff --git a/ossim/include/ossim/vpfutil/vpfapi.h b/include/ossim/vpfutil/vpfapi.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfapi.h
rename to include/ossim/vpfutil/vpfapi.h
diff --git a/ossim/include/ossim/vpfutil/vpfdisp.h b/include/ossim/vpfutil/vpfdisp.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfdisp.h
rename to include/ossim/vpfutil/vpfdisp.h
diff --git a/ossim/include/ossim/vpfutil/vpfdraw.h b/include/ossim/vpfutil/vpfdraw.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfdraw.h
rename to include/ossim/vpfutil/vpfdraw.h
diff --git a/ossim/include/ossim/vpfutil/vpfinit.h b/include/ossim/vpfutil/vpfinit.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfinit.h
rename to include/ossim/vpfutil/vpfinit.h
diff --git a/ossim/include/ossim/vpfutil/vpfio.h b/include/ossim/vpfutil/vpfio.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfio.h
rename to include/ossim/vpfutil/vpfio.h
diff --git a/ossim/include/ossim/vpfutil/vpfmisc.h b/include/ossim/vpfutil/vpfmisc.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfmisc.h
rename to include/ossim/vpfutil/vpfmisc.h
diff --git a/ossim/include/ossim/vpfutil/vpfprim.h b/include/ossim/vpfutil/vpfprim.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfprim.h
rename to include/ossim/vpfutil/vpfprim.h
diff --git a/ossim/include/ossim/vpfutil/vpfrelat.h b/include/ossim/vpfutil/vpfrelat.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfrelat.h
rename to include/ossim/vpfutil/vpfrelat.h
diff --git a/ossim/include/ossim/vpfutil/vpfselec.h b/include/ossim/vpfutil/vpfselec.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfselec.h
rename to include/ossim/vpfutil/vpfselec.h
diff --git a/ossim/include/ossim/vpfutil/vpftable.h b/include/ossim/vpfutil/vpftable.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpftable.h
rename to include/ossim/vpfutil/vpftable.h
diff --git a/ossim/include/ossim/vpfutil/vpftidx.h b/include/ossim/vpfutil/vpftidx.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpftidx.h
rename to include/ossim/vpfutil/vpftidx.h
diff --git a/ossim/include/ossim/vpfutil/vpfview.h b/include/ossim/vpfutil/vpfview.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/vpfview.h
rename to include/ossim/vpfutil/vpfview.h
diff --git a/ossim/include/ossim/vpfutil/xmemory.h b/include/ossim/vpfutil/xmemory.h
similarity index 100%
rename from ossim/include/ossim/vpfutil/xmemory.h
rename to include/ossim/vpfutil/xmemory.h
diff --git a/ossim-logo.png b/ossim-logo.png
new file mode 100644
index 0000000..19bee94
Binary files /dev/null and b/ossim-logo.png differ
diff --git a/ossim/CMakeLists.txt b/ossim/CMakeLists.txt
deleted file mode 100644
index d19dfa4..0000000
--- a/ossim/CMakeLists.txt
+++ /dev/null
@@ -1,273 +0,0 @@
-PROJECT(ossimcore)
-Message("################## Setting up OSSIM core library #########################")
-
-IF(NOT OSSIM_BUILD_ADDITIONAL_OSSIM_DIRECTORIES)
-   SET(OSSIM_BUILD_ADDITIONAL_OSSIM_DIRECTORIES "" CACHE PATH "Specify full paths separated by ; to additional OSSIM applications you wish to include into the ossim build framework.  These will have variables setup for the ossim includes" FORCE)
-ENDIF(NOT OSSIM_BUILD_ADDITIONAL_OSSIM_DIRECTORIES)
-
-cmake_minimum_required(VERSION 2.8)
-
-SET(CMAKE_MODULE_PATH "${${PROJECT_NAME}_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
-
-INCLUDE(OssimVersion)
-INCLUDE(OssimCommonVariables)
-
-# Expose some build options
-OPTION(BUILD_OSSIM_FREETYPE_SUPPORT "Set to ON to build OSSIM with freetype support.  Use OFF to turn off freetype support." ON)
-
-OPTION(BUILD_OSSIM_MPI_SUPPORT "Set to ON to build OSSIM with MPI support.  Use OFF to turn off MPI support." ON)
-
-OPTION(BUILD_OSSIM_ID_SUPPORT "Set to ON to build OSSIM SVN ID support into the library.  Use OFF to turn off ID support." ON)
-
-OPTION(BUILD_OSSIM_APPS "Set to ON to build ossim apps.  Use OFF to disable." ON)
-OPTION(BUILD_OSSIM_CURL_APPS "Set to ON to build ossim curl dependent apps.  Use ON to enable." OFF)
-OPTION(BUILD_OSSIM_TEST_APPS "Set to ON to build ossim test apps.  Use OFF to disable." ON)
-
-OPTION(BUILD_OSSIM_APPS "Set to ON to build ossim test apps.  Use OFF to disable." ON)
-
-
-###################################################################################
-# Include the Utilities in the root make
-###################################################################################
-INCLUDE(OssimUtilities)
-
-INCLUDE(CheckIncludeFile)
-CHECK_INCLUDE_FILE("dirent.h" CMAKE_HAVE_DIRENT_H)
-CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
-CHECK_INCLUDE_FILE("getopt.h" CMAKE_HAVE_GETOPT_H)
-CHECK_INCLUDE_FILE("fcntl.h" CMAKE_HAVE_FCNTL_H)
-CHECK_INCLUDE_FILE("dbmalloc.h" CMAKE_HAVE_DBMALLOC_H)
-CHECK_INCLUDE_FILE("malloc.h" CMAKE_HAVE_MALLOC_H)
-CHECK_INCLUDE_FILE("dlfcn.h" CMAKE_HAVE_DLFCN_H)
-
-# Set our include paths:
-include_directories( ${PROJECT_SOURCE_DIR}/include )
-include_directories( ${PROJECT_BINARY_DIR}/include )
-
-# Stores list of libs to link with. Initialized throughout.
-set( ossimDependentLibs )
-
-#---
-# Find required and optional packages and add their include paths and libraries:
-#---
-
-# GEOS - Currently optional until it is actually called.:
-find_package( GEOS )
-if( GEOS_FOUND )
-   include_directories( ${GEOS_INCLUDE_DIR} )
-   set( ossimDependentLibs ${ossimDependentLibs} ${GEOS_LIBRARY} )
-else( GEOS_FOUND )
-   message( FATAL_ERROR "Could not find geos package! Consider installing this as it will soon become a required package." )
-endif( GEOS_FOUND )
-
-# GEOFIFF - Required:
-set( OSSIM_HAS_GEOTIFF 0 )
-find_package( GEOTIFF )
-if( GEOTIFF_FOUND )
-   include_directories( ${GEOTIFF_INCLUDE_DIR} )
-   set( ossimDependentLibs ${ossimDependentLibs} ${GEOTIFF_LIBRARY} )
-   set( OSSIM_HAS_GEOTIFF 1 )
-else( GEOTIFF_FOUND )
-   message( FATAL_ERROR "Could not find required geotiff package!" )
-endif( GEOTIFF_FOUND )
-
-# GEOTRANS - Required: (GeoTrans 3.4.x port future...)
-# find_package( Geotrans )
-# if( GEOTRANS_FOUND )
-#   include_directories( ${GEOTRANS_INCLUDE_DIR} )
-#   set( ossimDependentLibs ${ossimDependentLibs} ${GEOTRANS_LIBRARY} )
-# else( GEOTRANS_FOUND )
-#   message( FATAL_ERROR "Could not find required geotrans package!" )
-# endif( GEOTRANS_FOUND )
-
-# JPEG - Required package:
-find_package( JPEG )
-if( JPEG_FOUND )
-   include_directories( ${JPEG_INCLUDE_DIR} )
-   set( ossimDependentLibs ${ossimDependentLibs} ${JPEG_LIBRARY} )
-else( JPEG_FOUND )
-   message( FATAL_ERROR "Could not find required jpeg package!" )
-endif( JPEG_FOUND )
-
-# OpenThreads - Required:
-find_package( OpenThreads )
-if( OPENTHREADS_FOUND )
-   include_directories( ${OPENTHREADS_INCLUDE_DIR} )
-   set( ossimDependentLibs ${ossimDependentLibs} ${OPENTHREADS_LIBRARY} )
-else( OPENTHREADS_FOUND )
-   message( FATAL_ERROR "Could not find required OpenThreads package!" )
-endif( OPENTHREADS_FOUND )
-
-# TIFF - Required:
-find_package( TIFF )
-if( TIFF_FOUND )
-   include_directories( ${TIFF_INCLUDE_DIR} )
-   set( ossimDependentLibs ${ossimDependentLibs} ${TIFF_LIBRARY} )
-else( TIFF_FOUND )
-   message( FATAL_ERROR "Could not find required tiff package!" )
-endif( TIFF_FOUND )
-
-# DL - Required on unix:
-if( UNIX )
-   find_library( DL_LIBRARY dl )
-   if ( DL_LIBRARY )
-      set( ossimDependentLibs ${ossimDependentLibs} ${DL_LIBRARY} )
-   else( DL_LIBRARY )
-      # TODO:  Is this required on unix?  If so move to the required section.
-      message( FATAL_ERROR "Could not find dl library!" )
-   endif( DL_LIBRARY )
-endif( UNIX )
-
-# FREETYPE - Optional:
-set( OSSIM_HAS_FREETYPE 0 )
-if( BUILD_OSSIM_FREETYPE_SUPPORT )
-   find_package(Freetype)
-   if( FREETYPE_FOUND )
-      include_directories( ${FREETYPE_INCLUDE_DIRS} )
-      set( ossimDependentLibs ${ossimDependentLibs} ${FREETYPE_LIBRARIES} )
-      set( OSSIM_HAS_FREETYPE 1 )
-   else( FREETYPE_FOUND )
-      message( WARNING "Could not find optional freetype package!" )
-   endif( FREETYPE_FOUND )
-endif( BUILD_OSSIM_FREETYPE_SUPPORT )
-
-# MPI - Optional:
-set( OSSIM_HAS_MPI 0 )
-if( BUILD_OSSIM_MPI_SUPPORT )
-   find_package(MPI)
-   if ( MPI_FOUND )
-      include_directories( ${MPI_INCLUDE_DIR} )
-      set( ossimDependentLibs ${ossimDependentLibs} ${MPI_LIBRARY} )
-      set( OSSIM_HAS_MPI 1 )
-   else ( MPI_FOUND )
-      message( WARNING "Could not find optional MPI package!" )
-   endif ( MPI_FOUND )
-endif( BUILD_OSSIM_MPI_SUPPORT )
-
-# ZLIB - Optional:
-set( OSSIM_HAS_LIBZ 0 )
-find_package( ZLIB )
-if ( ZLIB_FOUND )
-   include_directories( ${ZLIB_INCLUDE_DIR} )
-   set( ossimDependentLibs ${ossimDependentLibs} ${ZLIB_LIBRARY} )
-   set( OSSIM_HAS_LIBZ 1 )
-else ( ZLIB_FOUND )
-   message( WARNING "Could not find optional zlib package!" )
-endif ( ZLIB_FOUND )
-
-#---
-# Call the OSSIM macros in OssimUtilities.cmake
-#---
-TODAYS_DATE(OSSIM_BUILD_DATE)
-SET(OSSIM_SVN_REVISION_NUMBER "UNKNOWN")
-GET_SVN_REVISION()
-if ( NOT ${Project_WC_REVISION} EQUAL 0 )
-   set( OSSIM_SVN_REVISION_NUMBER ${Project_WC_REVISION} )
-endif()
-
-#####################################################################################
-# Call the configure files for ossimConfig and ossimVersion setup
-#####################################################################################
-set(OSSIM_VERSION_NUMBER "\"${OSSIM_VERSION}\"")
-set(OSSIM_BUILD_DATE "\"${OSSIM_BUILD_DATE}\"")
-set(OSSIM_REVISION_NUMBER "\"${OSSIM_SVN_REVISION_NUMBER}\"")
-
-# Setting of OSSIM_ID to variable expanded $Id$ results.  Embedded troughout code.
-set(OSSIM_ID_ENABLED   1)
-IF(NOT BUILD_OSSIM_ID_SUPPORT)
-   set(OSSIM_ID_ENABLED 0)
-ENDIF(NOT BUILD_OSSIM_ID_SUPPORT)
-
-SET(OSSIM_CONFIGURE_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/ossim/ossimConfig.h")
-CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/ossim/ossimConfig.h.in"
-	       "${OSSIM_CONFIGURE_HEADER}")
-SET(OSSIM_VERSION_HEADER_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/src/ossim/ossimVersion.h.in")
-SET(OSSIM_VERSION_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/ossim/ossimVersion.h")
-CONFIGURE_FILE("${OSSIM_VERSION_HEADER_CONFIG}"
-               "${OSSIM_VERSION_HEADER}")
-
-
-##################################################################################################
-# Instead of creating another CMakeLists under src we will just add the subdirectories to build
-# here
-##################################################################################################
-subdirs(src/ossim)
-
-#---
-# Building apps optional.
-#---
-if(BUILD_OSSIM_APPS)
-  subdirs(src/apps)
-endif()
-
-#---
-# Building curl dependant apps optional. default=OFF
-#---
-if(BUILD_OSSIM_CURL_APPS)
-  subdirs(src/apps/curl_apps)
-endif()
-
-#---
-# Building test apps optional.
-#---
-if(BUILD_OSSIM_TEST_APPS)
-  subdirs(src/test)
-endif()
-
-set(TARGET_COMMON_LIBRARIES ossim ${OPENTHREADS_LIBRARY})
-
-##################################################################################################
-#
-# Setup install destinations for the shared files:
-# 1) Projection CSV files:
-#
-##################################################################################################
-FILE(GLOB ossim_projection_codes_csv ${${PROJECT_NAME}_SOURCE_DIR}/share/ossim/projection/*.csv ${${PROJECT_NAME}_SOURCE_DIR}/share/ossim/projection/*.txt)
-INSTALL(FILES ${ossim_projection_codes_csv} DESTINATION share/ossim/projection COMPONENT ossim)
-
-# 2) Utility API JSON files
-FILE(GLOB ossim_util_api_json ${${PROJECT_NAME}_SOURCE_DIR}/share/ossim/util/*.json)
-INSTALL(FILES ${ossim_util_api_json} DESTINATION share/ossim/util COMPONENT ossim)
-
-###################### OUTPUT GENERAL VARIABLE SETTINGS #######################
-
-MESSAGE( STATUS "OSSIM_REVISION_NUMBER           = ${OSSIM_REVISION_NUMBER}" )
-MESSAGE( STATUS "BUILD_LIBRARY_DIR               = ${BUILD_LIBRARY_DIR}" )
-MESSAGE( STATUS "BUILD_RUNTIME_DIR               = ${BUILD_RUNTIME_DIR}" )
-MESSAGE( STATUS "BUILD_OSSIM_FREETYPE_SUPPORT    = ${BUILD_OSSIM_FREETYPE_SUPPORT}" )
-MESSAGE( STATUS "BUILD_OSSIM_APPS                = ${BUILD_OSSIM_APPS}" )
-MESSAGE( STATUS "BUILD_OSSIM_CURL_APPS           = ${BUILD_OSSIM_CURL_APPS}" )
-MESSAGE( STATUS "BUILD_OSSIM_TEST_APPS           = ${BUILD_OSSIM_TEST_APPS}" )
-MESSAGE( STATUS "CMAKE_BUILD_TYPE                = ${CMAKE_BUILD_TYPE}" )
-MESSAGE( STATUS "CMAKE_CXX_COMPILER              = ${CMAKE_CXX_COMPILER}" )
-MESSAGE( STATUS "CMAKE_CXX_FLAGS                 = ${CMAKE_CXX_FLAGS}" )
-MESSAGE( STATUS "CMAKE_CXX_FLAGS_DEBUG           = ${CMAKE_CXX_FLAGS_DEBUG}" )
-MESSAGE( STATUS "CMAKE_CXX_FLAGS_RELEASE         = ${CMAKE_CXX_FLAGS_RELEASE}" )
-MESSAGE( STATUS "CMAKE_INSTALL_PREFIX            = ${CMAKE_INSTALL_PREFIX}" )
-MESSAGE( STATUS "FREETYPE_LIBRARY                = ${FREETYPE_LIBRARIES}" )
-MESSAGE( STATUS "FREETYPE_INCLUDE                = ${FREETYPE_INCLUDE_DIRS}" )
-MESSAGE( STATUS "GEOTIFF_LIBRARY                 = ${GEOTIFF_LIBRARIES}" )
-MESSAGE( STATUS "GEOTIFF_INCLUDE                 = ${GEOTIFF_INCLUDE_DIR}" )
-MESSAGE( STATUS "GEOTRANS_LIBRARY                = ${GEOTRANS_LIBRARY}" )
-MESSAGE( STATUS "GEOTRANS_INCLUDE                = ${GEOTRANS_INCLUDE_DIR}" )
-MESSAGE( STATUS "GEOS_LIBRARY                    = ${GEOS_LIBRARY}" )
-MESSAGE( STATUS "GEOS_INCLUDE                    = ${GEOS_INCLUDE_DIR}" )
-MESSAGE( STATUS "JPEG_LIBRARY                    = ${JPEG_LIBRARIES}" )
-MESSAGE( STATUS "JPEG_INCLUDE                    = ${JPEG_INCLUDE_DIR}" )
-MESSAGE( STATUS "MPI_LIBRARY                     = ${MPI_LIBRARIES}" )
-MESSAGE( STATUS "MPI_INCLUDE                     = ${MPI_INCLUDE_PATH}" )
-MESSAGE( STATUS "OPENTHREADS_LIBRARY             = ${OPENTHREADS_LIBRARY}" )
-MESSAGE( STATUS "OPENTHREADS_INCLUDE             = ${OPENTHREADS_INCLUDE_DIR}" )
-MESSAGE( STATUS "OSSIM_COMPILE_WITH_FULL_WARNING = ${OSSIM_COMPILE_WITH_FULL_WARNING}" )
-MESSAGE( STATUS "OSSIM DEPENDENT LIBRARIES       = ${ossimDependentLibs}" )
-MESSAGE( STATUS "TIFF_LIBRARY                    = ${TIFF_LIBRARIES}" )
-MESSAGE( STATUS "TIFF_INCLUDE                    = ${TIFF_INCLUDE_DIR}" )
-MESSAGE( STATUS "ZLIB_LIBRARY                    = ${ZLIB_LIBRARIES}" )
-MESSAGE( STATUS "ZLIB_INCLUDE                    = ${ZLIB_INCLUDE_DIR}" )
-
-#-----------------------------------------------------------------------------
-# uninstall target
-#-----------------------------------------------------------------------------
-OSSIM_ADD_COMMON_MAKE_UNINSTALL()
-
-message("################## end of OSSIM core library setup #########################")
diff --git a/ossim/Doxyfile b/ossim/Doxyfile
deleted file mode 100644
index 5fb8742..0000000
--- a/ossim/Doxyfile
+++ /dev/null
@@ -1,1552 +0,0 @@
-# Doxyfile 1.7.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = "OSSIM - Open Source Software Image Map"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER         = "Version 1.8.17"
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = doc
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES        = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH        =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = YES
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE               = 4
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES                =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C  = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this
-# tag. The format is ext=language, where ext is a file extension, and language
-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING      =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT   = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE        = YES
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC         = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS       = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS       =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES        = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES       = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. The create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
-
-LAYOUT_FILE            =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS               = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC       = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE           =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT                  = include \
-                         src \
-                         ../ossim_plugins
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS          = *.cpp \
-                         *.h \
-                         *.cc \
-                         *.dox
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                = CVS \
-                         .svn
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       = *CVS*
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH           =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS       =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH             =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER           =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS        =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER         = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = YES
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX     = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX    = 4
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX          = ossim
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER            =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER            =
-
-# If the HTML_TIMESTAMP tag is set to YES then the generated HTML
-# documentation will contain the timesstamp.
-
-HTML_TIMESTAMP         = NO
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET        =
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP         = YES
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS     = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-
-GENERATE_DOCSET        = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP      = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE               =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION           =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI           = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING     =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND             = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE               =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE          = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME   =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
-# Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS  =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
-# Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS  =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION           =
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX          = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW      = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES       = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH         = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE       = 10
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE           = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX         = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE             = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES         =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER           =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS         = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX           = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE        = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE      = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE    =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE    =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION          = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA             =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD                =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION        = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF     = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH           =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS  =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED             =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED      =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES               =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE       =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS        = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH            =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT               = NO
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME           = FreeSans.ttf
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH           =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK               = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH          = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT       = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH               =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS           =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP            = YES
diff --git a/ossim/LICENSE.txt b/ossim/LICENSE.txt
deleted file mode 100644
index dfa18e3..0000000
--- a/ossim/LICENSE.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-The MIT License (MIT)
-
-Copyright (c) 2015 OSSIM Labs
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
diff --git a/ossim/OSSIM_logo.png b/ossim/OSSIM_logo.png
deleted file mode 100644
index b3a9d07..0000000
Binary files a/ossim/OSSIM_logo.png and /dev/null differ
diff --git a/ossim/README.txt b/ossim/README.txt
deleted file mode 100644
index 14e3e84..0000000
--- a/ossim/README.txt
+++ /dev/null
@@ -1,148 +0,0 @@
-
-OSSIM - Open Source Software Image Map
-
-Introduction:
-
-OSSIM, pronounced "awesome" is an open source project to
-develop a state of the art set of libraries and tools for remote
-sensing and geographic information systems.A test application,
-OSSIM, is included in the distribution to showcase the
-functionality of the libraries. For a complete list of OSSIM
-functionality, point your Internet web browser to
-http://www.ossim.org
-
-
-Environmental Variables:
-
-The various builds will use the following environmental variables, set them to point to the relevant paths in your development environment:
-
-OSSIM_DEPENDENCIES // This should be one up from OSSIM_HOME.
-OSSIM_HOME 
-OSSIM_PREFS_FILE
-
-for example, in .bashrc on the mac
-
-export OSSIM_HOME=/Users/Shared/Development/ossim
-export OSSIM_PREFS_FILE=/Users/mrl/ossim_preferences
-
-Other useful Environmental variables you might want to set for OSSIM related builds:
-
-QT_HOME
-
-
-
-Binary distributions and source packages are available from sourceforge at:
-http://sourceforge.net/project/showfiles.php?group_id=5891
-
-Getting the source code via cvs, this includes get external packages that
-we need/like to have:
-
-//---
-// cd into some work directory.  I like to put all packages parallel to 
-// each other.
-//---
-
-//---
-// Get external packages we like to have.  If you have these installed already
-// you just need to tell ossim where they're at...  In most cases if you 
-// install these parallel to ossim they will be found during a "./configure"
-//---
-
-// Get OpenThreads if not installed already (now a required library):
-svn co http://www.openscenegraph.org/svn/osg/OpenThreads/trunk OpenThreads
-
-// Login to maptools cvs pserver
-cvs -d :pserver:cvsanon at cvs.maptools.org:/cvs/maptools/cvsroot login
-password:  <hit return for password>
-
-// Get libtiff
-cvs -d :pserver:cvsanon at cvs.maptools.org:/cvs/maptools/cvsroot co libtiff
-
-// The geotiff source code is available via svn (subversion) server on:
-http://svn.osgeo.org/metacrs/geotiff/trunk/libgeotiff
-
-// Get geotiff:
-svn co http://svn.osgeo.org/metacrs/geotiff/trunk/libgeotiff
-
-// The gdal source code is available via svn (subversion) server on
-http://svn.osgeo.org/gdal/trunk/gdal
-
-// Get gdal:
-svn co http://svn.osgeo.org/gdal/trunk/gdal gdal
-
-// Logout of cvs pserver
-cvs -d :pserver:cvsanon at cvs.maptools.org:/cvs/maptools/cvsroot logout
-
-// The ossim source code is available via svn (subversion) server on:
-http://svn.osgeo.org/ossim
-
-// Get ossim core
-svn co http://svn.osgeo.org/ossim/trunk/ossim ossim
-
-// Get ossim_qt - this is the old QT3.x gui module with imagelinker and iview
-svn co http://svn.osgeo.org/ossim/trunk/ossim_qt ossim_qt
-
-// Get ossim_qt4 - this is the QT4.x port of imagelinker and iview
-svn co htts://svn.osgeo.org/ossim/trunk/ossim_qt4 ossim_qt4
-
-// Get ossim_plugins
-svn co http://svn.osgeo.org/ossim/trunk/ossim_plugins ossim_plugins
-
-// Elevation geoid grid: egm96.grd (you will need this if you don't have)
-svn co http://svn.osgeo.org/ossim/trunk/ossim_package_support/geoids geoids
-
-//---
-// Building on unix like machines, linux, sunos and so on.
-// Note my workspace directory is "/work/drb".  You should change that out
-// to be yours...
-//---
-
-//---
-// Build libtiff:
-// Note that ossim requires "libtiff", won't build without it.  Most systems
-// have libtiff installed.  If you need to build it follow directions 
-// below.
-// 
-// Official website at:  
-// http://www.remotesensing.org/libtiff
-// 
-// LIBTIFF Notes:
-// My libtiff is in "/work/drb/libiff".  The --prefix will tell it to install
-// there rather than user local.
-//---
-cd /work/drb/libtiff
-cvs -z 3 update -d -P
-./configure --prefix=/work/drb/libtiff
-make
-make install
-
-//---
-// Build geotiff:
-// Note that ossim does not require geotiff; however, it is nice to have.
-// Without it none of you geotiffs will be placed on the ground correctly.
-// Official website at:  
-// http://www.remotesensing.org:16080/websites/geotiff/geotiff.html
-//---
-cd /work/drb/geotiff/libgeotiff
-cvs -z 3 update -d -P
-./configure --prefix=/work/drb/geotiff --with-libtiff=/work/drb/libtiff 
-make 
-make install
-cd ../..
-
-cd /work/drb/ossim
-cvs -z 3 update -d -P
-./configure
-make depends;
-make
-
-//---
-// Sample configure line to build single static libossim.a and static 
-// applications.  (linux Fedora Core 3)
-// Notes:
-// 1) Mpi and freetype were shut off since there were no static 
-//    libraries on my machine.
-// 2) libtiff and geotiff packages were explicitly set since there were not
-//    parallel to the static ossim build.
-//---
-./configure --enable-singleStaticOssimLibrary=yes --enable-singleSharedOssimLibrary=no --with-mpi=no --with-freetype=no --with-libtiff=/work/drb/libtiff --with-geotiff=/work/drb/geotiff --enable-staticOssimApps
diff --git a/ossim/doc/ossim.spec b/ossim/doc/ossim.spec
deleted file mode 100644
index 1447ca0..0000000
--- a/ossim/doc/ossim.spec
+++ /dev/null
@@ -1,78 +0,0 @@
-# $Id: ossim.spec 23668 2015-12-14 20:11:00Z rashadkm $
-# $crtd:  by  Derald Metzger  on  000226 $
-# $cmnt:  spec file for ossim $
-
-# Preamble
-Summary: Open Source Software Image Map
-Name: ossim
-Version: 0.999.7
-Release: 1
-Copyright: GPL MIT
-Group: Applications/Image
-Source: ftp://ftp.remotesensing.org/pub/ossim/%{name}-%{version}.tgz
-URL: http://www.remotesensing.org/ossim/
-Distribution: na
-Vendor: imagelinks.com
-Packager: Derald Metzger <dmetz at remotesensing.org>
-BuildRoot: %{_tmppath}/%{name}-%{version}
-#Provides: 
-#Requires: 
-
-%description
- ######--- This is alpha stage development code. ---######
- OSSIM (Open Source Software Image Map) project. 
-Pronounced "awesome", the OSSIM project leverages existing open source 
-algorithms, tools, and packages to construct an integrated library for 
-remote sensing, image-processing, and Geographical Information Sciences (GIS) 
-analysis.
-
-%prep
-%setup
-rm -r `find . -name CVS -print`
-
-%build
-./configure \
-    --prefix=%{_prefix} \
-    --with-grass=no \
-    --without-python
-make
-
-%install
-make \
-  version=%{version} \
-  prefix=$RPM_BUILD_ROOT%{_prefix} \
-  sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} \
-  install
-
-%changelog
-* Wed Feb 08 2001  Derald Metzger <dmetz at remotesensing.org>
--UPDATE pkg to 0.999.7-1
-  The ossim dir tree has been extensively reconfigured.
-* Thu Dec 28 2000  Derald Metzger <dmetz at remotesensing.org>
--UPDATE pkg to 0.999.3-1
-  The 0.999 is meant to imply preliminary code (alpha or beta).
-  The .3-1 is the 3rd preliminary version and first rpm release of it. 
-- Remove $BR build root stuff from Makefile. Use make var defs on cmdline.
-- Macroized and updated the files manifest
-- Added config dir etc/ossim
-- Added doc dir
-- Removed lib/ossim - linking statically
-* Thu Aug 31 2000  Derald Metzger <dmetz at remotesensing.org>
--pkg 0.2.0a-2  Rebuild with wxGTK-2.2.1-0.
-* Sat Aug 26 2000  Derald Metzger <dmetz at remotesensing.org>
--pkg 0.2.0a-1  Snapshot of current alpha code
-* Thu May 23 2000  Derald Metzger <dmetz at remotesensing.org>
--PACKGED 0.0.0-1
-- rpm'd ossim. Started version at 0.0.0
-
-%files
-%defattr(-,root,root)
-%{_bindir}/%{name}
-%doc %{_docdir}/%{name}-%{version}/
-%config %{_sysconfdir}/%{name}
-
-
-
-
-
-
diff --git a/ossim/etc/linux/profile.d/ossim.csh b/ossim/etc/linux/profile.d/ossim.csh
deleted file mode 100644
index 11e1502..0000000
--- a/ossim/etc/linux/profile.d/ossim.csh
+++ /dev/null
@@ -1,18 +0,0 @@
-#---
-# Open Source Software Image Map(OSSIM) initialization script (csh).
-#---
-if ( ! $?OSSIM_INSTALL_PREFIX ) then
-   setenv OSSIM_INSTALL_PREFIX "/usr"
-endif
-
-if ( ( ! $?OSSIM_PREFS_FILE ) then
-   setenv OSSIM_PREFS_FILE $OSSIM_INSTALL_PREFIX/share/ossim/ossim-site-preferences
-endif
-
-#---
-# Stub to set path on standard install:
-#---
-# set ossim_bin=/usr/local/ossim/bin
-# if ( "${path}" !~ *$ossim_bin* ) then
-#   set path = ( $ossim_bin $path )
-# endif
diff --git a/ossim/etc/linux/profile.d/ossim.sh b/ossim/etc/linux/profile.d/ossim.sh
deleted file mode 100644
index f02c898..0000000
--- a/ossim/etc/linux/profile.d/ossim.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#---
-# Open Source Software Image Map(OSSIM) initialization script (sh).
-#---
-if [ -z "$OSSIM_INSTALL_PREFIX" ]; then
-   export OSSIM_INSTALL_PREFIX=/usr
-fi
-
-if [ -z "$OSSIM_PREFS_FILE" ]; then
-   export OSSIM_PREFS_FILE=$OSSIM_INSTALL_PREFIX/share/ossim/ossim-site-preferences
-fi
-
-#---
-# Stub to set path on standard install:
-#---
-# ossim_bin=/usr/local/ossim/bin
-# if ! echo ${PATH} | /bin/grep -q $ossim_bin ; then
-#    PATH=$ossim_bin:${PATH}
-# fi
-# export PATH
diff --git a/ossim/etc/templates/ossim_preferences_template b/ossim/etc/templates/ossim_preferences_template
deleted file mode 100644
index e2e35c8..0000000
--- a/ossim/etc/templates/ossim_preferences_template
+++ /dev/null
@@ -1,585 +0,0 @@
-// ------------------------------------------------------------------------
-// 
-// Description:  ossim_preferences_template
-// 
-// This file will be automatically loaded by ossim applications provided the
-// environment variable "OSSIM_PREFS_FILE" is set to point to some form of 
-// this file.
-//
-// Note:  c++ comments "//" can be used to comment a line.
-//
-// To set the environment variable for automatic preference file loading:
-//
-// This assumes a preference file in your home called "ossim_preferences".
-// Typically this would be put in a dot file read at startup of a shell.
-//
-// tcsh and csh users:  setenv OSSIM_PREFS_FILE ~/ossim_preferences
-//
-// bash and sh users:   export OSSIM_PREFS_FILE=~/ossim_preferences
-// 
-// windoze users:       I'll have to look this up...
-//
-// You can also use the "-P <preference_file>" option at application startup.
-// where <preference_file> is full path and filename.
-//
-// Note that system environment variables found in this ossim preferences
-// file in the format "$(env_var_name)" will be expanded in place.
-//
-// To view your preferences use below command.  This is useful when trouble
-// shooting paths and so on:
-//
-// $ ossim-info --config
-// 
-// ------------------------------------------------------------------------
-
-//---
-// Elevation setup:
-//
-// Keyword pair: 
-// elevation_source.type
-// elevation_source.filename 
-// 
-// Indicates an elevation source.  These should be listed in pairs.  Numbering
-// should start with 0 with lowest number being the highest resolution.  This
-// can be a cell(file) or a directory.
-// 
-// There are four elevation_source.type types:
-// elevation_source.type: dted_directory
-// elevation_source.type: srtm_directory
-// elevation_source.type: general_raster_directory
-// 
-// The elevation_source.connection_string is a connection for your database.
-// Typically this is a directory location.
-// 
-// NOTES:
-// 
-// 1) Order dependent, i.e. ALWAYS put your highest resolution first.
-// 
-// 2) The elevation_source keyword replaces the deprecated keywords:
-// dted_directory
-// image_directory
-// srtm_directory
-// dted_cell 
-//
-// 3) We support bringing cells into memory for dted and srtm datasets.  You can also control the
-// number of open cells by specifying a min and max open cells.  If the number of cells opened
-// exceeds the maximum then it will shrink the active opened cells to the minumum.  We currently
-// use a least recently used algorithm.
-// 
-// 4) A good elevation source is the Shuttle Radar Topographic Mission(SRTM):
-//    http://srtm.usgs.gov/index.php
-
-// 5) Examples below are defaulted to some value.  To change enabled key to
-//    true, e.g.:
-//    elevation_manager.elevation_source0.enabled: true
-//    
-//---
-
-elevation_manager.elevation_source0.connection_string: $(OSSIM_DATA)/elevation/dted/level2
-elevation_manager.elevation_source0.enabled: true
-elevation_manager.elevation_source0.type: dted_directory
-elevation_manager.elevation_source0.min_open_cells: 25
-elevation_manager.elevation_source0.max_open_cells: 50
-elevation_manager.elevation_source0.memory_map_cells: false
-elevation_manager.elevation_source0.geoid.type: geoid1996
-
-elevation_manager.elevation_source1.connection_string: $(OSSIM_DATA)/elevation/srtm/1arc
-elevation_manager.elevation_source1.enabled: true
-elevation_manager.elevation_source1.type: srtm_directory
-elevation_manager.elevation_source1.min_open_cells: 25
-elevation_manager.elevation_source1.max_open_cells: 50
-elevation_manager.elevation_source1.memory_map_cells: false
-elevation_manager.elevation_source1.geoid.type: geoid1996
-
-elevation_manager.elevation_source2.connection_string: $(OSSIM_DATA)/elevation/dted/level1
-elevation_manager.elevation_source2.enabled: true
-elevation_manager.elevation_source2.type: dted_directory
-elevation_manager.elevation_source2.min_open_cells: 25
-elevation_manager.elevation_source2.max_open_cells: 50
-elevation_manager.elevation_source2.memory_map_cells: false
-elevation_manager.elevation_source2.geoid.type: geoid1996
-
-elevation_manager.elevation_source3.connection_string: $(OSSIM_DATA)/elevation/srtm/3arc
-elevation_manager.elevation_source3.enabled: true
-elevation_manager.elevation_source3.type: srtm_directory
-elevation_manager.elevation_source3.min_open_cells: 25
-elevation_manager.elevation_source3.max_open_cells: 50
-elevation_manager.elevation_source3.memory_map_cells: false
-elevation_manager.elevation_source3.geoid.type: geoid1996
-
-elevation_manager.elevation_source4.connection_string: $(OSSIM_DATA)/elevation/dted/level0
-elevation_manager.elevation_source4.enabled: true
-elevation_manager.elevation_source4.type: dted_directory
-elevation_manager.elevation_source4.min_open_cells: 25
-elevation_manager.elevation_source4.max_open_cells: 50
-elevation_manager.elevation_source4.memory_map_cells: true
-elevation_manager.elevation_source4.geoid.type: geoid1996
-
-// "image_directory" can be any type of image, i.e. tiff, nitf and so on.
-// elevation_manager.elevation_source5.connection_string: $(OSSIM_DATA)/elevation/some_dir
-// elevation_manager.elevation_source5.enabled: false
-// elevation_manager.elevation_source5.type: image_directory
-// elevation_manager.elevation_source5.min_open_cells: 25
-// elevation_manager.elevation_source5.max_open_cells: 50
-// elevation_manager.elevation_source5.memory_map_cells: false
-// elevation_manager.elevation_source5.geoid.type: geoid1996
-
-
-//---
-// Identity geoid is 0 everywhere, so MSL = Ellipsoid. Useful when DEM
-// provides posts relative to ellipsoid instead of customary MSL. This is
-// specific to each elev database:
-//---
-// elevation_manager.elevation_source3.geoid.type: identity
-
-//---
-// Default height above ellipsoid, for use when no elev data is present, 
-// instead of returning NAN:
-//---
-// elevation_manager.default_height_above_ellipsoid: 0.0
-
-// ---
-// This is n elevation offset that is added to the height returned from the
-// elevation manager.
-// if the value is nan then nothing is added.
-// ---
-//elevation_manager.elevation_offset: nan
-
-//---
-// Allows one to specify to the elevation manager to use the ellipsoid offset
-// as defined by the geoid manager if a getHeightAboveEllipsoid fails.
-//---
-elevation_manager.use_geoid_if_null: true
-
-//---
-// Keyword:  default_elevation_path
-// Default path for the elevation manager popup "Add" to start at.
-//---
-default_elevation_path: $(OSSIM_DATA)/elevation/dted/level2 
-// ---
-
-//---
-// Keyword:  elevation.enabled
-// If disabled calls to the elevation manager getHeightAboveMSL and 
-// getHeightAboveEllipsoid will return a null height.  (default=true)
-// Use: "true", "yes", "y" or "1" to enable, 
-//      "false", "no", "n" or "0" to disable.
-//---
-elevation_manager.enabled:  true
-
-//---
-// Keyword:  elevation.threads
-// Defines the number of instances of elevation databases to maintain for multithreading.
-// Can be boolean "yes" or "true" to use all available cores or an integer value for
-// custom experimentation. Set to "no" (or "false") or 1 for no multithreading capability. 
-// Default is "true".
-//---
-elevation_manager.threads: yes                 
-
-// ---
-// Location of datum grids:
-//
-// Snip from: http://www.ngs.noaa.gov/TOOLS/Nadcon/Nadcon.html
-// 
-// Advances in the accuracies now obtainable in geodetic surveys, specifically
-// through use of differential GPS, has allowed for the creation of state 
-// High Precision Geodetic Networks (HPGNs), also referred to as High Accuracy
-// Reference Networks (HARNs) throughout the country.
-// 
-// Latest ftp location(20100206):
-// ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon/
-//
-// ---
-// datum_grids: $(OSSIM_DATA)/ossim/elevation/nadcon-grids
-
-//---
-// Look-up tables for European Petroleum Survey Group (EPSG) coded 
-// projections and datums.
-// These are expected to be delimiter-separated value (*.csv|tsv) files.
-// NOTE: ESRI codes are NOT EPSG codes, however, they do not conflict with 
-// EPSG so ingesting them as if they were EPSG. Eventually, separate 
-// databases or a multi-Db solution may need to be 
-// implemented. OLK 05/2010
-// --- 
-epsg_database_file0: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_epsg_projections-v7_4.csv
-epsg_database_file1: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_harn_state_plane_epsg.csv
-epsg_database_file2: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_state_plane_spcs.csv
-epsg_database_file3: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_harn_state_plane_esri.csv
-
-// Database file for WKT-based projection factory:
-wkt_database_file: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_wkt_pcs.csv
-
-//---
-// Geoid support:
-// Note:  Since the sensor models do earth intersects at height above the 
-//        ellipsoid and the vertical datum of DTED is geoid_egm_96_grid, you
-//        should have a geoid grid in place for accurate earth intersections.
-//---
-
-//---
-// Generic geoid support:
-// Specifying a "geoid_manager.geoid_source0.type: geoid_image" uses an image handler
-// based geoid reader.  So this can be any type of image, i.e. tiff, raster, provided
-// it can be opened and a good image geometry is returned.
-// 
-// In the below example for geoid_manager.geoid_source0 an external geometry file was
-// created for Und_min1x1_egm2008_isw_equal_82_WGS84_TideFree_SE.ras.
-//---
-geoid_manager.geoid_source0.connection_string: $(OSSIM_DATA)/elevation/geoids/egm2008/Und_min1x1_egm2008_isw_equal_82_WGS84_TideFree_SE.ras
-geoid_manager.geoid_source0.enabled: true
-geoid_manager.geoid_source0.geoid.type: egm2008
-geoid_manager.geoid_source0.memory_map: false
-geoid_manager.geoid_source0.type: geoid_image
-
-//---
-// GEOID 99:  Set keyword to the directory containing the GEOID 99 grids.
-// 
-// Notes:  
-// - Grids MUST be in the native byte order.
-// - Can be downloaded from:
-// http://www.ngs.noaa.gov/GEOID/GEOID99
-// ---
-// geoid_99_directory:  $(OSSIM_DATA)/ele1/geoid/geoid99
-
-//---
-// Generic support has been added to each NGS geoid grid. You can download
-// ngs grids for 1999, 2003.
-// Current release only allows for a single directory we will allow for
-//  multiple directories later and auto detecting if possible.
-//
-// Currently the file names are hard coded and need to be from the NGS 
-// distribution also downloadable from ftp.remotesensing.org under
-// /ossim/test_data.tgz
-//---
-geoid_ngs_directory: $(OSSIM_DATA)/elevation/geoids/geoid99
-geoid_ngs_directory.byte_order: little_endian
-// geoid_ngs_directory.byte_order: big_endian
-
-//---
-// GEOID EGM 96:  Set keyword to the path to the egm96.grd
-// 
-// Notes:
-// - Grid must be in BIG ENDIAN (UNIX) format.
-// - Can be downloaded from svn:
-// svn co http://svn.osgeo.org/ossim/trunk/ossim_package_support/geoids geoids
-//---
-geoid_egm_96_grid: $(OSSIM_INSTALL_PREFIX)/share/ossim/geoids/geoid1996/egm96.grd
-
-//---
-// Location of other shared files can be accessed using this preference to permit 
-// specifying paths relative to it.
-//---
-ossim_share_directory: $(OSSIM_INSTALL_PREFIX)/ossim/share
-
-// ---
-// Font support:
-// NOTE:  To use the MapCompositionSource you must at least have "font.dir1"
-//        set to some default.
-// ---
-// font.file1: /usr/share/fonts/default/Type1/b018032l.pfb
-// font.dir1: /usr/share/fonts/default/Type1
-
-
-//---
-// OSSIM plugin support:
-//
-// Notes:  
-//
-// Notes:
-//
-// View plugins with:
-//
-// $ ossim-info --plugins
-//
-// To troubleshoot problems  embedded trace debug can be turned on using 
-// "ossimDynamic"
-//
-// $ ossim-info -T ossimDynamic --plugins 
-//
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimpng_plugin.so
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimgdal_plugin.so
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimreg_plugin.so
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimcontrib_plugin.so
-//
-// Keywords:
-//
-// plugin.dir1:  < directory where plugins are >
-//
-// you can also list by individual file names
-//
-// plugin.file1: < full path and file name >
-//---
-// Example, edit/uncomment as needed:
-plugin.file0: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimpng_plugin.so
-plugin.file5: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimkakadu_plugin.so
-plugin.file10: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimmrsid_plugin.so
-plugin.file15: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_plugin.so
-
-// Old hdf4/5 plugin:
-// plugin.file20: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimhdf_plugin.so
-
-// New split out hdf plugins
-plugin.file20: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimhdf5_plugin.so
-plugin.file23: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimhdf4_plugin.so
-
-plugin.file25: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimsqlite_plugin.so
-plugin.file30: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimlas_plugin.so
-plugin.file40: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimweb_plugin.so
-plugin.file45: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimkmlsuperoverlay_plugin.so
-plugin.file50: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimndf_plugin.so
-plugin.file55: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimgeopdf_plugin.so
-plugin.file60: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimopencv_plugin.so
-plugin.file65: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimgdal_plugin.so
-
-// plugin.file5: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimreg_plugin.so
-// plugin.file6: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimcontrib_plugin.so
-// 
-//
-// We also support a second style that allows one to pass options to any
-// plugins that support them
-// the options param is an embedded keywordlist that is surrounded by triple
-// quotes:
-// plugin0.file: <path to>/libossimkakadu_plugin
-// plugin0.options: """
-//                  read_factory.location: front
-//                  writer_factory.location: back
-//                  """
-//
-// END OSSIM plugin support
-//---
-
-// Toggles for recceVue application:
-statusLatLon: true
-statusHeight: true
-statusDatum: true
-statusGSD: true
-statusUpdateOnClick: true
-
-
-// ---
-// Keyword: cache_size
-// The cache size is in megabytes.
-// ---
-cache_size: 256
-// cache_size: 512
-// cache_size: 1024
-// cache_size: 2048
-
-
-// ---
-// Keyword: overview_stop_dimension
-//
-// Affects any overview building from img2rr, imagelinker, iview. Controls
-// the amount of resLevels created.  This is also used to control the amount
-// of levels the J2K writers use from the kakadu plugin.
-// 
-// This is the point where "img2rr" or the overview builder will stop 
-// decimating the image down.  So in other words, if the 
-// overview_stop_dimension keyword is 64, img2rr application will build 
-// overviews, decimating each level by 2 until both the width and height are 
-// less than or equal to 64.  Note the larger the dimension the less levels
-// created.
-// 
-// Uncomment one below.
-// ---
-overview_stop_dimension: 8
-// overview_stop_dimension: 16
-// overview_stop_dimension: 32
-// overview_stop_dimension: 64
-// overview_stop_dimension: 128
-// overview_stop_dimension: 256
-// overview_stop_dimension: 512
-
-// ---
-// Keyword: overview_builder.scan_for_min_max_null_if_float
-// 
-// Control overview sequencer scanning for min, max, nulls for float data. If
-// true and input data is float scalar type scanning will be performed and a
-// dot.omd file will be written with the min, max, nulls in it.
-// 
-// Type: boolean, set to true, false, 1, 0
-// 
-// CAUTION: Because the j2k overview builder requires the min/max up front for 
-// normalization this is NOT a good option to turn on.  In other word if you
-// are doing ossim-img2rr -r -t ossim_kakadu_nitf_j2k <float-image> you should
-// disable this and set the min/max with ossim-cmm(compute min max) or do it
-// manually.
-// ---
-// overview_builder.scan_for_min_max_null_if_float: true
-
-// ---
-// Keyword: tile_size
-//
-// Tile size x y
-//
-// Affects all ossim application.  This is the internal tile size of any
-// image chain unless overridden by the filter.
-// 
-// Notes: 
-// 1) OSSIM can handle any tile size; however it is best to use a size that
-// is a power of two.
-// 2) 
-// 
-// Uncomment one below.  
-// ---
-// tile_size: 32 32
-// tile_size: 64 64
-// tile_size: 128 128
-tile_size: 256 256
-// tile_size: 512 512
-// tile_size: 1024 1024
-
-
-// ---
-// Keyword: shapefile_colors_auto
-// 
-// Shape file colors set to automatic.
-// This is a boolean value.  If true pen and brush color of shape files will
-// be determined by indexing a color table in a round robin approach.  If set 
-// to true the auto colors override keywords for "pen" and "brush" color.
-// Default value if not found if "false".
-// 
-// Value can be: true, yes, y, 1, false, no, n or 0
-// ---
-shapefile_colors_auto: false
-
-// ---
-// Shape file pen color:
-// Three values for red, green and blue between 0 and 1.0 with 1.0 being 
-// brightness and 0.0 being black.
-// ---
-shapefile_normalized_rgb_pen_color: 0.004 1.0 0.004
-
-// ---
-// Shape file pen color:
-// Three values for red, green and blue between 0 and 1.0 with 1.0 being 
-// brightness and 0.0 being black.
-// ---
-shapefile_normalized_rgb_brush_color: 0.004 1.0 0.004
-
-// ---
-// Shape file point size:
-// Width and height for points in pixels.
-// ---
-shapefile_point_size: 6.0 6.0
-
-
-// --------------------------
-// Some keywords for the OSSIM GUI application
-//
-//
-// igen spec files output./  This is the directory location you would
-// like the igen export GUI to default to when outputing spec files
-ossim.igen_spec_output_directory: /work/gpotts/igen_test
-
-// this is the igen executable.  Make sure you put the full path
-ossim.igen_executable:  /work/gpotts/ossim/bin/igen
-
-// END keywords for OSSIM GUI
-//--------------------------
-
-// ---
-// Position Quality Evaluator (PQE) keywords. 
-// Note Circulay Error(CE) and Linear Error (LE)  units are in meters.
-// These keywords are for the imagelinker->image-window->PQE dialog box.
-// They allow the user to calculater position quality factoring in backdrop
-// and elevation uncertainty.
-// ---
-
-// Backdrop enter "name,ce90,le90" like "JOG-A,77,38".
-pqe_backdrop1: TLM50,31,25
-pqe_backdrop2: TLM100,61,25
-pqe_backdrop3: JOG-A,77,38
-pqe_backdrop4: TPC,613,47
-pqe_backdrop5: ONC,1226,93
-pqe_backdrop6: JNC,2452,187
-pqe_backdrop7: GNC,6129,465
-
-// Elevation enter "name,ce90,le90" like "SRTM_1ARC,20,16"
-// Accuracies vary widely depending on terrain and how they were computed.
-// These are just examples.
-pqe_elev1: SRTM_3ARC,20,16
-pqe_elev2: SRTM_1ARC,20,10
-pqe_elev3: DTED_LEVEL2,40,20
-pqe_elev4: DTED_LEVEL1,50,30
-pqe_elev5: RPC_No_DEM_State,-2,-1.6449
-// Special Case
-// RPC_No_DEM_State, Scale Divisor, 1-Sigma Divisor (minus signs required)
-
-pqe_normalized_rgb_ellipse_color: 0.004 1.0 0.004
-
-// End of PQE keywords...
-
-// ---
-// Log file support:  If set all output from ossimNotify to stdout and to 
-// stderr will be written to the log file.  Optionally users of ossim 
-// applications can use the "--ossim-logfile <some_file>" command line 
-// argument.  Note that the "--ossim-logfile" command line argument overrides
-// the preference setting.
-// 
-// Uncomment and set path to use log file:
-// ---
-// ossim.log.file: D:\tmp\ossim-log.txt
-
-// ---
-// Kakadu threads:
-// ---
-kakadu_threads: 4
-
-// ---
-// ossim threads:
-// ---
-ossim_threads: 4
-
-//---
-// Keyword for ingesting terrasar-x and radarsat-2 data. When TRUE, instructs
-// the sensor model to create an ossim coarse grid replacement model to
-// improve performance geometric_sar_sensor_model.create_ocg: true
-// Keyword parsed presently by orthoigen. If true, histograms will be
-// computed when needed for all images that do not yet have a histogram. 
-//---
-autogenerate_histogram: true
-
-//---
-// specify true or fals if you want the ossimInit to look in the current 
-// program path to see if any plugins are available.  Turn this off if you 
-// want to load them from a keyword list and remove the need to scan the 
-// directory for valid plugins
-//---
-ossim_init.auto_load_plugins: false
-
-//---
-// When true, indicates to orthoigen application that the specified cut
-// rectangle for the product shall be adjusted to fit the minimum bounding
-// valid image rect. This eliminates null exterior pixels when the cut rect
-// extends beyond the valid image rect. This preference can be overriden
-// by an option on the orthoigen command line. See the usage on orthoigen.
-// [default is false]
-//---
-orthoigen.clip_to_valid_rect: false
-
-//---
-// Specifies the preference for remapping null-valued pixels to 1 (min).
-// Possible settings are:
-// "none" -- Bypasses pixel flipper
-// "all_nulls" -- replaces any occurrence of the null value with 1. 
-//    Ex: (20,0,10) becomes (20,1,10), also (0,0,0) becomes (1,1,1)
-// "only_partial_nulls" -- 
-// replaces null-valued band only if another band is non-null.
-//    Ex: (20,0,10) becomes (20,1,10), but (0,0,0) is not remapped.
-// "all_bands_if_partial_null" -- 
-// Remaps all bands of a pixel if even one band is null.
-//    Ex: (20,0,10) becomes (1,1,1), but (0,0,0) is not remapped
-// "only_full_nulls" -- Remaps pixel only if all bands are null.
-//    Ex: (0,0,0) becomes (1,1,1), but (20,0,10) is not remapped
-//---
-orthoigen.flip_null_pixels: none
-
-// ---
-// NITF writer site configuration file:
-// ---
-// nitf_writer.site_configuration_file: $(OSSIM_DATA)/ossim/share/nitf-site-configuration.kwl
diff --git a/ossim/include/ossim/base/ossim2dTo2dIdentityTransform.h b/ossim/include/ossim/base/ossim2dTo2dIdentityTransform.h
deleted file mode 100644
index 146a1b9..0000000
--- a/ossim/include/ossim/base/ossim2dTo2dIdentityTransform.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:  Contains class definition for ossim2dTo2dIdentityTransform.
-// 
-//*******************************************************************
-//  $Id$
-#ifndef ossim2dTo2dIdentityTransform_HEADER
-#define ossim2dTo2dIdentityTransform_HEADER
-#include "ossim2dTo2dTransform.h"
-/**
- * This is the identity transform and just passes the input to the output.
- */
-class OSSIM_DLL ossim2dTo2dIdentityTransform : public ossim2dTo2dTransform
-{
-public:
-   /**
-    * forward transform just passes the point to the output.
-    */
-   virtual void forward(const ossimDpt& input,
-                        ossimDpt& output) const
-   {
-      output = input;
-   }
-   
-   /**
-    * forward transform nothing is modified on the input point.
-    */
-   virtual void forward(ossimDpt&  /* modify_this */) const
-   {
-      // do nothing this is identity
-   }
-   
-   /**
-    * inverse transform just passes the point to the output.
-    */
-   virtual void inverse(const ossimDpt& input,
-                        ossimDpt&       output) const
-   {
-      output = input;
-   }
-   
-   /**
-    * inverse transform nothing is modified on the input point.
-    */
-   virtual void inverse(ossimDpt&  /* modify_this */) const
-   {
-      // do nothing this is identity
-   }
-   
-   /**
-    * Pass equality to the parent
-    */
-   virtual const ossim2dTo2dIdentityTransform& operator=(
-                                                 const ossim2dTo2dIdentityTransform& rhs)
-   {
-      ossim2dTo2dTransform::operator =(rhs);
-      
-      return *this;
-   }
-   
-protected:
-   TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossim2dTo2dMatrixTransform.h b/ossim/include/ossim/base/ossim2dTo2dMatrixTransform.h
deleted file mode 100644
index f06e95a..0000000
--- a/ossim/include/ossim/base/ossim2dTo2dMatrixTransform.h
+++ /dev/null
@@ -1,221 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:
-//
-// Description: 
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossim2dTo2dMatrixTransform_HEADER
-#define ossim2dTo2dMatrixTransform_HEADER 1
-
-#include <ossim/base/ossim2dTo2dTransform.h>
-#include <algorithm>
-
-/**
- * ossim2dTo2dMatrixTransform allows one to specify a set of input points and output points
- * and will fit a bilinear transform to those points.  Function of the form is solved for each  
- * output dimension.
- *
- * z(x,y) = a + b*x + c*y + d*x*y
- *
- * We use the ossimLeastSquareBilin solver to solve for the coefficients.
- *
- */
-class OSSIM_DLL ossim2dTo2dMatrixTransform : public ossim2dTo2dTransform
-{
-public: 
-
-   /**
-    * Initialize to the identity
-    */
-   ossim2dTo2dMatrixTransform();
-   
-   /**
-    * Initialize the transform that best fits the input and output arrays.  
-    * If the input and output are well dispersed and are 4 points it should fit
-    * exactly.  Both arrays should be of equal number of points
-    *
-    * @param input the list of input points
-    * @param output the list of output points to transform the input to
-    * @param arraySize the number of points for the arrays.
-    */
-   ossim2dTo2dMatrixTransform(const ossimDpt* input,
-                            const ossimDpt* output, 
-                            ossim_uint32 arraySize)
-   {
-      setFromPoints(input, output, arraySize);
-   }
-   
-   /**
-    * Mapping 4 corners to an output 4 corners.
-    *
-    */
-   ossim2dTo2dMatrixTransform(const ossimDpt& in1, const ossimDpt& in2, const ossimDpt& in3, const ossimDpt& in4,
-                            const ossimDpt& out1, const ossimDpt& out2, const ossimDpt& out3, const ossimDpt& out4)
-   {
-      setFromPoints(in1, in2, in3, in4, out1, out2, out3, out4);
-   }
-   
-   /**
-    * Copy constructor
-    */
-   ossim2dTo2dMatrixTransform(const ossim2dTo2dMatrixTransform& src);
-   
-   /**
-    * Duplication method that duplicates this object
-    */
-   virtual ossimObject* dup()const{return new ossim2dTo2dMatrixTransform(*this);}
-   
-   /**
-    * Overloaded operator equal that allows for assignment.
-    *
-    * @param src the src data to copy into this object.  It will call the base classes
-    * equal operator.
-    */
-   const ossim2dTo2dMatrixTransform& operator =(const ossim2dTo2dMatrixTransform& src)
-   {
-      if(this == &src) return *this;
-      
-      ossim2dTo2dTransform::operator =(*this); // call base classes equal operator
-      std::copy(src.m_coefficientsXTerm, src.m_coefficientsXTerm+4, m_coefficientsXTerm);
-      std::copy(src.m_coefficientsYTerm, src.m_coefficientsYTerm+4, m_coefficientsYTerm);
-      std::copy(src.m_inverseCoefficientsXTerm, src.m_inverseCoefficientsXTerm+4, m_inverseCoefficientsXTerm);
-      std::copy(src.m_inverseCoefficientsYTerm, src.m_inverseCoefficientsYTerm+4, m_inverseCoefficientsYTerm);
-      
-      return *this;
-   }
-   
-   /**
-    * Mapping 4 corners to an output 4 corners.  Will use the ossimLeastSquareBilin class to solve 
-    * the bilinear coefficients that maps the given input points to the output points.
-    */
-   void setFromPoints(const ossimDpt& in1, const ossimDpt& in2, const ossimDpt& in3, const ossimDpt& in4,
-                      const ossimDpt& out1, const ossimDpt& out2, const ossimDpt& out3, const ossimDpt& out4);
-
-   /**
-    * Initialize the transform that best fits the input and output arrays.  
-    * If the input and output are well dispersed and are 4 points it should fit
-    * exactly.  Both arrays should be of equal number of points
-    *
-    * @param input the list of input points
-    * @param output the list of output points to transform the input to
-    * @param arraySize the number of points for the arrays.
-    */
-   void setFromPoints(const ossimDpt* input,
-                      const ossimDpt* output, 
-                      ossim_uint32 arraySize);
- 
-   /**
-    * forward transform will transform an input point to the output.  
-    */
-   virtual void forward(const ossimDpt& input,
-                        ossimDpt& output) const
-   {
-      output.x = (m_coefficientsXTerm[0] + 
-                  m_coefficientsXTerm[1]*input.x + 
-                  m_coefficientsXTerm[2]*input.y + 
-                  m_coefficientsXTerm[3]*input.x*input.y);
-      output.y = (m_coefficientsYTerm[0] + 
-                  m_coefficientsYTerm[1]*input.x + 
-                  m_coefficientsYTerm[2]*input.y + 
-                  m_coefficientsYTerm[3]*input.x*input.y);
-   }
-   
-   /**
-    * forward transform will transform an input point to the output and modify the passed in point
-    * to the new value
-    */
-   virtual void forward(ossimDpt&  modify_this) const
-   {
-      double saveX = modify_this.x;
-      modify_this.x = (m_coefficientsXTerm[0] + 
-                       m_coefficientsXTerm[1]*modify_this.x + 
-                       m_coefficientsXTerm[2]*modify_this.y + 
-                       m_coefficientsXTerm[3]*modify_this.x*modify_this.y);
-      modify_this.y = (m_coefficientsYTerm[0] + 
-                       m_coefficientsYTerm[1]*saveX + 
-                       m_coefficientsYTerm[2]*modify_this.y + 
-                       m_coefficientsYTerm[3]*saveX*modify_this.y);
-   }
-   
-   /**
-    * Inverts the point back to the original input value.
-    */
-   virtual void inverse(const ossimDpt& input,
-                        ossimDpt&       output) const
-   {
-      output.x = (m_inverseCoefficientsXTerm[0] + 
-                  m_inverseCoefficientsXTerm[1]*input.x + 
-                  m_inverseCoefficientsXTerm[2]*input.y + 
-                  m_inverseCoefficientsXTerm[3]*input.x*input.y);
-      output.y = (m_inverseCoefficientsYTerm[0] + 
-                  m_inverseCoefficientsYTerm[1]*input.x + 
-                  m_inverseCoefficientsYTerm[2]*input.y + 
-                  m_inverseCoefficientsYTerm[3]*input.x*input.y);
-   }
-   
-   /**
-    * Inverts the point back to the original input value and modifies the passed in point
-    * to the new value.
-    */
-   virtual void inverse(ossimDpt&  modify_this) const
-   {
-      double saveX = modify_this.x;
-      modify_this.x = (m_inverseCoefficientsXTerm[0] + 
-                       m_inverseCoefficientsXTerm[1]*modify_this.x + 
-                       m_inverseCoefficientsXTerm[2]*modify_this.y + 
-                       m_inverseCoefficientsXTerm[3]*modify_this.x*modify_this.y);
-      modify_this.y = (m_inverseCoefficientsYTerm[0] + 
-                       m_inverseCoefficientsYTerm[1]*saveX + 
-                       m_inverseCoefficientsYTerm[2]*modify_this.y + 
-                       m_inverseCoefficientsYTerm[3]*saveX*modify_this.y);
-   }
-   
-   /**
-    * Saves the state of this object.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0)const;
-   
-   /**
-    * loads the state of this object from a keywordlist.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-   
-   /**
-    * prints the contents of this object.  Will also cal the base classes
-    * print method.
-    */
-   virtual std::ostream& print(std::ostream& out) const
-   {
-      ossim2dTo2dTransform::print(out);
-      out << "xTerm: " << m_coefficientsXTerm[0] << ", " << m_coefficientsXTerm[1] << ", "
-          << m_coefficientsXTerm[2] << ", " << m_coefficientsXTerm[3] << "\n";
-      out << "yTerm: " << m_coefficientsYTerm[0] << ", " << m_coefficientsYTerm[1] << ", "
-          << m_coefficientsYTerm[2] << ", " << m_coefficientsYTerm[3] << "\n";
-      
-      out << "xInverseTerm: " << m_inverseCoefficientsXTerm[0] << ", " << m_inverseCoefficientsXTerm[1] << ", "
-          << m_inverseCoefficientsXTerm[2] << ", " << m_inverseCoefficientsXTerm[3] << "\n";
-      out << "yInverseTerm: " << m_inverseCoefficientsYTerm[0] << ", " << m_inverseCoefficientsYTerm[1] << ", "
-          << m_inverseCoefficientsYTerm[2] << ", " << m_inverseCoefficientsYTerm[3] << "\n";
-      
-      return out;
-   }
-   
-protected:
-   ossim_float64 m_coefficientsXTerm[4]; // constant, linear x, linear y, cross xy
-   ossim_float64 m_coefficientsYTerm[4]; // constant, linear x, linear y, cross xy
-
-   ossim_float64 m_inverseCoefficientsXTerm[4]; // constant, linear x, linear y, cross xy
-   ossim_float64 m_inverseCoefficientsYTerm[4]; // constant, linear x, linear y, cross xy
-   TYPE_DATA;   
-};
-
-#endif 
-
diff --git a/ossim/include/ossim/base/ossim2dTo2dShiftTransform.h b/ossim/include/ossim/base/ossim2dTo2dShiftTransform.h
deleted file mode 100644
index 6347c17..0000000
--- a/ossim/include/ossim/base/ossim2dTo2dShiftTransform.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossim2dTo2dShiftTransform_HEADER
-#define ossim2dTo2dShiftTransform_HEADER
-#include <ossim/base/ossim2dTo2dTransform.h>
-
-class OSSIM_DLL ossim2dTo2dShiftTransform : public ossim2dTo2dTransform
-{
-public:
-   /**
-    * Constructor to initialize the shift transform
-    */
-   ossim2dTo2dShiftTransform(const ossimDpt& shift = ossimDpt(0.0,0.0))
-   :ossim2dTo2dTransform(),
-   m_shift(shift)
-   {}
-   
-   /**
-    * Copy constructor
-    */
-   ossim2dTo2dShiftTransform(const ossim2dTo2dShiftTransform& src)
-   :ossim2dTo2dTransform(src),
-   m_shift(src.m_shift)
-   {}
-   
-   /**
-    * Duplication method that duplicates this object
-    */
-   virtual ossimObject* dup()const{return new ossim2dTo2dShiftTransform(*this);}
-   
-   /**
-    * operator = allows one to copy the contents of the class through a common = 
-    * operator.  The = is passed to the derived class.
-    */
-   const ossim2dTo2dShiftTransform& operator =(const ossim2dTo2dShiftTransform& src)
-   {
-      if(this == &src) return *this;
-      
-      ossim2dTo2dTransform::operator =(*this); // call base classes equal operator
-      m_shift = src.m_shift;
-      
-      return *this;
-   }
-   
-   /**
-    * Apply the shift to the input.
-    *
-    * @param input The value to shift.
-    * @param output the shifted value.
-    */
-   virtual void forward(const ossimDpt& input,
-                        ossimDpt& output) const
-   {
-      output = input + m_shift;
-   }
-   /**
-    * Apply the shift to the input and put the result in the same variable
-    *
-    * @param modify_this The value to shift.  The result is placed back into this value.
-    */
-   virtual void forward(ossimDpt&  modify_this) const
-   {
-      modify_this.x += m_shift.x;
-      modify_this.y += m_shift.y;
-   }
-
-   /**
-    * Negate the shift to the input and put the result in output.
-    *
-    * @param input The value to apply the negated shift.
-    * @param output the shifted value.
-    */
-   virtual void inverse(const ossimDpt& input,
-                        ossimDpt& output) const
-   {
-      output = input - m_shift;
-   }
-   
-   /**
-    * Negate the shift operation and put the result in the same variable
-    *
-    * @param modify_this The value to shift.  The result is placed back into this value.
-    */
-   virtual void inverse(ossimDpt&  modify_this) const
-   {
-      modify_this.x -= m_shift.x;
-      modify_this.y -= m_shift.y;
-   }
-   /**
-    * Saves the state of this object.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0)const;
-   
-   /**
-    * loads the state of this object from a keywordlist.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-   
-   /**
-    * Print the contents of the class and pass to the derived class.
-    */
-   virtual std::ostream& print(std::ostream& out) const
-   {
-      ossim2dTo2dTransform::print(out);
-      
-      out << "shift: " << m_shift;
-      
-      return out;
-   }
-   
-protected:
-   virtual ~ossim2dTo2dShiftTransform(){}
-   
-   ossimDpt m_shift;
-   
-TYPE_DATA;
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossim2dTo2dTransform.h b/ossim/include/ossim/base/ossim2dTo2dTransform.h
deleted file mode 100644
index 57ae70e..0000000
--- a/ossim/include/ossim/base/ossim2dTo2dTransform.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossim2dTo2dTransform.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossim2dTo2dTransform_HEADER
-#define ossim2dTo2dTransform_HEADER
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimDpt.h>
-
-class OSSIMDLLEXPORT ossim2dTo2dTransform : public ossimObject
-{
-public:
-   virtual void forward(const ossimDpt& input,
-                        ossimDpt& output) const=0;
-   
-   virtual void forward(ossimDpt&  modify_this) const;
-      
-   virtual void inverse(const ossimDpt& input,
-                        ossimDpt&       output) const;
-
-   virtual void inverse(ossimDpt&  modify_this) const;
-      
-   virtual const ossim2dTo2dTransform& operator=(
-      const ossim2dTo2dTransform& rhs);
-   
-   /*!
-    * Used by the inverse iterator.  This will give it a good initial value
-    * that is within the input transforms
-    */
-   virtual ossimDpt getOrigin() const;
-
-   virtual std::ostream& print(std::ostream& out) const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                   const char* prefix = 0)const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                  const char* prefix = 0);
-   
-   void setConvergenceThreshold(const double& new_threshold);
-   
-   void setMaxIterations(int new_max_iters);
-
-   void setDxDy(const ossimDpt& dxdy);
-
-protected:
-   ossim2dTo2dTransform();
-   virtual ~ossim2dTo2dTransform(){}
-   double theConvergenceThreshold;
-   int    theMaxIterations;
-
-   ossimDpt theDxDy;
-   
-TYPE_DATA      
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossim2dTo2dTransformFactory.h b/ossim/include/ossim/base/ossim2dTo2dTransformFactory.h
deleted file mode 100644
index 224c40b..0000000
--- a/ossim/include/ossim/base/ossim2dTo2dTransformFactory.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class declaration of ossim2dTo2dTransformFactory.
-//
-//**************************************************************************************************
-// $Id$
-#ifndef ossim2dTo2dTransformFactory_HEADER
-#define ossim2dTo2dTransformFactory_HEADER
-#include <ossim/base/ossim2dTo2dTransformFactoryBase.h>
-
-class ossim2dTo2dTransform;
-class OSSIM_DLL ossim2dTo2dTransformFactory : public ossim2dTo2dTransformFactoryBase
-{
-public:
-   ossim2dTo2dTransformFactory(){}
-   static ossim2dTo2dTransformFactory* instance();
-   
-   /**
-    * Take a transform type name.
-    */
-   virtual ossim2dTo2dTransform* createTransform(const ossimString& name)const;
-   
-   /**
-    * Take a keywordlist.
-    */
-   virtual ossim2dTo2dTransform* createTransform(const ossimKeywordlist& kwl,
-                                                 const char* prefix)const;
-   
-   /*!
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-  
-protected:
-   static ossim2dTo2dTransformFactory* m_instance;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossim2dTo2dTransformFactoryBase.h b/ossim/include/ossim/base/ossim2dTo2dTransformFactoryBase.h
deleted file mode 100644
index 193d74d..0000000
--- a/ossim/include/ossim/base/ossim2dTo2dTransformFactoryBase.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef ossim2dTo2dTransformFactoryBase_HEADER
-#define ossim2dTo2dTransformFactoryBase_HEADER
-#include <ossim/base/ossimObjectFactory.h>
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class declaration of ossim2dTo2dTransformFactoryBase.
-//
-//**************************************************************************************************
-// $Id$
-#include <ossim/base/ossim2dTo2dTransform.h>
-
-class OSSIM_DLL ossim2dTo2dTransformFactoryBase : public ossimObjectFactory
-{
-public:
-   
-   /**
-    * Creates an object given a type name.
-    */
-   virtual ossimObject* createObject(const ossimString& typeName)const
-   {
-      return createTransform(typeName);
-   }
-   
-   /**
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const
-   {
-      return createTransform(kwl, prefix);
-   }
-   
-   /**
-    * Take a transform type name.
-    */
-   virtual ossim2dTo2dTransform* createTransform(const ossimString& name)const=0;
-   
-   /**
-    * Take a keywordlist.
-    */
-   virtual ossim2dTo2dTransform* createTransform(const ossimKeywordlist& kwl,
-                                                 const char* prefix)const=0;
-protected:
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossim2dTo2dTransformRegistry.h b/ossim/include/ossim/base/ossim2dTo2dTransformRegistry.h
deleted file mode 100644
index 3db9075..0000000
--- a/ossim/include/ossim/base/ossim2dTo2dTransformRegistry.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class declaration of ossim2dTo2dTransformRegistry.
-//
-//**************************************************************************************************
-// $Id$
-#ifndef ossim2dTo2dTransformRegistry_HEADER
-#define ossim2dTo2dTransformRegistry_HEADER
-#include <ossim/base/ossimObjectFactory.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/base/ossim2dTo2dTransformFactoryBase.h>
-#include <ossim/base/ossim2dTo2dTransform.h>
-#include <vector>
-#include <ossim/base/ossimFactoryListInterface.h>
-
-class OSSIM_DLL ossim2dTo2dTransformRegistry : public ossimObjectFactory,
-                                               public ossimFactoryListInterface<ossim2dTo2dTransformFactoryBase,
-                                                                                ossim2dTo2dTransform>
-{
-public:
-   virtual ~ossim2dTo2dTransformRegistry(){}
-   static ossim2dTo2dTransformRegistry* instance();
-   
-   /*!
-    * Creates an object given a type name.
-    */
-   virtual ossimObject* createObject(const ossimString& typeName)const
-   {
-      return createObjectFromRegistry(typeName);
-   }
-   
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const
-   {
-      return createObjectFromRegistry(kwl, prefix);
-   }
-   /*!
-    * Creates an object given a type name.
-    */
-   virtual ossim2dTo2dTransform* createTransform(const ossimString& typeName)const
-   {
-      return createNativeObjectFromRegistry(typeName);
-   }
-   
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossim2dTo2dTransform* createTransform(const ossimKeywordlist& kwl,
-                                                 const char* prefix=0)const
-   {
-      return createNativeObjectFromRegistry(kwl, prefix);
-   }
-   
-   /*!
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const
-   {
-      getAllTypeNamesFromRegistry(typeList);
-   }
-   
-protected:
-   ossim2dTo2dTransformRegistry()
-   :ossimObjectFactory()
-   {}
-   
-   ossim2dTo2dTransformRegistry( const ossim2dTo2dTransformRegistry& rhs )
-   :ossimObjectFactory(rhs)
-   {}
-   void operator =(const ossim2dTo2dTransformRegistry&){}
-   static ossim2dTo2dTransformRegistry* m_instance;
-   
-   TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossimArgumentParser.h b/ossim/include/ossim/base/ossimArgumentParser.h
deleted file mode 100644
index 2e60508..0000000
--- a/ossim/include/ossim/base/ossimArgumentParser.h
+++ /dev/null
@@ -1,230 +0,0 @@
-//-------------------------------------------------------------------------
-//
-// This code was taken from Open Scene Graph and incorporated from into
-// OSSIM.
-//
-//-------------------------------------------------------------------------
-// $Id: ossimArgumentParser.h 22491 2013-11-26 18:17:29Z dburken $
-#ifndef ossimArgumentParser_HEADER
-#define ossimArgumentParser_HEADER 1
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <map>
-#include <string>
-#include <iosfwd>
-
-class ossimApplicationUsage;
-
-class OSSIMDLLEXPORT ossimArgumentParser
-{
-public:
-   
-   class ossimParameter
-   {
-   public:
-      enum ossimParameterType
-      {
-         OSSIM_FLOAT_PARAMETER,
-         OSSIM_DOUBLE_PARAMETER,
-         OSSIM_INT_PARAMETER,
-         OSSIM_UNSIGNED_INT_PARAMETER,
-         OSSIM_STRING_PARAMETER,
-      };
-      
-      union ossimValueUnion
-      {
-         float*          theFloat;
-         double*         theDouble;
-         int*            theInt;
-         unsigned int*   theUint;
-         std::string*    theString;
-      };
-      
-      ossimParameter(float& value)
-      {
-         theType = OSSIM_FLOAT_PARAMETER; theValue.theFloat = &value;
-      }
-      
-      ossimParameter(double& value)
-      {
-         theType = OSSIM_DOUBLE_PARAMETER; theValue.theDouble = &value;
-      }
-      
-      ossimParameter(int& value)
-      {
-         theType = OSSIM_INT_PARAMETER; theValue.theInt = &value;
-      }
-      
-      ossimParameter(unsigned int& value)
-      {
-         theType = OSSIM_UNSIGNED_INT_PARAMETER; theValue.theUint = &value;
-      }
-      
-      ossimParameter(std::string& value)
-      {
-         theType = OSSIM_STRING_PARAMETER; theValue.theString = &value;
-      }
-      
-      ossimParameter(ossimString& value)
-      {
-         theType = OSSIM_STRING_PARAMETER; theValue.theString =
-                                              &(value.string());
-      }
-      
-      bool valid(const char* str) const;
-      bool assign(const char* str);
-      
-   protected:
-      
-      ossimParameterType   theType;
-      ossimValueUnion      theValue;
-   };
-   
-   /** return return true if specified string is an option in the form of
-    * -option or --option .
-    */
-   static bool isOption(const char* str);
-   
-   /** return return true if string is any other string apart from an option.*/
-   static bool isString(const char* str);
-   
-   /** return return true if specified parameter is an number.*/
-   static bool isNumber(const char* str);
-   
-public:
-   
-   ossimArgumentParser(int* argc,char **argv);
-
-   ~ossimArgumentParser();
-
-   /** @brief Initialize from command arguments. */
-   void initialize(int* argc, const char **argv); 
-   
-   void setApplicationUsage(ossimApplicationUsage* usage) { theUsage = usage; }
-   ossimApplicationUsage* getApplicationUsage() { return theUsage; }
-   const ossimApplicationUsage* getApplicationUsage() const { return theUsage; }
-   
-   /** return the argument count.*/
-   int& argc() { return *theArgc; }
-   
-   /** return the argument array.*/
-   char** argv() { return theArgv; }
-   
-   /** return char* argument at specificed position.*/
-   char* operator [] (int pos) { return theArgv[pos]; }
-   
-   /** return const char* argument at specificed position.*/
-   const char* operator [] (int pos) const { return theArgv[pos]; }
-   
-   /** return the application name, as specified by argv[0] */
-   std::string getApplicationName() const;
-   
-   /** return the position of an occurence of a string in the argument list.
-    * return -1 when no string is found.*/      
-   int find(const std::string& str) const;
-   
-   /** return return true if specified parameter is an option in the form of -option or --option .*/
-   bool isOption(int pos) const;
-   
-   /** return return true if specified parameter is an string, which can be any other string apart from an option.*/
-   bool isString(int pos) const;
-   
-   /** return return true if specified parameter is an number.*/
-   bool isNumber(int pos) const;
-   
-   bool containsOptions() const;
-   
-   /** remove one or more arguments from the argv argument list, and decrement the argc respectively.*/
-   void remove(int pos,int num=1);
-   
-   /** return true if specified argument matches string.*/        
-   bool match(int pos, const std::string& str) const;
-   
-   /**
-    * search for an occurance of a string in the argument list, on sucess
-    * remove that occurance from the list and return true, otherwise
-    * return false.
-    */
-   bool read(const std::string& str);
-   bool read(const std::string& str, ossimParameter value1);
-   bool read(const std::string& str, ossimParameter value1,
-             ossimParameter value2);
-   bool read(const std::string& str, ossimParameter value1,
-             ossimParameter value2, ossimParameter value3);
-   bool read(const std::string& str, ossimParameter value1,
-             ossimParameter value2, ossimParameter value3,
-             ossimParameter value4);
-   bool read(const std::string& str, ossimParameter value1,
-             ossimParameter value2, ossimParameter value3,
-             ossimParameter value4, ossimParameter value5);
-   bool read(const std::string& str, ossimParameter value1,
-             ossimParameter value2, ossimParameter value3,
-             ossimParameter value4, ossimParameter value5,
-             ossimParameter value6);
-   
-   /**
-    * @return The number of parameters of type value associated with specified
-    * option, or -1 if option not found
-    */
-   int numberOfParams(const std::string& str,
-                      const ossimParameter& value) const;
-   
-   /**
-    * if the argument value at the position pos matches specified string, and
-    * subsequent paramters are also matched then set the paramter values and
-    * remove the from the list of arguments.
-    */
-   bool read(int pos, const std::string& str);
-   bool read(int pos, const std::string& str, ossimParameter value1);
-   bool read(int pos, const std::string& str, ossimParameter value1,
-             ossimParameter value2);
-   bool read(int pos, const std::string& str, ossimParameter value1,
-             ossimParameter value2, ossimParameter value3);
-   bool read(int pos, const std::string& str, ossimParameter value1,
-             ossimParameter value2, ossimParameter value3,
-             ossimParameter value4);
-   
-   
-   enum ossimErrorSeverity
-   {
-      OSSIM_BENIGN = 0,
-      OSSIM_CRITICAL = 1
-   };
-   
-   typedef std::map<std::string,ossimErrorSeverity> ossimErrorMessageMap;
-   
-   /**
-    * @return The error flag, true if an error has occured when
-    * reading arguments.
-    */
-   bool errors(ossimErrorSeverity severity=OSSIM_BENIGN) const;
-   
-   /** report an error message by adding to the ErrorMessageMap.*/
-   void reportError(const std::string& message,
-                    ossimErrorSeverity severity=OSSIM_CRITICAL);
-   
-   /** for each remaining option report it as an unrecongnized.*/
-   void reportRemainingOptionsAsUnrecognized(
-      ossimErrorSeverity severity=OSSIM_BENIGN);
-   
-   /** @return The error message, if any has occured.*/
-   ossimErrorMessageMap& getErrorMessageMap();
-   
-   /** @return The error message, if any has occured.*/
-   const ossimErrorMessageMap& getErrorMessageMap() const;
-   
-   /** write out error messages at an above specified .*/
-   void writeErrorMessages(std::ostream& output,
-                           ossimErrorSeverity sevrity=OSSIM_BENIGN);
-   
-   
-protected:
-   
-   int*                     theArgc;
-   char**                   theArgv;
-   ossimErrorMessageMap     theErrorMessageMap;
-   ossimApplicationUsage*   theUsage;
-        
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimCallback1.h b/ossim/include/ossim/base/ossimCallback1.h
deleted file mode 100644
index ea0658a..0000000
--- a/ossim/include/ossim/base/ossimCallback1.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimCallback1wRet.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Simple templated callback class that takes a single parameter(argument) "P1"
-// with void return.
-//
-// See link for more detail description:
-// http://www.tutok.sk/fastgl/callback.html
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimCallback1_HEADER
-#define ossimCallback1_HEADER 1
-
-/**
- * @class ossimCallback1
- *
- * Usage example, note template params can be anything:
- *
- * Caller interface to register callback:
- *
- * @code
- * void registerCallback(ossimCallback1<const ossimFilename&>* cb);
- * @endcode
- *
- * Callee creation of call back mechanism:
- *
- * @code
- * class ProcessFileCB: public ossimCallback1<const ossimFilename&>
- * {
- * public:
- *    ProcessFileCB(
- *       ossimImageElevationDatabase* obj,
- *       void (ossimImageElevationDatabase::*func)(const ossimFilename&))
- *       :
- *       m_obj(obj),
- *       m_func(func)
- *    {}
- *       
- *    virtual void operator()(const ossimFilename& file) const
- *    {
- *       ( m_obj->*m_func)(file);
- *    }
- * 
- * private:
- *    ossimImageElevationDatabase* m_obj;
- *    void (ossimImageElevationDatabase::*m_func)(const ossimFilename& file);
- * };
- * @endcode
- *
- * Making/registering a callback.
- *
- * @code
- * ossimFileWalker* fw = new ossimFileWalker();
- *
- * ossimCallback1wRet<const ossimFilename&>* cb =
- *    new ProcessFileCB(this, &ossimImageElevationDatabase::processFile);
- *
- * fw->registerProcessFileCallback(cb);
- *
- * @endcode
- */
-template <class P1> class ossimCallback1
-{
-public:
-   ossimCallback1(){}
-   virtual ~ossimCallback1(){}
-   virtual void operator()(P1 p1) const = 0;
-};
-
-#endif /* #ifndef ossimCallback1_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimCallback1wRet.h b/ossim/include/ossim/base/ossimCallback1wRet.h
deleted file mode 100644
index 4032978..0000000
--- a/ossim/include/ossim/base/ossimCallback1wRet.h
+++ /dev/null
@@ -1,82 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimCallback1wRet.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Simple templated callback class that takes a single parameter(argument) "P1"
-// and has a return "RT".
-//
-// See link for more detail description:
-// http://www.tutok.sk/fastgl/callback.html
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimCallback1wRet_HEADER
-#define ossimCallback1wRet_HEADER 1
-
-/**
- * @class ossimCallback1wRet
- *
- * Usage example, note template params can be anything:
- *
- * Caller interface to register callback:
- *
- * @code
- * void registerCallback(ossimCallback1wRet<const ossimFilename&, bool>* cb);
- * @endcode
- *
- * Callee creation of call back mechanism:
- *
- * @code
- * class ProcessFileCB: public ossimCallback1wRet<const ossimFilename&, bool>
- * {
- * public:
- *    ProcessFileCB(
- *       ossimImageElevationDatabase* obj,
- *       bool (ossimImageElevationDatabase::*func)(const ossimFilename&))
- *       :
- *       m_obj(obj),
- *       m_func(func)
- *    {}
- *       
- *    virtual bool operator()(const ossimFilename& file) const
- *    {
- *       return ( m_obj->*m_func)(file);
- *    }
- * 
- * private:
- *    ossimImageElevationDatabase* m_obj;
- *    bool (ossimImageElevationDatabase::*m_func)(const ossimFilename& file);
- * };
- * @endcode
- *
- * Making/registering a callback.
- *
- * @code
- * ossimFileWalker* fw = new ossimFileWalker();
- *
- * ossimCallback1wRet<const ossimFilename&, bool>* cb =
- *    new ProcessFileCB(this, &ossimImageElevationDatabase::processFile);
- *
- * fw->registerProcessFileCallback(cb);
- *
- * @endcode
- */
-template <class P1, class RT> class ossimCallback1wRet
-{
-public:
-   ossimCallback1wRet(){}
-   virtual ~ossimCallback1wRet(){}
-   virtual RT operator()(P1 p1) const = 0;
-};
-
-#endif /* #ifndef ossimCallback1wRet_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimCallback2wRet.h b/ossim/include/ossim/base/ossimCallback2wRet.h
deleted file mode 100644
index 59c38d4..0000000
--- a/ossim/include/ossim/base/ossimCallback2wRet.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimCallback2wRet.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Simple templated callback class that takes a two parameters(arguments) "P1"
-// and has a return "RT".
-//
-// See link for more detail description:
-// http://www.tutok.sk/fastgl/callback.html
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimCallback2wRet_HEADER
-#define ossimCallback2wRet_HEADER 1
-
-/**
- * @class ossimCallback2wRet
- *
- * Usage example, note template params can be anything:
- *
- * Caller interface to register callback:
- *
- * @code
- * void registerCallback(ossimCallback2wRet<const ossimFilename&, bool&, bool>* cb);
- * @endcode
- *
- * Callee creation of call back mechanism:
- *
- * @code
- * class ProcessFileCB: public ossimCallback2wRet<const ossimFilename&, bool&, bool>
- * {
- * public:
- *    ProcessFileCB(
- *       ossimImageElevationDatabase* obj,
- *       bool (ossimImageElevationDatabase::*func)(const ossimFilename&, bool&))
- *       :
- *       m_obj(obj),
- *       m_func(func)
- *    {}
- *       
- *    virtual bool operator()(const ossimFilename& file, bool& flag) const
- *    {
- *       return ( m_obj->*m_func)(file, flag);
- *    }
- * 
- * private:
- *    ossimImageElevationDatabase* m_obj;
- *    bool (ossimImageElevationDatabase::*m_func)(const ossimFilename& file, bool& flag);
- * };
- * @endcode
- *
- * Making/registering a callback.
- *
- * @code
- * ossimFileWalker* fw = new ossimFileWalker();
- *
- * ossimCallback2wRet<const ossimFilename&, bool&, bool>* cb =
- *    new ProcessFileCB(this, &ossimImageElevationDatabase::processFile);
- *
- * fw->registerProcessFileCallback(cb);
- *
- * @endcode
- */
-
-template <class P1, class P2, class RT> class ossimCallback2wRet
-{
-public:
-   ossimCallback2wRet(){}
-   virtual ~ossimCallback2wRet(){}
-   virtual RT operator()(P1 p1, P2 p2) const = 0;
-};
-
-#endif /* #ifndef ossimCallback2wRet_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimColumnVector3d.h b/ossim/include/ossim/base/ossimColumnVector3d.h
deleted file mode 100644
index 52bde06..0000000
--- a/ossim/include/ossim/base/ossimColumnVector3d.h
+++ /dev/null
@@ -1,292 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-// Description: This is a 3-D vector without the homogeneous
-//              coordinate.
-//
-//*******************************************************************
-//  $Id: ossimColumnVector3d.h 20074 2011-09-08 16:16:27Z gpotts $
-#ifndef ossimColumnVector3d_HEADER
-#define ossimColumnVector3d_HEADER
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <float.h> // for FLT_EPSILON
-#include <iomanip>
-#include <iostream>
-#include <cmath>
-using namespace std;
-
-#include <ossim/matrix/newmat.h>
-#include <ossim/base/ossimString.h>
-
-class OSSIMDLLEXPORT ossimColumnVector3d
-{
-public:
-   ossimColumnVector3d()
-      {
-         data[0]=0;
-         data[1]=0;
-         data[2]=0;
-      }
-
-   ossimColumnVector3d(double x, double y, double z=0)
-      {
-         data[0]=x;
-         data[1]=y;
-         data[2]=z;
-      }
-
-   ossimColumnVector3d(const ossimColumnVector3d &rhs)
-   {
-      data[0] = rhs.data[0];
-      data[1] = rhs.data[1];
-      data[2] = rhs.data[2];
-   }
-   
-   explicit ossimColumnVector3d(const NEWMAT::ColumnVector& rhs)
-   {
-      if ( (rhs.Ncols() == 1) && (rhs.Nrows() > 2) )
-      {
-         data[0] = rhs[0];
-         data[1] = rhs[1];
-         data[2] = rhs[2];
-      }
-      else
-      {
-         data[0]=0;
-         data[1]=0;
-         data[2]=0;
-      }
-   }
-
-   const ossimColumnVector3d& operator=(const NEWMAT::ColumnVector& rhs)
-   {
-      if ( (rhs.Ncols() == 1) && (rhs.Nrows() == 3) )
-      {
-         data[0] = rhs[0];
-         data[1] = rhs[1];
-         data[2] = rhs[2];
-      }
-      return *this;
-   }
-
-   friend ostream& operator <<(ostream& out, const ossimColumnVector3d& v)
-      {
-         return out << setiosflags(ios::fixed) << setprecision(15)
-                    << v[0] << " " << v[1] <<" "
-                    << v[2];
-      }
-
-   friend ossimColumnVector3d operator*(double scalar,
-					const ossimColumnVector3d &v)
-      {
-         return ossimColumnVector3d(v.data[0]*scalar,
-                                    v.data[1]*scalar,
-                                    v.data[2]*scalar);
-      }
-
-   /*!
-    *  Multiplies column vector times matrix.
-    *  Note:
-    *  If "lhs" is not a 3x3 that's an error and a blank column vector
-    *  is returned.
-    */
-   friend ossimColumnVector3d operator*(const NEWMAT::Matrix& lhs,
-                                        const ossimColumnVector3d& rhs)
-   {
-      if ((lhs.Ncols() == 3) && (lhs.Nrows() == 3))
-      {
-         return ossimColumnVector3d( (lhs[0][0]*rhs[0] + lhs[0][1]*rhs[1] + lhs[0][2]*rhs[2]),
-                                     (lhs[1][0]*rhs[0] + lhs[1][1]*rhs[1] + lhs[1][2]*rhs[2]),
-                                     (lhs[2][0]*rhs[0] + lhs[2][1]*rhs[1] + lhs[2][2]*rhs[2]));
-      }
-      else if((lhs.Ncols() == 4) && (lhs.Nrows() == 4))
-      {
-         return ossimColumnVector3d( (lhs[0][0]*rhs[0] + lhs[0][1]*rhs[1] + lhs[0][2]*rhs[2] + lhs[0][3]) ,
-                                     (lhs[1][0]*rhs[0] + lhs[1][1]*rhs[1] + lhs[1][2]*rhs[2] + lhs[1][3]) ,
-                                     (lhs[2][0]*rhs[0] + lhs[2][1]*rhs[1] + lhs[2][2]*rhs[2] + lhs[2][3]));
-      }
-      ossimNotify(ossimNotifyLevel_WARN) << "Multiplying a 3 row column vector by an invalid matrix" << std::endl;
-      return rhs;
-   }
-
-   double& operator [](int index)
-      {
-         return data[index];
-      }
-
-   const double& operator [](int index)const
-      {
-         return data[index];
-      }
-
-   ossimColumnVector3d operator*(double scalar)const
-      {
-         return ossimColumnVector3d(data[0]*scalar,
-                                    data[1]*scalar,
-                                    data[2]*scalar);
-      }
-
-   ossimColumnVector3d operator +(const ossimColumnVector3d &rhs)const
-      {
-         return ossimColumnVector3d( data[0]+rhs[0],
-                                     data[1]+rhs[1],
-                                     data[2]+rhs[2]);
-      }
-
-   const ossimColumnVector3d& operator +=(const ossimColumnVector3d &rhs)
-      {
-         data[0] += rhs[0];
-         data[1] += rhs[1];
-         data[2] += rhs[2];
-
-         return *this;
-      }
-
-   ossimColumnVector3d operator - ()const
-      {
-         return ossimColumnVector3d(-data[0],
-                                    -data[1],
-                                    -data[2]);
-      }
-
-   ossimColumnVector3d operator /(double scalar)const
-      {
-         return ossimColumnVector3d( data[0]/scalar,
-                                     data[1]/scalar,
-                                     data[2]/scalar);
-      }
-
-   const ossimColumnVector3d& operator /=(double scalar)
-      {
-         data[0]/=scalar;
-         data[1]/=scalar;
-         data[2]/=scalar;
-
-         return *this;
-      }
-
-   ossimColumnVector3d operator -(const ossimColumnVector3d &rhs)const
-      {
-         return ossimColumnVector3d( data[0]-rhs[0],
-                                     data[1]-rhs[1],
-                                     data[2]-rhs[2]);
-      }
-
-   const ossimColumnVector3d& operator -=(const ossimColumnVector3d &rhs)
-      {
-         data[0] -= rhs[0];
-         data[1] -= rhs[1];
-         data[2] -= rhs[2];
-
-         return *this;
-      }
-
-   bool operator ==(const ossimColumnVector3d &rhs) const
-      { return ((fabs(data[0] - rhs[0]) <= FLT_EPSILON) &&
-		(fabs(data[1] - rhs[1]) <= FLT_EPSILON) &&
-		(fabs(data[2] - rhs[2]) <= FLT_EPSILON));
-      }
-
-   bool operator !=(const ossimColumnVector3d &rhs) const
-      { return !(*this == rhs); }
-
-   double magnitude()const
-      {
-         return sqrt(data[0]*data[0] +
-                     data[1]*data[1] +
-                     data[2]*data[2]);
-      }
-   inline double norm2()const //!speedup
-      {
-          return data[0]*data[0] +
-                 data[1]*data[1] +
-                 data[2]*data[2];
-      }
-   double dot(const ossimColumnVector3d &rhs) const
-      {
-         return (data[0]*rhs[0]+
-                 data[1]*rhs[1]+
-                 data[2]*rhs[2]);
-      }
-
-   ossimColumnVector3d unit() const
-   {
-      double mag = magnitude();
-
-      if(fabs(mag) > FLT_EPSILON)
-      {
-         mag = 1.0/mag;
-         return (*this *mag);
-      }
-
-      return *this;
-   }
-
-   ossimColumnVector3d cross(const ossimColumnVector3d &rhs) const
-      {
-         return ossimColumnVector3d( data[1]*rhs[2] - data[2]*rhs[1],
-                               data[2]*rhs[0] - data[0]*rhs[2],
-                               data[0]*rhs[1] - data[1]*rhs[0]);
-      }
-
-   const ossimColumnVector3d& xAligned()
-      {
-         data[0] = 1;
-         data[1] = 0;
-         data[2] = 0;
-
-         return *this;
-      }
-   const ossimColumnVector3d& yAligned()//
-      {
-         data[0] = 0;
-         data[1] = 1;
-         data[2] = 0;
-
-         return *this;
-      }
-   const ossimColumnVector3d& zAligned() //
-      {
-         data[0] = 0;
-         data[1] = 0;
-         data[2] = 1;
-
-         return *this;
-      }
-
-   /**
-    * @brief To string method.
-    * 
-    * @param precision Output floating point precision.
-    * 
-    * @return ossimString representing point.
-    *
-    * Output format:
-    * ( 0.0000000,  0.0000000,  0.00000000 )
-    *   -----x----  -----y----  ------z----
-    */
-   ossimString toString(ossim_uint32 precision=15) const;
-
-   /**
-    * @brief Initializes this point from string.
-    *
-    * Expected format:
-    * 
-    * ( 0.0000000,  0.0000000,  0.00000000 )
-    *   -----x----  -----y----  ------z----
-    *
-    * @param s String to initialize from.
-    */
-   void toPoint(const std::string& s);
-   
-private:
-   double data[3];
-};
-
-
-
-#endif
diff --git a/ossim/include/ossim/base/ossimCommon.h b/ossim/include/ossim/base/ossimCommon.h
deleted file mode 100644
index ba2b317..0000000
--- a/ossim/include/ossim/base/ossimCommon.h
+++ /dev/null
@@ -1,661 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts, with some additions and modifciations by
-// Patrick Melody
-//
-// Description: Common file for utility functions.
-//
-//*************************************************************************
-// $Id: ossimCommon.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimCommon_HEADER
-#define ossimCommon_HEADER 1
-
-
-// XXX nullify these for now, but eventually replace with a #include 
-#define ossimREQUIRE(expr) 
-#define ossimENSURE(expr)  
-#define ossimCHECK(expr) 
-#define ossimSTATIC_CHECK(expr,msg)  
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <cfloat>
-#include <cmath>
-#include <istream>
-#include <sstream>
-#include <string>
-#include <vector>
-#include <iostream>
-#include <algorithm>
-#include <iterator>
-
-class ossimIpt;
-class ossimIrect;
-class ossimDpt;
-class ossimGpt;
-namespace NEWMAT
-{
-   class Matrix;
-}
-
-namespace ossim
-{
-   OSSIM_DLL std::istream& skipws(std::istream& in);
-   OSSIM_DLL bool isWhiteSpace(int c);
-    template<class T>
-/*     inline bool almostEqual(T x, T y, T tolerence = std::numeric_limits<T>::epsilon()) */
-/*         // are x and y within tolerance distance of each other? */
-/*         { return std::abs(x - y) <= tolerence; } */
-    inline bool almostEqual(T x, T y, T tolerence = FLT_EPSILON)
-        // are x and y within tolerance distance of each other?
-        { return std::fabs(x - y) <= tolerence; }
-
-    template <class T>
-    inline bool inInterval(T x, T a, T b)
-	// is x in the closed interval [a,b]?
-	{ return x >= a && x <= b; }
-
-    template <class T>
-    inline bool inOpenInterval(T x, T a, T b)
-	// is x in the open interval (a,b)?
-	{ return x > a && x < b; }
-
-   
-    /**
-     * isnan Test for floating point Not A Number (NAN) value.
-     * This should be used test for nan.
-     * DO NOT USE operator==.  Like "if (height == ossim::nan())"
-     *
-     * @return true if nan, false if not.
-     *
-     * @see nan()
-     */
-#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
-    inline bool isnan(const float& v) { return _isnan(v); }
-    inline bool isnan(const double& v) { return _isnan(v); }
-#elif defined(sun) || defined(__sun)
-#    if defined(__SVR4) || defined(__svr4__)
-/* Solaris */
-    inline bool isnan(const float& v)  { return ( ::isnan(v) ); }
-    inline bool isnan(const double& v) { return ( ::isnan(v) ); }
-#    else
-/* SunOS */
-    inline bool isnan(const float& v)  { return ( ::isnan(v) ); }
-    inline bool isnan(const double& v) { return ( ::isnan(v) ); }
-#   endif
-#else
-    inline bool isnan(const float& v)  { return ( std::isnan(v) ); }
-    inline bool isnan(const double& v) { return ( std::isnan(v) ); }
-#endif
-
-/* #if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__) */
-/*     inline bool isnan(const float& v) { return _isnan(v); } */
-/*     inline bool isnan(const double& v) { return _isnan(v); } */
-/* #else */
-/*     inline bool isnan(const float& v)  { return ( std::isnan(v) ); } */
-/*     inline bool isnan(const double& v) { return ( std::isnan(v) ); } */
-/* #endif */
-
-    /** @brief Class lets us see bit patterns of floats. */
-    class OSSIM_DLL IntFloatBitCoercion
-    {
-    public:
-       union
-       { 
-          ossim_int64 intname;
-          ossim_float64 floatname;
-       } bits;
-       IntFloatBitCoercion(ossim_int64 x)   { bits.intname = x;   }
-       IntFloatBitCoercion(ossim_float64 x) { bits.floatname = x; }
-    };
-    
-    /**
-     * @brief Declaration of nan part of nan() declared here for inline
-     * ossim::nan().
-     */
-    extern OSSIM_DLL_DATA(const IntFloatBitCoercion) nanValue;
-    
-    /**
-     * @brief Method to return ieee floating point double precision NAN.
-     *
-     * @return ieee floating point double precision NAN.
-     *
-     * @see isnan()
-     *
-     * @note casts seamlessly to float and long double.
-     *
-     * @note Use ossim::isnan(v) to test for nan.
-     * Like "if (isnan(myDoubleValue)) { doSomething; }"
-     * DO NOT USE operator==.  Like "if (myDoubleValue == ossim::nan())"
-     */
-    inline double nan() { return nanValue.bits.floatname; }
-
-   template <class T>
-   inline T abs(const T& value)
-   {
-      if(value < 0)
-      {
-         return -value;
-      }
-      return value;
-   }
-    template <class S, class T> 
-    inline T lerp(S x, T begin, T end)
-	// linear interpolation from begin to end by x
-	{ return x*(end - begin) + begin; }
-    
-    template <class T> 
-    inline T inverseLerp(T x, T begin, T end)
-	// inverse of lerp: if lerp(z,begin,end) = x, then inverseLerp(x,begin,end) = z.
-        // when begin=end, inverseLerp is underconstrained, so we define it to be 0.
-	{ return begin == end ? (ossim::isnan(x) ? x : T(0)) : (x - begin)/(end - begin); }
-
-    template <class S, class T> 
-    T quaderp(S x, T begin, T middle, T end)
-	// quadratic interpolation through begin,middle,end by x
-	{
-	    // newton interpolation
-	    const T a1 = S(2)*(middle - begin);
-	    const T a2 = S(2)*(end - middle) - a1;
-	    return x*((x - S(0.5))*a2 + a1) + begin;
-	}
-
-    template <class T> 
-    inline T clamp(T x, T a, T b)
-	// clamp x to [a, b]
-	{
-	    ossimREQUIRE(a <= b);  // input must make sense, disallow nans 
-	    
-            if (ossim::isnan(x)) return x;
-            if (x < a) return a;
-            if (b < x) return b;
-            return x;
-	}
-    
-    template <class T>
-    T wrap(T x, T a, T b)
-	// wrap x modularly into [a,b)
-	{
-	    ossimREQUIRE(a <= b);  // input must make sense, disallow nans 
-	    
-	    if (a == b && !ossim::isnan(x))
-		return a;
-	    else {
-		T z = x < a ? b : a;
-		return std::fmod(x - z, b - a) + z;
-	    }
-	}
-
-    // XXX to Garrett from PJM:
-    //     min and max routines. std::min/max do not in fact correctly handle nan.  
-    //     this is troublesome, i think my code always was asserting no nans before values got
-    //     through std::min/std::max.  i agree with you that if any of the input is nan,
-    //     then the result should be nan, but the STL doesn't really consider the possibility
-    //     that inputs to min/max have a "strange" ordering to them.  we could overload
-    //     std::min/max to do this behavior but that's evil. for all my whining, i think
-    //     we should have ossim::max/max that do the right thing wrt nan.  however:
-    //     if we "correctly" handle nans like this, does that subtly break any existing code?
-    template <class T>
-    inline T min(T a, T b)
-       // min of a,b; nan if either a or b are nan
-    {
-       return (a < b) ? a : b;
-    }
-    
-    template <>
-    inline ossim_float32 min<ossim_float32>(ossim_float32 a, ossim_float32 b)
-    {
-       if (ossim::isnan(a)||ossim::isnan(b))
-       {
-          return ossim::nan();
-       }
-       else
-       {
-          return (a < b) ? a : b;
-       }
-    }
-    
-    template <>
-    inline ossim_float64  min<ossim_float64>(ossim_float64  a, ossim_float64 b)
-    {
-       if (ossim::isnan(a)||ossim::isnan(b))
-       {
-          return ossim::nan();
-       }
-       else
-       {
-          return (a < b) ? a : b;
-       }
-    }
-    
-    template <class T>
-    inline T max(T a, T b)
-       // max of a,b; nan if either a or b are nan
-    {
-       return (a < b) ? b : a;
-    }
-    template <>
-    inline ossim_float32 max<ossim_float32>(ossim_float32 a, ossim_float32 b)
-    {
-       if (ossim::isnan(b))
-          return b;
-       else
-          return (a < b) ? b : a;       
-    }
-    template <>
-    inline ossim_float64 max<ossim_float64>(ossim_float64 a, ossim_float64 b)
-    {
-       if (ossim::isnan(b))
-          return b;
-       else
-          return (a < b) ? b : a;       
-    }
-    inline double radiansToDegrees(double x) { return x*DEG_PER_RAD;}
-    inline double degreesToRadians(double x) { return x*RAD_PER_DEG;}
-    inline double cosd(double x)             { return std::cos(x*RAD_PER_DEG); }
-    inline double sind(double x)             { return std::sin(x*RAD_PER_DEG); }
-    inline double tand(double x)             { return std::tan(x*RAD_PER_DEG); }
-        // trig fncs with parameter in degrees
-        
-    inline double acosd(double x)            { return DEG_PER_RAD*std::acos(x); }
-    inline double asind(double x)            { return DEG_PER_RAD*std::asin(x); }
-    inline double atand(double x)            { return DEG_PER_RAD*std::atan(x); }
-    inline double atan2d(double y, double x) { return DEG_PER_RAD*std::atan2(y,x); }
-        // trig fncs with result in degrees
-
-    template <class IntType>
-    IntType gcd(IntType n, IntType m)
-        // greatest common divisor of two ints
-        // NB: We use n and m as temporaries in this function, so there is no value
-        //     in using const IntType& as we would only need to make a copy anyway...
-        {
-            IntType zero(0);    // Avoid repeated construction
-            
-            // This is abs() - given the existence of broken compilers with Koenig
-            // lookup issues and other problems, I code this explicitly. (Remember,
-            // IntType may be a user-defined type).
-            if (n < zero)
-                n = -n;
-            if (m < zero)
-                m = -m;
-            
-            // As n and m are now positive, we can be sure that %= returns a
-            // positive value (the standard guarantees this for built-in types,
-            // and we require it of user-defined types).
-            for (;;) {
-                if (m == zero)
-                    return n;
-                n %= m;
-                if (n == zero)
-                    return m;
-                m %= n;
-            }
-        }
-
-    template <>
-    inline int gcd<int>(int n, int m)
-        // greatest common divisor specialize for int.
-        // XXX this is the old gcd, the above code is the old ossimGcd().
-        //     i made this a specialization of the template above,
-        //     is this really necessary or more efficient, or can we safely delete this specialization?
-        //     i don't know why this fnc must be decled inline, otherwise there's a compile error.
-        //     the simple test case doesn't have this problem.
-        { 
-            if (m == 0)
-                return n;
-            else
-                return gcd(m, n % m);  // gcc can optimize tail calls right?
-        }
-
-    template <class IntType>
-    IntType lcm(IntType n, IntType m)
-        // least common multiple
-        // NB: We use n and m as temporaries in this function, so there is no value
-        //     in using const IntType& as we would only need to make a copy anyway...
-        {
-            IntType zero(0);    // Avoid repeated construction
-            
-            if (n == zero || m == zero) {
-                return zero;
-            } else {
-                n /= gcd(n, m);
-                n *= m;
-                if (n < zero)
-                    n = -n;
-                return n;
-            }
-        }
-    
-    template<class T> 
-    inline T square(T x)
-        { return x*x; }
-        
-    // identical to copysign() but usable in templates
-    template <class T>
-    inline T sgn(T x) 
-        // signum function, returns 0, 1, -1, or nan
-        {
-            const T table[] = {T(0), T(1), T(-1)};
-            return table[((x < T(0)) << 1) | (x > T(0))];
-        }
-    template <>
-    inline ossim_float32 sgn<ossim_float32>(ossim_float32 x) 
-        // signum function, returns 0, 1, -1, or nan
-        {
-            const ossim_float32 table[] = {ossim_float32(0), ossim_float32(1), ossim_float32(-1)};
-            return ossim::isnan(x) ? x : table[((x < ossim_float32(0)) << 1) | (x > ossim_float32(0))];
-        }
-    template <>
-    inline ossim_float64 sgn(ossim_float64 x) 
-        // signum function, returns 0, 1, -1, or nan
-        {
-            const ossim_float64 table[] = {ossim_float64(0), ossim_float64(1), ossim_float64(-1)};
-            return ossim::isnan(x) ? x : table[((x < ossim_float64(0)) << 1) | (x > ossim_float64(0))];
-        }
-
-    template <class R, class F>    
-    inline R round(F x)
-        // correctly round a float, and cast to desired type R
-        {
-            R result = static_cast<R>((x < F(0)) ? std::ceil(x - F(0.5)) : std::floor(x + F(0.5)));
-            
-            ossimENSURE(ossim::isnan(x) == ossim::isnan(result));   // if x is nan, R must be a float type
-            return result;
-            
-            // XXX is this better than use of ceil/floor?:    return static_cast<long long>((x < T(0)) ? x - T(0.5) : x + T(0.5));
-        }
-
-    inline double ft2mtrs(double feet)      { return (feet * MTRS_PER_FT); }
-    inline double usft2mtrs(double feet)    { return (feet * US_METERS_PER_FT); }
-    inline double mtrs2ft(double meters)    { return (meters / MTRS_PER_FT); }
-    inline double mtrs2usft(double meters)  { return (meters / US_METERS_PER_FT); }
-        // Common conversion functions
-
-    template <class T>
-    std::pair<T, T> quadraticRoots(T a, T b, T c)
-	// evaluates quadradic formula (positive sqrt is first)
-	{
-            // XXX could suffer from catastrophic cancellation, 
-            // see David Goldberg's "What Every Computer Scientist Should Know About Floating-Point Arithmetic"
-	    T s = std::sqrt(b*b - T(4)*a*c);
-	    T twoA = T(2)*a;
-            return std::pair<T, T>((-b + s)/twoA, (-b - s)/twoA); 
-	}
-
-    template <class T>
-    inline void memClear(T& var, int z = 0)
-	// zero out a variable's memory (for a given value of zero)
-	{ memset(&var, z, sizeof(T)); }
-
-    template <class T>
-    inline void memClear(T* var)
-        // prevent user from accidentally passing in a pointer to his struct
-        { ossimSTATIC_CHECK(false, YOU_PROBABLY_WANT_TO_MEMCLEAR_WHAT_THE_POINTER_POINTS_TO_NOT_THE_POINTER_ITSELF); }
-
-    OSSIM_DLL ossimByteOrder byteOrder();
-        // test endianness of current machine 
-
-    // values for various scalar types
-    OSSIM_DLL double defaultMin(ossimScalarType scalarType);
-    OSSIM_DLL double defaultMax(ossimScalarType scalarType);
-    OSSIM_DLL double defaultNull(ossimScalarType scalarType);
-    OSSIM_DLL ossim_uint32 scalarSizeInBytes(ossimScalarType scalarType);
-    
-    /** @brief @return true if scalar type is signed, false if not. */
-    OSSIM_DLL bool isSigned(ossimScalarType scalarType);
-
-    /**
-     * @brief Get actual bits per pixel for a given scalar type.
-     * 
-     * This is bits used.  (OSSIM_USHORT11 = 11)
-     * 
-     * @returns The actual bits per pixel.  This will return 0 if the
-     * input connection is not hooked up or there is an unhandled scalar type.
-     */
-    OSSIM_DLL ossim_uint32 getActualBitsPerPixel(ossimScalarType scalarType);
-    
-    /**
-     * @brief Get bits per pixel for a given scalar type.
-     * 
-     * This the total bits per pixel.  (OSSIM_USHORT11 = 16)
-     * 
-     * @returns The bits per pixel.  This will return 0 if the
-     * input connection is not hooked up or there is an unhandled scalar type.
-     */
-    OSSIM_DLL ossim_uint32 getBitsPerPixel(ossimScalarType scalarType);  
-        
-    OSSIM_DLL void defaultTileSize(ossimIpt& tileSize);
-
-    OSSIM_DLL std::string convertHtmlSpecialCharactersToNormalCharacter(const std::string& src);
-
-    /** Heading pitch roll extraction from a matrix. */
-    OSSIM_DLL bool matrixToHpr( ossim_float64 hpr[3],
-                                const NEWMAT::Matrix& rotation );
-
-    /** Heading pitch roll extraction from a matrix. */
-    OSSIM_DLL bool matrixToHpr( ossim_float64 hpr[3],
-                                const NEWMAT::Matrix& lsrMatrix,
-                                const NEWMAT::Matrix& rotationalMatrix);
-    
-    OSSIM_DLL void lexQuotedTokens(const std::string& str,
-                                   ossim_uint32 start,
-                                   const char* whitespace,
-                                   const char* quotes,
-                                   std::vector<std::string>& tokens, bool& unbalancedQuotes);
-   /**
-    * Will take a vector of ossimDpt and convert to a string list separated by spaces
-    * For example: 
-    *      (45,34) (12,34)
-    */
-   
-   OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
-                               const std::vector<ossimDpt>& pointList,
-                               char separator=' ');
-   OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
-                               const std::vector<ossimIpt>& pointList,
-                               char separator = ' ');
-   OSSIM_DLL void toStringList(ossimString& resultStringOfPoints,
-                               const std::vector<ossimGpt>& pointList,
-                               char seaprator = ' ');
-   
-   /**
-    * Will take a string list separated by spaces and convert to a vector of ossimDpts.  It will not clear
-    * the passed in list but will append all points found.
-    */
-   OSSIM_DLL void toVector(std::vector<ossimDpt>& result,
-                           const ossimString& stringOfPoints);
-   OSSIM_DLL void toVector(std::vector<ossimIpt>& result,
-                           const ossimString& stringOfPoints);
-   OSSIM_DLL void toVector(std::vector<ossimGpt>& result,
-                           const ossimString& stringOfPoints);
-   
-   /**
-    * This will output a vector of values inst a string
-    *
-    *  (value1,...,valueN)
-    *
-    * Parenthesis are required
-    */ 
-   template <class T>
-   void toSimpleStringList(ossimString& result,
-                           const std::vector<T>& valuesList)
-   {
-      std::ostringstream out;
-      
-      if(!valuesList.empty())
-      {
-         ossim_uint32 idx = 0;
-         ossim_uint32 size = (ossim_uint32) (valuesList.size()-1);
-         for(idx = 0; idx < size; ++idx)
-         {
-            out << valuesList[idx] << ",";
-         }
-         out << valuesList[size];
-      }
-      
-      result = "("+out.str()+")";
-   }
-   
-   /**
-    * This will output a vector of values inst a string
-    *
-    *  (value1,...,valueN)
-    *
-    * Specialize the char for it will output the actual ascii char instead of the numeric value
-    *
-    * Parenthesis are required
-    */ 
-   template <>
-   OSSIM_DLL void toSimpleStringList(ossimString& result,
-                                     const std::vector<ossim_uint8>& valuesList);
-   
-   /**
-    * Generic function to extract a list of values into a vector of string where
-    * the string of points is of the form:
-    *
-    * (value1,value2, ... , )
-    *
-    * Parenthesis are required
-    */ 
-   OSSIM_DLL bool extractSimpleValues(std::vector<ossimString>& values,
-                                      const ossimString& stringOfPoints);
-
-   
-  template <class T>  bool toSimpleVector(std::vector<T>& result, const ossimString& stringOfPoints)
-  {
-     std::istringstream in(stringOfPoints);
-     ossim::skipws(in);
-     bool returnValue = true;
-     char c = in.get();
-     ossimString value = "";
-     if(c == '(')
-     {
-        c = (char)in.get();
-        while( (c!=')') && (c!= '\n') && (in.good()) )
-        {
-           if(c!= ',')
-           {
-              value += ossimString(c);
-           }
-           else
-           {
-              result.push_back(static_cast<T>(value.toDouble()));
-              value = "";
-           }
-           c = in.get();
-        }
-     }
-     if(c!= ')')
-     {
-        returnValue = false;
-     }
-     else
-     {
-        if(!value.empty())
-        {
-           result.push_back(static_cast<T>(value.toDouble()));
-        }
-     }
-     
-     return returnValue;
-  }
-   
-   /**
-    *  Takes input format of the form:
-    *  (value1,value2,...,valueN)
-    */
-  OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint32>& result,
-                                const ossimString& stringOfPoints);
-   /**
-    *  Takes input format of the form:
-    *  (value1,value2,...,valueN)
-    */
-  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int32>& result,
-                                const ossimString& stringOfPoints);
-   /**
-    *  Takes input format of the form:
-    *  (value1,value2,...,valueN)
-    */
-   OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint16>& result,
-                                 const ossimString& stringOfPoints);
-   /**
-    *  Takes input format of the form:
-    *  (value1,value2,...,valueN)
-    */
-  OSSIM_DLL bool toSimpleVector(std::vector<ossim_int16>& result,
-                                const ossimString& stringOfPoints);
-   /**
-    *  Takes input format of the form:
-    *  (value1,value2,...,valueN)
-    */
-   OSSIM_DLL bool toSimpleVector(std::vector<ossim_uint8>& result,
-                                 const ossimString& stringOfPoints);
-   /**
-    *  Takes input format of the form:
-    *  (value1,value2,...,valueN)
-    */
-   OSSIM_DLL bool toSimpleVector(std::vector<ossim_int8>& result,
-                                 const ossimString& stringOfPoints);
-   
-        // lex str into tokens starting at position start using whitespace  
-	//    chars as delimiters and quotes[0] and quotes[1] as the opening
-	//    and closing quotation chars (for quoting tokens containing whitespace).
-	//    unbalancedQuotes is true iff it aborted when detecting unbalanced quoting.
-	// REQUIRE(whitespace != NULL);
-	// REQUIRE(quotes != NULL);
-	// REQUIRE(tokens != NULL);
-	// REQUIRE(unbalancedQuotes != NULL);
-
-   /**
-    * @brief Get the number threads to use from ossimPreferences or OpenThreads.
-    *
-    * Keyword searched for is:  "ossim_threads"
-    *
-    * If keyword is not found OpenThreads::GetNumberOfProcessors() is used.
-    *
-    * @return Number of threads. Default=1
-    */
-   OSSIM_DLL ossim_uint32 getNumberOfThreads();
-
-   /**
-    * @brief Gets the current time.
-    *
-    * Example formats and output:
-    * format = "%Y-%m-%dT%H:%M:%SZ" output = "2014-03-06T13:55:10Z"
-    *
-    * @param format E.g. "%Y-%m-%dT%H:%M:%SZ"
-    *
-    * @param gmtFlag If true get the zulu time; else, gets the local time.
-    *
-    * @param result Initialized by this with result.
-    *
-    * E.g. "2014-03-06T13:55:10Z"
-    * 
-    * @note If an error occurs result will be empty.
-    */
-   OSSIM_DLL void getFormattedTime( const std::string& format,
-                                    bool gmtFlag,
-                                    std::string& result );
-
-   /**
-    * @brief Computes the number of decimation levels to get to the overview
-    * stop dimension.
-    *
-    * This uses ossim preferences "overview_stop_dimension" value if set else
-    * it uses the default tile size to compute the number of levels.
-    * 
-    * @param rect The rectangle of the first level.
-    *
-    * @return The number of decimation levels needed.
-    */
-   OSSIM_DLL ossim_uint32 computeLevels(const ossimIrect& rect);   
-
-} // End: namespace ossim
-
-
-#endif /* #ifndef ossimCommon_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimConnectableDisplayListener.h b/ossim/include/ossim/base/ossimConnectableDisplayListener.h
deleted file mode 100644
index 7a88f2b..0000000
--- a/ossim/include/ossim/base/ossimConnectableDisplayListener.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2004, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ossimConnectableDisplayListener
-// 
-// This class is intended for connectable displays that wants to be a
-// ossimConnectableObjectListener and a ossimDisplayEventListener to avoid
-// a triangle inheritance.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimConnectableDisplayListener.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimConnectableDisplayListener_HEADER
-#define ossimConnectableDisplayListener_HEADER
-
-#include <ossim/base/ossimListener.h>
-
-class ossimConnectionEvent;
-class ossimObjectDestructingEvent;
-class ossimPropertyEvent;
-class ossimContainerEvent;
-class oossimDisplayListEvent;
-class ossimRefreshEvent;
-class ossimDisplayListEvent;
-class ossimDisplayRefreshEvent;
-
-/**
- * This class is intended for connectable displays that wants to be a
- * ossimConnectableObjectListener and a ossimDisplayEventListener to avoid
- * a triangle inheritance.
- */
-class OSSIMDLLEXPORT ossimConnectableDisplayListener : public ossimListener
-{
-public:
-
-   /** default constructor */
-   ossimConnectableDisplayListener();
-
-   /**
-    * Method called by listener managers.  This will in turn call the correct
-    * xxxEvent method.
-    *
-    * @param event Event to handle.
-    */
-   virtual void processEvent(ossimEvent& event);
-
-   /** @param event Event to handle signifying an object destroying. */
-   virtual void objectDestructingEvent(ossimObjectDestructingEvent& event);
-
-   /** @param event Event to handle signifying an object connecting. */
-   virtual void connectionEvent(ossimConnectionEvent& event);
-
-   /** @param event Event to handle signifying a disconnect input event. */
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-
-   /** @param event Event to handle signifying an output disconnect event. */
-   virtual void disconnectOutputEvent(ossimConnectionEvent& event);
-
-   /** @param event Event to handle signifying a connect input event. */
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-
-   /** @param event Event to handle signifying a connect  output event. */
-   virtual void connectOutputEvent(ossimConnectionEvent& event);
-
-   /**
-    * @param event Event to handle signifying a property has changed  event.
-    */
-   virtual void propertyEvent(ossimPropertyEvent& event);
-
-   /**
-    * @param event Event to handle signifying a dislay list  has changed
-    * event.
-    */
-   virtual void displayListEvent(ossimDisplayListEvent&);
-
-   /**
-    * @param event Event to handle signifying a dislay refresh
-    * is needed.
-    */
-   virtual void displayRefreshEvent(ossimDisplayRefreshEvent&);
-
-   /**
-    * @param event Event to handle signifying a refresh is needed.
-    */
-   virtual void refreshEvent(ossimRefreshEvent& event);
-
-   /**
-    * Container Events:
-    * Typically isued by objects that contain children.  If anyone is
-    * interested, can latch on to this event.  Other objects within the
-    * system might be interest in this event even 
-    */
-
-   /** @param event Event signifying an object was added to a container. */
-   virtual void addObjectEvent(ossimContainerEvent& event);
-
-   /** @param event Event signifying an object was removed from a container. */
-   virtual void removeObjectEvent(ossimContainerEvent& event);
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimConnectableObject.h b/ossim/include/ossim/base/ossimConnectableObject.h
deleted file mode 100644
index 21a496c..0000000
--- a/ossim/include/ossim/base/ossimConnectableObject.h
+++ /dev/null
@@ -1,601 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-// Description:
-// 
-// Contains class declaration for ossimConnectableObject the base class for
-// all connectable objects.
-//
-//*************************************************************************
-// $Id: ossimConnectableObject.h 21852 2012-10-21 20:16:04Z dburken $
-
-#ifndef ossimConnectableObject_HEADER
-#define ossimConnectableObject_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimId.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimListenerManager.h>
-#include <ossim/base/ossimPropertyInterface.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <vector>
-
-class ossimVisitor;
-class ossimConnectableContainer;
-
-class  OSSIMDLLEXPORT  ossimConnectableObject : public ossimObject,
-                                                public ossimListenerManager,
-                                                public ossimPropertyInterface
-{
-public:
-   typedef std::vector<ossimRefPtr<ossimConnectableObject> > ConnectableObjectList;
-   enum ossimConnectableObjectDirectionType
-   {
-      CONNECTABLE_DIRECTION_NONE   = 0,
-      CONNECTABLE_DIRECTION_INPUT  = 1,
-      CONNECTABLE_DIRECTION_OUTPUT = 2
-   };
-   /**
-    * Base constructor of this object.
-    */
-   ossimConnectableObject(ossimObject* owner=0);
-   ossimConnectableObject(ossimObject* owner,
-                          ossim_int32 inputListSize,
-                          ossim_int32 outputListSize,
-                          bool inputListIsFixedFlag=true,
-                          bool outputListIsFixedFlag=true);
-
-   virtual ~ossimConnectableObject();
-   /**
-    * All connectable objects will have id's.  This allows us to
-    * set the id of this object.
-    */
-   void setId(const ossimId& id);
-
-   /**
-    * Will allow us to get this object's id.
-    */
-   const ossimId& getId()const;
-   
-   /**
-    * Fetches the current owner, most likely a container but not limited to one.
-    */
-   const ossimObject* getOwner() const;
-
-   /**
-    * Permits changing the object's owner.
-    */
-   virtual void changeOwner(ossimObject* owner);
-
-   virtual void setDescription(const ossimString& description);
-   virtual ossimString getDescription()const;
-   
-   /**
-    * will check the direction specified to see if all slots are full.
-    * If any slot is null then false is returned.
-    * If a filter requires options testing they
-    * need to override this method.  The argument can be ored together. If you
-    * want both checked then pass
-    * CONNECTABLE_DIRECTION_INPUT | CONNECTABLE_DIRECTION_OUTPUT
-    */
-   virtual bool isConnected(
-      ossimConnectableObjectDirectionType direction = CONNECTABLE_DIRECTION_INPUT)const;
-
-
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not achieve exactly
-    * what you want then you can derive new rules by overriding the virtual
-    * visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimIdVisitor visitor(id, false, ossimVisitor::VISIT_CHILDREN |
-    *    ossimVisitor::VISIT_INPUTS);
-    *    connectableObject->accept(visitor);
-    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findConnectableObject(
-                             const ossimId& id));
-
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not achieve exactly
-    * what you want then you can derive new rules by overriding the virtual
-    * visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeIdVisitor visitor(typeId, true, ossimVisitor::VISIT_CHILDREN |
-    *    ossimVisitor::VISIT_INPUTS);
-    *    connectableObject->accept(visitor);
-    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObjectOfType(
-                             RTTItypeid typeId,
-                             ossimConnectableObjectDirectionType directionType,
-                             bool recurse = true));
-
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding
-    * the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeNameVisitor visitor(typeName, true,
-    *    ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
-    *    connectableObject->accept(visitor);
-    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObjectOfType(
-                             const ossimString& obj,
-                             ossimConnectableObjectDirectionType directionType,
-                             bool recurse = true));
-   
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding
-    * the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeNameVisitor visitor(typeName, true,
-    *    ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
-    *    connectableObject->accept(visitor);
-    *    ossimRefPtr<ossimConnectableObject> object = visitor.getObject();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findInputObjectOfType(
-                             const ossimString& className));
-   
-   /**
-    * Return a valid index of the input list if the passed in object
-    * is found else return -1.
-    */
-   virtual ossim_int32 findInputIndex(const ossimConnectableObject* object);
-
-   /**
-    * Return a valid index of the input list if the passed id
-    * is found else return -1.
-    */
-   virtual ossim_int32 findInputIndex(const ossimId& id);
-
-   /**
-    * Return a valid index of the output list if the passed in object
-    * is found else return -1.
-    */
-   virtual ossim_int32 findOutputIndex(const ossimConnectableObject* object);
-
-   /**
-    * Return a valid index of the output list if the passed in object
-    * is found else return -1.
-    */   
-   virtual ossim_int32 findOutputIndex(const ossimId& id);
-   
-   /**
-    * Should return the first available index to connect to.  The
-    * connectMyInputTo that just takes another ossimConnectableObject as input
-    * and not an index will call this method.  By default this method will find
-    * the first open slot (not null) or append o the list if it's dynamic. If
-    * the list is dynamic it calls conConnectMyInputTo(index, object) on an
-    * index = to listSize.
-    */
-   virtual ossim_int32 getMyInputIndexToConnectTo(
-      ossimConnectableObject* object)const;
-   
-
-   /**
-    * Should return the first available index to connect to.  The
-    * connectMyOutputTo that just takes another ossimConnectableObject as input\
-    * and not an index will call this method.  By default this method will find
-    * the first open slot (not null) or append to the list if it's dynamic. If
-    * the list is dynamic it calls canConnectMyOutputTo(index, object) on an
-    * index = to listSize.
-    */
-   virtual ossim_int32 getMyOutputIndexToConnectTo(
-      ossimConnectableObject* object)const;
-   
-   /**
-    * required to be overriden by derived classes
-    */
-   virtual bool canConnectMyInputTo(
-      ossim_int32 myInputIndex, const ossimConnectableObject* object)const=0;
-   
-   /**
-    * default implementation is to allow anyone to connect to us.
-    */
-   virtual bool canConnectMyOutputTo(ossim_int32 myOutputIndex,
-                                     const ossimConnectableObject* object)const;
-   
-   /**
-    * Will disconnect the object passed in.
-    */
-   virtual void disconnect(ossimConnectableObject* object=0);
-
-   /**
-    * Will disconnect the object passed in.
-    */
-   virtual void disconnect(const ossimId& id);
-   
-   /**
-    * Will disconnect the object at the given input index and generate
-    * a connection event.
-    */
-   virtual ossimRefPtr<ossimConnectableObject> disconnectMyInput(
-      ossim_int32 inputIndex,
-      bool disconnectOutputFlag=true,
-      bool createEventFlag = true);
-   
-  /**
-   * Finds the index of the passed in input and calls
-   * disconnectMyInput(inputIndex, disconnectOutputFlag, createEventFlag);
-   */
-   virtual void disconnectMyInput(ossimConnectableObject* input,
-                                  bool disconnectOutputFlag=true,
-                                  bool createEventFlag = true);
-   /**
-    *
-    */
-   virtual void disconnectMyInputs(
-      ConnectableObjectList& inputList,
-      bool disconnectOutputFlag=true,
-      bool createEventFlag=true);
-   
-   /**
-    * Will disconnect the object at the given output index and generate
-    * a connection event.  If there is no object at that index then no
-    * event is generated and NULL is returned.  The disconnectOutputFlag
-    * says do you want this method to disconnect the output pointer to
-    * this object.
-    */
-   virtual ossimRefPtr<ossimConnectableObject> disconnectMyOutput(
-      ossim_int32 outputIndex,
-      bool disconnectInputFlag=true,
-      bool createEventFlag = true);
-   
-   /**
-    * Will disconnect the output object.  It will get the index of
-    * the object and call disconnectMyOutput(index, disconnectOutputFlag).
-    */
-   virtual void disconnectMyOutput(ossimConnectableObject* output,
-                                   bool disconnectInputFlag=true,
-                                   bool createEventFlag=true);
-
-   virtual void disconnectMyOutputs(
-      ConnectableObjectList& outputList,
-      bool disconnectOutputFlag=true,
-      bool createEventFlag=true);
-   
-   /**
-    * Will disconnect all of the input objects.
-    */
-   virtual void disconnectAllInputs();
-
-   /**
-    * Will disconnect all of the output objects.
-    */
-   virtual void disconnectAllOutputs();
-
-   /**
-    * Will try to connect this objects input to the passed in object.
-    * It will return a valid index >= 0 if successful.  Will use the
-    * getMyInputIndexToConnectTo method to implement the connection
-    */
-   virtual ossim_int32 connectMyInputTo(ossimConnectableObject* inputObject,
-                                        bool makeOutputConnection=true,
-                                        bool createEventFlag=true);
-
-   /**
-    * Will connect the specified input to the passed in object
-    */
-   virtual ossim_int32 connectMyInputTo(ossim_int32 inputIndex,
-                                        ossimConnectableObject* inputObject,
-                                        bool makeOutputConnection=true,
-                                        bool createEventFlag=true);
-   
-   virtual bool connectMyInputTo(
-      ConnectableObjectList& inputList,
-      bool makeOutputConnection=true,
-      bool createEventFlag = true);   
-
-   /**
-    * Will try to connect this objects output to the passed in object.
-    * It will return a valid index >= 0 if successful.  It will in turn call
-    * the passed in objects connect input command if makeInputConnection
-    * is set to true.
-    *
-    * Will use the getMyOutputIndexToConnectTo to implement this method
-    */
-   virtual ossim_int32 connectMyOutputTo(ossimConnectableObject* outputObject,
-                                         bool makeInputConnection=true,
-                                         bool createEventFlag=true);
-   
-   virtual bool connectMyOutputTo(
-      ConnectableObjectList& outputList,
-      bool makeInputConnection=true,
-      bool createEventFlag=true);
-   
-   /**
-    * Will disconnect itself from all inputs and reset to the passed in
-    * input list.  It will return true if all objects were successfully
-    * added.
-    */
-   virtual bool connectInputList(
-      ConnectableObjectList& inputList);
-   
-   /**
-    * Will disconnect itself from all outputs and reset to the passed in
-    * output list.  It will return true if all objects were successfully
-    * added.
-    */
-   virtual bool connectOutputList(
-      ConnectableObjectList& outputList);
-   
-   /**
-    * Returns the number of input objects.
-    */
-   virtual ossim_uint32 getNumberOfInputs()const;
-
-   /**
-    * Return the number of output objects
-    */
-   virtual ossim_uint32 getNumberOfOutputs()const;
-   
-   /**
-    * returns the object at the specified index.
-    * if the index is not valid then NULL is
-    * returned
-    */
-   ossimConnectableObject* getInput(ossim_uint32 index=0);   
-
-   /**
-    * returns the object at the specified index.
-    * if the index is not valid then NULL is
-    * returned
-    */
-   const ossimConnectableObject* getInput(ossim_uint32 index=0)const;
-
-   /**
-    * returns the object at the specified index.
-    * if the index is not valid then NULL is
-    * returned
-    */
-   ossimConnectableObject* getOutput(ossim_uint32 index=0);
-
-   /**
-    * returns the object at the specified index.
-    * if the index is not valid then NULL is
-    * returned
-    */
-   const ossimConnectableObject* getOutput(ossim_uint32 index=0)const;
-   
-   /**
-    * Will set the number of inputs.  This will expand the list if the number
-    * of inputs is larger than the current number of inputs.  Will shrink
-    * the list if the current number of inputs is larger than the passed in
-    * inputs.
-    */
-   virtual void setNumberOfInputs(ossim_int32 numberOfInputs);
-
-   virtual bool getInputListIsFixedFlag()const;
-   
-   virtual bool getOutputListIsFixedFlag()const;
-
-   /**
-    * Will set the number of outputs.  This will expand the list if the
-    * number of outputs is larger than the current number of outputs.
-    * Will shrink the list if the current number of outputs is larger than
-    * the passed in outputs.
-    */
-   virtual void setNumberOfOutputs(ossim_int32 numberOfInputs);
-   
-   const ConnectableObjectList& getInputList()const;
-
-   const ConnectableObjectList& getOutputList()const;
-
-   ConnectableObjectList& getInputList();
-
-   ConnectableObjectList& getOutputList();
-
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not achieve exactly
-    * what you want then you can derive new rules by overriding the virtual
-    * visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeNameVisitor visitor("<put type name here>",
-    *    false, ossimVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-    OSSIM_DEPRECATE_METHOD(virtual void findAllObjectsOfType(
-                              ConnectableObjectList& result,
-                              const RTTItypeid& typeInfo, bool recurse=true) );
-    
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not achieve exactly
-    * what you want then you can derive new rules by overriding the virtual
-    * visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeNameVisitor visitor("<put type name here>", false,
-    *    ossimVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual void findAllObjectsOfType(
-                             ConnectableObjectList& result,
-                             const ossimString& className,
-                             bool recurse=true));
-
-#if 0 /* Deprecated code. Left here until thoroughly debugged. (drb) */
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding
-    * the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeIdVisitor visitor(<put type id here>, false,
-    *    ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
-    *    connectableObject->accept(visitor);
-    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual void findAllInputsOfType(
-      ConnectableObjectList& result,
-      const RTTItypeid& typeInfo,
-      bool propagateToInputs=true,
-      bool recurseChildren=false));
-   
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by
-    * using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding
-    * the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeNameVisitor visitor("<put type name here>",
-    *    false, ossimVisitor::VISIT_CHILDREN | ossimVisitor::VISIT_INPUTS);
-    *    connectableObject->accept(visitor);
-    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-   
-   OSSIM_DEPRECATE_METHOD(virtual void findAllInputsOfType(
-                             ConnectableObjectList& result,
-                             const ossimString& className,
-                             bool propagateToInputs=true,
-                             bool recurseChildren=false));
-#endif  /* deprecated code. (drb) */
-
-   virtual void propagateEventToOutputs(ossimEvent& event);
-   virtual void propagateEventToInputs(ossimEvent& event);
-
-   /* ------------------- PROPERTY INTERFACE -------------------- */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual void setProperty(const ossimString& name, const ossimString& value);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   /* ------------------ PROPERTY INTERFACE END ------------------- */
-
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0)const;
-
-   /**
-    * Save the state of all inputs to a keyword list.  This will do a
-    * recursive call through all inputs and save their state to a
-    * keyword list.
-    *
-    * @param kwl Keyword list to save state to.
-    *
-    * @param saveThisStateFlag If the true the state of this object will be
-    * saved as well as all inputs. Default = true.
-    *
-    * @param  objectIndex Index to be used for prefix.  So if
-    * objectIndex = 1, the first object will have a prefix of: "object1."
-    * Default = 1.
-    *
-    * @param prefix Prefix to tack onto keyword.  If prefix = "myChain." and
-    * objectIndex = 1, then the first keyword would be
-    * "myChain.object1.some_keyword".
-    *
-    * @return Returns the next object index.  This is the last index used
-    * plus one.  Used internally to keep track of index to use for prefix.
-    */
-   virtual ossim_uint32 saveStateOfAllInputs(ossimKeywordlist& kwl,
-                                             bool saveThisStateFlag=true,
-                                             ossim_uint32 objectIndex=1,
-                                             const char* prefix=0) const;
-
-   /**
-    * Inserts this object and all of its children and inputs into the container
-    * provided.
-    * @return Returns TRUE if successful.
-    */
-   virtual bool fillContainer(ossimConnectableContainer& container);
-
-   /**
-    * Moves the input connection matching id up one in the connection list.
-    * @param id The id to move.
-    * @return true if action was performed, false if not.
-    */
-   bool moveInputUp(const ossimId& id);
-
-   /**
-    * Moves the input connection matching id down one in the connection list.
-    * @param id The id to move.
-    * @return true if action was performed, false if not.
-    */
-   bool moveInputDown(const ossimId& id);
-
-   /**
-    * Moves the input connection matching id to the top of the connection list.
-    * @param id The id to move.
-    * @return true if action was performed, false if not.
-    */   
-   bool moveInputToTop(const ossimId& id);
-
-   /**
-    * Moves the input connection matching id to the bottom of the connection
-    * list.
-    * @param id The id to move.
-    * @return true if action was performed, false if not.
-    */     
-   bool moveInputToBottom(const ossimId& id);
-   
-   /**
-    * We will add a visitor interface for all connectable objects.
-    */
-   virtual void accept(ossimVisitor& visitor);
-   
-protected:
-
-   ossimConnectableObject* findObjectOfType(
-      ConnectableObjectList* connectableList,
-      ossimVisitor& visitor );
-   
-   ossimId      theId;
-   ossimString  theDescription;
-   ossimObject* theOwner;
-
-   /**
-    * Indicates whether the theInputObjectList is fixed
-    */
-   bool theInputListIsFixedFlag;
-
-   /**
-    * Indicates whether the theOutputObjectList is fixed
-    */
-   bool theOutputListIsFixedFlag;
-   
-   /**
-    * Holds a list of input objects.
-    */
-   ConnectableObjectList theInputObjectList;
-   
-   /**
-    * Holds a list of output objects.
-    */
-   ConnectableObjectList theOutputObjectList;
-
-private:
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimConnectableObject_HEADER */
diff --git a/ossim/include/ossim/base/ossimConnectionEvent.h b/ossim/include/ossim/base/ossimConnectionEvent.h
deleted file mode 100644
index 92c595d..0000000
--- a/ossim/include/ossim/base/ossimConnectionEvent.h
+++ /dev/null
@@ -1,80 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//*************************************************************************
-// $Id: ossimConnectionEvent.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimConnectionEvent_HEADER
-#define ossimConnectionEvent_HEADER
-
-#include <vector>
-
-#include <ossim/base/ossimEventIds.h>
-#include <ossim/base/ossimEvent.h>
-#include <ossim/base/ossimConnectableObject.h>
-
-class OSSIMDLLEXPORT ossimConnectionEvent : public ossimEvent
-{
-public:
-   enum ossimConnectionDirectionType
-   {
-      OSSIM_DIRECTION_UNKNOWN  = 0,
-      OSSIM_INPUT_DIRECTION    = 1,
-      OSSIM_OUTPUT_DIRECTION   = 2,
-      OSSIM_INPUT_OUTPUT_DIRECTION = 3
-   };
-   
-   ossimConnectionEvent(ossimObject* object=NULL,
-                        long id=OSSIM_EVENT_NULL_ID);
-
-   ossimConnectionEvent(ossimObject* object,
-                        long id,
-                        const ossimConnectableObject::ConnectableObjectList& newList,
-                        const ossimConnectableObject::ConnectableObjectList& oldList,
-                        ossimConnectionDirectionType whichDirection);
-
-   ossimConnectionEvent(ossimObject* object,
-                        long id,
-                        ossimConnectableObject* newConnectableObject,
-                        ossimConnectableObject* oldConnectableObject,
-                        ossimConnectionDirectionType whichDirection);
-   
-   ossimConnectionEvent(const ossimConnectionEvent& rhs);
-
-   ossimObject* dup()const;
-   
-   virtual void setDirection(ossimConnectionDirectionType direction);
-   
-   virtual ossimConnectionDirectionType getDirection()const;
-
-   virtual ossim_uint32 getNumberOfNewObjects()const;
-   
-   virtual ossim_uint32 getNumberOfOldObjects()const;
-   
-   virtual ossimConnectableObject* getOldObject(ossim_uint32 i=0);
-
-   virtual ossimConnectableObject* getNewObject(ossim_uint32 i=0);
-
-   virtual bool isDisconnect()const;
-   
-   virtual bool isConnect()const;
-      
-   virtual bool isInputDirection()const;
-   
-   virtual bool isOutputDirection()const;
-   
-protected:
-   ossimConnectableObject::ConnectableObjectList theNewObjectList;
-   ossimConnectableObject::ConnectableObjectList theOldObjectList;
-   ossimConnectionDirectionType         theDirectionType;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimConstants.h b/ossim/include/ossim/base/ossimConstants.h
deleted file mode 100644
index 1d137eb..0000000
--- a/ossim/include/ossim/base/ossimConstants.h
+++ /dev/null
@@ -1,545 +0,0 @@
-/********************************************************************
- *
- * License:  See top level LICENSE.txt file.
- *
- * Author: Ken Melero
- * 
- * Description: Common file for global constants.
- *
- **************************************************************************
- * $Id: ossimConstants.h 22476 2013-11-07 16:08:32Z dburken $
- */
-#ifndef ossimConstants_HEADER
-#define ossimConstants_HEADER 1
-
-#include <ossim/ossimConfig.h>
-
-#ifdef __cplusplus
-#  include <cfloat>
-#else
-#  include <float.h>
-#endif
-
-/**
- * WARNINGS SECTION:
- */
-#ifdef _MSC_VER /* Quiet a bunch of MSVC warnings... */
-#  pragma warning(disable:4786) /* visual c6.0 compiler */
-#  pragma warning(disable:4251)/* for std:: member variable to have dll interface */
-#  pragma warning(disable:4275) /* for std:: base class to have dll interface */
-#  pragma warning(disable:4800) /* int forcing value to bool */
-#  pragma warning(disable:4244) /* conversion, possible loss of data */
-#endif
-#if defined(__GNUC__)
-#   define OSSIM_DEPRECATE_METHOD(func) func __attribute__ ((deprecated))
-#elif defined(_MSC_VER)
-#   define OSSIM_DEPRECATE_METHOD(func)  __declspec(deprecated) func 
-#else
-#   define OSSIM_DEPRECATE_METHOD(func)
-#endif
-   
-/**
- * DLL IMPORT/EXORT SECTION
- */
-#if defined(OSSIM_STATIC)
-#  define OSSIMEXPORT
-#  define OSSIMIMPORT
-#  define OSSIMDLLEXPORT
-#  define OSSIM_DLL
-#  define OSSIMDLLEXPORT_DATA(type) type
-#  define OSSIM_DLL_DATA(type) type
-#  define OSSIMDLLEXPORT_CTORFN 
-#elif defined(__MINGW32__) || defined(__CYGWIN__) || defined(_MSC_VER) || defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
-#  define OSSIMEXPORT __declspec(dllexport)
-#  define OSSIMIMPORT __declspec(dllimport)
-#  ifdef OSSIMMAKINGDLL
-#    define OSSIMDLLEXPORT OSSIMEXPORT
-#    define OSSIM_DLL       OSSIMEXPORT
-#    define OSSIMDLLEXPORT_DATA(type) OSSIMEXPORT type
-#    define OSSIM_DLL_DATA(type) OSSIMEXPORT type
-#    define OSSIMDLLEXPORT_CTORFN
-#  else
-#    define OSSIMDLLEXPORT OSSIMIMPORT
-#    define OSSIM_DLL      OSSIMIMPORT
-#    define OSSIMDLLEXPORT_DATA(type) OSSIMIMPORT type
-#    define OSSIM_DLL_DATA(type) OSSIMIMPORT type
-#    define OSSIMDLLEXPORT_CTORFN
-#  endif
-#else /* not #if defined(_MSC_VER) */
-#  define OSSIMEXPORT
-#  define OSSIMIMPORT
-#  define OSSIMDLLEXPORT
-#  define OSSIM_DLL
-#  define OSSIMDLLEXPORT_DATA(type) type
-#  define OSSIM_DLL_DATA(type) type
-#  define OSSIMDLLEXPORT_CTORFN
-#endif /* #if defined(_MSC_VER) */
-   
-/**
- * Previous DLL import export section.  Commented out, but left just in case.
- */
-#if 0 /* Comment out ALL this mess! */
-#if defined(_MSC_VER) || defined(__VISUALC__) || defined(__BORLANDC__) || defined(__GNUC__) || defined(__WATCOMC__)
-#  if (_MSC_VER >= 1300)	/* MSVC .NET 2003 version */
-#    define OSSIMEXPORT __declspec(dllexport)
-#    define OSSIMIMPORT __declspec(dllimport)
-#  else
-#    define OSSIMEXPORT __declspec(dllexport)
-#    define OSSIMIMPORT __declspec(dllimport)
-#  endif
-#else /* compiler doesn't support __declspec() */
-#   define OSSIMEXPORT
-#   define OSSIMIMPORT
-#endif
-
-#if defined(__WXPM__)
-#  if defined (__WATCOMC__)
-#    define OSSIMEXPORT __declspec(dllexport)
- /*
-   __declspec(dllimport) prepends __imp to imported symbols. We do NOT
-   want that!
- */
-#    define OSSIMIMPORT
-#  elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
-#    define OSSIMEXPORT _Export
-#    define OSSIMIMPORT _Export
-#  endif
-#elif defined(__OSSIMMAC__)
-#  ifdef __MWERKS__
-#    define OSSIMEXPORT __declspec(export)
-#    define OSSIMIMPORT __declspec(import)
-#  endif
-#endif
-
-#if defined(_MSC_VER)
-#  pragma warning(disable:4786) /* visual c6.0 compiler */
-#  pragma warning(disable:4251) /* for std:: member variable to have dll interface */
-#  pragma warning(disable:4275) /* for std:: base class to have dll interface */
-#  pragma warning(disable:4800) /* int forcing value to bool */
-#  pragma warning(disable:4244) /* conversion, possible loss of data */
-
-#  ifdef OSSIMSINGLEDLL /* one gigantic dll, all declared export */
-#    ifdef EXPORT_OSMMATRIX
-#      define EXPORT_OSMMATRIX  OSSIMEXPORT
-#    endif
-#    ifndef OSSIMDLLEXPORT
-#      define OSSIMDLLEXPORT    OSSIMEXPORT
-#    endif
-#    ifdef EXPORT_OSMELEV
-#      define EXPORT_OSMELEV    OSSIMEXPORT
-#    endif
-#    ifdef EXPORT_OSMSPTDATA
-#      define EXPORT_OSMSPTDATA OSSIMEXPORT
-#    endif
-#    ifdef EXPORT_ISO8211
-#      define EXPORT_ISO8211    OSSIMEXPORT
-#    endif
-#    ifdef EXPORT_OSMPROJ
-#      define EXPORT_OSMPROJ    OSSIMEXPORT
-#    endif
-#    ifndef EXPORT_OSMIMAGING
-#      define EXPORT_OSMIMAGING OSSIMEXPORT
-#    endif
-#  else /* individual dlls, each with their own import/export symbols */
-#    ifndef EXPORT_OSMMATRIX
-#      ifdef OSMMATRIX_EXPORTS
-#        define EXPORT_OSMMATRIX OSSIMEXPORT
-#      else
-#        define EXPORT_OSMMATRIX OSSIMIMPORT
-#      endif
-#    endif
-#    ifndef OSSIMDLLEXPORT
-#      ifdef OSMBASE_EXPORTS
-#        define OSSIMDLLEXPORT OSSIMEXPORT
-#      else
-#        define OSSIMDLLEXPORT OSSIMIMPORT
-#      endif
-#    endif
-#    ifndef EXPORT_OSMELEV
-#      ifdef OSMELEV_EXPORTS
-#        define EXPORT_OSMELEV OSSIMEXPORT
-#      else
-#        define EXPORT_OSMELEV OSSIMIMPORT
-#      endif
-#    endif
-#    ifndef EXPORT_OSMSPTDATA
-#      ifdef OSMSPTDATA_EXPORTS
-#        define EXPORT_OSMSPTDATA OSSIMEXPORT
-#      else
-#        define EXPORT_OSMSPTDATA OSSIMIMPORT
-#      endif
-#    endif
-#    ifndef EXPORT_OSMPROJ
-#      ifdef OSMPROJ_EXPORTS
-#        define EXPORT_OSMPROJ OSSIMEXPORT
-#      else
-#        define EXPORT_OSMPROJ OSSIMIMPORT
-#      endif
-#    endif
-#    ifndef EXPORT_ISO8211
-#      ifdef ISO8211_EXPORTS
-#        define EXPORT_ISO8211 OSSIMEXPORT
-#      else
-#        define EXPORT_ISO8211 OSSIMIMPORT
-#      endif
-#    endif
-#    ifndef EXPORT_OSMIMAGING
-#      ifdef OSMIMAGING_EXPORTS
-#        define EXPORT_OSMIMAGING OSSIMEXPORT
-#      else
-#        define EXPORT_OSMIMAGING OSSIMIMPORT
-#      endif
-#    endif
-#  endif
-#else /* defined(_MSC_VER) */
-#  ifdef OSSIMMAKINGDLL
-#    define OSSIMDLLEXPORT OSSIMEXPORT
-#    define OSSIM_DLL       OSSIMEXPORT
-#    define OSSIMDLLEXPORT_DATA(type) OSSIMEXPORT type
-#    define OSSIM_DLL_DATA(type) OSSIMEXPORT type
-#    define OSSIMDLLEXPORT_CTORFN
-#  elif defined(OSSIMUSINGDLL)
-#    define OSSIMDLLEXPORT OSSIMIMPORT
-#    define OSSIM_DLL      OSSIMIMPORT
-#    define OSSIMDLLEXPORT_DATA(type) OSSIMIMPORT type
-#    define OSSIM_DLL_DATA(type) OSSIMIMPORT type
-#    define OSSIMDLLEXPORT_CTORFN
-#  else /* not making nor using DLL */
-#    define OSSIMDLLEXPORT
-#    define OSSIM_DLL
-#    define OSSIM_DLL_DATA(type) type
-#    define OSSIMDLLEXPORT_DATA(type) type
-#    define OSSIMDLLEXPORT_CTORFN
-#  endif
-#  define EXPORT_OSMMATRIX  OSSIMDLLEXPORT
-#  define EXPORT_OSMELEV    OSSIMDLLEXPORT
-#  define EXPORT_OSMSPTDATA OSSIMDLLEXPORT
-#  define EXPORT_OSMPROJ    OSSIMDLLEXPORT
-#  define EXPORT_OSMIMAGING OSSIMDLLEXPORT
-#endif
-#endif /* End of commented out "#if 0" old DLL import/export section. */
-
-/*
-  we know that if this is defined all other types are defined
-  since its included from ossimConfig.h
-*/
-typedef char                   ossim_int8;
-typedef unsigned char          ossim_uint8;
-typedef signed char            ossim_sint8;
-
-typedef short                  ossim_int16;
-typedef unsigned short         ossim_uint16;
-typedef signed short           ossim_sint16;
-
-typedef int                    ossim_int32;
-typedef unsigned int           ossim_uint32;
-typedef signed int             ossim_sint32;
-
-typedef float                  ossim_float32;
-typedef double                 ossim_float64;
-
-
-typedef long long              ossim_int64;
-typedef unsigned long long     ossim_uint64;
-typedef signed long long       ossim_sint64;
-   
-typedef ossim_int32            ossimErrorCode;
-
-enum ossimVertexOrdering
-{
-   OSSIM_VERTEX_ORDER_UNKNOWN    = 0,
-   OSSIM_CLOCKWISE_ORDER         = 1,
-   OSSIM_COUNTERCLOCKWISE_ORDER  = 2
-};
-
-//---
-// For histogram builders.  Note that FAST computation mode will not sample all tiles.
-//---   
-enum ossimHistogramMode
-{
-   OSSIM_HISTO_MODE_UNKNOWN = 0,
-   OSSIM_HISTO_MODE_NORMAL  = 1,
-   OSSIM_HISTO_MODE_FAST    = 2
-};
-
-/*
- Corner coordinates are relative to center (0) of pixel
- or relative to the upper left of pixel (1).
-*/
-enum ossimPixelType
-{
-   OSSIM_PIXEL_IS_POINT = 0,
-   OSSIM_PIXEL_IS_AREA  = 1
-};
-
-/*
- Definitions for scalar type identification.
-*/
-enum ossimScalarType
-{
-   OSSIM_SCALAR_UNKNOWN    =  0, 
-   OSSIM_UINT8             =  1, /**< 8 bit unsigned integer        */
-   OSSIM_SINT8             =  2, /**< 8 bit signed integer          */
-   OSSIM_UINT16            =  3, /**< 16 bit unsigned integer       */
-   OSSIM_SINT16            =  4, /**< 16 bit signed integer         */
-   OSSIM_UINT32            =  5, /**< 32 bit unsigned integer       */
-   OSSIM_SINT32            =  6, /**< 32 bit signed integer         */
-   OSSIM_UINT64            =  7, /**< 64 bit unsigned integer       */
-   OSSIM_SINT64            =  8, /**< 64 bit signed integer         */
-   OSSIM_FLOAT32           =  9, /**< 32 bit floating point         */
-   OSSIM_FLOAT64           = 10, /**< 64 bit floating point         */
-   OSSIM_CINT16            = 11, /**< 16 bit complex integer        */
-   OSSIM_CINT32            = 12, /**< 32 bit complex integer        */
-   OSSIM_CFLOAT32          = 13, /**< 32 bit complex floating point */
-   OSSIM_CFLOAT64          = 14, /**< 64 bit complex floating point */
-   OSSIM_NORMALIZED_FLOAT  = 15, /**< 32 bit normalized floating point */
-   OSSIM_NORMALIZED_DOUBLE = 16, /**< 64 bit normalized floating point */
-
-   //---
-   // Below for backward compatibility only.  Please use above enums in
-   // conjunction with null, min, max settings to determine bit depth.
-   //---
-   OSSIM_USHORT11          = 17, /**< 16 bit unsigned integer (11 bits used) */
-   OSSIM_UCHAR             = 1,  /**< 8 bit unsigned iteger  */
-   OSSIM_USHORT16          = 3,  /**< 16 bit unsigned iteger */
-   OSSIM_SSHORT16          = 4,  /**< 16 bit signed integer  */
-   OSSIM_FLOAT             = 9,  /**< 32 bit floating point  */
-   OSSIM_DOUBLE            = 10, /**< 64 bit floating point  */
-};
-
-/*
- Definitions for interleave type identification.
-*/
-enum ossimInterleaveType
-{
-   OSSIM_INTERLEAVE_UNKNOWN = 0,
-   OSSIM_BIL                = 1,  /* band interleaved by line */
-   OSSIM_BIP                = 2,  /* band interleaved by pixel */
-   OSSIM_BSQ                = 3,  /* band sequential */
-   OSSIM_BSQ_MULTI_FILE     = 4   /* band sequential in separate files */
-};
-
-/*
- Definitions for origin location.
-*/
-enum ossimOriginLocationType
-{
-   OSSIM_ORIGIN_LOCATION_UNKNOWN = 0,
-   OSSIM_CENTER                  = 1,
-   OSSIM_UPPER_LEFT              = 2,
-   OSSIM_UPPER_LEFT_CENTER       = 3,
-   OSSIM_LOWER_LEFT              = 4,
-   OSSIM_LOWER_LEFT_CENTER       = 5
-};
-
-/*
- Definitions for coordinate system type.
-*/
-enum ossimCoordinateSystemType
-{
-   OSSIM_COORDINATE_SYSTEM_UNKNOWN = 0,
-   OSSIM_IMAGE_SPACE               = 1,
-   OSSIM_GEOGRAPHIC_SPACE          = 2,
-   OSSIM_PROJECTED_SPACE           = 3,
-   OSSIM_GEOCENTRIC_SPACE          = 4
-};
-
-/*
- Definitions for coordinate system orientation mode .
-*/
-enum ossimCoordSysOrientMode
-{
-   OSSIM_LEFT_HANDED  = 0,
-   OSSIM_RIGHT_HANDED = 1
-};
-
-/*
- Definitions for unit type.
-*/
-enum ossimUnitType
-{
-   OSSIM_UNIT_UNKNOWN    = 0,
-   OSSIM_METERS          = 1,
-   OSSIM_FEET            = 2,
-   OSSIM_US_SURVEY_FEET  = 3,
-   OSSIM_DEGREES         = 4,
-   OSSIM_RADIANS         = 5,
-   OSSIM_NAUTICAL_MILES  = 6,
-   OSSIM_SECONDS         = 7,
-   OSSIM_MINUTES         = 8,
-   OSSIM_PIXEL           = 9,
-   OSSIM_MILES           = 10,
-   OSSIM_MILLIMETERS     = 11,
-   OSSIM_MICRONS         = 12,
-   OSSIM_CENTIMETERS     = 13,
-   OSSIM_YARDS           = 14,
-   OSSIM_INCHES          = 15,
-   OSSIM_KILOMETERS      = 16
-};
-
-/** Definitions for data object status. */
-enum ossimDataObjectStatus
-{
-   OSSIM_STATUS_UNKNOWN = 0,
-   OSSIM_NULL           = 1, // not initialized
-   OSSIM_EMPTY          = 2, // initialized but blank or empty
-   OSSIM_PARTIAL        = 3, // contains some null/invalid values
-   OSSIM_FULL           = 4  // all valid data
-};
-
-/** Definitions for image type identification. */
-enum ossimImageType
-{
-   OSSIM_IMAGE_TYPE_UNKNOWN       = 0,
-   OSSIM_TIFF_STRIP               = 1,
-   OSSIM_TIFF_STRIP_BAND_SEPARATE = 2,
-   OSSIM_TIFF_TILED               = 3,
-   OSSIM_TIFF_TILED_BAND_SEPARATE = 4,
-   OSSIM_GENERAL_RASTER_BIP       = 5,
-   OSSIM_GENERAL_RASTER_BIL       = 6,
-   OSSIM_GENERAL_RASTER_BSQ       = 7,
-   OSSIM_JPEG                     = 8,
-   OSSIM_PDF                      = 9
-};
-
-/** Definitions for metadata type identification. */
-enum ossimMetadataType
-{
-   OSSIM_META_UNKNOWN   = 0,
-   OSSIM_META_TFW       = 1,
-   OSSIM_META_JGW       = 2,
-   OSSIM_META_GEOM      = 3,
-   OSSIM_META_README    = 4,
-   OSSIM_META_FGDC      = 5,
-   OSSIM_META_ENVI      = 6
-};
-
-enum ossimByteOrder
-{
-   OSSIM_LITTLE_ENDIAN = 0,
-   OSSIM_BIG_ENDIAN    = 1
-};
-
-enum ossimCompareType
-{
-   OSSIM_COMPARE_FULL=0,      // compares full traversal if supported.  Not just instance pointers
-   OSSIM_COMPARE_IMMEDIATE=1  // Only immediate attributes are compared
-};
-
-#ifndef FLT_EPSILON
-#  define FLT_EPSILON __FLT_EPSILON__
-#endif
-   
-#ifndef DBL_EPSILON
-#  define DBL_EPSILON __DBL_EPSILON__
-#endif
-   
-#ifndef M_PI
-#  define M_PI             ((ossim_float64)3.141592653589793238462643)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI           ((ossim_float64)(2.0 * M_PI))
-#endif
-#ifndef DEG_PER_RAD
-#  define DEG_PER_RAD      ((ossim_float64)(180.0/M_PI))
-#endif
-#ifndef SEC_PER_RAD
-#  define SEC_PER_RAD      ((ossim_float64)206264.8062471)
-#endif
-#ifndef RAD_PER_DEG
-#  define RAD_PER_DEG      ((ossim_float64)(M_PI/180.0))
-#endif
-#ifndef MTRS_PER_FT
-#  define MTRS_PER_FT      ((ossim_float64)0.3048)
-#endif
-#ifndef FT_PER_MTRS
-#  define FT_PER_MTRS      ((ossim_float64)3.280839895013122)
-#endif
-#ifndef FT_PER_MILE
-#  define FT_PER_MILE      ((ossim_float64)5280.0)
-#endif
-#ifndef SQRT_TWO_PI
-#  define SQRT_TWO_PI      ((ossim_float64)2.50662827463100050242)
-#endif
-#ifndef SQRT_TWO_PI_DIV2
-#  define SQRT_TWO_PI_DIV2 ((ossim_float64)7.07106781186547524401E-1)
-#endif
-
-#define TIFFTAG_OSSIM_METADATA 50955
-#define OSSIM_DEFAULT_TILE_HEIGHT  ((ossim_int32)64)
-#define OSSIM_DEFAULT_TILE_WIDTH   ((ossim_int32)64)
-
-/*
- NOTE Reference for U.S. feet value:
- U.S.G.S. "Map Projections - A Working Manual"
- USGS Professional paper 1395 page 51
-*/
-#ifndef US_METERS_PER_FT
-#  define  US_METERS_PER_FT ((ossim_float64)0.3048006096)
-#endif
-
-//---
-// Integer nan kept for ossimIpt.
-// This should be the most negative int: -2147483648
-//---
-#define OSSIM_INT_NAN ((ossim_sint32)0x80000000)
-
-#define OSSIM_DEFAULT_NULL_PIX_UCHAR  ((ossim_uint8)0)
-#define OSSIM_DEFAULT_MIN_PIX_UCHAR   ((ossim_uint8)1)
-#define OSSIM_DEFAULT_MAX_PIX_UCHAR   ((ossim_uint8)255)
-
-#define OSSIM_DEFAULT_NULL_PIX_UINT8  ((ossim_uint8)0)
-#define OSSIM_DEFAULT_MIN_PIX_UINT8   ((ossim_uint8)1)
-#define OSSIM_DEFAULT_MAX_PIX_UINT8   ((ossim_uint8)255)
-
-#define OSSIM_DEFAULT_NULL_PIX_SINT8  ((ossim_sint8)0x80)
-#define OSSIM_DEFAULT_MIN_PIX_SINT8   ((ossim_sint8)0x81)
-#define OSSIM_DEFAULT_MAX_PIX_SINT8   ((ossim_sint8)0x7F)
-
-#define OSSIM_DEFAULT_NULL_PIX_SINT16 ((ossim_sint16)0x8000)
-#define OSSIM_DEFAULT_MIN_PIX_SINT16  ((ossim_sint16)0x8001)
-#define OSSIM_DEFAULT_MAX_PIX_SINT16  ((ossim_sint16)0x7FFF)
-
-#define OSSIM_DEFAULT_NULL_PIX_UINT16 ((ossim_uint16)0)
-#define OSSIM_DEFAULT_MIN_PIX_UINT16  ((ossim_uint16)1)
-#define OSSIM_DEFAULT_MAX_PIX_UINT16  ((ossim_uint16)0xFFFF)
-
-#define OSSIM_DEFAULT_NULL_PIX_SINT32 ((ossim_sint32)0x80000000)
-#define OSSIM_DEFAULT_MIN_PIX_SINT32  ((ossim_sint32)0x80000001)
-#define OSSIM_DEFAULT_MAX_PIX_SINT32  ((ossim_sint32)0x7FFFFFFF)
-
-#define OSSIM_DEFAULT_NULL_PIX_UINT32 ((ossim_uint32)0)
-#define OSSIM_DEFAULT_MIN_PIX_UINT32  ((ossim_uint32)1)
-#define OSSIM_DEFAULT_MAX_PIX_UINT32  ((ossim_uint32)0xFFFFFFFF)
-
-#define OSSIM_DEFAULT_NULL_PIX_SINT64 ((ossim_sint32)0x8000000000000000)
-#define OSSIM_DEFAULT_MIN_PIX_SINT64  ((ossim_sint32)0x8000000000000001)
-#define OSSIM_DEFAULT_MAX_PIX_SINT64  ((ossim_sint32)0x7FFFFFFFFFFFFFFF)
-
-#define OSSIM_DEFAULT_NULL_PIX_UINT64 ((ossim_uint32)0)
-#define OSSIM_DEFAULT_MIN_PIX_UINT64  ((ossim_uint32)1)
-#define OSSIM_DEFAULT_MAX_PIX_UINT64  ((ossim_uint32)0xFFFFFFFFFFFFFFFF)
-
-#define OSSIM_DEFAULT_NULL_PIX_UINT11 ((ossim_uint16)0)
-#define OSSIM_DEFAULT_MIN_PIX_UINT11  ((ossim_uint16)1)
-#define OSSIM_DEFAULT_MAX_PIX_UINT11  ((ossim_uint16)0x07FF)
-
-#define OSSIM_DEFAULT_NULL_PIX_FLOAT  ((ossim_float32)-1.0/FLT_EPSILON)
-#define OSSIM_DEFAULT_MIN_PIX_FLOAT   ((ossim_float32)((-1.0/FLT_EPSILON) + 1))
-#define OSSIM_DEFAULT_MAX_PIX_FLOAT   ((ossim_float32)((1.0/FLT_EPSILON)))
-
-#define OSSIM_DEFAULT_NULL_PIX_NORM_FLOAT  ((ossim_float32)0)
-#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT   ((ossim_float32)((2*FLT_EPSILON)))
-#define OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT   ((ossim_float32)1.0)
-
-#define OSSIM_DEFAULT_NULL_PIX_DOUBLE      ((ossim_float64)-1.0/DBL_EPSILON)
-#define OSSIM_DEFAULT_MIN_PIX_DOUBLE       ((ossim_float64)((-1.0/DBL_EPSILON) + 1))
-#define OSSIM_DEFAULT_MAX_PIX_DOUBLE       ((ossim_float64)((1.0/DBL_EPSILON)))
-
-#define OSSIM_DEFAULT_NULL_PIX_NORM_DOUBLE ((ossim_float64)0)
-#define OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE  ((ossim_float64)((2*DBL_EPSILON)))
-#define OSSIM_DEFAULT_MAX_PIX_NORM_DOUBLE  ((ossim_float64)(1.0))
-
-#define OSSIM_DEFAULT_MEAN_SEA_LEVEL ((ossim_float64)0.0)
-
-#endif /* #ifndef ossimConstants_HEADER */
diff --git a/ossim/include/ossim/base/ossimContainerEvent.h b/ossim/include/ossim/base/ossimContainerEvent.h
deleted file mode 100644
index 87aa214..0000000
--- a/ossim/include/ossim/base/ossimContainerEvent.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimContainerEvent.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimContainerEvent_HEADER
-#define ossimContainerEvent_HEADER
-#include <ossim/base/ossimEvent.h>
-#include <ossim/base/ossimEventIds.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <vector>
-
-class OSSIMDLLEXPORT ossimContainerEvent : public ossimEvent
-{
-public:
-
-   typedef std::vector<ossimRefPtr<ossimObject> > ObjectList;
-   
-   /** constuctor */
-   ossimContainerEvent(ossimObject* obj1,// the object firing the event.
-                       long id);
-
-   void setObjectList(ossimObject* obj);
-   void setObjectList(ObjectList& objects);
-   ObjectList& getObjectList(){return m_objectList;}
-   const ObjectList& getObjectList()const{return m_objectList;}
-   
-protected:
-   
-   /*!
-    * This is the object associated with the container event.
-    * if this was an add then it s the object added to the
-    * container.
-    */
-      ObjectList m_objectList;
-
-TYPE_DATA
-};
-
-#endif /* end of: "#ifndef ossimContainerEvent_HEADER" */
-
diff --git a/ossim/include/ossim/base/ossimDataObject.h b/ossim/include/ossim/base/ossimDataObject.h
deleted file mode 100644
index 71d945c..0000000
--- a/ossim/include/ossim/base/ossimDataObject.h
+++ /dev/null
@@ -1,116 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimDataObject.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDataObject_HEADER
-#define ossimDataObject_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDpt3d.h>
-
-class ossimSource;
-
-class OSSIMDLLEXPORT ossimDataObject : public ossimObject
-{
-public:
-   ossimDataObject(ossimSource* source=0,
-                   ossimDataObjectStatus status=OSSIM_STATUS_UNKNOWN);
-   
-   ossimDataObject(const ossimDataObject& rhs);
-   virtual ~ossimDataObject();
-
-
-
-   virtual ossim_uint32 getHashId()const=0;
-   
-   /**
-    * Sets the owner of this Data object.
-    */
-   virtual void setOwner(ossimSource* aSource);
-
-   virtual ossimSource* getOwner();
-
-   virtual const ossimSource* getOwner() const;
-
-   /**
-    * Full list found in ossimConstants.h
-    *
-    * OSSIM_STATUS_UNKNOWN
-    * OSSIM_NULL            Null data.  The buffers are never allocated
-    * OSSIM_EMPTY           Allocated data but its empty.  Most of the
-    *                       time this will be the default for an initialized
-    *                       data object.
-    * OSSIM_PARTIAL         Says that some of the object is empty and is only
-    *                       partially full
-    * OSSIM_FULL            This data is completey full
-    */
-   virtual void  setDataObjectStatus(ossimDataObjectStatus status) const;
-
-   /**
-    * @return Returns enumerated status:
-    * OSSIM_STATUS_UNKNOWN = 0
-    * OSSIM_NULL           = 1
-    * OSSIM_EMPTY          = 2
-    * OSSIM_PARTIAL        = 3
-    * OSSIM_FULL           = 4
-    */
-   virtual ossimDataObjectStatus getDataObjectStatus() const;
-
-   /**
-    * @return Returns the status as a string, like "OSSIM_NULL".
-    */
-   virtual ossimString getDataObjectStatusString() const;
-
-   virtual ossim_uint32 getObjectSizeInBytes()const;
-
-   virtual ossim_uint32 getDataSizeInBytes()const=0;
-
-   /**
-    * This is to be overriden in the derived classes so they can check
-    * If their data is null.
-    */
-   virtual bool isInitialize() const;
-
-   /**
-    * Will allow derived classes to initialize their buffers.  This class
-    * does nothing with this and reset any internal attributes.
-    */
-   virtual void initialize()=0;
-   
-   virtual void assign(const ossimDataObject* rhs);
-
-   virtual const ossimDataObject* operator =(const ossimDataObject* rhs);
-   
-   virtual const ossimDataObject& operator=(const ossimDataObject& rhs);
-
-   virtual bool operator==(const ossimDataObject& rhs) const;
-   virtual bool operator!=(const ossimDataObject& rhs) const;
-
-   virtual std::ostream& print(std::ostream& out) const;
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-protected:
-
-   //***
-   // Note:  This object is not responsible for deletion of the ossimSource*
-   //        "theSource".  It is simply a hook to his owner for things
-   //        like unregister and so forth...
-   //***
-   ossimSource*                      theOwner;
-   mutable ossimDataObjectStatus     theDataObjectStatus;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimDate.h b/ossim/include/ossim/base/ossimDate.h
deleted file mode 100644
index 18688b5..0000000
--- a/ossim/include/ossim/base/ossimDate.h
+++ /dev/null
@@ -1,280 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimDate.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimDate_HEADER
-#define ossimDate_HEADER
-#include <ctime>
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <OpenThreads/Mutex>
-#include <OpenThreads/ScopedLock>
-
-class OSSIM_DLL ossimLocalTm : public std::tm
-{
-public:
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimLocalTm& src);
-   friend OSSIM_DLL int operator== (const ossimLocalTm& t1,
-                                    const ossimLocalTm& src);
-   friend OSSIM_DLL int operator!= (const ossimLocalTm& t1,
-                                    const ossimLocalTm& src);
-   friend OSSIM_DLL int operator<  (const ossimLocalTm& t1,
-                                    const ossimLocalTm& src);
-   friend OSSIM_DLL int operator<= (const ossimLocalTm& t1,
-                                    const ossimLocalTm& src);
-   friend OSSIM_DLL int operator>  (const ossimLocalTm& t1,
-                                    const ossimLocalTm& src);
-   friend OSSIM_DLL int operator>= (const ossimLocalTm& t1,
-                                    const ossimLocalTm& src);
-   
-   ossimLocalTm (time_t t=0);     // Set to time, 0 is magic for 'now'
-   ossimLocalTm (tm const & t); // Copy constructor
-   ossimLocalTm (const ossimLocalTm& t); // Copy constructor
-   
-   ossimLocalTm & operator= (tm const & t);            // Assignment
-   ossimLocalTm & operator= (const ossimLocalTm & t);            // Assignment
-   operator time_t (void) const;        // Conversion operator
-   
-   int isValid (void) const;             // Test for validity
-   
-   void now();
-   int compare (ossimLocalTm const & t) const;      // Compare times
-   int compare (std::time_t const tt) const;       // Compare times
-   
-   enum ossimLocalTmFormat     // Date format flags
-   {
-      ossimLocalTmFormatYear          = (int)0x0001,            // Print year
-      ossimLocalTmFormatYearShort     = (int)0x0002, // Print last two digits
-      ossimLocalTmFormatPadYear       = (int)0x0004,    // Pad year to 2 or 4
-      ossimLocalTmFormatZeroYear      = (int)0x0008,        // Zero fill year
-      ossimLocalTmFormatMonth         = (int)0x0010,           // Print month
-      ossimLocalTmFormatMonText       = (int)0x0020,   // Print month in text
-      ossimLocalTmFormatPadMon        = (int)0x0040, // Pad to 2 (trunc to 3)
-      ossimLocalTmFormatZeroMon       = (int)0x0080,       // Zero fill month
-      ossimLocalTmFormatDay           = (int)0x0100,            // Print date
-      ossimLocalTmFormatDayOfWeek     = (int)0x0200,     // Print day of week
-      ossimLocalTmFormatPadDay        = (int)0x0400,         // Pad date to 2
-      ossimLocalTmFormatZeroDay       = (int)0x0800,         // Zero fill day
-      ossimLocalTmFormatDMY           = (int)0x0111, // Print date, mth, year
-      ossimLocalTmFormatPadDMY        = (int)0x0444,         // Pad all three
-      ossimLocalTmFormatZeroDMY       = (int)0x0888,   // Zero fill all three
-      ossimLocalTmFormatYearFirst     = (int)0x1000,      // Print year first
-      ossimLocalTmFormatMonFirst      = (int)0x2000,     // Print month first
-      ossimLocalTmFormatSepChar       = (int)0x4000,// Separate fields datech
-      ossimLocalTmFormatSepSpace      = (int)0x8000,  // Separate fields space
-      ossimLocalTmFormatInternational = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatMonText|ossimLocalTmFormatPadMon|
-                                              ossimLocalTmFormatSepSpace),
-      ossimLocalTmFormatIntlShort     = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatMonText|ossimLocalTmFormatPadMon|
-                                              ossimLocalTmFormatSepSpace|ossimLocalTmFormatYearShort),
-      ossimLocalTmFormatUsa           = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatMonFirst|ossimLocalTmFormatPadDMY|
-                                              ossimLocalTmFormatZeroDMY|ossimLocalTmFormatYearShort|ossimLocalTmFormatSepChar),
-      ossimLocalTmFormatEnglish       = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatYearShort|ossimLocalTmFormatPadDMY|
-                                              ossimLocalTmFormatZeroDMY|ossimLocalTmFormatSepChar),
-      ossimLocalTmFormatJapanese      = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatYearFirst|ossimLocalTmFormatPadDMY|
-                                              ossimLocalTmFormatZeroDMY|ossimLocalTmFormatYearShort|ossimLocalTmFormatMonFirst|
-                                              ossimLocalTmFormatSepChar),
-      ossimLocalTmFormatFull          = (int)(ossimLocalTmFormatDMY|ossimLocalTmFormatDayOfWeek|ossimLocalTmFormatMonText|
-                                              ossimLocalTmFormatSepSpace)
-   };
-   
-   enum ossimTimeFormat  // Time format (nb: time zones not implemented)
-   {
-      ossimTimeFormatSecs          = (int)0x0001,         // Print seconds
-      ossimTimeFormatZeroSecs      = (int)0x0002,     // Zero fill seconds
-      ossimTimeFormatPadSecs       = (int)0x0004,      // Pad seconds to 2
-      ossimTimeFormatSecsAll       = (int)0x0007,
-      ossimTimeFormatTimeZone      = (int)0x0008,        // Print timezone
-      ossimTimeFormatMins          = (int)0x0010,         // Print minutes
-      ossimTimeFormatZeroMins      = (int)0x0020,     // Zero fill minutes
-      ossimTimeFormatPadMins       = (int)0x0040,      // Pad minutes to 2
-      ossimTimeFormatMinsAll       = (int)0x0070,
-      ossimTimeFormatTZNumeric     = (int)0x0080,      // Print numeric TZ
-      ossimTimeFormatHour          = (int)0x0100,            // Print hour
-      ossimTimeFormatZeroHour      = (int)0x0200,        // Zero fill hour
-      ossimTimeFormatPadHour       = (int)0x0400,  // Pad hour to 2 digits
-      ossimTimeFormatHourAll       = (int)0x0700,
-      ossimTimeFormat24hour        = (int)0x0800,          // 24hour clock
-      ossimTimeFormatSepChar       = (int)0x1000, // Separate field timech
-      ossimTimeFormatSepSpace      = (int)0x2000, // Separate fields space
-      ossimTimeFormatSepAbbrev     = (int)0x4000,     // Add abbreviations
-      ossimTimeFormatAmPm          = (int)0x8000,       // Add 'am' or 'pm'
-      ossimTimeFormatInternational = (int)(ossimTimeFormatHourAll|ossimTimeFormatMinsAll|ossimTimeFormatSecsAll|
-                                           ossimTimeFormat24hour|ossimTimeFormatSepChar),
-      ossimTimeFormatShortTime     = (int)(ossimTimeFormatHourAll|ossimTimeFormatMinsAll|ossimTimeFormat24hour|
-                                           ossimTimeFormatSepChar),
-      ossimTimeFormatClockTime     = (int)(ossimTimeFormatHour|ossimTimeFormatPadHour|ossimTimeFormatMinsAll|
-                                           ossimTimeFormatAmPm|ossimTimeFormatSepChar),
-      ossimTimeFormatLongTime      = (int)(ossimTimeFormatHour|ossimTimeFormatPadHour|ossimTimeFormatMinsAll|
-                                           ossimTimeFormatSecsAll|ossimTimeFormatSepAbbrev|ossimTimeFormatSepSpace),
-      ossimTimeFormatMillitary     = (int)(ossimTimeFormatHourAll|ossimTimeFormatMinsAll|ossimTimeFormat24hour)
-   };
-   
-   
-   static char timech;    // Character used for time separator
-   static char datech;    // Character used for date separator
-   static int datefmt;                  // Default date format
-   static int timefmt;                  // Default time format
-   
-   // Output methods
-   std::ostream& print(std::ostream & os,
-                       int df =datefmt,
-                       int tf =timefmt) const;
-   std::ostream& printTime(std::ostream & os, int f =timefmt) const;
-   std::ostream& printDate(std::ostream & os, int f =datefmt) const;
-   
-   /**
-    * @brief method to dump all the data members.  This is the tm struct +
-    * the theFractionalSecond from this class.
-    *
-    * @note: tm_gmtoff and  tm_zone from tm struct are not printed as they
-    * are not standard.
-    *
-    * @param os Stream to dump to.
-    *
-    * @return stream.
-    */
-   std::ostream& dump(std::ostream& os) const;
-   
-   
-   int getYear()const;
-   
-   int getShortYear()const;
-   
-   /*!
-    * This is one based i.e. values are returned between 1-12
-    */
-   int getMonth()const;
-   
-   /*!
-    * returns the day 1-31
-    */
-   int getDay()const;
-   double getJulian()const;
-   double getModifiedJulian()const;
-   
-   ossimLocalTm& setDay(int day);
-   /*!
-    * The month is a number bewteen 1 and 12.  We will shift it to the internal
-    * representation
-    */
-   ossimLocalTm& setMonth(int month);
-   ossimLocalTm& setYear(int year);
-   ossimLocalTm& setDateFromJulian(double jd);
-   ossimLocalTm& setDateFromModifiedJulian(double mjd);
-   
-   void setFractionalDay(double fractionalDay);
-   static void extractHmsFromFractionalDay(double fractionalDay,
-                                           int &h,
-                                           int &m,
-                                           int &s,
-                                           double& fractionalSecond);
-   int getHour()const;
-   int getMin()const;
-   int getSec()const;
-   double getFractionalSecond()const;
-   ossimLocalTm& setHour(int h);
-   ossimLocalTm& setMin(int m);
-   ossimLocalTm& setSec(int s);
-   ossimLocalTm& setFloatSec(double s);
-   ossimLocalTm& setFractionalSecond(double fractS);
-   
-   /**
-    * getTicks() will call getEpoc.  This is te number of microseconds passed
-    * since (00:00:00 UTC, January 1, 1970)
-    */ 
-   time_t getTicks()const;
-   time_t getEpoc()const;
-   
-   void addSeconds(ossim_float64 n);
-   void addMinutes(ossim_float64 n);
-   void addHours(ossim_float64 n);
-   void addDays(ossim_float64 n);
-   
-   ossim_float64 deltaInSeconds(const ossimLocalTm& d)const;
-   ossim_float64 deltaInMinutes(const ossimLocalTm& d)const;
-   ossim_float64 delatInHours(const ossimLocalTm& d)const;
-   ossim_float64 deltaInDays(const ossimLocalTm& d)const;
-   
-   ossimLocalTm convertToGmt()const;
-   /**
-    * Will not adjust for timezone.  The passed in value is based on seconds.
-    */ 
-   void setTimeNoAdjustmentGivenEpoc(time_t ticks);
-   
-   /**
-    * Will adjust for timezone. The passed in value is based on seconds.
-    */ 
-   void setTimeGivenEpoc(time_t ticks);
-   
-   bool setIso8601(const std::string& timeString, bool shiftToGmtOffsetZero=false);
-   
-   ossimRefPtr<ossimXmlNode> saveXml()const;
-   bool loadXml(ossimRefPtr<ossimXmlNode> dateNode);
-   
-protected:
-   // Time suffix
-   void tSfx(std::ostream & os, int fmt, char ch) const;
-   // Time field formatters
-   void pHour(std::ostream & os, int fmt) const;
-   void pMins(std::ostream & os, int fmt) const;
-   void pSecs(std::ostream & os, int fmt) const;
-   // Date suffix
-   void dSfx(std::ostream & os, int fmt) const;
-   // Date field formatters
-   void pDate(std::ostream & os, int fmt) const;
-   void pMonth(std::ostream & os, int fmt) const;
-   void pYear(std::ostream & os, int fmt) const;
-   
-   void setTimezoneOffsetFromGmt();
-   static OpenThreads::Mutex m_mutex;
-   double theFractionalSecond;
-   int m_timezoneOffset;
-};
-
-
-class OSSIM_DLL ossimDate : public ossimLocalTm
-{
-public:
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimDate& src);
-   
-   ossimDate(int datefmt =ossimLocalTm::datefmt);
-   ossimDate (ossimLocalTm const & t,
-              int dtfmt =ossimLocalTm::datefmt);
-   ossimDate (time_t t, int dtfmt =ossimLocalTm::datefmt);
-   ossimDate(int month, int day, int year,int dtfmt=ossimLocalTm::datefmt);
-   
-   int fmt(int f);
-   int fmt(void) const;
-   
-   std::ostream & print (std::ostream & os) const;
-   
-private:
-   int _fmt;
-};
-
-class OSSIM_DLL ossimTime :public ossimLocalTm
-{
-public:
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimTime& src);
-   ossimTime(int tmfmt =ossimLocalTm::timefmt);
-   ossimTime (ossimTime const & t,
-              int tmfmt =ossimLocalTm::timefmt);
-   ossimTime (time_t t, int tmfmt =ossimLocalTm::timefmt);
-   
-   int fmt (int f);
-   int fmt (void) const;
-   
-   std::ostream& print (std::ostream & os) const;
-   
-private:
-   int _fmt;   
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossimDateProperty.h b/ossim/include/ossim/base/ossimDateProperty.h
deleted file mode 100644
index e038f59..0000000
--- a/ossim/include/ossim/base/ossimDateProperty.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT see top level license.txt
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimDateProperty.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimDateProperty_HEADER
-#define ossimDateProperty_HEADER
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimDate.h>
-
-class OSSIM_DLL ossimDateProperty : public ossimProperty
-{
-public:
-   ossimDateProperty();
-   ossimDateProperty(const ossimString& name,
-                     const ossimString& value);
-   ossimDateProperty(const ossimString& name,
-                     const ossimLocalTm& value);
-   ossimDateProperty(const ossimDateProperty& src);
-   virtual ossimObject* dup()const;
-   
-   void setDate(const ossimLocalTm& localTm);
-   const ossimLocalTm& getDate()const;
-   virtual bool setValue(const ossimString& value);
-   virtual void valueToString(ossimString& valueResult)const;
-   virtual const ossimProperty& assign(const ossimProperty& rhs);
-   
-protected:
-   ossimLocalTm theValue;
-
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimDblGrid.h b/ossim/include/ossim/base/ossimDblGrid.h
deleted file mode 100644
index 64e51c0..0000000
--- a/ossim/include/ossim/base/ossimDblGrid.h
+++ /dev/null
@@ -1,233 +0,0 @@
-//*****************************************************************************
-//                                   O S S I M
-//
-// FILE: ossimDblGrid.h
-//
-// License:  See top level LICENSE.txt file.
-//
-// AUTHOR:  Oscar Kramer
-//
-// DESCRIPTION:
-//   Contains declaration of class ossimDblGrid. This object class maintains
-//   a regular grid of floating point (double) values. Access methods to the
-//   grid include interpolation between grid nodes. Capability is included
-//   to address the grid in an arbitrary, floating-point u, v coordinate
-//   system which is related to the integer grid x, y system by scale and
-//   offset:
-//
-//          u = Sx*(x + Xo),   v = Sy*(y + Y0)
-//
-//   where Xo, Yo is the origin of the U/V cood system. Sx, Sy are the scale
-//   relations. For example, if the grid is being used to hold a grid of
-//   elevation posts, then the origin will be the SW corner post ground point,
-//   and the scale will be derived from the post spacing. Both origin and
-//   spacing are specified to the constructor.
-//
-//*****************************************************************************
-//  $Id: ossimDblGrid.h 20044 2011-09-06 15:02:43Z oscarkramer $
-
-#ifndef ossimDblGrid_HEADER
-#define ossimDblGrid_HEADER
-
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimCommon.h>
-
-class ossimDrect;
-
-/*!****************************************************************************
- *
- * CLASS:  ossimDblGrid
- *
- *****************************************************************************/
-class OSSIMDLLEXPORT ossimDblGrid 
-{
-public:
-   /*!
-    * Default Constructor.
-    */
-   ossimDblGrid ();
-
-   /*!
-    * Copy Constructor.
-    */
-   ossimDblGrid (const ossimDblGrid& source_to_copy);
-
-   /*!
-    * Constructs given a U/V origin and spacing, and a grid size.
-    */
-   ossimDblGrid (const ossimIpt&  size, 
-                 const ossimDpt&  origin,
-                 const ossimDpt&  spacing,
-                 double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
-
-   /*!
-    * Constructs given a rectangle in U/V space and grid spacing. The origin is
-    * taken as the upper-left corner of the rectangle. The lower-rightmost grid
-    * point may not coincide with the rectangles LR corner if the side is not
-    * evenly divisible by the corresponding spacing.
-    */
-   ossimDblGrid (const ossimDrect&  uv_rect, 
-                 const ossimDpt&    spacing,
-                 double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
-
-   ~ossimDblGrid ();
-
-   /*!
-    * When constructed with default, permits initialization afterward.
-    */
-   void         initialize(const ossimIpt&  size, 
-                           const ossimDpt&  origin,
-                           const ossimDpt&  spacing,
-                           double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
-   void         initialize(const ossimDrect&  uv_rect, 
-                           const ossimDpt&    spacing,
-                           double null_value = OSSIM_DEFAULT_NULL_PIX_DOUBLE);
-   /*!
-   * Enables/disables extrapolation functionality. If extrapolation is enabled, then calls to 
-   * operator() will handle points outside of the grid. 
-   */
-   void enableExtrapolation(bool arg=true) { theExtrapIsEnabled = arg;}
-
-   void deallocate();
-   /*!
-    * Fills the current grid with the value specified.
-    */
-   void         fill(double fill_value);
-
-   /*!
-    * Fills the current grid with null values.
-    */
-   void         clear() { fill(theNullValue); }
-   
-   /*!
-    * Access individual node value by node index in the X/Y (grid) coord system.
-    */
-   void         setNode (const ossimIpt& p,
-                         const double& value)   { setNode(p.x, p.y, value); }
-   void         setNode (int x, int y, const double&  value);
-
-   double       getNode (const ossimIpt& p) const { return getNode(p.x, p.y); }
-   double       getNode (int x, int y) const;
-
-   /*!
-    * Sets the node nearest the U,V point specified to the value given. This is
-    * different from setNode() in that the UV coordinate system is used to
-    * address a node instead of an XY grid point.
-    */
-   void         setNearestNode(const ossimDpt& uv_point,
-                               const double&   value);
-   
-   /*!
-    * This method performs a resampling of the defined grid nodes in order to
-    * compute interpolated values for those uninitialized nodes. This is
-    * necessary when only a subset of nodes are available for initializing the
-    * grid.
-    */
-   void interpolateNullValuedNodes(const double& decay_rate=10.0);
-
-   /*!
-    * Passes the grid data through a convolution filter given the kernel array.
-    * The grid must not contain any NULL nodes as these are treated as valid
-    * quantities. The kernel sizes should be odd numbers. To avoid shrinking
-    * the grid by the kernel radius, the edge nodes outside of the filter's
-    * reach are computed by extrapolation. X is the contiguous
-    * axis in the kernel array, i.e., kernel(x,y) = kernel[y*size_x + x].
-    */
-   void filter(int size_x, int size_y, double* kernel);
-   
-   /*!
-    * Interpolate between grid nodes given arbitrary u/v coord system:
-    */
-   enum InterpType
-   {
-      BILINEAR
-   };
-   void  setInterpolationType (InterpType interp);
-
-   enum DomainType
-   {
-      CONTINUOUS = 0, // Default continuous grid with no limits on values
-      SAWTOOTH_90= 1, // For angles between -90 and 90 deg such as latitude
-      WRAP_180   = 2, // For angles between -180 and 180 with discontinuity at limits (typically used for longitude)
-      WRAP_360   = 3  // For angles between 0 and 360 with discontinuity at limits (typically used for rotations)
-   };
-   void setDomainType(DomainType dt) { theDomainType = dt; }
-
-   /*!
-    * Access an interpolated value in the U/V (output) coordinate system.
-    */
-   double operator() (const ossimDpt& uv_point) const {return (*this)(uv_point.u, uv_point.v);}
-   double value      (const ossimDpt& uv_point) const {return (*this)(uv_point.u, uv_point.v);}
-
-   double operator() (const double& u, const double& v) const;
-   double value (const double& u, const double& v) const {return (*this)(u,v);}
-
-   /*!
-    * operator for initializing this grid with another.
-    */
-   const ossimDblGrid& operator = (const ossimDblGrid& grid);
-   
-   /*!
-    *Statistics methods:
-    */
-   double minValue()   const { return theMinValue; }
-   double maxValue()   const { return theMaxValue; }
-   double nullValue()  const { return theNullValue; }
-   double meanValue();
-   double meanStdDev();
-
-   void setMinValue(double value) {theMinValue = value;}
-   void setMaxValue(double value) {theMaxValue = value;}
-   void setNullValue(double value) {theNullValue = value;}
-   /*!
-    * Other member access methods:
-    */
-   const ossimIpt& size()    const { return theSize; }
-   const ossimDpt& origin()  const { return theOrigin; }
-   const ossimDpt& spacing() const { return theSpacing; }
-   unsigned long   getSizeInBytes() const { return theSize.x*theSize.y*sizeof(double); }
-   
-   /*!
-    * Returns true if double point lies within world space coverage:
-    */
-   bool  isInside(const ossimDpt& p) const {return isInside(p.u, p.v);}
-   bool  isInside(const double& u, const double& v) const;
-
-   /*!
-    * Loads and saves the grid from/to a stream. Returns TRUE if successful.
-    */
-   bool  save(std::ostream& os, const char* descr) const;
-   bool  load(std::istream& is);
-   
-   friend std::ostream& operator << (std::ostream& os, const ossimDblGrid& grid);
-   
-private:
-   
-   void  computeMean();
-   double interpolate(double x, double y) const;
-   double extrapolate(double x, double y) const;
-
-   //! Constrains the value to the numerical domain specified in theDomainType.
-   void constrain(double& value) const;
-
-   ossim_uint32   index(int x, int y) const { return y*theSize.x + x; }
-   
-   double*      theGridData;
-   ossimIpt     theSize;
-   ossimDpt     theOrigin;
-   ossimDpt     theSpacing;
-   double       theMinValue;
-   double       theMaxValue;
-   double       theNullValue;
-   double       theMeanValue;
-   double       theDeviation;
-   bool         theMeanIsComputed;
-   bool         theExtrapIsEnabled;
-   DomainType   theDomainType;
-   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimDirectory.h b/ossim/include/ossim/base/ossimDirectory.h
deleted file mode 100644
index 30cb413..0000000
--- a/ossim/include/ossim/base/ossimDirectory.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-// Description: 
-//
-//*************************************************************************
-// $Id: ossimDirectory.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimDirectory_HEADER
-#define ossimDirectory_HEADER
-
-#include <ossim/base/ossimFilename.h>
-
-#ifndef _WIN32
-class ossimDirectoryData;
-#endif
-
-class  OSSIMDLLEXPORT ossimDirectory
-{
-public:
-   
-   /*!
-    * These flags define what kind of filenames is included in the list
-    * of files enumerated by GetFirst/GetNext.
-    */
-   enum
-   {
-      OSSIM_DIR_FILES     = 0x0001,       // include files
-      OSSIM_DIR_DIRS      = 0x0002,       // include directories
-      OSSIM_DIR_HIDDEN    = 0x0004,       // include hidden files
-      OSSIM_DIR_DOTDOT    = 0x0008,       // include '.' and '..'
-      
-      // by default, enumerate everything except '.' and '..'
-      OSSIM_DIR_DEFAULT   = OSSIM_DIR_FILES | OSSIM_DIR_DIRS | OSSIM_DIR_HIDDEN
-   };
-
-
-   ossimDirectory();
-   
-   ossimDirectory(const ossimFilename& dir);
-   
-   ~ossimDirectory();
-   
-   bool open(const ossimFilename& dir);
-   
-   bool isOpened() const;
-   
-   bool getFirst(ossimFilename &filename,
-                 int flags = OSSIM_DIR_DEFAULT);
-   
-   /*!
-    * Get next file in the enumeration started with either GetFirst() or
-    * GetFirstNormal().
-    */
-   bool getNext(ossimFilename &filename) const;
-   
-   void findAllFilesThatMatch(std::vector<ossimFilename>& result,
-                              const ossimString& regularExpressionPattern,
-                              int flags = OSSIM_DIR_DEFAULT);
-   
-#if defined (_WIN32)
-   void setFlags(int flags) { theFlags = flags; };
-   bool fileMatched(ossimFilename &filename) const;
-#endif    
-
-   // ESH 07/2008, Trac #234: OSSIM is case sensitive 
-   // when using worldfile templates during ingest
-   /*!
-    * Case insensitive search for files with the same name but 
-    * with letters that have different case than the input name. 
-    *
-    * On Windows there can only be one match, but the case can be 
-    * different than the input name. On UNIX there can be multiple 
-    * matches.
-    *
-    * If the bExcludeExactMatch input parameter is set to false, 
-    * the original input name will be included in the 'result'
-    * vector if it is found in the directory. Otherwise (the default),
-    * the input name is excluded from the 'result' vector even if it
-    * is found in the directory.
-    *
-    * Returns true if a name has been added to the result vector.
-    */
-   bool findCaseInsensitiveEquivalents( const ossimFilename &filename, 
-                                        std::vector<ossimFilename>& result,
-                                        bool bExcludeExactMatch = true );
-   
-   // TODO using scandir() when available later, emulating it otherwise
-   
-private:
-#if defined (_WIN32)
-   intptr_t      theData;
-   ossimFilename theDirectoryName;
-   int           theFlags;
-#else
-   ossimDirectoryData* theData;
-#endif
-};
-
-#endif /* #ifndef ossimDirectory_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimDisplayInterface.h b/ossim/include/ossim/base/ossimDisplayInterface.h
deleted file mode 100644
index e303012..0000000
--- a/ossim/include/ossim/base/ossimDisplayInterface.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimDisplayInterface.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimDisplayInterface_HEADER
-#define ossimDisplayInterface_HEADER
-#include <ossim/base/ossimRtti.h>
-#include <ossim/base/ossimString.h>
-
-class OSSIMDLLEXPORT ossimDisplayInterface
-{
-public:
-   ossimDisplayInterface();
-
-   virtual ~ossimDisplayInterface();
-
-   /*!
-    * Returns the display back to the caller
-    */
-   virtual void* getDisplayDevice()=0;
-
-   virtual void setTitle(const ossimString& title)=0;
-   virtual void getTitle(ossimString& title)const=0;
-   virtual ossimString getTitle()const;
-   virtual void close()=0;
-   virtual bool isOpen() const=0;
-   virtual bool open()=0;
-   virtual bool isMinimized()const=0;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimDpt.h b/ossim/include/ossim/base/ossimDpt.h
deleted file mode 100644
index 66a92a0..0000000
--- a/ossim/include/ossim/base/ossimDpt.h
+++ /dev/null
@@ -1,166 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for ossimDpt.
-// Used to represent an double point containing an x and y data member.
-// 
-//*******************************************************************
-//  $Id: ossimDpt.h 19793 2011-06-30 13:26:56Z gpotts $
-#ifndef ossimDpt_HEADER
-#define ossimDpt_HEADER
-
-#include <iosfwd>
-#include <string>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimString.h>
-
-// Forward class declarations.
-class ossimIpt;
-class ossimFpt;
-class ossimDpt3d;
-class ossimGpt;
-
-class OSSIMDLLEXPORT ossimDpt
-{
-public:
-
-   ossimDpt() : x(0), y(0) {}
-
-   ossimDpt(double anX, double aY) : x(anX), y(aY) {}
-         
-   ossimDpt(const ossimDpt& pt) : x(pt.x), y(pt.y) {}
-
-   ossimDpt(const ossimFpt& pt);
-   
-   ossimDpt(const ossimIpt& pt);
-
-   ossimDpt(const ossimDpt3d &pt);
-
-   ossimDpt(const ossimGpt &pt); // assigns lat, lon only
-
-   const ossimDpt& operator=(const ossimDpt&);
-
-   const ossimDpt& operator=(const ossimFpt&);
-   
-   const ossimDpt& operator=(const ossimIpt&);
-
-   const ossimDpt& operator=(const ossimDpt3d&);
-
-   const ossimDpt& operator=(const ossimGpt&); // assigns lat, lon only
-
-   bool operator==(const ossimDpt& pt) const
-   { return ( ossim::almostEqual(x, pt.x) && ossim::almostEqual(y, pt.y) ); } 
-
-   bool operator!=(const ossimDpt& pt) const
-   { return !(*this == pt ); }
-
-   void makeNan(){x = ossim::nan(); y=ossim::nan();}
-   
-   bool hasNans()const
-   {
-      return (ossim::isnan(x) || ossim::isnan(y));
-   }
-
-   bool isNan()const
-   {
-      return (ossim::isnan(x) && ossim::isnan(y));
-   }
-
-   /*!
-    * METHOD: length()
-    * Returns the RSS of the components.
-    */
-   double length() const { return sqrt(x*x + y*y); }
-   
-   //***
-   // OPERATORS: +, -, +=, -=
-   // Point add/subtract with other point:
-   //***
-   ossimDpt operator+(const ossimDpt& p) const
-      { return ossimDpt(x+p.x, y+p.y); }
-   ossimDpt operator-(const ossimDpt& p) const
-      { return ossimDpt(x-p.x, y-p.y); }
-   const ossimDpt& operator+=(const ossimDpt& p)
-      { x += p.x; y += p.y; return *this; }
-   const ossimDpt& operator-=(const ossimDpt& p)
-      { x -= p.x; y -= p.y; return *this; }
-
-   //***
-   // OPERATORS: *, /
-   // Scale point components by scalar:
-   //***
-   ossimDpt operator*(const double& d) const
-      { return ossimDpt(d*x, d*y); }
-   ossimDpt operator/(const double& d) const
-      { return ossimDpt(x/d, y/d); }
-
-   std::ostream& print(std::ostream& os, ossim_uint32 precision=15) const;
-   
-   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
-                                                  const ossimDpt& pt);
-
-   /**
-    * @param precision Output floating point precision.
-    * 
-    * @return ossimString representing point.
-    *
-    * Output format:  ( 30.00000000000000, -90.00000000000000 )
-    *                   --------x--------  ---------y--------
-    */
-   ossimString toString(ossim_uint32 precision=15) const;
-
-   /**
-    * Initializes this point from string.  This method opens an istream to
-    * s and then calls operator>>.
-    *
-    * Expected format:  ( 30.00000000000000, -90.00000000000000 )
-    *                     --------x--------  ---------y--------
-    *
-    * @param s String to initialize from.
-    *
-    * @see operator>>
-    */
-   void toPoint(const std::string& s);
-   
-   /**
-    * Method to input the formatted string of the "operator<<".
-    *
-    * Expected format:  ( 30.00000000000000, -90.00000000000000 )
-    *                     --------x--------  ---------y--------
-    * 
-    * This method starts by doing a "makeNan" on pt.  So if anything goes
-    * wrong with the stream or parsing pt could be all or partially nan.
-    *
-    * @param is Input stream istream to formatted text.
-    * @param pt osimDpt to be initialized from stream.
-    * @return istream pass in.
-    */
-   friend OSSIMDLLEXPORT std::istream& operator>>(std::istream& is,
-                                                  ossimDpt& pt);
-   bool isEqualTo(const ossimDpt& rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL)const;
-   //***
-   // Public data members:
-   //***
-   union {double x; double samp; double u; double lon;};
-   union {double y; double line; double v; double lat;};
-
-};
-
-inline const ossimDpt& ossimDpt::operator=(const ossimDpt& pt)
-{
-   if (this != &pt)
-   {
-      x = pt.x;
-      y = pt.y;
-   }
-   
-   return *this;
-}
-
-#endif /* #ifndef ossimDpt_HEADER */
diff --git a/ossim/include/ossim/base/ossimDpt3d.h b/ossim/include/ossim/base/ossimDpt3d.h
deleted file mode 100644
index bb34f12..0000000
--- a/ossim/include/ossim/base/ossimDpt3d.h
+++ /dev/null
@@ -1,149 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:  
-//
-// Contains class declaration for dpt3d
-// Used to represent a 3d double point containing an x, y and z data member.
-//*******************************************************************
-//  $Id: ossimDpt3d.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDpt3d_HEADER
-#define ossimDpt3d_HEADER
-
-#include <cmath>
-#include <iosfwd>
-#include <string>
-
-#include <ossim/base/ossimCommon.h> /* for ossim::isnan */
-#include <ossim/base/ossimColumnVector3d.h>
-
-class ossimIpt;
-class ossimDpt;
-
-class OSSIMDLLEXPORT ossimDpt3d
-{
-public:
-   friend OSSIMDLLEXPORT std::ostream & operator <<(std::ostream &out,
-                                                    const ossimDpt3d &rhs);
-   
-   ossimDpt3d(const double &aX=0, const double &aY=0, const double &aZ=0)
-      :x(aX), y(aY), z(aZ) {}
-
-   ossimDpt3d(const ossimDpt &aPt);
-   ossimDpt3d(const ossimIpt &aPt);
-
-   //! Argument gPt is converted to WGS84 datum before coordinates are stored in x, y, z.
-   //! Likewise, ossimGpt has a constructor that accepts an ossimDpt3d with assumed WGS84 datum.
-   ossimDpt3d(const ossimGpt &gPt);
-   
-   ossimDpt3d(const ossimColumnVector3d &pt)
-      : x(pt[0]), y(pt[1]), z(pt[2]) {}
-   
-   bool operator ==(const ossimDpt3d &rhs) const
-      {
-         return ( (x == rhs.x) &&
-                  (y == rhs.y) &&
-                  (z == rhs.z));
-      }
-   bool operator !=(const ossimDpt3d &rhs) const
-   {
-      return ( (x != rhs.x) ||
-               (y != rhs.y) ||
-               (z != rhs.z) );
-   }
-   
-   void makeNan(){x = ossim::nan(); y=ossim::nan(); z=ossim::nan();}
-
-   bool hasNans()const
-   {
-      return (ossim::isnan(x) || ossim::isnan(y) || ossim::isnan(z));
-   }
-   /*!
-    * METHOD: length()
-    * Returns the RSS of the components.
-    */
-   double length() const { return std::sqrt(x*x + y*y + z*z); }
-   double length2() const { return x*x + y*y + z*z; }
-   
-   //***
-   // OPERATORS: +, -, +=, -=
-   // Point add/subtract with other point:
-   //***
-   ossimDpt3d operator+(const ossimDpt3d& p) const
-      { return ossimDpt3d(x+p.x, y+p.y, z+p.z); }
-   ossimDpt3d operator-(const ossimDpt3d& p) const
-      { return ossimDpt3d(x-p.x, y-p.y, z-p.z); }
-   const ossimDpt3d& operator+=(const ossimDpt3d& p)
-      { x += p.x; y += p.y; z += p.z; return *this; }
-   const ossimDpt3d& operator-=(const ossimDpt3d& p)
-      { x -= p.x; y -= p.y; z -= p.z; return *this; }
-
-   //***
-   // OPERATORS: *, /
-   // Scale point components by scalar:
-   //***
-   ossimDpt3d operator*(const double& d) const
-      { return ossimDpt3d(d*x, d*y, d*z); }
-   ossimDpt3d operator/(const double& d) const
-      { return ossimDpt3d(x/d, y/d, z/d); }
-  void operator /=(double value)
-      {
-         x /= value;
-         y /= value;
-         z /= value;
-      }
-   void operator *=(double value) 
-      {
-         x *= value;
-         y *= value;
-         z *= value;
-      }
-   double operator *(const ossimDpt3d& src)const
-   {
-      return (x*src.x + y*src.y + z*src.z);
-   }
-   inline const ossimDpt3d operator ^ (const ossimDpt3d& rhs) const
-   {
-      return ossimDpt3d(y*rhs.z-z*rhs.y,
-                        z*rhs.x-x*rhs.z ,
-                        x*rhs.y-y*rhs.x);
-   }
-
-   /**
-    * @brief To string method.
-    * 
-    * @param precision Output floating point precision.
-    * 
-    * @return std::string representing point.
-    *
-    * Output format:
-    * ( 0.0000000,  0.0000000,  0.00000000 )
-    *   -----x----  -----y----  ------z----
-    */
-   std::string toString(ossim_uint32 precision=15) const;
-   
-   /**
-    * @brief Initializes this point from string.
-    *
-    * Expected format:
-    * 
-    * ( 0.0000000,  0.0000000,  0.00000000 )
-    *   -----x----  -----y----  ------z----
-    *
-    * @param s String to initialize from.
-    */
-   void toPoint(const std::string& s); 
-   
-   double x;
-   double y;
-   double z;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimDrect.h b/ossim/include/ossim/base/ossimDrect.h
deleted file mode 100644
index 46a39f4..0000000
--- a/ossim/include/ossim/base/ossimDrect.h
+++ /dev/null
@@ -1,860 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for drect.
-// Container class for four double points representing a rectangle.
-// 
-//*******************************************************************
-//  $Id: ossimDrect.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDrect_HEADER
-#define ossimDrect_HEADER
-
-#include <iosfwd>
-#include <vector>
-
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimFpt.h>
-
-//***
-// NOTE:  A word on corner points...
-//
-// There is the concept of "pixel is area" and "pixel is point".
-// - Pixel is area means the (x,y) pixel coordinate refers to the upper left
-//   corner of the pixel, NOT the center of the pixel.
-// - Pixel is point means the (x,y) pixel coordinate refers to the center
-//   of the pixel, NOT the upper left corner.
-//
-// For the uniformity purposes, all pixel points  should be in the
-// "pixel is point" form; therefore, the (x,y) point should represent the
-// CENTER of the pixel.
-//***
-
-//***
-// Forward class declarations.
-//***
-class ossimIrect;
-class ossimPolygon;
-class ossimKeywordlist;
-
-//*******************************************************************
-// CLASS:  ossimDrect
-//*******************************************************************
-
-class OSSIMDLLEXPORT ossimDrect
-{
-public:
-   enum
-   {
-      UPPER_LEFT  = 1,
-      LOWER_LEFT  = 2,
-      LOWER_RIGHT = 4,
-      UPPER_RIGHT = 8
-   };
-
-   ossimDrect()
-      :
-         theUlCorner(0.0, 0.0),
-         theUrCorner(0.0, 0.0),
-         theLrCorner(0.0, 0.0),
-         theLlCorner(0.0, 0.0),
-         theOrientMode(OSSIM_LEFT_HANDED)
-      {}
-
-   ossimDrect(const ossimDpt&   ul_corner,
-              const ossimDpt&   lr_corner,
-              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED)
-      :
-         theUlCorner(ul_corner),
-         theUrCorner(lr_corner.x, ul_corner.y),
-         theLrCorner(lr_corner),
-         theLlCorner(ul_corner.x, lr_corner.y),
-         theOrientMode(mode)
-      {
-      }
-
-   ossimDrect(const double& ul_corner_x,
-              const double& ul_corner_y,
-              const double& lr_corner_x,
-              const double& lr_corner_y,
-              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED)
-      :
-         theUlCorner(ul_corner_x, ul_corner_y),
-         theUrCorner(lr_corner_x, ul_corner_y),
-         theLrCorner(lr_corner_x, lr_corner_y),
-         theLlCorner(ul_corner_x, lr_corner_y),
-         theOrientMode(mode)
-      {}
-   
-   ossimDrect(const ossimDrect& rect)
-      :
-         theUlCorner(rect.ul()),
-         theUrCorner(rect.ur()),
-         theLrCorner(rect.lr()),
-         theLlCorner(rect.ll()),
-         theOrientMode(rect.orientMode())
-      {}
-
-   ossimDrect(const ossimIrect& rect);
-
-   /*!
-    * Must compute a bounding rect given a collection of points or polygon:
-    */
-   ossimDrect(const std::vector<ossimDpt>& points,
-              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
-   ossimDrect(const ossimDpt& p1,
-              const ossimDpt& p2,
-              const ossimDpt& p3,
-              const ossimDpt& p4,
-              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
-   ossimDrect(const ossimPolygon& polygon, 
-              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
-
-   /** destructor */
-   ~ossimDrect();
-   
-   //! Constructs an Drect surrounding the specified point, and of specified size.
-   ossimDrect(const ossimDpt& center, 
-              const double&   size_x, 
-              const double&   size_y,
-              ossimCoordSysOrientMode mode=OSSIM_LEFT_HANDED);
-
-   inline const ossimDrect& operator=  (const ossimDrect& rect);
-   const ossimDrect&        operator=  (const ossimIrect& rect);
-   inline bool              operator!= (const ossimDrect& rect) const;
-   inline bool              operator== (const ossimDrect& rect) const;
-
-   friend ossimDrect operator*(double scalar, const ossimDrect& rect)
-   {
-      ossimDpt ul(rect.theUlCorner.x*scalar,
-                  rect.theUlCorner.y*scalar);
-      
-      if(rect.theOrientMode == OSSIM_LEFT_HANDED)
-      {
-         return ossimDrect(ul.x,
-                           ul.y,
-                           ul.x+rect.width()*scalar-1,
-                           ul.y+rect.height()*scalar-1,
-                           rect.theOrientMode);
-      }
-      return ossimDrect(ul.x,
-                        ul.y,
-                        ul.x+rect.width()*scalar-1,
-                        ul.y-(rect.height()*scalar-1),
-                        rect.theOrientMode);
-      
-   }
-   
-   const ossimDrect& operator *=(double scalar)
-      {
-          ossimDpt ul(theUlCorner.x*scalar,
-                      theUlCorner.y*scalar);
-
-          if(theOrientMode == OSSIM_LEFT_HANDED)
-          {
-             *this = ossimDrect(ul.x,
-                                ul.y,
-                                (ul.x+width()*scalar-1),
-                                (ul.y+height()*scalar-1),
-                                theOrientMode);
-          }
-          else
-          {
-             *this = ossimDrect(ul.x,
-                                ul.y,
-                                (ul.x+width()*scalar-1),
-                                (ul.y-(height()*scalar-1)),
-                                theOrientMode);
-                                
-          }
-         return *this;
-      }
-   
-   ossimDrect operator *(double scalar)const
-      {
-         ossimDpt ul((theUlCorner.x*scalar),
-                     (theUlCorner.y*scalar));
-
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            return ossimDrect(ul.x,
-                              ul.y,
-                              (ul.x+width()*scalar-1),
-                              (ul.y+height()*scalar-1),
-                              theOrientMode);
-         }
-
-         return ossimDrect(ul.x,
-                           ul.y,
-                           (ul.x+width()*scalar-1),
-                           ul.y-(height()*scalar-1),
-                           theOrientMode);
-      }
-   const ossimDrect& operator *=(const ossimDpt& scalar)
-      {
-         ossimDpt ul((theUlCorner.x*scalar.x),
-                     (theUlCorner.y*scalar.y));
-         
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            *this = ossimDrect(ul.x,
-                               ul.y,
-                               (ul.x+width()*scalar.x - 1),
-                               (ul.y+height()*scalar.y - 1),
-                               theOrientMode);
-         }
-         else
-         {
-            *this = ossimDrect(ul.x,
-                               ul.y,
-                               (ul.x+width()*scalar.x - 1),
-                               (ul.y-(height()*scalar.y - 1)),
-                               theOrientMode);            
-         }
-         return *this;
-      }
-   
-   ossimDrect operator *(const ossimDpt& scalar)const
-      {
-         ossimDpt ul((theUlCorner.x*scalar.x),
-                     (theUlCorner.y*scalar.y));
-         
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            return ossimDrect(ul.x,
-                              ul.y,
-                              (ul.x+width()*scalar.x-1),
-                              (ul.y+height()*scalar.y-1),
-                              theOrientMode);
-         }
-         return ossimDrect(ul.x,
-                           ul.y,
-                           (ul.x+width()*scalar.x-1),
-                           (ul.y-(height()*scalar.y-1)),
-                           theOrientMode);
-      }
-   const ossimDrect& operator +=(const ossimDpt& shift)
-      {
-         ossimDpt ul((theUlCorner.x+shift.x),
-                     (theUlCorner.y+shift.y));
-                     
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            *this = ossimDrect(ul.x,
-                               ul.y,
-                               ul.x+width()-1,
-                               ul.y+height()-1,
-                               theOrientMode);
-         }
-         else
-         {
-            *this = ossimDrect(ul.x,
-                               ul.y,
-                               ul.x+width()-1,
-                               ul.y-(height()-1),
-                               theOrientMode);            
-         }
-         return *this;
-      }
-   
-   const ossimDrect& operator -=(const ossimDpt& shift)
-      {
-         ossimDpt ul((theUlCorner.x-shift.x),
-                     (theUlCorner.y-shift.y));
-         
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            *this = ossimDrect(ul.x,
-                               ul.y,
-                               ul.x+width()-1,
-                               ul.y+height()-1,
-                               theOrientMode);
-         }
-         else
-         {
-            *this = ossimDrect(ul.x,
-                               ul.y,
-                               ul.x+width()-1,
-                               ul.y-(height()-1),
-                               theOrientMode);
-         }
-         return *this;
-      }
-   
-   ossimDrect operator +(const ossimDpt& shift)const
-      {
-         ossimDpt ul((theUlCorner.x+shift.x),
-                     (theUlCorner.y+shift.y));
-                     
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            return ossimDrect(ul.x,
-                              ul.y,
-                              ul.x+width()-1,
-                              ul.y+height()-1,
-                              theOrientMode);
-         }
-         else
-         {
-            return ossimDrect(ul.x,
-                              ul.y,
-                              ul.x+width()-1,
-                              ul.y-(height()-1),
-                              theOrientMode);
-         }
-      }  
-
-   ossimDrect operator -(const ossimDpt& shift)const
-      {
-         ossimIpt ul(ossim::round<int>(theUlCorner.x-shift.x),
-                     ossim::round<int>(theUlCorner.y-shift.y));
-                     
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            return ossimDrect(ul.x,
-                              ul.y,
-                              ul.x+width()-1,
-                              ul.y+height()-1,
-                              theOrientMode);
-         }
-         else
-         {
-            return ossimDrect(ul.x,
-                              ul.y,
-                              ul.x+width()-1,
-                              ul.y-(height()-1),
-                              theOrientMode);            
-         }
-      }  
-
-   const ossimDpt& ul() const { return theUlCorner; }
-   const ossimDpt& ur() const { return theUrCorner; }
-   const ossimDpt& lr() const { return theLrCorner; }
-   const ossimDpt& ll() const { return theLlCorner; }
-
-   const ossimDrect& changeOrientationMode(ossimCoordSysOrientMode mode)
-   {
-      // if we are already in the orientation then return
-      //
-      if(mode == theOrientMode) return *this;
-      if(mode == OSSIM_LEFT_HANDED)
-      {
-         // we must be right handed so change to left handed
-         *this = ossimDrect(theUlCorner.x,
-                            theLlCorner.y,
-                            theLrCorner.x,
-                            theUlCorner.y,
-                            OSSIM_LEFT_HANDED);
-      }
-      else
-      {
-         // we must be left handed so change to RIGHT handed
-         *this = ossimDrect(theUlCorner.x,
-                            theLlCorner.y,
-                            theLrCorner.x,
-                            theUlCorner.y,
-                            OSSIM_RIGHT_HANDED);
-      }
-      theOrientMode = mode;
-      
-      return *this;
-   }
-   
-   void getBounds(double& minx, double& miny,
-                  double& maxx, double& maxy)const
-      {
-         minx = theUlCorner.x;
-         maxx = theUrCorner.x;
-         if(theOrientMode == OSSIM_LEFT_HANDED)
-         {
-            miny = theUlCorner.y;
-            maxy = theLrCorner.y;
-         }
-         else
-         {
-            maxy = theUlCorner.y;
-            miny = theLrCorner.y;
-         }
-      }
-   void makeNan()
-      {
-         theUlCorner.makeNan();
-         theLlCorner.makeNan();
-         theLrCorner.makeNan();
-         theUrCorner.makeNan();
-      }
-   
-   bool hasNans()const{ return (theUlCorner.hasNans() ||
-                                theLlCorner.hasNans() ||
-                                theLrCorner.hasNans() ||
-                                theUrCorner.hasNans());}
-   
-   bool isNan()const{ return (theUlCorner.hasNans() &&
-                              theLlCorner.hasNans() &&
-                              theLrCorner.hasNans() &&
-                              theUrCorner.hasNans());}
-
-   double area()const
-      {
-         return width()*height();
-      }
-   //***
-   // This class supports both left and right-handed coordinate systems. For
-   // both, the positive x-axis extends to the "right".
-   //***
-   ossimCoordSysOrientMode orientMode() const { return theOrientMode; }
-   void setOrientMode(ossimCoordSysOrientMode mode) { theOrientMode = mode; }
-   
-   /*!
-    * Sets the upper left corner to "pt".  Adjusts the remaining corners
-    * accordingly.
-    */
-   inline void set_ul(const ossimDpt& pt);
-
-   /*!
-    * Sets the upper right corner to "pt".  Adjusts the remaining corners
-    * accordingly.
-    */
-   inline void set_ur(const ossimDpt& pt);
-
-   /*!
-    * Sets the lower right corner to "pt".  Adjusts the remaining corners
-    * accordingly.
-    */
-   inline void set_lr(const ossimDpt& pt);
-
-   /*!
-    * Sets the lower left corner to "pt".  Adjusts the remaining corners
-    * accordingly.
-    */
-   inline void set_ll(const ossimDpt& pt);
-
-   /*!
-    * Sets the upper left x.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_ulx(ossim_float64 x);
-
-   /*!
-    * Sets the upper left y.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_uly(ossim_float64 y);
-
-   /*!
-    * Sets the upper right x.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_urx(ossim_float64 x);
-
-   /*!
-    * Sets the upper right y.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_ury(ossim_float64 y);
-
-   /*!
-    * Sets the lower right x.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_lrx(ossim_float64 x);
-
-   /*!
-    * Sets the lower right y.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_lry(ossim_float64 y);
-
-   /*!
-    * Sets the lower left x.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_llx(ossim_float64 x);
-
-   /*!
-    * Sets the lower left y.  Adjusts the remaining corners accordingly.
-    */
-   inline void set_lly(ossim_float64 y);
-
-   /*!
-    * METHOD: initBoundingRect(points)
-    * Initializes this rect to the bounding rect containing all points in the
-    * collection passed in.
-    */
-   void initBoundingRect(const std::vector<ossimDpt>& points);
-
-   /*!
-    * Returns true if "pt" falls within rectangle.  Fall on an edge is also
-    * considered to be within.  The edge is expanded by epsilon value so any value
-    * within epsilon is inside
-    */
-   bool pointWithin(const ossimDpt& pt, double epsilon=0.0) const;
-
-   /*!
-    * Returns true if "pt" falls within rectangle.  Fall on an edge is also
-    * considered to be within.
-    */
-   bool pointWithin(const ossimFpt& pt, double epsilon=0.0) const;
-
-   /*!
-    * Returns true if any portion of an input rectangle "rect" intersects
-    * "this" rectangle.  
-    */
-   bool intersects(const ossimDrect& rect) const;
-
-   /*!
-    * Returns true if "this" rectangle is contained completely within the
-    * input rectangle "rect".
-    */
-   bool completely_within(const ossimDrect& rect) const;
-
-   ossimCoordSysOrientMode orientationMode()const{return theOrientMode;}
-   /*!
-    * Returns the height of a rectangle.
-    */
-   ossim_float64 height() const { return fabs(theLlCorner.y - theUlCorner.y) + 1.0; }
-
-   /*!
-    * Returns the width of a rectangle.
-    */
-   ossim_float64 width()  const { return fabs(theLrCorner.x - theLlCorner.x) + 1.0; }
-
-   ossimDpt size() const { return ossimDpt(width(), height()); }
-
-   /*!
-    * Stretches this rectangle out to integer boundaries.
-    */
-   void stretchOut();
-
-   /*!
-    * Will stretch the rect to the passed in tiled boundary.
-    */
-   void stretchToTileBoundary(const ossimDpt& widthHeight);
-
-   const ossimDrect& expand(const ossimDpt& padding);
-
-   /**
-    * @return ossimString representing ossimIrect.
-    *
-    * Format:  ( 30, -90, 512, 512, [LH|RH] )
-    *            -x- -y-  -w-  -h-   -Right or left handed-
-    *
-    * where:
-    *     x and y are origins either upper left if LEFT HANDED (LH) or
-    *                                lower left if RIGHT HANDED (RH)
-    *     w and h are width and height respectively
-    *     The last value is LH or RH to indicate LeftHanded or RightHanded
-    *    
-    */
-   ossimString toString()const;
-   /**
-    * expected Format:  form 1: ( 30, -90, 512, 512, [LH|RH] )
-    *                            -x- -y-  -w-  -h-   -Right or left handed-
-    * 
-    *                   form 2: ( 30, -90, 512, 512)
-    *                            -x- -y-  -w-  -h-
-    *
-    * NOTE: Form 2 assumes Left handed were x,y is origin upper left and y positive down.
-    *
-    * This method starts by doing a "makeNan" on rect. 
-    *
-    * @param rectString String to initialize from.
-    * @return true or false to indicate successful parsing.
-    */
-   bool toRect(const ossimString& rectString);
-
-   bool saveState(ossimKeywordlist& kwl,
-                  const char* prefix=0)const;
-   bool loadState(const ossimKeywordlist& kwl,
-                  const char* prefix=0);
-
-   /*!
-    * Will subdivide this rect into four partitions.
-    */
-   void splitToQuad(ossimDrect& ulRect,
-                    ossimDrect& urRect,
-                    ossimDrect& lrRect,
-                    ossimDrect& llRect);
-   
-   /*!
-   * Finds the point on the rect boundary that is closest to the arg_point. Closest is defined as
-   * the minimum perpendicular distance.
-   */
-   ossimDpt findClosestEdgePointTo(const ossimDpt& arg_point) const;
-   
-   ossimDrect clipToRect(const ossimDrect& rect)const;
-
-   inline ossimDpt midPoint()const;
-
-   void print(std::ostream& os) const;
-
-   ossimDrect combine(const ossimDrect& rect)const;
-   
-   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
-                                                  const ossimDrect& rect);
-
-   bool clip(ossimDpt &p1,
-             ossimDpt  &p2)const;
-
-   static long getCode(const ossimDpt& aPoint,
-                       const ossimDrect& clipRect);
-private:
-
-   enum ossimCohenSutherlandClipCodes
-   {
-      NONE   = 0,
-      LEFT   = 1,
-      RIGHT  = 2,
-      BOTTOM = 4,
-      TOP    = 8
-   };
-   
-   //***
-   // Private data members representing the rectangle corners.
-   //***
-   ossimDpt theUlCorner;
-   ossimDpt theUrCorner;
-   ossimDpt theLrCorner;
-   ossimDpt theLlCorner;
-
-   ossimCoordSysOrientMode  theOrientMode;
-};
-
-//*******************************************************************
-// Inline Method: ossimDrect::operator=(ossimDrect)
-//*******************************************************************
-inline const ossimDrect& ossimDrect::operator=(const ossimDrect& rect)
-{
-   if (this != &rect)
-   {
-      theUlCorner   = rect.theUlCorner;
-      theUrCorner   = rect.theUrCorner;
-      theLrCorner   = rect.theLrCorner;
-      theLlCorner   = rect.theLlCorner;
-      theOrientMode = rect.theOrientMode;
-   }
-
-   return *this;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::operator!=
-//*******************************************************************
-inline bool ossimDrect::operator!=(const ossimDrect& rect) const
-{
-   return ( (theUlCorner   != rect.theUlCorner) ||
-            (theUrCorner   != rect.theUrCorner) ||
-            (theLrCorner   != rect.theLrCorner) ||
-            (theLlCorner   != rect.theLlCorner) ||
-            (theOrientMode != rect.theOrientMode));
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::operator==
-//*******************************************************************
-inline bool ossimDrect::operator==(const ossimDrect& rect) const
-{
-   return ( (theUlCorner   == rect.theUlCorner) &&
-            (theUrCorner   == rect.theUrCorner) &&
-            (theLrCorner   == rect.theLrCorner) &&
-            (theLlCorner   == rect.theLlCorner) &&
-            (theOrientMode == rect.theOrientMode));
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_ul
-//*******************************************************************
-inline void ossimDrect::set_ul(const ossimDpt& pt)
-{
-   theUlCorner   = pt;
-   theUrCorner.y = pt.y;
-   theLlCorner.x = pt.x;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_ur
-//*******************************************************************
-inline void ossimDrect::set_ur(const ossimDpt& pt)
-{
-   theUrCorner   = pt;
-   theUlCorner.y = pt.y;
-   theLrCorner.x = pt.x;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_lr
-//*******************************************************************
-inline void ossimDrect::set_lr(const ossimDpt& pt)
-{
-   theLrCorner   = pt;
-   theUrCorner.x = pt.x;
-   theLlCorner.y = pt.y;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_ll
-//*******************************************************************
-inline void ossimDrect::set_ll(const ossimDpt& pt)
-{
-   theLlCorner   = pt;
-   theUlCorner.x = pt.x;
-   theLrCorner.y = pt.y;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_ulx
-//*******************************************************************
-inline void ossimDrect::set_ulx(ossim_float64 x)
-{
-   theUlCorner.x = x;
-   theLlCorner.x = x;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_uly
-//*******************************************************************
-inline void ossimDrect::set_uly(ossim_float64 y)
-{
-   theUlCorner.y = y;
-   theUrCorner.y = y;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_urx
-//*******************************************************************
-inline void ossimDrect::set_urx(ossim_float64 x)
-{
-   theUrCorner.x = x;
-   theLrCorner.x = x;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_ury
-//*******************************************************************
-inline void ossimDrect::set_ury(ossim_float64 y)
-{
-   theUrCorner.y = y;
-   theUlCorner.y = y;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_lrx
-//*******************************************************************
-inline void ossimDrect::set_lrx(ossim_float64 x)
-{
-   theLrCorner.x = x;
-   theUrCorner.x = x;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_lry
-//*******************************************************************
-inline void ossimDrect::set_lry(ossim_float64 y)
-{
-   theLrCorner.y = y;
-   theLlCorner.y = y;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_llx
-//*******************************************************************
-inline void ossimDrect::set_llx(ossim_float64 x)
-{
-   theLlCorner.x = x;
-   theUlCorner.x = x;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::set_lly
-//*******************************************************************
-inline void ossimDrect::set_lly(ossim_float64 y)
-{
-   theLlCorner.y = y;
-   theLrCorner.y = y;
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::pointWithin(const ossimDpt& pt) 
-//*******************************************************************
-inline bool ossimDrect::pointWithin(const ossimDpt& pt, double epsilon) const
-{
-   if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      return ((pt.x >= (ul().x-epsilon)) &&
-              (pt.x <= (ur().x+epsilon)) &&
-              (pt.y >= (ul().y-epsilon)) &&
-              (pt.y <= (ll().y+epsilon)));
-   }
-   return ((pt.x >= (ul().x-epsilon)) &&
-           (pt.x <= (ur().x+epsilon)) &&
-           (pt.y <= (ul().y+epsilon)) &&
-           (pt.y >= (ll().y-epsilon)));
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::pointWithin(const ossimFpt& pt)
-//*******************************************************************
-inline bool ossimDrect::pointWithin(const ossimFpt& pt, double epsilon) const
-{
-   if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      return ((pt.x >= (ul().x-epsilon)) &&
-              (pt.x <= (ur().x+epsilon)) &&
-              (pt.y >= (ul().y-epsilon)) &&
-              (pt.y <= (ll().y+epsilon)));
-   }
-   return ((pt.x >= (ul().x-epsilon)) &&
-           (pt.x <= (ur().x+epsilon)) &&
-           (pt.y <= (ul().y+epsilon)) &&
-           (pt.y >= (ll().y-epsilon)));
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::midPoint()
-//*******************************************************************
-inline ossimDpt ossimDrect::midPoint()const
-{
-   return ossimDpt( (ul().x + ur().x + ll().x + lr().x)*.25,
-                    (ul().y + ur().y + ll().y + lr().y)*.25);
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::combine(const ossimDrect& rect)
-//*******************************************************************
-inline ossimDrect ossimDrect::combine(const ossimDrect& rect)const
-{
-   if(rect.hasNans() || hasNans())
-   {
-      ossimDrect result;
-
-      result.makeNan();
-
-      return result;
-   }
-   if (theOrientMode != rect.theOrientMode)
-      return(*this);
-   
-   ossimDpt ulCombine;
-   ossimDpt lrCombine;
-
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
-      ulCombine.y = ((ul().y <= rect.ul().y)?ul().y:rect.ul().y);
-      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
-      lrCombine.y = ((lr().y >= rect.lr().y)?lr().y:rect.lr().y);
-   }
-   else
-   {
-      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
-      ulCombine.y = ((ul().y >= rect.ul().y)?ul().y:rect.ul().y);
-      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
-      lrCombine.y = ((lr().y <= rect.lr().y)?lr().y:rect.lr().y);
-   }
-
-   return ossimDrect(ulCombine, lrCombine, theOrientMode);
-}
-#endif
-
diff --git a/ossim/include/ossim/base/ossimDuration.h b/ossim/include/ossim/base/ossimDuration.h
deleted file mode 100644
index 05cb680..0000000
--- a/ossim/include/ossim/base/ossimDuration.h
+++ /dev/null
@@ -1,167 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id$
-#ifndef ossimDuration_HEADER
-#define ossimDuration_HEADER
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimReferenced.h>
-#include <iostream>
-
-class OSSIM_DLL ossimDuration
-{
-public:
-   /**
-    * This will take an iso8601 encoded duration string and parse out
-    * the individual values
-    */
-   ossimDuration(const ossimString& iso8601Duration = ossimString(""));
-   
-   
-   /**
-    * zero out all fields
-    */
-   void clearFields();
-   
-   /**
-    * This will take an iso8601 encoded duration stream and parse out
-    * the individual values it will stop when a blank character or whitespace is found
-    */
-   bool readIso8601Encoding(std::istream& in);
-   
-   /**
-    * This will take an iso8601 encoded duration stream and parse out
-    * the individual values it will stop when a blank character or whitespace is found
-    */
-   bool setByIso8601DurationString(const ossimString& iso8601Duration);
-   
-   /**
-    * Will take the field values and encode into a iso8601 string format.
-    * Note, anything that is 0 will not be output.
-    *
-    */
-   void toIso8601DurationString(ossimString& result);
-   
-   /**
-    * this will not use the months field or the years field but will use all other
-    * fields to calculate a total value in seconds.  We can not determine leap years
-    * and how many days are in a month so those are omitted and so this serves as
-    * a utility method to just calculate the total seconds if you give a duration string
-    * that contains only one or all or any of the following: weeks, days, minutes, hours,
-    * and/or seconds.
-    *
-    * If the sign is set to negative it will return a negative value.
-    */
-   ossim_float64 toSeconds()const;
-   
-   void setSign(ossim_int32 value)
-   {
-      theSign = ((value < 0)?-1:1);
-   }
-   /**
-    * returns the sign.  Should be either -1 or 1 for the return
-    */
-   ossim_int32 sign()const
-   {
-      return theSign;
-   }
-   void setYears(ossim_uint64 value)
-   {
-      theYears = value;
-   }
-   ossim_int64 years()const
-   {
-      return theYears;
-   }
-   void setMonths(ossim_uint64 value)
-   {
-      theMonths = value;
-   }
-   ossim_int64 months()const
-   {
-      return theMonths;
-   }
-   void setWeeks(ossim_uint64 value)
-   {
-      theWeeks = value;
-   }
-   ossim_int64 weeks()const
-   {
-      return theWeeks;
-   }
-   void setDays(ossim_uint64 value)
-   {
-      theDays = value;
-   }
-   ossim_int64 days()const
-   {
-      return theDays;
-   }
-   void setHours(ossim_uint64 value)
-   {
-      theHours = value;
-   }
-   ossim_int64 hours()const
-   {
-      return theHours;
-   }
-   void setMinutes(ossim_uint64 value)
-   {
-      theMinutes = value;
-   }
-   ossim_int64 minutes()const
-   {
-      return theMinutes;
-   }
-   void setSeconds(ossim_float64 value)
-   {
-      theSeconds = value;
-   }
-   ossim_float64 seconds()const
-   {
-      return theSeconds;
-   }
-   
-   /**
-    * Sets all values in one call
-    */
-   void setAll(ossim_int32 signValue,
-               ossim_uint64 yearsValue,
-               ossim_uint64 monthsValue,
-               ossim_uint64 weeksValue,
-               ossim_uint64 daysValue,
-               ossim_uint64 hoursValue,
-               ossim_uint64 minutesValue,
-               ossim_float64 secondsValue)
-   {
-      theSign    = ((signValue < 0)?-1:1);
-      theYears   = yearsValue;
-      theMonths  = monthsValue;
-      theWeeks   = weeksValue;
-      theDays    = daysValue;
-      theHours   = hoursValue;
-      theMinutes = minutesValue;
-      theSeconds = secondsValue;
-   }
-               
-   
-protected:
-   ossim_int32 theSign; // indicates -1 for negative and anything else is positive
-   ossim_int64 theYears; // number of years
-   ossim_int64 theMonths; // number of months
-   ossim_int64 theWeeks; // number of months
-   ossim_int64 theDays;   // number of days
-   ossim_int64 theHours;  // number of hours
-   ossim_int64 theMinutes; // number of minutes
-   ossim_float64 theSeconds; // umber of Seconds
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimEcefPoint.h b/ossim/include/ossim/base/ossimEcefPoint.h
deleted file mode 100644
index 070f526..0000000
--- a/ossim/include/ossim/base/ossimEcefPoint.h
+++ /dev/null
@@ -1,220 +0,0 @@
-//*****************************************************************************
-// FILE: ossimEcefPoint.h
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION:
-//   Contains declaration of a 3D point object in the Earth-centered, earth
-//   fixed (ECEF) coordinate system.
-//
-// SOFTWARE HISTORY:
-//>
-//   08Aug2001  Oscar Kramer (http://www.oscarkramer.com)
-//              Initial coding.
-//<
-//*****************************************************************************
-//  $Id: ossimEcefPoint.h 20043 2011-09-06 15:00:55Z oscarkramer $
-
-#ifndef ossimEcefPoint_HEADER
-#define ossimEcefPoint_HEADER
-#include <iosfwd>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimColumnVector3d.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/matrix/newmat.h>
-
-class ossimGpt;
-class ossimEcefVector;
-class ossimDpt3d;
-
-//*****************************************************************************
-//  CLASS: ossimEcefPoint
-//
-//*****************************************************************************
-class OSSIMDLLEXPORT ossimEcefPoint
-{
-public:
-   /*!
-    * CONSTRUCTORS: 
-    */
-   ossimEcefPoint()
-      : theData(0,0,0) {}
-
-   ossimEcefPoint(const ossimEcefPoint& copy_this)
-      : theData (copy_this.theData) {}
-
-   ossimEcefPoint(const ossimGpt& convert_this);
-
-   ossimEcefPoint(const double& x,
-                  const double& y,
-                  const double& z)
-      : theData(x, y, z) {}
-
-   ossimEcefPoint(const ossimColumnVector3d& assign_this)
-      : theData(assign_this) {}
-
-   ossimEcefPoint(const NEWMAT::ColumnVector& assign_this)
-      : theData(assign_this) {}
-
-   ossimEcefPoint(const ossimDpt3d& pt);
-   
-   void makeNan()
-      {
-         theData[0] = ossim::nan();
-         theData[1] = ossim::nan();
-         theData[2] = ossim::nan();
-      }
-   
-   bool hasNans()const
-      {
-         return ( ossim::isnan(theData[0]) ||
-                  ossim::isnan(theData[1]) ||
-                  ossim::isnan(theData[2]) );
-                           
-      }
-
-   bool isNan()const
-      {
-         return ( ossim::isnan(theData[0]) &&
-                  ossim::isnan(theData[1]) &&
-                  ossim::isnan(theData[2]) );
-         
-      }
-   /*!
-    * OPERATORS:
-    */
-   ossimEcefVector       operator- (const ossimEcefPoint&)  const;
-   ossimEcefPoint        operator+ (const ossimEcefVector&) const;
-   ossimEcefPoint        operator- (const ossimEcefVector&) const;
-   const ossimEcefPoint& operator= (const ossimEcefPoint&);        // inline
-   bool                  operator==(const ossimEcefPoint&)  const; // inline
-   bool                  operator!=(const ossimEcefPoint&)  const; // inline
-   
-   /*!
-    * COMPONENT ACCESS METHODS: 
-    */
-   double    x() const { return theData[0]; }
-   double&   x()       { return theData[0]; }
-   double    y() const { return theData[1]; }
-   double&   y()       { return theData[1]; }
-   double    z() const { return theData[2]; }
-   double&   z()       { return theData[2]; }
-   double&   operator[](int idx){return theData[idx];}
-   const double&   operator[](int idx)const{return theData[idx];}
-   const ossimColumnVector3d& data() const { return theData; }
-   ossimColumnVector3d&       data()       { return theData; }
-
-   double getMagnitude() const
-      {
-         return theData.magnitude();
-      }
-   double magnitude()const
-   {
-      return theData.magnitude();
-   }
-   double length()const
-   {
-      return theData.magnitude();
-   }
-   double normalize()
-   {
-      double result = magnitude();
-
-      if(result > 1e-15)
-      {
-         theData[0]/=result;
-         theData[1]/=result;
-         theData[2]/=result;
-      }
-      
-      return result;
-   }
-
-   /**
-    * @brief To string method.
-    * 
-    * @param precision Output floating point precision.
-    * 
-    * @return ossimString representing point.
-    *
-    * Output format:
-    * ( 0.0000000,  0.0000000,  0.00000000 )
-    *   -----x----  -----y----  ------z----
-    */
-   ossimString toString(ossim_uint32 precision=15) const;
-
-   /**
-    * @brief Initializes this point from string.
-    *
-    * Expected format:
-    * 
-    * ( 0.0000000,  0.0000000,  0.00000000 )
-    *   -----x----  -----y----  ------z----
-    *
-    * @param s String to initialize from.
-    */
-   void toPoint(const std::string& s);
-   
-   //! Converts this point to a 3D column vector.
-   NEWMAT::ColumnVector toVector() const
-   {
-      NEWMAT::ColumnVector v (3);
-      v(0) = theData[0];
-      v(1) = theData[1];
-      v(2) = theData[2];
-      return v;
-   }
-   
-   //! Converts 3D column vector to this point.
-   void toPoint(const NEWMAT::ColumnVector& v)
-   {
-      if (v.Nrows() == 3)
-      {
-         theData[0] = v[0];
-         theData[1] = v[1];
-         theData[2] = v[2];
-      }
-   }
-
-   /*!
-    * Debug Dump: 
-    */
-   void print(std::ostream& os = ossimNotify(ossimNotifyLevel_INFO)) const;
-   
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& os ,
-                                             const ossimEcefPoint& instance);
-
-protected:
-   ossimColumnVector3d theData;
-};
-
-//================== BEGIN DEFINITIONS FOR INLINE METHODS =====================
-
-//*****************************************************************************
-//  INLINE METHOD: ossimEcefPoint::operator=(ossimEcefPoint)
-//*****************************************************************************
-inline const ossimEcefPoint&
-ossimEcefPoint::operator=(const ossimEcefPoint& p)
-{
-   theData = p.theData;
-   return *this;
-}
-
-//*****************************************************************************
-//  INLINE METHOD: ossimEcefPoint::operator==(ossimEcefPoint)
-//*****************************************************************************
-inline bool ossimEcefPoint::operator==(const ossimEcefPoint& p) const
-{
-   return (theData == p.theData);
-}
-
-//*****************************************************************************
-//  INLINE METHOD: ossimEcefPoint::operator!=(ossimEcefPoint)
-//*****************************************************************************
-inline bool ossimEcefPoint::operator!=(const ossimEcefPoint& p) const
-{
-   return (theData != p.theData);
-}
-
-#endif
diff --git a/ossim/include/ossim/base/ossimEndian.h b/ossim/include/ossim/base/ossimEndian.h
deleted file mode 100644
index ff87024..0000000
--- a/ossim/include/ossim/base/ossimEndian.h
+++ /dev/null
@@ -1,273 +0,0 @@
-//******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-// 
-// Description: This file contains the interface to the
-//              endian byte swap
-//
-//***********************************
-// $ID$
-#ifndef ossimEndian_HEADER
-#define ossimEndian_HEADER
-
-// for OSSIM_LITTLE_ENDIAN AND BIG_ENDIAN
-#include <ossim/base/ossimConstants.h>
-
-class OSSIMDLLEXPORT ossimEndian
-{
-public:
-   ossimEndian();
-
-   /*!
-    *  Swap bytes methods that work on a single pixel.
-    */
-   inline void swap(ossim_sint8    &/*data*/){}
-   inline void swap(ossim_uint8    &/*data*/){}
-   inline void swap(ossim_int16   &data) const;
-   inline void swap(ossim_uint16  &data) const;
-   inline void swap(ossim_int32   &data) const;
-   inline void swap(ossim_uint32  &data) const;
-   inline void swap(ossim_uint64  &data) const;
-   inline void swap(ossim_sint64  &data) const;
-   inline void swap(ossim_float32 &data) const;
-   inline void swap(ossim_float64 &data) const;
-
-   /*!
-    *  Swap bytes methods that work on arrays of pixels.
-    *
-    *  @note size is number of pixels, not number of bytes.
-    */
-   inline void swap(ossimScalarType scalar, void* data, ossim_uint32 size) const;
-   // only here to allow template based swaps to compile correctly
-   //
-   inline void swap(ossim_sint8* data, ossim_uint32 size)const;
-   inline void swap(ossim_uint8* data, ossim_uint32 size)const;
-   
-   inline void swap(ossim_int16* data, ossim_uint32 size) const;
-   inline void swap(ossim_uint16* data, ossim_uint32 size) const;
-
-   inline void swap(ossim_int32* data, ossim_uint32 size) const;
-   inline void swap(ossim_uint32* data, ossim_uint32 size) const;
-
-   inline void swap(ossim_int64* data, ossim_uint32 size) const;
-   inline void swap(ossim_uint64* data, ossim_uint32 size) const;
-
-   inline void swap(ossim_float32* data, ossim_uint32 size) const;
-   inline void swap(ossim_float64* data, ossim_uint32 size) const;
-
-   inline void swapTwoBytes(void* data, ossim_uint32 size) const;
-   inline void swapFourBytes(void* data, ossim_uint32 size) const;
-   inline void swapEightBytes(void* data, ossim_uint32 size) const;
-   inline ossimByteOrder getSystemEndianType() const;
-
-private:
-
-   // Holds the Endian of the architecture that you are running on.
-   ossimByteOrder  theSystemEndianType;  
-   
-   void swapTwoBytes(void *data) const;
-   void swapFourBytes(void *data) const;
-   void swapEightBytes(void *data) const;
-
-   void swapPrivate(ossim_uint8 *c1,
-                    ossim_uint8 *c2) const;
-};
-
-inline ossimByteOrder ossimEndian::getSystemEndianType() const
-{
-   return theSystemEndianType;
-}
-
-inline void ossimEndian::swap(ossim_sint8* /* data */,
-                              ossim_uint32 /* size */ )const
-{
-   //intentionally left blank
-}
-
-inline void ossimEndian::swap(ossim_uint8* /* data */,
-                              ossim_uint32 /* size */ )const
-{
-   //intentionally left blank
-}
-
-inline void ossimEndian::swap(ossim_int16 &data) const
-{
-   swapTwoBytes(reinterpret_cast<void*>(&data));   
-} 
-
-inline void ossimEndian::swap(ossim_uint16 &data) const
-{
-   swapTwoBytes(reinterpret_cast<void*>(&data));
-}
-
-inline void ossimEndian::swap(ossim_int32 &data) const
-{
-   swapFourBytes(reinterpret_cast<void*>(&data));
-}
-
-inline void ossimEndian::swap(ossim_uint32 &data) const
-{
-   swapFourBytes(reinterpret_cast<void*>(&data));
-}
-
-inline void ossimEndian::swap(ossim_uint64 &data) const
-{
-   swapEightBytes(reinterpret_cast<void*>(&data));
-}
-
-inline void ossimEndian::swap(ossim_sint64 &data) const
-{
-   swapEightBytes(reinterpret_cast<void*>(&data));
-}
-
-inline void ossimEndian::swap(ossim_float32 &data) const
-{
-   swapFourBytes(reinterpret_cast<void*>(&data));
-}
-
-inline void ossimEndian::swap(ossim_float64 &data) const
-{
-   swapEightBytes(reinterpret_cast<void*>(&data));
-}
-
-inline void ossimEndian::swapTwoBytes(void *data) const
-{
-   unsigned char *c = reinterpret_cast<unsigned char*>(data);
-
-   swapPrivate(&c[0], &c[1]);
-}
-
-inline void ossimEndian::swapFourBytes(void* data) const
-{
-   unsigned char *c = reinterpret_cast<unsigned char*>(data);
-
-   swapPrivate(&c[0], &c[3]);
-   swapPrivate(&c[1], &c[2]);
-}
-
-inline void ossimEndian::swapEightBytes(void* data) const
-{
-   unsigned char *c = reinterpret_cast<unsigned char*>(data);
-
-   swapPrivate(&c[0], &c[7]);
-   swapPrivate(&c[1], &c[6]);
-   swapPrivate(&c[2], &c[5]);
-   swapPrivate(&c[3], &c[4]);
-}
-
-inline void ossimEndian::swapPrivate(ossim_uint8 *c1,                       
-                                     ossim_uint8 *c2) const
-{
-   ossim_uint8 temp_c = *c1;
-   *c1 = *c2;
-   *c2 = temp_c;
-}
-
-inline void ossimEndian::swap(ossimScalarType scalar,
-                              void* data, ossim_uint32 size) const
-{
-   switch (scalar)
-   {
-      case OSSIM_USHORT16:
-      case OSSIM_SSHORT16:
-      case  OSSIM_USHORT11:
-         swapTwoBytes(data, size);
-         return;
-         
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-         swapFourBytes(data, size);
-         return;
-         
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-         swapEightBytes(data, size);
-         break;
-         
-      default:
-         return;
-   }
-}
-
-inline void ossimEndian::swap(ossim_int16* data, ossim_uint32 size) const
-{
-   swapTwoBytes(data, size);
-}
-
-inline void ossimEndian::swap(ossim_uint16* data, ossim_uint32 size) const
-{
-   swapTwoBytes(data, size);
-}
-
-inline void ossimEndian::swap(ossim_int32* data, ossim_uint32 size) const
-{
-   swapFourBytes(data, size);
-}
-
-inline void ossimEndian::swap(ossim_uint32* data, ossim_uint32 size) const
-{
-   swapFourBytes(data, size);
-}
-
-inline void ossimEndian::swap(ossim_int64* data, ossim_uint32 size) const
-{
-   swapEightBytes(data, size);
-}
-
-inline void ossimEndian::swap(ossim_uint64* data, ossim_uint32 size) const
-{
-   swapEightBytes(data, size);
-}
-
-inline void ossimEndian::swap(ossim_float32* data, ossim_uint32 size) const
-{
-   swapFourBytes(data, size);
-}
-
-inline void ossimEndian::swap(ossim_float64* data, ossim_uint32 size) const
-{
-   swapEightBytes(data, size);
-}
-
-inline void ossimEndian::swapTwoBytes(void* data, ossim_uint32 size) const
-{
-   ossim_uint16* buf = reinterpret_cast<ossim_uint16*>(data);
-   for (ossim_uint32 i=0; i<size; ++i)
-   {
-      buf[i] = ((buf[i] & 0x00ff) << 8) | ((buf[i] & 0xff00) >> 8);
-   }
-}
-
-inline void ossimEndian::swapFourBytes(void* data, ossim_uint32 size) const
-{
-   ossim_uint32* buf = reinterpret_cast<ossim_uint32*>(data);
-   for (ossim_uint32 i=0; i<size; ++i)
-   {
-      buf[i]
-         = (  ((buf[i] & 0xff000000) >> 24)
-            | ((buf[i] & 0x00ff0000) >> 8)
-            | ((buf[i] & 0x0000ff00) << 8)
-            | ((buf[i] & 0x000000ff) << 24));
-   }
-}
-
-inline void ossimEndian::swapEightBytes(void* data, ossim_uint32 size) const
-{
-   ossim_uint64* buf = reinterpret_cast<ossim_uint64*>(data);
-   for (ossim_uint32 i=0; i<size; ++i)
-   {
-      buf[i]
-         = (  ((buf[i] & 0xff00000000000000ull) >> 56)
-            | ((buf[i] & 0x00ff000000000000ull) >> 40)
-            | ((buf[i] & 0x0000ff0000000000ull) >> 24)
-            | ((buf[i] & 0x000000ff00000000ull) >> 8)
-            | ((buf[i] & 0x00000000ff000000ull) << 8)
-            | ((buf[i] & 0x0000000000ff0000ull) << 24)
-            | ((buf[i] & 0x000000000000ff00ull) << 40)
-            | ((buf[i] & 0x00000000000000ffull) << 56));
-   }
-}
-
-#endif /* End of #ifndef ossimEndian_HEADER */
diff --git a/ossim/include/ossim/base/ossimEnvironmentUtility.h b/ossim/include/ossim/base/ossimEnvironmentUtility.h
deleted file mode 100644
index fd680d5..0000000
--- a/ossim/include/ossim/base/ossimEnvironmentUtility.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef ossimEnvironmentUtility_HEADER
-#define ossimEnvironmentUtility_HEADER
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-
-class OSSIM_DLL ossimEnvironmentUtility
-{
-public:
-   typedef std::vector<ossimFilename> FilenameListType;
-   
-   
-   static ossimEnvironmentUtility* instance();
-
-   ossimString getEnvironmentVariable(const ossimString& variable)const;
-
-   ossimFilename getUserDir()const;
-   ossimString   getUserName()const;
-   ossimFilename getUserOssimSupportDir()const;
-   ossimFilename getUserOssimPreferences()const;
-   ossimFilename getUserOssimPluginDir()const;
-   
-   ossimFilename getInstalledOssimSupportDir()const;
-   ossimFilename getInstalledOssimPluginDir()const;
-   ossimFilename getInstalledOssimPreferences()const;
-
-   /**
-    * @return The current working dir which is $(PWD) for unix $(CD) for
-    * windows.
-    */
-   ossimFilename getCurrentWorkingDir()const;
-
-   ossimFilename searchAllPaths(const ossimFilename& file)const;
-   
-   ossimFilename findPlugin(const ossimFilename& plugin)const;
-   ossimFilename findData(const ossimFilename& data)const;
-
-   void addDataSearchPath(const ossimFilename& path);
-   void addDataSearchPathToFront(const ossimFilename& path);
-   void addPluginSearchPath(const ossimFilename& path);
-   void addPluginSearchPathToFront(const ossimFilename& path);
- 
-   ossimEnvironmentUtility::FilenameListType& getPluginSearchPath();
-   const ossimEnvironmentUtility::FilenameListType& getPluginSearchPath()const;
-   ossimEnvironmentUtility::FilenameListType& getDataSearchPath();
-   const ossimEnvironmentUtility::FilenameListType& getDataSearchPath()const;
-   
-private:
-   static ossimEnvironmentUtility* theInstance;
-
-   ossimEnvironmentUtility::FilenameListType thePluginSearchPath;
-   ossimEnvironmentUtility::FilenameListType theDataSearchPath;
-
-   ossimEnvironmentUtility();
-   ossimEnvironmentUtility(const ossimEnvironmentUtility& obj);
-   const ossimEnvironmentUtility& operator=
-      (const ossimEnvironmentUtility& rhs);
-};
-
-
-#endif
diff --git a/ossim/include/ossim/base/ossimFactoryListInterface.h b/ossim/include/ossim/base/ossimFactoryListInterface.h
deleted file mode 100644
index 368638a..0000000
--- a/ossim/include/ossim/base/ossimFactoryListInterface.h
+++ /dev/null
@@ -1,266 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class declaration of ossimFactoryListInterface.
-//
-//**************************************************************************************************
-// $Id$
-#ifndef ossimFactoryListInterface_HEADER
-#define ossimFactoryListInterface_HEADER
-#include <OpenThreads/Mutex>
-#include <OpenThreads/ScopedLock>
-#include <vector>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-/**
- * The is a factory list interface that allows registries to be accessed in a common way.  
- */
-template <class T, class NativeType>
-class ossimFactoryListInterface
-   {
-   public:
-      typedef std::vector<T*> FactoryListType;
-      typedef T FactoryType;
-      typedef NativeType NativeReturnType;
-      
-      ossimFactoryListInterface(){}
-      
-      /**
-       * This is for backward compatability and calls registerFactory for simple adds.
-       */
-      void addFactory(T* factory)
-      {
-         registerFactory(factory);
-      }
-      
-      /**
-       * Public access method to determine if a factory is already registered to this
-       * list
-       */
-      bool isFactoryRegistered(T* factory)const
-      {
-         if(!factory) return false;
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-         
-         return findFactory(factory);
-      }
-      
-      /**
-       * Will register a factory to the factory list.  Will append the passed in factory if not
-       * already registered to the list.
-       */
-      void registerFactory(T* factory, bool pushToFrontFlag=false)
-      {
-         if(!factory) return;
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-         if(!findFactory(factory))
-         {
-            if (pushToFrontFlag)
-            {
-               m_factoryList.insert(m_factoryList.begin(), factory);
-            }
-            else
-            {
-               m_factoryList.push_back(factory);
-            }
-         }
-      }
-      /**
-       * Will remove the factory from the registry.
-       */
-      void unregisterFactory(T* factory)
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-         ossim_uint32 idx = 0;
-         for(idx = 0; idx < m_factoryList.size(); ++idx)
-         {
-            if(factory == m_factoryList[idx])
-            {
-               m_factoryList.erase(m_factoryList.begin() + idx);
-               return;
-            }
-         }
-      }
-      
-      /**
-       * Will remove all factories from the registry.
-       */
-      void unregisterAllFactories()
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-         m_factoryList.clear();
-      }
-      
-      /**
-       * Inserts the factory to the front of the list.
-       */
-      void registerFactoryToFront(T* factory)
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-         if(!findFactory(factory))
-         {
-            m_factoryList.insert(m_factoryList.begin(), factory);
-         }
-      }
-      
-      /**
-       * Will insert the factory before the beforeThisFactory.  If not found
-       * it will do a simple append.
-       */
-      void registerFactoryBefore(T* factory, T* beforeThisFactory)
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-         if(!findFactory(factory))
-         {
-            ossim_uint32 idx = 0;
-            for(idx = 0; idx < m_factoryList.size(); ++idx)
-            {
-               if(beforeThisFactory == m_factoryList[idx])
-               {
-                  m_factoryList.insert(m_factoryList.begin() + idx, factory);
-                  return;
-               }
-            }
-            m_factoryList.push_back(factory);
-         }
-      }
-      
-      /**
-       *
-       * Will add all object types the factories can allocate.  Typically a list of classnames are returned
-       *
-       */
-      void getAllTypeNamesFromRegistry(std::vector<ossimString>& typeList)const;
-      
-      /**
-       * This is the base object return for all objects in the system.  This is used for 
-       * backward compatability.
-       */
-      ossimObject* createObjectFromRegistry(const ossimString& typeName)const;
-      
-      /**
-       * This is the base object return for all objects in the system.  This is used for 
-       * backward compatability.
-       */
-      ossimObject* createObjectFromRegistry(const ossimKeywordlist& kwl,
-                                            const char* prefix=0)const;
-
-      /**
-       * This is a helper method that calls the createObject and makes sure that the
-       * returned object is of the NativeType base type this registry supports.
-       */
-      NativeType* createNativeObjectFromRegistry(const ossimString& typeName)const;
-      
-      /**
-       * This is a helper method that calls the createObject and makes sure that the
-       * returned object is of the NativeType base type this registry supports.
-       *
-       * @param kwl is a state keywordlist allowing one to instantiate an object 
-       *        defined by a set of name value pairs.  It will use the type 
-       *        keyword to create an object of the defined type and then load the 
-       *        state.
-       */
-      NativeType* createNativeObjectFromRegistry(const ossimKeywordlist& kwl,
-                                                 const char* prefix=0)const;
-   protected:
-      /**
-       * Utility to find a factory in the list
-       */
-      bool findFactory(T* factory)const
-      {
-         if(!factory) return false;
-         ossim_uint32 idx = 0;
-         for(;idx < m_factoryList.size();++idx)
-         {
-            if(m_factoryList[idx] == factory)
-            {
-               return true;
-            }
-         }
-         
-         return false;
-      }
-      mutable OpenThreads::Mutex m_factoryListMutex;
-      FactoryListType m_factoryList;
-   };
-
-template <class T, class NativeType>
-void ossimFactoryListInterface<T, NativeType>::getAllTypeNamesFromRegistry(std::vector<ossimString>& typeList)const
-{
-   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-   ossim_uint32 idx = 0;
-   for(; idx<m_factoryList.size(); ++idx)
-   {
-      m_factoryList[idx]->getTypeNameList(typeList);
-   }
-}
-template <class T, class NativeType>
-ossimObject* ossimFactoryListInterface<T, NativeType>::createObjectFromRegistry(const ossimString& typeName)const
-{
-   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-   ossimObject* result = 0;
-   ossim_uint32 idx = 0;
-   for(;((idx<m_factoryList.size())&&!result); ++idx)
-   {
-      result = m_factoryList[idx]->createObject(typeName);
-   }
-   return result;
-}
-
-template <class T, class NativeType>
-ossimObject* ossimFactoryListInterface<T, NativeType>::createObjectFromRegistry(const ossimKeywordlist& kwl,
-                                                                                const char* prefix)const
-{
-   // OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
-   ossimObject* result = 0;
-   ossim_uint32 idx = 0;
-   for(;((idx<m_factoryList.size())&&!result); ++idx)
-   {
-      result = m_factoryList[idx]->createObject(kwl, prefix);
-   }
-   return result;
-}
-
-template <class T, class NativeType>
-NativeType* ossimFactoryListInterface<T, NativeType>::createNativeObjectFromRegistry(const ossimString& typeName)const
-{
-   NativeType* result = 0;
-   ossimRefPtr<ossimObject> tempObject = createObjectFromRegistry(typeName);
-   if(tempObject.valid())
-   {
-      result = dynamic_cast<NativeType*>(tempObject.get());
-      if(result)
-      {
-         tempObject.release();
-      }
-   }
-   
-   return result;
-}
-
-template <class T, class NativeType>
-NativeType* ossimFactoryListInterface<T, NativeType>::createNativeObjectFromRegistry(const ossimKeywordlist& kwl,
-                                                                                     const char* prefix)const
-{
-   NativeType* result = 0;
-   ossimRefPtr<ossimObject> tempObject = createObjectFromRegistry(kwl, prefix);
-   if(tempObject.valid())
-   {
-      result = dynamic_cast<NativeType*>(tempObject.get());
-      if(result)
-      {
-         tempObject.release();
-      }
-   }
-   
-   return result;
-}
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimFileProcessorInterface.h b/ossim/include/ossim/base/ossimFileProcessorInterface.h
deleted file mode 100644
index 74d09ff..0000000
--- a/ossim/include/ossim/base/ossimFileProcessorInterface.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimFileProcessorInterface.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class interface ossimFileProcessorInterface.
-//
-// Has pure virtual "processFile" method that derived classes must
-// implement to be concrete. 
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimFileProcessorInterface_HEADER
-#define ossimFileProcessorInterface_HEADER 1
-
-class ossimFilename;
-
-/** @class ossimFileProcessorInterface */
-class ossimFileProcessorInterface
-{
-public:
-   
-   /** @brief default constructor */
-   ossimFileProcessorInterface(){}
-
-   /** @brief virtual destructor. */
-   virtual ~ossimFileProcessorInterface(){}
-
-   /**
-    * @brief Pure virtual processFile method. Derived classed must implement.
-    * @param file to process.
-    */
-   virtual void processFile(const ossimFilename& file) = 0;
-};
-
-#endif /* #ifndef ossimFileProcessorInterface_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimFilename.h b/ossim/include/ossim/base/ossimFilename.h
deleted file mode 100644
index a39a4f1..0000000
--- a/ossim/include/ossim/base/ossimFilename.h
+++ /dev/null
@@ -1,265 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//
-// Description: This class provides manipulation of filenames.
-//
-//*************************************************************************
-// $Id: ossimFilename.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimFilename_HEADER
-#define ossimFilename_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-
-class ossimLocalTm;
-
-class OSSIM_DLL ossimFilename : public ossimString
-{
-public:
-   enum AccessModes
-   {
-      OSSIM_READ_WRITE = 6,
-      OSSIM_READ       = 4,
-      OSSIM_WRITE      = 2,
-      OSSIM_EXE	       = 1, // The PC docs say that this is ignored
-      OSSIM_EXIST      = 0
-   };
-   ossimFilename();
-   ossimFilename(const ossimFilename& src);
-   ossimFilename(const ossimString& src);
-   ossimFilename(const std::string& src);
-   ossimFilename(const char* src);
-
-   template <class Iter> ossimFilename(Iter s, Iter e);
-
-   static const ossimFilename NIL;
-
-   bool operator == (const ossimFilename& rhs)const;
-   
-   bool operator == (const ossimString& rhs)const;
-   bool operator == (const char* rhs)const;
-
-   /** @brief Writes f to the output stream os. */
-//    friend std::ostream& operator<<(std::ostream& os,
-   //                                const ossimFilename& s);
-   
-   void convertBackToForwardSlashes();
-   void convertForwardToBackSlashes();
-
-   bool setTimes(ossimLocalTm* accessTime,
-                 ossimLocalTm* modTime,
-                 ossimLocalTm* createTime)const;
-   bool getTimes(ossimLocalTm* accessTime,
-                 ossimLocalTm* modTime,
-                 ossimLocalTm* createTime)const;
-   
-   bool touch()const;
-   
-   /**
-    * Method to do file name expansion.
-    *
-    * Like: ~/docs will be expanded to /home/user/docs
-    *
-    * @return The expanded file name.
-    *
-    * @note METHOD IS NOT COMPLETE YET.
-    */
-   ossimFilename expand() const;
-   
-   // Methods to test ossimFilename for various states.
-   bool        exists()       const;
-   bool        isFile()       const;
-   bool        isDir()        const;
-   bool        isReadable()   const;
-   bool        isWriteable()  const;
-   bool        isExecutable() const;
-   ossim_int64 fileSize()     const;
-   
-   // Methods to access parts of the ossimFilename.
-
-   /**
-    * @return "tif" if file is "/data/images/t1.tif".
-    *
-    * @note The '.' (dot) is not returned.
-    */
-   ossimString   ext() const;
-
-   /**
-    * @return @return "/data/images" if file is "/data/images/t1.tif".
-    */
-   ossimFilename path() const;
-
-   /**
-    * @return @return "c:" if file is "c:\data\images\t1.tif".
-    */
-   ossimFilename drive() const;
-   
-   /**
-    * @return @return "t1.tif" if file is "/data/images/t1.tif".
-    */
-   ossimFilename file() const;
-
-   /**
-    * @return @return "t1" if file is "/data/images/t1.tif".
-    */
-   ossimFilename fileNoExtension() const;
-
-   /**
-    * @return @return "/data/images/t1" if file is "/data/images/t1.tif".
-    *
-    * @note  The '.' (dot) is not returned.
-    */
-   ossimFilename noExtension() const;
-
-   /**
-    * Sets the extension of a file name.
-    *
-    * Given:
-    * ossimFilename f = "foo";
-    * f.setExtension("tif");
-    * f now equals "foo.tif"
-    *
-    * Given: 
-    * ossimFilename f = "foo.jpg";
-    * f.setExtension("tif");
-    * f now equals "foo.tif"
-    * 
-    * Given: 
-    * ossimFilename f = "foo.jpg";
-    * f.setExtension(".tif");
-    * f now equals "foo.tif"
-    *
-    * Given: 
-    * ossimFilename f = "foo.";
-    * ossimFilename f2;
-    * f2 = f.setExtension("tif");
-    * f now equals "foo.tif"
-    * f2 now equals "foo.tif"
-    *
-    * @param e Extension to add or replace.
-    *
-    * @returns a reference to this.
-    */
-   ossimFilename& setExtension(const ossimString& e);
-
-   /**
-	* Sets the file path and drive.
-	* Input: the drive to be set (this should come from the user's preferences)
-	* Example: "x:"
-	* Given: "/filepath/file.ext"
-    * @return @return "c:\filepath\file.ext".
-    */
-   ossimFilename& setDrive(const ossimString& d);
-   ossimFilename& setPath(const ossimString& p);
-   ossimFilename& setFile(const ossimString& f);
-   
-   void split(ossimString& drivePart,
-              ossimString& pathPart,
-              ossimString& filePart,
-              ossimString& extPart)const;
-   
-   void merge(const ossimString& drivePart,
-              const ossimString& pathPart,
-              const ossimString& filePart,
-              const ossimString& extPart);
-   /*!
-    * Returns file appended onto this string. Path seperator is always placed
-    * between this and file.  Returns file if this string is empty.
-    * Given: this = /foo  and file  = bar output  = /foo/bar
-    * Given: this = /foo/ and file  = bar output  = /foo/bar
-    */
-   ossimFilename dirCat(const ossimFilename& file) const;
-
-   /*!
-    */
-   bool createDirectory(bool recurseFlag=true,
-                        int perm=0775)const;
-
-   /*!
-    * @brief Removes pathname from filesystem if supported by platform.
-    *
-    * If pathname is a directory it will only be removed if empty. If supported
-    * will set errno and output equivalent string if one occurs.
-    *
-    * @return true on success, false on error.
-    */
-   static bool remove(const ossimFilename& pathname);
-
-   /**
-    * Will use a wildcard remove.  NOTE:  This is in
-    * a regular expression format so if you want all
-    * files with prefix myfile to be erased then you would give
-    * it <path>/myfile.*
-    *
-    * The . here is a regular expression '.' character which says any character
-    * and the * "is any number of"
-    * 
-    */ 
-   static bool wildcardRemove(const ossimFilename& pathname);
-
-   bool rename(const ossimFilename& destFile, bool overwriteDestinationFlag=true)const;
-   
-   bool remove()const;
-   bool wildcardRemove()const;
-
-   /**
-    * @brief Copies this file to output file.
-    *
-    * Copies this to output file. If output file is a directory, this->file() is
-    * appended to output file.
-    * 
-    * @param outputFile File name to copy to.
-    * 
-    * @return True on success, false on error.
-    */
-   bool copyFileTo(const ossimFilename& ouputFile) const;
-
-   /**
-    * @brief Checks whether file name is relative or absolute.
-    * 
-    * @return true if file name has a relative path, false if absolute.
-    *
-    * @note This will return true if file name is empty.
-    */
-   bool isRelative() const;
-   
-   /**
-    * @brief Method to check if expansion is needed.
-    *
-    * This checks if file isRelative() first if isRelative is false (has
-    * absolute path) it then walks the file and looks for '$'.
-    * 
-    * @return true if file name is relative or has environment vars.
-    *
-    * @note This will return false if file name is empty.
-    */
-   bool needsExpansion() const;
-
-   /** @return The path separator. */
-   char getPathSeparator() const;
-   
-protected:
-
-   void convertToNative();
-
-   /*!
-    * since windows uses \ for path separation
-    * and unix / we need to be consistent.
-    */
-   static const char thePathSeparator;
-
-};
-
-// inline std::ostream& operator<<(std::ostream& os, const ossimFilename& f)
-// {
-//   return os << f.string().c_str();
-// }
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimGeoTiffDatumLut.h b/ossim/include/ossim/base/ossimGeoTiffDatumLut.h
deleted file mode 100644
index d8dc61d..0000000
--- a/ossim/include/ossim/base/ossimGeoTiffDatumLut.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for GeoTiffDatumLut. Used to map a
-// geotiff coordinate transformation code to an ossim projection.
-//*******************************************************************
-//  $Id: ossimGeoTiffDatumLut.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimGeoTiffDatumLut_HEADER
-#define ossimGeoTiffDatumLut_HEADER
-
-#include <ossim/base/ossimLookUpTable.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-class OSSIMDLLEXPORT ossimGeoTiffDatumLut : public ossimLookUpTable
-{
-public:
-
-   enum
-   {
-      //---
-      // Datum codes cut from geotiff specification section 6.3.2.1.
-      //---
-      GCS_Adindan                     = 4201,
-      GCS_Arc_1950                    = 4209,
-      GCS_Arc_1960                    = 4210,
-      GCS_ED50                        = 4230,
-      GCS_NAD27                       = 4267,
-      GCS_NAD83                       = 4269,
-      GCS_OSGB_1936                   = 4277,
-      GCS_WGS_72                      = 4322,
-      GCS_WGS_84                      = 4326,
-      GCS_Tokyo                       = 4301,
-      GCS_NAD83_HARN                  = 4152,
-
-      //---
-      // Datum codes cut from geotiff specification section 6.3.2.1.
-      // NOTE:  These codes imply an ellipsoid only!
-      //---
-      GCS_Clark_1866                  = 4008,
-      
-      //---
-      // Datum codes cut from geotiff specification section 6.3.2.2.
-      //---
-      DatumE_WGS84                    = 6030,
-      Datum_Adindan                   = 6201,
-      Datum_Arc_1950                  = 6209,
-      Datum_Arc_1960                  = 6210,
-      Datum_European_Datum_1950       = 6230,
-      Datum_North_American_Datum_1927 = 6267,
-      Datum_North_American_Datum_1983 = 6269,
-      Datum_OSGB_1936                 = 6277,
-      Datum_Tokyo                     = 6301,
-      Datum_WGS72                     = 6322,
-      Datum_WGS84                     = 6326,
-      Datum_NAD83_HARN                = 6152
-   };
-   
-   ossimGeoTiffDatumLut();
-
-   virtual ~ossimGeoTiffDatumLut();
-   
-   virtual ossimKeyword getKeyword() const;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimGeoidEgm96.h b/ossim/include/ossim/base/ossimGeoidEgm96.h
deleted file mode 100644
index c5a42ac..0000000
--- a/ossim/include/ossim/base/ossimGeoidEgm96.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//*******************************************************************
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimGeoidEgm96 which is
-// "Earth Gravity Model 1996".
-//
-//*******************************************************************
-//  $Id: ossimGeoidEgm96.h 22900 2014-09-30 09:56:11Z dburken $
-
-#ifndef ossimGeoidEgm96_HEADER
-#define ossimGeoidEgm96_HEADER
-
-#include <ossim/base/ossimGeoid.h>
-#include <vector>
-
-#define GEOID_NO_ERROR              0x0000
-#define GEOID_FILE_OPEN_ERROR       0x0001
-#define GEOID_INITIALIZE_ERROR      0x0002
-#define GEOID_NOT_INITIALIZED_ERROR 0x0004
-#define GEOID_LAT_ERROR             0x0008
-#define GEOID_LON_ERROR             0x0010
-
-class ossimGpt;
-
-class OSSIMDLLEXPORT ossimGeoidEgm96 : public ossimGeoid
-{
-
-public:
-   ossimGeoidEgm96();
-   ossimGeoidEgm96(const ossimFilename& grid_file,
-                   ossimByteOrder byteOrder=OSSIM_BIG_ENDIAN);
-   
-   virtual ~ossimGeoidEgm96();
-
-   virtual bool open(const ossimFilename& grid_file,
-                     ossimByteOrder byteOrder=OSSIM_BIG_ENDIAN);
-
-   virtual ossimString getShortName()const;
-   
-   /**
-    *  @return The offset from the ellipsoid to the geoid or ossim::nan()
-    *  (IEEE NAN) if grid does not contain the point.
-    */
-   virtual double offsetFromEllipsoid(const ossimGpt& gpt);
-
-   double geoidToEllipsoidHeight(double lat,
-                                 double lon,
-                                 double geoidHeight);
-   
-   double ellipsoidToGeoidHeight(double lat,
-                           double lon,
-                           double ellipsoidHeight);
-
-protected:
-
-   std::vector<float> theGeoidHeightBuffer;
-   mutable float* theGeoidHeightBufferPtr;
-   TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimGeoidImage.h b/ossim/include/ossim/base/ossimGeoidImage.h
deleted file mode 100644
index ef8d928..0000000
--- a/ossim/include/ossim/base/ossimGeoidImage.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Generic geoid source which uses an image handler for reading the grid.
-// 
-//----------------------------------------------------------------------------
-#ifndef ossimGeoidImage_HEADER
-#define ossimGeoidImage_HEADER 1
-   
-#include <ossim/base/ossimGeoid.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-
-class ossimFilename;
-
-/**
- * @class ossimGeoidImage
- *
- * Generic geoid source which uses a image handler for reading the grid.
- *
- * The settable keyword "geoid.type", e.g. "egm2008" is used to attach a given geoid
- * to an elevation source.
- *
- * The keyword "type" is fixed for this object as "geoid_image".
- */
-class OSSIM_DLL ossimGeoidImage : public ossimGeoid
-{
-
-public:
-   
-   /** @brief default constructor */
-   ossimGeoidImage();
-
-   /** @brief destructor */
-   virtual ~ossimGeoidImage();
-
-   /**
-    * @brief open method
-    * @param file This can be any image that ossim can open and get geometry
-    * info for.
-    * @param byteOrder Not used by this object.
-    * @return true on success, false on erro.
-    */
-   virtual bool open( const ossimFilename& file,
-                      ossimByteOrder byteOrder=OSSIM_BIG_ENDIAN );
-
-   /**
-    * @return The short name which represents the "geoid.type" keyword which is
-    * used by ossimGeoidFactory.
-    */
-   virtual ossimString getShortName() const;
-   
-   /** @brief Sets the geoid type name string. */
-   void setShortName( const std::string& geoidTypeName );
-
-   /**
-    * @brief Gets the memory map flag.
-    * @return true if geoid image is memory mapped; else, false.
-    */
-   bool getMemoryMapFlag() const;
-
-   /**
-    * @brief Set the memory map flag.
-    */
-   void setMemoryMapFlag( bool flag );
-   
-   /**
-    * Method to save the state of the object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-   
-   /**
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   /**
-    *  @return The offset from the ellipsoid to the geoid or ossim::nan()
-    *  (IEEE NAN) if grid does not contain the point.
-    */
-   virtual double offsetFromEllipsoid(const ossimGpt& gpt);
-
-   bool getEnableFlag() const;
-
-   void setEnableFlag(bool flag);
-
-protected:
-
-   template <class T>
-   double offsetFromEllipsoidTemplate(T dummy, const ossimGpt& gpt);
-
-   ossimRefPtr<ossimImageGeometry> m_geom;
-   ossimRefPtr<ossimImageHandler>  m_handler;
-   ossimRefPtr<ossimImageData>     m_cacheTile;
-   std::string                     m_connectionString;
-   ossimString                     m_geoidTypeName;
-   bool                            m_memoryMapFlag;
-   bool                            m_enabledFlag;
-   ossimIrect                      m_imageRect;
-   ossimScalarType                 m_scalarType;
-};
-
-#endif /* #define ossimGeoidImage_HEADER 1 */
-
diff --git a/ossim/include/ossim/base/ossimGeoidManager.h b/ossim/include/ossim/base/ossimGeoidManager.h
deleted file mode 100644
index f8a4ed0..0000000
--- a/ossim/include/ossim/base/ossimGeoidManager.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimGeoidManager. Maintains
-//   a list of geoids.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimGeoidManager.h 22900 2014-09-30 09:56:11Z dburken $
-
-#ifndef ossimGeoidManager_HEADER
-#define ossimGeoidManager_HEADER
-
-#include <vector>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimGeoid.h>
-/*****************************************************************************
- *
- * CLASS: ossimGeoidManager 
- *
- *****************************************************************************/
-class OSSIMDLLEXPORT ossimGeoidManager : public ossimGeoid
-{
-public:
-
-
-   virtual ~ossimGeoidManager();
-      
-   /**
-    * Implements singelton pattern:
-    */
-   static ossimGeoidManager* instance();
-
-   
-   /**
-    * Permits initialization of geoids from directory name. Should never be
-    * called since called on specific geoid types:
-    */
-   virtual bool open(const ossimFilename& dir, ossimByteOrder byteOrder);
-
-   /**
-    *  @return The offset from the ellipsoid to the geoid or ossim::nan()
-    *  if grid does not contain the point.
-    */
-   virtual double offsetFromEllipsoid(const ossimGpt& gpt);
-
-   /**
-    * Method to save the state of the object to a keyword list.
-    * Return true if ok or false on error. DO NOTHING
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-
-   /**
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * Permits adding additional geoids to the list: 
-    */
-   virtual void addGeoid(ossimRefPtr<ossimGeoid> geoid, bool toFrontFlag=false);
-
-   ossimGeoid* findGeoidByShortName(const ossimString& shortName, bool caseSensitive=true);
-private:
-   /**
-    *  Private constructor.  Use "instance" method.
-    */
-   ossimGeoidManager();
-
-   //static ossimGeoidManager* theInstance;
-   mutable std::vector< ossimRefPtr<ossimGeoid> > theGeoidList;
-   
-   // will use this as a identity if one wants but don't want it part of the internal list
-   //
-   ossimRefPtr<ossimGeoid> theIdentityGeoid;
-   
-   TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimGrect.h b/ossim/include/ossim/base/ossimGrect.h
deleted file mode 100644
index fea60f7..0000000
--- a/ossim/include/ossim/base/ossimGrect.h
+++ /dev/null
@@ -1,311 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimGrect.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimGrect_HEADER
-#define ossimGrect_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDatumFactory.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimCommon.h>
-
-#include <vector>
-#include <iostream>
-
-class OSSIM_DLL ossimGrect
-{
-public:
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& os, const ossimGrect& rect);
-
-   /**
-    * Will default to 0,0,0,0.
-    */
-    ossimGrect()
-      :
-         theUlCorner(0.0, 0.0, 0.0),
-         theLrCorner(0.0, 0.0, 0.0)
-      {}
-
-   /**
-    * Copies the passed in rectangle to this
-    * object.
-    */
-   ossimGrect(const ossimGrect& rect)
-      :
-         theUlCorner(rect.ul()),
-         theLrCorner(rect.lr())
-      {}
-
-   /**
-    * WIll take two ground points and fill the
-    * bounding rect appropriately.
-    */
-   ossimGrect(const ossimGpt& p1, const ossimGpt& p2);
-
-   /**
-    * Takes the upper left and lower right ground
-    * points
-    */
-   ossimGrect(double ulLat,
-              double ulLon,
-              double lrLat,
-              double lrLon,
-              const ossimDatum* aDatum=ossimDatumFactory::instance()->wgs84())
-      : 
-         theUlCorner(ulLat, ulLon,0, aDatum),
-         theLrCorner(lrLat, lrLon, 0, aDatum)
-      {}
-   ossimGrect(const ossimGpt& point,
-              double latSpacingInDegrees,
-              double lonSpacingInDegrees)
-      :
-         theUlCorner(point),
-         theLrCorner(point)
-      {
-         std::vector<ossimGrect> v;
-         computeEvenTiles(v, latSpacingInDegrees, lonSpacingInDegrees);
-         if(v.size())
-            *this = v[0];
-      }
-   ossimGrect(std::vector<ossimGpt>& points);
-   ossimGrect(const ossimGpt& p1,
-              const ossimGpt& p2,
-              const ossimGpt& p3,
-              const ossimGpt& p4);
-              
-
-   const ossimGrect& operator=(const ossimGrect& rect)
-      {
-         theUlCorner = rect.ul();
-         theLrCorner = rect.lr();
-         return *this;
-      }
-
-   inline ossimGpt midPoint()const;
-   
-   /** Returns the height of a rectangle in deg. */
-   inline ossim_float64 height() const;
-
-   /** Returns the width of a rectangle in deg. */
-   inline ossim_float64 width()  const;
-   
-   /** Returns the height of a rectangle in meters. */
-   ossim_float64 heightMeters() const;
-
-   /** Returns the width of a rectangle in meters using the center lat for scaling EW direction. */
-   ossim_float64 widthMeters()  const;
-
-   inline const ossimGpt& ul()const;
-   inline const ossimGpt& lr()const;
-   inline ossimGpt ur() const;
-   inline ossimGpt ll() const;
-
-   inline ossimGpt& ul();
-   inline ossimGpt& lr();
-	
-   inline void makeNan();
-   
-   inline bool isLonLatNan()const;
-	
-   inline bool hasNans()const;
-   
-   inline bool isNan()const;
-   
-   /*!
-    * Returns true if "this" rectangle is contained completely within the
-    * input rectangle "rect".
-    */
-   bool completely_within(const ossimGrect& rect) const;
-	
-   /*!
-    * Returns true if any portion of an input rectangle "rect" intersects
-    * "this" rectangle.  
-    */
-   bool intersects(const ossimGrect& rect) const;
-
-   inline ossimGrect clipToRect(const ossimGrect& rect)const;
-
-   inline ossimGrect combine(const ossimGrect& rect)const;
-
-   /**
-    * Expands existing rect to accomodate argument point. If this object contains NaNs
-    * (uninitialized), then the rect is set to 0-area with the arg point as both UL and LR --
-    * convenient for establishing bounds in a loop over collection of points. This method does not
-    * consider height.
-    * @param gpt Argument point.
-    */
-   void expandToInclude(const ossimGpt& gpt);
-   void expandToInclude(const ossimGrect& rect);
-
-   /**
-    * METHOD: pointWithin(ossimGpt)
-    *
-    * @param gpt Point to test for withinness.
-    * @param considerHgt true if the height is to be compared to be between ul.hgt and lr.hgt
-    * @return true if argument is inside rectangle (or cuboid when hgt considered)
-    *
-    * @note There is no datum shift applied if
-    * gpt is of a different datum than this datum.
-    */
-   inline bool pointWithin(const ossimGpt& gpt, bool considerHgt=false) const; //inline below
-
-   ossimGrect stretchToEvenBoundary(double latSpacingInDegrees,
-                                    double lonSpacingInDegrees)const;
-   
-   void computeEvenTiles(std::vector<ossimGrect>& result,
-                         double latSpacingInDegrees,
-                         double lonSpacingInDegrees,
-                         bool clipToGeographicBounds = true)const;
-private:
-   ossimGpt theUlCorner; // Contains max height as well
-   ossimGpt theLrCorner; // Contains min height as well
-  
-};
-
-//==================== BEGIN INLINE DEFINITIONS ===============================
-
-//*****************************************************************************
-//  INLINE METHOD: ossimGrect::midPoint()
-//*****************************************************************************
-inline ossimGpt ossimGrect::midPoint()const
-{
-   return ossimGpt((ul().latd() + ur().latd() + ll().latd() + lr().latd())*.25,
-                   (ul().lond() + ur().lond() + ll().lond() + lr().lond())*.25,
-                   (ul().height()+ur().height()+ll().height()+
-                    lr().height())*.25,
-                   ul().datum() );
-}
-
-//*****************************************************************************
-//  INLINE METHOD: ossimGrect::clipToRect()
-//*****************************************************************************
-inline ossimGrect ossimGrect::clipToRect(const ossimGrect& rect)const
-{
-    double     ulx, uly, lrx, lry;
-
-    ulx = ossim::max<ossim_float64>(rect.ul().lond(),ul().lond());
-    uly = ossim::min<ossim_float64>(rect.ul().latd(),ul().latd());
-    lrx = ossim::min<ossim_float64>(rect.lr().lond(),lr().lond());
-    lry = ossim::max<ossim_float64>(rect.lr().latd(),lr().latd());
-
-    if( lrx < ulx || lry > uly )
-    {
-       return ossimGrect(ossimGpt(0,0,0),ossimGpt(0,0,0));
-    }
-    else
-    {
-       return ossimGrect(ossimGpt(uly, ulx, 0, rect.ul().datum()),
-                         ossimGpt(lry, lrx, 0, rect.ul().datum()));
-    }
-}
-
-//*******************************************************************
-// Inline Method: ossimDrect::combine(const ossimDrect& rect)
-//*******************************************************************
-inline ossimGrect ossimGrect::combine(const ossimGrect& rect)const
-{
-   if (isLonLatNan())
-      return rect;
-
-   ossimGpt ulCombine;
-   ossimGpt lrCombine;
-	
-	ulCombine.lon = ((ul().lon <= rect.ul().lon)?ul().lon:rect.ul().lon);
-   ulCombine.lat = ((ul().lat >= rect.ul().lat)?ul().lat:rect.ul().lat);
-   lrCombine.lon = ((lr().lon >= rect.lr().lon)?lr().lon:rect.lr().lon);
-   lrCombine.lat = ((lr().lat <= rect.lr().lat)?lr().lat:rect.lr().lat);
-	
-   return ossimGrect(ulCombine, lrCombine);
-}
-
-//*****************************************************************************
-//  INLINE METHOD: ossimGrect::pointWithin()
-//*****************************************************************************
-inline bool ossimGrect::pointWithin(const ossimGpt& gpt, bool considerHgt) const
-{
-   bool within = (gpt.lat <= theUlCorner.lat) && (gpt.lat >= theLrCorner.lat) &&
-                 (gpt.lon >= theUlCorner.lon) && (gpt.lon <= theLrCorner.lon);
-   if (considerHgt)
-      within &= (gpt.hgt <= theUlCorner.hgt) && (gpt.hgt >= theLrCorner.hgt);
-
-   return within;
-}
-
-inline ossim_float64 ossimGrect::height() const
-{
-   return (theUlCorner.latd() - theLrCorner.latd());
-}
-
-inline ossim_float64 ossimGrect::width() const
-{
-   return (theLrCorner.lond() - theUlCorner.lond());
-}
-
-inline const ossimGpt& ossimGrect::ul() const
-{
-   return theUlCorner;
-}
-
-inline ossimGpt ossimGrect::ur() const
-{
-   ossimGpt gpt (theUlCorner.lat, theLrCorner.lon, theUlCorner.hgt, theUlCorner.datum());
-   return gpt;
-}
-
-inline ossimGpt ossimGrect::ll() const
-{
-   ossimGpt gpt (theLrCorner.lat, theUlCorner.lon, theLrCorner.hgt, theLrCorner.datum());
-   return gpt;
-}
-
-inline const ossimGpt& ossimGrect::lr() const
-{
-   return theLrCorner;
-}
-   
-inline ossimGpt& ossimGrect::ul()
-{
-   return theUlCorner;
-}
-
-inline ossimGpt& ossimGrect::lr()
-{
-   return theLrCorner;
-}
-	
-inline void ossimGrect::makeNan()
-{
-   theUlCorner.makeNan();
-   theLrCorner.makeNan();
-}
-
-inline bool ossimGrect::isLonLatNan() const
-{
-   return ( ossim::isnan(theUlCorner.lat) ||
-            ossim::isnan(theUlCorner.lon) ||
-            ossim::isnan(theLrCorner.lat) ||
-            ossim::isnan(theLrCorner.lon) );
-}
-
-inline bool ossimGrect::hasNans() const
-{
-   return ( theUlCorner.hasNans() ||
-            theLrCorner.hasNans() );
-}
-
-inline bool ossimGrect::isNan()const
-{
-   return ( theUlCorner.hasNans() &&
-            theLrCorner.hasNans() );
-}
-
-#endif /* End of "#ifndef ossimGrect_HEADER" */
-
diff --git a/ossim/include/ossim/base/ossimHistogram.h b/ossim/include/ossim/base/ossimHistogram.h
deleted file mode 100644
index 4247ac6..0000000
--- a/ossim/include/ossim/base/ossimHistogram.h
+++ /dev/null
@@ -1,202 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Ken Melero 
-//         Orginally developed by:
-//                   Copyright (c) 1997 TargetJr Consortium
-//               GE Corporate Research and Development (GE CRD)
-//                             1 Research Circle
-//                            Niskayuna, NY 12309
-//         Adapted from:  IUE v4.1.2
-// Description: 
-//      A Histogram contains an array of "buckets", which represent finite
-// segments of some value axis, along with a corresponding array of
-// frequency counts for each of these buckets.
-//
-//********************************************************************
-// $Id: ossimHistogram.h 19799 2011-06-30 18:41:26Z gpotts $
-//
-
-#ifndef ossimHistogram_HEADER
-#define ossimHistogram_HEADER
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimXmlNode.h>
-class OSSIMDLLEXPORT ossimHistogram : public ossimObject
-{
-  private:
-
-    mutable int stats_consistent; // A 2 bit state flag  Mean =1 | StandDev = 2
-
-  protected:
-
-   
-   virtual void deleteAll();
-   
-    float * vals;            // histogram x array
-                             // (value = midpoint of each bucket)
-    float * counts;          // histogram y array ie. count[i] is
-                             // the number of pixels with value within range
-                             // of bucket i
-
-    int num;                 // number of indices
-
-    float delta;             // "Width" of each bucket on value axis
-    float vmin, vmax;        // Maximum and minimum values on plot
-    mutable float mean;               // Mean value of the distribution
-    mutable float standard_dev;       // 
-  protected:
-
-
-   class ossimProprietaryHeaderInformation
-   {
-   public:
-      ossimProprietaryHeaderInformation(){clear();}
-
-      bool parseStream(istream& in);
-
-      long getNumberOfBins()
-         {
-            return theNumberOfBins.toLong();
-         }
-      void clear()
-         {
-            theFileType      = "";
-            theVersion       = "";
-            theMapperType    = "";
-            theNumberOfBins  = "";
-         }
-      ossimString theFileType;
-      ossimString theVersion;
-      ossimString theMapperType;
-      ossimString theNumberOfBins;
-   };
-   
-  public:
-   enum FillAlgorithmType
-   {
-      HISTOGRAM_FILL_DEFAULT    = 0,
-      HISTOGRAM_FILL_THIN_PLATE = 1
-   };
-// Constructors
-    ossimHistogram();
-    ossimHistogram(int xres, float min, float max);
-    ossimHistogram(float*, float*, int);
-    ossimHistogram(const ossimHistogram& his); // Copy constructor
-    ossimHistogram(const ossimHistogram*, float width); // Resampling constructor
-
-    virtual int GetIndex(float)const;
-// Other histogram formation operations    
-   ossimHistogram* fillInteriorEmptyBins(int type=HISTOGRAM_FILL_THIN_PLATE)const;
-    ossimHistogram* Scale(float scale_factor); // Scale Transformation
-    ossimHistogram* CumulativeGreaterThanEqual()const;// From density to cumulative
-    ossimHistogram* CumulativeLessThanEqual()const;// From density to cumulative
-    //Suppress non-peak values.
-   ossimHistogram* NonMaximumSupress(int radius = 1, bool cyclic = false);
-   void create(int xres, float val1, float val2);
-  
-// Attribute accessors
-    void UpCount(float newval);
-    float GetCount(float uval)const;
-    float SetCount(float pixelval, float count);
-
-    float GetMinVal()const;
-    float GetMaxVal()const;
-    float GetMaxCount()const;
-
-    float GetRangeMin()const
-    {
-       return vmin;
-    }
-    float GetRangeMax()const
-    {
-       return vmax;
-    }
-    float * GetVals()
-    {
-	stats_consistent = 0; // Values might change.
-	return vals; 
-    }
-    const float * GetVals()const
-    {
-	stats_consistent = 0; // Values might change.
-	return vals; 
-    }
-
-    float * GetCounts()
-    { 
-	stats_consistent = 0; // Counts might change.
-	return counts; 
-    }
-
-   const float * GetCounts()const
-    { 
-	stats_consistent = 0; // Counts might change.
-	return counts; 
-    }
-
-    int GetRes()const
-    { return num; }
-
-    float GetBucketSize()const { return delta; }
-
-    float * GetMinValAddr()
-    { return vals+GetIndex(GetMinVal());  }
-
-    float * GetMinCountAddr()
-    { return counts+GetIndex(GetMinVal());  }
-
-   const float * GetMinValAddr()const
-    { return vals+GetIndex(GetMinVal());  }
-
-    const float * GetMinCountAddr()const
-    { return counts+GetIndex(GetMinVal());  }
-
-    float ComputeArea(float low, float high)const;// bounded area
-    float ComputeArea()const;//total area
-
-    /*!
-     * Returns the fraction of accumulation up to and including "val" bucket
-     * from min divided by the total accumulation.
-     * returns OSSIM_FLT_NAN if "val" is not between GetMinVal and GetMaxVal.
-     */
-    float getLowFractionFromValue(float val) const;
-    
-    /*!
-     * Returns the fraction of accumulation down to and including "val" bucket
-     * from max divided by the total accumulation.
-     * returns OSSIM_FLT_NAN if "val" is not between GetMin() and GetMax().
-     */
-    float getHighFractionFromValue(float val) const;
-    
-    //Find bounds that clip off a given percent of the area
-    float LowClipVal(float clip_fraction)const;
-    float HighClipVal(float clip_fraction)const;
-
-    int GetValIndex(float val)const;
-
-    float GetMean()const;
-    float GetStandardDev()const;
-
-    void Print()const;
-    void Dump(char *)const;
-    int  WritePlot(const char* fname)const;
-   virtual ~ossimHistogram();
-
-
-   virtual bool importHistogram(const ossimFilename& inputFile);
-   virtual bool importHistogram(istream& in);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual bool saveState(ossimRefPtr<ossimXmlNode> xmlNode)const;
-   virtual bool loadState(const ossimRefPtr<ossimXmlNode> xmlNode);
-TYPE_DATA   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimHistogramSource.h b/ossim/include/ossim/base/ossimHistogramSource.h
deleted file mode 100644
index c5acc45..0000000
--- a/ossim/include/ossim/base/ossimHistogramSource.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHistogramSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimHistogramSource_HEADER
-#define ossimHistogramSource_HEADER
-
-#include <ossim/base/ossimSource.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-
-class OSSIM_DLL ossimHistogramSource : public ossimSource
-{
-public:
-   
-   virtual ~ossimHistogramSource();
-   
-   virtual ossimRefPtr<ossimMultiResLevelHistogram> getHistogram();
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-protected:
-   ossimHistogramSource(ossimObject* owner=NULL,
-                        ossim_uint32 numberOfInputs=0,
-                        ossim_uint32 numberOfOutputs=0,
-                        bool inputListFixedFlag=true,
-                        bool outputListFixedFlag=true);
-   
-   ossimRefPtr<ossimMultiResLevelHistogram> theHistogram;
-   
-   /*!
-    * if the filename is not "" then it will use
-    * this to store the histogram outside the keywordlist.
-    *
-    * it will set the filename keyword to the filename and
-    * during a save state will save it out to the file
-    * instead of inline to the keyword list.
-    */
-   ossimFilename                theFilename;
-   
-private:
-   /** Hidden from use copy constructor. */
-   ossimHistogramSource(const ossimHistogramSource&);
-
-TYPE_DATA
-};
-
-#endif /* End of "#ifndef ossimHistogramSource_HEADER" */
-
diff --git a/ossim/include/ossim/base/ossimHttpResponse.h b/ossim/include/ossim/base/ossimHttpResponse.h
deleted file mode 100644
index 1cad97e..0000000
--- a/ossim/include/ossim/base/ossimHttpResponse.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file
-//
-// Author: Garrett Potts
-//
-// Description: This is an initial cut at an http response object.  The HttpResponse is
-//              returned from the HttpRequest base object.
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimHttpResponse_HEADER
-#define ossimHttpResponse_HEADER
-
-#include <iostream>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimByteStreamBuffer.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimWebResponse.h>
-
-class OSSIM_DLL ossimHttpResponse : public ossimWebResponse
-{
-public:
-   ossimHttpResponse()
-   :m_headerStream(&m_headerBuffer),
-   m_bodyStream(&m_bodyBuffer)
-   {
-      clear();
-   }
-   
-   ossimByteStreamBuffer& headerBuffer(){return m_headerBuffer;}
-   const ossimByteStreamBuffer& headerBuffer()const{return m_headerBuffer;}
-   ossimByteStreamBuffer& bodyBuffer(){return m_bodyBuffer;}
-   const ossimByteStreamBuffer& bodyBuffer()const{return m_bodyBuffer;}
-   
-   std::iostream& headerStream(){return m_headerStream;}
-   std::iostream& bodyStream(){return m_bodyStream;}
-   
-   virtual std::istream* getInputStream()
-         {return static_cast<std::istream*>(&m_bodyStream);}
-   
-   /**
-    * Clears out the Response and prepares for a new response.
-    */
-   virtual void clear()
-   {
-      m_headerBuffer.clear();
-      m_bodyBuffer.clear();
-      m_headerKwl.clear();
-      m_statusLine = "";
-      m_statusCode = 200;
-   }
-   
-   /**
-    * This will parse out the response code from the status line and initialize
-    * the header variables into a keywordlist.
-    */
-   void convertHeaderStreamToKeywordlist();
-   virtual void clearLastError(){m_statusCode = 200;m_statusLine="";}
-   
-   virtual ossimString getLastError()const{return ((m_statusCode == 200)?ossimString(""):m_statusLine);}
-   
-   ossimKeywordlist& headerKwl(){return m_headerKwl;}
-   const ossimKeywordlist& headerKwl()const{return m_headerKwl;}
-   
-   const ossimString& statusLine()const{return m_statusLine;}
-   ossim_uint32 getStatusCode()const{return m_statusCode;}
-   
-protected:
-   ossimKeywordlist      m_headerKwl;
-   ossimByteStreamBuffer m_headerBuffer;
-   ossimByteStreamBuffer m_bodyBuffer;
-   std::iostream         m_headerStream;
-   std::iostream         m_bodyStream;
-   ossimString           m_statusLine;
-   ossim_uint32          m_statusCode;
-   
-TYPE_DATA;
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossimImageTypeLut.h b/ossim/include/ossim/base/ossimImageTypeLut.h
deleted file mode 100644
index b5886c7..0000000
--- a/ossim/include/ossim/base/ossimImageTypeLut.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken (dburken at imagelinks.com)
-//
-// Description:
-//
-// Contains class declaration for ImageTypeLut.  Currently has mapping of
-// ouput image writes from enumeration to string and string to
-// enumeration.
-//
-//*******************************************************************
-//  $Id: ossimImageTypeLut.h 9968 2006-11-29 14:01:53Z gpotts $
-
-#ifndef ImageTypeLUT_HEADER
-#define ImageTypeLUT_HEADER
-
-#include <ossim/base/ossimLookUpTable.h>
-
-class OSSIMDLLEXPORT ossimImageTypeLut : public ossimLookUpTable
-{
-public:
-
-   ossimImageTypeLut();
-
-   virtual ~ossimImageTypeLut(){}
-
-   virtual ossimKeyword getKeyword() const { return IMAGE_TYPE_KW; }
-
-   static const ossimKeyword IMAGE_TYPE_KW;
-};
-#endif
diff --git a/ossim/include/ossim/base/ossimIoStream.h b/ossim/include/ossim/base/ossimIoStream.h
deleted file mode 100644
index e2d728f..0000000
--- a/ossim/include/ossim/base/ossimIoStream.h
+++ /dev/null
@@ -1,236 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-// Description:
-// 
-// Class declarations for:
-//
-// ossimIStream
-// ossimOStream
-// ossimIOStream
-// ossimIOMemoryStream
-// ossimIMemoryStream
-// ossimOMemoryStream
-// ossimIOFStream
-// ossimIFStream
-// ossimOFStream
-//
-//*******************************************************************
-//  $Id: ossimIoStream.h 22475 2013-11-07 13:28:51Z gpotts $
-#ifndef ossimIoStream_HEADER
-#define ossimIoStream_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimStreamBase.h>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <ossim/base/ossimString.h>
-
-
-class OSSIM_DLL ossimIStream : public ossimStreamBase, public std::basic_istream<char>   
-{
-public:
-   //ossimIStream();
-   ossimIStream(std::streambuf* sb);
-   virtual ~ossimIStream();
-};
-
-
-class OSSIM_DLL ossimOStream : public ossimStreamBase, public std::basic_ostream<char>
-{
-public:
-   //ossimOStream();
-   ossimOStream(std::streambuf* sb);   
-   virtual ~ossimOStream();
-};
-
-class OSSIM_DLL ossimIOStream : public ossimStreamBase, public std::basic_iostream<char>
-{
-public:
-   //ossimIOStream();
-   ossimIOStream(std::streambuf* sb);   
-   virtual ~ossimIOStream();
-};
-
-class OSSIM_DLL ossimIOMemoryStream : public ossimIOStream
-{
-public:
-   ossimIOMemoryStream();
-
-   virtual ~ossimIOMemoryStream();
-
-   // ??? (drb)
-   bool is_open()const;
-
-   // ??? (drb)
-   virtual void open(const char* /* protocolString */,
-                     int /* openMode */);
-
-   ossimString str();
-
-   // ??? (drb)
-   virtual void close();
-
-   // ??? (drb) std::streamsize
-   ossim_uint64 size()const;
-
-protected:
-   std::stringbuf theBuf;
-};
-
-class OSSIM_DLL ossimIMemoryStream : public ossimIStream
-{
-public:
-   
-   ossimIMemoryStream(const ossimString& inputBuf);
-   
-   virtual ~ossimIMemoryStream();
-   
-   bool is_open()const;
-   
-   ossim_uint64 size()const;
-   
-   virtual void open(const char* /* protocolString */,
-                     int /* openMode */ );
-
-   virtual void close();
-   
-   ossimString str();
-
-protected:
-   std::stringbuf theBuf;
-   
-};
-
-class OSSIM_DLL ossimOMemoryStream : public ossimOStream
-{
-public:
-   ossimOMemoryStream();
-   virtual ~ossimOMemoryStream();   
-
-   bool is_open()const;
-
-   ossim_uint64 size()const;
-
-   virtual void open(const char* /* protocolString */,
-                     int /* openMode */ );
-
-   virtual void close();
-
-   ossimString str();
-
-protected:
-   std::stringbuf theBuf;
-};
-
-class OSSIM_DLL ossimIOFStream : public ossimStreamBase, public std::basic_fstream<char>
-{
-public:
-   ossimIOFStream();
-
-   ossimIOFStream(const char* name,
-                  std::ios_base::openmode mode =
-                  std::ios_base::in | std::ios_base::out);
-
-   virtual ~ossimIOFStream();
-};
-
-class OSSIM_DLL ossimIFStream : public ossimStreamBase, public std::basic_ifstream<char>
-{
-public:
-   ossimIFStream();
-   
-   ossimIFStream(const char* file,
-                 std::ios_base::openmode mode = std::ios_base::in);
-
-   virtual ~ossimIFStream();
-
-};
-
-class OSSIM_DLL ossimOFStream : public ossimStreamBase, public std::basic_ofstream<char>
-{
-public:
-   ossimOFStream();
-
-   ossimOFStream(const char* name,
-                 std::ios_base::openmode mode =
-                 std::ios_base::out|std::ios_base::trunc);
-
-   virtual ~ossimOFStream();
-
-};
-
-
-#ifdef _MSC_VER
-
-class ossimIFStream64 : public std::basic_ifstream<char>
-{
-public:
-   ossimIFStream64(const char* pFilename, 
-      std::ios_base::openmode mode = ios_base::in, 
-      int prot = ios_base::_Openprot);
-
-   virtual ~ossimIFStream64();
-   void seekg64(off_type off, ios_base::seekdir way);
-
-   void seekg64(streampos pos, ios_base::seekdir way);
-
-   static void seekg64(std::istream& str, off_type off, ios_base::seekdir way);
- 
-   static void seekg64(std::istream& str, std::streampos pos, ios_base::seekdir way);
-private:
-   FILE* theFile;
-};
-
-class ossimOFStream64 : public std::basic_ofstream<char>
-{
-public:
-   ossimOFStream64(const char* pFilename, 
-                   std::ios_base::openmode mode = ios_base::out, 
-                   int prot = ios_base::_Openprot);
-   virtual ~ossimOFStream64();
-
-   ossim_uint64 tellp64();
-};
-
-#else
-
-class ossimIFStream64 : public std::basic_ifstream<char>
-{
-public:
-   ossimIFStream64(const char* pFilename, std::ios_base::openmode mode = ios_base::in, long prot = 0666);
-
-   virtual ~ossimIFStream64();
-
-   void seekg64(off_type off, ios_base::seekdir way);
-
-   static void seekg64(std::istream& str, off_type off, ios_base::seekdir way);
-};
-
-class ossimOFStream64 : public std::basic_ofstream<char>
-{
-public:
-   ossimOFStream64(const char* pFilename, std::ios_base::openmode mode = ios_base::out, long prot = 0666);
-
-   virtual ~ossimOFStream64();
-
-   ossim_uint64 tellp64();
-};
-
-#endif // _MSC_VER
-
-OSSIM_DLL void operator >> (ossimIStream& in,ossimOStream& out);
-OSSIM_DLL ossimIOStream& operator >> (ossimIStream& in,ossimIOStream& out);
-OSSIM_DLL void operator >> (ossimIOStream& in,ossimOStream& out);
-OSSIM_DLL ossimIOStream& operator >> (ossimIOStream& in,ossimIOStream& out);
-OSSIM_DLL void operator << (ossimOStream& out, ossimIStream& in);
-OSSIM_DLL void operator << (ossimOStream& out, ossimIOStream& in);
-OSSIM_DLL ossimIOStream& operator << (ossimIOStream& out, ossimIStream& in);
-OSSIM_DLL ossimIOStream& operator << (ossimIOStream& out, ossimIOStream& in);
-
-
-#endif
diff --git a/ossim/include/ossim/base/ossimKeywordNames.h b/ossim/include/ossim/base/ossimKeywordNames.h
deleted file mode 100644
index 6c09a4d..0000000
--- a/ossim/include/ossim/base/ossimKeywordNames.h
+++ /dev/null
@@ -1,209 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file
-//
-// Author: Ken Melero (kmelero at remotesensing.org)
-//
-// Description: Common file for global Keywors.
-//
-//*************************************************************************
-// $Id: ossimKeywordNames.h 23626 2015-11-18 14:04:24Z gpotts $
-
-#ifndef ossimKeywordNames_HEADER
-#define ossimKeywordNames_HEADER
-
-#include <ossim/base/ossimConstants.h>
-
-class OSSIMDLLEXPORT ossimKeywordNames
-{
-public:
-   //***
-   // NOTE:  List keyword in alphabetical order.
-   //***
-   static const char* AZIMUTH_ANGLE_KW;
-   static const char* BAND_KW;
-   static const char* BANDS_KW;
-   static const char* BORDER_SIZE_KW;
-   static const char* BRUSH_COLOR_KW;
-   static const char* BYTE_ORDER_KW;
-   static const char* CE90_ABSOLUTE_KW;
-   static const char* CE90_RELATIVE_KW;
-   static const char* CENTER_PIXEL_X_KW;
-   static const char* CENTER_PIXEL_Y_KW;
-   static const char* CENTRAL_MERIDIAN_KW;
-   static const char* CENTRAL_POINT1_LAT_KW;
-   static const char* CENTRAL_POINT1_LON_KW;
-   static const char* CENTRAL_POINT2_LAT_KW;
-   static const char* CENTRAL_POINT2_LON_KW;
-   static const char* COMPRESS_KW;
-   static const char* COMPRESSION_QUALITY_KW;
-   static const char* COMPRESSION_TYPE_KW;
-   static const char* CONVERGENCE_THRESHOLD_KW;
-   static const char* CREATE_EX_KW;
-   static const char* CREATE_EXTERNAL_GEOMETRY_KW;
-   static const char* CREATE_IMAGE_KW;
-   static const char* CREATE_HISTOGRAM_KW;   
-   static const char* CREATE_OVERVIEW_KW;
-   static const char* DATA_FILE_KW;
-   static const char* DATE_KW;
-   static const char* DATE_YEAR_KW;
-   static const char* DATE_MONTH_KW;
-   static const char* DATE_DAY_KW;
-   static const char* DATE_HOUR_KW;
-   static const char* DATE_MIN_KW;
-   static const char* DATE_SEC_KW;
-   static const char* DATE_FRACT_SEC_KW;
-   static const char* DATUM_KW;
-   static const char* DECIMAL_DEGREES_PER_PIXEL_LAT;
-   static const char* DECIMAL_DEGREES_PER_PIXEL_LON;
-   static const char* DESCRIPTION_KW;
-   static const char* ELEVATION_ANGLE_KW;
-   static const char* ELEVATION_CELL_KW;
-   static const char* ELEVATION_SOURCE_KW;
-   static const char* ELEVATION_LOOKUP_FLAG_KW;
-   static const char* ELLIPSE_CODE_KW;
-   static const char* ELLIPSE_EPSG_CODE_KW;
-   static const char* ELLIPSE_NAME_KW;
-   static const char* ENABLED_KW;
-   static const char* ENABLE_CACHE_KW;
-   static const char* EXTRACT_VERTICES_KW;  
-   static const char* ENTRY_KW;
-   static const char* FALSE_EASTING_NORTHING_KW;
-   static const char* FALSE_EASTING_NORTHING_UNITS_KW;
-   static const char* FALSE_EASTING_KW;
-   static const char* FALSE_NORTHING_KW;
-   static const char* FEATURE_NAME_KW;
-   static const char* FILENAME_KW;
-   static const char* FILEPATH_KW;
-   static const char* FILL_FLAG_KW;
-   static const char* FRAME_INDEX_KW;       
-   static const char* GCS_CODE_KW;
-   static const char* GEOM_FILE_KW;
-   static const char* HEMISPHERE_KW;
-   static const char* HORIZONTAL_SIZE_KW;
-   static const char* ID_KW;
-   static const char* IMAGE_CE90_KW;
-   static const char* IMAGE_FILE_KW;
-   static const char* IMAGE_ID_KW;
-   static const char* IMAGE_MODEL_TRANSFORM_MATRIX_KW;
-   static const char* IMAGE_MODEL_TRANSFORM_UNIT_KW;
-   static const char* IMAGE_PATH_KW;
-   static const char* IMAGE_TYPE_KW;
-   static const char* IMAGE_DATE_KW;
-   static const char* IMAGE_FILE_SIZE_KW;
-   static const char* INPUT_RR_LEVEL_KW;
-   static const char* INTERLEAVE_TYPE_KW;
-   static const char* JULIAN_DAY_KW;
-   static const char* LAT_INCREMENT_KW;
-   static const char* LL_LAT_KW;
-   static const char* LL_LON_KW;
-   static const char* LR_LAT_KW;
-   static const char* LR_LON_KW;
-   static const char* LL_X_KW;
-   static const char* LL_Y_KW;
-   static const char* LR_X_KW;
-   static const char* LR_Y_KW;
-   static const char* LON_INCREMENT_KW;
-   static const char* MAJOR_AXIS_KW;
-   static const char* MAX_VALUE_KW;
-   static const char* MAX_ITERATIONS_KW;
-   static const char* MAX_QUADTREE_LEVELS_KW;
-   static const char* METADATA_TYPE_KW;
-   static const char* METERS_PER_PIXEL_KW;
-   static const char* METERS_PER_PIXEL_X_KW;
-   static const char* METERS_PER_PIXEL_Y_KW;
-   static const char* MINOR_AXIS_KW;
-   static const char* MIN_VALUE_KW;
-   static const char* NULL_VALUE_KW;
-   static const char* NUMBER_BANDS_KW;
-   static const char* NUMBER_ENTRIES_KW;
-   static const char* NUMBER_INPUT_BANDS_KW;
-   static const char* NUMBER_INPUTS_KW;
-   static const char* NUMBER_OUTPUTS_KW;
-   static const char* NUMBER_OUTPUT_BANDS_KW;
-   static const char* NUMBER_LINES_KW;
-   static const char* NUMBER_REDUCED_RES_SETS_KW;
-   static const char* NUMBER_SAMPLES_KW;
-   static const char* ORIGIN_LATITUDE_KW;
-   static const char* ORIGIN_X_KW;
-   static const char* ORIGIN_Y_KW;
-   static const char* ORIGINAL_MAP_UNITS_KW;
-   static const char* OUTPUT_FILE_KW;
-   static const char* OUTPUT_FILE_PREFIX_KW;
-   static const char* OUTPUT_FILE_EXTENSION_KW;
-   static const char* OUTPUT_TILE_SIZE_KW;
-   static const char* OVERVIEW_COMPRESSION_QUALITY_KW;
-   static const char* OVERVIEW_COMPRESSION_TYPE_KW;
-   static const char* OVERVIEW_FILE_KW;
-   static const char* OVERVIEW_STOP_DIMENSION_KW;
-   static const char* PCS_CODE_KW;
-   static const char* PEN_COLOR_KW;
-   static const char* PHOTOMETRIC_KW;
-   static const char* PIXEL_SCALE_XY_KW;
-   // static const char* PIXEL_SCALE_Y_KW;
-   static const char* PIXEL_SCALE_UNITS_KW;
-   static const char* PIXEL_TYPE_KW;
-   static const char* PLANAR_CONFIG_KW;
-   static const char* POINT_WIDTH_HEIGHT_KW;
-   static const char* PROJECTION_KW;
-   static const char* QUALITY_KW;
-   static const char* QUERY_KW;
-   static const char* RADIOMETRY_KW;
-   static const char* REDUCED_RES_LEVEL_KW;
-   static const char* REF_GPT_LAT_KW;
-   static const char* REF_GPT_LON_KW;
-   static const char* REF_GPT_HGT_KW;
-   static const char* REF_IPT_LINE_KW;
-   static const char* REF_IPT_SAMP_KW;
-   static const char* ROTATION_KW;
-   static const char* SCALAR_TYPE_KW;
-   static const char* SCALE_PER_PIXEL_X_KW;
-   static const char* SCALE_PER_PIXEL_Y_KW;
-   static const char* SCALE_FACTOR_KW;
-   static const char* SCALE_X_KW;
-   static const char* SCALE_Y_KW;
-   static const char* SCALE_FACTOR_X_KW;
-   static const char* SCALE_FACTOR_Y_KW;
-   static const char* SENSOR_ID_KW;
-   static const char* SRS_NAME_KW;
-   static const char* STD_PARALLEL_1_KW;
-   static const char* STD_PARALLEL_2_KW;
-   static const char* THICKNESS_KW;
-   static const char* THREADS_KW;
-   static const char* TIE_POINT_EASTING_KW;
-   static const char* TIE_POINT_NORTHING_KW;
-   static const char* TIE_POINT_XY_KW;
-   // static const char* TIE_POINT_Y_KW;
-   static const char* TIE_POINT_UNITS_KW;
-   
-   static const char* TIE_POINT_LAT_KW;
-   static const char* TIE_POINT_LON_KW;
-   static const char* TILE_SOURCE_KW;
-   static const char* TILE_TYPE_KW;
-   static const char* TILE_SIZE_X_KW;
-   static const char* TILE_SIZE_Y_KW;
-   static const char* TRANSLATION_X_KW;
-   static const char* TRANSLATION_Y_KW;
-   static const char* TYPE_KW;
-   static const char* UL_LAT_KW;
-   static const char* UL_LON_KW;
-   static const char* UNITS_KW;
-  
-   static const char* UR_LAT_KW;
-   static const char* UR_LON_KW;
-   static const char* UL_X_KW;
-   static const char* UL_Y_KW;
-   static const char* UR_X_KW;
-   static const char* UR_Y_KW;
-   static const char* VALID_VERTICES_KW;
-   static const char* VERTICAL_SIZE_KW;
-   static const char* ZONE_KW;
-
-protected:
-   ossimKeywordNames();
-   ossimKeywordNames(const ossimKeywordNames& rhs);
-   const ossimKeywordNames& operator =(const ossimKeywordNames &rhs);
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimKeywordlist.h b/ossim/include/ossim/base/ossimKeywordlist.h
deleted file mode 100644
index a1ed2a8..0000000
--- a/ossim/include/ossim/base/ossimKeywordlist.h
+++ /dev/null
@@ -1,529 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Ken Melero
-// 
-// Description: This class provides capabilities for keywordlists.
-//
-//********************************************************************
-// $Id: ossimKeywordlist.h 22516 2013-12-14 17:19:47Z dburken $
-
-#ifndef ossimKeywordlist_HEADER
-#define ossimKeywordlist_HEADER 1
-
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimString.h>
-#include <iosfwd>
-#include <map>
-#include <vector>
-#include <algorithm>
-
-static const char DEFAULT_DELIMITER = ':';
-
-class ossimFilename;
-
-
-class OSSIM_DLL ossimKeywordlist : public ossimErrorStatusInterface,
-   public ossimReferenced
-{
-public:
-
-   typedef std::map<std::string, std::string> KeywordMap;
-
-   ossimKeywordlist(const ossimKeywordlist& src);
-   ossimKeywordlist(const std::map<std::string, std::string>& keywordMap);
-   ossimKeywordlist(char delimiter = DEFAULT_DELIMITER,
-                    bool expandEnvVars = false);
-
-   ossimKeywordlist(const char* file,
-                    char        delimiter = DEFAULT_DELIMITER,
-                    bool        ignoreBinaryChars = false,
-                    bool        expandEnvVars = false );
-
-   ossimKeywordlist(const ossimFilename& fileName,
-                    char                 delimiter = DEFAULT_DELIMITER,
-                    bool                 ignoreBinaryChars = false,
-                    bool                 expandEnvVars = false);
-
-   ~ossimKeywordlist();
-
-   static const std::string NULL_KW;
-
-   /*!
-    *  Reads file and adds keywords to the KeywordMap.
-    *  Returns true if file was parsed, false on error.
-    */
-   bool addFile(const char* file);
-
-   /*!
-    *  Reads file and adds keywords to the KeywordMap.
-    *  Returns true if file was parsed, false on error.
-    */
-   bool addFile(const ossimFilename& file); 
-
-   /*!
-    *  Method to change default delimiter.  Handy when parsing
-    *  files similar to a ossimKeywordlist.  (DEFAULT = ':')
-    */
-   void change_delimiter(char del);
-
-   ossimString delimiter_str() const;
-
-   /*!
-    * If set to true, then strings found having the format
-    * "$(env_var_name)" are expanded in place.
-    */
-   void setExpandEnvVarsFlag( bool flag );
-   /*!
-    * Returns the flag that determines whether or not
-    * environment variables are expanded.
-    */
-   bool getExpandEnvVarsFlag( void ) const;
-
-   void add(const char* prefix,
-            const ossimKeywordlist& kwl,
-            bool overwrite=true);
-
-   /**
-    * This is a generic find method that takes a comparator type and iterates through 
-    * the map executing the overloaded operator ().
-    * Typical code example format
-    <pre>
-    typedef std::unary_function<std::pair<ossimString, ossimString>, bool> KwlCompareFunctionType;
-    
-    class KwlKeyCaseInsensitiveEquals : public KwlCompareFunctionType
-    {
-    public:
-       KwlKeyCaseInsensitiveEquals(const ossimString& key):m_key(key){}
-       virtual bool operator()(const KwlComparePairType& rhs)const
-       {
-          return (m_key == rhs.first.downcase());
-       }
-       ossimString m_key;
-    };
-
-    // now for use case example:
-    kwl.findValue(value, KwlKeyCaseInsensitiveEquals("foo"));
-    </pre>
-    
-    This example shows how to supplly your own comparator and do a case insensitive
-    search for the key foo and the value is set to the variable value.
-    *
-    */
-   template<class CompareType>
-   bool findValue(ossimString& value, const CompareType& compare)const
-   {
-      KeywordMap::const_iterator iter = std::find_if(m_map.begin(), m_map.end(), compare);
-      bool result = (iter != m_map.end());
-      if(result) value = iter->second;
-      return result;
-   }
-   
-   std::string& operator[](const std::string& key)
-   {
-      return m_map[key];
-   }
-   std::string operator[](const std::string& key)const
-   {
-      ossimString result = find(key.c_str());
-      
-      return result.c_str();
-   }
-
-   // Methods to add keywords to list.
-   void addPair(const std::string& key,
-                const std::string& value,
-                bool               overwrite = true);
-
-   void addPair(const std::string& prefix,
-                const std::string& key,
-                const std::string& value,
-                bool               overwrite = true);
-   
-   /*!
-    * Allows you to extract out a sub keywordlist from another
-    * you can also collapse the hieracrchy by setting
-    * strip prefix to true.
-    */
-   void add(const ossimKeywordlist& kwl,
-            const char* prefix=0,
-            bool stripPrefix=true);
-  
-   void add(const char*   key,
-            const char*   value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            const char*   value,
-            bool          overwrite = true);
-
-   void add(const char*   key,
-            char          value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            char          value,
-            bool          overwrite = true);
-
-   void add(const char*   key,
-            ossim_int16   value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_int16   value,
-            bool          overwrite = true);
-
-   void add(const char*   key,
-            ossim_uint16  value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_uint16  value,
-            bool          overwrite = true);
-
-   void add(const char*   key,
-            ossim_int32   value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_int32   value,
-            bool          overwrite = true);
-
-   void add(const char*   key,
-            ossim_uint32  value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_uint32  value,
-            bool          overwrite = true);
-
-   void add(const char*   key,
-            ossim_int64   value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_int64   value,
-            bool          overwrite = true);
-
-   void add(const char*   key,
-            ossim_uint64  value,
-            bool          overwrite = true);
-
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_uint64  value,
-            bool          overwrite = true);
-
-   /**
-    * @param key Key for key-value pair.
-    *
-    * @param value Value to pair with key.  Note this will be stored as a
-    * string.
-    * 
-    * @param precision Decimal point precision of the output. (default = 8)
-    *
-    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
-    * be trimmed from the converted string.  (default = false)
-    *
-    * @param scientific If true output will be in scientific notation else
-    * fixed is used. (default = false)
-    */
-   void add(const char*   key,
-            ossim_float32 value,
-            bool          overwrite    = true,
-            int           precision    = 8);
-
-   /**
-    * @param key Key for key-value pair.
-    *
-    * @param value Value to pair with key.  Note this will be stored as a
-    * string.
-    * 
-    * @param precision Decimal point precision of the output. (default = 8)
-    *
-    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
-    * be trimmed from the converted string.  (default = false)
-    *
-    * @param scientific If true output will be in scientific notation else
-    * fixed is used. (default = false)
-    */
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_float32 value,
-            bool          overwrite    = true,
-            int           precision    = 8);
-
-   /**
-    * @param key Key for key-value pair.
-    *
-    * @param value Value to pair with key.  Note this will be stored as a
-    * string.
-    * 
-    * @param precision Decimal point precision of the output. (default = 15)
-    *
-    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
-    * be trimmed from the converted string.  (default = false)
-    *
-    * @param scientific If true output will be in scientific notation else
-    * fixed is used. (default = false)
-    */
-   void add(const char*   key,
-            ossim_float64 value,
-            bool          overwrite    = true,
-            int           precision    = 15);
-
-   /**
-    * @param key Key for key-value pair.
-    *
-    * @param value Value to pair with key.  Note this will be stored as a
-    * string.
-    * 
-    * @param precision Decimal point precision of the output. (default = 15)
-    *
-    * @param trimZeroFlag If true trailing '0's and any trailing '.' will
-    * be trimmed from the converted string.  (default = false)
-    *
-    * @param scientific If true output will be in scientific notation else
-    * fixed is used. (default = false)
-    */
-   void add(const char*   prefix,
-            const char*   key,
-            ossim_float64 value,
-            bool          overwrite    = true,
-            int           precision    = 15);
-
-   /**
-    * @brief Checks for key in map.
-    *
-    * Note that "find" and findKey will alway return an empty string even if
-    * the key in not in the map.
-    *
-    * @return true if key is in map even if value is empty; false, if not.
-    */
-   bool hasKey( const std::string& key ) const;
-   
-   /**
-    *  @brief Find methods that take std::string(s).
-    *  Searches the map for key(/prefix) and returns the resulting value
-    *  or an empty string if the key was not found.
-    *  @param key e.g. "number_line"
-    *  @param prefix e..g "image0."
-    *  @return Reference to string.  This will be emptry if not found or
-    *  if value is empty.
-    */
-   const std::string& findKey(const std::string& key) const;
-   const std::string& findKey(const std::string& prefix,
-                              const std::string& key) const;
-   
-   const char* find(const char* key) const;
-   const char* find(const char* prefix,
-                    const char* key) const;
-
-   void remove(const char * key);
-   void remove(const char* prefix, const char * key);
-
-   /*!
-    *  Searches the map for the number of keys containing the string.
-    */
-   ossim_uint32 numberOf(const char* str) const;
-
-   /*!
-    *  Searches the map for the number of keys containing the prefix+key.
-    *  
-    *  Given the keyword list contains:
-    *
-    *  source.type1: foo
-    *  source.type2: you
-    *
-    *  This:
-    *
-    *  int number_of_sources = numberOf("source", "type");
-    *
-    *  number_of_sources equals 2
-    */
-   ossim_uint32 numberOf(const char* prefix, const char* key) const;
-
-   /**
-    * Methods to dump the ossimKeywordlist to a file on disk.
-    *
-    * @param file Name of output file.
-    * @param comment Optional string that will be written to line 1
-    * as a C++-style comment. A "//" is prepended to the input string.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool write(const char* file, const char* comment = 0) const;
-
-   virtual ossimString toString()const;
-   virtual void toString(ossimString& result)const;
-
-   virtual void writeToStream(std::ostream &out)const;
-
-   virtual std::ostream& print(std::ostream& os) const;
-   OSSIMDLLEXPORT friend std::ostream& operator<<(std::ostream& os,
-                                                  const ossimKeywordlist& kwl);
-   bool operator ==(ossimKeywordlist& kwl)const;
-
-    /*!
-     * Clear all contents out of the ossimKeywordlist.
-     */
-
-    void clear();
-
-    /*!
-     * Add contents of another keyword list to this one.
-     *
-     * @param src the keyword list to copy items from.
-     * @param overwrite true if keys existing in this and src should have
-     * their value overwritten by the src value, otherwise false to preserve
-     * the original value.  Defaults to true.
-     */
-
-   void addList( const ossimKeywordlist &src, bool overwrite = true );
-
-   /** deprecated method */
-   virtual bool parseStream(std::istream& is,
-                            bool ignoreBinaryChars);
-   
-   virtual bool parseStream(std::istream& is);
-   virtual bool parseString(const std::string& inString);
-
-   /*!
-    *  Will return a list of keys that contain the string passed in.
-    *  Later we will need to allow a user to specify regular expresion
-    *  searches.
-    */
-   std::vector<ossimString> findAllKeysThatContains(
-      const ossimString &searchString)const;
-
-   /**
-    * @brief Finds keys that match regular expression.
-    *
-    * Note: This does not clear vector passed to it.
-    *
-    * @param result Initialized by this.
-    * @param regularExpression e.g. "image[0-9]*\\.file"
-    */
-   void findAllKeysThatMatch( std::vector<ossimString>& result,
-                              const ossimString &regularExpression ) const;
-
-   /**
-    * @brief Gets number keys that match regular expression.
-    * @param regularExpression e.g. "image[0-9]*\\.file"
-    * @return Number of keys matching regular expression.
-    */
-   ossim_uint32 getNumberOfKeysThatMatch(
-      const ossimString &regularExpression ) const;
-
-   void extractKeysThatMatch(ossimKeywordlist& kwl,
-                             const ossimString &regularExpression)const;
-
-   void removeKeysThatMatch(const ossimString &regularExpression);
-
-   /*!
-    * Will return only the portion of the key that
-    * matches the regular expression.
-    *
-    * example:
-    *
-    *  source1.source1.a:
-    *  source1.source2.a:
-    *  source1.source3.a:
-    *  source1.source4.a:
-    *  source1.source10.a:
-    *
-    *  kwl.getSubstringKeyList("source1.source[0-9]*\\.");
-    *
-    *  will return:
-    *
-    *  source1.source1.
-    *  source1.source2.
-    *  source1.source3.
-    *  source1.source4.
-    *  source1.source10.
-    *
-    */
-   std::vector<ossimString> getSubstringKeyList(const ossimString& regularExpression)const;
-   void getSubstringKeyList(std::vector<ossimString>& result,
-                            const ossimString& regularExpression)const;
-
-   ossim_uint32 getNumberOfSubstringKeys(
-      const ossimString& regularExpression)const;
-
-   void addPrefixToAll(const ossimString& prefix);
-   void addPrefixToKeysThatMatch(const ossimString& prefix,
-                                 const ossimString& regularExpression);
-   void stripPrefixFromAll(const ossimString& regularExpression);
-
-   /*!
-    * Returns the number of elements.
-    */
-   ossim_uint32 getSize()const;
-
-   const ossimKeywordlist::KeywordMap& getMap()const;
-   ossimKeywordlist::KeywordMap& getMap();
-   
-   ossimKeywordlist& downcaseKeywords();
-   ossimKeywordlist& upcaseKeywords();
-   
-   ossimKeywordlist& trimAllValues(const ossimString& valueToTrim= ossimString(" \t\n\r"));
-   ossimKeywordlist trimAllValues(const ossimString& valueToTrim= ossimString(" \t\n\r"))const;
-
-
-   //! [OLK, Aug/2008]
-   //! Sets the boolean  <rtn_val> depending on value associated with keyword for values = 
-   //! (yes|no|true|false|1|0). Returns TRUE if keyword found, otherwise false. Also returns false
-   //! if none of the above permitted values are specified (rtn_val left unchanged in this case).
-   bool getBoolKeywordValue(bool& rtn_val, 
-                            const char* keyword, 
-                            const char* prefix=0) const;
-
-protected:
-   enum KeywordlistParseState
-   {
-      KeywordlistParseState_OK         = 0,
-      KeywordlistParseState_FAIL       = 1, // just used to say this set of token has failed the rules
-      KeywordlistParseState_BAD_STREAM = 2, // Means an error occured that is a mal formed stream for Keywordlist
-   };
-   /*!
-    *  Method to parse files to initialize the list.  Method will error on
-    *  binary characters if "ignoreBinaryChars = false".  This is used by
-    *  ImageHandler factories that can be passed a binary file inadvertently
-    *  by a user.  The "ignoreBinaryChars" flag should be set to true if
-    *  a text file contains mixed ascii/binary values.
-    *  Returns true if file was parsed, false on error.
-    */
-   bool parseFile(const ossimFilename& file,
-                  bool  ignoreBinaryChars = false);
-
-   bool isValidKeywordlistCharacter(ossim_uint8 c)const;
-   void skipWhitespace(std::istream& in)const;
-   KeywordlistParseState readComments(ossimString& sequence, std::istream& in)const;
-   KeywordlistParseState readKey(ossimString& sequence, std::istream& in)const;
-   KeywordlistParseState readValue(ossimString& sequence, std::istream& in)const;
-   KeywordlistParseState readKeyAndValuePair(ossimString& key, ossimString& value, std::istream& in)const;
-   
-   // Method to see if keyword exists in list.
-   KeywordMap::iterator getMapEntry(const std::string& key);
-   KeywordMap::iterator getMapEntry(const ossimString& key);
-   KeywordMap::iterator getMapEntry(const char* key);
-
-   KeywordMap               m_map;
-   char                     m_delimiter;
-   bool                     m_preserveKeyValues; // enables preserving empty field values, multi lines, ... etc
-   bool                     m_expandEnvVars;
-};
-
-#endif /* #ifndef ossimKeywordlist_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimListener.h b/ossim/include/ossim/base/ossimListener.h
deleted file mode 100644
index 9245529..0000000
--- a/ossim/include/ossim/base/ossimListener.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimListener.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimListener_HEADER
-#define ossimListener_HEADER
-#include <ossim/base/ossimObject.h>
-
-class ossimEvent;
-
-/*!
- * Base class for all listners.  Listners nned to derive from this
- * class and override the processEvent method.
- */
-class OSSIMDLLEXPORT ossimListener
-{
-public:
-
-   ossimListener();
-
-   virtual ~ossimListener();
-
-   /**
-    * ProcessEvent.  The defaul is to do nothing.  Derived
-    * classes need to override this class.
-    */
-   virtual void processEvent(ossimEvent& event);
-
-   void enableListener();
-
-   void disableListener();
-
-   void setListenerEnableFlag(bool flag);
-
-   bool isListenerEnabled() const;
-
-   bool getListenerEnableFlag() const;
-
-protected:
-   bool theListenerEnableFlag;
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimLookUpTable.h b/ossim/include/ossim/base/ossimLookUpTable.h
deleted file mode 100644
index 5e560c2..0000000
--- a/ossim/include/ossim/base/ossimLookUpTable.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for LookUpTable. 
-//*******************************************************************
-//  $Id: ossimLookUpTable.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimLookUpTable_HEADER
-#define ossimLookUpTable_HEADER
-
-#include <vector>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimKeyword.h>
-
-class ossimKeywordlist;
-
-//*******************************************************************
-// CLASS:  LookUpTable
-//*******************************************************************
-class OSSIMDLLEXPORT ossimLookUpTable
-{
-public:
-
-   enum
-   {
-      NOT_FOUND    = -1
-   };
-   
-   virtual ~ossimLookUpTable();
-
-   /*!
-    *  @return
-    *  Returns the entry string associated with the entry number (key) passed
-    *  in. Returns empty string if entry number is not in the list.
-    */
-   virtual ossimString getEntryString(ossim_int32 entry_number) const;
-
-   /*!
-    *  @param table_index Index into the table
-    *  Note:  This is not the key mapped to the but the index into the table.
-    *  @return
-    *  Returns the entry string associated with the table index passed in.
-    *  Returns empty string if index is out of range.
-    */
-   virtual ossimString getTableIndexString(ossim_uint32 table_index) const;
-
-   /*!
-    *  Returns the entry string associated with the entry number passed in.
-    *  Returns empty string if entry number is not in the list.
-    */
-   virtual ossimString operator[](ossim_int32 entry_number) const;
-
-   /*!
-    *  Returns the entry string associated with lookup table keyword entry
-    *  in the Keywordlist passed in.
-    *  Returns empty string if keyword entry is not in the Keywordlist.
-    */
-   virtual ossimString getEntryString(const ossimKeywordlist& kwl,
-                                      const char* prefix=0) const;
-
-   /*!
-    *  Returns the entry number associated with the entry string passed in.
-    *  Returns NOT_FOUND(-1) if entry string is not in the list.
-    *  If case_insensitive == true(default), the test is case insensitive;
-    *  else, the test will be case sensitive.
-    */
-   virtual ossim_int32 getEntryNumber(const char* entry_string,
-                                      bool case_insensitive = true) const;
-
-   /*!
-    *  Returns the entry number associated with the lookup table keyword
-    *  entry in the Keywordlist passed in.  Returns NOT_FOUND(-1) if no
-    *  matching entry.
-    *  If case_insensitive == true(default), the test is case insensitive;
-    *  else, the test will be case sensitive.
-    */
-   virtual ossim_int32 getEntryNumber(const ossimKeywordlist& kwl,
-                                      const char* prefix=0,
-                                      bool case_insensitive = true) const;
-
-   /*!
-    *  Returns keyword for lookups from a Keywordlist.
-    */
-   virtual ossimKeyword getKeyword() const=0;
-
-   virtual ossim_uint32 getTableSize() const;
-  
-  void dumpValues(std::ostream& out)const;
-protected:
-
-   ossimLookUpTable(ossim_int32 table_size);
-
-   class ossimKeyValueMap
-   {
-   public:
-      void init (ossim_int32 key, const ossimString& value) { theKey=key; theValue=value; }
-      ossim_int32  theKey;
-      ossimString theValue;
-   };
-
-   std::vector<ossimKeyValueMap>  theTable;
-   
-   ossimLookUpTable(){}
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimMetadataInterface.h b/ossim/include/ossim/base/ossimMetadataInterface.h
deleted file mode 100644
index 56c3268..0000000
--- a/ossim/include/ossim/base/ossimMetadataInterface.h
+++ /dev/null
@@ -1,46 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimFileProcessorInterface.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class interface ossimMetadataInterface.
-//
-// Has pure virtual "addMetadata" method that derived classes must
-// implement to be concrete.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimMetadataInterface_HEADER
-#define ossimMetadataInterface_HEADER 1
-
-#include <string>
-
-class ossimKeywordlist;
-
-/** @class ossimMetadataInterface */
-class ossimMetadataInterface
-{
-public:
-   
-   /** @brief default constructor */
-   ossimMetadataInterface(){}
-
-   /** @brief virtual destructor. */
-   virtual ~ossimMetadataInterface(){}
-
-   /**
-    * @brief Pure virtual addMetadata method. Derived classed must implement.
-    * @param kwl Initialized by this.
-    * @param prefix e.g. "image0." (can be empty)
-    */
-   virtual void addMetadata( ossimKeywordlist* kwl,
-                             const std::string& prefix ) const = 0;
-};
-
-#endif /* #ifndef ossimMetadataInterface_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimMultiResLevelHistogram.h b/ossim/include/ossim/base/ossimMultiResLevelHistogram.h
deleted file mode 100644
index c333c02..0000000
--- a/ossim/include/ossim/base/ossimMultiResLevelHistogram.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-// Description: 
-//
-//*******************************************************************
-//  $Id: ossimMultiResLevelHistogram.h 15766 2009-10-20 12:37:09Z gpotts $
-#ifndef ossimMultiResLevelHistogram_HEADER
-#define ossimMultiResLevelHistogram_HEADER
-#include <vector>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-
-class OSSIMDLLEXPORT ossimMultiResLevelHistogram : public ossimReferenced
-{
-public:
-   ossimMultiResLevelHistogram();
-   ossimMultiResLevelHistogram(ossim_uint32 numberOfResLevels);
-   ossimMultiResLevelHistogram(const ossimMultiResLevelHistogram& rhs);
-   
-
-   ossimRefPtr<ossimHistogram> getHistogram(ossim_uint32 band,
-                                            ossim_uint32 resLevel=0);
-   const ossimRefPtr<ossimHistogram> getHistogram(ossim_uint32 band,
-                                                  ossim_uint32 resLevel=0)const;
-   ossim_uint32 getNumberOfResLevels()const;
-   ossim_uint32 getNumberOfBands(ossim_uint32 resLevel=0) const;
-   void create(ossim_uint32 numberOfResLevels);
-   ossimRefPtr<ossimMultiBandHistogram> getMultiBandHistogram(ossim_uint32 resLevel) const;
-   ossimRefPtr<ossimMultiResLevelHistogram> createAccumulationLessThanEqual()const;
-   ossimRefPtr<ossimMultiResLevelHistogram> createAccumulationGreaterThanEqual()const;
-
-   void setBinCount(double binNumber, double count);
-   /*!
-    * Will append to the list the passed in histogram.
-    */
-   virtual void addHistogram(ossimMultiBandHistogram* histo);
-
-   /*!
-    * This will create and append a histogram to the
-    * list and return a pointer to the new histogram.
-    */
-   virtual ossimRefPtr<ossimMultiBandHistogram> addHistogram();
-
-   /*!
-    * Will set the histogram to the passed in res level.
-    * It will delete the histogram at the res level before
-    * setting the pointer to the passed in histogram.  if
-    * the resLevel is out of range it will return false meaning
-    * it was unable to assign the pointer.
-    */
-   virtual bool setHistogram(ossimRefPtr<ossimMultiBandHistogram> histo, ossim_uint32 resLevel);
-
-   virtual ossimFilename getHistogramFile() const;
-   virtual bool importHistogram(const ossimFilename& inputFile);
-   virtual bool importHistogram(std::istream& in);
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-protected:
-   virtual ~ossimMultiResLevelHistogram();
-  class  ossimProprietaryHeaderInformation
-   {
-   public:
-      ossimProprietaryHeaderInformation(){clear();}
-
-      bool parseStream(std::istream& in);
-
-      ossim_uint32 getNumberOfResLevels()
-         {
-            return theNumberOfResLevels.toUInt32();
-         }
-      void clear()
-         {
-            theFileType          = "";
-            theVersion           = "";
-            theCreatorId         = "";
-            theNumberOfResLevels = "";
-         }
-      ossimString theFileType;
-      ossimString theVersion;
-      ossimString theCreatorId;
-      ossimString theNumberOfResLevels;
-   };
-
-   std::vector<ossimRefPtr<ossimMultiBandHistogram> > theHistogramList;
-   ossimFilename                    theHistogramFile;
-   
-   void deleteHistograms();
-   bool parseProprietaryHistogram(std::istream& in);
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimNBandLutDataObject.h b/ossim/include/ossim/base/ossimNBandLutDataObject.h
deleted file mode 100644
index b2c2942..0000000
--- a/ossim/include/ossim/base/ossimNBandLutDataObject.h
+++ /dev/null
@@ -1,489 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// LICENSE: MIT See top level license file.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimNBandLutDataObject.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNBandLutDataObject_HEADER
-#define ossimNBandLutDataObject_HEADER 1
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimFilename.h>
-#include <iostream>
-#include <map>
-
-/**
- * class ossimNBandLutDataObject
- *
- * Sample CADRG LUT taken from an arbitrary CADRG image entry.  This is a keywordlist
- * support by the loadstate of this class.
- *
- * <pre>
- * entry0:  25 39 116 
- * entry1:  245 242 242 
- * entry10:  92 89 115 
- * entry100:  74 55 85 
- * entry101:  233 165 53 
- * entry102:  75 2 4 
- * entry103:  162 118 42 
- * entry104:  233 159 130 
- * entry105:  189 129 40 
- * entry106:  154 109 66 
- * entry107:  145 97 85 
- * entry108:  121 86 31 
- * entry109:  238 151 118 
- * entry11:  52 31 76 
- * entry110:  239 167 42 
- * entry111:  236 137 100 
- * entry112:  179 112 88 
- * entry113:  92 37 33 
- * entry114:  121 66 24 
- * entry115:  120 133 151 
- * entry116:  76 92 192 
- * entry117:  36 50 117 
- * entry118:  57 75 191 
- * entry119:  125 45 50 
- * entry12:  235 217 204 
- * entry120:  102 65 81 
- * entry121:  172 148 199 
- * entry122:  204 145 95 
- * entry123:  81 19 5 
- * entry124:  91 4 1 
- * entry125:  109 54 31 
- * entry126:  137 114 118 
- * entry127:  230 150 52 
- * entry128:  82 38 87 
- * entry129:  190 120 76 
- * entry13:  244 218 172 
- * entry130:  170 109 45 
- * entry131:  95 20 22 
- * entry132:  150 80 61 
- * entry133:  225 122 82 
- * entry134:  122 37 16 
- * entry135:  146 88 49 
- * entry136:  122 94 122 
- * entry137:  230 135 63 
- * entry138:  137 73 75 
- * entry139:  119 46 29 
- * entry14:  189 167 141 
- * entry140:  190 142 128 
- * entry141:  242 216 187 
- * entry142:  176 125 95 
- * entry143:  193 117 143 
- * entry144:  19 0 0 
- * entry145:  12 1 42 
- * entry146:  24 4 26 
- * entry147:  38 40 52 
- * entry148:  8 24 175 
- * entry149:  40 23 45 
- * entry15:  245 213 142 
- * entry150:  39 11 58 
- * entry151:  10 0 22 
- * entry152:  236 148 41 
- * entry153:  101 41 11 
- * entry154:  230 113 67 
- * entry155:  148 44 46 
- * entry156:  225 144 133 
- * entry157:  115 2 13 
- * entry158:  159 79 49 
- * entry159:  164 95 33 
- * entry16:  246 241 205 
- * entry160:  97 6 22 
- * entry161:  175 90 133 
- * entry162:  112 23 20 
- * entry163:  105 22 6 
- * entry164:  148 59 33 
- * entry165:  215 118 104 
- * entry166:  211 122 41 
- * entry167:  233 129 34 
- * entry168:  153 73 25 
- * entry169:  208 102 39 
- * entry17:  240 215 89 
- * entry170:  206 101 133 
- * entry171:  229 113 96 
- * entry172:  127 16 25 
- * entry173:  224 104 28 
- * entry174:  171 76 74 
- * entry175:  221 94 78 
- * entry176:  229 86 94 
- * entry177:  213 80 57 
- * entry178:  161 44 36 
- * entry179:  155 54 19 
- * entry18:  115 92 157 
- * entry180:  130 25 5 
- * entry181:  150 29 24 
- * entry182:  198 54 34 
- * entry183:  224 61 70 
- * entry184:  213 82 37 
- * entry185:  186 28 31 
- * entry186:  200 64 15 
- * entry187:  110 2 2 
- * entry188:  195 38 12 
- * entry189:  151 6 8 
- * entry19:  160 163 37 
- * entry190:  193 13 10 
- * entry191:  205 1 3 
- * entry192:  44 62 193 
- * entry193:  35 14 16 
- * entry194:  15 30 118 
- * entry195:  28 47 189 
- * entry196:  25 3 80 
- * entry197:  7 16 118 
- * entry198:  33 10 6 
- * entry199:  39 24 95 
- * entry2:  216 212 237 
- * entry20:  38 29 21 
- * entry200:  82 58 159 
- * entry201:  55 29 142 
- * entry202:  33 4 23 
- * entry203:  17 14 36 
- * entry204:  58 26 41 
- * entry205:  11 13 14 
- * entry206:  74 87 85 
- * entry207:  50 60 41 
- * entry208:  119 123 98 
- * entry209:  193 187 172 
- * entry21:  208 202 156 
- * entry210:  124 126 128 
- * entry211:  47 68 84 
- * entry212:  110 119 60 
- * entry213:  63 145 121 
- * entry214:  154 166 147 
- * entry215:  107 156 104 
- * entry22:  242 202 152 
- * entry23:  168 148 140 
- * entry24:  31 22 25 
- * entry25:  245 205 114 
- * entry26:  245 191 137 
- * entry27:  175 161 172 
- * entry28:  17 6 11 
- * entry29:  172 170 137 
- * entry3:  247 230 113 
- * entry30:  51 27 20 
- * entry31:  239 210 73 
- * entry32:  185 176 129 
- * entry33:  35 2 13 
- * entry34:  60 52 51 
- * entry35:  101 78 70 
- * entry36:  141 124 101 
- * entry37:  206 184 107 
- * entry38:  244 174 106 
- * entry39:  82 98 136 
- * entry4:  246 231 132 
- * entry40:  190 191 239 
- * entry41:  241 188 161 
- * entry42:  67 51 38 
- * entry43:  244 184 122 
- * entry44:  211 201 142 
- * entry45:  61 27 16 
- * entry46:  182 182 82 
- * entry47:  243 188 87 
- * entry48:  86 83 60 
- * entry49:  61 40 43 
- * entry5:  204 198 166 
- * entry50:  146 141 93 
- * entry51:  44 4 4 
- * entry52:  231 210 51 
- * entry53:  85 74 39 
- * entry54:  197 169 127 
- * entry55:  182 151 60 
- * entry56:  121 98 73 
- * entry57:  243 182 145 
- * entry58:  58 18 21 
- * entry59:  241 157 91 
- * entry6:  2 0 2 
- * entry60:  59 4 1 
- * entry61:  155 162 223 
- * entry62:  154 133 80 
- * entry63:  73 21 16 
- * entry64:  195 183 116 
- * entry65:  76 51 29 
- * entry66:  234 181 63 
- * entry67:  58 59 98 
- * entry68:  42 22 79 
- * entry69:  134 143 219 
- * entry7:  204 204 239 
- * entry70:  106 117 205 
- * entry71:  48 65 117 
- * entry72:  63 54 117 
- * entry73:  125 93 62 
- * entry74:  137 138 41 
- * entry75:  104 68 59 
- * entry76:  113 99 41 
- * entry77:  76 30 11 
- * entry78:  239 184 48 
- * entry79:  161 129 98 
- * entry8:  31 4 66 
- * entry80:  241 170 126 
- * entry81:  145 109 105 
- * entry82:  207 163 116 
- * entry83:  79 41 40 
- * entry84:  175 138 41 
- * entry85:  10 0 56 
- * entry86:  180 151 77 
- * entry87:  72 12 24 
- * entry88:  242 154 105 
- * entry89:  91 26 15 
- * entry9:  246 238 162 
- * entry90:  160 118 53 
- * entry91:  228 166 141 
- * entry92:  231 160 69 
- * entry93:  61 2 11 
- * entry94:  132 83 60 
- * entry95:  86 46 24 
- * entry96:  243 143 86 
- * entry97:  108 60 46 
- * entry98:  109 76 38 
- * entry99:  96 86 84 
- * null_value:  -1
- * number_bands:  3
- * number_entries:  216
- * scalar_type:  ossim_uint8
- * type:  ossimNBandLutDataObject
- *
- *
- * NOTES:
- * 
- * - The null_value keyword above is the index in the lut that correspnds to an invalid pixel value.
- * - Each entry will have number_bands.  SO if number of bands is 3 then there will be 3 values
- *   Where the first value is for band 1, ... etc.
- * - scalar_type is a hint as to the scalar type of the entries.  Is the resulting lut for 8 bit, 16 bit , etc data.
- * - You should always use the LUT_ENTRY_TYPE when getting values from the lut.  This value could change to an
- *   ossim_float32 precision and if you use the LUT_ENTRY_TYPE then your code will not have to change.
- *   
- * </pre>
- */
-class OSSIM_DLL ossimNBandLutDataObject : public ossimObject
-{
-public:
-   
-   typedef ossim_int32 LUT_ENTRY_TYPE;
-   
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimNBandLutDataObject& lut);
-   /*!
-    * Will allocate 256 values for the color table
-    */
-   ossimNBandLutDataObject(ossim_uint32 numberOfEntries=0,
-                           ossim_uint32 numberOfBands=0,
-                           ossimScalarType bandScalarType = OSSIM_UINT8,
-                           ossim_int32 nullPixelIndex=-1);
-   ossimNBandLutDataObject(const ossimNBandLutDataObject& lut);
-   ossimObject* dup()const
-   {
-      return new ossimNBandLutDataObject(*this);
-   }
-   void create(ossim_uint32 numberOfEntries,
-               ossim_uint32 numberOfBands=3);
-   const LUT_ENTRY_TYPE* operator[](ossim_uint32 idx)const
-   {
-      if(theLut)
-      {
-         return &theLut[idx*theNumberOfBands];
-      }
-      
-      return 0;
-   }
-   LUT_ENTRY_TYPE* operator[](ossim_uint32 idx)
-   {
-      if(theLut)
-      {
-         return &theLut[idx*theNumberOfBands];
-      }
-      
-      return 0;
-   }
-   const LUT_ENTRY_TYPE* operator[](ossim_int32 idx)const
-   {
-      if(theLut)
-      {
-         return &theLut[idx*theNumberOfBands];
-      }
-      
-      return 0;
-   }
-   LUT_ENTRY_TYPE* operator[](ossim_int32 idx)
-   {
-      if(theLut)
-      {
-         return &theLut[idx*theNumberOfBands];
-      }
-      
-      return 0;
-   }
-   const LUT_ENTRY_TYPE* operator[](double normalizedIndex)const
-   {
-      int idx = int(normalizedIndex*theNumberOfEntries);
-      if (idx < 0)
-      {
-         idx = 0;
-      }
-      return (*this)[idx];
-   }
-
-   /**
-    * @param normalizedIndex  If a double precision value is passed in then it is
-    *                         assumed to be in normalized space where the value ranges from 0.0 to 1.0
-    * @return the starting address of the band values.
-    */ 
-   LUT_ENTRY_TYPE* operator[](double normalizedIndex)
-   {
-      ossim_uint32 idx = int(normalizedIndex*(theNumberOfEntries-1));
-      if (idx >= theNumberOfEntries)
-      {
-         idx = theNumberOfEntries-1;
-      }
-      return (*this)[idx];
-   }
-   
-   bool hasNullPixelIndex()const
-   {
-      return (theNullPixelIndex >= 0);
-   }
-   /**
-    * Will return the min max value for a given band
-    *
-    * @param band band number to query.  This is 0 based so the first band
-    *        is indicated by the value of 0.
-    * @param minValue is the minimum value returned for the passed in band
-    * @param maxValue is the maximum value returned for the passed in band
-    */
-   void getMinMax(ossim_uint32 band,
-                  LUT_ENTRY_TYPE& minValue,
-                  LUT_ENTRY_TYPE& maxValue);
-
-   /**
-    * @return First index with alpha of 0 or -1 if not found or there is no alpha.
-    *
-    * Currently only works on 4 band data.  May consider adding an alpha channel
-    * class data member in the future.
-    */
-   ossim_int32 getFirstNullAlphaIndex() const;
-   
-   /**
-    * Allows you to specify which entry is to be designated as an invalid
-    * entry.  Note: setting this to -1 indicates no null entry is set.
-    *
-    * @param idx is the entry number that will be used for the null value
-    */
-   void setNullPixelIndex(ossim_int32 idx){theNullPixelIndex = idx;}
-
-   /**
-    * @return Return either a positive value indicating the entry designated for
-    *         a null pixel value or a -1 to say no null pixel has been designated
-    *         yet.
-    */ 
-   ossim_int32 getNullPixelIndex()const{return theNullPixelIndex;}
-
-   /**
-    * @return Return the number of bands this lut is indexed for.
-    */ 
-   ossim_uint32 getNumberOfBands()const{return theNumberOfBands;}
-
-   /**
-    * @return Return the number of entries in the lut.
-    */ 
-   ossim_uint32 getNumberOfEntries()const{return theNumberOfEntries;}
-
-   /**
-    * This method gives you a way to find an entry index closest to the passed in
-    * band values.
-    * 
-    * @param values Is an array of band values.  This array must be equal to the number
-    *        of bands for the lut.
-    * @return Returns the nearest index to the passed in value.  
-    */ 
-   ossim_uint32 findIndex(ossim_int32* values) const;
-
-   /**
-    * @brief This method gives you a way to find an entry index closest to the
-    * passed in band values.
-    * 
-    * @param values Is an array of band values.
-    * @param size Size of values array.  Note if size is less than the LUT
-    * number of bands, the trailing bands get dropped.  This allows finding
-    * an index dropping the alpha channel.
-    * 
-    * @return Returns the nearest index to the passed in value.  
-    */ 
-   ossim_uint32 findIndex(ossim_int32* values, ossim_uint32 size) const;
-
-   /**
-    * Will do a simple memset to '\0' all 
-    */ 
-   void clearLut();
-   /**
-    * does a deep copy from the passed in lut to the object.
-    *
-    * @param lut The lut to copy.
-    */ 
-   const ossimNBandLutDataObject& operator =(const ossimNBandLutDataObject& lut);
-
-   /**
-    * Determines if the state of this lut is identical to the passed in lut
-    *
-    * @param lut Checks equality of the this object to the lut parameter.
-    * @return True if equal and false otherwise
-    */ 
-   bool operator ==(const ossimNBandLutDataObject& lut)const;
-
-   /**
-    * Reads in an external lut file.  The external file is in a keywordlist format specified by the saveState.
-    */ 
-   bool open(const ossimFilename& lutFile);
-
-   /**
-    * <pre>
-    * 
-    * Keywords:
-    *  
-    * entry0:
-    * entry1:
-    * :
-    * entry<number_entries-1>:
-    * null_value:  -1
-    * number_bands:  3
-    * number_entries:  216
-    * scalar_type:  ossim_uint8
-    * type:  ossimNBandLutDataObject
-    *
-    * Where entry<idx> is repeasted for each entry number where idx start from 0 and goes to number_entries-1
-    * each entry must have number_bands values.
-    * </pre>
-    *
-    * @param kwl The keyword list to store the keywords to.  Each keyword could be prefixed by an optional
-    *            prefix parameter.
-    * @param prefix The optional prefix parameter used to prefix each keyword.
-    * 
-    */ 
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   std::vector<ossimString> getEntryLabels(ossim_uint32 band);
-
-   void setEntryLables(ossim_uint32 band, std::vector<ossimString> entryLabels);
-
-   
-   /**
-    * Loads the state of the object by reading in the keywords listed in the save state.
-    *
-    * @param kwl The keywordlist to extract the classes keywords from to restore its state.
-    * @param prefix  Optional prefix value used to prefix each keyword.
-    */ 
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-protected:
-   virtual ~ossimNBandLutDataObject();
-
-   LUT_ENTRY_TYPE *theLut;
-   ossim_uint32    theNumberOfEntries;
-   ossim_uint32    theNumberOfBands;
-   ossimScalarType theBandScalarType;
-   ossim_int32     theNullPixelIndex;
-   std::map<ossim_uint32, std::vector<ossimString> >  m_entryLabels;
-   
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimNormRgbVector.h b/ossim/include/ossim/base/ossimNormRgbVector.h
deleted file mode 100644
index 6db8f5d..0000000
--- a/ossim/include/ossim/base/ossimNormRgbVector.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// License: MIT
-// Author: Garrett Potts 
-// Description:
-//
-//*************************************************************************
-// $Id: ossimNormRgbVector.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNormRgbVector_HEADER
-#define ossimNormRgbVector_HEADER
-#include <iostream>
-#include <ossim/base/ossimConstants.h>
-
-class ossimJpegYCbCrVector;
-class ossimHsiVector;
-class ossimHsvVector;
-class ossimCmyVector;
-class ossimRgbVector;
-
-class OSSIM_DLL ossimNormRgbVector
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out, const ossimNormRgbVector& data)
-   {
-      out << "<" << data.theBuf[0] << ", "
-          << data.theBuf[1] << ", "
-          << data.theBuf[2] << ">";
-
-         return out;
-      }
-   ossimNormRgbVector(ossim_float64 r=0, ossim_float64 g=0, ossim_float64 b=0)
-      {
-         theBuf[0] = r;
-         theBuf[1] = g;
-         theBuf[2] = b;
-      }
-   ossimNormRgbVector(ossim_float64 grey)
-      {
-         theBuf[0] = grey;
-         theBuf[1] = grey;
-         theBuf[2] = grey;
-      }
-   ossimNormRgbVector(ossim_float64 colorData[3])
-      {
-         theBuf[0] = colorData[0];
-         theBuf[1] = colorData[1];
-         theBuf[2] = colorData[2];
-      }
-   ossimNormRgbVector(const ossimNormRgbVector& rgb)
-   {
-      theBuf[0] = rgb.theBuf[0];
-      theBuf[1] = rgb.theBuf[1];
-      theBuf[2] = rgb.theBuf[2];
-   }
-   ossimNormRgbVector(const ossimRgbVector& rgb);
-   ossimNormRgbVector(const ossimJpegYCbCrVector& YCbCr);
-   ossimNormRgbVector(const ossimHsiVector& hsi);
-   ossimNormRgbVector(const ossimHsvVector& hsv);
-   ossimNormRgbVector(const ossimCmyVector& cmy);
-   ossimNormRgbVector operator -(const ossimNormRgbVector& rgb)const
-   {
-      return ossimNormRgbVector(clamp(theBuf[0] - rgb.theBuf[0]),
-                                clamp(theBuf[1] - rgb.theBuf[1]),
-                                clamp(theBuf[2] - rgb.theBuf[2]));
-   }
-   ossimNormRgbVector operator *(ossim_float64 t)const
-   {
-      return ossimNormRgbVector(clamp(theBuf[0]*t),
-                                clamp(theBuf[1]*t),
-                                clamp(theBuf[2]*t));
-   }
-   
-   const ossimNormRgbVector& operator =(const ossimJpegYCbCrVector& data);
-   const ossimNormRgbVector& operator =(const ossimHsiVector& hsi);
-   const ossimNormRgbVector& operator =(const ossimHsvVector& hsv);
-   const ossimNormRgbVector& operator =(const ossimCmyVector& cmy);
-   bool operator ==(const ossimNormRgbVector& rgb)
-      {
-         return ( (rgb.theBuf[0] == theBuf[0])&&
-                  (rgb.theBuf[1] == theBuf[1])&&
-                  (rgb.theBuf[2] == theBuf[2]));
-      }
-   bool operator !=(const ossimNormRgbVector& rgb)
-      {
-         return ( (rgb.theBuf[0] != theBuf[0])||
-                  (rgb.theBuf[1] != theBuf[1])||
-                  (rgb.theBuf[2] != theBuf[2]));
-      }
-   static ossim_float64 clamp(ossim_float64 colorValue, ossim_float64 min=0.0, ossim_float64 max=1.0)
-      {
-         colorValue = colorValue > max? max:colorValue;
-         colorValue = colorValue < min? min:colorValue;
-         
-         return colorValue;
-      }
-   ossim_float64 getR() const { return theBuf[0]; }
-   ossim_float64 getG()const  { return theBuf[1]; }
-   ossim_float64 getB()const  { return theBuf[2]; }
-   void setR(ossim_float64 r) { theBuf[0] = r; }
-   void setG(ossim_float64 g) { theBuf[1] = g; }
-   void setB(ossim_float64 b) { theBuf[2] = b; }
-   
-protected:
-   ossim_float64 theBuf[3];
-   
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimPointHash.h b/ossim/include/ossim/base/ossimPointHash.h
deleted file mode 100644
index df7d178..0000000
--- a/ossim/include/ossim/base/ossimPointHash.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description: Point Hash is a base for hashing functions
-//              
-//*******************************************************************
-//  $Id: ossimPointHash.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimPointHash_HEADER
-#define ossimPointHash_HEADER
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimFpt.h>
-
-class OSSIMDLLEXPORT ossimPointHash
-{
-public:
-   virtual ~ossimPointHash(){}
-   virtual long operator ()(const ossimDpt &aPoint)=0;
-   virtual long operator ()(const ossimFpt &aPoint)=0;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimPolyArea2d.h b/ossim/include/ossim/base/ossimPolyArea2d.h
deleted file mode 100644
index 1545ad6..0000000
--- a/ossim/include/ossim/base/ossimPolyArea2d.h
+++ /dev/null
@@ -1,151 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//*******************************************************************
-//$Id: ossimPolyArea2d.h 23608 2015-10-28 13:51:35Z gpotts $
-
-#ifndef ossimPolyArea2d_HEADER
-#define ossimPolyArea2d_HEADER 1
-
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimReferenced.h>
-#include <vector>
-
-class OssimPolyArea2dPrivate;
-
-namespace geos
-{
-   namespace geom
-   {
-      class Geometry;
-   }
-}
-
-class OSSIM_DLL ossimPolyArea2d : public ossimReferenced
-{
-public:
-   friend class OssimPolyArea2dPrivate;
-   friend OSSIM_DLL std::ostream& operator <<(std::ostream& out, const ossimPolyArea2d& data);
-   
-   ossimPolyArea2d();
-   ossimPolyArea2d(const vector<ossimGpt>& polygon);
-   ossimPolyArea2d(const ossimPolygon& shell, const vector<ossimPolygon>& holes); 
-   
-   ossimPolyArea2d(const ossimDpt& p1,
-                   const ossimDpt& p2,
-                   const ossimDpt& p3,
-                   const ossimDpt& p4);
-   ossimPolyArea2d(const ossimPolyArea2d& rhs);
-   
-   ossimPolyArea2d(const ossimIrect& rect);
-   ossimPolyArea2d(const ossimDrect& rect);
-   ossimPolyArea2d(const ossimPolygon& polygon);
-   ~ossimPolyArea2d();
-   
-   void clear()
-   {
-      clearPolygons();
-   }
-   const ossimPolyArea2d& operator =(const ossimPolyArea2d& rhs);
-   const ossimPolyArea2d& operator =(const ossimPolygon& rhs);
-   const ossimPolyArea2d& operator =(const ossimIrect& rect);
-   const ossimPolyArea2d& operator =(const ossimDrect& rect);
-   const ossimPolyArea2d& operator =(const vector<ossimGpt>& polygon);
-   const ossimPolyArea2d& operator =(const vector<ossimDpt>& polygon);
-   const ossimPolyArea2d& operator &=(const ossimPolyArea2d& rhs);
-   ossimPolyArea2d operator &(const ossimPolyArea2d& rhs)const;
-   ossimPolyArea2d operator +(const ossimPolyArea2d& rhs)const;
-   const ossimPolyArea2d& operator +=(const ossimPolyArea2d& rhs);
-   ossimPolyArea2d operator -(const ossimPolyArea2d& rhs)const;
-   const ossimPolyArea2d& operator -=(const ossimPolyArea2d& rhs);
-   
-   bool intersects(const ossimPolyArea2d& rhs)const;
-   
-   void add(const ossimPolyArea2d& rhs);
-   bool getVisiblePolygons(vector<ossimPolygon>& polyList)const;
-   bool getPolygonHoles(vector<ossimPolygon>& polyList)const;
-   
-   /**
-    * @brief Gets all of the polygons stored with their holes embedded. This
-    * may be useful if an operation was performed on the original ossimPolyArea2d 
-    * that caused multiple polygons to be created internally.
-    *	 
-    * For example, if a rectangle is intersected with a U shape, the two top
-    * portions of the U would be their own separate polygon. It's also possible 
-    * for these polygons to contain their own holes. This function will return 
-    * the two top polygons as separate ossimPolyArea2d objects (with any of 
-    * their holes embedded inside them).
-    *
-    *  --------------------------------		 
-    * |                                |
-    * |                                |
-    * | ........           .........   |
-    * | .      .           .       .   |
-    *  -.------.-----------.-------.---
-    *   .      .           .       .
-    *   .      .............       .
-    *   .                          .
-    *   ............................
-    *   
-    * @param polylist an empty vector of ossimPolyArea2d that will be filled
-    * @return returns true if it successfully places polygons in the input vector
-    */
-   bool getCompletePolygons(vector<ossimPolyArea2d>& polyList)const;
-   
-   bool isEmpty()const;
-   bool isValid(bool displayValidationError = false)const;
-   bool isPointWithin(const ossimDpt& point)const;
-   bool isPointWithin(double x, double y)const;
-   void getBoundingRect(ossimDrect& rect);
-   
-   /**
-   * Returns the Well Known Text string
-   */
-   std::string toString()const;
-
-   /**
-    * @brief Buffers the ossimPolyArea2d shape and returns a copy. This method
-    * does not alter polygon.
-    *  
-    * @param distance is the distance to buffer the shape by. Positive values
-    * will expand the shape, and negative values will shrink the shape.
-    * @return A shape that is a buffered (expanded/contracted) version of this
-    * shape
-    */
-   ossimPolyArea2d getBufferedShape(double distance=FLT_EPSILON) const;
-   
-   ossimPolyArea2d& setToBufferedShape(double distance=FLT_EPSILON);
-
-   ossimPolyArea2d& toMultiPolygon();
-   bool saveState(ossimKeywordlist& kwl,
-                  const char* prefix=0)const;
-   bool loadState(const ossimKeywordlist& kwl,
-                  const char* prefix=0);
-   
-protected:
-   
-   void clearPolygons();
-   void recurseVisibleGeometries(ossimPolygon::Vector& polyList,
-                                 const geos::geom::Geometry* geom) const;
-   
-   void recurseHoles(ossimPolygon::Vector& polyList,
-                     const geos::geom::Geometry* geom) const;
-   
-   /**
-    * @brief Recurses over the Geometry object to load all complete polygons
-    * (a shell and any internal holes) into the ossimPolyArea2d.
-    */
-   void recurseCompleteGeometries(std::vector<ossimPolyArea2d>& polyList,
-                                  const geos::geom::Geometry* geom) const;
-   
-   OssimPolyArea2dPrivate* m_privateData;
-};
-
-#endif /* #ifndef ossimPolyArea2d_HEADER */
diff --git a/ossim/include/ossim/base/ossimPolygon.h b/ossim/include/ossim/base/ossimPolygon.h
deleted file mode 100644
index 625042d..0000000
--- a/ossim/include/ossim/base/ossimPolygon.h
+++ /dev/null
@@ -1,248 +0,0 @@
-//*****************************************************************************
-// FILE: ossimPolygon.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimPolygon.
-//   This class provides utilities associated with N-vertex, convex
-//   (i.e., only two intersections for any line passing through the polygon).
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimPolygon.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimPolygon_HEADER
-#define ossimPolygon_HEADER
-#include <iostream>
-#include <vector>
-using namespace std;
-
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <vector>
-class ossimLine;
-
-/******************************************************************************
- *
- * CLASS:  ossimPolygon
- *
- *****************************************************************************/
-class OSSIMDLLEXPORT ossimPolygon
-{
-public:
-  typedef std::vector<ossimPolygon> Vector;
-   ossimPolygon();
-   ossimPolygon(const vector<ossimIpt>& polygon);
-   ossimPolygon(const vector<ossimDpt>& polygon);
-   ossimPolygon(int numVertices, const ossimDpt* vertex_array);
-
-   ossimPolygon(const ossimPolygon& copy_this);
-   
-   /**
-    * CONSTRUCTOR: Provided for convenience. Does not imply the polygon is
-    * limited to four vertices:
-    */
-   ossimPolygon(ossimDpt v1,
-                ossimDpt v2,
-                ossimDpt v3,
-                ossimDpt v4);
-   
-   ossimPolygon(const ossimIrect& rect);
-   ossimPolygon(const ossimDrect& rect);
-
-   ~ossimPolygon();
-
-   ossimDpt& operator[](int index);
-   
-   const ossimDpt& operator[](int index)const;
-
-   ossim_uint32 getVertexCount()const;
-   
-   ossim_uint32 getNumberOfVertices()const;
-
-   //! Returns polygon area. Negative indicates CW ordering of vertices (in right-handed coordinates)
-   double area()const;
-
-   void getIntegerBounds(ossim_int32& minX,
-                         ossim_int32& minY,
-                         ossim_int32& maxX,
-                         ossim_int32& maxY)const;
-   void getFloatBounds(ossim_float64& minX,
-                       ossim_float64& minY,
-                       ossim_float64& maxX,
-                       ossim_float64& maxY)const;
-
-   void getBoundingRect(ossimIrect& rect)const;
-   void getBoundingRect(ossimDrect& rect)const;
-
-   /**
-    * Initializes minRect with the minimum area rect (not-necessarily
-    * aligned with axes) that bounds this polygon.
-    *
-    * @param minRect Polygon to initialize with the minimum rect.
-    */
-   void getMinimumBoundingRect(ossimPolygon& minRect) const;
-   
-   void roundToIntegerBounds(bool compress=false);
-
-   void clear();
-
-   void addPoint(const ossimDpt& pt);
-   void addPoint(double x, double y);
-
-   ossimDpt midPoint()const;
-   
-   /**
-    * will sequence through the polygon and check to see if any values are NAN
-    */
-   bool hasNans()const;
-
-   const vector<ossimDpt>& getVertexList()const;
-      
-   /**
-    * Uses the ossimPolyArea2d class for the intersection
-    */
-   bool clipToRect(vector<ossimPolygon>& result,
-                   const ossimDrect& rect)const;
-
-   
-   /**
-    * METHOD: clipLineSegment(p1, p2)
-    * Implements Cyrus-Beck clipping algorithm as described in:
-    * http://www.daimi.au.dk/~mbl/cgcourse/wiki/cyrus-beck_line-clipping_.html
-    * Clips the line segment defined by thw two endpoints provided. The
-    * endpoints are modified as needed to represent the clipped line. Returnes
-    * true if intersection present.
-    */
-   bool clipLineSegment(ossimDpt& p1, ossimDpt& p2) const;
-
-   /**
-    * METHOD: pointWithin(ossimDpt)
-    * Returns TRUE if point is inside polygon.
-    */
-   bool pointWithin(const ossimDpt& point) const;
-
-   bool isPointWithin(const ossimDpt& point) const;
-
-   /**
-   * METHOD: isRectWithin()
-   * Returns true if all the corner points of the given rect fit within.
-   */
-   bool isRectWithin(const ossimIrect &rect) const;
-
-   /**
-   * METHOD: isPolyWithin()
-   * Returns true if all the vertices of the given polygon fit within.
-   */
-   bool isPolyWithin(const ossimPolygon &poly) const;
-
-   /**
-    * METHOD: vertex(index)
-    * Returns the ossimDpt vertex given the index. Returns false if no vertex
-    * defined.
-    */
-   bool vertex(int index, ossimDpt& tbd_vertex) const;
-
-   /**
-    * METHOD: nextVertex()
-    * Assigns the ossimDpt tbd_vertex following the current vertex. The current
-    * vertex is initialized with a call to vertex(int), or after the last
-    * vertex is reached. Returns false if no vertex defined. Intended to be
-    * when cycling through all vertices.
-    */
-   bool nextVertex(ossimDpt& tbd_vertex) const;
-
-   void reverseOrder();
-   /**
-    * OPERATORS: (Some are inlined at bottom) 
-    */
-   const ossimPolygon& operator= (const ossimPolygon& copy_this);
-   const ossimPolygon& operator= (const vector<ossimDpt>& vertexList);
-   const ossimPolygon& operator= (const vector<ossimIpt>& vertexList);
-   const ossimPolygon& operator= (const ossimIrect& rect);
-   const ossimPolygon& operator= (const ossimDrect& rect);
-   bool                operator==(const ossimPolygon& compare_this) const;
-   bool                operator!=(const ossimPolygon& compare_this) const;
-
-   const ossimPolygon& operator *=(const ossimDpt& scale);
-   const ossimPolygon& operator *=(double scale);
-   
-   ossimPolygon operator *(const ossimDpt& scale)const;
-   ossimPolygon operator *(double scale)const;
-   
-   void resize(ossim_uint32 newSize);
-
-   /**
-    * METHOD: print()
-    */
-   void print(ostream& os) const;
-   friend ostream& operator<<(ostream&, const ossimPolygon&);
-
-
-   bool saveState(ossimKeywordlist& kwl,
-                  const char* prefix=0)const;
-   
-   bool loadState(const ossimKeywordlist& kwl,
-                  const char* prefix=0);
-
-   ossimVertexOrdering checkOrdering()const;
-
-   ossimVertexOrdering getOrdering()const;
-
-protected:
-   /**
-   * METHOD: getCentroid()
-   * Assigns the ossimDpt centroid the polygon.
-   * Warning: centroid is not guaranteed to be inside the polygon!
-    */
-   void getCentroid(ossimDpt &centroid) const;
-
-   /**
-   * METHOD: shrink()
-   * Shrinks the current polygon by inset, return true if success.
-    */
-   bool shrink(ossimPolygon &dest, double inset) const;
-   
-   /**
-   * METHOD: remove()
-   * Removes the vertex from the polygon.
-
-    */
-   void removeVertex(int vertex);
-   /**
-   * METHOD: removeSmallestContributingVertex()
-   * Removes the vertex that contributes the smallest area to the polygon.
-    */
-   void removeSmallestContributingVertex();
-
-   void intersectEdge(ossimDpt& result,
-                      const ossimLine& segment,
-                      const ossimDrect& rect,
-                      int edge);
-   
-   bool isInsideEdge(const ossimDpt& pt,
-                     const ossimDrect& rect,
-                     int edge)const;
-
-   /**
-   * Assigns destPt the point that fits a circle of given radius inside the polygon vertex.
-   * Warning: destPt is not guaranteed to be inside the polygon!
-   * (you may not be able to fit a circle of the given radius inside the polygon)
-   */
-   void fitCircleInsideVertex(ossimDpt &destPt, unsigned int vertex, double radius) const;
-
-   mutable ossimVertexOrdering theOrderingType;
-   vector<ossimDpt> theVertexList;
-   mutable ossim_int32 theCurrentVertex;
-};
-
-#endif /* End of "#ifndef ossimPolygon_HEADER" */
-
diff --git a/ossim/include/ossim/base/ossimProcessListener.h b/ossim/include/ossim/base/ossimProcessListener.h
deleted file mode 100644
index 639613d..0000000
--- a/ossim/include/ossim/base/ossimProcessListener.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// $Id: ossimProcessListener.h 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-#ifndef ossimProcessListener_HEADER
-#define ossimProcessListener_HEADER
-#include <ossim/base/ossimListener.h>
-
-class ossimProcessProgressEvent;
-
-class OSSIMDLLEXPORT ossimProcessListener : public ossimListener
-{
-public:
-   ossimProcessListener();
-   virtual ~ossimProcessListener();
-   virtual void processEvent(ossimEvent& event);
-   virtual void processProgressEvent(ossimProcessProgressEvent& event);
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimProcessProgressEvent.h b/ossim/include/ossim/base/ossimProcessProgressEvent.h
deleted file mode 100644
index 5550214..0000000
--- a/ossim/include/ossim/base/ossimProcessProgressEvent.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description: Event for process progress.
-//
-// $Id: ossimProcessProgressEvent.h 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-#ifndef ossimProcessProgressEvent_HEADER
-#define ossimProcessProgressEvent_HEADER
-
-#include <ossim/base/ossimEvent.h>
-#include <ossim/base/ossimString.h>
-
-class OSSIMDLLEXPORT ossimProcessProgressEvent : public ossimEvent
-{
-public:
-   ossimProcessProgressEvent(ossimObject* owner=NULL,
-                             double percentComplete=0.0,
-                             const ossimString message="",
-                             bool outputMessageFlag=false);
-
-   virtual ossimObject* dup()const;
-   
-   double getPercentComplete()const;
-   
-   ossimString getMessage()const;
-
-   void getMessage(ossimString& message)const;
-   
-   void setPercentComplete(double percentComplete);
-   
-   void setMessage(const ossimString& message);
-
-   void setOutputMessageFlag(bool flag);
-
-   bool getOutputMessageFlag() const;
-      
-protected:
-   double      thePercentComplete;
-   ossimString theMessage;
-   bool        theOutputMessageFlag;
-
-TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossimPropertyInterface.h b/ossim/include/ossim/base/ossimPropertyInterface.h
deleted file mode 100644
index 36c5b4c..0000000
--- a/ossim/include/ossim/base/ossimPropertyInterface.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// LICENSE: MIT see top level license.txt
-//
-// Author: Garrett Potts (gpotts at imagelinks)
-//
-//*************************************************************************
-// $Id: ossimPropertyInterface.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimPropertyInterface_HEADER
-#define ossimPropertyInterface_HEADER
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimProperty.h>
-
-
-class OSSIM_DLL ossimPropertyInterface
-{
-public:
-   ossimPropertyInterface()
-      {}
-   
-   virtual ~ossimPropertyInterface()
-      {}
-
-   virtual void setProperty(const ossimString& name,
-                            const ossimString& value);
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const; 
-	virtual ossimString getPropertyValueAsString(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   void getPropertyList(std::vector<ossimRefPtr<ossimProperty> >& propertyList)const;
-   void setProperties(std::vector<ossimRefPtr<ossimProperty> >& propertyList);
-   
-protected:
-   
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimRectanglePartitioner.h b/ossim/include/ossim/base/ossimRectanglePartitioner.h
deleted file mode 100644
index 2e7ba6a..0000000
--- a/ossim/include/ossim/base/ossimRectanglePartitioner.h
+++ /dev/null
@@ -1,148 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2004 David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// Utility class to partition up a rectangle.
-//
-// $Id: ossimRectanglePartitioner.h 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-#ifndef ossimRectanglePartitioner_HEADER
-#define ossimRectanglePartitioner_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <vector>
-
-class ossimIrect;
-
-/**
- * class ossimRectanglePartitioner
- * Utility class to partition up a rectangle.
- */
-class OSSIMDLLEXPORT ossimRectanglePartitioner
-{
-public:
-
-   /** default construtor */
-   ossimRectanglePartitioner();
-
-   /** destructor */
-   ~ossimRectanglePartitioner();
-
-   /**
-    * Partitions the rectangle doing a binary split on the longest dimension
-    * until the total size is less than or equal to the "maxSizeInBytes".
-    * Initializes "result" with the resulting rectangles starting at the
-    * upper left corner.
-    *
-    * @param inputRectangle The source rectangle usually the bounding rectangle
-    * of a scene.
-    *
-    * @param result The vector of ossimIrects to hold the result.
-    *
-    * @param maxSizeInBytes Maximum size of the resulting rectangle partitions
-    * in bytes.
-    *
-    * @param bands The number of bands in the image.
-    *
-    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
-    *
-    * @param internalOverlapPixels Overlap in pixels for desired partitions.
-    * (default = 0) This is added to all four sides of the rectangle so 
-    *
-    * @note The result rectangle passed in will be cleared for starters.
-    *
-    * @note Edge rectangles will be clipped to the inputRectangle.
-    */
-   void binaryPartition(const ossimIrect& inputRectangle,
-                        std::vector<ossimIrect>& result,
-                        ossim_uint64 maxSizeInBytes,
-                        ossim_uint32 bands,
-                        ossim_uint32 bytesPerPixel,
-                        ossim_uint32 internalOverlapPixels = 0) const;
-
-private:
-
-   /**
-    * Recursively splits the input rectangle until the size is less than
-    * or equal to maxSizeInBytes.
-    * 
-    * @param rect Input rectangle to split.
-    *
-    * @param maxSizeInBytes Maximum size of the resulting rectangle partitions
-    * in bytes.
-    *
-    * @param bands The number of bands in the image.
-    *
-    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
-    *
-    * @param internalOverlapPixels Overlap in pixels for desired partitions.
-    * (default = 0)
-    *
-    * @note Will split the longest dimension.  If square will split in the
-    * lengthwise direction.
-    */
-   void splitUntilLessThanMax(ossimIrect& rect,
-                              ossim_uint64 maxSizeInBytes,
-                              ossim_uint32 bands,
-                              ossim_uint32 bytesPerPixel,
-                              ossim_uint32 internalOverlapPixels = 0) const;
-
-   /**
-    * Splits rectangle in half rounding up if needed.
-    *
-    * @param input Rectangle to split.
-    *
-    * @note output will be a zero base rect.
-    *
-    * @notes Will split the longest dimension.  If square will split in the
-    * lengthwise direction.
-    */
-   void splitRect(ossimIrect& rect) const;
-
-   /**
-    * @param rect Rectangle to give size for in bytes.
-    *
-    * @param bands The number of bands in the image.
-    *
-    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
-    *
-    * @param internalOverlapPixels Overlap in pixels.
-    * (default = 0)
-    * 
-    * @return size of rectangle in bytes.
-    */
-   ossim_uint64 getSize(const ossimIrect& rect,
-                        ossim_uint32 bands,
-                        ossim_uint32 bytesPerPixel,
-                        ossim_uint32 internalOverlapPixels = 0) const;
-
-   /**
-    * Convenience trace method.
-    *
-    * @param r Input rectangle.
-    *
-    * @param v Vector of resulting partitioned rectangles.
-    *
-    * @param maxSizeInBytes Maximum size of the resulting rectangle partitions
-    * in bytes.
-    *
-    * @param bands The number of bands in the image.
-    *
-    * @param bytesPerPixel.  The number of bytes per pixel for a single band.
-    */
-   void trace(const ossimIrect& r,
-              const std::vector<ossimIrect>& v,
-              ossim_uint64 maxSizeInBytes,
-              ossim_uint32 bands,
-              ossim_uint32 bytesPerPixel) const;
-   
-};
-
-#endif /* End of "#ifndef ossimRectanglePartitioner_HEADER" */
-
diff --git a/ossim/include/ossim/base/ossimRectilinearDataObject.h b/ossim/include/ossim/base/ossimRectilinearDataObject.h
deleted file mode 100644
index b5d98c4..0000000
--- a/ossim/include/ossim/base/ossimRectilinearDataObject.h
+++ /dev/null
@@ -1,156 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRectilinearDataObject.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRectilinearDataObject_HEADER
-#define ossimRectilinearDataObject_HEADER
-#include <ossim/base/ossimDataObject.h>
-
-class OSSIMDLLEXPORT ossimRectilinearDataObject : public ossimDataObject
-{
-public:
-
-   /** default constructor */
-   ossimRectilinearDataObject();
-
-   ossimRectilinearDataObject(const ossimRectilinearDataObject&rhs);
-      
-   ossimRectilinearDataObject(ossim_uint32 numberOfSpatialComponents,
-                              ossimSource* owner,
-                              ossim_uint32 numberOfDataComponents,
-                              ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN,
-                              ossimDataObjectStatus status=OSSIM_NULL);
-   
-   /**
-    * This is a helper constructor that allows one to instantiate a one
-    * dimensional Spatial component with N number of data components.
-    * It will internally allocate theSpatialExtent to 1 and set the
-    * contents equal to the value passed in to length.
-    */
-   ossimRectilinearDataObject(ossimSource* owner,
-                              ossim_uint32 numberOfDataComponents,
-                              ossim_uint32 length,
-                              ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN,
-                              ossimDataObjectStatus status=OSSIM_NULL);
-
-   /**
-    * This is a helper constructor that allows one to instantiate a two
-    * dimensional Spatial component (WidthxHeight) with N number of
-    * data components.  It will internally allocate theSpatialExtent
-    * to 2 and set the contents equal to the value passed in to width, and
-    * height.
-    */
-   ossimRectilinearDataObject(ossimSource* owner,
-                              ossim_uint32 numberOfDataComponents,
-                              ossim_uint32 width,
-                              ossim_uint32 height,
-                              ossimScalarType scalarType=OSSIM_SCALAR_UNKNOWN,
-                              ossimDataObjectStatus status=OSSIM_NULL);
-
-   /**
-    * This is a helper constructor that allows one to instantiate a two
-    * dimensional Spatial component (WidthxHeightxDepth) with N number of
-    * data components.  It will internally allocate theSpatialExtent
-    * to 3 and set the contents equal to the value passed in to width,
-    * height, and depth.
-    */
-   ossimRectilinearDataObject(ossimSource* owner,
-                              ossim_uint32 numberOfDataComponents,
-                              ossim_uint32 width,
-                              ossim_uint32 height,
-                              ossim_uint32 depth,
-                              ossimScalarType   scalarType=OSSIM_SCALAR_UNKNOWN,
-                              ossimDataObjectStatus status=OSSIM_NULL);
-   
-
-   virtual ~ossimRectilinearDataObject();
-   /**
-    * How many components make up this data object.  For
-    * example:  If this were an RGB image data object then
-    * the number of components would be set to 3 and the
-    * RGB would be seen as a single data object being
-    * passed through.
-    */
-   virtual void setNumberOfDataComponents(ossim_uint32 n);
-   
-   virtual void setSpatialExtents(ossim_uint32* extents, ossim_uint32  size);
-
-   /**
-    *  See ossimScalarType in ossimConstants for a full list
-    *
-    *  OSSIM_SCALAR_UNKNOWN
-    *  OSSIM_UCHAR          Unsigned char
-    *  OSSIM_USHORT16       16bit unsigned short
-    *  OSSIM_SSHORT16       16bit signed short
-    *  OSSIM_USHORT11       11bit unsigned short
-    *  OSSIM_FLOAT          float
-    *  OSSIM_NORMALIZED_DOUBLE normalized 0 to 1 data
-    */
-   virtual void setScalarType(ossimScalarType type);
-
-   virtual ossim_uint32 getNumberOfDataComponents() const;
-
-   virtual ossim_uint32 getNumberOfSpatialComponents() const;
-
-   virtual const ossim_uint32* getSpatialExtents() const;
-
-   virtual ossimScalarType getScalarType() const;
-
-   virtual ossim_uint32 getScalarSizeInBytes()const;
-
-   virtual void*   getBuf();
-
-   virtual const void* getBuf() const;
-
-   virtual void assign(const ossimRectilinearDataObject* data);
-
-   /**
-    *  Initializes m_dataBuffer to current spatial extents.
-    *  
-    *  @notes
-    *
-    *  1) The underlying std::vector::resize() call with only be performed if
-    *  m_dataBuffer.size() is not equal to getDataSizeInBytes().
-    *
-    *  2) The status will be set to OSSIM_STATUS_UNKNOWN if a resize was
-    *  performed.
-    *
-    *  3) On error: catches std::bad_alloc exception and rethrows as
-    *  ossimException.
-    */
-   virtual void initialize();
-
-   virtual ossim_uint32 computeSpatialProduct()const;
-
-   virtual ossim_uint32 getDataSizeInBytes()const;
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief assignment operator=
-    * @param rhs The data to assign from.
-    * @param A reference to this object.
-    */
-   virtual const ossimRectilinearDataObject& operator=(
-      const ossimRectilinearDataObject& rhs);
-
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-protected:
-   ossim_uint32              m_numberOfDataComponents;
-   ossimScalarType           m_scalarType;
-   std::vector<ossim_uint8>  m_dataBuffer;
-   std::vector<ossim_uint32> m_spatialExtents;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimRefPtr.h b/ossim/include/ossim/base/ossimRefPtr.h
deleted file mode 100644
index 2fbec14..0000000
--- a/ossim/include/ossim/base/ossimRefPtr.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*-c++-*- ossim - Copyright (C) since 2004 Garrett Potts 
- *
- * This was taken directly from OpenSceneGraph and will retain OSGGPL license.
- * This is basically an MIT.
- * 
-*/
-#ifndef ossimRefPtr_HEADER
-#define ossimRefPtr_HEADER
-#include <ossim/base/ossimConstants.h>
-
-template<class T> class ossimRefPtr
-{
- public:
-   typedef T element_type;
-   
-   ossimRefPtr() :m_ptr(0) {}
-   ossimRefPtr(T* t):m_ptr(t)              { if (m_ptr) m_ptr->ref(); }
-   ossimRefPtr(const ossimRefPtr& rp):m_ptr(rp.m_ptr)  { if (m_ptr) m_ptr->ref(); }
-   ~ossimRefPtr()                           { if (m_ptr) m_ptr->unref(); m_ptr=0; }
-   
-   inline ossimRefPtr& operator = (const ossimRefPtr& rp)
-      {
-         if (m_ptr==rp.m_ptr) return *this;
-         T* tmpPtr = m_ptr;
-         m_ptr = rp.m_ptr;
-         if (m_ptr) m_ptr->ref();
-         // unref second to prevent any deletion of any object which might
-         // be referenced by the other object. i.e rp is child of the
-         // original _ptr.
-         if (tmpPtr) tmpPtr->unref();
-         return *this;
-      }
-   
-   inline ossimRefPtr& operator = (T* ptr)
-      {
-         if (m_ptr==ptr) return *this;
-         T* tmpPtr = m_ptr;
-         m_ptr = ptr;
-         if (m_ptr) m_ptr->ref();
-         // unref second to prevent any deletion of any object which might
-         // be referenced by the other object. i.e rp is child of the
-         // original m_ptr.
-         if (tmpPtr) tmpPtr->unref();
-         return *this;
-      }
-   
-   // comparison operators for ossimRefPtr.
-   inline bool operator == (const ossimRefPtr& rp) const { return (m_ptr==rp.m_ptr); }
-   inline bool operator != (const ossimRefPtr& rp) const { return (m_ptr!=rp.m_ptr); }
-   inline bool operator < (const ossimRefPtr& rp) const { return (m_ptr<rp.m_ptr); }
-   inline bool operator > (const ossimRefPtr& rp) const { return (m_ptr>rp.m_ptr); }
-   
-   // comparion operator for const T*.
-   inline bool operator == (const T* ptr) const { return (m_ptr==ptr); }
-   inline bool operator != (const T* ptr) const { return (m_ptr!=ptr); }
-   inline bool operator < (const T* ptr) const { return (m_ptr<ptr); }
-   inline bool operator > (const T* ptr) const { return (m_ptr>ptr); }
-   
-   inline T& operator*()  { return *m_ptr; }
-   
-   inline const T& operator*() const { return *m_ptr; }
-   
-   inline T* operator->() { return m_ptr; }
-   
-   inline const T* operator->() const   { return m_ptr; }
-   
-   inline bool operator!() const	{ return m_ptr==0L; }
-   
-   inline bool valid() const	{ return m_ptr!=0L; }
-   
-   inline T* get() { return m_ptr; }
-   
-   inline const T* get() const { return m_ptr; }
-   
-   /** take control over the object pointed to by ref_ptr, unreference but do not delete even if ref count goes to 0,
-    * return the pointer to the object.
-    * Note, do not use this unless you are 100% sure your code handles the deletion of the object correctly, and
-    * only use when absolutely required.*/
-   inline T* take() { return release();}
-   
-   inline T* release() { T* tmp=m_ptr; if (m_ptr) m_ptr->unref_nodelete(); m_ptr=0; return tmp;}
-   
- private:
-   T* m_ptr;
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimReferenced.h b/ossim/include/ossim/base/ossimReferenced.h
deleted file mode 100644
index 9337695..0000000
--- a/ossim/include/ossim/base/ossimReferenced.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*-c++-*- libossim - Copyright (C) since 2004 Garrett Potts 
- * LICENSE: MIT
- * Author: Garrett Potts
-*/
-#ifndef ossimReferenced_HEADER
-#define ossimReferenced_HEADER
-#include <ossim/base/ossimConstants.h>
-#include <OpenThreads/ScopedLock>
-#include <OpenThreads/Mutex>
-
-class OSSIMDLLEXPORT ossimReferenced
-{
- public:
-   ossimReferenced()
-   : theRefMutex(new OpenThreads::Mutex),
-     theRefCount(0)
-      {}
-   
-   ossimReferenced(const ossimReferenced&)
-   : theRefMutex(new OpenThreads::Mutex),
-   theRefCount(0)
-   {}
-   inline ossimReferenced& operator = (const ossimReferenced&) { return *this; }
-   
-
-   /*! increment the reference count by one, indicating that 
-       this object has another pointer which is referencing it.*/
-   inline void ref() const;
-   
-   /*! decrement the reference count by one, indicating that 
-       a pointer to this object is referencing it.  If the
-       reference count goes to zero, it is assumed that this object
-       is no longer referenced and is automatically deleted.*/
-   inline void unref() const;
-   
-   /*! decrement the reference count by one, indicating that 
-       a pointer to this object is referencing it.  However, do
-       not delete it, even if ref count goes to 0.  Warning, unref_nodelete() 
-       should only be called if the user knows exactly who will
-       be resonsible for, one should prefer unref() over unref_nodelete() 
-       as the later can lead to memory leaks.*/
-   inline void unref_nodelete() const 
-   { 
-      if (theRefMutex)
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*theRefMutex); 
-         --theRefCount;
-      }
-      else
-      {
-         --theRefCount;
-      }
-   }
-   
-   /*! return the number pointers currently referencing this object. */
-   inline int referenceCount() const { return theRefCount; }
-   
-   
- protected:
-   virtual ~ossimReferenced();
-   mutable OpenThreads::Mutex*     theRefMutex;
-   mutable int theRefCount;
-};
-
-inline void ossimReferenced::ref() const
-{
-   if (theRefMutex)
-   {
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*theRefMutex); 
-      ++theRefCount;
-   }
-   else
-   {
-      ++theRefCount;
-   }
-}
-
-inline void ossimReferenced::unref() const
-{
-   bool needDelete = false;
-   if (theRefMutex)
-   {
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*theRefMutex); 
-      --theRefCount;
-      needDelete = theRefCount<=0;
-   }
-   else
-   {
-      --theRefCount;
-      needDelete = theRefCount<=0;
-   }
-   
-   if (needDelete)
-   {
-      delete this;
-   }
-   
-#if 0
-    --theRefCount;
-    if (theRefCount==0)
-    {
-        delete this;
-    }
-#endif
-}
-
-#endif
diff --git a/ossim/include/ossim/base/ossimRegExp.h b/ossim/include/ossim/base/ossimRegExp.h
deleted file mode 100644
index 70371f8..0000000
--- a/ossim/include/ossim/base/ossimRegExp.h
+++ /dev/null
@@ -1,264 +0,0 @@
-//
-// Copyright (C) 1991 Texas Instruments Incorporated.
-//
-// Permission is granted to any individual or institution to use, copy, modify,
-// and distribute this software, provided that this complete copyright and
-// permission notice is maintained, intact, in all copies and supporting
-// documentation.
-//
-// Texas Instruments Incorporated provides this software "as is" without
-// express or implied warranty.
-//
-// .NAME CoolRegExp - Pattern matching with regular expressions.
-// .LIBRARY cool
-// .HEADER String Classes
-// .INCLUDE cool/RegExp.h
-// .FILE cool/RegExp.C
-// .FILE cool/RegExp.h
-// .EXAMPLE examples/ex_RegExp.C
-//
-//
-// .SECTION Description
-//  A regular expression allows a programmer to specify  complex
-//  patterns  that  can  be searched for and matched against the
-//  character string of a string object. In its simplest form, a
-//  regular  expression  is  a  sequence  of  characters used to
-//  search for exact character matches. However, many times  the
-//  exact  sequence to be found is not known, or only a match at
-//  the beginning or end of a string is desired. The cool  regu-
-//  lar  expression  class implements regular expression pattern
-//  matching as is found and implemented in many  UNIX  commands
-//  and utilities.
-//
-//  The regular expression class provides a convenient mechanism
-//  for  specifying  and  manipulating  regular expressions. The
-//  regular expression object allows specification of such  pat-
-//  terns  by using the following regular expression metacharac-
-//  ters:
-// 
-//   ^        Matches at beginning of a line
-//
-//   $        Matches at end of a line
-//
-//  .         Matches any single character
-//
-//  [ ]       Matches any character(s) inside the brackets
-//
-//  [^ ]      Matches any character(s) not inside the brackets
-//
-//   -        Matches any character in range on either side of a dash
-//
-//   *        Matches preceding pattern zero or more times
-//
-//   +        Matches preceding pattern one or more times
-//
-//   ?        Matches preceding pattern zero or once only
-//
-//  ()        Saves a matched expression and uses it in a  later match
-// 
-//  Note that more than one of these metacharacters can be  used
-//  in  a  single  regular expression in order to create complex
-//  search patterns. For example, the pattern [^ab1-9]  says  to
-//  match  any  character  sequence that does not begin with the
-//  characters "ab"  followed  by  numbers  in  the  series  one
-//  through nine.
- 
-
-#ifndef ossimRegExph
-#define ossimRegExph
-
-#include <ossim/base/ossimString.h>
-
-const int NSUBEXP = 10;
-
-
-class OSSIMDLLEXPORT ossimRegExp {
-public:
-  inline ossimRegExp ();			// ossimRegExp with program=NULL
-  inline ossimRegExp (const char*);	// ossimRegExp with compiled char*
-  ossimRegExp (const ossimRegExp&);	// Copy constructor
-  inline ~ossimRegExp();			// Destructor 
-
-  void compile (const char*);		// Compiles char* --> regexp
-  bool find (const char*);		// true if regexp in char* arg
-  inline ossim_uint32 start() const;	// Index to start of first find
-  inline ossim_uint32 end() const;	// Index to end of first find
-
-  bool operator== (const ossimRegExp&) const;	// Equality operator
-  inline bool operator!= (const ossimRegExp&) const; // Inequality operator
-  bool deep_equal (const ossimRegExp&) const;	// Same regexp and state?
-  
-  inline bool is_valid() const;		// true if compiled regexp
-  inline void set_invalid();		// Invalidates regexp
-
-  // awf added
-  ossim_uint32 start(ossim_uint32 n) const;
-  ossim_uint32 end(ossim_uint32 n) const;
-  std::string match(ossim_uint32 n) const;
-  
-private: 
-  const char* startp[NSUBEXP];
-  const char* endp[NSUBEXP];
-  char  regstart;			// Internal use only
-  char  reganch;			// Internal use only
-  const char* regmust;			// Internal use only
-  ossim_uint32 regmlen;			// Internal use only
-  char* program;   
-  ossim_uint32 progsize;
-  const char* searchstring;
-
- // work variables
-  mutable const char* regparse;
-  mutable int   regnpar;	// () count.
-  mutable char  regdummy;
-  mutable char* regcode;	// Code-emit pointer; &regdummy = don't.
-  mutable long  regsize;	// Code size.
-  const char*  reginput;	// String-input pointer.
-  const char*  regbol;	// Beginning of input, for ^ check.
-  const char* *regstartp;	// Pointer to startp array.
-  const char* *regendp;	// Ditto for endp.
-
-  char* reg (int, int*);
-  char* regbranch (int*);
-  char* regpiece (int*);
-  char* regatom (int*);
-  char* regnode (char);
-  const char* regnext (register const char*);
-  char* regnext (register char*);
-  void        regc (unsigned char);
-  void        reginsert (char, char*);
-  void        regtail (char*, const char*);
-  void        regoptail (char*, const char*);
-  int regtry (const char*, const char* *,
-              const char* *, const char*);
-  int regmatch (const char*);
-  int regrepeat (const char*);
-#ifdef STRCSPN
-  int strcspn ();
-#endif
-  
-}; 
-
-// ossimRegExp -- Creates an empty regular expression.
-
-inline ossimRegExp::ossimRegExp ():
-  regstart(0),     // Internal use only
-  reganch(0),      // Internal use only
-  regmust(0),      // Internal use only
-  regmlen(0),     // Internal use only
-  program(0),   
-  progsize(0),
-  searchstring(0),
-
- // work variables
-  regparse(0),
-  regnpar(0),  // () count.
-  regdummy(0),
-  regcode(0),  // Code-emit pointer; &regdummy = don't.
-  regsize(0),  // Code size.
-  reginput(0),  // String-input pointer.
-  regbol(0),  // Beginning of input, for ^ check.
-  regstartp(0), // Pointer to startp array.
-  regendp(0) // Ditto for endp.
-{ 
-}
-
-
-// ossimRegExp -- Creates a regular expression from string s, and
-// compiles s.
-
-
-inline ossimRegExp::ossimRegExp (const char* s) :
-  regstart(0),     // Internal use only
-  reganch(0),      // Internal use only
-  regmust(0),      // Internal use only
-  regmlen(0),     // Internal use only
-  program(0),   
-  progsize(0),
-  searchstring(0),
-
- // work variables
-  regparse(0),
-  regnpar(0),  // () count.
-  regdummy(0),
-  regcode(0),  // Code-emit pointer; &regdummy = don't.
-  regsize(0),  // Code size.
-  reginput(0),  // String-input pointer.
-  regbol(0),  // Beginning of input, for ^ check.
-  regstartp(0), // Pointer to startp array.
-  regendp(0) // Ditto for endp.
-{  
-  this->program = NULL;
-  compile(s);
-}
-
-// ~ossimRegExp -- Frees space allocated for regular expression.
-
-inline ossimRegExp::~ossimRegExp () {
-//#ifndef WIN32
-   if(program)
-   {
-      delete [] this->program;
-      this->program = 0;
-   }
-//#endif
-}
-
-// Start -- 
-
-inline ossim_uint32 ossimRegExp::start () const {
-  return(this->startp[0] - searchstring);
-}
-
-
-// End -- Returns the start/end index of the last item found.
-
-
-inline ossim_uint32 ossimRegExp::end () const {
-  return(this->endp[0] - searchstring);
-}
-
-
-// operator!= //
-
-inline bool ossimRegExp::operator!= (const ossimRegExp& r) const {
-  return(!(*this == r));
-}
-
-
-// is_valid -- Returns true if a valid regular expression is compiled
-// and ready for pattern matching.
-
-inline bool ossimRegExp::is_valid () const {
-  return (this->program != NULL);
-}
-
-
-// set_invalid -- Invalidates regular expression.
-
-inline void ossimRegExp::set_invalid () {
-//#ifndef WIN32
-  delete [] this->program;
-//#endif
-  this->program = NULL;
-}
-
-// -- Return start index of nth submatch. start(0) is the start of the full match.
-inline ossim_uint32 ossimRegExp::start(ossim_uint32 n) const
-{
-  return this->startp[n] - searchstring;
-}
-
-// -- Return end index of nth submatch. end(0) is the end of the full match.
-inline ossim_uint32 ossimRegExp::end(ossim_uint32 n) const
-{
-  return this->endp[n] - searchstring;
-}
-
-// -- Return nth submatch as a string.
-inline std::string ossimRegExp::match(ossim_uint32 n) const
-{
-	return std::string(this->startp[n], this->endp[n] - this->startp[n]);
-}
-
-#endif // CoolRegExph
diff --git a/ossim/include/ossim/base/ossimStdOutProgress.h b/ossim/include/ossim/base/ossimStdOutProgress.h
deleted file mode 100644
index b3e4a1d..0000000
--- a/ossim/include/ossim/base/ossimStdOutProgress.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimStdOutProgress.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimStdOutProgress_HEADER
-#define ossimStdOutProgress_HEADER
-
-#include <ossim/base/ossimProcessListener.h>
-#include <ossim/base/ossimProcessProgressEvent.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-class OSSIM_DLL ossimStdOutProgress : public ossimProcessListener
-{
-public:
-   ossimStdOutProgress(ossim_uint32 precision = 0, bool flushStream=false);
-
-   virtual void processProgressEvent(ossimProcessProgressEvent& event);
-      
-   virtual void setFlushStreamFlag(bool flag);
-
-protected:
-   ossim_uint32 thePrecision;
-   bool         theFlushStreamFlag;
-TYPE_DATA
-};
-
-OSSIM_DLL extern ossimStdOutProgress theStdOutProgress;
-#endif
-
diff --git a/ossim/include/ossim/base/ossimStreamFactory.h b/ossim/include/ossim/base/ossimStreamFactory.h
deleted file mode 100644
index 4bf19d0..0000000
--- a/ossim/include/ossim/base/ossimStreamFactory.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//
-//*******************************************************************
-//  $Id: ossimStreamFactory.h 23664 2015-12-14 14:17:27Z dburken $
-//
-#ifndef ossimStreamFactory_HEADER
-#define ossimStreamFactory_HEADER
-#include <ossim/base/ossimStreamFactoryBase.h>
-#include <ossim/base/ossimIoStream.h>
-
-class OSSIM_DLL ossimStreamFactory : public ossimStreamFactoryBase
-{
-public:
-   static ossimStreamFactory* instance();
-   virtual ~ossimStreamFactory();
- 
-   virtual ossimRefPtr<ossimIFStream>
-      createNewIFStream(const ossimFilename& file,
-                        std::ios_base::openmode openMode) const;
-
-   
-protected:
-   ossimStreamFactory();
-   ossimStreamFactory(const ossimStreamFactory&);
-   static ossimStreamFactory* theInstance;
-   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimStreamFactoryBase.h b/ossim/include/ossim/base/ossimStreamFactoryBase.h
deleted file mode 100644
index 24d8bf7..0000000
--- a/ossim/include/ossim/base/ossimStreamFactoryBase.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//
-//*******************************************************************
-//  $Id: ossimStreamFactoryBase.h 23664 2015-12-14 14:17:27Z dburken $
-//
-#ifndef ossimStreamFactoryBase_HEADER
-#define ossimStreamFactoryBase_HEADER
-
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimIoStream.h>
-
-class ossimFilename;
-class ossimIStream;
-
-class OSSIM_DLL ossimStreamFactoryBase
-{
-public:
-   virtual ~ossimStreamFactoryBase(){}
-   
-   virtual ossimRefPtr<ossimIFStream> createNewIFStream(
-      const ossimFilename& file,
-      std::ios_base::openmode openMode)const=0;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimStreamFactoryRegistry.h b/ossim/include/ossim/base/ossimStreamFactoryRegistry.h
deleted file mode 100644
index 96e898c..0000000
--- a/ossim/include/ossim/base/ossimStreamFactoryRegistry.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimStreamFactoryRegistry.h 22648 2014-02-28 14:34:29Z gpotts $
-//
-#ifndef ossimStreamFactoryRegistry_HEADER
-#define ossimStreamFactoryRegistry_HEADER
-#include <vector>
-
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/base/ossimStreamFactoryBase.h>
-
-
-class OSSIM_DLL ossimStreamFactoryRegistry : public ossimStreamFactoryBase
-{
-public:
-   static ossimStreamFactoryRegistry* instance();
-   virtual ~ossimStreamFactoryRegistry();
-   
-   void registerFactory(ossimStreamFactoryBase* factory);
-   
-   virtual ossimRefPtr<ossimIFStream> createNewIFStream(
-      const ossimFilename& file, std::ios_base::openmode openMode) const;
-   
-protected:
-   ossimStreamFactoryRegistry();
-private:
-   /** @brief copy constructor hidden from use */
-   ossimStreamFactoryRegistry(const ossimStreamFactoryRegistry&);
-   
-   std::vector<ossimStreamFactoryBase*> theFactoryList;
-   static ossimStreamFactoryRegistry* theInstance;
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimString.h b/ossim/include/ossim/base/ossimString.h
deleted file mode 100644
index d7a869d..0000000
--- a/ossim/include/ossim/base/ossimString.h
+++ /dev/null
@@ -1,936 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: This class extends the stl's string class.
-//
-//********************************************************************
-// $Id: ossimString.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimString_HEADER
-#define ossimString_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <string>
-#include <vector>
-#include <iostream>
-
-
-class OSSIM_DLL ossimString
-{
-public:
-
-   typedef std::string::const_iterator const_iterator;
-   typedef std::string::iterator       iterator;
-   typedef std::string::size_type      size_type;
-
-   /** @brief default constructor */
-   ossimString(): m_str() {}
-
-   /** @brief constructor that takes a std::string */
-   ossimString(const std::string& s):m_str(s) {}
-
-   /**
-    * @brief constructor that takes char*
-    * NOTE: std::string construtor throws exception given null pointer;
-    * hence, the null check.
-    */
-   ossimString(const char *aString):m_str( aString?aString:"" ){}
-
-   /** @brief copy constructor */
-   ossimString(const ossimString& aString):m_str(aString.m_str){}
-
-   /** @brief constructor - constructs with n copies of c */
-   ossimString(std::string::size_type n, char c):m_str(n,c){}
-
-   /** @brief constructor - constructs with 1 c. */
-   ossimString(char aChar):m_str(1, aChar){}
-
-   template <class Iter>
-   ossimString(Iter startIter, Iter endIter):m_str(startIter, endIter){}
-
-   /** @brief destructor */
-   ~ossimString(){}
-
-   bool contains(const ossimString& aString) const
-   { return m_str.find(aString.m_str)!=std::string::npos; }
-
-   bool contains(const char* aString) const
-   { return m_str.find(aString)!=std::string::npos; }
-
-   /** @brief Type conversion operator to a const std::string&. */
-   operator const std::string&() const { return m_str; }
-
-   /** @brief Type conversion operator to a std::string&. */
-   operator std::string&() { return m_str; }
-
-   /** @brief Type conversion operator to a const char*. */
-   operator const char*() const { return m_str.c_str(); }
-
-   /** @brief For backward compatibility. */
-   const char* chars() const { return m_str.c_str(); }
-
-   /** @brief Reads s from the input stream is. */
-   friend OSSIM_DLL std::istream& operator>>(std::istream&  is, ossimString& s);
-
-   /** @brief Writes s to the output stream os. */
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& os,
-                                             const ossimString& s);
-
-   /**
-    * @brief Reads a string from the input stream is, stopping when it
-    * reaches delim.
-    */
-   friend OSSIM_DLL std::istream& getline( std::istream& is,
-                                           ossimString& str,
-                                           char delim );
-
-   /** @brief Reads a single line from the input stream is. */
-   friend OSSIM_DLL std::istream& getline( std::istream& is, ossimString& str );
-
-   const ossimString& operator=(const std::string& s)
-   {
-      m_str = s;
-      return *this;
-   }
-
-   const ossimString& operator=(const char* s)
-   {
-      if (s) // std::string::operator= throws exception given null pointer.
-      {
-         m_str = s;
-      }
-      else
-      {
-         m_str = "";
-      }
-      return *this;
-   }
-
-   const ossimString& operator=(char c)
-   {
-      m_str = c;
-      return *this;
-   }
-
-   const ossimString& operator=(const ossimString& s)
-   {
-      if ( this != &s )
-      {
-         m_str = s.m_str;
-      }
-      return *this;
-   }
-
-   const ossimString& operator+=(const ossimString& s)
-   {
-      m_str.append(s.m_str);
-      return *this;
-   }
-
-   const ossimString& operator+=(const std::string& s)
-   {
-      m_str.append(s);
-      return *this;
-   }
-
-   const ossimString& operator+=(const char* s)
-   {
-      if ( s ) m_str.append(s);
-      return *this;
-   }
-
-   const ossimString& operator+=(char c)
-   {
-      m_str.append(1, c);
-      return *this;
-   }
-
-   const ossimString& append(const ossimString& s);
-
-   const ossimString& append(const std::string& s);
-
-   const ossimString& append(const char* s);
-
-   /**
-    *  @brief  Provides access to the data contained in the %string.
-    *  @param n The index of the character to access.
-    *  @return  Read-only (const) reference to the character.
-    *  @throw  std::out_of_range  If @a n is an invalid index.
-    *
-    *  This function provides for safer data access.  The parameter is
-    *  first checked that it is in the range of the string.  The function
-    *  throws out_of_range if the check fails.
-    */
-   const char& at(std::string::size_type n) const;
-
-   /**
-    *  @brief  Provides access to the data contained in the %string.
-    *  @param n The index of the character to access.
-    *  @return  Read/write reference to the character.
-    *  @throw  std::out_of_range  If @a n is an invalid index.
-    *
-    *  This function provides for safer data access.  The parameter is
-    *  first checked that it is in the range of the string.  The function
-    *  throws out_of_range if the check fails.  Success results in
-    *  unsharing the string.
-    */
-   char& at(std::string::size_type n);
-
-   /** @brief Append n copies of c to *this. */
-   const ossimString& append(std::string::size_type n, char c);
-
-   ossimString operator+(const ossimString& s)const
-   {
-      ossimString returnS(*this);
-      returnS.m_str.append(s.m_str);
-      return returnS;
-   }
-
-   ossimString operator+(const std::string& s)const
-   {
-      ossimString returnS(*this);
-      returnS.m_str.append(s);
-      return returnS;
-   }
-
-   ossimString operator+(const char* s)const
-   {
-      ossimString returnS(*this);
-      if ( s ) returnS.m_str.append(s);
-      return returnS;
-   }
-
-   ossimString operator+(char c)const
-   {
-      ossimString returnS(*this);
-      returnS.m_str.append(1, c);
-      return returnS;
-   }
-
-   friend OSSIM_DLL ossimString operator+(const char* s1, const ossimString& s2);
-
-   friend OSSIM_DLL ossimString operator+(const std::string s1, const ossimString& s2);
-
-   friend OSSIM_DLL ossimString operator+(char c, const ossimString& s2);
-   friend OSSIM_DLL bool operator==(const char* lhs, const ossimString& rhs);
-   friend OSSIM_DLL bool operator==(const std::string& lhs, const ossimString& rhs);
-
-   /**
-    *  @brief  Test if this ossimString is equal to another ossimString.
-    *  @param rhs ossimString to compare.
-    *  @return  True if strings are equal.  False otherwise.
-    */
-   bool operator==(const ossimString& rhs) const
-   {
-      return (m_str.compare( rhs.m_str ) == 0);
-   }
-
-   /**
-    *  @brief  Test if this ossimString is equal to a C sting.
-    *  @param rhs C string to compare.
-    *  @return  True if strings are equal.
-    *  False if rhs is not equal null or null.
-    */
-   bool operator==(const char* rhs) const
-   {
-      bool result = false;
-      if (rhs)
-      {
-         result = (m_str.compare(std::string(rhs)) == 0);
-      }
-      return result;
-   }
-
-   /**
-    *  @brief  Test if this ossimString is not equal to another ossimString.
-    *  @param rhs ossimString to compare.
-    *  @return  True if strings are not equal.  False otherwise.
-    */
-   bool operator!=(const ossimString& rhs) const
-   {
-      return !(m_str.compare(rhs.m_str) == 0);
-   }
-
-   /**
-    *  @brief  Test if this ossimString is not equal to a C sting.
-    *  @param rhs C string to compare.
-    *  @return  True if strings are not equal or rhs is null.
-    *  False if rhs equal to this string.
-    */
-   bool operator!=(const char* rhs) const
-   {
-      bool result = true;
-      if (rhs)
-      {
-         result = !(m_str.compare(std::string(rhs)) == 0);
-      }
-      return result;
-   }
-
-   char& operator[](std::string::size_type i)
-   {
-      return m_str[i];
-      // return *( const_cast<char*>(m_strc_str())+i);
-   }
-
-   const char& operator[](std::string::size_type i)const
-   {
-      return m_str[i];
-   }
-
-   /**
-    * @brief If pos > size(), throws out_of_range. Otherwise, equivalent to
-    * insert(begin() + pos, s, s + traits::length(s)).
-    */
-   std::string& insert(std::string::size_type pos, const char* s);
-
-   /** @brief Equivalent to insert(end(), c). */
-   void push_back(char c);
-
-   /** @brief Equivalent to basic_string(*this, pos, n). */
-   std::string substr(std::string::size_type pos = 0,
-                      std::string::size_type n = std::string::npos) const;
-
-   /**
-    * this will strip lead and trailing character passed in.
-    * So if you want to remove blanks:
-    *    ossimString temp("       asdfasdf      ");
-    *    ossimString trimmedString = temp.trim(" \n\t\r");
-    *
-    *    this will now contain "asdfasdf" without the blanks.
-    *
-    */
-   ossimString trim(const ossimString& valueToTrim= ossimString(" \t\n\r"))const;
-   ossimString& trim(const ossimString& valueToTrim= ossimString(" \t\n\r"));
-
-   ossimString beforePos(std::string::size_type pos)const;
-    ossimString afterPos(std::string::size_type pos)const;
-
-   /**
-    *  Substitutes searchKey string with replacementValue and returns a
-    *  string.  Will replace all occurrences found if "replaceAll" is true.
-    */
-   ossimString substitute(const ossimString &searchKey,
-                                  const ossimString &replacementValue,
-                                  bool replaceAll=false)const;
-
-   /**
-    *  Substitutes searchKey string with replacementValue and returns a
-    *  reference to *this.  Will replace all occurrences found if
-    *  "replaceAll" is true.  (like substitute only works on "this")
-    */
-   ossimString& gsub(const ossimString &searchKey,
-                             const ossimString &replacementValue,
-                             bool replaceAll=false);
-
-   std::vector<ossimString> explode(const ossimString& delimeter) const;
-
-   /**
-    * If the variable "$(env_var_name)" is found in the string, where
-    * "env_var_name" is any system environment variable resolvable by
-    * the getenv() function, the variable is expanded in place and the
-    * result returned.
-    */
-   ossimString expandEnvironmentVariable() const;
-
-   /**
-    * @param aString String to make an upcased copy of.
-    *
-    * @return An upcased version of aString.
-    */
-   static ossimString upcase(const ossimString& aString);
-
-   /**
-    * @param aString String to make an downcased copy of.
-    *
-    * @return A downcased version of aString.
-    */
-   static ossimString downcase(const ossimString& aString);
-
-   /**
-    * Upcases this string.
-    *
-    * @return Reference to this.
-    */
-   ossimString& upcase();
-   ossimString upcase()const;
-
-   /**
-    * Downcases this string.
-    *
-    * @return Reference to this.
-    */
-   ossimString& downcase();
-   ossimString downcase()const;
-
-   /**
-    * @brief Returns a pointer to a null-terminated array of characters
-    * representing the string's contents.
-    */
-   const char* c_str() const { return m_str.c_str(); }
-
-   /**
-    * @brief Returns a pointer to an array of characters (not necessarily
-    * null-terminated) representing the string's contents.
-    */
-   const char* data() const { return m_str.data(); }
-
-   /** @return The size of the string. */
-   std::string::size_type size() const { return m_str.size(); }
-
-   /** @return The size of the string. */
-   std::string::size_type length() const { return m_str.size(); }
-
-   /** @return True if size is 0. */
-   bool empty() const { return m_str.empty(); }
-
-   /** @return The underlying std::string container. */
-   const std::string& string() const { return m_str; }
-
-   /** @return The underlying std::string container. */
-   std::string& string() { return m_str; }
-
-   /** @return An iterator pointing to the beginning of the string. */
-   std::string::iterator begin() { return m_str.begin(); }
-
-   /** @return An iterator pointing to the end of the string. */
-   std::string::iterator end() { return m_str.end(); }
-
-   /** @return An const_iterator pointing to the beginning of the string. */
-   std::string::const_iterator begin() const { return m_str.begin(); }
-
-   /** @return An const_iterator pointing to the end of the string. */
-   std::string::const_iterator end() const { return m_str.end(); }
-
-   /** @brief Erases the entire container. */
-   void clear() { m_str.clear(); }
-
-   /** @brief Erases the character at position p. */
-   std::string::iterator erase(std::string::iterator p);
-
-   /** @brief Erases the range [first, last). */
-   std::string::iterator erase(std::string::iterator first,
-                               std::string::iterator last);
-
-   /** @brief Erases a range. */
-   std::string& erase(std::string::size_type pos = 0,
-                      std::string::size_type n = std::string::npos);
-
-   /**
-    * @brief Searches for s as a substring of *this, beginning at character
-    * pos of *this.
-    */
-   std::string::size_type find(const std::string& s,
-                               std::string::size_type pos = 0) const;
-
-   /**
-    * @brief Searches for the first n characters of s as a substring of *this,
-    * beginning at character pos of *this.
-    */
-   std::string::size_type find(const char* s,
-                               std::string::size_type pos,
-                               std::string::size_type n) const;
-
-   /**
-    * @brief Searches for a null-terminated character array as a substring
-    * of *this, beginning at character pos of *this.
-    */
-   std::string::size_type find(const char* s,
-                               std::string::size_type pos = 0) const;
-
-   /**
-    * @brief Searches for the character c, beginning at character position
-    * pos.
-    */
-   std::string::size_type find(char c, std::string::size_type pos = 0) const;
-
-    /**
-    * @brief Searches backward for s as a substring of *this, beginning at
-    * character position min(pos, size()).
-    */
-   std::string::size_type rfind(const std::string& s,
-                                std::string::size_type pos = 0) const;
-
-   /**
-    * @brief Searches backward for the first n characters of s as a substring
-    * of *this, beginning at character position min(pos, size()).
-    */
-   std::string::size_type rfind(const char* s,
-                                std::string::size_type pos,
-                                std::string::size_type n) const;
-
-   /**
-    * @brief Searches backward for a null-terminated character array as a
-    * substring of *this, beginning at character min(pos, size()).
-    */
-   std::string::size_type rfind(const char* s,
-                                std::string::size_type pos = 0) const;
-
-   /**
-    * @brief Searches backward for the character c, beginning at character
-    * position min(pos, size().
-    */
-   std::string::size_type rfind(char c, std::string::size_type pos = 0) const;
-
-   /** @brief Equivalent to find(c, pos). */
-   std::string::size_type find_first_of(
-      char c, std::string::size_type pos = 0) const;
-
-   /**
-    * @brief Returns the smallest character position N such that
-    * pos <= N < size(), and such that (*this)[N] does not compare equal to c.
-    * Returns npos if no such character position exists.
-    */
-   std::string::size_type find_first_not_of(
-      char c, std::string::size_type pos = 0) const;
-
-   /**
-    * @brief Equivalent to find_first_of(s, pos, traits::length(s)).
-    */
-   std::string::size_type find_first_of(
-      const char* s, std::string::size_type pos = 0) const;
-
-      /**
-    * @brief Equivalent to find_first_not_of(s, pos, traits::length(s)).
-    */
-   std::string::size_type find_first_not_of(
-      const char* s, std::string::size_type pos = 0) const;
-
-   /** @brief Equivalent to rfind(c, pos). */
-   std::string::size_type find_last_of(
-      char c, std::string::size_type pos = std::string::npos) const;
-
-   /**
-    * @brief Erases the existing characters and replaces them by n copies
-    * of c.
-    */
-   std::string& assign(std::string::size_type n, char c);
-
-   /** @brief Replaces a substring of *this with the string s. */
-   std::string& replace(std::string::size_type pos,
-                        std::string::size_type n,
-                        const std::string& s);
-
-   /** brief Equivalent to insert(erase(first, last), s.begin(), s.end()). */
-   std::string& replace(std::string::iterator first,
-                        std::string::iterator last,
-                        const std::string& s);
-
-   /** @brief Replaces a substring of *this with a substring of s. */
-   std::string& replace(std::string::size_type pos,
-                        std::string::size_type n,
-                        const std::string& s,
-                        std::string::size_type pos1,
-                        std::string::size_type n1);
-
-   /** @brief Requests that the string's capacity be changed. */
-   void reserve(std::string::size_type n);
-
-   /**
-    * METHOD: before(str, pos)
-    * Returns string beginning at pos and ending one before the token str
-    * If string not found or pos out of range the whole string will be
-    * returned.
-    */
-   ossimString before(const ossimString& str, std::string::size_type pos=0)const;
-
-   /**
-    * METHOD: after(str, pos)
-    * Returns string immediately after the token str. The search for str
-    * begins at pos.  Returns an empty string if not found or pos out of
-    * range.
-    */
-   ossimString after (const ossimString& str, std::string::size_type pos=0)const;
-
-   char* stringDup()const;
-
-   /**
-    * String to numeric methods.
-    */
-   bool                 toBool()const;
-   static bool          toBool(const ossimString& aString);
-
-   ossim_uint8          toUInt8()const;
-   static ossim_uint8   toUInt8(const ossimString& aString);
-
-   int                  toInt()const;
-   static int           toInt(const ossimString& aString);
-
-   ossim_int16          toInt16()const;
-   static ossim_int16   toInt16(const ossimString& aString);
-   ossim_uint16         toUInt16()const;
-   static ossim_uint16  toUInt16(const ossimString& aString);
-
-   ossim_int32          toInt32()const;
-   static ossim_int32   toInt32(const ossimString& aString);
-   ossim_uint32         toUInt32()const;
-   static ossim_uint32  toUInt32(const ossimString& aString);
-
-   ossim_int64          toInt64()const;
-   static ossim_int64   toInt64(const ossimString& aString);
-   ossim_uint64         toUInt64()const;
-   static ossim_uint64  toUInt64(const ossimString& aString);
-
-   /**
-    * toLong's deprecated, please use the toInts...
-    */
-   long                 toLong()const;
-   static long          toLong(const ossimString& aString);
-   unsigned long        toULong()const;
-   static unsigned long toULong(const ossimString& aString);
-
-   ossim_float32        toFloat32()const;
-   static ossim_float32 toFloat32(const ossimString& aString);
-   ossim_float64        toFloat64()const;
-   static ossim_float64 toFloat64(const ossimString& aString);
-   double               toDouble()const;
-   static double        toDouble(const ossimString& aString);
-
-   /**
-    * Numeric to string methods.
-    */
-   static ossimString toString(bool aValue);
-   static ossimString toString(ossim_int16   aValue);
-   static ossimString toString(ossim_uint16  aValue);
-   static ossimString toString(ossim_int32   aValue);
-   static ossimString toString(ossim_uint32  aValue);
-   static ossimString toString(ossim_int64   aValue);
-   static ossimString toString(ossim_uint64  aValue);
-
-   /**
-    * @param aValue Value to convert to string.
-    *
-    * @param precision Decimal point precision of the output.
-    *
-    * @param fixed If true setiosflags(std::ios::fixed) will be called.
-    */
-   static ossimString toString(ossim_float32 aValue,
-                               ossim_int32 precision = 8,
-                               bool fixed = false);
-
-   /**
-    * @param aValue Value to convert to string.
-    *
-    * @param precision Decimal point precision of the output.
-    *
-    * @param fixed If true setiosflags(std::ios::fixed) will be called.
-    */
-   static ossimString toString(ossim_float64 aValue,
-                               ossim_int32 precision = 15,
-                               bool fixed = false);
-
-   static ossimString stripLeading(const ossimString &value,
-                                   char characterToStrip);
-
-
-   /**
-    * Splits this string into a vector of strings (fields) using the delimiter list specified.
-    * If a delimiter is encountered at the beginning or the end of this, or two delimiters are
-    * contiguous, a blank field is inserted in the vector, unless skipBlankFields is true.
-    */
-   void split(std::vector<ossimString>& result,
-              const ossimString& separatorList,
-              bool skipBlankFields=false)const;
-
-   std::vector<ossimString> split(const ossimString& separatorList,
-                                  bool skipBlankFields=false)const;
-
-   const ossimString& join(const std::vector<ossimString>& stringList,
-                           const ossimString& separator);
-
-   //---
-   // Regular expression pattern utilities
-   //---
-
-   /**
-    * Returns from start of string up to but not including found pattern.
-    * Returns "" if pattern not found.
-    */
-   ossimString beforeRegExp(const char *regularExpressionPattern) const;
-
-   /**
-    * Returns from position of found pattern to end of string.
-    * Returns "" if pattern not found.
-    */
-   ossimString fromRegExp(const char *regularExpressionPattern) const;
-
-   /**
-    * Returns from position after found pattern to end of string.
-    * Returns "" if pattern not found.
-    */
-   ossimString afterRegExp(const char *regularExpressionPattern) const;
-
-   /**
-    * Returns from found pattern to end of pattern.
-    * Returns "" if pattern not found.
-    */
-   ossimString match(const char *regularExpressionPattern) const;
-
-   ossimString replaceAllThatMatch(const char *regularExpressionPattern,
-                                   const char *value="") const;
-
-   ossimString replaceStrThatMatch(const char *regularExpressionPattern,
-                                   const char *value="") const;
-
-   ossimString urlEncode()const;
-
-   /**
-    * If OSSIM_ID_ENABLED returns the OSSIM_ID which currently is the
-    * expanded cvs $Id: ossimString.h 23664 2015-12-14 14:17:27Z dburken $ macro; else, an empty string.
-    */
-   ossimString getOssimId() const;
-
-protected:
-
-   std::string m_str;
-};
-
-inline std::string::iterator ossimString::erase(std::string::iterator p)
-{
-   return m_str.erase(p);
-}
-
-inline std::string::iterator ossimString::erase(std::string::iterator first,
-                                                std::string::iterator last)
-{
-   return m_str.erase(first, last);
-}
-
-inline std::string& ossimString::erase(std::string::size_type pos,
-                                       std::string::size_type n)
-{
-   return m_str.erase(pos, n);
-}
-
-inline std::string::size_type ossimString::find(
-   const std::string& s, std::string::size_type pos) const
-{
-   return m_str.find(s, pos);
-}
-
-inline std::string::size_type ossimString::find(
-   const char* s, std::string::size_type pos, std::string::size_type n) const
-{
-   return m_str.find(s, pos, n);
-}
-
-inline std::string::size_type ossimString::find(
-   const char* s, std::string::size_type pos) const
-{
-   return m_str.find(s, pos);
-}
-
-inline std::string::size_type ossimString::find(
-   char c, std::string::size_type pos) const
-{
-   return m_str.find(c, pos);
-}
-
-inline std::string::size_type ossimString::rfind(
-   const std::string& s, std::string::size_type pos) const
-{
-   return m_str.rfind(s, pos);
-}
-
-inline std::string::size_type ossimString::rfind(
-   const char* s, std::string::size_type pos, std::string::size_type n) const
-{
-   return m_str.rfind(s, pos, n);
-}
-
-inline std::string::size_type ossimString::rfind(
-   const char* s, std::string::size_type pos) const
-{
-   return m_str.rfind(s, pos);
-}
-
-inline std::string::size_type ossimString::rfind(
-   char c, std::string::size_type pos) const
-{
-   return m_str.rfind(c, pos);
-}
-
-inline std::string::size_type ossimString::find_first_of(
-   char c, std::string::size_type pos) const
-{
-   return m_str.find_first_of(c, pos);
-}
-
-inline std::string::size_type ossimString::find_first_of(
-   const char* s, std::string::size_type pos) const
-{
-   return m_str.find_first_of(s, pos);
-}
-
-inline std::string::size_type ossimString::find_first_not_of(
-   const char c, std::string::size_type pos) const
-{
-   return m_str.find_first_not_of(c, pos);
-}
-
-inline std::string::size_type ossimString::find_first_not_of(
-   const char* s, std::string::size_type pos) const
-{
-   return m_str.find_first_not_of(s, pos);
-}
-
-inline std::string::size_type ossimString::find_last_of(
-   char c, std::string::size_type pos) const
-{
-   return m_str.find_last_of(c, pos);
-}
-
-inline const ossimString& ossimString::append(const ossimString& s)
-{
-   m_str.append(s.m_str);
-   return *this;
-}
-
-inline const ossimString& ossimString::append(const std::string& s)
-{
-   m_str.append(s);
-   return *this;
-}
-
-inline const ossimString& ossimString::append(const char* s)
-{
-   if ( s ) m_str.append(s);
-   return *this;
-}
-
-inline const ossimString& ossimString::append(std::string::size_type n, char c)
-{
-   m_str.append(n, c);
-   return *this;
-}
-
-inline const char& ossimString::at(std::string::size_type n) const
-{
-   return m_str.at(n); 
-}
-
-inline char& ossimString::at(std::string::size_type n)
-{
-   return m_str.at(n);
-}
-
-inline std::string& ossimString::assign(std::string::size_type n, char c)
-{
-   return m_str.assign(n, c);
-}
-
-inline std::string& ossimString::replace(
-   std::string::size_type pos, std::string::size_type n, const std::string& s)
-{
-   return m_str.replace(pos, n, s);
-}
-
-inline std::string& ossimString::replace(std::string::iterator first,
-                                         std::string::iterator last,
-                                         const std::string& s)
-{
-   return m_str.replace(first, last, s);
-}
-
-inline std::string& ossimString::replace(std::string::size_type pos,
-                                         std::string::size_type n,
-                                         const std::string& s,
-                                         std::string::size_type pos1,
-                                         std::string::size_type n1)
-{
-   return m_str.replace(pos, n, s, pos1, n1);
-}
-
-inline void ossimString::reserve(std::string::size_type n)
-{
-   m_str.reserve(n);
-}
-
-
-inline std::string& ossimString::insert(std::string::size_type pos,
-                                        const char* s)
-{
-   if (s) m_str.insert(pos, s);
-   return m_str;
-}
-
-inline void ossimString::push_back(char c)
-{
-   m_str.push_back(c);
-}
-
-inline std::string ossimString::substr(std::string::size_type pos,
-                                       std::string::size_type n) const
-{
-   return m_str.substr(pos, n);
-}
-
-inline std::istream& getline( std::istream& is, ossimString& str, char delim )
-{
-   return std::getline( is, str.string(), delim );
-}
-
-inline std::istream& getline( std::istream& is, ossimString& str )
-{
-   // Not sure why getline( is, str.string()) doesn't work. (drb)
-   return std::getline( is, str.string(), '\n' );
-}
-
-inline std::istream& operator>>(std::istream&  is, ossimString& s)
-{
-   return is >> s.string();
-}
-
-inline std::ostream& operator<<(std::ostream& os, const ossimString& s)
-{
-   return os << s.string();
-}
-
-inline ossimString operator+(const char* s1, const ossimString& s2)
-{
-   ossimString result;
-   if ( s1 ) result = ossimString( s1 + s2.string() );
-   else result = s2;
-   return result;
-}
-
-inline ossimString operator+(const std::string s1, const ossimString& s2)
-{
-   return ossimString( s1 + s2.string() );
-}
-
-inline ossimString operator+(char c, const ossimString& s2)
-{
-   return ossimString( c + s2.string() );
-}
-
-inline bool operator==(const char* lhs, const ossimString& rhs)
-{
-   return (rhs.operator ==(lhs));
-}
-
-inline bool operator==(const std::string& lhs, const ossimString& rhs)
-{
-   return (rhs.operator ==(lhs));
-}
-
-/**
- * @brief For use with std::map as a compare operator:
- * std::map<ossimString, ossimString, ossimStringLtstr>
- *
- * This will allow the find method on map to work.
- */
-struct ossimStringLtstr
-{
-   bool operator()(const ossimString& s1, const ossimString& s2) const
-   {
-      return s1.string().compare(s2.string()) < 0;
-   }
-};
-
-#endif /* #ifndef ossimString_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimStringProperty.h b/ossim/include/ossim/base/ossimStringProperty.h
deleted file mode 100644
index 2874f89..0000000
--- a/ossim/include/ossim/base/ossimStringProperty.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// LICENSE: MIT see top level license.txt
-//
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-//*************************************************************************
-// $Id: ossimStringProperty.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimStringProperty_HEADER
-#define ossimStringProperty_HEADER
-#include <ossim/base/ossimProperty.h>
-#include <vector>
-
-class OSSIMDLLEXPORT ossimStringProperty : public ossimProperty
-{
-public:
-   ossimStringProperty(const ossimString& name = ossimString(""),
-                       const ossimString& value = ossimString(""),
-                       bool editableFlag = true,
-                       const std::vector<ossimString>& constraintList = std::vector<ossimString>());
-   
-   ossimStringProperty(const ossimStringProperty& rhs);
-
-   /*!
-    * Duplicates the object and returns a new one
-    */
-   virtual ossimObject* dup()const;
-
-   virtual const ossimProperty& assign(const ossimProperty& rhs);
-   
-   void setEditableFlag(bool flag);
-   bool getEditableFlag()const;
-   bool isEditable()const;
-   
-   /*!
-    * Clears the constraints for this string.  You can constrain
-    * it to a string list by calling setConstraints.
-    */
-   void clearConstraints();
-
-   /*!
-    * Sets the constraints for this property.  If the editable
-    * flag is present then this says the editing is not readonly
-    * and one can hand type the value in without only selecting
-    * from a choice list.
-    */
-   void setConstraints(const std::vector<ossimString>& constraintList);
-
-   void addConstraint(const ossimString& value);
-   const std::vector<ossimString>& getConstraints()const;
-   
-   bool hasConstraints()const;
-   
-   /*!
-    * will try to set the value.  If the constraints are set
-    * it will make sure that the value is in the list and
-    * if its not then it will return false 
-    */
-   virtual bool setValue(const ossimString& value);
-   
-   virtual void valueToString(ossimString& valueResult)const;
-  
-   
-protected:
-   ossimString theValue;
-   bool        theEditableFlag;
-   std::vector<ossimString> theConstraints;
-
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/base/ossimTempFilename.h b/ossim/include/ossim/base/ossimTempFilename.h
deleted file mode 100644
index 652a1f0..0000000
--- a/ossim/include/ossim/base/ossimTempFilename.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// Description: This is a tmeporary filename class it will create a temporary
-//              file and will also delete it upon destruction
-//
-//*************************************************************************
-// $Id: ossimTempFilename.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimTempFilename_HEADER
-#define ossimTempFilename_HEADER
-#include <ossim/base/ossimFilename.h>
-
-class OSSIM_DLL ossimTempFilename : public ossimFilename
-{
-public:
-   ossimTempFilename(const ossimString& tempDir="",
-                     const ossimString& prefix = "",
-                     const ossimString& extension = "",
-                     bool autodelete=true,
-                     bool useWildcardDelete=true);
-
-   void generateRandomFile();
-   void generateRandomDir();
-   
-   ~ossimTempFilename();
-   
-protected:
-   ossimString theTempDir;
-   ossimString thePrefix;
-   ossimString theExtension;
-   bool theAutoDeleteFlag;
-   bool theWildCardDeleteFlag;
-   
-
-   void generate(bool createAsDirectoryFlag);
-};
-#endif
-
diff --git a/ossim/include/ossim/base/ossimTieMeasurementGeneratorInterface.h b/ossim/include/ossim/base/ossimTieMeasurementGeneratorInterface.h
deleted file mode 100644
index 80fb913..0000000
--- a/ossim/include/ossim/base/ossimTieMeasurementGeneratorInterface.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimTieMeasurementGeneratorInterface.h
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David hicks
-//
-// Description: OSSIM interface for tie measurement generator plugin.
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimTieMeasurementGeneratorInterface_HEADER
-#define ossimTieMeasurementGeneratorInterface_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <iosfwd>
-
-
-class ossimImageSource;
-
-class ossimTieMeasurementGeneratorInterface
-{
-public:
-
-   /** @brief Virtual destructor defined to squash compiler errors. */
-   virtual ~ossimTieMeasurementGeneratorInterface(){}
-
-   // Initializer
-   virtual bool init(std::ostream& report = std::cout) = 0;
-
-   // Define collection ROI
-   virtual bool setBox(std::vector<ossimIrect> roi,
-                       const ossim_uint32& index,
-                       std::vector<ossimImageSource*> src) = 0;
-   virtual bool isValidCollectionBox() const = 0;
-
-   // Measurement collection
-   virtual bool run() = 0;
-
-   // Report run parameters
-   virtual void summarizeRun() const = 0;
-   
-   // Patch grid configuration accessors
-   virtual void setUseGrid(const bool useGrid) = 0;
-   virtual bool getUseGrid() const = 0;
-   virtual bool setGridSize(const ossimIpt& gridDimensions) = 0;
-   virtual ossimIpt getGridSize() const = 0;
-
-   // Max matches in patch accessors
-   virtual bool setMaxMatches(const int& maxMatches) = 0;
-   virtual int getMaxMatches() const = 0;
-
-   // Set the feature detector
-   virtual bool setFeatureDetector(const ossimString& name) = 0;
-   virtual ossimString getFeatureDetector() const  = 0;
-   
-   // Set the descriptor-extractor
-   virtual bool setDescriptorExtractor(const ossimString& name) = 0;
-   virtual ossimString getDescriptorExtractor() const  = 0;
-   
-   // Set the matcher
-   virtual bool setDescriptorMatcher(const ossimString& name) = 0;
-   virtual ossimString getDescriptorMatcher() const  = 0;
-   
-   // Measured point access
-   virtual int numMeasurements() const = 0;
-   virtual ossimDpt pointIndexedAt(const ossim_uint32 imgIdx,
-                                   const ossim_uint32 measIdx) = 0;
-
-   // OpenCV drawMatches window
-   virtual void closeCvWindow(const bool waitKeyPress = false) = 0;
-   virtual void setShowCvWindow(const bool showCvWindow) = 0;
-   virtual bool getShowCvWindow() const = 0;
-
-};
-
-#endif /* #ifndef ossimTieMeasurementGeneratorInterface_HEADER */
-
diff --git a/ossim/include/ossim/base/ossimTileHash.h b/ossim/include/ossim/base/ossimTileHash.h
deleted file mode 100644
index 3f8cdcf..0000000
--- a/ossim/include/ossim/base/ossimTileHash.h
+++ /dev/null
@@ -1,47 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken Copied from TiledImageHash.
-//
-// Description: Hashing function for tiled rectangles.  Will hash a
-//              dpt or fpt to a single index value.
-//
-// NOTE:  Works on rectangles that are positive in the line up (y)
-//        direction.  Use TiledImageHash for rectangles that are positive
-//        in the line down direction.
-//              
-//*******************************************************************
-//  $Id: ossimTileHash.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef TileHash_HEADER
-#define TileHash_HEADER
-
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimPointHash.h>
-
-class OSSIMDLLEXPORT ossimTileHash : public ossimPointHash
-{
-public:
-   ossimTileHash(const ossimDrect &imageRect,
-                 double tileWidth,
-                 double tileHeight);
-
-   virtual ~ossimTileHash();
-
-   virtual long operator()(const ossimDpt &aPoint);
-   virtual long operator()(const ossimFpt &aPoint);
-   
-private:
-   ossimDrect   theImageRect;
-   double  theTileWidth;
-   double  theTileHeight;
-   long    theNumberOfHorizTiles;
-   long    theNumberOfVertTiles;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimTiledImageHash.h b/ossim/include/ossim/base/ossimTiledImageHash.h
deleted file mode 100644
index b549f73..0000000
--- a/ossim/include/ossim/base/ossimTiledImageHash.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description: Hashing function for tiled rectangles.  Will hash a
-//              dpt to a single index value.
-//              
-//*******************************************************************
-//  $Id: ossimTiledImageHash.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimTiledImageHash_HEADER
-#define ossimTiledImageHash_HEADER
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimPointHash.h>
-
-class OSSIMDLLEXPORT ossimTiledImageHash : public ossimPointHash
-{
-public:
-   ossimTiledImageHash(const ossimDrect &imageRect,
-                       double tileWidth,
-                       double tileHeight);
-
-   virtual ~ossimTiledImageHash();
-
-   virtual long operator()(const ossimDpt &aPoint);
-   virtual long operator()(const ossimFpt &aPoint);
-   
-private:
-   ossimDrect   theImageRect;
-   double  theTileWidth;
-   double  theTileHeight;
-   long    theNumberOfHorizTiles;
-   long    theNumberOfVertTiles;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimTraceManager.h b/ossim/include/ossim/base/ossimTraceManager.h
deleted file mode 100644
index b514550..0000000
--- a/ossim/include/ossim/base/ossimTraceManager.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//*****************************************************************************
-// Copyright (C) 2005 Garrett Potts, all rights reserved.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-// 
-// DESCRIPTION:
-//   Contains declaration of class ossimTraceManager.
-//
-//*****************************************************************************
-// $Id: ossimTraceManager.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimTraceManager_HEADER
-#define ossimTraceManager_HEADER
-
-#include <ossim/base/ossimString.h>
-
-class ossimTrace;
-
-class OSSIMDLLEXPORT ossimTraceManager
-{
-public:
-   /**
-    * @return ossimTraceManager* to instance of the ossim trace manager.
-    */
-   static ossimTraceManager* instance();
-
-   /**
-    * Sets "thePattern" to "pattern", then calls setTraceFlags(true).
-    *
-    * @param pattern Regular expression to enable trace for.
-    */
-   void setTracePattern(const ossimString& pattern);
-
-   /**
-    * @param traceObj ossimTrace* to add to "theTraceList".
-    */
-   void addTrace(ossimTrace* traceObj);
-
-   /**
-    * @param traceObj ossimTrace* to remove from "theTraceList".
-    */
-   void removeTrace(ossimTrace* traceObj);
-   
-protected:
-   /** Protected default constructor. */
-   ossimTraceManager();
-
-private:
-   /**
-    * Loops through "theTraceList" and sets any trace object's enable flag to
-    * flag if it matches regular expression of "thePattern".
-    * For trace objects not matching "thePattern" no action is taken.
-    */
-   void setTraceFlags(bool flag);
-
-   /** The instance of this manager. */
-   static ossimTraceManager* theInstance;
-
-   /** The regular expression pattern like "ossimDynamic|ossimGdal". */
-   ossimString               thePattern;
-
-   /** The list of trace objects. */
-   std::vector<ossimTrace*>  theTraceList;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimUnitConversionTool.h b/ossim/include/ossim/base/ossimUnitConversionTool.h
deleted file mode 100644
index 2549b7b..0000000
--- a/ossim/include/ossim/base/ossimUnitConversionTool.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimUnitConversionTool.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimUnitConversionTool_HEADER
-#define ossimUnitConversionTool_HEADER
-#include <iostream>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimGpt.h>
-
-class OSSIM_DLL ossimUnitConversionTool
-{
-public:
-   friend std::ostream& operator<<(std::ostream& out,
-                                   const ossimUnitConversionTool& data);
-
-   ossimUnitConversionTool(double value=1.0,
-                           ossimUnitType unitType=OSSIM_METERS);
-
-   ossimUnitConversionTool(const ossimGpt& origin,
-                           double value,
-                           ossimUnitType unitType=OSSIM_METERS);
-
-   void setOrigin(const ossimGpt& gpt);
-
-   ossimGpt getOrigin()const;
-
-   void getOrigin(ossimGpt& result)const;
-
-   void setValue(double value, ossimUnitType unitType=OSSIM_METERS);
-
-   double getValue(ossimUnitType unitType=OSSIM_METERS) const;
-   
-   void setMeters(double value);
-   void setRadians(double value);
-   void setDegrees(double value);
-   void setMinutes(double value);
-   void setSeconds(double value);
-   void setUsSurveyFeet(double value);
-   void setFeet(double value);
-   void setNauticalMiles(double value);
-   void setMiles(double value);
-   void setMillimeters(double value);
-   void setMicrons(double value);
-   void setCentimeters(double value);
-   void setYards(double value);
-   void setInches(double value);
-   void setKilometers(double value);
-   double getMeters()const;
-   double getRadians()const;
-   double getDegrees()const;
-   double getMinutes()const;
-   double getSeconds()const;
-   double getUsSurveyFeet()const;
-   double getFeet()const;
-   double getNauticalMiles()const;
-   double getMiles()const;
-   double getMillimeters()const;
-   double getMicrons()const;
-   double getCentimeters()const;
-   double getYards()const;
-   double getInches()const;
-   double getKilometers()const;
-   
-protected:
-   double         theValue;
-   ossimUnitType  theUnitType;
-   ossimGpt       theOrigin;
-
-   double computeMeters()const;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimVrect.h b/ossim/include/ossim/base/ossimVrect.h
deleted file mode 100644
index 3e5b956..0000000
--- a/ossim/include/ossim/base/ossimVrect.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//*******************************************************************
-//
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Contains class declaration for vrect.
-// Container class for four double points representing a rectangle
-// where y is up
-// 
-//*******************************************************************
-//  $Id: ossimVrect.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimVrect_HEADER
-#define ossimVrect_HEADER
-#include <iostream>
-
-#include <ossim/base/ossimDpt.h>
-
-class OSSIMDLLEXPORT ossimVrect
-{
-public:
-   ossimVrect()
-      :theUlCorner(0.0, 0.0),
-       theLlCorner(0.0, 0.0),
-       theLrCorner(0.0, 0.0),
-       theUrCorner(0.0, 0.0)
-      {}
-   ossimVrect(const ossimDpt &ul,
-         const ossimDpt &lr)
-      :theUlCorner(ul),
-       theLlCorner(ul.x, lr.y),
-       theLrCorner(lr),
-       theUrCorner(lr.x, ul.y)
-      {}
-   ossimVrect(double ul_corner_x,
-         double ul_corner_y,
-         double lr_corner_x,
-         double lr_corner_y)
-      :
-         theUlCorner(ul_corner_x, ul_corner_y),
-         theLlCorner(ul_corner_x, lr_corner_y),
-         theLrCorner(lr_corner_x, lr_corner_y),
-         theUrCorner(lr_corner_x, ul_corner_y)
-      {}
-   ossimVrect(const ossimVrect& rect)
-      :
-         theUlCorner(rect.ul()),
-         theLlCorner(rect.ll()),
-         theLrCorner(rect.lr()),
-         theUrCorner(rect.ur())
-      {}
-
-   ~ossimVrect();
-
-   const ossimVrect& operator=  (const ossimVrect& rect);
-   bool         operator!= (const ossimVrect& rect) const;
-   bool         operator== (const ossimVrect& rect) const;
-   
-   const ossimDpt &ul() const { return theUlCorner; }
-   const ossimDpt &ur() const { return theUrCorner; }
-   const ossimDpt &lr() const { return theLrCorner; }
-   const ossimDpt &ll() const { return theLlCorner; }
-   /*!
-    * Returns the height of a rectangle.
-    */
-   ossim_float64 height() const
-      { return fabs(theLlCorner.y - theUlCorner.y) + 1.0; }
-
-   /*!
-    * Returns the width of a rectangle.
-    */
-   ossim_float64 width()  const
-      { return fabs(theLrCorner.x - theLlCorner.x) + 1.0; }
-   
-   inline ossimDpt midPoint()const;
-   void print(std::ostream& os) const;
-   
-   ossimVrect combine(const ossimVrect& rect)const;
-   inline ossimVrect clipToRect(const ossimVrect& rect)const;
-
-   friend std::ostream& operator<<(std::ostream& os, const ossimVrect& rect);
-
-private:
-   ossimDpt theUlCorner;
-   ossimDpt theLlCorner;
-   ossimDpt theLrCorner;
-   ossimDpt theUrCorner;
-};
-
-inline const ossimVrect& ossimVrect::operator=(const ossimVrect& rect)
-{
-   if (this != &rect)
-   {
-      theUlCorner = rect.ul();
-      theUrCorner = rect.ur();
-      theLrCorner = rect.lr();
-      theLlCorner = rect.ll();
-   }
-
-   return *this;
-}
-
-inline bool ossimVrect::operator!=(const ossimVrect& rect) const
-{
-   return ( (theUlCorner != rect.ul()) ||
-            (theUrCorner != rect.ur()) ||
-            (theLrCorner != rect.lr()) ||
-            (theLlCorner != rect.ll()) );
-}
-
-inline bool ossimVrect::operator==(const ossimVrect& rect) const
-{
-   return ( (theUlCorner == rect.ul()) &&
-            (theUrCorner == rect.ur()) &&
-            (theLrCorner == rect.lr()) &&
-            (theLlCorner == rect.ll()) );
-}
-
-
-inline ossimVrect ossimVrect::clipToRect(const ossimVrect& rect)const
-{
-    ossim_float64     ulx, uly, lrx, lry;
-
-    // XXX not replaced with std::max or ossim::max since the test is backward 
-    //     here and will give a different answer in the case of nan.
-    #define d_MAX(a,b)      (((a)>(b)) ? a : b)
-
-    ulx = d_MAX(rect.ul().x,ul().x);
-    uly = d_MAX(rect.ul().y,ul().y);
-
-    #undef d_MAX
-
-    lrx = std::min(rect.lr().x,lr().x);
-    lry = std::min(rect.lr().y,lr().y);
-
-    if( lrx <= ulx || lry <= uly )
-        return ossimVrect(ossimDpt(0,0),ossimDpt(0,0));
-    else
-       return ossimVrect(ulx,uly,lrx,lry);
-}
-
-inline ossimDpt ossimVrect::midPoint()const
-{
-   return ossimDpt( (ul().x + ur().x + ll().x + lr().x)*.25,
-               (ul().y + ur().y + ll().y + lr().y)*.25);
-}
-
-inline ossimVrect ossimVrect::combine(const ossimVrect& rect)const
-{
-   ossimDpt ulCombine;
-   ossimDpt lrCombine;
-   
-   ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
-   ulCombine.y = ((ul().y >= rect.ul().y)?ul().y:rect.ul().y);
-   lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
-   lrCombine.y = ((lr().y <= rect.lr().y)?lr().y:rect.lr().y);
-
-   return ossimVrect(ulCombine, lrCombine);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/base/ossimWebRequest.h b/ossim/include/ossim/base/ossimWebRequest.h
deleted file mode 100644
index f51dc2a..0000000
--- a/ossim/include/ossim/base/ossimWebRequest.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef ossimWebRequest_HEADER
-#define ossimWebRequest_HEADER
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimUrl.h>
-#include <ossim/base/ossimWebResponse.h>
-
-class OSSIM_DLL ossimWebRequest : public ossimObject
-{
-public:
-   ossimWebRequest(){}
-   ossimWebRequest(const ossimUrl& url)
-   :m_url(url)
-   {}
-   const ossimUrl& getUrl()const{return m_url;}
-   virtual bool setUrl(const ossimUrl& url){m_url = url; return true;}
-   void clearLastError(){m_lastError = "";}
-   const ossimString getLastError(){return m_lastError;}
-   virtual ossimWebResponse* getResponse(){return 0;}
-   
-protected:
-   ossimUrl m_url;
-   mutable ossimString m_lastError;
-   
-   TYPE_DATA;
-};
-#endif
diff --git a/ossim/include/ossim/base/ossimXmlNode.h b/ossim/include/ossim/base/ossimXmlNode.h
deleted file mode 100644
index c278c22..0000000
--- a/ossim/include/ossim/base/ossimXmlNode.h
+++ /dev/null
@@ -1,128 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Oscar Kramer <okramer at imagelinks.com> (ossim port by D. Burken)
-//
-// Description:  
-//
-// Contains declaration of class ossimXmlNode.
-// 
-//*****************************************************************************
-// $Id: ossimXmlNode.h 12527 2008-03-04 17:02:55Z gpotts $
-#ifndef ossimXmlNode_HEADER
-#define ossimXmlNode_HEADER
-
-#include <vector>
-using namespace std;
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimXmlAttribute.h>
-#include <ossim/base/ossimString.h>
-
-
-class OSSIMDLLEXPORT ossimXmlNode : public ossimObject,
-                                    public ossimErrorStatusInterface
-{
-public:
-   typedef std::vector<ossimRefPtr<ossimXmlNode> > ChildListType;
-   typedef std::vector<ossimRefPtr<ossimXmlAttribute> > AttributeListType;
-   
-   ossimXmlNode(istream& xml_stream, ossimXmlNode* parent=0);
-   ossimXmlNode();
-   ossimXmlNode(const ossimXmlNode& src);
-   virtual ossimObject* dup() const
-   {
-      return new ossimXmlNode(*this);
-   }
-	void duplicateAttributes(ossimXmlNode::AttributeListType result)const;
-   void duplicateChildren(ossimXmlNode::ChildListType& result)const;
-   bool read(std::istream& in);
-   // Appends any matching nodes to the list supplied
-   void findChildNodes(const ossimString& rel_xpath,
-                       ossimXmlNode::ChildListType& nodelist)const;
-   const ossimRefPtr<ossimXmlNode> findFirstNode(const ossimString& rel_xpath)const;
-   ossimRefPtr<ossimXmlNode> findFirstNode(const ossimString& rel_xpath);
-
-   ossimRefPtr<ossimXmlAttribute> findAttribute(const ossimString& name);
-   const ossimRefPtr<ossimXmlAttribute> findAttribute(const ossimString& name)const;
-   void setTag(const ossimString& tag);
-   ossimString                      getTag()        const;
-   const ossimXmlNode*              getParentNode() const;
-   ossimXmlNode*              getParentNode();
-   void setParent(ossimXmlNode* parent);
-   const ossimXmlNode::ChildListType&      getChildNodes() const;
-   ossimXmlNode::ChildListType&      getChildNodes();
-   const  ossimXmlNode::AttributeListType& getAttributes() const;
-   bool getAttributeValue(ossimString& value, const ossimString& name)const;
-   ossimString getAttributeValue(const ossimString& name)const
-   {
-      ossimString value;
-      getAttributeValue(value, name);
-      return value;
-   }
-   bool getChildTextValue(ossimString& value,
-                          const ossimString& relPath)const;
-   ossimString getChildTextValue(const ossimString& relPath)const
-   {
-      ossimString value;
-      getChildTextValue(value, relPath);
-      return value;
-   }
-   void addAttribute(ossimRefPtr<ossimXmlAttribute> attribute);
-   void addAttribute(const ossimString& name, const ossimString& value);
-   bool setAttribute(const ossimString& name,
-                     const ossimString& value,
-                     bool addIfNotPresentFlag=false);
-   ossimRefPtr<ossimXmlNode> addNode(const ossimString& relPath,
-                                     const ossimString& text = "");
-   ossimRefPtr<ossimXmlNode> addOrSetNode(const ossimString& relPath,
-                                          const ossimString& text = "");
-   void addChildNode(ossimRefPtr<ossimXmlNode> node);
-   ossimRefPtr<ossimXmlNode> addChildNode(const ossimString& tagName,
-                                          const ossimString& text="");
-   void addChildren(ossimXmlNode::ChildListType& children);
-   void setChildren(ossimXmlNode::ChildListType& children);
-   void addAttributes(ossimXmlNode::AttributeListType& children);
-   void setAttributes(ossimXmlNode::AttributeListType& children);
-   void setText(const ossimString& text);
-   const ossimString&                      getText()       const;
-   bool cdataFlag()const;
-   void setCDataFlag(bool value);
-   OSSIMDLLEXPORT friend ostream& operator << (ostream& os, const ossimXmlNode* xml_node);
-   OSSIMDLLEXPORT friend ostream& operator << (ostream& os, const ossimXmlNode& xml_node);
-
-   ossimRefPtr<ossimXmlNode> removeChild(ossimRefPtr<ossimXmlNode> node);
-   ossimRefPtr<ossimXmlNode> removeChild(const ossimString& tag);
-   void clear();
-   void clearChildren();
-   void clearAttributes();
-   
-   void toKwl(ossimKeywordlist& kwl,
-              const ossimString& prefix="")const;
-   void fromKwl(const ossimKeywordlist& kwlToConvert);
-  
-protected:
-   ~ossimXmlNode();
-   bool readTag(std::istream& in,
-                ossimString& tag);
-   bool readTextContent(std::istream& in);
-   bool readEndTag(std::istream& in,
-                   ossimString& endTag);
-
-   void skipCommentTag(std::istream& in);
-   bool readCDataContent(std::istream& in);
-   ossimString                 theTag;
-   ossimXmlNode*         theParentNode;
-   vector<ossimRefPtr<ossimXmlNode> >      theChildNodes;
-   vector<ossimRefPtr<ossimXmlAttribute> >  theAttributes;
-   ossimString                 theText;
-   bool                        theCDataFlag;
-/*    ossimString                 theCData; */
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimXmlNode_HEADER */
diff --git a/ossim/include/ossim/elevation/ossimDtedElevationDatabase.h b/ossim/include/ossim/elevation/ossimDtedElevationDatabase.h
deleted file mode 100644
index fde095f..0000000
--- a/ossim/include/ossim/elevation/ossimDtedElevationDatabase.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef ossimDtedElevationDatabase_HEADER
-#define ossimDtedElevationDatabase_HEADER 1
-
-#include <ossim/elevation/ossimElevationCellDatabase.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/elevation/ossimDtedHandler.h>
-#include <OpenThreads/Mutex>
-
-class OSSIM_DLL ossimDtedElevationDatabase : public ossimElevationCellDatabase
-{
-public:
-   typedef std::vector<ossimRefPtr<CellInfo> > DirectMap; // 360x180 cell grid
-   ossimDtedElevationDatabase()
-   :ossimElevationCellDatabase(),
-   m_extension("")
-   {
-   }
-   ossimDtedElevationDatabase(const ossimDtedElevationDatabase& rhs)
-   :ossimElevationCellDatabase(rhs),
-   m_extension(rhs.m_extension)
-   {
-   }
-   virtual ~ossimDtedElevationDatabase()
-   {
-   }
-
-   virtual ossimObject* dup() const
-   {
-      ossimDtedElevationDatabase* duped = new ossimDtedElevationDatabase;
-      duped->open(m_connectionString);
-      return duped;
-   }
-
-   virtual bool open(const ossimString& connectionString);
-   virtual bool pointHasCoverage(const ossimGpt& gpt) const
-   {
-      ossimFilename filename;
-      createFullPath(filename, gpt);
-      
-      return filename.exists();
-   }
-   
-   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
-   virtual double getHeightAboveMSL(const ossimGpt&);
-   virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
-   virtual ossim_uint64 createId(const ossimGpt& pt)const
-   {
-      ossim_uint64 y = static_cast<ossim_uint64>(ossim::wrap(pt.latd(), -90.0, 90.0)+90.0);
-      ossim_uint64 x = static_cast<ossim_uint64>(ossim::wrap(pt.lond(),-180.0,180.0)+180.0);
-      // map the extreme edge to the same ID ax the 179 west cell and the same for the 89
-      // degree north cell.
-      //
-      x = x==360?359:x;
-      y = y==180?179:y;
-      // dted databases are 1x1 degree cells and we will use a world 
-      // grid for id generation.
-      //
-      return (y*360+x);
-   }
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix = 0)const;
-   
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-   ossimString                m_extension;
-   ossimRefPtr<ossimElevCellHandler> m_lastHandler;
-   mutable OpenThreads::Mutex m_mutex;
-   
-   bool openDtedDirectory(const ossimFilename& dir);
-   void createRelativePath(ossimFilename& file, const ossimGpt& gpt)const;
-   void createFullPath(ossimFilename& file, const ossimGpt& gpt)const
-   {
-      ossimFilename relativeFile;
-      createRelativePath(relativeFile, gpt);
-      file = ossimFilename(m_connectionString).dirCat(relativeFile);
-   }
-   virtual ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& gpt);
-TYPE_DATA
-};
-#endif
diff --git a/ossim/include/ossim/elevation/ossimDtedFactory.h b/ossim/include/ossim/elevation/ossimDtedFactory.h
deleted file mode 100644
index 03a7c90..0000000
--- a/ossim/include/ossim/elevation/ossimDtedFactory.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//*****************************************************************************
-// FILE: ossimDtedFactory.cc
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Class declaration for ossimDtedFactory.
-// This is the base class interface for elevation cell factories.
-//*****************************************************************************
-// $Id: ossimDtedFactory.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimDtedFactory_HEADER
-#define ossimDtedFactory_HEADER
-
-#include <ossim/elevation/ossimElevSourceFactory.h>
-
-/** CLASS:  ossimDtedFactory */
-class OSSIM_DLL ossimDtedFactory : public ossimElevSourceFactory
-{
-public:
-
-   ossimDtedFactory();
-   ossimDtedFactory(const ossimFilename& dir);
-      
-
-   virtual ossimElevSource* getNewElevSource(const ossimGpt& gpt) const;
-   virtual void createIndex();
-protected:
-   virtual ~ossimDtedFactory();
-
-TYPE_DATA
-};
-
-#endif /* End of "#ifndef ossimDtedFactory_HEADER" */
-
diff --git a/ossim/include/ossim/elevation/ossimDtedHandler.h b/ossim/include/ossim/elevation/ossimDtedHandler.h
deleted file mode 100644
index 801750d..0000000
--- a/ossim/include/ossim/elevation/ossimDtedHandler.h
+++ /dev/null
@@ -1,241 +0,0 @@
-//*****************************************************************************
-// FILE: ossimDtedHandler.h
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION:
-//   Contains declaration of class ossimDtedHandler. This class derives from
-//   ossimElevHandler. It is responsible for loading an individual DTED cell
-//   from disk. This elevation files are memory mapped.
-//
-// SOFTWARE HISTORY:
-//>
-//   05Feb2001  Ken Melero
-//              Initial coding of ossimDted.h
-//   19Apr2001  Oscar Kramer
-//              Derived from ossimElevCellHandler.
-//<
-//*****************************************************************************
-// $Id: ossimDtedHandler.h 23497 2015-08-28 15:28:59Z okramer $
-
-#ifndef ossimDtedHandler_HEADER
-#define ossimDtedHandler_HEADER
-
-#include <fstream>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/elevation/ossimElevCellHandler.h>
-#include <OpenThreads/Mutex>
-#include <ossim/support_data/ossimDtedVol.h>
-#include <ossim/support_data/ossimDtedHdr.h>
-#include <ossim/support_data/ossimDtedUhl.h>
-#include <ossim/support_data/ossimDtedDsi.h>
-#include <ossim/support_data/ossimDtedAcc.h>
-#include <ossim/support_data/ossimDtedRecord.h>
-
-class OSSIM_DLL ossimDtedHandler : public ossimElevCellHandler
-{
-public:
-
-   /// number of Dted posts per point.
-   static const int TOTAL_POSTS = 4;
-   /// number of Dted posts per block
-   static const int NUM_POSTS_PER_BLOCK= 2;
-
-   /// ossimDtedHandler
-   ossimDtedHandler()
-   {
-   }
-
-   ossimDtedHandler(const ossimFilename& dted_file, bool memoryMapFlag=false);
-
-   enum
-   {
-      DATA_RECORD_OFFSET_TO_POST = 8,     // bytes
-      DATA_RECORD_CHECKSUM_SIZE  = 4,     // bytes
-      POST_SIZE                  = 2,     // bytes
-      NULL_POST                  = -32767 // Fixed by DTED specification.
-   };
-
-   virtual bool open(const ossimFilename& file, bool memoryMapFlag=false);
-   virtual void close();
-   
-   /*!
-    * METHOD: getHeightAboveMSL
-    * Height access methods.
-    */
-   virtual double getHeightAboveMSL(const ossimGpt&);
-
-   /*!
-    *  METHOD:  getSizeOfElevCell
-    *  Returns the number of post in the cell.  Satisfies pure virtual.
-    *  Note:  x = longitude, y = latitude
-    */
-   virtual ossimIpt getSizeOfElevCell() const;
-      
-   /*!
-    *  METHOD:  getPostValue
-    *  Returns the value at a given grid point as a double.
-    *  Satisfies pure virtual.
-    */
-   virtual double getPostValue(const ossimIpt& gridPt) const;
-
-   ossimString  edition()         const;
-   ossimString  productLevel()    const;
-   ossimString  compilationDate() const;
-
-   virtual bool isOpen()const;
-   
-   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
-   
-   const ossimDtedVol& vol()const
-   {
-      return m_vol;
-   }
-   const ossimDtedHdr& hdr()const
-   {
-      return m_hdr;
-   }
-   const ossimDtedUhl& uhl()const
-   {
-      return m_uhl;
-   }
-   const ossimDtedDsi& dsi()const
-   {
-      return m_dsi;
-   }
-   const ossimDtedAcc& acc()const
-   {
-      return m_acc;
-   }
-
-   virtual ossimObject* dup () const
-   {
-      return new ossimDtedHandler(this->getFilename(), (m_memoryMap.size() != 0));
-   }
-
-   virtual ~ossimDtedHandler();
-
-protected:
-
-   /// DtedPost, this class contains the height, weighting factor and status
-   class DtedPost
-   {
-   public:
-     // constructor - initialise variables
-     DtedPost():
-       m_height(0),
-       m_weight(0),
-       m_status(false)
-     {
-     }
-     // destructor
-     virtual ~DtedPost();
-     // member variables
-     double m_height;
-     double m_weight;
-     bool m_status;
-   };
-
-   /// DtedHeight is a class for storing DTED information
-   /// - 4 posts are used to generate an interpolated height value.
-   class DtedHeight
-   {
-   public:
-     // constructor
-     DtedHeight();
-     // destructor
-     virtual ~DtedHeight();
-     // calculate the interpolated Height for the posts
-     double calcHeight();
-     // debug
-     void debug();
-     // post data
-     DtedPost m_posts[TOTAL_POSTS];
-   };
-
-
-  // Disallow operator= and copy construction...
-   const ossimDtedHandler& operator=(const ossimDtedHandler& rhs);
-   ossimDtedHandler(const ossimDtedHandler&);
-
-   /*!
-    *  If statistics file exist, stats will be initialized from that; else,
-    *  this scans the dted cell and gets stats, then, writes new stats file.
-    *  The statistics file will be named accordingly:
-    *  If dted cell = n27.dt1 then the stats file = n27.statistics.
-    *  Currently method only grabs the min and max posts value.
-    */
-   void gatherStatistics();
-
-   ossim_sint16 convertSignedMagnitude(ossim_uint16& s) const;
-   virtual double getHeightAboveMSL(const ossimGpt&, bool readFromFile);
-
-  /**
-   * read the height posts from the File
-   * @param postData - post heights, status & weight
-   * @param offset - file contents offset to start reading from
-   */
-   void readPostsFromFile(DtedHeight &postData, int offset);
-
-   mutable OpenThreads::Mutex m_fileStrMutex;
-   mutable std::ifstream m_fileStr;
-   
-   ossim_int32      m_numLonLines;  // east-west dir
-   ossim_int32      m_numLatPoints; // north-south
-   ossim_int32      m_dtedRecordSizeInBytes;
-   ossimString      m_edition;
-   ossimString      m_productLevel;
-   ossimString      m_compilationDate;
-   ossim_int32      m_offsetToFirstDataRecord;
-   double           m_latSpacing;   // degrees
-   double           m_lonSpacing;   // degrees
-   ossimDpt         m_swCornerPost; // cell origin;
-
-   // Indicates whether byte swapping is needed.
-   bool m_swapBytesFlag;
-
-   mutable OpenThreads::Mutex m_memoryMapMutex;
-   mutable std::vector<ossim_uint8> m_memoryMap;
-   
-   ossimDtedVol m_vol;
-   ossimDtedHdr m_hdr;
-   ossimDtedUhl m_uhl;
-   ossimDtedDsi m_dsi;
-   ossimDtedAcc m_acc;
-   TYPE_DATA
-};
-
-inline ossim_sint16 ossimDtedHandler::convertSignedMagnitude(ossim_uint16& s) const
-{
-   // DATA_VALUE_MASK 0x7fff = 0111 1111 1111 1111
-   // DATA_SIGN_MASK  0x8000 = 1000 0000 0000 0000
-   
-   // First check to see if the bytes need swapped.
-   s = (m_swapBytesFlag ? ( ((s & 0x00ff) << 8) | ((s & 0xff00) >> 8) ) : s);
-   
-   // If the sign bit is set, mask it out then multiply by negative one.
-   if (s & 0x8000)
-   {
-      return (static_cast<ossim_sint16>(s & 0x7fff) * -1);
-   }
-   
-   return static_cast<ossim_sint16>(s);
-}
-
-inline bool ossimDtedHandler::isOpen()const
-{
-   if(!m_memoryMap.empty()) return true;
-   
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_fileStrMutex);
-   return (m_fileStr.is_open());
-}
-
-inline void ossimDtedHandler::close()
-{
-   m_fileStr.close();
-   m_memoryMap.clear();
-}
-
-#endif
diff --git a/ossim/include/ossim/elevation/ossimElevManager.h b/ossim/include/ossim/elevation/ossimElevManager.h
deleted file mode 100644
index ec5cf92..0000000
--- a/ossim/include/ossim/elevation/ossimElevManager.h
+++ /dev/null
@@ -1,184 +0,0 @@
-//*****************************************************************************
-// FILE: ossimElevManager.h
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION:
-//   Contains declaration of class ossimElevManager. This object provides a
-//   single interface to an imaging chain for accessing multiple elevation
-//   sources. This object owns one or more elevation sources in an ordered
-//   list. When queried for an elevation at a particular point, it searches
-//   the available sources for the best result, instantiating new sources if
-//   necessary.
-//
-// SOFTWARE HISTORY:
-//>
-//   13Apr2001  Oscar Kramer
-//              Initial coding.
-//<
-//*****************************************************************************
-#ifndef ossimElevManager_HEADER
-#define ossimElevManager_HEADER
-
-#include <vector>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/elevation/ossimElevSource.h>
-#include <ossim/elevation/ossimElevationDatabase.h>
-#include <OpenThreads/ReadWriteMutex>
-
-class OSSIM_DLL ossimElevManager : public ossimElevSource
-{
-public: 
-   typedef std::vector<ossimRefPtr<ossimElevationDatabase> > ElevationDatabaseListType;
-   
-   class OSSIM_DLL ConnectionStringVisitor : public ossimVisitor
-   {
-   public:
-      ConnectionStringVisitor(const ossimString& value);
-      virtual ossimRefPtr<ossimVisitor> dup()const{return new ConnectionStringVisitor(*this);}
-      const ossimString& getConnectionString()const{return m_connectionString;}
-      virtual void visit(ossimObject* obj);
-      ossimElevationDatabase* getElevationDatabase(){return m_database.get();}
-      
-   protected:
-      ossimString m_connectionString;
-      ossimRefPtr<ossimElevationDatabase> m_database;
-   };
-   
-   virtual ~ossimElevManager();
-   
-   /**
-    * METHOD: instance()
-    * Implements singelton pattern
-    */
-   static ossimElevManager* instance();
-   
-   virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
-   virtual double getHeightAboveMSL(const ossimGpt& gpt);
-   virtual bool pointHasCoverage(const ossimGpt&) const;
-
-   /**
-    * Returns the mean post spacing (in meters) for the highest resolution DEM in the list or NaN
-    * if no DEMs have been loaded. Recommended to perform a getHeight() call for a central
-    * ground pt first to load the relevant cells before calling this method.
-    */
-   virtual double getMeanSpacingMeters() const;
-
-   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
-  
-   ossim_uint32 getNumberOfElevationDatabases()const
-   {
-      return (ossim_uint32) m_dbRoundRobin[0].size();
-   }
-   ossimElevationDatabase* getElevationDatabase(ossim_uint32 idx)
-   {
-      return m_dbRoundRobin[0][idx].get();
-   }
-   const ossimElevationDatabase* getElevationDatabase(ossim_uint32 idx)const
-   {
-      return m_dbRoundRobin[0][idx].get();
-   }
-   void addDatabase(ossimElevationDatabase* database);
-   bool loadElevationPath(const ossimFilename& path);
-   
-   void setDefaultHeightAboveEllipsoid(double meters) {m_defaultHeightAboveEllipsoid=meters;}
-   void setElevationOffset(double meters) {m_elevationOffset=meters;}
-   double getElevationOffset() const { return m_elevationOffset; }
-   
-   void getOpenCellList(std::vector<ossimFilename>& list) const;
-
-   /**
-    * @brief Gets a list of elevation cells needed to cover bounding box.
-    * @param connectionString Typically elevation repository, e.g.:
-    * "/data1/elevation/srtm/1arc"
-    * @param minLat Minimum latitude of bounding box.
-    * @param minLon Minimum longitude of bounding box.
-    * @param maxLat Maximum latitude of bounding box.
-    * @param maxLon Maximum longitude of bounding box.
-    * @param cells Initialized by this.
-    * @param maxNumberOfCells Value of 0 indicates return as many as you can.  Any positive
-    *        number will only return that number of cells.
-    */
-   void getCellsForBounds( const std::string& connectionString,
-                           const ossim_float64& minLat,
-                           const ossim_float64& minLon,
-                           const ossim_float64& maxLat,
-                           const ossim_float64& maxLon,
-                           std::vector<std::string>& cells,
-                           ossim_uint32 maxNumberOfCells=0 );
-
-   /**
-    * @brief Gets a list of elevation cells needed to cover bounding box.
-    *
-    * This implementation sorts elevation repositories by resolution, best
-    * first, then searches cells for bounds. Search is stopped on the first
-    * repository that has cells.
-    * 
-    * @param minLat Minimum latitude of bounding box.
-    * @param minLon Minimum longitude of bounding box.
-    * @param maxLat Maximum latitude of bounding box.
-    * @param maxLon Maximum longitude of bounding box.
-    * @param cells Initialized by this.
-    * @param maxNumberOfCells Value of 0 indicates return as many as you can.  Any positive
-    *        number will only return that number of cells.
-    */
-   void getCellsForBounds( const ossim_float64& minLat,
-                           const ossim_float64& minLon,
-                           const ossim_float64& maxLat,
-                           const ossim_float64& maxLon,
-                           std::vector<std::string>& cells,
-                           ossim_uint32 maxNumberOfCells=0 );
-   void getCellsForBounds( const ossimGrect& bounds,
-                           std::vector<std::string>& cells,
-                           ossim_uint32 maxNumberOfCells=0 );
-
-   void setUseGeoidIfNullFlag(bool flag) { m_useGeoidIfNullFlag = flag; }
-   bool getUseGeoidIfNullFlag() const { return m_useGeoidIfNullFlag; }
-   void setRoundRobinMaxSize(ossim_uint32 size);
-
-   void clear();
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-   
-   virtual void accept(ossimVisitor& visitor);
-   
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-   virtual ossimObject* dup() const { return 0; } // required to implement but not permitted to call
-
-   ossimElevManager();
-   void loadStandardElevationPaths();
-
-   ElevationDatabaseListType& getNextElevDbList() const; // for multithreading
-   
-   //static ossimElevManager* m_instance;
-   mutable std::vector<ElevationDatabaseListType> m_dbRoundRobin;
-   ossim_uint32 m_maxRoundRobinSize;
-   ossim_float64 m_defaultHeightAboveEllipsoid;
-   ossim_float64 m_elevationOffset;
-   
-   // if an elevation is returned that's null for ellipsoid then use the geoid manager to calculate a shift
-   bool m_useGeoidIfNullFlag;
-   
-   mutable ossim_uint32 m_currentDatabaseIdx;
-   
-   /**
-    * I have tried the readwrite lock interfaces but have found it unstable.  I am using the standard Mutex
-    * and it seems to be much more stable across all platforms.  More testing needs to occur for the ReadWriteMutex.
-    * For now we will use Mutex.
-    */
-   mutable OpenThreads::Mutex m_mutex;
-};
-
-#endif
diff --git a/ossim/include/ossim/elevation/ossimElevSourceFactory.h b/ossim/include/ossim/elevation/ossimElevSourceFactory.h
deleted file mode 100644
index 717e58d..0000000
--- a/ossim/include/ossim/elevation/ossimElevSourceFactory.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//----------------------------------------------------------------------------
-// FILE: ossimElevSourceFactory.cc
-//
-// Copyright (C) 2002 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Class declaration for ossimElevSourceFactory.
-//
-// This is the base class interface for elevation source factories which main
-// function is to return an elevation source that covers the ground point
-// passed to the "getElevSource" method.
-//
-// Note the caller of "getElevSource" is responsible for managing the memory
-// new'd from the method.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimElevSourceFactory.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimElevSourceFactory_HEADER
-#define ossimElevSourceFactory_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimFilename.h>
-
-class ossimElevSource;
-class ossimGpt;
-
-/*!****************************************************************************
- * CLASS:  ossimElevSourceFactory
- *
- *****************************************************************************/
-class OSSIM_DLL ossimElevSourceFactory : public ossimObject
-{
-public:
-
-   /** default constructor */
-   ossimElevSourceFactory();
-
-   /** virtual destructor */
-   virtual ~ossimElevSourceFactory();
-
-   /**
-    *  Pure virtual method.
-    *  return an elevation source pointer that has elevation coverage for the
-    *  ground point passed in.
-    *  Note the caller of this method is responsible for managing the memory
-    *  allocated.
-    */
-   virtual ossimElevSource* getNewElevSource(const ossimGpt& gpt)const=0;
-
-   /**
-    * @return The directory the factory returns data from.
-    */
-   virtual ossimFilename getDirectory() const;
-
-   /**
-    * @param directory The directory to return data from.
-    */
-   virtual void setDirectory(const ossimFilename& directory);
-
-protected:
-   ossimFilename theDirectory;
-   
-TYPE_DATA
-}; 
-
-#endif /* End of "#ifndef ossimElevSourceFactory_HEADER" */
-
diff --git a/ossim/include/ossim/elevation/ossimElevationCellDatabase.h b/ossim/include/ossim/elevation/ossimElevationCellDatabase.h
deleted file mode 100644
index cf40646..0000000
--- a/ossim/include/ossim/elevation/ossimElevationCellDatabase.h
+++ /dev/null
@@ -1,170 +0,0 @@
-#ifndef ossimElevationCellDatabase_HEADER
-#define ossimElevationCellDatabase_HEADER 1
-#include <ossim/elevation/ossimElevationDatabase.h>
-
-class OSSIM_DLL ossimElevationCellDatabase : public ossimElevationDatabase
-{
-public:
-   struct CellInfo : ossimReferenced
-   {
-      CellInfo(ossim_uint64 id, ossimElevCellHandler* handler = 0)
-         :ossimReferenced(),
-          m_id(id),
-          m_handler(handler),
-          m_timestamp(0)
-      {
-            m_timestamp = ossimTimer::instance()->tick();
-      }
-      CellInfo(const CellInfo& src)
-         :ossimReferenced(src),
-          m_id(src.m_id),
-          m_handler(src.m_handler),
-          m_timestamp(src.m_timestamp)
-      {
-      }
-      CellInfo()
-         :ossimReferenced(),
-          m_id(0),
-          m_handler(0),
-          m_timestamp(0)
-      {
-      }
-      const CellInfo& operator =(const CellInfo& src)
-      {
-         if (this != &src)
-         {
-            m_id = src.m_id;
-            m_handler = src.m_handler;
-            m_timestamp = src.m_timestamp;
-         }
-         return *this;
-      }
-      void updateTimestamp()
-      {
-         m_timestamp = ossimTimer::instance()->tick();
-      }
-      ossim_uint64 id()const
-      {
-         return m_id;
-      }
-      ossim_uint64                      m_id;
-      ossimRefPtr<ossimElevCellHandler> m_handler;
-      ossimTimer::Timer_t               m_timestamp;
-   };
-
-   typedef std::map<ossim_uint64, ossimRefPtr<CellInfo> > CellMap;
-   
-   ossimElevationCellDatabase()
-      :ossimElevationDatabase(),
-      m_minOpenCells(5),
-      m_maxOpenCells(10),
-      m_memoryMapCellsFlag(false)
-   {
-   }
-   ossimElevationCellDatabase(const ossimElevationCellDatabase& src)
-      :ossimElevationDatabase(src),
-      m_minOpenCells(src.m_minOpenCells),
-      m_maxOpenCells(src.m_maxOpenCells),
-      m_cacheMap(src.m_cacheMap),
-      m_memoryMapCellsFlag(src.m_memoryMapCellsFlag)
-   {
-   }
-
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   virtual ossim_uint32 getMinOpenCells()const
-   {
-      return m_minOpenCells;
-   }
-   virtual ossim_uint32 getMaxOpenCells()const
-   {
-      return m_maxOpenCells;
-   }
-   virtual void setMinMaxOpenCells(ossim_uint64 minCellCount,
-                                   ossim_uint64 maxCellCount)
-   {
-      m_minOpenCells = minCellCount;
-      m_maxOpenCells = maxCellCount;
-   }
-   virtual bool getMemoryMapCellsFlag()const
-   {
-      return m_memoryMapCellsFlag;
-   }
-   virtual void setMemoryMapCellsFlag(bool flag)
-   {
-      m_memoryMapCellsFlag = flag;
-   }
-
-   virtual void getOpenCellList(std::vector<ossimFilename>& list) const;
-
-   /**
-    * @brief Gets a list of elevation cells needed to cover bounding box.
-    * @param connectionString Typically elevation repository, e.g.:
-    * "/data1/elevation/srtm/1arc"
-    * @param minLat Minimum latitude of bounding box.
-    * @param minLon Minimum longitude of bounding box.
-    * @param maxLat Maximum latitude of bounding box.
-    * @param maxLon Maximum longitude of bounding box.
-    * @param cells Initialized by this.
-    * @param maxNumberOfCells Value of 0 indicates return as many as you can.  Any positive
-    *        number will only return that number of cells.
-    */   
-   void getCellsForBounds( const ossim_float64& minLat,
-                           const ossim_float64& minLon,
-                           const ossim_float64& maxLat,
-                           const ossim_float64& maxLon,
-                           std::vector<std::string>& cells,
-                           ossim_uint32 maxNumberOfCells=0 );
-
-   virtual ossim_uint64 createId(const ossimGpt& /* pt */)const
-   {
-      return 0;
-   }
-   virtual ossimRefPtr<ossimElevCellHandler> getOrCreateCellHandler(const ossimGpt& gpt);
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-   virtual ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& /* gpt */)
-   {
-      return 0;
-   }
-   virtual void remove(ossim_uint64 id)
-   {
-      CellMap::iterator iter = m_cacheMap.find(id);
-      if(iter != m_cacheMap.end())
-      {
-         m_cacheMap.erase(iter);
-      }
-   }
-   void flushCacheToMinOpenCells()
-   {
-      // lets flush the cache from least recently used to recent.
-      //
-      CellMap sortedMap;
-      CellMap::iterator iter = m_cacheMap.begin();
-      
-      while(iter != m_cacheMap.end())
-      {
-         sortedMap.insert(std::make_pair(iter->second->m_timestamp, iter->second));
-         ++iter;
-      }
-      
-      iter = sortedMap.begin();
-      while((iter!=sortedMap.end())&&(m_cacheMap.size() > m_minOpenCells))
-      {
-         remove(iter->second->id());
-         ++iter;
-      }
-   }
-   
-   ossim_uint32               m_minOpenCells;
-   ossim_uint32               m_maxOpenCells;
-   mutable OpenThreads::Mutex m_cacheMapMutex;
-   CellMap                    m_cacheMap;
-   ossim_uint32               m_memoryMapCellsFlag;
-   
-   TYPE_DATA;
-};
-
-#endif /* #ifndef ossimElevationCellDatabase_HEADER */
diff --git a/ossim/include/ossim/elevation/ossimImageElevationDatabase.h b/ossim/include/ossim/elevation/ossimImageElevationDatabase.h
deleted file mode 100644
index 500b9d1..0000000
--- a/ossim/include/ossim/elevation/ossimImageElevationDatabase.h
+++ /dev/null
@@ -1,219 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimImageElevationDatabase.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: See description for class below.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimImageElevationDatabase_HEADER
-#define ossimImageElevationDatabase_HEADER 1
-
-#include <ossim/elevation/ossimElevationCellDatabase.h>
-#include <ossim/base/ossimFileProcessorInterface.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimRtti.h>
-#include <map>
-
-class ossimString;
-
-/**
- * @class ossimTiledElevationDatabase
- *
- * Elevation source used for working with generic images opened by an
- * ossimImageHandler. This class is typically utilized through the
- * ossimElevManager.
- */
-class OSSIM_DLL ossimImageElevationDatabase :
-   public ossimElevationCellDatabase, public ossimFileProcessorInterface
-{
-public:
-
-   /** default constructor */
-   ossimImageElevationDatabase();
-
-   /**
-    * @brief Open a connection to a database.
-    *
-    * @param connectionString File or directory to open.  In most cases this
-    * will point to a directory containing DEMs. Satisfies pure virtual
-    * ossimElevationDatabase::open().
-    *
-    * @return true on success, false on error.
-    */   
-   virtual bool open(const ossimString& connectionString);
-
-   /** @brief close method. Unreferences all data. */
-   virtual void close();
-
-   virtual ossimObject* dup() const
-   {
-      ossimImageElevationDatabase* duped = new ossimImageElevationDatabase;
-      duped->open(m_connectionString);
-      return duped;
-   }
-
-   /**
-    * @brief Maps elevation data for region to a grid.
-    *
-    * This uses connectionString passed to open method as starting point.
-    */
-   void mapRegion(const ossimGrect& region);
-
-   /**
-    * @brief Get height above MSL for point.
-    *
-    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
-    * 
-    * @return Height above MSL.
-    */
-   virtual double getHeightAboveMSL(const ossimGpt& gpt);
-
-   /**
-    * @brief Get height above ellipsoid for point.
-    *
-    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
-    * 
-    * @return Height above MSL.
-    */
-   virtual double getHeightAboveEllipsoid(const ossimGpt&);
-   
-   /**
-    * Satisfies pure virtual ossimElevSource::pointHasCoverage
-    * 
-    * @return true if database has coverage for point.
-    */
-   virtual bool pointHasCoverage(const ossimGpt& gpt) const;
-
-
-   virtual bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const;
-
-
-   /**
-    * Statisfies pure virtual ossimElevSource::getAccuracyLE90.
-    * @return The vertical accuracy (90% confidence) in the
-    * region of gpt:
-    */
-   //virtual double getAccuracyLE90(const ossimGpt& gpt) const;
-   
-   /**
-    * Statisfies pure virtual ossimElevSource::getAccuracyCE90.
-    * @return The horizontal accuracy (90% confidence) in the
-    * region of gpt.
-    */
-   //virtual double getAccuracyCE90(const ossimGpt& gpt) const;
-
-   /** @brief Initialize from keyword list. */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /** @brief Save the state to a keyword list. */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   /**
-    * @brief Gets the bounding rectangle/coverage of elevation.
-    *
-    * @param rect Rectangle to initialize.
-    */
-   void getBoundingRect(ossimGrect& rect) const;
-
-   /**
-    * @brief ProcessFile method.
-    *
-    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
-    *
-    * This method is linked to the ossimFileWalker::walk method via a pointer
-    * to this class.
-    * 
-    * @param file to process.
-    */
-   virtual void processFile(const ossimFilename& file);
-   
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-   /**
-    * @Brief Protected destructor.
-    *
-    * This class is derived from ossimReferenced so users should always use
-    * ossimRefPtr<ossimImageElevationDatabase> to hold instance.
-    */
-   virtual ~ossimImageElevationDatabase();
-
-   virtual ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& gpt);
-
-   // virtual ossim_uint64 createId(const ossimGpt& pt) const;
-
-   /**
-    * @brief Gets cell for point.
-    *
-    * This override ossimElevationCellDatabase::getOrCreateCellHandler as we cannot use
-    * the createId as our cells could be of any size.
-    */
-   virtual ossimRefPtr<ossimElevCellHandler> getOrCreateCellHandler(const ossimGpt& gpt);
-
-   /**
-    * @brief Removes an entry from the m_cacheMap and m_entryMap maps.
-    */
-   virtual void remove(ossim_uint64 id);
-
-private:
-
-   // Private container to hold bounding rect and image handler.
-   struct ossimImageElevationFileEntry
-   {
-      /** @brief default constructor */
-      ossimImageElevationFileEntry();
-
-      /** @brief Constructor that takes a file name. */
-      ossimImageElevationFileEntry(const ossimFilename& file);
-
-      ossimImageElevationFileEntry(const ossimImageElevationFileEntry& copy_this);
-
-      /** file name */
-      ossimFilename m_file;
-
-      /** Bounding rectangle in decimal degrees. */
-      ossimGrect m_rect;
-
-      /** True if in ossimElevationCellDatabase::m_cacheMap. */
-      bool m_loadedFlag;
-   };  
-
-   /**
-    * @brief Initializes m_entryMap with all loadable files from
-    * m_connectionString.
-    */
-   void loadFileMap();
-
-   /** Hidden from use copy constructor */
-   ossimImageElevationDatabase(const ossimImageElevationDatabase& copy_this);
-   
-   std::map<ossim_uint64, ossimImageElevationFileEntry> m_entryMap;
-   ossim_uint64       m_lastMapKey;
-   ossim_uint64       m_lastAccessedId;
-
-   TYPE_DATA 
-};
-
-inline void ossimImageElevationDatabase::remove(ossim_uint64 id)
-{
-   std::map<ossim_uint64, ossimImageElevationFileEntry>::iterator entryIter = m_entryMap.find(id);
-   if ( entryIter != m_entryMap.end() )
-   {
-      (*entryIter).second.m_loadedFlag = false;
-   }
-   ossimElevationCellDatabase::remove(id);
-}
-
-#endif /* ossimImageElevationDatabase_HEADER */
-
diff --git a/ossim/include/ossim/elevation/ossimImageElevationHandler.h b/ossim/include/ossim/elevation/ossimImageElevationHandler.h
deleted file mode 100644
index 2bf6464..0000000
--- a/ossim/include/ossim/elevation/ossimImageElevationHandler.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimImageElevationHandler.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: See description for class below.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimImageElevationHandler_HEADER
-#define ossimImageElevationHandler_HEADER 1
-
-#include <ossim/elevation/ossimElevCellHandler.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <OpenThreads/Mutex>
-
-/**
- * @class ossimImageElevationHandler
- *
- * Elevation source for a generic image opened via ossimImageHandler.
- */
-class OSSIM_DLL ossimImageElevationHandler : public ossimElevCellHandler
-{
-public:
-
-   /** default constructor */
-   ossimImageElevationHandler();
-   ossimImageElevationHandler(const ossimFilename& file);
-
-   /**
-    * METHOD: getHeightAboveMSL
-    * Height access methods.
-    */
-   virtual double getHeightAboveMSL(const ossimGpt&);
-
-   /**
-    *  METHOD:  getSizeOfElevCell
-    *  Returns the number of post in the cell.  Satisfies pure virtual.
-    *  Note:  x = longitude, y = latitude
-    */
-   virtual ossimIpt getSizeOfElevCell() const;
-      
-   /**
-    *  METHOD:  getPostValue
-    *  Returns the value at a given grid point as a double.
-    *  Satisfies pure virtual.
-    */
-   virtual double getPostValue(const ossimIpt& gridPt) const;
-
-   /** @return True if open, false if not. */
-   virtual bool isOpen()const;
-   
-   /**
-    * Opens a stream to the srtm cell.
-    *
-    * @return Returns true on success, false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-
-   /** @brief Closes the stream to the file. */
-   virtual void close();
-
-   /**
-    * @brief pointHasCoverage(gpt)
-    *
-    * Overrides ossimElevCellHandler::pointHasCoverage
-    * @return TRUE if coverage exists over gpt.
-    */
-   virtual bool pointHasCoverage(const ossimGpt&) const;
-
-   virtual ossimObject* dup () const { return new ossimImageElevationHandler(this->getFilename()); }
-
-protected:
-   /**
-    * @Brief Protected destructor.
-    *
-    * This class is derived from ossimReferenced so users should always use
-    * ossimRefPtr<ossimImageElevationHandler> to hold instance.
-    */
-   virtual ~ossimImageElevationHandler();
-   
-private:
-
-   /** Hidden from use copy constructor */
-   ossimImageElevationHandler(const ossimImageElevationHandler&);
-   
-   /** Hidden from use assignment operator */
-   const ossimImageElevationHandler& operator= (const ossimImageElevationHandler& rhs);
-
-
-   /** Pointers to links in chain. */
-   ossimRefPtr<ossimImageHandler>      m_ih;
-   ossimRefPtr<ossimImageGeometry>     m_geom;
-
-   /** Image space rect stored as drect for inlined pointHasCoverage method. */
-   ossimDrect                          m_rect;
-   
-   mutable OpenThreads::Mutex          m_mutex; 
-
-   TYPE_DATA
-};
-
-inline bool ossimImageElevationHandler::isOpen() const
-{
-   return m_ih.valid();
-}
-
-inline void ossimImageElevationHandler::close()
-{
-   m_geom  = 0;
-   m_ih    = 0;
-}
-
-inline bool ossimImageElevationHandler::pointHasCoverage(const ossimGpt& gpt) const
-{
-   if ( m_geom.valid() )
-   {
-      ossimDpt dpt;
-      m_geom->worldToLocal(gpt, dpt);
-      return m_rect.pointWithin(dpt);
-   }
-   return false;
-}
-
-#endif /* ossimImageElevationHandler_HEADER */
-
diff --git a/ossim/include/ossim/elevation/ossimSrtmElevationDatabase.h b/ossim/include/ossim/elevation/ossimSrtmElevationDatabase.h
deleted file mode 100644
index 55819bb..0000000
--- a/ossim/include/ossim/elevation/ossimSrtmElevationDatabase.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimSrtmElevationDatabase_HEADER
-#define ossimSrtmElevationDatabase_HEADER 1
-
-#include <ossim/elevation/ossimElevationCellDatabase.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/elevation/ossimSrtmHandler.h>
-#include <OpenThreads/Mutex>
-
-class OSSIM_DLL ossimSrtmElevationDatabase : public ossimElevationCellDatabase
-{
-public:
-   typedef std::vector<ossimRefPtr<CellInfo> > DirectMap; // 360x180 cell grid
-   ossimSrtmElevationDatabase()
-   :ossimElevationCellDatabase()
-   {
-   }
-   ossimSrtmElevationDatabase(const ossimSrtmElevationDatabase& rhs)
-   :ossimElevationCellDatabase(rhs)
-   {
-   }
-   virtual ~ossimSrtmElevationDatabase()
-   {
-   }
-
-   virtual ossimObject* dup() const
-   {
-      ossimSrtmElevationDatabase* duped = new ossimSrtmElevationDatabase;
-      duped->open(m_connectionString);
-      return duped;
-   }
-
-   virtual bool open(const ossimString& connectionString);
-   bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& /*gpt*/) const;
-   virtual bool pointHasCoverage(const ossimGpt& gpt) const
-   {
-      ossimFilename filename;
-      createFullPath(filename, gpt);
-      
-      return filename.exists();
-   }
-   virtual double getHeightAboveMSL(const ossimGpt&);
-   virtual double getHeightAboveEllipsoid(const ossimGpt& gpt);
-   virtual ossim_uint64 createId(const ossimGpt& pt)const
-   {
-      ossim_uint64 y = static_cast<ossim_uint64>(ossim::wrap(pt.latd(), -90.0, 90.0)+90.0);
-      ossim_uint64 x = static_cast<ossim_uint64>(ossim::wrap(pt.lond(),-180.0,180.0)+180.0);
-      // map the extreme edge to the same ID ax the 179 west cell and the same for the 89
-      // degree north cell.
-      //
-      x = x==360?359:x;
-      y = y==180?179:y;
-      // Srtm databases are 1x1 degree cells and we will use a world 
-      // grid for id generation.
-      //
-      return (y*360+x);
-   }
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix = 0)const;
-   
-protected:
-   bool openSrtmDirectory(const ossimFilename& dir);
-   void createRelativePath(ossimFilename& file, const ossimGpt& gpt)const;
-   void createFullPath(ossimFilename& file, const ossimGpt& gpt)const
-   {
-      ossimFilename relativeFile;
-      createRelativePath(relativeFile, gpt);
-      file = ossimFilename(m_connectionString).dirCat(relativeFile);
-   }
-
-   ossimRefPtr<ossimElevCellHandler> createCell(const ossimGpt& gpt);
-
-   TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/elevation/ossimSrtmFactory.h b/ossim/include/ossim/elevation/ossimSrtmFactory.h
deleted file mode 100644
index ab968fb..0000000
--- a/ossim/include/ossim/elevation/ossimSrtmFactory.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Shuttle Radar Topography Mission (SRTM) factory to return an
-// ossimSrtmElevSource given a ground point.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimSrtmFactory.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimSrtmFactory_HEADER
-#define ossimSrtmFactory_HEADER
-
-#include <ossim/elevation/ossimElevSourceFactory.h>
-
-/**
- * @class ossimSrtmFactory Used by the elevation manager, this class returns
- * an ossimSrtmElevSource given a ground point and some directory with srtm
- * files in it.
- */
-class OSSIM_DLL ossimSrtmFactory : public ossimElevSourceFactory
-{
-public:
-
-   /** default constructor */
-   ossimSrtmFactory();
-
-   /** Constructor that takes a directory name. */
-   ossimSrtmFactory(const ossimFilename& dir);
-
-   /** destructor */
-   virtual ~ossimSrtmFactory();
-
-   /**
-    * Open the appropriate ossimSrtmElevSource that covers given a
-    * ground point.
-    *
-    * @param gpt Ground point that an elevation source is need for.
-    *
-    * @return Returns a pointer to an ossimElevSource if an srtm file is found
-    * that can cover the ground point.  Returns NULL if no cell is found
-    * for the point.
-    */
-   virtual ossimElevSource* getNewElevSource(const ossimGpt& gpt) const;
-   
-protected:
-
-TYPE_DATA
-};
-
-#endif /* End of "#ifndef ossimSrtmFactory_HEADER" */
-
diff --git a/ossim/include/ossim/elevation/ossimTiledElevationDatabase.h b/ossim/include/ossim/elevation/ossimTiledElevationDatabase.h
deleted file mode 100644
index e0a38c7..0000000
--- a/ossim/include/ossim/elevation/ossimTiledElevationDatabase.h
+++ /dev/null
@@ -1,223 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimTiledElevationDatabase.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: See description for class below.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimTiledElevationDatabase_HEADER
-#define ossimTiledElevationDatabase_HEADER 1
-
-#include <ossim/elevation/ossimElevationDatabase.h>
-#include <ossim/base/ossimFileProcessorInterface.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimRtti.h>
-#include <vector>
-
-class ossimDblGrid;
-class ossimFilename;
-class ossimFileWalker;
-class ossimImageData;
-class ossimImageGeometry;
-class ossimImageHandler;
-class ossimProjection;
-class ossimSingleImageChain;
-class ossimString;
-
-/**
- * @class ossimTiledElevationDatabase
- *
- * Elevation source used for working with generic images opened by an
- * ossimImageHandler.  This class supplies a mapRegion method used to map a
- * region of elevation to a grid.  The grid in turn is used for the
- * getHeightAboveMSL.  This class is for applications that know their region
- * of interest up front and want to bypass the ossimElevManager and grid the
- * elevation prior to processing for speed.  Can work on a file or a
- * directory of files.
- */
-class OSSIM_DLL ossimTiledElevationDatabase :
-   public ossimElevationDatabase, public ossimFileProcessorInterface
-{
-public:
-
-   /** default constructor */
-   ossimTiledElevationDatabase();
-
-   /**
-    * @brief Open a connection to a database.
-    *
-    * @param connectionString File or directory to open.  In most cases this
-    * will point to a directory containing DEMs. Satisfies pure virtual
-    * ossimElevationDatabase::open().
-    *
-    * @return true on success, false on error.
-    */   
-   virtual bool open(const ossimString& connectionString);
-
-   /** @brief close method. Unreferences all data. */
-   virtual void close();
-
-   /**
-    * @brief Maps elevation data for region to a grid.
-    *
-    * This uses connectionString passed to open method as starting point.
-    */
-   void mapRegion(const ossimGrect& region);
-
-   /**
-    * @brief Get height above MSL for point.
-    *
-    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
-    * 
-    * @return Height above MSL.
-    */
-   virtual double getHeightAboveMSL(const ossimGpt& gpt);
-
-   /**
-    * @brief Get height above ellipsoid for point.
-    *
-    * Satisfies pure virtual ossimElevSource::getHeightAboveMSL().
-    * 
-    * @return Height above MSL.
-    */
-   virtual double getHeightAboveEllipsoid(const ossimGpt&);
-   
-   /**
-    * Satisfies pure virtual ossimElevSource::pointHasCoverage
-    * 
-    * @return true if database has coverage for point.
-    */
-   virtual bool pointHasCoverage(const ossimGpt& gpt) const;
-
-
-   /** @brief Initialize from keyword list. */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /** @brief Save the state to a keyword list. */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   
-   bool getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& /*gpt*/) const
-   {
-      info.makeNan();
-      
-      return false;
-   }
-   
-   /**
-    * @brief ProcessFile method.
-    *
-    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
-    *
-    * This method is linked to the ossimFileWalker::walk method via a callback
-    * mechanism.  It is called by the ossimFileWalk (caller).  This class
-    * (callee) sets recurse and return flags accordingly to control
-    * the ossimFileWalker, e.g. don't recurse, stop altogether.
-    * 
-    * @param file to process.
-    */
-   virtual void processFile(const ossimFilename& file);
-   
-   virtual std::ostream& print(std::ostream& out) const;
-
-   virtual ossimObject* dup() const
-   {
-      ossimTiledElevationDatabase* duped = new ossimTiledElevationDatabase;
-      duped->open(m_connectionString);
-      return duped;
-   }
-
-protected:
-   /** Protected destructor as this is derived from ossimRefenced. */
-   virtual ~ossimTiledElevationDatabase();
-
-private:
-
-   // Private container to hold bounding rect and image handler.
-   struct ossimTiledElevationEntry
-   {
-      /** @brief default constructor */
-      ossimTiledElevationEntry();
-
-      /** @brif Constructor that takes rectangle and chain. */
-      ossimTiledElevationEntry(const ossimGrect& rect,
-                               ossimRefPtr<ossimSingleImageChain> sic );
-
-      /** Bounding rectangle in decimal degrees. */
-      ossimGrect m_rect;
-
-      /** Hold pointer to single image chain. */
-      ossimRefPtr<ossimSingleImageChain> m_sic;
-   };
-
-   /**
-    * @brief adds entry to the list checking for duplicates.
-    */
-   void addEntry(const ossimTiledElevationEntry& entry);
-
-   /**
-    * @brief Initializes m_referenceProj from the first entry.
-    */
-   void initializeReferenceProjection();
-
-   /**
-    * @return true if file is a directory based image and the stager should go
-    * on to next directory; false if stager should continue with directory.
-    */
-   bool isDirectoryBasedImage(ossimRefPtr<ossimImageHandler> ih);
-
-   /**
-    * @brief Check for match of the following against the first entry of:
-    *  bands, projection, scalar type and scale.
-    * @returns true if good, false if not the same.
-    */
-   bool isCompatible(ossimImageHandler* ih,
-                     ossimImageGeometry* geom,
-                     ossimProjection* proj) const;
-
-   /**
-    * @brief Initialize bounding rectangle from image handler.
-    *
-    * Sets boundingRect to nan if ossimImageGeometry::getCornerGpts returns false.
-    * 
-    * @param ih Image handler.
-    * @param boundingRect Initialized by method.
-    */
-   void getBoundingRect(ossimRefPtr<ossimImageGeometry> geom, ossimGrect& boundingRect) const;
-
-   /** @brief Loads m_requestedRect into m_grid from m_entries. */
-   void mapRegion();
-
-   /** @brief Templated fill grid method. */
-   template <class T> void fillGrid(T dummyTemplate, ossimRefPtr<ossimImageData> data);
-
-   /** Hidden from use copy constructor */
-   ossimTiledElevationDatabase(const ossimTiledElevationDatabase& copy_this);
-
-   std::vector<ossimTiledElevationEntry> m_entries;
-
-   /** Hold region of elevation. */
-   ossimDblGrid* m_grid;
-
-   /** Projection of the first entry.  Stored for convenience. */
-   ossimRefPtr<ossimProjection> m_referenceProj;
-
-   ossimGrect m_requestedRect;
-   ossimGrect m_entryListRect;
-   ossimGrect m_mappedRect; // Requested expanded to even post boundary.
-
-   ossimFileWalker* m_fileWalker;
-
-   TYPE_DATA 
-};
-
-#endif /* ossimTiledElevationDatabase_HEADER */
-
diff --git a/ossim/include/ossim/font/ossimFontFactoryBase.h b/ossim/include/ossim/font/ossimFontFactoryBase.h
deleted file mode 100644
index b845990..0000000
--- a/ossim/include/ossim/font/ossimFontFactoryBase.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//********************************************************************
-// $Id: ossimFontFactoryBase.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFontFactoryBase_HEADER
-#define ossimFontFactoryBase_HEADER
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimFontInformation.h>
-class ossimFont;
-
-class ossimFontFactoryBase
-{
-public:
-
-   virtual ~ossimFontFactoryBase(){}
-   
-   /*!
-    * Will find the best font for the passed in infromation.
-    * If none is found a default font should be returned.
-    */
-   virtual ossimFont* createFont(const ossimFontInformation& information)const=0;
-
-   /*!
-    * Usually for trutype fonts but any font stored in a file it
-    * will try to create a font from it.
-    */
-   virtual ossimFont* createFont(const ossimFilename& file)const=0;
-
-   virtual void getFontInformation(std::vector<ossimFontInformation>& informationList)const=0;
-
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossim3x3ConvolutionFilter.h b/ossim/include/ossim/imaging/ossim3x3ConvolutionFilter.h
deleted file mode 100644
index bcd15e5..0000000
--- a/ossim/include/ossim/imaging/ossim3x3ConvolutionFilter.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossim3x3ConvolutionFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossim3x3ConvolutionFilter_HEADER
-#define ossim3x3ConvolutionFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-
-class ossim3x3ConvolutionFilter : public ossimImageSourceFilter
-{
-public:
-   ossim3x3ConvolutionFilter(ossimObject* owner=NULL);
-
-   virtual ossimString getShortName()const{return ossimString("3x3 Convolution");}
-   virtual ossimString getLongName()const{return ossimString("Convolves the input image with a 3x3 kernel");}
-
-   virtual void getKernel(double kernel[3][3]);
-   
-   virtual void setKernel(double kernel[3][3]);
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-
-   virtual double getNullPixelValue(ossim_uint32 band=0) const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)  const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)  const;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0)const;
-   
-protected:
-   virtual ~ossim3x3ConvolutionFilter();
-
-   /**
-    * Allocates theTile.
-    */
-   void allocate();
-
-   /**
-    * Clears data members theNullPixValue, theMinPixValue, and
-    * theMaxPixValue.
-    */
-   void clearNullMinMax();
-
-   /**
-    * Computes null, min, and max considering input connection and theKernel.
-    */
-   void computeNullMinMax();
-   
-   ossimRefPtr<ossimImageData> theTile;
-   double theKernel[3][3];
-
-   vector<double> theNullPixValue;
-   vector<double> theMinPixValue;
-   vector<double> theMaxPixValue;   
-   
-   /*!
-    * Convolve full means that the input data is full and has
-    * no null data.  We don't have to compare for nulls here
-    */
-   template<class T>
-   void convolveFull(T,
-                     ossimRefPtr<ossimImageData> inputData,
-                     ossimRefPtr<ossimImageData> outputData);
-   
-   /*!
-    * Convolve partial means that the input data is has some
-    * null data.  We will have to compare nulls
-    */
-   template<class T>
-   void convolvePartial(T,
-                        ossimRefPtr<ossimImageData> inputData,
-                        ossimRefPtr<ossimImageData> outputData);
-                       
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossim3x3ConvolutionFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimAOD.h b/ossim/include/ossim/imaging/ossimAOD.h
deleted file mode 100644
index ef25198..0000000
--- a/ossim/include/ossim/imaging/ossimAOD.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kathy Minear
-//
-// Description:
-// 
-// Class to compute Aerosol Optical Depth (AOD) for with atmospheric
-// correction.
-//
-//*************************************************************************
-// $Id: ossimAOD.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimAOD_HEADER
-#define ossimAOD_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimAOD : public ossimImageSourceFilter
-{
-public:
-
-   ossimAOD(ossimObject* owner=NULL);
-   ossimAOD(ossimImageSource* inputSource);
-   ossimAOD(ossimObject* owner, ossimImageSource* inputSource);
-
-
-   virtual ossimString getShortName() const;
-
-   virtual void initialize();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-   
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   virtual ostream& print(ostream& os) const;
-   friend ostream& operator << (ostream& os,  const ossimAOD& hr);
-
-   static void writeTemplate(ostream& os);
-
-protected:
-   virtual ~ossimAOD();
-
-   void allocate();
-   
-   /*!
-    * Method to set unset the enable flag.
-    */
-   void verifyEnabled();
-
-   ossimRefPtr<ossimImageData> theTile;
-
-   TYPE_DATA
-};
-
-#endif /* #ifndef ossimAOD_HEADER */
-
-
diff --git a/ossim/include/ossim/imaging/ossimAdrgTileSource.h b/ossim/include/ossim/imaging/ossimAdrgTileSource.h
deleted file mode 100644
index 7f33914..0000000
--- a/ossim/include/ossim/imaging/ossimAdrgTileSource.h
+++ /dev/null
@@ -1,197 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Ken Melero
-// 
-// Description: This class give the capability to access tiles from an
-//              ADRG file.
-//
-//********************************************************************
-// $Id: ossimAdrgTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimAdrgTileSource_HEADER
-#define ossimAdrgTileSource_HEADER
-
-#include <fstream>
-
-#include <ossim/imaging/ossimImageHandler.h>
-
-class ossimImageData;
-class ossimAdrgHeader;
-
-class OSSIM_DLL ossimAdrgTileSource : public ossimImageHandler
-{
-public:
-   
-   enum
-   {
-      ADRG_TILE_WIDTH  = 128,
-      ADRG_TILE_HEIGHT = 128,
-      ADRG_TILE_SIZE   = 16384, // 128 * 128,
-      BAND_OFFSET      = 16384, // 8 * 2048,
-      NUMBER_OF_BANDS  = 3
-   };
-   
-   enum ADRG_COLOR
-   {
-      RED_BAND    = 0,  // the ADRG rgb value
-      GREEN_BAND  = 1,
-      BLUE_BAND   = 2
-   };
-      
-   ossimAdrgTileSource();
-
-   virtual ossimString getShortName()const;
-   virtual ossimString getLongName()const;
-
-   /**
-    *  @return Returns true on success, false on error.
-    *
-    *  @note This method relies on the data member ossimImageData::theImageFile
-    *  being set.  Callers should do a "setFilename" prior to calling this
-    *  method or use the ossimImageHandler::open that takes a file name and an
-    *  entry index.
-    */
-   virtual bool open();
-
-   /**
-    *  Returns a pointer to a tile given an origin representing the upper
-    *  left corner of the tile to grab from the image.
-    *  Satisfies pure virtual requirement from TileSource class.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    *
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);   
-
-   /**
-    *  Returns the number of bands in the image.
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   
-   virtual ossim_uint32 getNumberOfOutputBands()const;
-
-   /**
-    *  Returns the number of lines in the image.
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    *  Returns the number of samples in the image.  
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
-
-   /**
-    * Returns the zero based image rectangle for the reduced resolution data
-    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
-    */
-   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   /**
-    *  Returns the image geometry object associated with this tile source or NULL if non defined.
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-
-   virtual void close();
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   virtual bool isOpen()const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width, which can be different than the
-    * internal image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileHeight which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   /**
-    * @brief Gets a property for matching name.
-    * @param name The name of the property to get.
-    * @return Returns property matching "name".
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   
-   /**
-    * @brief Gets a list of property names available.
-    * @param propertyNames The list to push back names to.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-protected:
-   virtual ~ossimAdrgTileSource();
-   
-   /**
-    *  Adjust point to even 128 boundary.  Assumes 0,0 origin.
-    */
-   void adjustToStartOfTile(ossimIpt& pt) const;
-   
-   /**
-    *  Returns true on success, false on error.
-    */
-   bool fillBuffer(const ossimIrect& tile_rect,
-                   const ossimIrect& clip_rect,
-                   ossimImageData* tile);
-   
-   ossimRefPtr<ossimImageData>  m_Tile;
-   ossim_uint8*                 m_TileBuffer;
-   std::ifstream                m_FileStr;
-   ossimAdrgHeader*             m_AdrgHeader;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimAppFixedTileCache.h b/ossim/include/ossim/imaging/ossimAppFixedTileCache.h
deleted file mode 100644
index 1f83b7f..0000000
--- a/ossim/include/ossim/imaging/ossimAppFixedTileCache.h
+++ /dev/null
@@ -1,118 +0,0 @@
-//******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: This file contains the Application cache algorithm
-//
-//***********************************
-// $Id: ossimAppFixedTileCache.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimAppFixedTileCache_HEADER
-#define ossimAppFixedTileCache_HEADER
-#include <map>
-#include <list>
-#include <iostream>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimIrect.h>
-#include <OpenThreads/ReadWriteMutex>
-
-class ossimFixedTileCache;
-class ossimImageData;
-
-class OSSIM_DLL ossimAppFixedTileCache
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimAppFixedTileCache& rhs);
-   static const ossim_uint32 DEFAULT_SIZE;
-   typedef ossim_int32 ossimAppFixedCacheId;
-   static ossimAppFixedTileCache *instance(ossim_uint32  maxSize   = 0);
-   virtual ~ossimAppFixedTileCache();
-   
-   /*!
-    * Will flush all cache registered
-    */
-   virtual void flush();
-   virtual void flush(ossimAppFixedCacheId cacheId);
-   virtual void deleteCache(ossimAppFixedCacheId cacheId);
-   /*!
-    * Will create a new Tile cache for this application if the tile size is 0,0 it will
-    * use the default tile size.  Will
-    * return 0 if not successful.
-    */
-   ossimAppFixedCacheId newTileCache(const ossimIrect& tileBoundaryRect,
-                                     const ossimIpt& tileSize=ossimIpt(0,0));
-   ossimAppFixedCacheId newTileCache();
-
-   virtual void setRect(ossimAppFixedCacheId cacheId,
-                        const ossimIrect& boundaryTileRect);
-   virtual void setTileSize(ossimAppFixedCacheId cacheId,
-                            const ossimIpt& tileSize);
-   
-   ossimRefPtr<ossimImageData> getTile(ossimAppFixedCacheId cacheId,
-                           const ossimIpt& origin);
-   ossimRefPtr<ossimImageData> addTile(ossimAppFixedCacheId cacheId,
-                                       ossimRefPtr<ossimImageData> data,
-                                       bool duplicateData=true);
-   
-   ossimRefPtr<ossimImageData> removeTile(ossimAppFixedCacheId cacheId,
-                                          const ossimIpt& origin);
-   void deleteTile(ossimAppFixedCacheId cacheId,
-                   const ossimIpt& origin);
-   
-   const ossimIpt& getTileSize(ossimAppFixedCacheId cacheId);
-   
-   virtual void setMaxCacheSize(ossim_uint32 cacheSize);
-   
-protected:
-//    struct ossimAppFixedCacheTileInfo
-//    {
-//    public:
-//       ossimAppFixedCacheTileInfo(ossimAppFixedCacheId appId,
-//                                  const ossimIpt& origin)
-//          :theAppCacheId(appId),
-//           theOrigin(origin)
-//          {}
-//       ossimAppFixedCacheId  theAppCacheId;
-//       ossimIpt       theOrigin;
-      
-//       bool operator ==(const ossimAppFixedCacheTileInfo &rhs)const
-//          {
-//             return (theAppCacheId == rhs.theAppCacheId &&
-//                     theOrigin     == rhs.theOrigin);
-//          } 
-//    };
-   
-   ossimAppFixedTileCache();
-   
-   ossimFixedTileCache* getCache(ossimAppFixedCacheId cacheId);
-
-   void shrinkGlobalCacheSize(ossim_int32 byteCount);
-   void shrinkCacheSize(ossimAppFixedCacheId id,
-                        ossim_int32 byteCount);
-   void shrinkCacheSize(ossimFixedTileCache* cache,
-                        ossim_int32 byteCount);
-   void deleteAll();
-   
-   static ossimAppFixedTileCache *theInstance;
-   
-   /*!
-    * Will hold the current unique Application id.
-    */
-   static ossimAppFixedCacheId    theUniqueAppIdCounter;
-   ossimIpt                       theTileSize;
-   ossim_uint32                   theMaxCacheSize;
-   ossim_uint32                   theMaxGlobalCacheSize;
-   ossim_uint32                   theCurrentCacheSize;
-
-   std::map<ossimAppFixedCacheId, ossimFixedTileCache*> theAppCacheMap;
-
-   OpenThreads::Mutex theMutex;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimAppTileCache.h b/ossim/include/ossim/imaging/ossimAppTileCache.h
deleted file mode 100644
index f0b9011..0000000
--- a/ossim/include/ossim/imaging/ossimAppTileCache.h
+++ /dev/null
@@ -1,171 +0,0 @@
-//******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: This file contains the Application cache algorithm
-//
-//***********************************
-// $Id: ossimAppTileCache.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimAppTileCache_HEADER
-#define ossimAppTileCache_HEADER
-#include <map>
-#include <list>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimRefPtr.h>
-// class ossimTile;
-class ossimTileCache;
-class ossimDataObject;
-
-class ossimAppTileCache
-{
-public:
-   static const ossim_uint32 DEFAULT_SIZE;
-
-   static const ossim_uint32 DEFAULT_BUCKET_SIZE;
-
-   typedef ossim_int32 ossimAppCacheId;
-   typedef ossim_int32 ossimTileId;
-   typedef map<ossimAppCacheId, ossimTileCache*>::iterator AppIdIterator;
-
-   ~ossimAppTileCache();
-
-   /*!
-    *  We will force a singleton on this class.
-    */
-   static ossimAppTileCache *instance(ossim_uint32  maxSize   = 0);
-
-   /*!
-    * Will create a new Tile cache for this application.  Will
-    * return 0 if not successful.
-    */
-   ossimAppCacheId newTileCache(ossim_uint32 bucketSize=DEFAULT_BUCKET_SIZE);
-
-   /*!
-    * Will retrieve a tile from the cache.  Will return NULL
-    * if not found.
-    */
-   ossimDataObject *get(ossimAppCacheId id,
-                        const ossimDpt3d &origin,
-                        ossim_uint32 resLevel=0);
-
-   /*!
-    * Will remove a tile completly from the cache.  The
-    * returned tile is no longer owned by the cache.
-    */
-   ossimRefPtr<ossimDataObject> removeTile(ossimAppCacheId id,
-                                           const ossimDpt3d &origin,
-                                           unsigned long resLevel);
-   /*!
-    * Will insert a tile into the cache.
-    */
-   ossimRefPtr<ossimDataObject> insert(ossimAppCacheId id,
-                                       const ossimDpt3d &origin,
-                                       const ossimDataObject* data,
-                                       ossim_uint32 resLevel=0);
-   
-   /*!
-    * This will delete the specified cache. The LRU queue will
-    * be updated accordingly
-    */
-   void deleteCache(ossimAppCacheId appId);
-protected:
-
-   struct ossimAppCacheTileInfo
-   {
-   public:
-      ossimAppCacheTileInfo(ossimAppCacheId appId,
-                       const ossimDpt3d& origin,
-                       ossim_uint32    resLevel)
-         :theAppCacheId(appId),
-          theOrigin(origin),
-          theResLevel(resLevel)
-         {}
-      ossimAppCacheId  theAppCacheId;
-      ossimDpt3d         theOrigin;
-      ossim_uint32     theResLevel;
-
-      bool operator ==(const ossimAppCacheTileInfo &rhs)
-         {
-            return (theAppCacheId == rhs.theAppCacheId &&
-                    theOrigin     == rhs.theOrigin &&
-                    theResLevel   == rhs.theResLevel);
-         } 
-  
-   };
-
-   ossimAppTileCache(ossim_uint32  maxSize   = DEFAULT_SIZE)
-      :
-         theMaxCacheSize(maxSize),
-         theCurrentCacheSize(0)
-      {}
-
-   void deleteAll();
-   /*!
-    * Used to get access to the App cache.
-    */
-  ossimTileCache* get(ossimAppCacheId id);
-
-   /*!
-    * will remove all occurances of the appId from the
-    * queue
-    */
-   void deleteAppCacheFromQueue(ossimAppCacheId appId);
-
-   /*!
-    * Will remove a single instance of a tile from the queue.
-    */
-   void removeTileFromQueue(ossimAppCacheId appId,
-                            const ossimDpt3d &origin,
-                            ossim_uint32 resLevel);
-
-   void adjustQueue(ossimAppCacheId id,
-                    const ossimDpt3d &origin,
-                    ossim_uint32 resLevel);
-   /*!
-    * will pop the queue and remove that tile from its cache
-    * and return it to the caller. This is used by the insert
-    * when the max cache size is exceeded.
-    */
-   ossimRefPtr<ossimDataObject> removeTile();
-
-
-   static ossimAppTileCache *theInstance;
-   /*!
-    * Will hold the current unique Application id.
-    */
-   static ossimAppCacheId                   theUniqueAppIdCounter;
-   /*!
-    * Will hold the list of application caches
-    */
-   map<ossimAppCacheId, ossimTileCache*>  theAppCache;
-
-   /*!
-    * Is the maximum size of the cache.
-    */
-   ossim_uint32                      theMaxGlobalCacheSize;
-   ossim_uint32                      theMaxCacheSize;
-   
-
-   /*!
-    * This holds the current cache size.
-    */
-   ossim_uint32                      theCurrentCacheSize;
-   
-
-   /*!
-    * Is used in an Least recently used algorithm
-    */
-   list<ossimAppCacheTileInfo>      theUsedQueue;
-   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimAtCorrRemapper.h b/ossim/include/ossim/imaging/ossimAtCorrRemapper.h
deleted file mode 100644
index 323fc9a..0000000
--- a/ossim/include/ossim/imaging/ossimAtCorrRemapper.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kathy Minear
-//
-// Description:
-// Takes in DNs for any number of bands
-// Converts DNs to Radiance at the satellite values Lsat
-// Converts Lsat to Surface Reflectance values
-//
-//*************************************************************************
-// $Id: ossimAtCorrRemapper.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimAtCorrRemapper_HEADER
-#define ossimAtCorrRemapper_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimAtCorrRemapper : public ossimImageSourceFilter
-{
-public:
-
-   ossimAtCorrRemapper(ossimObject* owner = NULL,
-                       ossimImageSource* inputSource =  NULL,
-                       const ossimString& sensorType = "");
-
-
-   virtual ossimString getShortName() const;
-
-   virtual void initialize();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-   
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   virtual ostream& print(ostream& os) const;
-   friend ostream& operator << (ostream& os,  const ossimAtCorrRemapper& hr);
-
-   vector<double> getNormMinPixelValues() const;
-   vector<double> getNormMaxPixelValues() const;
-
-   void getNormMinPixelValues(vector<double>& v) const;
-   void getNormMaxPixelValues(vector<double>& v) const;
-
-   const ossimString& getSensorType() const;
-
-   void setSensorType(const ossimString& sensorType);
-
-protected:
-   virtual ~ossimAtCorrRemapper();
-
-   /*!
-    * Method to set unset the enable flag.
-    */
-   void verifyEnabled();
-   virtual void interpolate(const ossimDpt& pt,
-                            int band,
-                            double& a,
-                            double& b,
-                            double& c)const;
-                            
-   ossimRefPtr<ossimImageData> theTile;
-   double*            theSurfaceReflectance;
-   bool               theUseInterpolationFlag;
-   vector<double>     theMinPixelValue;
-   vector<double>     theMaxPixelValue;
-   vector<double>     theXaArray;
-   vector<double>     theXbArray;
-   vector<double>     theXcArray;
-   vector<double>     theBiasArray;
-   vector<double>     theGainArray;
-   vector<double>     theCalCoefArray;
-   vector<double>     theBandWidthArray;
-   ossimString        theSensorType;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimAtCorrRemapper_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimBandAverageFilter.h b/ossim/include/ossim/imaging/ossimBandAverageFilter.h
deleted file mode 100644
index 9f12689..0000000
--- a/ossim/include/ossim/imaging/ossimBandAverageFilter.h
+++ /dev/null
@@ -1,111 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBandAverageFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimBandAverageFilter_HEADER
-#define ossimBandAverageFilter_HEADER
-#include <vector>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/**
- * This filter outputs a single band that is the weighted average of all the
- * input bands retrieved from the getTile.  This filter will work with any
- * input scalar type.  Note the OSSIMDLLEXPORT is used for the different
- * compilers that require importing and exporting symbols for shared library
- * support.
- */
-class OSSIMDLLEXPORT ossimBandAverageFilter : public ossimImageSourceFilter
-{
-public:
-   ossimBandAverageFilter();
-   ossimBandAverageFilter(ossimImageSource* input,
-                          const std::vector<double>& weights);
-
-   /**
-    * The data object argument is deprecated and should not be used.
-    * eventually we will remove it from the base classes.  This method will
-    * return 1 if our source is enabled else it calls the base class
-    * getNumberOfOutputBands.
-    */
-   virtual ossim_uint32 getNumberOfOutputBands()const;
-   
-   /**
-    * Since this filter is going to operate in native pixel type we will use
-    * a tmeplate method to do this.  It will check the scalar tpe of the input
-    * and then cat it to set the template variabel to be used within the
-    * template method averageInput.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    * Since we are merging all bands we will use the null pix of the
-    * first input band as our null pix.  If we are disabled we just
-    * return the input s null
-    */
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * We will use the min of all bands as our min.  If we aredisabled
-    * we just return the inputs min
-    */
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   
-   /**
-    * We will use the max of all bands as our max.  If we aredisabled
-    * we just return the inputs max
-    */
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * simple access method to get a weight
-    */
-   double getWeight(ossim_uint32 band)const;
-
-   /**
-    * Sinple access method to set the weight of a band,
-    * We make sure that it is a positive weight
-    */
-   void setWeight(ossim_uint32 band, double weight);
-
-   /**
-    * allocates its tile buffer
-    */
-   virtual void initialize();
-
-   /**
-    * loads its weights to a keywordlist
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   /**
-    * Saves its weights to a keywordlist
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-protected:
-   virtual ~ossimBandAverageFilter();
-   
-  ossimRefPtr<ossimImageData> theTile;
-   std::vector<double>         theWeights;
-
-   void checkWeights();
-   
-   template<class T> void averageInput(
-      T dummyVariable, // used only for template type, value ignored
-      ossimRefPtr<ossimImageData> inputDataObject);
-
-// for Runtime Type Info (RTTI)
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimBandClipFilter.h b/ossim/include/ossim/imaging/ossimBandClipFilter.h
deleted file mode 100644
index dcb2b30..0000000
--- a/ossim/include/ossim/imaging/ossimBandClipFilter.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBandClipFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimBandClipFilter_HEADER
-#define ossimBandClipFilter_HEADER
-#include <vector>
-using namespace std;
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimBandClipFilter : public ossimImageSourceFilter
-{
-public:
-   /*!
-    * Specifies the type of clipping.  The first will
-    * just clip and 
-    */
-   enum ossimBandClipType
-   {
-      ossimBandClipType_NONE             = 0,
-      ossimBandClipType_CLIP             = 1,
-      ossimBandClipType_CLAMP            = 2,
-      ossimBandClipType_LINEAR_STRETCH   = 3,
-      ossimBandClipType_MEDIAN_STRETCH   = 4 
-   };
-
-   ossimBandClipFilter();
-   ossimBandClipFilter(ossimImageSource*,
-                        const vector<double>& minPix,
-                        const vector<double>& maxPix,
-                        ossimBandClipType clipType=ossimBandClipType_NONE);
-   
-   ossimBandClipFilter(ossimImageSource*,
-                        double minPix,
-                        double maxPix,
-                        ossimBandClipType clipType=ossimBandClipType_NONE);
-
-
-   void setClipType(ossimBandClipType clipType);
-
-   ossimBandClipType getClipType()const;
-
-   virtual ossim_uint32 getNumberOfValues()const;
-
-   void setNumberOfValues(ossim_uint32 size);
-   
-   void setMinMaxPix(const vector<double>& minPix,
-                     const vector<double>& maxPix);
-
-   const std::vector<double>& getMinPixList()const;
-   const std::vector<double>  getMaxPixList()const;
-
-   double getMinPix(ossim_uint32 index)const;
-   double getMaxPix(ossim_uint32 index)const;
-
-   ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                       ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = NULL);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = NULL)const;
-protected:
-   virtual ~ossimBandClipFilter();
-
-   void runClip();
-   void runClamp();
-   void runLinearStretch();
-   void runMedianStretch();
-
-   std::vector<double> theMinPix; // normalized min
-   std::vector<double> theMaxPix; // normalized max
-   std::vector<double> theMedian; // normalized median.
-
-   ossimBandClipType           theClipType;
-   ossimRefPtr<ossimImageData> theTile;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimBandMergeSource.h b/ossim/include/ossim/imaging/ossimBandMergeSource.h
deleted file mode 100644
index 076dba1..0000000
--- a/ossim/include/ossim/imaging/ossimBandMergeSource.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBandMergeSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimBandMergeSource_HEADER
-#define ossimBandMergeSource_HEADER
-#include <ossim/imaging/ossimImageCombiner.h>
-
-class ossimImageSourceConnection;
-class ossimImageSource;
-
-class OSSIM_DLL ossimBandMergeSource : public ossimImageCombiner
-{
-public:
-   ossimBandMergeSource();
-   ossimBandMergeSource(ossimConnectableObject::ConnectableObjectList& inputSources);
-   
-   /**
-    * This will merge all the bands from the input source list
-    * into one contiguous ossimImageData object.  This is very
-    * useful when you want to split off an intesity channel in
-    * HSI and then run some algorithms on it and then merge it back.
-    * You can also try to do fusions by converting to an YCbCr and
-    * replace the Y or intensity channel with maybe a high-pass
-    * convolution on the pan.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0);
-   virtual bool getTile(ossimImageData* tile, ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-   
-   /**
-    * Returns the number of bands in a tile returned from this TileSource.
-    * Note: we are supporting sources that can have multiple data objects.
-    * If you want to know the scalar type of an object you can pass in the 
-    */
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
-protected:
-   virtual ~ossimBandMergeSource();
-   /** Performs allocation of "theTile". */
-   void allocate();
-   
-   ossim_uint32                theNumberOfOutputBands;
-   ossimRefPtr<ossimImageData> theTile;
-   
-   ossim_uint32 computeNumberOfInputBands()const;
-
-TYPE_DATA
-};
-#endif /* #ifndef ossimBandMergeSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimBandSelector.h b/ossim/include/ossim/imaging/ossimBandSelector.h
deleted file mode 100644
index 04579b1..0000000
--- a/ossim/include/ossim/imaging/ossimBandSelector.h
+++ /dev/null
@@ -1,169 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt.
-// 
-// Author:  Garrett Potts
-//
-// Description:  Contains class declaration for ossimBandSelector.
-// 
-//*******************************************************************
-//  $Id: ossimBandSelector.h 23427 2015-07-15 14:51:51Z okramer $
-#ifndef ossimBandSelector_HEADER
-#define ossimBandSelector_HEADER 1
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <vector>
- 
-class ossimImageData;
-class ossimImageHandler;
-
-class OSSIM_DLL ossimBandSelector : public ossimImageSourceFilter
-{
-   
-public:
-   enum ossimBandSelectorWithinRangeFlagState
-   {
-      ossimBandSelectorWithinRangeFlagState_NOT_SET      = 0,
-      ossimBandSelectorWithinRangeFlagState_IN_RANGE     = 1,
-      ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE = 2,
-   };
-
-   ossimBandSelector();
-   virtual ~ossimBandSelector();
-   
-   virtual ossimString getLongName()  const;
-   virtual ossimString getShortName() const;
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    * Initializes bandList to the zero based order of output bands.
-    */
-   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
-
-   /**
-    * Sets the output band list.
-    *
-    * @param outputBandList List of zero based bands.
-    * @param disablePassThru If true, forces the band selection to be performed by this filter.
-    *        Otherwise, the image handler to the left is directed to select bands if it has that
-    *        capability (default behavior).
-    *
-    * @note The input connection should be established prior to calling this.
-    *
-    * @note Bands can be duplicated.  So if you have a single band input you
-    * can do a band list like "1, 1, 1".   Any band within the list must be
-    * available from the input.  So if you have a 3 band input bands must be
-    * constrained to zero based bands "0, 1, or 2".
-    *
-    * @note Calling this method does not enable filter so callers should do:
-    * theBandSelector->enableSource();
-    * theBandSelector->setOutputBandList(bandList);
-    */
-   virtual void setOutputBandList(const vector<ossim_uint32>& outputBandList,
-                                  bool disablePassThru=false);
-   
-   /**
-    * Returns the number of bands in a tile returned from this TileSource.
-    */
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-
-   /**
-    * @brief Returns the number of input bands.
-    *
-    * Overrides ossimImageSourceFilter::getNumberOfInputBands to check for a
-    * single image chain band selectable image handler on the input.  If one
-    * is present it returns it's number of input bands instead of the number
-    * of the input connection's output bands(our input).  This is needed so
-    * callers, e.g. band selector dialog box can query the number of bands
-    * available.
-    *
-    * @return Number of bands available.
-    */
-   virtual ossim_uint32 getNumberOfInputBands()const;   
-
-   virtual void initialize();
-   
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-   /**
-    *   Override base class so that a disableSource event does not
-    *   reinitialize the object and enable itself.
-    */
-   //virtual void propertyEvent(ossimPropertyEvent& event);
-   //virtual void refreshEvent(ossimRefreshEvent& event);   
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;						  
-   virtual bool isSourceEnabled()const;
-
-protected:
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-
-   /**
-    * Will check all combinations of the band list to see if its 
-    */
-   void checkPassThrough();
-
-   /**
-    * @return true if all bands in theOutputBandList are less than the
-    * number of input's bands.
-    */
-   bool outputBandsWithinInputRange() const;
-
-   /**
-    * @brief Finds and returns band selectable image handler.
-    *
-    * To get a valid pointer there must be one and only one image handler on
-    * the input connection and it must be a band selector.  In other words,
-    * must be a single image chain input and
-    * ossimImageHandler::isBandSelector() must return true.
-    *
-    * @return Pointer to image handler wrapped in an ossimRefPtr on success;
-    * null, on error.
-    */
-   ossimRefPtr<ossimImageHandler> getBandSelectableImageHandler() const;
-
-   /**
-    * @brief Attempts to derive rgb bands from image handler to the left of the
-    * band selector.
-    *
-    * Must be one and only one image handler on the input connection.
-    * In other words, must be a single image chain input.
-    *
-    * @return true on success, false on error.
-    */
-   bool getRgbBandList(std::vector<ossim_uint32>& bandList) const;
-   
-   ossimRefPtr<ossimImageData>           theTile;
-   std::vector<ossim_uint32>             theOutputBandList;
-   ossimBandSelectorWithinRangeFlagState theWithinRangeFlag;
-   bool                                  thePassThroughFlag;
-   bool                                  theDelayLoadRgbFlag;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimBandSelector_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimBandSeparateHandler.h b/ossim/include/ossim/imaging/ossimBandSeparateHandler.h
deleted file mode 100644
index 2efb9e8..0000000
--- a/ossim/include/ossim/imaging/ossimBandSeparateHandler.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Oscar Kramer
-// 
-// Description:
-//
-// Image handler used when the multi-band image has each band represented by a different disk file.
-// This is the case for some Ikonos imagery. 
-//
-//**************************************************************************************************
-// $Id: ossimBandSeparateHandler.h 2644 2011-05-26 15:20:11Z oscar.kramer $
-#ifndef ossimBandSeparateHandler_HEADER
-#define ossimBandSeparateHandler_HEADER
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimBandMergeSource.h>
-
-/**
- *  This class defines an abstract Handler which all image handlers(loaders)
- *  should derive from.
- */
-class OSSIMDLLEXPORT ossimBandSeparateHandler : public ossimImageHandler
-{
-public:
-   //!  Constructor (default):
-   ossimBandSeparateHandler();
-   
-   //! Destructor:
-   virtual ~ossimBandSeparateHandler();
-   
-   //! Opens multiple band-files based on info in metadata file.
-   //! @return Returns true on success, false on error.
-   virtual bool open();
-
-   //! Closes all band-files and clears input handler list.
-   virtual void close();
-
-   //! @return true if open, false if not.
-   virtual bool isOpen()const;
-
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   
-   //! @param resLevel Reduced resolution level to return lines of.
-   //! Default = 0
-   //! @return The number of lines for specified reduced resolution level.
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
-
-   //! @param resLevel Reduced resolution level to return samples of.
-   //! Default = 0
-   //! @return The number of samples for specified reduced resolution level.
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
-   
-   //! Method to save the state of an object to a keyword list.
-   //! Return true if ok or false on error.
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   //! Method to the load (recreate) the state of an object from a keyword
-   //! list.  Return true if ok or false on error.
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   //! Fills the requested tile by pulling pixels from multiple file tiles as needed.
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel);
-
-   //! Returns scalar type of first band (should be the same for all bands)
-   virtual ossimScalarType getOutputScalarType() const;
-
-   //! Overrides base connection method to connect output of merge source.
-   virtual bool canConnectMyOutputTo(ossim_int32 index, const ossimConnectableObject* obj);
-
-   //! Returns the geometry of the first band:
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   //! These images are not tiled
-   virtual ossim_uint32 getImageTileWidth()  const { return 0; }
-   virtual ossim_uint32 getImageTileHeight() const { return 0; }
-
-protected:
-   //! Fetches the list of band file names from the header file. The header file name is contained
-   //! in ossimImageHandler::theImageFile.
-   //! NOTE TO PROGRAMMER: This class is presently tailored to the Ikonos metadata file specifying
-   //! the individual band files. If other "metadata" formats are to be supported, then this class
-   //! should be derived from. This method would therefore be pure virtual in this base-class and 
-   //! only this method would need to be implemented in the derived classes.
-   virtual void getBandFileNames(vector<ossimFilename>& file_names);
-
-  vector<ossimRefPtr<ossimImageHandler> > m_bandFiles;
-  ossimRefPtr<ossimBandMergeSource>       m_mergeSource;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimBandSeparateHandler_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimBitMaskTileSource.h b/ossim/include/ossim/imaging/ossimBitMaskTileSource.h
deleted file mode 100644
index a8226d8..0000000
--- a/ossim/include/ossim/imaging/ossimBitMaskTileSource.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-//*******************************************************************
-//  $Id: ossimBitMaskTileSource.h 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#ifndef ossimBitMaskTileSource_HEADER
-#define ossimBitMaskTileSource_HEADER
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimBitMaskWriter.h>
-
-class ossimImageGeometry;
-
-//*************************************************************************************************
-//! This is the image handler for providing mask pixels to an ossimMaskFilter object.
-//!
-//! This class takes care of reading the custom, bit-compressed OSSIM bit mask file format. 
-//! 
-//! When the developer needs to mask an image, the following needs to be done:
-//!
-//!   Creating the Mask:
-//!   1. A mask file first needs to be created using ossimBitMaskWriter and a source image. The app
-//!      "img2rr --create-mask" directs that program to use ossimBitMaskWriter to generate a mask  
-//!      during overview generation. There is also create-bitmask app that will generate the mask.
-//!   2. An OSSIM ".mask" file should exist on disk after step 0. This is typically the same base 
-//!      name as the source image file being masked.
-//!   
-//!   Using the Mask:
-//!   1. An ossimBitMaskTileSource (derived from ossimImageHandler) needs to be instantiated and
-//!      the mask file name used to open it. 
-//!   3. An ossimMaskFilter (derived from ossimImageCombiner) is the actual filter that combines
-//!      the source image handler and the ossimBitMaskTileSource object to provide the resultant 
-//!      masked tiles.
-//!      
-//! The OSSIM bit mask file contains a small header that consists of:
-//!    magic number,
-//!    starting res level,
-//!    number of res levels
-//!    num columns at starting res level,
-//!    num rows at starting res level, 
-//!    num columns at 2nd res level,
-//!    num rows at 2nd res level, 
-//!    etc., for all res levels
-//!    <space> 
-//!    <compressed binary mask data>
-//!
-//! The number of rows and columns represents the number of bytes in the mask, with each byte
-//! containing 8 alpha mask bits representing 8 pixels in the original image.
-//!
-//! This class functions as an image handler, returning 255 for unmasked pixels, and 0 for masked 
-//! pixels. 
-//! 
-//! For debug purposes, this code initializes the tile to all 128's so that the 
-//! ossimMaskFilter can recognize uninitialized mask data.
-//!
-//*************************************************************************************************
-
-class OSSIM_DLL ossimBitMaskTileSource : public ossimImageHandler
-{
-public:
-
-   ossimBitMaskTileSource();
-
-   //! Return a tile of masks. These are "bit masks", i.e., either 0 (hide) or 1 (show).
-   //! The pixels' remaining 7 bits are cleared and should not be used.
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect, ossim_uint32 rLevel=0);
-   
-   virtual bool         isValidRLevel     (ossim_uint32 res_level)   const;
-   virtual ossim_uint32 getNumberOfLines  (ossim_uint32 res_level=0) const;
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 res_level=0) const;
-
-   virtual ossim_uint32    getNumberOfInputBands()  const { return 1; }
-   virtual ossim_uint32    getNumberOfOutputBands() const { return 1; }
-   virtual ossimScalarType getOutputScalarType()    const { return OSSIM_UINT8; }
-   virtual ossim_uint32    getImageTileWidth()      const { return 0; }
-   virtual ossim_uint32    getImageTileHeight()     const { return 0; }   
-
-   virtual bool isOpen() const;
-   virtual bool open();
-   virtual void close();
-
-   virtual double getNullPixelValue(ossim_uint32 /*band=0*/) const { return 0; }
-   virtual double getMinPixelValue (ossim_uint32 /*band=0*/) const { return 0; }
-   virtual double getMaxPixelValue (ossim_uint32 /*band=0*/) const { return 1.0; }
-
-   //! There is no geometry associated with a mask file -- it is pixel-for-pixel mapped to
-   //! an image file. The image file must have the valid geometry.
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   //! Overrides base class implementation.
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-
-   //! For backward compatibility with older mask format ("Ming Mask"), provide for associating
-   //! the mask with an image handler:
-   void setAssociatedImageHandler(ossimImageHandler* handler);
-
-   //! This class can be used during overview generation, in which case there will be a simultaneous
-   //! mask writing. Instead of accessing a mask file (which may not yet exist), the mask buffer
-   //! of the writer will be accessed directly instead of our own buffer.
-   void setAssociatedMaskWriter(ossimBitMaskWriter* maskWriter);
-
-protected:
-   virtual ~ossimBitMaskTileSource();
-   
-   //! Returns true if this handler recognizes the file name extension as an OSSIM raster mask file.
-   bool isSupportedExtension();
-
-   virtual void establishDecimationFactors();
-
-   ossimRefPtr<ossimImageData>  m_tile;
-   vector<ossim_uint8*>         m_buffers;
-   vector<ossimIpt>             m_bufferSizes;
-   
-   //! For backward compatibility with older mask format ("Ming Mask"), provide for associating
-   //! the mask with an image handler:
-   ossimRefPtr<ossimImageHandler>  m_handler;
-
-   //! This class can be used during overview generation, in which case there will be a simultaneous
-   //! mask writing. Instead of accessing a mask file (which may not yet exist), the mask buffer
-   //! of the writer will be accessed directly instead of our own buffer.
-   ossimRefPtr<ossimBitMaskWriter>  m_maskWriter;
-
-   TYPE_DATA
-};
-
-#endif
-
-
diff --git a/ossim/include/ossim/imaging/ossimBitMaskWriter.h b/ossim/include/ossim/imaging/ossimBitMaskWriter.h
deleted file mode 100644
index 70725dd..0000000
--- a/ossim/include/ossim/imaging/ossimBitMaskWriter.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//*************************************************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-//*************************************************************************************************
-//  $Id: ossimBitMaskWriter.h 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#ifndef ossimBitMaskWriter_HEADER
-#define ossimBitMaskWriter_HEADER
-
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimOutputSource.h>
-#include <ossim/imaging/ossimPixelFlipper.h>
-#include <vector>
-
-class ossimFilename;
-class ossimKeywordlist;
-class ossimImageHandler;
-class ossimBitMaskTileSource;
-
-//*************************************************************************************************
-//! 
-//! Class for computing a mask from an input image source and writing the mask file to disk.
-//!
-//! This class takes care of all details associated with computing, writing and reading the custom,
-//! bit-compressed OSSIM bit mask file format. 
-//! 
-//! When the developer needs to mask an image, the following needs to be done:
-//!
-//!   Creating the Mask:
-//!   1. A mask file first needs to be created using ossimBitMaskWriter and a source image. The app
-//!      "img2rr --create-mask" directs that program to use ossimBitMaskWriter to generate a mask  
-//!      during overview generation. There is also create-bitmask app that will generate the mask.
-//!   2. An OSSIM ".mask" file should exist on disk after step 0. This is typically the same base 
-//!      name as the source image file being masked.
-//!   
-//!   Using the Mask:
-//!   1. An ossimBitMaskTileSource (derived from ossimImageHandler) needs to be instantiated and
-//!      the mask file name used to open it. 
-//!   3. An ossimMaskFilter (derived from ossimImageCombiner) is the actual filter that combines
-//!      the source image handler and the ossimBitMaskTileSource object to provide the resultant 
-//!      masked tiles.
-//!      
-//! The OSSIM bit mask file contains a small header that consists of:
-//!    magic number,
-//!    starting res level,
-//!    number of res levels
-//!    num columns at starting res level,
-//!    num rows at starting res level, 
-//!    num columns at 2nd res level,
-//!    num rows at 2nd res level, 
-//!    etc., for all res levels
-//!    <space> 
-//!    <compressed binary mask data>
-//!
-//! The number of rows and columns represents the number of bytes in the mask, with each byte
-//! containing 8 alpha mask bits representing 8 pixels in the original image.
-//!
-//! The mask is computed here using the specified values for bogus pixels. If a pixel in the source
-//! image is in the range of bogus values, a mask of 0 is assigned to that pixel, otherwise 1. 
-//!
-//*************************************************************************************************
-class OSSIM_DLL ossimBitMaskWriter : public ossimOutputSource
-{
-public:
-   static const char* BM_STARTING_RLEVEL_KW;
-   static const char* MASK_FILE_MAGIC_NUMBER;
-
-   //! Default constructor typically used when reading a mask from disk.
-   ossimBitMaskWriter();
-
-   ~ossimBitMaskWriter();
-
-   //! Sets the NULL pixel value to consider when computing mask:
-   void setBogusPixel(double pixel_value);
-
-   //! Sets the range of pixels (inclusive) to be regarded as NULL pixels when computing mask
-   void setBogusPixelRange(double min, double max);
-
-   //! Sets the starting resolution level for the mask.
-   void setStartingResLevel(ossim_uint32 res_level) { m_startingResLevel = res_level; }
-
-   //! Given a source's tile, derives the alpha mask and saves it in buffer for later writing to 
-   //! disk.
-   void generateMask(ossimRefPtr<ossimImageData> tile, ossim_uint32 rLevel);
-
-   //! For imagery that already has overviews built, but with artifact edge pixels (such as JP2-
-   //! compressed data), it is preferred to build the mask overviews directly from the R0 mask.
-   //! This method will build the remaining number of R-levels from the last defined mask buffer
-   //! such that the total number of R-levels (counting R0) are represented. Returns TRUE if successful.
-   bool buildOverviews(ossim_uint32 total_num_rlevels);
-
-   //! Computes and writes the mask file according to the specification in the KWL.
-   //! Returns TRUE if successful.
-   virtual bool loadState(const ossimKeywordlist& spec, const char* prefix=0);
-
-   virtual bool isOpen() const;
-   virtual bool open();
-   virtual void close();
-
-   virtual bool canConnectMyInputTo(ossim_int32 myInputIndex, 
-                                    const ossimConnectableObject* object) const;
-   virtual ossim_int32 connectMyInputTo (ossimConnectableObject *inputObject, 
-                                         bool makeOutputConnection=true, 
-                                         bool createEventFlag=true);
-
-protected:
-   friend class ossimBitMaskTileSource;
-
-   //! Initializes the flipper (used for identifying pixels for masking) to default values
-   void initializeFlipper();
-
-   //! Deletes allocated buffers and resets all values to defaults.
-   void reset();
-
-   //! Since overviews may not yet exist when the mask is being written, we must compute the
-   //! size of the source image based on the original R0 image size.
-   ossimIpt computeImageSize(ossim_uint32 rlevel, ossimImageData* tile) const;
-
-   ossimRefPtr<ossimPixelFlipper>  m_flipper;
-   vector<ossim_uint8*>            m_buffers;
-   vector<ossimIpt>                m_bufferSizes;
-   ossim_uint32                    m_startingResLevel;
-   ossimIpt                        m_imageSize; //!< Size of full res source image
-};
-
-#endif
-
-
diff --git a/ossim/include/ossim/imaging/ossimBlendMosaic.h b/ossim/include/ossim/imaging/ossimBlendMosaic.h
deleted file mode 100644
index b5aff2a..0000000
--- a/ossim/include/ossim/imaging/ossimBlendMosaic.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBlendMosaic.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimBlendMosaic_HEADER
-#define ossimBlendMosaic_HEADER
-#include <ossim/imaging/ossimImageMosaic.h>
-
-class OSSIMDLLEXPORT ossimBlendMosaic : public ossimImageMosaic
-{
-public:
-   ossimBlendMosaic();
-   ossimBlendMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
-   virtual void initialize();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-
-   void setWeight(ossim_uint32 index, double weight);
-   void setWeights(const std::vector<double>& weights);
-   
-   double getWeight(ossim_uint32 index) const;
-   const std::vector<double>& getWeights()const;
-
-
-   void setNumberOfWeights(ossim_uint32 numberOfWeights);
-   void setAllWeightsTo(double value);
-   
-   /**
-    * Will find the min and max values and then
-    * normalize all weights to be from 0 to 1
-    */
-   void normalizeWeights();
-   void findMinMax(double& minValue, double& maxValue)const;
-   
-protected:
-   virtual ~ossimBlendMosaic();
-   vector<double>              theWeights;
-   ossimRefPtr<ossimImageData> theNormResult;
-   /**
-    * If our inputs have output of different scalar
-    * types then we must normalize so we can blend
-    * different scalar data together.
-    */
-   
-
-   template <class T>
-      ossimRefPtr<ossimImageData> combine(T,
-                                          const ossimIrect& tileRect,
-                                          ossim_uint32);
-   template <class T>
-      ossimRefPtr<ossimImageData> combineNorm(T,
-                                              const ossimIrect& tileRect,
-                                              ossim_uint32);
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimBlendMosaic_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimBrightnessMatch.h b/ossim/include/ossim/imaging/ossimBrightnessMatch.h
deleted file mode 100644
index a179273..0000000
--- a/ossim/include/ossim/imaging/ossimBrightnessMatch.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: A brief description of the contents of the file.
-//
-//*************************************************************************
-// $Id: ossimBrightnessMatch.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimBrightnessMatch_HEADER
-#define ossimBrightnessMatch_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/imaging/ossimBrightnessContrastSource.h>
-
-class ossimBrightnessMatch : public ossimImageSourceFilter
-{
-public:
-   ossimBrightnessMatch();
-
-
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-
-   virtual void initialize();
-   /*---------------------- PROPERTY INTERFACE ---------------------------*/
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   /*--------------------- PROPERTY INTERFACE END ------------------------*/
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-protected:
-   virtual ~ossimBrightnessMatch();
-   
-   double          theTargetBrightness;
-   double          theInputBrightness;
-   ossimRefPtr<ossimImageData> theNormTile;
-
-   ossimRefPtr<ossimBrightnessContrastSource> theBrightnessContrastSource;
-   
-   ossimRefPtr<ossimImageData> runBrightnessMatch();
-
-   void computeInputBrightness();
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimBumpShadeTileSource.h b/ossim/include/ossim/imaging/ossimBumpShadeTileSource.h
deleted file mode 100644
index 0f1f329..0000000
--- a/ossim/include/ossim/imaging/ossimBumpShadeTileSource.h
+++ /dev/null
@@ -1,284 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBumpShadeTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimBumpShadeTileSource_HEADER
-#define ossimBumpShadeTileSource_HEADER
-#include <ossim/imaging/ossimImageCombiner.h>
-#include <ossim/base/ossimPropertyEvent.h>
-#include <ossim/matrix/newmat.h>
-
-class ossimImageData;
-
-class ossimImageSourceConnection;
-
-/**
- * This uses a derivative of Blinn's bump function to compute a 3-D
- * looking image.  The elevation data can be from Grey Scale image or from
- * a Dted file.  This class can take one or two inputs.  The First input is an
- * elevation input that is used to compute a perturbed Normal which is
- * used in a simple lambertian shading equation.  The second input is some
- * color source (Grey or RGB) that defines the diffuse color used within
- * the illumination equation for each pixel. If the diffuse color input is not
- * supplied then an all white color is used for the color.  There are several
- * adjustable parameters that can be set:
- * 1) the Incident light vector described by the Azimuth and Elevation Angle,
- * 2) the pixel scale used along the x and y direction, and
- * 3) the partial derivative matrix used for the partial derivative
- * computation along the x and y direction.
- *
- * <pre>
- * 
- * Some examples of good values:
- *
- * If we are using dted 90 meters as input for shading then:
- * 1) set pixel scale to 180.  Since the partials do 2*dx and 2*dy then
- *    the scale is 2*90meters = 180.
- * 2) set azimuth angle to 45 and set elevation angle to 45 degrees.  Change
- *    them to see the effects.
- * 3) use the following matrix -1 0 1
- *                             -1 0 1
- *                             -1 0 1
- *                                &
- *                              1  1  1
- *                              0  0  0
- *                             -1 -1 -1
- * 
- *    for the partials along x and y directions respectively.  These matrices
- *
- *    (f(x+dx, y) - f(x-dx, y))/2*dx and
- *    (f(x, y+dy) - f(x, y-dy))/2*dy
- *
- *    for an apprximate derivative about some point x, y
- *
- * If we are using pixel intesity (1 - 255) then set the scales to around
- * 100.
- *
- *  Note: varying the scales will vary the smoothness/roughness of the surface
- *        Smaller the scale the rougher the surface will look.
- *
- * The output of this source is always a 3-band 8-bit image.
- *
- * Keywords:
- *   type:               ossimBumpShadeTileSource
- *   azimuth_angle:      45.000000000000000
- *   elevation_angle:    45.000000000000000
- *   scale_per_pixel_x:  180.000000000000000  // this is the 2*dx defined above
- *   scale_per_pixel_y:  180.000000000000000  // this is the 2*dy defined above
- *
- *   the next set of keywords are optional and the default is as defined above.
- *   these define the matrix.
- *
- *
- * A typical chain would look something like this:
- * 
- * OrthoMosaicOfElevation-->Normals-->Renderer-->|
- *                                               |--> BumpShade-->Output 
- * ColorSource----------------------->Renderer-->|
- *
- * NOTES:
- *
- * 1) "Normals" is an ossimImageToPlaneNormalFilter class
- *
- * 2) The bump map input source is used to bump or shade the input color
- * source.  The input color source currently must be a 1 or 3 band
- * image.  Note that the output of this source is always
- * 3 bands (r, g, b).
- *
- * 3) If no color source (2nd input layer) is present the r,g,b values will be
- * used.  The method setRgbColorSource can be used to control this.
- * 
- * </pre>
- * 
- */
-class OSSIMDLLEXPORT ossimBumpShadeTileSource : public ossimImageCombiner
-{
-public:
-   ossimBumpShadeTileSource();
-
-   ossimString getShortName()const;
-   ossimString getLongName()const;
-
-   ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                       ossim_uint32 resLevel=0);
-
-   virtual bool getTile(ossimImageData* tile, ossim_uint32 resLevel=0);
-
-   /**
-    * This should always return 3
-    */
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-
-   /**
-    * The output scalar type should always be 8-bit
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-   
-   /**
-    * the null pixel is 0.0.
-    * \return null pixel value is always 0
-    *
-    */
-   virtual double getNullPixelValue()const;
-
-   /**
-    * the min pixel is 1.0.
-    * \return min pixel value is always 1
-    *
-    */
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * the max pixel is 255.
-    * \return max pixel value is always 255
-    *
-    */
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * \return Returns the rotation of the incident vector..
-    */
-   virtual double getAzimuthAngle()const;
-
-   /**
-    * \return Returns the elevation of the incident vector.
-    */
-   virtual double getElevationAngle()const;
-
-   /**
-    *
-    */
-   virtual void setAzimuthAngle(double angle);
-
-   /**
-    *
-    */
-   virtual void setElevationAngle(double angle);
-
-   /**
-    *
-    */
-   virtual void initialize();
-
-   /**
-    *
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    *
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    *
-    */
-   bool canConnectMyInputTo(ossim_int32 inputIndex,
-                            const ossimConnectableObject* object)const;
-      
-   /**
-    *
-    */
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-
-   /**
-    *
-    */
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-
-   /**
-    *
-    */
-   virtual void propertyEvent(ossimPropertyEvent& event);
-
-   virtual void refreshEvent(ossimRefreshEvent& event);
-
-   /**
-    * Will re-compute the light direction given the elevation angle and
-    * azimuth angle.
-    */
-   void computeLightDirection();
-
-   /* ------------------- PROPERTY INTERFACE -------------------- */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   /* ------------------ PROPERTY INTERFACE END ------------------- */
-
-   /**
-    * @brief Set the red, green and blue color source values.
-    *
-    * This sets the rgb value used when no second layer is present.
-    *
-    * The default is: r = 255, g = 255, b = 255
-    *
-    * @param r red
-    * @param g green
-    * @param b blue
-    */
-   void setRgbColorSource(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b);
-
-   /**
-    * Gets the red, green and blue color source values.
-    * @param r red
-    * @param g green
-    * @param b blue
-    */
-   void getRgbColorSource(ossim_uint8& r, ossim_uint8& g, ossim_uint8& b) const;
-   
-protected:
-   virtual ~ossimBumpShadeTileSource();
-   void allocate();
-   /**
-    * The result of the illumination equation is stored in
-    * here.  This is populated on each call to getTile.
-    */
-   ossimRefPtr<ossimImageData> m_tile;
-
-   /**
-    * Used for the light vector computation.
-    */
-   double m_lightSourceElevationAngle;
-
-   /**
-    * Used for the light vector computation.
-    */
-   double m_lightSourceAzimuthAngle;
-
-   /**
-    * This is computed from the elevation and
-    * azimuth angles of the light source.
-    */
-   NEWMAT::ColumnVector m_lightDirection;
-
-   /**
-    * rgb values used when no color source (2nd layer) is present.
-    */
-   ossim_uint8 m_r;
-   ossim_uint8 m_g;
-   ossim_uint8 m_b;
-
-   void computeColor(ossim_uint8& r,
-                     ossim_uint8& g,
-                     ossim_uint8& b,
-                     ossim_float64 normalX,
-                     ossim_float64 normalY,
-                     ossim_float64 normalZ,
-                     ossim_uint8 dr,
-                     ossim_uint8 dg,
-                     ossim_uint8 db)const;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimCacheTileSource.h b/ossim/include/ossim/imaging/ossimCacheTileSource.h
deleted file mode 100644
index 53461b3..0000000
--- a/ossim/include/ossim/imaging/ossimCacheTileSource.h
+++ /dev/null
@@ -1,88 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:  ossimCacheTileSource
-// 
-//*******************************************************************
-//  $Id: ossimCacheTileSource.h 20456 2012-01-13 19:39:30Z gpotts $
-#ifndef ossimCacheTileSource_HEADER
-#define ossimCacheTileSource_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/imaging/ossimAppFixedTileCache.h>
-#include <ossim/base/ossimProcessProgressEvent.h>
-#include <OpenThreads/Mutex>
-
-/** Cache Tile Source */
-class OSSIMDLLEXPORT ossimCacheTileSource : public ossimImageSourceFilter
-{
-public:
-   typedef std::vector<ossimAppFixedTileCache::ossimAppFixedCacheId> RLevelCacheList;
-   /**
-    * Will construct a new Application cache
-    */
-   ossimCacheTileSource();
-   // ossimCacheTileSource(ossimImageSource* inputSource);
-
-   virtual ossimString getLongName()  const;
-   virtual ossimString getShortName() const;
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   virtual void initialize();
-   virtual void flush();
-   virtual void setCachingEnabledFlag(bool value);
-   virtual void setEventProgressFlag(bool value);
-
-   void getTileSize(ossimIpt& size) const;
-
-   /**
-    * @brief Set the tile size.  This changes underlying cache tile size.
-    * @param Size of cache tile.
-    */
-   void setTileSize(const ossimIpt& size);
-   
-   virtual ossim_uint32 getTileWidth() const;
-   virtual ossim_uint32 getTileHeight() const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-
-   
-protected:
-   virtual ~ossimCacheTileSource();
-
-   void allocate();
-   void deleteRlevelCache();
-   void initializeRlevelCache();
-   
-   ossimAppFixedTileCache::ossimAppFixedCacheId getCacheId(ossim_uint32 resLevel);
-
-   ossimRefPtr<ossimImageData> theTile;
-   ossimIpt                    theFixedTileSize;
-   bool                        theCachingEnabled;
-   bool                        theEventProgressFlag;
-   bool                        theUseInputTileSizeFlag;
-   RLevelCacheList             theRLevelCacheList;
-   
-   /** For lock and unlock. */
-
-   
-   virtual void fireProgressEvent(double percentComplete);
-   
-   virtual ossimRefPtr<ossimImageData> fillTile(ossim_uint32 resLevel);
-
-TYPE_DATA
-};
-
-
-#endif /* end of "#ifndef ossimCacheTileSource_HEADER" */
diff --git a/ossim/include/ossim/imaging/ossimCastTileSourceFilter.h b/ossim/include/ossim/imaging/ossimCastTileSourceFilter.h
deleted file mode 100644
index ba3826a..0000000
--- a/ossim/include/ossim/imaging/ossimCastTileSourceFilter.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimCastTileSourceFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimCastTileSourceFilter_HEADER
-#define ossimCastTileSourceFilter_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIMDLLEXPORT ossimCastTileSourceFilter : public ossimImageSourceFilter
-{
-public:
-   ossimCastTileSourceFilter(ossimImageSource* inputSource=NULL,
-			     ossimScalarType scalarType=OSSIM_UCHAR);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   virtual void initialize();
-   virtual ossimScalarType getOutputScalarType() const;
-
-   virtual ossimString getOutputScalarTypeString()const;
-
-   /**
-    *  Sets the output scalar type.
-    */
-   virtual void setOutputScalarType(ossimScalarType scalarType);
-   virtual void setOutputScalarType(ossimString scalarType);
-   
-   /**
-    *  Sets the current resolution level.  Returns true on success, false
-    *  on error.
-    */
-   virtual double getNullPixelValue(ossim_uint32 band)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   ossimRefPtr<ossimImageData> applyCast(ossimRefPtr<ossimImageData> input);
-   
-   /**
-    *  Method to save the state of an object to a keyword list.
-    *  Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-
-   /**
-    *   Override base class so that a disableSource event does not
-    *   reinitialize the object and enable itself.
-    */
-   virtual void propertyEvent(ossimPropertyEvent& event);
-   virtual void refreshEvent(ossimRefreshEvent& event);   
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-     
-protected:
-   virtual ~ossimCastTileSourceFilter();
-
-   void allocate(const ossimRefPtr<ossimImageData> inputTile);
-   
-   ossimRefPtr<ossimImageData> theTile;
-   ossimScalarType             theOutputScalarType;
-
-   template<class inType>
-   void castInputToOutput(inType **inBuffer,
-                          const double  *nullPix,
-                          bool   inPartialFlag);
-   
-   template<class inType, class outType>
-   void castInputToOutput(inType *inBuffer[],
-                          const double  *nullInPix,
-                          bool   inPartialFlag,
-                          outType *outBuffer[],
-                          const double  *nullOutPix,
-                          ossim_uint32   numberOfBands);
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimCastTileSourceFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimCcfHead.h b/ossim/include/ossim/imaging/ossimCcfHead.h
deleted file mode 100644
index 72549fb..0000000
--- a/ossim/include/ossim/imaging/ossimCcfHead.h
+++ /dev/null
@@ -1,188 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for CcfHead.
-//
-// Notes:
-// - This is not a full blown CCF header class as it only captures the
-//   data needed for loading.
-// - Currently only version 6 is supported.
-//
-//*******************************************************************
-//  $Id: ossimCcfHead.h 10265 2007-01-14 19:18:43Z dburken $
-#ifndef ossimCcfHead_HEADER
-#define ossimCcfHead_HEADER
-
-#include <iosfwd>
-#include <vector>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimIpt.h>
-
-class ossimIrect;
-
-//***************************************************************************
-// CLASS:  ossimCcfHead
-//***************************************************************************
-class OSSIM_DLL ossimCcfHead : public ossimErrorStatusInterface
-{
-public:
-
-   ossimCcfHead();
-   
-   ossimCcfHead(const char* ccf_file);
-
-   ~ossimCcfHead ();
-
-   /*!
-    *  Reads the ccf header and initializes data members.  Returns true on
-    *  successful read, false on error.
-    */
-   bool parseCcfHeader(const char* ccf_file);
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-   ossim_uint32 numberOfReducedResSets() const { return theNumberOfRLevels; }
-
-   ossim_uint32 numberOfLines(ossim_uint32 reduced_res_level) const;
-
-   ossim_uint32 numberOfSamples(ossim_uint32 reduced_res_level) const;
-
-   ossim_uint32 chunksInLineDir(ossim_uint32 reduced_res_level) const;
-   
-   ossim_uint32 chunksInSampleDir(ossim_uint32 reduced_res_level) const;
-
-   std::streampos startOfData(ossim_uint32 reduced_res_level) const;
-
-   /*!
-    *  Returns the highest available reduced resolution level.
-    *  Zero based.
-    */
-   ossim_uint32 highestReducedResSet() const
-      { return !theNumberOfRLevels ? 0 : (theNumberOfRLevels - 1); }
-
-   /*!
-    *  Returns the zero based image rectangle for the reduced resolution
-    *  level passed in.  Returns a rectangle of (0,0,0,0) if reduced_res_level
-    *  is out of range.
-    */
-   ossimIrect imageRect(ossim_uint32 reduced_res_level) const;
-
-   /*!
-    *  Returns the ccf file name as a String.
-    */
-   ossimString imageFile() const { return theCcfFile; }
-
-   /*!
-    *  Returns the radiometry string.
-    */
-   ossimString radiometry() const { return theRadiometryString; }
-
-   /*!
-    *  Returns the number of bands.
-    */
-   ossim_uint32 numberOfBands() const { return theNumberOfBands; }
-
-   /*!
-    *  Returns the enumerated pixel type.
-    */
-   ossimScalarType pixelType() const { return thePixelType; }
-
-   /*!
-    *  Returns the bytes per chunk.
-    */
-   ossim_uint32 bytesPerChunk() const { return theBytesPerChunk; }
-
-   /*!
-    *  Returns the bytes per chip.
-    */
-   ossim_uint32 bytesPerChip() const { return theBytesPerChip; }
-
-   /*!
-    *  Returns the number of chips in sample direction of a chunk.
-    */
-   ossim_uint32 sampleChipsPerChunk() const { return theSampleChipsPerChunk; }
-
-   /*!
-    *  Returns the number of chips in line direction of a chunk.
-    */
-   ossim_uint32 lineChipsPerChunk() const { return theLineChipsPerChunk; }
-
-   /*!
-    *  Returns the samples per chip.
-    */
-   ossim_uint32 samplesPerChip() const { return theSamplesPerChip; }
-
-   /*!
-    *  Returns the lines per chip.
-    */
-   ossim_uint32 linesPerChip() const { return theLinesPerChip; }
-
-   /*!
-    *  Returns the number of pixels in a single band of a chip.
-    *  Note:  This is not in bytes but in pixels.
-    */
-   ossim_uint32 chipSizePerBand() const
-      { return theLinesPerChip * theSamplesPerChip; }
-
-   const std::vector<ossimIpt>& getValidImageVertices()const
-      {
-         return theValidImageVertices;
-      }
-private:
-
-   /*!
-    *  Parses a version five header.
-    */
-   bool parseV5CcfHeader(std::istream& is);
-
-   /*!
-    *  Parses a version six header.
-    */
-   bool parseV6CcfHeader(std::istream& is);
-
-   /*!
-    *  Parses the radiometry string and initializes "theNumberOfBands" and
-    *  "thePixelType".
-    */
-   void parseRadString();
-
-   ossimString            theCcfFile;
-   ossim_uint32           theNumberOfBands;
-   ossimScalarType        thePixelType;
-   ossimString            theFileType;
-   ossim_uint32           theVersionNumber;
-   ossim_uint32           theLinesPerChip;
-   ossim_uint32           theSamplesPerChip;
-   ossim_uint32           theLineChipsPerChunk;
-   ossim_uint32           theSampleChipsPerChunk;
-   ossim_uint32           theRectInFullImageStartLine;
-   ossim_uint32           theRectInFuleImageStartSample;
-   ossim_uint32           theRectInFullImageStopLine;
-   ossim_uint32           theRectInFuleImageStopSample;
-   ossim_uint32           theNumberOfValidImageVertices;
-   std::vector<ossimIpt>  theValidImageVertices;
-   ossim_uint32           theFirstBandHeaderPointer;
-   ossimString            theRadiometryString;
-   ossim_uint32           theBytesPerPixel;
-   ossim_uint32           theBytesPerChip;
-   ossim_uint32           theBytesPerChunk;
-   ossimString            theCompressionType;
-   ossim_uint32           theNumberOfRLevels;
-   std::vector<bool>           theOccupiedFlag;
-   std::vector<std::streampos> theStartOfData;
-   std::vector<ossim_uint32>   theNumberOfLines;
-   std::vector<ossim_uint32>   theNumberOfSamples;
-   std::vector<ossim_uint32>   theChunksInLineDir;
-   std::vector<ossim_uint32>   theChunksInSampleDir;
-};
-
-
-#endif // #ifndef CcfHead_HEADER
diff --git a/ossim/include/ossim/imaging/ossimCcfTileSource.h b/ossim/include/ossim/imaging/ossimCcfTileSource.h
deleted file mode 100644
index 74ab580..0000000
--- a/ossim/include/ossim/imaging/ossimCcfTileSource.h
+++ /dev/null
@@ -1,233 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for CcfTileSource.
-//
-// A ccf (Chip Chunk Format) is a double tiled format.  Image data is
-// arranged in chips and chunks.  Each chip is 32 x 32 pixels.  Each chunk
-// is 8 x 8 chips for a single band image.  Bands are interleaved by chip
-// so a rgb image has a red chip a green chip, then a blue chip which
-// would make the chunk 24 x 8 chips.
-//
-//*******************************************************************
-//  $Id: ossimCcfTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimCcfTileSource_HEADER
-#define ossimCcfTileSource_HEADER
-
-#include <fstream>
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimCcfHead.h>
-
-class  ossimImageData;
-
-class OSSIM_DLL ossimCcfTileSource : public ossimImageHandler
-{
-public:
-
-   ossimCcfTileSource();
-   
-   virtual ossimString getShortName()const;
-   virtual ossimString getLongName()const;
-
-   /**
-    *  @return Returns true on success, false on error.
-    *
-    *  @note This method relies on the data member ossimImageData::theImageFile
-    *  being set.  Callers should do a "setFilename" prior to calling this
-    *  method or use the ossimImageHandler::open that takes a file name and an
-    *  entry index.
-    */
-   virtual bool open();
-   
-   virtual void close();
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    *
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-   
-    /**
-     *  Returns the number of bands in the image.
-     *  Satisfies pure virtual from ImageHandler class.
-     */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   virtual ossim_uint32 getNumberOfOutputBands()const;
-
-   /**
-     *  Returns the number of lines in the image.
-     *  Satisfies pure virtual from ImageHandler class.
-     */
-   virtual ossim_uint32 getNumberOfLines(
-      ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    *  Returns the number of samples in the image.  
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(
-      ossim_uint32 reduced_res_level = 0) const;
-
-   /**
-    *  Returns the number of reduced resolution data sets (rrds).
-    *  Note:  The full res image is counted as a data set so an image with no
-    *         reduced resolution data set will have a count of one.
-    */
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-   
-   /**
-    *  Returns the zero based image rectangle for the reduced resolution data
-    *  set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
-    */
-   virtual ossimIrect getImageRectangle(
-      ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    *  Set the output band list.  Use to set the number and order of output
-    *  bands.  Will set an error if out of range.
-    */
-   bool setOutputBandList(const vector<ossim_uint32>& outputBandList);
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-      
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-   
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   virtual bool isOpen()const;
-
-   /**
-    * @brief Gets a property for matching name.
-    * @param name The name of the property to get.
-    * @return Returns property matching "name".
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-   
-   /**
-    * @brief Gets a list of property names available.
-    * @param propertyNames The list to push back names to.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-	
-   
-protected:
-   virtual ~ossimCcfTileSource();
-
-   void initVerticesFromHeader();
-   
-   // Disallow these...
-   ossimCcfTileSource(const ossimCcfTileSource& source);
-   ossimCcfTileSource& operator=(const ossimCcfTileSource& source); 
-   
-   /**
-    *  Returns true on success, false on error.
-    */
-   bool fillBuffer(const  ossimIrect& tile_rect,
-                   const  ossimIrect& clip_rect,
-                   const  ossimIrect& image_rect,
-                   ossim_uint32 reduced_res_level,
-                   ossimImageData* tile);
-
-   /**
-    *  Returns true on success, false on error.
-    */
-   bool fillUshortBuffer(const  ossimIrect& tile_rect,
-                         const  ossimIrect& clip_rect,
-                         const  ossimIrect& image_rect,
-                         ossim_uint32 reduced_res_level,
-                         ossimImageData* tile);
-   
-   /**
-    *  Returns true on success, false on error.
-    */
-   bool fillUcharBuffer(const  ossimIrect& tile_rect,
-                        const  ossimIrect& clip_rect,
-                        const  ossimIrect& image_rect,
-                        ossim_uint32 reduced_res_level,
-                        ossimImageData* tile);
-
-   /**
-    *  Adjust point to even 256 boundary.  Assumes 0,0 origin.
-    */
-   void adjustToStartOfChunk(ossimIpt& pt) const;
-
-   /**
-    *  Adjust point to even 32 boundary.  Assumes 0,0 origin.
-    */
-   void adjustToStartOfChip(ossimIpt& pt) const;
-
-   bool isEcgGeom(const ossimFilename& filename)const;
-
-   ossimCcfHead                theCcfHead;
-   ossimRefPtr<ossimImageData> theTile;
-   ossim_uint8*                theChipBuffer;
-   ifstream*                   theFileStr;
-   vector<ossim_uint32>        theOutputBandList;
-   ossim_int32                 theByteOrder;
-
-
-TYPE_DATA
-};
-   
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimCibCadrgTileSource.h b/ossim/include/ossim/imaging/ossimCibCadrgTileSource.h
deleted file mode 100644
index 3e4be48..0000000
--- a/ossim/include/ossim/imaging/ossimCibCadrgTileSource.h
+++ /dev/null
@@ -1,606 +0,0 @@
-//-----------------------------------------------------------------------
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-// Description: This class give the capability to access tiles from an
-//              CADRG file.
-//
-//-----------------------------------------------------------------------
-//$Id: ossimCibCadrgTileSource.h 17954 2010-08-21 20:39:47Z dburken $
-#ifndef ossimCibCadrgTileSource_HEADER
-#define ossimCibCadrgTileSource_HEADER 1
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/support_data/ossimRpfFrameEntry.h>
-
-class ossimRpfToc;
-class ossimRpfTocEntry;
-class ossimRpfFrame;
-
-/**
- * CIB/CADRG formats are encoded the same except that the CIB is a grey
- * scale image and the CADRG is a color image.  Both are VQ compressed.
- * The images are encoded into an NITF format with embedded RPF headers.
- * It reads the embedded RPF tags from the NITF file and parses the data.
- * It allows for you to select which CIB/CADRG entry to render.  The handler
- * is opened by giving it the associated a.toc file.  This is a table of
- * contents file that describes all the entries found in the CIB/CADRG
- * product.  You must set which entry you wish to render.  By default it
- * will render the first product it comes to.
- *
- * Note:  This handler will eventually merge into the nitf handler.
- */
-class OSSIMDLLEXPORT ossimCibCadrgTileSource : public ossimImageHandler
-{
-public:
-   friend class ossimMultiEntryCibCadrg;
-
-   /**
-    * Basic enumeration.  This should
-    * be either a CIB or a CADRG product
-    * type.
-    */
-   enum ossimCibCadrgProductType
-   {
-      OSSIM_PRODUCT_TYPE_UNKNOWN = 0,
-      OSSIM_PRODUCT_TYPE_CIB     = 1,
-      OSSIM_PRODUCT_TYPE_CADRG   = 2
-   };
-
-   /**
-    * Default constructor.
-    *
-    * Initializes all internal attributes to a default state.
-    */
-   ossimCibCadrgTileSource();
-
-   /**
-    * This method is defined in the base class ossimObject.
-    * This class overrides the default implementation
-    * to return its own short name.
-    * 
-    * @return The short name for this class as an ossimString.
-    */
-   virtual ossimString getShortName()const;
-
-   /**
-    * This method is defined in the base class ossimObject.
-    * This class overrides the default implementation
-    * to return its own long name.
-    * 
-    * @return The long name for this class as an ossimString.
-    */
-   virtual ossimString getLongName()const;
-
-   /**
-    * Closes this image handler and deletes any allocated data.
-    */
-   virtual void close();
-   
-   /**
-    */
-   virtual bool open();
-
-  /**
-    * Changes the way the open() routine functions slightly.
-    *
-    * @param bSkipEmptyCheck If true, the RPF file is opened even 
-    * if all the frame files are missing. By default this is 
-    * set to false.
-    */
-   void setSkipEmptyCheck( bool bSkipEmptyCheck = false );
-
-   /**
-    *  Returns a pointer to an ossimImageDataObject given a rectangluar
-    *  region of interest.
-    *
-    *  @param rect The region of interest to return.
-    *  @param resLevel From which resolution set are we querying
-    *  (default is 0 full res).
-    *
-    *  @return The ossimImageData object to the caller.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
-                                               ossim_uint32 resLevel = 0);
-
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    *
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-
-   /**
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    *
-    *  @param reduced_res_level The reduced res level to query number of lines from.
-    *  @return The number of lines in the image.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    *
-    *  @param reduced_res_level The reduced res level to query number of samples from.
-    *  @return The number of samples in the image.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
-
-   /**
-    * @param reduced_res_level Which res level to get the bounds for.  0 represents
-    *                          the default and is the full resolution.
-    * 
-    * @return A rectangle representing the bounds for the passed in resolution level.
-    */
-   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
-   
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    *
-    * Saving data without a prefix.
-    * @code
-    *  ossimCibCadrgTileSource* cibCadrgHandler = new ossimCibCadrgTileSource;
-    *  ossimKeywordlist kwl;
-    *  cibCadrgHandler->open(filename);
-    *  cibCadrgHandler->saveState(kwl);
-    * @endcode
-    *
-    * and saving data with a prefix.
-    * @code
-    *  ossimCibCadrgTileSource* cibCadrgHandler = new ossimCibCadrgTileSource;
-    *  ossimKeywordlist kwl;
-    *  cibCadrgHandler->open(filename);
-    *  cibCadrgHandler->saveState(kwl, "handler1.");
-    * @endcode
-    *
-    * Saving with a prefix will help uniquely identify objects in the kwl.
-    * To see what is in the keywordlist after a save state then do:
-    *
-    * @code
-    * cout << kwl << endl;
-    * @endcode
-    *
-    * There is only 1 keyword for this object:
-    * 
-    * entry: <entry number>
-    *
-    * where <entry number> is the index value for the current entry.
-    *
-    * @see ossimImageHandler for additional keywords.
-    *
-    * @param kwl Keywordlist to save the state of the object to.
-    * @param prefix prefix to prepend to the keywords.  This will
-    *               help uniquely identify each keyword if multiple
-    *               objects are saved to the same list.
-    * @return True if successfully saved the state of the object and
-    *         false otherwise.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to load the state of an object from a keyword list.
-    *
-    * Loading with a prefix.
-    * @code
-    *  cibCadrgHandler->laodState(kwl, "handler1.");
-    * @endcode
-    * 
-    * Loading without a prefix.
-    * @code
-    *  cibCadrgHandler->laodState(kwl);
-    * @endcode
-    *
-    * Since all objects are factory created you can go through the
-    * registry and pass the keyword list in.
-    * @code
-    * ossimImageHandler* handler = ossimImageHandlerRegistry::instance()->open(kwl, prefix);
-    * @endcode
-    * 
-    * @param kwl Keywordlist that holds the state information for this
-    *            object.
-    *
-    *
-    * @param prefix prefix value prepended to all keywords to uniquely
-    *                      locate the state attributes for this object.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   /**
-    *  Populates the geometry object with image geometry information.  This
-    *  method is used to relay projection/model information to users.
-    *  Returns true if geometry info is present, false if not.
-    *  Keywords supported by this class are:
-    *  @verbatim
-    *  datum:    // datum code>   // Datum code
-    *  ul_lat:   // upper left latitude
-    *  ul_lon:   // upper left longitude
-    *  ll_lat:   // lower left latitude
-    *  ll_lon:   // lower left longitude
-    *  lr_lat:   // lower right latitude
-    *  lr_lon:   // lower right longitude
-    *  ur_lat:   // upper right latitude
-    *  ur_lon:   // upper right longitude
-    *  number_input_bands:     
-    *  number_output_bands:    
-    *  number_lines:           
-    *  number_samples:
-    *  decimal_degrees_per_pixel_lat:  // specifies the spacing per pixel along Y direction
-    *  decimal_degrees_per_pixel_lon:  // specifies the spacing per pixel along X direction
-    *  origin_latitude:                // specifies the origin or center of the projector for the latitude
-    *  central_meridian:               // specifies the origin or center of the projector for the longitude
-    *  tie_point_lat:     // tie point lat.  Represents the latitude of the upper left center of pixel
-    *  tie_point_lon:     // tie point lon.  Represents the longitude of the upper left center of pixel
-    *  zone:              // zone read from the CIB/CADRG boundary info
-    *  type:              // class name of the object for factory driven reconstruction
-    *  map_scale:         // Map scale of the image
-    *  @endverbatim
-    *  @see ossimImageSource for further code example on using the geometry.
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
-   /**
-    * This method allows you to query the scalar type of the output data.
-    * This is simply the data type, i.e. whether its OSSIM_FLOAT, OSSIM_DOUBLE,
-    * OSSIM_UCHAR, ... etc.  This means that if there are bands of different
-    * scalar types from a single image then they must be casted to the highest
-    * precision type. @see ossimConstants.h for all ossimScalarType.
-    * 
-    * @return The output scalar type.
-    *         
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * This method allows you to query the number of input bands.  If an image
-    * is band selectable this will allow one to select the bands you wish
-    * to read in.  This indicates that the number of input bands might not
-    * match the number of output bands.
-    * @return number of input bands.
-    */
-   virtual ossim_uint32 getNumberOfInputBands()const;
-
-   /**
-    * This method allows one to query the number of output bands.  This might not
-    * be the same as the n umber of input bands.
-    *
-    * @see getNumberOfInputBands().
-    * @return number of output bands.
-    */
-   virtual ossim_uint32 getNumberOfOutputBands()const;
-   
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-   
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   virtual ossim_uint32 getCurrentEntry()const;
-   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
-   virtual void getEntryList(std::vector<ossim_uint32>& entryList)const;
-   
-
-   /**
-    * Returns -1 if invalid
-    */
-   virtual ossim_int32 getCurrentEntryIndex()const;
-   
-   /**
-    * @return The current entry being rendered
-    */
-   virtual const ossimRpfTocEntry* getCurrentTocEntry()const;
-
-   /**
-    * @return The table of contents object.
-    */
-   virtual const ossimRpfToc*      getToc()const;
-
-   /**
-    * @param reduced_res_level passed in resolution level.
-    * @return True if the reduced_res_level is within an acceptable range
-    *         and false otherwise.
-    */
-   bool isValidRLevel(ossim_uint32 reduced_res_level) const;
-
-   /**
-    * Determines if its open if there eists a table of contents object.
-    * 
-    * @return True if the handler is open and flase otherwise.
-    */
-   bool isOpen()const;
-
-   /** @return true if CIB */
-   bool isCib() const;
-
-   /** @return true if CADRG */
-   bool isCadrg() const;
-
-   /** @return Scale string ( like 1:24000 ) for current entry. */
-   ossimString getProductScale() const;
-
-   /**
-    * This retrieves all product scales that are within the Table of contents.
-    * I make no assumptions that a CIB/CADRG has only one product.  A product
-    * here is 1meter, 5 meter, 10 meter ... etc for CIB and 1:24000, 1:50000,
-    * ... etc for CADRG.
-    *
-    * @return The prduct list as a vector of strings.
-    */
-   vector<ossimString> getProductScaleList()const;
-
-   /**
-    * Using the product scales from getProductScaleList() you can pass each string
-    * in so you can get all associated indices for a given product.
-    * 
-    * @return Entry indices for a passed in product scale.
-    */
-   vector<ossim_int32>      getProductEntryList(const ossimString& productScale)const;
-
-   ossimString getSecurityClassification()const;
-   
-	/**
-    * @brief Gets a property for matching name.
-    * @param name The name of the property to get.
-    * @return Returns property matching "name".
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   
-   /**
-    * @brief Gets a list of property names available.
-    * @param propertyNames The list to push back names to.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-	/**
-    * CONSTANT representing the width of a Frame.  This should be 1536.
-    */
-   static const ossim_uint32 CIBCADRG_FRAME_WIDTH;
-   
-   /**
-    * CONSTANT representing the height of a Frame.  This should be 1536.
-    */
-   static const ossim_uint32 CIBCADRG_FRAME_HEIGHT;
-   
-
-protected:
-   /**
-    * Destructor.
-    *
-    * Will return allocated memory back to the heap.
-    */
-   virtual ~ossimCibCadrgTileSource();
-   
-   void updatePropertiesToFirstValidFrame();
-
-   /**
-    * Sets the entry to be renderer.  The entry within the table
-    * of contents are stored in an Toc entry object.
-    *
-    * @param entry the Rpf toc entry object to set to.
-    */
-   virtual void setTocEntryToRender(const ossimRpfTocEntry* entry);
-   
-   /**
-    * Protected structure that is only used internally by this class.
-    * 
-    * This is used to establish which entry data is being used.
-    * all we need is the ro, col of the entry.  We can compute the
-    * image rect from this since the CibCadrg are 1536x1536 frame.
-    * 
-    */
-   struct ossimFrameEntryData
-   {
-      ossimFrameEntryData()
-         :theRow(-1),
-          theCol(-1),
-          thePixelRow(-1),
-          thePixelCol(-1)
-         {}
-      ossimFrameEntryData(ossim_int32 row,
-                          ossim_int32 col,
-                          ossim_int32 pixelRow,
-                          ossim_int32 pixelCol,
-                          const ossimRpfFrameEntry& entry)
-         :theRow(row),
-          theCol(col),
-          thePixelRow(pixelRow),
-          thePixelCol(pixelCol),
-          theFrameEntry(entry)
-         {}
-      ossimFrameEntryData(const ossimFrameEntryData& rhs)
-         :theRow(rhs.theRow),
-          theCol(rhs.theCol),
-          thePixelRow(rhs.thePixelRow),
-          thePixelCol(rhs.thePixelCol),
-          theFrameEntry(rhs.theFrameEntry)
-         {}
-      ossim_int32 theRow;
-      ossim_int32 theCol;
-      ossim_int32 thePixelRow;
-      ossim_int32 thePixelCol;
-      ossimRpfFrameEntry theFrameEntry;
-   };
-
-   /**
-    * Sets the entry to render.
-    *
-    */
-   virtual bool setEntryToRender(ossim_uint32 index);
-   
-   /**
-    * It is important to note that each frame is organized into an easting northing
-    * type orientation.  This means that a frame at 0,0 is at the lower left corner.
-    * Each frame's pixel data is has 0,0 at the upper left.
-    *
-    * It will take the curent region to render and then find all entries that intersect
-    * that region.
-    *
-    * @param rect the current region to render.
-    * @return The list of entry data objects found for this rect.
-    */
-   vector<ossimFrameEntryData> getIntersectingEntries(const ossimIrect& rect);
-
-   /**
-    * This is a wrapper for the fill cib and fill cadrg.  It takes the frames
-    * involved that were found in the getIntersectingEntries and call the
-    * appropriate fill cib or fill cadrg on each frame entry data.  It will
-    * loop through making sure that the frame file exists before calling
-    * the associated fill routines.
-    *
-    * @param tileRect Region to fill.
-    * @param framesInvolved All intersecting frames used to render the region.
-    */
-   void fillTile(const ossimIrect& tileRect,
-                 const vector<ossimFrameEntryData>& framesInvolved,
-                 ossimImageData* tile);
-
-   /**
-    * Will uncompress the CIB file using a VQ decompression algorithm.
-    *
-    * @param aFrame Frame that overlaps the requested tile rect.
-    * @param tileRect The region requested to render.
-    * @param frameEntryData The frame entry data.
-    */
-   void fillSubTileCib(const ossimRpfFrame& aFrame,
-                       const ossimIrect& tileRect,
-                       const ossimFrameEntryData& frameEntryData,
-                       ossimImageData* tile);
-   
-   /**
-    * Will uncompress the CADRG file using a VQ decompression algorithm.
-    *
-    * @param aFrame Frame that overlaps the requested tile rect.
-    * @param tileRect The region requested to render.
-    * @param frameEntryData The frame entry data.
-    */
-   void fillSubTileCadrg(const ossimRpfFrame& aFrame,
-                         const ossimIrect& tileRect,
-                         const ossimFrameEntryData& frameEntryData,
-                         ossimImageData* tile);
-   
-   /**
-    * Will allocate an internal buffer for the given product.  If the product is
-    * a CIB then it is a single band OSSIM_UCHAR buffer and if its a CADRG it
-    * is a 3 band OSSIM_UCHAR buffer.
-    */
-   void allocateForProduct();
-   
-   /**
-    * This will search each entry in the table and look for a certain
-    * entry.  The first entry it comes to that has Geographic coverage
-    * will be the frame to render.  This method is best here instead of
-    * in the ossimRpfToc.  I am not sure, but I feel these types of
-    * searches are specific to the product (CADRG, CIB ...).  This
-    * is called immediately after a succesful open of the ossimRpfToc
-    */
-   const ossimRpfTocEntry* findFirstFrame();
-
-   void deleteAll();
-
-   void populateLut();
-
-   /**
-    * This is for storage of a single compressed buffer.
-    */
-   unsigned char*               theCompressedBuffer;
-
-   /**
-    * This is used as a buffer to uncompress the data to
-    */
-   unsigned char*               theUncompressedBuffer;
-   
-   /**
-    * This will be computed based on the frames organized within
-    * the directory.  The CibCadrg have fixed size frames of 1536x1536
-    * and we must count how many there are.  
-    */
-   ossim_uint32                theNumberOfLines;
-
-   /**
-    * This will be computed based on the frames organized within
-    * the directory.  The CibCadrg have fixed size frames of 1536x1536
-    * and we must count how many there are.  
-    */
-   ossim_uint32                theNumberOfSamples;
-   
-   /**
-    * This is the actual data returned from a getTile request.
-    */
-   ossimRefPtr<ossimImageData>  theTile;
-
-   /**
-    * Will own a table of contents.  This describes all entries within
-    * the CIB/CADRG.
-    */
-   ossimRpfToc*                 theTableOfContents;
-
-   /**
-    * This is the actual frame file to render.  This should be
-    * divided into frames where each frame is 1536x1536 in
-    * size.
-    */
-   const ossimRpfTocEntry*      theEntryToRender;
-
-   /**
-    * This will be the entry number that we are currently
-    * rendering.  This will mainly be used when using
-    * overviews.
-    */
-   ossim_int32                  theEntryNumberToRender;
-   
-   /**
-    * The size of the output tile.
-    */
-   ossimIpt                     theTileSize;
-
-   /**
-    * Holds the enumeration specifying the product type.
-    * The product type can be a CIB or a CADRG product.
-    */
-   ossimCibCadrgProductType     theProductType;
-   
-   mutable ossimRpfFrame*       theWorkFrame;
-
-   /**
-    * If true during the call to open(), the RPF file is opened even 
-    * if all the frame files are missing. By default this is set to false.
-    */
-   bool                         theSkipEmptyCheck;
-
-	// data to use in property retrieval
-	
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimCibCadrgTileSource_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimClosestToCenterCombiner.h b/ossim/include/ossim/imaging/ossimClosestToCenterCombiner.h
deleted file mode 100644
index c9a9ccb..0000000
--- a/ossim/include/ossim/imaging/ossimClosestToCenterCombiner.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimClosestToCenterCombiner.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimClosestToCenterCombiner_HEADER
-#define ossimClosestToCenterCombiner_HEADER
-#include <vector>
-#include <ossim/imaging/ossimImageMosaic.h>
-/**
-  * This implements a closest to center combiner.
-  *
-  * It will first grab all images overlapping a given rectangle query.  The first non-null
-  * closest pixel to the center of the image is used.  This basically uses only pixels along
-  * the "sweet" spot of the image.  This combiner is typically used when there is overlapping
-  * sensor data.
-  * 
-  */
-class OSSIM_DLL ossimClosestToCenterCombiner : public ossimImageMosaic
-{
-public:
-   ossimClosestToCenterCombiner();
-
-   /**
-    * Executes the ossimClosestToCenterCombiner algorithm. sets the pixels to the closest
-    * Valid value.  This simulates a sweet spot cutter.
-    * 
-    * @param rect The region of interest.
-    * @param resLevel.  For this combiner this is assumed to always be 0
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-protected:
-   class ossimClosestToCenterCombinerInfo
-   {
-   public:
-      ossimClosestToCenterCombinerInfo(ossimRefPtr<ossimImageData> tile,
-                                       ossim_int32 idx)
-         :theTile(tile),
-         theIndex(idx)
-         {
-         }
-      ossimRefPtr<ossimImageData> theTile;
-      ossim_int32                 theIndex;
-   };
-
-   
-   ossim_int32 findIdx(const std::vector<ossimClosestToCenterCombinerInfo >& normTileList,
-                       const ossimIpt& pt, ossim_uint32 offset)const;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimCodecBase.h b/ossim/include/ossim/imaging/ossimCodecBase.h
deleted file mode 100644
index b0daf89..0000000
--- a/ossim/include/ossim/imaging/ossimCodecBase.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: class declaration for base codec(encoder/decoder).
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimCodecBase_HEADER
-#define ossimCodecBase_HEADER 1
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimPropertyInterface.h>
-#include <ossim/imaging/ossimImageData.h>
-class OSSIM_DLL ossimCodecBase
-   : public ossimObject, public ossimPropertyInterface
-{
-public:
-
-    /**
-    * Will return the identifier used to identify the codec type.  For example the Jpeg codec
-    * will have "jpeg" as the identifier
-    *
-    * @return Codec identifier
-    */
-	virtual ossimString getCodecType()const=0;
-
-   /**
-    * @brief Encode method.
-    *
-    * Pure virtual method that encodes the passed in buffer to this codec.
-    *
-    * @param in Input data to encode.
-    * 
-    * @param out Encoded output data.
-    *
-    * @return true on success, false on failure.
-    */
-
-   virtual bool encode( const ossimRefPtr<ossimImageData>& in,
-                        std::vector<ossim_uint8>& out ) const=0;
-
-  /**
-    * @brief Decode method.
-    *
-    * @param in Input data to decode.
-    * 
-    * @param out Output tile.  If the pointer to ossimImageData is null
-    * internally it will be created.  For code loops it is better to pre
-    * initialized to correct size.
-    *
-    * @note Caller should set "out's" image rectangle upon successful
-    * decode.
-    *
-    * @return true on success, false on failure.
-    */
-   virtual bool decode( const std::vector<ossim_uint8>& in,
-                        ossimRefPtr<ossimImageData>& out ) const=0;
-
-TYPE_DATA;
-
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimCodecFactory.h b/ossim/include/ossim/imaging/ossimCodecFactory.h
deleted file mode 100644
index b80c1cc..0000000
--- a/ossim/include/ossim/imaging/ossimCodecFactory.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Factory class declaration for codec(encoder/decoder).
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimCodecFactory_HEADER
-#define ossimCodecFactory_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimCodecFactoryInterface.h>
-
-class ossimFilename;
-class ossimCodecBase;
-
-/**
- * @brief Codec factory.
- */
-class OSSIM_DLL ossimCodecFactory : public ossimCodecFactoryInterface
-{
-public:
-
-   /** virtual destructor */
-   virtual ~ossimCodecFactory();
-
-   /**
-   * @return instance
-   */
-   static ossimCodecFactory* instance();
-
-   /**
-   * createCodec takes a type and will return a new codec to encode decode image buffers
-   *
-   * @param in type.  Type identifer used to allocate the proper codec.
-   * @return ossimCodecBase type.
-   */
-   virtual ossimCodecBase* createCodec(const ossimString& type)const;
-
-
-   /**
-   * createCodec takes a type in the keywordlist and will return a new codec to encode decode image buffers
-   *
-   * @param in kwl.  Type identifer used to allocate the proper codec.
-   * @param in prefix.  prefix used to prefix keywords during the construction
-   *                    of the codec
-   * @return ossimCodecBase type.
-   */
-   virtual ossimCodecBase* createCodec(const ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   virtual void getTypeNameList(std::vector<ossimString>& typeNames)const;
-   
-private:
-   
-   /** hidden from use default constructor */
-   ossimCodecFactory();
-
-   /** hidden from use copy constructor */
-   ossimCodecFactory(const ossimCodecFactory& obj);
-
-   /** hidden from use operator = */
-   const ossimCodecFactory& operator=(const ossimCodecFactory& rhs);
-
-   /** The single instance of this class. */
-   static ossimCodecFactory* theInstance;
-};
-
-#endif /* End of "#ifndef ossimCodecFactory_HEADER" */
-
diff --git a/ossim/include/ossim/imaging/ossimCodecFactoryInterface.h b/ossim/include/ossim/imaging/ossimCodecFactoryInterface.h
deleted file mode 100644
index b73f2a5..0000000
--- a/ossim/include/ossim/imaging/ossimCodecFactoryInterface.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Interface for codec(encoder/decoder) factories.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimCodecFactoryInterface_HEADER
-#define ossimCodecFactoryInterface_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <vector>
-
-class ossimObject;
-class ossimCodecBase;
-/**
- * @brief Codec factory interface.
- */
-class OSSIM_DLL ossimCodecFactoryInterface // : public ossimObjectFactory
-{
-public:
-
-   /** default constructor */
-   ossimCodecFactoryInterface(){}
-
-   /** virtual destructor */
-   virtual ~ossimCodecFactoryInterface(){}
-   
-   /**
-   * This is a bridge to the generic factory list interface that trys to call createObject
-   * 
-   * We will bridge it in this interface to just call createCodec.  These are not pure virtual.
-   *
-   */
-   virtual ossimObject* createObject(const ossimString& type)const;
-
-  /**
-   * This is a bridge to the generic factory list interface that trys to call createObject
-   * 
-   * We will bridge it in this interface to just call createCodec.  These are not pure virtual.
-   *
-   */
-  virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix=0)const;
-   
-
-   
-   virtual ossimCodecBase* createCodec(const ossimString& type)const=0;
-   virtual ossimCodecBase* createCodec(const ossimKeywordlist& kwl, const char* prefix=0)const=0;
-
-
-   virtual void getTypeNameList(std::vector<ossimString>& typeNames)const=0;
-
-   /**
-    * @brief Pure virtual decode method. Derived classes must implement to
-    * be concrete.
-    *
-    * @param in Input data to decode.
-    * 
-    * @param out Output tile.
-    *
-    * @return true on success, false on failure.
-    */
-//   virtual bool decode( const std::vector<ossim_uint8>& in,
-//                        ossimRefPtr<ossimImageData>& out ) const = 0;
-
-   /**
-    * @brief Pure virtual encode method. Derived classes must implement to
-    * be concrete.
-    *
-    * @param in Input data to encode.
-    * 
-    * @param out Encoded output data.
-    *
-    * @return true on success, false on failure.
-    */
-
-//   virtual bool encode( const ossimKeywordlist& options,
-//                        const ossimRefPtr<ossimImageData>& in,
-//                        std::vector<ossim_uint8>& out ) const = 0;
-};
-
-#endif /* End of "#ifndef ossimCodecFactoryInterface_HEADER" */
-
diff --git a/ossim/include/ossim/imaging/ossimColorNormalizedFusion.h b/ossim/include/ossim/imaging/ossimColorNormalizedFusion.h
deleted file mode 100644
index 391a7b3..0000000
--- a/ossim/include/ossim/imaging/ossimColorNormalizedFusion.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Color normalized fusion
-//
-//*************************************************************************
-// $Id: ossimColorNormalizedFusion.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimColorNormalizedFusion_HEADER
-#define ossimColorNormalizedFusion_HEADER
-#include <ossim/imaging/ossimFusionCombiner.h>
-
-class ossimColorNormalizedFusion : public ossimFusionCombiner
-{
-public:
-
-   ossimColorNormalizedFusion();
-   ossimColorNormalizedFusion(ossimObject* owner);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-protected:
-   virtual ~ossimColorNormalizedFusion();
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimConvolutionFilter1D.h b/ossim/include/ossim/imaging/ossimConvolutionFilter1D.h
deleted file mode 100644
index 16fb1b1..0000000
--- a/ossim/include/ossim/imaging/ossimConvolutionFilter1D.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//*******************************************************************
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// class ossimImageGaussianFilter : tile source
-// class ossimConvolutionFilter1D
-// one dimensional convolution
-//
-// efficient for gradients & separable convolution kernels (like gaussian)
-//*******************************************************************
-// $Id: ossimConvolutionFilter1D.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimConvolutionFilter1D_HEADER
-#define ossimConvolutionFilter1D_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/**
- * class for vertical or horizontal convolution
- *
- * PROPERTIES:
- *  -KernelSize   : length of linear kernel (>=1)
-             NOTE - you need to exit the property editor for the kernel to be resized
- *  -Kernel       : Kernel vector (line matrix)
- *  -Horizontal   : boolean, otherwise vertical kernel
- *  -CenterOffset : center pixel position in the kernel, starting at 0
- *  -StrictNoData : controls NODATA use
- *      true  : any NODATA pixel in the convolution will make the center pixel NODATA
- *      false : if center is NODATA, then output center is NODATA,
- *              other NODATA pixels are processed as if they were zero in the convolution
- */
-class OSSIM_DLL ossimConvolutionFilter1D : public ossimImageSourceFilter
-{
-public:
-  /**
-   * own class methods
-   */
-   ossimConvolutionFilter1D(ossimObject* owner=NULL);
-
-   virtual inline const std::vector<ossim_float64>& getKernel()const { return theKernel; }
-   virtual void setKernel(const std::vector<ossim_float64>& aKernel);
-
-   virtual inline bool isHorizontal()const         { return theIsHz; }
-   virtual inline void setIsHorizontal(bool aIsHz) { theIsHz = aIsHz; }
-
-   virtual inline ossim_int32 getCenterOffset()const              { return theCenterOffset; }
-   virtual inline void setCenterOffset(ossim_int32 aCenterOffset) { theCenterOffset = aCenterOffset; }
-   
-   virtual inline bool isStrictNoData()const         { return theStrictNoData; }
-   virtual inline void setStrictNoData(bool aStrict) { theStrictNoData = aStrict; }
-
-  /** 
-   * inherited methods
-   */
-   virtual ossimString getShortName()const{return ossimString("1D Convolution");}
-   virtual ossimString getLongName()const{return ossimString("Convolves the input image with a one dimensional convolution kernel");}
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-
-   virtual double getNullPixelValue(ossim_uint32 band=0) const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)  const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)  const;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,const char* prefix = 0);
-   virtual bool saveState(ossimKeywordlist& kwl,const char* prefix = 0)const;
-   
-protected:
-   virtual ~ossimConvolutionFilter1D();
-
-   /**
-    * Allocates theTile.
-    */
-   void allocate();
-
-   /**
-    * Clears data members theNullPixValue, theMinPixValue, and
-    * theMaxPixValue.
-    */
-   void clearNullMinMax();
-
-   /**
-    * Computes null, min, and max considering input connection and theKernel.
-    */
-   void computeNullMinMax();
-      
-   /*!
-    * Convolve full means that the input data is full and has
-    * no null data.  We don't have to compare for nulls here
-    */
-   template<class T>
-   void convolveFull(T,
-                     ossimRefPtr<ossimImageData> inputData,
-                     ossimRefPtr<ossimImageData> outputData);
-   
-   /*!
-    * Convolve partial means that the input data is has some
-    * null data.  We will have to compare nulls
-    */
-   template<class T>
-   void convolvePartial(T,
-                        ossimRefPtr<ossimImageData> inputData,
-                        ossimRefPtr<ossimImageData> outputData);
-
-   //! offset of center point in the Kernel
-   ossim_int32                theCenterOffset;
-   ossimRefPtr<ossimImageData> theTile;
-   std::vector<ossim_float64>  theKernel;
-   bool                        theIsHz; //! isHorizontal convolution?
-   bool                        theStrictNoData; //! strictly no NODATA values used
-
-   std::vector<double> theNullPixValue;
-   std::vector<double> theMinPixValue;
-   std::vector<double> theMaxPixValue;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimConvolutionFilter1D_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimConvolutionSource.h b/ossim/include/ossim/imaging/ossimConvolutionSource.h
deleted file mode 100644
index 19ee678..0000000
--- a/ossim/include/ossim/imaging/ossimConvolutionSource.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimConvolutionSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimConvolutionSource_HEADER
-#define ossimConvolutionSource_HEADER
-#include <vector>
-#include <iostream>
-#include <ossim/matrix/newmat.h>
-using namespace std;
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimTilePatch;
-class ossimDiscreteConvolutionKernel;
-
-class OSSIM_DLL ossimConvolutionSource : public ossimImageSourceFilter
-{
-public:
-   ossimConvolutionSource();
-   ossimConvolutionSource(ossimImageSource* inputSource,
-                          const NEWMAT::Matrix& convolutionMatix);
-   ossimConvolutionSource(ossimImageSource* inputSource,
-                          const vector<NEWMAT::Matrix>& convolutionList);
-   
-   virtual void setConvolution(const double* kernel, int nrows, int ncols, bool doWeightedAverage=false);
-   virtual void setConvolution(const NEWMAT::Matrix& convolutionMatrix, bool doWeightedAverage=false);
-   virtual void setConvolutionList(const vector<NEWMAT::Matrix>& convolutionList, bool doWeightedAverage=false);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-   
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-
-   ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect, ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-   
-protected:
-   virtual ~ossimConvolutionSource();
-
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theTile;
-   ossim_int32                 theMaxKernelWidth;
-   ossim_int32                 theMaxKernelHeight;
-   
-   std::vector<ossimDiscreteConvolutionKernel* > theConvolutionKernelList;
-   virtual void setKernelInformation();
-   virtual void deleteConvolutionList();
-
-   template<class T>
-   void convolve(T dummyVariable,
-                 ossimRefPtr<ossimImageData> inputTile,
-                 ossimDiscreteConvolutionKernel* kernel);
-   
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimConvolutionSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimDespeckleFilter.h b/ossim/include/ossim/imaging/ossimDespeckleFilter.h
deleted file mode 100644
index 2fab8dd..0000000
--- a/ossim/include/ossim/imaging/ossimDespeckleFilter.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-//*******************************************************************
-//  $Id: ossimDespeckleFilter.h 2644 2011-05-26 15:20:11Z oscar.kramer $
-#ifndef ossimDespeckleFilter_HEADER
-#define ossimDespeckleFilter_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimDespeckleFilter : public ossimImageSourceFilter
-{
-public:
-   ossimDespeckleFilter();
-   ossimDespeckleFilter(ossimImageSource* inputSource, ossim_uint32 filter_radius=1);
-   
-   virtual void setRadius(ossim_uint32 radius) { theFilterRadius = (ossim_int32) radius; }
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
-
-   ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect, ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-   
-   /* ------------------- PROPERTY INTERFACE -------------------- */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   /* ------------------ PROPERTY INTERFACE END ------------------- */
-
-protected:
-   virtual ~ossimDespeckleFilter();
-   template<class T> void despeckle(T dummyVariable, ossimRefPtr<ossimImageData> inputTile);
-
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theTile;
-   ossim_int32                theFilterRadius;
-   
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimDespeckleFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimDilationFilter.h b/ossim/include/ossim/imaging/ossimDilationFilter.h
deleted file mode 100644
index 4d59535..0000000
--- a/ossim/include/ossim/imaging/ossimDilationFilter.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//**************************************************************************************************
-//
-//                                            OSSIM
-//
-//       License: MIT. See LICENSE.txt file in the top level directory for more details.
-//
-//**************************************************************************************************
-//  $Id$
-#ifndef ossimDilationFilter_HEADER
-#define ossimDilationFilter_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/base/ossimPolygon.h>
-
-/*!
- * class ossimDilationFilter
- *
- * Allows you to change between a median or mean filter.  You can
- * also specify a window size which the median or mean is computed and
- * the center pixel is replaced.
- *
- */
-class OSSIM_DLL ossimDilationFilter : public ossimImageSourceFilter
-{
-public:
-   ossimDilationFilter(ossimObject* owner=NULL);
-   virtual void initialize();
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0);
-
-   /**
-    * Size of resampling kernel width & height
-    */
-   void setWindowSize(ossim_uint32 windowSize) { theWindowSize = windowSize; }
-   ossim_uint32 getWindowSize() const          { return theWindowSize; }
-
-   /**
-    * Set if getTile is to be called recursively until all pixels have been assigned non-null.
-    * This is only valid for "fill null" modes.
-    */
-   void setRecursiveFlag(bool flag=true) { theRecursiveFlag = flag; }
-   bool getRecursiveFlag() const         { return theRecursiveFlag; }
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-protected:
-   virtual ~ossimDilationFilter();
-   
-   ossimRefPtr<ossimImageData> theTile;
-   ossimRefPtr<ossimImageData> theTempTile; //!> Used for recursion when recursive fill enabled
-   ossim_uint32                theWindowSize;
-   bool                        theRecursiveFlag;
-   ossimPolygon                theValidImagePoly;
-   bool                        theNullFoundFlag;
-
-   template <class T> void doDilation(T scalarType, ossimRefPtr<ossimImageData>& inputData);
-
-   TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/imaging/ossimDoqqTileSource.h b/ossim/include/ossim/imaging/ossimDoqqTileSource.h
deleted file mode 100644
index 42c563e..0000000
--- a/ossim/include/ossim/imaging/ossimDoqqTileSource.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimDoqqTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimDoqqTileSource_HEADER
-#define ossimDoqqTileSource_HEADER
-#include <ossim/imaging/ossimGeneralRasterTileSource.h>
-#include <ossim/support_data/ossimDoqq.h>
-
-class OSSIM_DLL ossimDoqqTileSource: public ossimGeneralRasterTileSource
-{
-public:
-   ossimDoqqTileSource();
-   
-   ossimString getShortName()const;
-   ossimString getLongName()const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = NULL);
-   
-   //! Returns the image geometry object associated with this tile source or NULL if non defined.
-   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   bool open(const ossimFilename& filename);
-   bool open(const ossimGeneralRasterInfo& info);
-
-   ossimString acqdate() const;
-	
-   /**
-    * @brief Gets a property for matching name.
-    * @param name The name of the property to get.
-    * @return Returns property matching "name".
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   
-   /**
-    * @brief Gets a list of property names available.
-    * @param propertyNames The list to push back names to.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-	
-protected:
-   virtual ~ossimDoqqTileSource();
-  ossimRefPtr<ossimDoqq>   theHeaderInformation;
-  ossimString  theAcqDate;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimDtedTileSource.h b/ossim/include/ossim/imaging/ossimDtedTileSource.h
deleted file mode 100644
index 6b09e1e..0000000
--- a/ossim/include/ossim/imaging/ossimDtedTileSource.h
+++ /dev/null
@@ -1,260 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: David Burken
-//
-// Description:
-//
-// Contains class declaration of ossimDtedTileSource.  The ossimDtedTileSource
-// class is derived from ossimImageHandler and is intended to be an image
-// handler for DTED files.
-//
-//********************************************************************
-// $Id: ossimDtedTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDtedTileSource_HEADER
-#define ossimDtedTileSource_HEADER
-
-#include <fstream>
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/support_data/ossimDtedVol.h>
-#include <ossim/support_data/ossimDtedHdr.h>
-#include <ossim/support_data/ossimDtedUhl.h>
-#include <ossim/support_data/ossimDtedDsi.h>
-#include <ossim/support_data/ossimDtedAcc.h>
-
-class ossimImageData;
-
-class OSSIM_DLL ossimDtedTileSource : public ossimImageHandler
-{
-public:
-      
-   ossimDtedTileSource();
-
-   enum
-   {
-      DATA_RECORD_OFFSET_TO_POST = 8,  // bytes
-      DATA_RECORD_CHECKSUM_SIZE  = 4,  // bytes
-      POST_SIZE                  = 2,  // bytes
-      NULL_PIXEL                 = -32767
-   };
-   
-   virtual ossimString getShortName()const;
-   virtual ossimString getLongName()const;
-
-   /**
-    *  Returns true if "theImageFile" can be opened and is a valid adrg file.
-    */
-   virtual bool open();
-   virtual void close();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-   
-  /**
-   * Method to get a tile.   
-   *
-   * @param result The tile to stuff.  Note The requested rectangle in full
-   * image space and bands should be set in the result tile prior to
-   * passing.  It will be an error if:
-   * result.getNumberOfBands() != this->getNumberOfOutputBands()
-   *
-   * @return true on success false on error.  If return is false, result
-   *  is undefined so caller should handle appropriately with makeBlank or
-   * whatever.
-   */
-  virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-  
-   /**
-    *  Returns the number of bands in the image.
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   
-   virtual ossim_uint32 getNumberOfOutputBands()const;
-   
-   /**
-    *  Returns the number of lines in the image.
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfLines(
-      ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    *  Returns the number of samples in the image.  
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(
-      ossim_uint32 reduced_res_level = 0) const;
-
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * Returns the zero based image rectangle for the reduced resolution data
-    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
-    */
-   virtual ossimIrect getImageRectangle(
-      ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   //! Returns the image geometry object associated with this tile source or NULL if not defined.
-   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   virtual bool isOpen()const;
-
-   /**
-    * Initializes spacing to the post spacing of the cell.
-    *
-    * @param postSpacing ossimDpt to initialize with spacing where
-    * postspacing.x = longitude interval and postspacing.y = latitude interval.
-    */
-   void getPostSpacing(ossimDpt& postSpacing) const;
-
-   /**
-    * @brief Gets a property for name.
-    * @param name Property name to get.
-    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
-    * property for name was not found.
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   /**
-    * @brief Adds this class's properties to list.
-    * @param propertyNames list to append to.
-    */
-   virtual void getPropertyNames(
-      std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @brief Sets the min/max.
-    *
-    * looks for an omd or statistics file for min/max.  If not found
-    * calls gatherStatistics method.  Overrides ossimImageHandler::loadMetaData
-    * called by completeOpen.
-    */
-   virtual void loadMetaData();  
-   
-protected:
-   virtual ~ossimDtedTileSource();
-
-   // Disallow operator= and copy constrution...
-   const ossimDtedTileSource& operator=(const  ossimDtedTileSource& rhs);
-   ossimDtedTileSource(const ossimDtedTileSource&);
-
-   /**
-    * Allocated the tiles.
-    */
-   void allocate();
-
-   /**
-    *  Returns true on success, false on error.
-    */
-   bool fillBuffer(const ossimIrect& tile_rect,
-                   const ossimIrect& clip_rect,
-                   ossimImageData* tile);
-
-   
-   /**
-    * @brief Scans for min and max.
-    * @param writeStatsFile If true and statistics file does not exists it
-    * will write one; else, no file will be written.
-    */
-   void gatherStatistics(bool writeStatsFile);
-   
-   ossim_sint16 convertSignedMagnitude(ossim_uint16& s) const;
-   
-   ossimRefPtr<ossimImageData> theTile;
-   mutable std::ifstream      theFileStr;
-   ossim_uint32               theTileWidth;
-   ossim_uint32               theTileHeight;   
-   ossim_uint32               theNumberOfLines;
-   ossim_uint32               theNumberOfSamps;
-   ossim_uint32               theOffsetToFirstDataRecord;
-   ossim_uint32               theDataRecordSize;
-   ossim_sint16               theMinHeight;
-   ossim_sint16               theMaxHeight;
-   ossimDpt                   thePostSpacing;
-   
-   ossimDtedVol m_vol;
-   ossimDtedHdr m_hdr;
-   ossimDtedUhl m_uhl;
-   ossimDtedDsi m_dsi;
-   ossimDtedAcc m_acc;
-   /**
-    *  DTED data is always stored as BIG_ENDIAN.  This flag indicates that
-    *  byte swapping is needed (LITTLE_ENDIAN machine).
-    */
-   bool  theSwapBytesFlag;    
-
-TYPE_DATA
-};
-
-inline ossim_sint16 ossimDtedTileSource::convertSignedMagnitude(ossim_uint16& s) const
-{
-   // DATA_VALUE_MASK 0x7fff = 0111 1111 1111 1111
-   // DATA_SIGN_MASK  0x8000 = 1000 0000 0000 0000
-   
-   // First check to see if the bytes need swapped.
-   s = (theSwapBytesFlag ? ( ((s&0x00ff) << 8) | ((s&0xff00) >> 8) ) : s);
-
-   // If the sign bit is set, mask it out then multiply by negative one.
-   if (s & 0x8000)
-   {
-      return (static_cast<ossim_sint16>(s & 0x7fff) * -1);
-   }
-   
-   return static_cast<ossim_sint16>(s);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimERSTileSource.h b/ossim/include/ossim/imaging/ossimERSTileSource.h
deleted file mode 100644
index 17d2585..0000000
--- a/ossim/include/ossim/imaging/ossimERSTileSource.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Chong-Ket Chuah
-//
-// Description:
-//
-// Contains class definition for the class "ossimERSTileSource".
-//
-//*******************************************************************
-//  $Id: ossimERSTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimERSTileSource_HEADER
-#define ossimERSTileSource_HEADER
-
-#include <ossim/imaging/ossimGeneralRasterTileSource.h>
-#include <ossim/support_data/ossimERS.h>
-
-
-class OSSIM_DLL ossimERSTileSource : public ossimGeneralRasterTileSource
-{
-public:
-   ossimERSTileSource();
-
-   ossimERSTileSource(const ossimKeywordlist& kwl, const char* prefix=0);
-   
-
-   virtual ossimString getShortName() const;
-   virtual ossimString getLongName() const;
-   virtual ossimString className() const;
-
-   virtual bool open(const ossimFilename& filename);
-  
-   //! Returns the image geometry object associated with this tile source or NULL if not defined.
-   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = NULL);
-protected:
-   virtual ~ossimERSTileSource();
-
-private:
-
-   void openHeader(const ossimFilename& file);
-   
-   ossimERS* theHdr;
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimEdgeFilter.h b/ossim/include/ossim/imaging/ossimEdgeFilter.h
deleted file mode 100644
index 97de63c..0000000
--- a/ossim/include/ossim/imaging/ossimEdgeFilter.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimEdgeFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimEdgeFilter_HEADER
-#define ossimEdgeFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/**
- * class ossimEdgeFilter
- *
- * This has default implementation for the certain filter types.  For the
- * different filter type please see method setFilterType.
- *
- *
- */
-class ossimEdgeFilter : public ossimImageSourceFilter
-{
-public:
-   ossimEdgeFilter(ossimObject* owner=NULL);
-   ossimEdgeFilter(ossimImageSource* inputSource);
-   ossimEdgeFilter(ossimObject* owner,
-                    ossimImageSource* inputSource);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-   virtual void initialize();
-   virtual void getFilterTypeNames(std::vector<ossimString>& filterNames)const;
-   virtual ossimString getFilterType()const;
-   /**
-    * The filter type can be one of the following strings.  It is
-    * case insensitive for the compares.
-    *
-    *  Sobel
-    *  Laplacian
-    *  Prewitt
-    *  
-    */
-   virtual void setFilterType(const ossimString& filterType);
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   virtual bool saveState(ossimKeywordlist& kwl,const char* prefix=0)const;
-   virtual bool loadState(const ossimKeywordlist& kwl,const char* prefix=0);
-   
-protected:
-   ossimRefPtr<ossimImageData> theTile;
-   ossimString                 theFilterType;
-   
-   void adjustRequestRect(ossimIrect& requestRect)const;
-   
-   template <class T>
-   void runFilter(T dummyVariable,
-                  ossimRefPtr<ossimImageData> inputData);
-   template <class T>
-   void runSobelFilter(T dummyVariable,
-                       ossimRefPtr<ossimImageData> inputData);
-   template <class T>
-   void runPrewittFilter(T dummyVariable,
-                         ossimRefPtr<ossimImageData> inputData);
-   template <class T>
-   void runLaplacianFilter(T dummyVariable,
-                           ossimRefPtr<ossimImageData> inputData);
-   template <class T>
-   void runRobertsFilter(T dummyVariable,
-                           ossimRefPtr<ossimImageData> inputData);
-   template <class T>
-   void runLocalMax8Filter(T dummyVariable,
-                          ossimRefPtr<ossimImageData> inputData);
-   
-TYPE_DATA
-};
-
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimElevImageSource.h b/ossim/include/ossim/imaging/ossimElevImageSource.h
deleted file mode 100644
index f99767e..0000000
--- a/ossim/include/ossim/imaging/ossimElevImageSource.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-// 
-// Description:  Class provides an elevation image source from the elevation
-// manager.
-//
-//********************************************************************
-// $Id: ossimElevImageSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimElevImageSource_HEADER
-#define ossimElevImageSource_HEADER
-
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimGrect.h>
-
-class ossimElevSource;
-
-class ossimElevImageSource : public ossimImageSource
-{
-public:
-
-   ossimElevImageSource();
-   ossimElevImageSource(ossimObject* owner);
-   ossimElevImageSource(ossimObject* owner,
-                        const ossimGpt& tie,
-                        double latSpacing,  // decimal degrees
-                        double lonSpacing ,
-                        ossim_uint32 numberLines,
-                        ossim_uint32 numberSamples);
-   ossimElevImageSource(ossimObject* owner,
-                        const ossimKeywordlist& kwl,
-                        const char* prefix=0);
-   
-
-   /*!
-    *  Returns a pointer to a tile given an origin representing the upper left
-    *  corner of the tile to grab from the image.
-    *  Satisfies pure virtual from TileSource class.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
-                                   ossim_uint32 resLevel=0);
-
-   /*!
-    *  Populates the keyword list with image geometry information.  This
-    *  method is used to relay projection/model information to users.
-    *  Returns true if geometry info is present, false if not.
-    */
-   virtual bool getImageGeometry(ossimKeywordlist& kwl,
-                                 const char* prefix=0);
-   
-   /*!
-    *  Returns the number of bands in the image.  Alway one for this source.
-    */
-   virtual ossim_uint32 getNumberOfOutputBands()const { return 1; }
-
-
-   /*!
-    * Returns the zero-based (relative) image rectangle for the reduced
-    * resolution data set (rrds) passed in.  Note that rrds 0 is the highest
-    * resolution rrds.
-    */
-   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const; 
-
-   /*!
-    * Returns the absolute bounding rectangle of the image. The upper left
-    * corner may be non-zero if this is a subimage.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel = 0) const
-      {
-         return getImageRectangle(resLevel);
-      }
-   
-   /*!
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   bool canConnectMyInputTo(ossim_int32 /* inputIndex */,
-                            const ossimConnectableObject* /* object */ )const
-   {      
-      return false;
-   }
-      
-   virtual void initialize();
-
-   /*!
-    *  Satisfy pure virtuals from base classes...
-    */
-   virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const;
-   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
-   virtual ossim_uint32 getNumberOfDecimationLevels()const;
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual ossim_uint32 getTileWidth() const;
-   virtual ossim_uint32 getTileHeight() const;
-   virtual void changeTileSize(const ossimIpt& size);
-
-   // access methods
-   virtual ossimGpt getTiePoint()         const { return theTiePoint; }
-   virtual ossim_float64 getLatitudeSpacing()  const { return theLatSpacing; }
-   virtual ossim_float64 getLongitudeSpacing() const { return theLonSpacing; }
-   virtual ossim_uint32  getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
-   // set methods
-   virtual void setTiePoint(const ossimGpt& gpt) { theTiePoint = gpt; }
-   virtual void setLatitudeSpacing(ossim_float64 sp) { theLatSpacing = sp; }
-   virtual void setLongitudeSpacing(ossim_float64 sp) { theLonSpacing = sp; }
-   virtual void setNumberOfLines(ossim_uint32 lines) { theNumberOfLines = lines; }
-   virtual void setNumberOfSamples(ossim_uint32 samps) { theNumberOfSamps = samps;}
-   virtual void setMinPixelValue(ossim_float64 min_pix);
-   virtual void setMaxPixelValue(ossim_float64 max_pix);
-   
-protected:
-   virtual ~ossimElevImageSource();
-
-   ossimElevSource*            theElevManager;
-   ossimRefPtr<ossimImageData> theTile;
-   ossimGpt                    theTiePoint;      // upper left tie point
-   ossim_float64               theLatSpacing;    // in decimal degrees
-   ossim_float64               theLonSpacing;    // in decimal degrees
-   ossim_uint32                theNumberOfLines;
-   ossim_uint32                theNumberOfSamps;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimEnviHeaderFileWriter.h b/ossim/include/ossim/imaging/ossimEnviHeaderFileWriter.h
deleted file mode 100644
index 415f31a..0000000
--- a/ossim/include/ossim/imaging/ossimEnviHeaderFileWriter.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Class declaration for ossimEnviHeaderFileWriter.  Meta data class for
-// writing an ENVI (The Environment for Visualizing Images) header file.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimEnviHeaderFileWriter.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimEnviHeaderFileWriter_H
-#define ossimEnviHeaderFileWriter_H
-
-#include <fstream>
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-
-/**
- * Class for writing a "ENVI" style header.
- */
-class OSSIMDLLEXPORT ossimEnviHeaderFileWriter : public ossimMetadataFileWriter
-{
-public:
-
-   /** default constructor */
-   ossimEnviHeaderFileWriter();
-
-
-   /**
-    * Initializes the state of the writer.  Users should use this to set
-    * the envi header fields that are not taken from theInputConnection prior
-    * to calling execute.
-    *
-    * @return true on success, false on failure.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * Appends the writers image types to the "metadatatypeList".
-    * 
-    * @param metadatatypeList stl::vector<ossimString> list to append to.
-    *
-    * @note Appends to the list, does not clear it first.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList) const;
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * @param imageType string representing image type.
-    *
-    * @return true if "metadataType" is supported by writer.
-    */
-   virtual bool hasMetadataType(const ossimString& metadataType)const;   
-protected:
-   /** virtual destructor */
-   virtual ~ossimEnviHeaderFileWriter();
-
-private:
-   
-   virtual bool writeFile();
-
-   ossimEnviHeader theHdr;
-   
-TYPE_DATA
-};
-#endif /* End of #ifndef ossimEnviHeaderFileWriter_H */
-
diff --git a/ossim/include/ossim/imaging/ossimEnviTileSource.h b/ossim/include/ossim/imaging/ossimEnviTileSource.h
deleted file mode 100644
index 5bef61f..0000000
--- a/ossim/include/ossim/imaging/ossimEnviTileSource.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Image handler class for a raster files with an ENVI header file.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimEnviTileSource_HEADER
-#define ossimEnviTileSource_HEADER 1
-
-#include <ossim/imaging/ossimGeneralRasterTileSource.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-
-
-class OSSIMDLLEXPORT ossimEnviTileSource : public ossimGeneralRasterTileSource
-{
-public:
-
-   /** @brief default constructor */
-   ossimEnviTileSource();
-
-   /** @return "ENVI" */
-   virtual ossimString getShortName() const;
-
-   /** @return "ENVI reader" */
-   virtual ossimString getLongName()  const;
-
-   /** @brief open method. */
-   virtual bool open();
-
-   /**
-    * @return The image geometry object associated with this tile source or
-    * NULL if not defined.  The geometry contains full-to-local image transform
-    * as well as projection (image-to-world).
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * @return true on success, false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = NULL);
-
-   /**
-    * @brief Gets a property.
-    * @param The name of the property to get.
-    * @return The property if found.
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-
-   /**
-    * @brief Adds property names to array.
-    * @param propertyNames Array to populate with property names.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-protected:
-   
-   /** @brief Hidden from use destructor.  This is a ref ptr. */
-   virtual ~ossimEnviTileSource();
-
-private:
-
-   /**
-    * @brief Sets default output band list if we are a band selector and
-    * "default bands" is found in the header file.
-    */
-   void setDefaultBandList();
-
-   /**
-    * @brief Creates geometry from known support data, i.e. envi header,
-    * and so on if found.
-    */
-   ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const;
-   
-   ossimEnviHeader m_enviHdr;
-   
-TYPE_DATA
-   
-}; // End: class ossimEnviTileSource
-
-#endif /* #ifndef ossimEnviTileSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimEquationCombiner.h b/ossim/include/ossim/imaging/ossimEquationCombiner.h
deleted file mode 100644
index 8743e72..0000000
--- a/ossim/include/ossim/imaging/ossimEquationCombiner.h
+++ /dev/null
@@ -1,324 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimEquationCombiner.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimEquationCombiner_HEADER
-#define ossimEquationCombiner_HEADER
-#include <ossim/imaging/ossimImageCombiner.h>
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-#include <ossim/base/ossimEquTokenizer.h>
-#include <stack>
-
-//class ossimCastTileSourceFilter;
-
-/**
- * Will combine the input data based on a supplied equation.
- *
- * This combiner uses the ossimEquTokenizer to create unique id's
- * for all tokens in the formula.  The parser is based on the following
- * rules:
- *
- * <pre>
- * 
- * Prog -> Expr EOF 
- * Expr -> Term RestExpr 
- * RestExpr -> + Term RestExpr | - Term RestExpr | <null> 
- * Term -> Storable RestTerm 
- * RestTerm -> * Factor RestTerm | / Factor RestTerm | <null> 
- * Factor -> number | R | ( Expr )
- *
- *
- * The equation string represents input images as in[i] for i = 0, 1, ..., n.
- * The following tokens are supported, where I, I1, I2, ..., In are inputs (either input images or
- * image solutions of other equations):
- *
- * sin(I)                 takes the sine of the input
- * sind(I)                takes the sin of the input and assumes degree input
- * asin(I)                computes the arc-sine of input in radians (input must be normalized)
- * asind(I)               computes the arc-sine of input in degrees (input must be normalized)
- * cos(I)                 takes cosine of input
- * cosd(I)                takes the cosine of input and assumes input in degrees
- * acos(I)                computes the arc-cosine of input in radians (input must be normalized)
- * acosd(I)               computes the arc-cosine of input in degrees (input must be normalized)
- * tan(I)                 takes tangent of input
- * tand(I)                takes the tangent of input and assumes input in degrees
- * atan(I)                computes the arc-tangent of input in radians
- * atand(I)               computes the arc-tangent of input in degrees
- * sqrt(I)                takes square root of input
- * log(I)                 takes the natural log of input
- * log10(I)               takes the log base 10 of the input
- * exp(I)                 takes the e raised to the passed in argument
- * abs(I)                 takes the absolute value of the passed in value
- * min(I1, I2, ... In)    takes the min of all values in the list
- * max(I1, I2, ... In)    takes the max of all values in the list.
- *
- * clamp(I, min, max)     will clamp all data to be between the min max values.
- *                        will set anything less than min to min and anythin
- *                        larger than max to max
- *
- * band(I, band_index)    returns a single band image object
- *                        by selecting band num from input image x.  Note
- *                        the first argument must be an image
- *                        and the second argument must be a number
- *
- * shift(I, rows, cols)
- *                        currently, the first argument must be an image
- *                        variable and rows, cols must be numbers
- *                        indicating the delta in that direction to shift the
- *                        input.
- *
- * blurr(I, rows, cols)   Will blurr the input image I with a
- *                        rows-by-cols kernel.  All values are equal
- *                        weight.  Note the fist argument must by an image
- *                        variable (ex: i1, i2,....in).
- *
- * conv(index, rows, cols, <row ordered list of values> )
- *                        this allows you to define an arbitrary matrix.  The
- *                        <row ordered list of values> is a comma separated
- *                        list of constant values.
- *
- * assign_band(I1, num1, I2, num2)
- *                        will take band num2 from image data I2 and assign it to
- *                        band num1 in image data I1.
- *
- * assign_band(I1, num1, I2)
- *                        will take band 1 from image data I2 and assign it to
- *                        band num1 in image data I1.
- *
- * assign_band(I, num1, num2)
- *                        will assin to band num1 of data I the value of num2
- *
- * I1 * I2                will multiply I1 and I2
- * I1 + I2                will add I1 and I2
- * I1 - I2                will subtract I1 and I2
- * I1 / I2                will divide I1 and I2
- * I1 ^ I2                will do a power, raises I1 to I2
- * I1 | I2                will do a bitwise or operation
- *                        ( will do it in unisgned char precision)
- *
- * I1 & I2                will do a bitwise and operation
- *                        ( will do it in unsigned char precision)
- *
- * ~I1                    will do the ones complement of the input
- *
- * I1 xor I2              will do an exclusive or operation
- *                        (will do it in unsigned char precision)
- *
- * - I1                   will negative of I1
- *
- * Boolean ops: 1=true, 0=false
- * I1 > I2
- * I1 >= I2
- * I1 == I2
- * I1 <= I2
- * I1 < I2
- * I1 <> I2
- *
- * Note:
- *
- * Currently an image input is reference by the variable "in[i]" where i
- * represents the input image index starting from 0.  So in[1] referes to the second image
- * in the input source list.
- *
- * Some examples:
- *
- *  (in[0] + in[1])/2
- *  Will take image 0 and add it to image 1 and average them.
- *
- *  exp(sqrt(in[0])/4)
- *  Will take the root of the image and divide by 4 and then raise e to that
- *  amount.
- *
- *  128
- *  Will return a constant value of 128 for all input bands.
- *
- * shift(0, 1, 1) - in[0]
- * Will shift the first input (0) by 1 pixel along the diagonal and then subtract
- * the original from the shifted (edge detect).
- *
- * assign_band(in[1], 1, blurr(in[1], 5, 5), 2)
- * Will assign to the first band of input 1 the 2nd band of the 5x5 blurr of same image.
- *
- * conv(0, 3, 3, -1, -2, -1, 0, 0, 0, 1, 2, 1)
- * Will convolve the first input connection with a 3x3 matrix.
- * The args are row ordered:
- *                          -1, -2, -1
- *                           0,  0,  0
- *                           1,  2,  1
- *
- * NDVI:
- * N=(in[0]-in[1])/(in[0]+in[1])
- *
- * For indexed-type values,like NDVI, (with limited values) it is better
- * to rescale between 0.0 and 1.0 and use type NormalizedFloat.
- * 
- * Rescaled NDVI between 0 and 1:
- * (N+1)/2 = in[0]/(in[0]+in[1])
- * 
- * With an ossimImageToPlaneNormalFilter feeding the DEM-image input, the slope at each pixel,
- * normalized so that 1.0 = 90 deg from vertical, is computed with:
- * "acosd(band(in[0],2))/90"
- *
- * </pre>
- */
-class OSSIMDLLEXPORT ossimEquationCombiner : public ossimImageCombiner
-{
-public:
-   ossimEquationCombiner();
-   ossimEquationCombiner(ossimConnectableObject::ConnectableObjectList& inputSources);
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-
-   virtual void setEquation(const ossimString& equ)
-      {
-         theEquation = equ;
-      }
-   virtual ossimString getEquation()const
-      {
-         return theEquation;
-      }
-   
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   virtual ossimScalarType getOutputScalarType() const;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   
-   virtual void setOutputScalarType(ossimScalarType scalarType);
-   /*!
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   class ossimBinaryOp
-   {
-   public:
-      virtual ~ossimBinaryOp(){}
-      virtual double apply(double v1, double v2)const=0;
-   };
-   class ossimUnaryOp
-   {
-   public:
-      virtual ~ossimUnaryOp(){}
-      virtual double apply(double v)const=0;
-   };
-   
-protected:
-   enum ossimEquValueType
-   {
-      OSSIM_EQU_TYPE_UNKNOWN    = 0,
-      OSSIM_EQU_DOUBLE_TYPE     = 1,
-      OSSIM_EQU_IMAGE_DATA_TYPE = 2
-   };
-   
-   union ossimEquDataType
-   {
-      double           doubleValue;
-      ossimImageData* imageDataValue;
-   };
-   
-   struct ossimEquValue
-   {
-      int              type;
-      ossimEquDataType d;
-   };
-
-   virtual ~ossimEquationCombiner();
-   
-   
-   ossimScalarType             theOutputScalarType;
-   ossimString                 theEquation;
-   mutable ossimEquTokenizer  *theLexer;
-   ossimRefPtr<ossimImageData> theTile;
-   ossimRefPtr<ossimCastTileSourceFilter>  theCastFilter;
-   ossimRefPtr<ossimCastTileSourceFilter> theCastOutputFilter;
-   
-   mutable int                theCurrentId;
-   mutable std::stack<ossimEquValue> theValueStack;
-   ossim_uint32                     theCurrentResLevel;
-   virtual void assignValue();
-   virtual void clearStacks();
-   virtual void clearArgList(vector<ossimEquValue>& argList);
-
-   virtual ossimRefPtr<ossimImageData> getImageData(ossim_uint32 index);
-   virtual ossimRefPtr<ossimImageData> getNewImageData(ossim_uint32 index);
-
-   virtual void deleteArgList(vector<ossimEquValue>& args);
-   virtual bool parseArgList(vector<ossimEquValue>& args,
-                             bool popValueStack = true);
-   
-   virtual ossimRefPtr<ossimImageData> parseEquation();
-  
-   virtual bool parseAssignBand();
-   virtual bool parseExpression();
-   virtual bool parseRestOfExp();
-   virtual bool parseTerm();
-   virtual bool parseRestOfTerm();
-   virtual bool parseFactor();
-   virtual bool parseStdFuncs();
-   virtual bool parseUnaryFactor();
-
-   virtual bool applyClamp(ossimImageData* &result,
-                           const vector<ossimEquValue>& argList);
-                           
-   virtual bool applyConvolution(ossimImageData* &result,
-                                 const vector<ossimEquValue>& argList);
-   
-   virtual bool applyBlurr(ossimImageData* &result,
-                           const vector<ossimEquValue>& argList);
-   
-   virtual bool applyShift(ossimImageData* &result,
-                           const vector<ossimEquValue>& argList);
-   
-   virtual bool applyOp(const ossimBinaryOp& op,
-                        ossimEquValue& result,
-                        ossimEquValue& v1,
-                        ossimEquValue& v2);
-   
-   virtual bool applyOp(const ossimBinaryOp& op,
-                        ossimImageData* v1,
-                        double          v2);
-
-   virtual bool applyOp(const ossimBinaryOp& op,
-                        double          v1,
-                        ossimImageData* v2);
-
-   virtual bool applyOp(const ossimBinaryOp& op,
-                        ossimImageData* v1,
-                        ossimImageData* v2);      
-
-   
-   virtual bool applyOp(const ossimUnaryOp& op,
-                        ossimEquValue& result,
-                        ossimEquValue& v1);
-   
-   virtual bool applyOp(const ossimUnaryOp& op,
-                        ossimImageData* v);
-   
-TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimFeatherMosaic.h b/ossim/include/ossim/imaging/ossimFeatherMosaic.h
deleted file mode 100644
index 1cd5218..0000000
--- a/ossim/include/ossim/imaging/ossimFeatherMosaic.h
+++ /dev/null
@@ -1,88 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimFeatherMosaic.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFeatherMosaic_HEADER
-#define ossimFeatherMosaic_HEADER
-#include <vector>
-#include <iterator>
-
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/base/ossimDpt.h>
-
-
-/**
- * Performs a spatial blend accross overlapping regions
- */
-class OSSIMDLLEXPORT ossimFeatherMosaic : public ossimImageMosaic
-{
-public:
-   ossimFeatherMosaic();
-   ossimFeatherMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                   ossim_uint32 resLevel=0);
-   virtual void initialize();
-       
-protected:
-   virtual ~ossimFeatherMosaic();
-   /**
-    * This is only visible by this class and will remain here
-    * unless we want to move it later.
-    */
-   class ossimFeatherInputInformation
-   {
-      
-   public:
-      ossimFeatherInputInformation(const vector<ossimIpt>& validVertices=vector<ossimIpt>());
-
-      void setVertexList(const vector<ossimIpt>& validVertices);
-      
-      ossimDpt        theCenter;
-      ossimDpt        theAxis1;
-      ossimDpt        theAxis2;
-      double          theAxis1Length;
-      double          theAxis2Length;
-      std::vector<ossimIpt> theValidVertices;
-      
-   };
-
-   friend ostream& operator<<(ostream& out,
-                              const ossimFeatherInputInformation& data);
-   
-
-   /**
-    * will hold an array of input information
-    *
-    */
-   ossimFeatherInputInformation* theInputFeatherInformation;
-   ossimRefPtr<ossimImageData> theAlphaSum;
-   ossimRefPtr<ossimImageData> theResult;
-   
-   /**
-    * Will hold the count for the feather information list.
-    */
-   long                          theFeatherInfoSize;
-
-   /**
-    * The dummy variable is used for the template type.  See the getTile
-    * method for the call.
-    */
-   template <class T>
-   ossimRefPtr<ossimImageData> combine(T dummyVariableNotUsed,
-                                       const ossimIrect& tileRect,
-                                       ossim_uint32 resLevel);
-   
-   virtual double computeWeight(long index,
-                                const ossimDpt& point)const;
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimFeatherMosaic_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimFftFilter.h b/ossim/include/ossim/imaging/ossimFftFilter.h
deleted file mode 100644
index 849d2a0..0000000
--- a/ossim/include/ossim/imaging/ossimFftFilter.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimFftFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFftFilter_HEADER
-#define ossimFftFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimScalarRemapper;
-
-class ossimFftFilter : public ossimImageSourceFilter
-{
-public:
-   enum ossimFftFilterDirectionType
-      {
-         ossimFftFilterDirectionType_FORWARD = 0,
-         ossimFftFilterDirectionType_INVERSE
-      };
-   ossimFftFilter(ossimObject* owner=NULL);
-   ossimFftFilter(ossimImageSource* inputSource);
-   ossimFftFilter(ossimObject* owner,
-                  ossimImageSource* inputSource);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                   ossim_uint32 resLevel=0);
-   virtual void initialize();
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-  /*!
-   * Returns the max pixel of the band.
-   */
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-  /*!
-   * Each band has a null pixel associated with it.  The null pixel 
-   * represents an invalid value.
-   */ 
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   
-   void setForward();
-   void setInverse();
-   ossimString getDirectionTypeAsString()const;
-   void setDirectionType(const ossimString& directionType);
-   void setDirectionType(ossimFftFilterDirectionType directionType);
-      
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0)const;
-protected:
-   virtual ~ossimFftFilter();
-   ossimRefPtr<ossimImageData> theTile;
-   ossimFftFilterDirectionType theDirectionType;
-   ossimRefPtr<ossimScalarRemapper>        theScalarRemapper;
-   template <class T>
-   void runFft(T dummy,
-               ossimRefPtr<ossimImageData>& input,
-               ossimRefPtr<ossimImageData>& output);
-
-   template <class T>
-   void fillMatrixForward(T *realPart,
-                          T nullPix,
-                          NEWMAT::Matrix& real,
-                          NEWMAT::Matrix& img)const;
-   template <class T>
-   void fillMatrixInverse(T *realPart,
-                          T *imgPart,
-                          NEWMAT::Matrix& real,
-                          NEWMAT::Matrix& img)const;
-
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimFgdcFileWriter.h b/ossim/include/ossim/imaging/ossimFgdcFileWriter.h
deleted file mode 100644
index c0dce1a..0000000
--- a/ossim/include/ossim/imaging/ossimFgdcFileWriter.h
+++ /dev/null
@@ -1,158 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  Class to write out meta data in a Federal Geographic Data
-// Committe (FGDC) format.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimFgdcFileWriter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFgdcFileWriter_HEADER
-#define ossimFgdcFileWriter_HEADER
-
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/base/ossimXmlDocument.h>
-
-/**
- * Class to write out meta data in a Federal Geographic Data
- * Committe (FGDC) format.
- */
-class OSSIMDLLEXPORT ossimFgdcFileWriter : public ossimMetadataFileWriter
-{
-public:
-   
-   /** constructor */
-   ossimFgdcFileWriter();
-
-   
-   /**
-    * Method to load the state from a keyword list.
-    *
-    * @param kwl Keyword list to load state from.
-    *
-    * @param prefix Prefix to attatch to keyword (like "object1.").
-    * default=NULL
-    *
-    * @return true if ok or false on error.
-    *
-    * Keywords picked up by this loadState:
-    * 
-    * source_image_filename: foo.ntf
-    * tab_string:            "\t"
-    * fgdc_template_doc:     fgdc_template.xml
-    * 
-    */
-   virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0);
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * Appends the writers image types to the "metadatatypeList".
-    * 
-    * @param metadatatypeList stl::vector<ossimString> list to append to.
-    *
-    * @note Appends to the list, does not clear it first.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList) const;
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * @param imageType string representing image type.
-    *
-    * @return true if "metadataType" is supported by writer.
-    */
-   virtual bool hasMetadataType(const ossimString& metadataType)const;
-
-   
-   /** @return Returns the current indentation level. */
-   ossim_uint32 getIndentionLevel() const;
-
-   /**
-    * Sets the current indentation level.
-    *
-    * @param level Indentation level.  "0" equals no indentation.
-    */
-   void setIndentionLevel(ossim_uint32 level);
-
-   /**
-    * @return The current tab string e.g.: "\t".
-    */
-   ossimString getTabString() const;
-
-   /**
-    * Sets the tab string.  Usually "\t" or spaces "  ".
-    *
-    * @param tabString  String to use for indentation.
-    */
-   void setTabString(const ossimString& tabString);
-
-   /**
-    * @param title Tile of data usually the image file name.
-    */
-   void setTitle(const ossimString& pubDate);
-
-   void setTemplate(const ossimFilename& xmlTemplateFile);
-
-   ossimString find(const ossimString& xpath) const;
-
-   bool writeTemplate(const ossimFilename& file) const;
-
-protected:
-   /** destructor */
-   virtual ~ossimFgdcFileWriter();
-
-   /**
-    * Writes file to disk.
-    *
-    * @return true on success, false on failure.
-    */
-   virtual bool writeFile();
-
-private:
-
-   /**
-    * Writes openning tag adding any indentation and brackets.  Increments
-    * indentation level.
-    *
-    * @param os otream to write to.
-    *
-    * @param tag String representing tag with no brackets, i.e. "metadata".
-    *
-    * @param newLine If true a new line "\n" is added.
-    */
-   void openTag(std::ostream& os,
-                const ossimString& tag,
-                bool newLine) const;
-
-   /**
-    * Closes tag decrementing indentation.
-    * e.g.: <metadata>
-    *
-    * @param os otream to write to.
-    *
-    * @param tag String representing tag with no brackets.
-    *
-    * @param decrementLevel If true indentation level is decremented.
-    */
-   void closeTag(std::ostream& os,
-                 const ossimString& tag,
-                 bool decrementLevel) const;
-   
-   mutable ossim_uint32 theIndentionLevel;
-   ossimString          theTabString;
-   ossimXmlDocument     theTemplate;
-   ossimFilename        theSourceImageFilename;
-
-TYPE_DATA
-};
-
-#endif /* End of "#ifndef ossimFgdcFileWriter_HEADER" */
-
diff --git a/ossim/include/ossim/imaging/ossimFilterResampler.h b/ossim/include/ossim/imaging/ossimFilterResampler.h
deleted file mode 100644
index dff9a29..0000000
--- a/ossim/include/ossim/imaging/ossimFilterResampler.h
+++ /dev/null
@@ -1,152 +0,0 @@
-//*******************************************************************
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Contributor:
-//         David A. Horner (DAH) http://dave.thehorners.com
-//
-//*************************************************************************
-// $Id: ossimFilterResampler.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFilterResampler_HEADER
-#define ossimFilterResampler_HEADER
-
-#include <vector>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimFilter.h>
-#include <ossim/imaging/ossimFilterTable.h>
-
-class OSSIMDLLEXPORT ossimFilterResampler
-{
-public:
-   enum ossimFilterResamplerType
-   {
-      ossimFilterResampler_NEAREST_NEIGHBOR = 0,
-      ossimFilterResampler_BOX              = 1,
-      ossimFilterResampler_GAUSSIAN         = 2,
-      ossimFilterResampler_CUBIC            = 3,
-      ossimFilterResampler_HANNING          = 4,
-      ossimFilterResampler_HAMMING          = 5,
-      ossimFilterResampler_LANCZOS          = 6,
-      ossimFilterResampler_MITCHELL         = 7,
-      ossimFilterResampler_CATROM           = 8,
-      ossimFilterResampler_BLACKMAN         = 9,
-      ossimFilterResampler_BLACKMAN_SINC    = 10,
-      ossimFilterResampler_BLACKMAN_BESSEL  = 11,
-      ossimFilterResampler_QUADRATIC        = 12,
-      ossimFilterResampler_TRIANGLE         = 13,
-      ossimFilterResampler_BILINEAR         = 13,
-      ossimFilterResampler_HERMITE          = 14,
-      ossimFilterResampler_BELL             = 15,
-      ossimFilterResampler_BSPLINE          = 16,
-      ossimFilterResampler_MAGIC            = 17
-      
-   };
-   ossimFilterResampler();
-   virtual ~ossimFilterResampler();
-
-  virtual void resample(const ossimRefPtr<ossimImageData>& input,
-			ossimRefPtr<ossimImageData>& output,
-			const ossimDpt& ul,
-			const ossimDpt& ur,
-			const ossimDpt& deltaUl,
-			const ossimDpt& deltaUr,
-			const ossimDpt& length);
-
-  virtual void resample(const ossimRefPtr<ossimImageData>& input,
-			ossimRefPtr<ossimImageData>& output,
-			const ossimIrect& outputSubRect,
-			const ossimDpt& ul,
-			const ossimDpt& ur,
-			const ossimDpt& deltaUl,
-			const ossimDpt& deltaUr,
-			const ossimDpt& length);
-
-  void setFilterType(ossimFilterResamplerType filterType);
-  void setFilterType(ossimFilterResamplerType minifyFilterType,
-		     ossimFilterResamplerType magnifyFilterType);
-  void setFilterType(const ossimString& type);
-  void setFilterType(const ossimString& minifyType,
-		     const ossimString& magnifyType);
-
-  void setMinifyFilterType(const ossimString& minifyType);
-  void setMagnifyFilterType(const ossimString& magnifyType);
-  void setMinifyFilterType(ossimFilterResamplerType filterType);
-  void setMagnifyFilterType(ossimFilterResamplerType filterType);
-  ossimString getMinifyFilterTypeAsString()const;
-  ossimString getMagnifyFilterTypeAsString()const;
-  void setScaleFactor(const ossimDpt& scale);
-  void setBlurFactor(ossim_float64 blur);
-
-  void setBoundingInputRect(const ossimIrect& rect)
-  {
-    theInputRect = rect;
-  }
-  ossimIrect getBoundingInputRect()const
-  {
-    return theInputRect;
-  }
-
-  ossim_float64 getBlurFactor()const;
-
-  const ossimDpt& getScaleFactor()const
-  {
-    return theScaleFactor;
-  }
-  /*!
-   * Saves the state of this object.
-   */
-  virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-  
-  /*!
-   * Loads the state of this object.
-   */
-  virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-  
-  virtual void getKernelSupport(double& x,
-				double & y)const;
-
-  virtual void getFilterTypes(std::vector<ossimString>& filterTypes)const;
-
-private:
-  const ossimFilter* getHorizontalFilter()const;
-  const ossimFilter* getVerticalFilter()const;
-
-  template <class T>
-  void resampleBilinearTile(T dummy,
-			    const ossimRefPtr<ossimImageData>& input,
-			    ossimRefPtr<ossimImageData>& output,
-			    const ossimIrect& outputSubRect,
-			    const ossimDpt& inputUl,
-			    const ossimDpt& inputUr,
-			    const ossimDpt& deltaUl,
-			    const ossimDpt& deltaUr,
-			    const ossimDpt& outLength);
-  
-   void computeTable();
-   ossimString getFilterTypeAsString(ossimFilterResamplerType type)const;
-   ossimFilterResamplerType getFilterType(const ossimString& type)const;
-   ossimFilter* createNewFilter(ossimFilterResamplerType filterType,
-                                ossimFilterResamplerType& result);
-
-
-   ossimFilter*             theMinifyFilter;
-   ossimFilter*             theMagnifyFilter;
-   ossimFilterTable         theFilterTable;
-   
-   ossimFilterResamplerType theMinifyFilterType;
-   ossimFilterResamplerType theMagnifyFilterType;
-   ossimDpt                 theScaleFactor;
-   ossimDpt                 theInverseScaleFactor;
-   
-   ossimIrect               theInputRect;
-   ossim_float64            theBlurFactor;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimFilterTable.h b/ossim/include/ossim/imaging/ossimFilterTable.h
deleted file mode 100644
index 34fd916..0000000
--- a/ossim/include/ossim/imaging/ossimFilterTable.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimFilterTable.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFilterTable_HEADER
-#define ossimFilterTable_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <cmath>
-
-class ossimFilter;
-
-class OSSIM_DLL ossimFilterTable
-{
-public:
-   /** default constructor */
-   ossimFilterTable();
-
-   /** destructor */
-   ~ossimFilterTable();
-
-   /** Builds a table with filter being used in both x and y direction. */
-   void buildTable(ossim_uint32  filterSteps,
-                   const ossimFilter& filter);
-
-   /** Builds a table. */
-   void buildTable(ossim_uint32  filterSteps,
-                   const ossimFilter& xFilter,
-                   const ossimFilter& yFilter);
-
-   /** @return theWidth*theHeight */
-   ossim_uint32 getWidthByHeight() const;
-
-   /** @return theXSupport */
-   ossim_uint32 getXSupport()      const;
-
-   /** @return theYSupport */
-   ossim_uint32 getYSupport()      const;
-
-   /** @return theWidth */
-   ossim_uint32 getWidth()         const;
-
-   /** @return theHeight */
-   ossim_uint32 getHeight()        const;
-
-   /**
-    * Inlined below.
-    *
-    * @return const double* to the closest weight of x and y.
-    */
-   const double* getClosestWeights(const double& x, const double& y)const;
-
-protected:
-
-   /**
-    * Creates the weight array "theWeights".  Will delete if previously
-    * allocated.
-    */
-   void allocateWeights();
-
-   double*      theWeights;
-   ossim_uint32 theWidth;
-   ossim_uint32 theHeight;
-   ossim_uint32 theWidthHeight;
-   ossim_uint32 theXSupport;
-   ossim_uint32 theYSupport;
-   ossim_uint32 theFilterSteps;
-};
-
-/**
- * Method inlined for speed as it is used in the inner pixel loop of
- * ossimFilterResampler::resampleBilinearTile method.
- */
-inline const double* ossimFilterTable::getClosestWeights(const double& x,
-                                                         const double& y)const
-{
-   // Extract the decimal part of x and y.
-   double intPartDummy;
-   double decimalPrecisionX = fabs(modf(x, &intPartDummy));
-   double decimalPrecisionY = fabs(modf(y, &intPartDummy));
-   
-   ossim_int32 kernelLine =
-      (ossim_int32)(theFilterSteps*decimalPrecisionY);
-   ossim_int32 kernelSamp =
-      (ossim_int32)(theFilterSteps*decimalPrecisionX);
-  
-  return &theWeights[(kernelLine*theFilterSteps +
-                      kernelSamp)*theWidthHeight];
-}
-
-#endif /* End of "#ifndef ossimFilterTable_HEADER" */
-
diff --git a/ossim/include/ossim/imaging/ossimFixedTileCache.h b/ossim/include/ossim/imaging/ossimFixedTileCache.h
deleted file mode 100644
index f0114cf..0000000
--- a/ossim/include/ossim/imaging/ossimFixedTileCache.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: This file contains the Application cache algorithm
-//
-//***********************************
-// $Id: ossimFixedTileCache.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFixedTileCache_HEADER
-#define ossimFixedTileCache_HEADER
-#include <map>
-#include <list>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <OpenThreads/Mutex>
-
-class  ossimFixedTileCacheInfo
-{
-public:
-   ossimFixedTileCacheInfo(ossimRefPtr<ossimImageData>& tile,
-                           ossim_int32 tileId=-1)
-      :theTile(tile),
-      theTileId(tileId)
-      {
-      }
-   
-   bool operator <(const ossimFixedTileCacheInfo& rhs)const
-      {
-         return (theTileId < rhs.theTileId);
-      }
-   bool operator <(ossim_int32 tileId)const
-      {
-         return (theTileId < tileId);
-      }
-   bool operator >(const ossimFixedTileCacheInfo& rhs)const
-      {
-         return (theTileId > rhs.theTileId);
-      }
-   bool operator >(ossim_int32 tileId)const
-      {
-         return (theTileId > tileId);
-      }
-   bool operator ==(const ossimFixedTileCacheInfo& rhs)const
-      {
-         return (theTileId == rhs.theTileId);
-      }
-   bool operator ==(ossim_int32 tileId)const
-      {
-         return (theTileId == tileId);
-      }
-   
-   ossimRefPtr<ossimImageData> theTile;
-   ossim_int32 theTileId;
-};
-
-class ossimFixedTileCache : public ossimReferenced
-{
-public:
-   ossimFixedTileCache();
-   virtual void setRect(const ossimIrect& rect);
-   virtual void setRect(const ossimIrect& rect,
-                        const ossimIpt& tileSize);
-   void keepTilesWithinRect(const ossimIrect& rect);
-   virtual ossimRefPtr<ossimImageData> addTile(ossimRefPtr<ossimImageData> imageData,
-                                               bool duplicateData=true);
-   virtual ossimRefPtr<ossimImageData> getTile(ossim_int32 id);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIpt& origin)
-      {
-         return getTile(computeId(origin));
-      }
-   virtual void setUseLruFlag(bool flag)
-      {
-         theUseLruFlag = flag;
-      }
-   virtual bool getUseLruFlag()const
-      {
-         return theUseLruFlag;
-      }
-   virtual void flush();
-   virtual void deleteTile(const ossimIpt& origin)
-      {
-         deleteTile(computeId(origin));
-      }
-   virtual void deleteTile(ossim_int32 tileId);
-   virtual ossimRefPtr<ossimImageData> removeTile(const ossimIpt& origin)
-      {
-         return removeTile(computeId(origin));
-      }
-   virtual ossimRefPtr<ossimImageData> removeTile(ossim_int32 tileId);
-   virtual const ossimIrect& getTileBoundaryRect()const
-      {
-         return theTileBoundaryRect;
-      }
-   virtual ossim_uint32 getNumberOfTiles()const
-      {
-         return (ossim_uint32)theTileMap.size();
-      }
-   virtual const ossimIpt& getTileSize()const
-      {
-         return theTileSize;
-      }
-   virtual ossim_uint32 getCacheSize()const
-      {
-         return theCacheSize;
-      }
-   virtual void deleteTile();
-   virtual ossimRefPtr<ossimImageData> removeTile();
-   
-   virtual void setMaxCacheSize(ossim_uint32 cacheSize)
-      {
-         theMaxCacheSize = cacheSize;
-      }
-
-   ossim_uint32 getMaxCacheSize()const
-      {
-         return theMaxCacheSize;
-      }
-   
-   virtual ossimIpt getTileOrigin(ossim_int32 tileId);
-   virtual ossim_int32 computeId(const ossimIpt& tileOrigin)const;
-   virtual void setTileSize(const ossimIpt& tileSize);
-protected:
-   virtual ~ossimFixedTileCache();
-   OpenThreads::Mutex theMutex;
-   ossimIrect   theTileBoundaryRect;
-   ossimIpt     theTileSize;
-   ossimIpt     theBoundaryWidthHeight;
-   ossim_uint32 theTilesHorizontal;
-   ossim_uint32 theTilesVertical;
-   ossim_uint32 theCacheSize;
-   ossim_uint32 theMaxCacheSize;
-   std::map<ossim_int32, ossimFixedTileCacheInfo> theTileMap;
-   std::list<ossim_int32> theLruQueue;
-   bool                   theUseLruFlag;
-   virtual void eraseFromLru(ossim_int32 id);
-   void adjustLru(ossim_int32 id);
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimFusionCombiner.h b/ossim/include/ossim/imaging/ossimFusionCombiner.h
deleted file mode 100644
index 8534d3e..0000000
--- a/ossim/include/ossim/imaging/ossimFusionCombiner.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Implementation for Base fusion.
-//              This base class assumes two inputs where the second input is
-//              the intensity source.
-//
-//*************************************************************************
-// $Id: ossimFusionCombiner.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimFusionCombiner_HEADER
-#define ossimFusionCombiner_HEADER
-
-#include <ossim/imaging/ossimImageCombiner.h>
-
-class OSSIMDLLEXPORT ossimFusionCombiner : public ossimImageCombiner
-{
-public:
-  ossimFusionCombiner();
-  ossimFusionCombiner(ossimObject* owner);
-  virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
-  bool canConnectMyInputTo(ossim_int32 inputIndex,
-			   const ossimConnectableObject* object)const;
-   ossimScalarType getOutputScalarType() const;
-   
-  virtual void initialize();
-protected:
-   virtual ~ossimFusionCombiner();   
-  ossimRefPtr<ossimImageData> theTile;
-  ossimRefPtr<ossimImageData> theNormTile;
-  ossimRefPtr<ossimImageData> theNormIntensity;
-  ossimImageSource*  theInputConnection;
-  ossimImageSource*  theIntensityConnection;
-  
-  ossimRefPtr<ossimImageData> getNormIntensity(const ossimIrect& rect,
-                                               ossim_uint32 resLevel);
-  ossimRefPtr<ossimImageData> getNormTile(const ossimIrect& rect,
-                                          ossim_uint32 resLevel);
-TYPE_DATA  
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimGammaRemapper.h b/ossim/include/ossim/imaging/ossimGammaRemapper.h
deleted file mode 100644
index 72e31b0..0000000
--- a/ossim/include/ossim/imaging/ossimGammaRemapper.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kathy Minear
-//
-// Description:
-//
-// Gamma remapper.
-//
-//*************************************************************************
-// $Id: ossimGammaRemapper.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimGammaRemapper_HEADER
-#define ossimGammaRemapper_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimGammaRemapper : public ossimImageSourceFilter
-{
-public:
-
-   ossimGammaRemapper(ossimObject* owner=NULL);
-   ossimGammaRemapper(ossimImageSource* inputSource);
-   ossimGammaRemapper(ossimObject* owner, ossimImageSource* inputSource);
-
-
-   virtual ossimString getShortName()const;
-
-   virtual void initialize();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                   ossim_uint32 resLevel=0);
-   
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   virtual ostream& print(ostream& os) const;
-   friend ostream& operator<< (ostream& os,  const ossimGammaRemapper& hr);
-
-   void setMinMaxPixelValues(const vector<double>& v_min,
-                             const vector<double>& v_max);
-
-   virtual void enableSource();
-   
-protected:
-   virtual ~ossimGammaRemapper();
-
-   /*!
-    * Method to set unset the enable flag.
-    */
-
-   void verifyEnabled();
-
-   ossimRefPtr<ossimImageData> theTile;
-   double*         theBuffer;
-   vector<double>  theMinPixelValue;
-   vector<double>  theMaxPixelValue;
-   vector<double>  theGamma;
-   bool            theUserDisabledFlag;
-
-   TYPE_DATA
-};
-
-#endif /* #ifndef ossimGammaRemapper_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimGeneralRasterInfo.h b/ossim/include/ossim/imaging/ossimGeneralRasterInfo.h
deleted file mode 100644
index 16f44b0..0000000
--- a/ossim/include/ossim/imaging/ossimGeneralRasterInfo.h
+++ /dev/null
@@ -1,432 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for ossimGeneralRasterInfo
-//*******************************************************************
-//  $Id: ossimGeneralRasterInfo.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimGeneralRasterInfo_HEADER
-#define ossimGeneralRasterInfo_HEADER 1
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/imaging/ossimImageMetaData.h>
-#include <vector>
-
-//---
-// Forward class declarations.
-//---
-class ossimEnviHeader;
-class ossimKeywordlist;
-
-/**
- * @class ossimGeneralRasterInfo
- *
- */
-class OSSIMDLLEXPORT ossimGeneralRasterInfo : public ossimObject
-{
-public:
-
-   enum ossimFillMode
-   {
-      NONE,
-      ZEROES_TO_MIN,
-      ZEROES_TO_NULL_EDGES_ONLY
-   };
-
-   enum
-   {
-      UNKNOWN = -1
-   };
-
-   /* @brief default constructor */
-   ossimGeneralRasterInfo();
-   
-   ossimGeneralRasterInfo(const std::vector<ossimFilename>& imageFileList,
-                          ossimScalarType      pixelType,
-                          ossimInterleaveType  il_type,
-                          ossim_int32          numberOfBands,
-                          ossim_int32          lines,
-                          ossim_int32          samples,
-                          ossim_int32          headerSize,
-                          ossimFillMode        nullsMode,
-                          ossim_int32          pixelsToChop);
-   
-   ossimGeneralRasterInfo(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /* @brief copy constructor */
-   ossimGeneralRasterInfo( const ossimGeneralRasterInfo& obj );
-
-   /** @brief Assignment operator=. */
-   const ossimGeneralRasterInfo& operator=( const ossimGeneralRasterInfo& rhs );
-   
-   virtual ~ossimGeneralRasterInfo ();
-
-   /**
-    *  Zero based rectangle of the valid image.
-    */
-   const ossimIrect& imageRect() const;
-
-   /**
-    *  Returns the rectangle of where the image is within the raster file.
-    *  In most cases this will be the same as the rawImageRect. (zero based)
-    */
-   const ossimIrect& validImageRect() const;
-
-   /**
-    *  Zero based rectangle of the raw image.
-    */
-   const ossimIrect& rawImageRect() const;
-
-   /**
-    * Returns the offset of this image's origin to a full-image's origin, in
-    * the case where this image is a sub-image of a larger full-image.
-    */
-   const ossimIpt& subImageOffset() const;
-
-   /**
-    *  Returns the size of header in bytes.
-    */
-   ossim_int32 headerSize() const;
-
-   /**
-    *  Returns the fill mode.  This is used to flip values on ingest.
-    *  Valid Mode Enumerations:
-    *  - 0  Do nothing to the pixels on ingest.
-    *  - 1  Flip all zeroes to the minimum pixel value.
-    *  - 2  Flip zeroes within the image line to minimum pixel value.
-    *       This is used by edge walking code.
-    */
-   ossim_uint32 fillToNullsMode() const;
-
-   /**
-    *  Sets theSetNullsMode.
-    */
-   void setFillToNullsMode(ossim_uint32 mode);
-
-   /**
-    * @brief Number of bands. Inlined below.
-    * @return Number of bands from theMetaData class member cast to an int32.
-    */
-   inline ossim_int32 numberOfBands() const;
-   
-   /**
-    * @brief Bytes per pixel.  Inlined below.
-    * @return Bytes per pixel from theMetaData class member cast to an int32.
-    */   
-   inline ossim_int32 bytesPerPixel() const;
-   
-   /**
-    *  Returns the number of pixels from the edge of a line
-    *  to set to the fill value.  This can be used to eliminate
-    *  resampling error on the edge of an image and still keep
-    *  the image demensions relative to the geometry file.
-    */
-   ossim_int32 pixelsToChop() const;
-   
-   /**
-    *  Enumerated in InterleaveTypeLUT. Should be either bip,
-    *  bil or bsq.  Defaulted to bip.
-    */
-   ossimInterleaveType interleaveType() const;
-
-   /**
-    *  Returns the number of lines within "theValidImageRect".
-    */
-   inline ossim_int32 validLines() const;
-
-   /**
-    *  Returns the number of lines within "theRawImageRect".
-    */
-   inline ossim_int32 rawLines() const;
-
-   /**
-    *  Returns the number of bytes in a raw line.
-    */
-   inline ossim_int32 bytesPerRawLine() const;
-
-   /**
-    *  Returns the number of bytes in a valid line.
-    */
-   inline ossim_int32 bytesPerValidLine() const;
-
-   /**
-    *  Returns the number of samples within "theValidImageRect".
-    */
-   inline ossim_int32 validSamples() const;
-
-   /**
-    *  Returns the number of samples within "theRawImageRect".
-    */
-   inline ossim_int32 rawSamples() const;
-
-   /**
-    *  Returns the offset in bytes to the first valid sample in the image.
-    */
-   inline std::streamoff offsetToFirstValidSample() const;
-   
-   const std::vector<ossimFilename>& getImageFileList() const;
-
-   void setImageFileList(const std::vector<ossimFilename>& list);
-
-   /**
-    * @brief Sets the image file list to file.  Performs a clear, prior to
-    * setting.
-    * @param file Image file.
-    */
-   void setImageFile(const ossimFilename& file);
-
-   void setHeaderSize(ossim_int32 headerSize);
-   
-   void setInterleaveType(ossimInterleaveType il_type);
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-   void setImageRect(const ossimIrect& imageRect);
-   
-   void setValidImageRect(const ossimIrect &imageRect);
-
-   void setRawImageRect(const ossimIrect &imageRect);
-
-   void setSubImageOffset(const ossimIpt& d);
-
-   ossimByteOrder getImageDataByteOrder() const;
-
-   void setImageDataByteOrder(ossimByteOrder byteOrder);
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * @brief Takes image file and attempts to derive/find header file to
-    * parse for general raster data, i.e. lines, samples, bands and so on.
-    * @param image file.
-    * @return true on success, false on error.
-    */
-   bool open( const ossimFilename& imageFile );
-
-   /** @return Const reference to theMetaData class member. */
-   inline const ossimImageMetaData& getImageMetaData() const;
-
-   /** @return Reference to theMetaData class member. */
-   inline ossimImageMetaData& getImageMetaData();
-
-   /**
-    * @brief Initialize from envi header file.
-    * @param enviHeader
-    * @return true on success, false on error.
-    */  
-   bool initializeFromEnviHdr( const ossimEnviHeader& enviHdr );
-
-private:
-
-   /**
-    * @brief Initialize from header file.
-    * @param headerFile
-    * @return true on success, false on error.
-    */
-   bool initializeFromHdr( const ossimFilename& imageFile,
-                           const ossimFilename& headerFile );
-
-   /**
-    * @brief Initialize from envi header file.
-    * @param headerFile
-    * @return true on success, false on error.
-    */  
-   bool initializeFromEnviHdr( const ossimFilename& headerFile );
-
-   /**
-    * @brief Initialize from omd file.
-    * @param file
-    * @return true on success, false on error.
-    */  
-   bool initializeFromXml( const ossimFilename& imageFile,
-                           const ossimFilename& headerFile );
-
-   /**
-    * @brief Private method to get bits per pixel from file size,
-    * lines, samples and bands.  Method created to avoid duplicate code
-    * in "initizeFrom" methods.
-    *
-    * This assumes that "theRawImageRect" and "theNumberOfBands" has been
-    * set.
-    *
-    * @param imageFile This image file.
-    * @param Calculated bits per pixel.
-    * @return bits per pixel or 0 on error.
-    */
-   ossim_int32 getBitsPerPixel( const ossimFilename& imageFile ) const;
-
-   /** @brief Clears data members. */
-   void clear();
-   
-   ossimImageMetaData          theMetaData;
-   std::vector<ossimFilename>  theImageFileList;
-   ossimInterleaveType         theInterleaveType;
-
-   /**
-    *  The zero based rectangle of the entire image not including any header.
-    */
-   ossimIrect theRawImageRect;
-
-   /**
-    *  The rectangle representing where the valid part of the image lies
-    *  within "theRawImageRect".
-    */
-   ossimIrect theValidImageRect;
-
-   /**
-    *  The valid image rectangle normalized to be zero based.
-    */
-   ossimIrect theImageRect;
-
-   /**
-    *  The offset from the full-image origin to this image's origin
-    */
-   ossimIpt theSubImageOffset;
-
-   /**
-    *  Size of header in bytes.
-    */
-   ossim_int32 theHeaderSize;
-
-   /**
-    *  Mode of how to handle pixels on import.
-    *   0 = Do nothing the pixels.
-    *   1 = Set any zeroes to min value of radiometry.
-    *   2 = Set zeroes on line edges only to nulls; any other zeroes are
-    *       set to min value of radiometry.
-    */
-   ossimFillMode theSetNullsMode;
-
-   /**
-    *  Amount of pixels to chop for each line edge.
-    */
-   ossim_int32 thePixelsToChop;
-
-   /**
-    *  The byte order the image data is stored in.
-    */
-  ossimByteOrder theImageDataByteOrder;
-};
-
-
-//---
-// Inlines:
-// 
-// These methods are used throughout raster read/write code; hence, inlines.
-// Note that most of these are used in calculating std::streamoff which is
-// a signed 64 bit integer on most machines; hence, the cast to an int from
-// an unsigned int for convenience.
-//---
-inline const ossimImageMetaData& ossimGeneralRasterInfo::getImageMetaData() const
-{
-   return theMetaData;
-}
-
-inline ossimImageMetaData& ossimGeneralRasterInfo::getImageMetaData()
-{
-   return theMetaData;
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::numberOfBands() const
-{
-   return static_cast<ossim_int32>( theMetaData.getNumberOfBands() );
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::bytesPerPixel() const
-{
-   return static_cast<ossim_int32>( theMetaData.getBytesPerPixel() );
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::validLines() const
-{
-   return static_cast<ossim_int32>(theValidImageRect.height());
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::rawLines() const
-{
-   return static_cast<ossim_int32>(theRawImageRect.height());
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::bytesPerRawLine() const
-{
-   if (interleaveType() == OSSIM_BIP)
-   {
-      return rawSamples() * bytesPerPixel() * numberOfBands();
-   }
-   else
-   {
-      return rawSamples() * bytesPerPixel();
-   }
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::bytesPerValidLine() const
-{
-   if (interleaveType() == OSSIM_BIP)
-   {
-      return validSamples() * bytesPerPixel() * numberOfBands();
-   }
-   else
-   {
-      return validSamples() * bytesPerPixel();
-   }
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::validSamples() const
-{
-   return static_cast<ossim_int32>(theValidImageRect.width());
-}
-
-inline ossim_int32 ossimGeneralRasterInfo::rawSamples() const
-{
-   return static_cast<ossim_int32>(theRawImageRect.width());
-}
-
-inline std::streamoff ossimGeneralRasterInfo::offsetToFirstValidSample() const
-{
-   if (interleaveType() == OSSIM_BIP)
-   {
-      return headerSize() +
-         ( bytesPerRawLine() * validImageRect().ul().y ) +
-         ( validImageRect().ul().x * numberOfBands() * bytesPerPixel() );
-   }
-   else if (interleaveType() == OSSIM_BIL)
-   {
-      return headerSize() +
-         ( bytesPerRawLine() * validImageRect().ul().y * numberOfBands() ) +
-         ( validImageRect().ul().x * bytesPerPixel() );
-   }
-   else // BSQ
-   {
-      return headerSize() +
-         ( bytesPerRawLine() * validImageRect().ul().y ) +
-         ( validImageRect().ul().x * bytesPerPixel() );
-   }
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimGeneralRasterTileSource.h b/ossim/include/ossim/imaging/ossimGeneralRasterTileSource.h
deleted file mode 100644
index 3bd9f8d..0000000
--- a/ossim/include/ossim/imaging/ossimGeneralRasterTileSource.h
+++ /dev/null
@@ -1,213 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for ossimGeneralRasterTileSource.
-// ossimGeneralRasterTileSource is derived from ImageHandler which is
-// derived from ossimTileSource.
-//*******************************************************************
-//  $Id: ossimGeneralRasterTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimGeneralRasterTileSource_HEADER
-#define ossimGeneralRasterTileSource_HEADER 1
-
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/imaging/ossimGeneralRasterInfo.h>
-#include <vector>
-  
-
-class  ossimImageData;
-
-class OSSIM_DLL ossimGeneralRasterTileSource : public ossimImageHandler
-{
-public:
-
-   ossimGeneralRasterTileSource();
-
-   virtual ossimString getShortName()const;
-   virtual ossimString getLongName()const;
-   
-   /**
-    *  Returns a pointer to a tile given an origin representing the upper
-    *  left corner of the tile to grab from the image.
-    *  Satisfies pure virtual from TileSource class.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    *
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);   
-   
-   /**
-    *  Returns the number of bands in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   
-   /**
-    * Returns the number of bands in a tile returned from this TileSource.
-    * Note: we are supporting sources that can have multiple data objects.
-    * If you want to know the scalar type of an object you can pass in the 
-    */
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-   
-   /**
-    *  Returns the number of lines in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    *  Returns the number of samples in the image.  
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32    getTileWidth() const;
-   
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32    getTileHeight() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    * Note:  This handler will always return 0 for this method.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    * Note:  This handler will always return 0 for this method.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;   
-   
-   bool isValidRLevel(ossim_uint32 reduced_res_level) const;
-   
-   virtual void close();
-   virtual bool isOpen() const;
-   virtual bool open();
-   virtual bool open(const ossimGeneralRasterInfo& info);
-   
-   /**
-    * Override base getXXXXPixValue methods since the null/min/max can be set
-    * to something different.  Currently returns the same value for all bands.
-    */
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   /**
-    * @brief Indicates whether or not the image handler can control output
-    * band selection via the setOutputBandList method.
-    *
-    * Overrides: ossimImageHandler::isBandSelector
-    *
-    * @return true
-    */
-   virtual bool isBandSelector() const;
-
-   /**
-    * @brief If the image handler "isBandSeletor()" then the band selection
-    * of the output chip can be controlled.
-    *
-    * Overrides: ossimImageHandler::setOutputBandList
-    * 
-    * @return true on success, false on error.
-    */
-   virtual bool setOutputBandList(const std::vector<ossim_uint32>& band_list);
-
-   /** @brief Initializes bandList to the zero based order of output bands. */
-   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
-
-protected:
-   virtual ~ossimGeneralRasterTileSource();
-   /**
-    *  Methods return true on succes false on error.
-    */
-   virtual bool fillBuffer(const ossimIpt& origin, const ossimIpt& size);
-   virtual bool fillBIP(const ossimIpt& origin, const ossimIpt& size);
-   virtual bool fillBIL(const ossimIpt& origin, const ossimIpt& size);
-   virtual bool fillBSQ(const ossimIpt& origin, const ossimIpt& size);
-   virtual bool fillBsqMultiFile(const ossimIpt& origin, const ossimIpt& size);
-
-   virtual ossimKeywordlist getHdrInfo(ossimFilename hdrFile);
-   virtual ossimKeywordlist getXmlInfo(ossimFilename xmlFile);
-
-   bool initializeHandler();
-   
-   ossimRefPtr<ossimImageData>              m_tile;
-   ossim_uint8*                             m_buffer;
-   ossim_uint8*                             m_lineBuffer;
-   ossimInterleaveType                      m_bufferInterleave;
-   std::vector<ossimRefPtr<ossimIFStream> > m_fileStrList;
-   // std::vector< std::ifstream* >            m_fileStrList;   
-   ossimGeneralRasterInfo                   m_rasterInfo;
-   ossimIrect                               m_bufferRect;
-   bool                                     m_swapBytesFlag;
-   ossim_uint32                             m_bufferSizeInPixels;
-   std::vector<ossim_uint32>                m_outputBandList;
-
-private:
-   
-   /** @brief Allocates m_tile. */
-   void allocateTile();
-
-   /** @brief Allocates m_buffer */
-   void allocateBuffer( const ossimImageData* tile );
-   
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimGeneralRasterTileSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimGeoAnnotationBitmap.h b/ossim/include/ossim/imaging/ossimGeoAnnotationBitmap.h
deleted file mode 100644
index 738faf9..0000000
--- a/ossim/include/ossim/imaging/ossimGeoAnnotationBitmap.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimGeoAnnotationBitmap.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimGeoAnnotationBitmap_HEADER
-#define ossimGeoAnnotationBitmap_HEADER
-#include <ossim/imaging/ossimGeoAnnotationObject.h>
-
-class OSSIMDLLEXPORT ossimGeoAnnotationBitmap: public ossimGeoAnnotationObject
-{
-public:
-
-   ossimGeoAnnotationBitmap(const ossimGpt& center= ossimGpt(0,0,0),
-                            ossimRefPtr<ossimImageData> imageData=0,
-                            unsigned char r = 255,
-                            unsigned char g = 255,
-                            unsigned char b = 255);
-   
-   ossimGeoAnnotationBitmap(const ossimGeoAnnotationBitmap& rhs);
-   
-   virtual ossimObject* dup()const;
-
-   virtual bool intersects(const ossimDrect& rect) const;
-
-   virtual ossimGeoAnnotationBitmap* getNewClippedObject(const ossimDrect& rect)const;
-
-   virtual void applyScale(double x, double y);
-
-   virtual std::ostream& print(std::ostream& out)const;
-   virtual void draw(ossimRgbImage& anImage)const;
-   virtual void getBoundingRect(ossimDrect& rect)const;
-   virtual void transform(ossimImageGeometry* projection);
-
-   virtual void setImageData(ossimRefPtr<ossimImageData>& imageData);
-   virtual void computeBoundingRect();
-
-protected:
-   virtual ~ossimGeoAnnotationBitmap();
-   
-   ossimGpt                    theCenterPoint;
-   ossimDpt                    theProjectedPoint;
-   ossimRefPtr<ossimImageData> theImageData;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimGeomFileWriter.h b/ossim/include/ossim/imaging/ossimGeomFileWriter.h
deleted file mode 100644
index 9021e4e..0000000
--- a/ossim/include/ossim/imaging/ossimGeomFileWriter.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2003 Storage Area Networks, Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kenneth Melero (kmelero at sanz.com)
-//
-//*******************************************************************
-//  $Id: ossimGeomFileWriter.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimGeomFileWriter_H
-#define ossimGeomFileWriter_H
-
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-
-/** ossimGeomFileWriter */
-class OSSIMDLLEXPORT ossimGeomFileWriter : public ossimMetadataFileWriter
-{
-public:
-   /** default constructor */
-   ossimGeomFileWriter();
-
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * Appends the writers image types to the "metadatatypeList".
-    * 
-    * @param metadatatypeList stl::vector<ossimString> list to append to.
-    *
-    * @note Appends to the list, does not clear it first.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList) const;
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * @param imageType string representing image type.
-    *
-    * @return true if "metadataType" is supported by writer.
-    */
-   virtual bool hasMetadataType(const ossimString& metadataType)const;
-
-protected:
-   /** virtual destructor */
-   virtual ~ossimGeomFileWriter();
-
-   /** Write a geometry file to "theFilename". */
-   virtual bool writeFile();
-   
-TYPE_DATA
-};
-
-#endif /* End of #ifndef ossimGeomFileWriter_H */
-
diff --git a/ossim/include/ossim/imaging/ossimGpkgWriterInterface.h b/ossim/include/ossim/imaging/ossimGpkgWriterInterface.h
deleted file mode 100644
index 2a4e190..0000000
--- a/ossim/include/ossim/imaging/ossimGpkgWriterInterface.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Interface for GeoPackage(gpkg) writers.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimGpkgWriterInterface_HEADER
-#define ossimGpkgWriterInterface_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimImageData;
-class ossimKeywordlist;
-
-/**
- * @class GeoPackage writer interface.
- *
- * This interface is for using the ossimGeopackageWriter in a connectionless
- * manner.  See ossim-gpkg-writer-test.cpp for example usage.
- */
-class OSSIM_DLL ossimGpkgWriterInterface
-{
-public:
-
-   /**
-    * @brief Opens file for writing, appending, merging without an input
-    * connection. I.e. opening, then calling writeTile directly.
-    * 
-    * @param options.  Keyword list containing all options.
-    */
-   virtual bool openFile( const ossimKeywordlist& options ) = 0;
-
-   /**
-    * @brief Calls initial sqlite3_prepare_v2 statement.  Must be called
-    * prior to calling writeTile.
-    * @return SQLITE_OK(0) on success, something other(non-zero) on failure.
-    */
-   virtual ossim_int32 beginTileProcessing() = 0;
-   
-   /**
-    * @brief Direct interface to writing a tile to database.
-    * @param tile to write.
-    * @param zoolLevel
-    * @param row
-    * @param col
-    * @return true on success, false on error.
-    */   
-   virtual bool writeTile( ossimRefPtr<ossimImageData>& tile,
-                           ossim_int32 zoomLevel,
-                           ossim_int64 row,
-                           ossim_int64 col ) = 0;
-   virtual bool writeCodecTile( ossim_uint8* codecTile,
-                                ossim_int32 codecTileSize,
-                                ossim_int32 zoomLevel,
-                                ossim_int64 row,
-                                ossim_int64 col ) = 0;
-
-   /**
-    * @brief Calls sqlite3_finalize(pStmt) terminating tile processing.
-    */
-   virtual void finalizeTileProcessing() = 0;
-   
-};
-
-#endif /* End of "#ifndef ossimGpkgWriterInterface_HEADER" */
-
diff --git a/ossim/include/ossim/imaging/ossimGridRemapEngine.h b/ossim/include/ossim/imaging/ossimGridRemapEngine.h
deleted file mode 100644
index 56e9a36..0000000
--- a/ossim/include/ossim/imaging/ossimGridRemapEngine.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//*****************************************************************************
-// FILE: ossimGridRemapEngine.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class 
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimGridRemapEngine.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimGridRemapEngine_HEADER
-#define ossimGridRemapEngine_HEADER
-
-#include <vector>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimDpt;
-class ossimGridRemapSource;
-class ossimImageData;
-class ossimAtbPointSource;
-
-/*!****************************************************************************
- *
- * CLASS: ossimGridRemapEngine 
- *
- *****************************************************************************/
-class ossimGridRemapEngine : public ossimObject
-{
-public:
-   virtual ossimObject* dup() const = 0;
-   
-   virtual void remapTile(const ossimDpt&       origin_point,
-                          ossimGridRemapSource* remapper,
-                          ossimRefPtr<ossimImageData>& tile) = 0;
-
-   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources)=0;
-
-   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
-                                   void* result) = 0;
-
-   int  getNumberOfParams() const { return theNumberOfParams; }
-   
-   int  getNumberOfBands()  const { return theNumberOfBands; }
-   
-protected:
-   ossimGridRemapEngine(int numParams, int numBands)
-      : theNumberOfParams(numParams), theNumberOfBands(numBands) {}
-
-   ossimGridRemapEngine() {}
-   virtual ~ossimGridRemapEngine() {}
-
-   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
-                                 void*                 source_value,
-                                 void*                 target_value) = 0;
-   int  theNumberOfParams;
-   int  theNumberOfBands;
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimGridRemapSource.h b/ossim/include/ossim/imaging/ossimGridRemapSource.h
deleted file mode 100644
index 3baa131..0000000
--- a/ossim/include/ossim/imaging/ossimGridRemapSource.h
+++ /dev/null
@@ -1,145 +0,0 @@
-//*****************************************************************************
-// FILE: ossimGridRemapSource.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimGridRemapSource. This is
-//   a spacially variant remapper that utilizes a grid for interpolating the
-//   remap value given an image x, y. 
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimGridRemapSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimGridRemapSource_HEADER
-#define ossimGridRemapSource_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <vector>
-#include <ossim/imaging/ossimGridRemapEngine.h>
-#include <ossim/base/ossimFilename.h>
-
-class ossimDblGrid;
-class ossimDrect;
-class ossimDpt;
-class ossimImageData;
-
-/*!****************************************************************************
- *
- * CLASS:  ossimGridRemapSource
- *
- *****************************************************************************/
-class ossimGridRemapSource : public ossimImageSourceFilter
-{
-public:
-   /*!
-    * Constructors: 
-    */
-   ossimGridRemapSource();
-   ossimGridRemapSource(ossimImageSource* inputSource,
-                        ossimGridRemapEngine* engine);
-
-   /*!ossimAtbPointSource
-    * Initializes the remap engine. This object implements specific algorithms
-    * for interpreting the grids owned by this remapper. It actually performs
-    * the remapping.
-    */
-   void setRemapEngine(ossimGridRemapEngine* engine);
-   
-   /*!
-    * Provides access to the remap engine:
-    */
-   ossimGridRemapEngine* getRemapEngine() { return theRemapEngine; }
-   
-   /*!
-    * Permits initializing the remap grid after construction. 
-    */
-   virtual void initialize(const ossimDrect& uv_rect,
-			   const ossimDpt&   grid_spacing);
-
-  /*!
-   * Sets a node of the member grid to the value specified. The grid is flagged
-   * as unfilled.
-   */
-  void setGridNode(const ossimDpt& view_pt,
-		   const double*    value);
-  
-   /*!
-    * Implementation of virtual method to return remapped tile.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& origin,
-                                   ossim_uint32 resLevel=0);
-
-   /*!
-    * Restore the state of the object from a keywordlist.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /*!
-    * Save the state of the object to a keywordlist.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /*!
-    * Locks the image to prevent grid adjustment. The remapper continues to
-    * remap given the current grid (if enabled), but all target values computed
-    * are such that no change in the grids will occur in an adjsutment. If more
-    * than one overlapping image is locked, the target will may be influenced
-    * by all locked images, but the remap grids will not be updated.
-    */
-   void lock() { theRemapIsLockedFlag = true; }
-
-   /*!
-    * Unlocks the grids for adjustment.
-    */
-   void unlock() { theRemapIsLockedFlag = false; }
-   
-   /*!
-    * Returns the status of the lock flag.
-    */
-   bool isLocked() const { return theRemapIsLockedFlag; }
-
-   /*!
-    * Provides access to individual grids (pointer) given an index. Null pointer
-    * returned if index out of range.
-    */
-   ossimDblGrid* getGrid(unsigned int index);
-
-   /*!
-    * Returns grid filename (may be empty)
-    */
-   const ossimFilename& getGridFilename() const { return theGridFilename; }
-
-   /*!
-    * Sets the grid filename and initiates read.
-    */
-   void setGridFilename(const ossimFilename& grid_filename);
-   
-protected:
-   virtual ~ossimGridRemapSource();
-
-   /*!
-    * Deallocates grid memory.
-    */
-   void deallocateGrids();
-   
-   vector<ossimDblGrid*> theGrids;
-   ossimFilename         theGridFilename;
-   ossimGridRemapEngine* theRemapEngine;
-   bool                  theRemapIsLockedFlag;
-   bool                  theGridIsFilled;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimHistoMatchRemapper.h b/ossim/include/ossim/imaging/ossimHistoMatchRemapper.h
deleted file mode 100644
index 4c9de25..0000000
--- a/ossim/include/ossim/imaging/ossimHistoMatchRemapper.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimHistoMatchRemapper.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimHistoMatchRemapper_HEADER
-#define ossimHistoMatchRemapper_HEADER 1
-#include <vector>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIM_DLL ossimHistoMatchRemapper: public ossimImageSourceFilter
-{
-public:
-   ossimHistoMatchRemapper();
-   ossimHistoMatchRemapper(ossimImageSource* inputSource,
-                           const vector<double>& targetMeanPerBand  = vector<double>(),
-                           const vector<double>& targetSigmaPerBand = vector<double>(),
-                           const vector<double>& inputMeanPerBand   = vector<double>(),
-                           const vector<double>& inputSigmaPerBand  = vector<double>()
-                           );
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   virtual void initialize();
-   
-   const vector<double>& getInputMeanValues()const;
-   const vector<double>& getInputSigmaValues()const;
-   const vector<double>& getTargetMeanValues()const;
-   const vector<double>& getTargetSigmaValues()const;
-
-   void setInputMeanValues(const vector<double>& newValues);
-   void setInputSigmaValues(const vector<double>& newValues);
-   void setTargetMeanValues(const vector<double>& newValues);
-   void setTargetSigmaValues(const vector<double>& newValues);
-   
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-
-protected:
-   virtual ~ossimHistoMatchRemapper();
-   
-   ossimRefPtr<ossimImageData> theBlankTile;
-   
-   vector<double> theTargetMeanPerBand;
-   vector<double> theTargetSigmaPerBand;
-   vector<double> theInputMeanPerBand;
-   vector<double> theInputSigmaPerBand;
-
-   /**
-    * transLean
-    * @param vIn input value to be transformed
-    * @param vBias bias value to be removed
-    * @param vTarget value that will replace bias
-    * @param vMin minimum valid value of vIn (inclusive)
-    * @param vMax maximum valid value of vIn (inclusive)
-    * @return vOut
-    */
-   double transLean(double vIn,
-                    double vBias,
-                    double vTarget,
-                    double vMin,
-                    double vMax);
-
-   /**
-    * transLeanStretch
-    * @param vin Input value to be transformed.
-    * @param vBias Bias value to be removed.
-    * @param vBiasStretch dispersion (+/-) about vBias
-    * @param vTarget value that will replace bias
-    * @param vTargetStretch dispersion (+/-) about vTarget
-    * @param vMin minimum valid value of vIn (inclusive)
-    * @param vMax maximum valid value of vIn (inclusive)
-    * @return vOut
-    */
-   double transLeanStretch(double vIn,
-                           double vBias,
-                           double vBiasStretch,
-                           double vTarget,
-                           double vTargetStretch,
-                           double vMin,
-                           double vMax);
-   
-};
-
-#endif /* #ifndef ossimHistoMatchRemapper_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimHistogramEqualization.h b/ossim/include/ossim/imaging/ossimHistogramEqualization.h
deleted file mode 100644
index f933a36..0000000
--- a/ossim/include/ossim/imaging/ossimHistogramEqualization.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHistogramEqualization.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimHistogramEqualization_HEADER
-#define ossimHistogramEqualization_HEADER
-#include <ossim/imaging/ossimImageSourceHistogramFilter.h>
-
-class OSSIMDLLEXPORT ossimHistogramEqualization : public ossimImageSourceHistogramFilter
-{
-public:
-   ossimHistogramEqualization();
-   ossimHistogramEqualization(ossimImageSource* inputSource,
-                              ossimRefPtr<ossimMultiResLevelHistogram> histogram);
-   ossimHistogramEqualization(ossimImageSource* inputSource,
-                              ossimRefPtr<ossimMultiResLevelHistogram> histogram,
-                              bool inverseFlag);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual void setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram);
-   virtual bool setHistogram(const ossimFilename& filename);
-
-   virtual bool getInverseFlag()const;
-   virtual void initialize();
-   virtual void setInverseFlag(bool inverseFlag);
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-   virtual ~ossimHistogramEqualization();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-  ossimRefPtr<ossimImageData> theTile;
-   /*!
-    * This will be used in some of the histogram
-    * based operations.
-    */
-   ossimRefPtr<ossimMultiResLevelHistogram> theAccumulationHistogram;
-
-   /*!
-    * Indicates if you should equalize or unequalize an input stream.
-    * If the inverse flag is true then it will indicate that we should
-    * assume that the input stream is already equalized and we should
-    * invert based on the current accumulation histogram.
-    *
-    *
-    * This flag is defaulted to false.
-    */
-   bool                         theInverseFlag;
-   /*!
-    * We will create a LUT for each band that directly maps
-    * an input value to an equalized output.
-    */
-   vector<double*> theForwardLut;
-   
-   /*!
-    * We will create a LUT for each band that directly maps
-    * an input value to an un-equalized output.
-    */
-   vector<double*> theInverseLut;
-
-   
-  std::vector<ossim_uint32> theBandList;
-   virtual void computeAccumulationHistogram();
-
-  template<class T>
-  ossimRefPtr<ossimImageData> runEqualizationAlgorithm(T dummyVariable,
-                                                       ossimRefPtr<ossimImageData> tile);
-
-   /*!
-    * We will pre-compute the luts for the forward and inverse
-    * equalization.  Note: the inverse is a little more tricky
-    * and since we must fill the empty spots missed by the
-    * inverse.  We use a linear interpolation between valid
-    * values for this.
-    */
-   virtual void initializeLuts();
-   virtual void deleteLuts();
-
-TYPE_DATA
-};
-#endif /* #ifndef ossimHistogramEqualization_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimHistogramRemapper.h b/ossim/include/ossim/imaging/ossimHistogramRemapper.h
deleted file mode 100644
index de7d601..0000000
--- a/ossim/include/ossim/imaging/ossimHistogramRemapper.h
+++ /dev/null
@@ -1,574 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Histogram remapper class declaration.  Derived from ossimTableRemapper.
-//
-// Remaps a tile based on mode and histogram clip points.  This object uses
-// a precomputed remap table for speed; hence, derived from the
-// ossimTableRemapper
-//
-// NOTE on bands:
-// 
-// - All methods take zero based bands.  In other words the first
-//   band is band "0".  
-//
-// - This objects band 0 is the same band 0 as it's input connection.  If
-//   the band order was changed by a ossimBandSelector then this band 0 will
-//   not map to the histogram files band 0.  To handle this,
-//   the "getOutputBandList()" method is used to get the correct histogram for
-//   the input band.
-//   
-// - The "get" methods that do not take a band, simply return the average of
-//   all bands.  This really only makes sense if all bands are the same
-//   but is provided for convenience.
-//   
-//*************************************************************************
-// $Id: ossimHistogramRemapper.h 22746 2014-04-23 16:16:28Z gpotts $
-#ifndef ossimHistogramRemapper_HEADER
-#define ossimHistogramRemapper_HEADER
-
-#include <ossim/imaging/ossimTableRemapper.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-
-
-class OSSIMDLLEXPORT ossimHistogramRemapper : public ossimTableRemapper
-{
-public:
-   enum StretchMode
-   {
-      LINEAR_ONE_PIECE      = 0,
-      LINEAR_1STD_FROM_MEAN = 1,
-      LINEAR_2STD_FROM_MEAN = 2,
-      LINEAR_3STD_FROM_MEAN = 3,
-      LINEAR_AUTO_MIN_MAX   = 4,
-      STRETCH_UNKNOWN = 5 // Alway last as used for number of modes method.
-   };
-
-   /** default constructor */
-   ossimHistogramRemapper();
-
-
-   virtual ossimString getLongName()  const;
-   virtual ossimString getShortName() const;
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-   /**
-    * - Disables this source.
-    * - Sets all clip points to default.
-    * - Removes current table.
-    */
-   void reset();
-   
-   /**
-    * Sets remap mode to mode.  If rebuildTableFlag is true, the table will
-    * be built at this time; else just the dirty flag is set.
-    *
-    * @param mode The stretch mode.
-    * 
-    * @param rebuildTableFlag If the true the table will be rebuilt; else,
-    * just the dirty flag will be set.
-    */
-   void setStretchMode(StretchMode mode, bool rebuildTableFlag=false);
-
-   /**
-    * Stretch mode values can be linear_one_piece, linear_1std_from_mean,
-    * linear_2std_from_mean, linear_3std_from_mean, linear_auto_min_max,
-    * If rebuildTableFlag is true, the table will
-    * be built at this time; else just the dirty flag is set.
-    *
-    * @param mode The stretch mode.
-    * 
-    * @param rebuildTableFlag If the true the table will be rebuilt; else,
-    * just the dirty flag will be set.
-    */
-   void setStretchModeAsString(const ossimString& mode,
-                               bool rebuildTableFlag=false);
-   
-   /**
-    * Returns the current enumerated node.
-    */
-   StretchMode   getStretchMode() const;
-
-   /**
-    * Returns the string for current remap mode.
-    */
-   ossimString getStretchModeString() const;
-
-   /**
-    * Returns the number of stretch modes.
-    */
-   ossim_uint32 getNumberOfStretchModes() const;
-
-   /**
-    * Returns the mode string for a given index.
-    * Returns "stretch_unknown" if index is out of range.
-    * 
-    * NOTE:
-    * - If you're building gui buttons you can:
-    *   // pseudo code...
-    *   ossim_uint32 number_of_modes = remapper->getNumberOfModes()
-    *   for (ossim_uint32 i = 0; i < number_of_modes; ++i)
-    *   {
-    *      addButton(getModeString(i).c_str());
-    *   }
-    */
-   ossimString getStretchModeString(ossim_uint32 index) const;
-   
-   /**
-    * Sets the low clip point.
-    *
-    * Note on null bin:
-    * - The null bin is ignored when considering a percent of penetration from
-    *   the low end.
-    *
-    * Notes on clip point:
-    * - If input chip source is mutiband this will set all band to same
-    *   percentage of clip.
-    * - Clip points should be normalized between zero and one.
-    * - A low clip point of 0.0 means no penetration.
-    * - A low clip point of 0.02 means penetrate in two percent.
-    */
-   void setLowNormalizedClipPoint(const ossim_float64& clip);
-
-   /**
-    * Sets the low clip point for band.
-    *
-    * Note on null bin:
-    * - The null bin is ignored when considering a percent of penetration from
-    *   the low end.
-    *
-    * Notes on clip points:
-    * - Clip point should be normalized between zero and one.
-    * - A low clip point of 0.0 means no penetration.
-    * - A low clip point of 0.02 means penetrate in two percent.
-    */
-   void setLowNormalizedClipPoint(const ossim_float64& clip,
-                                  ossim_uint32 zero_based_band);
-
-   /**
-    * Sets the high clip point.
-    * 
-    * Notes on clip points:
-    * - If input chip source is mutiband this will set all band to same
-    *   percentage of clip.
-    * - Clip point should be normalized between zero and one.
-    * - A high clip point of 1.0 means no penetration.
-    * - A high clip point of .98 mean a 2 % penetration from the high end.
-    */
-   void setHighNormalizedClipPoint(const ossim_float64& clip);
-
-   /**
-    * Sets the high clip point.
-    *
-    * Notes on clip points:
-    * - Clip point should be normalized between zero and one.
-    * - A high clip point of 1.0 means no penetration.
-    * - A high clip point of .98 mean a 2 % penetration from the high end.
-    */
-   void setHighNormalizedClipPoint(const ossim_float64& clip,
-                                   ossim_uint32 zero_based_band);
-
-   /**
-    * Sets the low clip point.
-    *
-    * Notes on clip point:
-    * - If input chip source is mutiband this will set all band to same
-    *   percentage of clip.
-    * - Clip points are in DN values.
-    * - If histogram is not set no action is taken. 
-    */
-   void setLowClipPoint(const ossim_float64& clip);
-
-   /**
-    * Sets the low clip point for band.
-    *
-    * Notes on clip points:
-    * - Clip points are DN values.
-    * - If histogram is not set no action is taken. 
-    */
-   void setLowClipPoint(const ossim_float64& clip,
-                        ossim_uint32 zero_based_band);
-
-   /**
-    * Sets the high clip point.
-    * 
-    * Notes on clip points:
-    * - If input chip source is mutiband this will set all band to same
-    *   percentage of clip.
-    * - Clip points are DN values.
-    * - If histogram is not set no action is taken. 
-    */
-   void setHighClipPoint(const ossim_float64& clip);
-
-   /**
-    * Sets the high clip point.
-    *
-    * Notes on clip points:
-    * - Clip points are DN values.
-    * - If histogram is not set no action is taken. 
-    */
-   void setHighClipPoint(const ossim_float64& clip,
-                         ossim_uint32 zero_based_band);
-
-   /**
-    * Sets the mid clip point.
-    * 
-    * Notes on clip points:
-    * - If input chip source is mutiband this will set all band to same
-    *   percentage of clip.
-    */
-   void setMidPoint(const ossim_float64& value);
-
-   /**
-    * Sets the mid clip point for band.
-    */
-   void setMidPoint(const ossim_float64& value,
-                    ossim_uint32 zero_based_band);
-
-   /**
-    * Sets the min output value.
-    * 
-    * Notes on clip points:
-    * - If input chip source is mutiband this will set all band to same
-    *   percentage of clip.
-    */
-   void setMinOutputValue(const ossim_float64& value);
-
-   /**
-    * Sets the min output value for band.
-    */
-   void setMinOutputValue(const ossim_float64& value,
-                          ossim_uint32 zero_based_band);
-
-   /**
-    * Sets the max output value.
-    * 
-    * Notes on clip points:
-    * - If input chip source is mutiband this will set all band to same
-    *   percentage of clip.
-    */
-   void setMaxOutputValue(const ossim_float64& value);
-
-   /**
-    * Sets the min output value for band.
-    */
-   void setMaxOutputValue(const ossim_float64& value,
-                          ossim_uint32 zero_based_band);
-   
-   /**
-    * Returns the normalized low clip point for band.
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getLowNormalizedClipPoint(ossim_uint32 zero_based_band) const;
-
-   /**
-    * Returns the normalized low clip point which is the average of all bands.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getLowNormalizedClipPoint() const;
-
-   /**
-    * Returns the normalized high clip point for band.
-    *
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getHighNormalizedClipPoint(ossim_uint32 zero_based_band) const;
-   /**
-    * Returns the normalized High clip point which is the average of all bands.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getHighNormalizedClipPoint() const;
-
-   /**
-    * Returns the low clip point for band.
-    * Clip points are DN values relative to the scalar type.
-    *
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getLowClipPoint(ossim_uint32 zero_based_band) const;
-
-   /**
-    * Returns the low clip point which is the average of all bands.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getLowClipPoint() const;
-
-   /**
-    * Returns the high clip point for band.
-    * Clip points are DN values relative to the scalar type.
-    *
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getHighClipPoint(ossim_uint32 zero_based_band) const;
-
-   /**
-    * Returns the high clip point which is the average of all bands.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getHighClipPoint() const;
-
-   
-   /**
-    * Returns the mid point for band
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getMidPoint(ossim_uint32 zero_based_band) const;
-   
-   /**
-    * Returns the mid clip point which is the average of all bands.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    * - Histogram has not been set.
-    */
-   ossim_float64 getMidPoint() const;
-   
-   /**
-    * Returns the minimum output value for band.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    */
-   ossim_float64 getMinOutputValue(ossim_uint32 zero_based_band) const;
-
-   /**
-    * Returns the minimum output value which is the average of all bands.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    */
-   ossim_float64 getMinOutputValue() const;
-
-   /**
-    * Returns the maximum output value for band.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    */
-   ossim_float64 getMaxOutputValue(ossim_uint32 zero_based_band) const;
-
-   /**
-    * Returns the maximum output value which is the average of all bands.
-    * 
-    * Will return OSSIM_DBL_NAN if:
-    * - Band is out of range.
-    * - Connection is not complete.
-    */
-   ossim_float64 getMaxOutputValue() const;
-   
-   /**
-    * Sets the histogram.
-    * If (own_histogram == true) this object will delete theHistogram
-    * on destruction.
-    */
-   void setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram);
-   
-   ossimRefPtr<ossimMultiResLevelHistogram> getHistogram();
-   ossimRefPtr<const ossimMultiResLevelHistogram> getHistogram()const;
-   
-   /**
-    * Returns pointer to histogram for band and reduced res level.
-    * - Band is zero based relative to the input connection.  This will be
-    *   remapped to the histogram band using the "getOutputBandList()" to
-    *   get the correct histogram band.
-    *   
-    * Will return NULL if:
-    * - band is out range
-    * - res_level is out of range
-    * - theHistogram has not been initialized yet.
-    */
-   ossimRefPtr<ossimHistogram> getHistogram(ossim_uint32 zero_based_band,
-                                ossim_uint32 res_level=0) const;
-
-   /**
-    * Open the histogram file.
-    * With this method the histogram is owned by this object.
-    * Returns true on success, false on error.
-    */
-   bool openHistogram(const ossimFilename& histogram_file);
-
-   /**
-    * Returns the currently opened histogram.
-    * Returns ossimFilename::NIL if no histogram is loaded.
-    */
-   ossimFilename getHistogramFile() const;
-   
-   /**
-    * Method to the save the state to a keyword list.
-    * Returns true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.
-    * Returns true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   
-   virtual ostream& print(ostream& os) const;
-
-   /**
-    * Returns the min pixel of the band.
-    */
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   
-   /**
-    * Returns the max pixel of the band.
-    */
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * Will test for the input being a ossimHistogramSource and allow pulling the histogram
-    * from a histogram source.
-    */
-   bool canConnectMyInputTo(ossim_int32 inputIndex,
-                            const ossimConnectableObject* object)const;
-
-protected:
-   /** virtual destructor */
-   virtual ~ossimHistogramRemapper();
-
-private:
-   // Do not allow copy constructor, operator=.
-   ossimHistogramRemapper(const ossimHistogramRemapper& hr);
-   ossimHistogramRemapper& operator=(const ossimHistogramRemapper& hr);
-
-   void buildTable();
-   void buildLinearTable();
-   void buildAutoLinearMinMaxTable();
-   template <class T> void buildLinearTable(T dummy);
-   template <class T> void buildAutoLinearMinMaxTableTemplate(T dummy);
-
-   /**
-    * Sets clip points using mean and standard deviations then calls
-    * buildLinearTable method.
-    */
-   void buildLinearTableStdFromMean();
-   
-   /**
-    * Uses getNumberOfInputBands() to determine BANDS then calls
-    * initializeClips(BANDS)
-    */
-   void initializeClips();
-
-   /**
-    * Initializes data members to some default state and size.
-    */
-   void initializeClips(ossim_uint32 bands);
-
-   /*
-    * Sets the count of the null bin to 0 so that clips from the low end
-    * ignore the null bin.
-    */
-   void setNullCount();
-
-   void initializeMinMaxOutput();
-   
-   /**
-    * Initialized base class (ossimTableRemapper) values:
-    * - theTableBinCount
-    * - theTableBandCount
-    * - theTableType
-    * - theTable (resizes if not correct size.
-    */
-   void setupTable();
-
-   /**
-    * This set theBypassFlag.  This is an internally used flag to signal that
-    * there is nothing to do in this filter; hence, bypass.
-    */
-   void verifyEnabled();
-
-   /**
-    * Returns the histogram band that maps to the input band.
-    * Note:
-    * - This uses the current band list from "getOutputBandList()".
-    */
-   ossim_uint32 getHistogramBand(ossim_uint32 input_band) const;
-
-   /**
-    * Sets theBypassFlag.  If the start changes from bypassed to not bypassed
-    * this will set theDirtyFlag to true.
-    */
-   void setBypassFlag(bool flag);
-
-   /**
-   * If we are dirty then it will init what it needs and then set
-   * the dirty back to false;
-   */
-   void makeClean();
-
-   template <class T> void applyLinearStretch(
-      T dummy,
-      ossimRefPtr<ossimImageData>& inputTile);
-
-
-   StretchMode                   theStretchMode;
-   bool                          theDirtyFlag;
-   mutable ossimRefPtr<ossimMultiResLevelHistogram>  theHistogram;
-   vector<ossim_float64>         theNormalizedLowClipPoint;
-   vector<ossim_float64>         theNormalizedHighClipPoint;
-   vector<ossim_float64>         theMidPoint;
-   vector<ossim_float64>         theMinOutputValue;
-   vector<ossim_float64>         theMaxOutputValue;
-
-   // Maps zero based band to histogram band.
-   vector<ossim_uint32>          theBandList;
-
-   // Internally bypassed flag.
-   bool theBypassFlag;
-   bool theResetBandIndicesFlag;
-
-   TYPE_DATA
-};
-
-#endif  /* #ifndef ossimHistogramRemapper_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimHistogramThreshholdFilter.h b/ossim/include/ossim/imaging/ossimHistogramThreshholdFilter.h
deleted file mode 100644
index c0d1328..0000000
--- a/ossim/include/ossim/imaging/ossimHistogramThreshholdFilter.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHistogramThreshholdFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimHistogramThreshholdFilter_HEADER
-#define ossimHistogramThreshholdFilter_HEADER
-#include <ossim/imaging/ossimImageSourceHistogramFilter.h>
-
-class ossimHistogramThreshholdFilter : public ossimImageSourceHistogramFilter
-{
-public:
-   ossimHistogramThreshholdFilter();
-   ossimHistogramThreshholdFilter(double minValuePercent,
-                                  double maxValuePercent,
-                                  ossimImageSource* inputSource,
-                                  ossimMultiResLevelHistogram* histogram);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual void setMinValuePercent(double minValue);
-   virtual void setMaxValuePercent(double maxValue);
-   
-   virtual double getMinValuePercent()const;
-   virtual double getMaxValuePercent()const;
-
-   virtual void initialize();
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-protected:
-   virtual ~ossimHistogramThreshholdFilter();
-   
-   double theMinValuePercent;
-   double theMaxValuePercent;
-   template <class T>
-   ossimRefPtr<ossimImageData> runThreshholdStretchAlgorithm(
-      T dummyVariable,
-      ossimRefPtr<ossimImageData>& tile);
-   
-TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimHsiRemapper.h b/ossim/include/ossim/imaging/ossimHsiRemapper.h
deleted file mode 100644
index b9f9686..0000000
--- a/ossim/include/ossim/imaging/ossimHsiRemapper.h
+++ /dev/null
@@ -1,257 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Remapper to adjust hue, saturation and intensity.
-//
-//*************************************************************************
-// $Id: ossimHsiRemapper.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimHsiRemapper_HEADER
-#define ossimHsiRemapper_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIMDLLEXPORT ossimHsiRemapper : public ossimImageSourceFilter
-{
-public:
-   enum
-   {
-      RED      = 0,
-      YELLOW   = 1,
-      GREEN    = 2,
-      CYAN     = 3,      
-      BLUE     = 4,
-      MAGENTA  = 5,
-      ALL      = 6
-   };
-   
-   ossimHsiRemapper();
-
-   virtual ossimString getLongName()  const;
-   virtual ossimString getShortName() const;
-
-   virtual void initialize();
-   /*---------------------- PROPERTY INTERFACE ---------------------------*/
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   /*---------------------- END PROPERTY INTERFACE ---------------------------*/
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                   ossim_uint32 resLevel=0);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   
-   ossim_uint32 getNumberOfOutputBands() const;
-
-   virtual ostream& print(ostream& os) const;
-
-   friend ostream& operator << (ostream& os,  const ossimHsiRemapper& hr);
-   
-   void setHueOffset               (int color_group, double offset);
-   void setHueLowRange             (int color_group, double range);
-   void setHueHighRange            (int color_group, double range);
-   void setHueBlendRange           (int color_group, double range);
-   void setSaturationOffset        (int color_group, double offset);
-   void setIntensityOffset         (int color_group, double offset);
-   
-   void setMasterHueOffset         (double offset);
-   void setMasterSaturationOffset  (double offset);
-   void setMasterIntensityOffset   (double offset);
-   void setMasterIntensityLowClip  (double clip);
-   void setMasterIntensityHighClip (double clip);
-
-   void setRedHueOffset            (double offset);
-   void setRedHueLowRange          (double range);
-   void setRedHueHighRange         (double range);
-   void setRedHueBlendRange        (double range);
-   void setRedSaturationOffset     (double offset);
-   void setRedIntensityOffset      (double offset);
-
-   void setYellowHueOffset         (double offset);
-   void setYellowHueLowRange       (double range);
-   void setYellowHueHighRange      (double range);
-   void setYellowHueBlendRange     (double range);
-   void setYellowSaturationOffset  (double offset);
-   void setYellowIntensityOffset   (double offset);
-
-   void setGreenHueOffset          (double offset);
-   void setGreenHueLowRange        (double range);
-   void setGreenHueHighRange       (double range);
-   void setGreenHueBlendRange      (double range);
-   void setGreenSaturationOffset   (double offset);
-   void setGreenIntensityOffset    (double offset);
-
-   void setCyanHueOffset           (double offset);
-   void setCyanHueLowRange         (double range);
-   void setCyanHueHighRange        (double range);
-   void setCyanHueBlendRange       (double range);
-   void setCyanSaturationOffset    (double offset);
-   void setCyanIntensityOffset     (double offset);
-
-   void setBlueHueOffset           (double offset);
-   void setBlueHueLowRange         (double range);
-   void setBlueHueHighRange        (double range);
-   void setBlueHueBlendRange       (double range);
-   void setBlueSaturationOffset    (double offset);
-   void setBlueIntensityOffset     (double offset);
-
-   void setMagentaHueOffset        (double offset);
-   void setMagentaHueLowRange      (double range);
-   void setMagentaHueHighRange     (double range);
-   void setMagentaHueBlendRange    (double range);
-   void setMagentaSaturationOffset (double offset);
-   void setMagentaIntensityOffset  (double offset);
-
-   double getHueOffset             (int color_group) const;
-   double getHueLowRange           (int color_group) const;
-   double getHueHighRange          (int color_group) const;
-   double getHueBlendRange         (int color_group) const;
-   double getSaturationOffset      (int color_group) const;
-   double getIntensityOffset       (int color_group) const;
-   
-   double getMasterHueOffset          () const;
-   double getMasterSaturationOffset   () const;
-   double getMasterIntensityOffset    () const;
-   double getMasterIntensityLowClip   () const;
-   double getMasterIntensityHighClip  () const;
-   
-   double getRedHueOffset             () const;
-   double getRedHueLowRange           () const;
-   double getRedHueHighRange          () const;
-   double getRedHueBlendRange         () const;
-   double getRedSaturationOffset      () const;
-   double getRedIntensityOffset       () const;
-
-   double getYellowHueOffset          () const;
-   double getYellowHueLowRange        () const;
-   double getYellowHueHighRange       () const;
-   double getYellowHueBlendRange      () const;
-   double getYellowSaturationOffset   () const;
-   double getYellowIntensityOffset    () const;
-
-   double getGreenHueOffset           () const;
-   double getGreenHueLowRange         () const;
-   double getGreenHueHighRange        () const;
-   double getGreenHueBlendRange       () const;
-   double getGreenSaturationOffset    () const;
-   double getGreenIntensityOffset     () const;
-
-   double getCyanHueOffset            () const;
-   double getCyanHueLowRange          () const;
-   double getCyanHueHighRange         () const;
-   double getCyanHueBlendRange        () const;
-   double getCyanSaturationOffset     () const;
-   double getCyanIntensityOffset      () const;
-
-   double getBlueHueOffset            () const;
-   double getBlueHueLowRange          () const;
-   double getBlueHueHighRange         () const;
-   double getBlueHueBlendRange        () const;
-   double getBlueSaturationOffset     () const;
-   double getBlueIntensityOffset      () const;
-
-   double getMagentaHueOffset         () const;
-   double getMagentaHueLowRange       () const;
-   double getMagentaHueHighRange      () const;
-   double getMagentaHueBlendRange     () const;
-   double getMagentaSaturationOffset  () const;
-   double getMagentaIntensityOffset   () const;
-
-   void   setWhiteObjectClip          (double clip);
-   double getWhiteObjectClip          () const;
-   void   resetWhiteObjectClip        ();
-
-   void resetGroup(int color_group);
-   void resetAll();
-   void resetMaster();
-   void resetRed();
-   void resetYellow();
-   void resetGreen();
-   void resetCyan();
-   void resetBlue();
-   void resetMagenta();
-   
-protected:
-   virtual ~ossimHsiRemapper();
-   void   allocate(const ossimIrect& rect);
-   void   verifyEnabled();
-   double calculateMinNormValue();
-
-   bool theValidFlag;
-   ossimRefPtr<ossimImageData> theTile;
-   double*                     theBuffer;
-   double                      theNormalizedMinPix;
-
-   double theMasterHueOffset;
-   double theMasterSaturationOffset;
-   double theMasterIntensityOffset;
-   double theMasterIntensityLowClip;
-   double theMasterIntensityHighClip;
-
-   double theRedHueOffset;
-   double theRedHueLowRange;
-   double theRedHueHighRange;
-   double theRedHueBlendRange;
-   double theRedSaturationOffset;
-   double theRedIntensityOffset;
-
-   double theYellowHueOffset;
-   double theYellowHueLowRange;
-   double theYellowHueHighRange;
-   double theYellowHueBlendRange;
-   double theYellowSaturationOffset;
-   double theYellowIntensityOffset;
-
-   double theGreenHueOffset;
-   double theGreenHueLowRange;
-   double theGreenHueHighRange;
-   double theGreenHueBlendRange;
-   double theGreenSaturationOffset;
-   double theGreenIntensityOffset;
-
-   double theCyanHueOffset;
-   double theCyanHueLowRange;
-   double theCyanHueHighRange;
-   double theCyanHueBlendRange;
-   double theCyanSaturationOffset;
-   double theCyanIntensityOffset;
-
-   double theBlueHueOffset;
-   double theBlueHueLowRange;
-   double theBlueHueHighRange;
-   double theBlueHueBlendRange;
-   double theBlueSaturationOffset;
-   double theBlueIntensityOffset;
-
-   double theMagentaHueOffset;
-   double theMagentaHueLowRange;
-   double theMagentaHueHighRange;
-   double theMagentaHueBlendRange;
-   double theMagentaSaturationOffset;
-   double theMagentaIntensityOffset;
-
-   double theWhiteObjectClip;
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimHsiToRgbSource.h b/ossim/include/ossim/imaging/ossimHsiToRgbSource.h
deleted file mode 100644
index 76866fa..0000000
--- a/ossim/include/ossim/imaging/ossimHsiToRgbSource.h
+++ /dev/null
@@ -1,50 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHsiToRgbSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimHsiToRgbSource_HEADER
-#define ossimHsiToRgbSource_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimHsiToRgbSource : public ossimImageSourceFilter
-{
-public:
-   ossimHsiToRgbSource();
-   ossimHsiToRgbSource(ossimImageSource* inputSource);
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual ossimScalarType getOutputScalarType() const;
-
-   virtual double getNullPixelValue()const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual void initialize();
-protected:
-   virtual ~ossimHsiToRgbSource();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theBlankTile;
-   ossimRefPtr<ossimImageData> theTile;
-
-   void initializeBuffers(ossimRefPtr<ossimImageData>& data);
-   
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimHsiToRgbSource_HEADER */
-
-
diff --git a/ossim/include/ossim/imaging/ossimHsvGridRemapEngine.h b/ossim/include/ossim/imaging/ossimHsvGridRemapEngine.h
deleted file mode 100644
index bde9840..0000000
--- a/ossim/include/ossim/imaging/ossimHsvGridRemapEngine.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//*****************************************************************************
-// FILE: ossimHsvGridRemapEngine.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimHsvGridRemapEngine
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimHsvGridRemapEngine.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimHsvGridRemapEngine_HEADER
-#define ossimHsvGridRemapEngine_HEADER
-
-#include <ossim/imaging/ossimGridRemapEngine.h>
-
-/*!****************************************************************************
- *
- * CLASS: ossimHsvGridRemapEngine 
- *
- *****************************************************************************/
-class ossimHsvGridRemapEngine : public ossimGridRemapEngine
-{
-public:
-   ossimHsvGridRemapEngine()
-      : ossimGridRemapEngine(3, 3) {}
-   
-   virtual ossimObject* dup() const;
-   
-   virtual void remapTile(const ossimDpt& origin_point,
-                          ossimGridRemapSource* remapper,
-                          ossimRefPtr<ossimImageData>& tile);
-
-   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources);
-
-   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
-                                   void* result);
-
-protected:
-   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
-                                 void*                 source_value,
-                                 void*                 target_value);
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimHsvToRgbSource.h b/ossim/include/ossim/imaging/ossimHsvToRgbSource.h
deleted file mode 100644
index 8c52481..0000000
--- a/ossim/include/ossim/imaging/ossimHsvToRgbSource.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHsvToRgbSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimHsvToRgbSource_HEADER
-#define ossimHsvToRgbSource_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIM_DLL ossimHsvToRgbSource : public ossimImageSourceFilter
-{
-public:
-   ossimHsvToRgbSource();
-   ossimHsvToRgbSource(ossimImageSource* inputSource);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual double          getNullPixelValue()const;
-   virtual double          getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double          getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual void initialize();
-
-protected:
-   virtual ~ossimHsvToRgbSource();
-
-   virtual void allocate();
-
-   ossimRefPtr<ossimImageData> theBlankTile;
-   ossimRefPtr<ossimImageData> theTile;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageChain.h b/ossim/include/ossim/imaging/ossimImageChain.h
deleted file mode 100644
index fdc8436..0000000
--- a/ossim/include/ossim/imaging/ossimImageChain.h
+++ /dev/null
@@ -1,417 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageChain.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageChain_HEADER
-#define ossimImageChain_HEADER
-#include <vector>
-#include <map>
-using namespace std;
-
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/base/ossimId.h>
-#include <ossim/base/ossimConnectableContainerInterface.h>
-
-class OSSIMDLLEXPORT ossimImageChain : public ossimImageSource,
-                                       public ossimConnectableObjectListener,
-                                       public ossimConnectableContainerInterface
-{
-public:
-   ossimImageChain();
-   virtual ~ossimImageChain();
-
-   ossimConnectableObject::ConnectableObjectList& getChainList(){return theImageChainList;}
-   const ossimConnectableObject::ConnectableObjectList& getChainList()const{return theImageChainList;}
-   
-   /**
-    * @param index Index of object to get.
-    *
-    * @see getNumberOfObjects(false) to get the number of objects inside
-    * the container.
-    *
-    * @return Container's object at that index or NULL if out of range.
-    */
-   ossimConnectableObject* operator[](ossim_uint32 index);
-
-   /**
-    * Same as operator[](ossim_uint32 i)
-    * 
-    * @param index Index of object to get.
-    *
-    * @see getNumberOfObjects(false) to get the number of objects inside
-    * the container.
-    *
-    * @return Container's object at that index or NULL if out of range.
-    *
-    * @note This does not recurse into other containers.
-    */
-   virtual ossimConnectableObject* getConnectableObject(ossim_uint32 index);
-   
-   virtual ossim_int32 indexOf(ossimConnectableObject* obj)const;
-   /**
-    * Return the first source which is the one that first receives the
-    * getTile request
-    */
-   virtual ossimImageSource* getFirstSource();
-   virtual const ossimImageSource* getFirstSource() const;
-   
-   virtual ossimObject* getFirstObject();
-
-   /**
-    * Return the last source which is the one that last receives the
-    * getTile request.
-    */
-   virtual ossimImageSource* getLastSource();
-   virtual const ossimImageSource* getLastSource() const;
-   
-   virtual ossimObject* getLastObject();
-
-
-   /**
-    * Adds it to the start of the chain.  This is the first one to receive
-    * the getTile request.  This basically inserts it to the right of the
-    * right most filter.
-    * Returns true on success, false on error.
-    */
-   bool addFirst(ossimConnectableObject* obj);
-
-   /**
-    * Adds it to the end.  this is the last one to receive the getTile
-    * request.  This basically inserts it to the left of the left most filter.
-    * Returns true on success, false on error.
-    */
-   bool addLast(ossimConnectableObject* obj);
-   
-   /**
-    * Deletes the first object.
-    * Note this is really most right of the chain.
-    * Returns true if deletion occurred, false if the chain is empty.
-    */
-   bool deleteFirst();
-
-   /**
-    * Deletes the last object.
-    * Note this is really most left of the chain.
-    * Returns true if deletion occurred, false if the chain is empty.
-    */
-   bool deleteLast();
-
-   /**
-    * 
-    */
-   bool insertRight(ossimConnectableObject* newObj,
-                    ossimConnectableObject* rightOfThisObj);
-
-   /**
-    *
-    */
-   bool insertRight(ossimConnectableObject* newObj,
-                    const ossimId& id);
-
-   /**
-    *
-    */
-   bool insertLeft(ossimConnectableObject* newObj,
-                   const ossimId& id);
-   /**
-    *
-    */
-   bool insertLeft(ossimConnectableObject* newObj,
-                   ossimConnectableObject* leftOfThisObj);
-   
-   bool replace(ossimConnectableObject* newObj,
-                ossimConnectableObject* oldObj);
-   /**
-    * Will return true or false if an image source was
-    * added to the chain.  It will add and do a connection
-    * to the previous source automatically.  This is a
-    * chain and the order of insertion matters. It adds it to the beginning
-    * of the list.  The last one added is the first one to receive
-    * the getTile.  Basically inserts to the right of the rightmost filter
-    *
-    */
-   virtual bool add(ossimConnectableObject* source);
-
-   /**
-    * Within the image chain will pass the head of the
-    * list.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   /**
-    * this call is passed to the head of the list.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   
-   /**
-    * This call is passed to the head of the list.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
-   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
-
-   /**
-    * This call is passed to the head of the list.
-    */
-   virtual ossim_uint32 getTileWidth()const;
-
-   /**
-    * This call is passed to the head of the list.
-    */
-   virtual ossim_uint32 getTileHeight()const;
-   
-   /**
-    * Will pass this call to the head of the list.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0)const;
-   
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   virtual void getDecimationFactor(ossim_uint32 resLevel,
-                                    ossimDpt& result) const;
-   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
-   virtual ossim_uint32 getNumberOfDecimationLevels()const;
-   
-   /**
-    * Will save the state of the chain.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-
-   /**
-    * Will load the state.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-   
-   virtual void initialize();
-   virtual void enableSource();
-   virtual void disableSource();
-   
-   bool canConnectMyInputTo(ossim_int32 myInputIndex,
-                            const ossimConnectableObject* object)const
-      {
-         if(theImageChainList.size()&&
-            theImageChainList[theImageChainList.size()-1].valid())
-         {
-            ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject, theImageChainList[theImageChainList.size()-1].get());
-            if(obj)
-            {
-               return obj->canConnectMyInputTo(myInputIndex,
-                                               object);
-            }
-         }
-         else if(!theImageChainList.size())
-         {
-            return true;
-         }
-         return false;
-      }
-      
-//    bool canConnectMyOutputTo(int32 myOutputIndex,
-//                              const ossimConnectableObject* object)const
-//       {
-//          if(theImageChainList.size()&&theImageChainList[0])
-//          {
-// 	   ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject, theImageChainList[0]);
-// 	   if(obj)
-// 	     {
-// 	       return obj->canConnectMyOutputTo(myOutputIndex,
-// 						object);
-// 	     }
-//          }
-         
-//          return false;
-//       }
-   
-   // ________________________CONNECTABLE CONTAINER DEFINTIONS_________________
-   //
-   
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeIdVisitor visitor(tyeId, false, ossimVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD( virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const RTTItypeid& typeInfo,
-                                                                     bool recurse=true));
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeNameVisitor visitor(typeName, false, ossimVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimCollectionVisitor::List& collection = visitor.getObjects();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject::ConnectableObjectList findAllObjectsOfType(const ossimString& className,
-                                                                     bool recurse=true));
-
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeIdVisitor visitor(tyeId, true, ossimVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findFirstObjectOfType(const RTTItypeid& typeInfo,
-                                                         bool recurse=true));
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimTypeNameVisitor visitor(className, true, ossimVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findFirstObjectOfType(const ossimString& className,
-                                                         bool recurse=true));
-
-   /*!
-    * These methods are now deprecated.  You can achieve the same thing by using the new visitor design pattern.  If this does not 
-    * achieve exactly what you want then you can derive new rules by overriding the virtual visit method in ossimVisitor
-    *
-    * <pre>
-    *    ossimIdVisitor visitor(tyeId, true, ossimVisitor::VISIT_CHILDREN);
-    *    connectableObject->accept(visitor);
-    *    ossimRefPtr<ossimConnectableObject> obj = visitor.getObject();
-    * </pre>
-    */
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObject(const ossimId& id,
-                                              bool recurse=true));
-
-   OSSIM_DEPRECATE_METHOD(virtual ossimConnectableObject* findObject(const ossimConnectableObject* obj,
-                                              bool recurse=true));
-
-   /**
-    * Will cycle through all sources setting their ids. the idLast wlil
-    * be updated
-    * so we can recurse into other containers.
-    */
-   virtual void makeUniqueIds();
-
-   /**
-    * Returns the number of objects within this container and all child
-    * containers.
-    *
-    * @param recurse If true and object is a contains containers; all objects
-    * will be conter.  If false only the objects of this container will be
-    * counted (theImageChainList.size()).
-    */
-   virtual ossim_uint32 getNumberOfObjects(bool recurse=true)const;
-
-   /**
-    * Deprecated! Please use getNumberOfObjects(false).
-    *
-    * @return The number of objects in this container or
-    * (theImageChainList.size()).
-    */
-   virtual ossim_uint32 getNumberOfSources() const;
-   
-   /**
-    * Will add an object to the container and then set the added objects owner
-    * to this.
-    */
-   virtual bool addChild(ossimConnectableObject* attachableObject);
-
-   /**
-    * Will remove the child from the container.  Changes the owner of the
-    * child to be NULL;
-    */
-   virtual bool removeChild(ossimConnectableObject* object);
-   virtual ossimConnectableObject* removeChild(const ossimId& id);
-   
-   virtual void getChildren(vector<ossimConnectableObject*>& children,
-                            bool immediateChildrenOnlyFlag);
-   //______________END CONNECTABLE CONTAINER INTERFACE____________
-   
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-   virtual void disconnectOutputEvent(ossimConnectionEvent& event);
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-   virtual void connectOutputEvent(ossimConnectionEvent& event);
-   virtual void objectDestructingEvent(ossimObjectDestructingEvent& event);
-
-   virtual void propagateEventToOutputs(ossimEvent& event);
-   virtual void propagateEventToInputs(ossimEvent& event);
- 
-   virtual void processEvent(ossimEvent& event);
-
-   virtual void accept(ossimVisitor& visitor);
-   void deleteList();
-
-   /**
-    * These access methods greatly facilitate the implementation of an image chain adaptor class.
-    * They shouldn't be accessed directly by any other classes.  These methods really should be 
-    * "protected" but the compiler complains if this base class' declarations are "protected".
-    */
-   virtual ossimConnectableObject::ConnectableObjectList& imageChainList() { return theImageChainList; }
-   virtual const ossimConnectableObject::ConnectableObjectList& imageChainList() const { return theImageChainList; }
-   
-   /**
-    * Inserts all of this object's children and inputs into the container provided. Since this is
-    * itself a form of container, this method will consolidate this chain with the argument
-    * container. Consequently, this chain object will not be represented in the container, but its
-    * children will be, with correct input and output connections to external objects. Ownership
-    * of children will pass to the argument container.
-    * @return Returns TRUE if successful.
-    */
-   virtual bool fillContainer(ossimConnectableContainer& container);
-
-protected:
-   void prepareForRemoval(ossimConnectableObject* connectableObject);
-   
-  /**
-    * This will hold a sequence of image sources.
-    * theFirst one in the list will be the head of the
-    * list and the last one is the tail.
-    */
-   ossimConnectableObject::ConnectableObjectList theImageChainList;
-   
-   ossimRefPtr<ossimImageData>     theBlankTile;
-  // mutable bool                    thePropagateEventFlag;
-   mutable bool                    theLoadStateFlag;
-   /**
-    * For dynamic loading to take place we must allocate all objects first and
-    * then assign id's later.  We must remember the id's so we can do this.
-    * we will create a map that takes the id of the source as a key and a
-    * vector of input id's to connect it's inputs to.
-    */
-   bool addAllSources(map<ossimId, vector<ossimId> >& idMapping,
-                      const ossimKeywordlist& kwl,
-                      const char* prefix = NULL);
-   void findInputConnectionIds(vector<ossimId>& result,
-                               const ossimKeywordlist& kwl,
-                               const char* prefix=NULL);
-   bool connectAllSources(const map<ossimId, vector<ossimId> >& idMapping);
-   
-   
-TYPE_DATA
-};
-#endif /* #ifndef ossimImageChain_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageData.h b/ossim/include/ossim/imaging/ossimImageData.h
deleted file mode 100644
index eb62cde..0000000
--- a/ossim/include/ossim/imaging/ossimImageData.h
+++ /dev/null
@@ -1,1275 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Container class for a tile of image data.
-//
-//*******************************************************************
-// $Id: ossimImageData.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageData_HEADER
-#define ossimImageData_HEADER 1
-
-#include <vector>
-#include <iosfwd> /* for ostream */
-
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimRectilinearDataObject.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimMultiBandHistogram;
-
-class OSSIMDLLEXPORT ossimImageData : public ossimRectilinearDataObject
-{
-public:
-
-   /** Definitions for the unloadBand routines. */
-   enum OverwriteBandRule
-   {
-      /*
-       * The COLOR_DISCREPANCY rule directs that the selected band of a pixel
-       * of the destination buffer is to be overwritten if *any* one of the
-       * other bands of the same destination pixel have color values that 
-       * deviate from its color. 
-       * Deprecated in favor of COLOR_DISCREPANCY_OF_ANY_FROM_DEST.
-       */
-      COLOR_DISCREPANCY = 0,
-
-      /*
-       * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected 
-       * band of a pixel of the destination buffer is to be overwritten if 
-       * *any* one of the other bands of the same destination pixel have color 
-       * values that deviate from its color. 
-       * Same as the deprecated COLOR_DISCREPANCY.
-       */
-      COLOR_DISCREPANCY_OF_ANY_FROM_DEST = 1,
-
-      /*
-       * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected 
-       * band of a pixel of the destination buffer is to be overwritten only if 
-       * *all* of the other bands of the same destination pixel have color 
-       * values that deviate from its color. 
-       */
-      COLOR_DISCREPANCY_OF_ALL_FROM_DEST = 2,
-
-      /*
-       * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected 
-       * band of a pixel of the destination buffer is to be overwritten if 
-       * *any* one of the other bands of the same destination pixel have color 
-       * values that are equal to the color of the selected band of the source
-       * pixel. 
-       */
-      COLOR_EQUALITY_OF_ANY_TO_SRC = 3,
-
-      /*
-       * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected 
-       * band of a pixel of the destination buffer is to be overwritten only if 
-       * *all* of the other bands of the same destination pixel have color 
-       * values that are equal to the color of the selected band of the source
-       * pixel. 
-       */
-      COLOR_EQUALITY_OF_ALL_TO_SRC = 4,
-
-      /*
-       * The selected band of the destination buffer is to be overwritten 
-       * by the selected band of the source image data (no questions asked).
-       */
-      NULL_RULE = 5
-   };
-
-   /** @brief copy constructor */
-   ossimImageData(const ossimImageData &rhs);
-   
-   ossimImageData();
-
-   /**
-    * @brief Constructor
-    * @param source The owner.  This can be null.
-    * @param scalar The Scalar type like OSSIM_UINT8, OSSIM_UINT16...
-    * @param bands  The number of bands.
-    * 
-    * @note This does not initialize the undelying data buffer.
-    *       Call the initialize method to allocate storage.
-    */
-   ossimImageData(ossimSource* source,
-                  ossimScalarType scalar,
-                  ossim_uint32 bands = 1);
-
-   /**
-    * @brief Constructor
-    * @param source The owner.  This can be null.
-    * @param scalar The Scalar type like OSSIM_UINT8, OSSIM_UINT16...
-    * @param bands  The number of bands.
-    * @param width  The width or number of samples in the buffer.
-    * @param height The height or numer of lines in the buffer.
-    * 
-    * @note This does not initialize the undelying data buffer.
-    *       Call the initialize method to allocate storage.
-    */
-   ossimImageData(ossimSource* source,
-                  ossimScalarType scalar,
-                  ossim_uint32 bands,
-                  ossim_uint32 width,
-                  ossim_uint32 height);
-
-   /** @brief virtual destructor */
-   virtual ~ossimImageData();
-
-   /**
-    * @brief assignment operator=
-    * @param rhs The data to assign from.
-    * @param A reference to this object.
-    */
-   virtual const ossimImageData& operator=(const ossimImageData &rhs);
-
-
-   /**
-    * @return The width of the data object.
-    */
-   virtual ossim_uint32 getWidth()const;
-
-   /**
-    * @return The height of the data object.
-    */
-   virtual ossim_uint32 getHeight()const;
-
-   /**
-    * @return The image rectangle relative to origin, height and width.
-    */
-   virtual ossimIrect getImageRectangle() const;
-   virtual void getWidthHeight(ossim_uint32& w, ossim_uint32& h);
-   virtual void setWidth(ossim_uint32 width);
-   virtual void setHeight(ossim_uint32 height);
-   virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h);
-   virtual void setImageRectangleAndBands(const ossimIrect& rect,
-                                          ossim_uint32 numberOfBands);
-   virtual void setImageRectangle(const ossimIrect& rect);
-   virtual void setOrigin(const ossimIpt& origin);   
-                                    
-   virtual void assign(const ossimDataObject* data);
-   virtual void assign(const ossimImageData* data);
-   virtual void assignBand(const ossimImageData* data,
-                           ossim_uint32 source_band,
-                           ossim_uint32 output_band);
-   
-   virtual ossimObject* dup() const;
-
-  /**
-   * Uses prime numbers as coefficients for this summation.  
-   * Take the the fours bytes of each origin and multiply 
-   * by the prime numbers and sum together.  This has
-   * been proven by others to give nicely distributed 
-   * id number.
-   */
-   virtual ossim_uint32 getHashId()const;
-   
-   virtual void setNullPix(ossim_float64 null_pix);
-   virtual void setNullPix(ossim_float64 null_pix, ossim_uint32 band);
-   virtual void setNullPix(const ossim_float64* nullPixArray,
-                           ossim_uint32 numberOfValues);
-   virtual void setMinPix(ossim_float64 min_pix);
-   virtual void setMinPix(ossim_float64 min_pix, ossim_uint32 band);
-   virtual void setMinPix(const ossim_float64* minPixArray,
-                          ossim_uint32 numberOfValues);
-   virtual void setMaxPix(ossim_float64 max_pix);
-   virtual void setMaxPix(ossim_float64 max_pix, ossim_uint32 band);
-   virtual void setMaxPix(const ossim_float64* maxPixArray,
-                          ossim_uint32 numberOfValues);
-
-   virtual const ossimIpt& getOrigin()const{return m_origin;}
-
-   /**
-    * If the minBands and maxBands are empty or not equal to the imageData's
-    * current number of bands it will erase the contents, resize, and then
-    * replace the values in the passed in array with this objects min max
-    * values.  If the arrays are the same size as this objects number of
-    * bands it will just update the values and use the current values in the
-    * arrays as initial min max values.
-    *
-    * If the status of this object(getDataObjectStatus()) is OSSIM_NULL or
-    * OSSIM_EMPTY no action is performed.
-    */
-   virtual void computeMinMaxPix(std::vector<ossim_float64>& minBands,
-                                 std::vector<ossim_float64>& maxBands) const;
-
-   /**
-    * @brief Scans tile for min, max, nulls.
-    * 
-    * If the nullBands, minBands and maxBands are empty or not equal to the
-    * imageData's current number of bands it will erase the contents, resize,
-    * and then replace the values in the passed in array with this objects
-    * min max values.  If the arrays are the same size as this objects number
-    * of bands it will just update the values and use the current values in the
-    * arrays as initial min max values.
-    *
-    * If the status of this object(getDataObjectStatus()) is OSSIM_NULL no
-    * action is performed.
-    */
-   virtual void computeMinMaxNulPix(
-      std::vector<ossim_float64>& minBands,
-      std::vector<ossim_float64>& maxBands,
-      std::vector<ossim_float64>& nulBands) const;
-   
-   virtual const ossim_float64* getNullPix()const;
-   virtual const ossim_float64* getMinPix()const;
-   virtual const ossim_float64* getMaxPix()const;
-   virtual ossim_float64        getNullPix(ossim_uint32 band) const;
-   virtual ossim_float64        getMinPix(ossim_uint32 band)  const;
-   virtual ossim_float64        getMaxPix(ossim_uint32 band)  const;
-
-   /**
-    * returns normalized minimum pixel value of band zero.
-    */
-   virtual ossim_float64   getMinNormalizedPix() const;
-   virtual ossimString     getScalarTypeAsString()const;
-   virtual ossim_uint32    getNumberOfBands() const;
-   virtual void            setNumberOfBands(ossim_uint32 bands,
-                                            bool reallocate=false);
-
-   /**
-    * Will return the pixel at location position.  Note it will first get
-    * the passed in position relative to the origin or upper left
-    * corner of this tile and then return the result.
-    */
-   virtual ossim_float64 getPix(const ossimIpt& position,
-                                ossim_uint32 band=0) const;
-
-   /**
-    * Will return the pixel at offset and band number.
-    */
-   virtual ossim_float64 getPix(ossim_uint32 offset,
-                                ossim_uint32 band = 0) const;
-   
-   /**
-    * will fill the entire band with
-    * the value.
-    */
-   void fill(ossim_uint32 band, ossim_float64 value);
-
-   /**
-    * will fill all bands with the passed in
-    * value.
-    */
-   void fill(ossim_float64 value);
-
-   /**
-    * @brief Creates a step wedge for testing only.
-    *
-    * Writes line at a time of a single value, starting at scalar null,
-    * and going to scalar max in increments of scalar range/tile_lines.
-    */
-   void createTestTile();
-   
-   bool isNull(ossim_uint32 offset)const;
-   bool isNull(ossim_uint32 offset, ossim_uint32 band)const;
-   void setNull(ossim_uint32 offset);
-   void setNull(ossim_uint32 offset, ossim_uint32 band);
-
-   bool isNull(const ossimIpt& pt)const;
-   void setNull(const ossimIpt& pt);
-   bool isNull(const ossimIpt& pt, ossim_uint32 band)const;
-   void setNull(const ossimIpt& pt, ossim_uint32 band);
-   
-   virtual bool   isValidBand(ossim_uint32 band) const;
-   virtual ossimDataObjectStatus validate() const;
-
-   /**
-    * Will take this tile and normalize it to a newly
-    * allocated floating point tile.
-    */
-   virtual ossimRefPtr<ossimImageData> newNormalizedFloat()const;
-
-   /**
-    * will go to the band and offset and compute the
-    * normalized float and return it back to the
-    * caller through the result argument.
-    */
-   virtual void getNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   ossim_float32& result)const;
-
-   /**
-    * This will assign to this object a normalized
-    * value by unnormalizing to its native type.
-    */
-   virtual void setNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   ossim_float32 input);
-
-   /**
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedFloat(ossimImageData* result)const;
-
-   /**
-    * Will take this tile and normalize it to a newly
-    * allocated double point tile.
-    */
-   virtual ossimImageData* newNormalizedDouble()const;
-
-   /**
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedDouble(ossimImageData* result)const;
-
-   /**
-    * Will take the normalized input and convert it
-    * to this tile's data type.  Example:  if this
-    * tile is of type UCHAR and its input is of type
-    * NORALIZED_FLOAT it will unnormalize the data by
-    * doing:
-    *
-    * minPix + normalizedInput*(maxPix-minPix)
-    *
-    * on a per band basis.
-    */
-   virtual void unnormalizeInput(ossimImageData* normalizedInput);
-
-   /**
-    * This will compute the average value for the band.
-    */
-   virtual ossim_float64 computeAverageBandValue(
-      ossim_uint32 bandNumber = 0) const;
-
-   /**
-    * This will call the compute average band value and then
-    * use that in the calculation of:
-    
-    * It will then do a SUM[(Mean - Actual)^2]/width*height.
-    *
-    * This is the average variance from the passed in
-    * mean.  
-    */
-   virtual ossim_float64 computeMeanSquaredError(
-      ossim_float64 meanValue,
-      ossim_uint32 bandNumber = 0) const;
-  
-   virtual void populateHistogram(ossimRefPtr<ossimMultiBandHistogram> histo);
-
-   /**
-    * @return true if alpha channel is initialized, false if not.
-    */
-   virtual bool hasAlpha() const;
-   
-   /**
-    * @return const ossim_uint8* to the alpha channel or null if the alpha
-    * channel was not computed.
-    */
-   virtual const ossim_uint8* getAlphaBuf() const;
-
-   /**
-    * @return ossim_uint8* to the alpha channel or null if the alpha channel
-    * was not computed.
-    */
-   virtual ossim_uint8* getAlphaBuf();
-
-   /**
-    * @return const void* to theDataBuffer
-    */
-   virtual const void* getBuf() const;
-   
-   /**
-    * @return const ossim_uint8* to theDataBuffer if scalar is of type
-    * OSSIM_UCHAR; else, NULL.
-    */
-   virtual const ossim_uint8*    getUcharBuf()  const;
-
-   /**
-    * @return const ossim_uint16* to theDataBuffer if scalar is of type
-    * OSSIM_USHORT16 or USHORT11; else, NULL.
-    */
-   virtual const ossim_uint16*   getUshortBuf() const;
-
-   /**
-    * @return const ossim_sint16* to theDataBuffer if scalar is of type
-    * OSSIM_SSHORT16; else, NULL.
-    */
-   virtual const ossim_sint16*   getSshortBuf() const;
-
-   /**
-    * @return const ossim_float32* to theDataBuffer if scalar is of type
-    * OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
-    */
-   virtual const ossim_float32*  getFloatBuf()  const;
-
-   /**
-    * @return const ossim_float64* to theDataBuffer if scalar is of type
-    * OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.
-    */
-   virtual const ossim_float64*  getDoubleBuf() const;
-
-   /**
-    * @return void* to theDataBuffer
-    */
-   virtual void* getBuf();
-   
-   /**
-    * @return ossim_uint8* to theDataBuffer if scalar is of type
-    * OSSIM_UCHAR; else, NULL.
-    */
-   virtual ossim_uint8*    getUcharBuf();
-   
-   /**
-    * @return ossim_uint16* to theDataBuffer if scalar is of type
-    * OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.
-    */
-   virtual ossim_uint16*   getUshortBuf();
-   
-   /**
-    * @return ossim_sint16* to theDataBuffer if scalar is of type
-    * OSSIM_SSHORT16; else, NULL.
-    */
-   virtual ossim_sint16*   getSshortBuf();
-
-   /**
-    * @return ossim_float32* to theDataBuffer if scalar is of type
-    * OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
-    */
-   virtual ossim_float32*  getFloatBuf();
-   
-   /**
-    * @return float64* to theDataBuffer if scalar is of type OSSIM_DOUBLE or
-    * OSSIM_NORMALIZED_DOUBLE; else, NULL.
-    */
-   virtual ossim_float64*  getDoubleBuf();
-
-   /**
-    * @param band (zero based)
-    * @return void* to theDataBuffer positioned at band.
-    */
-   virtual const void*           getBuf(ossim_uint32 band) const;
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_uint8* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_UCHAR; else, NULL.
-    */
-   virtual const ossim_uint8*    getUcharBuf(ossim_uint32 band) const;
-
-   /**
-    * @param band (zero based)
-    * @return ossim_uint16* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.
-    */
-   virtual const ossim_uint16*   getUshortBuf(ossim_uint32 band) const;
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_sint16* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_SSHORT16; else, NULL.
-    */
-   virtual const ossim_sint16*   getSshortBuf(ossim_uint32 band) const;
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_float32* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
-    */
-   virtual const ossim_float32*  getFloatBuf(ossim_uint32 band) const;
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_float64* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.
-    */
-   virtual const ossim_float64*  getDoubleBuf(ossim_uint32 band) const;
-
-   /**
-    * @param band (zero based)
-    * @return void* to theDataBuffer positioned at band.
-    */
-   virtual void*           getBuf(ossim_uint32 band);
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_uint8* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_UCHAR; else, NULL.
-    */
-   virtual ossim_uint8*    getUcharBuf(ossim_uint32 band);
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_uint16* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_USHORT16 or OSSIM_USHORT11; else, NULL.
-    */
-   virtual ossim_uint16*   getUshortBuf(ossim_uint32 band);
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_sint16* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_SSHORT16; else, NULL.
-    */
-   virtual ossim_sint16*   getSshortBuf(ossim_uint32 band);
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_float32* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_FLOAT or OSSIM_NORMALIZED_FLOAT; else, NULL.
-    */
-   virtual ossim_float32*  getFloatBuf(ossim_uint32 band);
-   
-   /**
-    * @param band (zero based)
-    * @return ossim_float64* to theDataBuffer positioned at band if scalar is
-    * of type OSSIM_DOUBLE or OSSIM_NORMALIZED_DOUBLE; else, NULL.
-    */
-   virtual ossim_float64*  getDoubleBuf(ossim_uint32 band);
-   
-   /**
-    *  Returns the total number of pixels in a tile for all bands.
-    *  Note:  This is not in bytes but in pixels.
-    */
-   virtual ossim_uint32 getSize() const;
-
-   /**
-    *  Returns the number of pixels in a single band in a tile.
-    *  Note:  This is not in bytes but in pixels.
-    */
-   virtual ossim_uint32 getSizePerBand()const;
-
-   /**
-    *  Returns the number of bytes in single band of the tile.
-    */
-   virtual ossim_uint32 getSizePerBandInBytes() const;
-
-   virtual ossim_uint32 getDataSizeInBytes()const;
-
-   /**
-    * Returns the total number of bytes for all bands.
-    */
-   virtual ossim_uint32  getSizeInBytes() const;
-
-   /**
-    *  Initializes data to null pixel values.
-    */
-   virtual void makeBlank();
-
-   /**
-    *  Initialize the data buffer.
-    */
-   virtual void initialize();
-
-   /**
-    * @brief Writes tile to stream.
-    *
-    * This will write the buffer to file with an associated header file.
-    * Assuming a contiguous buffer in BSQ format.  Currently does not
-    * support converting to BIP or BIL or byte swapping but probably
-    * should add at some point.
-    *
-    * @param f File to write.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool write(const ossimFilename& f) const;
-
-   /**
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(ossim_float64* buf) const;
-   virtual void copyTileToNormalizedBuffer(ossim_float32* buf)const;
-
-   /**
-    * Will copy this tiles specified band number to the normalized buffer.
-    * if the band is out of range then nothing is done and returns.
-    *
-    * @param band Zero based band to copy.
-    *
-    * @param buf Buffer to copy to.
-    */
-   virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band,
-                                               ossim_float64* buf) const;
-   
-   /**
-    * Will copy this tiles specified band number to the normalized buffer.
-    * if the band is out of range then nothing is done and returns.
-    *
-    * @param band Zero based band to copy.
-    *
-    * @param buf Buffer to copy to.
-    */
-   virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band,
-                                               ossim_float32* buf)const;
-
-   /**
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(ossim_float64* buf);
-   virtual void copyNormalizedBufferToTile(ossim_float32* buf);
-
-   /**
-    * Will copy the normalized buffer to this tiles
-    * specified band.  If band is out of range then nothing
-    *
-    * is done and returns.
-    */
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           ossim_float64* buf);
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           ossim_float32* buf);
-
-   virtual bool isWithin(ossim_int32 x, ossim_int32 y);
-   virtual void setValue(ossim_int32 x, ossim_int32 y, ossim_float64 color);
-
-   virtual void loadBand(const void* src,
-                         const ossimIrect& src_rect,
-                         ossim_uint32 band);
-
-   virtual void loadBand(const void* src,
-                         const ossimIrect& src_rect,
-                         const ossimIrect& clip_rect,
-                         ossim_uint32 band);
-   
-   virtual void loadTile(const void* src,
-                         const ossimIrect& src_rect,
-                         ossimInterleaveType il_type);
-   virtual void loadTileWithAlpha(const void* src,
-                         const ossimIrect& src_rect,
-                         ossimInterleaveType il_type);
-
-   virtual void loadTile(const void* src,
-                         const ossimIrect& src_rect,
-                         const ossimIrect& clip_rect,                         
-                         ossimInterleaveType il_type);
-
-   virtual void nullTileAlpha(const ossim_uint8* src,
-                              const ossimIrect& src_rect,
-                              bool mutliplyAlphaFlag=false);
-   virtual void nullTileAlpha(const ossim_uint8* src,
-                              const ossimIrect& src_rect,
-                              const ossimIrect& clip_rect,
-                              bool multiplyAlphaFlag=false);
-   /**
-    * Will load a tile of different types.  If they
-    * are the same then it will call loadTile(void*...)
-    * method.  Note if they are of different types we
-    * will have to go through a much slower assign
-    * process by normalizing the right side and then
-    * unnormalizing to the destination type. For this
-    * method to work they both must have the same
-    * number of bands.
-    */
-   virtual void loadTile(const ossimImageData* src);
-   
-   virtual void loadTileFrom1Band(const ossimImageData* data);
-
-   virtual void loadTileFrom1Band(const void* src,
-                                  const ossimIrect& src_rect);
-   /**
-    * Specialized to load a tile from a short (16 bit scalar type) buffer.
-    * Performs byte swapping if swap_bytes is set to true.
-    */
-   virtual void loadShortBand(const void* src,
-                              const ossimIrect& src_rect,
-                              ossim_uint32 band,
-                              bool swap_bytes=false);
-
-   /**
-    * This routine is designed for overwriting a selected band of the 
-    * destination buffer 'dest' by an independent selected band of the
-    * source buffer according to a user-selected rule, defined by 
-    * OverwriteBandRule.
-    *
-    * Currently the rules available in OverwriteBandRule are: 
-    *
-    * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten if *any* 
-    * one of the other bands of the same destination pixel have color values 
-    * that deviate from its color. Same as the deprecated COLOR_DISCREPANCY.
-    *
-    * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten only if 
-    * *all* of the other bands of the same destination pixel have color values
-    * that deviate from its color. 
-    *
-    * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten if 
-    * *any* one of the other bands of the same destination pixel have color 
-    * values that are equal to the color of the selected band of the source
-    * pixel. 
-    *
-    * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten only if 
-    * *all* of the other bands of the same destination pixel have color 
-    * values that are equal to the color of the selected band of the source
-    * pixel. 
-    *
-    * The NULL_RULE rule directs that the selected band of the 
-    * destination buffer is to be overwritten by the selected band of the 
-    * source image data (no questions asked).
-    *
-    * @note: The 'dest' buffer should have at least the same number of bands 
-    * as the 'src' object. 
-    *
-    * Currently this routine is only implemented for il_type set to OSSIM_BSQ.
-    *
-    * @param dest      The destination buffer, which should have at least the 
-    * same number of bands as the 'src' object.
-    * @param src_band  The 0-based band of the source image data.
-    * @param dest_band The 0-based band of the dest buffer.
-    * @param dest_rect The rectangle of the destination buffer.
-    * @param il_type   The interleave type. Only OSSIM_BSQ available.
-    * @param ow_type   The rule for overwriting the destination buffer.
-    */
-   virtual void unloadBand( void* dest,
-                            ossim_uint32 src_band,
-                            ossim_uint32 dest_band,
-                            const ossimIrect& dest_rect,
-                            ossimInterleaveType il_type=OSSIM_BSQ,
-                            OverwriteBandRule ow_type=NULL_RULE ) const;
-
-   /**
-    * This routine is designed for overwriting a selected band of the 
-    * destination buffer 'dest' by an independent selected band of the
-    * source buffer according to a user-selected rule, defined by 
-    * OverwriteBandRule.
-    *
-    * Currently the rules available in OverwriteBandRule are: 
-    *
-    * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten if *any* 
-    * one of the other bands of the same destination pixel have color values 
-    * that deviate from its color. Same as the deprecated COLOR_DISCREPANCY.
-    *
-    * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten only if 
-    * *all* of the other bands of the same destination pixel have color values
-    * that deviate from its color. 
-    *
-    * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten if 
-    * *any* one of the other bands of the same destination pixel have color 
-    * values that are equal to the color of the selected band of the source
-    * pixel. 
-    *
-    * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected 
-    * band of a pixel of the destination buffer is to be overwritten only if 
-    * *all* of the other bands of the same destination pixel have color 
-    * values that are equal to the color of the selected band of the source
-    * pixel. 
-    *
-    * The NULL_RULE rule directs that the selected band of the 
-    * destination buffer is to be overwritten by the selected band of the 
-    * source image data (no questions asked).
-    *
-    * @note: The 'dest' buffer should have at least the same number of bands 
-    * as the 'src' object. 
-    *
-    * Currently this routine is only implemented for il_type set to OSSIM_BSQ.
-    *
-    * @param dest      The destination buffer, which should have at least the 
-    * same number of bands as the 'src' object.
-    * @param src_band  The 0-based band of the source image data.
-    * @param dest_band The 0-based band of the dest buffer.
-    * @param dest_rect The rectangle of the destination buffer.
-    * @param clip_rect Only data within will be copied.
-    * @param il_type   The interleave type. Only OSSIM_BSQ available.
-    * @param ow_type   The rule for overwriting the destination buffer.
-    */
-   virtual void unloadBand( void* dest,
-                            ossim_uint32 src_band,
-                            ossim_uint32 dest_band,
-                            const ossimIrect& dest_rect,
-                            const ossimIrect& clip_rect,
-                            ossimInterleaveType il_type=OSSIM_BSQ,
-                            OverwriteBandRule ow_type=NULL_RULE ) const;
-
-   /**
-    * @param dest The destination buffer.  It is assumed this is a single band
-    * and the size of dest_rect.
-    * @param dest_rect The rectangle of the destination buffer.
-    * @param src_band The band to copy (unload) from the tile.
-    */
-   virtual void unloadBand(void* dest,
-                           const ossimIrect& dest_rect,
-                           ossim_uint32 src_band) const;
-
-   /**
-    * @param dest The destination buffer.  It is assumed this is a single band
-    * and the size of dest_rect.
-    * @param dest_rect The rectangle of the destination buffer.
-    * param clip_rect Only data within the clip_rect will be copied.
-    * @param src_band The band to copy (unload) from the tile.
-    */
-   virtual void unloadBand(void* dest,
-                           const ossimIrect& dest_rect,
-                           const ossimIrect& clip_rect,
-                           ossim_uint32 src_band) const;
-   
-   virtual void unloadTile(void* dest,
-                           const ossimIrect& dest_rect,
-                           ossimInterleaveType il_type ) const;
-
-   virtual void unloadTile(void* dest,
-                           const ossimIrect& dest_rect,
-                           const ossimIrect& clip_rect,
-                           ossimInterleaveType il_type) const;
-
-   /**
-    * @param dest The destination buffer.
-    * @param dest_rect The rectangle of the destination buffer.
-    * param clip_rect Only data within the clip_rect will be copied.
-    * @param src_band The band to copy (unload) from the tile.
-    */
-   virtual void unloadTileToBipAlpha(void* dest,
-                                     const ossimIrect& dest_rect,
-                                     const ossimIrect& clip_rect) const;
-   
-   virtual bool isPointWithin(const ossimIpt& point)const;
-   virtual bool isPointWithin(ossim_int32 x,
-                              ossim_int32 y)const;
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief Performs linear stretch on tile data from min/max to limits of
-    * scalar type.
-    */
-   virtual void stretchMinMax();
-
-   /**
-    * @brief Computes the alpha channel.
-    *
-    * For each pixel if any band value is not null then alpha will be 255;
-    * else, 0.
-    */
-   virtual void computeAlphaChannel();
-
-   /**
-    * @brief Method to copy a single line to the tile.
-    *
-    * This will copy a line to the tile.  It is assumed that all bands are in
-    * the buffer "src".  Only pixels within the tile rect will be copied.
-    * Note that all coordinates are relative to the tile coordinates.
-    * Clipping will be performed on pixels outside of the tile rectangle.
-    * No fill is added if a partial tile line is copied so callers
-    * should do a ossimImageData::makeBlank if the whole tile is not to be
-    * stuffed.  ossimImageData::validate should be called after all lines
-    * are copied if in doubt of a full tile.
-    *
-    * @param src The source buffer or line to copy containing all bands.
-    *
-    * @param lineNumber Line number to copy.
-    *
-    * @param lineStartSample The start sample of the source buffer relative
-    * to tile coordinates.
-    *
-    * @param lineStopSample The stop sample of the source buffer relative
-    * to tile coordinates.
-    *
-    * @param lineInterleave Interleave of src buffer.  If OSSIM_BIP assumed
-    * rgbrgbrgb; else, red row, green row, blue row.
-    *
-    * Usage example in method: ossimTiffTileSource::loadFromScanLine
-    */
-   virtual void copyLine(const void* src,
-                         ossim_int32 lineNumber,
-                         ossim_int32 lineStartSample,
-                         ossim_int32 lineStopSample,
-                         ossimInterleaveType lineInterleave);
-
-   /**
-    * @brief Sets the indexed flag.
-    *
-    * This indicates the data contains palette indexes.  Default is false.
-    * 
-    * @param flag If true data is indexed.
-    */
-   void setIndexedFlag(bool flag);
-
-   /** @return The indexed flag. */
-   bool getIndexedFlag() const;
-   
-   /**
-    * Returns the percentage (0-100) of data buffer containing non-null (valid) entries.
-    * Undefined until validate() is called.
-    */
-   ossim_float64 percentFull() const { return m_percentFull; }
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-protected:
-   /** @brief Templated copy line method. */
-   template <class T> void copyLineTemplate(T dummyTemplate,
-                                            const void* src,
-                                            ossim_int32 lineNumber,
-                                            ossim_int32 lineStartSample,
-                                            ossim_int32 lineStopSample,
-                                            ossimInterleaveType lineInterleave);
-   
-   /**
-    * @brief Templated stretch method.
-    *
-    * Performs linear stretches on tile data from min/max to limits of
-    * scalar type.
-    */
-   template <class T> void stretchMinMax(T dummyTemplate);
-
-   /**
-    * @brief Templated compute alpha channel.
-    *
-    * For each pixel if any band value is not null then alpha will be 255;
-    * else, 0.
-    */
-   template <class T> void computeAlphaChannel(T dummyTemplate);   
-
-   /**
-    * Templated validate method.
-    *
-    * @return The status of the ossimImageDataMethod.
-    *
-    * @note See ossimConstants.h for ossimDataObjectStatus enumerations.
-    */
-   template <class T> ossimDataObjectStatus validate(T dummyTemplate) const;
-
-   /**
-    * Templated makeBlank method.
-    */
-   template <class T> void makeBlank(T dummyTemplate);
-
-   /**
-    * Templated computeMeanSquaredError method.
-    */
-   template <class T>
-      ossim_float64 computeMeanSquaredError(T dummyTemplate,
-                                            ossim_float64 meanValue,
-                                            ossim_uint32 bandNumber) const;
-
-   /**
-    * Templated computeAverageBandValue method.
-    */
-   template <class T>
-      ossim_float64 computeAverageBandValue(T dummyTemplate,
-                                            ossim_uint32 bandNumber) const;
-   
-   void loadTileFromBip(const void* src, const ossimIrect& src_rect);
-   void loadTileFromBipAlpha(const void* src, const ossimIrect& src_rect);
-   void loadTileFromBil(const void* src, const ossimIrect& src_rect);
-   void loadTileFromBsq(const void* src, const ossimIrect& src_rect);
-
-   void loadTileFromBip(const void* src,
-                        const ossimIrect& src_rect,
-                        const ossimIrect& clip_rect);
-   void loadTileFromBil(const void* src,
-                        const ossimIrect& src_rect,
-                        const ossimIrect& clip_rect);
-   void loadTileFromBsq(const void* src,
-                        const ossimIrect& src_rect,
-                        const ossimIrect& clip_rect);
-
-   void unloadTileToBip(void* dest,
-                        const ossimIrect& dest_rect,
-                        const ossimIrect& clip_rect) const;
-   void unloadTileToBil(void* dest,
-                        const ossimIrect& dest_rect,
-                        const ossimIrect& clip_rect) const;
-   void unloadTileToBsq(void* dest,
-                        const ossimIrect& dest_rect,
-                        const ossimIrect& clip_rect) const;
-
-   /**
-    * Called from public unloadBand() routines that have an 
-    * OverwriteBandRule interface.
-    *
-    * @param dest      The destination buffer.
-    * @param src_band  The 0-based band of the source image data.
-    * @param dest_band The 0-based band of the destination buffer.
-    * @param dest_rect The rectangle of the destination buffer.
-    * @param clip_rect Only data within will be copied.
-    * @param ow_type   The rule for overwriting the destination buffer.
-    */
-   virtual void unloadBandToBsq( void* dest,
-                                 ossim_uint32 src_band,
-                                 ossim_uint32 dest_band,
-                                 const ossimIrect& dest_rect,
-                                 const ossimIrect& clip_rect,
-                                 OverwriteBandRule ow_type=NULL_RULE ) const;
-
-   /**
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   template <class T>
-   void copyTileToNormalizedBuffer(T dummyTemplate,
-                                   ossim_float64* buf) const;
-   template <class T>
-   void copyTileToNormalizedBuffer(T dummyTemplate,
-                                   ossim_float32* buf)const;
-
-   /**
-    * Will copy this tiles specified band number to the normalized buffer.
-    * if the band is out of range then nothing is done and returns.
-    */
-   template <class T>
-   void copyTileToNormalizedBuffer(T dummyTemplate,
-                                   ossim_uint32 band, ossim_float64* buf) const;
-   template <class T>
-   void copyTileToNormalizedBuffer(T dummyTemplate,
-                                   ossim_uint32 band, ossim_float32* buf)const;
-
-   /**
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   template <class T>
-   void copyNormalizedBufferToTile(T dummyTemplate,
-                                   ossim_float64* buf);
-   template <class T>
-   void copyNormalizedBufferToTile(T dummyTemplate,
-                                   ossim_float32* buf);
-   template <class T>
-   void copyNormalizedBufferToTile(T dummyTemplate,
-                                   ossim_uint32 band,
-                                   ossim_float64* buf);
-   template <class T>
-   void copyNormalizedBufferToTile(T dummyTemplate,
-                                   ossim_uint32 band,
-                                   ossim_float32* buf);
-
-   
-   template <class T>
-   void computeMinMaxPix(T dummyValue,
-                         std::vector<ossim_float64>& minBands,
-                         std::vector<ossim_float64>& maxBands) const;
-
-   template <class T>
-   void computeMinMaxNulPix(T dummyValue,
-                            std::vector<ossim_float64>& minBands,
-                            std::vector<ossim_float64>& maxBands,
-                            std::vector<ossim_float64>& nulBands) const;
-   
-   template <class T> void loadBandTemplate(T, // dummy template variable
-                                            const void* src,
-                                            const ossimIrect& src_rect,
-                                            ossim_uint32 band);
-
-   template <class T> void loadBandTemplate(T, // dummy template variable
-                                            const void* src,
-                                            const ossimIrect& src_rect,
-                                            const ossimIrect& clip_rect,
-                                            ossim_uint32 band);
-
-   template <class T> void nullTileAlphaTemplate(T,
-                                                 const ossim_uint8* src,
-                                                 const ossimIrect& src_rect,
-                                                 const ossimIrect& clip_rect,
-                                                 bool multiplyAlphaFlag=false);
-   
-   template <class T> void loadTileFromBipTemplate(T, // dummy template variable
-                                                   const void* src,
-                                                   const ossimIrect& src_rect);
-   template <class T> void loadTileFromBipAlphaTemplate(T, // dummy template variable
-                                                   const void* src,
-                                                   const ossimIrect& src_rect);
-
-   template <class T> void loadTileFromBipTemplate(T, // dummy template variable
-                                                   const void* src,
-                                                   const ossimIrect& src_rect,
-                                                   const ossimIrect& clip_rect);
-    template <class T>
-    void loadTileFromBipAlphaTemplate(T, // dummy template variable
-                                                 const void* src,
-                                                 const ossimIrect& src_rect,
-                                                 const ossimIrect& clip_rect);
-   
-   template <class T> void loadTileFromBilTemplate(T, // dummy template variable
-                                                   const void* src,
-                                                   const ossimIrect& src_rect);
-   
-   template <class T> void loadTileFromBilTemplate(T, // dummy template variable
-                                                   const void* src,
-                                                   const ossimIrect& src_rect,
-                                                   const ossimIrect& clip_rect);
-   
-   template <class T> void loadTileFromBsqTemplate(T, // dummy template variable
-                                                   const void* src,
-                                                   const ossimIrect& src_rect);
-   
-   template <class T> void loadTileFromBsqTemplate(T, // dummy template variable
-                                                   const void* src,
-                                                   const ossimIrect& src_rect,
-                                                   const ossimIrect& clip_rect);
-   
-   template <class T> void unloadTileToBipTemplate(T, // dummy template variable
-                                                   void* dest,
-                                                   const ossimIrect& dest_rect,
-                                                   const ossimIrect& clip_rect) const;
-
-   template <class T> void unloadTileToBipAlphaTemplate(T, // dummy template variable
-                                                        void* dest,
-                                                        const ossimIrect& dest_rect,
-                                                        const ossimIrect& clip_rect) const;
-
-   template <class T> void unloadTileToBilTemplate(T, // dummy template variable
-                                                   void* dest,
-                                                   const ossimIrect& dest_rect,
-                                                   const ossimIrect& clip_rect) const;
-
-   template <class T> void unloadTileToBsqTemplate(T, // dummy template variable
-                                                   void* dest,
-                                                   const ossimIrect& dest_rect,
-                                                   const ossimIrect& clip_rect) const;
-
-   template <class T> void unloadBandTemplate(T, // dummy template variable
-                                              void* dest,
-                                              const ossimIrect& dest_rect,
-                                              const ossimIrect& clip_rect,
-                                              ossim_uint32 band) const;
-
-   template <class T> void unloadBandToBsqTemplate(T, // dummy template variable
-                                                   void* dest,
-                                                   ossim_uint32 src_band,
-                                                   ossim_uint32 dest_band,
-                                                   const ossimIrect& dest_rect,
-                                                   const ossimIrect& clip_rect,
-                                                   OverwriteBandRule ow_type=NULL_RULE) const;
-
-   /**
-    * @brief Creates a test tile for scalar type for testing only.
-    *
-    * Protected template implementation of matching public createTestTile.
-    */
-   template <class T> void createTestTile(T);
-   
-   /**
-    * @brief initializeDefaults() Resizes and sets min/max/null arrays to
-    * number of bands and some default value for scalar type.
-    */
-   virtual void initializeDefaults();
-
-   /**
-    * @brief initializeMinDefault() Resizes theMinPixelValue array to number
-    * of bands and initializes to the default min for scalar type.
-    */
-   virtual void initializeMinDefault();
-
-   /**
-    * @brief initializeMaxDefault() Resizes theMaxPixelValue array to number
-    * of bands and initializes to the default max for scalar type.
-    */
-   virtual void initializeMaxDefault();
-
-   /**
-    * @brief initializeNullDefault() Resizes theNullPixelValue array to number
-    * of bands and initializes to the default null for scalar type.
-    */
-   virtual void initializeNullDefault();
-
-   virtual bool isEqualTo(const ossimDataObject& rhs,
-                          bool deepTest=false)const;
-   
-   bool hasSameDimensionsAs(ossimImageData* data)const
-   {
-      bool result = false;
-      if(data)
-      {
-         result = ((m_spatialExtents.size() ==
-                    data->m_spatialExtents.size())&&
-                   (m_spatialExtents[0] == data->m_spatialExtents[0])&&
-                   (m_spatialExtents[1] == data->m_spatialExtents[1])&&
-                   (m_scalarType == data->m_scalarType));
-      }
-      return result;
-   }
-   
-   /**  Null pixel value for each band. */
-   std::vector<ossim_float64> m_nullPixelValue;
-
-   /** Min pixel value for each band. */
-   std::vector<ossim_float64> m_minPixelValue;
-
-   /** Max pixel value for each band. */
-   std::vector<ossim_float64> m_maxPixelValue;
-
-   /** Alpha channel */
-   std::vector<ossim_uint8> m_alpha;
-   
-   ossimIpt m_origin;
-
-   /** Indicates data contains palette indexes. */
-   bool m_indexedFlag;
-
-   /** percentage (0-100) of image tile that has valid (non-null) pixel values. This is computed
-    * in validate() method.
-    */
-   mutable ossim_float64 m_percentFull;
-
-private:
-
-   
-TYPE_DATA
-};
-
-inline bool ossimImageData::hasAlpha() const
-{
-   return (m_alpha.size()?true:false);
-}
-
-inline ossimIrect ossimImageData::getImageRectangle() const
-{
-   ossimIpt lr(m_origin.x + getWidth()  - 1,
-               m_origin.y + getHeight() - 1);
-   
-   return ossimIrect(m_origin, lr);
-}
-
-inline const ossim_float64* ossimImageData::getNullPix()const
-{
-   return ( m_nullPixelValue.size() > 0 ? &m_nullPixelValue.front() : 0 );
-}
-
-inline const ossim_float64* ossimImageData::getMinPix()const
-{
-   return ( m_minPixelValue.size() > 0 ? &m_minPixelValue.front() : 0 );
-}
-
-inline const ossim_float64* ossimImageData::getMaxPix()const
-{
-   return ( m_maxPixelValue.size() > 0 ? &m_maxPixelValue.front() : 0 );
-}
-
-inline ossim_float64 ossimImageData::getNullPix(ossim_uint32 band) const
-{
-   return ( band < m_nullPixelValue.size() ? m_nullPixelValue[band] :
-            ossim::defaultNull( getScalarType() ) );
-}
-      
-inline ossim_float64 ossimImageData::getMinPix(ossim_uint32 band) const
-{
-   return ( band < m_minPixelValue.size() ? m_minPixelValue[band] :
-            ossim::defaultMin( getScalarType() ) );
-}
-
-inline ossim_float64 ossimImageData::getMaxPix(ossim_uint32 band) const
-{
-   return ( band < m_maxPixelValue.size() ? m_maxPixelValue[band] :
-            ossim::defaultMax( getScalarType() ) );
-}
-
-inline ossim_uint32 ossimImageData::getHashId()const
-{
-   const unsigned char *bufx = (unsigned char*)(&m_origin.x);
-   const unsigned char *bufy = (unsigned char*)(&m_origin.y);
-   return (ossim_uint32)(bufx[0]*101 + bufx[1]*103 +
-                         bufx[2]*107 + bufx[3]*109 +
-                         bufy[0]*139 + bufy[1]*149 +
-                         bufy[2]*151 + bufy[3]*157);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageDataFactory.h b/ossim/include/ossim/imaging/ossimImageDataFactory.h
deleted file mode 100644
index 54e878b..0000000
--- a/ossim/include/ossim/imaging/ossimImageDataFactory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description:
-//
-//*************************************************************************
-// $Id: ossimImageDataFactory.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageDataFactory_HEADER
-#define ossimImageDataFactory_HEADER
-
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <OpenThreads/Mutex>
-class ossimSource;
-class ossimImageSource;
-
-
-/*!
- * This factory should be called by all image source producers to allocate
- * an image tile.
- */
-class OSSIM_DLL ossimImageDataFactory
-{
-public:
-   virtual ~ossimImageDataFactory();
-   static ossimImageDataFactory* instance();
-
-   virtual ossimRefPtr<ossimImageData> create(ossimSource* owner,
-                                              ossimScalarType scalar,
-                                              ossim_uint32 bands = 1)const;
-
-   virtual ossimRefPtr<ossimImageData> create(ossimSource* owner,
-                                              ossimScalarType scalar,
-                                              ossim_uint32 bands,
-                                              ossim_uint32 width,
-                                              ossim_uint32 height)const;
-   
-   virtual ossimRefPtr<ossimImageData> create(
-      ossimSource* owner,
-      ossim_uint32 bands,
-      ossimImageSource* inputSource)const;
-   
-   
-   virtual ossimRefPtr<ossimImageData> create(
-      ossimSource* owner,
-      ossimImageSource* inputSource)const;
-   
-protected:
-   ossimImageDataFactory(); // hide
-   ossimImageDataFactory(const ossimImageDataFactory&){}//hide
-   void operator = (ossimImageDataFactory&){}// hide
-   
-   static ossimImageDataFactory* theInstance;
-   static OpenThreads::Mutex theInstanceMutex;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageFileWriter.h b/ossim/include/ossim/imaging/ossimImageFileWriter.h
deleted file mode 100644
index 7163d1a..0000000
--- a/ossim/include/ossim/imaging/ossimImageFileWriter.h
+++ /dev/null
@@ -1,499 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Frank Warmerdam (warmerdam at pobox.com)
-//
-// Description:
-//
-// Contains class declaration for ossimImageWriter
-//*******************************************************************
-//  $Id: ossimImageFileWriter.h 21963 2012-12-04 16:28:12Z dburken $
-
-#ifndef ossimImageFileWriter_HEADER
-#define ossimImageFileWriter_HEADER
-#include <fstream>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/imaging/ossimImageWriter.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimObjectEvents.h>
-#include <ossim/base/ossimProcessProgressEvent.h>
-#include <ossim/base/ossimViewController.h>
-
-/**
- * Pure virtual base class for image file writers.
- *
- * There is normally one subclass of this class for each format supported
- * for writing.  This class roughly corresponds to the ImageHandler class
- * used for reading images.  Format specific ossimImageWriter's are normally
- * instantiated by the ossimImageWriterFactory::createWriterInstance() method.
- * ossimImageWriters should not be directly instantiated by application code.
- */
-class OSSIMDLLEXPORT ossimImageFileWriter
-   :  public ossimImageWriter,
-      public ossimProcessInterface,
-      public ossimConnectableObjectListener
-{   
-public:
-
-   /**
-    * The writer will own the sequencer.
-    */
-   ossimImageFileWriter(const ossimFilename& filename = ossimFilename(),
-                        ossimImageSource* inputSource=0,
-                        ossimObject* owner=0);
-   virtual ~ossimImageFileWriter();
-   
-   
-   virtual ossimObject* getObject();
-
-   virtual const ossimObject* getObject()const;
-
-   /**
-    * void getImageTypeList(std::vector<ossimString>& imageTypeList)const
-    *
-    * pure virtual
-    * 
-    * Appends the writers image types to the "imageTypeList".
-    * 
-    * This is the actual image type name.  So for
-    * example, ossimTiffWriter has several image types.  Some of these
-    * include TIFF_TILED, TIFF_TILED_BAND_SEPARATE ... etc.
-    * The ossimGdalWriter
-    * may include GDAL_IMAGINE_HFA, GDAL_RGB_NITF, GDAL_JPEG20000, ... etc.
-    *
-    * @param imageTypeList stl::vector<ossimString> list to append to.
-    *
-    * @note All writers should append to the list, not, clear it and then add
-    * their types.
-    */
-   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const=0;
-
-   /**
-    * Returns a 3-letter extension from the image type descriptor 
-    * (theOutputImageType) that can be used for image file extensions.
-    *
-    * @param imageType string representing image type.
-    *
-    * @return the 3-letter string extension.
-    */
-   virtual ossimString getExtension() const;
-
-   /**
-    * Examples of writers that always generate internal
-    * overviews are ossim_kakadu_jp2 and ossim_kakadu_nitf_j2k.
-    *
-    * @return true if the output of the writer will have
-    * internal overviews. The default is false. 
-    */
-   virtual bool getOutputHasInternalOverviews( void ) const;
-
-   /**
-    * bool hasImageType(const ossimString& imageType) const
-    *
-    * @param imageType string representing image type.
-    *
-    * @return true if "imageType" is supported by writer.
-    */
-   virtual bool hasImageType(const ossimString& imageType) const;
-
-   /**
-    * Sets the output image tiling size if supported by the writer.  If not
-    * supported this simply sets the sequencer(input) tile size.
-    */
-   virtual void setTileSize(const ossimIpt& tileSize);
-
-   /**
-    * Will write an envi header file.  If "theFilename" is "foo.tif"
-    * then this will write out "foo.hdr".
-    */
-   virtual bool writeEnviHeaderFile() ;
-
-   /**
-    * Will write an ER Mapper header file.  If "theFilename" is "foo.tif"
-    * then this will write out "foo.hdr".
-    */
-   virtual bool writeErsHeaderFile() ;
-
-   /**
-    * Will write an external geometry file.  If "theFilename" is "foo.tif"
-    * then this will write out "foo.geom".
-    */
-   virtual bool writeExternalGeometryFile() ;
-
-   /**
-    * Will write an fgdc file.  If "theFilename" is "foo.tif"
-    * then this will write out "foo.xml".
-    */
-   virtual bool writeFgdcFile() ;
-
-   /**
-    * Returns true on success, false on error.
-    */
-   virtual bool writeHistogramFile() ;
-
-   /**
-    * Will write a jpeg world file.  If "theFilename" is "foo.tif"
-    * then this will write out "foo.jpw".
-    */
-   virtual bool writeJpegWorldFile() ;
-
-   /**
-    * Write out an ossim overview file from the source_file.
-    * If source file is "foo.tif", this will create a "foo.ovr" in
-    * the same directory.
-    *
-    * @param source_file The file to create overview from.
-    *
-    * @param tiff_compress_type valid types:
-    * - COMPRESSION_JPEG
-    * - COMPRESSION_DEFLATE
-    * - COMPRESSION_PACKBITS
-    * - COMPRESSION_NONE=1 (default)
-    *
-    * @param jpeg_compress_quality Compression quality.  Only valid with
-    * COMPRESSION_JPEG. Range 1 to 100 with 100 being the best.
-    * default = 75
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool writeOverviewFile(ossim_uint16 tiff_compress_type = 1,
-                                  ossim_int32 jpeg_compress_quality = 75,
-                                  bool includeR0 = false );
-
-   /**
-    * Will write a readme file.  If "theFilename" is "foo.tif"
-    * then this will write out "foo_readme.txt".
-    */
-   virtual bool writeReadmeFile() ;
-
-   /**
-    * Will write a world file.  If "theFilename" is "foo.tif"
-    * then this will write out "foo.tfw".
-    */
-   virtual bool writeTiffWorldFile() ;
-
-   /**
-    * Will write a world file.  The extension will be derived from the
-    * image extension.
-    *
-    * Currently handles the following image extentions:
-    * 
-    * "tif" or "tiff" -> "tfw"
-    * "jpg" of "jpeg" -> "jpw"
-    * "png" -> "pgw"
-    * "sid" -> "sdw"
-    *
-    * If extension does not match one of the above no file will be written
-    * and false will be returned.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool writeWorldFile() ;
-
-   /**
-    * Convenience method that calls meta data write methods that are flagged
-    * to be called.  Attempts to write all files flagged to be written even
-    * if one file writer returns false.
-    *
-    * Currently calls these methods if flagged:
-    * writeEnviHeaderFile
-    * writeExternalGeometryFile
-    * writeFgdcFile
-    * writeJpegWorldFile
-    * writeReadmeFile
-    * writeTiffWorldFile
-    * writeOverviewFile
-    * writeHistogramFile
-    *
-    * @return true if all files flagged are written, false if not.
-    */
-   virtual bool writeMetaDataFiles() ;
-
-   virtual void setAreaOfInterest(const ossimIrect& inputRect);
-
-   /**
-    * @brief Sets the sequencer and connects it to the input of this.
-    *
-    * This does not set the area of interest.  Note stored as an ossimRefPtr.
-    *
-    * @param sequencer Pointer to a sequencer.
-    */
-   virtual void changeSequencer(ossimImageSourceSequencer* sequencer);
-
-   virtual ossimImageSourceSequencer* getSequencer();
-
-   /**
-    * @brief Initialize method.
-    *
-    * Calls theInputConnection->initialize() then syncs area of interest(AOI)
-    * with ossimImageWriter::theAreaOfInterest taking precedence over
-    * ossimImageSourceSequencer::theAreaOfInterest.
-    */
-   virtual void initialize();
-
-   /**
-    * Calls:
-    * writeFile()
-    * writeMetaDataFiles()
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool execute();
-
-   /**
-    * @brief Method to write the image to a stream.
-    *
-    * This implementation does nothing and returns false.
-    * Derived classed should implement as needed.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool writeStream();
-
-   /**
-    * @brief Sets the output stream to write to.
-    *
-    * This implementation in this class does nothing and returns false.
-    * Derived classed should implement as needed.
-    *
-    * @param stream The stream to write to.
-    *
-    * @return true if object can write to stream, false if not.
-    */
-   virtual bool setOutputStream(ossimRefPtr<ossimOStream> stream);
-
-   /** tmp drb */
-   virtual bool setOutputStream(std::ostream& str);
-
-   /**
-    * @brief Method to return the stream attached to output.
-    *
-    * This implementation in this class does nothing and returns an empty
-    * ossimRefPtr<ossimOStream>.
-    * Derived classed should implement as needed.
-    * 
-    * @return The stream wrapped around a ref pointer.
-    */
-   virtual ossimRefPtr<ossimOStream> getOutputStream() const;
-   
-   virtual void setPercentComplete(double percentComplete);
-
-   virtual void  setOutputImageType(ossim_int32 type);
-   virtual void  setOutputImageType(const ossimString& type);
-   virtual ossim_int32 getOutputImageType() const;
-   virtual ossimString getOutputImageTypeString() const;
-   
-   virtual void setOutputName(const ossimString& outputName);
-
-   virtual void setFilename(const ossimFilename& file);
-
-   virtual const ossimFilename& getFilename()const;
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-
-   virtual bool canConnectMyInputTo(ossim_int32 inputIndex,
-                                    const ossimConnectableObject* object)const;
-   
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-   virtual void propertyEvent(ossimPropertyEvent& event);
-
-   /**
-    * Control flags...
-    */
-
-   virtual bool         getWriteImageFlag()            const;
-   virtual bool         getWriteHistogramFlag()        const;
-   virtual bool         getWriteOverviewFlag()         const;
-   virtual bool         getScaleToEightBitFlag()       const;
-
-   virtual bool         getWriteEnviHeaderFlag()       const;
-   virtual bool         getWriteErsHeaderFlag()        const;   
-   virtual bool         getWriteExternalGeometryFlag() const;
-   virtual bool         getWriteFgdcFlag()             const;
-   virtual bool         getWriteJpegWorldFileFlag()    const;
-   virtual bool         getWriteReadmeFlag()           const;
-   virtual bool         getWriteTiffWorldFileFlag()    const;
-   virtual bool         getWriteWorldFileFlag()        const;
-
-   virtual void         setWriteImageFlag(bool flag);
-   virtual void         setWriteOverviewFlag(bool flag);
-   virtual void         setWriteHistogramFlag(bool flag);
-   virtual void         setScaleToEightBitFlag(bool flag);
-
-   virtual void         setWriteEnviHeaderFlag(bool flag);
-   virtual void         setWriteErsHeaderFlag(bool flag); 
-   virtual void         setWriteExternalGeometryFlag(bool flag);
-   virtual void         setWriteFgdcFlag(bool flag);
-   virtual void         setWriteJpegWorldFile(bool flag);
-   virtual void         setWriteReadme(bool flag);
-   virtual void         setWriteTiffWorldFile(bool flag);
-   virtual void         setWriteWorldFile(bool flag);
-   
-   virtual ossim_uint16 getOverviewCompressType() const;
-   virtual ossim_int32  getOverviewJpegCompressQuality() const;
-
-   virtual void         setOverviewCompressType(ossim_uint16 type);
-   virtual void         setOverviewJpegCompressQuality(ossim_int32 quality);
-
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * Overrides base "addListener" this will capture the pointer and then call
-    * the base class "addListener".  If overview building is enabled, the
-    * listener will be passed to the overview builder::addListener, and
-    * subsequently removed from the overview builder after the build overview
-    * call is complete.  This it transparent to the caller of this method.
-    *
-    * @param listener The listener to add.
-    *
-    * @return Currently always returns true.
-    *
-    * @note Callers still should call "removeListener" after the writing
-    * process is complete.
-    *
-    * @note If called more than once, theProgressListener will contain
-    * the latest listener.
-    */
-   virtual bool addListener(ossimListener* listener);
-
-   /**
-    * Overrides base "removeListener".  Calls base "removeListener which will
-    * find and removes the listener.
-    * If "theProgressListener" pointer matches listener "theProgressListener"
-    * will be set to NULL.
-    *
-    * @param listener The listener to remove.
-    *
-    * @return Currently always returns true.
-    */
-   virtual bool removeListener(ossimListener* listener);
-
-   /**
-    * If "point" the coordinate tie points are relative to the center of the
-    * pixel.  If "area" the coordinate tie points are relative to the upper
-    * left corner of the pixel.
-    *
-    * For image types that are keyed, tiff for instance, this will set the
-    * geotiff key: GTRasterTypeGeoKey
-    *
-    * If meta data writers are enabled, world file writers for instance,
-    * this will also be propagated to them.
-    *
-    * Default in this writer is:  OSSIM_PIXEL_IS_POINT
-    * 
-    * @param type
-    * OSSIM_PIXEL_IS_POINT = center of pixel
-    * OSSIM_PIXEL_IS_AREA  = upper left corner of pixel
-    */
-   virtual void setPixelType(ossimPixelType type);
-
-   /**
-    * If "point" the coordinate tie points are relative to the center of the
-    * pixel.  If "area" the coordinate tie points are relative to the upper
-    * left corner of the pixel.
-    *
-    * For image types that are keyed, tiff for instance, this will set the
-    * geotiff key: GTRasterTypeGeoKey
-    *
-    * If meta data writers are enabled, world file writers for instance,
-    * this will also be propagated to them.
-
-    * Default in this writer is:  OSSIM_PIXEL_IS_POINT
-    * 
-    * @param type
-    * "point" = center of pixel
-    * "area"  = upper left corner of pixel
-    *
-    * @note If the downcased "type" is not equal to "point" or "area" pixel
-    * type will remain unchanged.
-    */
-   virtual void setPixelType(const ossimString& type);
-
-   /**
-    * @return The pixel type as either OSSIM_PIXEL_IS_POINT or
-    * OSSIM_PIXEL_IS_AREA.
-    */
-   virtual ossimPixelType getPixelType() const;
-   
-   /**
-    * @param type ossimString to initialize which will either be "point" or
-    * "area".
-    */
-   virtual void getPixelTypeString(ossimString& type) const;
-   
-protected:
-
-   /**
-    * Common world file writer method.
-    *
-    * @param file The file to write like "foo.tfw" or "foo.jpw".
-    *
-    * @return true on success, false on error.
-    */
-   bool writeWorldFile(const ossimFilename& file);
-   
-   /**
-    * Write out the file.
-    * @return true on success, false on error.
-    */
-   virtual bool writeFile() = 0;
-   
-   ossimRefPtr<ossimImageSourceSequencer> theInputConnection;
-   ossimRefPtr<ossimViewController>       theViewController;
-   ossimListener*             theProgressListener;
-   ossimFilename              theFilename;
-   ossimString                theOutputImageType;
-   bool                       theWriteImageFlag;
-   bool                       theWriteOverviewFlag;
-   bool                       theWriteHistogramFlag;
-   bool                       theScaleToEightBitFlag;
-   ossim_uint16               theOverviewCompressType;
-   ossim_int32                theOverviewJpegCompressQuality;
-
-   /**
-    * External meta data writer flags.  Not really part of an image writer, put
-    * here for convenience.  If true the writer will do the connection work
-    * for you.
-    */
-   bool                       theWriteEnviHeaderFlag;
-   bool                       theWriteErsHeaderFlag; 
-   bool                       theWriteExternalGeometryFlag;
-   bool                       theWriteFgdcFlag;
-   bool                       theWriteJpegWorldFileFlag;
-   bool                       theWriteReadmeFlag;
-   bool                       theWriteTiffWorldFileFlag;
-   bool                       theWriteWorldFileFlag;
-   bool                       theAutoCreateDirectoryFlag;
-   
-   /**
-    * If not a geographic projection this allows the user to set the linear
-    * units of the output tag to be:
-    * 
-    * meters (default)
-    * us_survey_feet
-    * feet
-    *
-    * This will be propagated to writers that can switch types and to the
-    * associated metadata writers.
-    */
-   ossimUnitType              theLinearUnits;
-
-   /** OSSIM_PIXEL_IS_POINT = 0, OSSIM_PIXEL_IS_AREA  = 1 */
-   ossimPixelType             thePixelType;
-   
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/imaging/ossimImageGaussianFilter.h b/ossim/include/ossim/imaging/ossimImageGaussianFilter.h
deleted file mode 100644
index 2e975b0..0000000
--- a/ossim/include/ossim/imaging/ossimImageGaussianFilter.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//*******************************************************************
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// class ossimImageGaussianFilter : tile source
-//*******************************************************************
-// $Id: ossimImageGaussianFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageGaussianFilter_HEADER
-#define ossimImageGaussianFilter_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/imaging/ossimConvolutionFilter1D.h>
-
-/**
- * class for symmetric Gaussian filtering
- * implemented as two separable horizontal/vertical gaussian filters
- *
- * PROPERTIES:
- * -GaussStd is the standard deviation of the gaussian
- *  (filter widths are equal to 2*floor(2.5*GaussStd+0.5)+1)
- * -strictNoData selects the behaviour for NODATA pixels
- *   true  : any NODATA pixels in the convolution will Nullify the center pixel
- *   false : center pixel will be NODATA only if it was NODATA before 
- *     other NODATA pixels are processed as zero in the convolution calculation
- */
-class OSSIM_DLL ossimImageGaussianFilter : public ossimImageSourceFilter
-{
-public:
-  /** 
-   * own methods
-   */
-   ossimImageGaussianFilter();
-
-   inline ossim_float64 getGaussStd()const { return theGaussStd; }
-   void setGaussStd(const ossim_float64& v);
-
-   inline bool isStrictNoData()const { return theStrictNoData; }
-   void setStrictNoData(bool aStrict);
-
-  /** 
-   * inherited methods
-   */
-   virtual void initialize();
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect &tileRect,ossim_uint32 resLevel=0);
-
-   virtual void connectInputEvent(ossimConnectionEvent &event);
-   virtual void disconnectInputEvent(ossimConnectionEvent &event);
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,const char* prefix = 0);   
-   virtual bool saveState(ossimKeywordlist& kwl,const char* prefix = 0)const;
-   
-protected:
-   virtual ~ossimImageGaussianFilter();
-  /**
-   * protected methods
-   */
-   void initializeProcesses();
-   void updateKernels();
-
-  /**
-   * parameters
-   */
-   ossim_float64 theGaussStd;
-   bool          theStrictNoData;
-
-  /**
-   * subprocesses
-   */
-   ossimRefPtr<ossimConvolutionFilter1D> theHF; //horizontal filter
-   ossimRefPtr<ossimConvolutionFilter1D> theVF; //vertical filter
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageGaussianFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageGeometry.h b/ossim/include/ossim/imaging/ossimImageGeometry.h
deleted file mode 100644
index 0f69fb7..0000000
--- a/ossim/include/ossim/imaging/ossimImageGeometry.h
+++ /dev/null
@@ -1,473 +0,0 @@
-//***********************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer (oscarkramer at yahoo.com)
-//
-// Description: Class declaration of ossimImageGeometry.
-//
-//***********************************************************************************************
-// $Id: ossimImageGeometry.h 3102 2012-01-18 15:30:20Z oscar.kramer $
-
-#ifndef ossimImageGeometry_HEADER
-#define ossimImageGeometry_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/base/ossim2dTo2dTransform.h>
-#include <vector>
-#include <ossim/matrix/newmat.h>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimAdjustableParameterInterface.h>
-
-// Forward class declarations:
-class ossimDrect;
-class ossimIrect;
-class ossimGrect;
-
-//***********************************************************************************************
-//! Container class that holds both 2D transform and 3D projection information for an image
-//! Only one instance of this is alive per image. This is  the object that is returned from
-//! a call to ossimImageSource::getImageGeometry()
-//! 
-//! All images in OSSIM have at least a 2D transformation from local (relative to start of file)
-//! to full-image coordinates. Often this transform is an identity transform (does nothing). In 
-//! some cases however, the first pixel in the file does not correspond to the upper-left pixel of
-//! the original, full image. Since the image's sensor model may only apply to full-image pixel 
-//! coordinates, it is necessary to reference the latter when making computing ground point 
-//! location.  Also the local image could be a reduced resolution level of the full image.  So
-//! the image could be a decimated sub image of the full image.
-//!
-//! Additionally, images typically are accompanied by some form of metadata that defines the mapping
-//! from 2D image coordinates to 3D world coordinates. This mapping may be in the form of a map
-//! projection for orthorectified images, or a perspective projection such as a sensor model.
-//! 
-//! This object class maintains both 2D transform and 3D projection information for the associated
-//! image. This object will typically be created and "owned" by the image handler object. Therefore,
-//! only one copy per image will exist at a time.
-//!
-//! Notes:
-//! 1) Shifts are relative to "full image space".  So if you have a sub image from r2 the shift
-//!    given to the transform should be relative to "full image space".
-//
-//! 2) A decimation of 1.0 is the full image.  This may or may not be r0 as r0 can be decimated.
-//!
-//***********************************************************************************************
-class OSSIM_DLL ossimImageGeometry : public ossimObject
-{
-public:
-   typedef std::vector<ossim_float64> DeltaParamList;
-   
-   //! Default constructor defaults to unity transform with no projection.
-   ossimImageGeometry();
-   virtual ~ossimImageGeometry();
-   
-   //! Copy constructor -- performs a deep copy. This is needed when an imageSource in the chain
-   //! needs to modify the image geometry at that point in the chain. The image geometry to the 
-   //! left of that imageSource must remain unchanged. This constructor permits that imageSource to 
-   //! maintain its own geometry based on the input geometry. All chained objects to the right
-   //! would see this alternate geometry. See ossimScaleFilter for an example of this case.
-   ossimImageGeometry(const ossimImageGeometry& copy_this);
-
-   //! Constructs with projection and transform objects available for referencing. Either pointer
-   //! can be NULL -- the associated mapping would be identity.
-   ossimImageGeometry(ossim2dTo2dTransform* transform, ossimProjection* projection);
-
-   //! rnToRn is a utility method that takes a rn resolution image point and maps it to the another
-   //! rn resolution image point.
-   //!
-   //! @param inRnPt Is a point in resolution n.
-   //! @param inResolutionLevel Is the resolution of the point inRnPt.
-   //! @param outResolutionLevel Is the resolution of the point outRnPt.
-   //! @param outRnPt Is the result of the transform.
-   //!
-   void rnToRn(const ossimDpt& inRnPt, ossim_uint32 inResolutionLevel,
-               ossim_uint32 outResolutionLevel,ossimDpt& outRnPt) const;
-   
-   //! rnToFull is a utility method that takes a rn resolution image point and maps it to the full
-   //! image point.
-   //!
-   //! @param rnPt Is a point in resolution n.
-   //! @param resolutionLevel Is the resolution of the point rnPt.  a value of 0 is the local image
-   //! @param fullPt Is the result of the transform
-   //!
-   void rnToFull(const ossimDpt& rnPt, ossim_uint32 resolutionLevel, ossimDpt& fullPt) const;
-
-   //! @brief fullToRn is a utility method that takes a full image point and maps it to a rn
-   //! resolution image point.
-   //! 
-   //! @param fullPt Is a point in full image space.
-   //! @param resolutionLevel Is the resolution of the point rnPt. A value of 0 is the local image.
-   //! @param fullPt Is the result of the transform
-   void fullToRn(const ossimDpt& fullPt, ossim_uint32 resolutionLevel, ossimDpt& rnPt) const;
-
-   //! rnToWorld is a utility method that takes a rn resolution image point and maps it to the 
-   //! world point.
-   //!
-   //! @param rnPt Is a point in resolution n.
-   //! @param resolutionLevel Is the resolution of the point rnPt.  a value of 0 is the local image
-   //! @param wpt Is the result of the transform
-   //!
-   void rnToWorld(const ossimDpt& rnPt, ossim_uint32 resolutionLevel, ossimGpt& wpt) const;
-   
-   //! worldToRn is a utility method that takes a world point allows one to transform all the way back to
-   //! an rn point.
-   //!
-   //! @param wpt Ground point.
-   //! @param resolutionLevel Is the resolution of the point rnPt.  a value of 0 is the local image
-   //! @param rnPt Is the resoltion point.
-   //!
-   void worldToRn(const ossimGpt& wpt, ossim_uint32 resolutionLevel, ossimDpt& rnPt) const;
-
-   //! Exposes the 3D projection from image to world coordinates. The caller should verify that
-   //! a valid projection exists before calling this method. Returns TRUE if a valid ground point
-   //! is available in the ground_pt argument. This method depends on the existence of elevation
-   //! information. If no DEM is available, the results will be incorrect or inaccurate.
-   bool localToWorld(const ossimDpt& local_pt, ossimGpt& world_pt) const;
-
-   //! Exposes the 3D projection from image to world coordinates given a constant height above 
-   //! ellipsoid. The caller should verify that a valid projection exists before calling this
-   //! method. Returns TRUE if a valid ground point is available in the ground_pt argument.
-   bool localToWorld(const ossimDpt& local_pt, const double& h_ellipsoid, ossimGpt& world_pt) const;
-
-   //! Exposes the 3D world-to-local image coordinate reverse projection. The caller should verify 
-   //! that a valid projection exists before calling this method. Returns TRUE if a valid image 
-   //! point is available in the local_pt argument.
-   bool worldToLocal(const ossimGpt& world_pt, ossimDpt& local_pt) const;
-
-   //! Sets the transform to be used for local-to-full-image coordinate transformation
-   void setTransform(ossim2dTo2dTransform* transform);
-
-   //! Sets the projection to be used for local-to-world coordinate transformation
-   void setProjection(ossimProjection* projection);
-
-   //! Access methods for transform (may be NULL pointer).
-   const ossim2dTo2dTransform* getTransform() const { return m_transform.get(); }
-   ossim2dTo2dTransform*       getTransform()       { return m_transform.get(); }
-
-   //! Access methods for projection (may be NULL pointer).
-   const ossimProjection* getProjection() const { return m_projection.get(); }
-   ossimProjection*       getProjection()       { return m_projection.get(); }
-
-   /**
-    * @return const ossimMapProjection* or NULL if projection not set or not
-    * derived from ossimMapProjection.
-    */
-   const ossimMapProjection* getAsMapProjection() const
-   { return dynamic_cast<const ossimMapProjection*>( m_projection.get() ); }
-
-   /**
-    * @return ossimMapProjection* or NULL if projection not set or not
-    * derived from ossimMapProjection.
-    */
-   ossimMapProjection*       getAsMapProjection()
-   { return dynamic_cast<ossimMapProjection*>( m_projection.get() ); }
-
-   //! Returns TRUE if valid projection defined
-   bool hasProjection() const { return m_projection.valid(); }
-   
-   //! Returns TRUE if valid transform defined
-   bool hasTransform() const { return m_transform.valid(); }
-
-   //! Returns TRUE if this geometry is sensitive to elevation
-   bool isAffectedByElevation() const;
-
-   //! Returns the GSD associated with this image in the active projection. Note that this only
-   //! makes sense if there is a projection associated with the image. Returns NaNs if no 
-   //! projection defined.
-   ossimDpt getMetersPerPixel() const;
-
-   /**
-    * @brief Get the ground sample distance(GSD) associated with this image
-    * in the active projection.
-    *
-    * GSD is taken from projection if there is no transform set; else,
-    * taken from three localToWorld calls (one pixel apart) at the image
-    * center.  If the projection or the image size(if needed) is not set the
-    * point will be set to NaNs.
-    * 
-    * @param gsd Point to intialize with GSD.
-    * 
-    * @note This only makes sense if there is a projection associated with
-    * the image.
-    *
-    * @note Result should be checked for NaNs after call.
-    */
-   void getMetersPerPixel( ossimDpt& gsd ) const;
-
-   //! Returns the resolution of this image in degrees/pixel. Note that this only
-   //! makes sense if there is a projection associated with the image. Returns NaNs if no 
-   //! projection defined.
-   ossimDpt getDegreesPerPixel() const;
-
-   /**
-    * @brief Get the resolution of this image in degrees/pixel.
-    *
-    * Degrees/pixel is taken from projection if there is no transform set;
-    * else, taken from three localToWorld calls (one pixel apart) at the image
-    * center.  If the projection or the image size(if needed) is not set the
-    * point will be set to NaNs.
-    * 
-    * @param dpp Point to intialize with degrees/pixel.
-    * 
-    * @note This only makes sense if there is a projection associated with
-    * the image.
-    *
-    * @note Result should be checked for NaNs after call.
-    */
-   void getDegreesPerPixel( ossimDpt& dpp ) const;
-
-   //! Assigns the ossimGpts with the ground coordinates of the four corresponding image 
-   //! corner points. Returns true if points are valid.
-   bool getCornerGpts(ossimGpt& ul, ossimGpt& ur, ossimGpt& lr, ossimGpt& ll) const;
-
-   /**
-    * @brief Get the latitude, longitude of the tie point.
-    *
-    * This is the bounding upper left point of the image which is not
-    * necessarily the image (0, 0) point.
-    * 
-    * @param tie ossimGpt to assign.
-    *
-    * @param edge If true the tie point is shifted up and to the right by
-    * half the gsd.
-    *
-    * @note Requires projection and image size to be initialized or the
-    * latitude and longitue will be set to nan.
-    *
-    * @note The height parameter of the ossimGpt is not touched by this method.
-    */
-   void getTiePoint(ossimGpt& tie, bool edge) const;
-
-   /**
-    * @brief Get the easting, northing of the tie point.
-    *
-    * This is the bounding upper left point of the image which is not
-    * necessarily the image (0, 0) point.
-    * 
-    * @param tie ossimDpt to assign.
-    *
-    * @param edge If true the tie point is shifted up and to the right by
-    * half the gsd.
-    * 
-    * @note Requires projection and image size to be initialized or the
-    * easting and northing will be set to nan.
-    */
-   void getTiePoint(ossimDpt& tie, bool edge) const;
-
-   //! Prints contents to output stream.
-   std::ostream& print(std::ostream& out) const;
-
-   //! Returns TRUE if argument geometry has exactly the same instances for transform and 
-   //! m_projection. This should be expanded to permit different instances of same transforms
-   bool operator==(const ossimImageGeometry& compare_this) const;
-
-   //! Replaces any existing transform and projection with those in the copy_this object
-   const ossimImageGeometry& operator=(const ossimImageGeometry& copy_this);
-
-   //! Returns the decimation factor from R0 for the resolution level specified. For r_index=0, the 
-   //! decimation factor is by definition 1.0. For the non-discrete case, r_index=1 returns a 
-   //! decimation of 0.5. If the vector of discrete decimation factors (m_decimationFactors) is 
-   //! empty, the factor will be computed as f=1/2^n
-   ossimDpt decimationFactor(ossim_uint32 r_index) const;
-
-   /**
-    * @brief Method to get the decimation factor for a given resolution
-    * level.
-    *
-    * If the array of decimations is not initialized by owner, the default is:
-    * r_index=0 is by definition 1.0.
-    * r_index=n Where n is some level the factor will be computed as f=1/2^n.
-    *
-    * @param resLevel Reduced resolution set for requested decimation.
-    *
-    * @param result ossimDpt to initialize with requested decimation.
-    */
-   void decimationFactor(ossim_uint32 r_index, ossimDpt& result) const;
-
-   /**
-    * @brief Gets array of all decimation levels.
-    * @param decimations Array to initialiaze.
-    */
-   void decimationFactors(std::vector<ossimDpt>& decimations) const;
-
-   //! Sets the decimation scheme to a discrete list of decimation factors.
-   void setDiscreteDecimation(const std::vector<ossimDpt>& decimation_list) 
-      { m_decimationFactors = decimation_list; }
-
-   //! @return The number of decimation factors
-   ossim_uint32 getNumberOfDecimations()const
-   {
-      return (ossim_uint32)m_decimationFactors.size();
-   }
-   void setImageSize(const ossimIpt& size)
-   {
-      m_imageSize = size;
-   }
-   const ossimIpt& getImageSize()const
-   {
-      return m_imageSize;
-   }
-
-   bool getCrossesDateline()const;
-   
-   /**
-   * This is the first stage implementation.   It will determine if it crosses the dateline
-   * and do a special multi polygon for the ossimPolyArea2d result.  For each edge
-   * of the image we walk "partitions" number of points.   If we cross a dateline we calculate
-   * the crossing lat by using the parametric form of the equation.   For example, if we
-   * are crossing from positive to negative that means we are going through the 180 degree lon
-   * location and we will need to solve for the paramtetric parameter t and plug back into the parametric
-   * equation to solve for the latitude.  Basic form:  start + (end-start)*t = 180.  If we are coming from
-   * negative to positive then we solve basic form: start + (end-start)*t = -180.  Where deltaPoint is (end-start) 
-   *
-   *                   ossim_float64 t = ((180-start.x)/deltaPoint.x);
-   *                   ossim_float64 lat = (start.y+deltaPoint.y*t);
-   *
-   * If we do not cross the dateline then if the image is affected by elevation (i.e. a sensor model) then we use the partitions
-   * paraemter to calculate that number of partitions to sample along each edge.
-   *
-   * if The geometry is not affected by elevation then we just use the corner points and ignore the partitions parameter
-   *
-   * @param poly holds the resulting polygon.  This could be a MultiPolygon depending on the geometry
-   * @param partitions These are the number of steps you want when walking the border.
-   */
-   void calculatePolyBounds(ossimPolyArea2d& result, ossim_int32 partitions = 25)const;
-
-   /**
-    * @brief Get the bounding rect of (0, 0) to (imageSize.x-1, imageSize.y-1).
-    *
-    * Relies on image size being initialized.
-    *
-    * @param bounding_rect Initialized by this method.  Will do a
-    * ossimIrect::makeNan() if the image size is not initialized.
-    */
-   void getBoundingRect(ossimIrect& bounding_rect) const;
-   void getBoundingRect(ossimDrect& bounding_rect) const; // Overloaded for drect.
-   
-   void getBoundingGroundRect(ossimGrect& bounding_grect) const;
-
-   //! Creates a new instance of ossimImageGeometry with the same transform and projection.
-   //! Overrides base-class version requiring loadState() and saveState() (not implemented yet)
-   virtual ossimObject* dup() const { return new ossimImageGeometry(*this); }
-
-   //! Attempts to initialize a transform and a projection given the KWL. Returns TRUE if no
-   //! error encountered.
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   //! Saves the transform (if any) and projection (if any) states to the KWL.
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-
-   /**
-    * @brief Set m_targetRrds data member.
-    *
-    * This is used by methods worldToRn and localToWorld that do not take a rrds
-    * argument and methods rnToWorld and worldToRn.  If the target rrds is set to 2,
-    * then the resulting point from worldToLocal is relative to reduced
-    * resolution level 2.  Vice versa for localToWorld it is assumed the local
-    * point is relative to the target
-    * reduced resolution data set.
-    *
-    * @param rrds Target (zero based) reduced resolution data set.
-    */
-   void setTargetRrds(ossim_uint32 rrds);
-
-   /**
-    * @return The target zero based reduced resolution data set used for localToWorld and
-    * worldToLocal.
-    * @see setTargetRrds 
-    */
-   ossim_uint32 getTargetRrds() const;
-
-   //! @brief  Changes the GSD and image size to reflect the scale provided.
-   //! @param scale  The scale to be applied in x and y directions
-   //! @param recenterTiePoint If true the will adjust the tie point by shifting the original tie 
-   //! to the upper left corner, applying scale, then shifting back by half of either the new
-   //! theDeltaLat/lon or theMetersPerPixel depending on if underlying projection isGeographic.
-   void applyScale(const ossimDpt& scale, bool recenterTiePoint);
-
-   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType = OSSIM_COMPARE_FULL)const;
-
-
-
-   // If we have an adjustable parameter interface return one.
-   //
-   // @return a pointer to an ossimAdjustableParameterInterface or NULL if no
-   //         adjustable paramters exist
-   //
-   virtual ossimAdjustableParameterInterface* getAdjustableParameterInterface();
-   virtual const ossimAdjustableParameterInterface* getAdjustableParameterInterface()const;
-   
-   
-   // Compute partials from image to ground with respect to the adjustable parameters.
-   //
-   //
-   bool computeImageToGroundPartialsWRTAdjParam(ossimDpt& result,
-                                                          const ossimGpt& gpt,
-                                                          ossim_uint32 idx,
-                                                          ossim_float64 paramDelta=1.0);
-   bool computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result,
-                                                           const ossimGpt& gpt,
-                                                           ossim_float64 paramDelta=1.0);
-   bool computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result,
-                                                           const ossimGpt& gpt,
-                                                           const DeltaParamList& deltas);
-   
-   bool computeGroundToImagePartials(NEWMAT::Matrix& result,
-                                     const ossimGpt& gpt,
-                                     const ossimDpt3d& deltaLlh);
-   
-   bool computeGroundToImagePartials(NEWMAT::Matrix& result,
-                                     const ossimGpt& gpt);
-
-   /**
-    * @return Returns the angle to "up is up" in decimal degrees, 0.0 if image
-    * is not affected by elevation, ossim::nan on error.
-    */
-   ossim_float64 upIsUpAngle() const;
-
-   /**
-    * @return Returns the angle to "north up" in decimal degrees, ossim::nan
-    * on error.
-    */
-   ossim_float64 northUpAngle() const;
-   
-protected:
-   //! @brief Method to back out decimation of a point.
-   //! @param rnPt Is a point in resolution n.
-   //! @param resolutionLevel Is the resolution of the point rnPt.
-   //! @param outPt Is the result of the transform a non-decimated point.
-   void undecimatePoint(const ossimDpt& rnPt,
-                        ossim_uint32 resolutionLevel,
-                        ossimDpt& outPt) const;
-
-   //! @brief Method to apply decimation of a point.
-   //! @param inPt Is a point with no decimation.
-   //! @param resolutionLevel Is the resolution of the point rnPt.
-   //! @param rnPt Is the result of the transform
-   void decimatePoint(const ossimDpt& inPt,
-                      ossim_uint32 resolutionLevel,
-                      ossimDpt& rnPt) const;
-
-   ossimRefPtr<ossim2dTo2dTransform> m_transform;   //!< Maintains local_image-to-full_image transformation 
-   ossimRefPtr<ossimProjection>      m_projection;  //!< Maintains full_image-to-world_space transformation
-   std::vector<ossimDpt>             m_decimationFactors; //!< List of decimation factors for R-levels
-   ossimIpt                          m_imageSize; // Image width and height
-
-   /** @brief Target rrds for localToWorld and worldToLocal methods. */
-   ossim_uint32                      m_targetRrds; 
-
-   TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageGeometry_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageGeometryFactory.h b/ossim/include/ossim/imaging/ossimImageGeometryFactory.h
deleted file mode 100644
index 6ce7aa6..0000000
--- a/ossim/include/ossim/imaging/ossimImageGeometryFactory.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//*****************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class declaration of ossimImageGeometryFactory.
-//
-//*****************************************************************************
-// $Id$
-#ifndef ossimImageGeometryFactory_HEADER
-#define ossimImageGeometryFactory_HEADER 1
-
-#include <ossim/imaging/ossimImageGeometryFactoryBase.h>
-
-class ossim2dTo2dTransform;
-class ossimNitfTileSource;
-class ossimProjection;
-
-class OSSIM_DLL ossimImageGeometryFactory : public ossimImageGeometryFactoryBase
-{
-public:
-   static ossimImageGeometryFactory* instance();
-   virtual ossimImageGeometry* createGeometry(const ossimString& typeName)const;
-   virtual ossimImageGeometry* createGeometry(const ossimKeywordlist& kwl,
-                                              const char* prefix=0)const;
-   virtual ossimImageGeometry* createGeometry(const ossimFilename& filename,
-                                              ossim_uint32 entryIdx)const;
-   virtual bool extendGeometry(ossimImageHandler* handler)const;
-   
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-   
-   /**
-    * This is a utility method used by crateGeoemtry that takes an image handler
-    */
-   virtual ossim2dTo2dTransform* createTransform(ossimImageHandler* handler)const;
-
-   /**
-    * @brief Utility method to create a projection from an image handler.
-    * @param handler The image handler to create projection from.
-    * @return Pointer to an ossimProjection on success, null on error.
-    */
-   virtual ossimProjection* createProjection(ossimImageHandler* handler) const;
-   
-protected:
-   ossimImageGeometryFactory();
-
-   virtual ossim2dTo2dTransform* createTransformFromNitf(ossimNitfTileSource* handler)const;
-   
-   static ossimImageGeometryFactory* m_instance;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageGeometryFactoryBase.h b/ossim/include/ossim/imaging/ossimImageGeometryFactoryBase.h
deleted file mode 100644
index 46feea2..0000000
--- a/ossim/include/ossim/imaging/ossimImageGeometryFactoryBase.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class declaration of ossimImageGeometryFactoryBase. See .h file for class documentation.
-//
-//**************************************************************************************************
-// $Id$
-#ifndef ossimImageGeometryFactoryBase_HEADER
-#define ossimImageGeometryFactoryBase_HEADER
-#include <ossim/base/ossimBaseObjectFactory.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-
-class ossimImageHandler;
-class OSSIM_DLL ossimImageGeometryFactoryBase : public ossimBaseObjectFactory
-{
-public: 
-   /**
-    * Creates an object given a type name.
-    */
-   virtual ossimObject* createObject(const ossimString& typeName)const
-   {
-      return createGeometry(typeName);
-   }
-   
-   /**
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const
-   {
-      return createGeometry(kwl, prefix);
-   }
-   
-   virtual ossimImageGeometry* createGeometry(const ossimString& typeName)const=0;
-   virtual ossimImageGeometry* createGeometry(const ossimKeywordlist& kwl,
-                                              const char* prefix=0)const=0;
-   virtual ossimImageGeometry* createGeometry(const ossimFilename& filename,
-                                              ossim_uint32 entryIdx)const = 0;
-   virtual bool extendGeometry(ossimImageHandler* handler)const=0;
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageGeometryRegistry.h b/ossim/include/ossim/imaging/ossimImageGeometryRegistry.h
deleted file mode 100644
index cb28e3b..0000000
--- a/ossim/include/ossim/imaging/ossimImageGeometryRegistry.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class declaration of ossimImageGeometryRegistry. See .h file for class documentation.
-//
-//**************************************************************************************************
-// $Id$
-#ifndef ossimImageGeometryRegistry_HEADER
-#define ossimImageGeometryRegistry_HEADER
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimImageGeometryFactoryBase.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/base/ossimFactoryListInterface.h>
-class OSSIM_DLL ossimImageGeometryRegistry : public ossimImageGeometryFactoryBase,
-                                             public ossimFactoryListInterface<ossimImageGeometryFactoryBase,
-                                                                              ossimImageGeometry>
-{
-public:
-   virtual ~ossimImageGeometryRegistry(){m_instance=0;}
-   static ossimImageGeometryRegistry* instance();
-   
-   
-   virtual ossimImageGeometry* createGeometry(const ossimString& typeName)const;
-   virtual ossimImageGeometry* createGeometry(const ossimKeywordlist& kwl,
-                                              const char* prefix=0)const;
-   virtual ossimImageGeometry* createGeometry(const ossimFilename& filename,
-                                              ossim_uint32 entryIdx)const;
-#if 0
-   /*!
-    * Creates an object given a type name.
-    */
-   virtual ossimObject* createObject(const ossimString& typeName)const
-   {
-      return createObjectFromRegistry(typeName);
-   }
-   
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const
-   {
-      return createObjectFromRegistry(kwl, prefix);
-   }
-#endif
-   virtual bool extendGeometry(ossimImageHandler* handler)const;
-   
-   /*!
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const
-   {
-      getAllTypeNamesFromRegistry(typeList);
-   }
-   
-protected:
-   ossimImageGeometryRegistry()
-   :ossimImageGeometryFactoryBase()
-   {}
-   
-   ossimImageGeometryRegistry( const ossimImageGeometryRegistry& rhs )
-   :ossimImageGeometryFactoryBase(rhs)
-   {}
-   void operator =(const ossimImageGeometryRegistry&){}
-   static ossimImageGeometryRegistry* m_instance;
-   
-   TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageHandler.h b/ossim/include/ossim/imaging/ossimImageHandler.h
deleted file mode 100644
index bf5437d..0000000
--- a/ossim/include/ossim/imaging/ossimImageHandler.h
+++ /dev/null
@@ -1,788 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description:
-//
-// This class defines an abstract image handler which all loaders should
-// derive from.
-//
-//********************************************************************
-// $Id: ossimImageHandler.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageHandler_HEADER
-#define ossimImageHandler_HEADER 1
-
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/imaging/ossimImageMetaData.h>
-
-/**
- *  This class defines an abstract Handler which all image handlers(loaders)
- *  should derive from.
- */
-class OSSIMDLLEXPORT ossimImageHandler : public ossimImageSource
-{
-public:
-
-   enum ossimImageHandlerOverviewCompressionType
-   {
-      OSSIM_OVERVIEW_COMPRESSION_NONE= 0,
-      OSSIM_OVERVIEW_COMPRESSION_JPEG,
-      OSSIM_OVERVIEW_COMPRESSION_LZW,
-      OSSIM_OVERVIEW_COMPRESSION_DEFLATE,
-      OSSIM_OVERVIEW_COMPRESSION_PACKBITS
-   };
-
-   /** Constructor (default): */
-   ossimImageHandler();
-   
-   /**
-    * Destructor:
-    * Derived classes should implement.
-    */
-   virtual ~ossimImageHandler();
-   
-   /**
-    * initialize
-    * Does nothing in this class.  Implemented to satisfy pure virtual.
-    */
-   virtual void initialize();
-   
-   /**
-    *  Searches for an overview.  Uses theImageFile as a key.
-    *  If theImageFile = "foo.tif" it will look for "foo.ovr" first,
-    *  then "foo_ovr.tif" next.
-    *  Calls openOverview(const ossimFilename& overview_file)
-    *  @return true on success, false on error.
-    *  @see openOverview(const ossimFilename& overview_file)
-    */
-   virtual bool openOverview();
-
-   /**
-    *  Calls closeOverview(), then attempts to open the overview_file.
-    *  On success, theOverviewFile will be set and theOverview will be
-    *  initialized.  On failure, theOverviewFile will be cleared and
-    *  theOverview deleted and set to NULL.
-    *  @param overview_file ossimFilename representing overview file.
-    *  @return true on success, false on error.
-    *  @see closeOverview()
-    */
-   virtual bool openOverview(const ossimFilename& overview_file);
-
-   /**
-    *  If theOverview is initialized it will be deleted and set to NULL. Also
-    *  clears theOverviewFile.
-    *  @return void
-    */
-   virtual void closeOverview();
-   
-   /**
-    *  @return the image handler of the overview, if it has been
-    *  successfully opened.
-    */
-   virtual const ossimImageHandler* getOverview() const;
-
-   /**
-    *  @return true if getNumberOfReducedResSets > 1, false if not.
-    *  @see getNumberOfReducedResSets()
-    */
-   virtual bool hasOverviews() const;
-
-   /**
-    *  @return ossimFilename represents an external OSSIM overview filename.
-    */
-   virtual ossimFilename createDefaultOverviewFilename() const;
-   
-   /**
-    *  @return ossimFilename represents an external OSSIM geometry filename.
-    */
-   virtual ossimFilename createDefaultGeometryFilename() const;
-
-   /**
-    *  @return ossimFilename represents an external OSSIM metadata filename.
-    */
-   virtual ossimFilename createDefaultMetadataFilename() const;
-
-   /**
-    *  @return ossimFilename represents an external OSSIM histogram filename.
-    */
-   virtual ossimFilename createDefaultHistogramFilename() const;
-
-   /**
-    *  @return ossimFilename represents an external OSSIM valid vertices filename.
-    */
-   virtual ossimFilename createDefaultValidVerticesFilename() const;
-   
-   /**
-    *  Outputs vertices to file and updates the internal vertex
-    *  array variable "theValidImageVertices".
-    *  @param vertices Array of ossimIpts to write.
-    *  @param file Name of output file to write to.  If file is empty, the
-    *  output file will be the image file with no extension + _vertices.kwl.
-    *  So if the image is "foo.tif" you'll get "foo_vertices.kwl".
-    *  @return true on success, false on error.
-    */
-   virtual bool writeValidImageVertices(const std::vector<ossimIpt>& vertices, 
-					const ossimFilename& file=ossimFilename(""));
-
-   /**
-    *  Opens the valid image vertices file and sets theValidImageVerticesFile
-    *  variable.
-    *  @param vertices_file File name containing valid vertices for image.
-    *  @return true on success, false on error.
-    */
-   virtual bool openValidVertices(const ossimFilename& vertices_file);
-
-   /**
-    *  Creates vertices file name based on image, then tries to open.
-    *  If theImageFile = "foo.tif" it will look for "foo_vertices.kwl".
-    *  @return true on success, false on error.
-    */
-   virtual bool openValidVertices();
-
-   /**
-    *  Pure virtual open.  Derived classes must implement.
-    *  
-    *  @return Returns true on success, false on error.
-    *
-    *  @note This method relies on the data member ossimImageData::theImageFile
-    *  being set.  Callers should do a "setFilename" prior to calling this
-    *  method or use the ossimImageHandler::open that takes a file name and an
-    *  entry index.
-    */
-   virtual bool open() = 0;
-
-   /**
-    *  Opens the image file.
-    *  
-    *  @param imageFile File to open.
-    *
-    *  @param entryIndex
-    *  @return true on success, false on error.
-    */
-   virtual bool open(const ossimFilename& imageFile,
-                     ossim_uint32 entryIndex);
-
-   virtual bool open(const ossimFilename& imageFile);
-
-   /**
-    *  Deletes the overview and clears the valid image vertices.  Derived
-    *  classes should implement.
-    */
-   virtual void close();
-
-   /**
-    *  Derived classes must implement this method to be concrete.
-    *
-    *  @return true if open, false if not.
-    */
-   virtual bool isOpen()const=0;
-
-   /**
-    *  Build a histogram for image file.
-    *
-    *  @param numberOfRLevels sets the maximum number of reduced resolution
-    *  level to compute histogram for.
-    *
-    *  @return true on success, false if not open.
-    */
-   virtual bool buildHistogram(int numberOfRLevels=0);
-   
-   
-   /**
-    *  Build a histograms for all image entries.
-    *
-    *  @param numberOfRLevels sets the maximum number of reduced resolution
-    *  level to compute histogram for.
-    *
-    *  @return true on success, false if not open.
-    */
-   virtual bool buildAllHistograms(int numberOfRLevels=0);
-   
-   /**
-    *  Will build over file for theImageFile.
-    *
-    *  @param includeFullResFlag if true the full resolution layer will also
-    *  be put in the overview format.  This is handly for inefficeint formats.
-    */
-   virtual bool buildOverview(ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
-                              ossim_uint32 quality = 75,
-                              ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
-                              bool includeFullResFlag=false);
-
-   /**
-    *  Will build over file for all image entries.
-    *
-    *  @param includeFullResFlag if true the full resolution layer will also
-    *  be put in the overview format.  This is handly for inefficeint formats.
-    */
-   virtual bool buildAllOverviews(ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
-                                  ossim_uint32 quality = 75,
-                                  ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
-                                  bool includeFullResFlag=false);
-   
-   /**
-    *  Will build an over file for filename.
-    *  @param filename Name of image file.
-    *
-    *  @param includeFullResFlag if true the full resolution layer will also
-    *  be put in the overview format.  This is handly for inefficeint formats.
-    */
-   virtual bool buildOverview(const ossimFilename& filename,
-                              ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
-                              ossim_uint32 quality = 75,
-                              ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
-                              bool includeFullResFlag=false);
-   
-   /**
-    * Returns the image geometry object associated with this tile source or
-    * NULL if non defined.  The geometry contains full-to-local image
-    * transform as well as projection (image-to-world).
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
-   /**
-    * Sets the image geometry object.
-    *
-    * @note Callers should note that this will override any existing
-    *       geometry.
-    *
-    * @note This does not write the geometry to disk, to do so call
-    *       one of the saveImageGeometry methods. 
-    */
-   virtual void setImageGeometry(ossimImageGeometry* geom);
-
-   /**
-    * Saves the image geometry to a file that will be made based on the image
-    * file name.
-    */
-   virtual void saveImageGeometry() const;
-   
-   /**
-    * Saves the image geometry to a file that will be made based on the image
-    * file name.
-    */
-   virtual void saveImageGeometry(const ossimFilename& geometry_file) const;   
-   
-   /**
-    *  Pure virtual, derived classes must implement.
-    *
-    *  @param resLevel Reduced resolution level to return lines of.
-    *  Default = 0
-    *
-    *  @return The number of lines for specified reduced resolution level.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const = 0;
-
-   /**
-    *  Pure virtual, derived classes must implement.
-    *
-    *  @param resLevel Reduced resolution level to return samples of.
-    *  Default = 0
-    *
-    *  @return The number of samples for specified reduced resolution level.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const = 0;
-   
-   /**
-    * @brief Returns zero-based bounding rectangle of the image.
-    * Note sub-image offset now in ossimImageGeometry class.
-    * 
-    * @param resLevel Reduced resolution level for rectangle.
-    *
-    * @return Rectangle of reduced resolution level.
-    */
-   virtual ossimIrect getImageRectangle(ossim_uint32 resLevel = 0) const; 
-
-   /**
-    * @brief Returns zero-based bounding rectangle of the image.
-    * Same as getImageRectangle() call.  Note sub-image offset now
-    * in ossimImageGeometry class.
-    * 
-    * @param resLevel Reduced resolution level for rectangle.
-    *
-    * @return Rectangle of reduced resolution level.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel = 0) const;
-
-   /**
-    * @param resLevel Reduced resolution set for requested decimation.
-    *
-    * @param result ossimDpt to initialize with requested decimation.
-    * 
-    * @note Initialized "result" with the decimation factor for the passed in
-    * resLevel.
-    * Most of the time the returned factor is a square decimation along x
-    * and y indicated by result.x and .y  = 1.0/(resLevel^2) where ^
-    * means rasing to the power of.  If the resLevel is 1 then the return
-    * decimation .5, .5. this is not the decimation to each resolution
-    * level but the total decimation from res level 0.
-    * So if resLevel is 2 then the return is .25, .25.
-    *
-    * @note Derived classes should override if the decimation is anything other
-    * than a power of two change in each direction per res level.
-    */
-   virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const;
-
-   /**
-    * This returns all decimation for all levels.
-    */
-   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
-
-   /**
-    * This returns the total number of decimation levels.  It is important to
-    * note that res level 0 or full resolution is included in the list and has
-    * decimation values 1.0, 1.0
-    */
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-
-   /**
-    * This method is obsolete.  Please use getNumberOfDecimationLevels.
-    *
-    * For backwards compatibility this calls getNumberOfDecimationLevels.
-    */
-   virtual ossim_uint32 getNumberOfReducedResSets()const;
-   
-   /**
-    * Sets the filename
-    */
-   virtual void setFilename(const ossimFilename& filename);
-
-   /**
-    * Returns the filename
-    */
-   virtual const ossimFilename& getFilename()const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * @brief Determines if the passed in reslution level is valid.
-    *
-    * If this reader is used as an overview the caller should pass in a
-    * resLevel relative to the full image.
-    * 
-    * @param resLevel zero base resolution level.
-    * @return true on success, false on error.
-    */
-   virtual bool isValidRLevel(ossim_uint32 resLevel) const;
-
-   /**
-    * Connection rule.  Since image handler currently don't have any
-    * inputs this will just return false saying we can't connect anything
-    * to an image handler.
-    */
-   bool canConnectMyInputTo(ossim_int32 inputIndex,
-                            const ossimConnectableObject* object) const;
-      
-   /**
-    * ordering specifies how the vertices should be arranged.
-    * valid image vertices is basically the tightly fit convex hull
-    * of the image.  Usually an image has NULL values and are
-    * internally not upright rectangular.  This can cause
-    * problems some spatial filters.
-    *
-    * The default implementation is to return the bounding rect.
-    */
-   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0)const;
-
-   /**
-    * @brief Indicates whether or not the image handler can control output
-    * band selection via the setOutputBandList method.
-    * @return true if band selector; false, if not.
-    */
-   virtual bool isBandSelector() const;
-
-   /**
-    * @brief If the image handler "isBandSeletor()" then the band selection
-    * of the output chip can be controlled.
-    *
-    * This method returns false. Derived classes that are band selectors should
-    * override.
-    *
-    * @param band_list Requested bands.
-    * 
-    * @return true on success, false on error.
-    */
-   virtual bool setOutputBandList(const std::vector<ossim_uint32>& band_list);
- 
-   /**
-    * @brief If the image handler "isBandSeletor()" then the band selection
-    * of the output are set to input or identity.  Does nothing and returns
-    * false if not a band selector.
-    * 
-    * @return If band selector, returns the output of setOutputBandList; if
-    * not, returns false.
-    */
-   virtual bool setOutputToInputBandList();
- 
-   /**
-    * @brief Convenience method to see if band list is identity.
-    * @param bandList List to check.
-    * @return true if band selector; false, if not.
-    */
-   virtual bool isIdentityBandList( const std::vector<ossim_uint32>& bandList ) const;
-   
-   /**
-    * Indicates whether or not the image is tiled internally.
-    * This implementation returns true if (getImageTileWidth() &&
-    * getImageTileHeight()) are both non zero.
-    * Override in the image handler if something else is desired.
-    * Returns true if tiled, false if not.
-    */
-   virtual bool isImageTiled() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const = 0;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const = 0;
-
-   virtual bool hasMetaData() const;
-
-   virtual ossimRefPtr<ossimNBandLutDataObject> getLut()const;
-
-   virtual bool hasLut() const;
-   
-   /**
-    * There is an external file with an omd extension.  this file contains
-    * additional information about the image such as the null pixel, min and
-    * max values.
-    * For general raster it will contain much more than that.
-    */
-   virtual void loadMetaData();
-
-   /**
-    * Retuns the min pixel value.  If there was an external eta data file
-    * then use the meta data from that file.  If not given then we will
-    * return the default min
-    */
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * @brief convenience method to set min pixel value.
-    *
-    * Added for overview readers so that the image handler that owns the
-    * overview reader can pass on it's min value.
-    *
-    * @param band Zero based band to set.
-    *
-    * @param pix Min pixel value.
-    */
-   virtual void setMinPixelValue(ossim_uint32 band, const ossim_float64& pix);
-
-   /**
-    * @brief convenience method to set max pixel value.
-    *
-    * Added for overview readers so that the image handler that owns the
-    * overview reader can pass on it's max value.
-    *
-    * @param band Zero based band to set.
-    *
-    * @param pix Max pixel value.
-    */
-   virtual void setMaxPixelValue(ossim_uint32 band, const ossim_float64& pix);
-
-   /**
-    * @brief convenience method to set null pixel value.
-    *
-    * Added for overview readers so that the image handler that owns the
-    * overview reader can pass on it's max value.
-    *
-    * @param band Zero based band to set.
-    *
-    * @param pix Null pixel value.
-    */
-   virtual void setNullPixelValue(ossim_uint32 band, const ossim_float64& pix);
-    
-   /**
-    * @return The current entry number.
-    *
-    * @note This implementation returns 0.  Derived classes should override
-    * if of multiple entry image type.
-    */
-   virtual ossim_uint32 getCurrentEntry()const;
-   
-   /**
-    * @return The number of entries (images) in the image file.
-    */
-   virtual ossim_uint32 getNumberOfEntries()const;
-
-   /**
-    * @brief Get the name of entry as a string.
-    *
-    * This implementation clears name. Derived classes that support multiple
-    * entries and have "named" entries should re-implement to provide entry
-    * names.  Example given from HDF5 file:
-    * 
-    * entry_name: /All_Data/VIIRS-IMG-GTM-EDR-GEO_All/QF1_VIIRSGTMGEO
-    *
-    * @param entryIdx Zero based entry index. If out of range name will
-    * be cleared.
-    * 
-    * @param name Initialized by this.
-    */
-   virtual void getEntryName( ossim_uint32 entryIdx,
-                              std::string& name ) const;
-   
-   /**
-    * @param entryList This is the list to initialize with entry indexes.
-    *
-    * @note This implementation returns puts one entry "0" in the list.
-    */
-   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
-   
-   /**
-    * @param getEntryNames List to initialize with strings associated with
-    * entries.
-    *
-    * @note This implementation calls getEntryList and converts entries in
-    * the list to strings.  Derived classes that support multiple entries
-    * with associated strings should re-implement.
-    */
-   virtual void getEntryNames(std::vector<ossimString>& entryNames) const;
-
-   /**
-    * @brief Convenience method to determine if entry index should be used for
-    * support files, e.g. file.his or file_e1.his.
-    * 
-    * @returns true if file is open, &&
-    * ( (entryList.size() > 1) || (entryList[0] != 0) )
-    * false otherwise.
-    *
-    * @note This is just a hint.  Put here as code was duplicated everywhere.
-    * Callers can do what they wish.
-    */
-   bool useEntryIndex() const;
-   
-   ossimFilename getOverviewFile()const;
-
-   /**
-    * @param entryIdx Entry number to select.
-    *
-    * @note The implementation does nothing.  Derived classes that handle
-    * multiple images should override.
-    *
-    * @return true if it was able to set the current entry and false otherwise.
-    */
-   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   /**
-    * Returns the image file with extension set.
-    *
-    * Examples:
-    * 
-    * - theImageFile          = "foo.hdf"
-    * - The number of entries = 1
-    * - ext parameter         = "geom"
-    * - return of method will = "foo.geom"
-    *
-    * - theImageFile          = "foo.hdf"
-    * - The number of entries = 12
-    * - The current entry     = 3
-    * - ext parameter         = "geom"
-    * - return of method will = "foo_e3.geom"
-    *
-    * @param ext Extension to tack onto file.  Can have or have not ".", it
-    * will be added if "." is not the first character.
-    *
-    * @param set_e0_prefix If true and the number of entries = 1 then
-    * "foo.geom" would come out "foo_e0.geom" instead. Default = false.
-    * 
-    * @return theImageFile with sent extension.
-    */
-   ossimFilename getFilenameWithThisExtension(const ossimString& ext,
-                                              bool set_e0_prefix=false) const;
-   
-   ossim_uint32 getStartingResLevel() const;
-   
-   void setStartingResLevel(ossim_uint32 level);
-   
-   /** @return theOpenOverviewFlag */
-   bool getOpenOverviewFlag() const;
-   
-   /**
-    * @brief Sets theOpenOverviewFlag.
-    *
-    * If true opening of overviews will be attempted on normal open.  If
-    * false only the base image will be opened (shallow open).
-    * Defaulted to true in constructor.
-    */
-   void setOpenOverviewFlag(bool flag);
-   
-   /**
-    * Sets the supplementary directory
-    */
-   virtual void setSupplementaryDirectory(const ossimFilename& dir);
-   
-   /**
-    * Returns the supplementary directory
-    */
-   virtual const ossimFilename& getSupplementaryDirectory()const;
-   
-   //! Fetches the image ID. This is initialized to -1 in the constructor but is searched for in 
-   //! loadState():
-   const ossimString& getImageID() const { return theImageID; }
-   
-   //! Sets the image ID in case it is externally generated
-   void setImageID(const ossimString&  id) { theImageID = id; }
-
-   //! Returns the raster pixel alignment type. OSSIM treats all alignments internally as
-   //! pixel-is-point. This is only a flag to identify the source's alignment type.
-   ossimPixelType getPixelType() const { return thePixelType; }
-   
-   /**
-    * @brief Convenience method to get the zero based rgb output band list.
-    *
-    * This method returns false and is here only so derived classes can
-    * override.
-    * 
-    * @param bandList
-    * @return false
-    */
-   virtual bool getRgbBandList(std::vector<ossim_uint32>& bandList) const;
-
-protected:
-   
-   /**
-    * Returns the image geometry object associated with this tile source or
-    * NULL if non defined.  The geometry contains full-to-local image
-    * transform as well as projection (image-to-world).
-    *
-    * This method just looks for external .geom style override only.
-    * If you want to go through a registry then call getImageGeometry().
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getExternalImageGeometry() const;
-   
-   virtual ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const;
-   
-   /**
-    * @brief Method to get an overview tile.  Derived classes should override if
-    * they have built in overviews or something different than the standard
-    * external overview file.  Image handlers can call this method from getTile
-    * in place of inlining code or if derived class needs to override this
-    * method.
-    *
-    * @param resLevel The resolution level to pull from with resLevel 0 being
-    * full res.
-    * 
-    * @param result The tile to stuff. 
-    * passing. 
-    *
-    * @return true on success false on error.  Typically this will return false
-    * if resLevel==0 unless the overview has r0.  If return is false, result
-    * is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getOverviewTile(ossim_uint32 resLevel, ossimImageData* result);  
-   
-   /**
-    *  Opens file and attempts to initialize the valid image vertices.
-    *  Returns true on success, false on error.
-    */
-   bool initVertices(const char* file);
-   
-   /**
-    * Will complete the opening process.  
-    * If there are overviews it will open them. 
-    * If there is meta data it will open that and if there
-    * is valid vertices it will open that.
-    */
-   virtual void completeOpen();
-   
-   /**
-    * @brief Convenience method to set things needed in the image geometry from
-    * the image handler.  At time of writing sets the decimation and image size.
-    * @param geom ossimImageGeometry to initiale.
-    */
-   void initImageParameters(ossimImageGeometry* geom) const;
-   
-   /**
-    * @brief Virtual method determines the decimation factors at each resolution level. This
-    * base class implementation computes the decimation by considering the ratios in image size
-    * between resolution levels, with fuzzy logic for rounding ratios to the nearest power of 2
-    * if possible. Derived classes need to override this method if the decimations are provided
-    * as part of the image metadata.
-    */
-   virtual void establishDecimationFactors();
-
-   /**
-    * @brief Convenience method to set output band list.
-    *
-    * This performs range checking and calls theOverview->setOutputBandList
-    * on success.
-    * 
-    * @param inBandList The new band list.
-    * @param outBandList Band list to initialize.
-    * @return true on success, false on error.
-    */
-   virtual bool setOutputBandList(const std::vector<ossim_uint32>& inBandList,
-                                  std::vector<ossim_uint32>& outBandList);
-
-   ossimFilename theImageFile;
-   ossimFilename theOverviewFile;
-   ossimFilename theSupplementaryDirectory;
-   ossimRefPtr<ossimImageHandler> theOverview;
-   vector<ossimIpt> theValidImageVertices;
-   ossimImageMetaData theMetaData;
-   mutable ossimRefPtr<ossimImageGeometry> theGeometry;
-   ossimRefPtr<ossimNBandLutDataObject> theLut;
-   std::vector<ossimDpt> theDecimationFactors;
-   ossimString theImageID;
-
-   /**
-    * theStartingResLevel If set to something other than zero(default) this is
-    * indicative that the reader is an overview.
-    */
-   ossim_uint32 theStartingResLevel; // 0 being full or highest res.
-
-   /**
-    * If true opening of overviews will be attempted.  If false only the base
-    * image will be opened (shallow open). Defaulted to true in constructor.
-    */
-   bool theOpenOverviewFlag;
-   mutable ossimPixelType thePixelType; // pixel-is-point or pixel-is-area
-   
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageHandler_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageHandlerFactory.h b/ossim/include/ossim/imaging/ossimImageHandlerFactory.h
deleted file mode 100644
index 7f342c7..0000000
--- a/ossim/include/ossim/imaging/ossimImageHandlerFactory.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for ossimImageHandlerFactoryMaker.
-//*******************************************************************
-// $Id: ossimImageHandlerFactory.h 22228 2013-04-12 14:11:45Z dburken $
-
-#ifndef ossimImageHandlerFactory_HEADER
-#define ossimImageHandlerFactory_HEADER 1
-
-#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
-#include <ossim/base/ossimString.h>
-
-class ossimImageHandler;
-class ossimFilename;
-class ossimKeywordlist;
-
-//*******************************************************************
-// CLASS:  ossimImageHandlerFactory
-//*******************************************************************
-class OSSIMDLLEXPORT ossimImageHandlerFactory : public ossimImageHandlerFactoryBase
-{
-public:
-   virtual ~ossimImageHandlerFactory();
-   static ossimImageHandlerFactory* instance();
-
-   /**
-    * @param openOverview If true image handler will attempt to open overview.
-    * default = true
-    */
-   virtual ossimImageHandler* open(const ossimFilename& fileName,
-                                   bool openOverview=true)const;
-   virtual ossimImageHandler* open(const ossimKeywordlist& kwl,
-                                   const char* prefix=0)const;
-
-   /**
-    * @brief Open overview that takes a file name.
-    * 
-    * @param file File to open.
-    * 
-    * @return ossimRefPtr to image handler on success or null on failure.
-    */
-   virtual ossimRefPtr<ossimImageHandler> openOverview(
-      const ossimFilename& file ) const;
-   
-   virtual ossimObject* createObject(const ossimString& typeName)const;
-   
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const;
-   
-   /*!
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-   virtual void getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const;
-   virtual void getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& ext)const;
-   virtual void getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const;
-   
-protected:
-
-   /**
-    * @brief Open method that looks at extension e.g. "tif", "jpg" to select
-    * class to open.
-    *
-    * This is to be called by standard open before just going down the list
-    * of classes the brute force hard way.
-    * 
-    * @param fileName The filename to open.
-    * 
-    * @return Pointer to image handler or null if nothing opened.
-    */
-//   virtual ossimImageHandler* openFromExtension(
-//      const ossimFilename& fileName) const;
-  
-   ossimImageHandlerFactory(){}
-   ossimImageHandlerFactory(const ossimImageHandlerFactory&){}
-   void operator = (const ossimImageHandlerFactory&){}
-
-   static ossimImageHandlerFactory* theInstance;
-
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/imaging/ossimImageHandlerFactoryBase.h b/ossim/include/ossim/imaging/ossimImageHandlerFactoryBase.h
deleted file mode 100644
index 492a4a1..0000000
--- a/ossim/include/ossim/imaging/ossimImageHandlerFactoryBase.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimImageHandlerFactoryBase.h 22632 2014-02-20 00:53:14Z dburken $
-
-#ifndef ossimImageHandlerFactoryBase_HEADER
-#define ossimImageHandlerFactoryBase_HEADER 1
-
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimObjectFactory.h>
-#include <algorithm>
-#include <iosfwd>
-#include <vector>
-
-class ossimFilename;
-class ossimKeywordlist;
-
-class OSSIM_DLL ossimImageHandlerFactoryBase : public ossimObjectFactory
-{
-public:
-   template <class T> class UniqueList
-   {
-   public:
-      
-      void push_back(const T& value)
-      {
-         if(std::find(theList.begin(),theList.end(), value) == theList.end())
-         {
-            theList.push_back(value);
-         }
-      }
-
-      const std::vector<T>& getList()const
-      {
-         return theList;
-      }
-      ossim_uint32 size()const
-      {
-         return theList.size();
-      }
-      const T& operator[](ossim_uint32 idx)const
-      {
-         return theList[idx];
-      }
-      T& operator[](ossim_uint32 idx)
-      {
-         return theList[idx];
-      }
-   protected:
-      std::vector<T> theList;
-   };
-   
-   typedef UniqueList<ossimString> UniqueStringList;
-   typedef std::vector<ossimRefPtr<ossimImageHandler> > ImageHandlerList;
-   
-   virtual ossimImageHandler* open(const ossimFilename& fileName,
-                                   bool openOverview=true)const = 0;
-   virtual ossimImageHandler* open(const ossimKeywordlist& kwl,
-                                   const char* prefix=0)const = 0;
-
-   /**
-    *  @brief Open method.
-    *
-    *  This open takes a stream, position and a flag.
-    *
-    *  @param str Open stream to image.
-    *
-    *  @param restartPosition Typically 0, this is the stream offset to the
-    *  front of the image.
-    *
-    *  @param youOwnIt If true the opener takes ownership of the stream
-    *  pointer and will destroy on close.
-    *  
-    *  @return This implementation returns an ossimRefPtr with a null pointer.
-    */
-   virtual ossimRefPtr<ossimImageHandler> open( std::istream* str,
-                                                std::streamoff restartPosition,
-                                                bool youOwnIt ) const;   
-
-   /**
-    * @brief Open overview that takes a file name.
-    *
-    * This default implementation returns a null ref pointer.
-    * Derived factories that have overview readers should override.
-    * 
-    * @param file File to open.
-    *
-    * @return This default implementation returns a null ref pointer.
-    */
-   virtual ossimRefPtr<ossimImageHandler> openOverview(
-      const ossimFilename& file ) const;
-
-   virtual void getImageHandlersBySuffix(ImageHandlerList& result,
-                                         const ossimString& ext)const;
-
-   virtual void getImageHandlersByMimeType(ImageHandlerList& result,
-                                           const ossimString& mimeType)const;
-
-   virtual void getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const=0;
-   
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/imaging/ossimImageHandlerRegistry.h b/ossim/include/ossim/imaging/ossimImageHandlerRegistry.h
deleted file mode 100644
index 38727ec..0000000
--- a/ossim/include/ossim/imaging/ossimImageHandlerRegistry.h
+++ /dev/null
@@ -1,157 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Garrett Potts
-//
-// Description:  Contains class definition for the class
-//               ImageHandlerRegistry.
-//
-//*******************************************************************
-//  $Id: ossimImageHandlerRegistry.h 22636 2014-02-23 17:55:50Z dburken $
-
-#ifndef ossimImageHandlerRegistry_HEADER
-#define ossimImageHandlerRegistry_HEADER 1
-
-#include <ossim/base/ossimObjectFactory.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
-#include <ossim/base/ossimFactoryListInterface.h>
-#include <iosfwd>
-#include <vector>
-
-class ossimImageHandler;
-class ossimFilename;
-class ossimKeywordlist;
-
-class OSSIMDLLEXPORT ossimImageHandlerRegistry : public ossimObjectFactory,
-                                                public ossimFactoryListInterface<ossimImageHandlerFactoryBase, ossimImageHandler>
-{
-public:
-   virtual ~ossimImageHandlerRegistry();
-   
-   static ossimImageHandlerRegistry* instance();
-   
-
-   /**
-    * @brief open that takes a filename.
-    * @param fileName File to open.
-    * @param trySuffixFirst If true calls code to try to open by suffix first,
-    * then goes through the list of available handlers. default=true.
-    * @param openOverview If true image handler will attempt to open overview.
-    * default = true
-    * @return Pointer to image handler or null if cannot open.
-    */
-   virtual ossimImageHandler* open(const ossimFilename& fileName,
-                                   bool trySuffixFirst=true,
-                                   bool openOverview=true)const;
-   
-   /**
-    *  Given a keyword list return a pointer to an ImageHandler.  Returns
-    *  null if a valid handler cannot be found.
-    */
-   virtual ossimImageHandler* open(const ossimKeywordlist& kwl,
-                                   const char* prefix=0)const;
-
-   /**
-    *  @brief Open method.
-    *
-    *  This open takes a stream, position and a flag.
-    *
-    *  @param str Open stream to image.
-    *
-    *  @param restartPosition Typically 0, this is the stream offset to the
-    *  front of the image.
-    *
-    *  @param youOwnIt If true the opener takes ownership of the stream
-    *  pointer and will destroy on close.
-    *  
-    *  @return This implementation returns an ossimRefPtr with a null pointer.
-    */
-   virtual ossimRefPtr<ossimImageHandler> open( std::istream* str,
-                                                std::streamoff restartPosition,
-                                                bool youOwnIt ) const;   
-   
-   /**
-    * @brief Open overview that takes a file name.
-    *
-    * This will only check readers that can be overview handlers.
-    * 
-    * @param file File to open.
-    * 
-    * @return ossimRefPtr to image handler on success or null on failure.
-    */
-   virtual ossimRefPtr<ossimImageHandler> openOverview(
-      const ossimFilename& file ) const;
-
-   /*!
-    * Creates an object given a type name.
-    */
-   virtual ossimObject* createObject(const ossimString& typeName) const;
-   
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const;
-
-   /**
-    * openBySuffix will call the mthod getImageHandlersBySuffix and go through
-    * each handler to try and open the file.  This should be a faster open
-    * for we do not have to do a magic number compare on all prior files and
-    * keep opening and closing files.
-    * @param openOverview If true image handler will attempt to open overview.
-    * default = true
-    */
-   virtual ossimRefPtr<ossimImageHandler> openBySuffix(const ossimFilename& file,
-                                                       bool openOverview=true)const; 
-   
-   /**
-    *
-    * Will add to the result list any handler that supports the passed in extensions
-    *
-    */
-   virtual void getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result,
-                                         const ossimString& ext)const;
-   /**
-    *
-    * Will add to the result list and handler that supports the passed in mime type
-    *
-    */
-   virtual void getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result,
-                                           const ossimString& mimeType)const;
-   
-   /*!
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList( std::vector<ossimString>& typeList ) const;
-
-   virtual void getSupportedExtensions(
-      ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const;
-
-   /**
-    * @brief Prints list of readers and properties.
-    * @param  out Stream to print to.
-    * @return std::ostream&
-    */
-   std::ostream& printReaderProps(std::ostream& out) const;
-   
-protected:
-   ossimImageHandlerRegistry();
-   ossimImageHandlerRegistry(const ossimImageHandlerRegistry& rhs);
-   const ossimImageHandlerRegistry&
-      operator=(const ossimImageHandlerRegistry& rhs);
-   
-   //static ossimImageHandlerRegistry*            theInstance;
-   
-TYPE_DATA
-};
-
-extern "C"
-{
-   OSSIM_DLL  void* ossimImageHandlerRegistryGetInstance();
-}
-
-#endif /* #ifndef ossimImageHandlerRegistry_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimImageHistogramSource.h b/ossim/include/ossim/imaging/ossimImageHistogramSource.h
deleted file mode 100644
index e5a93a1..0000000
--- a/ossim/include/ossim/imaging/ossimImageHistogramSource.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageHistogramSource.h 22737 2014-04-16 18:53:57Z gpotts $
-#ifndef ossimImageHistogramSource_HEADER
-#define ossimImageHistogramSource_HEADER
-#include <ossim/base/ossimHistogramSource.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/base/ossimObjectEvents.h>
-#include <ossim/base/ossimIrect.h>
-
-/*!
- * This source expects as input an ossimImageSource.
- * it will slice up the requested region into tiles and compute
- * the histogram of the passed in rectangle.
- */
-class OSSIMDLLEXPORT ossimImageHistogramSource : public ossimHistogramSource,
-                                                 public ossimConnectableObjectListener,
-                                                 public ossimProcessInterface
-{
-public:
-
-   ossimImageHistogramSource(ossimObject* owner = 0);
-   
-   virtual ossimObject* getObject();
-   virtual const ossimObject* getObject()const;
-
-   void setAreaOfInterest(const ossimIrect& rect);
-
-   ossimIrect getAreaOfInterest()const;
-
-   void getAreaOfInterest(ossimIrect& rect)const;
-
-   virtual ossim_uint32 getMaxNumberOfRLevels()const;
-
-   virtual void setMaxNumberOfRLevels(ossim_uint32 number);
-
-   /*!
-    * The first argument is the region of interest that you wish to
-    * use for the histogram.  If the region is different than
-    * what it has already computed before then the histogram is considered
-    * dirty and will be re-computed.  The returned object is a
-    * multi-reslevel histogram
-    */
-   virtual ossimRefPtr<ossimMultiResLevelHistogram> getHistogram(const ossimIrect& rect);
-
-   virtual ossimRefPtr<ossimMultiResLevelHistogram> getHistogram();
-   virtual bool execute();
-   
-   virtual bool canConnectMyInputTo(ossim_int32 myInputIndex,
-                                    const ossimConnectableObject* object)const;
-
-   void setNumberOfBinsOverride(ossim_int32 numberOfBinsOverride);
-
-   void setMinValueOverride(ossim_float32 minValueOverride);
-
-   void setMaxValueOverride(ossim_float32 maxValueOverride);
-
-   ossimHistogramMode getComputationMode()const;
-   void setComputationMode(ossimHistogramMode mode);
-	
-   virtual void propertyEvent(ossimPropertyEvent& event);
-   
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-	
-protected:
-   virtual ~ossimImageHistogramSource();
-
-   void getBinInformation(ossim_uint32& numberOfBins,
-                          ossim_float64& minValue,
-                          ossim_float64& maxValue,
-                          ossim_uint32 band)const;
-   virtual void computeNormalModeHistogram();
-   virtual void computeFastModeHistogram();
-   
-   /*!
-    * Initialized to ossimNAN'S
-    */
-   ossimIrect theAreaOfInterest;
-   bool       theHistogramRecomputeFlag;
-   
-   /*!
-    * Will default to 1.  This means it will use up to max
-    * number of res levels for the histogram.
-    */
-   ossim_uint32       theMaxNumberOfResLevels; 
-   ossim_float64      theMinValueOverride;
-   ossim_float64      theMaxValueOverride;
-   ossim_int32        theNumberOfBinsOverride;
-   ossimHistogramMode theComputationMode;
-   ossim_uint32       theNumberOfTilesToUseInFastMode;
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/imaging/ossimImageMetaData.h b/ossim/include/ossim/imaging/ossimImageMetaData.h
deleted file mode 100644
index 45dd249..0000000
--- a/ossim/include/ossim/imaging/ossimImageMetaData.h
+++ /dev/null
@@ -1,139 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Contains class declaration for ossimImageMetaData.
-// 
-//*******************************************************************
-//  $Id: ossimImageMetaData.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageMetaData_HEADER
-#define ossimImageMetaData_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <iosfwd>
-#include <string>
-
-class ossimKeywordlist;
-
-class OSSIM_DLL ossimImageMetaData
-{
-public:
-   ossimImageMetaData();
-   ossimImageMetaData(ossimScalarType aType,
-                      ossim_uint32 numberOfBands);
-   ossimImageMetaData(const ossimImageMetaData& rhs);
-
-   const ossimImageMetaData& operator=(const ossimImageMetaData& rhs);
-   
-   ~ossimImageMetaData();
-   
-   void clear();
-
-   void setDefaultsForArrays();
-   
-   void setNumberOfBands(ossim_uint32 numberOfBands);
-   
-   ossim_uint32 getNumberOfBands()const;
-   
-   void setScalarType(ossimScalarType aType);
-   
-   ossimScalarType getScalarType()const;
-
-   /** @return The bytes per pixel. This is for a single band. */
-   ossim_uint32 getBytesPerPixel() const;
-   
-   double getMinPix(ossim_uint32 band)const;
-   
-   void setMinPix(ossim_uint32 band, double pix);
-   
-   void setMaxPix(ossim_uint32 band, double pix);
-   
-   void setNullPix(ossim_uint32 band, double pix);
-   
-   double getMaxPix(ossim_uint32 band)const;
-   
-   double getNullPix(ossim_uint32 band)const;
-   
-   const double* getMinPixelArray()const;
-   
-   const double* getMaxPixelArray()const;
-   
-   const double* getNullPixelArray()const;
-
-   void setMinValuesValid(bool flag);
-   
-   void setMaxValuesValid(bool flag);
-   
-   void setNullValuesValid(bool flag);
-
-   bool getMinValuesValidFlag()const;
-
-   bool getMaxValuesValidFlag()const;
-
-   bool getNullValuesValidFlag()const;
-
-   bool isValid()const;
-   
-   bool loadState(const ossimKeywordlist& kwl,
-                  const char* prefix=0);
-   bool saveState(ossimKeywordlist& kwl,
-                  const char* prefix=0)const;
-
-   /**
-    * @brief Method to update band values.
-    *
-    * Assumes a previous initialization and does not error out if band data is
-    * not found.  This does NOT clear the object prior to loading like the
-    * loadState(...) method.  Can be used to update min/max values from a
-    * "compute min max".  
-    *
-    * @param kwl Keyword list to initialize from.
-    *
-    * @param prefix Prefix, e.g. "image0.".
-    */
-   void updateMetaData( const ossimKeywordlist& kwl,
-                        const std::string& prefix );
-
-   /**
-    * @brief Print method.
-    * @return std::ostream&
-    */
-   std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @note  Since the print method is virtual, derived classes only need
-    *        to implement that, not an addition operator<<.
-    */
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out,
-                                             const ossimImageMetaData& obj);
-   
-private:
-
-   /**
-    * Looks for ossimKeywordNames::NUMBER_BANDS_KW, if not found looks for.
-    */
-   ossim_uint32 getBandCount(const ossimKeywordlist& kwl,
-                             const std::string& prefix) const;
-   
-   double*         theNullPixelArray;
-   double*         theMinPixelArray;
-   double*         theMaxPixelArray;
-  
-   bool            theMinValuesValidFlag;
-   bool            theMaxValuesValidFlag;
-   bool            theNullValuesValidFlag;
-   
-   ossimScalarType theScalarType;
-   ossim_uint32    theBytesPerPixel;
-   ossim_uint32    theNumberOfBands;
-};
-
-#endif /* #ifndef ossimImageMetaData_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageMetaDataWriterFactory.h b/ossim/include/ossim/imaging/ossimImageMetaDataWriterFactory.h
deleted file mode 100644
index d107369..0000000
--- a/ossim/include/ossim/imaging/ossimImageMetaDataWriterFactory.h
+++ /dev/null
@@ -1,88 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2003 Storage Area Networks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kenneth Melero (kmelero at sanz.com)
-//
-//*******************************************************************
-//  $Id: ossimImageMetaDataWriterFactory.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimImageMetaDataWriterFactory_HEADER
-#define ossimImageMetaDataWriterFactory_HEADER
-
-#include <ossim/imaging/ossimImageMetaDataWriterFactoryBase.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimMetadataFileWriter;
-
-class OSSIMDLLEXPORT ossimImageMetaDataWriterFactory:
-   public ossimImageMetaDataWriterFactoryBase
-{
-public:
-   ~ossimImageMetaDataWriterFactory();
-
-   static ossimImageMetaDataWriterFactory* instance();
-   virtual ossimObject* createObject(const ossimString& typeName)const;
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const;
-
-   /**
-    * Creates a writer from either a class name or a string representing the
-    * meta data type like "tiff_world_file".
-    *
-    * @return ossimRefPtr<ossimMetadataFileWriter>
-    *
-    * @note Return can have a null pointer if type is not found in a factory so
-    * the caller should always check the pointer like:
-    * ossimRefPtr<ossimMetadataFileWriter> mw =
-    *    ossimImageMetaDataWriterRegistry::instance("ossim_readme");
-    * if (!mw.valid())
-    * {
-    *    // not in factory
-    * }
-    */
-   virtual ossimRefPtr<ossimMetadataFileWriter> createWriter(
-      const ossimString& type)const;
-
-   /**
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-
-   /**
-    * Satisfies pure virtual from ossimImageMetaDataWriterFactoryBase.
-    * 
-    * Appends the meta data writers types from each of the supported meta
-    * data writers in this factor to the "metadatatypeList".
-    * 
-    * This is the actual metadata type name like:
-    *   ossim_geometry
-    *   envi_header
-    *   tiff_world_file
-    *   jpeg_world_file
-    *   
-    * @param metadatatypeList stl::vector<ossimString> List to append to.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList) const;
- 
-protected:
-   static ossimImageMetaDataWriterFactory* theInstance;
-
-   ossimImageMetaDataWriterFactory();
-
-   ossimImageMetaDataWriterFactory(const ossimImageMetaDataWriterFactory& rhs);
-
-   const ossimImageMetaDataWriterFactory& operator =(
-      const ossimImageMetaDataWriterFactory& rhs);
-   
-TYPE_DATA 
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageMetaDataWriterFactoryBase.h b/ossim/include/ossim/imaging/ossimImageMetaDataWriterFactoryBase.h
deleted file mode 100644
index fe5d706..0000000
--- a/ossim/include/ossim/imaging/ossimImageMetaDataWriterFactoryBase.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//----------------------------------------------------------------------------
-// $Id: ossimImageMetaDataWriterFactoryBase.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageMetaDataWriterFactoryBase_HEADER
-#define ossimImageMetaDataWriterFactoryBase_HEADER
-#include <ossim/base/ossimObjectFactory.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimMetadataFileWriter;
-
-class ossimImageMetaDataWriterFactoryBase : public ossimObjectFactory
-{
-public:
-   /**
-    * Pure virtual.  All ossimImageMetaDataWriterFactories must implement.
-    * 
-    * Creates a writer from either a class name or a string representing the
-    * meta data type like "tiff_world_file".
-    *
-    * @return ossimRefPtr<ossimMetadataFileWriter>
-    *
-    * @note Return can have a null pointer if type is not found in a factory so
-    * the caller should always check the pointer like:
-    * ossimRefPtr<ossimMetadataFileWriter> mw =
-    *    ossimImageMetaDataWriterRegistry::instance("ossim_readme");
-    * if (!mw.valid())
-    * {
-    *    // not in factory
-    * }
-    */
-   virtual ossimRefPtr<ossimMetadataFileWriter> createWriter(
-      const ossimString& type)const=0;
-
-   /**
-    * Pure virtual.  All ossimImageMetaDataWriterFactories must implement.
-    * 
-    * Appends the meta data writers types to the "metadatatypeList".
-    * 
-    * This is the actual metadata type name like:
-    *   ossim_geometry
-    *   envi_header
-    *   tiff_world_file
-    *   jpeg_world_file
-    *   
-    * @param metadatatypeList stl::vector<ossimString> List to append to.
-    *
-    * @note All writers should append to the list, not, clear it and then add
-    * their types.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList) const=0;
-
-protected:
-   ossimImageMetaDataWriterFactoryBase();
-   
-   ossimImageMetaDataWriterFactoryBase(
-      const ossimImageMetaDataWriterFactoryBase&);
-   
-   const ossimImageMetaDataWriterFactoryBase& operator=(
-      const ossimImageMetaDataWriterFactoryBase&);
-
-TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageMetaDataWriterRegistry.h b/ossim/include/ossim/imaging/ossimImageMetaDataWriterRegistry.h
deleted file mode 100644
index 92574d8..0000000
--- a/ossim/include/ossim/imaging/ossimImageMetaDataWriterRegistry.h
+++ /dev/null
@@ -1,99 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//----------------------------------------------------------------------------
-// $Id: ossimImageMetaDataWriterRegistry.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimImageMetaDataWriterRegistry_HEADER
-#define ossimImageMetaDataWriterRegistry_HEADER
-#include <ossim/imaging/ossimImageMetaDataWriterFactoryBase.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimMetadataFileWriter;
-
-class OSSIMDLLEXPORT ossimImageMetaDataWriterRegistry :
-   public ossimImageMetaDataWriterFactoryBase
-{
-public:
-   ~ossimImageMetaDataWriterRegistry();
-   
-   static ossimImageMetaDataWriterRegistry* instance();
-   
-   void registerFactory(ossimImageMetaDataWriterFactoryBase* factory);
-   void unregisterFactory(ossimImageMetaDataWriterFactoryBase* factory);
-   bool findFactory(ossimImageMetaDataWriterFactoryBase* factory)const;
-   /**
-    * Creates an object given a type name.
-    */
-   virtual ossimObject* createObject(const ossimString& typeName)const;
-
-   /**
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const;
-
-   /**
-    * Creates a writer from either a class name or a string representing the
-    * meta data type like "tiff_world_file".
-    *
-    * @return ossimRefPtr<ossimMetadataFileWriter>
-    *
-    * @note Return can have a null pointer if type is not found in a factory so
-    * the caller should always check the pointer like:
-    * ossimRefPtr<ossimMetadataFileWriter> mw =
-    *    ossimImageMetaDataWriterRegistry::instance("ossim_readme");
-    * if (!mw.valid())
-    * {
-    *    // not in factory
-    * }
-    */
-   virtual ossimRefPtr<ossimMetadataFileWriter> createWriter(
-      const ossimString& type)const;
-   
-   /**
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-
-   /**
-    * Initializes list with meta data types from all registered
-    * metadata factories.
-    * 
-    * This is the actual image type name like:
-    *   ossim_geometry
-    *   envi_header
-    *   tiff_world_file
-    *   jpeg_world_file
-    *   
-    * @param metadatatypeList stl::vector<ossimString> list to append to.
-    *
-    * @note Since this is the master registry for all meta data factories
-    * this method starts by clearing the metadatatypeList.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList)const;
-   
-protected:
-   ossimImageMetaDataWriterRegistry();
-
-   ossimImageMetaDataWriterRegistry(
-      const ossimImageMetaDataWriterRegistry& rhs);
-   
-   const ossimImageMetaDataWriterRegistry& operator=(
-      const ossimImageMetaDataWriterRegistry &rhs);
-
-  // static ossimImageMetaDataWriterRegistry* theInstance;
-   std::vector<ossimImageMetaDataWriterFactoryBase*> theFactoryList;
-};
-
-
-extern "C"
-{
-   OSSIMDLLEXPORT void* ossimImageMetaDataWriterRegistryGetInstance();
-}
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageModel.h b/ossim/include/ossim/imaging/ossimImageModel.h
deleted file mode 100644
index d2bad58..0000000
--- a/ossim/include/ossim/imaging/ossimImageModel.h
+++ /dev/null
@@ -1,190 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class declaration of ossimImageModel.
-//
-//-----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimImageModel_HEADER
-#define ossimImageModel_HEADER 1
-
-#include <vector>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimRtti.h>
-
-class ossimDrect;
-class ossimImageHandler;
-
-/**
- * @brief Class to handle transforming image points, rectangles, and offsets
- * from one reduced resolution data set (rrds) level to another.
- *
- * Derived from ossimObject only so users can pass via the
- * ossimViewInterface::setView method.
- */
-class OSSIM_DLL ossimImageModel : public ossimObject
-{
-public:
-   
-   /** @brief default constructor */
-   ossimImageModel();
-
-
-   /**
-    * @brief Method to initialize class from an image handler.
-    *
-    * @param ih Image handler.
-    */
-   virtual void initialize(const ossimImageHandler& ih);
-
-   /**
-    * @brief Get r0 point from rn point.
-    * 
-    * @param rrds Source (rnPt) reduced resolution data set.
-    *
-    * @param rnPt The image point to tranform.
-    *
-    * @param r0Pt the Point to initialize.
-    *
-    * @note Throws ossimException on out of range rrds.
-    */
-   void rnToR0(ossim_uint32 rrds,
-               const ossimDpt& rnPt,
-               ossimDpt& r0Pt) const;
-
-   /**
-    * @brief Get r0 point from rn point.
-    *
-    * This requires calling setTargetRrds(ossim_uint32 rrds) to the level
-    * for rnPt.
-    * 
-    * @param rnPt The image point to tranform.
-    *
-    * @param r0Pt the Point to initialize.
-    *
-    * @note Throws ossimException on out of range rrds.
-    *
-    * @see setTargetRrds
-    */
-   void rnToR0(const ossimDpt& rnPt, ossimDpt& r0Pt) const;
-   
-   /**
-    * @brief Get rn point from r0 point.
-    * 
-    * @param rrds Target (rnPt) reduced resolution data set.
-    *
-    * @param r0Pt The image point to tranform.
-    *
-    * @param rnPt the Point to initialize.
-    *
-    * @note Throws ossimException on out of range rrds.
-    */
-   void r0ToRn(ossim_uint32 rrds,
-               const ossimDpt& r0Pt,
-               ossimDpt& rnPt) const;
-
-   /**
-    * @brief Get rn point from r0 point.
-    *
-    * This requires calling setTargetRrds(ossim_uint32 rrds) to the level
-    * for rnPt.
-    * 
-    * @param r0Pt The image point to tranform.
-    *
-    * @param rnPt the Point to initialize.
-    *
-    * @note Throws ossimException on out of range rrds.
-    *
-    * @see setTargetRrds
-    */
-   void r0ToRn(const ossimDpt& r0Pt,
-               ossimDpt& rnPt) const;
-
-   /**
-    * @brief Get the sub image offset for a given resolution level.
-    * 
-    * @param rrds The reduced resolution data set.
-    *
-    * @param offset the Point to initialize.
-    *
-    * @note Throws ossimException on out of range rrds.
-    */
-   void getSubImageOffset(ossim_uint32 rrds, ossimDpt& offset) const;
-
-   /**
-    * @brief Gets the zero-based image rectangle for a given reduced resolution
-    * data set.
-    *
-    * @param rrds The reduced resolution data set.
-    *
-    * @param rect Initialized with image rectangle for rrds.
-    *
-    * @note Throws ossimException on out of range rrds.
-    */
-   void getImageRectangle(ossim_uint32 rrds, ossimDrect& rect) const; 
-   
-   /**
-    * @brief Gets the model-based image rectangle for a given reduced
-    * resolution data set.
-    *
-    * If this image is a sub image the offset is applied.  So if the image
-    * has a sub image offset of (1024, 1024), and has 1024 lines and 1024
-    * samples the rectangle for r0 will be:  (1024, 1024) (2047, 2047)
-    *
-    * @param rrds The reduced resolution data set.
-    *
-    * @param rect Initialized with image rectangle for rrds.
-    *
-    * @note Throws ossimException on out of range rrds.
-    */
-   void getBoundingRectangle(ossim_uint32 rrds, ossimDrect& rect) const;
-
-   /**
-    * @return This returns the total number of decimation levels.
-    */
-   ossim_uint32 getNumberOfDecimationLevels()const;
-
-   /**
-    * @brief Set theTargetRrds data member.
-    *
-    * This is used by methods rnToR0 and r0ToRn that do not take a rrds
-    * argument.
-    *
-    * @param rrds Target reduced resolution data set.
-    */
-   void setTargetRrds(ossim_uint32 rrds);
-
-   /**
-    * @return The target reduced resolution data set.
-    */
-   ossim_uint32 getTargetRrds() const;
-   
- 
-
-protected:
-   /** @brief virtual destructor */
-   virtual ~ossimImageModel();
-
-   /** Offset from the full image. */
-   ossimDpt theSubImageOffset;
-
-   /** Decimation factors for each rrds level. */
-   std::vector<ossimDpt> theDecimationFactors;
-
-   ossim_uint32 theLines;
-   ossim_uint32 theSamples;
-   ossim_uint32 theTargetRrds;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageModel_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageMosaic.h b/ossim/include/ossim/imaging/ossimImageMosaic.h
deleted file mode 100644
index 753e9cf..0000000
--- a/ossim/include/ossim/imaging/ossimImageMosaic.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageMosaic.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageMosaic_HEADER
-#define ossimImageMosaic_HEADER
-#include <vector>
-using namespace std;
-
-#include <ossim/imaging/ossimImageCombiner.h>
-
-
-/**
- * An image mosaic is a simple combiner that will
- * just do a simple mosaic.  It just checks NULL pix values until it finds a
- * pixel that is not empty and copies it out to the output.  The list will
- * have same size tiles and have the same number of bands.
- */
-class OSSIMDLLEXPORT ossimImageMosaic : public ossimImageCombiner
-{
-public:
-   ossimImageMosaic();
-   ossimImageMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-protected:
-   virtual ~ossimImageMosaic();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theTile;
-
-   template <class T> ossimRefPtr<ossimImageData> combine(
-      T, // dummy template variable not used
-      const ossimIrect& tileRect,
-      ossim_uint32 resLevel=0);
-   template <class T> ossimRefPtr<ossimImageData> combineNorm(
-      T, // dummy template variable not used
-      const ossimIrect& tileRect,
-      ossim_uint32 resLevel=0);
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageMosaic_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageRenderer.h b/ossim/include/ossim/imaging/ossimImageRenderer.h
deleted file mode 100644
index 55ad6b5..0000000
--- a/ossim/include/ossim/imaging/ossimImageRenderer.h
+++ /dev/null
@@ -1,500 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*******************************************************************
-// $Id: ossimImageRenderer.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimImageRenderer_HEADER
-#define ossimImageRenderer_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/projection/ossimImageViewTransform.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/base/ossimViewInterface.h>
-#include <ossim/base/ossimRationalNumber.h>
-
-class ossimImageData;
-class ossimDiscreteConvolutionKernel;
-class ossimFilterResampler;
-
-class OSSIMDLLEXPORT ossimImageRenderer : public ossimImageSourceFilter,
-                                          public ossimViewInterface
-{
-public:
-   ossimImageRenderer();
-   ossimImageRenderer(ossimImageSource* inputSource,
-                      ossimImageViewTransform* imageViewTrans = NULL);
-
-   virtual ossimString getLongName()  const;
-   virtual ossimString getShortName() const;
-
-   /**
-    * the resampler will need the tile request to come from the view.
-    * It will use the view to transoform this to world and then use the
-    * image's projection to get it into final line sample.  This way
-    * the resampler can fill a tile width by height on the screen
-    * correctly.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-
-   /**
-    * m_Resampler will adjust the rect to whatever the view is.  So it
-    * will project the full image rect onto the view and return the upright
-    * bounding rect.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-
-   /**
-    * @brief Gets the bounding rectangle of the source.
-    *
-    * This is the output view bounds.
-    * 
-    * @param rect Initialized with bounding rectangle by this.
-    * @param resLevel Reduced resolution level if applicable.
-    */
-   virtual void getBoundingRect(ossimIrect& rect,
-                                ossim_uint32 resLevel=0) const;
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   void setImageViewTransform(ossimImageViewTransform* transform);
-   ossimImageViewTransform* getImageViewTransform() { return m_ImageViewTransform.get(); }
-
-   //! Returns instance to the input image geometry. This may be a NULL pointer.
-   //! This is only valid if the IVT is a projection type IVT (IVPT) 
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   virtual bool setView(ossimObject* baseObject);
-   ossimFilterResampler* getResampler() { return m_Resampler; }
-   virtual ossimObject* getView();
-   virtual const ossimObject* getView()const;
-
-   virtual void getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result)const;
-  virtual void getDecimationFactors(vector<ossimDpt>& decimations)const;
-  virtual ossim_uint32 getNumberOfDecimationLevels()const;
-  
-   virtual void setAutoUpdateInputTransformFlag(bool flag){ m_AutoUpdateInputTransform = flag; }
-   
-   /**
-    * ordering specifies how the vertices should be arranged.
-    * valid image vertices is basically the tightly fit convex hull
-    * of the image.  Usually an image has NULL values and are
-    * internally not upright rectangular.  This can cause
-    * problems some spatial filters.
-    *
-    * We need to make sure that the resampler overrides this method.
-    * it needs to transform the vertices to the view's side.
-    */
-   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0)const;
-
-   void setMaxLevelsToCompute(ossim_uint32 maxLevels);
-   ossim_uint32 getMaxLevelsToCompute()const;
-   
-   void connectInputEvent(ossimConnectionEvent& event);
-   void disconnectInputEvent(ossimConnectionEvent& event);
-   void propertyEvent(ossimPropertyEvent& event);
-   virtual void refreshEvent(ossimRefreshEvent& event);
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @brief Enables source.
-    *
-    * Overrides ossimSource::enableSource so bounding rects are recomputed on
-    * state change.
-    */
-   virtual void enableSource();
-
-   /**
-    * @brief Disables source.
-    *
-    * Overrides ossimSource::disableSource so bounding rects are recomputed on
-    * state change.
-    */
-   virtual void disableSource();
-
-   /**
-    * @brief Sets the enable flag.
-    *
-    * @param flag True to enable, false to disable.
-    * 
-    * Overrides ossimSource::setEnableFlag so bounding rects are recomputed on
-    * state change.
-    */
-   virtual void setEnableFlag(bool flag);
-
-   
-protected:
-   virtual ~ossimImageRenderer();
-
-private:
-   
-   class ossimRendererSubRectInfo
-   {
-    enum SplitFlag{
-      SPLIT_NONE = 0,
-      UPPER_LEFT_SPLIT_FLAG  = 1,
-      UPPER_RIGHT_SPLIT_FLAG = 2,
-      LOWER_RIGHT_SPLIT_FLAG = 4,
-      LOWER_LEFT_SPLIT_FLAG  = 8,
-      SPLIT_ALL = UPPER_LEFT_SPLIT_FLAG|UPPER_RIGHT_SPLIT_FLAG|LOWER_RIGHT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG
-    };
-   public:
-      friend std::ostream& operator <<(std::ostream& out, const ossimRendererSubRectInfo& rhs)
-      {
-         return out << "vul:   " << rhs.m_Vul << endl
-            << "vur:   " << rhs.m_Vur << endl
-            << "vlr:   " << rhs.m_Vlr << endl
-            << "vll:   " << rhs.m_Vll << endl
-            << "iul:   " << rhs.m_Iul << endl
-            << "iur:   " << rhs.m_Iur << endl
-            << "ilr:   " << rhs.m_Ilr << endl
-            << "ill:   " << rhs.m_Ill << endl
-            << "scale: " << rhs.m_ViewToImageScale << endl;
-
-      }
-
-      ossimRendererSubRectInfo(ossimImageViewTransform* transform=0);
-      ossimRendererSubRectInfo(ossimImageViewTransform* transform,
-                               const ossimDpt& vul,
-                               const ossimDpt& vur,
-                               const ossimDpt& vlr,
-                               const ossimDpt& vll);
-         
-      bool imageHasNans()const;
-      bool imageIsNan()const;
-      bool viewHasNans()const;
-      bool viewIsNan()const;
-
-      void splitView(std::vector<ossimRendererSubRectInfo>& result)const;
-      //void splitView(ossimRendererSubRectInfo& ulRect,
-      //               ossimRendererSubRectInfo& urRect,
-      //               ossimRendererSubRectInfo& lrRect,
-      //               ossimRendererSubRectInfo& llRect)const;
-      
-      void transformViewToImage();
-      void transformImageToView();
-      bool tooBig()const;
-      void roundToInteger();
-      void stretchImageOut(bool enableRound=false);
-      ossimDrect getViewRect()const;
-      ossimDrect getImageRect()const;
-      void roundImageToInteger();
-      void roundViewToInteger();
-      bool isViewEqual(const ossimRendererSubRectInfo& infoRect)const;
-      bool isViewEqual(const ossimDrect& viewRect)const;
-      ossimDpt computeViewToImageScale(const ossimDpt& viewPt, const ossimDpt& delta=ossimDpt(1.0,1.0))const;
-      ossimDpt getAbsValueViewToImageScales()const;
-      ossimDpt getAbsValueImageToViewScales()const;
-      ossimDpt computeRoundTripErrorViewPt(const ossimDpt& dpt)const;
-      bool isViewAPoint()const;
-      bool isIdentity()const;
-      bool canBilinearInterpolate(double error)const;
-
-      ossimDpt getParametricCenter(const ossimDpt& ul, const ossimDpt& ur, 
-				    const ossimDpt& lr, const ossimDpt& ll)const;
-
-     void getViewMids(ossimDpt& upperMid,
-		      ossimDpt& rightMid,
-		      ossimDpt& bottomMid,
-		      ossimDpt& leftMid,
-		      ossimDpt& center)const;
-
-     void getImageMids(ossimDpt& upperMid,
-		       ossimDpt& rightMid,
-		       ossimDpt& bottomMid,
-		       ossimDpt& leftMid,
-		       ossimDpt& center)const;
-     ossim_uint16 getSplitFlags()const;
-
-      ossimDpt m_Iul;
-      ossimDpt m_Iur;
-      ossimDpt m_Ilr;
-      ossimDpt m_Ill;
-
-      ossimIpt m_Vul;
-      ossimIpt m_Vur;
-      ossimIpt m_Vlr;
-      ossimIpt m_Vll;
-
-      ossimDpt m_ViewToImageScale;
-      ossimDpt m_ImageToViewScale;
-
-
-      ossimDpt m_VulScale;
-      ossimDpt m_VurScale;
-      ossimDpt m_VlrScale;
-      ossimDpt m_VllScale;
-
-      ossimDpt m_ulRoundTripError;
-      ossimDpt m_urRoundTripError;
-      ossimDpt m_lrRoundTripError;
-      ossimDpt m_llRoundTripError;
-
-      mutable ossimRefPtr<ossimImageViewTransform> m_transform;
-      mutable const ossimPolyArea2d* m_viewBounds;
-
-    private:
-      void splitHorizontal(std::vector<ossimRendererSubRectInfo>& result)const;
-      void splitVertical(std::vector<ossimRendererSubRectInfo>& result)const;
-      void splitAll(std::vector<ossimRendererSubRectInfo>& result)const;
-   };
-
-   void recursiveResample(ossimRefPtr<ossimImageData> outputData,
-                          const ossimRendererSubRectInfo& rectInfo,
-			  ossim_uint32 level);
-   
-
-   void fillTile(ossimRefPtr<ossimImageData> outputData,
-                 const ossimRendererSubRectInfo& rectInfo);
-                 
-   ossimIrect getBoundingImageRect()const;
-
-   
-   //! this is called on a property event and on input connection changes.
-   void checkIVT();
-
-   /**
-    * @brief Initializes m_inputR0Rect and m_viewBoundingRect and sets
-    * m_rectsDirty appropriately.
-    */
-   void initializeBoundingRects();
-
-   ossimRefPtr<ossimImageData> getTileAtResLevel(const ossimIrect& boundingRect,
-                                     ossim_uint32 resLevel);
-  template <class T>
-  void resampleTileToDecimation(T dummyVariable,
-				ossimRefPtr<ossimImageData> result,
-				ossimRefPtr<ossimImageData> tile,
-				ossim_uint32 multiplier);
-
-   long computeClosestResLevel(const std::vector<ossimDpt>& decimationFactors,
-                               double scale)const;
-   void stretchQuadOut(const ossimDpt& amount,
-                       ossimDpt& ul,
-                       ossimDpt& ur,
-                       ossimDpt& lr,
-                       ossimDpt& ll);
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-
-   /**
-    *  Deletes all allocated tiles.
-    */
-   void deallocate();
-
-   ossimFilterResampler*       m_Resampler;
-   ossimRefPtr<ossimImageData> m_BlankTile;
-   ossimRefPtr<ossimImageData> m_Tile;
-   ossimRefPtr<ossimImageData> m_TemporaryBuffer;
-
-   /**
-    * This is going to allow us to chain multiple
-    * renderers together.  So if we have one
-    * renderer doing a scale and they pass an r-level
-    * down and we have another renderer within the
-    * chain he will be starting at a different r-level.
-    * The default will be r-level 0 request coming
-    * from the right.
-    */
-   ossim_uint32             m_StartingResLevel;
-   ossimRefPtr<ossimImageViewTransform> m_ImageViewTransform;
-
-   ossimIrect               m_inputR0Rect;
-   ossimIrect               m_viewRect;
-   bool                     m_rectsDirty;
-
-   ossim_uint32             m_MaxRecursionLevel;
-   bool                     m_AutoUpdateInputTransform;
-   ossim_uint32             m_MaxLevelsToCompute;
-
-   ossimPolyArea2d            m_viewArea;
-   
-TYPE_DATA
-};
-
-inline ossimImageRenderer::ossimRendererSubRectInfo::ossimRendererSubRectInfo(ossimImageViewTransform* transform)
-:m_transform(transform),
-m_viewBounds(0)
-{
-   m_Vul.makeNan();
-   m_Vur.makeNan();
-   m_Vlr.makeNan();
-   m_Vll.makeNan();
-   m_Iul.makeNan();
-   m_Iur.makeNan();
-   m_Ilr.makeNan();
-   m_Ill.makeNan();
-   m_ViewToImageScale.makeNan();
-   m_ImageToViewScale.makeNan();            
-}
-
-inline ossimImageRenderer::ossimRendererSubRectInfo::ossimRendererSubRectInfo(ossimImageViewTransform* transform,
-                         const ossimDpt& vul,
-                         const ossimDpt& vur,
-                         const ossimDpt& vlr,
-                         const ossimDpt& vll)
-                         :m_Vul(vul),
-                         m_Vur(vur),
-                         m_Vlr(vlr),
-                         m_Vll(vll),
-                         m_transform(transform),
-                         m_viewBounds(0)
-{
-   m_Iul.makeNan();
-   m_Iur.makeNan();
-   m_Ilr.makeNan();
-   m_Ill.makeNan();
-   m_ViewToImageScale.makeNan();
-   m_ImageToViewScale.makeNan();            
-}
-
-inline bool ossimImageRenderer::ossimRendererSubRectInfo::imageHasNans()const
-{
-   return ( m_Iul.hasNans()||
-      m_Iur.hasNans()||
-      m_Ilr.hasNans()||
-      m_Ill.hasNans());
-}
-
-inline bool ossimImageRenderer::ossimRendererSubRectInfo::imageIsNan()const
-{
-   return ( m_Iul.hasNans()&&
-      m_Iur.hasNans()&&
-      m_Ilr.hasNans()&&
-      m_Ill.hasNans());
-}
-
-inline bool ossimImageRenderer::ossimRendererSubRectInfo::viewHasNans()const
-{
-   return ( m_Vul.hasNans()||
-      m_Vur.hasNans()||
-      m_Vlr.hasNans()||
-      m_Vll.hasNans());
-}
-
-inline bool ossimImageRenderer::ossimRendererSubRectInfo::viewIsNan()const
-{
-   return ( m_Vul.hasNans()&&
-      m_Vur.hasNans()&&
-      m_Vlr.hasNans()&&
-      m_Vll.hasNans());
-}
-
-inline void ossimImageRenderer::ossimRendererSubRectInfo::roundToInteger()
-{
-   m_Iul = ossimIpt(m_Iul);
-   m_Iur = ossimIpt(m_Iur);
-   m_Ilr = ossimIpt(m_Ilr);
-   m_Ill = ossimIpt(m_Ill);
-
-   m_Vul = ossimIpt(m_Vul);
-   m_Vur = ossimIpt(m_Vur);
-   m_Vlr = ossimIpt(m_Vlr);
-   m_Vll = ossimIpt(m_Vll);
-}
-
-inline ossimDrect ossimImageRenderer::ossimRendererSubRectInfo::getViewRect()const
-{
-   return ossimDrect(m_Vul,
-      m_Vur,
-      m_Vlr,
-      m_Vll);            
-}
-
-inline ossimDrect ossimImageRenderer::ossimRendererSubRectInfo::getImageRect()const
-{
-   return ossimDrect(m_Iul,
-      m_Iur,
-      m_Ilr,
-      m_Ill);
-}
-
-inline void ossimImageRenderer::ossimRendererSubRectInfo::roundImageToInteger()
-{
-   m_Iul = ossimIpt(m_Iul);
-   m_Iur = ossimIpt(m_Iur);
-   m_Ilr = ossimIpt(m_Ilr);
-   m_Ill = ossimIpt(m_Ill);
-}
-
-inline void ossimImageRenderer::ossimRendererSubRectInfo::roundViewToInteger()
-{
-   m_Vul = ossimIpt(m_Vul);
-   m_Vur = ossimIpt(m_Vur);
-   m_Vlr = ossimIpt(m_Vlr);
-   m_Vll = ossimIpt(m_Vll);
-}
-
-inline bool ossimImageRenderer::ossimRendererSubRectInfo::isViewEqual(const ossimRendererSubRectInfo& infoRect)const
-{
-   return ( (m_Vul == infoRect.m_Vul)&&
-      (m_Vur == infoRect.m_Vur)&&
-      (m_Vlr == infoRect.m_Vlr)&&
-      (m_Vll == infoRect.m_Vll));
-}
-
-inline bool ossimImageRenderer::ossimRendererSubRectInfo::isViewEqual(const ossimDrect& viewRect)const
-{
-   return ( (m_Vul == viewRect.ul())&&
-      (m_Vur == viewRect.ur())&&
-      (m_Vlr == viewRect.lr())&&
-      (m_Vll == viewRect.ll()));
-}
-
-inline ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getAbsValueViewToImageScales()const
-{
-   if(m_ViewToImageScale.hasNans())
-   {
-      return m_ImageToViewScale;
-   }
-   return ossimDpt(fabs(m_ViewToImageScale.x), fabs(m_ViewToImageScale.y));
-}
-
-inline ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getAbsValueImageToViewScales()const
-{
-   if(m_ImageToViewScale.hasNans())
-   {
-      return m_ImageToViewScale;
-   }
-
-   return ossimDpt(fabs(m_ImageToViewScale.x), fabs(m_ImageToViewScale.y));
-}
-
-inline bool ossimImageRenderer::ossimRendererSubRectInfo::isViewAPoint()const
-{
-   return ((m_Vul == m_Vur)&&
-      (m_Vul == m_Vlr)&&
-      (m_Vul == m_Vll));
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageSharpenFilter.h b/ossim/include/ossim/imaging/ossimImageSharpenFilter.h
deleted file mode 100644
index 08eba4e..0000000
--- a/ossim/include/ossim/imaging/ossimImageSharpenFilter.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageSharpenFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageSharpenFilter_HEADER
-#define ossimImageSharpenFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/imaging/ossimConvolutionSource.h>
-class OSSIMDLLEXPORT ossimImageSharpenFilter : public ossimImageSourceFilter
-{
-public:
-   ossimImageSharpenFilter(ossimObject* owner=NULL);
-
-   virtual ossimString getShortName()const;
-   virtual ossimString getLongName()const;
-   
-   ossim_uint32 getWidth()const;
-   ossim_float64 getSigma()const;
-   void setWidthAndSigma(ossim_uint32 w, ossim_float64 sigma);
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-   
-   virtual void connectInputEvent(ossimConnectionEvent &event);
-   virtual void disconnectInputEvent(ossimConnectionEvent &event);
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-protected:
-   virtual ~ossimImageSharpenFilter();
-   inline double laplacianOfGaussian(double x, double y, double sigma)
-   {
-      double r2 = x*x+y*y;
-      double sigma2 = sigma*sigma;
-      return ((1.0/(M_PI*sigma2*sigma2))*
-              (1.0-r2/(2.0*sigma2))*
-              (exp(-r2/(2.0*sigma2))));
-      
-   }
-   
-   void buildConvolutionMatrix();
-   
-
-   /*!
-    * Convolve full means that the input data is full and has
-    * no null data.  We don't have to compare for nulls here
-    */
-   template<class T>
-   void sharpenFull(T,
-                    const ossimRefPtr<ossimImageData>& inputData,
-                    ossimRefPtr<ossimImageData>& outputData);
-   
-   /*!
-    * Convolve partial means that the input data is has some
-    * null data.  We will have to compare nulls
-    */
-   template<class T>
-   void sharpenPartial(T,
-                       const ossimRefPtr<ossimImageData>& inputData,
-                       ossimRefPtr<ossimImageData>& outputData);
-
-   ossimRefPtr<ossimConvolutionSource> theConvolutionSource;
-   ossim_uint32 theWidth;
-   ossim_float64 theSigma;
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageSharpenFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageSource.h b/ossim/include/ossim/imaging/ossimImageSource.h
deleted file mode 100644
index e5124e0..0000000
--- a/ossim/include/ossim/imaging/ossimImageSource.h
+++ /dev/null
@@ -1,247 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageSource_HEADER
-#define ossimImageSource_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimSource.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-
-class ossimDpt;
-
-class OSSIMDLLEXPORT ossimImageSource : public ossimSource
-{
-public:
-   ossimImageSource(ossimObject* owner = 0);
-   ossimImageSource(ossimObject* owner,
-                    ossim_uint32 inputListSize,
-                    ossim_uint32 outputListSize,
-                    bool inputListIsFixedFlag=true,
-                    bool outputListIsFixedFlag=true);
-   virtual ~ossimImageSource();
-
-   /**
-    * @return from origin out to tile_width-1, and tile_height-1.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIpt& origin,
-                                               ossim_uint32 resLevel=0);
-   
-  /**
-   * @return the requested region of interest
-   */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing. This is the default implementation that is not thread-friendly as it uses the
-    * object's tile then simply copies its buffer to the provided tile. Eventually, all image
-    * sources should override this method.
-    *
-    * @return true on success false on error.  If return is false, result
-    * is undefined so caller should handle appropriately with makeBlank or whatever.
-    *
-    * @note Derived classes should override this method to most efficiently stuff result.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-   
-  /**
-   * For RTTI support. overrides ossimImageSource
-   * get object to return the correct casted base pointer
-   * for RTTI casting
-   */
-   virtual ossimObject* getObject() { return this; }
-   
-   /**
-    * For RTTI support. overrides ossimImageSource
-    * get object to return the correct casted base pointer
-    * for RTTI casting
-    */
-   virtual const ossimObject* getObject() const { return this; }
-
- 
-  /**
-   * Will return the decimation factor for the given resolution 
-   * level.  the decimation is the scale from Resolution 0 or full 
-   * res.  Usually this is a power of 2 decimation where
-   * the decimation result is 1.0/2^resoltion.
-   */
-   virtual void getDecimationFactor(ossim_uint32 resLevel,
-                                    ossimDpt& result)const;
-  
-   /**
-    * Will return an array of all decimations for each resolution level.
-    */
-   virtual void getDecimationFactors(std::vector<ossimDpt>& decimations) const;
-
-   /**
-    * Will return the number of resolution levels.  Note: resolution
-    * level 0 is included in the return count.
-    */
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-   
-   /*!
-    * Returns the number of bands available from the input.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const = 0;
-   
-   /**
-    * Returns the number of bands in a tile returned from this TileSource.
-    */
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-
-   /**
-    * @brief Initializes bandList.
-    * 
-    * This implementation initializes to the zero based order of input bands.
-    * Derived classes that are band selectors should override.
-    *
-    * @param bandList Initialized by this.
-    */
-   virtual void getOutputBandList( std::vector<ossim_uint32>& bandList ) const;
-
-   /**
-    * This will be used to query the output pixel type of the tile source.
-    * Please ignore the argument.  It will soon be removed.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the default processing tile width
-    */
-   virtual ossim_uint32 getTileWidth() const;
-
-   /**
-    * Returns the default processing tile height
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /**
-    * Each band has a null pixel associated with it.  The null pixel 
-    * represents an invalid value.
-    */ 
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   
-   /**
-    * Returns the min pixel of the band.
-    */
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   
-   /**
-    * Returns the max pixel of the band.
-    */
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
-   /**
-    * This will return the bounding rect of the source.  We can have several
-    * sources which are in a chain to modify the bounding image rect.
-    * lets say you are next to an image handler then it will return the
-    * bounding rect for that image.  If you are at the right side of a
-    * resampler then you will get a bounding rect along the image view plane.
-    * This is going to be a very import method for both image writers,
-    * mosaics or anything that needs to operate only within the bounds of an
-    * image.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
-   
-   /**
-    * @brief Gets the bounding rectangle of the source.
-    *
-    * This default implementation calls the getBoundingRect interface that
-    * returns a rectangle.  Derived classes should override as needed.
-    * 
-    * @param rect Initialized with bounding rectangle by this.
-    * @param resLevel Reduced resolution level if applicable.
-    */
-   virtual void getBoundingRect(ossimIrect& rect,
-                                ossim_uint32 resLevel=0) const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * ordering specifies how the vertices should be arranged.
-    * valid image vertices is basically the tightly fit convex hull
-    * of the image.  Usually an image has NULL values and are
-    * internally not upright rectangular.  This can cause
-    * problems some spatial filters.
-    *
-    * The default implementation is to return the bounding rect.
-    */
-   virtual void getValidImageVertices(
-      std::vector<ossimIpt>& validVertices,
-      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-      ossim_uint32 resLevel=0)const;
-
-   /**
-    * Returns the image geometry object associated with this tile source or
-    * NULL if not defined. The geometry contains full-to-local image transform
-    * as well as projection (image-to-world). Default implementation returns
-    * the image geometry object associated with the next  
-    * (left) input source (if any) connected to this source in the chain, or
-    * NULL.
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   /**
-    * Default implementation sets geometry of the first input to the geometry
-    * specified.
-    */
-   virtual void setImageGeometry(const ossimImageGeometry* geom);
-       
-   /** Default method to call input's saveImageGeometry. */
-   virtual void saveImageGeometry() const;
-   
-   /** Default method to call input's saveImageGeometry. */
-   virtual void saveImageGeometry(const ossimFilename& geometry_file) const;
-   
-   virtual void initialize()=0;
-   
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @return Flag indicating the data contains pallete indexes.
-    *
-    * This should be replaced by a getPhotoInterpretation().
-    */
-   virtual bool isIndexedData() const;
-   
-protected:
-
-   ossimImageSource (const ossimImageSource& rhs);
-   const ossimImageSource& operator= (const ossimImageSource&);
-
-private:
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageSourceFilter.h b/ossim/include/ossim/imaging/ossimImageSourceFilter.h
deleted file mode 100644
index fccac4d..0000000
--- a/ossim/include/ossim/imaging/ossimImageSourceFilter.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-//*******************************************************************
-//  $Id: ossimImageSourceFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageSourceFilter_HEADER
-#define ossimImageSourceFilter_HEADER
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/base/ossimConnectionEvent.h>
-
-class OSSIMDLLEXPORT ossimImageSourceFilter : public ossimImageSource,
-     public ossimConnectableObjectListener
-{
-public:
-   ossimImageSourceFilter(ossimObject* owner=NULL);
-   ossimImageSourceFilter(ossimImageSource* inputSource);
-   ossimImageSourceFilter(ossimObject* owner,
-                          ossimImageSource* inputSource);
-
-   /*!
-    * Returns the input connection's output band list.
-    * If not connected calls ossimImageSource::getOutputBandList.
-    */
-   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
-   
-   /*!
-    * Returns the number of bands available from the input.
-    */
-   virtual ossim_uint32 getNumberOfInputBands()const;   
-
-   virtual void initialize();
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   bool canConnectMyInputTo(ossim_int32 inputIndex,
-                            const ossimConnectableObject* object)const;
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-   virtual void propertyEvent(ossimPropertyEvent& event);
-   virtual void refreshEvent(ossimRefreshEvent& event);
-   
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-protected:
-   virtual ~ossimImageSourceFilter();
-   ossimImageSource* theInputConnection;
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageSourceFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimImageSourceSequencer.h b/ossim/include/ossim/imaging/ossimImageSourceSequencer.h
deleted file mode 100644
index eadc08c..0000000
--- a/ossim/include/ossim/imaging/ossimImageSourceSequencer.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimImageSourceSequencer.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageSourceSequencer_HEADER
-#define ossimImageSourceSequencer_HEADER 1
-
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-
-
-class OSSIMDLLEXPORT ossimImageSourceSequencer
-   :
-      public ossimImageSource,
-      public ossimConnectableObjectListener
-{
-public:
-   ossimImageSourceSequencer(ossimImageSource* inputSource=NULL,
-                             ossimObject* owner=NULL);
-
-   virtual ~ossimImageSourceSequencer();
-  /*!
-    * This will return the number of tiles within the
-    * area of interest.
-    */
-   ossim_int64 getNumberOfTiles()const;
-
-   /*!
-    * Will return the number of tiles along the
-    * x or horizontal direction.
-    */
-   ossim_int64 getNumberOfTilesHorizontal()const;
-
-   /*!
-    * Will return the number of tiles along the
-    * y or vertical direction.
-    */
-   ossim_int64 getNumberOfTilesVertical()const;
-
-   /*!
-    * This must be called.  We can only initialize this
-    * object completely if we know all connections
-    * are valid.  Some other object drives this and so the
-    * connection's initialize will be called after.  The job
-    * of this connection is to set up the sequence.  It will
-    * default to the bounding rect.  The area of interest can be
-    * set to some other rectagle (use setAreaOfInterest).
-    */
-   virtual void initialize();
-
-   /*!
-    * Will set the current area of interest.
-    */
-   virtual void setAreaOfInterest(const ossimIrect& areaOfInterest);
-
-   /*!
-    * Just returns the current area of interest.
-    */
-   const ossimIrect& getAreaOfInterest()const;
-
-   /*!
-    * Will set the internal pointers to the upperleft
-    * tile number.  To go to the next tile in the sequence
-    * just call getNextTile.
-    */
-   virtual void setToStartOfSequence();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-   /*!
-    * Will allow you to get the next tile in the sequence.
-    * Note the last tile returned will be an invalid
-    * ossimRefPtr<ossimImageData>.  Callers should be able to do:
-    * 
-    * ossimRefPtr<ossimImageData> id = sequencer->getNextTile();
-    * while (id.valid())
-    * {
-    *    doSomething;
-    *    id = sequencer->getNextTile();
-    * }
-    * 
-    */
-   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
-
-   virtual bool getTileOrigin(ossim_int64 id, ossimIpt& origin)const;
-
-   /*!
-    * @brief Establishes a tile rect given tile ID.
-    * @param tile_id
-    * @param rect Rectangle to initialize.
-    * @return true if valid; else, false.
-    */
-   bool getTileRect(ossim_int64 tile_id, ossimIrect& rect) const;
-
-   virtual ossimRefPtr<ossimImageData> getTile(ossim_int64 id,
-                                               ossim_uint32 resLevel=0);
-
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-   virtual void getDecimationFactor(ossim_uint32 resLevel,
-                                    ossimDpt& result) const;
-   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
-   virtual ossim_uint32 getNumberOfDecimationLevels()const;
-   
-   /*!
-    * Returns the number of bands available from the input.
-    */
-   virtual ossim_uint32 getNumberOfInputBands()const;   
-
-   virtual ossimScalarType getOutputScalarType() const;
-      
-   virtual ossim_uint32 getTileWidth() const;
-   virtual ossim_uint32 getTileHeight() const;
-   
-   virtual void slaveProcessTiles();
-   virtual bool isMaster()const;
-
-   virtual ossimIpt getTileSize()const;
-   virtual void setTileSize(const ossimIpt& tileSize);
-   virtual void setTileSize(ossim_int32 width, ossim_int32 height);
-   
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-   
-   virtual bool canConnectMyInputTo(ossim_int32 inputIndex,
-                                    const ossimConnectableObject* object)const;
-   
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
-protected:
-   ossimImageSource*  theInputConnection;
-   ossimRefPtr<ossimImageData> theBlankTile;
-   /*!
-    * Is the area of interest.  The default will
-    * 
-    */
-   ossimIrect theAreaOfInterest;
-
-   /*!
-    * Called during initialize.
-    */
-   ossimIpt theTileSize;
-
-   //---
-   // These need to be big(64 bit) for high resolution tile servers. Made
-   // signed for ease of going to/from ipt and irect which are both signed.
-   //---
-   ossim_int64 theNumberOfTilesHorizontal;
-   ossim_int64 theNumberOfTilesVertical;
-   ossim_int64 theCurrentTileNumber;
-
-   virtual void updateTileDimensions();
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageToPlaneNormalFilter.h b/ossim/include/ossim/imaging/ossimImageToPlaneNormalFilter.h
deleted file mode 100644
index e1b87f4..0000000
--- a/ossim/include/ossim/imaging/ossimImageToPlaneNormalFilter.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageToPlaneNormalFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageToPlaneNormalFilter_HEADER
-#define ossimImageToPlaneNormalFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIMDLLEXPORT ossimImageToPlaneNormalFilter : public ossimImageSourceFilter
-{
-public:
-   ossimImageToPlaneNormalFilter();
-   ossimImageToPlaneNormalFilter(ossimImageSource* inputSource);
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual ossim_uint32    getNumberOfOutputBands() const;
-   
-   void setXScale(const double& scale);
-   void setYScale(const double& scale);
-   
-   double getXScale()const;
-   double getYScale()const;
-
-   void setTrackScaleFlag(bool flag);
-   bool getTrackScaleFlag()const;
-   
-   void   setSmoothnessFactor(double value);
-   double getSmoothnessFactor()const;
-   
-   bool loadState(const ossimKeywordlist& kwl,
-                  const char* prefix);
-   bool saveState(ossimKeywordlist& kwl,
-                  const char* prefix)const;
-   virtual void initialize();
-   /* ------------------- PROPERTY INTERFACE -------------------- */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   /* ------------------ PROPERTY INTERFACE END ------------------- */
-   
-protected:
-   ossimRefPtr<ossimImageData> theTile;
-   ossimRefPtr<ossimImageData> theBlankTile;
-   ossimIrect      theInputBounds;
-   bool            theTrackScaleFlag;
-   double          theXScale;
-   double          theYScale;
-   double          theSmoothnessFactor;
-   
-   void initializeTile();
-   virtual void computeNormals(ossimRefPtr<ossimImageData>& inputTile,
-                               ossimRefPtr<ossimImageData>& outputTile);
-
-   template <class T>
-   void computeNormalsTemplate(T inputScalarTypeDummy,
-                               ossimRefPtr<ossimImageData>& inputTile,
-                               ossimRefPtr<ossimImageData>& outputTile);
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageWriterFactory.h b/ossim/include/ossim/imaging/ossimImageWriterFactory.h
deleted file mode 100644
index db15034..0000000
--- a/ossim/include/ossim/imaging/ossimImageWriterFactory.h
+++ /dev/null
@@ -1,64 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Frank Warmerdam (warmerda at home.com)
-//
-//*******************************************************************
-//  $Id: ossimImageWriterFactory.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimImageWriterFactory_HEADER
-#define ossimImageWriterFactory_HEADER
-#include <ossim/imaging/ossimImageWriterFactoryBase.h>
-
-class ossimImageWriter;
-class ossimKeywordlist;
-
-class ossimImageWriterFactory: public ossimImageWriterFactoryBase
-{   
-public:
-   virtual ~ossimImageWriterFactory();
-   static ossimImageWriterFactory* instance();
-   
-   ossimImageFileWriter *createWriterFromExtension(const ossimString& fileExtension)const;
-   virtual ossimImageFileWriter* createWriter(const ossimKeywordlist& kwl,
-                                              const char *prefix=0)const;
-   virtual ossimImageFileWriter* createWriter(const ossimString& typeName)const;
-   
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char *prefix=0)const;
-   virtual ossimObject* createObject(const ossimString& typeName)const;
-   
-   virtual void getExtensions(std::vector<ossimString>& result)const;
-   
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-   
-   /*!
-    * getImageTypeList.  This is the actual image type name.  So for
-    * example, ossimTiffWriter has several image types.  Some of these
-    * include TIFF_TILED, TIFF_TILED_BAND_SEPARATE ... etc.  The
-    * ossimGdalWriter
-    * may include GDAL_IMAGINE_HFA, GDAL_RGB_NITF, GDAL_JPEG20000, ... etc
-    * A writer should be able to be instantiated by this name as well as a
-    * class name
-    */
-   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
-   
-   virtual void getImageFileWritersBySuffix(ossimImageWriterFactoryBase::ImageFileWriterList& result,
-                                            const ossimString& ext)const;
-   virtual void getImageFileWritersByMimeType(ossimImageWriterFactoryBase::ImageFileWriterList& result,
-                                              const ossimString& mimeType)const;
-protected:
-   ossimImageWriterFactory() {}
-
-   static ossimImageWriterFactory* theInstance;
-
-	ossimImageFileWriter* createFromMimeType(const ossimString& mimeType)const;
-   bool isImageTypeName(const ossimString& name)const;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimImageWriterFactoryRegistry.h b/ossim/include/ossim/imaging/ossimImageWriterFactoryRegistry.h
deleted file mode 100644
index 891a37a..0000000
--- a/ossim/include/ossim/imaging/ossimImageWriterFactoryRegistry.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Frank Warmerdam (warmerda at home.com)
-//
-//*******************************************************************
-//  $Id: ossimImageWriterFactoryRegistry.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimImageWriterFactoryRegistry_HEADER
-#define ossimImageWriterFactoryRegistry_HEADER
-#include <ossim/base/ossimObjectFactory.h>
-#include <ossim/imaging/ossimImageWriterFactoryBase.h>
-#include <ossim/base/ossimFactoryListInterface.h>
-#include <vector>
-#include <iosfwd>
-
-class ossimImageFileWriter;
-class ossimKeywordlist;
-
-class OSSIMDLLEXPORT ossimImageWriterFactoryRegistry :
-   public ossimObjectFactory,
-   public ossimFactoryListInterface<ossimImageWriterFactoryBase, ossimImageFileWriter>
-{   
-public:
-   static ossimImageWriterFactoryRegistry* instance();
-
-   ossimImageFileWriter *createWriter(const ossimFilename& filename)const;
-   ossimImageFileWriter *createWriterFromExtension(const ossimString& fileExtension)const;
-   ossimImageFileWriter *createWriter(const ossimKeywordlist &kwl,
-                                      const char *prefix=0)const;
-   ossimImageFileWriter* createWriter(const ossimString& typeName)const;
-   
-   ossimObject* createObject(const ossimKeywordlist &kwl,
-                             const char *prefix=0)const;
-
-   ossimObject* createObject(const ossimString& typeName)const;
-   
-   /**
-    * getTypeNameList.  This should return the class type of the object being
-    * used to perform the writting.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-   
-   /**
-    * getImageTypeList.  This is the actual image type name.  So for
-    * example, ossimTiffWriter has several image types.  Some of these
-    * include TIFF_TILED, TIFF_TILED_BAND_SEPARATE ... etc.
-    * The ossimGdalWriter
-    * may include GDAL_IMAGINE_HFA, GDAL_RGB_NITF, GDAL_JPEG20000, ... etc
-    * A writer should be able to be instantiated by this name as well as a
-    * class name
-    */
-   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
-
-   virtual void getImageFileWritersBySuffix(ossimImageWriterFactoryBase::ImageFileWriterList& result,
-                                            const ossimString& ext)const;
-   virtual void getImageFileWritersByMimeType(ossimImageWriterFactoryBase::ImageFileWriterList& result,
-                                              const ossimString& mimeType)const;
-   /**
-    * @brief Prints list of writers from getImageTypeList.
-    * @param  out Stream to print to.
-    * @return std::ostream&
-    */
-   std::ostream& printImageTypeList(std::ostream& out)const;
-
-   /**
-    * @brief Prints list of writers from getImageTypeList.
-    * @param  out Stream to print to.
-    * @return std::ostream&
-    */
-   std::ostream& printWriterProps(std::ostream& out)const;
-   
-protected:
-   ossimImageWriterFactoryRegistry();
-   ossimImageWriterFactoryRegistry(const ossimImageWriterFactoryRegistry&);
-   void operator=(const ossimImageWriterFactoryRegistry&);
-   
-   //static ossimImageWriterFactoryRegistry*    theInstance;
-};
-
-extern "C"
-{
-  OSSIMDLLEXPORT void* ossimImageWriterFactoryRegistryGetInstance();
-}
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimIndexToRgbLutFilter.h b/ossim/include/ossim/imaging/ossimIndexToRgbLutFilter.h
deleted file mode 100644
index 64fc80f..0000000
--- a/ossim/include/ossim/imaging/ossimIndexToRgbLutFilter.h
+++ /dev/null
@@ -1,176 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Oscar Kramer
-//
-//*************************************************************************
-// $Id: ossimIndexToRgbLutFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimIndexToRgbLutFilter_HEADER
-#define ossimIndexToRgbLutFilter_HEADER
-
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <vector>
-
-class ossimImageData;
-
-/***************************************************************************************************
- *
- * This class provides a look-up-table remap from a single band input (the index), to a 3-band RGB
- * output. The LUT is provided as a KWL with several remapping modes supported:
- *
- * Literal: Only those indices represented in the KWL are remapped to the values indicated. All
- * other pixel values are mapped to the NULL pixel (0,0,0). Note that this is only meaningful for
- * integer input scalar types since a normalized input will likely not find an exact match.
- *
- * Arbitrary piecewise linear ("vertices"): The LUT KWL provides vertices to contiguous line
- * segments. Pixel values falling between specified indices are linearly interpolated between
- * adjacent vertices. Any index pixel values falling outside the range between min and max vertex
- * indices will be mapped to the NULL pixel.
- *
- * Regular piecewise linear ("regular"): The entries in the KWL do not correspond to any specific
- * index (except the first and the last entries that correspond to the min and max pixel values).
- * Remaining intermediate entries are equally spaced in index space so that the line segments are of
- * equal length. The min and max values are queried from the input source, but can be overriden with
- * the "min_value" and "max_value" keywords in the LUT KWL.
- *
- * Here are example KWLs for the three modes, first for the literal remap:
- *
- *    type: ossimIndexToRgbLutFilter
- *    mode: literal
- *    entry0.index: 0
- *    entry0.color: 1 1 1
- *    entry1.index: 128
- *    entry1.color: 255 0 0
- *    entry2.index: 255
- *    entry2.color: 0 255 0
- *
- * The above KWL will map only pixels with input values of 0, 128, and 255. All other indices will
- * map to the null value.
- *
- * Example for arbitrary piecewise linear:
- *
- *    type: ossimIndexToRgbLutFilter
- *    mode: vertices
- *    entry0.index: 1
- *    entry0.color: 0 0 255
- *    entry1.index: 128
- *    entry1.color: 0 255 0
- *    entry2.index: 250
- *    entry2.color: 255 0 0
- *
- * The above KWL is a sort of heat map where indices between 1 and 128 will linearly map from blue
- * to green, and then 128 to 250 will map from green (through yellow) to red. Note that any value
- * above 250 as well as 0 are outside of the remap range and will map to the null pixel (0,0,0).
- *
- * Example or regular piecewise linear. This is the default mode. For backward compatibility, the
- * mode keyword here is optional and if omitted will imply this mode. Also, unlike previous form,
- * the number_of_entries keyword is not required and is ignored if present.
- *
- *    type: ossimIndexToRgbLutFilter
- *    mode: regular
- *    entry0: 0 0 255
- *    entry1: 0 255 0
- *    entry2: 255 0 0
- *    max_value:  250
- *    min_value:  1
- *
- * The above KWL is almost equivalent to the "vertices" example above, i.e., a heat map. However,
- * the individual vertices are not specified. Instead, three entries will define two line segments.
- * The first line segment will commence with index 1 (min_value) and finish at:
- *
- *    [(max_value-min_value)/(number_of_entries-1)] + min_value
- *
- * In this case it will be 125.5. The quantity in square-brackets (124.5) is the interval, or
- * length of each line segment, so the second line segment will go from 125.5 to 250. Input pixel
- * values below the min_value will clamp to the min value (except the null pixel) and those above
- * the max value will clamp to the max value.
- *
- * The table can be contained in a separate file from the main KWL state file. In this case, the
- * loadState can accept a file name in place of a complete table:
- *
- *    type: ossimIndexToRgbLutFilter
- *    lut_file: <path to LUT KWL file>
- * 
- * The format of the LUT KWL file is just as specified above for the inline case.
- *
- **************************************************************************************************/
-class OSSIM_DLL ossimIndexToRgbLutFilter : public ossimImageSourceFilter
-{
-public:
-   enum Mode  { LITERAL = 0, VERTICES  = 1, REGULAR = 2 };
-
-   ossimIndexToRgbLutFilter();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-   
-   ossim_uint32 getNumberOfOutputBands() const;
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   
-   void           setMode(Mode mode) { theMode = mode; }
-   Mode           getMode() const { return theMode; }
-
-   /**
-    * @brief Set lookup table(lut) method.
-    *
-    * This opens the keyword list and initializes lut.
-    *
-    * CAUTION: Requires theMinValue, theMaxValue, and theMode to be set.  Typically a
-    * connection is made prior to this call.  If not connected to an input, "min",
-    * "max" and "mode" keywords should be passed in the keyword list file.
-    *
-    * @param file Keyword list containing lut.
-    */
-   void           setLut(const ossimFilename& file);
-   
-   double         getMinValue()const;
-   double         getMaxValue()const;
-   
-   void           setMinValue(double value);
-   void           setMaxValue(double value);
-   
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual void initialize();
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
-
-protected:
-   virtual ~ossimIndexToRgbLutFilter();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   bool initializeLut(const ossimKeywordlist* kwl, const char* prefix=0);
-   
-   std::map<double, ossimRgbVector> theLut;
-
-   double theMinValue;
-   double theMaxValue;
-   bool   theMinValueOverride;
-   bool   theMaxValueOverride;
-   Mode   theMode;
-   ossimRefPtr<ossimImageData> theTile;
-   ossimFilename   theLutFile;
-   
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimIndexToRgbLutFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimIntensityAdjustmentFilter.h b/ossim/include/ossim/imaging/ossimIntensityAdjustmentFilter.h
deleted file mode 100644
index ab0dbf3..0000000
--- a/ossim/include/ossim/imaging/ossimIntensityAdjustmentFilter.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-// $Id: ossimIntensityAdjustmentFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimIntensityAdjustmentFilter_HEADER
-#define ossimIntensityAdjustmentFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/base/ossimDblGrid.h>
-
-class ossimIntensityAdjustmentFilter : public ossimImageSourceFilter
-{
-public:
-   ossimIntensityAdjustmentFilter();
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-   const ossimIrect& getGridBounds()const
-      {
-         return theGridBounds;
-      }
-   virtual void setIntensityGrid(const ossimDblGrid& grid)
-      {
-         theMeanIntensityGrid = grid;
-      }
-   void setMeanIntensityTarget(double targetMean)
-      {
-         theMeanIntensityTarget = targetMean;
-      }
-   double getMeanIntensityTarget()const
-      {
-         return theMeanIntensityTarget;
-      }
-   ossimDblGrid& getMeanIntensityGrid()
-      {
-         return theMeanIntensityGrid;
-      }
-   const ossimDblGrid& getMeanIntensityGrid()const
-      {
-         return theMeanIntensityGrid;
-      }
-   void createAndPopulateGrid(const ossimIpt& spacing, double targetMean = .5);
-   
-   virtual void initialize();
-protected:
-   virtual ~ossimIntensityAdjustmentFilter();
-
-   virtual void allocate();
-   
-   ossimDblGrid                theMeanIntensityGrid;
-   double                      theMeanIntensityTarget;
-   ossimRefPtr<ossimImageData> theNormTile;
-   ossimRefPtr<ossimImageData> theTile;
-   ossimRefPtr<ossimImageData> theBlankTile;
-
-   ossimIrect   theGridBounds;
-
-   double computeMeanIntensity(ossimRefPtr<ossimImageData>& data);
-   void loadNormTile(ossimRefPtr<ossimImageData>& data);
-   double matchTargetMean(double inputValue,
-                          double meanValue,
-                          double targetMean,
-                          double minValue,
-                          double maxValue);
-   
-TYPE_DATA
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimJpegCodec.h b/ossim/include/ossim/imaging/ossimJpegCodec.h
deleted file mode 100644
index 58bed4b..0000000
--- a/ossim/include/ossim/imaging/ossimJpegCodec.h
+++ /dev/null
@@ -1,134 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: class declaration for base codec(encoder/decoder).
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimJpegCodec_HEADER
-#define ossimJpegCodec_HEADER 1
-#include <ossim/imaging/ossimCodecBase.h>
-
-class OSSIM_DLL ossimJpegCodec : public ossimCodecBase
-{
-public:
-   
-   ossimJpegCodec();
-   virtual ~ossimJpegCodec();
-
-   /**
-    * @return Codec type.  "jpeg"
-    */  
-   virtual ossimString getCodecType()const;
-   
-   /**
-    * @brief Encode jpeg method.
-    *
-    * Current options handled by this factory:
-    *
-    * type: jpeg
-    * quality: 75
-    *
-    * @param in Input data to encode.
-    * 
-    * @param out Encoded output data.
-    *
-    * @return true on success, false on failure.
-    */   
-   virtual bool encode( const ossimRefPtr<ossimImageData>& in,
-                        std::vector<ossim_uint8>& out ) const;
-
-   /**
-    * @brief Decode jpeg method.
-    *
-    * @param in Input data to decode.
-    * 
-    * @param out Output tile.  If the pointer to ossimImageData is null
-    * internally it will be created.  For code loops it is better to pre
-    * initialized to correct size.
-    *
-    * @note Caller should set "out's" image rectangle upon successful
-    * decode.
-    *
-    * @return true on success, false on failure.
-    */
-   virtual bool decode( const std::vector<ossim_uint8>& in,
-                        ossimRefPtr<ossimImageData>& out ) const;
-
-   /**
-    * Ineterface to allow for specific properties to be set.
-    *
-    */ 
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   
-   /**
-    * Interface to get the value of a specific property
-    *
-    * @param in name.  Property name to retrieve
-    *
-    * @return property value
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const; 
-   
-   /**
-    * Get a list of all supported property names.  Currently only "quality" property 
-    * is exposed
-    *
-    * @param out proeprtyNames.  push the list of proeprty names to the list
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   /**
-    * Allocate the state of the object thorugh a factory load/keywordlist
-    *
-    * @param in kwl. Input keywordlist that holds the values.
-    *
-    * @param in prefix. prefix to use for all keywords.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-   
-   /**
-    * Save the state of the codec to the keywordlist
-    *
-    * @param out kwl. Input keywordlist that holds the values.
-    *
-    * @param in prefix. prefix to use for all keywords.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   
-protected:
-
-   /**
-    * @brief For decoding standard jpeg block.
-    * Curently only handles CMYK.
-    * @param in Input jpeg buffer.
-    * @param out Initialized by this.
-    * @return true on success, false on error.
-    */
-   bool decodeJpeg(const std::vector<ossim_uint8>& in,
-                   ossimRefPtr<ossimImageData>& out ) const;
-   
-   /**
-    * @brief For decoding color spaces other that mono and rgb.
-    * Curently only handles CMYK.
-    * @param in Input jpeg buffer.
-    * @param out Initialized by this.
-    * @return true on success, false on error.
-    */
-   bool decodeJpegToRgb(const std::vector<ossim_uint8>& in,
-                        ossimRefPtr<ossimImageData>& out ) const;
-
-   /**
-    * @return The enumerated libjpeg out_color_space.
-    */
-   ossim_int32 getColorSpace( const std::vector<ossim_uint8>& in ) const;
-   
-   ossim_uint32 m_quality;
-   TYPE_DATA;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimJpegDefaultTable.h b/ossim/include/ossim/imaging/ossimJpegDefaultTable.h
deleted file mode 100644
index 3ebe557..0000000
--- a/ossim/include/ossim/imaging/ossimJpegDefaultTable.h
+++ /dev/null
@@ -1,163 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Mingjie Su
-// 
-// Description: Default JPEG Huffman tables. Values from: MIL-STD-188-198, APPENDIX B
-//              Default JPEG quantization tables. Values from: MIL-STD-188-198, APPENDIX A
-//
-//********************************************************************
-// $Id: ossimJpegDefaultTable.h 958 2010-06-03 23:00:32Z ming.su $
-
-#ifndef ossimJpegDefaultTable_HEADER
-#define ossimJpegDefaultTable_HEADER
-
-static const int AC_BITS[16] = 
-{
-  0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125
-};
-
-static const int DC_BITS[16] = 
-{
-  0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const int AC_HUFFVAL[256] =
-{
-  0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,          
-  0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
-  0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xA1, 0x08,
-  0x23, 0x42, 0xB1, 0xC1, 0x15, 0x52, 0xD1, 0xF0,
-  0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0A, 0x16,
-  0x17, 0x18, 0x19, 0x1A, 0x25, 0x26, 0x27, 0x28,
-  0x29, 0x2A, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
-  0x3A, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
-  0x4A, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
-  0x5A, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
-  0x6A, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
-  0x7A, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
-  0x8A, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
-  0x99, 0x9A, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
-  0xA8, 0xA9, 0xAA, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6,
-  0xB7, 0xB8, 0xB9, 0xBA, 0xC2, 0xC3, 0xC4, 0xC5,
-  0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xD2, 0xD3, 0xD4,
-  0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xE1, 0xE2,
-  0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA,
-  0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8,
-  0xF9, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static const int DC_HUFFVAL[256] =
-{
-  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-  0x08, 0x09, 0x0A, 0x0B, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-const static int Q1table[64] = 
-{
-  8,    72,  72,  72,  72,  72,  72,  72, // 0 - 7
-  72,   72,  78,  74,  76,  74,  78,  89, // 8 - 15
-  81,   84,  84,  81,  89, 106,  93,  94, // 16 - 23
-  99,   94,  93, 106, 129, 111, 108, 116, // 24 - 31
-  116, 108, 111, 129, 135, 128, 136, 145, // 32 - 39
-  136, 128, 135, 155, 160, 177, 177, 160, // 40 - 47
-  155, 193, 213, 228, 213, 193, 255, 255, // 48 - 55
-  255, 255, 255, 255, 255, 255, 255, 255  // 56 - 63
-};
-
-const static int Q2table[64] = 
-{ 
-  8,   36,  36,  36,  36,  36,  36,  36, // 0 - 7
-  36,   36,  39,  37,  38,  37,  39,  45, // 8 - 15
-  41,   42,  42,  41,  45,  53,  47,  47, // 16 -23
-  50,   47,  47,  53,  65,  56,  54,  59, // 24 - 31
-  59,   54,  56,  65,  68,  64,  69,  73, // 32 - 39
-  69,   64,  68,  78,  81,  89,  89,  81, // 40 - 47
-  78,   98, 108, 115, 108,  98, 130, 144, // 48 - 55
-  144, 130, 178, 190, 178, 243, 243, 255  // 56 - 63
-};
-
-const static int Q3table[64] = 
-{ 
-  8,  10, 10, 10, 10, 10, 10, 10,  // 0 - 7
-  10, 10, 11, 10, 11, 10, 11, 13,  // 8 - 15
-  11, 12, 12, 11, 13, 15, 13, 13,  // 16 - 23
-  14, 13, 13, 15, 18, 16, 15, 16,  // 24 - 31
-  16, 15, 16, 18, 19, 18, 19, 21,  // 32 - 39
-  19, 18, 19, 22, 23, 25, 25, 23,  // 40 - 47
-  22, 27, 30, 32, 30, 27, 36, 40,  // 48 - 56
-  40, 36, 50, 53, 50, 68, 68, 91   // 57 - 63
-};
-
-const static int Q4table[64] = 
-{
-  8,   7,  7,  7,  7,  7,  7,  7, // 0 - 7
-  7,   7,  8,  7,  8,  7,  8,  9, // 8 - 15
-  8,   8,  8,  8,  9, 11,  9,  9, // 16 - 23
-  10,  9,  9, 11, 13, 11, 11, 12, // 24 - 31
-  12, 11, 11, 13, 14, 13, 14, 15, // 32 - 39
-  14, 13, 14, 16, 16, 18, 18, 16, // 40 - 47
-  16, 20, 22, 23, 22, 20, 26, 29, // 48 - 55
-  29, 26, 36, 38, 36, 49, 49, 65  // 56 - 63
-};
-
-const static int Q5table[64] = 
-{
-  4,   4,  4,  4,  4,  4,  4,  4, // 0 - 7
-  4,   4,  4,  4,  4,  4,  4,  5, // 8 - 15
-  5,   5,  5,  5,  5,  6,  5,  5, // 16 - 23
-  6,   5,  5,  6,  7,  6,  6,  6, // 24 - 31
-  6,   6,  6,  7,  8,  7,  8,  8, // 32 - 39
-  8,   7,  8,  9,  9, 10, 10,  9, // 40 - 47
-  9,  11, 12, 13, 12, 11, 14, 16, // 48 - 55
-  16, 14, 20, 21, 20, 27, 27, 36  // 56 - 63
-};
-
-const static int* QTABLE_ARRAY[5]={Q1table,Q2table,Q3table,Q4table,Q5table};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimJpegMemDest.h b/ossim/include/ossim/imaging/ossimJpegMemDest.h
deleted file mode 100644
index 20c54bc..0000000
--- a/ossim/include/ossim/imaging/ossimJpegMemDest.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//----------------------------------------------------------------------------
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Oscar Kramer, original code from Thomas G. Lane
-//
-// Most of code and comments below are from jpeg-6b "example.c" file. See 
-// http://www4.cs.fau.de/Services/Doc/graphics/doc/jpeg/libjpeg.html
-//
-// Description:
-// Code interfaces to use with jpeg-6b library to write a jpeg image from memory.
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimJpegMemDest_HEADER
-#define ossimJpegMemDest_HEADER 1
-
-#include <ostream>                     /** for std::ostream */
-#include <ossim/base/ossimConstants.h> /** for OSSIM_DLL export macro */
-#include <cstdio>                      /** for size_t  */
-#include <csetjmp>                     /** for jmp_buf */
-extern "C"
-{
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#  ifndef XMD_H
-#    define XMD_H
-#  endif
-#endif
-#include <jpeglib.h> /** for jpeg stuff */
-}
-
-/**
- * @brief Method which uses memory instead of a FILE* to write to.
- * @note Used in place of "jpeg_stdio_dest(&cinfo, outfile)".
- */
-OSSIM_DLL void jpeg_cpp_stream_dest (j_compress_ptr cinfo, std::ostream& stream);
-
-#endif 
diff --git a/ossim/include/ossim/imaging/ossimJpegMemSrc.h b/ossim/include/ossim/imaging/ossimJpegMemSrc.h
deleted file mode 100644
index ea56b1c..0000000
--- a/ossim/include/ossim/imaging/ossimJpegMemSrc.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//----------------------------------------------------------------------------
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken, original code from Thomas G. Lane
-//
-// Description:
-// Code interfaces to use with jpeg-6b library to read a jpeg image from
-// memory.
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimJpegMemSrc_HEADER
-#define ossimJpegMemSrc_HEADER 1
-
-#include <ossim/base/ossimConstants.h> /** for OSSIM_DLL export macro */
-extern "C"
-{
-#include <cstdio>                      /** for size_t  */
-#include <csetjmp>                     /** for jmp_buf */
-#include <jpeglib.h>                   /** for jpeg stuff */
-
-
-/** @brief Extended error handler struct. */
-struct OSSIM_DLL ossimJpegErrorMgr
-{
-  struct jpeg_error_mgr pub;	/* "public" fields */
-  jmp_buf setjmp_buffer;	/* for return to caller */
-};
-typedef struct ossimJpegErrorMgr* ossimJpegErrorPtr;
-
-/**
- * @brief Error routine that will replace jpeg's standard error_exit method.
- */
-OSSIM_DLL void ossimJpegErrorExit (j_common_ptr cinfo);
-
-/**
- * @brief Method which uses memory instead of a FILE* to read from.
- * @note Used in place of "jpeg_stdio_src(&cinfo, infile)".
- */
-OSSIM_DLL void ossimJpegMemorySrc (j_decompress_ptr cinfo,
-                                   const JOCTET * buffer,
-                                   std::size_t bufsize);
-}
-#endif /* #ifndef ossimJpegMemSrc_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimJpegStdIOSrc.h b/ossim/include/ossim/imaging/ossimJpegStdIOSrc.h
deleted file mode 100644
index 9ea09a8..0000000
--- a/ossim/include/ossim/imaging/ossimJpegStdIOSrc.h
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------------------
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken, original code from Thomas G. Lane
-//
-// Description:
-// Code interfaces to use with jpeg-6b library to read a jpeg image from
-// memory.
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimJpegStdIOSrc_HEADER
-#define ossimJpegStdIOSrc_HEADER
-
-#include <ossim/base/ossimConstants.h> /** for OSSIM_DLL export macro */
-extern "C"
-{
-#include <cstdio>                      /** for size_t  */
-#include <csetjmp>                     /** for jmp_buf */
-#include <jpeglib.h>                   /** for jpeg stuff */
-   //#include <jinclude.h>
-   //#include <jerror.h>
-   /**
-    * @brief Method which uses memory instead of a FILE* to read from.
-    * @note Used in place of "jpeg_stdio_src(&cinfo, infile)".
-    */
-   OSSIM_DLL void ossimJpegStdIOSrc ( j_decompress_ptr cinfo,
-                                     FILE* infile);
-}
-#endif /* #ifndef ossimJpegMemSrc_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimJpegTileSource.h b/ossim/include/ossim/imaging/ossimJpegTileSource.h
deleted file mode 100644
index bff30ae..0000000
--- a/ossim/include/ossim/imaging/ossimJpegTileSource.h
+++ /dev/null
@@ -1,216 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for JpegTileSource.
-// JpegTileSource is derived from ImageHandler which is derived from
-// TileSource.
-//*******************************************************************
-//  $Id: ossimJpegTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimJpegTileSource_HEADER
-#define ossimJpegTileSource_HEADER
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimAppFixedTileCache.h>
-
-class  ossimImageData;
-
-class OSSIM_DLL ossimJpegTileSource : public ossimImageHandler
-{
-public:
-
-   ossimJpegTileSource();
-
-   ossimJpegTileSource(const ossimKeywordlist& kwl,
-                       const char* prefix=0);
-
-   ossimJpegTileSource(const char* jpeg_file);
-
-
-   virtual ossimString getShortName() const;
-   virtual ossimString getLongName()  const;
-
-   /**
-    *  Returns a pointer to a tile given an origin representing the upper
-    *  left corner of the tile to grab from the image.
-    *  Satisfies pure virtual from TileSource class.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    *
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-
-   /**
-     *  Returns the number of bands in the image.
-     *  Satisfies pure virtual from ImageHandler class.
-     */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-
-   /**
-    * Returns the number of bands in a tile returned from this TileSource.
-    * Note: we are supporting sources that can have multiple data objects.
-    * If you want to know the scalar type of an object you can pass in the
-    */
-   virtual ossim_uint32 getNumberOfOutputBands()const;
-
-   /**
-     *  Returns the number of lines in the image.
-     *  Satisfies pure virtual from ImageHandler class.
-     */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
-
-   /**
-    *  Returns the number of samples in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
-
-   /**
-    * Returns the zero based image rectangle for the reduced resolution data
-    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
-    */
-   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32    getTileWidth() const;
-
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32    getTileHeight() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   bool isValidRLevel(ossim_uint32 reduced_res_level) const;
-
-
-   bool isOpen()const;
-   /**
-    *  Returns true if the image_file can be opened and is a valid tiff file.
-    */
-   bool open(const ossimFilename& jpeg_file);
-   virtual void close();
-
-   /**
-    * @brief Gets a property for matching name.
-    * @param name The name of the property to get.
-    * @return Returns property matching "name".
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   
-   /**
-    * @brief Gets a list of property names available.
-    * @param propertyNames The list to push back names to.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * Returns the image geometry object associated with this tile source or
-    * NULL if non defined.  The geometry contains full-to-local image
-    * transform as well as projection (image-to-world).
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
-protected:
-
-   /**
-    * @param Method to get geometry from the xml file or internal geotiff
-    * tags.
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const; 
-   
-   virtual ~ossimJpegTileSource();
-	class PrivateData;
-   /**
-    *  Returns true if no errors initializing object.
-    *
-    *  Notes:
-    *  - Callers of this method must ensure "theTiffPtr" data member
-    *    is initialized.
-    *  - This method was added to consolidate object initialization code
-    *    between constructor and public open method.
-    */
-   virtual bool open();
-
-   void allocate();
-   void destroy();
-   void restart();
-
-   /**
-    * @note this method assumes that setImageRectangle has been called on
-    * theTile.
-    */
-   void fillTile(const ossimIrect& clip_rect, ossimImageData* tile);
-
-   ossimRefPtr<ossimImageData>  theTile;
-   ossimRefPtr<ossimImageData>  theCacheTile;
-   ossim_uint8*                 theLineBuffer;
-   FILE*                        theFilePtr;
-   ossimIrect                   theBufferRect;
-   ossimIrect                   theImageRect;
-   ossim_uint32                 theNumberOfBands;
-   ossimIpt                     theCacheSize;
-
-   PrivateData*                 thePrivateData;
-
-   ossimAppFixedTileCache::ossimAppFixedCacheId theCacheId;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimJpegYCbCrToRgbSource.h b/ossim/include/ossim/imaging/ossimJpegYCbCrToRgbSource.h
deleted file mode 100644
index 962b8ce..0000000
--- a/ossim/include/ossim/imaging/ossimJpegYCbCrToRgbSource.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimJpegYCbCrToRgbSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimJpegYCbCrToRgbSource_HEADER
-#define ossimJpegYCbCrToRgbSource_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimJpegYCbCrToRgbSource : public ossimImageSourceFilter
-{
-public:
-   ossimJpegYCbCrToRgbSource();
-   ossimJpegYCbCrToRgbSource(ossimImageSource* inputSource);
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-       
-protected:
-   virtual ~ossimJpegYCbCrToRgbSource();
-
-   virtual void allocate();
-   
-   ossimRefPtr<ossimImageData> theBlankTile;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimMapCompositionSource.h b/ossim/include/ossim/imaging/ossimMapCompositionSource.h
deleted file mode 100644
index 423c70e..0000000
--- a/ossim/include/ossim/imaging/ossimMapCompositionSource.h
+++ /dev/null
@@ -1,337 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimMapCompositionSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimMapCompositionSource_HEADER
-#define ossimMapCompositionSource_HEADER
-#include <ossim/imaging/ossimAnnotationSource.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/font/ossimFont.h>
-#include <ossim/base/ossimFontInformation.h>
-
-class ossimFont;
-class ossimMapProjection;
-class ossimU8ImageData;
-
-class ossimMapCompositionSource : public ossimAnnotationSource
-{
-public:
-   enum ossimGridLineType
-   {
-      OSSIM_GRID_NONE    = 0,
-      OSSIM_GRID_LINE    = 1,
-      OSSIM_GRID_RESEAUX = 2
-   };
-
-   ossimMapCompositionSource();
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual ossim_uint32    getNumberOfOutputBands() const;
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-
-   ossimIpt getViewWidthHeight()const;
-
-   void getViewWidthHeight(ossimIpt& widthHeight)const;
-   
-   void setViewWidthHeight(const ossimIpt& widthHeight);
-   
-   // all borders here
-   virtual ossim_int32 getTopBorderLength()const;
-   virtual ossim_int32 getBottomBorderLength()const;
-   virtual ossim_int32 getLeftBorderLength()const;
-   virtual ossim_int32 getRightBorderLength()const;
-
-   virtual void setTopBorderLength(ossim_int32 length);
-   virtual void setBottomBorderLength(ossim_int32 length);
-   virtual void setLeftBorderLength(ossim_int32 length);
-   virtual void setRightBorderLength(ossim_int32 length);
-
-   //all spacing here
-   void setGeographicSpacingLat(double value);
-   void setGeographicSpacingLon(double value);
-   void setMeterSpacingX(double value);
-   void setMeterSpacingY(double value);
-   void setMeterSpacing(double x, double y);
-   void setGeographicSpacing(double lat, double lon);
-
-   ossimDpt getGeographicSpacing()const;
-   ossimDpt getMeterSpacing()const;
-   
-   // All geographic formatting here
-   virtual ossimString getTopGeographicLabelFormat()const;
-   virtual ossimString getBottomGeographicLabelFormat()const;
-   virtual ossimString getLeftGeographicLabelFormat()const;
-   virtual ossimString getRightGeographicLabelFormat()const;
-
-   virtual void setGeographicLabelFormat(const ossimString format);
-   virtual void setTopGeographicLabelFormat(const ossimString& format);
-   virtual void setBottomGeographicLabelFormat(const ossimString& format);
-   virtual void setLeftGeographicLabelFormat(const ossimString& format);
-   virtual void setRightGeographicLabelFormat(const ossimString& format);
-   
-   // All font funtions here.
-   virtual ossimString    getTitle()const;
-   virtual ossimRgbVector getTitleColor()const;
-
-   virtual void setTitleFont(const ossimFontInformation& fontInfo);
-   virtual void setTitleColor(const ossimRgbVector& color);
-   virtual void setTitle(const ossimString& s);
-   virtual void setGeographicTopLabelFont(const ossimFontInformation& fontInfo);
-   virtual void setGeographicBottomLabelFont(const ossimFontInformation& fontInfo);
-   virtual void setGeographicLeftLabelFont(const ossimFontInformation& fontInfo);
-   virtual void setGeographicRightLabelFont(const ossimFontInformation& fontInfo);
-
-   virtual void setMeterTopLabelFont(const ossimFontInformation& fontInfo);
-   virtual void setMeterBottomLabelFont(const ossimFontInformation& fontInfo);
-   virtual void setMeterLeftLabelFont(const ossimFontInformation& fontInfo);
-   virtual void setMeterRightLabelFont(const ossimFontInformation& fontInfo);
-
-   virtual ossimFontInformation getTitleFont()const;
-   virtual ossimFontInformation getGeographicTopLabelFontInfo()const;
-   virtual ossimFontInformation getGeographicBottomLabelFontInfo()const;
-   virtual ossimFontInformation getGeographicLeftLabelFontInfo()const;
-   virtual ossimFontInformation getGeographicRightLabelFontInfo()const;
-   virtual ossimFontInformation getMeterTopLabelFontInfo()const;
-   virtual ossimFontInformation getMeterBottomLabelFontInfo()const;
-   virtual ossimFontInformation getMeterLeftLabelFontInfo()const;
-   virtual ossimFontInformation getMeterRightLabelFontInfo()const;
-
-   // All color funtions here
-   virtual ossimRgbVector getBorderColor()const;
-   virtual void setBorderColor(const ossimRgbVector& color);
-
-   virtual ossimRgbVector getGeographicGridColor()const;
-   virtual ossimRgbVector getMeterGridColor()const;
-   virtual ossimRgbVector getTopGeographicLabelColor()const;
-   virtual ossimRgbVector getBottomGeographicLabelColor()const;
-   virtual ossimRgbVector getLeftGeographicLabelColor()const;
-   virtual ossimRgbVector getRightGeographicLabelColor()const;
-
-   virtual void setGeographicGridColor(const ossimRgbVector& color);
-   virtual void setTopGeographicLabelColor(const ossimRgbVector& color);
-   virtual void setBottomGeographicLabelColor(const ossimRgbVector& color);
-   virtual void setLeftGeographicLabelColor(const ossimRgbVector& color);
-   virtual void setRightGeographicLabelColor(const ossimRgbVector& color);
-   virtual void setGeographicLabelColor(const ossimRgbVector& color);
-
-   virtual ossimRgbVector getTopMeterLabelColor()const;
-   virtual ossimRgbVector getBottomMeterLabelColor()const;
-   virtual ossimRgbVector getLeftMeterLabelColor()const;
-   virtual ossimRgbVector getRightMeterLabelColor()const;
-   
-   virtual void setTopMeterLabelColor(const ossimRgbVector& color);
-   virtual void setBottomMeterLabelColor(const ossimRgbVector& color);
-   virtual void setLeftMeterLabelColor(const ossimRgbVector& color);
-   virtual void setRightMeterLabelColor(const ossimRgbVector& color);
-   virtual void setMeterLabelColor(const ossimRgbVector& color);
-   virtual void setMeterGridColor(const ossimRgbVector& color);
-
-   // All grid types here
-   virtual void setMeterGridType(ossimGridLineType gridType);
-   virtual void setGeographicGridType(ossimGridLineType gridType);
-   virtual void setBorderColor(ossimRgbVector& color);
-
-   virtual ossimGridLineType getGeographicGridType()const;
-   virtual ossimGridLineType getMeterGridType()const;
-   
-   // all grid flags here
-   void setGeographicTickMarkFlag(bool flag);
-   void setTopGeographicTickMarkFlag(bool flag);
-   void setBottomGeographicTickMarkFlag(bool flag);
-   void setLeftGeographicTickMarkFlag(bool flag);
-   void setRightGeographicTickMarkFlag(bool flag);
-   void setTopGeographicLabelFlag(bool flag);
-   void setBottomGeographicLabelFlag(bool flag);
-   void setLeftGeographicLabelFlag(bool flag);
-   void setRightGeographicLabelFlag(bool flag);
-
-   virtual bool getTopGeographicTickMarkFlag()const;
-   virtual bool getBottomGeographicTickMarkFlag()const;
-   virtual bool getLeftGeographicTickMarkFlag()const;
-   virtual bool getRightGeographicTickMarkFlag()const;
-   virtual bool getTopGeographicLabelFlag()const;
-   virtual bool getBottomGeographicLabelFlag()const;
-   virtual bool getLeftGeographicLabelFlag()const;
-   virtual bool getRightGeographicLabelFlag()const;
-
-   void setMeterTickMarkFlag(bool flag);
-   virtual void setTopMeterTickMarkFlag(bool flag);
-   virtual void setBottomMeterTickMarkFlag(bool flag);
-   virtual void setLeftMeterTickMarkFlag(bool flag);
-   virtual void setRightMeterTickMarkFlag(bool flag);
-   virtual void setTopMeterLabelFlag(bool flag);
-   virtual void setBottomMeterLabelFlag(bool flag);
-   virtual void setLeftMeterLabelFlag(bool flag);
-   virtual void setRightMeterLabelFlag(bool flag);
-   
-   virtual bool getTopMeterTickMarkFlag()const;
-   virtual bool getBottomMeterTickMarkFlag()const;
-   virtual bool getLeftMeterTickMarkFlag()const;
-   virtual bool getRightMeterTickMarkFlag()const;
-   virtual bool getTopMeterLabelFlag()const;
-   virtual bool getBottomMeterLabelFlag()const;
-   virtual bool getLeftMeterLabelFlag()const;
-   virtual bool getRightMeterLabelFlag()const;
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-
-   virtual void initialize();
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-protected:
-   virtual ~ossimMapCompositionSource();
-   ossimIpt            theViewWidthHeight;
-   ossimGridLineType   theMeterGridType;
-   ossimGridLineType   theGeographicGridType;
-   
-   ossim_uint32        theTopBorderLength;
-   ossim_uint32        theBottomBorderLength;
-   ossim_uint32        theLeftBorderLength;
-   ossim_uint32        theRightBorderLength;
-   
-   ossimRgbVector      theBorderColor;
-
-   ossimRgbVector      theGeographicGridColor;
-   ossimRgbVector      theMeterGridColor;
-
-   // title info
-   //
-   ossimString          theTitleString;
-   ossimRefPtr<ossimFont>           theTitleFont;
-   ossimFontInformation theTitleFontInfo;
-   ossimRgbVector       theTitleColor;
-   
-   // grid label colors
-   //
-   ossimRgbVector      theTopGeographicLabelColor;
-   ossimRgbVector      theBottomGeographicLabelColor;
-   ossimRgbVector      theLeftGeographicLabelColor;
-   ossimRgbVector      theRightGeographicLabelColor;
-   ossimRgbVector      theTopMeterLabelColor;
-   ossimRgbVector      theBottomMeterLabelColor;
-   ossimRgbVector      theLeftMeterLabelColor;
-   ossimRgbVector      theRightMeterLabelColor;
-
-   // grid label font
-   //
-   ossimFontInformation theGeographicTopLabelFontInfo;
-   ossimRefPtr<ossimFont>           theGeographicTopLabelFont;
-   ossimFontInformation theGeographicBottomLabelFontInfo;
-   ossimRefPtr<ossimFont>           theGeographicBottomLabelFont;
-   ossimFontInformation theGeographicLeftLabelFontInfo;
-   ossimRefPtr<ossimFont>           theGeographicLeftLabelFont;
-   ossimFontInformation theGeographicRightLabelFontInfo;
-   ossimRefPtr<ossimFont>           theGeographicRightLabelFont;
-
-   ossimFontInformation theMeterTopLabelFontInfo;
-   ossimRefPtr<ossimFont>           theMeterTopLabelFont;
-   ossimFontInformation theMeterBottomLabelFontInfo;
-   ossimRefPtr<ossimFont>           theMeterBottomLabelFont;
-   ossimFontInformation theMeterLeftLabelFontInfo;
-   ossimRefPtr<ossimFont>           theMeterLeftLabelFont;
-   ossimFontInformation theMeterRightLabelFontInfo;
-   ossimRefPtr<ossimFont>           theMeterRightLabelFont;
-   
-   // grid label dms format strings
-   //
-   ossimString         theTopGeographicFormat;
-   ossimString         theBottomGeographicFormat;
-   ossimString         theLeftGeographicFormat;
-   ossimString         theRightGeographicFormat;
-
-   // grid label flag
-   //
-   bool                theTopGeographicLabelFlag;
-   bool                theBottomGeographicLabelFlag;
-   bool                theLeftGeographicLabelFlag;
-   bool                theRightGeographicLabelFlag;
-
-   bool                theTopGeographicTickFlag;
-   bool                theBottomGeographicTickFlag;
-   bool                theLeftGeographicTickFlag;
-   bool                theRightGeographicTickFlag;
-
-   bool                theTopMeterLabelFlag;
-   bool                theBottomMeterLabelFlag;
-   bool                theLeftMeterLabelFlag;
-   bool                theRightMeterLabelFlag;
-
-   bool                theTopMeterTickFlag;
-   bool                theBottomMeterTickFlag;
-   bool                theLeftMeterTickFlag;
-   bool                theRightMeterTickFlag;
-   
-   
-   ossimIrect          theTopBorder;
-   ossimIrect          theBottomBorder;
-   ossimIrect          theLeftBorder;
-   ossimIrect          theRightBorder;
-
-   // geo-tick spacing in lat lon
-   ossimDpt            theGeographicSpacing;
-
-   //  tick spacing in meter units
-   ossimDpt            theMeterSpacing;
-   
-   ossimAnnotationSource::AnnotationObjectListType theFixedAnnotationList;
-
-   /*!
-    * Override base classes drawAnnotations so we can layout
-    * any fixed annotations first.
-    */
-   virtual void drawAnnotations(ossimRefPtr<ossimImageData> tile);
-   
-   virtual void computeBorderRects();
-   virtual void drawBorders();
-   virtual void addGridLabels();
-   
-   virtual void addGeographicTopGridLabels();
-   virtual void addGeographicBottomGridLabels();
-   virtual void addGeographicLeftGridLabels();
-   virtual void addGeographicRightGridLabels();
-
-   virtual void addGeographicGridLines();
-   virtual void addGeographicGridReseaux();
-   
-   virtual void addMeterGridLabels();
-   
-   virtual void addMeterGridLines();
-   virtual void addMeterGridReseaux();
-
-   
-   virtual void addTitle();
-   
-   virtual void layoutAnnotations();
-
-   virtual void addFixedAnnotation(ossimAnnotationObject* obj);
-      
-   virtual void deleteFixedAnnotations();
-   
-   ossimIrect getViewingRect()const;
-   
-   //! Fetches the input connection's image geometry and verifies that it is a map projection.
-   //! Returns NULL if no valid projection found.
-   const ossimMapProjection* inputMapProjection() const;
-
-// For RTTI
-TYPE_DATA
-};
-#endif /* #ifndef ossimMapCompositionSource_HEADER */
-
-
diff --git a/ossim/include/ossim/imaging/ossimMaskFilter.h b/ossim/include/ossim/imaging/ossimMaskFilter.h
deleted file mode 100644
index f52c2b4..0000000
--- a/ossim/include/ossim/imaging/ossimMaskFilter.h
+++ /dev/null
@@ -1,267 +0,0 @@
-//*******************************************************************
-  // Copyright (C) 2000 ImageLinks Inc. 
-  //
-// License: MIT
-  // 
-  // See LICENSE.txt file in the top level directory for more details.
-  //
-  // Author: Garrett Potts
-  // Modified by: Elan Sharghi (1/20/2009)
-  // Description: Class declaration for ossimMaskFilter.
-  //
-  //*************************************************************************
-    // $Id: ossimMaskFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef  ossimMaskFilter_HEADER
-#define  ossimMaskFilter_HEADER 1
-#include <ossim/imaging/ossimImageSource.h>
-
-    /**
-     * <pre>
-     * class ossimMaskFilter
-     *
-     *    Requires 2 inputs.  The first input is assumed to be the image input
-     *    and the second input is assumed to be the mask data.  It will only
-     *    use one band of the mask and multi band masks are not supported.
-     *
-     *    the number of bands, min pix, max pix, null pix ...etc are mapped
-     *    to the first input.
-     *
-     * Keywords:
-     *    mask_type:
-     *
-     * keywords description: This keyword can have the following values:
-     *    select, select_clamp, invert, weighted, binary, or binary_inverse
-     *         
-     *    - select will use the input data and every where
-     *      the mask is greater than 0 it will copy the input to the output.
-     *
-     *    - select_clamp_min If mask pixel is non zero, output pixel is input
-     *      pixel; else, null pixel value. Differs from select in that output
-     *      pixel is clamped to min pixel if input pixel is used. 
-     *      
-     *    - invert will use the input data and every where the mask is 0 it
-     *      will copy the input to the output else it will place a null in
-     *      the output.
-     *      
-     *    - weighted will normalize the mask between 0 and 1 and then multiply
-     *      the input by that normalized value and copy to the output.
-     *
-     *    - binary If mask pixel is non zero, output pixel is max pixel value;
-     *      else, null.
-     *
-     *    - binary_inverse If mask pixel is non zero, output pixel is max pixel
-     *      value; else, null pixel value. 
-     *    
-     * example of keywords:
-     *
-     *      mask_type: select
-     *
-     * </pre>
-     */
-class OSSIMDLLEXPORT ossimMaskFilter : public ossimImageSource
-{
-public:
-   /**
-    * Enumeration used to identify what the selection type for this mask is to
-    * be used:
-    * 
-    * - OSSIM_MASK_TYPE_SELECT
-    *   If the mask is non zero then the input is kept if it's 0 then the input
-    *   is nulled out.
-    * - OSSIM_MASK_TYPE_INVERT
-    *   If the input is non zero then the output is nulled else the input is kept
-    * - OSSIM_MASK_TYPE_WEIGHTED
-    *   works as a multiplier of the input data.  The mask is normalized to be
-    *   between 0 and 1 and multiplies the input by that normalized value.
-    * - OSSIM_MASK_TYPE_BINARY
-    *   If mask pixel is non zero, output pixel is null pixel value; else, max
-    *   pixel value.
-    * - OSSIM_MASK_TYPE_BINARY_INVERSE
-    *   If mask pixel is non zero, output pixel is max pixel value; else, null
-    *   pixel value.
-    * - OSSIM_MASK_TYPE_SELECT_CLAMP_MIN
-    *   If mask pixel is non zero, output pixel is input pixel; else, null pixel
-    *   value. Differs from OSSIM_MASK_TYPE_SELECT in that output pixel is
-    *   clamped to min pixel if input pixel is used. The clampling has the
-    *   affect of flipping null pixels to min pixel value if the mask pixel is
-    *   non zero and input pixel is a null.
-    */
-  enum ossimFileSelectionMaskType
-  {
-     /**< standard select if mask is true then keep */
-     OSSIM_MASK_TYPE_SELECT         = 1,
-     /**< standard invert if mask is true the don't keep */
-     OSSIM_MASK_TYPE_INVERT         = 2,
-     /**< weighted operation.  Normalize the mask and multiply the input */
-     OSSIM_MASK_TYPE_WEIGHTED       = 3,
-     /**< binary image> */
-     OSSIM_MASK_TYPE_BINARY         = 4,
-     /**< inverse binary image> */
-     OSSIM_MASK_TYPE_BINARY_INVERSE = 5,
-     /**< Standard select if mask is true then keep with min. */
-     OSSIM_MASK_TYPE_SELECT_CLAMP_MIN = 6,
-  };
-
-   /**
-    * Default Constructor.
-    */
-   ossimMaskFilter(ossimObject* owner=NULL);
-
-   /**
-    * This set method is necessary when this object is being added to an ossimImageChain because
-    * ossimImageChain::addLast() performs a disconnect of all the input sources, thus losing the
-    * assignments made via constructor accepting source pointers. If the intent is to insert this
-    * object in place of the image handler in a chain, First remove the handler from the chain, then
-    * add a default-constructed mask filter object, then call this method to assign the inputs.
-    */
-   void setMaskSource(ossimImageSource* maskSource);
-
-   /**
-    * Sets the mask type.
-    * @param type The mask algorithm type to be used.
-    * see ossimFileSelectionMaskType
-    */
-   virtual void setMaskType(ossimFileSelectionMaskType type);
-   
-   /**
-    * @brief Sets the mask type from string.
-    *
-    * Valid strings are:  "select", "invert" and "weighted".
-    * 
-    * @param type The mask algorithm type to be used.
-    */
-   virtual void setMaskType(const ossimString& type);
-
-   /**
-    * Returns the current mask algorithm used.
-    * \return the current ossimFileSelectionMaskType used.
-    */
-   virtual ossimFileSelectionMaskType getMaskType() const;
-
-   /**
-    * @brief Returns the current mask algorithm used as a string.
-    * @return the current ossimFileSelectionMaskType used.
-    */
-   virtual ossimString getMaskTypeString() const;
-
-   /**
-    * Main entry point for the algorithm.
-    * \param rect 
-    *
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   virtual bool canConnectMyInputTo(ossim_int32 index, const ossimConnectableObject* object)const;
-   
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   
-
-   virtual ossimRefPtr<ossimImageData> executeMaskFilter(
-      ossimRefPtr<ossimImageData> imageSourceData,
-      ossimRefPtr<ossimImageData> maskSourceData);
-
-   /** @brief Interface to set the mask type. */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-
-   /** @return "mask_type" property. */
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-
-   /** @brief Adds "mask_type" to list. */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-protected:
-   /**
-    * Will delete its owned tile.
-    */
-   virtual ~ossimMaskFilter();
-   
-   void allocate();
-   
-   /**
-    * will execute the section algorithm.  everywhere the mask is not 0 it
-    * copies the input data to the output and everywhere the input is null it
-    * writes a null pixel to the output.
-    */
-   ossimRefPtr<ossimImageData> executeMaskFilterSelect(
-      ossimRefPtr<ossimImageData> imageSourceData,
-      ossimRefPtr<ossimImageData> maskSourceData);
-
-   /**
-    * will execute the invert selection algorithm.  everywhere the mask is 0
-    * it copies the input data to the output else it outputs null.
-    */
-   ossimRefPtr<ossimImageData> executeMaskFilterInvertSelect(
-      ossimRefPtr<ossimImageData> imageSourceData,
-      ossimRefPtr<ossimImageData> maskSourceData);
-
-   /**
-    * will execute the weighted algorithm.  It normalizes the mask value to
-    * be between 0 and 1 and multiplies the input data by that value and
-    * outputs it.  
-    */
-   ossimRefPtr<ossimImageData> executeMaskFilterWeighted(
-      ossimRefPtr<ossimImageData> imageSourceData,
-      ossimRefPtr<ossimImageData> maskSourceData);
-
-   /**
-    * Will execute the binary algorithm. Copies the values in the mask to each 
-    * tile. Values will be either NULL or MAX pixel value, typically 0 or 255.
-    */
-   ossimRefPtr<ossimImageData> executeMaskFilterBinary(
-      ossimRefPtr<ossimImageData> imageSourceData,
-      ossimRefPtr<ossimImageData> maskSourceData);
-   
-   template <class inputT, class maskT>
-      ossimRefPtr<ossimImageData> executeMaskFilterSelection(
-         inputT dummyInput,
-         maskT  dummyMask,
-         ossimRefPtr<ossimImageData> imageSourceData,
-         ossimRefPtr<ossimImageData> maskSourceData);
-   
-   template <class inputT, class maskT>
-      ossimRefPtr<ossimImageData> executeMaskFilterInvertSelection(
-         inputT dummyInput,
-         maskT  dummyMask,
-         ossimRefPtr<ossimImageData> imageSourceData,
-         ossimRefPtr<ossimImageData> maskSourceData);
-   
-   template <class inputT, class maskT>
-      ossimRefPtr<ossimImageData> executeMaskFilterWeighted(
-         inputT dummyInput,
-         maskT  dummyMask,
-         ossimRefPtr<ossimImageData> imageSourceData,
-         ossimRefPtr<ossimImageData> maskSourceData);
-
-   template <class inputT, class maskT>
-   ossimRefPtr<ossimImageData> executeMaskFilterBinarySelection(
-      inputT dummyInput,
-      maskT  dummyMask,
-      ossimRefPtr<ossimImageData> imageSourceData,
-      ossimRefPtr<ossimImageData> maskSourceData);
-
-   /**
-    * Member variable that holds the algorithm type to run on the calls to getTile.
-    */
-   ossimFileSelectionMaskType  theMaskType;
-
-   /**
-    * Member used to store the result of the applied algorithm type.  This is returned
-    * from the call to getTile.
-    */
-   ossimRefPtr<ossimImageData> theTile;
-   ossimRefPtr<ossimImageSource> theMaskSource;
-
-   TYPE_DATA
-};
-
-#endif /* #ifndef ossimMaskFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimMaxMosaic.h b/ossim/include/ossim/imaging/ossimMaxMosaic.h
deleted file mode 100644
index e25446c..0000000
--- a/ossim/include/ossim/imaging/ossimMaxMosaic.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 SANZ Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Kenneth Melero (kmelero at sanz.com)
-//
-// Description: This combiner is designed to "float" the maximum pixel value
-//              of all inputs to the top of the mosaic output. 
-//
-//*************************************************************************
-// $Id: ossimMaxMosaic.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimMaxMosaic_HEADER
-#define ossimMaxMosaic_HEADER
-
-#include <vector>
-#include <ossim/imaging/ossimImageCombiner.h>
-
-
-/**
- * An image mosaic is a simple combiner that will
- * just do a simple mosaic.  It just checks NULL pix values until it finds a
- * pixel that is not empty and copies it out to the output.  The list will
- * have same size tiles and have the same number of bands.
- */
-class OSSIMDLLEXPORT ossimMaxMosaic : public ossimImageCombiner
-{
-public:
-   ossimMaxMosaic();
-   ossimMaxMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual ossimString getShortName() const;
-   virtual ossimString getLongName()  const;
-   virtual ossimString getDescription()const;
-
-protected:
-   virtual ~ossimMaxMosaic();
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theTile;
-
-   template <class T> ossimRefPtr<ossimImageData> combine(
-      T, // dummy template variable not used
-      const ossimIrect& tileRect,
-      ossim_uint32 resLevel=0);
-   template <class T> ossimRefPtr<ossimImageData> combineNorm(
-      T, // dummy template variable not used
-      const ossimIrect& tileRect,
-      ossim_uint32 resLevel=0);
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimMeanMedianFilter.h b/ossim/include/ossim/imaging/ossimMeanMedianFilter.h
deleted file mode 100644
index f2ea333..0000000
--- a/ossim/include/ossim/imaging/ossimMeanMedianFilter.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimMeanMedianFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimMeanMedianFilter_HEADER
-#define ossimMeanMedianFilter_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/*!
- * class ossimMeanMedianFilter
- *
- * Allows you to change between a median or mean filter.  You can
- * also specify a window size which the median or mean is computed and
- * the center pixel is replaced.
- *
- */
-class OSSIM_DLL ossimMeanMedianFilter : public ossimImageSourceFilter
-{
-public:
-
-   enum ossimMeanMedianFilterType
-   {
-      /** Applies filter to any non-null center pixel. */
-      OSSIM_MEDIAN                  = 0,
-
-      /** Applies filter to all pixels including null center pixels. */
-      OSSIM_MEDIAN_FILL_NULLS       = 1,
-
-      /** Applies filter to only null center pixels. */
-      OSSIM_MEDIAN_NULL_CENTER_ONLY = 2,
-
-      /** Applies filter to any non-null center pixel. */
-      OSSIM_MEAN                    = 3,
-
-      /* Applies filter to all pixels including null center pixels. */
-      OSSIM_MEAN_FILL_NULLS         = 4,
-
-      /** Applies filter to only null center pixels. */
-      OSSIM_MEAN_NULL_CENTER_ONLY   = 5
-   };
-
-   ossimMeanMedianFilter(ossimObject* owner=NULL);
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-   virtual void initialize();
-
-   void setWindowSize(ossim_uint32 windowSize);
-   ossim_uint32 getWindowSize()const;
-
-   /**
-    * @param flag Set "theAutoGrowRectFlag".  This only affects filter types
-    * that set nulls.  Will have a growing affect on the edges.
-    */
-   void setAutoGrowRectFlag(bool flag);
-   bool getAutoGrowRectFlag() const;
-
-   void setFilterType(ossimMeanMedianFilterType type);
-   void setFilterType(const ossimString& type);
-   ossimString getFilterTypeString() const;
-   void getFilterTypeList(std::vector<ossimString>& list) const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * @return Returns the bounding rectangle which is the input bounding
-    * rectangle with any expansion (from autogrow) added in.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-
-protected:
-   virtual ~ossimMeanMedianFilter();
-   
-   ossimRefPtr<ossimImageData> theTile;
-   ossimMeanMedianFilterType   theFilterType;
-   ossim_uint32                theWindowSize;
-
-   /** Used by applyMean and applyMedian for "fill null" modes. */
-   bool theEnableFillNullFlag;
-
-   /**
-    * If true rectangle is expanded by half filter in each direction if the
-    * theFilterType fills nulls.
-    */
-   bool theAutoGrowRectFlag;
-
-   void applyFilter(ossimRefPtr<ossimImageData>& input);
-
-   template <class T>
-      void applyMean(T dummyVariable,
-                     ossimRefPtr<ossimImageData>& inputData);
-   template <class T>
-      void applyMeanNullCenterOnly(T dummyVariable,
-                                   ossimRefPtr<ossimImageData>& inputData);
-
-   template <class T>
-      void applyMedian(T dummyVariable,
-                       ossimRefPtr<ossimImageData>& inputData);
-   template <class T>
-      void applyMedianNullCenterOnly(T dummyVariable,
-                                     ossimRefPtr<ossimImageData>& inputData);
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimMetadataFileWriter.h b/ossim/include/ossim/imaging/ossimMetadataFileWriter.h
deleted file mode 100644
index 1069050..0000000
--- a/ossim/include/ossim/imaging/ossimMetadataFileWriter.h
+++ /dev/null
@@ -1,177 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2003 Storage Area Networks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kenneth Melero (kmelero at sanz.com)
-//
-//*******************************************************************
-//  $Id: ossimMetadataFileWriter.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimMetadataFileWriter_H
-#define ossimMetadataFileWriter_H
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimObjectEvents.h>
-#include <ossim/base/ossimProcessProgressEvent.h>
-
-class ossimImageSource;
-
-/**
- * ossimMetadataFileWriter
- *
- * Typical usage something like this:
- *
- * ossimObject* obj = ossimImageMetaDataWriterRegistry::instance()->
- *     createObject(ossimString("ossimReadmeFileWriter"));
- * if (!obj)
- * {
- *    return;
- * }
- * ossimMetadataFileWriter* mw = PTR_CAST(ossimMetadataFileWriter, obj);
- * if (!mw)
- * {
- *    return;
- * }
- * 
- * mw->setFilename(xmlFile);
- * mw->loadState(kwl);
- * mw->connectMyInputTo(ih.get());
- * mw->execute();
- * delete mw;
- */
-class OSSIMDLLEXPORT ossimMetadataFileWriter :
-   public ossimConnectableObject,
-   public ossimProcessInterface,
-   public ossimConnectableObjectListener
-{   
-public:
-   ossimMetadataFileWriter();
-   
-
-   virtual ossimObject*       getObject();
-   virtual const ossimObject* getObject() const;
-
-   virtual void initialize();
-   
-   virtual bool execute();
-   
-   virtual void setPercentComplete(double percentComplete);
-   
-   virtual void setFilename(const ossimFilename& file);
-   
-   const ossimFilename& getFilename()const;
-
-   /**
-    * Load state method:
-    *
-    * This method call base class ossimConnectableObject::loadState then
-    * looks for its keywords.
-    *
-    * @param kwl Keyword list to initialize from.
-    *
-    * @param prefix Usually something like: "object1."
-    *
-    * @return This method will alway return true as it is intended to be
-    * used in conjuction with the set methods.
-    *
-    * Keywords picked up by loadState:
-    *
-    * filename: foo.tfw
-    *
-    * (pixel_type should be area or point)
-    * 
-    * pixel_type: area
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix = 0);
-   
-   bool canConnectMyInputTo(ossim_int32 inputIndex,
-                            const ossimConnectableObject* object) const;
-   
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-   virtual void propertyEvent(ossimPropertyEvent& event);
-
-   /**
-    * Ossim uses a concept of "pixel is point" internally.
-    * 
-    * This means that if you say a tie point is 30.0N -81.0W, the center of
-    * the pixel at the tie point is 30.0N -81.0W.
-    *
-    */ 
-   virtual void setPixelType(ossimPixelType pixelType);
-   virtual ossimPixelType getPixelType() const;
-
-   /**
-    * Sets the area of interest to write the meta data for.
-    * 
-    * @param areaOfInterest Sets theAreaOfInterest.
-    *
-    * @note By default the writers will use
-    * "theInputConnection->getBoundingRect()" if theAreaOfInterest has nans.
-    */
-   virtual void setAreaOfInterest(const ossimIrect& areaOfInterest);
-
-   /**
-    * @returns theAreaOfInterest.
-    */
-   virtual ossimIrect getAreaOfInterest() const;
-
-   /**
-    * void getMetadatatypeList(std::vector<ossimString>& metadatatypeList)const
-    *
-    * pure virtual
-    * 
-    * Appends the writers metadata types to the "metadatatypeList".
-    * 
-    * This is the actual image type name.  So for
-    * example, ossimTiffWorldFileWriter has tiff_world_file type.
-    *
-    * @param metadatatypeList stl::vector<ossimString> list to append to.
-    *
-    * @note All writers should append to the list, not, clear it and then add
-    * their types.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList)const=0;
-
-   /**
-    * bool hasMetadataType(const ossimString& metadataType) const
-    *
-    * @param imageType string representing image type.
-    *
-    * @return true if "metadataType" is supported by writer.
-    */
-   virtual bool hasMetadataType(const ossimString& metadataType)const=0;
-   
-   /*!
-    * property interface
-    */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-protected:
-   virtual ~ossimMetadataFileWriter();
-   /**
-    * Write out the file.
-    * @return true on success, false on error.
-    */
-   virtual bool writeFile() = 0;
-
-   ossimImageSource* theInputConnection;
-   ossimFilename              theFilename;
-   ossimPixelType             thePixelType;
-   ossimIrect                 theAreaOfInterest;
-   
-TYPE_DATA
-};
-
-#endif /* End of #ifndef ossimMetadataFileWriter_H */
-
diff --git a/ossim/include/ossim/imaging/ossimMonoGridRemapEngine.h b/ossim/include/ossim/imaging/ossimMonoGridRemapEngine.h
deleted file mode 100644
index d2ea9b8..0000000
--- a/ossim/include/ossim/imaging/ossimMonoGridRemapEngine.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//*****************************************************************************
-// FILE: ossimMonoGridRemapEngine.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimMonoGridRemapEngine
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimMonoGridRemapEngine.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimMonoGridRemapEngine_HEADER
-#define ossimMonoGridRemapEngine_HEADER
-
-#include <ossim/imaging/ossimGridRemapEngine.h>
-
-/*!****************************************************************************
- *
- * CLASS: ossimMonoGridRemapEngine 
- *
- *****************************************************************************/
-class ossimMonoGridRemapEngine : public ossimGridRemapEngine
-{
-public:
-   ossimMonoGridRemapEngine()
-      : ossimGridRemapEngine(1, 1) {}
-   
-   virtual ossimObject* dup() const;
-   
-   virtual void remapTile(const ossimDpt& origin_point,
-                          ossimGridRemapSource* remapper,
-                          ossimRefPtr<ossimImageData>& tile);
-
-   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources);
-
-   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
-                                   void* result);
-
-protected:
-   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
-                                 void*                 source_value,
-                                 void*                 target_value);
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimNBandToIndexFilter.h b/ossim/include/ossim/imaging/ossimNBandToIndexFilter.h
deleted file mode 100644
index ef2a68c..0000000
--- a/ossim/include/ossim/imaging/ossimNBandToIndexFilter.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimNBandToIndexFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNBandToIndexFilter_HEADER
-#define ossimNBandToIndexFilter_HEADER
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <vector>
-
-class ossimImageData;
-
-/*!
- * It will map the input data to an 8-bit index table.  The table
- * <pre>
- *
- * Example keyword list:
- *
- * type:  ossimNBandToIndexFilter
- *
- * If you want to load from a file then just do:
- *
- * lut.filename: <full path to lut file>
- *
- * If you have the lut table in line then it must look like this:
- *
- * lut.entry0:  204 102 1
- * lut.entry1:  255 204 153
- * lut.entry2:  51 204 204
- * lut.number_of_entries:  3
- * lut.type:  ossimNBandLutDataObject
- *
- * </pre>
- */
-class OSSIM_DLL ossimNBandToIndexFilter : public ossimImageSourceFilter
-{
-public:
-   /*!
-    * Initializes the min value to 0 and the max value to 4000.
-    */
-   ossimNBandToIndexFilter();
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   
-   void setLut(ossimNBandLutDataObject& lut);
-
-   void setLut(const ossimFilename& file);
-
-   virtual bool isSourceEnabled()const;
-   virtual void disableSource();
-   
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
-   virtual void initialize();
-
-   /*!
-    * Saves the state of this object.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   /*!
-    * Loads the state of this object.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /**
-    * Will set the property whose name matches the argument
-    * "property->getName()".
-    *
-    * @param property Object containing property to set.
-    */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-
-   /**
-    * @param name Name of property to return.
-    * 
-    * @returns A pointer to a property object which matches "name".  Returns
-    * NULL if no match is found.
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-
-   /**
-    * Pushes this's names onto the list of property names.
-    *
-    * @param propertyNames array to add this's property names to.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-protected:
-   virtual ~ossimNBandToIndexFilter();
-   void allocate();
-
-   
-   virtual ossimRefPtr<ossimImageData> convertInputTile(ossimImageData* inputTile);
-
-   template <class T> ossimRefPtr<ossimImageData> convertOutputTileTemplate(T inputDummy,
-                                                                            ossimImageData* inputTile);
-   template <class T1, class T2> ossimRefPtr<ossimImageData> convertInputTileToOutputTemplate(T1 inputDummy,
-                                                                                              T2 outputDummy,
-                                                                                              ossimImageData* inputTile);
-   
-   ossimRefPtr<ossimNBandLutDataObject> theLut;
-   ossimRefPtr<ossimImageData>          theTile;
-   ossimFilename                        theLutFilename;
-   bool                                 theKeepQuantizedValueFlag;
-   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> theMinValues;
-   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> theMaxValues;
-   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> theNullValues;
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimNitf20Writer.h b/ossim/include/ossim/imaging/ossimNitf20Writer.h
deleted file mode 100644
index 328cbf5..0000000
--- a/ossim/include/ossim/imaging/ossimNitf20Writer.h
+++ /dev/null
@@ -1,136 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimNitfWriter.h 9256 2006-07-14 15:28:19Z dburken $
-#ifndef ossimNitf20Writer_HEADER
-#define ossimNitf20Writer_HEADER
-
-#include <iosfwd>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimNitfWriterBase.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/base/ossimRgbLutDataObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
-
-class ossimProjection;
-
-class OSSIM_DLL ossimNitf20Writer : public ossimNitfWriterBase
-{
-public:
-   ossimNitf20Writer(const ossimFilename& filename=ossimFilename(""),
-                   ossimImageSource* inputSource = (ossimImageSource*)NULL);
-   virtual ~ossimNitf20Writer();
-   virtual bool isOpen()const;
-   virtual bool open();
-   virtual void close();
-   
-   /**
-    * void getImageTypeList(std::vector<ossimString>& imageTypeList)const
-    *
-    * Appends this writer image types to list "imageTypeList".
-    *
-    * This writer has the following types:
-    * nitf_block_band_separate
-    * nitf_block_band_sequential
-    *
-    * @param imageTypeList stl::vector<ossimString> list to append to.
-    */   
-   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-
-   /**
-    * @param propertyNames Array to populate with property names.
-    *
-    * @note The following names are handled:
-    *  file_header
-    *  image_header
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag);
-
-   /**
-    * Saves the state of the writer to kwl with prefix then calls
-    * base class ossimImageFileWriter::saveState
-    *
-    * @param kwl Keyword list to save to.
-    *
-    * @param prefix Usually something like: "object2."
-
-    * @return true on success, false on failure.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-
-   /**
-    * Initializes the state of the writer from kwl with prefix then calls
-    * base class ossimImageFileWriter::loadState
-    *
-    * @param kwl Keyword list to initialize from.
-    *
-    * @param prefix Usually something like: "object2."
-
-    * @return true on success, false on failure.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-protected:
-   
-   /**
-    * @return true on success false on error.
-    */
-   virtual bool writeFile();
-   
-   /**
-    * write out block band separate
-    * 
-    * @return true on success and false on error
-    */
-   virtual bool writeBlockBandSeparate();
-   
-   /**
-    * Outputs in band sequential format.  Band 1 is followed by band
-    * 2, ... etc.
-    */
-   virtual bool writeBlockBandSequential();
-
-   void addTags();
-
-   std::ofstream* theOutputStream;
-   
-   ossimRefPtr<ossimNitfFileHeaderV2_0>  theFileHeader;
-   ossimRefPtr<ossimNitfImageHeaderV2_0> theImageHeader;
-
-   /** If true user wants to set RPC00B tag. (DEFAULT = false) */
-   bool theEnableRpcbTagFlag;
-
-   /**
-    * If true user wants to set BLOCKA tag. (DEFAULT = true)
-    * Currently only valid for map projected images.
-    */
-   bool theEnableBlockaTagFlag;
-
-   /**
-    *
-    * If true this will enable searching the input connnection for another NITF handler and 
-    * bring the fields to this writers output fields and will maintin as many field values as possible
-    *
-    */
-   bool theCopyFieldsFlag;
-   
-TYPE_DATA   
-};
-
-#endif /* #ifndef ossimNitfWriter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimNitfTileSource.h b/ossim/include/ossim/imaging/ossimNitfTileSource.h
deleted file mode 100644
index fee5c20..0000000
--- a/ossim/include/ossim/imaging/ossimNitfTileSource.h
+++ /dev/null
@@ -1,544 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for NitfTileSource.
-//
-//*******************************************************************
-//  $Id: ossimNitfTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimNitfTileSource_HEADER
-#define ossimNitfTileSource_HEADER 1
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimAppFixedTileCache.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <fstream>
-
-struct jpeg_decompress_struct;
-
-class OSSIM_DLL ossimNitfTileSource : public ossimImageHandler
-{
-public:
-
-   enum ReadMode
-   {
-      READ_MODE_UNKNOWN = 0,
-      
-      /** IMODE = B "Band Interleaved By Block or a single band" */
-      READ_BIB_BLOCK = 1,
-
-      /** IMODE = P "Band Interleaved By Pixel" */
-      READ_BIP_BLOCK = 2,
-
-      /** IMODE = R "Band Interleaved By Row" */
-      READ_BIR_BLOCK = 3,
-
-      /** IMODE = S "Band Sequential" */
-      READ_BSQ_BLOCK = 4,
-
-      /** IMODE = B of S "single block or one block for each band" */
-      READ_BIB       = 5,
-
-      /** IMODE = P "single block Band Interleaved By Pixel" */
-      READ_BIP       = 6,
-
-      /** IMODE = R "single block Band Interleaved By Row" */
-      READ_BIR       = 7,
-
-      /** IMODE = B, IC = C3 "JPEG compressed blocks" */
-      READ_JPEG_BLOCK = 8
-   };
-
-   ossimNitfTileSource();
-   
-   
-   virtual ossimString getShortName() const;
-   virtual ossimString getLongName()  const;
-
-   /**
-    *  Returns true if the image_file can be opened and is a valid nitf file.
-    */
-   virtual bool open();
-
-   /**
-    * Closes file and destroys all memory allocated.
-    */
-   virtual void close();
-
-   /**
-    * @param tileRect Requested rectangle.
-    *
-    * @param resLevel Reduced resolution level to grab tileRect from.
-    * Default = 0 or the full resolution data set.
-    *
-    * @return Returns an image data object with requested rectangle from the
-    * image.  Depending on the overlap of tileRect with respect to the image
-    * rectangle, the returned tile could be full, partial, or an empty(blank)
-    * tile.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-    /**
-     * @return Returns the number of bands in the image.
-     * Satisfies pure virtual from ImageHandler class.
-     */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-
-   /**
-    * @return Number of output bands.
-    */
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-
-   /**
-     *  Returns the number of lines in the image.
-     *  Satisfies pure virtual from ImageHandler class.
-     */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
-   
-   /**
-    *  Returns the number of samples in the image.  
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-   
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;   
-
-   virtual bool isOpen()const;
-
-   /**
-    * @return The current entry number.
-    *
-    * @note NITF's can contain multiple images in a single file.  This returns
-    * the index of the current image being read.
-    */
-   virtual ossim_uint32 getCurrentEntry() const;
-
-   /**
-    * @param entryList This is the list to initialize with entry indexes.
-    */
-   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
-
-   /**
-    * @return Returns the number of entries (or images) within the nitf
-    * file.
-    */
-   ossim_uint32 getNumberOfEntries() const;
-   
-   /**
-    * @param entryIdx Zero base entry number to select.  Sets data member
-    * "theCurrentEntry".
-    *
-    * @note "theCurrentEntry" will not be set if "entryIdx" is out of range.
-    */
-   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
-
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   ossimString getSecurityClassification()const;
-   
-   /**
-    * @return Returns theCacheEnabledFlag.
-    */
-   bool getCacheEnabledFlag() const;
-
-   /**
-    * @param flag Sets theCacheEnabledFlag and disables/enables caching
-    * accordingly.  If cache is disabled it is also flushed at the same time.
-    * If cache is enabled, blocks read from the image will be cached.
-    */
-   void setCacheEnabledFlag(bool flag);
-
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   const ossimNitfFileHeader* getFileHeader()const;
-   ossimNitfFileHeader* getFileHeader();
-   /**
-    * @return The image header for the current entry.
-    */
-   const ossimNitfImageHeader* getCurrentImageHeader() const;
-   ossimNitfImageHeader* getCurrentImageHeader();
-
-   /**
-    * @brief Convenience method to get the zero based rgb output band list.
-    *
-    * Attempts to derive RGB bands from nitf fields.
-    * 
-    * @param bandList Initialized by this.
-    * @return true on success, false if number of bands is less than 3 or if
-    * rgb bands could not be derived from nitf fields.
-    */
-   virtual bool getRgbBandList(std::vector<ossim_uint32>& bandList) const;
-
-protected:
-   virtual ~ossimNitfTileSource();
-
-   /**
-    * @param imageRect The full resolution image rectangle.
-    *
-    * @note Should contain offsets if there are any.
-    */
-   void setBoundingRectangle(const ossimIrect& imageRect);
-   
-   /** Copy constructor, disallow... */
-   ossimNitfTileSource(const ossimNitfTileSource& obj);
-
-   /** Operator=, disallow... */
-   ossimNitfTileSource& operator=(const ossimNitfTileSource& rhs); 
-
-   /**
-    *  Returns true on success, false on error.
-    */
-   bool loadTile(const ossimIrect& clipRect);
-
-   /**
-    * @return Returns the block number given an origin.
-    */
-   ossim_uint32 getBlockNumber(const ossimIpt& block_origin) const;
-
-   /**
-    * Deletes all memory allocated by this object.
-    */
-   void destroy();
-
-   /**
-    * @brief Parses "theImageFile" and initializes all nitf headers.
-    * @return true on success, false on error.
-    */
-   virtual bool parseFile();
-
-   /**
-    * @brief Allocates everything for current entry.
-    *
-    * This is called on an open() or a entry change to an already open nitf
-    * file.
-    *
-    * This does not allocate buffers and tiles to keep open and
-    * setCurrentEntry times to a minimum.  Buffers are allocated on first
-    * grab of pixel data by allocatBuffers method.
-    * 
-    * @return True on success, false on error.
-    */
-   virtual bool allocate();
-
-   /**
-    * @brief Allocates buffers for current entry.
-    *
-    * This is called on first getTile().
-    * 
-    * @return True on success, false on error.
-    */
-   virtual bool allocateBuffers();
-
-   /**
-    * @param hdr Pointer to image header.
-    * @return true if reader can uncompress nitf.
-    * */
-   virtual bool canUncompress(const ossimNitfImageHeader* hdr) const;
-
-   /**
-    * Initializes the data member "theScalarType" from the current entry.
-    */
-   virtual void initializeScalarType();
-
-   /**
-    * Initializes the data member "theSwapBytesFlag" from the current entry.
-    */
-   virtual void initializeSwapBytesFlag();
-   
-   /**
-    * Initializes the data member "theReadMode" from the current entry.
-    */
-   virtual void initializeReadMode();
-
-   /**
-    * Initializes the data member "theNumberOfBands" from the current entry.
-    */
-   void initializeBandCount();
-
-   /**
-    * Initializes the data member "theBlockSize" from the current entry.
-    *
-    * @note This should be performed after setting the read mode and
-    * band count.
-    *
-    * @note This is the size of a single block read.  So if the bands are
-    * separated by block, a read of this size will get one block.
-    *
-    * @return true on success, false on error.
-    */
-   bool initializeBlockSize();
-
-   /**
-    * Initializes the data members "theImageRect" and "theBlockRect"
-    * from the current entry.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool initializeImageRect();
-
-   /**
-    * Initializes the data member "theCacheSize".
-    */
-   void initializeCacheSize();
-
-   /**
-    * Initializes the data member "theCacheTileInterLeaveType".
-    */
-   virtual void initializeCacheTileInterLeaveType();
-   
-   /**
-    * Initializes the cache tile size(width and height).  For block images
-    * this will be the size of one block.  For images that are a single block,
-    * this will be the image width by the height of one tile.
-    */
-   void initializeCacheTile();
-
-   /**
-    * Initializes the data member theCompressedBuf.
-    */
-   virtual void initializeCompressedBuf();
-
-   /**
-    * Initializes the output tile size(width and height).
-    */
-   virtual void initializeOutputTile();
-
-   /**
-    * @brief Initializes "theLut" if applicable.
-    */
-   void initializeLut();
-
-   /**
-    * Loads a block of data to theCacheTile.
-    * 
-    * @param x Starting x position of block to load.
-    *
-    * @param y Starting y position of block to load.
-    *
-    * @return true on success, false on error.
-    *
-    * @note x and y are zero based relative to the upper left corner so any
-    * sub image offset should be subtracted off.
-    */
-   bool loadBlockFromCache(ossim_uint32 x, ossim_uint32 y,
-                           const ossimIrect& clipRect);
-
-   /**
-    * Loads a block of data to theCacheTile.
-    * 
-    * @param x Starting x position of block to load.
-    *
-    * @param y Starting y position of block to load.
-    *
-    * @return true on success, false on error.
-    *
-    * @note x and y are zero based relative to the upper left corner so any
-    * sub image offset should be subtracted off.
-    */
-   virtual bool loadBlock(ossim_uint32 x, ossim_uint32 y);
-
-   /**
-    * @param x Horizontal upper left pixel position of the requested block.
-    *
-    * @param y Vertical upper left pixel position of the requested block.
-    *
-    * @param band Band of block.  Only relative with IMODES that have bands
-    * in separate blocks.
-    *
-    * @return true if the stream offset was settable and false otherwise.
-    */
-   bool getPosition(std::streamoff& position,
-                    ossim_uint32 x,
-                    ossim_uint32 y,
-                    ossim_uint32 band) const;
-
-   /**
-    * @return the total number of blocks for the current entry.
-    *
-    * @note For band separated blocks, all bands will be counted as on block.
-    */
-   ossim_uint32 getNumberOfBlocks() const;
-
-   /**
-    * @return The number of bytes to get from one block band to the next band.
-    */
-   std::streampos getBandOffset() const;
-
-   /**
-    * @return The number of bytes to get from one block to the next block.
-    */
-   std::streampos getBlockOffset() const;
-   
-
-   void explodePackedBits(ossimRefPtr<ossimImageData> packedBuffer)const;
-
-   void convertTransparentToNull(ossimRefPtr<ossimImageData> tile)const;
-   
-   ossim_uint32 getPartialReadSize(const ossimIpt& blockOrigin)const;
-   bool isVqCompressed(const ossimString& compressionCode)const;
-
-   /**
-    * @brief Uncompresses Vector Quantization unmasked image data.
-    * IC field = C4
-    * @param destination tile to stuff.
-    * @param source Pointer to compressed data.
-    */
-   void vqUncompressC4(ossimRefPtr<ossimImageData> destination,
-                       ossim_uint8* source);
-   
-   /**
-    * @brief Uncompresses Vector Quantization masked image data.
-    * IC field = M4
-    * @param destination tile to stuff.
-    * @param source Pointer to compressed data.
-    */
-   void vqUncompressM4(ossimRefPtr<ossimImageData> destination,
-                       ossim_uint8* source);
-
-   void lutUncompress(ossimRefPtr<ossimImageData> destination,
-                     ossim_uint8* source);
-
-   /**
-    * @brief scans the file storing in offsets in "theNitfBlockOffset" and
-    * block sizes in "theNitfBlockSize".
-    * @return true on success, false on error.  This checks for arrays being
-    * the same size as number of blocks.
-    */
-   virtual bool scanForJpegBlockOffsets();
-
-   /**
-    * @brief Uncompresses a jpeg block using the jpeg-6b library.
-    * @param x sample location in image space.
-    * @param y line location in image space.
-    * @return true on success, false on error.
-    */
-   virtual bool uncompressJpegBlock(ossim_uint32 x, ossim_uint32 y);
-
-   /**
-    * @brief Loads one of the default tables based on COMRAT value.
-    *
-    * @return true if comrat had valid table value(1-5) and table was loaded,
-    * false if COMRAT value did not contain a valid value.  Will also return
-    * false if there is already a table loaded.
-    * 
-    * @note COMRAT is nitf compression rate code field:
-    * -  "00.2" == default compression table 2
-    * -  "00.5" == default compression table 5 and so on.
-    */
-   bool loadJpegQuantizationTables(jpeg_decompress_struct& cinfo) const;
-
-   /**
-    * @brief Loads default huffman tables.
-    *
-    * @return true success, false on error.
-    */
-   bool loadJpegHuffmanTables(jpeg_decompress_struct& cinfo) const;
-   
-   /**
-   * @brief Virtual method determines the decimation factors at each resolution level. 
-   * This method derives the decimations from the image metadata.
-   */
-   virtual void establishDecimationFactors();
-
-   ossimRefPtr<ossimImageData>   theTile;
-   ossimRefPtr<ossimImageData>   theCacheTile;
-   ossimRefPtr<ossimNitfFile>    theNitfFile;
-   std::vector<ossimRefPtr<ossimNitfImageHeader> > theNitfImageHeader;
-   ReadMode                      theReadMode;
-   ossimScalarType               theScalarType;
-   bool                          theSwapBytesFlag;
-   ossim_uint32                  theNumberOfInputBands;
-   ossim_uint32                  theNumberOfOutputBands;
-   ossim_uint32                  theBlockSizeInBytes;
-   ossim_uint32                  theReadBlockSizeInBytes;
-   ossim_uint32                  theNumberOfImages;
-   ossim_uint32                  theCurrentEntry;
-   ossimIrect                    theImageRect;
-   std::ifstream                 theFileStr;   
-   std::vector<ossim_uint32>     theOutputBandList;
-   ossimIpt                      theCacheSize;
-   ossimInterleaveType           theCacheTileInterLeaveType;
-   bool                          theCacheEnabledFlag;
-   std::vector<ossim_uint32>     theEntryList;
-   ossimAppFixedTileCache::ossimAppFixedCacheId theCacheId;
-   bool                          thePackedBitsFlag;
-   ossimIrect                    theBlockImageRect;
-   std::vector<ossim_uint8>      theCompressedBuf;
-
-   //---
-   // Have compressed jpeg blocks of variable length so we must scan and
-   // capture the offsetts and block sizes for reading.
-   //---
-   std::vector<std::streamoff>   theNitfBlockOffset;
-   std::vector<ossim_uint32>     theNitfBlockSize;
-   
-   bool m_isJpeg12Bit;
-
-   //---
-   // If set to true indicates scanForJpegBlockOffsets() needs to be called
-   // prior to grabbing a block.
-   //---
-   bool m_jpegOffsetsDirty;
-   
-TYPE_DATA
-};
-   
-#endif /* #ifndef ossimNitfTileSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimNitfTileSource_12.h b/ossim/include/ossim/imaging/ossimNitfTileSource_12.h
deleted file mode 100644
index 9effc70..0000000
--- a/ossim/include/ossim/imaging/ossimNitfTileSource_12.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description:
-//
-// Contains class declaration for NitfTileSource_12.
-//
-//*******************************************************************
-//  $Id: ossimNitfTileSource_12.h 958 2010-06-03 23:00:32Z ming.su $
-#ifndef ossimNitfTileSource_12_HEADER
-#define ossimNitfTileSource_12_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-
-class OSSIM_DLL ossimNitfTileSource_12 
-{
-public:
-  static bool uncompressJpeg12Block(ossim_uint32 x, 
-                                    ossim_uint32 y,
-                                    ossimRefPtr<ossimImageData> cacheTile,
-                                    ossimNitfImageHeader* hdr,
-                                    ossimIpt cacheSize,
-                                    std::vector<ossim_uint8> compressedBuf,
-                                    ossim_uint32 readBlockSizeInBytes,
-                                    ossim_uint32 bands);
-
-
-  static bool loadJpegQuantizationTables(ossimNitfImageHeader* hdr,
-                                         jpeg_decompress_struct& cinfo);
-
-  static bool loadJpegHuffmanTables(jpeg_decompress_struct& cinfo);
-};
-   
-#endif /* #ifndef ossimNitfTileSource_12_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimNitfWriter.h b/ossim/include/ossim/imaging/ossimNitfWriter.h
deleted file mode 100644
index 5dd7dd5..0000000
--- a/ossim/include/ossim/imaging/ossimNitfWriter.h
+++ /dev/null
@@ -1,173 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimNitfWriter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfWriter_HEADER
-#define ossimNitfWriter_HEADER
-
-#include <iosfwd>
-#include <ossim/imaging/ossimNitfWriterBase.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/base/ossimRgbLutDataObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfTextHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfTextHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h>
-#include <ossim/base/ossimIoStream.h>
-
-class ossimProjection;
-
-class OSSIM_DLL ossimNitfWriter : public ossimNitfWriterBase
-{
-public:
-   ossimNitfWriter(const ossimFilename& filename=ossimFilename(""),
-                   ossimImageSource* inputSource = (ossimImageSource*)NULL);
-   virtual ~ossimNitfWriter();
-   virtual bool isOpen()const;
-   virtual bool open();
-   virtual void close();
-   
-   /**
-    * void getImageTypeList(std::vector<ossimString>& imageTypeList)const
-    *
-    * Appends this writer image types to list "imageTypeList".
-    *
-    * This writer has the following types:
-    * nitf_block_band_separate
-    * nitf_block_band_sequential
-    *
-    * @param imageTypeList stl::vector<ossimString> list to append to.
-    */   
-   virtual void getImageTypeList(std::vector<ossimString>& imageTypeList)const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-
-   /**
-    * @param propertyNames Array to populate with property names.
-    *
-    * @note The following names are handled:
-    *  file_header
-    *  image_header
-    *  des_header
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag, bool unique = true);
-   void addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag, bool unique,
-      const ossim_uint32& ownerIndex, const ossimString& tagType);
-
-   /**
-    * Saves the state of the writer to kwl with prefix then calls
-    * base class ossimImageFileWriter::saveState
-    *
-    * @param kwl Keyword list to save to.
-    *
-    * @param prefix Usually something like: "object2."
-
-    * @return true on success, false on failure.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-
-   /**
-    * Initializes the state of the writer from kwl with prefix then calls
-    * base class ossimImageFileWriter::loadState
-    *
-    * @param kwl Keyword list to initialize from.
-    *
-    * @param prefix Usually something like: "object2."
-
-    * @return true on success, false on failure.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   virtual bool addTextToNitf(std::string& inputText);
-
-   /** @brief Gets the block size. */
-   virtual void getTileSize(ossimIpt& size) const;
-
-   /**
-    * Sets the nitf output block size.  Must be divisible by 16.
-    *
-    * Note:  This is not called setBlockSize just because there was already
-    * a virtual setTileSize.
-    *
-    * @param tileSize Block size.
-    */
-   virtual void setTileSize(const ossimIpt& tileSize);
-
-   /**
-    * Get the image header used for export.
-    *
-    * @warning Many values will be overwritten at export time.  This includes the 
-    *          ossimNitfImageBandV2_1, if the number of bands on the image header
-    *          does not match that on the writer.
-    *
-    * @return The image header.
-    */
-   virtual ossimNitfImageHeaderV2_1 *getImageHeader();
-
-   /**
-    * Get the file header used for export.
-    *
-    * @warning Many values will be overwritten at export time.
-    *
-    * @return The file header.
-    */
-   virtual ossimNitfFileHeaderV2_1 *getFileHeader();
-
-   /**
-    * Add a DES to the file.
-    *
-    * @param des The DES to add to the file.
-    */
-   virtual void addDataExtensionSegment(const ossimNitfDataExtensionSegmentV2_1& des, bool allowTreOverflow);
-protected:
-   
-   /**
-    * @return true on success false on error.
-    */
-   virtual bool writeFile();
-   
-   /**
-    * write out block band separate
-    * 
-    * @return true on success and false on error
-    */
-   virtual bool writeBlockBandSeparate();
-   
-   /**
-    * Outputs in band sequential format.  Band 1 is followed by band
-    * 2, ... etc.
-    */
-   virtual bool writeBlockBandSequential();
-
-   /** Currently disabled... */
-   // virtual void addStandardTags();
-
-   ossimOFStream64*                      m_outputStream;
-   ossimRefPtr<ossimNitfFileHeaderV2_1>  m_fileHeader;
-   ossimRefPtr<ossimNitfImageHeaderV2_1> m_imageHeader;
-   std::vector<ossimNitfDataExtensionSegmentV2_1> m_dataExtensionSegments;
-   ossimRefPtr<ossimNitfTextHeaderV2_1>  m_textHeader;
-   std::string                           m_textEntry;
-   ossimIpt                              m_blockSize;
-
-TYPE_DATA 
-private:
-   void takeOverflowTags(bool useFileHeader, bool userDefinedTags);
-
-};
-
-#endif /* #ifndef ossimNitfWriter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimNitfWriterBase.h b/ossim/include/ossim/imaging/ossimNitfWriterBase.h
deleted file mode 100644
index ef195af..0000000
--- a/ossim/include/ossim/imaging/ossimNitfWriterBase.h
+++ /dev/null
@@ -1,184 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: OSSIM nitf writer base class to hold methods common to
-// all nitf writers.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfWriterBase.h 2981 2011-10-10 21:14:02Z david.burken $
-#ifndef ossimNitfWriterBase_HEADER
-#define ossimNitfWriterBase_HEADER
-
-#include <ossim/imaging/ossimImageFileWriter.h>
-
-class ossimFilename;
-class ossimImageSourceSequencer;
-class ossimMapProjectionInfo;
-class ossimNitfFileHeaderV2_X;
-class ossimNitfImageHeaderV2_X;
-class ossimProjection;
-
-/**
- * @brief OSSIM nitf writer base class to hold methods common to
- * all nitf writers.
- */
-class OSSIM_DLL ossimNitfWriterBase : public ossimImageFileWriter
-{
-public:
-
-   /** @brief default constructor */
-   ossimNitfWriterBase();
-
-   /**
-    * @brief Constructor that takes filename and input source.
-    * @param filename The output file name.
-    * @param inputSource The input source to write to file.
-    */
-   ossimNitfWriterBase(const ossimFilename& filename,
-                       ossimImageSource* inputSource);
-
-   /* @brief virtual destructor */
-   virtual ~ossimNitfWriterBase();
-
-   /**
-    * @brief Set the properties.
-    * @param property The property to set.
-    */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-
-   /**
-    * @brief Gets a property.
-    * @param The name of the property to get.
-    * @return The property if found.
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-
-   /**
-    * @param propertyNames Array to populate with property names.
-    *
-    * @note The following names are handled:
-    *  enable_rpcb_tag
-    *  enable_blocka_tag
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
- 
-
-   /**
-    * Saves the state of the writer to kwl with prefix then calls
-    * base class ossimImageFileWriter::saveState
-    *
-    * @param kwl Keyword list to save to.
-    *
-    * @param prefix Usually something like: "object2."
-
-    * @return true on success, false on failure.
-    *
-    * Keywords saved by saveState:
-    * 
-    * enable_rpcb_tag: true
-    *
-    * enable_blocka_tag: true
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-
-   /**
-    * Initializes the state of the writer from kwl with prefix then calls
-    * base class ossimImageFileWriter::loadState
-    *
-    * @param kwl Keyword list to initialize from.
-    *
-    * @param prefix Usually something like: "object2."
-
-    * @return true on success, false on failure.
-    *
-    * Keywords picked up by loadState:
-    * 
-    * enable_rpcb_tag: true
-    *
-    * enable_blocka_tag: true
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /**
-    * Returns a 3-letter extension from the image type descriptor 
-    * (theOutputImageType) that can be used for image file extensions.
-    *
-    * @param imageType string representing image type.
-    *
-    * @return the 3-letter string extension.
-    */
-   virtual ossimString getExtension() const;
-
-protected:
-
-   /**
-    * @brief Populates tags with geometry info from projection.  Will write an
-    * rpcb tag if theEnableRpcbTagFlag if set to true.
-    * @param hdr The header to write to.
-    * @param seq The input connection or image source.
-    */
-   void writeGeometry(ossimNitfImageHeaderV2_X* hdr,
-                      ossimImageSourceSequencer* seq);
-
-   /**
-    * @brief Adds the BLOCKA tag.
-    *
-    * @param mapInfo ossimMapProjectionInfo to use to set tag with.
-    * @param hdr The header to write to.
-    *
-    * @note Currently only used with map projected images.
-    */
-   void addBlockaTag(ossimMapProjectionInfo& mapInfo,
-                     ossimNitfImageHeaderV2_X* hdr);
-
-   /**
-    * @brief Adds the RPC00B tag.
-    *
-    * @param rect Requested rectangle of image to write.
-    *
-    * @param proj The output projection.
-    */
-   void addRpcbTag(const ossimIrect& rect,
-                   ossimProjection* proj,
-                   ossimNitfImageHeaderV2_X* hdr);
-
-   /**
-    * @brief Sets the complexity level of theFileHeader.
-    *
-    * @param endPosition This should be the end seek position of the file.
-    */
-   void setComplexityLevel(std::streamoff,
-                           ossimNitfFileHeaderV2_X* hdr);
-
-   /**
-    * @brief Sets file header and image header defaults from config file if
-    * found in preferences.
-    */
-   virtual void initializeDefaultsFromConfigFile(
-      ossimNitfFileHeaderV2_X* fileHdr,
-      ossimNitfImageHeaderV2_X* imgHdr );   
-
-   /** @brief If true user wants to set RPC00B tag. (DEFAULT = false) */
-   bool theEnableRpcbTagFlag;
-   
-   /**
-    * @brief If true user wants to set BLOCKA tag. (DEFAULT = true)
-    * Currently only valid for map projected images.
-    */
-   bool theEnableBlockaTagFlag;
-
-   
-
-private:
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimKakaduNitfVoid Writer_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimNormalizedRemapTable.h b/ossim/include/ossim/imaging/ossimNormalizedRemapTable.h
deleted file mode 100644
index 5a6ecd6..0000000
--- a/ossim/include/ossim/imaging/ossimNormalizedRemapTable.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class declaration for base class ossimNormalizedRemapTable.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedRemapTable.h 23664 2015-12-14 14:17:27Z dburken $
-
-
-#ifndef ossimNormalizedRemapTable_HEADER
-#define ossimNormalizedRemapTable_HEADER
-
-#include <ossim/base/ossimConstants.h>
-
-/**
- * @class ossimNormalizedRemapTable
- *
- * @brief Base class implemetation of normalized remap tables to go to/from
- * normalized value to pixel value.
- */
-class OSSIM_DLL ossimNormalizedRemapTable
-{
-public:
-
-   /** default constructor */
-   ossimNormalizedRemapTable();
-
-   /** virtual destructor */
-   virtual ~ossimNormalizedRemapTable();
-
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 operator[](ossim_int32 pix) const = 0;
-
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 normFromPix(ossim_int32 pix) const = 0;
-
-   /**
-    * @brief Returns an pixel value as an int from a normalized value.
-    *
-    * @return Value between scalar range of remap table.
-    */
-   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const = 0;
-
-   /**
-    * @brief Pure virtual method to get the number of table entries.
-    * @return The number of entries in a table.
-    */
-   virtual ossim_int32 getEntries() const = 0;
-
-   /**
-    * @brief Get the value used to normalize and un-normalize table entries.
-    * @return Value used to normalize and un-normalize table entries.
-    */
-   virtual ossim_float64 getNormalizer() const;
-
-private:
-
-   // Forbid copy constructor and asignment operator.
-   ossimNormalizedRemapTable(const ossimNormalizedRemapTable& source);
-   ossimNormalizedRemapTable& operator=(const ossimNormalizedRemapTable&);  
-
- };
-
-inline ossim_float64 ossimNormalizedRemapTable::getNormalizer() const
-{
-   return static_cast<ossim_float64>(getEntries()-1);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimNormalizedS16RemapTable.h b/ossim/include/ossim/imaging/ossimNormalizedS16RemapTable.h
deleted file mode 100644
index 0ee4258..0000000
--- a/ossim/include/ossim/imaging/ossimNormalizedS16RemapTable.h
+++ /dev/null
@@ -1,147 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class declaration for  ossimNormalizedS16RemapTable.  Table for
-// normalizing signed 16 bit data.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedS16RemapTable.h 10456 2007-02-08 14:17:50Z gpotts $
-
-#ifndef ossimNormalizedS16RemapTable_HEADER
-#define ossimNormalizedS16RemapTable_HEADER
-
-#include <ossim/imaging/ossimNormalizedRemapTable.h>
-#include <ossim/base/ossimCommon.h> /* for round */
-
-/**
- * @class ossimNormalizedS16RemapTable
- *
- * @brief Signed 16 bit normalized remap tables to go to/from
- * normalized value to pixel value.
- */
-class OSSIM_DLL ossimNormalizedS16RemapTable : public ossimNormalizedRemapTable
-{
-public:
-   
-   /** @brief default constructor */
-   ossimNormalizedS16RemapTable();
-
-   /** @brief virtual destructor */
-   virtual ~ossimNormalizedS16RemapTable();
-
-   enum
-   {
-      TABLE_ENTRIES  = 65536,  // 2^16 32767-(-32768)+1
-      OFFSET_TO_ZERO = 32768,  // Gets -32768 to zero.
-      NULL_PIX       = -32768,
-      MIN_PIX        = -32767 
-   };
-
-   /**
-    * @brief Gets the number of table entries.
-    * @return The number of entries in a table.
-    */
-   virtual ossim_int32 getEntries() const;
-
-   /**
-    * @brief Gets normalized value (between '0.0' and '1.0') from an
-    * int which should in scalar range of a signed 16 bit.
-    *
-    * @note This table is specialized to map both -32768 and -32767 to 0 since
-    * dted data has a null of -32767.
-    * 
-    * @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 operator[](ossim_int32 pix) const;
-
-   /**
-    * @brief Gets normalized value (between '0.0' and '1.0') from an
-    * int which should in scalar range of a signed 16 bit.
-    *
-    * @note This table is specialized to map both -32768 and -32767 to 0 since
-    * dted data has a null of -32767.
-    *
-    * @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
-
-   /**
-    * @brief Gets pixel value from normalized value.
-    *
-    * Valid returns range is signed 16 bit range or -32768 to 32767.
-    *
-    * @return Value between -32768 to 32767.
-    */
-   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;
-
-private:
-
-   static ossim_float64  theTable[TABLE_ENTRIES];
-   static bool theTableIsInitialized;
-
-};
-
-inline ossim_int32 ossimNormalizedS16RemapTable::getEntries() const
-{
-   return TABLE_ENTRIES;
-}
-
-inline ossim_float64 ossimNormalizedS16RemapTable::operator[](
-   ossim_int32 pix) const
-{
-   ossim_float64 result = 0;
-
-   // Move pix into table range.  This will take -32768 to 0.
-   ossim_int32 p = pix + OFFSET_TO_ZERO;
-
-   result = (p < TABLE_ENTRIES ? ( p >= 0 ? theTable[p] : 0.0) : 1.0);
-
-   return result;
-}
-
-inline ossim_float64 ossimNormalizedS16RemapTable::normFromPix(
-   ossim_int32 pix) const
-{
-   ossim_float64 result = 0;
-
-   // Move pix into table range.  This will take -32768 to 0.
-   ossim_int32 p = pix + OFFSET_TO_ZERO;
-
-   result = (p < TABLE_ENTRIES ? ( p >= 0 ? theTable[p] : 0.0) : 1.0);
-
-   return result;
-}
-
-inline ossim_int32 ossimNormalizedS16RemapTable::pixFromNorm(
-   ossim_float64 normPix) const
-{
-   if(normPix <= 0.0) return NULL_PIX;
-   
-   // Clamp between 0 and 1 on the way in.
-   ossim_float64 p = (normPix<1.0) ? ( (normPix>0.0) ? normPix : 0.0) : 1.0;
-
-   // Un-normalize.
-   p = p * getNormalizer(); // TABLE_ENTRIES - 1;
-
-   //---
-   // Move pixel into sign range then round it.  This will take  65535 to
-   // 32767 which is the max pixel for this scalar type.
-   //---
-   p = ossim::round<ossim_int32>(p - OFFSET_TO_ZERO);
-
-   if (p == NULL_PIX)
-   {
-      // norm pixel came in just above zero so should be at least min.
-      p = MIN_PIX; 
-   }
-
-   return static_cast<ossim_int32>(p);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimNormalizedU11RemapTable.h b/ossim/include/ossim/imaging/ossimNormalizedU11RemapTable.h
deleted file mode 100644
index 15aeffe..0000000
--- a/ossim/include/ossim/imaging/ossimNormalizedU11RemapTable.h
+++ /dev/null
@@ -1,118 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class declaration for  ossimNormalizedU11RemapTable.  Table for
-// normalizing unsigned 11 bit data.
-//
-//*******************************************************************
-//  $Id: ossimNormalizedU11RemapTable.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimNormalizedU11RemapTable_HEADER
-#define ossimNormalizedU11RemapTable_HEADER
-
-#include <ossim/imaging/ossimNormalizedRemapTable.h>
-#include <ossim/base/ossimCommon.h> /* for round */
-
-/**
- * @class ossimNormalizedU11RemapTable
- *
- * @brief Eleven bit normalized remap table to go to/from normalized value
- * to pixel value.
- */
-class OSSIM_DLL ossimNormalizedU11RemapTable : public ossimNormalizedRemapTable
-{
-public:
-
-   /** @brief default constructor */
-   ossimNormalizedU11RemapTable();
-   /** @brief virtual destructor */
-   virtual ~ossimNormalizedU11RemapTable();
-
-
-   enum
-   {
-      TABLE_ENTRIES = 2048 //  2^11
-   };
-
-   /**
-    * @brief Gets the number of table entries.
-    * @return The number of entries in a table.
-    */
-   virtual ossim_int32 getEntries() const;
-
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 operator[](ossim_int32 pix) const;
-
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
-
-   /**
-    * @brief Returns an pixel value as an int from a normalized value.
-    *
-    * @return Value between scalar range of remap table.
-    */
-   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;   
-
-private:
-
-   static ossim_float64  theTable[TABLE_ENTRIES];
-   static bool theTableIsInitialized;
-   
-};
-
-inline ossim_int32 ossimNormalizedU11RemapTable::getEntries() const
-{
-   return TABLE_ENTRIES;
-}
-
-inline ossim_float64 ossimNormalizedU11RemapTable::operator[](
-   ossim_int32 pix) const
-{
-   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
-}
-
-inline ossim_float64 ossimNormalizedU11RemapTable::normFromPix(
-   ossim_int32 pix) const
-{
-   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
-}
-
-inline ossim_int32 ossimNormalizedU11RemapTable::pixFromNorm(
-   ossim_float64 normPix) const
-{
-   if(normPix <= 0.0) return 0;
-   
-   // un-normalize...
-   ossim_float64 p = normPix * getNormalizer();
-
-   // Ensure pixel is in range.
-   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
-
-   // Since going from double to int round...
-   p = ossim::round<ossim_int32>(p);
-
-   if(p == 0.0)
-   {
-      p = 1.0;
-   }
-   
-   return static_cast<ossim_int32>(p);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimNormalizedU16RemapTable.h b/ossim/include/ossim/imaging/ossimNormalizedU16RemapTable.h
deleted file mode 100644
index eb83e28..0000000
--- a/ossim/include/ossim/imaging/ossimNormalizedU16RemapTable.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class declaration for  ossimNormalizedU16RemapTable.  Table for
-// normalizing unsigned 16 bit data.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedU16RemapTable.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimNormalizedU16RemapTable_HEADER
-#define ossimNormalizedU16RemapTable_HEADER
-
-#include <ossim/imaging/ossimNormalizedRemapTable.h>
-#include <ossim/base/ossimCommon.h> /* for round */
-
-/**
- * @class ossimNormalizedU16RemapTable
- *
- * @brief Unsigned 16 bit normalized remap table to go to/from normalized value
- * to pixel value.
- */
-class OSSIM_DLL ossimNormalizedU16RemapTable : public ossimNormalizedRemapTable
-{
-public:
-
-   /** @brief default constructor */
-   ossimNormalizedU16RemapTable();
-   /** @brief virtual destructor */
-   virtual ~ossimNormalizedU16RemapTable();
-
-   enum
-   {
-      TABLE_ENTRIES   = 65536 // 2^16
-   };
-
-   /**
-    * @brief Gets the number of table entries.
-    * @return The number of entries in a table.
-    */
-   virtual ossim_int32 getEntries() const;
-   
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 operator[](ossim_int32 pix) const;
-
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
-
-   /**
-    * @brief Returns an pixel value as an int from a normalized value.
-    *
-    * @return Value between scalar range of remap table.
-    */
-   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;
-   
-protected:
-
-   static ossim_float64  theTable[TABLE_ENTRIES];
-   static bool theTableIsInitialized;
-   
-};
-
-inline ossim_int32 ossimNormalizedU16RemapTable::getEntries() const
-{
-   return TABLE_ENTRIES;
-}
-
-inline ossim_float64 ossimNormalizedU16RemapTable::operator[](
-   ossim_int32 pix) const
-{
-   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
-}
-
-inline ossim_float64 ossimNormalizedU16RemapTable::normFromPix(
-   ossim_int32 pix) const
-{
-   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
-}
-
-inline ossim_int32 ossimNormalizedU16RemapTable::pixFromNorm(
-   ossim_float64 normPix) const
-{
-   if(normPix <= 0.0) return 0;
-   
-   // un-normalize...
-   ossim_float64 p = normPix * getNormalizer();
-
-   // Ensure pixel is in range.
-   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
-
-   // Since going from double to int round...
-   p = ossim::round<ossim_int32>(p);
-       
-   if(p == 0.0)
-   {
-      p = 1.0;
-   }
-   
-   return static_cast<ossim_int32>(p);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimNormalizedU8RemapTable.h b/ossim/include/ossim/imaging/ossimNormalizedU8RemapTable.h
deleted file mode 100644
index 923aea6..0000000
--- a/ossim/include/ossim/imaging/ossimNormalizedU8RemapTable.h
+++ /dev/null
@@ -1,117 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class declaration for  ossimNormalizedU8RemapTable.  Table for
-// normalizing unsigned 8 bit data.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedU8RemapTable.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimNormalizedU8RemapTable_HEADER
-#define ossimNormalizedU8RemapTable_HEADER
-
-#include <ossim/imaging/ossimNormalizedRemapTable.h>
-#include <ossim/base/ossimCommon.h> /* for round */
-
-/**
- * @class ossimNormalizedU8RemapTable
- *
- * @brief Eight bit normalized remap table to go to/from normalized value
- * to pixel value.
- */
-class OSSIM_DLL ossimNormalizedU8RemapTable : public ossimNormalizedRemapTable
-{
-public:
-
-   /** @brief default constructor */
-   ossimNormalizedU8RemapTable();
-   /** @brief virtual destructor */
-   virtual ~ossimNormalizedU8RemapTable();
-
- 
-   enum
-   {
-      TABLE_ENTRIES = 256 // 2^8
-   };
-
-   /**
-    * @brief Gets the number of table entries.
-    * @return The number of entries in a table.
-    */
-   virtual ossim_int32 getEntries() const;
-
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 operator[](ossim_int32 pix) const;
-
-   /**
-    *  @brief Gets a normalized value (between '0.0' and '1.0') from
-    *  a pixel value.
-    *
-    *  @return Value between 0.0 and 1.0.
-    */
-   virtual ossim_float64 normFromPix(ossim_int32 pix) const;
-
-   /**
-    * @brief Returns an pixel value as an int from a normalized value.
-    *
-    * @return Value between scalar range of remap table.
-    */
-   virtual ossim_int32 pixFromNorm(ossim_float64 normPix) const;
-
-protected:
-
-   static ossim_float64 theTable[TABLE_ENTRIES];
-   static bool theTableIsInitialized;
-
-};
-
-inline ossim_int32 ossimNormalizedU8RemapTable::getEntries() const
-{
-   return TABLE_ENTRIES;
-}
-
-inline ossim_float64 ossimNormalizedU8RemapTable::operator[](
-   ossim_int32 pix) const
-{
-   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);  
-}
-
-inline ossim_float64 ossimNormalizedU8RemapTable::normFromPix(
-   ossim_int32 pix) const
-{
-   return ( (pix < TABLE_ENTRIES) ? (pix >= 0 ? theTable[pix] : 0.0) : 1.0);
-}
-
-inline ossim_int32 ossimNormalizedU8RemapTable::pixFromNorm(
-   ossim_float64 normPix) const
-{
-   if(normPix <= 0.0) return 0;
-   
-   ossim_float64 p = normPix * getNormalizer();
-
-   // Ensure pixel is in range.
-   p = ( (p < TABLE_ENTRIES) ? (p >= 0.0 ? p : 0.0) : getNormalizer());
-
-   // Since going from double to int round...
-   p = ossim::round<ossim_int32>(p);
-       
-   if(p == 0.0)
-   {
-      p = 1;
-   }
-   
-   return static_cast<ossim_int32>(p);
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimOrthoImageMosaic.h b/ossim/include/ossim/imaging/ossimOrthoImageMosaic.h
deleted file mode 100644
index 4873d78..0000000
--- a/ossim/include/ossim/imaging/ossimOrthoImageMosaic.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimOrthoImageMosaic.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimOrthoImageMosaic_HEADER
-#define ossimOrthoImageMosaic_HEADER
-
-#include <ossim/imaging/ossimImageMosaic.h>
-
-class OSSIMDLLEXPORT ossimOrthoImageMosaic : public ossimImageMosaic
-{
-public:
-   ossimOrthoImageMosaic();
-   ossimOrthoImageMosaic(ossimConnectableObject::ConnectableObjectList& inputSources);
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
-   virtual void initialize();
-
-   //! Returns the geometry associated with the full mosaic. This object maintains it's own 
-   //! geometry instance.
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   //! Used to retrieve the number of overlapping images withint the given rect.
-   virtual ossim_uint32 getNumberOfOverlappingImages(const ossimIrect& rect, ossim_uint32 resLevel=0)const;
-
-   //! Used to populate the result with the index of the overlapping images.
-   virtual void getOverlappingImages(std::vector<ossim_uint32>& result,
-                                     const ossimIrect& rect,
-                                     ossim_uint32 resLevel=0)const;
-   
-   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32& returnedIdx,
-                                                   const ossimIrect& origin,
-                                                   ossim_uint32 resLevel=0);
-   
-   ossimIrect getRelativeRect(ossim_uint32 index,
-                              ossim_uint32 resLevel = 0)const;
-protected:
-   virtual ~ossimOrthoImageMosaic();   
-   void computeBoundingRect(ossim_uint32 resLevel=0);
-   
-   //! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
-   //! each time the contents of the mosaic changes.
-   void updateGeometry();
-
-   std::vector<ossimDpt>  m_InputTiePoints;
-   ossimDpt    m_Delta; //!< Holds R0 delta and will be scaled for different r-level requests
-   ossimDpt    m_UpperLeftTie; //!< Will hold the upper left tie of the mosaic.
-   ossimIrect  m_BoundingRect;
-   ossimString m_Units;
-   ossimRefPtr<ossimImageGeometry> m_Geometry; //!< The input image geometry, altered by the map tiepoint
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimOverviewBuilderBase.h b/ossim/include/ossim/imaging/ossimOverviewBuilderBase.h
deleted file mode 100644
index 2cda8bb..0000000
--- a/ossim/include/ossim/imaging/ossimOverviewBuilderBase.h
+++ /dev/null
@@ -1,241 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  Base class for overview builders.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimOverviewBuilderBase.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimOverviewBuilderBase_HEADER
-#define ossimOverviewBuilderBase_HEADER 1
-
-#include <ossim/base/ossimSource.h>
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimBitMaskWriter.h>
-#include <ossim/imaging/ossimMaskFilter.h>
-#include <vector>
-
-class ossimImageFileWriter;
-class ossimFilename;
-
-class OSSIM_DLL ossimOverviewBuilderBase
-   :
-      public ossimSource,
-      public ossimProcessInterface,
-      public ossimConnectableObjectListener
-{
-public:
-
-   /** default constructor */
-   ossimOverviewBuilderBase();
-
-   /**
-    * @brief Sets an optional file writer to the builder.
-    * Currently used by the virtual overview builder.
-    * 
-    * @param outputWriter The file writer of the builder.
-    * 
-    * @return True on successful initialization, false on error.
-    */
-   virtual bool setOutputWriter(ossimImageFileWriter* outputWriter);
-
-   /**
-    * @brief Sets the input to the builder.
-    * 
-    * @param imageSource The input to the builder.
-    * 
-    * @return True on successful initialization, false on error.
-    */
-   virtual bool setInputSource(ossimImageHandler* imageSource);
-
-   /**
-    * @brief Sets the output file name. (pure virtual)
-    * @prama file This will be the output file name like foo.ovr
-    */
-   virtual void setOutputFile(const ossimFilename& file)=0;
-
-   /**
-    * @brief Gets the output file name. (pure virtual)
-    *
-    * @return The output file name or ossimFilename::NIL if it was not set
-    * yet and the image handle has not been initialized.
-    *
-    * @note This will return ossimFilename::NIL unless one of was called,
-    * setInputSource or setOutputFile.
-    */
-   virtual ossimFilename getOutputFile() const=0;
-
-   /**
-    * @brief Sets the overview output type. (pure virtual)
-    * @param type This should be the string representing the type.  This method
-    * will do nothing if type is not handled and return false.
-    * @return true if type is handled, false if not.
-
-    * @note Currently handled types are 
-    */
-   virtual bool setOverviewType(const ossimString& type)=0;
-
-   /**
-    * @brief Gets the overview type. (pure virtual)
-    * @return The overview output type as a string. */
-   virtual ossimString getOverviewType() const=0;
-
-   /**
-    * @brief Method to check if builder can handle type.
-    * @return true if type is handled by builder, false if not.
-    */
-   virtual bool hasOverviewType(const ossimString& type) const;
-
-   /**
-    * @brief Method to populate class supported types. (pure virtual)
-    * Example:
-    * ossimTiffOverviewNearest
-    * ossimTiffOverviewBox
-    *
-    * @param typeList List of ossimStrings to add to.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const=0;
-
-   /**
-    * @brief Get the overview stop dimension.
-    * @return The overview stop dimension.
-    */
-   virtual ossim_uint32 getOverviewStopDimension() const;
-
-   /**
-    * @brief Sets the overview stop dimension.
-    *
-    * This controls how many layers will be built. If set to 64 then the
-    * builder will stop when height and width for current level are less
-    * than or equal to 64.  Note a default can be set in the ossim preferences
-    * file, setting the keyword "overview_stop_dimension".
-    * 
-    * @param dim The overview stop dimension
-    */
-   virtual void setOverviewStopDimension(ossim_uint32 dim);
-
-   /**
-    * @brief Gets the histogram accumulation mode.
-    * @return mode NONE, NORMAL or FAST.
-    */
-   ossimHistogramMode getHistogramMode() const;
-
-   /**
-    * @brief Sets the histogram accumulation mode.
-    * @param mode NONE, NORMAL or FAST.
-    */
-   void setHistogramMode(ossimHistogramMode mode);
- 
-   /**
-    * @brief Builds the overviews. (pure virtual)
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool execute()=0;
-
-   /**
-    * @brief Finalize method.  Should be called at end of execute.
-    *
-    * This implementation will reset the the output band list if the source
-    * image handler is a band selector.
-    */
-   virtual void finalize();
-
-   /**
-    * @brief Specifies parameters (in KWL) for generation of an alpha (bit)
-    * mask such that any full or partial null pixels will be masked out. A
-    * mask file will be written to the source image directory with the image
-    * file name and extension ".mask". 
-    */
-   void setBitMaskSpec(const ossimKeywordlist& bit_mask_spec);
-
-   /**
-    * @brief Turn on/off scan for min max flag.
-    * This method assumes the null is known.
-    * @param flag true turns scan on, false off. Default=off.
-    */
-   void setScanForMinMax(bool flag);
-
-   /** @return scan for min max flag. */
-   bool getScanForMinMax() const;
-
-   /**
-    * @brief Turn on/off scan for min, max, null flag.
-    * Attempts to find null, min and max where null is the minimum value found,
-    * min is the second most min and max is max.
-    * @param flag true turns scan on, false off. Default=off.
-    */
-   void setScanForMinMaxNull(bool flag);
-
-   /** @return scan for min max flag. */
-   bool getScanForMinMaxNull() const;
-
-protected:
-   /** virtual destructor */
-   virtual ~ossimOverviewBuilderBase();
-
-   /**
-    *  @brief Gets the required number of res levels.
-    *
-    *  Convenience method to get the required number of reduced resolution
-    *  data sets to get to the smallest dimension of the output tile size.
-    *  Note that this include r0.
-    *
-    *  @param ih Pointer to the image handler.
-    *
-    *  @return number of res levels.
-    */
-   ossim_uint32 getRequiredResLevels(const ossimImageHandler* ih) const;
-  
-   /**
-    * @brief Initializes preference settings.
-    *
-    * Currently:
-    *
-    * 1) Gets the default stop dimension.
-    *
-    * Looks for overview_stop_dimension, then will use minimum default tile
-    * size if that is not found.
-    * 
-    * 2) Set scan float data flag.
-    *
-    * Looks for overview_builder.scan_for_min_max_null_if_float.
-    *
-    * If true this will turn the m_scanForMinMaxNull on if the scalar type of
-    * image handler is float.
-    */
-   void initializePreferenceSettings();
-
-   /**
-    * @brief Checks scalar type and turns on scanning for min, max, nulls if
-    * needed.
-    */
-   void initializeScanOptions();
-   
-   ossim_uint32 m_overviewStopDimension;
-   ossimHistogramMode m_histoMode; 
-   ossimKeywordlist m_bitMaskSpec;
-   ossimRefPtr<ossimImageHandler>  m_imageHandler;
-   std::vector<ossim_uint32>       m_originalBandList;
-   ossimRefPtr<ossimBitMaskWriter> m_maskWriter;
-   ossimRefPtr<ossimMaskFilter>    m_maskFilter;
-   ossimFilename                   m_outputFile;
-   bool                            m_scanForMinMax;
-   bool                            m_scanForMinMaxNull;
-   bool                            m_scanFloatData;
-
-   /** for rtti stuff */
-   TYPE_DATA
-};
-
-#endif /* End of "#ifndef ossimOverviewBuilderBase_HEADER" */
-
diff --git a/ossim/include/ossim/imaging/ossimPiecewiseRemapper.h b/ossim/include/ossim/imaging/ossimPiecewiseRemapper.h
deleted file mode 100644
index 2d3727f..0000000
--- a/ossim/include/ossim/imaging/ossimPiecewiseRemapper.h
+++ /dev/null
@@ -1,262 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Piecewise remapper class declaration.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimPiecewiseRemapper_HEADER
-#define ossimPiecewiseRemapper_HEADER 1
-
-#include <ossim/imaging/ossimTableRemapper.h>
-#include <ossim/base/ossimRtti.h>
-#include <vector>
-
-/**
- * @class ossimPiecewiseRemapper
- *
- * Given object2 is a ossimPiecewiseRemapper with a state of:
- * 
- * object2.band0.remap0:  ((0,127,0,127),(128,255,128,382))
- * object2.band0.remap1:  ((0,382,0,255))
- *
- * Quadruples map to:
- * (<min_in> <max_in> <min_out> <max_out>)
- *
- * There can be any number of quadrupals.
- *
- * From above example:
- * 
- * 0 <-> 127 is mapped to 0 <-> 127
- * 128 <->  255 is mapped to 128 <-> 382
- * 0 <-> 382 is mapped to 0 <-> 255
- *
- * Notes:
- * 
- * 1) Currently there is only one remap type so it's not really needed but
- *    left in the code for future type remaps, e.g. a remap where there is
- *    a linear and a logarithmic section.
- *
- * 2) Any number of "remaps" are allowed.
- *
- * 3) Last remap should get data between scalar types.
- * 
- */
-class OSSIMDLLEXPORT ossimPiecewiseRemapper : public ossimTableRemapper
-{
-public:
-
-   enum PiecewiseRemapType
-   {
-      UNKNOWN       = 0,
-      LINEAR_NATIVE = 1
-   };
-   
-   /** default constructor */
-   ossimPiecewiseRemapper();
-
-   /** @return "ossimPiecewiseRemapper" */
-   virtual ossimString getClassName()const;
-
-   /** @return "OSSIM Piecewise Remapper" */
-   virtual ossimString getLongName()  const;
-
-   /** @return "Piecewise Remapper" */
-   virtual ossimString getShortName() const;
-
-   /**
-    * @brief Get tile method.
-    * @param tileRect Region of interest.
-    * @param resLevel Resolution level.
-    * @param The requested region of interest for resolution level.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel = 0);
-
-   /** @brief Initialization method.  Called on state change of chain. */ 
-   virtual void initialize();
-
-   /**
-    * @brief Sets remap type.
-    *
-    * Current types: "linear_native"
-    *
-    * @param type
-    */
-   void setRemapType( const std::string& type );
-   
-   /**
-    * @brief Saves the state to a keyword list.
-    * @return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * @brief Loads (recreates) the state of an object from a keyword
-    * list.
-    * @return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-
-   /** @brief Print method.  Called by ossimObject::operator<<. */
-   virtual ostream& print(ostream& os) const;
-
-   /** @return The min pixel of the band. */
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   
-   /** @return The max pixel of the band. */
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-protected:
-
-   /**
-    * @brief Protected virtual destructor.
-    *
-    * This class is derived from ossimReferenced; hence, will auto destruct
-    * provided it is wrapped/stored in an ossimRefPtr. Example usage:
-    *
-    * ossimRefPtr<ossimPiecewiseRemapper> pwr = new ossimPiecewiseRemapper();
-    */
-   virtual ~ossimPiecewiseRemapper();
-
-private:
-
-   /**
-    * @class ossimRemapSet
-    *
-    * Private container class. Currently hold an array of doubles.
-    */
-   class ossimRemapSet
-   {
-   public:
-      ossimRemapSet();
-      ossimRemapSet(const ossimRemapSet& obj);
-      const ossimRemapSet& operator=(const ossimRemapSet& rhs);
-      std::vector<ossim_float64> m_set;
-   };
-   
-   /**
-    * @class ossimBandRemap
-    *
-    * Private container class. Holds array of ossimRemapSets for a given band.
-    */
-   class ossimBandRemap
-   {
-   public:
-      ossimBandRemap();
-      ossimBandRemap(const ossimBandRemap& obj);
-      const ossimBandRemap& operator=(const ossimBandRemap& rhs);
-
-      void loadState( const ossimKeywordlist& kwl,
-                      const std::string& prefix,
-                      ossim_uint32 band );
-      
-      void saveState( ossimKeywordlist& kwl,
-                      const std::string& prefix,
-                      ossimPiecewiseRemapper::PiecewiseRemapType remapType,
-                      ossim_uint32 band ) const;
-
-      /**
-       * @brief Initializes set from string.
-       *
-       * Example input: ((0, 127, 0, 127), (128, 255, 128, 382))
-       * 
-       * @param s String to initialize from.
-       * @param set Initialized by this.
-       */
-      bool initRemapSetFromString( const std::string& s,
-                                   ossimPiecewiseRemapper::ossimRemapSet& set ) const;
-
-      /**
-       * @brief Gets a string from remap set for type.
-       * @param remapType
-       * @param set
-       * @param s Initialized by this.
-       */
-      void getRemapSetString( ossimPiecewiseRemapper::PiecewiseRemapType remapType,
-                              const ossimPiecewiseRemapper::ossimRemapSet& set, 
-                              std::string& s ) const;
-
-      void getLinearRemapSetString( const ossimPiecewiseRemapper::ossimRemapSet& set, 
-                                    std::string& s ) const;
-         
-      std::vector<ossimRemapSet> m_remap;
-      
-   }; // End: class ossimBandRemap 
-   
-   /**
-    * @brief Gets a string from remap type.
-    * @param remapType
-    * @param s Initialized by this.
-    */
-   void getRemapTypeString( ossimPiecewiseRemapper::PiecewiseRemapType remapType,
-                            std::string& s ) const;
-
-   /**
-    * @brief Gets a string from remap set.
-    *
-    * Example output: ((0, 127, 0, 127), (128, 255, 128, 382))
-    * 
-    * @param set
-    * @param s Initialized by this.
-    */   
-   void getLinearRemapSetString(
-      const ossimPiecewiseRemapper::ossimRemapSet& set, 
-      std::string& s ) const;
-
-   /** @brief Builds the table. */
-   void buildTable();
-
-   /** @brief Builds the linear native table. */
-   void buildLinearNativeTable();
-
-   /** @brief Builds the linear native table for scalar type T. */
-   template <class T> void buildLinearNativeTable(T dummy);
-   
-   /**
-    * @brief Initialized base class (ossimTableRemapper) values:
-    * - theTableBinCount
-    * - theTableBandCount
-    * - theTableType
-    * - theTable (resizes if not correct size.
-    */
-   void setupTable();
-
-   /** @brief Computes min/max from remaps in m_bandRemap. */
-   void initMinMax();
-
-   /** @private(not allowed) copy constructor. */
-   ossimPiecewiseRemapper(const ossimPiecewiseRemapper& obj);
-
-   /** @private(not allowed) assignment(operator=) */
-   ossimPiecewiseRemapper& operator=(const ossimPiecewiseRemapper& hr);
-
-   /** @brief Dirty flag to indicate table needs to be rebuilt. */
-   bool m_dirty;
-   
-   PiecewiseRemapType m_remapType;
-
-   // One set per band.
-   std::vector<ossimPiecewiseRemapper::ossimBandRemap> m_bandRemap;
-
-#if 1 /* Not sure if we need min/max right now.(drb) */
-   // Stores the min/max from the table for each band.
-   vector<ossim_float64> m_min;
-   vector<ossim_float64> m_max;
-#endif
-
-   TYPE_DATA
-};
-
-#endif  /* #ifndef ossimPiecewiseRemapper_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimPixelFlipper.h b/ossim/include/ossim/imaging/ossimPixelFlipper.h
deleted file mode 100644
index f85a4ed..0000000
--- a/ossim/include/ossim/imaging/ossimPixelFlipper.h
+++ /dev/null
@@ -1,273 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Class to scan pixels and flip target dn pixel value to new dn pixel value.
-// This was written to fix partial null pixels.
-// 
-//*************************************************************************
-// $Id: ossimPixelFlipper.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimPixelFlipper_HEADER
-#define ossimPixelFlipper_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/base/ossimPolygon.h>
-#include <OpenThreads/ReentrantMutex>
-
-/**
- *  Class to scan pixels and flip target dn value to a replacement dn
- *  value.
- *
- *  This was written to fix problems with null pixels, i.e. an image has a
- *  digital number(dn) of 255 for null and it is desired to use a dn of 0 as
- *  a null.  This can really be used to flip any pixel value to another.
- *
- *  @note This filter currently works on the input tile directly and does
- *  not copy the data.
- *
- *  @see theReplacementMode data member documentation for more info.
- */
-class OSSIM_DLL ossimPixelFlipper : public ossimImageSourceFilter
-{
-public:
-   static const char PF_TARGET_VALUE_KW[];     
-   static const char PF_TARGET_RANGE_KW[];     
-   static const char PF_REPLACEMENT_VALUE_KW[];
-   static const char PF_REPLACEMENT_MODE_KW[];
-   static const char PF_CLAMP_VALUE_KW[];
-   static const char PF_CLAMP_VALUE_LO_KW[];   
-   static const char PF_CLAMP_VALUE_HI_KW[];   
-   static const char PF_CLIP_MODE_KW[];
-
-   /**
-    * Target Replacement Mode:
-    * 
-    * Examples given for 3-band pixel values as (R, G, B) with target = 0, and replacement = 1
-
-    * If mode is REPLACE_BAND_IF_TARGET (default):
-    * Any pixel band with value of target will be replaced.
-    * (0, 0, 0) becomes (1, 1, 1)
-    * (0, 3, 2) becomes (1, 3, 2)
-    *
-    * If mode is REPLACE_BAND_IF_PARTIAL_TARGET:
-    * A band with target value will be replaced only if at least one other band in the pixel does 
-    * not have the target.
-    * (0, 0, 0) remains (0, 0, 0)
-    * (0, 3, 2) becomes (1, 3, 2)
-    *
-    * If mode is REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
-    * All bands of the pixel will be replaced if any but not all bands in the pixel have the
-    * target value.
-    * (0, 0, 0) remains (0, 0, 0)
-    * (0, 3, 2) becomes (1, 1, 1)
-    *
-    * If mode is REPLACE_ONLY_FULL_TARGETS:
-    * All bands in the pixel will be replaced only if they all have the target.
-    * (0, 0, 0) becomes (1, 1, 1)
-    * (0, 3, 2) remains (0, 3, 2)
-    *
-    * If mode is REPLACE_ALL_BANDS_IF_ANY_TARGET:
-    * All bands in the pixel will be replaced if even one band has the target.
-    * (0, 0, 0) becomes (1, 1, 1)
-    * (0, 3, 2) remains (1, 1, 1)
-    */
-   enum ReplacementMode
-   {
-      REPLACE_BAND_IF_TARGET               = 0,
-      REPLACE_BAND_IF_PARTIAL_TARGET       = 1,
-      REPLACE_ALL_BANDS_IF_PARTIAL_TARGET  = 2,
-      REPLACE_ONLY_FULL_TARGETS            = 3,
-      REPLACE_ALL_BANDS_IF_ANY_TARGET      = 4,
-   };
-
-   /** 
-    * When either a lo and/or hi clamp value is set, the clamping mode will be enabled accordingly
-    * and override any target replacement defined
-    */
-   enum ClampingMode
-   {
-      DISABLED                           = 0,
-      CLAMPING_LO                        = 1,
-      CLAMPING_HI                        = 2,
-      CLAMPING_LO_AND_HI                 = 3,
-   };
-
-   enum ClipMode
-   {
-      NONE = 0,
-      BOUNDING_RECT  = 1,
-      VALID_VERTICES = 2
-   };
-
-   /** default constructor */
-   ossimPixelFlipper(ossimObject* owner=NULL);
-
-
-   /** @return "Pixel flipper" as an ossimString. */
-   virtual ossimString getShortName()const;
-
-   /** Initializes the state of the object from theInputConnection. */
-   virtual void initialize();
-
-   /**
-    * @param tile_rect Rectangle to fill tile with.
-    * 
-    * @param resLevel Reduced resolution level to grab from.
-    * 
-    * @return ossimRefPtr<ossimImageData> This is tile that was filled with
-    * tile_rect.
-    *
-    * @note Callers should check the ossimRefPtr::valid method.
-    * The internal pointer of the ossimRefPtr<ossimImageData> can be
-    * null if the tile_rect did not intersect the input connection's
-    * bounding rectangle.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual ossim_float64 getMaxPixelValue (ossim_uint32 band = 0 ) const;
-   virtual ossim_float64 getMinPixelValue (ossim_uint32 band = 0 ) const;
-      
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /** 
-    * @param target_value This is the value to flip. 
-    * @note If clamping is specified, it will take precedence over any target value (or range) test
-    */
-   void setTargetValue(ossim_float64 target_value);
-
-   /** 
-    * Instead of a single value for a target, this method allows for specifying a range of values
-    * to flip to the replacement. The replacement mode is still referenced.
-    * @param  This is the value to flip. 
-    * @note If clamping is specified, it will take precedence over any target range test.
-    */
-   void setTargetRange(ossim_float64 target_min, ossim_float64 target_max);
-
-   /**
-    * @param replacement_value This is the value to flip target to.
-    * @note If clamping is specified, it will take precedence over any target replacement.
-    */
- void setReplacementValue(ossim_float64 replacement_value);
-
-   /**
-    * @param clamp_value If set all pixel values above this range will (or below if clamp_max_value
-    * = false) be clamped to clamp_value. Must be less than max pixel (or greater than the min 
-    * pixel) value of the input and cannot be null. 
-    * @note If any clamp limit is defined, it will take precedence over any target value (or range)
-    * replacement. The replacement mode is referenced when deciding whether a pixel should be 
-    * clamped or left alone.
-    */
-   void setClampValue(ossim_float64 clamp_value, bool is_high_clamp_value=true);
-   void setClampValues(ossim_float64 clamp_value_lo, ossim_float64 clamp_value_hi);
-
-   /** @see enum ReplacementMode */
-   void setReplacementMode(ossimPixelFlipper::ReplacementMode mode);
-
-   /** Accepts a string that must match the enumerator's label (can be lower case) and sets the 
-    * replacement mode accordingly. If the string is not understood, the mode remains unchanged and
-    * FALSE is returned. */
-   bool setReplacementMode(const ossimString& modeString);
-
-   /** 
-    * Clipping here refers to bounding rect or valid polygon (spacial) clipping, where all pixels
-    * outside the valid area are mapped to the replacement value.
-    */
-   void setClipMode(const ossimString& modeString);
-   void setClipMode(ClipMode mode);
-
-   //ossim_float64 getTargetValue()      const;
-   ossim_float64 getReplacementValue() const;
-   //ossim_float64 getClampValue() const;
-   ossimPixelFlipper::ReplacementMode getReplacementMode()  const;
-   ossimString getReplacementModeString() const;
-   ossimString getClipModeString() const;
-   ClipMode getClipMode() const;
-
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   //! This object can be used outside of an image chain for offline processing of existing tile.
-   template <class T> void flipPixels(T dummy, ossimImageData* inpuTile, ossim_uint32 resLevel);
-
-protected:
-   /** destructor */
-   virtual ~ossimPixelFlipper();
-   template <class T> void clipTile(T dummy,
-                                    ossimImageData* inpuTile,
-                                    ossim_uint32 resLevel);
-
-   /**
-    * Verifies pixel is in range.
-    * @return Returns true if in range else false.
-    */
-   bool inRange(ossim_float64 value) const;
-
-   void allocateClipTileBuffer(ossimRefPtr<ossimImageData> inputImage);
-   
-   /** The value range to replace. For a single value replacement, both Lo and Hi are equal. Any
-    * pixel within this range will be remapped to the replacement value */
-   ossim_float64 theTargetValueLo;
-   ossim_float64 theTargetValueHi;
-
-    /** When target values are defined, this is the value the pixel will assume if the pixel falls 
-     *  within the target range (according to the rules for replacement mode) */
-   ossim_float64 theReplacementValue;
-   ReplacementMode theReplacementMode; //!< See documentation for ReplacementMode enum above
-
-  /** The range of desired pixel values. Any pixels outside this range are set to the corresponding
-    * clamp value. Note that theReplacementValue is not referenced when clamping. */
-   ossim_float64 theClampValueLo;
-   ossim_float64 theClampValueHi;
-   ClampingMode  theClampingMode;
-
-   /**
-    * Border Clip mode
-    *
-    * This will flip to nulls any pixel value outside the specified mode.
-    *
-    * Valid modes are:
-    *
-    * none
-    * bounding_rect
-    * valid_vertices
-    *
-    * if the mode is "none" then nothing is done.
-    * if the mode is "bounding_rect" then the bounding rect for the requested rlevel
-    *                is used and every pixel outside that   
-    */
-   ClipMode        theClipMode;
-   
-   /** For lock and unlock. */
-   mutable OpenThreads::ReentrantMutex      theMutex;
-
-   mutable std::vector<ossimPolygon> theValidVertices;
-   mutable std::vector<ossimIrect>   theBoundingRects;
-
-   ossimRefPtr<ossimImageData> theClipTileBuffer;
-   
-   TYPE_DATA
-};
-
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimPolyCutter.h b/ossim/include/ossim/imaging/ossimPolyCutter.h
deleted file mode 100644
index c87a9d7..0000000
--- a/ossim/include/ossim/imaging/ossimPolyCutter.h
+++ /dev/null
@@ -1,109 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimPolyCutter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimPolyCutter_HEADER
-#define ossimPolyCutter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/imaging/ossimImageDataHelper.h>
-#include <vector>
-
-//class ossimPolyArea2d;
-class ossimImageData;
-
-class OSSIMDLLEXPORT ossimPolyCutter : public ossimImageSourceFilter
-{
-public:
-   enum ossimPolyCutterCutType
-   {
-      OSSIM_POLY_NULL_INSIDE  = 0,
-      OSSIM_POLY_NULL_OUTSIDE = 1
-   };
-   
-   ossimPolyCutter();
-    ossimPolyCutter(ossimImageSource* inputSource,
-                    const ossimPolygon& polygon);
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-
-   virtual void initialize();
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual void setPolygon(const vector<ossimDpt>& polygon,
-                           ossim_uint32 i = 0);
-   
-   virtual void setPolygon(const vector<ossimIpt>& polygon,
-                           ossim_uint32 i = 0);
-   
-   virtual void addPolygon(const vector<ossimIpt>& polygon);
-   virtual void addPolygon(const vector<ossimDpt>& polygon);
-   virtual void addPolygon(const ossimPolygon& polygon);
-   
-   virtual void setNumberOfPolygons(ossim_uint32 count);
-   
-   virtual std::vector<ossimPolygon>& getPolygonList();
-
-   virtual const std::vector<ossimPolygon>& getPolygonList()const;
-   
-   void setCutType(ossimPolyCutterCutType cutType);
-   
-   ossimPolyCutterCutType getCutType()const;
-
-   void clear();
-
-   const ossimIrect& getRectangle() const;
-
-   void setRectangle(const ossimIrect& rect);
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-protected:
-   virtual ~ossimPolyCutter();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   void computeBoundingRect();
-
-   ossimRefPtr<ossimImageData> theTile;
-
-   /*!
-    * Will hold a pre-computed bounding rect of the
-    * polygon data.
-    */
-   ossimIrect theBoundingRect;
-
-   std::vector<ossimPolygon> thePolygonList;
-
-   /*!
-    * theDefault fill will be outside.
-    */
-   ossimPolyCutterCutType theCutType;
-   ossimImageDataHelper theHelper;
-   bool m_boundingOverwrite;
-
-TYPE_DATA  
-};
-#endif /* #ifndef ossimPolyCutter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimQbTileFilesHandler.h b/ossim/include/ossim/imaging/ossimQbTileFilesHandler.h
deleted file mode 100644
index d88ed4d..0000000
--- a/ossim/include/ossim/imaging/ossimQbTileFilesHandler.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Oscar Kramer
-// 
-//**************************************************************************************************
-// $Id: ossimQbTileFilesHandler.h 2669 2011-06-06 12:28:20Z oscar.kramer $
-#ifndef ossimQbTileFilesHandler_HEADER
-#define ossimQbTileFilesHandler_HEADER
-
-#include <ossim/imaging/ossimTiledImageHandler.h>
-
-// Enable this flag to utilize the system of separate overviews for each tile-file
-#define USING_SUB_OVRS 0
-
-//! Image handler used for tiled Quickbird imagery. 
-class OSSIMDLLEXPORT ossimQbTileFilesHandler : public ossimTiledImageHandler
-{
-public:
-   //!  Constructor (default):
-   ossimQbTileFilesHandler();
-   
-   //! Destructor:
-   virtual ~ossimQbTileFilesHandler();
-   
-   //! @return Returns true on success, false on error.
-   //! @note This method relies on the data member ossimImageData::theImageFile being set.  
-   virtual bool open();
-
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
-protected:
-
-   //! Initializes tile image rects by considering adjacent row/col offsets. Called when TIL
-   //! doesn't contain the info. Returns true if successful.
-   bool computeImageRects();
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimQbTileFilesHandler_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimQuickbirdNitfTileSource.h b/ossim/include/ossim/imaging/ossimQuickbirdNitfTileSource.h
deleted file mode 100644
index 9e3ace9..0000000
--- a/ossim/include/ossim/imaging/ossimQuickbirdNitfTileSource.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts (gpotts at imagelinks.com)
-//
-// Description:
-//
-//*******************************************************************
-//  $Id: ossimQuickbirdNitfTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimQuickbirdNitfTileSource_HEADER
-#define ossimQuickbirdNitfTileSource_HEADER
-#include <ossim/imaging/ossimNitfTileSource.h>
-#include <ossim/base/ossim2dTo2dTransform.h>
-
-class ossimQuickbirdNitfTileSource : public ossimNitfTileSource
-{
-public:
-   virtual bool open();
-
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-protected:
-   ossimRefPtr<ossim2dTo2dTransform> m_transform;
-TYPE_DATA   
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimQuickbirdTiffTileSource.h b/ossim/include/ossim/imaging/ossimQuickbirdTiffTileSource.h
deleted file mode 100644
index 25a178d..0000000
--- a/ossim/include/ossim/imaging/ossimQuickbirdTiffTileSource.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-// 
-// Copied from ossimQuickbirdNitfTileSource written by Garrett Potts.
-//
-// Description:
-//
-// Class declaration for specialized image handler to pick up offsets from
-// Quick Bird ".TIL" files.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimQuickbirdTiffTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimQuickbirdTiffTileSource_HEADER
-#define ossimQuickbirdTiffTileSource_HEADER
-
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/base/ossim2dTo2dShiftTransform.h>
-
-class OSSIM_DLL ossimQuickbirdTiffTileSource : public ossimTiffTileSource
-{
-public:
-   virtual bool open();
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   
-protected:
-   ossimFilename m_tileInfoFilename;
-   
-TYPE_DATA   
-};
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimRLevelFilter.h b/ossim/include/ossim/imaging/ossimRLevelFilter.h
deleted file mode 100644
index b5a43b7..0000000
--- a/ossim/include/ossim/imaging/ossimRLevelFilter.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRLevelFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRLevelFilter_HEADER
-#define ossimRLevelFilter_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/*!
- * This filter is used to adjust the RLevel.  If you would like to
- * continually change between RLevels or Reslolutions then you can use this
- * filter to do so.  You can also specify whether or not the rLevel
- * passed in from the getTile request is added to this classes current
- * Rlevel.  This is so if you concatenate multiple filters that reduce
- * the RLevels then it will keep reducing.  For example if I have
- * 2 filters that both go to RLevel 1 then it actually will go to
- * 2 since there are 2 decimations happening.  This can be turned off
- * by specifying the Rlevel not to be additive.
- */
-class OSSIMDLLEXPORT ossimRLevelFilter : public ossimImageSourceFilter
-{
-public:
-
-   /** @brief default constructor */
-   ossimRLevelFilter();
-
-
-   virtual void getDecimationFactor(ossim_uint32 resLevel,
-                                    ossimDpt& result)const;
-
-   //! Returns a pointer reference to the active image geometry at this filter. The input source
-   //! geometry is modified, so we need to maintain our own geometry object as a data member.
-   ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   virtual void setCurrentRLevel(ossim_uint32 rlevel);
-
-   virtual ossim_uint32 getCurrentRLevel()const;
-
-   /*!
-    * Get/set of the data member "theOverrideGeometryFlag".
-    * If set this will override the "getImageGeometry" method and adjust
-    * the getMetersPerPixel or the getDecimalDegreesPerPixel.
-    * Default behavior is to not override method.
-    */
-   virtual bool getOverrideGeometryFlag() const;
-   virtual void setOverrideGeometryFlag(bool override);
-
-   /**
-    * @brief Returns the bounding rectangle.
-    *
-    * @param resLevel This argument is only passed onto the input connection
-    * if this filter is disabled.  @see disableSource().
-    *
-    * To get the bounding rectangle of an rlevel when source is enabled do:
-    * myRLevelFilter->setCurrentRLevel(level);
-    * myRLevelFilter->getBoundingRect();
-    *
-    * @return Rectangle of the current rlevel if enabled; else, the rectangle
-    * of the input connection for resLevel.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-protected:
-   /** @brief virtual destructor. */
-   virtual ~ossimRLevelFilter();
-   
-   /*!
-    * Initializes result with the sum of decimations from rlevel one to
-    * theCurrentRLevel.
-    */
-   void getSummedDecimation(ossimDpt& result) const;
-   
-   //! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
-   //! a scale change so that the geometry's projection is modified accordingly.
-   void updateGeometry();
-
-   ossim_uint32 theCurrentRLevel;
-   bool         theOverrideGeometryFlag;
-   ossimRefPtr<ossimImageGeometry> m_ScaledGeometry; //!< The input image geometry, altered by the scale
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimRangeDomeTileSource.h b/ossim/include/ossim/imaging/ossimRangeDomeTileSource.h
deleted file mode 100644
index 7963003..0000000
--- a/ossim/include/ossim/imaging/ossimRangeDomeTileSource.h
+++ /dev/null
@@ -1,122 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id: ossimRangeDomeTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimRangeDomeTileSource_HEADER
-#define ossimRangeDomeTileSource_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimGrect.h>
-#include <vector>
-
-class ossimImageData;
-
-struct ossimRangeDome
-{
-   enum Classification
-   {
-      UNASSIGNED = 0,
-      FRIENDLY_UNSPECIFIED = 1,
-      FRIENDLY_LEVEL_1= 2,
-      FRIENDLY_LEVEL_2 = 3,
-      FRIENDLY_LEVEL_3 = 4,
-      THREAT_UNSPECIFIED = 101,
-      THREAT_LEVEL_1 = 102,
-      THREAT_LEVEL_2 = 103,
-      THREAT_LEVEL_3 = 104
-   };
-
-   ossimRangeDome(std::vector<ossimString>& tokens);
-   ossimGrect boundingRect() const;
-
-   bool valid;
-   ossim_uint32 id;
-   ossimGpt centerGpt;
-   ossimDpt centerIpt;
-   double radiusMeters;
-   ossim_uint32 radiusPixelsSq;
-   Classification classification;
-   double startAz;
-   double endAz;
-   ossimString description;
-};
-
-
-/**
- * Class used for rendering range domes (a.k.a. "threat domes") as 2-D ortho-images.
- *
- * This base class has the rudimentary capability of reading range dome specifications as a CSV file
- * in the following format (one line per dome object):
- *
- *    id, lat, lon, hgt, R, C [,Az0, Az1] [, description]
- *
- * where
- *
- *    id -- integer ID of data object
- *    lat, lon, hgt -- Location of center of dome (actually sphere) in WGS84
- *    R -- radius (in meters) of dome boundary
- *    C -- classification id (unsigned 8-bit) corresponding to area inside r
- *    Az0, Az1 -- [optional] starting and ending azimuth (clockwise from Az0 in degrees). If both
- *         Az0 and Az1 are equal, then 360 deg is implied.
- *    description -- [optional] string
- */
-class OSSIMDLLEXPORT ossimRangeDomeTileSource : public ossimImageHandler
-{
-public:
-   ossimRangeDomeTileSource();
-   virtual ~ossimRangeDomeTileSource();
-
-   /**  @brief Reads CSV file representing range domes.  */
-   virtual bool open();
-
-   virtual bool isOpen() const;
-
-   virtual void close();
-
-   virtual void initialize();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect, ossim_uint32 resLevel=0);
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-
-   virtual ossim_uint32    getNumberOfInputBands() const;
-   virtual ossim_uint32    getNumberOfLines(ossim_uint32 resLevel = 0) const;
-   virtual ossim_uint32    getNumberOfSamples(ossim_uint32 resLevel = 0) const;
-   virtual ossim_uint32    getImageTileWidth() const { return 0; }
-   virtual ossim_uint32    getImageTileHeight() const { return 0; }
-   virtual ossimScalarType getOutputScalarType() const { return OSSIM_UINT8; }
-
-
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry() { return theGeometry; }
-
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /**
-    * The reader properties are:
-    * -- the GSD ("meters_per_pixel")
-    */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
-
-   virtual void getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const;
-   virtual void setGSD( const ossim_float64& gsd );
-
-   ossim_uint32 getNumRangeDomes() const { return m_rangeDomes.size(); }
-
-protected:
-   std::vector<ossimRangeDome>       m_rangeDomes;
-   ossimDpt                     m_gsd;
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimReadmeFileWriter.h b/ossim/include/ossim/imaging/ossimReadmeFileWriter.h
deleted file mode 100644
index e6d8bcc..0000000
--- a/ossim/include/ossim/imaging/ossimReadmeFileWriter.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2003 Storage Area Networks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kenneth Melero (kmelero at sanz.com)
-//
-//*******************************************************************
-//  $Id: ossimReadmeFileWriter.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimReadmeFileWriter_H
-#define ossimReadmeFileWriter_H
-
-#include <fstream>
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-
-/** ossimReadmeFileWriter */
-class OSSIMDLLEXPORT ossimReadmeFileWriter : public ossimMetadataFileWriter
-{
-public:
-
-   /** default constructor */
-   ossimReadmeFileWriter();
-
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * Appends the writers image types to the "metadatatypeList".
-    * 
-    * @param metadatatypeList stl::vector<ossimString> list to append to.
-    *
-    * @note Appends to the list, does not clear it first.
-    */
-   virtual void getMetadatatypeList(
-      std::vector<ossimString>& metadatatypeList) const;
-
-   /**
-    * Satisfies pure virtual from ossimMetadataWriter base.
-    *
-    * @param imageType string representing image type.
-    *
-    * @return true if "metadataType" is supported by writer.
-    */
-   virtual bool hasMetadataType(const ossimString& metadataType)const;
-   
-protected:
-   /** virtual destructor */
-   virtual ~ossimReadmeFileWriter();
-   virtual bool writeFile();
-   
-TYPE_DATA
-};
-
-#endif /* End of #ifndef ossimReadmeFileWriter_H */
-
diff --git a/ossim/include/ossim/imaging/ossimRectangleCutFilter.h b/ossim/include/ossim/imaging/ossimRectangleCutFilter.h
deleted file mode 100644
index 93a0b3f..0000000
--- a/ossim/include/ossim/imaging/ossimRectangleCutFilter.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRectangleCutFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRectangleCutFilter_HEADER
-#define ossimRectangleCutFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIM_DLL ossimRectangleCutFilter : public ossimImageSourceFilter
-{
-public:
-   enum ossimRectangleCutType
-   {
-      OSSIM_RECTANGLE_NULL_INSIDE  = 0,
-      OSSIM_RECTANGLE_NULL_OUTSIDE = 1
-   };
-
-   ossimRectangleCutFilter(ossimObject* owner,
-                     ossimImageSource* inputSource=NULL);
-   ossimRectangleCutFilter(ossimImageSource* inputSource=NULL);
-
-   void setRectangle(const ossimIrect& rect);
-
-   const ossimIrect&     getRectangle()const;
-   ossimRectangleCutType getCutType()const;
-   void                  setCutType(ossimRectangleCutType cutType);
-   
-   ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0)const;
-
-   ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                       ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-   
-protected:
-   ossimIrect            theRectangle;
-   ossimRectangleCutType theCutType;
-   vector<ossimDpt>      theDecimationList;
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimRectangleCutFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimRgbGridRemapEngine.h b/ossim/include/ossim/imaging/ossimRgbGridRemapEngine.h
deleted file mode 100644
index 8f2e590..0000000
--- a/ossim/include/ossim/imaging/ossimRgbGridRemapEngine.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//*****************************************************************************
-// FILE: ossimRgbGridRemapEngine.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimRgbGridRemapEngine
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimRgbGridRemapEngine.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimRgbGridRemapEngine_HEADER
-#define ossimRgbGridRemapEngine_HEADER
-
-#include <ossim/imaging/ossimGridRemapEngine.h>
-
-/*!****************************************************************************
- *
- * CLASS: ossimRgbGridRemapEngine 
- *
- *****************************************************************************/
-class ossimRgbGridRemapEngine : public ossimGridRemapEngine
-{
-public:
-   ossimRgbGridRemapEngine()
-      : ossimGridRemapEngine(3, 3) {}
-   
-   virtual ossimObject* dup() const;
-   
-   virtual void remapTile(const ossimDpt& origin_point,
-                          ossimGridRemapSource* remapper,
-                          ossimRefPtr<ossimImageData>& tile);
-
-   virtual void assignRemapValues(std::vector<ossimAtbPointSource*>& sources);
-
-   virtual void computeSourceValue(ossimRefPtr<ossimImageData>& source,
-                                   void* result);
-
-protected:
-   virtual void computeRemapNode(ossimAtbPointSource*  point_source,
-                                 void*                 source_value,
-                                 void*                 target_value);
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimRgbToGreyFilter.h b/ossim/include/ossim/imaging/ossimRgbToGreyFilter.h
deleted file mode 100644
index ac51093..0000000
--- a/ossim/include/ossim/imaging/ossimRgbToGreyFilter.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToGreyFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRgbToGreyFilter_HEADER
-#define ossimRgbToGreyFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIMDLLEXPORT ossimRgbToGreyFilter : public ossimImageSourceFilter
-{
-public:
-   ossimRgbToGreyFilter(ossimObject* owner=NULL);
-   ossimRgbToGreyFilter(ossimImageSource* inputSource,
-                        double c1 = 1.0/3.0,
-                        double c2 = 1.0/3.0,
-                        double c3 = 1.0/3.0);
-   ossimRgbToGreyFilter(ossimObject* owner,
-                        ossimImageSource* inputSource,
-                        double c1 = 1.0/3.0,
-                        double c2 = 1.0/3.0,
-                        double c3 = 1.0/3.0);
-   
-   virtual ossimString getShortName()const;
-   virtual ossimString getLongName()const;
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual void initialize();
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   
-   ossim_uint32 getNumberOfOutputBands() const;
- 
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-protected:
-   virtual ~ossimRgbToGreyFilter();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theBlankTile;
-   ossimRefPtr<ossimImageData> theTile;
-   void runUcharTransformation(ossimRefPtr<ossimImageData>& tile);
-   double theC1;
-   double theC2;
-   double theC3;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimRgbToGreyFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimRgbToHsiSource.h b/ossim/include/ossim/imaging/ossimRgbToHsiSource.h
deleted file mode 100644
index c298d54..0000000
--- a/ossim/include/ossim/imaging/ossimRgbToHsiSource.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToHsiSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRgbToHsiSource_HEADER
-#define ossimRgbToHsiSource_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimRgbToHsiSource : public ossimImageSourceFilter
-{
-public:
-   ossimRgbToHsiSource();
-   ossimRgbToHsiSource(ossimImageSource* inputSource);
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual ossim_uint32    getNumberOfOutputBands()const;
-   virtual double          getNullPixelValue()const;
-   virtual double          getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double          getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual void initialize();
-
-protected:
-   virtual ~ossimRgbToHsiSource();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theBlankTile;
-   ossimRefPtr<ossimImageData> theTile;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimRgbToHsiSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimRgbToHsvSource.h b/ossim/include/ossim/imaging/ossimRgbToHsvSource.h
deleted file mode 100644
index 021243f..0000000
--- a/ossim/include/ossim/imaging/ossimRgbToHsvSource.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToHsvSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRgbToHsvSource_HEADER
-#define ossimRgbToHsvSource_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimRgbToHsvSource : public ossimImageSourceFilter
-{
-public:
-   ossimRgbToHsvSource();
-   ossimRgbToHsvSource(ossimImageSource* inputSource);
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual ossim_uint32    getNumberOfOutputBands()const;
-   virtual double getNullPixelValue()const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual void initialize();
-       
-protected:
-   virtual ~ossimRgbToHsvSource();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-   ossimRefPtr<ossimImageData> theBlankTile;
-   ossimRefPtr<ossimImageData> theTile;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimRgbToIndexFilter.h b/ossim/include/ossim/imaging/ossimRgbToIndexFilter.h
deleted file mode 100644
index 57a651f..0000000
--- a/ossim/include/ossim/imaging/ossimRgbToIndexFilter.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToIndexFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRgbToIndexFilter_HEADER
-#define ossimRgbToIndexFilter_HEADER
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/base/ossimRgbLutDataObject.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <vector>
-
-class ossimImageData;
-
-/*!
- * It will map the input data to an 8-bit index table.  The table
- * <pre>
- *
- * Example keyword list:
- *
- * type:  ossimRgbToIndexFilter
- *
- * If you want to load from a file then just do:
- *
- * lut.filename: <full path to lut file>
- *
- * If you have the lut table in line then it must look like this:
- *
- * lut.entry0:  204 102 1
- * lut.entry1:  255 204 153
- * lut.entry2:  51 204 204
- * lut.number_of_entries:  3
- * lut.type:  ossimRgbLutDataObject
- *
- * </pre>
- */
-class ossimRgbToIndexFilter : public ossimImageSourceFilter
-{
-public:
-   /*!
-    * Initializes the min value to 0 and the max value to 4000.
-    */
-   ossimRgbToIndexFilter();
-   ossimRgbToIndexFilter(ossimImageSource* inputSource,
-                           const ossimRgbLutDataObject& rgbLut);
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& origin,
-                                               ossim_uint32 resLevel=0);
-   
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-   
-   virtual ossimScalarType getOutputScalarType() const;
-   
-   void setLut(ossimRgbLutDataObject& lut);
-
-   void setLut(const ossimFilename& file);
-
-   virtual void disableSource();
-   
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-   
-   virtual void initialize();
-
-   /*!
-    * Saves the state of this object.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   /*!
-    * Loads the state of this object.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-protected:
-   virtual ~ossimRgbToIndexFilter();
-   void allocate();
-   
-   virtual ossimRefPtr<ossimImageData> convertInputTile(ossimRefPtr<ossimImageData>& tile);
-
-   ossimRefPtr<ossimRgbLutDataObject>       theLut;
-   ossimRefPtr<ossimImageData> theTile;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimRgbToJpegYCbCrSource.h b/ossim/include/ossim/imaging/ossimRgbToJpegYCbCrSource.h
deleted file mode 100644
index de498d6..0000000
--- a/ossim/include/ossim/imaging/ossimRgbToJpegYCbCrSource.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToJpegYCbCrSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRgbToJpegYCbCrSource_HEADER
-#define ossimRgbToJpegYCbCrSource_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class ossimRgbToJpegYCbCrSource : public ossimImageSourceFilter
-{
-public:
-   
-   ossimRgbToJpegYCbCrSource();
-   ossimRgbToJpegYCbCrSource(ossimImageSource* inputSource);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-       
-protected:
-   virtual ~ossimRgbToJpegYCbCrSource();
-   ossimRefPtr<ossimImageData> theBlankTile;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimS16ImageData.h b/ossim/include/ossim/imaging/ossimS16ImageData.h
deleted file mode 100644
index 29baaf0..0000000
--- a/ossim/include/ossim/imaging/ossimS16ImageData.h
+++ /dev/null
@@ -1,185 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Class declaration of ossimS16ImageData.  Specialized image data object for
-// signed short data.
-//
-//*************************************************************************
-// $Id: ossimS16ImageData.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimS16ImageData_HEADER
-#define ossimS16ImageData_HEADER
-
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimNormalizedS16RemapTable.h>
-
-class OSSIMDLLEXPORT ossimS16ImageData : public ossimImageData
-{
-public:
-   ossimS16ImageData(ossimSource* source,
-                     ossim_uint32 bands = 1);
-
-   ossimS16ImageData(ossimSource* source,
-                    ossim_uint32 bands,
-                    ossim_uint32 width,
-                    ossim_uint32 height);
-
-   ossimS16ImageData(const ossimS16ImageData &rhs);
-   
-
-   /*!
-    * Perform object duplication.
-    */
-   virtual ossimObject* dup()const;
-
-   /*!
-    * will fill the entire band with
-    * the value.
-    */
-   void fill(ossim_uint32 band, double value);
-
-
-   bool isNull(ossim_uint32 offset)const;
-   void setNull(ossim_uint32 offset);
-
-   virtual ossimDataObjectStatus validate() const;
-
-   /*!
-    * will go to the band and offset and compute the
-    * normalized float and return it back to the
-    * caller through the result argument.
-    */
-   virtual void getNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float& result)const;
-
-   /*!
-    * This will assign to this object a normalized
-    * value by unnormalizing to its native type.
-    */
-   virtual void setNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float input);
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedFloat(ossimImageData* result)const;
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedDouble(ossimImageData* result)const;
-
-   /*!
-    * Will take the normalized input and convert it
-    * to this tile's data type.  Example:  if this
-    * tile is of type UCHAR and its input is of type
-    * NORALIZED_FLOAT it will unnormalize the data by
-    * doing:
-    *
-    * minPix + normalizedInput*(maxPix-minPix)
-    *
-    * on a per band basis.
-    */
-   virtual void unnormalizeInput(ossimImageData* normalizedInput);
-
-   /*!
-    * This will compute the average value for the band.
-    */
-   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
-
-   /*!
-    * This will call the compute average band value and then
-    * use that in the calculation of:
-    
-    * It will then do a SUM[(Mean - Actual)^2]/width*height.
-    *
-    * This is the average variance from the passed in
-    * mean.  Basically think of the mean as a completely
-    * grey image and we would like to see how this
-    * image varies from the passed in mean.
-    */
-   virtual double computeMeanSquaredError(double meanValue,
-                                          ossim_uint32 bandNumber = 0);
-  
-   virtual void setValue(ossim_int32 x, ossim_int32 y, double color);
-
-   /*!
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(double* buf) const;
-   
-   /*!
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(double* buf);
-
-   /*!
-    * Will copy this tiles specified band number to the normalized buffer.
-    * if the band is out of range then nothing is done and returns.
-    */
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, double* buf) const;
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, float* buf)const;
-   
-   /*!
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(float* buf) const;
-   
-   /*!
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(float* buf);
-   
-   /*!
-    * Will copy the normalized buffer to this tiles
-    * specified band.  If band is out of range then nothing
-    * is done and returns.
-    */
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           double* buf);
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           float* buf);
-
-   /** @return The first non-null index of the normalized remap table. */
-   virtual ossim_float64 getMinNormalizedPix() const;
-   
-protected:
-   virtual ~ossimS16ImageData();
-   ossimS16ImageData();
-
-private:
-
-   static const ossimNormalizedS16RemapTable m_remapTable;
-
-TYPE_DATA
-};
-
-inline ossim_float64 ossimS16ImageData::getMinNormalizedPix() const
-{
-   return m_remapTable[1];
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimSFIMFusion.h b/ossim/include/ossim/imaging/ossimSFIMFusion.h
deleted file mode 100644
index 50c1ac4..0000000
--- a/ossim/include/ossim/imaging/ossimSFIMFusion.h
+++ /dev/null
@@ -1,86 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// LICENSE:  See top level LICENSE.txt
-// 
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimSFIMFusion.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimSFIMFusion_HEADER
-#define ossimSFIMFusion_HEADER
-#include <ossim/imaging/ossimFusionCombiner.h>
-#include <ossim/imaging/ossimConvolutionSource.h>
-#include <ossim/imaging/ossimImageGaussianFilter.h>
-#include <ossim/base/ossimAdjustableParameterInterface.h>
-
-/**
- * This class imlements the fusion algorithm from the paper:
- *
- * "Smoothing Filter-based Intesity Modulation: a spectral preserve
- *  image fusion technique for improving spatial details"
- *
- *  Pulished in INT. J. Remote Sensing, 2000, Vol. 21 NO. 18, 3461-3472
- *
- *  By J. G. LIU
- *
- *
- * Auther: Garrett Potts
- * LICENSE: MIT
- */
-class OSSIM_DLL ossimSFIMFusion : public ossimFusionCombiner,
-                                  public ossimAdjustableParameterInterface
-{
-public:
-   ossimSFIMFusion();
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-   virtual void initialize();
-
-   virtual ossimObject* getBaseObject()
-   {
-      return this;
-   }
-   virtual const ossimObject* getBaseObject()const
-   {
-      return this;
-   }
-   virtual void initAdjustableParameters();
-   virtual void adjustableParametersChanged();
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-protected:
-   virtual ~ossimSFIMFusion();
-   void setFilters();
-   bool computeRegression(ossim_float64& slopeResult,
-                          const ossimIpt& origin,
-                          ossimRefPtr<ossimImageData> panData,
-                          ossimRefPtr<ossimImageData> colorData,
-                          ossim_uint32 colorBandIdx);
-   
-   ossim_float64 theLowPassKernelWidth;
-   ossim_uint32 theHighPassKernelWidth;
-   // These are low and high pass filters for the single pan band
-   //
-   ossimRefPtr<ossimImageGaussianFilter> theLowPassFilter;
-   ossimRefPtr<ossimConvolutionSource>   theHighPassFilter;
-   ossimRefPtr<ossimImageData>           theNormLowPassTile;
-   ossimRefPtr<ossimImageData>           theNormHighPassTile;
-   ossimRefPtr<ossimImageData>           theNormColorData;
-
-   NEWMAT::Matrix                        theHighPassMatrix;
-   bool                                  theAutoAdjustScales;
-
-TYPE_DATA   
-};
-
-#endif
diff --git a/ossim/include/ossim/imaging/ossimScalarRemapper.h b/ossim/include/ossim/imaging/ossimScalarRemapper.h
deleted file mode 100644
index f03f9fa..0000000
--- a/ossim/include/ossim/imaging/ossimScalarRemapper.h
+++ /dev/null
@@ -1,107 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declartion for ossimScalarRemapper.
-// This class is used to remap image data from one scalar type to another.
-//
-//*******************************************************************
-//  $Id: ossimScalarRemapper.h 15766 2009-10-20 12:37:09Z gpotts $
-#ifndef ossimScalarRemapper_HEADER
-#define ossimScalarRemapper_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIMDLLEXPORT ossimScalarRemapper : public ossimImageSourceFilter
-{
-public:
-   ossimScalarRemapper();
-   ossimScalarRemapper(ossimImageSource* inputSource,
-                       ossimScalarType outputScalarType);
-
-   virtual void initialize();
-
-   virtual ossimString getLongName()  const;
-   virtual ossimString getShortName() const;
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    *  Returns the output pixel type of the tile source.  This override the
-    *  base class since it simply returns it's input scalar type which is
-    *  not correct with this object.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    *  Returns the output pixel type of the tile source as a string.
-    */
-   virtual ossimString getOutputScalarTypeString() const;
-   
-   /**
-    *  Sets the output scalar type.
-    */
-   virtual void setOutputScalarType(ossimScalarType scalarType);
-   virtual void setOutputScalarType(ossimString scalarType);
-     
-   /**
-    *  Sets the current resolution level.  Returns true on success, false
-    *  on error.
-    */
-   virtual double getNullPixelValue(ossim_uint32 band)  const;
-   virtual double getMinPixelValue(ossim_uint32 band=0) const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0) const;
-
-   /**
-    *  Method to save the state of an object to a keyword list.
-    *  Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-
-   /**
-    *   Override base class so that a disableSource event does not
-    *   reinitialize the object and enable itself.
-    */
-   virtual void propertyEvent(ossimPropertyEvent& event);
-   virtual void refreshEvent(ossimRefreshEvent& event);   
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-protected:
-   virtual ~ossimScalarRemapper();
-
-   /**
-    *  Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-
-   /**
-    *  Deletes allocated memory.  Used by both allocate and destructor.
-    */
-   void destroy();
-   
-   double*                     theNormBuf;
-   ossimRefPtr<ossimImageData> theTile;
-   ossimScalarType             theOutputScalarType;
-
-   bool                        theByPassFlag;
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimScalarRemapper_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimScaleFilter.h b/ossim/include/ossim/imaging/ossimScaleFilter.h
deleted file mode 100644
index e7dbf2f..0000000
--- a/ossim/include/ossim/imaging/ossimScaleFilter.h
+++ /dev/null
@@ -1,185 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimScaleFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimScaleFilter_HEADER
-#define ossimScaleFilter_HEADER
-#include <vector>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/matrix/newmat.h>
-#include <ossim/matrix/newmatio.h>
-#include <ossim/imaging/ossimFilter.h>
-
-/*!
- */
-class OSSIM_DLL ossimScaleFilter : public ossimImageSourceFilter
-{
-public:
-   enum ossimScaleFilterType
-   {
-      ossimScaleFilter_NEAREST_NEIGHBOR = 0,
-      ossimScaleFilter_BOX              = 1,
-      ossimScaleFilter_GAUSSIAN         = 2,
-      ossimScaleFilter_CUBIC            = 3,
-      ossimScaleFilter_HANNING          = 4,
-      ossimScaleFilter_HAMMING          = 5,
-      ossimScaleFilter_LANCZOS          = 6,
-      ossimScaleFilter_MITCHELL         = 7,
-      ossimScaleFilter_CATROM           = 8,
-      ossimScaleFilter_BLACKMAN         = 9,
-      ossimScaleFilter_BLACKMAN_SINC    = 10,
-      ossimScaleFilter_BLACKMAN_BESSEL  = 11,
-      ossimScaleFilter_QUADRATIC        = 12,
-      ossimScaleFilter_TRIANGLE         = 13,
-      ossimScaleFilter_HERMITE          = 14
-   };
-   
-   ossimScaleFilter();
-   ossimScaleFilter(ossimImageSource* inputSource,
-                    const ossimDpt& scaleFactor);
-   
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                   ossim_uint32 resLevel=0);
-   
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-   virtual void initialize();
-   virtual void getDecimationFactor(ossim_uint32 resLevel,
-                                    ossimDpt& result)const
-      {
-         result.makeNan();
-
-         if(resLevel == 0)
-         {
-            result.x = 1.0;
-            result.y = 1.0;
-         }
-      }
-   virtual void getDecimationFactors(vector<ossimDpt>& decimations)const
-      {
-         decimations.push_back(ossimDpt(1.0, 1.0));
-      }
-   virtual ossim_uint32 getNumberOfDecimationLevels()const
-      {
-         // only full res output since we are scaling
-         //
-         return 1;
-      }
-   void setFilterType(ossimScaleFilterType filterType);
-   void setFilterType(ossimScaleFilterType minifyFilterType,
-                      ossimScaleFilterType magnifyFilterType);
-   
-   void setFilterType(const ossimString& minifyType,
-                      const ossimString& magnifyType)
-      {
-         setFilterType(getFilterType(minifyType),
-                       getFilterType(magnifyType));
-      }
-   void setMinifyFilterType(const ossimString& minifyType)
-      {
-         setMinifyFilterType(getFilterType(minifyType));
-      }
-   void setMagnifyFilterType(const ossimString& magnifyType)
-      {
-         setMagnifyFilterType(getFilterType(magnifyType));
-      }
-   void setMinifyFilterType(ossimScaleFilterType filterType)
-      {
-         setFilterType(filterType,
-                       m_MagnifyFilterType);
-      }
-   void setMagnifyFilterType(ossimScaleFilterType filterType)
-      {
-         setFilterType(m_MinifyFilterType,filterType);
-      }
-   ossimString getMinifyFilterTypeAsString()const
-      {
-         return getFilterTypeAsString(m_MinifyFilterType);
-      }
-   ossimString getMagnifyFilterTypeAsString()const
-      {
-         return getFilterTypeAsString(m_MagnifyFilterType);
-      }
-   void setScaleFactor(const ossimDpt& scale);
-   void setBlurFactor(ossim_float64 blur)
-      {
-         m_BlurFactor = blur;
-      }
-   ossim_float64 getBlurFactor()const
-      {
-         return m_BlurFactor;
-      }
-   const ossimDpt& getScaleFactor()const
-      {
-         return m_ScaleFactor;
-      }
-   /*!
-    * Saves the state of this object.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   /*!
-    * Loads the state of this object.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-   
-protected:
-   virtual ~ossimScaleFilter();
-  void allocate();
-
-   //! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
-   //! a scale change so that the geometry's projection is modified accordingly.
-   void updateGeometry();
-   
-   ossimRefPtr<ossimImageData> m_BlankTile;
-   ossimRefPtr<ossimImageData> m_Tile;
-   ossimFilter*                m_MinifyFilter;
-   ossimFilter*                m_MagnifyFilter;
-   ossimScaleFilterType        m_MinifyFilterType;
-   ossimScaleFilterType        m_MagnifyFilterType;
-   ossimDpt                    m_ScaleFactor;
-   ossimDpt                    m_InverseScaleFactor;
-   ossimIpt                    m_TileSize;
-   ossimIrect                  m_InputRect;
-   ossim_float64               m_BlurFactor;
-   ossimRefPtr<ossimImageGeometry> m_ScaledGeometry; //!< The input image geometry, altered by the scale
-
-   template <class T>
-   void runFilterTemplate(T dummy,
-                          const ossimIrect& imageRect,
-                          const ossimIrect& viewRect);
-   template <class T>
-   void runHorizontalFilterTemplate(T dummy,
-                                    const ossimRefPtr<ossimImageData>& input,
-                                    ossimRefPtr<ossimImageData>& output);
-   template <class T>
-   void runVerticalFilterTemplate(T dummy,
-                                  const ossimRefPtr<ossimImageData>& input,
-                                  ossimRefPtr<ossimImageData>& output);
-    void runFilter(const ossimIrect& imageRect,
-                   const ossimIrect& viewRect);
-
-   void getSupport(double& x, double& y);
-   const ossimFilter* getHorizontalFilter()const;
-   const ossimFilter* getVerticalFilter()const;
-   
-   ossimString getFilterTypeAsString(ossimScaleFilterType type)const;
-   ossimScaleFilterType getFilterType(const ossimString& type)const;
-   
-   ossimIrect scaleRect(const ossimIrect input,
-                        const ossimDpt& scaleFactor)const;
-   ossimFilter* createNewFilter(ossimScaleFilterType filterType,
-                                ossimScaleFilterType& result);
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimShiftFilter.h b/ossim/include/ossim/imaging/ossimShiftFilter.h
deleted file mode 100644
index a44ef05..0000000
--- a/ossim/include/ossim/imaging/ossimShiftFilter.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Filter for shifting input to an output range.  See class description
-// below for more.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimShiftFilter_HEADER
-#define ossimShiftFilter_HEADER 1
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimImageData.h>
-
-/**
- * @class ossimShiftFilter
- *
- * Class to shift/stretch input values to given min/max.  Callers must set
- * the min, max, null output values.  Input data shifted stretch base on:
- *
- * pix = outMin + (inPix - inMin) * (outMax-outMin)/(inMax-inMin)
- *
- * See ossim-shift-filter-test.cpp for concrete example of usage.
- */
-class OSSIMDLLEXPORT ossimShiftFilter : public ossimImageSourceFilter
-{
-public:
-
-   /** default constructor */
-   ossimShiftFilter();
-
-   virtual void initialize();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   /** @return "ossimShiftFilter" */
-   virtual ossimString getClassName() const;
-
-   /** @return "OSSIM shift filter" */
-   virtual ossimString getLongName()  const;
-
-   /** @return "shift filter" */
-   virtual ossimString getShortName() const;
-
-   
-   /** @return The null pixel of the band. */
-   virtual double getNullPixelValue(ossim_uint32 band)const;
-
-   /** @return The min pixel of the band. */
-   virtual double getMinPixelValue(ossim_uint32 band)const;
-   
-   /** @return The max pixel of the band. */
-   virtual double getMaxPixelValue(ossim_uint32 band)const;
-
-   /** @brief Set the null output pixel. */
-   void setNullPixelValue(double null);
-
-   /** @brief Set the min output pixel. */
-   void setMinPixelValue(double min);
-
-   /** @brief Set the max output pixel. */
-   void setMaxPixelValue(double max);
-
-protected:
-
-   /** virtual protected destructor */
-   virtual ~ossimShiftFilter();
-
-private:
-   
-   /** @brief Private to disallow use... */
-   ossimShiftFilter(const ossimShiftFilter&);
-
-   /** @brief Private to disallow use... */
-   ossimShiftFilter& operator=(const ossimShiftFilter&);
-
-   /** @brief Allocates the tile.  Called on first getTile. */
-   void allocate();
-
-   /**
-    * @brief Template to fill the tile.
-    * @param dummy template type.
-    * @param inputTile
-    * @param outputTile
-    */
-   template <class T> void fillTile(T dummy,
-                                    const ossimImageData* inputTile,
-                                    ossimImageData* outputTile) const;
-   
-   ossimRefPtr<ossimImageData> m_tile;
-   double m_min;
-   double m_max;
-   double m_null;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimShiftFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimSingleImageChain.h b/ossim/include/ossim/imaging/ossimSingleImageChain.h
deleted file mode 100644
index 2d61125..0000000
--- a/ossim/include/ossim/imaging/ossimSingleImageChain.h
+++ /dev/null
@@ -1,557 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Utility class declaration for a single image chain.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimSingleImageChain_HEADER
-#define ossimSingleImageChain_HEADER 1
-
-#include <ossim/base/ossimConstants.h> /* OSSIM_DLL */
-#include <ossim/imaging/ossimBandSelector.h>
-#include <ossim/imaging/ossimBrightnessContrastSource.h>
-#include <ossim/imaging/ossimCacheTileSource.h>
-#include <ossim/imaging/ossimGeoPolyCutter.h>
-#include <ossim/imaging/ossimHistogramRemapper.h>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimImageSharpenFilter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <vector>
-
-// Forward class declarations:
-class ossimFilename;
-class ossimGeoPolygon;
-class ossimSrcRecord;
-
-/**
- * @class ossimSingleImageChain
- * 
- * @brief Single image chain class.
- *
- * Convenience class for a single image chain.
- * 
- * For code example see: ossim/src/test/ossim-single-image-chain-test.cpp  
- *
- * Just a clarification on "start of chain" versus "end of chain" in this
- * file.
- *
- * Given chain of:
- * 1) image handler
- * 2) band selector (optional)
- * 3) histogram remapper(optional)
- * 4) scalar remapper (optional)
- * 5) resampler cache
- * 6) resampler
- * 7) band selector (optional when going one band to three)
- * 8) chain cache
- *
- * The "image handle" is the "start of chain".
- * The "chain cache" is the "end of chain".
- */
-class OSSIM_DLL ossimSingleImageChain : public ossimImageChain
-{
-public:
-
-   /** default constructor */
-   ossimSingleImageChain();
-
-   /** Constructor that takes flags.*/
-   ossimSingleImageChain(bool addHistogramFlag,
-                         bool addResamplerCacheFlag,
-                         bool addChainCacheFlag,
-                         bool remapToEightBitFlag,
-                         bool threeBandFlag,
-                         bool threeBandReverseFlag,
-                         bool brightnessContrastFlag=false,
-                         bool sharpenFlag=false,
-                         bool geoPolyCutterFlag=false);
-   
-   /** virtual destructor */
-   virtual ~ossimSingleImageChain();
-
-   /**
-    * @brief reset method
-    * This deletes all links in the chain, zero's out all data members, and
-    * sets all flags back to default.
-    */
-   void reset();
-   
-   /**
-    * @brief open method that takes an image file.
-    *
-    * Opens file and creates a simple chain with ossimImageHandler.
-    *
-    * @param file File to open.
-
-    * @param openOverview If true image handler will attempt to open overview.
-    * Note that if you are planning on doing a rendered chain or want to go
-    * between res levels you should set this to true.  default = true
-    *
-    * @return true on success, false on error.
-    *
-    * @note This will close previous chain if one was opened.
-    */
-   bool open(const ossimFilename& file, bool openOverview=true);
-
-   /**
-    * @brief open method that takes an ossimSrcRecord.
-    *
-    * Opens file and creates a simple chain with ossimImageHandler.
-    *
-    * @return true on success, false on error.
-    *
-    * @note This will close previous chain if one was opened.
-    */
-   bool open(const ossimSrcRecord& src);
-   
-   /** @return true if image handler is opened. */
-   bool isOpen() const;
-
-   /** @brief close method to delete the image handler. */
-   void close();
-
-   /** @return The filename of the image. */
-   ossimFilename getFilename() const;
-
-   /**
-    * @brief Create a rendered image chain.
-    *
-    * Typical usage is to call this after "open" method returns true like:
-    * if ( myChain->open(myFile) == true )
-    * {
-    *    myChain->createRenderedChain();
-    *    code-goes-here();
-    * }
-    *
-    * Typical chain is:
-    * 
-    * 1) image handler
-    * 2) band selector (optional)
-    * 3) histogram remapper(optional)
-    * 4) scalar remapper (optional)
-    * 5) resampler cache
-    * 6) resampler
-    * 7) band selector (optional when going one band to three)
-    * 8) chain cache
-    *
-    * NOTES:
-    * 1) Cache on left hand side of resampler is critical to speed if you
-    *    have the ossimImageRender enabled.
-    *    
-    * 2) If doing a sequential write where tiles to the right of the
-    *    resampler will not be revisited the chain cache could be
-    *    disabled to save memory.
-    */
-   void createRenderedChain();
-
-   /**
-    * @brief Create a rendered image chain that takes an ossimSrcRecord.
-    */
-   void createRenderedChain(const ossimSrcRecord& src);
-
-   /**
-    * @brief Adds an image handler for file.
-    * 
-    * @param file File to open.
-    *
-    * @param openOverview If true image handler will attempt to open overview.
-    * Note that if you are planning on doing a rendered chain or want to go
-    * between res levels you should set this to true. default = true
-    *
-    * @return true on success, false on error.
-    */
-   bool addImageHandler(const ossimFilename& file,
-                        bool openOverview=true);
-
-   /**
-    * @brief Adds an image handler from src record.
-    *
-    * This take an ossimSrcRecord which can contain a supplemental directory
-    * to look for overviews.
-    * 
-    * @param rec Record to open.
-    * @return true on success, false on error.
-    */
-   bool addImageHandler(const ossimSrcRecord& src);
-   
-   /** @brief Adds a band selector to the end of the chain. */
-   void addBandSelector();
-
-   /**
-    * @brief Adds a band selector.
-    *
-    * This takes an ossimSrcRecord which can contain a band selection list.
-    * 
-    * @param src Record to initialize band selector from.
-    * 
-    */
-   void addBandSelector(const ossimSrcRecord& src);
-
-   /** @brief Adds histogram remapper to the chain. */
-   void addHistogramRemapper();
-
-   /**
-    * @brief Adds a band selector.
-    *
-    * This takes an ossimSrcRecord which can contain a histogram
-    * operation to be performed.
-    * 
-    * @param src Record to initialize band selector from.
-    */
-   void addHistogramRemapper(const ossimSrcRecord& src);
-
-   /**
-    * @brief Adds a new cache to the current end of the chain.
-    * @return Pointer to cache.
-    */
-   ossimRefPtr<ossimCacheTileSource> addCache();
-
-   /** @brief Adds a resampler to the end of the chain. */ 
-   void addResampler();
-
-   /**
-    * @brief Adds scalar remapper either to the left of the resampler cache
-    * or at the end of the chain if not present.
-    */
-   void addScalarRemapper();
-
-   /**
-    * @brief Adds brightness contrast filter the end of the chain if not
-    * present.
-    */
-   void addBrightnessContrast();
-
-   /**
-    * @brief Adds sharpen filter the end of the chain if not present.
-    */
-   void addSharpen();
-
-
-   /**
-   *
-   * @brief Adds a geo polycutter to allow for cropping imagery or nulling out
-   * regions.  This has no affect on modification of the bounds
-   *
-   */
-   void addGeoPolyCutter();
-
-   void addGeoPolyCutterPolygon(const vector<ossimGpt>& polygon);
-   void addGeoPolyCutterPolygon(const ossimGeoPolygon& polygon);
-
-   /**
-    * @return ossimRefPtr containing the image handler.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimImageHandler> getImageHandler() const;
-
-   /**
-    * @return ossimRefPtr containing the image handler.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimImageHandler> getImageHandler();
-
-   /**
-    * @return ossimRefPtr containing  the band selector.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimBandSelector> getBandSelector() const;
-
-   /**
-    * @return ossimRefPtr containing  the band selector.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimBandSelector> getBandSelector();
-
-   /**
-    * @return ossimRefPtr containing the histogram remapper.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimHistogramRemapper> getHistogramRemapper() const;
-
-   /**
-    * @return ossimRefPtr containing the histogram remapper.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimHistogramRemapper> getHistogramRemapper();
-
-   /**
-    * @return  ossimRefPtr containing the resampler cache.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimCacheTileSource> getResamplerCache() const;
-
-   /**
-    * @return  ossimRefPtr containing the resampler cache.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimCacheTileSource> getResamplerCache();
-
-   /**
-    * @return ossimRefPtr containing the resampler.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimImageRenderer> getImageRenderer() const;
-
-   /**
-    * @return ossimRefPtr containing the resampler.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimImageRenderer> getImageRenderer();
-
-   /**
-    * @return ossimRefPtr containing the scalar remapper.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimScalarRemapper> getScalarRemapper() const;
-
-   /**
-    * @return ossimRefPtr containing the scalar remapper.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimScalarRemapper> getScalarRemapper();
-
-   /**
-    * @return ossimRefPtr containing the brightness contrast filter.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimBrightnessContrastSource>
-      getBrightnessContrast() const;
-
-   /**
-    * @return ossimRefPtr containing the brightness contrast filter.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimBrightnessContrastSource> getBrightnessContrast();
-
-   /**
-    * @return ossimRefPtr containing the sharpen filter.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimImageSharpenFilter> getSharpenFilter() const;
-
-   /**
-    * @return ossimRefPtr containing the sharpen.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimImageSharpenFilter> getSharpenFilter();
-   
-   /**
-    * @return ossimRefPtr containing the chain cache.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<const ossimCacheTileSource> getChainCache() const;
-
-   /**
-    * @return ossimRefPtr containing the chain cache.
-    * @note Can contain a null pointer so callers should validate.
-    */
-   ossimRefPtr<ossimCacheTileSource> getChainCache();
-
-   /**
-    * @brief If flag is true a histogram will be added to the chain at create time.
-    * @param flag
-    */
-   void setAddHistogramFlag(bool flag);
-
-   /**
-    * @brief Gets the add histogram flag.
-    * @return true or false.
-    */
-   bool getAddHistogramFlag() const;
-
-   /**
-    * @brief If flag is true a resampler cache will be added to the chain at create time.
-    * This is a cache to the left of the resampler.
-    * @param flag
-    */
-   void setAddResamplerCacheFlag(bool flag);
-
-   /**
-    * @brief Gets the add resampler cache flag.
-    * @return true or false.
-    */
-   bool getAddResamplerCacheFlag() const;
-
-   /**
-    * @brief If flag is true a chain cache will be added to the chain at create time.
-    * This is a cache at the end of the chain.
-    * @param flag
-    */
-   void setAddChainCacheFlag(bool flag);
-
-   /**
-    * @brief Gets the add chain cache flag.
-    * @return true or false.
-    */
-   bool getAddChainCacheFlag() const;
-
-   /**
-    * @brief Sets remap to eigth bit flag.
-    * @param flag
-    */
-   void setRemapToEightBitFlag(bool flag);
-
-   /**
-    * @brief Get the remap to eight bit flag.
-    * @return true or false.
-    */
-   bool getRemapToEightBitFlag() const;
-   
-   /**
-    * @brief Sets the three band flag.
-    *
-    * If set will for a three band output.  So if one band it will duplicate
-    * so that rgb = b1,b1,b1. An attempt is made to derive rgb bands from the
-    * image handler.
-    * 
-    * @param flag
-    */
-   void setThreeBandFlag(bool flag);
-
-   /**
-    * @brief Get the three band flag.
-    * @return true or false.
-    */
-   bool getThreeBandFlag() const;
-   
-   /**
-    * @brief Sets the three band reverse flag.
-    *
-    * @param flag
-    */
-   void setThreeBandReverseFlag(bool flag);
-
-   /**
-    * @brief Get the three band reverse flag.
-    * @return true or false.
-    */
-   bool getThreeBandReverseFlag() const;
-   
-   /**
-    * @brief Sets the brightness contrast flag.
-    *
-    * @param flag
-    */
-   void setBrightnessContrastFlag(bool flag);
-
-   /**
-    * @brief Get the brightness constrast flag.
-    * @return true or false.
-    */
-   bool getBrightnessContrastFlag() const;
-
-   /**
-    * @brief Sets the sharpenflag.
-    *
-    * @param flag
-    */
-   void setSharpenFlag(bool flag);
-
-   /**
-    * @brief Get the sharpen flag.
-    * @return true or false.
-    */
-   bool getSharpenFlag() const;
-
-   /**
-    * @brief Utility method to force 3 band output.
-    *
-    * Set band selector to a three band (rgb) output. If image has less than
-    * three bands it will set to rgb = b1,b1,b1.  If image has three or
-    * more bands the band selector will be see to rgb = b1, b2, b3.
-    *
-    * @note This will not work unless the image handler is initialized.
-    */
-   void setToThreeBands();
-   
-   /**
-    * @brief Utility method to set to 3 bandsand reverse them.  This is
-    * mainly used by NITF and Lndsat color data where the bands are in bgr
-    * format and you want it in rgb combination.  If image has less than
-    * three bands it will set to rgb = b1,b1,b1.  If image has three or
-    * more bands the band selector will be see to rgb = b3, b2, b1.
-    *
-    * @note This will not work unless the image handler is initialized.
-    */
-   void setToThreeBandsReverse();
-
-   /**
-    * @brief method to set band selector.
-    *
-    * This will set the band selection to bandList.  If a band selector is
-    * not in the chain yet it will be added.
-    *
-    * @param bandList The list of bands.
-    */
-   void setBandSelection(const std::vector<ossim_uint32>& bandList);
-
-   /**
-    * @brief Convenience method to return the scalar type of the image handler.
-    * 
-    * @return Scalar type of the image handler.
-    *
-    * This can return OSSIM_SCALAR_UNKNOWN if the image handler has not been
-    * set yet.  Also, this is NOT the same as calling getOutputScalarType
-    * which could have a different scalar type than the image if the
-    * m_remapToEightBitFlag has been set.
-    */
-   ossimScalarType getImageHandlerScalarType() const;
-
-   /**
-    * @brief Convenience method to open the histogram and apply a default
-    * stretch.
-    *
-    * This will only work if the image is open, there is a histogram remapper
-    * in the chain, and there was a histogram created.
-    * 
-    * Valid stretches (from ossimHistogramRemapper.h):
-    *
-    @verbatim
-      ossimHistogramRemapper::LINEAR_ONE_PIECE
-      ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN
-      ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN
-      ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN
-      ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX
-    @endverbatim
-    *
-    * @return true on success, false on error.
-    */
-   bool openHistogram( ossimHistogramRemapper::StretchMode mode );
-
-private:
-
-   /**  Pointers to links in chain. */
-   ossimRefPtr<ossimImageHandler>             m_handler;
-   ossimRefPtr<ossimBandSelector>             m_bandSelector;
-   ossimRefPtr<ossimHistogramRemapper>        m_histogramRemapper;
-   ossimRefPtr<ossimBrightnessContrastSource> m_brightnessContrast;
-   ossimRefPtr<ossimImageSharpenFilter>       m_sharpen;   
-   ossimRefPtr<ossimScalarRemapper>           m_scalarRemapper;
-   ossimRefPtr<ossimCacheTileSource>          m_resamplerCache;
-   ossimRefPtr<ossimImageRenderer>            m_resampler;
-   ossimRefPtr<ossimGeoPolyCutter>            m_geoPolyCutter;
-   ossimRefPtr<ossimCacheTileSource>          m_chainCache;
-
-   /** control flags */
-   bool m_addHistogramFlag;
-   bool m_addResamplerCacheFlag;
-   bool m_addChainCacheFlag;
-   bool m_remapToEightBitFlag;
-   bool m_threeBandFlag;
-   bool m_threeBandReverseFlag;
-   bool m_brightnessContrastFlag;
-   bool m_sharpenFlag;
-   bool m_geoPolyCutterFlag;
-
-};
-
-#endif /* #ifndef ossimSingleImageChain_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimSrtmTileSource.h b/ossim/include/ossim/imaging/ossimSrtmTileSource.h
deleted file mode 100644
index f6354cc..0000000
--- a/ossim/include/ossim/imaging/ossimSrtmTileSource.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Image handler class for a Shuttle Radar Topography Mission (SRTM) file.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimSrtmTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimSrtmTileSource_HEADER
-#define ossimSrtmTileSource_HEADER
-
-#include <ossim/imaging/ossimGeneralRasterTileSource.h>
-#include <ossim/support_data/ossimSrtmSupportData.h>
-
-
-class OSSIMDLLEXPORT ossimSrtmTileSource : public ossimGeneralRasterTileSource
-{
-public:
-   ossimSrtmTileSource();
-
-   virtual ossimString getShortName() const;
-   virtual ossimString getLongName()  const;
-
-   virtual bool open();
-
-   //! Returns the image geometry object associated with this tile source or NULL if not defined.
-   //! The geometry contains full-to-local image transform as well as projection (image-to-world)
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * @return true on success, false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = NULL);
-
-   /**
-    * @brief Gets a property.
-    * @param The name of the property to get.
-    * @return The property if found.
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-
-   /**
-    * @brief Adds property names to array.
-    * @param propertyNames Array to populate with property names.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-protected:
-   virtual ~ossimSrtmTileSource();
-   ossimSrtmSupportData m_SrtmSupportData;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimStreamReaderInterface.h b/ossim/include/ossim/imaging/ossimStreamReaderInterface.h
deleted file mode 100644
index a156673..0000000
--- a/ossim/include/ossim/imaging/ossimStreamReaderInterface.h
+++ /dev/null
@@ -1,53 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimStreamReaderInterface.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class interface ossimMetadataInterface.
-//
-// Has pure virtual "open" method that derived classes must
-// implement to be concrete.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimStreamReaderInterface_HEADER
-#define ossimStreamReaderInterface_HEADER 1
-
-#include <iosfwd>
-
-/** @class ossimStreamReaderInterface */
-class ossimStreamReaderInterface
-{
-public:
-   
-   /** @brief default constructor */
-   ossimStreamReaderInterface(){}
-
-   /** @brief virtual destructor. */
-   virtual ~ossimStreamReaderInterface(){}
-
-   /**
-    *  @brief Pure virtual open method.
-    *
-    *  This open takes a stream, postition and a flag.
-    *
-    *  @param str Open stream to image.
-    *
-    *  @param restartPosition Typically 0, this is the stream offset to the
-    *  front of the image.
-    *
-    *  @param youOwnIt If true this object takes owner ship of the pointer
-    *  memory and will destroy on close.
-    *  
-    *  @return true on success, false on error.
-    */
-   virtual bool open( std::istream* str,
-                      std::streamoff restartPosition,
-                      bool youOwnIt ) = 0;
-};
-
-#endif /* #ifndef ossimStreamReaderInterface_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimSubImageTileSource.h b/ossim/include/ossim/imaging/ossimSubImageTileSource.h
deleted file mode 100644
index ee0c732..0000000
--- a/ossim/include/ossim/imaging/ossimSubImageTileSource.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//*****************************************************************************
-// FILE: ossimSubImageTileSource.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimSubImageTileSource.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimSubImageTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimSubImageTileSource_HEADER
-#define ossimSubImageTileSource_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/*!****************************************************************************
- *
- *  CLASS: ossimSubImageTileSource
- *
- *  This tile source permits specifying an offset that is to be applied to the
- *  tile origin for all getTile() requests. It is intended for converting
- *  a full-image space coordinate to a sub-image coordinate.
- *
- *****************************************************************************/
-class OSSIM_DLL ossimSubImageTileSource : public ossimImageSourceFilter
-{
-public:
-   /*!
-    * Default constructor initializes the sub-image offset to zero.
-    */
-   ossimSubImageTileSource();
-
-   /*!
-    * Constructor accepts an input source pointer. Offset is defaulted to (0,0).
-    */
-   ossimSubImageTileSource(ossimImageSource* inputSource);
-
-   /*!
-    * Constructs with specified input source and offset.
-    */
-   ossimSubImageTileSource(ossimImageSource* inputSource,
-                           const ossimIpt&   offset);
-
-   /*!
-    * Permits setting the image's offset relative to the full image space.
-    */
-   void setSubImageOffset(const ossimIpt& offset) { theSubImageOffset=offset; }
-
-   ossimIpt getSubImageOffset()const{ return theSubImageOffset;}
- 
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32  rr_level=0);
-
-   /*!
-    * Fetches the sub-image's bounding rect in FULL-IMAGE SPACE.
-    */
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const;
-   
-   /*!
-    * Fetches the sub-image's valid image vertices in FULL-IMAGE SPACE.
-    */
-   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0)const;
-
-   virtual void initialize();
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-private:
-   virtual ~ossimSubImageTileSource();
-   
-   ossimIpt                    theSubImageOffset;
-   ossimRefPtr<ossimImageData> theTile;
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimTableRemapper.h b/ossim/include/ossim/imaging/ossimTableRemapper.h
deleted file mode 100644
index 1788163..0000000
--- a/ossim/include/ossim/imaging/ossimTableRemapper.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Table remapper class declaration.
-// 
-// Takes input tile, remaps it through a table, then output tile in the desired
-// scalar type.
-//
-// Two modes one that works on native remap tables, that being of the same
-// scalar type (like ossim_uint8) of the input connection, and another that
-// uses a normalized remap table (more scalar independent).
-//
-//*************************************************************************
-// $Id: ossimTableRemapper.h 22479 2013-11-12 02:18:55Z dburken $
-#ifndef ossimTableRemapper_HEADER
-#define ossimTableRemapper_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-class OSSIMDLLEXPORT ossimTableRemapper : public ossimImageSourceFilter
-{
-public:
-   enum RemapTableType
-   {
-      UKNOWN     = 0,
-      NATIVE     = 1,
-      NORMALIZED = 2
-   };
-
-   /** default constructor */
-   ossimTableRemapper();
-
-   virtual ossimScalarType getOutputScalarType() const;
-    
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-
-
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   
-   virtual ostream& print(ostream& os) const;
-
-   friend ostream& operator << (ostream& os,  const ossimTableRemapper& tr);
-
-protected:
-   /** virtual destructor */
-   virtual ~ossimTableRemapper();
-
-   ossimRefPtr<ossimImageData> theTile;
-   ossimRefPtr<ossimImageData> theTmpTile;
-   std::vector<ossim_uint8>    theTable;
-   ossim_float64*  theNormBuf;
-   ossim_uint32    theTableBinCount;
-   ossim_uint32    theTableBandCount;
-   RemapTableType  theTableType;
-   ossimScalarType theInputScalarType;
-   ossimScalarType theOutputScalarType;
-   
-   void allocate(const ossimIrect& rect);
-   void destroy();
-
-   void remapFromNativeTable(ossimRefPtr<ossimImageData>& inputTile);
-
-   template <class T> void remapFromNativeTable(
-      T dummy,
-      ossimRefPtr<ossimImageData>& inputTile);
-
-   void remapFromNormalizedTable(ossimRefPtr<ossimImageData>& inputTile);
-
-   template <class T> void dumpTable(T dummy, ostream& os) const;
-
-   // Do not allow copy constructor, operator=.
-   ossimTableRemapper(const ossimTableRemapper& tr);
-   ossimTableRemapper& operator=(const ossimTableRemapper& tr);
-   
-   TYPE_DATA
-};
-
-#endif  /* #ifndef ossimTableRemapper_HEADER */
diff --git a/ossim/include/ossim/imaging/ossimTiffOverviewBuilder.h b/ossim/include/ossim/imaging/ossimTiffOverviewBuilder.h
deleted file mode 100644
index 8c12590..0000000
--- a/ossim/include/ossim/imaging/ossimTiffOverviewBuilder.h
+++ /dev/null
@@ -1,304 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for TiffOverviewBuilder.
-//
-//*******************************************************************
-//  $Id: ossimTiffOverviewBuilder.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimTiffOverviewBuilder_HEADER
-#define ossimTiffOverviewBuilder_HEADER
-
-#include <vector>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-
-#include <ossim/imaging/ossimOverviewBuilderBase.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-
-#include <tiffio.h>
-
-class ossimConnectableObject;
-class ossimFilename;
-class ossimImageGeometry;
-
-class OSSIM_DLL ossimTiffOverviewBuilder
-   :
-      public ossimOverviewBuilderBase
-{
-public:
-
-   enum
-   {
-      DEFAULT_COMPRESS_QUALITY=75
-   };
-
-   /** default constructor */
-   ossimTiffOverviewBuilder();
-   
-   /** virtual destructor */
-   virtual ~ossimTiffOverviewBuilder();
-
-   /**
-    * Supports BOX or NEAREST NEIGHBOR.  When indexed you should probably use nearest neighbor
-    */ 
-   void setResampleType(ossimFilterResampler::ossimFilterResamplerType resampleType);
-   
-   /**
-    *  Builds overview file and sets "theOutputFile" to that of
-    *  the overview_file.
-    *
-    *  @param overview_file The overview file name to output.
-    *
-    *  @param copy_all  If set to true the entire image will be
-    *  copied.  This can be used to convert an image to a tiled tif.
-    *  
-    *  @return trueon success, false on error.
-    */
-   bool buildOverview(const ossimFilename& overview_file,
-                      bool copy_all=false);
-
-   /**
-    * Calls buildOverview.  This method uses "theOutputFile" for the file
-    * name.
-    *
-    * If the copy_all flag is set the entire image will be copied.  This can
-    * be used to convert an image to a tiled tif.
-    *
-    * @return true on success, false on error.
-    *
-    * @note If setOutputFile was not called the output name will be derived
-    * from the image name.  If image was "foo.tif" the overview file will
-    * be "foo.ovr".
-    */
-   virtual bool execute();
-
-   /**
-    *  Sets the compression type to use when building overviews.
-    *  
-    *  @param compression_type Current supported types:
-    * - COMPRESSION_JPEG
-    * - COMPRESSION_LZW
-    * - COMPRESSION_DEFLATE
-    * - COMPRESSION_PACKBITS
-    * - COMPRESSION_NONE (default)
-    */
-   void setCompressionType(ossim_uint16 compression_type);
-
-   /**
-    *  Sets the compression quality for use when using a compression type
-    *  of COMPRESSION_JPEG.
-    *
-    *  @param quality Range 1 to 100 with 100 being best quality.
-    */
-   void setJpegCompressionQuality(ossim_int32 quality);
-
-   /**
-    * @brief Method to return copy all flag.
-    * @return The copy all flag.  If true all data will be written to the
-    * overview including R0.
-    */
-   bool getCopyAllFlag() const;
-
-   /**
-    * @brief Sets internal overviews flag.
-    * @param flag If true, and input source is tiff format, overviews will be
-    * built internally.
-    */
-   void setInternalOverviewsFlag(bool flag);
-
-   /** @return The intenal overview flag. */
-   bool getInternalOverviewsFlag() const;
-
-   /**
-    * @brief Sets theCopyAllFlag.
-    * @param flag The flag. If true all data will be written to the
-    * overview including R0.
-    */
-   void setCopyAllFlag(bool flag);
-
-   /** @return ossimObject* to this object. */
-   virtual ossimObject* getObject();
-
-   /**
-    * @return const ossimObject* to this object.
-    */
-   virtual const ossimObject* getObject() const;
-
-   /**
-    * @return true if input is an image handler.
-    */
-   virtual bool canConnectMyInputTo(ossim_int32 index,
-                                    const ossimConnectableObject* obj) const;
-
-   /**
-    * @brief Sets the input to the builder. Satisfies pure virtual from
-    * ossimOverviewBuilderBase.
-    *
-    * @param imageSource The input to the builder.
-    *
-    * @return True on successful initializion, false on error.
-    */
-   virtual bool setInputSource(ossimImageHandler* imageSource);
-   
-   /**
-    * @brief Sets the output filename.
-    * Satisfies pure virtual from ossimOverviewBuilderBase.
-    * @param file The output file name.
-    */
-   virtual void  setOutputFile(const ossimFilename& file);
-
-   /**
-    * @brief Gets the output file name. (pure virtual)
-    *
-    * @return The output file name or ossimFilename::NIL if it was not set
-    * yet and the image handle has not been initialized.
-    *
-    * @note This is non-const as a call to this may force initialization of
-    * overview builder output file name if the it was not set already.
-    *
-    * @note This will return ossimFilename::NIL unless one of was called,
-    * setInputSource or setOutputFile.
-    */
-   virtual ossimFilename getOutputFile() const;
-
-   void setOutputTileSize(const ossimIpt& tileSize);
-
-   /**
-    * @brief Sets the overview output type.
-    *
-    * Satisfies pure virtual from ossimOverviewBuilderBase.
-    * 
-    * Currently handled types are:
-    * "ossim_tiff_nearest" and "ossim_tiff_box"
-    *
-    * @param type This should be the string representing the type.  This method
-    * will do nothing if type is not handled and return false.
-    *
-    * @return true if type is handled, false if not.
-    */
-   virtual bool setOverviewType(const ossimString& type);
-
-   /**
-    * @brief Gets the overview type.
-    * Satisfies pure virtual from ossimOverviewBuilderBase.
-    * @return The overview output type as a string.
-    */
-   virtual ossimString getOverviewType() const;
-
-   /**
-    * @brief Method to populate class supported types.
-    * Satisfies pure virtual from ossimOverviewBuilderBase.
-    * @param typeList List of ossimStrings to add to.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-
-   /**
-    * @brief Method to set properties.
-    * @param property Property to set.
-    *
-    * @note Currently supported property:
-    * name=levels, value should be list of levels separated by a comma with
-    * no spaces. Example: "2,4,8,16,32,64"
-    */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-
-   /**
-    * @brief Method to populate the list of property names.
-    * @param propertyNames List to populate.  This does not clear the list
-    * just adds to it.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-  
-private:
-
-   /**
-    *  Copy the full resolution image data to the output tif image.
-    */
-  bool writeR0(TIFF* tif);
-
-   /**
-    *  Write reduced resolution data set to the tif file.
-    *
-    *  @param firstRestLevel used to tell method that if a histogram is needed, do it on
-    *  that res level.
-    */
-   bool writeRn(ossimImageHandler* imageHandler,
-                TIFF* tif,
-                ossim_uint32 resLevel,
-                bool firstResLevel);
-   
-   /**
-    *  Set the tiff tags for the appropriate resLevel.  Level zero is the
-    *  full resolution image.
-    *
-    *  @param tif Pointer to the tif file.
-    *  @param outputRect The dimensions (zero based) of res set.
-    *  @param rrds_level The current reduced res level.
-    */
-   bool setTags(TIFF* tif,
-                const ossimIrect& outputRect,
-                ossim_int32 resLevel) const;
-
-   /**
-    *  Writes geotiff tags.
-    *  @param geom
-    *  @param boundingRect
-    *  @param resLevel Zero base, 0 being full res.
-    *  @param tif
-    *  @return true on success, false on error.
-    */
-   bool setGeotiffTags(const ossimImageGeometry* geom,
-                       const ossimDrect& boundingRect,
-                       ossim_uint32 resLevel,
-                       TIFF* tif);
-
-   TIFF* openTiff( const ossimString& filename ) const;
-
-   void closeTiff(TIFF* tif);
-
-   /**
-    * @returns true if m_internalOverviewsFlag and input image supports
-    * building internal overviews.  Currently only tiff reader.
-    */
-   bool buildInternalOverviews() const;
-
-   /**
-    * @return true if m_copyAllFlag is set and build internal overviews is not
-    * set.
-    */
-   bool copyR0() const;
-
-   // Disallow these...
-   ossimTiffOverviewBuilder(const ossimTiffOverviewBuilder& source);
-   ossimTiffOverviewBuilder& operator=(const ossimTiffOverviewBuilder& rhs); 
-
-   std::vector<ossim_uint8>                           m_nullDataBuffer;
-   ossim_int32                                        m_bytesPerPixel;
-   ossim_int32                                        m_bitsPerSample;
-   ossim_int32                                        m_tileWidth;
-   ossim_int32                                        m_tileHeight;
-   ossim_int32                                        m_tileSizeInBytes;
-   ossim_int32                                        m_sampleFormat;
-   ossim_int32                                        m_currentTiffDir;
-   ossim_uint16                                       m_tiffCompressType;
-   ossim_int32                                        m_jpegCompressQuality;
-   ossimFilterResampler::ossimFilterResamplerType     m_resampleType;
-   std::vector<double>                                m_nullPixelValues;
-   bool                                               m_copyAllFlag;
-   bool                                               m_outputTileSizeSetFlag;
-   bool                                               m_internalOverviewsFlag;
-
-TYPE_DATA   
-};
-   
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimTiffTileSource.h b/ossim/include/ossim/imaging/ossimTiffTileSource.h
deleted file mode 100644
index 4089e7c..0000000
--- a/ossim/include/ossim/imaging/ossimTiffTileSource.h
+++ /dev/null
@@ -1,365 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//          Frank Warmerdam (warmerdam at pobox.com)
-//
-// Description:
-//
-// Contains class declaration for ossimTiffTileSource.
-// ossimTiffTileSource  is derived from ImageHandler which is derived from
-// TileSource.
-//*******************************************************************
-//  $Id: ossimTiffTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimTiffTileSource_HEADER
-#define ossimTiffTileSource_HEADER 1
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimIrect.h>
-#include <tiffio.h>
-#include <vector>
-
-class ossimImageData;
-class ossimTiffOverviewTileSource;
-
-class OSSIMDLLEXPORT ossimTiffTileSource : public ossimImageHandler
-{
-public:
-
-   enum ReadMethod
-   {
-      UNKNOWN,
-      READ_RGBA_U8_TILE,
-      READ_RGBA_U8_STRIP,
-      READ_RGBA_U8A_STRIP,
-      READ_SCAN_LINE,
-      READ_TILE,
-      READ_U16_STRIP
-   };
-
-   ossimTiffTileSource();
-
-   virtual ossimString getLongName()  const;
-   virtual ossimString getShortName() const;
-
-   /**
-    *  Returns true if the image_file can be opened and is a valid tiff file.
-    */
-   virtual bool open(const ossimFilename& image_file);
-   virtual void close();
-   
-   /**
-    *  Returns a pointer to a tile given an origin representing the upper left
-    *  corner of the tile to grab from the image.
-    *  Satisfies pure virtual from TileSource class.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-   
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    *
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-   
-   /**
-    *  Returns the number of bands in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   virtual ossim_uint32 getNumberOfOutputBands () const;
-
-   /**
-    * @brief Indicates whether or not the image handler can control output
-    * band selection via the setOutputBandList method.
-    *
-    * Overrides: ossimImageHandler::isBandSelector
-    *
-    * @return true
-    */
-   virtual bool isBandSelector() const;
-
-   /**
-    * @brief If the image handler "isBandSeletor()" then the band selection
-    * of the output chip can be controlled.
-    *
-    * Overrides: ossimImageHandler::setOutputBandList
-    * 
-    * @return true on success, false on error.
-    */
-   virtual bool setOutputBandList(const std::vector<ossim_uint32>& band_list);
-
-   /** @brief Initializes bandList to the zero based order of output bands. */
-   virtual void getOutputBandList(std::vector<ossim_uint32>& bandList) const;
-   
-   /**
-    *  Returns the number of lines in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
-   
-   /**
-    *  Returns the number of samples in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
-
-   /**
-    *  Returns the number of image file directories in the tiff image.
-    */
-   virtual ossim_uint32 getNumberOfDirectories() const;
-   
-   /**
-    * Returns the number of reduced resolution data sets (rrds).
-    * Notes:
-    *
-    * - The full res image is counted as a data set so an image with no
-    *   reduced resolution data set will have a count of one.
-    * - This method counts R0 as a res set even if it does not have one.
-    *   This was done deliberately so as to not screw up code down the
-    *   line.
-    */
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual bool isOpen()const;
-
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-   
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /**
-    *  Returns true if the first directory of the tiff image did not have
-    *  the reduced resolution file type set.
-    */
-   bool hasR0() const;
-  
-   virtual ossim_float64 getMinPixelValue(ossim_uint32 band=0)const;
-   virtual ossim_float64 getMaxPixelValue(ossim_uint32 band=0)const;
-   virtual ossim_float64 getNullPixelValue(ossim_uint32 band=0)const;
-   
-   virtual bool isValidRLevel(ossim_uint32 resLevel) const;
-
-   /**
-    * @return The tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width, which can be different than the
-    * internal image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * @return The tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileHeight which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   void setApplyColorPaletteFlag(bool flag);
-   bool getApplyColorPaletteFlag()const;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   bool isColorMapped() const;
-   
-   virtual std::ostream& print(std::ostream& os) const;
-
-   TIFF* tiffPtr()
-   {
-      return theTiffPtr;
-   }
-#if 0
-   /**
-    * @brief Method to get the image geometry object associated with this
-    * image.
-    *
-    * The geometry contains full-to-local image transform as well as
-    * projection (image-to-world).
-    *
-    * @return ossimImageGeometry* or null if not defined.
-    */
-   virtual ossimImageGeometry* getImageGeometry();
-#endif   
-protected:
-   virtual ~ossimTiffTileSource();
-   /**
-    *  Returns true if no errors initializing object.
-    *
-    *  Notes:
-    *  - Callers of this method must ensure "theTiffPtr" data member
-    *    is initialized.
-    *  - This method was added to consolidate object initialization code
-    *    between constructor and public open method.
-    */
-   bool open();
-
-   // Must be protected for derived ossimTerraSarTiffReader.
-   TIFF* theTiffPtr; 
-   
-private:
-
-   /**
-    *  Adjust point to even tile boundary.  Assumes 0,0 origin.
-    *  Shifts in the upper left direction.
-    */
-   void adjustToStartOfTile(ossimIpt& pt) const;
-
-   /**
-    *  If the tiff source has R0 then this returns the current tiff directory
-    *  that the tiff pointer is pointing to; else, it returns the current
-    *  directory + 1.
-    */
-   ossim_uint32 getCurrentTiffRLevel() const;
-   
-   ossimString getReadMethod(ossim_uint32 directory) const;
-   
-   bool loadTile(const ossimIrect& tile_rect,
-                 const ossimIrect& clip_rect,
-                 ossimImageData* result);
-   
-   bool loadFromRgbaU8Tile(const ossimIrect& tile_rect,
-                           const ossimIrect& clip_rect,
-                           ossimImageData* result);
-   
-   bool loadFromRgbaU8Strip(const ossimIrect& tile_rect,
-                            const ossimIrect& clip_rect,
-                            ossimImageData* result);
-   
-   bool loadFromRgbaU8aStrip(const ossimIrect& tile_rect,
-                             const ossimIrect& clip_rect,
-                             ossimImageData* result);
-
-   bool loadFromU16Strip(const ossimIrect& clip_rect,
-                         ossimImageData* result);
-   
-   bool loadFromScanLine(const ossimIrect& clip_rect,
-                         ossimImageData* result);
-
-   bool loadFromTile(const ossimIrect& clip_rect,
-                     ossimImageData* result);
-   
-   void setReadMethod();
-   
-   /**
-    * Change tiff directory and sets theCurrentDirectory.
-    *
-    * @return true on success, false on error.
-    */
-   bool setTiffDirectory(ossim_uint16 directory);
-
-   void populateLut();
-
-   /**
-    * @brief validateMinMaxNull Checks min, max and null to make sure they are not equal
-    * to the scalar type nan or double nan; sets to default min max if so.
-    */
-   void validateMinMaxNull();
-
-   /**
-    * @brief Checks line/samples of level for power of two decimation from the
-    * previous rlevel.
-    *
-    * Used to weed out thumbnail directories being used as a reduced
-    * resolution layer.
-    *
-    * Note this shuts off the thumbnail which someone may
-    * want to see.  We could make this a reader prop if it becomes an issue.
-    * drb - 09 Jan. 2012.
-    *
-    * @param dir The tiff directory index.
-    * 
-    * @return true is so; else, false.  If level is zero returns false.
-    */
-   bool isPowerOfTwoDecimation(ossim_uint32 dir) const;
-
-   /** @brief Allocates theTile. */
-   void allocateTile();
-
-   /**
-    * @brief Allocates theBuffer
-    * @return true on success; false, on error.
-    */
-   bool allocateBuffer();  
-   
-   ossimRefPtr<ossimImageData> theTile;
-   
-   ossim_uint8*         theBuffer;
-   ossim_uint32         theBufferSize;
-   ossimIrect           theBufferRect;
-   ossim_uint32         theBufferRLevel;
-   ossim_uint32         theCurrentTileWidth;
-   ossim_uint32         theCurrentTileHeight;
-
-   ossim_uint16         theSamplesPerPixel;
-   ossim_uint16         theBitsPerSample;
-   ossim_uint16         theSampleFormatUnit;
-
-   ossim_float64        theMaxSampleValue;
-   ossim_float64        theMinSampleValue;
-   ossim_float64        theNullSampleValue;
-
-   ossim_uint16         theNumberOfDirectories;
-   ossim_uint16         theCurrentDirectory;
-   bool                 theR0isFullRes;
-   ossim_uint32         theBytesPerPixel;
-   ossimScalarType      theScalarType;
-   bool                 theApplyColorPaletteFlag;
-
-   // Things we need from each directory as they can be different.
-   std::vector<ossim_uint32> theImageWidth;
-   std::vector<ossim_uint32> theImageLength;
-   std::vector<ReadMethod>   theReadMethod;
-   std::vector<ossim_uint16> thePlanarConfig;
-   std::vector<ossim_uint16> thePhotometric;
-   std::vector<ossim_uint32> theRowsPerStrip;
-   std::vector<ossim_uint32> theImageTileWidth;
-   std::vector<ossim_uint32> theImageTileLength;
-   std::vector<ossim_uint32> theImageDirectoryList;
-   
-   ossim_uint32              theCurrentTiffRlevel;
-   ossim_int32               theCompressionType;
-   std::vector<ossim_uint32> theOutputBandList;
-   
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimTiffTileSource_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimTileCache.h b/ossim/include/ossim/imaging/ossimTileCache.h
deleted file mode 100644
index 9512a0e..0000000
--- a/ossim/include/ossim/imaging/ossimTileCache.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts
-// Description: This file contains the cache algorithm
-//
-//***********************************
-// $Id: ossimTileCache.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef DataCache_HEADER
-#define DataCache_HEADER
-#include <map>
-#include <stack>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimDataObject.h>
-class OSSIM_DLL ossimTileCache
-{
-public:
-   
-   ossimTileCache(long numberOfBuckets  = 10);
-   virtual ~ossimTileCache();
-
-   /*!
-    * This will return a tile if found.  Note this tile is still
-    * owned by the cache.
-    */
-   virtual ossimDataObject* get(const ossimDpt3d &origin,
-                               unsigned long resLevel=0);
-
-   /*!
-    * Will remove the tile from the cache and will not delete.  Note:
-    * the cache no longer owns the tile.
-    */
-   virtual ossimDataObject* remove(const ossimDpt3d &origin,
-                                  unsigned long resLevel=0);
-   /*!
-    * This will not duplicate the tile.  Note the tile is owned
-    * by the cache.
-    */
-   virtual ossimDataObject* insert(const ossimDpt3d &origin,
-                                  ossimDataObject* data,
-                                  unsigned long resLevel=0);
-   /*!
-    * Not implemented
-    */
-   void invalidate();
-   /*!
-    * Not implemented
-    */
-   virtual void invalidate(const ossimDpt3d &origin,
-                           ossim_uint32 resLevel);
-
-
-   
-   virtual long numberOfItems()const{return theCache?(long)theCache->size():(long)0;}
-   virtual void display()const;
-
-   virtual ossim_uint32 sizeInBytes(){return theSizeInBytes;}
-   
-protected:
-
-   struct ossimTileInformation
-   {
-   public:
-      friend ostream& operator <<(ostream &out,
-                                  const ossimTileInformation& /* info */)
-         {
-
-            return out;
-         }
-      ossimTileInformation(ossimDataObject* aTile,
-                           const ossimDpt3d &origin = ossimDpt(0,0),
-                           unsigned long resLevel = 0)
-         : theCachedTile(aTile),
-           theOrigin(origin),
-           theResLevel(resLevel)
-         {}
-      ossimRefPtr<ossimDataObject>    theCachedTile;
-      ossimDpt3d         theOrigin;
-      unsigned long      theResLevel;
-   };
-
-   typedef multimap<ossim_uint32, ossimTileInformation*>::iterator Iterator;
-   typedef ossimTileInformation* CacheDataPtr;
-   typedef ossimTileInformation  CacheData;
-   
-   void deleteAll();
-   virtual ossim_uint32 bucketHash(const ossimDpt3d &aPt);
-   virtual ossim_uint32 tileId(const ossimDpt3d &aPt);
-   
-   multimap<ossim_uint32, ossimTileInformation*>  *theCache;
-   long                                            theNumberOfBuckets;
-   ossim_uint32                                    theSizeInBytes;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimTilePatch.h b/ossim/include/ossim/imaging/ossimTilePatch.h
deleted file mode 100644
index 585f042..0000000
--- a/ossim/include/ossim/imaging/ossimTilePatch.h
+++ /dev/null
@@ -1,137 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimTilePatch.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimTilePatch_HEADER
-#define ossimTilePatch_HEADER
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/imaging/ossimDiscreteNearestNeighbor.h>
-#include <ossim/imaging/ossimImageData.h>
-
-class ossimImageSource;
-
-class ossimTilePatch : public ossimObject
-{
-public:
-   ossimTilePatch(ossimImageSource* input);
-   /*!
-    * The rect is assumed up right and all we need
-    * to do is compute the even tile boundary rect
-    */
-   ossimTilePatch(ossimScalarType scalarType = OSSIM_UCHAR,
-                  long numberOfComponents = 1,
-                  long width=128,
-                  long height=128);
-   
-   /*!
-    * return the tile boundary aligned rectangle for this
-    * patch.
-    */
-   virtual ossimIrect getRect()const;
-
-   /*!
-    * The padding is for any convolution that must take
-    * place.  
-    */
-   virtual void setRect(const ossimDpt &p1,
-                        const ossimDpt &p2,
-                        const ossimDpt &p3,
-                        const ossimDpt &p4,
-                        const ossimDpt &tile_size,
-                        const ossimDpt &padding=ossimDpt(0,0));
-
-   virtual void setRect(const ossimDrect &aRect,
-                        const ossimDpt &tile_size,
-                        const ossimDpt &padding=ossimDpt(0,0));
-
-   virtual void setRect(const ossimDpt &center_of_rect,
-                        const ossimDpt &rect_size,
-                        const ossimDpt &tile_size,
-                        const ossimDpt &padding=ossimDpt(0,0));
-
-   /*!
-    * This will fill the tile from the tile patch.
-    */
-   virtual void fillTile(ossimRefPtr<ossimImageData>& aTile)const;
-
-   /*!
-    * This will fill the tile from the tile patch and apply the convolution
-    * kernel.  This is optimized for upright rectangles.  Use the bilinear
-    * fill tile bellow for arbitrary 4-sided polygons.
-    */
-   virtual void fillTile(ossimRefPtr<ossimImageData>& result,
-                         ossimDiscreteConvolutionKernel* kernel)const;
-
-   /*!
-    * We will assume that the patch is already
-    * big enough to satisfy the kernel size.
-    */
-   virtual void fillTile(ossimRefPtr<ossimImageData>& result,
-                         const ossimDpt   &ul,
-                         const ossimDpt   &ur,
-                         const ossimDpt   &deltaUl,
-                         const ossimDpt   &deltaUr,
-                         const ossimDpt   &length)const;
-
-
-   virtual void fillPatch(ossimImageSource *imageSource,
-                          long resLevel = 0);
-   
-   
-   
-//    static ossimIrect alignRectToBoundary(const ossimDrect &aRect,
-//                                          const ossimDpt &tile_size);
-   static ossimDrect findBoundingRect(const ossimDpt &p1,
-                                      const ossimDpt &p2,
-                                      const ossimDpt &p3,
-                                      const ossimDpt &p4);
-   /*!
-    * Do not delete this data.  We give raw access to the buffer
-    * if there are special things you wish to have done.
-    */
-   ossimRefPtr<ossimImageData> getData(){return thePatchData;}
-
-   void setData(ossimRefPtr<ossimImageData>& patchData);
-   /*!
-    *  This will implement an in place convolution.  It will
-    *  allocate a buffer pass it to the convolution algorithm
-    * and then replace the internal buffer.
-    */
-   void convolve(ossimDiscreteConvolutionKernel* kernel);
-   
-protected:
-   virtual ~ossimTilePatch();
-   
-   ossimRefPtr<ossimImageData>         thePatchData;
-   static ossimDiscreteNearestNeighbor nearestNeighborKernel;
-   
-
-
-   template<class T>
-   void fillTileTemplate(T dummyVariable,
-                         ossimRefPtr<ossimImageData>& result,
-                         const ossimDpt   &ul,
-                         const ossimDpt   &ur,
-                         const ossimDpt   &deltaUl,
-                         const ossimDpt   &deltaUr,
-                         const ossimDpt   &length)const;
-   
-   template<class T>
-   void fillTileTemplate(T dummyVariable,
-                         ossimRefPtr<ossimImageData>& result,
-                         ossimDiscreteConvolutionKernel* kernel)const;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimTiledImageHandler.h b/ossim/include/ossim/imaging/ossimTiledImageHandler.h
deleted file mode 100644
index 658280e..0000000
--- a/ossim/include/ossim/imaging/ossimTiledImageHandler.h
+++ /dev/null
@@ -1,161 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Oscar Kramer
-// 
-// Description:
-//
-// Image handler used  when the full image is distributed across multiple files,
-// As is the case for tiled Quickbird imagery. This is not for use with band-separate formats,
-// but only "spatially-separate" schemes. Throughout, MFT = multiple file tiles, the disk storage
-// scheme handled by this class.
-//
-//**************************************************************************************************
-// $Id: ossimTiledImageHandler.h 2644 2011-05-26 15:20:11Z oscar.kramer $
-#ifndef ossimTiledImageHandler_HEADER
-#define ossimTiledImageHandler_HEADER
-
-#include <ossim/imaging/ossimImageHandler.h>
-
-// Enable this flag to utilize the system of separate overviews for each tile-file
-#define USING_SUB_OVRS 0
-
-/**
- *  This class defines an abstract Handler which all image handlers(loaders)
- *  should derive from.
- */
-class OSSIMDLLEXPORT ossimTiledImageHandler : public ossimImageHandler
-{
-public:
-   //!  Constructor (default):
-   ossimTiledImageHandler();
-   
-   //! Destructor:
-   virtual ~ossimTiledImageHandler();
-   
-   //! @return Returns true on success, false on error.
-   //! @note This method relies on the data member ossimImageData::theImageFile
-   //! being set.  
-   virtual bool open() = 0;
-
-   //! Deletes the overview and clears the valid image vertices.  Derived
-   //! classes should implement. */
-   virtual void close();
-
-   //! Derived classes must implement this method to be concrete.
-   //! @return true if open, false if not.
-   virtual bool isOpen()const;
-
-   virtual ossim_uint32 getNumberOfInputBands() const;
-   
-   //! @param resLevel Reduced resolution level to return lines of.
-   //! Default = 0
-   //! @return The number of lines for specified reduced resolution level.
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
-
-   //! @param resLevel Reduced resolution level to return samples of.
-   //! Default = 0
-   //! @return The number of samples for specified reduced resolution level.
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
-   
-   //! Method to save the state of an object to a keyword list.
-   //! Return true if ok or false on error.
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   //! Method to the load (recreate) the state of an object from a keyword
-   //! list.  Return true if ok or false on error.
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   //! Indicates whether or not the image is tiled internally.
-   //! This implementation returns true if (getImageTileWidth() &&
-   //! getImageTileHeight()) are both non zero.
-   //! Override in the image handler if something else is desired.
-   //! Returns true if tiled, false if not.
-   virtual bool isImageTiled() const;
-
-   //! Returns the tile width of the image or 0 if the image is not tiled.
-   //! Note: this is not the same as the ossimImageSource::getTileWidth which
-   //! returns the output tile width which can be different than the internal
-   //! image tile width on disk.
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   //! Returns the tile height of the image or 0 if the image is not tiled.
-   //! Note: this is not the same as the ossimImageSource::getTileHeight which
-   //! returns the output tile height which can be different than the internal
-   //! image tile height on disk.
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   //! Fills the requested tile by pulling pixels from multiple file tiles as needed.
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel);
-
-   //! Returns scalar type of first tile (should be the same for all tiles)
-   virtual ossimScalarType getOutputScalarType() const;
-
-   //! Returns overall bounding rect in image space.
-   virtual ossimIrect getImageRectangle(ossim_uint32 resLevel = 0) const;
-
-protected:
-
-   //! Class for record of one tile file:
-   class ossimTileFile
-   {
-   public:
-      ossimTileFile() : overviewIsOpen(false) {}
-
-      ossimFilename tileFilename;
-      vector<ossimIrect>  subImageRects; // one rect per resolution level
-      ossimRefPtr<ossimImageHandler> imageHandler;
-      bool overviewIsOpen;
-   };
-
-   //!  Initialize tile buffer to match image datatype.
-   void allocate();
-
-  vector<ossimTileFile> m_tileFiles;
-  ossimRefPtr<ossimImageData> m_tile;
-  ossimRefPtr<ossimImageData> m_blankTile;
-  ossimIrect  m_fullImgRect;
-  ossim_uint32 m_startOvrResLevel;
-
-#if USING_SUB_OVRS
-public:
-   //! Will build over files, one for each tile file.
-   //! @param includeFullResFlag if true the full resolution layer will also
-   //! be put in the overview format.  This is handy for inefficient formats.
-   virtual bool buildOverview(
-      ossimImageHandlerOverviewCompressionType compressionType = OSSIM_OVERVIEW_COMPRESSION_NONE,
-      ossim_uint32 quality = 75,
-      ossimFilterResampler::ossimFilterResamplerType resampleType = ossimFilterResampler::ossimFilterResampler_BOX,
-      bool includeFullResFlag=false);
-
-   virtual bool openOverview();
-   virtual void closeOverview();
-
-   //! This is not an allowed operation since there are many overviews (one per tile) and the
-   //! precise overview being requested is ambiguous:
-   virtual const ossimImageHandler* getOverview() const { return NULL; }
-
-   //!  @return true if getNumberOfReducedResSets > 1, false if not.
-   //!  @see getNumberOfReducedResSets()
-   virtual bool hasOverviews() const;
-   
-   //! Returns the number of decimation (reduced resolution) levels. This is the minimum number
-   //! among all sub-image tile-files.
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-
-protected:
-   //! Will complete the opening process. If there are overviews it will open them. 
-   virtual void completeOpen();
-  
-   bool m_lockSubOvrs;
-
-#endif /* #if USING_SUB_OVRS */
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimTiledImageHandler_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimTiling.h b/ossim/include/ossim/imaging/ossimTiling.h
deleted file mode 100644
index c1d21b5..0000000
--- a/ossim/include/ossim/imaging/ossimTiling.h
+++ /dev/null
@@ -1,201 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: implementation for image generator
-//
-//*************************************************************************
-// $Id: ossimTiling.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimTiling_HEADER
-#define ossimTiling_HEADER
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class OSSIM_DLL ossimTiling : public ossimObject
-{
-public:
-
-   enum ossimTilingDeltaType
-   {
-      ossimTilingDeltaType_TOTAL_PIXELS,
-      ossimTilingDeltaType_PER_PIXEL
-   };
-
-   ossimTiling();
-
-   bool initialize(const ossimMapProjection& proj,
-                   const ossimIrect& boundingRect);
-
-   bool next(ossimRefPtr<ossimMapProjection>& resultProjection,
-             ossimIrect& resultingBounds,
-             ossimString& resultingName)const;
-   
-   void reset();
-   
-   /**
-    * 
-    * @param tilingDistance Distance in the specified units.
-    * @param unitType Currently only angular unit degrees,
-    *                 and linear unit meters are supported.
-    *                 If unitType is pixel unit then the
-    *                 delta per unit will be set to 1.
-    *                 
-    */
-   void setTilingDistance(const ossimDpt& tilingDistance,
-                          ossimUnitType unitType);
-
-   /**
-    * This sets the pixel delta.  The delta can either be TOTAL_PIXELS or
-    * UNIT_PER_PIXEL.
-    *
-    * If the delta type is TOTAL_PIXELS then the unit per pixel is calculated
-    * from the theTilingDistance.  This is very useful when wanting to be on
-    * even geographic boundaries and would like to have a fixed width and
-    * height for
-    * the pixels.  Flight simulators use this tiling scheme for power of 2
-    * outputs.
-    *
-    * if the delta type is unit per pixel then the total pixels is computed
-    * form the
-    * theTilingDistance.  This is useful when you might want whole number
-    * GSD's and whole numbered tile boundaries.
-    */
-   void setDelta(const ossimDpt& delta,
-                 ossimTilingDeltaType deltaType);
-
-   /**
-    * This sets the tilename mask.  The key tokens that are supported are.
-    *
-    * %r%         Replaces with the row number of the current tile
-    * %c%         Replaces with the column number of the current tile
-    * %i%         Replaces with the current tile id.
-    * %or%        Replaces with the origin of the row
-    * %oc%        Replaces with the origin of the col
-    * %SRTM%      Replaces all filenames with the SRTM file name convention
-    *
-    * 
-    * Examples:
-    *   tile%r%_%c%  assume r = 0 and c = 100 then
-    *              this is replaced with tile0_100
-    *   
-    */
-   void setTileNameMask(const ossimString& mask);
-   ossimString getTileNameMask()const;
-   
-   bool getRowCol(ossim_int64& row,
-                  ossim_int64& col,
-                  ossim_int64 tileId)const;
-   bool getOrigin(ossimDpt& origin,
-                  ossim_int64 tileId)const;
-   bool getOrigin(ossimDpt& origin,
-                  ossim_int64 row,
-                  ossim_int64 col)const;
-   
-   void setPaddingSizeInPixels(const ossimIpt& pizelOverlap);
-   ossimDpt getDeltaPerPixel()const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-
-   /**
-    * @return The tiling distance converted to either degrees or meters.
-    */
-   void getConvertedTilingDistance(ossimDpt& pt) const;
-
-   /** The size of a tile in theTilingDistanceUnitType. */
-   ossimDpt             theTilingDistance;
-
-   /** The unit type for "theDelta", and "theTilingDistance". */
-   ossimUnitType        theTilingDistanceUnitType;
-
-   /**
-    * If (theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS) then
-    * this is the size of the tile in pixels like 1024 x 1024.
-    *
-    * If (theDeltaType == ossimTilingDeltaType_PER_PIXEL) then
-    * this is the size of a single pixel like 1.0 meter.
-    */
-   ossimDpt             theDelta;
-
-   /** @see theDelta */
-   ossimTilingDeltaType theDeltaType;
-
-   /**
-    * @brief If set tiling size is controlled by the desired output size in
-    * bytes.  Set by one of output_size_in_bytes, output_size_in_kilo_bytes, or
-    * output_size_in_mega_bytes.  Always stored in bytes.
-    *
-    * @note kilo_byte = 1024 X 1024, mega_byte = 1024 X 1024 X 1024.
-    *
-    * @note If set this relys on theNumberOfBands and theNumberOfBytesPerPixel
-    * need to alse be set correctly.
-    */
-   ossim_int64 theOutputSizeInBytes;
-
-   /**
-    * @brief Output number of bands.  Needed to tile by output size in bytes.
-    *
-    * default = 1
-    *
-    * @see theOutputSizeInBytes
-    */
-   ossim_uint32 theNumberOfBands;
-
-   /**
-    * @brief Output number of bytes per pixel.
-    * Needed to tile by output size in bytes.
-    *
-    * default = 1
-    *
-    * @see theOutputSizeInBytes
-    *
-    * @note This bytes per single pixel, not all bands.
-    */
-   ossim_uint32 theNumberOfBytesPerPixelPerBand;
-   
-   ossimDpt             thePaddingSizeInPixels;
-   mutable ossimRefPtr<ossimMapProjection>  theMapProjection;
-   ossimIrect                       theImageRect;
-   ossimDrect                       theTilingRect;
-   mutable ossim_int64 theTileId;
-   ossim_int64         theTotalHorizontalTiles;
-   ossim_int64         theTotalVerticalTiles;
-   ossim_int64         theTotalTiles;
-   ossimString         theTileNameMask;
-
-   /**
-    * This flags the code to shift the tie point so that the edge of the pixel
-    * falls on the tile boundary.  default=false
-    */
-   bool theEdgeToEdgeFlag; 
-   
-   bool validate()const;
-   bool isAngularUnit(ossimUnitType unitType)const;
-   bool isLinearUnit(ossimUnitType unitType)const;
-   void getTileName(ossimString& resultingName,
-                    ossim_int64 row,
-                    ossim_int64 col,
-                    ossim_int64 id)const;
-   void clampGeographic(ossimDrect& rect)const;
-                    
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimTilingPoly.h b/ossim/include/ossim/imaging/ossimTilingPoly.h
deleted file mode 100644
index 014633b..0000000
--- a/ossim/include/ossim/imaging/ossimTilingPoly.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Mingjie Su
-// 
-// Description: implementation for image generator
-//
-//*************************************************************************
-// $Id: ossimTilingPoly.h 2725 2011-06-15 18:13:07Z david.burken $
-#ifndef ossimTilingPoly_HEADER
-#define ossimTilingPoly_HEADER 1
-
-#include <ossim/imaging/ossimTilingRect.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimGeoPolyCutter.h>
-
-class OSSIM_DLL ossimTilingPoly : public ossimTilingRect
-{
-public:
-
-   ossimTilingPoly();
-
-   virtual ~ossimTilingPoly();
-
-   virtual bool initialize(const ossimMapProjection& proj,
-                           const ossimIrect& boundingRect);
-
-   virtual bool next(ossimRefPtr<ossimMapProjection>& resultProjection,
-                     ossimIrect& resultingBounds,
-                     ossimString& resultingName);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-      const char* prefix=0)const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-      const char* prefix=0);
-
-   bool useMbr() const;
-
-   /** return true if exterior cut is initialized. */
-   bool hasExteriorCut() const;
-
-   /** return true if interior cut is initialized. */
-   bool hasInteriorCut() const;
-   
-   ossimRefPtr<ossimGeoPolyCutter>& getExteriorCut();
-   
-   ossimRefPtr<ossimGeoPolyCutter>& getInteriorCut();
-
-   bool isFeatureBoundingIntersect() const;
-
-protected:
-
-   struct ossimShpFeature
-   {
-      ossimShpFeature(ossim_int32 fid,
-         ossim_int32 polyType,
-         std::vector<ossimGpt> polygon,
-         std::vector<ossimGeoPolygon> multiPolys)
-
-         :m_fid(fid),
-         m_polyType(polyType),
-         m_polygon(polygon),
-         m_multiPolys(multiPolys)
-      {}
-
-      ossim_int32 m_fid;
-      ossim_int32 m_polyType;
-      std::vector<ossimGpt> m_polygon;
-      std::vector<ossimGeoPolygon> m_multiPolys;
-   };
-
-   bool parseShpFile();
-
-   bool nextFeature();
-
-   void setRect();
-
-   ossimFilename          m_shpFilename;
-   bool                   m_useMbr;
-   ossim_float64          m_bufferDistance;
-   
-   ossimRefPtr<ossimGeoPolyCutter> m_exteriorCut;
-   ossimRefPtr<ossimGeoPolyCutter> m_interiorCut;
-   
-   std::vector<ossimShpFeature> m_features;
-   bool m_featureBoundingIntersect;
-                    
-TYPE_DATA
-};
-
-#endif
-
-
diff --git a/ossim/include/ossim/imaging/ossimTilingRect.h b/ossim/include/ossim/imaging/ossimTilingRect.h
deleted file mode 100644
index db5b5ca..0000000
--- a/ossim/include/ossim/imaging/ossimTilingRect.h
+++ /dev/null
@@ -1,68 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Mingjie Su
-// 
-// Description: implementation for image generator
-//
-//*************************************************************************
-// $Id: ossimTilingRect.h 2725 2011-06-15 18:13:07Z david.burken $
-#ifndef ossimTilingRect_HEADER
-#define ossimTilingRect_HEADER 1
-
-#include <ossim/imaging/ossimTiling.h>
-#include <ossim/imaging/ossimGeoPolyCutter.h>
-#include <ossim/imaging/ossimGeoAnnotationPolyObject.h>
-#include <ossim/imaging/ossimGeoAnnotationMultiPolyObject.h>
-
-
-class OSSIM_DLL ossimTilingRect : public ossimTiling
-{
-public:
-
-   ossimTilingRect();
-
-   virtual ~ossimTilingRect();
-
-   virtual bool initialize(const ossimMapProjection& proj,
-                           const ossimIrect& boundingRect);
-
-   virtual bool next(ossimRefPtr<ossimMapProjection>& resultProjection,
-                     ossimIrect& resultingBounds,
-                     ossimString& resultingName);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-      const char* prefix=0)const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-      const char* prefix=0);
-
-protected:
-
-   bool initializeBase(const ossimMapProjection& proj, 
-                       const ossimIrect& boundingRect,
-                       ossimDpt& convertedTilingDistance);
-
-   void getConvertedDistance(ossimDpt& pt, ossimDpt inputDistance) const;
-
-   ossimDpt getPaddingSize() const;
-
-   bool                   m_clipToAoi;
-   ossim_float64          m_lastWidth;
-   ossim_float64          m_lastHeight;
-   bool                   m_useOffset;
-   ossimDpt               m_offsetInPixels;
-   ossimDpt               m_tilingDistanceInPixels;
-   ossimDpt               m_tilinResolutionDistance;
-   ossimUnitType          m_tilingResolutionUnitType;
-   ossimDpt               m_fractionalPixelMisalignment;
-                    
-TYPE_DATA
-};
-
-#endif
-
-
diff --git a/ossim/include/ossim/imaging/ossimTopographicCorrectionFilter.h b/ossim/include/ossim/imaging/ossimTopographicCorrectionFilter.h
deleted file mode 100644
index 8286b85..0000000
--- a/ossim/include/ossim/imaging/ossimTopographicCorrectionFilter.h
+++ /dev/null
@@ -1,225 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimTopographicCorrectionFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimTopographicCorrectionFilter_HEADER
-#define ossimTopographicCorrectionFilter_HEADER
-#include <ossim/imaging/ossimImageCombiner.h>
-#include <ossim/matrix/newmat.h>
-#include <ossim/base/ossimColumnVector3d.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/base/ossimPropertyEvent.h>
-#include <ossim/base/ossim2dLinearRegression.h>
-
-class ossimImageData;
-
-class ossimImageSourceConnection;
-class ossimImageToPlaneNormalFilter;
-/*!
- *
- * class ossimTopographicCorrectionFilter
- *
- * This clas is used to execute terrain correction.  I t requires 2 inputs
- * where the first input is a multi band data source to correct and the
- * second is elevation normals used in light incident calculations.
- *
- * A sample chain might look like:
- *
- *  landsatHandler ---> Cache ---> renderer ---> cache ---------------------------------------
- *                                                                                            |--> Topo correction filter ---> Output
- *  ortho mosaic of elevation data----> imageToPlaneNormals --> Cache ---> Renderer -->Cache --
- *
- * the ossimImageToPlaneNormalsFilter is used to take a single band elevation source and compute normals at each post.  I suggest that you
- * set the renderer to use a higher order convolution than just nearest neighbor, maybe Cubic.  This way you have smoother interpolation
- * as you change zoom levels.
- *
- *
- * Correction Types:
- *
- *   Cosine correction:     In order for this to run it does not need any additional informat but the multi band source and
- *                          an normal calculation input.
- *
- *   Cosine-C correction:   In order for this to run it will need theC array populated for each band.  It defaults
- *                          to 0 forcing a default Cosine correction to take place.
- *
- *   Minnaert correction:   In order for this to run it will need theK array populated for each band.  The defaults should work pretty good
- *  
- */
-class OSSIMDLLEXPORT ossimTopographicCorrectionFilter : public ossimImageCombiner
-{
-public:
-   enum ossimTopoCorrectionType
-   {
-      TOPO_CORRECTION_COSINE    = 0,
-      TOPO_CORRECTION_COSINE_C  = 1,
-      TOPO_CORRECTION_MINNAERT  = 2
-   };
-   ossimTopographicCorrectionFilter();
-
-   ossimTopographicCorrectionFilter(ossimImageSource* colorSource,
-                                    ossimImageSource* elevSource);
-   
-   ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tileRect,
-                                       ossim_uint32 resLevel=0);
-   
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-
-   virtual ossimScalarType getOutputScalarType() const;
-
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-
-   virtual void getDecimationFactor(ossim_uint32 resLevel,
-                                    ossimDpt& result) const;
-   
-   virtual void getDecimationFactors(vector<ossimDpt>& decimations) const;
-
-   virtual ossim_uint32 getNumberOfDecimationLevels()const;
-
-   virtual double getAzimuthAngle()const;
-
-   virtual double getElevationAngle()const;
-
-   virtual void setAzimuthAngle(double angle);
-
-   virtual void setElevationAngle(double angle);
-
-   virtual void initialize();
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   bool canConnectMyInputTo(ossim_int32 inputIndex,
-                            const ossimConnectableObject* object)const;
-      
-   virtual void connectInputEvent(ossimConnectionEvent& event);
-
-   virtual void disconnectInputEvent(ossimConnectionEvent& event);
-
-   virtual void propertyEvent(ossimPropertyEvent& event);
-
-   virtual void refreshEvent(ossimRefreshEvent& event);
-
-   virtual ossimTopoCorrectionType getTopoCorrectionType()const;
-
-   virtual void setTopoCorrectionType(ossimTopoCorrectionType topoType);
-
-   const std::vector<double>& getGainValues()const;
-
-   void setGainValues(const std::vector<double>& gainValues);
-  
-   const vector<double>& getBiasValues()const;
-
-   void setBiasValues(const std::vector<double>& biasValues);
-
-   const vector<double>& getKValues()const;
-
-   double getK(int idx)const;
-
-   void setK(int idx, double value);
-
-   void setKValues(const vector<double>& kValues);
-
-   double getC(int idx)const;
-
-   void setC(int idx, double value);
-
-   void setCValues(const vector<double>& cValues);
-   
-   void computeLightDirection();
-
-protected:
-   virtual ~ossimTopographicCorrectionFilter();
-   virtual void allocate();
-   
-   /*!
-    * The result of the illumination equation is stored in
-    * here.  This is populated on each call to getTile.
-    */
-   ossimRefPtr<ossimImageData>   theTile;
-
-   std::vector<ossim_uint32> theBandMapping;
-   
-//   ossimImageToPlaneNormalFilter* theNormalFilter;
-//   ossimScalarRemapper*           theScalarRemapper;
-   std::vector<double> theC;
-   std::vector<double> theK;
-   std::vector<double> theBias;
-   std::vector<double> theGain;
-   
-   /*!
-    * Used for the light vector computation.
-    */
-   double theLightSourceElevationAngle;
-
-   /*!
-    * Used for the light vector computation.
-    */
-   double theLightSourceAzimuthAngle;
-
-   /*!
-    * This is computed from the elevation and
-    * azimuth angles of the light source.
-    */
-   double theLightDirection[3];
-
-   double         theJulianDay;
-   mutable bool   theCComputedFlag;
-   ossimTopoCorrectionType theTopoCorrectionType;   
-   double         theNdviLowTest;
-   double         theNdviHighTest;
-   
-   virtual void executeTopographicCorrection(
-      ossimRefPtr<ossimImageData>& outputData,
-      ossimRefPtr<ossimImageData>& colorData,
-      ossimRefPtr<ossimImageData>& normalData);
-
-   template <class T> void executeTopographicCorrectionTemplate(
-      T dummy,
-      ossimRefPtr<ossimImageData>& outputData,
-      ossimRefPtr<ossimImageData>& colorData,
-      ossimRefPtr<ossimImageData>& normalData);
-
-   template <class T> void executeTopographicCorrectionMinnaertTemplate(
-      T dummy,
-      ossimRefPtr<ossimImageData>& outputData,
-      ossimRefPtr<ossimImageData>& colorData,
-      ossimRefPtr<ossimImageData>& normalData);
-  
-//    virtual void computeC();
-
-//    template<class T>
-//    void addRegressionPointsTemplate(T, //dummy
-//                                     std::vector<ossim2dLinearRegression>& regressionPoints,
-//                                     std::vector<int>& cosineIBucketCount,
-//                                     ossim_int32 maxCountPerBucket,
-//                                     ossimImageData* colorData,
-//                                     ossimImageData* normalData);
-   template <class T> bool computeNdvi(T dummy,
-                                       ossim_float64& result,
-                                       ossim_uint32 offset,
-                                       const std::vector<T*>& bands)const;
-
-   void resizeArrays(ossim_uint32 newSize);
-
-   bool setCCmputedFlag();
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimTrimFilter.h b/ossim/include/ossim/imaging/ossimTrimFilter.h
deleted file mode 100644
index 9de9f97..0000000
--- a/ossim/include/ossim/imaging/ossimTrimFilter.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimTrimFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimTrimFilter_HEADER
-#define ossimTrimFilter_HEADER
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/imaging/ossimPolyCutter.h>
-
-class ossimTrimFilter : public ossimImageSourceFilter
-{
-public:
-   ossimTrimFilter();
-
-   virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0)const;
-   virtual void getValidImageVertices(vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0)const;
-
-   ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                       ossim_uint32 resLevel=0);
-
-   virtual void initialize();
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-   
-
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-
-   /**
-    * Set property.
-    *
-    * @param property Property to set if property->getName() matches a
-    * property name of this object.
-    */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-
-   /**
-    * Adds this objects properties to the list.
-    *
-    * @param propertyNames Array to add to.
-    *
-    * @note This method does not clear propertyNames prior to adding it's
-    * names.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-protected:
-   virtual ~ossimTrimFilter();
-   double theLeftPercent;
-   double theRightPercent;
-   double theTopPercent;
-   double theBottomPercent;
-   std::vector<ossimIpt>  theValidVertices;
-   ossimRefPtr<ossimPolyCutter> theCutter;
-   
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimTrimFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimTwoColorView.h b/ossim/include/ossim/imaging/ossimTwoColorView.h
deleted file mode 100644
index bf62b80..0000000
--- a/ossim/include/ossim/imaging/ossimTwoColorView.h
+++ /dev/null
@@ -1,106 +0,0 @@
-//-------------------------------------------------------------------
-// License: MIT
-//
-// Author:  Garrett Potts
-//
-//-------------------------------------------------------------------
-//  $Id$
-#ifndef ossimTwoColorView_HEADER
-#define ossimTwoColorView_HEADER 1
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimImageCombiner.h>
-
-/**
- * This is a 2 color view of the input.  It basically allows for a change detection and by default will take the first input and map
- * it to the blue channel and takes the second input and maps to the red channel.  The unused channel is mapped to a min pixel value.
- */
-class OSSIM_DLL ossimTwoColorView : public ossimImageCombiner
-{
-public:
-
-   /**
-    * @brief Enumerations for mapping inputs to red, green and blue
-    * output channels.
-    */
-   enum ossimTwoColorMultiViewOutputSource
-   {
-      UNKNOWN = 0,
-      MIN     = 1,
-      OLD     = 2,
-      NEW     = 3
-   };
-   
-   ossimTwoColorView();
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-   /**
-    * @return the requested region of interest
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-   ossimScalarType getOutputScalarType() const;
-   
-   double getNullPixelValue(ossim_uint32 band)const;
-   double getMinPixelValue(ossim_uint32 band)const;
-   double getMaxPixelValue(ossim_uint32 band)const;
-   
-   /**
-    * @brief Sets which bands to use from inputs, and which inputs to use for
-    * output red, green and blue channels.
-    *
-    * This method does no error checking as the inputs may or may not be set
-    * prior to this call.  ossimTwoColorView::initialize() will verify once
-    * inputs are established.  So if an input band is out of range band
-    * 0 (first band) will be used.
-    *
-    * Callers should ensure initialize is called after this.
-    *
-    * @param oldInputBandIndex Zero based band index for old input. Default=0
-    * * 
-    * @param newInputBandIndex Zero based band index for new input. Default=0.
-    * 
-    * @param redOutputSource default=OLD.  Can be:
-    *    ossimTwoColorMultiViewOutputSource::OLD
-    *    ossimTwoColorMultiViewOutputSource::NEW
-    *    ossimTwoColorMultiViewOutputSource::MIN
-    *    
-    * @param grnOutputSource default=NEW.  Can be:
-    *    ossimTwoColorMultiViewOutputSource::OLD
-    *    ossimTwoColorMultiViewOutputSource::NEW
-    *    ossimTwoColorMultiViewOutputSource::MIN
-    *    
-    * @param bluOutputSource default=NEW.  Can be:
-    *    ossimTwoColorMultiViewOutputSource::OLD
-    *    ossimTwoColorMultiViewOutputSource::NEW
-    *    ossimTwoColorMultiViewOutputSource::MIN   
-    */
-   void setBandIndexMapping(
-      ossim_uint32 oldInputBandIndex,
-      ossim_uint32 newInputBandIndex,
-      ossimTwoColorMultiViewOutputSource redOutputSource,
-      ossimTwoColorMultiViewOutputSource grnOutputSource,
-      ossimTwoColorMultiViewOutputSource bluOutputSource);
-
-   virtual void initialize();
-   
-protected:
-   void allocate();
-   void runAlgorithm(ossimImageData* newData, ossimImageData* oldData);
-   void runNative8(ossimImageData* newData,   ossimImageData* oldData);
-   void runNorm(ossimImageData* newData,   ossimImageData* oldData);
-   
-   bool                               m_byPassFlag;
-   bool                               m_nativeFlag;
-   ossimRefPtr<ossimImageData>        m_twoColorTile;
-   ossimRefPtr<ossimImageSource>      m_newInput;
-   ossimRefPtr<ossimImageSource>      m_oldInput;
-   ossim_uint32                       m_newInputBandIndex;
-   ossim_uint32                       m_oldInputBandIndex;
-   ossimTwoColorMultiViewOutputSource m_redSource;
-   ossimTwoColorMultiViewOutputSource m_grnSource;
-   ossimTwoColorMultiViewOutputSource m_bluSource;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimTwoColorView_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimU11ImageData.h b/ossim/include/ossim/imaging/ossimU11ImageData.h
deleted file mode 100644
index d0d4d12..0000000
--- a/ossim/include/ossim/imaging/ossimU11ImageData.h
+++ /dev/null
@@ -1,189 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Class declaration of ossimU16ImageData.  Specialized image data object for
-// unsigned short data with an 11 bit depth.
-//
-// NOTE:  This object is optimized for unsigned short data and assumes the
-//        following:  null pixel value  = 0.0
-//                    min  pixel value  = 1.0
-//                    max  pixel value  = 2047.0  (2^11 - 1)
-//
-//        If you want anything else use the less efficient ossimImageData.
-//
-//*************************************************************************
-// $Id: ossimU11ImageData.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimU11ImageData_HEADER
-#define ossimU11ImageData_HEADER
-
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimNormalizedU11RemapTable.h>
-
-class OSSIMDLLEXPORT ossimU11ImageData : public ossimImageData
-{
-public:
-   ossimU11ImageData(ossimSource* source,
-                     ossim_uint32 bands = 1);
-
-   ossimU11ImageData(ossimSource* source,
-                     ossim_uint32 bands,
-                     ossim_uint32 width,
-                     ossim_uint32 height);
-
-   ossimU11ImageData(const ossimU11ImageData &rhs);
-   
-
-   virtual ossimObject* dup()const;
-
-   /*!
-    * will fill the entire band with
-    * the value.
-    */
-   void fill(ossim_uint32 band, double value);
-
-   bool isNull(ossim_uint32 offset)const;
-   void setNull(ossim_uint32 offset);
-
-   virtual ossimDataObjectStatus validate() const;
-
-   /*!
-    * will go to the band and offset and compute the
-    * normalized float and return it back to the
-    * caller through the result argument.
-    */
-   virtual void getNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float& result)const;
-
-   /*!
-    * This will assign to this object a normalized
-    * value by unnormalizing to its native type.
-    */
-   virtual void setNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float input);
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedFloat(ossimImageData* result)const;
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedDouble(ossimImageData* result)const;
-
-   /*!
-    * Will take the normalized input and convert it
-    * to this tile's data type.  Example:  if this
-    * tile is of type UCHAR and its input is of type
-    * NORALIZED_FLOAT it will unnormalize the data by
-    * doing:
-    *
-    * minPix + normalizedInput*(maxPix-minPix)
-    *
-    * on a per band basis.
-    */
-   virtual void unnormalizeInput(ossimImageData* normalizedInput);
-
-   /*!
-    * This will compute the average value for the band.
-    */
-   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
-
-   /*!
-    * This will call the compute average band value and then
-    * use that in the calculation of:
-    
-    * It will then do a SUM[(Mean - Actual)^2]/width*height.
-    *
-    * This is the average variance from the passed in
-    * mean.  Basically think of the mean as a completely
-    * grey image and we would like to see how this
-    * image varies from the passed in mean.
-    */
-   virtual double computeMeanSquaredError(double meanValue,
-                                          ossim_uint32 bandNumber = 0);
-
-   virtual void setValue(long x, long y, double color);
-
-   /*!
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(double* buf) const;
-   
-   /*!
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(double* buf);
-
-   /*!
-    * Will copy this tiles specified band number to the normalized buffer.
-    * if the band is out of range then nothing is done and returns.
-    */
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
-                                           double* buf) const;
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band,
-                                           float* buf)const;
-
-      /*!
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(float* buf) const;
-   
-   /*!
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(float* buf);
-
-   /*!
-    * Will copy the normalized buffer to this tiles
-    * specified band.  If band is out of range then nothing
-    * is done and returns.
-    */
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           double* buf);
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           float* buf);
-
-   /** @return The first non-null index of the normalized remap table. */
-   virtual ossim_float64 getMinNormalizedPix() const;
-
-protected:
-   virtual ~ossimU11ImageData();
-   ossimU11ImageData();
-
-private:
-
-   static const ossimNormalizedU11RemapTable m_remapTable;
-   
-TYPE_DATA
-};
-
-inline ossim_float64 ossimU11ImageData::getMinNormalizedPix() const
-{
-   return m_remapTable[1];
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimU16ImageData.h b/ossim/include/ossim/imaging/ossimU16ImageData.h
deleted file mode 100644
index 61c7ee5..0000000
--- a/ossim/include/ossim/imaging/ossimU16ImageData.h
+++ /dev/null
@@ -1,193 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Class declaration of ossimU16ImageData.  Specialized image data object for
-// unsigned short data.
-//
-// NOTE:  This object is optimized for unsigned short data and assumes the
-//        following:  null pixel value  = 0.0
-//                    min  pixel value  = 1.0
-//                    max  pixel value  = 65536.0  (2^16 - 1)
-//
-//        If you want anything else use the less efficient ossimImageData.
-//
-//*************************************************************************
-// $Id: ossimU16ImageData.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimU16ImageData_HEADER
-#define ossimU16ImageData_HEADER
-
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimNormalizedU16RemapTable.h>
-
-class OSSIMDLLEXPORT ossimU16ImageData : public ossimImageData
-{
-public:
-   ossimU16ImageData(ossimSource* source,
-                     ossim_uint32 bands = 1);
-
-   ossimU16ImageData(ossimSource* source,
-                    ossim_uint32 bands,
-                    ossim_uint32 width,
-                    ossim_uint32 height);
-
-   ossimU16ImageData(const ossimU16ImageData &rhs);
-
-
-   /*!
-    * Perform object duplication.
-    */
-   virtual ossimObject* dup()const;
-
-   /*!
-    * will fill the entire band with
-    * the value.
-    */
-   void fill(ossim_uint32 band, double value);
-
-   /*!
-    * will fill all bands with the passed in
-    * value.
-    */
-   void fill(double value);
-
-   virtual ossimDataObjectStatus validate() const;
-
-   /*!
-    * will go to the band and offset and compute the
-    * normalized float and return it back to the
-    * caller through the result argument.
-    */
-   virtual void getNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float& result)const;
-
-   /*!
-    * This will assign to this object a normalized
-    * value by unnormalizing to its native type.
-    */
-   virtual void setNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float input);
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedFloat(ossimImageData* result)const;
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedDouble(ossimImageData* result)const;
-
-   /*!
-    * Will take the normalized input and convert it
-    * to this tile's data type.  Example:  if this
-    * tile is of type UCHAR and its input is of type
-    * NORALIZED_FLOAT it will unnormalize the data by
-    * doing:
-    *
-    * minPix + normalizedInput*(maxPix-minPix)
-    *
-    * on a per band basis.
-    */
-   virtual void unnormalizeInput(ossimImageData* normalizedInput);
-
-   /*!
-    * This will compute the average value for the band.
-    */
-   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
-
-   /*!
-    * This will call the compute average band value and then
-    * use that in the calculation of:
-    
-    * It will then do a SUM[(Mean - Actual)^2]/width*height.
-    *
-    * This is the average variance from the passed in
-    * mean.  Basically think of the mean as a completely
-    * grey image and we would like to see how this
-    * image varies from the passed in mean.
-    */
-   virtual double computeMeanSquaredError(double meanValue,
-                                          ossim_uint32 bandNumber = 0);
-
-   virtual void setValue(long x, long y, double color);
-   
-   /*!
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(double* buf) const;
-   
-   /*!
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(double* buf);
-
-   /*!
-    * Will copy this tiles specified band number to the normalized buffer.
-    * if the band is out of range then nothing is done and returns.
-    */
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, double* buf) const;
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, float* buf)const;
-
-   /*!
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(float* buf) const;
-   
-   /*!
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(float* buf);
-
-   /*!
-    * Will copy the normalized buffer to this tiles
-    * specified band.  If band is out of range then nothing
-    * is done and returns.
-    */
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           double* buf);
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           float* buf);
-
-   /** @return The first non-null index of the normalized remap table. */
-   virtual ossim_float64 getMinNormalizedPix() const;
-   
-protected:
-   virtual ~ossimU16ImageData();
-   ossimU16ImageData();
-
-private:
-
-   static const ossimNormalizedU16RemapTable m_remapTable;
-   
-TYPE_DATA
-};
-
-inline ossim_float64 ossimU16ImageData::getMinNormalizedPix() const
-{
-   return m_remapTable[1];
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimU8ImageData.h b/ossim/include/ossim/imaging/ossimU8ImageData.h
deleted file mode 100644
index d37d35f..0000000
--- a/ossim/include/ossim/imaging/ossimU8ImageData.h
+++ /dev/null
@@ -1,176 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Class declaration of ossimU8ImageData.  Specialized image data object for
-// unsigned char data.
-//
-// NOTE:  This object is optimized for unsigned char data and assumes the
-//        following:  null pixel value  = 0.0
-//                    min  pixel value  = 1.0
-//                    max  pixel value  = 255.0
-//
-//        If you want anything else use the less efficient ossimImageData.
-//
-//*************************************************************************
-// $Id: ossimU8ImageData.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimU8ImageData_HEADER
-#define ossimU8ImageData_HEADER
-
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimNormalizedU8RemapTable.h>
-
-class OSSIMDLLEXPORT ossimU8ImageData : public ossimImageData
-{
-public:
-   ossimU8ImageData(ossimSource* source=NULL,
-                    ossim_uint32 bands = 1);
-   
-   ossimU8ImageData(ossimSource* source,
-                    ossim_uint32 bands,
-                    ossim_uint32 width,
-                    ossim_uint32 height);
-   
-   ossimU8ImageData(const ossimU8ImageData& rhs)
-      :ossimImageData(rhs)
-      {}
-
-
-   virtual ossimObject* dup()const;
-
-   /*!
-    * will fill the entire band with
-    * the value.
-    */
-   void fill(ossim_uint32 band, double value);
-   void fill(double value);
-
-   bool isNull(ossim_uint32 offset)const;
-   void setNull(ossim_uint32 offset);
-
-   virtual ossimDataObjectStatus validate() const;
-
-   /*!
-    * will go to the band and offset and compute the
-    * normalized float and return it back to the
-    * caller through the result argument.
-    */
-   virtual void getNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float& result)const;
-
-   /*!
-    * This will assign to this object a normalized
-    * value by unnormalizing to its native type.
-    */
-   virtual void setNormalizedFloat(ossim_uint32 offset,
-                                   ossim_uint32 bandNumber,
-                                   float input);
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedFloat(ossimImageData* result)const;
-   
-   /*!
-    * Will use the memory that you pass in to normalize
-    * this data object.
-    */
-   virtual void convertToNormalizedDouble(ossimImageData* result)const;
-
-   /*!
-    * Will take the normalized input and convert it
-    * to this tile's data type.  Example:  if this
-    * tile is of type UCHAR and its input is of type
-    * NORALIZED_FLOAT it will unnormalize the data by
-    * doing:
-    *
-    * minPix + normalizedInput*(maxPix-minPix)
-    *
-    * on a per band basis.
-    */
-   virtual void unnormalizeInput(ossimImageData* normalizedInput);
-
-   /*!
-    * This will compute the average value for the band.
-    */
-   virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
-
-   /*!
-    * This will call the compute average band value and then
-    * use that in the calculation of:
-    
-    * It will then do a SUM[(Mean - Actual)^2]/width*height.
-    *
-    * This is the average variance from the passed in
-    * mean.  Basically think of the mean as a completely
-    * grey image and we would like to see how this
-    * image varies from the passed in mean.
-    */
-   virtual double computeMeanSquaredError(double meanValue,
-                                          ossim_uint32 bandNumber = 0);
-  
-   virtual void setValue(ossim_int32 x, ossim_int32 y, double color);
-
-   /*!
-    * Copies entire tile to buf passed in.  Data put in buf is normalized.
-    * The "buf" passed to method is assumed to be at least as big as:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyTileToNormalizedBuffer(double* buf) const;
-   virtual void copyTileToNormalizedBuffer(float* buf) const;
-
-   /*!
-    * Will copy this tiles specified band number to the normalized buffer.
-    * if the band is out of range then nothing is done and returns.
-    */
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, double* buf) const;
-   virtual void copyTileToNormalizedBuffer(ossim_uint32 band, float* buf)const;
-
-   /*!
-    * Copies buf passed in to tile.  Data is unnormalized to the tile's
-    * scalar type.
-    * The "buf" passed to method is assumed to be at least as big as the tiles:
-    * "getSize() * sizeof(double)"
-    */
-   virtual void copyNormalizedBufferToTile(double* buf);
-   virtual void copyNormalizedBufferToTile(float* buf);
-
-   /*!
-    * Will copy the normalized buffer to this tiles
-    * specified band.  If band is out of range then nothing
-    * is done and returns.
-    */
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           double* buf);
-   virtual void copyNormalizedBufferToTile(ossim_uint32 band,
-                                           float* buf);
-
-   /** @return The first non-null index of the normalized remap table. */   
-   virtual ossim_float64 getMinNormalizedPix() const;
-   
-protected:
-   virtual ~ossimU8ImageData();
-
-private:
-
-   static const ossimNormalizedU8RemapTable m_remapTable;
-   
-TYPE_DATA
-};
-
-inline ossim_float64 ossimU8ImageData::getMinNormalizedPix() const
-{
-   return m_remapTable[1];
-}
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimUsgsDemTileSource.h b/ossim/include/ossim/imaging/ossimUsgsDemTileSource.h
deleted file mode 100644
index f66d3de..0000000
--- a/ossim/include/ossim/imaging/ossimUsgsDemTileSource.h
+++ /dev/null
@@ -1,195 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Contains class declaration of ossimUsgsDemTileSource.
-// The ossimUsgsDemTileSource class is derived from ossimImageHandler and
-// is intended to be an image handler for USGS dem files.
-//
-//********************************************************************
-// $Id: ossimUsgsDemTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimUsgsDemTileSource_HEADER
-#define ossimUsgsDemTileSource_HEADER
-
-#include <ossim/imaging/ossimImageHandler.h>
-
-class ossimImageData;
-class ossimDemGrid;
-
-class OSSIM_DLL ossimUsgsDemTileSource : public ossimImageHandler
-{
-public:
-      
-   ossimUsgsDemTileSource();
-
-   virtual ossimString getShortName() const;
-   virtual ossimString getLongName()  const;
-
-   /**
-    *  Returns true if the "theImageFile can be opened.
-    *
-    *  If the extension is not equal to ".dem" this will attempt to look for
-    *  an ".omd" file with the keyword pair "dem_type:  usgs_dem" in it.
-    *
-    *  Optionally users can change the scalar type from signed 16 bit to
-    *  float with the keyword pair "scalar_type: ossim_float32"
-    */
-   virtual bool open();
-
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-
-   /**
-    * Method to get a tile.   
-    *
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    *
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-   
-   /**
-    *  Returns the number of bands in the image.
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfInputBands()  const;
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-   
-   /**
-    *  Returns the number of lines in the image.
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    *  Returns the number of samples in the image.  
-    *  Satisfies pure virtual requirement from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
-
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   /**
-    * Returns the zero based image rectangle for the reduced resolution data
-    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
-    */
-   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
-   
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    *
-    * Keywords picked up by this method:
-    * dem_type: usgs_dem
-    * scalar_type: ossim_sint16 (default)
-    * or
-    * scalar_type: ossim_float32
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   
-   /**
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /**
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-
-   /**
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;   
-
-   virtual bool isOpen()const;
-   
-   /**
-    * Override base-class method to make sure the internal geometry is explored before extending.
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-protected:
-
-   /**
-    * @brief Initializes theGeometry from USGS DEM header.
-    *
-    * This is called by base ossimImageHandler::getImageGeometry if
-    * theGeometry is not set.  External callers should not go through this
-    * method but call "getImageGeometry" instead for efficiency reasons.
-    * 
-    * @return Pointer to geometry or null if header not found.
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getInternalImageGeometry() const;
-   
-   virtual ~ossimUsgsDemTileSource();
-   // Disallow operator= and copy constrution...
-   const ossimUsgsDemTileSource& operator=(const  ossimUsgsDemTileSource& rhs);
-   ossimUsgsDemTileSource(const ossimUsgsDemTileSource&);
-   
-   /**
-    *  Returns true on success, false on error.
-    */
-   template <class T> bool fillBuffer(T, // dummy template variable
-                                      const ossimIrect& tile_rect,
-                                      const ossimIrect& clip_rect,
-                                      ossimImageData* tile);
-
-   void gatherStatistics();
-
-   ossimDemGrid*               theDem;
-   ossimRefPtr<ossimImageData> theTile;
-   ossim_float64               theNullValue;
-   ossim_float64               theMinHeight;
-   ossim_float64               theMaxHeight;
-   bool                        theFeetFlag;  // elevation units = feet
-   bool                        theIsDemFlag;
-
-   /**
-    * This can be either OSSIM_SINT16 or OSSIM_FLOAT32.  Default = OSSIM_SINT16
-    * Can be changed via ".omd" file keyword:
-    */
-   ossimScalarType             theScalarType;
-   
-TYPE_DATA
-};
-
-#endif  // #ifndef ossimUsgsDemTileSource_HEADER
-
diff --git a/ossim/include/ossim/imaging/ossimValueAssignImageSourceFilter.h b/ossim/include/ossim/imaging/ossimValueAssignImageSourceFilter.h
deleted file mode 100644
index aad6f52..0000000
--- a/ossim/include/ossim/imaging/ossimValueAssignImageSourceFilter.h
+++ /dev/null
@@ -1,103 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimValueAssignImageSourceFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimValueAssignImageSourceFilter_HEADER
-#define ossimValueAssignImageSourceFilter_HEADER
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/**
- * This allows one to assign a value to a group of bands.  It will test
- * for equality band separate or as group. For example:
- *
- * if we are testing as a group then the assign will not happen unless
- * all values equal theInputValue array
- *
- *  inputValue = <1, 2, 3>
- *  outputValue = <100, 100, 100>
- *
- *  then it will only convert to 100, 100, 100 if the input equals all
- *  values of the output.
- *
- * input <1, 55, 3>  would become <1, 55, 3>
- * input <1, 2, 3>   would become <100, 100, 100>
- *
- *  Now for band separate it means you want to change on a per band and
- *  not as a group.  For example:
- *
- * inputValue = <1, 2, 3>
- * outputValue = <100, 100, 100>
- *
- * input <1, 55, 3>  would become <100, 55, 100>
- *
- */
-class OSSIMDLLEXPORT ossimValueAssignImageSourceFilter : public ossimImageSourceFilter
-{
-public:
-   enum ossimValueAssignType
-   {
-      ossimValueAssignType_SEPARATE = 1,
-      ossimValueAssignType_GROUP    = 2
-   };
-   
-   ossimValueAssignImageSourceFilter(ossimObject* owner=NULL);
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                   ossim_uint32 resLevel=0);
-
-   void setInputOutputValues(const vector<double>& inputValues,
-                             const vector<double>& outputValues);
-
-   const vector<double>& getInputValues()const;
-   const vector<double>& getOutputValues()const;
-   ossimValueAssignType getValueAssignType()const;
-   void setValueAssignType(ossimValueAssignType type);
-
-   virtual void initialize();
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=NULL)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=NULL);
-   
-protected:
-   virtual ~ossimValueAssignImageSourceFilter();
-
-   /**
-    * Called on first getTile, will initialize all data needed.
-    */
-   void allocate();
-   
-   vector<double>              theInputValueArray;
-   vector<double>              theOutputValueArray;
-   ossimValueAssignType        theAssignType;
-   ossimRefPtr<ossimImageData> theTile;
-   
-   void validateArrays();
-   
-   template <class T>
-      void executeAssign(T, ossimRefPtr<ossimImageData>& data);
-   
-   template <class T>
-      void executeAssignSeparate(T, ossimRefPtr<ossimImageData>& data);
-   
-   template <class T>
-      void executeAssignGroup(T, ossimRefPtr<ossimImageData>& data);
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimValueAssignImageSourceFilter_HEADER */
-
diff --git a/ossim/include/ossim/imaging/ossimVpfAnnotationCoverageInfo.h b/ossim/include/ossim/imaging/ossimVpfAnnotationCoverageInfo.h
deleted file mode 100644
index 954e3bd..0000000
--- a/ossim/include/ossim/imaging/ossimVpfAnnotationCoverageInfo.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//*************************************************************************
-// Copyright (C) 2004 Intelligence Data Systems, Inc.  All rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//**************************************************************************
-// $Id: ossimVpfAnnotationCoverageInfo.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimVpfAnnotationCoverageInfo_HEADER
-#define ossimVpfAnnotationCoverageInfo_HEADER
-#include <ossim/imaging/ossimVpfAnnotationFeatureInfo.h>
-#include <ossim/vec/ossimVpfCoverage.h>
-class ossimVpfLibrary;
-
-class ossimRgbImage;
-
-class ossimVpfAnnotationCoverageInfo
-{
-public:
-  ossimVpfAnnotationCoverageInfo(const ossimString& name="")
-    :theName(name)
-  {
-    
-  }
-  virtual ~ossimVpfAnnotationCoverageInfo()
-  {
-    deleteAllFeatures();
-  }
-  bool hasRenderableFeature()const;
-  void getEnabledFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result);
-  void getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result);
-
-  void transform(ossimImageGeometry* geom);
-  ossimIrect getBoundingProjectedRect()const;
-  void buildCoverage();
-  void buildCoverage(const ossimString& feature);
-  void setName(const ossimString& name)
-  {
-    theName = name;
-  }
-  ossimString getName()const
-     {
-        return theName;
-     }
-  void setLibrary(ossimVpfLibrary* library)
-  {
-    theLibrary = library;
-  }
-  ossimVpfLibrary* getLibrary()
-  {
-    return theLibrary;
-  }
-  const ossimVpfLibrary* getLibrary()const
-  {
-    return theLibrary;
-  }
-  void drawAnnotations(ossimRgbImage* tile);
-   void deleteAllFeatures();
-
-  virtual bool saveState(ossimKeywordlist& kwl,
-			 const char* prefix=0)const;
-  virtual bool loadState(const ossimKeywordlist& kwl,
-			 const char* prefix=0);
-protected:
-  ossimString theName;
-
-  /*!
-   * Not owned.
-   */
-  ossimVpfLibrary* theLibrary;
-  std::vector<ossimVpfAnnotationFeatureInfo*>           theFeatureInfoArray;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h b/ossim/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h
deleted file mode 100644
index 229592a..0000000
--- a/ossim/include/ossim/imaging/ossimVpfAnnotationFeatureInfo.h
+++ /dev/null
@@ -1,230 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimVpfAnnotationFeatureInfo.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimVpfAnnotationFeatureInfo_HEADER
-#define ossimVpfAnnotationFeatureInfo_HEADER
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimGeoPolygon.h>
-#include <ossim/imaging/ossimGeoAnnotationObject.h>
-#include <ossim/vec/ossimVpfCoverage.h>
-#include <ossim/base/ossimFontInformation.h>
-
-class ossimGeoAnnotationObject;
-class ossimVpfCoverage;
-class ossimVpfFeatureClassSchema;
-class ossimPolyLine;
-
-class OSSIMDLLEXPORT ossimVpfAnnotationFeatureInfo : public ossimObject
-{
-public:
-  enum ossimVpfAnnotationFeatureType
-    {
-      ossimVpfAnnotationFeatureType_UNKNOWN  = 0,
-      ossimVpfAnnotationFeatureType_POINT    = 1,
-      ossimVpfAnnotationFeatureType_LINE     = 2,
-      ossimVpfAnnotationFeatureType_POLYGON  = 3,
-      ossimVpfAnnotationFeatureType_TEXT     = 4,
-    };
-
-  ossimVpfAnnotationFeatureInfo(const ossimString& featureName   = "",
-				const ossimRgbVector& penColor   = ossimRgbVector(255,255,255),
-				const ossimRgbVector& brushColor = ossimRgbVector(255,255,255),
-                                const ossimDpt& pointRadius=ossimDpt(1,1),
-                                int   thickness=0,
-				bool enabledFlag = true);
-  ~ossimVpfAnnotationFeatureInfo();
-
-  void setCoverage(const ossimVpfCoverage& coverage)
-  {
-    theCoverage = coverage;
-  }
-
-  const ossimVpfCoverage& getCoverage()const
-  {
-    return theCoverage;
-  }
-  ossimVpfCoverage& getCoverage()
-  {
-    return theCoverage;
-  }
-
-   void setColor(const ossimRgbVector& color)
-      {
-         setPenColor(color);
-         setBrushColor(color);
-      }
-  void setPenColor(const ossimRgbVector& penColor)
-  {
-    thePenColor = penColor;
-  }
-
-  ossimRgbVector getPenColor()const
-  {
-    return thePenColor;
-  }
-
-  void setBrushColor(const ossimRgbVector& brushColor)
-  {
-    theBrushColor = brushColor;
-  }
-
-  ossimRgbVector getBrushColor()const
-  {
-    return theBrushColor;
-  }
-
-  void setFillEnabledFlag(bool flag)
-  {
-     theFillEnabledFlag = flag;
-  }
-  bool getFillEnabledFlag()const
-  {
-     return theFillEnabledFlag;
-  }
-  void setEnabledFlag(bool flag);
-  bool getEnabledFlag()const
-  {
-    return theEnabledFlag;
-  }
-
-  void setThickness(int thickness)
-  {
-     theThickness = thickness;
-  }
-
-  int getThickness()const
-  {
-     return theThickness;
-  }
-  
-  void setName(const ossimString& name)
-  {
-    theName = name;
-  }
-  const ossimString& getName()const
-  {
-    return theName;
-  }
-   
-  bool isPoint()const
-  {
-     return (theFeatureType == ossimVpfAnnotationFeatureType_POINT);
-  }
-  bool isLine()const
-  {
-     return (theFeatureType == ossimVpfAnnotationFeatureType_LINE);
-  }
-  bool isPolygon()const
-  {
-     return (theFeatureType == ossimVpfAnnotationFeatureType_POLYGON);
-  }
-  bool isText()const
-  {
-     return (theFeatureType == ossimVpfAnnotationFeatureType_TEXT);
-  }
-  void getFontInformation(ossimFontInformation& fontInfo)const
-  {
-     fontInfo = theFontInformation;
-  }
-  void setFontInformation(const ossimFontInformation& fontInfo)
-  {
-     theFontInformation = fontInfo;
-  }
-
-  void setPointRadius(const ossimDpt& radius)
-  {
-    thePointRadius = radius;
-  }
-  ossimDpt getPointRadius()const
-  {
-    return thePointRadius;
-  }
-  void setDrawingFeaturesToAnnotation();
-  ossimIrect getBoundingProjectedRect()const;
-  void transform(ossimImageGeometry* proj);
-  void buildFeature();
-  void deleteAllObjects();
-  void drawAnnotations(ossimRgbImage* tile);
-
-  bool saveState(ossimKeywordlist& kwl,
-		 const char* prefix=0)const;
-  bool loadState(const ossimKeywordlist& kwl,
-		 const char* prefix=0);
-  ossimString getFeatureTypeAsString()const;
-  ossimVpfAnnotationFeatureType getFeatureTypeFromString(const ossimString& featureType)const;
-
-private:
-  void readAttributes(ossimPolyLine& polyLine, ossimVpfTable& table, int row);
-  void readAttributes(ossimGeoPolygon& polygon, ossimVpfTable& table, int row);
-
-protected:
-  ossimString                   theName;
-  ossimString                   theDescription;
-  ossimRgbVector                thePenColor;
-  ossimRgbVector                theBrushColor;
-  ossimVpfCoverage              theCoverage;
-  ossimDpt                      thePointRadius;
-  int                           theThickness; 
-  bool                          theFillEnabledFlag;
-  bool                          theEnabledFlag;
-  ossimVpfAnnotationFeatureType theFeatureType;
-  ossimFontInformation          theFontInformation;
-   
-  std::vector<ossimRefPtr<ossimGeoAnnotationObject> > theAnnotationArray;
-
-  void buildTxtFeature(const ossimFilename& table,
-                       const ossimString&   tableKey,
-                       const ossimFilename& primitive,
-                       const ossimString&   primitiveKey);
-   
-  void buildEdgFeature(const ossimFilename& table,
-                       const ossimString&   tableKey,
-		       const ossimFilename& primitive,
-		       const ossimString&   primitiveKey);
-
-  void buildPointFeature(const ossimString& primitiveName,
-			 const ossimFilename& table,
-			 const ossimString&   tableKey,
-			 const ossimFilename& primitive,
-			 const ossimString&   primitiveKey);
-  void buildFaceFeature(const ossimFilename& table,
-                        const ossimString&   tableKey,
-                        const ossimFilename& primitive,
-			const ossimString&   primitiveKey);
-  
-
-  void readEdge(ossimPolyLine& polyLine,
-		int rowNumber,
-		int colPosition,
-		ossimVpfTable& edgeTable);
-  int readTableCellAsInt (int rowNumber, // should replace calls to readRngId, readStartEdgeId with this
-			  int colNumber,
-			  ossimVpfTable& table);
-  int readRngId(int rowNumber,
-		int colNumber,
-		ossimVpfTable& faceTable);
-  int readStartEdgeId(int rowNumber,
-		      int colNumber,
-		      ossimVpfTable& rngTable);
-  void readGeoPolygon(ossimGeoPolygon& polygon,
-		      int faceId,
-		      int startEdgeId,
-		      ossimVpfTable& edgTable);
-
-  ossimDpt* getXy(vpf_table_type table, row_type row, ossim_int32 pos, ossim_int32* count);
-  int getEdgeKeyId (vpf_table_type& table, row_type& row, int col);
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimVpfTileSource.h b/ossim/include/ossim/imaging/ossimVpfTileSource.h
deleted file mode 100644
index 33c123b..0000000
--- a/ossim/include/ossim/imaging/ossimVpfTileSource.h
+++ /dev/null
@@ -1,165 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2004 Garrett Potts, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// $Id: ossimVpfTileSource.h 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-#ifndef ossimVpfTileSource_HEADER
-#define ossimVpfTileSource_HEADER
-
-#include <ossim/imaging/ossimVpfAnnotationSource.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimViewInterface.h>
-
-
-class OSSIMDLLEXPORT ossimVpfTileSource : public ossimImageHandler,
-                                          public ossimViewInterface
-{
-public:
-   
-   ossimVpfTileSource();
-
-   virtual void close();
-
-   /**
-    *  @return Returns true on success, false on error.
-    *
-    *  @note This method relies on the data member ossimImageData::theImageFile
-    *  being set.  Callers should do a "setFilename" prior to calling this
-    *  method or use the ossimImageHandler::open that takes a file name and an
-    *  entry index.
-    */   
-   virtual bool open();
-
-   /*!
-    *  Returns a pointer to a tile given an origin representing the upper
-    *  left corner of the tile to grab from the image.
-    *  Satisfies pure virtual from TileSource class.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-
-   /*!
-    *  Returns the number of bands in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-
-    /*!
-    * Returns the number of bands in a tile returned from this TileSource.
-    * Note: we are supporting sources that can have multiple data objects.
-    * If you want to know the scalar type of an object you can pass in the 
-    */
-   virtual ossim_uint32 getNumberOfOutputBands() const;
-  
-   /*!
-    *  Returns the number of bands in the image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 reduced_res_level = 0) const;
-
-   /*!
-    *  Returns the number of bands available from an image.
-    *  Satisfies pure virtual from ImageHandler class.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 reduced_res_level = 0) const;
-
-   /*!
-    * Returns the number of reduced resolution data sets (rrds).
-    * Note:  The full res image is counted as a data set so an image with no
-    *        reduced resolution data set will have a count of one.
-    */
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-
-   /*!
-    * Returns the zero based image rectangle for the reduced resolution data
-    * set (rrds) passed in.  Note that rrds 0 is the highest resolution rrds.
-    */
-   virtual ossimIrect getImageRectangle(ossim_uint32 reduced_res_level = 0) const;
-
-   /*!
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix);
-   
-   //! Returns the image geometry object associated with this tile source or NULL if non defined.
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   /*!
-    * Returns the output pixel type of the tile source.
-    */
-   virtual ossimScalarType getOutputScalarType() const;
-
-   /*!
-    * Returns the width of the output tile.
-    */
-   virtual ossim_uint32 getTileWidth() const;
-   
-   /*!
-    * Returns the height of the output tile.
-    */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /*!
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /*!
-    * Returns the tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   virtual bool isOpen()const;
-   
-   virtual double getNullPixelValue(ossim_uint32 band=0)const;
-
-   virtual double getMinPixelValue(ossim_uint32 band=0)const;
-      
-   virtual double getMaxPixelValue(ossim_uint32 band=0)const;
-
-   virtual ossimObject* getView();
-
-   virtual const ossimObject* getView()const;
-   
-   virtual bool setView(ossimObject*  baseObject);
-
-   void getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& featureList);
-  
-   void setAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& featureList);
-
-   void transformObjects();
-
-   void computeBoundingRect();
-
-protected:
-   virtual ~ossimVpfTileSource();
-   ossimRefPtr<ossimVpfAnnotationSource> m_AnnotationSource;
-   
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/imaging/ossimWatermarkFilter.h b/ossim/include/ossim/imaging/ossimWatermarkFilter.h
deleted file mode 100644
index a5f11bc..0000000
--- a/ossim/include/ossim/imaging/ossimWatermarkFilter.h
+++ /dev/null
@@ -1,348 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class declaration of ossimWatermarkFilter.
-// Applies an image or watermark to image.  Positioning is based on mode.
-// Density is base on alpha weight.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimWatermarkFilter.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimWatermarkFilter_HEADER
-#define ossimWatermarkFilter_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-
-/**
- * class ossimWatermarkFilter
- * Applies an image or watermark to image.
- * Positioning is based on mode.
- * Density is base on alpha weight.
- */
-class OSSIMDLLEXPORT ossimWatermarkFilter : public ossimImageSourceFilter
-{
-public:
-
-   enum WatermarkMode
-   {
-      UPPER_LEFT     = 0,
-      UPPER_CENTER   = 1,
-      UPPER_RIGHT    = 2,
-      CENTER         = 3,
-      LOWER_LEFT     = 4,
-      LOWER_CENTER   = 5,
-      LOWER_RIGHT    = 6,
-      UNIFORM_DENSE  = 7,
-      UNIFORM_SPARSE = 8,
-      END            = 9 //< Number of modes.
-   };
-      
-   /** contructor */
-   ossimWatermarkFilter();
-
-   /** @return Short name of filter. */
-   virtual ossimString getShortName()   const;
-
-   /** @return Long name of filter. */
-   virtual ossimString getLongName()    const;
-
-   /** @return Descriptive name of filter. */
-   virtual ossimString getDescription() const;
-
-   /**
-    * @param tile_rect Rectangle to fill tile with.
-    * 
-    * @param resLevel Reduced resolution level to grab from.
-    * 
-    * @return ossimRefPtr<ossimImageData> This is tile that was filled with
-    * tile_rect.
-    *
-    * @note Callers should check the ossimRefPtr::valid method.
-    * The internal pointer of the ossimRefPtr<ossimImageData> can be
-    * null if the tile_rect did not intersect the input connection's
-    * bounding rectangle.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
-                                               ossim_uint32 resLevel=0);
-   
-   /**
-    * Initializes state of the object from the input connection.
-    */
-   virtual void initialize();
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    *
-    * Keywords picked saved by saveState
-    * 
-    * filename: my_colormap_file.jpg
-    *
-    * weight: .25
-    * 
-    * watermark_mode:  upper_left
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /**
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.
-    *
-    * @param kwl Keyword list to initialize from.
-    *
-    * @param prefix Usually something like: "object1."
-    *
-    * @return This method will alway return true as it is intended to be
-    * used in conjuction with the set methods.
-    *
-    * Keywords picked up by loadState:
-    * 
-    * filename: my_colormap_file.jpg
-    *
-    * weight: .25
-    * 
-    * watermark_mode:  upper_left
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * @param The property to get as a string like "watermark_mode".
-    *
-    * @return ossimRefPt<ossimProperty> holding pointer to ossimProperty
-    * matching string or null pointer if string does not match.
-    *
-    * @note Internal pointer can be null so callers should check prior to
-    * accessing like:
-    * ossimRefPtr<ossimProperty> p = myFilter->getProperty(ossimString("foo"));
-    * if (p.valid() == NULL)
-    * {
-    *    some_error;
-    * }
-    */
-   virtual ossimRefPtr<ossimProperty> getProperty(
-      const ossimString& name)const;
-
-   /**
-    * Set property.
-    *
-    * @param property Property to set if property->getName() matches a
-    * property name of this object.
-    */
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-
-   /**
-    * Adds this objects properties to the list.
-    *
-    * @param propertyNames Array to add to.
-    *
-    * @note This method does not clear propertyNames prior to adding it's
-    * names.
-    */
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @param list List initialized with watermark mode strings.
-    *
-    * @note This method clears the "list" prior to stuffing.
-    */
-   void getModeList(vector<ossimString>& list) const;
-
-   /** @return theMode */
-   ossimWatermarkFilter::WatermarkMode getMode() const;
-
-   /** @return theMode as a string like "upper_left". */
-   ossimString getModeString() const;
-
-   /**
-    * Sets theFilename to file.
-    *
-    * @param file The watermark image file.
-    */
-   void setFilename(const ossimFilename& file);
-
-   /**
-    * Sets the filter mode.
-    *
-    * @param mode String representing mode.
-    */
-   void setMode(const ossimString& mode);
-
-   /**
-    * Sets the weight.
-    *
-    * @param weight Weight to use for watermark pixels normalize between
-    * 0.0 and 1.0.
-    */
-   void setWeight(ossim_float64 weight);
-   
-   /**
-    * Print method.  Called by: friend operator<<
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-   /** destructor */
-   virtual ~ossimWatermarkFilter();
-
-   /**
-    * Allocates / recomputes things that are needed.  Clears theDirtyFlag
-    * by setting it to false on success.
-    *
-    * @return true on success, false on error.
-    */
-   bool allocate();
-
-   /**
-    * Attempts to open "theFilename".  This will load "theWatermark" with
-    * the image converting it to the scalar type of the input connection.
-    *
-    * @return true on success, false if no image handler is found for the
-    * image or theInputConnection has not been established.
-    */
-   bool openWatermarkFile();
-   
-   // void verifyEnable();
-
-   /**
-    * Writes watermark(s) to theTile.
-    * Performs theTile->validate() at the end if theTile was touched.
-    */
-   template <class T> void fill(T dummy);
-
-   /**
-    * Computes the bounding rectangles.  These are the rectangles in image
-    * space of the input connection to paint the watermark(s) on.  The start of
-    * each rectangle will be the start of where "theWatermark" is painted.
-    */
-   void getIntersectingRects(vector<ossimIrect>& rects);
-
-   /**
-    * Addes upper left watermark rectangle to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getUpperLeftRect(vector<ossimIrect>& rects);
-   
-   /**
-    * Addes upper center watermark rectangle to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getUpperCenterRect(vector<ossimIrect>& rects);
-   
-   /**
-    * Addes upper right watermark rectangle to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getUpperRightRect(vector<ossimIrect>& rects);
-
-   /**
-    * Addes center watermark rectangle to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getCenterRect(vector<ossimIrect>& rects);
-
-   /**
-    * Addes lower left watermark rectangle to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getLowerLeftRect(vector<ossimIrect>& rects);
-
-   /**
-    * Addes lower center watermark rectangle to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getLowerCenterRect(vector<ossimIrect>& rects);
-   
-   /**
-    * Addes lower right watermark rectangle to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getLowerRightRect(vector<ossimIrect>& rects);
-   
-   /**
-    * Addes rectangles to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * This will repeat the watermark throughout the input bounding rect.
-    *
-    * @param rects Array to add rect to.
-    */
-   void getUniformDenseRects(vector<ossimIrect>& rects);
-   
-   /**
-    * Addes rectangles to rects if it intersects
-    * theTile rect clipped to input bounding rect.
-    *
-    * This will repeat the watermark sparsly throughout the input bounding
-    * rect.
-    * 
-    * @param rects Array to add rect to.
-    */
-   void getUniformSparceRects(vector<ossimIrect>& rects);
-   
-   /** File name of watermark image. */
-   ossimFilename      theFilename;
-
-   /** Normalized between 0.0 and 1.0. */
-   ossim_float64      theWatermarkWeight;
-
-   /** The returned tile. */
-   ossimRefPtr<ossimImageData> theTile;
-
-   /** Tile storage for watermark image. */
-   ossimRefPtr<ossimImageData> theWatermark;
-
-   /** The number of watermark bands. */
-   ossim_uint32 theWatermarkNumberOfBands;
-
-   /** The filter mode. */
-   WatermarkMode      theMode;
-
-   /** The bounding rectangle of the input connection. */
-   ossimIrect theInputBoundingRect;
-
-   /** The number of input bands. */
-   ossim_uint32 theInputNumberOfBands;
-
-   /** The input scalar type. */
-   ossimScalarType theInputScalarType;
-
-   /**
-    * Set in the initialize method this instructs the getTile that something
-    * has changes and it need to call initialize.
-    */
-   bool theDirtyFlag;
-
-
-TYPE_DATA
-      
-}; // End of class ossimWatermarkFilter.
-
-#endif /* #ifndef ossimWatermarkFilter_HEADER */
-
diff --git a/ossim/include/ossim/init/ossimInit.h b/ossim/include/ossim/init/ossimInit.h
deleted file mode 100644
index 298641f..0000000
--- a/ossim/include/ossim/init/ossimInit.h
+++ /dev/null
@@ -1,152 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// DESCRIPTION:
-//   Contains declaration of class ossimInit. This object handles all aspects
-//   of initialization for OSSIM applications. These tasks include:
-//
-//      1. Parsing the command line.
-//      2. Instantiating all class factories as declared in ossimFactories.h
-//      3. Initializing the "trace" code execution tracing functionality.
-//      4. Scanning the preferences file for relevant values.
-//
-// SOFTWARE HISTORY:
-//>
-//   24Apr2001  Oscar Kramer
-//              Initial coding.
-//<
-//*****************************************************************************
-// $Id: ossimInit.h 19440 2011-04-25 16:41:28Z dburken $
-#ifndef ossimInit_HEADER
-#define ossimInit_HEADER 1
-
-#include <ossim/base/ossimFilename.h>
-
-class ossimPreferences;
-class ossimArgumentParser;
-
-class OSSIMDLLEXPORT ossimInit
-{
-public:
-
-   ~ossimInit();
-   /*!
-    * Returns the static instance of an ossimInit object. This is of no use
-    * until non-static methods are implemented.
-    */
-   static ossimInit* instance();
-
-   void addOptions(ossimArgumentParser& parser);
-
-   /*!
-    * METHOD: initialize()
-    * This method shall be called from the application's main module with
-    * the command-line arguments. Every OSSIM application should have the
-    * following line early in the main module:
-    *
-    *   ossimInit::initialize(argc, argv);
-    *
-    * OR
-    *
-    *   ossimInit::instance()->initialize(argc, argv);
-    *
-    * The two forms are functionally identical. Pick the latter form if you
-    * like to type. The argv command line options are parsed and may be
-    * stripped. the value of argc will be adjusted to account for stripped
-    * options.
-    */
-   void initialize(int& argc, char** argv);
-
-   void initialize(ossimArgumentParser& parser);
-   
-   void initialize();
-
-   void finalize();
-
-   /*!
-    * METHOD: usage()
-    * Prints to stdout the list of command line options that this object parses
-    */
-   void usage();
-
-   /** @return theElevEnabledFlag */
-   bool getElevEnabledFlag() const;
-
-   /**
-    * @brief Sets theElevEnabledFlag.
-    * @param flag If true ossimElevManager will be initialized. Set to false
-    * to NOT initialize the ossimElevManager from preferences.
-    * Default in class is true.
-    */
-   void setElevEnabledFlag(bool flag);
-
-   void setPluginLoaderEnabledFlag(bool flag);
-
-   /**
-    * Can take a file or a directory.  If a directory is givien then it will check all files in
-    * the directory and add each file that is detected to be a valid plugin.
-    *
-    * @param plugin Is the filename of the plugin to load
-    * @param options Is a keywordlist of plugin specific options
-    
-    */ 
-   void loadPlugins(const ossimFilename& plugin, const char* options=0);
-   
-   void initializePlugins();
-   void initializeDefaultFactories();
-   void initializeElevation();
-
-   /**
-    * @brief Initializes log file from preferences keyword lookup
-    * of "ossim.log.file" if log file has not already been set and
-    * keyword is set in preferences.
-    *
-    * So this should be called after parse options as the --ossim-logfile
-    * should override any preferences setting.
-    */
-   void initializeLogFile();
-
-   /**
-    * @return The version in the form of:
-    * "version major.minor.release (yyyymmdd)"
-    * where
-    * yyyymmdd is the build date.
-    *
-    * e.g. "version 1.7.0 (20071003)"
-    */
-   ossimString version() const;
-
-   ossimFilename appName()const;
-
-protected:
-   /** protected default constructor. */
-   ossimInit();
-
-   /** Hidden from use copy constructor. */
-   ossimInit(const ossimInit& obj);
-   
-   /** Hidden from use assignment operator. */
-   void operator=(const ossimInit& rhs) const;
-   
-   void parseOptions(ossimArgumentParser& parser);
-
-   void parseNotifyOption(ossimArgumentParser& parser);
-   /*!
-    * METHOD: removeOptions()
-    * Utility for stripping from argv all characters associated with a
-    * particular option:
-    */
-   void removeOption(int&   argc, 
-                     char** argv,
-                     int    argToRemove);
-   
-   static ossimInit*  theInstance;
-   bool               theInitializedFlag;  
-   ossimFilename      theAppName;
-   ossimPreferences*  thePreferences;
-   bool               theElevEnabledFlag;
-   bool               thePluginLoaderEnabledFlag;
-};
-
-#endif
diff --git a/ossim/include/ossim/ossimConfig.h.in b/ossim/include/ossim/ossimConfig.h.in
deleted file mode 100644
index 206accd..0000000
--- a/ossim/include/ossim/ossimConfig.h.in
+++ /dev/null
@@ -1,23 +0,0 @@
-/*  $Id: ossimConfig.h.in 13607 2008-09-25 19:39:45Z gpotts $ */
-#ifndef ossimConfig_HEADER
-#define ossimConfig_HEADER
-
-/* Define to "1" if you have libz installed, "0" if not. */
-#define OSSIM_HAS_LIBZ 0
-
-/* Define to "1" if you have MPI(lam/mpi), "0" if not. */
-#define OSSIM_HAS_MPI 0
-
-/* Define to "1" if you have FREETYPE, "0" if not. */
-#define OSSIM_HAS_FREETYPE 0
-
-/* Define to "1" if you have GEOTIFF, "0" if not. */
-#define OSSIM_HAS_GEOTIFF 0
-
-/* Define to "1" if you have OpenThreads for mutex support, "0" if not. */
-#define OSSIM_HAS_OPEN_THREADS 0
-
-/* Enable cvs id strings for use with "ident" application. */
-#define OSSIM_ID_ENABLED 1
-
-#endif /* End of "#ifndef ossimConfig_HEADER" */
diff --git a/ossim/include/ossim/ossimConfig.h.vc b/ossim/include/ossim/ossimConfig.h.vc
deleted file mode 100644
index 94750da..0000000
--- a/ossim/include/ossim/ossimConfig.h.vc
+++ /dev/null
@@ -1,54 +0,0 @@
-/*  $Id: ossimConfig.h.vc 13809 2008-10-30 13:28:17Z gpotts $ */
-#ifndef ossimConfig_HEADER
-#define ossimConfig_HEADER
-
-/* Define if you have dirent.h.  */
-#define HAVE_DIRENT_H 0
-
-/* Define as 1 if you have unistd.h.  */
-#define HAVE_UNISTD_H 0
-
-/* Define as 1 if you have getopt.h.  */
-#define HAVE_GETOPT_H 0
-
-/* 
- * Define as 1 if you have fcntl.h. Note this is defined on windows in gdal.
- * #define HAVE_FCNTL_H 0 
- */
-
-/* Define as 1 if you have dbmalloc.h.  */
-#define HAVE_DBMALLOC_H 0
-
-/* Define as 1 if you have malloc.h.  */
-#define HAVE_MALLOC_H 1
-
-/* Define as 1 if you have dlfcn.h.  */
-#define HAVE_DLFCN_H 0
-
-#define OSSIM_HAS_LIBZ 1
-
-/* Define if you have support for large (64 bit size) files */
-#define HAVE_LARGEFILE_SUPPORT 0
-
-/* Define to "1" if you have MPI(lam/mpi), "0" if not. */
-#define OSSIM_HAS_MPI 0
-
-/* Define to "1" if you have FREETYPE, "0" if not. */
-#define OSSIM_HAS_FREETYPE 1
-
-/* Define to "1" if you have GEOTIFF, "0" if not. */
-#define OSSIM_HAS_GEOTIFF 1
-
-/* Define to "1" if you have OpenThreads for mutex support, "0" if not. */
-#define OSSIM_HAS_OPEN_THREADS 1
-
-/* Enable cvs id strings for use with "ident" application. */
-#define OSSIM_ID_ENABLED 1
-
-/* Enable dynamic library support for plugins.
- * Usually set to 0 for static applications.
- */
-#define OSSIM_DYNAMIC_ENABLED 1
-
-
-#endif /* End of "#ifndef ossimConfig_HEADER" */
diff --git a/ossim/include/ossim/parallel/ossimIgen.h b/ossim/include/ossim/parallel/ossimIgen.h
deleted file mode 100644
index 12fa192..0000000
--- a/ossim/include/ossim/parallel/ossimIgen.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Class declaration for image generator.
-//
-//*************************************************************************
-// $Id: ossimIgen.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimIgen_HEADER
-#define ossimIgen_HEADER
-
-#include <iostream>
-#include <list>
-#include <fstream>
-
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimConnectableContainer.h>
-#include <ossim/imaging/ossimTiling.h>
-
-class ossimImageChain;
-class ossimImageFileWriter;
-class ossimMapProjection;
-class ossimImageViewTransform;
-class ossimImageSource;
-class ossimImageMpiMWriterSequenceConnection;
-class ossimImageMpiSWriterSequenceConnection;
-class ossimObject;
-class ossimArgumentParser;
-
-class OSSIM_DLL ossimIgen : public ossimReferenced
-{
-public:
-   ossimIgen();
-   virtual ~ossimIgen();
-
-   virtual void initialize(const ossimKeywordlist& kwl);
-   virtual void outputProduct();
-   
-protected:
-   void initializeAttributes();
-   void slaveSetup();
-   bool loadProductSpec();
-   void setView();
-   void initThumbnailProjection();
-   void initializeChain();
-   bool writeToFile(ossimImageFileWriter* writer);
-
-   ossimRefPtr<ossimConnectableContainer> theContainer;
-   ossimRefPtr<ossimMapProjection>  theProductProjection;
-   ossimRefPtr<ossimImageChain>  theProductChain;
-   ossimRefPtr<ossimTiling>      theTiling;
-   ossimDrect        theOutputRect;
-   bool              theBuildThumbnailFlag;
-   ossimIpt          theThumbnailSize;
-   long              theNumberOfTilesToBuffer;
-   ossimKeywordlist  theKwl;
-   bool              theTilingEnabled;
-   bool              theProgressFlag;
-   bool              theStdoutFlag;
-   ossim_uint32      theThreadCount;
-
-};
-
-#endif
-
diff --git a/ossim/include/ossim/parallel/ossimImageChainMtAdaptor.h b/ossim/include/ossim/parallel/ossimImageChainMtAdaptor.h
deleted file mode 100644
index 81576d6..0000000
--- a/ossim/include/ossim/parallel/ossimImageChainMtAdaptor.h
+++ /dev/null
@@ -1,123 +0,0 @@
-//*************************************************************************************************
-//                                            OSSIM
-//
-// License: MIT
-//
-// Author: Oscar Kramer
-//
-//*************************************************************************************************
-// $Id$
-#ifndef ossimImageChainMtAdaptor_HEADER
-#define ossimImageChainMtAdaptor_HEADER
-
-#include <vector>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
-#include <ossim/base/ossimId.h>
-#include <ossim/base/ossimConnectableContainer.h>
-
-//*************************************************************************************************
-//! This class supports multi-threading of image chain getTile() requests and associated chain
-//! updating. It accepts an original ossimImageChain object which is then cloned (replicated). 
-//! One clone per thread is created, counting the original as clone(0), with all clones
-//! sharing a common input handler (if directed) so that disk access is serialized and thread-safe.
-//*************************************************************************************************
-class OSSIMDLLEXPORT ossimImageChainMtAdaptor : public ossimImageChain
-{
-   friend class ossimMultiThreadSequencer; //### FOR DEBUG ONLY
-
-public:
-   ossimImageChainMtAdaptor();
-
-   //! Full constructor accepts the original image chain to clone. 
-   //! @param num_threads  Total number of cloned chains to make available.
-   //! 
-   ossimImageChainMtAdaptor(ossimImageChain* original, ossim_uint32 num_threads=0);
-   ~ossimImageChainMtAdaptor();
-
-   //! Alternate way of specifying number of threads to support. This is the same as the number of 
-   //! clones that will be available after replicating the original chain. 
-   //! @param num_threads  Total number of cloned chains to make available.
-   void setNumberOfThreads(ossim_uint32 num_threads);
-
-   //! Alternate way of specifying the original chain being adapted for multi-threading.
-   //! @param original  Image chain to be adapted.
-   void setOriginalChain(ossimImageChain* original);
-
-   //! Intercepts the getTile because it should never be called directly. The tile request must go
-   //! to the specific chain clone.
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
-                                               ossim_uint32 resLevel=0);
-   
-   //! Adapts call to original chain so that all clones are initialized.
-   virtual void initialize();
-
-   //! Adapts call to original chain so that clones are replicated after original's loadState.
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=NULL);
-
-   //! Adapts call to original chain so that adapter-specific keywords can be added to KWL.
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=NULL)const;
-
-   //! Adapts the image chain event handler. If the event involves a change to the original image 
-   //! chain, then the clones will need to be regenerated here.
-   virtual void processEvent(ossimEvent& event);
-
-   //! Returns pointer to a specific clone image chain, or NULL if index exceeds the max available.
-   //! The clone at index=0 corresponds to the original, though this detail should be ignored.
-   ossimImageSource* getClone(ossim_uint32 index);
-
-   //! Returns the number of clones available. The original chain always counts as the first clone.
-   ossim_uint32 getNumberOfClones() const { return (ossim_uint32) m_clones.size(); }
-
-   //! These overriding access methods greatly facilitate the implementation of an image chain
-   //! adapter class operating on the member original chain. These methods really should be 
-   //! "protected" but the compiler complains if the base class declarations are "protected".
-   virtual ossimConnectableObject::ConnectableObjectList& imageChainList();
-   virtual const ossimConnectableObject::ConnectableObjectList& imageChainList() const;
-
-   //! Overrides base class implementation in order to make the connection to each clone. This 
-   //! connection is typically to the multi-thread sequencer object.
-   virtual ossim_int32 connectMyOutputTo(ossimConnectableObject* outputObject,
-                                         bool makeInputConnection=true,
-                                         bool createEventFlag=true);
-
-protected:
-   //! Deletes instances of all replicas from the clone list and leaves only the original.
-   void deleteReplicas();
-
-   //! Creates clones of original and pushes them onto the clone list. Returns TRUE if successful.
-   bool replicate();
-
-   //! Manages reconnecting shared image handlers to a cloned image chain (identified by index)
-   //! after its creation. This is in support of shared image handlers. Returns TRUE if successful.
-   bool connectSharedHandlers(ossim_uint32 index);
-
-   //! This is the adaptee image chain.
-   ossimRefPtr<ossimImageChain> m_adaptedChain;
-
-   //! List of replicated child chains' first source (the one receiving the getTile call). The
-   //! first in the list is always the original (adaptee) source. These are owned by the 
-   //! m_chainContainers that are maintained here.
-   std::vector< ossimRefPtr<ossimImageSource> > m_clones;
-   
-   //! The container objects must be kept alive in this vector while their child chains in
-   //! m_clones are used. Containers are used because they are the only way of "duping" a complete 
-   //! chain with all connections properly done. The containers need to persist in order for the 
-   //! chain connections to be maintained (apparent bug in connectable object code). I found it 
-   //! impossible to dissociate the chain from its container. As soon as the container disappeared,
-   //! the chain's internal connections would be disrupted. (OLK 11/11)
-   std::vector< ossimRefPtr<ossimConnectableContainer> > m_chainContainers;
-
-   //! List of handlers that are being shared among all clones (if requested). It is a list since 
-   //! the original chain may involve a combiner with multiple image inputs.
-   typedef std::vector<ossimRefPtr<ossimImageHandlerMtAdaptor> > SharedHandlerList;
-   SharedHandlerList m_sharedHandlers;
-
-   ossim_uint32 m_numThreads;
-
-   bool d_useSharedHandlers;
-   bool d_debugEnabled;
-
-};
-#endif /* #ifndef ossimImageChain_HEADER */
-
diff --git a/ossim/include/ossim/parallel/ossimImageHandlerMtAdaptor.h b/ossim/include/ossim/parallel/ossimImageHandlerMtAdaptor.h
deleted file mode 100644
index ecf44ad..0000000
--- a/ossim/include/ossim/parallel/ossimImageHandlerMtAdaptor.h
+++ /dev/null
@@ -1,101 +0,0 @@
-//**************************************************************************************************
-//                          OSSIM -- Open Source Software Image Map
-//
-// LICENSE: See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-//**************************************************************************************************
-//  $Id$
-#ifndef ossimImageHandlerMtAdaptor_HEADER
-#define ossimImageHandlerMtAdaptor_HEADER 1
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimCacheTileSource.h>
-#include <OpenThreads/Thread>
-
-//**************************************************************************************************
-//! Intended mainly to provide a mechanism for mutex-locking access to a shared resource during
-//! a getTile operation on an ossimImageHandler. This is needed for multi-threaded implementation.
-//**************************************************************************************************
-class OSSIMDLLEXPORT ossimImageHandlerMtAdaptor : public ossimImageHandler
-{
-public:
-   static const char* ADAPTEE_ID_KW;
-
-   ossimImageHandlerMtAdaptor(ossimImageHandler* adaptee = 0);
-
-   //! Sets the handler being adapted.
-   void setAdaptee(ossimImageHandler* handler);
-
-   //! Only an ossimImageHandler is allowed as input here.
-   virtual bool canConnectMyInputTo(ossim_int32 i, const ossimConnectableObject* obj) const;
-
-   //! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
-   //! adaptee's getTile call.
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIpt& origin, ossim_uint32 resLevel=0);
-   
-   //! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
-   //! adaptee's getTile call.
-   virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& rect, ossim_uint32 resLevel=0);
-
-   //! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
-   //! adaptee's getTile call.
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-   
-   //! Method to save the state of an object to a keyword list.
-   //! Return true if ok or false on error.
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   //! Method to the load (recreate) the state of an object from a keyword
-   //! list.  Return true if ok or false on error.
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   // The following are virtuals in the base class. Implemented here as pass-through to adaptee
-   virtual ossim_uint32    getNumberOfInputBands() const;
-   virtual bool            isOpen() const;
-   virtual bool            open();
-   virtual ossim_uint32    getNumberOfLines(ossim_uint32 resLevel = 0) const;
-   virtual ossim_uint32    getNumberOfSamples(ossim_uint32 resLevel = 0) const;
-   virtual ossim_uint32    getImageTileWidth() const;
-   virtual ossim_uint32    getImageTileHeight() const;
-   virtual ossimString     getLongName()  const;
-   virtual ossimString     getShortName() const;
-   virtual void            close();
-   virtual ossim_uint32    getNumberOfOutputBands() const;
-   virtual ossim_uint32    getNumberOfDecimationLevels() const;
-   virtual ossimScalarType getOutputScalarType() const;
-   virtual ossim_uint32    getTileWidth() const;
-   virtual ossim_uint32    getTileHeight() const;
-   virtual ossim_float64   getMinPixelValue(ossim_uint32 band=0)const;
-   virtual ossim_float64   getMaxPixelValue(ossim_uint32 band=0)const;
-   virtual ossim_float64   getNullPixelValue(ossim_uint32 band=0)const;
-
-   double       d_getTileT;
-
-protected:
-   //! Protected destructor forces using reference pointer for instantiation.
-   virtual ~ossimImageHandlerMtAdaptor();
-
-   ossimRefPtr<ossimImageHandler>    m_adaptedHandler;
-   ossimRefPtr<ossimCacheTileSource> m_cache;
-   mutable OpenThreads::Mutex        m_mutex;   
-
-   bool                        d_useCache;
-   bool                        d_useFauxTile;
-   ossimRefPtr<ossimImageData> d_fauxTile;
-   friend class ossimMtDebug;
-
-TYPE_DATA
-};
-
-#endif
-
-
-
-
-
-
-
-
-
diff --git a/ossim/include/ossim/parallel/ossimImageMpiMWriterSequenceConnection.h b/ossim/include/ossim/parallel/ossimImageMpiMWriterSequenceConnection.h
deleted file mode 100644
index 413a93a..0000000
--- a/ossim/include/ossim/parallel/ossimImageMpiMWriterSequenceConnection.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// This class is specific to the Master connection and is optimized
-// for the writer sequence and batch processing chain.  For the Slave
-// implementation look for the ossimImageMpiSWriterSequenceConnection.cc and .h
-// files.  The Master connection is currently implemented to allways do
-// a recieve and does no processing itself.  The slave connection does
-// all the actual work and processing.
-//
-//*******************************************************************
-//  $Id: ossimImageMpiMWriterSequenceConnection.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageMpiMWriterSequenceConnection_HEADER
-#define ossimImageMpiMWriterSequenceConnection_HEADER
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-class ossimImageData;
-class ossimImageMpiMWriterSequenceConnection : public ossimImageSourceSequencer
-{
-public:
-   ossimImageMpiMWriterSequenceConnection(ossimObject* owner=NULL);
-   ossimImageMpiMWriterSequenceConnection(ossimImageSource* inputSource,
-                                          ossimObject* owner=NULL);
-  virtual ~ossimImageMpiMWriterSequenceConnection();
-
-   /*!
-    * This is a virtual method that can be overriden
-    * by derived classes (MPI, or PVM or other
-    * parallel connections.  This method is to indicate
-    * whether or not this connection is the master/
-    * controlling connection.
-    */
-   virtual void initialize();
-   virtual void setToStartOfSequence();
-
-   virtual bool isMaster()const
-      {
-         return true;
-      }
-   /*!
-    * Will allow you to get the next tile in the sequence.
-    */
-   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
-protected:
-   int theNumberOfProcessors;
-   int theRank;
-   bool theNeedToSendRequest;
-   ossimRefPtr<ossimImageData> theOutputTile;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/parallel/ossimImageMpiSWriterSequenceConnection.h b/ossim/include/ossim/parallel/ossimImageMpiSWriterSequenceConnection.h
deleted file mode 100644
index 810f7fd..0000000
--- a/ossim/include/ossim/parallel/ossimImageMpiSWriterSequenceConnection.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimImageMpiSWriterSequenceConnection.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageMpiSWriterSequenceConnection_HEADER
-#define ossimImageMpiSWriterSequenceConnection_HEADER
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-class ossimImageData;
-class ossimImageMpiSWriterSequenceConnection : public ossimImageSourceSequencer
-{
-public:
-   ossimImageMpiSWriterSequenceConnection(ossimObject* owner=NULL,
-                                          long numberOfTilesToBuffer = 2);
-   
-   ossimImageMpiSWriterSequenceConnection(ossimImageSource* inputSource,
-                                          ossimObject* owner=NULL,
-                                          long numberOfTilesToBuffer = 2);
-   
-  virtual ~ossimImageMpiSWriterSequenceConnection();
-   virtual bool isMaster()const
-      {
-         return false;
-      }
-
-   virtual void initialize();
-   virtual void setToStartOfSequence();
-   /*!
-    * Will allow you to get the next tile in the sequence.
-    */
-   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
-
-   virtual void slaveProcessTiles();
-   
-protected:
-   int theNumberOfProcessors;
-   int theRank;
-   int theNumberOfTilesToBuffer;
-   
-   ossimRefPtr<ossimImageData>* theOutputTile;
-
-   void deleteOutputTiles();
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/parallel/ossimMultiThreadSequencer.h b/ossim/include/ossim/parallel/ossimMultiThreadSequencer.h
deleted file mode 100644
index bd084b4..0000000
--- a/ossim/include/ossim/parallel/ossimMultiThreadSequencer.h
+++ /dev/null
@@ -1,142 +0,0 @@
-//**************************************************************************************************
-//                          OSSIM -- Open Source Software Image Map
-//
-// LICENSE: See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-//  $Id$
-//**************************************************************************************************
-#ifndef ossimMultiThreadSequencer_HEADER
-#define ossimMultiThreadSequencer_HEADER
-
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/parallel/ossimJobMultiThreadQueue.h>
-#include <ossim/parallel/ossimImageChainMtAdaptor.h>
-#include <OpenThreads/Thread>
-
-//*************************************************************************************************
-//! This class manages the sequencing of tile requests across multiple threads. Note that multi-
-//! threading can only be achieved through the use of getNextTile() method for sequencing. 
-//! Conventional getTiles will not be multi-threaded.
-//*************************************************************************************************
-class OSSIMDLLEXPORT ossimMultiThreadSequencer : public ossimImageSourceSequencer
-{
-public:
-   ossimMultiThreadSequencer(ossimImageSource* inputSource=NULL, 
-                             ossim_uint32 num_threads=0,
-                             ossimObject* owner=NULL);
-
-   virtual ~ossimMultiThreadSequencer();
-
-   //! Overrides base class implementation. This call initiates the multi-threaded getTile jobs for
-   //! the first N tiles.
-   virtual void setToStartOfSequence();
-
-   //! Overrides base class in order to implement multi-threaded tile requests. The output tile 
-   //! should be available in the tile cache, otherwise, method waits until it becomes available.
-   virtual ossimRefPtr<ossimImageData> getNextTile(ossim_uint32 resLevel=0);
-
-   //! Specifies number of thread to support. Default behavior (if this method is never called) is
-   //! to query the system for number of cores available.
-   void setNumberOfThreads(ossim_uint32 num_threads);
-
-   //! Fetches the number of threads being used. Useful when this object decides the quantity.
-   ossim_uint32 getNumberOfThreads() const { return m_numThreads; }
-
-   //! Accessed for performance logging.
-   ossim_uint32 maxCacheSize() const { return m_maxCacheSize; }
-
-   // FOR DEBUG:
-   ossim_uint32 d_maxCacheUsed;
-   ossim_uint32 d_cacheEmptyCount;
-   double       d_idleTime1;
-   double       d_idleTime2;
-   double       d_idleTime3;
-   double       d_idleTime4;
-   double       d_idleTime5;
-   double       d_idleTime6;
-   double       d_jobGetTileT;
-   double       handlerGetTileT();
-
-protected:
-
-   // Associates a job with a tile ID for quick access to its tile data when finished:
-   typedef std::map<ossim_uint32 /*tile_ID*/, ossimRefPtr<ossimImageData> >  TileCache;
-
-   //! Private class representing a getTile job.
-   class ossimGetTileJob : public ossimJob
-   {
-   public:
-      ossimGetTileJob(ossim_uint32 tile_id,  ossim_uint32 chain_id,  ossimMultiThreadSequencer& sequencer) 
-         :  m_tileID(tile_id), 
-            m_chainID(chain_id), 
-            m_sequencer(sequencer),
-            t_launchNewJob(true) {}
-
-      virtual void start();
-
-   private:
-      ossim_uint32                 m_tileID;
-      ossim_uint32                 m_chainID;
-      ossimMultiThreadSequencer&   m_sequencer;
-
-      bool t_launchNewJob;                    //### for experimental purposes
-      friend class ossimMultiThreadSequencer; //### for experimental purposes
-   };
-   friend class ossimGetTileJob;
-
-   //! Private class for getTile job callbacks.
-   class ossimGetTileCallback : public ossimJobCallback
-   {
-   public:
-      ossimGetTileCallback() {}
-      virtual void finished(ossimJob* job)
-      {
-         if (job != NULL)
-            job->finished();
-      }
-   };
-
-   //! Queues up the optimum amount of jobs given the availability of thread chains and space in
-   //! the output tile cache.
-   void initJobs();
-
-   //! Access method to tile cache with scope lock to avoid multiple threads writing to
-   //! the cache simultaneously. 
-   //! NOTE: chain_id being passed only for debug. To be removed.
-   void setTileInCache(ossim_uint32 tile_id, ossimImageData* tile, ossim_uint32 chain_id, double dt /*for debug*/);
-
-   //! Method to job queue with scope lock to avoid multiple threads modifying the queue
-   //! simultaneously.
-   void nextJob(ossim_uint32 chain_id);
-
-   //! For debug -- thread-safe console output
-   void print(ostringstream& msg) const;
-
-   ossimRefPtr<ossimImageChainMtAdaptor> m_inputChain; //!< Same as base class' theInputConnection
-   ossimRefPtr<ossimJobMultiThreadQueue> m_jobMtQueue;
-   ossim_uint32                          m_numThreads;
-   ossimRefPtr<ossimGetTileCallback>     m_callback;
-   ossim_uint32                          m_nextTileID; //!< ID of next tile to be threaded, different from base class' theCurrentTileNumber
-   TileCache                             m_tileCache;  //!< Saves tiles output by threaded jobs
-   ossim_uint32                          m_maxCacheSize;
-   ossim_uint32                          m_maxTileCacheFactor;
-   mutable OpenThreads::Mutex            m_cacheMutex;   
-   mutable OpenThreads::Mutex            m_jobMutex;   
-   ossim_uint32                          m_totalNumberOfTiles;
-   OpenThreads::Block                    m_getTileBlock; //<! Blocks execution of main thread while waiting for tile to become available
-   OpenThreads::Block                    m_nextJobBlock; //<! Blocks execution of worker threads
-
-   // FOR DEBUG:
-   mutable OpenThreads::Mutex d_printMutex;
-   mutable OpenThreads::Mutex d_timerMutex;
-   bool d_debugEnabled;
-   ossim_uint32 d_timedBlocksDt;
-   bool d_timeMetricsEnabled;
-   double d_t1;
-};
-
-#endif
diff --git a/ossim/include/ossim/parallel/ossimOrthoIgen.h b/ossim/include/ossim/parallel/ossimOrthoIgen.h
deleted file mode 100644
index ab6d2ae..0000000
--- a/ossim/include/ossim/parallel/ossimOrthoIgen.h
+++ /dev/null
@@ -1,253 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Class declaration for ortho-image generator.
-//
-//*************************************************************************
-// $Id: ossimOrthoIgen.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimOrthoIgen_HEADER
-#define ossimOrthoIgen_HEADER
-
-#include <ossim/parallel/ossimIgen.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimConnectableContainer.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/support_data/ossimSrcRecord.h>
-#include <map>
-
-class ossimConnectableObject;
-class ossimMapProjection;
-class ossimImageSource;
-class ossimImageHandler;
-class ossimImageCombiner;
-
-class OSSIM_DLL ossimOrthoIgen : public ossimIgen
-{
-public:
-   enum ossimOrthoIgenProjectionType
-   {
-      OSSIM_UNKNOWN_PROJECTION = 0,
-      OSSIM_UTM_PROJECTION,
-      OSSIM_SRS_PROJECTION,
-      OSSIM_GEO_PROJECTION,
-      OSSIM_INPUT_PROJECTION,
-      OSSIM_EXTERNAL_PROJECTION
-   };
-   enum OriginType
-   {
-      OSSIM_CENTER_ORIGIN     = 0,
-      OSSIM_UPPER_LEFT_ORIGIN = 1
-   };
-   typedef std::map<ossimString,ossimString, ossimStringLtstr> PropertyMap;
-   
-   ossimOrthoIgen();
-
-   /**
-    * Will add command line arguments to initialize this object from a command line application
-    *
-    * <pre>
-    * Command Line Arguments:
-    *
-    * -t or --thumbnail  Takes an integer argument that is used to set both width
-    *                    and height.
-    *                    example: -t 1024 will produce an image that is 1024x1024
-    * --meters           Takes a double precision argument that is used for meters per pixel
-    *                    override.
-    *                    example: --meters 5 will create a 5 meter product.
-    * --slave-buffers    Takes an integer as an argument that specifies the number of slave tile buffers per
-    *                    slave node.  The slave nodes are suppose to be asynch send.  It will
-    *                    not wait for the send to finish.  It will got to the next buffer and check to
-    *                    see if it's been sent and if not it will then wait for the buffer to be free.
-    *                    example: --slave-buffers 10  will create 10 buffers per slave node.
-    * --chain-template   Takes a file name that is a kewyord list that is used as a template for every
-    *                    input file.
-    *                    example:
-    * 
-    * @param argumentParser Argument parser object to add command line options to
-    *
-    */ 
-   void addArguments(ossimArgumentParser& argumentParser);
-   virtual void initialize(ossimArgumentParser& argumentParser);
-   void addFiles(ossimArgumentParser& argumentParser,
-                 bool withDecoding,
-                 ossim_uint32 startIdx = 1);
-   void clearFilenameList();
-
-   //! Parses the .src file specified in the command line. These contain an alternate specification
-   //! of input file and associated attributes as a KWL.
-   void addSrcFile(const ossimFilename& fileName);
-
-   bool execute();
-   void setDefaultValues();
-
-protected:
-   //! Used to parse command line filename specs with piped switches (in lieu of *.src file).
-   //! Returns TRUE if successful.
-   bool parseFilename(const ossimString& file_spec, bool decodeEntry);
-
-   //! Determines the UL corner tiepoint of the product projection as the overall UL corner of the
-   //! mosaic.
-   void establishMosaicTiePoint();
-
-   //! Computes the center latitude of the mosaic for use as the geographic scaling latitude
-   void computeGeoScalingLatitude();
-
-   ossimUnitType theDeltaPerPixelUnit;
-   ossimDpt      theDeltaPerPixelOverride;
-   ossimOrthoIgenProjectionType theProjectionType;
-   ossimString   theProjectionName;
-   ossimString   theCrsString;
-   ossim_float64 theGeoScalingLatitude;
-   ossimString   theCombinerType;
-   ossimString   theResamplerType;
-   ossimString   theWriterType;
-   ossimFilename theTemplateView;
-   ossimFilename theTilingTemplate;
-   ossimFilename theTilingFilename;
-   ossimFilename theChainTemplate;
-   ossimFilename theCombinerTemplate;
-   ossimFilename theAnnotationTemplate;
-   ossimFilename theWriterTemplate;
-   ossimFilename theSupplementaryDirectory;
-   ossimString   theSlaveBuffers;
-   OriginType    theCutOriginType;
-   ossimDpt      theCutOrigin;
-   ossimDpt      theCutDxDy;
-   ossimUnitType theCutOriginUnit;
-   ossimUnitType theCutDxDyUnit;
-   ossim_float64 theLowPercentClip;
-   ossim_float64 theHighPercentClip;
-   ossim_int32   theStdDevClip;
-   bool          theUseAutoMinMaxFlag;
-   bool          theClipToValidRectFlag;
-   PropertyMap   theReaderProperties;
-   PropertyMap   theWriterProperties;   
-   ossimFilename theTargetHistoFileName;
-   std::vector<ossimSrcRecord> theSrcRecords;
-   ossimFilename theProductFilename;
-   ossimRefPtr<ossimProjection> theReferenceProj;
-   ossimFilename theMaskShpFile;
-   bool          theCacheExcludedFlag;
-   ossimString   thePixelReplacementMode;
-   ossim_float64 theClampPixelMin;
-   ossim_float64 theClampPixelMax;
-   ossim_float64 theClipPixelMin;
-   ossim_float64 theClipPixelMax;
-   ossimString   theOutputRadiometry;
-   ossimPixelType thePixelAlignment;
-
-   /**
-   * @brief Sets up the igen keyword list for the process.
-   *
-   * This throws ossimException on error.
-   */
-   void setupIgenChain();
-
-   bool setupTiling();
-   void setupCutter();
-
-   /** 
-   * Checks for the presence of a raster mask file alongside the image, and inserts the mask 
-   * filter in the chain if mask file exists. Returns with current_src pointing to masker object 
-   */
-   ossimImageSource* setupRasterMask(ossimImageChain* single_image_chain,
-                        const ossimSrcRecord& src_record);
-
-   /**
-   * Insert a partial-pixel flipper to remap null-valued pixels to min according to info in the
-   * source record and/or command line. Returns with current_src pointing to flipper object.
-   */
-   ossimImageSource* setupPixelFlipper(ossimImageChain* single_image_chain, 
-                          const ossimSrcRecord& src_record);
-
-   /**
-    * @brief Set up the writer for the process.
-    * This throws ossimException on error.
-    */
-   void setupWriter();
-
-   /**
-    * @brief Set up the output projection for the process.
-    * This throws ossimException on error.
-    */
-   void setupProjection();
-
-   /**
-    * Sets up any annotation from --annotate option.
-    * @note This must be called after "setupView" as it needs a projection.
-    */
-   void setupAnnotation();
-
-   void addFiles(ossimString fileInfoStr, 
-                 std::vector<ossimString> fileInfos,
-                 bool withEncodedEntry);
-
-   /**
-   * Consolidates specification of bounding rect given various ways of specifying on the command
-   * line. This avoids multiple, redundant checks scattered throughout the code.
-   */
-   void consolidateCutRectSpec();
-
-   /**
-   * Called when histogram operation is requested. Sets up additional filters in image chain
-   * for performing matching, stretching or clipping. If chain=0,
-   * this implies that the target histogram is being enabled for the output mosaic. */
-   void setupHistogram(ossimImageChain* chain=0, const ossimSrcRecord& src_record=ossimSrcRecord());
-
-   //! Utility method for creating a histogram for an input image. Returns TRUE if successful.
-   bool createHistogram(ossimImageChain* chain, const ossimFilename& histo_filename);
-
-   /**
-    * @brief Adds cache to the left of resampler.
-    * @param chain The chain to add to.
-    */
-   void addChainCache(ossimImageChain* chain) const;
-
-   /**
-   * @brief Generates a log KWL file that could be fed directly to Igen. Used for verifying chain.
-   */
-   void generateLog();
-  
-   /**
-   * @brief Adds a scalar remapper to the extreme right of the chain is specified by the 
-   * --output-radiometry option.
-   */
-   void setupOutputRadiometry();
-
-   /**
-    * @brief Checks all input image projections to see if elevation is needed.
-    * @return true if affected, false if not.
-    */
-   bool isAffectedByElevation();
-
-   /**
-    * @brief Recomputes image gsds.
-    *
-    * Calls ossimImageGeometry::computeGsd() on all image handlers
-    * that have projections affected by elevation.  Used to recompute after a
-    * delayed load of elevation.
-    */
-   void reComputeChainGsds();
-
-   /**
-    * GSD Determination is nontrivial since there are various command-line options that control
-    * this quantity. This method considers all information before setting the product's GSD.
-    */
-   void setProductGsd();
-};
-#endif
-
diff --git a/ossim/include/ossim/plugin/ossimDynamicLibrary.h b/ossim/include/ossim/plugin/ossimDynamicLibrary.h
deleted file mode 100644
index 2d0f956..0000000
--- a/ossim/include/ossim/plugin/ossimDynamicLibrary.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// LICENSE: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimDynamicLibrary.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimDynamicLibrary_HEADER
-#define ossimDynamicLibrary_HEADER 1
-
-#include <ossim/ossimConfig.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimReferenced.h>
-
-
-#if defined(_WIN32) || defined(__WIN32__)
-#include <windows.h>
-#else 
-#include <dlfcn.h>
-#endif
-
-class OSSIM_DLL ossimDynamicLibrary : public ossimReferenced
-{
-public:
-   ossimDynamicLibrary();
-   ossimDynamicLibrary(const ossimString& name);
-   virtual ~ossimDynamicLibrary();
-   // return TRUE if the library was loaded successfully
-   bool isLoaded() const { return theLibrary != 0; }
-
-   // load the library with the given name (full or not), return TRUE on
-   // success
-   bool load(const ossimString& name);
-
-   bool load();
-   // unload the library, also done automatically in dtor
-   void unload();
-
-   // load a symbol from the library, return NULL if an error occured or
-   // symbol wasn't found
-   void *getSymbol(const ossimString& name) const;
-
-   const ossimString& getName()const
-   {
-      return theLibraryName;
-   }
-   
-protected:
-   // the handle to DLL or NULL
-#if defined(_WIN32)
-   HINSTANCE theLibrary;
-#else
-   void* theLibrary;
-#endif
-   ossimString theLibraryName;
-
-};
-
-#endif
-
-
-
diff --git a/ossim/include/ossim/point_cloud/ossimGenericPointCloudHandler.h b/ossim/include/ossim/point_cloud/ossimGenericPointCloudHandler.h
deleted file mode 100644
index b21eaeb..0000000
--- a/ossim/include/ossim/point_cloud/ossimGenericPointCloudHandler.h
+++ /dev/null
@@ -1,41 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id: ossimGenericPointCloudHandler.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimGenericPointCloudHandler_HEADER
-#define ossimGenericPointCloudHandler_HEADER 1
-
-#include <ossim/point_cloud/ossimPointCloudHandler.h>
-#include <ossim/point_cloud/ossimPointBlock.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimGrect.h>
-#include <vector>
-
-using namespace std;
-
-class OSSIM_DLL ossimGenericPointCloudHandler : public ossimPointCloudHandler
-{
-public:
-   ossimGenericPointCloudHandler(vector<ossimEcefPoint>& ecef_points);
-   ossimGenericPointCloudHandler(vector<ossimGpt>& ground_points);
-   virtual ~ossimGenericPointCloudHandler();
-   virtual ossim_uint32 getNumPoints() const;
-   virtual void getFileBlock(ossim_uint32 offset,
-                             ossimPointBlock& block,
-                             ossim_uint32 maxNumPoints=0xFFFFFFFF)const;
-   virtual ossim_uint32 getFieldCode() const;
-   virtual bool open(const ossimFilename& pointsFile);
-   virtual void close();
-
-protected:
-   ossimGenericPointCloudHandler() {}
-   ossimPointBlock m_pointBlock;
-};
-
-#endif /* #ifndef ossimPdalReader_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointBlock.h b/ossim/include/ossim/point_cloud/ossimPointBlock.h
deleted file mode 100644
index f8e9379..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointBlock.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-#ifndef ossimPointBlock_HEADER
-#define ossimPointBlock_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h> /* for ossim::isnan */
-#include <ossim/base/ossimDataObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/point_cloud/ossimPointRecord.h>
-#include <vector>
-
-class ossimSource;
-
-/***************************************************************************************************
- * Base class for all Point Cloud data sources, including input file handlers and processing nodes.
- **************************************************************************************************/
-class OSSIMDLLEXPORT ossimPointBlock: public ossimDataObject
-{
-public:
-   typedef std::vector< ossimRefPtr<ossimPointRecord> > PointList;
-
-   ossimPointBlock(ossimSource* owner=0, ossim_uint32 fields=0);
-
-   virtual ~ossimPointBlock();
-
-   /** Returns allocated size. The pointList may contain only null points if not assigned */
-   virtual ossim_uint32 size() const { return m_pointList.size(); }
-
-   bool empty() const { return (size() == 0); }
-
-   /**
-    * Returns OR'd mash-up of ossimPointRecord field codes being stored (or desired to be stored)
-    */
-   ossim_uint32 getFieldCode() const;
-   vector<ossimPointRecord::FIELD_CODES> getFieldCodesAsList() const;
-
-   /**
-    * Initializes the desired fields to be stored. This will affect future getBlock() calls. If
-    * the point list contains points from prior read, they will be deleted unless the points field
-    * code matches the code argument.
-    */
-   void setFieldCode(ossim_uint32 code);
-
-   /** Adds single point to the tail of the list. */
-   virtual void addPoint(ossimPointRecord* point);
-
-   virtual const ossimPointRecord* getPoint(ossim_uint32 point_offset) const;
-   virtual ossimPointRecord* getPoint(ossim_uint32 point_offset);
-
-   const ossimPointRecord* operator[](ossim_uint32 i) const { return getPoint(i); }
-   ossimPointRecord* operator[](ossim_uint32 i) { return getPoint(i); }
-
-   virtual const PointList&  getPoints() const { return m_pointList; }
-   virtual PointList&  getPoints()  { return m_pointList; }
-
-   void getFieldMin(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const;
-   void getFieldMax(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const;
-   void getBounds(ossimGrect& block_bounds) const;
-
-   virtual const ossimPointBlock& operator=(const ossimPointBlock &rhs);
-
-   virtual ossimObject* dup() const;
-
-   /** Resets any storage to empty. */
-   virtual void clear() { m_pointList.clear(); m_isNormalized = false; m_minMaxValid = false;}
-
-   /**
-    *  Fulfills base class pure virtual. TODO: Needs to be correctly implemented
-    */
-   virtual bool isEqualTo(const ossimDataObject& /*rhs*/, bool /*deep_copy*/) const { return false; }
-   virtual ossim_uint32 getHashId() const { return 0; }
-   virtual ossim_uint32 getDataSizeInBytes() const { return 0; };
-   virtual void initialize() {};
-
-protected:
-   ossimPointBlock(const ossimPointBlock& rhs);
-   void scanForMinMax() const;
-
-   ossimPointRecord m_nullPCR;
-   mutable ossimPointRecord m_minRecord;
-   mutable ossimPointRecord m_maxRecord;
-   mutable bool m_minMaxValid;
-   PointList m_pointList;
-   mutable ossim_uint32 m_fieldCode; // OR'd mash-up of ossimPointRecord::FIELD_CODES
-   bool m_isNormalized;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimPointBlock_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointCloudGeometry.h b/ossim/include/ossim/point_cloud/ossimPointCloudGeometry.h
deleted file mode 100644
index adac902..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointCloudGeometry.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#ifndef ossimPointCloudGeometry_HEADER
-#define ossimPointCloudGeometry_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDatumFactory.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/projection/ossimMapProjection.h>
-
-
-/***************************************************************************************************
- * This class represents the 3D geometry of the point cloud dataset.
- * NOTE: See below for details on position format. It is the responsibility of the derived
- * ossimPointCloudHandlers to convert the ray point positions into either geographic or map-meters
- * before storing a point in ossimPointCloudRecord.
- **************************************************************************************************/
-class OSSIMDLLEXPORT ossimPointCloudGeometry : public ossimObject
-{
-public:
-   enum PositionFormat
-   {
-      UNKNOWN,
-      GEOGRAPHIC,     // x=lon, y=lat, z=ellipsoid height
-      MAP_PROJECTED, // x=easting, y=northing, z=ellipsoid height
-      ECF_METERS      // X, Y, Z (see base/ossimEcef)
-   };
-
-   /**
-    * Constructs from WKT specification. Since the projection units are unknown
-    * when the bounds are established, the caller will not know the units of the point coordinates
-    * for establishing the bounds.
-    */
-   ossimPointCloudGeometry(const ossimString& wkt);
-
-   /**
-    * If arg left to default GEOGRAPHIC, this geometry is essentially unity transform except for a
-    * possible datum change if requested.
-    */
-   ossimPointCloudGeometry(PositionFormat f=GEOGRAPHIC)
-         : m_format(f),
-           m_projection(0),
-           m_datum (ossimDatumFactory::instance()->wgs84()) {}
-
-   ~ossimPointCloudGeometry() {}
-
-   bool operator==(const ossimPointCloudGeometry& other) const;
-
-   /**
-   * While the raw point positions may be specified in the data file as either geographic, map
-   * projected (feet or meters), or ECF meters, the point positions are stored in OSSIM as either as
-   * geographic or map (meters) only. This method is used by the Point cloud handler object for
-   * interpreting the input file's raw position format.
-   */
-   PositionFormat getRawPosFormat() const { return m_format; }
-
-   /**
-    * This method will return either GEOGRAPHIC or MAP_PROJECTION. For the latter, the stored
-    * coordinates will be in meters.
-    */
-   PositionFormat getStoredPosFormat() const { return (m_format==ECF_METERS) ? GEOGRAPHIC : m_format; }
-
-   const ossimMapProjection* getProjection()   const { return m_projection.get(); }
-   const ossimDatum*         getDatum()        const { return m_datum; }
-
-   /**
-    * Method converts a generic 3D point as stored in the argument ossim3Dpt object,
-    * and converts it to an ossimGpt, using the preset datum provided in the argument gpt.
-    */
-   void convertPos(const ossimDpt3d& stored_pos, ossimGpt& converted_gpos) const;
-
-private:
-   PositionFormat m_format;
-   ossimRefPtr<ossimMapProjection> m_projection;
-   const ossimDatum* m_datum;
-
-TYPE_DATA
-};
-
-#endif /* ossimPointCloudGeometry_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointCloudHandler.h b/ossim/include/ossim/point_cloud/ossimPointCloudHandler.h
deleted file mode 100644
index 094c264..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointCloudHandler.h
+++ /dev/null
@@ -1,98 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#ifndef ossimPointCloudHandler_HEADER
-#define ossimPointCloudHandler_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/point_cloud/ossimPointCloudSource.h>
-#include <ossim/point_cloud/ossimPointBlock.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/point_cloud/ossimPointCloudGeometry.h>
-#include <vector>
-
-
-/**
- * Base class for all point-cloud file readers
- */
-class OSSIMDLLEXPORT ossimPointCloudHandler: public ossimPointCloudSource
-{
-public:
-   static ossim_uint32 DEFAULT_BLOCK_SIZE;
-
-   ossimPointCloudHandler();
-   ossimPointCloudHandler(ossimObject* owner);
-
-   virtual ~ossimPointCloudHandler();
-
-   /**
-    *  @brief Method to open input point cloud dataset.
-    *  @param imageFile Name of point data file to be opened. (or basename for multi-file sets.)
-    *  @return Returns true on success, false on error.
-    */
-   virtual bool open(const ossimFilename& imageFile) = 0;
-
-   /**
-    * Closes the point cloud file(s).
-    */
-   virtual void close() = 0;
-
-   /**
-    * Fetches up to maxNumPoints points starting at the dataset's <offset> in the order they
-    * appear in the data file. Thread-safe implementation accepts an allocated block from the
-    * calling method. caller can check block.size() to see if block is full.
-    */
-   virtual void getFileBlock(ossim_uint32 offset,
-                             ossimPointBlock& block,
-                             ossim_uint32 maxNumPoints=0xFFFFFFFF) const = 0;
-
-   /**
-    * @see getFileBlock.
-    */
-   virtual void getNextFileBlock(ossimPointBlock& block,
-                                 ossim_uint32 maxNumPoints=0xFFFFFFFF) const;
-
-   virtual void rewind() const { m_currentPID = 0; }
-
-   /**
-    * Fetches the block of points inside the block bounds. If the height components of the bounds
-    * are NaN, then only the horizontal bounds are considered. Thread-safe version accepts data
-    * block object from caller. The block object is cleared before points are pushed on the vector.
-    * The block size will be non-zero if points were found.
-    */
-   virtual void getBlock(const ossimGrect& bounds, ossimPointBlock& block) const;
-
-   virtual const ossimPointRecord*  getMinPoint() const { return m_minRecord.get(); }
-   virtual const ossimPointRecord*  getMaxPoint() const { return m_maxRecord.get(); }
-
-   virtual void getBounds(ossimGrect& bounds) const;
-
-   /**
-    * Handler is always on the start of the pipeline
-    */
-   virtual bool canConnectMyInputTo(ossim_int32, const ossimConnectableObject*) const
-   { return false; }
-
-   void normalizeBlock(ossimPointBlock& block);
-
-protected:
-
-   ossimFilename m_inputFilename;
-   ossimRefPtr<ossimPointCloudGeometry> m_geometry;
-   ossimRefPtr<ossimPointRecord> m_minRecord;
-   ossimRefPtr<ossimPointRecord>  m_maxRecord;
-   mutable ossim_uint32 m_currentPID;
-
-TYPE_DATA
-};
-
-#endif /* ossimPointCloudHandler_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointCloudHandlerFactory.h b/ossim/include/ossim/point_cloud/ossimPointCloudHandlerFactory.h
deleted file mode 100644
index 32780c4..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointCloudHandlerFactory.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#ifndef ossimPointCloudHandlerFactory_HEADER
-#define ossimPointCloudHandlerFactory_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimObjectFactory.h>
-#include <ossim/base/ossimFilename.h>
-
-class ossimPointCloudHandler;
-
-class OSSIMDLLEXPORT ossimPointCloudHandlerFactory: public ossimObjectFactory
-{
-public:
-   virtual ~ossimPointCloudHandlerFactory() {}
-
-   virtual ossimPointCloudHandler* open(const ossimFilename& fileName) const = 0;
-   virtual ossimPointCloudHandler* open(const ossimKeywordlist& kwl, const char* prefix = 0) const = 0;
-
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix = 0) const
-   {
-      return (ossimObject*) open(kwl, prefix);
-   }
-
-   virtual ossimObject* createObject(const ossimString& typeName) const = 0;
-
-   virtual void getSupportedExtensions(std::vector<ossimString>& extList) const = 0;
-
-protected:
-
-};
-
-#endif /* ossimPointCloudHandlerFactory_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointCloudHandlerRegistry.h b/ossim/include/ossim/point_cloud/ossimPointCloudHandlerRegistry.h
deleted file mode 100644
index 69d6814..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointCloudHandlerRegistry.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#ifndef ossimPointCloudHandlerRegistry_HEADER
-#define ossimPointCloudHandlerRegistry_HEADER 1
-
-#include <ossim/base/ossimObjectFactory.h>
-#include <ossim/base/ossimFactoryListInterface.h>
-#include <ossim/base/ossimFilename.h>
-
-#include <ossim/point_cloud/ossimPointCloudHandlerFactory.h>
-#include <ossim/point_cloud/ossimPointCloudHandler.h>
-
-class OSSIMDLLEXPORT ossimPointCloudHandlerRegistry :
-      public ossimObjectFactory,
-      public ossimFactoryListInterface<ossimPointCloudHandlerFactory, ossimPointCloudHandler>
-{
-public:
-   virtual ~ossimPointCloudHandlerRegistry();
-
-   static ossimPointCloudHandlerRegistry* instance();
-
-   virtual ossimPointCloudHandler* open(const ossimFilename& fileName) const;
-
-   virtual ossimPointCloudHandler* open(const ossimKeywordlist& kwl, const char* prefix = 0) const;
-
-   virtual ossimRefPtr<ossimPointCloudHandler> open(std::istream* str,
-                                                    std::streamoff restartPosition,
-                                                    bool youOwnIt) const;
-
-   /*!
-    * Creates an object given a type name.
-    */
-   virtual ossimObject* createObject(const ossimString& typeName) const;
-
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix = 0) const;
-
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-
-protected:
-   ossimPointCloudHandlerRegistry();
-   const ossimPointCloudHandlerRegistry& operator=(const ossimPointCloudHandlerRegistry& rhs);
-   static ossimPointCloudHandlerRegistry* m_instance;
-
-TYPE_DATA
-};
-
-#endif /* ossimPointCloudHandlerRegistry_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointCloudImageHandler.h b/ossim/include/ossim/point_cloud/ossimPointCloudImageHandler.h
deleted file mode 100644
index bbc9cbe..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointCloudImageHandler.h
+++ /dev/null
@@ -1,255 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#ifndef ossimPointCloudImageSource_HEADER
-#define ossimPointCloudImageSource_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/point_cloud/ossimPointCloudHandler.h>
-#include <vector>
-
-class ossimImageData;
-class ossimTiffOverviewTileSource;
-class ossimPoinCloudHandler;
-
-/**
- * Class used for rendering point cloud data into a raster tile. It is derived from
- * ossimImageHandler so that it can be included in the available file formats for reading as
- * maintained by the ossimImageHandlerRegistry. This base class implementation exposes the data
- * elements represented by the base-class ossimPointCloudSource and the individual point base-class
- * ossimPointCloudRecord, namely, intensity, RGB color, elevation, and number of returns.
- *
- * For sensor systems providing additional renderable data items, a derived class will be required
- * to expose those components.
- */
-class OSSIMDLLEXPORT ossimPointCloudImageHandler : public ossimImageHandler
-{
-public:
-   enum Components { INTENSITY=0, HIGHEST, LOWEST, RETURNS, RGB, NUM_COMPONENTS /*not a component*/ };
-
-   ossimPointCloudImageHandler();
-   virtual ~ossimPointCloudImageHandler();
-
-   /**
-    *  @brief open method.
-    *  Satisfies ossimImageHandler::open pure virtual.
-    *  @return Returns true on success, false on error.
-    *  @note This method relies on the data member ossimImageData::theImageFile
-    *  being set.  Callers should do a "setFilename" prior to calling this
-    *  method or use the ossimImageHandler::open that takes a file name and an
-    *  entry index.
-    */
-   virtual bool open();
-
-   /**
-    *  @brief is open method.
-    *  Satisfies ossimImageHandler::isOpen pure virtual.
-    *  @return true if open, false if not.
-    */
-   virtual bool isOpen() const { return m_pch.valid(); }
-
-
-   /**
-    * @brief Close method.
-    */
-   virtual void close();
-
-   /**
-    *  Returns a pointer to a tile given an origin representing the upper left
-    *  corner of the tile to grab from the image.
-    *  Satisfies pure virtual from TileSource class.
-    */
-   virtual ossimRefPtr<ossimImageData> getTile(const  ossimIrect& rect,
-                                               ossim_uint32 resLevel=0);
-   
-   /**
-    * Method to get a tile.   
-    * @param result The tile to stuff.  Note The requested rectangle in full
-    * image space and bands should be set in the result tile prior to
-    * passing.  It will be an error if:
-    * result.getNumberOfBands() != this->getNumberOfOutputBands()
-    * @return true on success false on error.  If return is false, result
-    *  is undefined so caller should handle appropriately with makeBlank or
-    * whatever.
-    */
-   virtual bool getTile(ossimImageData* result, ossim_uint32 resLevel=0);
-   
-   /**
-    * @brief Gets bands.
-    * Satisfies ossimImageSource::getNumberOfInputBands pure virtual.
-    * @retrun Number of bands.
-    */
-   virtual ossim_uint32 getNumberOfInputBands() const;
-
-   /**
-    * @brief Gets lines.
-    * Satisfies ossimImageHandler::getNumberOfLines pure virtual.
-    * @param resLevel Reduced resolution level to return lines of.
-    * Default = 0
-    * @return The number of lines for specified reduced resolution level.
-    */
-   virtual ossim_uint32 getNumberOfLines(ossim_uint32 resLevel = 0) const;
-
-   /**
-    * @brief Gets samples.
-    * Satisfies ossimImageHandler::getNumberOfSamples
-    * @param resLevel Reduced resolution level to return samples of.
-    * Default = 0
-    * @return The number of samples for specified reduced resolution level.
-    */
-   virtual ossim_uint32 getNumberOfSamples(ossim_uint32 resLevel = 0) const;
-
-   /**
-    * @brief Gets tile width.
-    * Satisfies ossimImageHandler::getImageTileWidth pure virtual.
-    * @return The tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileWidth() const;
-
-   /**
-    * @brief Gets tile height.
-    * Satisfies ossimImageHandler::getImageTileHeight pure virtual.
-    * @return The tile width of the image or 0 if the image is not tiled.
-    * Note: this is not the same as the ossimImageSource::getTileWidth which
-    * returns the output tile width which can be different than the internal
-    * image tile width on disk.
-    */
-   virtual ossim_uint32 getImageTileHeight() const;
-
-   /** @return The width of the output tile. */
-   virtual ossim_uint32 getTileWidth() const;
-   
-   /** @returns The height of the output tile. */
-   virtual ossim_uint32 getTileHeight() const;
-
-   /** @return The output pixel type of the tile source. */
-   ossimScalarType getOutputScalarType() const;
-
-   /**
-    * @brief Gets entry list.
-    * This list reflects the data component entry list provided by the derived point-cloud handler.
-    * This base class understands the basic (LIDAR-biased) entries: "Intensity", "RGB",
-    * "Elevation", and "Return". If a sensor provides other components, then a derived image handler
-    * will be needed to rasterize that data channel as well.
-    * @param entryList This is the list to initialize with entry indexes.
-    */
-   virtual void getEntryList(std::vector<ossim_uint32>& entryList) const;
-
-   virtual void getEntryNames(std::vector<ossimString>& entryNames) const;
-
-   /** @return The current entry number. */
-   virtual ossim_uint32 getCurrentEntry() const;
-
-   /**
-    * @param entryIdx Entry number to select.
-    * @return true if it was able to set the current entry and false otherwise.
-    */
-   virtual bool setCurrentEntry(ossim_uint32 entryIdx);
-
-   /** @return "point-cloud" */
-   virtual ossimString getShortName() const;
-   
-   /** @return "ossim point cloud to image renderer" */
-   virtual ossimString getLongName()  const;
-
-   /**
-    * Returns the image geometry object associated with this tile source or
-    * NULL if non defined.  The geometry contains full-to-local image
-    * transform as well as projection (image-to-world).
-    */
-   virtual ossimRefPtr<ossimImageGeometry> getImageGeometry();
-
-   /** @return Min pixel value. */
-   virtual double getMinPixelValue(ossim_uint32 band=0) const;
-
-   /** @return Min pixel value. */
-   virtual double getMaxPixelValue(ossim_uint32 band=0) const;
-
-   /** @return Min pixel value. */
-   virtual double getNullPixelValue(ossim_uint32 band=0) const;
-
-   /** @return The total number of decimation levels. */
-   virtual ossim_uint32 getNumberOfDecimationLevels() const;
-
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   virtual void getValidImageVertices(std::vector<ossimIpt>& validVertices,
-                                      ossimVertexOrdering ordering=OSSIM_CLOCKWISE_ORDER,
-                                      ossim_uint32 resLevel=0) const;
-
-   /**
-    * The reader properties are:
-    * -- the GSD ("meters_per_pixel") which overrides computed nominal GSD
-    * -- the GSD factor ("gsd_factor") scales the computed nominal GSD, defaults to 1.0.
-    * -- the active component as entry number ("entry") with possible values [0 - 4] corresponding
-    *    to "component" property (listed below)
-    * -- the active component ("component") as string with possible values
-    *    "intensity", "highest", "lowest", "returns", or "rgb", respectively (case insensitive)
-    */
-   void setProperty(ossimRefPtr<ossimProperty> property);
-   ossimRefPtr<ossimProperty> getProperty(const ossimString& name) const;
-
-   /**
-    * Permits backdoor for setting the input point cloud handler object. Useful for debug
-    */
-   bool setPointCloudHandler(ossimPointCloudHandler* pch);
-
-   /** @brief Get the GSD for resLevel. */
-   void getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const;
-
-   /** @brief Sets m_gsd data member and projection if projection is set. */
-   void setGSD( const ossim_float64& gsd );
-
-
-protected:
-   class PcrBucket
-   {
-   public:
-      PcrBucket() : m_bucket(0), m_numSamples(0) {}
-      PcrBucket(const ossim_float32* init_value, ossim_uint32 numBands);
-      PcrBucket(const ossim_float32& R, const ossim_float32& G, const ossim_float32& B);
-      PcrBucket(const ossim_float32& init_value);
-      ~PcrBucket();
-      ossim_float32* m_bucket;
-      int m_numSamples;
-   };
-
-   void initTile();
-
-   void addSample(std::map<ossim_int32, PcrBucket*>& accumulator,
-                  ossim_int32 index,
-                  const ossimPointRecord* sample);
-
-   void normalize(std::map<ossim_int32, PcrBucket*>& accumulator);
-
-   ossim_uint32 componentToFieldCode() const;
-
-   ossimRefPtr<ossimPointCloudHandler> m_pch;
-   ossim_float32                m_maxPixel;
-   ossim_float32                m_minPixel;
-   ossimDpt                     m_gsd;
-   ossim_float64                m_gsdFactor;
-   ossimRefPtr<ossimImageData>  m_tile;
-   OpenThreads::Mutex           m_mutex;
-   Components                   m_activeComponent;
-   std::vector<ossimString>     m_componentNames;
-
-   TYPE_DATA
-};
-
-#endif /* ossimPointCloudRenderer_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointCloudSource.h b/ossim/include/ossim/point_cloud/ossimPointCloudSource.h
deleted file mode 100644
index d74cb84..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointCloudSource.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-#ifndef ossimPointCloudSource_HEADER
-#define ossimPointCloudSource_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h> /* for ossim::isnan */
-#include <ossim/base/ossimSource.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/point_cloud/ossimPointBlock.h>
-#include <ossim/point_cloud/ossimPointRecord.h>
-#include <vector>
-
-/***************************************************************************************************
- * Base class for all Point Cloud data sources, including input file handlers and processing nodes.
- **************************************************************************************************/
-class OSSIMDLLEXPORT ossimPointCloudSource: public ossimSource
-{
-public:
-   ossimPointCloudSource(ossimObject* owner = 0);
-   virtual ~ossimPointCloudSource();
-
-   /**
-    * Fetches the block of points inside the block bounds. If the height components of the bounds
-    * are NaN, then only the horizontal bounds are considered. Thread-safe version accepts data
-    * block object from caller.
-    */
-   virtual void getBlock(const ossimGrect& bounds, ossimPointBlock& block) const = 0;
-
-   /**
-    * Returns the total number of points in the dataset (not just the block returned in getPoints)
-    */
-   virtual ossim_uint32 getNumPoints() const = 0;
-
-   /**
-    * Assigns the two points with fields representing the extremes of the dataset. Useful for
-    * normalizing and establishing bounds.
-    */
-   virtual const ossimPointRecord*  getMinPoint() const;
-   virtual const ossimPointRecord*  getMaxPoint() const;
-
-   /**
-    * Fetches the data fields ids available from this source, OR'd together for testing against
-    * specific field (@see ossimPointRecord::FIELD_CODES). e.g. (though should use hasField()),
-    *
-    * bool hasIntensity = getFields() & ossimPointRecord::Intensity;
-    */
-   virtual ossim_uint32 getFieldCode() const;
-
-   /**
-    * Sets the data fields ID of interest for this source, and all input sources connected to this.
-    * This is an OR'd mash-up of @see ossimPointRecord::FIELD_CODES
-    */
-   virtual void setFieldCode (ossim_uint32 fieldCode);
-
-   /**
-    * Returns true if the data field is available from this source. The argument can be OR'd
-    * together for testing multiple fileds simultaneously. Example:
-    *
-    * bool hasRGB = hasField(ossimPointRecord::Red|ossimPointRecord::Green|ossimPointRecord::Blue);
-    */
-   virtual bool hasFields(ossim_uint32 id) const { return getFieldCode()&id; }
-
-   /** Special for convenience */
-   bool hasRGB() const
-   { return hasFields(ossimPointRecord::Red|ossimPointRecord::Green|ossimPointRecord::Blue); }
-
-   virtual bool canConnectMyInputTo(ossim_int32, const ossimConnectableObject*) const;
-
-protected:
-   ossimPointCloudSource(const ossimPointCloudSource& rhs);
-   ossimPointRecord m_nullPCR;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimPointCloudSource_HEADER */
-
diff --git a/ossim/include/ossim/point_cloud/ossimPointRecord.h b/ossim/include/ossim/point_cloud/ossimPointRecord.h
deleted file mode 100644
index f7cc449..0000000
--- a/ossim/include/ossim/point_cloud/ossimPointRecord.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id: ossimPointRecord.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimPointCloudRecord_HEADER
-#define ossimPointCloudRecord_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimGpt.h>
-#include <vector>
-#include <map>
-
-/***************************************************************************************************
- * This class represents a single sample (point) in a point cloud.
- **************************************************************************************************/
-class OSSIMDLLEXPORT ossimPointRecord : public ossimReferenced
-{
-public:
-   // Field codes intended to be OR'd to indicate fields present in point record. All point records
-   // have at least an X, Y, Z position so those fields are implied.
-   enum FIELD_CODES // and associated types
-   {
-      Intensity       = 0x0008, // float 32
-      ReturnNumber    = 0x0010, // unsigned int 32
-      NumberOfReturns = 0x0020, // unsigned int 32
-      Red             = 0x0040, // float 32
-      Green           = 0x0080, // float 32
-      Blue            = 0x0100, // float 32
-      GpsTime         = 0x0200, // unsigned long Unix epoch (microsec from 01/01/1970)
-      Infrared        = 0x0400, // float 32
-      All             = 0x0777
-   };
-
-   ossimPointRecord(ossim_uint32 fields_code=0);
-   ossimPointRecord(const ossimPointRecord& pcr);
-   ossimPointRecord(const ossimGpt& pos);
-
-   /** Creates a point record with fields set to null values */
-   ~ossimPointRecord();
-
-   ossimPointRecord& operator=(const ossimPointRecord& pcr);
-
-   ossim_uint32 getPointId() const { return m_pointId; }
-   void         setPointId(ossim_uint32 id) {m_pointId = id; }
-
-   /**
-    * Returns the 3D position vector in the dataset's coodinate reference system (available from
-    * the ossimPointCloudSource object. This is either map/meters (x, y, z) or geog (lat, lon, hgt).
-    * Refer to the ossimPointCloudGeometry::getStoredPosFormat() available from the associated
-    * ossimPointCloudSource->getGeometry()
-    */
-   const ossimGpt& getPosition() const { return m_position; }
-   void setPosition(const ossimGpt& p)  { m_position = p; }
-
-   /** Argument can be mash-up of OR'd codes for check of multiple fields. Returns TRUE if ALL
-    * fields are present. */
-   virtual bool hasFields(ossim_uint32 code_mashup) const;
-
-   /** Returns mash-up of OR'd codes of multiple fields being stored*/
-   virtual ossim_uint32 getFieldCode() const;
-
-   /** Return the float value of the requested field */
-   ossim_float32 getField(FIELD_CODES fc) const;
-
-   const std::map<FIELD_CODES, ossim_float32>& getFieldMap() const { return m_fieldMap; }
-
-   void setField(FIELD_CODES fc, ossim_float32 value);
-
-   friend std::ostream& operator << (std::ostream& ostr, const ossimPointRecord& p);
-
-   /**
-    * Initializes point to undefined state:
-    */
-   void clear();
-   bool isValid() const;
-
-protected:
-   ossim_uint32 m_pointId;
-   ossimGpt     m_position;
-   std::map<FIELD_CODES, ossim_float32> m_fieldMap;
-};
-
-#endif /* ossimPointCloudRecord_HEADER */
-
diff --git a/ossim/include/ossim/projection/ossimAdjMapModel.h b/ossim/include/ossim/projection/ossimAdjMapModel.h
deleted file mode 100644
index c9b0949..0000000
--- a/ossim/include/ossim/projection/ossimAdjMapModel.h
+++ /dev/null
@@ -1,138 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, Oscar Kramer, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description:
-// 
-// Special "sensor model" that provides a conventional map projection but
-// with additional capability for adjusting the map x,y coordinates with
-// offset, scale, and rotation transform.  Funtions to control notifications,
-// information and error output.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimAdjMapModel.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimAdjMapModel_HEADER
-#define ossimAdjMapModel_HEADER
-
-#include <ossim/matrix/newmat.h>
-#include <ossim/projection/ossimSensorModel.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimRefPtr.h>
-
-using namespace NEWMAT;
-
-class ossimMapProjection;
-
-//----------------------------------------------------------------------------
-//  CLASS DESCRIPTION: ossimAdjMapModel
-//! Special "sensor model" that provides a conventional map projection but with
-//  additional
-//! capability for adjusting the map x,y coordinates with offset, scale, and
-//  rotation transform.
-//----------------------------------------------------------------------------
-class OSSIMDLLEXPORT ossimAdjMapModel : public ossimSensorModel
-{
-public:
-   //! Constructs to uninitialized state (needed by factory).
-   ossimAdjMapModel();
-
-   //! Constructs with map projection and image rectangle size.
-   ossimAdjMapModel(ossimMapProjection* map_proj, const ossimIpt& image_size);
-
-   //! Copy constructor
-   ossimAdjMapModel(const ossimAdjMapModel& copy_this);
-
-   //! Constructs given geom KWL.
-   ossimAdjMapModel(const ossimKeywordlist& kwl, const char* prefix);
-
-   //! Constructs given geom filename.
-   ossimAdjMapModel(const ossimFilename& geom_filename);
-
-   //! Initializes base class data members after map model established.
-   //  Returns TRUE if all's well.
-   bool initializeFromMap();
-
-   //! Returns pointer to a new instance, copy of this.
-   virtual ossimObject* dup() const;
-   
-   //! Extends base-class implementation. Dumps contents of object to ostream.
-   virtual std::ostream& print(std::ostream& out) const;
-   
-   //! Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-   //! KWL files. Returns true if successful.
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-   
-   //! Writes a template of geom keywords processed by loadState and saveState
-   //  to output stream.
-   static void writeGeomTemplate(ostream& os);
-   
-   //! Overrides base class pure virtual.
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPoint) const;
-   
-   //! Overrides base class virtual.
-   virtual void lineSampleToWorld(const ossimDpt& image_point,
-                                  ossimGpt&       worldPoint) const;
-   
-   //! Rigorous inverse transform implented, overrides base-class' iterative
-   //  solution.
-   virtual void worldToLineSample(const ossimGpt& world_point,
-                                  ossimDpt&       image_point) const;
-      
-   //! Following a change to the adjustable parameter set, this virtual is
-   //  called to permit 
-   //! instances to compute derived quantities after parameter change.
-   virtual void updateModel();
-
-   //! Initializes adjustable parameters to their default values.
-   //! Overrides ossimAdjustableParameterInterface virtual method.
-   virtual void initAdjustableParameters();
-
-   //! Fetches the GSD from the internal map projection.
-   virtual ossimDpt 	getMetersPerPixel () const;
-
-   //! Enumeration for adjustable parameter positions in theAdjParams vector
-   enum AdjParamIndex
-   {
-      OFFSET_X = 0,         // meters
-      OFFSET_Y,             // meters
-      ROTATION,             // degrees CCW
-      SCALE_X,              // ratio
-      SCALE_Y,              // ratio
-      NUM_ADJ_PARAMS // not an index
-   };
-
-   /*!
-    * ossimOptimizableProjection
-    */
-   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM)
-
-private:
-   //! Destructor only deletes the map projection.
-   virtual ~ossimAdjMapModel();
-   
-   //! This is the vector of UNNORMALIZED, BIASED parameters as used in the
-   //! model. The collection of normalized, 0-biased, parameters used in
-   //! registration are found in the
-   //! ossimAdjustableParameterInterface and related classes.
-   //!  The quantities here are computed given the base class quantities.
-   ColumnVector                    theAdjParams;
-
-   ossimRefPtr<ossimMapProjection> theMapProjection;
-   double                          theCosTheta;
-   double                          theSinTheta;
-
-TYPE_DATA
-};
-
-#endif /* End of "#ifndef ossimAdjMapModel_HEADER" */
-
diff --git a/ossim/include/ossim/projection/ossimApplanixEcefModel.h b/ossim/include/ossim/projection/ossimApplanixEcefModel.h
deleted file mode 100644
index 7cb1f9b..0000000
--- a/ossim/include/ossim/projection/ossimApplanixEcefModel.h
+++ /dev/null
@@ -1,102 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// MIT
-// 
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimApplanixEcefModel.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimApplanixEcefModel_HEADER
-#define ossimApplanixEcefModel_HEADER
-#include <ossim/projection/ossimFcsiModel.h>
-#include <ossim/projection/ossimMeanRadialLensDistortion.h>
-#include <ossim/base/ossimDpt3d.h>
-
-class OSSIM_DLL ossimApplanixEcefModel : public ossimSensorModel
-{
-public:
-   ossimApplanixEcefModel();
-   ossimApplanixEcefModel(const ossimDrect& imageRect, // center in image space
-                          const ossimGpt& platformPosition,
-                          double roll,
-                          double pitch,
-                          double heading,
-                          const ossimDpt& principalPoint, // in millimeters
-                          double focalLength, // in millimeters
-                          const ossimDpt& pixelSize); // in millimeters
-   ossimApplanixEcefModel(const ossimApplanixEcefModel& src);
-   virtual ossimObject* dup()const;
-   
-   virtual void imagingRay(const ossimDpt& image_point,
-                           ossimEcefRay&   image_ray) const;
-
-   void lineSampleToWorld(const ossimDpt& image_point,
-                          ossimGpt&       gpt) const;
-  
-   
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPoint) const;
-   virtual void worldToLineSample(const ossimGpt& world_point,
-                                  ossimDpt&       image_point) const;
-   
-   virtual void updateModel();
-
-   void setPrincipalPoint(ossimDpt principalPoint);
-
-   virtual bool insideImage(const ossimDpt& p) const
-   {
-      /*          return( (p.u>=(0.0-FLT_EPSILON)) && */
-      /*                  (p.u<=(double)(theImageSize.u-(1-FLT_EPSILON))) && */
-      /*                  (p.v>=(0.0-FLT_EPSILON)) && */
-      /*                  (p.v<=(double)(theImageSize.v-(1-FLT_EPSILON))) ); */
-      // if it's close to the edge we will consider it inside the image
-      //
-      return theImageClipRect.pointWithin(p, theImageClipRect.width());
-   }
-
-
-   void setRollPitchHeading(double roll,
-                            double pitch,
-                            double heading);
-   
-   void setPixelSize(const ossimDpt& pixelSize);
-   void setImageRect(const ossimDrect& rect);
-   void setFocalLength(double focalLength);
-   void setPlatformPosition(const ossimGpt& gpt);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual void initAdjustableParameters();
-   
-   /*!
-    * ossimOptimizableProjection
-    */
-//   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM)
-   inline virtual bool useForward()const {return false;} //!ground to image faster (you don't need DEM)
-   virtual bool setupOptimizer(const ossimString& init_file); //!uses file path to init model
-
-protected:
-   
-   NEWMAT::Matrix theCompositeMatrix;
-   NEWMAT::Matrix theCompositeMatrixInverse;
-   double         theRoll;
-   double         thePitch;
-   double         theHeading;
-   ossimDpt       thePrincipalPoint;
-   ossimDpt       thePixelSize;
-   double         theFocalLength;
-   ossimEcefPoint theEcefPlatformPosition;
-   ossimRefPtr<ossimMeanRadialLensDistortion> theLensDistortion;
-
-
-   ossimEcefPoint theAdjEcefPlatformPosition;
-   
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimApplanixUtmModel.h b/ossim/include/ossim/projection/ossimApplanixUtmModel.h
deleted file mode 100644
index 25d3801..0000000
--- a/ossim/include/ossim/projection/ossimApplanixUtmModel.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// MIT
-// 
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimApplanixUtmModel.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimApplanixUtmModel_HEADER
-#define ossimApplanixUtmModel_HEADER
-#include <ossim/projection/ossimFcsiModel.h>
-#include <ossim/projection/ossimMeanRadialLensDistortion.h>
-#include <ossim/base/ossimDpt3d.h>
-
-class OSSIM_DLL ossimApplanixUtmModel : public ossimSensorModel
-{
-public:
-   ossimApplanixUtmModel();
-   ossimApplanixUtmModel(const ossimApplanixUtmModel& src);
-   virtual ossimObject* dup()const;
-   
-   virtual void imagingRay(const ossimDpt& image_point,
-                           ossimEcefRay&   image_ray) const;
-
-   void lineSampleToWorld(const ossimDpt& image_point,
-                          ossimGpt&       gpt) const;
-  
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPoint) const;
-   virtual void worldToLineSample(const ossimGpt& world_point,
-                                  ossimDpt&       image_point) const;
-   
-   virtual void updateModel();
-
-   void setPrincipalPoint(ossimDpt principalPoint);
-
-   void setPixelSize(const ossimDpt& pixelSize);
-   void setImageRect(const ossimDrect& rect);
-   void setFocalLength(double focalLength);
-   void setPlatformPosition(const ossimGpt& gpt);
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   virtual void initAdjustableParameters();
-   
-   /*!
-    * ossimOptimizableProjection
-    */
-//   inline virtual bool useForward()const {return false;} 
-   inline virtual bool useForward()const {return true;} //!ground to image faster (you don't need DEM) //TBC
-   virtual bool setupOptimizer(const ossimString& init_file); //!uses file path to init model
-
-protected:
-   NEWMAT::Matrix theCompositeMatrix;
-   NEWMAT::Matrix theCompositeMatrixInverse;
-   double         theOmega;
-   double         thePhi;
-   double         theKappa;
-   double         theBoreSightTx;
-   double         theBoreSightTy;
-   double         theBoreSightTz;
-   ossimDpt       thePrincipalPoint;
-   ossimDpt       thePixelSize;
-   double         theFocalLength;
-   ossimEcefPoint theEcefPlatformPosition;
-   ossimGpt       thePlatformPosition;
-   ossim_int32    theUtmZone;
-   ossim_int8     theUtmHemisphere;
-   ossimDpt3d     theUtmPlatformPosition;
-   ossimEcefVector theShiftValues;
-   
-   ossimRefPtr<ossimMeanRadialLensDistortion> theLensDistortion;
-   ossimEcefPoint theAdjEcefPlatformPosition;
-
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimCadrgProjection.h b/ossim/include/ossim/projection/ossimCadrgProjection.h
deleted file mode 100644
index f0ba410..0000000
--- a/ossim/include/ossim/projection/ossimCadrgProjection.h
+++ /dev/null
@@ -1,91 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimCadrgProjection.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimCadrgProjection_HEADER
-#define ossimCadrgProjection_HEADER
-#include <ossim/projection/ossimMapProjection.h>
-
-class OSSIM_DLL ossimCadrgProjection : public ossimMapProjection
-{
-public:
-   ossimCadrgProjection();
-
-                       
-   virtual ossimObject *dup()const;
-   virtual ossimGpt inverse(const ossimDpt &eastingNorthing)const;
-   virtual ossimDpt forward(const ossimGpt &latLon)const;
-   
-   virtual ossimDpt worldToLineSample(const ossimGpt &worldPoint)    const;
-   virtual ossimGpt lineSampleToWorld(const ossimDpt &projectedPoint)const;
-   virtual void worldToLineSample(const ossimGpt &worldPoint,
-                                  ossimDpt&       lineSample)const;
-   virtual void lineSampleToWorld(const ossimDpt &projectedPoint,
-                                  ossimGpt& gpt)const;
-
-   double computeXPixConstant(double scale, long zone)const;
-   double computeYPixConstant(double scale)const;
-   /*!
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-
-   /*!
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   
-   ossimString getProjectionName()const
-      {
-         return getClassName();
-      }
-      
-   //! Returns TRUE if principal parameters are within epsilon tolerance.
-   virtual bool operator==(const ossimProjection& projection) const;
-
-protected:
-   virtual ~ossimCadrgProjection();
-   /*
-    * Are from the ADRG Mil spec for 1:1,000,000 and
-    * are scales for each zone.
-    */
-   static double theCadrgArcA[8];
-   
-
-   static double theOldZoneExtents[10];
-
-   static double theNorthLimit;
-   static double theSouthLimit;
-
-   ossim_int32   theCadrgZone;
-
-   ossimDpt thePixelConstant;
-   double   theMapScale;
-
-   double theWidth;
-   double theHeight;
-
-   ossimDpt theUlLineSample;
-
-   ossimGpt theUlGpt;
-   ossimGpt theLlGpt;
-   ossimGpt theLrGpt;
-   ossimGpt theUrGpt;
-   
-   void computeParameters();
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimCoarseGridModel.h b/ossim/include/ossim/projection/ossimCoarseGridModel.h
deleted file mode 100644
index 17d754a..0000000
--- a/ossim/include/ossim/projection/ossimCoarseGridModel.h
+++ /dev/null
@@ -1,185 +0,0 @@
-//*****************************************************************************
-// FILE: ossimCoarseGridModel.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION:
-//   Contains declaration of class ossimCoarseGridModel. This is an
-//   implementation of an interpolation sensor model.
-//
-//*****************************************************************************
-//  $Id: ossimCoarseGridModel.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimCoarseGridModel_HEADER
-#define ossimCoarseGridModel_HEADER 1
-
-#include <ossim/projection/ossimSensorModel.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDblGrid.h>
-#include <ossim/base/ossimFilename.h>
-
-class ossimImageGeometry;
-
-/******************************************************************************
- *
- * CLASS:  ossimCoarseGridModel
- *
- *****************************************************************************/
-class OSSIMDLLEXPORT ossimCoarseGridModel : public ossimSensorModel
-{
-public:
-   /**
-    * CONSTRUCTORS:
-    */
-   ossimCoarseGridModel();
-   ossimCoarseGridModel(const ossimCoarseGridModel& copy_this);
-
-   /**
-    * CONSTRUCTOR (filename)
-    * Accepts name of geometry file. This can be either MET ECG geom file, or
-    * OSSIM keywordlist geometry file.
-    */
-   ossimCoarseGridModel(const ossimFilename& geom_file);
-
-   /**
-    * CONSTRUCTOR (keywordlist)
-    * Accepts OSSIM keywordlist geometry file.
-    */
-   ossimCoarseGridModel(const ossimKeywordlist& geom_kwl);
-   
-   ~ossimCoarseGridModel();
-
-   /**
-    * This method will build a grid from any projector.
-    * The first argument must be the image space bounds for
-    * the projection.  The second argument is the projector
-    * that will be used to approximate a bilinear grid over.
-    *
-    * The accuracy of the grid can be controlled by the static method
-    * setInterpolationError.
-    */
-   virtual void buildGrid(const ossimDrect& imageBounds,
-                          ossimProjection* proj,
-                          double heightDelta=500.0,
-                          bool enableHeightFlag=false,
-                          bool makeAdjustableFlag=true);
-   virtual void buildGrid(const ossimDrect& imageBounds,
-                          ossimImageGeometry* geom,
-                          double heightDelta=500.0,
-                          bool enableHeightFlag=false,
-                          bool makeAdjustableFlag=true);
-   
-   /**
-    *  This is used when building a grid from a projector.
-    *  You can set the interpolation error.  The default is
-    *  subpixel accuracy (within .1 of a pixel).
-    */
-   static void setInterpolationError(double error=.1);
-   static void setMinGridSpacing(ossim_int32 minSpacing = 100);
-   /**
-    * METHOD: print()
-    * Extends base-class implementation. Dumps contents of object to ostream.
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-   
-   /**
-    * METHODS:  saveState, loadState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files. Returns true if successful.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0) const;
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /**
-    * STATIC METHOD: writeGeomTemplate(ostream)
-    * Writes a template of geometry keywords processed by loadState and
-    * saveState to output stream.
-    */
-   static void writeGeomTemplate(ostream& os);
-
-   /**
-    * METHOD: dup()
-    * Returns pointer to a new instance, copy of this.
-    */
-   virtual ossimObject* dup() const
-      { return new ossimCoarseGridModel(*this); }
-   
-   /**
-    * METHOD: saveCoarseGrid(), loadCoarseGrid()
-    * Saves/loads the coarse grid to/from the specified file. Returns true if
-    * successful.
-    */
-   bool saveCoarseGrid(const ossimFilename& cgFileName) const;
-   bool loadCoarseGrid(const ossimFilename& cgFileName);
-
-   virtual void imagingRay(const ossimDpt& image_point,
-                           ossimEcefRay&   image_ray) const;
-
-   
-   virtual void lineSampleToWorld(const ossimDpt& image_point,
-                                  ossimGpt&       gpt) const;
-   /**
-    * METHOD: lineSampleHeightToWorld(image_point, height, &ground_point)
-    * This is the virtual that performs the actual work of projecting
-    * the image point to the earth at some specified elevation.
-    */
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       world_pt) const;
-
-
-   virtual void initAdjustableParameters();
-
-   /*!
-    * ossimOptimizableProjection
-    */
-   inline virtual bool useForward()const {return false;} //!image to ground faster
-
-   /**
-    * @brief Overrides base  ossimSensorModel::isAffectedByElevation
-    * method.
-    * @return true if height enabled, false if not.
-    */
-   virtual bool isAffectedByElevation() const;
-   
-protected:
-   /**
-    * METHOD: reallocateGrid()
-    * Deletes existing allocated memory and reallocates
-    * new space. This may happen if a new grid is loaded over an existing one.
-    */
-   void reallocateGrid(const ossimIpt& size);
-   
-   //! Initializes base class data members after grids have been assigned.
-   void initializeModelParams(ossimIrect irect);
-
-   //! Implements its own extrapolation since this can be handled by ossimDblGrid.
-   virtual ossimGpt extrapolate (const ossimDpt& imgPt, const double& height=ossim::nan()) const;
-
-   /**
-    * Data Members:
-    */
-   mutable ossimFilename theGridFilename;
-   ossimDblGrid  theLatGrid;         // degrees
-   ossimDblGrid  theLonGrid;         // degrees
-   ossimDblGrid  theDlatDhGrid;      // degrees/meter
-   ossimDblGrid  theDlonDhGrid;      // degrees/meter
-   ossimDblGrid* theDlatDparamGrid;  // degrees/(units-of-param)
-   ossimDblGrid* theDlonDparamGrid;  // degrees/(units-of-param)
-
-   static double       theInterpolationError;
-   static ossim_int32  theMinGridSpacing;
-   ossimAdjustmentInfo theInitialAdjustment;
-   bool                theHeightEnabledFlag;
-   
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimEpsgProjectionDatabase.h b/ossim/include/ossim/projection/ossimEpsgProjectionDatabase.h
deleted file mode 100644
index 0859a77..0000000
--- a/ossim/include/ossim/projection/ossimEpsgProjectionDatabase.h
+++ /dev/null
@@ -1,132 +0,0 @@
-//*************************************************************************************************
-//                          OSSIM -- Open Source Software Image Map
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Oscar Kramer
-//
-//*************************************************************************************************
-//  $Id: ossimEpsgProjectionDatabase.h 22924 2014-10-27 16:32:58Z okramer $
-
-#ifndef ossimEpsgProjectionDatabase_HEADER
-#define ossimEpsgProjectionDatabase_HEADER 1
-
-#include <ossim/projection/ossimProjectionFactoryBase.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <OpenThreads/Mutex>
-#include <fstream>
-
-
-class ossimProjection;
-class ossimString;
-class ossimEpsgProjectionFactory;
-class ossimUtmProjection;
-
-//*************************************************************************************************
-//! Projection Database for coded projections defined in database files and specified via some 
-//! coordinate reference system group:code, such as EPSG:26715.
-//*************************************************************************************************
-class OSSIMDLLEXPORT ossimEpsgProjectionDatabase : public ossimReferenced
-{
-   friend class ossimEpsgProjectionFactory;
-
-public:
-   //! Instantiates singleton instance of this class:
-   static ossimEpsgProjectionDatabase* instance();
-
-   //! Destructor
-   virtual ~ossimEpsgProjectionDatabase();
-
-   //! Returns a projection corresponding to the projection specified, or NULL if no entry found.
-   //! Normally <proj_spec> takes the form of <group>:<code> (e.g., "EPSG:26715"). Other forms 
-   //! accepted are <code> (assumed EPSG), or <proj_name> to match a name in the database.
-   ossimProjection* findProjection(const ossimString& proj_spec) const;
-
-   //! Returns a projection corresponding to the epsg code specified, or NULL if no entry found.
-   ossimProjection* findProjection(ossim_uint32 epsg_code) const;
-
-   //! Given a projection name, assigns the group (e.g., "EPSG") and code of the projection. 
-   //! Returns integer EPSG code if match was found or 0 if not found.
-   ossim_uint32 findProjectionCode(const ossimString& projection_name) const;
-
-   //! Given a projection instance, this method determines the corresponding EPSG code. Obviously
-   //! this is only needed if the projection does not have its PCS code assigned (it is NULL). This
-   //! happens when the projection was constructed with full parameters instead of the EPSG code.
-   //! Returns integer EPSG code if match was found or 0 if not found.
-   ossim_uint32 findProjectionCode(const ossimMapProjection& lost_proj) const;
-
-   //! ### NECESSARY HACK ### (originally implemented by ESH)
-   //! ArcMap (9.2 and less) doesn't understand the non-meters HARN codes.  
-   //! This method provides acess to the projection name given the EPSG code. The name provides 
-   //! enough info for recognizing a non-meters HARN-based projection. 
-   ossimString findProjectionName(ossim_uint32 epsg_code) const;
-
-   //! Populates caller's list with all projections currently represented in the database.
-   //! The format is: 
-   //!    EPSG:<code>  "<Name as appears in Db>"
-   //! There may be duplicate entries if the projection is duplicated in the various Db files.
-   void getProjectionsList(std::vector<ossimString>& typeList) const;
-
-   //! ENGINEERING CODE. Used for testing
-   size_t numRecords() const { return m_projDatabase.size(); }
-
-protected:
-   enum RecordFormat
-   {  
-      NOT_ASSIGNED=0,
-      FORMAT_A,
-      FORMAT_B,
-      FORMAT_C,
-      CUSTOM
-   };
-
-   //! Type for database record consists of EPSG code and serialized form of corresponding OSSIM 
-   //! projection (as a keywordlist)
-   class ProjDbRecord : public ossimReferenced
-   {
-   public:
-      ProjDbRecord() : 
-            code(0), 
-            name(""), 
-            datumValid(false), 
-            csvFormat(NOT_ASSIGNED), 
-            proj(0) {}
-
-      ossim_uint32     code;
-      ossimString      name;
-      bool             datumValid; //!< FALSE if the datum code was not parsed and WGS84 defaulted
-      RecordFormat     csvFormat;
-      std::vector<ossimString>        csvRecord;
-      ossimRefPtr<ossimMapProjection> proj;
-   };
-
-   //! Constructor loads all Db files specified in the ossim prefs. Protected as part of
-   //! singleton implementation.
-   ossimEpsgProjectionDatabase();
-
-   //! Parses the "Spadac EPSG" Db record format and produces a projection (or NULL if invalid)   
-   ossimMapProjection* createProjFromFormatARecord(ProjDbRecord* record) const;
-
-   //! Parses the State Plane Db record format and produce a projection (or NULL if invalid)
-   ossimMapProjection* createProjFromFormatBRecord(ProjDbRecord* record) const;
-
-   //!  ### HACK ###
-   //! UTM projections as specified in the EPSG are indistinguishable from regular TM.
-   //! Unfortunately OSSIM does make a distinction. For the time being, parse the code and
-   //! programmatically arrives at the UTM projection.
-   ossimMapProjection* createProjFromUtmCode(ossim_uint32 code) const;
-
-   //! Given UTM projection, derives the associated EPSG code. This is faster than a Db lookup.
-   ossim_uint32 getCodeFromUtmProj(const ossimUtmProjection* proj) const;
-
-   //! Populates the database with contents of DB files as specified in ossim_preferences.
-   void initialize() const;
-
-   mutable std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> > m_projDatabase;
-   mutable OpenThreads::Mutex m_mutex;
-   //static ossimEpsgProjectionDatabase*  m_instance; //!< Singleton implementation
-   
-};
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimGoogleProjection.h b/ossim/include/ossim/projection/ossimGoogleProjection.h
deleted file mode 100644
index d14a98d..0000000
--- a/ossim/include/ossim/projection/ossimGoogleProjection.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//
-//*******************************************************************
-#ifndef ossimGoogleProjection_HEADER
-#define ossimGoogleProjection_HEADER 1
-#include <ossim/projection/ossimMapProjection.h>
-
-class OSSIM_DLL ossimGoogleProjection : public ossimMapProjection
-{
-public:
-   ossimGoogleProjection(const ossimEllipsoid& ellipsoid = ossimEllipsoid(),
-                        const ossimGpt& origin = ossimGpt());
-   ossimGoogleProjection(const ossimGoogleProjection&);
-   ~ossimGoogleProjection();
-   virtual ossimObject *dup()const{return new ossimGoogleProjection(*this);}
-
-   virtual ossimDpt forward(const ossimGpt &worldPoint)    const;
-   virtual ossimGpt inverse(const ossimDpt &projectedPoint)const;
-   virtual void update();
-
-	virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-	virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
-   virtual bool operator==(const ossimProjection& projection) const;
-
-protected:
-
-	TYPE_DATA;
-};
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimIkonosRpcModel.h b/ossim/include/ossim/projection/ossimIkonosRpcModel.h
deleted file mode 100644
index d0282d1..0000000
--- a/ossim/include/ossim/projection/ossimIkonosRpcModel.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimIkonosRpcModel. This 
-//    derived class implements the capability of reading Ikonos RPC support
-//    data.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimIkonosRpcModel.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimIkonosRpcModel_HEADER
-#define ossimIkonosRpcModel_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/projection/ossimRpcModel.h>
-#include <ossim/support_data/ossimIkonosMetaData.h>
-
-class ossimFilename;
-
-/*!****************************************************************************
- *
- * CLASS:  ossimIkonosRpcModel
- *
- *****************************************************************************/
-class OSSIM_DLL ossimIkonosRpcModel : public ossimRpcModel
-{
-public:
-  ossimIkonosRpcModel();
-   ossimIkonosRpcModel(const ossimFilename& geom_file);
-
-   ossimIkonosRpcModel(const ossimFilename& metadata,
-                       const ossimFilename& rpcdata);
-
-  virtual bool saveState(ossimKeywordlist& kwl,
-			 const char* prefix=0)const;
-
-  /**
-    * @brief loadState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files. Returns true if successful.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-  
-   /*!
-    * STATIC METHOD: writeGeomTemplate(ostream)
-    * Writes a template of an ossimIkonosRpcModel geometry file.
-    */
-   static void writeGeomTemplate(ostream& os);
-
-   virtual bool parseFile(const ossimFilename& file);
-   
-protected:
-   virtual ~ossimIkonosRpcModel();
-   void finishConstruction();
-   void parseMetaData(const ossimFilename& metadata);
-   void parseRpcData (const ossimFilename& rpcdata);
-
-   bool isNitf(const ossimFilename& filename);
-   bool parseTiffFile(const ossimFilename& filename);
-/*    bool parseNitfFile(const ossimFilename& geom_file); */
-   bool parseHdrData(const ossimFilename& data_file);
-
-   ossimRefPtr<ossimIkonosMetaData> theSupportData;
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimImageProjectionModel.h b/ossim/include/ossim/projection/ossimImageProjectionModel.h
deleted file mode 100644
index c67964a..0000000
--- a/ossim/include/ossim/projection/ossimImageProjectionModel.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class declaration of ossimImageProjectionModel.
-//
-//-----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimImageProjectionModel_HEADER
-#define ossimImageProjectionModel_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/imaging/ossimImageModel.h>
-
-class ossimProjection;
-
-/**
- * @brief Class derived from ossimImageModel, this adds an image projection
- * for lineSampleToWorld and worldToLineSample.
- *
- * Note that image points fed to projection methods should be full
- * resolution with any sub image offset applied.
- */
-class OSSIM_DLL ossimImageProjectionModel : public ossimImageModel
-{
-public:
-   
-   /** @brief default constructor */
-   ossimImageProjectionModel();
-
-
-   /**
-    * @brief Method to initialize class from an image handler.
-    *
-    * @param ih Image handler.
-    */
-   virtual void initialize(const ossimImageHandler& ih);
-
-   /**
-    * @brief Method to get projection.
-    *
-    * @return Constant pointer to projection or 0 if not initialized.
-    */
-   const ossimProjection* getProjection() const;
-
-protected:
-   /** @brief virtual destructor */
-   virtual ~ossimImageProjectionModel();
-
-   ossimProjection* theProjection;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimImageProjectionModel_HEADER */
-
diff --git a/ossim/include/ossim/projection/ossimImageViewAffineTransform.h b/ossim/include/ossim/projection/ossimImageViewAffineTransform.h
deleted file mode 100644
index b576aba..0000000
--- a/ossim/include/ossim/projection/ossimImageViewAffineTransform.h
+++ /dev/null
@@ -1,188 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimImageViewAffineTransform.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimImageViewAffineTransform_HEADER
-#define ossimImageViewAffineTransform_HEADER
-#include <ossim/projection/ossimImageViewTransform.h>
-#include <ossim/matrix/newmat.h>
-
-class OSSIMDLLEXPORT ossimImageViewAffineTransform: public ossimImageViewTransform
-{
-public:
-   ossimImageViewAffineTransform(double rotateDegrees = 0.0,
-                                 double imageScaleX = 1.0,
-                                 double imageScaleY = 1.0,
-                                 double scaleXValue = 1.0,
-                                 double scaleYValue = 1.0,
-                                 double translateXValue = 0.0,
-                                 double translateYValue = 0.0,
-                                 double pivotXValue = 0.0,
-                                 double pivotYValue = 0.0 );
-   virtual ~ossimImageViewAffineTransform();
-   
-   ossimImageViewAffineTransform(const ossimImageViewAffineTransform& src)
-   :ossimImageViewTransform(src),
-   m_transform(src.m_transform),
-   m_inverseTransform(src.m_inverseTransform),
-   m_rotation(src.m_rotation),
-   m_imageSpaceScale(src.m_imageSpaceScale),
-   m_scale(src.m_scale),
-   m_translate(src.m_translate),
-   m_pivot(src.m_pivot)
-   {
-   }
-   virtual ossimObject* dup()const
-   {
-      return new ossimImageViewAffineTransform(*this);
-   }
-//   virtual void inverse(const ossimDpt& input,
-//                        ossimDpt&       output) const
-//   {
-//      viewToImage(input, output);
- //  }
-   
-   virtual void imageToView(const ossimDpt& imagePoint,
-                            ossimDpt&       viewPoint)const;
-   virtual void viewToImage(const ossimDpt& viewPoint,
-                            ossimDpt&       imagePoint)const;
-   void setMatrix(NEWMAT::Matrix& matrix);
-   const NEWMAT::Matrix& getMatrix()const;
-   
-   virtual bool isIdentity()const
-   {
-      return ((m_transform[0][0] == 1.0)&&
-              (m_transform[0][1] == 0.0)&&
-              (m_transform[0][2] == 0.0)&&
-              (m_transform[1][0] == 0.0)&&
-              (m_transform[1][1] == 1.0)&&
-              (m_transform[1][2] == 0.0)&&
-              (m_transform[2][0] == 0.0)&&
-              (m_transform[2][1] == 0.0)&&
-              (m_transform[2][2] == 1.0));
-   }
-
-   virtual bool isValid()const;
-   virtual bool setView(ossimObject* obj);
-   virtual ossimObject* getView();
-   virtual const ossimObject* getView()const;
-   
-   /** @return (1, 1) ???????(drb) */
-   virtual ossimDpt getInputMetersPerPixel()const;
-
-   /** @return (nan, nan) ????????? (drb) */
-   virtual ossimDpt getOutputMetersPerPixel()const;
-   
-   /*!
-    * Translate in the x and y direction.
-    */ 
-   virtual void translate(double deltaX, double deltaY);
-   
-   /*!
-    * Translate in the x direction.
-    */
-   virtual void translateX(double deltaX);
-   
-   /*!
-    * Translate in the Y direction.
-    */
-   virtual void translateY(double deltaY);
-   
-   /*!
-    * Translate the origin for rotation in the x and y direction.
-    */
-   virtual void pivot(double originX, double originY);
-   
-   /*!
-    * Translate the origin for rotation in the x direction.
-    */
-   virtual void pivotX(double originX);
-   
-   /*!
-    * Translate the origin for rotation in the y direction.
-    */
-   virtual void pivotY(double originY);
-
-   /*!
-    * Will allow you to specify an image scale
-    * for both the x and y direction.
-    */
-   virtual void imageSpaceScale(double x, double y);
-   
-   /*!
-    * Will allow you to specify an image scale along the X direction.
-    */
-   virtual void imageSpaceScaleX(double x);
-
-   /*!
-    * Will allow you to an image scale along the Y direction.
-    */
-   virtual void imageSpaceScaleY(double y);
-    
-   /*!
-    * will allow you to specify a scale
-    * for both the x and y direction.
-    */
-   virtual void scale(double x, double y);
-    
-   /*!
-    * will alow you to specify a scale
-    * along the X direction.
-    */
-   virtual void scaleX(double x);
-   
-   /*!
-    * Will allow you to scale along the Y
-    * direction.
-    */
-   virtual void scaleY(double y);
-   
-   /*!
-    * Will apply a rotation
-    */
-   virtual void rotate(double degrees);
-   
-   ossim_float64 getRotation()const{return m_rotation;}
-   const ossimDpt& getScale()const{return m_scale;}
-   const ossimDpt& getTranslate()const{return m_translate;}
-   const ossimDpt& getPivot()const{return m_pivot;}
-   
-   
-   virtual bool isEqualTo(const ossimObject& obj, ossimCompareType compareType = OSSIM_COMPARE_FULL)const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix =0);
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix =0)const;
-   
-   
-protected:
-   void buildCompositeTransform();
-   
-   /*!
-    * This is the transformation from image to
-    * viewing coordinates.  If this matrix is
-    * changed it will perform an inverse to solve
-    * the inverse transform.
-    */
-   NEWMAT::Matrix m_transform;
-   NEWMAT::Matrix m_inverseTransform;
-   ossim_float64  m_rotation;
-   ossimDpt       m_imageSpaceScale;
-   ossimDpt       m_scale;
-   ossimDpt       m_translate;
-   ossimDpt       m_pivot;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimImageViewProjectionTransform.h b/ossim/include/ossim/projection/ossimImageViewProjectionTransform.h
deleted file mode 100644
index 4e964b3..0000000
--- a/ossim/include/ossim/projection/ossimImageViewProjectionTransform.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// AUTHOR: Garrett Potts (gpotts at imagelinks.com)  
-//         Oscar Kramer (oscar at krameranalytic.com)
-//
-// DESCRIPTION: Contains declaration of ossimImageViewProjectionTransform.
-//    This class provides an image to view transform that utilizes two
-//    independent 2D-to-3D projections. Intended for transforming view to
-//    geographic "world" space to input image space.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimImageViewProjectionTransform.h 20352 2011-12-12 17:24:52Z dburken $
-
-#ifndef ossimImageViewProjectionTransform_HEADER
-#define ossimImageViewProjectionTransform_HEADER 1
-
-#include <ossim/projection/ossimImageViewTransform.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-
-class OSSIMDLLEXPORT ossimImageViewProjectionTransform : public ossimImageViewTransform
-{
-public:
-   ossimImageViewProjectionTransform(ossimImageGeometry* imageGeometry=0,
-                                     ossimImageGeometry* viewGeometry=0);
-
-   //! copy constructor 
-   ossimImageViewProjectionTransform(const ossimImageViewProjectionTransform& src);
-
-   virtual ossimObject* dup() const { return new ossimImageViewProjectionTransform(*this); }
-   virtual ~ossimImageViewProjectionTransform();
-
-   //! Satisfies base class pure virtual. Returns TRUE if both input and output geoms exist.
-   virtual bool isValid() const { return (m_imageGeometry.valid() && m_viewGeometry.valid()); }
-
-   //! Returns TRUE if both input and output geometries are identical. Presently implemented as
-   //! limited compare of geometry pointers
-   virtual bool isIdentity() const { return (m_imageGeometry == m_viewGeometry); }
-
-   //! Assigns the geometry to use for output view. This object does NOT own the geometry.
-   void setViewGeometry(ossimImageGeometry* g) { m_viewGeometry = g; }   
-
-   //! Assigns the geometry to use for input image. This object does NOT own the geometry.
-   void setImageGeometry(ossimImageGeometry* g) { m_imageGeometry = g; }  
-
-   //! Workhorse of the object. Converts image-space to view-space.
-   virtual void imageToView(const ossimDpt& imagePoint, ossimDpt& viewPoint) const;
-
-   //! Other workhorse of the object. Converts view-space to image-space.
-   virtual void viewToImage(const ossimDpt& viewPoint, ossimDpt& imagePoint) const;
-
-   //! Dumps contents to stream
-   virtual std::ostream& print(std::ostream& out) const;
-   
-   ossimImageGeometry* getImageGeometry()  { return m_imageGeometry.get(); }
-   ossimImageGeometry* getViewGeometry()   { return m_viewGeometry.get(); }
-   const ossimImageGeometry* getImageGeometry()const  { return m_imageGeometry.get(); }
-   const ossimImageGeometry* getViewGeometry()const   { return m_viewGeometry.get(); }
-   
-   //! OLK: Not sure where this is used, but needed to satisfy ossimViewInterface base class.
-   //! The ownership flag is ignored.
-   virtual bool setView(ossimObject* baseObject);
-   virtual       ossimObject* getView()       { return m_viewGeometry.get(); }
-   virtual const ossimObject* getView() const { return m_viewGeometry.get(); }
-
-   //! Returns the GSD of input image.
-   virtual ossimDpt getInputMetersPerPixel()const;
-
-   //! Returns the GSD of the output view.
-   virtual ossimDpt getOutputMetersPerPixel() const;
-
-   //! Gets the image bounding rect in view-space coordinates
-   virtual ossimDrect getImageToViewBounds(const ossimDrect& imageRect)const;
-   
-   //! After rewrite for incorporating ossimImageGeometry: No longer needed.  
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix =0);
-   
-   //! After rewrite for incorporating ossimImageGeometry: No longer needed.  
-   virtual bool saveState(ossimKeywordlist& kwl, const char* prefix = 0)const;
-
-protected:
-
-   /**
-    * @brief Initializes the view geometry image size from image geometry
-    * bounding rect.
-    *
-    * This is needed for the ossimImageGeometry::worldToLocal if the underlying
-    * projection is geographic to handle images that cross the date line.
-    * 
-    * @param Input image rectangle.
-    * @return true on success, false on error.
-    */
-   bool initializeViewSize();  
-   
-   ossimRefPtr<ossimImageGeometry> m_imageGeometry;
-   ossimRefPtr<ossimImageGeometry> m_viewGeometry;
-   
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimLensDistortion.h b/ossim/include/ossim/projection/ossimLensDistortion.h
deleted file mode 100644
index fce7ab8..0000000
--- a/ossim/include/ossim/projection/ossimLensDistortion.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// MIT
-// 
-// Author:  Garrett Potts (gpotts at imagelinks.com)
-//
-// Description:
-//
-// ossimLensDistortion
-//*******************************************************************
-//  $Id: ossimLensDistortion.h 23666 2015-12-14 20:01:22Z rashadkm $
-
-#ifndef ossimLensDistortion_HEADER
-#define ossimLensDistortion_HEADER
-#include <ossim/base/ossim2dTo2dTransform.h>
-class OSSIM_DLL ossimLensDistortion : public ossim2dTo2dTransform
-{
-public:
-   ossimLensDistortion(const ossimDpt& callibratedCenter=ossimDpt(0,0))
-      :theCenter(callibratedCenter)
-   {
-   }
-   void setCenter(const ossimDpt& center)
-   {
-      theCenter = center;
-   }
-   virtual void forward(const ossimDpt& input,
-                        ossimDpt& output) const
-   {
-      distort(input, output);
-   }
-   virtual void inverse(const ossimDpt& input,
-                        ossimDpt& output)
-   {
-      undistort(input, output);
-   }
-   virtual void distort(const ossimDpt& input, ossimDpt& output)const;
-   virtual void undistort(const ossimDpt& input, ossimDpt& output)const=0;
-
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0)const;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-   
-protected:
-   ossimDpt theCenter;
-
-TYPE_DATA   
-};
-#endif
diff --git a/ossim/include/ossim/projection/ossimMapProjectionFactory.h b/ossim/include/ossim/projection/ossimMapProjectionFactory.h
deleted file mode 100644
index 652fa70..0000000
--- a/ossim/include/ossim/projection/ossimMapProjectionFactory.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  Garrett Potts
-//
-// Description:
-//
-// class ossimProjectionFactory maintains a static list of projection
-// makers.  If a user wants to create a projection they can pass in
-// a projection name and a datum if desired.  Currently the default
-// datum will be WGS84.
-//*******************************************************************
-//  $Id: ossimMapProjectionFactory.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimMapProjectionFactory_HEADER
-#define ossimMapProjectionFactory_HEADER
-
-#include <ossim/projection/ossimProjectionFactoryBase.h>
-
-class ossimProjection;
-class ossimString;
-
-class OSSIMDLLEXPORT ossimMapProjectionFactory : public ossimProjectionFactoryBase
-{
-public:
-   /*!
-    * METHOD: instance()
-    * Instantiates singleton instance of this class:
-    */
-   static ossimMapProjectionFactory* instance();
-
-   virtual ossimProjection* createProjection(const ossimFilename& filename,
-                                             ossim_uint32 entryIdx)const;
-   /*!
-    * METHOD: create()
-    * Attempts to create an instance of the projection specified by name.
-    * Returns successfully constructed projection or NULL.
-    */
-   virtual ossimProjection* createProjection(const ossimString& name)const;
-   virtual ossimProjection* createProjection(const ossimKeywordlist& kwl,
-                                             const char* prefix = 0)const;
-   virtual ossimObject* createObject(const ossimString& typeName)const;
-
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const;
-   
-   /*!
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-
-protected:
-   ossimMapProjectionFactory() {}
-   static ossimMapProjectionFactory*  theInstance;
- 
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimMapProjectionInfo.h b/ossim/include/ossim/projection/ossimMapProjectionInfo.h
deleted file mode 100644
index 39f6512..0000000
--- a/ossim/include/ossim/projection/ossimMapProjectionInfo.h
+++ /dev/null
@@ -1,277 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// Class for encapsulate projection info given a projection, datum, and
-// output rectangle.
-//
-// NOTE:
-// - Output rectangle should be relative to the center of pixels.
-//   Shifts will be made for "pixel is area" internally.
-//
-//*******************************************************************
-//  $Id: ossimMapProjectionInfo.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimMapProjectionInfo_HEADER
-#define ossimMapProjectionInfo_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimString.h>
-
-class ossimMapProjection;
-class ossimImageChain;
-
-class OSSIMDLLEXPORT ossimMapProjectionInfo : public ossimObject
-{
-public:
-
-   ossimMapProjectionInfo(const ossimMapProjection* proj,
-                          const ossimDrect& output_rect);
-
-   virtual ~ossimMapProjectionInfo();
-
-   /**
-    *  Returns true on error false if ok.
-    */
-   bool errorStatus() const;
-
-   /**
-    * Adds tie point to keyword list.  This will be latitude, longitude if
-    * projection is geographic; else, easting, northing.
-    */
-   void getGeom(ossimKeywordlist& kwl, const char* prefix=0)const;
-
-   /**
-    *  Returns the pixel size in meters.
-    *  x = sample direction
-    *  y = line direction
-    */
-   ossimDpt getMetersPerPixel() const;
-   
-   /**
-    *  Returns the pixel size in U.S. Survey feet.
-    *  x = sample direction
-    *  y = line direction
-    *
-    *  NOTE:
-    *  The US survey feet per meter converion (0.3048006096 feet per meter)
-    *  is NOT the same as the standard feet per meter conversion
-    *  (0.3048 feet per meter).
-    */
-   ossimDpt getUsSurveyFeetPerPixel() const;
-
-   /**
-    *  Returns the decimal degrees per pixel.
-    *  x = sample direction
-    *  y = line direction
-    */
-   ossimDpt getDecimalDegreesPerPixel() const;
-   
-   /**
-    *  Returns the upper left easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v". Units are in meters.
-    */
-   ossimDpt ulEastingNorthingPt() const;
-
-   /**
-    *  Returns the upper right easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v". Units are in meters.
-    */
-   ossimDpt urEastingNorthingPt() const;
-
-   /**
-    *  Returns the lower right easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v". Units are in meters.
-    */
-   ossimDpt lrEastingNorthingPt() const;
-
-   /**
-    *  Returns the lower left easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v". Units are in meters.
-    */
-   ossimDpt llEastingNorthingPt() const;
-   
-   /**
-    *  Returns the upper left easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v".
-    *  Units are in U.S. Survey feet.
-    */
-   ossimDpt ulEastingNorthingPtInFt() const;
-
-   /**
-    *  Returns the upper right easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v".
-    *  Units are in U.S. Survey feet.
-    */
-   ossimDpt urEastingNorthingPtInFt() const;
-
-   /**
-    *  Returns the lower right easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v".
-    *  Units are in U.S. Survey feet.
-    */
-   ossimDpt lrEastingNorthingPtInFt() const;
-
-   /**
-    *  Returns the lower left easting and northing as a ossimDpt.
-    *  The easting is "u" and the northing is "v". 
-    *  Units are in U.S. Survey feet.
-    */
-   ossimDpt llEastingNorthingPtInFt() const;
-   
-   /**
-    * Returns the upper left ground point.
-    */
-   ossimGpt ulGroundPt() const;
-
-   /**
-    * Returns the upper right ground point.
-    */
-   ossimGpt urGroundPt() const;
-
-   /**
-    * Returns the lower right ground point.
-    */
-   ossimGpt lrGroundPt() const;
- 
-   /**
-    * Returns the lower left ground point.
-    */
-   ossimGpt llGroundPt() const;
-
-   /**
-    * Returns the center ground point.
-    */
-   ossimGpt centerGroundPt() const;
-
-   /** @return The center ground point. */
-   ossimDpt centerEastingNorthingPt() const;
-
-   /** @return The lines per image. */
-   ossim_int32 linesPerImage() const;
-
-   /** @return The pixels per line (samples). */
-   ossim_int32 pixelsPerLine() const;
-
-   /**
-    * Formatted print of data members.  Used by operator <<.
-    */
-   std::ostream& print(std::ostream& os) const;
-
-   /**
-    *  Sets the data member "thePixelType".
-    *  NOTE:
-    *  PIXEL_IS_POINT (ennumerated to a "0"):
-    *  Corner coordinates are relative to the center of pixel.
-    *  PIXEL_IS_AREA (ennumerated to a "1"):
-    *  Corner coordinates are relative to the outer edge of the pixel.
-    */
-   void setPixelType (ossimPixelType type);
-
-   /**
-    *  Returns data member "thePixelType".
-    *  NOTE:
-    *  OSSIM_PIXEL_IS_POINT (ennumerated to a "0"):
-    *  Corner coordinates are relative to the center of pixel.
-    *  OSSIM_PIXEL_IS_AREA (ennumerated to a "1"):
-    *  Corner coordinates are relative to the outer of the pixel.
-    */
-   ossimPixelType  getPixelType () const;
-
-   /**
-    * Sets the data member "theOutputInfoInFeetFlag".
-    */
-   void setOutputFeetFlag (bool flag);
-
-   /**
-    *  Returns the data member "theOutputInfoInFeetFlag".
-    *  True = feet, false = meters.
-    */
-   bool unitsInFeet() const;
-
-   /**
-    * Returns theImageInfoString.
-    */
-   ossimString getImageInfoString () const;
-
-   /**
-    *  Used to set data member "theImageInfoString".  This will be output
-    *  in the "Image: " field of the README file.
-    */
-   void setImageInfoString (const ossimString& string);
-
-   /**
-    * Returns reference to "theProjection".
-    */
-   const ossimMapProjection* getProjection() const;
-
-   //****
-   // Keywords for getStateFrom/saveStateTo.
-   //***
-   static const char* README_IMAGE_STRING_KW;
-   static const char* PIXEL_TYPE_KW;
-   static const char* OUTPUT_US_FT_INFO_KW;
-   
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-   
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0) const;
-   
-private:
-
-   // Do not permit construction with void args.
-   ossimMapProjectionInfo();
-   ossimMapProjectionInfo& operator=(const ossimMapProjectionInfo&);
-   
-   void initializeMembers(const ossimDrect& output_rect);
-   
-   const ossimMapProjection* theProjection;
-   mutable bool              theErrorStatus;
-   int                       theLinesPerImage;
-   int                       thePixelsPerLine;
-   ossimGpt                  theCornerGroundPt[4];
-   ossimDpt                  theCornerEastingNorthingPt[4];
-   ossimGpt                  theCenterGroundPt;
-   ossimDpt                  theCenterEastingNorthingPt;
-   ossimDrect                theBoundingRect;
-   
-   /**
-    *   "thePixelType" defines whether the tie point coordinates are
-    *   relative to the center of the pixel(which is PIXEL_IS_POINT) or
-    *   the upper left corner of the pixel(PIXEL_IS_AREA).  The default
-    *   pixle type is PIXEL_IS_POINT.
-    */
-   ossimPixelType                 thePixelType;
-
-   /**
-    *   If "theOutputInfoInFeetFlag" is true the readme file tie point
-    *   info will be output in both meters and U.S. feet.
-    *   NOTE:
-    *   U.S. feet conversion is "meters/0.3048006096" not the standard
-    *   "meters/0.3048".
-    *   Reference for U.S. feet value:
-    *   U.S.G.S. "Map Projections - A Working Manual" USGS Professional
-    *   paper 1395 page 51.
-    */
-   bool                      theOutputInfoInFeetFlag;
-
-   /**
-    *   "theImageInfoString" goes in the README file "Image:" field
-    *   to identify the image.
-    */
-   ossimString               theImageInfoString;
-};
-
-#endif /* End of #ifndef ossimMapProjectionInfo_HEADER */
-
diff --git a/ossim/include/ossim/projection/ossimMeanRadialLensDistortion.h b/ossim/include/ossim/projection/ossimMeanRadialLensDistortion.h
deleted file mode 100644
index 1e4bbf1..0000000
--- a/ossim/include/ossim/projection/ossimMeanRadialLensDistortion.h
+++ /dev/null
@@ -1,119 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// MIT
-// 
-// Author:  Garrett Potts (gpotts at imagelinks.com)
-//
-// Description:
-//
-// MeanRadialLensDistortion
-//*******************************************************************
-//  $Id: ossimMeanRadialLensDistortion.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimMeanRadialLensDistortion_HEADER
-#define ossimMeanRadialLensDistortion_HEADER
-#include <vector>
-#include <ossim/matrix/newmat.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/projection/ossimLensDistortion.h>
-class ossimMeanRadialLensDistortion : public ossimLensDistortion
-{
-public:
-   ossimMeanRadialLensDistortion()
-   {
-      theCoefficients.resize(4);
-      theCoefficients[0] = 0.0;
-      theCoefficients[1] = 0.0;
-      theCoefficients[2] = 0.0;
-      theCoefficients[3] = 0.0;
-   }
-
-  /*!
-   * Instantiate a ossimMeanRadialLens with the calibrated data.
-   * The data consists of the Principal point,
-   * focal distance, radialDistance measures for the distortion
-   * deltas, the radial distortion values.
-   * 
-   * example of construction:
-   *
-   * lets say we have the following:
-   *
-   * principal point = (.008 , -.001) mm
-   *
-   * and
-   *
-   * field angle       radial distance       deltaR (distortion)
-   *_____________________________________________________________
-   *  7.5 deg.             .004 mm             .0202 mm
-   *  15 deg.              .007 mm             .0411 mm
-   *  22.5 deg.            .007 mm             .0635 mm
-   *  :
-   *  :
-   *  :
-   *
-   * then construct the ossimMeanRadialLensDistortion class to construct the
-   * given focal length and principal point and the middle column as
-   * the radial distance column vector and the third column as the
-   * distortion values.
-   */
-/*    ossimMeanRadialLensDistortion(ossimDpt    calibratedPrincipalPoint, */
-/*                                  const NEWMAT::ColumnVector &radialDistance, */
-/*                                  const NEWMAT::ColumnVector &radialDistortion) */
-   ossimMeanRadialLensDistortion(ossimDpt    calibratedPrincipalPoint,
-                                 const NEWMAT::ColumnVector &radialDistance,
-                                 const NEWMAT::ColumnVector &radialDistortion)
-      :ossimLensDistortion(calibratedPrincipalPoint)
-  {
-     theCoefficients.resize(4);
-     solveCoefficients(radialDistance, radialDistortion);
-  }
-      
-  /*!
-   * Returns the coefficients (k1, k2, k3, k4) for the deltaR polynomial:
-   *
-   *    deltaR = k1*r + k2*r^3 + k3*r^5 + k4*r^7
-   */
-  const std::vector<double>& getCoefficients()const{return theCoefficients;}
-  std::vector<double>& getCoefficients(){return theCoefficients;}
-
-
-//  ossimDpt adjustPoint(const ossimDpt &position)const;
-  virtual std::ostream& print(std::ostream& out) const
-  {return out;}
-
-  /*!
-   * dletaR computes how much we should adjust r.  The
-   * return value is the adjustment amount.  This method is used
-   * by adjustPoint.
-   */
-  double deltaR(double r)const;
-
-  virtual void undistort(const ossimDpt& input, ossimDpt& output)const;
-  
-  /*!
-   * solves the coefficients given the radial distances and distortion
-   * for each distance.
-   */
-  void solveCoefficients(const NEWMAT::ColumnVector &radialDistance,
-			 const NEWMAT::ColumnVector &radialDistortion);
-  /*!
-   * solves the coefficients given the radial distances and distortion
-   * for each distance.
-   */
-  void solveCoefficients(const std::vector<double>& radialDistance,
-			 const std::vector<double>& radialDistortion);
-  
-  virtual bool saveState(ossimKeywordlist& kwl,
-                         const char* prefix = 0)const;
-  
-  virtual bool loadState(const ossimKeywordlist& kwl,
-                         const char* prefix = 0);
-  
-protected:
-  std::vector<double> theCoefficients;
-  
-TYPE_DATA  
-};
-
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimNgaProjectionFactory.h b/ossim/include/ossim/projection/ossimNgaProjectionFactory.h
deleted file mode 100644
index 422b8c7..0000000
--- a/ossim/include/ossim/projection/ossimNgaProjectionFactory.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2014 RadiantBlue, Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-//*******************************************************************
-//  $Id$
-#ifndef ossimNgaProjectionFactory_HEADER
-#define ossimNgaProjectionFactory_HEADER
-
-#include <ossim/projection/ossimProjectionFactoryBase.h>
-
-class OSSIM_DLL ossimNgaProjectionFactory : public ossimProjectionFactoryBase
-{
-public:
-   
-   static ossimNgaProjectionFactory* instance();
-
-   /**
-    * takes a filename. This filename can be an image file or
-    * it can also be a ossim .geom file.  It could be other
-    * forms of geom files as well.  The factories job will be to
-    * determine what parser to use and return a projection if
-    * successful.
-    */
-   virtual ossimProjection* createProjection(const ossimFilename& filename,
-                                             ossim_uint32 entryIdx)const;
-
-   /**
-    * Take a projection type name.
-    */
-   virtual ossimProjection* createProjection(const ossimString& name)const;
-
-   /**
-    * Take a keywordlist.
-    */
-   virtual ossimProjection* createProjection(const ossimKeywordlist& kwl,
-                                             const char* prefix)const;
-   
-   virtual ossimObject* createObject(const ossimString& typeName)const;
-
-   /*!
-    * Creates and object given a keyword list.
-    */
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0) const;
-
-   /*!
-     * This should return the type name of all objects in all factories.
-     * This is the name used to construct the objects dynamially and this
-     * name must be unique.
-     */
-    virtual void getTypeNameList(std::vector<ossimString>& typeList)const;
-
-protected:
-    //! Constructor loads all SRS CSV files specified in the ossim prefs. Protected as part of
-    //! singleton implementation.
-    ossimNgaProjectionFactory() {}
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimNitfRpcModel.h b/ossim/include/ossim/projection/ossimNitfRpcModel.h
deleted file mode 100644
index e50a52b..0000000
--- a/ossim/include/ossim/projection/ossimNitfRpcModel.h
+++ /dev/null
@@ -1,116 +0,0 @@
-//*****************************************************************************
-// FILE: ossimNitfRpcModel.h
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains declaration of class ossimNitfRpcModel. This 
-//    derived class implements the capability of reading Nitf RPC support
-//    data.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimNitfRpcModel.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimNitfRpcModel_HEADER
-#define ossimNitfRpcModel_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/projection/ossimRpcModel.h>
-
-class ossimFilename;
-class ossimNitfImageHeader;
-
-/*!****************************************************************************
- *
- * CLASS:  ossimNitfRpcModel
- *
- *****************************************************************************/
-class OSSIM_DLL ossimNitfRpcModel : public ossimRpcModel
-{
-public:
-   ossimNitfRpcModel();
-   ossimNitfRpcModel(const ossimNitfRpcModel& rhs);
-   ossimNitfRpcModel(const ossimFilename& nitfFile);
-   virtual ossimObject* dup() const;
-
-   /**
-    * @brief worldToLineSample()
-    * Calls ossimRpcModel::worldToLineSample(), then applies (if needed)
-    * decimation.
-    * This is a temp work around for decimation RPC NITFs.
-    */
-   virtual void  worldToLineSample(const ossimGpt& world_point,
-                                   ossimDpt&       image_point) const;
-
-   /**
-    * @brief lineSampleHeightToWorld()
-    * Backs out decimation of image_point (if needed) then calls:
-    * ossimRpcModel::lineSampleHeightToWorld
-    * This is a temp work around for decimation RPC NITFs.
-    */
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPoint) const;
-
-   /**
-    * @brief Saves "decimation".  Then calls ossimRpcModel::saveState.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-
-   /**
-    * @brief Looks for decimation. Then calls ossimRpcModel::loadState.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * @brief Method to parse an nitf file and initialize model.
-    * @param entryIndex The entry to get model for.  Note the nitf's can have
-    * multiple entries; each with a different projection.
-    * @return true on success, false on error.
-    */
-   virtual bool parseFile(const ossimFilename& nitfFile,
-                          ossim_uint32 entryIndex=0);
-   
-   virtual bool parseImageHeader(const ossimNitfImageHeader* ih);
-private:
-
-   /**
-    * Attempts to get gsd from nitf tags and initialize
-    * ossimSensorModel::theGsd.
-    * 
-    * If unsuccessful  theGsd will be initialized to OSSIM_DBL_NAN.
-    */
-   void getGsd(const ossimNitfImageHeader* ih);
-
-   /**
-    * Attempts to get sensor ID from nitf tags and initialize
-    * ossimSensorModel::theSensorID.
-    * 
-    * If unsuccessful  theGsd will be initialized to UNKNOWN.
-    */
-   void getSensorID(const ossimNitfImageHeader* ih);
-
-   /**
-    * Get model information from either the RPC00A or RPC00B tag.
-    * @return true on success, false on error.
-    */
-   bool getRpcData(const ossimNitfImageHeader* ih);
-
-   /**
-    * Stored from header field "IMAG".  This is a temp work around to handle
-    * decimated rpc nitf's.
-    */
-   ossim_float64 theDecimation;
-
-   TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimNitfRsmModel.h b/ossim/include/ossim/projection/ossimNitfRsmModel.h
deleted file mode 100644
index f8d46b7..0000000
--- a/ossim/include/ossim/projection/ossimNitfRsmModel.h
+++ /dev/null
@@ -1,92 +0,0 @@
-//---
-// File: ossimNitfRsmModel.h
-//---
-#ifndef ossimNitfRsmModel_HEADER
-#define ossimNitfRsmModel_HEADER 1
-
-#include <ossim/projection/ossimRsmModel.h>
-
-class ossimNitfImageHeader;
-class ossimNitfRsmecaTag;
-class ossimNitfRsmidaTag;
-class ossimNitfRsmpcaTag;
-class ossimNitfRsmpiaTag;
-
-/**
- * @class ossimNitfRsmModel
- */
-class OSSIM_DLL ossimNitfRsmModel : public ossimRsmModel
-{
-public:
-
-   /** @brief default constructor */
-   ossimNitfRsmModel();
-
-   /** @brief copy constructor */
-   ossimNitfRsmModel( const ossimNitfRsmModel& obj );
-
-   /** @brief assignment operator */
-   const ossimNitfRsmModel& operator=( const ossimNitfRsmModel& rhs );
-
-   virtual bool parseFile(const ossimFilename& nitfFile,
-                          ossim_uint32 entryIndex=0);
-
-   virtual bool parseImageHeader(const ossimNitfImageHeader* ih);
-
-   bool getRsmData(const ossimNitfImageHeader* ih);
-
-   /**
-    * @brief saveState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files. Returns true if successful.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-   
-   /**
-    * @brief loadState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files. Returns true if successful.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * @brief dup()
-    * Returns pointer to a new instance, copy of this.
-    */
-   virtual ossimObject* dup() const;
-
-   /**
-    * @brief Initializes model from RSMECA tag.
-    * @param rsmecaTag
-    */
-   bool initializeModel( const ossimNitfRsmecaTag* rsmecaTag );
-
-   /**
-    * @brief Initializes model from RSMECA tag.
-    * @param rsmecaTag
-    */
-   bool initializeModel( const ossimNitfRsmidaTag* rsmidaTag );
-   
-   /**
-    * @brief Initializes model from RSMECA tag.
-    * @param rsmecaTag
-    */ 
-   bool initializeModel( const ossimNitfRsmpiaTag* rsmpiaTag );
-   
-   /**
-    * @brief Initializes model from RSMECA tag.
-    * @param rsmecaTag
-    */   
-   bool initializeModel( const ossimNitfRsmpcaTag* rsmpcaTag );
-
-protected:
-   /** @brief virtual destructor */
-   virtual ~ossimNitfRsmModel();
-
-   TYPE_DATA
-      
-}; // End: class ossimRsmModel
-
-#endif /* #ifndef ossimNitfRsmModel_HEADER */
diff --git a/ossim/include/ossim/projection/ossimQuickbirdRpcModel.h b/ossim/include/ossim/projection/ossimQuickbirdRpcModel.h
deleted file mode 100644
index 14a6e98..0000000
--- a/ossim/include/ossim/projection/ossimQuickbirdRpcModel.h
+++ /dev/null
@@ -1,86 +0,0 @@
-//*****************************************************************************
-// FILE: ossimQuickbirdRpcModel.h
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// DESCRIPTION: Contains declaration of class ossimQuickbirdRpcModel. This 
-//    derived class implements the capability of reading Quickbird RPC support
-//    data.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimQuickbirdRpcModel.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimQuickbirdRpcModel_HEADER
-#define ossimQuickbirdRpcModel_HEADER
-
-#include <ossim/projection/ossimRpcModel.h>
-#include <ossim/support_data/ossimQuickbirdMetaData.h>
-
-class ossimFilename;
-class ossimQuickbirdMetaData;
-class ossimQbTileFilesHandler;
-
-/*!****************************************************************************
- *
- * CLASS:  ossimQuickbirdRpcModel
- *
- *****************************************************************************/
-class ossimQuickbirdRpcModel : public ossimRpcModel
-{
-public:
-   ossimQuickbirdRpcModel();
-   ossimQuickbirdRpcModel(const ossimQuickbirdRpcModel& rhs);
-
-   //! Initializes
-   ossimQuickbirdRpcModel(const ossimQbTileFilesHandler* handler);
-   ~ossimQuickbirdRpcModel();
-
-   virtual ossimObject* dup() const;
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual bool parseFile(const ossimFilename& file);
-   
-   void setSupportData(ossimQuickbirdMetaData* supportData)
-   {
-      theSupportData = supportData;
-   }
-   ossimQuickbirdMetaData* getSupportData()
-   {
-      return theSupportData.get();
-   }
-   const ossimQuickbirdMetaData* getSupportData()const
-   {
-      return theSupportData.get();
-   }
-protected:
-   bool parseNitfFile(const ossimFilename& file);
-   bool parseTiffFile(const ossimFilename& file);
-   bool parseMetaData(const ossimFilename& file);
-   bool parseRpcData (const ossimFilename& file);
-   bool parseTileData(const ossimFilename& file);
-
-   //! Given an initial filename with case-agnostic extension, this method searches first for an
-   //! image-specific instance of that file (i.e., with _R*C* in the filename) before considering
-   //! the mosaic-global support file (_R*C* removed). If a file is found, the argument is modified 
-   //! to match the actual filename and TRUE is returned. Otherwise, argument filename is left 
-   //! unchanged and FALSE is returned.
-   bool findSupportFile(ossimFilename& file) const;
-
-void finishConstruction();
-
-   ossimRefPtr<ossimQuickbirdMetaData> theSupportData;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimRpcProjection.h b/ossim/include/ossim/projection/ossimRpcProjection.h
deleted file mode 100644
index 347d0a5..0000000
--- a/ossim/include/ossim/projection/ossimRpcProjection.h
+++ /dev/null
@@ -1,238 +0,0 @@
-//*****************************************************************************
-// FILE: ossimRpcProjection.h
-//
-// MIT
-//
-// DESCRIPTION: Contains declaration of class ossimRpcProjection.
-//   This is a replacement model utilizing the Rational Polynomial Coefficients
-//   (RPC), a.k.a. Rapid Positioning Capability, and Universal Sensor Model
-//   (USM).
-//
-//*****************************************************************************
-//  $Id: ossimRpcProjection.h 23666 2015-12-14 20:01:22Z rashadkm $
-
-#ifndef ossimRpcProjection_HEADER
-#define ossimRpcProjection_HEADER
-
-#include <ossim/projection/ossimOptimizableProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/base/ossimAdjustableParameterInterface.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/matrix/newmat.h>
-
-/*!****************************************************************************
- *
- * CLASS:  ossimRpcProjection
- *
- *****************************************************************************/
-class OSSIM_DLL ossimRpcProjection : public ossimProjection,
-                                     public ossimOptimizableProjection,
-                                     public ossimAdjustableParameterInterface
-{
-public:
-   //***
-   // Enumeration of supported RPC polynomial formats:
-   //***
-   enum PolynomialType
-   {
-      A='A',  // corresponds to "RPC00A"
-      B='B'   // corresponds to "RPC00B"
-   };
-   
-   /*!
-    * CONSTRUCTORS:
-    */
-   ossimRpcProjection();
-   ossimRpcProjection(const ossimRpcProjection& copy_this);
-   ~ossimRpcProjection();
-
-   ossimRpcProjection& operator=(const ossimRpcProjection& source);
-
-   void initAdjustableParameters();
-   virtual void adjustableParametersChanged();
-   
-   virtual ossimObject* getBaseObject();
-   virtual const ossimObject* getBaseObject()const;
-   
-   void setAttributes(ossim_float64 theSampleOffset,
-                      ossim_float64 theLineOffset,
-                      ossim_float64 theSampleScale,
-                      ossim_float64 theLineScale,
-                      ossim_float64 theLatOffset,
-                      ossim_float64 theLonOffset,
-                      ossim_float64 theHeightOffset,
-                      ossim_float64 theLatScale,
-                      ossim_float64 theLonScale,
-                      ossim_float64 theHeightScale,
-                      const std::vector<double>& xNumeratorCoeffs,
-                      const std::vector<double>& xDenominatorCoeffs,
-                      const std::vector<double>& yNumeratorCoeffs,
-                      const std::vector<double>& yDenominatorCoeffs,
-                      PolynomialType polyType = B);
-                      
-   /*!
-    * METHOD: worldToLineSample()
-    * Overrides base class implementation. Directly computes line-sample from
-    * the polynomials.
-    */
-   virtual void  worldToLineSample(const ossimGpt& world_point,
-                                   ossimDpt&       image_point) const;
-   /*!
-    * METHOD: print()
-    * Extends base-class implementation. Dumps contents of object to ostream.
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /*!
-    * METHODS:  saveState, loadState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files. Returns true if successful.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   virtual void  lineSampleToWorld(const ossimDpt& image_point,
-                                   ossimGpt&       world_point) const;
-   //***
-   // METHOD: lineSampleHeightToWorld()
-   // Overrides base class pure virtual. Height understood to be relative to
-   // standard ellipsoid.
-   //***
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPoint) const;
-
-   /*!
-    * METHOD: dup()
-    * Returns pointer to a new instance, copy of this.
-    */
-   virtual ossimObject* dup() const { return new ossimRpcProjection(*this); }
-
-   virtual ossimGpt origin()const;
-   virtual ossimDpt getMetersPerPixel() const;
-   virtual bool operator==(const ossimProjection& projection) const;
-   
-   /*
-    * optimizable interface
-    */
-    virtual bool setupOptimizer(const ossimString& setup);
-    inline virtual bool useForward()const {return true;}
-    virtual ossim_uint32 degreesOfFreedom()const;
-    virtual double optimizeFit(const ossimTieGptSet& tieSet, double* targetVariance=NULL);
-   /*!
-    * METHOD: getForwardDeriv()
-    * gives forward() partial derivative regarding parameter parmIdx (>=0)
-    * default implementation is centered finite difference
-    * -should be reimplemented with formal derivative in child class
-    */
-   virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta=1e-11);
-
-   /*!
-    * METHOD: getInverseDeriv()
-    * gives inverse() partial derivative regarding parameter parmIdx (>=0)
-    * default implementation is centered finite difference
-    * -should be reimplemented with formal derivative in child class
-    */
-   virtual ossimGpt getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta=1e-11);
-
-   /**
-    * @brief Implementation of pure virtual
-    * ossimProjection::isAffectedByElevation method.
-    * @return true.
-    */
-   virtual bool isAffectedByElevation() const { return true; }
-
-protected:
-   //***
-   // Methods for computing RPC polynomial and its derivatives:
-   //***
-   double polynomial(const double& nlat,
-                     const double& nlon,
-                     const double& nhgt,
-                     const double* coeffs) const;
-   double dPoly_dLat(const double& nlat,
-                     const double& nlon,
-                     const double& nhgt,
-                     const double* coeffs) const;
-   double dPoly_dLon(const double& nlat,
-                     const double& nlon,
-                     const double& nhgt,
-                     const double* coeffs) const;
-   
-   /*!
-    * METHOD: buildNormalEquation
-    * builds linearized system  (LMS equivalent)
-    * A*dp = projResidue
-    * 
-    * A: symetric matrix = tJ*J
-    * dp: system parameter shift that we want to estimate
-    * projResidue = tJ * residue
-    *
-    * t: transposition operator
-    * J = jacobian of transform relative to parameters p, transform can be forward() or inverse()
-    * jacobian is obtained via finite differences
-    * residue can be image (2D) or ground residue(3D)
-    *
-    * TODO: use image/ground points covariance matrices
-    */
-   void buildNormalEquation(const ossimTieGptSet& tieSet,
-                                      NEWMAT::SymmetricMatrix& A,
-                                      NEWMAT::ColumnVector& residue,
-                                      NEWMAT::ColumnVector& projResidue,
-                                      double pstep_scale);
-
-   /*!
-    * METHOD: getResidue()
-    * returns ground opr image residue
-    */
-   NEWMAT::ColumnVector getResidue(const ossimTieGptSet& tieSet);
-
-   NEWMAT::ColumnVector solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const;
-
-   /*!
-    * stable invert stolen from ossimRpcSolver
-    */
-   NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
-
-   PolynomialType thePolyType;
-   //***
-   // Quantities for zero-biasing and normalizing the image point and
-   // ground point coordinates referenced in the polynomials:
-   //***
-   double theLineScale;
-   double theSampScale;
-   double theLatScale;
-   double theLonScale;
-   double theHgtScale;
-   double theLineOffset;
-   double theSampOffset;
-   double theLatOffset;
-   double theLonOffset;
-   double theHgtOffset;
-
-   //***
-   // Coefficients:
-   //***
-   double theLineNumCoef[20];
-   double theLineDenCoef[20];
-   double theSampNumCoef[20];
-   double theSampDenCoef[20];
-
-   //*
-   // Quantities derived from the adjustable parameters:
-   //*
-   double theIntrackOffset;
-   double theCrtrackOffset;
-   double theIntrackScale;
-   double theCrtrackScale;
-   double theYawSkew;  // = sin(theYawOffset)
-   double theCosMapRot;
-   double theSinMapRot;
-   
-   TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimRpcSolver.h b/ossim/include/ossim/projection/ossimRpcSolver.h
deleted file mode 100644
index d42c1fb..0000000
--- a/ossim/include/ossim/projection/ossimRpcSolver.h
+++ /dev/null
@@ -1,244 +0,0 @@
-//*****************************************************************************
-// FILE: ossimRpcModel.h
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Garrett Potts
-//
-//*****************************************************************************
-//  $Id: ossimRpcSolver.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRpcSolver_HEADER
-#define ossimRpcSolver_HEADER
-
-#include <vector>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/matrix/newmat.h>
-#include <ossim/projection/ossimRpcModel.h>
-#include <ossim/projection/ossimRpcProjection.h>
-
-class ossimProjection;
-class ossimImageGeometry;
-class ossimNitfRegisteredTag;
-
-/**
- * This currently only support Rational poilynomial B format.  This can be
- * found in the NITF registered commercial tag document.
- *
- * @note x=longitude, y=latitude, z=height
- * 
- * <pre>
- * Format is:
- *  coeff[ 0]       + coeff[ 1]*x     + coeff[ 2]*y     + coeff[ 3]*z     +
- *  coeff[ 4]*x*y   + coeff[ 5]*x*z   + coeff[ 6]*y*z   + coeff[ 7]*x*x   +
- *  coeff[ 8]*y*y   + coeff[ 9]*z*z   + coeff[10]*x*y*z + coeff[11]*x*x*x +
- *  coeff[12]*x*y*y + coeff[13]*x*z*z + coeff[14]*x*x*y + coeff[15]*y*y*y +
- *  coeff[16]*y*z*z + coeff[17]*x*x*z + coeff[18]*y*y*z + coeff[19]*z*z*z;
- *
- *       where coeff is one of XNum, XDen, YNum, and YDen.  So there are 80
- *       coefficients all together.
- *
- *       
- * Currently we use a linear least squares fit to solve the coefficients.
- * This is the simplest to implement.  We probably relly need a nonlinear
- * minimizer to fit the coefficients but I don't have time to experiment.
- * Levenberg Marquardt might be a solution to look into.
- *
- *
- * 
- * HOW TO USE:
- * 
- *        ossimRpcSolver solver;
- *        solver.solveCoefficients(rect,
- *                                 *proj.get());
- *                                 
- * We can also call solve coefficients with a list of ground control points.
- * First is the list of image points followed by the ground points.
- * NOTE: Thes must be equal in size.
- * 
- *        solver.solveCoefficients(imagePoints,
- *                                 groundPoints);
- *                                 
- *                                 
- * Once you call solveCoefficients you can create the projector:
- *                                 
- *        ossimRefPtr<ossimRpcProjection> rpc = solver.createRpcProjection();
- *
- * </pre>
- * 
- */ 
-class OSSIM_DLL ossimRpcSolver : public ossimReferenced
-{
-public:
-   /**
-    * The use elvation flag will deterimne if we force the height t be 0.
-    * If the elevation is enabled then we use the height field of the control
-    * points to determine the coefficients of the RPC00 polynomial.  If its
-    * false then we will ignore the height by setting the height field to 0.0.
-    *
-    * Note:  even if the elevation is enabled all NAN heights are set to 0.0.
-    */
-   ossimRpcSolver(bool useElevation=false,
-                  bool useHeightAboveMSLFlag=false);
-
-   
-   /**
-    * This will convert any projector to an RPC model
-    */
-   void solveCoefficients(const ossimDrect& imageBouunds,
-                          ossimProjection* imageProj,
-                          ossim_uint32 xSamples=8,
-                          ossim_uint32 ySamples=8,
-                          bool shiftTo0Flag=true);
-   
-   void solveCoefficients(const ossimDrect& imageBouunds,
-                          ossimImageGeometry* geom,
-                          ossim_uint32 xSamples=8,
-                          ossim_uint32 ySamples=8,
-                          bool shiftTo0Flag=true);
-   
-   /**
-    * takes associated image points and ground points
-    * and solves the coefficents for the rational polynomial for
-    * line and sample calculations from world points.
-    *
-    * Note: All data will be normalized between -1 and 1 for
-    *       numerical robustness.
-    */ 
-   void solveCoefficients(const std::vector<ossimDpt>& imagePoints,
-                          const std::vector<ossimGpt>& groundControlPoints,
-                          const ossimDpt& imageShift = ossimDpt(0.0,0.0));
-
-   /**
-    * Creates and Rpc model from the coefficients
-    */
-   ossimImageGeometry* createRpcModel()const;
-
-   /**
-    * Create a simple rpc projection which is a dumbed down
-    * rpc model.
-    */
-   ossimImageGeometry* createRpcProjection()const;
-
-
-   /**
-    * Gives access to the solved coefficients.  For the image
-    * X numerator
-    */
-   const std::vector<double>& getImageXNumCoefficients()const;
-
-   /**
-    * Gives access to the solved coefficients.  For the image
-    * X denominator
-    */
-   const std::vector<double>& getImageXDenCoefficients()const;
-
-   /**
-    * Gives access to the solved coefficients.  For the image
-    * Y numerator
-    */
-   const std::vector<double>& getImageYNumCoefficients()const;
-
-   /**
-    * Gives access to the solved coefficients. For the image
-    * Y denominator
-    */
-   const std::vector<double>& getImageYDenCoefficients()const;
-
-   
-   double getImageXOffset()const;
-   double getImageYOffset()const;
-   double getLatOffset()const;
-   double getLonOffset()const;
-   double getHeightOffset()const;
-   double getImageXScale()const;
-   double getImageYScale()const;
-   double getLatScale()const;
-   double getLonScale()const;
-   double getHeightScale()const;
-
-   double getRmsError()const;
-
-   /**
-    * @return ossimRefPtr<ossimNitfRegisteredTag>
-    *
-    * @note one of the solve methods should have been called prior to this.
-    */
-   ossimRefPtr<ossimNitfRegisteredTag> getNitfRpcBTag() const;
-   
-protected:
-	virtual ~ossimRpcSolver(){}
-   
-   virtual void solveInitialCoefficients(NEWMAT::ColumnVector& coeff,
-                                         const std::vector<double>& f,
-                                         const std::vector<double>& x,
-                                         const std::vector<double>& y,
-                                         const std::vector<double>& z)const;
-                                         
-   virtual void solveCoefficients(NEWMAT::ColumnVector& coeff,
-                                  const std::vector<double>& f,
-                                  const std::vector<double>& x,
-                                  const std::vector<double>& y,
-                                  const std::vector<double>& z)const;
-   
-   double eval(const std::vector<double>& coeff,
-               double x,
-               double y,
-               double z)const;
-
-   /**
-    * Inverts using the SVD method
-    */
-   NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
-   
-   void setupSystemOfEquations(NEWMAT::Matrix& equations,
-                               const NEWMAT::ColumnVector& f,
-                               const std::vector<double>& x,
-                               const std::vector<double>& y,
-                               const std::vector<double>& z)const;
-
-   void setupWeightMatrix(NEWMAT::DiagonalMatrix& result, // holds the resulting weights
-                          const NEWMAT::ColumnVector& coefficients,
-                          const NEWMAT::ColumnVector& f,
-                          const std::vector<double>& x,
-                          const std::vector<double>& y,
-                          const std::vector<double>& z)const;
-
-   bool theUseElevationFlag;
-   bool theHeightAboveMSLFlag;
-   ossimDpt      theImageOffset;
-   ossimGpt      theGroundOffset;
-   ossimDpt      theImageScale;
-   ossim_float64 theLatScale;
-   ossim_float64 theLonScale;
-   ossim_float64 theHeightScale;
-   ossim_float64 theError;
-   /**
-    * there are 20 coefficients in the cubic RPC model
-    */ 
-   std::vector<ossim_float64> theXNumCoeffs;
-
-   /**
-    * there are 20 coefficients in the cubic RPC model
-    */ 
-   std::vector<ossim_float64> theXDenCoeffs;
-
-   /**
-    * there are 20 coefficients in the cubic RPC model
-    */ 
-   std::vector<ossim_float64> theYNumCoeffs;
-
-   /**
-    * there are 20 coefficients in the cubic RPC model
-    */ 
-   std::vector<ossim_float64> theYDenCoeffs;
-   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimRsmModel.h b/ossim/include/ossim/projection/ossimRsmModel.h
deleted file mode 100644
index 33ef418..0000000
--- a/ossim/include/ossim/projection/ossimRsmModel.h
+++ /dev/null
@@ -1,166 +0,0 @@
-//---
-// File: ossimRsmModel.h
-//---
-#ifndef ossimRsmModel_H
-#define ossimRsmModel_H 1
-
-#include <ossim/projection/ossimSensorModel.h>
-#include <iosfwd>
-
-/**
- * @class ossimRsmModel
- */
-class OSSIM_DLL ossimRsmModel : public ossimSensorModel
-{
-public:
-
-   /** @brief default constructor */
-   ossimRsmModel();
-
-   /** @brief copy constructor */
-   ossimRsmModel( const ossimRsmModel& obj );
-
-   /** @brief assignment operator */
-   const ossimRsmModel& operator=( const ossimRsmModel& rhs );
-
-   /**
-    * @brief worldToLineSample()
-    * Overrides base class implementation. Directly computes line-sample from
-    * the polynomials.
-    */
-   virtual void  worldToLineSample(const ossimGpt& world_point,
-                                   ossimDpt&       image_point) const;
- 
-
-   /**
-    * @brief lineSampleToWorld()
-    * Overrides base class pure virtual.  Intersects DEM.
-    */
-   virtual void  lineSampleToWorld(const ossimDpt& image_point,
-                                   ossimGpt&       world_point) const;
-   /**
-    * @brief lineSampleHeightToWorld()
-    * Overrides base class pure virtual. Height understood to be relative to
-    * standard ellipsoid.
-    */
-   virtual void lineSampleHeightToWorld(const ossimDpt& image_point,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPoint) const;
-   
-   /**
-    * @brief imagingRay()
-    * Overrides base class pure virtual.
-    */
-   virtual void imagingRay(const ossimDpt& image_point,
-                           ossimEcefRay&   image_ray) const;
-
-   virtual void updateModel();
-   virtual void initAdjustableParameters();
-
-   /**
-    * @brief dup()
-    * Returns pointer to a new instance, copy of this.
-    */
-   virtual ossimObject* dup() const;
-
-   inline virtual bool useForward()const {return false;}
-
-   double polynomial( const double& x, const double& y, const double& z,
-                      const ossim_uint32& maxx, const ossim_uint32& maxy,
-                      const ossim_uint32& maxz,
-                      std::vector<ossim_float64> pcf ) const;
-   
-   double dPoly_dLat( const double& x, const double& y, const double& z,
-                      const ossim_uint32& maxx, const ossim_uint32& maxy,
-                      const ossim_uint32& maxz,
-                      std::vector<ossim_float64> pcf) const;
-   
-   double dPoly_dLon( const double& x, const double& y, const double& z,
-                      const ossim_uint32& maxx, const ossim_uint32& maxy,
-                      const ossim_uint32& maxz,
-                      std::vector<ossim_float64> pcf ) const;
-   
-   double dPoly_dHgt( const double& x, const double& y, const double& z,
-                      const ossim_uint32& maxx, const ossim_uint32& maxy,
-                      const ossim_uint32& maxz,
-                      std::vector<ossim_float64> pcf ) const;
-
-   /**
-    * @brief print()
-    * Extends base-class implementation. Dumps contents of object to ostream.
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief saveState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files. Returns true if successful.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-   
-   /**
-    * @brief loadState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files. Returns true if successful.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-protected:
-   
-   /** @brief virtual destructor */
-   virtual ~ossimRsmModel();
-   
-   ossimString m_iid;
-   ossimString m_edition;
-
-   ossim_uint32 m_rsn;
-   ossim_uint32 m_csn;
-
-   ossim_float64 m_rfep;
-   ossim_float64 m_cfep;
-   ossim_float64 m_rnrmo;
-   ossim_float64 m_cnrmo;
-   ossim_float64 m_xnrmo;
-   ossim_float64 m_ynrmo;
-   ossim_float64 m_znrmo;
-   ossim_float64 m_rnrmsf;
-   ossim_float64 m_cnrmsf;
-   ossim_float64 m_xnrmsf;
-   ossim_float64 m_ynrmsf;
-   ossim_float64 m_znrmsf;
-   
-   ossim_uint32 m_rnpwrx;
-   ossim_uint32 m_rnpwry;
-   ossim_uint32 m_rnpwrz;
-   ossim_uint32 m_rntrms;
-
-   std::vector<ossim_float64> m_rnpcf;
-
-   ossim_uint32 m_rdpwrx;
-   ossim_uint32 m_rdpwry;
-   ossim_uint32 m_rdpwrz;
-   ossim_uint32 m_rdtrms;
-
-   std::vector<ossim_float64> m_rdpcf;
-
-   ossim_uint32 m_cnpwrx;
-   ossim_uint32 m_cnpwry;
-   ossim_uint32 m_cnpwrz;
-   ossim_uint32 m_cntrms;
-
-   std::vector<ossim_float64> m_cnpcf;
-
-   ossim_uint32 m_cdpwrx;
-   ossim_uint32 m_cdpwry;
-   ossim_uint32 m_cdpwrz;
-   ossim_uint32 m_cdtrms;
-
-   std::vector<ossim_float64> m_cdpcf;
-
-   TYPE_DATA
-      
-}; // End: class ossimRsmModel
-
-#endif /* #ifndef ossimRsmModel_H */
diff --git a/ossim/include/ossim/projection/ossimSarModel.h b/ossim/include/ossim/projection/ossimSarModel.h
deleted file mode 100644
index 4306da7..0000000
--- a/ossim/include/ossim/projection/ossimSarModel.h
+++ /dev/null
@@ -1,344 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Hicks
-//
-// Description: Base class for Synthetic Aperture Radar model.
-//
-//              This model represents a standard model using relatively
-//              generic support data based on the following references:
-//                [1] Modern Photogrammetry; Mikhail, Bethel, & McGlone;
-//                    Sections 11.7-11.9
-//                [2] The Compendium of Controlled Extensions for NITFS
-//                    21 Mar 2006, paragraph E.3.8, SAR MPDSR
-//
-//----------------------------------------------------------------------------
-// $Id: ossimSarModel.h 15766 2009-10-20 12:37:09Z gpotts $
-#ifndef ossimSarModel_HEADER
-#define ossimSarModel_HEADER
-
-#include <ossim/projection/ossimSensorModel.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimEcefPoint.h>
-#include <ossim/base/ossimEcefVector.h>
-
-class ossimHgtRef;
-
-
-class OSSIM_DLL ossimSarModel : public ossimSensorModel
-{
-public:
-
-   enum AcquisitionMode
-   {
-      UNKNOWN = 0,
-      SCAN    = 1,
-      SPOT    = 2
-   };
-
-   enum AdjustParamIndex
-   {
-      X_POS = 0,
-      Y_POS,
-      Z_POS,
-      NUM_ADJUSTABLE_PARAMS // not an index
-   };
-
-   /** @brief default constructor */
-   ossimSarModel();
-
-   /**
-    * @brief Method to load or recreate the state of an ossimSarModel from
-    * a keyword list.
-    *
-    * @param kwl    Keyword list to load from.
-    * @param prefix Prefix for keywords, like "image01.".
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   /**
-    * @brief Method to save the state of this object to a keyword list.
-    *
-    * @param kwl    Keyword list to save to.
-    * @param prefix Prefix for keywords, like "image01.".
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-   
-   /*!
-    * Writes a template of geom keywords processed by loadState and saveState
-    * to output stream.
-    */
-   static void writeGeomTemplate(ostream& os);
-                          
-                          
-   /*!
-    * Returns pointer to a new instance, copy of this.
-    */
-   virtual ossimObject* dup() const { return 0; } // TBR
-
-   /**
-    * @brief print method.
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-
-   /**
-    * @brief 
-    */
-   virtual void lineSampleToWorld(const ossimDpt& image_point,
-                                  ossimGpt&       world_point) const;
-   virtual void worldToLineSample(const ossimGpt& world_point,
-                                  ossimDpt&       image_point) const;
-   virtual void lineSampleHeightToWorld(const ossimDpt& lineSampPt,
-                                        const double&   heightAboveEllipsoid,
-                                        ossimGpt&       worldPt) const;
-   /**
-    * METHOD: imagingRay(image_point, &ossimEcefRay)
-    *  Given an image point, returns a ray originating at the ARP position
-    *  and pointing towards the target's position in the Output
-    *  Plane.
-    *  This DOES NOT provide the conventional definition for an imaging ray
-    *  because the imaging locus for SAR is not a ray.
-    *
-    *  It DOES provide a radius vector for the range/Doppler circle.
-    */
-   virtual void imagingRay(const ossimDpt& image_point,
-                           ossimEcefRay&   image_ray) const;
-
-   
-   /**
-    * @brief Compute partials of range/Doppler WRT ground point
-    *
-    * @param parmIdx computational mode:
-    *        OBS_INIT, EVALUATE, P_WRT_X, P_WRT_X, P_WRT_X.
-    * @param gpos Current ground point estimate.
-    * @param h Not used.
-    *
-    * @return OBS_INT: n/a, EVALUATE: residuals, P_WRT_X/Y/Z: partials.
-    */
-   virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt& gpos, double h);
-
-   /**
-    * ossimOptimizableProjection
-    */
-   inline virtual bool useForward() const
-   {
-      return false; //!image to ground faster
-   } 
-
-   /**
-    * @brief Compute other parameters & update the model.
-    */
-   virtual void updateModel();
-
-   /*!
-    * METHOD: getObsCovMat()
-    * gives 2X2 covariance matrix of observations
-    */
-   virtual ossimSensorModel::CovMatStatus getObsCovMat(
-      const ossimDpt& ipos, NEWMAT::SymmetricMatrix& Cov);
-   
-protected:
-   /** @brief virtual destructor */
-   virtual ~ossimSarModel();
-   
-   
-   /*!
-    * Assigns initial default values to adjustable parameters and related
-    * members.
-    */
-   void initAdjustableParameters();
-
-   /**
-    * @brief Get ARP time for SPOT mode (constant time).
-    */
-   virtual ossim_float64 getArpTime() const;
-
-   /**
-    * @brief Get ARP time for SCAN mode (varying time).
-    *
-    * @param imgPt The image coordinates.
-    */
-   virtual ossim_float64 getArpTime(const ossimDpt& imgPt) const;
-
-   /**
-    * @brief Get ARP position for SPOT mode (constant time).
-    */
-   virtual ossimEcefPoint  getArpPos() const;
-
-   /**
-    * @brief Get ARP position for SCAN mode (varying time).
-    */
-   virtual ossimEcefPoint  getArpPos(const ossim_float64& time) const;
-
-   /**
-    * @brief Get ARP velocity for SPOT mode (constant time).
-    */
-   virtual ossimEcefVector getArpVel() const;
-
-   /**
-    * @brief Get ARP velocity for SPOT mode (constant time).
-    */
-   virtual ossimEcefVector getArpVel(const ossim_float64& time) const;
-   
-   /**
-    * @brief Method to compute range & Doppler.
-    *
-    * @param pt ECF ground point coordinates.
-    * @param arpPos ECF ARP position.
-    * @param arpVel ECF ARP velocity.
-    * @param range  range.
-    * @param arpVel Doppler.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool computeRangeDoppler(const ossimEcefPoint& pt,
-                                    const ossimEcefPoint& arpPos,
-                                    const ossimEcefVector& arpVel,
-                                    ossim_float64& range,
-                                    ossim_float64& doppler) const;
-
-  /**
-    * @brief Method to compute image coordinates from output plane coordinates.
-    *
-    * @param opPt  ECF output plane position of point.
-    * @param imgPt image position of point.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool computeImageFromOP(const ossimEcefPoint& opPt, ossimDpt& imgPt) const;
-   
-   /**
-    * @brief Method to compute output plane coordinates from image coordinates.
-    *
-    * @param imgPt image position of point.
-    * @param opPt  ECF output plane position of point.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool computeOPfromImage(const ossimDpt& imgPt, ossimEcefPoint& opPt) const;
-   
-   /**
-    * @brief Method to project output plane coordinates to surface.
-    *
-    * @param opPt   ECF output plane point coordinates.
-    * @param range  range.
-    * @param arpVel Doppler.
-    * @param arpPos ECF ARP position.
-    * @param arpVel ECF ARP velocity.
-    * @param hgtRef Height reference defining intersection surface.
-    * @param ellPt  ECF point coordinates.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool projOPtoSurface(const ossimEcefPoint& opPt,
-                                const ossim_float64& range,
-                                const ossim_float64& doppler,
-                                const ossimEcefPoint& arpPos,
-                                const ossimEcefVector& arpVel,
-                                const ossimHgtRef* hgtRef,
-                                ossimEcefPoint& ellPt) const;
-
-   /**
-    * @brief Method to project ellipsoid coordinates to output plane.
-    *
-    * @param ellPt ECF ellipsoid position.
-    * @param opPt  ECF output plane position of point.
-    *
-    * @return true on success, false on error.
-    */
-   virtual bool projEllipsoidToOP(const ossimEcefPoint& ellPt,
-                                  ossimEcefPoint& opPt) const;
-
-
-
-   /**
-    * Returns the acquisition mode as a string.
-    */
-   ossimString getAcquistionModeString() const;
-
-   /**
-    * @brief Sets the acquisition mode from string.
-    *
-    * @param mode The string representing mode.
-    */
-   void setAcquisitionMode(const ossimString& mode);
-
-   /** acquisition mode */
-   AcquisitionMode theAcquisitionMode;
-
-   /** Output/Ground Reference Point (ORP) position */
-   ossimEcefPoint theOrpPosition;
-
-   /** sample (x)/line(y) image coordinates of ORP  */
-   ossimDpt theOrpCenter;
-
-   /** output plane normal */
-   ossimEcefVector theOutputPlaneNormal;
-
-   /** output plane x-axis */
-   ossimEcefVector theOutputPlaneXaxis;
-
-   /** output impulse response */
-   ossim_float64 theOipr;
-
-   /** pixel size */
-   ossim_float64 thePixelSize;
-
-   /** Aperture Reference/Center Point (ARP) time in seconds. */
-   ossim_float64 theArpTime;
-
-   /**
-    * Aperture Reference Point (ARP) Polynomials.
-    * Note: Size is derived dependent.
-    */
-   vector<ossim_float64> theArpXPolCoeff;
-   vector<ossim_float64> theArpYPolCoeff;
-   vector<ossim_float64> theArpZPolCoeff;
-
-   /** Time Coefficients.  Note: Size is derived dependent. */
-   vector<ossim_float64> theTimeCoeff;
-
-   /**
-    * Other computed parameters
-    */
-    
-   /** Pixel spacing */
-   ossim_float64 thePixelSpacing;
-   
-   /** Output/slant plane unit vectors */
-   ossimEcefVector theOPX;
-   ossimEcefVector theOPY;
-   ossimEcefVector theOPZ;
-   
-   
-   /**
-    * Adjustment-related data used and set by getForwardDeriv
-    */
-   /** Observations for current point */
-   ossim_float64   theObsRng;
-   ossim_float64   theObsDop;
-   ossim_float64   theObsTime;
-   ossimEcefPoint  theObsPosition;
-   ossimEcefPoint  theObsOP;
-   ossimEcefPoint  theObsArpPos;
-   ossimEcefVector theObsArpVel;
-   ossimEcefVector theObsArpVel_U;
-   ossim_float64   theObsArpVel_Mag;
-   
-   /** Partials for current point */
-   ossim_float64 theParDopWRTaz;
-
-   /** Adjustable parameters */
-   ossimEcefVector theLsrOffset;      // meters
-
-   TYPE_DATA
-};
-
-#endif /* #ifndef ossimSarModel_HEADER */
diff --git a/ossim/include/ossim/projection/ossimSensorModel.h b/ossim/include/ossim/projection/ossimSensorModel.h
deleted file mode 100644
index 920cbed..0000000
--- a/ossim/include/ossim/projection/ossimSensorModel.h
+++ /dev/null
@@ -1,393 +0,0 @@
-//*****************************************************************************
-// FILE: ossimSensorModel.h
-//
-// License:  See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION:
-//   Contains declaration of class ossimSensorModel. This is the base class to
-//   all sensor model-related projections including replacement models such as
-//   coarse grids and polynomial models. This base class supports adjustable
-//   parameters for registration adjustment.
-//
-//   Important note to sensor model implementors: In order to avoid a separate
-//   set of "initial adjustable parameters," this design assumes ALL initial
-//   values are 0. When designing the derived-class model, insure that the
-//   adjustable parameters are 0-based. This applies to theAdjustableParams
-//   array declared in this base class only. The derived classes can declare
-//   their own adjstable params that are more descriptive and that can be
-//   assigned an initial value that is non-zero, but that are linearly related
-//   to the adjustable params of this class. In that case, the updateModel()
-//   method will compute the derived-class's parameters based on
-//   theAdjustableParams array, after an adjustment is made.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimSensorModel.h 23516 2015-09-14 18:22:38Z dburken $
-
-#ifndef ossimSensorModel_HEADER
-#define ossimSensorModel_HEADER 1
-
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimBilinearProjection.h>
-#include <ossim/projection/ossimOptimizableProjection.h>
-#include <ossim/base/ossimEcefRay.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimCommon.h> /* for ossim::nan() */
-#include <ossim/elevation/ossimElevSource.h>
-#include <ossim/base/ossimAdjustableParameterInterface.h>
-#include <ossim/matrix/newmat.h>
-#include <ossim/matrix/newmatap.h>
-#include <ossim/base/ossimException.h>
-class ossimKeywordlist;
-class ossimTieGptSet;
-
-/*!****************************************************************************
- *
- * CLASS:  ossimSensorModel
- *
- *****************************************************************************/
-class OSSIMDLLEXPORT ossimSensorModel : public ossimProjection,
-                                        public ossimOptimizableProjection,
-                                        public ossimAdjustableParameterInterface
-{
-public:
-
-   enum CovMatStatus
-   {
-      COV_INVALID = 0,
-      COV_PARTIAL = 1,
-      COV_FULL    = 2
-   };
-
-   enum DeriveMode
-   {
-      OBS_INIT =-99,
-      EVALUATE =-98,
-      P_WRT_X = -1,
-      P_WRT_Y = -2,
-      P_WRT_Z = -3
-   };
-   
-   /*!
-    * CONSTRUCTORS:
-    */
-   ossimSensorModel();
-   ossimSensorModel(const ossimSensorModel& copy_this);
-   ossimSensorModel(const ossimKeywordlist& geom_kwl);
-
-   /** @brief assignment operator */
-   const ossimSensorModel& operator=( const ossimSensorModel& rhs );
-
-   virtual ossimObject* getBaseObject();
-   virtual const ossimObject* getBaseObject()const;
-   
-   /*!
-    * ACCESS METHODS:
-    */
-   virtual ossimGpt origin()            const {return theRefGndPt; }
-   virtual ossimDpt getMetersPerPixel() const {return ossimDpt(fabs(theGSD.x),
-                                                               fabs(theGSD.y));}
-   
-   //! Returns the estimated Absolute horizontal position error (CE90) of the sensor model.
-   virtual const double& getNominalPosError() const { return theNominalPosError; }
-
-   //! Returns the estimated RELATIVE horizontal position error (CE90) of the sensor model.
-   virtual const double& getRelativePosError() const { return theRelPosError; }
-
-   //! Assigns the absolute image position error uncertainty (abs CE90)
-   virtual void setNominalPosError(const double& ce90) { theNominalPosError = ce90; }
-
-   //! Assigns the relative image position error uncertainty (rel CE90)
-   virtual void setRelativePosError(const double& ce90) { theRelPosError = ce90; }
-
-   /*!
-    * Implementation of base-class pure virtual projection methods. These
-    * methods may be overriden by derived classes if those have more efficient
-    * schemes. The implementations here are iterative (relatively slow). Both
-    * depend on calls to the pure virtual lineSampleHeightToWorld() method.
-    */
-   virtual void  lineSampleToWorld(const ossimDpt& image_point,
-                                   ossimGpt&       world_point) const;
-   virtual void  worldToLineSample(const ossimGpt& world_point,
-                                   ossimDpt&       image_point) const;
-
-   /*!
-    * METHOD: lineSampleHeightToWorld
-    * This is the pure virtual that performs the actual work of projecting
-    * the image point to the given elevation above Ellipsoid. 
-    */
-   virtual void lineSampleHeightToWorld(const ossimDpt& lineSampPt,
-                                        const double&   heightEllipsoid,
-                                        ossimGpt&       worldPt) const = 0;
-   /*!
-    * METHOD: imagingRay(image_point, &ossimEcefRay)
-    * Given an image point, returns a ray originating at some arbitrarily high
-    * point (ideally at the sensor position) and pointing towards the target.
-    * Implemented here but should be overriden for more efficient solution.
-    */
-   virtual void imagingRay(const ossimDpt& image_point,
-                           ossimEcefRay&   image_ray) const;
-
-   /*!
-    * METHOD: print()
-    * Fulfills base-class pure virtual. Dumps contents of object to ostream.
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief Sets the center line sampe of the image.
-    *
-    * @param pt Image center point (x = sample, y = line).
-    */
-   void setRefImgPt(const ossimDpt& pt);
-
-   /**
-    * @brief Sets the center latitude, longitude, height of the image.
-    *
-    * @param pt Image center point.
-    */
-   void setRefGndPt(const ossimGpt& pt);
-   
-
-   void setImageRect(const ossimDrect& imageRect);
-   void setGroundRect(const ossimGpt& ul,
-                      const ossimGpt& ur,
-                      const ossimGpt& lr,
-                      const ossimGpt& ll);
-   /*!
-    * METHOD: imageSize()
-    * Returns the maximum line/sample rigorously defined by this model.
-    */
-   ossimDpt imageSize() const { return theImageSize; }
-   void setImageSize(const ossimDpt& size){theImageSize = size;}
-   /*!
-    * This is from the adjustable parameter interface.  It is
-    * called when a paraemter adjustment is made.
-    */
-   virtual void adjustableParametersChanged()
-      {
-         updateModel();
-      }
-   /*!
-    * VIRTUAL METHOD: updateModel()
-    * Following a change to the adjustable parameter set, this virtual
-    * is called to permit instances to compute derived quantities after
-    * parameter change.
-    */
-   virtual void updateModel() {}
-
-   /*!
-    * METHODS:  saveState, loadState
-    * Fulfills ossimObject base-class pure virtuals. Loads and saves geometry
-    * KWL files.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /*!
-    * METHOD: insideImage(image_point)
-    * Returns true if the image_point lies inside the image rectangle.
-    */
-   virtual bool insideImage(const ossimDpt& p) const
-      {
-/*          return( (p.u>=(0.0-FLT_EPSILON)) && */
-/*                  (p.u<=(double)(theImageSize.u-(1-FLT_EPSILON))) && */
-/*                  (p.v>=(0.0-FLT_EPSILON)) && */
-/*                  (p.v<=(double)(theImageSize.v-(1-FLT_EPSILON))) ); */
-         // if it's close to the edge we will consider it inside the image
-         //
-         return theImageClipRect.pointWithin(p, 2.0);
-      }
-
-   /*!
-    * STATIC METHOD: writeGeomTemplate(ostream)
-    * Writes a template of keywords processed by loadState and saveState to
-    * output stream.
-    */
-   static void writeGeomTemplate(ostream& os);
-
-   /*!
-    * OPERATORS: 
-    */
-   virtual bool operator==(const ossimProjection& proj) const; //inline below
-
-    //! Access methods:
-    const ossimString&   getImageID()               const { return theImageID; }
-    const ossimDrect&    getImageClipRect()         const { return theImageClipRect; }
-
-   /*!
-    * optimizableProjection implementation
-    */
-   virtual ossim_uint32 degreesOfFreedom()const;
-   inline virtual bool needsInitialState()const {return true;}
-   virtual double optimizeFit(const ossimTieGptSet& tieSet,
-                              double* targetVariance=0);
-
-   /*!
-    * METHOD: getForwardDeriv()
-    * gives forward() partial derivative regarding parameter parmIdx (>=0)
-    * default implementation is centered finite difference
-    * -should be reimplemented with formal derivative in child class
-    */
-   virtual ossimDpt getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta=1e-11);
-
-   /*!
-    * METHOD: getInverseDeriv()
-    * gives inverse() partial derivative regarding parameter parmIdx (>=0)
-    * default implementation is centered finite difference
-    * -should be reimplemented with formal derivative in child class
-    */
-   virtual ossimGpt getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta=1e-11);
-
-   /*!
-    * METHOD: getObsCovMat()
-    * @brief Gives 2X2 covariance matrix of observations
-    */
-   virtual ossimSensorModel::CovMatStatus getObsCovMat(
-      const ossimDpt& ipos, NEWMAT::SymmetricMatrix& Cov,
-      const ossim_float64 defPointingSigma = 0.5);
-
-   /**
-    * @brief Implementation of pure virtual
-    * ossimProjection::isAffectedByElevation method.
-    * @return true.
-    */
-   virtual bool isAffectedByElevation() const { return true; }
-
-   /**
-    * This method computes the ground sample distance(gsd) and sets class
-    * attributes theGSD and theMeanGSD by doing a lineSampleHeightToWorld on
-    * four points and calculating the distance from them.
-    *
-    * @return Nothing but throws ossimException on error.
-    */
-   void computeGsd();
-
-   /**
-    * @brief Extracts geometry info from a non-ossim key,value pair 
-    * to an ossim keyword list.
-    *
-    * @param key non-ossim-based input ossimString 
-    * @param value non-ossim-based input ossimString
-    * @param geomKwl The keyword list to fill in.
-    */
-   virtual bool getImageGeometry( 
-      const ossimString& /* key */, const ossimString& /* value */, 
-      ossimKeywordlist& /* geomKwl */ ) const { return false; }
-
-protected:
-   virtual ~ossimSensorModel();
-
-   
-   /*!
-    * METHOD: extrapolate()
-    * Extrapolates solutions for points outside of the image. The second
-    * version accepts a height value -- if left at the default, the elevation
-    * will be looked up via theElevation object.
-    */
-   virtual ossimDpt extrapolate (const ossimGpt& gp) const;
-   virtual ossimGpt extrapolate (const ossimDpt& ip,
-				 const double& height=ossim::nan()) const;
-
-   /*!
-    * METHOD: buildNormalEquation
-    * builds linearized system  (LMS equivalent)
-    * A*dp = projResidue
-    * 
-    * A: symetric matrix = tJ*J
-    * dp: system parameter shift that we want to estimate
-    * projResidue = tJ * residue
-    *
-    * t: transposition operator
-    * J = jacobian of transform relative to parameters p, transform can be forward() or inverse()
-    * jacobian is obtained via finite differences
-    * residue can be image (2D) or ground residue(3D)
-    *
-    * TODO: use image/ground points covariance matrices
-    */
-   void buildNormalEquation(const ossimTieGptSet& tieSet,
-                                      NEWMAT::SymmetricMatrix& A,
-                                      NEWMAT::ColumnVector& residue,
-                                      NEWMAT::ColumnVector& projResidue,
-                                      double pstep_scale);
-
-   /*!
-    * METHOD: getResidue()
-    * returns ground opr image residue
-    */
-   NEWMAT::ColumnVector getResidue(const ossimTieGptSet& tieSet);
-
-   NEWMAT::ColumnVector solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const;
-
-   /*!
-    * stable invert stolen from ossimRpcSolver
-    */
-   NEWMAT::Matrix invert(const NEWMAT::Matrix& m)const;
-
-   ossimIpt       theImageSize;       // pixels
-
-   /*!
-    * Support sub-image of larger full image by maintaining offset to UL corner
-    */
-   ossimDpt       theSubImageOffset;  // pixels
-   
-   ossimString    theImageID;
-   ossimString    theSensorID;
-   ossimDpt       theGSD;             // meters
-   ossim_float64  theMeanGSD;         // meters
-   ossimGpt       theRefGndPt;        // should be image center
-   ossimDpt       theRefImgPt;        // should be image center
-   ossimPolygon   theBoundGndPolygon;
-   ossimDrect     theImageClipRect;
-   ossim_float64  theRelPosError; 	// meters, relative to other models in the set
-   ossim_float64  theNominalPosError; // meters
-
-   /** Partials for current point */
-   ossimDpt theParWRTx;
-   ossimDpt theParWRTy;
-   ossimDpt theParWRTz;
-   
-   /** Observations & residuals for current point */
-   ossimDpt theObs;
-   ossimDpt theResid;
-
-   /**
-    * Used as an initial guess for iterative solutions and a guess for points outside the support
-    * bounds.
-    */ 
-   ossimRefPtr<ossimProjection> theSeedFunction;
-   
-   mutable bool theExtrapolateImageFlag;
-   mutable bool theExtrapolateGroundFlag;
-   
-TYPE_DATA
-};
-
-//================= BEGIN INLINE DEFINITIONS =================================
-
-//*****************************************************************************
-//  OPERATOR == 
-//*****************************************************************************
-inline bool ossimSensorModel::operator==(const ossimProjection& proj) const
-{
-   const  ossimSensorModel* model
-      = PTR_CAST(ossimSensorModel, (const ossimProjection*) &proj);
-    
-   if ( (!model) ||
-	(theSensorID != model->theSensorID) ||
-	(theImageID != model->theImageID) ||
-	(theSubImageOffset != model->theSubImageOffset) )
-      return false;
-
-   return true;
-}
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimUtmProjection.h b/ossim/include/ossim/projection/ossimUtmProjection.h
deleted file mode 100644
index f5cbb58..0000000
--- a/ossim/include/ossim/projection/ossimUtmProjection.h
+++ /dev/null
@@ -1,217 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Utm projection code.  
-//*******************************************************************
-//  $Id: ossimUtmProjection.h 17815 2010-08-03 13:23:14Z dburken $
-#ifndef ossimUtmProjection_HEADER
-#define ossimUtmProjection_HEADER
-#include <ossim/projection/ossimMapProjection.h>
-
-class OSSIMDLLEXPORT ossimUtmProjection : public ossimMapProjection
-{
-public:
-   ossimUtmProjection(const ossimEllipsoid& ellipsoid = ossimEllipsoid(),
-                      const ossimGpt& origin = ossimGpt());
-   
-   ossimUtmProjection(const ossimEllipsoid& ellipsoid,
-                      const ossimGpt& origin,
-                      ossim_int32 zone,
-                      char hemisphere);
-   ossimUtmProjection(ossim_int32 zone);
-   ossimUtmProjection(const ossimUtmProjection& src);
-   
-   virtual ossimObject* dup()const;
-
-   virtual ossimGpt inverse(const ossimDpt &eastingNorthing)const;
-   virtual ossimDpt forward(const ossimGpt &latLon)const;
-   virtual void update();
-
-   /**
-    * This will set the utm zone and utm origin base on origin passed in.
-    *
-    * @note If the origin latitude is not 0.0 it will also set the
-    * hemisphere.  If 0.0 hemisphere is unchanged from previous stored value.
-    */
-   virtual void setOrigin(const ossimGpt& origin);
-   
-   void setZone(const ossimGpt& ground);
-   void setZone(ossim_int32 zone);
-   void setHemisphere(const ossimGpt& ground);
-   void setHemisphere(char hemisphere);
-   static ossim_int32 computeZone(const ossimGpt& gpt);
-
-   /**
-    * Return in decimal degrees the zone meridian.
-    */
-   static double computeZoneMeridian(ossim_int32 zone);
-
-   ossim_int32 getZone()const;
-
-   char getHemisphere()const;
-
-   /**
-    * Method to save the state of an object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0)const;
-   
-   /**
-    * Method to the load (recreate) the state of an object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   /**
-    * Prints data members to stream.  Returns stream&.
-    */
-   virtual std::ostream& print(std::ostream& out) const;   
-
-   /**
-    * @return The false easting.
-    */
-   virtual double getFalseEasting() const;
-
-   /**
-    * @return The false northing.
-    */
-   virtual double getFalseNorthing() const;
-
-   //! Returns TRUE if principal parameters are within epsilon tolerance.
-   virtual bool operator==(const ossimProjection& projection) const;
-
-private:
-   /*_____________GEOTRANS_______________*/
-   
-   /**
-    * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
-    * parameters and Tranverse Mercator projection parameters as inputs, and
-    * sets the corresponding state variables. If any errors occur, the error
-    * code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
-    * returned.
-    *
-    * a                 : Semi-major axis of ellipsoid, in meters    (input)
-    * f                 : Flattening of ellipsoid                    (input)
-    * Origin_Latitude   : Latitude in radians at the origin of the   (input)
-    *                      projection
-    * Central_Meridian  : Longitude in radians at the center of the  (input)
-    *                      projection
-    * False_Easting     : Easting/X at the center of the projection  (input)
-    * False_Northing    : Northing/Y at the center of the projection (input)
-    * Scale_Factor      : Projection scale factor                    (input) 
-    */
-   ossim_int32 Set_Transverse_Mercator_Parameters(double a,      
-                                                  double f,
-                                                  double Origin_Latitude,
-                                                  double Central_Meridian,
-                                                  double False_Easting,
-                                                  double False_Northing,
-                                                  double Scale_Factor);
-   /**
-    * The function Get_Transverse_Mercator_Parameters returns the current
-    * ellipsoid and Transverse Mercator projection parameters.
-    *
-    * a                 : Semi-major axis of ellipsoid, in meters    (output)
-    * f                 : Flattening of ellipsoid                    (output)
-    * Origin_Latitude   : Latitude in radians at the origin of the   (output)
-    *                      projection
-    * Central_Meridian  : Longitude in radians at the center of the  (output)
-    *                      projection
-    * False_Easting     : Easting/X at the center of the projection  (output)
-    * False_Northing    : Northing/Y at the center of the projection (output)
-    * Scale_Factor      : Projection scale factor                    (output) 
-    */
-   void Get_Transverse_Mercator_Parameters(double *a,
-                                           double *f,
-                                           double *Origin_Latitude,
-                                           double *Central_Meridian,
-                                           double *False_Easting,
-                                           double *False_Northing,
-                                           double *Scale_Factor)const;
-   
-   
-   /**
-    * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
-    * (latitude and longitude) coordinates to Transverse Mercator projection
-    * (easting and northing) coordinates, according to the current ellipsoid
-    * and Transverse Mercator projection coordinates.  If any errors occur, the
-    * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
-    * returned.
-    *
-    * Latitude      : Latitude in radians                         (input)
-    * Longitude     : Longitude in radians                        (input)
-    * Easting       : Easting/X in meters                         (output)
-    * Northing      : Northing/Y in meters                        (output)
-    */
-   ossim_int32 Convert_Geodetic_To_Transverse_Mercator (double Latitude,
-                                                        double Longitude,
-                                                        double *Easting,
-                                                        double *Northing)const;
-   
-   
-   /**
-    * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
-    * Mercator projection (easting and northing) coordinates to geodetic
-    * (latitude and longitude) coordinates, according to the current ellipsoid
-    * and Transverse Mercator projection parameters.  If any errors occur, the
-    * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
-    * returned.
-    *
-    *    Easting       : Easting/X in meters                         (input)
-    *    Northing      : Northing/Y in meters                        (input)
-    *    Latitude      : Latitude in radians                         (output)
-    *    Longitude     : Longitude in radians                        (output)
-    */
-   ossim_int32 Convert_Transverse_Mercator_To_Geodetic(double Easting,
-                                                       double Northing,
-                                                       double *Latitude,
-                                                       double *Longitude)const;
-   
-   double theTranMerc_a;  /* Semi-major axis of ellipsoid i meters */
-   double theTranMerc_f;  /* Flattening of ellipsoid  */
-   
-   /* Eccentricity (0.08181919084262188000) squared */
-   double theTranMerc_es;
-   
-   double theTranMerc_ebs;   /* Second Eccentricity squared */
-   
-   /* Transverse_Mercator projection Parameters */
-   
-   double theTranMerc_Origin_Lat;     /* Latitude of origin in radians */
-   double theTranMerc_Origin_Long;    /* Longitude of origin in radians */
-   double theTranMerc_False_Northing; /* False northing in meters */
-   double theTranMerc_False_Easting;  /* False easting in meters */
-   double theTranMerc_Scale_Factor;   /* Scale factor  */
-   
-   /* Isometeric to geodetic latitude parameters, default to WGS 84 */
-   double theTranMerc_ap;
-   double theTranMerc_bp;
-   double theTranMerc_cp;
-   double theTranMerc_dp;
-   double theTranMerc_ep;
-   
-   /* Maximum variance for easting and northing values for WGS 84. */
-   double theTranMerc_Delta_Easting;
-   double theTranMerc_Delta_Northing;  
-   
-   /** 
-    * zone can be from 1 through 60 (0 == NOT SET)
-    */
-   ossim_int32 theZone;
-   
-   /**
-    * can be N or S.
-    */
-   char   theHemisphere;
-   
-TYPE_DATA
-};
-
-#endif
diff --git a/ossim/include/ossim/projection/ossimUtmpt.h b/ossim/include/ossim/projection/ossimUtmpt.h
deleted file mode 100644
index a259681..0000000
--- a/ossim/include/ossim/projection/ossimUtmpt.h
+++ /dev/null
@@ -1,90 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// This is the Universal Transverse Mercator (UTM) point.  Allows
-// easy onversion between different coordinates.
-//*******************************************************************
-//  $Id: ossimUtmpt.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimUtmpt_HEADER
-#define ossimUtmpt_HEADER
-
-#include <ossim/base/ossimConstants.h>
-
-class ossimGpt;
-class ossimEcefPoint;
-class ossimUpspt;
-class ossimDatum;
-
-class OSSIMDLLEXPORT ossimUtmpt
-{
-public:
-   ossimUtmpt(const ossimGpt &aPt);
-   ossimUtmpt(const ossimEcefPoint &aPt);
-   ossimUtmpt(long         zone,
-              char         hemisphere,  // N or S
-              double       easting,
-              double       northing,
-              const ossimDatum* datum);
-   
-   // ossimUtmpt(const ossimUpspt &aPt);
-
-   /**
-    * Return the zone for this utm point.
-    */
-   long zone() const { return theZone; }
-
-   /**
-    * Return the hemisphere ( Northern or Southern).
-    * We store this as a char value N or S.  We store it
-    * like this because we are interfacing to geotrans
-    * and geotrans stores their values in this manner.
-    */
-   char hemisphere() const { return theHemisphere; }
-
-   /**
-    * return the easting value in meters.
-    */
-   double easting() const { return theEasting; }
-
-   /**
-    * return the northing value in meters.
-    */
-   double northing() const { return theNorthing; }
-
-   /**
-    * return the reference datum for this point.
-    */
-   const ossimDatum* datum() const { return theDatum; }
-
-   /**
-    * Initializes this point to utm coordinates for the ground point.
-    *
-    * @param aPt Ground point to initialize from.
-    */
-   void convertFromGround(const ossimGpt &aPt);
-
-   /**
-    * Initializes the ground point from the utm coordinates of this point.
-    *
-    * @param aPt Ground point to initialize.
-    */
-   void convertToGround(ossimGpt &aPt);
-   
-private:
-   long               theZone;
-   char               theHemisphere;
-   double             theEasting;
-   double             theNorthing;
-   const ossimDatum*  theDatum;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/projection/ossimWktProjectionFactory.h b/ossim/include/ossim/projection/ossimWktProjectionFactory.h
deleted file mode 100644
index d65a0bb..0000000
--- a/ossim/include/ossim/projection/ossimWktProjectionFactory.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Oscar Kramer
-//
-//*******************************************************************
-//  $Id: ossimWktProjectionFactory.h 22924 2014-10-27 16:32:58Z okramer $
-
-#ifndef ossimWktProjectionFactory_HEADER
-#define ossimWktProjectionFactory_HEADER
-
-#include <ossim/projection/ossimProjectionFactoryBase.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimProjection;
-class ossimString;
-class ossimMapProjection;
-class ossimDatum;
-
-//*************************************************************************************************
-//! Projection Factory for coded projections defined in database. These are projections
-//! that are fully defined in database files and specified via a projection coordinate system (PCS)
-//! code, such as EPSG codes.
-//*************************************************************************************************
-class OSSIMDLLEXPORT ossimWktProjectionFactory : public ossimProjectionFactoryBase
-{
-public:
-   /*!
-    * METHOD: instance()
-    * Instantiates singleton instance of this class:
-    */
-   static ossimWktProjectionFactory* instance();
-
-   virtual ossimProjection* createProjection(const ossimFilename& filename,
-                                             ossim_uint32 entryIdx) const;
-
-   //! This is the principal factory method. It accepts a WKT string, for example 
-   //! "Anguilla_1957_British_West_Indies_Grid"
-   virtual ossimProjection* createProjection(const ossimString& name) const;
-
-   //! Looks for presence of "projection" keyword with the value in WKT format,
-   //! for example "Anguilla_1957_British_West_Indies_Grid" 
-   virtual ossimProjection* createProjection(const ossimKeywordlist& kwl,
-                                             const char* prefix = 0)const;
-
-   virtual ossimObject* createObject(const ossimString& typeName)const;
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl, const char* prefix=0)const;
-   
-    //! This returns the type name of all objects in all factories. This is the name used to 
-    //! construct the objects dynamically and this name must be unique.
-   virtual void getTypeNameList(std::vector<ossimString>& typeList) const;
-
-protected:
-
-   //! Constructor loads the WKT CSV file specified in the ossim prefs with "wkt_database_file"
-   //! keyword.
-   ossimWktProjectionFactory() {}
-
-   ossimProjection* doTransverseMercator(const ossimKeywordlist& kwl)const;
-   ossimProjection* doMercator(const ossimKeywordlist& kwl)const;
-   ossimProjection* doLambertConformalConic(const ossimKeywordlist& kwl) const;
-   ossimProjection* doEquiDistCylindrical(const ossimKeywordlist& kwl) const;
-   ossimProjection* doEquiAreaCylindrical(const ossimKeywordlist& kwl) const;
-
-   void loadRecords() const;
-
-   template<class T> void doMapCommon(const ossimKeywordlist& kwl, T proj) const;
-
-   static ossimWktProjectionFactory*  m_instance; //!< Singleton implementation
-   mutable std::map<std::string, ossim_uint32> m_wktProjRecords;
-
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimApplanixEOFile.h b/ossim/include/ossim/support_data/ossimApplanixEOFile.h
deleted file mode 100644
index c178c91..0000000
--- a/ossim/include/ossim/support_data/ossimApplanixEOFile.h
+++ /dev/null
@@ -1,211 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// MIT
-// 
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimApplanixEOFile.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimApplanixEOFile_HEADER
-#define ossimApplanixEOFile_HEADER 1
-
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <iostream>
-#include <map>
-#include <vector>
-
-class OSSIM_DLL ossimApplanixEORecord : public ossimReferenced
-{
-public:
-
-   OSSIM_DLL friend std::ostream& operator <<(std::ostream& out, const ossimApplanixEORecord& src);
-   ossimApplanixEORecord(const ossimApplanixEORecord& src)
-      :theField(src.theField)
-   {
-   }
-   ossimApplanixEORecord(ossim_uint32 size=0)
-   {
-      setSize(size);
-   }
-
-   void setSize(ossim_uint32 size)
-   {
-      theField.resize(size);
-   }
-   const ossimString& operator [](ossim_uint32 idx)const
-   {
-      return theField[idx];
-   }
-   ossimString& operator [](ossim_uint32 idx)
-   {
-      return theField[idx];
-   }
-
-   std::vector<ossimString> theField;
-};
-
-class OSSIM_DLL ossimApplanixEOFile : public ossimReferenced
-{
-public:
-   OSSIM_DLL friend std::ostream& operator <<(std::ostream& out, const ossimApplanixEOFile& src);
-   ossimApplanixEOFile();
-
-   /**
-    * Will parse the entire Exterior orientation file and then index any record
-    * ID's found.  This calls the parseStream method.
-    *
-    * @param file  The exterior orientation file
-    */ 
-   bool parseFile(const ossimFilename& file);
-
-   /**
-    * Will parse the stream and set internal queriable parameters.
-    * @param inThe input stream containing the Applanix format exterior orientation file
-    * 
-    */
-   bool parseStream(std::istream& in);
-   
-
-   /**
-    * Utility method that just checks for an APPlanix exterior orientation header.
-    * Will call the isEOFile(istream) method.
-    *
-    * @param file theExterior orientation file.
-    */ 
-   bool isEOFile(const ossimFilename& file)const;
-
-   /**
-    * Utility method that just checks for an APPlanix exterior orientation header.
-    */ 
-   bool isEOFile(std::istream& in)const;
-
-   /**
-    * Parses the header of the exterior orientation file.
-    * Calls the parseHeader(istream, header) method.
-    *
-    * @param file The filename that is an Applanix Exterior orientation file.
-    * @param header The resulting header that was parsed out.
-    */
-   bool parseHeader(const ossimFilename& file,
-                    ossimString& header)const;
-
-   /**
-    * Parses the header of the exterior orientation file.
-    * Calls the parseHeader(istream, header) method.
-    *
-    * @param in The input stream That contains an exterior orientation 
-    * @param header The resulting header that was parsed out.
-    */
-   bool parseHeader(std::istream& in,
-                    ossimString& header)const;
-
-   /**
-    * Is a case insensitive parse of the column names for the orientation
-    * record.  Note this will check to see if the search key is contained
-    * within any column heading.  So if a Heading has something like
-    * "ID MORE TEXT"  then you can call this with just "ID" and get a match
-    *
-    * @param searchKey  the substring to search for
-    * @return The id of the column or -1 if can't find the column
-    */
-   ossim_int32 getFieldIdxLike(const ossimString& searchKey)const;
-   
-   
-   /**
-    * Is a case insensitive parse of the column names for the orientation
-    * record.  Note this will check to see if the search key exactly matches
-    * a column heading.  So if a Heading has something like
-    * "ID MORE TEXT"  then you can call this with just "ID MORE TEXT" to have a match
-    *
-    * @param searchKey  the substring to search for
-    *
-    * @return The id of the column or -1 if can't find the column
-    */
-   ossim_int32 getFieldIdx(const ossimString& searchKey)const;
-   
-   /** 
-    * Will index all records based on the "ID #" field for fast searching.
-    */ 
-   void indexRecordIds();
-
-   /**
-    *  Given an ID it will search and find an EO record that matches the ID.
-    *
-    *  If the records are not indexed it will do a linear search on the record array.
-    *
-    *  @param id  The id of the record to find.
-    *  
-    *  @return The exterior orientation for that record.
-    */
-   const ossimRefPtr<ossimApplanixEORecord> getRecordGivenId(const ossimString& id)const;
-
-   ossim_uint32 getNumberOfRecords()const;
-   const ossimRefPtr<ossimApplanixEORecord> getRecord(ossim_uint32 idx)const;
-      
-   bool isHeightAboveMSL()const;
-   bool isEcefModel()const;
-   bool isUtmFrame()const;
-   ossim_int32 getUtmZone()const;
-   ossimString getUtmHemisphere()const;
-
-   ossimString getSbetField()const;
-   double getBoreSightTx()const;
-   double getBoreSightTy()const;
-   double getBoreSightTz()const;
-   double getLeverArmLx()const;
-   double getLeverArmLy()const;
-   double getLeverArmLz()const;
-   double getKardinalKappa()const;
-   double getShiftValuesX()const;
-   double getShiftValuesY()const;
-   double getShiftValuesZ()const;
-
-   ossimString getMappingFrameDatum()const;
-   ossimString getMappingFrameProjection()const;
-   double getMappingFrameCentralMeridian()const;
-   double getMappingFrameOriginLatitude()const;
-   double getMappingFrameGridScaleFactor()const;
-   double getMappingFrameFalseEasting()const;
-   double getMappingFrameFalseNorthing()const;
-
-   ossimString convertToOssimDatumCode(const ossimString& datum)const;
-   
-protected:
-   ossimString theHeader;
-   ossimString theVersion;
-   ossimString theBoreSightTx;
-   ossimString theBoreSightTy;
-   ossimString theBoreSightTz;
-   ossimString theKappaCardinal;
-   ossimString theLeverArmLx;
-   ossimString theLeverArmLy;
-   ossimString theLeverArmLz;
-   ossimString theShiftValuesX;
-   ossimString theShiftValuesY;
-   ossimString theShiftValuesZ;
-   ossimString theSbetField;
-
-   ossimString theMappingFrameDatum;
-   ossimString theMappingFrameProjection;
-   ossimString theCentralMeridian;
-   ossimString theOriginLatitude;
-   ossimString theGridScaleFactor;
-   ossimString theFalseEasting;
-   ossimString theFalseNorthing;
-   ossimString theUtmZone;
-   ossimString theUtmHemisphere;
-
-   ossim_float64 theMinLat;
-   ossim_float64 theMinLon;
-   ossim_float64 theMaxLat;
-   ossim_float64 theMaxLon;
-   std::vector<ossimString> theRecordFormat;
-   std::vector< ossimRefPtr<ossimApplanixEORecord> > theApplanixRecordList;
-   std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>, ossimStringLtstr> theRecordIdMap;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimAuxFileHandler.h b/ossim/include/ossim/support_data/ossimAuxFileHandler.h
deleted file mode 100644
index e5ce077..0000000
--- a/ossim/include/ossim/support_data/ossimAuxFileHandler.h
+++ /dev/null
@@ -1,231 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: SPADAC Inc
-//         Adaptd from the GDAL package hfa dataset
-// Description: This class provides some simple utilities for aux file.
-//
-//********************************************************************
-// $Id: ossimAuxFileHandler.h 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#ifndef ossimAuxFileHandler_HEADER
-#define ossimAuxFileHandler_HEADER
-
-#include <cstring>
-#include <cstdlib>
-#include <string>
-#include <iostream>
-#include <fstream>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-
-#define EPT_u1	0
-#define EPT_u2	1
-#define EPT_u4	2
-#define EPT_u8	3
-#define EPT_s8	4
-#define EPT_u16	5
-#define EPT_s16	6
-#define EPT_u32	7
-#define EPT_s32	8
-#define EPT_f32	9
-#define EPT_f64	10
-#define EPT_c64	11
-#define EPT_c128 12
-
-class ossimFilename;
-class ossimAuxEntry;
-class ossimAuxType;
-class ossimAuxDictionary;
-
-class ossimAuxInfo{
-
-public:
-  ossimAuxInfo();
-
-  virtual ~ossimAuxInfo();   
-
-  FILE *fp;
-
-  ossim_uint32  nEndOfFile;
-  ossim_uint32	nRootPos;
-  ossim_uint32	nDictionaryPos;
-
-  ossim_int16	nEntryHeaderLength;
-  ossim_int32	nVersion;
-
-  ossimAuxEntry* m_Root;
-
-  ossimAuxDictionary*  m_Dictionary;
-  char* dictionaryData;
-};
-
-
-class ossimAuxEntry
-{
-  ossim_uint32	nFilePos;
-
-  ossimAuxInfo*   m_auxInfo;
-  ossimAuxEntry*  m_Parent;
-  ossimAuxEntry*  m_Prev;
-  ossimAuxEntry*  m_Next;
-  ossimAuxEntry*  m_Child;
-
-  ossim_uint32	  nNextPos;
-  ossim_uint32	  nChildPos;
-  
-  char	entryNodeName[64];
-  char	entryType[32];
-
-  ossimAuxType* m_Type;
-  ossim_uint32	nDataPos;
-  ossim_uint32	nDataSize;
-  char*  entryData;
-
-  void	     loadData();
-
-  int 	     getFieldValue(const char* auxFieldPath,
-                           char chReqType, void *reqReturn);
-
-public:
-  ossimAuxEntry( ossimAuxInfo* auxInfoIn, ossim_uint32 nPos,
-    ossimAuxEntry* parentIn, ossimAuxEntry* prevIn);
-
-  virtual     ~ossimAuxEntry();                
-
-  ossim_uint32	getFilePos() { return nFilePos; }
-
-  const char*   getName() { return entryNodeName; }
-  void          setName( const char *nodeName );
-
-  const char*   getType() { return entryType; }
-
-  char*  getData() { loadData(); return entryData; }
-  ossim_uint32	getDataPos() { return nDataPos; }
-  ossim_uint32	getDataSize() { return nDataSize; }
-
-  ossimAuxEntry*     getChild();
-  ossimAuxEntry*     getNext();
-  ossimAuxEntry*     getNamedChild( const char * name);
-
-  ossim_int16	  getIntField( const char * auxFieldPath);
-  const char*   getStringField( const char * auxFieldPath);
-
-};
-
-class ossimAuxField
-{
-public:
-  int		nBytes;
-
-  int		nItemCount;
-  char	chPointer; 	/* '\0', '*' or 'p' */
-  char	chItemType;	/* 1|2|4|e|... */
-
-  char	*itemObjectType; /* if chItemType == 'o' */
-  ossimAuxType* m_auxItemObjectType;
-
-  char** enumNames; /* normally NULL if not an enum */
-
-  char	*fieldName;
-
-  ossimAuxField();
-  ~ossimAuxField();
-
-  int 	extractInstValue( const char * auxField, int nIndexValue,
-    char *entryData, ossim_uint32 nDataOffset, int nDataSize,
-    char chReqType, void *reqReturn );
-
-  int		getInstCount( char * entryData, int nDataSize );
-
-  int   getInstBytes( char *entryData, int nDataSize );
-
-  const char* initialize( const char * fieldInput );
-
-  void completeDefn( ossimAuxDictionary * auxDict );
-};
-
-
-class ossimAuxType
-{
-public:
-  int		nBytes;
-  int		nFields;
-
-  ossimAuxField** m_auxFields;
-
-  char* auxTypeName;
-
-  ossimAuxType();
-  ~ossimAuxType();
-
-  const char* initialize( const char * typeInput);
-
-  void	completeDefn( ossimAuxDictionary * auxDict);
-
-  int		getInstBytes(char *entryData, int nDataSize );
-
-  int   extractInstValue( const char * auxField,
-    char *entryData, ossim_uint32 nDataOffset, int nDataSize,
-    char chReqType, void *reqReturn );
-};
-
-class ossimAuxDictionary
-{
-public:
-  int		nTypes;
-  int   nTypesMax;
-  ossimAuxType**  m_auxTypes;
-
-  ossimAuxDictionary(const char *auxDictStr);
-  ~ossimAuxDictionary();
-
-  ossimAuxType* findType( const char * name);
-  void          addType( ossimAuxType * type);
-
-  static int	  getItemSize( char chType);
-};
-
-
-class OSSIM_DLL ossimAuxFileHandler
-{
-public:
-
-
-  ossimAuxFileHandler();
-  virtual ~ossimAuxFileHandler();
-  /**
-  * @read .aux file
-  */
-  bool isAuxFile(const ossimFilename& file);
-
-  /**
-  * @open the file for reading
-  */
-  bool open(const ossimFilename& file);
-
-  /**
-  *  Reads a single record from a aux file.
-  *  Returns true if succesful. Returns false if EOF or error.
-  */
-  const ossimString& getProjectionName() const { return m_projName; }
-
-  const ossimString& getDatumName() const { return m_datumName; }
-
-  const ossimString& getUnitType() const { return m_unitsType; }
-
-private:
-
-  ossimAuxInfo* m_auxInfo;
-  ossimString m_projName;
-  ossimString m_datumName;
-  ossimString m_unitsType;
-};
-
-#endif  // #ifndef ossimAuxFileHandlerl_HEADER
-
diff --git a/ossim/include/ossim/support_data/ossimAuxXmlSupportData.h b/ossim/include/ossim/support_data/ossimAuxXmlSupportData.h
deleted file mode 100644
index 9539afc..0000000
--- a/ossim/include/ossim/support_data/ossimAuxXmlSupportData.h
+++ /dev/null
@@ -1,94 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: See class description below.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimAuxXmlSupportData_HEADER
-#define ossimAuxXmlSupportData_HEADER 1
-
-#include <ossim/base/ossimRefPtr.h>
-#include <iosfwd>
-#include <string>
-
-// Forward class declarations:
-class ossimDrect;
-class ossimFilename;
-class ossimProjection;
-class ossimString;
-class ossimXmlDocument;
-
-/**
- * @class ossimAuxXmlSupportData
- *
- * Utility/support data class to extract the projection from a dot aux dot xml
- * file commonly found with mrsid data.
- */
-class OSSIM_DLL ossimAuxXmlSupportData
-{
-public:
-   
-   /** default constructor */
-   ossimAuxXmlSupportData();
-
-   /** virtual destructor */
-   virtual ~ossimAuxXmlSupportData();
-
-   /**
-    * @brief Method to get a projection if possible.
-    * @param file File name to open.
-    * @return Projection pointer wrapped in ref pointer.  Can be null if
-    * projection cannot be established.
-    */
-   ossimRefPtr<ossimProjection> getProjection(const ossimFilename& file) const;
-
-private:
-
-   /**
-    * @brief Gets path from doc and initializes string.
-    * @param path Xml path to look for.
-    * @param xdoc Xml doc to look in.
-    * @param s String to initialize.
-    * @return true on success and false if path is not found or if there
-    * are more than one of path.
-    */
-   bool getPath( const ossimString& path,
-                 const ossimXmlDocument& xdoc,
-                 ossimString& s ) const;
-
-   /**
-    * @brief Sets tie and scale.
-    * @param xdoc Xml document.
-    * @param wkt Well known tet string.
-    * @return True on success, false on error.
-    */
-   bool initializeProjection( const ossimXmlDocument xdoc,
-                              const std::string& wkt,
-                              ossimProjection* proj ) const;
-
-   /**
-    * @brief Get first parameter from PROJCS[ ... ] string.
-    * @param wkt Well known tet string.
-    * @param name Initialized by this with name if found.
-    * @return true on success, false on error.
-    */
-   bool getProjcsName( const std::string& wkt, std::string& name ) const;
-
-   /**
-    * @brief Gets units of Projected Coordinate System.
-    * @param wkt Well known tet string.
-    * @return Units.
-    */
-   ossimUnitType getUnits( const std::string& wkt ) const;
-
-};
-
-#endif /* End of "#ifndef ossimAuxXmlSupportData_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimCcfInfo.h b/ossim/include/ossim/support_data/ossimCcfInfo.h
deleted file mode 100644
index 6c3bd38..0000000
--- a/ossim/include/ossim/support_data/ossimCcfInfo.h
+++ /dev/null
@@ -1,61 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CCF Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimCcfInfo_HEADER
-#define ossimCcfInfo_HEADER
-
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimFilename.h>
-
-class ossimNitfFile;
-
-/**
- * @brief NITF info class.
- *
- * Encapsulates the dumpnitf functionality.
- */
-class OSSIM_DLL ossimCcfInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimCcfInfo();
-
-   /** virtual destructor */
-   virtual ~ossimCcfInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-   
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-private:
-   ossimFilename theFile;
-};
-
-#endif /* End of "#ifndef ossimCcfInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimDemGrid.h b/ossim/include/ossim/support_data/ossimDemGrid.h
deleted file mode 100644
index 3449a11..0000000
--- a/ossim/include/ossim/support_data/ossimDemGrid.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class defines a DEM grid.
-//
-//********************************************************************
-// $Id: ossimDemGrid.h 9305 2006-07-19 17:47:04Z dburken $
-
-#ifndef ossimDemGrid_HEADER
-#define ossimDemGrid_HEADER
-
-#include <iostream>
-#include <vector>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimDemHeader.h>
-#include <ossim/support_data/ossimDemProfile.h>
-
-/*!
- *  class ossimDemGrid
- *  This class uses the DEM library to read a DEM and construct a rectangular
- *  grid of signed 16 bit point values.
- */
-class ossimDemGrid
-{
-public:
-
-   /*!
-    *  Missing or void data is replaced with missingDataValue.
-    */
-   ossimDemGrid(ossim_float32 missingDataValue = -32768.0);
-
-   ~ossimDemGrid();
-
-   /*!
-    *  Convertes a DEM to a rectangular grid.
-    *
-    *  If incrementalRead is false, the entire DEM will be converted
-    *  with just one call to read. 0 (zero) is returned if successful, -1
-    *  if error.
-    *
-    *  If incrementalRead is true, multiple calls to read are
-    *  required, and the return value is as follows:
-    *     >0  --  Number of calls remaining until conversion is complete.
-    *    ==0  --  Conversion was successful. No more calls to read required.
-    *     -1  --  Error during conversion.
-    */
-   long read(std::istream& dem, bool incrementalRead = false);
-
-   // Accessors
-   ossimDemHeader const& getHeader() const;
-
-   /*!
-    *  Returns the number of columns in the grid.
-    */
-   long getWidth() const;
-
-   /*!
-    *  Returns the number of rows in the grid.
-    */
-   long getHeight() const;
-
-   /*!
-    *  Returns the elevation value at (x,y). (0,0) is in the upper left
-    *  corner, x is positive to the right, y is positive down.
-    */
-   ossim_float32 getElevation(long x, long y) const;
-
-   /*!
-    *  Returns the value used to indicate missing data.
-    */
-   ossim_float32 getMissingDataValue() const;
-
-   /*!
-    *  (x,y) are the coordinates of a elevation value in the dem.
-    *  (ground_x, ground_y) are the coordinates of that value in the
-    *  units of the horizontal projection system used by the dem.
-    */
-   void getGroundCoords(long x, long y, double& ground_x, double& ground_y);
-
-private:
-
-   ossim_float32   _missDataVal;
-   ossimDemHeader  _header;
-   long            _width;
-   long            _height;
-   ossim_float32*  _grid;
-   bool            _firstTime; // Whether or not we've started reading the DEM.
-   long            _curProfile;
-   std::vector<ossimDemProfile> _profiles;  // Used by fillUTM()
-   double _northwest_x, _northwest_y;
-
-   void setElevation(long x, long y, ossim_float32 val);
-   long fillGeographic(std::istream& dem, bool incrementalRead);
-   long fillUTM(std::istream& dem, bool incrementalRead);
-};
-
-inline void ossimDemGrid::setElevation(long x, long y, ossim_float32 val)
-{
-   if (_grid == 0)
-      return;
-
-   _grid[(_width * y) + x] = val;
-}
-
-#endif  // #ifndef ossimDemGrid_HEADER
diff --git a/ossim/include/ossim/support_data/ossimDemHeader.h b/ossim/include/ossim/support_data/ossimDemHeader.h
deleted file mode 100644
index 0b5edee..0000000
--- a/ossim/include/ossim/support_data/ossimDemHeader.h
+++ /dev/null
@@ -1,384 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class parses a DEM header.
-//
-//********************************************************************
-// $Id: ossimDemHeader.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDemHeader_HEADER
-#define ossimDemHeader_HEADER
-
-#include <string>
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimDemPoint.h>
-
-class ossimFilename;
-class ossimString;
-class ossimKeywordlist;
-
-class OSSIM_DLL ossimDemHeader
-{
-public:
-   
-   ossimDemHeader();
-   
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& s,
-                                             const ossimDemHeader& header);
-   friend OSSIM_DLL std::istream& operator>>(std::istream& s,
-                                             ossimDemHeader& header);
-
-   /**
-    * @brief open method that takes a file.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   bool open(const ossimFilename& file);
-
-   /**
-    * @brief open method that takes a stream.
-    *
-    * @param is The input stream to read from.
-    *
-    * @return stream
-    */
-   std::istream& open(std::istream& is);
-
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */   
-   std::ostream& print(std::ostream& out) const;
-   
-   // Accessors
-
-   /*! Quadrangle name. */
-   std::string const& getQuadName() const;
-
-   /*! Free format desciptor field containing process information. */
-   std::string const& getProcessInfo () const;
-
-   /*!
-    *  SE geographic corner orderd as:
-    *  x == Longitude == SDDDMMSS.SSSS
-    *  (neg sign (s) right justified, no leading zeros,
-    *  plus sign (s) implied
-    */
-   double getSEGeoCornerX () const;
-
-   /*!
-    *  SE geographic corner orderd as:
-    *  y == Latitude == SDDMMSS.SSSS
-    *  (neg sign (s) right justified, no leading zeros,
-    *  plus sign (s) implied
-    */
-   double getSEGeoCornerY () const;
-
-   /*!
-    *  1 == Autocorrelation resample simple bilinear
-    *  2 == Manual profile GRIDEM simple bilinear
-    *  3 == DLG/hypsography CTOG 8-direction bilinear
-    *  4 == Interpolation from photogrammetic system contours DCASS 
-    *  4-direction bilinear
-    *  5 == DLG/hypsography LINETRACE, LT4X complex linear
-    *  6 == DLG/hypsography CPS-3, ANUDEM, GRASS complex polynomial
-    *  7 == Electronic imaging (non-photogrammetric), active or passive
-    *  sensor systems
-    */
-   ossim_int32 getProcessCode () const;
-
-   /*!
-    *  Used for 30 minute DEMs - Identifies 1:100,000 scale sections
-    *  Formatted as XNN, wher X is "S" == 7.5 min. & "F" == 15 min.
-    *  NN is a two digit sequence number
-    */
-   std::string const& getSectionIndicator() const;
-
-   /*!
-    *  Mapping Center origin code. "EMC","WMC","MCMC","RMMC","FS" and "GPM2"
-    */
-   std::string const& getMappingCenterCode() const;
-
-   /*!
-    *  1 == DEM-1
-    *  2 == DEM-2
-    *  3 == DEM-3
-    */
-   ossim_int32 getLevelCode() const;
-
-   /*!
-    *  1 == Regular
-    *  2 == Random (reserved for future use).
-    */
-   ossim_int32 getElevPattern() const;
-
-   /*!
-    *  Code defining ground planimetric reference system.
-    *  0 == Geographic
-    *  1 == UTM
-    *  2 == State Plane
-    */
-   ossim_int32 getGroundRefSysCode() const;
-
-   /*!
-    * @return The projection type as a string.
-    */
-   ossimString getProjectionType() const;
-
-   /*!
-    *  Code defining zone in ground planimetric reference system.
-    */
-   ossim_int32 getGroundRefSysZone() const;
-
-   /*!
-    *  Code defining unit of measure for ground planimetric coordinates
-    *  used throughout the file.
-    *  0 == Radians
-    *  1 == Feet
-    *  2 == Meters
-    *  3 == Arc Seconds
-    */
-   ossim_int32 getGroundRefSysUnits() const;
-
-   /*!
-    *  Code defining unit of measure for elevation coordinates used
-    *  throughout the file.
-    *  1 == Feet
-    *  2 == Meters
-    */
-   ossim_int32 getElevationUnits() const;
-
-   /*!
-    *  Set n == 4
-    */
-   ossim_int32 getNumPolySides() const;
-
-   /*!
-    *  The coordinates of the quadrangle corners are ordered in a clockwise
-    *  direction beginning with the southwest corner.
-    */
-   const ossimDemPointVector& getDEMCorners() const;
-
-   /*!
-    *  In Radians the counterclockwise angle from the primary axis of ground
-    *  planimetric reference to the primary axis of the DEM local reference
-    *  system. Set to 0 to align with the coordinate system
-    */
-   double getCounterclockAngle() const;
-
-   /*!
-    *  0 == unknown accuracy
-    *  1 == accuracy info is given in logical record type C
-    */
-   ossim_int32 getElevAccuracyCode() const;
-
-   /*!
-    *  Minimum elevation in the DEM.
-    */
-   double getMinimumElev() const;
-
-   /*!
-    *  Maximum elevation in the DEM.
-    */
-   double getMaximumElev() const;
-
-   double getSpatialResX() const;
-   double getSpatialResY() const;
-   double getSpatialResZ() const;
-
-   /*!
-    *  The number of rows and columns in profiles in the DEM. 
-    *  NOTE: When profile rows == 1, profile columns is the number of profiles
-    *  in the DEM.
-    */
-   ossim_int32 getProfileRows() const;
-   ossim_int32 getProfileColumns() const;      
-
-   /*!
-    *  Present only if two or more primary intervals exist (level 2 DEM's only)
-    */
-   ossim_int32 getLargeContInt() const;
-
-   /*!
-    *  0 == NA
-    *  1 == feet
-    *  2 == meters
-    *  (level two DEM's only)
-    */
-   ossim_int32 getMaxSourceUnits() const;
-
-   /*!
-    *  Smallest or only primary contour interval (level 2 DEM's only)
-    */
-   ossim_int32 getSmallContInt() const;
-
-   /*!
-    *  1 == feet
-    *  2 == meters
-    */
-   ossim_int32 getMinSourceUnits() const;
-
-   /*!
-    *  YYY
-    */
-   ossim_int32 getSourceDate() const;
-
-   /*!
-    *  YYY
-    */
-   ossim_int32 getInspRevDate() const;
-
-   /*!
-    *  "I" indicates all processes of part3, Quality Control have been
-    *  performed.
-    */
-   std::string const& getInspFlag() const;
-
-   /*!
-    *  0 == No Validation
-    *  1 == RSME computed from test points, no quantative test or interactive
-    *       editing/review
-    *  2 == Batch process water body edit and RSME computed from test points
-    *  3 == Review and edit, including water edit. No RSME computed from test
-    *       points
-    *  4 == Level 1 DEM's reviewed & edited. RSME computed from test points
-    *  5 == Level 2 & 3 DEM's reviewed & edited. RSME computed from test points
-    */
-   ossim_int32 getDataValFlag() const;
-
-   /*!
-    *  0 == none
-    *  1 == suspect areas
-    *  2 == void areas
-    *  3 == suspect & void areas
-    */
-   ossim_int32 getSuspectVoidFlag() const;
-
-   /*!
-    *  1 == local mean sea level
-    *  2 == National Geodetic Vertical Datum 1929
-    *  3 == North American Vertical Datum 1988
-    */
-   ossim_int32 getVertDatum() const;
-
-   /*!
-    *  1 == North Amercian Datum 1927 (NAD 27)
-    *  2 == World Geoditic System 1972 (WGS 72)
-    *  3 == WGS 84
-    *  4 == NAD 83
-    *  5 == Old Hawaii Datum
-    *  6 == Puerto Rico Datum
-    */
-   ossim_int32 getHorizDatum() const;
-
-   /**
-    * @return The ossim datum code as a string.
-    */
-   ossimString getHorizDatumCode() const;
-
-   /*!
-    *  01-99 Primarily a DMA specfic field. (For USGS use set to 01)
-    */
-   ossim_int32 getDataEdition() const;
-
-   /*!
-    *  Contains the percentage of nodes in the file set to void
-    */
-   ossim_int32 getPerctVoid() const;
-
-   /*!
-    *  West edge match status flag
-    */
-   ossim_int32 getWestEdgeFlag() const;
-
-   /*!
-    *  North edge match status flag
-    */
-   ossim_int32 getNorthEdgeFlag() const;
-
-   /*!
-    *  East edge match staus flag
-    */
-   ossim_int32 getEastEdgeFlag() const;
-
-   /*!
-    *  South edge match status flag
-    */
-   ossim_int32 getSouthEdgeFlag() const;
-
-   /*!
-    *  Vertical datum shift - value is in the form of SFFF.DD Value is
-    *  the average shift value for the four quadrangle corners obtained
-    *  from program VERTCOM.
-    */
-   double getVertDatumShift() const;
-
-   /*!
-    * Populates keyword list with geometry info.
-    * 
-    * @return true on success, false on error.
-    */
-   bool getImageGeometry(ossimKeywordlist& kwl,
-                         const char* prefix=NULL) const;
-	 
-private:
-
-   std::string _quadName;
-   std::string _processInfo;
-   double _seGeoCornerX;
-   double _seGeoCornerY;
-   ossim_int32 _processCode;
-   std::string _sectionIndicator;
-   std::string _mapCenterCode;
-   ossim_int32 _levelCode;
-   ossim_int32 _elevPattern;
-   ossim_int32 _groundRefSysCode;
-   ossim_int32 _groundRefSysZone;
-   ossim_int32 _groundRefSysUnits;
-   ossim_int32 _elevUnits;
-   ossim_int32 _numPolySides;
-   ossimDemPointVector _demCorners;
-   double _counterclockAngle;
-   ossim_int32 _elevAccuracyCode;
-   double _minElevation;
-   double _maxElevation;
-   double _spatialResX;
-   double _spatialResY;
-   double _spatialResZ;
-   ossim_int32 _profileRows;
-   ossim_int32 _profileColumns;
-   ossim_int32 _largeContInt;
-   ossim_int32 _maxSourceUnits;
-   ossim_int32 _smallContInt;
-   ossim_int32 _minSourceUnits;
-   ossim_int32 _sourceDate;
-   ossim_int32 _inspRevDate;
-   std::string _inspFlag;
-   ossim_int32 _valFlag;
-   ossim_int32 _suspectVoidFlg;
-   ossim_int32 _vertDatum;
-   ossim_int32 _horizDatum;
-   ossim_int32 _dataEdition;
-   ossim_int32 _perctVoid;
-   ossim_int32 _westEdgeFlag;
-   ossim_int32 _northEdgeFlag;
-   ossim_int32 _eastEdgeFlag;
-   ossim_int32 _southEdgeFlag;
-   double _vertDatumShift;
-};
-
-#endif  // #ifndef ossimDemHeader_HEADER
-
diff --git a/ossim/include/ossim/support_data/ossimDemInfo.h b/ossim/include/ossim/support_data/ossimDemInfo.h
deleted file mode 100644
index 29a3366..0000000
--- a/ossim/include/ossim/support_data/ossimDemInfo.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: USGS DEM Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimDemInfo_HEADER
-#define ossimDemInfo_HEADER
-
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/support_data/ossimInfoBase.h>
-
-/**
- * @brief USGS DEM info class.
- *
- * Encapsulates the dumpnitf functionality.
- */
-class OSSIM_DLL ossimDemInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimDemInfo();
-
-   /** virtual destructor */
-   virtual ~ossimDemInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-   
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-private:
-   ossimFilename theFile;
-};
-
-#endif /* End of "#ifndef ossimDemInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimDemProfile.h b/ossim/include/ossim/support_data/ossimDemProfile.h
deleted file mode 100644
index 45510a6..0000000
--- a/ossim/include/ossim/support_data/ossimDemProfile.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class defines a DEM profile.
-//
-//********************************************************************
-// $Id: ossimDemProfile.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDemProfile_HEADER
-#define ossimDemProfile_HEADER
-
-#include <vector>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimDemPoint.h>
-
-typedef std::vector<ossim_int32> ossimDemElevationVector;
-
-class ossimDemProfile
-{
-public:
-
-   ossimDemProfile();
-   ossimDemProfile(ossimDemProfile const& right);
-   ossimDemProfile const& operator=(ossimDemProfile const& right);
-
-   friend std::ostream& operator<<(std::ostream& s, ossimDemProfile& demp);
-   friend std::istream& operator>>(std::istream& s, ossimDemProfile& demp);
-
-   // Accessors
-
-   /*!
-    *  Row identification number. Typically set to 1.
-    */
-   ossim_int32 getRowNumber() const;
-
-   /*!
-    *  Column identification number. This is the profile sequence number.
-    */
-   ossim_int32 getColumnNumber() const;
-
-   /*!
-    *  Number of elevations in this profile.
-    */
-   ossim_int32 getNumberOfElevations() const;
-
-   /*!
-    *  Location (in ground planimetric coordinates) of the first
-    */
-   ossimDemPoint const& getProfileLocation() const;
-
-   /*!
-    *  Elevation of local datum for the profile.
-    *  Value is in units of measure given by the Elevation Units field
-    *  found in the DEM header.
-    */
-   double getLocalDatumElevation() const;
-
-   /*!
-    *  Minimum elevation for this profile.
-    */
-   double getMinimumElev() const;
-
-   /*!
-    *  Maximum elevation for this profile.
-    */
-   double getMaximumElev() const;
-
-   /*!
-   *  Elevation values.
-   *  From the DEM standard:
-   *  "A value in this array would be multiplied by the spatial resolution
-   *  value and added to the elevation of the local elevation datum for the
-   *  element profile to obtain the elevation for the point."
-   */
-   ossimDemElevationVector const& getElevations() const;
-
-private:
-
-   ossim_int32 _row;
-   ossim_int32 _column;
-   ossim_int32 _numberElevations;
-   ossimDemPoint _profileLocation;
-   double _locDatumElev;
-   double _minElev;
-   double _maxElev;
-   ossimDemElevationVector _elevations;
-};
-
-#endif  // #ifndef ossimDemProfile_HEADER
-
diff --git a/ossim/include/ossim/support_data/ossimDemStats.h b/ossim/include/ossim/support_data/ossimDemStats.h
deleted file mode 100644
index 8976b4d..0000000
--- a/ossim/include/ossim/support_data/ossimDemStats.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class provides some statistics for DEMs.
-//
-//********************************************************************
-// $Id: ossimDemStats.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDemStats_HEADER
-#define ossimDemStats_HEADER
-
-#include <iostream>
-
-class ossimDemStats
-{
-public:
-
-   ossimDemStats();
-   ~ossimDemStats();
-
-   friend std::ostream& operator<<(std::ostream& s,
-                                   ossimDemStats const& stats);
-   friend std::istream& operator>>(std::istream& s, ossimDemStats& stats);
-
-   //Accessors
-
-   /*!
-    *  1 = available
-    *  2 = unavailable
-    *  The code defines the availability of statics
-    */
-   long getAvailCodeDE2() const;
-
-   long getRSMEDE2x () const;
-
-   long getRSMEDE2y () const;
-
-   long getRSMEDE2z () const;
-
-   /*!
-    *  This code defines the sample size use
-    *  to compute the accuracy, if 0 then the
-    *  accuracy is estimated.
-    */
-   long getSampleSizeDE2() const;
-
-   /*!
-    *  1 = available
-    *  2 = unavailable
-    *  The code defines the availability of statics
-    */
-   long getAvailCodeDE5() const;
-
-   long getRSMEDE5x () const;
-
-   long getRSMEDE5y () const;
-
-   long getRSMEDE5z () const;
-	
-   /*!
-    *  This code defines the sample size use
-    *  to compute the accuracy, if 0 then the
-    *  accuracy is estimated.
-    */
-   long getSampleSizeDE5() const;
-
-private:
-
-   long _availCodeDE2;
-   long _rsmeDE2x;
-   long _rsmeDE2y;
-   long _rsmeDE2z;
-   long _sampleSizeDE2;
-   long _availCodeDE5;
-   long _rsmeDE5x;
-   long _rsmeDE5y;
-   long _rsmeDE5z;
-   long _sampleSizeDE5;
-};
-
-#endif // #ifndef ossimDemStats_HEADER
-
diff --git a/ossim/include/ossim/support_data/ossimDemUtil.h b/ossim/include/ossim/support_data/ossimDemUtil.h
deleted file mode 100644
index 2beb64a..0000000
--- a/ossim/include/ossim/support_data/ossimDemUtil.h
+++ /dev/null
@@ -1,83 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class provides some simple utilities for DEMs.
-//
-//********************************************************************
-// $Id: ossimDemUtil.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDemUtil_HEADER
-#define ossimDemUtil_HEADER
-
-#include <cstring>
-#include <cstdlib>
-#include <string>
-#include <iostream>
-#include <fstream>
-
-class ossimFilename;
-
-class ossimDemUtil
-{
-public:
-
-   /**
-    * @brief Does basic sanity checks to see if file is a dem.
-    *
-    * 1) Check extension for .dem
-    *
-    * 2) Look for file.omd (ossim meta data) file containing keyword
-    *    "dem_type" with value of "usgs_dem".
-    *
-    * 3) Check 512 bytes and make sure there is no binary data.
-    *
-    * @note
-    * There is a keyword list template stored in the templates directory:
-    * "ossim/etc/templates/usgs_dem_template.kwl"
-    *
-    * @param file The file to check.
-    *
-    * @return true on success, false on error.
-    */
-   static bool isUsgsDem(const ossimFilename& file);
-
-   /**
-    *  Reads a single record from a DEM.
-    *  Returns true if succesful. Returns false if EOF or error.
-    */
-   static bool getRecord(std::istream& s, std::string& strbuf, long reclength = 1024);
-
-   /**
-    *  Same as getRecord above. buf should be at least reclength+1 in size.
-    */
-   static bool getRecord(std::istream& s, char* buf, long reclength = 1024);
-
-   static long getLong(char* const strbuf, // string to extract long from
-                       long const startpos,  // starting position of field
-                       long const width)     // width of field
-      {
-         char temp[1024];
-         strncpy(temp,strbuf+startpos,width);
-         temp[width] = '\0';
-         return atol(temp);
-      }
-
-   static bool getDouble(std::string const& strbuf, // string to extract double from
-                         long const startpos,  // starting position of field
-                         long const width,     // width of field
-                         double& val);         // value extracted from field.
-
-private:
-
-   ossimDemUtil();
-};
-
-#endif  // #ifndef ossimDemUtil_HEADER
-
diff --git a/ossim/include/ossim/support_data/ossimDoqq.h b/ossim/include/ossim/support_data/ossimDoqq.h
deleted file mode 100644
index 579be95..0000000
--- a/ossim/include/ossim/support_data/ossimDoqq.h
+++ /dev/null
@@ -1,127 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//
-// Description: This class parses a Digital Ortho Quarter Quad (DOQQ)
-//              header.
-//
-//********************************************************************
-// $Id: ossimDoqq.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDoqq_HEADER
-#define ossimDoqq_HEADER
-
-//#include <iostream>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fstream>
-#include <iostream>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/support_data/ossimInfoBase.h>
-
-class OSSIM_DLL ossimDoqq : public ossimInfoBase
-{
-public:
-   ossimDoqq();
-   ossimDoqq(ossimFilename file);
-   ~ossimDoqq();
-   
-   enum ossimErrorStatus
-   {
-      OSSIM_OK    = 0,
-      OSSIM_ERROR = 1
-   };
-
-   enum
-   {
-      GSD_X_OFFSET            = 59,
-      GSD_Y_OFFSET            = 59,
-      DATA_ORDER_OFFSET       = 142,      
-      LINE_OFFSET             = 145,
-      SAMPLE_OFFSET           = 151,
-      PROJECTION_OFFSET       = 196,
-      RGB_OFFSET              = 157,
-      UL_EASTING_OFFSET       = 288,
-      UL_NORTHING_OFFSET      = 312,
-      UTM_ZONE_OFFSET         = 199,
-      DATUM_OFFSET            = 168,
-
-      DATA_ORDER_SIZE         = 3,
-      LINE_SIZE               = 8,
-      SAMPLE_SIZE             = 8,  
-      PROJECTION_SIZE         = 3,
-      RGB_SIZE                = 3,
-      MARKING_U_SIZE          = 5,
-      MARKING_V_SIZE          = 5,
-      UL_EASTING_SIZE         = 24,
-      UL_NORTHING_SIZE        = 24,
-      UTM_ZONE_SIZE           = 6,
-      DATUM_SIZE              = 2,
-      RADIOMETRY_SIZE         = 3,
-      GSD_SIZE              = 12
-   };
-
-   //! Implementation of ossimInfoBase class pure virtual.
-   virtual bool open(const ossimFilename& file);
-
-   //! Implementation of ossimInfoBase class pure virtual.
-   virtual std::ostream& print(std::ostream& out) const;
-
-   ossimString theProjection;
-   ossimString theDatum;
-   ossimString theQuadName;
-   ossimString theQuad;
-   ossimString theNation;
-   ossimString theState;
-   ossimString theDataOrder;
-   ossimString theMarkU;
-   ossimString theMarkV;
-   ossimString theImageSource;
-   ossimString theSourceImageID;
-
-   ossim_int32 theUtmZone;
-   ossim_int32 theLine;
-   ossim_int32 theSample;
-   ossim_int32 theRgb;
-
-   ossimString theAcqYear;
-   ossimString theAcqMonth;
-   ossimString theAcqDay;
-   ossimString theAcqYearMonthDay;
-
-   ossim_float64 theRMSE;
-
-   ossim_float64   theEasting;
-   ossim_float64   theNorthing;
-   ossim_float64   theUN;
-   ossim_float64   theUE;
-   ossim_float64   theLN;
-   ossim_float64   theLE;
-   ossimDpt        theGsd;
-   ossim_int32     theHeaderSize;
-   ossim_int32     theRecordSize;
-
-   ossim_int32 errorStatus() const { return theErrorStatus; }
-   
-private:
-
-   std::ifstream           theDoqFile;
-   ossimErrorStatus   theErrorStatus;
-   
-   ossim_float64 convertStr(const char* str) const;
-
-   void ldstr_v1(std::istream& in);
-   void ldstr_v2(std::istream& in);
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimDtedAcc.h b/ossim/include/ossim/support_data/ossimDtedAcc.h
deleted file mode 100644
index c909923..0000000
--- a/ossim/include/ossim/support_data/ossimDtedAcc.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the Accuracy Description
-//               (ACC) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedAcc.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDtedAcc_H
-#define ossimDtedAcc_H
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimProperty;
-
-class OSSIM_DLL ossimDtedAcc : public ossimErrorStatusInterface
-{
-public:
-   ossimDtedAcc(const ossimFilename& dted_file="", ossim_int32 offset=0);
-   ossimDtedAcc(std::istream& in);
-   enum
-   {
-      ACC_LENGTH = 2700,
-      ACC_ABSOLUTE_CE = 4,
-      ACC_ABSOLUTE_LE = 8,
-      ACC_RELATIVE_CE = 12,
-      ACC_RELATIVE_LE = 16,
-      ACC_RESERVED_1 = 20,
-      ACC_RESERVED_2 = 24,
-      ACC_RESERVED_3 = 25,
-      ACC_MULTIPLE_FLAG = 56,
-      ACC_RESERVED = 58,
-      FIELD1_SIZE           = 3,
-      FIELD2_SIZE           = 4,
-      FIELD3_SIZE           = 4,
-      FIELD4_SIZE           = 4,
-      FIELD5_SIZE           = 4,
-      FIELD6_SIZE           = 4,
-      FIELD7_SIZE           = 1,
-      FIELD8_SIZE           = 31,
-      FIELD9_SIZE           = 2,
-      FIELD10_SIZE          = 4,
-      FIELD11_SIZE          = 4,
-      FIELD12_SIZE          = 4,
-      FIELD13_SIZE          = 4,
-      FIELD14_SIZE          = 2,
-      FIELD15_SIZE          = 9,
-      FIELD16_SIZE          = 10,
-      FIELD17_SIZE          = 18,
-      FIELD18_SIZE          = 69
-   };
-
-   // The Recoginition Sentinel signifies if the ACC record exists.
-
-   ossim_int32 absCE() const;
-   ossim_int32 absLE() const;
-   ossim_int32 relCE() const;
-   ossim_int32 relLE() const;
-   
-   ossim_int32 startOffset() const;
-   ossim_int32 stopOffset()  const;
-   
-   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
-                                              const ossimDtedAcc& acc);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix) const;
-   
-   void parse(std::istream& in);
-
-   void clearFields();
-
-   /**
-    * @brief Gets a property for name.
-    * @param name Property name to get.
-    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
-    * property for name was not found.
-    */
-   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-
-   /**
-    * @brief Adds this class's properties to list.
-    * @param propertyNames list to append to.
-    */
-   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-private:
-   // Do not allow...
-   ossimDtedAcc(const ossimDtedAcc& source);
-   const ossimDtedAcc& operator=(const ossimDtedAcc& rhs);
-
-   
-   char theRecSen[FIELD1_SIZE+1];
-   char theAbsoluteCE[FIELD2_SIZE+1];
-   char theAbsoluteLE[FIELD3_SIZE+1];
-   char theRelativeCE[FIELD4_SIZE+1];
-   char theRelativeLE[FIELD5_SIZE+1];
-   char theField6[FIELD6_SIZE+1];
-   char theField7[FIELD7_SIZE+1];
-   char theField8[FIELD8_SIZE+1];
-   char theField9[FIELD9_SIZE+1];
-   char theField10[FIELD10_SIZE+1];
-   char theField11[FIELD11_SIZE+1];
-   char theField12[FIELD12_SIZE+1];
-   char theField13[FIELD13_SIZE+1];
-   char theField14[FIELD14_SIZE+1];
-   char theField15[FIELD15_SIZE+1];
-   char theField16[FIELD16_SIZE+1];
-   char theField17[FIELD17_SIZE+1];
-   
-   ossim_int32 theStartOffset;
-   ossim_int32 theStopOffset;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimDtedDsi.h b/ossim/include/ossim/support_data/ossimDtedDsi.h
deleted file mode 100644
index 0463ef9..0000000
--- a/ossim/include/ossim/support_data/ossimDtedDsi.h
+++ /dev/null
@@ -1,238 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the Data Set Identification
-//               (DSI) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedDsi.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDtedDsi_H
-#define ossimDtedDsi_H
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimProperty;
-
-class OSSIM_DLL ossimDtedDsi : public ossimErrorStatusInterface
-{
-public:
-   ossimDtedDsi(const ossimFilename& dted_file="", ossim_int32 offset=0);
-   ossimDtedDsi(std::istream& in);
-
-   enum
-   {
-      DSI_LENGTH = 648,
-      DSI_SECURITY_CODE = 4,
-      DSI_SECURITY_CONTROL = 5,
-      DSI_SECURITY_HANDLING = 7,
-      DSI_RESERVED_1 = 34,
-      DSI_DMA_SERIES = 60,
-      DSI_RESERVED_2 = 65,
-      DSI_RESERVED_3 = 80,
-      DSI_DATA_EDITION = 88,
-      DSI_MATCH_MERGE_VERSION = 90,
-      DSI_MAINTENANCE_DATE = 91,
-      DSI_MATCH_MERGE_DATE = 95,
-      DSI_MAINTENANCE_CODE = 99,
-      DSI_PRODUCER_CODE = 103,
-      DSI_RESERVED_4 = 111,
-      DSI_PRODUCT_SPEC_STOCK_NUMBER = 127, 
-      DSI_PRODUCT_SPEC_NUMBER = 136,
-      DSI_PRODUCT_SPEC_DATE = 138,
-      DSI_VERTICAL_DATUM = 142,
-      DSI_HORIZ_DATUM = 145,
-      DSI_DIGITIZING_SYSTEM = 150,
-      DSI_COMPILATION_DATE = 160,
-      DSI_RESERVED_5 = 164,
-      DSI_LAT_ORIGIN = 186,
-      DSI_LON_ORIGIN = 195,
-      DSI_LAT_SW = 205,
-      DSI_LON_SW = 212,
-      DSI_LAT_NW = 220,
-      DSI_LON_NW = 227,
-      DSI_LAT_NE = 235,
-      DSI_LON_NE = 242,
-      DSI_LAT_SE = 250,
-      DSI_LON_SE = 257,
-      DSI_ORIENTATION = 265,
-      DSI_LAT_INTERVAL = 274,
-      DSI_LON_INTERVAL = 278,
-      DSI_NUM_LAT_LINES = 282,
-      DSI_NUM_LON_LINES = 286,
-      DSI_PARTIAL_CELL_INDICATOR = 290,
-      DSI_RESERVED = 292,
-      FIELD1_SIZE           = 3,
-      FIELD2_SIZE           = 1,
-      FIELD3_SIZE           = 2,
-      FIELD4_SIZE           = 27,
-      FIELD5_SIZE           = 26,
-      FIELD6_SIZE           = 5,
-      FIELD7_SIZE           = 15,
-      FIELD8_SIZE           = 8,
-      FIELD9_SIZE           = 2,
-      FIELD10_SIZE          = 1,
-      FIELD11_SIZE          = 4,
-      FIELD12_SIZE          = 4,
-      FIELD13_SIZE          = 4,
-      FIELD14_SIZE          = 8,
-      FIELD15_SIZE          = 16,
-      FIELD16_SIZE          = 9,
-      FIELD17_SIZE          = 2,
-      FIELD18_SIZE          = 4,
-      FIELD19_SIZE          = 3,
-      FIELD20_SIZE          = 5,
-      FIELD21_SIZE          = 10,
-      FIELD22_SIZE          = 4,
-      FIELD23_SIZE          = 22,
-      FIELD24_SIZE          = 9,
-      FIELD25_SIZE          = 10,
-      FIELD26_SIZE          = 7,
-      FIELD27_SIZE          = 8,
-      FIELD28_SIZE          = 7,
-      FIELD29_SIZE          = 8,
-      FIELD30_SIZE          = 7,
-      FIELD31_SIZE          = 8,
-      FIELD32_SIZE          = 7,
-      FIELD33_SIZE          = 8,
-      FIELD34_SIZE          = 9,
-      FIELD35_SIZE          = 4,
-      FIELD36_SIZE          = 4,
-      FIELD37_SIZE          = 4,
-      FIELD38_SIZE          = 4,
-      FIELD39_SIZE          = 2,
-      FIELD40_SIZE          = 101,
-      FIELD41_SIZE          = 100,
-      FIELD42_SIZE          = 156
-   };
-
-   // The Recognition Sentinel signifies if the DSI record exists.
-   ossimString recognitionSentinel() const;
-
-   ossimString securityCode()           const;
-   ossimString productLevel()           const;
-   ossimString edition()                const;
-   ossimString matchMergeVersion()      const;
-   ossimString maintanenceDate()        const;
-   ossimString matchMergeDate()         const;
-   ossimString maintenanceCode()        const;
-   ossimString producerCode()           const;
-   ossimString productStockSpecNumber() const;
-   ossimString productSpecNumber()      const;
-   ossimString productSpecDate()        const;
-   ossimString verticalDatum()          const;
-   ossimString horizontalDatum()        const;
-   ossimString compilationDate()        const;
-   ossimString latOrigin()              const;
-   ossimString lonOrigin()              const;
-   ossimString latSW()                  const;
-   ossimString lonSW()                  const;
-   ossimString latNW()                  const;
-   ossimString lonNW()                  const;
-   ossimString latNE()                  const;
-   ossimString lonNE()                  const;
-   ossimString latSE()                  const;
-   ossimString lonSE()                  const;
-
-   ossimString orientation()    const;
-   ossimString latInterval()    const;
-   ossimString lonInterval()    const;
-   ossim_int32 numLatPoints()   const;
-   ossim_int32 numLonLines()    const;
-   ossim_int32 cellIndicator()  const;
-   ossim_int32 startOffset()    const;
-   ossim_int32 stopOffset()     const;
-   
-   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
-                                              const ossimDtedDsi& dsi);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix) const;   
-   
-   void parse(std::istream& in);
-
-   /**
-    * @brief Gets a property for name.
-    * @param name Property name to get.
-    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
-    * property for name was not found.
-    */
-   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   
-   /**
-    * @brief Adds this class's properties to list.
-    * @param propertyNames list to append to.
-    */
-   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-private:
-   // Do not allow...
-   ossimDtedDsi(const ossimDtedDsi& source);
-   const ossimDtedDsi& operator=(const ossimDtedDsi& rhs);
-
-   
-   char theRecSen[FIELD1_SIZE+1];
-   char theSecurityCode[FIELD2_SIZE+1];
-   char theField3[FIELD3_SIZE+1];
-   char theField4[FIELD4_SIZE+1];
-   char theProductLevel[FIELD6_SIZE+1];
-   char theField7[FIELD7_SIZE+1];
-   char theField8[FIELD8_SIZE+1];
-   char theEdition[FIELD9_SIZE+1];
-   char theMatchMergeVersion[FIELD10_SIZE+1];
-   char theMaintenanceDate[FIELD11_SIZE+1];
-   char theMatchMergeDate[FIELD12_SIZE+1];
-   char theMaintenanceCode[FIELD13_SIZE+1];
-   char theProducerCode[FIELD14_SIZE+1];
-   char theField15[FIELD15_SIZE+1];
-   char theProductStockSpecNumber[FIELD16_SIZE+1];
-   char theProductSpecNumber[FIELD17_SIZE+1];
-   char theProductSpecDate[FIELD18_SIZE+1];
-   char theVerticalDatum[FIELD19_SIZE+1];
-   char theHorizontalDatum[FIELD20_SIZE+1];
-   char theField21[FIELD21_SIZE+1];
-   char theCompilationDate[FIELD22_SIZE+1];
-   char theField23[FIELD23_SIZE+1];
-   char theLatOrigin[FIELD24_SIZE+1];
-   char theLonOrigin[FIELD25_SIZE+1];
-   char theLatSW[FIELD26_SIZE+1];
-   char theLonSW[FIELD27_SIZE+1];
-   char theLatNW[FIELD28_SIZE+1];
-   char theLonNW[FIELD29_SIZE+1];
-   char theLatNE[FIELD30_SIZE+1];
-   char theLonNE[FIELD31_SIZE+1];
-   char theLatSE[FIELD32_SIZE+1];
-   char theLonSE[FIELD33_SIZE+1];
-   char theOrientation[FIELD34_SIZE+1];
-   char theLatInterval[FIELD35_SIZE+1];
-   char theLonInterval[FIELD36_SIZE+1];
-   char theNumLatPoints[FIELD37_SIZE+1];
-   char theNumLonLines[FIELD38_SIZE+1];
-   char theCellIndicator[FIELD39_SIZE+1];
-   char theField40[FIELD40_SIZE+1];
-   char theField41[FIELD41_SIZE+1];
-   char theField42[FIELD42_SIZE+1];
-   
-   ossim_int32       theStartOffset;
-   ossim_int32       theStopOffset;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimDtedHdr.h b/ossim/include/ossim/support_data/ossimDtedHdr.h
deleted file mode 100644
index a0920e9..0000000
--- a/ossim/include/ossim/support_data/ossimDtedHdr.h
+++ /dev/null
@@ -1,128 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the File Header Label
-//               (HDR) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedHdr.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDtedHdr_H
-#define ossimDtedHdr_H
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimProperty;
-
-class OSSIM_DLL ossimDtedHdr : public ossimErrorStatusInterface
-{
-public:
-   ossimDtedHdr(const ossimFilename& dted_file="", ossim_int32 offset=0);
-   ossimDtedHdr(std::istream& in);
-
-   enum
-   {
-      HDR_LENGTH            = 80,
-      HDR_ONE_LABEL_1       =  4,
-      HDR_FILENAME          =  5,
-      HDR_UNIVAC            = 22,
-      HDR_REEL              = 28,
-      HDR_FILE_NUM          = 32,
-      HDR_GENERATION_NUM    = 36,
-      HDR_VERSION_NUM       = 40,
-      HDR_CREATION_DATE     = 42,
-      HDR_EXPIRATION_DATE   = 48,
-      HDR_ACCESS            = 54,
-      HDR_BLOCK_COUNT       = 55,
-      HDR_QUALIFIER         = 61,
-      HDR_BLANKS            = 74,
-      FIELD1_SIZE           = 3,
-      FIELD2_SIZE           = 1,
-      FIELD3_SIZE           = 17,
-      FIELD4_SIZE           = 6,
-      FIELD5_SIZE           = 4,
-      FIELD6_SIZE           = 4,
-      FIELD7_SIZE           = 4,
-      FIELD8_SIZE           = 2,
-      FIELD9_SIZE           = 6,
-      FIELD10_SIZE          = 6,
-      FIELD11_SIZE          = 1,
-      FIELD12_SIZE          = 6,
-      FIELD13_SIZE          = 13,
-      FIELD14_SIZE          = 7
-   };
-
-   // The Recognition Sentinel signifies if the HDR record exists.
-   ossimString recognitionSentinel() const;
-
-   ossimString fileName()     const;
-   ossimString version()      const;
-   ossimString creationDate() const;
-   ossim_int32 startOffset()  const;
-   ossim_int32 stopOffset()   const;
-
-   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
-                                              const ossimDtedHdr& hdr);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix) const;
-
-   void parse(std::istream& in);
-
-   /**
-    * @brief Gets a property for name.
-    * @param name Property name to get.
-    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
-    * property for name was not found.
-    */
-   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-
-   /**
-    * @brief Adds this class's properties to list.
-    * @param propertyNames list to append to.
-    */
-   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-private:
-   // Do not allow...
-   ossimDtedHdr(const ossimDtedHdr& source);
-   const ossimDtedHdr& operator=(const ossimDtedHdr& rhs);
-   
-   char theRecSen[FIELD1_SIZE+1];
-   char theField2[FIELD2_SIZE+1];
-   char theFilename[FIELD3_SIZE+1];
-   char theField4[FIELD4_SIZE+1];
-   char theField5[FIELD5_SIZE+1];
-   char theField6[FIELD6_SIZE+1];
-   char theVersion[FIELD7_SIZE+1];
-   char theCreationDate[FIELD8_SIZE+1];
-   char theField9[FIELD9_SIZE+1];
-   char theField10[FIELD10_SIZE+1];
-   char theField11[FIELD11_SIZE+1];
-   char theField12[FIELD12_SIZE+1];
-   char theField13[FIELD13_SIZE+1];
-   char theField14[FIELD14_SIZE+1];
-   
-   ossim_int32 theStartOffset;
-   ossim_int32 theStopOffset;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimDtedInfo.h b/ossim/include/ossim/support_data/ossimDtedInfo.h
deleted file mode 100644
index 2a1199b..0000000
--- a/ossim/include/ossim/support_data/ossimDtedInfo.h
+++ /dev/null
@@ -1,78 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: DTED Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimDtedInfo_HEADER
-#define ossimDtedInfo_HEADER
-
-#include <iosfwd>
-#include <vector>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimNitfFile;
-class ossimProperty;
-
-/**
- * @brief DTED Info class.
- *
- * Encapsulates the dtedInfo functionality.
- */
-class OSSIM_DLL ossimDtedInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimDtedInfo();
-
-   /** virtual destructor */
-   virtual ~ossimDtedInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-   
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief Gets a property for name.
-    * @param name Property name to get.
-    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
-    * property for name was not found.
-    */
-   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   
-   /**
-    * @brief Adds this class's properties to list.
-    * @param propertyNames list to append to.
-    */
-   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-private:
-   ossimFilename theFile;
-};
-
-#endif /* End of "#ifndef ossimDtedInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimDtedRecord.h b/ossim/include/ossim/support_data/ossimDtedRecord.h
deleted file mode 100644
index 9f4ff6b..0000000
--- a/ossim/include/ossim/support_data/ossimDtedRecord.h
+++ /dev/null
@@ -1,165 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the Data Record Description
-//               of a DTED Level 1 file.
-//
-// Notes:  Each elevation is a true value referenced to meas sea level
-//         (MSL) datum recorded to the nearest meter.  The horizontal
-//         position is referenced to precise longitude-latitiude
-//         locations in terms of the current World Geodetic System
-//         (WGS84) determined for each file by reference to the origin
-//         at the southwest corner.  The elevations are evenly spaced
-//         in latitude and longitude at the interval designated in the
-//         User Header Label (UHL) in South to North profile sequence.
-//
-//********************************************************************
-// $Id: ossimDtedRecord.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimDtedRecord_H
-#define ossimDtedRecord_H
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-
-class OSSIM_DLL ossimDtedRecord : public ossimErrorStatusInterface
-{
-public:
-   ossimDtedRecord(std::istream& in,
-                   ossim_int32 offest,
-                   ossim_int32 num_points);
-   // NOTE:  When using this class be sure that as you cycle through
-   //        all the points within a record, that you verify they are
-   //        sequential.  According to the DTED Specification
-   //        (MIL-PRF-89020A) issued in 19 April 1996, page 22 all
-   //        records must be sequential.  If not, file may be corrupt.
-   //
-   //        To verify this, you can do the following:
-   //
-   //        int count = 0;
-   //        for(int i = 0; i < num_lon_lines; i++)
-   //          rec[i] = new ossimDtedRecord(theFileDesc, offset,
-   //                       num_lat_points);
-   //          if(count != (rec[i]->dataBlockCount() + 1))
-   //             ERROR -- Records are not sequential
-   //          count = rec[i]->dataBlockCount();
-
-   ~ossimDtedRecord();
-   
-   enum
-   {
-      DATA_LENGTH = 12,
-      DATA_BLOCK_COUNT = 2,
-      DATA_LON_COUNT = 4,
-      DATA_LAT_COUNT = 6,
-      DATA_ELEV_START = 8,
-      DATA_BYTES_PER_POINT = 2,
-   };
-
-   // The Recognition Sentinel signifies if the Data Record exists.
-   ossimString recognitionSentinel() const;
-
-   ossim_int32  dataBlockCount()   const;
-   ossim_int32  lonCount()         const;
-   ossim_int32  latCount()         const;
-   ossim_uint32 checkSum()         const;
-   ossim_uint32 computedCheckSum() const;
-   ossim_int32  numPoints()        const;
-
-   // Access methods for the elevation data
-   ossim_int32   getPoint(ossim_int32 i)     const;
-   ossim_uint16  getPointData(ossim_int32 i) const;
-   ossim_int32*  points()                    const;
-   ossim_uint16* pointsData()                const;
-   
-   ossim_int32 startOffset() const;
-   ossim_int32 stopOffset()  const;
-
-   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
-                                              const ossimDtedRecord& rec);
-   void parse(std::istream& in);
-
-private:
-   // prevent use
-   ossimDtedRecord(const ossimDtedRecord& source);
-
-   ossim_int32  theFile;
-
-   /*!
-    * 252 (8 bit)
-    */
-   ossimString theRecSen;
-
-   /*!
-    *  Sequential count of the block within the file.
-    */
-   ossim_int32  theDataBlockCount;
-
-   /*!
-    *  Count of the meridian.
-    *  True longitude = longitude count x data interval + origin
-    *  (Offset from the SW corner longitude)
-    */
-   ossim_int32  theLonCount;
-
-   /*!
-    *  Count of the parallel.
-    *  True latitude = latitude count x data interval + origin
-    *  (Offset from the SW corner latitude)
-    */
-   ossim_int32  theLatCount;
-
-   /*!
-    *  Algebraic addition of contents of block.
-    *  The checksum is computed algebraically using integer arithmetic by
-    *  summing all header and elevation bytes contained int the record as
-    *  8-bit values.  Each byte is considered an unsigned, 8-bit value for
-    *  checksum calculation.
-    */
-   ossim_uint32  theCheckSum;
-
-   /*!
-    *  All the elevation points in a Data Record as ints.
-    *  (ie. all the latitudal points in a longitudinal line)
-    */
-   ossim_int32* thePoints;
-
-   /*!
-    *  All the elevation points in a Data Record as unsigned shorts.
-    *  (ie. all the latitudal points in a longitudinal line)
-    */
-   ossim_uint16* thePointsData;
-
-   /*!
-    *  Our computed check sum.  This should match the checksum
-    *  at the end of the Data Record.
-    */
-   ossim_uint32  theComputedCheckSum;
-
-   /*!
-    *  The number of points in a longitudinal line.
-    */
-   ossim_int32  theNumPoints;
-
-   ossim_int32  theStartOffset;
-   ossim_int32  theStopOffset;
-
-   /*!
-    *  Compute the check sum for the Data Record and compare against
-    *  the parsed check sum from the data record. This must be correct
-    *  to be a valid data record. If not, there is a chance of a
-    *  corrupted elevation cell.
-    *
-    *  @return true if check sum validates, false if not.
-    */
-   bool validateCheckSum(std::istream& in);
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimDtedUhl.h b/ossim/include/ossim/support_data/ossimDtedUhl.h
deleted file mode 100644
index c6566d9..0000000
--- a/ossim/include/ossim/support_data/ossimDtedUhl.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the User Header Label
-//               (UHL) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedUhl.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimDtedUhl_H
-#define ossimDtedUhl_H
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimProperty;
-
-class OSSIM_DLL ossimDtedUhl : public ossimErrorStatusInterface
-{
-public:
-   ossimDtedUhl(const ossimFilename& dted_file="", ossim_int32 offset=0);
-   ossimDtedUhl(std::istream& in);
-
-   enum
-   {
-      UHL_LENGTH        = 80,
-      UHL_LON_ORIGIN    =  5,
-      UHL_LAT_ORIGIN    = 13,
-      UHL_LON_INTERVAL  = 21,
-      UHL_LAT_INTERVAL  = 25,
-      UHL_ABSOLUTE_LE   = 29,
-      UHL_SECURITY_CODE = 33,
-      UHL_REFERENCE_NUM = 33,
-      UHL_NUM_LON_LINES = 48,
-      UHL_NUM_LAT_LINES = 52,
-      UHL_MULTIPLE_ACC  = 56,
-      UHL_RESERVED      = 57,
-      FIELD1_SIZE       = 3,
-      FIELD2_SIZE       = 1,
-      FIELD3_SIZE       = 8,
-      FIELD4_SIZE       = 8,
-      FIELD5_SIZE       = 4,
-      FIELD6_SIZE       = 4,
-      FIELD7_SIZE       = 4,
-      FIELD8_SIZE       = 3,
-      FIELD9_SIZE       = 12,
-      FIELD10_SIZE      = 4,
-      FIELD11_SIZE      = 4,
-      FIELD12_SIZE      = 1,
-      FIELD13_SIZE      = 24
-   };
-   
-   // The Recognition Sentinel signifies if the UHL record exists.
-   ossimString recognitionSentinel() const;
-
-   double      lonOrigin()        const;
-   double      latOrigin()        const;
-   double      lonInterval()      const;
-   double      latInterval()      const;
-   double      absoluteLE()       const;
-   ossimString securityCode()     const;
-   ossim_int32 numLonLines()      const;
-   ossim_int32 numLatPoints()     const;
-   ossim_int32 mulitpleAccuracy() const;
-   ossim_int32 startOffset()      const;
-   ossim_int32 stopOffset()       const;
-   
-   friend OSSIM_DLL std::ostream& operator<<( std::ostream& out,
-                                              const ossimDtedUhl& uhl);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix) const;
-
-   void parse(std::istream& in);
-
-   /**
-    * @brief Gets a property for name.
-    * @param name Property name to get.
-    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
-    * property for name was not found.
-    */
-   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-
-   /**
-    * @brief Adds this class's properties to list.
-    * @param propertyNames list to append to.
-    */
-   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-private:
-   // Do not allow...
-   ossimDtedUhl(const ossimDtedUhl& source);
-   const ossimDtedUhl& operator=(const ossimDtedUhl& rhs);
-
-   double degreesFromString(const char* str) const;
-   double spacingFromString(const char* str) const;
-   
-   char theRecSen[FIELD1_SIZE+1];
-   char theField2[FIELD2_SIZE+1];
-   char theLonOrigin[FIELD3_SIZE+1];
-   char theLatOrigin[FIELD4_SIZE+1];
-   char theLonInterval[FIELD5_SIZE+1];
-   char theLatInterval[FIELD6_SIZE+1];
-   char theAbsoluteLE[FIELD7_SIZE+1];
-   char theSecurityCode[FIELD8_SIZE+1];
-   char theField9[FIELD9_SIZE+1];
-   char theNumLonLines[FIELD10_SIZE+1];
-   char theNumLatPoints[FIELD11_SIZE+1];
-   char theMultipleAccuracy[FIELD12_SIZE+1];
-   
-   ossim_int32 theStartOffset;
-   ossim_int32 theStopOffset;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimDtedVol.h b/ossim/include/ossim/support_data/ossimDtedVol.h
deleted file mode 100644
index 73eec89..0000000
--- a/ossim/include/ossim/support_data/ossimDtedVol.h
+++ /dev/null
@@ -1,110 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the Volume Header Label
-//               (VOL) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedVol.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimDtedVol_H
-#define ossimDtedVol_H
-
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimProperty;
-
-class OSSIM_DLL ossimDtedVol : public ossimErrorStatusInterface
-{
-public:
-   ossimDtedVol(const ossimFilename& dted_file="",
-                ossim_int32 offset=0);
-   ossimDtedVol(std::istream& in);
-
-   enum
-   {
-      VOL_LENGTH            = 80,
-      VOL_ONE_LABEL_1       =  4,
-      VOL_REEL_NUMBER       =  5,
-      VOL_REEL_ACCESS       = 11,
-      VOL_SPACE             = 12,
-      VOL_ACCOUNT_NUMBER    = 38,
-      VOL_BLANKS            = 52,
-      VOL_ONE_LABEL_2       = 80,
-      FIELD1_SIZE           = 3,
-      FIELD2_SIZE           = 1,
-      FIELD3_SIZE           = 6,
-      FIELD4_SIZE           = 1,
-      FIELD5_SIZE           = 26,
-      FIELD6_SIZE           = 14,
-      FIELD7_SIZE           = 28,
-      FIELD8_SIZE           = 1
-   };
-   
-   // The Recognition Sentinel signifies if the VOL record exists.
-   ossimString getRecognitionSentinel() const;
-   ossimString getReelNumber()           const;
-   ossimString getAccountNumber()        const;
-   ossim_int32 startOffset()             const;
-   ossim_int32 stopOffset()              const;
-   
-   friend OSSIM_DLL std::ostream& operator<<( std::ostream& os,
-                                              const ossimDtedVol& vol);
-   
-   void parse(std::istream& in);
-
-   /**
-    * @brief Gets a property for name.
-    * @param name Property name to get.
-    * @return ossimRefPtr<ossimProperty> Note that this can be empty if
-    * property for name was not found.
-    */
-   ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-
-   /**
-    * @brief Adds this class's properties to list.
-    * @param propertyNames list to append to.
-    */
-   void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix) const;
-private:
-   // Do not allow...
-   ossimDtedVol(const ossimDtedVol& source);
-   const ossimDtedVol& operator=(const ossimDtedVol& rhs);
-
-   char theRecSen[FIELD1_SIZE+1];
-   char theField2[FIELD2_SIZE+1];
-   char theReelNumber[FIELD3_SIZE+1];
-   char theField4[FIELD4_SIZE+1];
-   char theField5[FIELD5_SIZE+1];
-   char theAccountNumber[FIELD6_SIZE+1];
-   char theField7[FIELD7_SIZE+1];
-   char theField8[FIELD8_SIZE+1];
-  
-   ossim_int32 theStartOffset;
-   ossim_int32 theStopOffset;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimEnviHeader.h b/ossim/include/ossim/support_data/ossimEnviHeader.h
deleted file mode 100644
index 0b5876d..0000000
--- a/ossim/include/ossim/support_data/ossimEnviHeader.h
+++ /dev/null
@@ -1,415 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Class for reading and writing an ENVI (The Environment for Visualizing
-// Images) header file.  This parses envi header and places in a keyword
-// list.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimEnviHeader.h 22349 2013-08-01 21:38:29Z dburken $
-
-#ifndef ossimEnviHeader_HEADER
-#define ossimEnviHeader_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimReferenced.h>
-#include <iosfwd>
-
-/**
- * Class for reading and writing an ENVI (The Environment for Visualizing
- * Images) header file.
- */
-class OSSIM_DLL ossimEnviHeader : public ossimReferenced
-{
-public:
-   /** default construtor */
-   ossimEnviHeader();
-
-   /** virtual destructor */
-   virtual ~ossimEnviHeader();
-
-   virtual void reset();
-
-   /** @return Const reference to map. */
-   const ossimKeywordlist& getMap() const;
-   
-   /** @return Reference to map. */
-   ossimKeywordlist& getMap();
-
-   /**
-    * @brief Gets value for key.
-    * @param key To search for.
-    * @param value Initialized by this.
-    * @return true on success, false on error. This will return true if key is
-    * found, even if value is empty.
-    */
-   bool getValue( const ossimString& key, ossimString& value ) const;
-
-   /**
-    * @brief Gets value for key.
-    * @param key
-    * @param value
-    * @return true if key is in map even if value is empty; false, if not.
-    */
-   bool findCaseInsensitive( const ossimString& key,
-                             ossimString& value ) const;
-
-   /**
-    * @brief Gets value for key.
-    * @param key
-    * @param value
-    * @return true if key is in map even if value is empty; false, if not.
-    */
-   bool findSubStringCaseInsensitive( const ossimString& key,
-                                      ossimString& value) const;
-
-   /**
-    * Opens an envi header.
-    * 
-    * @return true on success, false on error.
-    */
-   bool open(const ossimFilename& file);
-
-   /**
-    * Writes header to file in a standard envi format.
-    *
-    * @param file File to write to.
-    *
-    * @return true on success, false on error.
-    */
-   bool writeFile(const ossimFilename& file);
-   
-   /**
-    * Prints header to out in a standard envi format.
-    *
-    * @param out Stream to write to.
-    *
-    * @return Reference to the stream passed.
-    */
-   std::ostream& print(std::ostream& out) const;
-
-   /** @brief friend operator<< */
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out,
-                                             const ossimEnviHeader& obj);
-
-   /**
-    * @return The description of the file.
-    */
-   ossimString getDescription() const;
-
-   /**
-    * @param description The description of the file.
-    */
-   void setDescription(const ossimString& description);
-
-   /**
-    * @return The number of samples.
-    */
-   ossim_uint32 getSamples() const;
-
-   /**
-    * Sets the number of samples.
-    * 
-    * @param samples The number of samples.
-    */
-   void setSamples(ossim_uint32 samples);
-
-   /**
-    * @return The number of lines.
-    */
-   ossim_uint32 getLines() const;
-
-   /**
-    * Sets the number of lines.
-    * 
-    * @param lines The number of lines.
-    */
-   void setLines(ossim_uint32 lines);
-
-   /**
-    * @return The number of bands.
-    */
-   ossim_uint32 getBands() const;
-
-   /**
-    * Sets the number of bands.
-    * 
-    * @param bands The number of bands.
-    */
-   void setBands(ossim_uint32 bands);
-
-   /**
-    * @brief Gets default bands if "default bands" keyword is present.
-    * @param bands Initialized by this.
-    * @return true on success, false if keyword not found. "bands" will be
-    * zeroed out on failure. 
-    */
-   bool getDefaultBands( std::vector<ossim_uint32>& bands ) const;
-
-   /**
-    * @brief Gets rgb bands if "wavelength" keyword is present.
-    * @param bands Initialized by this.
-    * @return true on success, false if keyword not found.  "bands" will be
-    * zeroed out on failure.
-    */   
-   bool getRgbBandsFromWaveLength( std::vector<ossim_uint32>& bands ) const;
-
-   /**
-    * @return The number of header offset in bytes.
-    */
-   ossim_uint32 getHeaderOffset() const;
-
-   /**
-    * Sets the header offset in bytes.
-    * 
-    * @param headerOffset The number of header offset in bytes.
-    */
-   void setHeaderOffset(ossim_uint32 headerOffset);
-
-   /**
-    * @return The file type
-    */
-   ossimString getFileType() const;
-
-   /**
-    * Sets the file type.
-    * 
-    * @param fileType The sensor type as a string.
-    */
-   void setFileType(const ossimString& fileType);
-
-   /**
-    * @return The envi data type..
-    */
-   ossim_uint32 getDataType() const;
-
-   /**
-    * @return The ossimScalarType from the envi data type..
-    */
-   ossimScalarType getOssimScalarType() const;
-
-   /**
-    * Sets the envi data type based on the ossimScalarType.
-    * 
-    * @param scalar The ossimScalarType of the image.
-    */
-   void setDataType(ossimScalarType scalar);
-
-   /**
-    * @return The envi interleave type.
-    */
-   ossimString getInterleaveType() const;
-
-   /**
-    * @return The ossimInterleaveType from the envi interleave..
-    */
-   ossimInterleaveType getOssimInterleaveType() const;
-
-   /**
-    * Sets the envi interleave type string based on the ossimInterleaveType.
-    * 
-    * @param interleave The ossimInterleaveType of the image.
-    */
-   void setInterleaveType(ossimInterleaveType interleave);
-
-   /**
-    * @return The sensor type..
-    */
-   ossimString getSensorType() const;
-
-   /**
-    * Sets the envi sensor type string.
-    * 
-    * @param sensorType The sensor type as a string.
-    */
-   void setSensorType(const ossimString& sensorType);
-
-   /**
-    * @return If key "byte order" found returns the envi byte order; else,
-    * system byte order.  
-    *
-    * @note (Same as the ossimByteOrder enumeration):
-    * 0 = LITTLE_ENDIAN,
-    * 1 = BIG_ENDIAN
-    */
-   ossimByteOrder getByteOrder() const;
-   
-   /**
-    * Sets the envi byte order from the ossimByteOrder.
-    * 
-    * @param byteorder The ossimByteOrder of the image.
-    */
-   void setByteorder(ossimByteOrder byteOrder);
-   
-   /**
-    * @return The x start.
-    */
-   ossim_int32 getXStart() const;
-   
-   /**
-    * Sets the x start.
-    * 
-    * @param xStart
-    */
-   void setXStart(ossim_int32 xstart);
-   
-   /**
-    * @return The x start.
-    */
-   ossim_int32 getYStart() const;
-   
-   /**
-    * Sets the y start.
-    * 
-    * @param ystart
-    */
-   void setYStart(ossim_int32 ystart);
-
-   /**
-    * @return The envi map info string.
-    */
-   ossimString getMapInfo() const;
-
-   /**
-    * Sets the envi map info string.
-    * 
-    * @param mapInfo envi map info string.
-    */
-   void setMapInfo(const ossimString& mapInfo);
-
-   /**
-    * Sets the envi map info string from a keyword list containing geometry
-    * information.
-    * 
-    * @param kwl Keyword list containing geometry information.
-    */
-   void setMapInfo(const ossimKeywordlist& kwl,  const char* prefix=0);
-
-   /**
-    * @return The env wavelength units..
-    */
-   ossimString getWavelengthUnits() const;
-
-   /**
-    * Sets the envi wavelength units string.
-    * 
-    * @param wavelengthUnits envi wavelength units string.
-    */
-   void setWavelengthUnits(const ossimString& wavelenghtUnits);
-
-   /**
-    * @param bandNames Vector of strings to initialize with band names.
-    */
-   void getBandNames(std::vector<ossimString>& bandNames) const;
-
-   /**
-    * Sets the band name string vector.
-    * 
-    * @param bandNames Vector of band name strings.
-    */
-   void setBandNames(const std::vector<ossimString>& bandNames);
-
-   /**
-    * @param wavelengths Vector of strings to initialize with wave lengths.
-    */
-   void getWavelengths(std::vector<ossimString>& wavelengths) const;
-
-   /**
-    * Sets the envi band name string.
-    * 
-    * @param wavelengths Vector of band name strings.
-    */
-   void setWavelengths(const std::vector<ossimString>& wavelengths);
-
-   /**
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.
-    *
-    * @param kwl Keyword list to initialize from.
-    *
-    * @param prefix Usually something like: "object1."
-    *
-    * @return This method will alway return true as it is intended to be
-    * used in conjuction with the set methods.
-    *
-    * Keywords picked up by loadState:
-    * 
-    * description: My_file
-    *
-    * number_samples: 1024
-    *
-    * number_lines: 512
-    *
-    * number_bands: 3
-    *
-    * header_offset: 0
-    *
-    * file_type: ENVI Standard
-    *
-    * data_type: 1
-    *
-    * interleave_type: bil
-    *
-    * sensor_type:  Unknown
-    *
-    * (little_endian or big_endian)
-    * byte_order: little_endian
-    * 
-    * map_info: Unkown
-    *
-    * wavelength_units: 
-    *
-    * band_name0: Red band
-    * band_name1: Green band
-    * band_name2: Blue band
-    *
-    * wavelength0:  620.25
-    * wavelength1:  514.5
-    * wavelength2:  470.0
-    */
-   bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /**
-    * @brief Global method to test first line of file for "ENVI".
-    * @return true on success, false on error.
-    */
-   static bool isEnviHeader( const ossimFilename& file );
-
-   /**
-    * @brief Global method to test first line of stream for "ENVI".
-    * @return true on success, false on error.
-    */
-   static bool isEnviHeader( std::istream& in );
-
-   /** @return Path to envi header file. */
-   const ossimFilename& getFile() const;
-   
-private:
-
-   /**
-    * @brief Check band list to see if any are outside of range of bands.
-    * Bands should be zero base.
-    * @return true if all bands are less than number of bands; false, if
-    * outside range or if "bands" key is not found.
-    */
-   bool rangeCheckBands( const std::vector<ossim_uint32>& bands ) const;
-
-   /**
-    * @brief Parses stream.
-    * @return true on success, false on error.
-    */
-   bool readStream(std::istream& in);
-   
-   ossimFilename       m_file; // Name of header file.
-   ossimKeywordlist    m_keywords;
-};
-#endif /* #ifndef ossimEnviHeader_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimEnviInfo.h b/ossim/include/ossim/support_data/ossimEnviInfo.h
deleted file mode 100644
index 912fa3b..0000000
--- a/ossim/include/ossim/support_data/ossimEnviInfo.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ENVI Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimEnviInfo_HEADER
-#define ossimEnviInfo_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimFilename.h>
-
-/** @brief ENVI info class. */
-class OSSIM_DLL ossimEnviInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimEnviInfo();
-
-   /** virtual destructor */
-   virtual ~ossimEnviInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-private:
-
-   ossimFilename m_file;
-};
-
-#endif /* End of "#ifndef ossimEnviInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimFfL5.h b/ossim/include/ossim/support_data/ossimFfL5.h
deleted file mode 100644
index 5638930..0000000
--- a/ossim/include/ossim/support_data/ossimFfL5.h
+++ /dev/null
@@ -1,47 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Ken Melero (kmelero at imagelinks.com)
-//         Orginally written by Oscar Kramer (SoBe Software)
-// Description: Container class for LandSat5 Fast Format header files (RevB & C)
-//
-// ********************************************************************
-// $Id: ossimFfL5.h 15766 2009-10-20 12:37:09Z gpotts $
-
-#ifndef ossimFfL5_HEADER
-#define ossimFfL5_HEADER
-
-
-#include <ossim/support_data/ossimFfL7.h>
-#include <ossim/support_data/ossimFfRevb.h>
-
-using namespace std;
-
-// Forward class declarations.
-
-// ***************************************************************************
-// CLASS: ossimFfL5
-// ***************************************************************************
-
-class OSSIM_DLL ossimFfL5 : public ossimFfL7
-{
-   friend ostream& operator<<(ostream& os, const ossimFfL5& head);
-
-public:
-   ossimFfL5();
-   ossimFfL5(const char* headerFile);
-   ossimRefPtr<ossimFfRevb> revb();
-   const ossimRefPtr<ossimFfRevb> revb()const;
- 
-protected:
-   virtual ~ossimFfL5();
-
-private:
-   void    readHeaderRevB(const ossimString& header_name);
-   int     convertGeoPoint(const char* sptr, ossimGpt& geo_point);
-
-   ossimRefPtr<ossimFfRevb> theRevb;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimFfRevb.h b/ossim/include/ossim/support_data/ossimFfRevb.h
deleted file mode 100644
index ffb470f..0000000
--- a/ossim/include/ossim/support_data/ossimFfRevb.h
+++ /dev/null
@@ -1,291 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Ken Melero (kmelero at imagelinks.com)
-//         Orginally written by Dave Burken (dburken at imagelinks.com)
-// Description: This class parses an EOSAT Fast Format rev b header.
-//
-//********************************************************************
-// $Id: ossimFfRevb.h 10384 2007-01-26 20:32:12Z gpotts $
-
-#ifndef ossimFfRevb_HEADER
-#define ossimFfRevb_HEADER
-#include <ossim/base/ossimReferenced.h>
-
-#include <iostream>
-using namespace std;
-
-//***************************************************************************
-// CLASS: ossimFfRevb.h
-//***************************************************************************
-class ossimFfRevb : public ossimReferenced
-{
-public:
-   ossimFfRevb  ();
-   ossimFfRevb  (const char* headerFile);
-   ~ossimFfRevb (){};
-
-   enum ErrorStatus
-   {
-      OSSIM_OK    = 0,
-      OSSIM_ERROR = 1
-   };
-
-   //***
-   // Enumerations for parsing header.  Contains size in bytes
-   // for all fields.
-   // 
-   // NOTE:  Sizes are the actual number of bytes for that field so add
-   //        one for trailing '\0' to get the string length for the
-   //        data member that are character arrays.
-   //***
-   enum
-   {
-      NUMBER_OF_PROJECTION_PARAMETERS = 15,
-      NUMBER_OF_BANDS                 = 7
-   };
-   
-   enum
-   {
-      PRODUCT_ORDER_NUMBER_DESC_SIZE      = 9,
-      PRODUCT_ORDER_NUMBER_SIZE           = 11,
-      WRS_DESC_SIZE                       = 6,
-      PATH_ROW_NUMBER_SIZE                = 9,
-      DATE_DESC_SIZE                      = 19,
-      DATE_SIZE                           = 8,
-      SAT_NUMBER_DESC_SIZE                = 12,
-      SAT_NUMBER_SIZE                     = 2,
-      INSTRUMENT_TYPE_DESC_SIZE           = 13,
-      INSTRUMENT_TYPE_SIZE                = 4,
-      PRODUCT_TYPE_DESC_SIZE              = 15,
-      PRODUCT_TYPE_SIZE                   = 14,
-      PRODUCT_SIZE_DESC_SIZE              = 15,
-      PRODUCT_SIZE_SIZE                   = 10,
-      MAP_SHEET_SIZE                      = 78,
-      PROCESSING_TYPE_DESC_SIZE           = 30,
-      PROCESSING_TYPE_SIZE                = 10,
-      RESAMPLING_ALGO_DESC_SIZE           = 13,
-      RESAMPLING_ALGO_SIZE                = 2,
-      RADIANCE_DESC_SIZE                  = 20,
-      RADIANCE_SIZE                       = 16,
-      VOLUME_NUMBER_DESC_SIZE             = 20,
-      VOLUME_NUMBER_SIZE                  = 3,
-      FIRST_LINE_DESC_SIZE                = 14,
-      FIRST_LINE_IN_VOLUME_SIZE           = 5,
-      LINES_PER_VOLUME_DESC_SIZE          = 15,
-      LINES_PER_VOLUME_SIZE               = 5,
-      ORIENTATION_ANGLE_DESC_SIZE         = 14,
-      ORIENTATION_ANGLE_SIZE              = 6,
-      MAP_PROJ_NAME_DESC_SIZE             = 13,
-      MAP_PROJ_NAME_SIZE                  = 4,
-      USGS_PROJ_NUMBER_DESC_SIZE          = 20,
-      USGS_PROJ_NUMBER_SIZE               = 6,
-      USGS_MAP_ZONE_DESC_SIZE             = 16,
-      USGS_MAP_ZONE_SIZE                  = 6,
-      USGS_PROJ_PARAMS_DESC_SIZE          = 29,
-      USGS_PROJ_PARAMS_SIZE               = 24,
-      ELLIPSOID_DESC_SIZE                 = 18,
-      ELLIPSOID_SIZE                      = 20,
-      MAJOR_AXIS_DESC_SIZE                = 18,
-      MAJOR_AXIS_SIZE                     = 11,
-      MINOR_AXIS_DESC_SIZE                = 18,
-      MINOR_AXIS_SIZE                     = 11,
-      PIXEL_GSD_DESC_SIZE                 = 13,
-      PIXEL_GSD_SIZE                      = 5,
-      PIXELS_PER_LINE_DESC_SIZE           = 17,
-      PIXELS_PER_LINE_SIZE                = 5,
-      LINES_PER_IMAGE_DESC_SIZE           = 17,
-      LINES_PER_IMAGE_SIZE                = 5,
-      CORNER_DESC_SIZE                    = 4,
-      LON_SIZE                            = 13,
-      LAT_SIZE                            = 12,
-      EASTING_SIZE                        = 13,
-      NORTHING_SIZE                       = 13,
-      BANDS_PRESENT_DESC_SIZE             = 16,
-      BANDS_PRESENT_SIZE                  = 7,
-      BLOCKING_FACTOR_DESC_SIZE           = 18,
-      BLOCKING_FACTOR_SIZE                = 4,
-      RECORD_LENGTH_DESC_SIZE             = 16,
-      RECORD_LENGTH_SIZE                  = 5,
-      SUN_ELEVATION_DESC_SIZE             = 16,
-      SUN_ELEVATION_SIZE                  = 2,
-      SUN_AZIMUTH_DESC_SIZE               = 14,
-      SUN_AZIMUTH_SIZE                    = 3,
-      CENTER_DESC_SIZE                    = 8,
-      CENTER_SAMPLE_SIZE                  = 6,
-      CENTER_LINE_SIZE                    = 6,
-      OFFSET_DESC_SIZE                    = 8,
-      OFFSET_SIZE                         = 4,
-      REV_DESC_SIZE                       = 4,
-      FORMAT_VERSION_SIZE                 = 1
-   };
-      
-   //***
-   // Enumerations for byte offsets in header.  All offsets are relative to
-   // the first byte of the first record which is byte 0.
-   //***
-   enum
-   {
-      // One record:  bytes 0 - 1535
-      PRODUCT_ORDER_NUMBER_OFFSET           = 9,
-      PATH_ROW_NUMBER_OFFSET                = 26,
-      DATE_OFFSET                           = 54,
-      SAT_NUMBER_OFFSET                     = 74,
-      INSTRUMENT_TYPE_OFFSET                 = 89,
-      PRODUCT_TYPE_OFFSET                   = 108,
-      PRODUCT_SIZE_OFFSET                   = 137,
-      MAP_SHEET_NAME_OFFSET                 = 147,
-      PROCESSING_TYPE_OFFSET                = 255,
-      RESAMPLING_ALGO_OFFSET                = 278,
-      VOLUME_NUMBER_OFFSET                  = 438,
-      FIRST_LINE_IN_VOLUME_OFFSET           = 455,
-      LINES_PER_VOLUME_OFFSET               = 475,
-      ORIENTATION_ANGLE_OFFSET              = 494,
-      MAP_PROJ_NAME_OFFSET                  = 513,
-      USGS_PROJ_NUMBER_OFFSET               = 537,
-      USGS_MAP_ZONE_OFFSET                  = 559,
-      ELLIPSOID_OFFSET                      = 972,
-      MAJOR_AXIS_OFFSET                     = 1010,
-      MINOR_AXIS_OFFSET                     = 1039,
-      PIXEL_GSD_OFFSET                      = 1063,
-      PIXELS_PER_LINE_OFFSET                = 1085,
-      LINES_PER_IMAGE_OFFSET                = 1107, 
-      UL_LON_OFFSET                         = 1116,
-      UL_LAT_OFFSET                         = 1130,
-      UL_EASTING_OFFSET                     = 1143,
-      UL_NORTHING_OFFSET                    = 1157,
-      UR_LON_OFFSET                         = 1174,
-      UR_LAT_OFFSET                         = 1188,
-      UR_EASTING_OFFSET                     = 1201,
-      UR_NORTHING_OFFSET                    = 1215,
-      LR_LON_OFFSET                         = 1232,
-      LR_LAT_OFFSET                         = 1246,
-      LR_EASTING_OFFSET                     = 1259,
-      LR_NORTHING_OFFSET                    = 1273,
-      LL_LON_OFFSET                         = 1290,
-      LL_LAT_OFFSET                         = 1304,
-      LL_EASTING_OFFSET                     = 1317,
-      LL_NORTHING_OFFSET                    = 1331,
-      BANDS_PRESENT_OFFSET                  = 1360,
-      BLOCKING_FACTOR_OFFSET                = 1385,
-      RECORD_LENGTH_OFFSET                  = 1405,
-      SUN_ELEVATION_OFFSET                  = 1426, 
-      SUN_AZIMUTH_OFFSET                    = 1442,
-      CENTER_LON_OFFSET                     = 1453,
-      CENTER_LAT_OFFSET                     = 1467,
-      CENTER_EASTING_OFFSET                 = 1480,
-      CENTER_NORTHING_OFFSET                = 1494,
-      CENTER_SAMPLE_OFFSET                  = 1507,
-      CENTER_LINE_OFFSET                    = 1513,
-      OFFSET_OFFSET                         = 1527,
-      FORMAT_VERSION_OFFSET                 = 1535 };
-
-   int errorStatus() const { return theErrorStatus; }
-
-   void print(ostream& os) const;
-
-   void write(ostream& os) const;
-
-   int    path() const;
-      //> Returns the path as an int.
-      //<
-   int    row() const;
-      //> Returns the row as an int from the pathRowString.
-      //<
-   int    fraction() const;
-      //> Returns the fraction as an int from the pathRowString.
-      //<
-   double projParam(int paramNumber) const;
-      //>  Converts the USGS Projection Parameter string, which has a
-      //   "D" to denote the exponent, to a double.
-      //<
-
-   friend ostream& operator<<(ostream& os, const ossimFfRevb& head);
-     
-   char   theProductOrderNumber[PRODUCT_ORDER_NUMBER_SIZE + 1];
-   char   thePathRowNumber[PATH_ROW_NUMBER_SIZE + 1];   
-   char   theAcquisitionDate[DATE_SIZE + 1];
-      //> yyyyddmm
-      //<
-   char   theSatNumber[SAT_NUMBER_SIZE + 1];
-      //> L4, L5, 1B, 1C
-      //<
-   char   theInstrumentType[INSTRUMENT_TYPE_SIZE + 1];
-      //> TM, LISS1 LISS2, LISS3, PAN, WIFS
-      //<
-   char   theProductType[PRODUCT_TYPE_SIZE + 1]; // MAP or ORBIT oriented
-   char   theProductSize[PRODUCT_SIZE_SIZE + 1]; // FULL, SUB, MAP
-      //> SYSTEMATIC, PRECISION, TERRAIN RADIOMETRIC
-      //<
-   char   theMapSheetName[MAP_SHEET_SIZE + 1];
-   char   theProcessingType[PROCESSING_TYPE_SIZE + 1];
-      //> SYSTEMATIC, PRECISION, TERRAIN RADIOMETRIC
-      //<
-   char   theResampAlgorithm[RESAMPLING_ALGO_SIZE + 1]; // CC, NN or BL
-   char   theBandRadiance[NUMBER_OF_BANDS][RADIANCE_SIZE + 1];
-   char   theVolumeNumber[VOLUME_NUMBER_SIZE + 1];
-   int    the1stLineInVolume;
-   int    theLinesPerVolume;
-   double theOrientationAngle;   // degrees
-   char   theMapProjName[MAP_PROJ_NAME_SIZE + 1];
-   int    theUsgsProjNumber;
-   int    theUsgsMapZone;
-   char   theUsgsProjParam[NUMBER_OF_PROJECTION_PARAMETERS]
-                          [USGS_PROJ_PARAMS_SIZE + 1];
-      //>  USGS Projection Parameters.  These are actually a string
-      //   representing doubles; however, EOSAT uses a "D" for the
-      //   exponent notation, so they are read in as a char*.
-      //   To convert to double use the method "projParam".
-      //<
-   char   theEllipsoid[ELLIPSOID_SIZE + 1];
-   double theSemiMajorAxis;
-   double theSemiMinorAxis;
-   double theGsd;             // pixel size in meters
-   int    thePixelsPerLine;   // samples
-   int    theLinesPerImage;   // lines
-
-   char    theUlLon[LON_SIZE + 1]; // deg, min, sec
-   char    theUlLat[LAT_SIZE + 1]; // deg, min, sec
-   double  theUlEasting;           // meters
-   double  theUlNorthing;          // meters
-   
-   char    theUrLon[LON_SIZE + 1]; // deg, min, sec
-   char    theUrLat[LAT_SIZE + 1]; // deg, min, sec
-   double  theUrEasting;           // meters
-   double  theUrNorthing;          // meters
-   
-   char    theLrLon[LON_SIZE + 1]; // deg, min, sec
-   char    theLrLat[LAT_SIZE + 1]; // deg, min, sec
-   double  theLrEasting;           // meters
-   double  theLrNorthing;          // meters
-   
-   char    theLlLon[LON_SIZE + 1]; // deg, min, sec
-   char    theLlLat[LAT_SIZE + 1]; // deg, min, sec
-   double  theLlEasting;           // meters
-   double  theLlNorthing;          // meters
-
-   char    theBandsPresentString[BANDS_PRESENT_SIZE + 1];
-   int     theBlockingFactor;
-   int     theRecordSize;
-   int     theSunElevation;        // degrees
-   int     theSunAzimuth;          // degrees
-
-   char    theCenterLon[LON_SIZE + 1]; // deg, min, sec
-   char    theCenterLat[LAT_SIZE + 1]; // deg, min, sec
-   double  theCenterEasting;           // meters
-   double  theCenterNorthing;          // meters
-   int     theCenterSample;       // Nearest whole pixel.
-   int     theCenterLine;         // Nearest whole pixel.
-   int     theOffset;   // pixels
-   char    theFormatVersion[FORMAT_VERSION_SIZE + 1];
-
-private:
-   void loadFromStream(istream& is);
-
-   int checkStream(istream& is);
-
-   ErrorStatus theErrorStatus;
-};
-   
-#endif
diff --git a/ossim/include/ossim/support_data/ossimFfRevc.h b/ossim/include/ossim/support_data/ossimFfRevc.h
deleted file mode 100644
index e660a49..0000000
--- a/ossim/include/ossim/support_data/ossimFfRevc.h
+++ /dev/null
@@ -1,347 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Ken Melero (kmelero at imagelinks.com)
-//         Orginally written by Dave Burken (dburken at imagelinks.com)
-// Description: This class parses an EOSAT Fast Format rev c header.
-//
-//********************************************************************
-// $Id: ossimFfRevc.h 9967 2006-11-29 02:01:23Z gpotts $
-
-#ifndef ossimFfRevc_HEADER
-#define ossimFfRevc_HEADER
-#include <iostream>
-using namespace std;
-
-// Forward class declarations.
-class ossimString;
-      
-//***************************************************************************
-// CLASS: ossimFfRevc.h
-//***************************************************************************
-
-class ossimFfRevc
-{
-public:
-   ossimFfRevc  ();
-   ossimFfRevc  (const char* headerFile);
-   ~ossimFfRevc (){};
-
-   enum ErrorStatus
-   {
-      OSSIM_OK    = 0,
-      OSSIM_ERROR = 1
-   };
-
-   //>
-   // Enumerations for parsing header.  Contains size in bytes
-   // for all fields.
-   // 
-   // NOTE:  Sizes are the actual number of bytes for that field so add
-   //        one for trailing '\0' to get the string length for the
-   //        data member that are character arrays.
-   //<
-
-   enum
-   {
-      NUMBER_OF_BANDS                 = 8,
-      NUMBER_OF_SCENES                = 4,
-      NUMBER_OF_PROJECTION_PARAMETERS = 15
-   };
-   
-   enum
-   {
-      // Adminstrative record:
-      PRODUCT_ORDER_NUMBER_DESC_SIZE      = 12,
-      PRODUCT_ORDER_NUMBER_SIZE           = 11,
-      LOCATION_DESC_SIZE                  = 11,
-      PATH_ROW_NUMBER_SIZE                = 17,
-      DATE_DESC_SIZE                      = 19,
-      DATE_SIZE                           = 8,
-      SAT_NAME_DESC_SIZE                  = 11,
-      SAT_NAME_SIZE                       = 10,
-      SENSOR_NAME_DESC_SIZE               = 9,
-      SENSOR_NAME_SIZE                    = 10,
-      SENSOR_MODE_DESC_SIZE               = 14,
-      SENSOR_MODE_SIZE                    = 6,
-      LOOK_ANGLE_DESC_SIZE                = 13,
-      OFF_NADIR_ANGLE_SIZE                = 6,
-      PRODUCT_TYPE_DESC_SIZE              = 14,
-      PRODUCT_TYPE_SIZE                   = 18,
-      PRODUCT_SIZE_DESC_SIZE              = 15,
-      PRODUCT_SIZE_SIZE                   = 10,
-      PROCESSING_TYPE_DESC_SIZE           = 20,
-      PROCESSING_TYPE_SIZE                = 11,
-      RESAMPLING_ALGO_DESC_SIZE           = 13,
-      RESAMPLING_ALGO_SIZE                = 2,
-      TAPE_VOLUME_NUMBER_DESC_SIZE        = 19,
-      TAPE_VOLUME_NUMBER_SIZE             = 2,
-      VOLUMES_PER_TAPE_SIZE               = 2,
-      PIXELS_PER_LINE_DESC_SIZE           = 18,
-      PIXELS_PER_LINE_SIZE                = 5,
-      LINES_PER_IMAGE_DESC_SIZE           = 17,
-      LINES_PER_IMAGE_SIZE                = 5,
-      FIRST_LINE_DESC_SIZE                = 14,
-      FIRST_LINE_IN_VOLUME_SIZE           = 5,
-      BLOCKING_FACTOR_DESC_SIZE           = 18,
-      BLOCKING_FACTOR_SIZE                = 2,
-      RECORD_LENGTH_DESC_SIZE             = 16,
-      RECORD_LENGTH_SIZE                  = 5,
-      PIXEL_GSD_DESC_SIZE                 = 13,
-      PIXEL_GSD_SIZE                      = 6,
-      BITS_PER_PIXEL_DESC_SIZE            = 23,
-      BITS_PER_PIXEL_SIZE                 = 2,  // Output and Acquired
-      AQUIRED_BITS_PER_PIXEL_DESC_SIZE    = 26,
-      BANDS_PRESENT_DESC_SIZE             = 15,
-      BANDS_PRESENT_SIZE                  = 33,
-      REV_DESC_SIZE                       = 15,
-      FORMAT_VERSION_SIZE                 = 1,
-      // Radiometric record:
-      BIAS_GAIN_DESC_SIZE                 = 50, 
-      BIAS_SIZE                           = 24,
-      GAIN_SIZE                           = 24,
-      // Geometric record:
-      GEO_DESC_SIZE                       = 14,
-      MAP_PROJECTION_NAME_DESC_SIZE       = 17,
-      MAP_PROJECTION_NAME_SIZE            = 4,
-      ELLIPSOID_DESC_SIZE                 = 12,
-      ELLIPSOID_SIZE                      = 18,
-      DATUM_DESC_SIZE                     = 8,
-      DATUM_SIZE                          = 6,
-      PROJECTION_PARAMETER_DESC_SIZE      = 28,
-      PROJECTION_PARAMETER_SIZE           = 24,
-      CORNER_DESC_SIZE                    = 4,
-      CENTER_DESC_SIZE                    = 8,
-      LON_SIZE                            = 13,
-      LAT_SIZE                            = 12,
-      EASTING_SIZE                        = 13,
-      NORTHING_SIZE                       = 13,
-      CENTER_SAMPLE_SIZE                  = 5,
-      CENTER_LINE_SIZE                    = 5,
-      HORIZONTAL_OFFSET_DESC_SIZE         = 8,
-      HORIZONTAL_OFFSET_SIZE              = 6,
-      ORIENTATION_ANGLE_DESC_SIZE         = 20,
-      ORIENTATION_ANGLE_SIZE              = 6,
-      SUN_ELEVATION_DESC_SIZE             = 21,
-      SUN_ELEVATION_SIZE                  = 4,
-      SUN_AZIMUTH_DESC_SIZE               = 20,
-      SUN_AZIMUTH_SIZE                    = 5
-   };
-
-   //---
-   //>
-   // Enumerations for byte offsets in header.  All offsets are relative to
-   // the first byte of the first record which is byte 0.
-   //<
-   
-   enum
-   {
-      // Administrative record:  bytes 0 - 1535
-      PRODUCT_ORDER_NUMBER_OFFSET           = 12,
-      PRODUCT_TYPE_OFFSET                   = 654,
-      PRODUCT_SIZE_OFFSET                   = 687,
-      PROCESSING_TYPE_OFFSET                = 740,
-      RESAMPLING_ALGO_OFFSET                = 764,
-      TAPE_VOLUME_NUMBER_OFFSET             = 819,
-      VOLUMES_PER_TAPE_OFFSET               = 822,
-      PIXELS_PER_LINE_OFFSET                = 842,
-      LINES_PER_IMAGE_OFFSET                = 864,
-      FIRST_LINE_IN_VOLUME_OFFSET           = 894,
-      BLOCKING_FACTOR_OFFSET                = 917,
-      RECORD_LENGTH_OFFSET                  = 935,
-      PIXEL_GSD_OFFSET                      = 954,
-      BITS_PER_PIXEL_OFFSET                 = 983,
-      ACQUIRED_BITS_PER_PIXEL_OFFSET        = 1011,
-      BANDS_PRESENT_OFFSET                  = 1055,
-      FORMAT_VERSION_OFFSET                 = 1535,
-      // Radiometric record:  bytes 1536 - 3071
-      // See file scope constants for bias and gain OFFSET positions.
-      // Geometric record:  bytes 3072 - 4607
-      MAP_PROJECTION_NAME_OFFSET    = 3103,
-      ELLIPSOID_OFFSET              = 3119,  
-      DATUM_OFFSET                  = 3145,
-      UL_LON_OFFSET                 = 3637,
-      UL_LAT_OFFSET                 = 3651,
-      UL_EASTING_OFFSET             = 3664,
-      UL_NORTHING_OFFSET            = 3678,
-      UR_LON_OFFSET                 = 3717,
-      UR_LAT_OFFSET                 = 3731,
-      UR_EASTING_OFFSET             = 3744,
-      UR_NORTHING_OFFSET            = 3758,
-      LR_LON_OFFSET                 = 3797,
-      LR_LAT_OFFSET                 = 3811,
-      LR_EASTING_OFFSET             = 3824,
-      LR_NORTHING_OFFSET            = 3838,
-      LL_LON_OFFSET                 = 3877,
-      LL_LAT_OFFSET                 = 3891,
-      LL_EASTING_OFFSET             = 3904,
-      LL_NORTHING_OFFSET            = 3918,
-      CENTER_LON_OFFSET             = 3961,
-      CENTER_LAT_OFFSET             = 3975,
-      CENTER_EASTING_OFFSET         = 3988,
-      CENTER_NORTHING_OFFSET        = 4002,
-      CENTER_SAMPLE_OFFSET          = 4016,
-      CENTER_LINE_OFFSET            = 4022,
-      HORIZONTAL_OFFSET_OFFSET      = 4040,
-      ORIENTATION_ANGLE_OFFSET      = 4066, 
-      SUN_ELEVATION_OFFSET          = 4133, 
-      SUN_AZIMUTH_OFFSET            = 4157
-   };
-
-   //---
-   //>
-   // An EOSAT Fast Format Rev C header consists of three
-   // records:  administrative, radiometric and geometric
-   // each record has a class defined for it to hold the pertinent
-   // data.
-   //<
-   
-   class AdminRecord
-   {
-   public:
-      AdminRecord();
-      ~AdminRecord(){}
-
-      //  Data Members for record.
-      
-      char   theProductOrderNumber[PRODUCT_ORDER_NUMBER_SIZE + 1];
-
-      char   thePathRowNumber[NUMBER_OF_SCENES][PATH_ROW_NUMBER_SIZE + 1];   
-      char   theAcquisitionDate[NUMBER_OF_SCENES][DATE_SIZE + 1];
-         //> yyyyddmm
-         //<
-      char   theSatName[NUMBER_OF_SCENES][SAT_NAME_SIZE + 1];
-         //> L4, L5, 1B, 1C
-         //<
-      char   theSensorName[NUMBER_OF_SCENES][SENSOR_NAME_SIZE + 1];
-         //> TM, LISS1 LISS2, LISS3, PAN, WIFS
-         //<
-      char   theSensorMode[NUMBER_OF_SCENES][SENSOR_MODE_SIZE + 1];
-      double theOffNadirAngle[NUMBER_OF_SCENES];  // degrees
-
-      char   theProductType[PRODUCT_TYPE_SIZE + 1]; // MAP or ORBIT oriented
-      char   theProductSize[PRODUCT_SIZE_SIZE + 1]; // FULL, SUB, MAP
-         //> SYSTEMATIC, PRECISION, TERRAIN RADIOMETRIC
-         //<
-      char   theProcessingType[PROCESSING_TYPE_SIZE + 1];
-      char   theResampAlgorithm[RESAMPLING_ALGO_SIZE + 1]; // CC or NN
-      int    theTapeVolumeNumber;
-      int    theNumberVolumesPerTape;
-      int    thePixelsPerLine;
-      int    theLinesPerImage;
-      int    the1stLineInVolume;
-      int    theTapeBlockingFactor;
-      int    theRecordSize;
-      double theGsd; // pixel size in meters
-      int    theOutputBitsPerPixel;
-      int    theAcquiredBitsPerPixel;
-      char   theBandsPresentString[BANDS_PRESENT_SIZE + 1];
-      char   theFormatVersion[FORMAT_VERSION_SIZE + 1];
-   };
-
-   class RadiomRecord
-   {
-   public:
-      RadiomRecord();
-      ~RadiomRecord(){}
-      
-
-      double theBias[8];
-      double theGain[8];
-   };
-
-   class GeoRecord
-   {
-   public:
-      GeoRecord();
-      ~GeoRecord(){}
-      
-      char    theMapProjectionName[MAP_PROJECTION_NAME_SIZE + 1];
-      char    theEllipsoid[ELLIPSOID_SIZE + 1];
-      char    theDatum[DATUM_SIZE + 1];
-      double  theProjectionParams[15];
-   
-      char    theUlLon[LON_SIZE + 1]; // deg, min, sec
-      char    theUlLat[LAT_SIZE + 1]; // deg, min, sec
-      double  theUlEasting;
-      double  theUlNorthing;
-   
-      char    theUrLon[LON_SIZE + 1]; // deg, min, sec
-      char    theUrLat[LAT_SIZE + 1]; // deg, min, sec
-      double  theUrEasting;
-      double  theUrNorthing;
-   
-      char    theLrLon[LON_SIZE + 1]; // deg, min, sec
-      char    theLrLat[LAT_SIZE + 1]; // deg, min, sec
-      double  theLrEasting;
-      double  theLrNorthing;
-   
-      char    theLlLon[LON_SIZE + 1]; // deg, min, sec
-      char    theLlLat[LAT_SIZE + 1]; // deg, min, sec
-      double  theLlEasting;
-      double  theLlNorthing;
-
-      char    theCenterLon[LON_SIZE + 1]; // deg, min, sec
-      char    theCenterLat[LAT_SIZE + 1]; // deg, min, sec
-      double  theCenterEasting;
-      double  theCenterNorthing;
-      int     theCenterSample;       // Nearest whole pixel.
-      int     theCenterLine;         // Nearest whole pixel.
-
-      int     theHorizontalOffset;   // pixels
-      double  theOrientationAngle;   // degrees
-      double  theSunElevationAngle;  // degrees
-      double  theSunAzimuth;         // degrees
-   };
-
-   AdminRecord  theAdminRecord;
-   RadiomRecord theRadiomRecord;
-   GeoRecord    theGeoRecord;
-   
-   int errorStatus() const { return theErrorStatus; }
-
-   void print(ostream& os) const;
-
-   void write(ostream& os) const;
-
-   friend ostream& operator<<(ostream& os, const ossimFfRevc& head);
-
-
-   //>
-   // Convenience methods.
-   //<
-   
-   int    path(int sceneNbr=0) const;
-      //> Returns the path as an int.
-      //  Currently uses the1stPathRowNumber string.
-      //<
-   int    row(int sceneNbr=0) const;
-      //> Returns the row as an int from the pathRowString.
-      //  Currently uses the1stPathRowNumber string.
-      //<
-   int    fraction(int sceneNbr=0) const;
-      //> Returns the fraction as an int from the pathRowString.
-      //  Currently uses the1stPathRowNumber string.
-      //<
-   ossimString subScene(int sceneNbr=0) const;
-      //> Returns the sub scene as an string from the pathRowString.
-      //  Currently uses the1stPathRowNumber string.
-      //<
-
-   ossimString pathRow(int sceneNbr=0) const;
-      //> Returns a string represnting the path and row as a name.
-      //  i.e.: 287/05100D0 will be returned as p287r05100D0
-      //  This method will remove any spaces.
-      //<
-
-private:
-   void loadFromStream(istream& is);
-
-   int checkStream(istream& is);
-
-   ErrorStatus theErrorStatus;
-};
-
-   
-#endif
diff --git a/ossim/include/ossim/support_data/ossimFgdcTxtDoc.h b/ossim/include/ossim/support_data/ossimFgdcTxtDoc.h
deleted file mode 100644
index 81b6b4b..0000000
--- a/ossim/include/ossim/support_data/ossimFgdcTxtDoc.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File ossimFgdcTxtDoc.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ossimFgdcTxtDoc class declaration.
-//
-// FGDC = "Federal Geographic Data Committee"
-//
-// See: http://www.fgdc.gov/
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimFgdcTxtDoc.h 2673 2011-06-06 14:57:24Z david.burken $
-#ifndef ossimFgdcTxtDoc_HEADER
-#define ossimFgdcTxtDoc_HEADER 1
-
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/projection/ossimProjection.h>
-
-/**
- * @class ossimFgdcTxtDoc
- * @brief Support data container for FGDC in text format.
- *
- * Has minimum parse support to get Spatial_Reference_Information section to
- * extract projection information.
- *
- * TODO: Make an ossimFgdcBase and consolidate code from
- * ossimFgdcXmlDoc and this class. (drb - 15 Aug. 2011)
- */
-class OSSIM_DLL ossimFgdcTxtDoc : public ossimReferenced
-{
-public:
-
-   /** default constructor */
-   ossimFgdcTxtDoc();
-
-   /** virtual destructor */
-   virtual ~ossimFgdcTxtDoc();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   bool open(const ossimFilename& file);
-
-   /**
-    * @brief Close method.
-    *
-    * This doesn't really do anything.  Here only because I think every open()
-    * should have a matching close().
-    */
-   void close();
-
-   /**
-    * @brief Gets projection from Spatial_Reference_Information block.
-    * @param proj Intialized by this method.  Set to null on projection cannot
-    * be created.
-    */   
-   void getProjection(ossimRefPtr<ossimProjection>& proj);
-
-   /**
-    * @brief Gets units from Altitude_Distance_Units.
-    * @return Units if found, OSSIM_UNIT_UNKNOWN if not.
-    */
-   void getAltitudeDistanceUnits(std::string& units) const;
-
-private:
-
-   /**
-    * @brief Gets projection from Spatial_Reference_Information block for
-    * version FGDC-STD-001-1998.
-    * @param str Stream to read from.
-    * @param proj Intialized by this method.  Set to null on projection cannot
-    * be created.
-    */ 
-   void getProjectionV1(std::ifstream& str,
-                        ossimRefPtr<ossimProjection>& proj);
-
-   /**
-    * @brief Finds key and returns true if present.
-    *
-    * Leaves stream at position of last getline.
-    * 
-    * @param str Stream to read from.
-    * @param key Key to find.
-    * @return true if present false if not.
-    */
-   bool findKey( std::ifstream& str, const std::string& key);
-
-   /**
-    * @brief Finds key and returns and intializes value if present.
-    *
-    * Stream position at end of call is dependent on seekBack flag.
-    * 
-    * @param str Stream to read from.
-    * @param seekBack If true the stream will be repositioned to original
-    * position at beginning of the call.
-    * @param key Key to find.
-    * @param value Intialized with value if key is found.
-    * @return true if present false if not.
-    */
-   bool findKey( std::ifstream& str,
-                 bool seekBack,
-                 const std::string& key,
-                 std::string& value);
-
-   /**
-    * Gets ossim datum string from fgdc datum string.
-    */
-   void getOssimDatum( const std::string& fgdcDatumString,
-                       std::string& ossimDatumCode ) const;
-
-   // Container for relevant data from FGDC file.
-   ossimRefPtr<ossimKeywordlist> m_kwl;
-   
-}; // End: class ossimFgdcTxtDoc
-
-#endif /* #ifndef ossimFgdcTxtDoc_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimFgdcXmlDoc.h b/ossim/include/ossim/support_data/ossimFgdcXmlDoc.h
deleted file mode 100644
index 268dabb..0000000
--- a/ossim/include/ossim/support_data/ossimFgdcXmlDoc.h
+++ /dev/null
@@ -1,189 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description: Utility class to encapsulate parsing projection info in the xml file.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimFgdcXmlDoc.h 2063 2011-01-19 19:38:12Z ming.su $
-#ifndef ossimFgdcXmlDoc_HEADER
-#define ossimFgdcXmlDoc_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/projection/ossimProjection.h>
-
-class ossimDatum;
-class ossimDrect;
-
-/** @brief Class for FGDC XML doc parsing. */
-class OSSIMDLLEXPORT ossimFgdcXmlDoc
-{
-public:
-   /** @brief default constructor */
-   ossimFgdcXmlDoc();
-   
-   /** @brief destructor */
-   ~ossimFgdcXmlDoc();
-
-   /**
-    * @brief Open method.
-    * @return true on success, false on error.
-    */
-   bool open(const ossimFilename& xmlFileName);
-
-   /** @return true if m_xmlDocument is open; false if not. */
-   bool isOpen() const;
-
-   /** @brief close method. */
-   void close();
-
-   /** @brief Gets projection from document. */
-   ossimRefPtr<ossimProjection> getProjection();
-
-   /** @return Unit type. Note meters is the default if not found in doc. */
-   ossimUnitType getUnitType() const;
-
-   /**
-    * @return text for path "/metadata/spref/horizsys/cordsysn/geogcsn"
-    */
-   bool getGeoCsn(ossimString& s) const;
-
-   /**
-    * @return text for path "/metadata/spref/horizsys/cordsysn/projcsn"
-    */
-   bool getProjCsn(ossimString& s) const;
-
-   /**
-    * @brief Get the Altitude Distance Units
-    *
-    * Path: "/metadata/spref/vertdef/altsys/altunits"
-    *
-    * Domain: "meters" "feet"
-    * 
-    * @return Text for path.
-    */
-   bool getAltitudeDistantUnits(ossimString& s) const;
-
-   /**
-    * @brief Get the Grid Coordinate system
-    *
-    * Path: "/metadata/spref/horizsys/planar/gridsys/gridsysn"
-    *
-    * @return Text for path.
-    */
-   bool getGridCoordinateSystem(ossimString& s) const;
-
-   /**
-    * @brief Gets projection from Grid Coordinate system node.
-    *
-    * Throws ossimException on error.
-    *
-    * @return Refptr with projection pointer.  Underlying pointer may be null.
-    */
-   ossimRefPtr<ossimProjection> getGridCoordSysProjection();
-
-   /**
-    * @brief Get the Grid Coordinate system
-    *
-    * Path: "/metadata/spref/horizsys/planar/gridsys/gridsysn"
-    *
-    * @return Text for path.
-    */
-   bool getHorizontalDatum(ossimString& s) const;
-
-   /**
-    * @brief Get the Planar Distant Units
-    * 
-    * Path: "/metadata/spref/horizsys/planar/planci/plandu"
-    *
-    * Domain: "meters" "international feet" "survey feet"
-    *
-    * @return Text for path.
-    */
-   bool getPlanarDistantUnits(ossimString& s) const;
-
-   /**
-    * @brief Get UTM false Northing.
-    * 
-    * Path: "/metadata/spref/horizsys/planar/gridsys/utm/transmer/fnorth"
-    *
-    * @return Text for path.
-    */
-   bool getUtmFalseNorthing(ossimString& s) const;
-   
-   /**
-    * @brief Get UTM zone.
-    * 
-    * Path: "/metadata/spref/horizsys/planar/gridsys/utm/utmzone"
-    *
-    * Domain: 1 <= UTM Zone Number <= 60 for the northern hemisphere;
-    * -60 <= UTM Zone Number <= -1 for the southern hemisphere
-     *
-    * @return Text for path.
-    */
-   bool getUtmZone(ossimString& s) const;
-
-   /**
-    * @brief Get Bands.
-    * 
-    * Path: "/metadata/spdoinfo/rastinfo/vrtcount"
-    *
-    * the maximum number of raster objects along the vertical (z) axis. 
-    * For use with rectangular volumetric raster objects (voxels). 
-     *
-    * @return int for path.
-    */
-   ossim_uint32 getNumberOfBands();
-
-    /**
-    * @brief Gets path from doc and initializes string.
-    *
-    * This method errors if multiple nodes are found for path.
-    * 
-    * @param path Xml path to look for.
-    * @param s String to initialize.
-    * @return true on success and false if path is not found or if there
-    * are more than one of path.
-    */
-   bool getPath(const ossimString& path, ossimString& s) const;
-
-   bool getImageSize(ossimIpt& size) const;
-
-private:
-
-   bool getXRes(ossim_float64& v) const;
-   
-   bool getYRes(ossim_float64& v) const;
-
-   void getBoundingBox(ossimDrect& rect) const;
-
-   /**
-    * @brief Gets path from doc and initializes string.
-    * @param path Xml path to look for.
-    * @param v Value to initialize.
-    * @return true on success and false if path is not found or if there
-    * are more than one of path.
-    */
-   bool getPath(const ossimString& path, ossim_float64& v) const;
-
-   /**
-    * Gets the ossimDatum from string.
-    */
-   const ossimDatum* createOssimDatum(const ossimString& s) const;
-   
-   ossimFilename                 m_xmlFilename;
-   ossimRefPtr<ossimXmlDocument> m_xmlDocument;
-   ossimRefPtr<ossimProjection>  m_projection;
-   mutable bool                  m_boundInDegree;
-};
-
-#endif /* matches: #ifndef ossimFgdcXmlDoc */
-
diff --git a/ossim/include/ossim/support_data/ossimGeoTiff.h b/ossim/include/ossim/support_data/ossimGeoTiff.h
deleted file mode 100644
index 9022ed1..0000000
--- a/ossim/include/ossim/support_data/ossimGeoTiff.h
+++ /dev/null
@@ -1,290 +0,0 @@
-//***************************************************************************
-// FILE: ossimGeoTiff.h
-//
-// License:  See top level LICENSE.txt file.
-//
-// Description:
-// 
-// Class declaration for ossimGeoTiff which is designed to read and hold tag
-// information.
-//
-//***************************************************************************
-// $Id: ossimGeoTiff.h 21023 2012-05-29 20:32:22Z dburken $
-
-#ifndef ossimGeoTiff_HEADER
-#define ossimGeoTiff_HEADER 1
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorStatusInterface.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/base/ossimRefPtr.h>
-
-#include <vector>
-
-#include <tiffio.h>
-#include <OpenThreads/Mutex>
-#include <OpenThreads/ScopedLock>
-
-class ossimFilename;
-class ossimKeywordlist;
-class ossimPrivateGtifDef;
-class ossimProjection;
-class ossimTieGptSet;
-
-class OSSIM_DLL ossimGeoTiff : public ossimErrorStatusInterface
-{
-public:
-   /** default constructor */
-   ossimGeoTiff();
-
-   ossimGeoTiff(const ossimFilename& file, ossim_uint32 entryIdx=0);
-
-   ~ossimGeoTiff();
-  
-   enum
-   {
-      UNDEFINED                        = 0,
-      PIXEL_IS_AREA                    = 1,
-      PIXEL_IS_POINT                   = 2,
-      GT_MODEL_TYPE_GEO_KEY            = 1024,
-      GT_RASTER_TYPE_GEO_KEY           = 1025,
-      GEOGRAPHIC_TYPE_GEO_KEY          = 2048,
-      GEOG_GEODETIC_DATUM_GEO_KEY      = 2050,
-      GEOG_ANGULAR_UNITS_GEO_KEY       = 2054,
-      PROJECTED_CS_TYPE_GEO_KEY        = 3072,
-      PCS_CITATION_GEO_KEY             = 3073,
-      PROJECTION_GEO_KEY               = 3074,
-      PROJ_COORD_TRANS_GEO_KEY         = 3075,
-      LINEAR_UNITS_GEO_KEY             = 3076,
-      PROJ_STD_PARALLEL1_GEO_KEY       = 3078,
-      PROJ_STD_PARALLEL2_GEO_KEY       = 3079,
-      PROJ_NAT_ORIGIN_LONG_GEO_KEY     = 3080,
-      PROJ_NAT_ORIGIN_LAT_GEO_KEY      = 3081,
-      PROJ_FALSE_EASTING_GEO_KEY       = 3082,
-      PROJ_FALSE_NORTHING_GEO_KEY      = 3083,
-      PROJ_CENTER_LONG_GEO_KEY         = 3088,
-      PROJ_CENTER_LAT_GEO_KEY          = 3089,
-      PROJ_SCALE_AT_NAT_ORIGIN_GEO_KEY = 3092,
-      LINEAR_METER                     = 9001,
-      LINEAR_FOOT                      = 9002,
-      LINEAR_FOOT_US_SURVEY            = 9003,
-      ANGULAR_DEGREE                   = 9102,
-      ANGULAR_ARC_MINUTE               = 9103,
-      ANGULAR_ARC_SECOND               = 9104,
-      ANGULAR_GRAD                     = 9105,
-      ANGULAR_GON                      = 9106,
-      ANGULAR_DMS                      = 9107,
-      ANGULAR_DMS_HEMISPHERE           = 9108,
-      PCS_BRITISH_NATIONAL_GRID        = 27700,
-      USER_DEFINED                     = 32767
-   };
-
-/*    enum CompressType */
-/*    { */
-/*       NOT_COMPRESSED = 0, */
-/*       COMPRESSED     = 1 */
-/*    }; */
- 
-/*    enum PhotoInterpretation */
-/*    { */
-/*       PHOTO_MINISWHITE  = 0,   // min value is white  */
-/*       PHOTO_MINISBLACK  = 1,   // min value is black  */
-/*       PHOTO_RGB         = 2,   // RGB color model  */
-/*       PHOTO_PALETTE     = 3,   // color map indexed  */
-/*       PHOTO_MASK        = 4,   // $holdout mask  */
-/*       PHOTO_SEPARATED   = 5,   // !color separations  */
-/*       PHOTO_YCBCR       = 6,   // !CCIR 601  */
-/*       PHOTO_CIELAB      = 8    // !1976 CIE L*a*b* */
-/*    }; */
-   enum ModelType
-   {
-      UNKNOWN               = 0,
-      MODEL_TYPE_PROJECTED  = 1,  // Projection Coordinate System
-      MODEL_TYPE_GEOGRAPHIC = 2,  // Geographic latitude-longitude System 
-      MODEL_TYPE_GEOCENTRIC = 3
-   };
-
-   static int getPcsUnitType(ossim_int32 pcsCode);
-
-   static bool writeTags(TIFF* tiffOut,
-                         const ossimRefPtr<ossimMapProjectionInfo> projectionInfo,
-                         bool imagineNad27Flag=false);
-
-   /**
-    * @brief Writes a geotiff box to a buffer.
-    *
-    * This will write a degenerate GeoTIFF file to a temp file, copy file to
-    * the buffer and then delete the temp file.
-    *
-    * @param tmpFile The temporary filename.
-    * @param rect The output image rect.
-    * @param proj Pointer to output projection.
-    * @param buf The buffer to stuff with data.
-    * @param pixelType OSSIM_PIXEL_IS_POINT(0) or OSSIM_PIXEL_IS_AREA(1)
-    * @return true on success, false on error.
-    */
-   static bool writeJp2GeotiffBox(const ossimFilename& tmpFile,
-                                  const ossimIrect& rect,
-                                  const ossimProjection* proj,
-                                  std::vector<ossim_uint8>& buf,
-                                  ossimPixelType pixelType);
-   
-   /**
-    *  Reads tags.
-    *  Returns true on success, false on error.
-    */
-   bool readTags(const ossimFilename& file, ossim_uint32 entryIdx=0);
-
-   /**
-    * @brief Method to parse the tiff file from an open tiff pointer for a
-    * given index.
-    *
-    * This will initialize this container for a subsequent call to
-    * addImageGeometry.
-    * 
-    * @param tiff The opened TIFF* to read from.
-    * 
-    * @param entryIdx Entry (tiff directory) to read.
-    *
-    * @param ownTiffPtrFlag If true the tiff pointer will be deleted by this
-    * object; else, it will simply zero out the pointer at the end of method.
-    * This allows for external code to pass in their open tiff pointer
-    * without this object closing it.
-    *
-    * @return true on success, false on error.
-    */
-   bool readTags(TIFF* tiff, ossim_uint32 entryIdx, bool ownTiffPtrFlag);
-
-   /**
-    *  Returns the map zone as an interger.
-    */
-   int mapZone() const;
-
-   /**
-    *  Add geometry info from tags to keword list.
-    *  Returns true on success, false on error.
-    */
-   bool addImageGeometry(ossimKeywordlist& kwl,
-                         const char* prefix=0) const;
-
-   /**
-    *  Returns an ossimString representing the ossim projection name.
-    *  Returns "unknown" if it can't find a match.
-    */
-   ossimString getOssimProjectionName() const;
-
-   /**
-    *  Attempts to set the ossim projection name from keys read.
-    */
-   void setOssimProjectionName();
-
-   /**
-    *  Returns an ossimString representing the ossim datum name code.
-    *  Returns "unknown" if it can't find a match.
-    */
-   ossimString getOssimDatumName() const;
-
-   /**
-    *  Attempts to set the ossim datum code.
-    */
-   void setOssimDatumName();
-
-   void getScale(std::vector<double>& scale) const;
-   void getTiePoint(std::vector<double>& tie_point) const;
-   void getModelTransformation(std::vector<double>& transform) const;
-
-   const std::vector<double>& getTiePoint() const;
-   const std::vector<double>& getModelTransformation() const;
-   const std::vector<double>& getScale() const;
-   ossimPixelType getRasterType() const;
-
-   int getWidth() const;
-   int getLength() const;
-/*    int getSamplesPerPixel() const; */
-
-   /** Prints data members. */
-   virtual std::ostream& print(std::ostream& out) const;
-   
-private:
-
-   // Disallow ...
-   ossimGeoTiff(const ossimGeoTiff* /* rhs */ ) {}
-   ossimGeoTiff& operator=(const ossimGeoTiff& /*rhs*/) { return *this; }
-
-   //! Initializes data members given a projection code. Returns TRUE if valid PCS code specified.
-   //! Resets the PCS code to 0 if invalid.
-   bool  parsePcsCode();
-
-   //! Initializes data members given a projection. Returns TRUE if successful.
-   bool parseProjection(ossimMapProjection* map_proj);
-
-   /**
-    *  Converts double passed in to meters if needed.  The conversion is
-    *  base on "theLiniarUnitsCode".
-    */
-   double convert2meters(double d) const;
-
-   /**
-    * @return true if conditions are present to use model transform; false
-    * if not.
-    */
-   bool usingModelTransform() const;
-
-   /**
-    * Initializes tieSet from theTiePoints.  Has logic to shift one based
-    * ties to be zero based like the rest of the code.
-    */
-   void getTieSet(ossimTieGptSet& tieSet) const;
-
-   /**
-    * Attempts to detect if tie points are one or zero based.
-    * @return true if one base, false if not.
-    */
-   bool hasOneBasedTiePoints() const;
-
-   TIFF*                 theTiffPtr;
-   ossim_uint32          theGeoKeyOffset;
-   int                   theGeoKeyLength;
-   bool                  theGeoKeysPresentFlag;
-   int                   theZone;
-   ossimString           theHemisphere;
-   int                   theDoubleParamLength;
-   int                   theAsciiParamLength;
-   ossimString           theProjectionName;
-   ossimString           theDatumName;
-   
-   std::vector<double>   theScale;                         // tag 33550
-   std::vector<double>   theTiePoint;                      // tag 33922
-   std::vector<double>   theModelTransformation;           // tag 34264
-   std::vector<double>   theDoubleParam;                   // tag 34736
-   ossimString           theAsciiParam;                    // tag 34737
-   
-   ossim_uint32          theWidth;                         // tag 256
-   ossim_uint32          theLength;                        // tag 257
-   ossim_uint16          theBitsPerSample;                 // tag 258
-
-   ossim_uint16          theModelType;                     // key 1024
-   ossim_uint16          theRasterType;                    // key 1025 undefined=0, area=1, point=2
-   ossim_uint16          theGcsCode;                       // key 2048
-   ossim_uint16          theDatumCode;                     // key 2050
-   ossim_uint16          theAngularUnits;                  // key 2054
-   ossim_uint32          thePcsCode;                       // key 3072
-   ossimString           thePcsCitation;                   // key 3073
-   ossim_uint16          theCoorTransGeoCode;              // key 3075
-   ossim_uint16          theLinearUnitsCode;               // key 3076
-   double                theStdPar1;                       // key 3078 
-   double                theStdPar2;                       // key 3079
-   mutable double        theOriginLon;                     // key 3080
-   mutable double        theOriginLat;                     // key 3081
-   double                theFalseEasting;                  // key 3082
-   double                theFalseNorthing;                 // key 3083
-   double                theScaleFactor;                   // key 3092
-   
-   ossimPrivateGtifDef*  thePrivateDefinitions;
-   
-   static OpenThreads::Mutex theMutex;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimGmlSupportData.h b/ossim/include/ossim/support_data/ossimGmlSupportData.h
deleted file mode 100644
index 0a3a9cb..0000000
--- a/ossim/include/ossim/support_data/ossimGmlSupportData.h
+++ /dev/null
@@ -1,118 +0,0 @@
-//---
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: GML support data object.
-// 
-//---
-// $Id$
-#ifndef ossimGmlSupportData_HEADER
-#define ossimGmlSupportData_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <iosfwd>
-
-class ossimImageGeometry;
-class ossimKeywordlist;
-class ossimMapProjection;
-class ossimXmlDocument;
-class ossimXmlNode;
-
-/** @brief GML support data class. */
-class OSSIM_DLL ossimGmlSupportData
-{
-public:
-   
-   /** default constructor */
-   ossimGmlSupportData();
-
-   /** destructor */
-   ~ossimGmlSupportData();
-
-   /**
-    * @brief Initializes gml block from geometry file.
-    * @param geom
-    */
-   bool initialize( const ossimImageGeometry* geom );
-
-   /**
-    * @brief Initializes from stream assumed to be a gml block.
-    * @param in
-    */   
-   bool initialize( std::istream& in );
-
-   /** @brief Write xml doc to stream. */
-   bool write( std::ostream& os );
-
-   /** @return Reference to xml doc. */
-   ossimRefPtr<ossimXmlDocument> getXmlDoc() const;
-
-   /**
-    *  @brief Extracts geometry info to keyword list.
-    *  
-    *  Populates the keyword list with image geometry information.  This
-    *  method is used to relay projection/model information to users.
-    *
-    *  @param geomKwl Keyword list that will be initialized with geometry info.
-    *
-    *  @return true if geometry info is present, false if not.
-    */
-   bool getImageGeometry( ossimKeywordlist& geomKwl ) const;
-  
-
-private:
-   
-   ossimRefPtr<ossimXmlNode> getGmljp2V1RootNode() const;
-   ossimRefPtr<ossimXmlNode> getGmljp2V2RootNode() const;
-
-   void getOrigin( const ossimImageGeometry* geom,
-                   ossimString& originString,
-                   ossimString& offsetVector1String, 
-                   ossimString& offsetVector2String ) const;
-
-   void getLimits( const ossimImageGeometry* geom,
-                   ossimString& gridHighString,
-                   ossimString& gridLowString ) const;
-
-   void getGeoBounds( const ossimImageGeometry* geom,
-                      ossimString& upperCornerString,
-                      ossimString& lowerCornerString ) const;
-
-   void getGeoOrigin( const ossimImageGeometry* geom,
-                      ossimString& originString,
-                      ossimString& offsetVector1String, 
-                      ossimString& offsetVector2String ) const;
-
-   void getMapOrigin( const ossimImageGeometry* geom,
-                      ossimString& originString,
-                      ossimString& offsetVector1String, 
-                      ossimString& offsetVector2String ) const;
-
-   bool configureGmljp2V1( ossimRefPtr<ossimXmlNode> node, const ossimImageGeometry* geom );
-   bool configureGmljp2V2( ossimRefPtr<ossimXmlNode> node, const ossimImageGeometry* geom );
-   bool configureBounds  ( ossimRefPtr<ossimXmlNode> node, const ossimImageGeometry* geom );
-                  
-   ossimRefPtr<ossimXmlDocument>         m_xmlDocument;
-   ossimRefPtr<const ossimMapProjection> m_mapProj;
-
-   bool         m_use_gmljp2_version2;
-   ossim_uint32 m_pcsCodeMap;
-   ossim_uint32 m_pcsCodeGeo;
-   ossimString  m_srsNameStringMap;
-   ossimString  m_srsNameStringGeo;
-   ossimString  m_srsDimensionString;
-   ossimString  m_axisLabelsStringMap;
-   ossimString  m_axisLabelsStringGeo;
-   ossimString  m_uomLabelsStringMap;
-   ossimString  m_uomLabelsStringGeo;
-
-};
-
-#endif /* End of "#ifndef ossimGmlSupportData_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimIkonosMetaData.h b/ossim/include/ossim/support_data/ossimIkonosMetaData.h
deleted file mode 100644
index 6b577c2..0000000
--- a/ossim/include/ossim/support_data/ossimIkonosMetaData.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Class declaration for ossimIkonosMetaData.
-// 
-// This class parses a Space Imaging Ikonos meta data file.
-//
-//********************************************************************
-// $Id: ossimIkonosMetaData.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimIkonosMetaData_HEADER
-#define ossimIkonosMetaData_HEADER
-
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimString.h>
-
-class ossimFilename;
-class ossimKeywordlist;
-
-
-class OSSIMDLLEXPORT ossimIkonosMetaData : public ossimObject
-{
-public:
-
-   /** @brief default constructor */
-   ossimIkonosMetaData();
-
-
-   /**
-    * @brief Open method that takes the image file, derives the metadata,
-    * header and rpc files, then calls parse methods parseMetaData,
-    * parseHdrData, and parseRpcData.
-    *
-    * @param imageFile Usually in the form of "po_2619900_pan_0000000.tif".
-    *
-    * @return true on success, false on error.
-    */
-   bool open(const ossimFilename& imageFile);
-
-   void clearFields();
-   
-   ossimString   getSensorID() const;
-
-   //---
-   // Convenient method to print important image info:
-   //---
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * Method to save the state of the object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0) const;
-   
-   /**
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-
-   /**
-    * @brief Method to parse Ikonos metadata file.
-    *
-    * @param metadata File name usually in the form of
-    * "po_149875_metadata.txt."
-    *
-    * @return true on success, false on error.
-    */
-   bool parseMetaData(const ossimFilename& metadata);
-
-   /**
-    * @brief Method to parse Ikonos header file.
-    *
-    * @param metadata File name usually in the form of
-    * "po_149875_pan_0000000.hdr"
-    *
-    * @return true on success, false on error.
-    */
-   bool parseHdrData(const ossimFilename& data_file);
-
-   /**
-    * @brief Method to parse Ikonos rpc file.
-    *
-    * @param metadata File name usually in the form of
-    * "po_149875_pan_0000000_rpc.txt"
-    *
-    * @return true on success, false on error.
-    *
-    * @note Currently NOT implemented.
-    */
-   bool parseRpcData(const ossimFilename& data_file);
-
-protected:
-   /** virtual destructor */
-   virtual ~ossimIkonosMetaData();
-
-private:
-   ossim_float64 theNominalCollectionAzimuth;
-   ossim_float64 theNominalCollectionElevation;
-   ossim_float64 theSunAzimuth;
-   ossim_float64 theSunElevation;
-   ossim_uint32  theNumBands;
-   ossimString   theBandName;
-   ossimString   theProductionDate;
-   ossimString   theAcquisitionDate;
-   ossimString   theAcquisitionTime;
-   ossimString   theSensorID;
-   
-TYPE_DATA   
-};
-
-#endif /* #ifndef ossimIkonosMetaData_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimInfoBase.h b/ossim/include/ossim/support_data/ossimInfoBase.h
deleted file mode 100644
index 1cd5af6..0000000
--- a/ossim/include/ossim/support_data/ossimInfoBase.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Base class for Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimInfoBase_HEADER
-#define ossimInfoBase_HEADER
-
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimReferenced.h>
-
-class ossimFilename;
-class ossimKeywordlist;
-
-/**
- * @brief Info Base.
- *
- * This is the base class for all info objects.  The purpose of an Info object
- * is to dump whatever info is available for a given file name to user.
- */
-class OSSIM_DLL ossimInfoBase : public ossimReferenced
-{
-public:
-   
-   /** default constructor */
-   ossimInfoBase();
-
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file) = 0;
-
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const = 0;
-
-   /**
-    * @brief Sets the overview flag.
-    * @param flag If true overview info is processed also.
-    */
-   void setProcessOverviewFlag(bool flag);
-   
-   /**
-    * @brief Method to get the overview flag.
-    * @return The overview flag.
-    */
-   bool getProcessOverviewFlag() const;
-
-   /**
-    * @brief Method to dump info to a keyword list.
-    * @param kwl The keyword list to initialize.
-    * @return true on success, false on error.
-    */
-   virtual bool getKeywordlist(ossimKeywordlist& kwl)const;
-
-protected:
-   /** virtual destructor */
-   virtual ~ossimInfoBase();
-   
-   bool theOverviewFlag; // If true overview information should be processed.
-   
-};
-
-#endif /* End of "#ifndef ossimInfoBase_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimInfoFactory.h b/ossim/include/ossim/support_data/ossimInfoFactory.h
deleted file mode 100644
index 5adfbb8..0000000
--- a/ossim/include/ossim/support_data/ossimInfoFactory.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Factory for info objects.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimInfoFactory.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimInfoFactory_HEADER
-#define ossimInfoFactory_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimInfoFactoryInterface.h>
-
-class ossimFilename;
-class ossimInfoBase;
-
-/**
- * @brief Info factory.
- */
-class OSSIM_DLL ossimInfoFactory : public ossimInfoFactoryInterface
-{
-public:
-
-   /** virtual destructor */
-   virtual ~ossimInfoFactory();
-
-   static ossimInfoFactory* instance();
-
-   /**
-    * @brief create method.
-    *
-    * @param file Some file you want info for.
-    *
-    * @return ossimInfoBase* on success 0 on failure.  Caller is responsible
-    * for memory.
-    */
-   virtual ossimInfoBase* create(const ossimFilename& file) const;
-   
-private:
-   
-   /** hidden from use default constructor */
-   ossimInfoFactory();
-
-   /** hidden from use copy constructor */
-   ossimInfoFactory(const ossimInfoFactory& obj);
-
-   /** hidden from use operator = */
-   const ossimInfoFactory& operator=(const ossimInfoFactory& rhs);
-
-   /** The single instance of this class. */
-   static ossimInfoFactory* theInstance;
-};
-
-#endif /* End of "#ifndef ossimInfoFactory_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimInfoFactoryInterface.h b/ossim/include/ossim/support_data/ossimInfoFactoryInterface.h
deleted file mode 100644
index 6d8730d..0000000
--- a/ossim/include/ossim/support_data/ossimInfoFactoryInterface.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Interface for info factories.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimInfoFactoryInterface_HEADER
-#define ossimInfoFactoryInterface_HEADER
-
-#include <ossim/base/ossimConstants.h>
-// #include <ossim/base/ossimObjectFactory.h>
-
-class ossimFilename;
-class ossimInfoBase;
-
-//---
-// Note: Deriving from ossimObjectFactory is being backed out as no
-// ossimObjectFactory interfaces were ever called and it introduces warning in
-// the header file so anyone who #includes this gets warnings...
-//
-// We can add back if there is a interface from ossimObjectFactory needed;
-// else, please leave out.
-// 
-// drb 20120518
-//---
-
-/**
- * @brief Info factory.
- */
-class OSSIM_DLL ossimInfoFactoryInterface // : public ossimObjectFactory
-{
-public:
-
-   /** default constructor */
-   ossimInfoFactoryInterface(){}
-
-   /** virtual destructor */
-   virtual ~ossimInfoFactoryInterface(){}
-
-   /**
-    * @brief Pure virtual create method.  Derived classes must implement to
-    * be concrete.
-    *
-    * @param file Some file you want info for.
-    *
-    * @return ossimInfoBase* on success 0 on failure.  Caller is responsible
-    * for memory.
-    */
-   virtual ossimInfoBase* create(const ossimFilename& file) const = 0;
-
-#if 0
-   virtual ossimObject* createObject(const ossimString& typeName)const
-   {
-      return 0;
-   }
-   virtual ossimObject* createObject(const ossimKeywordlist& kwl,
-                                     const char* prefix=0)const
-   {
-      return 0;
-   }
-   /*!
-    * This should return the type name of all objects in all factories.
-    * This is the name used to construct the objects dynamially and this
-    * name must be unique.
-    */
-   virtual void getTypeNameList(std::vector<ossimString>& typeList)const
-   {
-      
-   }
-#endif
-   
-};
-
-#endif /* End of "#ifndef ossimInfoFactoryInterface_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimInfoFactoryRegistry.h b/ossim/include/ossim/support_data/ossimInfoFactoryRegistry.h
deleted file mode 100644
index af39de3..0000000
--- a/ossim/include/ossim/support_data/ossimInfoFactoryRegistry.h
+++ /dev/null
@@ -1,89 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file
-//
-// Author:  David Burken
-//
-// Description: Class declaration of Registry (singleton) for info factories.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimInfoFactoryRegistry_HEADER
-#define ossimInfoFactoryRegistry_HEADER 1
-
-#include <ossim/base/ossimConstants.h> /* for OSSIM_DLL macro */
-#include <OpenThreads/Mutex>
-#include <vector>
-
-// Forward class declarations.
-class ossimInfoFactoryInterface;
-class ossimInfoBase;
-class ossimFilename;
-
-class OSSIM_DLL ossimInfoFactoryRegistry
-{
-public:
-   
-   /** destructor */
-   ~ossimInfoFactoryRegistry();
-
-   /**
-    * instance method
-    *
-    * @return Pointer to the instance of the registry.
-    */
-   static ossimInfoFactoryRegistry* instance();
-
-   /**
-    * @brief Method to add factory to registry.
-    * @param factory Factory to register.
-    */
-   void registerFactory(ossimInfoFactoryInterface* factory);
-
-   /**
-    * @brief Adds factory to the front of the registry.
-    * @param factory Factory to register.
-    */
-   void registerFactoryToFront( ossimInfoFactoryInterface* factory );
-                               
-   /**
-    * Method to remove a factory from the registry.  Used by plugins when they
-    * are unloaded.
-    * @param factory Factory to remove.
-    */
-   void unregisterFactory(ossimInfoFactoryInterface* factory);
-
-   /**
-    * @brief Create method.
-    *
-    * @param file Some file you want info for.
-    *
-    * @return ossimInfoBase* on success 0 on failure.  Caller is responsible
-    * for memory.
-    */
-   ossimInfoBase* create(const ossimFilename& file) const;
-   
-protected:
-
-   /**
-    * @brief Hidden from use default constructor.
-    * @note Adds ossimInfoFactory to registry.
-    */
-   ossimInfoFactoryRegistry();
-
-   /** @brief hidden from use copy constructor */
-   ossimInfoFactoryRegistry(const ossimInfoFactoryRegistry& obj);
-
-   /** @brief hidden from use assignment operator */
-   const ossimInfoFactoryRegistry& operator=(
-      const ossimInfoFactoryRegistry& rhs);
-   
-   std::vector<ossimInfoFactoryInterface*> m_factoryList;
-
-   OpenThreads::Mutex m_mutex;
-
-   static ossimInfoFactoryRegistry* m_instance;
-};
-
-#endif /* #ifndef ossimInfoFactoryRegistry_HEADER */
diff --git a/ossim/include/ossim/support_data/ossimJ2kCodRecord.h b/ossim/include/ossim/support_data/ossimJ2kCodRecord.h
deleted file mode 100644
index d240cf8..0000000
--- a/ossim/include/ossim/support_data/ossimJ2kCodRecord.h
+++ /dev/null
@@ -1,96 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Container class for J2K Coding style default (COD) record.
-//
-// See document BPJ2K01.00 Table 7-7 Image and tile size (15444-1 Annex A5.1)
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJ2kCodRecord.h,v 1.5 2005/10/13 21:24:47 dburken Exp $
-#ifndef ossimJ2kCodRecord_HEADER
-#define ossimJ2kCodRecord_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-
-#include <iosfwd>
-#include <string>
-
-class OSSIM_DLL ossimJ2kCodRecord
-{
-public:
-   
-   /** default constructor */
-   ossimJ2kCodRecord();
-
-   /** destructor */
-   ~ossimJ2kCodRecord();
-
-   /**
-    * Parse method.  Performs byte swapping as needed.
-    *
-    * @param in Stream to parse.
-    *
-    * @note COD Marker (0xff52) is not read.
-    */
-   void parseStream(std::istream& in);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-
-   /** operator<< */
-   friend OSSIM_DLL std::ostream& operator<<(
-      std::ostream& out, const ossimJ2kCodRecord& obj);
-
-   /** segmet marker 0xff52 (big endian) */
-   ossim_uint16 m_marker;
-
-   /** length of segment minus marker */
-   ossim_uint16 m_lcod;
-
-   /** Coding style */
-   ossim_uint8 m_scod;
-
-   /** SGcod - Progression order */
-   ossim_uint8 m_progressionOrder;
-
-   /** SGcod - Number of layers */
-   ossim_uint16 m_numberOfLayers;
-
-   /** SGcod - Multiple component transform */
-   ossim_uint8 m_multipleComponentTransform;
-
-   /** SPcod - Number of decomposition levels */
-   ossim_uint8 m_numberOfDecompositionLevels;
-
-   /** SPcod - Code-block width */
-   ossim_uint8 m_codeBlockWidth;
-   
-   /** SPcod - Code-block height */
-   ossim_uint8 m_codeBlockHeight;
-
-   /** SPcod - Code-block height */
-   ossim_uint8 m_codeBlockStyle;
-
-   /** SPcod - transformation (wavelet filter) */
-   ossim_uint8 m_transformation;
-
-    /** SPcod - precinct size (only is defined, Scod = xxxx xxx1) */
-   ossim_uint8 m_precinctSize;
-};
-
-#endif /* End of "#ifndef ossimJ2kCodRecord_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimJ2kInfo.h b/ossim/include/ossim/support_data/ossimJ2kInfo.h
deleted file mode 100644
index db9353b..0000000
--- a/ossim/include/ossim/support_data/ossimJ2kInfo.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: J2K Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimJ2kInfo_HEADER
-#define ossimJ2kInfo_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimFilename.h>
-
-class ossimEndian;
-
-/**
- * @brief TIFF info class.
- *
- * Encapsulates the listgeo functionality.
- */
-class OSSIM_DLL ossimJ2kInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimJ2kInfo();
-
-   /** virtual destructor */
-   virtual ~ossimJ2kInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-   
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-protected:
-
-   /** Initializes s reference.  Does byte swapping as needed. */
-   void readUInt16(ossim_uint16& s, std::ifstream& str) const;
-
-   /**
-    * @brief Prints 0xff52 COD_MARKER (0xff52).
-    * @param out Stream to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
-    * "j2k.file_name:"
-    * @param str Input stream to pass to j2k record for parsing.  Should be
-    * just pass the marker.
-    * @return output stream.
-    */
-   std::ostream& printCodMarker(std::ostream& out,
-                                const std::string& prefix,
-                                std::ifstream& str) const;
-
-   /**
-    * @brief Prints 0xff51 SIZ_MARKER (0xff51).
-    * @param out Stream to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
-    * "j2k.file_name:"
-    * @param str Input stream to pass to j2k record for parsing.  Should be
-    * just pass the marker.
-    * @return output stream.
-    */
-   std::ostream& printSizMarker(std::ostream& out,
-                                const std::string& prefix,
-                                std::ifstream& str) const;
-
-   /**
-    * @brief Prints 0xff90 SOT_MARKER (0xff90)
-    * @param out Stream to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
-    * "j2k.file_name:"
-    * @param str Input stream to pass to j2k record for parsing.  Should be
-    * just pass the marker.
-    * @return output stream.
-    */
-   std::ostream& printSotMarker(std::ostream& out,
-                                const std::string& prefix,
-                                std::ifstream& str) const;
-
-   /**
-    * @brief Prints unhandle segment.  This will only print the marker and
-    * record length.
-    * @param out Stream to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "j2k." and key is "file_name" key becomes:
-    * "j2k.file_name:"
-    * @param str Input stream to pass to j2k record for parsing.  Should be
-    * just pass the marker.
-    * @param marker.  The marker.
-    * @return output stream.
-    */
-   std::ostream& printUnknownMarker(std::ostream& out,
-                                    const std::string& prefix,
-                                    std::ifstream& str,
-                                    ossim_uint16 marker) const;
-
-   
-   ossimFilename  m_file;
-   ossimEndian*   m_endian;
-};
-
-#endif /* End of "#ifndef ossimJ2kInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimJ2kSizRecord.h b/ossim/include/ossim/support_data/ossimJ2kSizRecord.h
deleted file mode 100644
index 6b98794..0000000
--- a/ossim/include/ossim/support_data/ossimJ2kSizRecord.h
+++ /dev/null
@@ -1,131 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Container class for J2K Image and tile size (SIZ) record.
-//
-// See document BPJ2K01.00 Table 7-6 Image and tile size (15444-1 Annex A5.1)
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJ2kSizRecord.h,v 1.5 2005/10/13 21:24:47 dburken Exp $
-#ifndef ossimJ2kSizRecord_HEADER
-#define ossimJ2kSizRecord_HEADER
-
-#include <iosfwd>
-#include <string>
-
-#include <ossim/base/ossimConstants.h>
-
-class OSSIM_DLL ossimJ2kSizRecord
-{
-public:
-   
-   /** default constructor */
-   ossimJ2kSizRecord();
-
-   /** destructor */
-   ~ossimJ2kSizRecord();
-
-   /**
-    * Parse method.  Performs byte swapping as needed.
-    *
-    * @param in Stream to parse.
-    *
-    * @note SIZ Marker (0xff51) is not read.
-    */
-   void parseStream(std::istream& in);
-
-   /** @return scalar type based on bit depth and signed bit from theSsiz. */
-   ossimScalarType getScalarType() const;
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-
-   /** operator<< */
-   friend OSSIM_DLL std::ostream& operator<<(
-      std::ostream& out, const ossimJ2kSizRecord& obj);
-
-   /** segmet marker 0xff51 (big endian) */
-   ossim_uint16 m_marker;
-
-   /** length of segment minus marker */
-   ossim_uint16 m_Lsiz;
-
-   /** profile */
-   ossim_uint16 m_Rsiz;
-
-   /** width of reference grid */
-   ossim_uint32 m_Xsiz;
-
-   /** height of reference grid */
-   ossim_uint32 m_Ysiz;
-
-   /**
-    * Horizontal offset from the orgin of reference grid to the left side
-    * of image.
-    */
-   ossim_uint32 m_XOsiz;
-
-   /**
-    * Vertical offset from the orgin of reference grid to the top
-    * of image.
-    */
-   ossim_uint32 m_YOsiz;
-
-   /** width of one reference tile */
-   ossim_uint32 m_XTsiz;
-   
-   /** height of one reference tile */   
-   ossim_uint32 m_YTsiz;
-
-   /**
-    * Horizontal offset from the orgin of reference grid to the left edge
-    * of first tile.
-    */
-   ossim_uint32 m_XTOsiz;
-
-   /**
-    * Vertical offset from the orgin of reference grid to the top
-    * edge of first tile.
-    */
-   ossim_uint32 m_YTOsiz;
-
-   /** number of component in the image */
-   ossim_uint16 m_Csiz;
-
-   /**
-    * sign bit and bit depth of data
-    * unsigned = 0xxx xxxx (msb == 0)
-    * signed   = 1xxx xxxx (msb == 1)
-    * bit depth = x000 0000 + 1 (first seven bits plus one)
-    */
-   ossim_uint8  m_Ssiz;
-
-   /**
-    * Horizontal separation of a sample of the component with respect to the
-    * reference grid.
-    */
-   ossim_uint8  m_XRsiz;
-
-   /**
-    * Vertical separation of a sample of the component with respect to the
-    * reference grid.
-    */
-   ossim_uint8  m_YRsiz;
-};
-
-#endif /* End of "#ifndef ossimJ2kSizRecord_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimJ2kSotRecord.h b/ossim/include/ossim/support_data/ossimJ2kSotRecord.h
deleted file mode 100644
index c10ea3e..0000000
--- a/ossim/include/ossim/support_data/ossimJ2kSotRecord.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Container class for J2K "Start Of Tile" (SOT) record.
-//
-// See document BPJ2K01.00 Table 7-3 Image and tile size (15444-1 Annex A.4.2)
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJ2kSotRecord.h,v 1.5 2005/10/13 21:24:47 dburken Exp $
-#ifndef ossimJ2kSotRecord_HEADER
-#define ossimJ2kSotRecord_HEADER
-
-#include <iosfwd>
-#include <string>
-
-#include <ossim/base/ossimConstants.h>
-
-class OSSIM_DLL ossimJ2kSotRecord
-{
-public:
-   
-   /** default constructor */
-   ossimJ2kSotRecord();
-
-   /** destructor */
-   ~ossimJ2kSotRecord();
-
-   /**
-    * Parse method.  Performs byte swapping as needed.
-    *
-    * @param in Stream to parse.
-    *
-    * @note Marker is not read.
-    */
-   void parseStream(std::istream& in);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-   
-   /**
-    * operator<<.
-    */
-   friend OSSIM_DLL std::ostream& operator<<(
-      std::ostream& out, const ossimJ2kSotRecord& obj);
-
-   /** Start of tile-part marker code. 0xff90 */
-   ossim_uint16 theMarker;
-   
-   /** Length in bytes of the marker segment. */
-   ossim_uint16 theLsot;
-
-   /** Tile index. Tiles are in raster order starting at 0. */
-   ossim_uint16 theIsot;
-
-   /** The length in bytes of this record including the SOT marker. */
-   ossim_uint32 thePsot;
-
-   /** Tile-Part index. */
-   ossim_uint8  theTpsot;
-
-   /**
-    * 0 = Number of tile-parts of this tile in the codestream is not defined
-    * in this header.
-    *
-    * 1-255 number of tile-parts of this tile in the codestream.
-    */
-   ossim_uint8  theTnsot;
-};
-
-#endif /* End of "#ifndef ossimJ2kSotRecord_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimJp2Info.h b/ossim/include/ossim/support_data/ossimJp2Info.h
deleted file mode 100644
index af70537..0000000
--- a/ossim/include/ossim/support_data/ossimJp2Info.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: JP2 Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJp2Info.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimJp2Info_HEADER
-#define ossimJp2Info_HEADER 1
-
-#include <ossim/support_data/ossimJ2kInfo.h>
-
-/**
- * @brief JP2 info class.
- */
-class OSSIM_DLL ossimJp2Info : public ossimJ2kInfo
-{
-public:
-
-   /** Anonymous enumerations: */
-   enum
-   {
-      SIGNATURE_BOX_SIZE = 12,
-      GEOTIFF_UUID_SIZE  = 16
-   };
-   
-   /** default constructor */
-   ossimJp2Info();
-
-   /** virtual destructor */
-   virtual ~ossimJp2Info();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief This gets a box of type and stuffs in box.
-    *
-    * Code for copying a box to a buffer. Currently used in ossimOpjWriter
-    * to overcome short falls of trying to write in between the uuid box in
-    * between the jp2h and start of jp2c written by opj_start_compress.
-    *
-    * @param type Defines box type. E.g. 0x6A703268 (jp2h)
-    * @param includeAll if true the length fields are copied. If false
-    * just the DBox is copied.
-    * @param box Initialized by this. LBox and XLBox fields
-    * are NOT copied to the box.
-    * @return is the start position of the box. At the LBox.
-    */
-   std::streamoff getBox( const ossim_uint32 type,
-                          bool includeAll,
-                          std::vector<ossim_uint8>& box ) const;
-
-   /**
-    * @brief This gets a box of type and stuffs in box.
-    *
-    * Code for copying a box to a buffer. Note that stream is not rewound or
-    * cleared if it hits EOF.
-    *
-    * @param type Defines box type. E.g. 0x6A703268 (jp2h)
-    * @param includeAll if true the length fields are copied. If false
-    * just the DBox is copied.
-    * @param str Stream to read from.
-    * @param box Initialized by this. LBox and XLBox fields
-    * are NOT copied to the box.
-    * @return The start position of the box (LBox) or zero if not found.
-    */
-   std::streamoff getBox( const ossim_uint32& type,
-                          bool includeAll,
-                          std::ifstream& str,
-                          std::vector<ossim_uint8>& box ) const;
-   /**
-    * @brief Method to get the embedded JP2 GeoTIFF box. This includes the 16
-    * GEOTIFF_UUID bytes.
-    * @param str Stream to read from.
-    * @return  The start position of the box (LBox) or zero if not found.
-    */
-   std::streamoff getGeotiffBox( std::ifstream& str,
-                                 std::vector<ossim_uint8>& box ) const;
-
-   /**
-    * @brief Method to get the embedded JP2 GML Box.
-    * @param str Stream to read from.
-    * @return  The start position of the box (LBox) or zero if not found.
-    */
-   std::streamoff getGmlBox( std::ifstream& str,
-                             std::vector<ossim_uint8>& box ) const;
-   
-   /**
-    * @brief This finds a box of type and returns the location of its data.
-    *
-    * @param type Defines box type. E.g. 0x6A703268 (jp2h)
-    * @param str Stream to read from.
-    * @param length Number of bytes in the data.
-    * @return The start position of the box (LBox) or zero if not found.
-    */
-   std::streamoff findBoxData( const ossim_uint32& type,
-                               std::ifstream& str,
-                               ossim_uint32& length ) const;
-
-protected:
-
-   /** @brief Print tbox type as string if known. */
-   void printTboxType( ossim_uint32 tbox, std::ostream& out) const;
-
-   /** Initializes i reference.  Does byte swapping as needed. */
-   void readUInt32(ossim_uint32& i, std::ifstream& str) const;
-
-   /** Initializes i reference.  Does byte swapping as needed. */
-   void readUInt64(ossim_uint64& i, std::ifstream& str) const;
-
-};
-
-#endif /* End of "#ifndef ossimJp2Info_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimJpipMessage.h b/ossim/include/ossim/support_data/ossimJpipMessage.h
deleted file mode 100644
index 9c81429..0000000
--- a/ossim/include/ossim/support_data/ossimJpipMessage.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*********************************************************************************************
- *
- * License: MIT Please see the top level LICENSE.txt
- *
- * Author: Garrett Potts
- * 
- *********************************************************************************************/
-#ifndef ossimJpipMessage_HEADER
-#define ossimJpipMessage_HEADER
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/support_data/ossimJpipMessageHeader.h>
-#include <vector>
-class OSSIM_DLL ossimJpipMessage : public ossimReferenced
-{
-public:
-    typedef std::vector<ossim_uint8> MessageBodyType;
-    
-    ossimJpipMessage();
-    void reset();
-    void setHeaderLength(ossim_uint64 length){m_headerLength = length;}
-    ossimJpipMessageHeader* header(){return m_header.get();}
-    const ossimJpipMessageHeader* header()const{return m_header.get();}
-    MessageBodyType& messageBody(){return m_messageBody;}
-    const MessageBodyType& messageBody()const{return m_messageBody;}
-    void dumpBodyAsHex(std::ostream& out)const;
-    void dumpBodyAsText(std::ostream& out)const;
-    
-protected:
-    ossimRefPtr<ossimJpipMessageHeader> m_header;
-    ossim_uint64             m_headerLength;
-    MessageBodyType m_messageBody;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimLasHdr.h b/ossim/include/ossim/support_data/ossimLasHdr.h
deleted file mode 100644
index 95c9216..0000000
--- a/ossim/include/ossim/support_data/ossimLasHdr.h
+++ /dev/null
@@ -1,188 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimLasHdr.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Container class for LAS LIDAR format public header block.
-//
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimLasHdr_HEADER
-#define ossimLasHdr_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-
-#include <iosfwd>
-#include <string>
-class ossimKeywordlist;
-
-class OSSIM_DLL ossimLasHdr
-{
-public:
-   
-   /* @brief default constructor */
-   ossimLasHdr();
-
-   /* @brief copy constructor */
-   ossimLasHdr(const ossimLasHdr& hdr);
-
-   /* @brief assignment operator= */
-   const ossimLasHdr& operator=(const ossimLasHdr& hdr);
-
-   /* destructor */
-   ~ossimLasHdr();
-
-   /**
-    * @brief Checks for LASF in first four bytes.
-    * @return true if first four bytes are LASF.
-    */
-   bool checkSignature(std::istream& in) const;   
-
-   /**
-    * @brief Method to initialize from input stream.
-    *
-    * Input stream should be at beginning of file.
-    * 
-    * @param in Stream to read from.
-    */
-   void readStream(std::istream& in);
-
-   /** @brief Writes header to stream. */
-   void writeStream(std::ostream& out);
-
-   /**
-    * @brief print method.
-    * @return std::ostream&
-    */
-   std::ostream& print(std::ostream& out) const;
-
-   /** @brief Convenience operator<< method. */
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out, const ossimLasHdr& hdr);
-   
-   void getKeywordlist(ossimKeywordlist& kwl) const;
-
-   /** @return True if bit 0 of m_globalEncoding is set, false if not. */
-   bool getGpsTimeTypeBit() const;
-
-   /** @return True if bit 1 of m_globalEncoding is set, false if not. */
-   bool getWaveforDataPacketsInternalBit() const;
-
-   /** @return True if bit 2 of m_globalEncoding is set, false if not. */
-   bool getWaveforDataPacketsExternalBit() const;
-   
-   /** @return True if bit 3 of m_globalEncoding is set, false if not. */
-   bool getReturnsSyntheticallyGeneratedBit() const;
-
-   /** @return True if bit 4 of m_globalEncoding is set, false if not. */
-   bool getWktBit() const;
-   
-   /**
-    * @return The project ID GUID data, e.g.: 55b44da7-7c23-4f86-a54ec39e8f1d1ea1
-    */
-   std::string getProjectIdGuid() const;
-
-   /** @return The major and minor version, e.g.: 1.2 */
-   std::string getVersion() const;
-
-   /** @return The system identifier string. */
-   std::string  getSystemIndentifier() const;
-
-   /** @return The generating software string. */
-   std::string  getGeneratingSoftware() const;
-
-   /** @return Size of this header in bytes. */
-   ossim_uint16 getHeaderSize() const;
-
-   /** @return Offset to point data. */
-   ossim_uint32 getOffsetToPointData() const;
-
-   /** @return The number fo variable length records. */
-   ossim_uint32 getNumberOfVlrs() const;
-
-   /** @return Point data format ID */
-   ossim_uint8 getPointDataFormatId() const;
-
-   /** @return The number of total points. */
-   ossim_uint64 getNumberOfPoints() const;
-
-   /**
-    * @brief Gets number of points for entry where entry is synonymous returns.
-    * @return The number of points for entries 0 through 4.
-    */
-   ossim_uint64 getNumberOfPoints(ossim_uint32 entry) const;
-
-   const ossim_float64& getScaleFactorX() const;
-   const ossim_float64& getScaleFactorY() const;
-   const ossim_float64& getScaleFactorZ() const;
-   const ossim_float64& getOffsetX() const;
-   const ossim_float64& getOffsetY() const;
-   const ossim_float64& getOffsetZ() const;
-   const ossim_float64& getMinX() const;
-   const ossim_float64& getMinY() const;
-   const ossim_float64& getMinZ() const;
-   const ossim_float64& getMaxX() const;
-   const ossim_float64& getMaxY() const;
-   const ossim_float64& getMaxZ() const;
-   
-   
-private:
-
-   /** @brief Performs a swap if system byte order is not little endian. */
-   void swap();
-
-   /**
-    * @brief Test version.
-    * @param major
-    * @param minor
-    * @return true if m_versionMajor and m_versionMinor are greater than major and minor
-    * args.
-    */
-   bool versionGreaterThan( ossim_uint8 major, ossim_uint8 minor ) const;
-
-   char          m_fileSignature[5];
-   ossim_uint16  m_fileSourceId;
-   ossim_uint16  m_globalEncoding;
-   ossim_uint32  m_projectIdGuidData1;
-   ossim_uint16  m_projectIdGuidData2;
-   ossim_uint16  m_projectIdGuidData3;
-   ossim_uint8   m_projectIdGuidData4[8];
-   ossim_uint8   m_versionMajor;
-   ossim_uint8   m_versionMinor;
-   char          m_systemIndentifier[32];
-   char          m_generatingSoftware[32];
-   ossim_uint16  m_fileCreationDay;
-   ossim_uint16  m_fileCreateionYear;
-   ossim_uint16  m_headerSize;
-   ossim_uint32  m_offsetToPointData;
-   ossim_uint32  m_numberOfVariableLengthRecords;
-   ossim_uint8   m_pointDataFormatId;
-   ossim_uint16  m_pointDataRecordLength;
-   ossim_uint32  m_legacyNumberOfPointRecords;            // deprecated 1_4
-   ossim_uint32  m_legacyNumberOfPointsByReturn[5];       // deprecated 1_4
-   ossim_float64 m_xScaleFactor;
-   ossim_float64 m_yScaleFactor;
-   ossim_float64 m_zScaleFactor;
-   ossim_float64 m_xOffset;
-   ossim_float64 m_yOffset;
-   ossim_float64 m_zOffset;
-   ossim_float64 m_maxX;
-   ossim_float64 m_minX;
-   ossim_float64 m_maxY;
-   ossim_float64 m_minY;
-   ossim_float64 m_maxZ;
-   ossim_float64 m_minZ;
-   ossim_uint64  m_startOfWaveformDataPacket;             // Added 1_3
-   ossim_uint64  m_startOfExtendedVariableLengthRecords;  // Added 1_4
-   ossim_uint32  m_numberOfExtendedVariableLengthRecords; // Added 1_4
-   ossim_uint64  m_numberOfPointRecords;                  // Added 1_4
-   ossim_uint64  m_numberOfPointsByReturn[15];            // Added 1_4
-   
-};
-
-#endif /* End of "#ifndef ossimLasHdr_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimLasInfo.h b/ossim/include/ossim/support_data/ossimLasInfo.h
deleted file mode 100644
index dd03241..0000000
--- a/ossim/include/ossim/support_data/ossimLasInfo.h
+++ /dev/null
@@ -1,58 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimLibLasInfo.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: LAS LIDAR info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimLasInfo_HEADER
-#define ossimLasInfo_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimFilename.h>
-
-#include <iosfwd>
-
-/** @brief LAS LIDAR info object. */
-class OSSIM_DLL ossimLasInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimLasInfo();
-
-   /** virtual destructor */
-   virtual ~ossimLasInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-private:
-   ossimFilename m_file;
-};
-
-#endif /* End of "#ifndef ossimLasInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfAcftbTag.h b/ossim/include/ossim/support_data/ossimNitfAcftbTag.h
deleted file mode 100644
index e63fa6b..0000000
--- a/ossim/include/ossim/support_data/ossimNitfAcftbTag.h
+++ /dev/null
@@ -1,404 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ACFTB - Aircraft Infomation Extension Format tag class
-// declaration.
-//
-// See document STDI-0002 (version 3), Appendix E, Table E-6 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimNitfAcftbTag_HEADER
-#define ossimNitfAcftbTag_HEADER
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfAcftbTag : public ossimNitfRegisteredTag
-{
-public:
-
-   enum 
-   {
-      CEL_SIZE               = 207,
-      AC_MSN_ID_SIZE         = 20,
-      AC_TAIL_NO_SIZE        = 10,
-      AC_TO_SIZE             = 12,
-      SENSOR_ID_TYPE_SIZE    = 4,
-      SENSOR_ID_SIZE         = 6,
-      SCENE_SOURCE_SIZE      = 1,
-      SCNUM_SIZE             = 6,
-      PDATE_SIZE             = 8,
-      IMHOSTNO_SIZE          = 6,
-      IMREQID_SIZE           = 5,
-      MPLAN_SIZE             = 3,
-      ENTLOC_SIZE            = 25,
-      LOC_ACCY_SIZE          = 6,
-      ENTELV_SIZE            = 6,
-      ELV_UNIT_SIZE          = 1,
-      EXITLOC_SIZE           = 25,
-      EXITELV_SIZE           = 6,
-      TMAP_SIZE              = 7,
-      ROW_SPACING_SIZE       = 7,
-      ROW_SPACING_UNITS_SIZE = 1,
-      COL_SPACING_SIZE       = 7,
-      COL_SPACING_UINTS_SIZE = 1,
-      FOCAL_LENGTH_SIZE      = 6,
-      SENSERIAL_SIZE         = 6,
-      ABSWVER_SIZE           = 7,
-      CAL_DATE_SIZE          = 8,
-      PATCH_TOT_SIZE         = 4,
-      MTI_TOT_SIZE           = 3
-   };
-   
-   /** @brief default constructor */
-   ossimNitfAcftbTag();
-
-   /** @brief destructor */
-   virtual ~ossimNitfAcftbTag();
-
-   /** @brief Method to parse data from stream. */
-   virtual void parseStream(std::istream& in);
-
-   /** @brief Method to write data to stream. */
-   virtual void writeStream(std::ostream& out);
-
-   /** @brief Method to clear all fields including null terminating. */
-   virtual void clearFields();
-
-   ossimString getFocalLength()const;
-   ossimString getColumnSpacing()const;
-   ossimString getColumnSpacingUnits()const;
-   ossimString getRowSpacing()const;
-   ossimString getRowSpacingUnits()const;
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-protected:
-
-   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
-   
-   /**
-    * FIELD: AC_MSN_ID
-    *
-    * TYPE: R
-    * 
-    * 20 byte field
-    *
-    * Aircraft Mission Identification
-    */
-   char theAcMsnId[AC_MSN_ID_SIZE+1];
-
-   /**
-    * FIELD: AC_TAIL_NO
-    *
-    * TYPE: <R>
-    * 
-    * 10 byte field
-    *
-    * Aircraft Tail Number
-    */
-   char theAcTailNo[AC_TAIL_NO_SIZE+1];
-   
-   /**
-    * FIELD: AC_TO
-    *
-    * TYPE: <R>
-    * 
-    * 12 byte field
-    *
-    * Aircraft Take-off, CCYYMMDDhhmm
-    */
-   char theAcTo[AC_TO_SIZE+1];
-
-   /**
-    * FIELD: SENSOR_ID_TYPE
-    *
-    * TYPE: R
-    * 
-    * 4 byte field
-    *
-    * Sensor ID Type
-    */
-   char theSensorIdType[SENSOR_ID_TYPE_SIZE+1];
-   
-   /**
-    * FIELD: SENSOR_ID
-    *
-    * TYPE: R
-    * 
-    * 6 byte field
-    *
-    * Sensor ID 
-    */
-   char theSensorId[SENSOR_ID_SIZE+1];
-
-   /**
-    * FIELD: SCENE_SOURCE
-    *
-    * TYPE: <R>
-    * 
-    * 1 byte field
-    *
-    * Scene Source, 0 to 9
-    */
-   char theSceneSource[SCENE_SOURCE_SIZE+1];
-   
-   /**
-    * FIELD: SCNUM
-    *
-    * TYPE: R
-    * 
-    * 6 byte field
-    *
-    * Scene Number, 000000 to 999999
-    */
-   char theScNum[SCNUM_SIZE+1];
-
-   /**
-    * FIELD: PDATE
-    *
-    * TYPE: R
-    * 
-    * 8 byte field
-    *
-    * Processing Date, CCYYMMDD
-    */
-   char thePDate[PDATE_SIZE+1];
-   
-   /**
-    * FIELD: IMHOSTNO
-    *
-    * TYPE: R
-    * 
-    * 6 byte field
-    *
-    * Immediate Scene Host
-    */
-   char theImHostNo[IMHOSTNO_SIZE+1];
-
-   /**
-    * FIELD: IMREQID
-    *
-    * TYPE: R
-    * 
-    * 5 byte field
-    *
-    * Immediate Scene Request ID, 00000, 00001 to 99999
-    */
-   char theImReqID[IMREQID_SIZE+1];
-   
-   /**
-    * FIELD: MPLAN
-    *
-    * TYPE: R
-    * 
-    * 3 byte field
-    *
-    * Mission Plan Mode, 001 to 999
-    */
-   char theMPlan[MPLAN_SIZE+1];
-
-   /**
-    * FIELD: ENTLOC
-    *
-    * TYPE: <R>
-    * 
-    * 25 byte field
-    *
-    * Entry Location
-    */
-   char theEntLoc[ENTLOC_SIZE+1];
-
-   /**
-    * FIELD: LOC_ACCY
-    *
-    * TYPE: R
-    * 
-    * 6 byte field
-    *
-    * Location Accuracy, feet, 000.01 to 999.99, 000000, 000.00
-    */
-   char theLocAccy[LOC_ACCY_SIZE+1];
-   
-   /**
-    * FIELD: ENTELV
-    *
-    * TYPE: <R>
-    * 
-    * 6 byte field
-    *
-    * Entry Elevation, feet or meters, -01000 to +30000
-    */
-   char theEntelv[ENTELV_SIZE+1];
-
-   /**
-    * FIELD: ELV_UNIT
-    *
-    * TYPE: <R>
-    * 
-    * 1 byte field
-    *
-    * Unit of Elevation, f or m
-    */
-   char theElvUnit[ELV_UNIT_SIZE+1];
-   
-   /**
-    * FIELD: EXITLOC
-    *
-    * TYPE: <R>
-    * 
-    * 25 byte field
-    *
-    * Exit Location
-    */
-   char theExitLoc[EXITLOC_SIZE+1];
-
-   /**
-    * FIELD: EXITELV
-    *
-    * TYPE: <R>
-    * 
-    * 6 byte field
-    *
-    * Exit Elevation
-    */
-   char theExitElev[EXITELV_SIZE+1];
-   
-   /**
-    * FIELD: TMAP
-    *
-    * TYPE: <R>
-    * 
-    * 7 byte field
-    *
-    * True Map Angle, degrees, 000.000 to 180.000
-    */
-   char theTMap[TMAP_SIZE+1];
-
-   /**
-    * FIELD: ROW_SPACING
-    *
-    * TYPE: R
-    * 
-    * 7 byte field
-    *
-    * Row Spacing, feet, meters, rads. 
-    */
-   char theRowSpacing[ROW_SPACING_SIZE+1];
-
-   /**
-    * FIELD: ROW_SPACING_UNITS
-    *
-    * TYPE: R
-    * 
-    * 1 byte field
-    *
-    * Unit of Row Spacing, f, m, r or u
-    */
-   char theRowSpacingUnits[ROW_SPACING_UNITS_SIZE+1];
-
-   /**
-    * FIELD: COL_SPACING
-    *
-    * TYPE: R
-    * 
-    * 7 byte field
-    *
-    * Column Spacing
-    */
-   char theColSpacing[COL_SPACING_SIZE+1];
-
-   /**
-    * FIELD: COL_SPACING_UINTS
-    *
-    * TYPE: R
-    * 
-    * 1 byte field
-    *
-    * Unit of Column Spacing
-    */
-   char theColSpacingUnits[COL_SPACING_UINTS_SIZE+1];
-   
-   /**
-    * FIELD: FOCAL_LENGTH
-    *
-    * TYPE: R
-    * 
-    * 6 byte field
-    *
-    * Sensor Focal Length, cm, 000.01 to 899.99, 999.99
-    */
-   char theFocalLength[FOCAL_LENGTH_SIZE+1];
-
-   /**
-    * FIELD: SENSERIAL
-    *
-    * TYPE: <R>
-    * 
-    * 6 byte field
-    *
-    * Sensor vendor's serial number, 000001 to 999999
-    */
-   char theSenserial[SENSERIAL_SIZE+1];
-   
-   /**
-    * FIELD: ABSWVER
-    *
-    * TYPE: <R>
-    * 
-    * 7byte field
-    *
-    * Airborne Software Version
-    */
-   char theAbSwVer[ABSWVER_SIZE+1];
-
-   /**
-    * FIELD: CAL_DATE
-    *
-    * TYPE: <R>
-    * 
-    * 8 byte field
-    *
-    * Calibration Date, CCYYMMDD
-    */
-   char theCalDate[CAL_DATE_SIZE+1];
-   
-   /**
-    * FIELD: PATCH_TOT
-    *
-    * TYPE: R
-    * 
-    * 4 byte field
-    *
-    * Patch Total
-    */
-   char thePatchTot[PATCH_TOT_SIZE+1];
-
-   /**
-    * FIELD: MTI_TOT
-    *
-    * TYPE: R
-    * 
-    * 3 byte field
-    *
-    * MTI Total, SAR: 000 to 999, EO-IR: 000
-    */
-   char theMtiTot[MTI_TOT_SIZE+1];
-   
-TYPE_DATA   
-};
-
-#endif /* matches #ifndef ossimNitfAcftbTag_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfAimidbTag.h b/ossim/include/ossim/support_data/ossimNitfAimidbTag.h
deleted file mode 100644
index cc2c5e8..0000000
--- a/ossim/include/ossim/support_data/ossimNitfAimidbTag.h
+++ /dev/null
@@ -1,279 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: AIMIDB - Additional Image ID Extension Format
-// tag class declaration.
-//
-// See document STDI-0002 (version 3), Appendix E, Table E-3 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimNitfAimidbTag_HEADER
-#define ossimNitfAimidbTag_HEADER 1
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfAimidbTag : public ossimNitfRegisteredTag
-{
-public:
-
-   enum 
-   {
-      CEL_SIZE                    = 89,
-      ACQUISITION_DATE_SIZE       = 14,
-      MISSION_NO_SIZE             = 4,
-      MISSION_IDENTIFICATION_SIZE = 10,
-      FLIGHT_NO_SIZE              = 2,
-      OP_NUM_SIZE                 = 3,
-      CURRENT_SEGMENT_SIZE        = 2,
-      REPRO_NUM_SIZE              = 2,
-      REPLAY_SIZE                 = 3,
-      RESERVED_1_SIZE             = 1,
-      START_TILE_COLUMN_SIZE      = 3,
-      START_TILE_ROW_SIZE         = 5,
-      END_SEGMENT_SIZE            = 2,
-      END_TILE_COLUMN_SIZE        = 3,
-      END_TILE_ROW_SIZE           = 5,
-      COUNTRY_SIZE                = 2,
-      RESERVED_2_SIZE             = 4,
-      LOCATION_SIZE               = 11,
-      RESERVED_3_SIZE             = 13
-    };
-   
-   /** @brief default constructor */
-   ossimNitfAimidbTag();
-
-   /** @brief destructor */
-   virtual ~ossimNitfAimidbTag();
-
-   /** @brief Method to parse data from stream. */
-   virtual void parseStream(std::istream& in);
-
-   /** @brief Method to write data to stream. */
-   virtual void writeStream(std::ostream& out);
-
-   /** @brief Method to clear all fields including null terminating. */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-protected:
-
-   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
-   
-   /**
-    * FIELD: ACQUISITION_DATE
-    *
-    * TYPE: R
-    * 
-    * 14 byte field
-    *
-    * CCYYMMDDhhmmss
-    */
-   char theAcquisitionDate[ACQUISITION_DATE_SIZE+1];
-
-   /**
-    * FIELD: MISSION_NO
-    *
-    * TYPE: R
-    *
-    * 4 byte field
-    *
-    * Mission Number
-    */
-   char theMissionNumber[MISSION_NO_SIZE+1];
-
-   /**
-    * FIELD: MISSION_IDENTIFICATION
-    *
-    * TYPE: R
-    *
-    * 10 byte field
-    *
-    * Name of the Mission.
-    */
-   char theMissionIdentification[MISSION_IDENTIFICATION_SIZE+1];
-   
-   /**
-    * FIELD: FLIGHT_NO
-    *
-    * TYPE: R
-    *
-    * 2 byte field
-    *
-    * Flight Number
-    */
-   char theFlightNo[FLIGHT_NO_SIZE+1];
-
-   /**
-    * FIELD: OP_NUM
-    *
-    * TYPE: R
-    *
-    * 3 byte field
-    *
-    * Image Operation Number 000 to 999
-    */
-   char theOpNum[OP_NUM_SIZE+1];
-   
-   /**
-    * FIELD: CURRENT_SEGMENT
-    *
-    * TYPE: R
-    *
-    * 2 byte field
-    *
-    * Current Segment ID, AA to ZZ
-    */
-   char theCurrentSegment[CURRENT_SEGMENT_SIZE+1];
-
-   /**
-    * FIELD: REPRO_NUM
-    *
-    * TYPE: R
-    *
-    * 2 byte field
-    *
-    * Reprocess Number, 00 to 99
-    */
-   char theReproNum[REPRO_NUM_SIZE+1];
-   
-   /**
-    * FIELD: REPLAY
-    *
-    * TYPE: <R>
-    *
-    * 3 byte field
-    *
-    * Replay
-    */
-   char theReplay[REPLAY_SIZE+1];
-
-   /**
-    * FIELD: RESERVED_1
-    *
-    * TYPE: R
-    *
-    * 1 byte field
-    *
-    * 1 space
-    */
-   char theReserved1[RESERVED_1_SIZE+1];
-   
-   /**
-    * FIELD: START_TILE_COLUMN
-    *
-    * TYPE: R
-    *
-    * 3 byte field
-    *
-    * Starting Tile Column Number, 001 to 099
-    */
-   char theStartTileColumn[START_TILE_COLUMN_SIZE+1];
-
-   /**
-    * FIELD: START_TILE_ROW
-    *
-    * TYPE: R
-    *
-    * 5 byte field
-    *
-    * Starting Tile Row Number, 00001 to 99999
-    */
-   char theStartTileRow[START_TILE_ROW_SIZE+1];
-   
-   /**
-    * FIELD: END_SEGMENT
-    *
-    * TYPE: R
-    *
-    * 2 byte field
-    *
-    * Ending Segment, 00, AA to ZZ
-    */
-   char theEndSegment[END_SEGMENT_SIZE+1];
-
-   /**
-    * FIELD: END_TILE_COLUMN
-    *
-    * TYPE: R
-    *
-    * 3 byte field
-    *
-    * Ending Tile Column Number, 001 to 099
-    */
-   char theTileColumn[END_TILE_COLUMN_SIZE+1];
-   
-   /**
-    * FIELD: END_TILE_ROW
-    *
-    * TYPE: R
-    *
-    * 5 byte field
-    *
-    * Ending Tile Row Number, 00001 to 99999
-    */
-   char theTileRow[END_TILE_ROW_SIZE+1];
-
-   /**
-    * FIELD: COUNTRY
-    *
-    * TYPE: <R>
-    *
-    * 2 byte field
-    *
-    * Country Code, AA to ZZ
-    */
-   char theCountry[COUNTRY_SIZE+1];
-   
-   /**
-    * FIELD: RESERVED_2
-    *
-    * TYPE: R
-    *
-    * 4 byte field
-    *
-    * 4 spaces
-    */
-   char theReserved2[RESERVED_2_SIZE+1];
-
-   /**
-    * FIELD: LOCATION
-    *
-    * TYPE: <R>
-    *
-    * 11 byte field
-    *
-    * Location, ddmmXdddmmY, spaces
-    */
-   char theLocation[LOCATION_SIZE+1];
-
-   /**
-    * FIELD: RESERVED_3
-    *
-    * TYPE: R
-    *
-    * 13 byte field
-    *
-    * 13 spaces
-    */
-   char theReserved3[RESERVED_3_SIZE+1];
-   
-TYPE_DATA   
-};
-
-#endif /* matches #ifndef ossimNitfAimidbTag_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfBlockaTag.h b/ossim/include/ossim/support_data/ossimNitfBlockaTag.h
deleted file mode 100644
index 3d5dc78..0000000
--- a/ossim/include/ossim/support_data/ossimNitfBlockaTag.h
+++ /dev/null
@@ -1,335 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: BLOCKA tag class declaration.
-//
-// See document STDI-0002 Table 8-9 for more info.
-// 
-// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfBlockaTag.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfBlockaTag_HEADER
-#define ossimNitfBlockaTag_HEADER
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class ossimDpt;
-
-class OSSIM_DLL ossimNitfBlockaTag : public ossimNitfRegisteredTag
-{
-public:
-   enum 
-   {
-      BLOCK_INSTANCE_SIZE = 2,
-      N_GRAY_SIZE         = 5,
-      L_LINES_SIZE        = 5,
-      LAYOVER_ANGLE_SIZE  = 3,
-      SHADOW_ANGLE_SIZE   = 3,
-      FIELD_6_SIZE        = 16, // reserved
-      FRLC_LOC_SIZE       = 21,
-      LRLC_LOC_SIZE       = 21,
-      LRFC_LOC_SIZE       = 21,
-      FRFC_LOC_SIZE       = 21,
-      FIELD_11_SIZE       = 5,  // reserved
-      //                -----
-      //                  123
-   };
-   
-   /** default constructor */
-   ossimNitfBlockaTag();
-  
-   /**
-    * Parse method.
-    *
-    * @param in Stream to parse.
-    */
-   virtual void parseStream(std::istream& in);
-   
-   /**
-    * Write method.
-    *
-    * @param out Stream to write to.
-    */
-   virtual void writeStream(std::ostream& out);
-   
-   /**
-    * Clears all string fields within the record to some default nothingness.
-    */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;
-
-   /** @param block number to set block instance to.  Valid range 01 to 99. */
-   void setBlockInstance(ossim_uint32 block);
-
-   
-   /** @return theBlockInstance as a string. */
-   ossimString getBlockInstance() const;
-   
-   /**
-    * @param grayCount Count of gray fill.
-    *
-    * Valid range:  0 to 99999
-    */
-   void setNGray(ossim_uint32 grayCount);
-   
-   /** @return theNGray as a string. */
-   ossimString getNGray() const;
-   
-   /**
-    * @param lines Number of rows.
-    *
-    * Valid range:  0 to 99999
-    */
-   void setLLines(ossim_uint32 lines);
-   
-   /** @return theLLines as a string. */
-   ossimString getLLines() const;
-   
-   /**
-    * @param angle Value to set theLayoverAngle to.
-    *
-    * Valid range: 000 to 359 or spaces
-    */
-   void setLayoverAngle(ossim_uint32 angle);
-   
-   /** @return theLayoverAngle as a string. */
-   ossimString getLayoverAngle() const;
-   
-   /**
-    * @param angle Value to set theLayoverAngle to.
-    *
-    * Valid range: 000 to 359 or spaces
-    */
-   void setShadowAngle(ossim_uint32 angle);
-   
-   /** @return theLayoverAngle as a string. */
-   ossimString getShadowAngle() const;
-   
-   /**
-    * Convert latitude and logitude to theFrlcLoc string.
-    * 
-    * @param pt Ground point of first row, last column.
-    *
-    * @param longitude Longitude portion in decimal degrees.
-    */
-   void setFrlcLoc(const ossimDpt& pt);
-   
-   /** @return theFrlcLoc as a string. */
-   ossimString getFrlcLoc() const;
-   
-   /** @param pt Ground point to initialize with location. */
-   void getFrlcLoc(ossimDpt& pt) const;
-
-   /**
-    * Convert latitude and logitude to theLrlcLoc string.
-    * 
-    * @param pt Ground point of last row, last column.
-    *
-    * @param longitude Longitude portion in decimal degrees.
-    */
-   void setLrlcLoc(const ossimDpt& pt);
-   
-   /** @return theLrlcLoc as a string. */
-   ossimString getLrlcLoc() const;
-   
-   /** @param pt Ground point to initialize with location. */
-   void getLrlcLoc(ossimDpt& pt) const;
-
-      /**
-    * Convert latitude and logitude to theLrfcLoc string.
-    * 
-    * @param pt Ground point of last row, first column.
-    *
-    * @param longitude Longitude portion in decimal degrees.
-    */
-   void setLrfcLoc(const ossimDpt& pt);
-   
-   /** @return theLrfcLoc as a string. */
-   ossimString getLrfcLoc() const;
-   
-   /** @param pt Ground point to initialize with location. */
-   void getLrfcLoc(ossimDpt& pt) const;
-
-   /**
-    * Convert latitude and logitude to theFrfcLoc string.
-    * 
-    * @param pt Ground point of first row, first column.
-    *
-    * @param longitude Longitude portion in decimal degrees.
-    */
-   void setFrfcLoc(const ossimDpt& pt);
-   
-   /** @return theFrfcLoc as a string. */
-   ossimString getFrfcLoc() const;
-   
-   /** @param pt Ground point to initialize with location. */
-   void getFrfcLoc(ossimDpt& pt) const;
-   
-protected:
-
-   /**
-    * Parses location string and initializes pt with result.
-    *
-    * @param locationString String to parse.
-    *
-    * @param pt Point to initialize.
-    */
-   void converLocStringToPt(const ossimString& locationString,
-                            ossimDpt& pt) const;
-                            
-   
-   /**
-    * FIELD: BLOCK_INSTANCE
-    *
-    * required 2 byte field
-    *
-    * 01 to 99
-    * 
-    * Block number of the image.
-    */
-   char theBlockInstance[BLOCK_INSTANCE_SIZE+1];
-   
-   /**
-    * FIELD: N_GRAY
-    *
-    * required 5 byte field
-    *
-    * 00000 to 99999
-    *
-    * SAR The number of gray fill pixels.
-    *
-    * EO-IR: 00000
-    */
-   char theNGray[N_GRAY_SIZE+1];
-   
-   /**
-    * FIELD: L_LINES
-    *
-    * required 5 byte field
-    *
-    * 00000 to 99999
-    *
-    * Row count.
-    */
-   char theLLines[L_LINES_SIZE+1];
-   
-   /**
-    * FIELD: LAYOVER_ANGLE
-    *
-    * required 3 byte field
-    *
-    * 000 to 359 or spaces
-    * 
-    * SAR: Angle between the first row of pixels and the layover direction in
-    * the image, measured in a clockwise direction.
-    *
-    * EO-IR: spaces
-    */
-   char theLayoverAngle[LAYOVER_ANGLE_SIZE+1];
-   
-   /**
-    * FIELD: SHADOW_ANGLE
-    *
-    * required 3 byte field
-    *
-    * 000 to 359 or spaces
-    *
-    * SAR: Angle between the first row of pixels and the radar shadow in
-    * the image, measured in a clockwase direction.
-    *
-    * EO-IR: spaces
-    */
-   char theShadowAngle[SHADOW_ANGLE_SIZE+1];
-   
-   /**
-    * FIELD: FIELD_6
-    *
-    * Reserved field of 16 spaces.
-    */
-   char theField6[FIELD_6_SIZE+1];
-   
-   /**
-    * FIELD: FRLC_LOC
-    *
-    * required 21 byte field
-    *
-    * XDDMMSS.SSYDDDMMSS.SS
-    * OR
-    * +-dd.dddddd+-ddd.dddddd
-    * OR
-    * 21 spaces
-    *
-    * Location of the first row, last column of the image block.
-    */
-   char theFrlcLoc[FRLC_LOC_SIZE+1];
-   
-   /**
-    * FIELD: LRLC_LOC
-    *
-    * required 21 byte field
-    *
-    * XDDMMSS.SSYDDDMMSS.SS
-    * OR
-    * +-dd.dddddd+-ddd.dddddd
-    * OR
-    * 21 spaces
-    *
-    * Location of the last row, last column of the image block.
-    */
-   char theLrlcLoc[LRLC_LOC_SIZE+1];
-   
-   /**
-    * FIELD: LRFC_LOC
-    *
-    * required 21 byte field
-    *
-    * XDDMMSS.SSYDDDMMSS.SS
-    * OR
-    * +-dd.dddddd+-ddd.dddddd
-    * OR
-    * 21 spaces
-    *
-    * Location of the last row, first column of the image block.
-    */
-   char theLrfcLoc[LRFC_LOC_SIZE+1];
-   
-   /**
-    * FIELD: FRFC_LOC
-    *
-    * required 21 byte field
-    *
-    * XDDMMSS.SSYDDDMMSS.SS
-    * OR
-    * +-dd.dddddd+-ddd.dddddd
-    * OR
-    * 21 spaces
-    *
-    * Location of the first row, first column of the image block.
-    */
-   char theFrfcLoc[FRFC_LOC_SIZE+1];
-   
-   /**
-    * FIELD: FIELD_11
-    *
-    * Reserved field of 5 bytes containing: 010.0 
-    */
-   char theField11[FIELD_11_SIZE+1];
-   
-TYPE_DATA   
-};
-
-#endif /* End of "#ifndef ossimNitfBlockaTag_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfCommon.h b/ossim/include/ossim/support_data/ossimNitfCommon.h
deleted file mode 100644
index f142ed2..0000000
--- a/ossim/include/ossim/support_data/ossimNitfCommon.h
+++ /dev/null
@@ -1,183 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Utility class for global nitf methods.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfCommon.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfCommon_HEADER
-#define ossimNitfCommon_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimString.h>
-#include <iostream>
-
-class ossimDpt;
-class ossimIrect;
-
-/** class ossimNitfCommon for global utility methods */   
-class OSSIM_DLL ossimNitfCommon
-{
-public:
-
-   /** default constructor */
-   ossimNitfCommon();
-
-   /** destructor */
-   ~ossimNitfCommon();
-
-   /**
-    * This method takes a value and a size(or width) and converts it to a
-    * scientific notation sting in the format: ±0.999999E±9
-    *
-    * @note If the value is positive, currently there is no + added to the
-    * front.
-    *
-    * @param aValue Value to convert to string.
-    *
-    * @param size total size of the string.  This must be at least 7 if
-    * aValue is positive and at least 8 if aValue is negative; else,
-    * no action is taken and an empty string is returned.
-    */
-   static ossimString convertToScientificString(const ossim_float64& aValue,
-                                                ossim_uint32 size);
-
-   /**
-    * This method takes a value and converts to a string of size with
-    * requested precision with a '0' fill.
-    *
-    * Format example: 00925.00
-    * 
-    * @param aValue Value to convert to string.
-    *
-    * @param precision The floating point precision.
-    *
-    * @param size total size of the string.
-    */
-   static ossimString convertToDoubleString(const ossim_float64& aValue,
-                                            ossim_uint32 precision,
-                                            ossim_uint32 size);
-
-   /**
-    * This method takes a value and converts to a string of size with
-    * with a '0' fill.
-    *
-    * Format example: 00925
-
-    * @param aValue Value to convert to string.
-    *
-    * @param size total size of the string.
-    */
-   static ossimString convertToUIntString(ossim_uint32 aValue,
-                                          ossim_uint32 size);
-   
-   /**
-    * Just like convertToUIntString only takes a signed value.
-    * 
-    * This method takes a value and converts to a string of size with
-    * with a '0' fill.
-    *
-    * Format example: 00925
-
-    * @param aValue Value to convert to string.
-    *
-    * @param size total size of the string.
-    */
-   static ossimString convertToIntString(ossim_int32 aValue,
-                                         ossim_uint32 size);
-
-   /**
-    * Converts pt to a decimal degrees latitude longitude location string.
-    *
-    * Format example: +-dd.dddddd+-ddd.dddddd
-    *
-    * @param pt Point to convert where pt.x = longitude and pt.y = latitude.
-    *
-    * @param  precision The floating point precision. This will determine the
-    * size of the string.
-    */
-   static ossimString convertToDdLatLonLocString(const ossimDpt& pt,
-                                                 ossim_uint32 precision);
-
-   /**
-    * Sets a field with a given string, width, and IOS flags.
-    *
-    * @param fieldDestination
-    *        The member NITF field to set.
-    * @param src
-    *        The source string.
-    * @param width
-    *        The number of characters in fieldDestination to copy from the
-    *        source string.
-    * @param ioflags
-    *        Formatting flags for the destination string.
-    * @param fill
-    *        If the size of the string is smaller than the field size,
-    *        this character specifies what the excess character values are.
-    */
-   static void setField(void* fieldDestination,
-                        const ossimString& src,
-                        std::streamsize width,
-                        std::ios_base::fmtflags ioflags = std::ios::left,
-                        char fill = ' ');
-   /**
-    * This will encode a 60 character IGEOLO field.
-    */
-   static ossimString encodeUtm(
-                                ossim_uint32 zone,
-                                const ossimDpt& ul,
-                                const ossimDpt& ur,
-                                const ossimDpt& lr,
-                                const ossimDpt& ll);
-   static ossimString encodeGeographicDms(
-                                          const ossimDpt& ul,
-                                          const ossimDpt& ur,
-                                          const ossimDpt& lr,
-                                          const ossimDpt& ll);
-   static ossimString encodeGeographicDecimalDegrees(
-                                                     const ossimDpt& ul,
-                                                     const ossimDpt& ur,
-                                                     const ossimDpt& lr,
-                                                     const ossimDpt& ll);
-
-   /**
-    * @brief Get the nitf pixel type string from scalar type.
-    *
-    * @param scalarType The scalar type.
-    *
-    * @return Pixel type as string, e.g.: "INT", "SI", "R"
-    */
-   static ossimString getNitfPixelType(ossimScalarType scalarType);
-
-   /**
-    * @brief Get compression rate (COMRAT) which is bits perpixel per band.
-    *
-    * This corresponds to the nitf image header COMRAT field.  Return is in
-    * the form of Nxyz "N" for numerically lossles, where "xyz"
-    * indicates the expected achieved bit rate (in bits per pixel per band)
-    * for the final layer of each tile. The decimal point is implicit and
-    * assumed to be one digit from the right (i.e. xy.z).
-    * 
-    * @param rect Image rectangles.
-    * @param bands
-    * @param scalar
-    * @param lengthInBytes Compressed length of image pixels.
-    * @return Approximate number of bits per pixel for the compressed image as
-    * a string which follows the nitf comrat field convention.  This will
-    * return an empty string if comrat is bigger than three digits.
-    */
-   static ossimString getCompressionRate(const ossimIrect& rect,
-                                         ossim_uint32 bands,
-                                         ossimScalarType scalar,
-                                         ossim_uint64 lengthInBytes);
-   
-   
-}; // End of class ossimNitfCommon.
-   
-#endif /* #ifndef ossimNitfCommon_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfCompressionHeader.h b/ossim/include/ossim/support_data/ossimNitfCompressionHeader.h
deleted file mode 100644
index 3a2ce2a..0000000
--- a/ossim/include/ossim/support_data/ossimNitfCompressionHeader.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts
-//
-// LICENSE: MIT see top level LICENSE.txt for more details
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfCompressionHeader.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfCompressionHeader_HEADER
-#define ossimNitfCompressionHeader_HEADER
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimString.h>
-
-#include <iosfwd>
-#include <string>
-
-class OSSIM_DLL ossimNitfCompressionHeader : public ossimObject
-{
-public:
-   virtual void parseStream(std::istream& in) = 0;
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const=0;
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-protected:
-
-TYPE_DATA;   
-};
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfCsccgaTag.h b/ossim/include/ossim/support_data/ossimNitfCsccgaTag.h
deleted file mode 100644
index 2da55f3..0000000
--- a/ossim/include/ossim/support_data/ossimNitfCsccgaTag.h
+++ /dev/null
@@ -1,145 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description: CSCCGA tag class definition
-//
-//----------------------------------------------------------------------------
-// $Id$
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-/**
-* All comments in this document were taken from the online resource found at:
-*
-* http://jitc.fhu.disa.mil/nitf/tag_reg
-*
-* The Cloud Cover Grid Data TRE (CSCCGA) provides support data that identifies 
-* which image segment and sensors were used to create the cloud grid. CSCCGA 
-* also geometrically registers the cloud grid to the pixel grid of one of the image segments.
-* 1. The format and content of the CSCCGA TRE shall be as detailed in Table 3.1-1.
-* 2. When cloud cover information is included in the dataset (see Section 2.1.4.2 for an exception) 
-*    both the CSCCGA TRE and the Cloud Cover Shapefile DES (Section 2.6.2) shall be 
-*    included in each dataset even though they both express similar information.
-*/
-class OSSIM_DLL ossimNitfCsccgaTag : public ossimNitfRegisteredTag
-{
-public:
-   enum
-   {
-      CCG_SOURCE_SIZE    = 18,
-      REG_SENSOR_SIZE    = 6,
-      ORIGIN_LINE_SIZE   = 7,
-      ORIGIN_SAMPLE_SIZE = 5,
-      AS_CELL_SIZE_SIZE  = 7,
-      CS_CELL_SIZE_SIZE  = 5,
-      CCG_MAX_LINE_SIZE  = 7,
-      CCG_MAX_SAMPLE_SIZE= 5,
-      CEL_SIZE           = 60 
-
-   };
-   ossimNitfCsccgaTag();
-
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   virtual void clearFields();
-
-protected:
-   /**
-    * Field: CCG_SOURCE
-    *
-    * BCS-A 18 byte field.
-    *
-    * Values: PAN or MS or PAN, MS
-    *
-    * Source of Grid Concatenation of all sensors used to create 
-    * cloud cover grid separated by commas
-    */
-   char m_ccgSource[CCG_SOURCE_SIZE+1];
-	
-   /**
-    * Field: REG_SENSOR
-    *
-    * BCS-A 6 bytes.
-    *
-    Values: PAN or MS
-    *
-    * Image Segment Sensor to which Cloud Cover Grid is registered 
-    * (CCG is always registered to the synthetic array)
-    */
-   char m_regSensor[REG_SENSOR_SIZE+1];
-
-   /**
-    * Field: ORIGIN_LINE
-    *
-    * BCS-N 7 bytes.
-    *
-    * Values: 0000001
-    *
-    * Cloud Cover Grid Origin – Line 
-    * (Corresponding line in registered image segment)
-    */
-   char m_originLine[ORIGIN_LINE_SIZE+1];
-
-   /**
-    * Field: ORIGIN_SAMPLE
-    *
-    * BCS-N 5 bytes
-    *
-    * Values: 00001
-    *
-    * Cloud Cover Grid Origin – Sample 
-    * (Corresponding sample in registered image segment)
-    */
-   char m_originSample[ORIGIN_SAMPLE_SIZE+1];
-
-   /**
-    * Field: AS_CELL_SIZE
-    *
-    * BCS-N 7 bytes
-    *
-    * Value Range: 0000001 - 9999999
-    *
-    * Along Scan Cell Size – Lines (Cloud Cover Grid spacing in 
-    * registered image segment lines)
-    */
-   char m_asCellSize[AS_CELL_SIZE_SIZE+1];
-
-   /**
-    * Field: CS_CELL_SIZE
-    *
-    * BCS-N 5 bytes
-    *
-    * Value Range: 00001 - 99999
-    *
-    * Cross Scan Cell Size – Samples 
-    * (Cloud Cover Grid spacing in registered image segment samples)
-    */
-   char m_csCellSize[CS_CELL_SIZE_SIZE+1];
-	
-   /**
-    * Field: CCG_MAX_LINE
-    *
-    * BCS-N 7 bytes
-    *
-    * Value Range: 0000001 - 9999999
-    *
-    * Number of Rows in CC Grid (Number of Cells in "lines" direction)
-    */
-   char m_ccgMaxLine[CCG_MAX_LINE_SIZE+1];
-
-   /**
-    * Field: CCG_MAX_SAMPLE
-    *
-    * BCS-N 5 bytes
-    *
-    * Value Range: 00001 - 99999
-    *
-    * Number of Columns in CC Grid (Number of Cells in "sample" direction)
-    */
-   char m_ccgMaxSample[CCG_MAX_SAMPLE_SIZE+1];
-};
diff --git a/ossim/include/ossim/support_data/ossimNitfCscrnaTag.h b/ossim/include/ossim/support_data/ossimNitfCscrnaTag.h
deleted file mode 100644
index 378227b..0000000
--- a/ossim/include/ossim/support_data/ossimNitfCscrnaTag.h
+++ /dev/null
@@ -1,185 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CSCRNA tag class declaration.
-//
-// Corner Footprint TRE.
-//
-// See document STDI-0006-NCDRD Table 3.2-13 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimNitfCscrnaTag_HEADER
-#define ossimNitfCscrnaTag_HEADER 1
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfCscrnaTag : public ossimNitfRegisteredTag
-{
-public:
-   /** @brief default constructor */
-   ossimNitfCscrnaTag();
-
-   /** @brief destructor */
-   virtual ~ossimNitfCscrnaTag();
-
-   /** @brief Method to parse data from stream. */
-   virtual void parseStream(std::istream& in);
-
-   /** @brief Method to write data to stream. */
-   virtual void writeStream(std::ostream& out);
-
-   /** @brief Method to clear all fields including null terminating. */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;
-   
-protected:
-
-   //---
-   // NOTE:  Spec says corner points are project from image plane to
-   // reference ellipsoid NOT ellipsoid + height.
-   //---
-
-   /**
-    * FIELD: PREDICT_CORNERS
-    * 
-    * 1 byte field BCS-A
-    *
-    * Y = predicted, N = actual
-    */
-   char thePredictedCornerFlag[2];
-
-   /**
-    * FIELD: ULCRN_LAT
-    *
-    * 9 byte field BCS-N Degrees
-    *
-    * -90.000000 ti +90.000000
-    */
-   char theUlLat[10];
-
-   /**
-    * FIELD: ULCRN_LON
-    *
-    * 10 byte field BCS-N Degrees
-    *
-    * -179.999999 ti +180.000000
-    */
-   char theUlLon[11];
-
-   /**
-    * FIELD: ULCRN_HT
-    *
-    * 8 byte field BCS-N Meters
-    *
-    * Height referenced to the reference ellipsoid.
-    *
-    * -00610.0 to +10668.0
-    */
-   char theUlHt[9];
-
-    /**
-    * FIELD: URCRN_LAT
-    *
-    * 9 byte field BCS-N Degrees
-    *
-    * -90.000000 ti +90.000000
-    */
-   char theUrLat[10];
-
-   /**
-    * FIELD: URCRN_LON
-    *
-    * 10 byte field BCS-N Degrees
-    *
-    * -179.999999 ti +180.000000
-    */
-   char theUrLon[11];
-
-   /**
-    * FIELD: URCRN_HT
-    *
-    * 8 byte field BCS-N Meters
-    *
-    * Height referenced to the reference ellipsoid.
-    *
-    * -00610.0 to +10668.0
-    */
-   char theUrHt[9];
-
-   /**
-    * FIELD: LRCRN_LAT
-    *
-    * 9 byte field BCS-N Degrees
-    *
-    * -90.000000 ti +90.000000
-    */
-   char theLrLat[10];
-
-   /**
-    * FIELD: LRCRN_LON
-    *
-    * 10 byte field BCS-N Degrees
-    *
-    * -179.999999 ti +180.000000
-    */
-   char theLrLon[11];
-
-   /**
-    * FIELD: LRCRN_HT
-    *
-    * 8 byte field BCS-N Meters
-    *
-    * Height referenced to the reference ellipsoid.
-    *
-    * -00610.0 to +10668.0
-    */
-   char theLrHt[9];
-
-   /**
-    * FIELD: LLCRN_LAT
-    *
-    * 9 byte field BCS-N Degrees
-    *
-    * -90.000000 ti +90.000000
-    */
-   char theLlLat[10];
-
-   /**
-    * FIELD: LLCRN_LON
-    *
-    * 10 byte field BCS-N Degrees
-    *
-    * -179.999999 ti +180.000000
-    */
-   char theLlLon[11];
-
-   /**
-    * FIELD: LLCRN_HT
-    *
-    * 8 byte field BCS-N Meters
-    *
-    * Height referenced to the reference ellipsoid.
-    *
-    * -00610.0 to +10668.0
-    */
-   char theLlHt[9];
-   
-TYPE_DATA   
-};
-
-#endif /* matches #ifndef ossimNitfCscrnaTag_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfCsdidaTag.h b/ossim/include/ossim/support_data/ossimNitfCsdidaTag.h
deleted file mode 100644
index d748ed2..0000000
--- a/ossim/include/ossim/support_data/ossimNitfCsdidaTag.h
+++ /dev/null
@@ -1,210 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CSDIDA tag class declaration.
-//
-// Dataset Indentification TRE.
-//
-// See document STDI-0006-NCDRD Table 3.3-14 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimNitfCsdidaTag_HEADER
-#define ossimNitfCsdidaTag_HEADER 1
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfCsdidaTag : public ossimNitfRegisteredTag
-{
-public:
-   /** @brief default constructor */
-   ossimNitfCsdidaTag();
-
-   /** @brief destructor */
-   virtual ~ossimNitfCsdidaTag();
-
-   /** @brief Method to parse data from stream. */
-   virtual void parseStream(std::istream& in);
-
-   /** @brief Method to write data to stream. */
-   virtual void writeStream(std::ostream& out);
-
-   /** @brief Method to clear all fields including null terminating. */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;
-   
-protected:
-
-   /**
-    * FIELD: DAY
-    * 
-    * 2 byte field BCS-N
-    *
-    * 01 TO 31 (UTC)
-    */
-   char theDay[3];
-
-   /**
-    * FIELD: MONTH
-    *
-    * 3 byte field BCS-A
-    *
-    * JAN to DEC (UTC)
-    */
-   char theMonth[4];
-
-
-   /**
-    * FIELD: YEAR
-    *
-    * 4 byte field BCS-N
-    * 
-    * 0000 to 9999 (UTC)
-    */
-   char theYear[5];
-
-   /**
-    * FIELD: PLATFORM CODE
-    *
-    * 2 byte field BCS-A
-    * 
-    * QB, IK, OV, WV ...
-    */
-   char thePlatformCode[3];
-
-   /**
-    * FIELD: VEHICLE ID
-    *
-    * 2 byte field BCS-N
-    * 
-    * 00 TO 99
-    */
-   char theVehicleId[3];
-
-   /**
-    * FIELD: PASS
-    *
-    * 2 byte field BCS-N
-    * 
-    * 01 to 99
-    */
-   char thePass[3];
-
-   /**
-    * FIELD: OPERATION
-    *
-    * 3 byte field BCS-N
-    * 
-    * 001 to 999
-    */
-   char theOperation[4];
-
-   /**
-    * FIELD: SENSOR_ID
-    * 
-    * 2 byte field BCS-A
-    * 
-    * AA = pan only, GA = multispectral and pan sharpened only, NA =
-    * panchroomatic & multispectral together.
-    */
-   char theSensorId[3];
-
-   /**
-    * FIELD: PRODUCT_ID
-    *
-    * 2 byte field BCS-A
-    * 
-    * See table 2.1-7 
-    */
-   char theProductId[3];
-
-   /**
-    * FIELD: Reserved
-    * 
-    * 4 bytes BCS-A
-    *
-    * fill "00  "
-    */
-   char theReservedField1[5];
-
-   /**
-    * FIELD: TIME
-    *
-    * 14 byte field BCS-N
-    * 
-    * Image start time (UTC) YYYYMMDDhhmmss Corresponds to ACQUISITION_DATE
-    * in STDI-0002
-    */
-   char theTime[15];
-
-   /**
-    * FIELD: PROCESS_TIME
-    *
-    * 14 byte field BCS-N
-    * 
-    * Image start time (UTC) YYYYMMDDhhmmss
-    */
-   char theProcessTime[15];
-
-   /** FIELD: Reserved
-    *
-    * 2 bytes BCS-N
-    * 
-    * Fill "00"
-    */
-   char theReservedField2[3];
-
-   /**
-    * FIELD: Reserved
-    *
-    * 2 bytes BCS-N 
-    *
-    * Fill "01"
-    */
-   char theReservedField3[3];
-
-   /**
-    * FIELD: Reserved
-    *
-    * 1 byte BCS-A
-    *
-    * Fill "N"
-    */
-   char theReservedField4[1];
-
-   /**
-    * FIELD: Reserved
-    *
-    * 1 byte BCS-A
-    *
-    * BCS-A "N"
-    */
-   char theReservedField5[1];
-
-   /**
-    * FIELD: SOFTWARE_VERSION_NUMBER
-    *
-    * 10 byte field BCS-A
-    * 
-    * Software version used.
-    */
-   char theSoftwareVersionNumber[11]; 
-   
-TYPE_DATA   
-};
-
-#endif /* matches #ifndef ossimNitfCsdidaTag_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfCsexraTag.h b/ossim/include/ossim/support_data/ossimNitfCsexraTag.h
deleted file mode 100644
index 6d8883a..0000000
--- a/ossim/include/ossim/support_data/ossimNitfCsexraTag.h
+++ /dev/null
@@ -1,478 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CSEXRA tag class declaration.
-//
-// Exploitation Reference Data TRE.
-//
-// See document STDI-0006-NCDRD Table 3.5-16 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimNitfCsexraTag_HEADER
-#define ossimNitfCsexraTag_HEADER 1
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfCsexraTag : public ossimNitfRegisteredTag
-{
-public:
-   /** @brief default constructor */
-   ossimNitfCsexraTag();
-
-   /** @brief destructor */
-   virtual ~ossimNitfCsexraTag();
-
-   /** @brief Method to parse data from stream. */
-   virtual void parseStream(std::istream& in);
-
-   /** @brief Method to write data to stream. */
-   virtual void writeStream(std::ostream& out);
-
-   /** @brief Method to clear all fields including null terminating. */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;
-   
-   /**
-    * @brief Get the SENSOR field.
-    * @return The SENSOR field as a string.
-    */
-   ossimString getSensor() const;
-   
-   /**
-    * @brief Get the TIME_FIRST_LINE_IMAGE field.
-    * @return The TIME_FIRST_LINE_IMAGE field as a string.
-    */
-   ossimString getTimeFirstLineImage() const;
-   
-   /**
-    * @brief Get the TIME_IMAGE_DURATION field.
-    * @return The TIME_IMAGE_DURATION field as a string.
-    */
-   ossimString getTimeImageDuration() const;
-   
-   /**
-    * @brief Get the MAX_GSDfield.
-    * @return The MAX_GSD field as a string.
-    */
-   ossimString getMaxGsd() const;
-   
-   /**
-    * @brief Get the ALONG_SCAN_GSD field.
-    * @return The ALONG_SCAN_GSD field as a string.
-    */
-   ossimString getAlongScanGsd() const;
-   
-   /**
-    * @brief Get the CROSS_SCAN_GSD field.
-    * @return TheCROSS_SCAN_GSD field as a string.
-    */
-   ossimString getCrossScanGsd() const;
-   
-   /**
-    * @brief Get the GEO_MEAN_GSD field.
-    * @return The GEO_MEAN_GSD field as a string.
-    */
-   ossimString getGeoMeanGsd() const;
-   
-   /**
-    * @brief Get the A_S_VERT_GSD field.
-    * @return The A_S_VERT_GSD field as a string.
-    */
-   ossimString getAlongScanVerticalGsd() const;
-   
-   /**
-    * @brief Get the C_S_VERT_GSD field.
-    * @return The C_S_VERT_GSD field as a string.
-    */
-   ossimString getCrossScanVerticalGsd() const;
-
-   /**
-    * @brief Get the GEO_MEAN_VERT_GSD field.
-    * @return The GEO_MEAN_VERT_GSD field as a string.
-    */
-   ossimString getGeoMeanVerticalGsd() const;
-   
-   /**
-    * @brief Get the GEO_BETA_ANGLEfield.
-    * @return The GEO_BETA_ANGLE field as a string.
-    */
-   ossimString getGeoBetaAngle() const;
-
-   /**
-    * @brief Get the DYNAMIC_RANGE field.
-    * @return The DYNAMIC_RANGE field as a string.
-    */
-   ossimString getDynamicRange() const;
-   
-   /**
-    * @brief Get the NUM_LINES field.
-    * @return The NUM_LINES field as a string.
-    */
-   ossimString getNumLines() const;
-   
-   
-   /**
-    * @brief Get the NUM_SAMPLES field.
-    * @return The NUM_SAMPLES field as a string.
-    */
-   ossimString getNumSamples() const;
-   
-   /**
-    * @brief Get the ANGLE_TO_NORTH field.
-    * @return The ANGLE_TO_NORTH field as a string.
-    */
-   ossimString getAngleToNorth() const;
-   
-   /**
-    * @brief Get the OBLIQUITY_ANGLE field.
-    * @return The OBLIQUITY_ANGLE field as a string.
-    */
-   ossimString getObliquityAngle() const;
-
-   /**
-    * @brief Get the AZ_OF_OBLIQUITY field.
-    * @return The AZ_OF_OBLIQUITY field as a string.
-    */
-   ossimString getAzimuthOfObliquity() const;
-   
-   /**
-    * @brief Get the GRD_COVER field.
-    * @return The GRD_COVER field as a string.
-    */
-   ossimString getGroundCover() const;
-
-   /**
-    * @brief Get the SNOW_DEPTH_CAT field.
-    * @return The SNOW_DEPTH_CAT field as a string.
-    */
-   ossimString getSnowDepth() const;
-   
-   /**
-    * @brief Get the SUN_AZIMUTH field.
-    * @return The SUN_AZIMUTH field as a string.
-    */
-   ossimString getSunAzimuth() const;
-
-   /**
-    * @brief Get the SUN_ELEVATION field.
-    * @return The SUN_ELEVATION field as a string.
-    */
-   ossimString getSunElevation() const;
-
-   /**
-    * @brief Get the PREDICTED_NIIRS field.
-    * @return The PREDICTED_NIIRS field as a string.
-    */
-   ossimString getPredictedNiirs() const;
-   
-   /**
-    * @brief Get the CIRCL_ERR field.
-    * @return The CIRCL_ERR field as a string.
-    */
-   ossimString getCE90() const;
-
-   /**
-    * @brief Get the LINEAR_ERR field.
-    * @return The LINEAR_ERR field as a string.
-    */
-   ossimString getLE90() const;
-
-protected:
-
-   /**
-    * FIELD: SENSOR
-    * 
-    * 6 byte field BCS-A
-    *
-    * PAN MS
-    */
-   char theSensor[7];
-
-   /**
-    * FIELD: TIME_FIRST_LINE_IMAGE
-    *
-    * 12 byte field BCS-N Seconds (UTC)
-    *
-    * Time in seconds from midnight for the first line, synthetic array,
-    * of the Dataset collection.
-    * 
-    * 00000.000000 to 86400.000000
-    */
-   char theTileFirstLine[13];
-
-   /**
-    * FIELD: TIME_IMAGE_DURATION
-    *
-    * 12 byte field BCS-N Seconds (UTC)
-    *
-    * Time Difference in seconds between the first line, synthetic array,
-    * and the last line, synthetic array.
-    * 
-    * 00000.000000 to 86400.000000
-    */
-   char theImageTimeDuration[13];
-
-   /**
-    * FIELD: MAX_GSD
-    *
-    * 5 byte field BCS-N inches
-    *
-    * Predicted maximum mean ground sample distance (GSD)for the primary
-    * target.
-    *
-    * 000.0 to 999.9
-    */
-   char theMaxGsd[6];
-
-   /**
-    * FIELD: ALONG_SCAN_GSD
-    *
-    * 5 byte field BCS-A inches
-    *
-    * Measured along scan GSD for the primary target.
-    *
-    * 000.0 to 999.9 or N/A
-    */
-   char theAlongScanGsd[6];
-
-   /**
-    * FIELD: CROSS_SCAN_GSD
-    *
-    * 5 byte field BCS-A inches
-    *
-    * Measured cross scan GSD for the primary target.
-    *
-    * 000.0 to 999.9 or N/A
-    */
-   char theCrossScanGsd[6];
-
-   /**
-    * FIELD: GEO_MEAN_GSD
-    *
-    * 5 byte field BCS-A inches
-    *
-    * Measured mean GSD for the primary target.
-    *
-    * 000.0 to 999.9 or N/A
-    */
-   char theGeoMeanGsd[6];
-
-   /**
-    * FIELD: A_S_VERT_GSD
-    *
-    * 5 byte field BCS-A inches
-    *
-    * Measured along scan vertical GSD for the primary target.
-    *
-    * 000.0 to 999.9 or N/A
-    */
-   char theAlongScanVertGsd[6];
-
-   /**
-    * FIELD: C_S_VERT_GSD
-    *
-    * 5 byte field BCS-A inches
-    *
-    * Measured cross scan vertical GSD for the primary target.
-    *
-    * 000.0 to 999.9 or N/A
-    */
-   char theCrossScanVertGsd[6];
-
-   /**
-    * FIELD: GEO_MEAN_VERT_GSD
-    *
-    * 5 byte field BCS-A inches
-    *
-    * Measured mean vertical GSD for the primary target.
-    *
-    * 000.0 to 999.9 or N/A
-    */
-   char theGeoMeanVertGsd[6];
-
-   /**
-    * FIELD: GEO_BETA_ANGLE
-    *
-    * 5 byte field BCS-A Degrees
-    *
-    * Angle on ground (Earth tangent plane) between along scan and cross scan
-    * directions.
-    *
-    * 00.0 to 180.0 or N/A
-    */
-   char theGeoBetaAngle[6];
-   
-   /**
-    * FIELD: DYNAMIC_RANGE
-    *
-    * 5 byte field BCS-N
-    *
-    * Dynamic range extent of pixel values in the image.
-    *
-    * 00000 to 02047 for PAN and MS.
-    */
-   char theDynamicRange[6];  
-
-   /**
-    * FIELD: NUM_LINES
-    *
-    * 7 byte field BCS-N
-    *
-    * 0000101 to 9999999
-    */
-   char theLine[8];
-   
-   /**
-    * FIELD: NUM_SAMPLES
-    *
-    * 5 byte field BCS-N
-    *
-    * 00101 to 99999
-    */
-   char theSamples[6];  
-
-   /**
-    * FIELD: ANGLE_TO_NORTH
-    *
-    * 7 byte field BCS-N Degrees
-    *
-    * Angle in degrees measured clockwise from the first row of the image to
-    * true North at image start time.
-    * 
-    * 000.000 to 360.000
-    */
-   char theAngleToNorth[8];
-
-   /**
-    * FIELD: OBLIQUITY_ANGLE
-    *
-    * 6 byte field BCS-N Degrees
-    *
-    * Obliquity angle measured from target local vertical.  I.e., the angle
-    * betweent the local North-Earth-Down (NED) horizontal and the optical
-    * axis of the image at the time of closest approach.
-    * 
-    * 00.000 to 90.000
-    */
-   char theObliquityAngle[7];
-
-   /**
-    * FIELD: AZ_OF_OBLIQUITY
-    *
-    * 7 byte field BCS-N Degrees
-    *
-    * Azimuth of the target-SV line-of-sight vectory projected in the target
-    * local horizontal plane, measured clockwise from True North, computed
-    * at Image Start Time.  The Velocity Control Point on the focal plane
-    * is projected to this azimuth projection in the target local
-    * horizontal plane.
-    * 
-    * 000.000 to 360.000
-    */
-   char theAzOfObliquity[8];
-   
-   /**
-    * FIELD: GRD_COVER
-    *
-    * 1 byte field BCS-N
-    *
-    * Snow or no snow
-    *
-    * 1 = snow, 0 = no snow, 9 = not available.
-    */
-   char theGrdCover[2];
-
-    /**
-    * FIELD: SNOW_DEPTH_CAT
-    *
-    * 1 byte field BCS-N
-    *
-    * Provides the weighted average of the snow depth values for all of
-    * the grids that overlap the tasked image area.
-    *
-    * 0 = 0 inches,
-    * 1 = 1-8 inches or ice,
-    * 2 = 9-17 inches,
-    * 3 = greater than 17 inches
-    * 9 = Not Available
-    */
-   char theSnowDepthCategory[2];
-
-   /**
-    * FIELD: SUN_AZIMUTH   
-    *
-    * 7 byte field BCS-N Degrees
-    *
-    * Azimuth of the target-sun line-of-sight vector projected in the
-    * target local horizontal plane, measured clockwise from True North,
-    * calculated at Image Start Time.
-    * 
-    * 000.000 to 360.000
-    */
-   char theSunAzimuth[8];
-
-   /**
-    * FIELD: SUN_ELEVATION  
-    *
-    * 7 byte field BCS-N Degrees
-    *
-    * The sun elevation angle from the local target plane to the sun
-    * calculated at Image_Start_Time, where the local target plane is
-    * referenced by the Target Centered - Earth Fixed, ST coordinate frame.
-    * 
-    * -90.000 to +90.000
-    */
-   char theSunElevation[8];
-   
-   /**
-    * FIELD: PREDICTED_NIIRS
-    *
-    * 3 byte field BCS-A
-    *
-    * Imagery NIIRS value. 
-    *
-    * 0.0 to 9.0 or N/A
-    */
-   char thePredictedNiirs[4];
-
-   /**
-    * FIELD: CIRCL_ERR
-    *
-    * 3 byte field BCS-N Feet
-    *
-    * Predicted CE/90 in the geolocation in the scene.
-    *
-    * 000 to 999
-    */
-   char theCircularError[4];
-
-   /**
-    * FIELD: LINEAR_ERR
-    *
-    * 3 byte field BCS-N Feet
-    *
-    * Predicted LE/90 in the geolocation in the scene
-    *
-    * 000 to 999
-    */
-   char theLinearError[4];
-   
-TYPE_DATA   
-};
-
-#endif /* matches #ifndef ossimNitfCsexraTag_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h b/ossim/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h
deleted file mode 100644
index 1e8e22b..0000000
--- a/ossim/include/ossim/support_data/ossimNitfEmbeddedRpfDes.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfEmbeddedRpfDes.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfEmbeddedRpfDes_HEADER
-#define ossimNitfEmbeddedRpfDes_HEADER 1
-
-#include <iosfwd>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-class ossimNitfFileHeader;
-
-class OSSIMDLLEXPORT ossimNitfEmbeddedRpfDes : public ossimNitfRegisteredTag
-{
-public:
-   ossimNitfEmbeddedRpfDes();
-   
-   virtual void parseStream(std::istream &in);
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-protected:
-   virtual ~ossimNitfEmbeddedRpfDes();
-
-TYPE_DATA
-private:
-
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfEngrdaTag.h b/ossim/include/ossim/support_data/ossimNitfEngrdaTag.h
deleted file mode 100644
index d2d9758..0000000
--- a/ossim/include/ossim/support_data/ossimNitfEngrdaTag.h
+++ /dev/null
@@ -1,149 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ENGRDA - Engineering Data tag class declaration.
-//
-// See document STDI-0002 (version 3), Appendix N for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimNitfEngrdaTag_HEADER
-#define ossimNitfEngrdaTag_HEADER 1
-
-#include <string>
-#include <vector>
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfEngrdaTag : public ossimNitfRegisteredTag
-{
-public:
-
-   enum 
-   {
-      RESRC_SIZE   = 20,
-      RECNT_SIZE   = 3,
-      ENGLN_SIZE   = 2,
-      ENGMTXC_SIZE = 4,
-      ENGMTXR_SIZE = 4,
-      ENGTYP_SIZE  = 1,
-      ENGDTS_SIZE  = 1,
-      ENGDATU_SIZE = 2,
-      ENGDATC_SIZE = 8,
-      TMP_BUF_SIZE = 128
-   };
-   
-   /** @brief default constructor */
-   ossimNitfEngrdaTag();
-
-   /** @brief destructor */
-   virtual ~ossimNitfEngrdaTag();
-
-   /** @brief Method to parse data from stream. */
-   virtual void parseStream(std::istream& in);
-
-   /** @brief Method to write data to stream. */
-   virtual void writeStream(std::ostream& out);
-
-   /** @brief Method to clear all fields including null terminating. */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-protected:
-
-   /** @brief Container class for an Engineering Data Element Record. */
-   class ossimEngDataElement
-   {
-   public:
-      /** ENGLBL - label */
-      std::string theEngLbl;
-
-      /** ENGMTXC - column count */
-      ossim_uint16 theEngMtxC;
-
-      /** ENGMTXR - row count */
-      ossim_uint16 theEngMtxR;
-
-      /** ENGTYP - data type */
-      ossim_int8  theEngTyp;
-
-      /** ENGDTS - data size in bytes */
-      ossim_uint8 theEngDts;
-
-      /** ENGDATU - units */
-      std::string theEngDatU;
-
-      /** ENGDATA - data */
-      std::vector<ossim_uint8> theEngDat;
-   };
-
-   /**
-    * @brief Method to print out a ossimEngDataElement object.
-    * @param out Stream to print to.
-    * @param element The element to print.
-    * @param elIndex The index of the element array index.
-    * @param prefix  The prefix to add to key.
-    */
-   std::ostream& printData(std::ostream& out,
-                           const ossimEngDataElement& element,
-                           ossim_uint32 elIndex,
-                           const std::string& prefix) const;
-
-   /**
-    * @brief Method to convert value to a string, padding with zero's,
-    * left justified.
-    * @param v The value to convert.
-    * @param w The width of the string field.
-    * @param s The string to stuff.
-    */
-   template <class T> void getValueAsString(T v,
-                                            ossim_uint16 w,
-                                            std::string& s) const;
-
-   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
-   
-   /**
-    * FIELD: RESRC
-    *
-    * TYPE: R
-    * 
-    * 20 byte field
-    *
-    * Unique Source System Name.
-    */
-   char theReSrc[RESRC_SIZE+1];
-   
-   /**
-    * FIELD: RECNT
-    *
-    * TYPE: R
-    * 
-    * 20 byte field
-    *
-    * Unique Source System Name.
-    */
-   char theReCnt[RECNT_SIZE+1];
-
-   std::vector<ossimEngDataElement> theData;
-
-   ossim_uint32 theTreLength;
-   
-TYPE_DATA   
-};
-
-#endif /* matches #ifndef ossimNitfEngrdaTag_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfFile.h b/ossim/include/ossim/support_data/ossimNitfFile.h
deleted file mode 100644
index fee4a9d..0000000
--- a/ossim/include/ossim/support_data/ossimNitfFile.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFile.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfFile_HEADER
-#define ossimNitfFile_HEADER
-
-#include <iosfwd>
-#include <vector>
-
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-
-class ossimNitfImageHeader;
-class ossimNitfSymbolHeader;
-class ossimNitfLabelHeader;
-class ossimNitfTextHeader;
-class ossimNitfDataExtensionSegment;
-class ossimFilename;
-class ossimNitfRegisteredTag;
-class ossimNitfTagInformation;
-
-class OSSIMDLLEXPORT ossimNitfFile : public ossimReferenced
-{
-public:
-   friend OSSIMDLLEXPORT std::ostream& operator <<(std::ostream& out,
-                                                   const ossimNitfFile &data);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out Stream to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @param printOverviews If true overview, if present(e.g. rpf's) will be
-    * printed.
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string(),
-                       bool printOverviews=false) const;
-   
-   ossimNitfFile();
-   virtual ~ossimNitfFile();
-
-   /*!
-    *  Opens the nitf file and attempts to parse.
-    *  Returns true on success, false on error.
-    */
-   bool parseFile(const ossimFilename &file);
-
-   /*!
-    * Will return the header.
-    */
-   const ossimNitfFileHeader* getHeader()const;
-   ossimNitfFileHeader* getHeader();
-   ossimIrect getImageRect()const;
-   
-   ossimNitfImageHeader*  getNewImageHeader(ossim_uint32 imageNumber)const;
-   ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber)const;
-   ossimNitfLabelHeader*  getNewLabelHeader(ossim_uint32 labelNumber)const;
-   ossimNitfTextHeader*   getNewTextHeader(ossim_uint32 textNumber)const;
-   ossimNitfDataExtensionSegment* getNewDataExtensionSegment(ossim_uint32 dataExtNumber)const;
-   
-   ossimString getVersion()const;
-
-   /** @return The filename parsed by this object. */
-   ossimFilename getFilename() const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix)const;
-
-protected:
-   ossimNitfImageHeader* allocateImageHeader()const;
-   
-   ossimFilename                    theFilename;
-   ossimRefPtr<ossimNitfFileHeader> theNitfFileHeader;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfFileHeader.h b/ossim/include/ossim/support_data/ossimNitfFileHeader.h
deleted file mode 100644
index cd5dbaa..0000000
--- a/ossim/include/ossim/support_data/ossimNitfFileHeader.h
+++ /dev/null
@@ -1,220 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFileHeader.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfFileHeader_HEADER
-#define ossimNitfFileHeader_HEADER
-
-#include <iosfwd>
-#include <vector>
-#include <iterator>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimPropertyInterface.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/support_data/ossimNitfTagInformation.h>
-
-class ossimNitfImageHeader;
-class ossimNitfSymbolHeader;
-class ossimNitfTextHeader;
-class ossimNitfLabelHeader;
-class ossimNitfRegisteredTag;
-class ossimNitfDataExtensionSegment;
-// These structures are just data holders and will
-// not be used directly by outside users.  This is for internal use
-//
-class OSSIM_DLL ossimNitfImageOffsetInformation : public ossimObject
-{
-public:
-   virtual std::ostream& print(std::ostream& out) const;
-
-   ossimNitfImageOffsetInformation(ossim_uint64 headerOffset,
-                                   ossim_uint64 dataOffset)
-      :theImageHeaderOffset(headerOffset),
-       theImageDataOffset(dataOffset)
-      {
-      }
-   
-   ossim_uint64 theImageHeaderOffset;
-   ossim_uint64 theImageDataOffset;
-};
-
-
-class OSSIMDLLEXPORT ossimNitfSymbolOffsetInformation : public ossimObject
-{
-public:
-   ossimNitfSymbolOffsetInformation(ossim_uint64 headerOffset,
-                                    ossim_uint64 dataOffset)
-      :theSymbolHeaderOffset(headerOffset),
-       theSymbolDataOffset(dataOffset)
-      {
-      }
-   
-   ossim_uint64 theSymbolHeaderOffset;
-   ossim_uint64 theSymbolDataOffset;
-};
-
-class OSSIMDLLEXPORT ossimNitfGraphicOffsetInformation : public ossimObject
-{
-public:
-   ossimNitfGraphicOffsetInformation(ossim_uint64 headerOffset,
-                                    ossim_uint64 dataOffset)
-      :theGraphicHeaderOffset(headerOffset),
-       theGraphicDataOffset(dataOffset)
-      {
-      }
-   
-   ossim_uint64 theGraphicHeaderOffset;
-   ossim_uint64 theGraphicDataOffset;
-};
-
-class OSSIMDLLEXPORT ossimNitfLabelOffsetInformation : public ossimObject
-{
-public:
-   ossimNitfLabelOffsetInformation(ossim_uint64 headerOffset,
-                                   ossim_uint64 dataOffset)
-      :theLabelHeaderOffset(headerOffset),
-       theLabelDataOffset(dataOffset)
-      {
-      }
-   
-   ossim_uint64 theLabelHeaderOffset;
-   ossim_uint64 theLabelDataOffset;
-};
-
-class OSSIMDLLEXPORT ossimNitfTextOffsetInformation : public ossimObject
-{
-public:
-   ossimNitfTextOffsetInformation(ossim_uint64 headerOffset,
-                                  ossim_uint64 dataOffset)
-      :theTextHeaderOffset(headerOffset),
-       theTextDataOffset(dataOffset)
-      {
-      }
-   
-   ossim_uint64 theTextHeaderOffset;
-   ossim_uint64 theTextDataOffset;
-   
-};
-
-class OSSIMDLLEXPORT ossimNitfDataExtSegOffsetInformation : public ossimObject
-{
-public:
-   ossimNitfDataExtSegOffsetInformation(ossim_uint64 headerOffset,
-                                        ossim_uint64 dataOffset)
-      :theDataExtSegHeaderOffset(headerOffset),
-       theDataExtSegDataOffset(dataOffset)
-      {
-      }
-   
-   ossim_uint64 theDataExtSegHeaderOffset;
-   ossim_uint64 theDataExtSegDataOffset;   
-};
-
-class OSSIM_DLL ossimNitfFileHeader : public ossimObject,
-                                      public ossimPropertyInterface
-{
-public:
-   friend class ossimNitfFile;
-
-   ossimNitfFileHeader();
-   virtual ~ossimNitfFileHeader();
-
-   virtual void parseStream(std::istream &in)= 0;
-   virtual void writeStream(std::ostream &out)=0;
-   
-   virtual bool isEncrypted()const=0;
-   virtual ossim_int32 getNumberOfImages()const=0;
-   virtual ossim_int32 getNumberOfLabels()const=0;
-   virtual ossim_int32 getNumberOfSymbols()const=0;
-   virtual ossim_int32 getNumberOfGraphics()const=0;
-   virtual ossim_int32 getNumberOfTextSegments()const=0;
-   virtual ossim_int32 getNumberOfDataExtSegments()const=0;
-   virtual ossim_int32 getNumberOfReservedExtSegments()const=0;
-   virtual ossim_int32 getHeaderSize()const=0;
-   
-   void addTag(const ossimNitfTagInformation& tag, bool unique=true);
-   virtual void removeTag(const ossimString& tagName);
-   virtual bool  getTagInformation(ossimNitfTagInformation& tag,
-                                   int idx)const;
-
-   virtual int getNumberOfTags()const;
-
-   virtual bool getTag(ossimNitfTagInformation& tagInfo,
-                       const ossimString& tagName)const;
-   
-   virtual ossim_int64 getFileSize()const=0;
-   virtual const char* getVersion()const=0;
-   virtual const char* getDateTime()const=0;
-   virtual ossimDrect getImageRect()const=0;
-   virtual ossimString getSecurityClassification()const=0;
-   
-   bool hasImages()const;
-   bool hasSymbols()const;
-   bool hasGraphics()const;
-   bool hasText()const;
-   bool hasLabels()const;
-   bool hasDataExtSegments()const;
-
-   virtual ossimNitfImageHeader* getNewImageHeader(ossim_uint32 imageNumber,
-                                                   std::istream& in)const=0;
-   virtual ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber,
-                                                    std::istream& in)const=0;
-   virtual ossimNitfLabelHeader* getNewLabelHeader(ossim_uint32 labelNumber,
-                                                   std::istream& in)const=0;
-   virtual ossimNitfTextHeader* getNewTextHeader(ossim_uint32 textNumber,
-                                                std::istream& in)const=0;
-   virtual ossimNitfDataExtensionSegment* getNewDataExtensionSegment(
-      ossim_int32 dataExtNumber, std::istream& in)const=0;
-   
-   virtual ossimNitfImageHeader*    allocateImageHeader()const=0;
-   virtual ossimNitfSymbolHeader*   allocateSymbolHeader()const=0;
-   virtual ossimNitfLabelHeader*    allocateLabelHeader()const=0;
-   virtual ossimNitfTextHeader*     allocateTextHeader()const=0;
-   virtual ossimNitfDataExtensionSegment *allocateDataExtSegment()const=0;
-
-   virtual ossim_uint32 getTotalTagLength()const;
-
-   /** @brief Sets file length (FL) field. */
-   virtual void setFileLength(ossim_uint64 fileLength) = 0;
-
-   /** @brief Sets header length (HL) field. */
-   virtual void setHeaderLength(ossim_uint64 headerLength) = 0;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-   /**
-    * @brief print tags method that outputs a key/value type format adding
-    * prefix to keys.
-    */
-   virtual std::ostream& printTags(
-      std::ostream& out,
-      const std::string& prefix=std::string()) const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-   
-protected:
-   std::vector<ossimNitfTagInformation> theTagList;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_0.h b/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_0.h
deleted file mode 100644
index 4691562..0000000
--- a/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_0.h
+++ /dev/null
@@ -1,612 +0,0 @@
-//*******************************************************************
-//
-//  License:  MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFileHeaderV2_0.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfFileHeaderV2_0_HEADER
-#define ossimNitfFileHeaderV2_0_HEADER
-
-#include <iosfwd>
-#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/support_data/ossimNitfTagInformation.h>
-
-class ossimNitfRegisteredTag;
-
-class ossimNitfImageInfoRecordV2_0
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimNitfImageInfoRecordV2_0 &data);
-
-   ossim_uint32 getHeaderLength()const;
-   ossim_uint64 getImageLength()const;
-   ossim_uint64 getTotalLength()const;
-   void setSubheaderLength(ossim_uint32 length);
-   void setImageLength(ossim_uint64 length);
-
-   /*!
-    * Is a 6 byte numeric 0-999999
-    */
-   char theImageSubheaderLength[7];
-
-   /*!
-    * Is a 10 byte numeric 0-999999999
-    */
-   char theImageLength[11];
-};
-
-struct ossimNitfSymbolInfoRecordV2_0
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                               const ossimNitfSymbolInfoRecordV2_0 &data);
-
-   ossim_int32 getHeaderLength()const;
-   ossim_int32 getImageLength()const;
-   ossim_int32 getTotalLength()const;
-   
-   /*!
-    * Is a 4 byte numeric 0-9999
-    */
-   char theSymbolSubheaderLength[5];
-
-   /*!
-    * Is a 6 byte numeric 0-999999
-    */
-   char theSymbolLength[7];
-};
-
-struct ossimNitfLabelInfoRecordV2_0
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                               const ossimNitfLabelInfoRecordV2_0 &data);
-
-   ossim_int32 getHeaderLength()const;
-   ossim_int32 getImageLength()const;
-   ossim_int32 getTotalLength()const;
-   
-   /*!
-    * Is a 4 byte numeric 0-9999
-    */
-   char theLabelSubheaderLength[5];
-
-   /*!
-    * Is a 3 byte numeric 0-320
-    */
-   char theLabelLength[4];
-};
-
-struct ossimNitfTextInfoRecordV2_0
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                               const ossimNitfTextInfoRecordV2_0 &data);
-
-   ossim_int32 getHeaderLength()const;
-   ossim_int32 getImageLength()const;
-   ossim_int32 getTotalLength()const;
-   /*!
-    * Is a 4 byte numeric 0-9999
-    */
-   char theTextSubheaderLength[5];
-
-   /*!
-    * Is a 5 byte numeric 0-99999
-    */
-   char theTextLength[6];
-};
-
-struct ossimNitfDataExtSegInfoRecordV2_0
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                               const ossimNitfDataExtSegInfoRecordV2_0 &data);
-
-   ossim_int32 getHeaderLength()const;
-   ossim_int32 getImageLength()const;
-   ossim_int32 getTotalLength()const;
-   /*!
-    * Is a 4 byte numeric 0-9999
-    */
-   char theDataExtSegSubheaderLength[5];
-
-   /*!
-    * Is a 9 byte numeric 0-999999999
-    */
-   char theDataExtSegLength[10];
-};
-
-struct ossimNitfResExtSegInfoRecordV2_0
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                               const ossimNitfResExtSegInfoRecordV2_0 &data);
-
-   /*!
-    * Is a 4 byte numeric 0-9999
-    */
-   char theResExtSegSubheaderLength[5];
-
-   /*!
-    * Is a 7 byte numeric 0-9999999
-    */
-   char theResExtSegLength[8];
-};
-
-class OSSIMDLLEXPORT ossimNitfFileHeaderV2_0 : public ossimNitfFileHeaderV2_X
-{
-public:
-   
-   ossimNitfFileHeaderV2_0();
-   virtual ~ossimNitfFileHeaderV2_0();
-
-   /**
-    * @brief parse method.
-    * @return This method returns void but will throw an std::exception in
-    * certain instances if the stream goes bad on seeks.
-    */
-   virtual void parseStream(std::istream &in);
-   
-   virtual void writeStream(std::ostream &out);
-   
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-   virtual bool isEncrypted()const;
-   virtual ossim_int32 getNumberOfImages()const;
-   virtual ossim_int32 getNumberOfLabels()const;
-   virtual ossim_int32 getNumberOfSymbols()const;
-   virtual ossim_int32 getNumberOfGraphics()const;
-   virtual ossim_int32 getNumberOfTextSegments()const;
-   virtual ossim_int32 getNumberOfDataExtSegments()const;
-   virtual ossim_int32 getNumberOfReservedExtSegments()const;
-   virtual ossim_int32 getHeaderSize()const;
-   virtual ossim_int64 getFileSize()const;
-   virtual ossimString getSecurityClassification()const;
-   
-   virtual const char* getDateTime()const;
-   virtual const char* getVersion()const;
-
-   virtual ossimDrect getImageRect()const;
-  
-   virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_0& recordInfo);
-   virtual void replaceImageInfoRecord(ossim_uint32 i, const ossimNitfImageInfoRecordV2_0& recordInfo);
-
-   virtual ossimNitfImageHeader*  getNewImageHeader(ossim_uint32 imageNumber,
-                                                    std::istream& in)const;
-   virtual ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber,
-                                                     std::istream& in)const;
-   virtual ossimNitfLabelHeader* getNewLabelHeader(ossim_uint32 labelNumber,
-                                                   std::istream& in)const;
-   virtual ossimNitfTextHeader*   getNewTextHeader(ossim_uint32 textNumber,
-                                                   std::istream& in)const;
-   virtual ossimNitfDataExtensionSegment* getNewDataExtensionSegment(
-      ossim_int32 dataExtNumber, std::istream& in)const;
-   
-   virtual ossimNitfImageHeader*  allocateImageHeader()const;
-   virtual ossimNitfSymbolHeader* allocateSymbolHeader()const;
-   virtual ossimNitfLabelHeader*  allocateLabelHeader()const;
-   virtual ossimNitfTextHeader*   allocateTextHeader()const;
-   virtual ossimNitfDataExtensionSegment *allocateDataExtSegment()const;
-
-   virtual void setCodeWords(const ossimString& codeWords);
-   virtual void setControlAndHandling(const ossimString& controlAndHandling);
-   virtual void setReleasingInstructions(const ossimString& releasingInstructions);
-   virtual void setClassificationAuthority(const ossimString& classAuth);
-   virtual void setSecurityControlNumber(const ossimString& controlNo);
-   virtual void setOriginatorsName(const ossimString& originatorName);
-   virtual void setOriginatorsPhone(const ossimString& origniatorPhone);
-
-   virtual ossimString getCodeWords()const;
-   virtual ossimString getControlAndHandling()const;
-   virtual ossimString getReleasingInstructions()const;
-   virtual ossimString getClassificationAuthority()const;
-   virtual ossimString getSecurityControlNumber()const;
-   virtual ossimString getOriginatorsName()const;
-   virtual ossimString getOriginatorsPhone()const;
-
-   ossimString getComplianceLevel()const;
-   ossimString getSecurityDowngrade()const;
-   ossimString getDowngradingEvent()const;
-
-   void setComplianceLevel(const ossimString& complianceLevel);
-   void setSecurityDowngrade(const ossimString& securityDowngrade);
-   void setDowngradingEvent(const ossimString& downgradeEvent);
-
-   virtual void setFileLength(ossim_uint64 fileLength);
-   virtual void setHeaderLength(ossim_uint64 headerLength);
-   /**
-    * Properties of a NITF 2.0 Header file. See MIL-STD-2500A for details.
-    *
-    * To access these, pass the constant to getProperty().
-    */
-   static const ossimString FSDWNG_KW;
-   static const ossimString FSDEVT_KW;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-TYPE_DATA
-private:
-
-   struct ossimNitfDisplayInfo
-   {
-   public:
-      ossimNitfDisplayInfo(const ossimString &filePartType,
-                           ossim_int32 displayLevel,
-                           ossim_int32 indexIntoList)
-         :theFilePartType(filePartType),
-          theDisplayLevel(displayLevel),
-          theIndex(indexIntoList)
-         {
-         }
-      
-      /*!
-       * Since NITF already has unique ids for the file
-       * part types we will just use them.
-       *
-       *  IM  indicates image part
-       *  LA  indicates a label part
-       *  SY   indicates a symbol part
-       */
-      ossimString theFilePartType;
-
-      /*!
-       * This is the display level of the renderable data.  Note the
-       * display level is like a painters algorithm.  The lowest level
-       * is drawn first followed by the next level.
-       */
-      ossim_int32        theDisplayLevel;
-
-      /*!
-       * This is an index into the array that has all the offsets
-       * pre-computed.
-       */
-      ossim_int32        theIndex;
-      
-   };
-
-   void clearFields();
-   /**
-    * Sets the number of image records in the NITF 2.0 File Header.
-    *
-    * @param num
-    *        The number of image records for the entire NITF 2.0 file.
-    *
-    * @throw std::out_of_range
-    */
-   void setNumberOfImageInfoRecords(ossim_uint64 num);
-   
-  /*!
-    * This method will be used to setup information about the file.
-    * Example: NITF files have display levels where the lowest number is the
-    * back most image and the highes number is the front most image.  We
-    * are not guranteed that they will be in order in the file so we must
-    * parse the file and sort the images.  The images include image data,
-    * symbols and labels.  Each of these are renderable.  The lowest
-    * display level should have the larges rect and this will be used
-    * to send back to the user an image rect.  During rasterization we must
-    * know the order to draw the data.
-    */
-   void precomputeValues();
-   
-   void readImageInfoRecords(std::istream &in);
-   void readSymbolInfoRecords(std::istream &in);
-   void readLabelInfoRecords(std::istream &in);
-   void readTextFileInfoRecords(std::istream &in);
-   void readDataExtSegInfoRecords(std::istream &in);
-   void readResExtSegInfoRecords(std::istream &in);
-   /*!
-    * If the header was parsed this method will initialize the offsets
-    * to whare all data resides within the file.  Example:  NITF files
-    * have several sections (Image, Symbol, Labels, Text and Extended data) and
-    * each of these sections have subsections.  The offsets stored are just offsets
-    * from the start of the file to each major section and eqach subsection.
-    */
-   void initializeAllOffsets();
-
-  /*!
-    * If the header was parsed and the offsets have been initialized, this method will
-    * parse all overflow tags and put them into theTagList.
-    */
-   void readOverflowTags(std::istream& in);
-
-   /*!
-    * This method will be called after the header is read
-    * in and the offsets have been initialized.  It will
-    * sort in order all renderable data based on their
-    * display level.
-    */
-   void initializeDisplayLevels(std::istream& in);
-
-   void insertIntoDisplayInfoList(const ossimNitfDisplayInfo &displayInformation);
-
-   
-   /*!
-    * This is the current file we are operating on.
-    */
-   ossimFilename theFilename;
-   
-   /*!
-    * This will be pre-computed when the header file is opened.  This is computed
-    * after we have found the display order.  We will use the rectangle of the
-    * smallest display number.
-    */
-   ossimDrect theImageRect;
-   
-   /*!
-    * This will hold some pre-computed information about the display
-    * order of the images.  It will be populated by scanning the
-    * file and sorting display levels.
-    */
-   std::vector<ossimNitfDisplayInfo>             theDisplayInformationList;
-   
-   /*!
-    * This will hold pre-computed offsets to the start of all image headers
-    * and start to their data.
-    */
-   std::vector<ossimNitfImageOffsetInformation>  theImageOffsetList;
-
-   /*!
-    * This will hold pre-computed offsets to the start of all symbol headers
-    * and start to their data.
-    */
-   std::vector<ossimNitfSymbolOffsetInformation> theSymbolOffsetList;
-
-   /*!
-    * This will hold pre-computed offsets to the start of all Label headers
-    * and start to their data.
-    */
-   std::vector<ossimNitfLabelOffsetInformation>  theLabelOffsetList;
-
-   /*!
-    * This will hold pre-computed offsets to the start of all text headers
-    * and start to their data.
-    */
-   std::vector<ossimNitfTextOffsetInformation>   theTextOffsetList;
-
-   /*!
-    * This will hold pre-coputed offsets to the start of all the data
-    * extension segments.
-    */
-   std::vector<ossimNitfDataExtSegOffsetInformation> theDataExtSegOffsetList;
-
-
-
-   
-   // Note: these are work variables and not part of the
-   // ossimNitf header.  These variables will be used to quickly
-   // access various parts of the file.
-   /*!
-    * This is not part of the NITF file header.  This will be
-    * computed since somethimes the header size will not be
-    * given in the header field.  This value will hold a count of
-    * all the bytes read for the header portion.  This can be used
-    * to skip past the header data.
-    */
-   ossim_int32 theHeaderSize;
-   
-   /*!
-    * FSCODE: This is a 40 byte Alphanumeric field
-    */
-   char theCodewords[41]; 
-
-   /*!
-    * FSCTLH: This is a 40 byte Alphanumeric field.
-    */
-   char theControlAndHandling[41]; 
-
-   /*!
-    * FSREL: This is a 40 byte Alphanumeric field.
-    */
-   char theReleasingInstructions[41]; 
-
-   /*!
-    * FSCAUT: This is a 20 byte alphanumeric field.
-    */ 
-   char theClassificationAuthority[21];
-
-   /*!
-    * FSCTLN: This is a 20 byte Alphanumeric field.
-    */
-   char theSecurityControlNumber[21]; 
-
-   /*!
-    * FSDWNG:
-    *
-    * This is a 6 byte Alphanumeric.  If this field
-    * is not blank then it will have the form:
-    *
-    *   YYMMDD
-    *
-    *   Where YY is the last 2 chars of the year and will be
-    *            00 to 59 represents 2000 to 2059
-    *            60 to 99 represents 1960 to 1999
-    *
-    *
-    *   if the field is 999999 then the Originating agency field
-    *   is required. If te field is 999998 then the downgrade event
-    *   is required
-    */
-   char theSecurityDowngrade[7];
-
-   /**
-    * FSDEVT:
-    * This is a conditional field and is a 40 byte
-    * Alphanumeric field.  This field exists if the
-    * security downgrade is 999998.
-    */
-   char theDowngradingEvent[41];
-
-   /**
-    * ONAME:
-    *
-    * This is a 27 byte Alphanumeric number
-    */
-   char theOriginatorsName[28];
-
-   /*!
-    * OPHONE:
-    * This is an 18 byte Alphanumeric value. 
-    */
-   char theOriginatorsPhone[19]; 
-
-   /*!
-    * FL:
-    *
-    * This is a required field.
-    *
-    * Is a 12 byte number of the form
-    * 000000000388-999999999998 indicates the
-    * file length and a value of 999999999999
-    * indicates that the file length was not
-    * available.
-    */
-   char theFileLength[13];
-
-   /**
-    * HL:
-    *
-    * This is a reqired field.
-    *
-    * Will hold the header length. The values
-    * range up to 999998 and a value of
-    * 999999 indicates that the length of the
-    * header was not available upon creation.
-    */
-   char theHeaderLength[7];
-
-   /**
-    * NUMI:
-    *
-    * This is a 3 byte field that specifies the number
-    * of images in the file.  0-999
-    */
-   char theNumberOfImageInfoRecords[4];
-
-   /*!
-    * This information is conditional on the number of image
-    * info records field.  If the field is greater than 0 then
-    * the record information is read in up to the indicated number
-    */
-   std::vector<ossimNitfImageInfoRecordV2_0> theNitfImageInfoRecords;
-
-   /*!
-    * This is a 3 byte numeric 0-999.
-    */
-
-   char theNumberOfSymbolInfoRecords[4];
-   /*!
-    * This information is conditional on the number of symbol
-    * info records field.  If the field is greater than 0 then
-    * the record information is read in up to the indicated number
-    */
-   std::vector<ossimNitfSymbolInfoRecordV2_0> theNitfSymbolInfoRecords;
-
-   /**
-    * NUML
-    *
-    * This is a 3 byte numeric 0-999.
-    */
-
-   char theNumberOfLabelInfoRecords[4];
-   
-   /*!
-    * This information is conditional on the number of label
-    * info records field.  If the field is greater than 0 then
-    * the record information is read in up to the indicated number
-    */
-   std::vector<ossimNitfLabelInfoRecordV2_0> theNitfLabelInfoRecords;
-
-   /**
-    * NUMT:
-    *
-    * This is a 3 byte numeric 0-999.
-    */
-   char theNumberOfTextFileInfoRecords[4];
-
-   /*!
-    * This information is conditional on the number of text file
-    * info records field.  If the field is greater than 0 then
-    * the record information is read in up to the indicated number
-    */
-   std::vector<ossimNitfTextInfoRecordV2_0> theNitfTextInfoRecords;
-
-   /**
-    * NUMDES:
-    *
-    * This is a 3 byte numeric 0-999.
-    */
-   char theNumberOfDataExtSegInfoRecords[4];
-
-   /*!
-    * This information is conditional on the number of 
-    * info records field.  If the field is greater than 0 then
-    * the record information is read in up to the indicated number
-    */
-   std::vector<ossimNitfDataExtSegInfoRecordV2_0> theNitfDataExtSegInfoRecords;
-
-   /**
-    * NUMRES:
-    *
-    * This is a 3 byte numeric 0-999. Reserved Extension Segments
-    */
-   char theNumberOfResExtSegInfoRecords[4];
-
-   /*!
-    * This information is conditional on the number of Res Ext Seg
-    * info records field.  If the field is greater than 0 then
-    * the record information is read in up to the indicated number
-    */
-   std::vector<ossimNitfResExtSegInfoRecordV2_0> theNitfResExtSegInfoRecords;
-
-   /**
-    * UDHDL:
-    * 
-    * This is a required field and is a 5 byte numeric ranging
-    * from 0-99999.  This is 0 if there is no data.
-    */
-   char theUserDefinedHeaderDataLength[6];
-
-   /*!
-    * This is a conditional field.  It will exist if the
-    * user defined header length is not 0.  If it exists
-    * then it may contain an overflow into one of the data
-    * extension segments above and will hold the number of that
-    * segment.
-    */
-   char theUserDefinedHeaderOverflow[4];
-
-   /**
-    * XHDL:
-    *
-    * This is a required field.  It is 5 bytes long and
-    * ranges from 0-99999.  0 means there is no data
-    */
-   char theExtendedHeaderDataLength[6];
-
-   /*!
-    * This is a required field.  It is 5 bytes long and
-    * ranges from 0-99999.  0 means there is no data
-    */
-   char theExtendedHeaderOverflow[4];
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_1.h b/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_1.h
deleted file mode 100644
index eb581cf..0000000
--- a/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_1.h
+++ /dev/null
@@ -1,641 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFileHeaderV2_1.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfFileHeaderV2_1_HEADER
-#define ossimNitfFileHeaderV2_1_HEADER
-
-#include <iosfwd>
-
-#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
-#include <ossim/base/ossimDate.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-class OSSIMDLLEXPORT ossimNitfImageInfoRecordV2_1
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimNitfImageInfoRecordV2_1 &data);
-   
-   ossim_uint64 getHeaderLength()const;
-   ossim_uint64 getImageLength()const;
-   ossim_uint64 getTotalLength()const;
-   
-   void setSubheaderLength(ossim_uint32 length);
-   void setImageLength(ossim_uint64 length);
-   
-   /**
-    * Is a 6 byte numeric 000439-999999
-    */
-   char theImageSubheaderLength[7];
-   
-   /**
-    * Is a 10 byte numeric 0000000001-9999999999
-    */
-   char theImageLength[11];
-};
-
-
-struct ossimNitfGraphicInfoRecordV2_1
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimNitfGraphicInfoRecordV2_1 &data);
-   
-   ossim_uint64 getHeaderLength()const;
-   ossim_uint64 getGraphicLength()const;
-   ossim_uint64 getTotalLength()const;
-   /**
-    * Is a 4 byte numeric 0258-9999
-    */
-   char theGraphicSubheaderLength[5];
-   
-   /**
-    * Is a 6 byte numeric 0000001-9999999
-    */
-   char theGraphicLength[7];
-};
-
-
-class OSSIMDLLEXPORT ossimNitfTextFileInfoRecordV2_1
-{
-public:
-   friend std::ostream& operator<<(std::ostream& out,
-                                   const ossimNitfTextFileInfoRecordV2_1 &data);
-
-
-   ossim_uint64 getHeaderLength()const;
-   ossim_uint64 getTextLength()const;
-   ossim_uint64 getTotalLength()const;
-
-   void setSubheaderLength(ossim_uint64 length);
-   void setTextLength(ossim_uint64 length);
-   
-   /**
-    * Is a 4 byte numeric 0282-9999
-    */
-   char theTextFileSubheaderLength[5];
-
-   /**
-    * Is a 5 byte numeric 0-99999
-    */
-   char theTextFileLength[6];
-};
-
-struct ossimNitfDataExtSegInfoRecordV2_1
-{
-public:
-   friend std::ostream& operator<<(std::ostream& out,
-                                   const ossimNitfDataExtSegInfoRecordV2_1 &data);
-
-   ossim_uint64 getHeaderLength()const;
-   ossim_uint64 getDataExtSegLength()const;
-   ossim_uint64 getTotalLength()const;
-   /**
-    * Is a 4 byte numeric 200-9999
-    */
-   char theDataExtSegSubheaderLength[5];
-
-   /**
-    * Is a 9 byte numeric 0-999999999
-    */
-   char theDataExtSegLength[10];
-};
-
-struct ossimNitfResExtSegInfoRecordV2_1
-{
-public:
-   friend std::ostream& operator<<(std::ostream& out,
-                                   const ossimNitfResExtSegInfoRecordV2_1 &data);
-
-   ossim_uint64 getHeaderLength()const;
-   ossim_uint64 getResExtSegLength()const;
-   ossim_uint64 getTotalLength()const;
-  /**
-    * Is a 4 byte numeric 0-9999
-    */
-   char theResExtSegSubheaderLength[5];
-
-   /**
-    * Is a 7 byte numeric 0-9999999
-    */
-   char theResExtSegLength[8];
-};
-
-class OSSIMDLLEXPORT ossimNitfFileHeaderV2_1 : public ossimNitfFileHeaderV2_X
-{
-public:
-   
-   ossimNitfFileHeaderV2_1();
-   virtual ~ossimNitfFileHeaderV2_1();
-   virtual void parseStream(std::istream &in);
-   virtual void writeStream(std::ostream &out);
-   virtual bool isEncrypted()const;
-   virtual ossim_int32 getNumberOfImages()const;
-   virtual ossim_int32 getNumberOfLabels()const;
-   virtual ossim_int32 getNumberOfSymbols()const;
-   virtual ossim_int32 getNumberOfGraphics()const;
-   virtual ossim_int32 getNumberOfTextSegments()const;
-   virtual ossim_int32 getNumberOfDataExtSegments()const;
-  virtual ossim_int32 getNumberOfReservedExtSegments()const;
-   virtual ossim_int32 getHeaderSize()const;
-   virtual ossim_int64 getFileSize()const;
-   virtual const char* getVersion()const;
-   virtual const char* getDateTime()const;
-   virtual ossimDrect getImageRect()const;
-
-   virtual void addImageInfoRecord(const ossimNitfImageInfoRecordV2_1& recordInfo);
-   virtual void addTextInfoRecord(const ossimNitfTextFileInfoRecordV2_1& recordInfo);
-	virtual void addDataExtSegInfoRecord(const ossimNitfDataExtSegInfoRecordV2_1& recordInfo);
-
-   virtual void replaceImageInfoRecord(int i, const ossimNitfImageInfoRecordV2_1& recordInfo);
-   
-   virtual ossimNitfImageHeader*  getNewImageHeader(ossim_uint32 imageNumber,
-                                                    std::istream& in)const;
-   virtual ossimNitfSymbolHeader* getNewSymbolHeader(ossim_uint32 symbolNumber,
-                                                     std::istream& in)const;
-   virtual ossimNitfLabelHeader* getNewLabelHeader(ossim_uint32 labelNumber,
-                                                   std::istream& in)const;
-   virtual ossimNitfTextHeader* getNewTextHeader(ossim_uint32 textNumber,
-                                                   std::istream& in)const;
-   virtual ossimNitfDataExtensionSegment* getNewDataExtensionSegment(
-      ossim_int32 dataExtNumber, std::istream& in)const;
-
-   virtual ossimNitfImageHeader*  allocateImageHeader()const;
-   virtual ossimNitfSymbolHeader* allocateSymbolHeader()const;
-   virtual ossimNitfLabelHeader*  allocateLabelHeader()const;
-   virtual ossimNitfTextHeader*   allocateTextHeader()const;
-   virtual ossimNitfDataExtensionSegment *allocateDataExtSegment()const;
-
-   virtual ossimString getSecurityClassificationSys()const;
-   virtual ossimString getCodeWords()const;
-   virtual ossimString getControlAndHandling()const;
-   virtual ossimString getReleasingInstructions()const;
-   virtual ossimString getDeclassificationType()const;
-   virtual ossimString getDeclassificationDate()const;
-   virtual ossimString getDeclassificationExemption()const;
-   virtual ossimString getDowngrade()const;
-   virtual ossimString getDowngradingDate()const;
-   virtual ossimString getClassificationText()const;
-   virtual ossimString getClassificationAuthorityType()const;
-   virtual ossimString getClassificationAuthority()const;
-   virtual ossimString getClassificationReason()const;
-   virtual ossimString getSecuritySourceDate()const;
-   virtual ossimString getSecurityControlNumber()const;
-   virtual void getBackgroundColor(ossim_uint8& r,
-                                   ossim_uint8& g,
-                                   ossim_uint8& b)const;
-   virtual ossimString getOriginatorsName()const;
-   virtual ossimString getOriginatorsPhone()const;
-   
-   virtual void setFileLength(ossim_uint64 fileLength);
-   virtual void setHeaderLength(ossim_uint64 headerLength);
-   
-   virtual void setSecurityClassificationSys(const ossimString& value);
-   virtual void setCodeWords(const ossimString& codeWords);
-   virtual void setControlAndHandling(const ossimString& controlAndHandling);
-   virtual void setReleasingInstructions(const ossimString& releasingInstructions);
-   virtual void setDeclassificationType(const ossimString& declassType);
-   virtual void setDeclassificationDate(const ossimLocalTm& declassDate);
-   virtual void setDeclassificationDate(const ossimString& declassDate);
-   virtual void setDeclassificationExemption(const ossimString& exemption);
-   virtual void setDowngrade(const ossimString& downgrade);
-   virtual void setDowngradingDate(const ossimLocalTm& date);
-   virtual void setDowngradingDate(const ossimString& date);
-   virtual void setClassificationText(const ossimString& classificationText);
-   virtual void setClassificationAuthorityType(const ossimString& authorityType);
-   virtual void setClassificationAuthority(const ossimString& authorityType);
-   virtual void setClassificationReason(const ossimString& reason);
-   virtual void setSecuritySourceDate(const ossimLocalTm& date);
-   virtual void setSecuritySourceDate(const ossimString& date);
-   virtual void setSecurityControlNumber(const ossimString& number);
-   virtual void setFileBackgroundColor(ossim_uint8 r,
-                                       ossim_uint8 g,
-                                       ossim_uint8 b);
-   virtual void setOriginatorsName(const ossimString& name);
-   virtual void setOriginatorsPhone(const ossimString& phone);
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /*!
-    * @brief Method to set fields from a keyword list.
-    *
-    * This is not a true loadState as it does not lookup/initialize all class
-    * members.  This was added to allow defaults, e.g OSTAID, to be set via a
-    * site configuration file.
-    * Code does not return false if a field(key) is not found..
-    *
-    * @return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-
-   /**
-    * Properties of a NITF 2.1 Header file. See MIL-STD-2500B for details.
-    *
-    * To access these, pass the constant to getProperty().
-    */
-   static const ossimString FSCLSY_KW;
-   static const ossimString FSDCTP_KW;
-   static const ossimString FSDCDT_KW;
-   static const ossimString FSDCXM_KW;
-   static const ossimString FSDG_KW;
-   static const ossimString FSDGDT_KW;
-   static const ossimString FSCLTX_KW;
-   static const ossimString FSCATP_KW;
-   static const ossimString FSCRSN_KW;
-   static const ossimString FSSRDT_KW;
-   static const ossimString FBKGC_KW;
-   
-   void clearFields();
-
-   void addTag(ossimNitfTagInformation tag, bool unique = true);
-   void removeTag(const ossimString& tagName);
-   bool takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
-                         ossim_uint32 potentialDesIndex, bool userDefinedTags = false);
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-private:
-   /**
-    * Sets the number of image records in the NITF 2.1 File Header.
-    *
-    * @param num
-    *        The number of image records for the entire NITF 2.1 file.
-    *
-    * @throw std::out_of_range
-    */
-   void setNumberOfImageInfoRecords(ossim_uint64 num);
-   void setNumberOfTextInfoRecords(ossim_uint64 num);
-   void setNumberOfGraphicInfoRecords(ossim_uint64 num);
-   void setNumberOfDataExtSegInfoRecords(ossim_uint64 num);
-
-   void readImageInfoRecords(std::istream &in);
-   void readGraphicInfoRecords(std::istream &in);
-   void readTextFileInfoRecords(std::istream &in);
-   void readDataExtSegInfoRecords(std::istream &in);
-   void readResExtSegInfoRecords(std::istream &in);
-
-   /**
-    * If the header was parsed this method will initialize the offsets
-    * to whare all data resides within the file.  Example:  NITF files
-    * have several sections (Image, Symbol, Labels, Text and Extended data) and
-    * each of these sections have subsections.  The offsets stored are just offsets
-    * from the start of the file to each major section and eqach subsection.
-    */
-   void initializeAllOffsets();
-   
-   /**
-    * If the header was parsed and the offsets have been initialized, this method will
-    * parse all overflow tags and put them into theTagList.
-    */
-   void readOverflowTags(std::istream& in);
-
-   // Note: these are work variables and not part of the
-   // Nitf header.  These variables will be used to quickly
-   // access various parts of the file.
-   /**
-    * This is not part of the NITF file header.  This will be
-    * computed since somethimes the header size will not be
-    * given in the header field.  This value will hold a count of
-    * all the bytes read for the header portion.  This can be used
-    * to skip past the header data.
-    */
-   ossim_uint32 theHeaderSize;
-
-   /**
-    * This will be pre-computed when the header file is opened.  This is
-    * computed after we have found the display order.  We will use the
-    * rectangle of the smallest display number.
-    */
-   ossimDrect theImageRect;
-   
-   /**
-    * This will hold pre-computed offsets to the start of all image headers
-    * and start to their data.
-    */
-   std::vector<ossimNitfImageOffsetInformation>  theImageOffsetList;
-   
-   std::vector<ossimNitfGraphicOffsetInformation> theGraphicOffsetList;
-   std::vector<ossimNitfTextOffsetInformation> theTextFileOffsetList;
-   std::vector<ossimNitfDataExtSegOffsetInformation> theDataExtSegOffsetList;
-   
-   // START Of header variables
-   /**
-    * Field: FSCLSY
-    * 
-    * Is a 2 byte field.  Required but can be blank:
-    *
-    */
-   char theSecurityClassificationSys[3];
-
-   /**
-    * Field: FSCODE
-    * 
-    * This is a 11 byte Alphanumeric field
-    */
-   char theCodewords[12]; 
-
-   /**
-    * Field: FSCTLH
-    * 
-    * This is a 2 byte Alphanumeric field.
-    */
-   char theControlAndHandling[3]; 
-
-   /**
-    * Field: FSREL
-    * 
-    * This is a 20 byte Alphanumeric field.
-    */
-   char theReleasingInstructions[21]; 
-
-   /**
-    * Field: FSDCTP
-    * 
-    * This is a 2 byte alphanumeric field.
-    * 
-    * DD    declassify on a specific date
-    * DE    declassify upon occurrence of an event
-    * GD    downgrade to a specified level on a specific date)
-    * GE    downgrade to a specified level upon occurrence of an event)
-    * O     OADR
-    * X     exempt from automatic declassification
-    *
-    * NOTE: If this field is all BCS spaces (0x20), it shall imply that no
-    *       file security declassification or
-    */ 
-   char theDeclassificationType[3];
-
-   /**
-    * Field: FSDCDT
-    * 
-    * This is a 8 byte field and has the form
-    * CCYYMMDD where:
-    *
-    * CC is the firs 2 chars of the year 00-99
-    * YY is the second 2 chars of the year 00-99
-    * MM is the month 01-12
-    * DD is the day 01-31
-    */
-   char theDeclassificationDate[9]; 
-
-   /**
-    * Field: FSDCXM
-    * 
-    * Is a 4 byte field
-    */
-   char theDeclassificationExemption[5];
-   
-   /**
-    * Field: FSDG
-    * 
-    * Can be blank.  Is a 1 byte field valid
-    * values are:
-    *
-    * S = secret
-    * C = Confidential
-    * R = Restricted
-    * 0x20 or BCS spaces.
-    *
-    * if spaces then security downgrading does not apply.
-    */
-   char theDowngrade[2];
-
-   /**
-    * Field: FSDGDT
-    * 
-    * Is an 8 byte field of the form
-    * CCYYMMDD.
-    */
-   char theDowngradingDate[9];
-
-   /**
-    * Field: FSCLTX
-    * 
-    * Is a 43 byte field and can contain BCS spaces (0x20).
-    */
-   char theClassificationText[44];
-
-   /**
-    * Field: FSCATP
-    *
-    * Values can be:
-    * 
-    * O  Original classification authority
-    * D  derivative from a single source
-    * M  derivative from multiple sources
-    * 
-    * Is a 1 byte field and can contain BCS spaces (0x20).
-    */
-   char theClassificationAuthorityType[2];
-
-   /**
-    * Field: FSCAUT
-    * 
-    * Is a 40 byte field and can contain BCS spaces (0x20).
-    */
-   char theClassificationAuthority[41];
-
-   /**
-    * Field: FSCRSN
-    * 
-    * Is a 1 byte field and can contain BCS spaces (0x20).
-    *
-    * Valid values are A-G
-    */
-   char theClassificationReason[2];
-
-   /**
-    * Field: FSSRDT
-    * 
-    * Is a 8 byte field of the form CCYYMMDD and can be
-    * BCS space (0x20).
-    */
-   char theSecuritySourceDate[9];
-
-   /**
-    * Field: FSCTLN
-    * 
-    * Is a 15 byte field and can be blank (0x20)
-    */
-   char theSecurityControlNumber[16];
-   
-   /**
-    * Field: FBKGC
-    * 
-    * Required.  Is a 3 byte field and is reuqired.  Note:  This
-    * field is binary and has range
-    *
-    *      (0x00-0xff, 0x00-0xff, 0x00-0xff)
-    *
-    * each byte can range from 0 to 255 binary
-    */
-   ossim_uint8 theFileBackgroundColor[3];
-   
-   /**
-    * Field: ONAME
-    * 
-    * This is a 24 byte Alphanumeric number
-    */
-   char theOriginatorsName[25];
-
-   /**
-    * Field: OPHONE
-    * 
-    * This is an 18 byte Alphanumeric value. 
-    */
-   char theOriginatorsPhone[19]; 
-
-   /**
-    * Field: FL
-    * 
-    * This is a required field.
-    *
-    * Is a 12 byte number of the form
-    * 000000000388-999999999998 indicates the
-    * file length and a value of 999999999999
-    * indicates that the file length was not
-    * available.
-    */
-   char theFileLength[13];
-
-   /**
-    * Field: HL
-    * 
-    * This is a reqired field.
-    *
-    * ranges from 000388-999999.
-    */
-   char theHeaderLength[7];
-
-   /**
-    * Field: NUMI
-    * 
-    * This is a 3 byte field that specifies the number
-    * of images in the file.  0-999
-    */
-   char theNumberOfImageInfoRecords[4];
-
-   /**
-    * This information is conditional on the number of image
-    * info records field.  If the filed is greater than 0 then
-    * the record information is read in up t the indicated number
-    */
-   std::vector<ossimNitfImageInfoRecordV2_1> theNitfImageInfoRecords;
-
-   /**
-    * Field: NUMS
-    * 
-    * This info is required and ranges from 000-999.
-    */
-   char theNumberOfGraphicInfoRecords[4];
-
-   /**
-    * This is an optional field and will depend on
-    * theNumberOfGraphicInfoRecords.  If 0 then does not exist.
-    */
-   std::vector<ossimNitfGraphicInfoRecordV2_1> theNitfGraphicInfoRecords;
-
-   /**
-    * Field: NUMX
-    * 
-    * Is a 3 byte field and is reserved for future use.
-    */
-   char theReservedForFutureUse1[4];
-   
-   /**
-    * Field: NUMT
-    * 
-    * This is a 3 byte numeric 0-999.
-    */
-   char theNumberOfTextFileInfoRecords[4];
-
-   /**
-    * This information is conditional on the number of text file
-    * info records field.  If the filed is greater than 0 then
-    * the record information is read in up t the indicated number
-    */
-   std::vector<ossimNitfTextFileInfoRecordV2_1> theNitfTextFileInfoRecords;
-
-   /**
-    * Field: NUMDES
-    * 
-    * This is a 3 byte numeric 0-999.
-    */
-   char theNumberOfDataExtSegInfoRecords[4];
-
-   /**
-    * This information is conditional on the number of 
-    * info records field.  If the filed is greater than 0 then
-    * the record information is read in up t the indicated number
-    */
-   std::vector<ossimNitfDataExtSegInfoRecordV2_1> theNitfDataExtSegInfoRecords;
-
-   /**
-    * Field: NUMRES
-    * 
-    * This is a 3 byte numeric 0-999. Reserved Extension Segments
-    */
-   char theNumberOfResExtSegInfoRecords[4];
-
-   /**
-    * This information is conditional on the number of Res Ext Seg
-    * info records field.  If the filed is greater than 0 then
-    * the record information is read in up t the indicated number
-    */
-   std::vector<ossimNitfResExtSegInfoRecordV2_1> theNitfResExtSegInfoRecords;
-
-   /**
-    * Field: UDHDL
-    * 
-    * This is a required field and is a 5 byte numeric ranging
-    * from 0-99999.  This is 0 if there is no data.  Valid values
-    * are 00000 or 00003-99999
-    */
-   char theUserDefinedHeaderDataLength[6];
-
-   /**
-    * Field: UDHOFL
-    * 
-    * This exists if theUserDefinedHeaderDataLength is not 0.
-    */
-   char theUserDefinedHeaderOverflow[4];
-
-   /**
-    * Field: XHDL
-    * 
-    * This is a required field.  It is 5 bytes long and
-    * ranges from 0-99999.  0 means there is no data
-    */
-   char theExtendedHeaderDataLength[6];
-
-   /**
-    * Field: XHDLOFL
-    * 
-    * This is conditional on theExtendedHeaderDataLength.  If
-    * that field is 0 then this does not exist.  This is a 3
-    * byte field.
-    */
-   char theExtendedHeaderDataOverflow[4];
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_X.h b/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_X.h
deleted file mode 100644
index 22f5af3..0000000
--- a/ossim/include/ossim/support_data/ossimNitfFileHeaderV2_X.h
+++ /dev/null
@@ -1,255 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimNitfFileHeaderV2_X.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimNitfFileHeaderV2_X_HEADER
-#define ossimNitfFileHeaderV2_X_HEADER
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-
-class ossimKeywordlist;
-class ossimLocalTm;
-
-class OSSIM_DLL ossimNitfFileHeaderV2_X : public ossimNitfFileHeader
-{
-public:
-   ossimNitfFileHeaderV2_X();
-
-   static ossimString formatDate(const ossimString& version,
-                                 const ossimLocalTm& d);
-
-   virtual void setCodeWords(const ossimString& codeWords) = 0;
-   virtual void setControlAndHandling(const ossimString& controlAndHandling) = 0;
-   virtual void setReleasingInstructions(const ossimString& releasingInstructions) = 0;
-   virtual void setClassificationAuthority(const ossimString& classAuth) = 0;
-   virtual void setSecurityControlNumber(const ossimString& controlNo) = 0;
-   virtual void setOriginatorsName(const ossimString& originatorName) = 0;
-   virtual void setOriginatorsPhone(const ossimString& origniatorPhone) = 0;
-
-   virtual ossimString getCodeWords()const = 0;
-   virtual ossimString getControlAndHandling()const = 0;
-   virtual ossimString getReleasingInstructions()const = 0;
-   virtual ossimString getClassificationAuthority()const = 0;
-   virtual ossimString getSecurityControlNumber()const = 0;
-   virtual ossimString getOriginatorsName()const = 0;
-   virtual ossimString getOriginatorsPhone()const = 0;
-
-   virtual ossimString getSecurityClassification()const;
-   void setComplexityLevel(const ossimString& level);
-   void setSystemType(const ossimString& systemType);
-   void setOriginatingStationId(const ossimString& originationId);
-
-   /**
-    * @brief Sets field FDT.
-    *
-    * Version 2.0 format: DDHHMMSSZMONYY
-    * Version 2.1 format: CCYYMMDDhhmmss
-    *
-    * @param ossimLocalTm Local time.  Note that this will be converted to
-    * GMT(ZULU).
-    */
-   void setDate(const ossimLocalTm& d);
-
-   
-   /**
-    * @brief Sets field FDT.
-    *
-    * @param d Date string to copy to FDT field.
-    *
-    * @note No conversions performed. 
-    */
-   void setDate(const ossimString& d);
-
-   /**
-    * @brief Sets field FDT to current time converted to GMT(ZULU).
-    *
-    * Version 2.0 format: DDHHMMSSZMONYY
-    * Version 2.1 format: CCYYMMDDhhmmss
-    */
-   virtual void setDate();
-
-   void setTitle(const ossimString& title);
-   void setFileSecurityClassification(const ossimString& securityClassification);
-   void setCopyNumber(const ossimString& copyNumber);
-   void setNumberOfCopies(const ossimString& numberOfCopies);
-   void setEncryption(const ossimString& encryption);
-
-   ossimString getComplexityLevel()const;
-   ossimString getSystemType()const;
-   ossimString getOriginatingStationId()const;
-   ossimString getDate()const;
-   ossimString getTitle()const;
-   ossimString getCopyNumber()const;
-   ossimString getNumberOfCopies()const;
-   ossimString getEncryption()const;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-
-   /*!
-    * @brief Method to set fields from a keyword list.
-    *
-    * This is not a true loadState as it does not lookup/initialize all class
-    * members.  This was added to allow defaults, e.g OSTAID, to be set via a
-    * site configuration file.
-    * Code does not return false if a field(key) is not found..
-    *
-    * @return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   /**
-    * Properties of a NITF 2.x Header file. See MIL-STD-2500A or
-    * MIL-STD-2500B for details.
-    *
-    * To access these, pass the constant to getProperty().
-    */
-   static const ossimString FILE_TYPE_KW;
-   static const ossimString FHDR_KW;
-   static const ossimString VERSION_KW;
-   static const ossimString CLEVEL_KW;
-   static const ossimString STYPE_KW;
-   static const ossimString OSTAID_KW;
-   static const ossimString FDT_KW;
-   static const ossimString FTITLE_KW;
-   static const ossimString FSCLAS_KW;
-   static const ossimString FSCODE_KW;
-   static const ossimString FSCTLH_KW;
-   static const ossimString FSREL_KW;
-   static const ossimString FSCAUT_KW;
-   static const ossimString FSCTLN_KW;
-   static const ossimString FSCOP_KW;
-   static const ossimString FSCPYS_KW;
-   static const ossimString ENCRYP_KW;
-   static const ossimString ONAME_KW;
-   static const ossimString OPHONE_KW;
-
-protected:
-
-   /**
-    * Field: FHDR
-    * Required field for NITF and is a 9 byte value
-    *
-    * format is NITFNN.NN where NN.NN is the version
-    * number. The valid version number for this class
-    * is NITF02.10.
-    *
-    * NOTE: This field may contain NSIF01.00 which is also the same as NITF02.10
-    * 
-    */
-   char  theFileTypeVersion[10]; // nine bytes
-
-   /**
-    * Field: CLEVEL
-    * 
-    * Required field. 2 byte field ranges from 01-99
-    */
-   char  theComplexityLevel[3];  // 2 bytes
-
-   /**
-    * Field: STYPE
-    * 
-    * Required field. 4 bytes
-    */
-   char  theSystemType[5];      // four bytes
-
-   /**
-    * Field: OSTAID
-    * 
-    * Is required 10 byte field and can't be blank
-    * 
-    */
-   char  theOriginatingStationId[11]; // ten bytes
-
-   /**
-    * Field: FDT
-    * 
-    * for NITF 2.1 format we have
-    *
-    * Has the form CCYYMMDDhhmmss and is a required field
-    *
-    * where CC is the first two digits of the year 00-99
-    *       YY is the last 2 digits of the year 00-99
-    *       MM is the month 01-12
-    *       DD is the day 01-31
-    *       hh is the hour 00-23
-    *       mm is the minutes 00-59
-    *       ss is the seconds 00-59
-    *
-    * For NITF 2.0 format we have
-    *
-    * DDHHMMSSZMONYY
-    *
-    * where  DD is the day
-    *        HH is the hour
-    *        MM is the minutes
-    *        SS is the seconds
-    *        MON is the first 3 characters of the month
-    *        YY is the 2 digit year
-    */
-   char  theDateTime[15];  // 14 bytes
-
-   /**
-    * Field: FTITLE
-    * 
-    * Is a required field and is an 80 byte
-    * Alphanumeric value this can be all BCS spaces.
-    */
-   char  theFileTitle[81]; // 80 bytes
-
-   /**
-    * Field: FSCLAS
-    * 
-    * This is a reqired field and is 1 byte long and
-    * can contain one of the following:
-    *
-    *  T      Top secret
-    *  S      Secret
-    *  C      Confidential
-    *  R      Restricted
-    *  U      Unclassified
-    */
-   char theSecurityClassification[2];
-
-   /**
-    * Field: FSCOP
-    * 
-    * This is the copy number and is a 5 byte
-    * numeric of the form 00000-99999.  This field
-    * is required.
-    */
-   char theCopyNumber[6];
-
-   /**
-    * Field: FSCOPYS
-    * 
-    * This is the total number of copies that exist.
-    * This is a 5 byte numeric of the form 00000-99999.  This
-    * field is required.
-    */
-   char theNumberOfCopies[6];
-
-   /**
-    * Field: ENCRYP
-    * 
-    * This is a reqired field and is a 1 byte numeric
-    * where 0 is not encrypted and 1 is encrypted.  This field
-    * is reuqired.
-    */
-   char theEncryption[2];
-
-TYPE_DATA
-};
-
-#endif
-
-
diff --git a/ossim/include/ossim/support_data/ossimNitfGeoPositioningTag.h b/ossim/include/ossim/support_data/ossimNitfGeoPositioningTag.h
deleted file mode 100644
index 6bd3141..0000000
--- a/ossim/include/ossim/support_data/ossimNitfGeoPositioningTag.h
+++ /dev/null
@@ -1,230 +0,0 @@
-//********************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:      Garrett Potts
-// 
-// Description: Nitf support class
-//
-// Documentation reference:
-// DIGEST Part 2 Annex D - Appendix 1, Table D1-3
-// 
-//********************************************************************
-// $Id: ossimNitfGeoPositioningTag.h 23664 2015-12-14 14:17:27Z dburken $
-//
-#ifndef ossimNitfGeoPositioningTag_HEADER
-#define ossimNitfGeoPositioningTag_HEADER 1
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfGeoPositioningTag : public ossimNitfRegisteredTag
-{
-public:
-   ossimNitfGeoPositioningTag();
-   virtual ~ossimNitfGeoPositioningTag();
-
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-protected:
-   /**
-    * FIELD: TYP
-    *
-    * required 3 byte field.
-    * 
-    * Coordinate System Type
-    *
-    * This field shall contain the type of coordinate system to which the Image
-    * Segment refers.  Valid values are GEO for a geographic coordinate
-    * system (longitude & latitude), MAP for a cartographic (grid)
-    * coordinate system (easting & northing) and DIG for a geographic or
-    * cartographic coordinate system registered through location grids or
-    * registration points.
-    * See clause D1.2.2 for details.
-    * The default value is MAP.
-    *
-    *
-    * Values: MAP, GEO or DIG 
-    */
-   char theType[4];
-
-   /**
-    * FIELD: UNI
-    *
-    * required 3 byte field.
-    *
-    * Coordinate Units This field shall contain the units of measure to which
-    * the Image Segment refers.  Valid values are SEC (Decimal seconds of arc),
-    * DEG (Decimal degrees) and M (Metres).  The value must be consistent with
-    * the coordinate system type.  SEC and DEG are not allowed when the
-    * coordinate system type is MAP.  M is not allowed when the coordinate system
-    * type is GEO.  The PRJPS extension is expected when the value is M.
-    * The default value is M.
-    */
-   char theCoordinateUnits[4];
-
-
-   /**
-    * FIELD: DAG
-    * 
-    * required 80 byte field.
-    * 
-    * Geodetic Datum Name
-    *
-    * This field shall contain the name of the geodetic datum to which the
-    * Image Segment refers.
-    * The default value is World Geodetic System 1984.
-    * 
-    */
-   char theGeodeticDatumName[81];
-
-   /**
-    * FIELD: DCD
-    *
-    * required 4 byte field.
-    * 
-    * Geodetic Datum Code This field shall contain the code of the geodetic
-    * datum to which the Image Segment refers. The default value is WGE.
-    * 
-    */
-   char theGeodeticDatumCode[5];
-
-   /**
-    * FIELD: ELL
-    *
-    * required 80 byte field.
-    *
-    * Ellipsoid Name
-    *
-    * This field shall contain the name of the ellipsoid to which the
-    * Image Segment refers. The default value is World Geodetic System 1984.
-    * 
-    */
-   char theEllipsoidName[81];
-
-   /**
-    * FIELD: ELC
-    *
-    * required 3 byte field.
-    *
-    * Ellipsoid Code This field shall contain the code of the ellipsoid to
-    * which the Image Segment refers.
-    * The default value is WE.
-    * 
-    */
-   char theEllipsoidCode[4];
-
-   /**
-    * FIELD: DVR
-    *
-    * required 80 byte field.
-    *
-    * Vertical Datum Reference This field shall contain the name of the vertical
-    * datum reference to which the Image Segment refers, or BCS Spaces if no elevation value
-    * appears in the Image Segment. The default name is Geodetic. 
-    */
-   char theVerticalDatumReference[81];
-
-   /**
-    * FIELD: VDCDVR
-    *
-    * required 4 byte field.
-    * 
-    * Code (Category) of Vertical Reference This field shall contain the code
-    * (or category) of the vertical reference to which the Image Segment
-    * refers, or BCS Spaces if no elevation value appears in the Image Segment.
-    * The default code is GEOD.
-    * 
-    */
-   char theVerticalReferenceCode[5];
-
-   /**
-    * FIELD: SDA
-    *
-    * required 80 byte field.
-    * 
-    * Sounding Datum Name This field shall contain the name of the sounding datum
-    * to which the Image Segment refers, or BCS Spaces i
-    * f no sounding appears in the Image Segment.
-    * The default value is Mean Sea.
-    */
-   char theSoundingDatumName[81];
-
-   /**
-    * FIELD: VDCSDA
-    *
-    * required 4 byte field.
-    * 
-    * Code for  Sounding Datum This field shall contain the code of the
-    * sounding datum to which the Image Segment refers, or BCS Spaces
-    * if no sounding appears in the Image Segment.
-    * The default valid code is MSL. 4BCS-A See Part 3-6 <R> 
-    */
-   char theSoundingDatumCode[5];
-
-   /**
-    * FIELD ZOR
-    *
-    * required 15 byte field
-    *
-    * Z values False Origin
-    *
-    * This field shall contain the elevation and depth false origin for Z values
-    * to which the Image Segment refers. The default value is 000000000000000,
-    * which implies that there is no projection false Z origin. 15 BCS-N positive integer
-    * 
-    */
-   char theZFalseOrigin[16];
-
-   /**
-    * FIELD: GRD
-    *
-    * required 3 byte field.
-    * 
-    * Grid Code This field shall contain the identification code of the grid system
-    * to which the Image Segment refers, or BCS Spaces. The default value is
-    * BCS Spaces. 3BCS-A See Part 3-6 <R> 
-    */
-   char theGridCode[4];
-
-   /**
-    * FIELD: GRN
-    *
-    * required 80 byte field.
-    *
-    * Grid Description If the GRD Field value is not BCS Spaces, this field can
-    * contain a text description of the grid system.
-    * The default value is BCS Spaces. 80 BCS-A <R> 
-    */
-   char theGridDescription[81];
-
-   /**
-    * FIELD: ZNA
-    *
-    * required 4 byte field.
-    *
-    * Grid Zone number This field shall contain the zone number when the GRD
-    * Field contains a significant grid code and the corresponding grid system
-    * comprises more than one zone. Defaulted to 0000 otherwise.
-    * 4 BCS-N integer See Part 3-6 R 
-    */
-   char theGridZoneNumber[5];
-
-   
-TYPE_DATA   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfIchipbTag.h b/ossim/include/ossim/support_data/ossimNitfIchipbTag.h
deleted file mode 100644
index ba00cfe..0000000
--- a/ossim/include/ossim/support_data/ossimNitfIchipbTag.h
+++ /dev/null
@@ -1,565 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description: ICHIPB tag class declaration.
-//
-// See document STDI-0002 Table 5-2 for more info.
-// 
-// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfIchipbTag.h 22013 2012-12-19 17:37:20Z dburken $
-#ifndef ossimNitfIchipbTag_HEADER
-#define ossimNitfIchipbTag_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class ossimDpt;
-class ossimDrect;
-class ossim2dTo2dTransform;
-class OSSIM_DLL ossimNitfIchipbTag : public ossimNitfRegisteredTag
-{
-public:
-   enum 
-   {
-      XFRM_FLAG_SIZE    =  2,
-      
-      SCALE_FACTOR_SIZE = 10,
-      
-      ANAMRPH_CORR_SIZE =  2,
-      
-      SCANBLK_NUM_SIZE  =  2,
-
-      OP_ROW_11_SIZE    = 12,
-      OP_COL_11_SIZE    = 12,
-
-      OP_ROW_12_SIZE    = 12,
-      OP_COL_12_SIZE    = 12,
-
-      OP_ROW_21_SIZE    = 12,
-      OP_COL_21_SIZE    = 12,
-
-      OP_ROW_22_SIZE    = 12,
-      OP_COL_22_SIZE    = 12,
-      
-      FI_ROW_11_SIZE    = 12,
-      FI_COL_11_SIZE    = 12,
-
-      FI_ROW_12_SIZE    = 12,
-      FI_COL_12_SIZE    = 12,
-
-      FI_ROW_21_SIZE    = 12,
-      FI_COL_21_SIZE    = 12,
-
-      FI_ROW_22_SIZE    = 12,
-      FI_COL_22_SIZE    = 12,
-
-      FI_ROW_SIZE       =  8,
-      FI_COL_SIZE       =  8
-      //                ------
-      //                 224
-   };
-   
-   /** default constructor */
-   ossimNitfIchipbTag();
-
-   /**
-    * Parse method.
-    *
-    * @param in Stream to parse.
-    */
-   virtual void parseStream(std::istream& in);
-   
-   /**
-    * Write method.
-    *
-    * @param out Stream to write to.
-    */
-   virtual void writeStream(std::ostream& out);
-   
-   /**
-    * Clears all string fields within the record to some default nothingness.
-    */
-   virtual void clearFields();
-   
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-
-   /**
-    * @return The Non-linear transformation flag.
-    */
-   bool getXfrmFlag() const;
-
-   /**
-    * @return Scale factor relative to R0 (original full res image resolution).
-    */
-   ossim_float64 getScaleFactor() const;
-
-   /**
-    * @return Anamophic correction indicator.
-    */
-   bool getAnamrphCorrFlag() const;
-
-   /**
-    * @return Scan block number or scan block index.
-    */
-   ossim_uint32 getScanBlock() const;
-
-   /**
-    * @return Output product row number component of grid point index (1,1) for
-    * intelligent data,
-    */
-   ossim_float64 getOpRow11() const;
-
-   /**
-    * Output product column number component of grid point index (1,1) for
-    * intelligent data.
-    */
-   ossim_float64 getOpCol11() const;
-
-   /**
-    * @return Output product row number component of grid point index (1,2) for
-    * intelligent data,
-    */
-   ossim_float64 getOpRow12() const;
-
-   /**
-    * Output product column number component of grid point index (1,2) for
-    * intelligent data.
-    */
-   ossim_float64 getOpCol12() const;
-
-   /**
-    * @return Output product row number component of grid point index (2,1) for
-    * intelligent data,
-    */
-   ossim_float64 getOpRow21() const;
-
-   /**
-    * Output product column number component of grid point index (2,1) for
-    * intelligent data.
-    */
-   ossim_float64 getOpCol21() const;
-
-   /**
-    * @return Output product row number component of grid point index (2,2) for
-    * intelligent data,
-    */
-   ossim_float64 getOpRow22() const;
-   
-   /**
-    * @return Output product row number component of grid point index (2,2) for
-    * intelligent data,
-    */
-   ossim_float64 getOpCol22() const;
-
-   /**
-    * @return Grid point (1,1) row number in full image coordinate system.
-    */
-   ossim_float64 getFiRow11() const;
-   
-   /**
-    * @return Grid point (1,1) column number in full image coordinate system.
-    */
-   ossim_float64 getFiCol11() const;
-   
-   /**
-    * @return Grid point (1,2) row number in full image coordinate system.
-    */
-   ossim_float64 getFiRow12() const;
-   
-   /**
-    * @return Grid point (1,2) row number in full image coordinate system.
-    */
-   ossim_float64 getFiCol12() const;
-   
-   /**
-    * @return Grid point (2,1) row number in full image coordinate system.
-    */
-   ossim_float64 getFiRow21() const;
-
-   /**
-    * @return Grid point (2,1) row number in full image coordinate system.
-    */
-   ossim_float64 getFiCol21() const;
-
-   /**
-    * @return Grid point (2,2) row number in full image coordinate system.
-    */
-   ossim_float64 getFiRow22() const;
-
-   /**
-    * @return Grid point (2,2) row number in full image coordinate system.
-    */
-   ossim_float64 getFiCol22() const;
-
-   /**
-    * @return Full image number of rows.
-    */
-   ossim_uint32 getFullImageRows() const;
-
-   /**
-    * @return Full image number of cols.
-    */
-   ossim_uint32 getFullImageCols() const;
-
-   /**
-    * Initializes rect with the image rectangle without any sub image offset
-    * applied.   This is the rectangle of the chip starting at (0,0).
-    *
-    * @param rect The rect to initialize.
-    *
-    * @note Rectangle is shifted by -0.5 since per spec (0,0) is the
-    * considered the upper left corner of the upper left pixel and we use a
-    * point method where (0,0) refers to the center of the pixel.
-    */
-   void getImageRect(ossimDrect& rect) const;
-
-    /**
-    * Initializes rect with the image rectangle with sub image offset
-    * applied.   This is the rectangle of the chip relative to the full
-    * image or starting at the sub image offset.
-    *
-    * @param rect The rect to initialize.
-    *
-    * @note Rectangle is shifted by -0.5 since per spec (0,0) is the
-    * considered the upper left corner of the upper left pixel and we use a
-    * point method where (0,0) refers to the center of the pixel.
-    */
-   void getFullImageRect(ossimDrect& rect) const;
-
-   ossim2dTo2dTransform* newTransform()const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-protected:
-
-
-   /**
-    * FIELD: XFRM_FLAG
-    *
-    * required 2 byte field
-    *
-    * 00 or 01
-    * 
-    * Non-linear transformation flag.
-    *
-    * NOTE:  If 01 remaining data zero filled.
-    */
-   char theXfrmFlag[XFRM_FLAG_SIZE+1];
-
-   
-   /**
-    * FIELD: SCALE_FACTOR
-    *
-    * required 10 byte field
-    *
-    * xxxx.xxxxx
-    *
-    * Scale factor relative to R0 (original full res image resolution).
-    */
-   char theScaleFactor[SCALE_FACTOR_SIZE+1];
-      
-  
-   /**
-    * FIELD: ANAMRPH_CORR
-    *
-    * required 2 byte field
-    *
-    * 00 or 01
-    * 
-    * Anamophic correction indicator.
-    */
-   char theAnamrphCorr[ANAMRPH_CORR_SIZE+1];
-   
-   /**
-    * FIELD: SCANBLK_NUM
-    *
-    * required 2 byte field
-    *
-    * 00-99, 00 if not applicable
-    * 
-    * Scan block number or scan block index.
-    */
-   char theScanBlock[SCANBLK_NUM_SIZE+1];
-   
-   /**
-    * FIELD: OP_ROW_11
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy typically 00000000.500
-    * 
-    * Output product row number component of grid point index (1,1) for
-    * intelligent data.
-    */
-   char theOpRow11[OP_ROW_11_SIZE+1];
-
-   /**
-    * FIELD: OP_COL_11
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy typically 00000000.500
-    * 
-    * Output product column number component of grid point index (1,1) for
-    * intelligent data.
-    * 
-    */
-   char theOpCol11[OP_COL_11_SIZE+1];
-
-   /**
-    * FIELD: OP_ROW_12
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Output product row number component of grid point index (1,2) for
-    * intelligent data.
-    */
-   char theOpRow12[OP_ROW_12_SIZE+1];
-
-   /**
-    * FIELD: OP_COL_12
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Output product column number component of grid point index (1,2) for
-    * intelligent data.
-    */
-   char theOpCol12[OP_COL_12_SIZE+1];
-   
-   /**
-    * FIELD: OP_ROW_21
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Output product row number component of grid point index (2,1) for
-    * intelligent data.
-    */
-   char theOpRow21[OP_ROW_21_SIZE+1];
-
-   /**
-    * FIELD: OP_COL_21
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Output product column number component of grid point index (2,1) for
-    * intelligent data.
-    */
-   char theOpCol21[OP_COL_21_SIZE+1];
-   
-   /**
-    * FIELD: OP_ROW_22
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Output product row number component of grid point index (2,2) for
-    * intelligent data.
-    */
-   char theOpRow22[OP_ROW_22_SIZE+1];
-
-   /**
-    * FIELD: OP_COL_22
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Output product column number component of grid point index (2,2) for
-    * intelligent data.
-    */
-   char theOpCol22[OP_COL_22_SIZE+1];
-
-   /**
-    * FIELD: FI_ROW_11
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy typically 00000000.500
-    * 
-    * Grid point (1,1) row number in full image coordinate system.
-    */
-   char theFiRow11[FI_ROW_11_SIZE+1];
-
-   /**
-    * FIELD: FI_COL_11
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy typically 00000000.500
-    * 
-    * Grid point (1,1) column number in full image coordinate system.
-    */
-   char theFiCol11[FI_COL_11_SIZE+1];
-
-   /**
-    * FIELD: FI_ROW_12
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Grid point (1,2) row number in full image coordinate system.
-    */
-   char theFiRow12[FI_ROW_12_SIZE+1];
-
-   /**
-    * FIELD: FI_COL_12
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Grid point (1,2) column number in full image coordinate system.
-    */
-   char theFiCol12[FI_COL_12_SIZE+1];
-   
-   /**
-    * FIELD: FI_ROW_21
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Grid point (2,1) row number in full image coordinate system.
-    */
-   char theFiRow21[FI_ROW_21_SIZE+1];
-
-   /**
-    * FIELD: FI_COL_21
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Grid point (2,1) column number in full image coordinate system.
-    */
-   char theFiCol21[FI_COL_21_SIZE+1];
-   
-   /**
-    * FIELD: FI_ROW_22
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Grid point (2,2) row number in full image coordinate system.
-    */
-   char theFiRow22[FI_ROW_22_SIZE+1];
-
-   /**
-    * FIELD: FI_COL_22
-    *
-    * required 12 byte field
-    *
-    * xxxxxxxx.yyy
-    * 
-    * Grid point (2,2) column number in full image coordinate system.
-    */
-   char theFiCol22[FI_COL_22_SIZE+1];
-
-   /**
-    * FIELD:  FI_ROW
-    *
-    * required 8 byte field
-    *
-    * 00000000 and 00000002 to 99999999
-    * 
-    * Full image number of rows.
-    */
-   char theFullImageRow[FI_ROW_SIZE+1];
-   
-   /**
-    * FIELD:  FI_COL
-    *
-    * required 8 byte field
-    *
-    * 00000000 and 00000002 to 99999999
-    * 
-    * Full image number of cols.
-    */
-   char theFullImageCol[FI_COL_SIZE+1];
-
-   
-   
-   
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-   
-                            
-   /**
-    * FIELD: 
-    *
-    * required  byte field
-    *
-    * 01 to 99
-    * 
-    * 
-    */
-   /**
-    * FIELD: 
-    *
-    * required  byte field
-    *
-    * 01 to 99
-    * 
-    * 
-    */
-   /**
-    * FIELD: 
-    *
-    * required  byte field
-    *
-    * 01 to 99
-    * 
-    * 
-    */
-   
-   
-TYPE_DATA   
-};
-
-#endif /* End of "#ifndef ossimNitfIchipbTag_HEADER" */
diff --git a/ossim/include/ossim/support_data/ossimNitfImageBand.h b/ossim/include/ossim/support_data/ossimNitfImageBand.h
deleted file mode 100644
index 1d7e177..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageBand.h
+++ /dev/null
@@ -1,51 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageBand.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfImageBand_HEADER
-#define ossimNitfImageBand_HEADER 1
-#include <iosfwd>
-#include <string>
-#include <ossim/support_data/ossimNitfImageLut.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-
-class ossimNitfImageBand : public ossimObject
-{
-public:
-   ossimNitfImageBand();
-   virtual ~ossimNitfImageBand();
-   virtual void parseStream(std::istream& in)=0;
-   virtual void writeStream(std::ostream& out)=0;
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out Stream to output to.
-    * @param prefix Like "image0."
-    * @param band zero based band.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix,
-                               ossim_uint32 band)const=0;
-
-   virtual ossim_uint32 getNumberOfLuts()const=0;
-   virtual const ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx)const=0;
-   virtual ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx)=0;
-
-   /** @return The band representation as an ossimString. */
-   virtual ossimString getBandRepresentation() const = 0;
-
-TYPE_DATA;
-};
-
-#endif /* #ifndef ossimNitfImageBand_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfImageBandV2_0.h b/ossim/include/ossim/support_data/ossimNitfImageBandV2_0.h
deleted file mode 100644
index a374ffa..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageBandV2_0.h
+++ /dev/null
@@ -1,113 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageBandV2_0.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfImageBandV2_0_HEADER
-#define ossimNitfImageBandV2_0_HEADER
-
-#include <string>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimNitfImageBand.h>
-#include <ossim/support_data/ossimNitfImageLutV2_0.h>
-
-class OSSIM_DLL ossimNitfImageBandV2_0 : public ossimNitfImageBand
-{
-public:
-   
-   /** default constructor */
-   ossimNitfImageBandV2_0();
-
-   /** virtual destructory */
-   virtual ~ossimNitfImageBandV2_0();
-   
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out Stream to output to.
-    * @param prefix Like "image0."
-    * @param band zero based band.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string(),
-                               ossim_uint32 band=0) const;   
-   
-   virtual ossim_uint32 getNumberOfLuts()const;
-   virtual const ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx)const;
-   virtual ossimRefPtr<ossimNitfImageLut> getLut(ossim_uint32 idx);
-
-   /** @return The band representation as an ossimString. */
-   virtual ossimString getBandRepresentation()const;
-
-   /**
-    * Sets the band representation.
-    *
-    * @param rep The band representation.
-    */
-   virtual void setBandRepresentation(const ossimString& rep);
-
-   /** @return The band significance as an ossimString. */
-   virtual ossimString getBandSignificance()const;
-
-   /**
-    * Sets the band significance.
-    *
-    * @param rep The band significance.
-    */
-   virtual void setBandSignificance(const ossimString& rep);
-
-protected:
-   void clearFields();
-   void printLookupTables(std::ostream& out)const;
-   /*!
-    * FIELD: IREPBAND,,
-    * Is a required 2 byte field.  When theNumberOfBands is
-    * 1 this field will contain all spaces.
-    */
-   char theBandRepresentation[3];
-
-   /*!
-    * FIELD:  ISUBCATnn
-    * Is a required 6 byte field.
-    */
-   char theBandSignificance[7];
-
-   /*!
-    * FIELD:  IFCnn
-    * Is an required 1 byte field.  Will be N
-    */
-   char theBandImageFilterCondition[2];
-
-   /*!
-    * FIELD:  IMFLTnn
-    * is a required 3 byte field.  This is a reserved field
-    */
-   char theBandStandardImageFilterCode[4];
-
-   /*!
-    * FIELD:  NLUTSnn
-    * This is a required 1 byte field.  Has value 0-4
-    */
-   char theBandNumberOfLuts[2];
-
-   /*!
-    * NELUTnn
-    * This is a conditional field.
-    */
-   char theBandNumberOfLutEntries[6];
-
-   std::vector<ossimRefPtr<ossimNitfImageLut> > theLookupTables;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfImageBandV2_1.h b/ossim/include/ossim/support_data/ossimNitfImageBandV2_1.h
deleted file mode 100644
index eaa5792..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageBandV2_1.h
+++ /dev/null
@@ -1,27 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT see top level directory for more details
-//
-// Author:  David Burken <dburken at imagelinks.com>
-//
-//********************************************************************
-// $Id: ossimNitfImageBandV2_1.h 23666 2015-12-14 20:01:22Z rashadkm $
-
-#ifndef ossimNitfImageBandV2_1_HEADER
-#define ossimNitfImageBandV2_1_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimNitfImageBandV2_0.h>
-
-class OSSIM_DLL ossimNitfImageBandV2_1 : public ossimNitfImageBandV2_0
-{
-public:
-
-   /** default constructor */
-   ossimNitfImageBandV2_1();
-
-   /** virtual destructory */
-   virtual ~ossimNitfImageBandV2_1();
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfImageHeader.h b/ossim/include/ossim/support_data/ossimNitfImageHeader.h
deleted file mode 100644
index a34e8ac..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageHeader.h
+++ /dev/null
@@ -1,181 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageHeader.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfImageHeader_HEADER
-#define ossimNitfImageHeader_HEADER
-
-#include <vector>
-
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimPropertyInterface.h>
-#include <ossim/support_data/ossimNitfTagInformation.h>
-#include <ossim/support_data/ossimNitfCompressionHeader.h>
-#include <ossim/support_data/ossimNitfImageBand.h>
-
-class ossimString;
-class ossimDpt;
-class ossimIpt;
-class ossimIrect;
-
-class OSSIMDLLEXPORT ossimNitfImageHeader : public ossimObject,
-                                            public ossimPropertyInterface
-{
-public:
-   ossimNitfImageHeader();
-   virtual ~ossimNitfImageHeader();
-
-   virtual bool getTagInformation(ossimNitfTagInformation& tagInfo,
-                                  ossim_uint32 idx) const;
-   
-   virtual bool getTagInformation(ossimNitfTagInformation& tagInfo,
-                                  const ossimString& tagName) const;
-
-   ossimRefPtr<ossimNitfRegisteredTag> getTagData(const ossimString& tagName);
-   
-   const ossimRefPtr<ossimNitfRegisteredTag> getTagData(
-      const ossimString& tagName) const;
-   
-   virtual ossim_uint32 getNumberOfTags()const;
-
-   virtual void addTag(const ossimNitfTagInformation& tag, bool unique=true);
-   virtual void removeTag(const ossimString& tagName);
-   
-   virtual void parseStream(std::istream &in)= 0;
-   virtual void writeStream(std::ostream &out)= 0;
-
-   virtual bool isCompressed()const=0;
-   virtual bool isEncrypted()const=0;
-
-   virtual ossimString getCompressionCode()const=0;
-   virtual ossimString getCompressionRateCode()const=0;
-   virtual ossim_uint32 getDisplayLevel()const=0;
-   virtual ossim_uint32 getAttachmentLevel()const=0;
-   
-   virtual ossim_int32 getNumberOfRows()const=0;
-   virtual ossim_int32 getNumberOfBands()const=0;
-   virtual ossim_int32 getNumberOfCols()const=0;
-   virtual ossim_int32 getNumberOfBlocksPerRow()const=0;
-   virtual ossim_int32 getNumberOfBlocksPerCol()const=0;
-   virtual ossim_int32 getNumberOfPixelsPerBlockHoriz()const=0;
-   virtual ossim_int32 getNumberOfPixelsPerBlockVert()const=0;
-   virtual ossimString getImageId()const=0;
-   virtual ossimString getTitle()const=0;
-   virtual ossim_int32 getActualBitsPerPixelPerBand()const=0;
-   virtual ossim_int32 getBitsPerPixelPerBand()const=0;
-   virtual ossimIrect  getImageRect()const=0;
-   /**
-    * Blocks might not be the same size as the significant rows and cols used
-    * by the getImageRect.
-    */
-   virtual ossimIrect   getBlockImageRect()const=0;
-   virtual ossimString  getIMode()const=0;
-   virtual ossim_uint64 getDataLocation()const=0;
-
-   /** @return The IDATIM field unparsed. */
-   virtual ossimString  getImageDateAndTime() const=0;
-   
-   virtual ossimString  getAcquisitionDateMonthDayYear(ossim_uint8 separationChar='-')const=0;
-   virtual ossimString  getSecurityClassification()const=0;
-   virtual ossimString  getCategory()const=0;
-   virtual ossimString  getImageSource()const=0;
-   virtual ossimString  getRepresentation()const=0;
-   virtual ossimString  getCoordinateSystem()const=0;
-   virtual ossimString  getGeographicLocation()const=0;
-   virtual ossimString  getPixelValueType()const=0;
-
-   /** @return IMAG field */
-   virtual ossimString  getImageMagnification()const=0;
-
-   /**
-    * @brief Gets the ILOC field as an ossimIpt.
-    * @param loc Initialized with the field.
-    * @note: Do not confuse with "data location".
-    */
-   virtual void getImageLocation(ossimIpt& loc)const=0;
-
-   /**
-    * @brief Convenience method to get the decimation factor as a double from
-    * the string returned be the getImageMagnification() method.
-    *
-    * @param result Initialized with the decimation factor as a double.
-    * Will return an ossim::nan() if something bad happens like the string is
-    * empty so callers should check result with ossim::isnan(result).
-    */
-   virtual void getDecimationFactor(ossim_float64& result) const;
-   
-   virtual bool hasBlockMaskRecords()const=0;
-   virtual bool hasPadPixelMaskRecords()const=0;
-   virtual bool hasTransparentCode()const=0;
-   virtual ossim_uint32 getTransparentCode()const=0;
-   virtual ossim_uint32 getBlockMaskRecordOffset(ossim_uint32 blockNumber,
-                                                 ossim_uint32 bandNumber)const=0;
-   
-   virtual ossim_uint32 getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
-                                                    ossim_uint32 bandNumber)const=0;
-   virtual const ossimRefPtr<ossimNitfCompressionHeader> getCompressionHeader()const=0;
-   virtual const ossimRefPtr<ossimNitfImageBand> getBandInformation(ossim_uint32 idx)const=0;
-   bool hasLut()const;
-   ossimRefPtr<ossimNBandLutDataObject> createLut(ossim_uint32 bandIdx)const;
-   virtual bool isSameAs(const ossimNitfImageHeader* hdr) const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   virtual ossim_uint32 getTotalTagLength()const;
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& printTags(
-      std::ostream& out, const std::string& prefix=std::string()) const;
-   
-   /**
-    * @brief Populates keyword list with metadata.
-    * expample:  country_code: US
-    * 
-    * @param kwl Keywordlist to populate with metadata.
-    *
-    * @param prefix Optional prefix to put in front of key, like: "image1.".
-    */
-   virtual void getMetadata(ossimKeywordlist& kwl,
-                            const char* prefix=0) const;
-
-   /**
-    * @brief pure virtual print method that outputs a key/value type format
-    * adding prefix to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const = 0;
-
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-protected:
-
-   /**
-    * Method to check tie point to see if it will be truncated in field
-    * IGEOLO which has only arc second resolution.
-    * 
-    * Spits out warning if tie does not evenly divide by an arc second.
-    *
-    * @param tie Tie point to check.
-    */
-   void checkForGeographicTiePointTruncation(const ossimDpt& tie) const;
-   
-   std::vector<ossimNitfTagInformation> theTagList;
-
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_0.h b/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_0.h
deleted file mode 100644
index 82d184b..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_0.h
+++ /dev/null
@@ -1,165 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageHeaderV2_0.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfImageHeaderV2_0_HEADER
-#define ossimNitfImageHeaderV2_0_HEADER
-#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
-#include <ossim/support_data/ossimNitfImageBandV2_0.h>
-#include <iterator>
-
-class OSSIMDLLEXPORT ossimNitfImageHeaderV2_0 : public ossimNitfImageHeaderV2_X
-{
-public:
-   ossimNitfImageHeaderV2_0();
-   virtual ~ossimNitfImageHeaderV2_0();
-
-   virtual void parseStream(std::istream &in);
-   virtual void writeStream(std::ostream &out);
-   
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-   virtual bool        isCompressed()const;
-   virtual bool        isEncrypted()const;
-
-   virtual ossim_int32  getNumberOfBands()const;
-   virtual ossim_int32  getNumberOfRows()const;
-   virtual ossim_int32  getNumberOfCols()const;
-   virtual ossim_int32  getNumberOfBlocksPerRow()const;
-   virtual ossim_int32  getNumberOfBlocksPerCol()const;
-   virtual ossim_int32  getNumberOfPixelsPerBlockHoriz()const;
-   virtual ossim_int32  getNumberOfPixelsPerBlockVert()const;
-   virtual ossimString  getImageId()const;
-   virtual ossim_int32  getBitsPerPixelPerBand()const;
-   virtual ossim_int32  getActualBitsPerPixelPerBand()const;
-   virtual ossimString  getIMode()const;
-   virtual ossimString  getSecurityClassification()const;
-
-   /** @return The IDATIM field unparsed. */
-   virtual ossimString  getImageDateAndTime() const;
-   virtual ossimString  getAcquisitionDateMonthDayYear(
-      ossim_uint8 separationChar='-')const;
-   virtual ossimString  getCategory()const;
-   virtual ossimString  getImageSource()const;
-   virtual ossimString  getRepresentation()const;
-   virtual ossimString  getCoordinateSystem()const;
-
-   virtual ossimString  getPixelValueType()const;
-   virtual bool         hasBlockMaskRecords()const;
-   virtual bool         hasPadPixelMaskRecords()const;
-   virtual bool         hasTransparentCode()const;
-   virtual ossim_uint32 getTransparentCode()const;
-   virtual ossim_uint32 getBlockMaskRecordOffset(ossim_uint32 blockNumber,
-                                                 ossim_uint32 bandNumber)const;
-   virtual ossim_uint32 getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
-                                                    ossim_uint32 bandNumber)const;
-   
-   virtual const ossimRefPtr<ossimNitfCompressionHeader> getCompressionHeader()const;
-   virtual const ossimRefPtr<ossimNitfImageBand> getBandInformation(ossim_uint32 idx)const;
-
-   virtual void setNumberOfBands(ossim_uint32 nbands);
-   virtual void setBandInfo(ossim_uint32 idx,
-                            const ossimNitfImageBandV2_0& info);
-   virtual void setNumberOfRows(ossim_uint32 rows);
-   virtual void setNumberOfCols(ossim_uint32 cols);
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-   
-   static const ossimString ISCODE_KW;
-   static const ossimString ISCTLH_KW;
-   static const ossimString ISREL_KW;
-   static const ossimString ISCAUT_KW;
-   static const ossimString CTLN_KW;
-   static const ossimString ISDWNG_KW;
-   static const ossimString ISDEVT_KW;
-   
-TYPE_DATA
-private:
-   //
-   
-   void clearFields();
-
-   /*!
-    * FIELD ISCODE:
-    * is a 40 byte field
-    */
-   char theCodewords[41];
-
-   /*!
-    * FIELD ISCTLH:
-    * is a 40 byte field
-    */
-   char theControlAndHandling[41];
-
-   /*!
-    * FIELD ISREL:
-    * Is a 40 byte field.
-    */
-   char theReleasingInstructions[41];
-
-   /*!
-    * FIELD ISCAUT:
-    * Is a 20 byte field
-    */
-   char theClassificationAuthority[21];
-
-   /*!
-    * FIELD CTLN:
-    */
-   char theSecurityControlNumber[21];
-
-   /*!
-    * FIELD ISDWNG:
-    * Is a 6 byte field with form:
-    *
-    *  YYMMDD.  Year month day
-    *
-    * 999999 indicates that he Originating
-    *        agencies determination is required
-    *        (OADR)
-    * 999998 downgrade event will specify at what
-    *        point and time the declassification
-    *        or downgrading is to take place.
-    */
-   char theSecurityDowngrade[7];
-
-   /*!
-    * FIELD ISDEVT:
-    * This is a conditional field and is present
-    * if the Security downgrade is 999998.
-    */
-   char theDowngradingEvent[41];
-
-   /**
-    * Will contain also the field NBANDS and we will have to recreate the prefix for
-    * 
-    * Container for repetitive fields:
-    * IREPBAND
-    * ISUBCAT
-    * IFC
-    * IMFLT
-    * NLUTS
-    * NELUT1
-    * LUTD
-    */ 
-   std::vector<ossimRefPtr<ossimNitfImageBandV2_0> > theImageBands;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_1.h b/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_1.h
deleted file mode 100644
index 5cbd155..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_1.h
+++ /dev/null
@@ -1,428 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// LICENSE: See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageHeaderV2_1.h 23072 2015-01-12 15:34:18Z dburken $
-
-#ifndef ossimNitfImageHeaderV2_1_HEADER
-#define ossimNitfImageHeaderV2_1_HEADER
-
-#include <stdexcept>
-
-#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
-#include <ossim/support_data/ossimNitfImageBandV2_1.h>
-
-class ossimNitfFileHeaderV2_1;
-class OSSIMDLLEXPORT ossimNitfImageHeaderV2_1 : public ossimNitfImageHeaderV2_X
-{
-public:
-   ossimNitfImageHeaderV2_1();
-   virtual ~ossimNitfImageHeaderV2_1();
-
-   virtual void parseStream(std::istream &in, const ossimNitfFileHeaderV2_1 *file);
-   virtual void parseStream(std::istream &in);
-   virtual void writeStream(std::ostream &out);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;
-   
-   virtual ossimIrect  getImageRect()const;   
-   virtual ossimIrect  getBlockImageRect()const;   
-   virtual bool        isCompressed()const;
-   virtual bool        isEncrypted()const;
-
-   virtual ossim_int32 getNumberOfBands()const;
-   virtual ossim_int32 getNumberOfRows()const;
-   virtual ossim_int32 getNumberOfCols()const;
-   virtual ossim_int32 getNumberOfBlocksPerRow()const;
-   virtual ossim_int32 getNumberOfBlocksPerCol()const;
-   virtual ossim_int32 getNumberOfPixelsPerBlockHoriz()const;
-   virtual ossim_int32 getNumberOfPixelsPerBlockVert()const;
-   virtual ossimString getImageId()const;
-   virtual ossim_int32 getBitsPerPixelPerBand()const;
-   virtual ossim_int32 getActualBitsPerPixelPerBand()const;
-   virtual ossimString getIMode()const;
-
-   /** @return The IDATIM field unparsed. */
-   virtual ossimString  getImageDateAndTime() const;
-   
-   virtual ossimString getAcquisitionDateMonthDayYear(ossim_uint8 separationChar='-')const;
-   virtual ossimString getSecurityClassification()const;
-   virtual ossimString getCategory()const;
-   virtual ossimString getRepresentation()const;
-   virtual ossimString getCoordinateSystem()const;
-   virtual ossimString getGeographicLocation()const;
-   virtual ossimString getPixelValueType()const;
-
-  virtual bool takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
-      ossim_uint32 potentialDesIndex, bool userDefinedTags = false);
-
-   virtual bool hasBlockMaskRecords()const;
-   virtual bool hasPadPixelMaskRecords()const;
-   virtual bool hasTransparentCode()const;
-   virtual ossim_uint32 getTransparentCode()const;
-   virtual ossim_uint32 getBlockMaskRecordOffset(ossim_uint32 blockNumber,
-                                                 ossim_uint32 bandNumber)const;
-   virtual ossim_uint32 getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
-                                                    ossim_uint32 bandNumber)const;
-   
-   virtual void setNumberOfBands(ossim_uint32 nbands);
-   virtual void setBandInfo(ossim_uint32 idx,
-                            const ossimNitfImageBandV2_1& info);
-   
-   virtual void setNumberOfRows(ossim_uint32 rows);
-   virtual void setNumberOfCols(ossim_uint32 cols);
-
-   virtual void setGeographicLocationDms(const ossimDpt& ul,
-                                         const ossimDpt& ur,
-                                         const ossimDpt& lr,
-                                         const ossimDpt& ll);
-   
-   virtual void setGeographicLocationDecimalDegrees(const ossimDpt& ul,
-                                                    const ossimDpt& ur,
-                                                    const ossimDpt& lr,
-                                                    const ossimDpt& ll);
-   virtual void setUtmNorth(ossim_uint32 zone,
-                            const ossimDpt& ul,
-                            const ossimDpt& ur,
-                            const ossimDpt& lr,
-                            const ossimDpt& ll);
-   virtual void setUtmSouth(ossim_uint32 zone,
-                            const ossimDpt& ul,
-                            const ossimDpt& ur,
-                            const ossimDpt& lr,
-                            const ossimDpt& ll);
-
-   virtual void setSecurityClassificationSystem(const ossimString& value);
-   virtual void setCodewords(const ossimString& value);
-   virtual void setControlAndHandling(const ossimString& value);
-   virtual void setReleasingInstructions(const ossimString& value);
-   virtual void setDeclassificationType(const ossimString& value);
-   virtual void setDeclassificationDate(const ossimString& value);
-   virtual void setDeclassificationExempt(const ossimString& value);
-   virtual void setDowngrade(const ossimString& value);
-   virtual void setDowngradeDate(const ossimString& value);
-   virtual void setClassificationText(const ossimString& value);
-   virtual void setClassificationAuthorityType(const ossimString& value);
-   virtual void setClassificationAuthority(const ossimString& value);
-   virtual void setClassificationReason(const ossimString& value);
-   virtual void setSecuritySourceDate(const ossimString& value);
-   virtual void setSecurityControlNumber(const ossimString& value);
-   virtual void setImageMagnification(const ossimString& value);
-   
-   virtual ossimString getImageSource()const; 
-   
-   virtual const ossimRefPtr<ossimNitfCompressionHeader> getCompressionHeader()const;
-   virtual const ossimRefPtr<ossimNitfImageBand> getBandInformation(ossim_uint32 idx)const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-
-   /*!
-    * @brief Method to set fields from a keyword list.
-    *
-    * This is not a true loadState as it does not lookup/initialize all class
-    * members.  This was added to allow defaults, e.g ISCLAS, to be set via a
-    * site configuration file.
-    * Code does not return false if a field(key) is not found..
-    *
-    * @return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   static const ossimString ISCLSY_KW;
-   static const ossimString ISCODE_KW;
-   static const ossimString ISCTLH_KW;
-   static const ossimString ISREL_KW;
-   static const ossimString ISDCTP_KW;
-   static const ossimString ISDCDT_KW;
-   static const ossimString ISDCXM_KW;
-   static const ossimString ISDG_KW;
-   static const ossimString ISDGDT_KW;
-   static const ossimString ISCLTX_KW;
-   static const ossimString ISCATP_KW;
-   static const ossimString ISCAUT_KW;
-   static const ossimString ISCRSN_KW;
-   static const ossimString ISSRDT_KW;
-   static const ossimString ISCTLN_KW;
-   static const ossimString XBANDS_KW;
-
-private:
-   void clearFields();
-
-   ossimString encodeUtm(ossim_uint32 zone,
-                         const ossimDpt& ul,
-                         const ossimDpt& ur,
-                         const ossimDpt& lr,
-                         const ossimDpt& ll)const;
-
-   /**
-    * FIELD: ISCLSY
-    * 
-    * Is a required 2 byte field.
-    *
-    * Image Security Classification System.
-    *
-    * This field shall contain valid values indicating the
-    * national or multinational security system used to classify the image.
-    * Country Codes per FIPS 10-4 shall be used to indicate national security
-    * systems; codes found in DIAM 65-19
-    * shall be used to indicate multinational security systems.
-    * If this field is all BCS spaces (0x20), it shall imply that no security
-    * classification system applies to the image. 
-    */
-   char theSecurityClassificationSys[3];
-
-   /**
-    * FIELD: ISCODE
-    * 
-    * is a 11 byte field
-    *
-    * Image Codewords.
-    *
-    * This field shall contain a valid indicator of the security compartments
-    * associated with the image. Values include one or more of the
-    * tri/digraphs found
-    * in DIAM 65-19 and/or Table A-4. Multiple entries shall be separated by
-    * single
-    * BCS spaces (0x20): The selection of a relevant set of codewords is
-    * application
-    * specific.  If this field is all BCS spaces (0x20), it shall imply that no
-    * codewords apply to the image.
-    */
-   char theCodewords[12];
-
-   /**
-    * FIELD: ISCTLH
-    * 
-    * is a 2 byte field.
-    *
-    * Image Control and Handling.  This field shall contain valid additional
-    * security control and/or handling instructions (caveats) associated with
-    * the image.
-    * Values include digraphs found in DIAM 65-19 and/or Table A4.
-    * The digraph may indicate single or multiple caveats. The selection of a
-    * relevant caveat(s) is application specific.  If this field is all BCS
-    * spaces (0x20),
-    * it shall imply that no additional control and handling instructions
-    * apply to the image. 
-    */
-   char theControlAndHandling[3];
-
-   /**
-    * FIELD: ISREL
-    * 
-    * Is a 20 byte field.
-    *
-    * Image Releasing Instructions.  This field shall contain a valid list of
-    * country and/or multilateral entity codes to which countries and/or
-    * multilateral entities the image is authorized for release.  Valid items
-    * in the list are one or
-    * more country codes as found in FIPS 10-4 and/or codes identifying
-    * multilateral
-    * entities as found in DIAM 65-19. If this field is all BCS spaces (0x20),
-    * it shall imply that no image release instructions apply.
-    */
-   char theReleasingInstructions[21];
-
-
-   /**
-    * FIELD: ISDCTP
-    * 
-    * Is a required 2 byte field.  The valid
-    * values are
-    * DD = declassify on a specific date
-    * DE = Declassify upon occurence of an event
-    * GD = downgrade to a specified level upon
-    *      occurence of an event
-    * O  = OADR
-    * X  = exempt from automatic declassification
-    * spaces = no image security declassification or
-    *          downgrade instruction apply.
-    */
-   char theDeclassificationType[3];
-   
-
-   /**
-    * FIELD: ISDCDT
-    * 
-    * Is a required 8 byte field.
-    *  CCYYMMDD
-    *
-    * CC   is the first 2 chars of the year 00-99
-    * YY   is the second 2 chars of the year 00-99
-    * MM   is the month 01-12
-    * DD   is the day 00-31
-    */
-   char theDeclassificationDate[9];
-
-   /**
-    * FIELD: ISDCXM
-    * 
-    * is a required 4 byte field.
-    * 
-    * Image Declassification Exemption.
-    *
-    * This field shall indicate the reason the image is exempt from automatic
-    * declassification if the value in Image Declassification Type is X. Valid
-    * values are X1 through X8 and X251 through X259. X1 through X8 correspond
-    * to the declassification exemptions found in DOD 5200.1-R, paragraphs
-    * 4-202b(1) through (8) for material exempt from the 10-year rule.
-    * X251 through X259 correspond to the declassification exemptions found in
-    * DOD 5200.1-R, paragraphs 4-301a(1) through (9) for permanently valuable
-    * material exempt from the 25-year declassification system. If this field is
-    * all BCS spaces (0x20), it shall imply that a image declassification exemption
-    * does not apply. 
-    */
-   char theDeclassificationExempt[5];
-   
-   /**
-    * FIELD: ISDG
-    * 
-    * Is a required 1 byte field with form:
-    *
-    *
-    * Image Downgrade.  This field shall indicate the classification level
-    * to which a image is to be downgraded if the values in Image Declassification Type
-    * are GD or GE.
-    *
-    * Valid values are
-    *    S (=Secret),
-    *    C (=Confidential),
-    *    R (= Restricted).
-    *
-    * If this field is all BCS spaces (0x20), it shall imply that image security
-    * downgrading does not apply.  
-    */
-   char theDowngrade[2];
-
-   /**
-    * FIELD: ISDGDT
-    * 
-    * is a required 8 byte field
-    *
-    * CCYYMMDD
-    *
-    * CC   is the first 2 chars of the year 00-99
-    * YY   is the second 2 chars of the year 00-99
-    * MM   is the month 01-12
-    * DD   is the day 00-31
-    */
-   char theDowngradeDate[9];
-
-   /**
-    * FIELD: ISCLTX
-    * 
-    * is a required 43 byte field.
-    *
-    * Image Classification Text.
-    *
-    * This field shall be used to provide additional information
-    * about image classification to include identification of a declassification or downgrading
-    * event if the values in Image Declassification Type are DE or GE.. It may also be used
-    * to identify multiple classification sources and/or any other special handling rules.
-    * Values are user defined free text. If this field is all BCS spaces (0x20), it shall
-    * imply that additional information about image classification does not apply. 
-    */
-   char theClassificationText[44];
-
-   /**
-    * FIELD: ISCATP
-    * 
-    * Is a required 1 byte field.
-    *
-    * O  = original classification Authority
-    * D  = derivative from a single source
-    * M  = derivative from multiple sources
-    * 
-    */
-   char theClassificationAuthType[2];
-
-   /**
-    * FIELD: ISCAUT
-    * 
-    * Is a required 40 byte field.
-    *
-    * Image Classification Authority.
-    *
-    * This field shall identify the classification authority for the image dependent upon the
-    * value in Image Classification Authority Type. Values are user defined free text which
-    * should contain the following information: original classification authority name and
-    * position or personal identifier if the value in Image Classification Authority Type is O;
-    * title of the document or security classification guide used to classify the image
-    * if the value in Image Classification Authority Type is D;
-    * and Derive-Multiple if the image classification was derived from multiple sources.
-    * In the latter case, the image originator will maintain a record of the sources used
-    * in accordance with existing security directives. One of the multiple sources may also
-    * be identified in Image Classification Text if desired. If this field is all BCS spaces
-    * (0x20), it shall imply that no image classification authority applies.
-    */
-   char theClassificationAuthority[41];
-
-   /**
-    * FIELD: ISCRSN
-    * 
-    * This is a required 1 byte field and indicates
-    * the classification reason.
-    *
-    * Image Classification Reason.
-    *
-    * This field shall contain values indicating the reason for classifying the image.
-    * Valid values are A through G. These correspond to the reasons for
-    * original classification per E.O. 12958, Section 1.5.(a) through (g).
-    * If this field is all BCS spaces (0x20), it shall imply that no image classification
-    * reason applies. 
-    */
-   char theClassificationReason[2];
-
-   /**
-    * FIELD: ISSRDT
-    * 
-    * This is a required 8 byte field.
-    *
-    * CCYYMMDD
-    *
-    * CC   is the first 2 chars of the year 00-99
-    * YY   is the second 2 chars of the year 00-99
-    * MM   is the month 01-12
-    * DD   is the day 00-31
-    *
-    */
-   char theSecuritySourceDate[9];
-
-   /**
-    * FIELD: ISCTLN
-    * 
-    * is a required 15 byte field.
-    */
-   char theSecurityControlNumber[16];
-
-  
-   /**
-    * FIELD: XBANDS
-    * 
-    * This is a conditional 5 byte field and ranges from
-    * 00010-99999.  This exists if theNumberOfBands is 0.
-    */
-   char theNumberOfMultispectralBands[6];
-
-   std::vector<ossimRefPtr<ossimNitfImageBandV2_1> > theImageBands;
-
-TYPE_DATA   
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_X.h b/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_X.h
deleted file mode 100644
index b85b0fd..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageHeaderV2_X.h
+++ /dev/null
@@ -1,946 +0,0 @@
-#ifndef ossimNitfImageHeaderV2_X_HEADER
-#define ossimNitfImageHeaderV2_X_HEADER
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-
-class OSSIM_DLL ossimNitfImageHeaderV2_X : public ossimNitfImageHeader
-{
-public:
-   ossimNitfImageHeaderV2_X();
-
-   /** @brief Returns the zero based image rectangle. */
-   virtual ossimIrect  getImageRect()const;
-
-   /**
-    * @brief Returns the zero based image rectangle expanded out to block boundaries.
-    * @note  This may or may not be the same as the rect from getImageRect.
-    */
-   virtual ossimIrect  getBlockImageRect()const;
-   
-   void setImageId(const ossimString& value);
-   void setAquisitionDateTime(const ossimString& value);
-   void setTargetId(const ossimString& value);
-   void setTitle(const ossimString& value);
-   void setSecurityClassification(const ossimString& value);
-   void setEncryption(const ossimString& value);
-   void setImageSource(const ossimString& value);
-   void setJustification(const ossimString& value);
-   void setCoordinateSystem(const ossimString& value);
-   void setGeographicLocation(const ossimString& value);
-   void setNumberOfComments(const ossimString& value);
-   void setCompression(const ossimString& value);
-   void setCompressionRateCode(const ossimString& value);
-   void setDisplayLevel(const ossimString& value);
-   void setAttachmentLevel(const ossimString& value);
-   void setPixelType(const ossimString& pixelType = ossimString("INT"));
-   void setBitsPerPixel(ossim_uint32 bitsPerPixel);
-   void setActualBitsPerPixel(ossim_uint32 bitsPerPixel);
-   void setImageMode(char mode);
-   void setCategory(const ossimString& category);
-   void setRepresentation(const ossimString& rep);
-   void setBlocksPerRow(ossim_uint32 blocks);
-   void setBlocksPerCol(ossim_uint32 blocks);
-   void setNumberOfPixelsPerBlockRow(ossim_uint32 pixels);
-   void setNumberOfPixelsPerBlockCol(ossim_uint32 pixels);
-
-   ossim_uint64 getDataLocation()const;
-   ossimString getImageId()const;
-   ossimString getAquisitionDateTime()const;
-   ossimString getTargetId()const;
-   ossimString getTitle()const;
-   ossimString getSecurityClassification()const;
-   ossimString getEncryption()const;
-   ossimString getImageSource()const;
-   ossimString getJustification()const;
-   ossimString getCoordinateSystem()const;
-   ossimString getGeographicLocation()const;
-
-   
-   ossimString getNumberOfComments()const;
-   ossimString getCompressionCode()const;
-   ossimString getCompressionRateCode()const;
-   ossim_uint32 getDisplayLevel()const;
-   ossim_uint32 getAttachmentLevel()const;
-   ossimString getPixelType()const;
-   ossim_uint32 getBitsPerPixel()const;
-   ossim_uint32 getActualBitsPerPixel()const;
-   char getImageMode()const;
-   ossimString getCategory()const;
-   ossimString getRepresentation()const;
-   ossim_uint32 getBlocksPerRow()const;
-   ossim_uint32 getBlocksPerCol()const;
-   ossim_uint32 getNumberOfPixelsPerBlockRow()const;
-   ossim_uint32 getNumberOfPixelsPerBlockCol()const;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @brief Gets the IMAG field as a string.  Satisfies pure virtual.
-    * @return IMAG field
-    */
-   virtual ossimString  getImageMagnification()const;
-
-   /**
-    * @brief Gets the ILOC field as an ossimIpt. Satisfies pure virtual.
-    * @param loc Initialized with the field.
-    * @note: Do not confuse with "data location".
-    */
-   virtual void getImageLocation(ossimIpt& loc)const;
-   
-   virtual void setGeographicLocationDms(const ossimDpt& ul,
-                                         const ossimDpt& ur,
-                                         const ossimDpt& lr,
-                                         const ossimDpt& ll);
-   
-   virtual void setGeographicLocationDecimalDegrees(const ossimDpt& ul,
-                                                    const ossimDpt& ur,
-                                                    const ossimDpt& lr,
-                                                    const ossimDpt& ll);
-   virtual void setUtmNorth(ossim_uint32 zone,
-                            const ossimDpt& ul,
-                            const ossimDpt& ur,
-                            const ossimDpt& lr,
-                            const ossimDpt& ll);
-   
-   virtual void setUtmSouth(ossim_uint32 zone,
-                            const ossimDpt& ul,
-                            const ossimDpt& ur,
-                            const ossimDpt& lr,
-                            const ossimDpt& ll);
-  
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-
-   /*!
-    * @brief Method to set fields from a keyword list.
-    *
-    * This is not a true loadState as it does not lookup/initialize all class
-    * members.  This was added to allow defaults, e.g ISCLAS, to be set via a
-    * site configuration file.
-    * Code does not return false if a field(key) is not found..
-    *
-    * @return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-
-   static const ossimString IM_KW;
-   static const ossimString IID1_KW;
-   static const ossimString IDATIM_KW;
-   static const ossimString TGTID_KW;
-   static const ossimString IID2_KW;
-   static const ossimString ITITLE_KW; // also IID2 in 2.1 spec and ITITLE in 2.0 spec
-   static const ossimString ISCLAS_KW;
-   static const ossimString ENCRYP_KW;
-   static const ossimString ISORCE_KW;
-   static const ossimString NROWS_KW;
-   static const ossimString NCOLS_KW;
-   static const ossimString PVTYPE_KW;
-   static const ossimString IREP_KW;
-   static const ossimString ICAT_KW;
-   static const ossimString ABPP_KW;
-   static const ossimString PJUST_KW;
-   static const ossimString ICORDS_KW;
-   static const ossimString IGEOLO_KW;
-   static const ossimString NICOM_KW;
-   static const ossimString ICOM_KW;
-   static const ossimString IC_KW;
-   static const ossimString COMRAT_KW;
-   static const ossimString NBANDS_KW;
-   static const ossimString ISYNC_KW;
-   static const ossimString IMODE_KW;
-   static const ossimString NBPR_KW;
-   static const ossimString NBPC_KW;
-   static const ossimString NPPBH_KW;
-   static const ossimString NPPBV_KW;
-   static const ossimString NBPP_KW;
-   static const ossimString IDLVL_KW;
-   static const ossimString IALVL_KW;
-   static const ossimString ILOC_KW;
-   static const ossimString IMAG_KW;
-   static const ossimString UDIDL_KW;
-   static const ossimString UDOFL_KW;
-   static const ossimString IXSHDL_KW;
-   static const ossimString IXSOFL_KW;
-   static const ossimString IMDATOFF_KW;
-   static const ossimString BMRLNTH_KW;
-   
-protected:
-   /*!
-    * FIELD IM:
-    * Is a required 2 byte value and is IM.
-    */
-   char theType[3];
-
-   /**
-    * FIELD: IID1
-    * Is a required 10 Alphanumeric value.
-    */
-   char theImageId[11];
-
-   /*!
-    * FIELD IDATIM:
-    * Contains the time of acquisition of the image.
-    * this is a 14 byte field and has the format:
-    *
-    * DDHHMMSSZMONYY
-    *
-    * DD   is the day of the month
-    * HH   is the Hour
-    * MM   is the minutes
-    * SS   is the seconds
-    * Z    is fixed (Zulu time)
-    * MON  is the first 3 chars of the month
-    * YY   is the year
-    */
-   char theDateTime[15];
-
-   /**
-    * FIELD: TGTID
-    * 
-    * is a 17 byte field.  Has the form
-    *
-    * BBBBBBBBBBFFFFFCC
-    *
-    * where:
-    *
-    * B     is the encyclopedia id
-    * F     is the functional category code
-    * C     is the country code.
-    */
-   char theTargetId[18];
-
-   /**
-    * FIELD: IID2
-    * 
-    * Is 80 bytes and contains the title
-    */
-   char theTitle[81];
-
-   /**
-    * FIELD: ISCLAS
-    * 
-    * Is a required 1 byte field and has value:
-    *
-    * T    = Top secret
-    * S    = Secrect
-    * C    = confidential
-    * R    = Restricted
-    * U    = Unclassified
-    */
-   char theSecurityClassification[2];
-
-   /*!
-    * FIELD ENCRYP:
-    * Is arequired 1 byte field.
-    *
-    * 0  = no encryption
-    * 1  = encryption
-    */
-   char theEncryption[2];
-
-   /**
-    * FIELD: ISORCE
-    * 
-    * Is a 42 byte optional field.
-    */
-   char theImageSource[43];
-
-   /**
-    * FIELD: NROWS
-    * 
-    * Required 8 byte number 00000002-99999999
-    */
-   char theSignificantRows[9];
-
-   /**
-    * FIELD: NCOLS
-    * 
-    * Required 8 byte number 00000002-99999999
-    */
-   char theSignificantCols[9];
-
-   /**
-    * FIELD: PVTYPE
-    * 
-    * Required 3 byte value.
-    * Values:
-    *
-    * INT   integer 16 bits
-    * B     for bi-level represented as single bits 1 or 0
-    * SI    signend 16 bit integer
-    * R     32 bit float
-    * C     for complex (32 bit float real part, 32 bit float imag part)
-    *       Adjacent 4 byte blocks
-    * U     for user defined.
-    */
-   char thePixelValueType[4];
-
-   /**
-    * FIELD: IREP
-    * 
-    * This is required 8 byte field.
-    *
-    * Values:
-    *
-    * MONO    indicates monnochrome
-    * RGB     indicates true color red green blue
-    * RGB/LUT indicates RGB lookup table.
-    * 1D      indicates monoband data.
-    * 2D      indicates for 2 dimensional data
-    * NM      indicates multidimensional data
-    * MULTI   indicates multiband imgery
-    * YCbCr601 indicates compressed in CCIR 601
-    *          color space using JPEG (field IC=C3)
-    */
-   char theRepresentation[9];
-
-   /**
-    * FIELD: ABPP
-    * 
-    * Is optional and indicates the number of
-    * bits per band 01-96
-    */
-   char theActualBitsPerPixelPerBand[3];
-
-   /**
-    * FIELD: ICAT
-    *
-    * This is a required 8 byte field.  Contains info
-    * about the specific category of the image.
-    *
-    * VIS    visible imagery
-    * SL     side looking infrared
-    * TI     thermal infrared
-    * FL     forward looking infrared
-    * RD     radar
-    * EO     elctro-optical
-    * OP     optical
-    * HR     high resolution radar
-    * HS     hyperspectral
-    * CP     color frame photography
-    * BP     black/white frame photography
-    * SAR    Synthetic Aperture Radar
-    * SARIQ  SAR radio hologram
-    * IR     infrared.
-    * MS     multispectral
-    * FP     fingerprints
-    * MRI    Magnetic Resonance imagery
-    * XRAY   x-rays
-    * CAT    cat scans
-    * MAP    maps
-    * PAT    patch
-    * LEG    legends
-    * DTEM   elevation models
-    * MATR   matrix data
-    * LOCG   location grids
-    * VD     video
-    * 
-    *
-    * default value is VIS
-    */
-   char theCategory[9];
-
-   /**
-    * FIELD: PJUST
-    * 
-    * Is 1 byte optional field.  Can have
-    * values L (left) or R (right).  Any other value
-    * is to interpreted as right justified.
-    *
-    * This indicates how the significant bits are justified
-    * in the field
-    */
-   char theJustification[2];
-
-   /**
-    * FIELD: ICORDS
-    * 
-    * Is a 1 byte required field and can have
-    * values 
-    *
-    * U indicates UTM MGRS format
-    * G indicates Geodetic (Geographic)
-    * N indicates UTM Northern hemisphere
-    * S indicates UTM SOuthern hemisphere
-    * D Decimal degrees
-    *
-    * spaces means no coordinate system
-    *
-    * Geodetic reference system is WGS84.
-    */
-   char theCoordinateSystem[2];
-
-   /*!
-    * FIELD NICOM:
-    * this is a required 1 byte field and indicates the number of comments.
-    */
-   char theNumberOfComments[2];
-
-   /*!
-   * FIELD ICOMnn:
-   * Dynamic buffer for the comments.  Each comment is 80 bytes
-   */
-   char *theImageComments;
-
-   /**
-    * FIELD: IGEOLO
-    * 
-    * This is a conditional field.  If theCoordinateSystem
-    * is blank then it does not exist.  If it's any other
-    * value then it's given in image coordinate order
-    *
-    * (0, 0) (0, MaxCol) (MaxRow, MaxCol) (MaxRow, 0)
-    *
-    * if its geodetic or geocentric it will have a lat lon coordinate
-    * with each coordinate as:
-    * Lat = ddmmssX
-    *       where d is degrees and m is minutes
-    *       and s is seconds and X is either N (North) or S (South).
-    * Lon = dddmmssX
-    *       where d is degrees and m is minutes
-    *       and s is seconds and X is either N (North) or S (South).
-    *
-    *       
-    * if its UTM then zzeeeeeennnnnnn where
-    *
-    * z is the zone number
-    * e is the easting
-    * n is the northing
-    *
-    * if its decimal degrees then +-dd.ddd +-dd.ddd four times where
-    * + is northern hemispher and - is souther hemisphere for lat
-    * and longitude + is easting and - is westing.
-    *
-    */
-   char theGeographicLocation[61];
-
-   /**
-    * FIELD: IC
-    * 
-    * This is a required 2 byte field and indicates the compression
-    * type of the image.
-    *
-    * NC  indicates not compressed
-    * C1  indicates bi-level
-    * C2  indicates ARIDPCM
-    * C3  inidates JPEG
-    * C4  inidcates Vector Quantization
-    * C5  indicates lossless jpeg
-    * I1  indicates a downsampled jpeg
-    * M0  indicates compressed images
-    * M3  indicates compressed images
-    * M4  indicates compressed images
-    * M5  indicates compression
-    * NM  indicates uncompressed
-    *
-    * The M's and NM are blocked images that contain
-    * block mask and/or transparent pixel mask.  There
-    * will be an Image Data Mask Subheader ath the beginning
-    * of the image data area.
-    *
-    */
-   char theCompression[3];
-
-   /**
-    * FIELD COMRAT
-    * 
-    * This is a conditional 4 byte  field.  if theCompression is
-    * not equal to NC then this field exists.
-    *
-    * Compression Rate Code.
-    *
-    * If the Image Compression (IC) field contains, C1, C4, M1, or M4,
-    * this field shall be present and contain a code indicating the
-    * compression rate for the image.
-    * If the value in IC is C1 or M1, the valid codes are 1D, 2DS, and 2DH,
-    * where: 1D represents One-dimensional Coding
-    *        2DS represents Two-dimensional Coding Standard Vertical
-    *        Resolution (K=2)
-    *        2DH represents Two-dimensional Coding High Vertical Resolution
-    *        (K=4)
-    *        
-    * A BCS zero (0x30) will be used for the Y value when custom Q-Tables are
-    * used.
-    * Explanation of these codes can be found in ITU-T T-4, AMD2 08/95.
-    *
-    * If the value in IC is C3, C5, I1, or M5, the value of this field shall
-    * be 00.0.
-    * The value 00.0 represents embedded tables and is required by JPEG.
-    * Explanation of embedded tables can be found in MIL-STD-188-198A and
-    * NIMA N0105-97.
-    * If the value in IC is C4 or M4, this field shall contain a value given
-    * in the
-    * form nn.n representing the number of bits-per-pixel for the compressed
-    * image.
-    * Explanation of the compression rate for vector quantization can be
-    * found in MIL-STD-188-199.
-    * This field is omitted if the value in IC is NC or NM. If IC = I1, value
-    * = 00.0.
-    * 4 BCS-A See description for constraints C 
-    */
-   char theCompressionRateCode[5];
-
-   /**
-    * FIELD: NBANDS
-    * 
-    * Is required 1 byte field  and will have value 1-9
-    *
-    * If theRepresentation is MONO this should be 1
-    * if theRepresentation is RGB  this should be 3
-    * if theRepresentation is RGB/LUT this should be 1
-    * if theRepresentation YCbCr601 this should be 3
-    * if theRepresentation is MULTI this should be 2-9
-    *
-    * if this field is 0 then it's multi spectral data
-    * larger than 9
-    */
-   char theNumberOfBands[2];
-
-   /**
-    * FIELD: ISYNC
-    * 
-    * Required 1 byte field.  Has value 0 or 4
-    */
-   char theImageSyncCode[2];
-
-   /**
-    * FIELD: IMODE
-    *
-    * Required 1 byte field.
-    *
-    *
-    * Image Mode.  This field shall contain an indicator of whether the image
-    * bands are stored in the
-    * file sequentially or band interleaved by block or band interleaved by
-    * pixel format or
-    * band interleaved by row.
-    *
-    * Valid values are B, P, R, and S.  The significance of the IMODE value
-    * must be interpreted
-    * with the knowledge of whether the image is:
-    *     JPEG compressed (IC=C3, C5, M3, or M5),
-    *     VQ compressed (IC=C4, or M4),
-    *     or uncompressed (IC=NC or NM).
-    * When IC=C1 or M1, the use of IMODE defaults to B.  When IC=I1, IMODE is
-    * B.
-    *
-    * For the uncompressed case:  The value R represents band interleaved by
-    * row,
-    * where the ordering mechanism stores the pixel values of each band in
-    * row sequential order.
-    * Within each block, all pixel values of the first row of the first band
-    * are followed by
-    * pixel values of the first row of the second band continuing until all
-    * values of the
-    * first row are stored.  The remaining rows are stored in a similar
-    * fashion until the last
-    * row of values has been stored.  Each block shall be zero filled to the
-    * next octet boundary
-    * when necessary.  The value S represents band sequential, where all
-    * blocks for the first band
-    * are followed by all blocks for the second band, and so on:
-    * [(block1, band1), (block2, band1), ... (blockM, band1)],
-    * [(block1, band2), (block2, band 2), ... (blockM, band2)] ...
-    * [(block1, bandN), (block2, bandN), ... (blockM, bandN)].
-    *
-    * The values B and P indicate variations on block sequential where all
-    * data from all bands
-    * for the first block is followed by all data from all bands for the
-    * second block, and so on.
-    * The variations are based on the way the bands are organized within each
-    * block.
-    * B represents band interleaved by block.
-    *
-    * This means that within each block, the bands follow one 1 BCS-A B, P,
-    * R, S R
-    *
-    *
-    * another:  [(block1, band1), (block1, band2), ...
-    *           (block1, bandN)],
-    *           [(block2, band1),
-    *           (block2, band2), ...
-    *           (block2, bandN)], ...
-    *           [(blockM, band1),
-    *           (blockM, band2), ...
-    *           (blockM, bandN)].
-    *
-    * P represents band interleaved by pixel within each block:  such as, for
-    * each block,
-    * one after the other, the full pixel vector (all band values) appears
-    * for every pixel in
-    * the block, one pixel after another, the block column index varying
-    * faster than the block
-    * row index.  If the NBANDS field is 1, the cases B and S coincide.
-    * In this case, this field shall contain B.  If the Number of Blocks is
-    * 1(NBPR = NBPC = 1),
-    * this field shall contain B for non-interleaved by pixel, and P for
-    * interleaved by pixel.
-    * The value S is only valid for images with multiple blocks and multiple
-    * bands.
-    * For the JPEG-compressed case:  The presence of B, P, or S implies
-    * specific ordering of
-    * data within the JPEG image data representation.  The interpretation of
-    * the values of IMODE
-    * for this case is specified in MIL-STD188-198A.
-    *
-    * For the Vector Quantization compressed case:  VQ compressed images are
-    * normally either RGB with a
-    * color look-up table or monochromatic.  In either case, the image is
-    * single band, and the IMODE
-    * field defaults to B.  However, it is possible to have a multiband VQ
-    * compressed image in band sequential,
-    * band interleaved by block, or band interleaved by pixel format.
-    * 
-    */
-   char theImageMode[2];
-
-   /**
-    * FIELD: NBPR
-    * 
-    * Required 4 byte value.  ranges from
-    * 0001-9999
-    */
-   char theNumberOfBlocksPerRow[5];
-   
-   /**
-    * FIELD: NBPC
-    * 
-    * Required 4 byte value. Ranges from
-    * 0001-9999
-    */
-   char theNumberOfBlocksPerCol[5];
-
-   /**
-    * FIELD: NPPBH
-    * 
-    * Reuqired 4 byte field
-    */
-   char theNumberOfPixelsPerBlockHoriz[5];
-
-   /**
-    * FIELD: NPPBV
-    * 
-    * Reuqired 4 byte field
-    */
-   char theNumberOfPixelsPerBlockVert[5];
-
-   /**
-    * FIELD: NBPP
-    * 
-    * Required 2 byte field.
-    *
-    * Number of Bits Per Pixel Per Band.  If IC contains NC, NM, C4, or M4,
-    * this field shall contain the number of storage bits used for the value
-    * from each component of a pixel vector.  The value in this field always
-    * shall be greater than or equal to Actual Bits Per Pixel (ABPP).
-    * For example, if 11-bit pixels are stored in 16 bits,
-    * this field shall contain 16 and Actual Bits Per Pixel shall contain 11.
-    * If IC = C3, M3, C5, M5, or I1 this field shall contain the value 8 or
-    * the value 12.
-    * If IC = C1, this field shall contain the value 1. 2 BCS-N 01-96 R 
-    */
-   char theNumberOfBitsPerPixelPerBand[3];
-
-   /**
-    * FIELD: IDLVL
-    *
-    * Display Level.
-    * 
-    * Required 3 byte field.  Ranges from 001-999
-    *
-    * This field shall contain a valid value that indicates the graphic display
-    * level of the image relative to other displayed file components in a
-    * composite
-    * display.  The display level of each displayable file component (image
-    * or graphic)
-    * within a file shall be unique; that is, each number from 001 to 999 is
-    * the display
-    * level of, at most, one item.  The meaning of display level is fully
-    * discussed in
-    * paragraph 5.3.3.  The image or graphic component in the file having the
-    * minimum
-    * display level shall have attachment level 0.
-    * 
-    */
-   char theDisplayLevel[4];
-
-   /**
-    * FIELD: IALVL
-    *
-    * Attachment Level
-    * 
-    * Required 3 byte field.  Ranges from 000-998
-    *
-    * This field shall contain a valid value that indicates the attachment
-    * level of the image.
-    * Valid values for this field are 0, and the display level value of any
-    * other image or
-    * graphic in the file.  The meaning of attachment level is fully discussed
-    * in
-    * paragraph 5.3.4. The image, graphic, or text component in the file
-    * having the
-    * minimum display level shall have attachment level 0.
-    * 
-    */
-   char theAttachmentLevel[4];
-
-   /**
-    * FIELD: ILOC
-    * 
-    * Required 10 byte field.
-    *
-    * Image Location.  The image location is the location of the first pixel
-    * of the first line of
-    * the image.  This field shall contain the image location represented as
-    * rrrrrccccc, where rrrrr and ccccc are the row and column offset from the
-    * ILOC or SLOC value of the item to which the image is attached.  A row or
-    * column
-    * value of 00000 indicates no offset.  Positive row and column values
-    * indicate offsets down
-    * and to the right and range from 00001 to 99999, while negative row and
-    * column
-    * values indicate offsets up and to the left and must be within the range
-    * -0001 to -9999.
-    * The location in the common coordinate system of all displayable graphic
-    * components can be computed from the offsets given in the ILOC and SLOC
-    * fields. 10 BCS-N -9999
-    * 
-    */
-   char theImageLocation[11];
-
-   /**
-    * FIELD: IMAG
-    * 
-    * Required 4 byte field
-    *
-    * Image Magnification.
-    *
-    * This field shall contain the magnification (or reduction) factor of the
-    * image
-    * relative to the original source image.  Decimal values are used to
-    * indicate magnification,
-    * and decimal fraction values indicate reduction.
-    * For example, 2.30 indicates the original image has been magnified by a
-    * factor of
-    * �2.30,� while �0.5� indicates the original image has been reduced by a
-    * factor of 2.
-    * The default value is 1.0, indicating no magnification or reduction.
-    * In addition, the following values shall be used for reductions that are
-    * reciprocals of
-    * nonnegative powers of 2: /2 (for 1/2), /4 (for 1/4), /8 (for 1/8), /16
-    * (for 1/16), /32 (for 1/32),
-    * /64 (for 1/64), /128 (for 1/128). 4 BCS-A /2, /4, /8, /16, /32, /64,
-    * /128 or
-    * decimal value (Default is 1.0 followed by BCS space (0x20)) R
-    * 
-    */
-   char theImageMagnification[5];
-
-   /**
-    * FIELD: UDIDL
-    * 
-    * Required 5 byte field. 00000 or 00003-99999
-    *
-    * User Defined Image Data Length.  A value of 0 shall represent that no
-    * tagged record extensions
-    * are included in the UDID field.  If a tagged record extension exists,
-    * the field shall contain
-    * the sum of the length of all the tagged record extensions (see
-    * paragraph 5.7.l.l) appearing in
-    * the UDID field plus 3 bytes (length of UDOFL field).  If a tagged
-    * record extension is too long
-    * to fit in the UDID field, it may be put in a data extension segment
-    * (see paragraph 5.8.1.3.1.)
-    *
-    */
-   char theUserDefinedImageDataLength[6];
-
-   /**
-    * FIELD: UDOFL
-    * 
-    * conditional 3 byte field. if theUserDefinedImageDataLength
-    * is not 0
-    *
-    * User Defined Overflow.  If present, this field shall contain 000 if the
-    * tagged record extensions
-    * in UDID do not overflow into a DES, or shall contain the sequence number
-    * of the DES into which
-    * they do overflow.  This field shall be omitted if the field UDIDL
-    * contains BCS zeros (0x30).
-    *
-    * 
-    */
-   char theUserDefinedOverflow[4];
-
-   /**
-    * FIELD: IXSHDL
-    * 
-    * Is a required 5 byte field. 00000 or 00003-99999
-    *
-    * Extended Subheader Data Length.  This field shall contain the length in
-    * bytes in
-    * IXSHD plus 3 (length of IXSOFL).  The length is 3 plus sum of the
-    * lengths of all the
-    * tagged record extensions (see paragraph 5.7.1.2) appearing in the IXSHD
-    * field.  A value of
-    * BCS zeros (0x30) shall represent that no tagged record extensions are
-    * included in the IXSHD field.
-    * If a tagged record extension exists, the field shall contain the sum of
-    * the length of all the tagged
-    * record extensions (see paragraph 5.7.1.2) appearing in the IXSHD field
-    * plus 3 bytes (length of
-    * IXSOFL field).  If a tagged record extension is too long to fit in the
-    * IXSHD field, it shall may
-    * be put in a data extension segment (see paragraph 5.7.1.4). 
-    */
-   char theExtendedSubheaderDataLen[6];
-
-   /**
-    * FIELD: IXSOFL
-    * 
-    * Is a conditional 3 byte field.  This depends on
-    * theExtendedSubheaderDataLen not being 0.
-    *
-    * Extended Subheader Data.  If present, this field shall contain tagged
-    * record
-    * extensions (see paragraph 5.8.1.2) approved and under configuration
-    * management by the ISMC.
-    * The length of this field shall be the length specified by the field
-    * IXSHDL minus 3.  Tagged
-    * record extensions in this field for an image shall contain information
-    * pertaining specifically
-    * to the image.  Tagged record extensions shall appear one after the other
-    * in this field with no
-    * intervening bytes.  The first byte of this field shall be the first byte
-    * of the  first tagged record
-    * extension appearing in the field.  The last byte of this field shall be
-    * the last byte of the last
-    * tagged record extension to appear in the field.  This field shall be
-    * omitted if the field IXSHDL
-    * contains 0.
-    */
-   char theExtendedSubheaderOverflow[4];
-
-   /**************************************************************************
-    *                    THIS IS THE MASK TABLE IF PRESENT
-    */
-   
-   /**
-    * FIELD NAME: IMDATOFF
-    * 
-    * Blocked Image Data Offset.
-    * 
-    * 4 byte Binary integer: 0x00000000 to 0xFFFFFFFF
-    * 
-    * This field is included if the IC value equals NM, M1, M3, M4, or M5.
-    * It identifies the offset from the beginning of the Image Data Mask to
-    * the first byte of the blocked image data.
-    * This offset, when used in combination with the offsets provided in the
-    * BMR fields,
-    * can provide random access to any recorded image block in any image band.
-    * 
-    */
-   ossim_uint32 theBlockedImageDataOffset;
-
-   /**
-    * FIELD NAME: BMRLNTH
-    *
-    * Block Mask Record Length.
-    *
-    * 2 byte Unsigned binary integer
-    * 0x0000=No Block mask record; 0x0004=Block mask
-    * records (4 bytes each) are present  
-    * 
-    * This field is included if the IC value equals NM, M1, M3, M4, or M5.
-    * It identifies the length of each Block Mask Record in bytes.
-    * When present, the length of each Block Mask Record is 4 bytes.
-    * The total length of all the block Mask Records is equal to
-    *
-    * For S mode BMRLNTH x NBPR x NBPC x NBANDS  (one 4 byte record for each
-    * block of each band in the image).
-    * and for all other modes BMRLNTH x NBPR x NBPC
-    * 
-    * If all of the image blocks are recorded,
-    * this value may be set to 0, and the conditional BMR fields are not
-    * recorded/transmitted.
-    * Otherwise, the value may be set to 4, and the conditional BMR fields
-    * are
-    * recorded/transmitted and can be used as an off-set index for each
-    * image block in each band of the image.
-    * If this field is present, but coded as 0, then only a pad pixel mask is
-    * included.
-    */
-   ossim_uint16 theBlockMaskRecordLength;
-
-   /**
-    * FIELD: TMRLNTH
-    *
-    * Pad Pixel Mask Record Length.
-    *
-    * 2 byte Unsigned binary integer a value of
-    * 0x0000=No Pad pixel mask records and 
-    * 0x0004=Pad pixel mask records (4 bytes each) are present
-    * 
-    * This field is included if the IC value equals NM, M1, M3, M4, or M5 
-    * It identifies the length of each Pad Pixel Mask Record in bytes.
-    * When present, the length of each Pad Pixel Mask Record is 4 bytes.
-    * The total length of the Pad Pixel Mask Records is equal to
-    * 
-    * For image mode S then TMRLNTH x NBPR x NBPC x NBANDS (one 4 byte record
-    * for each block for each band in the image).
-    * else for all other modes TMRLNTH x NBPR x NBPC
-    * 
-    * If none of the image blocks contain pad pixels, this value is set to 0,
-    * and the conditional TMR fields are not recorded/transmitted.
-    * For IC value of M3, the value shall be set to 0.
-    * If this field is present, but coded as 0, then a Block Mask is included.
-    */
-   ossim_uint16 thePadPixelMaskRecordLength;
-   
-   /**
-    *  FIELD: TPXCDLNTH
-    *
-    *  Transparent Output Pixel Code Length.
-    *
-    *  2 byte Unsigned binary integer;
-    *  0x0000=No pad pixels; 0x0001 to 0x0010=pad pixel code length in bits
-    *  
-    *  This field is included if the IC value equals NM, M1, M3, M4, M5.
-    *  It identifies the length in bits of the Transparent Output Pixel Code.
-    *  If coded as 0, then no transparent pixels are present,
-    *  and the TPXCD field is not recorded.  For IC value of M3, the
-    *  value shall be set to 0..
-    *  
-    */
-   ossim_uint16 theTransparentOutputPixelCodeLength;
-
-   /**
-    * FIELD: TPXCD
-    *
-    * Pad Output Pixel Code.
-    *
-    * This field is included if the IC value equals NM, M1, M3, M4, M5, M0 and
-    * TPXCDLNTH is not 0.  It contains the output pixel code that represents a
-    * pad pixel in the image.  This value is unique within the image, and
-    * allows the user to identify pad pixels.  The pad output pixel code
-    * length is determined by TPXCDLNTH, but the value is stored in a maximum
-    * of 2 bytes.  If the number of bits used by TPXCD is less than the number
-    * of bits available for storage,
-    * the value shall be justified in accordance with the PJUST field in the
-    * image subheader. �
-    * 3A Binary integer; 0 to 2^n -1 where n=TPXCDLNTH
-    */
-   ossim_uint16 thePadOutputPixelCode;
-
-   std::vector<ossim_uint32> theBlockMaskRecords;
-   std::vector<ossim_uint32> thePadPixelMaskRecords;
-   ossimRefPtr<ossimNitfCompressionHeader> theCompressionHeader;
-   ossim_uint64 theDataLocation;
-
-TYPE_DATA
-   
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfImageLut.h b/ossim/include/ossim/support_data/ossimNitfImageLut.h
deleted file mode 100644
index 7824c20..0000000
--- a/ossim/include/ossim/support_data/ossimNitfImageLut.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageLut.h 9094 2006-06-13 19:12:40Z dburken $
-#ifndef ossimNitfImageLut_HEADER
-#define ossimNitfImageLut_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimObject.h>
-
-//using namespace std;
-
-class ossimNitfImageLut : public ossimObject
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimNitfImageLut &data);
-   ossimNitfImageLut();
-   virtual ~ossimNitfImageLut();
-   virtual void parseStream(std::istream &in)=0;
-   virtual std::ostream& print(std::ostream& out)const=0;
-   virtual ossim_uint32 getNumberOfEntries()const=0;
-   virtual void setNumberOfEntries(ossim_uint32 numberOfEntries)=0;
-   virtual ossim_uint8 getValue(ossim_uint32 idx)const=0;
-
-TYPE_DATA;
-};
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfInfo.h b/ossim/include/ossim/support_data/ossimNitfInfo.h
deleted file mode 100644
index a790465..0000000
--- a/ossim/include/ossim/support_data/ossimNitfInfo.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: NITF Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimNitfInfo_HEADER
-#define ossimNitfInfo_HEADER
-
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/support_data/ossimNitfFile.h>
-
-/**
- * @brief NITF info class.
- *
- * Encapsulates the dumpnitf functionality.
- */
-class OSSIM_DLL ossimNitfInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimNitfInfo();
-
-   /** virtual destructor */
-   virtual ~ossimNitfInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-   
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   virtual bool getKeywordlist(ossimKeywordlist& kwl)const;
-   
-private:
-   ossimRefPtr<ossimNitfFile> m_nitfFile;
-};
-
-#endif /* End of "#ifndef ossimNitfInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfJ2klraTag.h b/ossim/include/ossim/support_data/ossimNitfJ2klraTag.h
deleted file mode 100644
index 0921bde..0000000
--- a/ossim/include/ossim/support_data/ossimNitfJ2klraTag.h
+++ /dev/null
@@ -1,177 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimNitfJ2klraTag.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: NITF J2KLRA tag.
-//
-// See:  ISO/IEC BIIF Profile BPJ2K01.00 Table 9-3.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#ifndef ossimNitfJ2klraTag_HEADER
-#define ossimNitfJ2klraTag_HEADER 1
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/base/ossimConstants.h>
-
-#include <iosfwd>
-#include <vector>
-
-class OSSIM_DLL ossimNitfJ2klraTag : public ossimNitfRegisteredTag
-{
-public:
-   enum 
-   {
-      ORIG_SIZE      = 1,
-      NLEVELS_O_SIZE = 2,
-      NBANDS_O_SIZE  = 5,
-      NLAYERS_O_SIZE = 3,
-      
-      LAYER_ID_SIZE  = 3, // repeating
-      BITRATE_SIZE   = 9, // repeating
-
-      NLEVELS_I_SIZE = 2, // conditional
-      NBANDS_I_SIZE  = 5, // conditional
-      NLAYERS_I_SIZE = 3  // conditional
-   };
-   
-   /** default constructor */
-   ossimNitfJ2klraTag();
-  
-   /**
-    * Parse method.
-    *
-    * @param in Stream to parse.
-    */
-   virtual void parseStream(std::istream& in);
-   
-   /**
-    * Write method.
-    *
-    * @param out Stream to write to.
-    */
-   virtual void writeStream(std::ostream& out);
-   
-   /** @return The size of this record in bytes (123) within a nitf file. */
-   virtual ossim_uint32 getSizeInBytes()const;
-   
-   /**
-    * Clears all string fields within the record to some default nothingness.
-    */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out, const std::string& prefix) const;
-
-   /** @return ORIG field as a number. */
-   ossim_uint32 getOriginNumber() const;
-
-   /** @return NLAYERS_O field as a number. */
-   ossim_uint32 getNumberOfLayersOriginal() const;
-
-protected:
-
-   // Container for repeating fields.
-   class ossimJ2klraLayer
-   {
-   public:
-      /**
-       * FIELD: LAYER_ID
-       * required 3 byte field
-       * 000 - 999
-       * Layer ID Number. Repeating.
-       */
-      char m_layer_id[LAYER_ID_SIZE+1];
-      
-      /**
-       * FIELD: BITRATE
-       * required 9 byte
-       * 00.000000 – 37.000000
-       * Bitrate
-       */
-      char m_bitrate[BITRATE_SIZE+1];
-   };
-
-   /**
-    * FIELD: ORIG
-    *
-    * Required 1 byte.
-    *
-    * 0 - Original NPJE
-    * 1 – Parsed NPJE
-    * 2 – Original EPJE*
-    * 3 – Parsed EPJE*
-    * 8 – Original other
-    * 9 – Parsed other
-    *
-    * Original compressed data.
-    */
-   char m_orig[ORIG_SIZE+1];
-   
-   /**
-    * FIELD: NLEVELS_O
-    * required 2 bytes
-    * 00 - 32
-    * Number of wavelet levels in original image.
-    */
-   char m_levels_o[NLEVELS_O_SIZE+1];
-   
-   /**
-    * FIELD: NBANDS_O
-    * required 5 bytes
-    * 00000 - 16384
-    * Number of bands in original image.
-    */
-   char m_bands_o[NBANDS_O_SIZE+1];
-   
-   /**
-    * FIELD: NLAYERS_O
-    * required 3 bytes
-    * 000 - 999
-    * Number of layers in original image.
-    */
-   char m_layers_o[NLAYERS_O_SIZE+1];
-
-   /** repeating fields */
-   std::vector<ossimJ2klraLayer> m_layer;
-   
-   /**
-    * FIELD: NLEVELS_I
-    * Conditional 2 bytes if ORIG=1, 3, or 9.
-    * 00 - 32
-    * Number of wavelet levels in this image.
-    */
-   char m_nlevels_i[NLEVELS_I_SIZE+1];
-   
-   /**
-    * FIELD: NBANDS_I
-    * Conditional 5 bytes if ORIG=1, 3,or 9.
-    * 00000 = 16384
-    * Number of bands in this image.
-    */
-   char m_nbands_i[NBANDS_I_SIZE+1];
-   
-   /**
-    * FIELD: NLAYERS_I
-    * Conditional 3 bytes if ORIG=1, 3, or 9.
-    * 000 - 999
-    * Number of Layers in this image.
-    */
-   char m_nlayers_i[NLAYERS_I_SIZE+1];
-   
-TYPE_DATA   
-};
-
-#endif /* End of "#ifndef ossimNitfJ2klraTag_HEADER_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfLocalGeographicTag.h b/ossim/include/ossim/support_data/ossimNitfLocalGeographicTag.h
deleted file mode 100644
index 36d3736..0000000
--- a/ossim/include/ossim/support_data/ossimNitfLocalGeographicTag.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Intelligence Data Systems. 
-//
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfLocalGeographicTag.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfLocalGeographicTag_HEADER
-#define ossimNitfLocalGeographicTag_HEADER
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfLocalGeographicTag : public ossimNitfRegisteredTag
-{
-public:
-   ossimNitfLocalGeographicTag();
-   virtual ~ossimNitfLocalGeographicTag();
-
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   virtual void clearFields();
-
-   virtual void setDegreesPerPixelLat(double deltaLat);
-   virtual void setDegreesPerPixelLon(double deltaLon);
-   virtual void setLatOrigin(double origin);
-   virtual void setLonOrigin(double origin);
-   
-protected:
-   /**
-    * FIELD: ARV
-    *
-    * required 9 byte field
-    *
-    * Longitude density
-    *
-    * This field shall contain the pixel ground spacing in E/W direction that is
-    * the number of pixels or elements intervals in 360 degrees.
-    * 9 BCS-N positive integer 000000002 to 999999999. 
-    */
-   char theLonDensity[10];
-
-   /**
-    * FIELD: BRV
-    *
-    * required 9 byte field
-    *
-    * Latitude density
-    *
-    * This field shall contain the pixel ground spacing in N/S direction that is the number of
-    * pixels or elements intervals in 360 degrees. 9 BCS-N positive integer 000000002 to 999999999 R 
-    */ 
-   char theLatDensity[10];
-
-   /**
-    * FIELD: LSO
-    * 
-    * required 15 byte field
-    *
-    * Longitude of Reference Origin This field shall contain the longitude of the origin pixel
-    * (row number 0, column number 0) in the absolute coordinate system. 15 BCS-N R 
-    */
-   char theLonOrigin[16];
-
-   /**
-    * FIELD: PSO
-    *
-    * required 15 byte field
-    *
-    * Latitude of Reference Origin This field shall contain the latitude of the origin
-    * pixel (row number 0, column number 0) in the absolute coordinate system. 15 BCS-N R 
-    */
-   char theLatOrigin[15];
-
-TYPE_DATA   
-};
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfMstgtaTag.h b/ossim/include/ossim/support_data/ossimNitfMstgtaTag.h
deleted file mode 100644
index 880cab4..0000000
--- a/ossim/include/ossim/support_data/ossimNitfMstgtaTag.h
+++ /dev/null
@@ -1,218 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: MSTGTA Mission Target Information Extension Format
-// tag class declaration.
-//
-// See document STDI-0002 Table 8-16 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#ifndef ossimNitfMstgtaTag_HEADER
-#define ossimNitfMstgtaTag_HEADER 1
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfMstgtaTag : public ossimNitfRegisteredTag
-{
-public:
-
-   enum 
-   {
-      TGT_NUM_SIZE       = 5,
-      TGT_ID_SIZE        = 12,
-      TGT_BE_SIZE        = 15,
-      TGT_PRI_SIZE       = 3,
-      TGT_REQ_SIZE       = 12,
-      TGT_LTIOV_SIZE     = 12,
-      TGT_TYPE_SIZE      = 1,
-      TGT_COLL_SIZE      = 1,
-      TGT_CAT_SIZE       = 5,
-      TGT_UTC_SIZE       = 7,
-      TGT_ELEV_SIZE      = 6,
-      TGT_ELEV_UNIT_SIZE = 1,
-      TGT_LOC_SIZE       = 21
-    };
-   
-   /** @brief default constructor */
-   ossimNitfMstgtaTag();
-
-   /** @brief destructor */
-   virtual ~ossimNitfMstgtaTag();
-
-   /** @brief Method to parse data from stream. */
-   virtual void parseStream(std::istream& in);
-
-   /** @brief Method to write data to stream. */
-   virtual void writeStream(std::ostream& out);
-
-   /** @brief Method to clear all fields including null terminating. */
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-protected:
-
-   /** Type R = Required Type <R> = BCS spaces allowed for entire field */
-   
-   /**
-    * FIELD: TGT_NUM
-    *
-    * TYPE: R
-    * 
-    * 5 byte field
-    *
-    * 00001 ti 99999
-    */
-   char theTgtNum[TGT_NUM_SIZE+1];
-
-   /**
-    * FIELD: TGT_ID
-    *
-    * TYPE: <R>
-    *
-    * 12 byte field
-    *
-    * Disignator of Target, alphnumeric.
-    */
-   char theTgtId[TGT_ID_SIZE+1];
-
-   /**
-    * FIELD: TGT_BE
-    *
-    * TYPE: <R>
-    * 
-    * 15 byte field
-    * 
-    * alphnumeric
-    */
-   char theTgtBe[TGT_BE_SIZE+1];
-
-   /**
-    * FIELD: TGT_PRI
-    *
-    * TYPE: <R>
-    *
-    * 3 byte field
-    * 
-    * Target priority, 1 = top, 2 = 2nd...  001 to 999
-    */
-   char theTgtPri[TGT_PRI_SIZE+1];
-
-   /**
-    * FIELD: TGT_REQ
-    *
-    * TYPE: <R>
-    *
-    * 12 byte field
-    * 
-    * Target requester. alphnumeric 
-    */
-   char theTgtReq[TGT_REQ_SIZE+1];
-
-   /**
-    * FIELD: TGT_LTIOV
-    *
-    * TYPE: <R>
-    * 
-    * 12 byte field
-    * 
-    * Latest Time Information of Value CCYYMMDDhhmm
-    */
-   char theTgtLtiov[TGT_LTIOV_SIZE+1];
-
-   /**
-    * FIELD: TGT_TYPE
-    *
-    * TYPE: <R>
-    *
-    * 1 byte field
-    * 
-    * Pre-Planned Target Type: 0 = point, 1 = strip, 2 = area, 0 to 9.
-    */
-   char theTgtType[TGT_TYPE_SIZE+1];
-
-   /**
-    * FIELD: TGT_COLL
-    *
-    * TYPE: R
-    * 
-    * 1 byte field
-    * 
-    * Pre-Planned Collection Technique: 0 to 9
-    */
-   char theTgtColl[TGT_COLL_SIZE+1];
-
-   /**
-    * FIELD: TGT_CAT
-    *
-    * TYPE: <R>
-    *
-    * 5 byte field
-    * 
-    * Target Functional Category Code 10000 to 99999
-    */
-   char theTgtCat[TGT_CAT_SIZE+1];
-
-   /**
-    * FIELD: TGT_UTC
-    *
-    * TYPE: <R>
-    * 
-    * 7 byte field
-    *
-    * Planned Time at Target hhmmssZ
-    */
-   char theTgtUtc[TGT_UTC_SIZE+1];
-
-   /**
-    * FIELD: TGT_ELEV
-    *
-    * TYPE: <R>
-    * 
-    * 6 byte field
-    * 
-    * Target Elevation -01000 to +30000 feet or meters
-    */
-   char theTgtElev[TGT_ELEV_SIZE+1];
-
-   /**
-    * FIELD: TGT_ELEV_UNIT
-    *
-    * TYPE: <R>
-    * 
-    * 1 byte field
-    * 
-    * Unit of Target Elevation, f = feet, m = meters
-    */
-   char theTgtElevUnit[TGT_ELEV_UNIT_SIZE+1];
-
-   /**
-    * FIELD: TGT_LOC
-    *
-    * TYPE: R
-    *
-    * 21 byte field
-    * 
-    * Target Location
-    */
-   char theTgtLoc[TGT_LOC_SIZE+1];
-   
-TYPE_DATA   
-};
-
-#endif /* matches #ifndef ossimNitfMstgtaTag_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfNameConversionTables.h b/ossim/include/ossim/support_data/ossimNitfNameConversionTables.h
deleted file mode 100644
index f32218e..0000000
--- a/ossim/include/ossim/support_data/ossimNitfNameConversionTables.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimNitfNameConversionTables.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfNameConversionTables_HEADER
-#define ossimNitfNameConversionTables_HEADER
-#include <ossim/base/ossimConstants.h>
-
-class ossimString;
-
-class OSSIM_DLL ossimNitfNameConversionTables
-{
-public:
-   ossimNitfNameConversionTables();
-
-   ossimString convertMapProjectionNameToNitfCode(const ossimString& mapProjectionName)const;
-   ossimString convertNitfCodeToOssimProjectionName(const ossimString& nitfProjectionCode)const;
-   ossimString convertNitfCodeToNitfProjectionName(const ossimString& nitfProjectionCode)const;
-   ossimString convertNitfProjectionNameToNitfCode(const ossimString& nitfProjectionName)const;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfPiaimcTag.h b/ossim/include/ossim/support_data/ossimNitfPiaimcTag.h
deleted file mode 100644
index 89a421c..0000000
--- a/ossim/include/ossim/support_data/ossimNitfPiaimcTag.h
+++ /dev/null
@@ -1,428 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: PIAIMC tag class declaration.
-// 
-// "Profile for Imagery Access Image Support Extensions"
-//
-// See document STDI-0002 Table 6-1 for more info.
-// 
-// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfPiaimcTag.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfPiaimcTag_HEADER
-#define ossimNitfPiaimcTag_HEADER
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/base/ossimConstants.h>
-
-class ossimString;
-
-class OSSIM_DLL ossimNitfPiaimcTag : public ossimNitfRegisteredTag
-{
-public:
-   enum 
-   {
-      CLOUDCVR_SIZE   =   3,
-      SRP_SIZE        =   1,
-      SENSMODE_SIZE   =  12,
-      SENSNAME_SIZE   =  18,
-      SOURCE_SIZE     = 255,
-      COMGEN_SIZE     =   2,
-      SUBQUAL_SIZE    =   1,
-      PIAMSNNUM_SIZE  =   7,
-      CAMSPECS_SIZE   =  32,
-      PROJID_SIZE     =   2,
-      GENERATION_SIZE =   1,
-      ESD_SIZE        =   1,
-      OTHERCOND_SIZE  =   2,
-      MEANGSD_SIZE    =   7,
-      IDATUM_SIZE     =   3,
-      IELLIP_SIZE     =   3,
-      PREPROC_SIZE    =   2,
-      IPROJ_SIZE      =   2,
-      SATTRACK_SIZE   =   8
-      //             -------
-      //                362
-   };
-   
-   /** default constructor */
-   ossimNitfPiaimcTag();
-  
-   /**
-    * Parse method.
-    *
-    * @param in Stream to parse.
-    */
-   virtual void parseStream(std::istream& in);
-   
-   /**
-    * Write method.
-    *
-    * @param out Stream to write to.
-    */
-   virtual void writeStream(std::ostream& out);
-   
-   /**
-    * Clears all string fields within the record to some default nothingness.
-    */
-   virtual void clearFields();
-   
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;
-   /**
-    * @return CLOUDCVR field as an ossimString.
-    */
-   ossimString getCloudcvrString() const;
-
-   /**
-    * @return SRP field as an ossimString.
-    */
-   ossimString getSrpString() const;
-   
-   /**
-    * @return SENSMODE field as an ossimString.
-    */
-   ossimString getSensmodeString() const;
-   
-   /**
-    * @return SENSNAME field as an ossimString.
-    */
-   ossimString getSensnameString() const;
-   
-    /**
-    * @return SOURCE field as an ossimString.
-    */
-   ossimString getSourceString() const;
-  
-   /**
-    * @return COMGEN field as an ossimString.
-    */
-   ossimString getComgenString() const;
-   
-   /**
-    * @return SUBQUAL field as an ossimString.
-    */
-   ossimString getSubqualString() const;
-
-   /**
-    * @return PIAMSNNUM field as an ossimString.
-    */
-   ossimString getPiamsnnumString() const;
-
-   /**
-    * @return field as an ossimString.
-    */
-   ossimString getString() const;
-
-   /**
-    * @return CAMSPECS field as an ossimString.
-    */
-   ossimString getCamspecsString() const;
-
-   /**
-    * @return PROJID field as an ossimString.
-    */
-   ossimString getProjidString() const;
-
-   /**
-    * @return GENERATION field as an ossimString.
-    */
-   ossimString getGenerationString() const;
-
-   /**
-    * @return ESD field as an ossimString.
-    */
-   ossimString getEsdString() const;
-   
-   /**
-    * @return OTHERCONDfield as an ossimString.
-    */
-   ossimString getOthercondString() const;
-
-   /**
-    * @return MEANGSD field as an ossimString.
-    */
-   ossimString getMeadGsdString() const;
-
-   /**
-    * @return MEANGSD field as a double converted to meters.
-    *
-    * @note Conversion used: gsd_in_meters = gsd / 12.0 * MTRS_PER_FT
-    */
-   ossim_float64 getMeanGsdInMeters() const;
-
-   /**
-    * @return IDATUM field as an ossimString.
-    */
-   ossimString getIdatumString() const;
-   
-   /**
-    * @return IELLIP field as an ossimString.
-    */
-   ossimString getIellipString() const;
-   
-   /**
-    * @return PREPROC field as an ossimString.
-    */
-   ossimString getPreprocString() const;
-   
-   /**
-    * @return IPROJ field as an ossimString.
-    */
-   ossimString getIprojString() const;
-   
-   /**
-    * @return SATTRACK field as an ossimString.
-    */
-   ossimString getSattrackString() const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-protected:
-
-   /**
-    * FIELD: CLOUDCVR
-    *
-    * 3 byte field
-    *
-    * Indicates the precentage of the image that is obscured by cloud. A value
-    * os 999 indicates an unknown condition.
-    *
-    * 000 to 100, or 999
-    */
-   char theCloudcvr[CLOUDCVR_SIZE+1];
-   
-   /**
-    * FIELD: SRP
-    *
-    * 1 byte field
-    *
-    * Indicates whether or not standard radiometric product data is available.
-    *
-    * Y,N
-    */
-   char theSrp[SRP_SIZE+1];
-   
-   /**
-    * FIELD: SENSMODE
-    *
-    * 12 byte field
-    *
-    * Indentifies the sensor mode used in capturing the image.
-    *
-    * WHISKBROOM, PUSHROOM, FRAMING, SPOT, SWATH, TBD
-    */
-   char thesSensmode[SENSMODE_SIZE+1];
-   
-   /**
-    * FIELD: SENSNAME
-    *
-    * 18 byte field
-    *
-    * Indentifies the name of sensor used in capturing the image.
-    *
-    * USIGS DM, SENSORTYPE Name
-    */
-   char theSensname[SENSNAME_SIZE+1];
-   
-   /**
-    * FIELD: SOURCE
-    *
-    * 18 byte field
-    *
-    * Indicated where the image came from.
-    *
-    * alphanumeric
-    */
-   char theSource[SOURCE_SIZE+1];
-   
-   /**
-    * FIELD: COMGEN
-    *
-    * 2 byte field
-    *
-    * Compression Generation.
-    *
-    * 00 to 99
-    */
-   char theComgen[COMGEN_SIZE+1];
-   
-   /**
-    * FIELD: SUBQUAL
-    *
-    * 1 byte field
-    *
-    * Subjective Quality
-    *
-    * P-Poor, G-Good, E-Excellent, F-Fair
-    */
-   char theSubqual[SUBQUAL_SIZE+1];
-   
-   /**
-    * FIELD: PIAMSNNUM
-    *
-    * 7 byte field
-    *
-    * Indicates the mission number assigned to the reconnaissance mission.
-    *
-    * EARS 1.1 page 4-28
-    */
-   char thePiamsnnum[PIAMSNNUM_SIZE+1];
-   
-   /**
-    * FIELD: CAMSPECS
-    *
-    * 32 byte field
-    *
-    * Specifies the brand name of the camera used and the focal length of the
-    * lens.
-    *
-    * alphanumeric
-    */
-   char theCamspecs[CAMSPECS_SIZE+1];
-   
-   /**
-    * FIELD: PROJID
-    *
-    * 2 byte field
-    *
-    * Indentifies collection platform project identifier code.
-    *
-    * EARS Appendix 9
-    */
-   char theProjid[PROJID_SIZE+1];
-   
-   /**
-    * FIELD: GENERATION
-    *
-    * 1 byte field
-    *
-    * Specifies the number of image generations of the product.  The number(0)
-    * is reserved for the original product.
-    *
-    * 0 to 9
-    */
-   char theGeneration[GENERATION_SIZE+1];
-
-   /**
-    * FIELD: ESD
-    *
-    * 1 byte field
-    *
-    * Indicates whether or not Exploitation Support Data is available and
-    * contained withing the product data.
-    *
-    * Y,N
-    */
-   char theEsd[ESD_SIZE+1];
-
-   /**
-    * FIELD: OTHERCOND
-    *
-    * 2 byte field
-    *
-    * Indicates other conditions that affect the imagery over the target.
-    *
-    * EARS 1.1 page 4 to 28
-    */
-   char theOthercond[OTHERCOND_SIZE+1];
-
-   /**
-    * FIELD: MEANGSD
-    *
-    * 7 byte field
-    *
-    * The geometric mean of the across and along scan center-to-center distance
-    * between contiguous ground samples.
-    *
-    * 00000.0 to 99999.9 Expressed in inches, accuracy=10%
-    */
-   char theMeanGsd[MEANGSD_SIZE+1];
-
-   /**
-    * FIELD: IDATUM
-    *
-    * 3 byte field
-    *
-    * Identifies the mathematical representation of the earth used to
-    * geo-correct/or to rectify the image.
-    * (Identifies the Datum assiciated with IGEOLO.)
-    *
-    * Horizontal_Reference_Datum_Code(refer to DDDS element)
-    */
-   char theIdatum[IDATUM_SIZE+1];
-
-   /**
-    * FIELD: IELLIP
-    *
-    * 3 byte field
-    *
-    * Identifies the mathematical representation of the earth used to
-    * geo-correct/or to rectify the image.
-    * (Identifies the Ellipsoid assiciated with IGEOLO.)
-    */
-   char theIellip[IELLIP_SIZE+1];
-  
-   /**
-    * FIELD: PREPROC
-    *
-    * 2 byte field
-    *
-    * Identifies the level of radiometric and geometric processing applied to
-    * the product by the commercial vendor.
-    *
-    * USIGS DM, IMAGEDATASET Processing Level Code.
-    */
-   char thePreproc[PREPROC_SIZE+1];
-  
-   /**
-    * FIELD: IPROJ
-    *
-    * 2 byte field
-    *
-    * Identifies the 2D-map projection used by commercial vendors to
-    * geo-correct/or to rectify the image.
-    *
-    * DIGEST, Part 3 table 6-1
-    */
-   char theIproj[IPROJ_SIZE+1];
-
-   /**
-    * FIELD: SATTRACK
-    *
-    * 8 byte field
-    *
-    * Identifies location of an image acquired by LANDSAT or SPOT (only) along
-    * the satellite path.
-    *
-    * Minimum values:
-    *  PATH(J)=0001
-    *  ROW(K) =0001
-    * Maximum values:
-    *  PATH(J)=9999
-    *  ROW(K) =9999
-    *
-    *  Recorded as PATH/ROW 00010001
-    */
-   char theSattrack[SATTRACK_SIZE+1];
-   
-TYPE_DATA   
-};
-
-#endif /* End of "#ifndef ossimNitfPiaimcTag_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfProjectionParameterTag.h b/ossim/include/ossim/support_data/ossimNitfProjectionParameterTag.h
deleted file mode 100644
index 34a03f8..0000000
--- a/ossim/include/ossim/support_data/ossimNitfProjectionParameterTag.h
+++ /dev/null
@@ -1,333 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfProjectionParameterTag.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimNitfProjectionParameterTag_HEADER
-#define ossimNitfProjectionParameterTag_HEADER
-#include <vector>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfProjectionParameterTag : public ossimNitfRegisteredTag
-{
-public:
-   ossimNitfProjectionParameterTag();
-   virtual ~ossimNitfProjectionParameterTag();
-
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-
-   virtual ossim_uint32 getSizeInBytes()const;
-   virtual void clearFields();
-   virtual void clearParameters();
-   virtual void addParameter(const ossimString& param);
-   virtual void addParameter(const ossim_float64& param);
-   void setName(const ossimString& name);
-   void setCode(const ossimString& code);
-   ossimString getName()const;
-   ossimString getCode()const;
-   void setFalseX(double falseX);
-   void setFalseY(double falseY);
-   double getFalseX()const;
-   double getFalseY()const;
-   
-protected:
-   /**
-    * FIELD: PRN
-    *
-    * required 80 byte field.
-    * 
-    * Projection Name
-    *
-    * This field shall contain the name of the projection to which the Image Segment refers.
-    * The default value is Transverse Mercator.
-    */
-   char theProjectionName[81];
-
-   /**
-    *
-    * FIELD: PCO
-    *
-    * required 2 byte field.
-    * 
-    * Projection Code
-    *
-    * This field shall contain the code of the projection to which the Image Segment refers.
-    * The default value is TC.
-    *
-    * Code values:
-    *
-    * AC           Albers Equal-Area Conic
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. std. parallel nearer to equator
-    *                3. std parallel farther from equator
-    *                4. latitude of origin
-    *              
-    * AK           (Lambert) Azimuthal Equal-Area
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *              
-    * AL           Azimuthal Equidistant
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    * 
-    * BF           Bonne
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Scale factor at projection origin
-    *                
-    * CC           Equidistant Conic with 1 Standard Parallel
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Latitude of Std. Parallel
-    *                
-    * CP           Equirectangular
-    *              Parameters:
-    *                1. Longitude of central meridian 
-    *                2. Latitude of true scale
-    *                3. Radius of sphere
-    *                
-    * CS           Cassini-Soldner
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *            
-    * ED           Eckert VI
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Radius of sphere
-    * 
-    * EF           Eckert IV
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Radius of sphere
-    * 
-    * GN           Gnomonic
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    * 
-    * HX           Hotine Oblique Mercator based on 2 Points 
-    *              Parameters:
-    *                1. Scale factor at projection origin
-    *                2. latitude of projection origin
-    *                3. longitude of first point defining center line
-    *                4. latitude of fist point defining center line
-    *                
-    * KA           Equidistant Conic with 2 Standard Parallels 
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Latitude of origin
-    *                3. Latitude of standard parallel Nearer to equator
-    *                4. Latitude of standard parallel farther from equator
-    *
-    * LA           Laborde
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Scale factor at proj origin
-    *                4. Azimuth at origin of axis of constant scale
-    * 
-    * LE           Lambert Conformal Conic
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. std. parallel nearer to equator
-    *                3. std. parallel farther from equator
-    *                4. Latitude of origin
-    * 
-    * LI           Cylindrical Equal Area
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Latitude of origin
-    *                
-    * LJ           Lambert Equal-Area Meridional
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Latitude of origin
-    *                
-    * MC           Mercator
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of true scale
-    *                3. Latitude of reference origin
-    *                
-    * MH           Miller Cylindrical
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Radius of sphere
-    *                
-    * MJ           French Lambert
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Scale factor at proj origin
-    *                
-    * MP           Mollweide
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Radius of sphere
-    *                
-    * NT           New Zealand Map Grid
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                
-    * OC           Oblique Mercator
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Azimuth
-    *                4. radius of sphere
-    *                
-    * OD           Orthographic
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Radius of sphere
-    *                
-    * PG           Polar Stereographic
-    *              Parameters:
-    *                1. Latitude of true scale
-    *                
-    * PH           Polyconic
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Latitude of origin
-    *                
-    * RS or RB     Hotine Oblique Mercator (Rectified Skew Orthomorphic)
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Azimuth East of North for Central Line (Skew X-Axis at Proj. origin)
-    *                4. Scale factor at proj origin
-    *                
-    * RX           Robinson
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Radius of sphere
-    *                
-    * SA           Sinusoidal
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Radius of sphere
-    *               
-    * SD           Oblique Stereographic
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Scale factor at origin
-    *                
-    * SX           Space Oblique Mercator
-    *              Parameters:
-    *                1. Application code:
-    *                     1 = Landsat, USGS equations
-    *                     2 = Landsat, EOSAT equations
-    *                2. Vehicle number
-    *                3. Orbital path number
-    *                
-    * TC           Transverse Mercator
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Central Scale Factor
-    *                3. Latitude of origin
-    *                
-    * TX           Transverse Cylindrical Equal Area
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Latitude of origin
-    *                3. Scale factor along central meridian
-    *                
-    * VA           Van der Grinten
-    *              Parameters:
-    *                1. Longitude of central meridian
-    *                2. Radius of sphere
-    * 
-    * VX           General Vertical NearSide Perspective
-    *              Parameters:
-    *                1. Longitude of origin
-    *                2. Latitude of origin
-    *                3. Heigh of perspective map above surface
-    *
-    * ZY           Other Known Projection
-    */
-   char theProjectionCode[3];
-
-   /**
-    * FIELD: NUM_PRJ
-    *
-    * required 1 byte field ranging from 0-9
-    * 
-    * Number of Projection Parameters
-    *
-    * This field shall contain the number of projection parameters.
-    * The PRJ Field should be repeated as necessary depending on the
-    * projection code (see Part 3-6).  If the number of projection parameters
-    * provided is lower than specified in Part 3-6, the
-    * missing parameters value is 0.
-    *
-    */
-   char              theNumberOfParameters[2];
-   
-   /**
-    * FIELD(S): PRJn
-    *
-    * Conditional 15 byte field each.
-    *
-    * Projection Parameter Each occurrence of this field provides an appropriate
-    * parameter to accurately describe the projection.  See Part 3-6 to know the
-    * kind of parameters needed for each projection code. 15 BCS-N C 
-    */
-   std::vector<ossimString> theProjectionParameters;
-   
-   /**
-    * FIELD: XOR
-    *
-    * required  15 byte field.
-    * 
-    * Projection False X (Easting) Origin
-    *
-    * This field shall contain the projection false X (easting) origin.
-    * The default value is 000000000000000, which implies that there is no projection false X origin.
-    * 
-    */
-   char theFalseXOrigin[16];
-
-
-   /**
-    * FIELD: YOR
-    *
-    * required 15 byte field.
-    *
-    * Projection False Y (Northing) Origin
-    *
-    * This field shall contain the projection false Y (northing) origin.
-    * The default value is 000000000000000, which implies that there is
-    * no projection false Y origin.
-    * 
-    */
-   char theFalseYOrigin[16];
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfRegisteredTag.h b/ossim/include/ossim/support_data/ossimNitfRegisteredTag.h
deleted file mode 100644
index bbd87a7..0000000
--- a/ossim/include/ossim/support_data/ossimNitfRegisteredTag.h
+++ /dev/null
@@ -1,125 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRegisteredTag.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfRegisteredTag_HEADER
-#define ossimNitfRegisteredTag_HEADER 1
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimPropertyInterface.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <string>
-
-class ossimKeywordlist;
-class ossimString;
-
-class OSSIM_DLL ossimNitfRegisteredTag : public ossimObject ,
-                                         public ossimPropertyInterface
-{
-public:
-   /** @brief default constructor */
-   ossimNitfRegisteredTag();
-   
-   /** @brief Constructor that takes name and size. */
-   ossimNitfRegisteredTag(const std::string& tagName, ossim_uint32 tagLength);
-
-   /** @brief destructor */
-   virtual ~ossimNitfRegisteredTag();
-   
-   /**
-    * @brief This will return the name of the registered tag for this user
-    * defined header.
-    *
-    * @note Deprecated - Use getTagName()
-    */
-   virtual std::string getRegisterTagName() const;
-   
-   /**
-    * @brief This will return the name of the registered tag for this user
-    * defined header.
-    */
-   virtual const std::string& getTagName() const;
-
-   /**
-    * @param tagName Name of tag.
-    *
-    * @note Users should set tag name as this is an unknown tag.
-    */
-   virtual void setTagName(const std::string& tagName);
- 
-   /**
-    * @brief Returns the length in bytes of the tag from the CEL or REL field.
-    * 
-    * @note Depricated use: getTagLength()
-    *
-    * The entire TRE length is 11 plus this(the size of the CEL or REL field).
-    *
-    * @return Length of REDATA or CEDATA.
-    */
-   virtual ossim_uint32 getSizeInBytes()const;
-
-  /**
-    * @brief Returns the length in bytes of the tag from the CEL or REL field.
-    *
-    * The entire TRE length is 11 plus this(the size of the CEL or REL field).
-    *
-    * @return Length of REDATA or CEDATA.
-    */
-   virtual ossim_uint32 getTagLength()const;
-
-  /**
-    * @brief Set the tag length.
-    *
-    * @param length Length of tag.
-    */
-   virtual void setTagLength(ossim_uint32 length);
-    
-   /**
-    * This will allow the user defined data to parse the stream.
-    */
-   virtual void parseStream(std::istream& in)=0;
-   virtual void writeStream(std::ostream& out)=0;
-
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-   /**
-    * @brief Default interface to populate keyword list with metadata.
-    * expample:  country_code: US
-    * This implementation does nothing.  Derived classes should implement as
-    * they see fit.
-    * 
-    * @param kwl Keywordlist to populate with metadata.
-    *
-    * @param prefix Optional prefix to put in front of key, like: "image1.".
-    */
-   virtual void getMetadata(ossimKeywordlist& kwl,
-                            const char* prefix=0) const;
-
-   /**
-    * @brief Pure virtual print method that outputs a key/value type format
-    * adding prefix to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix)const;
-   
-protected:
-   std::string  m_tagName;
-   ossim_uint32 m_tagLength;
-   
-TYPE_DATA
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfRegisteredTagFactory.h b/ossim/include/ossim/support_data/ossimNitfRegisteredTagFactory.h
deleted file mode 100644
index 3f60095..0000000
--- a/ossim/include/ossim/support_data/ossimNitfRegisteredTagFactory.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// LICENSE: MIT see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRegisteredTagFactory.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfRegisteredTagFactory_HEADER
-#define ossimNitfRegisteredTagFactory_HEADER 1
-
-#include <ossim/support_data/ossimNitfTagFactory.h>
-
-class ossimNitfRegisteredTagFactory : public ossimNitfTagFactory
-{
-public:
-   virtual ~ossimNitfRegisteredTagFactory();
-   static ossimNitfRegisteredTagFactory* instance();
-   
-   virtual ossimRefPtr<ossimNitfRegisteredTag> create(const ossimString &tagName)const;
-
-protected:
-   ossimNitfRegisteredTagFactory();
-
-TYPE_DATA   
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfRpcATag.h b/ossim/include/ossim/support_data/ossimNitfRpcATag.h
deleted file mode 100644
index 9c4b89d..0000000
--- a/ossim/include/ossim/support_data/ossimNitfRpcATag.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 Intelligence Data Systems. 
-//
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-//
-// Description: Nitf support class for RPC00A -
-// Rational Polynomial Coefficient extension.
-//
-//********************************************************************
-// $Id: ossimNitfRpcATag.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfRpcATag_HEADER
-#define ossimNitfRpcATag_HEADER 1
-
-#include <ossim/support_data/ossimNitfRpcBase.h>
-
-/**
- * The layout of RPC00B is the same as RPC00A.  The difference is how the
- * coefficients are used; hence, all the code is in the ossimNitfRpcBase class.
- */
-class OSSIM_DLL ossimNitfRpcATag : public ossimNitfRpcBase
-{
-public:
-   
-   ossimNitfRpcATag();
-   
-protected:
-   
-TYPE_DATA   
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfRpcBTag.h b/ossim/include/ossim/support_data/ossimNitfRpcBTag.h
deleted file mode 100644
index 7a0617b..0000000
--- a/ossim/include/ossim/support_data/ossimNitfRpcBTag.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 Intelligence Data Systems. 
-//
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRpcBTag.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfRpcBTag_HEADER
-#define ossimNitfRpcBTag_HEADER 1
-
-#include <ossim/support_data/ossimNitfRpcBase.h>
-
-/**
- * The layout of RPC00B is the same as RPC00A.  The difference is how the
- * coefficients are used; hence, all the code is in the ossimNitfRpcBase class.
- */
-class OSSIM_DLL ossimNitfRpcBTag : public ossimNitfRpcBase
-{
-public:
-   ossimNitfRpcBTag();
-
-TYPE_DATA   
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfRpcBase.h b/ossim/include/ossim/support_data/ossimNitfRpcBase.h
deleted file mode 100644
index 88bc1f2..0000000
--- a/ossim/include/ossim/support_data/ossimNitfRpcBase.h
+++ /dev/null
@@ -1,544 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-// Description: Nitf base support data class for RPC tags.
-// 
-// Rational Polynomial Coefficient extension.
-//
-// See: http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
-//
-//********************************************************************
-// $Id: ossimNitfRpcBase.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfRpcBase_HEADER
-#define ossimNitfRpcBase_HEADER 1
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfRpcBase : public ossimNitfRegisteredTag
-{
- public:
-  enum 
-  {
-    SUCCESS_SIZE                         = 1,
-    ERROR_BIAS_SIZE                      = 7,
-    ERR_RAND_SIZE                        = 7,
-    LINE_OFFSET_SIZE                     = 6,
-    SAMPLE_OFFSET_SIZE                   = 5,
-    GEODETIC_LAT_OFFSET_SIZE             = 8,
-    GEODETIC_LON_OFFSET_SIZE             = 9,
-    GEODETIC_HEIGHT_OFFSET_SIZE          = 5,
-    LINE_SCALE_SIZE                      = 6,
-    SAMPLE_SCALE_SIZE                    = 5,
-    GEODETIC_LAT_SCALE_SIZE              = 8,
-    GEODETIC_LON_SCALE_SIZE              = 9,
-    GEODETIC_HEIGHT_SCALE_SIZE           = 5,
-    LINE_NUMERATOR_COEFFICIENT_SIZE      = 12,
-    LINE_NUMERATOR_COEFFICIENT_COUNT     = 20,
-    LINE_DENOMINATOR_COEFFICIENT_SIZE    = 12,
-    LINE_DENOMINATOR_COEFFICIENT_COUNT   = 20,
-    SAMPLE_NUMERATOR_COEFFICIENT_SIZE    = 12,
-    SAMPLE_NUMERATOR_COEFFICIENT_COUNT   = 20,
-    SAMPLE_DENOMINATOR_COEFFICIENT_SIZE  = 12,
-    SAMPLE_DENOMINATOR_COEFFICIENT_COUNT = 20
-    //                                  -----
-    //                                   1041
-  };
-
-  /** default constructor */
-  ossimNitfRpcBase();
-
-  /**
-   * Parse method.
-   *
-   * @param in Stream to parse.
-   */
-  virtual void parseStream(std::istream& in);
-
-  /**
-   * Write method.
-   *
-   * @param out Stream to write to.
-   */
-  virtual void writeStream(std::ostream& out);
-
-  /**
-   * Clears all string fields within the record to some default nothingness.
-   */
-  virtual void clearFields();
-
-  /**
-   * @return The success record as a boolean.
-   */
-  bool getSuccess()const;
-
-  /** @param success Sets data member theSuccess to success. */
-  void setSuccess(bool success);
-
-  /** @return theErrorBias as a string. */
-  ossimString getErrorBias()const;
-
-  //---
-  // The set methods below taking ossimString args will truncate and
-  // pad with spaces, as necessary, to match enumed size.
-  //---
-
-  /**
-   * @param errorBias Error bias to set theErrorBias to.  This will be
-   * converted to a string with two digit precision.
-   */
-  void setErrorBias(const ossim_float64& errorBias);
-
-  /** @param errorBias bias string to set theErrorBias to. */
-  void setErrorBias(const ossimString& errorBias);
-
-  /** @return theErrorBias as a string. */
-  ossimString getErrorRand()const;
-
-  /**
-   * @param errorRand The random error to set theErrRand to.  This will be
-   * converted to a string with two digit precision.
-   */
-  void setErrorRand(const ossim_float64& errorRand);
-
-  
-  /** @param errorRand error random  string to set theErrorRand to. */
-  void setErrorRand(const ossimString& errorRand);
-
-  /** @return The line offset as a string. */
-  ossimString getLineOffset()const;
-
-  /**
-   * @param lineOffset Sets the line offset to a string truncated to an int.
-   */
-  void setLineOffset(ossim_uint32 lineOffset);
-
-  /**
-   * @param lineOffset Sets theLineOffset to lineOffset string.
-   */
-  void setLineOffset(const ossimString& lineOffset);
-
-  /** @return The sample offset as a string. */
-  ossimString getSampleOffset()const;
-
-  /**
-   * @param sampleOffset Sets the sample offset to a string truncated to an
-   * int.
-   */
-  void setSampleOffset(ossim_uint32 sampleOffset);
-
-  /** @param sampleOffset Sets the sample offset to a string. */
-  void setSampleOffset(const ossimString& sampleOffset);
-
-  /** @return Geodetic latitude offset as a string. */
-  ossimString getGeodeticLatOffset()const;
-
-  /**
-   * @param geodeticLatOffset Value to Set the geodedic latitude offset to.
-   * Converted to a string with four digit precision.
-   */
-  void setGeodeticLatOffset(const ossim_float64& geodeticLatOffset);
-
-  /**
-   * @param geodeticLatOffset geodedic latitude offset string to set
-   * theGeodeticLatOffset to.
-   */
-  void setGeodeticLatOffset(const ossimString& geodeticLatOffset);
-
-  /** @return Geodetic longitude offset as a string. */
-  ossimString getGeodeticLonOffset()const;
-
-  /**
-   * @param geodeticLonOffset Value to Set the geodedic longitude offset to.
-   * Converted to a string with four digit precision.
-   */
-  void setGeodeticLonOffset(const ossim_float64& geodeticLonOffset);
-
-  /**
-   * @param geodeticLonOffset Value to Set the geodedic longitude offset to.
-   */
-  void setGeodeticLonOffset(const ossimString& geodeticLonOffset);
-
-  /** @return Geodetic height offset as a string. */
-  ossimString getGeodeticHeightOffset()const;
-
-  /**
-   * @param geodeticHeightOffset value to Set the height offset to.
-   * Converted to a string truncated to an int.
-   */
-  void setGeodeticHeightOffset(ossim_int32 geodeticHeightOffset);
-  
-  /** @param geodeticHeightOffset value to Set the height offset to. */
-  void setGeodeticHeightOffset(const ossimString& geodeticHeightOffset);
-
-  /** @return The line scale as a string. */
-  ossimString getLineScale()const;
-  
-  /**
-   * @param lineScale The value to set the line scale to.
-   * Converted to a string.
-   */
-  void setLineScale(ossim_uint32 lineScale);
-
-  /**
-   * @param lineScale The value to set the line scale to.
-   */
-  void setLineScale(const ossimString& lineScale);
-
-  /**
-   * @return the sample scale as a string.
-   */
-  ossimString getSampleScale()const;
-
-  /**
-   * @param sampleScale The value to set the sample scale to.
-   * Converted to a string truncated to an int.
-   */
-  void setSampleScale(ossim_uint32 sampleScale);
-
-  /**
-   * @param sampleScale The value to set the sample scale to.
-   */
-  void setSampleScale(const ossimString& sampleScale);
-
-  /** @return The Geodetic latitude scale as a string. */
-  ossimString getGeodeticLatScale()const;
-
-  /**
-   * @param geodeticLatScale The value to set the geodedic latitude scale to.
-   * Converted to a string with four digit precision.
-   */
-  void setGeodeticLatScale(const ossim_float64& geodeticLatScale);
-
-  /**
-   * @param geodeticLatScale The value to set the geodedic latitude scale to.
-   */
-  void setGeodeticLatScale(const ossimString& geodeticLatScale);
-
-  /** @return Geodetic longitude scale as a string. */
-  ossimString getGeodeticLonScale()const;
-
-  /**
-   * @param geodeticLonScale The value to set the geodedic longitude scale to.
-   * Converted to a string with four digit precision.
-   */
-  void setGeodeticLonScale(const ossim_float64& geodeticLonScale);
-
-  /**
-   * @param geodeticLonScale The value to set the geodedic longitude scale to.
-   */
-  void setGeodeticLonScale(const ossimString& geodeticLonScale);
-
-  /** @return The geodetic height scale as a string. */
-  ossimString getGeodeticHeightScale()const;
-
-  /**
-   * @param geodeticHeightScale The value to set the height scale to.
-   * Converted to a string truncated to an int.
-   */
-  void setGeodeticHeightScale(ossim_int32 geodeticHeightScale);
-  
-  /**
-   * @param geodeticHeightScale The value to set the height scale to.
-   */
-  void setGeodeticHeightScale(const ossimString& geodeticHeightScale);
-
-  /**
-   * @param idx Index of line numerator coefficient to get.
-   * Range: 0 - 19
-   *
-   * @return The line numerator coefficient as a string.
-   */
-  ossimString getLineNumeratorCoeff(ossim_uint32 idx)const;
-
-  /**
-   * @param coeff This should be an array of 20 line numerator coefficients.
-   * Coefficients will be converted to a scientific string to conform to
-   * specification.
-   *
-   * @note if (coeff.size() != 20) no action is taken.
-   */  
-  void setLineNumeratorCoeff(const std::vector<ossim_float64>& coeff);
-  
-  /**
-   * @param idx index of line numerator coefficient to set.
-   * Range: 0 - 19
-   *
-   * @param coeff Value to set line numerator coefficient to for
-   * idx or index.
-   */  
-  void setLineNumeratorCoeff(ossim_uint32 idx,
-                             const ossimString& coeff);
-
-  /**
-   * @param idx index of line denominator coefficient to get.
-   * Range: 0 - 19
-   *
-   * @return line  denominator coefficient as a string.
-   */
-  ossimString getLineDenominatorCoeff(ossim_uint32 idx)const;
-  
-  /**
-   * @param coeff This should be an array of 20 line denominator coefficients.
-   * Coefficients will be converted to a scientific string to conform to
-   * specification.
-   *
-   * @note if (coeff.size() != 20) no action is taken.
-   */  
-  void setLineDenominatorCoeff(const std::vector<ossim_float64>& coeff);
-  
-  /**
-   * @param idx index of line denominator coefficient to set.
-   * Range: 0 - 19
-   *
-   * @param lineDenominatorCoeff Value to set line denominator coefficient
-   * to for idx or index.
-   */  
-  void setLineDenominatorCoeff(ossim_uint32 idx,
-                               const ossimString& coeff);
-
-  /**
-   * @param idx Index of sample numerator coefficient to get.
-   * Range: 0 - 19
-   *
-   * @return The sample numerator coefficient as a string.
-   */
-  ossimString getSampleNumeratorCoeff(ossim_uint32 idx)const;
-
-  /**
-   * @param coeff This should be an array of 20 sample numerator coefficients.
-   * Coefficients will be converted to a scientific string to conform to
-   * specification.
-   *
-   * @note if (coeff.size() != 20) no action is taken.
-   */  
-  void setSampleNumeratorCoeff(const std::vector<ossim_float64>& coeff);
-  
-  /**
-   * @param idx index of sample numerator coefficient to set.
-   * Range: 0 - 19
-   *
-   * @param coeff Value to set sample numerator coefficient to for
-   * idx or index.
-   */  
-  void setSampleNumeratorCoeff(ossim_uint32 idx,
-                             const ossimString& coeff);
-
-  /**
-   * @param idx index of sample denominator coefficient to get.
-   * Range: 0 - 19
-   *
-   * @return sample  denominator coefficient as a string.
-   */
-  ossimString getSampleDenominatorCoeff(ossim_uint32 idx)const;
-  
-  /**
-   * @param coeff This should be an array of 20 sample denominator coefficients.
-   * Coefficients will be converted to a scientific string to conform to
-   * specification.
-   *
-   * @note if (coeff.size() != 20) no action is taken.
-   */  
-  void setSampleDenominatorCoeff(const std::vector<ossim_float64>& coeff);
-  
-  /**
-   * @param idx index of sample denominator coefficient to set.
-   * Range: 0 - 19
-   *
-   * @param sampleDenominatorCoeff Value to set sample denominator coefficient
-   * to for idx or index.
-   */  
-  void setSampleDenominatorCoeff(ossim_uint32 idx,
-                               const ossimString& coeff);
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-
-  virtual void setProperty(ossimRefPtr<ossimProperty> property);
-  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-  virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-protected:
-
-  /**
-   * FIELD: SUCCESS
-   *
-   * Required 1 byte field.
-   * 
-   * Value is 1
-   * 
-   */
-  char theSuccess[SUCCESS_SIZE+1];
-   
-  /**
-   * FIELD: ERR_BIAS
-   *
-   * required 7 byte field
-   * 
-   * Error - Bias. 68% non time-varying error estimate assumes
-   * correlated images.
-   *
-   * Values range from 0000.00 to 9999.99 meters
-   */
-  char theErrorBias[ERROR_BIAS_SIZE+1];
-
-  /**
-   * FIELD ERR_RAND
-   *
-   * Required 7 byte field
-   * 
-   * Error - Random. 68% time-varying error estimate assumes
-   * correlated images. 0000.00 to 9999.99 meters
-   */
-  char theErrRand[ERR_RAND_SIZE+1];
-
-  /**
-   * FIELD: LINE_OFF
-   *
-   * required 6 byte field.
-   * 
-   * value is in pixels and ranges from 000000-999999
-   */
-  char theLineOffset[LINE_OFFSET_SIZE+1];
-
-  /**
-   * FIELD: SAMP_OFF
-   *
-   * required 5 byte field.
-   *
-   * value is in pixels and ranges from 00000-99999
-   */
-  char theSampleOffset[SAMPLE_OFFSET_SIZE+1];
-
-  /**
-   * FIELD: LAT_OFF
-   *
-   * required 8 byte field.
-   *
-   * Holds the lat offset in degrees and ranges from +-90.0000
-   */
-  char theGeodeticLatOffset[GEODETIC_LAT_OFFSET_SIZE+1];
-
-  /**
-   * FIELD: LONG_OFF
-   *
-   * required 9 byte field.
-   *
-   * holds the lon offset in degrees and ranges from +-180.0000
-   */
-  char theGeodeticLonOffset[GEODETIC_LON_OFFSET_SIZE+1];
-
-  /**
-   * FIELD: HEIGHT_OFF
-   *
-   * required 5 byte field.
-   *
-   * holds the height offset in meters and ranges from +-9999
-   */
-  char theGeodeticHeightOffset[GEODETIC_HEIGHT_OFFSET_SIZE+1];
-
-  /**
-   * FIELD: LINE_SCALE
-   *
-   * required 6 byte field.
-   *
-   * holds the line scale in pixels and ranges from 000001-999999
-   * 
-   */
-  char theLineScale[LINE_SCALE_SIZE+1];
-
-  /**
-   * FIELD: SAMP_SCALE
-   *
-   * required 5 byte field.
-   *
-   * holds the line scale in pixels and ranges from 00001-99999
-   * 
-   */
-  char theSampleScale[SAMPLE_SCALE_SIZE+1];
-
-  /**
-   * FIELD: LAT_SCALE
-   *
-   * required 8 byte field
-   *
-   * holds the lat scale in degrees and ranges from +-90.0000 degrees
-   */
-  char theGeodeticLatScale[GEODETIC_LAT_SCALE_SIZE+1];
-
-  /**
-   * FIELD: LON_SCALE
-   *
-   * required 9 byte field
-   *
-   * holds the lon scale in degrees and ranges from +-180.0000 degrees
-   */
-  char theGeodeticLonScale[GEODETIC_LON_SCALE_SIZE+1];
-
-  /**
-   * FIELD: HEIGHT_SCALE
-   *
-   * required 5 byte field
-   *
-   * holds the geodetic height scale and ranges from +-9999 meters.
-   */
-  char theGeodeticHeightScale[GEODETIC_HEIGHT_SCALE_SIZE+1];
-
-  /**
-   * FIELD: LINE_NUM_COEFF_1 through LINE_NUM_COEFF_20
-   *
-   * Line Numerator Coefficients.
-   *
-   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
-   * polynomial
-   *
-   */     
-  std::vector<ossimString> theLineNumeratorCoefficient;
-
-  /**
-   * FIELD: LINE_DEN_COEFF_1 through LINE_DEN_COEFF_20
-   *
-   * Line Denominato Coefficients.
-   *
-   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
-   * polynomial
-   *
-   */     
-  std::vector<ossimString> theLineDenominatorCoefficient;
-
-  /**
-   * FIELD: SAMP_NUM_COEFF_1 through SAMP_NUM_COEFF_20
-   *
-   * samp Numerator Coefficients.
-   *
-   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
-   * polynomial
-   *
-   */     
-  std::vector<ossimString> theSampleNumeratorCoefficient;
-
-  /**
-   * FIELD: SAMP_DEN_COEFF_1 through SAMP_DEN_COEFF_20
-   *
-   * samp Denominator Coefficients.
-   *
-   * required 12 byte field ranging �0.999999E�9 Twenty coefficients for the
-   * polynomial
-   *
-   */     
-  std::vector<ossimString> theSampleDenominatorCoefficient;
-
-TYPE_DATA   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfRpfTagFactory.h b/ossim/include/ossim/support_data/ossimNitfRpfTagFactory.h
deleted file mode 100644
index 6fc4d27..0000000
--- a/ossim/include/ossim/support_data/ossimNitfRpfTagFactory.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// LICENSE: MIT  see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRpfTagFactory.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfRpfTagFactory_HEADER
-#define ossimNitfRpfTagFactory_HEADER 1
-
-#include <ossim/support_data/ossimNitfTagFactory.h>
-class ossimNitfRegisteredTag;
-
-class ossimNitfRpfTagFactory : public ossimNitfTagFactory
-{
-public:
-   virtual ~ossimNitfRpfTagFactory();
-   static ossimNitfRpfTagFactory* instance();
-   virtual ossimRefPtr<ossimNitfRegisteredTag> create(const ossimString &tagName)const;
-   
-protected:
-   ossimNitfRpfTagFactory();
-
-private:
-   /*!
-    * Hide this.
-    */
-   ossimNitfRpfTagFactory(const ossimNitfRpfTagFactory & /* rhs */){}
-
-   /*!
-    * Hide this.
-    */ 
-   ossimNitfRpfTagFactory& operator =(const ossimNitfRpfTagFactory & /* rhs */){return *this;}
-
-TYPE_DATA
-};
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfSensraTag.h b/ossim/include/ossim/support_data/ossimNitfSensraTag.h
deleted file mode 100644
index ba6863b..0000000
--- a/ossim/include/ossim/support_data/ossimNitfSensraTag.h
+++ /dev/null
@@ -1,269 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Walt Bunch
-//
-// Description: Nitf support class for SENSRA - Sensor parameters extension.
-// 
-//********************************************************************
-// $Id: ossimNitfSensraTag.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfSensraTag_HEADER
-#define ossimNitfSensraTag_HEADER
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfSensraTag : public ossimNitfRegisteredTag
-{
-public:
-
-   enum
-   {
-      REF_ROW_SIZE         = 8,
-      REF_COL_SIZE         = 8,
-      SENSOR_MODEL_SIZE    = 6,
-      SENSOR_MOUNT_SIZE    = 3,
-      SENSOR_LOC_SIZE      = 21,
-      SENSOR_ALT_SRC_SIZE  = 1,
-      SENSOR_ALT_SIZE      = 6,
-      SENSOR_ALT_UNIT_SIZE = 1,
-      SENSOR_AGL_SIZE      = 5,
-      SENSOR_PITCH_SIZE    = 7,
-      SENSOR_ROLL_SIZE     = 8,
-      SENSOR_YAW_SIZE      = 8,
-      PLATFORM_PITCH_SIZE  = 7,
-      PLATFORM_ROLL_SIZE   = 8,
-      PLATFORM_HDG_SIZE    = 5,
-      GROUND_SPD_SRC_SIZE  = 1,
-      GROUND_SPEED_SIZE    = 6,
-      GROUND_SPD_UNIT_SIZE = 1,
-      GROUND_TRACK_SIZE    = 5,
-      VERTICAL_VEL_SIZE    = 5,
-      VERT_VEL_UNIT_SIZE   = 1,
-      SWATH_FRAMES_SIZE    = 4,
-      N_SWATHS_SIZE        = 4,
-      SPOT_NUM_SIZE        = 3
-      //                  -----
-      //                   132
-   };
-
-   ossimNitfSensraTag();
-   virtual ~ossimNitfSensraTag();
-
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   virtual void clearFields();
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;
-   
-  // The set methods below taking ossimString args will truncate and
-  // pad with spaces, as necessary, to match enumed size
-   void setRefRow(ossimString refRow);
-   ossimString getRefRow()const;
-   void setRefCol(ossimString refCol);
-   ossimString getRefCol()const;
-   void setSensorModel(ossimString sensorModel);
-   ossimString getSensorModel()const;
-   void setSensorMount(ossimString sensorMount);
-   ossimString getSensorMount()const;
-   void setSensorLoc(ossimString sensorLoc);
-   ossimString getSensorLoc()const;
-   void setSensorAltSrc(ossimString sensorAltSrc);
-   ossimString getSensorAltSrc()const;
-   void setSensorAlt(ossimString sensorAlt);
-   ossimString getSensorAlt()const;
-   void setSensorAltUnit(ossimString sensorAltUnit);
-   ossimString getSensorAltUnit()const;
-   void setSensorAgl(ossimString sensorAgl);
-   ossimString getSensorAgl()const;
-   void setSensorPitch(ossimString sensorPitch);
-   ossimString getSensorPitch()const;
-   void setSensorRoll(ossimString sensorRoll);
-   ossimString getSensorRoll()const;
-   void setSensorYaw(ossimString sensorYaw);
-   ossimString getSensorYaw()const;
-   void setPlatformPitch(ossimString platformPitch);
-   ossimString getPlatformPitch()const;
-   void setPlatformRoll(ossimString platformRoll);
-   ossimString getPlatformRoll()const;
-   void setPlatformHdg(ossimString platformHdg);
-   ossimString getPlatformHdg()const;
-   void setGroundSpdSrc(ossimString groundSpdSrc);
-   ossimString getGroundSpdSrc()const;
-   void setGroundSpeed(ossimString groundSpeed);
-   ossimString getGroundSpeed()const;
-   void setGroundSpdUnit(ossimString groundSpdUnit);
-   ossimString getGroundSpdUnit()const;
-   void setGroundTrack(ossimString groundTrack);
-   ossimString getGroundTrack()const;
-   void setVerticalVel(ossimString verticalVel);
-   ossimString getVerticalVel()const;
-   void setVertVelUnit(ossimString vertVelUnit);
-   ossimString getVertVelUnit()const;
-   void setSwathFrames(ossimString swathFrames);
-   ossimString getSwathFrames()const;
-   void setNSwaths(ossimString nSwaths);
-   ossimString getNSwaths()const;
-   void setSpotNum(ossimString spotNum);
-   ossimString getSpotNum()const;
-
-protected:
-
-   /**
-    * FIELD: REFROW
-    *
-    */
-   char theRefRow[REF_ROW_SIZE+1];
-
-   /**
-    * FIELD: REFCOL
-    *
-    */
-   char theRefCol[REF_COL_SIZE+1];
-
-   /**
-    * FIELD: SENSORMODEL
-    *
-    */
-   char theSensorModel[SENSOR_MODEL_SIZE+1];
-
-   /**
-    * FIELD: SENSORMOUNT
-    *
-    */
-   char theSensorMount[SENSOR_MOUNT_SIZE+1];
-
-   /**
-    * FIELD: SENSORLOC
-    *
-    */
-   char theSensorLoc[SENSOR_LOC_SIZE+1];
-
-   /**
-    * FIELD: SENSORALTSRC
-    *
-    */
-   char theSensorAltSrc[SENSOR_ALT_SRC_SIZE+1];
-
-   /**
-    * FIELD: SENSORALT
-    *
-    */
-   char theSensorAlt[SENSOR_ALT_SIZE+1];
-
-   /**
-    * FIELD: SENSORALTUNIT
-    *
-    */
-   char theSensorAltUnit[SENSOR_ALT_UNIT_SIZE+1];
-
-   /**
-    * FIELD: SENSORAGL
-    *
-    */
-   char theSensorAgl[SENSOR_AGL_SIZE+1];
-
-   /**
-    * FIELD: SENSORPITCH
-    *
-    */
-   char theSensorPitch[SENSOR_PITCH_SIZE+1];
-
-   /**
-    * FIELD: SENSORROLL
-    *
-    */
-   char theSensorRoll[SENSOR_ROLL_SIZE+1];
-
-   /**
-    * FIELD: SENSORYAW
-    *
-    */
-   char theSensorYaw[SENSOR_YAW_SIZE+1];
-
-   /**
-    * FIELD: PLATFORMPITCH
-    *
-    */
-   char thePlatformPitch[PLATFORM_PITCH_SIZE+1];
-
-   /**
-    * FIELD: PLATFORMROLL
-    *
-    */
-   char thePlatformRoll[PLATFORM_ROLL_SIZE+1];
-
-   /**
-    * FIELD: PLATFORMHDG
-    *
-    */
-   char thePlatformHdg[PLATFORM_HDG_SIZE+1];
-
-   /**
-    * FIELD: GROUNDSPDSRC
-    *
-    */
-   char theGroundSpdSrc[GROUND_SPD_SRC_SIZE+1];
-
-   /**
-    * FIELD: GROUNDSPEED
-    *
-    */
-   char theGroundSpeed[GROUND_SPEED_SIZE+1];
-
-   /**
-    * FIELD: GROUNDSPDUNIT
-    *
-    */
-   char theGroundSpdUnit[GROUND_SPD_UNIT_SIZE+1];
-
-   /**
-    * FIELD: GROUNDTRACK
-    *
-    */
-   char theGroundTrack[GROUND_TRACK_SIZE+1];
-
-   /**
-    * FIELD: VERTICALVEL
-    *
-    */
-   char theVerticalVel[VERTICAL_VEL_SIZE+1];
-
-   /**
-    * FIELD: VERTVELUNIT
-    *
-    */
-   char theVertVelUnit[VERT_VEL_UNIT_SIZE+1];
-
-   /**
-    * FIELD: SWATHFRAMES
-    *
-    */
-   char theSwathFrames[SWATH_FRAMES_SIZE+1];
-
-   /**
-    * FIELD: NSWATHS
-    *
-    */
-   char theNSwaths[N_SWATHS_SIZE+1];
-
-   /**
-    * FIELD: SPOTNUM
-    *
-    */
-   char theSpotNum[SPOT_NUM_SIZE+1];
-
-TYPE_DATA   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfStdidcTag.h b/ossim/include/ossim/support_data/ossimNitfStdidcTag.h
deleted file mode 100644
index 40f186d..0000000
--- a/ossim/include/ossim/support_data/ossimNitfStdidcTag.h
+++ /dev/null
@@ -1,204 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  Walt Bunch
-// 
-// Description:   NITF support data class for STDIDC - Standard ID extension.
-//
-// See:  STDI-000_v2.1 Table 7-3 for detailed description.
-// 
-//********************************************************************
-// $Id: ossimNitfStdidcTag.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfStdidcTag_HEADER
-#define ossimNitfStdidcTag_HEADER 1
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfStdidcTag : public ossimNitfRegisteredTag
-{
-public:
-
-   enum
-   {
-      ACQ_DATE_SIZE         = 14,
-      MISSION_SIZE          = 14,
-      PASS_SIZE             = 2,
-      OP_NUM_SIZE           = 3,
-      START_SEGMENT_SIZE    = 2,
-      REPRO_NUM_SIZE        = 2,
-      REPLAY_REGEN_SIZE     = 3,
-      BLANK_FILL_SIZE       = 1,
-      START_COLUMN_SIZE     = 3,
-      START_ROW_SIZE        = 5,
-      END_SEGMENT_SIZE      = 2,
-      END_COLUMN_SIZE       = 3,
-      END_ROW_SIZE          = 5,
-      COUNTRY_SIZE          = 2,
-      WAC_SIZE              = 4,
-      LOCATION_SIZE         = 11,
-      FIELD17_SIZE          = 5,
-      FIELD18_SIZE          = 8
-      //                   -----
-      //                     89 bytes
-   };
-      
-   ossimNitfStdidcTag();
-   virtual ~ossimNitfStdidcTag();
-
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   virtual void clearFields();
-
-  // The set methods below taking ossimString args will truncate and
-  // pad with spaces, as necessary, to match enumed size
-   void setAcqDate(ossimString acqDate);
-   ossimString getAcqDate()const;
-   void setMission(ossimString mission);
-   ossimString getMission()const;
-   void setPass(ossimString pass);
-   ossimString getPass()const;
-   void setOpNum(ossimString opNum);
-   ossimString getOpNum()const;
-   void setStartSegment(ossimString startSegment);
-   ossimString getStartSegment()const;
-   void setReproNum(ossimString reproNum);
-   ossimString getReproNum()const;
-   void setReplayRegen(ossimString replayRegen);
-   ossimString getReplayRegen()const;
-   void setBlankFill(ossimString blankFill);
-   ossimString getBlankFill()const;
-   void setStartColumn(ossimString startColumn);
-   ossimString getStartColumn()const;
-   void setStartRow(ossimString startRow);
-   ossimString getStartRow()const;
-   void setEndSegment(ossimString endSegment);
-   ossimString getEndSegment()const;
-   void setEndColumn(ossimString endColumn);
-   ossimString getEndColumn()const;
-   void setEndRow(ossimString endRow);
-   ossimString getEndRow()const;
-   void setCountry(ossimString country);
-   ossimString getCountry()const;
-   void setWac(ossimString wac);
-   ossimString getWac()const;
-   void setLocation(ossimString location);
-   ossimString getLocation()const;
-   void setField17(ossimString field17);
-   ossimString getField17()const;
-   void setField18(ossimString field18);
-   ossimString getField18()const;
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-
-
-protected:
-
-   /**
-    * FIELD: ACQDATE
-    */
-   char theAcqDate[ACQ_DATE_SIZE+1];
-   
-   /**
-    * FIELD: MISSION
-    */
-   char theMission[MISSION_SIZE+1];
-   
-   /**
-    * FIELD: PASS
-    */
-   char thePass[PASS_SIZE+1];
-   
-   /**
-    * FIELD: OPNUM
-    */
-   char theOpNum[OP_NUM_SIZE+1];
-   
-   /**
-    * FIELD: STARTSEGMENT
-    */
-   char theStartSegment[START_SEGMENT_SIZE+1];
-   
-   /**
-    * FIELD: REPRONUM
-    */
-   char theReproNum[REPRO_NUM_SIZE+1];
-   
-   /**
-    * FIELD: REPLAYREGEN
-    */
-   char theReplayRegen[REPLAY_REGEN_SIZE+1];
-   
-   /**
-    * FIELD: BLANKFILL
-    */
-   char theBlankFill[BLANK_FILL_SIZE+1];
-   
-   /**
-    * FIELD: STARTCOLUMN
-    */
-   char theStartColumn[START_COLUMN_SIZE+1];
-   
-   /**
-    * FIELD: STARTROW
-    */
-   char theStartRow[START_ROW_SIZE+1];
-   
-   /**
-    * FIELD: ENDSEGMENT
-    */
-   char theEndSegment[END_SEGMENT_SIZE+1];
-   
-   /**
-    * FIELD: ENDCOLUMN
-    */
-   char theEndColumn[END_COLUMN_SIZE+1];
-   
-   /**
-    * FIELD: ENDROW
-    */
-   char theEndRow[END_ROW_SIZE+1];
-   
-   /**
-    * FIELD: COUNTRY
-    */
-   char theCountry[COUNTRY_SIZE+1];
-   
-   /**
-    * FIELD: WAC
-    */
-   char theWac[WAC_SIZE+1];
-   
-   /**
-    * FIELD: LOCATION
-    */
-   char theLocation[LOCATION_SIZE+1];
-   
-   /**
-    * FIELD: FIELD17
-    */
-   char theField17[FIELD17_SIZE+1];
-   
-   /**
-    * FIELD: FIELD18
-    */
-   char theField18[FIELD18_SIZE+1];
-
-TYPE_DATA   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfTagInformation.h b/ossim/include/ossim/support_data/ossimNitfTagInformation.h
deleted file mode 100644
index 7830ac6..0000000
--- a/ossim/include/ossim/support_data/ossimNitfTagInformation.h
+++ /dev/null
@@ -1,99 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfTagInformation.h 22418 2013-09-26 15:01:12Z gpotts $
-#ifndef ossimNitfTagInformation_HEADER
-#define ossimNitfTagInformation_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class ossimString;
-
-class OSSIMDLLEXPORT ossimNitfTagInformation : public ossimObject
-{
-public:
-   ossimNitfTagInformation(ossimRefPtr<ossimNitfRegisteredTag> tagData = 0);
-   virtual ~ossimNitfTagInformation();
-   
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   void setTagName(const ossimString& tagName);
-   void setTagLength(ossim_uint32 tagLength);
-
-   /**
-    * Length of the 5 byte tag length the 6 byte tag name and
-    * the data length.
-    * So we have Data length + 11 bytes.
-    */
-   ossim_uint32 getTotalTagLength()const;
-
-   /**
-    * Should return the value of theTagLength which is the length of
-    * the data in bytes.
-    */
-   ossim_uint32 getTagLength()const;
-   ossim_uint64 getTagOffset()const;
-   ossim_uint64 getTagDataOffset()const;
-   
-   ossimString   getTagName()const;
-   virtual std::ostream& print(std::ostream& out)const;
-   void clearFields();
-   
-   ossimRefPtr<ossimNitfRegisteredTag> getTagData();
-   const ossimRefPtr<ossimNitfRegisteredTag> getTagData()const;
-   void setTagData(ossimRefPtr<ossimNitfRegisteredTag> tagData);
-   ossimString getTagType() const;
-   void setTagType(const ossimString& tagType) const;
-
-   bool operator<(const ossimNitfTagInformation& rhs) const
-   {
-      return getTotalTagLength() < rhs.getTotalTagLength();
-   }
-   
-private:
-
-   /**
-    * This is a 6 byte field
-    */
-   char          theTagName[7];
-
-   /**
-    * This is a 5 byte field
-    */
-   char           theTagLength[6];
-
-   /**
-    * This is a 6 byte field which should be UDHD, UDID, XHD, IXSHD, SXSHD, or TXSHD.
-    * This is declared as mutable since changing the tag type doesn't change the contents of the tag.
-    */
-   mutable char theTagType[7];
-
-   /**
-    * This will hold the offset to the start of the above information
-    * This is just a work variable.
-    */
-   ossim_uint64 theTagOffset;
-
-   /**
-    * This will hold the start to the data.  This is just the
-    * position in the file just past the tag length field.
-    * This is just a work variable
-    */
-   ossim_uint64 theTagDataOffset;
-
-   /**
-    * Used to hold the tag data.
-    */
-   ossimRefPtr<ossimNitfRegisteredTag> theTagData;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNitfUnknownTag.h b/ossim/include/ossim/support_data/ossimNitfUnknownTag.h
deleted file mode 100644
index 66cae61..0000000
--- a/ossim/include/ossim/support_data/ossimNitfUnknownTag.h
+++ /dev/null
@@ -1,84 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Unknown tag class declaration.
-//
-// Note: By "unknown" this means that the tag name was not found in any of
-// the tag factories.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfUnknownTag.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfUnknownTag_HEADER
-#define ossimNitfUnknownTag_HEADER 1
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfUnknownTag : public ossimNitfRegisteredTag
-{
-public:
-   /** default constructor */
-   ossimNitfUnknownTag();
-
-   /** destructor */
-   virtual ~ossimNitfUnknownTag();
-  
-   /**
-    * Parse method.
-    *
-    * @param in Stream to parse.  This will read the entire tag length into
-    * an array.
-    */
-   virtual void parseStream(std::istream& in);
-   
-   /**
-    * Write method.
-    *
-    * @param out Stream to write to.
-    */
-   virtual void writeStream(std::ostream& out);
-   
-   /**
-    * Clears all string fields within the record to some default nothingness.
-    */
-   virtual void clearFields();
-   
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-
-   /**
-    * @param length Length of tag.
-    *
-    * @note The tag length must be set prior to calling "parseStream".
-    *
-    * @note Since you must have a length to read theTagData, if theTagData
-    * exist it will be deleted by this method.
-    * Subsequent "parseStream" calls will allocate theTagData as needed.
-    */
-   virtual void setTagLength(ossim_uint32 length);
-   
-protected:
-
-   /**
-    * @return true if all characters in theTagData are printable.
-    */
-   bool tagDataIsAscii() const;
-
-   /**
-    * Holds entire tag data(theTagLength) plus one byte for null terminator.
-    */
-   char* m_tagData;
-   
-TYPE_DATA   
-};
-
-#endif /* End of "#ifndef ossimNitfUnknownTag_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimNitfUse00aTag.h b/ossim/include/ossim/support_data/ossimNitfUse00aTag.h
deleted file mode 100644
index 377d13c..0000000
--- a/ossim/include/ossim/support_data/ossimNitfUse00aTag.h
+++ /dev/null
@@ -1,283 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Walt Bunch
-//
-// Description: Nitf support class for USE00A -
-// Exploitation Usability extension.
-// 
-//********************************************************************
-// $Id: ossimNitfUse00aTag.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimNitfUse00aTag_HEADER
-#define ossimNitfUse00aTag_HEADER
-
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-class OSSIM_DLL ossimNitfUse00aTag : public ossimNitfRegisteredTag
-{
-public:
-   
-   enum
-   {
-      ANGLE_TO_NORTH_SIZE  = 3,
-      MEAN_GSD_SIZE        = 5,
-      FIELD3_SIZE          = 1,
-      DYNAMIC_RANGE_SIZE   = 5,
-      FIELD5_SIZE          = 3,
-      FIELD6_SIZE          = 1,
-      FIELD7_SIZE          = 3,
-      OBL_ANG_SIZE         = 5,
-      ROLL_ANG_SIZE        = 6,
-      FIELD10_SIZE         = 12,
-      FIELD11_SIZE         = 15,
-      FIELD12_SIZE         = 4,
-      FIELD13_SIZE         = 1,
-      FIELD14_SIZE         = 3,
-      FIELD15_SIZE         = 1,
-      FIELD16_SIZE         = 1,
-      N_REF_SIZE           = 2,
-      REV_NUM_SIZE         = 5,
-      N_SEG_SIZE           = 3,
-      MAX_LP_SEG_SIZE      = 6,
-      FIELD20_SIZE         = 6,
-      FIELD21_SIZE         = 6,
-      SUN_EL_SIZE          = 5,
-      SUN_AZ_SIZE          = 5
-      //                  -----
-      //                  107 bytes
-   };
-   
-   ossimNitfUse00aTag();
-   virtual ~ossimNitfUse00aTag();
-
-   virtual void parseStream(std::istream& in);
-   virtual void writeStream(std::ostream& out);
-
-   virtual void clearFields();
-   
-  // The set methods below taking ossimString args will truncate and
-  // pad with spaces, as necessary, to match enumed size
-   void setAngleToNorth(const ossimString& angleToNorth);
-   ossimString getAngleToNorth()const;
-   void setMeanGsd(const ossimString& meanGsd);
-   ossimString getMeanGsd()const;
-
-   /**
-    * @return MEANGSD field as a double converted to meters.
-    *
-    * @note Conversion used: gsd_in_meters = gsd / 12.0 * MTRS_PER_FT
-    */
-   ossim_float64 getMeanGsdInMeters() const;
-
-   void setField3(const ossimString& field3);
-   ossimString getField3()const;
-   void setDynamicRange(const ossimString& dynamicRange);
-   ossimString getDynamicRange()const;
-   void setField5(const ossimString& field5);
-   ossimString getField5()const;
-   void setField6(const ossimString& field6);
-   ossimString getField6()const;
-   void setField7(const ossimString& field7);
-   ossimString getField7()const;
-   void setOblAng(const ossimString& oblAng);
-   ossimString getOblAng()const;
-   void setRollAng(const ossimString& rollAng);
-   ossimString getRollAng()const;
-   void setField10(const ossimString& field10);
-   ossimString getField10()const;
-   void setField11(const ossimString& field11);
-   ossimString getField11()const;
-   void setField12(const ossimString& field12);
-   ossimString getField12()const;
-   void setField13(const ossimString& field13);
-   ossimString getField13()const;
-   void setField14(const ossimString& field14);
-   ossimString getField14()const;
-   void setField15(const ossimString& field15);
-   ossimString getField15()const;
-   void setField16(const ossimString& field16);
-   ossimString getField16()const;
-   void setNRef(const ossimString& nRef);
-   ossimString getNRef()const;
-   void setRevNum(const ossimString& revNum);
-   ossimString getRevNum()const;
-   void setNSeg(const ossimString& nSeg);
-   ossimString getNSeg()const;
-   void setMaxLpSeg(const ossimString& maxLpSeg);
-   ossimString getMaxLpSeg()const;
-   void setField20(const ossimString& field20);
-   ossimString getField20()const;
-   void setField21(const ossimString& field21);
-   ossimString getField21()const;
-   void setSunEl(const ossimString& sunEl);
-   ossimString getSunEl()const;
-   void setSunAz(const ossimString& sunAz);
-   ossimString getSunAz()const;
-
-   /**
-    * @brief Print method that outputs a key/value type format
-    * adding prefix to keys.
-    * @param out Stream to output to.
-    * @param prefix Prefix added to key like "image0.";
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix=std::string()) const;
-   
-   virtual void setProperty(ossimRefPtr<ossimProperty> property);
-   virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
-   virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
-   
-protected:
-   
-   /**
-    * FIELD: ANGLETONORTH
-    *
-    */
-   char theAngleToNorth[ANGLE_TO_NORTH_SIZE+1];
-   
-   /**
-    * FIELD: MEANGSD
-    *
-    */
-   char theMeanGsd[MEAN_GSD_SIZE+1];
-   
-   /**
-    * FIELD: FIELD3
-    *
-    */
-   char theField3[FIELD3_SIZE+1];
-
-   /**
-    * FIELD: DYNAMICRANGE
-    *
-    */
-   char theDynamicRange[DYNAMIC_RANGE_SIZE+1];
-
-   /**
-    * FIELD: FIELD5
-    *
-    */
-   char theField5[FIELD5_SIZE+1];
-
-   /**
-    * FIELD: FIELD6
-    *
-    */
-   char theField6[FIELD6_SIZE+1];
-
-   /**
-    * FIELD: FIELD7
-    *
-    */
-   char theField7[FIELD7_SIZE+1];
-
-   /**
-    * FIELD: OBLANG
-    *
-    */
-   char theOblAng[OBL_ANG_SIZE+1];
-
-   /**
-    * FIELD: ROLLANG
-    *
-    */
-   char theRollAng[ROLL_ANG_SIZE+1];
-
-   /**
-    * FIELD: FIELD10
-    *
-    */
-   char theField10[FIELD10_SIZE+1];
-
-   /**
-    * FIELD: FIELD11
-    *
-    */
-   char theField11[FIELD11_SIZE+1];
-
-   /**
-    * FIELD: FIELD12
-    *
-    */
-   char theField12[FIELD12_SIZE+1];
-
-   /**
-    * FIELD: FIELD13
-    *
-    */
-   char theField13[FIELD13_SIZE+1];
-
-   /**
-    * FIELD: FIELD14
-    *
-    */
-   char theField14[FIELD14_SIZE+1];
-
-   /**
-    * FIELD: FIELD15
-    *
-    */
-   char theField15[FIELD15_SIZE+1];
-
-   /**
-    * FIELD: FIELD16
-    *
-    */
-   char theField16[FIELD16_SIZE+1];
-
-   /**
-    * FIELD: NREF
-    *
-    */
-   char theNRef[N_REF_SIZE+1];
-
-   /**
-    * FIELD: REVNUM
-    *
-    */
-   char theRevNum[REV_NUM_SIZE+1];
-
-   /**
-    * FIELD: NSEG
-    *
-    */
-   char theNSeg[N_SEG_SIZE+1];
-
-   /**
-    * FIELD: MAXLPSEG
-    *
-    */
-   char theMaxLpSeg[MAX_LP_SEG_SIZE+1];
-
-   /**
-    * FIELD: FIELD20
-    *
-    */
-   char theField20[FIELD20_SIZE+1];
-
-   /**
-    * FIELD: FIELD21
-    *
-    */
-   char theField21[FIELD21_SIZE+1];
-
-   /**
-    * FIELD: SUNEL
-    *
-    */
-   char theSunEl[SUN_EL_SIZE+1];
-
-   /**
-    * FIELD: SUNAZ
-    *
-    */
-   char theSunAz[SUN_AZ_SIZE+1];
-
-TYPE_DATA   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimNitfVqCompressionHeader.h b/ossim/include/ossim/support_data/ossimNitfVqCompressionHeader.h
deleted file mode 100644
index 918abef..0000000
--- a/ossim/include/ossim/support_data/ossimNitfVqCompressionHeader.h
+++ /dev/null
@@ -1,79 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts
-//
-// LICENSE: MIT see top level LICENSE.txt for more details
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfVqCompressionHeader.h 23666 2015-12-14 20:01:22Z rashadkm $
-#ifndef ossimNitfVqCompressionHeader_HEADER
-#define ossimNitfVqCompressionHeader_HEADER
-
-#include <vector>
-#include <ossim/support_data/ossimNitfCompressionHeader.h>
-
-class OSSIM_DLL ossimNitfVqCompressionOffsetTableData
-{
-public:
-
-   ossimNitfVqCompressionOffsetTableData();
-   ossimNitfVqCompressionOffsetTableData(const ossimNitfVqCompressionOffsetTableData& rhs);
-   ~ossimNitfVqCompressionOffsetTableData();
-   const ossimNitfVqCompressionOffsetTableData& operator =(const ossimNitfVqCompressionOffsetTableData& rhs);
-   ossim_uint32 getDataLengthInBytes()const;
-   void clearFields();
-   void parseStream(std::istream& in);
-   
-   ossim_uint16 theTableId;
-   ossim_uint32 theNumberOfCompressionLookupRecords;
-   ossim_uint16 theNumberOfValuesPerCompressionLookup;
-   ossim_uint16 theCompressionLookupValueBitLength;
-   ossim_uint32 theCompressionLookupTableOffset;
-   ossim_uint8* theData;
-};
-
-class OSSIM_DLL ossimNitfVqCompressionHeader : public ossimNitfCompressionHeader
-{
-public:
-   ossimNitfVqCompressionHeader();
-   virtual void parseStream(std::istream &in);
-
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    */
-   virtual std::ostream& print(std::ostream& out,
-                               const std::string& prefix) const;  
-
-   virtual bool saveState(ossimKeywordlist& kwl, const ossimString& prefix="")const;
-   virtual ossim_uint32 getBlockSizeInBytes()const;
-   virtual ossim_uint32 getNumberOfImageRows()const;
-   virtual ossim_uint32 getNumberOfImageCodesPerRow()const;
-   virtual ossim_uint32 getCompressionAlgorithmId()const;
-   virtual ossim_uint32 getImageCodeBitLength()const;
-   virtual ossim_uint32 getNumberOfTables()const;
-   const std::vector<ossimNitfVqCompressionOffsetTableData>& getTable()const;
-   
-protected:
-   ossim_uint32 theNumberOfImageRows;
-   ossim_uint32 theNumberOfImageCodesPerRow;
-   ossim_uint8  theImageCodeBitLength;
-
-   ossim_uint16 theCompressionAlgorithmId;
-   ossim_uint16 theNumberOfCompressionLookupOffsetRecords;
-   ossim_uint16 theNumberOfCompressionParameterOffsetRecords;
-
-   ossim_uint32 theCompressionLookupOffsetTableOffset;
-   ossim_uint16 theCompressionLookupTableOffsetRecordLength;
-
-   std::vector<ossimNitfVqCompressionOffsetTableData> theTable;
-   void clearFields();
-
-TYPE_DATA   
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimNmeaMessage.h b/ossim/include/ossim/support_data/ossimNmeaMessage.h
deleted file mode 100644
index d84498d..0000000
--- a/ossim/include/ossim/support_data/ossimNmeaMessage.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// File: ossimNmeaMessage.h
-//
-// Author:  Garrett Potts
-//
-// Description: Contains a general parser for NMEA messages.
-//
-//
-// $Id$
-//----------------------------------------------------------------------------
-#ifndef ossimNmeaMessage_HEADER
-#define ossimNmeaMessage_HEADER
-
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimException.h>
-#include <iostream>
-#include <algorithm>
-#include <vector>
-
-
-class OSSIM_DLL ossimNmeaMessage : public ossimReferenced
-{
-public:
-   typedef std::vector<ossimString> FieldListType;
-   
-   ossimNmeaMessage(const std::string& acceptedStartingCharacters="!$"):m_startChars(acceptedStartingCharacters){}
-   
-   /**
-    * Parses a standard formatted NMEA message.  No exceptions are created for checksums.  The checksum needs
-    * to be checked after parsing by calling validCheckSum().
-    */
-   virtual void parseMessage(std::istream& in)throw(ossimException);
-   
-   virtual bool valid()const{return validCheckSum();}
-   bool validCheckSum()const{return m_validCheckSum;}
-   
-   
-   ossim_uint32 numberOfFields()const{return m_fields.size();}
-   
-   const std::string& getField(ossim_uint32 idx)
-   {
-      static ossimString empty="";
-      
-      if(idx < m_fields.size()) return m_fields[idx];
-      
-      return empty;
-   }
-   const std::string& operator [](int idx)const
-   {
-      static ossimString empty="";
-      
-      if ( idx < static_cast<int>( m_fields.size() ) ) return m_fields[idx];
-      
-      return empty;
-   }
-   void setStartChars(const std::string& acceptedStartingCharacters="!$"){m_startChars = acceptedStartingCharacters;}
-   
-   virtual void reset()
-   {
-      m_fields.clear();
-      m_message = "";
-      m_validCheckSum = false;
-   }
-   const std::string& message()const{return m_message;}
-   
-   static ossim_uint32 checksum(std::string::const_iterator start, std::string::const_iterator end);
-   
-protected:
-   virtual void setFields(std::string::const_iterator start, std::string::const_iterator end);
-   
-   bool isValidStartChar(char c)const;
-   
-   std::string m_message;
-   FieldListType m_fields;
-   
-   bool m_validCheckSum;
-   std::string m_startChars;
-};
-
-#endif
-
-
diff --git a/ossim/include/ossim/support_data/ossimQuickbirdMetaData.h b/ossim/include/ossim/support_data/ossimQuickbirdMetaData.h
deleted file mode 100644
index 34e1efd..0000000
--- a/ossim/include/ossim/support_data/ossimQuickbirdMetaData.h
+++ /dev/null
@@ -1,130 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Class declaration for ossimQuickbirdMetaData.
-// 
-// This class parses a Space Imaging Quickbird meta data file.
-//
-//********************************************************************
-// $Id: ossimQuickbirdMetaData.h 14412 2009-04-27 16:58:46Z dburken $
-
-#ifndef ossimQuickbirdMetaData_HEADER
-#define ossimQuickbirdMetaData_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimString.h>
-
-#include <iosfwd>
-
-class ossimFilename;
-class ossimKeywordlist;
-
-class OSSIMDLLEXPORT ossimQuickbirdMetaData : public ossimObject
-{
-public:
-
-   /** @brief default constructor */
-   ossimQuickbirdMetaData();
-
-   /** virtual destructor */
-   virtual ~ossimQuickbirdMetaData();
-
-   /**
-    * @brief Open method that takes the image file, derives the metadata,
-    * header and rpc files, then calls parse methods parseMetaData,
-    * parseHdrData, and parseRpcData.
-    *
-    * @param imageFile Usually in the form of "po_2619900_pan_0000000.tif".
-    *
-    * @return true on success, false on error.
-    */
-   bool open(const ossimFilename& imageFile);
-
-   void clearFields();
-
-   //---
-   // Convenient method to print important image info:
-   //---
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * Method to save the state of the object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix = 0) const;
-   
-   /**
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix = 0);
-
-   /**
-    * @brief Method to parse Quickbird metadata file.
-    *
-    * @param metadata File name usually in the form of
-    * ".IMD."
-    *
-    * @return true on success, false on error.
-    */
-   bool parseMetaData(const ossimFilename& metadata);
-
-   /**
-    * @brief Method to parse Quickbird rpc file.
-    *
-    * @param metadata File name usually in the form of
-    * ".GEO.txt"
-    *
-    * @return true on success, false on error.
-    *
-    * @note Currently NOT implemented.
-    */
-   bool parseGEOData(const ossimFilename& data_file);
-
-   bool parseATTData(const ossimFilename& data_file);
-
-   bool parseEPHData(const ossimFilename& data_file);
-
-   /** @return theSatID */
-   ossimString getSatID() const;
-
-   bool getEndOfLine( char * fileBuf,
-                      ossimString lineBeginning,
-                      const char * format,
-                      ossimString & name );
-
-   const ossimIpt& getImageSize() const;
-
-/*****************************************
-*parseATTData EPH GEO IMD RPB TIL
-*
-****************************************/
-   
-private:
-
-   ossimString         theGenerationDate;
-   ossimString         theBandId;
-   int                 theBitsPerPixel;	
-   ossimString         theSatID;
-   ossimString         theTLCDate;
-   ossim_float64       theSunAzimuth;
-   ossim_float64       theSunElevation;
-   ossim_float64       theSatAzimuth;
-   ossim_float64       theSatElevation;
-   int                 theTDILevel;
-   std::vector<double> theAbsCalFactors;
-   ossimString         theBandNameList;
-   ossimIpt            theImageSize;
-
-TYPE_DATA
-};
-
-#endif /* #ifndef ossimQuickbirdMetaData_HEADER */
-
diff --git a/ossim/include/ossim/support_data/ossimRpfAttributeOffsetRecord.h b/ossim/include/ossim/support_data/ossimRpfAttributeOffsetRecord.h
deleted file mode 100644
index 6ecad74..0000000
--- a/ossim/include/ossim/support_data/ossimRpfAttributeOffsetRecord.h
+++ /dev/null
@@ -1,275 +0,0 @@
-#ifndef ossimRpfAttributeOffsetRecord_HEADER
-#define ossimRpfAttributeOffsetRecord_HEADER
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfAttributeOffsetRecord
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfAttributeOffsetRecord& data);
-
-   ossimRpfAttributeOffsetRecord();
-   virtual ~ossimRpfAttributeOffsetRecord(){}
-
-   ossimErrorCode parseStream(istream& in, ossimByteOrder byteOrder);
-   void print(ostream& out)const;
-   ossim_uint16  getAttributeId()const{return theAttributeId;}
-   ossim_uint8   getParamterId()const{return theParameterId;}
-   ossim_uint32  getAttributeRecordOffset()const{return theAttributeRecordOffset;}
-   
-private:
-   void clearFields();
-   /*!
-    * The attribute Id.  The Id and descriptions are taken from
-    * MIL-STD-2411-1 and can have one of the following values:
-    *
-    * ID     Description
-    * _________________________________________________________________
-    * 1      Currency Date, 1 parameter:
-    *          1. Date of most recent revision to the RPF
-    *             YYYYMMDD
-    *             8 byte ascii value
-    *
-    * 2      Production Date, 1 parameter:
-    *          1. Date the source data was transformed to RPF format
-    *             YYYYMMDD
-    *             8 byte ascii value
-    *  
-    * 3      Significant Date, 1 parameter:
-    *          1. Most accurately describes the date of
-    *             the source data.
-    *             YYYYMMDD
-    *             8 byte ascii value
-    *
-    * 4      Map/Chart source, 4 parameters:
-    *          1. Short title for the id of a group of
-    *             products.  ex: JOG 1501A ...
-    *             10 byte ascii value
-    *          2. The designation of the hardcopy source
-    *             8 byte ascii value
-    *          3. Old horizontal datum code.  Original
-    *             horizontal datum of the hardcopy product
-    *             4 byte ascii value
-    *          4. Edition number of the source graphic
-    *             7 byte ascii value.
-    *
-    * 5      Projection Systemd, 5 parameters: p. 38 of MIL-STD-2411-1
-    *          1. Projection Code. 2 byte ascii value
-    *             AC    Albers Equal area
-    *                   Requires Parameters A B C D
-    *             AL    Azimuthal Equal Dist.
-    *                   Requires Parameters A B
-    *             RB    Hotline Oblique Mercator
-    *                   Requires Parameters A B C 
-    *             LE    Lambert Conformal Conic
-    *                   Requires Parameters A B C D
-    *             MC    Mercator
-    *                   Requires Parameters A B
-    *             OC    Oblique Mercator
-    *                   Requires Parameters A B C
-    *             OD    Orthographic
-    *                   Requires Parameters A B
-    *             PG    Polar Stereo-graphic
-    *                   Requires Parameters A B C D
-    *             PH    Poly conic
-    *                   Requires Parameters A B
-    *             TC    Transverse Mercator
-    *                   Requires Parameters A B C
-    *             UT    Universal Transverse Mercator
-    *                   Requires Parameters A
-    *          2. Projection Param A: real 4 byte value
-    *          3. Projeciton Param B: real 4 byte value
-    *          4. Projection Param C: real 4 byte value
-    *          5. Projection Param D: real 4 byte value
-    * 6      Vertical Datum (1 parameter) p. 37 MIL-STD-2411-1
-    *         4 byte ascii
-    *
-    *          MSL     Mean Sea Level.  All elevations in th data set
-    *                  are referenced to the geoid of the specified datum
-    *          GEOD    Geodetic (All elevations in the data set
-    *                  are referenced to the ellipsoid of the specified
-    *                  datum
-    * 7      Horizontal Datum (1 parameter)
-    *        4 byte ascii
-    *
-    *            Look on p.33 of MIL-STD-2411-1.  Too big to list
-    *            we will need a translation table for these
-    *            codes
-    * 8      Vertical Absolute Accurracy (2 parameters)
-    *        1. vertical absolute accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    *
-    * 9      Horizontal Absolute Accuracy (2 parameters)
-    *        1. Horizontal absolute accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    *
-    * 10     Vertical Relative Accuracy (2 parameters)
-    *        1. Vertical relative accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    *
-    * 11     Horizontal Relative Accuracy (2 parameters)
-    *        1. Horizontal relative accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    *
-    * 12     Ellipsoid, 1 parameter:
-    *        1. Ellipsoid code.  3 byte ascii
-    *           See p. 40 of MIL-STD-2411-1
-    * 13     Sounding Datumm, 1 parameter: 4 byte ascii
-    *        See p. 33 MIL-STD-2411-1 5.3.2.2
-    * 14     Navigation System, 1 parameter: 
-    *        1. Navigation code. 2 byte unsigned int
-    *           See MIL-STD-2411-1 5.3.2.4
-    * 15     Grid, 1 parameter:
-    *        1. Grid code. 2 byte ascii
-    *           See MIL-STD-2411-1 5.3.2.7
-    * 16     Easterly Annual Magnetic Change, 2 parameters:
-    *        1. Easterly annual magnetic change. 4 byte real
-    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
-    * 17     Westerly Annual Magnetic Change, 2 parameters:
-    *        1. Westerly annual magnetic change. 4 byte real
-    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
-    * 18     Grid North Magnetic North ANgle, 2 paramters:
-    *        1. Grid North - Magnetic North.  4 byte real
-    *        2. Units of angle. 2 byte unsigned int
-    *           see 5.3.2.6
-    * 19     Grid convergence angle, 2 parameters:
-    *        1. Grid convergence angle.  4 byte Real
-    *        2. Units of angle. 2 byte unsigned int 5.3.2.6
-    * 20     Highest known elevation (4 parameters)
-    *        1. Highest known elevation: 8 byte real
-    *        2. Units of elevation: See 5.3.2.6 of MIL-STD-2411-1
-    *        3. Lat of elevation: 8 byte real in decimal degrees
-    *        4. Lon of elevation: 8 byte real in decimal degrees
-    * 21     Multiple legend, 1 paraemter:
-    *        1. Name of legend file that applies to this
-    *           12 byte ascii
-    * 22     Image source, 2 parameters:
-    *        1. Source of data from which this
-    *           RPF was derived. ex: SPOT. Landsat7, Landsat4.
-    *           for CDTED: "imagery, "carto"
-    *           12 byte ascii
-    *        2. GSD.  Ground sample or post distance.
-    *           4 byte unsigned int
-    * 23     Data Level, 1 parameter:
-    *        1. The level of the source.  For example:
-    *           if this is a DTED or CDTED it would
-    *           distinguish between level 1 and 2
-    */
-   ossim_uint16 theAttributeId;
-
-   /*!
-    * This defines which parameter number for theAttrributeId
-    */
-   ossim_uint8  theParameterId;
-
-   /*!
-    * This is a 1 byte field.  If the value is 0 then
-    * the attribute applies to the entire geographic coverage
-    * of this frame.  If it's > 0 then the areal coverage
-    * where the given attribute applies is defined in the corresponding
-    * explicit areal coverage record in the explicit areal
-    * coverage table.
-    */
-    ossim_uint8 theArealCoverageSequenceNumber;
-
-   /*!
-    * a 4-byte unsigned integer.  displacement in bytes measured
-    * from the beginning of the [attribute subsection] and the first
-    * byte of the [attribute record].
-    */
-   ossim_uint32 theAttributeRecordOffset;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfAttributeSectionSubheader.h b/ossim/include/ossim/support_data/ossimRpfAttributeSectionSubheader.h
deleted file mode 100644
index ebd1bcf..0000000
--- a/ossim/include/ossim/support_data/ossimRpfAttributeSectionSubheader.h
+++ /dev/null
@@ -1,53 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfAttributeSectionSubheader.h 9967 2006-11-29 02:01:23Z gpotts $
-#ifndef ossimRpfAttributeSectionSubheader_HEADER
-#define ossimRpfAttributeSectionSubheader_HEADER
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfAttributeSectionSubheader
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfAttributeSectionSubheader& data);
-   ossimRpfAttributeSectionSubheader();
-
-   virtual ~ossimRpfAttributeSectionSubheader(){}
-   ossimErrorCode parseStream(istream& in, ossimByteOrder byteOrder);
-   virtual void print(ostream& out)const;
-   ossim_uint16 getNumberOfAttributeOffsetRecords()const
-      {
-         return theNumberOfAttributeOffsetRecords;
-      }
-   ossim_uint16 getAttributeOffsetTableOffset()const
-      {
-         return theAttributeOffsetTableOffset;
-      }
-
-   ossim_uint64 getSubheaderStart()const;
-   ossim_uint64 getSubheaderEnd()const;
-   
-private:
-   void clearFields();
-   
-   ossim_uint16 theNumberOfAttributeOffsetRecords;
-   ossim_uint16 theNumberOfExplicitArealCoverageRecords;
-   ossim_uint32 theAttributeOffsetTableOffset;
-   ossim_uint16 theAttribteOffsetRecordLength;
-
-
-   mutable ossim_uint64 theAttributeSectionSubheaderStart;
-   mutable ossim_uint64 theAttributeSectionSubheaderEnd;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfAttributes.h b/ossim/include/ossim/support_data/ossimRpfAttributes.h
deleted file mode 100644
index 2a07be3..0000000
--- a/ossim/include/ossim/support_data/ossimRpfAttributes.h
+++ /dev/null
@@ -1,371 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimRpfAttributes.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimRpfAttributes_HEADER
-#define ossimRpfAttributes_HEADER
-#include <map>
-
-#include <ossim/base/ossimString.h>
-
-class OSSIM_DLL ossimRpfAttributes
-{
-
-public:
-   friend OSSIM_DLL std::ostream& operator<<(std::ostream& out,
-                                             const ossimRpfAttributes& data);
-   ossimRpfAttributes();
-   ~ossimRpfAttributes();
-
-   void setAttributeFlag(ossim_uint32 id,
-                         bool flag);
-   bool getAttributeFlag(ossim_uint32 id)const;
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-   
-   bool isEmpty()const;
-   void clearFields();
-   
-   /*!
-    * The attribute Id.  The Id and descriptions are taken from
-    * MIL-STD-2411-1 and can have one of the following values:
-    * _________________________________________________________________
-    * 1      Currency Date, 1 parameter:
-    *          1. Date of most recent revision to the RPF
-    *             YYYYMMDD
-    *             8 byte ascii value
-    */
-   ossimString theCurrencyDate;
-
-   /*! 2      Production Date, 1 parameter:
-    *          1. Date the source data was transformed to RPF format
-    *             YYYYMMDD
-    *             8 byte ascii value
-    */
-   ossimString theProductionDate;
-   
-   /*! 3      Significant Date, 1 parameter:
-    *          1. Most accurately describes the date of
-    *             the source data.
-    *             YYYYMMDD
-    *             8 byte ascii value
-    */
-   ossimString theSignificantDate;
-   
-   /*!
-    * 4      Map/Chart source, 4 parameters:
-    *          1. Short title for the id of a group of
-    *             products.  ex: JOG 1501A ...
-    *             10 byte ascii value
-    *          2. The designation of the hardcopy source
-    *             8 byte ascii value
-    *          3. Old horizontal datum code.  Original
-    *             horizontal datum of the hardcopy product
-    *             4 byte ascii value
-    *          4. Edition number of the source graphic
-    *             7 byte ascii value.
-    */
-   ossimString theChartSeriesCode; 
-   ossimString theMapDesignationCode; 
-   ossimString theOldHorDatum;   
-   ossimString theEdition;
-   
-   /*!
-    * 5      Projection Systemd, 5 parameters: p. 38 of MIL-STD-2411-1
-    *          1. Projection Code. 2 byte ascii value
-    *             AC    Albers Equal area
-    *                   Requires Parameters A B C D
-    *             AL    Azimuthal Equal Dist.
-    *                   Requires Parameters A B
-    *             RB    Hotline Oblique Mercator
-    *                   Requires Parameters A B C 
-    *             LE    Lambert Conformal Conic
-    *                   Requires Parameters A B C D
-    *             MC    Mercator
-    *                   Requires Parameters A B
-    *             OC    Oblique Mercator
-    *                   Requires Parameters A B C
-    *             OD    Orthographic
-    *                   Requires Parameters A B
-    *             PG    Polar Stereo-graphic
-    *                   Requires Parameters A B C D
-    *             PH    Poly conic
-    *                   Requires Parameters A B
-    *             TC    Transverse Mercator
-    *                   Requires Parameters A B C
-    *             UT    Universal Transverse Mercator
-    *                   Requires Parameters A
-    *          2. Projection Param A: real 4 byte value
-    *          3. Projeciton Param B: real 4 byte value
-    *          4. Projection Param C: real 4 byte value
-    *          5. Projection Param D: real 4 byte value
-    */
-   ossimString theProjectionCode;
-   float theProjectionA;
-   float theProjectionB;
-   float theProjectionC;
-   float theProjectionD;
-
-   /*!
-    * 6      Vertical Datum (1 parameter) p. 37 MIL-STD-2411-1
-    *         4 byte ascii
-    *
-    *          MSL     Mean Sea Level.  All elevations in th data set
-    *                  are referenced to the geoid of the specified datum
-    *          GEOD    Geodetic (All elevations in the data set
-    *                  are referenced to the ellipsoid of the specified
-    *                  datum
-    */
-   ossimString theVertDatumCode;
-
-   /*!
-    * 7      Horizontal Datum (1 parameter)
-    *        4 byte ascii
-    *
-    *            Look on p.33 of MIL-STD-2411-1.  Too big to list
-    *            we will need a translation table for these
-    *            codes
-    */
-   ossimString theHorDatumCode;
-   
-   /*!
-    * 8      Vertical Absolute Accurracy (2 parameters)
-    *        1. vertical absolute accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    */
-   ossim_uint32  theVertAbsAccuracy;
-   ossim_uint16 theVertAbsUnits;
-   
-   /*!
-    * 9      Horizontal Absolute Accuracy (2 parameters)
-    *        1. Horizontal absolute accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    */
-   ossim_uint32  theHorAbsAccuracy;
-   ossim_uint16 theHorAbsUnits;
-   
-   /*!
-    * 10     Vertical Relative Accuracy (2 parameters)
-    *        1. Vertical relative accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    */
-   ossim_uint32  theVertRelAccuracy;
-   ossim_uint16 theVertRelUnits;
-   
-   /*!
-    * 11     Horizontal Relative Accuracy (2 parameters)
-    *        1. Horizontal relative accuracy: 4 byte unsigned int
-    *        2. Accuracy units of measure:  2 byte value 
-    *             0   unknown
-    *             1   meters (Length area Volume)
-    *             2   Kilopounds
-    *             3   Seconds (of time)
-    *             4   Meters/Second (speed)
-    *             5   Cubic Meters per second (Flow)
-    *             6   Volt (Electrical potential)
-    *             7   Watt (Ten to 6 electirical power)
-    *             8   Hertz
-    *             9   +- DD MM SS.S (Angular)
-    *             10  +- HH MM SS.S (Time)
-    *             11  International Nautical Mile (1852 meters)
-    *             12  knot
-    *             13  Nautical mile per day
-    *             14  Feet
-    *             15  Fathom
-    *             16  Micrometers (microns)
-    *             17  Mils
-    *             18  Seconds of Arc
-    *             19  Minutes of Arc
-    *             20  Degrees of arc
-    *             999 Other
-    */
-   ossim_uint32  theHorRelAccuracy;
-   ossim_uint16 theHorRelUnits; 
-
-   /*!
-    * 12     Ellipsoid, 1 parameter:
-    *        1. Ellipsoid code.  3 byte ascii
-    *           See p. 40 of MIL-STD-2411-1
-    */
-   ossimString ellipsoidCode;
-
-   /*!
-    * 13     Sounding Datumm, 1 parameter: 4 byte ascii
-    *        See p. 33 MIL-STD-2411-1 5.3.2.2
-    */
-   ossimString theSoundingDatumCode;
-   
-   /*!
-    * 14     Navigation System, 1 parameter: 
-    *        1. Navigation code. 2 byte unsigned int
-    *           See MIL-STD-2411-1 5.3.2.4
-    */
-   ossim_uint16 theNavSystemCode; 
-
-   /*!
-    * 15     Grid, 1 parameter:
-    *        1. Grid code. 2 byte ascii
-    *           See MIL-STD-2411-1 5.3.2.7
-    */
-   ossimString theGridCode;
-
-   /*!
-    * 16     Easterly Annual Magnetic Change, 2 parameters:
-    *        1. Easterly annual magnetic change. 4 byte real
-    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
-    */
-   float          theEeasterlyMagChange; 
-   ossim_uint16 theEasterlyMagChangeUnits;
-
-   /*!
-    * 17     Westerly Annual Magnetic Change, 2 parameters:
-    *        1. Westerly annual magnetic change. 4 byte real
-    *        2. Units of the change.  See 5.3.2.6 of MIL-STD-2411-1
-    */
-   float          theWesterlyMagChange;
-   ossim_uint16 theWesterlyMagChangeUnits;
-
-   /*!
-    * 18     Grid North Magnetic North ANgle, 2 paramters:
-    *        1. Grid North - Magnetic North.  4 byte real
-    *        2. Units of angle. 2 byte unsigned int
-    *           see 5.3.2.6
-    */
-   float          theMagAngle; 
-   ossim_uint16 theMagAngleUnits;
-
-   /*!
-    * 19     Grid convergence angle, 2 parameters:
-    *        1. Grid convergence angle.  4 byte Real
-    *        2. Units of angle. 2 byte unsigned int 5.3.2.6
-    */
-   float          theGridConver; 
-   ossim_uint16 theGridConverUnits;
-
-   /*!
-    * 20     Highest known elevation (4 parameters)
-    *        1. Highest known elevation: 8 byte real
-    *        2. Units of elevation: See 5.3.2.6 of MIL-STD-2411-1
-    *        3. Lat of elevation: 8 byte real in decimal degrees
-    *        4. Lon of elevation: 8 byte real in decimal degrees
-    */
-   double         theHighElevation;
-   ossim_uint16   theHighElevationUnits;
-   double         theHighLat;
-   double         theHighLon;
-
-   /*! 21     Multiple legend, 1 paraemter:
-    *        1. Name of legend file that applies to this
-    *           12 byte ascii
-    */
-   ossimString theLegendFileName;
-   
-   /*!
-    * 22     Image source, 2 parameters:
-    *        1. Source of data from which this
-    *           RPF was derived. ex: SPOT. Landsat7, Landsat4.
-    *           for CDTED: "imagery, "carto"
-    *           12 byte ascii
-    *
-    *        2. GSD.  Ground sample or post distance.
-    *           4 byte unsigned int
-    */
-    ossimString theDataSource; // [12];
-    ossim_uint32 theGsd; // uint
-
-   /*!
-    * 23     Data Level, 1 parameter:
-    *        1. The level of the source.  For example:
-    *           if this is a DTED or CDTED it would
-    *           distinguish between level 1 and 2
-    */
-   ossim_uint16 theDataLevel; // ushort
-
-protected:
-   std::map<ossim_uint32, bool> theAttributeIdBoolMap;
-   
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimRpfColorConverterOffsetRecord.h b/ossim/include/ossim/support_data/ossimRpfColorConverterOffsetRecord.h
deleted file mode 100644
index 325806f..0000000
--- a/ossim/include/ossim/support_data/ossimRpfColorConverterOffsetRecord.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef ossimRpfColorConverterOffsetRecord_HEADER
-#define ossimRpfColorConverterOffsetRecord_HEADER
-#include <iostream>
-using namespace std;
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-
-class ossimRpfColorConverterOffsetRecord
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfColorConverterOffsetRecord& data);
-   ossimRpfColorConverterOffsetRecord();
-   
-   ossimErrorCode parseStream(istream& in,
-                              ossimByteOrder byteOrder);
-
-   void clearFields();
-   /*!
-    * Is a two byte field as is described in Mil-STD-2411-1.
-    * The id can be one of:
-    *
-    * 1       CCT/1--->1
-    * 2       CCT/1--->2
-    * 3       CCT/1--->3
-    * 4       CCT/1--->4
-    * 5       CCT/2--->2
-    * 6       CCT/2--->3
-    * 7       CCT/2--->4
-    * 8       CCT/3--->3
-    *
-    * where CCT stands for Color Converter Table
-    */
-   ossim_uint16 theColorConverterTableId;
-
-   /*!
-    * Is a 4 byte field.
-    */
-   ossim_uint32  theNumberOfColorConverterRecords;
-
-   /*!
-    * Is a 4 byte field indicating the offset from the start of
-    * the color converter subsection to the color converter table.
-    */
-   ossim_uint32  theColorConverterTableOffset;
-
-   /*!
-    * Is a 4 byte field indicating the offset from the colormap
-    * subsection to the source color/grayscale offset table.
-    */
-   ossim_uint32  theSourceColorGrayscaleOffsetTableOffset;
-
-   /*!
-    * Is a 4 byte field indicating the offset from the colormap
-    * subsection to the color/graysscale offset table.
-    */
-   ossim_uint32  theTargetColorGrayscaleOffsetTableOffset;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfColorConverterSubsection.h b/ossim/include/ossim/support_data/ossimRpfColorConverterSubsection.h
deleted file mode 100644
index 39f7d1a..0000000
--- a/ossim/include/ossim/support_data/ossimRpfColorConverterSubsection.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef ossimRpfColorConverterSubsection_HEADER
-#define ossimRpfColorConverterSubsection_HEADER
-#include <iostream>
-#include <vector>
-#include <iterator>
-using namespace std;
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/support_data/ossimRpfColorConverterTable.h>
-
-class ossimRpfColorConverterSubsection
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfColorConverterSubsection& data);
-   ossimRpfColorConverterSubsection();
-   virtual ~ossimRpfColorConverterSubsection(){}
-
-   ossimErrorCode parseStream(istream& in,
-                              ossimByteOrder byteOrder);
-   
-   ossim_uint32 getStartOffset()const{return theStartOffset;}
-   ossim_uint32 getEndOffset()const{return theEndOffset;}
-
-   const vector<ossimRpfColorConverterTable>& getColorConversionTable()const
-      {
-         return theTableList;
-      }
-   const ossimRpfColorConverterTable* getColorConversionTable(ossim_uint32 givenThisNumberOfEntires)const;
-   
-   void setNumberOfColorConverterOffsetRecords(ossim_uint16 numberOfRecords);
-   void print(ostream& out)const;
-
-   void clearFields();
-   
-private:
-   ossimRpfColorConverterSubsection(const ossimRpfColorConverterSubsection&){}//hide
-   void operator =(const ossimRpfColorConverterSubsection&){}//hide
-
-   ossim_uint32  theStartOffset;
-   ossim_uint32  theEndOffset;
-   
-   ossim_uint16  theNumberOfColorConverterOffsetRecords;
-   
-   ossim_uint32  theColorConverterOffsetTableOffset;
-   ossim_uint16  theColorConverterOffsetRecordLength;
-   ossim_uint16  theConverterRecordLength;
-
-   vector<ossimRpfColorConverterTable> theTableList;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfColorConverterTable.h b/ossim/include/ossim/support_data/ossimRpfColorConverterTable.h
deleted file mode 100644
index 67e1411..0000000
--- a/ossim/include/ossim/support_data/ossimRpfColorConverterTable.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef ossimRpfColorConverterTable_HEADER
-#define ossimRpfColorConverterTable_HEADER
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfColorConverterTable
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfColorConverterTable& data);
-   
-   ossimRpfColorConverterTable();
-   virtual ~ossimRpfColorConverterTable();
-
-   ossimErrorCode parseStream(istream& in,
-                              ossimByteOrder byteOrder);
-   void print(ostream& out)const;
-   ossim_uint32 getEntry(ossim_uint32 entry){return theColorGrayscaleTableEntryList[entry];}
-   void setNumberOfEntries(ossim_uint32 entries);
-   void setTableId(ossim_uint16 id);
-   const ossim_uint32* getEntryList()const{return theColorGrayscaleTableEntryList;}
-   ossim_uint32 getNumberOfEntries()const{return theNumberOfEntries;}
-   
-private:
-   /*!
-    * This will not be a field read from the stream this is
-    * the value in the color converter offset table.
-    */
-   ossim_uint16 theTableId;
-
-   /*!
-    * Holds the number of entries
-    */ 
-   ossim_uint32  theNumberOfEntries;
-
-   /*!
-    * This will hold the lookup table values.
-    */
-   ossim_uint32* theColorGrayscaleTableEntryList;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h b/ossim/include/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h
deleted file mode 100644
index 0697fba..0000000
--- a/ossim/include/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef ossimRpfColorGrayscaleOffsetRecord_HEADER
-#define ossimRpfColorGrayscaleOffsetRecord_HEADER
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfColorGrayscaleOffsetRecord
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfColorGrayscaleOffsetRecord& data);
-   
-   ossimRpfColorGrayscaleOffsetRecord();
-
-   ossimErrorCode parseStream(istream& in,
-                              ossimByteOrder byteOrder);
-   
-   void print(ostream& out)const;
-
-   void clearFields();
-   ossim_uint16 getColorGrayscaleTableId()const
-      {
-         return theColorGrayscaleTableId;
-      }
-   ossim_uint32 getNumberOfColorGrayscaleRecords()const
-      {
-         return theNumberOfColorGrayscaleRecords;
-      }
-   ossim_uint32 getColorGrayscaleTableOffset()const
-      {
-         return theColorGrayscaleTableOffset;
-      }
-private:
-   ossim_uint16  theColorGrayscaleTableId;
-   ossim_uint32  theNumberOfColorGrayscaleRecords;
-   unsigned char theColorGrayscaleElementLength;
-   ossim_uint16  theHistogramRecordLength;
-   ossim_uint32  theColorGrayscaleTableOffset;
-   ossim_uint32  theHistogramTableOffset;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfColorGrayscaleSubheader.h b/ossim/include/ossim/support_data/ossimRpfColorGrayscaleSubheader.h
deleted file mode 100644
index 3c671b6..0000000
--- a/ossim/include/ossim/support_data/ossimRpfColorGrayscaleSubheader.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef ossimRpfColorGrayscaleSubheader_HEADER
-#define ossimRpfColorGrayscaleSubheader_HEADER
-#include <iostream>
-using namespace std;
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimConstants.h>
-
-class ossimRpfColorGrayscaleSubheader
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfColorGrayscaleSubheader& data);
-   
-   ossimRpfColorGrayscaleSubheader();
-   ~ossimRpfColorGrayscaleSubheader(){}
-   
-   ossimErrorCode parseStream(istream& in,
-                            ossimByteOrder byteOrder);
-   void print(ostream& out)const;
-   unsigned long getStartOffset()const
-      {
-         return theStartOffset;
-      }
-   unsigned long getEndOffset()const
-      {
-         return theEndOffset;
-      }
-   unsigned long getNumberOfColorGreyscaleOffsetRecords()const
-      {
-         return theNumberOfColorGreyscaleOffsetRecords;
-      }
-   unsigned long getNumberOfColorConverterOffsetRecords()const
-      {
-         return theNumberOfColorConverterOffsetRecords;
-      }
-   
-private:
-   void clearFields();
-
-   unsigned long theStartOffset;
-   unsigned long theEndOffset;
-   
-   unsigned char theNumberOfColorGreyscaleOffsetRecords;
-   unsigned char theNumberOfColorConverterOffsetRecords;
-
-   /*!
-    * 12 byte field.
-    */
-   ossimString         theColorGrayscaleFilename;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfColorGrayscaleTable.h b/ossim/include/ossim/support_data/ossimRpfColorGrayscaleTable.h
deleted file mode 100644
index 4ac7c0d..0000000
--- a/ossim/include/ossim/support_data/ossimRpfColorGrayscaleTable.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef ossimRpfColorGrayscaleTable_HEADER
-#define ossimRpfColorGrayscaleTable_HEADER
-#include <iostream>
-using namespace std;
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfColorGrayscaleTable
-{
-public:
-   friend ostream& operator <<(ostream& out,
-                               const ossimRpfColorGrayscaleTable& data);
-   ossimRpfColorGrayscaleTable();
-   ossimRpfColorGrayscaleTable(const ossimRpfColorGrayscaleTable& rhs);
-   virtual ~ossimRpfColorGrayscaleTable();
-
-   ossimErrorCode parseStream(istream& in, ossimByteOrder byteOrder);
-   
-   void setTableData(unsigned short id,
-                     unsigned long  numberOfElements);
-   
-   const ossimRpfColorGrayscaleTable& operator =(const ossimRpfColorGrayscaleTable&);
-
-   const unsigned char* getData()const{return theData;}
-   const unsigned char* getStartOfData(unsigned long entry)const;
-   unsigned short getTableId()const{return theTableId;}
-   unsigned long getNumberOfElements()const{return theNumberOfElements;}
-   
-private:   
-   unsigned long theNumberOfElements;
-
-   unsigned long theTotalNumberOfBytes;
-   
-   /*!
-    * This will not be parsed from the stream.  This is set when
-    * reading the offset record for this table.  The id defines
-    * the format of the data buffer. if the id is :
-    *
-    * 1           then the buffer is in the format of RGB
-    * 2                     ""                        RGBM
-    * 3                     ""                        M
-    * 4                     ""                        CMYK
-    */
-   unsigned short theTableId;
-
-   
-
-   unsigned char* theData;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h b/ossim/include/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h
deleted file mode 100644
index ff7be47..0000000
--- a/ossim/include/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef ossimRpfCompressionLookupOffsetRecord_HEADER
-#define ossimRpfCompressionLookupOffsetRecord_HEADER
-#include <iostream>
-using namespace std;
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfCompressionLookupOffsetRecord
-{
-public:
-   friend ostream& operator <<(ostream &out,
-                               const ossimRpfCompressionLookupOffsetRecord& data);
-   ossimRpfCompressionLookupOffsetRecord();
-   ossimErrorCode parseStream(istream& in,
-                              ossimByteOrder byteOrder);
-   void print(ostream& out)const;
-   ossim_uint16 getCompressionLookupTableId()const
-      {
-         return theCompressionLookupTableId;
-      }
-   ossim_uint32 getNumberOfCompressionLookupRecords()const
-      {
-         return theNumberOfCompressionLookupRecords;
-      }
-   ossim_uint16 getNumberOfValuesPerCompressionLookupRecord()const
-      {
-         return theNumberOfValuesPerCompressionLookupRecord;
-      }
-   ossim_uint16 getCompressionLookupValueBitLength()const
-      {
-         return theCompressionLookupValueBitLength;
-      }
-   ossim_uint32 getCompressionLookupTableOffset()const
-      {
-         return theCompressionLookupTableOffset;
-      }
-   
-private:
-   void clearFields();
-   
-   ossim_uint16 theCompressionLookupTableId;
-   ossim_uint32 theNumberOfCompressionLookupRecords;
-   ossim_uint16 theNumberOfValuesPerCompressionLookupRecord;
-   ossim_uint16 theCompressionLookupValueBitLength;
-   ossim_uint32 theCompressionLookupTableOffset;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfCompressionSection.h b/ossim/include/ossim/support_data/ossimRpfCompressionSection.h
deleted file mode 100644
index 6226831..0000000
--- a/ossim/include/ossim/support_data/ossimRpfCompressionSection.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef ossimRpfCompressionSection_HEADER
-#define ossimRpfCompressionSection_HEADER
-#include <iostream>
-#include <vector>
-#include <iterator>
-using namespace std;
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimConstants.h>
-
-class ossimRpfCompressionSectionSubheader;
-
-struct ossimRpfCompressionOffsetTableData
-{
-   friend ostream& operator<<(ostream& out,
-                              const ossimRpfCompressionOffsetTableData& data);
-   ossimRpfCompressionOffsetTableData();
-   ossimRpfCompressionOffsetTableData(const ossimRpfCompressionOffsetTableData& rhs);
-   ~ossimRpfCompressionOffsetTableData();
-   const ossimRpfCompressionOffsetTableData& operator =(const ossimRpfCompressionOffsetTableData& rhs);
-   
-   ossim_uint16 theTableId;
-   ossim_uint32 theNumberOfLookupValues;
-   ossim_uint16 theCompressionLookupValueBitLength;
-   ossim_uint16 theNumberOfValuesPerLookup;
-   ossim_uint8* theData;
-};
-
-class ossimRpfCompressionSection
-{
-public:
-   friend ostream& operator << (ostream& out,
-                                const ossimRpfCompressionSection& data);
-   ossimRpfCompressionSection();
-   virtual ~ossimRpfCompressionSection();
-   ossimErrorCode parseStream(istream& in,
-                              ossimByteOrder byteOrder);
-   void print(ostream& out)const;
-   const vector<ossimRpfCompressionOffsetTableData>& getTable()const
-      {
-         return theTable;
-      }
-   const ossimRpfCompressionSectionSubheader* getSubheader()const
-   {
-      return theSubheader;
-   }
-private:
-   void clearTable();
-   
-   ossimRpfCompressionSectionSubheader* theSubheader;
-   
-   ossim_uint32 theCompressionLookupOffsetTableOffset;
-   ossim_uint16 theCompressionLookupTableOffsetRecordLength;
-
-   vector<ossimRpfCompressionOffsetTableData> theTable;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfCompressionSectionSubheader.h b/ossim/include/ossim/support_data/ossimRpfCompressionSectionSubheader.h
deleted file mode 100644
index 71fb78b..0000000
--- a/ossim/include/ossim/support_data/ossimRpfCompressionSectionSubheader.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef ossimRpfCompressionSectionSubheader_HEADER
-#define ossimRpfCompressionSectionSubheader_HEADER
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfCompressionSectionSubheader
-{
-public:
-   friend ostream& operator<<(ostream& out,
-                              const ossimRpfCompressionSectionSubheader& data);
-   ossimRpfCompressionSectionSubheader();
-   virtual ~ossimRpfCompressionSectionSubheader(){}
-
-   ossimErrorCode parseStream(istream& in, ossimByteOrder byteOrder);
-
-   unsigned long getStartOffset()const{return theStartOffset;}
-   unsigned long getEndOffset()const{return theEndOffset;}
-   unsigned short getCompressionAlgorithmId()const
-      {
-         return theCompressionAlgorithmId;
-      }
-   unsigned short getNumberOfCompressionLookupOffsetRecords()const
-      {
-         return theNumberOfCompressionLookupOffsetRecords;
-      }
-   unsigned short getNumberOfCompressionParameterOffsetRecords()const
-      {
-         return theNumberOfCompressionParameterOffsetRecords;
-      }
-   void print(ostream& out)const;
-   
-private:
-   void clearFields();
-
-   /*!
-    * helper varible that holds the starting absolute
-    * offset to the start of the this data.
-    */
-   unsigned long theStartOffset;
-
-   /*!
-    * helper varible that holds the starting absolute
-    * offset to the end of the this data.
-    */
-   unsigned long theEndOffset;
-   /*!
-    * Current ids are:
-    *
-    * 1  VQ
-    * 2 Jpeg Lossless
-    */
-   unsigned short theCompressionAlgorithmId;
-
-   unsigned short theNumberOfCompressionLookupOffsetRecords;
-
-   unsigned short theNumberOfCompressionParameterOffsetRecords;
-   
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfCoverageSection.h b/ossim/include/ossim/support_data/ossimRpfCoverageSection.h
deleted file mode 100644
index b56f791..0000000
--- a/ossim/include/ossim/support_data/ossimRpfCoverageSection.h
+++ /dev/null
@@ -1,163 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfCoverageSection.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRpfCoverageSection_HEADER
-#define ossimRpfCoverageSection_HEADER
-
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimRpfConstants.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-class ossimRpfCoverageSection
-{
-public:
-   friend std::ostream& operator <<(std::ostream &out,
-                                    const ossimRpfCoverageSection &data);
-   
-   ossimRpfCoverageSection();
-   ossimRpfCoverageSection(const ossimRpfCoverageSection& obj);
-   const ossimRpfCoverageSection& operator=(const ossimRpfCoverageSection& rhs);
-   
-   ~ossimRpfCoverageSection(){}
-
-   ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder);
-
-   /**
-    * @brief Write method.
-    *
-    * @param out Stream to write to.
-    */
-   void writeStream(std::ostream& out);
-
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-   
-   void clearFields();
-
-   bool isGeographicRectNull()const
-   {
-      return ((theUpperLeftLat  == OSSIM_RPF_ULONG_NULL) &&
-              (theUpperLeftLon  == OSSIM_RPF_ULONG_NULL) &&
-              (theLowerLeftLat  == OSSIM_RPF_ULONG_NULL) &&
-              (theLowerLeftLon  == OSSIM_RPF_ULONG_NULL) &&
-              (theLowerRightLat == OSSIM_RPF_ULONG_NULL) &&
-              (theLowerRightLon == OSSIM_RPF_ULONG_NULL) &&
-              (theUpperRightLat == OSSIM_RPF_ULONG_NULL) &&
-              (theUpperRightLon == OSSIM_RPF_ULONG_NULL));
-   }
-   bool isIntervalNull()const
-   {
-      return ((theVerticalInterval   == OSSIM_RPF_ULONG_NULL)&&
-              (theHorizontalInterval == OSSIM_RPF_ULONG_NULL));
-   }
-
-   ossim_float64 getUlLat()const{return theUpperLeftLat;}
-   ossim_float64 getUlLon()const{return theUpperLeftLon;}
-   ossim_float64 getLlLat()const{return theLowerLeftLat;}
-   ossim_float64 getLlLon()const{return theLowerLeftLon;}
-   ossim_float64 getLrLat()const{return theLowerRightLat;}
-   ossim_float64 getLrLon()const{return theLowerRightLon;}
-   ossim_float64 getUrLat()const{return theUpperRightLat;}
-   ossim_float64 getUrLon()const{return theUpperRightLon;}
-
-   ossim_float64 getVerticalResolution()const{return theVerticalResolution;}
-   ossim_float64 getHorizontalResolution()const{return theHorizontalResolution;}
-
-   /*!
-    * This indicates the lat increment per pixel in degrees.
-    */
-   ossim_float64 getVerticalInterval()const{return theVerticalInterval;}
-
-   /*!
-    * This indicates the lon increment per pixel in degrees.
-    */
-   ossim_float64 getHorizontalInterval()const{return theHorizontalInterval;}
-
-   /** @brief Sets theUpperLeftLat to value. */
-   void setUlLat(ossim_float64 value);
-
-   /** @brief Sets theUpperLeftLon to value. */
-   void setUlLon(ossim_float64 value);
-
-   /** @brief Sets theLowerLeftLat to value. */
-   void setLlLat(ossim_float64 value);
-
-   /** @brief Sets theLowerLeftLon to value. */
-   void setLlLon(ossim_float64 value);
-   
-   /** @brief Sets theLowerRightLat to value. */
-   void setLrLat(ossim_float64 value);
-   
-   /** @brief Sets theLowerRightLon to value. */
-   void setLrLon(ossim_float64 value);
-
-   /** @brief Sets theUpperRightLat to value. */
-   void setUrLat(ossim_float64 value);
-
-   /** @brief Sets theUpperRightLon to value. */
-   void setUrLon(ossim_float64 value);
-
-   /** @brief Sets theVerticalResolution to value. */
-   void setVerticalResolution(ossim_float64 value);
-
-   /** @brief Sets theHorizontalResolution to value. */
-   void setHorizontalResolution(ossim_float64 value);
-   
-   /** @brief Sets theVerticalInterval to value. */
-   void setVerticalInterval(ossim_float64 value);
-   
-   /** @brief Sets theHorizontalInterval to value. */
-   void setHorizontalInterval(ossim_float64 value);
-   
-private:   
-   /*!
-    * 8 byte ossim_float64 and is the upper left lat or
-    * North West portion of the image.
-    */
-   ossim_float64 theUpperLeftLat;
-
-   /*!
-    * 8 byte ossim_float64 and is the upper left lon
-    * (North west)
-    */
-   ossim_float64 theUpperLeftLon;
-
-   ossim_float64 theLowerLeftLat;
-   ossim_float64 theLowerLeftLon;
-
-   ossim_float64 theUpperRightLat;
-   ossim_float64 theUpperRightLon;
-
-   ossim_float64 theLowerRightLat;
-   ossim_float64 theLowerRightLon;
-
-   ossim_float64 theVerticalResolution;
-   ossim_float64 theHorizontalResolution;
-
-   ossim_float64 theVerticalInterval;
-   ossim_float64 theHorizontalInterval;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimRpfFrame.h b/ossim/include/ossim/support_data/ossimRpfFrame.h
deleted file mode 100644
index 2269135..0000000
--- a/ossim/include/ossim/support_data/ossimRpfFrame.h
+++ /dev/null
@@ -1,208 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: This class give the capability to access tiles from an
-//              rpf file.
-//
-//********************************************************************
-// $Id: ossimRpfFrame.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimRpfFrame_HEADER
-#define ossimRpfFrame_HEADER 1
-
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimRpfColorGrayscaleTable.h>
-#include <ossim/support_data/ossimRpfReplaceUpdateTable.h>
-#include <iosfwd>
-#include <vector>
-
-class ossimRpfHeader;
-class ossimRpfAttributes;
-class ossimRpfCoverageSection;
-class ossimRpfImageDescriptionSubheader;
-class ossimRpfImageDisplayParameterSubheader;
-class ossimRpfMaskSubheader;
-class ossimRpfCompressionSection;
-class ossimRpfColorGrayscaleSubheader;
-class ossimRpfColorConverterSubsection;
-
-class OSSIM_DLL ossimRpfFrame : public ossimReferenced
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimRpfFrame& data);
-   ossimRpfFrame();
-   ~ossimRpfFrame();
-   
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;  
-
-   ossimErrorCode parseFile(const ossimFilename& filename,
-                            bool minimalParse = false);
-   
-   const ossimRpfHeader* getRpfHeader()const{return theHeader;}
-
-   bool hasSubframeMaskTable()const;
-
-   const vector< vector<ossim_uint32> >& getSubFrameMask(
-      ossim_uint32 spectralGroup)
-   {
-      return theSubframeMaskTable[spectralGroup];
-   }
-   
-   bool fillSubFrameBuffer(ossim_uint8* buffer,
-                           ossim_uint32 spectralGroup,
-                           ossim_uint32 row,
-                           ossim_uint32 col)const;
-   
-   const ossimRpfCompressionSection* getCompressionSection()const
-   {
-      return theCompressionSection;
-   }
-   const vector<ossimRpfColorGrayscaleTable>& getColorGrayscaleTable()const
-   {
-      return theColorGrayscaleTable;
-   }
-   const ossimRpfColorConverterSubsection* getColorConverterSubsection()const
-   {
-      return theColorConverterSubsection;
-   }
-   const ossimRpfAttributes* getAttributes()const
-   {
-      return theAttributes;
-   }
-   const ossimNitfFile* getNitfFile()const
-   {
-      return theNitfFile.get();
-   }
-
-   /**
-    * @return The RPF replace / update table.  The ossimRefPtr can have a null
-    * internal pointer if record was not found. Callers should check
-    * ossimRefPtr<ossimRpfReplaceUpdateTable>::valid() before using pointer.
-    */
-   ossimRefPtr<ossimRpfReplaceUpdateTable> getRpfReplaceUpdateTable() const;
-
-private:
-   void clearFields();
-   void deleteAll();
-   ossimErrorCode populateCoverageSection(std::istream& in);
-   ossimErrorCode populateCompressionSection(std::istream& in);
-   ossimErrorCode populateImageSection(std::istream& in);
-   ossimErrorCode populateAttributeSection(std::istream& in);
-   ossimErrorCode populateColorGrayscaleSection(std::istream& in);
-   ossimErrorCode populateMasks(std::istream& in);
-   ossimErrorCode populateReplaceUpdateTable(std::istream& in);
-
-   /*!
-    * The header will be instantiated during the opening of the
-    * frame file.
-    */
-   ossimRpfHeader *theHeader;
-
-   /*!
-    * The filename is set if its a successful open.
-    */
-   ossimFilename   theFilename;
-
-   /*!
-    * This will hold the coverage.
-    */
-   ossimRpfCoverageSection* theCoverage;
-
-   /*!
-    * This will hold the attributes of this frame.
-    */
-   ossimRpfAttributes *theAttributes;
-
-   /*!
-    * This is the subheader for the image.  It will have
-    * some general information about the image.
-    */
-   ossimRpfImageDescriptionSubheader* theImageDescriptionSubheader;
-
-   /*!
-    * This is the mask subheader.
-    */
-   ossimRpfMaskSubheader* theMaskSubheader;
-   
-   /*!
-    * This is the subheader for the display parameters
-    * for this frame.
-    */
-   ossimRpfImageDisplayParameterSubheader* theImageDisplayParameterSubheader;
-
-   /*!
-    * Will hold a pointer to the compression information section.
-    */
-   ossimRpfCompressionSection*             theCompressionSection;
-   
-   /*!
-    * If present, it will hold the color grayscale subheader.
-    */
-   ossimRpfColorGrayscaleSubheader*        theColorGrayscaleSubheader;
-
-   /*!
-    * 
-    */
-   ossimRpfColorConverterSubsection*       theColorConverterSubsection;
-
-   /*!
-    * 
-    */
-   vector<ossimRpfColorGrayscaleTable>     theColorGrayscaleTable;
-
-   /*!
-    * 
-    */
-   ossimRefPtr<ossimNitfFile>              theNitfFile;
-
-   /*!
-    * We have a 3-D array.  For the most part the numberof spectral groups
-    * should be one.  The indexes are as follows:
-    *
-    * theSubframeMasKTable[spectralGroup][row][col]
-    *
-    *  It will hold RPF_NULL(0xffffffff) if the subframe does not exist
-    *  and it will hold an offset value from the start of the
-    * [spatial data section] to the first byte of the subframe table.
-    */
-   vector< vector< vector< ossim_uint32> > > theSubframeMaskTable;
-
-   /*!
-    * We have a 3-D array.  For the most part the numberof spectral groups
-    * should be one.  The indexes are as follows:
-    *
-    * theSubframeTransparencyMaskTable[spectralGroup][row][col]
-    *
-    *  It will hold RPF_NULL(0xffffffff) if the subframe does not exist
-    *  and it will hold an offset value from the start of the
-    * [spatial data section] to the first byte of the subframe table.
-    */
-   vector< vector< vector< ossim_uint32> > > theSubframeTransparencyMaskTable;
-
-   /** Holds table of "replace / update" records if present. */
-   ossimRefPtr<ossimRpfReplaceUpdateTable> theReplaceUpdateTable;
-
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimRpfFrameEntry.h b/ossim/include/ossim/support_data/ossimRpfFrameEntry.h
deleted file mode 100644
index 8672667..0000000
--- a/ossim/include/ossim/support_data/ossimRpfFrameEntry.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfFrameEntry.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRpfFrameEntry_HEADER
-#define ossimRpfFrameEntry_HEADER
-
-#include <iosfwd>
-#include <ossim/base/ossimFilename.h>
-
-class OSSIM_DLL ossimRpfFrameEntry
-{
-public:
-   friend std::ostream& operator<<(std::ostream& out,
-                                   const ossimRpfFrameEntry& data);
-   ossimRpfFrameEntry(const ossimFilename& rootDirectory=ossimFilename(""),
-                      const ossimFilename& pathToFrameFileFromRoot=ossimFilename(""));
-
-   /** @brief copy constructor */
-   ossimRpfFrameEntry(const ossimRpfFrameEntry& obj);
-
-   /** @brief operator= */
-   const ossimRpfFrameEntry& operator=(const ossimRpfFrameEntry& rhs);
-   
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;  
-
-   bool exists() const;
-   
-   void setEntry(const ossimFilename& rootDirectory,
-                 const ossimFilename& pathToFrameFileFromRoot);
-   
-   const ossimFilename& getFullPath() const;
-   const ossimString&   getRootDirectory() const;
-   const ossimString    getPathToFrameFileFromRoot() const;
-   
-private:
-   bool          m_exists;
-   ossimFilename m_rootDirectory;
-   ossimFilename m_pathToFrameFileFromRoot;
-   ossimFilename m_fullValidPath;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimRpfHeader.h b/ossim/include/ossim/support_data/ossimRpfHeader.h
deleted file mode 100644
index 3304111..0000000
--- a/ossim/include/ossim/support_data/ossimRpfHeader.h
+++ /dev/null
@@ -1,182 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfHeader.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRpfHeader_HEADER
-#define ossimRpfHeader_HEADER 1
-
-#include <iosfwd>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/support_data/ossimRpfConstants.h>
-
-class ossimRpfLocationSection;
-class ossimRpfCoverageSection;
-class ossimRpfBoundaryRectTable;
-class ossimRpfBoundaryRectSectionSubheader;
-class ossimRpfFrameFileIndexSectionSubheader;
-class ossimRpfFrameFileIndexSubsection;
-class ossimRpfColorTableIndexSectionSubheader;
-class ossimRpfImageDescriptionSubheader;
-class ossimRpfMaskSubsection;
-class ossimRpfAttributeSectionSubheader;
-class ossimRpfImageDisplayParameterSubheader;
-class ossimRpfCompressionSection;
-class ossimRpfCompressionSectionSubheader;
-class ossimRpfColorGrayscaleSubheader;
-
-class ossimRpfHeader : public ossimNitfRegisteredTag
-{
-public:
-
-   /** default constructor */
-   ossimRpfHeader();
-
-   /** copy constructor */
-   ossimRpfHeader(const ossimRpfHeader& obj);
-
-   /** assignment operator */
-   const ossimRpfHeader& operator=(const ossimRpfHeader& rhs);
-
-   virtual ~ossimRpfHeader();
-
-   /**
-    * @brief Parse method.
-    *
-    * @param in Stream to parse.
-    */
-   virtual void parseStream(std::istream& in);
-
-   /**
-    * @brief Write method.
-    *
-    * @param out Stream to write to.
-    */
-   virtual void writeStream(std::ostream& out);
-   
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-
-   virtual ossimByteOrder getByteOrder()const;
-   
-   const ossimRpfLocationSection* getLocationSection() const;
-
-   ossimRpfLocationSection* getLocationSection();
-
-   bool hasComponent(ossimRpfComponentId componentId)const;
-   ossimString getSecurityClassification()const;
-   
-   /*!
-    * This will return a new coverage section.  It will return NULL if
-    * one does not exist.
-    */
-   ossimRpfCoverageSection*
-      getNewCoverageSection(const ossimFilename& file)const;
-   ossimRpfCoverageSection*
-      getNewCoverageSection(std::istream& in)const;
-
-   ossimRpfColorGrayscaleSubheader*
-      getNewColorGrayscaleSubheader(std::istream& in)const;
-   ossimRpfCompressionSection*
-      getNewCompressionSection(std::istream& in)const;
-   ossimRpfCompressionSectionSubheader*
-      getNewCompressionSectionSubheader(std::istream& in)const;
-   ossimRpfImageDisplayParameterSubheader*
-      getNewImageDisplayParameterSubheader(std::istream& in)const;
-   ossimRpfAttributeSectionSubheader*
-      getNewAttributeSectionSubheader(std::istream& in)const;
-   ossimRpfImageDescriptionSubheader*
-      getNewImageDescriptionSubheader(std::istream& in)const;
-   ossimRpfMaskSubsection*
-      getNewMaskSubsection(std::istream& in)const;
-   ossimRpfBoundaryRectSectionSubheader*
-      getNewBoundaryRectSectSubheader(std::istream& in)const;
-   ossimRpfBoundaryRectTable*
-      getNewBoundaryRectTable(std::istream& in)const;
-   ossimRpfFrameFileIndexSectionSubheader*
-      getNewFrameFileIndexSectionSubheader(std::istream& in)const;
-   ossimRpfFrameFileIndexSubsection*
-      getNewFileIndexSubsection(std::istream& in)const;
-   ossimRpfColorTableIndexSectionSubheader*
-      getNewColorTableIndexSectionSubheader(std::istream& in)const;
-
-   ossimRpfCompressionSection*
-      getNewCompressionSection(const ossimFilename& file)const;
-   ossimRpfBoundaryRectSectionSubheader*
-      getNewBoundaryRectSectSubheader(const ossimFilename& file)const;
-   ossimRpfBoundaryRectTable*
-      getNewBoundaryRectTable(const ossimFilename& file)const;
-   ossimRpfFrameFileIndexSectionSubheader*
-      getNewFrameFileIndexSectionSubheader(const ossimFilename& file)const;
-   ossimRpfFrameFileIndexSubsection*
-      getNewFileIndexSubsection(const ossimFilename& file)const;
-   ossimRpfColorTableIndexSectionSubheader*
-      getNewColorTableIndexSectionSubheader(const ossimFilename& file)const;
-
-   ossimString getDate()const;
-
-   /** @brief returns the byte position of the location section. */
-   ossim_uint32 getLocationSectionLocation() const;
-   
-   void setFilename(const ossimString& file);
-   void setNewRepUpIndicator(const ossimString& s);
-   void setGovSpecNumber(const ossimString& s);
-   void setGovSpecDate(const ossimString& s);
-   void setSecurityClassification(const ossimString& s);
-   void setCountryCode(const ossimString& s);
-   void setSecurityReleaseMarking(const ossimString& s);
-   void setLocationSectionPos(std::streamoff off);
-
-   /*!
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
-
-private:
-
-   /** 0x00 = big, 0xff = little */
-   ossim_uint8  m_littleBigEndianIndicator; // 1 byte bool
-   ossim_uint16 m_headerSectionLength;      // 2 bytes uint
-   char         m_fileName[13];             // 12 byte ascii
-   ossim_uint8  m_newRepUpIndicator;        // 1 byte unsigned int
-   char         m_govSpecNumber[16];        // 15 byte ascii
-   char         m_govSpecDate[9];           // 8 byte ascii
-   /**
-    * 1 byte field that can have the values
-    *
-    * U   Unclassified
-    * R   Restricted
-    * C   Confidential
-    * S   Secret
-    * T   Top Secret
-    */ 
-   char         m_securityClassification[2]; // 1 byte ascii
-   char         m_countryCode[3];            // 2 byte ascii
-   char         m_securityReleaseMarking[3]; // 2 byte ascii
-   ossim_uint32 m_locSectionLoc;             // 4 byte unsigned int
-   
-   ossimRpfLocationSection* m_locationSection;
-};
-
-#endif
- 
-
diff --git a/ossim/include/ossim/support_data/ossimRpfImageDescriptionSubheader.h b/ossim/include/ossim/support_data/ossimRpfImageDescriptionSubheader.h
deleted file mode 100644
index 12a928b..0000000
--- a/ossim/include/ossim/support_data/ossimRpfImageDescriptionSubheader.h
+++ /dev/null
@@ -1,128 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfImageDescriptionSubheader.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRpfImageDescriptionSubheader_HEADER
-#define ossimRpfImageDescriptionSubheader_HEADER
-
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimRpfConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfImageDescriptionSubheader
-{
-public:
-   friend std::ostream& operator <<(
-      std::ostream& out, const ossimRpfImageDescriptionSubheader& data);
-
-   ossimRpfImageDescriptionSubheader();
-   ~ossimRpfImageDescriptionSubheader(){}
-
-   ossimErrorCode parseStream(std::istream& in, ossimByteOrder byteOrder);
-   
-   ossim_uint32 getStartOffset()const{return theStartOffset;}
-   ossim_uint32 getEndOffset()const{return theEndOffset;}
-
-   bool isSubframeMaskTableOffsetNull()const
-   {
-      return (theSubframeMaskTableOffset == OSSIM_RPF_ULONG_NULL);
-   }
-   bool isTransparencyMaskTableOffsetNull()const
-   {
-      return (theTransparencyMaskTableOffset == OSSIM_RPF_ULONG_NULL);
-   }
-   ossim_uint16 getNumberOfSpectralGroups()const
-   {
-      return theNumberOfSpectralGroups;
-   }
-   ossim_uint16 getNumberOfSubframeTables()const
-   {
-      return theNumberOfSubframeTables;
-   }
-   ossim_uint16 getNumberOfSpectralBandTables()const
-   {
-      return theNumberOfSpectralBandTables;
-   }
-   ossim_uint16 getNumberOfSpectralBandLinesPerImageRow()const
-   {
-      return theNumberOfSpectralBandLinesPerImageRow;
-   }
-   ossim_uint16 getNumberOfSubframesHorizontal()const
-   {
-      return theNumberOfSubframesHorizontal;
-   }
-   ossim_uint16 getNumberOfSubframesVertical()const
-   {
-      return theNumberOfSubframesVertical;
-   }
-   ossim_uint32  getNumberOfOutputColumnsPerSubframe()const
-   {
-      return theNumberOfOutputColumnsPerSubframe;
-   }
-   ossim_uint32  getNumberOfOutputRowsPerSubframe()const
-   {
-      return theNumberOfOutputRowsPerSubframe;
-   }
-   ossim_uint32  getSubframeMaskTableOffset()const
-   {
-      return theSubframeMaskTableOffset;
-   }
-   ossim_uint32  getTransparencyMaskTableOffset()const
-   {
-      return theTransparencyMaskTableOffset;
-   }
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-   
-private:
-   void clearFields();
-   // work variables to store useful information.
-   ossim_uint32 theStartOffset;
-   ossim_uint32 theEndOffset;
-
-   ossim_uint16 theNumberOfSpectralGroups;
-   ossim_uint16 theNumberOfSubframeTables;
-   ossim_uint16 theNumberOfSpectralBandTables;
-   ossim_uint16 theNumberOfSpectralBandLinesPerImageRow;
-
-   /*!
-    * Each frame file could be divided into sub frames.
-    * This identifies the number of subframes in the
-    * horizontal direction.
-    */
-   ossim_uint16 theNumberOfSubframesHorizontal;
-
-   /*!
-    * Each frame file could be divided into sub frames.
-    * This identifies the number of subframes in the
-    * vertical direction.
-    */
-   ossim_uint16 theNumberOfSubframesVertical;
-   ossim_uint32 theNumberOfOutputColumnsPerSubframe;
-   ossim_uint32 theNumberOfOutputRowsPerSubframe;
-   ossim_uint32 theSubframeMaskTableOffset;
-   ossim_uint32 theTransparencyMaskTableOffset;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimRpfImageDisplayParameterSubheader.h b/ossim/include/ossim/support_data/ossimRpfImageDisplayParameterSubheader.h
deleted file mode 100644
index a06c623..0000000
--- a/ossim/include/ossim/support_data/ossimRpfImageDisplayParameterSubheader.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfImageDisplayParameterSubheader.h 9967 2006-11-29 02:01:23Z gpotts $
-#ifndef ossimRpfImageDisplayParameterSubheader_HEADER
-#define ossimRpfImageDisplayParameterSubheader_HEADER
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-
-class ossimRpfImageDisplayParameterSubheader
-{
-public:
-   friend ostream& operator<<(ostream& out,
-                              const ossimRpfImageDisplayParameterSubheader& data);
-   ossimRpfImageDisplayParameterSubheader();
-   ossimErrorCode parseStream(istream& in, ossimByteOrder byteOrder);
-   
-   void print(ostream& out)const;
-
-   ossim_uint32 getStartOffset()const
-      {
-         return theStartOffset;
-      }
-   ossim_uint32 getEndOffset()const
-      {
-         return theEndOffset;
-      }
-   ossim_uint32 getNumberOfImageRows()const
-      {
-         return theNumberOfImageRows;
-      }
-   ossim_uint32 getNumberOfImageCodesPerRow()const
-      {
-         return theNumberOfImageCodesPerRow;
-      }
-   ossim_uint32 getImageCodeLength()const
-      {
-         return theImageCodeBitLength;
-      }
-   
-private:
-   void clearFields();
-
-   ossim_uint32 theStartOffset;
-   ossim_uint32 theEndOffset;
-   
-   ossim_uint32 theNumberOfImageRows;
-   ossim_uint32 theNumberOfImageCodesPerRow;
-   ossim_uint8  theImageCodeBitLength;
-};
-
-#endif
diff --git a/ossim/include/ossim/support_data/ossimRpfInfo.h b/ossim/include/ossim/support_data/ossimRpfInfo.h
deleted file mode 100644
index 4ec04bf..0000000
--- a/ossim/include/ossim/support_data/ossimRpfInfo.h
+++ /dev/null
@@ -1,63 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description: Rpf Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimRpfInfo.h 1236 2010-08-05 19:45:44Z ming.su $
-#ifndef ossimRpfInfo_HEADER
-#define ossimRpfInfo_HEADER
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimFilename.h>
-
-class ossimKeywordlist;
-/**
- * @brief HDF info class.
- *
- * Encapsulates the HDF functionality.
- */
-class ossimRpfInfo : public ossimInfoBase
-{
-public:
-
-   /** default constructor */
-   ossimRpfInfo();
-
-   /** virtual destructor */
-   virtual ~ossimRpfInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   bool isOpen();
-
-   private: 
-   
-     ossimFilename                       theFile;
-     ossimFilename                       m_infoFile;
-};
-
-#endif /* End of "#ifndef ossimRpfInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimRpfLocationSection.h b/ossim/include/ossim/support_data/ossimRpfLocationSection.h
deleted file mode 100644
index 2ddeb10..0000000
--- a/ossim/include/ossim/support_data/ossimRpfLocationSection.h
+++ /dev/null
@@ -1,168 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfLocationSection.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRpfLocationSection_HEADER
-#define ossimRpfLocationSection_HEADER
-
-#include <iosfwd>
-#include <vector>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimRpfConstants.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-//  10 byte record
-class ossimRpfComponentLocationRecord
-{
-public:
-   friend std::ostream& operator<<(
-      std::ostream& out, const ossimRpfComponentLocationRecord& data);
-
-   /** default constructor */
-   ossimRpfComponentLocationRecord();
-
-   /** copy constructor */
-   ossimRpfComponentLocationRecord(const ossimRpfComponentLocationRecord& record);
-
-   /** assignment operator */
-   const ossimRpfComponentLocationRecord& operator=(const ossimRpfComponentLocationRecord& rhs);
-   
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-
-   ossimErrorCode parseStream(std::istream& in, ossimByteOrder endianOrder);
-
-   /**
-    * @brief Write method.
-    *
-    * @param out Stream to write to.
-    */
-   void writeStream(std::ostream& out);
-
-   /*!
-    * The component is a 2-Byte unsigned value which
-    * identitfies a level-2 component.  The table can be
-    * found in MIL-STD-2411-1 in section 5.1.1 and in ossimRpfConstants.h.
-    */
-   ossim_uint16 m_componentId;
-
-   /*!
-    * Is a 4 byte unsigned integer indicating the length in
-    * bytes of the component.
-    */
-   ossim_uint32  m_componentLength;
-
-   /*!
-    * Is a 4 byte value defining the absolute address (byte number)
-    * of the first byte of the component measured
-    * from the beginning of the RPF Frame file.
-    */ 
-   ossim_uint32  m_componentLocation;
-};
-
-class ossimRpfLocationSection
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimRpfLocationSection &data);
-   ossimRpfLocationSection();
-   virtual ~ossimRpfLocationSection(){}
-
-   virtual ossimErrorCode parseStream(std::istream& in,
-                                      ossimByteOrder endianOrder);
-
-   /**
-    * @brief Write method.
-    *
-    * @param out Stream to write to.
-    */
-   void writeStream(std::ostream& out);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-
-   /*!
-    * Will let you know if a component exists within the location section.
-    * these component Ids' are defined in the MIL-STD-2411-1 standards doc.
-    * the ossimRpfComponentId is in ossimRpfConstants.h
-    */
-   bool hasComponent(ossimRpfComponentId componentId)const;
-
-   bool getComponent(ossimRpfComponentId componentId,
-                     ossimRpfComponentLocationRecord& result)const;
-
-   /**
-    * @brief Method to add a component location record.
-    *
-    * This will push the record onto the back of theComponentLocationList array.
-    *
-    * @param record Record to add to array.
-    */
-   void addComponentRecord(const ossimRpfComponentLocationRecord& record);
-
-   void setLocationSectionLength(ossim_uint16 length);
-   void setLocationTableOffset(ossim_uint32 offset);
-   void setNumberOfComponentLocationRecords(ossim_uint16 count);
-   void setLocationRecordLength(ossim_uint16 length);
-   void setComponentAggregateLength(ossim_uint32 length);
-
-   /** @brief Clears records and fields. Public interface to clearFields. */
-   void clearFields();
-
-   /** Brief Direct access to the list of records. */
-   std::vector<ossimRpfComponentLocationRecord>& getLocationRecordList();
-   
-private:
-
-   /*!
-    * This is a 2 byte unsigned short >= 34 indicatin
-    * the length in bytes of the entire location section
-    */
-   ossim_uint16 m_locationSectionLength;
-
-   ossim_uint32 m_locationTableOffset;
-
-   ossim_uint16 m_numberOfComponentLocationRecords;
-
-   ossim_uint16 m_locationRecordLength;
-
-   ossim_uint32 m_componentAggregateLength;
-
-   /*!
-    * Since there are not very many components within an Rpf file
-    * it would be overkill to sort these components into an stl
-    * map.  We will just use an array (stl vector) and do linear searches
-    * for components when we need to.
-    */
-   std::vector<ossimRpfComponentLocationRecord> m_componentLocationList;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimRpfToc.h b/ossim/include/ossim/support_data/ossimRpfToc.h
deleted file mode 100644
index 9d87980..0000000
--- a/ossim/include/ossim/support_data/ossimRpfToc.h
+++ /dev/null
@@ -1,230 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRpfToc.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef osimRpfToc_HEADER
-#define osimRpfToc_HEADER
-
-#include <vector>
-#include <iosfwd>
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimRpfHeader.h>
-
-class ossimRpfFrameFileIndexSubsection;
-class ossimRpfTocEntry;
-class ossimRpfFrameEntry;
-
-class OSSIM_DLL ossimRpfToc : public ossimReferenced
-{
-public:
-   friend OSSIM_DLL std::ostream& operator <<(std::ostream& out,
-                                              const ossimRpfToc& data);
-   ossimRpfToc();
-
-   virtual ~ossimRpfToc();
-
-   /**
-    * @brief Parses a.toc file.
-    * @param fileName File to parse.
-    * @param keepFileHeader If true the ossimNitfFileHeader will be kept.
-    * @return ossimErrorCodes::OSSIM_OK on success, ossimErrorCodes::OSSIM_ERROR on error.
-    */
-   ossimErrorCode parseFile(const ossimFilename &fileName,
-                            bool keepFileHeader = false);
-
-   /**
-    * @brief Creates a new a.toc file from list of rpf frames in output directory.
-    *
-    * @param dotRpfFile File containing list of rpf frames wanted.
-    *
-    * @param outputDir Directory to write a.toc file and rpf frames to.
-    *
-    * @see ossim-rpf application usage for dotRpfFile format.
-    *
-    * @note Throws ossimException on error.
-    */
-   void createTocAndCopyFrames( const ossimFilename& dotRpfFile,
-                                const ossimFilename& outputDir);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string(),
-                       bool printOverviews=false) const;
-   
-   ossim_uint32 getNumberOfEntries()const;
-   
-   const ossimRpfTocEntry* getTocEntry(ossim_uint32 index)const;
-
-   /**
-    * Returns -1 if not found.
-    */
-   ossim_int32 getTocEntryIndex(const ossimRpfTocEntry* entry);
-
-   /**
-    * @brief Get the nitf file header.
-    *
-    * @return The nitf file header or 0 if not set.
-    */
-   const ossimNitfFileHeader* getNitfFileHeader()const;
-   
-   const ossimRpfHeader* getRpfHeader() const;
-
-   /**
-    * For the given entry index, this routine returns the number of 
-    * frames that exist in the horizontal direction. If the entry index
-    * is invalid, 0 frames are returned.
-    *
-    * @param idx the entry index.
-    * @return number of frames in the horizontal direction
-    */
-   ossim_uint32 getNumberOfFramesHorizontal(ossim_uint32 idx)const;
-
-   /**
-    * For the given entry index, this routine returns the number of 
-    * frames that exist in the vertical direction. If the entry index
-    * is invalid, 0 frames are returned.
-    *
-    * @param idx the entry index.
-    * @return number of frames in the vertical direction
-    */
-   ossim_uint32 getNumberOfFramesVertical(ossim_uint32 idx)const;
-
-   /**
-    * For the given entry index, frame row, and frame column, this 
-    * routine returns the corresponding ossimRpfFrameEntry instance. 
-    *
-    * @param entryIdx the entry index.
-    * @param row the frame row.
-    * @param col the frame col.
-    * @return true if successful
-    */
-   bool getRpfFrameEntry(ossim_uint32 entryIdx, 
-                         ossim_uint32 row,
-                         ossim_uint32 col,
-                         ossimRpfFrameEntry& result)const;
-
-   /**
-    * For the given entry index, frame row, and frame column, this 
-    * routine returns the corresponding name of the frame image
-    * with respect to the location of the toc file. 
-    *
-    * @param entryIdx the entry index.
-    * @param row the frame row.
-    * @param col the frame col.
-    * @return the name of the frame image
-    */
-   const ossimString getRelativeFramePath( ossim_uint32 entryIdx,
-                                           ossim_uint32 row,
-                                           ossim_uint32 col)const;
-
-   /**
-    * @brief Method to get the root directory from the a.toc file name.
-    * @param dir This initializes dir.
-    */
-   void getRootDirectory(ossimFilename& dir) const;
-
-private:
-   void deleteAll();
-   void clearAll();
-   void deleteTocEntryList();
-   void buildTocEntryList(ossimRpfHeader* rpfHeader);
-   void allocateTocEntryList(ossim_uint32 numberOfEntries);
-
-   /** @brief Walks through frames to find the first entry that exists... */
-   void getFirstEntry(const ossimRpfTocEntry* rpfTocEntry,
-                      ossimRpfFrameEntry& frameEntry) const;
-
-   /**
-    * @brief Writes the frame file sub section of an a.toc.
-    * 
-    * This is a utility method for createTocAndCopyFrames method. 
-    */
-   void writeFrameFileIndexSection(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
-                                   std::ifstream& dotRpfStr,
-                                   std::ofstream& dotTocStr);
-
-   /**
-    * @brief Copies frame to output directory.
-    * 
-    * This is a utility method for createTocAndCopyFrames method. 
-    */
-   void copyFrames(std::ifstream& dotRpfStr, const ossimFilename& outputDir);
-
-   
-
-   /**
-    * @brief Get the number of frames from the dot rpf file.
-    * This is a utility method for createTocAndCopyFrames method.
-    */
-   ossim_uint32 getNumberOfFrames(std::ifstream& dotRpfStr) const;
-
-   /**
-    * @brief Get a.toc file from the dot rpf file.
-    * This is a utility method for createTocAndCopyFrames method.
-    */
-   ossimFilename getSourceTocFile(std::ifstream& dotRpfStr) const;
-
-   /**
-    * @brief Gets the zero based entry number for the first file in the dot rpf file.
-    * This is a utility method for createTocAndCopyFrames method.
-    */
-   bool getCorespondingEntry(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
-                             std::ifstream& dotRpfStr,
-                             ossim_uint32& entry) const;
-   
-   /**
-    * @brief Gets the filename from line in.
-    *
-    * Line format:
-    *
-    * /data/spadac/rpf-frame-test/t1/N03E030/005FNU1B.I21|30.9141787715578,3.03831480449669|30.9889225265623,3.10741371349693
-    *
-    * @param line Line to extract filename from.
-    *
-    * @param out Filename to initialize.
-    *
-    * This is a utility method for createTocAndCopyFrames method.
-    */
-   bool getFile(const std::string& line, ossimFilename& file) const;
-
-   /*!
-    * This will hold a list of table of content entries.  There is one entry
-    * per directory.  Each entry will have its geographic coverage.
-    * Each directory is then divided into frames.  There could be 30 or
-    * more frame images that make up an entire image.
-    */
-   std::vector<ossimRpfTocEntry*> m_tocEntryList;
-   
-   /*!
-    * We will remember the file that we opened
-    */
-   ossimFilename m_filename;
-
-   ossimRefPtr<const ossimNitfFileHeader> m_nitfFileHeader;
-   
-   ossimRefPtr<ossimRpfHeader> m_rpfHeader;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimRpfTocEntry.h b/ossim/include/ossim/support_data/ossimRpfTocEntry.h
deleted file mode 100644
index 2899dc0..0000000
--- a/ossim/include/ossim/support_data/ossimRpfTocEntry.h
+++ /dev/null
@@ -1,114 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfTocEntry.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimRpfTocEntry_HEADER
-#define ossimRpfTocEntry_HEADER
-
-#include <vector>
-#include <iosfwd>
-
-#include <ossim/support_data/ossimRpfBoundaryRectRecord.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/support_data/ossimRpfFrameEntry.h>
-
-class ossimIrect;
-
-class OSSIMDLLEXPORT ossimRpfTocEntry
-{
-public:
-   friend std::ostream& operator <<(std::ostream& out,
-                                    const ossimRpfTocEntry& data);
-   ossimRpfTocEntry();
-   ossimErrorCode parseStream(std::istream &in, ossimByteOrder byteOrder);
-
-   /**
-    * @brief print method that outputs a key/value type format adding prefix
-    * to keys.
-    * @param out String to output to.
-    * @param prefix This will be prepended to key.
-    * e.g. Where prefix = "nitf." and key is "file_name" key becomes:
-    * "nitf.file_name:"
-    * @return output stream.
-    */
-   std::ostream& print(std::ostream& out,
-                       const std::string& prefix=std::string()) const;
-   
-   void setEntry(const ossimRpfFrameEntry& entry,
-                 long row,
-                 long col);
-
-   bool getEntry(long row,
-                 long col,
-                 ossimRpfFrameEntry& result)const;
-
-   ossimString getProductType() const;
-   
-   /*!
-    * returns how many subimges or frames exist in the horizontal
-    * direction.
-    */
-   ossim_uint32 getNumberOfFramesHorizontal()const;
-
-   /*!
-    * returns how many subimges or frames exist in the vertical
-    * direction.
-    */
-   ossim_uint32 getNumberOfFramesVertical()const;
-
-   /** @return The number of lines (frames vertical * 1536). */
-   ossim_uint32 getNumberOfLines() const;
-
-   /** @return The number of samples (frames horizontal * 1536). */
-   ossim_uint32 getNumberOfSamples() const;
-
-   /** @return Number of bands. */
-   ossim_uint32 getNumberOfBands() const;
-   
-   /**
-    * @brief Get the bounding rect of entry.
-    * @param rect Gets initialized with rect.
-    */
-   void getBoundingRect(ossimIrect& rect) const;
-   
-   const ossimRpfBoundaryRectRecord& getBoundaryInformation()const;
-
-   /*!
-    * If there is an entry and all the files don't exist we will return
-    * true.
-    */
-   bool isEmpty()const;
-
-   /**
-    * Returns the image geometry object associated with this tile source or
-    * NULL if non defined.  The geometry contains full-to-local image
-    * transform as well as projection (image-to-world).
-    */
-   ossimRefPtr<ossimImageGeometry> getImageGeometry() const;
-
-   /** @brief Get the scale in decimal degrees per pixel. */
-   void getDecimalDegreesPerPixel(ossimDpt& scale) const;
-
-   /** @brief Get the scale in meters per pixel. */
-   void getMetersPerPixel(ossimDpt& scale) const;
-   
-private:
-   void allocateFrameEntryArray();
-   
-   ossimRpfBoundaryRectRecord theBoundaryInformation;
-   ossim_uint32  theNumSamples; //!> May be less than actual image width in case of > 360 deg wrap condition. (OLK 10/10)
-   std::vector< std::vector<ossimRpfFrameEntry> > theFrameEntryArray;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimSrtmSupportData.h b/ossim/include/ossim/support_data/ossimSrtmSupportData.h
deleted file mode 100644
index 15f7be4..0000000
--- a/ossim/include/ossim/support_data/ossimSrtmSupportData.h
+++ /dev/null
@@ -1,204 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Support data class for a Shuttle Radar Topography Mission (SRTM) file.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimSrtmSupportData.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimSrtmSupportData_HEADER
-#define ossimSrtmSupportData_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/projection/ossimProjection.h>
-
-/**
- * @class ossimStrmSupportData
- * Support data class for a Shuttle Radar Topography Mission (SRTM) file.
- * Provides lines, samples, post spacing and geometry info given a valid
- * srtm file.  This class will set an error if the file is not deemed to
- * be valid.
- */
-class OSSIMDLLEXPORT ossimSrtmSupportData : public ossimObject
-{
-public:
-   /** default constructor */
-   ossimSrtmSupportData();
-
-   /** destructor */
-   virtual ~ossimSrtmSupportData();
-
-   /**
-    * Initializes object from file.  File is expected to be in a format like
-    * N27W081.hgt or n27w081.hgt where "N27" is the South West latitude of
-    * the cell and "W081" is the South West longitude of the cell.
-    *
-    * @param srtmFile File to set.
-    *
-    * @param scanForMinMax If true and there is no ossim meta data file with
-    * the min and max keywords in it, this will call computeMinMax which will
-    * scan the file for min and max.
-    *
-    * @return Returns true if file is deemed to be an srtm, false if not.
-    *
-    * @note This will write an ossim meta data (.omd) if one does not exists.
-    */
-   bool setFilename(const ossimFilename& srtmFile,
-                    bool scanForMinMax = false);
-
-   /** @return Returns the srtm file name. */
-   ossimFilename getFilename() const;
-
-   /**
-    * @return Returns the number of lines or rows.  Returns  OSSIM_UINT_NAN
-    * if not initialized or file was invalid.
-    */
-   ossim_uint32 getNumberOfLines() const;
-   
-   /**
-    * @return Returns the number of samples or columns. Returns
-    * OSSIM_UINT_NAN if not initialized or file was invalid.
-    */
-   ossim_uint32 getNumberOfSamples() const;
-
-   /**
-    *  Populates the keyword list with image geometry information.  This
-    *  method is used to relay projection information to users.
-    *
-    *  @param kwl Keyword list that will be initialized with geometry info.
-    *  Returns true if geometry info is present, false if not.
-    *
-    *  @param prefix The prefix is added to the resulting keyword list
-    *  keywords.  So is you if you pass in a prefix of "image01.", the
-    *  keyword ul_lat will be like:  "image01.ul_lat:  -40.00000"
-    */
-   virtual bool getImageGeometry(ossimKeywordlist& kwl, const char* prefix=0);
-
-   /**
-    * @brief Gets the projection for srtm cell.
-    * @return  The projection for srtm cell.
-    */
-   ossimRefPtr<ossimProjection> getProjection() const;
-
-   /**
-    * Method to save the state of the object to a keyword list.
-    * Return true if ok or false on error.
-    */
-   virtual bool saveState(ossimKeywordlist& kwl,
-                          const char* prefix=0) const;
-   
-   /**
-    * Method to the load (recreate) the state of the object from a keyword
-    * list.  Return true if ok or false on error.
-    */
-   virtual bool loadState(const ossimKeywordlist& kwl,
-                          const char* prefix=0);
-   
-   /**
-    * @return Returns the Southwest latitude in decimal degrees. Returns
-    * OSSIM_DBL_NAN if not initialized or file was invalid.
-    */
-   ossim_float64 getSouthwestLatitude() const;
-
-   /**
-    * @return Returns the Southwest longitude in decimal degrees.  Returns
-    * OSSIM_DBL_NAN if not initialized or file was invalid.
-    */
-   ossim_float64 getSouthwestLongitude() const;
-   
-   /**
-    * @return Returns the latitude spacing in decimal degrees. Returns
-    * OSSIM_DBL_NAN if not initialized or file was invalid.
-    */
-   ossim_float64 getLatitudeSpacing() const;
-
-   /**
-    * @return Returns the longitude spacing in decimal degrees.  Returns
-    * OSSIM_DBL_NAN if not initialized or file was invalid.
-    */
-   ossim_float64 getLongitudeSpacing() const;
-
-   /**
-    * @return Returns the minimum pixel value.  This is also
-    * the minimum height above sea level.  Returns
-    * OSSIM_SSHORT_NAN if not initialized or file was invalid.
-    */
-   ossim_float64 getMinPixelValue() const;
-
-   /**
-    * @return Returns the maximum pixel value.  This is also
-    * the minimum height above sea level.  Returns
-    * OSSIM_SSHORT_NAN if not initialized or file was invalid.
-    */
-   ossim_float64 getMaxPixelValue() const;
-
-   ossimScalarType getScalarType()const;
-   /**
-    * Prints data members for debug.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-private:
-
-   /**
-    * This is a loadState called by setFilename that does not reset "theFile".
-    */
-   bool loadOmd(const ossimKeywordlist& kwl, const char* prefix=0);
-
-   /** Sets all data members to an unitialized state. */
-   void clear();
-
-   /**
-    * Sets corner points from "theFile".
-    *
-    * @return true on success, false on error.
-    */
-   bool setCornerPoints();
-   
-   /**
-    * Sets lines and samples from "theFile" size.
-    *
-    * @return true on success, false on error.
-    */
-   bool setSize();
-
-   /**
-    * Scans file for min and max pixels.
-    *
-    * @retun true on success, false on error.
-    */
-   bool computeMinMax();
-  
-   ossimFilename theFile;
-   ossim_uint32  theNumberOfLines;
-   ossim_uint32  theNumberOfSamples;
-   ossim_float64 theSouthwestLatitude;  //< decimal degrees
-   ossim_float64 theSouthwestLongitude; //< decimal degrees
-   ossim_float64 theLatSpacing;         //< decimal degrees
-   ossim_float64 theLonSpacing;         //< decimal degrees
-   ossim_float64 theMinPixelValue;      //< meters
-   ossim_float64 theMaxPixelValue;      //< meters
-
-   ossimScalarType theScalarType;
-
-   mutable ossimRefPtr<ossimIFStream> theFileStream;
-   template <class T>
-   bool computeMinMaxTemplate(T dummy,
-                              double defaultNull);
-};
-
-#endif /* #ifndef ossimSrtmSupportData */
-
diff --git a/ossim/include/ossim/support_data/ossimSupportFilesList.h b/ossim/include/ossim/support_data/ossimSupportFilesList.h
deleted file mode 100644
index 658f6d3..0000000
--- a/ossim/include/ossim/support_data/ossimSupportFilesList.h
+++ /dev/null
@@ -1,45 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Oscar Kramer
-// 
-//********************************************************************
-// $Id$
-#ifndef ossimSupportFilesList_HEADER
-#define ossimSupportFilesList_HEADER
-
-#include <vector>
-#include <ossim/base/ossimFilename.h>
-
-class ossimKeywordlist;
-
-//*************************************************************************************************
-//! Singleton class for logging all support data files opened during a session.
-//*************************************************************************************************
-class OSSIMDLLEXPORT ossimSupportFilesList
-{
-public:
-   static ossimSupportFilesList* instance();
-
-   //! Add support data filename to the list:
-   void add(const ossimFilename& f) { m_list.push_back(f); }
-
-   //! Output list to the kwl.
-   void save(ossimKeywordlist& kwl, const char* prefix) const;
-   
-   //! Clears the list to ready for new accumulation:
-   void clear() { m_list.clear(); }
-
-private:
-   ossimSupportFilesList()  { }
-   ~ossimSupportFilesList() { m_instance=0; }
-
-   std::vector<ossimFilename>       m_list;
-   static ossimSupportFilesList*    m_instance;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimTiffInfo.h b/ossim/include/ossim/support_data/ossimTiffInfo.h
deleted file mode 100644
index ba973ea..0000000
--- a/ossim/include/ossim/support_data/ossimTiffInfo.h
+++ /dev/null
@@ -1,772 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: TIFF Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimTiffInfo.h 2673 2011-06-06 14:57:24Z david.burken $
-#ifndef ossimTiffInfo_HEADER
-#define ossimTiffInfo_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimFilename.h>
-
-#include <iosfwd>
-#include <string>
-#include <vector>
-
-class ossimDpt;
-class ossimEndian;
-class ossimKeywordlist;
-class ossimTieGptSet;
-
-/**
- * @brief TIFF info class.
- *
- * Encapsulates the listgeo functionality.
- */
-class OSSIM_DLL ossimTiffInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimTiffInfo();
-
-   /** virtual destructor */
-   virtual ~ossimTiffInfo();
-
-   /**
-    * Anonymous enumerations.  Note prefixed with 'O' to avoid conflict with
-    * libtiff.
-    */
-   enum
-   {
-      UNDEFINED                           = 0,
-      OPIXEL_IS_AREA                      = 1,
-      OPIXEL_IS_POINT                     = 2,
-      OTIFFTAG_SUBFILETYPE                = 254,
-      OTIFFTAG_IMAGEWIDTH                 = 256,
-      OTIFFTAG_IMAGELENGTH                = 257,
-      OTIFFTAG_BITSPERSAMPLE              = 258,
-      OTIFFTAG_COMPRESSION                = 259,
-      OTIFFTAG_PHOTOMETRIC                = 262,
-      OTIFFTAG_FILLORDER                  = 266,
-      OTIFFTAG_IMAGEDESCRIPTION           = 270,
-      OTIFFTAG_MODEL                      = 272,
-      OTIFFTAG_STRIPOFFSETS               = 273,
-      OTIFFTAG_ORIENTATION                = 274,
-      OTIFFTAG_SAMPLESPERPIXEL            = 277,
-      OTIFFTAG_ROWSPERSTRIP               = 278,
-      OTIFFTAG_STRIPBYTECOUNTS            = 279,
-      OTIFFTAG_MINSAMPLEVALUE             = 280,
-      OTIFFTAG_MAXSAMPLEVALUE             = 281,
-      OTIFFTAG_XRESOLUTION                = 282,
-      OTIFFTAG_YRESOLUTION                = 283,
-      OTIFFTAG_PLANARCONFIG               = 284,
-      OTIFFTAG_RESOLUTIONUNIT             = 296,
-      OTIFFTAG_PAGENUMBER                 = 297,
-      OTIFFTAG_SOFTWARE                   = 305,
-      OTIFFTAG_DATETIME                   = 306,  // FORMAT is YYYY:MM:DD HH:MM:SS
-      OTIFFTAG_ARTIST                     = 315,
-      OTIFFTAG_TILEWIDTH                  = 322,
-      OTIFFTAG_TILELENGTH                 = 323,
-      OTIFFTAG_TILEOFFSETS                = 324,
-      OTIFFTAG_TILEBYTECOUNTS             = 325,
-      OTIFFTAG_EXTRASAMPLES               = 338,
-      OTIFFTAG_SAMPLEFORMAT               = 339,
-      OTIFFTAG_SMINSAMPLEVALUE            = 340,
-      OTIFFTAG_SMAXSAMPLEVALUE            = 341,
-      OSAMPLEFORMAT_UINT                  = 1,
-      OSAMPLEFORMAT_INT                   = 2,
-      OSAMPLEFORMAT_IEEEFP                = 3,
-      OSAMPLEFORMAT_VOID                  = 4,
-      OSAMPLEFORMAT_COMPLEXINT            = 5,
-      OSAMPLEFORMAT_COMPLEXIEEEFP         = 6,
-      OTIFFTAG_SUBIFD                     = 330,
-      OGT_MODEL_TYPE_GEO_KEY              = 1024,
-      OGT_RASTER_TYPE_GEO_KEY             = 1025,
-      OGT_CITATION_GEO_KEY                = 1026,
-      OGEOGRAPHIC_TYPE_GEO_KEY            = 2048,
-      OGEOG_CITATION_GEO_KEY              = 2049,
-      OGEOG_GEODETIC_DATUM_GEO_KEY        = 2050,
-      OGEOG_PRIME_MERIDIAN_GEOKEY         = 2051,
-      OGEOG_LINEAR_UNITS_GEO_KEY          = 2052,
-      OGEOG_ANGULAR_UNITS_GEO_KEY         = 2054,
-      OGEOG_ANGULAR_UNIT_SIZE_GEO_KEY     = 2055,
-      OGEOG_ELLIPSOID_GEO_KEY             = 2056,
-      OGEOG_SEMI_MAJOR_AXIS               = 2057,
-      OGEOG_SEMI_MINOR_AXIS               = 2058,
-      OGEOG_INV_FLATTENING_GEO_KEY        = 2059,
-      OGEOG_PRIME_MERIDIAN_LONG_GEO_KEY   = 2061,
-      OPROJECTED_CS_TYPE_GEO_KEY          = 3072,
-      OPCS_CITATION_GEO_KEY               = 3073,
-      OPROJECTION_GEO_KEY                 = 3074,
-      OPROJ_COORD_TRANS_GEO_KEY           = 3075,
-      OPROJ_LINEAR_UNITS_GEO_KEY          = 3076,
-      OPROJ_LINEAR_UNIT_SIZE_GEO_KEY      = 3077,
-      OPROJ_STD_PARALLEL1_GEO_KEY         = 3078,
-      OPROJ_STD_PARALLEL2_GEO_KEY         = 3079,
-      OPROJ_NAT_ORIGIN_LONG_GEO_KEY       = 3080,
-      OPROJ_NAT_ORIGIN_LAT_GEO_KEY        = 3081,
-      OPROJ_FALSE_EASTING_GEO_KEY         = 3082,
-      OPROJ_FALSE_NORTHING_GEO_KEY        = 3083,
-      OPROJ_FALSE_ORIGIN_LONG_GEO_KEY     = 3084,
-      OPROJ_FALSE_ORIGIN_LAT_GEO_KEY      = 3085,
-      OPROJ_FALSE_ORIGIN_EASTING_GEO_KEY  = 3086,
-      OPROJ_FALSE_ORIGIN_NORTHING_GEO_KEY = 3087,
-      OPROJ_CENTER_LONG_GEO_KEY           = 3088,
-      OPROJ_CENTER_LAT_GEO_KEY            = 3089,
-      OPROJ_SCALE_AT_NAT_ORIGIN_GEO_KEY   = 3092,
-      OPROJ_SCALE_AT_CENTER_GEO_KEY       = 3093,
-      OVERTICAL_Cs_TYPE_GEO_KEY           = 4096,
-      OVERTICAL_CITATION_GEO_KEY          = 4097,
-      OVERTICAL_DATUM_GEO_KEY             = 4098,
-      OVERTICAL_UNITS_GEO_KEY             = 4099,
-      OLINEAR_METER                       = 9001,
-      OLINEAR_FOOT                        = 9002,
-      OLINEAR_FOOT_US_SURVEY              = 9003,
-      OANGULAR_DEGREE                     = 9102,
-      OANGULAR_ARC_MINUTE                 = 9103,
-      OANGULAR_ARC_SECOND                 = 9104,
-      OANGULAR_GRAD                       = 9105,
-      OANGULAR_GON                        = 9106,
-      OANGULAR_DMS                        = 9107,
-      OANGULAR_DMS_HEMISPHERE             = 9108,
-      OPCS_BRITISH_NATIONAL_GRID          = 27700,
-      OUSER_DEFINED                       = 32767,
-      OTIFFTAG_COPYRIGHT                  = 33432,
-      OMODEL_PIXEL_SCALE_TAG              = 33550,
-      OMODEL_TIE_POINT_TAG                = 33922,
-      OMODEL_TRANSFORM_TAG                = 34264,
-      OTIFFTAG_PHOTOSHOP                  = 34377,
-      OGEO_KEY_DIRECTORY_TAG              = 34735,
-      OGEO_DOUBLE_PARAMS_TAG              = 34736,
-      OGEO_ASCII_PARAMS_TAG               = 34737,
-      OGDAL_METADATA_TAG                  = 42112,
-      OGDAL_NODATA                        = 42113
-   };
-
-   enum CompressType
-   {
-      NOT_COMPRESSED = 0,
-      COMPRESSED     = 1
-   };
- 
-   enum PhotoInterpretation
-   {
-      OPHOTO_MINISWHITE  = 0,   // min value is white 
-      OPHOTO_MINISBLACK  = 1,   // min value is black 
-      OPHOTO_RGB         = 2,   // RGB color model 
-      OPHOTO_PALETTE     = 3,   // color map indexed 
-      OPHOTO_MASK        = 4,   // $holdout mask 
-      OPHOTO_SEPARATED   = 5,   // !color separations 
-      OPHOTO_YCBCR       = 6,   // !CCIR 601 
-      OPHOTO_CIELAB      = 7    // !1976 CIE L*a*b*
-   };
-
-   enum ModelType
-   {
-      UNKNOWN                = 0,
-      OMODEL_TYPE_PROJECTED  = 1,  // Projection Coordinate System
-      OMODEL_TYPE_GEOGRAPHIC = 2,  // Geographic latitude-longitude System 
-      OMODEL_TYPE_GEOCENTRIC = 3
-   };
-
-   enum WordType
-   {
-      TWO_OR_EIGHT  = 0,
-      FOUR_OR_EIGHT = 1
-   };
-
-   enum
-   {
-      OTIFF_NOTYPE = 0,      /* placeholder */
-      OTIFF_BYTE = 1,        /* 8-bit unsigned integer */
-      OTIFF_ASCII = 2,       /* 8-bit bytes w/ last byte null */
-      OTIFF_SHORT = 3,       /* 16-bit unsigned integer */
-      OTIFF_LONG = 4,        /* 32-bit unsigned integer */
-      OTIFF_RATIONAL = 5,    /* 64-bit unsigned fraction */
-      OTIFF_SBYTE = 6,       /* !8-bit signed integer */
-      OTIFF_UNDEFINED = 7,   /* !8-bit untyped data */
-      OTIFF_SSHORT = 8,      /* !16-bit signed integer */
-      OTIFF_SLONG = 9,       /* !32-bit signed integer */
-      OTIFF_SRATIONAL = 10,  /* !64-bit signed fraction */
-      OTIFF_FLOAT = 11,      /* !32-bit IEEE floating point */
-      OTIFF_DOUBLE = 12,     /* !64-bit IEEE floating point */
-      OTIFF_IFD = 13,        /* %32-bit unsigned integer (offset) */
-      OTIFF_LONG8 = 16,      /* BigTIFF 64-bit unsigned integer */
-      OTIFF_SLONG8 = 17,     /* BigTIFF 64-bit signed integer */
-      OTIFF_IFD8 = 18        /* BigTIFF 64-bit unsigned integer (offset) */
-   };
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /**
-    * @brief Print method.
-    * 
-    * Print method that takes a stream that should be positions at the start
-    * of tiff stream. This was added to see embedded information on embedded
-    * geotiff's in a geojp2 file.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::istream& inStr,
-                               std::ostream& outStr) const;
-
-   /**
-    *  @brief Extracts geometry info to keyword list.  This method assumes
-    *  that open has been called and theFile is set.
-    *  
-    *  Populates the keyword list with image geometry information.  This
-    *  method is used to relay projection/model information to users.
-    *
-    *  @param geomKwl Keyword list that will be initialized with geometry info.
-    *  Returns true if geometry info is present, false if not.
-    *
-    *  @param entryIndex Entry to get geometry from. 
-    */
-   bool getImageGeometry(ossimKeywordlist& geomKwl,
-                         ossim_uint32 entryIndex) const;
-
-   /**
-    *  @brief Extracts geometry info from stream to keyword list.
-    *  
-    *  Populates the keyword list with image geometry information.  This
-    *  method is used to relay projection/model information to users.
-    *
-    *  @note The str should be position at start of tiff portion. This
-    *  was written to allow passing a stream positioned at an embedded tiff
-    *  image in a jp2 file.
-    *
-    *  @param str Stream position at start of tiff image.
-    *
-    *  @param geomKwl Keyword list that will be initialized with geometry info.
-    *  Returns true if geometry info is present, false if not.
-    *
-    *  @param entryIndex Entry to get geometry from. 
-    */
-   bool getImageGeometry(std::istream& str,
-                         ossimKeywordlist& geomKwl,
-                         ossim_uint32 entryIndex) const;
-
-   /**
-    * @brief Extracts geometry info from geotiff keys to keyword list.
-    *
-    * Helper method used to extract keywords from geotiff keys embedded in
-    * files, e.g. LAS data.  Because this is just the geotiff keys, the output
-    * will be missing the image part, i.e. line, samples, radiometry...
-    *
-    * This output is intended to be usable to get a projection from a call to
-    * ossimProjectionFactoryRegistry::createProjection(kwl).
-    *
-    * Internally calls printGeoKeys and then the private getImageGeometry.
-    *
-    * @param geoKeyLength Length of geoKeyBlock.
-    * @param geoKeyBlock Pointer to array of keys.
-    * @param geoDoubleLength Length of geoDoubleBlock.
-    * @param geoDoubleBlock Pointer to array of double values.
-    * @param geoAsciiLength Length of geoAsciiBlock.
-    * @param geoAsciiBlock Pointer to array of ascii values.
-    * @param projKwl The keyword list to initialize.
-    *
-    * @return Because the resulting keyword list (geomKwl) is not complete
-    * there will be no return.
-    */
-   void getImageGeometry(ossim_uint64   geoKeyLength,
-                         ossim_uint16*  geoKeyBlock,
-                         ossim_uint64   geoDoubleLength,
-                         ossim_float64* geoDoubleBlock,
-                         ossim_uint64   geoAsciiLength,
-                         ossim_int8*    geoAsciiBlock,
-                         ossimKeywordlist& geomKwl) const;
-
-   /**
-    * @brief Prints geo keys to stream.
-    *
-    * Helper method used to extract keywords from geotiff keys embedded in
-    * files, e.g. LAS data.  Because this is just the geotiff keys, the output
-    * will be missing the image part, i.e. line, samples, radiometry...
-    *
-    * This output is the raw tiff tags/geotiff keys not necessarily useable to construct
-    * a projection from.
-    *
-    * @param out Stream to dump to.
-    * @param prefix if any.  This will be added to the keys, e.g.
-    * tiff0.coord_trans where "tiff0." is the prefix and "coord_trans" the key.
-    * @param geoKeyLength Length of geoKeyBlock.
-    * @param geoKeyBlock Pointer to array of keys.
-    * @param geoDoubleLength Length of geoDoubleBlock.
-    * @param geoDoubleBlock Pointer to array of double values.
-    * @param geoAsciiLength Length of geoAsciiBlock.
-    * @param geoAsciiBlock Pointer to array of ascii values.
-    */
-   std::ostream& printGeoKeys(std::ostream& out,
-                              const std::string& prefix,
-                              ossim_uint64   geoKeyLength,
-                              ossim_uint16*  geoKeyBlock,
-                              ossim_uint64   geoDoubleLength,
-                              ossim_float64* geoDoubleBlock,
-                              ossim_uint64   geoAsciiLength,
-                              ossim_int8*    geoAsciiBlock) const;
-
-private:
-
-   /**
-    * @brief extracts geometry info from stream to keyword list.
-    *  
-    * Populates geomKwl from gtiffKwl.
-    *
-    * @param gtiffKwl Raw keywordlist extracted from tiff/geotiff keys.
-    * 
-    * @param geomKwl Keyword list that will be initialized with geometry info.
-    * Returns true if geometry info is present, false if not.
-    *
-    * @param entryIndex Entry to get geometry from. 
-    */
-   bool getImageGeometry(const ossimKeywordlist& gtiffKwl,
-                         ossimKeywordlist& geomKwl,
-                         ossim_uint32 entryIndex) const;
-   
-   /** Initializes s reference.  Does byte swapping as needed. */
-   void readShort(ossim_uint16& s, std::istream& str) const;
-   
-   /** Initializes l reference.  Does byte swapping as needed. */
-   void readLong(ossim_uint32& l, std::istream& str) const;
-   
-   /** Initializes l reference.  Does byte swapping as needed. */
-   void readLongLong(ossim_uint64& l, std::istream& str) const;
-   
-   /** Attempts to parse the pcs code (3072). */
-   void parsePcsCode(int code);
-   
-   /** Attempts to parse the projection geo key (3074). */
-   void parseProjGeoCode(int code);
-   
-   /**
-    *  Converts double passed in to meters if needed.  The conversion is
-    *  base on "theLiniarUnitsCode".
-    */
-   double convert2meters(double d) const;
-   
-   /**
-    * This will read either 4 or 8 bytes depending on the version and
-    * initialize offset.
-    *
-    * @return true if stream is good, false if not.
-    */
-   bool getOffset(std::streamoff& offset, std::istream& str,
-                  ossim_uint16 version) const;
-   
-   /**
-    * This will read either 2 , 4or 8 bytes depending on the version and
-    * WORD_TYPE.
-    *
-    * @return true if stream is good, false if not.
-    */
-   bool getValue(ossim_uint64& val, std::istream& str, WordType type,
-                 ossim_uint16 version) const;
-   
-   ossim_uint64 getArraySizeInBytes(ossim_uint64 length,
-                                    ossim_uint16 type) const;
-   
-   /**
-    * @return The byte size of each tiff type or 0 if unhandled.
-    */
-   ossim_uint16 getTypeByteSize(ossim_uint16 type) const;
-   
-   /**
-    * Eats the value field.  Either 4 or 8 bytes depending on the version.
-    */
-   void eatValue(std::istream& str, ossim_uint16 version) const;
-   
-   void swapBytes(ossim_uint8* v, ossim_uint16 type, ossim_uint64 count) const;
-   
-   /** Initializes v. */
-   template <class T> void getArrayValue(T& v,
-                                         ossim_uint8* array,
-                                         ossim_uint64 position) const;
-   
-   std::ostream& print(std::ostream& out,
-                       const std::string&  prefix,
-                       ossim_uint64   tagIdx,
-                       ossim_uint16   tag,
-                       ossim_uint16   type,
-                       ossim_uint64   count,
-                       ossim_uint64   arraySizeInBytes,
-                       ossim_uint8*   valueArray) const;
-   
-   std::ostream& printValue(std::ostream& out,
-                            ossim_uint16 type,
-                            ossim_uint8* valueArray) const;
-   
-   std::ostream& printArray(std::ostream& out,
-                            ossim_uint16 type,
-                            ossim_uint64 count,
-                            ossim_uint8* valueArray) const;
-   
-   std::ostream& printGdalMetadata(std::ostream& out,
-                                   const std::string& prefix,
-                                   ossim_uint64 count,
-                                   ossim_uint8* valueArray) const;
-
-   /** @brief Prints key 1024 */
-   std::ostream& printModelType(std::ostream& out,
-                                const std::string& prefix,
-                                ossim_uint16 code) const;
-
-   /** @brief Prints key 1025 */
-   std::ostream& printRasterType(std::ostream& out,
-                                 const std::string& prefix,
-                                 ossim_uint16 code) const;
-
-   /** @brief Prints key 2054 */
-   std::ostream& printAngularUnits(std::ostream& out,
-                                   const std::string& prefix,
-                                   ossim_uint16 code) const;
-
-   /** @brief Prints key 3075 */
-   std::ostream& printCoordTrans(std::ostream& out,
-                                  const std::string& prefix,
-                                  ossim_uint16 code) const;
-
-   /** @brief Prints key from code from section 6.3.1.3 */
-   std::ostream& printLinearUnits(std::ostream& out,
-                                  const std::string& prefix,
-                                  const std::string& key,
-                                  ossim_uint16 code) const;
-
-   /** @brief Prints tag 274 */
-   std::ostream& printOrientation(std::ostream& out,
-                                  const std::string& prefix,
-                                  ossim_uint16 code) const;
-  
-   /** @brief adds imageN. to prefix where N is zero base directory index. */
-   void getDirPrefix(ossim_int32 dirIndex, std::string& prefix) const;
-
-   /**
-    * @brief Gets the required pixel scale from keyword list looking for the
-    * key model_pixel_scale.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param scale The point to initialize.
-    * @return true on success, false on error.
-    */
-   bool getPixelScale(const ossimString& gtiffPrefix,
-                      const ossimKeywordlist& gtiffKwl,
-                      ossimDpt& scale) const;
-   
-   /**
-    * @brief Gets the model_tie_point array.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param ties The array to initialize.
-    * @return true on success, false on error.
-    */
-   bool getTiePoint(const ossimString& gtiffPrefix,
-                    const ossimKeywordlist& gtiffKwl,
-                    std::vector<ossim_float64>& ties) const;
-
-   /**
-    * @brief Gets the model_transform array.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param ties The array to initialize.
-    * @return true on success, false on error.
-    */
-   bool getModelTransform(const ossimString& gtiffPrefix,
-                          const ossimKeywordlist& gtiffKwl,
-                          std::vector<ossim_float64>& xfrm) const;
-
-   /**
-    * @brief Extracts float values from keyword list that match key.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param key to look for.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param floats Array to stuff.  Will have size of zero on failure.
-    * @return true on success, false on error.  If size of array is zero it
-    * will return false.
-    */
-   bool  getFloats(const ossimString& gtiffPrefix,
-                   const ossimString& key,
-                   const ossimKeywordlist& gtiffKwl,
-                   std::vector<ossim_float64>& floats) const;
-
-   /**
-    * @brief Extracts float values from lookup line and puts in floats array.
-    * @param lookup Line to parse like:
-    * "0.00138888888889 0.00138888888889, 0.0"
-    * @param floats Array to stuff.  Will have size of zero on failure.
-    */
-   bool getFloats(const ossimString& line,
-                  std::vector<ossim_float64>& floats) const;
-
-   /**
-    * @brief Gets the datum code matching code from the keyword list as a
-    * string.
-    *
-    * This checks for "geodetic_datum"(geotiff key 2050), then
-    * "gcs_code"(geotiff key 2048) if first lookup faild.
-    * 
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param datumCode The code to initialize.
-    * @return true on success, false on error.
-    */
-   bool getDatumCode(const ossimString& gtiffPrefix,
-                     const ossimKeywordlist& gtiffKwl,
-                     ossimString& datumCode) const;
-
-   /**
-    * @brief Gets the datum code.
-    * @param code Code from either "geodetic_datum"(geotiff key 2050),
-    * or "gcs_code"(geotiff key 2048).
-    * @param datumCode The code to initialize.
-    * @return true on success, false on error.
-    */
-   bool getDatumCode(ossim_int32 code, ossimString& datumCode) const;
-
-   /**
-    * @brief Gets the pcs code from the keyword list as a string.
-    *
-    * If the lookup of "pcs_code" returns false then the "pcs_citation" is then
-    * checked.
-    * 
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param pcsCode The code to initialize.
-    * @return true on success, false on error.
-    */
-   bool getPcsCode(const ossimString& gtiffPrefix,
-                   const ossimKeywordlist& gtiffKwl,
-                   ossimString& pcsCode) const;
-
-   /**
-    * @brief Gets units from keyword list as a string. This will be angular
-    * or linear base on the model type.  The default is meters if not found.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param linearUnits The string to initialize with units.
-    * @return true on success, false on error.
-    */
-   bool getUnits(const ossimString& gtiffPrefix,
-                 const ossimKeywordlist& gtiffKwl,
-                 ossimString& units) const;
-   /**
-    * @brief Gets the linear units from keyword list as a string.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param linearUnits The string to initialize with units.
-    * @return true on success, false on error.
-    */
-   bool getLinearUnits(const ossimString& gtiffPrefix,
-                       const ossimKeywordlist& gtiffKwl,
-                       ossimString& linearUnits) const;
-
-   /**
-    * @brief Gets the vertical units from keyword list as a string.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param linearUnits The string to initialize with units.
-    * @return true on success, false on error.
-    */
-   bool getVerticalUnits(const ossimString& gtiffPrefix,
-                         const ossimKeywordlist& gtiffKwl,
-                         ossimString& verticalUnits) const;
-
-   /**
-    * @brief Gets the units from keyword list as a string.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param angularUnit The string to initialize with units.
-    * @return true on success, false on error.
-    */
-   bool getAngularUnits(const ossimString& gtiffPrefix,
-                        const ossimKeywordlist& gtiffKwl,
-                        ossimString& units) const;
-
-
-   /**
-    * @brief Gets the pixel type (point or area) from keyword list as a string.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param unit The string to initialize with pixel type.
-    * @return true on success, false on error.
-    */   
-   bool getPixelType(const ossimString& gtiffPrefix,
-                     const ossimKeywordlist& gtiffKwl,
-                     ossimString& pixelType) const;
-
-   /**
-    * @brief Gets the model type from keyword list as a string.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param modelType The string to initialize with pixel type.
-    * @return true on success, false on error.
-    */   
-   bool getModelType(const ossimString& gtiffPrefix,
-                     const ossimKeywordlist& gtiffKwl,
-                     ossimString& modeType) const;
-
-   /**
-    * @brief Gets the ossimProjection from keyword list as a string.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param ossimProj The string to initialize with pixel type.
-    * @return true on success, false on error.
-    */   
-   bool getOssimProjectionName(const ossimString& gtiffPrefix,
-                               const ossimKeywordlist& gtiffKwl,
-                               ossimString& ossimProj) const;
-   
-   /**
-    * @brief Gets the number of lines from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @return Number of lines or 0 if lines not found.
-    */   
-   ossim_uint32 getLines(const ossimString& gtiffPrefix,
-                         const ossimKeywordlist& gtiffKwl) const;
-
-   /**
-    * @brief Gets the number of samples from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @return Number of lines or 0 if lines not found.
-    */   
-   ossim_uint32 getSamples(const ossimString& gtiffPrefix,
-                           const ossimKeywordlist& gtiffKwl) const;
-
-   /**
-    * @brief Gets the first standard parallel from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param value Initialized with result.
-    */   
-   bool getStdParallelOne(const ossimString& gtiffPrefix,
-                          const ossimKeywordlist& gtiffKwl,
-                          ossimString& value) const;
-
-   /**
-    * @brief Gets the second standard parallel from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param value Initialized with result.
-    */
-   bool getStdParallelTwo(const ossimString& gtiffPrefix,
-                          const ossimKeywordlist& gtiffKwl,
-                          ossimString& value) const;
-   
-   /**
-    * @brief Gets the false easting from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param value Initialized with result.
-    */
-   bool getFalseEasting(const ossimString& gtiffPrefix,
-                        const ossimKeywordlist& gtiffKwl,
-                        ossimString& value) const;
-
-   /**
-    * @brief Gets the false northing from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param value Initialized with result.
-    */
-   bool getFalseNorthing(const ossimString& gtiffPrefix,
-                         const ossimKeywordlist& gtiffKwl,
-                         ossimString& value) const;
-
-   /**
-    * @brief Gets the false easting/northing from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param eastingNorthing Initialized with result.
-    */
-   bool getFalseEastingNorthing(const ossimString& gtiffPrefix,
-                                const ossimKeywordlist& gtiffKwl,
-                                ossimDpt& eastingNorthing) const;
-
-   /**
-    * @brief Gets the scale factor from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param value Initialized with result.
-    */
-   bool getScaleFactor(const ossimString& gtiffPrefix,
-                       const ossimKeywordlist& gtiffKwl,
-                       ossim_float64& value) const;
-
-   /**
-    * @brief Gets the origin of latitude from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param value Initialized with result.
-    */
-   bool getOriginLat(const ossimString& gtiffPrefix,
-                     const ossimKeywordlist& gtiffKwl,
-                     ossim_float64& value) const;
-
-   /**
-    * @brief Gets the central meridian from keyword list.
-    * @param gtiffPrefix Prefix for gtiffKwl.
-    * @param gtiffKwl The keyword list with all tiff keywords.
-    * @param value Initialized with result.
-    */
-   bool getCentralMeridian(const ossimString& gtiffPrefix,
-                           const ossimKeywordlist& gtiffKwl,
-                           ossim_float64& value) const;
-
-   /**
-    * @brief Split tie points into sets of six tie sets.
-    * @param tie points.
-    * @param width Image width.
-    * @param height Image height.
-    * @param tieSet Initialized with result.
-    */
-   void getTieSets(const std::vector<ossim_float64>& ties,
-                   ossim_uint32 width,
-                   ossim_uint32 height,
-                   ossimTieGptSet& tieSet) const;
-
-
-   /**
-    * @brief Check tie points to see if they are zero base or one based.
-    * @param tie points.
-    * @param width Image width.
-    * @param height Image height.
-    * @return true if one based, false if not.
-    */
-   bool hasOneBasedTiePoints(const std::vector<ossim_float64>& ties,
-                             ossim_uint32 width,
-                             ossim_uint32 height) const;
-   
-   ossimFilename          theFile;
-   mutable ossimEndian*   theEndian;
-};
-
-#endif /* End of "#ifndef ossimTiffInfo_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimTiffWorld.h b/ossim/include/ossim/support_data/ossimTiffWorld.h
deleted file mode 100644
index 3ed7563..0000000
--- a/ossim/include/ossim/support_data/ossimTiffWorld.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description: Container class for a tiff world file data.
-//
-//********************************************************************
-// $Id: ossimTiffWorld.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef ossimTiffWorld_HEADER
-#define ossimTiffWorld_HEADER
-
-#include <iostream>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDpt.h>
-using namespace std;
-
-//***************************************************************************
-// CLASS:  ossimTiffWorld
-//***************************************************************************
-class OSSIMDLLEXPORT ossimTiffWorld
-{
-public:
-   ossimTiffWorld();
-   ossimTiffWorld(const char* source, 
-		  ossimPixelType ptype = OSSIM_PIXEL_IS_POINT,
-		  ossimUnitType  unit = OSSIM_METERS);
-   
-   ~ossimTiffWorld();
-   
-   bool open(const ossimFilename& file,
-             ossimPixelType ptype,
-             ossimUnitType unit);
-   
-   bool saveToOssimGeom(ossimKeywordlist& kwl, const char* prefix=NULL)const;
-   bool loadFromOssimGeom(const ossimKeywordlist& kwl, const char* prefix=NULL);
-   
-   std::ostream& print(std::ostream& out) const;
-   
-   friend OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& out,
-                                                  const ossimTiffWorld& obj);
-   
-   /*!
-    * transformed.x =
-    * imagePoint.x*theX_scale + imagePoint.y*the3rdValue + theTranslateX
-    * 
-    * transformed.y =
-    * imagePoint.x*the2ndValue + imagePoint.y*theY_scale + theTranslateY
-    */
-   void forward(const ossimDpt& imagePoint,
-                ossimDpt& transformedPoint);
-   
-   //! Converts world file parameters into x, y scale (for use in affine transform) 
-   const ossimDpt& getScale() const { return theComputedScale; }
-   
-   //! Converts world file parameters into RH rotation in radians (for use in affine transform) 
-   double getRotation() const { return theComputedRotation; }
-   
-   //! Provides access to the translation (for use in affine transform) 
-   const ossimDpt& getTranslation() const { return theTranslation; }
-
-protected:
-   double theXform1;     
-   double theXform2;   
-   double theXform3;   
-   double theXform4;   
-   ossimDpt theTranslation;
-
-   ossimPixelType thePixelType;
-   ossimUnitType  theUnit;
-   ossimDpt theComputedScale;
-   double   theComputedRotation;  //!< Radians
-};
-
-#endif
-
diff --git a/ossim/include/ossim/support_data/ossimWavelength.h b/ossim/include/ossim/support_data/ossimWavelength.h
deleted file mode 100644
index b0870e3..0000000
--- a/ossim/include/ossim/support_data/ossimWavelength.h
+++ /dev/null
@@ -1,107 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class declaration for ossimWavelength.
-// See class description below.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimWavelength_HEADER
-#define ossimWavelength_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <iostream>
-#include <map>
-#include <vector>
-
-
-class ossimEnviHeader;
-
-/**
- * @class ossimWavelenght class.
- *
- * Simple container class encapsulating a std::map of wavelengths(key) and associated
- * bands(value), with convenience methods.  Wavelengths values are 64 bit
- * floating point in nanometers. Bands are zero based
- * 32 bit unsigned integers. 
- */
-class OSSIM_DLL ossimWavelength 
-{
-public:
-   
-   typedef std::map< ossim_float64, ossim_uint32 > WavelengthMap;
-   
-   /** @brief default constructor */
-   ossimWavelength();
-
-   /** @brief copy constructor */
-   ossimWavelength( const ossimWavelength& obj );
-
-   /** @brief assignment operator= */
-   const ossimWavelength& operator=( const ossimWavelength& rhs );
-
-   /** @brief virtual destructor */
-   ~ossimWavelength();
-   
-   const ossimWavelength::WavelengthMap& getMap() const;
-   
-   ossimWavelength::WavelengthMap& getMap();
-
-   /**
-    * @brief Initializes map from ENVI header class.
-    *
-    * This will clear any existing map, look for the keywords
-    * "wavelength units" and "wavelength".
-    * 
-    * @param header to initialize from.
-    * @return true on success, false on error.
-    */
-   bool initialize( const ossimEnviHeader& hdr );
-
-   /**
-    * @brief Finds iterator closest to wavelength.
-    * @param requestedWavelength Requested wavelength in nanometers.
-    * @param thresholdFromCenter in nanometers.
-    * @return WavelengthMap::const_iterator if not found will return. 
-    */
-   WavelengthMap::const_iterator findClosestIterator(
-      const ossim_float64& requestedWavelength,
-      const ossim_float64& thresholdFromCenter  ) const;
-   
-   /**
-    * @brief Finds index closest to wavelength.
-    * @param requestedWavelength Requested wavelength in nanometers.
-    * @param thresholdFromCenter in nanometers.
-    * @return Closest zero based index to wavelength or -1 if not found. 
-    */
-   ossim_int32 findClosestIndex(
-      const ossim_float64& requestedWavelength,
-      const ossim_float64& thresholdFromCenter  ) const;
-   
-   /**
-    * @brief Gets rgb bands if "wavelength" keyword is present.
-    * @param bands Initialized by this with zero base rbg band
-    * indexes.
-    * @return true on success, false if bands not found.
-    */   
-   bool getRgbBands( std::vector<ossim_uint32>& bands ) const;
-
-   /** @return WavelengthMap::const_iterator of underlying map. */
-   WavelengthMap::const_iterator end() const;
-
-   /** @return WavelengthMap::iterator of underlying map. */
-   WavelengthMap::iterator end();
-
-private:
-   
-   WavelengthMap m_map;
-};
-
-#endif /* End of "#ifndef ossimWavelength_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimWkt.h b/ossim/include/ossim/support_data/ossimWkt.h
deleted file mode 100644
index 638c2e4..0000000
--- a/ossim/include/ossim/support_data/ossimWkt.h
+++ /dev/null
@@ -1,112 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// ossimWkt class declaration. A well known text(WKT) utility class.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimWkt_HEADER
-#define ossimWkt_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-#include <iosfwd>
-#include <string>
-#include <vector>
-
-/**
- * @class ossimWkt
- *
- * Utility/support data class to parse WKT text string to an ossimKeywordlist.
- *
- * Example keyword list( WKT string dependent ):
- *
- * PROJCS.AUTHORITY.name:  EPSG
- * PROJCS.AUTHORITY.param0:  "32641"
- * PROJCS.GEOGCS.AUTHORITY.name:  EPSG
- * PROJCS.GEOGCS.AUTHORITY.param0:  "4326"
- * PROJCS.GEOGCS.DATUM.AUTHORITY.name:  EPSG
- * PROJCS.GEOGCS.DATUM.AUTHORITY.param0:  "6326"
- * PROJCS.GEOGCS.DATUM.SPHEROID.AUTHORITY.name:  EPSG
- * PROJCS.GEOGCS.DATUM.SPHEROID.AUTHORITY.param0:  "7030"
- * PROJCS.GEOGCS.DATUM.SPHEROID.name:  WGS 84
- * PROJCS.GEOGCS.DATUM.SPHEROID.param0:  6378137
- * PROJCS.GEOGCS.DATUM.SPHEROID.param1:  298.2572235630016
- * PROJCS.GEOGCS.DATUM.name:  WGS_1984
- * PROJCS.GEOGCS.PRIMEM.name:  Greenwich
- * PROJCS.GEOGCS.PRIMEM.param0:  0
- * PROJCS.GEOGCS.UNIT.name:  degree
- * PROJCS.GEOGCS.UNIT.param0:  0.0174532925199433
- * PROJCS.GEOGCS.name:  WGS 84
- * PROJCS.PARAMETER0.name:  latitude_of_origin
- * PROJCS.PARAMETER0.param0:  0
- * PROJCS.PARAMETER1.name:  central_meridian
- * PROJCS.PARAMETER1.param0:  63
- * PROJCS.PARAMETER2.name:  scale_factor
- * PROJCS.PARAMETER2.param0:  0.9996
- * PROJCS.PARAMETER3.name:  false_easting
- * PROJCS.PARAMETER3.param0:  500000
- * PROJCS.PARAMETER4.name:  false_northing
- * PROJCS.PARAMETER4.param0:  0
- * PROJCS.PROJECTION.name:  Transverse_Mercator
- * PROJCS.UNIT.AUTHORITY.name:  EPSG
- * PROJCS.UNIT.AUTHORITY.param0:  "9001"
- * PROJCS.UNIT.name:  metre
- * PROJCS.UNIT.param0:  1
- * PROJCS.name:  WGS 84 / UTM zone 41N 
- *
- */
-class OSSIM_DLL ossimWkt
-{
-public:
-   
-   /** default constructor */
-   ossimWkt();
-
-   /** destructor */
-   ~ossimWkt();
-
-   /**
-    * @brief Parses string to keyword list.
-    * @param wkt String to parse.
-    */
-   bool parse( const std::string& wkt );
-
-   /** @return Refeerence to keyword list. */
-   const ossimKeywordlist& getKwl() const;
-
-private:
-   bool parseWktGroup( std::istringstream& is, ossimKeywordlist& kwl );
-
-   bool parseObject( std::istringstream& is,
-                     const std::string& prefix,
-                     const std::string& object,
-                     ossimKeywordlist& kwl );
-   
-   bool parseName( std::istringstream& is,
-                   const std::string& prefix,
-                   const std::string& object,
-                   ossimKeywordlist& kwl );
-   
-   bool parseParam( std::istringstream& is,
-                    const std::string& prefix,
-                    const std::string& object,
-                    ossim_uint32& objectIndex,
-                    ossim_uint32& paramIndex,
-                    ossimKeywordlist& kwl );
-
-   ossimKeywordlist m_kwl;
-
-};
-
-#endif /* End of "#ifndef ossimWkt_HEADER" */
-
diff --git a/ossim/include/ossim/support_data/ossimXmpInfo.h b/ossim/include/ossim/support_data/ossimXmpInfo.h
deleted file mode 100644
index 240c3d1..0000000
--- a/ossim/include/ossim/support_data/ossimXmpInfo.h
+++ /dev/null
@@ -1,121 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Extensible Metadata Platform (XMP) Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimXmpInfo_HEADER
-#define ossimXmpInfo_HEADER 1
-
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/projection/ossimProjection.h>
-#include <string>
-
-// Forward class declarations:
-class ossimDrect;
-class ossimString;
-class ossimXmlDocument;
-
-/** @class Extensible Metadata Platform (XMP) Info object. */
-class OSSIM_DLL ossimXmpInfo : public ossimInfoBase
-{
-public:
-   
-   /** default constructor */
-   ossimXmpInfo();
-
-   /** virtual destructor */
-   virtual ~ossimXmpInfo();
-
-   /**
-    * @brief open method.
-    *
-    * @param file File name to open.
-    *
-    * @return true on success false on error.
-    */
-   virtual bool open(const ossimFilename& file);
-   
-   /**
-    * Print method.
-    *
-    * @param out Stream to print to.
-    * 
-    * @return std::ostream&
-    */
-   virtual std::ostream& print(std::ostream& out) const;
-
-   /** @return XMP APP1 XML block. */ 
-   const std::string& getXmpApp1XmlBlock() const;
-
-   /**
-    * @brief Method to get a projection if possible.
-    * @param imageRect Require image rectangle of associated meta data
-    * parsed by this class.
-    * @return Projection pointer wrapped in ref pointer.  Can be null if
-    * projection cannot be established.
-    */
-   ossimRefPtr<ossimProjection> getProjection(
-      const ossimDrect& imageRect ) const;
-
-   /**
-    *  @brief Gets the date if available in ISO8601 format:
-    *  YYYY-MM-DDThh:mm:ss.sssZ
-    *
-    *  @param date Initialized by this.  Will be cleared if date not found.
-    */
-   void getDate( std::string& date ) const;
-   
-   /**
-    *  @brief Gets the mission ID if available.
-    *
-    *  @param mission Initialized by this.  Will be cleared if date not found.
-    */
-   void getMissionId( std::string& mission ) const;
-
-   /**
-    *  @brief Gets the sensor ID if available.
-    *
-    *  @param sensor Initialized by this.  Will be cleared if date not found.
-    */
-   void getSensorId( std::string& sensor ) const;
-   
-private:
-
-   /**
-    * @brief Gets the xml block as a string from stream.
-    * @param str Input stream.
-    * @param xmpApp1XmlBlock String initialized by this.
-    * @return true on success, false on error.
-    */
-   bool getXmpApp1XmlBlock( std::ifstream& str,
-                            std::string& xmpApp1XmlBlock ) const;
-
-   /**
-    * @brief Gets path from doc and initializes string.
-    * @param path Xml path to look for.
-    * @param xdoc Xml doc to look in.
-    * @param s String to initialize.
-    * @return true on success and false if path is not found or if there
-    * are more than one of path.
-    */
-   bool getPath( const ossimString& path,
-                 const ossimXmlDocument& xdoc,
-                 ossimString& s ) const;
-
-   ossimFilename  m_file;
-   std::string    m_xmpApp1XmlBlock;
-};
-
-#endif /* End of "#ifndef ossimXmpInfo_HEADER" */
-
diff --git a/ossim/include/ossim/util/ossimAutRegUtil.h b/ossim/include/ossim/util/ossimAutRegUtil.h
deleted file mode 100644
index 087bcee..0000000
--- a/ossim/include/ossim/util/ossimAutRegUtil.h
+++ /dev/null
@@ -1,289 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimAutRegUtil.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Hicks
-//
-// Description: Utility class for autonomous registration.
-//----------------------------------------------------------------------------
-#ifndef ossimAutRegUtil_HEADER
-#define ossimAutRegUtil_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimTieMeasurementGeneratorInterface.h>
-
-#include <ctime>
-#include <vector>
-#include <iostream>
-
-
-// Forward class declarations:
-class ossimArgumentParser;
-class ossimImageHandler;
-class ossimKeywordlist;
-class ossimImageViewAffineTransform;
-class ossimAdjustmentExecutive;
-class ossimObservationSet;
-
-/**
- * @brief ossimAutRegUtil class.
- *
- * This is a utility class to register two images.
- *
- * @note Almost all methods use throw for stack unwinding.  This is not in
- * method declarations to alleviate build errors on windows.
- */
-class OSSIM_DLL ossimAutRegUtil : public ossimReferenced
-{
-public:
-   /** emumerated operations */
-   enum ossimAutRegOperation
-   {
-      OSSIM_AUTREG_OP_UNKNOWN = 0,
-      OSSIM_AUTREG_OP_COREG   = 1,
-      OSSIM_AUTREG_OP_MASREG  = 2
-   };
-
-   /**
-    * @brief default constructor
-    */
-   ossimAutRegUtil();
-   
-   /**
-    * @brief virtual destructor
-    */
-   ~ossimAutRegUtil();
-
-   /**
-    * @brief Disconnects and clears the dem and image layers?????????????.
-    */
-   void clear();
-   
-   /**
-    * @brief Initialize method, using arguments, to be run prior to execute.
-    * @param ap Arg parser to initialize from.
-    * @note Throws ossimException on error.
-    * @note A throw with an error message of "usage" is used to get out when
-    * a usage is printed.
-    */
-   bool initialize(ossimArgumentParser& ap);
-
-
-   /**
-    * @brief Initialize method, using predefined kwl, to be run prior to execute.
-    * @note Throws ossimException on error.
-    */
-   void initialize(const ossimKeywordlist& kwl);
-
-
-   /**
-    * @brief Execute method.  Performs the registration process.
-    * @note Throws ossimException on error.
-    */
-   void execute();
-
-
-   // /**
-   //  * @brief Summarize method
-   //  */
-   void summarizeSolution() const;
-
-
-   // /**
-   //  * @brief saveAdjustment method
-   //  */
-   void saveAdjustment();
-
-   /**
-    * @brief Gets the output file name.
-    * @param f Initialized by this with the filename.
-    */
-   void getOutputFilename(ossimFilename& f) const;
-
-private:
-
-   /**
-    * @brief Internal initialize method.
-    * @note Throws ossimException on error.
-    */
-   void initialize();
-
-   /**
-    * @brief Internal load image pair method.
-    * @return true if succsessful.
-    */
-   bool loadImages();
-
-   /**
-    * @brief Internal correlation region determination.
-    * @return true if succsessful.
-    */
-   bool delineateROIs();
-
-   /**
-    * @brief Internal observation set poplulate method.
-    * @return true if succsessful.
-    */
-   bool populateObsSet();
-
-
-   /** @return true if key is set to true; false, if not. */
-   bool keyIsTrue(ossimRefPtr<ossimKeywordlist> kwl, const std::string& key ) const;
-                                  
-
-   /** @return true if file extension is "src" */
-   bool isSrcFile(const ossimFilename& file) const;
-
-   /** @brief Initializes m_srcKwl if option was set. */
-   void initializeSrcKwl();
-
-   /** @brief Initializes m_ocvKwl if option was set. */
-   void initializeOcvKwl();
-
-   /** @brief Initializes m_oaxKwl if option was set. */
-   void initializeOaxKwl();
-
-   /**
-    * @brief Adds application arguments to the argument parser.
-    * @param ap Parser to add to.
-    */
-   void addArguments(ossimArgumentParser& ap);
-
-   /**
-    * @brief Configures tie measurement generator
-    */
-   void configureTieMeasGenerator();
-
-   /**
-    * @brief Configures adjustment executive
-    */
-   void configureAdjustmentExecutive();
-
-
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-
-
-   /**
-    * @brief Passes reader properties to single image handler if any.
-    * @param ih Image handler to set properties on.
-    */
-   void setReaderProps( ossimImageHandler* ih ) const;
-
-   /**
-    * @brief Sets entry for a chain.
-    * @param chain Chain to set up.
-    * @param entryIndex Zero based index.
-    * @return true on success, false on error.
-    */
-   bool setChainEntry( ossimRefPtr<ossimSingleImageChain>& chain,
-                       ossim_uint32 entryIndex ) const;
-   
-   /**
-    * @brief Method to create a chain and add to img layers from file.
-    * @param file Image to open.
-    * @parm entryIndex Entry to open.
-    */
-   bool addImgSource(const ossimFilename& file,
-                     ossim_uint32 entryIndex);
-
-
-   /**
-    * @brief Creates a ossimSingleImageChain from file.
-    * @param file File to open.
-    * @param entryIndex Entry to open.
-    * options like histogram stretches.
-    * @return Ref pointer to ossimSingleImageChain.
-    * @note Throws ossimException on error.
-    */
-   ossimRefPtr<ossimSingleImageChain> createChain(const ossimFilename& file,
-                                                  ossim_uint32 entryIndex) const;
-   
-   /**
-    * @brief Sets the single image chain for identity operations view to
-    * an ossimImageViewAffineTransform.
-    */
-   void createIdentityProjection(int idx);
-
-   /** @brief Hidden from use copy constructor. */
-   ossimAutRegUtil( const ossimAutRegUtil& obj );
-
-   /** @brief Hidden from use assignment operator. */
-   const ossimAutRegUtil& operator=( const ossimAutRegUtil& rhs );
-
-   /**
-    * @brief Tie point generator interface
-    */
-   ossimTieMeasurementGeneratorInterface* m_tGen;
-   ossimRefPtr<ossimObject> m_tGenObj;
-   
-   /** @brief Correlation ROIs */
-   std::vector<ossimIrect> m_roiRects;
-   
-   /** @brief OpenCV match window display flag */
-   bool m_showMatchWindow;
-   
-   /**
-    * @brief Adjustment executive interface
-    */
-   /** @brief Executive object */
-   ossimRefPtr<ossimAdjustmentExecutive> m_adjExec;
-
-   /** @brief Observation set */
-   ossimRefPtr<ossimObservationSet> m_obsSet;
-
-   /** @brief A priori tie point sigmas */
-   ossimColumnVector3d m_LatLonHgtSigmas;
-   ossimColumnVector3d m_LatLonHgtControlSigmas;
-
-
-   /** @brief Report stream pointer */
-   std::ostream* m_rep;
-
-
-   /**  @brief Array of image source chains. */
-   std::vector< ossimRefPtr<ossimSingleImageChain> > m_imgLayer;
-
-   /** Hold all options passed into intialize. */
-   ossimRefPtr<ossimKeywordlist> m_kwl;
-
-   /** Hold contents of OpenCV config file if --ocv_config_file is used. */
-   ossimRefPtr<ossimKeywordlist> m_ocvKwl;
-
-   /** Hold contents of oax config file if --oax_config_file is used. */
-   ossimRefPtr<ossimKeywordlist> m_oaxKwl;
-
-   /** Hold contents of src file if --src is used. */
-   ossimRefPtr<ossimKeywordlist> m_srcKwl;
-   
-   /** Enumerated operation to perform. */
-   ossimAutRegOperation m_operation;
-   
-   /**
-    * Image view transform(IVT). Only set/used in "chip"(identity) operation as
-    * the IVT for the resampler(ossimImageRenderer).
-    */
-   ossimRefPtr<ossimImageViewAffineTransform> m_ivt[2];
-
-   /**
-    * The image geometry.  In chip mode this will be from the input image. So
-    * this may or may not have a map projection. In any other mode it
-    * will the view or output geometry which will be a map projection.
-    */
-   ossimRefPtr<ossimImageGeometry> m_geom[2];
-   
-   /** Control image flags. */
-   bool m_controlImage[2];
-};
-
-#endif // #ifndef ossimAutRegUtil_HEADER
-
diff --git a/ossim/include/ossim/util/ossimBatchTest.h b/ossim/include/ossim/util/ossimBatchTest.h
deleted file mode 100644
index c16f22a..0000000
--- a/ossim/include/ossim/util/ossimBatchTest.h
+++ /dev/null
@@ -1,146 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken, Oscar Kramer
-//
-// Description: Test code application utility class.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimBatchTest_HEADER
-#define ossimBatchTest_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimFilename.h>
-#include <vector>
-#include <fstream>
-
-// Forward class declarations:
-class ossimArgumentParser;
-class ossimDpt;
-class ossimString;
-class ossimGpt;
-class ossimImageFileWriter;
-class ossimImageGeometry;
-class ossimIrect;
-class ossimKeywordlist;
-class ossimTilingRect;
-
-class OSSIM_DLL ossimBatchTest : public ossimReferenced
-{
-public:
-   enum TEST_STATUS
-   {
-      TEST_TBD      = 0x00, // initial state: no test yet attempted
-      TEST_PASSED   = 0x01,
-      TEST_FAILED   = 0x02,
-      TEST_ERROR    = 0x04,
-      TEST_DISABLED = 0x08
-   };
-
-   //! This constructor only initializes data members to null/defaults
-   ossimBatchTest();
-   
-   //! Initializes the test session given the command line.
-   bool initialize(ossimArgumentParser& ap);
-
-   //! Performs the actual test with the config filename previously set in initialize() or
-   //! processConfigList() when config is a list of subordinate test config files.
-   //! @return The overall bit-wise status of all tests (see TEST_STATUS enum for bit definitions).
-   ossim_uint8 execute();
-
-private:
-   //! Writes template test config file, either exhaustive long form for flexibility, or simple
-   //! short-form for easier test creation.
-   void writeTemplate(const ossimFilename& templateFile, bool long_form);
-   
-   //! Fetches string from OS for naming and tagging the log file.
-   void getDateString(ossimString& date);
-   
-   //! Establishes name of output log file.
-   void getLogFilename(ossimFilename& logFile);
-
-   //! When the config file consists of a list of subordinate test config files, this method manages
-   //! processing multiple configs.
-   //! @return The overall bit-wise status of all configs (see TEST_STATUS enum for bit definitions).
-   ossim_uint8 processConfigList(const ossimKeywordlist& kwl);
-
-   //! Within a single config file can be multiple tests, distinguished by the "test*." prefix. This
-   //! method manages the execution of a single test.
-   //! @return The overall bit-wise status of test (see TEST_STATUS enum for bit definitions).
-   ossim_uint8 processTest(const ossimString& prefix, const ossimKeywordlist& kwl);
-
-   //! Runs a single command within a test.
-   //! @return The bit-wise status of command (see TEST_STATUS enum for bit definitions).
-   ossim_uint8 processCommands(const ossimString& prefix,
-                               const ossimKeywordlist& kwl,
-                               const ossimString& testName,
-                               bool logTime,
-                               const ossimFilename& tempFile=ossimFilename(""));
-
-   //! Modifies the config's KWL to explicitly declare implied keywords.
-   void preprocessKwl(const std::vector<std::string>& testList,
-                      const std::string& testCommand,
-                      ossimKeywordlist& kwl);
-
-   //! Default preprocessing step makes expected and output results directories. Returns 
-   //! @return TRUE if successful.
-   bool makeDefaultResultsDir();
-
-   //! Default clean step deletes all files in out and exp dirs.
-   //! @return TRUE if successful.
-   bool doDefaultClean();
-
-   /**
-    * @brief Gets the temp file name.
-    *
-    * This will either be from the config file lookup of "temp_file" or derived under
-    * $(OSSIM_BATCH_TEST_RESULTS)/tmp if the lookup fails.  Note that this will create
-    * the $(OSSIM_BATCH_TEST_RESULTS)/tmp directory if needed.
-    *
-    * @param prefix Like "test1."
-    * @param kwl Keyword list to look for temp_file in.
-    * @param tempFile Initialized by this.
-    *
-    * @return true on success.  False if derived temp file directory could
-    * not be created.
-    */
-   bool getTempFileName( const ossimString& prefix,
-                         const ossimKeywordlist& kwl,
-                         ossimFilename& tempFile ) const;
-
-   /**
-    * @brief Gets the default temp directory $(OSSIM_BATCH_TEST_RESULTS)/tmp.
-    * @param tempDir Initialized by this.
-    *
-    * @return true on success, false on error.
-    */
-   bool getDefaultTempFileDir( ossimFilename& tempDir ) const;
-
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-
-   /**
-    * @brief Converts string slashes to either forward or backward taking
-    * into account that windows commands with forward slashes in them.
-    * @param s String to convert.
-    */
-   std::string convertToNative( const char* lookup ) const;
-
-   std::vector<std::string> m_acceptTestList;
-   std::vector<std::string> m_cleanTestList;
-   std::vector<std::string> m_preprocessTestList;
-   std::vector<std::string> m_runTestList;
-
-   bool          m_templateModeActive;
-   ossimFilename m_configFileName;
-   ossimFilename m_outDir;
-   ossimFilename m_expDir;
-   std::ofstream m_logStr;
-};
-
-#endif /* #ifndef ossimBatchTest_HEADER */
diff --git a/ossim/include/ossim/util/ossimChipperUtil.h b/ossim/include/ossim/util/ossimChipperUtil.h
deleted file mode 100644
index c6d6647..0000000
--- a/ossim/include/ossim/util/ossimChipperUtil.h
+++ /dev/null
@@ -1,768 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimChipperUtil.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Utility class to for chipping out images. , orthorectifying imagery with an
-// added slant toward doing digital elevation model(DEM) operations.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimChipperUtil.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimChipperUtil_HEADER
-#define ossimChipperUtil_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/projection/ossimMapProjection.h>
-
-#include <map>
-#include <vector>
-
-// Forward class declarations:
-class ossimArgumentParser;
-class ossimDpt;
-class ossimFilename;
-class ossimGeoPolygon;
-class ossimGpt;
-class ossimImageData;
-class ossimImageFileWriter;
-class ossimImageGeometry;
-class ossimImageViewAffineTransform;
-class ossimIrect;
-class ossimKeywordlist;
-
-/**
- * @brief ossimChipperUtil class.
- *
- * This is a utility class to orthorectify imagery with an added slant toward
- * doing digital elevation model(DEM) operations.
- *
- * See the ossim-dem application for a code usage example.
- *
- * @note Almost all methods use throw for stack unwinding.  This is not in
- * method declarations to alleviate build errors on windows.  Sorry...
- *
- * @note "bumpshade" and "hillshade" intermixed throughout.  The class to do
- * a hillshade is the ossimBumpShadeTileSource.
- */
-class OSSIM_DLL ossimChipperUtil : public ossimReferenced
-{
-public:
-
-   /** emumerated operations */
-   enum ossimChipperOperation
-   {
-      OSSIM_CHIPPER_OP_UNKNOWN      = 0,
-      OSSIM_CHIPPER_OP_HILL_SHADE   = 1,
-      OSSIM_CHIPPER_OP_COLOR_RELIEF = 2,
-      OSSIM_CHIPPER_OP_ORTHO        = 3,
-      OSSIM_CHIPPER_OP_2CMV         = 4, // two color multiview
-      OSSIM_CHIPPER_OP_CHIP         = 5, // image space
-      OSSIM_CHIPPER_OP_PSM          = 6  // pan sharpened multispectral
-   };
-
-   /** emumerated output projections */
-   enum ossimChipperOutputProjection
-   {
-      OSSIM_CHIPPER_PROJ_UNKNOWN    = 0,
-      OSSIM_CHIPPER_PROJ_GEO        = 1,
-      OSSIM_CHIPPER_PROJ_GEO_SCALED = 2,
-      OSSIM_CHIPPER_PROJ_INPUT      = 3,
-      OSSIM_CHIPPER_PROJ_UTM        = 4
-   };
-
-   /** default constructor */
-   ossimChipperUtil();
-
-   /** virtual destructor */
-   virtual ~ossimChipperUtil();
-
-   /**
-    * @brief Disconnects and clears the dem and image layers.
-    */
-   void clear();
-   
-   /**
-    * @brief Initial method to be ran prior to execute.
-    * @param ap Arg parser to initialize from.
-    * @note Throws ossimException on error.
-    * @note A throw with an error message of "usage" is used to get out when
-    * a usage is printed.
-    */
-   bool initialize(ossimArgumentParser& ap);
-
-
-   /**
-    * @brief Initialize method to be ran prior to execute.
-    * 
-    * @note Throws ossimException on error.
-    */
-   void initialize(const ossimKeywordlist& kwl);
-
-   /**
-    * @brief execute method.  Performs the actual product write.
-    * @note Throws ossimException on error.
-    */
-   void execute();
-
-   void abort();
-
-   /**
-    * @brief Gets initialized area of interest(aoi) from chain.
-    * @return Pointer to ossimImageData holding chip.  Pointer
-    * can be null if not initialized properly so caller should
-    * check.
-    */
-//   ossimRefPtr<ossimImageData> getChip();
-
-   /**
-   * The options will only support a couple modifications while chipping.  
-   * this is mainly here to support a moving chip window so we do not need to do
-   * a full initialize for every chip.  We can specify a new cut bounds and
-   * cut width height in pixels if desired.
-   *
-   *  cut_wms_bbox: ..........
-   *  cut_width:
-   *  cut_height:
-   *
-   *
-   *
-   */
-   ossimRefPtr<ossimImageData> getChip(const ossimKeywordlist& optionsKwl= ossimKeywordlist());
-
-   /**
-    * @brief Gets the output file name.
-    * @param f Initialized by this with the filename.
-    */
-   void getOutputFilename(ossimFilename& f) const;
-
-private:
-
-   /**
-    * @brief Initial method to be ran prior to execute.
-    *
-    * @note Throws ossimException on error.
-    */
-   void initialize();
-
-   /**
-    * @brief Builds image chains returns ref pointer to image source
-    * and initializes area of interest(aoi).
-    * @return Ref pointer to image chain.
-    */
-   ossimRefPtr<ossimImageSource> initializeChain( ossimIrect& aoi );
-
-   void setOptionsToChain( ossimIrect& aoi, const ossimKeywordlist& kwl );
-
-   /**
-    * @brief Initializes a color relief chain.
-    * @return Ref pointer to image chain.
-    */
-   ossimRefPtr<ossimImageSource> initializeColorReliefChain();
-
-   /**
-    * @brief Initializes a bump shade chain.
-    * @return Ref pointer to image chain.
-    */
-   ossimRefPtr<ossimImageSource> initializeBumpShadeChain();
-
-   /**
-    * @brief Combines two images into a two color multi view chain.
-    * @return ossimRefPtr with pointer to ossimImageSource.  Can be null.
-    */
-   ossimRefPtr<ossimImageSource> initialize2CmvChain();
-
-   /**
-    * @brief Initializes a psm (pan sharpening multispectra) chain.
-    * @return Ref pointer to image chain.
-    */
-   ossimRefPtr<ossimImageSource> initializePsmChain();
-
-   /**
-    * @brief Initializes the output projection and propagates to image chains.
-    * @note Throws ossimException on error.
-    */
-   void initializeOutputProjection();
-   
-   /** @brief Create chains for all dems. */
-   void addDemSources();
-   
-   /**
-    * @brief Method to create a chain and add to dem layers from file.
-    * @param file Image to open.
-    * @parm entryIndex Entry to open.
-    */
-   void addDemSource(const ossimFilename& file,
-                     ossim_uint32 entryIndex);
-
-   /**
-    * @brief  Method to create a chain and add to dem layers from a
-    * ossimSrcRecord.
-    */
-   void addDemSource(const ossimSrcRecord& rec);
-
-   /** @brief Creates chains for all images. */
-   void addImgSources();
-   
-   /**
-    * @brief Method to create a chain and add to img layers from file.
-    * @param file Image to open.
-    * @parm entryIndex Entry to open.
-    */
-   void addImgSource(const ossimFilename& file,
-                     ossim_uint32 entryIndex);
-
-   /**
-    * @brief  Method to create a chain and add to img layers from a
-    * ossimSrcRecord.
-    */
-   void addImgSource(const ossimSrcRecord& rec);
-
-   /**
-    * @brief Creates a ossimSingleImageChain from file.
-    * @param file File to open.
-    * @param entryIndex Entry to open.
-    * @param isDemSource True if dem source, false if not. This controls chain
-    * options like histogram stretches.
-    * @return Ref pointer to ossimSingleImageChain.
-    * @note Throws ossimException on error.
-    */
-   ossimRefPtr<ossimSingleImageChain> createChain(const ossimFilename& file,
-                                                  ossim_uint32 entryIndex,
-                                                  bool isDemSource) const;
-
-   /**
-    * @brief Creates a ossimSingleImageChain from ossimSrcRecord.
-    * @param src Record.
-    * @param isDemSource True if dem source, false if not. This controls chain
-    * options like histogram stretches.
-    * @return Ref pointer to ossimSingleImageChain.
-    * @note Throws ossimException on error.
-    */
-   ossimRefPtr<ossimSingleImageChain> createChain(const ossimSrcRecord& rec,
-                                                  bool isDemSource) const;
-
-   /**
-    * @brief Creates the output or view projection.
-    * @note All chains should be constructed prior to calling this.
-    */
-   void createOutputProjection();
-   
-   /**
-    * @brief Sets the single image chain for identity operations view to
-    * a ossimImageViewAffineTransform.  This will have a rotation if
-    * up is up is selected.  Also set m_outputProjection to the input's
-    * for area of interest.
-    */
-   void createIdentityProjection();
-
-   /**
-    * @brief Gets the first input projection.
-    *
-    * This gets the output projection of the first dem layer if present;
-    * if not, the first image layer.
-    * 
-    * @return ref ptr to projection, could be null.
-    */
-   ossimRefPtr<ossimMapProjection> getFirstInputProjection();
-
-   /**
-    * @brief Convenience method to get geographic projection.
-    * @return new ossimEquDistCylProjection.
-    */
-   ossimRefPtr<ossimMapProjection> getNewGeoProjection();
-
-   /**
-    * @brief Convenience method to get geographic projection.
-    *
-    * This method sets the origin to the center of the scene bounding rect
-    * of all layers.
-    * @return new ossimEquDistCylProjection.
-    */
-   ossimRefPtr<ossimMapProjection> getNewGeoScaledProjection();
-
-    /**
-    * @brief Convenience method to get a projection from an srs code.
-    * @return new ossimMapProjection.
-    */  
-   ossimRefPtr<ossimMapProjection> getNewProjectionFromSrsCode(
-      const std::string& code );
-
-   /**
-    * @brief Convenience method to get a utm projection.
-    * @return new ossimUtmProjection.
-    */     
-   ossimRefPtr<ossimMapProjection> getNewUtmProjection();
-
-   /**
-    * @brief Convenience method to get a pointer to the  output map
-    * projection.
-    *
-    * Callers should check for valid() as the pointer could be
-    * 0 if not initialized.
-    * 
-    * @returns The ossimMapProjection* from the m_outputGeometry as a ref
-    * pointer.
-    */
-   ossimRefPtr<ossimMapProjection> getMapProjection();
-
-   /**
-    * @brief Sets the projection tie point to the scene bounding rect corner.
-    * @note Throws ossimException on error.
-    */
-   void intiailizeProjectionTiePoint();
-
-   /**
-    * @brief Initializes the projection gsd.
-    *
-    * This loops through all chains to find the best resolution gsd.
-    *
-    * @note Throws ossimException on error.
-    */
-   void initializeProjectionGsd();   
-
-   /**
-    * @brief Initializes the image view transform(IVT) scale.
-    *
-    * Chip mode only. Sets IVT scale to output / input.
-    * 
-    * @note Throws ossimException on error.
-    */
-   void initializeIvtScale();   
-
-   /**
-    * @brief Loops through all layers to get the upper left tie point.
-    * @param tie Point to initialize.
-    */
-   void getTiePoint(ossimGpt& tie);
-
-   /**
-    * @brief Gets the upper left tie point from a chain.
-    * @param chain The chain to get tie point from.
-    * @param tie Point to initialize.
-    * @note Throws ossimException on error.
-    */
-   void getTiePoint(ossimSingleImageChain* chain, ossimGpt& tie);
-
-   /**
-    * @brief Loops through all layers to get the upper left tie point.
-    * @param tie Point to initialize.
-    */
-   void getTiePoint(ossimDpt& tie);
-
-   /**
-    * @brief Gets the upper left tie point from a chain.
-    * @param chain The chain to get tie point from.
-    * @param tie Point to initialize.
-    * @note Throws ossimException on error.
-    */
-   void getTiePoint(ossimSingleImageChain* chain, ossimDpt& tie);
-
-   /**
-    * @brief Loops through all layers to get the best gsd.
-    * @param gsd Point to initialize.
-    */
-   void getMetersPerPixel(ossimDpt& gsd);
-
-   /**
-    * @brief Gets the gsd from a chain.
-    * @param chain The chain to get gsd from.
-    * @param gsd Point to initialize.
-    * @note Throws ossimException on error.
-    */   
-   void getMetersPerPixel(ossimSingleImageChain* chain, ossimDpt& gsd);
-
-   /**
-    * @brief Gets value of key "central_meridan" if set, nan if not.
-    *
-    * @return Value as a double or nan if keyord is not set.
-    * 
-    * @note Throws ossimException on range error.
-    */
-   ossim_float64 getCentralMeridian() const;
-
-   /**
-    * @brief Gets value of key "origin_latitude" if set, nan if not.
-    *
-    * @return Value as a double or nan if keyord is not set.
-    * 
-    * @note Throws ossimException on range error.
-    */
-   ossim_float64 getOriginLatitude() const;
-
-   /**
-    * @brief Loops through all layers to get the scene center ground point.
-    * @param gpt Point to initialize.
-    * @note Throws ossimException on error.
-    */
-   void getSceneCenter(ossimGpt& gpt);
-
-   /**
-    * @brief Gets the scene center from a chain.
-    * @param chain The chain to get scene center from.
-    * @param gpt Point to initialize.
-    * @note Throws ossimException on error.
-    */   
-   void getSceneCenter(ossimSingleImageChain* chain, ossimGpt& gpt);
-
-   /**
-    * @brief Creates a new writer.
-    *
-    * This will use the writer option (-w or --writer), if present; else,
-    * it will be derived from the output file extention.
-    *
-    * This will also set any writer properties passed in.
-    *
-    * @return new ossimImageFileWriter.
-    * @note Throws ossimException on error.
-    */
-   ossimRefPtr<ossimImageFileWriter> createNewWriter() const;
-
-   /**
-    * @brief loops through all chains and sets the output projection.
-    * @note Throws ossimException on error.
-    */
-   void propagateOutputProjectionToChains();
-
-   /**
-    * @brief Combines all layers into an ossimImageMosaic.
-    * @return ossimRefPtr with pointer to ossimImageSource.  Can be null.
-    */
-   ossimRefPtr<ossimImageSource> combineLayers(
-      std::vector< ossimRefPtr<ossimSingleImageChain> >& layers) const;
-
-   /** @brief Combines dems(m_demLayer) and images(m_imgLayer). */
-   ossimRefPtr<ossimImageSource> combineLayers();
-
-   /**
-    * @brief Creates ossimIndexToRgbLutFilter and connects to source.
-    * @param Source to connect to.
-    * @return End of chain with lut filter on it.
-    * @note Throws ossimException on error.
-    */
-   ossimRefPtr<ossimImageSource> addIndexToRgbLutFilter(
-      ossimRefPtr<ossimImageSource> &source) const;
-
-   /**
-    * @brief Creates ossimScalarRemapper and connects to source.
-    * @param Source to connect to.
-    * @param scalar Scalar type.
-    * @return End of chain with remapper on it.
-    * @note Throws ossimException on error.
-    */
-   ossimRefPtr<ossimImageSource> addScalarRemapper(
-      ossimRefPtr<ossimImageSource> &source,
-      ossimScalarType scalar) const;
-
-   /**
-    * @brief Set up ossimHistogramRemapper for a chain.
-    * @param chain Chain to set up.
-    * @return true on success, false on error.
-    */
-   bool setupChainHistogram( ossimRefPtr<ossimSingleImageChain>& chain) const;
-
-   /**
-    * @brief Sets entry for a chain.
-    * @param chain Chain to set up.
-    * @param entryIndex Zero based index.
-    * @return true on success, false on error.
-    */
-   bool setChainEntry( ossimRefPtr<ossimSingleImageChain>& chain,
-                       ossim_uint32 entryIndex ) const;
-
-   /**
-    * @brief Initializes "rect" with the output area of interest.
-    *
-    * Initialization will either come from user defined cut options or the
-    * source bounding rect with user options taking precidence.
-    *
-    * @param source Should be the end of the processing chain.
-    * @param rect Rectangle to initialize.  This is in output (view) space.
-    *
-    * @note Throws ossimException on error.
-    */
-   void getAreaOfInterest( ossimImageSource* source, ossimIrect& rect ) const;
-
-   /**
-    * @brief Method to calculate and initialize scale and area of interest
-    * for making a thumbnail.
-    *
-    * Sets the scale of the output projection so that the adjusted rectangle
-    * meets the cut rect and demension requirements set in options.
-    *
-    * @param originalRect Original scene area of interest.
-    * @param adjustedRect New rect for thumbnail.
-    *
-    * @note Throws ossimException on error.
-    */
-   void initializeThumbnailProjection(const ossimIrect& originalRect,
-                                      ossimIrect& adjustedRect);
-
-   /** @return true if BANDS keyword is set; false, if not. */
-   bool hasBandSelection() const;
-
-   /**
-    * @brief Gets the band list if BANDS keyword is set.
-    *
-    * NOTE: BANDS keyword values are ONE based.  bandList values are
-    * ZERO based.
-    *
-    * @param bandList List initialized by this.
-    */
-   void getBandList( std::vector<ossim_uint32>& bandList ) const;
-
-   /** @return true if color table (lut) is set; false, if not. */
-   bool hasLutFile() const;
-
-   /** @return true if brightness or contrast option is set; false, if not. */
-   bool hasBrightnesContrastOperation() const;
-
-   /** @return true if any Geo Poly cutter option is set */
-   bool hasGeoPolyCutterOption()const;
-   
-   /**
-    * @return true if any bump share options have been set by user; false,
-    * if not.
-    */
-   bool hasBumpShadeArg() const;
-
-   /** @return true if thumbnail option is set; false, if not. */
-   bool hasThumbnailResolution() const;
-
-   /** @return true if histogram option is set; false, if not. */
-   bool hasHistogramOperation() const;
-
-   /** @return true if file extension is "hgt", "dem" or contains "dtN" (dted). */
-   bool isDemFile(const ossimFilename& file) const;
-
-   /** @return true if file extension is "src" */
-   bool isSrcFile(const ossimFilename& file) const;
-
-   /** @brief Initializes m_srcKwl if option was set. */
-   void initializeSrcKwl();
-
-   /**
-    * @return The number of DEM_KW and IMG_KW found in the m_kwl and m_srcKwl
-    * keyword list.
-    */
-   ossim_uint32 getNumberOfInputs() const;
-
-   /**
-    * @brief Gets the emumerated output projection type.
-    *
-    * This looks in m_kwl for ossimKeywordNames::PROJECTION_KW.
-    * @return The enumerated output projection type.
-    * @note This does not cover SRS keyword which could be any type of projection.
-    */
-   ossimChipperOutputProjection getOutputProjectionType() const;
-
-   /**
-    * @brief Returns the scalar type from OUTPUT_RADIOMETRY_KW keyword if
-    * present. Deprecated SCALE_2_8_BIT_KW is also checked.
-    *
-    * @return ossimScalarType Note this can be OSSIM_SCALAR_UNKNOWN if the
-    * keywords are not present.
-    */
-   ossimScalarType getOutputScalarType() const;
-
-   /** @return true if scale to eight bit option is set; false, if not. */
-   bool scaleToEightBit() const;
-
-   /** @return true if snap tie to origin option is set; false, if not. */
-   bool snapTieToOrigin() const;
-
-   /**
-    * @brief Gets the image space scale.
-    *
-    * This is a "chip" operation only.
-    *
-    * Keys: 
-    * IMAGE_SPACE_SCALE_X_KW
-    * IMAGE_SPACE_SCALE_Y_KW
-    *
-    * Scale will be 1.0, 1.0 if keys not found. 
-    */
-   void getImageSpaceScale( ossimDpt& imageSpaceScale ) const;
-   
-   /**
-    * @brief Gets rotation.
-    *
-    * @return Rotation in decimal degrees if ROTATION_KW option is set;
-    * ossim::nan, if not.
-    *
-    * @note Throws ossimException on range error.
-    */
-   ossim_float64 getRotation() const;
-
-   /** @return true if ROTATION_KW option is set; false, if not. */
-   bool hasRotation() const;
-
-   /** @return true if UP_IS_UP_KW option is set; false, if not. */
-   bool upIsUp() const;
-
-   /** @return true if NORTH_UP_KW option is set; false, if not. */
-   bool northUp() const;
-
-   /** @return true if operation is "chip" or identity; false, if not. */
-   bool isIdentity() const;
-
-   /** @return true if key is set to true; false, if not. */
-   bool keyIsTrue( const std::string& key ) const;
-
-   /**
-    * @return The entry number if set.  Zero if ossimKeywordNames::ENTRY_KW not
-    * found.
-    */
-   ossim_uint32 getEntryNumber() const;
-
-   /**
-    * @return The zone if set.  Zero if ossimKeywordNames::ZONE_KW not
-    * found.
-    */
-   ossim_int32 getZone() const;
-
-   /**
-    * @return The hemisphere if set. Empty string if
-    * ossimKeywordNames::HEMISPHERE_KW not found.
-    */
-   std::string getHemisphere() const;
-
-   /**
-    * @return True if any input has a sensor model input, false if all input
-    * projections are map projections.
-    */
-   bool hasSensorModelInput();
-
-   /**
-    * @return true if all size cut box width height keywords are true.
-    */
-   bool hasCutBoxWidthHeight() const;
-
-   /**
-   *  @return true if the WMS style cut and the width and height keywords are set
-   */
-   bool hasWmsBboxCutWidthHeight() const;
-
-   /**
-    * @return true if meters, degrees or cut box with width and height option.
-    */  
-   bool hasScaleOption() const;
-   
-   /**
-    * @return true if three band out is true, false if not.
-    */  
-   bool isThreeBandOut() const;
-
-   /**
-    * @return true if pad thumbnail is true, false if not.
-    */  
-   bool padThumbnail() const;
-
-   /**
-    * @brief Passes reader properties to single image handler if any.
-    * @param ih Image handler to set properties on.
-    */
-   void setReaderProps( ossimImageHandler* ih ) const;
-   
-   /**
-    * @brief Adds application arguments to the argument parser.
-    * @param ap Parser to add to.
-    */
-   void addArguments(ossimArgumentParser& ap);
-
-   void getClipPolygon(ossimGeoPolygon& polygon)const;
-   /**
-    * @brief Gets the brightness level.
-    * 
-    * This will return 0.0 if the keyword is not found or if the range check
-    * is not between -1.0 and 1.0.
-    *
-    * @return brightness
-    */
-   ossim_float64 getBrightness() const;
-
-   /**
-    * @brief Gets the contrast level.
-    * 
-    * This will return 1.0 if the keyword is not found or if the range check
-    * is not between 0.0 and 20.0.
-    *
-    * @return brightness
-    */   
-   ossim_float64 getContrast() const;
-
-   /**
-    * @brief Gets the sharpen mode.
-    *
-    * Valid modes: light, heavy
-    * 
-    * @return sharpness mode
-    */   
-   std::string getSharpenMode() const;
-
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-
-   /** @brief Hidden from use copy constructor. */
-   ossimChipperUtil( const ossimChipperUtil& obj );
-
-   /** @brief Hidden from use assignment operator. */
-   const ossimChipperUtil& operator=( const ossimChipperUtil& rhs );
-
-   ossimRefPtr<ossimImageSource> createCombiner()const;
-
-   /** Enumerated operation to perform. */
-   ossimChipperOperation m_operation;
-   
-   /** Hold all options passed into intialize. */
-   ossimRefPtr<ossimKeywordlist> m_kwl;
-
-   /** Hold contents of src file if --src is used. */
-   ossimRefPtr<ossimKeywordlist> m_srcKwl;
-
-   /**
-    * The image geometry.  In chip mode this will be from the input image. So
-    * this may or may not have a map projection. In any other mode it
-    * will the view or output geometry which will be a map projection.
-    */
-   ossimRefPtr<ossimImageGeometry> m_geom;
-
-   /**
-    * Image view transform(IVT). Only set/used in "chip"(identity) operation as
-    * the IVT for the resampler(ossimImageRenderer).
-    */
-   ossimRefPtr<ossimImageViewAffineTransform> m_ivt;
-
-   /**  Array of dem chains. */
-   std::vector< ossimRefPtr<ossimSingleImageChain> > m_demLayer;
-
-   /**  Array of image source chains. */
-   std::vector< ossimRefPtr<ossimSingleImageChain> > m_imgLayer;
-   
-   /**
-    *  We need access to the writer so we can support aborting
-    */
-   mutable ossimRefPtr<ossimImageFileWriter> m_writer;
-
-   /**
-   * We need to support changing clips without doing a full initilization.  
-   * we will save the ImageSource pointer on first initialization
-   */
-    ossimRefPtr<ossimImageSource> m_source;
-
-};
-
-#endif /* #ifndef ossimChipperUtil_HEADER */
-
diff --git a/ossim/include/ossim/util/ossimFileWalker.h b/ossim/include/ossim/util/ossimFileWalker.h
deleted file mode 100644
index 35697c1..0000000
--- a/ossim/include/ossim/util/ossimFileWalker.h
+++ /dev/null
@@ -1,223 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimFileWalker.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  See description for class below.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimFileWalker_HEADER
-#define ossimFileWalker_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/parallel/ossimJob.h>
-#include <ossim/parallel/ossimJobMultiThreadQueue.h>
-#include <OpenThreads/Mutex>
-#include <string>
-#include <vector>
-
-class ossimFilename;
-class ossimFileProcessorInterface;
-
-/**
- * @class ossimFileWalker
- *
- * Utility class to walk through directories and get a list of files to
- * process. For each file found the ossimFileProcessorInterface::processFile
- * method is excecuted.  Internally the processFile calls are placed in a job
- * queue.
- *
- * Typical usage (snip from ossimTiledElevationDatabase):
- *
- * ossimFileWalker* fw = new ossimFileWalker();
- * fw->initializeDefaultFilterList();
- * fw->setFileProcessor( this ); 
- * fw->walk(f);
- */
-class OSSIM_DLL ossimFileWalker
-{
-public:
-   
-   /** default constructor */
-   ossimFileWalker();
-
-   /** destructor */
-   ~ossimFileWalker();
-
-   /**
-    * @brief Takes an array of files.
-    *
-    * For each file in array:  If files is a directory, it will walk it. Files
-    * found in walk or files(not directories) in the array will be processed
-    * via a job queue.
-    *
-    * Files are filter prior to the callback execution.  The filtering is to
-    * eliminate sending unwanted files to the callback.  There is a default
-    * filter table.  This can be edited by calling the non-const
-    * getFilteredExtensions method.
-    *
-    * Each callback is placed in a threaded job queue.  So users should ensure
-    * their callback is thread safe.
-    */
-   void walk(const std::vector<ossimFilename>& files);
-
-   /**
-    * @brief This will walk "root" and execute a callback for each file found.
-    *
-    * Files are filter prior to the callback execution.  The filtering is to
-    * eliminate sending unwanted files to the callback.  There is a default
-    * filter table.  This can be edited by calling the non-const
-    * getFilteredExtensions method.
-    *
-    * Each callback is placed in a threaded job queue.  So users should ensure
-    * their callback is thread safe.
-    */
-   void walk(const ossimFilename& root);
-
-   /**
-    * @brief Sets ossimFileProcessorInterfacecallback method to process files.
-    *
-    * @param fpi ossimFileProcessorInterface pointer
-    */   
-   void setFileProcessor(ossimFileProcessorInterface* fpi);
-
-   /** @return The list of filtered out files. */
-   const std::vector<std::string>& getFilteredExtensions() const;
-
-   /**
-    * @brief Non const method to allow access for
-    * adding or deleting extensions from the list.
-    *
-    * The list is used by the private isFiltered method to avoid trying to
-    * process unwanted files.
-    */
-   std::vector<std::string>& getFilteredExtensions();
-
-   /** @brief Dumps filtered image extenstions to std out. */
-   void dumpFilteredExtensionList() const;
-
-   /**
-    * @brief Initializes the filter list with a default set of filtered out
-    * file names.
-    */
-   void initializeDefaultFilterList();
-
-   /**
-    * @brief Sets recurse flag.
-    *
-    * If set to true this stops recursing of the
-    * current directory.  Defaulted to true in the constructor.
-    * Typically used to indicate the directory being processed holds a
-    * directory based image, e.g. RPF data.
-    *
-    * @param flag True to recurse, false to stop recursion of current
-    * directory.
-    */
-   void setRecurseFlag(bool flag);
-
-   /**
-    * @brief Sets waitOnDir flag.
-    *
-    * If set to true each directory is processed in entirety before sub
-    * directories are recursed.  This allows callers of setRecurseFlag
-    * to disable directory walking.  If your code is calling setRecurseFlag
-    * this flag should be set to true.
-    *
-    * @param flag true to wait, false to not wait. Defaulted to false in the constructor. 
-    */   
-   void setWaitOnDirFlag(bool flag);
-
-   /**
-    * @brief If set to true this stops files walking (aborts).
-    * @param flag True to abort current "walk".
-    */
-   void setAbortFlag(bool flag);
-
-   /** @brief Sets the max number of threads(jobs) to run at one time. */
-   void setNumberOfThreads(ossim_uint32 nThreads);
-   
-private:
-
-   /** @brief Private ossimJob class. */
-   class ossimFileWalkerJob : public ossimJob
-   {
-   public:
-      /**
-       * @brief Constructor that takes file processor pointer and file.
-       * @param fpi ossimFileProcessorInterface pointer
-       * @param file The file to process.
-       */
-      ossimFileWalkerJob(ossimFileProcessorInterface* fpi,
-                         const ossimFilename& file);
-      /**
-       * @brief Defines pure virtual ossimJob::start.
-       *
-       * This executes the call to m_processFileCallBackPtr.
-       */
-      virtual void start();
-      
-   private:
-      ossimFileProcessorInterface* m_fileProcessor;
-      ossimFilename                m_file;
-      
-   }; // End: class ossimFileWalkerJob
-
-   /** @brief Private ossimJobCallback class. */
-   class ossimFileWalkerJobCallback : public ossimJobCallback
-   {
-   public:
-      ossimFileWalkerJobCallback();
-      virtual void started(ossimJob* job);
-      virtual void finished(ossimJob* job);
-      virtual void canceled(ossimJob* job);
-   };
-
-   /**
-    * @brief Processes files in directory.
-    *
-    * If a file in the directory is itself a directory this will do a recursive
-    * call to itself.  Individual files are processed in a job queue...
-    */
-   void walkDir(const ossimFilename& dir);
-   
-   /**
-    * @brief Convenience method for file walker code to check file to see is
-    * it should be processed.
-    *
-    * @param f File to check.
-    * 
-    * @return true if f is in filter list, false if not.
-    */
-   bool isFiltered(const ossimFilename& f) const;
-   
-   /**
-    * @brief isDotFile method.
-    * @param f File/directory to check.
-    * @return true if file is a dot file.
-    */   
-   bool isDotFile(const ossimFilename& f) const;
-   
-   /**
-    * @brief Callback to method to process a file.
-    *
-    * @param const ossimFilename& First parameter(argument) file to process.
-    */
-   ossimFileProcessorInterface*          m_fileProcessor;
-   ossimRefPtr<ossimJobMultiThreadQueue> m_jobQueue;
-   std::vector<std::string>              m_filteredExtensions;
-   bool                                  m_recurseFlag;
-   bool                                  m_waitOnDirFlag;
-   bool                                  m_abortFlag;
-   OpenThreads::Mutex                    m_mutex;
-};
-
-#endif /* #ifndef ossimFileWalker_HEADER */
-
diff --git a/ossim/include/ossim/util/ossimHLZUtil.h b/ossim/include/ossim/util/ossimHLZUtil.h
deleted file mode 100644
index 0e6cdb9..0000000
--- a/ossim/include/ossim/util/ossimHLZUtil.h
+++ /dev/null
@@ -1,182 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Oscar Kramer
-//
-//*************************************************************************
-// $Id: ossimHLZUtil.h 23465 2015-08-13 13:36:26Z okramer $
-
-#ifndef ossimHLZUtil_HEADER
-#define ossimHLZUtil_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimLeastSquaresPlane.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/parallel/ossimJob.h>
-#include <ossim/parallel/ossimJobMultiThreadQueue.h>
-#include <ossim/point_cloud/ossimPointCloudHandler.h>
-#include <OpenThreads/ReadWriteMutex>
-#include <vector>
-
-/*!
- *  Class for finding helicopter landing zones (HLZ) on a DEM given the final destination and max
- *  range from destination.
- */
-class OSSIMDLLEXPORT ossimHLZUtil : public ossimObject,
-                                    public ossimProcessInterface,
-                                    public ossimListenerManager
-{
-public:
-   ossimHLZUtil();
-   ~ossimHLZUtil();
-
-   /**
-    * Initializes from command line arguments.
-    */
-   bool parseCommand(ossimArgumentParser& ap);
-
-   /*
-    * Initializes after parameter set-methods have been called (in lieu of argument parser init)
-    */
-   bool initialize();
-
-   void setAoiRadius(const double& meters) { m_aoiRadius = meters; }
-   void setDestinationGpt(const ossimGpt& dest) { m_destinationGpt = dest; }
-   void setRoughnessThreshold(const double& meters) { m_roughnessThreshold = meters; }
-   void setSlopeThreshold(const double& degrees) { m_slopeThreshold = degrees; }
-   void setLZRadiusThreshold(const double& meters) { m_hlzMinRadius = meters; }
-   void setProductGSD(const double& meters_per_pixel);
-   void setOutputFileName(const ossimFilename& fname) { m_productFile = fname; }
-
-   /**
-    * Returns true if successful
-    */
-   virtual bool execute();
-
-   virtual ossimObject* getObject() { return this; }
-   virtual const ossimObject* getObject() const  { return this; }
-   virtual ossimListenerManager* getManager()  { return this; };
-
-   void printApiJson(ostream& out) const;
-
-protected:
-   class MaskSource
-   {
-   public:
-      MaskSource(ossimHLZUtil* hlzUtil, ossimKeywordlist& kwl, ossim_uint32 index);
-      MaskSource(ossimHLZUtil* hlzUtil, const ossimFilename& mask_image);
-      ossimRefPtr<ossimImageSource> image;
-      bool exclude;
-      bool valid;
-   };
-
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-   void addArguments(ossimArgumentParser& ap);
-   bool loadDemFile();
-   bool loadPcFile();
-   bool loadMaskFiles();
-   bool initProcessingChain();
-   bool initHlzFilter();
-   bool writeFile();
-   void dumpProductSummary() const;
-   void paintReticle();
-   void createInputChain(ossimRefPtr<ossimImageHandler>& handler,
-                         ossimRefPtr<ossimImageSource>& chain);
-   void writeSlopeImage();
-
-   ossimGpt m_destinationGpt;
-   double m_slopeThreshold; // (degrees)
-   double m_roughnessThreshold; // peak deviation from plane (meters)
-   double m_hlzMinRadius; // meters
-   ossimFilename m_demFile;
-   ossimFilename m_pcFile; // optional level-2 point-cloud file
-   ossimFilename m_maskFile; // optional mask specification (may be KWL file with multiple masks)
-   ossimFilename m_slopeFile; // optional byproduct output
-   double m_aoiRadius; // meters
-   ossimRefPtr<ossimImageGeometry> m_productGeom;
-   ossimIrect m_demRect; // rect (in raster coordinates) of the input dem for AOI
-   ossimIrect m_viewRect; // rect (in raster coordinates) of output image.
-   ossimGrect m_gndRect;
-   ossimIpt m_demFilterSize;
-   ossimRefPtr<ossimImageData> m_demBuffer;
-   ossimRefPtr<ossimImageData> m_outBuffer;
-   double m_gsd;
-   ossimDpt m_demGsd;
-   ossimFilename m_productFile;
-   ossim_int32 m_reticleSize;
-   ossimFilename m_lutFile;
-   ossimRefPtr<ossimJobMultiThreadQueue> m_jobMtQueue;
-   bool m_outputSummary;
-   ossim_uint32 m_jobCount;
-
-   ossim_uint8 m_badLzValue;
-   ossim_uint8 m_marginalLzValue;
-   ossim_uint8 m_goodLzValue;
-   ossim_uint8 m_reticleValue;
-   bool m_useLsFitMethod;
-   ossimRefPtr<ossimImageSource> m_combinedElevSource;
-   std::vector< ossimRefPtr<ossimPointCloudHandler> > m_pcSources;
-   OpenThreads::Mutex m_chainMutex;
-   std::vector<MaskSource> m_maskSources;
-
-   // For debugging:
-   ossim_uint32 m_numThreads;
-   double d_accumT;
-
-   class ChipProcessorJob : public ossimJob
-   {
-   public:
-      ChipProcessorJob(ossimHLZUtil* hlzUtil, const ossimIpt& origin, ossim_uint32 chip_id=0);
-
-      virtual void start();
-      virtual bool level1Test() = 0;
-      bool level2Test();
-      bool maskTest();
-
-      ossimHLZUtil* m_hlzUtil;
-      ossimIpt m_demChipUL;
-      ossimIpt m_demChipLR;
-      ossim_uint8 m_status;
-      float m_nullValue;
-
-      // ossim_uint32 m_chipId; // for debug
-      static OpenThreads::ReadWriteMutex m_bufMutex;
-   };
-
-   class LsFitChipProcessorJob : public ChipProcessorJob
-   {
-   public:
-      LsFitChipProcessorJob(ossimHLZUtil* hlzUtil, const ossimIpt& origin, ossim_uint32 chip_id=0)
-         : ChipProcessorJob(hlzUtil, origin, chip_id),
-           m_plane (new ossimLeastSquaresPlane) {}
-
-      ~LsFitChipProcessorJob() { delete m_plane; }
-      virtual bool level1Test();
-      ossimLeastSquaresPlane* m_plane;
-   };
-
-   class NormChipProcessorJob : public ChipProcessorJob
-   {
-   public:
-      NormChipProcessorJob(ossimHLZUtil* hlzUtil, const ossimIpt& origin, ossim_uint32 chip_id=0)
-         : ChipProcessorJob(hlzUtil, origin, chip_id) {}
-
-      virtual bool level1Test();
-   };
-
-};
-
-#endif
diff --git a/ossim/include/ossim/util/ossimImageUtil.h b/ossim/include/ossim/util/ossimImageUtil.h
deleted file mode 100644
index 43f726f..0000000
--- a/ossim/include/ossim/util/ossimImageUtil.h
+++ /dev/null
@@ -1,504 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimImageUtil.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ossimImageUtil
-//
-// See class descriptions below for more.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimImageUtil_HEADER
-#define ossimImageUtil_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFileProcessorInterface.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimOverviewBuilderBase.h>
-#include <OpenThreads/Mutex>
-#include <ostream>
-#include <vector>
-
-class ossimArgumentParser;
-class ossimFileWalker;
-class ossimGpt;
-class ossimPropertyInterface;
-class ossimApplicationUsage;
-/**
- * @brief ossimImageUtil class.
- *
- * Utility class for processing image recursively.  This is for doing things like:
- * 
- * building overview, histograms, compute min/max, extract vertices.
- */
-class OSSIM_DLL ossimImageUtil :
-   public ossimReferenced, public ossimFileProcessorInterface
-{
-public:
-
-   /** default constructor */
-   ossimImageUtil();
-
-   /** virtual destructor */
-   virtual ~ossimImageUtil();
-
-   void addOptions(ossimApplicationUsage* au);
-   /**
-    * @brief Adds application arguments to the argument parser.
-    * @param ap Parser to add to.
-    */
-   void addArguments(ossimArgumentParser& ap);
-
-   /**
-    * @brief Initial method.
-    *
-    * Typically called from application prior to execute.  This parses
-    * all options and put in keyword list m_kwl.
-    * 
-    * @param ap Arg parser to initialize from.
-    *
-    * @return true, indicating process should continue with execute.
-    */
-   bool initialize(ossimArgumentParser& ap);
-
-   /**
-    * @brief Execute method.
-    *
-    * This launches file walking mechanism.
-    *
-    * @return int, 0 = good, non-zero something happened.  Because this can
-    * process multiple files a non-zero return may indicate just one file
-    * did not complete, e.g. building overviews.
-    * 
-    * @note Throws ossimException on error.
-    */
-   ossim_int32 execute();
-
-   /**
-    * @brief ProcessFile method.
-    *
-    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
-    *
-    * This method is linked to the ossimFileWalker::walk method via a callback
-    * mechanism.  It is called by the ossimFileWalk (caller).  In turn this
-    * class (callee) calls ossimFileWalker::setRecurseFlag and
-    * ossimFileWalker::setAbortFlag to control the waking process.
-    * 
-    * @param file to process.
-    */
-   virtual void processFile(const ossimFilename& file);
-
-   /**
-    * @brief Sets create overviews flag keyword CREATE_OVERVIEWS_KW used by
-    * processFile method.
-    *
-    * @param flag If true overview will be created if image does not already
-    * have the required or if the REBUILD_OVERVIEWS_KW is set.
-    *
-    * @note Number of required overviews is controlled by the ossim preferences
-    * keyword overview_stop_dimension.
-    */
-   void setCreateOverviewsFlag( bool flag );
-
-   /** @return true if CREATE_OVERVIEWS_KW is found and set to true. */
-   bool createOverviews() const;
-   
-   /**
-    * @brief Sets the rebuild overview flag keyword REBUILD_OVERVIEWS_KW used by
-    * processFile method.
-    *
-    * @param flag If true forces a rebuild of overviews even if image has
-    * required number of reduced resolution data sets.
-    *
-    * @note Number of required overviews is controlled by the ossim preferences
-    * keyword overview_stop_dimension.
-    */
-   void setRebuildOverviewsFlag( bool flag );
-
-   /** @return true if REBUILD_OVERVIEWS_KW is found and set to true. */
-   bool rebuildOverviews() const;
-
-   /**
-    * @brief Sets the rebuild histogram flag keyword REBUILD_HISTOGRAM_KW used by
-    * processFile method.
-    *
-    * @param flag If true forces a rebuild of histogram even if image has one already.
-    */
-   void setRebuildHistogramFlag( bool flag );
-
-   /** @return true if REBUILD_HISTOGRAM_KW is found and set to true. */
-   bool rebuildHistogram() const;
-
-   /**
-    * @brief Sets key OVERVIEW_TYPE_KW.
-    *
-    * Available types depens on plugins.  Know types:
-    * ossim_tiff_box ( defualt )
-    * ossim_tiff_nearest
-    * ossim_kakadu_nitf_j2k ( kakadu plugin )
-    * gdal_tiff_nearest	    ( gdal plugin )
-    * gdal_tiff_average	    ( gdal plugin )
-    * gdal_hfa_nearest      ( gdal plugin )	
-    * gdal_hfa_average      ( gdal plugin )	
-    * 
-    * @param type One of the above.
-    */
-   void setOverviewType( const std::string& type );
-   
-   /**
-    * @brief sets the overview stop dimension.
-    *
-    * The overview builder will decimate the image until both dimensions are
-    * at or below this dimension.
-    *
-    * @param dimension
-    *
-    * @note Recommend a power of 2 value, i.e. 8, 16, 32 and so on.
-    */
-   void setOverviewStopDimension( ossim_uint32 dimension );
-   void setOverviewStopDimension( const std::string& dimension );
-
-   /**
-    * @brief Sets the tile size.
-    *
-    * @param tileSize
-    *
-    * @note Must be a multiple of 16, i.e. 64, 128, 256 and so on.
-    */
-   void setTileSize( ossim_uint32 tileSize );
-
-   /**
-    * @return Overview stop dimension or 0 if OVERVIEW_STOP_DIM_KW is not
-    * found.
-    */
-   ossim_uint32 getOverviewStopDimension() const;
-
-   /**
-    * @brief Sets create histogram flag keyword CREATE_HISTOGRAM_KW used by
-    * processFile method.
-    *
-    * @param flag If true a full histogram will be created.
-    */
-   void setCreateHistogramFlag( bool flag );
-   
-   /** @return true if CREATE_HISTOGRAM_KW is found and set to true. */
-   bool createHistogram() const;
-
-   /**
-    * @brief Sets create histogram flag keyword CREATE_HISTOGRAM_FAST_KW used by
-    * processFile method.
-    *
-    * @param flag If true a histogram will be created in fast mode.
-    */
-   void setCreateHistogramFastFlag( bool flag );
-
-   /** @return true if CREATE_HISTOGRAM_FAST_KW is found and set to true. */
-   bool createHistogramFast() const;
-
-   /**
-    * @brief Sets create histogram "R0" flag keyword CREATE_HISTOGRAM_R0_KW used by
-    * processFile method.
-    *
-    * @param flag If true a histogram will be created from R0.
-    */
-   void setCreateHistogramR0Flag( bool flag );
-
-   /** @return true if CREATE_HISTOGRAM_R0_KW is found and set to true. */
-   bool createHistogramR0() const;
-
-   /** @return true if any of the histogram options are set. */
-   bool hasHistogramOption() const;
-
-   /** @return Histogram mode or OSSIM_HISTO_MODE_UNKNOWN if not set. */
-   ossimHistogramMode getHistogramMode() const;
-
-   /**
-    * @brief Sets scan for min/max flag keyword SCAN_MIN_MAX_KW used by
-    * processFile method.
-    *
-    * @param flag If true a file will be scanned for min/max and a file.omd
-    * will be written out.
-    */
-   void setScanForMinMax( bool flag );
-   
-   /** @return true if SCAN_MIN_MAX_KW is found and set to true. */
-   bool scanForMinMax() const;
-
-   /**
-    * @brief Sets scan for min/max/null flag keyword SCAN_MIN_MAX_KW used by
-    * processFile method.
-    *
-    * @param flag If true a file will be scanned for min/max/null and a file.omd
-    * will be written out.
-    */
-   void setScanForMinMaxNull( bool flag );
-
-   /** @return true if SCAN_MIN_MAX_NULL_KW is found and set to true. */
-   bool scanForMinMaxNull() const;
-
-   /**
-    * @brief Sets the writer property for compression quality.
-    *
-    * @param quality For TIFF JPEG takes values from 1
-    * to 100, where 100 is best.  For J2K plugin (if available),
-    * numerically_lossless, visually_lossless, lossy.
-    */
-   void setCompressionQuality( const std::string& quality );
-
-   /**
-    * @brief Sets the compression type to use when building overviews.
-    *  
-    * @param compression_type Current supported types:
-    * - deflate 
-    * - jpeg
-    * - lzw
-    * - none
-    * - packbits
-    */
-   void setCompressionType( const std::string& type );
-
-   /**
-    * @brief Sets the overview builder copy all flag.
-    * @param flag
-    */
-   void setCopyAllFlag( bool flag );
-
-   /**
-    * @return true if COPY_ALL_FLAG_KW key is found and value is true; else,
-    * false.
-    */
-   bool getCopyAllFlag() const;
-
-   /**
-    * @brief Sets the dump filteredImageList flag.
-    * @param flag
-    */
-   void setDumpFilteredImageListFlag( bool flag );
-
-   /**
-    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
-    * false.
-    * 
-    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
-    */
-   bool getDumpFilterImagesFlag() const;
-
-   /**
-    * @brief Sets the overview builder internal overviews flag.
-    * @param flag
-    */
-   void setInternalOverviewsFlag( bool flag );
-
-   /**
-    * @return true if INTERNAL_OVERVIEWS_FLAG_KW key is found and value is true; else,
-    * false.
-    */
-   bool getInternalOverviewsFlag() const;
-   
-   /**
-    * @brief Sets the output directory.  Typically overviews and histograms
-    * are placed parallel to image file.  This overrides.
-    *  
-    * @param directory
-    */
-   void setOutputDirectory( const std::string& directory );
- 
-   /**
-    * @brief Sets the output file name flag OUTPUT_FILENAMES_KW.
-    *
-    * If set to true all files that we can successfully open will be output.
-    *  
-    * @param flag
-    */
-   void setOutputFileNamesFlag( bool flag );
-
-   /**
-    * @return true if OUTPUT_FILENAMES_KW key is found and value is true; else,
-    * false.
-    */
-   bool getOutputFileNamesFlag() const;
-
-   /**
-    * @brief Sets the override filtered images flag.
-    * @param flag
-    */
-   void setOverrideFilteredImagesFlag( bool flag );
-
-   /**
-    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
-    * false.
-    * 
-    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
-    */
-   bool getOverrideFilteredImagesFlag() const;
-   
-   /**
-    * @brief Set number of threads to use.
-    *
-    * This is only used in execute method if a directory is given to
-    * application to walk.
-    *
-    * @param threads Defaults to 1 if THREADS_KW is not found.
-    */
-   void setNumberOfThreads( ossim_uint32 threads );
-   void setNumberOfThreads( const std::string& threads );
-
-   /** @return The list of filtered out files. */
-   const std::vector<std::string>& getFilteredImages() const;
-
-   /**
-    * @brief Non const method to allow access for
-    * adding or deleting extensions from the list.
-    *
-    * The list is used by the private isFiltered method to avoid trying to
-    * process unwanted files.
-    */
-   std::vector<std::string>& getFilteredImages();
-
-private:
-
-   /** @return true if key is set to true; false, if not. */
-   bool keyIsTrue( const std::string& key ) const;
-
-   /**
-    * @brief Convenience method to check file to see is if file should be
-    * processed.
-    *
-    * @param f File to check.
-    * 
-    * @return true if f is in filter list, false if not.
-    */
-   bool isFiltered(const ossimFilename& f) const;
-   
-   /**
-    * @brief Initializes the filter list with a default set of filtered out
-    * file names.
-    */
-   void initializeDefaultFilterList();
-
-   /** @brief Dumps filtered image list to std out. */
-   void dumpFilteredImageList() const;
-
-   void createOverview(ossimRefPtr<ossimImageHandler>& ih,
-                       bool& consumedHistogramOptions,
-                       bool& consumedCmmOptions);
-
-   void createOverview(ossimRefPtr<ossimImageHandler>& ih,
-                       ossimRefPtr<ossimOverviewBuilderBase>& ob,
-                       ossim_uint32 entry,
-                       bool useEntryIndex,
-                       bool& consumedHistogramOptions);
-
-   /** @return true if entry has required overviews. */
-   bool hasRequiredOverview( ossimRefPtr<ossimImageHandler>& ih,
-                             ossimRefPtr<ossimOverviewBuilderBase>& ob );
-
-   /** @return true if any compute min, max or null options are set. */
-   bool hasCmmOption() const;
-
-   void createHistogram(ossimRefPtr<ossimImageHandler>& ih);
-
-   void createHistogram(ossimRefPtr<ossimImageHandler>& ih,
-                       ossim_uint32 entry,
-                       bool useEntryIndex);
-
-   void computeMinMax(ossimRefPtr<ossimImageHandler>& ih);
-
-   void computeMinMax(ossimRefPtr<ossimImageHandler>& ih,
-                      ossim_uint32 entry,
-                      bool useEntryIndex);
-   
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-
-   void outputOverviewWriterTypes() const;
-
-   /**
-    * @return true if file is a directory based image and the stager should go
-    * on to next directory; false if stager should continue with directory.
-    */
-   bool isDirectoryBasedImage(const ossimImageHandler* ih) const;
-
-   /**
-    * @brief Initializes type from OVERVIEW_TYPE_KW or sets to default
-    * ossim_tiff_box if not found.
-    */
-   void getOverviewType(std::string& type) const;
-
-   /** @brief set reader or writer properties based on cast of pi. */
-   void setProps(ossimPropertyInterface* pi) const;
-   
-   /**
-    * @return Threads to use.  Defaults to 1 if THREADS_KW is not found.
-    */
-   ossim_uint32 getNumberOfThreads() const;
-
-   /** @return the next writer prop index. */
-   ossim_uint32 getNextWriterPropIndex() const;
-
-   /** @return the next reader prop index. */   
-   ossim_uint32 getNextReaderPropIndex() const;
-
-   /**
-    * @brief Adds option to m_kwl with mutex lock.
-    * @param key
-    * @param value
-    */
-   void addOption( const std::string& key, ossim_uint32 value );
-   void addOption( const std::string& key, const std::string& value );
-
-   /**
-    * @brief Sets the m_errorStatus for return on execute.
-    */
-   void setErrorStatus( ossim_int32 status );
-
-   /** @brief run prep system commands. */
-   void executePrepCommands() const;
-
-   /** @brief run per file system commands. */
-   void executeFileCommands( const ossimFilename& file ) const;
-
-   /** @brief run post system commands. */
-   void executePostCommands() const;
-
-   /** @brief system commands. */
-   void executeCommands( const std::string& prefix,
-                         const ossimFilename& file ) const;
-
-    /** @brief Expands variables in a command string. */
-   void substituteCommandString( const ossimFilename& file,
-                                 const std::string& prefix,
-                                 const std::string& commandKey,
-                                 ossimString& command ) const;
-
-   /** @brief Expands file level variables in a command string. */
-   void substituteFileStrings( const ossimFilename& file,
-                               ossimString& command ) const;
-
-    /** @brief Expands date variables in a command string. */
-   void gsubDate( const std::string& commandPrefix,
-                  ossimString& command ) const;
-   
-   /** Holds all options passed into intialize except writer props. */
-   ossimRefPtr<ossimKeywordlist> m_kwl;
-
-   ossimFileWalker*   m_fileWalker;
-   OpenThreads::Mutex m_mutex;
-
-   ossim_int32 m_errorStatus;
-
-   /** Hold images we never want to process. */
-   std::vector<std::string> m_filteredImages; 
-};
-
-#endif /* #ifndef ossimImageUtil_HEADER */
-
diff --git a/ossim/include/ossim/util/ossimInfo.h b/ossim/include/ossim/util/ossimInfo.h
deleted file mode 100644
index 6cc3619..0000000
--- a/ossim/include/ossim/util/ossimInfo.h
+++ /dev/null
@@ -1,698 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimInfo.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ossimInfo class declaration
-//
-// See class doxygen descriptions below for more.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimInfo.h 23664 2015-12-14 14:17:27Z dburken $
-
-#ifndef ossimInfo_HEADER
-#define ossimInfo_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageHandler.h>
-
-#include <ostream>
-
-class ossimArgumentParser;
-class ossimGpt;
-
-/**
- * @brief ossimInfo class.
- *
- * This is a utility class for getting information from the ossim library.
- * This includes information from an image, general library queries, like
- * loaded plugins, and just general stuff like height for point, conversions
- * and so on that are easily obtained through the library.
- */
-class OSSIM_DLL ossimInfo : public ossimReferenced
-{
-public:
-
-   /** default constructor */
-   ossimInfo();
-
-   /** virtual destructor */
-   virtual ~ossimInfo();
-
-   /**
-    * @brief Adds application arguments to the argument parser.
-    * @param ap Parser to add to.
-    */
-   void addArguments(ossimArgumentParser& ap);
-
-   /**
-    * @brief Initial method.
-    *
-    * Typically called from application prior to execute.  This parses
-    * all options and put in keyword list m_kwl.
-    * 
-    * @param ap Arg parser to initialize from.
-    *
-    * @return true, indicating process should continue with execute.
-    */
-   bool initialize(ossimArgumentParser& ap);
-
-   /**
-    * @brief execute method.
-    *
-    * Performs the actual dump of information.  This executes any options
-    * set including image operations, i.e. -i -p --dno and so on.
-    * 
-    * @note Throws ossimException on error.
-    */
-   void execute();
-
-   /**
-    * @brief handles image options.
-    *
-    * Handles image type info opions,  i.e. -i -p --dno and so on.
-    *
-    * @return Number of consumed options.
-    */
-   ossim_uint32 executeImageOptions(const ossimFilename& file);
-
-   /**
-    * @brief getImageInfo Method to open image "file" and get image info
-    * in the form of a ossimKeywordlist.
-    *
-    * Flags turn on various pieces of info.  These equate to options in
-    * ossim-info for image information.
-    *
-    * @param file Image file to get information for.
-    * @param dumpFlag      ossim-info -d
-    * @param dnoFlag       ossim-info --dno
-    * @param imageGeomFlag ossim-info -p
-    * @param imageInfoFlag ossim-info -i 
-    * @param metaDataFlag  ossim-info -m 
-    * @param paletteFlag   ossim-info --palette
-    * @param kwl Initialized by this method.
-    */
-   void getImageInfo( const ossimFilename& file,
-                      bool dumpFlag,
-                      bool dnoFlag,
-                      bool imageGeomFlag,
-                      bool imageInfoFlag,
-                      bool metaDataFlag,
-                      bool paletteFlag,
-                      ossimKeywordlist& kwl ) const;
-
-   /**
-    * @brief getImageInfo Method to open image "file" and get image info
-    * for entry in the form of a ossimKeywordlist.
-    *
-    * Equivalent of ossim-info -i -p <image> for entry. 
-    *
-    * Throws ossimException on error if file cannot be opened or entry is
-    * invalid.
-    *
-    * @param file Image file to get information for.
-    * @param entry Entry index to open.
-    * @return true on success, false on error.
-    */
-   bool getImageInfo( const ossimFilename& file,
-                      ossim_uint32 entry,
-                      ossimKeywordlist& kwl ) const;
-   
-   /**
-    * @brief Opens image handler and stores in m_img data member.
-    * @param Image to open.
-    * @note Throws ossimException if image cannot be opened.
-    */
-   void openImage(const ossimFilename& file);
-
-   /** @brief Closes image if open. */
-   void closeImage();
-
-   /**
-    * @return Ref pointer to the image handler.  Can be null if an image is
-    * not open.
-    */
-   ossimRefPtr<ossimImageHandler> getImageHandler();
-
-   /** @brief Dumps the image information from ossimInfoFactoryRegistry */
-   void dumpImage(const ossimFilename& file, bool dnoFlag) const;
-
-   /**
-    * @brief Dumps the image information from ossimInfoFactoryRegistry to
-    * keyword list.
-    * @param file Image to dump.
-    * @param dnoFlag Dump no overviews. If true do not dump overviews.
-    * @param kwl Initialized by this method.
-    */
-   void dumpImage(const ossimFilename& file,
-                  bool dnoFlag,
-                  ossimKeywordlist& kwl) const;
-
-   /**
-    * @brief Prints factories.
-    * @param keywordListFlag If true the result of a saveState will be output
-    * for each factory.
-    * */
-   void printFactories(bool keywordListFlag) const;
-
-   /**
-    * @brief Populates keyword list with metadata.
-    * This requires open image.
-    *
-    * @param kwl Keyword list to populate.
-    */
-   void getImageMetadata(ossimKeywordlist& kwl) const;
-
-   /**
-    * @brief Populates keyword list with palette data.
-    * This requires open image.
-    *
-    * @param kwl Keyword list to populate.
-    */
-   void getImagePalette(ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with general image information.
-    *
-    * This requires open image.
-    *
-    * @param kwl Keyword list to populate.
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    */
-   void getImageInfo(ossimKeywordlist& kwl, bool dnoFlag);
-
-   /**
-    * @brief Populates keyword list with general image information.
-    *
-    * @param entry Entry number to select.  Note this is the entry number from
-    * the getEntryList call not a simple zero based entry index.
-    * 
-    * @param kwl Keyword list to populate.
-    *
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    *
-    * This requires open image.
-    *
-    * @return true if entry info was saved to keyword list false if not.
-    */
-   bool getImageInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag);
-
-   /**
-    * @brief Populates keyword list with image geometry/projection information.
-    *
-    * This requires open image.
-    *
-    * @param kwl Keyword list to populate.
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    */
-   void getImageGeometryInfo(ossimKeywordlist& kwl, bool dnoFlag);
-
-   /**
-    * @brief Populates keyword list with image geometry/projection information.
-    *
-    * @param entry Entry number to select.  Note this is the entry number
-    * from the getEntryList call not a simple zero based entry index.
-    * 
-    * @param kwl Keyword list to populate.
-    *
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    *
-    * This requires open image.
-    *
-    * @return true if entry info was saved to keyword list false if not.
-    */
-   bool getImageGeometryInfo( ossim_uint32 entry, 
-                              ossimKeywordlist& kwl, 
-                              bool dnoFlag );
-
-   /**
-    * @brief Populates keyword list with image center point..
-    * @param kwl Keyword list to populate.
-    */
-   void getCenterImage(ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with image center point..
-    * @param entry Entry number to select.  Note this is the entry number
-    * from the getEntryList call not a simple zero based entry index.
-    * @param kwl Keyword list to populate.
-    */
-   void getCenterImage(ossim_uint32 entry, ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with image center ground point..
-    * @param kwl Keyword list to populate.
-    */  
-   void getCenterGround(ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with image center ground point..
-    * @param entry Entry number to select.  Note this is the entry number
-    * from the getEntryList call not a simple zero based entry index.
-    * @param kwl Keyword list to populate.
-    */
-   void getCenterGround(ossim_uint32 entry, ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with up_is_up_angle.
-    *
-    * @param kwl Keyword list to populate.
-    *
-    * This requires open image.
-    */
-   void getUpIsUpAngle(ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with up_is_up_angle.
-    *
-    * @param entry Entry number to select.  Note this is the entry number
-    * from the getEntryList call not a simple zero based entry index.
-    * 
-    * @param kwl Keyword list to populate.
-    *
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    *
-    * This requires open image.
-    */
-   void getUpIsUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl);
-   
-   /**
-    * @brief Populates keyword list with north_up_angle.
-    *
-    * @param kwl Keyword list to populate.
-    *
-    * This requires open image.
-    */
-   void getNorthUpAngle(ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with north_up_angle.
-    *
-    * @param entry Entry number to select.  Note this is the entry number
-    * from the getEntryList call not a simple zero based entry index.
-    * 
-    * @param kwl Keyword list to populate.
-    *
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    *
-    * This requires open image.
-    */
-   void getNorthUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl);
-   
-   /**
-    * @brief Populates keyword list with image rectangle.
-    *
-    * This requires open image.
-    *
-    * @param kwl Keyword list to populate.
-    */
-   void getImageRect(ossimKeywordlist& kwl);
-
-   /**
-    * @brief Populates keyword list with image rectangle.
-    *
-    * @param entry Entry number to select.  Note this is the entry number from
-    * the getEntryList call not a simple zero based entry index.
-    * 
-    * @param kwl Keyword list to populate.
-    *
-    * This requires open image.
-    */
-   void getImageRect(ossim_uint32 entry, ossimKeywordlist& kwl);
-
-   /**
-    * @return true if current open image entry is an overview.
-    */
-   bool isImageEntryOverview() const;
-
-   /** @brief Dumps ossim preferences/configuration data. */
-   void printConfiguration() const;
-
-   /**
-    * @brief Dumps ossim preferences/configuration data.
-    * @param out Output to write to.
-    * @return stream
-    */
-   std::ostream& printConfiguration(std::ostream& out) const;
-
-   /** @brief Dumps datum list to stdout. */
-   void printDatums() const;
-
-   /** @brief Dumps datum list to stream. */
-   std::ostream& printDatums(std::ostream& out) const;
-
-   /** @brief Converts degrees to radians and outputs to stdout. */
-   void deg2rad(const ossim_float64& degrees) const;
-
-   /**
-    * @brief Converts degrees to radians and outputs to stream.
-    * @param out Output to write to.
-    * @return stream
-    */
-   std::ostream& deg2rad(const ossim_float64& degrees, std::ostream& out) const;
-
-   /** @brief Converts radians to degrees and outputs to stdout. */
-   void rad2deg(const ossim_float64& radians) const;
-
-   /**
-    * @brief Converts radians to degrees and outputs to stream. 
-    * @param out Output to write to.
-    * @return stream
-    */
-   std::ostream& rad2deg(const ossim_float64& radians, std::ostream& out) const;
-
-   /** @brief Converts feet to meters and outputs to stdout. */
-   void ft2mtrs(const ossim_float64& feet, bool us_survey) const;
-
-   /**
-    * @brief Converts feet to meters and outputs to stream.
-    * @param out Output to write to out.
-    * @return stream
-    */
-   std::ostream& ft2mtrs(const ossim_float64& feet, bool us_survey, std::ostream& out) const;
-
-   /** @brief Converts meters to feet and outputs to stdout. */
-   void mtrs2ft(const ossim_float64& meters, bool us_survey) const;
-
-   /**
-    * @brief Converts meters to feet and outputs to stream.
-    * @param out Output to write to out.
-    * @return stream
-    */   
-   std::ostream& mtrs2ft(const ossim_float64& meters, bool us_survey, std::ostream& out) const;
-
-   /**
-    * @brief Get meters per degree for a given latitude and outputs to stdout.
-    * @param latitude
-    */
-   void mtrsPerDeg(const ossim_float64& latitude) const;
-
-   /**
-    * @brief Get meters per degree for a given latitude and outputs to stream.
-    * @param latitude
-    * @param out Output to write to out.
-    * @return stream
-    */   
-   std::ostream& mtrsPerDeg(const ossim_float64& latitude, std::ostream& out) const;
-
-   /**
-    * @brief Gets the height for ground point (latitude, longitude). Outputs
-    * to stdout.
-    * @param gpt Ground point.
-    */
-   void outputHeight(const ossimGpt& gpt) const;
-
-   /**
-    * @brief Gets the height for ground point (latitude, longitude). Outputs
-    * to out.
-    * @param out Output to write to out.
-    * @return stream
-    */
-   std::ostream& outputHeight(const ossimGpt& gpt, std::ostream& out) const;
-
-   /** @brief Prints loaded plugins to stdout. */
-   void printPlugins() const;
-
-   /**
-    * @brief Prints loaded plugins to stream.
-    * @param out Output to write to out.
-    * @return stream
-    */
-   std::ostream& printPlugins(std::ostream& out) const;
-
-   /**
-    * @brief Test a plugin load  and outputs to stdout.
-    * 
-    * @param plugin Plugin to test.
-    */
-   void testPlugin(const ossimFilename& plugin) const;
-
-   /**
-    * @brief Test a plugin load outputs to stream.
-    * 
-    * @param plugin Plugin to test.
-    * @param out Stream to write to.
-    * @param stream
-    */
-   std::ostream& testPlugin(const ossimFilename& plugin, std::ostream& out) const;
-
-   /** @brief Prints overview types to stdout. */
-   void printOverviewTypes() const;
-
-   /** @brief Prints overview types to stream. */
-   std::ostream& printOverviewTypes(std::ostream& out) const;
-
-   /** @breif Prints projections to stdout. */
-   void printProjections() const;
-
-   /** @breif Prints projections to stream. */
-   std::ostream& printProjections(std::ostream& out) const;
-
-   /** @brief Prints reader properties to stdout. */
-   void printReaderProps() const;
-
-   /** @brief Prints reader properties to stream. */
-   std::ostream& printReaderProps(std::ostream& out) const;
-
-   /** @brief Prints resampler filters to stdout. */
-   void printResamplerFilters() const;
-
-   /** @brief Prints resampler filters to stream. */
-   std::ostream& printResamplerFilters(std::ostream& out) const;
-
-   /** @brief Prints list of available writers to stdout. */
-   void printWriters() const;
-
-   /** @brief Prints list of available writers to stream. */
-   std::ostream& printWriters(std::ostream& out) const;
-
-   /** @brief Prints writer properties to stdout. */
-   void printWriterProps() const;
-
-   /** @brief Prints writer properties to stream. */
-   std::ostream& printWriterProps(std::ostream& out) const;
-
-   /** @brief Prints zoom levels to stdout. */
-   void printZoomLevelGsds() const;
-
-   /** @brief Prints zoom levels to stream. */
-   std::ostream& printZoomLevelGsds(std::ostream& out) const;
-
-   /**
-    * @brief Gets the radiometry string, i.e. "8-bit" and so on, from scalar.
-    * @param scalar Scalar type.
-    * @param s String to initialize.
-    */
-   void getRadiometry(ossimScalarType scalar, std::string& s) const;
-
-   /**
-    * @brief Gets build date.
-    * @param s String to initialize.
-    */
-   void getBuildDate(std::string& s) const;
-
-   /**
-    * @brief Gets revision number.
-    * @param s String to initialize.
-    */
-   void getRevisionNumber(std::string& s) const;
-
-   /**
-    * @brief Gets version.
-    * @param s String to initialize.
-    */
-   void getVersion(std::string& s) const;
-   
-private:
- 
-   /**
-    * @brief Populates keyword list with metadata.
-    * @param ih Pointer to an image handler.
-    * @param kwl Keyword list to populate.
-    */
-   void getImageMetadata( const ossimImageHandler* ih, 
-                          ossimKeywordlist& kwl ) const;
- 
-  /**
-   * @brief Populates keyword list with palette data.
-   * @param ih Pointer to an image handler.
-   * @param kwl Keyword list to populate.
-   */
-   void getImagePalette( ossimImageHandler* ih, 
-                         ossimKeywordlist& kwl ) const;
-  
-   /**
-    * @brief Populates keyword list with general image information.
-    * @param ih Pointer to an image handler.
-    * @param kwl Keyword list to populate.
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    */
-   void getImageInfo( ossimImageHandler* ih, 
-                      ossimKeywordlist& kwl, 
-                      bool dnoFlag ) const;
-
-   /**
-    * @brief Populates keyword list with general image information.
-    * @param ih Pointer to an image handler.
-    * @param entry Entry number to select.  Note this is the entry number from
-    * the getEntryList call not a simple zero based entry index.
-    * @param kwl Keyword list to populate.
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    * @return true if entry info was saved to keyword list false if not.
-    */
-   bool getImageInfo( ossimImageHandler* ih, 
-                      ossim_uint32 entry, 
-                      ossimKeywordlist& kwl, 
-                      bool dnoFlag ) const;
-   
-   /**
-    * @brief Populates keyword list with image geometry/projection information.
-    * @param ih Pointer to an image handler.
-    * @param kwl Keyword list to populate.
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    */
-   void getImageGeometryInfo( ossimImageHandler* ih,
-                              ossimKeywordlist& kwl, 
-                              bool dnoFlag ) const;
-
-   /**
-    * @brief Populates keyword list with image geometry/projection information.
-    * @param ih Pointer to an image handler.
-    * @param entry Entry number to select.  Note this is the entry number
-    * from the getEntryList call not a simple zero based entry index.
-    * @param kwl Keyword list to populate.
-    * @param dnoFlag If true no entries flaged as overviews will be output.
-    * @return true if entry info was saved to keyword list false if not.
-    */
-   bool getImageGeometryInfo( ossimImageHandler* ih,
-                              ossim_uint32 entry, 
-                              ossimKeywordlist& kwl, 
-                              bool dnoFlag ) const;
-
-   void getCenterImage( ossimImageHandler* ih,
-                        ossimKeywordlist& kwl ) const;
-   void getCenterImage( ossimImageHandler* ih,
-                        ossim_uint32 entry, 
-                        ossimKeywordlist& kwl ) const;
-   void getCenterGround( ossimImageHandler* ih,
-                         ossimKeywordlist& kwl ) const;
-   void getCenterGround( ossimImageHandler* ih,
-                         ossim_uint32 entry, 
-                         ossimKeywordlist& kwl ) const;
-
-   /**
-    * @brief Populates keyword list with up_is_up_angle.
-    * @param kwl Keyword list to populate.
-    */
-   void getUpIsUpAngle( ossimImageHandler* ih,
-                        ossimKeywordlist& kwl ) const;
-
-   /**
-    * @brief Populates keyword list with up_is_up_angle.
-    * @param entry Entry number to select.  Note this is the entry number from
-    * the getEntryList call not a simple zero based entry index.
-    * @param kwl Keyword list to populate.
-    */  
-   void getUpIsUpAngle( ossimImageHandler* ih,
-                        ossim_uint32 entry, 
-                        ossimKeywordlist& kwl ) const;
-   
-  /**
-    * @brief Populates keyword list with north_up_angle.
-    * @param kwl Keyword list to populate.
-    */
-   void getNorthUpAngle( ossimImageHandler* ih,
-                         ossimKeywordlist& kwl ) const;
-
-   /**
-    * @brief Populates keyword list with north_up_angle.
-    * @param entry Entry number to select.  Note this is the entry number from
-    * the getEntryList call not a simple zero based entry index.
-    * @param kwl Keyword list to populate.
-    */  
-   void getNorthUpAngle( ossimImageHandler* ih,
-                         ossim_uint32 entry, 
-                         ossimKeywordlist& kwl ) const;
-
-   /**
-    * @brief Populates keyword list with image rectangle.
-    *
-    * @param kwl Keyword list to populate.
-    */
-   void getImageRect( ossimImageHandler* ih,
-                      ossimKeywordlist& kwl ) const;
-
-   /**
-    * @brief Populates keyword list with image rectangle.
-    * @param entry Entry number to select.  Note this is the entry number from
-    * the getEntryList call not a simple zero based entry index.
-    * @param kwl Keyword list to populate.
-    */
-   void getImageRect( ossimImageHandler* ih,
-                      ossim_uint32 entry, 
-                      ossimKeywordlist& kwl ) const;
-
-   /**
-    * @brief Populates keyword list with rgb bands if available.
-    *
-    * This is image handler specific and within image handler specific to
-    * internal metadata, e.g. NITF IREPBAND keys.
-    *
-    * Example of key:value:
-    * rgb_bands:(2,1,0)
-    *
-    * @param ih Pointer to image handler.
-    * @param entry Current entry of image handler.
-    * @param kwl Keyword list to populate.
-    * @return true on success; false, on error.
-    */
-   bool getRgbBands( ossimImageHandler* ih,
-                     ossim_uint32 entry,
-                     ossimKeywordlist& kwl ) const;
-
-   /** @return true if current open image entry is an overview. */
-   bool isImageEntryOverview( const ossimImageHandler* ih ) const;
-
-   /**
-    * @brief Convert keyword list to xml then outputs to standard out.
-    * @param kwl Keyword list to output.
-    */
-   void outputXml( const ossimKeywordlist& kwl ) const;
-   
-   /**
-    * @brief Convert keyword list to xml then outputs to file.
-    * @param kwl Keyword list to output.
-    * @param file Output file to write to.
-    */
-   void outputXml( const ossimKeywordlist& kwl, const ossimFilename& file ) const;
-  
-  /**
-   * @brief Opens image.
-   * @param Image to open.
-   * @return ossimRefPtr with image handler.
-   * @note Throws ossimException if image cannot be opened.
-   */
-   ossimRefPtr<ossimImageHandler> openImageHandler(const ossimFilename& file) const;
-   
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-
-   /** @return true if key is set to true; false, if not. */
-   bool keyIsTrue( const std::string& key ) const;
-
-   /** Hold all options passed into intialize except writer props. */
-   ossimRefPtr<ossimKeywordlist> m_kwl;
-
-   /** Holds the open image. */
-   ossimRefPtr<ossimImageHandler> m_img;
-};
-
-#endif /* #ifndef ossimInfo_HEADER */
-
diff --git a/ossim/include/ossim/util/ossimRpfUtil.h b/ossim/include/ossim/util/ossimRpfUtil.h
deleted file mode 100644
index bd1de12..0000000
--- a/ossim/include/ossim/util/ossimRpfUtil.h
+++ /dev/null
@@ -1,86 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  ossimRpfUtil.h
-// 
-// Utility class to stuff with rpf files.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef ossimRpfUtil_HEADER
-#define ossimRpfUtil_HEADER 1
-
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/imaging/ossimImageGeometry.h> 
-
-class ossimFilename;
-class ossimGpt;
-class ossimRpfToc;
-class ossimRpfTocEntry;
-
-class OSSIM_DLL ossimRpfUtil : public ossimReferenced
-{
-public:
-
-   /** @brief default constructor */
-   ossimRpfUtil();
-
-
-   /**
-    * @brief Write dot rpf file(s) to output directory from a.toc file.
-    *
-    * This creates a dot rpf file for each entry.
-    *
-    * @param aDotFile The a.toc file.
-    *
-    * @param outputDir Directory to write dot rpf file(s) to.
-    *
-    * throws ossimException on error.
-    */
-   void writeDotRpfFiles( const ossimFilename& aDotTocFile,
-                          const ossimFilename& outputDir);
-
-   void writeDotRpfFile( const ossimRpfToc* toc,
-                         const ossimRpfTocEntry* tocEntry,
-                         const ossimFilename& outputDir,
-                         ossim_uint32 entry);
-
-protected:
-
-   /**
-    * @brief protected virtual destructor
-    *
-    * Do not call directly.  Use as a ref ptr.
-    */
-   virtual ~ossimRpfUtil();
-
-private:
-
-   /**
-    * @brief Method to test for 360 spread, 180.0 <--> 180.00 and set
-    * leftLon to -180 if both left and right are 180.0 degrees.
-    *
-    * This adds a small tolerance to the test.
-    * 
-    * @param left Left hand side of scene.  This is the value
-    * that will be flipped to -180 if test is true.
-    *
-    * @param right Right hand side of scene.
-    */
-   void checkLongitude(ossimGpt& left, ossimGpt& right) const;
-
-   /** @brief Method to get the file for entry. */
-   void getDotRfpFilenameForEntry(const ossimFilename& outputDir,
-                                  ossim_uint32 entry,
-                                  ossimFilename& outFile) const;
-   
-}; // Matches: class ossimRpfUtil
-
-#endif /* #ifndef ossimRpfUtil_HEADER */
-
diff --git a/ossim/include/ossim/util/ossimSlopeUtil.h b/ossim/include/ossim/util/ossimSlopeUtil.h
deleted file mode 100644
index fc073d3..0000000
--- a/ossim/include/ossim/util/ossimSlopeUtil.h
+++ /dev/null
@@ -1,67 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Oscar Kramer
-//
-//*************************************************************************
-// $Id: ossimSlopeUtil.h 23443 2015-07-17 15:57:00Z okramer $
-
-#ifndef ossimSlopeUtil_HEADER
-#define ossimSlopeUtil_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ostream>
-
-/*!
- *  Class for computing the slope on each elevation post and generatinga corresponding slope image.
- *  The output scalar type is a normalized float unless unsigned 8-bit is selected via the options.
- */
-class OSSIMDLLEXPORT ossimSlopeUtil : public ossimObject,
-                                      public ossimProcessInterface,
-                                      public ossimListenerManager
-{
-public:
-   ossimSlopeUtil();
-   ~ossimSlopeUtil();
-
-   /**
-    * Initializes from command line arguments.
-    */
-   bool initialize(ossimArgumentParser& ap);
-
-   /**
-    * Returns true if successful
-    */
-   virtual bool execute();
-
-   virtual ossimObject* getObject() { return this; }
-   virtual const ossimObject* getObject() const  { return this; }
-   virtual ossimListenerManager* getManager()  { return this; };
-
-   void printApiJson(std::ostream& out) const;
-
-protected:
-   bool initializeChain();
-   bool loadDemFile();
-   bool loadElevDb();
-   void usage(ossimArgumentParser& ap);
-   void addArguments(ossimArgumentParser& ap);
-   bool writeJsonApi(const ossimFilename& outfile);
-
-   ossimFilename m_demFile;
-   ossimFilename m_slopeFile;
-   ossimFilename m_lutFile;
-   ossimGpt m_centerGpt;
-   double m_aoiRadius; // meters
-   bool m_remapToByte;
-   ossimRefPtr<ossimImageSource> m_procChain;
-};
-
-#endif
diff --git a/ossim/include/ossim/util/ossimViewshedUtil.h b/ossim/include/ossim/util/ossimViewshedUtil.h
deleted file mode 100644
index 913f344..0000000
--- a/ossim/include/ossim/util/ossimViewshedUtil.h
+++ /dev/null
@@ -1,198 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Oscar Kramer
-//
-//*************************************************************************
-// $Id: ossimViewshedUtil.h 23409 2015-07-08 16:24:41Z okramer $
-
-#ifndef ossimViewshedUtil_HEADER
-#define ossimViewshedUtil_HEADER
-
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/parallel/ossimJob.h>
-#include <ossim/parallel/ossimJobMultiThreadQueue.h>
-#include <OpenThreads/ReadWriteMutex>
-
-/*!
- *  Class for computing the viewshed on a DEM given the viewer location and max range of visibility
- */
-
-class OSSIMDLLEXPORT ossimViewshedUtil : public ossimObject,
-                                         public ossimProcessInterface,
-                                         public ossimListenerManager
-{
-   friend class SectorProcessorJob;
-   friend class RadialProcessorJob;
-   friend class RadialProcessor;
-
-public:
-   ossimViewshedUtil();
-   ~ossimViewshedUtil();
-
-   /**
-    * Initializes from command line arguments.
-    */
-   bool initialize(ossimArgumentParser& ap);
-
-   /*
-    * Initializes after parameter set-methods have been called (in lieu of argument parser init)
-    */
-   bool initialize();
-
-   /**
-    * Directly assigns the maximum visibility radius property (in meters).
-    */
-   void setVisibilityRadius(const double& radius) { m_visRadius = radius; }
-
-   /**
-    * Directly assigns the observer's ground point property.
-    */
-   void setObserverGpt(const ossimGpt& vpt) { m_observerGpt = vpt; }
-
-   void setOutputFileName(const ossimFilename& fname) { m_filename = fname; }
-
-   /**
-    * Sets the nominal output resolution in meters
-    */
-   void setGSD(const double& meters_per_pixel);
-
-   /**
-    * Sets the boundary azimuths in degrees for the field-of-view (clockwise from start to stop)
-    */
-   void setFOV(const double& start_deg, const double& stop_deg);
-
-   /**
-    * Returns true if successful
-    */
-   virtual bool execute();
-
-   virtual ossimObject* getObject() { return this; }
-   virtual const ossimObject* getObject() const  { return this; }
-   virtual ossimListenerManager* getManager()  { return this; };
-
-   void printApiJson(ostream& out) const;
-
-protected:
-   class Radial
-   {
-   public:
-      Radial() : azimuth (0), elevation (-99999999.0) {}
-      Radial (const double& az) : azimuth (az), elevation (-99999999.0) {}
-
-      // Angles are stored as arctangents: azimuth = dy/dx,  elevation = dz/dx
-      double azimuth;
-      double elevation;
-   };
-
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-   void addArguments(ossimArgumentParser& ap);
-   bool writeFile();
-   void dumpProductSummary() const;
-   void paintReticle();
-   void initRadials();
-   bool writeHorizonProfile();
-   bool writeJsonApi(const ossimFilename& outfile);
-
-   ossimGpt  m_observerGpt;
-   ossimFilename m_demFile;
-   double m_obsHgtAbvTer; // meters above the terrain
-   double m_visRadius; // meters
-   Radial** m_radials;
-   ossimRefPtr<ossimImageGeometry> m_geometry;
-   bool m_initialized;
-   ossimIrect m_viewRect;
-   ossim_uint32 m_halfWindow; // visRadius adjusted by GSD (in pixels)
-   ossimRefPtr<ossimImageData> m_outBuffer;
-   double m_gsd;
-   ossimFilename m_filename;
-   ossim_uint8 m_visibleValue;
-   ossim_uint8 m_hiddenValue;
-   ossim_uint8 m_observerValue;
-   ossim_int32 m_reticleSize;
-   ossimFilename m_lutFile;
-   bool m_simulation;
-   ossimRefPtr<ossimJobMultiThreadQueue> m_jobMtQueue;
-   ossim_uint32 m_numThreads;
-   bool m_outputSummary;
-   double m_startFov;
-   double m_stopFov;
-   bool m_threadBySector;
-   ossimFilename m_horizonFile;
-   std::map<double, double> m_horizonMap;
-
-   // For debugging:
-   double d_accumT;
-   OpenThreads::Mutex d_mutex;
-};
-
-/**
- * For support of multithreading. The --tbs option directs ossimViewshedUtil to create a thread
- * for each sector (using the SectorProcessorJob). Otherwise, the threads are mapped to a single
- * radial. There are 8 sectors total (45 deg each) so a max of 8 threads are launched. Thus it may
- * be faster to use the RadialProcessorJob scheme (default) when the number of available cores > 8.
- */
-class SectorProcessorJob : public ossimJob
-{
-   friend class ossimViewshedUtil;
-
-private:
-   SectorProcessorJob(ossimViewshedUtil* vs_util, ossim_uint32 sector, ossim_uint32 numRadials)
-   : m_vsUtil (vs_util), m_sector (sector), m_numRadials (numRadials)  {}
-
-   virtual void start();
-
-   ossimViewshedUtil* m_vsUtil;
-   ossim_uint32 m_sector;
-   ossim_uint32 m_numRadials;
-};
-
-
-class RadialProcessorJob : public ossimJob
-{
-   friend class ossimViewshedUtil;
-
-private:
-   RadialProcessorJob(ossimViewshedUtil* vs_util,
-                      ossim_uint32 sector,
-                      ossim_uint32 radial,
-                      ossim_uint32 numRadials)
-   : m_vsUtil (vs_util), m_sector (sector), m_radial (radial), m_numRadials (numRadials) {}
-
-   virtual void start();
-
-   ossimViewshedUtil* m_vsUtil;
-   ossim_uint32 m_sector;
-   ossim_uint32 m_radial;
-   ossim_uint32 m_numRadials;
-};
-
-/**
- * This class provides a common entry point for both SectorProcessorJob and RadialProcessorJob for
- * processing a single radial. Eventually, SectorProcessorJob can likely go away (invoked with the
- * "--tbs" command-line option, and doRadial() method can be moved into RadialProcessorJob class.
- * In the meantime, both Sector/thread and Radial/thread schemes are supported to continue
- * evaluating performance.
- */
-class RadialProcessor
-{
-public:
-   static void doRadial(ossimViewshedUtil* vs, ossim_uint32 s, ossim_uint32 r);
-
-private:
-   static OpenThreads::ReadWriteMutex m_bufMutex;
-   static OpenThreads::ReadWriteMutex m_radMutex;
-   RadialProcessor() {};
-};
-
-#endif
diff --git a/ossim/include/ossim/vec/ossimVpfDatabaseHeaderTableValidator.h b/ossim/include/ossim/vec/ossimVpfDatabaseHeaderTableValidator.h
deleted file mode 100644
index 8290f4e..0000000
--- a/ossim/include/ossim/vec/ossimVpfDatabaseHeaderTableValidator.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//-----------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//-----------------------------------------------------------------
-#ifndef ossimVpfDatabaseHeaderTableValidator_HEADER
-#define ossimVpfDatabaseHeaderTableValidator_HEADER
-#include <ossim/vec/ossimVpfTableValidator.h>
-class ossimVpfTable;
-class ossimVpfDatabaseHeaderTableValidator : public ossimVpfTableValidator
-{
-public:
-   virtual ~ossimVpfDatabaseHeaderTableValidator();
-   virtual bool isValid(ossimVpfTable& aTable)const;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/vec/ossimVpfTableValidator.h b/ossim/include/ossim/vec/ossimVpfTableValidator.h
deleted file mode 100644
index f67c65c..0000000
--- a/ossim/include/ossim/vec/ossimVpfTableValidator.h
+++ /dev/null
@@ -1,19 +0,0 @@
-//-----------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//-----------------------------------------------------------------
-#ifndef ossimVpfTableValidator_HEADER
-#define ossimVpfTableValidator_HEADER
-
-class ossimVpfTable;
-
-class ossimVpfTableValidator
-{
-public:
-   virtual ~ossimVpfTableValidator(){}
-   virtual bool isValid(ossimVpfTable& aTable)const=0;
-};
-
-#endif
-
diff --git a/ossim/include/ossim/vec/vpf.h b/ossim/include/ossim/vec/vpf.h
deleted file mode 100644
index fca5635..0000000
--- a/ossim/include/ossim/vec/vpf.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: This class give the capability to access tiles from an
-//              vpf file.
-//
-//********************************************************************
-// $Id: vpf.h 23664 2015-12-14 14:17:27Z dburken $
-#ifndef VPF_HEADER
-#define VPF_HEADER
-
-#include <ossim/ossimConfig.h>
-
-#if __OSSIM_CARBON__
-#define MAXINT INT_MAX
-#endif
-
-extern "C"
-{
-#include <ossim/vpfutil/vpfapi.h>
-#include <ossim/vpfutil/vpfview.h>
-#include <ossim/vpfutil/vpfselec.h>
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfprim.h>
-#include <ossim/vpfutil/vpfmisc.h>
-#include <ossim/vpfutil/vpfdisp.h>
-}
-
-#endif
-
diff --git a/ossim/ossim_header.txt b/ossim/ossim_header.txt
deleted file mode 100644
index e0cecac..0000000
--- a/ossim/ossim_header.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-/*****************************************************************************
-*                                                                            *
-*                                 O S S I M                                  *
-*            Open Source, Geospatial Image Processing Project                *
-*          License: MIT, see LICENSE.txt at the top-level directory         *
-*                                                                            *
-******************************************************************************
-$Id: ossim_header.txt 23481 2015-08-26 15:42:55Z okramer $ */
diff --git a/ossim/packaging/pkgconfig/ossim.pc.in b/ossim/packaging/pkgconfig/ossim.pc.in
deleted file mode 100644
index 8e2582c..0000000
--- a/ossim/packaging/pkgconfig/ossim.pc.in
+++ /dev/null
@@ -1,14 +0,0 @@
-# pkg-config source file
-
-prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_POSTFIX@
-includedir=${prefix}/include
-
-Name: ossim
-Description: Open Source Software Image Map
-Version: @OSSIM_VERSION@
-Requires: openthreads tiff jpeg
-Conflicts:
-Libs: -L${libdir} -lossim
-Cflags: -I${includedir}
diff --git a/ossim/share/ossim/projection/ossim_epsg_projections-v7_4.csv b/ossim/share/ossim/projection/ossim_epsg_projections-v7_4.csv
deleted file mode 100644
index c38b2a5..0000000
--- a/ossim/share/ossim/projection/ossim_epsg_projections-v7_4.csv
+++ /dev/null
@@ -1,3252 +0,0 @@
-EPSG_DB_FORMAT_A
-code,name,type,unit,datum code,datum name,ellipsoid,False easting,Latitude of natural origin,False northing,Longitude of natural origin,Scale factor at natural origin,Azimuth of initial line,Latitude of projection centre,Northing at projection centre,Angle from Rectified to Skew Grid,Scale factor on initial line,Easting at projection centre,Longitude of projection centre,Latitude of pseudo standard parallel,Scale factor on pseudo standard parallel,Longitude of origin,Latitude of 2nd stan [...]
-2000,Anguilla 1957 / British West Indies Grid,Transverse Mercator,metre,4600,Anguilla 1957,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2001,Antigua 1943 / British West Indies Grid,Transverse Mercator,metre,4601,Antigua 1943,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2002,Dominica 1945 / British West Indies Grid,Transverse Mercator,metre,4602,Dominica 1945,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2003,Grenada 1953 / British West Indies Grid,Transverse Mercator,metre,4603,Grenada 1953,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2004,Montserrat 1958 / British West Indies Grid,Transverse Mercator,metre,4604,Montserrat 1958,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2005,St. Kitts 1955 / British West Indies Grid,Transverse Mercator,metre,4605,St. Kitts 1955,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2006,St. Lucia 1955 / British West Indies Grid,Transverse Mercator,metre,4606,St. Lucia 1955,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2007,St. Vincent 45 / British West Indies Grid,Transverse Mercator,metre,4607,St. Vincent 1945,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2008,NAD27(CGQ77) / SCoPQ zone 2,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-55.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2009,NAD27(CGQ77) / SCoPQ zone 3,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-58.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2010,NAD27(CGQ77) / SCoPQ zone 4,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2011,NAD27(CGQ77) / SCoPQ zone 5,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2012,NAD27(CGQ77) / SCoPQ zone 6,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-67.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2013,NAD27(CGQ77) / SCoPQ zone 7,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-70.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2014,NAD27(CGQ77) / SCoPQ zone 8,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-73.3,0.9999
-2015,NAD27(CGQ77) / SCoPQ zone 9,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-76.3,0.9999
-2016,NAD27(CGQ77) / SCoPQ zone 10,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-79.3,0.9999
-2017,NAD27(76) / MTM zone 8,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-73.3,0.9999
-2018,NAD27(76) / MTM zone 9,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-76.3,0.9999
-2019,NAD27(76) / MTM zone 10,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-79.3,0.9999
-2020,NAD27(76) / MTM zone 11,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-82.3,0.9999
-2021,NAD27(76) / MTM zone 12,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-81,0.9999
-2022,NAD27(76) / MTM zone 13,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-84,0.9999
-2023,NAD27(76) / MTM zone 14,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-87,0.9999
-2024,NAD27(76) / MTM zone 15,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-90,0.9999
-2025,NAD27(76) / MTM zone 16,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-93,0.9999
-2026,NAD27(76) / MTM zone 17,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-96,0.9999
-2027,NAD27(76) / UTM zone 15N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-93,0.9996
-2028,NAD27(76) / UTM zone 16N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-87,0.9996
-2029,NAD27(76) / UTM zone 17N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-81,0.9996
-2030,NAD27(76) / UTM zone 18N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-75,0.9996
-2031,NAD27(CGQ77) / UTM zone 17N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-81,0.9996
-2032,NAD27(CGQ77) / UTM zone 18N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-75,0.9996
-2033,NAD27(CGQ77) / UTM zone 19N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-69,0.9996
-2034,NAD27(CGQ77) / UTM zone 20N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-63,0.9996
-2035,NAD27(CGQ77) / UTM zone 21N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-57,0.9996
-2039,Israel / Israeli TM Grid,Transverse Mercator,metre,4141,Israel,GRS 1980,219529.584,31.4403817,626907.39,35.1216261,1.0000067
-2040,Locodjo 1965 / UTM zone 30N,Transverse Mercator,metre,4142,Locodjo 1965,Clarke 1880 (RGS),500000,0,0,-3,0.9996
-2041,Abidjan 1987 / UTM zone 30N,Transverse Mercator,metre,4143,Abidjan 1987,Clarke 1880 (RGS),500000,0,0,-3,0.9996
-2042,Locodjo 1965 / UTM zone 29N,Transverse Mercator,metre,4142,Locodjo 1965,Clarke 1880 (RGS),500000,0,0,-9,0.9996
-2043,Abidjan 1987 / UTM zone 29N,Transverse Mercator,metre,4143,Abidjan 1987,Clarke 1880 (RGS),500000,0,0,-9,0.9996
-2044,Hanoi 1972 / Gauss-Kruger zone 18,Transverse Mercator,metre,4147,Hanoi 1972,Krassowsky 1940,18500000,0,0,105,1
-2045,Hanoi 1972 / Gauss-Kruger zone 19,Transverse Mercator,metre,4147,Hanoi 1972,Krassowsky 1940,19500000,0,0,111,1
-2046,Hartebeesthoek94 / Lo15,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,15,1
-2047,Hartebeesthoek94 / Lo17,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,17,1
-2048,Hartebeesthoek94 / Lo19,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,19,1
-2049,Hartebeesthoek94 / Lo21,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,21,1,0,0,0,0,0,0,0,0,0,
-2050,Hartebeesthoek94 / Lo23,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,23,1,0,0,0,0,0,0,0,0,0,
-2051,Hartebeesthoek94 / Lo25,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,25,1,0,0,0,0,0,0,0,0,0,
-2052,Hartebeesthoek94 / Lo27,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,27,1,0,0,0,0,0,0,0,0,0,
-2053,Hartebeesthoek94 / Lo29,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,29,1,0,0,0,0,0,0,0,0,0,
-2054,Hartebeesthoek94 / Lo31,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,31,1,0,0,0,0,0,0,0,0,0,
-2055,Hartebeesthoek94 / Lo33,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,33,1,0,0,0,0,0,0,0,0,0,
-2056,CH1903+ / LV95,Oblique Mercator,metre,4149,CH1903+,Bessel 1841,0,0,0,0,0,90,46.570866,1200000,90,1,2600000,7.26225,0,0,
-2057,Rassadiran / Nakhl e Taqi,Oblique Mercator,metre,4153,Rassadiran,International 1924,0,0,0,0,0,0.34179803,27.31077837,3044969.194,0.34179803,0.999895934,658377.437,52.3612741,0,0,
-2058,ED50(ED77) / UTM zone 38N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,
-2059,ED50(ED77) / UTM zone 39N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,
-2060,ED50(ED77) / UTM zone 40N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,57,0.9996,0,0,0,0,0,0,0,0,0,
-2061,ED50(ED77) / UTM zone 41N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,63,0.9996,0,0,0,0,0,0,0,0,0,
-2062,Madrid 1870 (Madrid) / Spain,Lambert Conic Conformal (1SP),metre,4903,Madrid 1870 (Madrid),Struve 1860,600000,40,600000,0,0.998808529,0,0,0,0,0,0,0,0,0,
-2065,S-JTSK (Ferro) / Krovak,Krovak Oblique Conic Conformal,metre,4156,S-JTSK (Ferro),Bessel 1841,0,0,0,0,0,30.1717303,49.3,0,0,0,0,0,78.3,0.9999,42.3
-2066,Mount Dillon / Tobago Grid,Cassini-Soldner,Clarke's link,4157,Mount Dillon,Clarke 1858,187500,11.1507843,180000,-60.4109632,0,0,0,0,0,0,0,0,0,0,
-2067,Naparima 1955 / UTM zone 20N,Transverse Mercator,metre,4158,Naparima 1955,International 1924,500000,0,0,-63,0.9996
-2068,ELD79 / Libya zone 5,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,9,0.9999
-2069,ELD79 / Libya zone 6,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,11,0.9999
-2070,ELD79 / Libya zone 7,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,13,0.9999
-2071,ELD79 / Libya zone 8,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,15,0.9999
-2072,ELD79 / Libya zone 9,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,17,0.9999
-2073,ELD79 / Libya zone 10,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,19,0.9999
-2074,ELD79 / Libya zone 11,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,21,0.9999
-2075,ELD79 / Libya zone 12,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,23,0.9999
-2076,ELD79 / Libya zone 13,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,25,0.9999
-2077,ELD79 / UTM zone 32N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,9,0.9996
-2078,ELD79 / UTM zone 33N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,15,0.9996
-2079,ELD79 / UTM zone 34N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,21,0.9996
-2080,ELD79 / UTM zone 35N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,27,0.9996
-2081,Chos Malal 1914 / Argentina zone 2,Transverse Mercator,metre,4160,Chos Malal 1914,International 1924,2500000,-90,0,-69,1
-2082,Pampa del Castillo / Argentina zone 2,Transverse Mercator,metre,4161,Pampa del Castillo,International 1924,2500000,-90,0,-69,1
-2083,Hito XVIII 1963 / Argentina zone 2,Transverse Mercator,metre,4254,Hito XVIII 1963,International 1924,2500000,-90,0,-69,1
-2084,Hito XVIII 1963 / UTM zone 19S,Transverse Mercator,metre,4254,Hito XVIII 1963,International 1924,500000,0,10000000,-69,0.9996
-2087,ELD79 / TM 12 NE,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,12,0.9996
-2088,Carthage / TM 11 NE,Transverse Mercator,metre,4223,Carthage,Clarke 1880 (IGN),500000,0,0,11,0.9996
-2089,Yemen NGN96 / UTM zone 38N,Transverse Mercator,metre,4163,Yemen National Geodetic Network 1996,WGS 84,500000,0,0,45,0.9996
-2090,Yemen NGN96 / UTM zone 39N,Transverse Mercator,metre,4163,Yemen National Geodetic Network 1996,WGS 84,500000,0,0,51,0.9996
-2093,Hanoi 1972 / GK 106 NE,Transverse Mercator,metre,4147,Hanoi 1972,Krassowsky 1940,500000,0,0,106,1
-2094,WGS 72BE / TM 106 NE,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,106,0.9996
-2095,Bissau / UTM zone 28N,Transverse Mercator,metre,4165,Bissau,International 1924,500000,0,0,-15,0.9996
-2096,Korean 1985 / Korea East Belt,Transverse Mercator,metre,4162,Korean Datum 1985,Bessel 1841,200000,38,500000,129,1
-2097,Korean 1985 / Korea Central Belt,Transverse Mercator,metre,4162,Korean Datum 1985,Bessel 1841,200000,38,500000,127,1
-2098,Korean 1985 / Korea West Belt,Transverse Mercator,metre,4162,Korean Datum 1985,Bessel 1841,200000,38,500000,125,1
-2099,Qatar 1948 / Qatar Grid,Cassini-Soldner,metre,4286,Qatar 1948,Helmert 1906,100000,25.22565,100000,50.4541,
-2100,GGRS87 / Greek Grid,Transverse Mercator,metre,4121,Greek Geodetic Reference System 1987,GRS 1980,500000,0,0,24,0.9996
-2101,Lake / Maracaibo Grid M1,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,0,10.1,-52684.972,-71.3620224,1
-2102,Lake / Maracaibo Grid,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,200000,10.1,147315.028,-71.3620224,1
-2103,Lake / Maracaibo Grid M3,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,500000,10.1,447315.028,-71.3620224,1
-2104,Lake / Maracaibo La Rosa Grid,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,-17044,10.1,-23139.97,-71.3620224,1
-2105,NZGD2000 / Mount Eden 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-36.5247,800000,174.4551,0.9999
-2106,NZGD2000 / Bay of Plenty 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-37.454,800000,176.2758,1
-2107,NZGD2000 / Poverty Bay 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-38.3728,800000,177.5308,1
-2108,NZGD2000 / Hawkes Bay 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-39.3903,800000,176.4025,1
-2109,NZGD2000 / Taranaki 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-39.0808,800000,174.134,1
-2110,NZGD2000 / Tuhirangi 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-39.3044,800000,175.3824,1
-2111,NZGD2000 / Wanganui 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-40.1431,800000,175.2917,1
-2112,NZGD2000 / Wairarapa 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-40.5531,800000,175.385,1
-2113,NZGD2000 / Wellington 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.1804,800000,174.4635,1
-2114,NZGD2000 / Collingwood 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-40.4253,800000,172.4019,1
-2115,NZGD2000 / Nelson 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.1628,800000,173.1757,1
-2116,NZGD2000 / Karamea 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.1723,800000,172.0632,1
-2117,NZGD2000 / Buller 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.4838,800000,171.3452,1
-2118,NZGD2000 / Grey 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-42.2001,800000,171.3259,1
-2119,NZGD2000 / Amuri 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-42.412,800000,173.0036,1
-2120,NZGD2000 / Marlborough 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.324,800000,173.4807,1
-2121,NZGD2000 / Hokitika 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-42.531,800000,170.5847,1
-2122,NZGD2000 / Okarito 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.0636,800000,170.1539,1
-2123,NZGD2000 / Jacksons Bay 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.584,800000,168.3622,1
-2124,NZGD2000 / Mount Pleasant 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.3526,800000,172.4337,1
-2125,NZGD2000 / Gawler 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.4455,800000,171.2138,1
-2126,NZGD2000 / Timaru 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-44.2407,800000,171.0326,1
-2127,NZGD2000 / Lindis Peak 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-44.4406,800000,169.2803,1
-2128,NZGD2000 / Mount Nicholas 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.0758,800000,168.2355,1
-2129,NZGD2000 / Mount York 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.3349,800000,167.4419,1
-2130,NZGD2000 / Observation Point 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.4858,800000,170.3742,1
-2131,NZGD2000 / North Taieri 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.5141,800000,170.1657,0.99996
-2132,NZGD2000 / Bluff 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-46.36,800000,168.2034,1
-2133,NZGD2000 / UTM zone 58S,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,500000,0,10000000,165,0.9996
-2134,NZGD2000 / UTM zone 59S,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,500000,0,10000000,171,0.9996
-2135,NZGD2000 / UTM zone 60S,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,500000,0,10000000,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2136,Accra / Ghana National Grid,Transverse Mercator,Gold Coast foot,4168,Accra,War Office,900000,4.4,0,-1,0.99975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2137,Accra / TM 1 NW,Transverse Mercator,metre,4168,Accra,War Office,500000,0,0,-1,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2138,NAD27(CGQ77) / Quebec Lambert,Lambert Conic Conformal (2SP),metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-68.3,60,0,0
-2154,RGF93 / Lambert-93,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,46.3,3,49,6600000,700000
-2157,IRENET95 / Irish Transverse Mercator,Transverse Mercator,metre,4173,IRENET95,GRS 1980,600000,53.3,750000,-8,0.99982,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2158,IRENET95 / UTM zone 29N,Transverse Mercator,metre,4173,IRENET95,GRS 1980,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2159,Sierra Leone 1924 / New Colony Grid,Transverse Mercator,Gold Coast foot,4174,Sierra Leone Colony 1924,War Office,500000,6.4,0,-12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2160,Sierra Leone 1924 / New War Office Grid,Transverse Mercator,Gold Coast foot,4174,Sierra Leone Colony 1924,War Office,800000,6.4,600000,-12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2161,Sierra Leone 1968 / UTM zone 28N,Transverse Mercator,metre,4175,Sierra Leone 1968,Clarke 1880 (RGS),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2162,Sierra Leone 1968 / UTM zone 29N,Transverse Mercator,metre,4175,Sierra Leone 1968,Clarke 1880 (RGS),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2163,US National Atlas Equal Area,Lambert Azimuthal Equal Area (Spherical),metre,4035,Not specified (based on Clarke 1866 Authalic Sphere),Clarke 1866 Authalic Sphere,0,45,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2164,Locodjo 1965 / TM 5 NW,Transverse Mercator,metre,4142,Locodjo 1965,Clarke 1880 (RGS),500000,0,0,-5,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2165,Abidjan 1987 / TM 5 NW,Transverse Mercator,metre,4143,Abidjan 1987,Clarke 1880 (RGS),500000,0,0,-5,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2169,Luxembourg 1930 / Gauss,Transverse Mercator,metre,4181,Luxembourg 1930,International 1924,80000,49.5,100000,6.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2172,Pulkovo 1942(58) / Poland zone II,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4603000,53.0007,5806000,21.301,0.9998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2173,Pulkovo 1942(58) / Poland zone III,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3501000,53.35,5999000,17.003,0.9998
-2174,Pulkovo 1942(58) / Poland zone IV,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3703000,51.4015,5627000,16.402,0.9998
-2175,Pulkovo 1942(58) / Poland zone V,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,237000,0,-4700000,18.573,0.999983
-2176,ETRS89 / Poland CS2000 zone 5,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,5500000,0,0,15,0.999923
-2177,ETRS89 / Poland CS2000 zone 6,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,6500000,0,0,18,0.999923
-2178,ETRS89 / Poland CS2000 zone 7,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,7500000,0,0,21,0.999923
-2179,ETRS89 / Poland CS2000 zone 8,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,8500000,0,0,24,0.999923
-2180,ETRS89 / Poland CS92,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,-5300000,19,0.9993
-2188,Azores Occidental 1939 / UTM zone 25N,Transverse Mercator,metre,4182,Azores Occidental Islands 1939,International 1924,500000,0,0,-33,0.9996
-2189,Azores Central 1948 / UTM zone 26N,Transverse Mercator,metre,4183,Azores Central Islands 1948,International 1924,500000,0,0,-27,0.9996
-2190,Azores Oriental 1940 / UTM zone 26N,Transverse Mercator,metre,4184,Azores Oriental Islands 1940,International 1924,500000,0,0,-27,0.9996
-2192,ED50 / France EuroLambert,Lambert Conic Conformal (1SP),metre,4154,European Datum 1950,International 1924,600000,46.48,2200000,2.2014025,0.99987742
-2193,NZGD2000 / New Zealand Transverse Mercator 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,1600000,0,10000000,173,0.9996
-2195,NAD83(HARN) / UTM zone 2S,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,10000000,-171,0.9996
-2196,ETRS89 / Kp2000 Jutland,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,200000,0,0,9.3,0.99995
-2197,ETRS89 / Kp2000 Zealand,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,12,0.99995
-2198,ETRS89 / Kp2000 Bornholm,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,900000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2200,ATS77 / New Brunswick Stereographic (ATS77),Oblique Stereographic,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,300000,46.3,800000,-66.3,0.999912,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2201,REGVEN / UTM zone 18N,Transverse Mercator,metre,4189,Red Geodesica Venezolana,GRS 1980,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2202,REGVEN / UTM zone 19N,Transverse Mercator,metre,4189,Red Geodesica Venezolana,GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2203,REGVEN / UTM zone 20N,Transverse Mercator,metre,4189,Red Geodesica Venezolana,GRS 1980,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2204,NAD27 / Tennessee,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.25,34.4,-86,35.15,100000,2000000
-2205,NAD83 / Kentucky North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,500000
-2206,ED50 / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4154,European Datum 1950,International 1924,9500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2207,ED50 / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4154,European Datum 1950,International 1924,10500000,0,0,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2208,ED50 / 3-degree Gauss-Kruger zone 11,Transverse Mercator,metre,4154,European Datum 1950,International 1924,11500000,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2209,ED50 / 3-degree Gauss-Kruger zone 12,Transverse Mercator,metre,4154,European Datum 1950,International 1924,12500000,0,0,36,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2210,ED50 / 3-degree Gauss-Kruger zone 13,Transverse Mercator,metre,4154,European Datum 1950,International 1924,13500000,0,0,39,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2211,ED50 / 3-degree Gauss-Kruger zone 14,Transverse Mercator,metre,4154,European Datum 1950,International 1924,14500000,0,0,42,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2212,ED50 / 3-degree Gauss-Kruger zone 15,Transverse Mercator,metre,4154,European Datum 1950,International 1924,15500000,0,0,45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2213,ETRS89 / TM 30 NE,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,30,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2215,Manoca 1962 / UTM zone 32N,Transverse Mercator,metre,4193,Manoca 1962,Clarke 1880 (IGN),500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2216,Qornoq 1927 / UTM zone 22N,Transverse Mercator,metre,4194,Qornoq 1927,International 1924,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2217,Qornoq 1927 / UTM zone 23N,Transverse Mercator,metre,4194,Qornoq 1927,International 1924,500000,0,0,-45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2218,Scoresbysund 1952 / Greenland zone 5 east,Lambert Conic Conformal (West Orientated),metre,4195,Scoresbysund 1952,International 1924,0,70.3,0,-24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2219,ATS77 / UTM zone 19N,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2220,ATS77 / UTM zone 20N,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2221,Scoresbysund 1952 / Greenland zone 6 east,Lambert Conic Conformal (West Orientated),metre,4195,Scoresbysund 1952,International 1924,0,67.3,0,-32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2222,NAD83 / Arizona East (ft),Transverse Mercator,foot,4269,North American Datum 1983,GRS 1980,700000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2223,NAD83 / Arizona Central (ft),Transverse Mercator,foot,4269,North American Datum 1983,GRS 1980,700000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2224,NAD83 / Arizona West (ft),Transverse Mercator,foot,4269,North American Datum 1983,GRS 1980,700000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2225,NAD83 / California zone 1 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,1640416.667,6561666.667
-2226,NAD83 / California zone 2 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,1640416.667,6561666.667
-2227,NAD83 / California zone 3 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,1640416.667,6561666.667
-2228,NAD83 / California zone 4 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,1640416.667,6561666.667
-2229,NAD83 / California zone 5 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,1640416.667,6561666.667
-2230,NAD83 / California zone 6 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,1640416.667,6561666.667
-2231,NAD83 / Colorado North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,1000000,3000000
-2232,NAD83 / Colorado Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,1000000,3000000
-2233,NAD83 / Colorado South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,1000000,3000000
-2234,NAD83 / Connecticut (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,500000,1000000
-2235,NAD83 / Delaware (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2236,NAD83 / Florida East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2237,NAD83 / Florida West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2238,NAD83 / Florida North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,1968500
-2239,NAD83 / Georgia East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2240,NAD83 / Georgia West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2296583.333,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2241,NAD83 / Idaho East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2242,NAD83 / Idaho Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2243,NAD83 / Idaho West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2624666.667,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2246,NAD83 / Kentucky North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,1640416.667
-2247,NAD83 / Kentucky South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,1640416.667,1640416.667
-2248,NAD83 / Maryland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,1312333.333
-2249,NAD83 / Massachusetts Mainland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,2460625,656166.667
-2250,NAD83 / Massachusetts Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,1640416.667
-2251,NAD83 / Michigan North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,26246719.16
-2252,NAD83 / Michigan Central (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,19685039.37
-2253,NAD83 / Michigan South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,13123359.58
-2254,NAD83 / Mississippi East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2255,NAD83 / Mississippi West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2296583.333,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2256,NAD83 / Montana (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,1968503.937
-2257,NAD83 / New Mexico East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,541337.5,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2258,NAD83 / New Mexico Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2259,NAD83 / New Mexico West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2723091.667,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2260,NAD83 / New York East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2261,NAD83 / New York Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,820208.333,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2262,NAD83 / New York West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1148291.667,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2263,NAD83 / New York Long Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,984250
-2264,NAD83 / North Carolina (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,2000000
-2265,NAD83 / North Dakota North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,1968503.937
-2266,NAD83 / North Dakota South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,1968503.937
-2267,NAD83 / Oklahoma North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,1968500
-2268,NAD83 / Oklahoma South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,1968500
-2269,NAD83 / Oregon North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,8202099.738
-2270,NAD83 / Oregon South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,4921259.843
-2271,NAD83 / Pennsylvania North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,1968500
-2272,NAD83 / Pennsylvania South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,1968500
-2273,NAD83 / South Carolina (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,2000000
-2274,NAD83 / Tennessee (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,1968500
-2275,NAD83 / Texas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,3280833.333,656166.667
-2276,NAD83 / Texas North Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,6561666.667,1968500
-2277,NAD83 / Texas Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,9842500,2296583.333
-2278,NAD83 / Texas South Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,13123333.33,1968500
-2279,NAD83 / Texas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,16404166.67,984250
-2280,NAD83 / Utah North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280839.895,1640419.948
-2281,NAD83 / Utah Central (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561679.79,1640419.948
-2282,NAD83 / Utah South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842519.685,1640419.948
-2283,NAD83 / Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,6561666.667,11482916.67
-2284,NAD83 / Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,3280833.333,11482916.67
-2285,NAD83 / Washington North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,1640416.667
-2286,NAD83 / Washington South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,1640416.667
-2287,NAD83 / Wisconsin North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,1968500
-2288,NAD83 / Wisconsin Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,1968500
-2289,NAD83 / Wisconsin South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,1968500
-2290,ATS77 / Prince Edward Isl. Stereographic (ATS77),Oblique Stereographic,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,700000,47.15,400000,-63,0.999912,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2294,ATS77 / MTM Nova Scotia zone 4,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,4500000,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2295,ATS77 / MTM Nova Scotia zone 5,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,5500000,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2296,Ammassalik 1958 / Greenland zone 7 east,Lambert Conic Conformal (West Orientated),metre,4196,Ammassalik 1958,International 1924,0,64.3,0,-40,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2299,Qornoq 1927 / Greenland zone 2 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,79.3,0,-64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2301,Qornoq 1927 / Greenland zone 3 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,76.3,0,-64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2303,Qornoq 1927 / Greenland zone 4 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,73.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2304,Qornoq 1927 / Greenland zone 5 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,70.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2305,Qornoq 1927 / Greenland zone 6 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,67.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2306,Qornoq 1927 / Greenland zone 7 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,64.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2307,Qornoq 1927 / Greenland zone 8 east,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,61.3,0,-48,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2308,Batavia / TM 109 SE,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,109,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2309,WGS 84 / TM 116 SE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,116,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2310,WGS 84 / TM 132 SE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,132,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2311,WGS 84 / TM 6 NE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,6,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2312,Garoua / UTM zone 33N,Transverse Mercator,metre,4197,Garoua,Clarke 1880 (RGS),500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2313,Kousseri / UTM zone 33N,Transverse Mercator,metre,4198,Kousseri,Clarke 1880 (RGS),500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2314,Trinidad 1903 / Trinidad Grid (ftCla),Cassini-Soldner,Clarke's foot,4302,Trinidad 1903,Clarke 1858,283800,10.263,214500,-61.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2315,Campo Inchauspe / UTM zone 19S,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,500000,0,10000000,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2316,Campo Inchauspe / UTM zone 20S,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,500000,0,10000000,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2317,PSAD56 / ICN Regional,Lambert Conic Conformal (2SP),metre,4248,Provisional South American Datum 1956,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,-66,9,1000000,1000000
-2318,Ain el Abd / Aramco Lambert,Lambert Conic Conformal (2SP),metre,4204,Ain el Abd 1970,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,25.0522236,48,17,0,0
-2319,ED50 / TM27,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2320,ED50 / TM30,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2321,ED50 / TM33,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,33,1
-2322,ED50 / TM36,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,36,1
-2323,ED50 / TM39,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,39,1
-2324,ED50 / TM42,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,42,1
-2325,ED50 / TM45,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,45,1
-2326,Hong Kong 1980 Grid System,Transverse Mercator,metre,4611,Hong Kong 1980,International 1924,836694.05,22.184368,819069.8,114.10428,1
-2327,Xian 1980 / Gauss-Kruger zone 13,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,13500000,0,0,75,1
-2328,Xian 1980 / Gauss-Kruger zone 14,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,14500000,0,0,81,1
-2329,Xian 1980 / Gauss-Kruger zone 15,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,15500000,0,0,87,1
-2330,Xian 1980 / Gauss-Kruger zone 16,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,16500000,0,0,93,1
-2331,Xian 1980 / Gauss-Kruger zone 17,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,17500000,0,0,99,1
-2332,Xian 1980 / Gauss-Kruger zone 18,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,18500000,0,0,105,1
-2333,Xian 1980 / Gauss-Kruger zone 19,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,19500000,0,0,111,1
-2334,Xian 1980 / Gauss-Kruger zone 20,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,20500000,0,0,117,1
-2335,Xian 1980 / Gauss-Kruger zone 21,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,21500000,0,0,123,1
-2336,Xian 1980 / Gauss-Kruger zone 22,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,22500000,0,0,129,1
-2337,Xian 1980 / Gauss-Kruger zone 23,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,23500000,0,0,135,1
-2338,Xian 1980 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,75,1
-2339,Xian 1980 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,81,1
-2340,Xian 1980 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,87,1
-2341,Xian 1980 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,93,1
-2342,Xian 1980 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,99,1
-2343,Xian 1980 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,105,1
-2344,Xian 1980 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,111,1
-2345,Xian 1980 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,117,1
-2346,Xian 1980 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,123,1
-2347,Xian 1980 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,129,1
-2348,Xian 1980 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,135,1
-2349,Xian 1980 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,25500000,0,0,75,1
-2350,Xian 1980 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,26500000,0,0,78,1
-2351,Xian 1980 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,27500000,0,0,81,1
-2352,Xian 1980 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,28500000,0,0,84,1
-2353,Xian 1980 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,29500000,0,0,87,1
-2354,Xian 1980 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,30500000,0,0,90,1
-2355,Xian 1980 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,31500000,0,0,93,1
-2356,Xian 1980 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,32500000,0,0,96,1
-2357,Xian 1980 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,33500000,0,0,99,1
-2358,Xian 1980 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,34500000,0,0,102,1
-2359,Xian 1980 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,35500000,0,0,105,1
-2360,Xian 1980 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,36500000,0,0,108,1
-2361,Xian 1980 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,37500000,0,0,111,1
-2362,Xian 1980 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,38500000,0,0,114,1
-2363,Xian 1980 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,39500000,0,0,117,1
-2364,Xian 1980 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,40500000,0,0,120,1
-2365,Xian 1980 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,41500000,0,0,123,1
-2366,Xian 1980 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,42500000,0,0,126,1
-2367,Xian 1980 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,43500000,0,0,129,1
-2368,Xian 1980 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,44500000,0,0,132,1
-2369,Xian 1980 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,45500000,0,0,135,1
-2370,Xian 1980 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,75,1
-2371,Xian 1980 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,78,1
-2372,Xian 1980 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,81,1
-2373,Xian 1980 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,84,1
-2374,Xian 1980 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,87,1
-2375,Xian 1980 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,90,1
-2376,Xian 1980 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,93,1
-2377,Xian 1980 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,96,1
-2378,Xian 1980 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,99,1
-2379,Xian 1980 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,102,1
-2380,Xian 1980 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,105,1
-2381,Xian 1980 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,108,1
-2382,Xian 1980 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,111,1
-2383,Xian 1980 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,114,1
-2384,Xian 1980 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,117,1
-2385,Xian 1980 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,120,1
-2386,Xian 1980 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,123,1
-2387,Xian 1980 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,126,1
-2388,Xian 1980 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,129,1
-2389,Xian 1980 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,132,1
-2390,Xian 1980 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,135,1
-2391,KKJ / Finland zone 1,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,1500000,0,0,21,1
-2392,KKJ / Finland zone 2,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,2500000,0,0,24,1
-2393,KKJ / Finland Uniform Coordinate System,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,3500000,0,0,27,1
-2394,KKJ / Finland zone 4,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,4500000,0,0,30,1
-2395,South Yemen / Gauss-Kruger zone 8,Transverse Mercator,metre,4164,South Yemen,Krassowsky 1940,8500000,0,0,45,1
-2396,South Yemen / Gauss-Kruger zone 9,Transverse Mercator,metre,4164,South Yemen,Krassowsky 1940,9500000,0,0,51,1
-2397,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,3500000,0,0,9,1
-2398,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,4500000,0,0,12,1
-2399,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,5500000,0,0,15,1
-2401,Beijing 1954 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,25500000,0,0,75,1
-2402,Beijing 1954 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,26500000,0,0,78,1
-2403,Beijing 1954 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,27500000,0,0,81,1
-2404,Beijing 1954 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,28500000,0,0,84,1
-2405,Beijing 1954 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,29500000,0,0,87,1
-2406,Beijing 1954 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,30500000,0,0,90,1
-2407,Beijing 1954 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,31500000,0,0,93,1
-2408,Beijing 1954 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,32500000,0,0,96,1
-2409,Beijing 1954 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,33500000,0,0,99,1
-2410,Beijing 1954 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,34500000,0,0,102,1
-2411,Beijing 1954 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,35500000,0,0,105,1
-2412,Beijing 1954 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,36500000,0,0,108,1
-2413,Beijing 1954 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,37500000,0,0,111,1
-2414,Beijing 1954 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,38500000,0,0,114,1
-2415,Beijing 1954 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,39500000,0,0,117,1
-2416,Beijing 1954 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,40500000,0,0,120,1
-2417,Beijing 1954 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,41500000,0,0,123,1
-2418,Beijing 1954 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,42500000,0,0,126,1
-2419,Beijing 1954 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,43500000,0,0,129,1
-2420,Beijing 1954 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,44500000,0,0,132,1
-2421,Beijing 1954 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,45500000,0,0,135,1
-2422,Beijing 1954 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,75,1
-2423,Beijing 1954 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,78,1
-2424,Beijing 1954 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,81,1
-2425,Beijing 1954 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,84,1
-2426,Beijing 1954 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,87,1
-2427,Beijing 1954 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,90,1
-2428,Beijing 1954 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,93,1
-2429,Beijing 1954 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,96,1
-2430,Beijing 1954 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,99,1
-2431,Beijing 1954 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,102,1
-2432,Beijing 1954 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,105,1
-2433,Beijing 1954 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,108,1
-2434,Beijing 1954 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,111,1
-2435,Beijing 1954 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,114,1
-2436,Beijing 1954 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,117,1
-2437,Beijing 1954 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,120,1
-2438,Beijing 1954 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,123,1
-2439,Beijing 1954 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,126,1
-2440,Beijing 1954 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,129,1
-2441,Beijing 1954 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,132,1
-2442,Beijing 1954 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,135,1
-2443,JGD2000 / Japan Plane Rectangular CS I,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,33,0,129.3,0.9999
-2444,JGD2000 / Japan Plane Rectangular CS II,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,33,0,131,0.9999
-2445,JGD2000 / Japan Plane Rectangular CS III,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,132.1,0.9999
-2446,JGD2000 / Japan Plane Rectangular CS IV,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,33,0,133.3,0.9999
-2447,JGD2000 / Japan Plane Rectangular CS V,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,134.2,0.9999
-2448,JGD2000 / Japan Plane Rectangular CS VI,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,136,0.9999
-2449,JGD2000 / Japan Plane Rectangular CS VII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,137.1,0.9999
-2450,JGD2000 / Japan Plane Rectangular CS VIII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,138.3,0.9999
-2451,JGD2000 / Japan Plane Rectangular CS IX,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,139.5,0.9999
-2452,JGD2000 / Japan Plane Rectangular CS X,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,40,0,140.5,0.9999
-2453,JGD2000 / Japan Plane Rectangular CS XI,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,44,0,140.15,0.9999
-2454,JGD2000 / Japan Plane Rectangular CS XII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,44,0,142.15,0.9999
-2455,JGD2000 / Japan Plane Rectangular CS XIII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,44,0,144.15,0.9999
-2456,JGD2000 / Japan Plane Rectangular CS XIV,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,142,0.9999
-2457,JGD2000 / Japan Plane Rectangular CS XV,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,127.3,0.9999
-2458,JGD2000 / Japan Plane Rectangular CS XVI,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,124,0.9999
-2459,JGD2000 / Japan Plane Rectangular CS XVII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,131,0.9999
-2460,JGD2000 / Japan Plane Rectangular CS XVIII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,20,0,136,0.9999
-2461,JGD2000 / Japan Plane Rectangular CS XIX,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,154,0.9999
-2462,Albanian 1987 / Gauss-Kruger zone 4,Transverse Mercator,metre,4191,Albanian 1987,Krassowsky 1940,4500000,0,0,21,1
-2463,Pulkovo 1995 / Gauss-Kruger CM 21E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,21,1
-2464,Pulkovo 1995 / Gauss-Kruger CM 27E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,27,1
-2465,Pulkovo 1995 / Gauss-Kruger CM 33E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,33,1
-2466,Pulkovo 1995 / Gauss-Kruger CM 39E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,39,1
-2467,Pulkovo 1995 / Gauss-Kruger CM 45E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,45,1
-2468,Pulkovo 1995 / Gauss-Kruger CM 51E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,51,1
-2469,Pulkovo 1995 / Gauss-Kruger CM 57E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,57,1
-2470,Pulkovo 1995 / Gauss-Kruger CM 63E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,63,1
-2471,Pulkovo 1995 / Gauss-Kruger CM 69E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,69,1
-2472,Pulkovo 1995 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,75,1
-2473,Pulkovo 1995 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,81,1
-2474,Pulkovo 1995 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,87,1
-2475,Pulkovo 1995 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,93,1
-2476,Pulkovo 1995 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,99,1
-2477,Pulkovo 1995 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,105,1
-2478,Pulkovo 1995 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,111,1
-2479,Pulkovo 1995 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,117,1
-2480,Pulkovo 1995 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,123,1
-2481,Pulkovo 1995 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,129,1
-2482,Pulkovo 1995 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,135,1
-2483,Pulkovo 1995 / Gauss-Kruger CM 141E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,141,1
-2484,Pulkovo 1995 / Gauss-Kruger CM 147E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,147,1
-2485,Pulkovo 1995 / Gauss-Kruger CM 153E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,153,1
-2486,Pulkovo 1995 / Gauss-Kruger CM 159E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,159,1
-2487,Pulkovo 1995 / Gauss-Kruger CM 165E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,165,1
-2488,Pulkovo 1995 / Gauss-Kruger CM 171E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,171,1
-2489,Pulkovo 1995 / Gauss-Kruger CM 177E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,177,1
-2490,Pulkovo 1995 / Gauss-Kruger CM 177W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-177,1
-2491,Pulkovo 1995 / Gauss-Kruger CM 171W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-171,1
-2494,Pulkovo 1942 / Gauss-Kruger CM 21E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,21,1
-2495,Pulkovo 1942 / Gauss-Kruger CM 27E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,27,1
-2496,Pulkovo 1942 / Gauss-Kruger CM 33E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,33,1
-2497,Pulkovo 1942 / Gauss-Kruger CM 39E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,39,1
-2498,Pulkovo 1942 / Gauss-Kruger CM 45E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,45,1
-2499,Pulkovo 1942 / Gauss-Kruger CM 51E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,51,1
-2500,Pulkovo 1942 / Gauss-Kruger CM 57E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,57,1
-2501,Pulkovo 1942 / Gauss-Kruger CM 63E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,63,1
-2502,Pulkovo 1942 / Gauss-Kruger CM 69E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,69,1
-2503,Pulkovo 1942 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,75,1
-2504,Pulkovo 1942 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,81,1
-2505,Pulkovo 1942 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,87,1
-2506,Pulkovo 1942 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,93,1
-2507,Pulkovo 1942 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,99,1
-2508,Pulkovo 1942 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,105,1
-2509,Pulkovo 1942 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,111,1
-2510,Pulkovo 1942 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,117,1
-2511,Pulkovo 1942 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,123,1
-2512,Pulkovo 1942 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,129,1
-2513,Pulkovo 1942 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,135,1
-2514,Pulkovo 1942 / Gauss-Kruger CM 141E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,141,1
-2515,Pulkovo 1942 / Gauss-Kruger CM 147E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,147,1
-2516,Pulkovo 1942 / Gauss-Kruger CM 153E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,153,1
-2517,Pulkovo 1942 / Gauss-Kruger CM 159E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,159,1
-2518,Pulkovo 1942 / Gauss-Kruger CM 165E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,165,1
-2519,Pulkovo 1942 / Gauss-Kruger CM 171E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,171,1
-2520,Pulkovo 1942 / Gauss-Kruger CM 177E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,177,1
-2521,Pulkovo 1942 / Gauss-Kruger CM 177W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-177,1
-2522,Pulkovo 1942 / Gauss-Kruger CM 171W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-171,1
-2523,Pulkovo 1942 / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,7500000,0,0,21,1
-2524,Pulkovo 1942 / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,8500000,0,0,24,1
-2525,Pulkovo 1942 / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,9500000,0,0,27,1
-2526,Pulkovo 1942 / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,10500000,0,0,30,1
-2527,Pulkovo 1942 / 3-degree Gauss-Kruger zone 11,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,11500000,0,0,33,1
-2528,Pulkovo 1942 / 3-degree Gauss-Kruger zone 12,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,12500000,0,0,36,1
-2529,Pulkovo 1942 / 3-degree Gauss-Kruger zone 13,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,13500000,0,0,39,1
-2530,Pulkovo 1942 / 3-degree Gauss-Kruger zone 14,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,14500000,0,0,42,1
-2531,Pulkovo 1942 / 3-degree Gauss-Kruger zone 15,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,15500000,0,0,45,1
-2532,Pulkovo 1942 / 3-degree Gauss-Kruger zone 16,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,16500000,0,0,48,1
-2533,Pulkovo 1942 / 3-degree Gauss-Kruger zone 17,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,17500000,0,0,51,1
-2534,Pulkovo 1942 / 3-degree Gauss-Kruger zone 18,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,18500000,0,0,54,1
-2535,Pulkovo 1942 / 3-degree Gauss-Kruger zone 19,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,19500000,0,0,57,1
-2536,Pulkovo 1942 / 3-degree Gauss-Kruger zone 20,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,20500000,0,0,60,1
-2537,Pulkovo 1942 / 3-degree Gauss-Kruger zone 21,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,21500000,0,0,63,1
-2538,Pulkovo 1942 / 3-degree Gauss-Kruger zone 22,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,22500000,0,0,66,1
-2539,Pulkovo 1942 / 3-degree Gauss-Kruger zone 23,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,23500000,0,0,69,1
-2540,Pulkovo 1942 / 3-degree Gauss-Kruger zone 24,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,24500000,0,0,72,1
-2541,Pulkovo 1942 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,25500000,0,0,75,1
-2542,Pulkovo 1942 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,26500000,0,0,78,1
-2543,Pulkovo 1942 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,27500000,0,0,81,1
-2544,Pulkovo 1942 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,28500000,0,0,84,1
-2545,Pulkovo 1942 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,29500000,0,0,87,1
-2546,Pulkovo 1942 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,30500000,0,0,90,1
-2547,Pulkovo 1942 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,31500000,0,0,93,1
-2548,Pulkovo 1942 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,32500000,0,0,96,1
-2549,Pulkovo 1942 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,33500000,0,0,99,1
-2551,Pulkovo 1942 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,34500000,0,0,102,1
-2552,Pulkovo 1942 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,35500000,0,0,105,1
-2553,Pulkovo 1942 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,36500000,0,0,108,1
-2554,Pulkovo 1942 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,37500000,0,0,111,1
-2555,Pulkovo 1942 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,38500000,0,0,114,1
-2556,Pulkovo 1942 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,39500000,0,0,117,1
-2557,Pulkovo 1942 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,40500000,0,0,120,1
-2558,Pulkovo 1942 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,41500000,0,0,123,1
-2559,Pulkovo 1942 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,42500000,0,0,126,1
-2560,Pulkovo 1942 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,43500000,0,0,129,1
-2561,Pulkovo 1942 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,44500000,0,0,132,1
-2562,Pulkovo 1942 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,45500000,0,0,135,1
-2563,Pulkovo 1942 / 3-degree Gauss-Kruger zone 46,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,46500000,0,0,138,1
-2564,Pulkovo 1942 / 3-degree Gauss-Kruger zone 47,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,47500000,0,0,141,1
-2565,Pulkovo 1942 / 3-degree Gauss-Kruger zone 48,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,48500000,0,0,144,1
-2566,Pulkovo 1942 / 3-degree Gauss-Kruger zone 49,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,49500000,0,0,147,1
-2567,Pulkovo 1942 / 3-degree Gauss-Kruger zone 50,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,50500000,0,0,150,1
-2568,Pulkovo 1942 / 3-degree Gauss-Kruger zone 51,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,51500000,0,0,153,1
-2569,Pulkovo 1942 / 3-degree Gauss-Kruger zone 52,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,52500000,0,0,156,1
-2570,Pulkovo 1942 / 3-degree Gauss-Kruger zone 53,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,53500000,0,0,159,1
-2571,Pulkovo 1942 / 3-degree Gauss-Kruger zone 54,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,54500000,0,0,162,1
-2572,Pulkovo 1942 / 3-degree Gauss-Kruger zone 55,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,55500000,0,0,165,1
-2573,Pulkovo 1942 / 3-degree Gauss-Kruger zone 56,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,56500000,0,0,168,1
-2574,Pulkovo 1942 / 3-degree Gauss-Kruger zone 57,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,57500000,0,0,171,1
-2575,Pulkovo 1942 / 3-degree Gauss-Kruger zone 58,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,58500000,0,0,174,1
-2576,Pulkovo 1942 / 3-degree Gauss-Kruger zone 59,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,59500000,0,0,177,1
-2578,Pulkovo 1942 / 3-degree Gauss-Kruger zone 61,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,61500000,0,0,-177,1
-2579,Pulkovo 1942 / 3-degree Gauss-Kruger zone 62,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,62500000,0,0,-174,1
-2580,Pulkovo 1942 / 3-degree Gauss-Kruger zone 63,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,63500000,0,0,-171,1
-2581,Pulkovo 1942 / 3-degree Gauss-Kruger zone 64,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,64500000,0,0,-168,1
-2582,Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,21,1
-2583,Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,24,1
-2584,Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,27,1
-2585,Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,30,1
-2586,Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,33,1
-2587,Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,36,1
-2588,Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,39,1
-2589,Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,42,1
-2590,Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,45,1
-2591,Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,48,1
-2592,Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,51,1
-2593,Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,54,1
-2594,Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,57,1
-2595,Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,60,1
-2596,Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,63,1
-2597,Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,66,1
-2598,Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,69,1
-2599,Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,72,1
-2601,Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,75,1
-2602,Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,78,1
-2603,Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,81,1
-2604,Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,84,1
-2605,Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,87,1
-2606,Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,90,1
-2607,Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,93,1
-2608,Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,96,1
-2609,Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,99,1
-2610,Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,102,1
-2611,Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,105,1
-2612,Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,108,1
-2613,Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,111,1
-2614,Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,114,1
-2615,Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,117,1
-2616,Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,120,1
-2617,Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,123,1
-2618,Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,126,1
-2619,Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,129,1
-2620,Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,132,1
-2621,Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,135,1
-2622,Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,138,1
-2623,Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,141,1
-2624,Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,144,1
-2625,Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,147,1
-2626,Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,150,1
-2627,Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,153,1
-2628,Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,156,1
-2629,Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,159,1
-2630,Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,162,1
-2631,Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,165,1
-2632,Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,168,1
-2633,Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,171,1
-2634,Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,174,1
-2635,Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,177,1
-2636,Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,180,1
-2637,Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-177,1
-2638,Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-174,1
-2639,Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-171,1
-2640,Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-168,1
-2641,Pulkovo 1995 / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,7500000,0,0,21,1
-2642,Pulkovo 1995 / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,8500000,0,0,24,1
-2643,Pulkovo 1995 / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,9500000,0,0,27,1
-2644,Pulkovo 1995 / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,10500000,0,0,30,1
-2645,Pulkovo 1995 / 3-degree Gauss-Kruger zone 11,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,11500000,0,0,33,1
-2646,Pulkovo 1995 / 3-degree Gauss-Kruger zone 12,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,12500000,0,0,36,1
-2647,Pulkovo 1995 / 3-degree Gauss-Kruger zone 13,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,13500000,0,0,39,1
-2648,Pulkovo 1995 / 3-degree Gauss-Kruger zone 14,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,14500000,0,0,42,1
-2649,Pulkovo 1995 / 3-degree Gauss-Kruger zone 15,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,15500000,0,0,45,1
-2650,Pulkovo 1995 / 3-degree Gauss-Kruger zone 16,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,16500000,0,0,48,1
-2651,Pulkovo 1995 / 3-degree Gauss-Kruger zone 17,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,17500000,0,0,51,1
-2652,Pulkovo 1995 / 3-degree Gauss-Kruger zone 18,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,18500000,0,0,54,1
-2653,Pulkovo 1995 / 3-degree Gauss-Kruger zone 19,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,19500000,0,0,57,1
-2654,Pulkovo 1995 / 3-degree Gauss-Kruger zone 20,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,20500000,0,0,60,1
-2655,Pulkovo 1995 / 3-degree Gauss-Kruger zone 21,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,21500000,0,0,63,1
-2656,Pulkovo 1995 / 3-degree Gauss-Kruger zone 22,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,22500000,0,0,66,1
-2657,Pulkovo 1995 / 3-degree Gauss-Kruger zone 23,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,23500000,0,0,69,1
-2658,Pulkovo 1995 / 3-degree Gauss-Kruger zone 24,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,24500000,0,0,72,1
-2659,Pulkovo 1995 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,25500000,0,0,75,1
-2660,Pulkovo 1995 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,26500000,0,0,78,1
-2661,Pulkovo 1995 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,27500000,0,0,81,1
-2662,Pulkovo 1995 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,28500000,0,0,84,1
-2663,Pulkovo 1995 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,29500000,0,0,87,1
-2664,Pulkovo 1995 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,30500000,0,0,90,1
-2665,Pulkovo 1995 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,31500000,0,0,93,1
-2666,Pulkovo 1995 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,32500000,0,0,96,1
-2667,Pulkovo 1995 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,33500000,0,0,99,1
-2668,Pulkovo 1995 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,34500000,0,0,102,1
-2669,Pulkovo 1995 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,35500000,0,0,105,1
-2670,Pulkovo 1995 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,36500000,0,0,108,1
-2671,Pulkovo 1995 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,37500000,0,0,111,1
-2672,Pulkovo 1995 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,38500000,0,0,114,1
-2673,Pulkovo 1995 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,39500000,0,0,117,1
-2674,Pulkovo 1995 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,40500000,0,0,120,1
-2675,Pulkovo 1995 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,41500000,0,0,123,1
-2676,Pulkovo 1995 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,42500000,0,0,126,1
-2677,Pulkovo 1995 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,43500000,0,0,129,1
-2678,Pulkovo 1995 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,44500000,0,0,132,1
-2679,Pulkovo 1995 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,45500000,0,0,135,1
-2680,Pulkovo 1995 / 3-degree Gauss-Kruger zone 46,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,46500000,0,0,138,1
-2681,Pulkovo 1995 / 3-degree Gauss-Kruger zone 47,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,47500000,0,0,141,1
-2682,Pulkovo 1995 / 3-degree Gauss-Kruger zone 48,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,48500000,0,0,144,1
-2683,Pulkovo 1995 / 3-degree Gauss-Kruger zone 49,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,49500000,0,0,147,1
-2684,Pulkovo 1995 / 3-degree Gauss-Kruger zone 50,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,50500000,0,0,150,1
-2685,Pulkovo 1995 / 3-degree Gauss-Kruger zone 51,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,51500000,0,0,153,1
-2686,Pulkovo 1995 / 3-degree Gauss-Kruger zone 52,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,52500000,0,0,156,1
-2687,Pulkovo 1995 / 3-degree Gauss-Kruger zone 53,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,53500000,0,0,159,1
-2688,Pulkovo 1995 / 3-degree Gauss-Kruger zone 54,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,54500000,0,0,162,1
-2689,Pulkovo 1995 / 3-degree Gauss-Kruger zone 55,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,55500000,0,0,165,1
-2690,Pulkovo 1995 / 3-degree Gauss-Kruger zone 56,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,56500000,0,0,168,1
-2691,Pulkovo 1995 / 3-degree Gauss-Kruger zone 57,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,57500000,0,0,171,1
-2692,Pulkovo 1995 / 3-degree Gauss-Kruger zone 58,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,58500000,0,0,174,1
-2693,Pulkovo 1995 / 3-degree Gauss-Kruger zone 59,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,59500000,0,0,177,1
-2695,Pulkovo 1995 / 3-degree Gauss-Kruger zone 61,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,61500000,0,0,-177,1
-2696,Pulkovo 1995 / 3-degree Gauss-Kruger zone 62,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,62500000,0,0,-174,1
-2697,Pulkovo 1995 / 3-degree Gauss-Kruger zone 63,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,63500000,0,0,-171,1
-2698,Pulkovo 1995 / 3-degree Gauss-Kruger zone 64,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,64500000,0,0,-168,1
-2699,Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,21,1
-2700,Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,24,1
-2701,Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,27,1
-2702,Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,30,1
-2703,Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,33,1
-2704,Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,36,1
-2705,Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,39,1
-2706,Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,42,1
-2707,Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,45,1
-2708,Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,48,1
-2709,Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,51,1
-2710,Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,54,1
-2711,Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,57,1
-2712,Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,60,1
-2713,Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,63,1
-2714,Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,66,1
-2715,Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,69,1
-2716,Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,72,1
-2717,Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,75,1
-2718,Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,78,1
-2719,Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,81,1
-2720,Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,84,1
-2721,Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,87,1
-2722,Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,90,1
-2723,Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,93,1
-2724,Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,96,1
-2725,Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,99,1
-2726,Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,102,1
-2727,Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,105,1
-2728,Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,108,1
-2729,Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,111,1
-2730,Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,114,1
-2731,Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,117,1
-2732,Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,120,1
-2733,Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,123,1
-2734,Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,126,1
-2735,Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,129,1
-2736,Tete / UTM zone 36S,Transverse Mercator,metre,4127,Tete,Clarke 1866,500000,0,10000000,33,0.9996
-2737,Tete / UTM zone 37S,Transverse Mercator,metre,4127,Tete,Clarke 1866,500000,0,10000000,39,0.9996
-2738,Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,132,1
-2739,Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,135,1
-2740,Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,138,1
-2741,Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,141,1
-2742,Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,144,1
-2743,Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,147,1
-2744,Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,150,1
-2745,Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,153,1
-2746,Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,156,1
-2747,Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,159,1
-2748,Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,162,1
-2749,Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,165,1
-2750,Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,168,1
-2751,Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,171,1
-2752,Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,174,1
-2753,Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,177,1
-2754,Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,180,1
-2755,Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-177,1
-2756,Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-174,1
-2757,Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-171,1
-2758,Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-168,1
-2759,NAD83(HARN) / Alabama East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,30.3,0,-85.5,0.99996
-2760,NAD83(HARN) / Alabama West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,600000,30,0,-87.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2761,NAD83(HARN) / Arizona East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,213360,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2762,NAD83(HARN) / Arizona Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,213360,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2763,NAD83(HARN) / Arizona West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,213360,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2764,NAD83(HARN) / Arkansas North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,400000
-2765,NAD83(HARN) / Arkansas South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,400000,400000
-2766,NAD83(HARN) / California zone 1,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,500000,2000000
-2767,NAD83(HARN) / California zone 2,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,500000,2000000
-2768,NAD83(HARN) / California zone 3,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,500000,2000000
-2769,NAD83(HARN) / California zone 4,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,500000,2000000
-2770,NAD83(HARN) / California zone 5,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,500000,2000000
-2771,NAD83(HARN) / California zone 6,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,500000,2000000
-2772,NAD83(HARN) / Colorado North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,304800.6096,914401.8289
-2773,NAD83(HARN) / Colorado Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,304800.6096,914401.8289
-2774,NAD83(HARN) / Colorado South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,304800.6096,914401.8289
-2775,NAD83(HARN) / Connecticut,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,152400.3048,304800.6096
-2776,NAD83(HARN) / Delaware,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2777,NAD83(HARN) / Florida East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2778,NAD83(HARN) / Florida West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2779,NAD83(HARN) / Florida North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,600000
-2780,NAD83(HARN) / Georgia East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2781,NAD83(HARN) / Georgia West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2782,NAD83(HARN) / Hawaii zone 1,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,18.5,0,-155.3,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2783,NAD83(HARN) / Hawaii zone 2,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,20.2,0,-156.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2784,NAD83(HARN) / Hawaii zone 3,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2785,NAD83(HARN) / Hawaii zone 4,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,21.5,0,-159.3,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2786,NAD83(HARN) / Hawaii zone 5,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,21.4,0,-160.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2787,NAD83(HARN) / Idaho East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2788,NAD83(HARN) / Idaho Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2789,NAD83(HARN) / Idaho West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,800000,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2790,NAD83(HARN) / Illinois East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2791,NAD83(HARN) / Illinois West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2792,NAD83(HARN) / Indiana East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,100000,37.3,250000,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2793,NAD83(HARN) / Indiana West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,900000,37.3,250000,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2794,NAD83(HARN) / Iowa North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,1000000,1500000
-2795,NAD83(HARN) / Iowa South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,500000
-2796,NAD83(HARN) / Kansas North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,400000
-2797,NAD83(HARN) / Kansas South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,400000,400000
-2798,NAD83(HARN) / Kentucky North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,500000
-2799,NAD83(HARN) / Kentucky South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,500000,500000
-2800,NAD83(HARN) / Louisiana North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,1000000
-2801,NAD83(HARN) / Louisiana South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,1000000
-2802,NAD83(HARN) / Maine East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2803,NAD83(HARN) / Maine West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,900000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2804,NAD83(HARN) / Maryland,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,400000
-2805,NAD83(HARN) / Massachusetts Mainland,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,750000,200000
-2806,NAD83(HARN) / Massachusetts Island,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,500000
-2807,NAD83(HARN) / Michigan North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,8000000
-2808,NAD83(HARN) / Michigan Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,6000000
-2809,NAD83(HARN) / Michigan South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,4000000
-2810,NAD83(HARN) / Minnesota North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,100000,800000
-2811,NAD83(HARN) / Minnesota Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,100000,800000
-2812,NAD83(HARN) / Minnesota South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,100000,800000
-2813,NAD83(HARN) / Mississippi East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2814,NAD83(HARN) / Mississippi West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2815,NAD83(HARN) / Missouri East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,250000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2816,NAD83(HARN) / Missouri Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2817,NAD83(HARN) / Missouri West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,850000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2818,NAD83(HARN) / Montana,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,600000
-2819,NAD83(HARN) / Nebraska,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,500000
-2820,NAD83(HARN) / Nevada East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,34.45,8000000,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2821,NAD83(HARN) / Nevada Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,34.45,6000000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2822,NAD83(HARN) / Nevada West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,800000,34.45,4000000,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2823,NAD83(HARN) / New Hampshire,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2824,NAD83(HARN) / New Jersey,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2825,NAD83(HARN) / New Mexico East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,165000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2826,NAD83(HARN) / New Mexico Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2827,NAD83(HARN) / New Mexico West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,830000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2828,NAD83(HARN) / New York East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2829,NAD83(HARN) / New York Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,250000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2830,NAD83(HARN) / New York West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,350000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2831,NAD83(HARN) / New York Long Island,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,300000
-2832,NAD83(HARN) / North Dakota North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,600000
-2833,NAD83(HARN) / North Dakota South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,600000
-2834,NAD83(HARN) / Ohio North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,600000
-2835,NAD83(HARN) / Ohio South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,600000
-2836,NAD83(HARN) / Oklahoma North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,600000
-2837,NAD83(HARN) / Oklahoma South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,600000
-2838,NAD83(HARN) / Oregon North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,2500000
-2839,NAD83(HARN) / Oregon South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,1500000
-2840,NAD83(HARN) / Rhode Island,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,100000,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2841,NAD83(HARN) / South Dakota North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,600000
-2842,NAD83(HARN) / South Dakota South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,600000
-2843,NAD83(HARN) / Tennessee,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,600000
-2844,NAD83(HARN) / Texas North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,1000000,200000
-2845,NAD83(HARN) / Texas North Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,2000000,600000
-2846,NAD83(HARN) / Texas Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,3000000,700000
-2847,NAD83(HARN) / Texas South Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,4000000,600000
-2848,NAD83(HARN) / Texas South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,5000000,300000
-2849,NAD83(HARN) / Utah North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,1000000,500000
-2850,NAD83(HARN) / Utah Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,2000000,500000
-2851,NAD83(HARN) / Utah South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,3000000,500000
-2852,NAD83(HARN) / Vermont,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2853,NAD83(HARN) / Virginia North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,2000000,3500000
-2854,NAD83(HARN) / Virginia South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,1000000,3500000
-2855,NAD83(HARN) / Washington North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,500000
-2856,NAD83(HARN) / Washington South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,500000
-2857,NAD83(HARN) / West Virginia North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,600000
-2858,NAD83(HARN) / West Virginia South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,600000
-2859,NAD83(HARN) / Wisconsin North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,600000
-2860,NAD83(HARN) / Wisconsin Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,600000
-2861,NAD83(HARN) / Wisconsin South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,600000
-2862,NAD83(HARN) / Wyoming East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2863,NAD83(HARN) / Wyoming East Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,400000,40.3,100000,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2864,NAD83(HARN) / Wyoming West Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,600000,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2865,NAD83(HARN) / Wyoming West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,800000,40.3,100000,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2866,NAD83(HARN) / Puerto Rico and Virgin Is.,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,200000,200000
-2867,NAD83(HARN) / Arizona East (ft),Transverse Mercator,foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2868,NAD83(HARN) / Arizona Central (ft),Transverse Mercator,foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2869,NAD83(HARN) / Arizona West (ft),Transverse Mercator,foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2870,NAD83(HARN) / California zone 1 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,1640416.667,6561666.667
-2871,NAD83(HARN) / California zone 2 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,1640416.667,6561666.667
-2872,NAD83(HARN) / California zone 3 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,1640416.667,6561666.667
-2873,NAD83(HARN) / California zone 4 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,1640416.667,6561666.667
-2874,NAD83(HARN) / California zone 5 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,1640416.667,6561666.667
-2875,NAD83(HARN) / California zone 6 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,1640416.667,6561666.667
-2876,NAD83(HARN) / Colorado North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,1000000,3000000
-2877,NAD83(HARN) / Colorado Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,1000000,3000000
-2878,NAD83(HARN) / Colorado South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,1000000,3000000
-2879,NAD83(HARN) / Connecticut (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,500000,1000000
-2880,NAD83(HARN) / Delaware (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2881,NAD83(HARN) / Florida East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2882,NAD83(HARN) / Florida West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2883,NAD83(HARN) / Florida North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,1968500
-2884,NAD83(HARN) / Georgia East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2885,NAD83(HARN) / Georgia West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2296583.333,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2886,NAD83(HARN) / Idaho East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2887,NAD83(HARN) / Idaho Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2888,NAD83(HARN) / Idaho West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2624666.667,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2891,NAD83(HARN) / Kentucky North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,1640416.667
-2892,NAD83(HARN) / Kentucky South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,1640416.667,1640416.667
-2893,NAD83(HARN) / Maryland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,1312333.333
-2894,NAD83(HARN) / Massachusetts Mainland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,2460625,656166.667
-2895,NAD83(HARN) / Massachusetts Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,1640416.667
-2896,NAD83(HARN) / Michigan North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,26246719.16
-2897,NAD83(HARN) / Michigan Central (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,19685039.37
-2898,NAD83(HARN) / Michigan South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,13123359.58
-2899,NAD83(HARN) / Mississippi East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2900,NAD83(HARN) / Mississippi West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2296583.333,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2901,NAD83(HARN) / Montana (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,1968503.937
-2902,NAD83(HARN) / New Mexico East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,541337.5,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2903,NAD83(HARN) / New Mexico Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2904,NAD83(HARN) / New Mexico West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2723091.667,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2905,NAD83(HARN) / New York East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2906,NAD83(HARN) / New York Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,820208.333,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2907,NAD83(HARN) / New York West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1148291.667,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2908,NAD83(HARN) / New York Long Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,984250
-2909,NAD83(HARN) / North Dakota North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,1968503.937
-2910,NAD83(HARN) / North Dakota South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,1968503.937
-2911,NAD83(HARN) / Oklahoma North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,1968500
-2912,NAD83(HARN) / Oklahoma South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,1968500
-2913,NAD83(HARN) / Oregon North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,8202099.738
-2914,NAD83(HARN) / Oregon South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,4921259.843
-2915,NAD83(HARN) / Tennessee (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,1968500
-2916,NAD83(HARN) / Texas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,3280833.333,656166.667
-2917,NAD83(HARN) / Texas North Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,6561666.667,1968500
-2918,NAD83(HARN) / Texas Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,9842500,2296583.333
-2919,NAD83(HARN) / Texas South Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,13123333.33,1968500
-2920,NAD83(HARN) / Texas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,16404166.67,984250
-2921,NAD83(HARN) / Utah North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280839.895,1640419.948
-2922,NAD83(HARN) / Utah Central (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561679.79,1640419.948
-2923,NAD83(HARN) / Utah South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842519.685,1640419.948
-2924,NAD83(HARN) / Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,6561666.667,11482916.67
-2925,NAD83(HARN) / Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,3280833.333,11482916.67
-2926,NAD83(HARN) / Washington North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,1640416.667
-2927,NAD83(HARN) / Washington South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,1640416.667
-2928,NAD83(HARN) / Wisconsin North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,1968500
-2929,NAD83(HARN) / Wisconsin Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,1968500
-2930,NAD83(HARN) / Wisconsin South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,1968500
-2931,Beduaram / TM 13 NE,Transverse Mercator,metre,4213,Beduaram,Clarke 1880 (IGN),500000,0,0,13,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2932,QND95 / Qatar National Grid,Transverse Mercator,metre,4614,Qatar National Datum 1995,International 1924,200000,24.27,300000,51.13,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2933,Segara / UTM zone 50S,Transverse Mercator,metre,4820,Gunung Segara,Bessel 1841,500000,0,10000000,117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2935,Pulkovo 1942 / CS63 zone A1,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,1300000,0.07,0,41.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2936,Pulkovo 1942 / CS63 zone A2,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,2300000,0.07,0,44.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2937,Pulkovo 1942 / CS63 zone A3,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,3300000,0.07,0,47.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2938,Pulkovo 1942 / CS63 zone A4,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,4300000,0.07,0,50.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2939,Pulkovo 1942 / CS63 zone K2,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,2300000,0.08,0,50.46,1
-2940,Pulkovo 1942 / CS63 zone K3,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,3300000,0.08,0,53.46,1
-2941,Pulkovo 1942 / CS63 zone K4,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,4300000,0.08,0,56.46,1
-2942,Porto Santo / UTM zone 28N,Transverse Mercator,metre,4615,Porto Santo 1936,International 1924,500000,0,0,-15,0.9996
-2943,Selvagem Grande / UTM zone 28N,Transverse Mercator,metre,4616,Selvagem Grande,International 1924,500000,0,0,-15,0.9996
-2944,NAD83(CSRS) / SCoPQ zone 2,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-55.3,0.9999
-2945,NAD83(CSRS) / MTM zone 3,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-58.3,0.9999
-2946,NAD83(CSRS) / MTM zone 4,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-61.3,0.9999
-2947,NAD83(CSRS) / MTM zone 5,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-64.3,0.9999
-2948,NAD83(CSRS) / MTM zone 6,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-67.3,0.9999
-2949,NAD83(CSRS) / MTM zone 7,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-70.3,0.9999
-2950,NAD83(CSRS) / MTM zone 8,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-73.3,0.9999
-2951,NAD83(CSRS) / MTM zone 9,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-76.3,0.9999
-2952,NAD83(CSRS) / MTM zone 10,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-79.3,0.9999
-2953,NAD83(CSRS) / New Brunswick Stereographic,Oblique Stereographic,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,2500000,46.3,7500000,-66.3,0.999912
-2954,NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83),Oblique Stereographic,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,400000,47.15,800000,-63,0.999912
-2955,NAD83(CSRS) / UTM zone 11N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2956,NAD83(CSRS) / UTM zone 12N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2957,NAD83(CSRS) / UTM zone 13N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2958,NAD83(CSRS) / UTM zone 17N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2959,NAD83(CSRS) / UTM zone 18N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2960,NAD83(CSRS) / UTM zone 19N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2961,NAD83(CSRS) / UTM zone 20N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2962,NAD83(CSRS) / UTM zone 21N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2963,Lisbon 1890 (Lisbon) / Portugal Bonne,Bonne (South Orientated),metre,4666,Lisbon 1890 (Lisbon),Bessel 1841,0,39.4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2964,NAD27 / Alaska Albers,Albers Equal Area,US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,50,-154,55,0,0
-2965,NAD83 / Indiana East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,328083.333,37.3,820208.333,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2966,NAD83 / Indiana West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2952750,37.3,820208.333,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2967,NAD83(HARN) / Indiana East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,328083.333,37.3,820208.333,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2968,NAD83(HARN) / Indiana West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2952750,37.3,820208.333,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2969,Fort Marigot / UTM zone 20N,Transverse Mercator,metre,4621,Fort Marigot,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2970,Guadeloupe 1948 / UTM zone 20N,Transverse Mercator,metre,4622,Guadeloupe 1948,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2971,CSG67 / UTM zone 22N,Transverse Mercator,metre,4623,Centre Spatial Guyanais 1967,International 1924,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2972,RGFG95 / UTM zone 22N,Transverse Mercator,metre,4624,Reseau Geodesique Francais Guyane 1995,GRS 1980,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2973,Martinique 1938 / UTM zone 20N,Transverse Mercator,metre,0,Martinique 1938,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2975,RGR92 / UTM zone 40S,Transverse Mercator,metre,4627,Reseau Geodesique de la Reunion 1992,GRS 1980,500000,0,10000000,57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2976,Tahiti 52 / UTM zone 6S,Transverse Mercator,metre,4628,Tahiti 52,International 1924,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2977,Tahaa 54 / UTM zone 5S,Transverse Mercator,metre,4629,Tahaa 54,International 1924,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2978,IGN72 Nuku Hiva / UTM zone 7S,Transverse Mercator,metre,4630,IGN72 Nuku Hiva,International 1924,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2980,Combani 1950 / UTM zone 38S,Transverse Mercator,metre,4632,Combani 1950,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2981,IGN56 Lifou / UTM zone 58S,Transverse Mercator,metre,4633,IGN56 Lifou,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2985,Petrels 1972 / Terre Adelie Polar Stereographic,Polar Stereographic (variant C),metre,4636,Petrels 1972,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,0,0,200000,300000,-67
-2986,Perroud 1950 / Terre Adelie Polar Stereographic,Polar Stereographic (variant C),metre,4637,Pointe Geologie Perroud 1950,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,0,0,200000,300000,-67
-2987,Saint Pierre et Miquelon 1950 / UTM zone 21N,Transverse Mercator,metre,4638,Saint Pierre et Miquelon 1950,Clarke 1866,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2988,MOP78 / UTM zone 1S,Transverse Mercator,metre,4639,MOP78,International 1924,500000,0,10000000,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2991,NAD83 / Oregon Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,400000,
-2992,NAD83 / Oregon Lambert (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,1312335.958,
-2993,NAD83(HARN) / Oregon Lambert,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,400000,
-2994,NAD83(HARN) / Oregon Lambert (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,1312335.958
-2995,IGN53 Mare / UTM zone 58S,Transverse Mercator,metre,4641,IGN53 Mare,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2996,ST84 Ile des Pins / UTM zone 58S,Transverse Mercator,metre,4642,ST84 Ile des Pins,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2997,ST71 Belep / UTM zone 58S,Transverse Mercator,metre,4643,ST71 Belep,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2998,NEA74 Noumea / UTM zone 58S,Transverse Mercator,metre,4644,NEA74 Noumea,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2999,Grand Comoros / UTM zone 38S,Transverse Mercator,metre,4646,Grand Comoros,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3000,Segara / NEIEZ,Mercator (1SP),metre,4820,Gunung Segara,Bessel 1841,3900000,0,900000,110,0.997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3001,Batavia / NEIEZ,Mercator (1SP),metre,4211,Batavia,Bessel 1841,3900000,0,900000,110,0.997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3002,Makassar / NEIEZ,Mercator (1SP),metre,4257,Makassar,Bessel 1841,3900000,0,900000,110,0.997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3003,Monte Mario / Italy zone 1,Transverse Mercator,metre,4265,Monte Mario,International 1924,1500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3004,Monte Mario / Italy zone 2,Transverse Mercator,metre,4265,Monte Mario,International 1924,2520000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3005,NAD83 / BC Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58.3,45,-126,50,0,1000000
-3006,SWEREF99 TM,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3007,SWEREF99 12 00,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3008,SWEREF99 13 30,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,13.3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3009,SWEREF99 15 00,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3010,SWEREF99 16 30,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,16.3,1
-3011,SWEREF99 18 00,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,18,1
-3012,SWEREF99 14 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,14.15,1
-3013,SWEREF99 15 45,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,15.45,1
-3014,SWEREF99 17 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,17.15,1
-3015,SWEREF99 18 45,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,18.45,1
-3016,SWEREF99 20 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,20.15,1
-3017,SWEREF99 21 45,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,21.45,1
-3018,SWEREF99 23 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,23.15,1
-3019,RT90 7.5 gon V,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,11.18298,1
-3020,RT90 5 gon V,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,13.33298,1
-3021,RT90 2.5 gon V,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,15.48298,1
-3022,RT90 0 gon,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,18.03298,1
-3023,RT90 2.5 gon O,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,20.18298,1
-3024,RT90 5 gon O,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,22.33298,1
-3025,RT38 7.5 gon V,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,11.18298,1
-3026,RT38 5 gon V,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,13.33298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3027,RT38 2.5 gon V,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,15.48298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3028,RT38 0 gon,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,18.03298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3029,RT38 2.5 gon O,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,20.18298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3030,RT38 5 gon O,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,22.33298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3031,WGS 84 / Antarctic Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71
-3032,WGS 84 / Australian Antarctic Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,6000000,0,6000000,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,0,0,-71
-3033,WGS 84 / Australian Antarctic Lambert,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-74.3,-50,70,-68.3,6000000,6000000,
-3034,ETRS89 / ETRS-LCC,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,52,10,35,2800000,4000000,
-3035,ETRS89 / ETRS-LAEA,Lambert Azimuthal Equal Area,metre,4258,European Terrestrial Reference System 1989,GRS 1980,4321000,52,3210000,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3036,Moznet / UTM zone 36S,Transverse Mercator,metre,4130,Moznet (ITRF94),WGS 84,500000,0,10000000,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3037,Moznet / UTM zone 37S,Transverse Mercator,metre,4130,Moznet (ITRF94),WGS 84,500000,0,10000000,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3038,ETRS89 / ETRS-TM26,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3039,ETRS89 / ETRS-TM27,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3040,ETRS89 / ETRS-TM28,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3041,ETRS89 / ETRS-TM29,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3042,ETRS89 / ETRS-TM30,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3043,ETRS89 / ETRS-TM31,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3044,ETRS89 / ETRS-TM32,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3045,ETRS89 / ETRS-TM33,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3046,ETRS89 / ETRS-TM34,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3047,ETRS89 / ETRS-TM35,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3048,ETRS89 / ETRS-TM36,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3049,ETRS89 / ETRS-TM37,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3050,ETRS89 / ETRS-TM38,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3051,ETRS89 / ETRS-TM39,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3052,Reykjavik 1900 / Lambert 1900,Lambert Conic Conformal (West Orientated),metre,4657,Reykjavik 1900,Danish 1876,0,65,0,-19.011965,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3053,Hjorsey 1955 / Lambert 1955,Lambert Conic Conformal (West Orientated),metre,4658,Hjorsey 1955,International 1924,500000,65,500000,-18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3054,Hjorsey 1955 / UTM zone 26N,Transverse Mercator,metre,4658,Hjorsey 1955,International 1924,500000,0,0,-27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3055,Hjorsey 1955 / UTM zone 27N,Transverse Mercator,metre,4658,Hjorsey 1955,International 1924,500000,0,0,-21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3056,Hjorsey 1955 / UTM zone 28N,Transverse Mercator,metre,4658,Hjorsey 1955,International 1924,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3057,ISN93 / Lambert 1993,Lambert Conic Conformal (2SP),metre,4659,Islands Network 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65.45,65,-19,64.15,500000,500000
-3058,Helle 1954 / Jan Mayen Grid,Transverse Mercator,metre,4660,Helle 1954,International 1924,50000,0,-7800000,-8.3,1
-3059,LKS92 / Latvia TM,Transverse Mercator,metre,4661,Latvia 1992,GRS 1980,500000,0,-6000000,24,0.9996
-3060,IGN72 Grande Terre / UTM zone 58S,Transverse Mercator,metre,4662,IGN72 Grande Terre,International 1924,500000,0,10000000,165,0.9996
-3061,Porto Santo 1995 / UTM zone 28N,Transverse Mercator,metre,4663,Porto Santo 1995,International 1924,500000,0,0,-15,0.9996
-3062,Azores Oriental 1995 / UTM zone 26N,Transverse Mercator,metre,4664,Azores Oriental Islands 1995,International 1924,500000,0,0,-27,0.9996
-3063,Azores Central 1995 / UTM zone 26N,Transverse Mercator,metre,4665,Azores Central Islands 1995,International 1924,500000,0,0,-27,0.9996
-3064,IGM95 / UTM zone 32N,Transverse Mercator,metre,4670,Istituto Geografico Militaire 1995,WGS 84,500000,0,0,9,0.9996
-3065,IGM95 / UTM zone 33N,Transverse Mercator,metre,4670,Istituto Geografico Militaire 1995,WGS 84,500000,0,0,15,0.9996
-3066,ED50 / Jordan TM,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,-3000000,37,0.9998
-3067,ETRS89 / ETRS-TM35FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,0.9996
-3068,DHDN / Soldner Berlin,Cassini-Soldner,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,40000,52.25071338,10000,13.37379332,
-3069,NAD27 / Wisconsin Transverse Mercator,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,-4500000,-90,0.9996
-3070,NAD83 / Wisconsin Transverse Mercator,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,520000,0,-4480000,-90,0.9996
-3071,NAD83(HARN) / Wisconsin Transverse Mercator,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,520000,0,-4480000,-90,0.9996
-3072,NAD83 / Maine CS2000 East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,43.5,0,-67.523,0.99998
-3074,NAD83 / Maine CS2000 West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,42.5,0,-70.223,0.99998
-3075,NAD83(HARN) / Maine CS2000 East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,43.5,0,-67.523,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3077,NAD83(HARN) / Maine CS2000 West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,42.5,0,-70.223,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3078,NAD83 / Michigan Oblique Mercator,Hotine Oblique Mercator,metre,4269,North American Datum 1983,GRS 1980,2546731.496,0,-4354009.816,0,0,337.25556,45.1833,0,337.25556,0.9996,0,-86,0,0,0,0,0,0,0,0,
-3079,NAD83(HARN) / Michigan Oblique Mercator,Hotine Oblique Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2546731.496,0,-4354009.816,0,0,337.25556,45.1833,0,337.25556,0.9996,0,-86,0,0,0,0,0,0,0,0,
-3080,NAD27 / Shackleford,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.55,31.1,-100,27.25,3000000,3000000
-3081,NAD83 / Texas State Mapping System,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.55,31.1,-100,27.25,1000000,1000000
-3082,NAD83 / Texas Centric Lambert Conformal,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,5000000,1500000
-3083,NAD83 / Texas Centric Albers Equal Area,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,6000000,1500000
-3084,NAD83(HARN) / Texas Centric Lambert Conformal,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,5000000,1500000
-3085,NAD83(HARN) / Texas Centric Albers Equal Area,Albers Equal Area,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,6000000,1500000
-3086,NAD83 / Florida GDL Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.3,24,-84,24,0,400000
-3087,NAD83(HARN) / Florida GDL Albers,Albers Equal Area,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.3,24,-84,24,0,400000
-3088,NAD83 / Kentucky Single Zone,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,1000000,1500000
-3089,NAD83 / Kentucky Single Zone (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,3280833.333,4921250
-3090,NAD83(HARN) / Kentucky Single Zone,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,1000000,1500000
-3091,NAD83(HARN) / Kentucky Single Zone (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,3280833.333,4921250
-3092,Tokyo / UTM zone 51N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3093,Tokyo / UTM zone 52N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3094,Tokyo / UTM zone 53N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3095,Tokyo / UTM zone 54N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3096,Tokyo / UTM zone 55N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3097,JGD2000 / UTM zone 51N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3098,JGD2000 / UTM zone 52N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3099,JGD2000 / UTM zone 53N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3100,JGD2000 / UTM zone 54N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3101,JGD2000 / UTM zone 55N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3102,American Samoa 1962 / American Samoa Lambert,Lambert Conic Conformal (1SP),US survey foot,4169,American Samoa 1962,Clarke 1866,500000,-14.16,312234.65,-170,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3106,Gulshan 303 / Bangladesh Transverse Mercator,Transverse Mercator,metre,0,Gulshan 303,Everest 1830 (1937 Adjustment),500000,0,0,90,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3107,GDA94 / SA Lambert,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,-32,135,-28,2000000,1000000
-3108,ETRS89 / Guernsey Grid,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,47000,49.3,50000,-2.25,0.999997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3109,ETRS89 / Jersey Transverse Mercator,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,40000,49.225,70000,-2.135,0.9999999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3110,AGD66 / Vicgrid66,Lambert Conic Conformal (2SP),metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-38,-37,145,-36,4500000,2500000
-3111,GDA94 / Vicgrid94,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-38,-37,145,-36,2500000,2500000
-3112,GDA94 / Geoscience Australia Lambert,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,0,134,-18,0,0
-3113,GDA94 / BCSG02,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,50000,-28,100000,153,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3114,MAGNA-SIRGAS / Colombia Far West zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-80.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3115,MAGNA-SIRGAS / Colombia West zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-77.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3116,MAGNA-SIRGAS / Colombia Bogota zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-74.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3117,MAGNA-SIRGAS / Colombia East Central zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-71.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3118,MAGNA-SIRGAS / Colombia East zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-68.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3119,Douala 1948 / AEF west,Transverse Mercator,metre,4192,Douala 1948,International 1924,1000000,0,1000000,10.3,0.999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3120,Pulkovo 1942(58) / Poland zone I,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4637000,50.373,5467000,21.05,0.9998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3121,PRS92 / Philippines zone 1,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,117,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3122,PRS92 / Philippines zone 2,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,119,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3123,PRS92 / Philippines zone 3,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,121,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3124,PRS92 / Philippines zone 4,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,123,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3125,PRS92 / Philippines zone 5,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,125,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3126,ETRS89 / ETRS-GK19FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,19,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3127,ETRS89 / ETRS-GK20FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,20,1
-3128,ETRS89 / ETRS-GK21FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,21,1
-3129,ETRS89 / ETRS-GK22FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,22,1
-3130,ETRS89 / ETRS-GK23FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,23,1
-3131,ETRS89 / ETRS-GK24FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,24,1
-3132,ETRS89 / ETRS-GK25FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,25,1
-3133,ETRS89 / ETRS-GK26FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,26,1
-3134,ETRS89 / ETRS-GK27FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,1
-3135,ETRS89 / ETRS-GK28FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,28,1
-3136,ETRS89 / ETRS-GK29FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,29,1
-3137,ETRS89 / ETRS-GK30FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,30,1
-3138,ETRS89 / ETRS-GK31FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,31,1
-3139,Vanua Levu 1915 / Vanua Levu Grid,Hyperbolic Cassini-Soldner,link,0,Vanua Levu 1915,Clarke 1880 (international foot),1251331.8,-16.15,1662888.5,179.2,
-3140,Viti Levu 1912 / Viti Levu Grid,Cassini-Soldner,link,0,Viti Levu 1912,Clarke 1880 (international foot),544000,-18,704000,178,
-3141,Fiji 1956 / UTM zone 60S,Transverse Mercator,metre,0,Fiji 1956,International 1924,500000,0,10000000,177,0.9996
-3142,Fiji 1956 / UTM zone 1S,Transverse Mercator,metre,0,Fiji 1956,International 1924,500000,0,10000000,-177,0.9996
-3144,FD54 / Faroe Lambert,Lambert Conic Conformal (West Orientated),metre,0,Faroe Datum 1954,International 1924,500000,62,500000,-9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3145,ETRS89 / Faroe Lambert,Lambert Conic Conformal (West Orientated),metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,62,500000,-9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3146,Pulkovo 1942 / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,6500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3147,Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3148,Indian 1960 / UTM zone 48N,Transverse Mercator,metre,4131,Indian 1960,Everest 1830 (1937 Adjustment),500000,0,0,105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3149,Indian 1960 / UTM zone 49N,Transverse Mercator,metre,4131,Indian 1960,Everest 1830 (1937 Adjustment),500000,0,0,111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3150,Pulkovo 1995 / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,6500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3151,Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3152,ST74,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,100178.1808,0,-6500614.784,18.0328044,0.99999425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3153,NAD83(CSRS) / BC Albers,Albers Equal Area,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58.3,45,-126,50,0,1000000
-3154,NAD83(CSRS) / UTM zone 7N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3155,NAD83(CSRS) / UTM zone 8N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3156,NAD83(CSRS) / UTM zone 9N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3157,NAD83(CSRS) / UTM zone 10N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3158,NAD83(CSRS) / UTM zone 14N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3159,NAD83(CSRS) / UTM zone 15N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3160,NAD83(CSRS) / UTM zone 16N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3161,NAD83 / Ontario MNR Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53.5,0,-85,44.5,6430000,930000
-3162,NAD83(CSRS) / Ontario MNR Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53.5,0,-85,44.5,6430000,930000
-3163,RGNC91-93 / Lambert New Caledonia,Lambert Conic Conformal (2SP),metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.2,-21.3,166,-20.4,300000,400000
-3164,ST87 Ouvea / UTM zone 58S,Transverse Mercator,metre,4635,ST87 Ouvea,WGS 84,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3165,NEA74 Noumea / Noumea Lambert,Lambert Conic Conformal (2SP),metre,4644,NEA74 Noumea,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.17408903,-22.16108903,166.2632733,-22.14408903,1.02,0.66
-3166,NEA74 Noumea / Noumea Lambert 2,Lambert Conic Conformal (2SP),metre,4644,NEA74 Noumea,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.1741,-22.1611,166.2633,-22.1441,-2.354,8.313
-3167,Kertau (RSO) / RSO Malaya (ch),Hotine Oblique Mercator,British chain (Sears 1922 truncated),4245,Kertau (RSO),Everest 1830 (RSO 1969),40000,0,0,0,0,323.0132846,4,0,323.0748369,0.99984,0,102.15,0,0,0,0,0,0,0,0,
-3168,Kertau (RSO) / RSO Malaya (m),Hotine Oblique Mercator,metre,4245,Kertau (RSO),Everest 1830 (RSO 1969),804670.24,0,0,0,0,323.0132846,4,0,323.0748369,0.99984,0,102.15,0,0,0,0,0,0,0,0,
-3169,RGNC91-93 / UTM zone 57S,Transverse Mercator,metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,500000,0,10000000,159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3170,RGNC91-93 / UTM zone 58S,Transverse Mercator,metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3171,RGNC91-93 / UTM zone 59S,Transverse Mercator,metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,500000,0,10000000,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3172,IGN53 Mare / UTM zone 59S,Transverse Mercator,metre,4641,IGN53 Mare,International 1924,500000,0,10000000,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3173,fk89 / Faroe Lambert FK89,Lambert Conic Conformal (West Orientated),metre,0,fk89,International 1924,700000,62,700000,-9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3174,NAD83 / Great Lakes Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.01518,45.568977,-84.455955,42.122774,1000000,1000000
-3175,NAD83 / Great Lakes and St Lawrence Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.01518,45.568977,-83.248627,42.122774,1000000,1000000
-3176,Indian 1960 / TM 106 NE,Transverse Mercator,metre,4131,Indian 1960,Everest 1830 (1937 Adjustment),500000,0,0,106,0.9996
-3177,LGD2006 / Libya TM,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,1000000,0,0,17,0.9965
-3178,GR96 / UTM zone 18N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-75,0.9996
-3179,GR96 / UTM zone 19N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-69,0.9996
-3180,GR96 / UTM zone 20N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-63,0.9996
-3181,GR96 / UTM zone 21N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-57,0.9996
-3182,GR96 / UTM zone 22N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-51,0.9996
-3183,GR96 / UTM zone 23N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-45,0.9996
-3184,GR96 / UTM zone 24N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-39,0.9996
-3185,GR96 / UTM zone 25N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-33,0.9996
-3186,GR96 / UTM zone 26N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-27,0.9996
-3187,GR96 / UTM zone 27N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-21,0.9996
-3188,GR96 / UTM zone 28N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-15,0.9996
-3189,GR96 / UTM zone 29N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-9,0.9996
-3190,LGD2006 / Libya TM zone 5,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,9,0.99995
-3191,LGD2006 / Libya TM zone 6,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,11,0.99995
-3192,LGD2006 / Libya TM zone 7,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,13,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3193,LGD2006 / Libya TM zone 8,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,15,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3194,LGD2006 / Libya TM zone 9,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,17,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3195,LGD2006 / Libya TM zone 10,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,19,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3196,LGD2006 / Libya TM zone 11,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,21,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3197,LGD2006 / Libya TM zone 12,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,23,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3198,LGD2006 / Libya TM zone 13,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,25,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3199,LGD2006 / UTM zone 32N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3200,FD58 / Iraq zone,Lambert Conic Conformal (1SP),metre,4132,Final Datum 1958,Clarke 1880 (RGS),1500000,32.3,1166200,45,0.998786408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3201,LGD2006 / UTM zone 33N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3202,LGD2006 / UTM zone 34N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3203,LGD2006 / UTM zone 35N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3204,WGS 84 / SCAR IMW SP19-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-63.2,-90,-66,-60.4,0,0
-3205,WGS 84 / SCAR IMW SP21-22,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-63.2,-90,-54,-60.4,0,0
-3206,WGS 84 / SCAR IMW SP23-24,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-63.2,-90,-42,-60.4,0,0
-3207,WGS 84 / SCAR IMW SQ01-02,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,-174,-64.4,0,0
-3208,WGS 84 / SCAR IMW SQ19-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,-66,-64.4,0,0
-3209,WGS 84 / SCAR IMW SQ21-22,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,-54,-64.4,0,0
-3210,WGS 84 / SCAR IMW SQ37-38,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,42,-64.4,0,0
-3211,WGS 84 / SCAR IMW SQ39-40,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,54,-64.4,0,0
-3212,WGS 84 / SCAR IMW SQ41-42,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,66,-64.4,0,0
-3213,WGS 84 / SCAR IMW SQ43-44,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,78,-64.4,0,0
-3214,WGS 84 / SCAR IMW SQ45-46,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,90,-64.4,0,0
-3215,WGS 84 / SCAR IMW SQ47-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,102,-64.4,0,0
-3216,WGS 84 / SCAR IMW SQ49-50,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,114,-64.4,0,0
-3217,WGS 84 / SCAR IMW SQ51-52,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,126,-64.4,0,0
-3218,WGS 84 / SCAR IMW SQ53-54,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,138,-64.4,0,0
-3219,WGS 84 / SCAR IMW SQ55-56,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,150,-64.4,0,0
-3220,WGS 84 / SCAR IMW SQ57-58,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,162,-64.4,0,0
-3221,WGS 84 / SCAR IMW SR13-14,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-102,-68.4,0,0
-3222,WGS 84 / SCAR IMW SR15-16,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-90,-68.4,0,0
-3223,WGS 84 / SCAR IMW SR17-18,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-78,-68.4,0,0
-3224,WGS 84 / SCAR IMW SR19-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-66,-68.4,0,0
-3225,WGS 84 / SCAR IMW SR27-28,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-18,-68.4,0,0
-3226,WGS 84 / SCAR IMW SR29-30,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-6,-68.4,0,0
-3227,WGS 84 / SCAR IMW SR31-32,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,6,-68.4,0,0
-3228,WGS 84 / SCAR IMW SR33-34,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,18,-68.4,0,0
-3229,WGS 84 / SCAR IMW SR35-36,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,30,-68.4,0,0
-3230,WGS 84 / SCAR IMW SR37-38,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,42,-68.4,0,0
-3231,WGS 84 / SCAR IMW SR39-40,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,54,-68.4,0,0
-3232,WGS 84 / SCAR IMW SR41-42,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,66,-68.4,0,0
-3233,WGS 84 / SCAR IMW SR43-44,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,78,-68.4,0,0
-3234,WGS 84 / SCAR IMW SR45-46,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,90,-68.4,0,0
-3235,WGS 84 / SCAR IMW SR47-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,102,-68.4,0,0
-3236,WGS 84 / SCAR IMW SR49-50,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,114,-68.4,0,0
-3237,WGS 84 / SCAR IMW SR51-52,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,126,-68.4,0,0
-3238,WGS 84 / SCAR IMW SR53-54,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,138,-68.4,0,0
-3239,WGS 84 / SCAR IMW SR55-56,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,150,-68.4,0,0
-3240,WGS 84 / SCAR IMW SR57-58,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,162,-68.4,0,0
-3241,WGS 84 / SCAR IMW SR59-60,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,174,-68.4,0,0
-3242,WGS 84 / SCAR IMW SS04-06,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-153,-72.4,0,0
-3243,WGS 84 / SCAR IMW SS07-09,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-135,-72.4,0,0
-3244,WGS 84 / SCAR IMW SS10-12,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-117,-72.4,0,0
-3245,WGS 84 / SCAR IMW SS13-15,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-99,-72.4,0,0
-3246,WGS 84 / SCAR IMW SS16-18,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-81,-72.4,0,0
-3247,WGS 84 / SCAR IMW SS19-21,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-63,-72.4,0,0
-3248,WGS 84 / SCAR IMW SS25-27,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-27,-72.4,0,0
-3249,WGS 84 / SCAR IMW SS28-30,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-9,-72.4,0,0
-3250,WGS 84 / SCAR IMW SS31-33,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,9,-72.4,0,0
-3251,WGS 84 / SCAR IMW SS34-36,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,27,-72.4,0,0
-3252,WGS 84 / SCAR IMW SS37-39,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,45,-72.4,0,0
-3253,WGS 84 / SCAR IMW SS40-42,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,63,-72.4,0,0
-3254,WGS 84 / SCAR IMW SS43-45,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,81,-72.4,0,0
-3255,WGS 84 / SCAR IMW SS46-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,99,-72.4,0,0
-3256,WGS 84 / SCAR IMW SS49-51,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,117,-72.4,0,0
-3257,WGS 84 / SCAR IMW SS52-54,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,135,-72.4,0,0
-3258,WGS 84 / SCAR IMW SS55-57,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,153,-72.4,0,0
-3259,WGS 84 / SCAR IMW SS58-60,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,171,-72.4,0,0
-3260,WGS 84 / SCAR IMW ST01-04,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-168,-76.4,0,0
-3261,WGS 84 / SCAR IMW ST05-08,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-144,-76.4,0,0
-3262,WGS 84 / SCAR IMW ST09-12,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-120,-76.4,0,0
-3263,WGS 84 / SCAR IMW ST13-16,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-96,-76.4,0,0
-3264,WGS 84 / SCAR IMW ST17-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-72,-76.4,0,0
-3265,WGS 84 / SCAR IMW ST21-24,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-48,-76.4,0,0
-3266,WGS 84 / SCAR IMW ST25-28,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-24,-76.4,0,0
-3267,WGS 84 / SCAR IMW ST29-32,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,0,-76.4,0,0
-3268,WGS 84 / SCAR IMW ST33-36,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,24,-76.4,0,0
-3269,WGS 84 / SCAR IMW ST37-40,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,48,-76.4,0,0
-3270,WGS 84 / SCAR IMW ST41-44,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,72,-76.4,0,0
-3271,WGS 84 / SCAR IMW ST45-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,96,-76.4,0,0
-3272,WGS 84 / SCAR IMW ST49-52,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,120,-76.4,0,0,
-3273,WGS 84 / SCAR IMW ST53-56,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,144,-76.4,0,0,
-3274,WGS 84 / SCAR IMW ST57-60,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,168,-76.4,0,0,
-3275,WGS 84 / SCAR IMW SU01-05,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-165,0,0,0,0,0,0,-80.1419
-3276,WGS 84 / SCAR IMW SU06-10,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-135,0,0,0,0,0,0,-80.1419
-3277,WGS 84 / SCAR IMW SU11-15,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-105,0,0,0,0,0,0,-80.1419
-3278,WGS 84 / SCAR IMW SU16-20,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75,0,0,0,0,0,0,-80.1419
-3279,WGS 84 / SCAR IMW SU21-25,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-45,0,0,0,0,0,0,-80.1419
-3280,WGS 84 / SCAR IMW SU26-30,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,0,0,0,0,0,-80.1419
-3281,WGS 84 / SCAR IMW SU31-35,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,-80.1419
-3282,WGS 84 / SCAR IMW SU36-40,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0,0,0,0,-80.1419
-3283,WGS 84 / SCAR IMW SU41-45,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,0,0,0,0,0,-80.1419
-3284,WGS 84 / SCAR IMW SU46-50,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,0,0,0,0,-80.1419
-3285,WGS 84 / SCAR IMW SU51-55,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,0,0,0,0,0,0,-80.1419
-3286,WGS 84 / SCAR IMW SU56-60,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,-80.1419
-3287,WGS 84 / SCAR IMW SV01-10,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-150,0,0,0,0,0,0,-80.1419
-3288,WGS 84 / SCAR IMW SV11-20,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-90,0,0,0,0,0,0,-80.1419
-3289,WGS 84 / SCAR IMW SV21-30,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-30,0,0,0,0,0,0,-80.1419
-3290,WGS 84 / SCAR IMW SV31-40,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,0,0,0,-80.1419
-3291,WGS 84 / SCAR IMW SV41-50,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,0,0,0,0,0,0,-80.1419
-3292,WGS 84 / SCAR IMW SV51-60,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,0,0,0,0,0,0,-80.1419
-3293,WGS 84 / SCAR IMW SW01-60,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-80.1419
-3294,WGS 84 / USGS Transantarctic Mountains,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-78,162,-76.4,0,0,
-3295,Guam 1963 / Yap Islands,Modified Azimuthal Equidistant,metre,0,Guam 1963,Clarke 1866,40000,9.324815,60000,138.100748,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3296,RGPF / UTM zone 5S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3297,RGPF / UTM zone 6S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3298,RGPF / UTM zone 7S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3299,RGPF / UTM zone 8S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3300,Estonian Coordinate System of 1992,Lambert Conic Conformal (2SP),metre,0,Estonia 1992,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,57.31031942,24,59.2,6375000,500000,
-3301,Estonian Coordinate System of 1997,Lambert Conic Conformal (2SP),metre,0,Estonia 1997,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,57.31031942,24,59.2,6375000,500000,
-3302,IGN63 Hiva Oa / UTM zone 7S,Transverse Mercator,metre,0,IGN63 Hiva Oa,International 1924,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3303,Fatu Iva 72 / UTM zone 7S,Transverse Mercator,metre,0,Fatu Iva 72,International 1924,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3304,Tahiti 79 / UTM zone 6S,Transverse Mercator,metre,0,Tahiti 79,International 1924,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3305,Moorea 87 / UTM zone 6S,Transverse Mercator,metre,0,Moorea 87,International 1924,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3306,Maupiti 83 / UTM zone 5S,Transverse Mercator,metre,0,Maupiti 83,International 1924,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3307,Nakhl-e Ghanem / UTM zone 39N,Transverse Mercator,metre,0,Nakhl-e Ghanem,WGS 84,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3308,GDA94 / NSW Lambert,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-35.75,-33.25,147,-30.75,4500000,9300000
-3309,NAD27 / California Albers,Albers Equal Area,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
-3310,NAD83 / California Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
-3311,NAD83(HARN) / California Albers,Albers Equal Area,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
-3312,CSG67 / UTM zone 21N,Transverse Mercator,metre,4623,Centre Spatial Guyanais 1967,International 1924,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3313,RGFG95 / UTM zone 21N,Transverse Mercator,metre,4624,Reseau Geodesique Francais Guyane 1995,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3316,Kasai 1953 / Congo TM zone 22,Transverse Mercator,metre,0,Kasai 1953,Clarke 1880 (RGS),500000,0,10000000,22,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3317,Kasai 1953 / Congo TM zone 24,Transverse Mercator,metre,0,Kasai 1953,Clarke 1880 (RGS),500000,0,10000000,24,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3318,IGC 1962 / Congo TM zone 12,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,12,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3319,IGC 1962 / Congo TM zone 14,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,14,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3320,IGC 1962 / Congo TM zone 16,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,16,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3321,IGC 1962 / Congo TM zone 18,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,18,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3322,IGC 1962 / Congo TM zone 20,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,20,0.9999
-3323,IGC 1962 / Congo TM zone 22,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,22,0.9999
-3324,IGC 1962 / Congo TM zone 24,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,24,0.9999
-3325,IGC 1962 / Congo TM zone 26,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,26,0.9999
-3326,IGC 1962 / Congo TM zone 28,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,28,0.9999
-3327,IGC 1962 / Congo TM zone 30,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,30,0.9999
-3328,Pulkovo 1942(58) / GUGiK-80,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,500000,52.1,500000,19.1,0.999714
-3329,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,5500000,0,0,15,1
-3330,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,6500000,0,0,18,1
-3331,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,7500000,0,0,21,1
-3332,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,8500000,0,0,24,1
-3333,Pulkovo 1942(58) / Gauss-Kruger zone 3,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3500000,0,0,15,1
-3334,Pulkovo 1942(58) / Gauss-Kruger zone 4,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4500000,0,0,21,1
-3335,Pulkovo 1942(58) / Gauss-Kruger zone 5,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,5500000,0,0,27,1
-3336,IGN 1962 Kerguelen / UTM zone 42S,Transverse Mercator,metre,0,IGN 1962 Kerguelen,International 1924,500000,0,10000000,69,0.9996
-3337,Le Pouce 1934 / Mauritius Grid,Lambert Conic Conformal (1SP),metre,0,Le Pouce 1934,Clarke 1880 (RGS),1000000,-20.114225,1000000,57.311858,1
-3338,NAD83 / Alaska Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,50,-154,55,0,0
-3339,IGCB 1955 / Congo TM zone 12,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,12,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3340,IGCB 1955 / Congo TM zone 14,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,14,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3341,IGCB 1955 / Congo TM zone 16,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,16,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3342,IGCB 1955 / UTM zone 33S,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3343,Mauritania 1999 / UTM zone 28N,Transverse Mercator,metre,0,Mauritania 1999,GRS 1980,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3344,Mauritania 1999 / UTM zone 29N,Transverse Mercator,metre,0,Mauritania 1999,GRS 1980,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3345,Mauritania 1999 / UTM zone 30N,Transverse Mercator,metre,0,Mauritania 1999,GRS 1980,500000,0,0,-3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3346,LKS94 / Lithuania TM,Transverse Mercator,metre,4669,Lithuania 1994 (ETRS89),GRS 1980,500000,0,0,24,0.9998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3347,NAD83 / Statistics Canada Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,63.390675,-91.52,49,3000000,6200000
-3348,NAD83(CSRS) / Statistics Canada Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,63.390675,-91.52,49,3000000,6200000
-3350,Pulkovo 1942 / CS63 zone C0,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,250000,0.06,0,21.57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3351,Pulkovo 1942 / CS63 zone C1,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,1250000,0.06,0,24.57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3352,Pulkovo 1942 / CS63 zone C2,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,2250000,0.06,0,27.57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3353,Mhast (onshore) / UTM zone 32S,Transverse Mercator,metre,4264,Mhast (onshore),International 1924,500000,0,10000000,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3354,Mhast (offshore) / UTM zone 32S,Transverse Mercator,metre,4264,Mhast (offshore),International 1924,500000,0,10000000,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3355,Egypt Gulf of Suez S-650 TL / Red Belt,Transverse Mercator,metre,0,Egypt Gulf of Suez S-650 TL,Helmert 1906,615000,30,810000,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3356,Grand Cayman 1959 / UTM zone 17N,Transverse Mercator,metre,0,Grand Cayman 1959,Clarke 1866,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3357,Little Cayman 1961 / UTM zone 17N,Transverse Mercator,metre,0,Little Cayman 1961,Clarke 1866,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3358,NAD83(HARN) / North Carolina,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,609601.22
-3360,NAD83(HARN) / South Carolina,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,609600
-3361,NAD83(HARN) / South Carolina (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,2000000
-3362,NAD83(HARN) / Pennsylvania North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,600000
-3363,NAD83(HARN) / Pennsylvania North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,1968500
-3364,NAD83(HARN) / Pennsylvania South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,600000
-3365,NAD83(HARN) / Pennsylvania South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,1968500
-3367,IGN Astro 1960 / UTM zone 28N,Transverse Mercator,metre,0,IGN Astro 1960,Clarke 1880 (RGS),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3368,IGN Astro 1960 / UTM zone 29N,Transverse Mercator,metre,0,IGN Astro 1960,Clarke 1880 (RGS),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3369,IGN Astro 1960 / UTM zone 30N,Transverse Mercator,metre,0,IGN Astro 1960,Clarke 1880 (RGS),500000,0,0,-3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3370,NAD27 / UTM zone 59N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3371,NAD27 / UTM zone 60N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3372,NAD83 / UTM zone 59N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3373,NAD83 / UTM zone 60N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3374,FD54 / UTM zone 29N,Transverse Mercator,metre,0,Faroe Datum 1954,International 1924,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3375,GDM2000 / Peninsula RSO,Hotine Oblique Mercator,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,804671,0,0,0,0,323.0132867,4,0,323.0748369,0.99984,0,102.15,0,0,0,0,0,0,
-3376,GDM2000 / East Malaysia BRSO,Hotine Oblique Mercator,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,0,0,0,0,0,53.18569158,4,0,53.07483685,0.99984,0,115,0,0,0,0,0,0,
-3377,GDM2000 / Johor Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-14810.562,2.071804708,8758.32,103.254057,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3378,GDM2000 / Sembilan and Melaka Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,3673.785,2.405645149,-4240.573,101.5829658,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3379,GDM2000 / PahangGrid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-7368.228,3.460979712,6485.858,102.2205876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3380,GDM2000 / Selangor Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-34836.161,3.410473658,56464.049,101.2320788,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3381,GDM2000 / Terengganu Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,19594.245,4.583462672,3371.895,103.0412992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3382,GDM2000 / Pinang Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-23.414,5.251746315,62.283,100.2039757,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3383,GDM2000 / Kedah and Perlis Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,0,5.575282177,0,100.3810936,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3384,GDM2000 / Perak Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-1.769,4.513262688,133454.779,100.4855478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3385,GDM2000 / Kelantan Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,13227.851,5.582115717,8739.894,102.174287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3386,KKJ / Finland zone 0,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3387,KKJ / Finland zone 5,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,5500000,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3388,Pulkovo 1942 / Caspian Sea Mercator,Mercator (2SP),metre,4284,Pulkovo 1942,Krassowsky 1940,0,0,0,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42
-3389,Pulkovo 1942 / 3-degree Gauss-Kruger zone 60,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,60500000,0,0,180,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3390,Pulkovo 1995 / 3-degree Gauss-Kruger zone 60,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,60500000,0,0,180,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3391,Karbala 1979 / UTM zone 37N,Transverse Mercator,metre,0,Karbala 1979,Clarke 1880 (RGS),500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3392,Karbala 1979 / UTM zone 38N,Transverse Mercator,metre,0,Karbala 1979,Clarke 1880 (RGS),500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3393,Karbala 1979 / UTM zone 39N,Transverse Mercator,metre,0,Karbala 1979,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3394,Nahrwan 1934 / Iraq zone,Lambert Conic Conformal (1SP),metre,0,Nahrwan 1934,Clarke 1880 (RGS),1500000,32.3,1166200,45,0.998786408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3395,WGS 84 / World Mercator,Mercator (1SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3396,PD/83 / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,0,Potsdam Datum/83,Bessel 1841,3500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3397,PD/83 / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,0,Potsdam Datum/83,Bessel 1841,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3398,RD/83 / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,0,Rauenberg Datum/83,Bessel 1841,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3399,RD/83 / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,0,Rauenberg Datum/83,Bessel 1841,5500000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3400,NAD83 / Alberta 10-TM (Forest),Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3401,NAD83 / Alberta 10-TM (Resource),Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3402,NAD83(CSRS) / Alberta 10-TM (Forest),Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3403,NAD83(CSRS) / Alberta 10-TM (Resource),Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3404,NAD83(HARN) / North Carolina (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,2000000
-3405,VN-2000 / UTM zone 48N,Transverse Mercator,metre,0,Vietnam 2000,WGS 84,500000,0,0,105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3406,VN-2000 / UTM zone 49N,Transverse Mercator,metre,0,Vietnam 2000,WGS 84,500000,0,0,111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3407,Hong Kong 1963 Grid System,Cassini-Soldner,Clarke's foot,0,Hong Kong 1963,Clarke 1858,132033.92,22.184368,62565.96,114.10428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3408,NSIDC EASE-Grid North,Lambert Azimuthal Equal Area (Spherical),metre,0,Not specified (based on International 1924 Authalic Sphere),International 1924 Authalic Sphere,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3409,NSIDC EASE-Grid South,Lambert Azimuthal Equal Area (Spherical),metre,0,Not specified (based on International 1924 Authalic Sphere),International 1924 Authalic Sphere,0,-90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3410,NSIDC EASE-Grid Global,Lambert Cylindrical Equal Area (Spherical),metre,0,Not specified (based on International 1924 Authalic Sphere),International 1924 Authalic Sphere,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,
-3411,NSIDC Sea Ice Polar Stereographic North,Polar Stereographic (variant B),metre,0,Not specified (based on Hughes 1980 ellipsoid),Hughes 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-45,0,0,0,0,0,0,70
-3412,NSIDC Sea Ice Polar Stereographic South,Polar Stereographic (variant B),metre,0,Not specified (based on Hughes 1980 ellipsoid),Hughes 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-70
-3413,WGS 84 / NSIDC Sea Ice Polar Stereographic North,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-45,0,0,0,0,0,0,70
-3414,SVY21 / Singapore TM,Transverse Mercator,metre,0,SVY21,WGS 84,28001.642,1.22,38744.572,103.5,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3415,WGS 72BE / South China Sea Lambert,Lambert Conic Conformal (2SP),metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,21,114,18,500000,500000,
-3416,ETRS89 / Austria Lambert,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,47.3,13.2,49,400000,400000,
-3417,NAD83 / Iowa North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,3280833.333,4921250,
-3418,NAD83 / Iowa South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,1640416.667,
-3419,NAD83 / Kansas North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,1312333.333,
-3420,NAD83 / Kansas South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,1312333.333,1312333.333,
-3421,NAD83 / Nevada East (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.6667,34.45,26246666.67,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3422,NAD83 / Nevada Central (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,34.45,19685000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3423,NAD83 / Nevada West (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2624666.667,34.45,13123333.33,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3424,NAD83 / New Jersey (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3425,NAD83(HARN) / Iowa North (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,3280833.333,4921250
-3426,NAD83(HARN) / Iowa South (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,1640416.667
-3427,NAD83(HARN) / Kansas North (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,1312333.333
-3428,NAD83(HARN) / Kansas South (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,1312333.333,1312333.333
-3429,NAD83(HARN) / Nevada East (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.6667,34.45,26246666.67,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3430,NAD83(HARN) / Nevada Central (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,34.45,19685000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3431,NAD83(HARN) / Nevada West (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2624666.667,34.45,13123333.33,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3432,NAD83(HARN) / New Jersey (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3433,NAD83 / Arkansas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,1312333.333
-3434,NAD83 / Arkansas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,1312333.333,1312333.333
-3435,NAD83 / Illinois East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3436,NAD83 / Illinois West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2296583.333,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3437,NAD83 / New Hampshire (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3438,NAD83 / Rhode Island (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,328083.3333,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3439,PSD93 / UTM zone 39N,Transverse Mercator,metre,4134,PDO Survey Datum 1993,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3440,PSD93 / UTM zone 40N,Transverse Mercator,metre,4134,PDO Survey Datum 1993,Clarke 1880 (RGS),500000,0,0,57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3441,NAD83(HARN) / Arkansas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,1312333.333
-3442,NAD83(HARN) / Arkansas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,1312333.333,1312333.333
-3443,NAD83(HARN) / Illinois East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3444,NAD83(HARN) / Illinois West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2296583.333,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3445,NAD83(HARN) / New Hampshire (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3446,NAD83(HARN) / Rhode Island (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,328083.3333,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3447,ETRS89 / Belgian Lambert 2005,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,50.4752134,4.2133177,49.5,166262,150328
-3448,JAD2001 / Jamaica Metric Grid,Lambert Conic Conformal (1SP),metre,0,Jamaica 2001,WGS 84,750000,18,650000,-77,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3449,JAD2001 / UTM zone 17N,Transverse Mercator,metre,0,Jamaica 2001,WGS 84,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3450,JAD2001 / UTM zone 18N,Transverse Mercator,metre,0,Jamaica 2001,WGS 84,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3451,NAD83 / Louisiana North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,3280833.333
-3452,NAD83 / Louisiana South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,3280833.333
-3453,NAD83 / Louisiana Offshore (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.3,-91.2,27.5,0,3280833.333
-3455,NAD83 / South Dakota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,1968500
-3456,NAD83(HARN) / Louisiana North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,3280833.333
-3457,NAD83(HARN) / Louisiana South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,3280833.333
-3458,NAD83(HARN) / South Dakota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,1968500
-3459,NAD83(HARN) / South Dakota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,1968500
-3460,Fiji 1986 / Fiji Map Grid,Transverse Mercator,metre,0,Fiji Geodetic Datum 1986,WGS 72,2000000,-17,4000000,178.45,0.99985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3461,Dabola 1981 / UTM zone 28N,Transverse Mercator,metre,0,Dabola 1981,Clarke 1880 (IGN),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3462,Dabola 1981 / UTM zone 29N,Transverse Mercator,metre,0,Dabola 1981,Clarke 1880 (IGN),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3463,NAD83 / Maine CS2000 Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,43.3,0,-69.073,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3464,NAD83(HARN) / Maine CS2000 Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,43.3,0,-69.073,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3465,NAD83(NSRS2007) / Alabama East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,30.3,0,-85.5,0.99996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3466,NAD83(NSRS2007) / Alabama West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,600000,30,0,-87.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3467,NAD83(NSRS2007) / Alaska Albers,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,50,-154,55,0,0
-3468,NAD83(NSRS2007) / Alaska zone 1,Hotine Oblique Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,5000000,0,-5000000,0,0,323.0748369,57,0,323.0748369,0.9999,0,-133.4,0,0,0,0,0,0,0,0,
-3469,NAD83(NSRS2007) / Alaska zone 2,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-142,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3470,NAD83(NSRS2007) / Alaska zone 3,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-146,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3471,NAD83(NSRS2007) / Alaska zone 4,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-150,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3472,NAD83(NSRS2007) / Alaska zone 5,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-154,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3473,NAD83(NSRS2007) / Alaska zone 6,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-158,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3474,NAD83(NSRS2007) / Alaska zone 7,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-162,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3475,NAD83(NSRS2007) / Alaska zone 8,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-166,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3476,NAD83(NSRS2007) / Alaska zone 9,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-170,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3477,NAD83(NSRS2007) / Alaska zone 10,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.5,51,-176,53.5,0,1000000
-3478,NAD83(NSRS2007) / Arizona Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,213360,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3479,NAD83(NSRS2007) / Arizona Central (ft),Transverse Mercator,foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3480,NAD83(NSRS2007) / Arizona East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,213360,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3481,NAD83(NSRS2007) / Arizona East (ft),Transverse Mercator,foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3482,NAD83(NSRS2007) / Arizona West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,213360,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3483,NAD83(NSRS2007) / Arizona West (ft),Transverse Mercator,foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3484,NAD83(NSRS2007) / Arkansas North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,400000
-3485,NAD83(NSRS2007) / Arkansas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,1312333.333
-3486,NAD83(NSRS2007) / Arkansas South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,400000,400000
-3487,NAD83(NSRS2007) / Arkansas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,1312333.333,1312333.333
-3488,NAD83(NSRS2007) / California Albers,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
-3489,NAD83(NSRS2007) / California zone 1,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,500000,2000000
-3490,NAD83(NSRS2007) / California zone 1 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,1640416.667,6561666.667
-3491,NAD83(NSRS2007) / California zone 2,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,500000,2000000
-3492,NAD83(NSRS2007) / California zone 2 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,1640416.667,6561666.667
-3493,NAD83(NSRS2007) / California zone 3,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,500000,2000000
-3494,NAD83(NSRS2007) / California zone 3 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,1640416.667,6561666.667
-3495,NAD83(NSRS2007) / California zone 4,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,500000,2000000
-3496,NAD83(NSRS2007) / California zone 4 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,1640416.667,6561666.667
-3497,NAD83(NSRS2007) / California zone 5,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,500000,2000000
-3498,NAD83(NSRS2007) / California zone 5 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,1640416.667,6561666.667
-3499,NAD83(NSRS2007) / California zone 6,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,500000,2000000
-3500,NAD83(NSRS2007) / California zone 6 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,1640416.667,6561666.667
-3501,NAD83(NSRS2007) / Colorado Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,304800.6096,914401.8289
-3502,NAD83(NSRS2007) / Colorado Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,1000000,3000000
-3503,NAD83(NSRS2007) / Colorado North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,304800.6096,914401.8289
-3504,NAD83(NSRS2007) / Colorado North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,1000000,3000000
-3505,NAD83(NSRS2007) / Colorado South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,304800.6096,914401.8289
-3506,NAD83(NSRS2007) / Colorado South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,1000000,3000000
-3507,NAD83(NSRS2007) / Connecticut,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,152400.3048,304800.6096
-3508,NAD83(NSRS2007) / Connecticut (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,500000,1000000
-3509,NAD83(NSRS2007) / Delaware,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3510,NAD83(NSRS2007) / Delaware (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3511,NAD83(NSRS2007) / Florida East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3512,NAD83(NSRS2007) / Florida East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3513,NAD83(NSRS2007) / Florida GDL Albers,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.3,24,-84,24,0,400000
-3514,NAD83(NSRS2007) / Florida North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,600000
-3515,NAD83(NSRS2007) / Florida North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,1968500
-3516,NAD83(NSRS2007) / Florida West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3517,NAD83(NSRS2007) / Florida West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3518,NAD83(NSRS2007) / Georgia East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,30,0,-82.1,0.9999
-3519,NAD83(NSRS2007) / Georgia East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,30,0,-82.1,0.9999
-3520,NAD83(NSRS2007) / Georgia West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,30,0,-84.1,0.9999
-3521,NAD83(NSRS2007) / Georgia West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2296583.333,30,0,-84.1,0.9999
-3522,NAD83(NSRS2007) / Idaho Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,41.4,0,-114,0.999947368
-3523,NAD83(NSRS2007) / Idaho Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1640416.667,41.4,0,-114,0.999947368
-3524,NAD83(NSRS2007) / Idaho East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,41.4,0,-112.1,0.999947368
-3525,NAD83(NSRS2007) / Idaho East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,41.4,0,-112.1,0.999947368
-3526,NAD83(NSRS2007) / Idaho West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,800000,41.4,0,-115.45,0.999933333
-3527,NAD83(NSRS2007) / Idaho West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2624666.667,41.4,0,-115.45,0.999933333
-3528,NAD83(NSRS2007) / Illinois East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,36.4,0,-88.2,0.999975
-3529,NAD83(NSRS2007) / Illinois East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,36.4,0,-88.2,0.999975
-3530,NAD83(NSRS2007) / Illinois West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,36.4,0,-90.1,0.999941177
-3531,NAD83(NSRS2007) / Illinois West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2296583.333,36.4,0,-90.1,0.999941177
-3532,NAD83(NSRS2007) / Indiana East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,100000,37.3,250000,-85.4,0.999966667
-3533,NAD83(NSRS2007) / Indiana East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,328083.333,37.3,820208.333,-85.4,0.999966667
-3534,NAD83(NSRS2007) / Indiana West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,900000,37.3,250000,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3535,NAD83(NSRS2007) / Indiana West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2952750,37.3,820208.333,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3536,NAD83(NSRS2007) / Iowa North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,1000000,1500000
-3537,NAD83(NSRS2007) / Iowa North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,3280833.333,4921250
-3538,NAD83(NSRS2007) / Iowa South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,500000
-3539,NAD83(NSRS2007) / Iowa South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,1640416.667
-3540,NAD83(NSRS2007) / Kansas North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,400000
-3541,NAD83(NSRS2007) / Kansas North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,1312333.333
-3542,NAD83(NSRS2007) / Kansas South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,400000,400000
-3543,NAD83(NSRS2007) / Kansas South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,1312333.333,1312333.333
-3544,NAD83(NSRS2007) / Kentucky North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,500000
-3545,NAD83(NSRS2007) / Kentucky North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,1640416.667
-3546,NAD83(NSRS2007) / Kentucky Single Zone,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,1000000,1500000
-3547,NAD83(NSRS2007) / Kentucky Single Zone (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,3280833.333,4921250
-3548,NAD83(NSRS2007) / Kentucky South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,500000,500000
-3549,NAD83(NSRS2007) / Kentucky South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,1640416.667,1640416.667
-3550,NAD83(NSRS2007) / Louisiana North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,1000000
-3551,NAD83(NSRS2007) / Louisiana North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,3280833.333
-3552,NAD83(NSRS2007) / Louisiana South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,1000000
-3553,NAD83(NSRS2007) / Louisiana South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,3280833.333
-3554,NAD83(NSRS2007) / Maine CS2000 Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,43.3,0,-69.073,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3555,NAD83(NSRS2007) / Maine CS2000 East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,43.5,0,-67.523,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3556,NAD83(NSRS2007) / Maine CS2000 West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,42.5,0,-70.223,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3557,NAD83(NSRS2007) / Maine East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3558,NAD83(NSRS2007) / Maine West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,900000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3559,NAD83(NSRS2007) / Maryland,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,400000
-3560,NAD83 / Utah North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280833.333,1640416.667
-3561,Old Hawaiian / Hawaii zone 1,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,18.5,0,-155.3,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3562,Old Hawaiian / Hawaii zone 2,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,20.2,0,-156.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3563,Old Hawaiian / Hawaii zone 3,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3564,Old Hawaiian / Hawaii zone 4,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,21.5,0,-159.3,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3565,Old Hawaiian / Hawaii zone 5,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,21.4,0,-160.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3566,NAD83 / Utah Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561666.667,1640416.667
-3567,NAD83 / Utah South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842500,1640416.667
-3568,NAD83(HARN) / Utah North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280833.333,1640416.667
-3569,NAD83(HARN) / Utah Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561666.667,1640416.667
-3570,NAD83(HARN) / Utah South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842500,1640416.667
-3571,WGS 84 / North Pole LAEA Bering Sea,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3572,WGS 84 / North Pole LAEA Alaska,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,-150,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3573,WGS 84 / North Pole LAEA Canada,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3574,WGS 84 / North Pole LAEA Atlantic,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,-40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3575,WGS 84 / North Pole LAEA Europe,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3576,WGS 84 / North Pole LAEA Russia,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3577,GDA94 / Australian Albers,Albers Equal Area,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,0,132,-18,0,0
-3578,NAD83 / Yukon Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,59,-132.3,61.4,500000,500000
-3579,NAD83(CSRS) / Yukon Albers,Albers Equal Area,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,59,-132.3,61.4,500000,500000
-3580,NAD83 / NWT Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,-112,62,0,0
-3581,NAD83(CSRS) / NWT Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,-112,62,0,0
-3582,NAD83(NSRS2007) / Maryland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,1312333.333
-3583,NAD83(NSRS2007) / Massachusetts Island,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,500000
-3584,NAD83(NSRS2007) / Massachusetts Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,1640416.667
-3585,NAD83(NSRS2007) / Massachusetts Mainland,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,750000,200000
-3586,NAD83(NSRS2007) / Massachusetts Mainland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,2460625,656166.667
-3587,NAD83(NSRS2007) / Michigan Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,6000000
-3588,NAD83(NSRS2007) / Michigan Central (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,19685039.37
-3589,NAD83(NSRS2007) / Michigan North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,8000000
-3590,NAD83(NSRS2007) / Michigan North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,26246719.16
-3591,NAD83(NSRS2007) / Michigan Oblique Mercator,Hotine Oblique Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2546731.496,0,-4354009.816,0,0,337.25556,45.1833,0,337.25556,0.9996,0,-86,0,0,0,0,0,0,0,0,
-3592,NAD83(NSRS2007) / Michigan South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,4000000
-3593,NAD83(NSRS2007) / Michigan South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,13123359.58
-3594,NAD83(NSRS2007) / Minnesota Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,100000,800000
-3595,NAD83(NSRS2007) / Minnesota North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,100000,800000
-3596,NAD83(NSRS2007) / Minnesota South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,100000,800000
-3597,NAD83(NSRS2007) / Mississippi East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3598,NAD83(NSRS2007) / Mississippi East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3599,NAD83(NSRS2007) / Mississippi West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3600,NAD83(NSRS2007) / Mississippi West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2296583.333,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3601,NAD83(NSRS2007) / Missouri Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3602,NAD83(NSRS2007) / Missouri East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,250000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3603,NAD83(NSRS2007) / Missouri West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,850000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3604,NAD83(NSRS2007) / Montana,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,600000
-3605,NAD83(NSRS2007) / Montana (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,1968503.937
-3606,NAD83(NSRS2007) / Nebraska,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,500000
-3607,NAD83(NSRS2007) / Nevada Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,34.45,6000000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3608,NAD83(NSRS2007) / Nevada Central (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1640416.667,34.45,19685000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3609,NAD83(NSRS2007) / Nevada East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,34.45,8000000,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3610,NAD83(NSRS2007) / Nevada East (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.6667,34.45,26246666.67,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3611,NAD83(NSRS2007) / Nevada West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,800000,34.45,4000000,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3612,NAD83(NSRS2007) / Nevada West (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2624666.667,34.45,13123333.33,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3613,NAD83(NSRS2007) / New Hampshire,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3614,NAD83(NSRS2007) / New Hampshire (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3615,NAD83(NSRS2007) / New Jersey,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3616,NAD83(NSRS2007) / New Jersey (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3617,NAD83(NSRS2007) / New Mexico Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3618,NAD83(NSRS2007) / New Mexico Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1640416.667,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3619,NAD83(NSRS2007) / New Mexico East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,165000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3620,NAD83(NSRS2007) / New Mexico East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,541337.5,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3621,NAD83(NSRS2007) / New Mexico West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,830000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3622,NAD83(NSRS2007) / New Mexico West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2723091.667,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3623,NAD83(NSRS2007) / New York Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,250000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3624,NAD83(NSRS2007) / New York Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,820208.333,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3625,NAD83(NSRS2007) / New York East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3626,NAD83(NSRS2007) / New York East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3627,NAD83(NSRS2007) / New York Long Island,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,300000
-3628,NAD83(NSRS2007) / New York Long Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,984250
-3629,NAD83(NSRS2007) / New York West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,350000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3630,NAD83(NSRS2007) / New York West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1148291.667,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3631,NAD83(NSRS2007) / North Carolina,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,609601.22
-3632,NAD83(NSRS2007) / North Carolina (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,2000000
-3633,NAD83(NSRS2007) / North Dakota North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,600000
-3634,NAD83(NSRS2007) / North Dakota North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,1968503.937
-3635,NAD83(NSRS2007) / North Dakota South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,600000
-3636,NAD83(NSRS2007) / North Dakota South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,1968503.937
-3637,NAD83(NSRS2007) / Ohio North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,600000
-3638,NAD83(NSRS2007) / Ohio South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,600000
-3639,NAD83(NSRS2007) / Oklahoma North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,600000
-3640,NAD83(NSRS2007) / Oklahoma North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,1968500
-3641,NAD83(NSRS2007) / Oklahoma South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,600000
-3642,NAD83(NSRS2007) / Oklahoma South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,1968500
-3643,NAD83(NSRS2007) / Oregon Lambert,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,400000
-3644,NAD83(NSRS2007) / Oregon Lambert (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,1312335.958
-3645,NAD83(NSRS2007) / Oregon North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,2500000
-3646,NAD83(NSRS2007) / Oregon North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,8202099.738
-3647,NAD83(NSRS2007) / Oregon South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,1500000
-3648,NAD83(NSRS2007) / Oregon South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,4921259.843
-3649,NAD83(NSRS2007) / Pennsylvania North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,600000
-3650,NAD83(NSRS2007) / Pennsylvania North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,1968500
-3651,NAD83(NSRS2007) / Pennsylvania South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,600000
-3652,NAD83(NSRS2007) / Pennsylvania South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,1968500
-3653,NAD83(NSRS2007) / Rhode Island,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,100000,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3654,NAD83(NSRS2007) / Rhode Island (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,328083.3333,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3655,NAD83(NSRS2007) / South Carolina,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,609600
-3656,NAD83(NSRS2007) / South Carolina (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,2000000
-3657,NAD83(NSRS2007) / South Dakota North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,600000
-3658,NAD83(NSRS2007) / South Dakota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,1968500
-3659,NAD83(NSRS2007) / South Dakota South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,600000
-3660,NAD83(NSRS2007) / South Dakota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,1968500
-3661,NAD83(NSRS2007) / Tennessee,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,600000
-3662,NAD83(NSRS2007) / Tennessee (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,1968500
-3663,NAD83(NSRS2007) / Texas Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,3000000,700000
-3664,NAD83(NSRS2007) / Texas Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,9842500,2296583.333
-3665,NAD83(NSRS2007) / Texas Centric Albers Equal Area,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,6000000,1500000
-3666,NAD83(NSRS2007) / Texas Centric Lambert Conformal,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,5000000,1500000
-3667,NAD83(NSRS2007) / Texas North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,1000000,200000
-3668,NAD83(NSRS2007) / Texas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,3280833.333,656166.667
-3669,NAD83(NSRS2007) / Texas North Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,2000000,600000
-3670,NAD83(NSRS2007) / Texas North Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,6561666.667,1968500
-3671,NAD83(NSRS2007) / Texas South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,5000000,300000
-3672,NAD83(NSRS2007) / Texas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,16404166.67,984250
-3673,NAD83(NSRS2007) / Texas South Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,4000000,600000
-3674,NAD83(NSRS2007) / Texas South Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,13123333.33,1968500
-3675,NAD83(NSRS2007) / Utah Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,2000000,500000
-3676,NAD83(NSRS2007) / Utah Central (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561679.79,1640419.948
-3677,NAD83(NSRS2007) / Utah Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561666.667,1640416.667
-3678,NAD83(NSRS2007) / Utah North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,1000000,500000
-3679,NAD83(NSRS2007) / Utah North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280839.895,1640419.948
-3680,NAD83(NSRS2007) / Utah North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280833.333,1640416.667
-3681,NAD83(NSRS2007) / Utah South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,3000000,500000
-3682,NAD83(NSRS2007) / Utah South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842519.685,1640419.948
-3683,NAD83(NSRS2007) / Utah South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842500,1640416.667
-3684,NAD83(NSRS2007) / Vermont,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3685,NAD83(NSRS2007) / Virginia North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,2000000,3500000
-3686,NAD83(NSRS2007) / Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,6561666.667,11482916.67
-3687,NAD83(NSRS2007) / Virginia South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,1000000,3500000
-3688,NAD83(NSRS2007) / Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,3280833.333,11482916.67
-3689,NAD83(NSRS2007) / Washington North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,500000
-3690,NAD83(NSRS2007) / Washington North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,1640416.667
-3691,NAD83(NSRS2007) / Washington South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,500000
-3692,NAD83(NSRS2007) / Washington South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,1640416.667
-3693,NAD83(NSRS2007) / West Virginia North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,600000
-3694,NAD83(NSRS2007) / West Virginia South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,600000
-3695,NAD83(NSRS2007) / Wisconsin Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,600000
-3696,NAD83(NSRS2007) / Wisconsin Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,1968500
-3697,NAD83(NSRS2007) / Wisconsin North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,600000
-3698,NAD83(NSRS2007) / Wisconsin North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,1968500
-3699,NAD83(NSRS2007) / Wisconsin South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,600000
-3700,NAD83(NSRS2007) / Wisconsin South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,1968500
-3701,NAD83(NSRS2007) / Wisconsin Transverse Mercator,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,520000,0,-4480000,-90,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3702,NAD83(NSRS2007) / Wyoming East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3703,NAD83(NSRS2007) / Wyoming East Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,400000,40.3,100000,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3704,NAD83(NSRS2007) / Wyoming West Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,600000,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3705,NAD83(NSRS2007) / Wyoming West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,800000,40.3,100000,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3706,NAD83(NSRS2007) / UTM zone 59N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3707,NAD83(NSRS2007) / UTM zone 60N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3708,NAD83(NSRS2007) / UTM zone 1N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3709,NAD83(NSRS2007) / UTM zone 2N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3710,NAD83(NSRS2007) / UTM zone 3N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-165,0.9996
-3711,NAD83(NSRS2007) / UTM zone 4N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-159,0.9996
-3712,NAD83(NSRS2007) / UTM zone 5N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-153,0.9996
-3713,NAD83(NSRS2007) / UTM zone 6N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-147,0.9996
-3714,NAD83(NSRS2007) / UTM zone 7N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-141,0.9996
-3715,NAD83(NSRS2007) / UTM zone 8N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-135,0.9996
-3716,NAD83(NSRS2007) / UTM zone 9N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-129,0.9996
-3717,NAD83(NSRS2007) / UTM zone 10N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-123,0.9996
-3718,NAD83(NSRS2007) / UTM zone 11N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-117,0.9996
-3719,NAD83(NSRS2007) / UTM zone 12N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-111,0.9996
-3720,NAD83(NSRS2007) / UTM zone 13N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-105,0.9996
-3721,NAD83(NSRS2007) / UTM zone 14N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-99,0.9996
-3722,NAD83(NSRS2007) / UTM zone 15N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-93,0.9996
-3723,NAD83(NSRS2007) / UTM zone 16N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-87,0.9996
-3724,NAD83(NSRS2007) / UTM zone 17N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-81,0.9996
-3725,NAD83(NSRS2007) / UTM zone 18N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-75,0.9996
-3726,NAD83(NSRS2007) / UTM zone 19N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3727,Reunion 1947 / TM Reunion,Transverse Mercator,metre,0,Reunion 1947,International 1924,160000,-21.07,50000,55.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3728,NAD83(NSRS2007) / Ohio North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,1968500
-3729,NAD83(NSRS2007) / Ohio South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,1968500
-3730,NAD83(NSRS2007) / Wyoming East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.6667,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3731,NAD83(NSRS2007) / Wyoming East Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1312333.333,40.3,328083.3333,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3732,NAD83(NSRS2007) / Wyoming West Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1968500,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3733,NAD83(NSRS2007) / Wyoming West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2624666.667,40.3,328083.3333,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3734,NAD83 / Ohio North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,1968500
-3735,NAD83 / Ohio South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,1968500
-3736,NAD83 / Wyoming East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.6667,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3737,NAD83 / Wyoming East Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1312333.333,40.3,328083.3333,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3738,NAD83 / Wyoming West Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1968500,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3739,NAD83 / Wyoming West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2624666.667,40.3,328083.3333,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3740,NAD83(HARN) / UTM zone 10N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3741,NAD83(HARN) / UTM zone 11N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3742,NAD83(HARN) / UTM zone 12N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3743,NAD83(HARN) / UTM zone 13N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3744,NAD83(HARN) / UTM zone 14N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3745,NAD83(HARN) / UTM zone 15N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3746,NAD83(HARN) / UTM zone 16N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3747,NAD83(HARN) / UTM zone 17N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3748,NAD83(HARN) / UTM zone 18N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3749,NAD83(HARN) / UTM zone 19N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3750,NAD83(HARN) / UTM zone 4N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3751,NAD83(HARN) / UTM zone 5N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3753,NAD83(HARN) / Ohio North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,1968500
-3754,NAD83(HARN) / Ohio South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,1968500
-3755,NAD83(HARN) / Wyoming East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.6667,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3756,NAD83(HARN) / Wyoming East Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1312333.333,40.3,328083.3333,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3757,NAD83(HARN) / Wyoming West Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1968500,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3758,NAD83(HARN) / Wyoming West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2624666.667,40.3,328083.3333,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3759,NAD83 / Hawaii zone 3 (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3760,NAD83(HARN) / Hawaii zone 3 (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3761,NAD83(CSRS) / UTM zone 22N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3762,WGS 84 / South Georgia Lambert,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-54.45,-55,-37,-54,0,0
-3763,ETRS89 / Portugal TM06,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,39.400573,0,-8.075919,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3764,NZGD2000 / Chatham Island Circuit 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-44,800000,-176.3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3765,HTRS96 / Croatia TM,Transverse Mercator,metre,0,Croatian Terrestrial Reference System,GRS 1980,500000,0,0,16.5,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3766,HTRS96 / Croatia LCC,Lambert Conic Conformal (2SP),metre,0,Croatian Terrestrial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.05,0,16.3,45.55,0,0
-3767,HTRS96 / UTM zone 33N,Transverse Mercator,metre,0,Croatian Terrestrial Reference System,GRS 1980,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3768,HTRS96 / UTM zone 34N,Transverse Mercator,metre,0,Croatian Terrestrial Reference System,GRS 1980,500000,0,0,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3769,Bermuda 1957 / UTM zone 20N,Transverse Mercator,metre,4216,Bermuda 1957,Clarke 1866,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3770,BDA2000 / Bermuda 2000 National Grid,Transverse Mercator,metre,0,Bermuda 2000,WGS 84,550000,32,100000,-64.45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3771,NAD27 / Alberta 3TM ref merid 111 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-111,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3772,NAD27 / Alberta 3TM ref merid 114 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-114,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3773,NAD27 / Alberta 3TM ref merid 117 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-117,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3774,NAD27 / Alberta 3TM ref merid 120 W (deprecated),Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3775,NAD83 / Alberta 3TM ref merid 111 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-111,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3776,NAD83 / Alberta 3TM ref merid 114 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-114,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3777,NAD83 / Alberta 3TM ref merid 117 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-117,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3778,NAD83 / Alberta 3TM ref merid 120 W (deprecated),Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3779,NAD83(CSRS) / Alberta 3TM ref merid 111 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-111,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3780,NAD83(CSRS) / Alberta 3TM ref merid 114 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-114,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3781,NAD83(CSRS) / Alberta 3TM ref merid 117 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-117,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3782,NAD83(CSRS) / Alberta 3TM ref merid 120 W (deprecated),Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3783,Pitcairn 2006 / Pitcairn TM 2006,Transverse Mercator,metre,0,Pitcairn 2006,WGS 84,14200,-25.04067894,15500,-130.0646682,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3784,Pitcairn 1967 / UTM zone 9S,Transverse Mercator,metre,0,Pitcairn 1967,International 1924,500000,0,10000000,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3788,NZGD2000 / Auckland Islands TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,166,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3789,NZGD2000 / Campbell Island TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,169,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3790,NZGD2000 / Antipodes Islands TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,179,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3791,NZGD2000 / Raoul Island TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,-178,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3793,NZGD2000 / Chatham Islands TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,-176.3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3794,Slovenia 1996 / Slovene National Grid,Transverse Mercator,metre,0,Slovenia Geodetic Datum 1996,GRS 1980,500000,0,-5000000,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3795,NAD27 / Cuba Norte,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21.42,22.21,-81,23,280296.016,500000
-3796,NAD27 / Cuba Sur,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20.08,20.43,-76.5,21.18,229126.939,500000
-3797,NAD27 / MTQ Lambert,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-70,50,0,800000
-3798,NAD83 / MTQ Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-70,50,0,800000
-3799,NAD83(CSRS) / MTQ Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-70,50,0,800000
-3800,NAD27 / Alberta 3TM ref merid 120 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3801,NAD83 / Alberta 3TM ref merid 120 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3802,NAD83(CSRS) / Alberta 3TM ref merid 120 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3812,ETRS89 / Belgian Lambert 2008,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,50.4752134,4.2133177,49.5,665262,649328
-3814,NAD83 / Mississippi TM,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,32.3,1300000,-89.45,0.9998335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3815,NAD83(HARN) / Mississippi TM,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,32.3,1300000,-89.45,0.9998335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3816,NAD83(NSRS2007) / Mississippi TM,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,32.3,1300000,-89.45,0.9998335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3825,TWD97 / TM2 zone 119,Transverse Mercator,metre,0,Taiwan Datum 1997,GRS 1980,250000,0,0,119,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3826,TWD97 / TM2 zone 121,Transverse Mercator,metre,0,Taiwan Datum 1997,GRS 1980,250000,0,0,121,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3827,TWD67 / TM2 zone 119,Transverse Mercator,metre,0,Taiwan Datum 1967,GRS 1967 Modified,250000,0,0,119,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3828,TWD67 / TM2 zone 121,Transverse Mercator,metre,0,Taiwan Datum 1967,GRS 1967 Modified,250000,0,0,121,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3829,Hu Tzu Shan / UTM zone 51N,Transverse Mercator,metre,4236,Hu Tzu Shan 1950,International 1924,500000,0,0,123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3832,WGS 84 / PDC Mercator,Mercator (1SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,150,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3833,Pulkovo 1942(58) / Gauss-Kruger zone 2,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,2500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3834,Pulkovo 1942(83) / Gauss-Kruger zone 2,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,2500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3835,Pulkovo 1942(83) / Gauss-Kruger zone 3,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,3500000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3836,Pulkovo 1942(83) / Gauss-Kruger zone 4,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,4500000,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3837,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3838,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3839,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,9500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3840,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,10500000,0,0,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3841,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,6500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3844,Pulkovo 1942(58) / Stereo70,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,500000,46,500000,25,0.99975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3845,SWEREF99 / RT90 7.5 gon V emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500025.141,0,-667.282,11.18225,1.000006,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3846,SWEREF99 / RT90 5 gon V emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500044.695,0,-667.13,13.332256,1.0000058,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3847,SWEREF99 / RT90 2.5 gon V emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500064.274,0,-667.711,15.48226243,1.00000561,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3848,SWEREF99 / RT90 0 gon emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500083.521,0,-668.844,18.032268,1.0000054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3849,SWEREF99 / RT90 2.5 gon O emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500102.765,0,-670.706,20.182274,1.0000052,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3850,SWEREF99 / RT90 5 gon O emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500121.846,0,-672.557,22.33228,1.0000049,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3851,NZGD2000 / NZCS2000,Lambert Conic Conformal (2SP),metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-44.3,-41,173,-37.3,7000000,3000000
-3852,RSRGD2000 / DGLC2000,Lambert Conic Conformal (2SP),metre,0,Ross Sea Region Geodetic Datum 2000,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,157,-76.4,0,500000
-3854,County ST74,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,100182.7406,0,-6500620.121,18.0328332,0.99999506,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3857,WGS 84 / Pseudo-Mercator,Popular Visualisation Pseudo Mercator,metre,6055,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3890,IGRS / UTM zone 37N,Transverse Mercator,metre,0,Iraqi Geospatial Reference System,GRS 1980,500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3891,IGRS / UTM zone 38N,Transverse Mercator,metre,0,Iraqi Geospatial Reference System,GRS 1980,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3892,IGRS / UTM zone 39N,Transverse Mercator,metre,0,Iraqi Geospatial Reference System,GRS 1980,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3893,ED50 / Iraq National Grid,Transverse Mercator,metre,4154,European Datum 1950,International 1924,800000,29.0134566,0,46.3,0.9994,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3907,MGI 1901 / Balkans zone 5,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,5500000,0,0,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3908,MGI 1901 / Balkans zone 6,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,6500000,0,0,18,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3909,MGI 1901 / Balkans zone 7,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,7500000,0,0,21,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3910,MGI 1901 / Balkans zone 8,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,8500000,0,0,24,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3911,MGI 1901 / Slovenia Grid,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,500000,0,0,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3912,MGI 1901 / Slovene National Grid,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,500000,0,-5000000,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3920,Puerto Rico / UTM zone 20N,Transverse Mercator,metre,4139,Puerto Rico,Clarke 1866,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3942,RGF93 / CC42,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.75,42,3,41.25,1200000,1700000
-3943,RGF93 / CC43,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.75,43,3,42.25,2200000,1700000
-3944,RGF93 / CC44,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.75,44,3,43.25,3200000,1700000
-3945,RGF93 / CC45,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.75,45,3,44.25,4200000,1700000
-3946,RGF93 / CC46,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.75,46,3,45.25,5200000,1700000
-3947,RGF93 / CC47,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.75,47,3,46.25,6200000,1700000
-3948,RGF93 / CC48,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.75,48,3,47.25,7200000,1700000
-3949,RGF93 / CC49,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.75,49,3,48.25,8200000,1700000
-3950,RGF93 / CC50,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50.75,50,3,49.25,9200000,1700000
-3968,NAD83 / Virginia Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.5,36,-79.5,37,0,0
-3969,NAD83(HARN) / Virginia Lambert,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.5,36,-79.5,37,0,0
-3970,NAD83(NSRS2007) / Virginia Lambert,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.5,36,-79.5,37,0,0
-3973,WGS 84 / NSIDC EASE-Grid North,Lambert Azimuthal Equal Area (Spherical),metre,4326,World Geodetic System 1984,WGS 84,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3974,WGS 84 / NSIDC EASE-Grid South,Lambert Azimuthal Equal Area (Spherical),metre,4326,World Geodetic System 1984,WGS 84,0,-90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-3975,WGS 84 / NSIDC EASE-Grid Global,Lambert Cylindrical Equal Area (Spherical),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0
-3976,WGS 84 / NSIDC Sea Ice Polar Stereographic South,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-70
-3978,NAD83 / Canada Atlas Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,49,-95,49,0,0,
-3979,NAD83(CSRS) / Canada Atlas Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,49,-95,49,0,0,
-3986,Katanga 1955 / Katanga Gauss zone A,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3987,Katanga 1955 / Katanga Gauss zone B,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,28,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3988,Katanga 1955 / Katanga Gauss zone C,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,26,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3989,Katanga 1955 / Katanga Gauss zone D,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3991,Puerto Rico State Plane CS of 1927,Lambert Conic Conformal (2SP),US survey foot,4139,Puerto Rico,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,0,500000,
-3992,Puerto Rico / St. Croix,Lambert Conic Conformal (2SP),US survey foot,4139,Puerto Rico,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,100000,500000,
-3993,Guam 1963 / Guam SPCS,Guam Projection,metre,0,Guam 1963,Clarke 1866,50000,13.28208789,50000,144.4455503,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3994,WGS 84 / Mercator 41,Mercator (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-41,0,0,
-3995,WGS 84 / Arctic Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71
-3996,WGS 84 / IBCAO Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75
-3997,WGS 84 / Dubai Local TM,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,55.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4026,MOLDREF99 / Moldova TM,Transverse Mercator,metre,0,MOLDREF99,GRS 1980,200000,0,-5000000,28.24,0.99994,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4037,WGS 84 / TMzn35N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4038,WGS 84 / TMzn36N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-4048,RGRDC 2005 / Congo TM zone 12,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,12,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-4049,RGRDC 2005 / Congo TM zone 14,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,14,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-4050,RGRDC 2005 / Congo TM zone 16,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,16,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4051,RGRDC 2005 / Congo TM zone 18,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,18,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4056,RGRDC 2005 / Congo TM zone 20,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,20,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4057,RGRDC 2005 / Congo TM zone 22,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,22,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4058,RGRDC 2005 / Congo TM zone 24,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,24,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4059,RGRDC 2005 / Congo TM zone 26,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,26,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4060,RGRDC 2005 / Congo TM zone 28,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,28,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4061,RGRDC 2005 / UTM zone 33S,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4062,RGRDC 2005 / UTM zone 34S,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4063,RGRDC 2005 / UTM zone 35S,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4071,Chua / UTM zone 23S,Transverse Mercator,metre,0,Chua,International 1924,500000,0,10000000,-45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4082,REGCAN95 / UTM zone 27N,Transverse Mercator,metre,0,Red Geodesica de Canarias 1995,GRS 1980,500000,0,0,-21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4083,REGCAN95 / UTM zone 28N,Transverse Mercator,metre,0,Red Geodesica de Canarias 1995,GRS 1980,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4088,World Equidistant Cylindrical (Sphere),Equidistant Cylindrical (Spherical),metre,0,Not specified (based on GRS 1980 Authalic Sphere),GRS 1980 Authalic Sphere,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,
-4093,ETRS89 / DKTM1,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,200000,0,-5000000,9,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
-4094,ETRS89 / DKTM2,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,400000,0,-5000000,10,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4095,ETRS89 / DKTM3,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,600000,0,-5000000,11.75,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4096,ETRS89 / DKTM4,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,800000,0,-5000000,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4326,WGS 84 / World Equidistant Cylindrical,Equidistant Cylindrical,metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,
-4414,NAD83(HARN) / Guam Map Grid,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,100000,13.3,200000,144.45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4415,Katanga 1955 / Katanga Lambert,Lambert Conic Conformal (2SP),metre,0,Katanga 1955,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-11.5,-9,26,-6.5,500000,500000
-4417,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,7500000,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4434,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,8500000,0,0,24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4437,NAD83(NSRS2007) / Puerto Rico and Virgin Is.,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,200000,200000
-4455,NAD27 / Pennsylvania South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,2000000
-4456,NAD27 / New York Long Island,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.3,-74,41.02,100000,2000000
-4457,NAD83 / South Dakota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,1968500
-4462,WGS 84 / Australian Centre for Remote Sensing Lambert,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,-27,132,-18,0,0
-4467,RGSPM06 / UTM zone 21N,Transverse Mercator,metre,0,Reseau Geodesique de Saint Pierre et Miquelon 2006,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4471,RGM04 / UTM zone 38S,Transverse Mercator,metre,0,Reseau Geodesique de Mayotte 2004,GRS 1980,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-4474,Cadastre 1997 / UTM zone 38S,Transverse Mercator,metre,4632,Combani 1950,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-4484,Mexican Datum of 1993 / UTM zone 11N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-4485,Mexican Datum of 1993 / UTM zone 12N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-111,0.9996,,,,,,,,,,,,,,,
-4486,Mexican Datum of 1993 / UTM zone 13N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-105,0.9996,,,,,,,,,,,,,,,
-4487,Mexican Datum of 1993 / UTM zone 14N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-99,0.9996,,,,,,,,,,,,,,,
-4488,Mexican Datum of 1993 / UTM zone 15N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-93,0.9996,,,,,,,,,,,,,,,
-4489,Mexican Datum of 1993 / UTM zone 16N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,
-4491,CGCS2000 / Gauss-Kruger zone 13,Transverse Mercator,metre,0,China 2000,CGCS2000,13500000,0,0,75,1,,,,,,,,,,,,,,,
-4492,CGCS2000 / Gauss-Kruger zone 14,Transverse Mercator,metre,0,China 2000,CGCS2000,14500000,0,0,81,1,,,,,,,,,,,,,,,
-4493,CGCS2000 / Gauss-Kruger zone 15,Transverse Mercator,metre,0,China 2000,CGCS2000,15500000,0,0,87,1,,,,,,,,,,,,,,,
-4494,CGCS2000 / Gauss-Kruger zone 16,Transverse Mercator,metre,0,China 2000,CGCS2000,16500000,0,0,93,1,,,,,,,,,,,,,,,
-4495,CGCS2000 / Gauss-Kruger zone 17,Transverse Mercator,metre,0,China 2000,CGCS2000,17500000,0,0,99,1,,,,,,,,,,,,,,,
-4496,CGCS2000 / Gauss-Kruger zone 18,Transverse Mercator,metre,0,China 2000,CGCS2000,18500000,0,0,105,1,,,,,,,,,,,,,,,
-4497,CGCS2000 / Gauss-Kruger zone 19,Transverse Mercator,metre,0,China 2000,CGCS2000,19500000,0,0,111,1,,,,,,,,,,,,,,,
-4498,CGCS2000 / Gauss-Kruger zone 20,Transverse Mercator,metre,0,China 2000,CGCS2000,20500000,0,0,117,1,,,,,,,,,,,,,,,
-4499,CGCS2000 / Gauss-Kruger zone 21,Transverse Mercator,metre,0,China 2000,CGCS2000,21500000,0,0,123,1
-4500,CGCS2000 / Gauss-Kruger zone 22,Transverse Mercator,metre,0,China 2000,CGCS2000,22500000,0,0,129,1
-4501,CGCS2000 / Gauss-Kruger zone 23,Transverse Mercator,metre,0,China 2000,CGCS2000,23500000,0,0,135,1
-4502,CGCS2000 / Gauss-Kruger CM 75E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,75,1
-4503,CGCS2000 / Gauss-Kruger CM 81E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,81,1
-4504,CGCS2000 / Gauss-Kruger CM 87E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,87,1
-4505,CGCS2000 / Gauss-Kruger CM 93E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,93,1
-4506,CGCS2000 / Gauss-Kruger CM 99E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,99,1
-4507,CGCS2000 / Gauss-Kruger CM 105E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,105,1
-4508,CGCS2000 / Gauss-Kruger CM 111E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,111,1
-4509,CGCS2000 / Gauss-Kruger CM 117E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,117,1
-4510,CGCS2000 / Gauss-Kruger CM 123E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,123,1
-4511,CGCS2000 / Gauss-Kruger CM 129E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,129,1
-4512,CGCS2000 / Gauss-Kruger CM 135E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,135,1
-4513,CGCS2000 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,0,China 2000,CGCS2000,25500000,0,0,75,1
-4514,CGCS2000 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,0,China 2000,CGCS2000,26500000,0,0,78,1
-4515,CGCS2000 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,0,China 2000,CGCS2000,27500000,0,0,81,1
-4516,CGCS2000 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,0,China 2000,CGCS2000,28500000,0,0,84,1
-4517,CGCS2000 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,0,China 2000,CGCS2000,29500000,0,0,87,1
-4518,CGCS2000 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,0,China 2000,CGCS2000,30500000,0,0,90,1
-4519,CGCS2000 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,0,China 2000,CGCS2000,31500000,0,0,93,1
-4520,CGCS2000 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,0,China 2000,CGCS2000,32500000,0,0,96,1
-4521,CGCS2000 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,0,China 2000,CGCS2000,33500000,0,0,99,1
-4522,CGCS2000 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,0,China 2000,CGCS2000,34500000,0,0,102,1
-4523,CGCS2000 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,0,China 2000,CGCS2000,35500000,0,0,105,1
-4524,CGCS2000 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,0,China 2000,CGCS2000,36500000,0,0,108,1
-4525,CGCS2000 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,0,China 2000,CGCS2000,37500000,0,0,111,1
-4526,CGCS2000 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,0,China 2000,CGCS2000,38500000,0,0,114,1
-4527,CGCS2000 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,0,China 2000,CGCS2000,39500000,0,0,117,1
-4528,CGCS2000 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,0,China 2000,CGCS2000,40500000,0,0,120,1
-4529,CGCS2000 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,0,China 2000,CGCS2000,41500000,0,0,123,1
-4530,CGCS2000 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,0,China 2000,CGCS2000,42500000,0,0,126,1
-4531,CGCS2000 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,0,China 2000,CGCS2000,43500000,0,0,129,1
-4532,CGCS2000 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,0,China 2000,CGCS2000,44500000,0,0,132,1
-4533,CGCS2000 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,0,China 2000,CGCS2000,45500000,0,0,135,1
-4534,CGCS2000 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,75,1
-4535,CGCS2000 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,78,1
-4536,CGCS2000 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,81,1
-4537,CGCS2000 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,84,1
-4538,CGCS2000 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,87,1
-4539,CGCS2000 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,90,1
-4540,CGCS2000 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,93,1
-4541,CGCS2000 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,96,1
-4542,CGCS2000 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,99,1
-4543,CGCS2000 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,102,1
-4544,CGCS2000 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,105,1
-4545,CGCS2000 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,108,1
-4546,CGCS2000 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,111,1
-4547,CGCS2000 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,114,1
-4548,CGCS2000 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,117,1
-4549,CGCS2000 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,120,1
-4550,CGCS2000 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,123,1
-4551,CGCS2000 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,126,1
-4552,CGCS2000 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,129,1
-4553,CGCS2000 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,132,1
-4554,CGCS2000 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,135,1
-4559,RRAF 1991 / UTM zone 20N,Transverse Mercator,metre,4640,Reseau de Reference des Antilles Francaises 1991,GRS 1980,500000,0,0,-63,0.9996
-4568,New Beijing / Gauss-Kruger zone 13,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,13500000,0,0,75,1
-4569,New Beijing / Gauss-Kruger zone 14,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,14500000,0,0,81,1
-4570,New Beijing / Gauss-Kruger zone 15,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,15500000,0,0,87,1
-4571,New Beijing / Gauss-Kruger zone 16,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,16500000,0,0,93,1
-4572,New Beijing / Gauss-Kruger zone 17,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,17500000,0,0,99,1
-4573,New Beijing / Gauss-Kruger zone 18,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,18500000,0,0,105,1
-4574,New Beijing / Gauss-Kruger zone 19,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,19500000,0,0,111,1
-4575,New Beijing / Gauss-Kruger zone 20,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,20500000,0,0,117,1
-4576,New Beijing / Gauss-Kruger zone 21,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,21500000,0,0,123,1
-4577,New Beijing / Gauss-Kruger zone 22,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,22500000,0,0,129,1
-4578,New Beijing / Gauss-Kruger zone 23,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,23500000,0,0,135,1
-4579,New Beijing / Gauss-Kruger CM 75E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,75,1
-4580,New Beijing / Gauss-Kruger CM 81E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,81,1
-4581,New Beijing / Gauss-Kruger CM 87E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,87,1
-4582,New Beijing / Gauss-Kruger CM 93E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,93,1
-4583,New Beijing / Gauss-Kruger CM 99E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,99,1
-4584,New Beijing / Gauss-Kruger CM 105E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,105,1
-4585,New Beijing / Gauss-Kruger CM 111E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,111,1
-4586,New Beijing / Gauss-Kruger CM 117E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,117,1
-4587,New Beijing / Gauss-Kruger CM 123E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,123,1
-4588,New Beijing / Gauss-Kruger CM 129E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,129,1
-4589,New Beijing / Gauss-Kruger CM 135E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,135,1
-4647,ETRS89 / UTM zone N32,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,32500000,0,0,9,0.9996
-4652,New Beijing / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,25500000,0,0,75,1
-4653,New Beijing / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,26500000,0,0,78,1
-4654,New Beijing / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,27500000,0,0,81,1
-4655,New Beijing / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,28500000,0,0,84,1
-4656,New Beijing / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,29500000,0,0,87,1
-4766,New Beijing / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,30500000,0,0,90,1
-4767,New Beijing / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,31500000,0,0,93,1
-4768,New Beijing / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,32500000,0,0,96,1
-4769,New Beijing / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,33500000,0,0,99,1
-4770,New Beijing / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,34500000,0,0,102,1
-4771,New Beijing / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,35500000,0,0,105,1
-4772,New Beijing / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,36500000,0,0,108,1
-4773,New Beijing / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,37500000,0,0,111,1
-4774,New Beijing / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,38500000,0,0,114,1
-4775,New Beijing / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,39500000,0,0,117,1
-4776,New Beijing / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,40500000,0,0,120,1
-4777,New Beijing / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,41500000,0,0,123,1
-4778,New Beijing / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,42500000,0,0,126,1
-4779,New Beijing / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,43500000,0,0,129,1
-4780,New Beijing / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,44500000,0,0,132,1
-4781,New Beijing / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,45500000,0,0,135,1
-4782,New Beijing / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,75,1
-4783,New Beijing / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,78,1
-4784,New Beijing / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,81,1
-4785,New Beijing / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,84,1
-4786,New Beijing / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,87,1
-4787,New Beijing / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,90,1
-4788,New Beijing / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,93,1
-4789,New Beijing / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,96,1
-4790,New Beijing / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,99,1
-4791,New Beijing / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,102,1
-4792,New Beijing / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,105,1
-4793,New Beijing / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,108,1,,,,,,,,,,,,,,,,
-4794,New Beijing / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,111,1,,,,,,,,,,,,,,,,
-4795,New Beijing / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,114,1,,,,,,,,,,,,,,,,
-4796,New Beijing / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,117,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4797,New Beijing / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,120,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4798,New Beijing / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,123,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4799,New Beijing / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,126,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4800,New Beijing / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,129,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4812,New Beijing / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,132,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4822,New Beijing / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,135,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-4826,WGS 84 / Cape Verde National,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16.4,15.5,-24,15,128511.202,161587.83
-20004,Pulkovo 1995 / Gauss-Kruger zone 4,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,4500000,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-20005,Pulkovo 1995 / Gauss-Kruger zone 5,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,5500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-20006,Pulkovo 1995 / Gauss-Kruger zone 6,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,6500000,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-20007,Pulkovo 1995 / Gauss-Kruger zone 7,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,7500000,0,0,39,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-20008,Pulkovo 1995 / Gauss-Kruger zone 8,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,8500000,0,0,45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-20009,Pulkovo 1995 / Gauss-Kruger zone 9,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,9500000,0,0,51,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-20010,Pulkovo 1995 / Gauss-Kruger zone 10,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,10500000,0,0,57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-20011,Pulkovo 1995 / Gauss-Kruger zone 11,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,11500000,0,0,63,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-20012,Pulkovo 1995 / Gauss-Kruger zone 12,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,12500000,0,0,69,1,,,,,,,,,,,,,,,
-20013,Pulkovo 1995 / Gauss-Kruger zone 13,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,13500000,0,0,75,1,,,,,,,,,,,,,,,
-20014,Pulkovo 1995 / Gauss-Kruger zone 14,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,14500000,0,0,81,1,,,,,,,,,,,,,,,
-20015,Pulkovo 1995 / Gauss-Kruger zone 15,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,15500000,0,0,87,1,,,,,,,,,,,,,,,
-20016,Pulkovo 1995 / Gauss-Kruger zone 16,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,16500000,0,0,93,1,,,,,,,,,,,,,,,
-20017,Pulkovo 1995 / Gauss-Kruger zone 17,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,17500000,0,0,99,1,,,,,,,,,,,,,,,
-20018,Pulkovo 1995 / Gauss-Kruger zone 18,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,18500000,0,0,105,1,,,,,,,,,,,,,,,
-20019,Pulkovo 1995 / Gauss-Kruger zone 19,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,19500000,0,0,111,1,,,,,,,,,,,,,,,
-20020,Pulkovo 1995 / Gauss-Kruger zone 20,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,20500000,0,0,117,1,,,,,,,,,,,,,,,
-20021,Pulkovo 1995 / Gauss-Kruger zone 21,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,21500000,0,0,123,1,,,,,,,,,,,,,,,
-20022,Pulkovo 1995 / Gauss-Kruger zone 22,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,22500000,0,0,129,1,,,,,,,,,,,,,,,
-20023,Pulkovo 1995 / Gauss-Kruger zone 23,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,23500000,0,0,135,1,,,,,,,,,,,,,,,
-20024,Pulkovo 1995 / Gauss-Kruger zone 24,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,24500000,0,0,141,1,,,,,,,,,,,,,,,
-20025,Pulkovo 1995 / Gauss-Kruger zone 25,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,25500000,0,0,147,1
-20026,Pulkovo 1995 / Gauss-Kruger zone 26,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,26500000,0,0,153,1
-20027,Pulkovo 1995 / Gauss-Kruger zone 27,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,27500000,0,0,159,1
-20028,Pulkovo 1995 / Gauss-Kruger zone 28,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,28500000,0,0,165,1
-20029,Pulkovo 1995 / Gauss-Kruger zone 29,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,29500000,0,0,171,1
-20030,Pulkovo 1995 / Gauss-Kruger zone 30,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,30500000,0,0,177,1
-20031,Pulkovo 1995 / Gauss-Kruger zone 31,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,31500000,0,0,-177,1
-20032,Pulkovo 1995 / Gauss-Kruger zone 32,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,32500000,0,0,-171,1
-20135,Adindan / UTM zone 35N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,27,0.9996
-20136,Adindan / UTM zone 36N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,33,0.9996
-20137,Adindan / UTM zone 37N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,39,0.9996
-20138,Adindan / UTM zone 38N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,45,0.9996
-20248,AGD66 / AMG zone 48,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,105,0.9996
-20249,AGD66 / AMG zone 49,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,111,0.9996
-20250,AGD66 / AMG zone 50,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,117,0.9996
-20251,AGD66 / AMG zone 51,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,123,0.9996
-20252,AGD66 / AMG zone 52,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,129,0.9996
-20253,AGD66 / AMG zone 53,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,135,0.9996
-20254,AGD66 / AMG zone 54,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,141,0.9996
-20255,AGD66 / AMG zone 55,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,147,0.9996
-20256,AGD66 / AMG zone 56,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,153,0.9996
-20257,AGD66 / AMG zone 57,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,159,0.9996
-20258,AGD66 / AMG zone 58,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,165,0.9996
-20348,AGD84 / AMG zone 48,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,105,0.9996
-20349,AGD84 / AMG zone 49,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,111,0.9996
-20350,AGD84 / AMG zone 50,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,117,0.9996
-20351,AGD84 / AMG zone 51,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,123,0.9996
-20352,AGD84 / AMG zone 52,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,129,0.9996
-20353,AGD84 / AMG zone 53,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,135,0.9996
-20354,AGD84 / AMG zone 54,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,141,0.9996
-20355,AGD84 / AMG zone 55,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,147,0.9996
-20356,AGD84 / AMG zone 56,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,153,0.9996
-20357,AGD84 / AMG zone 57,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,159,0.9996
-20358,AGD84 / AMG zone 58,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,165,0.9996
-20436,Ain el Abd / UTM zone 36N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,33,0.9996
-20437,Ain el Abd / UTM zone 37N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,39,0.9996
-20438,Ain el Abd / UTM zone 38N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,45,0.9996
-20439,Ain el Abd / UTM zone 39N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,51,0.9996
-20440,Ain el Abd / UTM zone 40N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,57,0.9996
-20499,Ain el Abd / Bahrain Grid,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,51,0.9996
-20538,Afgooye / UTM zone 38N,Transverse Mercator,metre,4205,Afgooye,Krassowsky 1940,500000,0,0,45,0.9996
-20539,Afgooye / UTM zone 39N,Transverse Mercator,metre,4205,Afgooye,Krassowsky 1940,500000,0,0,51,0.9996
-20790,Lisbon (Lisbon) / Portuguese National Grid,Transverse Mercator,metre,4207,Lisbon 1937 (Lisbon),International 1924,200000,39.4,300000,1,1
-20791,Lisbon (Lisbon) / Portuguese Grid,Transverse Mercator,metre,4207,Lisbon 1937 (Lisbon),International 1924,0,39.4,0,1,1
-20822,Aratu / UTM zone 22S,Transverse Mercator,metre,4208,Aratu,International 1924,500000,0,10000000,-51,0.9996
-20823,Aratu / UTM zone 23S,Transverse Mercator,metre,4208,Aratu,International 1924,500000,0,10000000,-45,0.9996
-20824,Aratu / UTM zone 24S,Transverse Mercator,metre,4208,Aratu,International 1924,500000,0,10000000,-39,0.9996
-20934,Arc 1950 / UTM zone 34S,Transverse Mercator,metre,4209,Arc 1950,Clarke 1880 (Arc),500000,0,10000000,21,0.9996
-20935,Arc 1950 / UTM zone 35S,Transverse Mercator,metre,4209,Arc 1950,Clarke 1880 (Arc),500000,0,10000000,27,0.9996
-20936,Arc 1950 / UTM zone 36S,Transverse Mercator,metre,4209,Arc 1950,Clarke 1880 (Arc),500000,0,10000000,33,0.9996
-21035,Arc 1960 / UTM zone 35S,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,10000000,27,0.9996
-21036,Arc 1960 / UTM zone 36S,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,10000000,33,0.9996
-21037,Arc 1960 / UTM zone 37S,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,10000000,39,0.9996
-21095,Arc 1960 / UTM zone 35N,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,0,27,0.9996
-21096,Arc 1960 / UTM zone 36N,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,0,33,0.9996
-21097,Arc 1960 / UTM zone 37N,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,0,39,0.9996
-21148,Batavia / UTM zone 48S,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,105,0.9996
-21149,Batavia / UTM zone 49S,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,111,0.9996
-21150,Batavia / UTM zone 50S,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,117,0.9996
-21291,Barbados 1938 / British West Indies Grid,Transverse Mercator,metre,4212,Barbados 1938,Clarke 1880 (RGS),400000,0,0,-62,0.9995
-21292,Barbados 1938 / Barbados National Grid,Transverse Mercator,metre,4212,Barbados 1938,Clarke 1880 (RGS),30000,13.1035,75000,-59.3335,0.9999986
-21413,Beijing 1954 / Gauss-Kruger zone 13,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,13500000,0,0,75,1
-21414,Beijing 1954 / Gauss-Kruger zone 14,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,14500000,0,0,81,1
-21415,Beijing 1954 / Gauss-Kruger zone 15,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,15500000,0,0,87,1
-21416,Beijing 1954 / Gauss-Kruger zone 16,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,16500000,0,0,93,1
-21417,Beijing 1954 / Gauss-Kruger zone 17,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,17500000,0,0,99,1
-21418,Beijing 1954 / Gauss-Kruger zone 18,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,18500000,0,0,105,1
-21419,Beijing 1954 / Gauss-Kruger zone 19,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,19500000,0,0,111,1
-21420,Beijing 1954 / Gauss-Kruger zone 20,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,20500000,0,0,117,1
-21421,Beijing 1954 / Gauss-Kruger zone 21,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,21500000,0,0,123,1
-21422,Beijing 1954 / Gauss-Kruger zone 22,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,22500000,0,0,129,1
-21423,Beijing 1954 / Gauss-Kruger zone 23,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,23500000,0,0,135,1
-21453,Beijing 1954 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,75,1
-21454,Beijing 1954 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,81,1
-21455,Beijing 1954 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,87,1
-21456,Beijing 1954 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,93,1
-21457,Beijing 1954 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,99,1
-21458,Beijing 1954 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,105,1
-21459,Beijing 1954 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,111,1
-21460,Beijing 1954 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,117,1
-21461,Beijing 1954 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,123,1,,,,,,,,,,,,,,,,
-21462,Beijing 1954 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,129,1,,,,,,,,,,,,,,,,
-21463,Beijing 1954 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,135,1,,,,,,,,,,,,,,,,
-21500,Belge 1950 (Brussels) / Belge Lambert 50,Lambert Conic Conformal (2SP),metre,4215,Reseau National Belge 1950 (Brussels),International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,90,0,49.5,5400000,150000
-21780,Bern 1898 (Bern) / LV03C,Oblique Mercator,metre,4801,CH1903 (Bern),Bessel 1841,0,0,0,0,0,90,46.570866,0,90,1,0,0,0,0,0,0,0,0,0,0,
-21781,CH1903 / LV03,Oblique Mercator,metre,4149,CH1903,Bessel 1841,0,0,0,0,0,90,46.570866,200000,90,1,600000,7.26225,0,0,0,0,0,0,0,0,
-21782,CH1903 / LV03C-G,Oblique Mercator,metre,4149,CH1903,Bessel 1841,0,0,0,0,0,90,46.570866,0,90,1,0,7.26225,0,0,0,0,0,0,0,0,
-21818,Bogota 1975 / UTM zone 18N,Transverse Mercator,metre,4218,Bogota 1975,International 1924,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-21896,Bogota 1975 / Colombia West zone,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-77.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-21897,Bogota 1975 / Colombia Bogota zone,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-74.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-21898,Bogota 1975 / Colombia East Central zone,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-71.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-21899,Bogota 1975 / Colombia East,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-68.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22032,Camacupa / UTM zone 32S,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22033,Camacupa / UTM zone 33S,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22091,Camacupa / TM 11.30 SE,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,11.3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22092,Camacupa / TM 12 SE,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,12,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22171,POSGAR 98 / Argentina 1,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,1500000,-90,0,-72,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22172,POSGAR 98 / Argentina 2,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,2500000,-90,0,-69,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22173,POSGAR 98 / Argentina 3,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,3500000,-90,0,-66,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22174,POSGAR 98 / Argentina 4,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,4500000,-90,0,-63,1,,,,,,,,,,,,,,,
-22175,POSGAR 98 / Argentina 5,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,5500000,-90,0,-60,1,,,,,,,,,,,,,,,
-22176,POSGAR 98 / Argentina 6,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,6500000,-90,0,-57,1,,,,,,,,,,,,,,,
-22177,POSGAR 98 / Argentina 7,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,7500000,-90,0,-54,1,,,,,,,,,,,,,,,
-22181,POSGAR 94 / Argentina 1,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,1500000,-90,0,-72,1,,,,,,,,,,,,,,,
-22182,POSGAR 94 / Argentina 2,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,2500000,-90,0,-69,1,,,,,,,,,,,,,,,
-22183,POSGAR 94 / Argentina 3,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,3500000,-90,0,-66,1,,,,,,,,,,,,,,,
-22184,POSGAR 94 / Argentina 4,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,4500000,-90,0,-63,1,,,,,,,,,,,,,,,
-22185,POSGAR 94 / Argentina 5,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,5500000,-90,0,-60,1,,,,,,,,,,,,,,,
-22186,POSGAR 94 / Argentina 6,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,6500000,-90,0,-57,1,,,,,,,,,,,,,,,
-22187,POSGAR 94 / Argentina 7,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,7500000,-90,0,-54,1,,,,,,,,,,,,,,,
-22191,Campo Inchauspe / Argentina 1,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,1500000,-90,0,-72,1,,,,,,,,,,,,,,,
-22192,Campo Inchauspe / Argentina 2,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,2500000,-90,0,-69,1,,,,,,,,,,,,,,,
-22193,Campo Inchauspe / Argentina 3,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,3500000,-90,0,-66,1,,,,,,,,,,,,,,,
-22194,Campo Inchauspe / Argentina 4,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,4500000,-90,0,-63,1,,,,,,,,,,,,,,,
-22195,Campo Inchauspe / Argentina 5,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,5500000,-90,0,-60,1,,,,,,,,,,,,,,,
-22196,Campo Inchauspe / Argentina 6,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,6500000,-90,0,-57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22197,Campo Inchauspe / Argentina 7,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,7500000,-90,0,-54,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22234,Cape / UTM zone 34S,Transverse Mercator,metre,4222,Cape,Clarke 1880 (Arc),500000,0,10000000,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22235,Cape / UTM zone 35S,Transverse Mercator,metre,4222,Cape,Clarke 1880 (Arc),500000,0,10000000,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22236,Cape / UTM zone 36S,Transverse Mercator,metre,4222,Cape,Clarke 1880 (Arc),500000,0,10000000,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22275,Cape / Lo15,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22277,Cape / Lo17,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,17,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22279,Cape / Lo19,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,19,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22281,Cape / Lo21,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22283,Cape / Lo23,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,23,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22285,Cape / Lo25,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,25,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22287,Cape / Lo27,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22289,Cape / Lo29,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,29,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-22291,Cape / Lo31,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22293,Cape / Lo33,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22300,Carthage (Paris) / Tunisia Mining Grid,Tunisia Mining Grid,kilometre,4816,Carthage (Paris),Clarke 1880 (IGN),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.81973,7.83445,0,582,270
-22332,Carthage / UTM zone 32N,Transverse Mercator,metre,4223,Carthage,Clarke 1880 (IGN),500000,0,0,9,0.9996,,,,,,,,,,,,,,,,
-22391,Carthage / Nord Tunisie,Lambert Conic Conformal (1SP),metre,4223,Carthage,Clarke 1880 (IGN),500000,40,300000,11,0.999625544,,,,,,,,,,,,,,,,
-22392,Carthage / Sud Tunisie,Lambert Conic Conformal (1SP),metre,4223,Carthage,Clarke 1880 (IGN),500000,37,300000,11,0.999625769,,,,,,,,,,,,,,,,
-22521,Corrego Alegre / UTM zone 21S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-57,0.9996,,,,,,,,,,,,,,,,
-22522,Corrego Alegre / UTM zone 22S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-51,0.9996,,,,,,,,,,,,,,,,
-22523,Corrego Alegre / UTM zone 23S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-45,0.9996,,,,,,,,,,,,,,,,
-22524,Corrego Alegre / UTM zone 24S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-39,0.9996,,,,,,,,,,,,,,,,
-22525,Corrego Alegre / UTM zone 25S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-33,0.9996,,,,,,,,,,,,,,,,
-22700,Deir ez Zor / Levant Zone,Lambert Conic Near-Conformal,metre,4227,Deir ez Zor,Clarke 1880 (IGN),300000,34.39,300000,37.21,0.9996256,,,,,,,,,,,,,,,,
-22770,Deir ez Zor / Syria Lambert,Lambert Conic Conformal (1SP),metre,4227,Deir ez Zor,Clarke 1880 (IGN),300000,34.39,300000,37.21,0.9996256,,,,,,,,,,,,,,,,
-22780,Deir ez Zor / Levant Stereographic,Oblique Stereographic,metre,4227,Deir ez Zor,Clarke 1880 (IGN),0,38,0,43.5,0.9995341,,,,,,,,,,,,,,,,
-22991,Egypt 1907 / Blue Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,300000,30,1100000,35,1,,,,,,,,,,,,,,,,
-22992,Egypt 1907 / Red Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,615000,30,810000,31,1,,,,,,,,,,,,,,,,
-22993,Egypt 1907 / Purple Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,700000,30,200000,27,1,,,,,,
-22994,Egypt 1907 / Extended Purple Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,700000,30,1200000,27,1,,,,,,
-23028,ED50 / UTM zone 28N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,-15,0.9996,,,,,,
-23029,ED50 / UTM zone 29N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,-9,0.9996,0,0,0,0,0,0
-23030,ED50 / UTM zone 30N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,-3,0.9996,0,0,0,0,0,0
-23031,ED50 / UTM zone 31N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,3,0.9996,0,0,0,0,0,0
-23032,ED50 / UTM zone 32N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,9,0.9996,0,0,0,0,0,0
-23033,ED50 / UTM zone 33N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,15,0.9996,0,0,0,0,0,0
-23034,ED50 / UTM zone 34N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,21,0.9996,0,0,0,0,0,0
-23035,ED50 / UTM zone 35N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,27,0.9996,0,0,0,0,0,0
-23036,ED50 / UTM zone 36N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,33,0.9996,0,0,0,0,0,0
-23037,ED50 / UTM zone 37N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,39,0.9996,0,0,0,0,0,0
-23038,ED50 / UTM zone 38N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,45,0.9996,0,0,0,0,0,0
-23090,ED50 / TM 0 N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,0,0.9996,0,0,0,0,0,0
-23095,ED50 / TM 5 NE,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,5,0.9996,0,0,0,0,0,0
-23239,Fahud / UTM zone 39N,Transverse Mercator,metre,4232,Fahud,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0
-23240,Fahud / UTM zone 40N,Transverse Mercator,metre,4232,Fahud,Clarke 1880 (RGS),500000,0,0,57,0.9996,0,0,0,0,0,0,
-23700,HD72 / EOV,Oblique Mercator,metre,4237,Hungarian Datum 1972,GRS 1967,0,0,0,0,0,90,47.08398174,200000,90,0.99993,650000,19.02548584
-23830,DGN95 / Indonesia TM-3 zone 46.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,94.5,0.9999,0,0,0,0,0,0,
-23831,DGN95 / Indonesia TM-3 zone 47.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,97.5,0.9999,,,,,,,
-23832,DGN95 / Indonesia TM-3 zone 47.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,100.5,0.9999,,,,,,,
-23833,DGN95 / Indonesia TM-3 zone 48.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,103.5,0.9999,,,,,,,
-23834,DGN95 / Indonesia TM-3 zone 48.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,106.5,0.9999,,,,,,,
-23835,DGN95 / Indonesia TM-3 zone 49.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,109.5,0.9999,,,,,,,
-23836,DGN95 / Indonesia TM-3 zone 49.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,112.5,0.9999,,,,,,,
-23837,DGN95 / Indonesia TM-3 zone 50.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,115.5,0.9999,,,,,,,
-23838,DGN95 / Indonesia TM-3 zone 50.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,118.5,0.9999,,,,,,,
-23839,DGN95 / Indonesia TM-3 zone 51.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,121.5,0.9999,,,,,,,
-23840,DGN95 / Indonesia TM-3 zone 51.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,124.5,0.9999,,,,,,,
-23841,DGN95 / Indonesia TM-3 zone 52.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,127.5,0.9999,,,,,,,
-23842,DGN95 / Indonesia TM-3 zone 52.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,130.5,0.9999,,,,,,,
-23843,DGN95 / Indonesia TM-3 zone 53.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,133.5,0.9999,,,,,,,
-23844,DGN95 / Indonesia TM-3 zone 53.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,136.5,0.9999
-23845,DGN95 / Indonesia TM-3 zone 54.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,139.5,0.9999
-23846,ID74 / UTM zone 46N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,93,0.9996
-23847,ID74 / UTM zone 47N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,99,0.9996
-23848,ID74 / UTM zone 48N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,105,0.9996
-23849,ID74 / UTM zone 49N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,111,0.9996
-23850,ID74 / UTM zone 50N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,117,0.9996
-23851,ID74 / UTM zone 51N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,123,0.9996
-23852,ID74 / UTM zone 52N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,129,0.9996
-23866,DGN95 / UTM zone 46N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,93,0.9996
-23867,DGN95 / UTM zone 47N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,99,0.9996
-23868,DGN95 / UTM zone 48N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,105,0.9996
-23869,DGN95 / UTM zone 49N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,111,0.9996
-23870,DGN95 / UTM zone 50N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,117,0.9996
-23871,DGN95 / UTM zone 51N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,123,0.9996
-23872,DGN95 / UTM zone 52N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,129,0.9996
-23877,DGN95 / UTM zone 47S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,99,0.9996
-23878,DGN95 / UTM zone 48S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,105,0.9996
-23879,DGN95 / UTM zone 49S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,111,0.9996
-23880,DGN95 / UTM zone 50S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,117,0.9996
-23881,DGN95 / UTM zone 51S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,123,0.9996
-23882,DGN95 / UTM zone 52S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,129,0.9996
-23883,DGN95 / UTM zone 53S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,135,0.9996
-23884,DGN95 / UTM zone 54S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,141,0.9996
-23887,ID74 / UTM zone 47S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,99,0.9996
-23888,ID74 / UTM zone 48S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,105,0.9996
-23889,ID74 / UTM zone 49S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,111,0.9996
-23890,ID74 / UTM zone 50S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,117,0.9996
-23891,ID74 / UTM zone 51S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,123,0.9996
-23892,ID74 / UTM zone 52S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,129,0.9996
-23893,ID74 / UTM zone 53S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,135,0.9996
-23894,ID74 / UTM zone 54S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,141,0.9996
-23946,Indian 1954 / UTM zone 46N,Transverse Mercator,metre,4239,Indian 1954,Everest 1830 (1937 Adjustment),500000,0,0,93,0.9996
-23947,Indian 1954 / UTM zone 47N,Transverse Mercator,metre,4239,Indian 1954,Everest 1830 (1937 Adjustment),500000,0,0,99,0.9996
-23948,Indian 1954 / UTM zone 48N,Transverse Mercator,metre,4239,Indian 1954,Everest 1830 (1937 Adjustment),500000,0,0,105,0.9996
-24047,Indian 1975 / UTM zone 47N,Transverse Mercator,metre,4240,Indian 1975,Everest 1830 (1937 Adjustment),500000,0,0,99,0.9996
-24048,Indian 1975 / UTM zone 48N,Transverse Mercator,metre,4240,Indian 1975,Everest 1830 (1937 Adjustment),500000,0,0,105,0.9996
-24100,Jamaica 1875 / Jamaica (Old Grid),Lambert Conic Conformal (1SP),Clarke's foot,4241,Jamaica 1875,Clarke 1880,550000,18,400000,-77,1
-24200,JAD69 / Jamaica National Grid,Lambert Conic Conformal (1SP),metre,4242,Jamaica 1969,Clarke 1866,250000,18,150000,-77,1
-24305,Kalianpur 1937 / UTM zone 45N,Transverse Mercator,metre,4144,Kalianpur 1937,Everest 1830 (1937 Adjustment),500000,0,0,87,0.9996
-24306,Kalianpur 1937 / UTM zone 46N,Transverse Mercator,metre,4144,Kalianpur 1937,Everest 1830 (1937 Adjustment),500000,0,0,93,0.9996
-24311,Kalianpur 1962 / UTM zone 41N,Transverse Mercator,metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),500000,0,0,63,0.9996
-24312,Kalianpur 1962 / UTM zone 42N,Transverse Mercator,metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),500000,0,0,69,0.9996
-24313,Kalianpur 1962 / UTM zone 43N,Transverse Mercator,metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),500000,0,0,75,0.9996
-24342,Kalianpur 1975 / UTM zone 42N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,69,0.9996
-24343,Kalianpur 1975 / UTM zone 43N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,75,0.9996
-24344,Kalianpur 1975 / UTM zone 44N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,81,0.9996
-24345,Kalianpur 1975 / UTM zone 45N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,87,0.9996
-24346,Kalianpur 1975 / UTM zone 46N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,93,0.9996
-24347,Kalianpur 1975 / UTM zone 47N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,99,0.9996
-24370,Kalianpur 1880 / India zone 0,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),2355500,39.3,2590000,68,0.99846154
-24371,Kalianpur 1880 / India zone I,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,32.3,1000000,68,0.99878641
-24372,Kalianpur 1880 / India zone IIa,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,26,1000000,74,0.99878641
-24373,Kalianpur 1880 / India zone III,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,19,1000000,80,0.99878641
-24374,Kalianpur 1880 / India zone IV,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,12,1000000,80,0.99878641
-24375,Kalianpur 1937 / India zone IIb,Lambert Conic Conformal (1SP),metre,4144,Kalianpur 1937,Everest 1830 (1937 Adjustment),2743185.69,26,914395.23,90,0.99878641
-24376,Kalianpur 1962 / India zone I,Lambert Conic Conformal (1SP),metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),2743196.4,32.3,914398.8,68,0.99878641
-24377,Kalianpur 1962 / India zone IIa,Lambert Conic Conformal (1SP),metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),2743196.4,26,914398.8,74,0.99878641
-24378,Kalianpur 1975 / India zone I,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,32.3,914398.5,68,0.99878641
-24379,Kalianpur 1975 / India zone IIa,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,26,914398.5,74,0.99878641
-24380,Kalianpur 1975 / India zone IIb,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,26,914398.5,90,0.99878641
-24381,Kalianpur 1975 / India zone III,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,19,914398.5,80,0.99878641
-24382,Kalianpur 1880 / India zone IIb,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,26,1000000,90,0.99878641
-24383,Kalianpur 1975 / India zone IV,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,12,914398.5,80,0.99878641
-24500,Kertau 1968 / Singapore Grid,Cassini-Soldner,metre,4245,Kertau 1968,Everest 1830 Modified,30000,1.1715528,30000,103.5110808,
-24547,Kertau 1968 / UTM zone 47N,Transverse Mercator,metre,4245,Kertau 1968,Everest 1830 Modified,500000,0,0,99,0.9996
-24548,Kertau 1968 / UTM zone 48N,Transverse Mercator,metre,4245,Kertau 1968,Everest 1830 Modified,500000,0,0,105,0.9996
-24600,KOC Lambert,Lambert Conic Conformal (1SP),metre,4246,Kuwait Oil Company,Clarke 1880 (RGS),1500000,32.3,1166200,45,0.998786408
-24718,La Canoa / UTM zone 18N,Transverse Mercator,metre,4247,La Canoa,International 1924,500000,0,0,-75,0.9996
-24719,La Canoa / UTM zone 19N,Transverse Mercator,metre,4247,La Canoa,International 1924,500000,0,0,-69,0.9996
-24720,La Canoa / UTM zone 20N,Transverse Mercator,metre,4247,La Canoa,International 1924,500000,0,0,-63,0.9996
-24817,PSAD56 / UTM zone 17N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-81,0.9996
-24818,PSAD56 / UTM zone 18N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-75,0.9996
-24819,PSAD56 / UTM zone 19N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-69,0.9996
-24820,PSAD56 / UTM zone 20N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-63,0.9996
-24821,PSAD56 / UTM zone 21N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-57,0.9996
-24877,PSAD56 / UTM zone 17S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-81,0.9996
-24878,PSAD56 / UTM zone 18S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-75,0.9996
-24879,PSAD56 / UTM zone 19S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-69,0.9996
-24880,PSAD56 / UTM zone 20S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-63,0.9996
-24881,PSAD56 / UTM zone 21S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-57,0.9996
-24882,PSAD56 / UTM zone 22S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-51,0.9996
-24891,PSAD56 / Peru west zone,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,222000,-6,1426834.743,-80.3,0.99983008
-24892,PSAD56 / Peru central zone,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,720000,-9.3,1039979.159,-76,0.99932994
-24893,PSAD56 / Peru east zone,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,1324000,-9.3,1040084.558,-70.3,0.99952992
-25000,Leigon / Ghana Metre Grid,Transverse Mercator,metre,4250,Leigon,Clarke 1880 (RGS),274319.51,4.4,0,-1,0.99975
-25231,Lome / UTM zone 31N,Transverse Mercator,metre,4252,Lome,Clarke 1880 (IGN),500000,0,0,3,0.9996
-25391,Luzon 1911 / Philippines zone I,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,117,0.99995
-25392,Luzon 1911 / Philippines zone II,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,119,0.99995
-25393,Luzon 1911 / Philippines zone III,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,121,0.99995
-25394,Luzon 1911 / Philippines zone IV,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,123,0.99995
-25395,Luzon 1911 / Philippines zone V,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,125,0.99995
-25828,ETRS89 / UTM zone 28N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-15,0.9996
-25829,ETRS89 / UTM zone 29N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-9,0.9996
-25830,ETRS89 / UTM zone 30N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-3,0.9996
-25831,ETRS89 / UTM zone 31N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,3,0.9996
-25832,ETRS89 / UTM zone 32N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,9,0.9996
-25833,ETRS89 / UTM zone 33N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,15,0.9996
-25834,ETRS89 / UTM zone 34N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,21,0.9996
-25835,ETRS89 / UTM zone 35N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,0.9996
-25836,ETRS89 / UTM zone 36N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,33,0.9996
-25837,ETRS89 / UTM zone 37N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,39,0.9996
-25838,ETRS89 / UTM zone 38N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,45,0.9996
-25884,ETRS89 / TM Baltic93,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,24,0.9996
-25932,Malongo 1987 / UTM zone 32S,Transverse Mercator,metre,4259,Malongo 1987,International 1924,500000,0,10000000,9,0.9996
-26191,Merchich / Nord Maroc,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),500000,37,300000,-6,0.999625769
-26192,Merchich / Sud Maroc,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),500000,33,300000,-6,0.999615596
-26194,Merchich / Sahara Nord,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),1200000,29,400000,-6,0.999616304
-26195,Merchich / Sahara Sud,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),1500000,25,400000,-6,0.999616437
-26237,Massawa / UTM zone 37N,Transverse Mercator,metre,4262,Massawa,Bessel 1841,500000,0,0,39,0.9996
-26331,Minna / UTM zone 31N,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),500000,0,0,3,0.9996
-26332,Minna / UTM zone 32N,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),500000,0,0,9,0.9996
-26391,Minna / Nigeria West Belt,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),230738.26,4,0,4.3,0.99975
-26392,Minna / Nigeria Mid Belt,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),670553.98,4,0,8.3,0.99975
-26393,Minna / Nigeria East Belt,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),1110369.7,4,0,12.3,0.99975
-26632,M'poraloko / UTM zone 32N,Transverse Mercator,metre,4266,M'poraloko,Clarke 1880 (IGN),500000,0,0,9,0.9996
-26692,M'poraloko / UTM zone 32S,Transverse Mercator,metre,4266,M'poraloko,Clarke 1880 (IGN),500000,0,10000000,9,0.9996
-26701,NAD27 / UTM zone 1N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-177,0.9996
-26702,NAD27 / UTM zone 2N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-171,0.9996
-26703,NAD27 / UTM zone 3N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-165,0.9996
-26704,NAD27 / UTM zone 4N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-159,0.9996
-26705,NAD27 / UTM zone 5N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-153,0.9996
-26706,NAD27 / UTM zone 6N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-147,0.9996
-26707,NAD27 / UTM zone 7N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-141,0.9996
-26708,NAD27 / UTM zone 8N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-135,0.9996
-26709,NAD27 / UTM zone 9N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-129,0.9996
-26710,NAD27 / UTM zone 10N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-123,0.9996
-26711,NAD27 / UTM zone 11N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-117,0.9996
-26712,NAD27 / UTM zone 12N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-111,0.9996,,,,,,,
-26713,NAD27 / UTM zone 13N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-105,0.9996,,,,,,,
-26714,NAD27 / UTM zone 14N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-99,0.9996,,,,,,,
-26715,NAD27 / UTM zone 15N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-93,0.9996,0,0,0,0,0,0,
-26716,NAD27 / UTM zone 16N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-87,0.9996,0,0,0,0,0,0,
-26717,NAD27 / UTM zone 17N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-81,0.9996,0,0,0,0,0,0,
-26718,NAD27 / UTM zone 18N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-75,0.9996,0,0,0,0,0,0,
-26719,NAD27 / UTM zone 19N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-69,0.9996,0,0,0,0,0,0,
-26720,NAD27 / UTM zone 20N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-63,0.9996,0,0,0,0,0,0,
-26721,NAD27 / UTM zone 21N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-57,0.9996,0,0,0,0,0,0,
-26722,NAD27 / UTM zone 22N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-51,0.9996,0,0,0,0,0,0,
-26729,NAD27 / Alabama East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30.3,0,-85.5,0.99996,0,0,0,0,0,0,
-26730,NAD27 / Alabama West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30,0,-87.3,0.999933333,0,0,0,0,0,0,
-26731,NAD27 / Alaska zone 1,Hotine Oblique Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,16404166.67,0,-16404166.67,0,0,323.0748369,57,0,323.0748369,0.9999,0,-133.4
-26732,NAD27 / Alaska zone 2,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-142,0.9999,0,0,0,0,0,0,
-26733,NAD27 / Alaska zone 3,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-146,0.9999,0,0,0,0,0,0,
-26734,NAD27 / Alaska zone 4,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-150,0.9999,0,0,0,0,0,0,,,,,,,,,,
-26735,NAD27 / Alaska zone 5,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-154,0.9999,0,0,0,0,0,0,,,,,,,,,,
-26736,NAD27 / Alaska zone 6,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-158,0.9999,0,0,0,0,0,0,,,,,,,,,,
-26737,NAD27 / Alaska zone 7,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,700000,54,0,-162,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26738,NAD27 / Alaska zone 8,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-166,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26739,NAD27 / Alaska zone 9,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,600000,54,0,-170,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26740,NAD27 / Alaska zone 10,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.5,51,-176,53.5,0,3000000
-26741,NAD27 / California zone I,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,0,2000000
-26742,NAD27 / California zone II,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,0,2000000
-26743,NAD27 / California zone III,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,0,2000000
-26744,NAD27 / California zone IV,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,0,2000000
-26745,NAD27 / California zone V,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,0,2000000
-26746,NAD27 / California zone VI,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,0,2000000
-26748,NAD27 / Arizona East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26749,NAD27 / Arizona Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26750,NAD27 / Arizona West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26751,NAD27 / Arkansas North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,2000000
-26752,NAD27 / Arkansas South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,0,2000000
-26753,NAD27 / Colorado North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.47,39.2,-105.3,39.43,0,2000000
-26754,NAD27 / Colorado Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,0,2000000
-26755,NAD27 / Colorado South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,0,2000000
-26756,NAD27 / Connecticut,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,0,600000
-26757,NAD27 / Delaware,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26758,NAD27 / Florida East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26759,NAD27 / Florida West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26760,NAD27 / Florida North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,2000000
-26766,NAD27 / Georgia East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26767,NAD27 / Georgia West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26768,NAD27 / Idaho East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26769,NAD27 / Idaho Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26770,NAD27 / Idaho West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26771,NAD27 / Illinois East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26772,NAD27 / Illinois West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26773,NAD27 / Indiana East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,37.3,0,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26774,NAD27 / Indiana West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,37.3,0,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26775,NAD27 / Iowa North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,0,2000000
-26776,NAD27 / Iowa South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,2000000
-26777,NAD27 / Kansas North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,2000000
-26778,NAD27 / Kansas South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,0,2000000
-26779,NAD27 / Kentucky North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,2000000
-26780,NAD27 / Kentucky South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.56,36.2,-85.45,36.44,0,2000000
-26781,NAD27 / Louisiana North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.4,30.4,-92.3,31.1,0,2000000
-26782,NAD27 / Louisiana South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.42,28.4,-91.2,29.18,0,2000000
-26783,NAD27 / Maine East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,43.5,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26784,NAD27 / Maine West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26785,NAD27 / Maryland,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.27,37.5,-77,38.18,0,800000
-26786,NAD27 / Massachusetts Mainland,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.41,41,-71.3,41.43,0,600000
-26787,NAD27 / Massachusetts Island,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.29,41,-70.3,41.17,0,200000
-26791,NAD27 / Minnesota North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.38,46.3,-93.06,47.02,0,2000000
-26792,NAD27 / Minnesota Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.03,45,-94.15,45.37,0,2000000
-26793,NAD27 / Minnesota South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.13,43,-94,43.47,0,2000000
-26794,NAD27 / Mississippi East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,29.4,0,-88.5,0.99996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26795,NAD27 / Mississippi West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30.3,0,-90.2,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26796,NAD27 / Missouri East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26797,NAD27 / Missouri Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26798,NAD27 / Missouri West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26799,NAD27 / California zone VII,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.52,34.08,-118.2,34.25,4160926.74,4186692.58
-26801,NAD Michigan / Michigan East,Transverse Mercator,US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,500000,41.3,0,-83.4,0.999942857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26802,NAD Michigan / Michigan Old Central,Transverse Mercator,US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,500000,41.3,0,-85.45,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26803,NAD Michigan / Michigan West,Transverse Mercator,US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,500000,41.3,0,-88.45,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26811,NAD Michigan / Michigan North,Lambert Conic Conformal (2SP),US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.05,44.47,-87,45.29,0,2000000
-26812,NAD Michigan / Michigan Central,Lambert Conic Conformal (2SP),US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.42,43.19,-84.2,44.11,0,2000000
-26813,NAD Michigan / Michigan South,Lambert Conic Conformal (2SP),US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.4,41.3,-84.2,42.06,0,2000000
-26847,NAD83 / Maine East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26848,NAD83 / Maine West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2952750,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26849,NAD83 / Minnesota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,328083.3333,2624666.667
-26850,NAD83 / Minnesota Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,328083.3333,2624666.667
-26851,NAD83 / Minnesota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,328083.3333,2624666.667
-26852,NAD83 / Nebraska (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,1640416.667
-26853,NAD83 / West Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,1968500
-26854,NAD83 / West Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,1968500
-26855,NAD83(HARN) / Maine East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26856,NAD83(HARN) / Maine West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2952750,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26857,NAD83(HARN) / Minnesota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,328083.3333,2624666.667
-26858,NAD83(HARN) / Minnesota Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,328083.3333,2624666.667
-26859,NAD83(HARN) / Minnesota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,328083.3333,2624666.667
-26860,NAD83(HARN) / Nebraska (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,1640416.667
-26861,NAD83(HARN) / West Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,1968500
-26862,NAD83(HARN) / West Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,1968500
-26863,NAD83(NSRS2007) / Maine East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26864,NAD83(NSRS2007) / Maine West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2952750,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26865,NAD83(NSRS2007) / Minnesota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,328083.3333,2624666.667
-26866,NAD83(NSRS2007) / Minnesota Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,328083.3333,2624666.667
-26867,NAD83(NSRS2007) / Minnesota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,328083.3333,2624666.667
-26868,NAD83(NSRS2007) / Nebraska (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,1640416.667
-26869,NAD83(NSRS2007) / West Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,1968500
-26870,NAD83(NSRS2007) / West Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,1968500
-26891,NAD83(CSRS) / MTM zone 11,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-82.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26892,NAD83(CSRS) / MTM zone 12,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-81,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26893,NAD83(CSRS) / MTM zone 13,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-84,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26894,NAD83(CSRS) / MTM zone 14,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-87,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26895,NAD83(CSRS) / MTM zone 15,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-90,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26896,NAD83(CSRS) / MTM zone 16,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-93,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26897,NAD83(CSRS) / MTM zone 17,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-96,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26898,NAD83(CSRS) / MTM zone 1,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-53,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26899,NAD83(CSRS) / MTM zone 2,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-56,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26901,NAD83 / UTM zone 1N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26902,NAD83 / UTM zone 2N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26903,NAD83 / UTM zone 3N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26904,NAD83 / UTM zone 4N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-159,0.9996,,,,,,,,,,,,,,,
-26905,NAD83 / UTM zone 5N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-153,0.9996,,,,,,,,,,,,,,,
-26906,NAD83 / UTM zone 6N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-147,0.9996,,,,,,,,,,,,,,,
-26907,NAD83 / UTM zone 7N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-141,0.9996,,,,,,,,,,,,,,,
-26908,NAD83 / UTM zone 8N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-135,0.9996,,,,,,,,,,,,,,,
-26909,NAD83 / UTM zone 9N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-129,0.9996,,,,,,,,,,,,,,,
-26910,NAD83 / UTM zone 10N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-123,0.9996,,,,,,,,,,,,,,,
-26911,NAD83 / UTM zone 11N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-117,0.9996,,,,,,,,,,,,,,,
-26912,NAD83 / UTM zone 12N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-111,0.9996,,,,,,,,,,,,,,,
-26913,NAD83 / UTM zone 13N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-105,0.9996,,,,,,,,,,,,,,,
-26914,NAD83 / UTM zone 14N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-99,0.9996,,,,,,,,,,,,,,,
-26915,NAD83 / UTM zone 15N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-93,0.9996,,,,,,,,,,,,,,,
-26916,NAD83 / UTM zone 16N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,
-26917,NAD83 / UTM zone 17N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-81,0.9996,,,,,,,,,,,,,,,
-26918,NAD83 / UTM zone 18N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-75,0.9996,,,,,,,,,,,,,,,
-26919,NAD83 / UTM zone 19N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-69,0.9996,,,,,,,,,,,,,,,
-26920,NAD83 / UTM zone 20N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26921,NAD83 / UTM zone 21N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26922,NAD83 / UTM zone 22N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26923,NAD83 / UTM zone 23N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26929,NAD83 / Alabama East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,30.3,0,-85.5,0.99996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26930,NAD83 / Alabama West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,600000,30,0,-87.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26931,NAD83 / Alaska zone 1,Hotine Oblique Mercator,metre,4269,North American Datum 1983,GRS 1980,5000000,0,-5000000,0,0,323.0748369,57,0,323.0748369,0.9999,0,-133.4,0,0,0,0,0,0,0,0
-26932,NAD83 / Alaska zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-142,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26933,NAD83 / Alaska zone 3,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-146,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26934,NAD83 / Alaska zone 4,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-150,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26935,NAD83 / Alaska zone 5,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-154,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26936,NAD83 / Alaska zone 6,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-158,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26937,NAD83 / Alaska zone 7,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-162,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-26938,NAD83 / Alaska zone 8,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-166,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26939,NAD83 / Alaska zone 9,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-170,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26940,NAD83 / Alaska zone 10,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.5,51,-176,53.5,0,1000000
-26941,NAD83 / California zone 1,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,500000,2000000
-26942,NAD83 / California zone 2,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,500000,2000000
-26943,NAD83 / California zone 3,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,500000,2000000
-26944,NAD83 / California zone 4,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,500000,2000000
-26945,NAD83 / California zone 5,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,500000,2000000
-26946,NAD83 / California zone 6,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,500000,2000000
-26948,NAD83 / Arizona East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,213360,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26949,NAD83 / Arizona Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,213360,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26950,NAD83 / Arizona West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,213360,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26951,NAD83 / Arkansas North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,400000
-26952,NAD83 / Arkansas South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,400000,400000
-26953,NAD83 / Colorado North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,304800.6096,914401.8289
-26954,NAD83 / Colorado Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,304800.6096,914401.8289
-26955,NAD83 / Colorado South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,304800.6096,914401.8289
-26956,NAD83 / Connecticut,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,152400.3048,304800.6096
-26957,NAD83 / Delaware,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26958,NAD83 / Florida East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26959,NAD83 / Florida West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26960,NAD83 / Florida North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,600000
-26961,NAD83 / Hawaii zone 1,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,18.5,0,-155.3,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26962,NAD83 / Hawaii zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,20.2,0,-156.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26963,NAD83 / Hawaii zone 3,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26964,NAD83 / Hawaii zone 4,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,21.5,0,-159.3,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26965,NAD83 / Hawaii zone 5,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,21.4,0,-160.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26966,NAD83 / Georgia East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26967,NAD83 / Georgia West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26968,NAD83 / Idaho East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26969,NAD83 / Idaho Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26970,NAD83 / Idaho West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,800000,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26971,NAD83 / Illinois East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26972,NAD83 / Illinois West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26973,NAD83 / Indiana East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,100000,37.3,250000,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26974,NAD83 / Indiana West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,900000,37.3,250000,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26975,NAD83 / Iowa North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,1000000,1500000
-26976,NAD83 / Iowa South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,500000
-26977,NAD83 / Kansas North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,400000
-26978,NAD83 / Kansas South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,400000,400000
-26980,NAD83 / Kentucky South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,500000,500000
-26981,NAD83 / Louisiana North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,1000000
-26982,NAD83 / Louisiana South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,1000000
-26983,NAD83 / Maine East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26984,NAD83 / Maine West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,900000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26985,NAD83 / Maryland,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,400000
-26986,NAD83 / Massachusetts Mainland,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,750000,200000
-26987,NAD83 / Massachusetts Island,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,500000
-26988,NAD83 / Michigan North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,8000000
-26989,NAD83 / Michigan Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,6000000
-26990,NAD83 / Michigan South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,4000000
-26991,NAD83 / Minnesota North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,100000,800000
-26992,NAD83 / Minnesota Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,100000,800000
-26993,NAD83 / Minnesota South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,100000,800000
-26994,NAD83 / Mississippi East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26995,NAD83 / Mississippi West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26996,NAD83 / Missouri East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,250000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26997,NAD83 / Missouri Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26998,NAD83 / Missouri West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,850000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-27037,Nahrwan 1967 / UTM zone 37N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-27038,Nahrwan 1967 / UTM zone 38N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-27039,Nahrwan 1967 / UTM zone 39N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-27040,Nahrwan 1967 / UTM zone 40N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-27120,Naparima 1972 / UTM zone 20N,Transverse Mercator,metre,4271,Naparima 1972,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-27200,NZGD49 / New Zealand Map Grid,New Zealand Map Grid,metre,4272,New Zealand Geodetic Datum 1949,International 1924,2510000,-41,6023150,173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-27205,NZGD49 / Mount Eden Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-36.5247515,700000,174.4551622,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-27206,NZGD49 / Bay of Plenty Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-37.45404993,700000,176.275831,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-27207,NZGD49 / Poverty Bay Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-38.372893,700000,177.5308291,1,,,,,,,,,,,,,,,
-27208,NZGD49 / Hawkes Bay Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39.39033455,700000,176.402525,1,,,,,,,,,,,,,,,
-27209,NZGD49 / Taranaki Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39.08087299,700000,174.1340842,1,,,,,,,,,,,,,,,
-27210,NZGD49 / Tuhirangi Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39.30448934,700000,175.3824133,1,,,,,,,,,,,,,,,
-27211,NZGD49 / Wanganui Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-40.14310097,700000,175.2917159,1,,,,,,,,,,,,,,,
-27212,NZGD49 / Wairarapa Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-40.55319175,700000,175.3850459,1,,,,,,,,,,,,,,,
-27213,NZGD49 / Wellington Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.18047507,700000,174.4635843,1,,,,,,,,,,,,,,,
-27214,NZGD49 / Collingwood Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-40.42531326,700000,172.4019367,1,,,,,,,,,,,,,,,
-27215,NZGD49 / Nelson Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.1628361,700000,173.1757541,1,,,,,,,,,,,,,,,
-27216,NZGD49 / Karamea Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.17236815,700000,172.0632502,1,,,,,,,,,,,,,,,
-27217,NZGD49 / Buller Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.48388903,700000,171.3452536,1,,,,,,,,,,,,,,,
-27218,NZGD49 / Grey Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-42.20012994,700000,171.3259177,1,,,,,,,,,,,,,,,
-27219,NZGD49 / Amuri Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-42.41208197,700000,173.003648,1,,,,,,,,,,,,,,,
-27220,NZGD49 / Marlborough Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.3240152,700000,173.4807467,1
-27221,NZGD49 / Hokitika Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-42.53107605,700000,170.5847977,1
-27222,NZGD49 / Okarito Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.06364613,700000,170.1539333,1
-27223,NZGD49 / Jacksons Bay Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.58400904,700000,168.3622561,1
-27224,NZGD49 / Mount Pleasant Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.35262953,700000,172.4337897,1
-27225,NZGD49 / Gawler Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.44553616,700000,171.2138695,1
-27226,NZGD49 / Timaru Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-44.24079933,700000,171.0326103,1
-27227,NZGD49 / Lindis Peak Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-44.44069647,700000,169.2803918,1
-27228,NZGD49 / Mount Nicholas Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.07584493,700000,168.2355108,1
-27229,NZGD49 / Mount York Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.33494142,700000,167.4419902,1
-27230,NZGD49 / Observation Point Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.48583078,700000,170.3742943,1
-27231,NZGD49 / North Taieri Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.51414481,700000,170.1657321,0.99996
-27232,NZGD49 / Bluff Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300002.66,-46.36000346,699999.58,168.2034339,1
-27258,NZGD49 / UTM zone 58S,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,500000,0,10000000,165,0.9996
-27259,NZGD49 / UTM zone 59S,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,500000,0,10000000,171,0.9996
-27260,NZGD49 / UTM zone 60S,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,500000,0,10000000,177,0.9996
-27291,NZGD49 / North Island Grid,Transverse Mercator,British yard (Sears 1922),4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39,400000,175.3,1
-27292,NZGD49 / South Island Grid,Transverse Mercator,British yard (Sears 1922),4272,New Zealand Geodetic Datum 1949,International 1924,500000,-44,500000,171.3,1
-27391,NGO 1948 (Oslo) / NGO zone I,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,-4.4,1
-27392,NGO 1948 (Oslo) / NGO zone II,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,-2.2,1
-27393,NGO 1948 (Oslo) / NGO zone III,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,0,1
-27394,NGO 1948 (Oslo) / NGO zone IV,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,2.3,1
-27395,NGO 1948 (Oslo) / NGO zone V,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,6.1,1
-27396,NGO 1948 (Oslo) / NGO zone VI,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,10.1,1
-27397,NGO 1948 (Oslo) / NGO zone VII,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,14.1,1
-27398,NGO 1948 (Oslo) / NGO zone VIII,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,18.2,1
-27429,Datum 73 / UTM zone 29N,Transverse Mercator,metre,4274,Datum 73,International 1924,500000,0,0,-9,0.9996
-27493,Datum 73 / Modified Portuguese Grid,Transverse Mercator,metre,4274,Datum 73,International 1924,180.598,39.4,-86.99,-8.0754862,1
-27500,ATF (Paris) / Nord de Guerre,Lambert Conic Conformal (1SP),metre,4901,Ancienne Triangulation Francaise (Paris),Plessis 1817,500000,55,300000,6,0.99950908
-27561,NTF (Paris) / Lambert Nord France,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,55,200000,0,0.999877341
-27562,NTF (Paris) / Lambert Centre France,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,52,200000,0,0.99987742
-27563,NTF (Paris) / Lambert Sud France,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,49,200000,0,0.999877499
-27564,NTF (Paris) / Lambert Corse,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),234.358,46.85,185861.369,0,0.99994471
-27571,NTF (Paris) / Lambert zone I,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,55,1200000,0,0.999877341
-27572,NTF (Paris) / Lambert zone II,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,52,2200000,0,0.99987742
-27573,NTF (Paris) / Lambert zone III,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,49,3200000,0,0.999877499
-27574,NTF (Paris) / Lambert zone IV,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),234.358,46.85,4185861.369,0,0.99994471
-27700,OSGB 1936 / British National Grid,Transverse Mercator,metre,4277,OSGB 1936,Airy 1830,400000,49,-100000,-2,0.999601272
-28191,Palestine 1923 / Palestine Grid,Cassini-Soldner,metre,4281,Palestine 1923,Clarke 1880 (Benoit),170251.555,31.4402749,126867.909,35.124349,
-28192,Palestine 1923 / Palestine Belt,Transverse Mercator,metre,4281,Palestine 1923,Clarke 1880 (Benoit),170251.555,31.4402749,1126867.909,35.124349,1
-28193,Palestine 1923 / Israeli CS Grid,Cassini-Soldner,metre,4281,Palestine 1923,Clarke 1880 (Benoit),170251.555,31.4402749,1126867.909,35.124349,
-28232,Pointe Noire / UTM zone 32S,Transverse Mercator,metre,4282,Congo 1960 Pointe Noire,Clarke 1880 (IGN),500000,0,10000000,9,0.9996
-28348,GDA94 / MGA zone 48,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,105,0.9996
-28349,GDA94 / MGA zone 49,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,111,0.9996
-28350,GDA94 / MGA zone 50,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,117,0.9996
-28351,GDA94 / MGA zone 51,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,123,0.9996
-28352,GDA94 / MGA zone 52,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,129,0.9996
-28353,GDA94 / MGA zone 53,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,135,0.9996
-28354,GDA94 / MGA zone 54,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,141,0.9996
-28355,GDA94 / MGA zone 55,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,147,0.9996
-28356,GDA94 / MGA zone 56,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,153,0.9996
-28357,GDA94 / MGA zone 57,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,159,0.9996
-28358,GDA94 / MGA zone 58,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,165,0.9996
-28404,Pulkovo 1942 / Gauss-Kruger zone 4,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,4500000,0,0,21,1
-28405,Pulkovo 1942 / Gauss-Kruger zone 5,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,5500000,0,0,27,1
-28406,Pulkovo 1942 / Gauss-Kruger zone 6,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,6500000,0,0,33,1
-28407,Pulkovo 1942 / Gauss-Kruger zone 7,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,7500000,0,0,39,1
-28408,Pulkovo 1942 / Gauss-Kruger zone 8,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,8500000,0,0,45,1
-28409,Pulkovo 1942 / Gauss-Kruger zone 9,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,9500000,0,0,51,1
-28410,Pulkovo 1942 / Gauss-Kruger zone 10,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,10500000,0,0,57,1
-28411,Pulkovo 1942 / Gauss-Kruger zone 11,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,11500000,0,0,63,1
-28412,Pulkovo 1942 / Gauss-Kruger zone 12,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,12500000,0,0,69,1
-28413,Pulkovo 1942 / Gauss-Kruger zone 13,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,13500000,0,0,75,1
-28414,Pulkovo 1942 / Gauss-Kruger zone 14,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,14500000,0,0,81,1
-28415,Pulkovo 1942 / Gauss-Kruger zone 15,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,15500000,0,0,87,1
-28416,Pulkovo 1942 / Gauss-Kruger zone 16,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,16500000,0,0,93,1
-28417,Pulkovo 1942 / Gauss-Kruger zone 17,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,17500000,0,0,99,1
-28418,Pulkovo 1942 / Gauss-Kruger zone 18,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,18500000,0,0,105,1
-28419,Pulkovo 1942 / Gauss-Kruger zone 19,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,19500000,0,0,111,1
-28420,Pulkovo 1942 / Gauss-Kruger zone 20,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,20500000,0,0,117,1
-28421,Pulkovo 1942 / Gauss-Kruger zone 21,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,21500000,0,0,123,1
-28422,Pulkovo 1942 / Gauss-Kruger zone 22,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,22500000,0,0,129,1
-28423,Pulkovo 1942 / Gauss-Kruger zone 23,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,23500000,0,0,135,1
-28424,Pulkovo 1942 / Gauss-Kruger zone 24,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,24500000,0,0,141,1
-28425,Pulkovo 1942 / Gauss-Kruger zone 25,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,25500000,0,0,147,1
-28426,Pulkovo 1942 / Gauss-Kruger zone 26,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,26500000,0,0,153,1
-28427,Pulkovo 1942 / Gauss-Kruger zone 27,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,27500000,0,0,159,1
-28428,Pulkovo 1942 / Gauss-Kruger zone 28,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,28500000,0,0,165,1
-28429,Pulkovo 1942 / Gauss-Kruger zone 29,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,29500000,0,0,171,1
-28430,Pulkovo 1942 / Gauss-Kruger zone 30,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,30500000,0,0,177,1
-28431,Pulkovo 1942 / Gauss-Kruger zone 31,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,31500000,0,0,-177,1
-28432,Pulkovo 1942 / Gauss-Kruger zone 32,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,32500000,0,0,-171,1
-28600,Qatar 1974 / Qatar National Grid,Transverse Mercator,metre,4285,Qatar 1974,International 1924,200000,24.27,300000,51.13,0.99999
-28991,Amersfoort / RD Old,Oblique Stereographic,metre,4289,Amersfoort,Bessel 1841,0,52.0922178,0,5.23155,0.9999079
-28992,Amersfoort / RD New,Oblique Stereographic,metre,4289,Amersfoort,Bessel 1841,155000,52.0922178,463000,5.23155,0.9999079
-29101,SAD69 / Brazil Polyconic,American Polyconic,metre,4291,South American Datum 1969,GRS 1967 Modified,5000000,0,10000000,-54,
-29168,SAD69 / UTM zone 18N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-75,0.9996
-29169,SAD69 / UTM zone 19N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-69,0.9996
-29170,SAD69 / UTM zone 20N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-63,0.9996
-29171,SAD69 / UTM zone 21N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-57,0.9996
-29172,SAD69 / UTM zone 22N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-51,0.9996
-29187,SAD69 / UTM zone 17S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-81,0.9996
-29188,SAD69 / UTM zone 18S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-75,0.9996
-29189,SAD69 / UTM zone 19S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-69,0.9996
-29190,SAD69 / UTM zone 20S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-63,0.9996
-29191,SAD69 / UTM zone 21S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-57,0.9996
-29192,SAD69 / UTM zone 22S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-51,0.9996,,,,,,,
-29193,SAD69 / UTM zone 23S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-45,0.9996,,,,,,,
-29194,SAD69 / UTM zone 24S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-39,0.9996,,,,,,,
-29195,SAD69 / UTM zone 25S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-33,0.9996,0,0,0,0,0,0,
-29220,Sapper Hill 1943 / UTM zone 20S,Transverse Mercator,metre,4292,Sapper Hill 1943,International 1924,500000,0,10000000,-63,0.9996,0,0,0,0,0,0,
-29221,Sapper Hill 1943 / UTM zone 21S,Transverse Mercator,metre,4292,Sapper Hill 1943,International 1924,500000,0,10000000,-57,0.9996,0,0,0,0,0,0,
-29333,Schwarzeck / UTM zone 33S,Transverse Mercator,metre,4293,Schwarzeck,Bessel Namibia (GLM),500000,0,10000000,15,0.9996,0,0,0,0,0,0,
-29371,Schwarzeck / Lo22/11,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,11,1,0,0,0,0,0,0,
-29373,Schwarzeck / Lo22/13,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,13,1,0,0,0,0,0,0,
-29375,Schwarzeck / Lo22/15,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,15,1,0,0,0,0,0,0,
-29377,Schwarzeck / Lo22/17,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,17,1,0,0,0,0,0,0,
-29379,Schwarzeck / Lo22/19,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,19,1,0,0,0,0,0,0,
-29381,Schwarzeck / Lo22/21,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,21,1,0,0,0,0,0,0,
-29383,Schwarzeck / Lo22/23,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,23,1,0,0,0,0,0,0,
-29385,Schwarzeck / Lo22/25,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,25,1,0,0,0,0,0,0,
-29701,Tananarive (Paris) / Laborde Grid,Laborde Madagascar,metre,4810,Tananarive 1925 (Paris),International 1924,400000,0,800000,0,0,21,-21,0,0,0.9995,0,49
-29702,Tananarive (Paris) / Laborde Grid approximation,Oblique Mercator,metre,4810,Tananarive 1925 (Paris),International 1924,0,0,0,0,0,21,-21,800000,21,0.9995,400000,49
-29738,Tananarive / UTM zone 38S,Transverse Mercator,metre,4297,Tananarive 1925,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,
-29739,Tananarive / UTM zone 39S,Transverse Mercator,metre,4297,Tananarive 1925,International 1924,500000,0,10000000,51,0.9996,0,0,0,0,0,0,
-29849,Timbalai 1948 / UTM zone 49N,Transverse Mercator,metre,4298,Timbalai 1948,Everest 1830 (1967 Definition),500000,0,0,111,0.9996,0,0,0,0,0,0,
-29850,Timbalai 1948 / UTM zone 50N,Transverse Mercator,metre,4298,Timbalai 1948,Everest 1830 (1967 Definition),500000,0,0,117,0.9996,0,0,0,0,0,0,
-29871,Timbalai 1948 / RSO Borneo (ch),Oblique Mercator,British chain (Sears 1922),4298,Timbalai 1948,Everest 1830 (1967 Definition),0,0,0,0,0,53.18569537,4,22014.3572,53.07483685,0.99984,29352.4763,115
-29872,Timbalai 1948 / RSO Borneo (ft),Oblique Mercator,British foot (Sears 1922),4298,Timbalai 1948,Everest 1830 (1967 Definition),0,0,0,0,0,53.18569537,4,1452947.58,53.07483685,0.99984,1937263.44,115
-29873,Timbalai 1948 / RSO Borneo (m),Oblique Mercator,metre,4298,Timbalai 1948,Everest 1830 (1967 Definition),0,0,0,0,0,53.18569537,4,442857.65,53.07483685,0.99984,590476.87,115
-29901,OSNI 1952 / Irish National Grid,Transverse Mercator,metre,4188,OSNI 1952,Airy 1830,200000,53.3,250000,-8,1,0,0,0,0,0,0,
-29902,TM65 / Irish Grid,Transverse Mercator,metre,4299,TM65,Airy Modified 1849,200000,53.3,250000,-8,1.000035,0,0,0,0,0,0,
-29903,TM75 / Irish Grid,Transverse Mercator,metre,4300,Geodetic Datum of 1965,Airy Modified 1849,200000,53.3,250000,-8,1.000035,0,0,0,0,0,0,
-30161,Tokyo / Japan Plane Rectangular CS I,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,33,0,129.3,0.9999,0,0,0,0,0,0,
-30162,Tokyo / Japan Plane Rectangular CS II,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,33,0,131,0.9999,0,0,0,0,0,0,
-30163,Tokyo / Japan Plane Rectangular CS III,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,132.1,0.9999,0,0,0,0,0,0,
-30164,Tokyo / Japan Plane Rectangular CS IV,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,33,0,133.3,0.9999,0,0,0,0,0,0,
-30165,Tokyo / Japan Plane Rectangular CS V,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,134.2,0.9999,0,0,0,0,0,0,
-30166,Tokyo / Japan Plane Rectangular CS VI,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,136,0.9999,0,0,0,0,0,0
-30167,Tokyo / Japan Plane Rectangular CS VII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,137.1,0.9999,0,0,0,0,0,0
-30168,Tokyo / Japan Plane Rectangular CS VIII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,138.3,0.9999,0,0,0,0,0,0
-30169,Tokyo / Japan Plane Rectangular CS IX,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,139.5,0.9999,,,,,,
-30170,Tokyo / Japan Plane Rectangular CS X,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,40,0,140.5,0.9999,,,,,,
-30171,Tokyo / Japan Plane Rectangular CS XI,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,44,0,140.15,0.9999,,,,,,
-30172,Tokyo / Japan Plane Rectangular CS XII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,44,0,142.15,0.9999,,,,,,
-30173,Tokyo / Japan Plane Rectangular CS XIII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,44,0,144.15,0.9999,,,,,,
-30174,Tokyo / Japan Plane Rectangular CS XIV,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,142,0.9999,,,,,,
-30175,Tokyo / Japan Plane Rectangular CS XV,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,127.3,0.9999,,,,,,
-30176,Tokyo / Japan Plane Rectangular CS XVI,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,124,0.9999,,,,,,
-30177,Tokyo / Japan Plane Rectangular CS XVII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,131,0.9999,,,,,,
-30178,Tokyo / Japan Plane Rectangular CS XVIII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,20,0,136,0.9999,,,,,,
-30179,Tokyo / Japan Plane Rectangular CS XIX,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,154,0.9999,,,,,,
-30200,Trinidad 1903 / Trinidad Grid,Cassini-Soldner,Clarke's link,4302,Trinidad 1903,Clarke 1858,430000,10.263,325000,-61.2,,,,,,,
-30339,TC(1948) / UTM zone 39N,Transverse Mercator,metre,4303,Trucial Coast 1948,Helmert 1906,500000,0,0,51,0.9996,,,,,,
-30340,TC(1948) / UTM zone 40N,Transverse Mercator,metre,4303,Trucial Coast 1948,Helmert 1906,500000,0,0,57,0.9996
-30491,Voirol 1875 / Nord Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4304,Voirol 1875,Clarke 1880 (IGN),500000,40,300000,3,0.999625544
-30492,Voirol 1875 / Sud Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4304,Voirol 1875,Clarke 1880 (IGN),500000,37,300000,3,0.999625769
-30493,Voirol 1879 / Nord Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4671,Voirol 1879,Clarke 1880 (IGN),500000,40,300000,3,0.999625544
-30494,Voirol 1879 / Sud Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4671,Voirol 1879,Clarke 1880 (IGN),500000,37,300000,3,0.999625769
-30729,Nord Sahara 1959 / UTM zone 29N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,-9,0.9996
-30730,Nord Sahara 1959 / UTM zone 30N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,-3,0.9996
-30731,Nord Sahara 1959 / UTM zone 31N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,3,0.9996
-30732,Nord Sahara 1959 / UTM zone 32N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,9,0.9996
-30791,Nord Sahara 1959 / Voirol Unifie Nord,Lambert Conic Conformal (1SP),metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500135,40,300090,3,0.999625544
-30792,Nord Sahara 1959 / Voirol Unifie Sud,Lambert Conic Conformal (1SP),metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500135,37,300090,3,0.999625769
-31028,Yoff / UTM zone 28N,Transverse Mercator,metre,4310,Yoff,Clarke 1880 (IGN),500000,0,0,-15,0.9996
-31121,Zanderij / UTM zone 21N,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-57,0.9996
-31154,Zanderij / TM 54 NW,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-54,0.9996
-31170,Zanderij / Suriname Old TM,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-55.41,0.9996
-31171,Zanderij / Suriname TM,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-55.41,0.9999
-31251,MGI (Ferro) / Austria GK West Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,-5000000,28,1,,,,,,,,,,,,,,,,
-31252,MGI (Ferro) / Austria GK Central Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,-5000000,31,1,,,,,,,,,,,,,,,,
-31253,MGI (Ferro) / Austria GK East Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,-5000000,34,1,,,,,,,,,,,,,,,,
-31254,MGI / Austria GK West,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,-5000000,10.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31255,MGI / Austria GK Central,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,-5000000,13.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31256,MGI / Austria GK East,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,-5000000,16.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31257,MGI / Austria GK M28,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,150000,0,-5000000,10.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31258,MGI / Austria GK M31,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,450000,0,-5000000,13.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31259,MGI / Austria GK M34,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,750000,0,-5000000,16.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31281,MGI (Ferro) / Austria West Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,0,28,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31282,MGI (Ferro) / Austria Central Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,0,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31283,MGI (Ferro) / Austria East Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,0,34,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31284,MGI / Austria M28,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,150000,0,0,10.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31285,MGI / Austria M31,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,450000,0,0,13.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31286,MGI / Austria M34,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,750000,0,0,16.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31287,MGI / Austria Lambert,Lambert Conic Conformal (2SP),metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,47.3,13.2,49,400000,400000
-31288,MGI (Ferro) / M28,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,150000,0,0,28,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31289,MGI (Ferro) / M31,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,450000,0,0,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31290,MGI (Ferro) / M34,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,750000,0,0,34,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31300,Belge 1972 / Belge Lambert 72,Lambert Conic Conformal (2SP Belgium),metre,4313,Reseau National Belge 1972,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,90,4.2124983,49.5,5400088.438,150000.0126
-31370,Belge 1972 / Belgian Lambert 72,Lambert Conic Conformal (2SP),metre,4313,Reseau National Belge 1972,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.5000002,90,4.2202952,51.1000002,5400088.438,150000.013
-31466,DHDN / 3-degree Gauss-Kruger zone 2,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,2500000,0,0,6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31467,DHDN / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,3500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31468,DHDN / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31469,DHDN / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,5500000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31528,Conakry 1905 / UTM zone 28N,Transverse Mercator,metre,4315,Conakry 1905,Clarke 1880 (IGN),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31529,Conakry 1905 / UTM zone 29N,Transverse Mercator,metre,4315,Conakry 1905,Clarke 1880 (IGN),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31600,Dealul Piscului 1930 / Stereo 33,Oblique Stereographic,metre,4316,Dealul Piscului 1930,International 1924,500000,45.54,500000,25.23328772,0.9996667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31838,NGN / UTM zone 38N,Transverse Mercator,metre,4318,National Geodetic Network,WGS 84,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31839,NGN / UTM zone 39N,Transverse Mercator,metre,4318,National Geodetic Network,WGS 84,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31901,KUDAMS / KTM,Transverse Mercator,metre,4319,Kuwait Utility,GRS 1980,500000,0,0,48,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31965,SIRGAS 2000 / UTM zone 11N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-31966,SIRGAS 2000 / UTM zone 12N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-31967,SIRGAS 2000 / UTM zone 13N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-31968,SIRGAS 2000 / UTM zone 14N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-31969,SIRGAS 2000 / UTM zone 15N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-93,0.9996,,,,,,,,,,,,,,,
-31970,SIRGAS 2000 / UTM zone 16N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,
-31971,SIRGAS 2000 / UTM zone 17N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-81,0.9996,,,,,,,,,,,,,,,
-31972,SIRGAS 2000 / UTM zone 18N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-75,0.9996,,,,,,,,,,,,,,,
-31973,SIRGAS 2000 / UTM zone 19N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-69,0.9996,,,,,,,,,,,,,,,
-31974,SIRGAS 2000 / UTM zone 20N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-63,0.9996,,,,,,,,,,,,,,,
-31975,SIRGAS 2000 / UTM zone 21N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-57,0.9996,,,,,,,,,,,,,,,
-31976,SIRGAS 2000 / UTM zone 22N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-51,0.9996,,,,,,,,,,,,,,,
-31977,SIRGAS 2000 / UTM zone 17S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-81,0.9996,,,,,,,,,,,,,,,
-31978,SIRGAS 2000 / UTM zone 18S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-75,0.9996,,,,,,,,,,,,,,,
-31979,SIRGAS 2000 / UTM zone 19S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-69,0.9996,,,,,,,,,,,,,,,
-31980,SIRGAS 2000 / UTM zone 20S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-63,0.9996,,,,,,,,,,,,,,,
-31981,SIRGAS 2000 / UTM zone 21S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-57,0.9996,,,,,,,,,,,,,,,
-31982,SIRGAS 2000 / UTM zone 22S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-51,0.9996
-31983,SIRGAS 2000 / UTM zone 23S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-45,0.9996
-31984,SIRGAS 2000 / UTM zone 24S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-39,0.9996
-31985,SIRGAS 2000 / UTM zone 25S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-33,0.9996
-31986,SIRGAS 1995 / UTM zone 17N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-81,0.9996
-31987,SIRGAS 1995 / UTM zone 18N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-75,0.9996
-31988,SIRGAS 1995 / UTM zone 19N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-69,0.9996
-31989,SIRGAS 1995 / UTM zone 20N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-63,0.9996
-31990,SIRGAS 1995 / UTM zone 21N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-57,0.9996
-31991,SIRGAS 1995 / UTM zone 22N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-51,0.9996
-31992,SIRGAS 1995 / UTM zone 17S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-81,0.9996
-31993,SIRGAS 1995 / UTM zone 18S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-75,0.9996
-31994,SIRGAS 1995 / UTM zone 19S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-69,0.9996
-31995,SIRGAS 1995 / UTM zone 20S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-63,0.9996
-31996,SIRGAS 1995 / UTM zone 21S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-57,0.9996
-31997,SIRGAS 1995 / UTM zone 22S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-51,0.9996
-31998,SIRGAS 1995 / UTM zone 23S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-45,0.9996,,,,,,,,,,,,,,,,
-31999,SIRGAS 1995 / UTM zone 24S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-39,0.9996,,,,,,,,,,,,,,,,
-32000,SIRGAS 1995 / UTM zone 25S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-33,0.9996,,,,,,,,,,,,,,,,
-32001,NAD27 / Montana North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.51,47,-109.3,48.43,0,2000000
-32002,NAD27 / Montana Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.27,45.5,-109.3,47.53,0,2000000
-32003,NAD27 / Montana South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.52,44,-109.3,46.24,0,2000000
-32005,NAD27 / Nebraska North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.49,41.2,-100,41.51,0,2000000
-32006,NAD27 / Nebraska South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,39.4,-99.3,40.17,0,2000000
-32007,NAD27 / Nevada East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,34.45,0,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32008,NAD27 / Nevada Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,34.45,0,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32009,NAD27 / Nevada West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,34.45,0,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32010,NAD27 / New Hampshire,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32011,NAD27 / New Jersey,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,2000000,38.5,0,-74.4,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32012,NAD27 / New Mexico East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32013,NAD27 / New Mexico Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32014,NAD27 / New Mexico West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32015,NAD27 / New York East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40,0,-74.2,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32016,NAD27 / New York Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32017,NAD27 / New York West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32019,NAD27 / North Carolina,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.1,33.45,-79,34.2,0,2000000
-32020,NAD27 / North Dakota North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.44,47,-100.3,47.26,0,2000000
-32021,NAD27 / North Dakota South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.29,45.4,-100.3,46.11,0,2000000
-32022,NAD27 / Ohio North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.42,39.4,-82.3,40.26,0,2000000
-32023,NAD27 / Ohio South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.02,38,-82.3,38.44,0,2000000
-32024,NAD27 / Oklahoma North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,35,-98,35.34,0,2000000
-32025,NAD27 / Oklahoma South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.14,33.2,-98,33.56,0,2000000
-32026,NAD27 / Oregon North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,43.4,-120.3,44.2,0,2000000
-32027,NAD27 / Oregon South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,41.4,-120.3,42.2,0,2000000
-32028,NAD27 / Pennsylvania North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.57,40.1,-77.45,40.53,0,2000000
-32030,NAD27 / Rhode Island,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.05,0,-71.3,0.9999938,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32031,NAD27 / South Carolina North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.58,33,-81,33.46,0,2000000
-32033,NAD27 / South Carolina South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.4,31.5,-81,32.2,0,2000000
-32034,NAD27 / South Dakota North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.41,43.5,-100,44.25,0,2000000
-32035,NAD27 / South Dakota South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.24,42.2,-100.2,42.5,0,2000000
-32037,NAD27 / Texas North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.11,34,-101.3,34.39,0,2000000
-32038,NAD27 / Texas North Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.58,31.4,-97.3,32.08,0,2000000
-32039,NAD27 / Texas Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.53,29.4,-100.2,30.07,0,2000000
-32040,NAD27 / Texas South Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.17,27.5,-99,28.23,0,2000000
-32041,NAD27 / Texas South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27.5,25.4,-98.3,26.1,0,2000000
-32042,NAD27 / Utah North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.47,40.2,-111.3,40.43,0,2000000
-32043,NAD27 / Utah Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.39,38.2,-111.3,39.01,0,2000000
-32044,NAD27 / Utah South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.21,36.4,-111.3,37.13,0,2000000
-32045,NAD27 / Vermont,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32046,NAD27 / Virginia North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.12,37.4,-78.3,38.02,0,2000000
-32047,NAD27 / Virginia South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.58,36.2,-78.3,36.46,0,2000000
-32048,NAD27 / Washington North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.44,47,-120.5,47.3,0,2000000
-32049,NAD27 / Washington South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.2,45.2,-120.3,45.5,0,2000000
-32050,NAD27 / West Virginia North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.15,38.3,-79.3,39,0,2000000
-32051,NAD27 / West Virginia South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.53,37,-81,37.29,0,2000000
-32052,NAD27 / Wisconsin North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.46,45.1,-90,45.34,0,2000000
-32053,NAD27 / Wisconsin Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,43.5,-90,44.15,0,2000000
-32054,NAD27 / Wisconsin South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.04,42,-90,42.44,0,2000000
-32055,NAD27 / Wyoming East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-105.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32056,NAD27 / Wyoming East Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-107.2,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32057,NAD27 / Wyoming West Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-108.45,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32058,NAD27 / Wyoming West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-110.05,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32061,NAD27 / Guatemala Norte,Lambert Conic Conformal (1SP),metre,4267,North American Datum 1927,Clarke 1866,500000,16.49,292209.579,-90.2,0.99992226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32062,NAD27 / Guatemala Sur,Lambert Conic Conformal (1SP),metre,4267,North American Datum 1927,Clarke 1866,500000,14.54,325992.681,-90.2,0.99989906,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32064,NAD27 / BLM 14N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32065,NAD27 / BLM 15N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32066,NAD27 / BLM 16N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32067,NAD27 / BLM 17N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32081,NAD27 / MTM zone 1,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-53,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32082,NAD27 / MTM zone 2,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-56,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32083,NAD27 / MTM zone 3,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-58.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32084,NAD27 / MTM zone 4,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32085,NAD27 / MTM zone 5,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32086,NAD27 / MTM zone 6,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-67.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32098,NAD27 / Quebec Lambert,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-68.3,60,0,0
-32099,NAD27 / Louisiana Offshore,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-91.2,27.5,0,2000000
-32100,NAD83 / Montana,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,600000
-32104,NAD83 / Nebraska,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,500000
-32107,NAD83 / Nevada East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,34.45,8000000,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32108,NAD83 / Nevada Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,34.45,6000000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32109,NAD83 / Nevada West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,800000,34.45,4000000,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32110,NAD83 / New Hampshire,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32111,NAD83 / New Jersey,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32112,NAD83 / New Mexico East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,165000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32113,NAD83 / New Mexico Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32114,NAD83 / New Mexico West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,830000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32115,NAD83 / New York East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32116,NAD83 / New York Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,250000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32117,NAD83 / New York West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,350000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32118,NAD83 / New York Long Island,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,300000
-32119,NAD83 / North Carolina,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,609601.22
-32120,NAD83 / North Dakota North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,600000
-32121,NAD83 / North Dakota South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,600000
-32122,NAD83 / Ohio North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,600000
-32123,NAD83 / Ohio South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,600000
-32124,NAD83 / Oklahoma North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,600000
-32125,NAD83 / Oklahoma South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,600000
-32126,NAD83 / Oregon North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,2500000
-32127,NAD83 / Oregon South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,1500000
-32128,NAD83 / Pennsylvania North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,600000
-32129,NAD83 / Pennsylvania South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,600000
-32130,NAD83 / Rhode Island,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,100000,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32133,NAD83 / South Carolina,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,609600
-32134,NAD83 / South Dakota North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,600000
-32135,NAD83 / South Dakota South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,600000
-32136,NAD83 / Tennessee,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,600000
-32137,NAD83 / Texas North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,1000000,200000
-32138,NAD83 / Texas North Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,2000000,600000
-32139,NAD83 / Texas Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,3000000,700000
-32140,NAD83 / Texas South Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,4000000,600000
-32141,NAD83 / Texas South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,5000000,300000
-32142,NAD83 / Utah North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,1000000,500000
-32143,NAD83 / Utah Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,2000000,500000
-32144,NAD83 / Utah South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,3000000,500000
-32145,NAD83 / Vermont,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32146,NAD83 / Virginia North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,2000000,3500000
-32147,NAD83 / Virginia South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,1000000,3500000
-32148,NAD83 / Washington North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,500000
-32149,NAD83 / Washington South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,500000
-32150,NAD83 / West Virginia North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,600000
-32151,NAD83 / West Virginia South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,600000
-32152,NAD83 / Wisconsin North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,600000
-32153,NAD83 / Wisconsin Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,600000
-32154,NAD83 / Wisconsin South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,600000
-32155,NAD83 / Wyoming East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32156,NAD83 / Wyoming East Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,400000,40.3,100000,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32157,NAD83 / Wyoming West Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,600000,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32158,NAD83 / Wyoming West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,800000,40.3,100000,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32161,NAD83 / Puerto Rico & Virgin Is.,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,200000,200000
-32164,NAD83 / BLM 14N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32165,NAD83 / BLM 15N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32166,NAD83 / BLM 16N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32167,NAD83 / BLM 17N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32180,NAD83 / SCoPQ zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-55.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32181,NAD83 / MTM zone 1,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-53,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32182,NAD83 / MTM zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-56,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32183,NAD83 / MTM zone 3,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-58.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32184,NAD83 / MTM zone 4,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32185,NAD83 / MTM zone 5,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32186,NAD83 / MTM zone 6,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-67.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32187,NAD83 / MTM zone 7,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-70.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32188,NAD83 / MTM zone 8,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-73.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32189,NAD83 / MTM zone 9,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-76.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32190,NAD83 / MTM zone 10,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-79.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32191,NAD83 / MTM zone 11,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-82.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32192,NAD83 / MTM zone 12,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-81,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32193,NAD83 / MTM zone 13,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-84,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32194,NAD83 / MTM zone 14,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-87,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32195,NAD83 / MTM zone 15,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-90,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32196,NAD83 / MTM zone 16,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-93,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32197,NAD83 / MTM zone 17,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-96,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32198,NAD83 / Quebec Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-68.3,60,0,0
-32199,NAD83 / Louisiana Offshore,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.3,-91.2,27.5,0,1000000
-32201,WGS 72 / UTM zone 1N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-177,0.9996,,,,,,,,,,,,,,,,
-32202,WGS 72 / UTM zone 2N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-171,0.9996,,,,,,,,,,,,,,,,
-32203,WGS 72 / UTM zone 3N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-165,0.9996,,,,,,,,,,,,,,,,
-32204,WGS 72 / UTM zone 4N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-159,0.9996,,,,,,,,,,,,,,,,
-32205,WGS 72 / UTM zone 5N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-153,0.9996,,,,,,,,,,,,,,,,
-32206,WGS 72 / UTM zone 6N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-147,0.9996,,,,,,,,,,,,,,,,
-32207,WGS 72 / UTM zone 7N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-141,0.9996,,,,,,,,,,,,,,,,
-32208,WGS 72 / UTM zone 8N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-135,0.9996,,,,,,,,,,,,,,,,
-32209,WGS 72 / UTM zone 9N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-129,0.9996,,,,,,,,,,,,,,,,
-32210,WGS 72 / UTM zone 10N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-123,0.9996,,,,,,,,,,,,,,,,
-32211,WGS 72 / UTM zone 11N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-117,0.9996,,,,,,,,,,,,,,,,
-32212,WGS 72 / UTM zone 12N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-111,0.9996,,,,,,,,,,,,,,,,
-32213,WGS 72 / UTM zone 13N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-105,0.9996,,,,,,,,,,,,,,,,
-32214,WGS 72 / UTM zone 14N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-99,0.9996
-32215,WGS 72 / UTM zone 15N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-93,0.9996
-32216,WGS 72 / UTM zone 16N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-87,0.9996
-32217,WGS 72 / UTM zone 17N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-81,0.9996
-32218,WGS 72 / UTM zone 18N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-75,0.9996
-32219,WGS 72 / UTM zone 19N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-69,0.9996
-32220,WGS 72 / UTM zone 20N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-63,0.9996
-32221,WGS 72 / UTM zone 21N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-57,0.9996
-32222,WGS 72 / UTM zone 22N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-51,0.9996
-32223,WGS 72 / UTM zone 23N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-45,0.9996
-32224,WGS 72 / UTM zone 24N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-39,0.9996
-32225,WGS 72 / UTM zone 25N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-33,0.9996
-32226,WGS 72 / UTM zone 26N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-27,0.9996
-32227,WGS 72 / UTM zone 27N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-21,0.9996
-32228,WGS 72 / UTM zone 28N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-15,0.9996
-32229,WGS 72 / UTM zone 29N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-9,0.9996
-32230,WGS 72 / UTM zone 30N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-3,0.9996
-32231,WGS 72 / UTM zone 31N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,3,0.9996
-32232,WGS 72 / UTM zone 32N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,9,0.9996
-32233,WGS 72 / UTM zone 33N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,15,0.9996
-32234,WGS 72 / UTM zone 34N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,21,0.9996
-32235,WGS 72 / UTM zone 35N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,27,0.9996
-32236,WGS 72 / UTM zone 36N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,33,0.9996
-32237,WGS 72 / UTM zone 37N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,39,0.9996
-32238,WGS 72 / UTM zone 38N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,45,0.9996
-32239,WGS 72 / UTM zone 39N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,51,0.9996
-32240,WGS 72 / UTM zone 40N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,57,0.9996
-32241,WGS 72 / UTM zone 41N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,63,0.9996
-32242,WGS 72 / UTM zone 42N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,69,0.9996
-32243,WGS 72 / UTM zone 43N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,75,0.9996
-32244,WGS 72 / UTM zone 44N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,81,0.9996
-32245,WGS 72 / UTM zone 45N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,87,0.9996
-32246,WGS 72 / UTM zone 46N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,93,0.9996
-32247,WGS 72 / UTM zone 47N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,99,0.9996
-32248,WGS 72 / UTM zone 48N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,105,0.9996
-32249,WGS 72 / UTM zone 49N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,111,0.9996
-32250,WGS 72 / UTM zone 50N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,117,0.9996
-32251,WGS 72 / UTM zone 51N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,123,0.9996
-32252,WGS 72 / UTM zone 52N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,129,0.9996
-32253,WGS 72 / UTM zone 53N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,135,0.9996
-32254,WGS 72 / UTM zone 54N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,141,0.9996
-32255,WGS 72 / UTM zone 55N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,147,0.9996
-32256,WGS 72 / UTM zone 56N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,153,0.9996
-32257,WGS 72 / UTM zone 57N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,159,0.9996
-32258,WGS 72 / UTM zone 58N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,165,0.9996
-32259,WGS 72 / UTM zone 59N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,171,0.9996
-32260,WGS 72 / UTM zone 60N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,177,0.9996
-32301,WGS 72 / UTM zone 1S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-177,0.9996
-32302,WGS 72 / UTM zone 2S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-171,0.9996
-32303,WGS 72 / UTM zone 3S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-165,0.9996
-32304,WGS 72 / UTM zone 4S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-159,0.9996
-32305,WGS 72 / UTM zone 5S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-153,0.9996
-32306,WGS 72 / UTM zone 6S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-147,0.9996
-32307,WGS 72 / UTM zone 7S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-141,0.9996
-32308,WGS 72 / UTM zone 8S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-135,0.9996
-32309,WGS 72 / UTM zone 9S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-129,0.9996
-32310,WGS 72 / UTM zone 10S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-123,0.9996
-32311,WGS 72 / UTM zone 11S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-117,0.9996
-32312,WGS 72 / UTM zone 12S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-111,0.9996
-32313,WGS 72 / UTM zone 13S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-105,0.9996
-32314,WGS 72 / UTM zone 14S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-99,0.9996
-32315,WGS 72 / UTM zone 15S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-93,0.9996
-32316,WGS 72 / UTM zone 16S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-87,0.9996
-32317,WGS 72 / UTM zone 17S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-81,0.9996
-32318,WGS 72 / UTM zone 18S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-75,0.9996
-32319,WGS 72 / UTM zone 19S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-69,0.9996
-32320,WGS 72 / UTM zone 20S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-63,0.9996
-32321,WGS 72 / UTM zone 21S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-57,0.9996
-32322,WGS 72 / UTM zone 22S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-51,0.9996
-32323,WGS 72 / UTM zone 23S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-45,0.9996
-32324,WGS 72 / UTM zone 24S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-39,0.9996
-32325,WGS 72 / UTM zone 25S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-33,0.9996
-32326,WGS 72 / UTM zone 26S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-27,0.9996
-32327,WGS 72 / UTM zone 27S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-21,0.9996
-32328,WGS 72 / UTM zone 28S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-15,0.9996
-32329,WGS 72 / UTM zone 29S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-9,0.9996
-32330,WGS 72 / UTM zone 30S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-3,0.9996
-32331,WGS 72 / UTM zone 31S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,3,0.9996
-32332,WGS 72 / UTM zone 32S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,9,0.9996
-32333,WGS 72 / UTM zone 33S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,15,0.9996
-32334,WGS 72 / UTM zone 34S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,21,0.9996
-32335,WGS 72 / UTM zone 35S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,27,0.9996
-32336,WGS 72 / UTM zone 36S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,33,0.9996
-32337,WGS 72 / UTM zone 37S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,39,0.9996
-32338,WGS 72 / UTM zone 38S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,45,0.9996
-32339,WGS 72 / UTM zone 39S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,51,0.9996
-32340,WGS 72 / UTM zone 40S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,57,0.9996
-32341,WGS 72 / UTM zone 41S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,63,0.9996
-32342,WGS 72 / UTM zone 42S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,69,0.9996
-32343,WGS 72 / UTM zone 43S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,75,0.9996
-32344,WGS 72 / UTM zone 44S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,81,0.9996
-32345,WGS 72 / UTM zone 45S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,87,0.9996
-32346,WGS 72 / UTM zone 46S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,93,0.9996
-32347,WGS 72 / UTM zone 47S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,99,0.9996
-32348,WGS 72 / UTM zone 48S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,105,0.9996
-32349,WGS 72 / UTM zone 49S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,111,0.9996
-32350,WGS 72 / UTM zone 50S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,117,0.9996
-32351,WGS 72 / UTM zone 51S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,123,0.9996
-32352,WGS 72 / UTM zone 52S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,129,0.9996
-32353,WGS 72 / UTM zone 53S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,135,0.9996
-32354,WGS 72 / UTM zone 54S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,141,0.9996
-32355,WGS 72 / UTM zone 55S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,147,0.9996
-32356,WGS 72 / UTM zone 56S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,153,0.9996
-32357,WGS 72 / UTM zone 57S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,159,0.9996
-32358,WGS 72 / UTM zone 58S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,165,0.9996
-32359,WGS 72 / UTM zone 59S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,171,0.9996
-32360,WGS 72 / UTM zone 60S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,177,0.9996
-32401,WGS 72BE / UTM zone 1N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-177,0.9996
-32402,WGS 72BE / UTM zone 2N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-171,0.9996
-32403,WGS 72BE / UTM zone 3N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-165,0.9996
-32404,WGS 72BE / UTM zone 4N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-159,0.9996
-32405,WGS 72BE / UTM zone 5N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-153,0.9996
-32406,WGS 72BE / UTM zone 6N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-147,0.9996
-32407,WGS 72BE / UTM zone 7N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-141,0.9996
-32408,WGS 72BE / UTM zone 8N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-135,0.9996
-32409,WGS 72BE / UTM zone 9N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-129,0.9996
-32410,WGS 72BE / UTM zone 10N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-123,0.9996
-32411,WGS 72BE / UTM zone 11N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-117,0.9996
-32412,WGS 72BE / UTM zone 12N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-111,0.9996
-32413,WGS 72BE / UTM zone 13N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-105,0.9996
-32414,WGS 72BE / UTM zone 14N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-99,0.9996
-32415,WGS 72BE / UTM zone 15N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-93,0.9996
-32416,WGS 72BE / UTM zone 16N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-87,0.9996
-32417,WGS 72BE / UTM zone 17N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-81,0.9996
-32418,WGS 72BE / UTM zone 18N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-75,0.9996
-32419,WGS 72BE / UTM zone 19N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-69,0.9996
-32420,WGS 72BE / UTM zone 20N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-63,0.9996
-32421,WGS 72BE / UTM zone 21N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-57,0.9996
-32422,WGS 72BE / UTM zone 22N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-51,0.9996
-32423,WGS 72BE / UTM zone 23N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-45,0.9996
-32424,WGS 72BE / UTM zone 24N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-39,0.9996
-32425,WGS 72BE / UTM zone 25N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-33,0.9996
-32426,WGS 72BE / UTM zone 26N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-27,0.9996
-32427,WGS 72BE / UTM zone 27N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-21,0.9996
-32428,WGS 72BE / UTM zone 28N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-15,0.9996
-32429,WGS 72BE / UTM zone 29N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-9,0.9996
-32430,WGS 72BE / UTM zone 30N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-3,0.9996
-32431,WGS 72BE / UTM zone 31N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,3,0.9996
-32432,WGS 72BE / UTM zone 32N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,9,0.9996
-32433,WGS 72BE / UTM zone 33N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,15,0.9996
-32434,WGS 72BE / UTM zone 34N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,21,0.9996
-32435,WGS 72BE / UTM zone 35N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,27,0.9996
-32436,WGS 72BE / UTM zone 36N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,33,0.9996
-32437,WGS 72BE / UTM zone 37N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,39,0.9996
-32438,WGS 72BE / UTM zone 38N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,45,0.9996
-32439,WGS 72BE / UTM zone 39N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,51,0.9996
-32440,WGS 72BE / UTM zone 40N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,57,0.9996
-32441,WGS 72BE / UTM zone 41N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,63,0.9996
-32442,WGS 72BE / UTM zone 42N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,69,0.9996
-32443,WGS 72BE / UTM zone 43N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,75,0.9996
-32444,WGS 72BE / UTM zone 44N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,81,0.9996
-32445,WGS 72BE / UTM zone 45N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,87,0.9996
-32446,WGS 72BE / UTM zone 46N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,93,0.9996
-32447,WGS 72BE / UTM zone 47N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,99,0.9996
-32448,WGS 72BE / UTM zone 48N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,105,0.9996
-32449,WGS 72BE / UTM zone 49N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,111,0.9996
-32450,WGS 72BE / UTM zone 50N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,117,0.9996
-32451,WGS 72BE / UTM zone 51N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,123,0.9996
-32452,WGS 72BE / UTM zone 52N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,129,0.9996
-32453,WGS 72BE / UTM zone 53N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,135,0.9996
-32454,WGS 72BE / UTM zone 54N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,141,0.9996
-32455,WGS 72BE / UTM zone 55N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,147,0.9996
-32456,WGS 72BE / UTM zone 56N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,153,0.9996
-32457,WGS 72BE / UTM zone 57N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,159,0.9996
-32458,WGS 72BE / UTM zone 58N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,165,0.9996
-32459,WGS 72BE / UTM zone 59N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,171,0.9996
-32460,WGS 72BE / UTM zone 60N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,177,0.9996
-32501,WGS 72BE / UTM zone 1S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-177,0.9996
-32502,WGS 72BE / UTM zone 2S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-171,0.9996
-32503,WGS 72BE / UTM zone 3S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-165,0.9996
-32504,WGS 72BE / UTM zone 4S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-159,0.9996
-32505,WGS 72BE / UTM zone 5S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-153,0.9996
-32506,WGS 72BE / UTM zone 6S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-147,0.9996
-32507,WGS 72BE / UTM zone 7S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-141,0.9996
-32508,WGS 72BE / UTM zone 8S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-135,0.9996
-32509,WGS 72BE / UTM zone 9S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-129,0.9996
-32510,WGS 72BE / UTM zone 10S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-123,0.9996
-32511,WGS 72BE / UTM zone 11S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-117,0.9996
-32512,WGS 72BE / UTM zone 12S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-111,0.9996
-32513,WGS 72BE / UTM zone 13S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-105,0.9996
-32514,WGS 72BE / UTM zone 14S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-99,0.9996
-32515,WGS 72BE / UTM zone 15S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-93,0.9996
-32516,WGS 72BE / UTM zone 16S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-87,0.9996
-32517,WGS 72BE / UTM zone 17S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-81,0.9996
-32518,WGS 72BE / UTM zone 18S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-75,0.9996
-32519,WGS 72BE / UTM zone 19S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-69,0.9996
-32520,WGS 72BE / UTM zone 20S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-63,0.9996
-32521,WGS 72BE / UTM zone 21S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-57,0.9996
-32522,WGS 72BE / UTM zone 22S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-51,0.9996
-32523,WGS 72BE / UTM zone 23S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-45,0.9996
-32524,WGS 72BE / UTM zone 24S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-39,0.9996
-32525,WGS 72BE / UTM zone 25S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-33,0.9996
-32526,WGS 72BE / UTM zone 26S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-27,0.9996
-32527,WGS 72BE / UTM zone 27S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-21,0.9996
-32528,WGS 72BE / UTM zone 28S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-15,0.9996
-32529,WGS 72BE / UTM zone 29S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-9,0.9996
-32530,WGS 72BE / UTM zone 30S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-3,0.9996
-32531,WGS 72BE / UTM zone 31S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,3,0.9996
-32532,WGS 72BE / UTM zone 32S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,9,0.9996
-32533,WGS 72BE / UTM zone 33S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,15,0.9996
-32534,WGS 72BE / UTM zone 34S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,21,0.9996
-32535,WGS 72BE / UTM zone 35S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,27,0.9996
-32536,WGS 72BE / UTM zone 36S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,33,0.9996
-32537,WGS 72BE / UTM zone 37S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,39,0.9996
-32538,WGS 72BE / UTM zone 38S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,45,0.9996
-32539,WGS 72BE / UTM zone 39S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,51,0.9996
-32540,WGS 72BE / UTM zone 40S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,57,0.9996
-32541,WGS 72BE / UTM zone 41S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,63,0.9996
-32542,WGS 72BE / UTM zone 42S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,69,0.9996
-32543,WGS 72BE / UTM zone 43S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,75,0.9996
-32544,WGS 72BE / UTM zone 44S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,81,0.9996
-32545,WGS 72BE / UTM zone 45S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,87,0.9996
-32546,WGS 72BE / UTM zone 46S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,93,0.9996
-32547,WGS 72BE / UTM zone 47S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,99,0.9996
-32548,WGS 72BE / UTM zone 48S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,105,0.9996
-32549,WGS 72BE / UTM zone 49S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,111,0.9996
-32550,WGS 72BE / UTM zone 50S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,117,0.9996
-32551,WGS 72BE / UTM zone 51S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,123,0.9996
-32552,WGS 72BE / UTM zone 52S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,129,0.9996
-32553,WGS 72BE / UTM zone 53S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,135,0.9996
-32554,WGS 72BE / UTM zone 54S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,141,0.9996
-32555,WGS 72BE / UTM zone 55S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,147,0.9996
-32556,WGS 72BE / UTM zone 56S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,153,0.9996
-32557,WGS 72BE / UTM zone 57S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,159,0.9996
-32558,WGS 72BE / UTM zone 58S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,165,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
-32559,WGS 72BE / UTM zone 59S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,171,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
-32560,WGS 72BE / UTM zone 60S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,177,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
-32600,WGS 84 / UTM grid system (northern hemisphere),Transverse Mercator Zoned Grid System,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,0,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-180,6
-32601,WGS 84 / UTM zone 1N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32602,WGS 84 / UTM zone 2N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32603,WGS 84 / UTM zone 3N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32604,WGS 84 / UTM zone 4N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32605,WGS 84 / UTM zone 5N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32606,WGS 84 / UTM zone 6N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32607,WGS 84 / UTM zone 7N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32608,WGS 84 / UTM zone 8N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32609,WGS 84 / UTM zone 9N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32610,WGS 84 / UTM zone 10N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32611,WGS 84 / UTM zone 11N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32612,WGS 84 / UTM zone 12N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32613,WGS 84 / UTM zone 13N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32614,WGS 84 / UTM zone 14N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32615,WGS 84 / UTM zone 15N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32616,WGS 84 / UTM zone 16N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32617,WGS 84 / UTM zone 17N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-81,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32618,WGS 84 / UTM zone 18N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-75,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32619,WGS 84 / UTM zone 19N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-69,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32620,WGS 84 / UTM zone 20N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-63,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32621,WGS 84 / UTM zone 21N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-57,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32622,WGS 84 / UTM zone 22N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-51,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32623,WGS 84 / UTM zone 23N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-45,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32624,WGS 84 / UTM zone 24N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-39,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32625,WGS 84 / UTM zone 25N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-33,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32626,WGS 84 / UTM zone 26N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-27,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32627,WGS 84 / UTM zone 27N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-21,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32628,WGS 84 / UTM zone 28N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-15,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32629,WGS 84 / UTM zone 29N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-9,0.9996
-32630,WGS 84 / UTM zone 30N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-3,0.9996
-32631,WGS 84 / UTM zone 31N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,3,0.9996
-32632,WGS 84 / UTM zone 32N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,9,0.9996
-32633,WGS 84 / UTM zone 33N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,15,0.9996
-32634,WGS 84 / UTM zone 34N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,21,0.9996
-32635,WGS 84 / UTM zone 35N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,27,0.9996
-32636,WGS 84 / UTM zone 36N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,33,0.9996
-32637,WGS 84 / UTM zone 37N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,39,0.9996
-32638,WGS 84 / UTM zone 38N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,45,0.9996
-32639,WGS 84 / UTM zone 39N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,51,0.9996
-32640,WGS 84 / UTM zone 40N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,57,0.9996
-32641,WGS 84 / UTM zone 41N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,63,0.9996
-32642,WGS 84 / UTM zone 42N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,69,0.9996
-32643,WGS 84 / UTM zone 43N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,75,0.9996
-32644,WGS 84 / UTM zone 44N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,81,0.9996
-32645,WGS 84 / UTM zone 45N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,87,0.9996
-32646,WGS 84 / UTM zone 46N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,93,0.9996
-32647,WGS 84 / UTM zone 47N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,99,0.9996
-32648,WGS 84 / UTM zone 48N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,105,0.9996
-32649,WGS 84 / UTM zone 49N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,111,0.9996
-32650,WGS 84 / UTM zone 50N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,117,0.9996
-32651,WGS 84 / UTM zone 51N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,123,0.9996
-32652,WGS 84 / UTM zone 52N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,129,0.9996
-32653,WGS 84 / UTM zone 53N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,135,0.9996
-32654,WGS 84 / UTM zone 54N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,141,0.9996
-32655,WGS 84 / UTM zone 55N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,147,0.9996
-32656,WGS 84 / UTM zone 56N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,153,0.9996
-32657,WGS 84 / UTM zone 57N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,159,0.9996
-32658,WGS 84 / UTM zone 58N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,165,0.9996
-32659,WGS 84 / UTM zone 59N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,171,0.9996
-32660,WGS 84 / UTM zone 60N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,177,0.9996
-32661,WGS 84 / UPS North,Polar Stereographic (variant A),metre,4326,World Geodetic System 1984,WGS 84,2000000,90,2000000,0,0.994,,,,,,,,,,,,,,,,,,,,,,,,,,
-32664,WGS 84 / BLM 14N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-99,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
-32665,WGS 84 / BLM 15N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-93,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
-32666,WGS 84 / BLM 16N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32667,WGS 84 / BLM 17N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32700,WGS 84 / UTM grid system (southern hemisphere),Transverse Mercator Zoned Grid System,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,0,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-180,6
-32701,WGS 84 / UTM zone 1S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32702,WGS 84 / UTM zone 2S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32703,WGS 84 / UTM zone 3S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32704,WGS 84 / UTM zone 4S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32705,WGS 84 / UTM zone 5S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32706,WGS 84 / UTM zone 6S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32707,WGS 84 / UTM zone 7S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32708,WGS 84 / UTM zone 8S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32709,WGS 84 / UTM zone 9S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32710,WGS 84 / UTM zone 10S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-32711,WGS 84 / UTM zone 11S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32712,WGS 84 / UTM zone 12S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32713,WGS 84 / UTM zone 13S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-32714,WGS 84 / UTM zone 14S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-99,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32715,WGS 84 / UTM zone 15S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-93,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32716,WGS 84 / UTM zone 16S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-87,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32717,WGS 84 / UTM zone 17S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-81,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32718,WGS 84 / UTM zone 18S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-75,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32719,WGS 84 / UTM zone 19S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-69,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32720,WGS 84 / UTM zone 20S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-63,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32721,WGS 84 / UTM zone 21S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-57,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32722,WGS 84 / UTM zone 22S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-51,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32723,WGS 84 / UTM zone 23S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-45,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32724,WGS 84 / UTM zone 24S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-39,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32725,WGS 84 / UTM zone 25S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-33,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32726,WGS 84 / UTM zone 26S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-27,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
-32727,WGS 84 / UTM zone 27S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-21,0.9996
-32728,WGS 84 / UTM zone 28S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-15,0.9996
-32729,WGS 84 / UTM zone 29S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-9,0.9996
-32730,WGS 84 / UTM zone 30S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-3,0.9996
-32731,WGS 84 / UTM zone 31S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,3,0.9996
-32732,WGS 84 / UTM zone 32S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,9,0.9996
-32733,WGS 84 / UTM zone 33S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,15,0.9996
-32734,WGS 84 / UTM zone 34S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,21,0.9996
-32735,WGS 84 / UTM zone 35S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,27,0.9996
-32736,WGS 84 / UTM zone 36S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,33,0.9996
-32737,WGS 84 / UTM zone 37S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,39,0.9996
-32738,WGS 84 / UTM zone 38S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,45,0.9996
-32739,WGS 84 / UTM zone 39S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,51,0.9996
-32740,WGS 84 / UTM zone 40S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,57,0.9996
-32741,WGS 84 / UTM zone 41S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,63,0.9996
-32742,WGS 84 / UTM zone 42S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,69,0.9996
-32743,WGS 84 / UTM zone 43S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,75,0.9996
-32744,WGS 84 / UTM zone 44S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,81,0.9996
-32745,WGS 84 / UTM zone 45S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,87,0.9996
-32746,WGS 84 / UTM zone 46S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,93,0.9996
-32747,WGS 84 / UTM zone 47S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,99,0.9996
-32748,WGS 84 / UTM zone 48S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,105,0.9996
-32749,WGS 84 / UTM zone 49S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,111,0.9996
-32750,WGS 84 / UTM zone 50S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,117,0.9996
-32751,WGS 84 / UTM zone 51S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,123,0.9996
-32752,WGS 84 / UTM zone 52S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,129,0.9996
-32753,WGS 84 / UTM zone 53S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,135,0.9996
-32754,WGS 84 / UTM zone 54S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,141,0.9996
-32755,WGS 84 / UTM zone 55S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,147,0.9996
-32756,WGS 84 / UTM zone 56S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,153,0.9996
-32757,WGS 84 / UTM zone 57S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,159,0.9996
-32758,WGS 84 / UTM zone 58S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,165,0.9996
-32759,WGS 84 / UTM zone 59S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,171,0.9996
-32760,WGS 84 / UTM zone 60S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,177,0.9996
-32761,WGS 84 / UPS South,Polar Stereographic (variant A),metre,4326,World Geodetic System 1984,WGS 84,2000000,-90,2000000,0,0.994
-32766,WGS 84 / TM 36 SE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,36,0.9996
diff --git a/ossim/share/ossim/templates/ossim_preferences_template b/ossim/share/ossim/templates/ossim_preferences_template
deleted file mode 100644
index e2e35c8..0000000
--- a/ossim/share/ossim/templates/ossim_preferences_template
+++ /dev/null
@@ -1,585 +0,0 @@
-// ------------------------------------------------------------------------
-// 
-// Description:  ossim_preferences_template
-// 
-// This file will be automatically loaded by ossim applications provided the
-// environment variable "OSSIM_PREFS_FILE" is set to point to some form of 
-// this file.
-//
-// Note:  c++ comments "//" can be used to comment a line.
-//
-// To set the environment variable for automatic preference file loading:
-//
-// This assumes a preference file in your home called "ossim_preferences".
-// Typically this would be put in a dot file read at startup of a shell.
-//
-// tcsh and csh users:  setenv OSSIM_PREFS_FILE ~/ossim_preferences
-//
-// bash and sh users:   export OSSIM_PREFS_FILE=~/ossim_preferences
-// 
-// windoze users:       I'll have to look this up...
-//
-// You can also use the "-P <preference_file>" option at application startup.
-// where <preference_file> is full path and filename.
-//
-// Note that system environment variables found in this ossim preferences
-// file in the format "$(env_var_name)" will be expanded in place.
-//
-// To view your preferences use below command.  This is useful when trouble
-// shooting paths and so on:
-//
-// $ ossim-info --config
-// 
-// ------------------------------------------------------------------------
-
-//---
-// Elevation setup:
-//
-// Keyword pair: 
-// elevation_source.type
-// elevation_source.filename 
-// 
-// Indicates an elevation source.  These should be listed in pairs.  Numbering
-// should start with 0 with lowest number being the highest resolution.  This
-// can be a cell(file) or a directory.
-// 
-// There are four elevation_source.type types:
-// elevation_source.type: dted_directory
-// elevation_source.type: srtm_directory
-// elevation_source.type: general_raster_directory
-// 
-// The elevation_source.connection_string is a connection for your database.
-// Typically this is a directory location.
-// 
-// NOTES:
-// 
-// 1) Order dependent, i.e. ALWAYS put your highest resolution first.
-// 
-// 2) The elevation_source keyword replaces the deprecated keywords:
-// dted_directory
-// image_directory
-// srtm_directory
-// dted_cell 
-//
-// 3) We support bringing cells into memory for dted and srtm datasets.  You can also control the
-// number of open cells by specifying a min and max open cells.  If the number of cells opened
-// exceeds the maximum then it will shrink the active opened cells to the minumum.  We currently
-// use a least recently used algorithm.
-// 
-// 4) A good elevation source is the Shuttle Radar Topographic Mission(SRTM):
-//    http://srtm.usgs.gov/index.php
-
-// 5) Examples below are defaulted to some value.  To change enabled key to
-//    true, e.g.:
-//    elevation_manager.elevation_source0.enabled: true
-//    
-//---
-
-elevation_manager.elevation_source0.connection_string: $(OSSIM_DATA)/elevation/dted/level2
-elevation_manager.elevation_source0.enabled: true
-elevation_manager.elevation_source0.type: dted_directory
-elevation_manager.elevation_source0.min_open_cells: 25
-elevation_manager.elevation_source0.max_open_cells: 50
-elevation_manager.elevation_source0.memory_map_cells: false
-elevation_manager.elevation_source0.geoid.type: geoid1996
-
-elevation_manager.elevation_source1.connection_string: $(OSSIM_DATA)/elevation/srtm/1arc
-elevation_manager.elevation_source1.enabled: true
-elevation_manager.elevation_source1.type: srtm_directory
-elevation_manager.elevation_source1.min_open_cells: 25
-elevation_manager.elevation_source1.max_open_cells: 50
-elevation_manager.elevation_source1.memory_map_cells: false
-elevation_manager.elevation_source1.geoid.type: geoid1996
-
-elevation_manager.elevation_source2.connection_string: $(OSSIM_DATA)/elevation/dted/level1
-elevation_manager.elevation_source2.enabled: true
-elevation_manager.elevation_source2.type: dted_directory
-elevation_manager.elevation_source2.min_open_cells: 25
-elevation_manager.elevation_source2.max_open_cells: 50
-elevation_manager.elevation_source2.memory_map_cells: false
-elevation_manager.elevation_source2.geoid.type: geoid1996
-
-elevation_manager.elevation_source3.connection_string: $(OSSIM_DATA)/elevation/srtm/3arc
-elevation_manager.elevation_source3.enabled: true
-elevation_manager.elevation_source3.type: srtm_directory
-elevation_manager.elevation_source3.min_open_cells: 25
-elevation_manager.elevation_source3.max_open_cells: 50
-elevation_manager.elevation_source3.memory_map_cells: false
-elevation_manager.elevation_source3.geoid.type: geoid1996
-
-elevation_manager.elevation_source4.connection_string: $(OSSIM_DATA)/elevation/dted/level0
-elevation_manager.elevation_source4.enabled: true
-elevation_manager.elevation_source4.type: dted_directory
-elevation_manager.elevation_source4.min_open_cells: 25
-elevation_manager.elevation_source4.max_open_cells: 50
-elevation_manager.elevation_source4.memory_map_cells: true
-elevation_manager.elevation_source4.geoid.type: geoid1996
-
-// "image_directory" can be any type of image, i.e. tiff, nitf and so on.
-// elevation_manager.elevation_source5.connection_string: $(OSSIM_DATA)/elevation/some_dir
-// elevation_manager.elevation_source5.enabled: false
-// elevation_manager.elevation_source5.type: image_directory
-// elevation_manager.elevation_source5.min_open_cells: 25
-// elevation_manager.elevation_source5.max_open_cells: 50
-// elevation_manager.elevation_source5.memory_map_cells: false
-// elevation_manager.elevation_source5.geoid.type: geoid1996
-
-
-//---
-// Identity geoid is 0 everywhere, so MSL = Ellipsoid. Useful when DEM
-// provides posts relative to ellipsoid instead of customary MSL. This is
-// specific to each elev database:
-//---
-// elevation_manager.elevation_source3.geoid.type: identity
-
-//---
-// Default height above ellipsoid, for use when no elev data is present, 
-// instead of returning NAN:
-//---
-// elevation_manager.default_height_above_ellipsoid: 0.0
-
-// ---
-// This is n elevation offset that is added to the height returned from the
-// elevation manager.
-// if the value is nan then nothing is added.
-// ---
-//elevation_manager.elevation_offset: nan
-
-//---
-// Allows one to specify to the elevation manager to use the ellipsoid offset
-// as defined by the geoid manager if a getHeightAboveEllipsoid fails.
-//---
-elevation_manager.use_geoid_if_null: true
-
-//---
-// Keyword:  default_elevation_path
-// Default path for the elevation manager popup "Add" to start at.
-//---
-default_elevation_path: $(OSSIM_DATA)/elevation/dted/level2 
-// ---
-
-//---
-// Keyword:  elevation.enabled
-// If disabled calls to the elevation manager getHeightAboveMSL and 
-// getHeightAboveEllipsoid will return a null height.  (default=true)
-// Use: "true", "yes", "y" or "1" to enable, 
-//      "false", "no", "n" or "0" to disable.
-//---
-elevation_manager.enabled:  true
-
-//---
-// Keyword:  elevation.threads
-// Defines the number of instances of elevation databases to maintain for multithreading.
-// Can be boolean "yes" or "true" to use all available cores or an integer value for
-// custom experimentation. Set to "no" (or "false") or 1 for no multithreading capability. 
-// Default is "true".
-//---
-elevation_manager.threads: yes                 
-
-// ---
-// Location of datum grids:
-//
-// Snip from: http://www.ngs.noaa.gov/TOOLS/Nadcon/Nadcon.html
-// 
-// Advances in the accuracies now obtainable in geodetic surveys, specifically
-// through use of differential GPS, has allowed for the creation of state 
-// High Precision Geodetic Networks (HPGNs), also referred to as High Accuracy
-// Reference Networks (HARNs) throughout the country.
-// 
-// Latest ftp location(20100206):
-// ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon/
-//
-// ---
-// datum_grids: $(OSSIM_DATA)/ossim/elevation/nadcon-grids
-
-//---
-// Look-up tables for European Petroleum Survey Group (EPSG) coded 
-// projections and datums.
-// These are expected to be delimiter-separated value (*.csv|tsv) files.
-// NOTE: ESRI codes are NOT EPSG codes, however, they do not conflict with 
-// EPSG so ingesting them as if they were EPSG. Eventually, separate 
-// databases or a multi-Db solution may need to be 
-// implemented. OLK 05/2010
-// --- 
-epsg_database_file0: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_epsg_projections-v7_4.csv
-epsg_database_file1: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_harn_state_plane_epsg.csv
-epsg_database_file2: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_state_plane_spcs.csv
-epsg_database_file3: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_harn_state_plane_esri.csv
-
-// Database file for WKT-based projection factory:
-wkt_database_file: $(OSSIM_INSTALL_PREFIX)/share/ossim/projection/ossim_wkt_pcs.csv
-
-//---
-// Geoid support:
-// Note:  Since the sensor models do earth intersects at height above the 
-//        ellipsoid and the vertical datum of DTED is geoid_egm_96_grid, you
-//        should have a geoid grid in place for accurate earth intersections.
-//---
-
-//---
-// Generic geoid support:
-// Specifying a "geoid_manager.geoid_source0.type: geoid_image" uses an image handler
-// based geoid reader.  So this can be any type of image, i.e. tiff, raster, provided
-// it can be opened and a good image geometry is returned.
-// 
-// In the below example for geoid_manager.geoid_source0 an external geometry file was
-// created for Und_min1x1_egm2008_isw_equal_82_WGS84_TideFree_SE.ras.
-//---
-geoid_manager.geoid_source0.connection_string: $(OSSIM_DATA)/elevation/geoids/egm2008/Und_min1x1_egm2008_isw_equal_82_WGS84_TideFree_SE.ras
-geoid_manager.geoid_source0.enabled: true
-geoid_manager.geoid_source0.geoid.type: egm2008
-geoid_manager.geoid_source0.memory_map: false
-geoid_manager.geoid_source0.type: geoid_image
-
-//---
-// GEOID 99:  Set keyword to the directory containing the GEOID 99 grids.
-// 
-// Notes:  
-// - Grids MUST be in the native byte order.
-// - Can be downloaded from:
-// http://www.ngs.noaa.gov/GEOID/GEOID99
-// ---
-// geoid_99_directory:  $(OSSIM_DATA)/ele1/geoid/geoid99
-
-//---
-// Generic support has been added to each NGS geoid grid. You can download
-// ngs grids for 1999, 2003.
-// Current release only allows for a single directory we will allow for
-//  multiple directories later and auto detecting if possible.
-//
-// Currently the file names are hard coded and need to be from the NGS 
-// distribution also downloadable from ftp.remotesensing.org under
-// /ossim/test_data.tgz
-//---
-geoid_ngs_directory: $(OSSIM_DATA)/elevation/geoids/geoid99
-geoid_ngs_directory.byte_order: little_endian
-// geoid_ngs_directory.byte_order: big_endian
-
-//---
-// GEOID EGM 96:  Set keyword to the path to the egm96.grd
-// 
-// Notes:
-// - Grid must be in BIG ENDIAN (UNIX) format.
-// - Can be downloaded from svn:
-// svn co http://svn.osgeo.org/ossim/trunk/ossim_package_support/geoids geoids
-//---
-geoid_egm_96_grid: $(OSSIM_INSTALL_PREFIX)/share/ossim/geoids/geoid1996/egm96.grd
-
-//---
-// Location of other shared files can be accessed using this preference to permit 
-// specifying paths relative to it.
-//---
-ossim_share_directory: $(OSSIM_INSTALL_PREFIX)/ossim/share
-
-// ---
-// Font support:
-// NOTE:  To use the MapCompositionSource you must at least have "font.dir1"
-//        set to some default.
-// ---
-// font.file1: /usr/share/fonts/default/Type1/b018032l.pfb
-// font.dir1: /usr/share/fonts/default/Type1
-
-
-//---
-// OSSIM plugin support:
-//
-// Notes:  
-//
-// Notes:
-//
-// View plugins with:
-//
-// $ ossim-info --plugins
-//
-// To troubleshoot problems  embedded trace debug can be turned on using 
-// "ossimDynamic"
-//
-// $ ossim-info -T ossimDynamic --plugins 
-//
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimpng_plugin.so
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimgdal_plugin.so
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimreg_plugin.so
-// ossimDynamicLibrary::load DEBUG:
-// Loaded library:  /usr/local/lib/libossimcontrib_plugin.so
-//
-// Keywords:
-//
-// plugin.dir1:  < directory where plugins are >
-//
-// you can also list by individual file names
-//
-// plugin.file1: < full path and file name >
-//---
-// Example, edit/uncomment as needed:
-plugin.file0: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimpng_plugin.so
-plugin.file5: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimkakadu_plugin.so
-plugin.file10: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimmrsid_plugin.so
-plugin.file15: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_plugin.so
-
-// Old hdf4/5 plugin:
-// plugin.file20: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimhdf_plugin.so
-
-// New split out hdf plugins
-plugin.file20: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimhdf5_plugin.so
-plugin.file23: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimhdf4_plugin.so
-
-plugin.file25: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimsqlite_plugin.so
-plugin.file30: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimlas_plugin.so
-plugin.file40: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimweb_plugin.so
-plugin.file45: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimkmlsuperoverlay_plugin.so
-plugin.file50: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimndf_plugin.so
-plugin.file55: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimgeopdf_plugin.so
-plugin.file60: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimopencv_plugin.so
-plugin.file65: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimgdal_plugin.so
-
-// plugin.file5: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimreg_plugin.so
-// plugin.file6: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossimcontrib_plugin.so
-// 
-//
-// We also support a second style that allows one to pass options to any
-// plugins that support them
-// the options param is an embedded keywordlist that is surrounded by triple
-// quotes:
-// plugin0.file: <path to>/libossimkakadu_plugin
-// plugin0.options: """
-//                  read_factory.location: front
-//                  writer_factory.location: back
-//                  """
-//
-// END OSSIM plugin support
-//---
-
-// Toggles for recceVue application:
-statusLatLon: true
-statusHeight: true
-statusDatum: true
-statusGSD: true
-statusUpdateOnClick: true
-
-
-// ---
-// Keyword: cache_size
-// The cache size is in megabytes.
-// ---
-cache_size: 256
-// cache_size: 512
-// cache_size: 1024
-// cache_size: 2048
-
-
-// ---
-// Keyword: overview_stop_dimension
-//
-// Affects any overview building from img2rr, imagelinker, iview. Controls
-// the amount of resLevels created.  This is also used to control the amount
-// of levels the J2K writers use from the kakadu plugin.
-// 
-// This is the point where "img2rr" or the overview builder will stop 
-// decimating the image down.  So in other words, if the 
-// overview_stop_dimension keyword is 64, img2rr application will build 
-// overviews, decimating each level by 2 until both the width and height are 
-// less than or equal to 64.  Note the larger the dimension the less levels
-// created.
-// 
-// Uncomment one below.
-// ---
-overview_stop_dimension: 8
-// overview_stop_dimension: 16
-// overview_stop_dimension: 32
-// overview_stop_dimension: 64
-// overview_stop_dimension: 128
-// overview_stop_dimension: 256
-// overview_stop_dimension: 512
-
-// ---
-// Keyword: overview_builder.scan_for_min_max_null_if_float
-// 
-// Control overview sequencer scanning for min, max, nulls for float data. If
-// true and input data is float scalar type scanning will be performed and a
-// dot.omd file will be written with the min, max, nulls in it.
-// 
-// Type: boolean, set to true, false, 1, 0
-// 
-// CAUTION: Because the j2k overview builder requires the min/max up front for 
-// normalization this is NOT a good option to turn on.  In other word if you
-// are doing ossim-img2rr -r -t ossim_kakadu_nitf_j2k <float-image> you should
-// disable this and set the min/max with ossim-cmm(compute min max) or do it
-// manually.
-// ---
-// overview_builder.scan_for_min_max_null_if_float: true
-
-// ---
-// Keyword: tile_size
-//
-// Tile size x y
-//
-// Affects all ossim application.  This is the internal tile size of any
-// image chain unless overridden by the filter.
-// 
-// Notes: 
-// 1) OSSIM can handle any tile size; however it is best to use a size that
-// is a power of two.
-// 2) 
-// 
-// Uncomment one below.  
-// ---
-// tile_size: 32 32
-// tile_size: 64 64
-// tile_size: 128 128
-tile_size: 256 256
-// tile_size: 512 512
-// tile_size: 1024 1024
-
-
-// ---
-// Keyword: shapefile_colors_auto
-// 
-// Shape file colors set to automatic.
-// This is a boolean value.  If true pen and brush color of shape files will
-// be determined by indexing a color table in a round robin approach.  If set 
-// to true the auto colors override keywords for "pen" and "brush" color.
-// Default value if not found if "false".
-// 
-// Value can be: true, yes, y, 1, false, no, n or 0
-// ---
-shapefile_colors_auto: false
-
-// ---
-// Shape file pen color:
-// Three values for red, green and blue between 0 and 1.0 with 1.0 being 
-// brightness and 0.0 being black.
-// ---
-shapefile_normalized_rgb_pen_color: 0.004 1.0 0.004
-
-// ---
-// Shape file pen color:
-// Three values for red, green and blue between 0 and 1.0 with 1.0 being 
-// brightness and 0.0 being black.
-// ---
-shapefile_normalized_rgb_brush_color: 0.004 1.0 0.004
-
-// ---
-// Shape file point size:
-// Width and height for points in pixels.
-// ---
-shapefile_point_size: 6.0 6.0
-
-
-// --------------------------
-// Some keywords for the OSSIM GUI application
-//
-//
-// igen spec files output./  This is the directory location you would
-// like the igen export GUI to default to when outputing spec files
-ossim.igen_spec_output_directory: /work/gpotts/igen_test
-
-// this is the igen executable.  Make sure you put the full path
-ossim.igen_executable:  /work/gpotts/ossim/bin/igen
-
-// END keywords for OSSIM GUI
-//--------------------------
-
-// ---
-// Position Quality Evaluator (PQE) keywords. 
-// Note Circulay Error(CE) and Linear Error (LE)  units are in meters.
-// These keywords are for the imagelinker->image-window->PQE dialog box.
-// They allow the user to calculater position quality factoring in backdrop
-// and elevation uncertainty.
-// ---
-
-// Backdrop enter "name,ce90,le90" like "JOG-A,77,38".
-pqe_backdrop1: TLM50,31,25
-pqe_backdrop2: TLM100,61,25
-pqe_backdrop3: JOG-A,77,38
-pqe_backdrop4: TPC,613,47
-pqe_backdrop5: ONC,1226,93
-pqe_backdrop6: JNC,2452,187
-pqe_backdrop7: GNC,6129,465
-
-// Elevation enter "name,ce90,le90" like "SRTM_1ARC,20,16"
-// Accuracies vary widely depending on terrain and how they were computed.
-// These are just examples.
-pqe_elev1: SRTM_3ARC,20,16
-pqe_elev2: SRTM_1ARC,20,10
-pqe_elev3: DTED_LEVEL2,40,20
-pqe_elev4: DTED_LEVEL1,50,30
-pqe_elev5: RPC_No_DEM_State,-2,-1.6449
-// Special Case
-// RPC_No_DEM_State, Scale Divisor, 1-Sigma Divisor (minus signs required)
-
-pqe_normalized_rgb_ellipse_color: 0.004 1.0 0.004
-
-// End of PQE keywords...
-
-// ---
-// Log file support:  If set all output from ossimNotify to stdout and to 
-// stderr will be written to the log file.  Optionally users of ossim 
-// applications can use the "--ossim-logfile <some_file>" command line 
-// argument.  Note that the "--ossim-logfile" command line argument overrides
-// the preference setting.
-// 
-// Uncomment and set path to use log file:
-// ---
-// ossim.log.file: D:\tmp\ossim-log.txt
-
-// ---
-// Kakadu threads:
-// ---
-kakadu_threads: 4
-
-// ---
-// ossim threads:
-// ---
-ossim_threads: 4
-
-//---
-// Keyword for ingesting terrasar-x and radarsat-2 data. When TRUE, instructs
-// the sensor model to create an ossim coarse grid replacement model to
-// improve performance geometric_sar_sensor_model.create_ocg: true
-// Keyword parsed presently by orthoigen. If true, histograms will be
-// computed when needed for all images that do not yet have a histogram. 
-//---
-autogenerate_histogram: true
-
-//---
-// specify true or fals if you want the ossimInit to look in the current 
-// program path to see if any plugins are available.  Turn this off if you 
-// want to load them from a keyword list and remove the need to scan the 
-// directory for valid plugins
-//---
-ossim_init.auto_load_plugins: false
-
-//---
-// When true, indicates to orthoigen application that the specified cut
-// rectangle for the product shall be adjusted to fit the minimum bounding
-// valid image rect. This eliminates null exterior pixels when the cut rect
-// extends beyond the valid image rect. This preference can be overriden
-// by an option on the orthoigen command line. See the usage on orthoigen.
-// [default is false]
-//---
-orthoigen.clip_to_valid_rect: false
-
-//---
-// Specifies the preference for remapping null-valued pixels to 1 (min).
-// Possible settings are:
-// "none" -- Bypasses pixel flipper
-// "all_nulls" -- replaces any occurrence of the null value with 1. 
-//    Ex: (20,0,10) becomes (20,1,10), also (0,0,0) becomes (1,1,1)
-// "only_partial_nulls" -- 
-// replaces null-valued band only if another band is non-null.
-//    Ex: (20,0,10) becomes (20,1,10), but (0,0,0) is not remapped.
-// "all_bands_if_partial_null" -- 
-// Remaps all bands of a pixel if even one band is null.
-//    Ex: (20,0,10) becomes (1,1,1), but (0,0,0) is not remapped
-// "only_full_nulls" -- Remaps pixel only if all bands are null.
-//    Ex: (0,0,0) becomes (1,1,1), but (20,0,10) is not remapped
-//---
-orthoigen.flip_null_pixels: none
-
-// ---
-// NITF writer site configuration file:
-// ---
-// nitf_writer.site_configuration_file: $(OSSIM_DATA)/ossim/share/nitf-site-configuration.kwl
diff --git a/ossim/share/ossim/util/ossimHlzApi.json b/ossim/share/ossim/util/ossimHlzApi.json
deleted file mode 100644
index 342b7d9..0000000
--- a/ossim/share/ossim/util/ossimHlzApi.json
+++ /dev/null
@@ -1,96 +0,0 @@
-{
-    "name": "ossim-hlz",
-    "description": {
-        "version" : "1.00",
-        "short_description": "OSSIM HLZ Utility",
-        "long_description": "Utility for finding suitable helicopter landing zones surrounding a speciflzied target location."
-     },
-     "inputs": {
-        "dem": {
-            "datatype": "file:elevation",
-            "description": "Optional DEM file to use in lieu of default elevation database.",
-            "required": false    
-        },
-        "gsd": {
-            "datatype": "double:positive_range",
-            "description": "Product resolution in meters-per-pixel. Defaults to the best resolution of elevation files referenced.",
-            "required": false    
-        },
-        "lut": {
-            "datatype": "file:text",
-            "description": "Specifies the optional lookup table filename for mapping the single-band output image to an RGB. The LUT provided must be in the ossimIndexToRgbLutFilter format and must handle the three output viewshed values (see --values option).",
-            "required": false    
-        },
-        "point_cloud": {
-            "datatype": "file:geopackage",
-            "description": "Specifies ancillary point-cloud data for level-2 search for obstructions.",
-            "required": false    
-        },
-        "reticle": {
-            "datatype": "int:positive_range",
-            "description": "Size (in pixels) of reticle centered on observer's position. If non-zero, a border is drawn delineating the ROI.",
-            "required": false    
-        },
-        "rlz": {         
-            "datatype": "double:positive_range",
-            "description": "Radius of interest (meters)",
-            "required": true    
-        },
-        "roi": {         
-            "datatype": "double:positive_range",
-            "description": "Radius of interest surrounding the target (meters)",
-            "required": true    
-        },
-        "roughness": {         
-            "datatype": "double:positive_range",
-            "description": "Threshold for acceptable landing zone terrain roughness (meters).",
-            "required": false    
-        },
-        "slope": {         
-            "datatype": "double:positive_range",
-            "description": "Threshold for acceptable landing zone terrain slope (deg).",
-            "required": false    
-        },
-        "target": {         
-            "datatype": "geo_pos_2d",
-            "description": "Geographic position of target (lat-deg, lon-deg)",
-            "required": true   
-        },
-        "threat-domes": {
-            "datatype": "file:text",
-            "description": "Optional file containing threat dome specifications.",
-            "required": false    
-        },
-        "viewsheds": {
-            "datatype": "file:text",
-            "description": "Optional file containing specifications of observers used in identifying visible or hidden LZs.",
-            "required": false    
-        },
-        "bad_zone_index": {
-            "datatype": "int:byte_range",
-            "description": "Specifies the pixel values (0-255) for the pixels representing unsuitable terrain.",
-            "required": false    
-        },
-        "marginal_zone_index": {
-            "datatype": "int:byte_range",
-            "description": "Specifies the pixel values (0-255) for the pixels representing marginal terrain.",
-            "required": false    
-        },
-        "good_zone_index": {
-            "datatype": "int:byte_range",
-            "description": "Specifies the pixel values (0-255) for the pixels representing good terrain.",
-            "required": false    
-        },
-        "outputFile": {
-            "datatype": "url:wms",
-            "description": "The URL/filename of the WMS server where the file is now accessible",
-            "required": true
-        }
-    },
-    "outputs": { },
-    "ranges" : {
-       "azimuth_range": [ 0.0, 360.0 ],
-       "positive_range": [ 0, "+inf"],
-       "byte_range": [ 0, 255 ]
-    }
-}
diff --git a/ossim/share/ossim/util/ossimViewshedApi.json b/ossim/share/ossim/util/ossimViewshedApi.json
deleted file mode 100644
index 26b7632..0000000
--- a/ossim/share/ossim/util/ossimViewshedApi.json
+++ /dev/null
@@ -1,86 +0,0 @@
-{
-    "name": "ossim-viewshed",
-    "description": {
-        "version" : "1.00",
-        "short_description": "OSSIM Viewshed Utility",
-        "long_description": "Utility for computing the viewshed from a given observer position for a specified area of interest."
-     },
-     "inputs": {
-        "radius": {         
-            "datatype": "double:positive_range",
-            "description": "Radius of interest (meters)",
-            "required": true    
-        },
-        "observer": {         
-            "datatype": "geo_pos_2d",
-            "description": "Geographic position of observer (lat-deg, lon-deg)",
-            "required": true   
-        },
-        "fovStart": {
-            "datatype": "int:azimuth_range",
-            "description": "FOV starting azimuth for clockwise sweep (deg).",
-            "required": false    
-        },
-        "fovEnd": {
-            "datatype": "int:azimuth_range",
-            "description": "FOV ending azimuth for clockwise sweep (deg).",
-            "required": false    
-        },
-        "dem": {
-            "datatype": "file:elevation",
-            "description": "Optional DEM file to se in lieu of default elevation database.",
-            "required": false    
-        },
-        "eyeHeight": {
-            "datatype": "double:positive_range",
-            "description": "eye height (meters)",
-            "datatype": "double:positive_range"
-        },
-        "gsd": {
-            "datatype": "double:positive_range",
-            "description": "Product resolution in meters-per-pixel. Defaults to the best resolution of elevation files referenced.",
-            "required": false    
-        },
-        "reticle": {
-            "datatype": "int:positive_range",
-            "description": "Size (in pixels) of reticle centered on observer's position. If non-zero, a border is drawn delineating the ROI.",
-            "required": false    
-        },
-        "lut": {
-            "datatype": "file:text",
-            "description": "Specifies the optional lookup table filename for mapping the single-band output image to an RGB. The LUT provided must be in the ossimIndexToRgbLutFilter format and must handle the three output viewshed values (see --values option).",
-            "required": false    
-        },
-        "visible_index": {
-            "datatype": "int:byte_range",
-            "description": "Specifies the pixel values (0-255) for the pixels representing visible terrain.",
-            "required": false    
-        },
-        "hidden_index": {
-            "datatype": "int:byte_range",
-            "description": "Specifies the pixel values (0-255) for the pixels representing hidden terrain.",
-            "required": false    
-        },
-        "reticle_index": {
-            "datatype": "int:byte_range",
-            "description": "Specifies the pixel values (0-255) to use for the reticle and borders.",
-            "required": false    
-        },
-        "outputFile": {
-            "datatype": "url:wms",
-            "description": "The URL/filename of the WMS server where the file is now accessible",
-            "required": true
-        },
-        "horizonFile": {
-            "datatype": "url:wms",
-            "description": "If specified, outputs the max elevation angles for all azimuths to specified URL/filename, for horizon profiling.",
-            "required": false    
-        }
-    },
-    "outputs": { },
-    "ranges" : {
-       "azimuth_range": [ 0.0, 360.0 ],
-       "positive_range": [ 0, "+inf"],
-       "byte_range": [ 0, 255 ]
-    }
-}
diff --git a/ossim/src/apps/CMakeLists.txt b/ossim/src/apps/CMakeLists.txt
deleted file mode 100644
index eab6c0d..0000000
--- a/ossim/src/apps/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-FILE(GLOB OSSIM_APP_DIRS "ossim-*")
-FILE(GLOB OSSIM_CONFIG_DIR "ossim-config*")
-LIST(REMOVE_ITEM OSSIM_APP_DIRS ${OSSIM_CONFIG_DIR})
-
-FOREACH(f ${OSSIM_APP_DIRS})
-	ADD_SUBDIRECTORY(${f})
-ENDFOREACH(f)
diff --git a/ossim/src/apps/curl_apps/CMakeLists.txt b/ossim/src/apps/curl_apps/CMakeLists.txt
deleted file mode 100644
index 4cc94eb..0000000
--- a/ossim/src/apps/curl_apps/CMakeLists.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-message( "************** Begin: CMAKE SETUP FOR ossim curl apps ******************" )
-
-cmake_minimum_required (VERSION 2.8)
-
-project(ossimcore)
-
-set(requiredLibs)
-
-# Get the library suffix for lib or lib64.
-get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)       
-if(LIB64)
-   set(LIBSUFFIX 64)
-else()
-   set(LIBSUFFIX "")
-endif()
-
-# OpenThreads - Required:
-find_package( OpenThreads )
-if( OPENTHREADS_FOUND )
-   include_directories( ${OPENTHREADS_INCLUDE_DIR} )
-   set( requiredLibs ${requiredLibs} ${OPENTHREADS_LIBRARY} )
-else( OPENTHREADS_FOUND )
-   message( FATAL_ERROR "Could not find required OpenThreads package!" )
-endif( OPENTHREADS_FOUND )
-
-find_package( CURL )
-if( CURL_FOUND )
-   include_directories( ${CURL_INCLUDE_DIR} )
-   set( requiredLibs ${requiredLibs} ${CURL_LIBRARY} )
-else( CURL_FOUND )
-   message(FATAL_ERROR "Could not find curl") 
-endif( CURL_FOUND )
-
-# Requires ossim:
-find_package(ossim)
-if (OSSIM_FOUND)
-   include_directories( ${OSSIM_INCLUDE_DIR} )
-   set(requiredLibs ${requiredLibs} ${OSSIM_LIBRARIES} )
-else(OSSIM_FOUND)
-   message(FATAL_ERROR "Could not find ossim")
-endif(OSSIM_FOUND)
-
-# Add our include...
-include_directories(".")
-
-message( STATUS "CURL_INCLUDE_DIR    = ${CURL_INCLUDE_DIR}" )
-message( STATUS "CURL_LIBRARY        = ${CURL_LIBRARY}" )
-message( STATUS "OPENTHREADS_LIBRARY = ${OPENTHREADS_LIBRARY}" )
-message( STATUS "OPENTHREADS_INCLUDE = ${OPENTHREADS_INCLUDE_DIR}" )
-message( STATUS "OSSIM_INCLUDE_DIR   = ${OSSIM_INCLUDE_DIR}" )
-message( STATUS "OSSIM_LIBRARIES     = ${OSSIM_LIBRARIES}" )
-message( STATUS "Required libs       = ${requiredLibs}" )
-
-# ---
-# omar-data-mgr app:
-# ---
-
-# Add the executable:
-add_executable(omar-data-mgr omar-data-mgr.cpp omarDataMgrUtil.cpp )
-
-# Set the output dir:
-set_target_properties(omar-data-mgr 
-                      PROPERTIES 
-                      RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${BUILD_RUNTIME_DIR}")
-
-# omar-data-mgr application links with required libs.
-target_link_libraries( omar-data-mgr ${requiredLibs} )
-
-# Install app:
-install( TARGETS omar-data-mgr
-         DESTINATION ${INSTALL_RUNTIME_DIR} )
-
-message( "************** End: CMAKE SETUP FOR ossim curl apps ******************" )
diff --git a/ossim/src/apps/curl_apps/omar-data-mgr.cpp b/ossim/src/apps/curl_apps/omar-data-mgr.cpp
deleted file mode 100644
index 8f05ab0..0000000
--- a/ossim/src/apps/curl_apps/omar-data-mgr.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//---
-// File: omar-data-mrg.cpp
-//
-// License: See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-// 
-// Description: omar-data-mrg application for interfacing with OMAR
-// dataManager services, e.g. "add", "remove" raster via libcurl.
-//---
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/init/ossimInit.h>
-#include "omarDataMgrUtil.h"
-
-#include <iostream>
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   int rv = 0; // Return value.
-   
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   int originalArgCount = argc;
-   
-   ossimArgumentParser ap(&argc, argv);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   //---
-   // Avoid going on if a global option was consumed by ossimInit::initialize
-   // like -V or --version option and the arg count is down to 1.
-   //---
-   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
-   {
-      // Make the info object.
-      ossimRefPtr<omarDataMgrUtil> dm = new omarDataMgrUtil();
-
-      try
-      {
-         //---
-         // Initialize will take the options passed in and set things to output
-         // information for.
-         //
-         // omarDataMgrUtil::initialize can throw an exception.
-         //---
-         bool continue_after_init = dm->initialize(ap);
-
-         if ( continue_after_init )
-         {
-            // This does all the work...
-            rv = (int)dm->execute();
-         }
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         rv = 1;
-      }
-      
-   }  // End: if ( ( ap.argc() > 1 ) ...
-   
-   return rv;
-   
-} // End of main...
diff --git a/ossim/src/apps/curl_apps/omarDataMgrUtil.cpp b/ossim/src/apps/curl_apps/omarDataMgrUtil.cpp
deleted file mode 100644
index 6e27301..0000000
--- a/ossim/src/apps/curl_apps/omarDataMgrUtil.cpp
+++ /dev/null
@@ -1,942 +0,0 @@
-//----------------------------------------------------------------------------
-// File: omarDataMgrUtil.cpp
-// 
-// License: See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: omarDataMgrUtil class definition
-//
-// Utility class for processing images recursively and calling OMAR
-// services upon successful open.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include "omarDataMgrUtil.h"
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/util/ossimFileWalker.h>
-
-#include <curl/curl.h>
-#include <iomanip>
-#include <string>
-#include <vector>
-
-static std::string CLEAN_KW                    = "clean";
-static std::string DUMP_FILTERED_IMAGES_KW     = "dump_filtered_images";
-static std::string FALSE_KW                    = "false";
-static std::string FILE_KW                     = "file";
-static std::string OVERRIDE_FILTERED_IMAGES_KW = "override_filtered_images";
-static std::string SERVICE_KW                  = "service";
-static std::string THREADS_KW                  = "threads";
-static std::string TRUE_KW                     = "true";
-static std::string URL_KW                      = "url";
-
-// Static trace for debugging.  Use -T omarDataMgrUtil to turn on.
-static ossimTrace traceDebug = ossimTrace("omarDataMgrUtil:debug");
-
-omarDataMgrUtil::omarDataMgrUtil()
-   :
-   ossimReferenced(),
-   ossimFileProcessorInterface(),
-   m_kwl( new ossimKeywordlist() ),
-   m_fileWalker(0),
-   m_mutex(),
-   m_imageUtil(0),
-   m_errorStatus(0),
-   m_filteredImages(0)
-{
-}
-
-omarDataMgrUtil::~omarDataMgrUtil()
-{
-   if ( m_fileWalker )
-   {
-      delete m_fileWalker;
-      m_fileWalker = 0;
-   }
-}
-
-void omarDataMgrUtil::addArguments(ossimArgumentParser& ap)
-{
-   // Set the general usage:
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options] <service> <file(s)-or-directory-to-walk>";
-   au->setCommandLineUsage(usageString);
-
-   // Set the command line options:
-   au->addCommandLineOption("--clean", "Cleans/removes image file and associated files from file system if present.\n\"remove\" option only.\nLooks for associated files of image, e.g. .ovr, .his, .omd, .geom\nCAUTION: This command is irreversible once envoked!");
-   
-   au->addCommandLineOption("--dump-filtered-image-list", "Outputs list of filtered images.");
-
-   au->addCommandLineOption("--override-filtered-images", "Allows processing of file that is in the filtered image list.");
-   
-   au->addCommandLineOption("--threads", "<threads> The number of threads to use. (default=1) Note a default can be set in your ossim preferences file by setting the key \"ossim_threads\".");
-   
-   au->addCommandLineOption("--preproc", "Enables the use of the preproc utility to build overviews and histograms");
-
-   au->addCommandLineOption( "-u", "<url> URL, e.g. \"http://omar.osssim.org/omar\"\n(default= url \"http://localhost:8080/omar\"" );
-
-   ossimRefPtr<ossimImageUtil> imageUtil = new ossimImageUtil();
-   imageUtil->addOptions(au);
-   imageUtil = 0;
-   
-} // void omarDataMgrUtil::addArguments(ossimArgumentParser& ap)
-
-bool omarDataMgrUtil::initialize(ossimArgumentParser& ap)
-{
-   static const char M[] = "omarDataMgrUtil::initialize(ossimArgumentParser&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-
-   bool result = true;
-
-   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
-   {
-      usage(ap);
-
-      // continue_after_init to false
-      result = false;
-   }
-   else
-   {
-      //---
-      // Start with clean options keyword list.
-      //---
-      m_kwl->clear();
-
-      while ( 1 ) //  While forever loop...
-      {
-         // Used throughout below:
-         std::string ts1;
-         ossimArgumentParser::ossimParameter sp1(ts1);
-
-         if( ap.read("--clean") )
-         {
-            addOption( CLEAN_KW, TRUE_KW );
-            if ( ap.argc() < 3 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--dump-filtered-image-list") )
-         {
-            setDumpFilteredImageListFlag( true );
-            if ( ap.argc() < 3 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--override-filtered-images") )
-         {
-            setOverrideFilteredImagesFlag( true );
-            if ( ap.argc() < 3 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--threads", sp1) )
-         {
-            m_kwl->addPair( THREADS_KW, ts1 );
-            if ( ap.argc() < 3 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-u", sp1) )
-         {
-            m_kwl->addPair( URL_KW, ts1 );
-            if ( ap.argc() < 3 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("--preproc"))
-         {
-            m_imageUtil = new ossimImageUtil();
-            m_imageUtil->initialize(ap);
-         }
-
-         if ( ap.argc() < 3 )
-         {
-            break;
-         }
-
-         // End of arg parsing.
-         ap.reportRemainingOptionsAsUnrecognized();
-         if ( ap.errors() )
-         {
-            ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-            std::string errMsg = "Unknown option...";
-            throw ossimException(errMsg);
-         }
-
-         break; // Break from while forever.
-         
-      } // End while (forever) loop.
-      
-      if( ap.argc() > 2 )
-      {
-         // First arg should be service, e.g. "add", "remove".
-         std::string value = ap[1];
-         m_kwl->addPair( SERVICE_KW, value );
-
-         // Check for "clean" used with "add" and issue warning???
-         if ( getCleanFlag() && ( value == "add" ) )
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "NOTICE: Using --clean with \"add\" service is illogical!\n";
-         }
-
-         // The remaining args should be files to process.
-         for (ossim_int32 i = 1; i < (ap.argc()-1); ++i)
-         {
-            ossimString kw = "file";
-            kw += ossimString::toString(i);
-            std::string value = ap[i+1];
-            m_kwl->addPair(kw.string(), value, true);
-         }
-      }
-      else
-      {
-         if ( getDumpFilterImagesFlag() )
-         {
-            // Caller wants to see filtered image names:
-            dumpFilteredImageList();
-         }
-         else
-         {
-            usage(ap);
-            result = false;
-         }
-      }
-
-   } // not usage
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "m_kwl:\n" << *(m_kwl.get()) << "\n"
-         << M << " exit result = " << (result?"true":"false")
-         << "\n";
-   }
-   
-   return result;
-}
-
-ossim_int32 omarDataMgrUtil::execute()
-{
-   static const char M[] = "omarDataMgrUtil::execute()";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-
-   if ( getDumpFilterImagesFlag() )
-   {
-      // Caller wants to see filtered image names:
-      if ( m_filteredImages.empty() )
-      {
-         initializeDefaultFilterList();
-      }
-      
-      dumpFilteredImageList();
-   }
-   
-   // Get the number of "file*" keywords.
-   ossim_uint32 fileCount = m_kwl->numberOf("file");
-
-   if ( fileCount )
-   {
-      if ( !m_fileWalker )
-      {
-         m_fileWalker = new ossimFileWalker();
-      }
-      
-      if ( !getOverrideFilteredImagesFlag() && m_filteredImages.empty() )
-      {
-         initializeDefaultFilterList();
-      }
-      
-      m_fileWalker->initializeDefaultFilterList();
-
-      //---
-      // Passing getNumberOfThreads() to ossimFileWalker::setNumberOfThreads was
-      // kicking up a coverity scan error:
-      // Passing tainted variable "this->getNumberOfThreads()" to a tainted sink.
-      // drb
-      //---
-      ossim_uint32 threads = getNumberOfThreads();
-      m_fileWalker->setNumberOfThreads( threads );
-
-      // Must set this so we can stop recursion on directory based images.
-      m_fileWalker->setWaitOnDirFlag( true );
-
-      // This links the file walker back to our "processFile" method.
-      m_fileWalker->setFileProcessor( this );
-      
-      // Wrap in try catch block as excptions can be thrown under the hood.
-      try
-      {
-         // Get the list of files passed to us:
-         std::vector<ossimFilename> files;
-         ossim_uint32 processedFiles = 0;;
-         ossim_uint32 i = 0;
-         while ( processedFiles < fileCount )
-         {
-            ossimString kw = FILE_KW;
-            kw += ossimString::toString(i);
-            std::string lookup = m_kwl->findKey( kw.string() );
-            if ( lookup.size() )
-            {
-               files.push_back( ossimFilename(lookup) );
-               ++processedFiles;
-            }
-            
-            ++i;
-            if ( i > (fileCount + 100) ) break;
-         }
-
-         // Process the files:
-         m_fileWalker->walk( files ); 
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Caught exception: " << e.what() << endl;
-         setErrorStatus( ossimErrorCodes::OSSIM_ERROR );
-      }
-      
-   } // if ( fileCount )
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " exit status: " << m_errorStatus << std::endl;
-   }
-   
-   // Zero is good, non zero is bad.
-   return m_errorStatus; 
-}
-
-//---
-// This method is called back by the ossimFileWalker::walk method for each file it finds that it
-// deems can be processed.
-//---
-void omarDataMgrUtil::processFile(const ossimFilename& file)
-{
-   static const char M[] = "omarDataMgrUtil::processFile";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "\nfile:    " << file << "\n";
-   }
-   
-   if ( file.size() )
-   {
-      bool processFileFlag = true;
-      if ( !getOverrideFilteredImagesFlag() )
-      {
-         processFileFlag = !isFiltered( file );
-      }
-      
-      if ( processFileFlag )
-      {
-         omarDataMgrUtil::OmarDataMgrUtilService service = getService();
-
-         if ( service == omarDataMgrUtil::ADD_RASTER )
-         {
-            callAddRasterService( file );
-         }
-         else if ( service == omarDataMgrUtil::REMOVE_RASTER )
-         {
-            callRemoveRasterService( file );
-         }
-         else
-         {
-            std::string s;
-            getService( s );
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Unhandled service: " << s << "\n";
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "Filtered file, not processing: " << file << std::endl;
-      }
-      
-   } // Matches: if ( file.size() )
-   
-   
-   if(traceDebug())
-   {
-      // Since ossimFileWalker is threaded output the file so we know which job exited.
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
-   }
-   
-} // End: omarDataMgrUtil::processFile(const ossimFilename& file)
-
-void omarDataMgrUtil::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-   
-   // Set app name.
-   ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
-
-   // Add options.
-   addArguments(ap);
-   
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-   
-   ossimNotify(ossimNotifyLevel_INFO)
-      << "\nValid services: \"add\" and \"remove\"."
-      << "\nExample usage:\n\n"
-
-      << "Using default url \"http://localhost:8080/omar\":\n"
-      << ap.getApplicationName()
-      << " add 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
-
-      << "Passing in url:\n"
-      << ap.getApplicationName()
-      << " -u http://your_url/omar add 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
-
-      << "Adding all images in a directory using 32 threads:\n"
-      << ap.getApplicationName()
-      << " --threads 32 add /data1/imagery/2015/09/28/0000\n\n"
-      
-      << "Removing file from database:\n"
-      << ap.getApplicationName()
-      << " remove 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
-
-      << "Removing file from database and file system:\n"
-      << ap.getApplicationName()
-      << " --clean remove 5V090205M0001912264B220000100072M_001508507.ntf\n\n"
-
-      << "Removing all images in a directory using 32 threads:\n"
-      << ap.getApplicationName()
-      << " --clean --threads 32 remove /data1/imagery/2015/09/28/0000\n"
-
-      << std::endl;
-}
-
-// Private method:
-bool omarDataMgrUtil::isDirectoryBasedImage(const ossimImageHandler* ih) const
-{
-   bool result = false;
-   if ( ih )
-   {
-      // Get the image handler name.
-      ossimString imageHandlerName = ih->getClassName();
-      if ( (imageHandlerName == "ossimAdrgTileSource") ||
-           (imageHandlerName == "ossimCibCadrgTileSource") )  
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-void omarDataMgrUtil::setNumberOfThreads( ossim_uint32 threads )
-{
-   addOption( THREADS_KW, threads );
-}
-
-void omarDataMgrUtil::setNumberOfThreads( const std::string& threads )
-{
-   addOption( THREADS_KW, threads );
-}
-
-ossim_uint32 omarDataMgrUtil::getNumberOfThreads() const
-{
-   ossim_uint32 result = 1;
-   std::string lookup = m_kwl->findKey( THREADS_KW );
-   if ( lookup.size() )
-   {
-      result = ossimString(lookup).toUInt32();
-   }
-   else
-   {
-      result = ossim::getNumberOfThreads();
-   }
-   return result;
-}
-
-void omarDataMgrUtil::addOption( const std::string& key, ossim_uint32 value )
-{
-   addOption( key, ossimString::toString( value ).string() );
-}
-
-void omarDataMgrUtil::addOption(  const std::string& key, const std::string& value )
-{
-   m_mutex.lock();
-   if ( m_kwl.valid() )
-   {
-      if ( key.size() && value.size() )
-      {
-         m_kwl->addPair( key, value );
-      }
-   }
-   m_mutex.unlock();
-}
-
-void omarDataMgrUtil::setErrorStatus( ossim_int32 status )
-{
-   m_mutex.lock();
-   m_errorStatus = status;
-   m_mutex.unlock();
-}
-
-omarDataMgrUtil::OmarDataMgrUtilService omarDataMgrUtil::getService() const
-{
-   omarDataMgrUtil::OmarDataMgrUtilService service = omarDataMgrUtil::UNKNOWN;
-   
-   std::string value = m_kwl->findKey( SERVICE_KW );
-   if ( value.size() )
-   {
-      ossimString s = value;
-      s.downcase();
-
-      if ( s == "add" )
-      {
-         service = omarDataMgrUtil::ADD_RASTER;
-      }
-      else if ( (s == "remove") || (s == "rm") || (s == "delete") || (s == "erase") )
-      {
-         service = omarDataMgrUtil::REMOVE_RASTER;
-      }
-   }
-
-   return service;
-}
-
-void omarDataMgrUtil::getService(std::string& serviceString) const
-{
-   omarDataMgrUtil::OmarDataMgrUtilService service = getService();
-   
-   if ( service == omarDataMgrUtil::ADD_RASTER )
-   {
-      serviceString = "/dataManager/addRaster";
-   }
-   else if ( service == omarDataMgrUtil::REMOVE_RASTER )
-   {
-      serviceString = "/dataManager/removeRaster";
-   }
-   else
-   {
-      serviceString.clear();
-   }
-}
-
-void omarDataMgrUtil::getUrl( std::string& url ) const
-{
-   url = m_kwl->findKey( URL_KW );
-   if ( url.empty() )
-   {
-      url = "http://localhost:8080/omar"; // default url
-   }
-}
-
-bool omarDataMgrUtil::callAddRasterService( const ossimFilename& file )
-{
-   static const char M[] = "omarDataMgrUtil::callAddRasterService";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "\nfile:    " << file << "\n";
-   }
-   
-   bool result = false;
-
-   // Must be able to open:
-   m_mutex.lock();
-   ossimRefPtr<ossimImageHandler> ih =
-      ossimImageHandlerRegistry::instance()->open(file, true, true);
-   m_mutex.unlock();
-   
-   if ( ih.valid() && !ih->hasError() )
-   {
-      if ( isDirectoryBasedImage( ih.get() ) )
-      {
-         // Tell the walker not to recurse this directory.
-         m_mutex.lock();
-         m_fileWalker->setRecurseFlag(false);
-         m_mutex.unlock();
-      }
-            
-      // Must have geometry:
-      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-      if( geom.valid() )
-      {
-         // Geometry object must have a valid projection:
-         ossimRefPtr<ossimProjection> proj = geom->getProjection();
-         if ( proj.valid() )
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "Processing file: " << file << std::endl;
-
-            if( m_imageUtil.valid() )
-            {
-               m_imageUtil->processFile(file);
-            }
-            
-            std::string service;
-            getService( service );
-            
-            std::string url;
-            getUrl( url );
-            
-            if ( service.size() && url.size() )
-            {
-               CURL* curl = curl_easy_init();
-               if ( curl )
-               {
-                  // Data for POST:
-                  std::string data = std::string("filename=") + file.string();
-                  curl_easy_setopt( curl, CURLOPT_POSTFIELDS, data.c_str() );
-                  
-                  // Create the URL string:
-                  std::string urlString = url + service;
-                  curl_easy_setopt( curl, CURLOPT_URL, urlString.c_str() );
-                  
-                  ossimNotify(ossimNotifyLevel_INFO)
-                     << "data: " << data 
-                     << "\nurl: " << urlString.c_str()
-                     << std::endl;
-                  
-                  // Tell libcurl to follow redirection
-                  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
-                  
-                  // Run it:
-                  CURLcode res = curl_easy_perform(curl);
-                  
-                  // Check for errors:
-                  if ( res == CURLE_OK )
-                  {
-                     // Response code of the http transaction:
-                     long respcode; 
-                     res = curl_easy_getinfo(curl,CURLINFO_RESPONSE_CODE, &respcode);
-                     if ( res == CURLE_OK )
-                     {
-                        if ( respcode == 200 ) //  OK 200 "The request was fulfilled."
-                        {
-                           result = true; // Set return status for caller.
-                        }
-                     }
-                  }
-                  else
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << "curl_easy_perform() failed: \n"
-                        << curl_easy_strerror(res)
-                        << std::endl;
-                     setErrorStatus( (ossim_int32)res );
-                  }
-                  
-                  ossimNotify(ossimNotifyLevel_WARN) << std::endl;
-                  
-                  // Always cleanup:
-                  curl_easy_cleanup(curl);
-               }
-               
-               // Cleanup curl:
-               curl_global_cleanup();
-            
-            } // Matches: if ( url.size() )
-
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << M << "\nCould create projection for: " << file << std::endl;
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << M << "\nCould create geometry for: " << file << std::endl;
-      }  
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << M << "\nCould not open: " << file << std::endl;
-   }
-   
-   if(traceDebug())
-   {
-      // Since ossimFileWalker is threaded output the file so we know which job exited.
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
-   }
-   
-   return result;
-   
-} // End: omarDataMgrUtil::callAddRasterService( file )
-
-bool omarDataMgrUtil::callRemoveRasterService( const ossimFilename& file )
-{
-   static const char M[] = "omarDataMgrUtil::callRemoveRasterService";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "\nfile:    " << file << "\n";
-   }
-   
-   bool result = false;
-   
-   std::string service;
-   getService( service );
-   
-   std::string url;
-   getUrl( url );
-   
-   if ( service.size() && url.size() )
-   {
-      CURL* curl = curl_easy_init();
-      if ( curl )
-      {
-         // Data for POST:
-         std::string data = std::string("filename=") + file.string();
-         curl_easy_setopt( curl, CURLOPT_POSTFIELDS, data.c_str() );
-         
-         // Create the URL string:
-         std::string urlString = url + service;
-         curl_easy_setopt( curl, CURLOPT_URL, urlString.c_str() );
-         
-         ossimNotify(ossimNotifyLevel_INFO)
-            << "data: " << data 
-            << "\nurl: " << urlString.c_str()
-            << std::endl;
-         
-         // Tell libcurl to follow redirection
-         curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
-         
-         // Run it:
-         CURLcode res = curl_easy_perform(curl);
-         
-         // Check for errors:
-         if ( res == CURLE_OK )
-         {
-            // Response code of the http transaction:
-            long respcode; 
-            res = curl_easy_getinfo(curl,CURLINFO_RESPONSE_CODE, &respcode);
-            if ( res == CURLE_OK )
-            {
-               if ( respcode == 200 ) //  OK 200 "The request was fulfilled."
-               {
-                  result = true; // Set return status for caller.
-
-                  // Check for clean flag:
-                  if ( getCleanFlag() )
-                  {
-                     clean( file );
-                  }
-               }
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "curl_easy_perform() failed: \n"
-               << curl_easy_strerror(res)
-               << std::endl;
-            setErrorStatus( (ossim_int32)res );
-         }
-         
-         ossimNotify(ossimNotifyLevel_WARN) << std::endl;
-         
-         // Always cleanup:
-         curl_easy_cleanup(curl);
-      }
-      
-      // Cleanup curl:
-      curl_global_cleanup();
-      
-   } // Matches: if ( service.size() )
-   
-   if(traceDebug())
-   {
-      // Since ossimFileWalker is threaded output the file so we know which job exited.
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
-   }
-   
-   return result;
-      
-} // End: omarDataMgrUtil::callRemoveRasterService( file, clean )
-
-
-void omarDataMgrUtil::clean( const ossimFilename& file ) const
-{
-   // Remove files from disk:
-   ossimFilename f = file;
-   
-   // Base image file:
-   if ( f.exists() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << "Removing file: " << f << "\n";
-      ossimFilename::remove( f );
-   }
-   
-   // Overview:
-   ossimString e = "ovr";
-   f.setExtension( e );
-   if ( f.exists() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << "Removing file: " << f << "\n";
-      ossimFilename::remove( f );
-   }
-
-   // Histogram:
-   e = "his";
-   f.setExtension( e );
-   if ( f.exists() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << "Removing file: " << f << "\n";
-      ossimFilename::remove( f );
-   }
-   
-   // Omd file:
-   e = "omd";
-   f.setExtension( e );
-   if ( f.exists() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << "Removing file: " << f << "\n";
-      ossimFilename::remove( f );
-   }
-}
-
-bool omarDataMgrUtil::isFiltered(const ossimFilename& file) const
-{
-   bool result = false;
-   if ( file.size() )
-   {
-      // Strip full path to base name.
-      std::string baseName = file.file().string();
-      if ( baseName.size() )
-      {
-         std::vector<std::string>::const_iterator i = m_filteredImages.begin();
-         while ( i != m_filteredImages.end() )
-         {
-            if ( baseName == (*i) )
-            {
-               result = true;
-               break;
-            }
-            ++i;
-         }
-      }
-   }
-#if 0 /* Please leave for debug. (drb) */
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimFileWalker::isFiltered file " << (result?"filtered: ":"not filtered: ")
-         << file << "\n";
-   }
-#endif
-   
-   return result;
-}
-
-bool omarDataMgrUtil::keyIsTrue( const std::string& key ) const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      std::string value = m_kwl->findKey( key );
-      if ( value.size() )
-      {
-         result = ossimString(value).toBool();
-      }
-   }
-   return result;
-}
-
-const std::vector<std::string>& omarDataMgrUtil::getFilteredImages() const
-{
-   return m_filteredImages;
-}
-
-std::vector<std::string>& omarDataMgrUtil::getFilteredImages()
-{
-   return m_filteredImages;
-}
-
-void omarDataMgrUtil::initializeDefaultFilterList()
-{
-   m_mutex.lock();
-
-   // Common images to filter out, put most common first.
-   m_filteredImages.push_back(std::string("icon.jpg"));
-   m_filteredImages.push_back(std::string("logo.jpg"));
-   m_filteredImages.push_back(std::string("preview.jpg"));
-   
-   m_mutex.unlock();
-}
-
-void omarDataMgrUtil::dumpFilteredImageList() const
-{
-   ossimNotify(ossimNotifyLevel_NOTICE) << "Filtered image list:\n";
-
-   std::vector<std::string>::const_iterator i = m_filteredImages.begin();
-   while ( i != m_filteredImages.end() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << (*i) << "\n";
-      ++i;
-   }
-
-   ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
-}
-
-void omarDataMgrUtil::setDumpFilteredImageListFlag( bool flag )
-{
-   // Add this for hasRequiredOverview method.
-   std::string key   = DUMP_FILTERED_IMAGES_KW;
-   std::string value = ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-}
-
-bool omarDataMgrUtil::getDumpFilterImagesFlag() const
-{
-   return keyIsTrue( DUMP_FILTERED_IMAGES_KW );
-}
-
-bool omarDataMgrUtil::getCleanFlag() const
-{
-   return keyIsTrue( CLEAN_KW );
-}
-
-void omarDataMgrUtil::setOverrideFilteredImagesFlag( bool flag )
-{
-   std::string key   = OVERRIDE_FILTERED_IMAGES_KW;
-   std::string value = ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-}
-
-bool omarDataMgrUtil::getOverrideFilteredImagesFlag() const
-{
-   return keyIsTrue( OVERRIDE_FILTERED_IMAGES_KW );
-}
diff --git a/ossim/src/apps/curl_apps/omarDataMgrUtil.h b/ossim/src/apps/curl_apps/omarDataMgrUtil.h
deleted file mode 100644
index 918678e..0000000
--- a/ossim/src/apps/curl_apps/omarDataMgrUtil.h
+++ /dev/null
@@ -1,269 +0,0 @@
-//----------------------------------------------------------------------------
-// File: omarDataMgrUtil.h
-// 
-// License: See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: omarDataMgrUtil
-//
-// See class descriptions below for more.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#ifndef omarDataMgrUtil_HEADER
-#define omarDataMgrUtil_HEADER 1
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFileProcessorInterface.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/util/ossimImageUtil.h>
-
-#include <OpenThreads/Mutex>
-#include <ostream>
-#include <vector>
-
-class ossimArgumentParser;
-class ossimFileWalker;
-class ossimGpt;
-class ossimImageHandler;
-class ossimPropertyInterface;
-
-/**
- * @brief omarDataMgrUtil class.
- *
- * Utility class for processing images recursively and calling OMAR
- * dataManager services upon successful open.
- */
-class omarDataMgrUtil :
-   public ossimReferenced, public ossimFileProcessorInterface
-{
-public:
-
-   enum OmarDataMgrUtilService
-   {
-      UNKNOWN       = 0,
-      ADD_RASTER    = 1,
-      REMOVE_RASTER = 2
-   };
-   
-   /** default constructor */
-   omarDataMgrUtil();
-
-   /** virtual destructor */
-   virtual ~omarDataMgrUtil();
-
-   /**
-    * @brief Adds application arguments to the argument parser.
-    * @param ap Parser to add to.
-    */
-   void addArguments(ossimArgumentParser& ap);
-
-   /**
-    * @brief Initial method.
-    *
-    * Typically called from application prior to execute.  This parses
-    * all options and put in keyword list m_kwl.
-    * 
-    * @param ap Arg parser to initialize from.
-    *
-    * @return true, indicating process should continue with execute.
-    */
-   bool initialize(ossimArgumentParser& ap);
-
-   /**
-    * @brief Execute method.
-    *
-    * This launches file walking mechanism.
-    *
-    * @return int, 0 = good, non-zero something happened.  Because this can
-    * process multiple files a non-zero return may indicate just one file
-    * did not complete, e.g. building overviews.
-    * 
-    * @note Throws ossimException on error.
-    */
-   ossim_int32 execute();
-
-   /**
-    * @brief ProcessFile method.
-    *
-    * Satisfies pure virtual ossimFileProcessorInterface::processFile.
-    *
-    * This method is linked to the ossimFileWalker::walk method via a callback
-    * mechanism.  It is called by the ossimFileWalk (caller).  In turn this
-    * class (callee) calls ossimFileWalker::setRecurseFlag and
-    * ossimFileWalker::setAbortFlag to control the waking process.
-    * 
-    * @param file to process.
-    */
-   virtual void processFile(const ossimFilename& file);
-   
-   /**
-    * @brief Set number of threads to use.
-    *
-    * This is only used in execute method if a directory is given to
-    * application to walk.
-    *
-    * @param threads Defaults to 1 if THREADS_KW is not found.
-    */
-   void setNumberOfThreads( ossim_uint32 threads );
-   void setNumberOfThreads( const std::string& threads );
-
-   /** @return The list of filtered out files. */
-   const std::vector<std::string>& getFilteredImages() const;
-
-   /**
-    * @brief Non const method to allow access for
-    * adding or deleting extensions from the list.
-    *
-    * The list is used by the private isFiltered method to avoid trying to
-    * process unwanted files.
-    */
-   std::vector<std::string>& getFilteredImages();
-
-private:
-
-   /** @return service as enumerated type. */
-   omarDataMgrUtil::OmarDataMgrUtilService getService() const;
-
-   /** @brief Gets service string, e.g. /dataManager/addRaster. */
-   void getService(std::string& serviceString) const;
-
-   /** @brief Gets url string, e.g. http://localhost:8080/omar */
-   void getUrl(std::string& url) const;
-
-   /**
-    * @brief Runs the curl command to call addRaster service.
-    * @param file Image file.
-    * @return true if http status code of 200(OK); else, false
-    */
-   bool callAddRasterService( const ossimFilename& file );
-
-   /**
-    * @brief Runs the curl command to call removeRaster service.
-    * @param file Image file.
-    * @return true if http status code of 200(OK); else, false
-    */
-   bool callRemoveRasterService( const ossimFilename& file );
-
-   /**
-    * @brief Removes files from disk.
-    *
-    * Triggered by the --clean option.
-    * 
-    * Given: 
-    * base file = foo.ntf
-    *
-    * Currently removes:
-    * foo.ntf
-    * foo.ovr
-    * foo.his
-    * foo.omd
-    *
-    * There are no checks for multi-entry images or directory based image
-    * files.
-    */
-   void clean( const ossimFilename& file ) const;
-
-   /**
-    * @brief Convenience method to check file to see is if file should be
-    * processed.
-    *
-    * @param f File to check.
-    * 
-    * @return true if f is in filter list, false if not.
-    */
-   bool isFiltered(const ossimFilename& f) const;
-   
-   /**
-    * @brief Initializes the filter list with a default set of filtered out
-    * file names.
-    */
-   void initializeDefaultFilterList();
-
-   /** @brief Dumps filtered image list to std out. */
-   void dumpFilteredImageList() const;
-   
-   /** @brief Initializes arg parser and outputs usage. */
-   void usage(ossimArgumentParser& ap);
-   
-   /**
-    * @return Threads to use.  Defaults to 1 if THREADS_KW is not found.
-    */
-   ossim_uint32 getNumberOfThreads() const;
-
-   /**
-    * @brief Adds option to m_kwl with mutex lock.
-    * @param key
-    * @param value
-    */
-   void addOption( const std::string& key, ossim_uint32 value );
-   void addOption( const std::string& key, const std::string& value );
-   
-   /**
-    * @brief Sets the m_errorStatus for return on execute.
-    */
-   void setErrorStatus( ossim_int32 status );
-
-   /**
-    * @brief Sets the dump filteredImageList flag.
-    * @param flag
-    */
-   void setDumpFilteredImageListFlag( bool flag );
-   
-   /**
-    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
-    * false.
-    * 
-    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
-    */
-   bool getDumpFilterImagesFlag() const;
-
-   /**
-    * @return true if CLEAN_KW key is found and value is true; else,
-    * false.
-    * 
-    * CLEAN_KW = "clean"
-    */
-   bool getCleanFlag() const;
-
-   /**
-    * @brief Sets the override filtered images flag.
-    * @param flag
-    */
-   void setOverrideFilteredImagesFlag( bool flag );
-   
-   /**
-    * @return true if DUMP_FILTERED_IMAGES_KW key is found and value is true; else,
-    * false.
-    * 
-    * DUMP_FILTERED_IMAGES_KW = "dump_filtered_images"
-    */
-   bool getOverrideFilteredImagesFlag() const;
-
-   /**
-    * @return true if file is a directory based image and the stager should go
-    * on to next directory; false if stager should continue with directory.
-    */
-   bool isDirectoryBasedImage(const ossimImageHandler* ih) const;
-
-   /** @return true if key is set to true; false, if not. */
-   bool keyIsTrue( const std::string& key ) const;
-   
-   /** Holds all options passed into intialize except writer props. */
-   ossimRefPtr<ossimKeywordlist> m_kwl;
-
-   ossimFileWalker*   m_fileWalker;
-   OpenThreads::Mutex m_mutex;
-
-   ossimRefPtr<ossimImageUtil> m_imageUtil;
-   ossim_int32 m_errorStatus;
-
-   /** Hold images we never want to process. */
-   std::vector<std::string> m_filteredImages; 
-};
-
-#endif /* #ifndef omarDataMgrUtil_HEADER */
diff --git a/ossim/src/apps/ossim-adrg-dump/Makefile b/ossim/src/apps/ossim-adrg-dump/Makefile
deleted file mode 100644
index cbed9fb..0000000
--- a/ossim/src/apps/ossim-adrg-dump/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-adrg-dump
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-applanix2ogeom/Makefile b/ossim/src/apps/ossim-applanix2ogeom/Makefile
deleted file mode 100644
index 33869ed..0000000
--- a/ossim/src/apps/ossim-applanix2ogeom/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-applanix2ogeom
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-applanix2ogeom/makefile.vc b/ossim/src/apps/ossim-applanix2ogeom/makefile.vc
deleted file mode 100644
index e34b1cb..0000000
--- a/ossim/src/apps/ossim-applanix2ogeom/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-applanix2ogeom
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp b/ossim/src/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp
deleted file mode 100644
index 08aed70..0000000
--- a/ossim/src/apps/ossim-applanix2ogeom/ossim-applanix2ogeom.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Applinix to ossim geometry.
-// 
-// Application to create an ossim geometry file from Applanix
-// support data files.
-//
-//----------------------------------------------------------------------------
-// $Id: applanix2ogeom.cpp 13025 2008-06-13 17:06:30Z sbortman $
-
-#include <iostream>
-#include <cstdlib>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/support_data/ossimApplanixEOFile.h>
-#include <ossim/projection/ossimApplanixEcefModel.h>
-#include <ossim/projection/ossimApplanixUtmModel.h>
-
-
-static const ossimTrace traceDebug(ossimString("applanix2ogeom:debug"));
-
-bool processImage(ossimApplanixEOFile& eo,
-                  const ossimKeywordlist& kwl,
-                  const ossimString& id,
-                  const ossimFilename& outputDir);
-
-int main(int argc, char* argv[])
-{
-   static const char MODULE[] = "applanix2ogeom";
-
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser argumentParser(&argc, argv);
-   bool outputDirOverrideFlag = false;
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-
-   argumentParser.getApplicationUsage()->setApplicationName(
-      argumentParser.getApplicationName());
-   
-   argumentParser.getApplicationUsage()->setDescription(
-      argumentParser.getApplicationName()+
-      " Creates ossim geometry file from Applannix support data.");
-   
-   argumentParser.getApplicationUsage()->setCommandLineUsage(
-      argumentParser.getApplicationName()+
-      " <camera_file> <exterior_orientation_file> <imageToProcess> <optional_output_directory>");
-
-   argumentParser.getApplicationUsage()->addUsageExplanation(
-      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
-      std::string("camera_file"),
-      std::string("Serial number specific keyword list with camera parameters."));
-   
-   argumentParser.getApplicationUsage()->addUsageExplanation(
-      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
-      std::string("exterior_orientation_file"),
-      std::string("Applanix exterior orientation file."));
-   
-   argumentParser.getApplicationUsage()->addUsageExplanation(
-      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
-      std::string("imageToProcess"),
-      std::string("Image to create geometry for. If not present then all geometries are created"));
-   
-   argumentParser.getApplicationUsage()->addUsageExplanation(
-      ossimApplicationUsage::OSSIM_COMMAND_LINE_OPTION,
-      std::string("option_output_directory"),
-      std::string("Option directory to output geometry file(s) to.  If not set the imageToProcess directory will be used."));
-
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "-h or --help", "Shows help");
-   
-   //---
-   // Extract optional arguments.
-   //---
-   if(argumentParser.read("-h") || argumentParser.read("--help"))
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      exit(0);
-   }
-   
-   argumentParser.reportRemainingOptionsAsUnrecognized();
-   if (argumentParser.errors())
-   {
-      argumentParser.writeErrorMessages(std::cout);
-      exit(1);
-   }
-
-   // cout << "argc:  " << argumentParser.argc() << endl;
-   
-   if(argumentParser.argc() < 4)
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      exit(1);
-   }
-
-//    if(argumentParser.argc() == 4)
-//    {
-//       if(!ossimFilename(argumentParser.argv()[3]).isDir())
-//       {
-//          ossimNotify(ossimNotifyLevel_WARN) << "for the 3 argument option the last argument must be a directory" << std::endl;
-//          exit(0);
-//       }
-//    }
-   ossimFilename cameraFile     = argumentParser.argv()[1];
-   ossimFilename eoFile         = argumentParser.argv()[2];
-   ossimFilename imageToProcess;
-   ossimFilename outputDir;
-   ossim_uint32 maxIdx = argumentParser.argc();
-   if (argumentParser.argc() > 4)
-   {
-      outputDir = argumentParser.argv()[argumentParser.argc()-1];
-
-      if (outputDir.isDir() == false) // doesn't exist
-      {
-         --maxIdx;
-         if (outputDir.createDirectory() == false)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "\nCould not create directory:  " << outputDir
-               << endl;
-            exit(1);
-         }
-      }
-      outputDirOverrideFlag = outputDir.exists();
-   }
-
-   
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG:"
-         << "\ncamera file:       " << cameraFile
-         << "\neo file:           " << eoFile
-         << endl;
-   }
-
-   
-   // Keyword list to pass to model loadState.
-   ossimKeywordlist kwl;
-   // Open up the exterior orientation file.
-   ossimApplanixEOFile eo;
-   if (eo.parseFile(eoFile) == false)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Could not open:  " << eoFile << endl;
-      exit(1);
-   }
-   eo.indexRecordIds();
-
-   if(argc >4)
-   {
-      ossim_uint32 idx = 0;
-      for(idx = 3; idx < maxIdx; ++idx)
-      {
-         kwl.clear();
-         // Add the eo_file keyword to the keyword list.
-         kwl.add("eo_file", eoFile.c_str(), true);
-         
-         // Add the eo_file keyword to the keyword list.
-         kwl.add("camera_file", cameraFile.c_str(), true);
-         kwl.add("compute_gsd_flag", true, true);
-         
-         // See if the ID is in the eo file.
-         imageToProcess = argumentParser.argv()[idx];
-         ossimString id = imageToProcess.fileNoExtension();
-         ossimRefPtr<ossimApplanixEORecord> rec = eo.getRecordGivenId(id);
-         if (!rec)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "applanix2ogeom ERROR:"
-               << "\nMatching id for imageToProcess not found in eo file!"
-               << "\nfile:  " << imageToProcess
-               << "\nid:    " << id
-               << "\nReturning..." << endl;
-            exit(1);
-         }
-         kwl.add("image_id", id, true);
-         if (!outputDirOverrideFlag)
-         {
-            outputDir = imageToProcess.path();
-         }
-         processImage(eo, kwl, id, outputDir);
-      }
-   }
-   else if(argc <=4)
-   {
-      outputDir = argumentParser.argv()[argumentParser.argc()-1];
-
-      if(!outputDir .isDir())
-      {
-         ossimFilename idFile = outputDir.file();
-         outputDir = outputDir.path();
-         idFile = idFile.setExtension("");
-         const ossimRefPtr<ossimApplanixEORecord> rec = eo.getRecordGivenId(idFile);
-         
-         if(rec.valid())
-         {
-            // Add the eo_file keyword to the keyword list.
-            kwl.add("eo_file", eoFile.c_str(), true);
-            kwl.add("eo_id", idFile.c_str(), true);
-            
-            // Add the eo_file keyword to the keyword list.
-            kwl.add("camera_file", cameraFile.c_str(), true);
-            kwl.add("compute_gsd_flag", true, true);
-            
-            processImage(eo, kwl, idFile, outputDir);
-         }
-      }
-      else
-      {
-         ossim_uint32 idx = 0;
-         ossim_uint32 nRecords = eo.getNumberOfRecords();
-         ossim_int32 idIdx = eo.getFieldIdx("ID");
-         if(idIdx >= 0)
-         {
-            for(idx = 0; idx < nRecords; ++idx)
-            {
-               const ossimRefPtr<ossimApplanixEORecord> rec = eo.getRecord(idx);
-               
-               if(rec.valid())
-               {
-                  ossimString id = (*rec)[idIdx];
-                  // Add the eo_file keyword to the keyword list.
-                  kwl.add("eo_file", eoFile.c_str(), true);
-                  kwl.add("eo_id", id.c_str(), true);
-                  
-                  // Add the eo_file keyword to the keyword list.
-                  kwl.add("camera_file", cameraFile.c_str(), true);
-                  kwl.add("compute_gsd_flag", true, true);
-                  
-                  processImage(eo, kwl, id, outputDir);
-               }
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "NO ID RECORD FOUND!!" << std::endl;
-            exit(0);
-         }
-      }
-   }
-   
-   
-   return 0;
-}
-
-bool processImage(ossimApplanixEOFile& eo,
-                  const ossimKeywordlist& kwl,
-                  const ossimString& id,
-                  const ossimFilename& outputDir)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "applanix2ogeom:processImage DEBUG:"
-         << "\nkwl:\n"
-         << kwl
-         << endl;
-   }
-
-//   ossimRefPtr<ossimApplanixEcefModel> model = new ossimApplanixEcefModel;
-   ossimRefPtr<ossimProjection> model;
-
-   if(eo.isUtmFrame())
-   {
-      model = new ossimApplanixUtmModel;
-   }
-   else
-   {
-     model = new ossimApplanixEcefModel;
-   }
-   if (model->loadState(kwl) == false)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "applanix2ogeom:processImage ERROR:"
-         << "\nossimApplanixEcefModel::loadState failded for id:  "
-         << id
-         << endl;
-      return false;
-   }
-      
-   ossimFilename geomFile = id;
-   geomFile.setExtension(ossimString(".geom"));
-   if (outputDir != ossimFilename::NIL)
-   {
-      geomFile = outputDir.dirCat(geomFile);
-   }
-
-   ossimKeywordlist geomKwl;
-   model->saveState(geomKwl);
-
-   if (geomKwl.write(geomFile.c_str()) == false)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "applanix2ogeom:processImage ERROR:"
-         << "\nCould not write file:  " << geomFile << endl;
-      return false;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "Wrote file:  " << geomFile << endl;
-   }
-   return true;
-}
-
diff --git a/ossim/src/apps/ossim-autreg/ossim-autreg.cpp b/ossim/src/apps/ossim-autreg/ossim-autreg.cpp
deleted file mode 100644
index a511284..0000000
--- a/ossim/src/apps/ossim-autreg/ossim-autreg.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-autreg.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Hicks
-//
-// Description: Autonomous registration.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/util/ossimAutRegUtil.h>
-
-#include <vector>
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <ctime>
-#include <cstdlib>
-
-
-using namespace std;
-
-static ossimTrace traceDebug = ossimTrace("ossim-autreg:debug");
-
-
-int main(int argc, char *argv[])
-{
-   // Start the timer.
-   ossimTimer::instance()->setStartTick();
-
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   int originalArgCount = argc;
-   
-   ossimArgumentParser ap(&argc, argv);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   //---
-   // Avoid going on if a global option was consumed by ossimInit::initialize
-   // like -V or --version option and the arg count is down to 1.
-   //---
-   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
-   {
-
-      ossimRefPtr<ossimAutRegUtil> autreg = new ossimAutRegUtil;
-
-      try
-      {      
-         //---
-         // NOTE: ossimAutRegUtil::initialize handles the application usage which will
-         // false, to end things if certain options (e.g. "--help") are provided.
-         //
-         // ossimAutRegUtil::initialize can throw an exception.
-         //---
-         bool goAhead = autreg->initialize(ap);
-         if (goAhead)
-         {      
-            // ossimAutRegUtil::execute can throw an excepion.
-            autreg->execute();
-            
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "elapsed time in seconds: "
-               << std::setiosflags(ios::fixed)
-               << std::setprecision(3)
-               << ossimTimer::instance()->time_s() << endl;
-         }
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         exit(1);
-      }
-      
-   } // End: if ( ( ap.argc() > 1 ) ...
-
-   exit(0);
-   
-} // End of main...
-
diff --git a/ossim/src/apps/ossim-band-merge/Makefile b/ossim/src/apps/ossim-band-merge/Makefile
deleted file mode 100644
index c77e20c..0000000
--- a/ossim/src/apps/ossim-band-merge/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-PROGRAM=ossim-band-merge
-
-include ../../../makeprog.mak
-
-
diff --git a/ossim/src/apps/ossim-band-merge/makefile.vc b/ossim/src/apps/ossim-band-merge/makefile.vc
deleted file mode 100644
index 64c339a..0000000
--- a/ossim/src/apps/ossim-band-merge/makefile.vc
+++ /dev/null
@@ -1,9 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-band-merge
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-band-merge/ossim-band-merge.cpp b/ossim/src/apps/ossim-band-merge/ossim-band-merge.cpp
deleted file mode 100644
index d55cd2d..0000000
--- a/ossim/src/apps/ossim-band-merge/ossim-band-merge.cpp
+++ /dev/null
@@ -1,327 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Ken Melero
-//
-// Merges input images together into output image.  Images must be of
-// same scalar type and same number of bands.  If image width is different
-// output image will be expanded to the largest input image width.
-//
-//*******************************************************************
-//  $Id: band_merge.cpp 10695 2007-04-12 13:56:50Z gpotts $
-
-#include <ossim/imaging/ossimJpegWriter.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimImageTypeLut.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactory.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimBandMergeSource.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <iostream>
-#include <exception>
-static ossimTrace traceDebug("band_merge:main");
-
-static void usage();
-static void outputWriterTypes();
-
-int main(int argc, char* argv[])
-{
-   static const char MODULE[] = "band_merge:main";
-
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
- 
-   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" merges band separate images to one image");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-o or --create-overiew", "Creates and overview for the output image");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-w or --tile-width", "Defines the tile width for the handlers that support tiled output");
-   
-   if (traceDebug()) CLOG << " Entered..." << std::endl;
-
-   if (argumentParser.read("-h") ||
-       argumentParser.read("--help")||(argumentParser.argc() < 2))
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      usage(); // for writer output types
-      exit(0);
-   }
-
-   // Keyword list to initialize image writers with.
-   ossimKeywordlist kwl;
-   const char* PREFIX = "imagewriter.";
-
-   ossim_uint32 tile_width = 32;
-   bool create_overview = false;
-
-   if (argumentParser.read("-o") || argumentParser.read("--crate-overview"))
-   {
-      create_overview = true;
-      std::cout << "\nOutput overview building enabled." << std::endl;
-   }
-
-   if (argumentParser.read("-w", stringParam) ||
-       argumentParser.read("-tile-width", stringParam))
-   {
-      tile_width = ossimString(tempString).toInt();
-      if ((tile_width % 16) != 0)
-      {
-         cerr << MODULE << " NOTICE:"
-              << "\nTile width must be a multiple of 16!"
-              << "\nDefaulting to 128"
-              << std::endl;
-         tile_width = 0;
-      }
-      std::cout << "Tile width set to:  " << tile_width << std::endl;
-   }
-   
-   argumentParser.reportRemainingOptionsAsUnrecognized();
-   
-   // Three required args:  output_type, input file, and output file.
-   if (argumentParser.errors())
-   {
-      argumentParser.writeErrorMessages(std::cout);
-      exit(0);
-   }
-   if (argumentParser.argc() == 1)
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      usage(); // for writer output types
-      exit(0);
-   }
-   
-   ossim_uint32 number_of_source_images = argumentParser.argc() - 3;
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nargc:  " << argumentParser.argc()
-           << "\nnumber_of_source_images:  " << number_of_source_images
-           << "\ntile_width:  " << tile_width
-           << "\ncreate_overview:  " << (create_overview?"true":"false")
-           << std::endl;
-   }
-
-   ossimString output_type = argv[1];
-   output_type.downcase();
-   std::cout << "Output type:        " << output_type << std::endl;
-
-   // Create the vector of image handlers.
-   ossimConnectableObject::ConnectableObjectList ihs;
-   for(ossim_uint32 h = 0; h < number_of_source_images; ++h)
-   {
-      ossimFilename f = argv[h + 2];
-      std::cout << "Input_image[" << h << "]:     " << f << std::endl;
-      ihs.push_back(ossimImageHandlerRegistry::instance()->open(f));
-   }
-
-   // Get the output file.
-   ossimFilename output_file = argv[argumentParser.argc() - 1];
-   std::cout << "Output file:        " << output_file << std::endl;   
-
-   //---
-   // Set the output writer type and the image type.
-   //---
-   kwl.add(PREFIX, ossimKeywordNames::TYPE_KW, output_type.c_str());
-
-   ossimRefPtr<ossimBandMergeSource> bm = new ossimBandMergeSource(ihs);
-   ossimRefPtr<ossimImageFileWriter> fileWriter =
-      ossimImageWriterFactoryRegistry::instance()->createWriter(kwl, PREFIX);
-   if(!fileWriter)
-   {
-      bm->disconnect();
-      bm = 0;
-      ossimConnectableObject::ConnectableObjectList::iterator i = ihs.begin();
-      while (i != ihs.end())
-      {
-         (*i)->disconnect();
-         (*i) = 0;
-         ++i;
-      }
-      
-      cerr << "Error making an image writer..."
-           << "\nExiting application..." << std::endl;
-      exit(1);
-   }
-   
-   // Write out a geometry file for new image.
-   ossimKeywordlist bm_geom;
-   ossimRefPtr<ossimImageGeometry> geom = bm->getImageGeometry();
-   geom->saveState(bm_geom);
-   
-   ossimFilename geom_file = output_file;
-   geom_file.setExtension("geom");
-   bm_geom.write(geom_file);
-   
-   fileWriter->connectMyInputTo(0, bm.get());
-   
-   if (tile_width)
-   {
-      // Set the tile size...
-      fileWriter->setTileSize(ossimIpt(tile_width, tile_width));
-   }
-   
-   fileWriter->open(output_file);
-   
-   ossimStdOutProgress prog(2);
-   fileWriter->addListener(&prog);
-   
-   fileWriter->setAreaOfInterest(bm->getBoundingRect());
-
-   if( fileWriter->canCastTo("ossimTiffWriter") )
-   {
-//      ossimTiffWriter* twriter = PTR_CAST(ossimTiffWriter, fileWriter);
-      
-      if(fileWriter.valid())
-      {
-         try
-         {
-            fileWriter->execute();
-         }
-         catch(std::exception& e)
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "band_merge: ERROR exception caught:\n"
-               << e.what()
-               << std::endl;
-         }
-         catch (...)
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "band_merge: ERROR - Unknown exception caught!"
-               << std::endl;
-         }
-      }
-   }
-   else if(fileWriter->canCastTo("ossimJpegWriter"))
-   {
-      ossimRefPtr<ossimScalarRemapper> remapper = NULL;
-      
-      if(PTR_CAST(ossimJpegWriter, fileWriter.get()) &&
-         (bm->getOutputScalarType() != OSSIM_UCHAR))
-      {
-         remapper = new ossimScalarRemapper(bm.get(), OSSIM_UCHAR);
-         remapper->initialize();
-         fileWriter->connectMyInputTo(0, remapper.get());
-      }
-      fileWriter->initialize();
-      try
-      {
-         fileWriter->execute();
-      }
-      catch(std::exception& e)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "band_merge: ERROR exception caught:\n"
-            << e.what()
-            << std::endl;
-      }
-      catch (...)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "band_merge: ERROR - Unknown exception caught!"
-            << std::endl;
-      }
-   }
-   else
-   {
-      try
-      {
-         fileWriter->execute();
-      }
-      catch(std::exception& e)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "band_merge: ERROR exception caught:\n"
-               << e.what()
-               << std::endl;
-         }
-      }
-      catch (...)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "band_merge: ERROR - Unknown exception caught!"
-               << std::endl;
-         }
-      }
-   }
-   
-   if (create_overview == true)
-   {
-      fileWriter->writeOverviewFile();
-   }
-   fileWriter->disconnect();
-   fileWriter = 0;
-   bm = 0;
-   ossimConnectableObject::ConnectableObjectList::iterator it = ihs.begin();
-   while (it != ihs.end())
-   {
-      (*it)->disconnect();
-      (*it) = 0;
-      ++it;
-   }
-
-   exit(0);
-}
-
-void usage()
-{
-   std::cout
-      << "band_merge: Band Merge\n"
-      << "Usage:\n"
-      << "band_merge [-h][-o][-w tile_width] <output_type> <input_file1> "
-      << "<input_file2> ... <output_file>"
-      << "\n\nOptional argument list:"
-      << "\n -h  -- display Usage/Help"
-      << "\n -o  -- create an ossim overview file with output file"
-      << "\n -w  -- tile width (default = 32)"
-      << "\n"
-      << "\nNOTES:"
-      << "\n\"-w\" option only valid with tiff type."
-      << "\n\"Tile width must be a multiple of 32."
-      << "\nValid output writer types:"
-      << "\n";
-   
-   outputWriterTypes();
-}
-
-void outputWriterTypes()
-{
-   ossimImageTypeLut lut;
-
-   ossim_uint32 index = 0;
-   ossimString type = lut.getTableIndexString(index);
-   
-   while (type.size())
-   {
-      std::cout << "\t" << type << std::endl;
-      ++index;
-      type = lut.getTableIndexString(index);
-   }
-   std::cout << std::endl;
-}
-
diff --git a/ossim/src/apps/ossim-batch-test/CMakeLists.txt b/ossim/src/apps/ossim-batch-test/CMakeLists.txt
deleted file mode 100644
index db78d05..0000000
--- a/ossim/src/apps/ossim-batch-test/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
-OSSIM_SETUP_APPLICATION(ossim-batch-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/ossim/src/apps/ossim-batch-test/ossim-batch-test.cpp b/ossim/src/apps/ossim-batch-test/ossim-batch-test.cpp
deleted file mode 100644
index 81e2be6..0000000
--- a/ossim/src/apps/ossim-batch-test/ossim-batch-test.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File ossim-batch-test.cpp
-// 
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Oscar Kramer
-//
-// Description: Test code application ossim batch test.
-//
-//----------------------------------------------------------------------------
-// $Id: ossim-batch-test.cpp 20675 2012-03-10 16:30:04Z dburken $
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/util/ossimBatchTest.h>
-#include <ossim/init/ossimInit.h>
-
-//**************************************************************************************************
-// MAIN MODULE
-// See ossimBatchTest.cpp for usage, or run executable with no args for usage.
-// Returns:
-//   -1 if any error occurred during test
-//    1 if any test failed
-//    0 if all tests passed
-//**************************************************************************************************
-int main(int argc, char *argv[])
-{
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-
-   int return_status = 0;
-   ossimBatchTest obt;
-   if (!obt.initialize(ap))
-   {
-      return_status = -1;
-   }
-   else
-   {
-      ossim_uint8 status = obt.execute();
-      
-      // Bitwise and ops to isolate status bits (see ossimBatchTest.h for bit definitions)
-      if (status == ossimBatchTest::TEST_TBD)
-         return_status = -1; // nothing was done
-      else if (status & ossimBatchTest::TEST_ERROR)
-         return_status = -1; // an error occurred running a command
-      else if (status & ossimBatchTest::TEST_FAILED)
-         return_status = 1;  // A test failed post-processing (diff)
-      else
-         return_status = 0;  // Everything passed
-   }
-
-   return return_status;
-}
-
diff --git a/ossim/src/apps/ossim-btoa/Makefile b/ossim/src/apps/ossim-btoa/Makefile
deleted file mode 100644
index cb03cdf..0000000
--- a/ossim/src/apps/ossim-btoa/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-btoa
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-btoa/makefile.vc b/ossim/src/apps/ossim-btoa/makefile.vc
deleted file mode 100644
index 7d3703a..0000000
--- a/ossim/src/apps/ossim-btoa/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 15118 2009-08-22 15:20:13Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-btoa
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-chgkwval/Makefile b/ossim/src/apps/ossim-chgkwval/Makefile
deleted file mode 100644
index 9beb7fe..0000000
--- a/ossim/src/apps/ossim-chgkwval/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-chgkwval
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-chgkwval/makefile.vc b/ossim/src/apps/ossim-chgkwval/makefile.vc
deleted file mode 100644
index 944488c..0000000
--- a/ossim/src/apps/ossim-chgkwval/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id$
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-chgkwval
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-chipper/ossim-chipper.cpp b/ossim/src/apps/ossim-chipper/ossim-chipper.cpp
deleted file mode 100644
index b105220..0000000
--- a/ossim/src/apps/ossim-chipper/ossim-chipper.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-chipper.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Utility class definition for processing digital elevation models(dems).
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/util/ossimChipperUtil.h>
-
-#include <cstdlib> /* for exit */
-#include <iomanip>
-#include <iostream>
-
-using namespace std;
-
-static ossimTrace traceDebug = ossimTrace("ossim-chipper:debug");
-
-int main(int argc, char* argv[])
-{
-   // Start the timer.
-   ossimTimer::instance()->setStartTick();
-
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   int originalArgCount = argc;
-   
-   ossimArgumentParser ap(&argc, argv);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   //---
-   // Avoid going on if a global option was consumed by ossimInit::initialize
-   // like -V or --version option and the arg count is down to 1.
-   //---
-   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
-   {
-      // Make the generator.
-      ossimRefPtr<ossimChipperUtil> chipper = new ossimChipperUtil;
-
-      try
-      {      
-         //---
-         // NOTE: ossimChipperUtil::initialize handles the application usage which will
-         // false, to end things if certain options (e.g. "--help") are provided.
-         //
-         // ossimChipperUtil::initialize can throw an exception.
-         //---
-         bool continue_after_init = chipper->initialize(ap);
-         if (continue_after_init)
-         {      
-            // ossimChipperUtil::execute can throw an excepion.
-            chipper->execute();
-            
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "elapsed time in seconds: "
-               << std::setiosflags(ios::fixed)
-               << std::setprecision(3)
-               << ossimTimer::instance()->time_s() << endl;
-         }
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         exit(1);
-      }
-      
-   } // End: if ( ( ap.argc() > 1 ) ...
-
-   exit(0);
-   
-} // End of main...
-
diff --git a/ossim/src/apps/ossim-cmm/Makefile b/ossim/src/apps/ossim-cmm/Makefile
deleted file mode 100644
index d30888b..0000000
--- a/ossim/src/apps/ossim-cmm/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-cmm
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-cmm/makefile.vc b/ossim/src/apps/ossim-cmm/makefile.vc
deleted file mode 100644
index 80cc752..0000000
--- a/ossim/src/apps/ossim-cmm/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-cmm
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-computeSrtmStats/Makefile b/ossim/src/apps/ossim-computeSrtmStats/Makefile
deleted file mode 100644
index c801731..0000000
--- a/ossim/src/apps/ossim-computeSrtmStats/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-computeSrtmStats
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-computeSrtmStats/makefile.vc b/ossim/src/apps/ossim-computeSrtmStats/makefile.vc
deleted file mode 100644
index f5614d4..0000000
--- a/ossim/src/apps/ossim-computeSrtmStats/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-computeSrtmStats
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-computeSrtmStats/ossim-computeSrtmStats.cpp b/ossim/src/apps/ossim-computeSrtmStats/ossim-computeSrtmStats.cpp
deleted file mode 100644
index af2d523..0000000
--- a/ossim/src/apps/ossim-computeSrtmStats/ossim-computeSrtmStats.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-//**************************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Written by:   David Burken
-// 
-// Description:  This program will open an srtm file.  Compute statistics,
-// then write a ossim meta data (omd) file.
-//
-//**************************************************************************
-// $Id: computeSrtmStats.cpp 13025 2008-06-13 17:06:30Z sbortman $
-
-#include <vector>
-#include <cstdlib>
-#include <fstream>
-#include <iostream>
-#include <iterator>
-
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/support_data/ossimSrtmSupportData.h>
-
-static const ossimTrace traceDebug(ossimString("computeStrmStats:debug"));
-
-static void usage()
-{
-   ossimNotify(ossimNotifyLevel_INFO)
-      << "\nNOTES:"
-      << "\n- Output is to a \".omd\" file so if the image was"
-      << " \"N27W081.hgt\" ouput will be a \"N27W081.omd\" file."
-      << "\n- Example:  computeSrtmStats *.hgt"
-      << endl;
-}
-
-int main(int argc, char* argv[])
-{
-   ossimString tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-
-   // Set the app name.
-   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-
-   // Set usage option.
-   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
-
-   // Usage...
-   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" <srtm_file>\n");
-   
-   if (argumentParser.read("-h") ||
-       argumentParser.read("--help")||(argumentParser.argc() < 2))
-   {
-      argumentParser.getApplicationUsage()->
-         write(ossimNotify(ossimNotifyLevel_WARN));
-      usage();
-      exit(0);
-   }
-   
-   argumentParser.reportRemainingOptionsAsUnrecognized();
-
-   if(argc == 1)
-   {
-      argumentParser.getApplicationUsage()->
-         write(ossimNotify(ossimNotifyLevel_WARN));
-      usage();
-      exit(1);
-   }
-
-   // Default variables
-
-   ossim_uint32 fileCount = argc - 1;
-   
-   ossim_uint32 idx = 1;
-   for(idx = 1; idx <= fileCount; ++idx)
-   {
-      // Get the srtm file name.
-      ossimFilename srtmFile(argv[idx]);
-
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "Processing srtm file:  " << srtmFile << endl;
-
-      ossimSrtmSupportData ss;
-      if (ss.setFilename(srtmFile, true) == true)
-      {
-         ossimFilename omdFile = srtmFile;
-         omdFile.setExtension(ossimString("omd"));
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "Wrote file:            " << omdFile.c_str() << std::endl;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Error processing:      " << srtmFile.c_str() << std::endl;
-      }
-      
-   } // End of loop through file...
-
-   return 0;
-}
diff --git a/ossim/src/apps/ossim-correl/Makefile b/ossim/src/apps/ossim-correl/Makefile
deleted file mode 100644
index 6a7c6c4..0000000
--- a/ossim/src/apps/ossim-correl/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-correl
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-correl/makefile.vc b/ossim/src/apps/ossim-correl/makefile.vc
deleted file mode 100644
index 4a0e148..0000000
--- a/ossim/src/apps/ossim-correl/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-correl
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-create-cg/Makefile b/ossim/src/apps/ossim-create-cg/Makefile
deleted file mode 100644
index e3a0f8d..0000000
--- a/ossim/src/apps/ossim-create-cg/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-create-cg
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-create-cg/makefile.vc b/ossim/src/apps/ossim-create-cg/makefile.vc
deleted file mode 100644
index 0dc4260..0000000
--- a/ossim/src/apps/ossim-create-cg/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-create-cg
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-create-cg/ossim-create-cg.cpp b/ossim/src/apps/ossim-create-cg/ossim-create-cg.cpp
deleted file mode 100644
index a0dad7b..0000000
--- a/ossim/src/apps/ossim-create-cg/ossim-create-cg.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains application definition "create_cg" app.
-//
-// It takes an image filename as input and creates a course grid model.
-//
-//*******************************************************************
-//  $Id$
-
-#include <ossim/ossimConfig.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimCoarseGridModel.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-
-int main(int argc, char *argv[])
-{
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   int originalArgCount = argc;
-   
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-   
-   if ( (argumentParser.argc() == 1) && (originalArgCount > 1) )
-   {
-      exit(0); // ossimInit consumed all options.
-   }
-
-   ossimString appname = argumentParser.getApplicationName();
-   ossimApplicationUsage* appuse = argumentParser.getApplicationUsage();
-   appuse->setApplicationName(appname);
-   appuse->setDescription(appname+" Creates OSSIM coarse grid geometry from rigorous sensor model.");
-   appuse->setCommandLineUsage(appname+" [options] <image_file>");
-   
-   appuse->addCommandLineOption("-d or --support", 
-      "<geom_path> -- Specifies a supplementary directory path to contain the geom and associated "
-      "grid files. The default is to use the image directory.");
-
-   appuse->addCommandLineOption("-e", 
-      "<error> -- default is 0.1.  This is the maximum difference tolerated in pixels between the "
-      "rigorous model and the computed coarse grid. The smaller this value, the bigger the "
-      "resulting grid.");
-
-   appuse->addCommandLineOption("-s",
-      "<min_line_sample_spacing> -- Specifies the min line sample spacing for the coarse grid. "
-      "Helps in converging. Basically will stop splitting if number of pixels per grid cell gets "
-      "below this number.");
-
-   appuse->addCommandLineOption("-o", 
-      "<base_out_name> -- Specifies a new base output name for the geom and associated grid files. "
-      "The default is to use the base name of the image file with .geom and .ocg extensions. "
-      "If specified then the output is <base_out_name>.geom and <base_out_name>.ocg where the "
-      ".ocg contains the coarse grid data. THIS IS NOT COMMON AND MAY PREVENT OSSIM FROM "
-      "SUBSEQUENTLY LOCATING THE GEOMETRY FILE.");
-
-   appuse->addCommandLineOption("-h or --help", "Shows help");
-
-   if(argumentParser.read("-h") || argumentParser.read("--help") || (argc < 2))
-   {
-      appuse->write(std::cout);
-      exit(0);
-   }
-   
-   // The last argument is always the image filename:
-   ossimFilename image_file = argv[argc-1];
-   
-   double error = 0.1;
-   if(argumentParser.read("-e", error))
-   {
-      if (error < 0.0)
-         error = 0.1;
-   }
-
-   ossim_int32 minSpacing = 100;
-   if(argumentParser.read("-s", minSpacing))
-   {
-      if (minSpacing < 1)
-         minSpacing = 100;
-   }
-   
-   ossimFilename outputBaseName;
-   argumentParser.read("-o", outputBaseName.string());
-
-   ossimFilename outputPath;
-   argumentParser.read("-d", outputPath.string());
-   if (outputPath.empty())
-   {
-      argumentParser.read("--support", outputPath);
-      if (outputPath.empty())
-         outputPath = image_file.path();
-   }
-
-   // Establish image handler for access to rigorous model:
-   ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(image_file);
-   if (ih.valid())
-   {
-      // Instantiate the rigorous model:
-      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-      if(geom.valid() && geom->getProjection())
-      {
-         // Compute the coarse grid:
-         ossimRefPtr<ossimCoarseGridModel> cg = new ossimCoarseGridModel;
-         cg->setInterpolationError(error);
-         cg->setMinGridSpacing(minSpacing);
-         ossimNotify(ossimNotifyLevel_NOTICE)<<"\nComputing coarse grid..."<<endl;
-         cg->buildGrid(ih->getBoundingRect(), geom.get());
-
-         // If no basename was provided, use the defaults for geom file. PREFERRED:
-         if (outputBaseName.empty())
-            outputBaseName = ih->createDefaultGeometryFilename().file();
-
-         // Save the coarse grid to appropriate location:
-         ossimFilename filename (outputPath.dirCat(outputBaseName));
-         filename.expand();
-         ossimNotify(ossimNotifyLevel_NOTICE)<<"\nSaving OCG grid and geometry to <"
-            <<filename.path()<<">..."<<endl;
-         cg->saveCoarseGrid(filename); // this saves geom file as well
-      }
-   }
-
-   return 0;
-}
-
diff --git a/ossim/src/apps/ossim-create-histo/Makefile b/ossim/src/apps/ossim-create-histo/Makefile
deleted file mode 100644
index dbce1b5..0000000
--- a/ossim/src/apps/ossim-create-histo/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-create-histo
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-create-histo/makefile.vc b/ossim/src/apps/ossim-create-histo/makefile.vc
deleted file mode 100644
index 2544988..0000000
--- a/ossim/src/apps/ossim-create-histo/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-create-histo
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-create-histo/ossim-create-histo.cpp b/ossim/src/apps/ossim-create-histo/ossim-create-histo.cpp
deleted file mode 100644
index 19532c9..0000000
--- a/ossim/src/apps/ossim-create-histo/ossim-create-histo.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-//*******************************************************************
-//  $Id: create_histo.cpp 11743 2007-09-19 19:57:31Z gpotts $
-
-
-#include <ossim/ossimConfig.h>
-
-#include <iostream>
-#include <vector>
-#include <algorithm>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-
-
-void usage()
-{
-   cout << "examples:\n"
-	<< " create_histo foo.tif\n"
-	<< "            Will create a histogram for the input image and call\n"
-	<< "            it foo.his\n\n"
-        << " create_histo -i foo.tif -o foo.his\n"
-        << "            this will compute a histogram from the input foo.tif\n"
-        << "            and write it to foo.his\n\n"
-        << " create_histo -p foo2.his -o foo.his\n"
-        << "            will import the proprietary histogram file and output\n"
-        << "            an ossim histogram file to foo.his\n\n"
-        << "NOTE:  If no output is given it will default to output.his\n"
-        << "       unless the special case of a single input image is given\n"
-        << endl;
-}
-
-void importHistogram(const ossimString& importFile,
-                     const ossimString&   outputFile)
-{
-   ossimRefPtr<ossimMultiResLevelHistogram> histo      = new ossimMultiResLevelHistogram;
-
-   histo->importHistogram(importFile);
-   ossimKeywordlist kwl;
-   histo->saveState(kwl);
-   kwl.write(outputFile.c_str());
-}
-
-void computeHistogram(const ossimString& imageOption,
-                      const ossimString& outputOption,
-                      ossim_float64 minValueOverride,
-                      ossim_float64 maxValueOverride,
-                      ossim_int32 numberOfBinsOverride,
-                      ossim_int32 entryNumberOverride,
-                      bool fastMode,
-                      int maxResLevels=1)
-{
-   theStdOutProgress.setFlushStreamFlag(true);
-   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(ossimFilename(imageOption));
-   if(handler.valid())
-   {
-      ossimFilename histogramFile;
-      std::vector<ossim_uint32> entryList;
-      handler->getEntryList(entryList);
-
-      if(entryNumberOverride >= 0)
-      {
-         std::vector<ossim_uint32>::iterator iter= std::find(entryList.begin(),
-                                                             entryList.end(),
-                                                             (ossim_uint32)entryNumberOverride);
-
-         if(iter != entryList.end())
-         {
-            entryList.clear();
-            entryList.push_back(entryNumberOverride);
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "Invalid entry number " << entryNumberOverride << " passed in.  Returning...." << std::endl;
-            return;
-         }
-      }
-      ossim_uint32 idx = 0;
-      for(idx = 0; idx < entryList.size(); ++idx)
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)<<"entry " << entryList[idx] << std::endl;
-         handler->setCurrentEntry(entryList[idx]);
-
-         // Check handler to see if it's filtering bands.
-         if ( handler->isBandSelector() )
-         { 
-            // Set output list to input.
-            handler->setOutputToInputBandList();
-         }
-         
-         ossimRefPtr<ossimProperty> histogramFilename = handler->getProperty("histogram_filename");
-         if(histogramFilename.valid())
-         {
-            if (outputOption == "")
-            {
-              histogramFile = ossimFilename(histogramFilename->valueToString());
-            }
-            else
-            {
-              histogramFile = outputOption;
-            }
-            
-            ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
-            ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
-            if(maxResLevels)
-            {
-               histoSource->setMaxNumberOfRLevels(maxResLevels);
-            }
-            else
-            {
-               histoSource->setMaxNumberOfRLevels(handler->getNumberOfDecimationLevels());
-            }
-            if(!ossim::isnan(minValueOverride))
-            {
-               histoSource->setMinValueOverride(minValueOverride);
-            }
-            if(!ossim::isnan(maxValueOverride))
-            {
-               histoSource->setMaxValueOverride(maxValueOverride);
-            }
-            if(numberOfBinsOverride > 0)
-            {
-               histoSource->setNumberOfBinsOverride(numberOfBinsOverride);
-            }
-            if (fastMode)
-            {
-               histoSource->setComputationMode(OSSIM_HISTO_MODE_FAST);
-            }
-            histoSource->connectMyInputTo(0, handler.get());
-            histoSource->enableSource();
-            writer->connectMyInputTo(0, histoSource.get());
-            
-            writer->setFilename(histogramFile);
-            writer->addListener(&theStdOutProgress);
-            writer->execute();
-            writer=0;
-         }
-      }
-   }
-}
-
-int main(int argc, char *argv[])
-{
-   ossimString tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-   
-   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" creates a histogram from image.");
-   
-   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" <args>");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help", "Display this information");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-p", "<histogram_file> Imports imagelinks proprietary histogram_file.");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("-i", "<image_file> Creates a histogram from the image_file.");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("-l", "<res_level> Output the specified number of res levels default is, set to 0 if you want all(not supported for import histogram -i option");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--create-histogram-fast", "Computes a histogram in fast mode which samples partial tiles.");
-   
-   argumentParser.getApplicationUsage()->addCommandLineOption("-o", "<output_file> Output the histogram to the indicated file.");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("--min",  "Minimum value to use");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--max",  "Maximum value to use");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--bins", "Number of bins to use");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--entry", "entry number to use");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption("-f", "fast mode");
-   
-   ossimString importOption;
-   ossimString imageOption;
-   ossimString outputOption;
-   ossim_uint32 maxLevels = 1;
-   ossim_int32 entry = -1;
-   
-   ossim_float64 minValueOverride = ossim::nan();
-   ossim_float64 maxValueOverride = ossim::nan();
-   ossim_int32   numberOfBinsOverride = -1;
-
-   bool fastMode = false;
-   
-   if ( (argumentParser.read("-h")) || (argumentParser.read("--help")) )
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      usage();
-      exit(0);
-    }
-   
-   if (argumentParser.argc() == 2)
-   {
-      ossimFilename inputImage = argv[1];
-      imageOption = inputImage;
-      if(!inputImage.exists())
-      {
-         cerr << "Image does not exist " << inputImage << endl;
-         exit(1);
-      }
-      maxLevels = 1;
-   }
-   else
-   {
-      if(argumentParser.read("--min", stringParam))
-      {
-         minValueOverride = tempString.toDouble();
-      }
-      if(argumentParser.read("--max", stringParam))
-      {
-         maxValueOverride = tempString.toDouble();
-      }
-      if(argumentParser.read("--bins", stringParam))
-      {
-         numberOfBinsOverride = tempString.toInt32();
-      }
-      if(argumentParser.read("--bins", stringParam))
-      {
-         numberOfBinsOverride = tempString.toInt32();
-      }
-      if(argumentParser.read("--entry", stringParam))
-      {
-         entry = tempString.toInt32();
-      }
-
-      if(argumentParser.read("-o", stringParam))
-      {
-         outputOption = tempString;
-      }
-      
-      if ( argumentParser.read("-f") ||
-           argumentParser.read("--create-histogram-fast"))
-      {
-         fastMode = true;
-      }
-
-      if(argumentParser.read("-p", stringParam))
-      {
-         importOption = tempString;
-      }
-      if(argumentParser.read("-l", stringParam))
-      {
-         ossimString s = tempString;
-         maxLevels = s.toUInt32();
-      }
-   }
-
-   if((importOption != "") && (imageOption  != ""))
-   {
-      cout << "you can either import or create a histogram from an image but\n"
-           << "we can't do both" << endl;
-      exit(1);
-   }
-
-   if(importOption != "")
-   {
-      importHistogram(importOption, "");
-   }
-   else if(argc > 1)
-   {
-      ossim_uint32 idx = 1;
-      while(argv[idx])
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            <<"file " << argv[idx] << std::endl;
-
-         computeHistogram(ossimString(argv[idx]), outputOption, minValueOverride, maxValueOverride, numberOfBinsOverride, entry, fastMode, maxLevels);
-         ++idx;
-      }
-   }
-   else
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      usage();
-   }
-
-   return 0;
-}
-
diff --git a/ossim/src/apps/ossim-deg2dms/Makefile b/ossim/src/apps/ossim-deg2dms/Makefile
deleted file mode 100644
index 5a154c7..0000000
--- a/ossim/src/apps/ossim-deg2dms/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-PROGRAM=ossim-deg2dms
-
-include ../../../Makefile.common
-
-CPPSRCS=$(wildcard *.cpp)
-CPPOBJS=$(patsubst %.cpp,%.o,$(CPPSRCS))
-
-OBJS=$(CPPOBJS)
-
-DEPEND_FILES = $(wildcard *.d)
-
-# The binary program extension, if any, including dots (e.g. '.exe')
-PROGRAM_EXT = $(EXEEXT)
-BIN_PROGRAM = $(PROGRAM_PREFIX)$(PROGRAM)$(PROGRAM_EXT)
-
-SRCS      = $(CPPSRCS)
-
-# Pattern rule for objects from .cpp files.
-%.$(OBJEXT): %.cpp
-	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) -c $< -o $@
-
-%.d: %.cpp
-	$(SHELL) -ec '$(CXX) -MM $(CXXFLAGS) $(CDEBUGFLAGS) $< >> $@;'
-
-all:	$(BIN_PROGRAM)
-
-$(BIN_PROGRAM): $(OBJS)
-	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(OBJS) -o $@
-	$(INSTALL_PROGRAM) $(BIN_PROGRAM) $(OSSIM_TOP)/bin
-
-depends: 	$(CPPSRCS:.cpp=.d)
-
-clean_depends:
-	$(RM_NOPROMPT) *.d
-
-clean:
-	$(RM_CMD) $(BIN_PROGRAM)
-
-# Only add the depends if they exist
-#
-ifneq ($(DEPENDS_FILES),)
--include $(DEPENDS_FILES)
-endif
diff --git a/ossim/src/apps/ossim-deg2dms/makefile.vc b/ossim/src/apps/ossim-deg2dms/makefile.vc
deleted file mode 100644
index 59385f3..0000000
--- a/ossim/src/apps/ossim-deg2dms/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-deg2dms
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-deg2dms/ossim-deg2dms.cpp b/ossim/src/apps/ossim-deg2dms/ossim-deg2dms.cpp
deleted file mode 100644
index 01c48aa..0000000
--- a/ossim/src/apps/ossim-deg2dms/ossim-deg2dms.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Application to convert decimal degrees, to degrees, minutes,
-// seconds (DMS).
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <cstdlib>
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <string>
-#include <sstream>
-
-using namespace std;
-
-void getDegrees(double& deg)
-{
-   std::string s;
-   cout << "Enter degrees:  " << flush;
-   cin >> s;
-   if ( (s == "q") || (s == "Q") )
-   {
-      exit(0);
-   }
-   else
-   {
-      istringstream is(s);
-      is >> deg;
-      if( is.fail() )
-      {
-         cerr << "Must enter a valid number between -180 and 180 for degrees."
-              << "  Exiting..." << endl;
-         exit(1);
-      }
-      else if ( (deg < -180.0) || (deg > 180.0) ) // Check the range.
-      {
-         cerr << "Degrees must be between -180 and 180.  Exiting..."
-              << endl;
-         exit(1);
-      }
-   }
-}
-   
-int main(int argc, char* argv[])
-{
-   enum
-   {
-      FOREVER=1
-   };
-
-   if (argc != 1)
-   {
-      cout << "Usage: " << argv[0]
-           << "\nThis application will convert decimal degrees to degrees, "
-           << "minutes, seconds.\nIt take no arguments, you will be prompted "
-           << "for the decimal degrees.\n" << endl;
-      return 0;
-   }
-   
-   cout << "\nEnter \"q\" to quit.\n\n";
-
-   double deg = 0.0;
-   double min = 0.0;
-   double sec = 0.0;
-   int degInt = 0;
-   int minInt = 0;
-
-   cout << setiosflags(ios::fixed) << setprecision(15);
-
-   while (FOREVER)
-   {
-      // Get the degrees.
-      getDegrees(deg);
-
-      // Compute the answer.
-      
-      bool isNegative = (deg < 0.0);
-
-      if (isNegative)
-      {
-         deg = fabs(deg);
-      }
-
-      degInt = static_cast<int>(deg);
-      
-      min = (deg - degInt) * 60.0;
-
-      minInt = static_cast<int>(min);
-      
-      sec = (min - minInt) * 60.0;
-
-      if (isNegative)
-      {
-         deg = -deg;
-      }
-      cout << deg << " = "
-           << (isNegative?"-":"") << degInt << " degrees, "
-           << minInt << " minutes, "
-           << sec << " seconds."
-           << endl;
-   }
-      
-   return 0;
-}
-
diff --git a/ossim/src/apps/ossim-dms2deg/Makefile b/ossim/src/apps/ossim-dms2deg/Makefile
deleted file mode 100644
index cb236b7..0000000
--- a/ossim/src/apps/ossim-dms2deg/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-PROGRAM=ossim-dms2deg
-
-include ../../../Makefile.common
-
-CPPSRCS=$(wildcard *.cpp)
-CPPOBJS=$(patsubst %.cpp,%.o,$(CPPSRCS))
-
-OBJS=$(CPPOBJS)
-
-DEPEND_FILES = $(wildcard *.d)
-
-# The binary program extension, if any, including dots (e.g. '.exe')
-PROGRAM_EXT = $(EXEEXT)
-BIN_PROGRAM = $(PROGRAM_PREFIX)$(PROGRAM)$(PROGRAM_EXT)
-
-SRCS      = $(CPPSRCS)
-
-# Pattern rule for objects from .cpp files.
-%.$(OBJEXT): %.cpp
-	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) -c $< -o $@
-
-%.d: %.cpp
-	$(SHELL) -ec '$(CXX) -MM $(CXXFLAGS) $(CDEBUGFLAGS) $< >> $@;'
-
-all:	$(BIN_PROGRAM)
-
-$(BIN_PROGRAM): $(OBJS)
-	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(OBJS) -o $@
-	$(INSTALL_PROGRAM) $(BIN_PROGRAM) $(OSSIM_TOP)/bin
-
-depends: 	$(CPPSRCS:.cpp=.d)
-
-clean_depends:
-	$(RM_NOPROMPT) *.d
-
-clean:
-	$(RM_CMD) $(BIN_PROGRAM)
-
-# Only add the depends if they exist
-#
-ifneq ($(DEPENDS_FILES),)
--include $(DEPENDS_FILES)
-endif
diff --git a/ossim/src/apps/ossim-dms2deg/makefile.vc b/ossim/src/apps/ossim-dms2deg/makefile.vc
deleted file mode 100644
index e8ba0a5..0000000
--- a/ossim/src/apps/ossim-dms2deg/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-dms2deg
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-dms2deg/ossim-dms2deg.cpp b/ossim/src/apps/ossim-dms2deg/ossim-dms2deg.cpp
deleted file mode 100644
index 12fbc2e..0000000
--- a/ossim/src/apps/ossim-dms2deg/ossim-dms2deg.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Application to convert degrees, minutes seconds (DMS) 
-// to decimal degrees.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <cstdlib>
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <string>
-#include <sstream>
-
-using namespace std;
-
-void getDegrees(double& deg)
-{
-   std::string s;
-   cout << "Enter degrees:  " << flush;
-   cin >> s;
-   if ( (s == "q") || (s == "Q") )
-   {
-      exit(0);
-   }
-   else
-   {
-      istringstream is(s);
-      is >> deg;
-      if( is.fail() )
-      {
-         cerr << "Must enter a valid number between -180 and 180 for degrees."
-              << "  Exiting..." << endl;
-         exit(1);
-      }
-      else if ( (deg < -180.0) || (deg > 180.0) ) // Check the range.
-      {
-         cerr << "Degrees must be between -180 and 180.  Exiting..."
-              << endl;
-         exit(1);
-      }
-   }
-}
-   
-void getMinutes(double& min)
-{
-   std::string s;
-   cout << "Enter minutes:  " << flush;
-   cin >> s;
-   if ( (s == "q") || (s == "Q") )
-   {
-      exit(0);
-   }
-   else
-   {
-      istringstream is(s);
-      is >> min;
-      if(is.fail())
-      {
-         cerr << "Must enter a valid number between 0 and 60 for minutes."
-              << "  Exiting..." << endl;
-         exit(1);
-      }
-      else if ( (min < 0.0) || (min > 60.0) ) // Check the range.
-      {
-         cerr << "Minutes must be between 0 and 60.  Exiting\n";
-         exit(1);
-      }
-   }
-}
-
-void getSeconds(double& sec)
-{
-   std::string s;
-   cout << "Enter seconds:  " << flush;
-   cin >> s;
-   if ( (s == "q") || (s == "Q") )
-   {
-      exit(0);
-   }
-   else
-   {
-      istringstream is(s);
-      is >> sec;
-      if( is.fail() )
-      {
-         cerr << "Must enter a valid number between 0 and 60 for seconds."
-              << "  Exiting..." << endl;
-         exit(1);
-      }
-      else if ( (sec < 0.0) || (sec > 60.0) ) // Check the range. 
-      {
-         cerr << "Seconds must be between 0 and 60.  Exiting\n";
-         exit(1);
-      }
-   }
-}
-
-int main(int argc, char* argv[])
-{
-   enum
-   {
-      FOREVER=1
-   };
-
-   if (argc != 1)
-   {
-      cout << "Usage: " << argv[0]
-           << "\nThis application will convert degrees, minutes, seconds to "
-           << "decimal degrees.\nIt take no arguments, you will be prompted "
-           << "for the degrees, minutes, seconds.\n" << endl;
-      return 0;
-   }
-
-   
-   cout << "\nEnter \"q\" to quit.\n\n";
-
-   double deg = 0.0;
-   double min = 0.0;
-   double sec = 0.0;
-
-   cout << setiosflags(ios::fixed) << setprecision(15);
-
-   while (FOREVER)
-   {
-      // Get the degrees.
-      getDegrees(deg);
-
-      // Get the minutes.
-      getMinutes(min);
-
-      // Get the the seconds.
-      getSeconds(sec);
-
-      // Compute the answer.
-      if (deg < 0.0)
-      {
-         double d = fabs(deg);
-         deg = -(d + min/60.0 + sec/3600.0);
-      }
-      else
-      {
-         deg = deg + min/60.0 + sec/3600.0;
-      }
-
-      if ( deg < -180.0 )
-      {
-         deg += 360.0;
-      }
-      else if ( deg > 180.0 )
-      {
-         deg -= 360.0;
-      }
-      cout << "Decimal degrees = " << deg << "\n" << endl;
-      
-   }
-      
-   return 0;
-}
-
diff --git a/ossim/src/apps/ossim-dump-ocg/Makefile b/ossim/src/apps/ossim-dump-ocg/Makefile
deleted file mode 100644
index 5b107ab..0000000
--- a/ossim/src/apps/ossim-dump-ocg/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-PROGRAM=ossim-dump-ocg
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-dump-ocg/makefile.vc b/ossim/src/apps/ossim-dump-ocg/makefile.vc
deleted file mode 100644
index 24b21eb..0000000
--- a/ossim/src/apps/ossim-dump-ocg/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 14839 2009-07-12 15:50:34Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-dump-ocg
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-equation/Makefile b/ossim/src/apps/ossim-equation/Makefile
deleted file mode 100644
index 8e1a9c7..0000000
--- a/ossim/src/apps/ossim-equation/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-equation
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-equation/makefile.vc b/ossim/src/apps/ossim-equation/makefile.vc
deleted file mode 100644
index 7a90ef9..0000000
--- a/ossim/src/apps/ossim-equation/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-equation
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-extract-vertices/Makefile b/ossim/src/apps/ossim-extract-vertices/Makefile
deleted file mode 100644
index 7893d51..0000000
--- a/ossim/src/apps/ossim-extract-vertices/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-extract-vertices
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-extract-vertices/makefile.vc b/ossim/src/apps/ossim-extract-vertices/makefile.vc
deleted file mode 100644
index 2e46f36..0000000
--- a/ossim/src/apps/ossim-extract-vertices/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-extract-vertices
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-hlz/CMakeLists.txt b/ossim/src/apps/ossim-hlz/CMakeLists.txt
deleted file mode 100644
index c148779..0000000
--- a/ossim/src/apps/ossim-hlz/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
-OSSIM_SETUP_APPLICATION(ossim-hlz INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/ossim/src/apps/ossim-hlz/Makefile b/ossim/src/apps/ossim-hlz/Makefile
deleted file mode 100644
index bd35d60..0000000
--- a/ossim/src/apps/ossim-hlz/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-hlz
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-hlz/makefile.vc b/ossim/src/apps/ossim-hlz/makefile.vc
deleted file mode 100644
index 8e9624f..0000000
--- a/ossim/src/apps/ossim-hlz/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-hlz
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-hlz/ossim-hlz.cpp b/ossim/src/apps/ossim-hlz/ossim-hlz.cpp
deleted file mode 100644
index f1b11d4..0000000
--- a/ossim/src/apps/ossim-hlz/ossim-hlz.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Oscar Kramer
-//
-// Description:
-//
-// Application for finding helicopter landing zones (HLZ) on a DEM given the final destination and
-// max range from destination.
-//
-//*******************************************************************
-//  $Id: ossim-hlz.cpp 23167 2015-02-24 22:07:14Z okramer $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/util/ossimHLZUtil.h>
-
-int main(int argc, char *argv[])
-{
-   ossimArgumentParser ap(&argc, argv);
-   ap.getApplicationUsage()->setApplicationName(argv[0]);
-
-   // While in development mode, echo the command line for logging:
-   cout<<"\nCommand: ";
-   for (int i=0; i<argc; ++i)
-      cout<<" "<<argv[i];
-   cout<<"\n"<<endl;
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   double t0 = ossimTimer::instance()->time_s();
-
-   ossimRefPtr<ossimHLZUtil> hlz = new ossimHLZUtil;
-   if (!hlz->parseCommand(ap))
-      exit(1);
-
-   // Add a listener for the percent complete to standard output.
-   ossimStdOutProgress prog(0, true);
-   hlz->addListener(&prog);
-   
-   // Start the viewshed process:
-   bool success = hlz->execute();
-   hlz = 0;
-   
-   double dt = ossimTimer::instance()->time_s() - t0;
-   cout << argv[0] << "Elapsed Time: " << dt << " s\n" << endl;
-   if (success)
-      exit(0);
-   exit(1);
-}
diff --git a/ossim/src/apps/ossim-icp/Makefile b/ossim/src/apps/ossim-icp/Makefile
deleted file mode 100644
index 8585fc8..0000000
--- a/ossim/src/apps/ossim-icp/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-icp
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-icp/makefile.vc b/ossim/src/apps/ossim-icp/makefile.vc
deleted file mode 100644
index 37d17b8..0000000
--- a/ossim/src/apps/ossim-icp/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-icp
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-icp/ossim-icp.cpp b/ossim/src/apps/ossim-icp/ossim-icp.cpp
deleted file mode 100644
index 0a03d00..0000000
--- a/ossim/src/apps/ossim-icp/ossim-icp.cpp
+++ /dev/null
@@ -1,747 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:  Command line application for copying images "image copy".
-// Can be used to cut images, convert formats.  Works in image space
-// (no resampler).
-//
-//*******************************************************************
-//  $Id: ossim-icp.cpp 3023 2011-11-02 15:02:27Z david.burken $
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimImageTypeLut.h>
-#include <ossim/imaging/ossimJpegWriter.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimRLevelFilter.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactory.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimCacheTileSource.h>
-#include <ossim/imaging/ossimBandSelector.h>
-#include <ossim/imaging/ossimCibCadrgTileSource.h>
-#include <ossim/imaging/ossimRgbToGreyFilter.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/imaging/ossimMaskFilter.h>
-
-#include <iostream>
-#include <algorithm>
-#include <iterator>
-#include <exception>
-
-static ossimTrace traceDebug("icp:main");
-
-static void usage()
-{
-   ossimNotify(ossimNotifyLevel_NOTICE)
-      << "\nValid output writer types:\n\n";
-   ossimImageWriterFactoryRegistry::instance()->
-      printImageTypeList( ossimNotify(ossimNotifyLevel_NOTICE) );
-}
-
-ossimString massageQuotedValue(const ossimString& value)
-{
-   char quote = '\0';
-   if(*value.begin() == '"')
-   {
-      quote = '"';
-   }
-   else if(*value.begin() == '\'')
-   {
-      quote = '\'';
-   }
-   
-   if(quote == '\0')
-   {
-      return value;
-   }
-   std::vector<ossimString> splitString;
-   value.split(splitString, quote);
-   if(splitString.size() == 3)
-   {
-      return splitString[1];
-   }
-   return value;
-}
-
-//*************************************************************************************************
-// FINALIZE -- Convenient location for placing debug breakpoint for catching program exit.
-//*************************************************************************************************
-void finalize(int code)
-{
-   exit (code);
-}
-
-int main(int argc, char* argv[])
-{
-   static const char MODULE[] = "icp:main";
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   
-   au->setApplicationName(ap.getApplicationName());
-   au->setDescription(ap.getApplicationName()+
-      " copies any supported input image format to any supported output image format format");
-   au->setCommandLineUsage(ap.getApplicationName()+
-      " [options] <output_type> <input_file> <output_file>");
-   au->addCommandLineOption("-h or --help",
-      "Display this information");
-   au->addCommandLineOption("-a or --use-scalar-remapper", 
-      "Uses scalar remapper, transforms to 8-bit");
-   au->addCommandLineOption("-o or --create-overview", 
-      "Creates and overview for the output image");
-   au->addCommandLineOption("-b or --bands <n,n...>", 
-      "uses the specified bands: ex. \"1, 2, 4\" will select bands 1 2 and 4 of the input image.  "
-      "Note: it is 1 based");
-   au->addCommandLineOption("-c or --compression-type <type>", 
-      "Uses compression.  Currently valid for only tiff output -c jpeg will use jpeg compression");
-   au->addCommandLineOption("-e or --entry <n>", 
-      "For multi image handlers which entry do you wish to extract");
-   au->addCommandLineOption("-g", "Convert to grey scale.");
-   au->addCommandLineOption("-q or --compression-quality <n>", 
-      "Uses compression.  Valid for jpeg type. default is 75 where 100 is best and 1 is worst");
-   au->addCommandLineOption("--pixel-type <type>", 
-      "Valid values: area or point, this will determine if the tie point is upper left corner of "
-      "the upper left pixel (area) or the center of the upper left corner (point), default=point. "
-      "NOTE: This option will only affect the tiff writer.");
-   au->addCommandLineOption("-r or --res-level <n>", 
-      "Which res level to extract from the input: ex -r 1 will get res level 1");
-   au->addCommandLineOption("-l or --start-line <n>", 
-      "Which start line do you wish to copy from the input. If none is given then 0 is used");
-   au->addCommandLineOption("-L or --end-line <n>", 
-      "Which end line do you wish to copy from the input.  If none is given then max line is used");
-   au->addCommandLineOption("-s or --start-sample <n>", 
-      "Which start sample do you wish to copy from the input.  If none is given then 0 is used");
-   au->addCommandLineOption("-p or --end-sample <n>", 
-      "The end sample you wish to copy from the input. If none is given then max sample is used");
-   au->addCommandLineOption("-t or --create-thumbnail <n>", 
-      "Takes an argument which is the maximum pixel dimension desired.");
-   au->addCommandLineOption("-w or --tile-width <n>", 
-      "Defines the tile width for the handlers that support tiled output");
-
-   au->addCommandLineOption("--reader-prop <string>", 
-      "Adds a property to send to the reader. format is name=value");
-
-   au->addCommandLineOption("--writer-prop <string>", 
-      "Adds a property to send to the writer. format is name=value");
-
-   au->addCommandLineOption("--filter-spec <fname>", 
-      "This is an external file spec that describes a chain for filtering the input image.");
-   au->addCommandLineOption("--use-mask [<fname>]", 
-      "Optionally specify name of mask file to use for masking the input image. If no filename "
-      "given, then the default mask filename is used.");
-   
-   
-   if (traceDebug()) CLOG << " Entered..." << std::endl;
-   
-   // Keyword list to initialize image writers with.
-   ossimKeywordlist kwl;
-   const char* PREFIX = "imagewriter.";
-
-   bool        lineEndIsSpecified       = false;
-   bool        sampEndIsSpecified       = false;
-   bool        lineStartIsSpecified     = false;
-   bool        sampStartIsSpecified     = false;
-   bool        convert_to_greyscale     = false;
-   bool        create_overview          = false;
-   bool        create_thumbnail         = false;
-   bool        use_band_selector        = false;
-   bool        use_scalar_remapper      = false;
-   bool        use_mask                 = false;
-   ossim_int32 tile_width               = 0;
-   ossim_int32 max_thumbnail_dimension  = 0;
-   ossim_int32 rr_level                 = 0;
-   ossim_int32 line_start               = 0;
-   ossim_int32 line_stop                = 0;
-   ossim_int32 sample_start             = 0;
-   ossim_int32 sample_stop              = 0;
-   ossim_int32 cibcadrg_entry           = 0;
-   vector<ossimString> band_list(0);
-   ossimFilename filterSpec, maskFile;
-   std::map<ossimString, ossimString, ossimStringLtstr> readerPropertyMap;
-   std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;
-
-   if (ap.read("-h") ||
-       ap.read("--help")||(ap.argc() < 2))
-   {
-      au->write(ossimNotify(ossimNotifyLevel_NOTICE));
-      usage(); // for writer output types
-      finalize(0);
-   }
-
-   while(ap.read("--reader-prop", stringParam))
-   {
-      std::vector<ossimString> nameValue;
-      ossimString(tempString).split(nameValue, "=");
-      if(nameValue.size() == 2)
-      {
-         readerPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
-      }
-   }   
-   while(ap.read("--writer-prop", stringParam))
-   {
-      std::vector<ossimString> nameValue;
-      ossimString(tempString).split(nameValue, "=");
-      if(nameValue.size() == 2)
-      {
-         writerPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
-      }
-   }
-   while(ap.read("-a") ||
-         ap.read("--use-scalar-remapper"))
-   {
-      use_scalar_remapper = true;        
-   }
-   while(ap.read("--filter-spec",stringParam))
-   {
-      filterSpec = ossimFilename(tempString);        
-   }
-   
-   while(ap.read("--use-mask") ||
-         ap.read("--use-mask",stringParam) )
-   {
-      maskFile = ossimFilename(tempString);     
-      use_mask = true;
-   }
-   
-   while(ap.read("-o") ||
-         ap.read("--create-overview"))
-   {
-      create_overview = true;
-   }
-   
-   while(ap.read("-b", stringParam) ||
-         ap.read("--bands", stringParam))
-   {
-      use_band_selector = true;
-      ossimString s = tempString;
-      band_list = s.split(",");
-   }
-   
-   while(ap.read("-c", stringParam) ||
-         ap.read("--compression-type", stringParam))
-   {
-      ossimString s = tempString;
-      s.downcase();
-      kwl.add(PREFIX, ossimKeywordNames::COMPRESSION_TYPE_KW, s.c_str(), true);
-   }
-   
-   while(ap.read("-e", stringParam) ||
-         ap.read("--entry", stringParam))
-   {
-      cibcadrg_entry = ossimString(tempString).toInt();
-   }
-
-   if ( ap.read("-g") )
-   {
-      convert_to_greyscale = true;
-   }   
-   
-   while(ap.read("-q", stringParam) ||
-         ap.read("--compression-quality", stringParam))
-   {
-      // Set the jpeg compression quality level.
-      kwl.add(PREFIX,
-              ossimKeywordNames::COMPRESSION_QUALITY_KW,
-              tempString.c_str(),
-              true);
-   }
-   while(ap.read("-r", stringParam) ||
-         ap.read("--res-level", stringParam))
-   {
-      rr_level = ossimString(tempString).toInt();
-   }
-   
-   while(ap.read("-l", stringParam) ||
-         ap.read("--start-line", stringParam))
-   {
-      lineStartIsSpecified = true;
-      line_start = ossimString(tempString).toInt();
-   }
-   
-   while(ap.read("-L", stringParam) ||
-         ap.read("--end-line", stringParam))
-   {
-      lineEndIsSpecified = true;
-      line_stop = ossimString(tempString).toInt();
-   }
-   while(ap.read("-s", stringParam) ||
-         ap.read("--start-sample", stringParam))
-   {
-      sampStartIsSpecified = true;
-      sample_start = ossimString(tempString).toInt();
-   }
-   
-   while(ap.read("-p", stringParam) ||
-         ap.read("--end-sample", stringParam))
-   {
-      sampEndIsSpecified = true;
-      sample_stop = ossimString(tempString).toInt();
-   }
-   
-   while(ap.read("-t", stringParam) ||
-         ap.read("--create-thumbnail", stringParam))
-   {
-      create_thumbnail = true;
-      max_thumbnail_dimension=ossimString(tempString).toInt();
-   }
-   
-   while(ap.read("-w", stringParam) ||
-         ap.read("-tile-width", stringParam))
-   {
-      tile_width = ossimString(tempString).toInt();
-      if ((tile_width % 16) != 0)
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << MODULE << " NOTICE:"
-            << "\nTile width must be a multiple of 16!"
-            << "\nDefaulting to 128"
-            << std::endl;
-         tile_width = 0;
-      }
-   }
-   if (ap.read("--pixel-type", stringParam))
-   {
-      ossimString os = tempString;
-      os.downcase();
-      if (os.contains("area"))
-      {
-         kwl.add(PREFIX, ossimKeywordNames::PIXEL_TYPE_KW, "area", true);
-      }
-      else
-      {
-         kwl.add(PREFIX, ossimKeywordNames::PIXEL_TYPE_KW, "point", true);
- 
-      }
-   }
-   
-   ap.reportRemainingOptionsAsUnrecognized();
-   
-   // Three required args:  output_type, input file, and output file.
-   if (ap.errors())
-   {
-      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-      finalize(0);
-   }
-   if (ap.argc() < 4)
-   {
-      au->write(ossimNotify(ossimNotifyLevel_NOTICE));
-      usage(); // for writer output types
-      finalize(0);
-   }
-   
-   // Set the writer type and the image type.
-   ossimString output_type = ap.argv()[ap.argc()-3];
-   
-   kwl.add(PREFIX, ossimKeywordNames::TYPE_KW, output_type.c_str(), true);
-
-   // Get the input file.
-   const char* input_file = argv[ap.argc()-2];
-   
-   // Get the output file.
-   ossimFilename output_file = argv[ap.argc()-1];
-   
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\noutput type:  "
-           << ap.argv()[ap.argc()-3]
-           << "\ninput file:   "
-           << ap.argv()[ap.argc()-2]
-           << "\noutput file:  "
-           << ap.argv()[ap.argc()-1]
-           << std::endl;
-      
-      if (tile_width)
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE) << "tile_width:  " << tile_width << std::endl;
-      }
-   }
-   
-   // Get an image handler for the input file.
-   ossimRefPtr<ossimImageHandler> ih =
-      ossimImageHandlerRegistry::instance()->open(ossimFilename(input_file));
-   
-   ossimCibCadrgTileSource* its = PTR_CAST(ossimCibCadrgTileSource, ih.get());
-   
-   if (its)
-   {
-      if (cibcadrg_entry > 0)
-      {
-         its->setCurrentEntry(cibcadrg_entry);
-      }
-   }
-   
-   if (!ih)
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << "Unsupported image file:  " << input_file
-           << "\nExiting application..." << std::endl;
-      finalize(0);
-   }
-   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "Error reading image:  " << input_file
-         << "Exiting application..." << std::endl; 
-      finalize(1);
-   }
-
-   // Set the reader properties if any.
-   if ( readerPropertyMap.size() )
-   {
-      ossimPropertyInterface* pi = (ossimPropertyInterface*)ih.get();
-      std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = readerPropertyMap.begin();
-      while(iter != readerPropertyMap.end())
-      {
-         pi->setProperty(iter->first, iter->second);
-         ++iter;
-      }
-   }
-   
-   ih->initialize();
-   ossimRefPtr<ossimImageSource> source = ih.get();
-   
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nImage Handler:  " << ih->getLongName()
-           << std::endl;
-   }
-
-   // Start band selector section:
-
-   //---
-   // If image handler is band selector, start with all bands.
-   // Some sources, e.g. ossimEnviTileSource can pick up default
-   // bands and filter out all other bands.
-   //---
-   ih->setOutputToInputBandList();
-
-   if ( use_band_selector && (source->getNumberOfOutputBands() > 1) )
-   {
-      // Build the band list.
-      ossim_uint32 bands = source->getNumberOfOutputBands();
-      vector<ossim_uint32> bl;
-      ossim_uint32 i;
-      for (i=0; i<band_list.size(); ++i)
-      {
-         bl.push_back(band_list[i].toULong()-1);
-      }
-      
-      // Check the list.  Make sure all the bands are within range.
-      for (i=0; i<bl.size(); ++i)
-      {
-         if (bl[i] >= bands)
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << MODULE << " ERROR:"
-               << "\nBand list range error!"
-               << "\nHighest available band:  " << bands
-               << std::endl;
-            finalize(1);
-         }
-      }
-      
-      ossimRefPtr<ossimBandSelector> bs = new ossimBandSelector();
-      bs->connectMyInputTo(source.get());
-      bs->setOutputBandList(bl);
-      bs->enableSource();
-      bs->initialize();
-      source = bs.get();
-      
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nZero based output band list:" << std::endl;
-         for (i=0; i<bl.size(); ++i)
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "   band[" << i << "]:  " << bl[i] << std::endl;
-         }
-         ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
-      }
-      
-   } // Matches: if ( use_band_selector...
-
-   // End of band selection section.
-
-   if ( convert_to_greyscale )
-   {
-      ossimRefPtr<ossimRgbToGreyFilter> rgb2grey = new ossimRgbToGreyFilter();
-      rgb2grey->connectMyInputTo( source.get() );
-      source = rgb2grey.get();
-   }
-   
-   ossimRefPtr<ossimMaskFilter> mask_filter = 0;
-   if (use_mask)
-   {
-      if (maskFile.empty())
-      {
-         maskFile = ih->getFilenameWithThisExtension("mask");
-      }
-      
-      ossimImageHandler* mh = ossimImageHandlerRegistry::instance()->open(maskFile);
-      if (mh == NULL)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)<<"ossim-icp -- Could not open raster mask file <"
-            <<maskFile<<">. Maske request will be ignored. Aborting..."<<endl;
-         finalize(1);
-      }
-      mask_filter = new ossimMaskFilter();
-      mask_filter->connectMyInputTo(source.get());
-      mask_filter->setMaskSource(mh);  // assumes ownership of mask handler object
-      source = mask_filter.get();
-   }
-
-   if(!filterSpec.empty()&&filterSpec.exists())
-   {
-      ossimKeywordlist kwl;
-      if(kwl.addFile(filterSpec))
-      {
-         ossimRefPtr<ossimObject> input = ossimObjectFactoryRegistry::instance()->createObject(kwl);
-         if(input.valid())
-         {
-            ossimImageSource* inputImageSource = dynamic_cast<ossimImageSource*> (input.get());
-            if(inputImageSource)
-            {
-               inputImageSource->connectMyInputTo(source.get());
-               source = inputImageSource;
-            }
-         }
-      }
-   }
-   
-   if (create_thumbnail == true)
-   {
-      // Get the rlevel that <= max thumbnail dimension.
-      int max   = 0;
-      int level = 0;
-      
-      while (level < ((ossim_int32)ih->getNumberOfDecimationLevels()-1))
-      {
-         int lines   = ih->getNumberOfLines(level);
-         int samples = ih->getNumberOfSamples(level);
-         max = lines > samples ? lines : samples;
-         if (max <= max_thumbnail_dimension)
-         {
-            break;
-         }
-         ++level;
-      }
-      
-      if (max > max_thumbnail_dimension)
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE) << " NOTICE:"
-              << "\nLowest rlevel not small enough to fulfill "
-              << "max_thumbnail_dimension requirement!" << std::endl;
-      }
-      
-      // Set the reduced res level.  This will override the -r option.
-      rr_level = level;
-
-   } // end of "if  (create_thumbnail == true)
-
-   // Start rlevel filter section.
-   if( rr_level != 0 )
-   {
-      //---
-      // Check for a valid reduced resolution level.
-      // If the operator entered an invalid rr_level with the -r option,
-      // spit out a warning and set to default "0".
-      //---
-      if (rr_level >= (ossim_int32)(ih->getNumberOfDecimationLevels()))
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << " WARNING:"
-            << "\n\t Selected res level greater than available res levels."
-            << "\n\t Defaulting to res level zero. " << std::endl;
-         rr_level = 0;
-      }
-         
-      ossimRefPtr<ossimRLevelFilter> rlevelFilter = new ossimRLevelFilter;
-      
-      rlevelFilter->connectMyInputTo(source.get());
-      
-      source = rlevelFilter.get();
-      
-      rlevelFilter->setCurrentRLevel(rr_level);
-      if ( rr_level )
-      {
-         rlevelFilter->setOverrideGeometryFlag(true);
-      }
-      
-   } // Matches: if( rr_level != 0 )
-      
-   ossimIrect output_rect = source->getBoundingRect(rr_level);
-      
-   //---
-   // If any of these are true the user wants to cut the rectangle.
-   //---
-   if ( lineStartIsSpecified || lineEndIsSpecified ||
-        sampStartIsSpecified || sampEndIsSpecified)
-   {
-      if (!lineStartIsSpecified) line_start   = output_rect.ul().y;
-      if (!lineEndIsSpecified)   line_stop    = output_rect.lr().y;
-      if (!sampStartIsSpecified) sample_start = output_rect.ul().x;
-      if (!sampEndIsSpecified)   sample_stop  = output_rect.lr().x;
-      
-      //---
-      // Check the start and stop points and make sure they are in
-      // the right order; if not, swap them.
-      //---
-      if (line_stop < line_start)
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << " WARNING:\n"
-            << "\t Line end is less than line start, swapping."
-            << std::endl;
-         int tmp    = line_start;
-         line_start = line_stop;
-         line_stop  = tmp;
-      }
-      if (sample_stop < sample_start)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << " WARNING:\n"
-            << "\t Sample end is less than sample start, swapping."
-            << std::endl;
-         int tmp      = sample_start;
-         sample_start = sample_stop;
-         sample_stop  = tmp;
-      }
-
-      output_rect.set_ulx(sample_start);
-      output_rect.set_lrx(sample_stop);
-      output_rect.set_uly(line_start);
-      output_rect.set_lry(line_stop);
-         
-   } // End of "if ((lineEndIsSpecified) ||..."
-
-   if (traceDebug())
-   {
-      CLOG << "icp:main debug"
-           << "\nrr_level:  " << rr_level
-           << "\noutput_rect:   " << output_rect
-           << "\nkeyword list:  " << kwl << std::endl;
-   }
-   
-   ossimRefPtr<ossimImageFileWriter> writer =
-      ossimImageWriterFactoryRegistry::instance()->createWriter(kwl, PREFIX);
-
-   if( writer == 0 )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "\nCould not create writer of type:  "
-         << output_type
-         << std::endl;
-      usage();
-      finalize(1);
-   }
-
-   writer->connectMyInputTo(0, source.get());
-
-   if (tile_width)
-   {
-      // Set the tile size...
-      writer->setTileSize(ossimIpt(tile_width, tile_width));
-   }
-   
-   writer->open(output_file);
-   
-   // Add a listener to get percent complete.
-   ossimStdOutProgress prog(0, true);
-   writer->addListener(&prog);
-
-   if (writer->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-   {
-      if( (ih->getOutputScalarType() != OSSIM_UCHAR) &&
-          ((PTR_CAST(ossimJpegWriter, writer.get())) ||
-           use_scalar_remapper))
-      {
-         writer->setScaleToEightBitFlag(true);
-      }
-
-      ossimRefPtr<ossimCacheTileSource> cache = new ossimCacheTileSource;
-      ossimIpt tileWidthHeight(ih->getImageTileWidth(),
-                               ih->getImageTileHeight());
-      // only use the cache if its stripped
-      if(static_cast<ossim_uint32>(tileWidthHeight.x) ==
-         ih->getBoundingRect().width())
-      {
-         cache->connectMyInputTo(0, source.get());
-         cache->setTileSize(tileWidthHeight);
-         writer->connectMyInputTo(0, cache.get());
-      }
-      else
-      {
-         writer->connectMyInputTo(0, source.get());
-      }
-      writer->initialize();
-      writer->setAreaOfInterest(output_rect); // Set the output rectangle.
-
-      try
-      {
-         if ( writerPropertyMap.size() )
-         {
-            ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
-            std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = writerPropertyMap.begin();
-            while(iter!=writerPropertyMap.end())
-            {
-               propInterface->setProperty(iter->first, iter->second);
-               ++iter;
-            }
-         }
-         writer->execute();
-      }
-      catch(std::exception& e)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "icp:main ERROR:\n"
-            << "Caught exception!\n"
-            << e.what()
-            << std::endl;
-      }
-      catch(...)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "icp:main ERROR:\n"
-            << "Unknown exception caught!\n"
-            << std::endl;
-      }
-
-      cache = 0;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "Error detected in the image writer..."
-         << "\nExiting application..." << std::endl;
-
-      finalize(1);
-   }
-   
-   if (create_overview == true)
-   {
-      writer->writeOverviewFile();
-   }
-   
-   finalize(0);
-}
diff --git a/ossim/src/apps/ossim-igen/Makefile b/ossim/src/apps/ossim-igen/Makefile
deleted file mode 100644
index acadf10..0000000
--- a/ossim/src/apps/ossim-igen/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-igen
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-igen/makefile.vc b/ossim/src/apps/ossim-igen/makefile.vc
deleted file mode 100644
index a7e6cd6..0000000
--- a/ossim/src/apps/ossim-igen/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-igen
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-image-compare/ossim-image-compare.cpp b/ossim/src/apps/ossim-image-compare/ossim-image-compare.cpp
deleted file mode 100644
index 0b6f2bd..0000000
--- a/ossim/src/apps/ossim-image-compare/ossim-image-compare.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// File: ossim-foo.cpp
-//
-// Author:  Oscar Kramer
-//
-// Description: Compares pixel data between two images. Returns with 0 if same or 1 of different.
-//              The input formats can be different -- the pixels are compared after any 
-//              unpacking and decompression. Only R0 is compared.
-//
-// $Id: ossim-image-compare.cpp 19753 2011-06-13 15:20:31Z dburken $
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/init/ossimInit.h>
-#include <iostream>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-
-using namespace std;
-
-template <typename T> bool tilesAreDifferent(const ossimImageData* t1, const ossimImageData* t2)
-{
-   ossimIpt size1 = t1->getImageRectangle().size();
-   ossimIpt size2 = t2->getImageRectangle().size();
-   int nbands1 = t1->getNumberOfBands();
-   int nbands2 = t2->getNumberOfBands();
-   if ((size1 != size2) || (nbands1 != nbands2))
-      return true;
-
-   ossim_uint32 num_pixels = (ossim_uint32) (size1.x * size1.y);
-   
-   for (int band=0; band<nbands1; band++)
-   {
-      T* buf1 = (T*) t1->getBuf(band);
-      T* buf2 = (T*) t2->getBuf(band);
-      
-      for ( ossim_uint32 p=0; p<num_pixels; ++p)
-      {
-         if (buf1[p] != buf2[p])
-            return true;
-      }
-   }
-   return false;
-}
-
-int main(int argc, char *argv[])
-{
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-
-   try
-   {
-      if (ap.argc() != 3)
-      {
-         cout << "\nUsage: "<<ap.getApplicationName()<<" <image1> <image2>"<<endl;
-         return 1;
-      }
-      
-      ossimFilename f1 (argv[1]);
-      ossimFilename f2 (argv[2]);
-      cout << "\nComparing <"<<f1<<"> to <"<<f2<<">..."<<endl;
-      // Establish input image handlers:
-      ossimImageHandlerRegistry* registry = ossimImageHandlerRegistry::instance();
-      ossimRefPtr<ossimImageHandler> h1 = registry->open(ossimFilename(argv[1]));
-      if (!h1.valid())
-      {
-         cout<<"  Could not open first image at <"<<argv[1]<<">. Aborting..."<<endl;
-         return 1;
-      }
-      ossimRefPtr<ossimImageHandler> h2 = registry->open(ossimFilename(argv[2]));
-      if (!h1.valid())
-      {
-         cout<<"  Could not open second image at <"<<argv[2]<<">. Aborting..."<<endl;
-         h1->close();
-         return 1;
-      }
-
-      // Establish the tile sequencer to loop over all tiles:
-      ossimRefPtr<ossimImageSourceSequencer> sequencer1 = new ossimImageSourceSequencer(h1.get());
-      ossimRefPtr<ossimImageSourceSequencer> sequencer2 = new ossimImageSourceSequencer(h2.get());
-      sequencer1->setToStartOfSequence();
-      sequencer2->setToStartOfSequence();
-      
-      // Begin loop over all tiles, checking them for any non-empty status:
-      int tile_count = 0;
-      bool diff_found = false;
-
-      ossimRefPtr<ossimImageData> tile1 = sequencer1->getNextTile();
-      ossimRefPtr<ossimImageData> tile2 = sequencer2->getNextTile();
-      ossimScalarType stype = tile1->getScalarType();
-      while (tile1.valid() && tile2.valid() && !diff_found)
-      {
-         switch (stype)
-         {
-         case OSSIM_UINT8:
-         case OSSIM_SINT8:
-            diff_found = tilesAreDifferent<ossim_uint8>(tile1.get(), tile2.get());
-            break;
-
-         case OSSIM_UINT16:
-         case OSSIM_SINT16:
-         case OSSIM_USHORT11:
-            diff_found = tilesAreDifferent<ossim_uint16>(tile1.get(), tile2.get());
-            break;
-
-         case OSSIM_UINT32:
-         case OSSIM_SINT32:
-            diff_found = tilesAreDifferent<ossim_uint32>(tile1.get(), tile2.get());
-            break;
-
-         case OSSIM_FLOAT32:
-            diff_found = tilesAreDifferent<ossim_float32>(tile1.get(), tile2.get());
-            break;
-
-         case OSSIM_FLOAT64:
-            diff_found = tilesAreDifferent<ossim_float64>(tile1.get(), tile2.get());
-            break;
-
-         default:
-            cout<<"  This datatype is not supported. Aborting..."<<endl;
-            diff_found = true;
-         }
-
-         tile1 = sequencer1->getNextTile();
-         tile2 = sequencer2->getNextTile();
-         ++tile_count;
-      }
-
-      h1->close();
-      h2->close();
-      
-      if (diff_found)
-      {
-         cout << "  DIFFERENCE FOUND AT TILE "<<tile_count<<"."<<endl;
-         return 1;
-      }
-      cout << "  No differences found."<<endl;
-      return 0;
-   }
-   catch (const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-      return 1;
-   }
-   
-}
diff --git a/ossim/src/apps/ossim-image-synth/Makefile b/ossim/src/apps/ossim-image-synth/Makefile
deleted file mode 100644
index 34e6feb..0000000
--- a/ossim/src/apps/ossim-image-synth/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-image-synth
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-image-synth/makefile.vc b/ossim/src/apps/ossim-image-synth/makefile.vc
deleted file mode 100644
index 0e43496..0000000
--- a/ossim/src/apps/ossim-image-synth/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-image-synth
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-image-synth/ossim-image-synth.cpp b/ossim/src/apps/ossim-image-synth/ossim-image-synth.cpp
deleted file mode 100644
index ac80b2b..0000000
--- a/ossim/src/apps/ossim-image-synth/ossim-image-synth.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Description: Utility to generate custom synthesized image for testing code..
-//
-// $Id: ossim-image-synth.cpp 23163 2015-02-23 16:04:05Z okramer $
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/imaging/ossimMemoryImageSource.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <cmath>
-#include <sstream>
-#include <iostream>
-
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   int returnCode = 0;
-   
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-   
-   if ( (ap.argc() < 2) || ap.read("-h") || ap.read("--help") )
-   {
-      cout << "\nUsage: "<<ap[0]<<" <filename>\n"<<endl;
-      return 0;
-   }
-
-   ossimFilename filename = ap[1];
-   filename.setExtension(".tif");
-
-   // Set the destination image size:
-   ossimIpt image_size (256 , 256);
-   ossimRefPtr<ossimImageData> outImage =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, image_size.x, image_size.y);
-   if(outImage.valid())
-      outImage->initialize();
-   else
-      return -1;
-   
-   // Fill the buffer with test image pattern. Start with fill:
-   outImage->fill(1);
-
-   // Establish the image geometry's map projection:
-   ossimGpt observerGpt (0, 0, 0);
-   ossimDpt gsd (1.0, 1.0); // must be same value in both directions
-   ossimRefPtr<ossimEquDistCylProjection> mapProj = new ossimEquDistCylProjection();
-   mapProj->setOrigin(observerGpt);
-   mapProj->setMetersPerPixel(gsd);
-   ossimDpt degPerPixel (mapProj->getDecimalDegreesPerPixel());
-   mapProj->setElevationLookupFlag(false);
-   ossimGpt ulTiePt (observerGpt);
-   ulTiePt.lat += degPerPixel.lat * (image_size.y-1)/2.0;
-   ulTiePt.lon -= degPerPixel.lon * (image_size.x-1)/2.0;
-   mapProj->setUlTiePoints(ulTiePt);
-   ossimRefPtr<ossimImageGeometry> geometry = new ossimImageGeometry(0, mapProj.get());
-   geometry->setImageSize(image_size);
-
-   // Define different tile textures: noisy, inclined, flat, combo.
-   ossim_uint32 tile_size = 32;
-
-   // Start with noisy tiles below and above amplitude threshold:
-   ossim_uint32 buf_size = tile_size*tile_size;
-   ossimRefPtr<ossimImageData> noisy_tile1 =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, tile_size, tile_size);
-   noisy_tile1->initialize();
-   ossim_float32* noisy_buf1 = noisy_tile1->getFloatBuf();
-
-   ossimRefPtr<ossimImageData> noisy_tile2 =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, tile_size, tile_size);
-   noisy_tile2->initialize();
-   ossim_float32* noisy_buf2 = noisy_tile2->getFloatBuf();
-
-   float noiseAmplitude1 = 0.5; // meters
-   float noiseAmplitude2 = 5.0; // meters
-   srand (time(NULL));
-   for (ossim_uint32 i=0; i<buf_size; ++i)
-   {
-      noisy_buf1[i] = 1.0 + noiseAmplitude1 * ((float)rand()/(float)RAND_MAX - 0.5);
-      noisy_buf2[i] = 1.0 + noiseAmplitude2 * ((float)rand()/(float)RAND_MAX - 0.5);
-   }
-
-   // Inclined planes below and above inclination threshold.
-   // Eq. of plane in terms of azimuth and inclination is: z = -tan(in) [ x sin(az) + y cos(az) ]
-   ossimRefPtr<ossimImageData> incline_tile1 =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, tile_size, tile_size);
-   incline_tile1->initialize();
-   ossim_float32* incline_buf1 = incline_tile1->getFloatBuf();
-
-   ossimRefPtr<ossimImageData> incline_tile2 =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, tile_size, tile_size);
-   incline_tile2->initialize();
-   ossim_float32* incline_buf2 = incline_tile2->getFloatBuf();
-
-   double azimuth = 45.0; // degrees azimuth, horizontal component of surface normal
-   double inclination1 = 2.0; // degrees inclination of surface normal from local vertical
-   double inclination2 = 8.0; // (above threshold)
-   double sinAz = ossim::sind(azimuth);
-   double cosAz = ossim::cosd(azimuth);
-   double x0 = tile_size/2.0;
-   double y0 = tile_size/2.0;
-   double gain1 = -gsd.x * ossim::tand(inclination1);
-   double gain2 = -gsd.x * ossim::tand(inclination2);
-   for (ossim_uint32 y=0; y<tile_size; ++y)
-   {
-      for (ossim_uint32 x=0; x<tile_size; ++x)
-      {
-         incline_tile1->setValue(x, y, 1.0 + gain1*((x-x0)*sinAz + (y-y0)*cosAz));
-         incline_tile2->setValue(x, y, 1.0 + gain2*((x-x0)*sinAz + (y-y0)*cosAz));
-      }
-   }
-
-   // Create hybrid incline and noisy, below and above threshold:
-   ossimRefPtr<ossimImageData> hybrid_tile1 =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, tile_size, tile_size);
-   hybrid_tile1->initialize();
-   ossim_float32* hybrid_buf1 = hybrid_tile1->getFloatBuf();
-
-   ossimRefPtr<ossimImageData> hybrid_tile2 =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, tile_size, tile_size);
-   hybrid_tile2->initialize();
-   ossim_float32* hybrid_buf2 = hybrid_tile2->getFloatBuf();
-
-   for (ossim_uint32 i=0; i<buf_size; ++i)
-   {
-      hybrid_buf1[i] = noisy_buf1[i] + incline_buf1[i] - 1.0;
-      hybrid_buf2[i] = noisy_buf2[i] + incline_buf2[i] - 1.0;
-   }
-
-   // Create plateau:
-   ossimRefPtr<ossimImageData> plateau_tile =
-         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, tile_size, tile_size);
-   plateau_tile->initialize();
-   plateau_tile->fill(5.0);
-
-   // Now populate the output buffer with tiles: XXXOXOXXOXXOXOO
-   std::vector<ossimImageData*> tiles;
-   tiles.push_back(noisy_tile1.get());
-   tiles.push_back(noisy_tile2.get());
-   tiles.push_back(incline_tile1.get());
-   tiles.push_back(incline_tile2.get());
-   tiles.push_back(hybrid_tile1.get());
-   tiles.push_back(hybrid_tile2.get());
-   tiles.push_back(plateau_tile.get());
-   ossimImageData* tile;
-   ossim_uint32 tiles_idx = 0;
-   ossimIpt tile_origin(0,0);
-   for (tile_origin.y=0; tile_origin.y<image_size.y; tile_origin.y+=tile_size)
-   {
-      for (tile_origin.x=0; tile_origin.x<image_size.x; tile_origin.x+=tile_size)
-      {
-         tile = tiles[tiles_idx++];
-         if (tiles_idx == tiles.size())
-            tiles_idx = 0;
-         tile->setOrigin(tile_origin);
-         outImage->loadTile(tile);
-      }
-   }
-
-   // Create output image chain:
-   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
-   memSource->setImage(outImage);
-   memSource->setImageGeometry(geometry.get());
-
-   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
-   writer->connectMyInputTo(0, memSource.get());
-   writer->setFilename(filename);
-   writer->setGeotiffFlag(true);
-   bool success = writer->execute();
-
-   return 0;
-}
diff --git a/ossim/src/apps/ossim-img2md/Makefile b/ossim/src/apps/ossim-img2md/Makefile
deleted file mode 100644
index 3029a0d..0000000
--- a/ossim/src/apps/ossim-img2md/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-PROGRAM=ossim-img2md
-
-include ../../../makeprog.mak
-
diff --git a/ossim/src/apps/ossim-img2md/makefile.vc b/ossim/src/apps/ossim-img2md/makefile.vc
deleted file mode 100644
index 9537190..0000000
--- a/ossim/src/apps/ossim-img2md/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-img2md
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-img2md/ossim-img2md.cpp b/ossim/src/apps/ossim-img2md/ossim-img2md.cpp
deleted file mode 100644
index abd80e4..0000000
--- a/ossim/src/apps/ossim-img2md/ossim-img2md.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  Application to output metadata given meta data type,
-// source image, output file.  Additional keywords can be passed to writer
-// via the "-t" option which takes a keyword list.
-//
-//----------------------------------------------------------------------------
-// $Id: img2md.cpp 9111 2006-06-14 12:34:08Z gpotts $
-
-#include <iostream>
-#include <iterator>
-using namespace std;
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageMetaDataWriterRegistry.h>
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-
-static void outputWriterTypes();
-static void usage();
-
-int main(int argc, char* argv[])
-{
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-   
-   argumentParser.getApplicationUsage()->setApplicationName(
-      argumentParser.getApplicationName());
-   
-   argumentParser.getApplicationUsage()->setDescription(
-      argumentParser.getApplicationName()+" outputs metadata for an image.");
-   
-   argumentParser.getApplicationUsage()->setCommandLineUsage(
-      argumentParser.getApplicationName()+" [options] <metadata_writer> <input_file> <output_file>");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "-h or --help", "Shows help");
-
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "-t or --template", "Template to pass to meta data writer.");
-   
-   //---
-   // Extract optional arguments.
-   //---
-   ossimFilename templateFile = ossimFilename::NIL;
-        
-   if(argumentParser.read("-h") || argumentParser.read("--help"))
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      usage(); // For metadata writer types.
-      exit(0);
-   }
-   if( argumentParser.read("-t", stringParam) ||
-       argumentParser.read("--template", stringParam) )
-   {
-      templateFile = tempString.c_str();
-   }
-   
-   argumentParser.reportRemainingOptionsAsUnrecognized();
-   if (argumentParser.errors())
-   {
-      argumentParser.writeErrorMessages(std::cout);
-      exit(1);
-   }
-
-   if(argumentParser.argc() < 4)
-   {
-      argumentParser.getApplicationUsage()->write(std::cout);
-      usage(); // For metadata writer types.
-      exit(1);
-   }
-   
-   ossimString   metaDataWriterType = argumentParser.argv()[1];
-   ossimFilename imageFile          = argumentParser.argv()[2];
-   ossimFilename outputFile         = argumentParser.argv()[3];
-   
-   ossimRefPtr<ossimImageHandler> ih =
-      ossimImageHandlerRegistry::instance()->open(imageFile);
-   if (!ih)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Could not open:  " << imageFile << endl; 
-   }
-
-   metaDataWriterType.downcase();
-   
-   ossimRefPtr<ossimMetadataFileWriter> mw =
-      ossimImageMetaDataWriterRegistry::instance()->createWriter(
-         metaDataWriterType);
-   if (!mw)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Could not create meta data writer of type:  "
-         << metaDataWriterType << endl;
-      exit(1);
-   }
-
-   ossimKeywordlist kwl;
-   kwl.add(ossimKeywordNames::FILENAME_KW, outputFile.c_str());
-
-   if (templateFile != ossimFilename::NIL)
-   {
-      if (kwl.addFile(templateFile) == false)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Could not load template file:  "
-            << templateFile << endl;
-         exit(1);
-      }
-   }
-
-   mw->loadState(kwl);
-
-   mw->connectMyInputTo(ih.get());
-
-   if (mw->execute() == true)
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "Wrote file:  " << outputFile.c_str() << endl;
-   }
-   
-   return 0;
-}
-
-void usage()
-{
-   cout << "\nNOTES:"
-        << "\nValid metadata writer types:"
-        << "\n";
-   outputWriterTypes();
-}
-
-void outputWriterTypes()
-{
-   std::vector<ossimString> metadatatypeList;
-   
-   ossimImageMetaDataWriterRegistry::instance()->getMetadatatypeList(
-      metadatatypeList);
-   
-   std::copy(metadatatypeList.begin(),
-             metadatatypeList.end(),
-             std::ostream_iterator<ossimString>(std::cout, "\t\n"));
-}
-
diff --git a/ossim/src/apps/ossim-img2rr/Makefile b/ossim/src/apps/ossim-img2rr/Makefile
deleted file mode 100644
index 1050639..0000000
--- a/ossim/src/apps/ossim-img2rr/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-img2rr
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-img2rr/makefile.vc b/ossim/src/apps/ossim-img2rr/makefile.vc
deleted file mode 100644
index 660f499..0000000
--- a/ossim/src/apps/ossim-img2rr/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-img2rr
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-info/Makefile b/ossim/src/apps/ossim-info/Makefile
deleted file mode 100644
index 991bb9a..0000000
--- a/ossim/src/apps/ossim-info/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-info
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-info/makefile.vc b/ossim/src/apps/ossim-info/makefile.vc
deleted file mode 100644
index 806c6dc..0000000
--- a/ossim/src/apps/ossim-info/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 14839 2009-07-12 15:50:34Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-info
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-info/ossim-info.cpp b/ossim/src/apps/ossim-info/ossim-info.cpp
deleted file mode 100644
index 1efe0f1..0000000
--- a/ossim/src/apps/ossim-info/ossim-info.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossim-info.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/util/ossimInfo.h>
-
-#include <iostream>
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   int originalArgCount = argc;
-
-   ossimArgumentParser ap(&argc, argv);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   //---
-   // Avoid going on if a global option was consumed by ossimInit::initialize
-   // like -V or --version option and the arg count is down to 1.
-   //---
-   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
-   {
-      // Make the info object.
-      ossimRefPtr<ossimInfo> oi = new ossimInfo;
-
-      try
-      {
-         //---
-         // Initialize will take the options passed in and set things to output
-         // information for.
-         //
-         // ossimInfo::initialize can throw an exception.
-         //---
-         bool continue_after_init = oi->initialize(ap);
-
-         if ( continue_after_init )
-         {
-            // This will actually output the information.
-            oi->execute();
-         }
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         return 1;
-      }
-      
-   }  // End: if ( ( ap.argc() > 1 ) ...
-   
-   return 0;
-   
-} // End of main...
-
diff --git a/ossim/src/apps/ossim-modopt/Makefile b/ossim/src/apps/ossim-modopt/Makefile
deleted file mode 100644
index db61ef6..0000000
--- a/ossim/src/apps/ossim-modopt/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-modopt
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-modopt/makefile.vc b/ossim/src/apps/ossim-modopt/makefile.vc
deleted file mode 100644
index b790d1b..0000000
--- a/ossim/src/apps/ossim-modopt/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-modopt
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-mosaic/Makefile b/ossim/src/apps/ossim-mosaic/Makefile
deleted file mode 100644
index 88b83a3..0000000
--- a/ossim/src/apps/ossim-mosaic/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-mosaic
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-mosaic/makefile.vc b/ossim/src/apps/ossim-mosaic/makefile.vc
deleted file mode 100644
index 664b833..0000000
--- a/ossim/src/apps/ossim-mosaic/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-mosaic
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-mosaic/ossim-mosaic.cpp b/ossim/src/apps/ossim-mosaic/ossim-mosaic.cpp
deleted file mode 100644
index d45c8e5..0000000
--- a/ossim/src/apps/ossim-mosaic/ossim-mosaic.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: mosaic.cpp 13312 2008-07-27 01:26:52Z gpotts $
-#include <iostream>
-#include <fstream>
-using namespace std;
-
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/imaging/ossimFeatherMosaic.h>
-#include <ossim/imaging/ossimBlendMosaic.h>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageSourceFactory.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageWriter.h>
-#include <ossim/projection/ossimImageViewTransform.h>
-#include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimRtti.h>
-
-static ossimTrace traceDebug(ossimString("mosaic:main"));
-
-void outputTemplateKeywordlist(const ossimFilename &templateFilename)
-{
-   ofstream out(templateFilename.c_str());
-
-   out << "file1.filename: <full path and file name>" << endl
-       << "file2.filename: <full path and file name>" << endl
-       << "// :\n"
-       << "// :\n"
-       << "// fileN: <full path and file name to the Nth file in the list>" << endl
-       << "\n// currently this option has been tested\n"
-       << "// with ossimTiffWriter and ossimJpegWriter\n"
-       << "// writer.type: ossimTiffWriter"            << endl
-       << "// writer.filename: <full path to output file>"  << endl
-       << "\n// Currently, the mosaic application supports\n"
-       << "// SIMPLE mosaics (ie. no blending algorithms)\n"
-       << "// BLEND  for maps or layers that you want to blend together\n"
-       << "// FEATHER for applying a spatial feaher along overlapped regions\n"
-       << "// mosaic.type: SIMPLE"                     << endl
-       << "\n// product type and projection information" << endl
-       << "// is optional.  It will use the first images"<<endl
-       << "// geometry information instead." << endl
-       << "// product.type: "        << endl
-       << "// product.meters_per_pixel_y: "       << endl
-       << "// product.meters_per_pixel_x: "       << endl
-       << "// product.central_meridian:   " << endl
-       << "// product.origin_latitude:"    << endl;
-
-   ossimNotify(ossimNotifyLevel_NOTICE)
-      << "Wrote file: " << templateFilename << std::endl;
-}
-
-ossimMapProjection* buildProductProjection(const ossimKeywordlist& kwl,
-                                           ossimConnectableObject::ConnectableObjectList& inputSources)
-{
-   const char* productType = kwl.find("product.type");
-   const char* productGeom = kwl.find("product.geom_file");
-   ossimRefPtr<ossimMapProjection> result = 0;
-
-   // if we don't have a prduct output specified
-   // we will just use the first image.
-   if(!productType&&!productGeom)
-   {
-      if(inputSources.size() < 1)
-      {
-         return NULL;
-      }
-      ossimKeywordlist geom;
-      ossimImageChain* imageChain = PTR_CAST(ossimImageChain, inputSources[0].get());
-      ossimConnectableObject* source = NULL;
-      
-      if(!imageChain)
-      {
-         source = PTR_CAST(ossimImageHandler, inputSources[0].get());
-      }
-      else
-      {
-         source = imageChain->findFirstObjectOfType(STATIC_TYPE_INFO(ossimImageHandler));
-      }
-
-      if(source)
-      {
-         ossimImageHandler* handler = PTR_CAST(ossimImageHandler, source);
-         if(handler)
-         {
-            ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-            ossimRefPtr<ossimProjection>   temp    = geom->getProjection();
-            result = PTR_CAST(ossimMapProjection, temp.get());
-         }
-      }
-      else
-      {
-         return NULL;
-      }
-   }
-   else
-   {
-      ossimRefPtr<ossimProjection>   temp    = ossimProjectionFactoryRegistry::instance()->createProjection(kwl,
-                                                                                                "product.");
-      result = PTR_CAST(ossimMapProjection, temp.get());
-   }
-
-   return result.release();
-}
-
-bool buildRenderers(const ossimKeywordlist& specFile,
-                    ossimConnectableObject::ConnectableObjectList& imageSources,
-                    ossimMapProjection* productProjection)
-{
-   ossim_int32 index = 0;
-
-   // add the renderer to each chain.  First, look for
-   // the ossimImageHandler and get the image
-   // geometry for this chain.  The add the ossimImageRenderer
-   // to each chain and then connect it up
-   //
-   for(index = 0; index < (ossim_int32)imageSources.size(); ++index)
-   {
-      ossimImageChain* imageChain = PTR_CAST(ossimImageChain, imageSources[index].get());
-      if(imageChain)
-      {
-         ossimConnectableObject* source = imageChain->findFirstObjectOfType(STATIC_TYPE_INFO(ossimImageHandler));
-
-         if(source)
-         {
-            ossimImageHandler* imageHandler = PTR_CAST(ossimImageHandler,
-                                                       source);
-
-
-            ossimRefPtr<ossimImageGeometry> geom = imageHandler->getImageGeometry();
-            // now add the image/view transform to the
-            // renderer.
-            //
-            if(geom.valid())
-            {
-               ossimImageSource* last = imageChain->getFirstSource();
-
-               
-               ossimImageRenderer* renderer = new ossimImageRenderer;
-               renderer->connectMyInputTo(0, PTR_CAST(ossimConnectableObject, last));
-               imageChain->add(renderer);
-               ossimImageViewProjectionTransform* transform = new ossimImageViewProjectionTransform;
-               transform->setImageGeometry(geom.get());
-               ossimRefPtr<ossimImageGeometry> viewGeom = new ossimImageGeometry();
-               viewGeom->setProjection(productProjection);
-               // Make a copy of the view projection for
-               // each chain by passing in the object and not
-               // the pointer.
-               transform->setViewGeometry(viewGeom.get());
-               
-               renderer->setImageViewTransform(transform);
-               imageChain->initialize();
-            }
-            else
-            {
-               return false;
-            }
-         }
-      }
-   }
-
-   return true;
-}
-
-bool buildChains(std::vector<ossimFilename>& fileList,
-                 ossimConnectableObject::ConnectableObjectList& chains)
-{
-   bool result = true;
-   chains.clear();
-
-   for(ossim_int32 index = 0; index < (ossim_int32)fileList.size();++index)
-   {
-      ossimRefPtr<ossimImageSource> handler = ossimImageHandlerRegistry::instance()->open(fileList[index]);
-
-      if(handler.valid())
-      {
-         ossimImageChain* imageChain = new ossimImageChain;
-         imageChain->add(handler.get());
-         chains.push_back(imageChain);
-      }
-      else
-      {
-         cerr << "Error: Unable to load image " << fileList[index] << endl;
-         result = false;
-      }
-   }
-
-   return result;
-}
-
-bool buildChains(const ossimKeywordlist& kwl,
-                 ossimConnectableObject::ConnectableObjectList& chains)
-{
-   ossim_int32 index = 0;
-   ossim_int32 result = kwl.getNumberOfSubstringKeys("file[0-9]+\\.filename");
-   const char* lookup = NULL;
-   ossim_int32 numberOfMatches = 0;
-   vector<ossimFilename> fileList;
-   
-   while(numberOfMatches < result)
-   {
-      ossimString searchValue = "file" + ossimString::toString(index);
-      
-      ossimString filename = searchValue + ".filename";
-      lookup = kwl.find(filename.c_str());
-      if(lookup)
-      {
-         fileList.push_back(ossimFilename(lookup));
-         ++numberOfMatches;
-      }
-      ++index;
-   }
-      
-   return buildChains(fileList,
-                      chains);
-}
-
-ossimRefPtr<ossimImageCombiner> createMosaic(const ossimKeywordlist& kwl,
-                               ossimConnectableObject::ConnectableObjectList& inputSources)
-{
-   const char* mosaicType = kwl.find("mosaic.type");
-   //ossimImageCombiner* mosaic = NULL;
-   ossimRefPtr<ossimImageCombiner> mosaic = 0;
-   if(mosaicType)
-   {
-      if(ossimString(mosaicType).upcase() == "FEATHER")
-      {
-         mosaic  = new ossimFeatherMosaic;
-      }
-      else if(ossimString(mosaicType).upcase() == "BLEND")
-      {
-         mosaic  = new ossimBlendMosaic;
-      }
-      else
-      {
-		 mosaic = PTR_CAST(ossimImageCombiner, ossimObjectFactoryRegistry::instance()->createObject(ossimString(mosaicType)));
-      }
-   }
-   else
-   {
-      mosaic = new ossimImageMosaic;
-   }
-   if (!mosaic) cerr << "Could not create Mosaic!";
-
-   for(ossim_int32 index = 0; index < (ossim_int32)inputSources.size(); ++index)
-   {
-      mosaic->connectMyInputTo(inputSources[index].get());
-   }
-
-   mosaic->initialize();
-
-   return mosaic;
-}
-ossimString massageQuotedValue(const ossimString& value)
-{
-   char quote = '\0';
-   if(*value.begin() == '"')
-   {
-      quote = '"';
-   }
-   else if(*value.begin() == '\'')
-   {
-      quote = '\'';
-   }
-   
-   if(quote == '\0')
-   {
-      return value;
-   }
-   std::vector<ossimString> splitString;
-   value.split(splitString, quote);
-   if(splitString.size() == 3)
-   {
-      return splitString[1];
-   }
-   return value;
-}
-int main(int argc, char *argv[])
-{
-	ossimArgumentParser argumentParser(&argc, argv);
-	ossimInit::instance()->addOptions(argumentParser);
-	ossimInit::instance()->initialize(argumentParser);
-	argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-	argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName() +" Takes a list of images and outputs to mosaic.");
-	argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" [options] <input_file1> <input_file2> <input_file...> <output_file>");
-	argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
-	argumentParser.getApplicationUsage()->addCommandLineOption("-k", "keyword list to load from");
-	argumentParser.getApplicationUsage()->addCommandLineOption("-m", "Mosiac type (SIMPLE, BLEND, FEATHER, or any MosaicCombinerType [ossimClosestToCenter, ossimFeatherMosaic, etc..]) (default=SIMPLE");
-	argumentParser.getApplicationUsage()->addCommandLineOption("-w", "Writer type (tiff_strip, jpeg, etc... see ossim-info --writers) (default=tiff_strip)");
-	argumentParser.getApplicationUsage()->addCommandLineOption("--writer-prop <string>", "Adds a property to send to the writer. format is name=value");
-	argumentParser.getApplicationUsage()->addCommandLineOption("-t", "ouput a keyword list template");
-
-	// Allocate some stuff up front for use later
-	ossimKeywordlist kwl;
-	ossimString theWriterType = "tiff_strip";
-	bool keywordlistSupplied = false;
-	bool optionGiven = false;
-	ossimFilename outfile = "";
-	std::string tempString;
-	ossimArgumentParser::ossimParameter stringParam(tempString);
-	std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;
-
-	// user input writer props, should use those
-	while(argumentParser.read("--writer-prop", stringParam))
-   {
-      std::vector<ossimString> nameValue;
-      ossimString(tempString).split(nameValue, "=");
-      if(nameValue.size() == 2)
-      {
-         writerPropertyMap.insert(std::make_pair(nameValue[0], massageQuotedValue(nameValue[1])));
-      }
-   }
-
-	// User input a writer type
-	while (argumentParser.read("-w", stringParam))
-   {
-      theWriterType = tempString;
-   }
-
-   // Keyword list to load from
-   while (argumentParser.read("-k", stringParam))
-   {
-      kwl.addFile(tempString.c_str());
-      keywordlistSupplied = true;
-      optionGiven         = true;
-   }
-
-   // Mosiac type
-   while (argumentParser.read("-m", stringParam))
-   {
-      ossimString opt = tempString;
-      opt = opt.upcase();
-      opt = opt.trim();
-      if( (opt != "SIMPLE")&&
-          (opt != "BLEND")&&
-          (opt != "FEATHER"))
-      {
-         opt = tempString;
-      }
-      kwl.add("mosaic.type",
-              opt.c_str(),
-              true);
-   }
-   
-   // Output KWL template
-   while (argumentParser.read("-t", stringParam))
-   {
-      ossimFilename templateFilename = tempString.c_str();
-      outputTemplateKeywordlist(templateFilename);
-      exit(0);
-   }
-   
-   // Display Help - changed 3 to 2, because you can just supply a kwl and an output
-   while (argumentParser.read("-h") ||
-       argumentParser.read("--help") ||
-       (argumentParser.argc() < 2 ))
-   {
-      argumentParser.getApplicationUsage()->write(
-         ossimNotify(ossimNotifyLevel_INFO));
-      exit(0);
-   }
-
-   int argCount = argumentParser.argc();
-
-   // Get the input files.
-   for (int i=1; i< (argCount-1); ++i)
-   {
-      ossimFilename f = argv[i];
-      if(f.exists())
-      {
-         kwl.add((ossimString("file")+ossimString::toString(i)+".").c_str(),
-                 "filename",
-                 f.c_str(),
-                 true);
-      }
-      keywordlistSupplied = true;
-      optionGiven         = true;
-   }
-
-   // Get the output file.
-   outfile = argv[argCount-1];
-
-   if(outfile.exists())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "mosaic ERROR:"
-         << "\nOuput file " << outfile << " exits and will not be overwritten!"
-         << "\nExiting..."
-         << std::endl;
-      exit(1);
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "kwl:\n" << kwl
-         << "output file: " << outfile << std::endl;
-   }
-
-   if(keywordlistSupplied)
-   {
-	   // NOTE: Got rid of the separate method writeMosaic and moved the code down here so i didn't have to pass a ton of variables to it.
-		ossimConnectableObject::ConnectableObjectList inputSources;
-
-		if(outfile == "")
-		{
-		   outfile = "./output.tif";
-		}
-		// build the image and a remapper for it.
-		// if we were successful then we will add the image
-		// renderer that will transform it it some output
-		// product projection.
-		//
-		if(buildChains(kwl, inputSources))
-		{
-		   ossimMapProjection* productProjection = buildProductProjection(kwl,
-		                                                                  inputSources);
-		   
-		   if(!productProjection)
-		   {
-		      cerr << "unable to create product projection" << endl;
-		      return false;
-		   }
-		   
-		   // now let's build up the renderers
-		   //
-		   if(buildRenderers(kwl,
-		                     inputSources,
-		                     productProjection))
-		   {
-				
-		      // Create mosaic object
-		      ossimRefPtr<ossimImageCombiner> mosaic = createMosaic(kwl,
-		                                                inputSources);
-			  // Create writer from kwl if supplied
-		      ossimRefPtr<ossimImageFileWriter> writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwl,"writer.");
-
-		      if(!writer)
-		      {
-				  // If no kwl was supplied, then create a writer from the 'theWriterType' string
-				 writer = ossimImageWriterFactoryRegistry::instance()->createWriter(theWriterType);
-		         //writer = new ossimTiffWriter; // the default 'theWriterType' is not 'tiff_strip' which should be this class
-		         writer->open(outfile);
-		      }
-		      
-		      if(writer.valid())
-		      {
-		         ossimStdOutProgress listener;
-		         if(mosaic.valid())
-		         {
-		            writer->addListener(&listener);
-		            writer->connectMyInputTo(0, mosaic.get());
-		            writer->initialize();
-		            
-					if ( writerPropertyMap.size() )
-					{
-					   ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
-					   std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = writerPropertyMap.begin();
-					   while(iter!=writerPropertyMap.end())
-					   {
-					      propInterface->setProperty(iter->first, iter->second);
-					      ++iter;
-					   }
-					}
-					
-					// NOTE: This stuff is copied in anyhow not sure why it was being done in the first place... 
-					// still here because maybe it is required! should be more generic.
-
-					//ossimMapProjectionInfo mapInfo(productProjection,
-		            //                               mosaic->getBoundingRect());
-		            //ossimTiffWriter* tempTiffPtr = PTR_CAST(ossimTiffWriter, writer.get());
-		            //
-		            //if(tempTiffPtr)
-		            //{
-		            //   tempTiffPtr->setProjectionInfo(mapInfo);
-		            //   tempTiffPtr->execute();
-		            //}
-		            //else
-		            //{
-					// Do the hard work here..
-		            if (!writer->execute())
-					{
-						ossimNotify(ossimNotifyLevel_WARN)
-							<< "mosaic ERROR:"
-							<< "\nCould not execute writer!"
-							<< "\nExiting..."
-							<< std::endl;
-						return 1;
-					}
-		            //}
-		            writer->removeListener(&listener);
-		         }
-		         writer->disconnect();
-		         mosaic->disconnect();
-		         mosaic = 0;
-		         writer = 0;
-		      }
-		   }
-		   else
-		   {
-		      return 1;
-		   }
-		}
-   }
-
-   if(!optionGiven)
-   {
-      argumentParser.getApplicationUsage()->write(
-         ossimNotify(ossimNotifyLevel_INFO));
-   }
-
-   return 0;
-}
diff --git a/ossim/src/apps/ossim-ogeom2ogeom/Makefile b/ossim/src/apps/ossim-ogeom2ogeom/Makefile
deleted file mode 100644
index d6ffd77..0000000
--- a/ossim/src/apps/ossim-ogeom2ogeom/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-ogeom2ogeom
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-ogeom2ogeom/makefile.vc b/ossim/src/apps/ossim-ogeom2ogeom/makefile.vc
deleted file mode 100644
index 26042f6..0000000
--- a/ossim/src/apps/ossim-ogeom2ogeom/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-ogeom2ogeom
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-orthoigen/Makefile b/ossim/src/apps/ossim-orthoigen/Makefile
deleted file mode 100644
index d259fc6..0000000
--- a/ossim/src/apps/ossim-orthoigen/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-orthoigen
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-orthoigen/makefile.vc b/ossim/src/apps/ossim-orthoigen/makefile.vc
deleted file mode 100644
index b8c5575..0000000
--- a/ossim/src/apps/ossim-orthoigen/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-orthoigen
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-orthoigen/ossim-orthoigen.cpp b/ossim/src/apps/ossim-orthoigen/ossim-orthoigen.cpp
deleted file mode 100644
index 9edd62f..0000000
--- a/ossim/src/apps/ossim-orthoigen/ossim-orthoigen.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossim-orthoigen.cpp 3023 2011-11-02 15:02:27Z david.burken $
-
-#include <iostream>
-#include <cstdlib>
-#include <list>
-#include <fstream>
-#include <iterator>
-#include <iomanip>
-using namespace std;
-
-#include <ossim/parallel/ossimOrthoIgen.h>
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <sstream>
-
-static ossimTrace traceDebug("orthoigen:debug");
-
-//*************************************************************************************************
-// USAGE
-//*************************************************************************************************
-static void usage()
-{
-   ossimNotify(ossimNotifyLevel_NOTICE) <<
-      "Valid output writer types for \"-w\" or \"--writer\" option:\n\n" << ends;
-   ossimImageWriterFactoryRegistry::instance()->
-      printImageTypeList(ossimNotify(ossimNotifyLevel_NOTICE));
-}
-
-//*************************************************************************************************
-// FINALIZE -- Convenient location for placing debug breakpoint for catching program exit.
-//*************************************************************************************************
-void finalize(int code)
-{
-   exit (code);
-}
-
-//*************************************************************************************************
-// MAIN
-//*************************************************************************************************
-int main(int argc, char* argv[])
-{
-#if OSSIM_HAS_MPI
-   ossimMpi::instance()->initialize(&argc, &argv);
-   if (ossimMpi::instance()->getRank() == 0)
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "MPI running with "
-         << ossimMpi::instance()->getNumberOfProcessors()
-         << " processors..." << std::endl;
-   }
-#endif
-
-   //---
-   // Start the timer.  Note ossimMpi::instance()->getRank() works with or without
-   // mpi being enabled.
-   //---
-   if (ossimMpi::instance()->getRank() == 0) ossimTimer::instance()->setStartTick();
-
-   enum
-   {
-      OK    = 0,
-      ERROR = 1
-   };
-
-   // Turn off the initial load of elevation.  This will be loaded if needed later.
-   ossimInit::instance()->setElevEnabledFlag(false);
-   
-   ossimRefPtr<ossimOrthoIgen> orthoIgen = new ossimOrthoIgen;
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-   ossimApplicationUsage* u = argumentParser.getApplicationUsage();
-   u->setApplicationName(argumentParser.getApplicationName());
-   u->setCommandLineUsage(     
-      "\n\n"
-      "    ossim-orthoigen [options] \"<input_image1>[|switches]\" \"[<input_image2>[|switches]\" ...] <output_image>\n"
-      "\n"
-      "    ossim-orthoigen [options] <input_spec>.src <output_image>");
-
-   u->setDescription(
-      "Creates a product image given an input specification as described below. There are two ways\n"
-      "of specifying the input source list. Switches on explicit form are \n"
-      "\n"
-      "    <N>|<B1,B2,...>|<histo-op>|<ovr_path>. \n"
-      "\n"
-      "The <histo-op> presently can be either \"auto-minmax\" or \"std-stretch-N\" where N=1, 2 or 3.\n"
-      "The <input_spec>.src keyword list contains keyword entries in the form of \n"
-      "\n"
-      "    imageN.<keyword>: value\n"
-      "\n"
-      "Supported keywords are \"file\", \"entry\", \"rgb\", \"hist\", \"ovr\", with values \n"
-      "identical to those specified in the explicit switch form.\n");
-
-   orthoIgen->addArguments(argumentParser);
-   u->addCommandLineOption("-h or --help","Display this information");
-   u->addCommandLineOption(
-      "--enable-entry-decoding","A filename can be separated by a | and a number (NO space).  \n"
-      "Example: a.toc|0 will do entry 0 of a.toc file and on unix you might want to use a \\ since\n"
-      "the separator is a pipe sign. Example: ./a.toc\\|0 will do entry 0 of a.toc.");
-
-   if (argumentParser.read("-h") || argumentParser.read("--help") || (argumentParser.argc() == 1))
-   {
-      u->write(ossimNotify(ossimNotifyLevel_INFO));
-      usage();
-      ossimMpi::instance()->finalize();
-      ossimInit::instance()->finalize();
-      finalize(OK);
-   }
-   bool enableEntryDecoding = false;
-   if(argumentParser.read("--enable-entry-decoding"))
-   {
-      enableEntryDecoding = true;
-   }
-   
-   orthoIgen->initialize(argumentParser);
-   argumentParser.reportRemainingOptionsAsUnrecognized();
-   if (argumentParser.errors())
-   {
-      argumentParser.writeErrorMessages(ossimNotify(ossimNotifyLevel_WARN));
-      ossimMpi::instance()->finalize();
-      finalize(OK);
-   }
-   
-   orthoIgen->clearFilenameList();
-   orthoIgen->addFiles(argumentParser, enableEntryDecoding);
-
-   int status = OK;
-
-   try
-   {
-      orthoIgen->execute();
-   }
-   catch (const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-      status = ERROR;
-   }
-   
-   if(ossimMpi::instance()->getRank() == 0)
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << std::setiosflags(ios::fixed)
-         << std::setprecision(3)
-         << "Time elapsed : " << ossimTimer::instance()->time_s() 
-         << std::endl;
-   }
-   
-   ossimMpi::instance()->finalize();
-   finalize(status); 
-}
-
diff --git a/ossim/src/apps/ossim-pc2dem/Makefile b/ossim/src/apps/ossim-pc2dem/Makefile
deleted file mode 100644
index 8585fc8..0000000
--- a/ossim/src/apps/ossim-pc2dem/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-icp
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-pc2dem/makefile.vc b/ossim/src/apps/ossim-pc2dem/makefile.vc
deleted file mode 100644
index 37d17b8..0000000
--- a/ossim/src/apps/ossim-pc2dem/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-icp
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-pixelflip/Makefile b/ossim/src/apps/ossim-pixelflip/Makefile
deleted file mode 100644
index a55cbb5..0000000
--- a/ossim/src/apps/ossim-pixelflip/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-pixelflip
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-pixelflip/makefile.vc b/ossim/src/apps/ossim-pixelflip/makefile.vc
deleted file mode 100644
index 6bd2dab..0000000
--- a/ossim/src/apps/ossim-pixelflip/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-pixelflip
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-pixelflip/ossim-pixelflip.cpp b/ossim/src/apps/ossim-pixelflip/ossim-pixelflip.cpp
deleted file mode 100644
index 68cd53b..0000000
--- a/ossim/src/apps/ossim-pixelflip/ossim-pixelflip.cpp
+++ /dev/null
@@ -1,419 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-//*******************************************************************
-//  $Id: ossim-pixelflip.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-
-#include <iostream>
-#include <sstream>
-#include <algorithm>
-#include <iterator>
-
-#include <ossim/ossimConfig.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimImageTypeLut.h>
-
-#include <ossim/imaging/ossimJpegWriter.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimPixelFlipper.h>
-#include <ossim/imaging/ossimRLevelFilter.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactory.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimBandSelector.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/parallel/ossimImageMpiMWriterSequenceConnection.h>
-#include <ossim/parallel/ossimImageMpiSWriterSequenceConnection.h>
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI
-#    include <mpi.h>
-#  endif
-#endif
-
-static ossimTrace traceDebug("pixelflip:main");
-static void usage();
-static void outputWriterTypes();
-int main(int argc, char* argv[])
-{
-   
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI
-   ossimMpi::instance()->initialize(&argc, &argv);
-   if (ossimMpi::instance()->getRank() == 0)
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "MPI running with "
-         << ossimMpi::instance()->getNumberOfProcessors()
-         << " processors..." << std::endl;
-   }
-#  endif
-#endif
-   
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-   
-   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName()+" flips any null pixels to a valid pixel");
-   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName()+" [options] <output_type> <input_file> <output_file> <target_value> <replacement_value>");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-o or --create-overview", "Creates and overview for the output image");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-c or --clamp-value", "clamp values (any pixel with value larger than input will be clamped to input)");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-m",  "Replacement mode (see notes below)");
-   argumentParser.getApplicationUsage()->addCommandLineOption("-w",  "output tile width(only valid with tiled output types).  Must be a multiply of 16");
-   
- 
-   static const char MODULE[] = "pixelflip:main";
-   if (traceDebug()) CLOG << " Entered..." << std::endl;
-   ossimInit::instance()->initialize(argc, argv);
-   // Keyword list to initialize image writers with.
-   ossimKeywordlist kwl;
-   const char* PREFIX = "imagewriter.";
-   bool create_overview = false;
-   ossim_int32 tile_width = 0;
-   double clamp_value = 0.0;
-   bool do_clamp = false;
-   ossimPixelFlipper::ReplacementMode replacement_mode =
-      ossimPixelFlipper::REPLACE_BAND_IF_TARGET;
-
-
-   if(argumentParser.read("-h") || argumentParser.read("--help")||(argumentParser.argc() == 1))
-   {
-      argumentParser.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-      usage();
-      exit(0);
-   }
-   while(argumentParser.read("-o") || argumentParser.read("--create-overview"))
-   {
-      create_overview = true;
-   }
-   while(argumentParser.read("-c", stringParam))
-   {
-      clamp_value = ossimString(tempString).toDouble();
-      do_clamp = true;
-   }
-   while(argumentParser.read("-m", stringParam))
-   {
-      ossimString mode = tempString;
-      mode.downcase();
-      if (mode == "replace_band_if_target")
-      {
-         replacement_mode = ossimPixelFlipper::REPLACE_BAND_IF_TARGET;
-      }
-      else if (mode == "replace_band_if_partial_target")
-      {
-         replacement_mode =
-            ossimPixelFlipper::REPLACE_BAND_IF_PARTIAL_TARGET;
-      }
-      else if (mode == "replace_all_bands_if_partial_target")
-      {
-         replacement_mode = ossimPixelFlipper::REPLACE_ALL_BANDS_IF_PARTIAL_TARGET;
-      }
-      else if (mode != "replace_all_targets")
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Invalid mode:  "
-            << mode
-            << "\nMode remains:  replace_band_if_target"
-            << std::endl;
-      }
-   }
-   while(argumentParser.read("-w", stringParam))
-   {
-      tile_width = ossimString(tempString).toInt32();
-      if (tile_width % 16)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE
-            << " NOTICE:"
-            << "\nTile width must be a multiple of 16!"
-            << "\nDefaulting to 128"
-            << std::endl;
-         tile_width = 0;
-      }
-   }
-
-   if(argumentParser.argc() != 6)
-   {
-      ossimMpi::instance()->finalize();
-      
-      exit(0);
-   }
-   //***
-   // Set the writer type and the image type.
-   //***
-   ossimString output_type = argumentParser.argv()[1];
-   output_type.downcase();
-   kwl.add(PREFIX, ossimKeywordNames::TYPE_KW, output_type.c_str());
-   // Get the input file.
-   ossimFilename input_file = argumentParser.argv()[2];
-   // Get the output file.
-   ossimFilename    output_file = argumentParser.argv()[3];
-   // Get the value to replace.
-   double target_value = ossimString(argumentParser.argv()[4]).toDouble();
-   // Get the replacement value.
-   double replacement_value = ossimString(argumentParser.argv()[5]).toDouble();
-   bool master = true;
-
-   if (ossimMpi::instance()->getRank() != 0)
-   {
-      master = false;
-   }
-   if (master)
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "pixelflip settings:"
-         << "\noutput type:        " << output_type
-         << "\ninput file:         " << input_file
-         << "\noutput file:        " << output_file
-         << "\ntarget value:       " << target_value
-         << "\nreplacement value:  " << replacement_value
-         << std::endl;
-      if (tile_width)
-      {
-         ossimNotify(ossimNotifyLevel_INFO)
-            << "tile width:         " << tile_width << std::endl;
-      }
-      if (do_clamp)
-      {
-          ossimNotify(ossimNotifyLevel_INFO)
-             << "clamp value:        " << clamp_value << std::endl;
-      }
-   }
-   // Get an image handler for the input file.
-   ossimRefPtr<ossimImageHandler> ih
-      = ossimImageHandlerRegistry::instance()->open(ossimFilename(input_file));
-   if (!ih)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Unsupported image file:  " << input_file
-         << "\nExiting application..." << std::endl;
-      ossimMpi::instance()->finalize();
-      exit(0);
-   }
-   // Initialize the
-   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Error reading image:  " << input_file
-         << "Exiting application..." << std::endl;
-      ossimMpi::instance()->finalize();
-      exit(1);
-   }
-   ih->initialize();
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nImage Handler:  " << ih->getLongName()
-           << std::endl;
-   }
-   // Capture the bounding rectangle of the image handler.
-   ossimIrect output_rect = ih->getBoundingRect(0);
-   // hook up the pixel flipper to the image handler.
-   ossimRefPtr<ossimPixelFlipper> pf = new ossimPixelFlipper();
-   pf->connectMyInputTo(ih.get());
-   pf->initialize();
-   // Setup the pixel flipper target/replacement values, and replace mode.
-   pf->setTargetValue(target_value);
-   pf->setReplacementValue(replacement_value);
-   pf->setReplacementMode(replacement_mode);
-   // Setup pixel flipper clamp value
-   if (do_clamp)
-   {
-      pf->setClampValue(clamp_value);
-   }
-   if (master)
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "replacement mode:   " << pf->getReplacementModeString()
-         << std::endl;
-   }
-   ossimImageSourceSequencer* sequencer = NULL;
-
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI
-   // only allocate the slave connection if
-   // the number of processors is larger than
-   // 1
-   //
-   if(ossimMpi::instance()->getNumberOfProcessors() > 1)
-   {
-      if(ossimMpi::instance()->getRank()!=0)
-      {
-         sequencer = new ossimImageMpiSWriterSequenceConnection(NULL, 4);
-      }
-      else
-      {
-         sequencer = new ossimImageMpiMWriterSequenceConnection();
-      }
-   }
-   else
-   {
-      sequencer = new ossimImageSourceSequencer();
-   }
-#  else
-   // we will just load a serial connection if MPI is not supported.
-   sequencer = new ossimImageSourceSequencer(NULL);
-#  endif
-#else
-   sequencer = new ossimImageSourceSequencer(NULL);
-#endif
-   
-   ossimRefPtr<ossimImageWriter> writer
-      = ossimImageWriterFactoryRegistry::instance()->createWriter(kwl, PREFIX);
-   ossimImageFileWriter* fileWriter = PTR_CAST(ossimImageFileWriter, writer.get());
-   if( fileWriter == NULL )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Error making an image writer..."
-         << "\nExiting application..." << std::endl;
-      ossimMpi::instance()->finalize();
-      exit(1);
-   }
-   // Change out the sequencer...
-   fileWriter->changeSequencer(sequencer);
-   // Hook up the pixel flipper to the file writer.
-   fileWriter->connectMyInputTo(0, pf.get());
-   if (tile_width)
-   {
-      // Set the tile size...
-      fileWriter->setTileSize(ossimIpt(tile_width, tile_width));
-   }
-   fileWriter->open(output_file);
-   // Add a listener to get percent complete.
-   ossimStdOutProgress prog(0, true);
-   fileWriter->addListener(&prog);
-   if (fileWriter->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-   {
-      fileWriter->initialize();
-      fileWriter->setAreaOfInterest(output_rect); // Set the output rectangle.
-
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI
-      double start_time = 0.0;
-      if(ossimMpi::instance()->getRank() == 0)
-      {
-         start_time= MPI_Wtime();
-      }
-#  endif
-#endif
-
-      // Filter and write the file...
-      fileWriter->execute();
-
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI
-      if(ossimMpi::instance()->getRank() == 0)
-      {
-         double stop_time = MPI_Wtime();
-         cout << "Elapsed time: " << (stop_time-start_time) << std::endl;
-      }
-#  endif
-#endif
-   }
-   else
-   {
-      cerr << "Error detected in the image writer..."
-           << "\nExiting application..." << std::endl;
-      exit(1);
-   }
-   if (create_overview == true)
-   {
-      fileWriter->writeOverviewFile();
-   }
-
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI   
-   ossimMpi::instance()->finalize();
-#  endif
-#endif
-   
-   exit(0);
-}
-void usage()
-{
-   ossimNotify(ossimNotifyLevel_INFO)
-      << "\nNOTES:"
-      << "\n-m Replacement mode option explanation:"
-      << "\n   Valid modes (default=replace_all_targets) :"
-      << "\n     replace_partial_targets"
-      << "\n     replace_partial_targets_all_bands"
-      << "\n     replace_full_targets"
-      << "\n     replace_all_targets"
-      << " (default=all)"
-      << "\n"
-      << "\nIf mode is \"replace_all_targets\" (default):"
-      << "\nAny pixel with dn of target will be replaced."
-      << "\n"
-      << "\nIf mode is \"replace_partial_targets\":"
-      << "\nTarget will be replaced only at least one subpixel(band) does "
-      << "\nnot have the target."
-      << "\n"
-      << "\nIf mode is \"replace_partial_targets_all_bands\":"
-      << "\nTarget will be replaced only at least one subpixel(band) does "
-      << "\nnot have the target.  All bands will be replaced."
-      << "\nThis is a good Landsat7 edge fixer..."
-      << "\n"
-      << "\nIf mode is \"replace_full_targets\":"
-      << "\nTarget will be repaced only if all subpixels(bands) have the "
-      << "target."
-      << "\n"
-      << "\n Example:"
-      << "\n target      = 0"
-      << "\n replacement = 1"
-      << "\n Pixel at (0, 0) r=0, g=0,  b=0"
-      << "\n Pixel at (0, 1) r=0, g=30, b=21"
-      << "\n"
-      << "\n Mode is \"replace_all_targets\":"
-      << "\n Pixel at (0, 0) becomes  r=1, g=1,  b=1"
-      << "\n Pixel at (0, 1) becomes  r=1, g=30, b=21"
-      << "\n"
-      << "\n Mode is \"replace_partial_targets\":"
-      << "\n Pixel at (0, 0) remains  r=0, g=0,  b=0"
-      << "\n Pixel at (0, 1) becomes  r=1, g=30, b=21"
-      << "\n"
-      << "\n Mode is \"replace_partial_targets_all_bands\":"
-      << "\n Pixel at (0, 0) remains  r=0, g=0,  b=0"
-      << "\n Pixel at (0, 1) becomes  r=1, g=1, b=1"
-      << "\n"
-      << "\n Mode is \"replace_full_targets\":"
-      << "\n Pixel at (0, 0) becomes  r=1, g=1,  b=1"
-      << "\n Pixel at (0, 1) remains  r=0, g=30, b=21"
-      << "\n"
-      << "\nValid output writer types:"
-      << std::endl;
-   outputWriterTypes();
-}
-
-void outputWriterTypes()
-{
-   std::vector<ossimString> outputType;
-   
-   ossimImageWriterFactoryRegistry::instance()->getImageTypeList(outputType);
-   std::copy(outputType.begin(),
-             outputType.end(),
-             std::ostream_iterator<ossimString>(std::cout, "\t\n"));
-}
-
diff --git a/ossim/src/apps/ossim-preproc/ossim-preproc.cpp b/ossim/src/apps/ossim-preproc/ossim-preproc.cpp
deleted file mode 100644
index a301908..0000000
--- a/ossim/src/apps/ossim-preproc/ossim-preproc.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossim-info.cpp 18619 2011-01-03 10:33:51Z dburken $
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/util/ossimImageUtil.h>
-
-int main(int argc, char *argv[])
-{
-   // Return 0 on success, something else on error.
-   enum
-   {
-      OK    = 0,
-      ERROR = 1
-   };
-   
-   int result = OK;
-   
-   // Start the timer.
-   ossimTimer::instance()->setStartTick();
-
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   int originalArgCount = argc;
-
-   ossimArgumentParser ap(&argc, argv);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   //---
-   // Avoid going on if a global option was consumed by ossimInit::initialize
-   // like -V or --version option and the arg count is down to 1.
-   //---
-   if ( ( ap.argc() > 1 ) || ( ap.argc() == originalArgCount ) )
-   {
-      // Make the info object.
-      ossimRefPtr<ossimImageUtil> oiu = new ossimImageUtil();
-      
-      try
-      {
-         //---
-         // Initialize will take the options passed in and set things to output
-         // information for.
-         //
-         // ossimInfo::initialize can throw an exception.
-         //---
-         bool continue_after_init = oiu->initialize(ap);
-         
-         if ( continue_after_init )
-         {
-            // Execute the operation(s).
-            result = oiu->execute();
-
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "elapsed time in seconds: "
-               << std::setiosflags(ios::fixed)
-               << std::setprecision(3)
-               << ossimTimer::instance()->time_s() << endl;
-         }
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         result = ERROR;
-      }
-      
-   }  // End: if ( ( ap.argc() > 1 ) ...
-   
-   return result;
-   
-} // End of main...
-
diff --git a/ossim/src/apps/ossim-prune/Makefile b/ossim/src/apps/ossim-prune/Makefile
deleted file mode 100644
index a9dbe3e..0000000
--- a/ossim/src/apps/ossim-prune/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-prune
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-prune/makefile.vc b/ossim/src/apps/ossim-prune/makefile.vc
deleted file mode 100644
index 0d68e45..0000000
--- a/ossim/src/apps/ossim-prune/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-prune
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-prune/ossim-prune.cpp b/ossim/src/apps/ossim-prune/ossim-prune.cpp
deleted file mode 100644
index 4a472e0..0000000
--- a/ossim/src/apps/ossim-prune/ossim-prune.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Lucas
-//
-//*******************************************************************
-//  $Id: prune.cpp 10698 2007-04-12 13:59:43Z gpotts $
-
-
-#include <iostream>
-#include <stdlib.h>
-using namespace std;
-
-#include <ossim/ossimConfig.h>
-
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/init/ossimInit.h>
-
-static ossimTrace traceDebug("prune:main");
-
-static void usage()
-{
-   cout << "prune: Displays if image is null or not.\n"
-        << "Usage:\n"
-        << "ossim-prune <image_file>"
-        << "\nMoves image_file to image_file.null if all tiles are null."
-        << "\n";
-   return;
-}
-
-static void move( const ossimFilename& in, const ossimFilename& out )
-{
-#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
-   std::string moveCommand = "ren";
-#else
-   std::string moveCommand = "mv";
-#endif
-
-   std::string command = moveCommand;
-   command += " ";
-   command += in.string();
-   command += " ";
-   command += out.string();
-   cout << "Executing " << command << endl;
-   system(command.c_str());
-}
-
-int main(int argc, char* argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-   
-   // One required arg:  input file
-   if (argc != 2)
-   {
-      usage();
-      exit(0);
-   }
-
-   const char* input_file = argv[1];
-
-   // Get an image handler for the input file.
-   ossimRefPtr<ossimImageHandler> ih
-      = ossimImageHandlerRegistry::instance()->open(ossimFilename(input_file));
-
-   if (!ih)
-   {
-      cout << "ERROR: Unsupported image file: " << input_file
-           << "\nExiting application." << endl;
-      exit(0);
-   }
-
-   // Initialize the 
-   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      cerr << "ERROR: Unable to read image file: " << input_file
-           << "\nExiting application." << endl; 
-      exit(1);
-   }
-
-   ih->initialize();
-
-   int lines   = ih->getNumberOfLines(0);
-   int samples = ih->getNumberOfSamples(0);
-   int tileHeight = ih->getTileHeight();
-   int tileWidth = ih->getTileWidth();
-   int tilesInLineDir = lines / tileHeight;
-   int tilesInSampDir = samples / tileWidth;
-
-   if(lines % tileHeight) ++tilesInLineDir;
-
-   if(samples % tileWidth) ++tilesInSampDir;
-
-   for(int i=0; i<tilesInLineDir; i++)
-   {
-      for(int j=0; j<tilesInSampDir; j++)
-      {
-         ossimIpt origin(j*tileWidth,i*tileHeight);
-         ossimRefPtr<ossimImageData> id=ih->getTile(origin);
-         if( id.valid() && (id->getDataObjectStatus() != OSSIM_EMPTY) )
-         {
-            cout << "RESULT: Image file has data: " << input_file << endl;
-            exit(0);
-         }
-      }
-   }
-
-   // Move the input file:
-   ossimFilename in = input_file;
-   ossimFilename out = in;
-   out += ".null";
-   move( in, out );
-   
-   in = in.fileNoExtension();
-   in += "_readme.txt";
-   if ( in.exists() )
-   {
-      out = in;
-      out += ".null";
-      move( in, out );
-   }
-   
-   exit(0);
-}
-
diff --git a/ossim/src/apps/ossim-rejout/Makefile b/ossim/src/apps/ossim-rejout/Makefile
deleted file mode 100644
index a5c9bf3..0000000
--- a/ossim/src/apps/ossim-rejout/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-rejout
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-rejout/makefile.vc b/ossim/src/apps/ossim-rejout/makefile.vc
deleted file mode 100644
index d721910..0000000
--- a/ossim/src/apps/ossim-rejout/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-rejout
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-rpf/Makefile b/ossim/src/apps/ossim-rpf/Makefile
deleted file mode 100644
index 9c616c1..0000000
--- a/ossim/src/apps/ossim-rpf/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-rpf
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-rpf/makefile.vc b/ossim/src/apps/ossim-rpf/makefile.vc
deleted file mode 100644
index d8e33c7..0000000
--- a/ossim/src/apps/ossim-rpf/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-rpf
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-senint/Makefile b/ossim/src/apps/ossim-senint/Makefile
deleted file mode 100644
index b634a65..0000000
--- a/ossim/src/apps/ossim-senint/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-senint
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-senint/makefile.vc b/ossim/src/apps/ossim-senint/makefile.vc
deleted file mode 100644
index b05e63e..0000000
--- a/ossim/src/apps/ossim-senint/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-senint
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-slope/CMakeLists.txt b/ossim/src/apps/ossim-slope/CMakeLists.txt
deleted file mode 100644
index 1ed1902..0000000
--- a/ossim/src/apps/ossim-slope/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
-OSSIM_SETUP_APPLICATION(ossim-slope INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/ossim/src/apps/ossim-slope/Makefile b/ossim/src/apps/ossim-slope/Makefile
deleted file mode 100644
index bac9e01..0000000
--- a/ossim/src/apps/ossim-slope/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-slope
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-slope/makefile.vc b/ossim/src/apps/ossim-slope/makefile.vc
deleted file mode 100644
index 82df4fe..0000000
--- a/ossim/src/apps/ossim-slope/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-slope
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-slope/ossim-slope.cpp b/ossim/src/apps/ossim-slope/ossim-slope.cpp
deleted file mode 100644
index a085abb..0000000
--- a/ossim/src/apps/ossim-slope/ossim-slope.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// File: ossim-slope.cpp
-//
-// Author:  Oscar Kramer
-//
-// Description: Application main() for computing the corresponding slope image (floating point
-// degrees) of an input DEM image.
-//
-// $Id: ossim-slope.cpp 23430 2015-07-15 15:01:50Z okramer $
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/util/ossimSlopeUtil.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/init/ossimInit.h>
-#include <iostream>
-
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   int returnCode = 0;
-   
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->initialize(ap);
-   
-   ossimRefPtr<ossimSlopeUtil> slopeUtil = new ossimSlopeUtil;
-   if (!slopeUtil->initialize(ap))
-      exit(1);
-
-   if (!slopeUtil->execute())
-      exit(1);
-
-   exit(0);
-}
diff --git a/ossim/src/apps/ossim-space-imaging/Makefile b/ossim/src/apps/ossim-space-imaging/Makefile
deleted file mode 100644
index fa699ff..0000000
--- a/ossim/src/apps/ossim-space-imaging/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-space-imaging
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-space-imaging/makefile.vc b/ossim/src/apps/ossim-space-imaging/makefile.vc
deleted file mode 100644
index a3ebfed..0000000
--- a/ossim/src/apps/ossim-space-imaging/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-space-imaging
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-src2src/ossim-src2src.cpp b/ossim/src/apps/ossim-src2src/ossim-src2src.cpp
deleted file mode 100644
index 3eefe6d..0000000
--- a/ossim/src/apps/ossim-src2src/ossim-src2src.cpp
+++ /dev/null
@@ -1,523 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-//*******************************************************************
-//  $Id: ossim-src2src.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimTilingPoly.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/plugin/ossimSharedPluginRegistry.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/support_data/ossimInfoFactoryRegistry.h>
-#include <ossim/support_data/ossimSrcRecord.h>
-
-#include <iostream>
-#include <vector>
-using namespace std;
-
-
-//**************************************************************************
-// usage()
-//**************************************************************************
-void usage()
-{
-   ossimNotify(ossimNotifyLevel_INFO)
-      << " examples:\n\n"
-      << "    ossim-create-src --tiling-template ./mytemplate.template ./myfile.tif ./outdir\n"
-      << std::endl;;
-}
-
-//*****************************************************************************************
-// Centralized point to capture all program exits (aids in debugging -- please leave)
-//*****************************************************************************************
-void finalize(int exit_code)
-{
-   exit(exit_code);
-}
-
-void parseSrcFile(const ossimFilename& srcFile, vector<ossimSrcRecord>& srcRecordFiles, ossimString& prefix)
-{
-   if (!srcFile.isReadable())
-      return;
-
-   ossimKeywordlist src_kwl (srcFile);
-   unsigned int image_idx = 0;
-   ossimString lookup = src_kwl.find("dem0.file");
-   if (!lookup.empty())
-   {
-      prefix = "dem";
-   }
-
-   // Loop to read all image file entries:
-   while (true)
-   {
-      ossimSrcRecord srcRecord(src_kwl, image_idx++, prefix);
-      if (!srcRecord.valid()) 
-         break;
-
-      srcRecordFiles.push_back(srcRecord);
-   }
-}
-
-ossimRefPtr<ossimTilingPoly> getTiling(const ossimFilename& templateFile)
-{
-   ossimKeywordlist templateKwl;
-   if (!templateKwl.addFile(templateFile))
-   {
-      return 0;
-   }
-
-   ossimString prefix ("igen.tiling.");
-   while (1)
-   {
-      if (templateKwl.find(prefix.chars(), "tile_source"))
-      {
-         break;
-      }
-      else
-      {
-         return 0;
-      }
-
-      // If we got here, then no matches were found in the template. Try again but without a prefix:
-      if (prefix.empty())
-         break;
-      prefix.clear();
-   }
-
-   // Initialize the tiling object if enabled:
-   ossimRefPtr<ossimTilingPoly> tiling = new ossimTilingPoly;
-  
-   if (!tiling->loadState(templateKwl, prefix))
-   {
-      return 0;
-   }
-
-   return tiling;
-}
-
-ossimDrect getRect(ossimRefPtr<ossimMapProjection> mapProj, 
-   vector<ossimGpt> points)
-{
-   std::vector<ossimDpt> rectTmp;
-   rectTmp.resize(points.size());
-
-   for(std::vector<ossimGpt>::size_type index=0; index < points.size(); ++index)
-   {
-      mapProj->worldToLineSample(points[(int)index], rectTmp[(int)index]);
-   }
-
-   if (rectTmp.size() > 3)
-   {
-      ossimDrect rect2 = ossimDrect(rectTmp[0],
-         rectTmp[1],
-         rectTmp[2],
-         rectTmp[3]);
-
-      return rect2;
-   }
-   return ossimDrect();
-}
-
-//**************************************************************************
-// Main Application
-//**************************************************************************
-int main(int argc, char *argv[])
-{
-   std::string tempString1;
-   ossimArgumentParser::ossimParameter stringParam1(tempString1);
-   std::string tempString2;
-   ossimArgumentParser::ossimParameter stringParam2(tempString2);
-
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-   ossimInit::instance()->initialize(argumentParser);
-
-   ossimApplicationUsage* appuse = argumentParser.getApplicationUsage();
-   
-   appuse->setApplicationName(argumentParser.getApplicationName());
-
-   appuse->setDescription(argumentParser.getApplicationName()+
-      " generate src files for polygons.");
-
-   appuse->setCommandLineUsage(argumentParser.getApplicationName()+
-      "ossim-create-src [--tiling-template] <full path to template file>");
-                          
-   appuse->addCommandLineOption("--tiling-template", "Specify an external file that contains tiling information.");
-
-   ossimFilename templateFile = "";
-  
-   if(argumentParser.read("--tiling-template", stringParam1))
-   {
-      templateFile = ossimFilename(tempString1);
-   }
-
-   // End of arg parsing.
-   argumentParser.reportRemainingOptionsAsUnrecognized();
-   if ( argumentParser.errors() )
-   {
-      argumentParser.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-      finalize(1);
-   }
-
-   if (argc == 1)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<< "Must supply an input file or info option." << std::endl;
-      finalize(0);
-   }
-
-   ossim_uint32 idx = 0;
-   ossim_uint32 last_idx = argumentParser.argc()-1;
-   ossimFilename inputSrcFile = "";
-   ossimString prefixStr = "image";
-   vector<ossimSrcRecord> inputFiles;
-   while(argumentParser.argv()[idx] && (idx < last_idx))
-   {
-      ossimString file = argumentParser.argv()[idx];
-      if (file.contains(".src"))
-      {
-         // input file spec provided via src file. Need to parse it:
-         inputSrcFile = ossimFilename(file);
-         if (!inputSrcFile.exists() )
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: file does not exist:  " << inputSrcFile
-               << std::endl;
-            finalize(1);
-         }
-         parseSrcFile(inputSrcFile, inputFiles, prefixStr);
-      }
-      ++idx;
-   }
-
-   // The last filename left on the command line should be the product filename:
-   ossimFilename outputFileDir = argumentParser.argv()[last_idx];
-   if (!outputFileDir.isDir())
-   {
-      outputFileDir = outputFileDir.path();
-      if (!outputFileDir.exists() )
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: output directory does not exist:  " << outputFileDir
-            << std::endl;
-         finalize(1);
-      }
-   }
-
-   if (!templateFile.exists())
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: template file does not exist::  " << templateFile
-         << std::endl;
-      finalize(1);
-   }
-
-   ossimRefPtr<ossimTilingPoly> polyTiling = getTiling(templateFile);
-   if (!polyTiling.valid())
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossim-src2src: error generating tiling:  " << templateFile
-         << std::endl;
-      finalize(1);
-   }
-
-   // Open up src file to get coordinate info from each file listed in src file.
-   ossim_float64 minLat = 90.0;
-   ossim_float64 maxLat = -90.0;
-   ossim_float64 minLon = 180.0;
-   ossim_float64 maxLon = -180.0;
-
-   ossimString tileName;
-   ossimIrect clipRect;
-   map<ossimString, ossimSrcRecord> infos;
-   ossimRefPtr<ossimMapProjection> mapProj = 0;
-
-   for (ossim_uint32 i = 0; i < inputFiles.size(); i++)
-   {
-      ossimFilename inputFile = inputFiles[i].getFilename();
-      vector<ossim_uint32> entryList;
-      ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(inputFile);
-      if (ih.valid() )
-      {
-         if(inputFiles[i].getEntryIndex() > -1 )
-         {
-            entryList.push_back(inputFiles[i].getEntryIndex());
-         }
-         else
-         {
-            ih->getEntryList(entryList);
-         }
-
-         for(ossim_uint32 entryIdx = 0; entryIdx < entryList.size(); ++entryIdx)
-         {
-            // Establish the image handler for this particular frame. This may be just
-            // the handler already opened in the case of single image per file:
-            ossimImageHandler* img_handler = 0;
-            if (entryList.size() == 1)
-            {
-               img_handler = ih.get();
-            }
-            else
-            {
-               img_handler = (ossimImageHandler*)ih->dup();
-            }
-
-            img_handler->setCurrentEntry(entryList[entryIdx]);
-
-            ossimDrect outputRect = img_handler->getBoundingRect();
-
-            ossimRefPtr<ossimImageGeometry> geom = img_handler->getImageGeometry();
-            if(geom.valid())
-            {
-               ossimGpt ulg;
-               ossimGpt llg;
-               ossimGpt lrg;
-               ossimGpt urg;
-
-               geom->localToWorld(outputRect.ul(), ulg);
-               geom->localToWorld(outputRect.ll(), llg);
-               geom->localToWorld(outputRect.lr(), lrg);
-               geom->localToWorld(outputRect.ur(), urg);
-
-               //find min and max lat, lon for whole src file
-               if (minLat > llg.lat)
-               {
-                  minLat = llg.lat;
-               }
-
-               if (minLon > llg.lon)
-               {
-                  minLon = llg.lon;
-               }
-
-               if (maxLat < urg.lat)
-               {
-                  maxLat = urg.lat;
-               }
-
-               if (maxLon < urg.lon)
-               {
-                  maxLon = urg.lon;
-               }
-
-               ossimString fileInfo = inputFile + "|" + ossimString::toString(entryIdx) + "|" + 
-                  ossimString::toString(ulg.lon) + "," + ossimString::toString(ulg.lat) + "," + 
-                  ossimString::toString(urg.lon) + "," + ossimString::toString(urg.lat) + "," + 
-                  ossimString::toString(lrg.lon) + "," + ossimString::toString(lrg.lat) + "," + 
-                  ossimString::toString(llg.lon) + "," + ossimString::toString(llg.lat);
-
-               infos[fileInfo] = inputFiles[i];
-
-               if (!mapProj.valid())
-               {
-                  ossimRefPtr<ossimProjection> proj = geom->getProjection();
-                  if (proj.valid())
-                  {
-                     mapProj = PTR_CAST(ossimMapProjection, proj->dup());
-                     if (!mapProj.valid()) //default it to ossimEquDistCylProjection
-                     {
-                        mapProj = new ossimEquDistCylProjection;
-                        mapProj->setMetersPerPixel(geom->getMetersPerPixel());
-                     }
-                  }
-               }
-            }
-            img_handler = 0;
-         }
-         ih = 0;
-      }
-      else
-      {
-         continue;
-      }
-   }
-   inputFiles.clear();
-
-   //get bounding rect for entire image
-   vector<ossimGpt> points;
-   if (points.size() == 0)
-   {
-      points.push_back(ossimGpt(maxLat, minLon));
-      points.push_back(ossimGpt(maxLat, maxLon));
-      points.push_back(ossimGpt(minLat, maxLon));
-      points.push_back(ossimGpt(minLat, minLon));
-   }
-
-   if(mapProj.valid())
-   {
-      ossimGpt tie(maxLat, minLon);
-      mapProj->setUlTiePoints(tie);
-      polyTiling->initialize(*(mapProj.get()), getRect(mapProj, points));
-   }
-
-   while(polyTiling->next(mapProj, clipRect, tileName))
-   {
-      ossimFilename outSrc = outputFileDir + "/" + ossimFilename(tileName).noExtension() + ".src";
-     
-      map<ossimString, ossimSrcRecord>::iterator it = infos.begin();
-      ossim_int32 index = 0;
-      map<ossim_int32, ossimSrcRecord> srcList;
-      while (it != infos.end())
-      {
-         ossimString fileInfo = it->first;
-         vector<ossimString> fileInfos = fileInfo.split("|");
-         ossim_int32 entryId = fileInfos[1].toInt();
-         vector<ossimString> latlonInfo = fileInfos[2].split(",");
-
-         double ulgLon = latlonInfo[0].toDouble();
-         double ulgLat = latlonInfo[1].toDouble();
-         double urgLon = latlonInfo[2].toDouble();
-         double urgLat = latlonInfo[3].toDouble();
-         double lrgLon = latlonInfo[4].toDouble();
-         double lrgLat = latlonInfo[5].toDouble();
-         double llgLon = latlonInfo[6].toDouble();
-         double llgLat = latlonInfo[7].toDouble();
-
-         points.clear();
-         points.push_back(ossimGpt(ulgLat, ulgLon));
-         points.push_back(ossimGpt(urgLat, urgLon));
-         points.push_back(ossimGpt(lrgLat, lrgLon));
-         points.push_back(ossimGpt(llgLat, llgLon));
-
-         //get bounding for each image listed in src file
-         ossimDrect rect = getRect(mapProj, points);
-
-         //check if the rect of image intersect with the rect of tile
-         if (rect.intersects(clipRect))
-         {
-            ossimSrcRecord srcRecord = it->second;
-            srcRecord.setEntryIndex(entryId);
-            srcList[index] = srcRecord;
-            index++;
-         }
-         it++;
-      }
-
-      //write image files which intersect with the tile to a new src file
-      if (srcList.size() > 0)
-      {
-         ofstream outputSrcFile(outSrc.c_str());
-         map<ossim_int32, ossimSrcRecord>::iterator srcIt = srcList.begin();
-         while (srcIt != srcList.end())
-         {
-            ossimString prefix = prefixStr + ossimString::toString(srcIt->first) + ".";
-
-            ossimFilename newSrcFile = srcIt->second.getFilename();
-            ossim_int32 entryId = srcIt->second.getEntryIndex();
-            ossimFilename supportDir = srcIt->second.getSupportDir();
-            ossimString hisOp = srcIt->second.getHistogramOp();
-            vector<ossim_uint32> bands = srcIt->second.getBands();
-            double weight = srcIt->second.getWeight();
-            ossimFilename overviewPath = srcIt->second.getOverviewPath();
-            ossimFilename hisPath = srcIt->second.getHistogramPath();
-            ossimFilename maskPath = srcIt->second.getMaskPath();
-
-            if (!newSrcFile.empty())
-            {
-               ossimString str = prefix + "file: " + newSrcFile;
-               outputSrcFile << str << "\n";
-            }
-
-            if (entryId > -1)
-            {
-               ossimString str = prefix + "entry: " + ossimString::toString(entryId);
-               outputSrcFile << str << "\n";
-            }
-
-            if (!supportDir.empty())
-            {
-               ossimString str = prefix + "support: " + supportDir;
-               outputSrcFile << str << "\n";
-            }
-
-            if (!hisOp.empty())
-            {
-               ossimString str = prefix + "hist-op: " + hisOp;
-               outputSrcFile << str << "\n";
-            }
-
-            if (bands.size())
-            {
-               ossimString str = "";
-               for (ossim_uint32 bandIndex = 0; bandIndex < bands.size(); bandIndex++)
-               {
-                  if (bandIndex == (bands.size()-1))
-                  {
-                     str = str + ossimString::toString(bands[bandIndex]+1);
-                  }
-                  else
-                  {
-                     str = str + ossimString::toString(bands[bandIndex]+1) + ",";
-                  }
-               }
-               str = prefix + "rgb: " + str;
-               outputSrcFile << str << "\n";
-            }
-
-            if (weight > 0)
-            {
-               ossimString str = prefix + "opacity: " + ossimString::toString(weight);
-               outputSrcFile << str << "\n";
-            }
-
-            if (!overviewPath.empty())
-            {
-               ossimString str = prefix + "ovr: " + overviewPath;
-               outputSrcFile << str << "\n";
-            }
-
-            if (!hisPath.empty())
-            {
-               ossimString str = prefix + "hist: " + hisPath;
-               outputSrcFile << str << "\n";
-            }
-
-            if (!maskPath.empty())
-            {
-               ossimString str = prefix + "mask: " + maskPath;
-               outputSrcFile << str << "\n";
-            }
-            outputSrcFile << "\n";
-            srcIt++;
-         }
-         outputSrcFile.close();
-         srcList.clear();
-      }
-   }
-
-   if (polyTiling.valid())
-   {
-      polyTiling = 0;
-   }
-   if (mapProj.valid())
-   {
-      mapProj = 0;
-   }
-   points.clear();
-   infos.clear();
-   
-   finalize(0);
-   return 0; // Never reached, but satisfies return type
-}
-
diff --git a/ossim/src/apps/ossim-swapbytes/Makefile b/ossim/src/apps/ossim-swapbytes/Makefile
deleted file mode 100644
index 53adbed..0000000
--- a/ossim/src/apps/ossim-swapbytes/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-swapbytes
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-swapbytes/makefile.vc b/ossim/src/apps/ossim-swapbytes/makefile.vc
deleted file mode 100644
index f88c979..0000000
--- a/ossim/src/apps/ossim-swapbytes/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-swapbytes
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-tfw2ogeom/Makefile b/ossim/src/apps/ossim-tfw2ogeom/Makefile
deleted file mode 100644
index 912f64e..0000000
--- a/ossim/src/apps/ossim-tfw2ogeom/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-tfw2ogeom
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-tfw2ogeom/makefile.vc b/ossim/src/apps/ossim-tfw2ogeom/makefile.vc
deleted file mode 100644
index 1bb42fe..0000000
--- a/ossim/src/apps/ossim-tfw2ogeom/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-tfw2ogeom
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-viewshed/CMakeLists.txt b/ossim/src/apps/ossim-viewshed/CMakeLists.txt
deleted file mode 100644
index df35013..0000000
--- a/ossim/src/apps/ossim-viewshed/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-FILE(GLOB SOURCE_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
-OSSIM_SETUP_APPLICATION(ossim-viewshed INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ${SOURCE_FILES})
diff --git a/ossim/src/apps/ossim-viewshed/Makefile b/ossim/src/apps/ossim-viewshed/Makefile
deleted file mode 100644
index 83b9bb1..0000000
--- a/ossim/src/apps/ossim-viewshed/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-PROGRAM=ossim-viewshed
-
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-viewshed/makefile.vc b/ossim/src/apps/ossim-viewshed/makefile.vc
deleted file mode 100644
index 0f3c135..0000000
--- a/ossim/src/apps/ossim-viewshed/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-viewshed
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-viewshed/ossim-viewshed.cpp b/ossim/src/apps/ossim-viewshed/ossim-viewshed.cpp
deleted file mode 100644
index 512e646..0000000
--- a/ossim/src/apps/ossim-viewshed/ossim-viewshed.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Application to scan image and attemp to detect the valid image vertices and
-// write them to a keyword list file for later use.  Note that if input
-// file is "foo.tif" this will create "foo_vertices.kwl".
-//
-//*******************************************************************
-//  $Id: ossim-viewshed.cpp 23084 2015-01-15 23:56:48Z okramer $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/util/ossimViewshedUtil.h>
-
-int main(int argc, char *argv[])
-{
-   ossimArgumentParser ap(&argc, argv);
-   ap.getApplicationUsage()->setApplicationName(argv[0]);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   double t0 = ossimTimer::instance()->time_s();
-
-   ossimRefPtr<ossimViewshedUtil> viewshed = new ossimViewshedUtil;
-   if (!viewshed->initialize(ap))
-      exit(1);
-
-   // Add a listener for the percent complete to standard output.
-   ossimStdOutProgress prog(0, true);
-   viewshed->addListener(&prog);
-   
-   // Start the viewshed process:
-   bool success = viewshed->execute();
-   viewshed = 0;
-   
-   double dt = ossimTimer::instance()->time_s() - t0;
-   cout << argv[0] << "Elapsed Time: " << dt << " s\n" << endl;
-   if (success)
-      exit(0);
-   exit(1);
-}
diff --git a/ossim/src/apps/ossim-viirs-proc/ossim-viirs-proc.cpp b/ossim/src/apps/ossim-viirs-proc/ossim-viirs-proc.cpp
deleted file mode 100644
index 36fcd51..0000000
--- a/ossim/src/apps/ossim-viirs-proc/ossim-viirs-proc.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// File: ossim-viirs-proc
-//
-// Description: Application to extract VIIRS Radiance layer, shifting
-// min/max linearly to 16 bit space with coarse grid geometry file.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimMetadataInterface.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimShiftFilter.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/projection/ossimCoarseGridModel.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimRpcSolver.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-
-#include <iomanip>
-#include <iostream>
-#include <string>
-using namespace std;
-
-int main(int argc, char* argv[])
-{
-   int status = 0;
-   ossimArgumentParser argumentParser(&argc, argv);
-   ossimInit::instance()->addOptions(argumentParser);
-
-   // Timer for elapsed time:
-   ossimTimer::instance()->setStartTick();
-   
-   ossimInit::instance()->initialize(argc, argv);
-   argumentParser.getApplicationUsage()->setApplicationName(argumentParser.getApplicationName());
-   argumentParser.getApplicationUsage()->setDescription(argumentParser.getApplicationName() + " Extracts VIIRS Radiance layer from hdf5 file, shifting min/max linearly to 16 bit space with a coarse grid or RPC geometry file");
-   argumentParser.getApplicationUsage()->setCommandLineUsage(argumentParser.getApplicationName() + " [options] <image_file>");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--cg","Create a coarse grid projection");
-   argumentParser.getApplicationUsage()->addCommandLineOption("--rpc","Create an RPC projection");
-   bool rpcFlag      = false;
-   bool cgFlag       = false;
-
-   if (argumentParser.read("--rpc"))
-   {
-      rpcFlag = true;
-   }
-   if (argumentParser.read("--cg"))
-   {
-      cgFlag = true;
-   }
-
-   if(!rpcFlag&&!cgFlag)
-   {
-      cgFlag = true;
-   }
-   if(rpcFlag&&cgFlag)
-   {
-      rpcFlag = false;
-   }
-   if (argumentParser.read("-h") || argumentParser.read("--help") || (argumentParser.argc() == 1))
-   {
-      argumentParser.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-      ossimInit::instance()->finalize();
-      exit(0);
-
-      cout << argv[0] << " <image_file>"
-           << "\n\nExtracts VIIRS Radiance layer from hdf5 file, shifting min/max "
-           << "linearly to 16 bit space with coarse grid geometry file.\n" << endl;
-   }
-   else
-   {
-      ossimFilename inputFile = argv[1];
-      if ( inputFile.exists() )
-      {
-         ossimFilename outputFile = inputFile.expand().noExtension();
-         outputFile.string() += "_1.tif";
-         
-         if ( inputFile != outputFile )
-         {
-            std::string command =
-               "ossim-cmm --null -9999.0 --reader-prop layer=/All_Data/VIIRS-DNB-SDR_All/Radiance ";
-            command += inputFile.string();
-            cout << "Executing command: " << command << endl;
-
-            status = system( command.c_str() );
-
-            if ( status == 0 )
-            {
-               ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
-               if ( sic->open( inputFile, false ) )
-               {
-                  cout << "Opened: " << inputFile << endl;
-
-                  // Set the entry to the Radiance layer.
-                  ossimRefPtr<ossimProperty> readerProp = new  ossimStringProperty(
-                     ossimString("layer"),
-                     ossimString("/All_Data/VIIRS-DNB-SDR_All/Radiance") );
-
-                  sic->getImageHandler()->setProperty( readerProp );
-
-                  // Add filter to shift/stretch data uint16 range.
-                  ossimRefPtr<ossimShiftFilter> sf = new ossimShiftFilter();
-                  sf->setNullPixelValue( 0.0 );
-                  sf->setMinPixelValue( 1.0 );
-                  sf->setMaxPixelValue( 65535.0 );
-                  sic->addFirst( sf.get() );
-
-                  // Cast it to uint16:
-                  ossimRefPtr<ossimCastTileSourceFilter> cf =
-                     new ossimCastTileSourceFilter(0, OSSIM_UINT16 );
-                  sic->addFirst( cf.get() );
-
-                  // Put a cache in front of resampler.
-                  sic->addCache();
-                  
-                  // sic->addResampler();
-                  
-                  sic->initialize();
-                  
-                  // Write image:
-                  ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
-                  if ( writer->open( outputFile ) )
-                  {
-                     // Turn on overviews and histograms:
-                     writer->setWriteOverviewFlag( true );
-                     writer->setWriteHistogramFlag( true );
-
-                     // Add a listener to get percent complete.
-                     ossimStdOutProgress prog(0, true);
-                     writer->addListener(&prog);
-                     
-                     writer->connectMyInputTo(0, sic.get());
-
-                     ossimIrect rect = writer->getAreaOfInterest();
-                     
-                     writer->execute();
-
-                     cout << "Wrote file: " << outputFile << endl;
-                     
-                     ossimRefPtr<ossimImageHandler> ih = sic->getImageHandler();
-
-                     if ( ih.valid() )
-                     {
-                        //---
-                        // If there is a coarse grid model write it out so the
-                        // oqutput file will pick it up.
-                        //---
-                        ossimRefPtr<ossimImageGeometry> geom = sic->getImageHandler()->
-                           getImageGeometry();
-                        if ( geom.valid() )
-                        {
-                           ossimRefPtr<ossimProjection> proj = geom->getProjection();
-                           if ( proj.valid() )
-                           {
-                              bool enableElevation = true;
-                              ossimFilename geomFile = outputFile.noExtension();
-                              geomFile.string() += ".geom";
-
-                              if(rpcFlag)
-                              {
-                                 ossimDrect imageRect = sic->getImageHandler()->getBoundingRect();
-                                 ossimRefPtr<ossimRpcSolver> solver =
-                                    new ossimRpcSolver(enableElevation);
-
-                                 solver->solveCoefficients(imageRect,
-                                                           geom.get(),
-                                                           40,
-                                                           40);
-
-                                 ossimRefPtr<ossimImageGeometry> outputProj =
-                                    solver->createRpcProjection();
-                                 ossimKeywordlist geomKwl;
-                                 outputProj->saveState(geomKwl);
-                                 geomKwl.write(geomFile);
-                              }
-                              else
-                              {
-                                 ossimRefPtr<ossimCoarseGridModel> cg =
-                                    dynamic_cast<ossimCoarseGridModel*>( proj.get() );
-                                 if ( cg.valid() )
-                                 {
-                                    // this saves geom file as well
-                                    cg->saveCoarseGrid( geomFile );
-                                    cout << "Wrote file: " << geomFile << endl;
-                                 }
-                                 else
-                                 {
-                                    // Save the state to keyword list.
-                                    ossimKeywordlist geomKwl;
-                                    geom->saveState(geomKwl);
-
-                                    // Write to file:
-                                    geomKwl.write( geomFile.c_str() );
-                                    cout << "Wrote file: " << geomFile << endl;
-                                 }
-                              }
-                           }
-                        }
-
-                        //---
-                        // If the image handler is a metadata interface pass the metadata
-                        // to the dot.omd file and rewrite it.
-                        //---
-                        ossimMetadataInterface* mdi =
-                           dynamic_cast<ossimMetadataInterface*>( ih.get() );
-                        if ( mdi )
-                        {
-                           ossimFilename omdFile = outputFile.noExtension();
-                           omdFile += ".omd";
-                           ossimRefPtr<ossimKeywordlist> kwl = new ossimKeywordlist();
-                           if ( omdFile.exists() )
-                           {
-                              kwl->addFile( omdFile );
-                           }
-                           
-                           std::string prefix = "";
-                           mdi->addMetadata( kwl.get(), prefix );
-                           kwl->write( omdFile.c_str() );
-                           cout << "Wrote file: " << omdFile << endl;
-                        }
-                     }
-                  }
-                  else
-                  {
-                     cerr << "Could not open: " << outputFile << endl;
-                  }
-               }
-            }
-         } 
-         else // Matches: 
-         {
-            cerr << "Input file is same as output file!  Returning..." << endl;
-            status = -1;
-         }
-      }
-      else // Match: if ( inputFile.exists() ){ ... }
-      {
-         cerr << "Input file does not exists!" << endl;
-         status = -1;
-      }
-   }
-
-   cout << "Elapsed time in seconds: "
-        << std::setiosflags(ios::fixed)
-        << std::setprecision(3)
-        << ossimTimer::instance()->time_s() << "\n";
-
-   return status;
-}
-
diff --git a/ossim/src/apps/ossim-ws-cmp/Makefile b/ossim/src/apps/ossim-ws-cmp/Makefile
deleted file mode 100644
index 3b85a27..0000000
--- a/ossim/src/apps/ossim-ws-cmp/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-PROGRAM=ossim-ws-cmp
-include ../../../makeprog.mak
diff --git a/ossim/src/apps/ossim-ws-cmp/makefile.vc b/ossim/src/apps/ossim-ws-cmp/makefile.vc
deleted file mode 100644
index 2150612..0000000
--- a/ossim/src/apps/ossim-ws-cmp/makefile.vc
+++ /dev/null
@@ -1,11 +0,0 @@
-###
-# $Id: makefile.vc 12829 2008-05-08 19:42:50Z dburken $
-# 
-# nmake makefile
-#
-# Typical usage:  nmake /f makefile.vc
-###
-
-PROGRAM=ossim-ws-cmp
-
-!include ..\makefile.inc
diff --git a/ossim/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp b/ossim/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp
deleted file mode 100644
index 42f64d9..0000000
--- a/ossim/src/apps/ossim-ws-cmp/ossim-ws-cmp.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description: Application to compare to workspaces.
-//
-// $Id: foo.cpp 14815 2009-07-01 14:59:11Z gpotts $
-//----------------------------------------------------------------------------
-
-#include <cstdlib> /* for system command */
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/init/ossimInit.h>
-#include <iostream>
-using namespace std;
-
-static bool trace = false; // Turn on to see more stuff...
-
-static void cmpDir(const ossimFilename& wsa,
-                   const ossimFilename& wsb,
-                   const ossimFilename& dir);
-
-static void cmpFile(const ossimFilename& wsa,
-                    const ossimFilename& wsb,
-                    const ossimFilename& file);
-
-static bool isIgnoredFile(const ossimFilename& file);
-
-static void usage()
-{
-   cout << "Usage:  ossim-ws-cmp <wsa> <wsb>\n"
-        << "Compares workspace a (wsa) to workspace b (wsb).\n"
-        << "NOTE: requires \"diff\" command."
-        << endl;
-}
-
-int main(int argc, char *argv[])
-{
-   if (argc != 3)
-   {
-      usage();
-      return 0;
-   }
-
-   ossimFilename wsa = argv[1];
-   ossimFilename wsb = argv[2];
-
-   if ( !wsa.isDir() )
-   {
-      cout << "<wsa> is NOT a directory: " << wsa << endl;
-      usage();
-      return 0;
-   }
-
-   if ( !wsb.isDir() )
-   {
-      cout << "<wsb> is NOT a directory: " << wsb << endl;
-      usage();
-      return 0;
-   }
-
-   cout << "wsa: " << wsa
-        << "\nwsb: " << wsb
-        << endl;
-
-   cmpDir(wsa, wsb, wsa);
-   
-   return 0;
-}
-
-void cmpDir(const ossimFilename& wsa,
-            const ossimFilename& wsb,
-            const ossimFilename& dir)
-{
-   ossimDirectory d;
-   if ( d.open(dir) )
-   {
-      ossimFilename f;
-      if (d.getFirst(f))
-      {
-         while ( f != "" )
-         {
-            // cout << f << endl;
-
-            if ( isIgnoredFile(f) == false )
-            {
-               if ( f.isDir() )
-               {
-                  cmpDir(wsa, wsb, f);
-               }
-               else
-               {
-                  cmpFile(wsa, wsb, f);
-               }
-            }
-            d.getNext(f);
-         }
-      }
-   }
-   else
-   {
-      cout << "Could not open: " << wsa << endl;
-   }
-}
-
-void cmpFile(const ossimFilename& wsa,
-             const ossimFilename& wsb,
-             const ossimFilename& file)
-{
-   ossimFilename bFile = file.substitute(wsa, wsb);
-
-   if ( !file.exists() )
-   {
-      cout << "\nnotice: wsb file: " << bFile
-           << "\nnotice: wsa file does not exists: " << file
-           << "\nb -> a copy command:"
-           << "\ncp " << bFile << " " << file << "\n"
-           << endl;
-   }
-   if ( !bFile.exists() )
-   {
-      cout << "\nnotice: wsa file: " << file
-           << "\nnotice: wsb file does not exists: " << bFile
-           << "\na -> b copy command:"
-           << "\ncp " << file << " " << bFile << "\n"
-           << endl;
-   }
-
-   if ( file.exists() && bFile.exists() )
-   {
-      std::string command = "diff -w --ignore-matching-lines=\\$Id ";
-      command += file.string();
-      command += " ";
-      command += bFile.string();
-      
-      int status = system( command.c_str() );
-      
-      if ( status != 0 )
-      {
-         cout << "\nnotice files differ:"
-              << "\nwsa file: " << file
-              << "\nwsb file: " << bFile
-              << "\na -> b copy command:"
-              << "\ncp " << file << " " << bFile
-              << "\nb -> a copy command:"
-              << "\ncp " << bFile << " " << file << "\n"
-              << endl;
-      }
-   }
-}
-
-bool isIgnoredFile(const ossimFilename& file)
-{
-   bool status = false;
-
-   if (trace)
-   {
-      cout << "file: " << file << endl;
-   }
-   
-   if ( file.size() )
-   {
-      ossimFilename f = file.file();
-      ossimFilename e = file.ext();
-      
-      if ( ( f == ".moc" )                  ||
-           ( f == ".svn" )                  ||
-           ( f == "CMakeCache.txt" )        ||
-           ( f == "CMakeFiles" )            ||
-           ( f == "cmake_install.cmake" )   ||
-           ( f == "cmake_uninstall.cmake" ) ||
-           ( f == "CVS" )                   ||
-           ( f == "doc" )                   || 
-           ( f == ".cvsignore" )            ||
-           ( f == "bin" )                   ||
-           ( f == "build" )                 ||
-           ( f == "builds" )                ||
-           ( f == "configure")              ||
-           ( f == "config.log" )            ||
-           ( f == "config.status")          ||
-           ( f == "lib" )                   ||
-           ( f == "Makefile" )              ||
-           ( f == "Makefile.common" )       ||
-           ( f == "make.out" )              ||
-           ( f == "projects")               ||
-           ( f == "wxmac.icns")             ||
-           ( f == "xcode" )                 ||
-           ( e == "d" )                     || // dot d file
-           ( e == "o" )                     || // object file
-           ( e == "obj" )                   ||
-           ( e == "exe" )                   ||
-           ( e == "tmp" )
-           )
-      {
-         status = true;
-      }
-      else if ( file.contains("apps") || file.contains("test") )
-      {
-         if ( file.isDir() ) // Go into apps and test dir.
-         {
-            status = false;
-         }
-         else if ( (e != "h") && (e != "cpp") )
-         {
-            // Ignore binary files. Only diff headers and source files.
-            status = true;
-         }
-      }
-      if ( file[file.size()-1] == '~' )
-      {
-         status = true; // xemacs
-      }
-      
-   } // if ( file.size() )
-   else
-   {
-      status = true; // empty
-   }
-
-   if ( trace && (status == true) )
-   {
-      cout << "ignoring file: " << file << endl;
-   }
-   
-   return status;
-}
diff --git a/ossim/src/ossim/CMakeLists.txt b/ossim/src/ossim/CMakeLists.txt
deleted file mode 100644
index d8dddd9..0000000
--- a/ossim/src/ossim/CMakeLists.txt
+++ /dev/null
@@ -1,146 +0,0 @@
-SET(LIB_NAME ossim)
-
-########################################### BEGIN: GRAB SOURCE FILES ##########################################
-FILE(GLOB ossim_dll_main_SRCS RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/dll_main/*.cpp")
-FILE(GLOB ossim_SRCS  RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} 
-        "${CMAKE_CURRENT_SOURCE_DIR}/ossimConfig*.cpp" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/ossimVer*.cpp" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/init/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/init/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/base/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/base/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/elevation/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/elevation/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/font/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/font/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/imaging/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/imaging/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/matrix/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/matrix/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/parallel/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/parallel/*.c"
-        "${CMAKE_CURRENT_SOURCE_DIR}/point_cloud/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/point_cloud/*.c"
-        "${CMAKE_CURRENT_SOURCE_DIR}/projection/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/projection/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/support_data/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/support_data/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/util/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/util/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/vec/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/vec/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/video/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/video/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/vpfutil/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/vpfutil/*.c" 
-        "${CMAKE_CURRENT_SOURCE_DIR}/plugin/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/plugin/*.c")
-
-IF(WIN32)
-	LIST(APPEND ossim_SRCS "${ossim_dll_main_SRCS}")
-ENDIF(WIN32)
-
-ADD_DEFINITIONS("-DOSSIMMAKINGDLL")
-############################### GRAB HEADERS #####################################
-FILE(GLOB ossim_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/*.h")
-FILE(GLOB ossim_base_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/base/*.h")
-FILE(GLOB ossim_elevation_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/elevation/*.h")
-FILE(GLOB ossim_font_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/font/*.h")
-FILE(GLOB ossim_imaging_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/imaging/*.h")
-FILE(GLOB ossim_init_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/init/*.h")
-FILE(GLOB ossim_matrix_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/matrix/*.h")
-FILE(GLOB ossim_parallel_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/parallel/*.h")
-FILE(GLOB ossim_plugin_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/plugin/*.h")
-FILE(GLOB ossim_point_cloud_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/point_cloud/*.h")
-FILE(GLOB ossim_projection_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/projection/*.h")
-FILE(GLOB ossim_support_data_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/support_data/*.h")
-FILE(GLOB ossim_util_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/util/*.h")
-FILE(GLOB ossim_vec_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/vec/*.h")
-FILE(GLOB ossim_video_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/video/*.h")
-FILE(GLOB ossim_vpfutil_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../include/ossim/vpfutil/*.h")
-
-MESSAGE( "${ossim_HDRS}" )
-SET(OSSIM_HEADER_FILES 
-	${ossim_HDRS}
- 	${ossim_base_HDRS} ${ossim_elevation_HDRS} ${ossim_font_HDRS}  ${ossim_imaging_HDRS} ${ossim_init_HDRS}
-	${ossim_matrix_HDRS} ${ossim_parallel_HDRS} ${ossim_plugin_HDRS} ${ossim_point_cloud_HDRS} ${ossim_projection_HDRS} ${ossim_support_data_HDRS} ${ossim_util_HDRS} ${ossim_vec_HDRS} ${ossim_video_HDRS} ${ossim_vpfutil_HDRS} )
-
-
-################################## APPLE Framework support deep header mapping ###################################
-IF(APPLE)
-  FOREACH(f  ${ossim_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_base_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/base )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_elevation_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/elevation )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_font_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/font )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_imaging_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/imaging )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_init_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/init )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_matrix_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/matrix )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_parallel_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/parallel )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_plugin_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/plugin )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_point_cloud_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/point_cloud )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_projection_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/projection )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_support_data_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/support_data )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_util_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/util )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_vec_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/vec )
-  ENDFOREACH(f)
-  FOREACH(f  ${ossim_video_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/video )
-  ENDFOREACH(f)
-
-  FOREACH(f  ${ossim_vpfutil_HDRS} )
-      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/vpfutil )
-  ENDFOREACH(f)
-
-ENDIF(APPLE)
-
-#################################### SETUP the required link parameters using the Ossim macro ####################################
-OSSIM_LINK_LIBRARY(${LIB_NAME} 
-                   COMPONENT_NAME ossim 
-                   TYPE ${OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC}
-                   LIBRARIES ${ossimDependentLibs}
-                   HEADERS "${OSSIM_HEADER_FILES}" 
-                   PUBLIC_HEADERS "${ossim_HDRS}"
-                   SOURCE_FILES "${ossim_SRCS}"
-                   INSTALL_LIB VERSION_SYMLINKS)
-
-# The install headers was duplicating ossimVersion.h and ossimConfig.h in "install_prefix/include".
-# INSTALL_HEADERS)
-
-########################################################## If DO special case for ossim core needs to have the files mapped properly ################################ 
-IF(NOT OSSIM_BUILD_FRAMEWORKS OR NOT APPLE)
-   install(FILES ${ossim_HDRS} DESTINATION include/ossim COMPONENT ossim) 
-   install(FILES ${ossim_base_HDRS} DESTINATION include/ossim/base COMPONENT ossim) 
-   install(FILES ${ossim_elevation_HDRS} DESTINATION include/ossim/elevation COMPONENT ossim)
-   install(FILES ${ossim_font_HDRS} DESTINATION include/ossim/font COMPONENT ossim)
-   install(FILES ${ossim_imaging_HDRS} DESTINATION include/ossim/imaging COMPONENT ossim) 
-   install(FILES ${ossim_init_HDRS} DESTINATION include/ossim/init COMPONENT ossim) 
-   install(FILES ${ossim_matrix_HDRS} DESTINATION include/ossim/matrix COMPONENT ossim) 
-   install(FILES ${ossim_parallel_HDRS} DESTINATION include/ossim/parallel COMPONENT ossim) 
-   install(FILES ${ossim_plugin_HDRS} DESTINATION include/ossim/plugin COMPONENT ossim) 
-   install(FILES ${ossim_point_cloud_HDRS} DESTINATION include/ossim/point_cloud COMPONENT ossim) 
-   install(FILES ${ossim_projection_HDRS} DESTINATION include/ossim/projection COMPONENT ossim) 
-   install(FILES ${ossim_support_data_HDRS} DESTINATION include/ossim/support_data COMPONENT ossim) 
-   install(FILES ${ossim_util_HDRS} DESTINATION include/ossim/util COMPONENT ossim) 
-   install(FILES ${ossim_vec_HDRS} DESTINATION include/ossim/vec COMPONENT ossim) 
-   install(FILES ${ossim_video_HDRS} DESTINATION include/ossim/video COMPONENT ossim) 
-   install(FILES ${ossim_vpfutil_HDRS} DESTINATION include/ossim/vpfutil COMPONENT ossim) 
-ENDIF(NOT OSSIM_BUILD_FRAMEWORKS OR NOT APPLE)
-# ENDIF(NOT OSSIM_FRAMEWORK_GENERATION OR NOT APPLE)
-
-# ---
-# This is the old list of library for the link line.  Replaced with ${ossimDependentLibs}.  
-# Kept temporarily in case I broke something.  drb - 31 Aug. 2011
-# LIBRARIES ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${GEOTIFF_LIBRARIES} ${OPENTHREADS_LIBRARIES} ${FREETYPE_LIBRARIES} ${MPI_LIBRARIES} ${ZLIB_LIBRARIES} ${DL_LIBRARY}
-# ---
diff --git a/ossim/src/ossim/base/makefile.vc b/ossim/src/ossim/base/makefile.vc
deleted file mode 100644
index 508b310..0000000
--- a/ossim/src/ossim/base/makefile.vc
+++ /dev/null
@@ -1,214 +0,0 @@
-###
-# $Id: makefile.vc 16135 2009-12-18 15:07:01Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossim2dBilinearTransform.obj \
-ossim2dLinearRegression.obj \
-ossim2dTo2dIdentityTransform.obj \
-ossim2dTo2dShiftTransform.obj \
-ossim2dTo2dTransform.obj \
-ossim2dTo2dTransformFactory.obj \
-ossim2dTo2dTransformRegistry.obj \
-ossimActiveEdgeTable.obj \
-ossimAdjustableParameterInfo.obj \
-ossimAdjustableParameterInterface.obj \
-ossimAdjustmentInfo.obj \
-ossimAffineTransform.obj \
-ossimApplicationUsage.obj \
-ossimArgumentParser.obj \
-ossimBaseObjectFactory.obj \
-ossimBilSplitter.obj \
-ossimBooleanProperty.obj \
-ossimCmyVector.obj \
-ossimColorProperty.obj \
-ossimColumnVector3d.obj \
-ossimCommon.obj \
-ossimConnectableContainer.obj \
-ossimConnectableContainerInterface.obj \
-ossimConnectableDisplayListener.obj \
-ossimConnectableObject.obj \
-ossimConnectableObjectListener.obj \
-ossimConnectionEvent.obj \
-ossimContainerEvent.obj \
-ossimContainerProperty.obj \
-ossimCplUtil.obj \
-ossimCsvFile.obj \
-ossimCustomEditorWindow.obj \
-ossimCustomEditorWindowFactoryBase.obj \
-ossimCustomEditorWindowRegistry.obj \
-ossimDataObject.obj \
-ossimDate.obj \
-ossimDateProperty.obj \
-ossimDatum.obj \
-ossimDatumFactory.obj \
-ossimDatumFactoryRegistry.obj \
-ossimDblGrid.obj \
-ossimDirectory.obj \
-ossimDirectoryData.obj \
-ossimDirectoryTree.obj \
-ossimDisplayEventListener.obj \
-ossimDisplayInterface.obj \
-ossimDisplayListEvent.obj \
-ossimDisplayRefreshEvent.obj \
-ossimDms.obj \
-ossimDoubleGridProperty.obj \
-ossimDpt.obj \
-ossimDpt3d.obj \
-ossimDrect.obj \
-ossimDuration.obj \
-ossimEbcdicToAscii.obj \
-ossimEcefPoint.obj \
-ossimEcefRay.obj \
-ossimEcefVector.obj \
-ossimElevationManagerEvent.obj \
-ossimElevationManagerEventListener.obj \
-ossimEllipsoid.obj \
-ossimEllipsoidFactory.obj \
-ossimEndian.obj \
-ossimEnvironmentUtility.obj \
-ossimEquTokenizer.obj \
-ossimErrorCodes.obj \
-ossimErrorStatusInterface.obj \
-ossimEvent.obj \
-ossimException.obj \
-ossimFactoryBaseTemplate.obj \
-ossimFilename.obj \
-ossimFilenameProperty.obj \
-ossimFontInformation.obj \
-ossimFontProperty.obj \
-ossimFpt.obj \
-ossimFpt3d.obj \
-ossimGeoPolygon.obj \
-ossimGeoTiffCoordTransformsLut.obj \
-ossimGeoTiffDatumLut.obj \
-ossimGeoid.obj \
-ossimGeoidEgm96.obj \
-ossimGeoidManager.obj \
-ossimGeoidNgs.obj \
-ossimGeoidNgsHeader.obj \
-ossimGeoref.obj \
-ossimGpt.obj \
-ossimGrect.obj \
-ossimGzStream.obj \
-ossimHexString.obj \
-ossimHistogram.obj \
-ossimHistogramSource.obj \
-ossimHsiVector.obj \
-ossimHsvVector.obj \
-ossimId.obj \
-ossimIdManager.obj \
-ossimImageAoiListener.obj \
-ossimImageGeometryEvent.obj \
-ossimImageGeometryEventListener.obj \
-ossimImageTypeLut.obj \
-ossimInterleaveTypeLut.obj \
-ossimIoStream.obj \
-ossimIpt.obj \
-ossimIrect.obj \
-ossimJpegYCbCrVector.obj \
-ossimKeyword.obj \
-ossimKeywordNames.obj \
-ossimKeywordlist.obj \
-ossimLeastSquaresBilin.obj \
-ossimLine.obj \
-ossimListener.obj \
-ossimListenerManager.obj \
-ossimLookUpTable.obj \
-ossimLsrPoint.obj \
-ossimLsrRay.obj \
-ossimLsrSpace.obj \
-ossimLsrVector.obj \
-ossimMatrix3x3.obj \
-ossimMatrix4x4.obj \
-ossimMatrixProperty.obj \
-ossimMouseEvent.obj \
-ossimMouseListener.obj \
-ossimMultiBandHistogram.obj \
-ossimMultiResLevelHistogram.obj \
-ossimNBandLutDataObject.obj \
-ossimNadconGridDatum.obj \
-ossimNadconGridFile.obj \
-ossimNadconGridHeader.obj \
-ossimNadconNarDatum.obj \
-ossimNadconNasDatum.obj \
-ossimNormRgbVector.obj \
-ossimNotify.obj \
-ossimNumericProperty.obj \
-ossimObject.obj \
-ossimObjectDestructingEvent.obj \
-ossimObjectFactory.obj \
-ossimObjectFactoryRegistry.obj \
-ossimOutputSource.obj \
-ossimPackedBits.obj \
-ossimPolyArea2d.obj \
-ossimPolyLine.obj \
-ossimPolygon.obj \
-ossimPreferences.obj \
-ossimProcessInterface.obj \
-ossimProcessListener.obj \
-ossimProcessProgressEvent.obj \
-ossimProperty.obj \
-ossimPropertyInterface.obj \
-ossimPropertyInterfaceFactory.obj \
-ossimPropertyInterfaceRegistry.obj \
-ossimQuadTreeWarp.obj \
-ossimQuadrilateralMap.obj \
-ossimQuaternion.obj \
-ossimROIEvent.obj \
-ossimROIEventListener.obj \
-ossimRationalNumber.obj \
-ossimRectanglePartitioner.obj \
-ossimRectilinearDataObject.obj \
-ossimReferenced.obj \
-ossimRefreshEvent.obj \
-ossimRegExp.obj \
-ossimRgbLutDataObject.obj \
-ossimRgbVector.obj \
-ossimRtti.obj \
-ossimScalarTypeLut.obj \
-ossimSevenParamDatum.obj \
-ossimSource.obj \
-ossimStateChangedEvent.obj \
-ossimStdOutProgress.obj \
-ossimStreamBase.obj \
-ossimStreamFactory.obj \
-ossimStreamFactoryRegistry.obj \
-ossimString.obj \
-ossimStringListProperty.obj \
-ossimStringProperty.obj \
-ossimTDpt.obj \
-ossimTempFilename.obj \
-ossimTextProperty.obj \
-ossimThreeParamDatum.obj \
-ossimTieGpt.obj \
-ossimTieGptSet.obj \
-ossimTileHash.obj \
-ossimTiledImageHash.obj \
-ossimTimer.obj \
-ossimTrace.obj \
-ossimTraceManager.obj \
-ossimUnitConversionTool.obj \
-ossimUnitTypeLut.obj \
-ossimUsgsQuad.obj \
-ossimViewController.obj \
-ossimViewEvent.obj \
-ossimViewInterface.obj \
-ossimViewListener.obj \
-ossimVrect.obj \
-ossimWgs72Datum.obj \
-ossimWgs84Datum.obj \
-ossimWms.obj \
-ossimXmlAttribute.obj \
-ossimXmlDocument.obj \
-ossimXmlNode.obj \
-ossimXmlString.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/base/ossim2dTo2dMatrixTransform.cpp b/ossim/src/ossim/base/ossim2dTo2dMatrixTransform.cpp
deleted file mode 100644
index d71d9a0..0000000
--- a/ossim/src/ossim/base/ossim2dTo2dMatrixTransform.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:
-//
-// Description: 
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossim2dTo2dMatrixTransform.h>
-#include <ossim/base/ossimLeastSquaresBilin.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <iostream>
-RTTI_DEF1(ossim2dTo2dMatrixTransform, "ossim2dTo2dMatrixTransform", ossim2dTo2dTransform);
-ossim2dTo2dMatrixTransform::ossim2dTo2dMatrixTransform()
-{
-   std::fill(m_coefficientsXTerm, m_coefficientsXTerm+4, 0.0);
-   std::fill(m_coefficientsYTerm, m_coefficientsYTerm+4, 0.0);
-   std::fill(m_inverseCoefficientsXTerm, m_inverseCoefficientsXTerm+4, 0.0);
-   std::fill(m_inverseCoefficientsYTerm, m_inverseCoefficientsYTerm+4, 0.0);
-   
-   // setup identity
-   //
-   m_coefficientsXTerm[1] = 1.0;
-   m_coefficientsYTerm[2] = 1.0;
-   m_inverseCoefficientsXTerm[1] = 1.0;
-   m_inverseCoefficientsYTerm[2] = 1.0;
-}
-
-ossim2dTo2dMatrixTransform::ossim2dTo2dMatrixTransform(const ossim2dTo2dMatrixTransform& src)
-:ossim2dTo2dTransform(src)
-{
-   std::copy(src.m_coefficientsXTerm, src.m_coefficientsXTerm+4, m_coefficientsXTerm);
-   std::copy(src.m_coefficientsYTerm, src.m_coefficientsYTerm+4, m_coefficientsYTerm);
-   std::copy(src.m_inverseCoefficientsXTerm, src.m_inverseCoefficientsXTerm+4, m_inverseCoefficientsXTerm);
-   std::copy(src.m_inverseCoefficientsYTerm, src.m_inverseCoefficientsYTerm+4, m_inverseCoefficientsYTerm);
-}
-
-void ossim2dTo2dMatrixTransform::setFromPoints(const ossimDpt& in1, const ossimDpt& in2, const ossimDpt& in3, const ossimDpt& in4,
-                                             const ossimDpt& out1, const ossimDpt& out2, const ossimDpt& out3, const ossimDpt& out4)
-{
-   ossimDpt input[4];
-   ossimDpt output[4];
-   
-   input[0] = in1;
-   input[1] = in2;
-   input[2] = in3;
-   input[3] = in4;
-   
-   output[0] = out1;
-   output[1] = out2;
-   output[2] = out3;
-   output[3] = out4;
-   
-   setFromPoints(&input[0], &output[0], 4);
-}
-
-void ossim2dTo2dMatrixTransform::setFromPoints(const ossimDpt* input,
-                                             const ossimDpt* output, 
-                                             ossim_uint32 arraySize)
-{
-   ossimLeastSquaresBilin inx;
-   ossimLeastSquaresBilin inversex;
-   ossimLeastSquaresBilin iny;
-   ossimLeastSquaresBilin inversey;
-   ossim_uint32 idx = 0;
-   for(idx=0; idx < arraySize; ++idx)
-   {
-      inx.addSample(input[idx].x, input[idx].y, output[idx].x);
-      inversex.addSample(output[idx].x, output[idx].y, input[idx].x);
-      iny.addSample(input[idx].x, input[idx].y, output[idx].y);
-      inversey.addSample(output[idx].x, output[idx].y, input[idx].y);
-   }
-   inx.solveLS();
-   inversex.solveLS();
-   iny.solveLS();
-   inversey.solveLS();
-   inx.getLSParms(m_coefficientsXTerm[0], m_coefficientsXTerm[1], m_coefficientsXTerm[2], m_coefficientsXTerm[3]);
-   iny.getLSParms(m_coefficientsYTerm[0], m_coefficientsYTerm[1], m_coefficientsYTerm[2], m_coefficientsYTerm[3]);
-   inversex.getLSParms(m_inverseCoefficientsXTerm[0], m_inverseCoefficientsXTerm[1], m_inverseCoefficientsXTerm[2], m_inverseCoefficientsXTerm[3]);
-   inversey.getLSParms(m_inverseCoefficientsYTerm[0], m_inverseCoefficientsYTerm[1], m_inverseCoefficientsYTerm[2], m_inverseCoefficientsYTerm[3]);
-}
-
-bool ossim2dTo2dMatrixTransform::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix)const
-{
-   ossimString xterm = (ossimString::toString(m_coefficientsXTerm[0])
-                        +" "+ossimString::toString(m_coefficientsXTerm[1])
-                        +" "+ossimString::toString(m_coefficientsXTerm[2])
-                        +" "+ossimString::toString(m_coefficientsXTerm[3]));
-   ossimString yterm = (ossimString::toString(m_coefficientsYTerm[0])
-                        +" "+ossimString::toString(m_coefficientsYTerm[1])
-                        +" "+ossimString::toString(m_coefficientsYTerm[2])
-                        +" "+ossimString::toString(m_coefficientsYTerm[3]));
-   ossimString inverse_xterm = (ossimString::toString(m_inverseCoefficientsXTerm[0])
-                        +" "+ossimString::toString(m_inverseCoefficientsXTerm[1])
-                        +" "+ossimString::toString(m_inverseCoefficientsXTerm[2])
-                        +" "+ossimString::toString(m_inverseCoefficientsXTerm[3]));
-   ossimString inverse_yterm = (ossimString::toString(m_inverseCoefficientsYTerm[0])
-                        +" "+ossimString::toString(m_inverseCoefficientsYTerm[1])
-                        +" "+ossimString::toString(m_inverseCoefficientsYTerm[2])
-                        +" "+ossimString::toString(m_inverseCoefficientsYTerm[3]));
-   
-   kwl.add(prefix, "xterm", xterm, true);
-   kwl.add(prefix, "yterm", yterm, true);
-   kwl.add(prefix, "inverse_xterm", inverse_xterm, true);
-   kwl.add(prefix, "inverse_yterm", inverse_yterm, true);
-   return ossim2dTo2dTransform::saveState(kwl, prefix);
-}
-
-bool ossim2dTo2dMatrixTransform::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   bool result = true;
-   ossimString xterm = kwl.find(prefix, "xterm");
-   ossimString yterm = kwl.find(prefix, "yterm");
-   ossimString inverse_xterm = kwl.find(prefix, "inverse_xterm");
-   ossimString inverse_yterm = kwl.find(prefix, "inverse_yterm");
-   
-   std::vector<ossimString> values;
-   xterm.split(values, " ");
-   if(values.size() == 4)
-   {
-      m_coefficientsXTerm[0] = values[0].toDouble();
-      m_coefficientsXTerm[1] = values[1].toDouble();
-      m_coefficientsXTerm[2] = values[2].toDouble();
-      m_coefficientsXTerm[3] = values[3].toDouble();
-   }
-   else 
-   {
-      result = false;
-   }
-   values.clear();
-   yterm.split(values, " ");
-   if(values.size() == 4)
-   {
-      m_coefficientsYTerm[0] = values[0].toDouble();
-      m_coefficientsYTerm[1] = values[1].toDouble();
-      m_coefficientsYTerm[2] = values[2].toDouble();
-      m_coefficientsYTerm[3] = values[3].toDouble();
-   }
-   else 
-   {
-      result = false;
-   }
-   values.clear();
-   inverse_xterm.split(values, " ");
-   if(values.size() == 4)
-   {
-      m_inverseCoefficientsXTerm[0] = values[0].toDouble();
-      m_inverseCoefficientsXTerm[1] = values[1].toDouble();
-      m_inverseCoefficientsXTerm[2] = values[2].toDouble();
-      m_inverseCoefficientsXTerm[3] = values[3].toDouble();
-   }
-   else 
-   {
-      result = false;
-   }
-   values.clear();
-   inverse_yterm.split(values, " ");
-   if(values.size() == 4)
-   {
-      m_inverseCoefficientsYTerm[0] = values[0].toDouble();
-      m_inverseCoefficientsYTerm[1] = values[1].toDouble();
-      m_inverseCoefficientsYTerm[2] = values[2].toDouble();
-      m_inverseCoefficientsYTerm[3] = values[3].toDouble();
-   }
-   else 
-   {
-      result = false;
-   }
-
-   if(result)
-   {
-      result = ossim2dTo2dTransform::loadState(kwl, prefix);
-   }
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/base/ossim2dTo2dTransform.cpp b/ossim/src/ossim/base/ossim2dTo2dTransform.cpp
deleted file mode 100644
index b0fae3a..0000000
--- a/ossim/src/ossim/base/ossim2dTo2dTransform.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossim2dTo2dTransform.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <sstream>
-#include <ossim/base/ossim2dTo2dTransform.h>
-
-
-RTTI_DEF1(ossim2dTo2dTransform, "ossim2dTo2dTransform", ossimObject);
-
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-// ### CREATE_COPY ###
-// Implementation of static factory method createCopy() requires includes here of ALL 2D-to-2D
-// transform types that need a deep copy capability:
-#include <ossim/base/ossimAffineTransform.h>
-#include <ossim/projection/ossimImageViewAffineTransform.h>
-#include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/projection/ossimMeanRadialLensDistortion.h>
-#include <ossim/base/ossimQuadTreeWarp.h>
-#include <ossim/projection/ossimRadialDecentLensDistortion.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossim2dTo2dTransform:exec");
-static ossimTrace traceDebug ("ossim2dTo2dTransform:debug");
-
-static const double DEFAULT_THRESHOLD      = 1000.0*DBL_EPSILON;
-static const int    DEFAULT_MAX_ITERATIONS = 10;
-
-//*****************************************************************************
-//  CONSTRUCTOR: 
-//*****************************************************************************
-ossim2dTo2dTransform::ossim2dTo2dTransform()
-   :
-      theConvergenceThreshold (DEFAULT_THRESHOLD),
-      theMaxIterations        (DEFAULT_MAX_ITERATIONS),
-      theDxDy(1.0, 1.0)
-{
-}
- 
-//*****************************************************************************
-//  METHOD: 
-//*****************************************************************************
-void ossim2dTo2dTransform::inverse(const ossimDpt& input,
-                                   ossimDpt&       output) const
-{
-   static const char MODULE[] = "ossim2dTo2dTransform::inverse";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: " << MODULE << ", entering...\n";
-   
-   //***
-   // Begin with guess. Forward transform is defined as trasforming left to
-   // right. We are therefore solving for left:
-   //***
-   ossimDpt left = getOrigin();
-   ossimDpt left_dx;
-   ossimDpt left_dy;
-   ossimDpt right;
-   ossimDpt right_dx;
-   ossimDpt right_dy;
-   ossimDpt dr_dx;
-   ossimDpt dr_dy;
-   ossimDpt r_diff;
-   ossimDpt l_diff;
-   double inverse_norm;
-   int iters=0;
-   //***
-   // Begin iterations:
-   //***
-   do
-   {
-      //***
-      // establish perturbed image points about the guessed point:
-      //***
-      left_dx.x = left.x + theDxDy.x;
-      left_dx.y = left.y;
-      left_dy.x = left.x;
-      left_dy.y = left.y + theDxDy.y;
-      
-      //***
-      // Compute numerical partials at current guessed point:
-      //***
-      forward(left,    right);
-      forward(left_dx, right_dx);
-      forward(left_dy, right_dy);
-
-      dr_dx.x = (right_dx.x - right.x)/theDxDy.x; //e
-      dr_dx.y = (right_dx.y - right.y)/theDxDy.y; //g
-      dr_dy.x = (right_dy.x - right.x)/theDxDy.x; //f
-      dr_dy.y = (right_dy.y - right.y)/theDxDy.y; //h
-
-      //***
-      // Test for convergence:
-      //***
-      r_diff = input - right;
-      
-      //***
-      // Compute linearized estimate of image point given gp delta:
-      //***
-      inverse_norm = dr_dy.x*dr_dx.y - dr_dx.x*dr_dy.y; // fg-eh
-
-      if (inverse_norm != 0)
-      {
-         l_diff.x = (-dr_dy.y*r_diff.x + dr_dy.x*r_diff.y)/inverse_norm;
-         l_diff.y = ( dr_dx.y*r_diff.x - dr_dx.x*r_diff.y)/inverse_norm;
-
-         left += l_diff;
-      }
-      else
-      {
-         l_diff.x = 0;
-         l_diff.y = 0;
-      }
-
-      iters++;
-      
-   } while (((fabs(l_diff.x) > theConvergenceThreshold) ||
-             (fabs(l_diff.y) > theConvergenceThreshold)) &&
-            (iters < theMaxIterations));
-
-   //***
-   // Note that this error mesage appears only if max count was reached while
-   // iterating. A linear (no iteration) solution would finish with iters =
-   // MAX_NUM_ITERATIONS + 1:
-   //***
-    if (iters == theMaxIterations)
-    {
-       ossimNotify(ossimNotifyLevel_WARN) << "WARNING: " << MODULE << ", exceeded max number of iterations computing inverse "
-                                          << "transform for point: " << input << "\n";
-    }
-
-   output = left;
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: " << MODULE << ", returning...\n";
-   return;
-   
-}
-
-//*****************************************************************************
-//  METHOD: 
-//*****************************************************************************
-bool ossim2dTo2dTransform::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::CONVERGENCE_THRESHOLD_KW,
-           theConvergenceThreshold,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::MAX_ITERATIONS_KW,
-           theMaxIterations,
-           true);
-   kwl.add(prefix,
-           "dxdy",
-           ossimString::toString(theDxDy.x) + " " +
-           ossimString::toString(theDxDy.y),
-           true);
-           
-   return ossimObject::saveState(kwl, prefix);
-}
-
-//*****************************************************************************
-//  METHOD: 
-//*****************************************************************************
-bool ossim2dTo2dTransform::loadState(const ossimKeywordlist& kwl,
-               const char* prefix)
-{
-  bool result = true;
-
-   const char* buf;
-
-   buf= kwl.find(prefix, ossimKeywordNames::CONVERGENCE_THRESHOLD_KW);
-
-   if (buf)
-   {
-      theConvergenceThreshold = atof(buf);
-   }
-   else
-   {
-      theConvergenceThreshold = .00000000000002;
-   }
-   
-   buf= kwl.find(prefix, ossimKeywordNames::MAX_ITERATIONS_KW);
-   if(buf)
-   {
-      theMaxIterations = atoi(buf);
-   }
-   else
-   {
-      theMaxIterations = 10;
-   }
-   const char* dxdy = kwl.find(prefix, "dxdy");
-   if(dxdy)
-   {
-      ossimString tempString(dxdy);
-      std::vector<ossimString> splitArray;
-      tempString = tempString.trim();
-      tempString.split(splitArray, " ");
-      if(splitArray.size()==2)
-      {
-         theDxDy.x = splitArray[0].toDouble();
-         theDxDy.y = splitArray[1].toDouble();
-      }
-   }
-   if(result)
-   {
-      ossimObject::loadState(kwl, prefix);
-   }
-   
-   return result;
-}
-   
-void ossim2dTo2dTransform::forward(ossimDpt&  modify_this) const 
-{
-   ossimDpt output;
-   forward(modify_this, output);
-   modify_this = output;
-}
-
-void ossim2dTo2dTransform::inverse(ossimDpt&  modify_this) const 
-{
-   ossimDpt output;
-   inverse(modify_this, output);
-   modify_this = output;
-}
-
-ossimDpt ossim2dTo2dTransform::getOrigin()const
-{
-   return ossimDpt(0,0);
-}
-
-void ossim2dTo2dTransform::setConvergenceThreshold(const double& new_threshold)
-{
-   theConvergenceThreshold = new_threshold;
-}
-
-void ossim2dTo2dTransform::setMaxIterations(int new_max_iters)
-{
-   theMaxIterations = new_max_iters;
-}
-
-void ossim2dTo2dTransform::setDxDy(const ossimDpt& dxdy)
-{
-   theDxDy.x = dxdy.x;
-   theDxDy.y = dxdy.y;
-}
-
-const ossim2dTo2dTransform& ossim2dTo2dTransform::operator=(const ossim2dTo2dTransform&  rhs )
-{
-   if (this != &rhs)
-   {
-      ossimObject::operator = (rhs);
-      
-      theConvergenceThreshold = rhs.theConvergenceThreshold;
-      theMaxIterations        = rhs.theMaxIterations;
-      theDxDy                 = rhs.theDxDy;
-   }
-   return *this;
-}
-
-std::ostream& ossim2dTo2dTransform::print(std::ostream& out) const
-{
-   out << "convergenceThreshold: " << theConvergenceThreshold << "\n"
-   << "maxIterations:        " << theMaxIterations << "\n"
-   << "dxdy:                 " << theDxDy << "\n";
-   return out;
-}
-
-
diff --git a/ossim/src/ossim/base/ossim2dTo2dTransformFactory.cpp b/ossim/src/ossim/base/ossim2dTo2dTransformFactory.cpp
deleted file mode 100644
index d5502a9..0000000
--- a/ossim/src/ossim/base/ossim2dTo2dTransformFactory.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Implementation of ossim2dTo2dTransformFactory.
-//
-//**************************************************************************************************
-// $Id$
-#include <ossim/base/ossim2dTo2dTransformFactory.h>
-#include <ossim/base/ossim2dBilinearTransform.h>
-#include <ossim/base/ossim2dTo2dShiftTransform.h>
-#include <ossim/base/ossim2dTo2dIdentityTransform.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-
-ossim2dTo2dTransformFactory* ossim2dTo2dTransformFactory::m_instance = 0;
-ossim2dTo2dTransformFactory* ossim2dTo2dTransformFactory::instance()
-{
-   if(!m_instance)
-   {
-      m_instance = new ossim2dTo2dTransformFactory();
-   }
-   return m_instance;
-}
-
-ossim2dTo2dTransform* ossim2dTo2dTransformFactory::createTransform(const ossimString& name)const
-{
-   ossim2dTo2dTransform* result = 0;
-   if(name == STATIC_TYPE_NAME(ossim2dBilinearTransform))
-   {
-      result = new ossim2dBilinearTransform();
-   }
-   else if(name == STATIC_TYPE_NAME(ossim2dTo2dShiftTransform))
-   {
-      result = new ossim2dTo2dShiftTransform();
-   }
-   else if(name == STATIC_TYPE_NAME(ossim2dTo2dIdentityTransform))
-   {
-      result = new ossim2dTo2dIdentityTransform();
-   }
-   
-   return result;
-}
-
-ossim2dTo2dTransform* ossim2dTo2dTransformFactory::createTransform(const ossimKeywordlist& kwl,
-                                                                   const char* prefix)const
-{
-   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   ossimRefPtr<ossim2dTo2dTransform> result =  createTransform(type);
-   if(result.valid()&&!result->loadState(kwl, prefix))
-   {
-      result = 0;
-   }
-   
-   return result.release();
-}
-
-void ossim2dTo2dTransformFactory::getTypeNameList(std::vector<ossimString>& typeList)const
-{
-   typeList.push_back(STATIC_TYPE_NAME(ossim2dBilinearTransform));
-   typeList.push_back(STATIC_TYPE_NAME(ossim2dTo2dShiftTransform));
-   typeList.push_back(STATIC_TYPE_NAME(ossim2dTo2dIdentityTransform));
-}
-
diff --git a/ossim/src/ossim/base/ossim2dTo2dTransformRegistry.cpp b/ossim/src/ossim/base/ossim2dTo2dTransformRegistry.cpp
deleted file mode 100644
index e2da0e9..0000000
--- a/ossim/src/ossim/base/ossim2dTo2dTransformRegistry.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Implementation of ossim2dTo2dTransformRegistry.
-//
-//**************************************************************************************************
-// $Id$
-#include <ossim/base/ossim2dTo2dTransformRegistry.h>
-#include <ossim/base/ossim2dTo2dTransformFactory.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-ossim2dTo2dTransformRegistry* ossim2dTo2dTransformRegistry::m_instance = 0;
-RTTI_DEF1(ossim2dTo2dTransformRegistry, "ossim2dTo2dTransformRegistry", ossimObjectFactory);
-ossim2dTo2dTransformRegistry* ossim2dTo2dTransformRegistry::instance()
-{
-   if(!m_instance)
-   {
-      m_instance = new ossim2dTo2dTransformRegistry();
-      m_instance->registerFactory(ossim2dTo2dTransformFactory::instance());
-      ossimObjectFactoryRegistry::instance()->registerFactory(m_instance);
-   }
-   
-   return m_instance;
-}
-
diff --git a/ossim/src/ossim/base/ossimArgumentParser.cpp b/ossim/src/ossim/base/ossimArgumentParser.cpp
deleted file mode 100644
index 03a8593..0000000
--- a/ossim/src/ossim/base/ossimArgumentParser.cpp
+++ /dev/null
@@ -1,574 +0,0 @@
-//-------------------------------------------------------------------------
-//
-// This code was taken from Open Scene Graph and incorporated from into
-// OSSIM.
-//
-//-------------------------------------------------------------------------
-// $Id: ossimArgumentParser.cpp 22491 2013-11-26 18:17:29Z dburken $
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimString.h>
-
-#include <cstring>
-#include <iostream>
-#include <set>
-
-bool ossimArgumentParser::isOption(const char* str)
-{
-   return str && str[0]=='-';
-}
-
-bool ossimArgumentParser::isString(const char* str)
-{
-   if (!str) return false;
-
-   return true;
-//    return !isOption(str);
-}
-
-bool ossimArgumentParser::isNumber(const char* str)
-{
-   if (!str) return false;
-   
-   bool hadPlusMinus = false;
-   bool hadDecimalPlace = false;
-   bool hadExponent = false;
-   bool couldBeInt = true;
-   bool couldBeFloat = true;
-   int noZeroToNine = 0;
-
-   const char* ptr = str;
-
-   // check if could be a hex number.
-   if (std::strncmp(ptr,"0x",2)==0)
-   {
-      // skip over leading 0x, and then go through rest of string
-      // checking to make sure all values are 0...9 or a..f.
-      ptr+=2;
-      while (
-         *ptr!=0 &&
-         ((*ptr>='0' && *ptr<='9') ||
-          (*ptr>='a' && *ptr<='f') ||
-          (*ptr>='A' && *ptr<='F'))
-         )
-      {
-         ++ptr;
-      }
-
-      // got to end of string without failure, therefore must be a hex integer.
-      if (*ptr==0) return true;
-   }
-
-   ptr = str;
-
-   // check if a float or an int.
-   while (*ptr!=0 && couldBeFloat)
-   {
-      if (*ptr=='+' || *ptr=='-')
-      {
-         if (hadPlusMinus)
-         {
-            couldBeInt = false;
-            couldBeFloat = false;
-         }
-         else
-         {
-            hadPlusMinus = true;
-         }
-      }
-      else if (*ptr>='0' && *ptr<='9')
-      {
-         noZeroToNine++;
-      }
-      else if (*ptr=='.')
-      {
-         if (hadDecimalPlace)
-         {
-            couldBeInt = false;
-            couldBeFloat = false;
-         }
-         else
-         {
-            hadDecimalPlace = true;
-            couldBeInt = false;
-         }
-      }
-      else if (*ptr=='e' || *ptr=='E')
-      {
-         if (hadExponent || noZeroToNine==0)
-         {
-            couldBeInt = false;
-            couldBeFloat = false;
-         }
-         else
-         {
-            hadExponent = true;
-            couldBeInt = false;
-            hadDecimalPlace = false;
-            hadPlusMinus = false;
-            noZeroToNine=0;
-         }
-      }
-      else
-      {
-         couldBeInt = false;
-         couldBeFloat = false;
-      }
-      ++ptr;
-   }
-
-   if (couldBeInt && noZeroToNine>0) return true;
-   if (couldBeFloat && noZeroToNine>0) return true;
-
-   return false;
-
-}
-
-bool ossimArgumentParser::ossimParameter::valid(const char* str) const
-{
-   switch(theType)
-   {
-      case ossimParameter::OSSIM_FLOAT_PARAMETER:        return isNumber(str);
-      case ossimParameter::OSSIM_DOUBLE_PARAMETER:       return isNumber(str);
-      case ossimParameter::OSSIM_INT_PARAMETER:          return isNumber(str);
-      case ossimParameter::OSSIM_UNSIGNED_INT_PARAMETER: return isNumber(str);
-      case ossimParameter::OSSIM_STRING_PARAMETER:       return isString(str);
-   }
-   return false;
-}
-
-bool ossimArgumentParser::ossimParameter::assign(const char* str)
-{
-   if (valid(str))
-   {
-      switch(theType)
-      {
-         case ossimParameter::OSSIM_FLOAT_PARAMETER:
-         {
-            *theValue.theFloat = (float)ossimString(str).toDouble();
-            break;
-         }
-         case ossimParameter::OSSIM_DOUBLE_PARAMETER:
-         {
-            *theValue.theDouble = ossimString(str).toDouble();
-            break;
-         }
-         case ossimParameter::OSSIM_INT_PARAMETER:
-         {
-            *theValue.theInt = ossimString(str).toInt();
-            break;
-         }
-         case ossimParameter::OSSIM_UNSIGNED_INT_PARAMETER:
-         {
-            *theValue.theUint = ossimString(str).toUInt32();
-            break;
-         }
-         case ossimParameter::OSSIM_STRING_PARAMETER:
-         {
-            *theValue.theString = str;
-            break;
-         }
-      }
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-ossimArgumentParser::ossimArgumentParser(int* argc,char **argv):
-   theArgc(argc),
-   theArgv(argv),
-   theUsage(ossimApplicationUsage::instance())
-{
-}
-
-ossimArgumentParser::~ossimArgumentParser()
-{
-}
-
-void ossimArgumentParser::initialize(int* argc, const char **argv)
-{
-   if(argc > 0) delete (theArgv);
-   theArgc = argc;
-   theArgv = new char*[*argc];
-   for(int i=0;i<*argc;i++)
-   {
-      theArgv[i] = new char[strlen(argv[i])];
-      strcpy(theArgv[i], argv[i]);
-   }
-}
-
-std::string ossimArgumentParser::getApplicationName() const
-{
-   if (theArgc && *theArgc>0 ) return std::string(theArgv[0]);
-   return "";
-}
-
-bool ossimArgumentParser::isOption(int pos) const
-{
-   return pos<*theArgc && isOption(theArgv[pos]);
-}
-
-bool ossimArgumentParser::isString(int pos) const
-{
-   return pos < *theArgc && isString(theArgv[pos]);
-}
-
-bool ossimArgumentParser::isNumber(int pos) const
-{
-   return pos < *theArgc && isNumber(theArgv[pos]);
-}
-
-int ossimArgumentParser::find(const std::string& str) const
-{
-   for(int pos=1;pos<*theArgc;++pos)
-   {
-      if (str==theArgv[pos])
-      {
-         return pos;
-      }
-   }
-   return 0;
-}
-
-bool ossimArgumentParser::match(int pos, const std::string& str) const
-{
-   return pos<*theArgc && str==theArgv[pos];
-}
-
-bool ossimArgumentParser::containsOptions() const
-{
-   for(int pos=1;pos<*theArgc;++pos)
-   {
-      if (isOption(pos)) return true;
-   }
-   return false;
-}
-
-int ossimArgumentParser::numberOfParams(const std::string& str, const ossimParameter& param) const
-{
-   int pos=find(str);
-   if (pos<=0) 
-      return -1;
-
-   ++pos;
-   int num_params = 0;
-   while (param.valid(theArgv[pos+num_params]))
-      ++num_params;
-   return num_params;
-}
-
-void ossimArgumentParser::remove(int pos,int num)
-{
-   if (num==0) return;
-   
-   for(;pos+num<*theArgc;++pos)
-   {
-      theArgv[pos]=theArgv[pos+num];
-   }
-   for(;pos<*theArgc;++pos)
-   {
-      theArgv[pos]=0;
-   }
-   *theArgc-=num;
-}
-
-bool ossimArgumentParser::read(const std::string& str)
-{
-   int pos=find(str);
-   if (pos<=0) return false;
-   remove(pos);
-   return true;
-}
-
-bool ossimArgumentParser::read(const std::string& str, ossimParameter value1)
-{
-   int pos=find(str);
-   if (pos<=0) return false;
-   if (!value1.valid(theArgv[pos+1]))
-   {
-      reportError("argument to `"+str+"` is missing");
-      return false;
-   }
-   value1.assign(theArgv[pos+1]);
-   remove(pos,2);
-   return true;
-}
-
-bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
-                               ossimParameter value2)
-{
-   int pos=find(str);
-   if (pos<=0) return false;
-   if (!value1.valid(theArgv[pos+1]) ||
-       !value2.valid(theArgv[pos+2]))
-   {
-      reportError("argument to `"+str+"` is missing");
-      return false;
-   }
-   value1.assign(theArgv[pos+1]);
-   value2.assign(theArgv[pos+2]);
-   remove(pos,3);
-   return true;
-}
-
-bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
-                               ossimParameter value2, ossimParameter value3)
-{
-   int pos=find(str);
-   if (pos<=0) return false;
-   if (!value1.valid(theArgv[pos+1]) ||
-       !value2.valid(theArgv[pos+2]) ||
-       !value3.valid(theArgv[pos+3]))
-   {
-      reportError("argument to `"+str+"` is missing");
-      return false;
-   }
-   value1.assign(theArgv[pos+1]);
-   value2.assign(theArgv[pos+2]);
-   value3.assign(theArgv[pos+3]);
-   remove(pos,4);
-   return true;
-}
-
-bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
-                               ossimParameter value2, ossimParameter value3,
-                               ossimParameter value4)
-{
-   int pos=find(str);
-   if (pos<=0) return false;
-   if (!value1.valid(theArgv[pos+1]) ||
-       !value2.valid(theArgv[pos+2]) ||
-       !value3.valid(theArgv[pos+3]) ||
-       !value4.valid(theArgv[pos+4]))
-   {
-      reportError("argument to `"+str+"` is missing");
-      return false;
-   }
-   value1.assign(theArgv[pos+1]);
-   value2.assign(theArgv[pos+2]);
-   value3.assign(theArgv[pos+3]);
-   value4.assign(theArgv[pos+4]);
-   remove(pos,5);
-   return true;
-}
-
-bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
-                               ossimParameter value2, ossimParameter value3,
-                               ossimParameter value4, ossimParameter value5)
-{
-   int pos=find(str);
-   if (pos<=0) return false;
-   if (!value1.valid(theArgv[pos+1]) ||
-       !value2.valid(theArgv[pos+2]) ||
-       !value3.valid(theArgv[pos+3]) ||
-       !value4.valid(theArgv[pos+4]) ||
-       !value5.valid(theArgv[pos+5]))
-   {
-      reportError("argument to `"+str+"` is missing");
-      return false;
-   }
-   value1.assign(theArgv[pos+1]);
-   value2.assign(theArgv[pos+2]);
-   value3.assign(theArgv[pos+3]);
-   value4.assign(theArgv[pos+4]);
-   value5.assign(theArgv[pos+5]);    
-   remove(pos,6);
-   return true;
-}
-
-bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
-                               ossimParameter value2, ossimParameter value3,
-                               ossimParameter value4, ossimParameter value5,
-                               ossimParameter value6)
-{
-   int pos=find(str);
-   if (pos<=0) return false;
-   if (!value1.valid(theArgv[pos+1]) ||
-       !value2.valid(theArgv[pos+2]) ||
-       !value3.valid(theArgv[pos+3]) ||
-       !value4.valid(theArgv[pos+4]) ||
-       !value5.valid(theArgv[pos+5]) ||
-       !value6.valid(theArgv[pos+6]))       
-   {
-      reportError("argument to `"+str+"` is missing");
-      return false;
-   }
-   value1.assign(theArgv[pos+1]);
-   value2.assign(theArgv[pos+2]);
-   value3.assign(theArgv[pos+3]);
-   value4.assign(theArgv[pos+4]);
-   value5.assign(theArgv[pos+5]);
-   value6.assign(theArgv[pos+6]);    
-   remove(pos,7);
-   return true;
-}
-
-
-/** if the argument value at the posotion pos matches specified string, and subsequent
- * parameters are also matched then set the paramter values and remove the from the list of arguments.*/
-bool ossimArgumentParser::read(int pos, const std::string& str)
-{
-   if (match(pos,str))
-   {
-      remove(pos,1);
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1)
-{
-   if (match(pos,str) &&
-       value1.valid(theArgv[pos+1]))
-   {
-      value1.assign(theArgv[pos+1]);
-      remove(pos,2);
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1, ossimParameter value2)
-{
-   if (match(pos,str) &&
-       value1.valid(theArgv[pos+1]) &&
-       value2.valid(theArgv[pos+2]))
-   {
-      value1.assign(theArgv[pos+1]);
-      value2.assign(theArgv[pos+2]);
-      remove(pos,3);
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1, ossimParameter value2, ossimParameter value3)
-{
-   if (match(pos,str) &&
-       value1.valid(theArgv[pos+1]) &&
-       value2.valid(theArgv[pos+2]) &&
-       value3.valid(theArgv[pos+3]))
-   {
-      value1.assign(theArgv[pos+1]);
-      value2.assign(theArgv[pos+2]);
-      value3.assign(theArgv[pos+3]);
-      remove(pos,4);
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1, ossimParameter value2, ossimParameter value3, ossimParameter value4)
-{
-   if (match(pos,str) &&
-       value1.valid(theArgv[pos+1]) &&
-       value2.valid(theArgv[pos+2]) &&
-       value3.valid(theArgv[pos+3]) &&
-       value4.valid(theArgv[pos+4]))
-   {
-      value1.assign(theArgv[pos+1]);
-      value2.assign(theArgv[pos+2]);
-      value3.assign(theArgv[pos+3]);
-      value4.assign(theArgv[pos+4]);
-      remove(pos,5);
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-bool ossimArgumentParser::errors(ossimErrorSeverity severity) const
-{
-   for(ossimErrorMessageMap::const_iterator itr=theErrorMessageMap.begin();
-       itr!=theErrorMessageMap.end();
-       ++itr)
-   {
-      if (itr->second>=severity) return true;
-   }
-   return false;
-}
-
-void ossimArgumentParser::reportError(const std::string& message, ossimErrorSeverity severity)
-{
-   theErrorMessageMap[message]=severity;
-}
-
-void ossimArgumentParser::reportRemainingOptionsAsUnrecognized(ossimErrorSeverity severity)
-{
-   std::set<std::string> options;
-   if (theUsage)
-   {
-      // parse the usage options to get all the option that the application can potential handle.
-      for(ossimApplicationUsage::UsageMap::const_iterator itr=theUsage->getCommandLineOptions().begin();
-          itr!=theUsage->getCommandLineOptions().end();
-          ++itr)
-      {
-         const std::string& option = itr->first;
-         std::string::size_type prevpos = 0, pos = 0;
-         while ((pos=option.find(' ',prevpos))!=std::string::npos)
-         {
-            if (option[prevpos]=='-')
-            {
-               options.insert(std::string(option,prevpos,pos-prevpos));
-            }
-            prevpos=pos+1;
-         }
-         if (option[prevpos]=='-')
-         {
-
-            options.insert(std::string(option,prevpos,std::string::npos));
-         }
-      }
-
-   }
-
-   for(int pos=1;pos<argc();++pos)
-   {
-      // if an option and havn't been previous querried for report as unrecognized.
-      if (isOption(pos) && options.find(theArgv[pos])==options.end())
-      {
-         reportError(getApplicationName() +": unrecognized option "+theArgv[pos],severity);
-      }
-   }
-}
-
-ossimArgumentParser::ossimErrorMessageMap& ossimArgumentParser::getErrorMessageMap()
-{
-   return theErrorMessageMap;
-}
-   
-const ossimArgumentParser::ossimErrorMessageMap& ossimArgumentParser::getErrorMessageMap() const
-{
-   return theErrorMessageMap;
-}
-
-void ossimArgumentParser::writeErrorMessages(std::ostream& output, ossimErrorSeverity severity)
-{
-   for(ossimErrorMessageMap::iterator itr=theErrorMessageMap.begin();
-       itr!=theErrorMessageMap.end();
-       ++itr)
-   {
-      if (itr->second>=severity)
-      {
-         output<< getApplicationName() << ": " << itr->first << std::endl;
-      }
-   }
-}
diff --git a/ossim/src/ossim/base/ossimBooleanProperty.cpp b/ossim/src/ossim/base/ossimBooleanProperty.cpp
deleted file mode 100644
index ffe4307..0000000
--- a/ossim/src/ossim/base/ossimBooleanProperty.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-//*************************************************************************
-// $Id: ossimBooleanProperty.cpp 19888 2011-08-03 11:30:22Z gpotts $
-#include <ossim/base/ossimBooleanProperty.h>
-
-RTTI_DEF1(ossimBooleanProperty, "ossimBooleanProperty", ossimProperty);
-
-ossimBooleanProperty::ossimBooleanProperty(const ossimString& name,
-                                           bool value)
-   :ossimProperty(name),
-    theValue(value)
-{
-}
-
-ossimBooleanProperty::ossimBooleanProperty(const ossimBooleanProperty& rhs)
-   :ossimProperty(rhs),
-    theValue(rhs.theValue)
-{
-}
-
-ossimObject* ossimBooleanProperty::dup()const
-{
-   return new ossimBooleanProperty(*this);
-}
-
-const ossimProperty& ossimBooleanProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-
-   ossimBooleanProperty* property = PTR_CAST(ossimBooleanProperty,
-                                             &rhs);
-   if(property)
-   {
-      theValue = property->theValue;
-   }
-   
-   return *this;
-}
-
-bool ossimBooleanProperty::setValue(const ossimString& value)
-{
-   theValue = value.toBool();
-   
-   return true;
-}
-
-bool ossimBooleanProperty::setBooleanValue(bool value,
-					   ossimString& /* msg */)
-{
-   theValue = value;
-
-   return true;
-}
-
-void ossimBooleanProperty::valueToString(ossimString& valueResult)const
-{
-   valueResult = theValue?"true":"false";
-}
-
-bool ossimBooleanProperty::getBoolean()const
-{
-   return theValue;
-}
diff --git a/ossim/src/ossim/base/ossimColorProperty.cpp b/ossim/src/ossim/base/ossimColorProperty.cpp
deleted file mode 100644
index c43d8ad..0000000
--- a/ossim/src/ossim/base/ossimColorProperty.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-//*************************************************************************
-// $Id: ossimColorProperty.cpp 13667 2008-10-02 19:59:55Z gpotts $
-#include <sstream>
-#include <ossim/base/ossimColorProperty.h>
-
-RTTI_DEF1(ossimColorProperty, "ossimColorProperty", ossimProperty);
-
-ossimColorProperty::ossimColorProperty(const ossimString& name,
-                                       const ossimRgbVector& value)
-   :ossimProperty(name),
-    theValue(value)
-{
-}
-
-ossimColorProperty::ossimColorProperty(const ossimColorProperty& rhs)
-   :ossimProperty(rhs),
-    theValue(rhs.theValue)
-{
-}
-
-ossimColorProperty::~ossimColorProperty()
-{
-}
-
-ossimObject* ossimColorProperty::dup()const
-{
-   return new ossimColorProperty(*this);
-}
-
-const ossimProperty& ossimColorProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-
-   ossimColorProperty* rhsPtr = PTR_CAST(ossimColorProperty, &rhs);
-
-   if(rhsPtr)
-   {
-      theValue = rhsPtr->theValue;
-   }
-   else
-   {
-      setValue(rhs.valueToString());
-   }
-
-   return *this;
-}
-
-bool ossimColorProperty::setValue(const ossimString& value)
-{
-   bool result = false;
-   std::vector<ossimString> splitArray;
-   
-   value.split(splitArray, " ");
-   if(splitArray.size() == 3)
-   {
-      int r,g,b;
-      r = splitArray[0].toInt32();
-      g = splitArray[1].toInt32();
-      b = splitArray[2].toInt32();
-      result = true;
-      
-      theValue = ossimRgbVector(r,g,b);
-   }
-   
-   return result;
-}
-
-void ossimColorProperty::valueToString(ossimString& valueResult)const
-{
-   ostringstream out;
-
-   out << (int)theValue.getR() << " " << (int)theValue.getG() << " " << (int)theValue.getB() << endl;
-
-   valueResult = out.str().c_str();
-}
-
-const ossimRgbVector& ossimColorProperty::getColor()const
-{
-   return theValue;
-}
-
-void ossimColorProperty::setColor(const ossimRgbVector& value)
-{
-   theValue = value;
-}
-
-ossim_uint8 ossimColorProperty::getRed()const
-{
-   return theValue.getR();
-}
-
-ossim_uint8 ossimColorProperty::getGreen()const
-{
-   return theValue.getG();
-}
-
-ossim_uint8 ossimColorProperty::getBlue()const
-{
-   return theValue.getB();
-}
-
-void ossimColorProperty::setRed(ossim_uint8 r)
-{
-   theValue.setR(r);
-}
-
-void ossimColorProperty::setGreen(ossim_uint8 g)
-{
-   theValue.setG(g);
-}
-
-void ossimColorProperty::setBlue(ossim_uint8 b)
-{
-   theValue.setB(b);
-}
diff --git a/ossim/src/ossim/base/ossimCommon.cpp b/ossim/src/ossim/base/ossimCommon.cpp
deleted file mode 100644
index 58830f8..0000000
--- a/ossim/src/ossim/base/ossimCommon.cpp
+++ /dev/null
@@ -1,1130 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: David Burken
-//
-// Description: Common file for global functions.
-//
-//*************************************************************************
-// $Id: ossimCommon.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/matrix/newmat.h>
-#include <OpenThreads/Mutex>
-#include <OpenThreads/Thread>
-#include <ctime>
-#include <sstream>
-
-static OpenThreads::Mutex timeMutex;
-static ossimTrace traceDebug("ossimCommon:debug");
-
-// stores a floating point nan value
-const ossim::IntFloatBitCoercion ossim::nanValue(~ossim_int64(0));
-
-std::istream& ossim::skipws(std::istream& in)
-{
-   int c = in.peek();
-   while( !in.bad() && ossim::isWhiteSpace(c))
-   {
-      in.ignore();
-      c = in.peek();
-   }
-   
-   return in;
-}
-bool ossim::isWhiteSpace(int c)
-{
-   return ( (c == ' ') || (c == '\t') || (c == '\n')|| (c == '\r') ) ;
-}
-
-ossimByteOrder ossim::byteOrder()
-{
-   union
-   {
-      short s;
-      char  c[sizeof(short)];
-   } un;
-
-   un.s = 0x0102;
-   if (un.c[0] ==  2 && un.c[1] == 1)
-   {
-      return OSSIM_LITTLE_ENDIAN;
-   }
-   else
-   {
-      return OSSIM_BIG_ENDIAN;
-   }
-}
-
-double ossim::defaultMin(ossimScalarType scalarType)
-{
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-	return OSSIM_DEFAULT_MIN_PIX_UINT8;
-      }
-      case OSSIM_SINT8:
-      {
-	return OSSIM_DEFAULT_MIN_PIX_SINT8;
-      }
-      case OSSIM_UINT16:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_UINT16;
-      }
-      case OSSIM_SINT16:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_SINT16;
-      }
-      case OSSIM_USHORT11:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_UINT11;
-      }
-      case OSSIM_UINT32:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_UINT32;
-      }
-      case OSSIM_SINT32:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_SINT32;
-      }
-      case OSSIM_FLOAT32:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_FLOAT;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
-      }
-      case OSSIM_FLOAT64:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_DOUBLE;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         return OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << __FILE__ << ":" << __LINE__
-               << "\nUnhandled scalar type:  " << scalarType << std::endl;
-         }
-         break;
-      }
-   }
-   return 0.0; // Should never happen...
-}
-
-double ossim::defaultMax(ossimScalarType scalarType)
-{
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_UINT8;
-      }
-      case OSSIM_SINT8:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_SINT8;
-      }
-      case OSSIM_UINT16:
-      {
-	return OSSIM_DEFAULT_MAX_PIX_UINT16;
-      }
-      case OSSIM_SINT16:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_SINT16;
-      }
-      case OSSIM_USHORT11:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_UINT11;
-      }
-      case OSSIM_UINT32:
-      {
-	return OSSIM_DEFAULT_MAX_PIX_UINT32;
-      }
-      case OSSIM_SINT32:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_SINT32;
-      }
-      case OSSIM_FLOAT32:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_FLOAT;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
-      }
-      case OSSIM_FLOAT64:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_DOUBLE;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         return OSSIM_DEFAULT_MAX_PIX_NORM_DOUBLE;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << __FILE__ << ":" << __LINE__
-               << "\nUnhandled scalar type:  " << scalarType << std::endl;
-         }
-         break;
-      }
-   }
-   return 0.0; // Should never happen...
-}
-
-double ossim::defaultNull(ossimScalarType scalarType)
-{
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_UINT8;
-      }
-      case OSSIM_SINT8:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_SINT8;
-      }
-      case OSSIM_UINT16:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_UINT16;
-      }
-      case OSSIM_SINT16:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_SINT16;
-      }
-      case OSSIM_USHORT11:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_UINT11;
-      }
-      case OSSIM_UINT32:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_UINT32;
-      }
-      case OSSIM_SINT32:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_SINT32;
-      }
-      case OSSIM_FLOAT32:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_FLOAT;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_NORM_FLOAT;
-      }
-      case OSSIM_FLOAT64:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_DOUBLE;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         return OSSIM_DEFAULT_NULL_PIX_NORM_DOUBLE;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << __FILE__ << ":" << __LINE__
-               << "\nUnhandled scalar type:  " << scalarType << std::endl;
-         }
-         break;
-      }
-    }
-
-   return 0.0; // Should never happen...
-}
-
-ossim_uint32 ossim::scalarSizeInBytes(ossimScalarType scalarType)
-{
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         return sizeof(ossim_uint8);
-      }
-      case OSSIM_SINT8:
-      {
-         return sizeof(ossim_sint8);
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         return sizeof(ossim_uint16);
-      }
-      case OSSIM_SINT16:
-      {
-         return sizeof(ossim_sint16);
-      }
-      case OSSIM_UINT32:
-      {
-         return sizeof(ossim_uint32);
-      }
-      case OSSIM_SINT32:
-      {
-         return sizeof(ossim_sint32);
-      }
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         return sizeof(ossim_float32);
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         return sizeof(ossim_float64);
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << __FILE__ << ":" << __LINE__
-               << "\nUnhandled scalar type:  " << scalarType << std::endl;
-         }
-         break;
-      }
-  }
-  
-  return 1;
-}
-
-bool ossim::isSigned(ossimScalarType scalarType)
-{
-   bool result = false;
-   switch(scalarType)
-   {
-      case OSSIM_SINT8:
-      case OSSIM_SINT16:
-      case OSSIM_SINT32:
-      case OSSIM_FLOAT32:
-      case OSSIM_FLOAT64:
-      {
-         result = true;
-         break;
-      }
-      default:
-      {
-         break;
-      }
-  }
-  return result;
-}
-
-ossim_uint32 ossim::getActualBitsPerPixel(ossimScalarType scalarType)
-{
-   ossim_uint32 actualBitsPerPixel = 0;
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      case OSSIM_SINT8:
-      {
-         actualBitsPerPixel = 8;
-         break;
-      }
-      case OSSIM_USHORT11:
-      {
-         actualBitsPerPixel = 11;
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_SINT16:
-      {
-         actualBitsPerPixel = 16;
-         break;
-      }
-      case OSSIM_UINT32:
-      case OSSIM_SINT32:
-      case OSSIM_FLOAT32:
-      case OSSIM_CINT16:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         actualBitsPerPixel = 32;
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_CFLOAT32:
-      case OSSIM_CINT32:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         actualBitsPerPixel = 64;
-         break;
-      }
-      case OSSIM_CFLOAT64:
-      {
-         actualBitsPerPixel = 128;
-         
-         break;
-      }
-      default:
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << __FILE__ << ":" << __LINE__
-               << "\nUnhandled scalar type:  " << scalarType << std::endl;
-         }
-         break;
-      }
-   }
-   return actualBitsPerPixel;
-}
-
-ossim_uint32 ossim::getBitsPerPixel(ossimScalarType scalarType)
-{
-   ossim_uint32 bitsPerPixel = 0;
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      case OSSIM_SINT8:
-      {
-         bitsPerPixel = 8;
-         break;
-      }
-      case OSSIM_USHORT11:
-      {
-         bitsPerPixel = 16;
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_SINT16:
-      {
-         bitsPerPixel = 16;
-         break;
-      }
-      case OSSIM_UINT32:
-      case OSSIM_SINT32:
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         bitsPerPixel = 32;
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         bitsPerPixel = 64;
-         break;
-      }
-      default:
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << __FILE__ << ":" << __LINE__
-               << "\nUnhandled scalar type:  " << scalarType << std::endl;
-         }
-         break;
-      }
-   }
-   return bitsPerPixel;
-}
-
-void ossim::defaultTileSize(ossimIpt& tileSize)
-{
-   const char* tileSizeKw = ossimPreferences::instance()->
-      findPreference("tile_size");
-
-   if(tileSizeKw)
-   {
-      std::vector<ossimString> splitArray;
-      ossimString tempString(tileSizeKw);
-      tempString.split(splitArray, " ");
-      bool hasX = true;
-    if(splitArray.size() == 2)
-      {
-         tileSize.x = splitArray[0].toInt32();
-         tileSize.y = splitArray[1].toInt32();
-      }
-      else if(splitArray.size() == 1)
-      {
-         tileSize.x = splitArray[0].toInt32();
-         tileSize.y = splitArray[0].toInt32();
-      }
-      else
-      {
-         tileSize = ossimIpt(0,0);
-      }
-      if(tileSize.x < 1)
-      {
-         tileSize.x = OSSIM_DEFAULT_TILE_WIDTH;
-         hasX = false;
-      }
-      if(tileSize.y < 1)
-      {
-         if(!hasX)
-         {
-            tileSize.y = OSSIM_DEFAULT_TILE_HEIGHT;
-         }
-         else
-         {
-            tileSize.y = tileSize.x;
-         }
-      }
-   }
-   else
-   {
-      tileSize.x = OSSIM_DEFAULT_TILE_WIDTH;
-      tileSize.y = OSSIM_DEFAULT_TILE_HEIGHT;
-   }
-}
-
-std::string ossim::convertHtmlSpecialCharactersToNormalCharacter(const std::string& src)
-{
-   ossimString result = src;
-   std::string::size_type pos = 0;
-   pos = result.find("&");
-   
-   while(pos != std::string::npos)
-   {
-      std::string::size_type size = result.size();
-      std::string test1(&result[pos], ossim::min(6, (int)(size-pos)));
-      std::string test2(&result[pos], ossim::min(5, (int)(size-pos)));
-      std::string test3(&result[pos], ossim::min(4, (int)(size-pos)));
-      
-      if(test1 == "'")
-      {
-         result = result.substitute(test1, "'");
-      }
-      else if(test1 == """)
-      {
-         result = result.substitute(test1, "\"");
-      }
-      else if(test2 == "&")
-      {
-         result = result.substitute(test2, "&");
-      }
-      else if(test3 == ">")
-      {
-         result = result.substitute(test3, ">");
-      }
-      else if(test3 == "<")
-      {
-         result = result.substitute(test3, "<");
-      }
-      pos = result.find("&", pos+1);
-   }
-   
-   return result;
-}
-
-bool ossim::matrixToHpr( ossim_float64 hpr[3], const NEWMAT::Matrix& rotation )
-{
-    //implementation converted from plib's sg.cxx
-    //PLIB - A Suite of Portable Game Libraries
-    //Copyright (C) 1998,2002  Steve Baker
-    //For further information visit http://plib.sourceforge.net
-    
-   NEWMAT::Matrix mat(rotation);
-    
-   ossimDpt3d col1(rotation[0][0], rotation[1][0], rotation[2][0]);
-   double s = col1.length();
-   
-   hpr[0] = 0.0;
-   hpr[1] = 0.0;
-   hpr[2] = 0.0;
-
-   if ( s <= 0.00001 )
-   {
-      return true;
-   }
-   
-   
-   double oneOverS = 1.0f / s;
-   for( int i = 0; i < 3; i++ )
-      for( int j = 0; j < 3; j++ )
-         mat[i][j] = rotation[j][i] * oneOverS;
-   
-   
-   hpr[1] = ossim::asind(ossim::clamp(mat[1][2], -1.0, 1.0));
-   
-   double cp = ossim::cosd(hpr[1]);
-   
-   if ( cp > -0.00001 && cp < 0.00001 )
-   {
-      double cr = ossim::clamp(mat[0][1], -1.0, 1.0);
-      double sr = ossim::clamp(-mat[2][1], -1.0, 1.0);
-      
-      hpr[0] = 0.0f;
-      hpr[2] = ossim::atan2d(sr,cr);
-   }
-   else
-   {
-      cp = 1.0 / cp;
-      double sr = ossim::clamp((-mat[0][2] * cp), -1.0,1.0);
-      double cr = ossim::clamp((mat[2][2] * cp), -1.0, 1.0);
-      double sh = ossim::clamp((-mat[1][0] * cp), -1.0, 1.0);
-      double ch = ossim::clamp((mat[1][1] * cp), -1.0, 1.0);
-      
-      if ( (sh == 0.0f && ch == 0.0f) || (sr == 0.0f && cr == 0.0f) )
-      {
-         cr = ossim::clamp(mat[0][1], -1.0, 1.0);
-         sr = ossim::clamp(-mat[2][1], -1.0, 1.0);
-         
-         hpr[0] = 0.0f;
-      }
-      else
-      {
-         hpr[0] = ossim::atan2d(sh, ch);
-      }
-      
-      hpr[2] = ossim::atan2d(sr, cr);
-   }
-   
-   hpr[0] *= -1.0;
-   return true;
-}
-
-bool ossim::matrixToHpr( ossim_float64 hpr[3],
-                  const NEWMAT::Matrix& lsrMatrix,
-                  const NEWMAT::Matrix& rotationalMatrix)
-{
-    bool result = false;
-    NEWMAT::Matrix invertLsr(lsrMatrix.i());
-   
-    hpr[0] = 0.0;
-    hpr[1] = 0.0;
-    hpr[2] = 0.0;
-    result = matrixToHpr(hpr, invertLsr*rotationalMatrix);
-    if(std::abs(hpr[0]) < FLT_EPSILON)
-    {
-       hpr[0] = 0.0;
-    }
-    if(std::abs(hpr[1]) < FLT_EPSILON)
-    {
-       hpr[1] = 0.0;
-    }
-    if(std::abs(hpr[2]) < FLT_EPSILON)
-    {
-       hpr[2] = 0.0;
-    }
-    
-    return result;
-}
-
-
-void ossim::lexQuotedTokens(const std::string& str,
-                            ossim_uint32 start,
-                            const char* whitespace,
-                            const char* quotes,
-                            std::vector<std::string>& tokens,
-                            bool& unbalancedQuotes)
-{
-   ossimREQUIRE(whitespace != NULL);
-   ossimREQUIRE(quotes != NULL);
-   ossimREQUIRE(tokens != NULL);
-   
-   const char openQuote(quotes[0]), closeQuote(quotes[1]);
-   
-   tokens.clear();
-   unbalancedQuotes = false;
-   
-   int end=0;
-   while (start < str.length())
-   {
-      if (str[start] == openQuote)
-      {
-         int openBraceCount = 1;
-         
-         if (start+1 < str.length())
-         {
-            start++;
-            if (str[start] != closeQuote)
-            {
-               //               end = start+1;
-               end = start;
-               while (static_cast<ossim_uint32>(end) < str.length() &&
-                      openBraceCount > 0)
-               {
-                  if (str[end] == openQuote)
-                     openBraceCount++;
-                  else if (str[end] == closeQuote)
-                     openBraceCount--;
-                  end++;
-               }
-            }
-            else
-            {
-               openBraceCount = 0;
-               start++;
-               end = start+1;
-            }
-         }
-         if (openBraceCount == 0)
-         {
-            tokens.push_back(str.substr(start, end-1-start));
-         }
-         else
-         {
-            unbalancedQuotes = true;
-            end = (int)str.length();
-         }
-      }
-      else if (str[start] == closeQuote)
-      {
-         unbalancedQuotes = true;
-         end = (int)str.length();
-	 
-      }
-      else
-      {
-         end = (int)str.find_first_of(whitespace, start);
-         tokens.push_back(str.substr(start, end-start));
-      }
-      
-      start = (ossim_uint32)str.find_first_not_of(whitespace, end);
-   }
-}
-
-void ossim::toStringList(ossimString& resultStringOfPoints,
-                         const std::vector<ossimDpt>& pointList, 
-                         char separator)
-{
-   ossim_uint32 idx = 0;
-   for(;idx < pointList.size();++idx)
-   {
-      ossimString pt = pointList[idx].toString();
-      if(resultStringOfPoints.empty())
-      {
-         resultStringOfPoints = pt;
-      }
-      else
-      {
-         resultStringOfPoints += (separator + pt);
-      }
-   }
-}
-
-void ossim::toStringList(ossimString& resultStringOfPoints,
-                         const std::vector<ossimIpt>& pointList, 
-                         char separator)
-{
-   ossim_uint32 idx = 0;
-   for(;idx < pointList.size();++idx)
-   {
-      ossimString pt = pointList[idx].toString();
-      if(resultStringOfPoints.empty())
-      {
-         resultStringOfPoints = pt;
-      }
-      else
-      {
-         resultStringOfPoints += (separator + pt);
-      }
-   }
-}
-
-void ossim::toStringList(ossimString& resultStringOfPoints,
-                         const std::vector<ossimGpt>& pointList, 
-                         char separator)
-{
-   ossim_uint32 idx = 0;
-   for(;idx < pointList.size();++idx)
-   {
-      ossimString pt = pointList[idx].toString();
-      if(resultStringOfPoints.empty())
-      {
-         resultStringOfPoints = pt;
-      }
-      else
-      {
-         resultStringOfPoints += (separator + pt);
-      }
-   }
-}
-
-void ossim::toVector(std::vector<ossimDpt>& result,
-                     const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> splitResult;
-  
-   // let grab each point string that is surrounded by ()
-   std::istringstream in(stringOfPoints.trim());
-   ossimString currentPoint = "";
-   ossimDpt tempPoint;
-   while(!in.bad()&&!in.eof())
-   {
-      skipws(in);
-      if(in.peek() == '(')
-      {
-         currentPoint += (char)in.get();
-         skipws(in);
-         if(in.peek() == '(') in.ignore();
-         
-         while(!in.bad()&&!in.eof()&&(in.peek() != ')'))
-         {
-            currentPoint += (char)in.get();
-         }
-         if(in.good())
-         {
-            currentPoint += (char)in.get();
-            tempPoint.toPoint(currentPoint);
-            result.push_back(tempPoint);
-         }
-         currentPoint = "";
-      }
-      else 
-      {
-         in.ignore();
-      }
-   }   
-}
-
-void ossim::toVector(std::vector<ossimIpt>& result,
-                     const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> splitResult;
-   
-   // let grab each point string that is surrounded by ()
-   std::istringstream in(stringOfPoints.trim());
-   ossimString currentPoint = "";
-   ossimIpt tempPoint;
-   while(!in.bad()&&!in.eof())
-   {
-      skipws(in);
-      if(in.peek() == '(')
-      {
-         currentPoint += (char)in.get();
-         skipws(in);
-         if(in.peek() == '(') in.ignore();
-         
-         while(!in.bad()&&!in.eof()&&(in.peek() != ')'))
-         {
-            currentPoint += (char)in.get();
-         }
-         if(in.good())
-         {
-            currentPoint += (char)in.get();
-            tempPoint.toPoint(currentPoint);
-            result.push_back(tempPoint);
-         }
-         currentPoint = "";
-      }
-      else 
-      {
-         in.ignore();
-      }
-   }   
-}
-void ossim::toVector(std::vector<ossimGpt>& result,
-                     const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> splitResult;
-   
-   // let grab each point string that is surrounded by ()
-   std::istringstream in(stringOfPoints.trim());
-   ossimString currentPoint = "";
-   ossimGpt tempPoint;
-   while(!in.bad()&&!in.eof())
-   {
-      skipws(in);
-      if(in.peek() == '(')
-      {
-         currentPoint += (char)in.get();
-         skipws(in);
-         if(in.peek() == '(') in.ignore();
-         
-         while(!in.bad()&&!in.eof()&&(in.peek() != ')'))
-         {
-            currentPoint += (char)in.get();
-         }
-         if(in.good())
-         {
-            currentPoint += (char)in.get();
-            tempPoint.toPoint(currentPoint);
-            result.push_back(tempPoint);
-         }
-         currentPoint = "";
-      }
-      else 
-      {
-         in.ignore();
-      }
-   }   
-}
-
-bool ossim::extractSimpleValues(std::vector<ossimString>& values,
-                                const ossimString& stringOfPoints)
-{
-   std::istringstream in(stringOfPoints);
-   ossim::skipws(in);
-   bool result = true;
-   if(stringOfPoints.empty()) return result;
-   char c = in.get();
-   ossimString value = "";
-   if(c == '(')
-   {
-      c = (char)in.get();
-      while((c!=')')&&
-            (c!= '\n')&&
-            (in.good()))
-      {
-         if(c!= ',')
-         {
-            value += ossimString(c);
-         }
-         else
-         {
-            values.push_back(value);
-            value = "";
-         }
-         c = in.get();
-      }
-   }
-   if(c!= ')')
-   {
-      result = false;
-   }
-   else
-   {
-      if(!value.empty())
-      {
-         values.push_back(value);
-      }
-   }
-   
-   return result;
-}
-
-bool ossim::toSimpleVector(std::vector<ossim_uint32>& result,
-                           const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> extractedValues;
-   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
-   if(resultFlag)
-   {
-      ossim_uint32 idx = 0;
-      ossim_uint32 size = (ossim_uint32) extractedValues.size();
-      for(idx = 0; idx < size; ++idx)
-      {
-         result.push_back(extractedValues[idx].toUInt32());
-      }
-   }
-   return resultFlag;
-}
-
-template <>
-void ossim::toSimpleStringList(ossimString& result,
-                               const std::vector<ossim_uint8>& valuesList)
-
-{
-   std::ostringstream out;
-   
-   if(!valuesList.empty())
-   {
-      ossim_uint32 idx = 0;
-      ossim_uint32 size = (ossim_uint32)(valuesList.size()-1);
-      for(idx = 0; idx < size; ++idx)
-      {
-         out << ((ossim_uint32)valuesList[idx]) << ",";
-      }
-      out << static_cast<ossim_uint32>(valuesList[size]);
-   }
-   
-   result = "("+out.str()+")";
-}
-
-bool ossim::toSimpleVector(std::vector<ossim_int32>& result,
-                           const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> extractedValues;
-   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
-   if(resultFlag)
-   {
-      ossim_uint32 idx = 0;
-      ossim_uint32 size = (ossim_int32) extractedValues.size();
-      for(idx = 0; idx < size; ++idx)
-      {
-         result.push_back(extractedValues[idx].toInt32());
-      }
-   }
-   return resultFlag;
-}
-
-bool ossim::toSimpleVector(std::vector<ossim_uint16>& result,
-                           const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> extractedValues;
-   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
-   if(resultFlag)
-   {
-      ossim_uint32 idx = 0;
-      ossim_uint32 size = (ossim_int32) extractedValues.size();
-      for(idx = 0; idx < size; ++idx)
-      {
-         result.push_back(extractedValues[idx].toUInt32());
-      }
-   }
-   return resultFlag;
-}
-
-bool ossim::toSimpleVector(std::vector<ossim_int16>& result,
-                           const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> extractedValues;
-   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
-   if(resultFlag)
-   {
-      ossim_uint32 idx = 0;
-      ossim_uint32 size = (ossim_uint32) extractedValues.size();
-      for(idx = 0; idx < size; ++idx)
-      {
-         result.push_back(extractedValues[idx].toInt32());
-      }
-   }
-   return resultFlag;
-}
-
-bool ossim::toSimpleVector(std::vector<ossim_uint8>& result,
-                    const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> extractedValues;
-   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
-   if(resultFlag)
-   {
-      ossim_uint32 idx = 0;
-      ossim_uint32 size = (ossim_uint32) extractedValues.size();
-      for(idx = 0; idx < size; ++idx)
-      {
-         result.push_back(extractedValues[idx].toUInt8());
-      }
-   }
-   return resultFlag;
-}
-
-bool ossim::toSimpleVector(std::vector<ossim_int8>& result,
-                    const ossimString& stringOfPoints)
-{
-   std::vector<ossimString> extractedValues;
-   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
-   if(resultFlag)
-   {
-      ossim_uint32 idx = 0;
-      ossim_uint32 size = (ossim_uint32) extractedValues.size();
-      for(idx = 0; idx < size; ++idx)
-      {
-         result.push_back(extractedValues[idx].toUInt8());
-      }
-   }
-   return resultFlag;
-}
-
-ossim_uint32 ossim::getNumberOfThreads()
-{
-   ossim_uint32 result;
-   const char* str = ossimPreferences::instance()->findPreference("ossim_threads");
-   if ( str )
-   {
-      result = ossimString(str).toUInt32();
-   }
-   else
-   {
-      result = static_cast<ossim_uint32>( OpenThreads::GetNumberOfProcessors() );
-   }
-   if ( !result )
-   {
-      result = 1;
-   }
-   return result;
-}
-
-void ossim::getFormattedTime(
-   const std::string& format, bool gmtFlag, std::string& result )
-{
-   timeMutex.lock();
-   
-   time_t rawTime;
-   time(&rawTime);
-   
-   struct tm* timeInfo;
-   if ( gmtFlag )
-   {
-      timeInfo = gmtime(&rawTime);
-   }
-   else
-   {
-      timeInfo = localtime(&rawTime);
-   }
-   
-   size_t size = 0;
-   if ( timeInfo )
-   {
-      const size_t STRING_SIZE = 196; // This is a big time string size.
-      char outStr[STRING_SIZE];
-
-      size = strftime(outStr, STRING_SIZE, format.c_str(), timeInfo );
-
-      if ( size )
-      {
-         // Per strftime spec not needed but null terminating anyway.
-         outStr[STRING_SIZE-1] = '\0';
-         result = outStr;
-      }
-   }
-   if ( !size )
-   {
-      result.clear();
-   }
-
-   timeMutex.unlock();
-}
-
-ossim_uint32 ossim::computeLevels(const ossimIrect& rect)
-{
-   ossim_uint32 result = 0;
-   ossim_uint32 stopDimension = 0;
-      
-   // Get the stop dimension from ossim preferences.
-   const char* lookup = ossimPreferences::instance()->
-      findPreference(ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW);
-   if (lookup)
-   {
-      stopDimension = ossimString(lookup).toUInt32();
-   }
-   
-   if (stopDimension == 0)
-   {
-      // Use the smallest default tile size.
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-      stopDimension = tileSize.x < tileSize.y ? tileSize.x : tileSize.y;
-   }
-      
-   ossim_uint32 largestImageDimension =
-      rect.width() > rect.height() ? rect.width() : rect.height();
-   
-   while(largestImageDimension > stopDimension)
-   {
-      largestImageDimension /= 2;
-      ++result;
-   }
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/base/ossimConnectableDisplayListener.cpp b/ossim/src/ossim/base/ossimConnectableDisplayListener.cpp
deleted file mode 100644
index c05d2e9..0000000
--- a/ossim/src/ossim/base/ossimConnectableDisplayListener.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-
-//----------------------------------------------------------------------------
-// Copyright (c) 2004, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: 
-//
-//----------------------------------------------------------------------------
-// $Id: ossimConnectableDisplayListener.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimConnectableDisplayListener.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimObjectEvents.h>
-#include <ossim/base/ossimDisplayListEvent.h>
-#include <ossim/base/ossimDisplayRefreshEvent.h>
-
-#include <ossim/base/ossimNotifyContext.h>
-
-RTTI_DEF1(ossimConnectableDisplayListener,
-          "ossimConnectableDisplayListener",
-          ossimListener);
-
-ossimConnectableDisplayListener::ossimConnectableDisplayListener()
-   : ossimListener()
-{}
-
-void ossimConnectableDisplayListener::processEvent(ossimEvent& event)
-{
-   switch(event.getId())
-   {
-      case OSSIM_EVENT_OBJECT_DESTRUCTING_ID:
-      {
-         ossimObjectDestructingEvent* eventCast =
-            static_cast<ossimObjectDestructingEvent*>(&event);
-         objectDestructingEvent(*eventCast);
-         
-         break;
-      }
-      case OSSIM_EVENT_CONNECTION_CONNECT_ID:
-      case OSSIM_EVENT_CONNECTION_DISCONNECT_ID:
-      {
-         ossimConnectionEvent* eventCast =
-            static_cast<ossimConnectionEvent*>(&event);
-         
-         connectionEvent(*eventCast);
-         if(event.getId() == OSSIM_EVENT_CONNECTION_DISCONNECT_ID)
-         {
-            if(eventCast->isInputDirection())
-            {
-               disconnectInputEvent(*eventCast);
-            }
-            else if(eventCast->isOutputDirection())
-            {
-               disconnectOutputEvent(*eventCast);
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimConnectableDisplayListener::processEvent, Direction not set\n";
-            }
-         }
-         else
-         {
-            ossimConnectionEvent* eventCast = static_cast<ossimConnectionEvent*>(&event);
-            
-            if(eventCast->isInputDirection())
-            {
-               connectInputEvent(*eventCast);
-            }
-            else if(eventCast->isOutputDirection())
-            {
-               connectOutputEvent(*eventCast);
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableDisplayListener::processEvent, Direction not set\n";
-            }
-         }
-         break;
-      }
-      case OSSIM_EVENT_PROPERTY_ID:
-      {
-         ossimPropertyEvent* eventCast = static_cast<ossimPropertyEvent*>(&event);
-         propertyEvent(*eventCast);
-         break;
-      }
-      case OSSIM_EVENT_ADD_OBJECT_ID:
-      {
-         ossimContainerEvent* eventCast = static_cast<ossimContainerEvent*>(&event);
-         addObjectEvent(*eventCast);
-         break;
-      }
-      case OSSIM_EVENT_REMOVE_OBJECT_ID:
-      {
-         ossimContainerEvent* eventCast = static_cast<ossimContainerEvent*>(&event);
-         removeObjectEvent(*eventCast);
-         break;
-      }
-      case OSSIM_EVENT_REFRESH_ID:
-      {
-         ossimRefreshEvent* eventCast = static_cast<ossimRefreshEvent*>(&event);
-         refreshEvent(*eventCast);
-         break;
-      }
-      case OSSIM_EVENT_DISPLAY_LIST_ID:
-      {
-         ossimDisplayListEvent* eventCast =
-            static_cast<ossimDisplayListEvent*>(&event);
-         displayListEvent(*eventCast);
-         break;
-      }
-      case OSSIM_EVENT_DISPLAY_REFRESH_ID:
-      {
-         ossimDisplayRefreshEvent* eventCast =
-            static_cast<ossimDisplayRefreshEvent*>(&event);
-         displayRefreshEvent(*eventCast);
-         break;
-      }
-      default:
-      {
-         ossimListener::processEvent(event);
-         break;
-      }
-   }
-}
-
-void ossimConnectableDisplayListener::objectDestructingEvent(
-   ossimObjectDestructingEvent& /*event*/)
-{
-}
-
-void ossimConnectableDisplayListener::connectionEvent(
-   ossimConnectionEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::disconnectInputEvent(
-   ossimConnectionEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::disconnectOutputEvent(
-   ossimConnectionEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::connectInputEvent(
-   ossimConnectionEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::connectOutputEvent(
-   ossimConnectionEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::propertyEvent(
-   ossimPropertyEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::displayListEvent(ossimDisplayListEvent&)
-{}
-
-void ossimConnectableDisplayListener::displayRefreshEvent(
-   ossimDisplayRefreshEvent&)
-{}
-
-void ossimConnectableDisplayListener::addObjectEvent(
-   ossimContainerEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::removeObjectEvent(
-   ossimContainerEvent& /* event */)
-{}
-
-void ossimConnectableDisplayListener::refreshEvent(
-   ossimRefreshEvent& /* event */)
-{}
-
-
diff --git a/ossim/src/ossim/base/ossimConnectableObject.cpp b/ossim/src/ossim/base/ossimConnectableObject.cpp
deleted file mode 100644
index d4d2195..0000000
--- a/ossim/src/ossim/base/ossimConnectableObject.cpp
+++ /dev/null
@@ -1,2347 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimConnectableObject.cpp 21850 2012-10-21 20:09:55Z dburken $
-
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimIdManager.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimObjectEvents.h>
-#include <ossim/base/ossimConnectableContainerInterface.h>
-#include <ossim/base/ossimConnectableContainer.h>
-#include <ossim/base/ossimTextProperty.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimVisitor.h>
-#include <algorithm>
-
-RTTI_DEF3(ossimConnectableObject,
-          "ossimConnectableObject",
-          ossimObject,
-          ossimListenerManager,
-          ossimPropertyInterface);
-
-const char* CONNECTABLE_INPUT_LIST_FIXED_KW  = "input_list_fixed";
-const char* CONNECTABLE_OUTPUT_LIST_FIXED_KW = "output_list_fixed";
-
-ossimConnectableObject::ossimConnectableObject(ossimObject* owner)
-:ossimObject(),
-ossimListenerManager(),
-theInputListIsFixedFlag(false),
-theOutputListIsFixedFlag(false)
-{
-   theId    = ossimIdManager::instance()->generateId();
-   theOwner = owner;
-}
-
-ossimConnectableObject::ossimConnectableObject(ossimObject* owner,
-                                               ossim_int32 inputListSize,
-                                               ossim_int32 outputListSize,
-                                               bool inputListIsFixedFlag,
-                                               bool outputListIsFixedFlag)
-:ossimObject(),
-ossimListenerManager(),
-theInputListIsFixedFlag(inputListIsFixedFlag),
-theOutputListIsFixedFlag(outputListIsFixedFlag)
-{
-   theId    = ossimIdManager::instance()->generateId();
-   theOwner = owner;
-   
-   setNumberOfInputs(inputListSize);
-   setNumberOfOutputs(outputListSize);
-}
-
-ossimConnectableObject::~ossimConnectableObject()
-{
-   
-   // tell the immediate listeners that we are destructing.
-   ossimObjectDestructingEvent event(this);
-   
-   //    if(theOwner)
-   //    {
-   //       ossimListenerManager* manager = PTR_CAST(ossimListenerManager, theOwner);
-   
-   //       if(manager)
-   //       {
-   //          // notify the owner that you are destructing
-   //          //
-   //          manager->fireEvent(event);
-   //       }
-   //    }
-   
-   // notify all other listeners that you are destructing
-   //
-   fireEvent(event);
-   
- }
-
-void ossimConnectableObject::changeOwner(ossimObject* owner)
-{
-   theOwner = owner;
-}
-
-void ossimConnectableObject::setDescription(const ossimString& description)
-{
-   theDescription = description;
-}
-
-ossimString ossimConnectableObject::getDescription()const
-{
-   return theDescription;
-}
-
-bool ossimConnectableObject::isConnected(ossimConnectableObjectDirectionType direction)const
-{
-   if(direction & CONNECTABLE_DIRECTION_INPUT)
-   {
-      if(getNumberOfInputs())
-      {
-         ConnectableObjectList::const_iterator current = theInputObjectList.begin();
-         
-         while(current != theInputObjectList.end())
-         {
-            if(! (*current))
-            {
-               return false;
-            }
-            
-            ++current;
-         }
-      }
-      else if(!theInputListIsFixedFlag)
-      {
-         return false;
-      }
-   }
-   
-   if(direction & CONNECTABLE_DIRECTION_OUTPUT)
-   {
-      if(theOutputObjectList.empty())
-      {
-         return theOutputListIsFixedFlag;
-         
-      }
-      ConnectableObjectList::const_iterator current = theOutputObjectList.begin();
-      current = theOutputObjectList.begin();
-      while(current != theOutputObjectList.end())
-      {
-         if(! (*current))
-         {
-            return false;
-         }
-         
-         ++current;
-      }
-   }
-   
-   return true;
-}
-
-ossimConnectableObject* ossimConnectableObject::findConnectableObject(const ossimId& id)
-{
-   ConnectableObjectList::iterator current;
-   
-   current = theInputObjectList.begin();
-   while(current != theInputObjectList.end())
-   {
-      ossimConnectableObject* temp = (*current).get();
-      
-      if(temp->getId() == id)
-      {
-         return temp;
-      }
-      
-      ++current;
-   }
-   
-   // go through the outputs
-   current = theOutputObjectList.begin();
-   while(current != theOutputObjectList.end())
-   {
-      ossimConnectableObject* temp = (*current).get();
-      
-      if(temp->getId() == id)
-      {
-         return temp;
-      }
-      
-      ++current;
-   }
-   
-   return 0;
-}
-
-ossimConnectableObject* ossimConnectableObject::findObjectOfType(
-   RTTItypeid typeId,
-   ossimConnectableObjectDirectionType directionType,
-   bool recurse)
-{
-   ossimConnectableObject* result = 0;
-
-   if(directionType != CONNECTABLE_DIRECTION_NONE)
-   {
-      ConnectableObjectList* connectableList = 0;
-
-      if ( CONNECTABLE_DIRECTION_INPUT )
-      {
-         connectableList = &theInputObjectList;
-      }
-      else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
-      {
-         connectableList = &theOutputObjectList;
-      }
-
-      // see if it is in the immediate list
-      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
-      {
-         if( (*connectableList)[index].valid() )
-         {
-            if( (*connectableList)[index]->canCastTo( typeId ) )
-            {
-               result = (*connectableList)[index].get();
-               break;
-            }
-         }
-      }
-
-      if ( !result )
-      {
-         ossimVisitor::VisitorType vType = ossimVisitor::VISIT_NONE;
-         
-         if ( CONNECTABLE_DIRECTION_INPUT )
-         {
-            if ( recurse )
-            {
-               // Cast needed for compiler...
-               vType = (ossimVisitor::VisitorType)
-                  (ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_CHILDREN);
-            }
-            else
-            {
-               vType = ossimVisitor::VISIT_INPUTS;
-            }
-         }
-         else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
-         {
-            if ( recurse )
-            {
-               // Cast needed for compiler...
-               vType = (ossimVisitor::VisitorType)
-                  (ossimVisitor::VISIT_OUTPUTS|ossimVisitor::VISIT_CHILDREN);
-            }
-            else
-            {
-               vType = ossimVisitor::VISIT_OUTPUTS;
-            }
-         }
-         
-         ossimTypeIdVisitor visitor( typeId,
-                                     true, // firstofTypeFlag
-                                     vType );
-
-
-         this->accept( visitor );
-         result = dynamic_cast<ossimConnectableObject*>( visitor.getObject(0) );
-      }
-      
-   } // Matches: if(directionType != CONNECTABLE_DIRECTION_NONE)
-   
-   return result;
-   
-} // End: findObjectOfType( RTTItypeid ...
-
-ossimConnectableObject* ossimConnectableObject::findObjectOfType(
-   const ossimString& className,
-   ossimConnectableObjectDirectionType directionType,
-   bool recurse )
-{
-   ossimConnectableObject* result = 0;
-   
-   if(directionType != CONNECTABLE_DIRECTION_NONE)
-   {
-      ConnectableObjectList* connectableList = 0;
-      
-      if ( CONNECTABLE_DIRECTION_INPUT )
-      {
-         connectableList = &theInputObjectList;
-      }
-      else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
-      {
-         connectableList = &theOutputObjectList;
-      }
-      
-      // see if it is in the immediate list
-      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
-      {
-         if( (*connectableList)[index].valid() )
-         {
-            if( (*connectableList)[index]->canCastTo( className ) )
-            {
-               result = (*connectableList)[index].get();
-               break;
-            }
-         }
-      }
-      
-      if ( !result )
-      {
-         ossimVisitor::VisitorType vType = ossimVisitor::VISIT_NONE;
-         
-         if ( CONNECTABLE_DIRECTION_INPUT )
-         {
-            if ( recurse )
-            {
-               // Cast needed for compiler...
-               vType = (ossimVisitor::VisitorType)
-                  (ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_CHILDREN);
-            }
-            else
-            {
-               vType = ossimVisitor::VISIT_INPUTS;
-            }
-         }
-         else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
-         {
-            if ( recurse )
-            {
-               // Cast needed for compiler...
-               vType = (ossimVisitor::VisitorType)
-                  (ossimVisitor::VISIT_OUTPUTS|ossimVisitor::VISIT_CHILDREN);
-            }
-            else
-            {
-               vType = ossimVisitor::VISIT_OUTPUTS;
-            }
-         }
-         
-         ossimTypeNameVisitor visitor( className,
-                                       true, // firstofTypeFlag
-                                       vType );
-         this->accept( visitor );
-         result = dynamic_cast<ossimConnectableObject*>( visitor.getObject(0) );
-      }
-      
-   } // Matches: if(directionType != CONNECTABLE_DIRECTION_NONE)
-   
-   return result;
-   
-} // End: findObjectOfType( const ossimString& className ...
-
-ossimConnectableObject* ossimConnectableObject::findInputObjectOfType(
-   const ossimString& className)
-{
-   ossimConnectableObject* result = 0;
-   
-   // See if we are of class type.
-   if ( canCastTo( className ) )
-   {
-      result = this;
-   }
-
-   if ( !result )
-   {
-      ConnectableObjectList* connectableList = &theInputObjectList;
-
-      // see if it is in the immediate list
-      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
-      {
-         if( (*connectableList)[index].valid() )
-         {
-            if( (*connectableList)[index]->canCastTo( className ) )
-            {
-               result = (*connectableList)[index].get();
-               break;
-            }
-         }
-      }
-      
-      if ( !result )
-      {
-         ossimTypeNameVisitor visitor( className,
-                                       true, // firstofTypeFlag
-                                       (ossimVisitor::VISIT_INPUTS|
-                                        ossimVisitor::VISIT_CHILDREN) );
-         this->accept( visitor );
-         result = dynamic_cast<ossimConnectableObject*>( visitor.getObject(0) );
-      }
-   }
-   
-   return result;
-   
-} // End: findInputObjectOfType( const ossimString& className )
-
-// Old findObject findInputObject code kept here until debugged to satisfaction.
-#if 0 /* drb */
-
-ossimConnectableObject* ossimConnectableObject::findObjectOfType(RTTItypeid typeId,
-                                                                 ossimConnectableObjectDirectionType directionType,
-                                                                 bool recurse)
-{
-   ConnectableObjectList* connectableList = &theInputObjectList;
-   
-   
-   if(directionType == CONNECTABLE_DIRECTION_NONE)
-   {
-      return 0;
-   }
-   
-   if(directionType == CONNECTABLE_DIRECTION_OUTPUT)
-   {
-      connectableList = &theOutputObjectList;
-   }
-   // see if it is in the immediate list
-   for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
-   {
-      if((*connectableList)[index].valid())
-      {
-         if((*connectableList)[index]->canCastTo(typeId))//typeId.can_cast(TYPE_INFO(theInputObjectList[index])))
-         {
-            return (*connectableList)[index].get();
-         }
-      }
-   }
-   
-   if(recurse)
-   {
-      ossimConnectableContainerInterface* inter = PTR_CAST(ossimConnectableContainerInterface,
-                                                           this);
-      if(inter)
-      {
-         ossimConnectableObject* tempObj = inter->findFirstObjectOfType(typeId);
-         if(tempObj)
-         {
-            return tempObj;
-         }
-      }
-      
-      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
-      {
-         inter = PTR_CAST(ossimConnectableContainerInterface,
-                          (*connectableList)[index].get());
-         if(inter)
-         {
-            ossimConnectableObject* tempObj = inter->findFirstObjectOfType(typeId);
-            if(tempObj)
-            {
-               return tempObj;
-            }
-         }
-         if((*connectableList)[index].valid())
-         {
-            ossimConnectableObject* result = (*connectableList)[index]->findObjectOfType(typeId,
-                                                                                         directionType,
-                                                                                         recurse);
-            if(result)
-            {
-               return result;
-            }
-         }
-      }
-   }
-   
-   ossimConnectableObject* result = 0;
-   for(ossim_uint32 index = 0; (index < connectableList->size())&&!result; ++index)
-   {
-      if((*connectableList)[index].valid())
-      {
-         result = ((*connectableList)[index])->findObjectOfType(typeId,
-                                                                directionType,
-                                                                recurse);
-      }
-   }
-   
-   return result;
-}
-
-ossimConnectableObject* ossimConnectableObject::findObjectOfType(
-                                                                 const ossimString& className,
-                                                                 ossimConnectableObjectDirectionType directionType,
-                                                                 bool recurse)
-{
-   ConnectableObjectList *connectableList = &theInputObjectList;
-   
-   if(directionType == CONNECTABLE_DIRECTION_NONE)
-   {
-      return 0;
-   }
-   
-   if(directionType == CONNECTABLE_DIRECTION_OUTPUT)
-   {
-      connectableList = &theOutputObjectList;
-      
-   }
-   
-   // see if it is in the immediate list
-   for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
-   {
-      if((*connectableList)[index].valid())
-      {
-         if((*connectableList)[index]->canCastTo(className))//typeId.can_cast(TYPE_INFO(theInputObjectList[index])))
-         {
-            return (*connectableList)[index].get();
-         }
-      }
-   }
-   
-   if(recurse)
-   {
-      ossimConnectableContainerInterface* inter = PTR_CAST(ossimConnectableContainerInterface,
-                                                           this);
-      if(inter)
-      {
-         ossimConnectableObject* tempObj = inter->findFirstObjectOfType(className);
-         if(tempObj)
-         {
-            return tempObj;
-         }
-      }
-      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
-      {
-         inter = PTR_CAST(ossimConnectableContainerInterface,
-                          (*connectableList)[index].get());
-         if(inter)
-         {
-            ossimConnectableObject* tempObj = inter->findFirstObjectOfType(className);
-            if(tempObj)
-            {
-               return tempObj;
-            }
-         }
-         if((*connectableList)[index].valid())
-         {
-            ossimConnectableObject* result = (*connectableList)[index]->findObjectOfType(className,
-                                                                                         directionType,
-                                                                                         recurse);
-            if(result)
-            {
-               return result;
-            }
-         }
-      }
-   }
-   ossimConnectableObject* result = 0;
-   for(ossim_uint32 index = 0; (index < connectableList->size())&&!result; ++index)
-   {
-      if((*connectableList)[index].valid())
-      {
-         result = ((*connectableList)[index])->findObjectOfType(className,
-                                                                directionType,
-                                                                recurse);
-      }
-   }
-   
-   return result;
-}
-
-ossimConnectableObject* ossimConnectableObject::findInputObjectOfType(
-    
-                                                                      const ossimString& className)
-{
-   // See if we are of class type.
-   if (canCastTo(className))
-   {
-      return this;
-   }
-   ossimConnectableObject* result = 0;
-   // If we are a container, look inside for type.
-   ossimConnectableContainerInterface* container =
-   PTR_CAST(ossimConnectableContainerInterface, this);
-   if (container)
-   {
-      const ossim_uint32 NUMBER_OF_OBJECTS =
-      container->getNumberOfObjects(false);
-      if (NUMBER_OF_OBJECTS)
-      {
-         for (ossim_uint32 idx = NUMBER_OF_OBJECTS; idx > 0; --idx) 
-         {
-            result =
-            container->getConnectableObject(idx-1);
-            if (result)
-            {
-               if (result->canCastTo(className))
-               {
-                  return result;
-               }
-               else 
-               {
-                  result = result->findInputObjectOfType(className);
-                  if(result)
-                  {
-                     return result;
-                  }
-               }
-            }
-         }
-      }
-   }
-  
-   ossim_uint32 inputs = getNumberOfInputs();
-   ossim_uint32 inputIdx = 0;
-   for(inputIdx = 0; inputIdx < inputs; ++inputIdx)
-   {
-      ossimConnectableObject* input = getInput(inputIdx);
-      if(input)
-      {
-         result = input->findInputObjectOfType(className);
-         if(result)
-         {
-            return result;
-         }
-      }
-   }
-   return result;
-}
-#endif /* drb */
-// End: Old findObject findInputObject code kept here until debugged to satisfaction.
-
-ossim_int32 ossimConnectableObject::findInputIndex(const ossimConnectableObject* object)
-{
-   ossim_int32 i = 0;
-   for(i = 0; i < (ossim_int32)theInputObjectList.size(); ++i)
-   {
-      if(theInputObjectList[i].get() == object)
-      {
-         return i;
-      }
-   }
-   
-   return -1;
-}
-
-ossim_int32 ossimConnectableObject::findInputIndex(const ossimId& id)
-{
-   ossim_int32 i = 0;
-   for(i = 0; i < (ossim_int32)theInputObjectList.size(); ++i)
-   {
-      if(theInputObjectList[i].valid() &&
-         (theInputObjectList[i]->getId() == id))
-      {
-         return i;
-      }
-   }
-   
-   return -1;
-}
-
-ossim_int32 ossimConnectableObject::findOutputIndex(const ossimConnectableObject* object)
-{
-   ossim_int32 i = 0;
-   for(i = 0; i < (ossim_int32)theOutputObjectList.size(); ++i)
-   {
-      if(theOutputObjectList[i] == object)
-      {
-         return i;
-      }
-   }
-   
-   return -1;
-}
-
-ossim_int32 ossimConnectableObject::findOutputIndex(const ossimId& id)
-{
-   ossim_int32 i = 0;
-   for(i = 0; i < (ossim_int32)theOutputObjectList.size(); ++i)
-   {
-      if(theOutputObjectList[i].valid() &&
-         (theOutputObjectList[i]->getId() == id))
-      {
-         return i;
-      }
-   }
-   
-   return -1;
-}
-
-ossim_int32 ossimConnectableObject::getMyInputIndexToConnectTo(ossimConnectableObject* object)const
-{
-   ConnectableObjectList::const_iterator current;
-   
-   ossim_int32 index = 0;
-   current = theInputObjectList.begin();
-   while(current != theInputObjectList.end())
-   {
-      if(!(*current))
-      {
-         if(canConnectMyInputTo(index, object))
-         {
-            return index;
-         }
-      }
-      ++current;
-      ++index;
-   }
-   if(!theInputListIsFixedFlag)
-   {
-      if(canConnectMyInputTo((ossim_int32)theInputObjectList.size(),
-                             object))
-      {
-         return (ossim_int32)theInputObjectList.size();
-      }
-   }
-   return -1;
-}
-
-ossim_int32 ossimConnectableObject::getMyOutputIndexToConnectTo(ossimConnectableObject* object)const
-{
-   ConnectableObjectList::const_iterator current;
-   
-   ossim_int32 index = 0;
-   current = theOutputObjectList.begin();
-   while(current != theOutputObjectList.end())
-   {
-      if(!(*current))
-      {
-         if(canConnectMyOutputTo(index, object))
-         {
-            return index;
-         }
-      }
-      ++current;
-      ++index;
-   }
-   if(!theOutputListIsFixedFlag)
-   {
-      if(canConnectMyOutputTo((ossim_int32)theOutputObjectList.size(),
-                              object))
-      {
-         return (ossim_int32)theOutputObjectList.size();
-      }
-   }
-   // default to return the size.  This will force an append.
-   //
-   return -1;
-}
-
-void ossimConnectableObject::disconnect(ossimConnectableObject* object)
-{
-   if( (object==this) || (object==0) )
-   {
-      disconnectAllInputs();
-      disconnectAllOutputs();
-   }
-   else
-   {
-      ossim_int32 index = findInputIndex(object);
-      if(index > -1)
-      {
-         disconnectMyInput(index);
-      }
-      index = findOutputIndex(object);
-      if(index > -1)
-      {
-         disconnectMyOutput(index, object);
-      }
-   }
-}
-
-void ossimConnectableObject::disconnect(const ossimId& id)
-{
-   if(id == theId)
-   {
-      disconnect(this);
-   }
-   else
-   {
-      ossimIdVisitor visitor( id,
-                              (ossimVisitor::VISIT_CHILDREN |
-                               ossimVisitor::VISIT_INPUTS   |
-                               ossimVisitor::VISIT_OUTPUTS) );
-      accept( visitor );
-      disconnect( visitor.getObject() );
-   }
-}
-
-ossimRefPtr<ossimConnectableObject> ossimConnectableObject::disconnectMyInput(ossim_int32 inputIndex,
-                                                                  bool disconnectOutputFlag,
-                                                                  bool createEventFlag)
-{
-   if(theInputObjectList.size() == 0)
-   {
-      return 0;
-   }
-   
-   ConnectableObjectList::iterator current;
-   ossimRefPtr<ossimConnectableObject> result = 0;
-   
-   if( (inputIndex > -1)&&
-      (inputIndex < (ossim_int32)theInputObjectList.size()))
-   {
-      current = (theInputObjectList.begin()+inputIndex);
-      result = (*current).get();
-      
-      if(!theInputListIsFixedFlag)
-      {
-         current = theInputObjectList.erase(current);
-      }
-      else
-      {
-         *current = 0;
-      }
-      if(createEventFlag&&result.valid())
-      {
-         ossimConnectionEvent event(this,  // owner of message
-                                    OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
-                                    0,  // new object
-                                    result.get(),// old object
-                                    ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-         
-         // send event to all listeners.
-         //
-         fireEvent(event);
-      }
-      
-      if(disconnectOutputFlag&&result.valid())
-      {
-         result->disconnectMyOutput(this, false, createEventFlag);
-      }
-   }
-   return result;
-}
-
-
-void ossimConnectableObject::disconnectMyInput(ossimConnectableObject* input,
-                                               bool disconnectOutputFlag,
-                                               bool createEventFlag)
-{
-   disconnectMyInput(findInputIndex(input),
-                     disconnectOutputFlag,
-                     createEventFlag);
-}
-
-void ossimConnectableObject::disconnectMyInputs(ConnectableObjectList& inputList,
-                                                bool disconnectOutputFlag,
-                                                bool createEventFlag)
-{
-   if(theInputObjectList.size() == 0) return;
-   ConnectableObjectList oldInputs;
-   ConnectableObjectList newInputs;
-   ossim_int32 i = 0;
-   
-   for(i = 0; i < (ossim_int32)inputList.size(); ++i)
-   {
-      if(findInputIndex(inputList[i].get()) >= 0)
-      {
-         disconnectMyInput(inputList[i].get(), disconnectOutputFlag, false);
-         oldInputs.push_back(inputList[i]);
-      }
-   }
-   if(createEventFlag && oldInputs.size())
-   {
-      ossimConnectionEvent event(this,
-                                 OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
-                                 newInputs,
-                                 oldInputs,
-                                 ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-      fireEvent(event);
-   }
-}
-
-ossimRefPtr<ossimConnectableObject> ossimConnectableObject::disconnectMyOutput(ossim_int32 outputIndex,
-                                                                   bool disconnectInputFlag,
-                                                                   bool createEvent)
-{
-   if(theOutputObjectList.size() == 0)
-   {
-      return 0;
-   }
-   
-   ConnectableObjectList::iterator current;
-   ossimRefPtr<ossimConnectableObject> result = 0;
-   if( (outputIndex > -1)&&
-      (outputIndex < (ossim_int32)theOutputObjectList.size()))
-   {
-      current = (theOutputObjectList.begin()+outputIndex);
-      result = (*current).get();
-      if(!theOutputListIsFixedFlag)
-      {
-         current = theOutputObjectList.erase(current);
-      }
-      else
-      {
-         *current = 0;
-      }
-      if(createEvent)
-      {
-         ossimConnectionEvent event(this,  // owner of message
-                                    OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
-                                    0,  // new object
-                                    result.get(),// old object
-                                    ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
-         
-         // send event to all listeners.
-         //
-         fireEvent(event);
-      }
-      
-      if(disconnectInputFlag&&result.valid())
-      {
-         result->disconnectMyInput(this, false, createEvent);
-      }
-   }
-   return result;
-}
-
-void ossimConnectableObject::disconnectMyOutput(ossimConnectableObject* output,
-                                                bool disconnectInputFlag,
-                                                bool createEventFlag)
-{
-   disconnectMyOutput(findOutputIndex(output), disconnectInputFlag, createEventFlag);
-}
-
-void ossimConnectableObject::disconnectMyOutputs(ConnectableObjectList& outputList,
-                                                 bool disconnectInputFlag,
-                                                 bool createEventFlag)
-{
-   if(theOutputObjectList.size() == 0) return;
-   
-   if(theOutputObjectList.size() == 1)
-   {
-      disconnectMyOutput((ossim_int32)0);
-      return;
-   }
-   ConnectableObjectList oldOutputs;
-   ConnectableObjectList newOutputs;
-   ossim_int32 i = 0;
-   for(i = 0; i < (ossim_int32)outputList.size(); ++i)
-   {
-      if(findOutputIndex(outputList[i].get()) >= 0)
-      {
-         disconnectMyOutput(outputList[i].get(), disconnectInputFlag, false);
-         oldOutputs.push_back(outputList[i]);
-      }
-   }
-   if(createEventFlag && oldOutputs.size())
-   {
-      ossimConnectionEvent event(this,
-                                 OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
-                                 newOutputs,
-                                 oldOutputs,
-                                 ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
-      fireEvent(event);
-   }
-}
-
-void ossimConnectableObject::disconnectAllInputs()
-{
-   if(theInputObjectList.size() == 0) return;
-   if(theInputObjectList.size() == 1)
-   {
-      //     ossimConnectableObject* obj = disconnectMyInput((ossim_int32)0, false);
-      disconnectMyInput((ossim_int32)0);
-      //     if(obj)
-      //     {
-      //        obj->disconnectMyOutput(this, false);
-      //     }
-      return;
-   }
-   ConnectableObjectList::iterator current;
-   ConnectableObjectList oldInputs = theInputObjectList;
-   ConnectableObjectList newInputs;
-   
-   
-   current = theInputObjectList.begin();
-   while(current != theInputObjectList.end())
-   {
-      if(!theInputListIsFixedFlag)
-      {
-         current = theInputObjectList.erase(current);
-      }
-      else
-      {
-         *current = 0;
-         ++current;
-      }
-   }
-   ossimConnectionEvent event(this,
-                              OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
-                              newInputs,
-                              oldInputs,
-                              ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-   fireEvent(event);
-   
-   for(ossim_uint32 index = 0; index < oldInputs.size(); ++index)
-   {
-      if(oldInputs[index].valid())
-      {
-         oldInputs[index]->disconnectMyOutput(this, false);
-      }
-   }
-}
-
-void ossimConnectableObject::disconnectAllOutputs()
-{
-   if(theOutputObjectList.size() == 0) return;
-   if(theOutputObjectList.size() == 1)
-   {
-      //     ossimConnectableObject* obj = disconnectMyOutput((ossim_int32)0, false);
-      disconnectMyOutput((ossim_int32)0);
-      //     if(obj)
-      //     {
-      //        obj->disconnectMyInput(this,
-      //                               false);
-      //     }
-      return;
-   }
-   ConnectableObjectList::iterator current;
-   
-   ConnectableObjectList oldOutputs = theOutputObjectList;
-   ConnectableObjectList newOutputs;
-   
-   current = theOutputObjectList.begin();
-   while(current != theOutputObjectList.end())
-   {
-      if(!theOutputListIsFixedFlag)
-      {
-         current = theOutputObjectList.erase(current);
-      }
-      else
-      {
-         *current = 0;
-         ++current;
-      }
-   }
-   ossimConnectionEvent event(this,
-                              OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
-                              newOutputs,
-                              oldOutputs,
-                              ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
-   fireEvent(event);
-   
-   for(ossim_uint32 index = 0; index < oldOutputs.size(); ++index)
-   {
-      if(oldOutputs[index].valid())
-      {
-         oldOutputs[index]->disconnectMyInput(this, false);
-      }
-   }
-}
-
-ossim_int32 ossimConnectableObject::connectMyInputTo(ossimConnectableObject* object,
-                                                     bool makeOutputConnection,
-                                                     bool createEventFlag)
-{
-   if(!object) return false;
-   
-   ossim_int32 index = findInputIndex(object);
-   if(index >= 0) return index;
-   
-   index = getMyInputIndexToConnectTo(object);
-   
-   if(index>-1)
-   {
-      if(index >= (ossim_int32)theInputObjectList.size())
-      {
-         if(theInputListIsFixedFlag) return -1;
-         
-         index = (ossim_int32)theInputObjectList.size();
-         theInputObjectList.push_back(object);
-      }
-      else
-      {
-         if(!theInputObjectList[index])
-         {
-            theInputObjectList[index] = object;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "Must issue a detach first!! trying to attach object " << object->getClassName()
-            << "\n to input index " << index << " in " << getClassName() << "\n";
-            
-            return -1;
-         }
-      }
-      if(createEventFlag)
-      {
-         ossimConnectionEvent event(this,  // owner of message
-                                    OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                    theInputObjectList[index].get(),  // new object
-                                    0,// old object
-                                    ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-         // send event to any listener.
-         //
-         fireEvent(event);
-      }
-      
-      if(makeOutputConnection&&object)
-      {
-         // make sure we tell the input not to connect
-         // back to us or infinite loop
-         //
-         object->connectMyOutputTo(this, false, createEventFlag);
-      }
-   }
-   else
-   {
-      return index;
-   }
-   
-   return index;
-}
-
-ossim_int32 ossimConnectableObject::connectMyInputTo(ossim_int32 inputIndex,
-                                                     ossimConnectableObject* inputObject,
-                                                     bool makeOutputConnection,
-                                                     bool createEventFlag)
-{
-   if(!inputObject)
-   {
-      if(inputIndex < (ossim_int32)theInputObjectList.size())
-      {
-         ossimConnectableObject* oldObject = theInputObjectList[inputIndex].get();
-         if(theInputListIsFixedFlag)
-         {
-            theInputObjectList[inputIndex] = 0;
-         }
-         else
-         {
-            theInputObjectList.erase(theInputObjectList.begin() + inputIndex);
-         }
-         if(createEventFlag)
-         {
-            ossimConnectionEvent event(this,  // owner of message
-                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                       0,  // new object
-                                       oldObject,// old object
-                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-            // send event to any listener.
-            //
-            fireEvent(event);
-         }
-         return -1;
-      }
-      return -1;
-   }
-   
-   ossim_int32 index = findInputIndex(inputObject);
-   
-   if((index >= 0)&&!inputObject) return index;
-   if(!inputObject) return -1;
-   
-   if(canConnectMyInputTo(inputIndex, inputObject))
-   {
-      if(inputIndex>-1)
-      {
-         ossimConnectableObject* oldObject=0;
-         if(inputIndex >= (ossim_int32)theInputObjectList.size())
-         {
-            if(theInputListIsFixedFlag) return -1;
-            
-            inputIndex = (ossim_int32)theInputObjectList.size();
-            theInputObjectList.push_back(inputObject);
-         }
-         else
-         {
-            oldObject = theInputObjectList[inputIndex].get();
-            theInputObjectList[inputIndex] = inputObject;
-            if(oldObject)
-            {
-               oldObject->disconnectMyOutput(this, false);
-            }
-         }
-         
-         if(createEventFlag)
-         {
-            ossimConnectionEvent event(this,  // owner of message
-                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                       theInputObjectList[inputIndex].get(),  // new object
-                                       oldObject,// old object
-                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-            // send event to any listener.
-            //
-            fireEvent(event);
-         }
-         
-         if(makeOutputConnection&&inputObject)
-         {
-            // make sure we tell the input not to connect
-            // back to us or infinite loop
-            //
-            inputObject->connectMyOutputTo(this, false, createEventFlag);
-         }
-      }
-      else
-      {
-         return inputIndex;
-      }
-      
-      return inputIndex;
-   }
-   
-   return -1;
-}
-
-bool ossimConnectableObject::connectMyInputTo(ConnectableObjectList& inputList,
-                                              bool makeOutputConnection,
-                                              bool createEventFlag)
-{
-   bool result = true;
-   ConnectableObjectList oldInputs;
-   ConnectableObjectList newInputs;
-   
-   if(inputList.size() == 1)
-   {
-      if(inputList[0].valid())
-      {
-         return (connectMyInputTo(inputList[0].get(), makeOutputConnection, createEventFlag) >= 0);
-      }
-      else
-      {
-         if(theInputListIsFixedFlag)
-         {
-            theInputObjectList[0] = 0;
-         }
-         else
-         {
-            theInputObjectList.clear();
-         }
-         if(createEventFlag)
-         {
-            ossimConnectionEvent event(this,
-                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                       0,
-                                       theInputObjectList[0].get(),
-                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-            fireEvent(event);
-         }
-         
-         return true;
-      }
-   }
-   ossim_int32 i = 0;
-   for(i = 0; i < (ossim_int32)inputList.size(); ++i)
-   {
-      if(inputList[i].valid())
-      {
-         if(connectMyInputTo(inputList[i].get(), makeOutputConnection, false)<0)
-         {
-            result = false;
-         }
-         else
-         {
-            newInputs.push_back(inputList[i]);
-         }
-      }
-      else
-      {
-         newInputs.push_back(0);
-      }
-   }
-   if(createEventFlag)
-   {
-      ossimConnectionEvent event(this,
-                                 OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                 newInputs,
-                                 oldInputs,
-                                 ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-      fireEvent(event);
-   }
-   return result;
-}
-
-ossim_int32 ossimConnectableObject::connectMyOutputTo(ossimConnectableObject* output,
-                                                      bool makeInputConnection,
-                                                      bool createEventFlag)
-{
-   ossim_int32 index = findOutputIndex(output);
-   if(index >= 0) return index;
-   
-   index = getMyOutputIndexToConnectTo(output);
-   
-   if(index > -1)
-   {
-      if((index >= (ossim_int32)theOutputObjectList.size())&&
-         !theOutputListIsFixedFlag)
-      {
-         index = (ossim_int32)theOutputObjectList.size();
-         theOutputObjectList.push_back(output);
-      }
-      else
-      {
-         if(!theOutputObjectList[index])
-         {
-            theOutputObjectList[index] = output;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "Must issue a disconnect first!! trying to connect object " << output->getClassName()
-            << "\n to output index " << index << " in " << getClassName() << "\n";
-            
-            return -1;
-         }
-      }
-      if(createEventFlag)
-      {
-         ossimConnectionEvent event(this,  // owner of message
-                                    OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                    theOutputObjectList[index].get(),  // new object
-                                    0,// old object
-                                    ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
-         // send event to any listener.
-         //
-         fireEvent(event);
-      }
-      if(makeInputConnection&&output)
-      {
-         // tell the output object not to connect back
-         // to us since this is already done.
-         //
-         output->connectMyInputTo(this, false, createEventFlag);
-      }
-   }
-   else
-   {
-      return index;
-   }
-   
-   return index;
-}
-
-bool ossimConnectableObject::connectMyOutputTo(ConnectableObjectList& outputList,
-                                               bool makeInputConnection,
-                                               bool createEventFlag)
-{
-   bool result = true;
-   ConnectableObjectList oldOutputs;
-   ConnectableObjectList newOutputs;
-   
-   if(outputList.size() == 0)
-   {
-      disconnectAllOutputs();
-      return true;
-   }
-   if((outputList.size() == 1)&&outputList[0].valid())
-   {
-      if(outputList[0].valid())
-      {
-         return (connectMyOutputTo(outputList[0].get(), makeInputConnection, createEventFlag) >= 0);
-      }
-      else
-      {
-         disconnectAllOutputs();
-      }
-   }
-   
-   ossim_int32 i = 0;
-   for(i = 0; i < (ossim_int32)outputList.size(); ++i)
-   {
-      if((connectMyOutputTo(outputList[i].get(), makeInputConnection, false)<0)&&outputList[i].valid())
-      {
-         newOutputs.push_back(outputList[i].get());
-         result = false;
-      }
-   }
-   if(createEventFlag&&newOutputs.size())
-   {
-      ossimConnectionEvent event(this,
-                                 OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                 newOutputs,
-                                 oldOutputs,
-                                 ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
-      fireEvent(event);
-   }
-   
-   return result;
-}
-
-ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 idx)
-{
-   if(idx < theInputObjectList.size())
-   {
-      return theInputObjectList[idx].get();
-   }
-   
-   return 0;
-}
-
-const ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 idx)const
-{
-   if( idx < theInputObjectList.size())
-   {
-      return theInputObjectList[idx].get();
-   }
-   
-   return 0;
-}
-
-ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 idx)
-{
-   if(idx < theOutputObjectList.size())
-   {
-      return theOutputObjectList[idx].get();
-   }
-   
-   return 0;
-}
-
-bool ossimConnectableObject::connectInputList(ConnectableObjectList& inputList)
-{
-   bool result = true;
-   ossim_uint32 i = 0;
-   ConnectableObjectList oldInputs = theInputObjectList;
-   ConnectableObjectList newInputs;
-   ConnectableObjectList::iterator currentInput = inputList.begin();
-   ConnectableObjectList tempOld;
-   if(theInputObjectList.size())
-   {
-      for(i = 0; i < theInputObjectList.size(); ++i)
-      {
-         if(oldInputs[i].valid())
-         {
-            tempOld.push_back(oldInputs[i].get());
-         }
-         theInputObjectList[i] = 0;
-      }
-   }
-   if(theInputListIsFixedFlag && (theInputObjectList.size()==0))
-   {
-      return false;
-   }
-   
-   if(!theInputListIsFixedFlag)
-   {
-      theInputObjectList.clear();
-   }
-   if(tempOld.size())
-   {
-      for(i = 0; i < tempOld.size(); ++ i)
-      {
-         tempOld[i]->disconnectMyOutput(this, false);
-      }
-   }
-   //   disconnectAllInputs();
-   
-   if(inputList.size() == 1)
-   {
-      return (connectMyInputTo(inputList[0].get())>=0);
-   }
-   i = 0;
-   // now connect the new outputs
-   //
-   currentInput = inputList.begin();
-   result = false;
-   
-   while(currentInput != inputList.end())
-   {
-      if((*currentInput).valid())
-      {
-         if(connectMyInputTo((*currentInput).get(), false) >= 0)
-         {
-            newInputs.push_back((*currentInput).get());
-            result = true;
-         }
-      }
-      ++currentInput;
-   }
-   ossimConnectionEvent event(this,
-                              OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
-                              newInputs,
-                              oldInputs,
-                              ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-   
-   if(theInputObjectList.size())
-   {
-      fireEvent(event);
-   }
-   
-   newInputs          = theInputObjectList;
-   
-   
-   
-   event = ossimConnectionEvent(this,
-                                OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                newInputs,
-                                oldInputs,
-                                ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-   fireEvent(event);
-   
-   return result;
-}
-
-bool ossimConnectableObject::connectOutputList(ConnectableObjectList& outputList)
-{
-   bool result = true;
-   ossim_int32 index  = 0;
-   ConnectableObjectList oldOutputs = theOutputObjectList;
-   ConnectableObjectList newOutputs;
-   ConnectableObjectList::const_iterator currentOutput = outputList.begin();
-   
-   disconnectAllOutputs();
-   
-   if(outputList.size() == 1)
-   {
-      return (connectMyOutputTo(outputList[0].get())>=0);
-   }
-   while(currentOutput != outputList.end())
-   {
-      if(!canConnectMyOutputTo(index, (*currentOutput).get()))
-      {
-         result = false;
-      }
-      ++currentOutput;
-   }
-   
-   if(!result)
-   {
-      return false;
-   }
-   
-   theOutputObjectList = outputList;
-   newOutputs = theOutputObjectList;
-   
-   ossimConnectionEvent event(this,
-                              OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                              newOutputs,
-                              oldOutputs,
-                              ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
-   fireEvent(event);
-   
-   return result;
-}
-
-void ossimConnectableObject::setNumberOfInputs(ossim_int32 numberOfInputs)
-{
-   if((ossim_int32)theInputObjectList.size() == numberOfInputs)
-   {
-      return;
-   }
-   ossim_int32 i = 0;
-   if(numberOfInputs < (ossim_int32)theInputObjectList.size())
-   {
-      ConnectableObjectList v(theInputObjectList.begin(),
-                              theInputObjectList.begin()+numberOfInputs);
-      ConnectableObjectList disconnectList;
-      
-      for(i = numberOfInputs;
-          i < (ossim_int32)theInputObjectList.size();
-          ++i)
-      {
-         if(theInputObjectList[i].valid())
-         {
-            disconnectList.push_back(theInputObjectList[i]);
-         }
-      }
-      disconnectMyInputs(disconnectList);
-      
-      theInputObjectList.clear();
-      theInputObjectList = v;
-   }
-   else
-   {
-      for(i = (ossim_int32)theInputObjectList.size();
-          i < numberOfInputs;
-          ++i)
-      {
-         theInputObjectList.push_back(0);
-      }
-   }
-}
-
-void ossimConnectableObject::setNumberOfOutputs(ossim_int32 numberOfOutputs)
-{
-   if((ossim_int32)theOutputObjectList.size() == numberOfOutputs)
-   {
-      return;
-   }
-   ossim_int32 i = 0;
-   if(numberOfOutputs < (ossim_int32)theOutputObjectList.size())
-   {
-      ConnectableObjectList v(theOutputObjectList.begin(),
-                              theOutputObjectList.begin()+numberOfOutputs);
-      ConnectableObjectList disconnectList;
-      for(i = numberOfOutputs;
-          i < (ossim_int32)theOutputObjectList.size();
-          ++i)
-      {
-         if(theOutputObjectList[i].valid())
-         {
-            disconnectList.push_back(theOutputObjectList[i]);
-         }
-      }
-      disconnectMyOutputs(disconnectList);
-      
-      theOutputObjectList.clear();
-      theOutputObjectList = v;
-   }
-   else
-   {
-      for(i = (ossim_int32)theOutputObjectList.size();
-          i < numberOfOutputs;
-          ++i)
-      {
-         theOutputObjectList.push_back(0);
-      }
-   }
-}
-
-
-const ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 idx)const
-{
-   if(idx < theOutputObjectList.size())
-   {
-      return theOutputObjectList[idx].get();
-   }
-   
-   return 0;
-}
-
-void  ossimConnectableObject::findAllObjectsOfType(ConnectableObjectList& result,
-                                                   const RTTItypeid& typeInfo,
-                                                   bool recurse)
-{
-   int j;
-   // go through children first
-   //
-   ossimConnectableContainerInterface* inter = PTR_CAST(ossimConnectableContainerInterface,
-                                                        this);
-   if(inter)
-   {
-      ConnectableObjectList tempList = inter->findAllObjectsOfType(typeInfo,
-                                                                   recurse);
-      
-      for(j = 0; j < (int)tempList.size(); ++j)
-      {
-         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
-         if(iter == result.end())
-         {
-            result.push_back(tempList[j].get());
-         }
-      }
-   }
-   
-}
-
-void ossimConnectableObject::findAllObjectsOfType(ConnectableObjectList& result, 
-                                                  const ossimString& className,
-                                                  bool recurse)
-{
-   int j;
-   // go through children first
-   //
-   ossimConnectableContainerInterface* inter = PTR_CAST(ossimConnectableContainerInterface,
-                                                        this);
-   if(inter)
-   {
-      ConnectableObjectList tempList = inter->findAllObjectsOfType(className,
-                                                                   recurse);
-      
-      for(j = 0; j < (int)tempList.size(); ++j)
-      {
-         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
-         if(iter == result.end())
-         {
-            result.push_back(tempList[j].get());
-         }
-      }
-   }
-}
-
-#if 0
-void ossimConnectableObject::findAllInputsOfType(ConnectableObjectList& result,
-                                                 const RTTItypeid& typeInfo,
-                                                 bool propagateToInputs,
-                                                 bool recurseChildren)
-{
-   int i;
-   int j;
-   // go through children first
-   //
-   ossimConnectableContainerInterface* inter = PTR_CAST(ossimConnectableContainerInterface,
-                                                        this);
-   if(inter&&recurseChildren)
-   {
-      ConnectableObjectList tempList = inter->findAllObjectsOfType(typeInfo,
-                                                                   true);
-      
-      for(j = 0; j < (int)tempList.size(); ++j)
-      {
-         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
-         if(iter == result.end())
-         {
-            result.push_back(tempList[j].get());
-         }
-      }
-   }
-   
-   for(i = 0; i < (int)getNumberOfInputs(); ++i)
-   {
-      ossimConnectableObject* current = getInput(i);
-      if(current&&(current->canCastTo(typeInfo)))
-      {
-         ConnectableObjectList::iterator position = std::find(result.begin(), result.end(), current);
-         
-         if(position == result.end())
-         {
-            result.push_back(current);
-         }
-      }
-      inter = PTR_CAST(ossimConnectableContainerInterface, current);
-      if(inter)
-      {
-         ConnectableObjectList tempList = inter->findAllObjectsOfType(typeInfo, true);
-         for(j = 0; j < (int)tempList.size(); ++j)
-         {
-            ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
-            if(iter == result.end())
-            {
-               result.push_back(tempList[j]);
-            }
-         }
-      }
-      
-      if(propagateToInputs&&current)
-      {
-         current->findAllInputsOfType(result,
-                                      typeInfo,
-                                      true,
-                                      recurseChildren);
-      }
-   }
-}
-
-void ossimConnectableObject::findAllInputsOfType(ConnectableObjectList& result,
-                                                 const ossimString& className,
-                                                 bool propagateToInputs,
-                                                 bool recurseChildren)
-{
-   int j;
-   // go through children first
-   //
-   ossimConnectableContainerInterface* inter = PTR_CAST(ossimConnectableContainerInterface,
-                                                        this);
-   if(inter&&recurseChildren)
-   {
-      ConnectableObjectList tempList = inter->findAllObjectsOfType(className,
-                                                                   true);
-      
-      for(j = 0; j < (int)tempList.size(); ++j)
-      {
-         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
-         if(iter == result.end())
-         {
-            result.push_back(tempList[j]);
-         }
-      }
-   }
-   for(ossim_uint32 i = 0; i < getNumberOfInputs(); ++i)
-   {
-      ossimConnectableObject* current = getInput(i);
-      if(current&&(current->canCastTo(className)))
-      {
-         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), current);
-         if(iter == result.end())
-         {
-            result.push_back(current);
-         }
-      }
-      ossimConnectableContainerInterface* inter = PTR_CAST(ossimConnectableContainerInterface,
-                                                           current);
-      if(inter)
-      {
-         ConnectableObjectList tempList = inter->findAllObjectsOfType(className, true);
-         for(j = 0; j < (int)tempList.size(); ++j)
-         {
-            ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
-            if(iter == result.end())
-            {
-               result.push_back(tempList[j]);
-            }
-         }
-      }
-      
-      if(propagateToInputs&&current)
-      {
-         current->findAllInputsOfType(result,
-                                      className,
-                                      true,
-                                      recurseChildren);
-      }
-   }
-}
-#endif
-
-void ossimConnectableObject::propagateEventToOutputs(ossimEvent& event)
-{
-   ossim_uint32 i;
-   
-   for(i = 0; i <getNumberOfOutputs(); ++i)
-   {
-      ossimConnectableObject* obj = getOutput(i);
-      if(obj)
-      {
-         event.setPropagationType(ossimEvent::PROPAGATION_OUTPUT);
-         obj->fireEvent(event);
-         obj->propagateEventToOutputs(event);
-      }
-   }
-}
-
-void ossimConnectableObject::propagateEventToInputs(ossimEvent& event)
-{
-   ossim_uint32 i;
-   
-   for(i = 0; i <getNumberOfInputs(); ++i)
-   {
-      ossimConnectableObject* obj = getInput(i);
-      if(obj)
-      {
-         obj->fireEvent(event);
-         obj->propagateEventToInputs(event);
-      }
-   }
-}
-
-void ossimConnectableObject::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid()) return;
-   if(property->getName() == "Description")
-   {
-      property->valueToString(theDescription);
-   }
-}
-
-void ossimConnectableObject::setProperty(const ossimString& name, const ossimString& value)
-{
-   ossimPropertyInterface::setProperty(name, value);
-}
-
-ossimRefPtr<ossimProperty> ossimConnectableObject::getProperty(const ossimString& name)const
-{
-   if(name == "Description")
-   {
-      return new ossimTextProperty(name, theDescription);
-   }
-   // "Class name" check for backwards compatibility only.
-   else if( (name == "class_name") ||
-           (name == "Class name") ) 
-   {
-      ossimProperty* prop = new ossimTextProperty(name,
-                                                  getClassName());
-      prop->setReadOnlyFlag(true);
-      
-      return prop;
-   }
-   return ossimRefPtr<ossimProperty>();
-}
-
-void ossimConnectableObject::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back("class_name");
-   propertyNames.push_back("Description");
-}
-
-bool ossimConnectableObject::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   const char* lookup = kwl.find(prefix,
-                                 ossimKeywordNames::ID_KW);
-   
-   // disconnect(this);
-   
-   if(lookup)
-   {
-      theId = ossimId(ossimString(lookup).toLong());
-   }
-   
-   lookup = kwl.find(prefix, CONNECTABLE_INPUT_LIST_FIXED_KW);
-   if(lookup)
-   {
-      theInputListIsFixedFlag = ossimString(lookup).toBool();
-   }
-   
-   lookup = kwl.find(prefix, CONNECTABLE_OUTPUT_LIST_FIXED_KW);
-   if(lookup)
-   {
-      theOutputListIsFixedFlag = ossimString(lookup).toBool();
-   }
-   
-   ossim_int32 numberInputs  = 0;
-   ossim_int32 numberOutputs = 0;
-   
-   ossimString regExpression;
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_INPUTS_KW);
-   if(lookup)
-   {
-      numberInputs = ossimString(lookup).toLong();
-   }
-   else if(!theInputListIsFixedFlag)
-   {
-      regExpression = ossimString("^(") + ossimString(prefix) + "input_connection[0-9]+)";
-      numberInputs = kwl.getNumberOfSubstringKeys(regExpression);
-   }
-   else
-   {
-      // if we are fixed then the list should already be set
-      numberInputs = (ossim_int32) theInputObjectList.size();
-   }
-
-   
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_OUTPUTS_KW);
-   if(lookup)
-   {
-      numberOutputs = ossimString(lookup).toLong();
-   }
-   else if(!theOutputListIsFixedFlag)
-   {
-      regExpression = ossimString("^(") + ossimString(prefix) + "output_connection[0-9]+)";
-      numberOutputs = kwl.getNumberOfSubstringKeys(regExpression);
-   }
-   else 
-   {
-      // if we are fixed then the list should already be set
-      numberOutputs = (ossim_int32) theOutputObjectList.size();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::DESCRIPTION_KW);
-   if (lookup)
-   {
-      theDescription = lookup;
-   }
-   
-   setNumberOfInputs(numberInputs);
-   setNumberOfOutputs(numberOutputs);
-   
-   return ossimObject::loadState(kwl, prefix);
-}
-
-bool ossimConnectableObject::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix)const
-{
-   ossimObject::saveState(kwl, prefix);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::ID_KW,
-           theId.getId(),
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::DESCRIPTION_KW,
-           theDescription,
-           true);
-   
-   kwl.add(prefix,
-           CONNECTABLE_INPUT_LIST_FIXED_KW,
-           theInputListIsFixedFlag,
-           true);
-   
-   kwl.add(prefix,
-           CONNECTABLE_OUTPUT_LIST_FIXED_KW,
-           theOutputListIsFixedFlag,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_INPUTS_KW,
-           static_cast<ossim_uint32>(theInputObjectList.size()),
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_OUTPUTS_KW,
-           static_cast<ossim_uint32>(theOutputObjectList.size()),
-           true);
-   
-   ossim_int32 i = 0;
-   for(i = 1; i <= (ossim_int32)theInputObjectList.size(); ++i)
-   {
-      ossimString value = "input_connection" + ossimString::toString(i);
-      
-      ossim_int32 id;
-      
-      if(theInputObjectList[i-1].valid())
-      {
-         id = theInputObjectList[i-1]->getId().getId();
-      }
-      else
-      {
-         id = -1;
-      }
-      kwl.add(prefix,
-              value.c_str(),
-              id,
-              true);
-   }
-   
-   for(i = 1; i <= (ossim_int32)theOutputObjectList.size(); ++i)
-   {
-      ossimString value = "output_connection" + ossimString::toString(i);
-      
-      ossim_int32 id;
-      
-      if(theOutputObjectList[i-1].valid())
-      {
-         id = theOutputObjectList[i-1]->getId().getId();
-      }
-      else
-      {
-         id = -1;
-      }
-      kwl.add(prefix,
-              value.c_str(),
-              id,
-              true);
-   }
-   
-   return true;
-}
-
-ossim_uint32 ossimConnectableObject::saveStateOfAllInputs(ossimKeywordlist& kwl,
-                                                          bool              saveThisStateFlag,
-                                                          ossim_uint32      objectIndex,
-                                                          const char*       prefix) const
-{
-   ossim_uint32 index = objectIndex;
-
-   const ossim_uint32 NUMBER_OF_INPUTS = getNumberOfInputs();
-   if (NUMBER_OF_INPUTS)
-   {
-      // Save all the inputs.
-      for(ossim_uint32 i = 0; i < NUMBER_OF_INPUTS; ++i)
-      {
-         const ossimConnectableObject* input = getInput(i);
-         if(input)
-            index = input->saveStateOfAllInputs(kwl, true, index, prefix);
-      }
-   }
-
-   if (saveThisStateFlag)
-   {
-      ossimString myPrefix;
-      if (prefix)
-         myPrefix = prefix;
-
-      myPrefix += "object" + ossimString::toString(index) + ".";
-
-      // Save the state of this object.
-      saveState(kwl, myPrefix.c_str());
-      ++index;
-   }
-
-   return index;
-}
-
-bool ossimConnectableObject::fillContainer(ossimConnectableContainer& container)
-{
-   // Insert inputs into the container:
-   bool good_fill = true;
-   ossim_uint32 num_inputs = getNumberOfInputs();
-   for(ossim_uint32 i=0; (i<num_inputs) && good_fill; ++i)
-   {
-      ossimConnectableObject* input = getInput(i);
-      if (input)
-         good_fill = input->fillContainer(container);
-   }
-   
-   // Insert this object and all of its children and inputs into the container provided:
-   if (good_fill)
-      good_fill = container.addChild(this);
-
-   return good_fill;
-}
-
-bool ossimConnectableObject::canConnectMyOutputTo(ossim_int32 myOutputIndex,
-                                                  const ossimConnectableObject* /* object */ ) const
-{
-   if(theOutputListIsFixedFlag)
-   {
-      return ((myOutputIndex >= 0) &&
-              (myOutputIndex < (ossim_int32)theOutputObjectList.size()));
-   }
-   
-   return ((myOutputIndex >= 0) &&
-           (myOutputIndex  <= (ossim_int32)theOutputObjectList.size()));
-}
-
-bool ossimConnectableObject::moveInputUp(const ossimId& id)
-{
-   bool result = false;
-   
-   if (theInputListIsFixedFlag == false)
-   {
-      if ( theInputObjectList.size() )
-      {
-         ossim_int32 indexOfId = findInputIndex(id);
-         
-         if (indexOfId > 0)
-         {
-            ConnectableObjectList oldInputs =
-            theInputObjectList;
-            
-            // Swap with index above.
-            ossimRefPtr<ossimConnectableObject> tmpObj  = theInputObjectList[indexOfId].get();
-            theInputObjectList[indexOfId]   = theInputObjectList[indexOfId-1].get();
-            theInputObjectList[indexOfId-1] = tmpObj;
-            result = true;
-            
-            ConnectableObjectList newInputs =
-            theInputObjectList;
-            
-            ossimConnectionEvent event(this,
-                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                       newInputs,
-                                       oldInputs,
-                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-            fireEvent(event);
-         }
-      }
-   }
-   
-   return result;
-}
-
-bool ossimConnectableObject::moveInputDown(const ossimId& id)
-{
-   bool result = false;
-   
-   if (theInputListIsFixedFlag == false)
-   {
-      if ( theInputObjectList.size() )
-      {
-         ossim_int32 indexOfId = findInputIndex(id);
-         
-         if ( indexOfId <
-             static_cast<ossim_int32>(theInputObjectList.size()-1) )
-         {
-            ConnectableObjectList oldInputs =
-            theInputObjectList;
-            
-            // Swap with index below.
-            ossimRefPtr<ossimConnectableObject> tmpObj  = theInputObjectList[indexOfId].get();
-            theInputObjectList[indexOfId]   = theInputObjectList[indexOfId+1].get();
-            theInputObjectList[indexOfId+1] = tmpObj;
-            result = true;
-            
-            ConnectableObjectList newInputs =
-            theInputObjectList;
-            
-            ossimConnectionEvent event(this,
-                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                       newInputs,
-                                       oldInputs,
-                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-            fireEvent(event);
-         }
-      }
-   }
-   
-   return result;
-}
-
-bool ossimConnectableObject::moveInputToTop(const ossimId& id)
-{
-   bool result = false;
-   
-   if (theInputListIsFixedFlag == false)
-   {
-      if ( theInputObjectList.size() )
-      {
-         ConnectableObjectList::iterator i =
-         theInputObjectList.begin();
-         
-         while (i != theInputObjectList.end())
-         {
-            if ( (*i)->getId() == id )
-            {
-               break;
-            }
-            ++i;
-         }
-         
-         if ( (i != theInputObjectList.begin()) &&
-             (i != theInputObjectList.end()) )
-         {
-            ConnectableObjectList oldInputs =
-            theInputObjectList;
-            
-            ossimRefPtr<ossimConnectableObject> obj = (*i).get();               
-            theInputObjectList.erase(i);
-            theInputObjectList.insert(theInputObjectList.begin(), obj.get());
-            result = true;
-            
-            ConnectableObjectList newInputs =
-            theInputObjectList;
-            
-            ossimConnectionEvent event(
-                                       this,
-                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                       newInputs,
-                                       oldInputs,
-                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-            fireEvent(event);
-         }
-      }
-   }
-   
-   return result;
-}
-
-bool ossimConnectableObject::moveInputToBottom(const ossimId& id)
-{
-   bool result = false;
-   
-   if (theInputListIsFixedFlag == false)
-   {
-      if ( theInputObjectList.size() )
-      {
-         ConnectableObjectList::iterator bottom =
-         theInputObjectList.end()-1;
-         
-         // if not bottom already
-         if ( (*bottom)->getId() != id ) 
-         {
-            ConnectableObjectList::iterator i =
-            theInputObjectList.begin();
-            
-            while (i != bottom)
-            {
-               if ( (*i)->getId() == id )
-               {
-                  break;
-               }
-               ++i;
-            }
-            
-            if (i != bottom)
-            {
-               ConnectableObjectList oldInputs =
-               theInputObjectList;
-               
-               ossimRefPtr<ossimConnectableObject> obj = (*i).get();
-               theInputObjectList.erase(i);
-               theInputObjectList.push_back(obj);
-               result = true;
-               
-               ConnectableObjectList newInputs =
-               theInputObjectList;
-               
-               ossimConnectionEvent event(
-                                          this,
-                                          OSSIM_EVENT_CONNECTION_CONNECT_ID,
-                                          newInputs,
-                                          oldInputs,
-                                          ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
-               fireEvent(event);
-            }
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimConnectableObject::accept(ossimVisitor& visitor)
-{
-   if(!visitor.stopTraversal())
-   {
-      if(!visitor.hasVisited(this))
-      {
-         visitor.visit(this);
-      }
-      
-      if(!visitor.stopTraversal())
-      {
-         
-         if(visitor.getVisitorType() & ossimVisitor::VISIT_INPUTS)
-         {
-            ConnectableObjectList::iterator current = theInputObjectList.begin();
-            while(current != theInputObjectList.end())
-            {
-               if((*current).get()&&!visitor.hasVisited((*current).get())) (*current)->accept(visitor);
-               ++current;
-            }
-         }
-         
-         if(visitor.getVisitorType() & ossimVisitor::VISIT_OUTPUTS)
-         {
-            // go through the outputs
-            ConnectableObjectList::iterator current = theOutputObjectList.begin();
-            while(current != theOutputObjectList.end())
-            {
-               if((*current).get()&&!visitor.hasVisited((*current).get())) (*current)->accept(visitor);
-               ++current;
-            }
-            ossimConnectableObject* obj = dynamic_cast<ossimConnectableObject*>(theOwner);
-            
-            if((!getNumberOfOutputs()||!isConnected(CONNECTABLE_DIRECTION_OUTPUT))&&obj)
-            {
-               ossimVisitor::VisitorType currentType = visitor.getVisitorType();
-               // lets make sure inputs and outputs are turned off for we are traversing all children and we should not have
-               // to have that enabled
-               //
-               visitor.turnOffVisitorType(ossimVisitor::VISIT_INPUTS);// |ossimVisitor::VISIT_CHILDREN);
-               
-               //obj->accept(visitor);
-               visitor.setVisitorType(currentType);
-              // visitor.turnOffVisitorType(ossimVisitor::VISIT_INPUTS);
-               // now go through outputs
-               //
-               ConnectableObjectList::iterator current = obj->theOutputObjectList.begin();
-               while(current != obj->theOutputObjectList.end())
-               {
-                  if((*current).get()&&!visitor.hasVisited((*current).get())) (*current)->accept(visitor);
-                  ++current;
-               }
-               
-               visitor.setVisitorType(currentType);
-               
-            }
-         } 
-      }  
-   }
-}
-
-void ossimConnectableObject::setId(const ossimId& id)
-{
-   theId = id;
-}
-
-const ossimId& ossimConnectableObject::getId()const
-{
-   return theId;
-}
-
-const ossimObject* ossimConnectableObject::getOwner() const
-{
-   return theOwner;
-}
-
-ossim_uint32 ossimConnectableObject::getNumberOfInputs()const
-{
-   return (ossim_uint32)theInputObjectList.size();
-}
-
-ossim_uint32 ossimConnectableObject::getNumberOfOutputs()const
-{
-   return (ossim_uint32)theOutputObjectList.size();
-}
-
-bool ossimConnectableObject::getInputListIsFixedFlag()const
-{
-   return theInputListIsFixedFlag;
-}
-
-bool ossimConnectableObject::getOutputListIsFixedFlag()const
-{
-   return theOutputListIsFixedFlag;
-}
-
-const ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getInputList()const
-{
-   return theInputObjectList;
-}
-
-const ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getOutputList()const
-{
-   return theOutputObjectList;
-}
-
-ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getInputList()
-{
-   return theInputObjectList;
-}
-
-ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getOutputList()
-{
-   return theOutputObjectList;
-}
diff --git a/ossim/src/ossim/base/ossimConnectableObjectListener.cpp b/ossim/src/ossim/base/ossimConnectableObjectListener.cpp
deleted file mode 100644
index 78d17f5..0000000
--- a/ossim/src/ossim/base/ossimConnectableObjectListener.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimConnectableObjectListener.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimConnectableObjectListener.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimObjectEvents.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-RTTI_DEF1(ossimConnectableObjectListener,
-          "ossimConnectableObjectListener",
-          ossimListener);
-
-void ossimConnectableObjectListener::processEvent(ossimEvent& event)
-{
-   switch(event.getId())
-   {
-      case OSSIM_EVENT_OBJECT_DESTRUCTING_ID:
-      {
-         ossimObjectDestructingEvent* eventCast = dynamic_cast<ossimObjectDestructingEvent*>(&event);
-         if(eventCast) objectDestructingEvent(*eventCast);
-         
-         break;
-      }
-      case OSSIM_EVENT_CONNECTION_CONNECT_ID:
-      case OSSIM_EVENT_CONNECTION_DISCONNECT_ID:
-      {
-         ossimConnectionEvent* eventCast = dynamic_cast<ossimConnectionEvent*>(&event);
-         
-         if(eventCast)
-         {
-            connectionEvent(*eventCast);
-         
-            if(event.getId() == OSSIM_EVENT_CONNECTION_DISCONNECT_ID)
-            {
-               if(eventCast->isInputDirection())
-               {
-                  disconnectInputEvent(*eventCast);
-               }
-               else if(eventCast->isOutputDirection())
-               {
-                  disconnectOutputEvent(*eventCast);
-               }
-               else
-               {
-                  ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
-               }
-            }
-            else
-            {
-               if(eventCast->isInputDirection())
-               {
-                  connectInputEvent(*eventCast);
-               }
-               else if(eventCast->isOutputDirection())
-               {
-                  connectOutputEvent(*eventCast);
-               }
-               else
-               {
-                  ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
-               }
-            }
-         }
-         break;
-      }
-      case OSSIM_EVENT_PROPERTY_ID:
-      {
-         ossimPropertyEvent* eventCast = dynamic_cast<ossimPropertyEvent*>(&event);
-         if(eventCast) propertyEvent(*eventCast);
-         break;
-      }
-      case OSSIM_EVENT_ADD_OBJECT_ID:
-      {
-         ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
-         if(eventCast)
-         {
-            containerEvent(*eventCast);
-            addObjectEvent(*eventCast);
-         }
-         break;
-      }
-      case OSSIM_EVENT_REMOVE_OBJECT_ID:
-      {
-         ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
-         if(eventCast)
-         {
-            containerEvent(*eventCast);
-            removeObjectEvent(*eventCast);
-         }
-         break;
-      }
-      case OSSIM_EVENT_REFRESH_ID:
-      {
-         ossimRefreshEvent* eventCast = dynamic_cast<ossimRefreshEvent*>(&event);
-         if(eventCast) refreshEvent(*eventCast);
-         break;
-      }
-      default:
-      {
-         ossimListener::processEvent(event);
-         break;
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/base/ossimContainerEvent.cpp b/ossim/src/ossim/base/ossimContainerEvent.cpp
deleted file mode 100644
index a387622..0000000
--- a/ossim/src/ossim/base/ossimContainerEvent.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimContainerEvent.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimContainerEvent.h>
-
-RTTI_DEF1(ossimContainerEvent, "ossimContainerEvent", ossimEvent);
-
-ossimContainerEvent::ossimContainerEvent(ossimObject* obj,
-                                         long id)
-   :ossimEvent(obj, id)
-{
-}
-
-void ossimContainerEvent::setObjectList(ossimObject* obj)
-{
-   m_objectList.clear();
-   m_objectList.push_back(obj);
-}
-
-void ossimContainerEvent::setObjectList(ObjectList& objects)
-{
-   m_objectList = objects;
-}
-
diff --git a/ossim/src/ossim/base/ossimContainerProperty.cpp b/ossim/src/ossim/base/ossimContainerProperty.cpp
deleted file mode 100644
index 5b3b655..0000000
--- a/ossim/src/ossim/base/ossimContainerProperty.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimContainerProperty.cpp 19920 2011-08-09 12:04:27Z gpotts $
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimVisitor.h>
-
-RTTI_DEF1(ossimContainerProperty, "ossimContainerProperty", ossimProperty);
-
-ossimContainerProperty::ossimContainerProperty(const ossimString& name)
-   :ossimProperty(name)
-{
-}
-
-ossimContainerProperty::ossimContainerProperty(const ossimContainerProperty& rhs)
-   :ossimProperty(rhs)
-{
-   copyList(rhs);
-}
-
-ossimContainerProperty::~ossimContainerProperty()
-{
-   deleteChildren();
-}
-
-ossimObject* ossimContainerProperty::dup()const
-{
-   return new ossimContainerProperty(*this);
-}
-
-const ossimProperty& ossimContainerProperty::assign(const ossimProperty& rhs)
-{
-   ossimContainerProperty* rhsContainer = PTR_CAST(ossimContainerProperty,
-                                                   &rhs);
-   ossimProperty::assign(rhs);
-
-   if(rhsContainer)
-   {
-      copyList(*rhsContainer);
-   }
-
-   return *this;
-}
-
-void ossimContainerProperty::copyList(const ossimContainerProperty& rhs)
-{
-   deleteChildren();
-
-   for(ossim_uint32 idx = 0; idx < rhs.theChildPropertyList.size();++idx)
-   {
-      if(rhs.theChildPropertyList[idx].valid())
-      {
-         theChildPropertyList.push_back((ossimProperty*)(rhs.theChildPropertyList[idx]->dup()));
-      }
-      else
-      {
-         theChildPropertyList.push_back((ossimProperty*)0);
-      }
-   }
-}
-
-void ossimContainerProperty::addChildren(std::vector<ossimRefPtr<ossimProperty> >& propertyList)
-{
-   for(ossim_uint32 idx = 0; idx < propertyList.size(); ++idx)
-   {
-      if(propertyList[idx].valid())
-      {
-         theChildPropertyList.push_back(propertyList[idx]);
-      }
-   }
-}
-
-void ossimContainerProperty::addChild(ossimProperty* property)
-{
-   theChildPropertyList.push_back(property);
-}
-
-void ossimContainerProperty::addStringProperty(const ossimString& name,
-                                               const ossimString& value,
-                                               bool readOnlyFlag)
-{
-   ossimProperty* prop = new ossimStringProperty(name, value);
-   
-   prop->setReadOnlyFlag(readOnlyFlag);
-   addChild(prop);
-}
-
-const ossimContainerProperty* ossimContainerProperty::asContainer()const
-{
-   return this;
-}
-
-ossimContainerProperty* ossimContainerProperty::asContainer()
-{
-   return this;
-}
-
-ossimRefPtr<ossimProperty> ossimContainerProperty::getProperty(const ossimString& name,
-                                                               bool recurse)
-{
-   ossim_uint32 idx = 0;
-   std::vector<ossimRefPtr<ossimContainerProperty> > containers;
-   if(name == getName())
-   {
-      return this;
-   }
-   for(idx = 0; idx < theChildPropertyList.size(); ++idx)
-   {
-      if(theChildPropertyList[idx].valid())
-      {
-         if(theChildPropertyList[idx]->getName() == name)
-         {
-            return theChildPropertyList[idx];
-         }
-         if(PTR_CAST(ossimContainerProperty, theChildPropertyList[idx].get())&&recurse)
-         {
-            containers.push_back(PTR_CAST(ossimContainerProperty, theChildPropertyList[idx].get()));
-         }
-      }
-   }
-   
-   if(containers.size())
-   {
-      for(idx = 0; idx < containers.size();++idx)
-      {
-         ossimRefPtr<ossimProperty> prop = containers[idx]->getProperty(name, recurse);
-         if(prop.valid())
-         {
-            return prop;
-         }
-      }
-   }
-   
-   return (ossimProperty*)0;
-}
-
-void ossimContainerProperty::deleteChildren()
-{
-//    for(ossim_uint32 idx = 0; idx < theChildPropertyList.size(); ++idx)
-//    {
-//       if(theChildPropertyList[idx])
-//       {
-//          delete theChildPropertyList[idx];
-//          theChildPropertyList[idx] = (ossimProperty*)0;
-//       }
-//    }
-   theChildPropertyList.clear();
-}
-
-
-bool ossimContainerProperty::setValue(const ossimString& /* value */ )
-{
-   return false;
-}
-
-void ossimContainerProperty::valueToString(ossimString& /* valueResult */ )const
-{
-}
-
-ossim_uint32 ossimContainerProperty::getNumberOfProperties()const
-{
-   return (ossim_uint32)theChildPropertyList.size();
-}
-
-ossimRefPtr<ossimProperty> ossimContainerProperty::getProperty(ossim_uint32 idx)
-{
-   if(idx < theChildPropertyList.size())
-   {
-      return theChildPropertyList[idx];
-   }
-
-   return (ossimProperty*)0;
-}
-
-void ossimContainerProperty::getPropertyList(
-   std::vector<ossimRefPtr<ossimProperty> >& children) const
-{
-   children = theChildPropertyList;
-}
-
-ossimRefPtr<ossimXmlNode> ossimContainerProperty::toXml()const
-{
-   ossimXmlNode* result = new ossimXmlNode;
-
-   result->setTag(getName());
-   
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theChildPropertyList.size(); ++idx)
-   {
-      ossimRefPtr<ossimXmlNode> child = theChildPropertyList[idx]->toXml();
-
-      result->addChildNode(child.get());
-   }
-
-   return result;
-}
-
-void ossimContainerProperty::setReadOnlyFlag(bool flag)
-{
-   ossimProperty::setReadOnlyFlag(flag);
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theChildPropertyList.size(); ++idx)
-   {
-      theChildPropertyList[idx]->setReadOnlyFlag(flag);
-   }
-}
-
-void ossimContainerProperty::accept(ossimVisitor& visitor)
-{
-   ossim_uint32 idx = 0;
-   if(!visitor.hasVisited(this))
-   {
-      ossimProperty::accept(visitor);
-      if(visitor.getVisitorType()&ossimVisitor::VISIT_CHILDREN)
-      {
-         for(idx = 0; idx < theChildPropertyList.size(); ++idx)
-         {
-            theChildPropertyList[idx]->accept(visitor);
-         }
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/base/ossimDataObject.cpp b/ossim/src/ossim/base/ossimDataObject.cpp
deleted file mode 100644
index b20d928..0000000
--- a/ossim/src/ossim/base/ossimDataObject.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimDataObject.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/base/ossimDataObject.h>
-#include <ossim/base/ossimSource.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-
-RTTI_DEF1(ossimDataObject, "ossimDataObject", ossimObject)
-   
-ossimDataObject::ossimDataObject(ossimSource* source,
-                                 ossimDataObjectStatus status)
-   :
-      theOwner(source),
-      theDataObjectStatus(status)
-{
-}
-
-ossimDataObject::ossimDataObject(const ossimDataObject& rhs)
-   : ossimObject(),
-     theOwner(0),
-     theDataObjectStatus(rhs.theDataObjectStatus)
-{
-}
-
-ossimDataObject::~ossimDataObject()
-{
-}
-
-void ossimDataObject::setOwner(ossimSource* aSource)
-{
-   theOwner = aSource;
-}
-
-ossimSource* ossimDataObject::getOwner()
-{
-   return theOwner;
-}
-
-const ossimSource* ossimDataObject::getOwner() const
-{
-   return theOwner;
-}
-
-void ossimDataObject::setDataObjectStatus(ossimDataObjectStatus status) const
-{
-   theDataObjectStatus = status;
-}
-
-ossimDataObjectStatus ossimDataObject::getDataObjectStatus()const
-{
-   return theDataObjectStatus;
-}
-
-ossimString ossimDataObject::getDataObjectStatusString() const
-{
-   ossimString s;
-   
-   switch (theDataObjectStatus)
-   {
-      case OSSIM_NULL:
-         s = "OSSIM_NULL";
-         break;
-
-      case OSSIM_EMPTY:
-         s = "OSSIM_EMPTY";
-         break;
-
-      case OSSIM_PARTIAL:
-         s = "OSSIM_PARTIAL";
-         break;
-
-      case OSSIM_FULL:
-         s = "OSSIM_FULL";
-         break;
-         
-      case OSSIM_STATUS_UNKNOWN:
-      default:
-         s = "OSSIM_STATUS_UNKNOWN";
-         break;
-   }
-   
-   return s;
-}
-
-ossim_uint32 ossimDataObject::getObjectSizeInBytes()const
-{
-   return sizeof(theOwner);
-}
-
-bool ossimDataObject::isInitialize()const
-{
-   return (getDataObjectStatus()!=OSSIM_NULL);
-}
-
-bool ossimDataObject::operator!=(const ossimDataObject& rhs) const
-{
-   return ( theOwner               != rhs.theOwner ||
-            theDataObjectStatus    != rhs.theDataObjectStatus );
-}
-
-bool ossimDataObject::operator==(const ossimDataObject& rhs) const
-{
-   return (theOwner            == rhs.theOwner &&
-           theDataObjectStatus == rhs.theDataObjectStatus);
-}
-
-void ossimDataObject::assign(const ossimDataObject* rhs)
-{
-   if(rhs != this)
-   {
-      theOwner               = rhs->theOwner;
-      theDataObjectStatus     = rhs->theDataObjectStatus;
-   }
-}
-
-const ossimDataObject* ossimDataObject::operator=(const ossimDataObject* rhs)
-{
-   assign(rhs);
-   return this;
-}
-
-const ossimDataObject& ossimDataObject::operator=(const ossimDataObject& rhs)
-{
-   if (this != &rhs)
-   {
-      theOwner            = rhs.theOwner;
-      theDataObjectStatus = rhs.theDataObjectStatus; 
-   }
-   return *this;
-}
-
-std::ostream& ossimDataObject::print(ostream& out) const
-{
-   out << "ossimDataObject::print:";
-   
-   if (theOwner)
-   {
-      out << "\ntheOwner->getClassName():  "
-          << theOwner->getClassName()<<endl;
-   }
-   else
-   {
-      out << "\ntheOwner is null"
-          <<endl;
-   }
-   out << "theDataObjectStatus: " << getDataObjectStatusString()
-       << endl;
-
-   return out;
-}
-
-bool ossimDataObject::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   kwl.add(prefix, "data_object_status", getDataObjectStatusString(), true);
-   return ossimObject::saveState(kwl, prefix);
-}
-
-bool ossimDataObject::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   ossimString data_object_status = kwl.find(prefix, "data_object_status");
-   if(!data_object_status.empty())
-   {
-      data_object_status = data_object_status.upcase();
-      if(data_object_status == "OSSIM_FULL")
-      {
-         theDataObjectStatus = OSSIM_FULL;
-      }
-      else if(data_object_status == "OSSIM_PARTIAL")
-      {
-         theDataObjectStatus = OSSIM_PARTIAL;
-      }
-      else if(data_object_status == "OSSIM_EMPTY")
-      {
-         theDataObjectStatus = OSSIM_EMPTY;
-      }
-      else if(data_object_status == "OSSIM_STATUS_UNKNOWN")
-      {
-         theDataObjectStatus = OSSIM_STATUS_UNKNOWN;
-      }
-   }
-   
-   return ossimObject::loadState(kwl, prefix);
-}                     
-
diff --git a/ossim/src/ossim/base/ossimDate.cpp b/ossim/src/ossim/base/ossimDate.cpp
deleted file mode 100644
index 306a1c0..0000000
--- a/ossim/src/ossim/base/ossimDate.cpp
+++ /dev/null
@@ -1,1140 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimDate.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimDate.h>
-#include <cctype> /* for isdigit */
-#include <iomanip>
-#include <sstream>
-#include <iostream>
-OpenThreads::Mutex ossimLocalTm::m_mutex;
-
-std::ostream& operator<< (std::ostream& out, const ossimDate& src)
-{
-   return src.print(out);
-}
-
-std::ostream& operator<< (std::ostream & os, ossimLocalTm const & t)
-{
-   return t.print(os);
-}
-
-int operator== (ossimLocalTm const & t1, ossimLocalTm const & t2)
-{
-   return int(t1.compare(t2) == 0);
-}
-
-int operator!= (ossimLocalTm const & t1, ossimLocalTm const & t2)
-{
-   return int(t1.compare(t2) != 0);
-}
-
-int operator<  (ossimLocalTm const & t1, ossimLocalTm const & t2)
-{
-   return int(t1.compare(t2) < 0);
-}
-
-int operator<= (ossimLocalTm const & t1, ossimLocalTm const & t2)
-{
-   return int(t1.compare(t2) <= 0);
-}
-
-int operator>  (ossimLocalTm const & t1, ossimLocalTm const & t2)
-{
-   return int(t1.compare(t2) > 0);
-}
-
-int operator>=  (ossimLocalTm const & t1, ossimLocalTm const & t2)
-{
-   return int(t1.compare(t2) >= 0);
-}
-
-char ossimLocalTm::timech = ':';
-char ossimLocalTm::datech = '/';
-
-int ossimLocalTm::datefmt = ossimLocalTm::ossimLocalTmFormatFull;
-int ossimLocalTm::timefmt = ossimLocalTm::ossimTimeFormatInternational;
-
-
-ossimLocalTm::ossimLocalTm (time_t t)
-   :theFractionalSecond(0.0)
-{
-  if (t == 0)
-      t = time(0);
-  *(tm *)this = *localtime(&t);
-
-  setTimezoneOffsetFromGmt();
-
-}
-
-ossimLocalTm::ossimLocalTm (tm const & t)
-   :theFractionalSecond(0.0)
-{
-  *((tm *)this) = t;
-  setTimezoneOffsetFromGmt();
-}
-ossimLocalTm::ossimLocalTm (const ossimLocalTm& t)
-   :theFractionalSecond(t.theFractionalSecond)
-{
-  *((tm *)this) = t;
-  setTimezoneOffsetFromGmt();
-}
-
-ossimLocalTm& ossimLocalTm::operator= (tm const & t)
-{
-    *((tm *)this) = t;
-    return *this;
-}
-
-ossimLocalTm & ossimLocalTm::operator= (const ossimLocalTm & t)
-{
-    *((tm *)this) = t;
-    theFractionalSecond = t.theFractionalSecond;
-    return *this;
-}
-
-int ossimLocalTm::compare (ossimLocalTm const & t) const
-{
-    return compare ((time_t)t);
-}
-
-int ossimLocalTm::compare (time_t const tt) const
-{
-    time_t tx = (time_t)*this;
-    return (tx == tt) ? 0 : (tx > tt) ? 1 : -1;
-}
-
-ossimLocalTm::operator time_t (void) const
-{
-    return mktime ((tm *)this);
-}
-
-int ossimLocalTm::isValid (void) const
-{
-    static int maxd[] =
-    {
-        31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-    };
-
-    return ((tm_year > 0) &&
-            (tm_mon >= 0) && (tm_mon < 12) &&
-            (tm_mday > 0) && (tm_mday <= maxd[tm_mon]) &&
-            (tm_wday < 7) && (tm_yday < 367) &&
-            (tm_sec < 60) && (tm_min < 60) && (tm_hour < 24));
-}
-void ossimLocalTm::now()
-{
-   time_t t = time(0);
-   *this = *localtime(&t);
-}
-
-void ossimLocalTm::dSfx (std::ostream & os, int fmt) const
-{
-    if (fmt & ossimLocalTmFormatSepChar)
-        os << datech;
-    if (fmt & ossimLocalTmFormatSepSpace)
-        os << ' ';
-}
-
-void ossimLocalTm::pYear (std::ostream & os, int fmt) const
-{
-    if (fmt & ossimLocalTmFormatYear)
-    {
-        int year = tm_year;
-        int dig;
-        if (fmt & ossimLocalTmFormatYearShort)
-        {
-            dig = 2;
-            year %= 100;
-        }
-        else
-        {
-            dig = 4;
-            if (year < 200)
-                year += 1900;
-        }
-        os << std::setw((fmt & ossimLocalTmFormatPadYear) ? dig : 0);
-        os << std::setfill((fmt & ossimLocalTmFormatZeroYear) ? '0' : ' ');
-        os << year;
-        if ((fmt & ossimLocalTmFormatYearFirst))
-        {
-            fmt &= (ossimLocalTmFormatSepChar|ossimLocalTmFormatSepSpace);
-            dSfx (os, fmt);
-        }
-    }
-}
-
-void ossimLocalTm::pMonth (std::ostream & os, int fmt) const
-{
-
-    static const char * _months[] =
-    {
-        "January", "February", "March", "April",
-        "May", "June", "July", "August", "September",
-        "October", "November", "December"
-    };
-
-    if (fmt & ossimLocalTmFormatMonth)
-    {
-        int mon = (tm_mon % 12);
-        if (fmt & ossimLocalTmFormatMonText)
-        {
-            char const * tmon = _months[mon];
-            if (!(fmt & ossimLocalTmFormatPadMon))
-                os << tmon;
-            else
-                for (int x = 0; x < 3; ++x)
-                    os << tmon[x];
-        }
-        else
-        {
-            ++mon;
-            os << std::setw((fmt & ossimLocalTmFormatPadMon) ? 2 : 0);
-            os << std::setfill((fmt & ossimLocalTmFormatZeroMon) ? '0' : ' ');
-            os << mon;
-        }
-        if (((fmt & ossimLocalTmFormatYear) && !(fmt & ossimLocalTmFormatYearFirst)) ||
-            ((fmt & ossimLocalTmFormatDay) && (fmt & ossimLocalTmFormatMonFirst)))
-        {
-            fmt &= (ossimLocalTmFormatSepChar|ossimLocalTmFormatSepSpace);
-            dSfx (os, fmt);
-        }
-    }
-}
-
-
-void ossimLocalTm::pDate (std::ostream & os, int fmt) const
-{
-    if (fmt & ossimLocalTmFormatDay)
-    {
-        int day = tm_mday;
-        os << std::setw((fmt & ossimLocalTmFormatPadDay) ? 2 : 0);
-        os << std::setfill((fmt & ossimLocalTmFormatZeroDay) ? '0' : ' ');
-        os << day;
-        if (!(fmt & ossimLocalTmFormatYearFirst) || !(fmt & ossimLocalTmFormatMonFirst))
-        {
-            fmt &= (ossimLocalTmFormatSepChar|ossimLocalTmFormatSepSpace);
-            dSfx (os, fmt);
-        }
-    }
-}
-
-void ossimLocalTm::setTimezoneOffsetFromGmt()
-{
-   m_mutex.lock();
-   // struct tm gmt = *this;
-#if !defined(_MSC_VER) 
-   tzset();
-#else
-   _tzset();
-#endif
-   
-#if ( defined(__APPLE__) || defined(__FreeBSD__)  || defined(__OpenBSD__) )
-   //gmt.tm_sec -= tm_gmtoff; // Seconds east of UTC
-   m_timezoneOffset = tm_gmtoff;
-#else
-   m_timezoneOffset = timezone; // Seconds west of UTC
-   if ( tm_isdst )
-   {
-      m_timezoneOffset -= 3600; // Subtract an hour.
-   }
-   m_timezoneOffset = -m_timezoneOffset;
-#endif
-   m_mutex.unlock();
-   
-   m_timezoneOffset = m_timezoneOffset/3600;
-}
-
-std::ostream& ossimLocalTm::print(std::ostream & os,
-                                    int df,
-                                    int tf) const
-{
-    std::ostringstream pTmp;
-    printDate (pTmp, df);
-    pTmp << ' ';
-    printTime (pTmp, tf);
-
-    return os << pTmp.str();
-}
-
-
-
-std::ostream& ossimLocalTm::printDate (std::ostream & os, int fmt) const
-{
-    std::ostringstream pTmp;
-
-    static const char * _days[] =
-    {
-        "Sunday", "Monday", "Tuesday", "Wednesday",
-        "Thursday", "Friday", "Saturday"
-    };
-
-    if (fmt & ossimLocalTmFormatDayOfWeek)
-    {
-        int day = tm_wday % 7;
-        char const * p = _days[day];
-        if (fmt & ossimLocalTmFormatPadDay)
-            for (int x = 0; x < 3; ++x)
-                pTmp << p[x];
-        else
-        {
-            pTmp << p;
-            if (fmt & ossimLocalTmFormatDMY)
-                pTmp << ',';
-        }
-        if ((fmt & ossimLocalTmFormatDMY) && fmt & ossimLocalTmFormatSepSpace)
-            pTmp << ' ';
-    }
-    if (fmt & ossimLocalTmFormatYearFirst)
-        pYear (pTmp, fmt);
-    if (fmt & ossimLocalTmFormatMonFirst)
-        pMonth (pTmp, fmt);
-    pDate (pTmp, fmt);
-    if (!(fmt & ossimLocalTmFormatMonFirst))
-        pMonth (pTmp, fmt);
-    if (!(fmt & ossimLocalTmFormatYearFirst))
-        pYear (pTmp, fmt);
-
-    return os << pTmp.str();
-}
-
-std::ostream& ossimLocalTm::dump(std::ostream& os) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = os.flags();
-
-   os << setiosflags(ios::fixed) << setprecision(8) << setiosflags(ios::left);
-
-   os << "fr_sec:   " << setw(12) << theFractionalSecond
-      << "fractional second\n"
-      << "tm_sec:   " << setw(12) << tm_sec
-      << "seconds [0-60] (1 leap second)\n"
-      << "tm_min:   " << setw(12) << tm_min   << "minutes [0-59]\n"
-      << "tm_hour:  " << setw(12) << tm_hour  << "hours [0-23]\n"
-      << "tm_mday:  " << setw(12) << tm_mday  << "day [1-31]\n"
-      << "tm_mon:   " << setw(12) << tm_mon   << "month [0-11]\n"
-      << "tm_year:  " << setw(12) << tm_year  << "year - 1900\n"
-      << "tm_wday:  " << setw(12) << tm_wday  << "day of week [0-6]\n"
-      << "tm_yday:  " << setw(12) << tm_yday  << "days in year[0-365]\n"
-      << "tm_isdst: " << setw(12) << tm_isdst << "DST.[-1/0/1]\n"
-      << std::endl;
-
-   // Reset flags.
-   os.setf(f);
-   
-   return os;
-}
-
-void ossimLocalTm::tSfx (std::ostream & os, int fmt, char ch) const
-{
-    if (fmt & ossimTimeFormatSepAbbrev)
-        os << ch;
-    if (fmt & ossimTimeFormatSepChar)
-        os << timech;
-    if (fmt & ossimTimeFormatSepSpace)
-        os << ' ';
-}
-
-void ossimLocalTm::pHour (std::ostream & os, int fmt) const
-{
-    if (fmt & ossimTimeFormatHour)
-    {
-        int hour = tm_hour;
-        if (!(fmt & ossimTimeFormat24hour))
-        {
-            if (hour > 12)
-                hour -= 12;
-            else if (!hour && (fmt & ossimTimeFormatAmPm))
-                hour += 12;
-        }
-        os << std::setw((fmt & ossimTimeFormatPadHour) ? 2 : 0);
-        os << std::setfill((fmt & ossimTimeFormatZeroHour) ? '0' : ' ');
-        os << hour;
-        if (!(fmt & ossimTimeFormatMins))
-            fmt &= ossimTimeFormatSepAbbrev;
-        tSfx (os, fmt, 'h');
-    }
-}
-
-void ossimLocalTm::pMins (std::ostream & os, int fmt) const
-{
-    if (fmt & ossimTimeFormatMins)
-    {
-        int min = tm_min;
-        int dig = 2;
-        if (!(fmt & ossimTimeFormatHour))
-        {
-            min += (tm_hour * 60);
-            dig += 2;
-        }
-        os << std::setw((fmt & ossimTimeFormatPadMins) ? dig : 0);
-        os << std::setfill((fmt & ossimTimeFormatZeroMins) ? '0' : ' ');
-        os << min;
-        if (!(fmt & ossimTimeFormatSecs))
-            fmt &= ossimTimeFormatSepAbbrev;
-        tSfx (os, fmt, 'm');
-    }
-}
-
-void ossimLocalTm::pSecs (std::ostream & os, int fmt) const
-{
-    if (fmt & ossimTimeFormatSecs)
-    {
-        int sec = tm_sec;
-        int dig = 2;
-        if (!(fmt & (ossimTimeFormatHour|ossimTimeFormatMins)))
-        {
-            sec += ((tm_hour * 60) + tm_min) + 60;
-            dig += 3;
-        }
-        os << std::setw((fmt & ossimTimeFormatPadSecs) ? dig : 0);
-        os << std::setfill((fmt & ossimTimeFormatZeroSecs) ? '0' : ' ');
-        os << sec;
-        if (fmt & ossimTimeFormatAmPm)
-            fmt &= ~ossimTimeFormatSepChar;
-        else
-            fmt &= (ossimTimeFormatSepAbbrev|ossimTimeFormatSepSpace);
-        tSfx (os, fmt, 's');
-    }
-}
-
-std::ostream &ossimLocalTm::printTime (std::ostream & os, int fmt) const
-{
-    std::ostringstream pTmp;
-    pHour (pTmp, fmt);
-    pMins (pTmp, fmt);
-    pSecs (pTmp, fmt);
-    if (fmt & ossimTimeFormatAmPm)
-    {
-        pTmp << (tm_hour > 11 ? "pm" : "am");
-    }
-
-    return os << pTmp.str();
-}
-
-
-int ossimLocalTm::getYear()const
-{
-   int result = tm_year;
-//   if (result < 200)
-   {
-      result += 1900;
-   }
-   return result;
-}
-
-int ossimLocalTm::getShortYear()const
-{
-   return (getYear()%100);
-}
-
-int ossimLocalTm::getMonth()const
-{
-   return ((tm_mon % 12)+1); 
-}
-
-int ossimLocalTm::getDay()const
-{
-   return tm_mday;
-}
-
-double ossimLocalTm::getJulian()const
-{
-   int J = getMonth();
-   int K = getDay();
-   int I = getYear();
-
-   return (K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12)
-           /12-3*((I+4900+(J-14)/12)/100)/4+
-           (getHour()/24.0)+
-           (getMin()/1440.0)+
-           ((getSec()+theFractionalSecond)/86400.0));
-}
-
-double ossimLocalTm::getModifiedJulian()const
-{
-   return getJulian() - 2400000.5;
-}
-
-ossimLocalTm& ossimLocalTm::setDay(int day)
-{
-   tm_mday = day;
-   
-   return *this;
-}
-
-ossimLocalTm& ossimLocalTm::setMonth(int month)
-{
-   tm_mon = month - 1;
-
-   return *this;
-}
-
-ossimLocalTm& ossimLocalTm::setYear(int year)
-{
-   if(year < 2099)
-   {
-      tm_year = year - 1900;
-   }
-   else
-   {
-      tm_year = year;
-   }
-
-   return *this;
-}
-
-ossimLocalTm& ossimLocalTm::setDateFromJulian(double jd)
-{
-   double fractional = jd - (long)jd;
-   long l;
-   long n;
-   long i;
-   long j;
-   long k;
-
-
-   l= (long)(jd+68569);
-   n= 4*l/146097;
-   l= l-(146097*n+3)/4;
-   i= 4000*(l+1)/1461001;
-   l= l-1461*i/4+31l;
-   j= 80*l/2447;
-   k= l-2447*j/80;
-   l= j/11;
-   j= j+2-12*l;
-   i= 100*(n-49)+i+l;
-   setDay(k);
-   setMonth(j);
-   setYear(i);
-
-   setFractionalDay(fractional);
-   
-   return *this;
-}
-
-ossimLocalTm& ossimLocalTm::setDateFromModifiedJulian(double mjd)
-{
-   setDateFromJulian(mjd + 2400000.5);
-
-   return *this;
-}
-
-void ossimLocalTm::setFractionalDay(double fractionalDay)
-{
-   int h, m, s;
-   double fractionalSecond;
-   extractHmsFromFractionalDay(fractionalDay, h, m, s, fractionalSecond);
-
-   setHour(h);
-   setMin(m);
-   setSec(s);
-   setFractionalSecond(fractionalSecond);
-}
-
-void ossimLocalTm::extractHmsFromFractionalDay(double fractionalDay,
-                                               int &h,
-                                               int &m,
-                                               int &s,
-                                               double& fractionalSecond)
-{
-   fractionalDay *=24;
-   h = (int)fractionalDay;
-   fractionalDay = fractionalDay-h;
-   fractionalDay*=60;
-   m = (int)fractionalDay;
-   fractionalDay = fractionalDay-m;
-   fractionalDay*=60;
-   s = (int)fractionalDay;
-   fractionalDay = fractionalDay-s;
-   fractionalSecond = fractionalDay;
-}
-
-int ossimLocalTm::getHour()const
-{
-   return tm_hour;
-}
-
-int ossimLocalTm::getMin()const
-{
-   return tm_min;
-}
-
-int ossimLocalTm::getSec()const
-{
-   return tm_sec;
-}
-
-double ossimLocalTm::getFractionalSecond()const
-{
-   return theFractionalSecond;
-}
-
-ossimLocalTm& ossimLocalTm::setHour(int h)
-{
-   tm_hour = h;
-
-   return *this;
-}
-
-ossimLocalTm& ossimLocalTm::setMin(int m)
-{
-   tm_min = m;
-
-   return *this;
-}
-
-ossimLocalTm& ossimLocalTm::setSec(int s)
-{
-   tm_sec = s;
-
-   return *this;
-}
-
-ossimLocalTm& ossimLocalTm::setFloatSec(double s)
-{
-   tm_sec = (int)s;
-   return setFractionalSecond(s-tm_sec);
-}
-
-ossimLocalTm& ossimLocalTm::setFractionalSecond(double fractionalSecond)
-{
-   theFractionalSecond = fractionalSecond;
-
-   return *this;
-}
-
-time_t ossimLocalTm::getTicks()const
-{
-   return getEpoc();
-}
-
-time_t ossimLocalTm::getEpoc()const
-{
-   std::tm temp = *this;
-
-   return mktime(&temp);
-}
-
-void ossimLocalTm::addSeconds(ossim_float64 n)
-{
-   // use julian to help in this addition.  Julian is in days
-   setDateFromJulian(getJulian() + (n/86400.0));
-}
-
-void ossimLocalTm::addMinutes(ossim_float64 n)
-{
-   setDateFromJulian(getJulian() + (n/1440.0));
-}
-
-void ossimLocalTm::addHours(ossim_float64 n)
-{
-   setDateFromJulian(getJulian() + (n/24.0));
-}
-
-void ossimLocalTm::addDays(ossim_float64 n)
-{
-   setDateFromJulian(getJulian() + n);
-}
-
-ossim_float64 ossimLocalTm::deltaInSeconds(const ossimLocalTm& d)const
-{
-   return (getJulian()-d.getJulian())*86400.0;
-}
-
-ossim_float64 ossimLocalTm::deltaInMinutes(const ossimLocalTm& d)const
-{
-   return (getJulian()-d.getJulian())*1440.0;
-}
-
-ossim_float64 ossimLocalTm::delatInHours(const ossimLocalTm& d)const
-{
-   return (getJulian()-d.getJulian())*24;
-}
-
-ossim_float64 ossimLocalTm::deltaInDays(const ossimLocalTm& d)const
-{
-   return (getJulian()-d.getJulian());
-}
-
-ossimLocalTm ossimLocalTm::convertToGmt()const
-{
-  m_mutex.lock();
-   struct tm gmt = *this;
-#if !defined(_MSC_VER) 
-   tzset();
-#else
-   _tzset();
-#endif
-
-#if ( defined(__APPLE__) || defined(__FreeBSD__)  || defined(__OpenBSD__) )
-   gmt.tm_sec -= tm_gmtoff; // Seconds east of UTC
-#else
-   gmt.tm_sec += timezone; // Seconds west of UTC
-   if ( tm_isdst )
-   {
-      gmt.tm_sec -= 3600; // Subtract an hour.
-   }
-#endif
-   
-   time_t t = mktime(&gmt);
-   std::tm localTime = *localtime(&t);
-
-m_mutex.unlock();
-   ossimLocalTm result(localTime);
-   
-   return result;
-}
-
-void ossimLocalTm::setTimeNoAdjustmentGivenEpoc(time_t ticks)
-{
-  OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
-   *this = *gmtime(&ticks);
-}
-
-void ossimLocalTm::setTimeGivenEpoc(time_t ticks)
-{
-  OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
-  *this = *localtime(&ticks);
-}
-
-
-static bool readIntegerFromString(ossim_int32& result,
-                                 const std::string& input,
-                                 std::string::size_type& currentPos,
-                                 int digits)
-{
-   ossimString number;
-   while((digits>0)&&
-         (currentPos < input.size()))
-   {
-      if(isdigit(input[currentPos]))
-      {
-         number += input[currentPos];
-         ++currentPos;
-         --digits;
-      }
-      else
-      {
-         return false;
-      }
-   }
-   result = number.toInt32();
-   return (digits <= 0);
-}
-
-static bool readTimeZoneOffset(ossim_int32& result,
-                               const std::string& input,
-                               std::string::size_type& currentPos)
-{
-   bool returnValue = false;
-   result = 0;
-   if(input[currentPos] == '+'||
-      input[currentPos] == '-')
-   {
-      returnValue = true;
-      ossim_int32 signMult = ((input[0] == '+')?1:-1);
-      ossim_int32 zoneMin = 0;
-      ossim_int32 zoneHour = 0;
-      ++currentPos;
-      if(readIntegerFromString(zoneHour,
-                               input,
-                               currentPos,
-                               2))
-      {
-         if(!isdigit(input[currentPos]))
-         {
-            ++currentPos; // skip :
-         }
-         if(readIntegerFromString(zoneMin,
-                                  input,
-                                  currentPos,
-                                  2))
-         {
-            result = signMult*(zoneMin*60 + zoneHour*3600);
-         }
-      }
-   }
-   
-   return returnValue;
-}
-
-bool ossimLocalTm::setIso8601(const std::string& timeString, bool shiftToGmtOffsetZero)
-{
-   ossimDate now;
-   std::string::size_type pos = 0;
-   ossim_int32 year  = 0;
-   ossim_int32 month = 0;
-   ossim_int32 day   = 0;
-   ossim_int32 timeZoneOffset = 0;
-   
-   if(timeString[0] != 'T') // make sure it's not time only
-   {
-      // look for year
-      //
-      if(readIntegerFromString(year,
-                               timeString,
-                               pos,
-                               4))
-      {
-         // retrieved the year portion
-         // now check for separator not digit
-         //
-         
-         // we at least have a year
-         // now check for others
-         setYear(year);
-         if(!isdigit(timeString[pos]))
-         {
-            // skip separator
-            ++pos;
-         }
-         if(readIntegerFromString(month,
-                                  timeString,
-                                  pos,
-                                  2))
-         
-         {
-            setMonth(month);
-            if(!isdigit(timeString[pos]))
-            {
-               // skip separator
-               ++pos;
-            }
-            if(readIntegerFromString(day,
-                                     timeString,
-                                     pos,
-                                     2))
-            {
-               setDay(day);
-            }
-         }
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else // set year month day to current
-   {
-      setYear(now.getYear());
-      setMonth(now.getMonth());
-      setDay(now.getDay());
-   }
-   // check to see if we need to read time portion
-   if(timeString[pos] == 'T')
-   {
-      ++pos; // skip T character
-      ossim_int32 hours=0, minutes=0;
-      
-      if(readIntegerFromString(hours,
-                               timeString,
-                               pos,
-                               2))
-      {
-         setHour(hours);
-         
-         // now check for separator
-         if(!std::isdigit(timeString[pos]))
-         {
-            ++pos; // skip separator if present
-         }
-         if(readIntegerFromString(minutes,
-                                  timeString,
-                                  pos,
-                                  2))
-         {
-            setMin(minutes);
-            // now check for time zone if only a hour minute time
-            //
-            if(timeString[pos] == 'Z')
-            {
-              std::time_t t = mktime(this);
-              t += m_timezoneOffset*3600;
-              setTimeGivenEpoc(t);
-            }
-            else if(!readTimeZoneOffset(timeZoneOffset,
-                                       timeString,
-                                       pos))
-            {
-               double fractionalSeconds = 0.0;
-               if(!std::isdigit(timeString[pos]))
-               {
-                  ++pos;
-               }
-               std::string::size_type endPos = timeString.find_first_not_of("0123456789.", pos);
-               if(endPos == std::string::npos)
-               {
-                  fractionalSeconds = ossimString(timeString.begin()+pos,
-                                                  timeString.end()).toDouble();
-               }
-               else
-               {
-                  fractionalSeconds = ossimString(timeString.begin()+pos,
-                                                  timeString.begin()+endPos).toDouble();
-               }
-               setFloatSec(fractionalSeconds);
-               pos = endPos;
-               if(pos == std::string::npos)
-               {
-                  // we will not be too strict so if at the end then just return we got enough
-                  return true;
-               }
-               if(timeString[pos] == 'Z')
-               {
-                  std::time_t t = mktime(this);
-                  t += m_timezoneOffset*3600;
-                  setTimeGivenEpoc(t);
-                //std::cout << "OFFSET == " << m_timezoneOffset << std::endl;
-               }
-               else
-               {
-                  readTimeZoneOffset(timeZoneOffset,
-                                     timeString,
-                                     pos);
-               }
-            }
-         }
-      }
-      else
-      {
-         // need at least hours 
-         return false;
-      }
-   }
-   else if(std::isdigit(timeString[pos]))
-   {
-      ossim_int32 hours=0, minutes=0;
-      
-      if(readIntegerFromString(hours,
-                               timeString,
-                               pos,
-                               2))
-      {
-         setHour(hours);
-         
-         // now check for separator
-         if(!std::isdigit(timeString[pos]))
-         {
-            ++pos; // skip separator if present
-         }
-         if(readIntegerFromString(minutes,
-                                  timeString,
-                                  pos,
-                                  2))
-         {
-            setMin(minutes);
-            
-            if(!readTimeZoneOffset(timeZoneOffset,
-                                  timeString,
-                                  pos))
-            {
-               double fractionalSeconds = 0.0;
-               if(!std::isdigit(timeString[pos]))
-               {
-                  ++pos;
-               }
-               std::string::size_type endPos = timeString.find_first_not_of("0123456789.", pos);
-               if(endPos == std::string::npos)
-               {
-                  fractionalSeconds = ossimString(timeString.begin()+pos,
-                                                  timeString.end()).toDouble();
-               }
-               else
-               {
-                  fractionalSeconds = ossimString(timeString.begin()+pos,
-                                                  timeString.begin()+endPos).toDouble();
-               }
-               setFloatSec(fractionalSeconds);
-               pos = endPos;
-               if(pos == std::string::npos)
-               {
-                  // we will not be too strict so if at the end then just return we got enough
-                  return true;
-               }
-               if(timeString[pos] == 'Z')
-               {
-                  // For proper readouts we need to shift
-                  // to current time zone of the system
-                  //
-                //std::cout << "OFFSET == " << m_timezoneOffset << std::endl;
-               
-                  std::time_t t = mktime(this);
-                  t += m_timezoneOffset*3600;
-                  setTimeGivenEpoc(t);
-               }
-               else
-               {
-                  readTimeZoneOffset(timeZoneOffset,
-                                     timeString,
-                                     pos);
-               }
-            }
-         }
-      }  
-   }
-   else
-   {
-      // need at least hours 
-      return false;
-   }
-   
-   if(shiftToGmtOffsetZero && (timeZoneOffset!=0))
-   {
-      addSeconds(-timeZoneOffset);
-   }
-   return true;
-}
-
-ossimRefPtr<ossimXmlNode> ossimLocalTm::saveXml()const
-{
-   ossimRefPtr<ossimXmlNode> result = new ossimXmlNode;
-
-   result->setTag("ossimDate");
-   result->addAttribute("version", "1");
-   result->addChildNode("month", ossimString::toString(getMonth()));
-   result->addChildNode("day", ossimString::toString(getDay()));
-   result->addChildNode("year", ossimString::toString(getYear()));
-   result->addChildNode("hour", ossimString::toString(getHour()));
-   result->addChildNode("minutes", ossimString::toString(getMin()));
-   result->addChildNode("seconds", ossimString::toString(getSec()));
-   result->addChildNode("fractionalSecond", ossimString::toString(getFractionalSecond()));
-   
-   return result.get();
-}
-
-bool ossimLocalTm::loadXml(ossimRefPtr<ossimXmlNode> dateNode)
-{
-   bool result = true;
-   ossimRefPtr<ossimXmlNode> month = dateNode->findFirstNode("month");
-   ossimRefPtr<ossimXmlNode> day = dateNode->findFirstNode("day");
-   ossimRefPtr<ossimXmlNode> year = dateNode->findFirstNode("year");
-   ossimRefPtr<ossimXmlNode> hour = dateNode->findFirstNode("hour");
-   ossimRefPtr<ossimXmlNode> minutes = dateNode->findFirstNode("minutes");
-   ossimRefPtr<ossimXmlNode> seconds = dateNode->findFirstNode("seconds");
-   ossimRefPtr<ossimXmlNode> fractionalSecond = dateNode->findFirstNode("fractionalSecond");
-   ossimRefPtr<ossimXmlNode> julian = dateNode->findFirstNode("julian");
-   ossimRefPtr<ossimXmlNode> modifiedJulian = dateNode->findFirstNode("modifiedJulian");
-
-   if(month.valid()&&
-      day.valid()&&
-      year.valid()&&
-      hour.valid()&&
-      minutes.valid()&&
-      seconds.valid())
-   {
-      setMonth(month->getText().toInt32());
-      setDay(day->getText().toInt32());
-      setYear(year->getText().toInt32());
-      setHour(hour->getText().toInt32());
-      setMin(minutes->getText().toInt32());
-      setSec(seconds->getText().toInt32());
-      if(fractionalSecond.valid())
-      {
-         setFractionalSecond(fractionalSecond->getText().toDouble());
-      }
-      else
-      {
-         setFractionalSecond(0.0);
-      }
-   }
-   else if(modifiedJulian.valid())
-   {
-      setDateFromModifiedJulian(modifiedJulian->getText().toDouble());
-   }
-   else if(julian.valid())
-   {
-      setDateFromJulian(julian->getText().toDouble());
-   }
-   else
-   {
-      result = false;
-   }
-
-   return result;
-}
-
-ossimDate::ossimDate(int datefmt)
-   :ossimLocalTm(0), _fmt(datefmt)
-{}
-
-ossimDate::ossimDate (ossimLocalTm const & t,
-                      int dtfmt)
-   : ossimLocalTm (t), _fmt(dtfmt)
-{}
-
-ossimDate::ossimDate (time_t t, int dtfmt)
-   : ossimLocalTm (t), _fmt(dtfmt)
-{}
-
-ossimDate::ossimDate(int month,
-                     int day,
-                     int year,
-                     int dtfmt)
-   :ossimLocalTm (0), _fmt(dtfmt)
-{
-   setMonth(month);
-   setDay(day);
-   setYear(year);
-   setHour(0);
-   setMin(0);
-   setSec(0);
-   setFractionalSecond(0.0);
-}
-
-int ossimDate::fmt(int f)
-{
-   return _fmt = f;
-}
-
-int ossimDate::fmt(void) const
-{
-   return _fmt;
-}
-
-std::ostream& ossimDate::print (std::ostream & os) const
-{
-   return printDate (os, _fmt);
-}
-
-std::ostream& operator <<(std::ostream& out, const ossimTime& src)
-{
-   return src.print(out);
-}
-ossimTime::ossimTime(int tmfmt)
-      : ossimLocalTm(0), _fmt(tmfmt)
-{
-}
-ossimTime::ossimTime(ossimTime const & t,
-                      int tmfmt)
-      : ossimLocalTm (t), _fmt(tmfmt)
-{
-}
-
-ossimTime::ossimTime(time_t t, int tmfmt)
-      : ossimLocalTm (t), _fmt(tmfmt)
-{
-}
-      
-int ossimTime::fmt(int f)
-{
-   return _fmt = f;
-}
-
-int ossimTime::fmt(void) const
-{
-   return _fmt;
-}
-
-std::ostream& ossimTime::print (std::ostream & os) const
-{
-   return printTime(os, _fmt);
-}
-
diff --git a/ossim/src/ossim/base/ossimDateProperty.cpp b/ossim/src/ossim/base/ossimDateProperty.cpp
deleted file mode 100644
index 68e6c8c..0000000
--- a/ossim/src/ossim/base/ossimDateProperty.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// LICENSE: MIT see top level license.txt
-//
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-//*************************************************************************
-// $Id: ossimDateProperty.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-//
-
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <ossim/base/ossimDateProperty.h>
-
-
-RTTI_DEF1(ossimDateProperty, "ossimDateProperty", ossimProperty);
-
-ossimDateProperty::ossimDateProperty()
-      :ossimProperty("")
-{
-   setDate(ossimDate());
-}
-
-ossimDateProperty::ossimDateProperty(const ossimString& name,
-                                     const ossimString& value)
-      :ossimProperty(name)
-{
-   setValue(value);
-}
-
-ossimDateProperty::ossimDateProperty(const ossimString& name,
-                                     const ossimLocalTm& value)
-      :ossimProperty(name),
-       theValue(value)
-{
-}
-
-ossimDateProperty::ossimDateProperty(const ossimDateProperty& src)
-   :ossimProperty(src),
-    theValue(src.theValue)
-{
-}
-
-ossimObject* ossimDateProperty::dup()const
-{
-   return new ossimDateProperty(*this);
-}
-
-void ossimDateProperty::setDate(const ossimLocalTm& localTm)
-{
-   theValue = localTm;
-}
-
-const ossimLocalTm& ossimDateProperty::getDate()const
-{
-   return theValue;
-}
-
-bool ossimDateProperty::setValue(const ossimString& value)
-{
-   if(value.trim() == "")
-   {
-      theValue = ossimDate();
-      return true;
-   }
-   bool result = value.size() == 14;
-   
-   ossimString year;
-   ossimString month;
-   ossimString day;
-   ossimString hour;
-   ossimString min;
-   ossimString sec;
-
-   if(value.size() == 14)
-   {
-      year = ossimString(value.begin(),
-                         value.begin()+4);
-      month = ossimString(value.begin()+4,
-                          value.begin()+6);
-      day = ossimString(value.begin()+6,
-                        value.begin()+8);
-      hour = ossimString(value.begin()+8,
-                        value.begin()+10);
-      min = ossimString(value.begin()+10,
-                        value.begin()+12);
-      sec = ossimString(value.begin()+12,
-                        value.begin()+14);
-
-      theValue.setYear(year.toUInt32());
-      theValue.setMonth(month.toUInt32());
-      theValue.setDay(day.toUInt32());
-      theValue.setHour(hour.toUInt32());
-      theValue.setMin(min.toUInt32());
-      theValue.setSec(sec.toUInt32());
-   }
-
-   return result;
-}
-
-void ossimDateProperty::valueToString(ossimString& valueResult)const
-{
-    std::ostringstream out;
-
-   out << std::setw(4)
-       << std::setfill('0')
-       << theValue.getYear()
-       << std::setw(2)
-       << std::setfill('0')
-       << theValue.getMonth()
-       << std::setw(2)
-       << std::setfill('0')
-       << theValue.getDay()
-       << std::setw(2)
-       << std::setfill('0')
-       << theValue.getHour()
-       << std::setw(2)
-       << std::setfill('0')
-       << theValue.getMin()
-       << std::setw(2)
-       << std::setfill('0')
-       << theValue.getSec();
-   
-   valueResult =  out.str();
-  
-}
-
-const ossimProperty& ossimDateProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-
-   ossimDateProperty* rhsPtr = PTR_CAST(ossimDateProperty, &rhs);
-
-   if(rhsPtr)
-   {
-      theValue = rhsPtr->theValue;
-   }
-   else
-   {
-      setValue(rhs.valueToString());
-   }
-
-   return *this;
-}
diff --git a/ossim/src/ossim/base/ossimDatumFactory.inc b/ossim/src/ossim/base/ossimDatumFactory.inc
deleted file mode 100644
index 65926de..0000000
--- a/ossim/src/ossim/base/ossimDatumFactory.inc
+++ /dev/null
@@ -1,287 +0,0 @@
-//*************************************************************************
-// MIT
-// 
-// Author:  Garrett Potts
-//
-//**************************************************************************
-// $Id: ossimDatumFactory.inc 23668 2015-12-14 20:11:00Z rashadkm $
-
-struct ossimSevenParamDatumType
-{
-   const char* theCode;
-   const char* theName;
-   const char* theEllipsoidCode;
-   ossim_float64 theSigmaX;
-   ossim_float64 theSigmaY;
-   ossim_float64 theSigmaZ;
-   ossim_float64 theWestLongitude;
-   ossim_float64 theEastLongitude;
-   ossim_float64 theSouthLatitude;
-   ossim_float64 theNorthLatitude;
-   ossim_float64 theParam1;
-   ossim_float64 theParam2;
-   ossim_float64 theParam3;
-   ossim_float64 theParam4;
-   ossim_float64 theParam5;
-   ossim_float64 theParam6;
-   ossim_float64 theParam7;
-};
-
-struct ossimThreeParamDatumType
-{
-public:
-   const char* theCode;
-   const char* theName;
-   const char* theEllipsoidCode;
-   ossim_float64 theSigmaX;
-   ossim_float64 theSigmaY;
-   ossim_float64 theSigmaZ;
-   ossim_float64 theWestLongitude;
-   ossim_float64 theEastLongitude;
-   ossim_float64 theSouthLatitude;
-   ossim_float64 theNorthLatitude;
-   ossim_float64 theParam1;
-   ossim_float64 theParam2;
-   ossim_float64 theParam3;
-};
-
-#define NUMBER_OF_SEVEN_PARAM_DATUMS 2
-#define NUMBER_OF_THREE_PARAM_DATUMS 226
-
-static ossimThreeParamDatumType threeParamDatum[] = {
-{"ADI-A", "ADINDAN, Ethiopia", "CD", 3, 3, 3, 26, 50, -3, 25, -165, -11, 206},
-{"ADI-B", "ADINDAN, Sudan", "CD", 3, 5, 3, 15, 45, -3, 31, -161, -14, 205},
-{"ADI-C", "ADINDAN, Mali", "CD", 25, 25, 25, -20, 11, 3, 31, -123, -20, 220},
-{"ADI-D", "ADINDAN, Senegal", "CD", 25, 25, 25, -24, -5, 5, 23, -128, -18, 224},
-{"ADI-E", "ADINDAN, Burkina Faso", "CD", 25, 25, 25, -5, 8, 4, 22, -118, -14, 218},
-{"ADI-F", "ADINDAN, Cameroon", "CD", 25, 25, 25, 3, 23, -4, 19, -134, -2, 210},
-{"ADI-M", "ADINDAN, Mean", "CD", 5, 5, 3, 15, 55, -5, 31, -166, -15, 204},
-{"AFG", "AFGOOYE, Somalia", "KA", 25, 25, 25, 35, 60, -8, 19, -43, -163, 45},
-{"AIA", "ANTIGUA ISLAND ASTRO 1943", "CD", 25, 25, 25, -65, -61, 16, 20, -270, 13, 62},
-{"AIN-A", "AIN EL ABD 1970, Bahrain", "IN", 25, 25, 25, 49, 53, 24, 28, -150, -250, -1},
-{"AIN-B", "AIN EL ABD 1970, Saudi Arabia", "IN", 10, 10, 10, 28, 62, 8, 38, -143, -236, 7},
-{"AMA", "AMERICAN SAMOA 1962", "CC", 25, 25, 25, -174, -165, -19, -9, -115, 118, 426},
-{"ANO", "ANNA 1 ASTRO 1965, Cocos Is.", "AN", 25, 25, 25, 94, 99, -14, -10, -491, -22, 435},
-{"ARF-A", "ARC 1950, Botswana", "CD", 3, 5, 3, 13, 36, -33, -13, -138, -105, -289},
-{"ARF-B", "ARC 1950, Lesotho", "CD", 3, 3, 8, 21, 35, -36, -23, -125, -108, -295},
-{"ARF-C", "ARC 1950, Malawi", "CD", 9, 24, 8, 26, 42, -21, -3, -161, -73, -317},
-{"ARF-D", "ARC 1950, Swaziland", "CD", 15, 15, 15, 25, 40, -33, -20, -134, -105, -295},
-{"ARF-E", "ARC 1950, Zaire", "CD", 25, 25, 25, 4, 38, -21, 10, -169, -19, -278},
-{"ARF-F", "ARC 1950, Zambia", "CD", 21, 21, 27, 15, 40, -24, -1, -147, -74, -283},
-{"ARF-G", "ARC 1950, Zimbabwe", "CD", 5, 8, 11, 19, 39, -29, -9, -142, -96, -293},
-{"ARF-H", "ARC 1950, Burundi", "CD", 20, 20, 20, 21, 37, -11, 4, -153, -5, -292},
-{"ARF-M", "ARC 1950, Mean", "CD", 20, 33, 20, 4, 42, -36, 10, -143, -90, -294},
-{"ARS-A", "ARC 1960, Kenya", "CD", 4, 3, 3, 28, 47, -11, 8, -157, -2, -299},
-{"ARS-B", "ARC 1960, Tanzania", "CD", 6, 9, 10, 23, 47, -18, 5, -175, -23, -303},
-{"ARS-M", "ARC 1960, Kenya & Tanzania", "CD", 20, 20, 20, 23, 47, -18, 8, -160, -6, -302},
-{"ASC", "ASCENSION ISLAND 1958", "IN", 25, 25, 25, -16, -13, -9, -6, -205, 107, 53},
-{"ASM", "MONTSERRAT ISLAND ASTRO 1958", "CD", 25, 25, 25, -64, -61, 15, 18, 174, 359, 365},
-{"ASQ", "ASTRO STATION 1952, Marcus Is.", "IN", 25, 25, 25, 152, 156, 22, 26, 124, -234, -25},
-{"ATF", "ASTRO BEACON E 1845, Iwo Jima", "IN", 25, 25, 25, 140, 144, 22, 26, 145, 75, -272},
-{"AUA", "AUSTRALIAN GEODETIC 1966", "AN", 3, 3, 3, 109, 161, -46, -4, -133, -48, 148},
-{"AUG", "AUSTRALIAN GEODETIC 1984", "AN", 2, 2, 2, 109, 161, -46, -4, -134, -48, 149},
-{"BAT", "DJAKARTA, INDONESIA", "BR", 3, 3, 3, 89, 146, -16, 11, -377, 681, -50},
-{"BER", "BERMUDA 1957, Bermuda Islands", "CC", 20, 20, 20, -66, -63, 31, 34, -73, 213, 296},
-{"BID", "BISSAU, Guinea-Bissau", "IN", 25, 25, 25, -23, -7, 5, 19, -173, 253, 27},
-{"BOO", "BOGOTA OBSERVATORY, Columbia", "IN", 6, 5, 6, -85, -61, -10, 16, 307, 304, -318},
-{"BUR", "BUKIT RIMPAH, Banka & Belitung", "BR", -1, -1, -1, 103, 110, -6, 0, -384, 664, -48},
-{"CAC", "CAPE CANAVERAL, Fla & Bahamas", "CC", 3, 3, 3, -94, -12, 15, 38, -2, 151, 181},
-{"CAI", "CAMPO INCHAUSPE 1969, Arg.", "IN", 5, 5, 5, -72, -51, -58, -27, -148, 136, 90},
-{"CAO", "CANTON ASTRO 1966, Phoenix Is.", "IN", 15, 15, 15, -180, -165, -13, 3, 298, -304, -375},
-{"CAP", "CAPE, South Africa", "CD", 3, 6, 6, 10, 40, -43, -15, -136, -108, -292},
-{"CAZ", "CAMP AREA ASTRO, Camp McMurdo", "IN", -1, -1, -1, 135, 180, -85, -70, -104, -129, 239},
-{"CCD", "S-JTSK, Czech Republic", "BR", 4, 2, 3, 6, 28, 43, 56, 589, 76, 480},
-{"CGE", "CARTHAGE, Tunisia", "CD", 6, 9, 8, 2, 18, 24, 43, -263, 6, 431},
-{"CHI", "CHATHAM ISLAND ASTRO 1971, NZ", "IN", 15, 15, 15, -180, -174, -46, -42, 175, -38, 113},
-{"CHU", "CHUA ASTRO, Paraguay", "IN", 6, 9, 5, -69, -49, -33, -14, -134, 229, -29},
-{"COA", "CORREGO ALEGRE, Brazil", "IN", 5, 3, 5, -80, -29, -39, -2, -206, 172, -6},
-{"DAL", "DABOLA, Guinea", "CD", 15, 15, 15, 12, 11, 1, 19, -83, 37, 124},
-{"DID", "DECEPTION ISLAND", "CD", 20, 20, 20, 58, 62, -65, -62, 260, 12, -147},
-{"DOB", "GUX 1 ASTRO, Guadalcanal Is.", "IN", 25, 25, 25, 158, 163, -12, -8, 252, -209, -751},
-{"EAS", "EASTER ISLAND 1967", "IN", 25, 25, 25, -111, -108, -29, -26, 211, 147, 111},
-{"ENW", "WAKE-ENIWETOK 1960", "HO", 3, 3, 3, 159, 175, 1, 16, 102, 52, -38},
-{"EST", "ESTONIA, 1937", "BR", 2, 3, 3, 16, 34, 52, 65, 374, 150, 588},
-{"EUR-A", "EUROPEAN 1950, Western Europe", "IN", 3, 3, 3, -15, 25, 30, 78, -87, -96, -120},
-{"EUR-B", "EUROPEAN 1950, Greece", "IN", 25, 25, 25, 14, 34, 30, 48, -84, -95, -130},
-{"EUR-C", "EUROPEAN 1950, Norway & Finland", "IN", 3, 5, 3, -2, 38, 52, 80, -87, -95, -120},
-{"EUR-D", "EUROPEAN 1950, Portugal & Spain", "IN", 5, 6, 3, -15, 10, 30, 49, -84, -107, -120},
-{"EUR-E", "EUROPEAN 1950, Cyprus", "IN", 15, 15, 15, 31, 36, 33, 37, -104, -101, -140},
-{"EUR-F", "EUROPEAN 1950, Egypt", "IN", 6, 8, 8, 19, 42, 16, 38, -130, -117, -151},
-{"EUR-G", "EUROPEAN 1950, England, Channel", "IN", 3, 3, 3, -10, 3, 48, 62, -86, -96, -120},
-{"EUR-H", "EUROPEAN 1950, Iran", "IN", 9, 12, 11, 37, 69, 19, 47, -117, -132, -164},
-{"EUR-I", "EUROPEAN 1950, Sardinia(Italy)", "IN", 25, 25, 25, 6, 12, 37, 43, -97, -103, -120},
-{"EUR-J", "EUROPEAN 1950, Sicily(Italy)", "IN", 20, 20, 20, 10, 17, 35, 40, -97, -88, -135},
-{"EUR-K", "EUROPEAN 1950, England, Ireland", "IN", 3, 3, 3, -12, 3, 48, 62, -86, -96, -120},
-{"EUR-L", "EUROPEAN 1950, Malta", "IN", 25, 25, 25, 12, 16, 34, 38, -107, -88, -149},
-{"EUR-M", "EUROPEAN 1950, Mean (3 Param)", "IN", 3, 8, 5, 5, 33, 30, 80, -87, -98, -121},
-{"EUR-S", "EUROPEAN 1950, Iraq, Israel", "IN", -1, -1, -1, 36, 57, -38, -4, -103, -106, -141},
-{"EUR-T", "EUROPEAN 1950, Tunisia", "IN", 25, 25, 25, 2, 18, 24, 43, -112, -77, -145},
-{"EUS", "EUROPEAN 1979", "IN", 3, 3, 3, -15, 24, 30, 80, -86, -98, -119},
-{"FAH", "OMAN", "CD", 3, 3, 9, 46, 65, 10, 32, -346, -1, 224},
-{"FLO", "OBSERVATORIO MET. 1939, Flores", "IN", 20, 20, 20, -33, -30, 38, 41, -425, -169, 81},
-{"FOT", "FORT THOMAS 1955, Leeward Is.", "CD", 25, 25, 25, -64, -61, 16, 19, -7, 215, 225},
-{"GAA", "GAN 1970, Rep. of Maldives", "IN", 25, 25, 25, 71, 75, -2, 9, -133, -321, 50},
-{"GEO", "GEODETIC DATUM 1949, NZ", "IN", 5, 3, 5, 165, 180, -48, -33, 84, -22, 209},
-{"GIZ", "DOS 1968, Gizo Island", "IN", 25, 25, 25, 155, 158, -10, -7, 230, -199, -752},
-{"GRA", "GRACIOSA BASE SW 1948, Azores", "IN", 3, 3, 3, -30, -26, 37, 41, -104, 167, -38},
-{"GSE", "GUNUNG SEGARA, Indonesia", "BR", -1, -1, -1, 106, 121, -6, 9, -403, 684, 41},
-{"GUA", "GUAM 1963", "CC", 3, 3, 3, 143, 146, 12, 15, -100, -248, 259},
-{"HEN", "HERAT NORTH, Afghanistan", "IN", -1, -1, -1, 55, 81, 23, 44, -333, -222, 114},
-{"HER", "HERMANNSKOGEL, old Yugoslavia", "BR", -1, -1, -1, 7, 29, 35, 52, 682, -203, 480},
-{"HIT", "PROVISIONAL SOUTH CHILEAN 1963", "IN", 25, 25, 25, -83, -60, -64, -25, 16, 196, 93},
-{"HJO", "HJORSEY 1955, Iceland", "IN", 3, 3, 6, -24, -11, 61, 69, -73, 46, -86},
-{"HKD", "HONG KONG 1963", "IN", 25, 25, 25, 112, 116, 21, 24, -156, -271, -189},
-{"HTN", "HU-TZU-SHAN, Taiwan", "IN", 15, 15, 15, 117, 124, 20, 28, -637, -549, -203},
-{"IBE", "BELLEVUE (IGN), Efate Is.", "IN", 20, 20, 20, 167, 171, -20, -16, -127, -769, 472},
-{"IDN", "INDONESIAN 1974", "ID", 25, 25, 25, 89, 146, -16, 11, -24, -15, 5},
-{"IND-B", "INDIAN, Bangladesh", "EA", 10, 8, 12, 80, 100, 15, 33, 282, 726, 254},
-{"IND-I", "INDIAN, India & Nepal", "EC", 12, 10, 15, 62, 105, 2, 44, 295, 736, 257},
-{"IND-P", "INDIAN, Pakistan", "EA", -1, -1, -1, 55, 81, 17, 44, 283, 682, 231},
-{"INF-A", "INDIAN 1954, Thailand", "EA", 15, 6, 12, 91, 111, 0, 27, 217, 823, 299},
-{"ING-A", "INDIAN 1960, Vietnam 16N", "EA", 25, 25, 25, 101, 115, 11, 23, 198, 881, 317},
-{"ING-B", "INDIAN 1960, Con Son Island", "EA", 25, 25, 25, 104, 109, 6, 11, 182, 915, 344},
-{"INH-A", "INDIAN 1975, Thailand", "EA", 12, 10, 12, 91, 111, 0, 27, 209, 818, 290},
-{"INH-A1", "INDIAN 1975, Thailand", "EA", 3, 2, 3, 91, 111, 0, 27, 210, 814, 289},
-{"IRL", "IRELAND 1965", "AM", 3, 3, 3, -12, -4, 50, 57, 506, -122, 611},
-{"ISG", "ISTS 061 ASTRO 1968, S Georgia", "IN", 25, 25, 25, -38, -34, -56, -52, -794, 119, -298},
-{"IST", "ISTS 073 ASTRO 1969, Diego Garc", "IN", 25, 25, 25, 69, 75, -10, -4, 208, -435, -229},
-{"JOH", "JOHNSTON ISLAND 1961", "IN", 25, 25, 25, -76, -73, -46, -43, 189, -79, -202},
-{"KAN", "KANDAWALA, Sri Lanka", "EA", 20, 20, 20, 77, 85, 4, 12, -97, 787, 86},
-{"KEA", "KERTAU 1948, W Malaysia & Sing.", "EE", 10, 8, 6, 94, 112, -5, 12, -11, 851, 5},
-{"KEG", "KERGUELEN ISLAND 1949", "IN", 25, 25, 25, 139, 180, -81, -74, 145, -187, 103},
-{"KUS", "KUSAIE ASTRO 1951, Caroline Is.", "IN", 25, 25, 25, 134, 167, -1, 12, 647, 1777, -1124},
-{"LCF", "L.C. 5 ASTRO 1961, Cayman Brac", "CC", 25, 25, 25, -81, -78, 18, 21, 42, 124, 147},
-{"LEH", "LEIGON, Ghana", "CD", 2, 3, 2, -9, 7, -1, 17, -130, 29, 364},
-{"LIB", "LIBERIA 1964", "CD", 15, 15, 15, -17, -1, -1, 14, -90, 40, 88},
-{"LUZ-A", "LUZON, Phillipines", "CC", 8, 11, 9, 115, 128, 3, 23, -133, -77, -51},
-{"LUZ-B", "LUZON, Mindanao Island", "CC", 25, 25, 25, 120, 128, 4, 12, -133, -79, -72},
-{"MAS", "MASSAWA, Ethiopia", "BR", 25, 25, 25, 37, 53, 7, 25, 639, 405, 60},
-{"MER", "MERCHICH, Morocco", "CD", 5, 3, 3, -19, 5, 22, 42, 31, 146, 47},
-{"MID", "MIDWAY ASTRO 1961, Midway Is.", "IN", 25, 25, 25, -180, -169, 25, 30, 912, -58, 1227},
-{"MIK", "MAHE 1971, Mahe Is.", "CD", 25, 25, 25, 54, 57, -6, -3, 41, -220, -134},
-{"MIN-A", "MINNA, Cameroon", "CD", 25, 25, 25, 3, 23, -4, 19, -81, -84, 115},
-{"MIN-B", "MINNA, Nigeria", "CD", 3, 6, 5, -4, 20, -1, 21, -92, -93, 122},
-{"MOD", "ROME 1940, Sardinia", "IN", 25, 25, 25, 6, 12, 37, 43, -225, -65, 9},
-{"MPO", "M'PORALOKO, Gabon", "CD", 25, 25, 25, 3, 20, -10, 8, -74, -130, 42},
-{"MVS", "VITI LEVU 1916, Viti Levu Is.", "CD", 25, 25, 25, 176, 180, -20, -16, 51, 391, -36},
-{"NAH-A", "NAHRWAN, Masirah Island (Oman)", "CD", 25, 25, 25, 57, 60, 19, 22, -247, -148, 369},
-{"NAH-B", "NAHRWAN, United Arab Emirates", "CD", 25, 25, 25, 45, 62, 17, 32, -249, -156, 381},
-{"NAH-C", "NAHRWAN, Saudi Arabia", "CD", 25, 25, 20, 28, 62, 8, 38, -243, -192, 477},
-{"NAP", "NAPARIMA, Trinidad & Tobago", "IN", 15, 15, 15, -64, -59, 8, 13, -10, 375, 165},
-{"NAR-A", "NORTH AMERICAN 1983, Alaska", "RF", 2, 2, 2, -175, -135, 48, 78, 0, 0, 0},
-{"NAR-B", "NORTH AMERICAN 1983, Canada", "RF", 2, 2, 2, -150, -50, 36, 90, 0, 0, 0},
-{"NAR-C", "NORTH AMERICAN 1983, CONUS", "RF", 2, 2, 2, -135, -60, 15, 60, 0, 0, 0},
-{"NAR-D", "NORTH AMERICAN 1983, Mexico", "RF", 2, 2, 2, -122, -72, 11, 35, 0, 0, 0},
-{"NAR-E", "NORTH AMERICAN 1983, Aleutian", "RF", 5, 2, 5, -180, 180, 51, 74, -2, 0, 4},
-{"NAR-H", "NORTH AMERICAN 1983, Hawai'i", "RF", 2, 2, 2, -164, -153, 17, 24, 1, 1, -1},
-{"NAS-A", "NORTH AMERICAN 1927, Eastern US", "CC", 5, 5, 8, -102, -60, 18, 55, -9, 161, 179},
-{"NAS-B", "NORTH AMERICAN 1927, Western US", "CC", 5, 3, 3, -132, -87, 19, 55, -8, 159, 175},
-{"NAS-C", "NORTH AMERICAN 1927, CONUS", "CC", 5, 5, 6, -135, -60, 15, 60, -8, 160, 176},
-{"NAS-D", "NORTH AMERICAN 1927, Alaska", "CC", 5, 9, 5, -175, -130, 47, 78, -5, 135, 172},
-{"NAS-E", "NORTH AMERICAN 1927, Canada", "CC", 15, 11, 6, -150, -50, 36, 90, -10, 158, 187},
-{"NAS-F", "NORTH AMERICAN 1927, Alberta/BC", "CC", 8, 8, 6, -145, -105, 43, 65, -7, 162, 188},
-{"NAS-G", "NORTH AMERICAN 1927, E. Canada", "CC", 6, 6, 3, -85, -45, 38, 68, -22, 160, 190},
-{"NAS-H", "NORTH AMERICAN 1927, Man/Ont", "CC", 9, 5, 5, -108, -69, 36, 63, -9, 157, 184},
-{"NAS-I", "NORTH AMERICAN 1927, NW Terr.", "CC", 5, 5, 3, -144, -55, 43, 90, 4, 159, 188},
-{"NAS-J", "NORTH AMERICAN 1927, Yukon", "CC", 5, 8, 3, -147, -117, 53, 75, -7, 139, 181},
-{"NAS-L", "NORTH AMERICAN 1927, Mexico", "CC", 8, 6, 6, -122, -80, 10, 38, -12, 130, 190},
-{"NAS-N", "NORTH AMERICAN 1927, C. America", "CC", 8, 3, 5, -98, -77, 3, 25, 0, 125, 194},
-{"NAS-O", "NORTH AMERICAN 1927, Canal Zone", "CC", 20, 20, 20, -86, -74, 3, 15, 0, 125, 201},
-{"NAS-P", "NORTH AMERICAN 1927, Caribbean", "CC", 3, 9, 12, -87, -58, 8, 29, -3, 142, 183},
-{"NAS-Q", "NORTH AMERICAN 1927, Bahamas", "CC", 5, 3, 5, -83, -71, 19, 29, -4, 154, 178},
-{"NAS-R", "NORTH AMERICAN 1927, San Salv.", "CC", 25, 25, 25, -75, -74, 23, 26, 1, 140, 165},
-{"NAS-T", "NORTH AMERICAN 1927, Cuba", "CC", 25, 25, 25, -87, -72, 18, 25, -9, 152, 178},
-{"NAS-U", "NORTH AMERICAN 1927, Greenland", "CC", 25, 25, 25, 74, 56, 74, 81, 11, 114, 195},
-{"NAS-V", "NORTH AMERICAN 1927, Aleutian E", "CC", 6, 8, 10, -180, -161, 50, 58, -2, 152, 149},
-{"NAS-W", "NORTH AMERICAN 1927, Aleutian W", "CC", 10, 10, 10, 169, 180, 50, 58, 2, 204, 105},
-{"NSD", "NORTH SAHARA 1959, Algeria", "CD", 25, 25, 25, -15, 11, 13, 43, -186, -93, 310},
-{"NTF", "NOUVELLE TRIANGULATION DE LA FRANCE, FRANCE", "CE", 0, 0, 0, -6, 12, 41, 51, -168, -60, 320},
-{"OEG", "OLD EGYPTIAN 1907", "HE", 3, 6, 8, 19, 42, 16, 38, -130, 110, -13},
-{"OGB-A", "ORDNANCE GB 1936, England", "AA", 5, 5, 6, -12, 7, 44, 61, 371, -112, 434},
-{"OGB-B", "ORDNANCE GB 1936, Eng., Wales", "AA", 10, 10, 15, -12, 7, 44, 61, 371, -111, 434},
-{"OGB-C", "ORDNANCE GB 1936, Scotland", "AA", 10, 10, 10, -14, 4, 49, 66, 384, -111, 425},
-{"OGB-D", "ORDNANCE GB 1936, Wales", "AA", 20, 20, 20, -11, 3, 46, 59, 370, -108, 434},
-{"OGB-M", "ORDNANCE GB 1936, Mean (3 Para)", "AA", 10, 10, 15, -14, 7, 44, 66, 375, -111, 431},
-{"OHA-A", "OLD HAWAI'IAN (CC), Hawai'i", "CC", 25, 25, 25, -158, -153, 17, 22, 89, -279, -183},
-{"OHA-B", "OLD HAWAI'IAN (CC), Kauai", "CC", 20, 20, 20, -161, -158, 20, 24, 45, -290, -172},
-{"OHA-C", "OLD HAWAI'IAN (CC), Maui", "CC", 25, 25, 25, -158, -154, 19, 23, 65, -290, -190},
-{"OHA-D", "OLD HAWAI'IAN (CC), Oahu", "CC", 10, 6, 6, -160, -156, 20, 23, 58, -283, -182},
-{"OHA-M", "OLD HAWAI'IAN (CC), Mean", "CC", 25, 20, 20, -164, -153, 17, 24, 61, -285, -181},
-{"OHI-A", "OLD HAWAI'IAN (IN), Hawai'i", "IN", 25, 25, 25, -158, -153, 17, 22, 229, -222, -348},
-{"OHI-B", "OLD HAWAI'IAN (IN), Kauai", "IN", 20, 20, 20, -161, -158, 20, 24, 185, -233, -337},
-{"OHI-C", "OLD HAWAI'IAN (IN), Maui", "IN", 25, 25, 25, -158, -154, 19, 23, 205, -233, -355},
-{"OHI-D", "OLD HAWAI'IAN (IN), Oahu", "IN", 10, 6, 6, -160, -156, 20, 23, 198, -226, -347},
-{"OHI-M", "OLD HAWAI'IAN (IN), Mean", "IN", 25, 20, 20, -164, -153, 17, 24, 201, -228, -346},
-{"PHA", "AYABELLA LIGHTHOUSE, Bjibouti", "CD", 25, 25, 25, 36, 49, 5, 20, -79, -129, 145},
-{"PIT", "PITCAIRN ASTRO 1967", "IN", 25, 25, 25, -134, -119, -27, -21, 185, 165, 42},
-{"PLN", "PICO DE LAS NIEVES, Canary Is.", "IN", 25, 25, 25, -20, -12, 26, 31, -307, -92, 127},
-{"POS", "PORTO SANTO 1936, Madeira Is.", "IN", 25, 25, 25, -18, -15, 31, 35, -499, -249, 314},
-{"PRP-A", "PROV. S AMERICAN 1956, Bolivia", "IN", 5, 11, 14, -75, -51, -28, -4, -270, 188, -388},
-{"PRP-B", "PROV. S AMERICAN 1956, N Chile", "IN", 25, 25, 25, -83, -60, -45, -12, -270, 183, -390},
-{"PRP-C", "PROV. S AMERICAN 1956, S Chile", "IN", 20, 20, 20, -83, -60, -64, -20, -305, 243, -442},
-{"PRP-D", "PROV. S AMERICAN 1956, Colombia", "IN", 15, 15, 15, -85, -61, -10, 16, -282, 169, -371},
-{"PRP-E", "PROV. S AMERICAN 1956, Ecuador", "IN", 3, 5, 3, -85, -70, -11, 7, -278, 171, -367},
-{"PRP-F", "PROV. S AMERICAN 1956, Guyana", "IN", 6, 14, 5, -67, -51, -4, 14, -298, 159, -369},
-{"PRP-G", "PROV. S AMERICAN 1956, Peru", "IN", 6, 8, 12, -87, -63, -24, 5, -279, 175, -379},
-{"PRP-H", "PROV. S AMERICAN 1956, Venez", "IN", 9, 14, 15, -79, -54, -5, 18, -295, 173, -371},
-{"PRP-M", "PROV. S AMERICAN 1956, Mean", "IN", 17, 27, 27, -87, -51, -64, 18, -288, 175, -376},
-{"PTB", "POINT 58, Burkina Faso & Niger", "CD", 25, 25, 25, -15, 25, 0, 10, -106, -129, 165},
-{"PTN", "POINT NOIRE 1948", "CD", 25, 25, 25, 5, 25, -11, 10, -148, 51, -291},
-{"PUK", "PULKOVO 1942, Russia", "KA", -1, -1, -1, -180, 180, 36, 89, 28, -130, -95},
-{"PUR", "PUERTO RICO & Virgin Is.", "CC", 3, 3, 3, -69, -63, 16, 20, 11, 72, -101},
-{"QAT", "QATAR NATIONAL", "IN", 20, 20, 20, 45, 57, 19, 32, -128, -283, 22},
-{"QUO", "QORNOQ, South Greenland", "IN", 25, 25, 32, -77, -7, 57, 85, 164, 138, -189},
-{"REU", "REUNION, Mascarene Is.", "IN", 25, 25, 25, 47, 65, -27, -12, 94, -948, -1262},
-{"SAE", "SANTO (DOS) 1965", "IN", 22, 25, 25, 160, 169, -17, -13, 170, 42, 84},
-{"SAN-A", "SOUTH AMERICAN 1969, Argentina", "SA", 5, 5, 5, -76, -47, -62, -23, -62, -1, -37},
-{"SAN-B", "SOUTH AMERICAN 1969, Bolivia", "SA", 15, 15, 15, -75, -51, -28, -4, -61, 2, -48},
-{"SAN-C", "SOUTH AMERICAN 1969, Brazil", "SA", 3, 5, 5, -80, -29, -39, -2, -60, -2, -41},
-{"SAN-D", "SOUTH AMERICAN 1969, Chile", "SA", 15, 8, 11, -83, -60, -64, -12, -75, -1, -44},
-{"SAN-E", "SOUTH AMERICAN 1969, Colombia", "SA", 6, 6, 5, -85, -61, -10, 16, -44, 6, -36},
-{"SAN-F", "SOUTH AMERICAN 1969, Ecuador", "SA", 3, 3, 3, -85, -70, -11, 7, -48, 3, -44},
-{"SAN-G", "SOUTH AMERICAN 1969, Guyana", "SA", 9, 5, 5, -67, -51, -4, 14, -53, 3, -47},
-{"SAN-H", "SOUTH AMERICAN 1969, Paraguay", "SA", 15, 15, 15, -69, -49, -33, -14, -61, 2, -33},
-{"SAN-I", "SOUTH AMERICAN 1969, Peru", "SA", 5, 5, 5, -87, -63, -24, 5, -58, 0, -44},
-{"SAN-J", "SOUTH AMERICAN 1969, Baltra", "SA", 25, 25, 25, -92, -89, -2, 1, -47, 26, -42},
-{"SAN-K", "SOUTH AMERICAN 1969, Trinidad", "SA", 25, 25, 25, -68, -55, 4, 17, -45, 12, -33},
-{"SAN-L", "SOUTH AMERICAN 1969, Venezuela", "SA", 3, 6, 3, -79, -54, -5, 18, -45, 8, -33},
-{"SAN-M", "SOUTH AMERICAN 1969, Mean", "SA", 15, 6, 9, -90, -25, -65, -50, -57, 1, -41},
-{"SAO", "SAO BRAZ, Santa Maria Is.", "IN", 25, 25, 25, -27, -23, 35, 39, -203, 141, 53},
-{"SAP", "SAPPER HILL 1943, E Falkland Is", "IN", 1, 1, 1, -61, -56, -54, -50, -355, 21, 72},
-{"SCK", "SCHWARZECK, Namibia", "BN", 20, 20, 20, 5, 31, -35, -11, 616, 97, -251},
-{"SGM", "SELVAGEM GRADE 1938, Salvage Is", "IN", 25, 25, 25, -18, -14, 28, 32, -289, -124, 60},
-{"SHB", "ASTRO DOS 71/4, St. Helena Is.", "IN", 25, 25, 25, -7, -4, -18, -14, -320, 550, -494},
-{"SOA", "SOUTH ASIA, Singapore", "FA", 25, 25, 25, 102, 106, 0, 3, 7, -10, -26},
-{"SPK-A", "S-42 (PULKOVO 1942), Hungary", "KA", 2, 2, 2, 11, 29, 40, 54, 28, -121, -77},
-{"SPK-B", "S-42 (PULKOVO 1942), Poland", "KA", 4, 2, 4, 8, 30, 43, 60, 23, -124, -82},
-{"SPK-C", "S-42 (PK42) Former Czechoslov.", "KA", 3, 3, 2, 6, 28, 42, 57, 26, -121, -78},
-{"SPK-D", "S-42 (PULKOVO 1942), Latvia", "KA", 2, 2, 2, 15, 34, 50, 64, 24, -124, -82},
-{"SPK-E", "S-42 (PK 1942), Kazakhstan", "KA", 25, 25, 25, 41, 93, 35, 62, 15, -130, -84},
-{"SPK-F", "S-42 (PULKOVO 1942), Albania", "KA", 3, 3, 3, 14, 26, 34, 48, 24, -130, -92},
-{"SPK-G", "S-42 (PULKOVO 1942), Romania", "KA", 3, 5, 3, 15, 35, 38, 54, 28, -121, -77},
-{"SRL", "SIERRA LEONE 1960", "CD", 15, 15, 15, -19, -4, 1, 16, -88, 4, 101},
-{"TAN", "TANANARIVE OBSERVATORY 1925", "IN", -1, -1, -1, 40, 53, -34, -8, -189, -242, -91},
-{"TDC", "TRISTAN ASTRO 1968", "IN", 25, 25, 25, -14, -11, -39, -36, -632, 438, -609},
-{"TIL", "TIMBALAI 1948, Brunei & E Malay", "EA", 10, 10, 12, 101, 125, -5, 15, -679, 669, -48},
-{"TOY-A", "TOKYO, Japan", "BR", 8, 5, 8, 119, 156, 19, 51, -148, 507, 685},
-{"TOY-B", "TOKYO, South Korea", "BR", 8, 5, 8, 120, 139, 27, 45, -146, 507, 687},
-{"TOY-B1", "TOKYO, South Korea", "BR", 2, 2, 2, 120, 139, 27, 45, -147, 506, 687},
-{"TOY-C", "TOKYO, Okinawa", "BR", 20, 5, 20, 119, 134, 19, 31, -158, 507, 676},
-{"TOY-M", "TOKYO, Mean", "BR", 20, 5, 20, 120, 155, 23, 53, -148, 507, 685},
-{"TRN", "ASTRO TERN ISLAND (FRIG) 1961", "IN", 25, 25, 25, -166, -166, 22, 26, 114, -116, -333},
-{"VOI", "VOIROL 1874, Algeria", "CD", -1, -1, -1, -15, 11, 13, 43, -73, -247, 227},
-{"VOR", "VOIROL 1960, Algeria", "CD", 25, 25, 25, -15, 11, 13, 43, -123, -206, 219},
-{"WAK", "WAKE ISLAND ASTRO 1952", "IN", 25, 25, 25, -176, -171, 17, 21, 276, -57, 149},
-{"WGD", "World Geodetic System 1972", "WD", 0, 0, 0, -180.0, 180.0, -90, 90, 0, 0, 0},
-{"WGE", "World Geodetic System 1984", "WE", 0, 0, 0, -180.0, 180.0, -90, 90, 0, 0, 0},
-{"YAC", "YACARE, Uruguay", "IN", -1, -1, -1, -65, -47, -40, -25, -155, 171, 37},
-{"ZAN", "ZANDERIJ, Suriname", "IN", 5, 5, 8, -76, -47, -10, 20, -265, 120, -358},
-{"6055", "Popular Visualisation", "7059", 0, 0, 0, -180.0, 180.0, -85, 85, 0, 0, 0},
-{"", "", "", 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0}
-};
-
-static ossimSevenParamDatumType sevenParamDatum[] = {
-{"EUR-7", "EUROPEAN 1950, Mean (7 Param)", "IN", 0, 0, 0, -180, 180, -90, 90, -102, -102, -129, 2.00228e-06, -8.92057e-07, 1.86653e-06, 2.4664e-06},
-{"OGB-7", "ORDNANCE GB 1936, Mean (7 Para)", "AA", 0, 0, 0, -180, 180, -90, 90, 446, -99, 544, -4.58149e-06, -1.26536e-06, -2.10894e-06, -2.08927e-05},
-{"", "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
-};
diff --git a/ossim/src/ossim/base/ossimDblGrid.cpp b/ossim/src/ossim/base/ossimDblGrid.cpp
deleted file mode 100644
index 2d973b1..0000000
--- a/ossim/src/ossim/base/ossimDblGrid.cpp
+++ /dev/null
@@ -1,1225 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// AUTHOR:  Oscar Kramer (okramer at imagelinks.com)
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimDblGrid. This class maintains
-//   a regular grid of floating point (double) values. Access methods to the
-//   grid include interpolation between grid nodes. Capability is included
-//   to address the grid in an arbitrary, floating-point x, y coordinate
-//   system. 
-//
-//*****************************************************************************
-//  $Id: ossimDblGrid.cpp 23329 2015-05-27 14:24:19Z dburken $
-
-#include <ossim/base/ossimDblGrid.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-
-#include <climits>
-#include <cstring>
-#include <iostream>
-#include <vector>
-using namespace std;
-
-//***
-// Define Trace flags for use within this file:
-//***
-static ossimTrace traceExec  ("ossimDblGrid:exec");
-static ossimTrace traceDebug ("ossimDblGrid:debug");
-
-static const ossimString MAGIC_NUMBER ("OSSIM_DBL_GRID");
-static const int   MAX_LENGTH_DESCR = 80;
-
-/*!****************************************************************************
-*  DEFAULT CONSTRUCTOR: ossimDblGrid
-*  
-*****************************************************************************/
-ossimDblGrid::ossimDblGrid()
-:
-theGridData       (0),
-theSize           (0, 0),
-theOrigin         (0.0, 0.0),
-theSpacing        (0.0, 0.0),
-theMinValue       (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
-theMaxValue       (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
-theNullValue      (OSSIM_DEFAULT_NULL_PIX_DOUBLE),
-theMeanIsComputed (false),
-theExtrapIsEnabled (true),
-theDomainType     (CONTINUOUS)
-{ }
-
-
-/*!****************************************************************************
-*  COPY CONSTRUCTOR: ossimDblGrid
-*  
-*****************************************************************************/
-ossimDblGrid::ossimDblGrid(const ossimDblGrid&  source)
-:
-theGridData   (0),
-theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
-theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
-theExtrapIsEnabled (true),
-theDomainType (CONTINUOUS)
-{
-   static const char MODULE[] = "ossimDblGrid Constructor";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   *this = source;
-   /*!
-   * Allocate mem for the grid, and initialize:
-   */
-   //    int buflen = theSize.x * theSize.y;
-   //    theGridData = new double [buflen];
-
-   //    for (int i=0; i<buflen; i++)
-   //       theGridData[i] = source.theGridData[i];
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-}
-
-/*!****************************************************************************
-*  CONSTRUCTOR: ossimDblGrid
-*  
-*****************************************************************************/
-ossimDblGrid::ossimDblGrid(const ossimIpt&  size, 
-                           const ossimDpt&  origin,
-                           const ossimDpt&  spacing,
-                           double           null_value)
-                           :
-theGridData   (0),
-theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
-theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
-theExtrapIsEnabled (true),
-theDomainType (CONTINUOUS)
-{
-   static const char MODULE[] = "ossimDblGrid Constructor";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   initialize(size, origin, spacing, null_value);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-}
-
-/*!****************************************************************************
-*  CONSTRUCTOR: ossimDblGrid
-*  
-*****************************************************************************/
-ossimDblGrid::ossimDblGrid(const ossimDrect&  rect, 
-                           const ossimDpt&    spacing,
-                           double             null_value)
-                           :
-theGridData   (0),
-theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
-theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
-theExtrapIsEnabled (true),
-theDomainType (CONTINUOUS)
-{
-   static const char MODULE[] = "ossimDblGrid Constructor";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   ossimIpt size ((int) (rect.width()/spacing.x)  + 1,
-      (int) (rect.height()/spacing.y) + 1);
-
-   initialize(size, rect.ul(), spacing, null_value);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " returning...\n";
-}
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimDblGrid()
-//  
-//*****************************************************************************
-ossimDblGrid::~ossimDblGrid()
-{
-   if(theGridData)
-   {
-      delete [] theGridData;
-      theGridData = NULL;
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimDblGrid::initialize()
-//  
-//  Permits initialization after construction
-//  
-//*****************************************************************************
-void ossimDblGrid::initialize(const ossimIpt&  size, 
-                              const ossimDpt&  origin,
-                              const ossimDpt&  spacing,
-                              double           null_value)
-{
-   static const char MODULE[] = "ossimDblGrid::initialize()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " entering...\n";
-
-   //***
-   // Delete any existing grid:
-   //***
-   if (theGridData)
-   {
-      delete [] theGridData;
-      theGridData = 0;
-   }
-
-   //***
-   // Initialize data members:
-   //***
-   theSize           = size;
-   theOrigin         = origin;
-   theSpacing        = spacing;
-   theNullValue      = null_value;
-   theMinValue       = OSSIM_DEFAULT_MIN_PIX_DOUBLE;
-   theMaxValue       = OSSIM_DEFAULT_MAX_PIX_DOUBLE;
-   theMeanIsComputed = false;
-
-   /*!
-   * Allocate mem for the grid, and initialize:
-   */
-   ossim_uint32 buflen = theSize.x * theSize.y;
-   if(buflen > 0)
-   {
-      theGridData = new double [buflen];
-
-      for (ossim_uint32 i=0; i<buflen; i++)
-         theGridData[i] = theNullValue;
-   }   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " returning...\n";
-
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimDblGrid::initialize()
-//  
-//  Permits initialization after construction
-//  
-//*****************************************************************************
-void ossimDblGrid::initialize(const ossimDrect&  uv_rect, 
-                              const ossimDpt&    spacing,
-                              double null_value)
-{
-   static const char MODULE[] = "ossimDblGrid::initialize()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   ossimIpt size ((int) (uv_rect.width()/spacing.x)  + 1,
-      (int) (uv_rect.height()/spacing.y) + 1);
-
-   initialize(size, uv_rect.ul(), spacing, null_value);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-   return;
-}
-
-//**************************************************************************************************
-void ossimDblGrid::deallocate()
-{
-   if(theGridData)
-   {
-      delete [] theGridData;
-      theGridData = 0;
-   }
-   theSize = ossimIpt(0,0); 
-}
-
-/*!****************************************************************************
-* METHOD: ossimDblGrid::setNode(x, y) NON-CONST
-*
-*  This method is used to assign the grid data values.
-*  
-*****************************************************************************/
-void ossimDblGrid::setNode (int x, int y, const double& input) 
-{
-   if(!theGridData) return;
-
-   // Insure the value passed in is allowed:
-   double value = input;
-   constrain(value);
-
-   if ((x>=0)&&(x<theSize.x)&&(y>=0)&&(y<theSize.y))
-   {
-      theGridData[index(x, y)] = value;
-
-      if (value != theNullValue)
-      {
-         if (value < theMinValue)
-            theMinValue = value;
-         if (value > theMaxValue)
-            theMaxValue = value;
-      }
-
-      theMeanIsComputed = false;
-   }
-
-   return;
-}
-
-/*!****************************************************************************
-* METHOD: ossimDblGrid::setNearestNode(uv)
-*
-* Sets the node nearest the U,V point specified to the value given. This is
-* different from setNode() in that the UV coordinate system is used to
-* address a node instead of an XY grid point.
-*  
-*****************************************************************************/
-void ossimDblGrid::setNearestNode (const ossimDpt& uv_point,
-                                   const double&   input) 
-{
-   if(!theGridData) return;
-   
-   // Insure the value passed in is allowed:
-   double value = input;
-   constrain(value);
-
-   //***
-   // Establish the grid indexes:
-   //***
-   int xi = ossim::round<int>((uv_point.u - theOrigin.u)/theSpacing.x);
-   int yi = ossim::round<int>((uv_point.v - theOrigin.v)/theSpacing.y);
-
-   if (xi < 0)
-      xi = 0;
-   if (xi >= theSize.x)
-      xi = theSize.x - 1;
-   if (yi < 0)
-      yi = 0;
-   if (yi >= theSize.y)
-      yi = theSize.y - 1;
-
-   setNode (xi, yi, value);
-
-   return;
-}
-
-/*!****************************************************************************
-* METHOD: ossimDblGrid::getNode(x, y) CONST
-*
-*  This method is used to return the grid data values.
-*  
-*****************************************************************************/
-double ossimDblGrid::getNode (int x, int y) const
-{
-   if(!theGridData) return theNullValue;
-   if ((x>=0)&&(x<theSize.x)&&(y>=0)&&(y<theSize.y))
-   {
-      ossim_uint32 i = index(x, y);
-      double val = theGridData[i];
-      return val;
-   }
-   return theNullValue;
-}
-
-/*!****************************************************************************
-* METHOD: ossimDblGrid::operator(double, double)
-*
-*  This method interpolates between grid points given a fractional location
-*  in UV (external) world space.
-*  
-*****************************************************************************/
-double ossimDblGrid::operator() (const double& u, const double& v) const
-{
-   if(!theGridData) return theNullValue;
-
-   double xi = (u - theOrigin.u)/theSpacing.x;
-   double yi = (v - theOrigin.v)/theSpacing.y;
-
-   if ((xi >= 0.0) && (xi <= (double)theSize.x-1) && (yi >= 0.0) && (yi <= (double)theSize.y-1))
-      return interpolate(xi, yi);
-
-   else if (theExtrapIsEnabled)
-      return extrapolate(xi, yi);
-
-   return theNullValue;
-}
-
-//*************************************************************************************************
-//! Interpolates given non-integral point x, y
-//*************************************************************************************************
-double ossimDblGrid::interpolate(double xi, double yi) const
-{
-   if(!theGridData) 
-      return theNullValue;
-
-   // Establish the grid cell origin indices:
-   int x0 = (int) xi;
-   int y0 = (int) yi;
-
-   // Compute bilinear interpolation weights:
-   double wx1 = xi - x0;
-   double wy1 = yi - y0;
-   double wx0 = 1.0 - wx1;
-   double wy0 = 1.0 - wy1;
-   double w00 = wx0 * wy0;
-   double w01 = wx0 * wy1;
-   double w10 = wx1 * wy0;
-   double w11 = wx1 * wy1;
-
-   // Establish grid indices for 4 surrounding points:
-   int index00  = theSize.x*y0 + x0;
-   int index10 = index00;
-   int index11 = index00;
-   int index01 = index00;
-
-   if (x0 < (theSize.x-1)) index10 = index00 + 1;
-   if (y0 < (theSize.y-1)) index01 = index00 + theSize.x;
-   if (y0 < (theSize.y-1)) index01 = index00 + theSize.x;
-   if (x0 < (theSize.x-1)) index11 = index01 + 1;
-
-   // Safety check:
-   int max_idx = theSize.x * theSize.y;
-   if ((index00 > max_idx) || (index10 > max_idx) || (index11 > max_idx) || (index01 > max_idx))
-      return ossim::nan();
-
-   // Extract the four data points:
-   double p00 = theGridData[index00];
-   double p01 = theGridData[index01];
-   double p10 = theGridData[index10];
-   double p11 = theGridData[index11];
-
-   // Consider the numerical domain to catch any wrap condition:
-   if (theDomainType >= WRAP_180)
-   {
-      double dp01_00 = p01 - p00;
-      double dp10_00 = p10 - p00;
-      double dp11_00 = p11 - p00;
-
-      if (dp01_00 > 180.0)
-         p01 -= 360.0;
-      else if (dp01_00 < -180.0)
-         p01 += 360.0;
-
-      if (dp10_00 > 180.0)
-         p10 -= 360.0;
-      else if (dp10_00 < -180.0)
-         p10 += 360.0;
-
-      if (dp11_00 > 180.0)
-         p11 -= 360.0;
-      else if (dp11_00 < -180.0)
-         p11 += 360.0;
-   }
-
-   // Perform interpolation:
-   double value = (p00*w00 + p01*w01 + p10*w10 + p11*w11) / (w00 + w01 + w10 + w11);
-   constrain(value);
-
-   return value;
-}
-
-//**************************************************************************************************
-//  METHOD: ossimDblGrid::extrapolate()
-//  
-//  Establishes bilinear extrapolation value for point outside of the grid. 
-//
-//**************************************************************************************************
-double ossimDblGrid::extrapolate(double x, double y) const
-{
-   if(!theGridData) 
-      return theNullValue;
-
-
-   // Decide which extra-grid region contains the input point:
-   double dx=0, dy=0, dR_dx=0, dR_dy=0, R0;
-   if (y < 0)
-   {
-      // The point is above the top edge of grid space:
-      dy = y;
-      if (x < 0)
-      {
-         // The point is in the top-left region. Use UL corner alone as reference, and compute first
-         // and second partials:
-         R0 = getNode(0, 0);
-         dx = x;
-         dR_dx = getNode(1, 0) - R0;
-         dR_dy = getNode(0, 1) - R0;
-      }
-      else if (x <= theSize.x-1)
-      {
-         // The point directly above the grid, use the dR_dy of the edge pixel:
-         R0 = interpolate(x, 0);
-         dR_dy = interpolate(x, 1.0) - R0;
-      }
-      else
-      {
-         // The point is in the top-right region:
-         R0 = getNode(theSize.x - 1, 0);
-         dx = x - theSize.x + 1;
-         dR_dx = R0 - getNode(theSize.x-2, 0);
-         dR_dy = getNode(theSize.x-1, 1) - R0;
-      }
-   }
-   else if (y <= theSize.y-1)
-   {
-      // The point is either to the left, the right, or inside of the grid:
-      if (x < 0)
-      {
-         // The point is directly to the left of the grid:
-         R0 = interpolate(0, y);
-         dx = x;
-         dR_dx = interpolate(1.0, y) - R0;
-      }
-      else if (x <= theSize.x-1)
-      {
-         // The point is inside the grid. This should never happen, but handle just in case:
-         return interpolate(x, y);
-      }
-      else 
-      {
-         // The point directly to the right of the grid:
-         R0 = interpolate((double)theSize.x-1, y);
-         dx = x - theSize.x + 1;
-         dR_dx = R0 - interpolate((double)theSize.x-2, y);
-      }
-   }
-   else
-   {
-      // The point is below the bottom edge of grid space:
-      dy = y - theSize.y + 1;
-      if (x < 0)
-      {
-         // The point is in the bottom-left region:
-         R0 = getNode(0, theSize.y-1);
-         dx = x;
-         dR_dx = getNode(1, theSize.y-1) - R0;
-         dR_dy = R0 - getNode(0, theSize.y-2);
-      }
-      else if (x < theSize.x-1)
-      {
-         // The point directly below the grid:
-         R0 = interpolate(x, (double)theSize.y-1);
-         dR_dy = R0 - interpolate(x, (double)theSize.y-2);
-      }
-      else
-      {
-         // The point is in the bottom-right region:
-         R0 = getNode(theSize.x - 1, theSize.y-1);
-         dx = x - theSize.x + 1;
-         dR_dx = R0 - getNode(theSize.x-2, theSize.y-1);
-         dR_dy = R0 - getNode(theSize.x-1, theSize.y-2);
-      }
-   }
-
-   // Consider the numerical domain and adjust potential wrap conditions in the differences:
-   if (theDomainType >= WRAP_180)
-   {
-      if (dR_dx > 180.0) dR_dx -= 360.0;
-      else if (dR_dx < -180.0) dR_dx += 360.0;
-
-      if (dR_dy > 180.0) dR_dy -= 360.0;
-      else if (dR_dy < -180.0) dR_dy += 360.0;
-   }
-
-   double R = R0 + dR_dx*dx + dR_dy*dy;
-   constrain(R);
-   return R;
-}
-
-//*****************************************************************************
-//  OPERATOR: =
-//  
-//*****************************************************************************
-const ossimDblGrid& ossimDblGrid::operator = (const ossimDblGrid& source)
-{
-   if(&source == this) return *this;
-
-   if (theGridData)
-   {
-      delete [] theGridData;
-      theGridData = 0;
-   }
-
-   //***
-   // Assign data members:
-   //***
-   theSize           = source.theSize;
-   theOrigin         = source.theOrigin;
-   theSpacing        = source.theSpacing;
-   theMinValue       = source.theMinValue;
-   theMaxValue       = source.theMaxValue;
-   theNullValue      = source.theNullValue;
-   theMeanValue      = source.theMeanValue;
-   theDeviation      = source.theDeviation;
-   theMeanIsComputed = source.theMeanIsComputed;
-   theDomainType     = source.theDomainType;
-   theExtrapIsEnabled = source.theExtrapIsEnabled;
-
-   //***
-   // Allocate mem for the grid, and initialize:
-   //***
-   int buflen = theSize.x * theSize.y;
-   if(buflen>0)
-   {
-      theGridData = new double [buflen];
-
-      for (int i=0; i<buflen; i++)
-      {
-         theGridData[i] = source.theGridData[i];
-      }
-   }
-
-   return *this;
-}
-
-
-/*!****************************************************************************
-* METHOD: ossimDblGrid::meanValue()
-*  
-*****************************************************************************/
-double  ossimDblGrid::meanValue()
-{
-   static const char MODULE[] = "ossimDblGrid::meanValue()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   if (!theMeanIsComputed)
-   {
-      computeMean();
-   }
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-   return theMeanValue;
-}
-
-/*!****************************************************************************
-* METHOD: ossimDblGrid::meanStdDev()
-*  
-*****************************************************************************/
-double  ossimDblGrid::meanStdDev()
-{
-   static const char MODULE[] = "ossimDblGrid::meanStdDev()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   if (!theMeanIsComputed)
-      computeMean();
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";;
-   return theDeviation;
-}
-
-/*!****************************************************************************
-* METHOD: ossimDblGrid::computeMean()
-*  
-*****************************************************************************/
-void ossimDblGrid::computeMean()
-{
-   static const char MODULE[] = "ossimDblGrid::meanStdDev()";
-   if(!theGridData) return;
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "entering...\n";
-
-   if (!theMeanIsComputed)
-   {
-      double accum = 0.0;
-      double num_samples = 0.0;
-
-      /*!
-      * Loop to compute mean:
-      */
-      for (int i=0; i<(theSize.x*theSize.y); i++)
-      {
-         if (theGridData[i] != theNullValue)
-         {
-            accum += theGridData[i];
-            num_samples += 1.0;
-         }
-      }
-      theMeanValue = accum/num_samples;
-
-      /*!
-      * Loop again to compute deviation:
-      */
-      accum = 0.0;
-      double diff;
-      for (int i=0; i<(theSize.x*theSize.y); i++)
-      {
-         if (theGridData[i] != theNullValue)
-         {
-            diff = theMeanValue - theGridData[i];
-            accum += diff*diff;
-         }
-      }
-      theDeviation = sqrt(accum/num_samples);
-
-      theMeanIsComputed = true;
-   }
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-   return;
-}
-
-/*!****************************************************************************
-* INLINE METHOD: ossimDblGrid::isInside(const ossimDpt& pt) const
-*****************************************************************************/
-bool ossimDblGrid::isInside(const double& u, const double& v) const
-{
-   double xi = (u - theOrigin.u)/theSpacing.x;
-   double yi = (v - theOrigin.v)/theSpacing.y;
-   return ((xi >= 0.0) && (xi <= ((double)theSize.x - 1.0)) &&
-      (yi >= 0.0) && (yi <= ((double)theSize.y - 1.0)));
-   //return ((xi >= 0.0) && (xi < ((double)theSize.x)) &&
-   //        (yi >= 0.0) && (yi < ((double)theSize.y)));
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimDblGrid::save()
-//  
-//  Saves the grid to the stream in compact ASCII format (not necessarily
-//  human readable).
-//  
-//*****************************************************************************
-bool ossimDblGrid::save(ostream& os, const char* descr) const
-{
-   static const char MODULE[] = "ossimDblGrid::save()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   //***
-   // Preserve the stream's settings:
-   //***
-   ios::fmtflags new_options = ios::scientific|ios::dec;
-   //ios::streamsize new_precision = 12;
-   int new_precision = 12;
-
-   ios::fmtflags old_options = os.flags(new_options);
-   int old_precision = os.precision(new_precision);
-
-   //***
-   // Verify the description string is not too long:
-   //***
-   char descr_buf[81];
-   std::strncpy(descr_buf, descr, 80);
-   descr_buf[80] = '\0';
-
-   //***
-   // write magic number tag and the grid size X, Y, num params:
-   //***
-   os << MAGIC_NUMBER << " " << descr_buf << "\n"
-      << theSize.x << "  "
-      << theSize.y << "  "
-      << theOrigin.u << "  "
-      << theOrigin.v << "  "
-      << theSpacing.u << "  "
-      << theSpacing.v << "  "
-      << theNullValue << "\n";
-
-   if(theGridData)
-   {
-      //***
-      // Loop to write grid points:
-      //***
-      int max_index = theSize.x*theSize.y;
-      for (int i=0; i<max_index; i++)
-         os << theGridData[i] << "  ";
-   }
-   os << "\n";
-
-   //***
-   // Restore the stream's state:
-   //***
-   os.flags(old_options);
-   os.precision(old_precision);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimDblGrid::load()
-//  
-//  Loads the grid from the stream in compact ASCII format (not necessarily
-//  human readable).
-//  
-//*****************************************************************************
-bool ossimDblGrid::load(istream& is)
-{
-   static const char MODULE[] = "ossimDblGrid::load()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-
-   char strbuf[128];
-
-   //***
-   // Read magic number tag to insure it is an ossimDblGrid record:
-   //***
-   is >> strbuf;
-   if (std::strncmp(strbuf, MAGIC_NUMBER.c_str(), MAGIC_NUMBER.length()))
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << MODULE << "Error reading OSSIM_DBL_GRID magic number from stream. "
-         << "Aborting...\n";
-      return false;
-   }
-   is.getline(strbuf, 128, '\n');
-   theSize           = ossimDpt(0,0);
-   theOrigin         = ossimDpt(0,0);
-   theSpacing        = ossimDpt(0,0);
-   theMinValue       = OSSIM_DEFAULT_MAX_PIX_DOUBLE;
-   theMaxValue       =  OSSIM_DEFAULT_MIN_PIX_DOUBLE;
-  // theNullValue      = theNullValue;
-   theMeanIsComputed = false;
-
-
-   //***
-   // Read the grid size, origin, and spacing:
-   //***
-   ossimIpt size;
-   ossimDpt origin, spacing;
-   double null_value;
-   is >> size.x 
-      >> size.y 
-      >> origin.u 
-      >> origin.v 
-      >> spacing.u
-      >> spacing.v
-      >> null_value;
-
-   initialize(size, origin, spacing, null_value);
-
-   //***
-   // Loop to read grid points:
-   //***
-   int max_index = theSize.x*theSize.y;
-   for (int i=0; i<max_index; i++)
-   {
-      is >> theGridData[i];
-   }
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-
-   return true;
-}
-
-//*****************************************************************************
-//  PRIVATE FUNCTION: isBlocked()
-//  
-//  Used by interpolateNullValuedNodes. Returns true if the direction indicated
-//  by the vector (x, y) has been blocked from further sampling. This occurs if
-//  a sample has already been found in that general direction. The directions
-//  are discrete (16) evenly distributed about a "compass rose." Each index
-//  corresponds to one of the directions as illustrated here:
-//
-//                        15 0 1
-//                     14    |    2
-//                    13     |     3
-//                   12------+------4
-//                    11     |     5
-//                     10    |    6
-//                         9 8 7
-//
-//*****************************************************************************
-bool isBlocked(bool* blocked, int x, int y)
-{
-   if (y == 0)
-   {
-      if (x > 0) return blocked[4];
-      return blocked[12];
-   }
-
-   double r = x/y;
-   int c = 0;
-   int i;
-   if (x < 0.0) c = 8;
-
-   //***
-   // Test the tangent value instead of computing angle:
-   //***
-   if      (r >  5.02734) i = 12 + c;
-   else if (r >  1.49660) i = 13 + c;
-   else if (r >  0.66818) i = 14 + c;
-   else if (r >  0.19891) i = 15 + c;
-   else if (r > -0.19891) i =  0 + c;
-   else if (r > -0.66818) i =  1 + c;
-   else if (r > -1.49660) i =  2 + c;
-   else if (r > -5.02734) i =  3 + c;
-   else                   i =  4 + c;
-
-   if (i > 15) i -= 16;  // modulo 16
-
-   return blocked[i];
-}
-
-//*****************************************************************************
-//  PRIVATE FUNCTION: blockDirection()
-//  
-//  Used by interpolateNullValuedNodes. Blocks the resampler from exploring
-//  further in a general direction, specified by thevector (x, y). The blocking
-//  is requested when a sample is found. This prevents a sample that is shadowed
-//  by a closer sample from having influence.
-//
-//  See method isBlocked() above for a description of the compass rose indexing.
-//  
-//*****************************************************************************
-void blockDirection(bool* blocked, int x, int y)
-{
-   if (y == 0)
-   {
-      if (x > 0) blocked[4] = true;
-      else       blocked[12] = true;
-      return;
-   }
-
-   double r = x/y;
-   int c = 0;
-   int i;
-   if (x < 0.0) c = 8;
-
-   //***
-   // Test the tangent value instead of computing angle:
-   //***
-   if      (r >  5.02734) i = 12 + c;
-   else if (r >  1.49660) i = 13 + c;
-   else if (r >  0.66818) i = 14 + c;
-   else if (r >  0.19891) i = 15 + c;
-   else if (r > -0.19891) i =  0 + c;
-   else if (r > -0.66818) i =  1 + c;
-   else if (r > -1.49660) i =  2 + c;
-   else if (r > -5.02734) i =  3 + c;
-   else                   i =  4 + c;
-
-   if (i > 15) i -= 16;  // modulo 16
-   blocked[i] = true;
-
-   return;
-}
-
-//*****************************************************************************
-//   METHOD: ossimDblGrid::interpolateNullValuedNodes(decay_rate)
-//
-//   This method performs a resampling of the defined grid nodes in order to
-//   compute interpolated values for those uninitialized nodes. This is
-//   necessary when only a subset of nodes are available for initializing the
-//   grid.
-//
-//   The decay rate is a geometric (1/r) factor applied to the weights to
-//   amplify the rate at which a neighbor's influence diminishes. For a
-//   decay_rate = 1, the influence of a sample diminishes linearly with the
-//   distance.
-//  
-//*****************************************************************************
-void ossimDblGrid::interpolateNullValuedNodes(const double& decay_rate)
-{
-   static const char MODULE[] = "ossimDblGrid::interpolateNullValuedNodes()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
-   if(!theGridData) return;
-
-   //***
-   // Allocate buffer to store resampled nodes:
-   //***
-   int buf_size = theSize.x*theSize.y;
-
-   //---
-   // Note: Changed resampled_grid from double* to vector<double> to fix
-   // coverity scan uninitialized error. This calls the fill constructor.
-   // drb - 20150527
-   //---
-   std::vector<double> resampled_grid( buf_size, 0.0 );
-
-   double min_weight_needed = 4.0/decay_rate;
-
-   int      start_x, start_y, end_x, end_y;
-   int      diameter;
-   double   sum_weights;
-   double   accumulator;
-   double   weight;
-   double   sample;
-   double   node_value;
-   bool     sample_found;
-   int      node_idx;
-   double   adj_delta;
-   int      dx, dy;
-   bool     blocked[16];
-
-   //***
-   // Loop over the entire grid to resample all NULL nodes:
-   //***
-   for (int y=0; y<theSize.y; ++y)
-   {
-      for (int x=0; x<theSize.x; ++x)
-      {
-         //***
-         // Only resample those nodes that contain NULL:
-         //***
-         node_idx = index(x, y);
-         node_value = theGridData[node_idx];
-         if (node_value != theNullValue)
-         {
-            //***
-            // This node had a value. Simply copy it into the resample_grid:
-            //***
-            resampled_grid[node_idx] = node_value;
-         }
-
-         else
-         {
-            //***
-            // Resampling is necessary. Initialize quantities used:
-            //***
-            start_x = x;
-            start_y = y;
-            diameter = 0;
-            sum_weights = 0;
-            accumulator = 0;
-            weight = 1.0;
-            sample_found = true;
-
-            for (int i=0; i<16; i++)
-               blocked[i] = false;
-
-            //***
-            // Loop collecting contributions from non-null neighbors. Begin with
-            // a small kernel size (diameter) and successively grow until a
-            // sufficient number of contributors is found:
-            //***
-            while ((sum_weights < min_weight_needed) && sample_found)
-            {
-               diameter += 2;
-               start_x -= 1;
-               start_y -= 1;
-               weight *= decay_rate;
-               sample_found = false;
-
-               //***
-               // Loop over each pixel in kernel and sum in it's contribution:
-               //***
-               end_y = start_y + diameter;
-               end_x = start_x + diameter;
-
-               for (int yn=start_y; yn<=end_y; ++yn)
-               {
-                  if ((yn == start_y) || (yn == end_y))
-                  {
-                     //***
-                     // This is the top edge or bottom edge, need samples from
-                     // each x along kernel edge:
-                     //***
-                     for (int xn=start_x; xn<=end_x; ++xn)
-                     {
-                        sample_found = sample_found || isInside(xn, yn);
-                        sample = getNode(xn, yn);
-                        if (sample != theNullValue)
-                        {
-                           dx = x - xn; dy = y - yn;
-                           if (!isBlocked(blocked, dx, dy))
-                           {
-                              adj_delta = weight*sqrt((double)(dx*dx + dy*dy));
-                              accumulator += sample/adj_delta;
-                              sum_weights += 1.0/adj_delta;
-                              blockDirection(blocked, dx, dy);
-                           }
-                        }
-                     }
-                  }
-                  else
-                  {
-                     //***
-                     // For the left/right edge of the kernel, need to sample
-                     // only the first (start_x) and last (end_x):
-                     //***
-                     sample_found = sample_found || isInside(start_x, yn);
-                     sample = getNode(start_x, yn);
-                     if (sample != theNullValue)
-                     {
-                        dx = x - start_x; dy = y - yn;
-                        if (!isBlocked(blocked, dx, dy))
-                        {
-                           adj_delta = weight*sqrt((double)(dx*dx + dy*dy));
-                           accumulator += sample/adj_delta;
-                           sum_weights += 1.0/adj_delta;
-                           blockDirection(blocked, dx, dy);
-                        }
-                     }
-
-                     sample_found = sample_found || isInside(end_x, yn);
-                     sample = getNode(end_x, yn);
-                     if (sample != theNullValue)
-                     {
-                        dx = x - end_x; dy = y - yn;
-                        if (!isBlocked(blocked, dx, dy))
-                        {
-                           adj_delta = weight*sqrt((double)(dx*dx + dy*dy));
-                           accumulator += sample/adj_delta;
-                           sum_weights += 1.0/adj_delta;
-                           blockDirection(blocked, dx, dy);
-                        }
-                     }
-                  } // end else
-               } // end for loop over all rows in kernel
-            } // end while loop inflating kernel size
-
-            //***
-            // Finished collecting sample contributions for this node. compute
-            // convolution and save in buffer:
-            //***
-            if (sum_weights != 0)
-               resampled_grid[node_idx] = accumulator/sum_weights;
-            else
-               resampled_grid[node_idx] = theNullValue;
-
-         } // end else (if input node is NULL)
-      } // end for loop over all columns in grid
-   } // end for loop over all lines in grid
-
-   //***
-   // Now copy the resampled grid back into the original buffer:
-   //***
-   for (node_idx=0; node_idx<buf_size; node_idx++)
-      theGridData[node_idx] = resampled_grid[node_idx];
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimDblGrid::filter(size_x, size_y, kernel)
-//  
-//  Passes the grid data through a convolution filter given in the kernel array.
-//  The grid must not contain any NULL nodes as these are not scanned for.
-//  The kernel sizes should be odd numbers.
-//  
-//*****************************************************************************
-void ossimDblGrid::filter(int size_x, int size_y, double* kernel)
-{
-   static const char MODULE[] = "ossimDblGrid::filter()";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "entering...\n";
-   if(!theGridData) return;
-
-   int      rx      = (size_x - 1)/2;     // kernel radii
-   int      ry      = (size_y - 1)/2;     
-   int      start_x = rx;                 // indexes to start sampling grid
-   int      start_y = ry;
-   int      end_x   = theSize.x - rx;     // indexes to end buffer sampling
-   int      end_y   = theSize.y - ry;
-   int      knl_ctr = ry*size_x + rx;     // offset to center of kernel buffer
-   double   node_value, kernel_value;
-   int      resample_node_idx;
-   
-   // The resampled data is accumulated and stored in a temporary ossimDblGrid object so that we
-   // can take advantage of the extrapolation feature later in this method.
-   ossimIpt resample_grid_size(end_x-start_x, end_y-start_y);
-   ossimDpt resample_grid_origin(start_x, start_y);
-   ossimDpt resample_grid_spacing(1,1);
-   ossimDblGrid resample_grid(resample_grid_size, resample_grid_origin, resample_grid_spacing);
-   resample_grid.enableExtrapolation();
-   resample_grid.fill(0.0);
-
-   // Loop over the entire grid to resample all NULL nodes:
-   for (int y=start_y; y<end_y; y++)
-   {
-      for (int x=start_x; x<end_x; x++)
-      {
-         resample_node_idx = resample_grid.index(x-start_x, y-start_y);
-      
-         // Fetch samples for each kernel element, apply gain, then accumulate
-         // in output buffer:
-         for (int ky=-ry; ky<=ry; ky++)
-         {
-            for (int kx=-rx; kx<=rx; kx++)
-            {
-               node_value = theGridData[index(x+kx, y+ky)];
-               kernel_value = kernel[knl_ctr + ky*size_x + kx];
-               resample_grid.theGridData[resample_node_idx] += kernel_value*node_value;
-            }
-         }
-      }
-   }
-   
-   // Copy the resampled data to the original grid.
-   // Note: the grid margin has unfiltered data due to the kernel radius. Use the resample_grid's
-   // inherent extrapolator to fill in these unfiltered border nodes:
-   for (int y=0; y<theSize.y; y++)
-   {
-      for (int x=0; x<theSize.x; x++)
-      {
-         theGridData[index(x, y)] = resample_grid(x, y); // automatically extrapolates if necessary
-      }
-   }
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
-   return;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimDblGrid::fill
-//  
-//  Fills the current grid with constant value provided.
-//  
-//*****************************************************************************
-void ossimDblGrid::fill(double fill_value)
-{
-   if (!theGridData)
-   {
-      return;
-   }
-
-   int size = theSize.x * theSize.y;
-   for (int i=0; i<size; i++)
-      theGridData[i] = fill_value;
-
-   return;
-}
-
-//*************************************************************************************************
-// Constrains the value to the numerical domain specified in theDomainType.
-//*************************************************************************************************
-void ossimDblGrid::constrain(double& value) const
-{
-   if ((theDomainType == CONTINUOUS) || (value == theNullValue))
-      return;
-      
-   // Consider again the domain to verify the value is within allowable range:
-   if (theDomainType == WRAP_180) 
-   {
-      if (value <= -180.0)
-         value += 360.0;
-      else if (value > 180.0) 
-         value -= 360.0;
-   }
-   else if (theDomainType == WRAP_360)
-   {
-      if (value < 0.0) 
-         value += 360.0;
-      else if (value >= 360.0) 
-         value -= 360.0;
-   }
-   //else if (theDomainType == SAWTOOTH_90)
-   //{
-   //   // Any adjustment here corrupts the data value since it is clipped:
-   //   if (value < -90.0) 
-   //      value = -90.0;
-   //   else if (value > 90.0) 
-   //      value = 90.0;
-   //}
-}
-
-//*****************************************************************************
-//  FRIEND OPERATOR: ostream& << (ostream&) 
-//  
-//*****************************************************************************
-ostream& operator<<(ostream& os, const ossimDblGrid& grid) 
-{
-   os << "\nDump of ossimDblGrid at " << (void*) &grid
-      << "\n  theSize: "           << grid.theSize
-      << "\n  theOrigin: "         << grid.theOrigin
-      << "\n  theSpacing: "        << grid.theSpacing
-      << "\n  theMinValue: "       << grid.theMinValue
-      << "\n  theMaxValue: "       << grid.theMaxValue
-      << "\n  theNullValue: "      << grid.theNullValue
-      << "\n  theMeanValue: "      << grid.theMeanValue
-      << "\n  theDeviation: "      << grid.theDeviation
-      << "\n  theMeanIsComputed: " << grid.theMeanIsComputed
-      << "\n";
-
-   if(grid.theGridData)
-   {
-
-      for (int y=0; y<grid.theSize.y; y++)
-      {
-         for (int x=0; x<grid.theSize.x; x++)
-         {
-            os << "\n  node(" << x << ", " << y << "): " << grid.getNode(x,y);
-         }
-      }
-   }
-
-   return os;
-}
diff --git a/ossim/src/ossim/base/ossimDirectory.cpp b/ossim/src/ossim/base/ossimDirectory.cpp
deleted file mode 100644
index f980424..0000000
--- a/ossim/src/ossim/base/ossimDirectory.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: A brief description of the contents of the file.
-//
-//*************************************************************************
-// $Id: ossimDirectory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstring> /* for strncasecmp */
-#include <iostream>
-
-#if defined (_WIN32)
-#include <io.h>
-#include <direct.h>
-#else
-#include <ossim/base/ossimDirectoryData.h>
-#endif
-#ifdef __BORLANDC__
-# include <dir.h>
-#include <direct.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <io.h>
-#define _chdir chdir
-#endif
-
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimRegExp.h>
-
-//#include "wx/filefn.h"          // for wxMatchWild
-
-// #include <sys/types.h>
-
-// #include <dirent.h>
-
-// ----------------------------------------------------------------------------
-// ossimDirectory construction/destruction
-// ----------------------------------------------------------------------------
-
-#if defined (_WIN32)
-ossimDirectory::ossimDirectory()
-   :
-      theData(0),
-      theDirectoryName(),
-      theFlags(0)
-{}
-
-ossimDirectory::ossimDirectory(const ossimFilename &dirname)
-   :
-      theData(0),
-      theDirectoryName(dirname),
-      theFlags(0)
-{
-   open(dirname);
-}
-
-ossimDirectory::~ossimDirectory()
-{
-   if (theData != 0) _findclose( theData );
-}
-
-bool ossimDirectory::open(const ossimFilename &dirname)
-{
-   // close out currently open directory
-   if (theData != 0)
-   {
-      _findclose( theData );
-      theData = 0;
-   }
-   
-   // set new directory name
-   theDirectoryName = dirname;
-
-	return (dirname.isDir());
-   // cd to the new directory
-//   if (_chdir( theDirectoryName) == -1)
-//   {
-//      return false;
-//   }
-   
-//   return true;
-}
-
-bool ossimDirectory::getFirst(ossimFilename &filename, int flags)
-{
-   struct _finddata_t c_file;
-   ossimFilename temp;
-   //long theData1 = _findfirst( "*.*", &c_file );
-   ossimFilename dirName = theDirectoryName.dirCat("*");
-   if( (theData = _findfirst( dirName.c_str(), &c_file )) != 0L )
-   {
-      setFlags(flags);
-      
-      temp = theDirectoryName.dirCat(c_file.name);
-      
-	  
-      while (!fileMatched(temp))
-      {
-         // look for next file in the directory
-         if (_findnext( theData, &c_file ) == 0 )
-         {
-            temp = theDirectoryName.dirCat(c_file.name);
-         }
-         else
-         {
-            // no more file in the directory
-            filename.clear();
-            return false;
-         }
-      }
-   }
-
-   // set the filenane that matches
-   filename = temp.trim();
-
-   return (filename!="");
-}
-
-bool ossimDirectory::getNext(ossimFilename &filename) const
-{
-   struct _finddata_t c_file;
-   bool matches = false;
-   ossimFilename temp;
-
-   while (!matches )
-   {
-      // look for next file in the directory
-      if (_findnext( theData, &c_file ) == 0 )
-      {
-         temp = theDirectoryName.dirCat(c_file.name);
-         matches = fileMatched(temp);
-      }
-      else
-      {
-         // no more file in the directory
-         filename.clear();
-         return false;
-      }
-   }
-
-   // set the filenane that matches
-   if (matches)
-   {
-      filename = temp.trim();
-   }
-
-   return (matches&&(filename!=""));
-}
-
-bool ossimDirectory::fileMatched(ossimFilename &filename) const
-{
-   bool matches = false;
-
-   // Don't return "." and ".." unless asked for.
-   if ( (filename.file() == "..") || (filename.file() == ".")   )
-   {
-      if (theFlags & ossimDirectory::OSSIM_DIR_DOTDOT)
-      {
-         matches = true;
-      }
-   }
-   else if((filename.isDir()) && (theFlags & ossimDirectory::OSSIM_DIR_DIRS))
-   {
-      matches = true;
-   }
-   else if((filename.isFile()) && (theFlags & ossimDirectory::OSSIM_DIR_FILES))
-   {
-      matches = true;
-   }
-
-   return matches;
-}
-
-bool ossimDirectory::isOpened() const
-{
-   return theDirectoryName.isDir();
-    //return theData != 0;
-}
-
-#else
-
-ossimDirectory::ossimDirectory()
-   :
-      theData(NULL)
-{}
-
-ossimDirectory::ossimDirectory(const ossimFilename &dirname)
-{
-    theData = NULL;
-    open(dirname);
-}
-
-bool ossimDirectory::open(const ossimFilename &dirname)
-{
-    delete theData;
-    theData = new ossimDirectoryData(dirname);
-
-    if ( theData &&
-         (!theData->isOk()) )
-    {
-        delete theData;
-        theData = NULL;
-
-        return false;
-    }
-
-    return true;
-}
-
-ossimDirectory::~ossimDirectory()
-{
-    delete theData;
-}
-
-// ----------------------------------------------------------------------------
-// ossimDirectory enumerating
-// ----------------------------------------------------------------------------
-
-bool ossimDirectory::getFirst(ossimFilename &filename,
-                              int flags)
-{
-   if(theData && isOpened())
-   {
-      theData->rewind();
-
-      theData->setFlags(flags);
-
-      return getNext(filename);
-   }
-
-   return false;
-}
-
-bool ossimDirectory::getNext(ossimFilename &filename) const
-{
-   if(theData && isOpened())
-   {
-      return theData->read(filename);
-   }
-
-   return false;
-}
-
-bool ossimDirectory::isOpened() const
-{
-    return theData != NULL;
-}
-
-#endif
-
-void ossimDirectory::findAllFilesThatMatch(std::vector<ossimFilename>& result,
-					   const ossimString& regularExpressionPattern,
-					   int flags)
-{
-   ossimFilename filename;
-   ossimRegExp   regExpr;
-   regExpr.compile(regularExpressionPattern.c_str());
-   if(getFirst(filename, flags))
-   {
-      do
-      {
-         ossimString fileOnly = filename.file();
-         if(regExpr.find(fileOnly.c_str()))
-         {
-            result.push_back(filename);
-         }
-      }while(getNext(filename));
-   }
-}
-
-// ESH 07/2008, Trac #234: OSSIM is case sensitive 
-// when using worldfile templates during ingest
-bool ossimDirectory::findCaseInsensitiveEquivalents(
-   const ossimFilename &filename, 
-   std::vector<ossimFilename>& result,
-   bool bExcludeExactMatch )
-{
-   bool bSuccess = false;
-   ossimFilename candidate;
-   bool bFoundCandidate = getFirst( candidate );
-   int compareSize = static_cast<int>( filename.length() );
-   
-   while( bFoundCandidate == true )
-   {
-      // Do a case insensitive string compare
-#if defined (_WIN32)
-      bool bFoundEquivalent = _strnicmp( filename.c_str(), candidate.c_str(), 
-                                         compareSize ) == 0 ? true : false;
-#else
-      //bool bFoundEquivalent =  strnicmp( filename.c_str(), candidate.c_str(), // 
-      //                                         compareSize ) == 0 ? true : false;
-      bool bFoundEquivalent =  strncasecmp( filename.c_str(), candidate.c_str(), 
-                                            compareSize ) == 0 ? true : false;
-#endif
-      
-      if ( bFoundEquivalent == true )
-      {
-         bool bFoundExact = ( filename == candidate.c_str() ) ? true : false;
-         bool bShouldExclude = ( bFoundExact == true && 
-                                 bExcludeExactMatch == true ) ? true : false;
-         
-         if ( bShouldExclude == false )
-         {
-            bSuccess = true;
-            result.push_back( candidate );
-         }
-      }
-      
-      bFoundCandidate = getNext( candidate );
-   }
-   
-   return bSuccess;
-}
-
diff --git a/ossim/src/ossim/base/ossimDisplayEventListener.cpp b/ossim/src/ossim/base/ossimDisplayEventListener.cpp
deleted file mode 100644
index 1fe105f..0000000
--- a/ossim/src/ossim/base/ossimDisplayEventListener.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id
-
-#include <ossim/base/ossimDisplayEventListener.h>
-#include <ossim/base/ossimDisplayListEvent.h>
-#include <ossim/base/ossimDisplayRefreshEvent.h>
-
-RTTI_DEF1(ossimDisplayEventListener, "ossimDisplayEventListener", ossimListener);
-
-ossimDisplayEventListener::ossimDisplayEventListener()
-   : ossimListener()
-{
-}
-
-ossimDisplayEventListener::~ossimDisplayEventListener()
-{
-}
-
-void ossimDisplayEventListener::processEvent(ossimEvent& event)
-{
-   ossimDisplayListEvent* displayListEvtPtr = PTR_CAST(ossimDisplayListEvent, &event);
-
-   if(displayListEvtPtr)
-   {
-      displayListEvent(*displayListEvtPtr);
-   }
-
-   ossimDisplayRefreshEvent* displayRefreshEvt = PTR_CAST(ossimDisplayRefreshEvent, &event);
-   if(displayRefreshEvt)
-   {
-      displayRefreshEvent(*displayRefreshEvt);
-   }
-   
-}
-
-void ossimDisplayEventListener::displayListEvent(ossimDisplayListEvent&)
-{
-}
-
-void ossimDisplayEventListener::displayRefreshEvent(ossimDisplayRefreshEvent&)
-{
-}
diff --git a/ossim/src/ossim/base/ossimDisplayInterface.cpp b/ossim/src/ossim/base/ossimDisplayInterface.cpp
deleted file mode 100644
index f9ce2ce..0000000
--- a/ossim/src/ossim/base/ossimDisplayInterface.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimDisplayInterface.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/base/ossimDisplayInterface.h>
-
-RTTI_DEF(ossimDisplayInterface, "ossimDisplayInterface");
-
-ossimDisplayInterface::ossimDisplayInterface()
-{
-}
-
-ossimDisplayInterface::~ossimDisplayInterface()
-{
-}
-
-ossimString ossimDisplayInterface::getTitle()const
-{
-   ossimString result;
-   
-   getTitle(result);
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/base/ossimDoubleGridProperty.cpp b/ossim/src/ossim/base/ossimDoubleGridProperty.cpp
deleted file mode 100644
index 875759b..0000000
--- a/ossim/src/ossim/base/ossimDoubleGridProperty.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-#include <sstream>
-#include <ossim/base/ossimDoubleGridProperty.h>
-
-RTTI_DEF1(ossimDoubleGridProperty, "ossimDoubleGridProperty", ossimProperty);
-
-ossimDoubleGridProperty::ossimDoubleGridProperty(const ossimString& name,
-						 int /* numberOfRows */,
-						 int /* numberOfCols */,
-						 const std::vector<double>& /* values*/ )
-  :ossimProperty(name),
-   theMinNumberOfCols(-1),
-   theMaxNumberOfCols(-1),
-   theMinNumberOfRows(-1),
-   theMaxNumberOfRows(-1)
-{
-
-}
-
-ossimDoubleGridProperty::ossimDoubleGridProperty(const ossimDoubleGridProperty& rhs)
-  :ossimProperty(rhs),
-  theMinNumberOfCols(rhs.theMinNumberOfCols),
-  theMaxNumberOfCols(rhs.theMaxNumberOfCols),
-  theMinNumberOfRows(rhs.theMinNumberOfRows),
-  theMaxNumberOfRows(rhs.theMaxNumberOfRows),
-  theValues(rhs.theValues)
-{
-}
-
-ossimDoubleGridProperty::~ossimDoubleGridProperty()
-{
-}
-
-ossimObject* ossimDoubleGridProperty::dup()const
-{
-  return new ossimDoubleGridProperty(*this);
-}
-
-const ossimProperty& ossimDoubleGridProperty::assign(const ossimProperty& rhs)
-{
-  ossimProperty::assign(rhs);
-  ossimDoubleGridProperty* rhsPtr = PTR_CAST(ossimDoubleGridProperty, &rhs);
-
-  if(rhsPtr)
-    {
-      theMinNumberOfCols = rhsPtr->theMinNumberOfCols;
-      theMaxNumberOfCols = rhsPtr->theMaxNumberOfCols;
-      theMinNumberOfRows = rhsPtr->theMinNumberOfRows;
-      theMaxNumberOfRows = rhsPtr->theMaxNumberOfRows;
-      theValues          = rhsPtr->theValues;
-    }
-  else
-    {
-      setValue(rhs.valueToString());
-      
-    }
-  
-  return *this;
-}
-
-  
-bool ossimDoubleGridProperty::setValue(const ossimString& value)
-{
-   std::istringstream in(value.c_str());
-   ossimString nRows, nCols, v;
-   int numberOfRows=0;
-   int numberOfCols=0;
-   int rowIdx = 0;
-   int colIdx = 0;
-   in >> nRows >> nCols;
-   numberOfRows = nRows.toInt32();
-   numberOfCols = nCols.toInt32();
-   theValues.resize(numberOfRows);
-   
-   for(rowIdx = 0; rowIdx < numberOfRows; ++rowIdx)
-   {
-      theValues[rowIdx].resize(numberOfCols);
-      for(colIdx = 0; colIdx < numberOfCols; ++ colIdx)
-      {
-         in >> v;
-         theValues[rowIdx][colIdx] = v.toDouble();
-      }
-   }
-   
-   return true;
-}
-
-void ossimDoubleGridProperty::valueToString(ossimString& valueResult)const
-{
-  std::ostringstream out;
-  int rowIdx = 0;
-  int colIdx = 0;
-  out << getNumberOfRows() << " " << getNumberOfCols() << " ";
-
-  for(rowIdx = 0; rowIdx < (int)getNumberOfRows(); ++rowIdx)
-    {
-      for(colIdx = 0; colIdx < (int)getNumberOfCols(); ++colIdx)
-	{
-	  out << ossimString::toString(getValue(rowIdx, colIdx)) << " ";
-	}
-    }
-  valueResult = out.str();
-}
-
-void ossimDoubleGridProperty::clearConstraints()
-{
-  theMinNumberOfCols = -1;
-  theMaxNumberOfCols = -1;
-  theMinNumberOfRows = -1;
-  theMaxNumberOfRows = -1;
-}
-
-void ossimDoubleGridProperty::setColConstraints(int minNumberOfCols,
-		  int maxNumberOfCols)
-{
-  theMinNumberOfCols = minNumberOfCols;
-  theMaxNumberOfCols = maxNumberOfCols;
-}
-
-void ossimDoubleGridProperty::setRowConstraints(int minNumberOfRows,
-						int maxNumberOfRows)
-{
-  theMinNumberOfRows = minNumberOfRows;
-  theMaxNumberOfRows = maxNumberOfRows;
-}
-
-void ossimDoubleGridProperty::setContraints(int minNumberOfRows,
-					    int maxNumberOfRows,
-					    int minNumberOfCols,
-					    int maxNumberOfCols)
-{
-  theMinNumberOfRows = minNumberOfRows;
-  theMaxNumberOfRows = maxNumberOfRows;
-  theMinNumberOfCols = minNumberOfCols;
-  theMaxNumberOfCols = maxNumberOfCols;
-}
-
-ossim_uint32 ossimDoubleGridProperty::getNumberOfRows()const
-{
-  return ((int)theValues.size());
-}
-
-ossim_uint32 ossimDoubleGridProperty::getNumberOfCols()const
-{
-  if(getNumberOfRows())
-    {
-      return (ossim_uint32)theValues[0].size();
-    }
-  return 0;
-}
-
-double ossimDoubleGridProperty::getValue(ossim_uint32 row, 
-					 ossim_uint32 col)const
-{
-  if((row < getNumberOfRows())&&
-     (col < getNumberOfCols()))
-    {
-      return theValues[(int)row][(int)col];
-    }
-
-  return 0.0;
-}
diff --git a/ossim/src/ossim/base/ossimDpt3d.cpp b/ossim/src/ossim/base/ossimDpt3d.cpp
deleted file mode 100644
index 13f0a8a..0000000
--- a/ossim/src/ossim/base/ossimDpt3d.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimDpt3d.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <sstream>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimString.h>
-
-
-ossimDpt3d::ossimDpt3d(const ossimDpt &aPt)
-   :x(aPt.x),
-    y(aPt.y),
-    z(0)
-{
-   if(aPt.isNan())
-   {
-      makeNan();
-   }
-}
-
-ossimDpt3d::ossimDpt3d(const ossimIpt &aPt)
-   :x(aPt.x),
-    y(aPt.y),
-    z(0)
-{
-   if(aPt.isNan())
-      makeNan();
-}
-
-ossimDpt3d::ossimDpt3d(const ossimGpt &gPt)
-{
-   if(gPt.hasNans())
-   {
-      makeNan();
-   }
-   else
-   {
-      ossimGpt wgs84Pt (gPt);
-      wgs84Pt.changeDatum(ossimDatumFactory::instance()->wgs84());
-      x = wgs84Pt.lon;
-      y = wgs84Pt.lat;
-      z = wgs84Pt.hgt;
-   }
-}
-
-
-std::string ossimDpt3d::toString(ossim_uint32 precision) const
-{
-   std::ostringstream os;
-   os <<  setprecision(precision);
-   
-   os << "(";
-   if ( ossim::isnan(x) == false)
-   {
-      os << x;
-   }
-   else
-   {
-      os << "nan";
-   }
-   os << ",";
-   if ( ossim::isnan(y) == false )
-   {
-      os << y;
-   }
-   else
-   {
-      os << "nan";
-   }
-   os << ",";
-   if ( ossim::isnan(z) == false )
-   {
-      os << z;
-   }
-   else
-   {
-      os << "nan";
-   }
-   os << ")";
-   
-   return os.str();
-}
-
-void ossimDpt3d::toPoint(const std::string& s)
-{
-   // Nan out the column vector for starters.
-   x = ossim::nan();
-   y = ossim::nan();
-   z = ossim::nan();
-  
-   std::istringstream is(s);
-
-   // Check the stream.
-   if (!is) return;
-
-   //---
-   // Expected input format:
-   // ( 0.0000000, 0.0000000, 0.00000000 )
-   //   -----x---- -----y---- -----z----
-   //---
-   
-   const int SZ = 64; // Handle real big number...
-   ossimString os;
-   char buf[SZ];
-   char c = 0;
-
-   //---
-   // X SECTION:
-   //---
-   
-   // Grab data up to the first comma.
-   is.get(buf, SZ, ',');
-
-   if (!is) return;
-
-   // Copy to ossim string.
-   os = buf;
-   
-   // Get rid of the '(' if there is any.
-   std::string::size_type pos = os.find('(');
-   if (pos != std::string::npos)
-   {
-      os.erase(pos, 1);
-   }   
-   
-   if (os.contains("nan") == false)
-   {
-      x = os.toFloat64();
-   }
-   else
-   {
-      x = ossim::nan();
-   }
-
-   // Eat the comma that we stopped at.
-   while (c != ',')
-   {
-      is.get(c);
-      if (!is) break;
-   }
-   
-   //---
-   // Y SECTION:
-   //---
-   
-   // Grab the data up to the next ','
-   is.get(buf, SZ, ',');
-
-   if (!is) return;
-   
-   // Copy to ossim string.
-   os = buf;
-   
-   if (os.contains("nan") == false)
-   {
-      y = os.toFloat64();
-   }
-   else
-   {
-      y = ossim::nan();
-   }
-   
-   // Eat the comma that we stopped at.
-   c = 0;
-   while (c != ',')
-   {
-      is.get(c);
-      if (!is) break;
-   }
-
-   //---
-   // Z SECTION:
-   //---
-   
-   // Grab the data up to the ')'
-   is.get(buf, SZ, ')');
-   
-   if (!is) return;
-   
-   // Copy to ossim string.
-   os = buf;
-   
-   if (os.contains("nan") == false)
-   {
-      z = os.toFloat64();
-   }
-   else
-   {
-      z = ossim::nan();
-   }
-}
-
-std::ostream& operator<< (std::ostream& out, const ossimDpt3d &rhs)
-{
-   std::string s = rhs.toString(15);
-   out << s;
-   return out;
-}
-
diff --git a/ossim/src/ossim/base/ossimDrect.cpp b/ossim/src/ossim/base/ossimDrect.cpp
deleted file mode 100644
index 923bc5f..0000000
--- a/ossim/src/ossim/base/ossimDrect.cpp
+++ /dev/null
@@ -1,854 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimDrect.
-//*******************************************************************
-//  $Id: ossimDrect.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <sstream>
-
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-// XXX not replaced with std::max since the test is backward here
-//     and will give a different answer in the case of nan.
-#define d_MAX(a,b)      (((a)>(b)) ? a : b)
-
-static int
-clip_1d (double *x0, 
-	 double *y0, 
-	 double *x1, 
-	 double *y1, 
-	 double maxdim)
-{
-   double m;			/* gradient of line */
-   if (*x0 < 0)
-   {				/* start of line is left of window */
-      if (*x1 < 0)		/* as is the end, so the line never cuts the window */
-         return 0;
-      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
-      /* adjust x0 to be on the left boundary (ie to be zero), and y0 to match */
-      *y0 -= m * *x0;
-      *x0 = 0;
-      /* now, perhaps, adjust the far end of the line as well */
-      if (*x1 > maxdim)
-      {
-         *y1 += m * (maxdim - *x1);
-         *x1 = maxdim;
-      }
-      return 1;
-   }
-   if (*x0 > maxdim)
-   {				/* start of line is right of window -
-				   complement of above */
-      if (*x1 > maxdim)		/* as is the end, so the line misses the window */
-         return 0;
-      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
-      *y0 += m * (maxdim - *x0);	/* adjust so point is on the right
-					   boundary */
-      *x0 = maxdim;
-      /* now, perhaps, adjust the end of the line */
-      if (*x1 < 0)
-      {
-         *y1 -= m * *x1;
-         *x1 = 0;
-      }
-      return 1;
-   }
-   /* the final case - the start of the line is inside the window */
-   if (*x1 > maxdim)
-   {				/* other end is outside to the right */
-      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
-      *y1 += m * (maxdim - *x1);
-      *x1 = maxdim;
-      return 1;
-   }
-   if (*x1 < 0)
-   {				/* other end is outside to the left */
-      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
-      *y1 -= m * *x1;
-      *x1 = 0;
-      return 1;
-   }
-   /* only get here if both points are inside the window */
-   return 1;
-}
-
-//*******************************************************************
-// Public Constructor: ossimDrect
-//
-//*******************************************************************
-ossimDrect::ossimDrect(const ossimIrect& rect)
-   :
-      theUlCorner(rect.ul()),
-      theUrCorner(rect.ur()),
-      theLrCorner(rect.lr()),
-      theLlCorner(rect.ll()),
-      theOrientMode(rect.orientMode())
-{
-   if(rect.isNan())
-   {
-      makeNan();
-   }
-}
-
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimDrect(const vector<ossimDpt>& points)
-//  
-//*****************************************************************************
-ossimDrect::ossimDrect(const ossimPolygon& polygon,
-                       ossimCoordSysOrientMode mode)
-   :
-      theOrientMode (mode)
-{
-   std::vector<ossimDpt> vertices;
-   ossimDpt point;
-   int index = 0;
-   while (polygon.vertex(index, point))
-   {
-      vertices.push_back(point);
-      index++;
-   }
-
-   initBoundingRect(vertices);
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimDrect(const vector<ossimDpt>& points)
-//  
-//*****************************************************************************
-ossimDrect::ossimDrect(const std::vector<ossimDpt>& points,
-                       ossimCoordSysOrientMode mode)
-   :
-      theOrientMode (mode)
-{
-  if(points.size())
-   {
-      unsigned long index;
-      double minx, miny;
-      double maxx, maxy;
-      
-      minx = points[0].x;
-      miny = points[0].y;
-      maxx = points[0].x;
-      maxy = points[0].y;
-            
-      // find the bounds
-      for(index = 1; index < points.size();index++)
-      {
-         
-         minx = std::min(minx, points[index].x);
-         miny = std::min(miny, points[index].y);
-         maxx = std::max(maxx, points[index].x);
-         maxy = std::max(maxy, points[index].y);
-         
-      }
-      if(theOrientMode == OSSIM_LEFT_HANDED)
-      {
-         *this = ossimDrect(minx, miny, maxx, maxy, mode);
-      }
-      else
-      {
-         *this = ossimDrect(minx,maxy, maxx, miny, mode);
-      }
-   }
-   else
-   {
-      makeNan();
-   }
-}
-ossimDrect::ossimDrect(const ossimDpt& p1,
-                       const ossimDpt& p2,
-                       const ossimDpt& p3,
-                       const ossimDpt& p4,
-                       ossimCoordSysOrientMode mode)
-: theOrientMode(mode)
-{
-   if(p1.hasNans()||p2.hasNans()||p3.hasNans()||p4.hasNans())
-   {
-      makeNan();
-   }
-   else
-   {
-      double minx, miny;
-      double maxx, maxy;
-      
-      minx = std::min( p1.x, std::min(p2.x, std::min(p3.x, p4.x)));
-      miny = std::min( p1.y, std::min(p2.y, std::min(p3.y, p4.y)));
-      maxx = std::max( p1.x, std::max(p2.x, std::max(p3.x, p4.x)));
-      maxy = std::max( p1.y, std::max(p2.y, std::max(p3.y, p4.y)));
-      
-      if(mode == OSSIM_LEFT_HANDED)
-      {
-         *this = ossimDrect(minx, miny, maxx, maxy, mode);
-      }
-      else
-      {            
-         *this = ossimDrect(minx,maxy, maxx, miny, mode);
-      }
-   }
-}
-
-
-//*******************************************************************
-//! Constructs an ossimDrect surrounding the specified point, and of specified size.
-//*******************************************************************
-ossimDrect::ossimDrect(const ossimDpt& center, 
-                       const double&   size_x, 
-                       const double&   size_y,
-                       ossimCoordSysOrientMode mode)
-: theOrientMode(mode)
-{
-   double dx = fabs(size_x);
-   double dy = fabs(size_y);
-
-   double minx = center.x - dx/2.0;
-   double maxx = minx + dx;
-
-   double miny = center.y - dy/2.0;
-   double maxy = miny + dy;
-
-   if(mode == OSSIM_LEFT_HANDED)
-      *this = ossimDrect(minx, miny, maxx, maxy, mode);
-   else
-      *this = ossimDrect(minx,maxy, maxx, miny, mode);
-}
-
-ossimDrect::~ossimDrect()
-{
-}
-
-void ossimDrect::initBoundingRect(const std::vector<ossimDpt>& points)
-{
-   unsigned long index;
-
-   // initialize everyone to the first point
-   if(points.size() > 0)
-   {
-      theUlCorner.x = points[0].x;
-      theUlCorner.y = points[0].y;
-      theLrCorner.x = theUlCorner.x;
-      theLrCorner.y = theUlCorner.y;
-   }
-   
-   // find the bounds
-   for(index = 1; index < points.size();index++)
-   {
-      // find left most
-      if(points[index].x < theUlCorner.x)
-         theUlCorner.x = points[index].x;
-
-      // find right most
-      else if(points[index].x > theLrCorner.x)
-         theLrCorner.x = points[index].x;
-
-      if (theOrientMode == OSSIM_LEFT_HANDED)
-      {
-         //find top most
-         if(points[index].y < theUlCorner.y)
-            theUlCorner.y = points[index].y;
-
-         // find bottom most
-         else if(points[index].y > theLrCorner.y)
-            theLrCorner.y = points[index].y;
-      }
-
-      else // right handed coord system
-      {
-         if(points[index].y > theUlCorner.y)
-            theUlCorner.y = points[index].y;
-
-         // find bottom most
-         else if(points[index].y < theLrCorner.y)
-            theLrCorner.y = points[index].y;
-      }
-   }
-
-   // now set the other points for the rect.
-   theUrCorner.x = theLrCorner.x;
-   theUrCorner.y = theUlCorner.y;
-   theLlCorner.x = theUlCorner.x;
-   theLlCorner.y = theLrCorner.y;
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-bool ossimDrect::intersects(const ossimDrect& rect) const
-{
-   if(rect.hasNans() || hasNans())
-   {
-      return false;
-   }
-   if (theOrientMode != rect.theOrientMode)
-      return false;
-   
-   ossim_float64  ulx = ossim::max(rect.ul().x,ul().x);
-   ossim_float64  lrx = ossim::min(rect.lr().x,lr().x);
-   ossim_float64  uly, lry;
-   bool rtn=false;
-   if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      uly  = ossim::max(rect.ul().y,ul().y);
-      lry  = ossim::min(rect.lr().y,lr().y);
-      rtn = ((ulx <= lrx) && (uly <= lry));
-   }
-   else
-   {
-      uly  = ossim::max(rect.ll().y,ll().y);
-      lry  = ossim::min(rect.ur().y,ur().y);
-      rtn = ((ulx <= lrx) && (uly <= lry));
-   }
-      
-   return (rtn);
-}
-
-//*******************************************************************
-// Public Method: ossimDrect::completely_within
-//*******************************************************************
-bool ossimDrect::completely_within(const ossimDrect& rect) const
-{
-   if(hasNans() || rect.hasNans())
-   {
-      return false;
-   }
-   if (theOrientMode != rect.theOrientMode)
-      return false;
-   
-   /*  --------------
-       |     1      |
-       | ---------- |
-       | |        | |
-       | |        | |
-       | |   2    | |
-       | |        | |
-       | |        | |
-       | ---------- |
-       |            |
-       --------------  */
-
-   bool rtn = true;
-   
-   if (theUlCorner.x < rect.ul().x)
-      rtn = false;
-   
-   else if (theLrCorner.x > rect.lr().x)
-      rtn = false;
-   
-   else if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      if (theUlCorner.y < rect.ul().y)
-         rtn = false;
-   
-      else if (theLrCorner.y > rect.lr().y)
-         rtn = false;
-   }
-   
-   else
-   {
-      if (theUlCorner.y > rect.ul().y)
-         rtn = false;
-   
-      else if (theLrCorner.y < rect.lr().y)
-         rtn = false;
-   }
-
-   return rtn;
-}
-
-//*******************************************************************
-// Public Method: ossimDrect::stretchOut
-//*******************************************************************
-void ossimDrect::stretchOut()
-{
-   set_ulx(floor(theUlCorner.x));
-   set_lrx(ceil(theLrCorner.x));
-
-   if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      set_uly(floor(theUlCorner.y));
-      set_lry(ceil(theLrCorner.y));
-   }
-   else
-   {
-      set_uly(ceil(theUlCorner.y));
-      set_lry(floor(theLrCorner.y));
-   }
-}
-
-void ossimDrect::stretchToTileBoundary(const ossimDpt& widthHeight)
-{
-   ossimDpt ul;
-   ossimDpt lr;
-   ossim_int32 evenDivision=0;
-
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      ul.x = theUlCorner.x;
-      if( fmod(theUlCorner.x, widthHeight.x) != 0)
-      {
-         ul.x = ((long)(ul.x / widthHeight.x))*widthHeight.x;
-         if(ul.x > theUlCorner.x)
-         {
-            ul.x -= widthHeight.x;
-         }
-      }
-      ul.y = theUlCorner.y;
-      if( fmod(theUlCorner.y, widthHeight.y) != 0)
-      {
-         ul.y = ((long)(ul.y / widthHeight.y))*widthHeight.y;
-         if(ul.y > theUlCorner.y)
-         {
-            ul.y -= widthHeight.y;
-         }
-      }
-      
-      evenDivision = fmod(theLrCorner.x, widthHeight.x) == 0;
-      lr.x = theLrCorner.x;
-      if(!evenDivision)
-      {
-         lr.x = ((long)((lr.x)/widthHeight.x)) * widthHeight.x;
-         if(lr.x < theLrCorner.x)
-         {
-            lr.x += widthHeight.x;
-         }
-      }
-
-      evenDivision = fmod(theLrCorner.y, widthHeight.y) == 0;
-      lr.y = theLrCorner.y;
-      if(!evenDivision)
-      {
-         lr.y = ((long)(lr.y/widthHeight.y)) * widthHeight.y;
-         if(lr.y < theLrCorner.y)
-         {
-            lr.y += widthHeight.y;
-         }
-      }
-   }
-   else
-   {
-      ul.x = theUlCorner.x;
-      ul.y = theUlCorner.y;
-      if( !ossim::almostEqual(fmod(theUlCorner.x, widthHeight.x), 0.0))
-      {
-         ul.x = ((long)(ul.x/ widthHeight.x))*widthHeight.x;
-         if(ul.x > theUlCorner.x)
-         {
-            ul.x -= widthHeight.x;
-         }
-      }
-      if( !ossim::almostEqual((double)fmod(theUlCorner.y, widthHeight.y), 0.0) )
-      {
-         ul.y = ((long)(ul.y / widthHeight.y))*widthHeight.y;
-         if(ul.y < theUlCorner.y)
-         {
-            ul.y += widthHeight.y;
-         }
-      }
-      
-      evenDivision = ossim::almostEqual( fmod(theLrCorner.x, widthHeight.x), 0.0);
-      lr.x = theLrCorner.x;
-      if(!evenDivision)
-      {
-         lr.x = ((long)(lr.x/widthHeight.x)) * widthHeight.x;
-         if(lr.x < theLrCorner.x)
-         {
-            lr.x += widthHeight.x;
-         }
-      }
-
-      evenDivision = ossim::almostEqual(fmod(theLrCorner.y, widthHeight.y), 0.0);
-      lr.y = theLrCorner.y;
-      if(!evenDivision)
-      {
-         lr.y = ((long)(lr.y/widthHeight.y)) * widthHeight.y;
-
-         if(lr.y > theLrCorner.y)
-         {
-            lr.y -= widthHeight.y;
-         }
-      }
-  }
-
-   *this = ossimDrect(ul, lr, theOrientMode);
-}
-
-const ossimDrect& ossimDrect::expand(const ossimDpt& padding)
-{
-   theUlCorner.x -= padding.x;
-   theUrCorner.x += padding.x;
-   theLrCorner.x += padding.x;
-   theLlCorner.x -= padding.x;
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      theUlCorner.y -= padding.y;
-      theUrCorner.y -= padding.y;
-      theLrCorner.y += padding.y;
-      theLlCorner.y += padding.y;
-   }
-   else
-   {
-      theUlCorner.y += padding.y;
-      theUrCorner.y += padding.y;
-      theLrCorner.y -= padding.y;
-      theLlCorner.y -= padding.y;
-   }
-   
-   return *this;
-}
-ossimString ossimDrect::toString()const
-{
-   ossimString result="(";
-   
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      ossimDpt origin = ul();
-      result += (ossimString::toString(origin.x,20) + ",");
-      result += (ossimString::toString(origin.y,20) + ",");
-      result += (ossimString::toString(width(),20) + ",");
-      result += (ossimString::toString(height(),20) + ",");
-      result += "LH";
-   }
-   else 
-   {
-      ossimDpt origin = ll();
-      result += (ossimString::toString(origin.x,20) + ",");
-      result += (ossimString::toString(origin.y,20) + ",");
-      result += (ossimString::toString(width(),20) + ",");
-      result += (ossimString::toString(height(),20) + ",");
-      result += "RH";
-   }
-   
-   result += ")";
-   return result;
-}
-
-bool ossimDrect::toRect(const ossimString& rectString)
-{
-   bool result = false;
-   
-   
-   std::istringstream in(rectString);
-   ossim::skipws(in);
-   char charString[2];
-   charString[1] = '\0';
-   ossimString interior;
-   if(in.peek() == '(')
-   {
-      in.ignore();
-      while((in.peek() != ')')&&
-            (in.peek() != '\n') &&
-            in.good())
-      {
-         charString[0] = in.get();
-         interior += charString;
-      }
-      if(in.peek() == ')')
-      {
-         result = true;
-      }
-   }
-   if(result)
-   {
-      std::vector<ossimString> splitArray;
-      interior.split(splitArray, ",");
-      
-      // assume left handed
-      if(splitArray.size() >= 4)
-      {
-         ossim_float64 x = splitArray[0].toDouble();
-         ossim_float64 y = splitArray[1].toDouble();
-         ossim_float64 w = splitArray[2].toDouble();
-         ossim_float64 h = splitArray[3].toDouble();
-         ossimString orientation = "lh";
-         if(splitArray.size() == 5)
-         {
-            orientation = splitArray[4].downcase();
-         }
-         if(orientation == "lh")
-         {
-            // origin upper left
-            *this = ossimDrect(x,y,x + (w-1), y+h-1, OSSIM_LEFT_HANDED);
-         }
-         else 
-         {
-            // origin lower left so construct and make an upper left
-            *this = ossimDrect(x,y+(h-1),x + (w-1), y, OSSIM_RIGHT_HANDED);
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      
-   }
-   return result;
-}
-
-bool ossimDrect::saveState(ossimKeywordlist& kwl,
-                           const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           "ossimDrect",
-           true);
-
-   kwl.add(prefix, "rect", toString());
-
-   return true;
-}
-
-bool ossimDrect::loadState(const ossimKeywordlist& kwl,
-                           const char* prefix)
-{
-  const char* rect = kwl.find(prefix, "rect");
-  makeNan();
-
-  if(rect)
-  {
-      toRect(rect);
-  }
-   
-   return true;
-}
-
-//*******************************************************************
-// Public Method: ossimDrect::print
-//*******************************************************************
-void ossimDrect::print(std::ostream& os) const
-{
-   os << toString();
-}
-
-//*******************************************************************
-// friend function: operator<<
-//*******************************************************************
-std::ostream& operator<<(std::ostream& os, const ossimDrect& rect)
-{
-   rect.print(os);
-
-   return os;
-}
-
-//*******************************************************************
-// Public Method: ossimDrect::clip
-//*******************************************************************
-bool ossimDrect::clip(ossimDpt &p1, ossimDpt &p2)const
-{
-   if(p1.isNan() || p2.isNan())
-   {
-      return false;
-   }
-   ossimDpt shift(-theUlCorner.x,
-		  -theUlCorner.y);
-
-   ossimDpt tempShiftP1 = p1+shift;
-   ossimDpt tempShiftP2 = p2+shift;
-   double maxW = width()-1;
-   double maxH = height()-1;
-   if (clip_1d (&tempShiftP1.x, &tempShiftP1.y, 
-                &tempShiftP2.x, &tempShiftP2.y, 
-                maxW) == 0)
-   {
-      return false;
-   }
-   if(clip_1d (&tempShiftP1.y, 
-               &tempShiftP1.x, 
-               &tempShiftP2.y, 
-               &tempShiftP2.x, maxH) == 0)
-   {
-      return false;
-   }
-   p1 = tempShiftP1-shift;
-   p2 = tempShiftP2-shift;
-   return true;
-}
-
-//*******************************************************************
-// Public Method: ossimDrect::getCode
-//*******************************************************************
-long ossimDrect::getCode(const ossimDpt& aPoint,
-                         const ossimDrect& clipRect)
-{
-   long result=NONE; // initialize to inside rect
-   
-   if( (aPoint.x > clipRect.lr().x) )
-      result |= RIGHT;
-   else if( (aPoint.x < clipRect.ul().x) )
-      result |= LEFT;
-
-   if (clipRect.theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      if( (aPoint.y < clipRect.ul().y) )
-         result |= TOP;
-      else if( (aPoint.y > clipRect.lr().y) )
-         result |= BOTTOM;
-   }
-   else
-   {
-      if( (aPoint.y > clipRect.ul().y) )
-         result |= TOP;
-      else if( (aPoint.y < clipRect.lr().y) )
-         result |= BOTTOM;
-   }
-      
-   return result;
-}
-
-
-void ossimDrect::splitToQuad(ossimDrect& ulRect,
-                             ossimDrect& urRect,
-                             ossimDrect& lrRect,
-                             ossimDrect& llRect)
-{
-   ossimDpt ulPt  = this->ul();
-   ossimDpt urPt  = this->ur();
-   ossimDpt lrPt  = this->lr();
-   ossimDpt llPt  = this->ll();
-   ossimIpt midPt = this->midPoint();
-   
-   ulRect = ossimDrect(ulPt.x,
-                       ulPt.y,
-                       midPt.x,
-                       midPt.y,
-                       theOrientMode);
-   
-   urRect = ossimDrect(midPt.x,
-                       ulPt.y,
-                       urPt.x,
-                       midPt.y,
-                       theOrientMode);
-   
-   if(theOrientMode  == OSSIM_LEFT_HANDED)
-   {
-      lrRect = ossimDrect(midPt.x,
-                          midPt.y,
-                          lrPt.x,
-                          theOrientMode);
-      llRect = ossimDrect(ulPt.x,
-                          midPt.y,
-                          midPt.x,
-                          llPt.y,
-                          theOrientMode);
-   }
-   else
-   {       
-      lrRect = ossimDrect(midPt.x,
-                          midPt.y,
-                          lrPt.x,
-                          theOrientMode);
-      llRect = ossimDrect(ulPt.x,
-                          midPt.y,
-                          midPt.x,
-                          llPt.y,
-                          theOrientMode);       
-   }
-   
-}
-
-//*******************************************************************
-// Public Method: ossimDrect::clipToRect
-//*******************************************************************
-ossimDrect ossimDrect::clipToRect(const ossimDrect& rect)const
-{
-   ossimDrect result;
-   result.makeNan();
-   if(rect.hasNans() || hasNans())
-   {
-      return result;
-   }
-   
-   if (theOrientMode != rect.theOrientMode)
-      return (*this);
-
-   double x0 = ossim::max(rect.ul().x, ul().x);
-   double x1 = ossim::min(rect.lr().x, lr().x);
-   double y0, y1;
-
-   if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      y0 = ossim::max(rect.ul().y, ul().y);
-      y1 = ossim::min(rect.lr().y, lr().y);
-
-      if( (x1 < x0) || (y1 < y0) )
-      {
-         return result;
-      }
-      else
-      {
-         result = ossimDrect(x0, y0, x1, y1, theOrientMode);
-      }
-   }
-   else
-   {
-      y0 = ossim::max(rect.ll().y,ll().y);
-      y1 = ossim::min(rect.ur().y,ur().y);
-      if( (x1 < x0) || (y1 < y0) )
-      {
-         return result;
-      }
-      else
-      {
-         result = ossimDrect(x0, y1, x1, y0, theOrientMode);
-      }
-   }
-   return result;
-}
-
-const ossimDrect& ossimDrect::operator=(const ossimIrect& rect)
-{
-   if(rect.isNan())
-   {
-      makeNan();
-   }
-   else
-   {
-      theUlCorner   = rect.ul();
-      theUrCorner   = rect.ur();
-      theLrCorner   = rect.lr();
-      theLlCorner   = rect.ll();
-      theOrientMode = rect.orientMode();
-   }
-   
-   return *this;
-}
-
-//*************************************************************************************************
-// Finds the point on the rect boundary that is closest to the arg_point. Closest is defined as
-// the minimum perpendicular distance.
-//*************************************************************************************************
-ossimDpt ossimDrect::findClosestEdgePointTo(const ossimDpt& arg_point) const
-{
-   double dXleft  = theUlCorner.x - arg_point.x;
-   double dXright = theLrCorner.x - arg_point.x;
-   double dYupper = theUlCorner.y - arg_point.y;
-   double dYlower = theLrCorner.y - arg_point.y;
-
-   ossimDpt edge_point (theLrCorner);
-
-   if (dXleft*dXright < 0.0)
-      edge_point.x = arg_point.x;
-   else if (fabs(dXleft) < fabs(dXright))
-      edge_point.x = theUlCorner.x;
-
-   if (dYupper*dYlower < 0.0)
-      edge_point.y = arg_point.y;
-   else if (fabs(dYupper) < fabs(dYlower))
-      edge_point.y = theUlCorner.y;
-
-   return edge_point;
-}
-
-
diff --git a/ossim/src/ossim/base/ossimDuration.cpp b/ossim/src/ossim/base/ossimDuration.cpp
deleted file mode 100644
index 3867bf1..0000000
--- a/ossim/src/ossim/base/ossimDuration.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id$
-#include <ossim/base/ossimDuration.h>
-#include <ossim/base/ossimCommon.h>
-#include <sstream>
-#include <cctype>
-ossimDuration::ossimDuration(const ossimString& iso8601Duration)
-:theSign(1),
-theYears(0),
-theMonths(0),
-theWeeks(0),
-theDays(0),
-theHours(0),
-theMinutes(0),
-theSeconds(0)
-{
-   if(!iso8601Duration.empty())
-   {
-      setByIso8601DurationString(iso8601Duration);
-   }
-}
-
-void ossimDuration::clearFields()
-{
-   theSign = 1; 
-   theYears = 0;
-   theMonths = 0;
-   theWeeks = 0;
-   theDays = 0;
-   theHours = 0;
-   theMinutes = 0;
-   theSeconds = 0; 
-}
-
-static bool isWhiteSpace(int c)
-{
-   return ((c==' ') ||
-           (c=='\n')||
-           (c=='\r')||
-           (c=='\t'));
-}
-
-bool ossimDuration::readIso8601Encoding(std::istream& in)
-{
-   clearFields();
-   
-   if(in.peek()=='-')
-   {
-      theSign = -1;
-      in.ignore();
-   }
-   if(in.peek()!='P')
-   {
-      return false;
-   }
-   // skip the period indicater
-   in.ignore();
-   
-   // now we start parsing the date portion and the time portion
-   ossimString value;
-   bool doneFlag     = false;
-   bool badParseFlag = false;
-   bool doingTimeFlag = false;
-   while(!doneFlag)
-   {
-      int c = in.peek();
-      if(!in)
-      {
-         doneFlag = true;
-      }
-      else
-      {
-         if(isWhiteSpace(c))
-         {
-            doneFlag = true; // parse til blank character is met
-         }
-         else if(isalpha(c))
-         {
-            // we are done with current value 
-            //
-            // check to see if was a Time seaprator of value
-            // 'T'
-            if(c == 'T')
-            {
-               // then it was a time separator so do nothing
-               value = ""; // go ahead and null it out for now
-               doingTimeFlag = true; // now in time parsing portion
-            }
-            else
-            {
-               if(doingTimeFlag)
-               {
-                  // check time values
-                  if(c == 'H')
-                  {
-                     theHours = value.toUInt64();
-                  }
-                  else if(c == 'M')
-                  {
-                     theMinutes = value.toUInt64();
-                  }
-                  else if(c == 'S')
-                  {
-                     theSeconds = value.toFloat64();
-                  }
-                  else
-                  {
-                     doneFlag = true;
-                     badParseFlag = true;
-                  }
-                  value = ""; // reset the value
-               }
-               else // check date characters instead
-               {
-                  if(c == 'Y')
-                  {
-                     theYears = value.toUInt64();
-                  }
-                  else if(c == 'M')
-                  {
-                     theMonths = value.toUInt64();
-                  }
-                  else if(c == 'W')
-                  {
-                     theWeeks = value.toUInt64();
-                  }
-                  else if(c == 'D')
-                  {
-                     theDays = value.toUInt64();
-                  }
-                  else
-                  {
-                     doneFlag = true;
-                     badParseFlag = true;
-                  }
-                  value = ""; // reset the value
-               }
-            }
-         }
-         else if(isdigit(c)||(c=='.'))// not an alphabetic character so add it to the value string
-         {
-            value += static_cast<char>(c);
-         }
-         else
-         {
-            doneFlag = true;
-            badParseFlag = true;
-         }
-      }
-      if(!doneFlag)
-      {
-         in.ignore();
-      }
-   }
-   
-   return badParseFlag;
-}
-
-bool ossimDuration::setByIso8601DurationString(const ossimString& iso8601Duration)
-{
-   if(iso8601Duration.empty())
-   {
-      clearFields();
-      return true;
-   }
-   std::istringstream in(iso8601Duration);
-   return readIso8601Encoding(in);
-}
-
-void ossimDuration::toIso8601DurationString(ossimString& result)
-{
-   result = "";
-   bool hasDatePeriod = ((theYears!=0)||
-                         (theMonths!=0)||
-                         (theWeeks!=0)||
-                         (theDays!=0));
-   bool hasTimePeriod = ((theHours!=0)||
-                         (theMinutes!=0)||
-                         (!ossim::almostEqual(theSeconds, 0.0, .00000000001)));
-   // if no time or date period present then return empty
-   if(!(hasDatePeriod || hasTimePeriod))
-   {
-      return;
-   }
-   if(theSign < 0)
-   {
-      result += "-";
-   }
-   result += "P";
-   if(hasDatePeriod)
-   {
-      if(theYears > 0)
-      {
-         result+=ossimString::toString(theYears);
-         result+="Y";
-      }
-      if(theMonths>0)
-      {
-         result+=ossimString::toString(theMonths);
-         result+="M";
-      }
-      if(theWeeks>0)
-      {
-         result+=ossimString::toString(theWeeks);
-         result+="W";
-      }
-      if(theDays>0)
-      {
-         result+=ossimString::toString(theDays);
-         result+="D";
-      }
-   }
-   if(hasTimePeriod)
-   {
-      result+="T";
-      if(theHours>0)
-      {
-         result+=ossimString::toString(theHours);
-         result+="H";
-      }
-      if(theMinutes>0)
-      {
-         result+=ossimString::toString(theMinutes);
-         result+="M";
-      }
-      if(theSeconds>0)
-      {
-         result+=ossimString::toString(theSeconds, 15);
-         result+="S";
-      }
-   }
-}
-
-ossim_float64 ossimDuration::toSeconds()const
-{
-   ossim_float64 result = theSeconds;
-   
-   if(theMinutes > 0)
-   {
-      result += theMinutes*60.0;
-   }
-   if(theHours > 0)
-   {
-      result += theHours*3600.0;
-   }
-   if(theDays > 0)
-   {
-      result += theDays*86400.0;
-   }
-   if(theWeeks > 0)
-   {
-      result += theWeeks*604800;
-   }
-   if(theSign < 0)
-   {
-      result *= -1.0;
-   }
-   return result;
-}
-
-
-
diff --git a/ossim/src/ossim/base/ossimElevationManagerEventListener.cpp b/ossim/src/ossim/base/ossimElevationManagerEventListener.cpp
deleted file mode 100644
index d3a4576..0000000
--- a/ossim/src/ossim/base/ossimElevationManagerEventListener.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <ossim/base/ossimElevationManagerEventListener.h>
-#include <ossim/base/ossimElevationManagerEvent.h>
-
-RTTI_DEF1(ossimElevationManagerEventListener, "ossimElevationManagerEventListener",
-          ossimListener);
-
-ossimElevationManagerEventListener::ossimElevationManagerEventListener()
-      : ossimListener()
-{
-}
-
-
-ossimElevationManagerEventListener::~ossimElevationManagerEventListener()
-{
-}
-
-void ossimElevationManagerEventListener::processEvent( ossimEvent& event )
-{
-   ossimElevationManagerEvent* elevationManagerEvent =
-      PTR_CAST( ossimElevationManagerEvent, &event );
-
-   if ( elevationManagerEvent )
-   {
-      processEvent( *elevationManagerEvent );
-   }
-}
-
-void ossimElevationManagerEventListener::processEvent( ossimElevationManagerEvent& /* event */)
-{
-
-}
diff --git a/ossim/src/ossim/base/ossimEllipsoid.cpp b/ossim/src/ossim/base/ossimEllipsoid.cpp
deleted file mode 100644
index aed940b..0000000
--- a/ossim/src/ossim/base/ossimEllipsoid.cpp
+++ /dev/null
@@ -1,691 +0,0 @@
-///*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// DESCRIPTION:
-//   Contains implementation of class ossimEllipsoid. The implementation is
-//   actually for an OBLATE SPHEROID (x.radius = y.radius) as Earth is
-//   considered.
-//
-// SOFTWARE HISTORY:
-//>
-//   06Aug2001  Garrett Potts, Oscar Kramer
-//              Initial coding.
-//<
-//*****************************************************************************
-//  $Id: ossimEllipsoid.cpp 22858 2014-08-05 17:24:50Z dburken $
-
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimEllipsoidFactory.h>
-#include <ossim/base/ossimEcefRay.h>
-#include <ossim/base/ossimEcefPoint.h>
-#include <ossim/base/ossimEcefVector.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimMatrix4x4.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-#include <cmath>
-static ossimTrace traceExec  ("ossimEllipsoid:exec");
-static ossimTrace traceDebug ("ossimEllipsoid:debug");
-
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimEllipsoid #1 (COPY)
-//  
-//*****************************************************************************
-ossimEllipsoid::ossimEllipsoid(const ossimEllipsoid &ellipsoid)
-   :
-      theName(ellipsoid.theName),
-      theCode(ellipsoid.theCode),
-      theEpsgCode(ellipsoid.theEpsgCode),
-      theA(ellipsoid.theA),
-      theB(ellipsoid.theB),
-      theFlattening(ellipsoid.theFlattening),
-      theA_squared(ellipsoid.theA_squared),
-      theB_squared(ellipsoid.theB_squared),
-      theEccentricitySquared(ellipsoid.theEccentricitySquared)
-{
-   if ( theEpsgCode == 0 )
-   {
-      theEpsgCode = ossimEllipsoidFactory::instance()->findEpsgCode(theCode);
-   }
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimEllipsoid #2
-//  
-//*****************************************************************************
-ossimEllipsoid::ossimEllipsoid(const ossimString &name,
-                               const ossimString &code,
-                               const double &a,
-                               const double &b,
-                               ossim_uint32 epsg_code)
-   :
-      theName(name),
-      theCode(code),
-      theEpsgCode(epsg_code),
-      theA(a),
-      theB(b),
-      theA_squared(a*a),
-      theB_squared(b*b)
-{
-   if (theEpsgCode == 0)
-   {
-      theEpsgCode = ossimEllipsoidFactory::instance()->findEpsgCode(theCode);
-   }
-
-   computeFlattening();   
-   theEccentricitySquared = 2*theFlattening - theFlattening*theFlattening;
-}
-
-ossimEllipsoid::ossimEllipsoid()
-{
-   const ossimEllipsoid* ellipse = ossimEllipsoidFactory::instance()->wgs84();
-   
-   *this = *ellipse;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimEllipsoid #3
-//  
-//*****************************************************************************
-ossimEllipsoid::ossimEllipsoid(const double &a,
-                               const double &b)
-   :
-      theName(""), // initialize to empty
-      theCode(""),
-      theEpsgCode(0),
-      theA(a),
-      theB(b),
-      theA_squared(a*a),
-      theB_squared(b*b)
-{
-   // First check if this is just WGS84:
-   const ossimEllipsoid* wgs84 = ossimEllipsoidFactory::instance()->wgs84();
-   if ((theA == wgs84->theA) && (theB == wgs84->theB))
-   {
-      *this = *wgs84;
-   }
-   else
-   {
-      computeFlattening();
-      theEccentricitySquared = 2*theFlattening - theFlattening*theFlattening;
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::nearestIntersection
-//  
-//*****************************************************************************
-bool ossimEllipsoid::nearestIntersection(const ossimEcefRay &ray,
-                                         ossimEcefPoint& rtnPt) const
-{
-   return nearestIntersection(ray, 0.0, rtnPt);
-}
-
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::nearestIntersection
-//  
-//   geographic objects that are derive this class will asssume that
-//   the reference datum is wgs84 and that the ray origin is a
-//   geocentric coordinate relative to the wgs84 datum.  Will return
-//   true if the object was intersected and false otherwise.
-//  
-//   The nearest intersection will use the ray sphere intersection
-//   found in most ray tracers.  We will take a Ray defined by the
-//   parametric equation:
-//  
-//     x = x0 + dxt
-//     y = y0 + dyt
-//     z = z0 + dzt
-//  
-//   and intersect this with the equation of a spheroid:
-//  
-//     x^2/theXRadius^2 + y^2/theYRadius^2 + z^2/theZRadius^2 = 1
-//  
-//  
-//   the intersection is achived by substituting the parametric line
-//   into the equation of the sphereroid.  By doing this you should
-//   get a quadratic in t and the equation should look like this:
-//  
-//    a*t^2 + b*t + c = 0
-//  
-//      let a = dx^2/theXRadius^2 + dy^2/theYRadius^2 + dz^2/theZRadius^2
-//      let b = 2*(x0*dx/theXRadius^2 +y0*dy/theYRadius^2 + z0*dz/theZRadius^2
-//      let c = x0^2/theXRadius^2 + y0^2/theYRadius^2 + z0^2/theZRadius^2 - 1
-//  
-//  
-//    Now solve the quadratic (-b +- sqrt(b^2 - 4ac) ) / 2a
-//  
-//    After solving for t, the parameter is applied to the ray to determine
-//    the 3D point position in X,Y,Z, passed back in rtnPt. The boolean
-//    "true" is returned if an intersection was found.
-//
-//*****************************************************************************
-bool ossimEllipsoid::nearestIntersection(const ossimEcefRay& ray,
-                                         const double&       offset,
-                                         ossimEcefPoint&     rtnPt) const
-{
-   static const char MODULE[] = "ossimEllipsoid::nearestIntersection";
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: " << MODULE << ", entering...\n";
-
-   
-   double A_squared = (theA + offset)*(theA + offset);
-   double B_squared = (theB + offset)*(theB + offset);
-
-//    double adjustedOffset = offset/theA;
-//    double bOverA = theB/theA;
-//    double A_squared = (1.0+adjustedOffset)*(1.0+adjustedOffset);
-//    double B_squared = ((bOverA+adjustedOffset)*(bOverA+adjustedOffset));//(theB + offset)*(theB + offset);
-   
-   //***
-   // get the origin and direction of ray:
-   //***
-   ossimEcefPoint  start = ray.origin();   
-   ossimEcefVector direction = ray.direction();
-//    start = ossimEcefPoint(start.x()/theA,
-//                           start.y()/theA,
-//                           start.z()/theA);
-   //***
-   // Solve the coefficents of the quadratic formula
-   //***
-   double a = ((direction.x() * direction.x())/A_squared) +
-              ((direction.y() * direction.y())/A_squared) +
-              ((direction.z() * direction.z())/B_squared);
-
-   double b = 2.0*( ((start.x()*direction.x())/A_squared) +
-                    ((start.y()*direction.y())/A_squared) +
-                    ((start.z()*direction.z())/B_squared) );
-
-   double c = ((start.x()*start.x())/A_squared) +
-              ((start.y()*start.y())/A_squared) +
-              ((start.z()*start.z())/B_squared) - 1.0;
-   
-   //***
-   // solve the quadratic
-   //***
-   double root = b*b - 4*a*c;
-   double t;
-   if(root < 0.0)
-   {
-      return false;
-   }
-   else
-   {
-      double squareRoot = sqrt(root);
-      double t1 = (-b + squareRoot ) / (2.0*a);
-      double t2 = (-b - squareRoot ) / (2.0*a);
-
-      //***
-      // sort t1 and t2 and take the nearest intersection if they
-      // are in front of the ray.
-      //***
-      if(t2 < t1)
-      {
-         double temp = t1;
-         t1 = t2;
-         t2 = temp;
-      }     
-
-       if(t1 > 0.0)
-          t = t1;
-       else
-          t = t2;
-//      t = t1;
-   }
-
-   //***
-   // Now apply solved t to ray to extrapolate correct distance to intersection
-   //***
-//    bool rtnval = false;
-//    if (t >= 0)
-//    {
-//       rtnval = true;
-//       rtnPt  = ray.extend(t); 
-// //       rtnPt  = ray.extend(t*theA); 
-//    }
-      
-   bool rtnval = true;
-   rtnPt  = ray.extend(t); 
-
-   return rtnval; 
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::evaluate(ossimColumnVector3d)
-//  
-//  Returns neg number if inside, 0 if on, and pos number if outside of
-//  ellipsoid.
-//  
-//*****************************************************************************
-double ossimEllipsoid::evaluate(const ossimEcefPoint &location)const
-{
-   //***
-   // get the axis
-   //***
-   return (((location.x() * location.x())/theA_squared) +
-           ((location.y() * location.y())/theA_squared) +
-           ((location.z() * location.z())/theB_squared) - 1.0);   
-}
- 
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::gradient()  version A
-//  
-//  Returns vector normal to the ellipsoid at point specified.
-//  
-//*****************************************************************************
-void ossimEllipsoid::gradient(const ossimEcefPoint& location,
-                              ossimEcefVector&      result) const
-{
-   result.x() = (2.0*location.x())/theA_squared;
-   result.y() = (2.0*location.y())/theA_squared;
-   result.z() = (2.0*location.z())/theB_squared;
-}
-
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::gradient()  version B
-//  
-//  Returns vector normal to the ellipsoid at point specified.
-//  
-//*****************************************************************************
-ossimEcefVector
-ossimEllipsoid::gradient(const ossimEcefPoint &location)const
-{
-   ossimEcefVector result;
-   gradient(location, result);
-   return result;
-}
-   
-   
-bool ossimEllipsoid::loadState(const ossimKeywordlist& kwl,
-                               const char* prefix)
-{
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::ELLIPSE_CODE_KW);
-   bool foundCode = false;
-   if(lookup)
-   {
-      const ossimEllipsoid* ellipse = ossimEllipsoidFactory::instance()->create(ossimString(lookup));
-
-      if(ellipse)
-      {
-         foundCode = true;
-         *this = *ellipse;
-      }
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::ELLIPSE_EPSG_CODE_KW);
-   if (lookup)
-   {
-      theEpsgCode = ossimString(lookup).toUInt32();
-   }
-
-   if(!foundCode)
-   {     
-      const char* majorAxis = kwl.find(prefix,
-                                       ossimKeywordNames::MAJOR_AXIS_KW);
-      const char* minorAxis = kwl.find(prefix,
-                                       ossimKeywordNames::MAJOR_AXIS_KW);
-
-      theName = "";
-      theCode = "";
-      if(majorAxis && minorAxis)
-      {
-         theA = ossimString(majorAxis).toDouble();
-         theB = ossimString(minorAxis).toDouble();
-
-         computeFlattening();
-         theA_squared = theA*theA;
-         theB_squared = theB*theB;
-      }
-      else
-      {
-         const ossimEllipsoid* ellipse = ossimEllipsoidFactory::instance()->wgs84();
-         
-         *this = *ellipse;
-      }      
-   }
-
-   return true;
-}
-
-bool ossimEllipsoid::saveState(ossimKeywordlist& kwl,
-                               const char* prefix)const
-{
-   if(theCode != "")
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::ELLIPSE_CODE_KW,
-              theCode.c_str(),
-              true);
-
-      kwl.add(prefix,
-              ossimKeywordNames::ELLIPSE_NAME_KW,
-              theName.c_str(),
-              true);
-   }
-   if (theEpsgCode)
-   {
-      kwl.add(prefix, ossimKeywordNames::ELLIPSE_EPSG_CODE_KW, theEpsgCode, true);
-   }
-
-   kwl.add(prefix,
-           ossimKeywordNames::MAJOR_AXIS_KW,
-           theA,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::MINOR_AXIS_KW,
-           theB,
-           true);
-
-   return true;
-}
-
- 
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::prinRadiiOfCurv()
-//  
-//  Computes the meridional radius and prime vertical at given point.
-//  
-//*****************************************************************************
-void ossimEllipsoid::prinRadiiOfCurv(const ossimEcefPoint& location,
-                                           double& merRadius,
-                                           double& primeVert) const
-{
-   double lat, lon, hgt;
-   XYZToLatLonHeight(location.x(), location.y(), location.z(), lat, lon, hgt);
-   
-   double sinPhi = sin(lat*RAD_PER_DEG);
-   double phiFac = 1.0 - theEccentricitySquared*sinPhi*sinPhi;
-   primeVert = theA / sqrt(phiFac);
-   merRadius = theA*(1.0-theEccentricitySquared) / sqrt(phiFac*phiFac*phiFac);
-}
-
- 
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::jacobianWrtEcef()
-//  
-//  Forms Jacobian of partials of geodetic WRT ECF at given point.
-//           -                           -
-//           | pLat/pX  pLat/pY  pLat/pZ |
-//    jMat = | pLon/pX  pLon/pY  pLon/pZ |
-//           | pHgt/pX  pHgt/pY  pHgt/pZ |
-//           -                           -
-//  
-//*****************************************************************************
-void ossimEllipsoid::jacobianWrtEcef(const ossimEcefPoint& location,
-                                           NEWMAT::Matrix& jMat) const
-{
-   double primeVert;
-   double merRadius;
-   double lat, lon, hgt;
-   
-   XYZToLatLonHeight(location.x(), location.y(), location.z(), lat, lon, hgt);
-   prinRadiiOfCurv(location, merRadius, primeVert);
-   
-   double sinPhi = sin(lat*RAD_PER_DEG);
-   double cosPhi = cos(lat*RAD_PER_DEG);
-   double sinLam = sin(lon*RAD_PER_DEG);
-   double cosLam = cos(lon*RAD_PER_DEG);
-   double N_plus_h = primeVert + hgt;
-   double M_plus_h = merRadius + hgt;
-   
-   jMat(1,1) = -sinPhi * cosLam / M_plus_h;
-   jMat(2,1) = -sinLam / (cosPhi * N_plus_h);
-   jMat(3,1) = cosPhi * cosLam;
-   jMat(1,2) = -sinPhi * sinLam / M_plus_h;
-   jMat(2,2) =  cosLam / (cosPhi * N_plus_h);
-   jMat(3,2) = cosPhi * sinLam;
-   jMat(1,3) = cosPhi / M_plus_h;
-   jMat(2,3) = 0.0;
-   jMat(3,3) = sinPhi;
-}
-
- 
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::jacobianWrtGeo()
-//  
-//  Forms Jacobian of partials of ECF WRT geodetic at given point.
-//           -                           -
-//           | pX/pLat  pX/pLon  pX/pHgt |
-//    jMat = | pY/pLat  pY/pLon  pY/pHgt |
-//           | pZ/pLat  pZ/pLon  pZ/pHgt |
-//           -                           -
-//  
-//*****************************************************************************
-void ossimEllipsoid::jacobianWrtGeo(const ossimEcefPoint& location,
-                                          NEWMAT::Matrix& jMat) const
-{
-   double primeVert;
-   double merRadius;
-   double lat, lon, hgt;
-   
-   XYZToLatLonHeight(location.x(), location.y(), location.z(), lat, lon, hgt);
-   prinRadiiOfCurv(location, merRadius, primeVert);
-   
-   double sinPhi = sin(lat*RAD_PER_DEG);
-   double cosPhi = cos(lat*RAD_PER_DEG);
-   double sinLam = sin(lon*RAD_PER_DEG);
-   double cosLam = cos(lon*RAD_PER_DEG);
-   double N_plus_h = primeVert + hgt;
-   double M_plus_h = merRadius + hgt;
-   
-   jMat(1,1) = -M_plus_h * sinPhi * cosLam;
-   jMat(2,1) = -M_plus_h * sinPhi * sinLam;
-   jMat(3,1) =  M_plus_h * cosPhi;
-   jMat(1,2) = -N_plus_h * cosPhi * sinLam;
-   jMat(2,2) =  N_plus_h * cosPhi * cosLam;
-   jMat(3,2) = 0.0;
-   jMat(1,3) = cosPhi * cosLam;
-   jMat(2,3) = cosPhi * sinLam;
-   jMat(3,3) = sinPhi;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimEllipsoid::geodeticRadius()
-//  
-//  Computes the "geodetic" radius for a given latitude in degrees
-//  
-//*****************************************************************************
-double ossimEllipsoid::geodeticRadius(const double& lat) const
-{
-   double cos_lat = ossim::cosd(lat);
-   double sin_lat = ossim::sind(lat);
-   double cos2_lat = cos_lat*cos_lat;
-   double sin2_lat = sin_lat*sin_lat;
-   double a2_cos = theA_squared*cos_lat;
-   double b2_sin = theB_squared*sin_lat;
-   
-   return sqrt( ( (a2_cos*a2_cos) + (b2_sin*b2_sin) )/ (theA_squared*cos2_lat + theB_squared*sin2_lat));
-}
-
-//*************************************************************************************************
-//  Computes the "geodetic" radius of curvature of the ellipsoid in the east-west (x) and
-//  north-south (y) directions for a given latitude in DEGREES.
-//  Taken from http://en.wikipedia.org/wiki/Earth_radius
-//*************************************************************************************************
-void ossimEllipsoid::geodeticRadii(const double& lat, ossimDpt& radii) const
-{
-   double cos_lat = ossim::cosd(lat);
-   double sin_lat = ossim::sind(lat);
-   double cos2_lat = cos_lat*cos_lat;
-   double sin2_lat = sin_lat*sin_lat;
-   double H = theA_squared*cos2_lat + theB_squared*sin2_lat;
-   double H3 = H*H*H;
-
-   radii.x = theA_squared/sqrt(H);
-   radii.y = theA_squared*theB_squared/sqrt(H3);
-}
-
-void ossimEllipsoid::latLonHeightToXYZ(double lat, double lon, double height,
-                                       double &x, double &y, double &z)const
-{
-    double sin_latitude = ossim::sind(lat);
-    double cos_latitude = ossim::cosd(lat);
-    double N = theA / sqrt( 1.0 - theEccentricitySquared*sin_latitude*sin_latitude);
-    x = (N+height)*cos_latitude*ossim::cosd(lon);
-    y = (N+height)*cos_latitude*ossim::sind(lon);
-    z = (N*(1-theEccentricitySquared)+height)*sin_latitude;
-}
-
-void ossimEllipsoid::XYZToLatLonHeight(double x, double y, double z,
-                                       double& lat, double& lon, double& height)const
-{
-
-#if 1
-  // Author: Norman J. Goldstein (ngoldstein at SystemSolutionsRD.com, 
-//                              normvcr at telus.net)
-
-  const double tol = 1e-15;
-  const double d = sqrt(x*x + y*y);
-  const int MAX_ITER = 10;
-
-  const double a2 = theA * theA;
-  const double b2 = theB * theB;
-  const double pa2 = d * d * a2;
-  const double qb2 = z * z * b2;
-  const double ae2 = a2 * eccentricitySquared();
-  const double ae4 = ae2 * ae2;
-
-  const double c3 = -( ae4/2 + pa2 + qb2 );          // s^2
-  const double c4 = ae2*( pa2 - qb2 );               // s^1
-  const double c5 = ae4/4 * ( ae4/4 - pa2 - qb2 );   // s^0
-
-  double s0 = 0.5 * (a2 + b2) * hypot( d/theA, z/theB );
-
-  for( int iterIdx = 0; iterIdx < MAX_ITER; ++iterIdx )
-  {
-    const double pol = c5 + s0 * ( c4 + s0 * ( c3 + s0 * s0 ) );
-    const double der = c4 + s0 * ( 2 * c3  + 4 * s0 * s0 );
-
-    const double ds = - pol / der;
-    s0 += ds;
-
-    if( fabs( ds ) < tol * s0 )
-    {
-      const double t = s0 - 0.5 * (a2 + b2);
-      const double x_ell = d / ( 1.0 + t/a2 );
-      const double y_ell = z / ( 1.0 + t/b2 );
-
-      height = ( d - x_ell ) * x_ell/a2 + ( z - y_ell ) * y_ell/b2;
-      height /= hypot( x_ell/a2 ,  y_ell/b2 );
-
-      lat = atan2( y_ell/b2, x_ell/a2 ) * DEG_PER_RAD;
-      lon = atan2( y, x ) * DEG_PER_RAD;
-
-      return;
-    }
-  }
-
-  #else
-   double d = sqrt(x*x + y*y);
-
-   double phi2 = z / ((1 - theEccentricitySquared) * d);
-   double p = 1.0;
-   double phi1 = 0.0;
-   double N1 = 0.0;
-   double height1 = 0.0;
-   int iterIdx = 0;
-   const int MAX_ITER = 10;
-   if (fabs(phi2) > 1e-16 )
-   {
-      while ( (p > 1e-17) && (iterIdx < MAX_ITER))
-      {
-         phi1 = phi2;
-         N1 = theA / sqrt(1.0 - (theEccentricitySquared * pow(sin(phi1), 2.0)));
-         height1 = (d / cos(phi1) - N1);
-         phi2 = atan((z / d) * (1.0 + (theEccentricitySquared * N1 * sin(phi1)) / z));
-         p = fabs(phi2 - phi1);
-         ++iterIdx;
-         /* printf("phi: %e   phi2: %e   p: %e  \n", phi1, phi2, p); */
-      }                                                                                           
-   }                                                                                                   
-   else
-   {                                                                                              
-      phi1 = phi2;                                                                                
-      N1 = theA / sqrt(1.0 - (theEccentricitySquared * pow(sin(phi1), 2.0)));                    
-      height1 = (d / cos(phi1)) - N1;                                                             
-   }                                                                                                   
-
-   /* *Latitude = phi2 * 180/PI; */
-   /* *Longitude = atan2(Y, X) * 180/PI; */
-   lat = phi2*DEG_PER_RAD; 
-   lon = atan2(y, x)*DEG_PER_RAD;                                                                
-   height = height1; 
-#endif
-}
-
-void ossimEllipsoid::computeLocalToWorldTransformFromXYZ(double x, double y, double z,
-                                                         ossimMatrix4x4& localToWorld)const
-{
-   localToWorld = ossimMatrix4x4::createIdentity();
-   NEWMAT::Matrix& m = localToWorld.getData();
-
-   // put in the translation
-   m[0][3] = x;
-   m[1][3] = y;
-   m[2][3] = z;
-   
-
-
-    // normalize X,Y,Z
-    double inverse_length = 1.0/sqrt(x*x + y*y + z*z);
-    
-    x *= inverse_length;
-    y *= inverse_length;
-    z *= inverse_length;
-
-    double length_XY = sqrt(x*x + y*y);
-    double inverse_length_XY = 1.0/length_XY;
-
-    // Vx = |(-Y,X,0)|
-    m[0][0] = -y*inverse_length_XY;
-    m[1][0] = x*inverse_length_XY;
-    m[2][0] = 0.0;
-
-    // Vy = /(-Z*X/(sqrt(X*X+Y*Y), -Z*Y/(sqrt(X*X+Y*Y),sqrt(X*X+Y*Y))| 
-    double Vy_x = -z*x*inverse_length_XY;
-    double Vy_y = -z*y*inverse_length_XY;
-    double Vy_z = length_XY;
-    inverse_length = 1.0/sqrt(Vy_x*Vy_x + Vy_y*Vy_y + Vy_z*Vy_z);            
-    m[0][1] = Vy_x*inverse_length;
-    m[1][1] = Vy_y*inverse_length;
-    m[2][1] = Vy_z*inverse_length;
-
-    // Vz = (X,Y,Z)
-    m[0][2] = x;
-    m[1][2] = y;
-    m[2][2] = z;
-   
-}
-
-ossim_uint32 ossimEllipsoid::getEpsgCode() const
-{
-   if (!theCode.empty() && (theEpsgCode == 0))
-      theEpsgCode = ossimEllipsoidFactory::instance()->findEpsgCode(theCode);
-   return theEpsgCode;
-}
-
-const ossimEllipsoid& ossimEllipsoid::operator=(const ossimEllipsoid& copy_me)
-{
-   if (this != &copy_me)
-   {
-      theName = copy_me.theName;
-      theCode = copy_me.theCode;
-      theEpsgCode = copy_me.theEpsgCode;
-      theA = copy_me.theA;  
-      theB = copy_me.theB;  
-      theFlattening = copy_me.theFlattening;
-      theA_squared = copy_me.theA_squared;
-      theB_squared = copy_me.theB_squared;
-      theEccentricitySquared = copy_me.theEccentricitySquared;
-   }
-   return *this;
-}
diff --git a/ossim/src/ossim/base/ossimEllipsoidFactory.cpp b/ossim/src/ossim/base/ossimEllipsoidFactory.cpp
deleted file mode 100644
index 6c6632d..0000000
--- a/ossim/src/ossim/base/ossimEllipsoidFactory.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-// 
-//*******************************************************************
-//  $Id: ossimEllipsoidFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimEllipsoidFactory.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimString.h>
-
-ossimEllipsoidFactory* ossimEllipsoidFactory::instance()
-{
-   static ossimEllipsoidFactory inst;
-
-   //---
-   // Boolean test here is necessary to avoid infinite loop from Ellipsoid
-   // classes calling this factory's instance() method. Leave this convoluted
-   // code as is. (OLK 09/14)
-   //---
-   static bool testInst = false;
-   if(!testInst)
-   {
-      testInst = true;
-      inst.initializeTable();
-   }
-   
-   return &inst;
-} 
-
-ossimEllipsoidFactory::ossimEllipsoidFactory()
-{
-}
-
-ossimEllipsoidFactory::~ossimEllipsoidFactory()
-{
-   deleteAll();
-}
-
-const ossimEllipsoid* ossimEllipsoidFactory::create(const ossimString &code)const
-{
-   // Can be 2-letter code or EPSG integer code for ellipsoids (7000-series). Make sure it is alpha:
-   if ( code.empty() )
-   {
-      return 0;
-   }
-
-   const ossimEllipsoid* ellipsoid = 0;
-   ossimString alphaCode = code;
-
-   // Check if the code passed in was actually numeric EPSG (vs. two char alpha code):
-      ossim_uint32 epsg_code = code.toUInt32();
-      if (epsg_code)
-      {
-         // EPSG was specified, fetch the equivalent alpha code from the map:
-         EpsgTableType::const_iterator iter = theEpsgTable.find(epsg_code);
-         if (iter != theEpsgTable.end())
-            alphaCode = (*iter).second;
-         }
-
-      // Established two-letter code. Now fetch the ellipsoid instance:
-      TableType::const_iterator iter = theEllipsoidTable.find(alphaCode);
-      if(iter != theEllipsoidTable.end())
-         ellipsoid = iter->second;
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimEllipsoidFactory::create WARNING:"
-            << "\nDid not create ellipsoid for code: " << code << std::endl;
-      }
-   
-   return ellipsoid;
-}
-
-void ossimEllipsoidFactory::initializeTable()
-{
-   // Do nothing if tables were already initialized:
-   if (!theEllipsoidTable.empty())
-   {
-      return;
-   }
-
-   // This table bridges between EPSG 7000-series codes to two-letter code:
-   theEpsgTable.insert(std::make_pair(7001, std::string("AA")));   
-   theEpsgTable.insert(std::make_pair(7002, std::string("AM")));
-   theEpsgTable.insert(std::make_pair(7003, std::string("AN")));
-   theEpsgTable.insert(std::make_pair(7004, std::string("BR")));
-   theEpsgTable.insert(std::make_pair(7006, std::string("BN")));
-   theEpsgTable.insert(std::make_pair(7008, std::string("CC")));
-   theEpsgTable.insert(std::make_pair(7012, std::string("CD")));
-   theEpsgTable.insert(std::make_pair(7011, std::string("CE")));
-   theEpsgTable.insert(std::make_pair(7015, std::string("EA")));
-   theEpsgTable.insert(std::make_pair(7016, std::string("EB")));
-   theEpsgTable.insert(std::make_pair(7044, std::string("EC")));
-   theEpsgTable.insert(std::make_pair(7056, std::string("ED")));
-   theEpsgTable.insert(std::make_pair(7018, std::string("EE")));
-   theEpsgTable.insert(std::make_pair(7019, std::string("RF")));
-   theEpsgTable.insert(std::make_pair(7020, std::string("HE")));
-   theEpsgTable.insert(std::make_pair(7053, std::string("HO")));
-   theEpsgTable.insert(std::make_pair(7021, std::string("ID")));
-   theEpsgTable.insert(std::make_pair(7022, std::string("IN")));
-   theEpsgTable.insert(std::make_pair(7024, std::string("KA")));
-   theEpsgTable.insert(std::make_pair(7003, std::string("SA"))); // Same as "AN"
-   theEpsgTable.insert(std::make_pair(7043, std::string("WD")));
-   theEpsgTable.insert(std::make_pair(7030, std::string("WE")));
-   theEpsgTable.insert(std::make_pair(7059, std::string("PV")));
-
-   theEllipsoidTable.insert(std::make_pair(std::string("AA"),
-      new ossimEllipsoid(std::string("Airy"), std::string("AA"), 
-      6377563.396, 6356256.9090, 7001)));   
-   theEllipsoidTable.insert(std::make_pair(std::string("AM"),
-      new ossimEllipsoid(std::string("Modified Airy"), std::string("AM"), 
-      6377340.189, 6356034.448, 7002)));
-   theEllipsoidTable.insert(std::make_pair(std::string("AN"),
-      new ossimEllipsoid(std::string("Australian National"), std::string("AN"), 
-      6378160.000, 6356774.7190, 7003)));
-   theEllipsoidTable.insert(std::make_pair(std::string("BR"),
-      new ossimEllipsoid(std::string("Bessel 1841"), std::string("BR"), 
-      6377397.155, 6356078.9630, 7004)));
-   theEllipsoidTable.insert(std::make_pair(std::string("BN"),
-      new ossimEllipsoid(std::string("Bessel 1841(Namibia)"), std::string("BN"), 
-      6377483.865, 6356165.3830, 7006)));
-   theEllipsoidTable.insert(std::make_pair(std::string("CC"),
-      new ossimEllipsoid(std::string("Clarke 1866"), std::string("CC"), 
-      6378206.400, 6356583.8000, 7008)));
-   theEllipsoidTable.insert(std::make_pair(std::string("CD"),
-      new ossimEllipsoid(std::string("Clarke 1880"), std::string("CD"), 
-      6378249.145, 6356514.8700, 7012)));
-   theEllipsoidTable.insert(std::make_pair(std::string("CE"),
-      new ossimEllipsoid(std::string("Clarke 1880 (IGN)EPSG 7011"), std::string("CE"), 
-      6378249.200, 6356515.0000, 7011)));
-   theEllipsoidTable.insert(std::make_pair(std::string("EA"),
-      new ossimEllipsoid(std::string("Everest"), std::string("EA"), 
-      6377276.345, 6356075.4130, 7015)));
-   theEllipsoidTable.insert(std::make_pair(std::string("EB"),
-      new ossimEllipsoid(std::string("Everest (E. Malasia, Brunei)"), std::string("EB"), 
-      6377298.556, 6356097.55, 7016)));
-   theEllipsoidTable.insert(std::make_pair(std::string("EC"),
-      new ossimEllipsoid(std::string("Everest 1956 (India)"), std::string("EC"), 
-      6377301.243, 6356100.228, 7044)));
-   theEllipsoidTable.insert(std::make_pair(std::string("ED"),
-      new ossimEllipsoid(std::string("Everest 1969 (West Malasia)"), std::string("ED"), 
-      6377295.664, 6356094.668, 7056)));
-   theEllipsoidTable.insert(std::make_pair(std::string("EE"),
-      new ossimEllipsoid(std::string("Everest 1948(W.Mals. & Sing.)"), std::string("EE"), 
-      6377304.063, 6356103.039, 7018)));
-
-   // No codes for next two:
-   theEllipsoidTable.insert(std::make_pair(std::string("EF"),
-      new ossimEllipsoid(std::string("Everest (Pakistan)"), std::string("EF"), 
-                         6377309.613, 6356109.571, 0)));
-   theEllipsoidTable.insert(std::make_pair(std::string("FA"),
-      new ossimEllipsoid(std::string("Mod. Fischer 1960(South Asia)"), std::string("FA"), 
-                         6378155.0, 6356773.32, 0)));
-      
-   theEllipsoidTable.insert(std::make_pair(std::string("RF"),
-      new ossimEllipsoid(std::string("GRS 80"), std::string("RF"), 
-      6378137.0, 6356752.3141, 7019)));
-   theEllipsoidTable.insert(std::make_pair(std::string("HE"),
-      new ossimEllipsoid(std::string("Helmert 1906"), std::string("HE"), 
-      6378200.0, 6356818.17, 7020)));
-   theEllipsoidTable.insert(std::make_pair(std::string("HO"),
-      new ossimEllipsoid(std::string("Hough"), std::string("HO"), 
-      6378270.0, 6356794.3430, 7053)));
-   theEllipsoidTable.insert(std::make_pair(std::string("ID"),
-      new ossimEllipsoid(std::string("Indonesian 1974"), std::string("ID"), 
-      6378160.0, 6356774.504, 7021)));
-   theEllipsoidTable.insert(std::make_pair(std::string("IN"),
-      new ossimEllipsoid(std::string("International 1924"), std::string("IN"), 
-      6378388.0, 6356911.946, 7022)));
-   theEllipsoidTable.insert(std::make_pair(std::string("KA"),
-      new ossimEllipsoid(std::string("Krassovsky"), std::string("KA"), 
-      6378245.0, 6356863.0190, 7024)));
-   theEllipsoidTable.insert(std::make_pair(std::string("SA"),
-      new ossimEllipsoid(std::string("South American 1969"),std::string("SA"), 
-      6378160.0, 6356774.719, 7003)));
-   theEllipsoidTable.insert(std::make_pair(std::string("WD"),
-      new ossimEllipsoid(std::string("WGS 72"), std::string("WD"), 
-      6378135.000, 6356750.5200, 7043)));
-   theEllipsoidTable.insert(std::make_pair(std::string("WE"),
-      new ossimEllipsoid(std::string("WGS 84"), std::string("WE"), 
-      6378137.000, 6356752.3142, 7030)));
-   theEllipsoidTable.insert(std::make_pair(std::string("PV"),
-      new ossimEllipsoid(std::string("Popular Visualization Sphere"), std::string("7059"), 
-      6378137.000, 6378137.000, 7059)));
-
-   theWgs84Ellipsoid = new ossimEllipsoid(std::string("WGS 84"), std::string("WE"), 
-      6378137.000, 6356752.3142, 7030);
-   theWgs72Ellipsoid = new ossimEllipsoid(std::string("WGS 72"), std::string("WD"), 
-      6378135.000, 6356750.5200, 7043);
-}
-
-void ossimEllipsoidFactory::deleteAll()
-{
-   TableType::const_iterator ellipsoid = theEllipsoidTable.begin();
-   
-   while(ellipsoid != theEllipsoidTable.end())
-   {
-      delete (*ellipsoid).second;
-      ++ellipsoid;
-   }
-
-   theEllipsoidTable.clear();
-   theEpsgTable.clear();
-
-   if (theWgs84Ellipsoid)
-   {
-      delete theWgs84Ellipsoid;
-      theWgs84Ellipsoid = 0;
-   }
-   if (theWgs72Ellipsoid)
-   {
-      delete theWgs72Ellipsoid;
-      theWgs72Ellipsoid = 0;
-   }
-}
-
-//*************************************************************************************************
-// Given an alpha code (for example "WE" for WGS84), returns the corresponding EPSG code or 0
-// if not found.
-//*************************************************************************************************
-ossim_uint32 ossimEllipsoidFactory::findEpsgCode(const ossimString& alpha_code) const
-{
-   ossim_uint32 epsg_code = 0;
-   if (alpha_code.empty())
-      return 0;
-
-   EpsgTableType::const_iterator iter = theEpsgTable.begin();
-   while ((iter != theEpsgTable.end()) && (epsg_code == 0))
-   {
-      if (iter->second == alpha_code.string())
-      {
-         epsg_code = iter->first;
-      }
-      iter++;
-   }
-   return epsg_code;
-}
-
diff --git a/ossim/src/ossim/base/ossimEnvironmentUtility.cpp b/ossim/src/ossim/base/ossimEnvironmentUtility.cpp
deleted file mode 100644
index 4039d84..0000000
--- a/ossim/src/ossim/base/ossimEnvironmentUtility.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
-#include <ossim/base/ossimEnvironmentUtility.h>
-#include <cstdlib>
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#  define OSSIM_ENVIRONMENT_UTILITY_UNIX 0
-#  include <direct.h>
-#else
-#  define OSSIM_ENVIRONMENT_UTILITY_UNIX 1
-#endif
-
-ossimEnvironmentUtility* ossimEnvironmentUtility::theInstance=0;
-
-ossimEnvironmentUtility::ossimEnvironmentUtility()
-{
-   ossimFilename dir = getUserOssimPluginDir();
-   
-   if(!dir.empty())
-   {
-      thePluginSearchPath.push_back(dir);
-   }
-   
-   dir = getInstalledOssimPluginDir();
-   if(!dir.empty())
-   {   
-      thePluginSearchPath.push_back(dir);
-   }
-
-   
-}
-
-ossimEnvironmentUtility* ossimEnvironmentUtility::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimEnvironmentUtility;
-   }
-
-   return theInstance;
-}
-
-ossimString ossimEnvironmentUtility::getEnvironmentVariable(const ossimString& variable)const
-{
-   ossimString result;
-   char* lookup = std::getenv(variable.c_str());
-   // getenv returns NULL if not found.
-   if (lookup)
-   {
-      result = (const char*)lookup;
-   }
-   return result;
-}
-
-ossimFilename ossimEnvironmentUtility::getUserOssimSupportDir()const
-{
-   ossimFilename result = getUserDir();
-   
-#if OSSIM_ENVIRONMENT_UTILITY_UNIX
-#   ifdef __APPLE__
-   result = result.dirCat("Library/Application Support/ossim");
-   
-#   else
-   result = result.dirCat(".ossim");
-#   endif
-#else
-   result = result.dirCat("Application Data\\ossim");
-#endif
-   
-   return result;
-}
-
-ossimString   ossimEnvironmentUtility::getUserName()const
-{
-#if OSSIM_ENVIRONMENT_UTILITY_UNIX
-   return getEnvironmentVariable("USER");
-#else
-   return getEnvironmentVariable("USERNAME");
-#endif
-}
-
-ossimFilename ossimEnvironmentUtility::getUserDir()const
-{
-   ossimFilename result;
-
-#if OSSIM_ENVIRONMENT_UTILITY_UNIX
-   result = ossimFilename(getEnvironmentVariable("HOME"));
-#else
-   result =ossimFilename(getEnvironmentVariable("USERPROFILE"));
-#endif
-
-   return result;
-}
-
-ossimFilename ossimEnvironmentUtility::getUserOssimPreferences()const
-{
-   ossimFilename result = getUserOssimSupportDir();
-
-   if(result == "")
-   {
-      return "";
-   }
-
-   result = result.dirCat("preferences");
-   
-   return result;
-}
-
-ossimFilename ossimEnvironmentUtility::getUserOssimPluginDir()const
-{
-   ossimFilename result = getUserOssimSupportDir();
-
-   if(result != "")
-   {
-      result = result.dirCat("plugins");
-   }
-   
-   return result;
-}
-
-ossimFilename ossimEnvironmentUtility::getInstalledOssimSupportDir()const
-{
-   ossimFilename result;
-#if OSSIM_ENVIRONMENT_UTILITY_UNIX
-#   ifdef __APPLE__
-   result = "/Library/Application Support/ossim";
-#   else
-   result = "/usr/share/ossim";
-   if(!result.exists())
-   {
-      result = "/usr/local/share/ossim";
-   }
-#   endif
-#else
-   // NEED the windows test here.
-#endif
-   if(result != "")
-   {
-      if(!result.exists())
-      {
-         result = "";
-      }
-   }
-
-   return result;
-}
-
-ossimFilename ossimEnvironmentUtility::getInstalledOssimPluginDir()const
-{
-   ossimFilename result = getInstalledOssimSupportDir();
-
-   //Need generic unix plugin location
-#if OSSIM_ENVIRONMENT_UTILITY_UNIX
-#   ifndef __APPLE__
-   return "";
-#   endif
-#endif
-   if((result!="")&&result.exists())
-   {
-      result = result.dirCat("plugins");
-   }
-   else
-   {
-      result = "";
-   }
-
-   return result;
-
-}
-
-ossimFilename ossimEnvironmentUtility::getInstalledOssimPreferences()const
-{
-   ossimFilename result = getInstalledOssimSupportDir();
-
-   
-   if((result!="")&&result.exists())
-   {
-      result = result.dirCat("preferences");
-   }
-   else
-   {
-      result = "";
-   }
-
-   if(!result.exists())
-   {
-      result = "";
-   }
-   
-   return result;
-   
-}
-
-ossimFilename ossimEnvironmentUtility::getCurrentWorkingDir()const
-{
-   ossimFilename result;
-
-#if OSSIM_ENVIRONMENT_UTILITY_UNIX
-   result = getEnvironmentVariable("PWD");
-#else
-   char buf[512];
-   _getcwd(buf, 512);
-   result = buf;
-#endif
-
-   return result;
-}
-
-ossimFilename ossimEnvironmentUtility::searchAllPaths(const ossimFilename& file)const
-{
-   ossimFilename result;
-
-   result = findPlugin(file);
-   if(!result.empty()) return result;
-
-   result = findData(file);
-
-
-   return result;
-}
-
-void ossimEnvironmentUtility::addDataSearchPath(const ossimFilename& path)
-{
-   theDataSearchPath.push_back(path);
-}
-
-void ossimEnvironmentUtility::addDataSearchPathToFront(const ossimFilename& path)
-{
-   theDataSearchPath.insert(theDataSearchPath.begin(), path);
-}
-
-void ossimEnvironmentUtility::addPluginSearchPath(const ossimFilename& path)
-{
-   thePluginSearchPath.push_back(path);
-}
-
-void ossimEnvironmentUtility::addPluginSearchPathToFront(const ossimFilename& path)
-{
-   thePluginSearchPath.insert(thePluginSearchPath.begin(), path);
-}
-
-ossimFilename ossimEnvironmentUtility::findPlugin(const ossimFilename& plugin)const
-{
-   for(ossimEnvironmentUtility::FilenameListType::const_iterator iter = thePluginSearchPath.begin();
-       iter != thePluginSearchPath.end();
-       ++iter)
-   {
-      ossimFilename temp = iter->dirCat(plugin);
-      if(temp.exists())
-      {
-         return temp;
-      }
-   }
-
-   return "";
-}
-
-ossimFilename ossimEnvironmentUtility::findData(const ossimFilename& data)const
-{
-   for(ossimEnvironmentUtility::FilenameListType::const_iterator iter = theDataSearchPath.begin();
-       iter != theDataSearchPath.end();
-       ++iter)
-   {
-      ossimFilename temp = iter->dirCat(data);
-      if(temp.exists())
-      {
-         return temp;
-      }
-   }
-
-   return "";
-}
-
-
-ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getPluginSearchPath()
-{
-   return thePluginSearchPath;
-}
-
-const ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getPluginSearchPath()const
-{
-   return thePluginSearchPath;
-}
-
-ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getDataSearchPath()
-{
-   return theDataSearchPath;
-}
-
-const ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getDataSearchPath()const
-{
-   return theDataSearchPath;
-}
-
-// Hidden copy constructor.
-ossimEnvironmentUtility::ossimEnvironmentUtility(
-   const ossimEnvironmentUtility& /* obj */)
-{
-}
-
-// Hidden operator=
-const ossimEnvironmentUtility& ossimEnvironmentUtility::operator=(
-   const ossimEnvironmentUtility& /* rhs */)
-{
-   return *this;
-}
diff --git a/ossim/src/ossim/base/ossimEquTokenizer.cpp b/ossim/src/ossim/base/ossimEquTokenizer.cpp
deleted file mode 100644
index 6837588..0000000
--- a/ossim/src/ossim/base/ossimEquTokenizer.cpp
+++ /dev/null
@@ -1,1817 +0,0 @@
-//#define yyFlexLexer ossimEquTokenizerFlexLexer
-//#define yywrap ossimEquTokenizerwrap
-#include <ossim/base/ossimEquTokenizer.h>
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header$
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include <cstdio> /* for EOF */
-#include <cstdlib>
-#include <iostream>
-#include <fstream>
-using namespace std;
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif	/* __STDC__ */
-#endif	/* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include <io.h>
-#include <stdlib.h>
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- * 	if ( condition_holds )
- *		yyless( 5 );
- *	else
- *		do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		*yy_cp = yy_hold_char; \
-		YY_RESTORE_YY_MORE_OFFSET \
-		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
-	{
-	istream* yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-	};
-
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-typedef unsigned char YY_CHAR;
-#define yytext_ptr yytext
-#define YY_INTERACTIVE
-
-//#include <ossim/base/ossimFlexLexer.h>
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	yytext_ptr = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	yy_hold_char = *yy_cp; \
-	*yy_cp = '\0'; \
-	yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 52
-#define YY_END_OF_BUFFER 53
-static yyconst short int yy_accept[119] =
-    {   0,
-        0,    0,   53,   52,    1,   11,    7,   14,   15,    5,
-        9,    3,   10,   52,    4,    2,   49,   52,   47,   52,
-       12,   13,   16,   52,   52,   52,   52,   52,   52,   52,
-       52,   52,   52,    6,    8,    1,    2,    2,    2,    0,
-       50,   51,   46,   48,   19,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,   18,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    2,   35,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,   27,   22,   20,   38,
-       37,    0,   23,    0,   31,   17,    0,    2,   29,   25,
-        0,   33,   42,    0,    0,   44,   39,   28,    0,    0,
-
-       24,   36,   32,   30,   26,    0,   34,   41,   45,   21,
-       40,    0,    0,    0,    0,    0,   43,    0
-    } ;
-
-static yyconst int yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    1,    1,    1,    3,    4,    1,    5,
-        6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
-       15,   15,   15,   15,   15,   15,   15,    1,    1,   16,
-       17,   18,    1,    1,    1,    1,    1,    1,   19,    1,
-        1,    1,   20,    1,    1,    1,    1,    1,    1,   21,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-       22,    1,   23,   24,   25,    1,   26,   27,   28,   29,
-
-       30,   31,   32,   33,   34,    1,    1,   35,   36,   37,
-       38,   39,   40,   41,   42,   43,   44,   45,    1,   46,
-        1,    1,    1,   47,    1,   48,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst int yy_meta[49] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1
-    } ;
-
-static yyconst short int yy_base[119] =
-    {   0,
-        0,    0,  170,  171,  167,  171,  171,  171,  171,  171,
-      171,  171,  171,   36,  171,   41,   40,  151,  150,  146,
-      171,  171,  171,   34,   33,   28,  119,  127,  125,   38,
-       40,  136,  123,  171,  171,  158,   68,   71,   78,   92,
-      171,  171,  171,  171,  171,  117,  120,   33,  131,  119,
-      111,   44,   57,  115,  171,  121,  106,  114,  116,  112,
-      107,  110,  105,  101,  104,  107,  171,  103,  107,  109,
-      105,  112,   99,  103,   99,   92,  107,  171,  121,  171,
-      171,  103,  104,   89,  102,  171,  110,  113,  101,  100,
-       81,   83,  171,   69,   65,  171,  171,  171,   90,   53,
-
-      171,  171,  171,  171,  171,   58,  171,  171,  171,  171,
-      171,   63,   52,   43,   28,   24,  171,  171
-    } ;
-
-static yyconst short int yy_def[119] =
-    {   0,
-      118,    1,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,    0
-    } ;
-
-static yyconst short int yy_nxt[220] =
-    {   0,
-        4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
-       14,   15,   16,   16,   16,   17,   18,   19,    4,    4,
-       20,   21,   22,   23,    4,   24,   25,   26,    4,   27,
-        4,    4,    4,   28,   29,   30,    4,    4,    4,    4,
-        4,   31,   32,    4,    4,   33,   34,   35,   37,   37,
-       37,   38,  117,   39,   39,   39,   41,   42,   50,   40,
-       46,   47,   52,   57,  116,   53,   69,   51,  115,   74,
-       40,   58,   59,   60,   70,   48,   49,   75,  114,   61,
-       37,   37,   37,   37,   37,   37,   64,  113,   38,   40,
-       39,   39,   39,   76,  112,  111,   40,   64,   77,   65,
-
-       40,   65,  110,  109,   66,   66,   66,   40,   87,  108,
-       87,  107,  106,   88,   88,   88,   66,   66,   66,   66,
-       66,   66,   88,   88,   88,   88,   88,   88,  105,  104,
-      103,  102,  101,  100,   99,   98,   97,   96,   95,   94,
-       93,   92,   91,   90,   89,   86,   85,   84,   83,   82,
-       81,   80,   79,   78,   73,   72,   71,   68,   67,   36,
-       63,   62,   56,   55,   54,   45,   44,   43,   36,  118,
-        3,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118
-    } ;
-
-static yyconst short int yy_chk[220] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,   14,   14,
-       14,   16,  116,   16,   16,   16,   17,   17,   25,   16,
-       24,   24,   26,   30,  115,   26,   48,   25,  114,   52,
-       16,   30,   31,   31,   48,   24,   24,   52,  113,   31,
-       37,   37,   37,   38,   38,   38,   37,  112,   39,   38,
-       39,   39,   39,   53,  106,  100,   39,   37,   53,   40,
-
-       38,   40,   99,   95,   40,   40,   40,   39,   64,   94,
-       64,   92,   91,   64,   64,   64,   65,   65,   65,   66,
-       66,   66,   87,   87,   87,   88,   88,   88,   90,   89,
-       85,   84,   83,   82,   79,   77,   76,   75,   74,   73,
-       72,   71,   70,   69,   68,   63,   62,   61,   60,   59,
-       58,   57,   56,   54,   51,   50,   49,   47,   46,   36,
-       33,   32,   29,   28,   27,   20,   19,   18,    5,    3,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-
-      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
-      118,  118,  118,  118,  118,  118,  118,  118,  118
-    } ;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-//#line 1 "ossimEquTokenizer.l"
-#define INITIAL 0
-//#line 2 "ossimEquTokenizer.l"
-#include <ossim/base/ossimEquTokenDefines.h>
-//#line 413 "lex.ossimEquTokenizer.cc"
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include <stdlib.h>
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-#define ECHO LexerOutput( yytext, yyleng )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
-		YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) LexerError( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yyFlexLexer::yylex()
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	YY_USER_ACTION
-
-YY_DECL
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp = NULL, *yy_bp = NULL;
-	register int yy_act;
-
-//#line 15 "ossimEquTokenizer.l"
-
-
-//#line 543 "lex.ossimEquTokenizer.cc"
-
-	if ( yy_init )
-		{
-		yy_init = 0;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! yy_start )
-			yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = &cin;
-
-		if ( ! yyout )
-			yyout = &cout;
-
-		if ( ! yy_current_buffer )
-			yy_current_buffer =
-				yy_create_buffer( yyin, YY_BUF_SIZE );
-
-		yy_load_buffer_state();
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yy_hold_char;
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = yy_start;
-yy_match:
-		do
-                {
-                   register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-                   if ( yy_accept[yy_current_state] )
-                   {
-                      yy_last_accepting_state = yy_current_state;
-                      yy_last_accepting_cpos = yy_cp;
-                   }
-                   
-                   // yy_chk size == 119
-                   // yy_base size == 119
-                   
-                   while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-                   {
-                      yy_current_state = (int) yy_def[yy_current_state];
-                      if ( yy_current_state >= 119 )
-                      {
-                         yy_c = yy_meta[(unsigned int) yy_c];
-                      }
-                      
-                      //---
-                      // NOTE:
-                      // Need to test this!
-                      // Above condition yy_current_state >= 119  flaged by coverity scan
-                      // as an array out of bounds read. Both yy_chk and yy_base have
-                      // size of 119.  Added break to fix.
-                      // drb - 20150529
-                      //---
-                      if ( (yy_current_state >= 119) ||
-                           ( (yy_base[yy_current_state] + yy_c) >= 119 ) )
-                      {
-                         break;
-                      }
-                   }
-                   
-                   yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-                   ++yy_cp;
-                }
-		while ( yy_base[yy_current_state] != 171 );
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-		if ( yy_act == 0 )
-			{ /* have to back up */
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
-			yy_act = yy_accept[yy_current_state];
-			}
-
-		YY_DO_BEFORE_ACTION;
-
-
-do_action:	/* This label is used only to access EOF actions. */
-
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yy_hold_char;
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
-			goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-//#line 17 "ossimEquTokenizer.l"
-/* skip blanks and tabs */
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-//#line 19 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_CONSTANT;
-           }
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-//#line 22 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_COMMA;
-           }
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-//#line 25 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_DIV;
-           }
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-//#line 29 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_MULT;
-           }
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 33 "ossimEquTokenizer.l"
-{ 
-               return OSSIM_EQU_TOKEN_OR_BAR;
-           }
-	YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 37 "ossimEquTokenizer.l"
-{ 
-               return OSSIM_EQU_TOKEN_AMPERSAND;
-           }
-	YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 40 "ossimEquTokenizer.l"
-{ 
-               return OSSIM_EQU_TOKEN_TILDE;
-           }
-	YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 44 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_PLUS;
-           }
-	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 47 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_MINUS;
-           }
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 50 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_MOD;
-           }
-	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 53 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_LEFT_ARRAY_BRACKET;
-           }
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 56 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_RIGHT_ARRAY_BRACKET;
-           }
-	YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 59 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_LEFT_PAREN;
-        }
-	YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 62 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_RIGHT_PAREN;
-           }
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 65 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_POWER;
-           }
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 68 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_XOR;
-        }
-	YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 72 "ossimEquTokenizer.l"
-{
-             return OSSIM_EQU_TOKEN_IMAGE_VARIABLE;
-        }
-	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 75 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_PI;
-           }
-	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 78 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_LOG;
-           }
-	YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 81 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_LOG10;
-           }
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 84 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_EXP;
-           } 
-	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 87 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_SIN;
-           }
-	YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 90 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_SIND;
-           }
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 93 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ASIN;
-           }
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 96 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ASIND;
-           }
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 99 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_COS;
-           }
-	YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 102 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_COSD;
-           }
-	YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 105 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ACOS;
-           }
-	YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 108 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ACOSD;
-           }
-	YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 111 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_TAN;
-           }
-	YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 114 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_TAND;
-           }
-	YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 117 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ATAN;
-           }
-	YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 120 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ATAND;
-           }
-	YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 123 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ABS;
-           }
-	YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 126 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_SQRT;
-           }
-	YY_BREAK
-case 37:
-YY_RULE_SETUP
-#line 129 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_MIN;
-           }
-	YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 132 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_MAX;
-           }
-	YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 135 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_CONV;
-           }
-	YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 138 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_SHIFT;
-           }
-	YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 141 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BLURR;
-           }
-	YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 144 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BAND;
-           }
-	YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 147 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_ASSIGN_BAND;
-              }
-	YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 150 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_CLIP;
-        }
-	YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 153 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_CLAMP;
-        }
-	YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 156 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BEQUAL;
-}
-	YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 159 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BGREATER;
-}
-	YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 162 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BGREATEROREQUAL;
-}
-	YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 165 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BLESS;
-}
-	YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 168 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BLESSOREQUAL;
-}
-	YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 171 "ossimEquTokenizer.l"
-{
-               return OSSIM_EQU_TOKEN_BDIFFERENT;
-}
-	YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 175 "ossimEquTokenizer.l"
-ECHO;
-	YY_BREAK
-#line 986 "lex.ossimEquTokenizer.cc"
-case YY_STATE_EOF(INITIAL):
-	yyterminate();
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yy_hold_char;
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between yy_current_buffer and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			yy_n_chars = yy_current_buffer->yy_n_chars;
-			yy_current_buffer->yy_input_file = yyin;
-			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state();
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = yytext_ptr + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = yy_c_buf_p;
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer() )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap() )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				yy_c_buf_p =
-					yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				yy_c_buf_p =
-				&yy_current_buffer->yy_ch_buf[yy_n_chars];
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-	} /* end of yylex */
-
-yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
-	{
-	yyin = arg_yyin;
-	yyout = arg_yyout;
-	yy_c_buf_p = 0;
-	yy_init = 1;
-	yy_start = 0;
-	yy_flex_debug = 0;
-	yylineno = 1;	// this will only get updated if %option yylineno
-
-	yy_did_buffer_switch_on_eof = 0;
-
-	yy_looking_for_trail_begin = 0;
-	yy_more_flag = 0;
-	yy_more_len = 0;
-	yy_more_offset = yy_prev_more_offset = 0;
-
-	yy_start_stack_ptr = yy_start_stack_depth = 0;
-	yy_start_stack = 0;
-
-	yy_current_buffer = 0;
-
-#ifdef YY_USES_REJECT
-	yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
-#else
-	yy_state_buf = 0;
-#endif
-	}
-
-yyFlexLexer::~yyFlexLexer()
-	{
-	delete yy_state_buf;
-	yy_delete_buffer( yy_current_buffer );
-	}
-
-void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
-	{
-	if ( new_in )
-		{
-		yy_delete_buffer( yy_current_buffer );
-		yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
-		}
-
-	if ( new_out )
-		yyout = new_out;
-	}
-
-#ifdef YY_INTERACTIVE
-int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
-#else
-int yyFlexLexer::LexerInput( char* buf, int max_size )
-#endif
-	{
-	if ( yyin->eof() || yyin->fail() )
-		return 0;
-
-#ifdef YY_INTERACTIVE
-	yyin->get( buf[0] );
-
-	if ( yyin->eof() )
-		return 0;
-
-	if ( yyin->bad() )
-		return -1;
-
-	return 1;
-
-#else
-	(void) yyin->read( buf, max_size );
-
-	if ( yyin->bad() )
-		return -1;
-	else
-		return yyin->gcount();
-#endif
-	}
-
-void yyFlexLexer::LexerOutput( const char* buf, int size )
-	{
-	(void) yyout->write( buf, size );
-	}
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-
-int yyFlexLexer::yy_get_next_buffer()
-	{
-	register char *dest = yy_current_buffer->yy_ch_buf;
-	register char *source = yytext_ptr;
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( yy_current_buffer->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
-	else
-		{
-		int num_to_read =
-			yy_current_buffer->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = yy_current_buffer;
-
-			int yy_c_buf_p_offset =
-				(int) (yy_c_buf_p - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yy_flex_realloc( (void *) b->yy_ch_buf,
-							 b->yy_buf_size + 2 );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = yy_current_buffer->yy_buf_size -
-						number_to_move - 1;
-#endif
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-			yy_n_chars, num_to_read );
-
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	if ( yy_n_chars == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart( yyin );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			yy_current_buffer->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	yy_n_chars += number_to_move;
-	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
-	return ret_val;
-	}
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-yy_state_type yyFlexLexer::yy_get_previous_state()
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-
-	yy_current_state = yy_start;
-
-	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			yy_last_accepting_state = yy_current_state;
-			yy_last_accepting_cpos = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 119 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		}
-
-	return yy_current_state;
-	}
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-
-yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
-	{
-	register int yy_is_jam;
-	register char *yy_cp = yy_c_buf_p;
-
-	register YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		yy_last_accepting_state = yy_current_state;
-		yy_last_accepting_cpos = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 119 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 118);
-
-	return yy_is_jam ? 0 : yy_current_state;
-	}
-
-
-void yyFlexLexer::yyunput( int c, register char* yy_bp )
-	{
-	register char *yy_cp = yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yy_hold_char;
-
-	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register int number_to_move = yy_n_chars + 2;
-		register char *dest = &yy_current_buffer->yy_ch_buf[
-					yy_current_buffer->yy_buf_size + 2];
-		register char *source =
-				&yy_current_buffer->yy_ch_buf[number_to_move];
-
-		while ( source > yy_current_buffer->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		yy_current_buffer->yy_n_chars =
-			yy_n_chars = yy_current_buffer->yy_buf_size;
-
-		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-
-	yytext_ptr = yy_bp;
-	yy_hold_char = *yy_cp;
-	yy_c_buf_p = yy_cp;
-	}
-
-
-int yyFlexLexer::yyinput()
-	{
-	int c;
-
-	*yy_c_buf_p = yy_hold_char;
-
-	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			/* This was really a NUL. */
-			*yy_c_buf_p = '\0';
-
-		else
-			{ /* need more input */
-			int offset = yy_c_buf_p - yytext_ptr;
-			++yy_c_buf_p;
-
-			switch ( yy_get_next_buffer() )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yyrestart( yyin );
-
-					/* fall through */
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yywrap() )
-						return EOF;
-
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					yy_c_buf_p = yytext_ptr + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
-	*yy_c_buf_p = '\0';	/* preserve yytext */
-	yy_hold_char = *++yy_c_buf_p;
-
-
-	return c;
-	}
-
-void yyFlexLexer::yyrestart( istream* input_file )
-	{
-	if ( ! yy_current_buffer )
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
-	yy_init_buffer( yy_current_buffer, input_file );
-	yy_load_buffer_state();
-	}
-
-
-void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-	{
-	if ( yy_current_buffer == new_buffer )
-		return;
-
-	if ( yy_current_buffer )
-		{
-		/* Flush out information for old buffer. */
-		*yy_c_buf_p = yy_hold_char;
-		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	yy_current_buffer = new_buffer;
-	yy_load_buffer_state();
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	yy_did_buffer_switch_on_eof = 1;
-	}
-
-
-void yyFlexLexer::yy_load_buffer_state()
-	{
-	yy_n_chars = yy_current_buffer->yy_n_chars;
-	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-	yyin = yy_current_buffer->yy_input_file;
-	yy_hold_char = *yy_c_buf_p;
-	}
-
-
-YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
-	{
-	YY_BUFFER_STATE b;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	yy_init_buffer( b, file );
-
-	return b;
-	}
-
-
-void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
-	{
-	if ( ! b )
-		return;
-
-	if ( b == yy_current_buffer )
-		yy_current_buffer = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		yy_flex_free( (void *) b->yy_ch_buf );
-
-	yy_flex_free( (void *) b );
-	}
-
-
-void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
-
-	{
-	yy_flush_buffer( b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-	b->yy_is_interactive = 0;
-	}
-
-
-void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
-	{
-	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == yy_current_buffer )
-		yy_load_buffer_state();
-	}
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-void yyFlexLexer::yy_push_state( int new_state )
-	{
-	if ( yy_start_stack_ptr >= yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yy_start_stack_depth * sizeof( int );
-
-		if ( ! yy_start_stack )
-			yy_start_stack = (int *) yy_flex_alloc( new_size );
-
-		else
-			yy_start_stack = (int *) yy_flex_realloc(
-					(void *) yy_start_stack, new_size );
-
-		if ( ! yy_start_stack )
-			YY_FATAL_ERROR(
-			"out of memory expanding start-condition stack" );
-		}
-
-	yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-	}
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-void yyFlexLexer::yy_pop_state()
-	{
-	if ( --yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yy_start_stack[yy_start_stack_ptr]);
-	}
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-int yyFlexLexer::yy_top_state()
-	{
-	return yy_start_stack[yy_start_stack_ptr - 1];
-	}
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-
-void yyFlexLexer::LexerError( yyconst char msg[] )
-	{
-	cerr << msg << '\n';
-	exit( YY_EXIT_FAILURE );
-	}
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		yytext[yyleng] = yy_hold_char; \
-		yy_c_buf_p = yytext + n; \
-		yy_hold_char = *yy_c_buf_p; \
-		*yy_c_buf_p = '\0'; \
-		yyleng = n; \
-		} \
-	while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-	{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-	}
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-	{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-	}
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-	{
-	return (void *) malloc( size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-	{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-	{
-	free( ptr );
-	}
-
-#if YY_MAIN
-int main()
-	{
-	yylex();
-	return 0;
-	}
-#endif
-#line 175 "ossimEquTokenizer.l"
-
-int yywrap()
-{
-   return 1;
-}
diff --git a/ossim/src/ossim/base/ossimFilename.cpp b/ossim/src/ossim/base/ossimFilename.cpp
deleted file mode 100644
index 155cd76..0000000
--- a/ossim/src/ossim/base/ossimFilename.cpp
+++ /dev/null
@@ -1,1338 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description: This class provides manipulation of filenames.
-//
-//*************************************************************************
-// $Id: ossimFilename.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/ossimConfig.h>  /* to pick up platform defines */
-
-#include <iostream>
-#include <fstream>
-using namespace std;
-
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <cerrno>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimDate.h>
-#include <ossim/base/ossimEnvironmentUtility.h>
-
-#if defined(_WIN32)
-#  include <io.h>
-#  include <direct.h>
-#  include <sys/utime.h>
-#  include <windows.h>
-#else
-#  include <sys/types.h>
-#  include <utime.h>
-#  include <sys/stat.h>
-#  include <unistd.h>
-#  include <dirent.h>
-#  include <fcntl.h>
-#endif
-
-#include <sys/stat.h>
-
-#ifdef __BORLANDC__
-#  include <dir.h>
-#  include <direct.h>
-#  include <stdlib.h>
-#  include <io.h>
-#endif
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-#if defined(_WIN32)
-const char ossimFilename::thePathSeparator = '\\';
-#else
-const char ossimFilename::thePathSeparator = '/';
-#endif
-
-
-/**
- * This was taken from Wx widgets for performing touch and access date stamps.
- */ 
-#if defined(_WIN32)
-typedef WIN32_FIND_DATA FIND_STRUCT;
-typedef HANDLE FIND_DATA;
-typedef DWORD FIND_ATTR;
-
-class ossimFileHandle
-{
-public:
-   enum OpenMode
-   {
-      Read,
-      Write
-   };
-   
-   ossimFileHandle(const ossimString& filename, OpenMode mode)
-   {
-      m_hFile = ::CreateFile(
-         filename.c_str(),              // name
-         mode == Read ? GENERIC_READ    // access mask
-         : GENERIC_WRITE,
-         FILE_SHARE_READ |              // sharing mode
-         FILE_SHARE_WRITE,              // (allow everything)
-         NULL,                          // no secutity attr
-         OPEN_EXISTING,                 // creation disposition
-         0,                             // no flags
-         NULL                           // no template file
-         );
-      
-      if ( m_hFile == INVALID_HANDLE_VALUE )
-      {
-//             wxLogSysError(_("Failed to open '%s' for %s"),
-//                           filename.c_str(),
-//                           mode == Read ? _("reading") : _("writing"));
-      }
-   }
-   
-   ~ossimFileHandle()
-   {
-      if ( m_hFile != INVALID_HANDLE_VALUE )
-      {
-         if ( !::CloseHandle(m_hFile) )
-         {
-//                 wxLogSysError(_("Failed to close file handle"));
-         }
-      }
-   }
-   
-   // return true only if the file could be opened successfully
-   bool isOk() const { return m_hFile != INVALID_HANDLE_VALUE; }
-   
-   // get the handle
-   operator HANDLE() const { return m_hFile; }
-   
-private:
-   HANDLE m_hFile;
-};
-
-static void convertOssimToFileTime(FILETIME *ft, const ossimDate& dt)
-{
-   SYSTEMTIME st;
-   st.wDay = dt.getDay();
-   st.wMonth = (WORD)(dt.getMonth());
-   st.wYear = (WORD)dt.getYear();
-   st.wHour = dt.getHour();
-   st.wMinute = dt.getMin();
-   st.wSecond = dt.getSec();
-//     st.wMilliseconds = dt.GetMillisecond();
-
-   FILETIME ftLocal;
-   if ( !::SystemTimeToFileTime(&st, &ftLocal) )
-   {
-//         wxLogLastError(_T("SystemTimeToFileTime"));
-   }
-
-   if ( !::LocalFileTimeToFileTime(&ftLocal, ft) )
-   {
-//         wxLogLastError(_T("LocalFileTimeToFileTime"));
-   }
-}
-
-static void convertFileTimeToOssim(ossimLocalTm &dt, const FILETIME &ft)
-{
-   FILETIME ftcopy = ft;
-   FILETIME ftLocal;
-   if ( !::FileTimeToLocalFileTime(&ftcopy, &ftLocal) )
-   {
-//         wxLogLastError(_T("FileTimeToLocalFileTime"));
-   }
-
-   SYSTEMTIME st;
-   if ( !::FileTimeToSystemTime(&ftLocal, &st) )
-   {
-//         wxLogLastError(_T("FileTimeToSystemTime"));
-   }
-
-   dt.setDay(st.wDay);
-   dt.setMonth(st.wMonth);
-   dt.setYear(st.wYear);
-   dt.setHour(st.wHour);
-   dt.setMin(st.wMinute);
-   dt.setSec(st.wSecond);
-    
-//     dt->Set(st.wDay, wxDateTime::Month(st.wMonth - 1), st.wYear,
-//             st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
-}
-
-static inline bool IsFindDataOk(FIND_DATA fd)
-{
-   return fd != INVALID_HANDLE_VALUE;
-}
-
-static inline FIND_DATA FindFirst(const ossimString& spec,
-                                  FIND_STRUCT *finddata)
-{
-   return ::FindFirstFile(spec.c_str(), finddata);
-}
-
-static bool ossimGetDirectoryTimes(const ossimString& dirname,
-                                   FILETIME *ftAccess,
-                                   FILETIME *ftCreate,
-                                   FILETIME *ftMod)
-{
-
-   FIND_STRUCT fs;
-   FIND_DATA fd = FindFirst(dirname, &fs);
-   if ( !IsFindDataOk(fd) )
-   {
-      return false;
-   }
-
-   *ftAccess = fs.ftLastAccessTime;
-   *ftCreate = fs.ftCreationTime;
-   *ftMod = fs.ftLastWriteTime;
-
-   FindClose(fd);
-
-   return true;
-}
-#endif
-
-const ossimFilename ossimFilename::NIL=("");
-
-ossimFilename::ossimFilename()
-   : ossimString()
-{}
-
-ossimFilename::ossimFilename(const ossimFilename& src)
-   : ossimString(src)
-{
-}
-
-ossimFilename::ossimFilename(const ossimString& src)
-   : ossimString(src)
-{
-   if ( m_str.size() )
-   {
-      convertToNative();
-   }
-}
-
-ossimFilename::ossimFilename(const std::string& src)
-   : ossimString(src)
-{
-   if ( m_str.size() )
-   {
-      convertToNative();
-   }
-}
-
-ossimFilename::ossimFilename(const char* src)
-   : ossimString(src)
-{
-   if ( m_str.size() )
-   {
-      convertToNative();
-   }
-}
-
-template <class Iter> ossimFilename::ossimFilename(Iter s, Iter e)
-   : ossimString(s, e)
-{
-   if ( m_str.size() )
-   {
-      convertToNative();
-   }
-}
-
-bool ossimFilename::operator == (const ossimFilename& rhs)const
-{
-   return ossimString::operator==(rhs);
-}
-
-bool ossimFilename::operator == (const ossimString& rhs)const
-{
-   return ossimString::operator==(rhs);
-}
-
-bool ossimFilename::operator == (const char* rhs)const
-{
-   return ossimString::operator ==(rhs);
-}
-
-void ossimFilename::convertBackToForwardSlashes()
-{
-   std::string::iterator currentChar = this->begin();
-
-   while(currentChar != this->end())
-   {
-      if(*currentChar == '\\')
-      {
-         *currentChar = '/';
-      }
-      ++currentChar;
-   }
-}
-
-void ossimFilename::convertForwardToBackSlashes()
-{
-   std::string::iterator currentChar = this->begin();
-
-   while(currentChar != this->end())
-   {
-      if(*currentChar == '/')
-      {
-         *currentChar = '\\';
-      }
-      ++currentChar;
-   }
-}
-
-bool ossimFilename::setTimes(ossimLocalTm* accessTime,
-                             ossimLocalTm* modTime,
-#if defined(_WIN32)                             
-                             ossimLocalTm* createTime)const
-#else
-                             ossimLocalTm* /* createTime */ )const
-#endif
-{
-#if defined(_WIN32)
-   if(isDir())
-   {
-      // need to implement this later
-      return false;
-   }
-   else
-   {
-      ossimFileHandle fh(this->expand(), ossimFileHandle::Write);
-      if(fh.isOk())
-      {
-         FILETIME ftAccess, ftCreate, ftWrite;
-         
-         if ( createTime )
-         {
-            convertOssimToFileTime(&ftCreate, *createTime);
-         }
-         if ( accessTime )
-         {
-            convertOssimToFileTime(&ftAccess, *accessTime);
-         }
-         if ( modTime )
-         {
-            convertOssimToFileTime(&ftWrite, *modTime);
-         }
-         if ( ::SetFileTime(fh,
-                            createTime ? &ftCreate : NULL,
-                            accessTime ? &ftAccess : NULL,
-                            modTime ? &ftWrite : NULL) )
-         {
-            return true;
-         }
-      }
-   }
-#else
-   if ( !accessTime && !modTime )
-   {
-      // can't modify the creation time anyhow, don't try
-      return true;
-   }
-   utimbuf utm;
-   utm.actime = accessTime ? accessTime->getTicks() : modTime->getTicks();
-   utm.modtime = modTime ? modTime->getTicks() : accessTime->getTicks();
-   if ( utime(expand().c_str(), &utm) == 0 )
-   {
-      return true;
-   }
-    
-#endif
-
-   return false;
-}
-
-bool ossimFilename::getTimes(ossimLocalTm *accessTime,
-                             ossimLocalTm *modTime,
-                             ossimLocalTm *createTime) const
-{
-   if(!expand().exists()) return false;
-   
-#if defined(_WIN32)
-   // we must use different methods for the files and directories under
-   // Windows as CreateFile(GENERIC_READ) doesn't work for the directories and
-   // CreateFile(FILE_FLAG_BACKUP_SEMANTICS) works -- but only under NT and
-   // not 9x
-   bool ok;
-   FILETIME ftAccess, ftCreate, ftWrite;
-   if ( isDir() )
-   {
-      ok = ossimGetDirectoryTimes(expand().c_str(),
-                                  &ftAccess, &ftCreate, &ftWrite);
-      ok = false;
-   }
-   else // file
-   {
-      ossimFileHandle fh(expand().c_str(), ossimFileHandle::Read);
-      if ( fh.isOk() )
-      {
-         ok = ::GetFileTime(fh,
-                            createTime ? &ftCreate : NULL,
-                            accessTime ? &ftAccess : NULL,
-                            modTime ? &ftWrite : NULL) != 0;
-      }
-      else
-      {
-         ok = false;
-      }
-   }
-
-   if ( ok )
-   {
-      if ( createTime )
-      {
-         convertFileTimeToOssim(*createTime, ftCreate);
-      }
-      if ( accessTime )
-      {
-         convertFileTimeToOssim(*accessTime, ftAccess);
-      }
-      if ( modTime )
-      {
-         convertFileTimeToOssim(*modTime, ftWrite);
-      }
-        
-      return true;
-   }
-#else
-   struct stat sbuf;
-   stat(c_str(), &sbuf);
-   if ( stat( expand().c_str(), &sbuf) == 0 )
-   {
-      if ( accessTime )
-      {
-         *accessTime = ossimLocalTm(sbuf.st_atime);
-      }
-      if ( modTime )
-      {
-         *modTime = ossimLocalTm(sbuf.st_mtime);
-      }
-      if ( createTime )
-      {
-         *createTime = ossimLocalTm(sbuf.st_ctime);
-      }
-      return true;
-   }
-#endif // platforms
-
-
-   return false;
-}
-
-bool ossimFilename::touch()const
-{
-#if defined( _WIN32 )
-   ossimDate now;
-
-   return setTimes(&now, &now, 0);
-   
-#else
-   if ( utime(expand().c_str(), NULL) == 0 )
-   {
-      return true;
-   }
-   
-   return false;
-#endif   
-}
-
-ossimFilename ossimFilename::expand() const
-{
-   //---
-   // Note:  ossimEnvironmentUtility::getCurrentWorkingDir() is returning
-   // a blank string on windows with vs9.  This was resulting in seg faults
-   // in this method so added checks were added for size of returned result.
-   // (drb  20100113)
-   //---
-   ossimFilename result = "";
-   if ( size() )
-   {
-      result = *this;
-      
-      if ( needsExpansion() )
-      {
-
-//#if defined(_WIN32)
-//         result.convertBackToForwardSlashes();
-//#endif
-
-         bool addCwd = false;
-         
-         if ( (size() > 1) && (*(begin()) == '~') && (*(begin()+1) == thePathSeparator) )
-         {
-            ossimFilename homeDir =
-               ossimEnvironmentUtility::instance()->getUserDir();
-            
-            ossimFilename s( (result.begin()+2) , result.end());
-            result = homeDir.dirCat(s);
-         }
-         else if( (size() > 1) &&
-                  (*(begin()) == '.') && (*(begin()+1) == thePathSeparator) )
-         {
-            // dot slash i.e. ./foo
-            addCwd = true;
-         }
-         else if ( (size() > 2)  && (*(begin()) == '.')
-                   && (*(begin()+1) == '.') && (*(begin()+2) == thePathSeparator) )
-         {
-            // ../foo
-            addCwd = true;
-         }
-         else if (result == ".")
-         {
-            result = ossimEnvironmentUtility::instance()->
-               getCurrentWorkingDir();
-         }
-
-         if (addCwd)
-         {
-            ossimFilename cwd = ossimEnvironmentUtility::instance()->
-               getCurrentWorkingDir();
-            result = cwd.dirCat(result);
-         }
-         else if ( result.isRelative() )
-         {
-            if ( result.size() && ((*(result.begin())) != '$') )
-            {
-               ossimFilename cwd = ossimEnvironmentUtility::instance()->
-                  getCurrentWorkingDir();
-               result = cwd.dirCat(result);
-            }
-         }
-               
-         // Check result to see if we're finished.
-         if ( result.needsExpansion() )
-         {
-            // now expand any environment variable substitutions
-            
-            ossimFilename finalResult;
-            const char* tempPtr = result.c_str();
-            ossim_int32 startIdx = -1;
-            ossim_int32 resultSize = (ossim_uint32)result.size();
-            ossim_int32 scanIdx = 0;
-            while(scanIdx < resultSize)
-            {
-               // look for start of substitution pattern
-               if(tempPtr[scanIdx] == '$')
-               {
-                  if(tempPtr[scanIdx+1] == '(')
-                  {
-                     scanIdx +=2;
-                     startIdx = scanIdx;
-                  }
-               }
-               // look for an end pattern and apply if we found a start pattern
-               else if(tempPtr[scanIdx] == ')')
-               {
-                  if(startIdx != -1)
-                  {
-                     ossimFilename value(
-                        ossimEnvironmentUtility::instance()->
-                        getEnvironmentVariable(ossimString(tempPtr+startIdx,
-                                                           tempPtr+scanIdx)));
-#if defined(_WIN32) // do windows style replacment
-                     //                    value.convertBackToForwardSlashes();
-#endif
-                     finalResult += value;
-                     // reset start idx indicator to not set so we are ready for next pattern
-                     //
-                     startIdx = -1;
-                  }
-                  else // if no start then tack on the )
-                  {
-                     finalResult += tempPtr[scanIdx];
-                  }
-                  ++scanIdx;
-               }
-               else if(startIdx == -1)
-               {
-                  finalResult += tempPtr[scanIdx];
-                  ++scanIdx;
-               }
-               else
-               {
-                  ++scanIdx;
-               }
-            }
-#if defined(_WIN32)
-
-#else        
-            finalResult.gsub("//", "/", true);
-#endif       
-            result = finalResult;
-         
-         } // matches:  if ( result.needsExpansion() )
-
-#if defined(_WIN32)
-         //        result.convertForwardToBackSlashes();
-#endif        
-
-      } // matches: if ( needsExpansion() )
-
-      //---
-      // If we had a size before "expand()" and now we don't something went
-      // wrong...
-      //---
-      if (!result.size())
-      {
-         result = *this;
-      }
-      
-   } // matches: if ( size() )
-   
-   return result;
-}
-
-bool ossimFilename::exists() const
-{
-   bool result = false;
-#if defined(_WIN32)
-   result = (_access(c_str(), ossimFilename::OSSIM_EXIST) == 0);
-#else
-   result = ((access(c_str(), ossimFilename::OSSIM_EXIST)) == 0);
-#endif
-   return result;
-}
-
-bool ossimFilename::isFile() const
-{
-#if defined(_WIN32)
-
-   struct _stat sbuf;
-   if ( _stat(c_str(), &sbuf ) == -1)
-      return false;
-   return (_S_IFMT & sbuf.st_mode ? true : false);
-#else
-   struct stat sbuf;
-
-   stat(c_str(), &sbuf);
-   return ((sbuf.st_mode & S_IFMT) == S_IFREG);
-#endif
-}
-
-bool ossimFilename::isDir() const
-{
-   if ( empty() )
-   {
-      return false;
-   }
-   
-   ossimFilename temp = c_str();
-   const char& lastChar = temp[temp.size()-1];
-   if ( lastChar == '/' || lastChar == '\\' )
-   {
-      temp = temp.beforePos(temp.size() - 1);
-   }
-	
-#if defined(_WIN32)
-
-   struct _stat sbuf;
-   if ( _stat(temp.c_str(), &sbuf ) == -1)
-      return false;
-   return (_S_IFDIR & sbuf.st_mode ? true : false);
-#else
-   struct stat sbuf;
-   if (stat(temp.c_str(), &sbuf) == -1)
-      return false;
-   return (S_ISDIR(sbuf.st_mode));
-#endif
-}
-
-bool ossimFilename::isReadable() const
-{
-#if defined(_WIN32)
-   
-   struct _stat sbuf;
-   if ( _stat(c_str(), &sbuf ) == -1)
-      return false;
-   return (_S_IREAD & sbuf.st_mode ? true : false);
-#else
-   return (access(c_str(), ossimFilename::OSSIM_READ) == 0);
-#endif
-}
-
-bool ossimFilename::isWriteable() const
-{
-#if defined(_WIN32)
-
-   struct _stat sbuf;
-   if ( _stat(c_str(), &sbuf ) == -1)
-      return false;
-   return (_S_IWRITE & sbuf.st_mode ? true : false);
-#else
-   return (access(c_str(), ossimFilename::OSSIM_WRITE) == 0);
-#endif
-}
-
-bool ossimFilename::isExecutable() const
-{
-#if defined(_WIN32)
-
-   struct _stat sbuf;
-   if ( _stat(c_str(), &sbuf ) == -1)
-      return false;
-   return (_S_IEXEC & sbuf.st_mode ? true : false);
-#else
-   return (access(c_str(), ossimFilename::OSSIM_EXE) == 0);
-#endif
-}
-
-ossimString ossimFilename::ext() const
-{
-   ossimFilename file = *this;
-   std::string::size_type pos = file.m_str.rfind('.');
-   if (pos == std::string::npos)
-   {
-      return ossimFilename::NIL;
-   }
-
-   return ossimFilename(file.m_str.substr(pos+1));
-}
-
-ossimFilename ossimFilename::file() const
-{
-   ossimFilename file = *this;
-
-   //file.convertBackToForwardSlashes();
-
-   std::string::size_type pos = file.m_str.rfind(thePathSeparator);
-   if (pos == std::string::npos)
-      return *this;
-   else
-      return ossimFilename(file.m_str.substr(pos+1));
-}
-
-ossimFilename ossimFilename::path() const
-{
-   ossimFilename file = *this;
-   //file.convertBackToForwardSlashes();
-
-   // finds the last occurrence of the given string; in this case '/';
-   std::string::size_type pos = file.m_str.rfind(thePathSeparator);
-
-   if (pos == 0)
-      return ossimFilename(ossimFilename(thePathSeparator));
-   if (pos == std::string::npos)
-   {
-      // We got to the end of the file and did not find a path separator.
-      return ossimFilename::NIL;
-   }
-
-   return ossimFilename(file.m_str.substr(0, pos));
-}
-
-ossimFilename ossimFilename::drive()const
-{
-   ossimFilename tempFile(*this);
-   ossimFilename result;
-
-   tempFile.convertForwardToBackSlashes();
-
-   ossimRegExp regEx("^([a-z|A-Z])+:");
-
-   if(regEx.find(tempFile.c_str()))
-   {
-      result = ossimFilename(ossimString(this->begin() + regEx.start(),
-                                         this->begin() + regEx.end()));
-   }
-   else
-   {
-      result = "";
-   }
-
-   return result;
-}
-
-ossimFilename ossimFilename::fileNoExtension()const
-{
-   ossimFilename f = *this;
-   //f.convertBackToForwardSlashes();
-
-   std::string::size_type dot_pos   = f.m_str.rfind('.');
-   std::string::size_type slash_pos = f.m_str.rfind(thePathSeparator);
-
-   if(dot_pos == std::string::npos)
-   {
-      if(slash_pos == std::string::npos)
-      {
-         return *this;
-      }
-      else
-      {
-         return ossimFilename(this->begin()+slash_pos+1,
-                              this->end());
-      }
-   }
-   else if(slash_pos == std::string::npos)
-   {
-      return ossimFilename(this->begin(), this->begin()+dot_pos);
-   }
-   else if(slash_pos < dot_pos)
-   {
-      return ossimFilename(this->begin()+slash_pos+1,
-                           this->begin() + dot_pos);
-   }
-
-   return ossimFilename(this->begin()+slash_pos+1,
-                        this->end());
-
-}
-ossimFilename ossimFilename::noExtension()const
-{
-   ossimString drivePart;
-   ossimString pathPart;
-   ossimString filePart;
-   ossimString extPart;
-
-   split(drivePart, pathPart, filePart, extPart);
-
-   extPart.clear();
-
-   ossimFilename result;
-   
-   result.merge(drivePart, pathPart, filePart, extPart);
-   
-   return result;
-}
-
-ossimFilename& ossimFilename::setExtension(const ossimString& e)
-{
-   ossimString newExtPart = e;
-
-   //---
-   // If e has a dot "." in the front of it strip it off...
-   //---
-   if ( (e.begin() != e.end()) && ((*(e.begin())) == '.') )
-   {
-      newExtPart = ossimString(e.begin() + 1, e.end());
-   }
-
-   ossimString drivePart;
-   ossimString pathPart;
-   ossimString filePart;
-   ossimString extPart;
-
-   split(drivePart,
-         pathPart,
-         filePart,
-         extPart);
-
-   merge(drivePart,
-         pathPart,
-         filePart,
-         newExtPart);
-
-   return *this;
-}
-
-ossimFilename& ossimFilename::setDrive(const ossimString& d)
-{
-   ossimString drivePart;
-   ossimString pathPart;
-   ossimString filePart;
-   ossimString extPart;
-
-   split(drivePart,
-         pathPart,
-         filePart,
-         extPart);
-
-   merge(d,
-         pathPart,
-         filePart,
-         extPart);
-
-   return *this;
-}
-
-ossimFilename& ossimFilename::setPath(const ossimString& p)
-{
-   ossimString drivePart;
-   ossimString pathPart;
-   ossimString filePart;
-   ossimString extPart;
-
-   split(drivePart,
-         pathPart,
-         filePart,
-         extPart);
-
-   merge(drivePart,
-         p,
-         filePart,
-         extPart);
-
-   return *this;
-}
-
-ossimFilename& ossimFilename::setFile(const ossimString& f)
-{
-   ossimString drivePart;
-   ossimString pathPart;
-   ossimString filePart;
-   ossimString extPart;
-
-   split(drivePart,
-         pathPart,
-         filePart,
-         extPart);
-
-   merge(drivePart,
-         pathPart,
-         f,
-         extPart);
-
-   return *this;
-}
-
-
-void ossimFilename::split(ossimString& drivePart,
-                          ossimString& pathPart,
-                          ossimString& filePart,
-                          ossimString& extPart)const
-{
-   drivePart = drive();
-   pathPart  = path();
-   if(drivePart != "")
-   {
-      pathPart = pathPart.substitute(drivePart, "");
-   }
-   filePart  = fileNoExtension();
-   extPart   = ext();
-}
-
-void ossimFilename::merge(const ossimString& drivePart,
-                          const ossimString& pathPart,
-                          const ossimString& filePart,
-                          const ossimString& extPart)
-{
-   ossimFilename result = drivePart;
-
-   if(pathPart != "")
-   {
-      result = result.dirCat(ossimFilename(pathPart));
-   }
-
-   if(filePart!="")
-   {
-      result = result.dirCat(ossimFilename(filePart));
-   }
-
-   if(extPart != "")
-   {
-      result += ".";
-      result += extPart;
-   }
-
-   *this = result;
-}
-
-ossimFilename ossimFilename::dirCat(const ossimFilename& file) const
-{
-   // If this string is empty simply return the input file.
-   if (empty()) return file;
-   if (file.empty()) return *this;
-
-   ossimFilename dir      = *this;
-   ossimFilename tempFile = file;
-      
-   // Check the end and see if it already has a "/".
-   string::const_iterator i = dir.end();
-
-   --i; // decrement past the trailing null.
-
-   if ( (*i) != thePathSeparator)
-   {
-      dir += ossimString(thePathSeparator);
-   }
-
-   // check for dot slash or just slash: ./foo or /foo   
-   std::string::iterator iter = tempFile.begin();
-   if (iter != tempFile.end())
-   {
-      if ((*iter) == thePathSeparator)
-      {
-         ++iter; // skip slash
-      }
-      else if (tempFile.size() > 1)
-      {
-         if ( ((*iter) == '.') &&  ( *(iter + 1) == thePathSeparator) )
-         {
-            iter = iter + 2; // skip dot slash
-         }
-      }
-   }   
-
-   dir += std::string(iter, tempFile.end());
-
-   return dir;
-}
-
-ossim_int64 ossimFilename::fileSize() const
-{
-   struct stat sbuf;
-
-#ifndef __BORLANDC__
-   if (stat(c_str(), &sbuf) == 0)
-   {
-      return (ossim_int64)sbuf.st_size;
-   }
-   else
-   {
-      ifstream in(c_str());
-      if(in)
-      {
-         in.seekg(SEEK_END);
-         return (ossim_int64)in.tellg();
-      }
-   }
-#else
-   ifstream in(c_str());
-   if(in)
-   {
-      in.seekg(SEEK_END);
-      return (ossim_int64)in.tellg();
-   }
-#endif
-   return 0;
-}
-
-bool ossimFilename::createDirectory( bool recurseFlag,
-                                     int perm ) const
-{
-   if(exists()) return true;
-
-   if ( empty() ) return false;
-
-   if(recurseFlag)
-   {
-      ossimString tempString = this->expand().c_str();
-
-      vector<ossimString> result;
-      tempString.split(result,thePathSeparator);
-
-      if(result.size())
-      {
-         ossimString current = result[0];
-
-// Reconstruct UNC paths under Windows.
-#if defined(_WIN32)
-         bool bGotUNC = false;
-         if ( current.length() == 0 && tempString.length() > 2 )
-         {
-            const char* fstr = tempString.c_str();
-            const char fstar0 = fstr[0];
-            const char fstar1 = fstr[1];
-            if ( fstar0=='\\' && fstar1=='\\' )
-            {
-               bGotUNC = true;
-               current = thePathSeparator;
-            }
-         }
-#endif
-
-         for(ossim_uint32 i = 1; i < result.size(); ++i)
-         {
-            current += (thePathSeparator+result[i]);
-
-#if defined(_WIN32)
-            if ( bGotUNC == true && i==1 )
-            {
-               // The root of the UNC path is assumed to exist.
-               continue;
-            }
-#endif
-            
-            if(current != thePathSeparator)
-            {
-               if(!ossimFilename(current).exists())
-               {
-#if defined(__BORLANDC__)
-                  if ( _mkdir(current.c_str()) != 0 )
-#elif defined(_WIN32)
-                  if ( _mkdir(current.c_str()) != 0 )
-#else
-                  if ( mkdir(current.c_str(), perm) != 0 )
-#endif
-                  {
-                     return false;
-                  }
-               }
-            }
-         }
-      }
-   }
-   else
-   {
-#if defined (__BORLANDC__)
-      if ( _mkdir(c_str()) != 0 )
-#elif defined(_WIN32)
-      if ( _mkdir(c_str()) != 0 )
-#else
-      if ( mkdir(c_str(), perm) != 0 )
-#endif
-      {
-         return false;
-      }
-      else
-      {
-         return true;
-      }
-   }
-   return true;
-}
-
-bool ossimFilename::remove(const ossimFilename& pathname)
-{
-   bool result = true;
-
-#if defined(__VISUALC__)  || defined(__BORLANDC__) || defined(__WATCOMC__) || \
-   defined(__GNUWIN32__) || defined(_MSC_VER)
-
-   // Note: not sure if these work on all of the above flavors. drb - 14 Sep. 2011.
-   if(pathname.isDir())
-   {
-      // Note this only removes empty directories.
-      result = ( RemoveDirectory( pathname.c_str() ) != 0 );
-   }
-   else
-   {
-      result = ( DeleteFile( pathname.c_str() ) != 0 );
-   }
-#else /* Unix flavor from unistd.h. */
-   if(pathname.isDir())
-   {
-      result = ( rmdir( pathname.c_str() ) == 0 );
-   }
-   else
-   {
-      result = ( unlink( pathname.c_str() ) == 0 );
-   }
-#endif
-
-   return result;
-}
-
-bool ossimFilename::wildcardRemove(const ossimFilename& pathname)
-{
-   std::vector<ossimFilename> fileListToRemove;
-   ossimFilename tempPathname = pathname;
-   
-   if(!tempPathname.isDir())
-   {
-      ossimFilename file = tempPathname.file();
-      ossimFilename path = tempPathname.path();
-      if(path == "")
-      {
-         path = ".";
-      }
-      ossimDirectory dir;
-      if(dir.open(path))
-      {
-         dir.findAllFilesThatMatch(fileListToRemove,
-                                   file.c_str());
-      }
-      else
-      {
-      }
-   }
-   else
-   {
-      fileListToRemove.push_back(ossimFilename(pathname));
-   }
-   ossim_uint32 idx = 0;
-   bool result = true;
-   for(idx = 0; idx < fileListToRemove.size(); ++idx)
-   {
-#if defined(__VISUALC__)  || defined(__BORLANDC__) || defined(__WATCOMC__) || \
-   defined(__GNUWIN32__) || defined(_MSC_VER)
-      
-      if(remove(fileListToRemove[idx].c_str()) != 0)
-      {
-         result = false;
-      }
-#else
-      if (unlink(fileListToRemove[idx]) == -1)
-      {
-         result = false;
-      }
-#endif /* HAVE_UNISTD_H */
-   }
-   return result;
-}
-
-bool ossimFilename::rename(const ossimFilename& destFile, bool overwriteDestinationFlag)const
-{
-   if(!overwriteDestinationFlag)
-   {
-      if(destFile.exists())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING: "
-            << "ossimFilename::rename WARNING:"
-            << "\nDestination File Exists: " << destFile << std::endl;
-         return false;
-      }
-   }
-   else if(destFile.exists())
-   {
-      destFile.remove();
-   }
-   ::rename(this->c_str(), destFile.c_str());
-   
-   return true;
-}
-   
-bool ossimFilename::remove()const
-{
-   return ossimFilename::remove(*this);
-}
-
-bool ossimFilename::wildcardRemove()const
-{
-   return ossimFilename::wildcardRemove(*this);
-}
-
-bool ossimFilename::copyFileTo(const ossimFilename& outputFile) const
-{
-   bool result = false;
-   
-   std::ifstream is(this->c_str(), std::ios::in|std::ios::binary);
-   if ( is.good() )
-   {
-      ossimFilename f = outputFile;
-      if ( f.isDir() )
-      {
-         f = f.dirCat( this->file() );
-      }
-
-      if ( f != *this )
-      {
-         std::ofstream os( f.c_str(), std::ios::out|std::ios::binary );
-         if ( os.good() )
-         {
-            // Copy the file:
-            char c;
-            while(is.get(c))
-            {
-               os.put(c);
-            }
-            
-            if ( is.eof() &&  !os.fail())
-            {
-               result = true;
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "WARNING: "
-                  << "ossimFilename::copyFileTo WARNING:"
-                  << "\nError detected writing from file "
-                  << this->c_str() << " to file " << f.c_str() << std::endl;
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "WARNING: "
-               << "ossimFilename::copyFileTo WARNING:"
-               << "\nCannot open: " << f.c_str() << std::endl;
-         }
-      } //  if ( f != *this )
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING: "
-            << "ossimFilename::copyFileTo WARNING:"
-            << "\nFiles the same!" << std::endl;
-      }
-      
-   } // if ( is.good() )
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "WARNING: "
-         << "ossimFilename::copyFileTo WARNING:"
-         << "\nCannot open: " << this->c_str() << std::endl;
-   }
-   
-   return result;
-}
-
-//---
-// We will only return false if we are absolutely sure absolutely sure we
-// are not relative. No pun intended:)
-//---
-bool ossimFilename::isRelative() const
-{
-   bool result = true;
-   if (size())
-   {
-      //---
-      // Look for unix "/"...
-      // ESH: Look for Windows "\" (with prepending escape character \)
-      //---
-      if ( (*(begin()) == '/') || (*(begin()) == '\\') )
-      {
-         result = false;
-      }
-      else
-      {
-         // Look for windows drive
-         ossimRegExp regEx("^([a-z|A-Z])+:");
-         if ( regEx.find(c_str()) == true)
-         {
-            result = false;
-         }
-      }
-   }
-   return result;
-}
-
-bool ossimFilename::needsExpansion() const
-{
-   bool result = false;
-   if ( size() )
-   {
-      result = isRelative();
-      if (result == false)
-      {
-         // Check for '$'
-         std::string::size_type pos = m_str.find('$', 0);
-         {
-            if (pos != std::string::npos)
-            {
-               // found '$'
-               result = true;
-            }
-         }
-      }    
-   }
-   return result;
-}
-
-char ossimFilename::getPathSeparator() const
-{
-   return thePathSeparator;
-}
-
-void ossimFilename::convertToNative()
-{
-#if defined(_WIN32)
-   convertForwardToBackSlashes();
-#else
-   convertBackToForwardSlashes();
-#endif
-	
-}
-
diff --git a/ossim/src/ossim/base/ossimFilenameProperty.cpp b/ossim/src/ossim/base/ossimFilenameProperty.cpp
deleted file mode 100644
index 5b3db2c..0000000
--- a/ossim/src/ossim/base/ossimFilenameProperty.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-//*************************************************************************
-// $Id: ossimFilenameProperty.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
-#include <ossim/base/ossimFilenameProperty.h>
-
-RTTI_DEF1(ossimFilenameProperty, "ossimFilenameProperty", ossimProperty);
-
-ossimFilenameProperty::ossimFilenameProperty(const ossimString& name,
-                                             const ossimFilename& value,
-                                             const std::vector<ossimString>& filterList)
-   :ossimProperty(name),
-    theValue(value),
-    theFilterList(filterList),
-    theIoType(ossimFilenamePropertyIoType_NOT_SPECIFIED)
-{
-}
-
-ossimFilenameProperty::ossimFilenameProperty(const ossimFilenameProperty& rhs)
-   :ossimProperty(rhs),
-    theValue(rhs.theValue),
-    theFilterList(rhs.theFilterList),
-    theIoType(rhs.theIoType)
-{
-}
-
-ossimFilenameProperty::~ossimFilenameProperty()
-{
-}
-
-ossimObject* ossimFilenameProperty::dup()const
-{
-   return new ossimFilenameProperty(*this);
-}
-
-void ossimFilenameProperty::valueToString(ossimString& valueResult)const
-{
-   valueResult = theValue;
-}
-
-bool ossimFilenameProperty::setValue(const ossimString& value)
-{
-   theValue = value;
-
-   return true;
-}
-
-const ossimFilenameProperty& ossimFilenameProperty::operator = (ossimFilenameProperty& rhs)
-{
-   assign(rhs);
-
-   return *this;
-}
-
-const ossimProperty& ossimFilenameProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-   theValue = rhs.valueToString();
-
-   ossimFilenameProperty* rhsPtr = PTR_CAST(ossimFilenameProperty,
-                                            &rhs);
-
-   if(rhsPtr)
-   {
-      theFilterList = rhsPtr->theFilterList;
-      theIoType     = rhsPtr->theIoType;
-   }
-
-   return *this;
-}
-
-void ossimFilenameProperty::clearFilterList()
-{
-   theFilterList.clear();
-}
-
-ossim_uint32 ossimFilenameProperty::getNumberOfFilters()const
-{
-   return (ossim_uint32)theFilterList.size();
-}
-
-void ossimFilenameProperty::setFilter(ossim_uint32 idx,
-                                      const ossimString& filterValue)
-{
-   if(idx < getNumberOfFilters())
-   {
-      theFilterList[idx] = filterValue;
-   }
-}
-
-ossimString ossimFilenameProperty::getFilter(ossim_uint32 idx)const
-{
-   if(idx < getNumberOfFilters())
-   {
-      return theFilterList[idx];
-   }
-
-   return ossimString("");
-}
-
-
-ossimString ossimFilenameProperty::getFilterListAsString(const ossimString& separator)const
-{
-   ossimString result;
-   ossim_uint32 idx = 0;
-
-   if(getNumberOfFilters() > 0)
-   {
-      for(idx = 0; idx < getNumberOfFilters()-1;++idx)
-      {
-         result += getFilter(idx);
-         result += separator;
-      }
-      result += getFilter(getNumberOfFilters()-1);
-   }
-
-   return result;
-}
-
-
-const std::vector<ossimString>& ossimFilenameProperty::getFilterList()const
-{
-   return theFilterList;
-}
-
-void ossimFilenameProperty::addFilter(const ossimString& filter)
-{
-   theFilterList.push_back(filter);
-}
-
-
-void ossimFilenameProperty::setIoType(ossimFilenamePropertyIoType ioType)
-{
-   theIoType = ioType;
-}
-
-ossimFilenameProperty::ossimFilenamePropertyIoType ossimFilenameProperty::getIoType()const
-{
-   return theIoType;
-}
-
-bool ossimFilenameProperty::isIoTypeInput()const
-{
-   return (theIoType==ossimFilenamePropertyIoType_INPUT);
-}
-
-bool ossimFilenameProperty::isIoTypeOutput()const
-{
-   return (theIoType==ossimFilenamePropertyIoType_OUTPUT);
-}
diff --git a/ossim/src/ossim/base/ossimFontProperty.cpp b/ossim/src/ossim/base/ossimFontProperty.cpp
deleted file mode 100644
index 7999ab3..0000000
--- a/ossim/src/ossim/base/ossimFontProperty.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimFontProperty.cpp 9094 2006-06-13 19:12:40Z dburken $
-#include <sstream>
-#include <ossim/base/ossimFontProperty.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-
-RTTI_DEF1(ossimFontProperty, "ossimFontProperty", ossimProperty);
-
-ossimFontProperty::ossimFontProperty(const ossimString& name,
-                                     const ossimFontInformation& value)
-   :ossimProperty(name),
-    theValue(value)
-{
-   
-}
-
-ossimFontProperty::ossimFontProperty(const ossimFontProperty& rhs)
-   :ossimProperty(rhs),
-    theValue(rhs.theValue)
-{
-}
-
-ossimFontProperty::~ossimFontProperty()
-{
-}
-
-ossimObject* ossimFontProperty::dup()const
-{
-   return new ossimFontProperty(*this);
-}
-
-const ossimProperty& ossimFontProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-
-   ossimFontProperty* rhsPtr = PTR_CAST(ossimFontProperty,
-                                        &rhs);
-
-   if(rhsPtr)
-   {
-      theValue = rhsPtr->theValue;
-   }
-   
-   return *this;
-}
-
-bool ossimFontProperty::setValue(const ossimString& value)
-{
-   bool result = true;
-   ossimKeywordlist kwl;
-
-   std::istringstream in(value);
-
-   result = kwl.parseStream(in);
-   if(result)
-   {
-      theValue.loadState(kwl);
-   }
-
-   return result;
-}
-
-void ossimFontProperty::valueToString(ossimString& valueResult)const
-{
-   std::ostringstream out;
-   ossimKeywordlist kwl;
-
-   theValue.saveState(kwl);
-   
-   kwl.writeToStream(out);
-   valueResult = kwl.toString();
-}
-
-void ossimFontProperty::setFontInformation(ossimFontInformation& fontInfo)
-{
-   theValue = fontInfo;
-}
-
-const ossimFontInformation& ossimFontProperty::getFontInformation()const
-{
-   return theValue;
-}
diff --git a/ossim/src/ossim/base/ossimGeoTiffDatumLut.cpp b/ossim/src/ossim/base/ossimGeoTiffDatumLut.cpp
deleted file mode 100644
index a6b2280..0000000
--- a/ossim/src/ossim/base/ossimGeoTiffDatumLut.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimGeoTiffDatumLut.
-//*******************************************************************
-//  $Id: ossimGeoTiffDatumLut.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimGeoTiffDatumLut.h>
-#include <ossim/base/ossimString.h>
-
-static const int TABLE_SIZE = 24;
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimGeoTiffDatumLut::ossimGeoTiffDatumLut()
-   :
-      ossimLookUpTable(TABLE_SIZE)
-{
-   //***
-   // Complete initialization of data member "theTable".
-   // Note:  Scalar types defined in constants.h file.
-   //***
-   theTable[0].theKey    = GCS_Adindan;
-   theTable[0].theValue  = "ADI-M";
-   
-   theTable[1].theKey    = GCS_Arc_1950;
-   theTable[1].theValue  = "ARF-M";
-   
-   theTable[2].theKey    = GCS_Arc_1960;
-   theTable[2].theValue  = "ARS-M";
-   
-   theTable[3].theKey    = GCS_ED50;
-   theTable[3].theValue  = "EUR-M";
-   
-   theTable[4].theKey    = GCS_NAD27;
-   theTable[4].theValue  = "NAS-C";
-   
-   theTable[5].theKey    = GCS_NAD83;
-   theTable[5].theValue  = "NAR-C";
-   
-   theTable[6].theKey    = GCS_OSGB_1936;
-   theTable[6].theValue  = "OGB-M";
-   
-   theTable[7].theKey    = GCS_WGS_72;
-   theTable[7].theValue  = "WGD";
-   
-   theTable[8].theKey    = GCS_WGS_84;
-   theTable[8].theValue  = "WGE";
-   
-   theTable[9].theKey    = GCS_Tokyo;
-   theTable[9].theValue  = "TOY-M";
-   
-   theTable[10].theKey   = DatumE_WGS84;
-   theTable[10].theValue = "WGE";
-   
-   theTable[11].theKey   = Datum_Adindan;
-   theTable[11].theValue = "ADI-M";
-   
-   theTable[12].theKey   = Datum_Arc_1950;
-   theTable[12].theValue = "ARF-M";
-   
-   theTable[13].theKey   = Datum_Arc_1960;
-   theTable[13].theValue = "ARS-M";
-   
-   theTable[14].theKey   = Datum_European_Datum_1950;
-   theTable[14].theValue = "EUR-M";
-   
-   theTable[15].theKey   = Datum_North_American_Datum_1927;
-   theTable[15].theValue = "NAS-C";
-   
-   theTable[16].theKey   = Datum_North_American_Datum_1983;
-   theTable[16].theValue = "NAR-C";
-   
-   theTable[17].theKey   = Datum_OSGB_1936;
-   theTable[17].theValue = "OGB-M";
-   
-   theTable[18].theKey   = Datum_Tokyo;
-   theTable[18].theValue = "TOY-M";
-   
-   theTable[19].theKey   = Datum_WGS72;
-   theTable[19].theValue = "WGD";
-   
-   theTable[20].theKey   = Datum_WGS84;
-   theTable[20].theValue = "WGE";
-
-   theTable[21].theKey   = Datum_NAD83_HARN;
-   theTable[21].theValue = "NAR";
-
-   theTable[22].theKey   = GCS_NAD83_HARN;
-   theTable[22].theValue = "NAR";
-
-   //---
-   // Note:  This code implies a Clark 1866 ellipse with no datum.
-   // NAS-C used as work around for poor tag setting out of Erdas Imagine.
-   //---
-   theTable[23].theKey   = GCS_Clark_1866;
-   theTable[23].theValue = "NAS-C";
-   theTable[23].theKey   = 3785;
-   theTable[23].theValue = "6055";
-   theTable[23].theKey   = 900913;
-   theTable[23].theValue = "6055";
-}
-
-ossimGeoTiffDatumLut::~ossimGeoTiffDatumLut()
-{
-}
-
-ossimKeyword ossimGeoTiffDatumLut::getKeyword() const
-{
-   return ossimKeyword("geotiff_datum_code", "");
-}
-
diff --git a/ossim/src/ossim/base/ossimGeoidImage.cpp b/ossim/src/ossim/base/ossimGeoidImage.cpp
deleted file mode 100644
index 88667f3..0000000
--- a/ossim/src/ossim/base/ossimGeoidImage.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Generic geoid source which uses an image handler for reading the grid.
-// 
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimGeoidImage.h>
-
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/projection/ossimProjection.h>
-#include <cmath>
-
-ossimGeoidImage::ossimGeoidImage()
-   : m_geom(0),
-     m_handler(0),
-     m_cacheTile(0),
-     m_geoidTypeName(),
-     m_memoryMapFlag(false),
-     m_enabledFlag(true),
-     m_imageRect()
-{
-}
-
-ossimGeoidImage::~ossimGeoidImage()
-{
-   m_geom = 0;
-   m_handler = 0;
-   m_cacheTile = 0;
-}
-
-bool ossimGeoidImage::open( const ossimFilename& file, ossimByteOrder /* byteOrder */ )
-{
-   static const char MODULE[] = "ossimGeoidImage::open";
-   
-   m_geom = 0;
-   m_cacheTile = 0;
-   if ( m_handler.valid() )
-   {
-      m_handler->close();
-   }
-
-   m_handler =
-      ossimImageHandlerRegistry::instance()->open(file,
-                                                  true, // try suffix 1st
-                                                  false); // open overview
-   if ( m_handler.valid() )
-   {
-      // Store the bounding rectangle:
-      m_imageRect = m_handler->getImageRectangle( 0 );
-
-      // Scalar type:
-      m_scalarType = m_handler->getOutputScalarType();
-      
-      // Get the geometry info.  Need this to compute grid indexes.
-      m_geom = m_handler->getImageGeometry();
-
-      if ( m_geom.valid() )
-      {
-         // Verify the geometry object has a good projection.
-         if ( m_geom->getProjection() )
-         {
-            if ( m_memoryMapFlag )
-            {
-               try
-               {
-                  m_cacheTile = m_handler->getTile( m_imageRect, 0 );
-                  
-                  if ( m_cacheTile.valid() )
-                  {
-                     // Close the image handler:
-                     m_handler->close();
-                     m_handler = 0;
-                  }
-               }
-               catch ( const ossimException& e )
-               {
-                  m_memoryMapFlag = false;
-                  m_cacheTile = 0;
-                  
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << MODULE << " ERROR: Caught Exception!"
-                     << "\n" << e.what()
-                     << "\nMemory mapping entire grid into memory has been disabled..."
-                     << std::endl;
-               }
-            }
-         }
-         else
-         {
-            m_handler = 0;
-            m_geom    = 0;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "\nGeometry object has null projection!"
-               << std::endl;
-         }
-      }
-         
-      else
-      {
-         m_handler = 0;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:"
-            << "\nCould not get geometry info!"
-            << std::endl;
-      }
-   }
-   
-   return ( m_geom.valid() && (m_handler.valid() || (m_memoryMapFlag && m_cacheTile.valid()) ));
-}
-
-ossimString ossimGeoidImage::getShortName() const
-{
-   return m_geoidTypeName;
-}
-
-void ossimGeoidImage::setShortName( const std::string& geoidTypeName )
-{
-   m_geoidTypeName = geoidTypeName;
-}
-
-bool ossimGeoidImage::getMemoryMapFlag() const
-{
-   return m_memoryMapFlag;
-}
-
-void ossimGeoidImage::setMemoryMapFlag( bool flag )
-{
-   m_memoryMapFlag = flag; 
-}
-   
-bool ossimGeoidImage::saveState( ossimKeywordlist& kwl,
-                                 const char* prefix ) const
-{
-   std::string myPrefix = ( prefix ? prefix : "" );
-
-   // Save the connection string:
-   std::string key = "connection_string";
-   kwl.addPair( myPrefix, key, m_connectionString, true );
-
-   // Save the geoid type name:
-   key = "geoid.type";
-   kwl.addPair( myPrefix, key, m_geoidTypeName.string(), true );
-
-   // Save the memory map flag:
-   key = "memory_map";
-   std::string value = (m_memoryMapFlag ? "true" : "false");
-   kwl.addPair( myPrefix, key, value, true );
-
-   // Save the enabledFlag:
-   key = ossimKeywordNames::ENABLED_KW;
-   value = m_enabledFlag ? "true" : "false";
-   kwl.addPair( myPrefix, key, value, true );
-
-   // Save the type:
-   key = ossimKeywordNames::TYPE_KW;
-   value = "geoid_image";
-   kwl.addPair( myPrefix, key, value, true );
-   
-   return true;
-}
-
-bool ossimGeoidImage::loadState( const ossimKeywordlist& kwl,
-                                 const char* prefix )
-{
-   bool result = false;
-   
-   std::string myPrefix = prefix ? prefix : "";
-   
-   // Check the type name:
-   std::string key = ossimKeywordNames::TYPE_KW;
-   std::string value = kwl.findKey( myPrefix, key );
-
-   if ( (value == "geoid_image" ) || ( value == "ossimGeoidImage" ) )
-   {
-      // Get the geoid type name:
-      key = "geoid.type";
-      m_geoidTypeName = kwl.findKey( myPrefix, key );
-
-      // Get the memory map flag:
-      key = "memory_map";
-      value = kwl.findKey( myPrefix, key );
-      m_memoryMapFlag = ossimString( value ).toBool();
-
-      // Get the enabled flag:
-      key = ossimKeywordNames::ENABLED_KW;
-      value = kwl.findKey( myPrefix, key );
-      m_enabledFlag = ossimString( value ).toBool();
-      
-      // Get the connection string:
-      std::string key = "connection_string";
-      m_connectionString = kwl.findKey( myPrefix, key );
-      if ( m_connectionString.size() )
-      {
-         result = open( ossimFilename( m_connectionString ) );
-      }
-   }
-   
-   return result;
-}
-
-
-double ossimGeoidImage::offsetFromEllipsoid( const ossimGpt& gpt )
-{
-   double offset = ossim::nan();
-
-   if ( m_enabledFlag )
-   {
-      if ( m_geom.valid() &&
-           ( m_handler.valid() ||
-             ( m_memoryMapFlag && m_cacheTile.valid() )
-             )
-           )
-      {
-         switch(m_scalarType)
-         {
-            case OSSIM_SINT16:
-            {
-               offset = offsetFromEllipsoidTemplate((ossim_sint16)0, gpt);
-               break;
-            }
-            case OSSIM_FLOAT32:
-            {
-               offset = offsetFromEllipsoidTemplate((ossim_float32)0, gpt);
-               break;
-            }
-            case OSSIM_FLOAT64:
-            {
-               offset = offsetFromEllipsoidTemplate((ossim_float64)0, gpt);
-               break;
-            }
-            default:
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimGeoidImage::offsetFromEllipsoid ERROR:\n"
-                  << "Unhandled scalar type: "
-                  << ossimScalarTypeLut::instance()->getEntryString( m_scalarType )
-                  << std::endl;
-               break;
-            }
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimGeoidImage::offsetFromEllipsoid ERROR: Object not initialized!\n"
-            << std::endl;
-      }
-      
-   } // Matches: if ( m_enabledFlag )
-   
-   return offset;
-}
-
-template <class T>
-double ossimGeoidImage::offsetFromEllipsoidTemplate(T /* dummy */,
-                                                    const ossimGpt& gpt)
-{
-   double geoidOffset = ossim::nan();
-
-   // Change the datum if needed:
-   ossimGpt copyGpt = gpt;
-   if(ossimDatumFactory::instance()->wgs84())
-   {
-      copyGpt.changeDatum(ossimDatumFactory::instance()->wgs84());
-   }
-   
-   // Fix wrap conditions:
-   copyGpt.wrap();
-   
-   // Get the local image point for the input ground point.
-   ossimDpt imgDpt;
-   m_geom->worldToLocal( copyGpt, imgDpt );
-
-   if ( m_imageRect.pointWithin( ossimIpt( imgDpt ) ) )
-   {
-      ossim_int32 x0 = static_cast<ossim_int32>( imgDpt.x );
-      ossim_int32 y0 = static_cast<ossim_int32>( imgDpt.y );
-      
-      ossim_int32 IW = static_cast<ossim_int32>(m_imageRect.width());
-      ossim_int32 IH = static_cast<ossim_int32>(m_imageRect.height());
-      
-      if ( x0 == (IW-1) )
-      {
-         --x0;  // Move over one point.
-      }
-      if ( y0 == (IH-1) )
-      {
-         --y0; // Move over one point.
-      }
-
-      if ( !m_memoryMapFlag )
-      {
-         // Get the four points from the image handler.
-         ossimIrect tileRect(ossimIpt(x0, y0), ossimIpt(x0+1, y0+1));
-         m_cacheTile = m_handler->getTile( tileRect, 0 );
-      }
-      
-      if ( m_cacheTile.valid() )
-      {
-         // Get a pointer to the buffer.
-         const T* buf = static_cast<const T*>(m_cacheTile->getBuf());
-         
-         if ( buf )
-         {
-            const ossim_float64 NP = m_cacheTile->getNullPix(0);
-            const ossim_int64 TW = static_cast<ossim_int64>(m_cacheTile->getWidth());
-            ossim_int64 offset = (y0 - m_cacheTile->getOrigin().y) * TW +
-               (x0 - m_cacheTile->getOrigin().x);
-            ossim_int64 offset2 = offset + TW;
-            
-            double p00 = buf[offset];
-            double p01 = buf[offset+1];
-            double p10 = buf[offset2];
-            double p11 = buf[offset2+1];
-            
-            double xt0 = imgDpt.x - x0;
-            double yt0 = imgDpt.y - y0;
-            double xt1 = 1-xt0;
-            double yt1 = 1-yt0;
-            
-            double w00 = xt1*yt1;
-            double w01 = xt0*yt1;
-            double w10 = xt1*yt0;
-            double w11 = xt0*yt0;
-            
-            //---
-            // Test for null posts and set the corresponding weights to 0:
-            //---
-            if (p00 == NP) w00 = 0.0;
-            if (p01 == NP) w01 = 0.0;
-            if (p10 == NP) w10 = 0.0;
-            if (p11 == NP) w11 = 0.0;                  
-            
-            double sum_weights = w00 + w01 + w10 + w11;
-            if (sum_weights)
-            {
-               geoidOffset = (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
-            }
-         }
-         
-      } // Matches: if ( m_cacheTile.valid() )
-      
-   } // Matches: if ( m_imageRect.pointWithin( imgPt ) )
-
-   return geoidOffset;
-}
-
-
diff --git a/ossim/src/ossim/base/ossimGeoidManager.cpp b/ossim/src/ossim/base/ossimGeoidManager.cpp
deleted file mode 100644
index 8e97ebb..0000000
--- a/ossim/src/ossim/base/ossimGeoidManager.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-//*****************************************************************************
-// FILE: ossimGeoidManager.cpp
-//
-// License:  See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class ossimGeoidManager
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimGeoidManager.cpp 22906 2014-09-30 17:28:52Z dburken $
-
-
-#include <ossim/base/ossimGeoidManager.h>
-
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEnvironmentUtility.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimGeoidNgs.h>
-#include <ossim/base/ossimGeoidEgm96.h>
-#include <ossim/base/ossimGeoidImage.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeyword.h>
-#include <ossim/base/ossimNotifyContext.h>
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimGeoidManager:exec");
-static ossimTrace traceDebug ("ossimGeoidManager:debug");
-
-RTTI_DEF1(ossimGeoidManager, "ossimGeoidManager", ossimGeoid);
-
-//ossimGeoidManager* ossimGeoidManager::theInstance = 0;
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimGeoidManager
-//  
-//*****************************************************************************
-ossimGeoidManager::ossimGeoidManager()
-{
-  // theInstance = this;
-   theIdentityGeoid = new ossimIdentityGeoid();
-}
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimGeoidManager
-//  
-//*****************************************************************************
-ossimGeoidManager::~ossimGeoidManager()
-{
-//    vector<ossimGeoid*>::iterator g = theGeoidList.begin();
-//    while (g != theGeoidList.end())
-//    {
-//       delete *g;
-//       ++g;
-//    }
-   theGeoidList.clear();
-}
-
-//*****************************************************************************
-//  METHOD: ossimGeoidManager::instance()
-//  
-//*****************************************************************************
-ossimGeoidManager* ossimGeoidManager::instance()
-{
-   static ossimGeoidManager inst;
-//   if (!theInstance)
-//   {
-//      theInstance = new ossimGeoidManager();
-//   }
-   
-   //return theInstance;
-   return &inst;
-}
-
-//*****************************************************************************
-//  METHOD: ossimElevManager::addGeoidSource
-//  
-//*****************************************************************************
-void ossimGeoidManager::addGeoid(ossimRefPtr<ossimGeoid> geoid, bool toFrontFlag)
-{
-   if(!toFrontFlag)
-   {
-      theGeoidList.push_back(geoid);
-   }
-   else
-   {
-      theGeoidList.insert(theGeoidList.begin(), geoid);
-   }
-}
-
-bool ossimGeoidManager::saveState(ossimKeywordlist& /* kwl */,
-                                  const char* /* prefix */ ) const
-{
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimGeoidManager::loadState()
-//  
-//*****************************************************************************
-bool ossimGeoidManager::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix)
-{
-   static const char MODULE[] = "ossimGeoidManager::loadState()";
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG: " << MODULE << ", entering...\n";
-
-   //---
-   // Look for geoid sources:
-   // Note: the ossimInit::initializeElevation() does not pass a prefix to us
-   // as it should...
-   //---
-   std::string geoidMgrPrefix = prefix ? prefix : "geoid.manager.";
-
-   ossimString regExpression =  ossimString("^(") + geoidMgrPrefix.c_str() +
-      "geoid_source[0-9]+.)";
-
-   vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
-   if ( keys.size() )
-   {
-      for ( ossim_uint32 idx = 0; idx < keys.size(); ++idx )
-      {
-         std::string newPrefix = keys[idx];
-
-         // See if enable flag is set to false.
-         bool enabled = true;
-         std::string key = ossimKeywordNames::ENABLED_KW;
-         std::string value = kwl.findKey( newPrefix, key );
-         if ( value.size() )
-         {
-            enabled = ossimString( value ).toBool();
-         }
-
-         if ( enabled )
-         {
-            // Get the type:
-            key = ossimKeywordNames::TYPE_KW;
-            value = kwl.findKey( newPrefix, key );
-
-            if ( (value == "geoid_image" ) || ( value == "ossimGeoidImage" ) )
-            {
-               ossimRefPtr<ossimGeoid> geoid = new ossimGeoidImage();
-               if ( geoid->loadState( kwl, newPrefix.c_str() ) )
-               {
-                  if (traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_DEBUG)
-                        << "DEBUG: " << MODULE
-                        << "\nAdded geoid:  " << geoid->getShortName() << "\n";
-                  }
-                  addGeoid(geoid.get());
-               }
-            }
-         }
-      }
-   }
-
-   // End of "geoid_sources" block.
-   
-   // Look for the ngs geoid directories
-   const char* lookup = kwl.find(prefix, "geoid_99_directory");
-   ossimByteOrder geoidNgsByteOrder = OSSIM_LITTLE_ENDIAN;
-   const char* byteOrder = kwl.find(prefix, "geoid_99_directory.byte_order");
-   if (!lookup)
-   {
-      lookup = kwl.find(prefix, "geoid_ngs_directory");
-      byteOrder = kwl.find(prefix, "geoid_ngs_directory.byte_order");
-   }
-   if(byteOrder)
-   {
-      if(ossimString(byteOrder).contains("little"))
-      {
-         geoidNgsByteOrder = OSSIM_LITTLE_ENDIAN;
-      }
-      else
-      {
-         geoidNgsByteOrder = OSSIM_BIG_ENDIAN;
-      }
-   }
-   if(lookup)
-   {
-      ossimFilename f = lookup;
-      if (f.isDir())
-      {
-         ossimRefPtr<ossimGeoid> geoid = new ossimGeoidNgs(f, geoidNgsByteOrder);
-
-         if (geoid->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG: " << MODULE
-                  << "\nAdded geoid dir:  " << f.c_str() << "\n";
-            }
-            addGeoid(geoid.get());
-         }
-         else
-         {
-            geoid = 0;
-         }
-      }
-   }
-
-   ossimFilename geoidGrid1996 = ossimEnvironmentUtility::instance()->getUserOssimSupportDir();
-   geoidGrid1996 = geoidGrid1996.dirCat("geoids");
-   geoidGrid1996 = geoidGrid1996.dirCat("geoid1996");
-   geoidGrid1996 = geoidGrid1996.dirCat("egm96.grd");
-
-   if(!geoidGrid1996.exists())
-   {
-      geoidGrid1996 = ossimEnvironmentUtility::instance()->getInstalledOssimSupportDir();
-      geoidGrid1996 = geoidGrid1996.dirCat("geoids");
-      geoidGrid1996 = geoidGrid1996.dirCat("geoid1996");
-      geoidGrid1996 = geoidGrid1996.dirCat("egm96.grd");
-   }
-
-   if( geoidGrid1996.exists() )
-   {
-      ossimRefPtr<ossimGeoid> geoid = new ossimGeoidEgm96(geoidGrid1996);
-      if (geoid->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "DEBUG: " << MODULE
-               << "\nAdded geoid egm 96:  " << geoidGrid1996.c_str()
-               << "\n";
-         }
-         addGeoid(geoid.get());
-      }
-      else
-      {
-         geoid = 0;
-      }
-   }
-   else
-   {
-      // Look for the geoid Earth Gravity Model (EGM) 96 directory.
-      lookup = kwl.find(prefix, "geoid_egm_96_grid");
-      if (lookup)
-      {
-         ossimFilename f = lookup;
-         if (f.isDir() || f.isFile())
-         {
-            ossimRefPtr<ossimGeoid> geoid = new ossimGeoidEgm96(f);
-            
-            if (geoid->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-            {
-               if (traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << "DEBUG: " << MODULE
-                     << "\nAdded geoid egm 96:  " << f.c_str()
-                     << "\n";
-               }
-               
-               addGeoid(geoid.get());
-            }
-            else
-            {
-               geoid = 0;
-            }
-         }
-      }
-   }
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG: " << MODULE << ", returning...\n";
-   }
-   
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimGeoidManager::open()
-//  
-//*****************************************************************************
-bool ossimGeoidManager::open(const ossimFilename& dir, ossimByteOrder byteOrder)
-{
-   std::vector<ossimRefPtr<ossimGeoid> >::iterator g = theGeoidList.begin();
-   bool status = true;
-   while (g != theGeoidList.end())
-   {
-      status &= (*g)->open(dir, byteOrder);
-      ++g;
-   }
-
-   return status;
-}
-
-//*****************************************************************************
-//  METHOD: ossimGeoidManager::open()
-//  
-//*****************************************************************************
-double ossimGeoidManager::offsetFromEllipsoid(const ossimGpt& gpt)
-{
-   double offset = ossim::nan();
-   std::vector<ossimRefPtr<ossimGeoid> >::iterator geoid =
-      theGeoidList.begin();
-   
-   while ( ossim::isnan(offset) && (geoid != theGeoidList.end()))
-   {
-      offset = ((*geoid))->offsetFromEllipsoid(gpt);
-      ++geoid;
-   }
-   
-   return offset;
-}
-
-ossimGeoid* ossimGeoidManager::findGeoidByShortName(const ossimString& shortName, bool caseSensitive)
-{
-   ossim_uint32 idx=0;
-   ossimString testString = shortName;
-   if(shortName == "identity")
-   {
-      return theIdentityGeoid.get();
-   }
-   if(!caseSensitive)
-   {
-      testString  = testString.downcase();
-   }
-   for(idx = 0; idx < theGeoidList.size(); ++idx)
-   {
-      if(!caseSensitive)
-      {
-         if(theGeoidList[idx]->getShortName().downcase() == testString)
-         {
-            return theGeoidList[idx].get();
-         }
-      }
-      else
-      {
-         if(theGeoidList[idx]->getShortName() == testString)
-         {
-            return theGeoidList[idx].get();
-         }
-      }
-   }
-   return 0;
-}
diff --git a/ossim/src/ossim/base/ossimGrect.cpp b/ossim/src/ossim/base/ossimGrect.cpp
deleted file mode 100644
index 951bf71..0000000
--- a/ossim/src/ossim/base/ossimGrect.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// Description:
-//
-//*************************************************************************
-// $Id: ossimGrect.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimGrect.h>
-using namespace std;
-
-ostream& operator<<(ostream& os, const ossimGrect& rect)
-{
-   return os << rect.theUlCorner << ", " << rect.theLrCorner << endl;
-}
-
-ossimGrect::ossimGrect(vector<ossimGpt>& points)
-   :
-   theUlCorner(0.0, 0.0, 0.0),
-   theLrCorner(0.0, 0.0, 0.0)
-{
-   // initialize everyone to the first point
-   if(points.size() > 0)
-   {
-      double minHgt = 0.0;
-      double maxHgt = 0.0;
-      theUlCorner = points[0];
-      theLrCorner = theUlCorner;
-      minHgt = theUlCorner.hgt;
-      maxHgt = minHgt;
-      
-      // find the bounds
-      for(ossim_uint32 index = 1; index < points.size(); index++)
-      {
-         // find left most
-         if(theUlCorner.lond() > points[index].lond())
-         {
-            theUlCorner.lond(points[index].lond());
-         } // find right most
-         else if(theLrCorner.lond() < points[index].lond())
-         {
-            theLrCorner.lond(points[index].lond());
-         }
-         //find top most
-         if(points[index].latd() > theUlCorner.latd())
-         {
-            theUlCorner.latd(points[index].latd());
-         }// find bottom most
-         else if(points[index].latd() < theLrCorner.latd())
-         {
-            theLrCorner.latd(points[index].latd());
-         }
-         
-         if (points[index].hgt > maxHgt)
-         {
-            maxHgt = points[index].hgt;
-         }
-         else if (points[index].hgt < minHgt)
-         {
-            minHgt = points[index].hgt;
-         }
-      }
-      
-      theUlCorner.hgt = maxHgt;
-      theLrCorner.hgt = minHgt;
-   }
-}
-
-ossimGrect::ossimGrect(const ossimGpt& p1, const ossimGpt& p2)
-{
-   if(p1.lon < p2.lon)
-   {
-      theUlCorner.lon = p1.lon;
-      theLrCorner.lon = p2.lon;
-   }
-   else
-   {
-      theUlCorner.lon = p2.lon;
-      theLrCorner.lon = p1.lon;
-   }
-
-   if(p1.lat > p2.lat)
-   {
-      theUlCorner.lat = p1.lat;
-      theLrCorner.lat = p2.lat;
-   }
-   else
-   {
-      theUlCorner.lat = p2.lat;
-      theLrCorner.lat = p1.lat;
-   }
-
-   if(p1.hgt > p2.hgt)
-   {
-      theUlCorner.hgt = p1.hgt;
-      theLrCorner.hgt = p2.hgt;
-   }
-   else
-   {
-      theUlCorner.hgt = p2.hgt;
-      theLrCorner.hgt = p1.hgt;
-   }
-}
-
-ossimGrect::ossimGrect(const ossimGpt& p1,
-                       const ossimGpt& p2,
-                       const ossimGpt& p3,
-                       const ossimGpt& p4)
-{
-   unsigned long index;
-   double minHgt, maxHgt;
-
-   std::vector<ossimGpt> points(4);
-   points[0] = p1;
-   points[1] = p2;
-   points[2] = p3;
-   points[3] = p4;
-
-   // initialize everyone to the first point
-   theUlCorner = points[0];
-   theLrCorner = theUlCorner;
-   minHgt = theUlCorner.hgt;
-   maxHgt = minHgt;
-   
-   // find the bounds
-   for(index = 1; index < points.size(); index++)
-   {
-      // find left most
-      if(theUlCorner.lond() > points[index].lond())
-      {
-         theUlCorner.lond(points[index].lond());
-      } // find right most
-      else if(theLrCorner.lond() < points[index].lond())
-      {
-         theLrCorner.lond(points[index].lond());
-      }
-      //find top most
-      if(points[index].latd() > theUlCorner.latd())
-      {
-         theUlCorner.latd(points[index].latd());
-      }// find bottom most
-      else if(points[index].latd() < theLrCorner.latd())
-      {
-         theLrCorner.latd(points[index].latd());
-      }
-
-      if (points[index].hgt > maxHgt)
-         maxHgt = points[index].hgt;
-      else if (points[index].hgt < minHgt)
-         minHgt = points[index].hgt;
-   }
-   theUlCorner.hgt = maxHgt;
-   theLrCorner.hgt = minHgt;
-}
-
-ossimGrect ossimGrect::stretchToEvenBoundary(double latSpacingInDegrees,
-                                             double lonSpacingInDegrees)const
-{
-   double ulLat = ((long)ceil(theUlCorner.latd()/latSpacingInDegrees))*
-                  latSpacingInDegrees;
-   double ulLon = ((long)floor(theUlCorner.lond()/lonSpacingInDegrees))*
-                  lonSpacingInDegrees;
-   double lrLat = ((long)floor(theLrCorner.latd()/latSpacingInDegrees))*
-                  latSpacingInDegrees;
-   double lrLon = ((long)ceil(theLrCorner.lond()/lonSpacingInDegrees))*
-                  lonSpacingInDegrees;
-   
-   ossimGpt ul (ulLat, ulLon, theUlCorner.hgt, theUlCorner.datum());
-   ossimGpt lr (lrLat, lrLon, theLrCorner.hgt, theLrCorner.datum());
-
-   return ossimGrect(ul, lr);
-}
-
-void ossimGrect::computeEvenTiles(std::vector<ossimGrect>& result,
-                                  double latSpacingInDegrees,
-                                  double lonSpacingInDegrees,
-                                  bool clipToGeographicBounds)const
-{
-   ossimGrect clipRect = ossimGrect(90, -180, -90, 180);
-   result.clear();
-   ossimGrect temp = stretchToEvenBoundary(latSpacingInDegrees,
-                                           lonSpacingInDegrees);
-
-   ossimGpt point = temp.ul();
-   
-   while(temp.pointWithin(point))
-   {
-      while(temp.pointWithin(point))
-      {
-         ossimGrect rect(point.latd(),
-                         point.lond(),
-                         point.latd()-latSpacingInDegrees,
-                         point.lond()+lonSpacingInDegrees);
-
-         rect.theUlCorner.datum( theUlCorner.datum());
-         rect.theLrCorner.datum( theUlCorner.datum());
-         if(clipToGeographicBounds)
-         {
-            rect = rect.clipToRect(clipRect);
-         }
-         result.push_back(rect);
-
-         point.lond(point.lond()+lonSpacingInDegrees);
-      }
-      point.lond(temp.ul().lond());
-      point.latd(point.latd()-latSpacingInDegrees);
-   }
-}
-
-//*******************************************************************
-// Public Method: ossimGrect::completely_within
-//*******************************************************************
-bool ossimGrect::completely_within(const ossimGrect& rect) const
-{
-   if(rect.isLonLatNan() || isLonLatNan())
-   {
-      return false;
-   }
-   
-   /*  --------------
-       |     1      |
-       | ---------- |
-       | |        | |
-       | |        | |
-       | |   2    | |
-       | |        | |
-       | |        | |
-       | ---------- |
-       |            |
-       --------------  */
-
-   bool rtn = true;
-   
-   if (theUlCorner.lon < rect.ul().lon)
-   {
-      rtn = false;
-   }
-   else if (theLrCorner.lon > rect.lr().lon)
-   {
-      rtn = false;
-   }
-   else if (theUlCorner.lat < rect.ul().lat)
-   {
-      rtn = false;
-   }
-   else if (theLrCorner.lat > rect.lr().lat)
-   {
-      rtn = false;
-   }
-
-   return rtn;
-}
-
-//*******************************************************************
-// Public Method: ossimGrect::intersects
-//*******************************************************************
-bool ossimGrect::intersects(const ossimGrect& rect) const
-{
-		
-   if(rect.isLonLatNan() || isLonLatNan())
-   {
-      return false;
-   }
-   
-   ossim_float64  ulx = ossim::max(rect.ul().lon, ul().lon);
-   ossim_float64  lrx = ossim::min(rect.lr().lon, lr().lon);
-   ossim_float64  uly, lry;
-   bool rtn;
-   
-   uly  = ossim::min(rect.ul().lat, ul().lat);
-   lry  = ossim::max(rect.lr().lat, lr().lat);
-   rtn = ((ulx <= lrx) && (uly >= lry));
-   
-      return (rtn);
-}
-
-ossim_float64 ossimGrect::heightMeters() const
-{
-   ossimDpt scale (midPoint().metersPerDegree());
-   return height()*scale.y;
-}
-
-ossim_float64 ossimGrect::widthMeters()  const
-{
-   ossimDpt scale (midPoint().metersPerDegree());
-   return width()*scale.x;
-}
-
-
-void ossimGrect::expandToInclude(const ossimGpt& gpt)
-{
-   if (isLonLatNan())
-   {
-      theUlCorner = gpt;
-      theLrCorner = gpt;
-   }
-   else if (!pointWithin(gpt, false))
-   {
-      if (gpt.lat > theUlCorner.lat)
-         theUlCorner.lat = gpt.lat;
-      else if (gpt.lat < theLrCorner.lat)
-         theLrCorner.lat = gpt.lat;
-      if (gpt.lon < theUlCorner.lon)
-         theUlCorner.lon = gpt.lon;
-      else if (gpt.lon > theLrCorner.lon)
-         theLrCorner.lon = gpt.lon;
-   }
-}
-
-void ossimGrect::expandToInclude(const ossimGrect& rect)
-{
-   expandToInclude(rect.ul());
-   expandToInclude(rect.lr());
-}
-
diff --git a/ossim/src/ossim/base/ossimHistogram.cpp b/ossim/src/ossim/base/ossimHistogram.cpp
deleted file mode 100644
index 9def392..0000000
--- a/ossim/src/ossim/base/ossimHistogram.cpp
+++ /dev/null
@@ -1,1612 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Ken Melero (kmelero at imagelinks.com)
-//         Orginally developed by:
-//                   Copyright (c) 1997 TargetJr Consortium
-//               GE Corporate Research and Development (GE CRD)
-//                             1 Research Circle
-//                            Niskayuna, NY 12309
-//         Adapted from:  IUE v4.1.2
-// Description: 
-//      A ossimHistogram contains an array of "buckets", which represent finite
-// segments of some value axis, along with a corresponding array of
-// frequency counts for each of these buckets.
-//
-//********************************************************************
-// $Id: ossimHistogram.cpp 23236 2015-04-08 00:47:22Z gpotts $
-
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimThinPlateSpline.h>
-#include <ossim/base/ossimDpt.h>
-#include <cmath>
-#include <cstdio>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-using namespace std;
-
-
-
-// nonstandard versions that use operator>, so they behave differently
-// than std:::min/max and ossim::min/max.  kept here for now for that
-// reason.
-#ifndef MAX
-#  define MAX(x,y) ((x)>(y)?(x):(y))
-#  define MIN(x,y) ((x)>(y)?(y):(x))
-#endif
-
-
-static const int MEAN_FLAG = 1, SD_FLAG = 2;
-RTTI_DEF1(ossimHistogram, "ossimHistogram", ossimObject);
-ossimHistogram::ossimHistogram()
-   :
-   stats_consistent(MEAN_FLAG | SD_FLAG),
-   vals(new float [1]),
-   counts(new float [1]),
-   num(0),
-   delta(0.0),
-   vmin(0),
-   vmax(0),
-   mean(0.0),
-   standard_dev(0.0)
-{
-   vals[0] = 0.0;
-   counts[0] = 0.0;
-}
-
-ossimHistogram::ossimHistogram(int xres, float val1, float val2)
-   :
-   stats_consistent(MEAN_FLAG | SD_FLAG),
-   vals(new float [xres]),
-   counts(new float [xres]),
-   num(xres),
-   delta(0.0),
-   vmin(0),
-   vmax(0),
-   mean(0.0),
-   standard_dev(0.0)
-{
-   vmax = MAX(val1, val2);
-   vmin = MIN(val1, val2);
-
-   //---
-   // Set the delta which is used to index the bins.
-   // Note: that using "(vmax - vmin) / xres" was dropping the
-   // last bin on integer data.
-   //---
-   if ( (vmax - vmin + 1) == xres )
-   {
-      delta = 1.0;
-   }
-   else
-   {
-      delta = (vmax - vmin) / xres;
-   }
-
-   mean = (float)((vmax + vmin)/2.0);
-   standard_dev = (float)((vmax - vmin)/(2.0*sqrt(3.0)));
-   int i = 0;
-
-   if (vals == NULL || counts == NULL)
-   {
-      fprintf(stderr, "Histogram : Ran out of memory for arrays.\n");
-      vals = NULL;
-      counts = NULL;
-      num = 0;
-      vmin = 0;
-      vmax = 0;
-      delta = 0.0;
-   }
-   else
-   {
-      //std::cout << std::setprecision(15) << vmin << ", " << vmax <<  ", " <<delta <<", "<< xres << std::endl; 
-      for(i = 0; i < xres; i++)
-      {
-         vals[i] = vmin + delta * (float)(i + 0.5);
-         //std::cout << vals[i] << std::endl;
-         counts[i] = 0.0;
-      }
-   }
-}
-
-ossimHistogram::ossimHistogram(float* uvals, float* ucounts, int xres)
-   :
-   stats_consistent(MEAN_FLAG | SD_FLAG),
-   vals(uvals),
-   counts(ucounts),
-   num(xres),
-   delta(0.0),
-   vmin(0),
-   vmax(0),
-   mean(0.0),
-   standard_dev(0.0)
-{
-   if ( ( xres >= 2 ) && uvals && ucounts )
-   {
-      delta = vals[1] - vals[0]; // Changed this from delta = 1.0
-      //  vmax = GetMaxVal();
-      //  vmin = GetMinVal(); JAF version
-      vmin = uvals[0] - .5f*delta;
-      vmax = uvals[num-1] + .5f*delta;
-      mean = GetMean();
-      standard_dev = GetStandardDev();
-   }   
-}
-//-----------------------------------------------------------
-// -- Copy constructor
-ossimHistogram::ossimHistogram(const ossimHistogram& his)
-{
-
-   int i = 0;
-   num = his.GetRes();
-
-   vals = new float[num];
-   const float* his_vals = his.GetVals();
-
-   counts = new float[num];
-   const float* his_counts = his.GetCounts();
-
-   if (vals == NULL || counts == NULL)
-   {
-      fprintf(stderr, "Histogram : Ran out of memory for arrays.\n");
-      vals = NULL;
-      counts = NULL;
-      num = 0;
-      vmin = 0;
-      vmax = 0;
-      delta = 0.0;
-      stats_consistent = 0;
-      return;
-   }
-
-   mean = his.GetMean();
-   standard_dev = his.GetStandardDev();
-
-   for(i=0; i<num; i++)
-   {
-      vals[i] = his_vals[i];
-      counts[i] = his_counts[i];
-   }
-   vmax = his.GetMaxVal();
-   vmin = his.GetMinVal();
-   delta = his.GetBucketSize();
-
-   stats_consistent = 0;
-   stats_consistent |= (MEAN_FLAG | SD_FLAG);
-}
-
-
-//---------------------------------------
-// -- Resample a histogram
-
-ossimHistogram::ossimHistogram(const ossimHistogram* his, float width)
-{
-
-   stats_consistent =0;
-
-// Attributes of original histogram
-
-   float del = his->GetBucketSize();
-   int max_index = his->GetRes() - 1;
-   float minvalue = his->GetVals()[0] - del*.5f;
-   float maxvalue = his->GetVals()[max_index] + del*.5f;
-
-
-// Intialize a new histogram
-   if(width == del) num = his->GetRes();
-   else if(!(width == 0.0))
-      num = (int)ceil((maxvalue - minvalue)/width);
-   else
-      num = 1; // This shouldn't happen anyway.
-
-   vals = new float [num];
-   counts = new float [num];
-   delta = width;
-   float mean_val = (maxvalue + minvalue)/2.0f;
-   float half_range = (num * delta)/2.0f;
-   vmax =  mean_val + half_range;
-   vmin =  mean_val - half_range;
-   int i = 0;
-
-   if (vals == NULL || counts == NULL)
-   {
-      fprintf(stderr,
-              "Histogram : Ran out of memory for arrays.\n");
-      vals = NULL;
-      counts = NULL;
-      num = 0;
-      vmin = 0;
-      vmax = 0;
-      delta = 0.0;
-      mean = 0.0;
-      standard_dev = 0.0;
-      stats_consistent |= (MEAN_FLAG | SD_FLAG);
-      return;
-       
-   }
-   
-   else
-   {
-      for(i = 0; i < num; i++)
-      {
-         vals[i] = vmin + delta * (i + 0.5f);
-         counts[i] = 0.0;
-      }
-   }
-
-
-// Cases:
-
-
-   if(width == del)    // Then just copy his
-   {
-      const float* his_counts = his->GetCounts();
-      for(i=0; i<num; i++)
-         counts[i] = his_counts[i];
-      mean = GetMean();
-      standard_dev = GetStandardDev();
-      stats_consistent |= (MEAN_FLAG | SD_FLAG);
-      return;
-   }
-
-
-   if(del > width)     // Then interpolate his counts.
-   {
-
-// Boundary conditions:
-//    Start
-      float his_start = minvalue + .5f*del;
-      float start = vmin + .5f*delta;
-      float c0 = his->GetCount(his_start);
-      float c1 = his->GetCount(his_start + del);
-      float s0 = (c1 - c0)/del;
-
-      for(float x = start; x <= (his_start + del + delta);)
-      {
-         float interp = s0 * (x - his_start) + c0;
-         if(interp < 0) interp = 0; //Can be negative
-         SetCount(x,interp);
-         x += width;
-      }
-//    End
-      float his_end = maxvalue - .5f*del;
-      float end = vmax - .5f*delta;
-      float cn = his->GetCount(his_end);
-      float cn_1 = his->GetCount(his_end - del);
-      float sn = (cn_1 - cn)/del;
-
-      for(float y = end; y >= (his_end - del + delta);)
-      {
-         float interp = sn * (his_end - y) + cn;
-         if(interp < 0) interp = 0; //Can be negative
-         SetCount(y, interp);
-         y -= delta;
-      }
-// Interior Loop
-
-      for(float z = his_start + del; z <= (his_end - del);)
-      {
-         float ci = his->GetCount(z);
-         float ci_1 = his->GetCount(z-del);
-         float cip1 = his->GetCount(z+del);
-         float deriv = (cip1 - ci_1)/(2.0f*del);
-         float second_drv =
-            ((cip1 + ci_1)/2.0f - ci)/(del*del);
-         int fine_x_index = GetIndex(z);
-         if (fine_x_index < 0)
-         {
-            if (z<vmin) fine_x_index = 0;
-            else fine_x_index = num-1;
-         }
-         float fine_x = vals[fine_x_index];
-         for(float xfine = fine_x; xfine < z + del;)
-         {
-            float interp = ci + deriv*(xfine -z) +
-               second_drv*(xfine - z)*(xfine - z);
-
-            if(interp < 0) interp = 0; //Can be negative
-            SetCount(xfine, interp);
-            xfine += width;
-         }
-         z += del;
-      }
-   }
-
-
-   if(del < width)    //Just accumulate samples from his into larger bins
-   {
-      if( del != 0.0){
-         float his_start = minvalue + .5f*del;
-         float his_end = maxvalue - .5f*del;
-         for(float x = his_start; x <= his_end;)
-         {
-            SetCount(x, (GetCount(x) + his->GetCount(x)));
-            x += del;
-         }
-      }
-   }
-   mean = GetMean();
-   standard_dev = GetStandardDev();
-   stats_consistent =0;
-   stats_consistent |= (MEAN_FLAG | SD_FLAG);
-}
-
-void ossimHistogram::create(int xres, float val1, float val2)
-{
-   // clear all the data
-   deleteAll();
-
-   // now set it up and initialize;
-   xres = xres >0? xres:1;
-   
-   vals   = new float [xres];
-   counts = new float [xres];
-   num = xres;
-   vmax = MAX(val1, val2);
-   vmin = MIN(val1, val2);
-
-   delta = (vmax - vmin) / xres;
-   mean = (float)((vmax + vmin)/2.0);
-   standard_dev = (float)((vmax - vmin)/(2.0*sqrt(3.0)));
-   stats_consistent = 0;
-   stats_consistent |= (MEAN_FLAG | SD_FLAG);
-   int i = 0;
-   if (vals == NULL || counts == NULL)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "Histogram : Ran out of memory for arrays.\n";
-      vals = NULL;
-      counts = NULL;
-      num = 0;
-      vmin = 0;
-      vmax = 0;
-      delta = 0.0;
-   }
-   else
-   {
-      for(i = 0; i < xres; i++)
-      {
-         vals[i] = vmin + delta * (float)(i + 0.5);
-         counts[i] = 0.0;
-      }
-   }   
-}
-ossimHistogram* ossimHistogram::fillInteriorEmptyBins(int type)const
-{
-   if(num < 1) return 0;
-   ossimHistogram* result = new ossimHistogram(*this);
-   switch(type)
-   {
-      case HISTOGRAM_FILL_THIN_PLATE:
-      case HISTOGRAM_FILL_DEFAULT:
-      {
-         ossimThinPlateSpline spline(1);
-         double pvars[1];
-         float* new_counts = result->GetCounts();
-         ossim_int32 idxLeft = 0;
-         ossim_int32 idxRight = num-1;
-         while((idxLeft < num) && (new_counts[idxLeft]  == 0.0))++idxLeft;
-         while((idxRight > -1) && (new_counts[idxRight] == 0.0))--idxRight;
-         
-         if(idxLeft < idxRight)
-         {
-            ossim_int32 idx = idxLeft;
-            while(idx <= idxRight)
-            {
-               if(new_counts[idx]!=0.0)
-               {
-                  pvars[0] = new_counts[idx];
-                  spline.addPoint(idx, 0, pvars);
-               }
-               ++idx;
-            }
-            if(spline.solve())
-            {
-               idx = idxLeft;
-               while(idx <= idxRight)
-               {
-                  if(spline.getPoint(idx, 0, pvars))
-                  {
-                     new_counts[idx] = pvars[0];
-                  }
-                  ++idx;
-               }
-            }
-         }
-         
-         break;
-      }
-   }
-   
-   return result;
-}
-//--------------------------------------------------
-// -- Transform the value axis of a histogram by a
-//    translation, transl, and a scale factor, scale.
-//    The new histogram has the same resolution as his.
-
-ossimHistogram* ossimHistogram::Scale(float scale_factor)
-{
-
-// Extract attributes of self
-
-//    float lowvalue = vals[0];
-   float highvalue = vals[num-1];
-
-// Construct a new histogram
-
-   ossimHistogram* scaled_his = new ossimHistogram(this, delta);
-   float* new_counts = scaled_his->GetCounts();
-   int i = 0;
-   for(i=0; i < num; i++)  // Initialize
-      new_counts[i] = 0.0;
-
-// Compute scaled values
-// We assume that the new histogram is to be scaled down from his
-
-   float scale = scale_factor;
-   if(scale_factor > 1.0) scale = 1.0;
-
-   for(float x = highvalue; x > vmin;)
-   {
-      float trans_x = (x-vmin)*scale + vmin; // Scaled x.
-      int index = GetIndex(trans_x);
-      if (index < 0)
-      {
-         if (trans_x<vmin) index = 0;
-         else index = num-1;
-      }
-      float fraction = (trans_x - vals[index])/delta;
-      float abs_fraction = (float)fabs(fraction);
-      int x_index = GetIndex(x);
-      if (x_index < 0)
-      {
-         if (x<vmin) x_index = 0;
-         else x_index = num-1;
-      }
-
-// Distribute the counts in proportion
-
-      new_counts[index] += (1.0f - abs_fraction)*counts[x_index];
-      if(fraction > 0)
-         if(index < (num-1))
-            new_counts[index + 1] +=
-               abs_fraction*counts[x_index];
-         else
-            new_counts[index] +=
-               abs_fraction*counts[x_index];
-      else
-         if(index > 0)
-            new_counts[index - 1] +=
-               abs_fraction*counts[x_index];
-         else
-            new_counts[index] +=
-               abs_fraction*counts[x_index];
-      x -= delta;
-   }
-
-// Compute new Histogram attributes
-
-   mean = scaled_his->GetMean();
-   standard_dev = scaled_his->GetStandardDev();
-   return scaled_his;
-}
-
-//---------------------------------------------------------------------
-// -- Assuming that "this" is a histogram of population density,
-//    construct a new histogram which is the cumulative distribution.
-//    Each bin, xi, in his is assumed to represent a density, i.e.,
-//            {x | (xi - .5*delta) < x <= (xi + .5*delta)}
-//    Each bin, xi, in the result represents a cumulative distribution, i.e.,
-//            {x | x <= (xi + .5*delta)}
-ossimHistogram* ossimHistogram::CumulativeGreaterThanEqual()const
-{
-   ossimHistogram* cum_his = new ossimHistogram(*this);
-   const float* density_counts = this->GetCounts();
-   int res = this->GetRes();
-
-   // Intitialize cumulative counts
-   float* cum_counts = cum_his->GetCounts();
-   int i = 0;
-   for(i=0; i < res; i++)
-      cum_counts[i] = 0;
-  
-   cum_counts[res-1] = density_counts[res-1];
-   for(i = res-2; i>=0; --i)
-   {
-      cum_counts[i] += (density_counts[i] + cum_counts[i+1]);
-   }
-
-   return cum_his;
-}
-
-ossimHistogram* ossimHistogram::CumulativeLessThanEqual()const
-{
-   ossimHistogram* cum_his = new ossimHistogram(*this);
-   const float* density_counts = this->GetCounts();
-   int res = this->GetRes();
-
-   // Intitialize cumulative counts
-   float* cum_counts = cum_his->GetCounts();
-   int i = 0;
-   for(i=0; i < res; i++)
-      cum_counts[i] = 0;
-
-   cum_counts[0] = density_counts[0];
-   for(i = 1; i < res; i++)
-   {
-      cum_counts[i] += (density_counts[i] + cum_counts[i-1]);
-   }
-  
-   return cum_his;
-}
-
-//Provides the correct values for histogram counts when the bin index 
-//extends outside the valid range of the counts array.  This function
-//permits easy array access logic for the NonMaximumSuppression algorithm.
-//The cyclic flag indicates that the counts array index is circular, i.e,
-//cnts[0] equivalent to cnts[n_bins-1]
-inline float GetExtendedCount(int bin, int n_bins, float* cnts, bool cyclic)
-{
-   int nbm = n_bins-1;
-   if(!cyclic)
-   {
-      if(bin < 0)
-         return cnts[0];
-      if(bin >= n_bins)
-         return cnts[nbm];
-   }
-   else
-   {
-      if(bin<0)
-         return cnts[nbm+bin];
-      if(bin >= n_bins)
-         return cnts[bin-n_bins];
-   }
-   return cnts[bin];
-}
-//Prune any sequences of more than one maxium value
-//That is, it is possible to have a "flat" top peak with an arbitarily
-//long sequence of equal, but maximum values. The cyclic flag indictates
-//that the sequence wraps around, i.e. cnts[0] equivalent to cnts[nbins-1]
-inline void RemoveFlatPeaks(int nbins, float* cnts, bool cyclic)
-{
-   int nbm = nbins-1;
-
-   //Here we define a small state machine - parsing for runs of peaks
-   //init is the state corresponding to an initial run (starting at i ==0)
-   bool init=GetExtendedCount(0, nbins, cnts, cyclic);
-   int init_end =0;
-
-   //start is the state corresponding to any other run of peaks
-   bool start=false;  
-   int start_index=0; 
-   int i = 0;
-
-   //The scan of the state machine
-   for(i = 0; i < nbins; i++)
-   {
-      float v = GetExtendedCount(i, nbins, cnts, cyclic);
-
-      //State init: a string of non-zeroes at the begining.
-      if(init&&v!=0)
-         continue;
-
-      if(init&&v==0)
-      {
-         init_end = i;
-         init = false;
-         continue;
-      }
-
-      //State !init&&!start: a string of "0s"
-      if(!start&&v==0)
-         continue;
-
-      //State !init&&start: the first non-zero value
-      if(!start&&v!=0)
-      {
-         start_index = i;
-         start = true;
-         continue;
-      }
-      //State ending flat peak: encountered a subsequent zero after starting
-      if(start&&v==0)
-      {
-         int peak_location = (start_index+i-1)/2;//The middle of the run
-         int k = 0;
-         for(k = start_index; k<=(i-1); k++)
-	    if(k!=peak_location)
-               cnts[k] = 0;
-         start = false;
-      }
-   }
-   //Now handle the boundary conditions
-   //The non-cyclic case
-   if(!cyclic)
-   {
-      if(init_end!=0)  //Was there an initial run of peaks?
-      {
-         int init_location = (init_end-1)/2;
-         int k = 0;
-         for(k = 0; k<init_end; k++)
-	    if(k!=init_location)
-               cnts[k] = 0;
-      }
-      if(start)       // Did we reach the end of the array in a run of pks?
-      {
-         int end_location = (start_index + nbm)/2;
-         int k = 0;
-         for(k = start_index; k<nbins; k++)
-	    if(k!=end_location)
-               cnts[k] = 0;
-      }
-   }
-   else  //The cyclic case
-   {
-      if(init_end!=0)  //Is there a run which crosses the cyclic cut?
-      {
-         if(start)    
-         { //Yes, so define the peak location accordingly
-	    int peak_location = (start_index + init_end - nbm -1)/2;
-	    int k;
-	    if(peak_location < 0) //Is the peak to the left of the cut?
-            {// Yes, to the left
-               peak_location += nbm; 
-               for( k = 0; k< init_end; k++)
-		  cnts[k]=0;
-               for( k= start_index; k <nbins; k++)
-		  if(k!=peak_location)
-                     cnts[k] = 0;
-            }
-	    else   
-            {//No, on the right.
-               for( k = start_index; k< nbins; k++)
-		  cnts[k]=0;
-               for( k= 0; k < init_end; k++)
-		  if(k!=peak_location)
-                     cnts[k] = 0;
-            }
-         }
-         else  
-         {//There wasn't a final run so just clean up the initial run
-	    int init_location = (init_end-1)/2;
-	    int k = 0;
-	    for(k = start_index; k<init_end; k++)
-               if(k!=init_location)
-                  cnts[k] = 0;
-         }
-      }
-   }
-}
-
-//----------------------------------------------------------
-// -- Suppress values in the Histogram which are not locally 
-//    a maxium. The neighborhood for computing the local maximum
-//    is [radius X radius], e.g. for radius =1 the neighborhood
-//    is [-X-], for radius = 2, the neighborhood is [--X--], etc.
-//    If the cyclic flag is true then the index space is assumed to
-//    be equivalent to a circle. That is, elements "0" and (n_buckets-1)
-//    are in correspondence.
-ossimHistogram* ossimHistogram::NonMaximumSupress(int radius, bool cyclic)
-{
-   if((2*radius +1)> num/2)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"ossimHistogram::NonMaximumSupress the radius is too large \n";
-      return NULL;
-   }
-   //Get the counts array of "this"
-   ossimHistogram* h_new = new ossimHistogram(*this);
-   int n_buckets = h_new->GetRes();
-   float* counts_old = this->GetCounts();
-
-   //Make a new Histogram for the suppressed version
-   float* counts_new = h_new->GetCounts();
-   int i;
-   for( i =0; i < n_buckets; i++)
-      counts_new[i] = 0;
-  
-   //Find local maxima
-   for( i = 0; i<  n_buckets; i++)
-   {
-      //find the maxium value in the current kernel
-      float max_count = counts_old[i];
-      int k = 0;
-      for(k = -radius; k <= radius ;k++)
-      {
-         int index = i+k;
-         float c = GetExtendedCount(index, n_buckets, counts_old, cyclic);
-         if( c > max_count)
-	    max_count = c;
-      }
-      //Is position i a local maxium?
-      if(max_count == counts_old[i])
-         counts_new[i] = max_count;//Yes. So set the counts to the max value
-   }
-   RemoveFlatPeaks(n_buckets, counts_new, cyclic);
-   return h_new;
-}
-//----------------------------------------------------------
-// -- Compute the mean of the histogram population
-float ossimHistogram::GetMean()const
-{
-   float xsum = 0.0;
-
-   if(MEAN_FLAG&stats_consistent)
-      return mean;
-   else
-   {
-      if( this->GetBucketSize() > 0.0){
-         for(float x=this->GetMinVal(); x<= this->GetMaxVal(); x +=this->GetBucketSize())
-            xsum += x*GetCount(x);
-      }
-
-      float area = ComputeArea(vmin, vmax);
-      if(area <= 0.0)
-      {
-         //	      fprintf(stderr, "Histogram : Area <= 0.0\n");
-         return 0.0;
-      }
-      else
-      {
-         stats_consistent |=1;
-         mean = xsum/area;
-         return mean;
-      }
-   }
-}
-
-
-
-float ossimHistogram::GetStandardDev()const
-{
-   float sum = 0.0;
-
-   if(SD_FLAG&stats_consistent)
-      return standard_dev;
-   else
-   {
-      float xm = this -> GetMean(); // Force an Update of Mean
-
-      if( this->GetBucketSize() > 0.0){
-         for(float x=this->GetMinVal();
-             x<= this->GetMaxVal();
-             x +=this->GetBucketSize())
-
-            sum += (x-xm)*(x-xm)*GetCount(x);
-      }
-
-      float area = ComputeArea(vmin, vmax);
-      if(area <= 0.0)
-      {
-         //	      fprintf(stderr, "Histogram : Area <= 0.0\n");
-         return 0.0;
-      }
-      else
-      {
-         stats_consistent |= 2;
-         standard_dev = (float)sqrt(sum/area);
-         return standard_dev;
-      }
-   }
-}
-
-int ossimHistogram::GetIndex(float pixelval)const
-{
-#if 1
-   if ((pixelval > vmax) || (pixelval < vmin)||(num==0))
-   {
-      return -1;
-   }
-//   ossim_float32 d = vmax-vmin;
-   int bandIdx = (ossim_int32)((pixelval-vmin)/delta);
-   return bandIdx<GetRes()?bandIdx:-1;
-//    if(bandIdx == num)
-//    {
-//       return num-1;
-//    }
-//    else if(bandIdx < num)
-//    {
-//       return bandIdx;
-//    }
-//    return -1;
-#else
-   if ((pixelval > vmax) || (pixelval < vmin))
-      return -1;
-
-   int idx = 0;
-   int i = 0;
-
-   for(i = 0; i < num; i++)
-   {
-      //std::cout << std::setprecision(15) << vals[i] << std::endl;
-      // RWMC: This is very dangerous - might get an intermediate
-      // value which is between vals[i]+0.5*delta and
-      // vals[i+1]-0.5*delta, which would then return index of 0.
-      // Changed to check range one-sided, which is safe because of
-      // previous check on range.
-      //       if ((pixelval > (vals[i] - 0.5 * delta)) &&
-      //           (pixelval <= (vals[i] + 0.5 * delta)))
-      if (pixelval <= (vals[i] + 0.5 * delta))
-      {
-         idx = i;
-         break;
-      }
-   }
-//std::cout << idx << std::endl;
-   return idx;
-#endif
-}
-
-
-int ossimHistogram::GetValIndex(float pixelval)const
-{
-   if ((pixelval > vmax) || (pixelval < vmin))
-      return -1;
-
-   int idx = 0;
-   int i = 0;
-
-   for(i = 0; i < num; i++)
-   {
-      if ((pixelval > (vals[i] - 0.5 * delta)) &&
-          (pixelval <= (vals[i] + 0.5 * delta)))
-      {
-         idx = i;
-         break;
-      }
-   }
-
-   return idx;
-}
-
-
-
-float ossimHistogram::GetCount(float pixelval)const
-{
-   int index = GetIndex(pixelval);
-
-   if (index < 0)
-      return -1;
-   else
-      return counts[index];
-}
-
-
-
-float ossimHistogram::GetMinVal()const
-{
-   register int i=0;
-
-   while (i<num-1 && !counts[i])
-      i++;
-
-   return vals[i];
-}
-
-
-
-
-float ossimHistogram::GetMaxVal()const
-{
-   register int i=num-1;
-
-   while (i>0 && !counts[i])
-      i--;
-
-   if (i < 0)
-      return 0.0;
-
-   return vals[i];
-}
-
-
-float ossimHistogram::GetMaxCount()const
-{
-   register int i=0;
-   float max;
-   max = 0.0;
-   for (i=0; i < num; i++)
-      if (counts[i] > max)
-         max = counts[i];
-   return max;
-}
-
-
-
-
-float ossimHistogram::SetCount(float pixelval, float count)
-{
-   stats_consistent = 0;
-
-   int index = GetIndex(pixelval);
-
-   if (index < 0)
-      return -1;
-   else
-   {
-      counts[index] = count;
-      return count;
-   }
-}
-
-
-void ossimHistogram::UpCount(float pixelval)
-{
-
-   stats_consistent = 0;
-   int idx = GetIndex(pixelval);
-   if (idx >= 0)  // Originally (index > 0)
-   {
-      counts[idx] += 1.0;
-   }
-}
-
-float ossimHistogram::ComputeArea(float low, float high)const
-{
-   float maxval = GetMaxVal();
-   float minval = GetMinVal();
-
-   if (low < minval) low = minval;
-   if (high > maxval) high = maxval;
-
-   if (low <= high)
-   {
-      int indexlow, indexhigh;
-      indexlow = (int) GetIndex(low);
-      if (indexlow < 0)
-      {
-         if (low<vmin) indexlow = 0;
-         else indexlow = num-1;
-      }
-      indexhigh = (int) GetIndex(high);
-      if (indexhigh < 0)
-      {
-         if (high<vmin) indexhigh = 0;
-         else indexhigh = num-1;
-      }
-      register int i=indexlow;
-      float sum = 0.0;
-
-      while (i<=indexhigh)
-      {
-         sum+= counts[i];
-         i++;
-      }
-      return sum;
-   }
-   else
-   {
-      //      fprintf(stderr, "Histogram : Range for ComputeArea is out of bounds.\n");
-      return 0.0;
-   }
-}
-//----------------------------------------------------------------------
-// --Compute the total area under the histogram
-//
-float ossimHistogram::ComputeArea()const
-{
-   float vmin = this->GetMinVal();
-   float vmax = this->GetMaxVal();
-   if(vmin>vmax)
-   {
-      float temp = vmin;
-      vmin = vmax;
-      vmax = temp;
-   }
-   return this->ComputeArea(vmin, vmax);
-}
-
-float ossimHistogram::getLowFractionFromValue(float val) const
-{
-   
-   float min = floor(GetMinVal());
-   float max = ceil(GetMaxVal());
-   if (val < min || val > max)
-   {
-      return ossim::nan();
-   }
-
-   int total_buckets = GetRes();
-   int cutoff_bucket = GetValIndex(val);
-   float partial_sum = 0.0;
-   float total_sum   = 0.0;
-   
-   for(int i = 0; i < total_buckets; ++i)
-   {
-      total_sum += counts[i];
-      if (i <= cutoff_bucket)
-      {
-         partial_sum += counts[i];
-      }
-   }
-
-   return (partial_sum/total_sum);
-}
-
-float ossimHistogram::getHighFractionFromValue(float val) const
-{
-   float min = floor(GetMinVal());
-   float max = ceil(GetMaxVal());
-   if (val < min || val > max)
-   {
-      return ossim::nan();
-   }
-
-   int total_buckets = GetRes();
-   int cutoff_bucket = GetValIndex(val);
-   float partial_sum = 0.0;
-   float total_sum   = 0.0;
-   
-   for(int i = (total_buckets-1); i >= 0; --i)
-   {
-      total_sum += counts[i];
-      if (i >= cutoff_bucket)
-      {
-         partial_sum += counts[i];
-      }
-   }
-
-   return (partial_sum/total_sum);
-}
-
-//----------------------------------------------------------------------
-//  -- Finds the lower bound value which elminates a given fraction of
-//     histogram area.
-//
-float ossimHistogram::LowClipVal(float clip_fraction)const
-{
-   if(clip_fraction<0) clip_fraction=0.0;
-   if(clip_fraction>1.0) clip_fraction=1.0;
-   float area = this->ComputeArea();
-   if(area==0.0) return this->GetMinVal();
-   if(clip_fraction==0.0) return this->GetMinVal();
-   if(clip_fraction==1.0) return this->GetMaxVal();
-   float clip_area = area*clip_fraction;
-   const float* COUNTS = this->GetCounts();
-   const float* VALS = this->GetVals();
-   int res = this->GetRes();
-   float sum = 0;
-   int i=0;
-   for(; i<res; i++)
-   {
-      sum+=COUNTS[i];
-      if(sum>=clip_area)
-         break;
-   }
-   return VALS[i];
-}
-
-//----------------------------------------------------------------------
-//  -- Finds the lower bound value which elminates a given fraction of
-//     histogram area.
-//
-float ossimHistogram::HighClipVal(float clip_fraction)const
-{
-   if(clip_fraction<0) clip_fraction=0.0;
-   if(clip_fraction>1.0) clip_fraction=1.0;
-   float area = this->ComputeArea();
-   if(area==0.0) return this->GetMaxVal();
-   if(clip_fraction==0.0) return this->GetMaxVal();
-   if(clip_fraction==1.0) return this->GetMinVal();
-   float clip_area = area*clip_fraction;
-   const float* COUNTS = this->GetCounts();
-   const float* VALS = this->GetVals();
-   int res = this->GetRes();
-   float sum = 0;
-   int i = (res-1);
-   for(; i>=0; i--)
-   {
-      sum+=COUNTS[i];
-      if(sum>=clip_area)
-         break;
-   }
-   return VALS[i];
-}
-
-//--------------------------------------------------------------------------
-// -- Prints histogram counts onto cout
-void ossimHistogram::Print()const
-{
-   ostream& out = ossimNotify(ossimNotifyLevel_INFO);
-   const float* VALS = this->GetVals();
-   const float* COUNTS = this->GetCounts();
-   int res = this->GetRes();
-   int width = 0;
-   int i = 0;
-   for(i =0; i < res; i++)
-   {
-      if(width++ > 5)
-      {
-         width = 0;
-         out << "\n";
-      }
-      out << VALS[i] << " "
-          << COUNTS[i] << " | " ;
-   }
-   out << "\n MaxVal " << this->GetMaxVal() << "\n";
-   out << " MinVal " << this->GetMinVal() << "\n";
-   out << " BucketSize " << this->GetBucketSize() << "\n";
-   out << " Resolution " << this->GetRes() << "\n";
-   out << " Area "
-       << this->ComputeArea(this->GetMinVal(),this->GetMaxVal()) << "\n";
-   out << "------------------------------------------------\n\n";
-}
-
-//---------------------------------------------------------------------------
-// --- dumps histogram  values  to file.
-
-void ossimHistogram::Dump(char *dumpfile)const
-{
-   FILE *dumpfp = fopen(dumpfile, "w");
-
-   if (!dumpfp)
-   {
-      fprintf(stderr, "Error opening histogram data file.\n");
-      return;
-   }
-   int i = 0;
-
-   for(i = 0; i < num; i++)
-      fprintf(dumpfp, "%f %f\n", vals[i], counts[i]);
-  
-   fclose(dumpfp);
-   return;
-}
-
-//---------------------------------------------------------------------------
-// -- Writes histogram in format suitable for plotting tools like Gnuplot.
-
-int ossimHistogram::WritePlot(const char *fname)const
-{
-   FILE *fp = fopen(fname, "w");
-
-   if (!fp)
-   {
-      fprintf(stderr, "Error opening histogram plot file.\n");
-      return 0;
-   }
-
-   int stat_res = this->GetRes();
-
-   float * x = new float[2*stat_res];
-   float * y = new float[2*stat_res];
-
-   const float * temp_x = this->GetVals();
-   const float * temp_y = this->GetCounts();
-   float     delt = this->GetBucketSize();
-
-   for (register int i=0; i < stat_res ;i++)
-   {
-      x[2*i] = temp_x[i] - 0.5f * delt;
-      x[2*i+1] = temp_x[i] + 0.5f * delt;
-      y[2*i] = temp_y[i];
-      y[2*i+1] = temp_y[i];
-   }
-
-
-   for(register int j = 0; j < 2*stat_res; j++)
-      fprintf(fp, "%f %f\n", x[j], y[j]);
-
-   delete [] x;
-   delete [] y;
-
-   fclose(fp);
-   return 1;
-}
-
-void ossimHistogram::deleteAll()
-{
-   if (vals)
-   {
-      delete []vals;
-      vals = NULL;
-   }
-   if (counts)
-   {
-      delete []counts;
-      counts = NULL;
-   }  
-}
-
-ossimHistogram::~ossimHistogram()
-{
-   deleteAll();
-}
-
-
-bool ossimHistogram::importHistogram(istream& in)
-{
-   ossimProprietaryHeaderInformation header;
-   bool binsCreated = false;
-   
-   if(header.parseStream(in))
-   {
-      long numberOfBins = header.getNumberOfBins();
-      
-      if(numberOfBins)
-      {
-         create(numberOfBins, 0, numberOfBins - 1);
-         binsCreated = true;
-
-         if(binsCreated)
-         {
-            ossimString buffer;
-            ossimString binNumber;
-            ossimString count;
-
-            while(in.good() &&
-                  !in.eof() &&
-                  *binNumber.c_str() != '.')
-            {
-               
-               getline(in, buffer);
-
-               istringstream s(buffer);
-
-               s >> binNumber >> count;
-               if(*binNumber.c_str() != (char)'.')
-               {
-                  SetCount((float)binNumber.toDouble(),
-                           (float)count.toDouble());
-               }
-            }
-         }
-      }
-      else
-      {
-         return false;
-      }
-   }  
-   return true;
-}
-
-bool ossimHistogram::importHistogram(const ossimFilename& inputFile)
-{
-   if(inputFile.exists())
-   {
-      ifstream input(inputFile.c_str());
-
-      return importHistogram(input);
-   }
-
-   return false;  
-}
-
-
-bool ossimHistogram::ossimProprietaryHeaderInformation::parseStream(istream& in)
-{
-   ossimString inputLine;
-   
-   getline(in, inputLine);  
-   if(inputLine.find("File Type") != string::npos)
-   {
-      std::string::size_type index = inputLine.find(":");
-      if(index != std::string::npos)
-      {
-         theFileType = inputLine.substr(index+1);
-         theFileType = theFileType.trim();
-      }
-      else
-      {
-         return false;
-      }
-
-   }
-   else
-   {
-      return false;
-   }
-
-   getline(in, inputLine);  
-   if(inputLine.find("Version") != string::npos)
-   {
-      std::string::size_type index = inputLine.find(":");
-      if(index != std::string::npos)
-      {
-         theVersion = inputLine.substr(index+1);
-         theVersion = theVersion.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-
-   getline(in, inputLine);  
-   if(inputLine.find("Mapper Type") != string::npos)
-   {
-      std::string::size_type index = inputLine.find(":");
-      if(index != std::string::npos)
-      {
-         theMapperType = inputLine.substr(index+1);
-         theMapperType = theMapperType.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-
-   getline(in, inputLine);  
-   if(inputLine.find("Number of Bins") != string::npos)
-   {
-      std::string::size_type index = inputLine.find(":");
-      if(index != std::string::npos)
-      {
-         theNumberOfBins = inputLine.substr(index+1);
-         theNumberOfBins = theNumberOfBins.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-   
-   return true;   
-}
-
-bool ossimHistogram::saveState(ossimKeywordlist& kwl,
-                               const char* prefix)const
-{
-   kwl.add(prefix,
-           "type",
-           "ossimHistogram",
-           true);
-   kwl.add(prefix,
-           "number_of_bins",
-           num,
-           true);
-   kwl.add(prefix,
-           "min_value",
-           vmin,
-           true);
-   kwl.add(prefix,
-           "max_value",
-           vmax,
-           true);
-   
-
-
-   ossimString binArrayList = "(";
-   bool firstValue = true;
-
-   for(ossim_int32 index = 0; index < num; ++index)
-   {
-      if(fabs(counts[index]) > FLT_EPSILON)
-      {
-
-         if(!firstValue)
-         {
-            binArrayList += ",";
-         }
-         else
-         {
-            firstValue = false;
-         }
-         binArrayList += "("+ossimString::toString(index)+","+ossimString::toString(counts[index])+")";
-     }
-   }
-
-   binArrayList += ")";
-
-   kwl.add(prefix, "bins", binArrayList, true);
-#if 0
-   ossimString binValue = "";
-   for(ossim_int32 index = 0; index < num; ++index)
-   {
-      if(fabs(counts[index]) > FLT_EPSILON)
-      {
-         //     binValue = prefix;
-         binValue = "bin";
-         binValue += ossimString::toString(index);
-         
-         kwl.add(prefix,
-                 binValue.c_str(),
-                 counts[index],
-                 true);
-      }
-   }
-#endif   
-   return true;
-}
-
-bool ossimHistogram::loadState(const ossimKeywordlist& kwl,
-                               const char* prefix)
-{
-//   std::cout << "ossimHistogram::loadState!!!!\n";
-   const char* number_of_bins = kwl.find(prefix, "number_of_bins");
-
-//   std::cout << "NBINS = " << number_of_bins << std::endl;
-   if(number_of_bins)
-   {
-      ossim_uint32 bins = ossimString(number_of_bins).toUInt32();
-
-//      std::cout << "BINS ======== " << bins << std::endl;
-      if(bins > 0)
-      {
-         // setup some defaults
-         float minValue = 0;
-         float maxValue = bins - 1;
-
-         // see if there is a range set for the data
-         const char* min_value = kwl.find(prefix, "min_value");
-         const char* max_value = kwl.find(prefix, "max_value");
-
-         if(min_value)
-         {
-            minValue = (ossim_float32)ossimString(min_value).toDouble();
-         }
-         if(max_value)
-         {
-            maxValue = (ossim_float32)ossimString(max_value).toDouble();
-         }
-
-         create((int)bins, minValue, maxValue);
-         float* countsPtr = GetCounts();
-         memset(countsPtr, '\0', bins*sizeof(float));
-         // this is new style histogram creation
-         //
-         ossimString binsString = kwl.find(prefix, "bins");
-         if(!binsString.empty())
-         {
-            std::vector<ossimDpt> result;
-            ossim::toVector(result, binsString);
-            if(!result.empty())
-            {
-               ossim_uint32 idx = 0;
-               for(idx = 0; idx < result.size();++idx)
-               {
-                  ossim_uint32 binIdx = static_cast<ossim_uint32>(result[idx].x);
-                  if(binIdx < bins)
-                  {
-                     countsPtr[binIdx] = result[idx].y;
-                  }
-               }
-            }
-         }
-         else
-         {
-            ossimKeywordlist binsKwl;
-            ossim_uint32 offset = (ossim_uint32)(ossimString(prefix)+"bin").size();
-            ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "bin[0-9]+)";
-            kwl.extractKeysThatMatch(binsKwl,regExpression);
-            const ossimKeywordlist::KeywordMap& kwlMap = binsKwl.getMap();
-            ossimKeywordlist::KeywordMap::const_iterator iter = kwlMap.begin();
-            while(iter != kwlMap.end())
-            {
-               ossimString numberStr(iter->first.begin() + offset,
-                                     iter->first.end());
-               countsPtr[numberStr.toUInt32()] = ossimString(iter->second).toDouble();
-               ++iter;
-            }
-         }
-
-//         ossimKeywordlist kwl;
-//         this->saveState(kwl);
-//         std::cout << kwl << std::endl;
-         
-         return true;
-#if 0
-         // create the bins
-         ossimString binNumber = "";
-         ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "bin[0-9]+)";
-         vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
-         ossim_uint32 numberOfBins = (ossim_uint32)keys.size();
-         ossim_uint32 offset = (ossim_uint32)(ossimString(prefix)+"bin").size();
-
-         std::vector<ossim_uint32> theNumberList(numberOfBins);
-         ossim_uint32 idx = 0;
-         for(idx = 0; idx < theNumberList.size();++idx)
-         {
-            ossimString numberStr(keys[idx].begin() + offset,
-                                  keys[idx].end());
-            theNumberList[idx] = numberStr.toUInt32();
-
-         }
-         
-         float* countsPtr = GetCounts();
-         memset(countsPtr, '\0', bins*sizeof(float));
-         for(idx = 0; idx < numberOfBins;++idx)
-         {
-            const char* binCount = kwl.find(prefix, ossimString("bin") + ossimString::toString(theNumberList[idx]));
-            countsPtr[theNumberList[idx]] = (float)ossimString(binCount).toDouble();
-         }
-#endif
-      }
-   }
-   return true;
-}
-
-bool ossimHistogram::loadState(const ossimRefPtr<ossimXmlNode> xmlNode)
-{
-   ossimRefPtr<ossimXmlNode> binValues =  xmlNode->findFirstNode("binValues");
-   ossimRefPtr<ossimXmlNode> minValueNode  =  xmlNode->findFirstNode("minValue");
-   ossimRefPtr<ossimXmlNode> maxValueNode  =  xmlNode->findFirstNode("maxValue");
-
-   if(binValues.valid())
-   {
-      ossim_uint32 count = 0;
-      float minValue = 0.0;
-      float maxValue = 0.0;
-      std::vector<float> floatValues;
-      std::istringstream in(binValues->getText());
-      ossimString vString;
-      while(!in.fail())
-      {
-         in>>vString;
-         if(!in.fail())
-         {
-            floatValues.push_back(vString.toFloat32());
-         }
-      }
-      count = (ossim_uint32)floatValues.size();
-     
-      if(count)
-      {
-         minValue = 0;
-         maxValue = count - 1;
-
-         if(minValueNode.valid())
-         {
-            minValue = minValueNode->getText().toFloat32();
-         }
-         if(maxValueNode.valid())
-         {
-            maxValue = maxValueNode->getText().toFloat32();
-         }
-
-         create(count, minValue, maxValue);
-         float* countsPtr = GetCounts();
-         ossim_uint32 idx = 0;
-         for(idx = 0; idx < count; ++idx)
-         {
-            countsPtr[idx] = floatValues[idx];
-         }
-         return true;
-      }
-   }
-
-   return false;
-}
-
-bool ossimHistogram::saveState(ossimRefPtr<ossimXmlNode> xmlNode)const
-{
-   ossimRefPtr<ossimXmlNode> binValues = new ossimXmlNode;
-   xmlNode->setTag("ossimHistogram");
-   xmlNode->addChildNode("minValue", ossimString::toString(vmin));
-   xmlNode->addChildNode("maxValue", ossimString::toString(vmax));
-   xmlNode->addChildNode("standardDeviation", ossimString::toString(standard_dev));
-   xmlNode->addChildNode("mean", ossimString::toString(mean));
-   binValues->setTag("binValues");
-   std::ostringstream out;
-
-   ossim_int32 idx = 0;
-   if(num > 0)
-   {
-      for(idx = 0; idx < num;++idx)
-      {
-         out << ossimString::toString(counts[idx], 8) << " ";
-      }
-      binValues->setText(out.str());
-   }
-   xmlNode->addChildNode(binValues.get());
-   
-   return true;
-}
diff --git a/ossim/src/ossim/base/ossimHistogramSource.cpp b/ossim/src/ossim/base/ossimHistogramSource.cpp
deleted file mode 100644
index bb9ce5e..0000000
--- a/ossim/src/ossim/base/ossimHistogramSource.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHistogramSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimHistogramSource.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-
-RTTI_DEF1(ossimHistogramSource, "ossimHistogramSource", ossimSource);
-
-
-ossimHistogramSource::ossimHistogramSource(ossimObject* owner,
-                                           ossim_uint32 numberOfInputs,
-                                           ossim_uint32 numberOfOutputs,
-                                           bool inputListFixedFlag,
-                                           bool outputListFixedFlag)
-   : ossimSource(owner,
-                 numberOfInputs,
-                 numberOfOutputs,
-                 inputListFixedFlag,
-                 outputListFixedFlag),
-     theHistogram(0),
-     theFilename()
-{
-}
-
-ossimHistogramSource::~ossimHistogramSource()
-{
-}
-
-ossimRefPtr<ossimMultiResLevelHistogram> ossimHistogramSource::getHistogram()
-{
-   return theHistogram;
-}
-
-bool ossimHistogramSource::loadState(const ossimKeywordlist& kwl,
-				     const char* prefix)
-{   
-   theHistogram = 0;
-   const char* externalFile = kwl.find(prefix,
-                                       ossimKeywordNames::FILENAME_KW);
-
-   theHistogram = new ossimMultiResLevelHistogram;
-   if(externalFile)
-   {
-      if(!theHistogram->importHistogram(ossimFilename(externalFile)))
-      {
-         theHistogram = 0;
-         theFilename = "";
-      }
-      theFilename = externalFile;
-   }
-   else
-   {
-      ossimString newPrefix = ossimString(prefix) + "histogram.";
-      if(!theHistogram->loadState(kwl, newPrefix))
-      {
-         theHistogram = 0;
-      }
-   }
-   
-   return ossimSource::loadState(kwl, prefix);
-}
-
-bool ossimHistogramSource::saveState(ossimKeywordlist& kwl,
-				     const char* prefix)const
-{
-   if(theHistogram.valid())
-   {
-      if(!theFilename.empty())      {
-         ossimKeywordlist kwl2;
-         
-         if(theHistogram->saveState(kwl2))
-         {
-            kwl2.write(theFilename.c_str());
-            kwl.add(prefix,
-                    ossimKeywordNames::FILENAME_KW,
-                    theFilename.c_str(),
-                    true);
-         }
-      }
-      else
-      {
-         ossimString newPrefix = ossimString(prefix) + "histogram.";
-         theHistogram->saveState(kwl, newPrefix);
-      }
-   }
-   
-   return ossimSource::saveState(kwl, prefix);
-}
-
-// Hidden from use.
-ossimHistogramSource::ossimHistogramSource(const ossimHistogramSource&)
-   :
-   theHistogram(0),
-   theFilename()
-{
-}
-
diff --git a/ossim/src/ossim/base/ossimHttpResponse.cpp b/ossim/src/ossim/base/ossimHttpResponse.cpp
deleted file mode 100644
index 1c5e1bb..0000000
--- a/ossim/src/ossim/base/ossimHttpResponse.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <ossim/base/ossimHttpResponse.h>
-
-RTTI_DEF1(ossimHttpResponse, "ossimHttpResponse", ossimWebResponse);
-
-void ossimHttpResponse::convertHeaderStreamToKeywordlist()
-{
-   m_headerKwl.clear();
-   ossimByteStreamBuffer buf(m_headerBuffer);
-   
-   std::istream in(&buf);
-   in.seekg(0); // make sure we are at the begining
-   // skip method type
-   //
-   std::string statusLine;
-   std::getline(in, statusLine);
-   m_statusLine = statusLine;
-   
-   m_headerKwl.parseStream(in);
-   std::vector<ossimString> statusLineArray;
-   m_statusLine.split(statusLineArray, " ");
-   if(statusLineArray.size() > 1)
-   {
-      m_statusCode = statusLineArray[1].toUInt32();
-   }
-   else
-   {
-      m_statusCode = 0;
-   }
-}
diff --git a/ossim/src/ossim/base/ossimImageTypeLut.cpp b/ossim/src/ossim/base/ossimImageTypeLut.cpp
deleted file mode 100644
index 5b769ee..0000000
--- a/ossim/src/ossim/base/ossimImageTypeLut.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ImageTypeLUT.  Currently has mapping of
-// ouput image writes from enumeration to string and string to
-// enumeration.
-//
-//*******************************************************************
-//  $Id: ossimImageTypeLut.cpp 22221 2013-04-11 15:30:08Z dburken $
-
-#include <ossim/base/ossimImageTypeLut.h>
-
-//***
-// Pixel type keyword to use for getState/saveState methods.
-//***
-const ossimKeyword ossimImageTypeLut::IMAGE_TYPE_KW("image_type",
-                                                    "Image type.\n\
-Valid types are:  ccf, tiff, tiled_tiff, jpeg, and general_raster.");
-
-static const int TABLE_SIZE = 9;
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimImageTypeLut::ossimImageTypeLut()
-   :
-      ossimLookUpTable(TABLE_SIZE)
-{
-   //***
-   // Complete initialization of data member "theImageTypeTable".
-   // Note:  Output type enumerations defined in constants.h file.
-   //***
-   theTable[0].theKey   = OSSIM_TIFF_STRIP;
-   theTable[0].theValue = "tiff_strip";
-   theTable[1].theKey   = OSSIM_TIFF_STRIP_BAND_SEPARATE;
-   theTable[1].theValue = "tiff_strip_band_separate";
-   theTable[2].theKey   = OSSIM_TIFF_TILED;
-   theTable[2].theValue = "tiff_tiled";
-   theTable[3].theKey   = OSSIM_TIFF_TILED_BAND_SEPARATE;
-   theTable[3].theValue = "tiff_tiled_band_separate";
-   theTable[4].theKey   = OSSIM_GENERAL_RASTER_BIP;
-   theTable[4].theValue = "general_raster_bip";
-   theTable[5].theKey   = OSSIM_GENERAL_RASTER_BIL;
-   theTable[5].theValue = "general_raster_bil";
-   theTable[6].theKey   = OSSIM_GENERAL_RASTER_BSQ;
-   theTable[6].theValue = "general_raster_bsq";
-   theTable[7].theKey   = OSSIM_JPEG;
-   theTable[7].theValue = "jpeg";
-   theTable[8].theKey   = OSSIM_PDF;
-   theTable[8].theValue = "ossim_pdf";
-}
diff --git a/ossim/src/ossim/base/ossimIrect.cpp b/ossim/src/ossim/base/ossimIrect.cpp
deleted file mode 100644
index 49a946d..0000000
--- a/ossim/src/ossim/base/ossimIrect.cpp
+++ /dev/null
@@ -1,681 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimIrect.
-// 
-//*******************************************************************
-//  $Id: ossimIrect.cpp 21560 2012-08-30 12:09:03Z gpotts $
-
-#include <ostream>
-#include <sstream>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-// nonstandard versions that use operator>, so they behave differently
-// than std:::min/max and ossim::min/max.  kept here for now for that
-// reason.
-#ifndef MAX
-#  define MAX(x,y) ((x)>(y)?(x):(y))
-#  define MIN(x,y) ((x)>(y)?(y):(x))
-#endif
-
-ossimIrect::ossimIrect(const ossimDrect& rect)
-   :
-      theUlCorner(rect.ul()),
-      theUrCorner(rect.ur()),
-      theLrCorner(rect.lr()),
-      theLlCorner(rect.ll()),
-      theOrientMode(rect.orientMode())
-{}
-
-ossimIrect::ossimIrect(const std::vector<ossimIpt>& points,
-                       ossimCoordSysOrientMode mode)
-   :
-      theOrientMode (mode)
-{
-   if(points.size())
-   {
-      ossim_uint32 index;
-      ossim_int32  minx = points[0].x;
-      ossim_int32  miny = points[0].y;
-      ossim_int32  maxx = points[0].x;
-      ossim_int32  maxy = points[0].y;
-            
-      // find the bounds
-      for(index = 1; index < points.size();index++)
-      {
-         minx = ossim::min(minx, points[index].x);
-         miny = ossim::min(miny, points[index].y);
-         maxx = ossim::max(maxx, points[index].x);
-         maxy = ossim::max(maxy, points[index].y);
-         
-      }
-      if(theOrientMode == OSSIM_LEFT_HANDED)
-      {
-         *this = ossimIrect(minx, miny, maxx, maxy, mode);
-      }
-      else
-      {
-         *this = ossimIrect(minx,maxy, maxx, miny, mode);
-      }
-   }
-   else
-   {
-      makeNan();
-   }
-}
-
-ossimIrect::ossimIrect(const ossimIpt& p1,
-                       const ossimIpt& p2,
-                       const ossimIpt& p3,
-                       const ossimIpt& p4,
-                       ossimCoordSysOrientMode mode)
-   :theOrientMode(mode)
-{
-   if(p1.hasNans()||p2.hasNans()||p3.hasNans()||p4.hasNans())
-   {
-      makeNan();
-   }
-   else
-   {
-      ossim_int32 minx, miny;
-      ossim_int32 maxx, maxy;
-      
-      minx = ossim::min( p1.x, ossim::min(p2.x, ossim::min(p3.x, p4.x)));
-      miny = ossim::min( p1.y, ossim::min(p2.y, ossim::min(p3.y, p4.y)));
-      maxx = ossim::max( p1.x, ossim::max(p2.x, ossim::max(p3.x, p4.x)));
-      maxy = ossim::max( p1.y, ossim::max(p2.y, ossim::max(p3.y, p4.y)));
-      
-      if(theOrientMode == OSSIM_LEFT_HANDED)
-      {
-         *this = ossimIrect(minx, miny, maxx, maxy, mode);
-      }
-      else
-      {
-         *this = ossimIrect(minx,maxy, maxx, miny, mode);
-      }
-   }
-}
-
-ossimIrect::~ossimIrect()
-{
-}
-
-//*******************************************************************
-//! Constructs an Irect surrounding the specified point, and of specified size.
-//*******************************************************************
-ossimIrect::ossimIrect(const ossimIpt& center, 
-                       ossim_uint32    size_x, 
-                       ossim_uint32    size_y,
-                       ossimCoordSysOrientMode mode)
-: theOrientMode (mode)
-{
-   ossim_int32 minx = center.x - size_x/2;
-   ossim_int32 maxx = minx + size_x - 1;
-
-   ossim_int32 miny = center.y - size_y/2;
-   ossim_int32 maxy = miny + size_y - 1;
-
-   if(mode == OSSIM_LEFT_HANDED)
-      *this = ossimIrect(minx, miny, maxx, maxy, mode);
-   else
-      *this = ossimIrect(minx,maxy, maxx, miny, mode);
-}
-
-
-//*************************************************************************************************
-//! Guarantees that this rect will be at least w X h big. If smaller than specified, the 
-//! corresponding side will be stretched equally in + and - direction to meet required size.
-//! Returns TRUE if resizing occurred.
-//*************************************************************************************************
-bool ossimIrect::insureMinimumSize(const ossimIpt& width_height)
-{
-   ossimIpt ul (theUlCorner);
-   ossimIpt lr (theLrCorner);
-   bool resized = false;
-
-   int dx = width_height.x - width();
-   int dy = width_height.y - height();
-
-   if (dx > 0)
-   {
-      dx = (int) ceil((double)dx/2.0);
-      ul.x -= dx;
-      lr.x += dx;
-      resized = true;
-   }
-
-   if (dy > 0)
-   {
-      resized = true;
-      if(theOrientMode == OSSIM_LEFT_HANDED)
-      {
-         dy = (int) ceil((double)dy/2.0);
-         ul.y -= dy;
-         lr.y += dy;
-      }
-      else
-      {
-         dy = (int) ceil((double)dy/2.0);
-         ul.y += dy;
-         lr.y -= dy;
-      }
-   }
-
-   if (resized)
-      *this = ossimIrect(ul, lr, theOrientMode);
-
-   return resized;
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-bool ossimIrect::intersects(const ossimIrect& rect) const
-{
-   if(rect.hasNans() || hasNans())
-   {
-      return false;
-   }
-   if (theOrientMode != rect.theOrientMode)
-      return false;
-   
-   ossim_int32  ulx = ossim::max(rect.ul().x,ul().x);
-   ossim_int32  lrx = ossim::min(rect.lr().x,lr().x);
-   ossim_int32  uly, lry;
-   bool rtn=false;
-   if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      uly  = ossim::max(rect.ul().y,ul().y);
-      lry  = ossim::min(rect.lr().y,lr().y);
-      rtn = ((ulx <= lrx) && (uly <= lry));
-   }
-   else
-   {
-      uly  = ossim::max(rect.ll().y,ll().y);
-      lry  = ossim::min(rect.ur().y,ur().y);
-      rtn = ((ulx <= lrx) && (uly <= lry));
-   }
-   
-   return (rtn);
-}
-
-void ossimIrect::stretchToTileBoundary(const ossimIpt& tileWidthHeight)
-{
-   ossimIpt ul;
-   ossimIpt lr;
-
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      ul.x = theUlCorner.x;
-      if( (theUlCorner.x % tileWidthHeight.x) != 0)
-      {
-         ul.x = ((ul.x / tileWidthHeight.x))*tileWidthHeight.x;
-         if(ul.x > theUlCorner.x)
-         {
-            ul.x -= tileWidthHeight.x;
-         }
-      }
-      ul.y = theUlCorner.y;
-      if( (theUlCorner.y % tileWidthHeight.y) != 0)
-      {
-         ul.y = ((ul.y / tileWidthHeight.y))*tileWidthHeight.y;
-         if(ul.y > theUlCorner.y)
-         {
-            ul.y -= tileWidthHeight.y;
-         }
-      }
-      ossim_int32 w = (theLrCorner.x - ul.x) + 1;
-      ossim_int32 h = (theLrCorner.y - ul.y) + 1;
-      
-      ossim_int32 nw = (w / tileWidthHeight.x)*tileWidthHeight.x;
-      ossim_int32 nh = (h / tileWidthHeight.y)*tileWidthHeight.y;
-      
-      if(w%tileWidthHeight.x)
-      {
-         nw += tileWidthHeight.x;
-      }
-      if(h%tileWidthHeight.y)
-      {
-         nh += tileWidthHeight.y;
-      }
-           
-      lr.x = ul.x + (nw-1);
-      lr.y = ul.y + (nh-1);
-   }
-   else
-   {
-      ul.x = theUlCorner.x;
-      ul.y = theUlCorner.y;
-      if( (theUlCorner.x%tileWidthHeight.x)!= 0)
-      {
-         ul.x = ((ul.x/ tileWidthHeight.x))*tileWidthHeight.x;
-         if(ul.x > theUlCorner.x)
-         {
-            ul.x -= tileWidthHeight.x;
-         }
-      }
-      if( (theUlCorner.y%tileWidthHeight.y)!=0 )
-      {
-         ul.y = ((ul.y / tileWidthHeight.y))*tileWidthHeight.y;
-         if(ul.y < theUlCorner.y)
-         {
-            ul.y += tileWidthHeight.y;
-         }
-      }
-      ossim_int32 w = theLrCorner.x - ul.x;
-      if (w < 0)
-      {
-         w = -w;
-      }
-      w += 1;
-      ossim_int32 h = theLrCorner.y - ul.y;
-      if (h < 0)
-      {
-         h = -h;
-      }
-      h += 1;
-
-      ossim_int32 nw = (w / tileWidthHeight.x)*tileWidthHeight.x;
-      ossim_int32 nh = (h / tileWidthHeight.y)*tileWidthHeight.y;
-      
-      if(w%tileWidthHeight.x)
-      {
-         nw += tileWidthHeight.x;
-      }
-      if(h%tileWidthHeight.y)
-      {
-         nh += tileWidthHeight.y;
-      }
-           
-      lr.x = ul.x + (nw-1);
-      lr.y = ul.y - (nh-1);
-  }
-
-   *this = ossimIrect(ul, lr, theOrientMode);
-}
-
-
-const ossimIrect& ossimIrect::expand(const ossimIpt& padding)
-{
-   theUlCorner.x -= padding.x;
-   theUrCorner.x += padding.x;
-   theLrCorner.x += padding.x;
-   theLlCorner.x -= padding.x;
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      theUlCorner.y -= padding.y;
-      theUrCorner.y -= padding.y;
-      theLrCorner.y += padding.y;
-      theLlCorner.y += padding.y;
-   }
-   else
-   {
-      theUlCorner.y += padding.y;
-      theUrCorner.y += padding.y;
-      theLrCorner.y -= padding.y;
-      theLlCorner.y -= padding.y;
-   }
-   
-   return *this;
-}
-
-ossimString ossimIrect::toString()const
-{
-   ossimString result="(";
-   
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      ossimIpt origin = ul();
-      result += (ossimString::toString(origin.x) + ",");
-      result += (ossimString::toString(origin.y) + ",");
-      result += (ossimString::toString(width()) + ",");
-      result += (ossimString::toString(height()) + ",");
-      result += "LH";
-   }
-   else 
-   {
-      ossimIpt origin = ll();
-      result += (ossimString::toString(origin.x) + ",");
-      result += (ossimString::toString(origin.y) + ",");
-      result += (ossimString::toString(width()) + ",");
-      result += (ossimString::toString(height()) + ",");
-      result += "RH";
-   }
-
-   result += ")";
-   return result;
-}
-
-bool ossimIrect::toRect(const ossimString& rectString)
-{
-   bool result = false;
-   makeNan();
-   
-   std::istringstream in(rectString);
-   ossim::skipws(in);
-   char charString[2];
-   charString[1] = '\0';
-   ossimString interior;
-   if(in.peek() == '(')
-   {
-      in.ignore();
-      while((in.peek() != ')')&&
-            (in.peek() != '\n') &&
-            in.good())
-      {
-         charString[0] = in.get();
-         interior += charString;
-      }
-      if(in.peek() == ')')
-      {
-         result = true;
-      }
-   }
-   if(result)
-   {
-      std::vector<ossimString> splitArray;
-      interior.split(splitArray, ",");
-      
-      // assume left handed
-      if(splitArray.size() >= 4)
-      {
-         ossim_int64 x = splitArray[0].toInt64();
-         ossim_int64 y = splitArray[1].toInt64();
-         ossim_int64 w = splitArray[2].toInt64();
-         ossim_int64 h = splitArray[3].toInt64();
-         ossimString orientation = "lh";
-         if(splitArray.size() == 5)
-         {
-            orientation = splitArray[4].downcase();
-         }
-         if(orientation == "lh")
-         {
-            // origin upper left
-            *this = ossimIrect(x,y,x + (w-1), y+h-1, OSSIM_LEFT_HANDED);
-         }
-         else 
-         {
-            // origin lower left
-            *this = ossimIrect(x,y+(h-1),x + (w-1), y, OSSIM_RIGHT_HANDED);
-         }
-         
-      }
-      else
-      {
-         result = false;
-      }
-
-   }
-   return result;
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-bool ossimIrect::completely_within(const ossimIrect& rect) const
-{
-   if(rect.hasNans() || hasNans())
-   {
-      return false;
-   }
-   
-   if (theOrientMode != rect.theOrientMode)
-      return false;
-   
-   /*  --------------
-       |     1      |
-       | ---------- |
-       | |        | |
-       | |        | |
-       | |   2    | |
-       | |        | |
-       | |        | |
-       | ---------- |
-       |            |
-       --------------  */
-
-   bool rtn = true;
-   
-   if (theUlCorner.x < rect.ul().x)
-      rtn = false;
-   
-   else if (theLrCorner.x > rect.lr().x)
-      rtn = false;
-   
-   else if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      if (theUlCorner.y < rect.ul().y)
-         rtn = false;
-   
-      else if (theLrCorner.y > rect.lr().y)
-         rtn = false;
-   }
-   
-   else
-   {
-      if (theUlCorner.y > rect.ul().y)
-         rtn = false;
-   
-      else if (theLrCorner.y < rect.lr().y)
-         rtn = false;
-   }
-
-   return rtn;
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-void ossimIrect::print(std::ostream& os) const
-{
-   os << toString();
-}
-
-//*******************************************************************
-// friend function: operator<<
-//*******************************************************************
-std::ostream& operator<<(std::ostream& os, const ossimIrect& rect)
-{
-   rect.print(os);
-
-   return os;
-}
-
-//*******************************************************************
-//  Method: ossimIrect::clipToRect
-//*******************************************************************
-ossimIrect ossimIrect::clipToRect(const ossimIrect& rect)const
-{   
-   if (theOrientMode != rect.theOrientMode)
-      return (*this);
-
-   int x0 = MAX(rect.ul().x, ul().x);
-   int x1 = MIN(rect.lr().x, lr().x);
-   int y0, y1;
-
-   if(!this->intersects(rect))
-   {
-      return ossimIrect(OSSIM_INT_NAN,
-         OSSIM_INT_NAN,
-         OSSIM_INT_NAN,
-         OSSIM_INT_NAN);
-
-   }
-   if (theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      y0 = MAX(rect.ul().y, ul().y);
-      y1 = MIN(rect.lr().y, lr().y);
-
-      if( (x1 < x0) || (y1 < y0) )
-         return ossimIrect(ossimIpt(0,0), ossimIpt(0,0), theOrientMode);
-      else
-         return ossimIrect(x0, y0, x1, y1, theOrientMode);
-   }
-   else
-   {
-      y1 = MIN(rect.ul().y,ul().y);
-      y0 = MAX(rect.lr().y,lr().y);
-
-      if((x1 < x0) || (y1 < y0))
-         return ossimIrect(ossimIpt(0,0), ossimIpt(0,0), theOrientMode);
-      else
-         return ossimIrect(x0, y1, x1, y0, theOrientMode);
-   }
-}
-
-//*******************************************************************
-//  Returns the minimum bounding rect that includes this and arg rect.
-//*******************************************************************
-ossimIrect ossimIrect::combine(const ossimIrect& rect) const
-{   
-   // If any rect has NANs, it is assumed uninitialized, so assign the result to just the other
-   if (hasNans()) 
-      return rect;
-   if(rect.hasNans())
-      return *this;
-
-   if (theOrientMode != rect.theOrientMode)
-      return(*this);
-
-   ossimIpt ulCombine;
-   ossimIpt lrCombine;
-
-   if(theOrientMode == OSSIM_LEFT_HANDED)
-   {
-      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
-      ulCombine.y = ((ul().y <= rect.ul().y)?ul().y:rect.ul().y);
-      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
-      lrCombine.y = ((lr().y >= rect.lr().y)?lr().y:rect.lr().y);
-   }
-   else
-   {
-      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
-      ulCombine.y = ((ul().y >= rect.ul().y)?ul().y:rect.ul().y);
-      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
-      lrCombine.y = ((lr().y <= rect.lr().y)?lr().y:rect.lr().y);
-   }
-
-   return ossimIrect(ulCombine, lrCombine, theOrientMode);
-}
-
-//*******************************************************************
-// Inline Method: ossimIrect::operator=(const ossimDrect& rect)
-//*******************************************************************
-const ossimIrect& ossimIrect::operator=(const ossimDrect& rect)
-{
-   theUlCorner   = rect.ul();
-   theUrCorner   = rect.ur();
-   theLrCorner   = rect.lr();
-   theLlCorner   = rect.ll();
-   theOrientMode = rect.orientMode();
-   
-   return *this;
-}
-
-bool ossimIrect::saveState(ossimKeywordlist& kwl,
-                           const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           "ossimIrect",
-           true);
-
-   kwl.add(prefix, "rect", toString());
- #if 0  
-   if(hasNans())
-   {
-      kwl.add(prefix,
-              "ul_x",
-              "nan",
-              true);
-      kwl.add(prefix,
-              "ul_y",
-              "nan",
-              true);
-      kwl.add(prefix,
-              "lr_x",
-              "nan",
-              true);
-      kwl.add(prefix,
-              "lr_y",
-              "nan",
-              true);
-   }
-   else
-   {
-      kwl.add(prefix,
-              "ul_x",
-              theUlCorner.x,
-              true);
-      kwl.add(prefix,
-              "ul_y",
-              theUlCorner.y,
-              true);
-      kwl.add(prefix,
-              "lr_x",
-              theLrCorner.x,
-              true);
-      kwl.add(prefix,
-              "lr_y",
-              theLrCorner.y,
-              true);
-   }
-#endif
-   return true;
-}
-
-bool ossimIrect::loadState(const ossimKeywordlist& kwl,
-                           const char* prefix)
-{
-  makeNan();
-  const char* ulx = kwl.find(prefix, "ul_x");
-  const char* uly = kwl.find(prefix, "ul_y");
-  const char* lrx = kwl.find(prefix, "lr_x");
-  const char* lry = kwl.find(prefix, "lr_y");
-  const char* rect = kwl.find(prefix, "rect");
-
-  if(ulx&&uly&&lrx&&lry)
-  {
-    if( (ossimString(ulx).trim().upcase() != "NAN") &&
-        (ossimString(uly).trim().upcase() != "NAN") &&
-        (ossimString(lrx).trim().upcase() != "NAN") &&
-        (ossimString(lry).trim().upcase() != "NAN"))
-    {
-      *this = ossimIrect(ossimString(ulx).toInt32(),
-                         ossimString(uly).toInt32(),
-                         ossimString(lrx).toInt32(),
-                         ossimString(lry).toInt32());
-    }
-  }
-  else if(rect)
-  {
-      toRect(rect);
-  }
-   
-   return true;
-}
-
-void ossimIrect::getCenter(ossimDpt& center_point) const
-{
-   if (hasNans())
-   {
-      center_point.makeNan();
-      return;
-   }
-
-   double d = (theUlCorner.x + theUrCorner.x + theLrCorner.x + theLlCorner.x);
-   center_point.x = d / 4.0;
-
-   d = (theUlCorner.y + theUrCorner.y + theLrCorner.y + theLlCorner.y);
-   center_point.y = d / 4.0;
-}
diff --git a/ossim/src/ossim/base/ossimKeywordNames.cpp b/ossim/src/ossim/base/ossimKeywordNames.cpp
deleted file mode 100644
index e4bffd5..0000000
--- a/ossim/src/ossim/base/ossimKeywordNames.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file
-//
-// Author: Ken Melero (kmelero at remotesensing.org)
-// 
-// Description: Common file for global Keywords.
-//
-//*************************************************************************
-// $Id: ossimKeywordNames.cpp 23623 2015-11-13 18:24:28Z gpotts $
-
-#include <ossim/base/ossimKeywordNames.h>
-
-const char* ossimKeywordNames::AZIMUTH_ANGLE_KW = "azimuth_angle";
-const char* ossimKeywordNames::BAND_KW = "band";
-const char* ossimKeywordNames::BANDS_KW = "bands";
-const char* ossimKeywordNames::BORDER_SIZE_KW = "border_size";
-const char* ossimKeywordNames::BRUSH_COLOR_KW = "brush_color";
-const char* ossimKeywordNames::BYTE_ORDER_KW = "byte_order";
-const char* ossimKeywordNames::CE90_ABSOLUTE_KW = "ce90_absolute";
-const char* ossimKeywordNames::CE90_RELATIVE_KW = "ce90_relative";
-const char* ossimKeywordNames::CENTRAL_MERIDIAN_KW = "central_meridian";
-const char* ossimKeywordNames::CENTRAL_POINT1_LAT_KW = "central_point1_lat";
-const char* ossimKeywordNames::CENTRAL_POINT1_LON_KW = "central_point1_lon";
-const char* ossimKeywordNames::CENTRAL_POINT2_LAT_KW = "central_point2_lat";
-const char* ossimKeywordNames::CENTRAL_POINT2_LON_KW = "central_point2_lon";
-const char* ossimKeywordNames::CENTER_PIXEL_X_KW = "center_pixel_x";
-const char* ossimKeywordNames::CENTER_PIXEL_Y_KW = "center_pixel_y";
-const char* ossimKeywordNames::COMPRESS_KW = "compress";
-const char* ossimKeywordNames::COMPRESSION_QUALITY_KW = "compression_quality";
-const char* ossimKeywordNames::COMPRESSION_TYPE_KW = "compression_type";
-const char* ossimKeywordNames::CONVERGENCE_THRESHOLD_KW = "convergence_threshold";
-const char* ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW = "create_external_geometry";
-const char* ossimKeywordNames::CREATE_IMAGE_KW = "create_image";
-const char* ossimKeywordNames::CREATE_HISTOGRAM_KW = "create_histogram";
-const char* ossimKeywordNames::CREATE_OVERVIEW_KW = "create_overview";
-const char* ossimKeywordNames::DATA_FILE_KW = "data_file";
-const char* ossimKeywordNames::DATE_KW = "date";
-const char* ossimKeywordNames::DATE_YEAR_KW = "year";
-const char* ossimKeywordNames::DATE_MONTH_KW = "month";
-const char* ossimKeywordNames::DATE_DAY_KW = "day";
-const char* ossimKeywordNames::DATE_HOUR_KW = "hour";
-const char* ossimKeywordNames::DATE_MIN_KW = "min";
-const char* ossimKeywordNames::DATE_SEC_KW = "sec";
-const char* ossimKeywordNames::DATE_FRACT_SEC_KW = "fract_sec";
-const char* ossimKeywordNames::DATUM_KW = "datum";
-const char* ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT = "decimal_degrees_per_pixel_lat";
-const char* ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON = "decimal_degrees_per_pixel_lon";
-const char* ossimKeywordNames::DESCRIPTION_KW = "description";
-const char* ossimKeywordNames::ELEVATION_ANGLE_KW = "elevation_angle";
-const char* ossimKeywordNames::ELEVATION_CELL_KW = "elevation_cell";
-const char* ossimKeywordNames::ELEVATION_SOURCE_KW = "elevation_source";
-const char* ossimKeywordNames::ELEVATION_LOOKUP_FLAG_KW = "elevation_lookup_flag";
-const char* ossimKeywordNames::ELLIPSE_CODE_KW = "ellipse_code";
-const char* ossimKeywordNames::ELLIPSE_EPSG_CODE_KW = "ellipse_epsg_code";
-const char* ossimKeywordNames::ELLIPSE_NAME_KW = "ellipse_name";
-const char* ossimKeywordNames::ENABLED_KW = "enabled";
-const char* ossimKeywordNames::ENABLE_CACHE_KW = "enable_cache";
-const char* ossimKeywordNames::EXTRACT_VERTICES_KW = "extract_vertices";  
-const char* ossimKeywordNames::ENTRY_KW = "entry";
-const char* ossimKeywordNames::FALSE_EASTING_NORTHING_KW = "false_easting_northing";
-const char* ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW = "false_easting_northing_units";
-const char* ossimKeywordNames::FALSE_EASTING_KW = "false_easting";
-const char* ossimKeywordNames::FALSE_NORTHING_KW = "false_northing";
-const char* ossimKeywordNames::FEATURE_NAME_KW = "feature_name";
-const char* ossimKeywordNames::FILENAME_KW = "filename";
-const char* ossimKeywordNames::FILEPATH_KW = "filepath";
-const char* ossimKeywordNames::FILL_FLAG_KW = "fill_flag";
-const char* ossimKeywordNames::FRAME_INDEX_KW = "frame_index";
-const char* ossimKeywordNames::GCS_CODE_KW = "gcs_code";
-const char* ossimKeywordNames::GEOM_FILE_KW = "geom_file";
-const char* ossimKeywordNames::HEMISPHERE_KW = "hemisphere";
-const char* ossimKeywordNames::HORIZONTAL_SIZE_KW = "horizontal_size";
-const char* ossimKeywordNames::ID_KW ="id";
-const char* ossimKeywordNames::IMAGE_CE90_KW  = "estimated_image_ce90";
-const char* ossimKeywordNames::IMAGE_FILE_KW = "image_file";
-const char* ossimKeywordNames::IMAGE_ID_KW = "image_id";
-const char* ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW = "image_model_transform_matrix";
-const char* ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW = "image_model_transform_unit";
-const char* ossimKeywordNames::IMAGE_PATH_KW = "image_path";
-const char* ossimKeywordNames::IMAGE_TYPE_KW = "image_type";
-const char* ossimKeywordNames::IMAGE_DATE_KW = "image_date";
-const char* ossimKeywordNames::IMAGE_FILE_SIZE_KW = "image_file_size";
-const char* ossimKeywordNames::INPUT_RR_LEVEL_KW = "input_rr_level";
-const char* ossimKeywordNames::INTERLEAVE_TYPE_KW = "interleave_type";
-const char* ossimKeywordNames::JULIAN_DAY_KW = "julian_day";
-const char* ossimKeywordNames::LAT_INCREMENT_KW = "lat_increment";
-const char* ossimKeywordNames::LL_LAT_KW = "ll_lat";
-const char* ossimKeywordNames::LL_LON_KW = "ll_lon";
-const char* ossimKeywordNames::LR_LAT_KW = "lr_lat";
-const char* ossimKeywordNames::LR_LON_KW = "lr_lon";
-const char* ossimKeywordNames::LL_X_KW = "ll_x";
-const char* ossimKeywordNames::LL_Y_KW = "ll_y";
-const char* ossimKeywordNames::LR_X_KW = "lr_x";
-const char* ossimKeywordNames::LR_Y_KW = "lr_y";
-const char* ossimKeywordNames::LON_INCREMENT_KW = "lon_increment";
-const char* ossimKeywordNames::MAJOR_AXIS_KW = "major_axis";
-const char* ossimKeywordNames::MAX_VALUE_KW = "max_value";
-const char* ossimKeywordNames::MAX_ITERATIONS_KW = "max_iterations";
-const char* ossimKeywordNames::MAX_QUADTREE_LEVELS_KW = "max_quadtree_levels";
-const char* ossimKeywordNames::METADATA_TYPE_KW = "metadata_type";
-const char* ossimKeywordNames::METERS_PER_PIXEL_KW = "meters_per_pixel";
-const char* ossimKeywordNames::METERS_PER_PIXEL_X_KW = "meters_per_pixel_x";
-const char* ossimKeywordNames::METERS_PER_PIXEL_Y_KW = "meters_per_pixel_y";
-const char* ossimKeywordNames::MINOR_AXIS_KW = "minor_axis";
-const char* ossimKeywordNames::MIN_VALUE_KW = "min_value";
-const char* ossimKeywordNames::NULL_VALUE_KW = "null_value";
-const char* ossimKeywordNames::NUMBER_BANDS_KW = "number_bands";
-const char* ossimKeywordNames::NUMBER_ENTRIES_KW = "number_entries";
-const char* ossimKeywordNames::NUMBER_INPUT_BANDS_KW = "number_input_bands";
-const char* ossimKeywordNames::NUMBER_INPUTS_KW = "number_inputs";
-const char* ossimKeywordNames::NUMBER_OUTPUTS_KW = "number_outputs";
-const char* ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW = "number_output_bands";
-const char* ossimKeywordNames::NUMBER_LINES_KW = "number_lines";
-const char* ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW = "number_reduced_res_sets";
-const char* ossimKeywordNames::NUMBER_SAMPLES_KW = "number_samples";
-const char* ossimKeywordNames::ORIGIN_X_KW = "origin_x";
-const char* ossimKeywordNames::ORIGIN_Y_KW = "origin_y";
-const char* ossimKeywordNames::ORIGIN_LATITUDE_KW = "origin_latitude";
-const char* ossimKeywordNames::ORIGINAL_MAP_UNITS_KW = "original_map_units";
-const char* ossimKeywordNames::OUTPUT_FILE_KW = "output_file";
-const char* ossimKeywordNames::OUTPUT_FILE_PREFIX_KW = "output_file_prefix";
-const char* ossimKeywordNames::OUTPUT_FILE_EXTENSION_KW = "output_file_extension";
-const char* ossimKeywordNames::OUTPUT_TILE_SIZE_KW = "output_tile_size";
-const char* ossimKeywordNames::OVERVIEW_COMPRESSION_QUALITY_KW = "overview_compression_quality";
-const char* ossimKeywordNames::OVERVIEW_COMPRESSION_TYPE_KW = "overview_compression_type";
-const char* ossimKeywordNames::OVERVIEW_FILE_KW  = "overview_file";
-const char* ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW = "overview_stop_dimension";
-const char* ossimKeywordNames::PCS_CODE_KW = "pcs_code";
-const char* ossimKeywordNames::PEN_COLOR_KW = "pen_color";
-const char* ossimKeywordNames::PHOTOMETRIC_KW    = "photometric";
-const char* ossimKeywordNames::PIXEL_SCALE_XY_KW = "pixel_scale_xy";
-const char* ossimKeywordNames::PIXEL_SCALE_UNITS_KW = "pixel_scale_units";
-const char* ossimKeywordNames::PIXEL_TYPE_KW  = "pixel_type";
-const char* ossimKeywordNames::PLANAR_CONFIG_KW  = "planar_config";
-const char* ossimKeywordNames::POINT_WIDTH_HEIGHT_KW = "point_width_height";
-const char* ossimKeywordNames::PROJECTION_KW     = "projection";
-const char* ossimKeywordNames::QUALITY_KW        = "quality";
-const char* ossimKeywordNames::QUERY_KW = "query";
-const char* ossimKeywordNames::RADIOMETRY_KW = "radiometry";
-const char* ossimKeywordNames::REDUCED_RES_LEVEL_KW = "reduced_res_level";
-const char* ossimKeywordNames::REF_GPT_LAT_KW  = "ref_point_lat";
-const char* ossimKeywordNames::REF_GPT_LON_KW  = "ref_point_lon";
-const char* ossimKeywordNames::REF_GPT_HGT_KW  = "ref_point_hgt";
-const char* ossimKeywordNames::REF_IPT_LINE_KW = "ref_point_line";
-const char* ossimKeywordNames::REF_IPT_SAMP_KW = "ref_point_samp";
-const char* ossimKeywordNames::ROTATION_KW = "rotation";
-const char* ossimKeywordNames::SCALE_PER_PIXEL_X_KW = "scale_per_pixel_x";
-const char* ossimKeywordNames::SCALE_PER_PIXEL_Y_KW = "scale_per_pixel_y";
-const char* ossimKeywordNames::SCALAR_TYPE_KW    = "scalar_type";
-const char* ossimKeywordNames::SCALE_FACTOR_KW   = "scale_factor";
-const char* ossimKeywordNames::SCALE_FACTOR_X_KW = "scale_factor_x";
-const char* ossimKeywordNames::SCALE_FACTOR_Y_KW = "scale_factor_y";
-const char* ossimKeywordNames::SCALE_X_KW = "scale_x";
-const char* ossimKeywordNames::SCALE_Y_KW = "scale_y";
-const char* ossimKeywordNames::SENSOR_ID_KW = "sensor";
-const char* ossimKeywordNames::SRS_NAME_KW = "srs_name";
-const char* ossimKeywordNames::STD_PARALLEL_1_KW = "std_parallel_1";
-const char* ossimKeywordNames::STD_PARALLEL_2_KW = "std_parallel_2";
-const char* ossimKeywordNames::THICKNESS_KW = "thickness";
-const char* ossimKeywordNames::THREADS_KW = "threads";
-const char* ossimKeywordNames::TIE_POINT_EASTING_KW = "tie_point_easting";  // ????
-const char* ossimKeywordNames::TIE_POINT_NORTHING_KW = "tie_point_northing";  // ????
-const char* ossimKeywordNames::TIE_POINT_XY_KW = "tie_point_xy";  // ????
-const char* ossimKeywordNames::TIE_POINT_UNITS_KW = "tie_point_units";
-const char* ossimKeywordNames::TIE_POINT_LAT_KW = "tie_point_lat";
-const char* ossimKeywordNames::TIE_POINT_LON_KW = "tie_point_lon";
-const char* ossimKeywordNames::TILE_SIZE_X_KW = "tile_size_x";
-const char* ossimKeywordNames::TILE_SIZE_Y_KW = "tile_size_y";
-const char* ossimKeywordNames::TILE_SOURCE_KW = "tile_source";
-const char* ossimKeywordNames::TILE_TYPE_KW = "tile_type";
-const char* ossimKeywordNames::TRANSLATION_X_KW = "translation_x";
-const char* ossimKeywordNames::TRANSLATION_Y_KW = "translation_y";
-const char* ossimKeywordNames::TYPE_KW = "type";
-const char* ossimKeywordNames::UL_LAT_KW = "ul_lat";
-const char* ossimKeywordNames::UL_LON_KW = "ul_lon";
-const char* ossimKeywordNames::UNITS_KW = "units";
-const char* ossimKeywordNames::UR_LAT_KW = "ur_lat";
-const char* ossimKeywordNames::UR_LON_KW = "ur_lon";
-const char* ossimKeywordNames::UL_X_KW = "ul_x";
-const char* ossimKeywordNames::UL_Y_KW = "ul_y";
-const char* ossimKeywordNames::UR_X_KW = "ur_x";
-const char* ossimKeywordNames::UR_Y_KW = "ur_y";
-const char* ossimKeywordNames::VALID_VERTICES_KW = "valid_vertices_file";
-const char* ossimKeywordNames::VERTICAL_SIZE_KW = "vertical_size";
-const char* ossimKeywordNames::ZONE_KW = "zone";
-
-ossimKeywordNames::ossimKeywordNames()
-{}
-
-ossimKeywordNames::ossimKeywordNames(const ossimKeywordNames& /* rhs */)
-{}
-
-const ossimKeywordNames& ossimKeywordNames::operator=(const ossimKeywordNames& /* rhs */)
-{
-   return *this;
-}
diff --git a/ossim/src/ossim/base/ossimKeywordlist.cpp b/ossim/src/ossim/base/ossimKeywordlist.cpp
deleted file mode 100644
index 25c87e6..0000000
--- a/ossim/src/ossim/base/ossimKeywordlist.cpp
+++ /dev/null
@@ -1,1411 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Description: This class provides capabilities for keywordlists.
-//
-//********************************************************************
-// $Id: ossimKeywordlist.cpp 23631 2015-11-19 20:40:01Z dburken $
-
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimTrace.h>
-
-#include <algorithm>
-#include <fstream>
-#include <list>
-#include <sstream>
-#include <utility>
-
-static ossimTrace traceDebug("ossimKeywordlist:debug");
-static const ossim_int32 MAX_LINE_LENGTH = 256;
-static const char NULL_KEY_NOTICE[]
-= "ossimKeywordlist Notice:  Null key passed to method.";
-
-
-#ifdef OSSIM_ID_ENABLED
-static const bool TRACE = false;
-static const char OSSIM_ID[] = "$Id: ossimKeywordlist.cpp 23631 2015-11-19 20:40:01Z dburken $";
-#endif
-
-const std::string ossimKeywordlist::NULL_KW = "";
-
-ossimKeywordlist::ossimKeywordlist(const ossimKeywordlist& src)
-:m_map(src.m_map),
-m_delimiter(src.m_delimiter),
-m_preserveKeyValues(src.m_preserveKeyValues),
-m_expandEnvVars(src.m_expandEnvVars)
-{
-}
-
-ossimKeywordlist::ossimKeywordlist(const std::map<std::string, std::string>& keywordMap)
-:m_map(keywordMap),
-m_delimiter(DEFAULT_DELIMITER),
-m_preserveKeyValues(true),
-m_expandEnvVars(true)
-{
-
-}
-
-ossimKeywordlist::ossimKeywordlist(char delimiter, 
-                                   bool expandEnvVars)
-:
-m_map(),
-m_delimiter(delimiter),
-m_preserveKeyValues(true),
-m_expandEnvVars(expandEnvVars)
-{
-#ifdef OSSIM_ID_ENABLED
-   if (TRACE) ossimNotify(ossimNotifyLevel_DEBUG) << OSSIM_ID << std::endl;
-#endif
-}
-
-ossimKeywordlist::ossimKeywordlist(const char* file,
-                                   char        delimiter,
-                                   bool        ignoreBinaryChars,
-                                   bool        expandEnvVars)
-:
-m_map(),
-m_delimiter(delimiter),
-m_preserveKeyValues(true),
-//m_lineContinuationCharacter('\\'),
-m_expandEnvVars(expandEnvVars)
-{
-   ossimFilename in_file(file);
-   
-   if (!parseFile(in_file, ignoreBinaryChars))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-   }
-}
-
-ossimKeywordlist::ossimKeywordlist(const ossimFilename& file,
-                                   char                 delimiter,
-                                   bool                 ignoreBinaryChars,
-                                   bool                 expandEnvVars)
-:
-m_map(),
-m_delimiter(delimiter),
-m_preserveKeyValues(true),
-m_expandEnvVars(expandEnvVars)
-
-{
-   if (!parseFile(file, ignoreBinaryChars))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-   }
-}
-
-ossimKeywordlist::~ossimKeywordlist()
-{
-   m_map.clear();
-}
-
-void ossimKeywordlist::setExpandEnvVarsFlag( bool flag )
-{
-   m_expandEnvVars = flag;
-}
-
-bool ossimKeywordlist::getExpandEnvVarsFlag( void ) const
-{
-   return m_expandEnvVars;
-}
-
-bool ossimKeywordlist::addFile(const char* file)
-{
-   ossimFilename in_file(file);
-   
-   return parseFile(in_file);
-}
-
-bool ossimKeywordlist::addFile(const ossimFilename& file)
-{
-   return parseFile(file);
-}
-
-void ossimKeywordlist::addList(const ossimKeywordlist &src, bool overwrite)
-{
-   KeywordMap::const_iterator i = src.m_map.begin();
-   
-   while (i != src.m_map.end())
-   {
-      addPair( (*i).first, (*i).second, overwrite );
-      i++;
-   }
-}
-
-void ossimKeywordlist::add(const ossimKeywordlist& kwl,
-                           const char* prefix,
-                           bool stripPrefix)
-{
-   std::map<std::string, std::string>::const_iterator iter = kwl.m_map.begin();
-   
-   ossimRegExp regExp;
-   
-   // Check for null prefix.
-   std::string tmpPrefix;
-   if (prefix) tmpPrefix = prefix;
-   
-   regExp.compile(("^("+tmpPrefix+")").c_str());
-   
-   while(iter != kwl.m_map.end())
-   {
-      ossimString newKey;
-      
-      if(regExp.find( (*iter).first.c_str()))
-      {
-         newKey = (*iter).first;
-         if(stripPrefix && prefix)
-         {
-            newKey = newKey.substitute(prefix, "");
-            
-         }
-         
-         addPair(newKey.string(), (*iter).second, true);
-      }
-      ++iter;
-   }
-}
-
-void ossimKeywordlist::add(const char* prefix,
-                           const ossimKeywordlist& kwl,
-                           bool overwrite)
-{
-   std::string p = prefix ? prefix : "";
-   std::map<std::string, std::string>::const_iterator iter = kwl.m_map.begin();
-   while(iter != kwl.m_map.end())
-   {
-      std::string k( p + (*iter).first );
-      addPair( k, (*iter).second, overwrite );
-      ++iter;
-   }
-}
-
-void ossimKeywordlist::addPair(const std::string& key,
-                               const std::string& value,
-                               bool               overwrite)
-{
-   if ( key.size() )
-   {
-      ossimString v = value;
-      if ( m_expandEnvVars == true )
-      {
-         v = v.expandEnvironmentVariable();
-      }
-      
-      KeywordMap::iterator i = getMapEntry(key);
-      
-      if (i == m_map.end())
-      {
-         m_map.insert(std::make_pair(key, v.string()));
-      }
-      else if (overwrite)
-      {
-         (*i).second = v.string();
-      }
-   }
-}
-
-void ossimKeywordlist::addPair(const std::string& prefix,
-                               const std::string& key,
-                               const std::string& value,
-                               bool               overwrite)
-{
-   std::string k(prefix + key);
-   addPair(k, value, overwrite);
-}
-
-void ossimKeywordlist::add(const char* key,
-                           const char* value,
-                           bool        overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v(value?value:"");
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* prefix,
-                           const char* key,
-                           const char* value,
-                           bool        overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v(value ? value : "");
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           char        value,
-                           bool        overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v(1, value);
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* prefix,
-                           const char* key,
-                           char        value,
-                           bool        overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v(1, value);
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_int16 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* prefix,
-                           const char* key,
-                           ossim_int16 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_uint16 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* prefix,
-                           const char* key,
-                           ossim_uint16 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_int32 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char*  prefix,
-                           const char*  key,
-                           ossim_int32 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_uint32 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char*  prefix,
-                           const char*  key,
-                           ossim_uint32 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_int64 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char*  prefix,
-                           const char*  key,
-                           ossim_int64 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_uint64 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char*  prefix,
-                           const char*  key,
-                           ossim_uint64 value,
-                           bool overwrite)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_float32 value,
-                           bool overwrite,
-                           int precision)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value, precision).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* prefix,
-                           const char* key,
-                           ossim_float32 value,
-                           bool overwrite,
-                           int precision)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value, precision).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* key,
-                           ossim_float64 value,
-                           bool overwrite,
-                           int precision)
-{
-   if ( key )
-   {
-      std::string k(key);
-      std::string v = ossimString::toString(value, precision).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-void ossimKeywordlist::add(const char* prefix,
-                           const char* key,
-                           ossim_float64 value,
-                           bool overwrite,
-                           int precision)
-{
-   if ( key )
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      std::string v = ossimString::toString(value, precision).string();
-      addPair(k, v, overwrite);
-   }
-}
-
-bool ossimKeywordlist::write(const char* file, 
-                             const char* comment) const
-{
-   std::ofstream filename(file);
-   if (!filename)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-      <<"ossimKeywordlist::write, Error opening file:  "
-      << file << std::endl;
-      return false;
-   }
-   
-   if ( comment != 0 )
-   {
-      ossimString commentStr("// ");
-      commentStr += comment;
-      
-      // Write out the input comment to the first line.
-      filename << commentStr.c_str() << std::endl;
-   }
-   
-   writeToStream(filename);
-   
-   filename.close();
-   
-   return true;
-}
-
-ossimString ossimKeywordlist::toString()const
-{
-   std::ostringstream out;
-   writeToStream(out);
-   
-#if 0
-   KeywordMap::const_iterator i;
-   ossimString result;
-   
-   for(i = m_map.begin(); i != m_map.end(); i++)
-   {
-      result += (*i).first;
-      result += delimiter_str().c_str();
-      result += " ";
-      result += (*i).second;
-      result += '\n';
-   }
-#endif
-   return ossimString(out.str());
-}
-
-void ossimKeywordlist::toString(ossimString& result)const
-{
-   std::ostringstream out;
-   writeToStream(out);
-   
-   result = out.str();
-#if 0
-   KeywordMap::const_iterator i;
-   
-   for(i = m_map.begin(); i != m_map.end(); i++)
-   {
-      result += (*i).first;
-      result += delimiter_str().c_str();
-      result += " ";
-      result += (*i).second;
-      result += '\n';
-   }
-#endif
-}
-
-void ossimKeywordlist::writeToStream(std::ostream& out) const
-{
-   KeywordMap::const_iterator i;
-   ossimString value;
-   ossimRegExp reg("\n|\r| $|^ ");
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      value = (*i).second;
-      if(!value.empty())
-      {
-         if(reg.find(value))
-         {
-            value = "\"\"\"" + value + "\"\"\"";
-         }
-      }
-      //      value = value.substitute('\n', "\\\n", true);
-      out << (*i).first  << delimiter_str().c_str() << "  "
-      << value << std::endl;
-   }
-}
-
-bool ossimKeywordlist::hasKey( const std::string& key ) const
-{
-   bool result = false;
-   KeywordMap::const_iterator i = m_map.find(key);
-   if (i != m_map.end())
-   {
-      result = true;
-   }
-   return result;
-}
-
-const std::string& ossimKeywordlist::findKey(const std::string& key) const
-{
-   // std::string result;
-   KeywordMap::const_iterator i = m_map.find(key);
-   if (i != m_map.end())
-   {
-      // result = (*i).second;
-      return (*i).second;
-   }
-   return ossimKeywordlist::NULL_KW;
-}
-
-const std::string& ossimKeywordlist::findKey(const std::string& prefix,
-                                             const std::string& key) const
-{
-   std::string k = prefix+key;
-   return findKey(k);
-}
-
-const char* ossimKeywordlist::find(const char* key) const
-{
-   const char* result = 0;
-   if (key)
-   {
-      std::string k = key;
-      KeywordMap::const_iterator i = m_map.find( k );
-      if (i != m_map.end())
-      {
-         result = (*i).second.c_str();
-      }
-   }
-   return result;
-}
-
-const char* ossimKeywordlist::find(const char* prefix,
-                                   const char* key) const
-{
-   const char* result = 0;
-   if (key)
-   {
-      std::string k;
-      if (prefix) k = prefix;
-      k += key;
-      KeywordMap::const_iterator i = m_map.find( k );
-      if (i != m_map.end())
-      {
-         result = (*i).second.c_str();
-      }
-   }
-   return result;
-}
-
-void ossimKeywordlist::remove(const char * key)
-{
-   ossimString k = key?key:"";
-   
-   KeywordMap::iterator i = m_map.find(k);
-   
-   if(i != m_map.end())
-   {
-      m_map.erase(i);
-   }
-}
-
-void ossimKeywordlist::remove(const char* prefix, const char * key)
-{
-   if (key)
-   {
-      ossimString k;
-      if (prefix) k = prefix;
-      k += key;
-      
-      KeywordMap::iterator i = m_map.find(k);
-      
-      if(i != m_map.end())
-      {
-         m_map.erase(i);
-      }
-   }
-}
-
-ossim_uint32 ossimKeywordlist::numberOf(const char* str) const
-{
-   ossim_uint32 count = 0;
-   
-   if (str)
-   {
-      KeywordMap::const_iterator i = m_map.begin();
-      
-      while (i != m_map.end())
-      {
-         if ( ossimString((*i).first).contains(str) )
-         {
-            ++count;
-         }
-         ++i;
-      }
-   }
-   
-   return count;
-}
-
-ossim_uint32 ossimKeywordlist::numberOf(const char* prefix,
-                                        const char* key) const
-{
-   if ( key ) // Must have key, sometimes no prefix.
-   {
-      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
-      return numberOf(k.c_str());
-   }
-   return 0;
-}
-
-void ossimKeywordlist::clear()
-{
-   m_map.clear();
-}
-
-ossimKeywordlist::KeywordMap::iterator
-ossimKeywordlist::getMapEntry(const char* key)
-{
-   if (key)
-   {
-      std::string k = key;
-      return m_map.find(k);
-   }
-   else
-   {
-      return m_map.end();
-   }
-}
-
-ossimKeywordlist::KeywordMap::iterator
-ossimKeywordlist::getMapEntry(const std::string& key)
-{
-   return m_map.find(key);
-}
-
-ossimKeywordlist::KeywordMap::iterator
-ossimKeywordlist::getMapEntry(const ossimString& key)
-{
-   return m_map.find(key.string());
-}
-
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimKeywordlist::parseFile(const ossimFilename& file,
-                                 bool ignoreBinaryChars)
-{
-   if(!file.exists()) return false;
-   bool result = false;
-   std::ifstream is;
-   is.open(file.c_str(), std::ios::in | std::ios::binary);
-   
-   if(!is.fail())
-   {
-      result = parseStream(is, ignoreBinaryChars);
-   }
-   
-   is.close();
-   
-   return result;
-}
-
-bool ossimKeywordlist::parseStream(std::istream& is, bool /* ignoreBinaryChars */)
-{
-   return parseStream(is);
-}
-
-bool ossimKeywordlist::parseString(const std::string& inString)
-{
-   std::istringstream in(inString);
-   
-   return parseStream(in);
-}
-
-bool ossimKeywordlist::isValidKeywordlistCharacter(ossim_uint8 c)const
-{
-   if((c>=0x20&&c<=0x7e))
-   {
-      return true;
-   }
-   switch(c)
-   {
-      case '\n':
-      case '\r':
-      case '\t':
-         return true;
-   }
-   return false;
-}
-
-void ossimKeywordlist::skipWhitespace(std::istream& in)const
-{
-   int c = in.peek();
-   while( !in.fail() &&
-         ( (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') ) )
-   {
-      in.ignore(1);
-      c = in.peek();
-   }
-}
-
-ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readComments(ossimString& sequence, std::istream& in)const
-{
-   KeywordlistParseState result = KeywordlistParseState_FAIL;
-   char c = (char)in.peek();
-   if(c == '/')
-   {
-      sequence += (char)in.get();
-      c = in.peek();
-      if(c == '/')
-      {
-         result = KeywordlistParseState_OK;
-         sequence += c;
-         while(!in.bad()&&!in.eof())
-         {
-            c = (char)in.get();
-            if(!isValidKeywordlistCharacter(c))
-            {
-               result = KeywordlistParseState_BAD_STREAM;
-               break;
-            }
-            if((c == '\n')||
-               (c == '\r'))
-            {
-               break;
-            }
-            sequence += c;
-         }
-      }
-   }
-   return result;
-}
-
-ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readKey(ossimString& sequence, std::istream& in)const
-{
-   KeywordlistParseState result = KeywordlistParseState_FAIL;
-   if(!sequence.empty())
-   {
-      if(*(sequence.begin()+(sequence.size()-1)) == m_delimiter)
-      {
-         sequence = ossimString(sequence.begin(), sequence.begin() + (sequence.size()-1));
-         return KeywordlistParseState_OK;
-      }
-   }
-   // not a comment so read til key delimeter
-   while(!in.eof() && in.good())
-   {
-      ossim_uint8 c = in.get();
-      if( isValidKeywordlistCharacter(c) )
-      {
-         if ( (c == '\n') || (c == '\r') ) 
-         {
-            // Hit end of line with no delimiter.
-            if ( in.peek() == EOF )
-            {
-               //---
-               // Allowing on last line only.
-               // Note the empty key will trigger parseStream to return true.
-               //---
-               sequence.clear();
-               result = KeywordlistParseState_OK;
-               break;
-            }
-            else // Line with no delimiter.
-            {
-               // mal formed input stream for keyword list specification
-               result = KeywordlistParseState_BAD_STREAM;
-               break;
-            }
-         }
-         else if(c != m_delimiter)
-         {
-            sequence += (char)c;
-         }
-         else // at m_delimiter
-         {
-            result = KeywordlistParseState_OK;
-            sequence = sequence.trim();
-            break;
-         }
-      }
-      else 
-      {
-         // mal formed input stream for keyword list specification
-         result = KeywordlistParseState_BAD_STREAM;
-         break;
-      }
-   }
-   // we never found a delimeter so we are mal formed
-   if(!sequence.empty()&&(result!=KeywordlistParseState_OK))
-   {
-      result = KeywordlistParseState_BAD_STREAM;
-   }
-   return result;
-}
-
-ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readValue(ossimString& sequence, std::istream& in)const
-{
-   KeywordlistParseState result = KeywordlistParseState_OK;
-   
-   ossim_int32 quoteCount = 0; // mark as not set
-   
-   // make sure we check for a blank value
-   while(!in.eof()&&!in.bad())
-   {
-      if(in.peek() == ' '||
-         in.peek() == '\t')
-      {
-         in.ignore();
-      }
-      else if(in.peek() == '\n' ||
-              in.peek() == '\r')
-      {
-         in.ignore();
-         return result;
-      }
-      else 
-      {
-         break;
-      }
-   }
-   // The ifstream object will end in '�' (character 255 or -1) if the end-of-file indicator 
-   // will not be set(e.g \n). In this case, end-of-file conditions would never be detected. 
-   // add EOF (which is actually the integer -1 or 255) check here.
-   // Reference link http://www.cplusplus.com/forum/general/33821/
-   while(!in.eof()&&!in.bad()&&in.peek()!=EOF)
-   {
-      ossim_uint8 c = in.get();
-      if(isValidKeywordlistCharacter(c))
-      {
-         if(((c == '\n'||c=='\r') && !quoteCount) || in.eof())
-         {
-            break;
-         }
-         sequence += (char)c;
-         if(sequence.size() >2)
-         {
-            if(quoteCount < 1)
-            {
-               //---
-               // If string has leading tripple quoted bump the "quoteCount" so
-               // we start skipping line breaks, preserving paragraph style strings.
-               //---
-               if(ossimString(sequence.begin(), sequence.begin()+3) == "\"\"\"")
-               {
-                  ++quoteCount;
-               }
-            }
-            else // check for ending quotes 
-            {
-               if(ossimString(sequence.begin() + sequence.size()-3, sequence.end()) == "\"\"\"")
-               {
-                  ++quoteCount;
-               }
-            }
-         }
-         if(quoteCount > 1)
-         {
-            //---
-            // Have leading and trailing tripple quotes. Some tiff writers, e.g. Space
-            // Imaging are using four quotes.  Below code strips all quotes from each end.
-            //---
-            char quote = '"';
-            std::string::size_type startPos = sequence.string().find_first_not_of(quote);
-            std::string::size_type stopPos  = sequence.string().find_last_not_of(quote);
-            if ( ( startPos != std::string::npos ) && (stopPos != std::string::npos) )
-            {
-               sequence = sequence.string().substr( startPos, stopPos-startPos+1 );
-            }
-            break;
-         }
-      }
-      else 
-      {
-         result = KeywordlistParseState_BAD_STREAM;
-         break;
-      }
-   }
-   return result;
-}
-
-ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readKeyAndValuePair(ossimString& key, ossimString& value, std::istream& in)const
-{
-   ossimKeywordlist::KeywordlistParseState keyState   = readKey(key, in);
-   if(keyState & KeywordlistParseState_BAD_STREAM) return keyState;
-   ossimKeywordlist::KeywordlistParseState valueState = readValue(value, in);
-   return static_cast<ossimKeywordlist::KeywordlistParseState>( (static_cast<int>(keyState) |
-                                                                 static_cast<int>(valueState)) );
-}
-
-bool ossimKeywordlist::parseStream(std::istream& is)
-{
-   if (!is) // Check stream state.
-   {
-      return false;
-   }
-   ossimString key;
-   ossimString value;
-   ossimString sequence;
-   KeywordlistParseState state = KeywordlistParseState_OK;
-   while(!is.eof() && !is.bad())
-   {
-      skipWhitespace(is);
-      if(is.eof() || is.bad()) return true; // we skipped to end so valid keyword list
-      state = readComments(sequence, is);
-      if(state & KeywordlistParseState_BAD_STREAM) return false;
-      // if we failed a comment parse then try key value parse.
-      if(state == KeywordlistParseState_FAIL)
-      {
-         key = sequence; // just in case there is a 1 token look ahead residual for a single slash test.
-         ossimKeywordlist::KeywordlistParseState testKeyValueState = readKeyAndValuePair(key, value, is);
-         if(testKeyValueState == KeywordlistParseState_OK)
-         {
-            key = key.trim();
-            if(key.empty())
-            {
-               return true;
-            }
-            if ( m_expandEnvVars == true )
-            {
-               ossimString result = value.expandEnvironmentVariable();
-               m_map.insert(std::make_pair(key.string(), result.string()));
-            }
-            else
-            {
-               m_map.insert(std::make_pair(key.string(), value.string()));
-            }
-         }
-         else if(testKeyValueState & KeywordlistParseState_BAD_STREAM)
-         {
-            return false;
-         }
-#if 0
-         // Commented out to allow an invalid line in keyword list without
-         // erroring out, effectively skipping bad line. drb - 01 Sep. 2001
-         else
-         {
-            return false;
-         }
-#endif
-      }
-      else if(state & KeywordlistParseState_BAD_STREAM)
-      {
-         return false;
-      }
-      sequence = key = value = "";
-   }   
-   
-   return true;
-}
-
-std::vector<ossimString> ossimKeywordlist::findAllKeysThatContains(const ossimString &searchString)const
-{
-   KeywordMap::const_iterator i;
-   std::vector<ossimString> result;
-   
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      if( ossimString((*i).first).contains(searchString))
-      {
-         result.push_back((*i).first);
-      }
-   }
-   
-   return result;
-}
-
-void ossimKeywordlist::findAllKeysThatMatch( std::vector<ossimString>& result,
-                                             const ossimString &regularExpression ) const
-{
-   KeywordMap::const_iterator i;
-   ossimRegExp regExp;
-   regExp.compile(regularExpression.c_str());
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      if(regExp.find( (*i).first.c_str()))
-      {
-         result.push_back((*i).first);
-      }
-   }
-}
-
-ossim_uint32  ossimKeywordlist::getNumberOfKeysThatMatch(
-   const ossimString &regularExpression ) const
-{
-   ossim_uint32 result = 0;
-   KeywordMap::const_iterator i;
-   ossimRegExp regExp;
-   regExp.compile(regularExpression.c_str());
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      if(regExp.find( (*i).first.c_str()))
-      {
-         ++result;
-      }
-   }
-   return result;
-}
-
-void ossimKeywordlist::extractKeysThatMatch(ossimKeywordlist& kwl,
-                                            const ossimString &regularExpression)const
-{
-   KeywordMap::const_iterator i;
-   std::vector<ossimString> result;
-   ossimRegExp regExp;
-   
-   regExp.compile(regularExpression.c_str());
-   
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      if(regExp.find( (*i).first.c_str()))
-      {
-         kwl.addPair((*i).first, (*i).second);
-      }
-   }
-}
-
-void ossimKeywordlist::removeKeysThatMatch(const ossimString &regularExpression)
-{
-   KeywordMap::const_iterator i;
-   std::vector<ossimString> result;
-   ossimRegExp regExp;
-   
-   regExp.compile(regularExpression.c_str());
-   
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      if(regExp.find( (*i).first.c_str()))
-      {
-         result.push_back((*i).first);
-      }
-   }
-   for(ossim_uint32 i2 = 0; i2 < result.size(); ++i2)
-   {
-      remove(result[i2]);
-   }
-}
-
-std::vector<ossimString> ossimKeywordlist::getSubstringKeyList(const ossimString& regularExpression)const
-{
-   std::vector<ossimString> result;
-   getSubstringKeyList(result, regularExpression);
-   return result;
-}
-
-void ossimKeywordlist::getSubstringKeyList(std::vector<ossimString>& result,
-                                           const ossimString& regularExpression)const
-{
-   KeywordMap::const_iterator i;
-   ossimRegExp regExp;
-   
-   regExp.compile(regularExpression.c_str());
-   
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      if(regExp.find( (*i).first.c_str()))
-      {
-         ossimString value = ossimString((*i).first.begin()+regExp.start(),
-                                         (*i).first.begin()+regExp.start()+regExp.end());
-         
-         if(std::find(result.begin(), result.end(), value) == result.end())
-         {
-            result.push_back(value);
-         }
-      }
-   }
-}
-
-ossim_uint32 ossimKeywordlist::getNumberOfSubstringKeys(const ossimString& regularExpression)const
-{
-   KeywordMap::const_iterator i;
-   std::list<ossimString> currentList;
-   ossim_uint32 result = 0;
-   ossimRegExp regExp;
-   
-   regExp.compile(regularExpression.c_str());
-   
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      if(regExp.find( (*i).first.c_str()))
-      {
-         ossimString value = ossimString((*i).first.begin()+regExp.start(),
-                                         (*i).first.begin()+regExp.start()+regExp.end());
-         
-         // make sure we have not already marked it as
-         // found
-         if(std::find(currentList.begin(),
-                      currentList.end(),
-                      value) == currentList.end())
-         {
-            currentList.push_back(value);
-            ++result;
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimKeywordlist::addPrefixToAll(const ossimString& prefix)
-{
-   ossimKeywordlist tempKwl = *this;
-   
-   clear();
-   
-   KeywordMap::const_iterator values = tempKwl.m_map.begin();
-   
-   while(values != tempKwl.m_map.end())
-   {
-      std::string newKey = prefix.string() + (*values).first;
-      addPair(newKey, (*values).second, true);
-      ++values;
-   }
-}
-
-void ossimKeywordlist::addPrefixToKeysThatMatch(const ossimString& prefix,
-                                                const ossimString& regularExpression)
-{
-   ossimKeywordlist tempKwl = *this;
-   
-   clear();
-   
-   KeywordMap::const_iterator values = tempKwl.m_map.begin();
-   ossimRegExp regExp;
-   
-   regExp.compile(regularExpression.c_str());
-   
-   while(values != tempKwl.m_map.end())
-   {
-      std::string newKey = prefix.string()+(*values).first;
-      if(regExp.find( (*values).first.c_str()))
-      {
-         
-         addPair(newKey, (*values).second, true);
-      }
-      else
-      {
-         addPair((*values).first, (*values).second, true);
-      }
-      ++values;
-   }
-}
-
-void ossimKeywordlist::stripPrefixFromAll(const ossimString& regularExpression)
-{
-   ossimKeywordlist tempKwl = *this;
-   
-   clear();
-   
-   KeywordMap::const_iterator values = tempKwl.m_map.begin();
-   ossimRegExp regExp;
-   
-   regExp.compile(regularExpression.c_str());
-   
-   while(values != tempKwl.m_map.end())
-   {
-      std::string newKey = (*values).first;
-      if(regExp.find( (*values).first.c_str()))
-      {
-         newKey.erase(newKey.begin()+regExp.start(),
-                      newKey.begin()+regExp.start()+regExp.end());
-         
-         addPair(newKey, (*values).second, true);
-      }
-      else
-      {
-         addPair(newKey, (*values).second, true);
-      }
-      ++values;
-   }
-}
-
-ossim_uint32 ossimKeywordlist::getSize()const
-{
-   return (ossim_uint32)m_map.size();
-}
-
-const ossimKeywordlist::KeywordMap& ossimKeywordlist::getMap()const
-{
-   return m_map;
-}
-
-ossimKeywordlist::KeywordMap& ossimKeywordlist::getMap()
-{
-   return m_map;
-}
-
-void ossimKeywordlist::change_delimiter(char del)
-{
-   m_delimiter = del;
-}
-
-ossimString ossimKeywordlist::delimiter_str() const
-{
-   char tmp[2];
-   tmp[0] = m_delimiter;
-   tmp[1] = '\0';
-   return ossimString(tmp);
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-std::ostream& ossimKeywordlist::print(std::ostream& os) const
-{
-   writeToStream(os);
-#if 0
-   KeywordMap::const_iterator i;
-   
-   for(i = m_map.begin(); i != m_map.end(); ++i)
-   {
-      os << (*i).first << delimiter_str().c_str() << "  "
-      << (*i).second << std::endl;
-   }
-#endif
-   return os;
-}
-
-//*******************************************************************
-// friend function:
-//*******************************************************************
-OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
-                                        const ossimKeywordlist& kwl)
-{
-   kwl.print(os);
-   
-   return os;
-}
-
-
-bool ossimKeywordlist::operator ==(ossimKeywordlist& kwl)const
-{
-   if(this==&kwl) return true;
-   std::map<std::string, std::string>::const_iterator iter = m_map.begin();
-   
-   while(iter != m_map.end())
-   {
-      const char* value = kwl.find((*iter).first.c_str());
-      
-      if(ossimString(value) != (*iter).second)
-      {
-         return false;
-      }
-      ++iter;
-   }
-   
-   return true;
-}
-
-ossimKeywordlist&  ossimKeywordlist::downcaseKeywords()
-{
-   KeywordMap tempMap;
-   KeywordMap::iterator iter = m_map.begin();
-   
-   while(iter != m_map.end())
-   {
-      ossimString k(iter->first);
-      tempMap.insert(std::make_pair(k.downcase().string(), iter->second));
-      ++iter;
-   }
-   m_map = tempMap;
-   
-   return *this;
-}
-
-ossimKeywordlist& ossimKeywordlist::upcaseKeywords()
-{
-   KeywordMap tempMap;
-   KeywordMap::iterator iter = m_map.begin();
-   
-   while(iter != m_map.end())
-   {
-      ossimString k(iter->first);
-      tempMap.insert(std::make_pair(k.upcase().string(), iter->second));
-      ++iter;
-   }
-   m_map = tempMap;
-   
-   return *this;
-}
-
-ossimKeywordlist& ossimKeywordlist::trimAllValues(const ossimString& valueToTrim)
-{
-   KeywordMap::iterator iter = m_map.begin();
-   
-   while(iter != m_map.end())
-   {
-      iter->second = ossimString(iter->second).trim(valueToTrim).string();
-      ++iter;
-   }
-   
-   return *this;
-}
-
-ossimKeywordlist ossimKeywordlist::trimAllValues(const ossimString& valueToTrim)const
-{
-   ossimKeywordlist result(*this);
-   result.trimAllValues(valueToTrim);
-   return result;
-}
-
-
-//*************************************************************************************************
-//! [OLK, Aug/2008]
-//! Sets the boolean destination arg depending on value associated with keyword for values = 
-//! (yes|no|true|false|1|0). Returns TRUE if keyword found, otherwise false. Also returns false
-//! if none of the above permitted values are specified (rtn_val left unchanged in this case).
-//*************************************************************************************************
-bool ossimKeywordlist::getBoolKeywordValue(bool& rtn_val, 
-                                           const char* keyword, 
-                                           const char* prefix) const
-{
-   bool found = true;
-   const char* val_str = find(prefix, keyword);
-   if (val_str) 
-   {
-      found = true;
-      ossimString yesno (val_str);
-      yesno.upcase();
-      if ((yesno == "YES") || (yesno == "TRUE") || (yesno == "1"))
-         rtn_val = true;
-      else if ((yesno == "NO") || (yesno == "FALSE") || (yesno == "0"))
-         rtn_val = false;
-      else
-         found = false;
-   }
-   else
-      found = false;
-   
-   return found;
-}
-
diff --git a/ossim/src/ossim/base/ossimListener.cpp b/ossim/src/ossim/base/ossimListener.cpp
deleted file mode 100644
index 4127f24..0000000
--- a/ossim/src/ossim/base/ossimListener.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  Garrett Potts 
-//
-//*******************************************************************
-//  $Id: ossimListener.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/base/ossimListener.h>
-
-RTTI_DEF(ossimListener, "ossimListener");
-
-ossimListener::ossimListener()
-  :theListenerEnableFlag(true)
-{}
-
-ossimListener::~ossimListener()
-{
-}
-
-void ossimListener::processEvent(ossimEvent& /* event */)
-{
-}
-
-void ossimListener::enableListener()
-{
-  theListenerEnableFlag = true;
-}
-
-void ossimListener::disableListener()
-{
-  theListenerEnableFlag = false;
-}
-
-void ossimListener::setListenerEnableFlag(bool flag)
-{
-  theListenerEnableFlag = flag;
-}
-
-bool ossimListener::isListenerEnabled()const
-{
-  return theListenerEnableFlag;
-}
-
-bool ossimListener::getListenerEnableFlag()const
-{
-  return theListenerEnableFlag;
-}
-
diff --git a/ossim/src/ossim/base/ossimListenerManager.cpp b/ossim/src/ossim/base/ossimListenerManager.cpp
deleted file mode 100644
index 4ac0d7a..0000000
--- a/ossim/src/ossim/base/ossimListenerManager.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See LICENSE.txt file in the top level directory.
-//
-// Author: Garrett Potts
-// 
-// Description: A brief description of the contents of the file.
-//
-//*************************************************************************
-// $Id: ossimListenerManager.cpp 17193 2010-04-23 14:59:44Z dburken $
-
-#include <algorithm>
-#include <ossim/base/ossimListenerManager.h>
-#include <ossim/base/ossimEvent.h>
-#include <ossim/base/ossimListener.h>
-
-RTTI_DEF(ossimListenerManager, "ossimListenerManager");
-
-ossimListenerManager::ossimListenerManager()
-{
-   theFireEventFlag = false;
-}
-
-ossimListenerManager::ossimListenerManager(const ossimListenerManager& /* rhs */)
-{
-//    replaceListeners(rhs.getListeners());
-}
-
-ossimListenerManager::~ossimListenerManager()
-{
-   theListenerList.clear();
-}
-
-void ossimListenerManager::fireEvent(ossimEvent& event)
-{
-   // only process the event if it has not been consumed.
-   event.setCurrentObject(PTR_CAST(ossimObject, this));
-   if(event.isConsumed())
-   {
-      return;
-   }
-   theFireEventFlag = true;
-
-   std::list<ossimListener*>::iterator currentIterator = theListenerList.begin();
-   
-   while(currentIterator != theListenerList.end())
-   {
-      // only fire if the event is not consumed
-      if(!event.isConsumed())
-      {
-         if(*currentIterator)
-         {
-            if(theDelayedRemove.end()==std::find(theDelayedRemove.begin(),
-                                                 theDelayedRemove.end(),
-                                                 (*currentIterator)))
-            {
-               if((*currentIterator)->isListenerEnabled())
-               {
-                  (*currentIterator)->processEvent(event);
-               }
-            }
-         }
-      }
-      else
-      {
-         // the event is now consumed so stop propagating.
-         //
-         theFireEventFlag = false;
-         break;
-      }
-      ++currentIterator;
-   }
-   
-   theFireEventFlag = false;
-   
-   if(theDelayedAdd.size())
-   {
-      for(std::list<ossimListener*>::iterator current = theDelayedAdd.begin();
-          current != theDelayedAdd.end();++current)
-      {
-         addListener(*current);
-      }
-      theDelayedAdd.clear();
-   }
-   
-   if(theDelayedRemove.size())
-   {
-      for(std::list<ossimListener*>::iterator current = theDelayedRemove.begin();
-          current != theDelayedRemove.end();++current)
-      {
-         removeListener(*current);
-      }
-      theDelayedRemove.clear();
-   }
-}
-
-bool ossimListenerManager::addListener(ossimListener* listener)
-{
-   if(theFireEventFlag)
-   {
-      theDelayedAdd.push_back(listener);
-   }
-   else
-   {
-      
-      if(!findListener(listener))
-      {
-         theListenerList.push_back(listener);
-      }
-   }
-   
-   return true;
-}
-
-bool ossimListenerManager::removeListener(ossimListener* listener)
-{
-   
-   if(theFireEventFlag)
-   {
-      theDelayedRemove.push_back(listener);
-      return true;
-   }
-   
-   std::list<ossimListener*>::iterator current=theListenerList.begin();
-   while(current!=theListenerList.end())
-   {
-      if( (*current) == listener)
-      {
-         current = theListenerList.erase(current);
-         break; // Should only be in list once... (drb)
-      }
-      else
-      {
-         ++current;
-      }
-   }
-   
-   return true;
-}
-
-bool ossimListenerManager::findListener(ossimListener* listener)
-{
-   bool result = false;
-
-   if(listener)
-   {
-      std::list<ossimListener*>::iterator currentIter =
-         std::find(theListenerList.begin(),
-                   theListenerList.end(),
-                   listener);
-      result = (currentIter != theListenerList.end());
-   }
-   
-   return result;
-}
diff --git a/ossim/src/ossim/base/ossimMatrixProperty.cpp b/ossim/src/ossim/base/ossimMatrixProperty.cpp
deleted file mode 100644
index c873a4c..0000000
--- a/ossim/src/ossim/base/ossimMatrixProperty.cpp
+++ /dev/null
@@ -1,317 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-//*************************************************************************
-// $Id: ossimMatrixProperty.cpp 17074 2010-04-14 18:49:11Z dburken $
-#include <sstream>
-#include <ossim/base/ossimMatrixProperty.h>
-#include <ossim/base/ossimCommon.h>
-
-RTTI_DEF1(ossimMatrixProperty, "ossimMatrixProperty", ossimProperty);
-
-ossimMatrixProperty::ossimMatrixProperty(const ossimString& name,
-                                         const std::vector<double>& values,
-                                         int numberOfRows,
-                                         int numberOfCols)
-   :ossimProperty(name),
-    theMinNumberOfCols(-1),
-    theMaxNumberOfCols(-1),
-    theMinNumberOfRows(-1),
-    theMaxNumberOfRows(-1)
-{
-   resize(numberOfRows, numberOfCols);
-
-   if((int)values.size() == numberOfRows*numberOfCols)
-   {
-      int rowIdx = 0;
-      int colIdx = 0;
-      int linearIdx = 0;
-      for(rowIdx = 0; rowIdx < getNumberOfRows(); ++rowIdx)
-      {
-         for(colIdx = 0; colIdx < getNumberOfCols(); ++colIdx)
-         {
-            theValueArray[rowIdx][colIdx] = values[linearIdx];
-            ++linearIdx;
-         }
-      }
-   }
-}
-
-
-ossimMatrixProperty::ossimMatrixProperty(const ossimMatrixProperty& rhs)
-   :ossimProperty(rhs),
-    theValueArray(rhs.theValueArray),
-    theMinNumberOfCols(rhs.theMinNumberOfCols),
-    theMaxNumberOfCols(rhs.theMaxNumberOfCols),
-    theMinNumberOfRows(rhs.theMaxNumberOfCols),
-    theMaxNumberOfRows(rhs.theMaxNumberOfRows)
-{
-}
-
-ossimMatrixProperty::~ossimMatrixProperty()
-{
-   
-}
-
-ossimObject* ossimMatrixProperty::dup()const
-{
-   return new ossimMatrixProperty(*this);
-}
-
-
-const ossimProperty& ossimMatrixProperty::assign(const ossimProperty& rhs)
-{
-   ossimMatrixProperty* rhsPtr = PTR_CAST(ossimMatrixProperty,
-                                          &rhs);
-   if(rhsPtr)
-   {
-      theValueArray      = rhsPtr->theValueArray;
-      theMinNumberOfCols = rhsPtr->theMinNumberOfCols;
-      theMaxNumberOfCols = rhsPtr->theMaxNumberOfCols;
-      theMinNumberOfRows = rhsPtr->theMinNumberOfRows;
-      theMaxNumberOfRows = rhsPtr->theMaxNumberOfRows;
-   }
-
-   return ossimProperty::assign(rhs);
-}
-
-bool ossimMatrixProperty::setValue(const ossimString& value)
-{
-   std::istringstream in(value);
-   
-   ossimString numberOfRows;
-   ossimString numberOfCols;
-   ossimString tempValue;
-   
-   in>>numberOfRows >> numberOfCols;
-
-   if(!in.bad())
-   {
-      resize(numberOfRows.toInt32(), numberOfCols.toInt32());
-
-      int rowIdx = 0;
-      int colIdx = 0;
-      for(rowIdx = 0; ((rowIdx < getNumberOfRows())&&(!in.bad())); ++rowIdx)
-      {
-         for(colIdx = 0; ((colIdx < getNumberOfCols())&&(!in.bad()));++ colIdx)
-         {
-            in >> tempValue;
-            
-            theValueArray[rowIdx][colIdx] = tempValue.toDouble();
-         }
-      }
-   }
-
-   return !in.bad();
-}
-
-void ossimMatrixProperty::valueToString(ossimString& valueResult)const
-{
-   if(theValueArray.size()>0)
-   {
-      if(theValueArray[0].size() > 0)
-      {
-         valueResult = "";
-         
-         int rowIdx = 0;
-         int colIdx = 0;
-         valueResult += ossimString::toString(getNumberOfRows()) + " " +
-                        ossimString::toString(getNumberOfCols()) + " ";
-         for(rowIdx = 0; rowIdx < getNumberOfRows();++rowIdx)
-         {
-            for(colIdx = 0; colIdx < getNumberOfCols(); ++colIdx)
-            {
-               valueResult += ossimString::toString(theValueArray[rowIdx][colIdx]);
-               valueResult += " ";
-            }
-         }
-      }
-   }
-}
-
-void ossimMatrixProperty::resize(int numberOfRows,
-                                 int numberOfCols)
-{
-   int tempNumberOfRows = numberOfRows;
-   int tempNumberOfCols = numberOfCols;
-
-   if(theMinNumberOfCols > 0)
-   {
-      if(tempNumberOfCols < theMinNumberOfCols)
-      {
-         tempNumberOfCols = theMinNumberOfCols;
-      }
-   }
-   if(theMinNumberOfRows > 0)
-   {
-      if(tempNumberOfRows < theMinNumberOfRows)
-      {
-         tempNumberOfRows = theMinNumberOfRows;
-      }
-   }
-   if(theMaxNumberOfCols > 0)
-   {
-      if(tempNumberOfCols > theMaxNumberOfCols)
-      {
-         tempNumberOfCols = theMaxNumberOfCols;
-      }
-   }
-   if(theMaxNumberOfRows > 0)
-   {
-      if(tempNumberOfRows > theMaxNumberOfRows)
-      {
-         tempNumberOfRows = theMaxNumberOfRows;
-      }
-   }
-
-   int currentNumberOfRows = getNumberOfRows();
-   int currentNumberOfCols = getNumberOfCols();
-   
-   if((currentNumberOfRows != tempNumberOfRows) ||
-      (currentNumberOfCols != tempNumberOfCols))
-   {
-      std::vector< std::vector<double> > tempValue = theValueArray;
-      
-      theValueArray.resize(tempNumberOfRows);
-
-      int minCols = ossim::min((int)currentNumberOfCols,
-                             (int)tempNumberOfCols);
-      int rowIdx = 0;
-      int colIdx = 0;
-      
-      for(rowIdx = 0 ; rowIdx < tempNumberOfRows; ++rowIdx)
-      {
-         theValueArray[rowIdx].resize(tempNumberOfCols);
-         std::fill(theValueArray[rowIdx].begin(), theValueArray[rowIdx].end(), 0);
-
-         if(tempNumberOfRows < currentNumberOfRows)
-         {
-            for(colIdx = 0 ; colIdx < minCols; ++colIdx)
-            {
-               theValueArray[rowIdx][colIdx] = tempValue[rowIdx][colIdx];
-            }
-         }
-      }
-   }
-}
-
-double& ossimMatrixProperty::operator()(int rowIdx,
-                                        int colIdx)
-{
-   return theValueArray[rowIdx][colIdx];
-}
-
-const double& ossimMatrixProperty::operator()(int rowIdx,
-                                              int colIdx)const
-{
-   return theValueArray[rowIdx][colIdx];
-}
-
-int ossimMatrixProperty::getNumberOfRows()const
-{
-   return (int)theValueArray.size();
-}
-
-int ossimMatrixProperty::getNumberOfCols()const
-{
-   if(getNumberOfRows())
-   {
-      return (int)theValueArray[0].size();
-   }
-
-   return 0;
-}
-
-void ossimMatrixProperty::clearConstraints()
-{
-   theMinNumberOfCols = -1;
-   theMaxNumberOfCols = -1;
-   theMinNumberOfRows = -1;
-   theMaxNumberOfRows = -1;
-}
-
-void ossimMatrixProperty::setColConstraints(int minNumberOfCols,
-                                            int maxNumberOfCols)
-{
-   theMinNumberOfCols = minNumberOfCols;
-   theMaxNumberOfCols = maxNumberOfCols;
-}
-
-void ossimMatrixProperty::setRowConstraints(int minNumberOfRows,
-                                            int maxNumberOfRows)
-{
-   theMinNumberOfRows = minNumberOfRows;
-   theMaxNumberOfRows = maxNumberOfRows;
-}
-
-void ossimMatrixProperty::getColConstraints(int& minNumberOfCols,
-                                            int& maxNumberOfCols) const
-{
-   minNumberOfCols = theMinNumberOfCols;
-   maxNumberOfCols = theMaxNumberOfCols;
-}
-
-void ossimMatrixProperty::getRowConstraints(int& minNumberOfRows,
-                                            int& maxNumberOfRows) const
-{
-   minNumberOfRows = theMinNumberOfRows;
-   maxNumberOfRows = theMaxNumberOfRows;
-}
-
-void ossimMatrixProperty::normalize()
-{
-   double densityValue = density();
-
-   if(fabs(densityValue) <= DBL_EPSILON)
-   {
-      return;
-   }
-   int rowIdx = 0;
-   int colIdx = 0;
-   for(rowIdx = 0 ; rowIdx < (int)theValueArray.size(); ++rowIdx)
-   {
-      for(colIdx = 0 ; colIdx < (int)theValueArray[rowIdx].size(); ++colIdx)
-      {
-         theValueArray[rowIdx][colIdx]/=densityValue;
-      }
-   }
-   
-}
-
-void ossimMatrixProperty::zero()
-{
-   int rowIdx = 0;
-   int colIdx = 0;
-   for(rowIdx = 0 ; rowIdx < (int)theValueArray.size(); ++rowIdx)
-   {
-      for(colIdx = 0 ; colIdx < (int)theValueArray[rowIdx].size(); ++colIdx)
-      {
-         theValueArray[rowIdx][colIdx] = 0.0;
-      }
-   }
-}
-
-double ossimMatrixProperty::density()const
-{
-   double result = 0.0;
-
-   if((getNumberOfRows() > 0)&&
-      (getNumberOfCols() > 0))
-   {
-      int rowIdx = 0;
-      int colIdx = 0;
-      
-      for(rowIdx = 0 ; rowIdx < (int)theValueArray.size(); ++rowIdx)
-      {
-         for(colIdx = 0 ; colIdx < (int)theValueArray[rowIdx].size(); ++colIdx)
-         {
-            result += theValueArray[rowIdx][colIdx];
-         }
-      }
-   }
-
-   return result;
-}
diff --git a/ossim/src/ossim/base/ossimMouseListener.cpp b/ossim/src/ossim/base/ossimMouseListener.cpp
deleted file mode 100644
index 5471e64..0000000
--- a/ossim/src/ossim/base/ossimMouseListener.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks)
-//
-//*************************************************************************
-// $Id: ossimMouseListener.cpp 9963 2006-11-28 21:11:01Z gpotts $
-
-#include <ossim/base/ossimMouseListener.h>
-#include <ossim/base/ossimMouseEvent.h>
-
-RTTI_DEF1(ossimMouseListener,"ossimMouseListener",ossimListener);
-
-void ossimMouseListener::processEvent(ossimEvent& event)
-{
-   ossimMouseEvent* mEvent = PTR_CAST(ossimMouseEvent, &event);
-
-   if(mEvent)
-   {
-      mouseEvent(*mEvent);
-   }
-   else
-   {
-      ossimListener::processEvent(event);
-   }
-//    switch(event.getId())
-//    {
-//    case OSSIM_MOUSE_EVENT_ID:
-//    {
-//        = static_cast<ossimMouseEvent*>(&event);
-//       mouseEvent(*mEvent);
-//       break;
-//    }
-//    default:
-//    {
-//       ossimListener::processEvent(event);
-//    }
-//    }
-}
diff --git a/ossim/src/ossim/base/ossimMultiBandHistogram.cpp b/ossim/src/ossim/base/ossimMultiBandHistogram.cpp
deleted file mode 100644
index e260621..0000000
--- a/ossim/src/ossim/base/ossimMultiBandHistogram.cpp
+++ /dev/null
@@ -1,508 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts
-//
-// Description: 
-//
-//*******************************************************************
-//  $Id: ossimMultiBandHistogram.cpp 21631 2012-09-06 18:10:55Z dburken $
-
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <fstream>
-
-ossimMultiBandHistogram::ossimMultiBandHistogram()
-{  
-}
-
-ossimMultiBandHistogram::~ossimMultiBandHistogram()
-{
-   deleteHistograms();
-}
-
-ossimMultiBandHistogram::ossimMultiBandHistogram(const ossimMultiBandHistogram& rhs)
-{
-   theHistogramList.resize(rhs.theHistogramList.size());
-
-   for(ossim_uint32 i = 0; i < theHistogramList.size(); ++i)
-   {
-      theHistogramList[i] =  rhs.theHistogramList[i].valid()?
-         new ossimHistogram(*rhs.theHistogramList[i].get()):(ossimHistogram*)0;
-   }
-}
-
-ossimMultiBandHistogram::ossimMultiBandHistogram(ossim_int32 numberOfBands,
-                                                 ossim_int32 numberOfBuckets,
-                                                 float minValue,
-                                                 float maxValue)
-{
-   if(numberOfBands > 0)
-   {
-      create(numberOfBands, numberOfBuckets, minValue, maxValue);
-   }
-}
-
-void ossimMultiBandHistogram::create(const ossimImageSource* input)
-{
-   if (input)
-   {
-      ossim_uint32 bands = input->getNumberOfOutputBands();;
-      ossim_uint32 numberOfBins = 0;
-      ossim_float64 minValue = 0.0;
-      ossim_float64 maxValue = 0.0;
-      
-      switch(input->getOutputScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            minValue     = 0;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_UCHAR;
-            numberOfBins = 256;
-            break;
-         }
-         case OSSIM_USHORT11:
-         {
-            minValue     = 0;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT11;
-            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT11 + 1;
-            break;
-         }
-         case OSSIM_UINT16:
-         case OSSIM_UINT32:
-         {
-            minValue     = 0;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT16;
-            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16 + 1;
-            break;
-         }
-         case OSSIM_SINT16:
-         case OSSIM_SINT32:
-         case OSSIM_FLOAT32:
-         case OSSIM_FLOAT64:
-         {
-            minValue     = OSSIM_DEFAULT_MIN_PIX_SINT16;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_SINT16;
-            numberOfBins = (OSSIM_DEFAULT_MAX_PIX_SINT16-OSSIM_DEFAULT_MIN_PIX_SINT16) + 1;
-            break;
-         }
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            minValue     = 0;
-            maxValue     = 1.0;
-            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
-            break;
-         }
-         default:
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Unsupported scalar type in ossimMultiBandHistogram::create()"
-               << std::endl;
-            return;
-         }
-         
-      }  // switch(input->getOutputScalarType())
-
-      create(bands, numberOfBins, minValue, maxValue);
-      
-   } // if (input)
-}
-
-void ossimMultiBandHistogram::create(ossim_int32 numberOfBands,
-                                     ossim_int32 numberOfBuckets,
-                                     float minValue,
-                                     float maxValue)
-{
-   // make sure we clear our internal lists before
-   // we start.
-   //
-   deleteHistograms();
-
-   if(numberOfBands > 0)
-   {
-      numberOfBuckets = numberOfBuckets>0?numberOfBuckets:1;
-
-      for(ossim_int32 bands = 0; bands < numberOfBands; ++bands)
-      {
-         theHistogramList.push_back(new ossimHistogram(numberOfBuckets,
-                                                       minValue,
-                                                       maxValue));
-      }
-   }
-}
-
-void ossimMultiBandHistogram::create(ossim_int32 numberOfBands)
-{
-   deleteHistograms();
-   for(ossim_int32 bands = 0; bands < numberOfBands; ++bands)
-   {
-      theHistogramList.push_back(new ossimHistogram);
-   }
-}
-
-ossim_uint32 ossimMultiBandHistogram::getNumberOfBands() const
-{
-   return (ossim_uint32)theHistogramList.size();
-}
-
-ossimRefPtr<ossimHistogram> ossimMultiBandHistogram::getHistogram(ossim_int32 band)
-{
-   if((band >=0) && (band < (ossim_int32)theHistogramList.size()))
-   {
-      return theHistogramList[band];
-   }
-
-   return NULL;
-}
-
-const ossimRefPtr<ossimHistogram> ossimMultiBandHistogram::getHistogram(ossim_int32 band)const
-{
-   if((band >=0) && (band < (ossim_int32)theHistogramList.size()))
-   {
-      return theHistogramList[band];
-   }
-
-   return 0;
-}
-
-void ossimMultiBandHistogram::setBinCount(double binNumber, double count)
-{
-   if(theHistogramList.size() > 0)
-   {
-      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
-      {
-         if(theHistogramList[idx].valid())
-         {
-            theHistogramList[idx]->SetCount(binNumber, count);
-         }
-      }
-   }   
-}
-
-ossimRefPtr<ossimMultiBandHistogram> ossimMultiBandHistogram::createAccumulationLessThanEqual()const
-{
-   ossimRefPtr<ossimMultiBandHistogram> result = NULL;
-
-   if(theHistogramList.size() > 0)
-   {
-      result = new ossimMultiBandHistogram;
-      result->theHistogramList.resize(theHistogramList.size());
-      
-      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
-      {
-         if(theHistogramList[idx].valid())
-         {
-            result->theHistogramList[idx] = theHistogramList[idx]->CumulativeLessThanEqual();
-         }
-         else
-         {
-            result->theHistogramList[idx] = 0;
-         }     
-      }
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimMultiBandHistogram> ossimMultiBandHistogram::createAccumulationGreaterThanEqual()const
-{
-   ossimRefPtr<ossimMultiBandHistogram> result = NULL;
-
-   if(theHistogramList.size() > 0)
-   {
-      result = new ossimMultiBandHistogram;
-      
-      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
-      {
-         if(theHistogramList[idx].valid())
-         {
-            result->theHistogramList[idx] = theHistogramList[idx]->CumulativeGreaterThanEqual();
-         }
-         else
-         {
-            result->theHistogramList[idx] = 0;
-         }     
-      }
-   }
-
-   return result;
-}
-
-void ossimMultiBandHistogram::deleteHistograms()
-{
-   theHistogramList.clear();
-}
-
-
-bool ossimMultiBandHistogram::importHistogram(std::istream& in)
-{
-   ossimProprietaryHeaderInformation header;
-   deleteHistograms();
-   
-   if(header.parseStream(in))
-   {
-      ossim_int32 numberOfBands = header.getNumberOfBands();
-      
-      if(numberOfBands)
-      {
-         theHistogramList.resize(numberOfBands);
-
-         for(ossim_int32 counter = 0; counter < (ossim_int32)theHistogramList.size(); ++counter)
-         {
-            theHistogramList[counter] = 0;
-         }
-         ossimString bandBuffer;
-         ossimString buffer;
-         
-         for(ossim_int32 idx = 0; idx < numberOfBands; ++idx)
-         {
-            getline(in, buffer);
-            if(buffer.find("Band") != string::npos)
-            {
-				string::size_type offset = buffer.find(":");
-               if(offset != string::npos)
-               {
-                  bandBuffer = buffer.substr(offset+1);
-               }
-               else
-               {
-                  deleteHistograms();
-                  return false;
-               }
-            }
-            else
-            {
-               deleteHistograms();
-               return false;
-            }
-            ossim_uint32 bandIdx = bandBuffer.toUInt32();
-
-            if(bandIdx < theHistogramList.size())
-            {
-               if(!theHistogramList[bandIdx].valid())
-               {
-                  ossimRefPtr<ossimHistogram> histogram = new ossimHistogram;
-                  if(histogram->importHistogram(in))
-                  {
-                     theHistogramList[bandIdx] = histogram;
-                  }
-                  else
-                  {
-                     deleteHistograms();
-                     return false;
-                  }
-               }
-            }
-            else
-            {
-               deleteHistograms();
-               return false;
-            }
-         }
-      }
-      else
-      {
-         return false;
-      }
-   }  
-   return true;
-}
-
-bool ossimMultiBandHistogram::importHistogram(const ossimFilename& file)
-{
-   if(file.exists())
-   {
-      std::ifstream input(file.c_str());
-
-      return importHistogram(input);
-   }
-
-   return false;
-}
-
-bool ossimMultiBandHistogram::ossimProprietaryHeaderInformation::parseStream(std::istream& in)
-{
-   ossimString inputLine;
-
-   getline(in, inputLine);  
-   if(inputLine.find("File Type") != string::npos)
-   {
-      std::string::size_type idx = inputLine.find(":");
-      if(idx != string::npos)
-      {
-         theFileType = inputLine.substr(idx+1);
-         theFileType = theFileType.trim();
-      }
-      else
-      {
-         return false;
-      }
-
-   }
-   else
-   {
-      return false;
-   }
-
-   getline(in, inputLine);  
-   if(inputLine.find("Version") != string::npos)
-   {
-      std::string::size_type idx = inputLine.find(":");
-      if(idx != string::npos)
-      {
-         theVersion = inputLine.substr(idx+1);
-         theVersion = theVersion.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-
-   getline(in, inputLine);  
-   if(inputLine.find("Number of Bands") != string::npos)
-   {
-      std::string::size_type idx = inputLine.find(":");
-      if(idx != string::npos)
-      {
-         theNumberOfBands = inputLine.substr(idx+1);
-         theNumberOfBands = theNumberOfBands.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-   
-   return true;
-}
-
-ossim_uint32 ossimMultiBandHistogram::ossimProprietaryHeaderInformation::getNumberOfBands() const
-{
-   return theNumberOfBands.toUInt32();
-}
-
-void ossimMultiBandHistogram::ossimProprietaryHeaderInformation::clear()
-{
-   theFileType      = "";
-   theVersion       = "";
-   theNumberOfBands = "";
-}
-
-bool ossimMultiBandHistogram::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)const
-{
-   kwl.add(prefix,
-           "type",
-           "ossimMultiBandHistogram",
-           true);
-   kwl.add(prefix,
-           "number_of_bands",
-           static_cast<ossim_uint32>(theHistogramList.size()),
-           true);
-   
-   for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
-   {
-      ossimString band = ossimString(prefix) + "band";
-      band += (ossimString::toString(idx) + ".");
-      if(theHistogramList[idx].valid())
-      {
-         ossimString newPrefix = (ossimString(prefix) + ossimString::toString(idx) + ".");
-         
-         theHistogramList[idx]->saveState(kwl, band.c_str());
-      }
-   }
-   
-   return true;
-}
-
-bool ossimMultiBandHistogram::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   deleteHistograms();
-   const char* number_of_bands = kwl.find(prefix, "number_of_bands");
-   if(number_of_bands)
-   {
-      ossim_uint32 numberOfBands = ossimString(number_of_bands).toUInt32();
-
-      if(numberOfBands>0)
-      {
-         ossimString newPrefix;
-         for(ossim_uint32 idx = 0; idx < numberOfBands; ++idx)
-         {
-            ossimHistogram* histo = new ossimHistogram;
-
-            newPrefix = prefix;
-            newPrefix += "band";
-            newPrefix += ossimString::toString(idx);
-            newPrefix += ".";
-            
-            histo->loadState(kwl, newPrefix.c_str());
-            
-            theHistogramList.push_back(histo);
-         }
-      }
-   }
-   
-   return true;
-}
-
-bool ossimMultiBandHistogram::saveState(ossimRefPtr<ossimXmlNode> xmlNode)const
-{
-   xmlNode->setTag("ossimMutliBandHistogram");
-   for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
-   {
-      ossimRefPtr<ossimXmlNode> band = new ossimXmlNode;
-      ossimRefPtr<ossimXmlNode> newNode = new ossimXmlNode;
-
-      band->setTag("Band");
-      band->addAttribute("idx", ossimString::toString(idx));
-      band->addChildNode(newNode.get());
-      if(theHistogramList[idx].valid())
-      {         
-         theHistogramList[idx]->saveState(newNode);
-      }
-      else
-      {
-         newNode->setTag("ossimHistogram");
-      }
-      xmlNode->addChildNode(band.get());
-   }
-
-   return true;
-}
-
-bool ossimMultiBandHistogram::loadState(const ossimRefPtr<ossimXmlNode> xmlNode)
-{
-   theHistogramList.clear();
-   const vector<ossimRefPtr<ossimXmlNode> >& childNodes = xmlNode->getChildNodes();
-
-   ossim_uint32 idx = 0;
-   ossim_uint32 maxCount = (ossim_uint32)childNodes.size();
-   for(idx = 0; idx < maxCount; ++idx)
-   {
-      if(childNodes[idx]->getTag() == "Band")
-      {
-         if(childNodes[idx]->getChildNodes().size())
-         {
-            ossimRefPtr<ossimHistogram> histo = new ossimHistogram;
-            histo->loadState(childNodes[idx]->getChildNodes()[0]);
-            theHistogramList.push_back(histo);
-         }
-      }
-   }
-
-   return true;
-}
diff --git a/ossim/src/ossim/base/ossimMultiResLevelHistogram.cpp b/ossim/src/ossim/base/ossimMultiResLevelHistogram.cpp
deleted file mode 100644
index 2f5911d..0000000
--- a/ossim/src/ossim/base/ossimMultiResLevelHistogram.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts
-//
-// Description: 
-//
-//*******************************************************************
-//  $Id: ossimMultiResLevelHistogram.cpp 20610 2012-02-27 12:19:25Z gpotts $
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimKeyword.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <fstream>
-using namespace std;
-
-static const ossimKeyword NUMBER_OF_RES_LEVELS("number_of_res_levels",
-                                               "");
-
-ossimMultiResLevelHistogram::ossimMultiResLevelHistogram()
-   :
-      theHistogramList(),
-      theHistogramFile()
-{  
-}
-
-ossimMultiResLevelHistogram::ossimMultiResLevelHistogram(ossim_uint32 numberOfResLevels)
-   :
-      theHistogramList(),
-      theHistogramFile()
-{
-   create(numberOfResLevels);
-}
-
-ossimMultiResLevelHistogram::ossimMultiResLevelHistogram(const ossimMultiResLevelHistogram& rhs)
-   :
-      theHistogramList(),
-      theHistogramFile()
-{
-   
-   create(rhs.getNumberOfResLevels());
-   for(ossim_uint32 i = 0; i < theHistogramList.size(); ++i)
-   {
-      theHistogramList[i] = rhs.theHistogramList[i].valid()?
-                            new ossimMultiBandHistogram(*rhs.theHistogramList[i]):
-                            (ossimMultiBandHistogram*)NULL;
-   }
-}
-
-ossimMultiResLevelHistogram::~ossimMultiResLevelHistogram()
-{
-   deleteHistograms();
-}
-
-void ossimMultiResLevelHistogram::create(ossim_uint32 numberOfResLevels)
-{
-   deleteHistograms();
-
-   for(ossim_uint32 idx = 0; idx < numberOfResLevels; ++idx)
-   {
-      theHistogramList.push_back(new ossimMultiBandHistogram);      
-   }
-}
-
-ossimRefPtr<ossimMultiResLevelHistogram> ossimMultiResLevelHistogram::createAccumulationLessThanEqual()const
-{
-   ossimRefPtr<ossimMultiResLevelHistogram> result = 0;
-
-   if(theHistogramList.size() > 0)
-   {
-      result = new ossimMultiResLevelHistogram((ossim_uint32)theHistogramList.size());
-
-      for(ossim_uint32 idx=0; idx < (ossim_uint32) theHistogramList.size(); ++ idx)
-      {
-         if(theHistogramList[idx].valid())
-         {
-            ossimRefPtr<ossimMultiBandHistogram> multiBandAccumulator = theHistogramList[idx]->createAccumulationLessThanEqual();
-            result->theHistogramList[idx] = multiBandAccumulator;
-         }
-         else
-         {
-            // we will push on a null since someone could
-            // turn off a band.  A null accumulation will
-            // indicate no histogram data.
-            //
-            result->theHistogramList[idx] = 0;
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimMultiResLevelHistogram::setBinCount(double binNumber, double count)
-{
-   if(theHistogramList.size() > 0)
-   {
-      for(ossim_uint32 idx=0; idx < (ossim_uint32) theHistogramList.size(); ++ idx)
-      {
-         if(theHistogramList[idx].valid())
-         {
-            theHistogramList[idx]->setBinCount(binNumber, count);
-         }
-      }
-   }   
-}
-
-ossimRefPtr<ossimMultiResLevelHistogram> ossimMultiResLevelHistogram::createAccumulationGreaterThanEqual()const
-{
-   ossimRefPtr<ossimMultiResLevelHistogram> result = NULL;
-
-   if(theHistogramList.size() > 0)
-   {
-      result = new ossimMultiResLevelHistogram((ossim_uint32)theHistogramList.size());
-
-      for(ossim_uint32 idx=0; idx < (ossim_uint32) theHistogramList.size(); ++ idx)
-      {
-         if(theHistogramList[idx].valid())
-         {
-            ossimRefPtr<ossimMultiBandHistogram> multiBandAccumulator = theHistogramList[idx]->createAccumulationGreaterThanEqual();
-            result->theHistogramList[idx]=multiBandAccumulator;
-         }
-         else
-         {
-            // we will push on a null since someone could
-            // turn off a band.  A null accumulation will
-            // indicate no histogram data.
-            //
-            result->theHistogramList[idx] = 0;
-         }
-      }
-      result = 0;
-   }
-   
-   return result;
-}
-
-void ossimMultiResLevelHistogram::addHistogram(ossimMultiBandHistogram* histo)
-{
-   theHistogramList.push_back(histo);
-}
-
-ossimRefPtr<ossimMultiBandHistogram> ossimMultiResLevelHistogram::addHistogram()
-{
-   ossimRefPtr<ossimMultiBandHistogram> result = new ossimMultiBandHistogram;
-   theHistogramList.push_back(result);
-   return result;
-}
-
-bool ossimMultiResLevelHistogram::setHistogram(ossimRefPtr<ossimMultiBandHistogram> histo, 
-                                               ossim_uint32 resLevel)
-{
-   if(resLevel < getNumberOfResLevels())
-   {
-      theHistogramList[resLevel] = histo;
-      return true;
-   }
-   return false;
-}
-
-void ossimMultiResLevelHistogram::deleteHistograms()
-{
-   for(ossim_uint32 idx = 0; idx < (ossim_uint32)theHistogramList.size(); ++idx)
-   {
-      if(theHistogramList[idx].valid())
-      {
-         theHistogramList[idx] = NULL;
-      }
-   }
-   
-   theHistogramList.clear();
-}
-
-ossimRefPtr<ossimHistogram> ossimMultiResLevelHistogram::getHistogram(ossim_uint32 band,
-                                                          ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimMultiBandHistogram> temp = getMultiBandHistogram(resLevel);
-
-   if(temp.valid())
-   {
-      return temp->getHistogram(band);
-   }
-   
-   return (ossimHistogram*)0;
-}
-const ossimRefPtr<ossimHistogram> ossimMultiResLevelHistogram::getHistogram(ossim_uint32 band,
-                                                                            ossim_uint32 resLevel)const
-{
-   const ossimRefPtr<ossimMultiBandHistogram> temp = getMultiBandHistogram(resLevel);
-
-   if(temp.valid())
-   {
-      return temp->getHistogram(band);
-   }
-   
-   return (ossimHistogram*)0;
-}
-
-ossim_uint32 ossimMultiResLevelHistogram::getNumberOfResLevels()const
-{
-   return (ossim_uint32)theHistogramList.size();
-}
-
-ossim_uint32 ossimMultiResLevelHistogram::getNumberOfBands(ossim_uint32 resLevel) const
-{
-   const ossimRefPtr<ossimMultiBandHistogram> h = getMultiBandHistogram(resLevel);
-   if (h.valid())
-   {
-      return h->getNumberOfBands();
-   }
-
-   return 0;
-}  
-
-ossimRefPtr<ossimMultiBandHistogram> ossimMultiResLevelHistogram::getMultiBandHistogram(ossim_uint32 resLevel) const
-{
-   if(resLevel < (ossim_uint32)theHistogramList.size())
-   {
-      return theHistogramList[resLevel];
-   }
-
-   return NULL;
-}
-
-bool ossimMultiResLevelHistogram::importHistogram(std::istream& in)
-{
-   if (!in) // Check stream state.
-   {
-      return false;
-   }
-   
-   ossimString buffer;
-   getline(in, buffer);
-
-   if ( in.eof() ) // Zero byte files will hit here.
-   {
-      return false;
-   }
-
-   // check to see if it is a proprietary histogram file
-   // 
-   if((buffer =="") || (buffer.c_str()[0] != 'F' ||
-      buffer.c_str()[1] != 'i'))
-   {
-      in.seekg(0, ios::beg);
-      ossimKeywordlist kwl;
-      if (kwl.parseStream(in) == true)
-      {
-         return loadState(kwl);
-      }
-      else
-      {
-         return false;
-      }
-   }
-   
-   ossimProprietaryHeaderInformation header;
-   in.seekg(0, ios::beg);
-   deleteHistograms();
-   if(header.parseStream(in))
-   {
-      ossim_uint32 numberOfResLevels = header.getNumberOfResLevels();
-      
-      if(numberOfResLevels)
-      {
-         theHistogramList.resize(numberOfResLevels);
-
-         for(ossim_uint32 counter = 0; counter < (ossim_uint32)theHistogramList.size(); ++counter)
-         {
-            theHistogramList[counter] = NULL;
-         }
-         ossimString reslevelBuffer;
-         ossimString buffer;
-         
-         for(ossim_uint32 idx = 0; idx < numberOfResLevels; ++idx)
-         {
-            getline(in, buffer);
-            if(buffer.find("RR Level") != string::npos)
-            {
-               std::string::size_type offset = buffer.find(":");
-               if(offset != string::npos)
-               {
-                  reslevelBuffer = buffer.substr(offset+1);
-               }
-               else
-               {
-                  deleteHistograms();
-                  return false;
-               }
-            }
-            else
-            {
-               deleteHistograms();
-               return false;
-            }
-            ossim_uint32 resLevelIdx = reslevelBuffer.toUInt32();
-
-            if(resLevelIdx < (ossim_uint32)theHistogramList.size())
-            {
-               if(!theHistogramList[resLevelIdx])
-               {
-                  ossimRefPtr<ossimMultiBandHistogram> histogram = new ossimMultiBandHistogram;
-                  if(histogram->importHistogram(in))
-                  {
-                     theHistogramList[resLevelIdx] = histogram;
-                  }
-                  else
-                  {
-                     deleteHistograms();
-                     return false;
-                  }
-               }
-            }
-            else
-            {
-               deleteHistograms();
-               return false;
-            }
-            ossimString skipDot;
-            getline(in, skipDot);
-         }
-      }
-      else
-      {
-         return false;
-      }
-   }  
-
-   return true;
-}
-
-bool ossimMultiResLevelHistogram::importHistogram(const ossimFilename& file)
-{
-   if( file.fileSize() > 0 )
-   {
-      theHistogramFile = file;
-      
-      ifstream input(file.c_str());
-      return importHistogram(input);
-   }
-   return false;
-}
-
-bool ossimMultiResLevelHistogram::ossimProprietaryHeaderInformation::parseStream(std::istream& in)
-{
-   ossimString inputLine;
-
-   getline(in, inputLine);  
-   if(inputLine.find("File Type") != string::npos)
-   {
-      std::string::size_type idx = inputLine.find(":");
-      if(idx != string::npos)
-      {
-         theFileType = inputLine.substr(idx+1);
-         theFileType = theFileType.trim();
-      }
-      else
-      {
-         return false;
-      }
-
-   }
-   else
-   {
-      return false;
-   }
-
-   getline(in, inputLine);  
-   if(inputLine.find("Version") != string::npos)
-   {
-      std::string::size_type idx = inputLine.find(":");
-      if(idx != string::npos)
-      {
-         theVersion = inputLine.substr(idx+1);
-         theVersion = theVersion.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-
-   getline(in, inputLine);  
-   if(inputLine.find("Creator ID") != string::npos)
-   {
-      std::string::size_type idx = inputLine.find(":");
-      if(idx != string::npos)
-      {
-         theCreatorId = inputLine.substr(idx+1);
-         theCreatorId = theCreatorId.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-   
-   getline(in, inputLine);  
-   if(inputLine.find("RR Levels") != string::npos)
-   {
-      std::string::size_type idx = inputLine.find(":");
-      if(idx != string::npos)
-      {
-         theNumberOfResLevels = inputLine.substr(idx+1);
-         theNumberOfResLevels = theNumberOfResLevels.trim();
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-   
-   return true;
-}
-
-bool ossimMultiResLevelHistogram::saveState(ossimKeywordlist& kwl,
-                                            const char* prefix)const
-{
-   bool result = true;
-   if(theHistogramList.size() > 0)
-   {
-      ossimString s1 = prefix;
-      kwl.add(prefix,
-              ossimKeywordNames::TYPE_KW,
-              "ossimMultiResLevelHistogram",
-              true);
-      kwl.add(prefix,
-              NUMBER_OF_RES_LEVELS.key(),
-              static_cast<ossim_uint32>(theHistogramList.size()),
-              true);
-
-      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
-      {
-         ossimString rr_level = ossimString(prefix) + "rr_level";
-         rr_level += ossimString::toString(idx)   + ".";
-         if(theHistogramList[idx].valid())
-         {
-            result = theHistogramList[idx]->saveState(kwl, rr_level.c_str());
-            
-            if(!result)
-            {
-               return result;
-            }
-         }
-      }    
-   }
-
-   return result;
-}
-
-bool ossimMultiResLevelHistogram::loadState(const ossimKeywordlist& kwl,
-                                            const char* prefix)
-{
-   deleteHistograms();
-   const char* number_of_res_levels = kwl.find(prefix, NUMBER_OF_RES_LEVELS.key());
-
-   if(number_of_res_levels)
-   {
-      ossim_uint32 numberOfResLevels = ossimString(number_of_res_levels).toUInt32();
-
-      if(numberOfResLevels)
-      {
-         ossimString newPrefix;
-         for(ossim_uint32 idx = 0; idx < numberOfResLevels; ++idx)
-         {
-            ossimRefPtr<ossimMultiBandHistogram> histo = new ossimMultiBandHistogram;
-
-            if (prefix) newPrefix = prefix;
-            
-            newPrefix += "rr_level";
-            newPrefix += ossimString::toString(idx);
-            newPrefix += ".";
-            
-            histo->loadState(kwl, newPrefix.c_str());
-            
-            theHistogramList.push_back(histo);
-         }
-      }
-   }
-   return true;
-}
-
-ossimFilename ossimMultiResLevelHistogram::getHistogramFile() const
-{
-   return theHistogramFile;
-}
diff --git a/ossim/src/ossim/base/ossimNormRgbVector.cpp b/ossim/src/ossim/base/ossimNormRgbVector.cpp
deleted file mode 100644
index f6e97d7..0000000
--- a/ossim/src/ossim/base/ossimNormRgbVector.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// License: MIT
-// Author: Garrett Potts 
-// Description:
-//
-//*************************************************************************
-// $Id: ossimNormRgbVector.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <ossim/base/ossimNormRgbVector.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/base/ossimJpegYCbCrVector.h>
-#include <ossim/base/ossimHsiVector.h>
-#include <ossim/base/ossimHsvVector.h>
-#include <ossim/base/ossimCmyVector.h>
-#include <ossim/base/ossimCommon.h>
-#include <math.h>
-
-ossimNormRgbVector::ossimNormRgbVector(const ossimRgbVector& rgb)
-{
-   theBuf[0] = rgb.getR()/255.0;
-   theBuf[1] = rgb.getG()/255.0;
-   theBuf[2] = rgb.getB()/255.0;
-}
-
-ossimNormRgbVector::ossimNormRgbVector(const ossimJpegYCbCrVector& YCbCr)
-{
-   (*this) = YCbCr;
-   
-}
-
-ossimNormRgbVector::ossimNormRgbVector(const ossimHsiVector& hsi)
-{
-   (*this)=hsi;
-}
-
-ossimNormRgbVector::ossimNormRgbVector(const ossimHsvVector& hsv)
-{
-   (*this) = hsv;
-}
-
-ossimNormRgbVector::ossimNormRgbVector(const ossimCmyVector& cmy)
-{
-   theBuf[0] = 255 - cmy.getC();
-   theBuf[1] = 255 - cmy.getM();
-   theBuf[2] = 255 - cmy.getY();
-}
-
-const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimHsvVector& hsv)
-{
-   // H is given on [0, 6] or UNDEFINED. S and V are given on [0, 1]. 
-   // RGB are each returned on [0, 1]. 
-   float h = hsv.getH(), // unnormalize it
-         s = hsv.getS(),
-         v = hsv.getV();
-   float m, n, f; 
-   int i; 
-   if(h == ossimHsvVector::OSSIM_HSV_UNDEFINED)
-   {
-      theBuf[0] = clamp(v);
-      theBuf[1] = clamp(v);
-      theBuf[2] = clamp(v);
-   }
-   else
-   {
-      h*=6.0; // unnormalize h
-      i = (int)floor(h); 
-      f = h - i; 
-      if(!(i & 1)) f = 1 - f; // if i is even 
-      m = v * (1 - s); 
-      n = v * (1 - s * f); 
-      switch (i)
-      { 
-      case 6: 
-      case 0:
-      {
-         theBuf[0] = clamp(v);
-         theBuf[1] = clamp(n);
-         theBuf[2] = clamp(m);
-         break;
-      }
-      case 1:
-      {
-         theBuf[0] = clamp(n);
-         theBuf[1] = clamp(v);
-         theBuf[2] = clamp(m);
-         break;
-      }
-      case 2:
-      {
-         theBuf[0] = clamp(m);
-         theBuf[1] = clamp(v);
-         theBuf[2] = clamp(n);
-         break;
-      }
-      case 3: 
-      {
-         theBuf[0] = clamp(m);
-         theBuf[1] = clamp(n);
-         theBuf[2] = clamp(v);
-         break;
-      }
-      case 4:
-      {
-         theBuf[0] = clamp(n);
-         theBuf[1] = clamp(m);
-         theBuf[2] = clamp(v);
-         break;
-      }
-      case 5: 
-      {
-         theBuf[0] = clamp(v);
-         theBuf[1] = clamp(m);
-         theBuf[2] = clamp(n);
-         break;
-      }
-      }
-   }
-   return *this;
-}
-
-const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimJpegYCbCrVector& YCbCr)
-{
-   theBuf[0] = clamp((YCbCr.getY() +
-                      1.402 * (YCbCr.getCr()-128.0))/255.0);
-   theBuf[1] = clamp((YCbCr.getY() -
-                      0.34414 *(YCbCr.getCb()-128.0) -
-                      0.71414*(YCbCr.getCr()-128.0))/255.0);
-   theBuf[2] = clamp((YCbCr.getY() +
-                      1.772 * ( YCbCr.getCb()-128.0))/255.0);
-
-   return *this;
-}
-
-const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimHsiVector& hsi)
-{
-   ossim_float32 h = hsi.getH();
-   ossim_float32 s = hsi.getS();
-   ossim_float32 i = hsi.getI();
-
-   ossim_float32 r=0;
-   ossim_float32 g=0;
-   ossim_float32 b=0;
-   
-   if(h <= 120.0)
-   {
-      b = i*(1-s);
-
-      r = i*(1 + s*cos(RAD_PER_DEG*h)/cos((60-h)*RAD_PER_DEG));
-      g = 3*i - (r+b);
-   }
-    else if(h <= 240.0)
-    {
-       h-=120;
-
-       r = i*(1-s);
-       g = i*(1 + s*cos(RAD_PER_DEG*h)/cos((60-h)*RAD_PER_DEG));
-       b = 3*i - (r+g);
-    }
-    else if(h <= 360.0)
-    {
-       h-=240;
-
-       g = i*(1-s);
-       b = i*(1 + s*cos(RAD_PER_DEG*h)/cos((60-h)*RAD_PER_DEG));
-       r = 3*i - (g+b);      
-    }
-   
-   theBuf[0] = clamp(r);
-   theBuf[1] = clamp(g);
-   theBuf[2] = clamp(b);
-   
-   return *this;
-}
-
-const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimCmyVector& cmy)
-{
-   theBuf[0] = (255 - cmy.getC())/255.0;
-   theBuf[1] = (255 - cmy.getM())/255.0;
-   theBuf[2] = (255 - cmy.getY())/255.0;
-
-   return *this;
-}
diff --git a/ossim/src/ossim/base/ossimNumericProperty.cpp b/ossim/src/ossim/base/ossimNumericProperty.cpp
deleted file mode 100644
index b7ab7b8..0000000
--- a/ossim/src/ossim/base/ossimNumericProperty.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-//
-//*************************************************************************
-// $Id: ossimNumericProperty.cpp 9963 2006-11-28 21:11:01Z gpotts $
-#include <algorithm>
-#include <ossim/base/ossimNumericProperty.h>
-
-
-RTTI_DEF1(ossimNumericProperty, "ossimNumericProperty", ossimProperty);
-
-ossimNumericProperty::ossimNumericProperty(const ossimString& name,
-                                           const ossimString& value)
-   :ossimProperty(name),
-    theValue(value),
-    theType(ossimNumericPropertyType_FLOAT64)
-{
-}
-
-ossimNumericProperty::ossimNumericProperty(const ossimString& name,
-                                           const ossimString& value,
-                                           double minValue,
-                                           double maxValue)
-   :ossimProperty(name),
-    theValue(value),
-    theType(ossimNumericPropertyType_FLOAT64)
-{
-   setConstraints(minValue,
-                  maxValue);
-}
-
-ossimNumericProperty::ossimNumericProperty(const ossimNumericProperty& rhs)
-   :ossimProperty(rhs),
-    theValue(rhs.theValue),
-    theType(rhs.theType),
-    theRangeConstraint(rhs.theRangeConstraint)
-{
-}
-
-ossimObject* ossimNumericProperty::dup()const
-{
-   return new ossimNumericProperty(*this);
-}
-
-const ossimProperty& ossimNumericProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-
-   ossimNumericProperty* numericProperty = PTR_CAST(ossimNumericProperty,
-                                                   &rhs);
-   if(numericProperty)
-   {
-      theValue           = numericProperty->theValue;
-      theType            = numericProperty->theType;
-      theRangeConstraint = numericProperty->theRangeConstraint;
-   }
-   else
-   {
-      ossimString value;
-      rhs.valueToString(value);
-      setValue(value);
-   }
-   return *this;
-}
-
-bool ossimNumericProperty::hasConstraints()const
-{
-   return (theRangeConstraint.size() == 2);
-}
-
-double ossimNumericProperty::getMinValue()const
-{
-   if(hasConstraints())
-   {
-      return theRangeConstraint[0];
-   }
-
-   return 0.0;
-}
-
-double ossimNumericProperty::getMaxValue()const
-{
-   if(hasConstraints())
-   {
-      return theRangeConstraint[1];
-   }
-
-   return 0.0;
-}
-
-void ossimNumericProperty::clearConstraints()
-{
-   theRangeConstraint.clear();
-}
-
-void ossimNumericProperty::setConstraints(double minValue,
-                                          double maxValue)
-{
-   theRangeConstraint.resize(2);
-   theRangeConstraint[0] = minValue;
-   theRangeConstraint[1] = maxValue;
-
-   if(minValue > maxValue)
-   {
-      std::swap(theRangeConstraint[0],
-                theRangeConstraint[1]);
-   }
-}
-
-bool ossimNumericProperty::setValue(const ossimString& value)
-{
-   bool result = true;
-   if(hasConstraints())
-   {
-      ossim_float64 tempV = (ossim_float64)value.toDouble();
-      if((tempV >= theRangeConstraint[0])&&
-         (tempV <= theRangeConstraint[1]))
-      {
-         theValue = value;
-      }
-   }
-   else
-   {
-     theValue = value;
-   }
-
-   return result;
-}
-
-void ossimNumericProperty::valueToString(ossimString& valueResult)const
-{
-   switch(theType)
-   {
-   case ossimNumericPropertyType_INT:
-   {
-      valueResult = ossimString::toString(asInt32());
-      break;
-   }
-   case ossimNumericPropertyType_UINT:
-   {
-      valueResult = ossimString::toString(asUInt32());
-      break;
-   }
-   case ossimNumericPropertyType_FLOAT32:
-   {
-      valueResult = ossimString::toString(asFloat32());
-      
-      break;
-   }
-   case ossimNumericPropertyType_FLOAT64:
-   {
-      valueResult = ossimString::toString(asFloat64());
-      break;
-   }
-   };
-}
-
-
-ossimNumericProperty::ossimNumericPropertyType ossimNumericProperty::getNumericType()const
-{
-   return theType;
-}
-
-void ossimNumericProperty::setNumericType(ossimNumericPropertyType type)
-{
-   theType = type;
-}
-
-ossim_float64 ossimNumericProperty::asFloat64()const
-{
-   return (ossim_float64)theValue.toDouble();
-}
-
-ossim_float32 ossimNumericProperty::asFloat32()const
-{
-   return (ossim_float32)theValue.toDouble();
-}
-
-ossim_uint32  ossimNumericProperty::asUInt32()const
-{
-   return theValue.toUInt32();
-}
-
-ossim_uint16 ossimNumericProperty::asUInt16()const
-{
-   return (ossim_uint16)theValue.toUInt32();
-}
-
-ossim_uint8 ossimNumericProperty::asUInt8()const
-{
-   return (ossim_uint8)theValue.toUInt32();
-}
-
-ossim_sint32 ossimNumericProperty::asInt32()const
-{
-   return (ossim_int32)theValue.toInt32();
-}
-
-ossim_sint16 ossimNumericProperty::asInt16()const
-{
-   return (ossim_int16)theValue.toInt32();
-}
-
-ossim_sint8 ossimNumericProperty::asInt8()const
-{
-   return (ossim_int8)theValue.toInt32();
-}
diff --git a/ossim/src/ossim/base/ossimObject.cpp b/ossim/src/ossim/base/ossimObject.cpp
deleted file mode 100644
index e392dc5..0000000
--- a/ossim/src/ossim/base/ossimObject.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimObject.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/base/ossimObject.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimVisitor.h>
-
-RTTI_DEF(ossimObject, "ossimObject")
-
-ossimObject::ossimObject()
-{}
-
-ossimObject::~ossimObject()
-{
-}
-   
-ossimObject* ossimObject::dup()const
-{
-   ossimObject* result = NULL;
-   ossimKeywordlist kwl;
-
-   saveState(kwl);
-   
-   result = ossimObjectFactoryRegistry::instance()->createObject(kwl);
-
-   if(!result)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "dup() not implemented for object = "
-         << getClassName() << ". Please implement!\n";
-   }
-   
-   return result;
-}
-
-ossimString ossimObject::getShortName()const
-{
-   return getClassName();
-}
-
-ossimString ossimObject::getLongName()const
-{
-   return getClassName();
-}
-
-ossimString ossimObject::getDescription()const
-{
-   return getLongName();
-}
-
-
-ossimString ossimObject::getClassName()const
-{
-   return TYPE_NAME(this);
-}
-
-RTTItypeid ossimObject::getType()const
-{
-   return TYPE_INFO(this);
-}
-
-bool ossimObject::canCastTo(ossimObject* obj)const
-{
-   if(obj)
-   {
-      return obj->getType().can_cast(this->getType());
-   }
-   
-   return false;
-}
-
-bool ossimObject::canCastTo(const ossimString& parentClassName)const
-{
-   return (getType().find_baseclass(parentClassName.c_str()) !=
-           getType().null_type());
-}
-
-bool ossimObject::canCastTo(const RTTItypeid& id)const
-{
-   return id.can_cast(this->getType());
-}
-
-bool ossimObject::saveState(ossimKeywordlist& kwl,
-                            const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           getClassName(),
-           true);
-
-   return true;
-}
-
-bool ossimObject::isEqualTo(const ossimObject& obj, ossimCompareType /* compareType */)const
-{
-   return (getClassName() == obj.getClassName());
-}
-
-void ossimObject::accept(ossimVisitor& visitor)
-{
-   if(!visitor.stopTraversal()&&!visitor.hasVisited(this))
-   {
-      visitor.visit(this);
-   }
-}
-
-bool ossimObject::loadState(const ossimKeywordlist&, const char*)
-{
-   return true;
-}
-
-std::ostream& ossimObject::print(std::ostream& out) const
-{
-   return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimObject& obj)
-{
-   return obj.print(out);
-}
-
diff --git a/ossim/src/ossim/base/ossimPolyArea2d.cpp b/ossim/src/ossim/base/ossimPolyArea2d.cpp
deleted file mode 100644
index b8131d8..0000000
--- a/ossim/src/ossim/base/ossimPolyArea2d.cpp
+++ /dev/null
@@ -1,837 +0,0 @@
-//---
-// License:  See top level LICENSE.txt file.
-//
-// $Id: ossimPolyArea2d.cpp 23623 2015-11-13 18:24:28Z gpotts $
-//---
-
-#include <ossim/base/ossimPolyArea2d.h>
-
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <geos/geom/Coordinate.h>
-#include <geos/geom/CoordinateArraySequence.h>
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/LinearRing.h>
-#include <geos/opBuffer.h>
-#include <geos/geom/Point.h>
-#include <geos/geom/Polygon.h>
-#include <geos/geom/MultiPolygon.h>
-#include <geos/geom/PrecisionModel.h>
-#include <geos/io/WKTReader.h>
-#include <geos/io/WKTWriter.h>
-#include <geos/util/GEOSException.h>
-#include <geos/operation/valid/IsValidOp.h>
-#include <geos/opBuffer.h>
-#include <cstdlib>
-#include <exception>
-#include <vector>
-
-class ossimGeometryFactoryWrapper : public ossimReferenced
-{
-public:
-   ossimGeometryFactoryWrapper()
-      : m_geomFactory(0)
-   {
-      geos::geom::PrecisionModel *pm =
-         new geos::geom::PrecisionModel(geos::geom::PrecisionModel::FLOATING);
-      m_geomFactory = new geos::geom::GeometryFactory(pm, -1); 
-   }
-   virtual ~ossimGeometryFactoryWrapper(){if(m_geomFactory) delete m_geomFactory;m_geomFactory=0;}
-   
-   geos::geom::GeometryFactory* m_geomFactory;
-};
-
-class OssimPolyArea2dPrivate
-{
-public:
-   typedef geos::geom::Geometry* GeometryPtr;
-   typedef const geos::geom::Geometry* ConstGeometryPtr;
-   
-   OssimPolyArea2dPrivate(GeometryPtr geom=0);
-   ~OssimPolyArea2dPrivate();
-   
-   void deleteGeometry() { if(m_geometry) { delete m_geometry; m_geometry = 0; }}
-   void setGeometry(const ossimPolygon& polygon, const vector<ossimPolygon>& holes = vector<ossimPolygon>());
-   void setGeometry(GeometryPtr geom){deleteGeometry();m_geometry=geom;}
-   geos::geom::GeometryFactory* geomFactory(){{return m_globalFactory.valid()?m_globalFactory->m_geomFactory:0;}}
-   GeometryPtr m_geometry;
-   static ossimRefPtr<ossimGeometryFactoryWrapper> m_globalFactory; 
-};
-
-ossimRefPtr<ossimGeometryFactoryWrapper> OssimPolyArea2dPrivate::m_globalFactory;
-
-OssimPolyArea2dPrivate::OssimPolyArea2dPrivate(GeometryPtr geom)
-:m_geometry(geom)
-{
-   static OpenThreads::Mutex globalFactoryMutex;
-   
-   {
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(globalFactoryMutex);
-      if(!m_globalFactory.valid())
-      {
-         m_globalFactory = new ossimGeometryFactoryWrapper();
-      }    
-   }
-}
-
-OssimPolyArea2dPrivate::~OssimPolyArea2dPrivate()
-{
-   deleteGeometry();
-}
-
-void OssimPolyArea2dPrivate::setGeometry(
-   const ossimPolygon& exteriorRing, const vector<ossimPolygon>& interiorRings)
-{
-   deleteGeometry();
-   
-   geos::geom::CoordinateArraySequence *cas = new geos::geom::CoordinateArraySequence();
-   
-   const std::vector<ossimDpt>& pts = exteriorRing.getVertexList();
-
-   int idx = 0;
-   int n = (int)pts.size();
-   
-   if(n > 0)
-   {
-      //fill the exterior ring
-      for (idx = 0; idx < n; idx++)
-      {
-         cas->add(geos::geom::Coordinate(pts[idx].x, pts[idx].y));
-      }
-      
-      //if the original polygon didn't have the first and last point the same, make it so
-      if((pts[0].x != pts[n-1].x) || (pts[0].y!=pts[n-1].y))
-      {
-         cas->add(geos::geom::Coordinate(pts[0].x, pts[0].y));
-      }
-      
-      //fill the interior rings
-      vector<geos::geom::Geometry*> *holes = new vector<geos::geom::Geometry*>();
-      for (ossim_uint32 interiorRingIdx = 0; interiorRingIdx < interiorRings.size(); ++interiorRingIdx)
-      {
-         geos::geom::CoordinateArraySequence *interiorCas =
-            new geos::geom::CoordinateArraySequence();
-         const std::vector<ossimDpt>& vertexPts = interiorRings[interiorRingIdx].getVertexList();
-         for(ossim_uint32 vertexIndex=0; vertexIndex < vertexPts.size(); ++vertexIndex)
-         {
-            interiorCas->add(geos::geom::Coordinate(vertexPts[vertexIndex].x,
-                                                    vertexPts[vertexIndex].y));
-         }
-         
-         //if the original polygon didn't have the first and last point the same, make it so
-         if((vertexPts[0].x != vertexPts[vertexPts.size()-1].x) ||
-            (vertexPts[0].y!=vertexPts[vertexPts.size()-1].y))
-         {
-            interiorCas->add(geos::geom::Coordinate(vertexPts[0].x, vertexPts[0].y));
-         }
-         
-         geos::geom::LinearRing *hole = geomFactory()->createLinearRing(interiorCas);
-         holes->push_back(hole);
-      }
-      
-      geos::geom::LinearRing* shell = geomFactory()->createLinearRing(cas);
-      if ( shell )
-      {
-         m_geometry = geomFactory()->createPolygon(shell, holes);
-      }
-      else
-      {
-         m_geometry = 0;
-      }
-   }
-}
-
-void ossimPolyArea2d::recurseVisibleGeometries(
-   std::vector<ossimPolygon>& polyList, const geos::geom::Geometry* geom) const
-{
-   int nGeoms = (int)geom->getNumGeometries();
-   
-   if(nGeoms < 2 )
-   {
-      const geos::geom::Polygon* poly = dynamic_cast<const geos::geom::Polygon*> (geom);
-      
-      if (poly)
-      {
-         const geos::geom::LineString* lineString = dynamic_cast<const geos::geom::LineString*> (poly->getExteriorRing());
-         if (lineString)
-         {
-            int currentPolyIdx = (int)polyList.size();
-            int nPoints = (int)lineString->getNumPoints();
-            int idx = 0;
-            
-            polyList.push_back(ossimPolygon());
-            
-            for (idx=0; idx<nPoints; idx++)
-            {
-               std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
-               polyList[currentPolyIdx].addPoint(point->getX(), point->getY());
-            }
-         }
-      }
-   }
-   else
-   {
-      for (int idx=0; idx < nGeoms; ++idx)
-      {
-         recurseVisibleGeometries(polyList, geom->getGeometryN(idx));
-      }
-   }
-}
-
-void ossimPolyArea2d::recurseHoles(std::vector<ossimPolygon>& polyList,
-                                   const geos::geom::Geometry* geom) const
-{
-   int nGeoms = (int)geom->getNumGeometries();
-   
-   if(nGeoms < 2 )
-   {
-      const geos::geom::Polygon* poly = dynamic_cast<const geos::geom::Polygon*> (geom);
-
-      if (poly)
-      {
-         ossim_uint32 nInteriorRings = (ossim_uint32)poly->getNumInteriorRing();
-         ossim_uint32 idx = 0;
-         
-         for(idx = 0; idx < nInteriorRings; ++idx)
-         {
-            const geos::geom::LineString* lineString = poly->getInteriorRingN(idx);
-            if (lineString)
-            {
-               int currentPolyIdx = (int)polyList.size();
-               int nPoints = (int)lineString->getNumPoints();
-               int idx = 0;
-
-               polyList.push_back(ossimPolygon());
-
-               for (idx=0; idx<nPoints; idx++)
-               {
-                  std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
-                  polyList[currentPolyIdx].addPoint(point->getX(), point->getY());
-               }
-            }
-         }
-      }
-   }
-   else
-   {
-      int idx = 0;
-      
-      for (idx=0; idx < nGeoms; idx++)
-      {
-         recurseHoles(polyList, geom->getGeometryN(idx));
-      }
-   }
-}
-
-void ossimPolyArea2d::recurseCompleteGeometries(std::vector<ossimPolyArea2d>& polyList,
-                                                const geos::geom::Geometry* geom) const
-{
-   int nGeoms = (int)geom->getNumGeometries();
-   if(nGeoms < 2 )
-   {
-      const geos::geom::Polygon* poly = dynamic_cast<const geos::geom::Polygon*> (geom);
-
-      if (poly)
-      {
-         //get exterior shell for the geometry
-         ossimPolygon shell;
-         const geos::geom::LineString* lineString =
-            dynamic_cast<const geos::geom::LineString*> (poly->getExteriorRing());
-         if (lineString)
-         {
-            int nPoints = (int)lineString->getNumPoints();
-            for (int idx = 0; idx<nPoints; idx++)
-            {
-               std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
-               shell.addPoint(point->getX(), point->getY());
-            }
-         }
-         
-         // Get interior rings for the geometry.
-         std::size_t nInteriorRings = poly->getNumInteriorRing();
-         vector<ossimPolygon> holes(nInteriorRings);
-         for(std::size_t holeIdx = 0; holeIdx < nInteriorRings; ++holeIdx)
-         {
-            const geos::geom::LineString* lineString = poly->getInteriorRingN(holeIdx);
-            if (lineString)
-            {
-               std::size_t nPoints = lineString->getNumPoints();
-               for (std::size_t idx = 0; idx<nPoints; ++idx)
-               {
-                  std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
-                  holes[holeIdx].addPoint(point->getX(), point->getY());
-               }
-            }
-         }
-         polyList.push_back(ossimPolyArea2d(shell, holes));
-      }
-   }
-   else
-   {
-      int idx = 0;
-      
-      for (idx=0; idx < nGeoms; idx++)
-      {
-         recurseCompleteGeometries(polyList, geom->getGeometryN(idx));
-      }
-   }
-}
-
-std::ostream& operator <<(std::ostream& out, const ossimPolyArea2d& rhs)
-{
-   if(rhs.m_privateData->m_geometry)
-   {
-      out << rhs.m_privateData->m_geometry->toString();
-   }
-   return out;
-}
-
-ossimPolyArea2d::ossimPolyArea2d()
-   :m_privateData(new OssimPolyArea2dPrivate)
-{
-}
-
-ossimPolyArea2d::ossimPolyArea2d(const vector<ossimGpt>& polygon)
-   :m_privateData(new OssimPolyArea2dPrivate)
-{
-   (*this) = polygon;
-}
-
-ossimPolyArea2d::ossimPolyArea2d(const ossimIrect& rect)
-   :m_privateData(new OssimPolyArea2dPrivate)
-{
-   (*this) = rect;
-}
-
-ossimPolyArea2d::ossimPolyArea2d(const ossimDrect& rect)
-   :m_privateData(new OssimPolyArea2dPrivate)
-{
-   (*this) = rect;
-}
-
-ossimPolyArea2d::ossimPolyArea2d(const ossimPolygon& polygon)
-   :m_privateData(new OssimPolyArea2dPrivate)
-{
-   (*this) = polygon;
-}
-
-ossimPolyArea2d::ossimPolyArea2d(const ossimPolygon& exteriorRing, const vector<ossimPolygon>& interiorRings)
-   :m_privateData(new OssimPolyArea2dPrivate)
-{	
-	m_privateData->setGeometry(exteriorRing, interiorRings);
-}
-
-ossimPolyArea2d::ossimPolyArea2d(const ossimPolyArea2d& rhs)
-   :m_privateData(new OssimPolyArea2dPrivate) 
-{
-   *this = rhs;
-}
-
-ossimPolyArea2d::ossimPolyArea2d(const ossimDpt& p1,
-                                 const ossimDpt& p2,
-                                 const ossimDpt& p3,
-                                 const ossimDpt& p4)
-   :
-   m_privateData(new OssimPolyArea2dPrivate)
-{
-   ossimPolygon temp(p1,p2,p3,p4);
-   *this = temp;
-}
-
-ossimPolyArea2d::~ossimPolyArea2d()
-{
-   if(m_privateData)
-   {
-      delete m_privateData;
-      m_privateData = 0;
-   }
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimPolyArea2d& rhs)
-{ 
-   if(this != &rhs)
-   {
-      if(rhs.m_privateData->m_geometry)
-      {
-         m_privateData->setGeometry(rhs.m_privateData->m_geometry->clone());
-      }
-   }
-   return *this;
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimPolygon& polygon)
-{
-   m_privateData->setGeometry(polygon);
-
-   return *this;
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimIrect& rect)
-{
-   return (*this = ossimPolygon(rect));
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimDrect& rect)
-{
-   return (*this = ossimPolygon(rect));
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator =(const vector<ossimGpt>& polygon)
-{
-   std::vector<ossimDpt> pts;
-   int idx = 0;
-   int n = (int)polygon.size();
-   for(idx = 0; idx < n;++idx)
-   {
-      pts.push_back(polygon[idx]);
-   }
-  
-   return (*this = ossimPolygon(pts));
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator =(const vector<ossimDpt>& polygon)
-{
-   return (*this = ossimPolygon(polygon));
-}
-
-bool ossimPolyArea2d::intersects(const ossimPolyArea2d& rhs)const
-{
-   bool result = false;
-
-   if(m_privateData->m_geometry&&rhs.m_privateData->m_geometry)
-   {
-      result = m_privateData->m_geometry->intersects(rhs.m_privateData->m_geometry); 
-   }
-
-   return result;
-}
-
-ossimPolyArea2d ossimPolyArea2d::operator &(const ossimPolyArea2d& rhs)const
-{
-   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
-   {
-      ossimPolyArea2d result;
-      try // GEOS code throws exceptions...
-      {
-         result.m_privateData->setGeometry(m_privateData->m_geometry->intersection(
-                                              rhs.m_privateData->m_geometry));
-      }
-      catch( const std::exception& e )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator& Caught exception: " << e.what() << std::endl;
-         result.clearPolygons();
-      }
-      catch( ... )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator& Caught exception!" << std::endl;
-         result.clearPolygons();
-      }
-      return result;
-   }
-   return *this;
-}
-
-ossimPolyArea2d ossimPolyArea2d::operator +(const ossimPolyArea2d& rhs)const
-{
-   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
-   {
-      ossimPolyArea2d result;
-      try // GEOS code throws exceptions...
-      {
-         result.m_privateData->setGeometry(m_privateData->m_geometry->Union(
-                                              rhs.m_privateData->m_geometry));
-      }  
-      catch( const std::exception& e )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator+ Caught exception: " << e.what() << std::endl;
-         result.clearPolygons();
-      }
-      catch( ... )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator+ Caught exception!" << std::endl;
-         result.clearPolygons();
-      }
-      return result;
-   }
-   return *this;
-}
-ossimPolyArea2d ossimPolyArea2d::operator -(const ossimPolyArea2d& rhs)const
-{
-   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
-   {
-      ossimPolyArea2d result;
-      try // GEOS code throws exceptions...
-      {
-         result.m_privateData->setGeometry(m_privateData->m_geometry->difference(
-                                              rhs.m_privateData->m_geometry));
-      }
-      catch( const std::exception& e )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator- Caught exception: " << e.what() << std::endl;
-         result.clearPolygons();
-      }
-      catch( ... )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator- Caught exception!" << std::endl;
-         result.clearPolygons();
-      }
-      return result;
-   }
-   return *this;
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator &=(const ossimPolyArea2d& rhs)
-{
-   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
-   {
-      try // GEOS code throws exceptions...
-      {
-         m_privateData->setGeometry(m_privateData->m_geometry->intersection(
-                                       rhs.m_privateData->m_geometry));
-      }
-      catch( const std::exception& e )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator&= Caught exception: " << e.what() << std::endl;
-         this->clearPolygons();
-      }
-      catch( ... )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator&= Caught exception!" << std::endl;
-         this->clearPolygons();
-      }      
-   }
-   return *this;
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator +=(const ossimPolyArea2d& rhs)
-{
-   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
-   {
-      try // GEOS code throws exceptions...
-      {
-         m_privateData->setGeometry(m_privateData->m_geometry->Union(
-                                       rhs.m_privateData->m_geometry));
-      }
-      catch( const std::exception& e )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator+= Caught exception: " << e.what() << std::endl;
-         this->clearPolygons();
-      }
-      catch( ... )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator+= Caught exception!" << std::endl;
-         this->clearPolygons();
-      }      
-   }
-   return *this;
-}
-
-const ossimPolyArea2d& ossimPolyArea2d::operator -=(const ossimPolyArea2d& rhs)
-{
-   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
-   {
-      try // GEOS code throws exceptions...
-      {
-         m_privateData->setGeometry(m_privateData->m_geometry->difference(
-                                       rhs.m_privateData->m_geometry));
-      }
-      catch( const std::exception& e )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator-= Caught exception: " << e.what() << std::endl;
-         this->clearPolygons();
-      }
-      catch( ... )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPolyArea2d::operator-= Caught exception!" << std::endl;
-         this->clearPolygons();
-      }      
-   }
-   return *this;
-}
-
-void ossimPolyArea2d::add(const ossimPolyArea2d& rhs)
-{
-   geos::geom::Geometry* geom = m_privateData->m_geometry->Union(rhs.m_privateData->m_geometry);
-   if(geom) m_privateData->setGeometry(geom);
-}
-
-void ossimPolyArea2d::clearPolygons()
-{
-   m_privateData->deleteGeometry();
-#if 0
-   clearEngine();
-#endif
-}
-
-bool ossimPolyArea2d::getVisiblePolygons(vector<ossimPolygon>& polyList)const
-{
-   bool foundPolys = false;
-   if(m_privateData->m_geometry)
-   {
-      ossim_uint32 sizeBefore = (ossim_uint32)polyList.size();
-      recurseVisibleGeometries(polyList, m_privateData->m_geometry);
-      foundPolys = (sizeBefore != polyList.size());
-   }
-
-   return foundPolys;
-}
-
-bool ossimPolyArea2d::getPolygonHoles(vector<ossimPolygon>& polyList)const
-{
-   bool foundPolys = false;
-   if(m_privateData->m_geometry)
-   {
-      ossim_uint32 sizeBefore = (ossim_uint32)polyList.size();
-      recurseHoles(polyList, m_privateData->m_geometry);
-      foundPolys = (sizeBefore != polyList.size());
-   }
-
-   return foundPolys;
-}
-
-bool ossimPolyArea2d::getCompletePolygons(vector<ossimPolyArea2d>& polyList)const
-{
-	bool foundPolys = false;
-	if(m_privateData->m_geometry){
-		ossim_uint32 sizeBefore = (ossim_uint32)polyList.size();
-		recurseCompleteGeometries(polyList, m_privateData->m_geometry);
-		foundPolys = (sizeBefore != polyList.size());
-	}
-	return foundPolys;
-}
-
-bool ossimPolyArea2d::isEmpty()const
-{
-   bool result = true;
-   if (m_privateData&&m_privateData->m_geometry)
-   {
-      result = m_privateData->m_geometry->isEmpty();
-   }
-
-   return result;
-}
-
-bool ossimPolyArea2d::isValid(bool displayValidationError)const
-{
-   bool result = false;
-   
-   if(m_privateData&&m_privateData->m_geometry)
-   {
-      if(displayValidationError)
-      {
-         geos::operation::valid::IsValidOp validityCheck(m_privateData->m_geometry);
-         geos::operation::valid::TopologyValidationError*
-            topologyValidationError(validityCheck.getValidationError());
-         // if(topologyValidationError == nullptr)
-         if(topologyValidationError == 0)
-         {
-            result = true;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_INFO)
-               << "ossimPolyArea2d::isValid: " << topologyValidationError->toString() << std::endl;
-         }
-      }
-      else
-      {
-         result = m_privateData->m_geometry->isValid();
-      }
-   }
-   
-   return result;
-}
-
-bool ossimPolyArea2d::isPointWithin(const ossimDpt& point)const
-{
-   return isPointWithin(point.x, point.y);
-}
-
-bool ossimPolyArea2d::isPointWithin(double x, double y)const
-{
-   bool result = false;
-
-   if(!isEmpty())
-   {
-      geos::geom::Coordinate c(x,y);
-      geos::geom::Geometry* geom = m_privateData->geomFactory()->createPoint(c);
-  
-      result = m_privateData->m_geometry->intersects(geom);
-
-      delete geom;
-   }
-
-   return result;
-}
-
-void ossimPolyArea2d::getBoundingRect(ossimDrect& rect)
-{
-   rect.makeNan();
-
-   if(!isEmpty())
-   {
-      const geos::geom::Envelope* envelope = m_privateData->m_geometry->getEnvelopeInternal();
-
-      rect = ossimDrect(envelope->getMinX(), envelope->getMinY(), envelope->getMaxX(), envelope->getMaxY());
-   }
-}
-
-std::string ossimPolyArea2d::toString()const
-{
-   std::string result = "";
-
-   if(m_privateData->m_geometry)
-   {
-      result = m_privateData->m_geometry->toString();
-   }
-
-   return result;
-}
-
-ossimPolyArea2d ossimPolyArea2d::getBufferedShape(double distance) const{
-	ossimPolyArea2d result;
-	try{
-		geos::operation::buffer::BufferOp buffer_operation(m_privateData->m_geometry);
-		result.m_privateData->setGeometry( buffer_operation.getResultGeometry(distance));
-	}catch( const std::exception& e ){
-		ossimNotify(ossimNotifyLevel_DEBUG)
-			<< "ossimPolyArea2d::getBufferedShape Caught exception: " << e.what() << std::endl;
-		result.clearPolygons();
-	}catch( ... ){
-		ossimNotify(ossimNotifyLevel_DEBUG)
-			<< "ossimPolyArea2d::getBufferedShape Caught exception!" << std::endl;
-		result.clearPolygons();
-	}
-	return result;
-}
-ossimPolyArea2d& ossimPolyArea2d::setToBufferedShape(double distance)
-{
-   try{
-      geos::operation::buffer::BufferOp buffer_operation(m_privateData->m_geometry);
-      m_privateData->setGeometry( buffer_operation.getResultGeometry(distance));
-   }catch( const std::exception& e ){
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPolyArea2d::getBufferedShape Caught exception: " << e.what() << std::endl;
-   }catch( ... ){
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPolyArea2d::getBufferedShape Caught exception!" << std::endl;
-   }
-   return *this;
-}
-
-ossimPolyArea2d& ossimPolyArea2d::toMultiPolygon()
-{
-
-
-   try{
-      if(m_privateData->m_geometry)
-      {
-         switch(m_privateData->m_geometry->getGeometryTypeId())
-         {
-            case geos::geom::GEOS_POLYGON:
-            {
-               std::vector<geos::geom::Geometry*> values;
-               values.push_back(m_privateData->m_geometry->clone());
-
-               m_privateData->setGeometry(m_privateData->m_geometry->getFactory()->createMultiPolygon(values));
-               break;
-            }
-            case geos::geom::GEOS_MULTIPOLYGON:
-            {
-               // intentionally left blank
-               break;
-            }
-            default:
-            {  
-               // might need an error at a later date
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimPolyArea2d::toMultiPolygon Geometry type can not be converted to a multi polygon: " <<m_privateData->m_geometry->getGeometryType()<< std::endl;
-
-               break;
-            }
-         }
-      }
-   }
-   catch(const std::exception& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimPolyArea2d::toMultiPolygon Caught exception: " << e.what() << std::endl;
-   }
-   catch(...)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimPolyArea2d::toMultiPolygon Caught exception!" << std::endl;
-   }
-
-   return *this;
-}
-
-bool ossimPolyArea2d::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           "ossimPolyArea2d",
-           true);
-
-   if(!isEmpty())
-   {
-      geos::io::WKTWriter writer;
-
-      kwl.add(prefix,
-              "wkt",
-              writer.write(m_privateData->m_geometry).c_str(),
-              true);
-   }
-   // else
-   // {
-   //
-   // }
-
-   return true;
-}
-
-bool ossimPolyArea2d::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   if(m_privateData)
-   {
-      ossimString wkt = kwl.find(prefix, "wkt");
-
-      if(!wkt.empty())
-      {
-         geos::io::WKTReader reader(m_privateData->geomFactory());
-         try
-         {
-            m_privateData->setGeometry(reader.read(wkt.c_str()));
-         }
-         catch( const std::exception& e )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimPolyArea2d::loadState Caught exception: " << e.what() << std::endl;
-            this->clearPolygons();
-         }
-         catch(...)
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimPolyArea2d::loadState Caught exception!" << std::endl;
-            this->clearPolygons(); 
-         }
-      }
-   }
-   return true;
-}
diff --git a/ossim/src/ossim/base/ossimPolygon.cpp b/ossim/src/ossim/base/ossimPolygon.cpp
deleted file mode 100644
index 7d91f44..0000000
--- a/ossim/src/ossim/base/ossimPolygon.cpp
+++ /dev/null
@@ -1,1267 +0,0 @@
-//*****************************************************************************
-// FILE: ossimPolygon.cpp
-//
-// License: MIT
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class 
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimPolygon.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimLine.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/base/ossimString.h>
-#include <algorithm>
-#include <iterator>
-#include <sstream>
-#include <iterator>
-
-static const char* NUMBER_VERTICES_KW = "number_vertices";
-static const char* VERTEX_ORDER_KW    = "order";
-
-static const int RECT_LEFT_EDGE   = 0;
-static const int RECT_TOP_EDGE    = 1;
-static const int RECT_RIGHT_EDGE  = 2;
-static const int RECT_BOTTOM_EDGE = 3;
-
-ossimPolygon::ossimPolygon()
-   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
-    theVertexList(),
-    theCurrentVertex(0)
-   
-{}
-
-ossimPolygon::ossimPolygon(const vector<ossimIpt>& polygon)
-   :theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
-   theVertexList(polygon.size()),
-   theCurrentVertex(0)
-   
-{
-   // Assign std::vector<ossimIpt> list to std::vector<ossimDpt> theVertexList.
-   for (std::vector<ossimIpt>::size_type i = 0; i < polygon.size(); ++i)
-   {
-      theVertexList[i] = polygon[i];
-   }
-}
-
-ossimPolygon::ossimPolygon(const vector<ossimDpt>& polygon)
-   :theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
-   theVertexList(polygon),
-    theCurrentVertex(0)
-{
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimPolygon(int numVertices, const ossimDpt* vertex_array)
-//  
-//*****************************************************************************
-ossimPolygon::ossimPolygon(int numVertices, const ossimDpt* v)
-   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
-     theCurrentVertex(0)
-     
-{
-   theVertexList.insert(theVertexList.begin(),
-                        v, v+numVertices);
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: ossimPolygon(ossimPolygon)
-//  
-//*****************************************************************************
-ossimPolygon::ossimPolygon(const ossimPolygon& polygon)
-   :theCurrentVertex(0)
-{
-   *this = polygon;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimPolygon(p1, p2, p3, p4)
-//  
-//  Provided for convenience. Does not imply the polygon is limited to four
-//  vertices
-//  
-//*****************************************************************************
-ossimPolygon::ossimPolygon(ossimDpt v1,
-                           ossimDpt v2,
-                           ossimDpt v3,
-                           ossimDpt v4)
-   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
-     theVertexList(4),
-     theCurrentVertex(0)
-     
-{
-   theVertexList[0] = v1;
-   theVertexList[1] = v2;
-   theVertexList[2] = v3;
-   theVertexList[3] = v4;
-}
-
-ossimPolygon::ossimPolygon(const ossimIrect& rect)
-: theOrderingType(OSSIM_CLOCKWISE_ORDER),
-  theVertexList(4),
-  theCurrentVertex(0)
-{
-   theVertexList[0] = rect.ul();
-   theVertexList[1] = rect.ur();
-   theVertexList[2] = rect.lr();
-   theVertexList[3] = rect.ll();
-}
-
-ossimPolygon::ossimPolygon(const ossimDrect& rect)
-: theOrderingType(OSSIM_CLOCKWISE_ORDER),
-theVertexList(4),
-theCurrentVertex(0)
-{
-   theVertexList[0] = rect.ul();
-   theVertexList[1] = rect.ur();
-   theVertexList[2] = rect.lr();
-   theVertexList[3] = rect.ll();
-}
-
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimPolygon
-//  
-//*****************************************************************************
-ossimPolygon::~ossimPolygon()
-{
-}
-
-
-//*************************************************************************************************
-//! Returns polygon area. Negative indicates CW ordering of vertices (in right-handed coordinates
-//*************************************************************************************************
-double ossimPolygon::area()const
-{
-   double area = 0;
-   ossim_uint32 i=0;
-   ossim_uint32 j=0;
-   ossim_uint32 size = (ossim_uint32)theVertexList.size();
-   
-   for (i=0;i<size;i++)
-   {
-      j = (i + 1) % (int)size;
-      area += theVertexList[i].x * theVertexList[j].y;
-      area -= theVertexList[i].y * theVertexList[j].x;
-   }
-
-   area /= 2;
-
-   return area;
-}
-
-void ossimPolygon::roundToIntegerBounds(bool compress)
-{
-   int i = 0;
-   for(i = 0; i < (int)theVertexList.size(); ++i)
-   {
-      theVertexList[i] = ossimIpt(theVertexList[i]);
-   }
-
-  if(compress&&theVertexList.size())
-   {
-      vector<ossimDpt> polyLine;
-      
-      polyLine.push_back(theVertexList[0]);
-      ossimDpt testPt = theVertexList[0];
-      for(i=1; i < (int)theVertexList.size(); ++i)
-      {
-         if(testPt!=theVertexList[i])
-         {
-            testPt = theVertexList[i];
-            polyLine.push_back(testPt);
-         }
-      }
-      if(polyLine.size() == 1)
-      {
-         polyLine.push_back(polyLine[0]);
-      }
-      
-      if(theVertexList.size() == 1)
-      {
-         polyLine.push_back(testPt);
-      }
-      theVertexList    = polyLine;
-      theCurrentVertex = 0;
-   }
-}
-
-ossimDpt ossimPolygon::midPoint()const
-{
-   int upper = (int)theVertexList.size();
-   ossimDpt result(0.0, 0.0);
-   int i = 0;
-
-   if(!upper)
-   {
-      result.makeNan();
-   }
-   else
-   {
-      for(i = 0; i < upper; ++i)
-      {
-         result.x+=theVertexList[i].x;
-         result.y+=theVertexList[i].y;
-      }
-      result.x/=(double)upper;
-      result.y/=(double)upper;
-   }
-   
-   return result;
-}
-
-bool ossimPolygon::hasNans()const
-{
-   int upper = (int)theVertexList.size();
-   int i = 0;
-
-   for(i = 0; i < upper; ++i)
-   {
-      if(theVertexList[i].hasNans())
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-void ossimPolygon::getIntegerBounds(ossim_int32& minX,
-   ossim_int32& minY,
-   ossim_int32& maxX,
-   ossim_int32& maxY)const
-{
-   ossim_int32 npoly = (ossim_int32)theVertexList.size();
-   int i = 0;
-
-   if(npoly)
-   {
-      minX = (ossim_int32)floor(theVertexList[0].x);
-      maxX = (ossim_int32)ceil(theVertexList[0].x);
-      minY = (ossim_int32)floor(theVertexList[0].y);
-      maxY = (ossim_int32)ceil(theVertexList[0].y);
-
-      for(i =1; i < npoly; ++i)
-      {
-         minX = std::min((ossim_int32)floor(theVertexList[i].x),
-            (ossim_int32)minX);
-         maxX = std::max((ossim_int32)ceil(theVertexList[i].x),
-            (ossim_int32)maxX);
-         minY = std::min((ossim_int32)floor(theVertexList[i].y),
-            (ossim_int32)minY);
-         maxY = std::max((ossim_int32)ceil(theVertexList[i].y),
-            (ossim_int32)maxY);
-      }
-   }
-   else
-   {
-      minX = OSSIM_INT_NAN;
-      minY = OSSIM_INT_NAN;
-      maxX = OSSIM_INT_NAN;
-      maxY = OSSIM_INT_NAN;
-   }
-}
-
-void ossimPolygon::getFloatBounds(ossim_float64& minX,
-                                  ossim_float64& minY,
-                                  ossim_float64& maxX,
-                                  ossim_float64& maxY) const
-{
-   ossim_int32 npoly = (ossim_int32)theVertexList.size();
-   int i = 0;
-
-   if(npoly)
-   {
-      minX = floor(theVertexList[0].x);
-      maxX = ceil(theVertexList[0].x);
-      minY = floor(theVertexList[0].y);
-      maxY = ceil(theVertexList[0].y);
-
-      for(i =1; i < npoly; ++i)
-      {
-         minX = std::min<double>(floor(theVertexList[i].x), minX);
-         maxX = std::max<double>(ceil(theVertexList[i].x),  maxX);
-         minY = std::min<double>(floor(theVertexList[i].y), minY);
-         maxY = std::max<double>(ceil(theVertexList[i].y),  maxY);
-      }
-   }
-   else
-   {
-      minX = ossim::nan();
-      minY = ossim::nan();
-      maxX = ossim::nan();
-      maxY = ossim::nan();
-   }
-}
-
-bool ossimPolygon::clipToRect(vector<ossimPolygon>& result,
-                              const ossimDrect& rect)const
-{
-   result.clear();
-   ossimPolyArea2d p1(*this);
-   ossimPolyArea2d p2(rect.ul(), rect.ur(), rect.lr(), rect.ll());
-   
-   p1&=p2;
-
-   p1.getVisiblePolygons(result);
-
-   return (result.size() > 0);
-}   
-
-//*****************************************************************************
-//  METHOD: ossimPolygon::clipLineSegment(p1, p2)
-//  
-//  Implements Cyrus-Beck clipping algorithm as described in:
-//  http://www.daimi.au.dk/~mbl/cgcourse/wiki/cyrus-beck_line-clipping_.html
-//
-//  Clips the line segment defined by the two endpoints provided. The
-//  endpoints are modified as needed to represent the clipped line. Returns
-//  true if intersection present.
-//  
-//*****************************************************************************
-bool ossimPolygon::clipLineSegment(ossimDpt& P, ossimDpt& Q) const
-{
-   ossimDpt PQ (Q - P);
-   double tE = 0.0;
-   double tL = 1.0;
-   ossimLine edge, edgeE, edgeL;
-   bool intersected=false;
-   double num, denom, t;
-   ossim_uint32 npol = (ossim_uint32)theVertexList.size();
-
-   checkOrdering();
-   //***
-   // clip the segment against each edge of the polygon
-   //***
-   ossim_uint32 i = 0;
-   ossim_uint32 j = 0;
-   for(i = 0, j = 1; i < npol;)
-   {
-      edge = ossimLine(theVertexList[i],
-                       theVertexList[j]);
-      
-      ossimDpt normal = edge.normal();
-
-      // Fix from CChuah at observera.com for counter clockwise polygons. (drb)
-      if (theOrderingType == OSSIM_COUNTERCLOCKWISE_ORDER)
-      {
-         normal.x = -normal.x;
-         normal.y = -normal.y;
-      }
-      
-      denom = normal.x*PQ.x + normal.y*PQ.y;
-      
-      num = normal.x*(edge.theP1.x - P.x) + normal.y*(edge.theP1.y - P.y);
-      
-      if (denom < 0)
-      {
-         //***
-         // Appears to be entering:
-         //***
-         t = num / denom;
-         if (t > tE)
-         {
-            tE = t; //+ FLT_EPSILON;
-            edgeE = edge;
-         }
-      }
-      else if (denom > 0)
-      {
-         //***
-         // Appears to be leaving:
-         //***
-         t = num / denom;
-         if (t < tL)
-         {
-            tL = t;// - FLT_EPSILON;
-            edgeL = edge;
-         }
-      }
-
-      ++i;
-      ++j;
-      j%=npol;
-   } 
-   
-   //***
-   // Compute clipped end points:
-   //***
-   if(tL >= tE)
-   {
-       Q.x = P.x + tL*PQ.x;
-       Q.y = P.y + tL*PQ.y;
-       P.x += tE*PQ.x;
-       P.y += tE*PQ.y;
-       intersected = true;
-   }
-   
-   return intersected;
-}
-
-/**
-* METHOD: isRectWithin()
-* Returns true if all the corner points of the given rect fit within.
-*/
-bool ossimPolygon::isRectWithin(const ossimIrect &rect) const 
-{
-    if(isPointWithin(rect.ul()) &&
-       isPointWithin(rect.ur()) &&
-       isPointWithin(rect.ll()) &&
-       isPointWithin(rect.lr())) {
-       	return true;
-    }
-    return false;
-}
-/**
-* METHOD: isPolyWithin()
-* Returns true if all the vertices of the given polygon fit within.
-*/
-bool ossimPolygon::isPolyWithin(const ossimPolygon &poly) const 
-{
-   bool ret=false;
-   int numvertex=poly.getNumberOfVertices();
-   if(getNumberOfVertices()>1 && numvertex) {
-      ret=true;
-      for(int v=0;v<numvertex;v++) {
-         if(!isPointWithin(poly[v])) {
-            ret=false;
-            break;
-         }
-      }
-   }
-   return ret;
-}
-
-//*****************************************************************************
-//  METHOD: ossimPolygon::pointWithin(const ossimDpt& point)
-//  
-//  Returns TRUE if point is inside polygon.
-//  
-//*****************************************************************************
-bool ossimPolygon::isPointWithin(const ossimDpt& point) const
-{
-
-   int i, j, c = 0;
-   int npol = (int)theVertexList.size();
-
-   for (i = 0, j = npol-1; i < npol; j = i++)
-   {
-      if ((((theVertexList[i].y <= point.y) && (point.y < theVertexList[j].y)) ||
-           ((theVertexList[j].y <= point.y) && (point.y < theVertexList[i].y))) &&
-          (point.x < (theVertexList[j].x - theVertexList[i].x) * (point.y - theVertexList[i].y) /
-           (theVertexList[j].y - theVertexList[i].y) + theVertexList[i].x))
-      {
-         c = !c;
-      }
-   }
-
-   if(!c) // check if on if not within
-   {
-      for (i = 0, j = npol-1; i < npol; j = i++)
-      {
-         if(ossimLine(theVertexList[i], theVertexList[j]).isPointWithin(point))
-         {
-            return true;
-         }
-      }
-   }
-
-   return (c!=0);
-}
-
-//*****************************************************************************
-//  METHOD: ossimPolygon::vertex(int)
-//  
-//  Returns the ossimDpt vertex given the index. Also initializes the current
-//  edge (theCurrentEdge) to the edge corresponding to the index.
-//  
-//*****************************************************************************
-bool ossimPolygon::vertex(int index, ossimDpt& tbd_vertex) const 
-{
-   if((index >= (int)theVertexList.size()) ||
-      (index < 0))
-   {
-      return false;
-   }
-
-   tbd_vertex = theVertexList[index];
-   theCurrentVertex = index;
-
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimPolygon::nextVertex()
-//  
-//  Assigns the ossimDpt tbd_vertex following the current vertex. The current
-//  vertex is initialized with a call to vertex(int), or after the last
-//  vertex is reached (initialized to theFirstEdge. Returns false if no vertex
-//  defined.
-//
-//*****************************************************************************
-bool ossimPolygon::nextVertex(ossimDpt& tbd_vertex) const 
-{
-   ++theCurrentVertex;
-   if(theCurrentVertex >= (ossim_int32)theVertexList.size())
-   {
-      return false;
-   }
-   tbd_vertex = theVertexList[theCurrentVertex];
-   
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: operator=()
-//  
-//*****************************************************************************
-const ossimPolygon& ossimPolygon::operator= (const ossimIrect& rect)
-{
-   theCurrentVertex = 0;
-   theVertexList.resize(4);
-   theVertexList[0] = rect.ul();
-   theVertexList[1] = rect.ur();
-   theVertexList[2] = rect.lr();
-   theVertexList[3] = rect.ll();
-
-   return *this;
-}
-
-const ossimPolygon& ossimPolygon::operator= (const ossimDrect& rect)
-{
-   theCurrentVertex = 0;
-   theVertexList.resize(4);
-   theVertexList[0] = rect.ul();
-   theVertexList[1] = rect.ur();
-   theVertexList[2] = rect.lr();
-   theVertexList[3] = rect.ll();
-
-   return *this;
-}
-
-const ossimPolygon&  ossimPolygon::operator=(const ossimPolygon& polygon)
-{
-   theVertexList    = polygon.theVertexList;
-   theCurrentVertex = polygon.theCurrentVertex;
-   theOrderingType  = polygon.theOrderingType;
-   
-   return *this;
-}
-
-const ossimPolygon& ossimPolygon::operator= (const vector<ossimDpt>& vertexList)
-{
-   theVertexList    = vertexList;
-   theCurrentVertex = 0;
-   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
-   
-   return *this;
-}
-
-const ossimPolygon& ossimPolygon::operator=(const vector<ossimIpt>& vertexList)
-{
-   theVertexList.resize(vertexList.size());
-   
-   // Assign std::vector<ossimIpt> list to std::vector<ossimDpt> theVertexList.
-   for (std::vector<ossimIpt>::size_type i = 0; i < vertexList.size(); ++i)
-   {
-      theVertexList[i] = vertexList[i];
-   }
-   
-   theCurrentVertex = 0;
-   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
-   
-   return *this;
-}
-
-//*****************************************************************************
-//  METHOD: operator==()
-//  
-//*****************************************************************************
-bool ossimPolygon::operator==(const ossimPolygon& polygon) const
-{
-   if( (theVertexList.size() != polygon.theVertexList.size()))
-   {
-      return false;
-   }
-   if(!theVertexList.size() && polygon.theVertexList.size())
-   {
-      return true;
-   }
-
-   return (theVertexList == polygon.theVertexList);
-}
-
-const ossimPolygon& ossimPolygon::operator *=(const ossimDpt& scale)
-{
-   ossim_uint32 upper = (ossim_uint32)theVertexList.size();
-   ossim_uint32 i = 0;
-   for(i = 0; i < upper; ++i)
-   {
-      theVertexList[i].x*=scale.x;
-      theVertexList[i].y*=scale.y;
-   }
-   
-   return *this;
-}
-
-ossimPolygon ossimPolygon::operator *(const ossimDpt& scale)const
-{
-   ossimPolygon result(*this);
-
-   ossim_uint32 upper = (ossim_uint32)theVertexList.size();
-   ossim_uint32 i = 0;
-   for(i = 0; i < upper; ++i)
-   {
-      result.theVertexList[i].x*=scale.x;
-      result.theVertexList[i].y*=scale.y;
-   }
-
-   return result;
-}
-
-
-void ossimPolygon::reverseOrder()
-{
-   std::reverse(theVertexList.begin(), theVertexList.end());
-   
-   if(theOrderingType == OSSIM_COUNTERCLOCKWISE_ORDER)
-   {
-      theOrderingType = OSSIM_CLOCKWISE_ORDER;
-   }
-   else if(theOrderingType == OSSIM_CLOCKWISE_ORDER)
-   {
-      theOrderingType =  OSSIM_COUNTERCLOCKWISE_ORDER;
-   }
-   
-}
-
-//*****************************************************************************
-//  METHOD: ossimPolygon::print(ostream)
-//  
-//*****************************************************************************
-void ossimPolygon::print(ostream& os) const
-{
-   copy(theVertexList.begin(),
-        theVertexList.end(),
-        ostream_iterator<ossimDpt>(os, "\n"));
-}
-
-
-ossimVertexOrdering ossimPolygon::checkOrdering()const
-{
-   if(theOrderingType == OSSIM_VERTEX_ORDER_UNKNOWN)
-   {
-      double areaValue = area();
-      if(areaValue > 0)
-      {
-         theOrderingType = OSSIM_COUNTERCLOCKWISE_ORDER;
-      }
-      else if(areaValue <= 0)
-      {
-         theOrderingType = OSSIM_CLOCKWISE_ORDER;
-      }
-   }
-
-   return theOrderingType;
-}
-
-void ossimPolygon::intersectEdge(ossimDpt& result,
-                                 const ossimLine& segment,
-                                 const ossimDrect& rect,
-                                 int edge)
-{
-   ossimLine edgeLine;
-   switch(edge)
-   {
-   case RECT_LEFT_EDGE:
-   {
-      edgeLine.theP1 = rect.ll();
-      edgeLine.theP2 = rect.ul();
-      break;
-   }
-   case RECT_TOP_EDGE:
-   {
-      edgeLine.theP1 = rect.ul();
-      edgeLine.theP2 = rect.ur();
-      break;
-   }
-   case RECT_RIGHT_EDGE:
-   {
-      edgeLine.theP1 = rect.ur();
-      edgeLine.theP2 = rect.lr();
-      break;
-   }
-   case RECT_BOTTOM_EDGE:
-   {
-      edgeLine.theP1 = rect.lr();
-      edgeLine.theP2 = rect.ll();
-      break;
-   }
-   }
-   
-   result = segment.intersectInfinite(edgeLine);
-}
-
-bool ossimPolygon::isInsideEdge(const ossimDpt& pt,
-                                const ossimDrect& rect,
-                                int edge)const
-{
-   switch(edge)
-   {
-   case RECT_LEFT_EDGE:
-   {
-      return (pt.x>rect.ul().x);
-      break;
-   }
-   case RECT_TOP_EDGE:
-   {
-      if(rect.orientMode() == OSSIM_LEFT_HANDED)
-      {
-         return (pt.y > rect.ul().y);
-      }
-      else
-      {
-         return (pt.y < rect.ul().y);
-      }
-      break;
-   }
-   case RECT_RIGHT_EDGE:
-   {
-      return (pt.x<rect.lr().x);
-      
-      break;
-   }
-   case RECT_BOTTOM_EDGE:
-   {
-      if(rect.orientMode() == OSSIM_LEFT_HANDED)
-      {
-         return (pt.y < rect.lr().y);
-      }
-      else
-      {
-         return (pt.y > rect.lr().y);
-      }
-      break;
-   }
-   }
-   return false;
-}
-
-
-bool ossimPolygon::saveState(ossimKeywordlist& kwl,
-                             const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           "ossimPolygon",
-           true);
-   kwl.add(prefix,
-           NUMBER_VERTICES_KW,
-           static_cast<ossim_uint32>(theVertexList.size()),
-           true);
-   int i = 0;
-   for(i = 0; i < (int)theVertexList.size();++i)
-   {
-      ossimString vert = "v"+ossimString::toString(i);;
-      ossimString value = (ossimString::toString(theVertexList[i].x) + " " +
-                           ossimString::toString(theVertexList[i].y) );
-      kwl.add(prefix,
-              vert.c_str(),
-              value.c_str(),
-              true);
-   }
-   ossimString order = "";
-   
-   switch(theOrderingType)
-   {
-   case OSSIM_VERTEX_ORDER_UNKNOWN:
-   {
-      order = "unknown";
-      break;
-   }
-   case OSSIM_CLOCKWISE_ORDER:
-   {
-      order = "clockwise";
-      break;
-   }
-   case OSSIM_COUNTERCLOCKWISE_ORDER:
-   {
-      order = "counter_clockwise";
-      break;
-   }
-   }
-   kwl.add(prefix,
-           VERTEX_ORDER_KW,
-           order,
-           true);
-
-   return true;
-}
-   
-bool ossimPolygon::loadState(const ossimKeywordlist& kwl,
-                             const char* prefix)
-{
-   ossimString order = kwl.find(prefix, VERTEX_ORDER_KW);
-   const char* number_vertices = kwl.find(prefix, NUMBER_VERTICES_KW);
-   ossimString x,y;
-   if(order=="unknown")
-   {
-      theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
-   }
-   else if(order =="clockwise")
-   {
-      theOrderingType = OSSIM_CLOCKWISE_ORDER;
-   }
-   else if(order =="counter_clockwise")
-   {
-      theOrderingType = OSSIM_COUNTERCLOCKWISE_ORDER;
-   }
-
-   theVertexList.clear();
-   int vertexCount = ossimString(number_vertices).toLong();
-   int i = 0;
-   for(i = 0; i < vertexCount; ++i)
-   {
-      ossimString v = kwl.find(prefix, (ossimString("v")+ossimString::toString(i)).c_str());
-      v = v.trim();
-
-      istringstream vStream(v.string());
-      vStream >> x.string() >> y.string();
-      theVertexList.push_back(ossimDpt(x.toDouble(),y.toDouble()));
-   }
-
-   return true;
-}
-
-void ossimPolygon::getMinimumBoundingRect(ossimPolygon& minRect) const
-{
-   static const double MIN_STEP = (0.5)*M_PI/180.0;
-   double angle_step = M_PI/8.0;  // initial rotation step size for min area search = 22.5 deg
-   double theta;
-   double best_theta = M_PI/4.0;  // Initial guess is 45 deg orientation
-   double center_theta;
-   double cos_theta, sin_theta;
-   ossimPolygon rotatedPolygon(*this);
-   ossimDpt xlatedVertex;
-   ossimDpt rotatedVertex(0.0, 0.0);
-   double min_x, min_y, max_x, max_y;
-   double area;
-   double min_area = 1.0/DBL_EPSILON;
-   rotatedPolygon.theVertexList[0] = ossimDpt(0, 0);  // first vertex always at origin
-   bool first_time = true;
-   ossimDrect best_rect;
-   static const bool TESTING = false;
-
-   //***
-   // Loop to converge on best orientation angle for bounding polygon:
-   //***
-   while (angle_step > MIN_STEP)
-   {
-      //***
-      // Try four different rotations evenly centered about the current best guess:
-      //***
-      center_theta = best_theta;
-      for (int i=0; i<5; i++)
-      {
-         //***
-         // Check for i=2 (center angle) since already computed quantities for this in last iteration
-         // unless this is first time through:
-         //***
-         if ((i != 2) || (first_time)) 
-         {
-            theta = center_theta + (i - 2.0)*angle_step;
-            cos_theta = cos(theta);
-            sin_theta = sin(theta);
-            min_x = rotatedPolygon.theVertexList[0].x;
-            min_y = rotatedPolygon.theVertexList[0].y;
-            max_x = min_x;
-            max_y = min_y;
-
-            //***
-            // Translate polygon to origin and rotate all vertices by current theta:
-            //***
-            for (unsigned int vertex=1; vertex < theVertexList.size(); vertex++)
-            {
-               xlatedVertex.x = theVertexList[vertex].x - theVertexList[0].x;
-               xlatedVertex.y = theVertexList[vertex].y - theVertexList[0].y;
-               rotatedVertex.x = cos_theta*xlatedVertex.x + sin_theta*xlatedVertex.y;
-               rotatedVertex.y = cos_theta*xlatedVertex.y - sin_theta*xlatedVertex.x;
-               rotatedPolygon.theVertexList[vertex] = rotatedVertex;
-
-               //***
-               // Latch max and mins of bounding rect:
-               //***
-               if (min_x > rotatedVertex.x) min_x = rotatedVertex.x;
-               if (min_y > rotatedVertex.y) min_y = rotatedVertex.y;
-               if (max_x < rotatedVertex.x) max_x = rotatedVertex.x;
-               if (max_y < rotatedVertex.y) max_y = rotatedVertex.y;
-            }
-
-            if (TESTING)
-            {
-               ossimDpt v1 (cos_theta*min_x - sin_theta*max_y + theVertexList[0].x,
-                            cos_theta*max_y + sin_theta*min_x + theVertexList[0].y);
-               ossimDpt v2 (cos_theta*max_x - sin_theta*max_y + theVertexList[0].x,
-                            cos_theta*max_y + sin_theta*max_x + theVertexList[0].y);
-               ossimDpt v3 (cos_theta*max_x - sin_theta*min_y + theVertexList[0].x,
-                            cos_theta*min_y + sin_theta*max_x + theVertexList[0].y);
-               ossimDpt v4 (cos_theta*min_x - sin_theta*min_y + theVertexList[0].x,
-                            cos_theta*min_y + sin_theta*min_x + theVertexList[0].y);
-               cout << v1.x << "\t" << v1.y << endl;
-               cout << v2.x << "\t" << v2.y << endl;
-               cout << v3.x << "\t" << v3.y << endl;
-               cout << v4.x << "\t" << v4.y << endl << endl;
-            }
-
-            //***
-            // Establish bounding rect and area about rotated polygon:
-            //***
-            area = (max_x - min_x) * (max_y - min_y);
-            if (area < min_area)
-            {
-               best_theta = theta;
-               min_area = area;
-               best_rect = ossimDrect(min_x, max_y, max_x, min_y, OSSIM_RIGHT_HANDED);
-            }
-         } // end if (i != 2 || first_time)
-      }  // end for-loop over surrounding rotations
-
-      //***
-      // Adjust step size by half to repeat process:
-      //***
-      angle_step /= 2.0;
-      first_time = false;
-
-   } // end while loop for convergence
-
-   //***
-   // best_theta now contains optimum rotation of bounding rect. Need to apply reverse
-   // rotation and translation of best_rect:
-   //***
-   cos_theta = cos(best_theta);
-   sin_theta = sin(best_theta);
-   ossimDpt v1 (cos_theta*best_rect.ul().x - sin_theta*best_rect.ul().y + theVertexList[0].x,
-                cos_theta*best_rect.ul().y + sin_theta*best_rect.ul().x + theVertexList[0].y);
-   ossimDpt v2 (cos_theta*best_rect.ur().x - sin_theta*best_rect.ur().y + theVertexList[0].x,
-                cos_theta*best_rect.ur().y + sin_theta*best_rect.ur().x + theVertexList[0].y);
-   ossimDpt v3 (cos_theta*best_rect.lr().x - sin_theta*best_rect.lr().y + theVertexList[0].x,
-                cos_theta*best_rect.lr().y + sin_theta*best_rect.lr().x + theVertexList[0].y);
-   ossimDpt v4 (cos_theta*best_rect.ll().x - sin_theta*best_rect.ll().y + theVertexList[0].x,
-                cos_theta*best_rect.ll().y + sin_theta*best_rect.ll().x + theVertexList[0].y);
-    
-   if (TESTING)
-   {
-      cout << v1.x << "\t" << v1.y << endl;
-      cout << v2.x << "\t" << v2.y << endl;
-      cout << v3.x << "\t" << v3.y << endl;
-      cout << v4.x << "\t" << v4.y << endl << endl;
-   }
-
-   //***
-   // Assign return value rect:
-   //***
-   minRect.clear();
-   minRect.addPoint(v1);
-   minRect.addPoint(v2);
-   minRect.addPoint(v3);
-   minRect.addPoint(v4);
-
-   // Make sure we are always returning a positive clockwise area.
-   minRect.checkOrdering();
-   if(minRect.getOrdering()==OSSIM_COUNTERCLOCKWISE_ORDER)
-      minRect.reverseOrder();
-   return;
-}
-
-/**
-* METHOD: remove() 
-* Removes the vertex from the polygon.
-*/
-void ossimPolygon::removeVertex(int vertex)
-{
-   int numvertices=getNumberOfVertices();
-   if(vertex>numvertices) {
-      return;
-   } else {
-      vector<ossimDpt>::iterator it;
-      int v=0;
-      for(it=theVertexList.begin();it!=theVertexList.end();it++) {
-         if(v++==vertex) {
-            theVertexList.erase(it);
-            break;
-         }
-      }
-   }
-}
-
-/**
-* METHOD: removeSmallestContributingVertex() 
-* Removes the vertex that contributes the smallest area to the polygon.
-*/
-void ossimPolygon::removeSmallestContributingVertex()
-{
-   unsigned int numvertices=getNumberOfVertices();
-   if (!numvertices)
-      return;
-
-   int smallest_vertex=-1,n1,n2;
-   double smallest_area=1.0/DBL_EPSILON;
-   ossimPolygon tmp;
-
-   for(unsigned int v=0;v<numvertices;v++) {
-      tmp.clear();
-      if(v==0) {
-         n1=numvertices-1;
-         n2=1;
-      } else if(v==numvertices-1) {
-         n1=numvertices-2;
-         n2=0;
-      } else {
-         n1=v-1;
-         n2=v+1;
-      }
-
-      tmp.addPoint(theVertexList[n1]);
-      tmp.addPoint(theVertexList[v]);
-      tmp.addPoint(theVertexList[n2]);
-
-      if(fabs(tmp.area())<smallest_area) {
-         smallest_area=fabs(tmp.area());
-         smallest_vertex=v;
-      }
-   }
-   removeVertex(smallest_vertex);
-}
-
-
-ossimDpt& ossimPolygon::operator[](int index)
-{
-   return theVertexList[index];
-}
-
-const ossimDpt& ossimPolygon::operator[](int index)const
-{
-   return theVertexList[index];
-}
-
-ossim_uint32 ossimPolygon::getVertexCount()const
-{
-   return getNumberOfVertices();
-}
-
-ossim_uint32 ossimPolygon::getNumberOfVertices()const
-{
-   return (ossim_uint32)theVertexList.size();
-}
-
-void ossimPolygon::getBoundingRect(ossimIrect& rect)const
-{
-   ossim_int32 minX;
-   ossim_int32 minY;
-   ossim_int32 maxX;
-   ossim_int32 maxY;
-   getIntegerBounds(minX, minY, maxX, maxY);
-   rect = ossimIrect(minX, minY, maxX, maxY);
-}
-
-void ossimPolygon::getBoundingRect(ossimDrect& rect)const
-{
-   ossim_float64 minX;
-   ossim_float64 minY;
-   ossim_float64 maxX;
-   ossim_float64 maxY;
-   getFloatBounds(minX, minY, maxX, maxY);
-   rect = ossimDrect(minX, minY, maxX, maxY);
-}
-
-void ossimPolygon::clear()
-{
-   theVertexList.clear();
-   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
-}
-
-void ossimPolygon::addPoint(const ossimDpt& pt)
-{
-   theVertexList.push_back(pt);
-   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
-}
-
-void ossimPolygon::addPoint(double x, double y)
-{
-   theVertexList.push_back(ossimDpt(x, y));
-   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
-}
-
-const vector<ossimDpt>& ossimPolygon::getVertexList()const
-{
-   return theVertexList;
-}
-
- bool ossimPolygon::pointWithin(const ossimDpt& point) const
-{
-   return isPointWithin(point);
-}
-
-const ossimPolygon& ossimPolygon::operator *=(double scale)
-{
-   return ((*this)*=ossimDpt(scale, scale));
-}
-
-ossimPolygon ossimPolygon::operator *(double scale)const
-{
-   return ((*this)*ossimDpt(scale, scale));
-}
-
-void ossimPolygon::resize(ossim_uint32 newSize)
-{
-   theVertexList.resize(newSize);
-   theOrderingType  = OSSIM_VERTEX_ORDER_UNKNOWN;
-   theCurrentVertex = 0;
-}
-
-ossimVertexOrdering ossimPolygon::getOrdering()const
-{
-   return theOrderingType;
-}
-
-bool ossimPolygon::operator!=(const ossimPolygon& compare_this) const
-{
-   return !(*this == compare_this);
-}
-
-ostream& operator<<(ostream& os, const ossimPolygon& polygon)
-{
-   polygon.print(os);
-   return os;
-}
-
-/**
-* METHOD: getCentroid() 
-* Assigns the ossimDpt centroid the polygon.
-* Warning: centroid is not guaranteed to be inside the polygon!
-*/
-void ossimPolygon::getCentroid(ossimDpt &centroid) const
-{
-   int numpts = (int)theVertexList.size();
-   unsigned int next;
-   double area=0,parea;
-
-   centroid=ossimDpt(0,0);
-   for(int i=0;i<numpts;i++) {
-      if(i<numpts-1) {
-         next=i+1;
-      } else {
-         next=0;
-      }
-      parea=theVertexList[i].x*theVertexList[next].y-theVertexList[next].x*theVertexList[i].y;
-      area+=parea;
-      centroid.x+=(theVertexList[i].x+theVertexList[next].x)*parea;
-      centroid.y+=(theVertexList[i].y+theVertexList[next].y)*parea;
-   }
-   area=area/2.0;
-   centroid=centroid/(area*6.0);
-}
-
-/**
-* METHOD: fitCircleInsideVertex() 
-* Assigns destPt the point that fits a circle of given radius inside the polygon vertex.
-* Warning: destPt is not guaranteed to be inside the polygon!
-* (you may not be able to fit a circle of the given radius inside the polygon)
-*/
-void ossimPolygon::fitCircleInsideVertex(ossimDpt &destPt, unsigned int vertex, double radius) const
-{
-   ossim_uint32 num_vertices=(int)theVertexList.size(),n1,n2;
-   ossimDpt side1,side2,bisection,currpt;
-   double length_out,side1_side2_cross;
-   bool concave=true;
-
-   // don't be doing that dude.
-   if(num_vertices<3 || vertex>=num_vertices) {
-      destPt=ossimDpt(0,0);
-      return;
-   }
- 
-   if(vertex==0) {
-      n1=num_vertices-1;
-      n2=vertex+1;
-   } else if(vertex==num_vertices-1) {
-      n1=num_vertices-2;
-      n2=0;
-   } else {
-      n1=vertex-1;
-      n2=vertex+1;
-   }
-
-   currpt=theVertexList[vertex];
-   // get the side vectors
-   side1=theVertexList[n1]-currpt;
-   side2=theVertexList[n2]-currpt;
-
-   // normalize the sides
-   side1 = side1/side1.length();
-   side2 = side2/side2.length();
-
-   side1_side2_cross=side1.x*side2.y-side2.x*side1.y;
-
-   checkOrdering();
-   if(getOrdering()==OSSIM_COUNTERCLOCKWISE_ORDER) {
-      if(side1_side2_cross<0)
-         concave=false;
-   } else { //clockwise
-      if(side1_side2_cross>0)
-         concave=false;
-   }
-
-   bisection = side1+side2;
-   bisection = bisection/bisection.length();
-
-   if(concave) {
-      bisection=bisection*-1.0;
-      length_out=radius;
-   } else {
-      double cos_theta=(side1.x*bisection.x+side1.y*bisection.y);
-      length_out=radius/sqrt(1-cos_theta*cos_theta);
-   }
-   destPt=ossimDpt(currpt+bisection*length_out);
-   return;
-}
-
-
-/**
-//! Shrinks this polygon by radius. Effectively, circles of given radius are placed inside 
-//! the vertices just tangent to the polygon edges (via fitCircleInsideVertex()). The new
-//! polygon's vertices will be the center of these circles. Return true if success. 
-*/
-bool ossimPolygon::shrink(ossimPolygon &dest, double inset) const 
-{
-   int numpts = (int) theVertexList.size();
-   ossimDpt pt;
-   
-   //don't let people shrink themselves, that isn't going to work
-   if(&dest==this) return false;
-
-   dest.clear();
-   for(int i=0;i<numpts;i++) {
-      fitCircleInsideVertex(pt,i,inset);
-      dest.addPoint(pt);
-   }
-   if(isPolyWithin(dest)) {
-      return true;
-   } else {
-      //return an empty polygon
-      dest=ossimPolygon();
-      return false;
-   }
-}
-
-
-
-
diff --git a/ossim/src/ossim/base/ossimPreferences.cpp b/ossim/src/ossim/base/ossimPreferences.cpp
deleted file mode 100644
index 605a010..0000000
--- a/ossim/src/ossim/base/ossimPreferences.cpp
+++ /dev/null
@@ -1,274 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// DESCRIPTION:
-//   Contains implementation of class ossimPreferences. This class provides
-//   a static keywordlist for global preferences. Objects needing access to
-//   application-wide global parameters shall do so through this class.
-//
-// SOFTWARE HISTORY:
-//>
-//   23Apr2001  Oscar Kramer (okramer at imagelinks.com)
-//              Initial coding.
-//<
-//*****************************************************************************
-
-#include <cstdlib> /* for getenv() */
-
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimNotify.h>
-
-//RTTI_DEF1(ossimPreferences, "ossimPreferences" , ossimObject)
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimPreferences:exec");
-static ossimTrace traceDebug ("ossimPreferences:debug");
-
-static const char* PREF_FILE_ENV_VAR_NAME = "OSSIM_PREFS_FILE";
-
-ossimPreferences* ossimPreferences::theInstance = NULL;
-
-ossimPreferences::ossimPreferences()
-{
-   /*!
-    * If $(env_var_name) is found in the preferences file, 
-    * expand it in place.
-    */
-   theKWL.setExpandEnvVarsFlag( true );
-
-   loadPreferences();
-}
-
-ossimPreferences::~ossimPreferences()
-{
-        theInstance = NULL;
-}
-
-/*!****************************************************************************
- * METHOD: ossimPreferences::instance()
- *  
- *  This is the method by which run-time objects access this singleton instance
- *  
- *****************************************************************************/
-ossimPreferences* ossimPreferences::instance()
-{
-   /*!
-    * Simply return the instance if already created:
-    */
-   if (theInstance)
-      return theInstance;
-
-   /*!
-    * Create the static instance of this class:
-    */
-   theInstance = new ossimPreferences();
-
-   return theInstance;
-}
-
-/*!****************************************************************************
- * METHOD: loadPreferences()
- *  
- *  Loads the preferences file specified in the runtime environment.
- *  
- *****************************************************************************/
-bool ossimPreferences::loadPreferences()
-{
-   static const char MODULE[] = "ossimPreferences::loadPreferences()";
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: " << MODULE << " entering...\n";
-   }
-
-   bool parsed_ok = false;
-   
-   /*!
-    * Fetch preferences file name from environment:
-    */
-   char* pref_filename = getenv(PREF_FILE_ENV_VAR_NAME);
-
-   if (pref_filename)
-   {
-      /*!
-       * Load the preferences file into the static keywordlist object:
-       */
-      thePrefFilename = pref_filename;
-      parsed_ok = theKWL.addFile(pref_filename);
-
-      /*!
-       * Check for error opening KWL:
-       */
-      if (!parsed_ok)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING: " << MODULE
-            << ", an error was encountered loading the prefererences "
-            << "file at \"" << thePrefFilename << "\" as specified by the "
-            << "environment variable \"" << PREF_FILE_ENV_VAR_NAME << "\"."
-            << "Preferences were not loaded.\n";
-      }
-   }
-
-//   else
-//   {
-//       if (traceDebug())
-//       {
-//          // No ENV var found. Print warning:
-//          CLOG << "WARNING: the preferences file environment variable \""
-//               << PREF_FILE_ENV_VAR_NAME << "\" is not defined. No preferences "
-//               << "were loaded. The environment variable should be set to "
-//               << "the full path to the preferences keywordlist file desired."
-//               << endl;
-//       }
-//   }
-   
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: " << MODULE << "returning...\n";
-   }
-   return parsed_ok;
-}
-
-/*!****************************************************************************
- * METHOD: loadPreferences(filename)
- *  
- *  Loads the preferences file specified in the arg.
- *  
- *****************************************************************************/
-bool ossimPreferences::loadPreferences(const ossimFilename& pathname)
-{
-   static const char MODULE[] = "ossimPreferences::loadPreferences(filename)";
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: " << MODULE << ", entering...\n";
-   }
-
-   bool parsed_ok;
-
-   /*!
-    * First clear the existing KWL:
-    */
-   theKWL.clear();
-   theInstanceIsModified = true;
-   
-   /*!
-    * Load the preferences file into the static keywordlist object:
-    */
-   thePrefFilename = pathname;
-   parsed_ok = theKWL.addFile(pathname);
-
-   /*!
-    * Check for error opening KWL:
-    */
-   if (!parsed_ok)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "WARNING: " << MODULE
-         << ", an error was encountered loading the prefererences "
-         << "file at \"" << pathname << "\". Preferences were not "
-         << "loaded.\n";
-   }
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: " << MODULE<< ", returning...\n";
-   }
-   
-   return parsed_ok;
-}
-
-/*!****************************************************************************
- * METHOD: ossimPreferences::savePreferences()
- *  
- *  Saves KWL to the current filename.
- *  
- *****************************************************************************/
-bool ossimPreferences::savePreferences() const
-{
-   static const char MODULE[] = "ossimPreferences::savePreferences()";
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: " << MODULE << ", entering...\n";
-   }
-   
-   bool success = true;
-   
-   /*!
-    * Save the file to current preferences filename:
-    */
-   if (theInstanceIsModified)
-   {
-      theKWL.write(thePrefFilename);
-      theInstanceIsModified = false;
-   }
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG:" << MODULE << ", returning...\n";
-   }
-   
-   return success;
-}
-
-/*!****************************************************************************
- * METHOD: ossimPreferences::savePreferences(filename)
- *  
- *  Saves KWL to the specified filename.
- *  
- *****************************************************************************/
-bool ossimPreferences::savePreferences(const ossimFilename& pathname)
-{
-   static const char MODULE[] = "ossimPreferences::savePreferences()";
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: "<< MODULE << ", entering...\n";
-   }
-   
-   bool success = true;
-   
-   /*!
-    * Save the file to the specified preferences filename:
-    */
-   theKWL.write(pathname);
-
-   thePrefFilename = pathname;
-   theInstanceIsModified = false;
-   
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: " << MODULE << ", returning...\n";
-   }
-   
-   return success;
-}
-
-void ossimPreferences::addPreference(const char* key, const char* value)
-{
-   theKWL.add(key, value, true);
-   theInstanceIsModified = true;
-}
-
-void ossimPreferences::addPreferences(const ossimKeywordlist& kwl,
-                                      const char* prefix,
-                                      bool stripPrefix)
-{
-   theKWL.add(kwl, prefix, stripPrefix);
-   theInstanceIsModified = true;
-}
-
-ossimFilename ossimPreferences::getPreferencesFilename() const
-{
-   return thePrefFilename;
-}
diff --git a/ossim/src/ossim/base/ossimProcessInterface.cpp b/ossim/src/ossim/base/ossimProcessInterface.cpp
deleted file mode 100644
index b06f82a..0000000
--- a/ossim/src/ossim/base/ossimProcessInterface.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimProcessInterface.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ostream>
-
-#include <ossim/base/ossimProcessInterface.h>
-#include <ossim/base/ossimListenerManager.h>
-
-RTTI_DEF(ossimProcessInterface, "ossimProcessInterface");
-
-ossimProcessInterface::ossimProcessInterface()
-   :thePercentComplete(0.0),
-    theProcessStatus(PROCESS_STATUS_NOT_EXECUTING),
-    theMessage(""),
-    theEventFlag(true)
-{
-}
-
-ossimProcessInterface::~ossimProcessInterface()
-{
-}
-
-void ossimProcessInterface::abort()
-{
-   if(theProcessStatus == PROCESS_STATUS_EXECUTING)
-   {
-      setProcessStatus(PROCESS_STATUS_ABORT_REQUEST);
-   }
-}
-
-bool ossimProcessInterface::needsAborting() const
-{
-   return ( isAborted()|| isAbortRequested() );
-}
-
-bool ossimProcessInterface::isAbortRequested()const
-{
-   return (theProcessStatus == PROCESS_STATUS_ABORT_REQUEST);
-}
-
-bool ossimProcessInterface::isAborted()const
-{
-   return (theProcessStatus==PROCESS_STATUS_ABORTED);
-}
-
-bool ossimProcessInterface::isExecuting()const
-{
-   return ((theProcessStatus==PROCESS_STATUS_EXECUTING)||
-           (theProcessStatus==PROCESS_STATUS_ABORT_REQUEST));
-}
-
-ossimProcessInterface::ossimProcessStatus ossimProcessInterface::getProcessStatus()const
-{
-   return theProcessStatus;
-}
-
-void ossimProcessInterface::setProcessStatus(ossimProcessStatus processStatus)
-{
-   theProcessStatus = processStatus;
-}
-
-double ossimProcessInterface::getPercentComplete()const
-{
-   return thePercentComplete;
-}
-
-void ossimProcessInterface::setPercentComplete(double percentComplete)
-{
-   thePercentComplete = percentComplete;
-
-   ossimListenerManager* manager = getManager();
-   if(theEventFlag&&manager)
-   {
-      ossimProcessProgressEvent event(getObject(),
-                                      thePercentComplete,
-                                      theMessage,
-                                      false);
-      manager->fireEvent(event);
-   }
-}
-
-ossimListenerManager* ossimProcessInterface::getManager()
-{
-   return PTR_CAST(ossimListenerManager, getObject());
-}
-
-void ossimProcessInterface::enableEvents()
-{
-   theEventFlag = true;
-}
-   
-void ossimProcessInterface::disableEvents()
-{
-   theEventFlag = false;
-}
-
-void ossimProcessInterface::setCurrentMessage(const ossimString& message)
-{
-   theMessage = message;
-
-   ossimListenerManager* manager = getManager();
-   if(theEventFlag&&manager)
-   {
-      ossimProcessProgressEvent event(getObject(),
-                                      thePercentComplete,
-                                      theMessage,
-                                      true);
-      manager->fireEvent(event);
-   }   
-}
-
-std::ostream& ossimProcessInterface::print(std::ostream& out) const
-{
-   out << "process status: ";
-   if(theProcessStatus == PROCESS_STATUS_EXECUTING)
-   {
-      out << "executing" << std::endl;
-   }
-   else if(theProcessStatus == PROCESS_STATUS_ABORTED)
-   {
-      out << "aborted" << std::endl;
-   }
-   else if(theProcessStatus == PROCESS_STATUS_NOT_EXECUTING)
-   {
-      out << "not executing" << std::endl;
-   }
-   out << "percent_complete: " << thePercentComplete;
-   
-   return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimProcessInterface& data)
-{
-   return data.print(out);
-}
-
diff --git a/ossim/src/ossim/base/ossimProcessListener.cpp b/ossim/src/ossim/base/ossimProcessListener.cpp
deleted file mode 100644
index 379a7e5..0000000
--- a/ossim/src/ossim/base/ossimProcessListener.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// $Id: ossimProcessListener.cpp 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimProcessListener.h>
-#include <ossim/base/ossimProcessProgressEvent.h>
-
-RTTI_DEF1(ossimProcessListener, "ossimProcessListener", ossimListener);
-
-ossimProcessListener::ossimProcessListener()
-   : ossimListener()
-{}
-
-ossimProcessListener::~ossimProcessListener()
-{}
-
-void ossimProcessListener::processEvent(ossimEvent& event)
-{
-   switch(event.getId())
-   {
-   case OSSIM_EVENT_PROCESS_PROGRESS_ID:
-   {
-      ossimProcessProgressEvent* eventCast = static_cast<ossimProcessProgressEvent*>(&event);
-      processProgressEvent(*eventCast);
-      break;
-   }
-   default:
-   {
-      ossimListener::processEvent(event);
-      break;
-   }
-   }
-}
-
-void ossimProcessListener::processProgressEvent(ossimProcessProgressEvent& /* event */ )
-{}
-
diff --git a/ossim/src/ossim/base/ossimProcessProgressEvent.cpp b/ossim/src/ossim/base/ossimProcessProgressEvent.cpp
deleted file mode 100644
index 5018a38..0000000
--- a/ossim/src/ossim/base/ossimProcessProgressEvent.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description: Event for process progress.
-//
-// $Id: ossimProcessProgressEvent.cpp 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-#include <ossim/base/ossimProcessProgressEvent.h>
-
-RTTI_DEF1(ossimProcessProgressEvent, "ossimProcessProgressEvent", ossimEvent);
-
-ossimProcessProgressEvent::ossimProcessProgressEvent(ossimObject* owner,
-                                                     double percentComplete,
-                                                     const ossimString message,
-                                                     bool outputMessageFlag)
-   :
-      ossimEvent(owner, OSSIM_EVENT_PROCESS_PROGRESS_ID),
-      thePercentComplete(percentComplete),
-      theMessage(message),
-      theOutputMessageFlag(outputMessageFlag)
-{
-}
-
-ossimObject* ossimProcessProgressEvent::dup()const
-{
-   return new ossimProcessProgressEvent(*this);
-}
-
-double ossimProcessProgressEvent::getPercentComplete()const
-{
-   return thePercentComplete;
-}
-   
-ossimString ossimProcessProgressEvent::getMessage()const
-{
-   return theMessage;
-}
-
-void ossimProcessProgressEvent::getMessage(ossimString& message)const
-{
-   message = theMessage;
-}
-   
-void ossimProcessProgressEvent::setPercentComplete(double percentComplete)
-{
-   thePercentComplete = percentComplete;
-}
-
-void ossimProcessProgressEvent::setMessage(const ossimString& message)
-{
-   theMessage = message;
-}
-
-void ossimProcessProgressEvent::setOutputMessageFlag(bool flag)
-{
-   theOutputMessageFlag = flag;
-}
-
-bool ossimProcessProgressEvent::getOutputMessageFlag() const
-{
-   return theOutputMessageFlag;
-}
-
diff --git a/ossim/src/ossim/base/ossimROIEventListener.cpp b/ossim/src/ossim/base/ossimROIEventListener.cpp
deleted file mode 100644
index 3d2f8ac..0000000
--- a/ossim/src/ossim/base/ossimROIEventListener.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <ossim/base/ossimROIEventListener.h>
-#include <ossim/base/ossimROIEvent.h>
-
-
-RTTI_DEF1(ossimROIEventListener, "ossimROIEventListener", ossimListener);
-
-void ossimROIEventListener::processEvent(ossimEvent& event)
-{
-   if(event.isConsumed()) return;
-   
-   ossimROIEvent* roiEvent = PTR_CAST(ossimROIEvent,
-                                      &event);
-   
-   if(roiEvent)
-   {
-      const int type = roiEvent->getEventType();
-      
-      switch ( type )
-      {
-      case ossimROIEvent::OSSIM_RECTANGLE_ROI:
-         handleRectangleROIEvent( *roiEvent );
-         break;
-
-      case ossimROIEvent::OSSIM_POLYGON_ROI:
-         handlePolygonROIEvent( *roiEvent );
-         break;
-
-
-      case ossimROIEvent::OSSIM_POLYLINE_ROI:
-         handlePolylineROIEvent( *roiEvent );
-         break;
-
-         default:
-         break;
-      }
-   }
-}
-
-void ossimROIEventListener::handleRectangleROIEvent( ossimROIEvent& /* event */)
-{
-}
-
-void ossimROIEventListener::handlePolygonROIEvent( ossimROIEvent& /* event */)
-{
-}
-
-void ossimROIEventListener::handlePolylineROIEvent( ossimROIEvent& /* event */)
-{
-}
diff --git a/ossim/src/ossim/base/ossimRectanglePartitioner.cpp b/ossim/src/ossim/base/ossimRectanglePartitioner.cpp
deleted file mode 100644
index e598600..0000000
--- a/ossim/src/ossim/base/ossimRectanglePartitioner.cpp
+++ /dev/null
@@ -1,249 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2004 David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// Utility class to partition up a rectangle.
-//
-// $Id: ossimRectanglePartitioner.cpp 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimRectanglePartitioner.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTrace.h>
-using namespace std;
-
-static ossimTrace traceDebug("ossimRectanglePartitioner:degug");
-
-ossimRectanglePartitioner::ossimRectanglePartitioner()
-{
-}
-
-ossimRectanglePartitioner::~ossimRectanglePartitioner()
-{
-}
-
-void ossimRectanglePartitioner::binaryPartition(
-   const ossimIrect& inputRectangle,
-   vector<ossimIrect>& result,
-   ossim_uint64 maxSizeInBytes,
-   ossim_uint32 bands,
-   ossim_uint32 bytesPerPixel,
-   ossim_uint32 internalOverlapPixels) const
-{
-   // Clear the result rect for starters.
-   result.clear();
-
-   // Some sanity checks.
-   if (maxSizeInBytes == 0)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Waning:  0 passed for max size in bytes.  Returning..."
-         << endl;
-      return;
-   }
-   if (bands == 0)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Waning:  0 passed for number of bands.  Returning..."
-         << endl;
-      return;
-   }
-   if (bytesPerPixel == 0)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Waning:  0 passed for bytes per pixel.  Returning..."
-         << endl;
-      return;
-   }
-   if (inputRectangle.hasNans())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Waning:  Input rectangle has nans in it!  Returning..."
-         << endl;
-      return;
-   }
-   if ( (maxSizeInBytes / (bands*bytesPerPixel)) < 4)
-   {
-      // Come on now you have to have at least four pixels.
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Waning:  Max size in bytes too small.  Returning..."
-         << endl;
-      return;
-   }
-   // End of sanity checks...
-
-   // Check the size... We could already be there.
-   if (getSize(inputRectangle, bands, bytesPerPixel) <= maxSizeInBytes)
-   {
-      result.push_back(inputRectangle);
-
-      if (traceDebug())
-      {
-         trace(inputRectangle, result, maxSizeInBytes, bands, bytesPerPixel);
-      }
-      
-      return;
-   }   
-
-   // OK, find the rectangle size that gets that will fit the max size.
-   ossimIrect tileRect = inputRectangle;
-   
-   splitUntilLessThanMax(tileRect,
-                         maxSizeInBytes,
-                         bands,
-                         bytesPerPixel,
-                         internalOverlapPixels);
-
-   ossim_int32 input_width  = static_cast<ossim_int32>(inputRectangle.width());
-   ossim_int32 input_height = static_cast<ossim_int32>(inputRectangle.height());
-
-   ossim_int32 tile_width   = static_cast<ossim_int32>(tileRect.width());
-   ossim_int32 tile_height  = static_cast<ossim_int32>(tileRect.height());
-
-   ossim_int32 tiles_wide   = (input_width % tile_width) ?
-      ( (input_width/tile_width)+1) : (input_width/tile_width);
-   ossim_int32 tiles_high   = (input_height % tile_height) ?
-      ( (input_height/tile_height)+1) : (input_height/tile_height);
-
-   ossim_int32 y_start = inputRectangle.ul().y;
-   ossim_int32 y_stop  = y_start + tile_height - 1 + internalOverlapPixels;
-
-   for (ossim_int32 y = 0; y < tiles_high; ++y)
-   {
-      // Clip to bottom if needed.
-      if (y_stop > inputRectangle.lr().y)
-      {
-         y_stop = inputRectangle.lr().y;
-      }
-      
-      ossim_int32 x_start = inputRectangle.ul().x;
-      ossim_int32 x_stop  = x_start + tile_width - 1 + internalOverlapPixels;
-      
-      for (ossim_int32 x = 0; x < tiles_wide; ++x)
-      {
-         // Clip to right edge is needed.
-         if (x_stop > inputRectangle.lr().x)
-         {
-            x_stop = inputRectangle.lr().x;
-         }
-
-         ossimIrect r(x_start, y_start, x_stop, y_stop);
-
-         // Add it to the result.
-         result.push_back(r);
-         
-         if( 0 == x )
-         {
-            x_start += tile_width - internalOverlapPixels;
-         }
-         else
-         {
-            x_start += tile_width;
-         }
-         x_stop  += tile_width;
-         
-      } // End of tiles_wide loop.
-      
-      if( 0 == y )
-      {
-         y_start += tile_height - internalOverlapPixels;
-      }
-      else
-      {
-         y_start += tile_height;
-      }
-      y_stop  += tile_height;
-      
-   } // End of tiles_high loop.
-   
-   if (traceDebug())
-   {
-      trace(inputRectangle, result, maxSizeInBytes, bands, bytesPerPixel);
-   }
-}
-
-void ossimRectanglePartitioner::splitUntilLessThanMax(
-   ossimIrect& rect,
-   ossim_uint64 maxSizeInBytes,
-   ossim_uint32 bands,
-   ossim_uint32 bytesPerPixel,
-   ossim_uint32 internalOverlapPixels) const
-{
-   do
-   {
-      splitRect(rect);
-
-   } while ( getSize(rect,
-                     bands,
-                     bytesPerPixel,
-                     internalOverlapPixels) > maxSizeInBytes );
-}
-
-void ossimRectanglePartitioner::splitRect(ossimIrect& rect) const
-{
-   ossim_int32 width  = static_cast<ossim_int32>(rect.width());
-   ossim_int32 height = static_cast<ossim_int32>(rect.height());
-   ossim_int32 new_width;
-   ossim_int32 new_height;
-   
-   if (height > width)
-   {
-      new_width  = width;
-      new_height = (height % 2) ? ( (height/2) + 1 ) : (height/2);
-   }
-   else
-   {
-      new_width  = (width % 2) ? ( (width/2) + 1) : (width/2);
-      new_height = height;
-   }
-   
-   rect = ossimIrect(0, 0, new_width-1, new_height-1);
-}
-
-ossim_uint64 ossimRectanglePartitioner::getSize(
-   const ossimIrect& rect,
-   ossim_uint32 bands,
-   ossim_uint32 bytesPerPixel,
-   ossim_uint32 internalOverlapPixels) const
-{
-   return( ( rect.width()  + 2 * internalOverlapPixels ) *
-           ( rect.height() + 2 * internalOverlapPixels ) *
-           bands * bytesPerPixel );
-}
-
-void ossimRectanglePartitioner::trace(const ossimIrect& r,
-                                      const std::vector<ossimIrect>& v,
-                                      ossim_uint64 maxSizeInBytes,
-                                      ossim_uint32 bands,
-                                      ossim_uint32 bytesPerPixel) const
-{
-   ossimNotify(ossimNotifyLevel_DEBUG)
-      << "ossimRectanglePartitioner DEBUG:"
-      << "\nInput rectangle:            " << r
-      << "\nInput rectangle byte size:  " << getSize(r, bands, bytesPerPixel)
-      << "\nTile max size in bytes:     " << maxSizeInBytes
-      << "\nbands:                      " << bands
-      << "\nbytesPerPixel:              " << bytesPerPixel
-      << "\nNumber of output tiles:     " << v.size()
-      << "\nTiled rectangles:\n";
-
-   int index = 0;
-   vector<ossimIrect>::const_iterator i = v.begin();
-   while(i != v.end())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "tile[" << index << "]:  " << *i
-         << "\nsize in bytes:  " << getSize(*i, bands, bytesPerPixel)
-         << endl;
-      ++i;
-      ++index;
-   }
-}
-
diff --git a/ossim/src/ossim/base/ossimRectilinearDataObject.cpp b/ossim/src/ossim/base/ossimRectilinearDataObject.cpp
deleted file mode 100644
index e4f2918..0000000
--- a/ossim/src/ossim/base/ossimRectilinearDataObject.cpp
+++ /dev/null
@@ -1,309 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// Contributor: David A. Horner (DAH) - http://dave.thehorners.com
-//
-//*************************************************************************
-// $Id: ossimRectilinearDataObject.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimRectilinearDataObject.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <sstream>
-
-RTTI_DEF1(ossimRectilinearDataObject, "ossimRectilinearDataObject", ossimDataObject);
-
-ossimRectilinearDataObject::ossimRectilinearDataObject()
-   : ossimDataObject(),
-     m_numberOfDataComponents(0),
-     m_scalarType(),
-     m_dataBuffer(),
-     m_spatialExtents()
-{
-}
-
-ossimRectilinearDataObject::ossimRectilinearDataObject(
-   const ossimRectilinearDataObject& rhs)
-   : ossimDataObject(rhs),
-     m_numberOfDataComponents(rhs.m_numberOfDataComponents),
-     m_scalarType(rhs.m_scalarType),
-     m_dataBuffer(rhs.m_dataBuffer),
-     m_spatialExtents(rhs.m_spatialExtents)
-{
-}
-
-ossimRectilinearDataObject::ossimRectilinearDataObject(
-   ossim_uint32 numberOfSpatialComponents,
-   ossimSource* owner,
-   ossim_uint32 numberOfDataComponents,
-   ossimScalarType   scalarType,
-   ossimDataObjectStatus /* status */)
-   :ossimDataObject(owner, OSSIM_NULL),
-    m_numberOfDataComponents(numberOfDataComponents),
-    m_scalarType(scalarType),
-    m_dataBuffer(0),
-    m_spatialExtents(numberOfSpatialComponents)
-{
-}
-
-ossimRectilinearDataObject::ossimRectilinearDataObject(
-   ossimSource* owner,
-   ossim_uint32 numberOfDataComponents,
-   ossim_uint32 length,
-   ossimScalarType   scalarType,
-   ossimDataObjectStatus /* status */ )
-   :ossimDataObject(owner, OSSIM_NULL),
-    m_numberOfDataComponents(numberOfDataComponents),
-    m_scalarType(scalarType),
-    m_dataBuffer(0),
-    m_spatialExtents(1)
-{
-   m_spatialExtents[0] = length;
-}
-
-ossimRectilinearDataObject::ossimRectilinearDataObject(
-   ossimSource* owner,
-   ossim_uint32 numberOfDataComponents,
-   ossim_uint32 width,
-   ossim_uint32 height,
-   ossimScalarType   scalarType,
-   ossimDataObjectStatus /* status */)
-   :ossimDataObject(owner, OSSIM_NULL),
-    m_numberOfDataComponents(numberOfDataComponents),
-    m_scalarType(scalarType),
-    m_dataBuffer(0),
-    m_spatialExtents(2)
-{
-   m_spatialExtents[0] = width;
-   m_spatialExtents[1] = height;
-}
-
-ossimRectilinearDataObject::ossimRectilinearDataObject(
-   ossimSource* owner,
-   ossim_uint32 numberOfDataComponents,
-   ossim_uint32 width,
-   ossim_uint32 height,
-   ossim_uint32 depth,
-   ossimScalarType   scalarType,
-   ossimDataObjectStatus /* status */)
-   :ossimDataObject(owner, OSSIM_NULL),
-    m_numberOfDataComponents(numberOfDataComponents),
-    m_scalarType(scalarType),
-    m_dataBuffer(0),
-    m_spatialExtents(3)
-{
-   m_spatialExtents[0] = width;
-   m_spatialExtents[1] = height;
-   m_spatialExtents[2] = depth;
-}
-
-ossimRectilinearDataObject::~ossimRectilinearDataObject()
-{
-}
-
-ossim_uint32 ossimRectilinearDataObject::computeSpatialProduct()const
-{
-   ossim_uint32 spatialProduct = 0;
-   for(ossim_uint32 index = 0; index < m_spatialExtents.size(); ++index)
-   {
-      spatialProduct *= m_spatialExtents[index];
-   }
-   return spatialProduct;
-}
-
-void ossimRectilinearDataObject::setNumberOfDataComponents(ossim_uint32 n)
-{
-   m_numberOfDataComponents = n;
-}
-
-void ossimRectilinearDataObject::setSpatialExtents(ossim_uint32* extents,
-                                                   ossim_uint32 size)
-{
-   if (extents)
-   {
-      m_spatialExtents.resize(size);
-      for(ossim_uint32 i =0; i < size; ++i)
-      {
-         m_spatialExtents[i] = extents[i];
-      }
-   }
-}
-
-void ossimRectilinearDataObject::setScalarType(ossimScalarType type)
-{
-   m_scalarType = type;
-}
-
-ossim_uint32 ossimRectilinearDataObject::getNumberOfDataComponents() const
-{
-   return m_numberOfDataComponents;
-}
-
-ossim_uint32 ossimRectilinearDataObject::getNumberOfSpatialComponents() const
-{
-   return (ossim_uint32)m_spatialExtents.size();
-}
-
-const ossim_uint32* ossimRectilinearDataObject::getSpatialExtents()const
-{
-   return &(m_spatialExtents.front());
-}
-
-ossimScalarType ossimRectilinearDataObject::getScalarType() const
-{
-   return m_scalarType;
-}
-
-ossim_uint32 ossimRectilinearDataObject::getScalarSizeInBytes() const
-{
-   return ossim::scalarSizeInBytes(getScalarType());
-}
-
-void* ossimRectilinearDataObject::getBuf()
-{
-   if (m_dataBuffer.size() > 0)
-   {
-      return static_cast<void*>(&m_dataBuffer.front());
-   }
-   return NULL;
-}
-
-const void* ossimRectilinearDataObject::getBuf()const
-{
-   if (m_dataBuffer.size() > 0)
-   {
-      return static_cast<const void*>(&m_dataBuffer.front());
-   }
-   return NULL;
-}
-
-void ossimRectilinearDataObject::assign(const ossimRectilinearDataObject* data)
-{
-   if(data)
-   {
-      if (this != data)
-      {
-         ossimDataObject::assign(data);
-         
-         m_numberOfDataComponents    = data->m_numberOfDataComponents;
-         m_scalarType                = data->m_scalarType;
-         m_dataBuffer                = data->m_dataBuffer;
-         m_spatialExtents            = data->m_spatialExtents;
-      }
-   }
-}
-
-void ossimRectilinearDataObject::initialize()
-{
-   if (m_dataBuffer.size() != getDataSizeInBytes())
-   {
-      // std::vector::resize can throw a std::bad_alloc so wrap it...
-      try
-      {
-         m_dataBuffer.resize( getDataSizeInBytes() );
-      }
-      catch( std::exception& e )
-      {
-         std::ostringstream errMsg;
-         errMsg << "ossimRectilinearDataObject::initialize caught exception on resize:\n"
-                << "Buffer size in bytes: " << getDataSizeInBytes()
-                << "\n" << e.what() << std::endl;
-         throw ossimException( errMsg.str() );
-      }
-      
-      setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
-   }
-}
-
-ossim_uint32 ossimRectilinearDataObject::getDataSizeInBytes()const
-{
-   return (ossim_uint32)(getScalarSizeInBytes()*
-                         computeSpatialProduct()*
-                         m_numberOfDataComponents);
-}
-
-std::ostream& ossimRectilinearDataObject::print(std::ostream& out) const
-{
-   out << "ossimRectilinearDataObject::print:"
-       << "\nm_numberOfDataComponents:     " << m_numberOfDataComponents
-       << "\ntheNumberOfSpatialComponents:  " << m_spatialExtents.size()
-       << "\nm_scalarType:                 "
-       << (ossimScalarTypeLut::instance()->getEntryString(m_scalarType))
-       << endl;
-   
-   return ossimDataObject::print(out);
-}
-
-const ossimRectilinearDataObject& ossimRectilinearDataObject::operator=(
-   const ossimRectilinearDataObject& rhs)
-{
-   if (this != &rhs)
-   {
-      // ossimDataObject initialization:
-      ossimDataObject::operator=(rhs);
-
-      // ossimRectilinearDataObject (this) initialization:
-      m_numberOfDataComponents    = rhs.m_numberOfDataComponents;
-      m_scalarType                = rhs.m_scalarType;
-      m_dataBuffer                = rhs.m_dataBuffer;
-      m_spatialExtents            = rhs.m_spatialExtents;
-   }
-   return *this;
-}
-
-bool ossimRectilinearDataObject::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   ossimString byteEncoded;
-   ossim::toSimpleStringList(byteEncoded, m_dataBuffer);
-   kwl.add(prefix, "data_buffer", byteEncoded, true);
-   ossim::toSimpleStringList(byteEncoded, m_spatialExtents);
-   kwl.add(prefix, "spatial_extents", byteEncoded, true);
-   kwl.add(prefix, ossimKeywordNames::SCALAR_TYPE_KW, ossimScalarTypeLut::instance()->getEntryString(m_scalarType));
-   
-   return ossimDataObject::saveState(kwl, prefix);
-}
-
-bool ossimRectilinearDataObject::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if(!ossimDataObject::loadState(kwl, prefix)) return false;
-   
-   const char* spatial_extents = kwl.find(prefix, "spatial_extents");
-   const char* data_buffer = kwl.find(prefix, "data_buffer");
-   const char* scalar_type = kwl.find(prefix, ossimKeywordNames::SCALAR_TYPE_KW);
-   m_spatialExtents.clear();
-   m_dataBuffer.clear();
-                                 
-   if(spatial_extents)
-   {
-      if(!ossim::toSimpleVector(m_spatialExtents, ossimString(spatial_extents)))
-      {
-         return false;
-      }
-   }
-   if(data_buffer)
-   {
-      if(!ossim::toSimpleVector(m_dataBuffer, ossimString(kwl.find(prefix, "data_buffer"))))
-      {
-         return false;
-      }
-   }
-   if(scalar_type)
-   {
-      ossimScalarTypeLut::instance()->getScalarTypeFromString(scalar_type);
-   }
-   else 
-   {
-      m_scalarType = OSSIM_SCALAR_UNKNOWN;
-   }
-
-   m_numberOfDataComponents = (ossim_uint32) m_spatialExtents.size();
-   
-   return true;
-   
-}                     
-
diff --git a/ossim/src/ossim/base/ossimRegExp.cpp b/ossim/src/ossim/base/ossimRegExp.cpp
deleted file mode 100644
index 6719a29..0000000
--- a/ossim/src/ossim/base/ossimRegExp.cpp
+++ /dev/null
@@ -1,1299 +0,0 @@
- 
-//
-// Copyright (C) 1991 Texas Instruments Incorporated.
-//
-// Permission is granted to any individual or institution to use, copy, modify,
-// and distribute this software, provided that this complete copyright and
-// permission notice is maintained, intact, in all copies and supporting
-// documentation.
-//
-// Texas Instruments Incorporated provides this software "as is" without
-// express or implied warranty.
-//
-//
-// Created: MNF 06/13/89  Initial Design and Implementation
-// Updated: LGO 08/09/89  Inherit from Generic
-// Updated: MBN 09/07/89  Added conditional exception handling
-// Updated: MBN 12/15/89  Sprinkled "const" qualifiers all over the place!
-// Updated: DLS 03/22/91  New lite version
-//
-// This  is the header file  for the regular  expression class.   An object of
-// this class contains a regular expression,  in  a special "compiled" format.
-// This  compiled format consists  of  several slots   all kept as the objects
-// private data.  The  RegExp class  provides a convenient  way  to  represent
-// regular  expressions.  It makes it easy   to search  for  the  same regular
-// expression in many different strings without having to  compile a string to
-// regular expression format more than necessary.
-//
-// A regular  expression allows a programmer to  specify complex patterns that
-// can be searched for  and  matched against the  character string of a String
-// object.  In  its  simplest case, a   regular expression  is a  sequence  of
-// characters with which you can search for exact character matches.  However,
-// many times you may not know the exact sequence you want to find, or you may
-// only want to find a match at the beginning or end of  a String.  The RegExp
-// object  allows specification of  such patterns by  utilizing the  following
-// regular  expression  meta-characters   (note   that  more  one  of    these
-// meta-characters  can  be used in a single  regular  expression in  order to
-// create complex search patterns):
-//
-//         ^    Match at beginning of line
-//         $    Match at end of line
-//         .    Match any single character
-//         [ ]  Match any one character inside the brackets
-//         [^ ] Match any character NOT inside the brackets
-//         -    Match any character in range on either side of dash
-//         *    Match preceding pattern zero or more times
-//         +    Match preceding pattern one or more times
-//         ?    Match preceding pattern zero or once only
-//         ()   Save a matched expression and use it in a further match.
-//
-// There are three constructors for RegExp.  One  just creates an empty RegExp
-// object.  Another creates a RegExp object  and initializes it with a regular
-// expression  that is given  in  the form of a   char*.   The  third  takes a
-// reference  to  a RegExp  object    as an  argument    and creates an object
-// initialized with the information from the given RegExp object.
-//
-// The  find  member function  finds   the  first  occurence   of  the regualr
-// expression of that object in the string given to find as an argument.  Find
-// returns a boolean, and  if true,  mutates  the private  data appropriately.
-// Find sets pointers to the beginning and end of  the thing last  found, they
-// are pointers into the actual string  that was searched.   The start and end
-// member functions return indicies  into the searched string that  correspond
-// to the beginning   and  end pointers  respectively.   The    compile member
-// function takes a char* and puts the  compiled version of the char* argument
-// into the object's private data fields.  The == and  != operators only check
-// the  to see  if   the compiled  regular  expression   is the same, and  the
-// deep_equal functions also checks  to see if the  start and end pointers are
-// the same.  The is_valid  function returns false if  program is set to NULL,
-// (i.e. there is no valid compiled exression).  The set_invalid function sets
-// the  program to NULL  (Warning: this deletes the compiled  expression). The
-// following examples may help clarify regular expression usage:
-//
-//   *  The regular expression  "^hello" matches  a "hello"  only at  the
-//      beginning of a  line.  It would match "hello  there" but not "hi,
-//      hello there".
-//
-//   *  The regular expression "long$" matches a  "long"  only at the end
-//      of a line. It would match "so long\0", but not "long ago".
-//
-//   *  The regular expression "t..t..g"  will match anything that  has a
-//      "t" then any two characters, another "t", any  two characters and
-//      then a "g".   It will match  "testing", or "test again" but would
-//      not match "toasting"
-//
-//   *  The regular  expression "[1-9ab]" matches any  number one through
-//      nine, and the characters  "a" and  "b".  It would match "hello 1"
-//      or "begin", but would not match "no-match".
-//
-//   *  The  regular expression "[^1-9ab]"  matches any character that is
-//      not a number one  through nine, or  an "a" or "b".   It would NOT
-//      match "hello 1" or "begin", but would match "no-match".
-//
-//   *  The regular expression "br* " matches  something that begins with
-//      a "b", is followed by zero or more "r"s, and ends in a space.  It
-//      would match "brrrrr ", and "b ", but would not match "brrh ".
-//
-//   *  The regular expression "br+ " matches something  that begins with
-//      a "b", is followed by one or more "r"s, and ends in  a space.  It
-//      would match "brrrrr ",  and  "br ", but would not  match "b  " or
-//      "brrh ".
-//
-//   *  The regular expression "br? " matches  something that begins with
-//      a "b", is followed by zero or one "r"s, and ends in  a space.  It
-//      would  match  "br ", and "b  ", but would not match  "brrrr "  or
-//      "brrh ".
-//
-//   *  The regular expression "(..p)b" matches  something ending with pb
-//      and beginning with whatever the two characters before the first p
-//      encounterd in the line were.  It would find  "repb" in "rep drepa
-//      qrepb".  The regular expression "(..p)a"  would find "repa qrepb"
-//      in "rep drepa qrepb"
-//
-//   *  The regular expression "d(..p)" matches something ending  with p,
-//      beginning with d, and having  two characters  in between that are
-//      the same as the two characters before  the first p  encounterd in
-//      the line.  It would match "drepa qrepb" in "rep drepa qrepb".
-//
-
-#include <cstring>
-#include <cstdio>
-#include <ossim/base/ossimRegExp.h>
-#include <iostream>
-// ossimRegExp -- Copies the given regular expression.
-
-ossimRegExp::ossimRegExp (const ossimRegExp& rxp) :
-  regstart(0),     // Internal use only
-  reganch(0),      // Internal use only
-  regmust(0),      // Internal use only
-  regmlen(0),     // Internal use only
-  program(0),   
-  progsize(0),
-  searchstring(0),
-
- // work variables
-  regparse(0),
-  regnpar(0),  // () count.
-  regdummy(0),
-  regcode(0),  // Code-emit pointer; &regdummy = don't.
-  regsize(0),  // Code size.
-  reginput(0),  // String-input pointer.
-  regbol(0),  // Beginning of input, for ^ check.
-  regstartp(0), // Pointer to startp array.
-  regendp(0) // Ditto for endp.
-{
-   if(rxp.program)
-   {
-      int ind = 0; 
-      this->progsize = rxp.progsize;		// Copy regular expression size
-      this->program = new char[this->progsize];	// Allocate storage
-      for(ind=this->progsize; ind-- != 0;)		// Copy regular expresion
-         this->program[ind] = rxp.program[ind];
-      this->startp[0] = rxp.startp[0];		// Copy pointers into last
-      this->endp[0] = rxp.endp[0];			// Successful "find" operation
-      this->regmust = rxp.regmust;			// Copy field
-      if (rxp.regmust != NULL) {
-         char* dum = rxp.program;
-         ind = 0;
-         while (dum != rxp.regmust) {
-            ++dum;
-            ++ind;
-         }
-         this->regmust = this->program + ind;
-      }
-      this->regstart = rxp.regstart;		// Copy starting index
-      this->reganch = rxp.reganch;			// Copy remaining private data
-      this->regmlen = rxp.regmlen;			// Copy remaining private data
-   }
-}
-
-
-// operator== -- Returns true if two regular expressions have the same
-// compiled program for pattern matching.
-
-bool ossimRegExp::operator== (const ossimRegExp& rxp) const {
-  if (this != &rxp) {				// Same address?
-    ossim_uint32 ind = this->progsize;		// Get regular expression size
-    if (ind != rxp.progsize)			// If different size regexp
-      return false;				// Return failure
-    while(ind-- != 0)				// Else while still characters
-      if(this->program[ind] != rxp.program[ind]) // If regexp are different    
-	return false;				 // Return failure             
-  }
-  return true;					// Else same, return success  
-}
-
-
-// deep_equal -- Returns true if have the same compiled regular expressions
-// and the same start and end pointers.
-
-bool ossimRegExp::deep_equal (const ossimRegExp& rxp) const {
-  ossim_uint32 ind = this->progsize;		// Get regular expression size
-  if (ind != rxp.progsize)			// If different size regexp
-    return false;				// Return failure
-  while(ind-- != 0)		 		// Else while still characters
-    if(this->program[ind] != rxp.program[ind])	// If regexp are different    
-      return false;				// Return failure             
-  return (this->startp[0] == rxp.startp[0] && 	// Else if same start/end ptrs,
-	  this->endp[0] == rxp.endp[0]);	// Return true
-}   
-
-// The remaining code in this file is derived from the  regular expression code
-// whose  copyright statement appears  below.  It has been  changed to work
-// with the class concepts of C++ and COOL.
-
-/*
- * compile and find 
- *
- *	Copyright (c) 1986 by University of Toronto.
- *	Written by Henry Spencer.  Not derived from licensed software.
- *
- *	Permission is granted to anyone to use this software for any
- *	purpose on any computer system, and to redistribute it freely,
- *	subject to the following restrictions:
- *
- *	1. The author is not responsible for the consequences of use of
- *		this software, no matter how awful, even if they arise
- *		from defects in it.
- *
- *	2. The origin of this software must not be misrepresented, either
- *		by explicit claim or by omission.
- *
- *	3. Altered versions must be plainly marked as such, and must not
- *		be misrepresented as being the original software.
- *
- * Beware that some of this code is subtly aware of the way operator
- * precedence is structured in regular expressions.  Serious changes in
- * regular-expression syntax might require a total rethink.
- */
-
-/*
- * The "internal use only" fields in regexp.h are present to pass info from
- * compile to execute that permits the execute phase to run lots faster on
- * simple cases.  They are:
- *
- * regstart	char that must begin a match; '\0' if none obvious
- * reganch	is the match anchored (at beginning-of-line only)?
- * regmust	string (pointer into program) that match must include, or NULL
- * regmlen	length of regmust string
- *
- * Regstart and reganch permit very fast decisions on suitable starting points
- * for a match, cutting down the work a lot.  Regmust permits fast rejection
- * of lines that cannot possibly match.  The regmust tests are costly enough
- * that compile() supplies a regmust only if the r.e. contains something
- * potentially expensive (at present, the only such thing detected is * or +
- * at the start of the r.e., which can involve a lot of backup).  Regmlen is
- * supplied because the test in find() needs it and compile() is computing
- * it anyway.
- */
-
-/*
- * Structure for regexp "program".  This is essentially a linear encoding
- * of a nondeterministic finite-state machine (aka syntax charts or
- * "railroad normal form" in parsing technology).  Each node is an opcode
- * plus a "next" pointer, possibly plus an operand.  "Next" pointers of
- * all nodes except BRANCH implement concatenation; a "next" pointer with
- * a BRANCH on both ends of it is connecting two alternatives.  (Here we
- * have one of the subtle syntax dependencies:  an individual BRANCH (as
- * opposed to a collection of them) is never concatenated with anything
- * because of operator precedence.)  The operand of some types of node is
- * a literal string; for others, it is a node leading into a sub-FSM.  In
- * particular, the operand of a BRANCH node is the first node of the branch.
- * (NB this is *not* a tree structure:  the tail of the branch connects
- * to the thing following the set of BRANCHes.)  The opcodes are:
- */
-
-// definition	number	opnd?	meaning
-#define	END	0		// no	End of program.
-#define	BOL	1		// no	Match "" at beginning of line.
-#define	EOL	2		// no	Match "" at end of line.
-#define	ANY	3		// no	Match any one character.
-#define	ANYOF	4		// str	Match any character in this string.
-#define	ANYBUT	5		// str	Match any character not in this
-				// string.
-#define	BRANCH	6		// node	Match this alternative, or the
-				// next...
-#define	BACK	7		// no	Match "", "next" ptr points backward.
-#define	EXACTLY	8		// str	Match this string.
-#define	NOTHING	9		// no	Match empty string.
-#define	STAR	10		// node	Match this (simple) thing 0 or more
-				// times.
-#define	PLUS	11		// node	Match this (simple) thing 1 or more
-				// times.
-#define	OPEN	20		// no	Mark this point in input as start of
-				// #n.
-// OPEN+1 is number 1, etc.
-#define	CLOSE	30		// no	Analogous to OPEN.
-
-/*
- * Opcode notes:
- *
- * BRANCH	The set of branches constituting a single choice are hooked
- *		together with their "next" pointers, since precedence prevents
- *		anything being concatenated to any individual branch.  The
- *		"next" pointer of the last BRANCH in a choice points to the
- *		thing following the whole choice.  This is also where the
- *		final "next" pointer of each individual branch points; each
- *		branch starts with the operand node of a BRANCH node.
- *
- * BACK		Normal "next" pointers all implicitly point forward; BACK
- *		exists to make loop structures possible.
- *
- * STAR,PLUS	'?', and complex '*' and '+', are implemented as circular
- *		BRANCH structures using BACK.  Simple cases (one character
- *		per match) are implemented with STAR and PLUS for speed
- *		and to minimize recursive plunges.
- *
- * OPEN,CLOSE	...are numbered at compile time.
- */
-
-/*
- * A node is one char of opcode followed by two chars of "next" pointer.
- * "Next" pointers are stored as two 8-bit pieces, high order first.  The
- * value is a positive offset from the opcode of the node containing it.
- * An operand, if any, simply follows the node.  (Note that much of the
- * code generation knows about this implicit relationship.)
- *
- * Using two bytes for the "next" pointer is vast overkill for most things,
- * but allows patterns to get big without disasters.
- */
-
-#define	OP(p)		(*(p))
-#define	NEXT(p)		(((*((p)+1)&0377)<<8) + (*((p)+2)&0377))
-#define	OPERAND(p)	((p) + 3)
-
-const unsigned char MAGIC = 0234;
-/*
- * Utility definitions.
- */
-
-#define	UCHARAT(p)	((const unsigned char*)(p))[0]
-
-
-#define	FAIL(m)	{ regerror(m); return(NULL); }
-#define	ISMULT(c)	((c) == '*' || (c) == '+' || (c) == '?')
-#define	META	"^$.[()|?+*\\"
-
-
-/*
- * Flags to be passed up and down.
- */
-#define	HASWIDTH	01	// Known never to match null string.
-#define	SIMPLE		02	// Simple enough to be STAR/PLUS operand.
-#define	SPSTART		04	// Starts with * or +.
-#define	WORST		0	// Worst case.
-
-
-
-/////////////////////////////////////////////////////////////////////////
-//
-//  COMPILE AND ASSOCIATED FUNCTIONS
-//
-/////////////////////////////////////////////////////////////////////////
-
-
-/*
- * Global work variables for compile().
- */
-// static const char* regparse;	// Input-scan pointer.
-// static       int   regnpar;	// () count.
-// static       char  regdummy;
-// static       char* regcode;	// Code-emit pointer; &regdummy = don't.
-// static       long  regsize;	// Code size.
-
-/*
- * Forward declarations for compile()'s friends.
- */
-// #ifndef static
-// #define	static	static
-// #endif
-// static       char* reg (int, int*);
-// static       char* regbranch (int*);
-// static       char* regpiece (int*);
-// static       char* regatom (int*);
-// static       char* regnode (char);
-// static const char* regnext (register const char*);
-// static       char* regnext (register char*);
-// static void        regc (unsigned char);
-// static void        reginsert (char, char*);
-// static void        regtail (char*, const char*);
-// static void        regoptail (char*, const char*);
-
-// #ifdef STRCSPN
-// static int strcspn ();
-// #endif
-
-
-
-/*
- * We can't allocate space until we know how big the compiled form will be,
- * but we can't compile it (and thus know how big it is) until we've got a
- * place to put the code.  So we cheat:  we compile it twice, once with code
- * generation turned off and size counting turned on, and once "for real".
- * This also means that we don't allocate space until we are sure that the
- * thing really will compile successfully, and we never have to move the
- * code and thus invalidate pointers into it.  (Note that it has to be in
- * one piece because free() must be able to free it all.)
- *
- * Beware that the optimization-preparation code in here knows about some
- * of the structure of the compiled regexp.
- */
-
-
-// compile -- compile a regular expression into internal code
-// for later pattern matching.
-
-void ossimRegExp::compile (const char* exp) {
-    register const char* scan;
-    register const char* longest;
-    register unsigned long len;
-             int         flags;
-
-    if (exp == NULL) {
-      //RAISE Error, SYM(ossimRegExp), SYM(No_Expr),
-      printf ("ossimRegExp::compile(): No expression supplied.\n");
-      return;
-    }
-
-    // First pass: determine size, legality.
-    regparse = exp;
-    regnpar = 1;
-    regsize = 0L;
-    regcode = ®dummy;
-    regc(MAGIC);
-    if(!reg(0, &flags))
-      {
-	printf ("ossimRegExp::compile(): Error in compile.\n");
-	return;
-      }
-    this->startp[0] = this->endp[0] = this->searchstring = NULL;
-
-    // Small enough for pointer-storage convention? 
-    if (regsize >= 32767L) {	// Probably could be 65535L. 
-      //RAISE Error, SYM(ossimRegExp), SYM(Expr_Too_Big),
-      printf ("ossimRegExp::compile(): Expression too big.\n");
-      return;
-    }
-
-    // Allocate space. 
-//#ifndef WIN32
-    if (this->program != NULL) delete [] this->program;  
-//#endif
-    this->program = new char[regsize];
-    this->progsize = (int) regsize;
-
-    if (this->program == NULL) {
-      //RAISE Error, SYM(ossimRegExp), SYM(Out_Of_Memory),
-      printf ("ossimRegExp::compile(): Out of memory.\n"); 
-      return;
-    }
-
-    // Second pass: emit code.
-    regparse = exp;
-    regnpar = 1;
-    regcode = this->program;
-    regc(MAGIC);
-    reg(0, &flags);
-
-    // Dig out information for optimizations.
-    this->regstart = '\0';		// Worst-case defaults.
-    this->reganch = 0;
-    this->regmust = NULL;
-    this->regmlen = 0;
-    scan = this->program + 1;	// First BRANCH.
-    if (OP(regnext(scan)) == END) {	// Only one top-level choice.
-	scan = OPERAND(scan);
-
-	// Starting-point info.
-	if (OP(scan) == EXACTLY)
-	    this->regstart = *OPERAND(scan);
-	else if (OP(scan) == BOL)
-	    this->reganch++;
-
-	 //
-	 // If there's something expensive in the r.e., find the longest
-	 // literal string that must appear and make it the regmust.  Resolve
-	 // ties in favor of later strings, since the regstart check works
-	 // with the beginning of the r.e. and avoiding duplication
-	 // strengthens checking.  Not a strong reason, but sufficient in the
-	 // absence of others. 
-	 //
-	if (flags & SPSTART) {
-	    longest = NULL;
-	    len = 0;
-	    for (; scan != NULL; scan = regnext(scan))
-		if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) {
-		    longest = OPERAND(scan);
-		    len = (unsigned long)strlen(OPERAND(scan));
-		}
-	    this->regmust = longest;
-	    this->regmlen = len;
-	}
-    }
-}
-
-
-/*
- - reg - regular expression, i.e. main body or parenthesized thing
- *
- * Caller must absorb opening parenthesis.
- *
- * Combining parenthesis handling with the base level of regular expression
- * is a trifle forced, but the need to tie the tails of the branches to what
- * follows makes it hard to avoid.
- */
-char* ossimRegExp::reg (int paren, int *flagp) {
-    register char* ret;
-    register char* br;
-    register char* ender;
-    register int   parno =0;
-             int   flags;
-
-    *flagp = HASWIDTH;		// Tentatively.
-
-    // Make an OPEN node, if parenthesized.
-    if (paren) {
-	if (regnpar >= NSUBEXP) {
-	  //RAISE Error, SYM(ossimRegExp), SYM(Too_Many_Parens),
-	  printf ("ossimRegExp::compile(): Too many parentheses.\n");
-	  return 0;
-        }
-	parno = regnpar;
-	regnpar++;
-	ret = regnode(OPEN + parno);
-    }
-    else
-	ret = NULL;
-
-    // Pick up the branches, linking them together.
-    br = regbranch(&flags);
-    if (br == NULL)
-	return (NULL);
-    if (ret != NULL)
-	regtail(ret, br);	// OPEN -> first.
-    else
-	ret = br;
-    if (!(flags & HASWIDTH))
-	*flagp &= ~HASWIDTH;
-    *flagp |= flags & SPSTART;
-    while (*regparse == '|') {
-	regparse++;
-	br = regbranch(&flags);
-	if (br == NULL)
-	    return (NULL);
-	regtail(ret, br);	// BRANCH -> BRANCH.
-	if (!(flags & HASWIDTH))
-	    *flagp &= ~HASWIDTH;
-	*flagp |= flags & SPSTART;
-      }
-
-    // Make a closing node, and hook it on the end.
-    ender = regnode((paren) ? CLOSE + parno : END);
-    regtail(ret, ender);
-
-    // Hook the tails of the branches to the closing node.
-    for (br = ret; br != NULL; br = regnext(br))
-	regoptail(br, ender);
-
-    // Check for proper termination.
-    if (paren && *regparse++ != ')') {
-        //RAISE Error, SYM(ossimRegExp), SYM(Unmatched_Parens),
-        printf ("ossimRegExp::compile(): Unmatched parentheses.\n");
-	return 0;
-    }
-    else if (!paren && *regparse != '\0') {
-        if (*regparse == ')') {
-            //RAISE Error, SYM(ossimRegExp), SYM(Unmatched_Parens),
-            printf ("ossimRegExp::compile(): Unmatched parentheses.\n");
-	    return 0;
-	}
-	else {
-	    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
-	    printf ("ossimRegExp::compile(): Internal error.\n");
-	    return 0;
-        }
-	// NOTREACHED
-    }
-    return (ret);
-}
-
-
-/*
- - regbranch - one alternative of an | operator
- *
- * Implements the concatenation operator.
- */
-char* ossimRegExp::regbranch (int *flagp) {
-    register char* ret;
-    register char* chain;
-    register char* latest;
-    int                  flags;
-
-    *flagp = WORST;		// Tentatively.
-
-    ret = regnode(BRANCH);
-    chain = NULL;
-    while (*regparse != '\0' && *regparse != '|' && *regparse != ')') {
-	latest = regpiece(&flags);
-	if (latest == NULL)
-	    return (NULL);
-	*flagp |= flags & HASWIDTH;
-	if (chain == NULL)	// First piece.
-	    *flagp |= flags & SPSTART;
-	else
-	    regtail(chain, latest);
-	chain = latest;
-    }
-    if (chain == NULL)		// Loop ran zero times.
-	regnode(NOTHING);
-
-    return (ret);
-}
-
-
-/*
- - regpiece - something followed by possible [*+?]
- *
- * Note that the branching code sequences used for ? and the general cases
- * of * and + are somewhat optimized:  they use the same NOTHING node as
- * both the endmarker for their branch list and the body of the last branch.
- * It might seem that this node could be dispensed with entirely, but the
- * endmarker role is not redundant.
- */
-char* ossimRegExp::regpiece (int *flagp) {
-    register char* ret;
-    register char  op;
-    register char* next;
-    int            flags;
-
-    ret = regatom(&flags);
-    if (ret == NULL)
-	return (NULL);
-
-    op = *regparse;
-    if (!ISMULT(op)) {
-	*flagp = flags;
-	return (ret);
-    }
-
-    if (!(flags & HASWIDTH) && op != '?') {
-        //RAISE Error, SYM(ossimRegExp), SYM(Empty_Operand),
-        printf ("ossimRegExp::compile() : *+ operand could be empty.\n");
-	return 0;
-    }
-    *flagp = (op != '+') ? (WORST | SPSTART) : (WORST | HASWIDTH);
-
-    if (op == '*' && (flags & SIMPLE))
-	reginsert(STAR, ret);
-    else if (op == '*') {
-	// Emit x* as (x&|), where & means "self".
-	reginsert(BRANCH, ret);	// Either x
-	regoptail(ret, regnode(BACK));	// and loop
-	regoptail(ret, ret);	// back
-	regtail(ret, regnode(BRANCH));	// or
-	regtail(ret, regnode(NOTHING));	// null.
-    }
-    else if (op == '+' && (flags & SIMPLE))
-	reginsert(PLUS, ret);
-    else if (op == '+') {
-	// Emit x+ as x(&|), where & means "self".
-	next = regnode(BRANCH);	// Either
-	regtail(ret, next);
-	regtail(regnode(BACK), ret);	// loop back
-	regtail(next, regnode(BRANCH));	// or
-	regtail(ret, regnode(NOTHING));	// null.
-    }
-    else if (op == '?') {
-	// Emit x? as (x|)
-	reginsert(BRANCH, ret);	// Either x
-	regtail(ret, regnode(BRANCH));	// or
-	next = regnode(NOTHING);// null.
-	regtail(ret, next);
-	regoptail(ret, next);
-    }
-    regparse++;
-    if (ISMULT(*regparse)) {
-        //RAISE Error, SYM(ossimRegExp), SYM(Nested_Operand),
-        printf ("ossimRegExp::compile(): Nested *?+.\n");
-	return 0;
-    }
-    return (ret);
-}
-
-
-/*
- - regatom - the lowest level
- *
- * Optimization:  gobbles an entire sequence of ordinary characters so that
- * it can turn them into a single node, which is smaller to store and
- * faster to run.  Backslashed characters are exceptions, each becoming a
- * separate node; the code is simpler that way and it's not worth fixing.
- */
-char* ossimRegExp::regatom (int *flagp) {
-    register char* ret;
-             int   flags;
-
-    *flagp = WORST;		// Tentatively.
-
-    switch (*regparse++) {
-	case '^':
-	    ret = regnode(BOL);
-	    break;
-	case '$':
-	    ret = regnode(EOL);
-	    break;
-	case '.':
-	    ret = regnode(ANY);
-	    *flagp |= HASWIDTH | SIMPLE;
-	    break;
-	case '[':{
-		register int    rxpclass;
-		register int    rxpclassend;
-
-		if (*regparse == '^') {	// Complement of range.
-		    ret = regnode(ANYBUT);
-		    regparse++;
-		}
-		else
-		    ret = regnode(ANYOF);
-		if (*regparse == ']' || *regparse == '-')
-		    regc(*regparse++);
-		while (*regparse != '\0' && *regparse != ']') {
-		    if (*regparse == '-') {
-			regparse++;
-			if (*regparse == ']' || *regparse == '\0')
-			    regc('-');
-			else {
-			    rxpclass = UCHARAT(regparse - 2) + 1;
-			    rxpclassend = UCHARAT(regparse);
-			    if (rxpclass > rxpclassend + 1) {
-			       //RAISE Error, SYM(ossimRegExp), SYM(Invalid_Range),
-			       printf ("ossimRegExp::compile(): Invalid range in [].\n");
-			       return 0;
-                            }
-			    for (; rxpclass <= rxpclassend; rxpclass++)
-				regc(rxpclass);
-			    regparse++;
-			}
-		    }
-		    else
-			regc(*regparse++);
-		}
-		regc('\0');
-		if (*regparse != ']') {
-                    //RAISE Error, SYM(ossimRegExp), SYM(Unmatched_Bracket),
-                    printf ("ossimRegExp::compile(): Unmatched [].\n");
-		    return 0;
-	        }
-		regparse++;
-		*flagp |= HASWIDTH | SIMPLE;
-	    }
-	    break;
-	case '(':
-	    ret = reg(1, &flags);
-	    if (ret == NULL)
-		return (NULL);
-	    *flagp |= flags & (HASWIDTH | SPSTART);
-	    break;
-	case '\0':
-	case '|':
-	case ')':
-	    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
-            printf ("ossimRegExp::compile(): Internal error.\n"); // Never here
-	    return 0;
-	case '?':
-	case '+':
-	case '*':
-	    //RAISE Error, SYM(ossimRegExp), SYM(No_Operand),
-            printf ("ossimRegExp::compile(): ?+* follows nothing.\n");
-	    return 0;
-	case '\\':
-	    if (*regparse == '\0') {
-	        //RAISE Error, SYM(ossimRegExp), SYM(Trailing_Backslash),
-                printf ("ossimRegExp::compile(): Trailing backslash.\n");
-		return 0;
-            }
-	    ret = regnode(EXACTLY);
-	    regc(*regparse++);
-	    regc('\0');
-	    *flagp |= HASWIDTH | SIMPLE;
-	    break;
-	default:{
-		register int    len;
-		register char   ender;
-
-		regparse--;
-		len = (int)strcspn(regparse, META);
-		if (len <= 0) {
-		    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
-                    printf ("ossimRegExp::compile(): Internal error.\n");
-		    return 0;
-                }
-		ender = *(regparse + len);
-		if (len > 1 && ISMULT(ender))
-		    len--;	// Back off clear of ?+* operand.
-		*flagp |= HASWIDTH;
-		if (len == 1)
-		    *flagp |= SIMPLE;
-		ret = regnode(EXACTLY);
-		while (len > 0) {
-		    regc(*regparse++);
-		    len--;
-		}
-		regc('\0');
-	    }
-	    break;
-    }
-    return (ret);
-}
-
-
-/*
- - regnode - emit a node
-   Location.
- */
-char* ossimRegExp::regnode (char op) {
-    register char* ret;
-    register char* ptr;
-
-    ret = regcode;
-    if (ret == &regdummy) {
-	regsize += 3;
-	return (ret);
-    }
-
-    ptr = ret;
-    *ptr++ = op;
-    *ptr++ = '\0';		// Null "next" pointer.
-    *ptr++ = '\0';
-    regcode = ptr;
-
-    return (ret);
-}
-
-
-/*
- - regc - emit (if appropriate) a byte of code
- */
-void ossimRegExp::regc (unsigned char b) {
-    if (regcode != &regdummy)
-	*regcode++ = b;
-    else
-	regsize++;
-}
-
-
-/*
- - reginsert - insert an operator in front of already-emitted operand
- *
- * Means relocating the operand.
- */
-void ossimRegExp::reginsert (char op, char* opnd) {
-    register char* src;
-    register char* dst;
-    register char* place;
-
-    if (regcode == &regdummy) {
-	regsize += 3;
-	return;
-    }
-
-    src = regcode;
-    regcode += 3;
-    dst = regcode;
-    while (src > opnd)
-	*--dst = *--src;
-
-    place = opnd;		// Op node, where operand used to be.
-    *place++ = op;
-    *place++ = '\0';
-    *place++ = '\0';
-}
-
-
-/*
- - regtail - set the next-pointer at the end of a node chain
- */
-void ossimRegExp::regtail (char* p, const char* val) {
-    register char* scan;
-    register char* temp;
-    register int   offset;
-
-    if (p == &regdummy)
-	return;
-
-    // Find last node.
-    scan = p;
-    for (;;) {
-	temp = regnext(scan);
-	if (temp == NULL)
-	    break;
-	scan = temp;
-    }
-
-    if (OP(scan) == BACK)
-	offset = (const char*)scan - val;
-    else
-	offset = val - scan;
-    *(scan + 1) = (offset >> 8) & 0377;
-    *(scan + 2) = offset & 0377;
-}
-
-
-/*
- - regoptail - regtail on operand of first argument; nop if operandless
- */
-void ossimRegExp::regoptail (char* p, const char* val) {
-    // "Operandless" and "op != BRANCH" are synonymous in practice.
-    if (p == NULL || p == &regdummy || OP(p) != BRANCH)
-	return;
-    regtail(OPERAND(p), val);
-}
-
-
-
-////////////////////////////////////////////////////////////////////////
-// 
-//  find and friends
-// 
-////////////////////////////////////////////////////////////////////////
-
-
-/*
- * Global work variables for find().
- */
-// static const char*  reginput;	// String-input pointer.
-// static const char*  regbol;	// Beginning of input, for ^ check.
-// static const char* *regstartp;	// Pointer to startp array.
-// static const char* *regendp;	// Ditto for endp.
-
-/*
- * Forwards.
- */
-// static int regtry (const char*, const char* *,
-// 		   const char* *, const char*);
-// static int regmatch (const char*);
-// static int regrepeat (const char*);
-
-// #ifdef DEBUG
-// int          regnarrate = 0;
-// void         regdump ();
-// static char* regprop ();
-// #endif
-
-
-
-// find -- Matches the regular expression to the given string.
-// Returns true if found, and sets start and end indexes accordingly.
-
-bool ossimRegExp::find (const char* string) {
-    register const char* s = 0;
-
-	if(!string) return false;
-    this->searchstring = string;
-
-     // Check validity of program.
-    if (!this->program || UCHARAT(this->program) != MAGIC) {
-        //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
-        printf ("ossimRegExp::find(): Compiled regular expression corrupted.\n");
-        return 0;
-    }
-    
-    // If there is a "must appear" string, look for it.
-    if (this->regmust != NULL) {
-	s = string;
-	while ((s = strchr(s, this->regmust[0])) != NULL) {
-	    if (strncmp(s, this->regmust, this->regmlen) == 0)
-		break;		// Found it.
-	    s++;
-	}
-	if (s == NULL)		// Not present.
-	    return (0);
-    }
-     
-    // Mark beginning of line for ^ .
-    regbol = string;
-
-    // Simplest case:  anchored match need be tried only once.
-    if (this->reganch)
-	return (regtry(string, this->startp, this->endp, this->program));
-    
-    // Messy cases:  unanchored match.
-    s = string;
-    if (this->regstart != '\0')
-	// We know what char it must start with.
-	while ((s = strchr(s, this->regstart)) != NULL) {
-	    if (regtry(s, this->startp, this->endp, this->program))
-		return (1);
-	    s++;
-	  
-	}
-    else
-	// We don't -- general case.
-	do {
-	    if (regtry(s, this->startp, this->endp, this->program))
-		return (1);
-	} while (*s++ != '\0');
-    
-    // Failure.
-    return (0);
-}
-
-
-/*
- - regtry - try match at specific point
-   0 failure, 1 success
- */
-int ossimRegExp::regtry (const char* string, const char* *start,
-		   const char* *end, const char* prog) {
-    register       int    i;
-    register const char* *sp1;
-    register const char* *ep;
-
-    reginput = string;
-    regstartp = start;
-    regendp = end;
-
-    sp1 = start;
-    ep = end;
-    for (i = NSUBEXP; i > 0; i--) {
-	*sp1++ = NULL;
-	*ep++ = NULL;
-    }
-    if (regmatch(prog + 1)) {
-	start[0] = string;
-	end[0] = reginput;
-	return (1);
-    }
-    else
-	return (0);
-}
-
-
-/*
- - regmatch - main matching routine
- *
- * Conceptually the strategy is simple:  check to see whether the current
- * node matches, call self recursively to see whether the rest matches,
- * and then act accordingly.  In practice we make some effort to avoid
- * recursion, in particular by going through "ordinary" nodes (that don't
- * need to know whether the rest of the match failed) by a loop instead of
- * by recursion.
- * 0 failure, 1 success
- */
-int ossimRegExp::regmatch (const char* prog) {
-    register const char* scan;	// Current node.
-             const char* next;	// Next node.
-
-    scan = prog;
-
-    while (scan != NULL) {
-
-	next = regnext(scan);
-
-	switch (OP(scan)) {
-	    case BOL:
-		if (reginput != regbol)
-		    return (0);
-		break;
-	    case EOL:
-		if (*reginput != '\0')
-		    return (0);
-		break;
-	    case ANY:
-		if (*reginput == '\0')
-		    return (0);
-		reginput++;
-		break;
-	    case EXACTLY:{
-		    register int         len;
-		    register const char* opnd;
-
-		    opnd = OPERAND(scan);
-		    // Inline the first character, for speed.
-		    if (*opnd != *reginput)
-			return (0);
-		    len = (int)strlen(opnd);
-		    if (len > 1 && strncmp(opnd, reginput, len) != 0)
-			return (0);
-		    reginput += len;
-		}
-		break;
-	    case ANYOF:
-		if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) == NULL)
-		    return (0);
-		reginput++;
-		break;
-	    case ANYBUT:
-		if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != NULL)
-		    return (0);
-		reginput++;
-		break;
-	    case NOTHING:
-		break;
-	    case BACK:
-		break;
-	    case OPEN + 1:
-	    case OPEN + 2:
-	    case OPEN + 3:
-	    case OPEN + 4:
-	    case OPEN + 5:
-	    case OPEN + 6:
-	    case OPEN + 7:
-	    case OPEN + 8:
-	    case OPEN + 9:{
-		    register       int    no;
-		    register const char* save;
-
-		    no = OP(scan) - OPEN;
-		    save = reginput;
-
-		    if (regmatch(next)) {
-
-			//
-			// Don't set startp if some later invocation of the
-			// same parentheses already has. 
-			//
-			if (regstartp[no] == NULL)
-			    regstartp[no] = save;
-			return (1);
-		    }
-		    else
-			return (0);
-		}
-//		break;
-	    case CLOSE + 1:
-	    case CLOSE + 2:
-	    case CLOSE + 3:
-	    case CLOSE + 4:
-	    case CLOSE + 5:
-	    case CLOSE + 6:
-	    case CLOSE + 7:
-	    case CLOSE + 8:
-	    case CLOSE + 9:{
-		    register       int    no;
-		    register const char* save;
-
-		    no = OP(scan) - CLOSE;
-		    save = reginput;
-
-		    if (regmatch(next)) {
-
-			//
-			// Don't set endp if some later invocation of the
-			// same parentheses already has. 
-			//
-			if (regendp[no] == NULL)
-			    regendp[no] = save;
-			return (1);
-		    }
-		    else
-			return (0);
-		}
-//		break;
-	    case BRANCH:{
-	      
-	      register const char* save;
-
-		    if (OP(next) != BRANCH)	// No choice.
-			next = OPERAND(scan);	// Avoid recursion.
-		    else {
-			do {
-			    save = reginput;
-			    if (regmatch(OPERAND(scan)))
-				return (1);
-			    reginput = save;
-			    scan = regnext(scan);
-			} while (scan != NULL && OP(scan) == BRANCH);
-			return (0);
-			// NOTREACHED
-		    }
-		}
-		break;
-	    case STAR:
-	    case PLUS:{
-	      register char   nextch;
-		    register int        no;
-		    register const char* save;
-		    register int        min_no;
-
-		    //
-		    // Lookahead to avoid useless match attempts when we know
-		    // what character comes next. 
-		    //
-		    nextch = '\0';
-		    if (OP(next) == EXACTLY)
-			nextch = *OPERAND(next);
-		    min_no = (OP(scan) == STAR) ? 0 : 1;
-		    save = reginput;
-		    no = regrepeat(OPERAND(scan));
-		    while (no >= min_no) {
-			// If it could work, try it.
-			if (nextch == '\0' || *reginput == nextch)
-			    if (regmatch(next))
-				return (1);
-			// Couldn't or didn't -- back up.
-			no--;
-			reginput = save + no;
-		    }
-		    return (0);
-		}
-//		break;
-	    case END:
- 		return (1);	// Success!
-
-	    default:
-	        //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
-                printf ("ossimRegExp::find(): Internal error -- memory corrupted.\n");
-		return 0;
-	}
-	scan = next;
-    }
-
-    // 
-    //  We get here only if there's trouble -- normally "case END" is the
-    //  terminating point. 
-    // 
-    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
-    printf ("ossimRegExp::find(): Internal error -- corrupted pointers.\n");
-    return (0);
-}
-
-
-/*
- - regrepeat - repeatedly match something simple, report how many
- */
-int ossimRegExp::regrepeat (const char* p) {
-    register       int   count = 0;
-    register const char* scan;
-    register const char* opnd;
-
-    scan = reginput;
-    opnd = OPERAND(p);
-    switch (OP(p)) {
-	case ANY:
-	    count = (int)strlen(scan);
-	    scan += count;
-	    break;
-	case EXACTLY:
-	    while (*opnd == *scan) {
-		count++;
-		scan++;
-	    }
-	    break;
-	case ANYOF:
-	    while (*scan != '\0' && strchr(opnd, *scan) != NULL) {
-		count++;
-		scan++;
-	    }
-	    break;
-	case ANYBUT:
-	    while (*scan != '\0' && strchr(opnd, *scan) == NULL) {
-		count++;
-		scan++;
-	    }
-	    break;
-	default:		// Oh dear.  Called inappropriately.
-	    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
-	    printf ("ossimRegExp::find(): Internal error.\n");
-	    return 0;
-    }
-    reginput = scan;
-    return (count);
-}
-
-
-/*
- - regnext - dig the "next" pointer out of a node
- */
-const char* ossimRegExp::regnext (register const char* p) {
-    register int offset;
-
-    if (p == &regdummy)
-	return (NULL);
-
-    offset = NEXT(p);
-    if (offset == 0)
-	return (NULL);
-
-    if (OP(p) == BACK)
-	return (p - offset);
-    else
-	return (p + offset);
-}
-
-
-char* ossimRegExp::regnext (register char* p) {
-    register int offset;
-
-    if (p == &regdummy)
-	return (NULL);
-
-    offset = NEXT(p);
-    if (offset == 0)
-	return (NULL);
-
-    if (OP(p) == BACK)
-	return (p - offset);
-    else
-	return (p + offset);
-}
diff --git a/ossim/src/ossim/base/ossimRgbLutDataObject.cpp b/ossim/src/ossim/base/ossimRgbLutDataObject.cpp
deleted file mode 100644
index 1a100b3..0000000
--- a/ossim/src/ossim/base/ossimRgbLutDataObject.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbLutDataObject.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/base/ossimRgbLutDataObject.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimColumnVector3d.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-#include <sstream>
-using namespace std;
-
-RTTI_DEF1(ossimRgbLutDataObject, "ossimRgbLutDataObject", ossimObject);
-
-ostream& operator <<(ostream& out,
-                     const ossimRgbLutDataObject& lut)
-{
-   for(ossim_uint32 index = 0; index < lut.theNumberOfEntries; ++index)
-   {
-      out << "entry" << index << " " << lut[index] << endl;
-   }
-
-   return out;
-}
-
-ossimRgbLutDataObject::ossimRgbLutDataObject(unsigned long numberOfEntries)
-   :
-      theLut(NULL),
-      theNumberOfEntries(numberOfEntries)
-{
-   if(theNumberOfEntries > 0)
-   {
-      // allocate 256 entries for the data object;
-      theLut = new ossimRgbVector[theNumberOfEntries];
-   }
-      
-}
-
-ossimRgbLutDataObject::ossimRgbLutDataObject(const ossimRgbLutDataObject& lut)
-   :
-      theLut(NULL),
-      theNumberOfEntries(0)
-{
-   theNumberOfEntries = lut.theNumberOfEntries;
-   if(theNumberOfEntries > 0)
-   {
-      theLut = new ossimRgbVector[theNumberOfEntries];
-      for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
-      {
-         theLut[index] = lut.theLut[index];
-      }
-   }
-}
-
-ossimRgbLutDataObject::~ossimRgbLutDataObject()
-{
-   if(theLut)
-   {
-      delete [] theLut;
-      theLut = NULL;
-   }
-   theNumberOfEntries = 0;
-}
-
-int ossimRgbLutDataObject::findIndex(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
-{
-   ossim_uint32 distance = 0x7FFFFFFF; // max 4 byte signed
-   ossim_int32 result   = 0;
-
-   if(theNumberOfEntries > 0)
-   {
-      for(ossim_uint32 i = 0; i < theNumberOfEntries; ++i)
-      {
-         ossim_uint32 rDelta = r - theLut[i].getR();
-         ossim_uint32 gDelta = g - theLut[i].getG();
-         ossim_uint32 bDelta = b - theLut[i].getB();
-
-         ossim_uint32 deltaSumSquare = (rDelta*rDelta +
-                                        gDelta*gDelta +
-                                        bDelta*bDelta);
-         if(deltaSumSquare == 0)
-         {
-            return static_cast<int>(i);
-         }
-         else if( deltaSumSquare < distance)
-         {
-            result = static_cast<int>(i);
-            distance = deltaSumSquare;
-         }
-      }
-   }
-
-   return result;
-}
-
-ossimRgbLutDataObject ossimRgbLutDataObject::rotate(long numberOfElements)const
-{
-   if(numberOfElements < 0)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL: Negative rotation is not supported yet in ossimRgbLutDataObject::rotate" << endl;
-      return *this;
-   }
-   ossimRgbLutDataObject lut;
-   for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
-   {
-      int adjustedDestinationIndex = (index+numberOfElements)%theNumberOfEntries;
-      lut[adjustedDestinationIndex] = theLut[index] ;
-   }
-
-   return lut;
-}
-
-ossimRgbLutDataObject& ossimRgbLutDataObject::rotate(long numberOfElements)
-{
-   if(numberOfElements < 0)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL: Negative rotation is not supported yet in ossimRgbLutDataObject::rotate" << endl;
-      return *this;
-   }
-   const ossimRgbLutDataObject* temp = this;
-
-   *this = temp->rotate(numberOfElements);
-
-   return *this;
-}
-
-const ossimRgbLutDataObject& ossimRgbLutDataObject::operator =(const ossimRgbLutDataObject& lut)
-{
-   if(theNumberOfEntries != lut.theNumberOfEntries)
-   {
-      delete [] theLut;
-      theLut = NULL;
-   }
-
-   theNumberOfEntries = lut.theNumberOfEntries;
-   if(!theLut&&(theNumberOfEntries > 0))
-   {
-      theLut = new ossimRgbVector[theNumberOfEntries];
-   }
-   for(unsigned long index = 0; index < theNumberOfEntries; ++index)
-   {
-      theLut[index] = lut.theLut[index];
-   }
-
-   return *this;
-}
-
-bool ossimRgbLutDataObject::operator ==(const ossimRgbLutDataObject& lut)const
-{
-   if(theNumberOfEntries != lut.theNumberOfEntries)
-   {
-      return false;
-   }
-   for(unsigned long index = 0; index < theNumberOfEntries; ++index)
-   {
-      if(theLut[index] != lut.theLut[index])
-      {
-         return false;
-      }
-   }
-   return true;
-}
-
-bool ossimRgbLutDataObject::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   kwl.add(prefix,
-           "type",
-           getClassName(),
-           true);
-   kwl.add(prefix,
-           "number_of_entries",
-           ossimString::toString(theNumberOfEntries).c_str(),
-           true);
-   for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
-   {
-      ossimString newPrefix = "entry";
-      newPrefix += ossimString::toString(index);
-      ostringstream ostr;
-      ostr << (int)(theLut[index].getR())
-           << " " << (int)(theLut[index].getG())
-           << " " << (int)(theLut[index].getB());
-      kwl.add(prefix,
-              newPrefix,
-              ostr.str().c_str(),
-              true);
-   }
-
-   return true;
-}
-
-bool ossimRgbLutDataObject::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   const char* lutFile = kwl.find(prefix, "lut_file");
-   ossimKeywordlist fileLut;
-   ossimKeywordlist* tempKwl = (const_cast<ossimKeywordlist*>(&kwl));
-   ossimString tempPrefix = prefix;
-
-   // this should have been used instead of lut_file.  We will still look
-   // for lut_file for backward compatibility.
-   //
-   if(!lutFile)
-   {
-      lutFile = kwl.find(prefix, "filename");
-   }
-   // check to see if we should open an external file
-   // if so point the fileLut to the one that we use
-   if(lutFile)
-   {
-      ossimFilename filename(lutFile);
-      if(filename.exists())
-      {
-         fileLut.addFile(filename.c_str());
-         tempKwl = &fileLut;
-         tempPrefix = "";
-      }
-   }
- 
-   const char* numberOfEntries = tempKwl->find(tempPrefix, "number_of_entries");
-   if(!numberOfEntries)
-   {
-      numberOfEntries = tempKwl->find(tempPrefix, "number_entries");
-   }
-   if(!numberOfEntries) return false;
-   theNumberOfEntries = ossimString(numberOfEntries).toULong();
-
-   delete [] theLut;
-   theLut = new ossimRgbVector[theNumberOfEntries];
-
-   if(tempKwl->find(tempPrefix, "entry0"))
-   {
-      for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
-      {
-         ossimString newPrefix = "entry";
-         newPrefix += ossimString::toString(index);
-         ossimString v = tempKwl->find(tempPrefix, newPrefix.c_str());
-         istringstream istr(v);
-
-         ossimString r, g, b;
-         istr >> r >> g >> b;
-         theLut[index].setR((unsigned char)r.toInt32());
-         theLut[index].setG((unsigned char)g.toInt32());
-         theLut[index].setB((unsigned char)b.toInt32());
-      }
-   }
-   else
-   {
-      for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
-      {
-         ossimString newPrefix = "entry";
-         newPrefix += ossimString::toString(index);
-         
-         const char* r = tempKwl->find(tempPrefix, (newPrefix+".r").c_str());
-         const char* g = tempKwl->find(tempPrefix, (newPrefix+".g").c_str());
-         const char* b = tempKwl->find(tempPrefix, (newPrefix+".b").c_str());
-         
-         if(r)
-         {
-            theLut[index].setR((unsigned char)ossimString(r).toLong());
-         }
-         if(g)
-         {
-            theLut[index].setG((unsigned char)ossimString(g).toLong());
-         }
-         if(b)
-         {
-            theLut[index].setB((unsigned char)ossimString(b).toLong());
-         }
-      }
-   }
-   return true;
-}
-
diff --git a/ossim/src/ossim/base/ossimRtti.cpp b/ossim/src/ossim/base/ossimRtti.cpp
deleted file mode 100644
index 489ce78..0000000
--- a/ossim/src/ossim/base/ossimRtti.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-
-#include <iostream>
-#include <cstring>
-#include <cstdlib>
-#include <algorithm>
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimRtti.h>
-
-static const RTTITypeinfo* RTTI_base_null_type[] = { 0 };
-
-const RTTITypeinfo* RTTIdyntypeid::a[] = { 0 };
-
-const RTTITypeinfo RTTITypeinfo::null_type = RTTITypeinfo("NULL", RTTI_base_null_type,0,0);
-
-void RTTITypeinfo::add_subtype(const RTTITypeinfo* t)		//Adds t as last RTTITypeinfo in the
-{		
-  subtypes.push_back(t);
-  ns = subtypes.size();
-							//'subtypes' list. For this, the
-/*   const RTTITypeinfo** ptr = new const RTTITypeinfo*[ns+1];		//list is realloc'd with one extra entry.
-   int i; for(i=0;i<ns;i++) ptr[i] = subtypes[i];
-   ptr[i] = t;
-   ns++;
-   delete[] subtypes;
-   subtypes = ptr;
-   */
-}
-
-void RTTITypeinfo::del_subtype(const RTTITypeinfo* t) 		//Searches for t in the subtypes list
-{	
-
-  SubtypesConstVector::iterator iter = std::find(subtypes.begin(), subtypes.end(), t);
-  if(iter != subtypes.end())
-  {
-    subtypes.erase(iter);
-    ns = subtypes.size();
-  }
-								//of this and removes it, if found.
-
-//   int i; for(i=0;i<ns && subtypes[i]!=t;i++);
-//   if (i<ns)
-//     for(;i<ns-1;i++) subtypes[i] = subtypes[i+1];
-}
-
-RTTITypeinfo::RTTITypeinfo(const char* name,
-                           const RTTITypeinfo* bb[],
-                           void* (*f1)(int,void*),
-                           void* (*f2)())
-{
-  n = "";
-  if(name) n = name;
-  b = bb; //ns = 0; subtypes = 0;		//Create default RTTITypeinfo
-  cast    = f1;								//Attach casting func
-  new_obj = f2;								//Attach creation func
-  int i = 0;
-  for(i=0;b[i];i++)							//Add this as subtype to all its basetypes
-     ((RTTITypeinfo**)b)[i]->add_subtype(this);				//REMARK: Harmless const castaway
-}
-
-const char* RTTITypeinfo::getname() const
-{
-  return n.c_str();
-}
-
-
-RTTITypeinfo::~RTTITypeinfo()
-{
-//   if(n)
-//   {
-//      free(n);
-//      n = NULL;
-//   }
-   int i = 0;
-   for(i=0;b[i];i++)
-   {
-      //Del this subtype from all its basetypes
-      ((RTTITypeinfo**)b)[i]->del_subtype(this); //REMARK: Harmless const castaway
-   }
-}
-
-int RTTITypeinfo::has_base(const RTTITypeinfo* p) const
-{
-  int i = 0;
-   for(i=0;b[i];i++)							//for all bases of this...
-      if (p->same(b[i]) || b[i]->has_base(p)) return 1;				//match found, return 1 or no match, search deeper
-   return 0;									//no match at all, return 0
-}
-
-void* RTTITypeinfo::create(const RTTITypeinfo* bt, const char* c) const	//Tries to create an obj of type-name
-{										//given by char*. Searches for this type in the
-   void* p = 0; int i;								//type-DAG rooted by this, creates it and returns
-										//it as cast to 'bt', where bt is either this or a
-										//direct base of this.
-   if (!strcmp(c,getname()))								//Want to create an obj of this type ?
-      p = (new_obj)? new_obj() : 0;						//Yes, do it if this type is instantiable.
-   else										//No, try with subclasses...
-      for(i=0;i<ns && !((p=subtypes[i]->create(this,c)));i++);			//Succeeded creating on ith subclass branch ?
-   if (!p) return 0;								//Couldn't create it in any way, abort.
-   if (bt==this) i = -1;							//Must cast to this's own type (i==-1)
-   else for(i=0;b[i] && b[i]!=bt;i++);						//Search to which base of this we should cast
-									        //Found: cast to ith base of this
-   return cast(i,p);								//Cast to ith base of to this, return as void*
-}
-
-RTTItypeid RTTItypeid::find_baseclass(const char* name)const
-{
-   if(strcmp(name, getname())==0)
-   {
-      return *this;
-   }
-   else if(num_baseclasses() == 0)
-   {
-      if(strcmp(name, getname()) == 0)
-      {
-         return *this;
-      }
-      return null_type();
-   }
-   else
-   {
-      int index = 0;
-
-      while(index < num_baseclasses())
-      {
-         RTTItypeid typeId = baseclass(index);
-         if(typeId == *this)
-         {
-	   return *this;//null_type();
-         }
-         if(strcmp(name, typeId.getname()) == 0)
-         {
-            return *this;
-         }
-         ++index;
-      }
-      index = 0;
-      while(index < num_baseclasses())
-      {
-         RTTItypeid typeId = baseclass(index);
-         if(typeId.find_baseclass(name) == typeId.null_type())
-         {
-            ++index;
-         }
-         else
-         {
-            return typeId;
-         }
-      }
-   }
-   return null_type();
-}
diff --git a/ossim/src/ossim/base/ossimScalarTypeLut.cpp b/ossim/src/ossim/base/ossimScalarTypeLut.cpp
deleted file mode 100644
index f4db442..0000000
--- a/ossim/src/ossim/base/ossimScalarTypeLut.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimScalarTypeLUT.
-// 
-//*******************************************************************
-//  $Id: ossimScalarTypeLut.cpp 22072 2013-01-04 13:46:52Z dburken $
-
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimString.h>
-
-ossimScalarTypeLut* ossimScalarTypeLut::theInstance = NULL;
-
-ossimScalarTypeLut* ossimScalarTypeLut::instance()
-{
-   if (!theInstance)
-   {
-      theInstance = new ossimScalarTypeLut;
-   }
-   return theInstance;
-}
-
-ossimScalarTypeLut::ossimScalarTypeLut()
-{
-   //---
-   // Complete initialization of data member "theTable".
-   // Note:  Scalar types defined in constants.h file.
-   //---
-   ossimKeyValueMap entry;
-   entry.init(OSSIM_SCALAR_UNKNOWN, "unknown");
-   theTable.push_back(entry);
-   
-   entry.init(OSSIM_UINT8, "ossim_uint8");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SINT8, "ossim_sint8");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_UINT16, "ossim_uint16");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SINT16, "ossim_sint16");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_UINT32, "ossim_uint32");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SINT32, "ossim_sint32");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_UINT64, "ossim_uint64");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SINT64, "ossim_sint64");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_FLOAT32, "ossim_float32");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_FLOAT64, "ossim_float64");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_CINT16, "ossim_cint16");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_CINT32, "ossim_cint32");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_CFLOAT32, "ossim_cfloat32");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_CFLOAT64, "ossim_cfloat64");
-   theTable.push_back(entry);
-   
-   entry.init(OSSIM_UCHAR, "uchar");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_USHORT16, "ushort16");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SSHORT16, "sshort16");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_USHORT11, "ushort11");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_FLOAT, "float");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_NORMALIZED_FLOAT, "normalized_float");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_NORMALIZED_DOUBLE, "normalized_double");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_DOUBLE, "double");
-   theTable.push_back(entry);
-
-   // Short forms:
-
-   entry.init(OSSIM_UINT8, "U8");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SINT8, "S8");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_USHORT11, "U11");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_UINT16, "U16");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SINT16, "S16");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_FLOAT32, "F32");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_FLOAT64, "F64");
-   theTable.push_back(entry);
-   
-   entry.init(OSSIM_NORMALIZED_FLOAT, "N32");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_NORMALIZED_DOUBLE, "N64");
-   theTable.push_back(entry);
-
-   // Forms from old code "radiometry" key in ossimImageMetaData:
-   
-   entry.init(OSSIM_UINT8, "8-bit");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_USHORT11, "11-bit");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_UINT16, "16-bit unsigned");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_SINT16, "16-bit signed");
-   theTable.push_back(entry);
-   
-   entry.init(OSSIM_UINT32, "32-bit unsigned");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_FLOAT32, "float");
-   theTable.push_back(entry);
-   
-   entry.init(OSSIM_NORMALIZED_FLOAT, "normalized float");
-   theTable.push_back(entry);
-
-   entry.init(OSSIM_FLOAT64, "double");
-   theTable.push_back(entry);
-   
-   entry.init(OSSIM_NORMALIZED_DOUBLE, "normalized double");
-   theTable.push_back(entry);
-}
-
-ossimScalarTypeLut::~ossimScalarTypeLut()
-{
-   theInstance = NULL;
-}
-
-ossimScalarType
-ossimScalarTypeLut::getScalarTypeFromString(const ossimString& s) const
-{
-   int scalar_type = getEntryNumber(s.c_str());
-   
-   if (scalar_type == -1)
-   {
-      return OSSIM_SCALAR_UNKNOWN;
-   }
-   
-   return static_cast<ossimScalarType>(scalar_type);
-}   
-
-ossimKeyword ossimScalarTypeLut::getKeyword() const
-{
-   return ossimKeyword((ossimKeywordNames::SCALAR_TYPE_KW), "");
-}
diff --git a/ossim/src/ossim/base/ossimSource.cpp b/ossim/src/ossim/base/ossimSource.cpp
deleted file mode 100644
index d94ccbf..0000000
--- a/ossim/src/ossim/base/ossimSource.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/base/ossimSource.h>
-#include <ossim/base/ossimDataObject.h>
-#include <ossim/base/ossimIdManager.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimBooleanProperty.h>
-
-RTTI_DEF2(ossimSource, "ossimSource",
-          ossimConnectableObject, ossimErrorStatusInterface)
-
-
-ossimSource::ossimSource(ossimObject* owner)
-   :
-      ossimConnectableObject(owner),
-      theEnableFlag(true),
-      theInitializedFlag(false)
-{
-}
-
-ossimSource::ossimSource(const ossimSource &rhs)
-   :
-      ossimConnectableObject(rhs),
-      theEnableFlag(rhs.theEnableFlag),
-      theInitializedFlag(rhs.theInitializedFlag)
-{
-}
-
-ossimSource::ossimSource(ossimObject* owner,
-                         ossim_uint32 inputListSize,
-                         ossim_uint32 outputListSize,
-                         bool inputListIsFixedFlag,
-                         bool outputListIsFixedFlag)
-   :
-      ossimConnectableObject(owner, inputListSize, outputListSize,
-                             inputListIsFixedFlag, outputListIsFixedFlag),
-      theEnableFlag(true),
-      theInitializedFlag(false)
-{}
-
-ossimSource::~ossimSource()   
-{
-}
-
-bool ossimSource::saveState(ossimKeywordlist& kwl,
-                            const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::ENABLED_KW,
-           (int)theEnableFlag,
-           true);
-
-   return ossimConnectableObject::saveState(kwl, prefix);
-}
-
-bool ossimSource::loadState(const ossimKeywordlist& kwl,
-                            const char* prefix)
-{
-   const char* lookup = kwl.find(prefix,
-                                 ossimKeywordNames::ENABLED_KW);
-   if(lookup)
-   {
-      theEnableFlag = ossimString(lookup).toBool();
-   }
-
-   return ossimConnectableObject::loadState(kwl, prefix);
-}
-
-bool ossimSource::isSourceEnabled()const
-{
-   return theEnableFlag;
-}
-
-void ossimSource::enableSource()
-{
-   setEnableFlag(true);
-}
-
-void ossimSource::disableSource()
-{
-   setEnableFlag(false);
-}
-
-bool ossimSource::getEnableFlag() const
-{
-   return theEnableFlag;
-}
-
-void ossimSource::setEnableFlag(bool flag)
-{
-   theEnableFlag = flag;
-}
-
-bool ossimSource::isInitialized() const
-{
-   return theInitializedFlag;
-}
-
-void ossimSource::setInitializedFlag(bool flag)
-{
-   theInitializedFlag = flag;
-}
-
-void ossimSource::initialize()
-{
-}
-
-void ossimSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid()) return;
-
-   ossimString name = property->getName();
-   name = name.downcase();
-   
-   if(name == ossimKeywordNames::ENABLED_KW)
-   {
-      ossimString value;
-      
-      property->valueToString(value);
-      setEnableFlag(value.toBool());
-   }
-   else
-   {
-      ossimConnectableObject::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimSource::getProperty(const ossimString& name)const
-{
-   if( (name == "Enabled") || (name == ossimKeywordNames::ENABLED_KW) )
-   {
-      return new ossimBooleanProperty(ossimKeywordNames::ENABLED_KW,theEnableFlag);
-   }
-   return ossimConnectableObject::getProperty(name);
-}
-
-void ossimSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimConnectableObject::getPropertyNames(propertyNames);
-   
-   propertyNames.push_back(ossimKeywordNames::ENABLED_KW);
-}
-
-const ossimSource& ossimSource::operator=(const ossimSource& /* rhs */)
-{
-   return *this;
-}
-
-std::ostream& ossimSource::print(std::ostream& out) const
-{
-   out << "ossimSource::print:\n"
-      << "theEnableFlag:       " << theEnableFlag
-      << "\ntheInitializedFlag:  " << theInitializedFlag
-      << endl;
-
-   return ossimErrorStatusInterface::print(out);
-}
-
diff --git a/ossim/src/ossim/base/ossimStdOutProgress.cpp b/ossim/src/ossim/base/ossimStdOutProgress.cpp
deleted file mode 100644
index 1008a58..0000000
--- a/ossim/src/ossim/base/ossimStdOutProgress.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimStdOutProgress.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iomanip>
-#include <ossim/base/ossimStdOutProgress.h>
-
-RTTI_DEF1(ossimStdOutProgress, "ossimStdOutProgress", ossimProcessListener);
-
-ossimStdOutProgress theStdOutProgress;
-
-ossimStdOutProgress::ossimStdOutProgress(ossim_uint32 precision,
-                                         bool flushStream)
-   :
-      ossimProcessListener(),
-      thePrecision(precision),
-      theFlushStreamFlag(flushStream)
-{
-}
-
-void ossimStdOutProgress::processProgressEvent(ossimProcessProgressEvent& event)
-{
-   if (event.getOutputMessageFlag())
-   {
-      ossimString s;
-      event.getMessage(s);
-      if (!s.empty())
-      {
-		  ossimNotify(ossimNotifyLevel_NOTICE) << s.c_str() << std::endl;
-      }
-      return; // Don't output percentage on a message update.
-   }
-
-   
-   double p = event.getPercentComplete();
-   ossimNotify(ossimNotifyLevel_NOTICE)
-	   << std::setiosflags(std::ios::fixed)
-      << std::setprecision(thePrecision)
-      << p << "%\r";
-   
-   if(theFlushStreamFlag)
-   {
-      (p != 100.0) ?
-         ossimNotify(ossimNotifyLevel_NOTICE).flush() :
-         ossimNotify(ossimNotifyLevel_NOTICE) << "\n";
-   }
-}
-
-void ossimStdOutProgress::setFlushStreamFlag(bool flag)
-{
-   theFlushStreamFlag = flag;
-}
-
-
diff --git a/ossim/src/ossim/base/ossimStreamFactory.cpp b/ossim/src/ossim/base/ossimStreamFactory.cpp
deleted file mode 100644
index 16a80c5..0000000
--- a/ossim/src/ossim/base/ossimStreamFactory.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//
-//*******************************************************************
-//  $Id: ossimStreamFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-//
-#include <ossim/base/ossimStreamFactory.h>
-#include <fstream>
-#include <ossim/ossimConfig.h>
-#include <ossim/base/ossimFilename.h>
-#if OSSIM_HAS_LIBZ
-#include <ossim/base/ossimGzStream.h>
-#endif
-
-
-ossimStreamFactory* ossimStreamFactory::theInstance = 0;
-
-ossimStreamFactory::ossimStreamFactory()
-   : ossimStreamFactoryBase()
-{
-}
-
-ossimStreamFactory::~ossimStreamFactory()
-{
-}
-
-ossimStreamFactory* ossimStreamFactory::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimStreamFactory();
-   }
-
-   return theInstance;
-}
-
-ossimRefPtr<ossimIFStream> ossimStreamFactory::createNewIFStream(
-   const ossimFilename& file,
-   std::ios_base::openmode openMode) const
-{
-   ossimRefPtr<ossimIFStream> result = 0;
-   
-#if OSSIM_HAS_LIBZ
-   ossimFilename copyFile = file;
-
-   if(!copyFile.exists())
-   {
-      ossimString ext = copyFile.ext();
-      copyFile.setExtension("gz");
-      if(!copyFile.exists())
-      {
-         copyFile.setExtension(ext);
-         copyFile += ".gz";
-
-         if(!copyFile.exists())
-         {
-            return result;
-         }
-      }
-   }
-   
-   std::ifstream in(copyFile.c_str(), std::ios::in|std::ios::binary);
-
-   if(!in) return result;
-
-   unsigned char buf[2];
-
-   in.read((char*)buf, 2);
-   in.close();
-   // check for gzip magic number
-   //
-   if((buf[0] == 0x1F) &&
-      (buf[1] == 0x8B))
-   {
-      result = new ossimIgzStream(copyFile.c_str(), openMode);
-   }
-#endif
-   return result;
-}
-
-ossimStreamFactory::ossimStreamFactory(const ossimStreamFactory&)
-   : ossimStreamFactoryBase()
-{}
-
-
-
-
diff --git a/ossim/src/ossim/base/ossimStreamFactoryRegistry.cpp b/ossim/src/ossim/base/ossimStreamFactoryRegistry.cpp
deleted file mode 100644
index 97249c0..0000000
--- a/ossim/src/ossim/base/ossimStreamFactoryRegistry.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimStreamFactoryRegistry.cpp 22648 2014-02-28 14:34:29Z gpotts $
-//
-#include <ossim/base/ossimStreamFactoryRegistry.h>
-#include <ossim/base/ossimStreamFactory.h>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/base/ossimFilename.h>
-
-#include <fstream>
-#include <algorithm>
-
-ossimStreamFactoryRegistry* ossimStreamFactoryRegistry::theInstance = 0;
-
-ossimStreamFactoryRegistry::ossimStreamFactoryRegistry()
-{
-}
-
-ossimStreamFactoryRegistry::~ossimStreamFactoryRegistry()
-{
-}
-
-ossimStreamFactoryRegistry* ossimStreamFactoryRegistry::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimStreamFactoryRegistry();
-      theInstance->registerFactory(ossimStreamFactory::instance());
-   }
-
-   return theInstance;
-}
-
-ossimRefPtr<ossimIFStream>
-ossimStreamFactoryRegistry::createNewIFStream(
-   const ossimFilename& file,
-   std::ios_base::openmode openMode) const
-{
-   ossim_uint32 idx = 0;
-   ossimRefPtr<ossimIFStream> result = 0;
-   for(idx = 0; ((idx < theFactoryList.size())&&(!result)); ++idx)
-   {
-      result = theFactoryList[idx]->createNewIFStream(file, openMode);
-   }
-
-   if(!result)
-   {
-      result = new ossimIFStream(file.c_str(),
-                                 openMode);
-//       result = new std::ifstream(file.c_str(),
-//                                  openMode);
-   }
-   
-   return result;
-}
-
-
-void ossimStreamFactoryRegistry::registerFactory(ossimStreamFactoryBase* factory)
-{
-   std::vector<ossimStreamFactoryBase*>::iterator iter = std::find(theFactoryList.begin(),
-                                                                  theFactoryList.end(),
-                                                                  factory);
-   if(iter == theFactoryList.end())
-   {
-      theFactoryList.push_back(factory);
-   }
-}
-
-ossimStreamFactoryRegistry::ossimStreamFactoryRegistry(const ossimStreamFactoryRegistry&)
-{}
diff --git a/ossim/src/ossim/base/ossimString.cpp b/ossim/src/ossim/base/ossimString.cpp
deleted file mode 100644
index 038346b..0000000
--- a/ossim/src/ossim/base/ossimString.cpp
+++ /dev/null
@@ -1,1088 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: This class extends the stl's string class.
-// 
-//********************************************************************
-// $Id: ossimString.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cctype> /* for toupper */
-#include <cstdlib> /* for getenv() */
-#include <stack> 
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <stdlib.h>
-#include <algorithm>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimHexString.h>
-
-static ossimTrace traceDebug("ossimString:debug");
-
-#ifdef OSSIM_ID_ENABLED
-static char OSSIM_ID[] = "$Id: ossimString.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-
-ossimString ossimString::upcase(const ossimString& aString)
-{
-   std::string s = aString.string();
-   
-   std::string::iterator eachCharacter = s.begin();
-   while(eachCharacter != s.end())
-   {
-      *eachCharacter = toupper(*eachCharacter);
-      eachCharacter++;
-   }
-
-   return s;
-}
-
-ossimString ossimString::downcase(const ossimString& aString)
-{
-   std::string s = aString.m_str;
-
-   std::string::iterator eachCharacter = s.begin();
-   while(eachCharacter != s.end())
-   {
-      *eachCharacter = tolower(*eachCharacter);
-      ++eachCharacter;
-   }
-
-   return ossimString(s);
-}
-
-ossimString& ossimString::upcase()
-{
-   std::string::iterator eachCharacter = m_str.begin();
-   while(eachCharacter != m_str.end())
-   {
-      *eachCharacter = toupper(*eachCharacter);
-      ++eachCharacter;
-   }
-
-   return *this;
-}
-
-ossimString ossimString::upcase()const
-{
-   ossimString result(*this);
-   result.upcase();
-   return result;
-}
-
-ossimString& ossimString::downcase()
-{
-   std::string::iterator eachCharacter = m_str.begin();
-   while(eachCharacter != m_str.end())
-   {
-      *eachCharacter = tolower(*eachCharacter);
-      ++eachCharacter;
-   }
-   
-   return *this;
-}
-
-ossimString ossimString::downcase()const
-{
-   ossimString result(*this);
-   result.downcase();
-   return result;
-}
-
-char* ossimString::stringDup()const
-{
-   char *result = 0;
-
-   if(length() == 0)
-   {
-      result = new char[1];
-      result[0] = '\0';
-   }
-   else
-   {  
-      ossim_uint32 index = 0;
-      ossim_uint32 len = (ossim_uint32)m_str.length();
-      result = new char[len+1];
-      const char* sourceString = m_str.c_str();
-
-      while(index < len) 
-      {
-         result[index] = sourceString[index];
-         ++index;
-      }
-      result[len] = '\0';
-   }
-   return result;
-}
-
-ossimString ossimString::stripLeading(const ossimString &value, char characterToStrip)
-{
-   std::string s;
-   ossimString::const_iterator stringIter = value.m_str.begin();
-   
-   while((*stringIter == characterToStrip)&&(stringIter!=value.m_str.end()))
-   {
-      ++stringIter;
-   }
-
-   while(stringIter != value.m_str.end())
-   {
-      s += *stringIter;
-      ++stringIter;
-   }
-   
-   return ossimString(s);
-}
-
-ossimString ossimString::substitute(const ossimString &searchKey,
-                                    const ossimString &replacementValue,
-                                    bool replaceAll)const
-{
-   std::string result = m_str;
-
-   size_type pos = result.find(searchKey.m_str);
-   
-   if (pos == std::string::npos) return result;  // Search key not found.
-   
-   if(replaceAll)
-   {
-      while(pos != std::string::npos)
-      {
-         result.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
-         pos = result.find(searchKey.m_str, pos+replacementValue.m_str.size());
-      }
-   }
-   else  // Replace only the first instance.
-   {
-      result.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
-   }
-
-   return ossimString(result);
-}
-
-ossimString& ossimString::gsub(const ossimString &searchKey,
-                               const ossimString &replacementValue,
-                               bool replaceAll)
-{
-   size_type pos = m_str.find(searchKey.m_str);
-   
-   if (pos == std::string::npos) return *this;  // Search key not found.
-   
-   if(replaceAll)
-   {
-      while(pos < m_str.size())
-      {
-         m_str.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
-         pos = find(searchKey.m_str, pos+replacementValue.m_str.size());
-      }
-   }
-   else  // Replace only the first instance.
-   {
-      m_str.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
-   }
-
-   return *this;
-}
-
-ossimString  ossimString::trim(const ossimString& valueToTrim) const
-{
-   ossimString tempString(*this);
-   
-   return tempString.trim(valueToTrim);
-}
-
-ossimString& ossimString::trim(const ossimString& valueToTrim)
-{
-   if(m_str.size() == 0) return *this;
-   if(valueToTrim.empty()) return *this;
-   iterator startPos = (*this).begin();
-   iterator endPos   = (*this).begin() + ((*this).size()-1);
-
-   while( ( startPos != (*this).end() ) &&
-          (std::find(valueToTrim.begin(),
-                     valueToTrim.end(),
-                     *startPos)!=valueToTrim.end()) ) ++startPos;
-
-   if(startPos == (*this).end())
-   {
-      *this = "";
-      return *this;
-   }
-   
-   while( (endPos!=startPos)&& (std::find(valueToTrim.begin(),
-                                          valueToTrim.end(),
-                                          *endPos)!=valueToTrim.end())) --endPos;
-
-   *this = ossimString(startPos, endPos+1);
-
-   return *this;
-}
-
-ossimString ossimString::beforePos(std::string::size_type pos)const
-{
-   ossimString result = *this;
-
-   if(pos < length())
-   {
-      result.erase(pos, std::string::npos);
-   }
-
-   return result;
-}
-
-ossimString ossimString::afterPos(std::string::size_type pos)const
-{
-   ossimString result = *this;
-
-   if(pos < length())
-   {
-      result.erase(0, pos+1);
-   }
-   else
-   {
-      return "";
-   }
-
-   return result;
-   
-}
-
-std::vector<ossimString> ossimString::explode(const ossimString& delimeter) const
-{
-   ossimString exp_str = *this;
-   std::vector<ossimString> result;
-   char* tokenPtr;
-
-   tokenPtr = strtok((char*)exp_str.c_str(), (char*)delimeter.c_str());
-
-   while(tokenPtr != NULL)
-   {
-      result.push_back(tokenPtr);
-      tokenPtr = strtok(NULL, delimeter.c_str());
-   }
-
-   return result;
-}
-
-ossimString ossimString::expandEnvironmentVariable() const
-{
-   ossimString result(*this);
-   std::stack<ossim_uint32> startChars;
-   ossimRegExp regExpStart("\\$\\(");
-
-   if(regExpStart.find(result.c_str()))
-   {
-      startChars.push(regExpStart.start());
-      while(!startChars.empty())
-      {
-         ossim_uint32 offset = startChars.top() + 2; // skip over the $(
-         
-         // We will replace like a stack by looking at the right most $(
-         //
-         if(regExpStart.find(result.c_str()+offset))
-         {
-            // maintain absolute offset to the original string
-            startChars.push(regExpStart.start()+offset);
-         }
-         else 
-         {
-            // now look for a closing ) for the stating $(
-            ossimRegExp regExpEnd("\\)");
-            if(regExpEnd.find(result.c_str()+startChars.top()))
-            {
-               ossimString envVarStr(result.begin()+startChars.top()+2,
-                                     result.begin()+startChars.top()+regExpEnd.start());
-               const char* lookup = getenv( envVarStr.c_str() );
-               if ( lookup )
-               {
-                  result.replace(result.begin()+startChars.top(),
-                                 result.begin()+startChars.top()+regExpEnd.start()+1,
-                                 ossimString(lookup));
-               }
-               else 
-               {
-                  if(traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                     << "In member function ossimString::expandEnvironmentVariable() "
-                     << "\n\tERROR: Environment variable("
-                     << envVarStr.c_str()
-                     << ") not found!"
-                     << std::endl;
-                  }
-                  result.replace(result.begin()+startChars.top(),
-                                 result.begin()+startChars.top()+regExpEnd.start()+1,
-                                 "");
-               }
-            }
-            startChars.pop();
-         }
-      }
-   }
-   
-   
-   return result;
-}
-
-//---
-// Regular expression pattern utilities
-//---
-
-ossimString ossimString::beforeRegExp(const char *regularExpressionPattern) const
-{   
-   ossimRegExp anExpression;
-   
-   anExpression.compile(regularExpressionPattern);
-
-   if(anExpression.find(c_str()))
-   {
-      if (anExpression.start() > 0)
-      {
-         return substr(0, anExpression.start());
-      }
-   }
-   
-   return ossimString("");
-}
-
-ossimString ossimString::fromRegExp(const char *regularExpressionPattern) const
-{   
-   ossimRegExp anExpression;
-   
-   anExpression.compile(regularExpressionPattern);
-
-   if(anExpression.find(c_str()))
-   {
-      if (anExpression.start() < size())
-      {
-         return substr(anExpression.start(), (size()-anExpression.start()));
-      }
-   }
-   
-   return ossimString("");
-}
-
-ossimString ossimString::afterRegExp(const char *regularExpressionPattern) const
-{   
-   ossimRegExp anExpression;
-   
-   anExpression.compile(regularExpressionPattern);
-
-   if(anExpression.find(c_str()))
-   {
-      if (anExpression.end() < size())
-      {
-         return substr(anExpression.end(), (size()-anExpression.end()));
-      }
-   }
-   
-   return ossimString("");
-}
-
-ossimString ossimString::match(const char *regularExpressionPattern) const
-{   
-   ossimRegExp anExpression;
-   
-   anExpression.compile(regularExpressionPattern);
-
-   if((anExpression.find(this->c_str())) &&
-      (anExpression.start() !=anExpression.end()))
-   {
-      return this->substr(anExpression.start(),
-                          anExpression.end() - anExpression.start() );
-   }
-
-   
-   return ossimString("");
-}
-
-ossimString ossimString::replaceAllThatMatch(const char *regularExpressionPattern,
-                                             const char *value) const
-{
-   ossimString result = *this;
-   ossimRegExp anExpression;
-   std::string::size_type offset     = 0;
-   std::string::size_type valueLength = ossimString(value).length();
-   anExpression.compile(regularExpressionPattern);
-   if(!anExpression.is_valid())
-   {
-      return *this;
-   }
-   while(anExpression.find(result.c_str()+offset))
-   {
-      if(anExpression.start() < anExpression.end())
-      {
-         result.replace(anExpression.start() + offset,
-                        anExpression.end()-anExpression.start(),
-                        value);
-         offset += anExpression.start() + valueLength;
-      }
-      else
-      {
-         break;
-      }
-   }
-
-   return result;
-}
-
-ossimString ossimString::replaceStrThatMatch(const char *regularExpressionPattern,
-                                             const char *value) const
-{
-   ossimString result = *this;
-   ossimRegExp anExpression;
-   anExpression.compile(regularExpressionPattern);
-   if(!anExpression.is_valid())
-   {
-      return *this;
-   }
-   if(anExpression.find(result.c_str()))
-   {
-      if(anExpression.start() < anExpression.end())
-      {
-         result.replace(anExpression.start(),
-                        anExpression.end()-anExpression.start(),
-                        value);
-      }
-   }
-
-   return result;
-}
-
-bool ossimString::toBool()const
-{
-   ossimString s = c_str();
-   if (s.empty())
-   {
-      return false;
-   }
-   
-   s = s.downcase();
-   if ( (s == "true") ||
-        (s == "yes")  ||
-        (s == "y")    ||
-        (s == "1") )
-   {
-      return true;
-   }
-   else if ( (s == "false") ||
-             (s == "no")    ||
-             (s == "n")     ||
-             (s == "0") )
-   {
-      return false;
-      
-   }
-   else if (toInt32())
-   {
-      return true;
-   }
-
-   return false;
-}
-
-bool ossimString::toBool(const ossimString& aString)
-{
-   // Check for true or false, yes or no, y or n, and 1 or 0...
-   ossimString s = aString;
-   if (s.empty())
-   {
-      return false;
-   }
-   s.downcase();
-   if ( (s == "true") ||
-        (s == "yes")  ||
-        (s == "y")    ||
-        (s == "1") )
-   {
-      return true;
-   }
-   else if ( (s == "false") ||
-             (s == "no")    ||
-             (s == "n")     ||
-             (s == "0") )
-   {
-      return false;
-      
-   }
-   else if (aString.toInt32())
-   {
-      return true;
-   }
-
-   return false;
-}
-
-ossim_uint8 ossimString::toUInt8()const
-{
-   // Note the std::istringstream::operator>> does not work with unsigned 8 bit.
-   ossim_uint16 i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-        i = 0;
-      }
-   }
-   return static_cast<ossim_uint8>(i);
-}
-
-ossim_uint8 ossimString::toUInt8(const ossimString& aString)
-{
-   return aString.toUInt8();
-}
-
-int ossimString::toInt()const
-{
-   int i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-int ossimString::toInt(const ossimString& aString)
-{
-   return aString.toInt();
-}
-
-ossim_int16 ossimString::toInt16()const
-{
-   ossim_int16 i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-ossim_int16 ossimString::toInt16(const ossimString& aString)
-{
-   return aString.toInt16();
-}
-
-ossim_uint16 ossimString::toUInt16()const
-{
-   ossim_uint16 i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-ossim_uint16 ossimString::toUInt16(const ossimString& aString)
-{
-   return aString.toUInt16();
-}
-
-ossim_int32 ossimString::toInt32()const
-{
-   ossim_int32 i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-ossim_int32 ossimString::toInt32(const ossimString& aString)
-{
-   return aString.toInt32();
-}
-
-ossim_uint32 ossimString::toUInt32()const
-{
-   ossim_uint32 i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-ossim_uint32 ossimString::toUInt32(const ossimString& aString)
-{
-   return aString.toUInt32();
-}
-
-ossim_int64 ossimString::toInt64()const
-{
-   ossim_int64 i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-ossim_int64 ossimString::toInt64(const ossimString& aString)
-{
-   return aString.toInt64();
-}
-
-ossim_uint64 ossimString::toUInt64()const
-{
-   ossim_uint64 i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-ossim_uint64 ossimString::toUInt64(const ossimString& aString)
-{
-   return aString.toUInt64();
-}
-
-long ossimString::toLong()const
-{
-  long i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-long ossimString::toLong(const ossimString& aString)
-{
-   return aString.toLong();
-}
-
-unsigned long  ossimString::toULong()const
-{
-   unsigned long i = 0;
-   if (!empty())
-   {
-      std::istringstream is(m_str);
-      is >> i;
-      if(is.fail())
-      {
-         i = 0;
-      }
-   }
-   return i;
-}
-
-unsigned long ossimString::toULong(const ossimString& aString)
-{
-   return aString.toULong();
-}
-
-ossim_float32 ossimString::toFloat32()const
-{
-   if(contains("nan"))
-   {
-      return ossim::nan();
-   }
-   ossim_float32 d = 0.0;
-   // this part is core dumping under mingw in ossimPlanet.
-   // There is a possibility that this isn't a thread safe implementation
-   // in mingw stl.  Let's resort back to atof for now
-
-#if 0
-   d = (ossim_float32)atof(c_str());
-#endif
-#if 1
-   if (!empty())
-   {
-      std::istringstream is(c_str());
-      is >> d;
-      if(is.fail())
-      {
-         d = 0.0;
-      }
-   }
-#endif
-   return d;
-}
-
-ossim_float32 ossimString::toFloat32(const ossimString& aString)
-{
-   return aString.toFloat32();
-}
-
-ossim_float64 ossimString::toFloat64()const
-{
-   if(contains("nan"))
-   {
-      return ossim::nan();
-   }
-   ossim_float64 d = 0.0;
-   // this part is core dumping under mingw in ossimPlanet.
-   // There is a possibility that this isn't a thread safe implementation
-   // in mingw stl.  Let's resort back to atof for now
-
-#if 0
-   d = (ossim_float64)atof(c_str());
-#endif
-#if 1
-   if (!empty())
-   {
-      std::istringstream is(c_str());
-      is >> d;
-      if(is.fail())
-      {
-         d = 0.0;
-      }
-   }
-#endif
-   return d;
-}
-
-ossim_float64 ossimString::toFloat64(const ossimString& aString)
-{
-   return aString.toFloat64();
-}
-
-double ossimString::toDouble()const
-{
-   if(contains("nan"))
-   {
-      return ossim::nan();
-   }
-   double d = 0.0;
-
-   // this part is core dumping under mingw in ossimPlanet.
-   // There is a possibility that this isn't a thread safe implementation
-   // in mingw stl.  Let's resort back to atof for now
-
-   if (!empty())
-   {
-#if 0
-      d = atof(c_str());
-#endif
-#if 1
-      if(!empty())
-      {
-         std::istringstream is(c_str());
-         is >> d;
-         if(is.fail())
-         {
-            d = 0.0;
-         }
-      }
-#endif
-   }
-   return d;
-}
-
-double ossimString::toDouble(const ossimString& aString)
-{
-   return aString.toDouble();
-}
-
-ossimString ossimString::toString(bool aValue)
-{
-   std::ostringstream s;
-   s << aValue;
-   ossimString result(s.str());
-   return result;
-}
-
-ossimString ossimString::toString(ossim_int16 aValue)
-{
-   std::ostringstream s;
-   s << aValue;
-   ossimString result(s.str());
-   return result;
-}
-
-ossimString ossimString::toString(ossim_uint16 aValue)
-{
-   std::ostringstream s;
-   s << aValue;
-   ossimString result(s.str());
-   return result;
-}
-
-ossimString ossimString::toString(ossim_int32 aValue)
-{
-   std::ostringstream s;
-   s << aValue;
-   ossimString result(s.str());
-   return result;
-}
-
-ossimString ossimString::toString(ossim_uint32 aValue)
-{
-   std::ostringstream s;
-   s << aValue;
-   ossimString result(s.str());
-   return result;
-}
-
-ossimString ossimString::toString(ossim_int64 aValue)
-{
-   std::ostringstream s;
-   s << aValue;
-   ossimString result(s.str());
-   return result;
-}
-
-ossimString ossimString::toString(ossim_uint64 aValue)
-{
-   std::ostringstream s;
-   s << aValue;
-   ossimString result(s.str());
-   return result;
-}
-
-ossimString ossimString::toString(ossim_float32 aValue,
-                                  ossim_int32 precision,
-                                  bool fixed)
-{
-   if ( ossim::isnan(aValue) )
-   {
-      return ossimString("nan");
-   }
-
-   std::ostringstream s;
-   s << std::setprecision(precision);
-   
-   if (fixed)
-   {
-      s << std::setiosflags(std::ios::fixed); 
-   }
-   
-   s << aValue;
-   
-   return ossimString(s.str());
-}
-
-ossimString ossimString::toString(ossim_float64 aValue,
-                                  ossim_int32 precision,
-                                  bool fixed)
-{
-   if ( ossim::isnan(aValue) )
-   {
-      return ossimString("nan");
-   }
-   
-   std::ostringstream s;
-   s << std::setprecision(precision);
-   
-   if (fixed)
-   {
-      s << std::setiosflags(std::ios::fixed); 
-   }
-   
-   s << aValue;
-   
-   return ossimString(s.str());
-}
-
-ossimString ossimString::before(const ossimString& str,
-                                std::string::size_type pos)const
-{
-   if(*this == "") return ossimString();
-
-   size_type last = find(str.c_str(), pos);
-   if(last >= std::string::npos) return *this;
-   
-   return ossimString( substr(0, last) );
-}
-
-ossimString ossimString::after(const ossimString& str,
-                               std::string::size_type pos)const
-{
-   size_type last = find(str.c_str(), pos);
-   if (last >= std::string::npos) return ossimString();
-   
-   return ossimString( substr(last+str.length()) );
-}
-
-//*************************************************************************************************
-// Splits this string into a vector of strings (fields) using the delimiter list specified.
-// If a delimiter is encountered at the beginning or the end of this, or two delimiters are 
-// contiguous, a blank field is inserted in the vector, unless skipBlankFields is true.
-//*************************************************************************************************
-void ossimString::split(std::vector<ossimString>& result,
-                        const ossimString& separatorList,
-                        bool skipBlankFields)const
-{
-	if(this->empty()) return;
-   
-   std::string::const_iterator iterStart = m_str.begin();
-   std::string::const_iterator iterCurrent = m_str.begin();
-   
-   while(iterCurrent != m_str.end())
-   {
-      if(std::find(separatorList.m_str.begin(), separatorList.m_str.end(), *iterCurrent) != separatorList.m_str.end())
-      {
-         if(iterStart == iterCurrent)
-         {
-            if(!skipBlankFields)
-            {
-               result.push_back(ossimString());
-            }
-         }
-         else 
-         {
-            result.push_back(ossimString(iterStart, iterCurrent));
-         }
-
-         ++iterCurrent;
-         iterStart = iterCurrent;
-      }
-      else 
-      {
-         ++iterCurrent;
-      }
-   }
-   if(iterStart!=iterCurrent)
-   {
-      result.push_back(ossimString(iterStart, iterCurrent));
-   }
-   
-#if 0   
-//   result = split(separatorList);
-   ossimString copyString = *this;
-
-   char* s = strtok(const_cast<char*>(copyString.c_str()),
-                    separatorList.c_str());
-
-   for(std::string::size_type i = 0; i < separatorList.size(); ++ i)
-   {
-      if (((*(this->begin())) == separatorList.c_str()[i]) && !skipBlankFields)
-         result.push_back("");
-   }
-   while(s)
-   {
-      result.push_back(ossimString(s));
-      if ((*s != 0) || !skipBlankFields)
-         s = strtok(NULL, separatorList.c_str());
-   }
-   for(std::string::size_type i = 0; i < separatorList.size(); ++ i)
-   {
-      if (((*(this->end()-1)) == separatorList.c_str()[i]) && !skipBlankFields)
-         result.push_back("");
-   }
-#endif
-}
-
-std::vector<ossimString> ossimString:: split(const ossimString& separatorList,
-                                             bool skipBlankFields)const
-{
-   std::vector<ossimString> result;
-
-   split(result, separatorList, skipBlankFields);
-   
-   return result;
-}
-
-const ossimString& ossimString::join(const std::vector<ossimString>& stringList,
-                                     const ossimString& separator)
-{
-   *this = "";
-   if(stringList.size())
-   {
-      for(long i = 0; i < ((long)stringList.size()-1); ++i)
-      {
-         *this += stringList[i];
-         *this += separator;
-      }
-      *this += stringList[stringList.size()-1];
-   }
-
-   return *this;
-}
-
-ossimString ossimString::urlEncode()const
-{
-   ossimString::const_iterator iter = begin();
-   ossimString result;
-   while(iter != end())
-   {
-      ossim_uint8 c = *iter;
-      
-      if(c > 47 && c < 58)
-      {
-         result += c;
-      }
-      else if(c > 64 && c < 91)
-      {
-         result += c;
-      }
-      else if(c > 96 && c < 123)
-      {
-         result+=c;
-      }
-      else if (c == 32)
-      {
-         result+="+";
-      }
-      else
-      {
-         result += ("%" + ossimHexString(c));
-      }
-      
-      ++iter;
-   }
-
-  return result;
-   
-}
-
-ossimString ossimString::getOssimId() const
-{
-#ifdef OSSIM_ID_ENABLED
-   return ossimString(OSSIM_ID);
-#endif
-   return ossimString("");
-}
-
-
diff --git a/ossim/src/ossim/base/ossimStringListProperty.cpp b/ossim/src/ossim/base/ossimStringListProperty.cpp
deleted file mode 100644
index 28b365c..0000000
--- a/ossim/src/ossim/base/ossimStringListProperty.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimStringListProperty.cpp 19682 2011-05-31 14:21:20Z dburken $
-//
-#include <sstream>
-#include <algorithm>
-#include <ossim/base/ossimStringListProperty.h>
-#include <ossim/base/ossimKeywordlist.h>
-RTTI_DEF1(ossimStringListProperty, "ossimStringListProperty", ossimProperty);
-
-ossimStringListProperty::ossimStringListProperty(const ossimString& name,
-                                                 const std::vector<ossimString>& value)
-   :ossimProperty(name),
-    theValueList(value),
-    theUniqueFlag(false),
-    theOrderMattersFlag(false)
-{
-}
-
-ossimStringListProperty::ossimStringListProperty(const ossimStringListProperty& rhs)
-   :ossimProperty(rhs),
-    theValueList(rhs.theValueList),
-    theConstraintList(rhs.theConstraintList),
-    theUniqueFlag(rhs.theUniqueFlag),
-    theOrderMattersFlag(rhs.theOrderMattersFlag),
-    theMinNumberOfValues(rhs.theMinNumberOfValues),
-    theMaxNumberOfValues(rhs.theMaxNumberOfValues)
-{
-}
-   
-ossimObject* ossimStringListProperty::dup()const
-{
-   return new ossimStringListProperty(*this);
-}
-
-const ossimProperty& ossimStringListProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-
-   ossimStringListProperty *rhsPtr = PTR_CAST(ossimStringListProperty,
-                                              &rhs);
-
-   if(rhsPtr)
-   {
-      theValueList         = rhsPtr->theValueList;
-      theConstraintList    = rhsPtr->theConstraintList;
-      theUniqueFlag        = rhsPtr->theUniqueFlag;
-      theOrderMattersFlag  = rhsPtr->theOrderMattersFlag;
-      theMinNumberOfValues = rhsPtr->theMinNumberOfValues;
-      theMaxNumberOfValues = rhsPtr->theMaxNumberOfValues;
-   }
-
-   return *this;
-}
-
-bool ossimStringListProperty::setValue(const ossimString& value)
-{
-   ossimKeywordlist kwl;
-   std::istringstream in(value);
-   bool result = true;
-   
-   if(kwl.parseStream(in))
-   {
-      int idx = 0;
-      std::vector<ossimString> keys =
-         kwl.getSubstringKeyList( "^([0-9]*" );
-      
-      std::vector<int> theNumberList(keys.size());
-      for(idx = 0; idx < (int)theNumberList.size();++idx)
-      {
-         theNumberList[idx] = keys[idx].toInt();
-      }
-      std::sort(theNumberList.begin(), theNumberList.end());
-      clearValueList();
-      for(idx = 0; idx < (int)theNumberList.size(); ++idx)
-      {
-         const char* temp = kwl.find(ossimString::toString(theNumberList[idx]));
-
-         if(temp)
-         {
-            addValue(temp);
-         }
-      }
-   }
-   else
-   {
-      result = false;
-   }
-
-   return result;
-}
-
-void ossimStringListProperty::valueToString(ossimString& valueResult)const
-{
-   ossimKeywordlist kwl;
-   int idx = 0;
-
-   for(idx = 0; idx < (int)theValueList.size(); ++idx)
-   {
-      kwl.add(ossimString::toString(idx).c_str(),
-              theValueList[idx],
-              true);
-   }
-   
-   valueResult = kwl.toString();
-}
-
-
-void ossimStringListProperty::clearValueList()
-{
-   theValueList.clear();
-}
-
-ossimString ossimStringListProperty::getValueAt(int idx)const
-{
-   if((idx >= 0)&&
-      (idx < (int)getNumberOfValues()))
-   {
-      return theValueList[idx];
-   }
-   
-   return ossimString("");;
-}
-
-bool ossimStringListProperty::setValueAt(int idx,
-                                         const ossimString& value)
-{
-   bool result = true;
-   
-   if(canAddValue(value))
-   {
-      if((idx < (int)getNumberOfValues())&&
-         (idx >= 0))
-      {
-         theValueList[idx] = value;
-      }
-   }
-   else
-   {
-      result = false;
-   }
-   return result;
-   
-}
-
-bool ossimStringListProperty::addValue(const ossimString& value)
-{
-   bool result = true;
-   
-   if(canAddValue(value))
-   {
-      theValueList.push_back(value);
-   }
-   else
-   {
-      result = false;
-   }
-
-   return result;
-}
- 
-ossim_uint32 ossimStringListProperty::getNumberOfValues()const
-{
-   return (int)theValueList.size();
-}
-
-ossim_uint32 ossimStringListProperty::getNumberOfContraints()const
-{
-   return (ossim_uint32)theConstraintList.size();
-}
-
-ossimString ossimStringListProperty::getConstraintAt(ossim_uint32 idx)const
-{
-   if(idx < theConstraintList.size())
-   {
-      return theConstraintList[(int)idx];
-   }
-
-   return ossimString("");
-}
-
-void ossimStringListProperty::setConstraints(const std::vector<ossimString>& constraints)
-{
-   theConstraintList =  constraints;
-}
-
-bool ossimStringListProperty::hasConstraints()const
-{
-   return (theConstraintList.size()>0);
-}
-
-void ossimStringListProperty::setUniqueFlag(bool flag)
-{
-   theUniqueFlag = flag;
-}
-
-void ossimStringListProperty::setOrderMattersFlag(bool flag)
-{
-   theOrderMattersFlag = flag;
-}
-
-void ossimStringListProperty::setNumberOfValuesBounds(int minNumber,
-                                                      int maxNumber)
-{
-   theMinNumberOfValues = minNumber;
-   theMaxNumberOfValues = maxNumber;
-}
-
-void ossimStringListProperty::getNumberofValuesBounds(int& minNumber,
-                                                      int& maxNumber)const
-{
-   minNumber = theMinNumberOfValues;
-   maxNumber = theMaxNumberOfValues;
-}
-
-bool ossimStringListProperty::findValueInConstraintList(const ossimString& value)const
-{
-   return (std::find(theConstraintList.begin(),
-                     theConstraintList.end(),
-                     value)!=theConstraintList.end());
-}
-
-bool ossimStringListProperty::findValueInValueList(const ossimString& value)const
-{
-   return (std::find(theValueList.begin(),
-                     theValueList.end(),
-                     value)!=theConstraintList.end());
-}
-
-bool ossimStringListProperty::canAddValue(const ossimString& value)const
-{
-   bool result = true;
-
-   if(hasConstraints())
-   {
-      if(findValueInConstraintList(value))
-      {
-         if(theUniqueFlag)
-         {
-            if(findValueInValueList(value))
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-   }
-
-   return result;
-}
diff --git a/ossim/src/ossim/base/ossimStringProperty.cpp b/ossim/src/ossim/base/ossimStringProperty.cpp
deleted file mode 100644
index 1e3c1bd..0000000
--- a/ossim/src/ossim/base/ossimStringProperty.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// LICENSE: MIT see top level license.txt
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimStringProperty.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <ossim/base/ossimStringProperty.h>
-#include <algorithm>
-RTTI_DEF1(ossimStringProperty, "ossimStringProperty", ossimProperty);
-
-ossimStringProperty::ossimStringProperty(const ossimString& name,
-                                         const ossimString& value,
-                                         bool editableFlag,
-                                         const std::vector<ossimString>& constraintList)
-   :ossimProperty(name),
-    theValue(value),
-    theEditableFlag(editableFlag),
-    theConstraints(constraintList)
-{
-}
-
-ossimStringProperty::ossimStringProperty(const ossimStringProperty& rhs)
-   :ossimProperty(rhs),
-    theValue(rhs.theValue),
-    theEditableFlag(rhs.theEditableFlag),
-    theConstraints(rhs.theConstraints)
-{
-}
-
-ossimObject* ossimStringProperty::dup()const
-{
-   return new ossimStringProperty(*this);
-}
-
-const ossimProperty& ossimStringProperty::assign(const ossimProperty& rhs)
-{
-   ossimProperty::assign(rhs);
-   
-   ossimStringProperty* rhsPtr = PTR_CAST(ossimStringProperty,
-					  &rhs);
-   
-   theValue        = rhs.valueToString();
-   
-   if(rhsPtr)
-     {
-       theEditableFlag = rhsPtr->theEditableFlag;
-       theConstraints  = rhsPtr->theConstraints;
-     }
-   
-   return *this;
-}
-
-
-void ossimStringProperty::setEditableFlag(bool flag)
-{
-   theEditableFlag = flag;
-}
-
-bool ossimStringProperty::getEditableFlag()const
-{
-   return theEditableFlag;
-}
-
-bool ossimStringProperty::isEditable()const
-{
-   return (getEditableFlag() == true);
-}
-
-
-void ossimStringProperty::clearConstraints()
-{
-   theConstraints.clear();
-}
-
-void ossimStringProperty::setConstraints(const std::vector<ossimString>& constraintList)
-{
-   theConstraints = constraintList;
-}
-
-void ossimStringProperty::addConstraint(const ossimString& value)
-{
-   theConstraints.push_back(value);
-}
-
-const std::vector<ossimString>& ossimStringProperty::getConstraints()const
-{
-   return theConstraints;
-}
-
-bool ossimStringProperty::hasConstraints()const
-{
-   return (theConstraints.size() > 0);
-}
-
-bool ossimStringProperty::setValue(const ossimString& value)
-{
-   bool result = true;
-   
-   if(theConstraints.size() > 0)
-   {
-      if(std::find(theConstraints.begin(),
-                   theConstraints.end(),
-                   value)
-                    != theConstraints.end())
-      {
-         theValue = value;
-      }
-      else
-      {
-         result = false;
-      }
-   }
-   else
-   {
-      theValue = value;
-   }
-
-   return result;
-}
-
-void ossimStringProperty::valueToString(ossimString& valueResult)const
-{
-   valueResult = theValue;
-}
diff --git a/ossim/src/ossim/base/ossimTempFilename.cpp b/ossim/src/ossim/base/ossimTempFilename.cpp
deleted file mode 100644
index 1379cb9..0000000
--- a/ossim/src/ossim/base/ossimTempFilename.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// Description: This is a tmeporary filename class it will create a temporary
-//              file and will also delete it upon destruction
-//
-//*************************************************************************
-// $Id: ossimTempFilename.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <stdlib.h>
-#include <fstream>
-#include <ossim/base/ossimTempFilename.h>
-#include <ossim/base/ossimEnvironmentUtility.h>
-#include <time.h>
-
-ossimTempFilename::ossimTempFilename(const ossimString& tempDir,
-                                     const ossimString& prefix,
-                                     const ossimString& extension,
-                                     bool autodelete,
-                                     bool useWildcardDelete)
-   :theTempDir(tempDir),
-    thePrefix(prefix),
-    theExtension(extension),
-    theAutoDeleteFlag(autodelete),
-    theWildCardDeleteFlag(useWildcardDelete)
-{
-}
-
-ossimTempFilename::~ossimTempFilename()
-{
-   if(*((ossimFilename*)this) != "")
-   {
-      
-      if(theAutoDeleteFlag)
-      {
-         if(theWildCardDeleteFlag)
-         {
-            wildcardRemove(*this + ".*");
-         }
-         else
-         {
-            remove();
-         }
-      }
-   }
-}
-
-void  ossimTempFilename::generateRandomFile()
-{
-   generate(false);
-}
-
-void ossimTempFilename::generateRandomDir()
-{
-   generate(true);
-}
-
-void ossimTempFilename::generate(bool createAsDirectoryFlag)
-{
-   srand(time(0));
-   ossimString tempDirCopy = theTempDir;
-
-   if(tempDirCopy == "")
-   {
-      tempDirCopy = ossimEnvironmentUtility::instance()->getEnvironmentVariable("TEMP");
-      if(tempDirCopy=="")
-      {
-         tempDirCopy  = ossimEnvironmentUtility::instance()->getEnvironmentVariable("TMP");
-      }
-      if(tempDirCopy == "")
-      {
-         if(ossimFilename("/tmp").exists())
-         {
-            tempDirCopy = "/tmp";
-         }
-      }
-   }
-
-   int count = 0;
-   int randNumber1 = rand();
-   ossimFilename prefixDir = ossimFilename(tempDirCopy);
-   ossimFilename result = prefixDir.dirCat(thePrefix+
-                                           ossimString::toString(randNumber1));
-   
-   while((count < RAND_MAX)&&result.exists())
-   {
-      randNumber1 = rand();
-      result = prefixDir.dirCat(thePrefix+
-                                ossimString::toString(randNumber1));
-      
-      ++count;
-   }
-
-   if(theExtension != "")
-   {
-      result = result.setExtension(theExtension);
-   }
-   *((ossimFilename*)this) = result;
-   if(result != "")
-   {
-      if(createAsDirectoryFlag)
-      {
-         createDirectory();
-      }
-      else
-      {
-         std::ofstream out(result.c_str());
-         out.close();
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/base/ossimTieGpt.cpp b/ossim/src/ossim/base/ossimTieGpt.cpp
deleted file mode 100644
index dbcd1b7..0000000
--- a/ossim/src/ossim/base/ossimTieGpt.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/base/ossimTieGpt.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-//*******************************************************************
-
-std::ostream& ossimTieGpt::print(std::ostream& os) const
-{
-   os << "( ";
-   os << dynamic_cast<const ossimGpt&>(*this);
-   os << ", ";
-   os << tie;
-   os << ", ";
-   if (ossim::isnan(score) == false)
-   {
-      os << std::setiosflags(std::ios::fixed) << std::setprecision(15);
-      os << score;
-   } else {
-      os << "nan";
-   }
-   os << " )";
-
-   return os;
-}
-
-std::ostream& ossimTieGpt::printTab(std::ostream& os) const
-{
-   os << std::setiosflags(std::ios::fixed) << std::setprecision(15);
-   os<< lond() ;
-   os<<"\t"<< latd();
-   os<<"\t"<< height();
-   os<<"\t"<< tie.x;
-   os<<"\t"<< tie.y;
-   os<<"\t"<< score;
-
-   return os;
-}
-
-std::ostream& operator<<(std::ostream& os, const ossimTieGpt& pt)
-{
-   return pt.print(os);
-}
-
-std::istream& operator>>(std::istream& is, ossimTieGpt& pt)
-{
-   //---
-   // Expected input format:
-   // ( (ossimDPt), (ossimDpt), score )
-   // score is real or nan
-   //---
-
-   // Start with a nan point.
-   pt.makeNan();
-   // Check the stream.
-   if (!is) return is;
-
-   ossimString tempString;
-
-   // Gobble the "(".
-   is >> tempString;
-
-   //get the first point
-   is>>dynamic_cast<ossimGpt&>(pt);
-
-   // Eat the ",".
-   char c;
-   is.get(c);
-
-   //get the second point
-   is>>pt.tie;
-
-   // Eat the second ",".
-   is.get(c);
-
-   // Get the score
-   const int SZ = 64; // real number buffer size
-   char tempChars[SZ];
-   is.get(tempChars, SZ, ',');
-   if (!is) return is;
-   tempChars[SZ-1] = '\0';
-   tempString = tempChars;
-   tempString.trim();
-   if (tempString == "nan")
-   {
-      pt.score = ossim::nan();
-   }
-   else
-   {
-      pt.score = tempString.toDouble();
-   }
-
-   // Gobble the trailing ")".
-   is >> tempString;
-   
-   // Finished
-   return is;
-}
-
-//constants for GML 2.1.2
-const char* GROUND_GML2      = "ground/gml:Point";
-const char* IMAGE_GML2       = "image/gml:Point";
-const char* SCORE_GML2       = "score";
-const char* COORD_GML2       = "gml:coord";
-const char* COORDINATES_GML2 = "gml:coordinates";
-
-ossimRefPtr<ossimXmlNode>
-ossimTieGpt::exportAsGmlNode(ossimString aGmlVersion)const
-{   
-   ossimRefPtr<ossimXmlNode> node(new ossimXmlNode);
-   // check datum to be WGS84
-   if ( !(datum()->operator==(*(ossimDatumFactory::instance()->wgs84()))) )
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode datum must be WGS84\n";
-      return node;
-   }
-   // check nans in lon/lat and in tie
-   if (isLatNan() || isLonNan() || tie.hasNans())
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode positions have nan\n";
-      return node;
-   }
-   if (aGmlVersion[static_cast<std::string::size_type>(0)] == '2')
-   {
-      node->setTag("SimpleTiePoint");
-      // note: no "fid" attribute (feature id")
-      //store Ground Point WGS84 + height above ellipsoid in meters
-      ossimRefPtr<ossimXmlNode> gcoord =  node->addNode(ossimString(GROUND_GML2) + "/" + COORD_GML2 );
-      gcoord->addChildNode("X",ossimString::toString(lond()));
-      gcoord->addChildNode("Y",ossimString::toString(latd()));
-      if (!isHgtNan())
-      {
-        gcoord->addChildNode("Z",ossimString::toString(height())); //above ellipsoid
-      }
-
-      // store image tie point
-      ossimRefPtr<ossimXmlNode> tcoord =  node->addNode(ossimString(IMAGE_GML2) + "/" + COORD_GML2);
-      tcoord->addChildNode("X",ossimString::toString(tie.x));
-      tcoord->addChildNode("Y",ossimString::toString(tie.y));
-
-      //store score (change name to confidence?)
-      node->addNode(SCORE_GML2,ossimString::toString(score));
-   } else {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode Unsupported GML version : " << aGmlVersion <<"\n";
-   }
-   return node;
-}
-
-bool
-ossimTieGpt::importFromGmlNode(ossimRefPtr<ossimXmlNode> aGmlNode, ossimString aGmlVersion)
-{
-   //assuming datum is EPSG:4326 (aka WGS84)
-   //feature has to be a SimpleTiePoint feature
-   //TBD : add support for coord instead of coordinates
-   //TBD : more robust type checks (for X,Y,Z and score) - create extra protected function
-
-   //clear data
-   makeNan();
-   tie.makeNan();
-   score = 0;
-
-   if (aGmlVersion[static_cast<std::string::size_type>(0)] == '2')
-   {
-      //read ground point
-      ossimRefPtr<ossimXmlNode> gn = aGmlNode->findFirstNode(GROUND_GML2);
-      ossimRefPtr<ossimXmlNode> gcoord = gn->findFirstNode(COORD_GML2);
-      if (gcoord.valid())
-      {
-         //read coord
-         ossimRefPtr<ossimXmlNode> gx = gcoord->findFirstNode("X");
-         if (gx.valid())
-         {
-            lond(ossimString(gx->getText()).toDouble());
-         } else {
-            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no ground X found in coord\n";
-            return false;
-         }
-         ossimRefPtr<ossimXmlNode> gy = gcoord->findFirstNode("Y");
-         if (gy.valid())
-         {
-            latd(ossimString(gy->getText()).toDouble());
-         } else {
-            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no ground Y found in coord\n";
-            return false;
-         }
-         ossimRefPtr<ossimXmlNode> gz = gcoord->findFirstNode("Z");
-         if (gz.valid())
-         {
-            height(ossimString(gz->getText()).toDouble());
-         } // no Z value is possible
-      }
-      else {
-         //try to read coordinates
-         //TBD
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode gml:coordinates not developped yet for ground\n";
-         return false;
-      }
-
-      //read image point
-      ossimRefPtr<ossimXmlNode> in = aGmlNode->findFirstNode(IMAGE_GML2);
-      ossimRefPtr<ossimXmlNode> icoord = in->findFirstNode(COORD_GML2);
-      if (icoord.valid())
-      {
-         //read coord
-         ossimRefPtr<ossimXmlNode> ix = icoord->findFirstNode("X");
-         if (ix.valid())
-         {
-            tie.x = ossimString(ix->getText()).toDouble();
-         } else {
-            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no image X found in coord\n";
-            return false;
-         }
-         ossimRefPtr<ossimXmlNode> iy = icoord->findFirstNode("Y");
-         if (iy.valid())
-         {
-            tie.y = ossimString(iy->getText()).toDouble();
-         } else {
-            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no image Y found in coord\n";
-            return false;
-         }
-         //don't read Z value (shouldn't be any)
-      }
-      else {
-         //try to read coordinates
-         //TBD
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode gml:coordinates not developped yet for image\n";
-         return false;
-      }
-
-      //read score
-      ossimRefPtr<ossimXmlNode> scoren = aGmlNode->findFirstNode(SCORE_GML2);
-      if (scoren.valid())
-      {
-         score = ossimString(scoren->getText()).toDouble();
-      } else {
-         score = 0.0;
-      }
-      return true;
-   } else {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode Unsupported GML version : " << aGmlVersion <<"\n";
-      return false;
-   }
-}
diff --git a/ossim/src/ossim/base/ossimTileHash.cpp b/ossim/src/ossim/base/ossimTileHash.cpp
deleted file mode 100644
index cc7ee9f..0000000
--- a/ossim/src/ossim/base/ossimTileHash.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken Copied from TiledImageHash.
-//
-// Description: Hashing function for tiled rectangles.  WIll hash a
-//              dpt or a to a single index value.
-//
-// NOTE:  This works with rectangles that are positive in the line up
-//        (y) direction.
-//              
-//*******************************************************************
-//  $Id: ossimTileHash.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cfloat> // for FLT_EPSILON
-
-#include <ossim/base/ossimTileHash.h>
-
-ossimTileHash::ossimTileHash(const ossimDrect& imageRect,
-                             double tileWidth,
-                             double tileHeight)
-   :
-      ossimPointHash(),
-      theImageRect(imageRect)
-{
-   // make sure that the width of the tile is not larger than
-   // the width of the image rectangle.
-   if(theImageRect.width() <= tileWidth)
-   {
-      theTileWidth = theImageRect.width();
-      theNumberOfHorizTiles = 1;
-   }
-   else
-   {
-      theTileWidth          = tileWidth;
-      double tempDiv        = theImageRect.width()/theTileWidth;
-      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
-      theNumberOfHorizTiles = static_cast<long>(tempDiv);
-      
-      if(fabs(overFlow) > FLT_EPSILON) // if the extent went beyond a tile
-      {
-         theNumberOfHorizTiles ++;      // we must say it has another tile
-      }
-   }
-
-   // make sure the height of the tile is not larger than the
-   // height of the image rectangle.
-   if(theImageRect.height() <= tileHeight)
-   {
-      theTileHeight = theImageRect.height();
-      theNumberOfVertTiles = 1;
-   }
-   else
-   {
-      theTileHeight         = tileHeight;
-      double tempDiv        = theImageRect.height()/theTileHeight;
-      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
-      theNumberOfVertTiles = static_cast<long>(tempDiv);
-
-      if(fabs(overFlow) > FLT_EPSILON) // if the extent went beyond a tile
-      {
-         theNumberOfVertTiles ++;      // we must say it has another tile
-      }
-   }
-}
-
-ossimTileHash::~ossimTileHash()
-{
-}
-
-long ossimTileHash::operator()(const ossimFpt& aPoint)
-{
-   if ( (aPoint.x >= theImageRect.ul().x) &&
-        (aPoint.x <= theImageRect.lr().x) &&
-        (aPoint.y <= theImageRect.ul().y) &&
-        (aPoint.y >= theImageRect.lr().y) )
-   {
-      // how far is the point horizontally  from the upper left corner
-      double deltaWidth  = aPoint.x - theImageRect.ul().x;
-
-      // how far is the point vertically from the upper left point
-      double deltaHeight = theImageRect.ul().y - aPoint.y;
-
-      // solve the horizontal and vertical index numbers
-      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
-      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
-
-      // Map to a linear array.
-      // Just like you would index a 2-D array in memory
-      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
-   }
-
-   return -1;
-}
-
-long ossimTileHash::operator()(const ossimDpt& aPoint)
-{
-   if ( (aPoint.x >= theImageRect.ul().x) &&
-        (aPoint.x <= theImageRect.lr().x) &&
-        (aPoint.y <= theImageRect.ul().y) &&
-        (aPoint.y >= theImageRect.lr().y) )
-   {
-      // how far is the point horizontally  from the upper left corner
-      double deltaWidth  = aPoint.x - theImageRect.ul().x;
-
-      // how far is the point vertically from the upper left point
-      double deltaHeight = theImageRect.ul().y - aPoint.y;
-
-      // solve the horizontal and vertical index numbers
-      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
-      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
-
-      // Map to a linear array.
-      // Just like you would index a 2-D array in memory
-      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
-   }
-
-   return -1;
-}
-
diff --git a/ossim/src/ossim/base/ossimTiledImageHash.cpp b/ossim/src/ossim/base/ossimTiledImageHash.cpp
deleted file mode 100644
index 7b30ed3..0000000
--- a/ossim/src/ossim/base/ossimTiledImageHash.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description: Hashing function for tiled rectangles.  WIll hash a
-//              dpt to a single index value.
-//              
-//*******************************************************************
-//  $Id: ossimTiledImageHash.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cfloat> // for FLT_EPSILON
-
-#include <ossim/base/ossimTiledImageHash.h>
-
-
-ossimTiledImageHash::ossimTiledImageHash(const ossimDrect &imageRect,
-                                         double tileWidth,
-                                         double tileHeight)
-   :ossimPointHash(),
-    theImageRect(imageRect)
-{
-   // make sure that the width of the tile is not larger than
-   // the width of the image rectangle.
-   if(theImageRect.width() < tileWidth)
-   {
-      theTileWidth = theImageRect.width();
-      theNumberOfHorizTiles = 1;
-   }
-   else
-   {
-      theTileWidth          = tileWidth;
-      double tempDiv        = theImageRect.width()/theTileWidth;
-      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
-      theNumberOfHorizTiles = static_cast<long>(tempDiv);
-      
-      if(fabs(overFlow) >= FLT_EPSILON) // if the extent went beyond a tile
-      {
-         theNumberOfHorizTiles ++;      // we must say it has another tile
-      }
-   }
-
-   // make sure the height of the tile is not larger than the
-   // height of the image rectangle.
-   if(theImageRect.height() < tileHeight)
-   {
-      theTileHeight = theImageRect.height();
-      theNumberOfVertTiles = 1;
-   }
-   else
-   {
-      theTileHeight         = tileHeight;
-      double tempDiv        = theImageRect.height()/theTileHeight;
-      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
-      theNumberOfVertTiles = static_cast<long>(tempDiv);
-
-      if(fabs(overFlow) >= FLT_EPSILON) // if the extent went beyond a tile
-      {
-         theNumberOfVertTiles ++;      // we must say it has another tile
-      }
-   }
-
-}
-
-ossimTiledImageHash::~ossimTiledImageHash()
-{
-}
-
-long ossimTiledImageHash::operator()(const ossimDpt &aPoint)
-{
-   if(aPoint.x >= theImageRect.ul().x && aPoint.y >= theImageRect.ul().y)
-   {
-      // how far is the point horizontally  from the upper left corner
-      double deltaWidth  = aPoint.x - theImageRect.ul().x;
-
-      // how far is the point vertically from the upper left point
-      double deltaHeight = aPoint.y - theImageRect.ul().y;
-
-      // if deltas are negative then we are outside the
-      // bounds
-      if((deltaWidth < 0) || (deltaHeight < 0)) 
-      {
-         return -1;
-      }
-
-      // check if outside the rectangle
-      if( (deltaWidth > theNumberOfHorizTiles*theTileWidth)||
-          (deltaHeight > theNumberOfVertTiles*theTileHeight))
-      {
-         return -1;
-      }
-      // solve the horizontal and vertical index numbers
-      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
-      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
-
-      // map to a linear array.  Just like you would index a 2-D array in memory
-      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
-   }
-
-   return -1;
-}
-
-long ossimTiledImageHash::operator()(const ossimFpt &aPoint)
-{
-   if(aPoint.x >= theImageRect.ul().x && aPoint.y >= theImageRect.ul().y)
-   {
-      // how far is the point horizontally  from the upper left corner
-      double deltaWidth  = aPoint.x - theImageRect.ul().x;
-
-      // how far is the point vertically from the upper left point
-      double deltaHeight = aPoint.y - theImageRect.ul().y;
-
-      // if deltas are negative then we are outside the
-      // bounds
-      if((deltaWidth < 0) || (deltaHeight < 0)) 
-      {
-         return -1;
-      }
-
-      // check if outside the rectangle
-      if( (deltaWidth > theNumberOfHorizTiles*theTileWidth)||
-          (deltaHeight > theNumberOfVertTiles*theTileHeight))
-      {
-         return -1;
-      }
-      // solve the horizontal and vertical index numbers
-      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
-      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
-
-      // map to a linear array.  Just like you would index a 2-D array in memory
-      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
-   }
-
-   return -1;
-}
-
-
diff --git a/ossim/src/ossim/base/ossimTimer.cpp b/ossim/src/ossim/base/ossimTimer.cpp
deleted file mode 100644
index d0b35b8..0000000
--- a/ossim/src/ossim/base/ossimTimer.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* 
- * This code was taken directly from the OpenSceneGraph
- */
-//#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTimer.h>
-
-ossimTimer* ossimTimer::m_instance = 0;
-
-// follows are the constructors of the Timer class, once version
-// for each OS combination.  The order is WIN32, FreeBSD, Linux, IRIX,
-// and the rest of the world.
-//
-// all the rest of the timer methods are implemented within the header.
-
-
-ossimTimer* ossimTimer::instance()
-{
-   if(!m_instance)
-   {
-      m_instance = new ossimTimer;
-   }
-   return m_instance;
-}
-
-// ---
-// From:  http://msdn.microsoft.com/en-us/library/b0084kay.aspx
-// Defined for applications for Win32 and Win64. Always defined.
-// ---
-#if defined(_WIN32)
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <windows.h>
-#include <winbase.h>
-ossimTimer::ossimTimer()
-{
-   LARGE_INTEGER frequency;
-   if(QueryPerformanceFrequency(&frequency))
-   {
-      m_secsPerTick = 1.0/(double)frequency.QuadPart;
-   }
-   else
-   {
-      m_secsPerTick = 1.0;
-      ossimNotify(ossimNotifyLevel_NOTICE)<<"Error: ossimTimer::ossimTimer() unable to use QueryPerformanceFrequency, "<<std::endl;
-      ossimNotify(ossimNotifyLevel_NOTICE)<<"timing code will be wrong, Windows error code: "<<GetLastError()<<std::endl;
-   }
-   
-   setStartTick();        
-}
-
-ossimTimer::Timer_t ossimTimer::tick() const
-{
-   LARGE_INTEGER qpc;
-   if (QueryPerformanceCounter(&qpc))
-   {
-      return qpc.QuadPart;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)<<"Error: ossimTimer::ossimTimer() unable to use QueryPerformanceCounter, "<<std::endl;
-      ossimNotify(ossimNotifyLevel_NOTICE)<<"timing code will be wrong, Windows error code: "<<GetLastError()<<std::endl;
-      return 0;
-   }
-}
-
-#else
-
-#include <sys/time.h>
-
-ossimTimer::ossimTimer(  )
-{
-   m_secsPerTick = (1.0 / (double) 1000000);
-   
-   setStartTick();        
-}
-
-ossimTimer::Timer_t ossimTimer::tick() const
-{
-   struct timeval tv;
-   gettimeofday(&tv, NULL);
-   return ((ossimTimer::Timer_t)tv.tv_sec)*1000000+(ossimTimer::Timer_t)tv.tv_usec;
-}
-
-#endif
diff --git a/ossim/src/ossim/base/ossimTrace.cpp b/ossim/src/ossim/base/ossimTrace.cpp
deleted file mode 100644
index 55073d4..0000000
--- a/ossim/src/ossim/base/ossimTrace.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//*****************************************************************************
-// FILE: ossimTrace.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimTrace
-//
-// SOFTWARE HISTORY:
-//>
-//   24Apr2001  Oscar Kramer
-//              Initial coding.
-//<
-//*****************************************************************************
-// $Id: ossimTrace.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimTraceManager.h>
-#include <ossim/base/ossimCommon.h>
-//*****************************************************************************
-//  CONSTRUCTOR: ossimTrace
-//  
-//*****************************************************************************
-ossimTrace::ossimTrace(const ossimString& trace_name)
-   :
-      theTraceName   (trace_name),
-      theEnabledFlag (false)
-{
-   ossimTraceManager::instance()->addTrace(this);
-}
-
-ossimTrace::~ossimTrace()
-{
-   ossimTraceManager::instance()->removeTrace(this);
-}
-
-
diff --git a/ossim/src/ossim/base/ossimTraceManager.cpp b/ossim/src/ossim/base/ossimTraceManager.cpp
deleted file mode 100644
index 6e5abc9..0000000
--- a/ossim/src/ossim/base/ossimTraceManager.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//*****************************************************************************
-// Copyright (C) 2005 Garrett Potts, all rights reserved.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-// 
-// DESCRIPTION:
-//   Contains declaration of class ossimTraceManager.
-//
-//*****************************************************************************
-// $Id: ossimTraceManager.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <algorithm>
-
-#include <ossim/base/ossimTraceManager.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimRegExp.h>
-
-ossimTraceManager* ossimTraceManager::theInstance = 0;
-
-ossimTraceManager::ossimTraceManager()
-{
-   theInstance = this;
-}
-
-ossimTraceManager* ossimTraceManager::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimTraceManager;
-   }
-   
-   return theInstance;
-}
-
-void ossimTraceManager::setTracePattern(const ossimString& pattern)
-{
-   thePattern = pattern;
-   setTraceFlags(true);
-}
-
-void ossimTraceManager::addTrace(ossimTrace* traceObj)
-{
-   if(!traceObj)
-   {
-      return;
-   }
-   
-   std::vector<ossimTrace*>::iterator iter = std::find(theTraceList.begin(),
-                                                       theTraceList.end(),
-                                                       traceObj);
-   if(iter == theTraceList.end())
-   {
-      theTraceList.push_back(traceObj);
-
-      if(thePattern.size())
-      {
-         ossimRegExp rxp;
-         rxp.compile(thePattern.c_str());
-         if(rxp.find(traceObj->getTraceName().c_str()))
-         {
-            // Found a match so set the flag and increment the counter.
-            traceObj->setTraceFlag(true);
-         }
-         else
-         {
-            traceObj->setTraceFlag(false);
-         }
-      }
-      else
-      {
-         traceObj->setTraceFlag(false);
-      } 
-   }
-}
-
-void ossimTraceManager::removeTrace(ossimTrace* traceObj)
-{
-   std::vector<ossimTrace*>::iterator iter = std::find(theTraceList.begin(),
-                                                       theTraceList.end(),
-                                                       traceObj);
-
-   if(iter !=  theTraceList.end())
-   {
-      theTraceList.erase(iter);
-   }
-}
-
-void ossimTraceManager::setTraceFlags(bool flag)
-{
-   ossimRegExp rxp;
-   rxp.compile(thePattern.c_str());
-   
-   for(ossim_uint32 idx = 0; idx < theTraceList.size(); ++idx)
-   {
-      if (rxp.find(theTraceList[idx]->getTraceName().c_str()))
-      {
-         // Found a match so set the flag and increment the counter.
-         theTraceList[idx]->setTraceFlag(flag);
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/base/ossimUnitConversionTool.cpp b/ossim/src/ossim/base/ossimUnitConversionTool.cpp
deleted file mode 100644
index 462e643..0000000
--- a/ossim/src/ossim/base/ossimUnitConversionTool.cpp
+++ /dev/null
@@ -1,436 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimUnitConversionTool.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <iomanip>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/base/ossimGpt.h>
-
-std::ostream& operator<<(std::ostream& out,
-                         const ossimUnitConversionTool& data)
-{
-   out << std::setprecision(15) << std::setiosflags(std::ios::fixed)
-       << "Meters:           " << data.getMeters()
-       << "\nFeet:             " << data.getFeet()
-       << "\nU.S. Survey Feet: " << data.getUsSurveyFeet()
-       << "\nNautical miles:   " << data.getNauticalMiles()
-       << "\nDegrees:          " << data.getDegrees()
-       << "\nMinutes:          " << data.getMinutes()
-       << "\nSeconds:          " << data.getSeconds() << std::endl;
-   
-   return out;
-}
-
-ossimUnitConversionTool::ossimUnitConversionTool(double value,
-                                                 ossimUnitType unitType)
-   : theValue(value),
-     theUnitType(unitType),
-     theOrigin()
-{
-}
-
-ossimUnitConversionTool::ossimUnitConversionTool(const ossimGpt& origin,
-                                                 double value,
-                                                 ossimUnitType unitType)
-   : theValue(value),
-     theUnitType(unitType),
-     theOrigin(origin)
-{
-}
-
-void ossimUnitConversionTool::setOrigin(const ossimGpt& gpt)
-{
-   theOrigin = gpt;
-}
-
-ossimGpt ossimUnitConversionTool::getOrigin()const
-{
-   return theOrigin;
-}
-
-void ossimUnitConversionTool::getOrigin(ossimGpt& result)const
-{
-   result = theOrigin;
-}
-
-void ossimUnitConversionTool::setValue(double value,
-                                       ossimUnitType unitType)
-{
-   theValue    = value;
-   theUnitType = unitType;
-}
-
-double ossimUnitConversionTool::getValue(ossimUnitType unitType) const
-{
-   switch(unitType)
-   {
-      case OSSIM_METERS:
-      {
-         return getMeters();
-      }
-      case OSSIM_RADIANS:
-      {
-         return getRadians();
-      }
-      case OSSIM_DEGREES:
-      {
-         return getDegrees();
-      }
-      case OSSIM_US_SURVEY_FEET:
-      {
-         return getUsSurveyFeet();
-      }
-      case OSSIM_FEET:
-      {
-         return getFeet();
-      }
-      case OSSIM_SECONDS:
-      {
-         return getSeconds();
-      }
-      case OSSIM_MINUTES:
-      {
-         return getMinutes();
-      }
-      case OSSIM_NAUTICAL_MILES:
-      {
-         return getNauticalMiles();
-      }
-      case OSSIM_MILES:
-      {
-         return getMiles();
-      }
-      case OSSIM_MICRONS:
-      {
-         return getMicrons();
-      }
-      case OSSIM_CENTIMETERS:
-      {
-         return getCentimeters();
-      }
-      case OSSIM_MILLIMETERS:
-      {
-         return getMillimeters();
-      }
-      case OSSIM_YARDS:
-      {
-         return getYards();
-      }
-      case OSSIM_INCHES:
-      {
-         return getInches();
-      }
-      case OSSIM_KILOMETERS:
-      {
-         return getKilometers();
-      }
-      default:
-         break;
-   }
-
-   return ossim::nan();
-}
-
-void ossimUnitConversionTool::setMeters(double value)
-{
-   setValue(value, OSSIM_METERS);
-}
-
-void ossimUnitConversionTool::setRadians(double value)
-{
-   setValue(value, OSSIM_RADIANS);
-}
-
-void ossimUnitConversionTool::setDegrees(double value)
-{
-   setValue(value, OSSIM_DEGREES);
-}
-
-void ossimUnitConversionTool::setMinutes(double value)
-{
-   setValue(value, OSSIM_MINUTES);
-}
-
-void ossimUnitConversionTool::setSeconds(double value)
-{
-   setValue(value, OSSIM_SECONDS);
-}
-
-void ossimUnitConversionTool::setUsSurveyFeet(double value)
-{
-   setValue(value, OSSIM_US_SURVEY_FEET);
-}
-
-void ossimUnitConversionTool::setFeet(double value)
-{
-   setValue(value, OSSIM_FEET);
-}
-
-void ossimUnitConversionTool::setNauticalMiles(double value)
-{
-   setValue(value, OSSIM_NAUTICAL_MILES);
-}
-
-void ossimUnitConversionTool::setMiles(double value)
-{
-   setValue(value, OSSIM_MILES);
-}
-
-void ossimUnitConversionTool::setMillimeters(double value)
-{
-   setValue(value, OSSIM_MILLIMETERS);
-}
-
-void ossimUnitConversionTool::setMicrons(double value)
-{
-   setValue(value, OSSIM_MICRONS);
-}
-
-void ossimUnitConversionTool::setCentimeters(double value)
-{
-   setValue(value, OSSIM_CENTIMETERS);
-}
-
-void ossimUnitConversionTool::setYards(double value)
-{
-   setValue(value, OSSIM_YARDS);
-}
-
-void ossimUnitConversionTool::setInches(double value)
-{
-   setValue(value, OSSIM_INCHES);
-}
-
-void ossimUnitConversionTool::setKilometers(double value)
-{
-   setValue(value, OSSIM_KILOMETERS);
-}
-
-double ossimUnitConversionTool::getMeters()const
-{
-   if(theUnitType == OSSIM_METERS)
-   {
-      return theValue;
-   }
-   
-   return computeMeters();
-}
-
-double ossimUnitConversionTool::getRadians()const
-{
-   if(theUnitType == OSSIM_RADIANS)
-   {
-      return theValue;
-   }
-   return getDegrees()*RAD_PER_DEG;
-}
-
-double ossimUnitConversionTool::getDegrees()const
-{
-   switch (theUnitType)
-   {
-      case OSSIM_DEGREES:
-      {
-         return theValue;
-      }
-      case OSSIM_MINUTES:
-      {
-         return (theValue / 60.0);
-      }
-      case OSSIM_SECONDS:
-      {
-         return (theValue / 3600.0);
-      }
-      case OSSIM_RADIANS:
-      {
-         return (theValue * DEG_PER_RAD);
-      }
-      default:
-         break;
-   }
-   
-   ossimDpt pt = theOrigin.metersPerDegree();
-   return (computeMeters() /((pt.x+pt.y)*.5));
-}
-
-double ossimUnitConversionTool::getMinutes()const
-{
-   if(theUnitType == OSSIM_MINUTES)
-   {
-      return theValue;
-   }
-   return (getDegrees()*60.0);
-}
-
-double ossimUnitConversionTool::getSeconds()const
-{
-   if(theUnitType == OSSIM_SECONDS)
-   {
-      return theValue;
-   }
-   return (getDegrees()*3600.0);
-}
-
-double ossimUnitConversionTool::getUsSurveyFeet()const
-{
-   if(theUnitType == OSSIM_US_SURVEY_FEET)
-   {
-      return theValue;
-   }
-   return (computeMeters()/US_METERS_PER_FT);
-}
-
-double ossimUnitConversionTool::getFeet()const
-{
-   if(theUnitType == OSSIM_FEET)
-   {
-      return theValue;
-   }
-   return (computeMeters()*FT_PER_MTRS);
-}
-
-double ossimUnitConversionTool::getNauticalMiles()const
-{
-   if(theUnitType == OSSIM_NAUTICAL_MILES)
-   {
-      return theValue;
-   }
-   
-   return (computeMeters()/(theOrigin.metersPerDegree().y/60.0));
-}
-
-double ossimUnitConversionTool::getMiles()const
-{
-   if(theUnitType == OSSIM_MILES)
-   {
-      return theValue;
-   }
-   return ((computeMeters()*FT_PER_MTRS)/FT_PER_MILE);
-}
-
-double ossimUnitConversionTool::getMillimeters()const
-{
-   if(theUnitType == OSSIM_MILLIMETERS)
-   {
-      return theValue;
-   }
-   return ((computeMeters()*1e3));
-}
-
-double ossimUnitConversionTool::getMicrons()const
-{
-   if(theUnitType == OSSIM_MICRONS)
-   {
-      return theValue;
-   }
-   return ((computeMeters()*1e6));
-}
-
-double ossimUnitConversionTool::getCentimeters()const
-{
-   if(theUnitType == OSSIM_KILOMETERS)
-   {
-      return theValue;
-   }
-
-   return ((computeMeters()*1e2));   
-}
-
-double ossimUnitConversionTool::getYards()const
-{
-   if(theUnitType == OSSIM_INCHES)
-   {
-      return theValue;
-   }
-
-   return ((computeMeters()/0.914));   
-}
-
-double ossimUnitConversionTool::getInches()const
-{
-   if(theUnitType == OSSIM_INCHES)
-   {
-      return theValue;
-   }
-
-   return ((getFeet()*12.0));   
-}
-
-double ossimUnitConversionTool::getKilometers()const
-{
-   if(theUnitType == OSSIM_KILOMETERS)
-   {
-      return theValue;
-   }
-   return ((computeMeters()*1e-3));
-}
-
-double ossimUnitConversionTool::computeMeters()const
-{
-   switch(theUnitType)
-   {
-      case OSSIM_METERS:
-      {
-         return theValue;
-         break;
-      }
-      case OSSIM_RADIANS:
-      {
-         ossimDpt pt = theOrigin.metersPerDegree();
-         return (theValue*DEG_PER_RAD)*((pt.x+pt.y)*.5);
-      }
-      case OSSIM_DEGREES:
-      {
-         ossimDpt pt = theOrigin.metersPerDegree();
-         return theValue*((pt.x+pt.y)*.5);
-      }
-      case OSSIM_US_SURVEY_FEET:
-      {
-         return  US_METERS_PER_FT*theValue;
-      }
-      case OSSIM_FEET:
-      {
-         return MTRS_PER_FT*theValue;
-      }
-      case OSSIM_SECONDS:
-      {
-         ossimDpt pt = theOrigin.metersPerDegree();
-         return (theValue/3600.0)*((pt.x+pt.y)*.5);
-      }
-      case OSSIM_MINUTES:
-      {
-         ossimDpt pt = theOrigin.metersPerDegree();
-         return (theValue/60.0)*((pt.x+pt.y)*.5);
-      }
-      case OSSIM_NAUTICAL_MILES:
-      {
-         return (theOrigin.metersPerDegree().y/60.0)*theValue;
-      }
-      case OSSIM_MILES:
-      {
-         return MTRS_PER_FT*FT_PER_MILE*theValue;
-      }
-      case OSSIM_MILLIMETERS:
-      {
-         return (theValue/(1e3));
-      }
-      case OSSIM_MICRONS:
-      {
-         return (theValue/(1e6));
-      }
-      default:
-         break;
-   }
-
-   return ossim::nan();
-}
-
diff --git a/ossim/src/ossim/base/ossimViewListener.cpp b/ossim/src/ossim/base/ossimViewListener.cpp
deleted file mode 100644
index 36396ad..0000000
--- a/ossim/src/ossim/base/ossimViewListener.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-// Description: A brief description of the contents of the file.
-//
-//
-//*************************************************************************
-// $Id: ossimViewListener.cpp 9963 2006-11-28 21:11:01Z gpotts $
-#include <ossim/base/ossimViewListener.h>
-
-RTTI_DEF1(ossimViewListener, "ossimViewListener", ossimListener);
-void ossimViewListener::processEvent(ossimEvent& event)
-{
-   ossimViewEvent* evt = PTR_CAST(ossimViewEvent, &event);
-
-   if(evt)
-   {
-      switch(evt->getViewEventType())
-      {
-      case  ossimViewEvent::OSSIM_VIEW_EVENT_SCALE_CHANGE:
-      {
-         viewScaleChangeEvent(*evt);
-         break;
-      }
-      case  ossimViewEvent::OSSIM_VIEW_EVENT_TYPE_GENERIC:
-      {
-         viewEvent(*evt);
-         break;
-      }
-      case ossimViewEvent::OSSIM_VIEW_EVENT_TRANSFORM_CHANGE:
-      {
-         viewTransformChangeEvent(*evt);
-         break;
-      }
-      case ossimViewEvent::OSSIM_VIEW_EVENT_VIEW_TYPE_CHANGE:
-      {
-         viewTypeChangeEvent(*evt);
-         break;
-      }
-      }
-      allViewEvents(*evt);
-   }
-}
diff --git a/ossim/src/ossim/base/ossimVrect.cpp b/ossim/src/ossim/base/ossimVrect.cpp
deleted file mode 100644
index a1548e5..0000000
--- a/ossim/src/ossim/base/ossimVrect.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Contains class declaration for vrect.
-// Container class for four double points representing a rectangle
-// where y is up
-// 
-//*******************************************************************
-//  $Id: ossimVrect.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimVrect.h>
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-void ossimVrect::print(std::ostream& os) const
-{
-   os << theUlCorner << theLrCorner;
-}
-
-//*******************************************************************
-// friend function:
-//*******************************************************************
-std::ostream& operator<<(std::ostream& os, const ossimVrect& rect)
-{
-   rect.print(os);
-
-   return os;
-}
-
-ossimVrect::~ossimVrect()
-{
-}
-
diff --git a/ossim/src/ossim/base/ossimXmlAttribute.cpp b/ossim/src/ossim/base/ossimXmlAttribute.cpp
deleted file mode 100644
index 53cada7..0000000
--- a/ossim/src/ossim/base/ossimXmlAttribute.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc.  All rights reserved.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Oscar Kramer (ossim port by D. Burken)
-//
-// Description:
-//
-// Contains definition of class ossimXmlAttribute.
-//
-//*****************************************************************************
-// $Id: ossimXmlAttribute.cpp 23623 2015-11-13 18:24:28Z gpotts $
-
-#include <iostream>
-#include <sstream>
-
-#include <ossim/base/ossimXmlAttribute.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-RTTI_DEF2(ossimXmlAttribute, "ossimXmlAttribute", ossimObject, ossimErrorStatusInterface)
-
-static std::istream& xmlskipws(std::istream& in)
-{
-   int c = in.peek();
-   while((!in.fail())&&
-         ((c == ' ') ||
-          (c == '\t') ||
-          (c == '\n')||
-          (c == '\r')))
-   {
-      in.ignore(1);
-      c = in.peek();
-   }
-
-   return in;
-}
-
-ossimXmlAttribute::ossimXmlAttribute(ossimString& spec)
-{
-   std::stringstream in(spec);
-
-   read(in);
-}
-
-ossimXmlAttribute::ossimXmlAttribute(const ossimXmlAttribute& src)
-   :theName(src.theName),
-    theValue(src.theValue)
-{
-}
-
-bool ossimXmlAttribute::read(std::istream& in)
-{
-   xmlskipws(in);
-   if(in.fail()) return false;
-   if(readName(in))
-   {
-      xmlskipws(in);
-      if((in.peek() != '=')||
-         (in.fail()))
-      {
-         setErrorStatus();
-         return false;
-      }
-      in.ignore(1);
-      if(readValue(in))
-      {
-         return true;
-      }
-      else
-      {
-         setErrorStatus();
-         return false;
-      }
-   }
-   return false;
-
-#if 0
-   //
-   // Pull out name:
-   //
-   theName = spec.before('=');
-   theName = theName.trim();
-   if (theName.empty())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "ossimXmlAttribute::ossimXmlAttribute \n"
-                                           << "Bad attribute format encountered near:\n\""<< spec<<"\"\n"
-                                           << "Parsing aborted...\n";
-      setErrorStatus();
-
-      return;
-   }
-   spec = spec.after('=');
-
-   //***
-   // Read value:
-   //***
-   char quote_char = spec[0];
-   spec = spec.after(quote_char);  // after first quote
-   theValue = spec.before(quote_char); // before second quote
-
-   //
-   // Reposition attribute specification to the start of next attribute or end
-   // of tag:
-   //
-   spec = spec.after(quote_char);  // after second quote
-   ossimString next_entry ("-?[+0-9A-Za-z<>]+");
-   spec = spec.fromRegExp(next_entry.c_str());
-#endif
-}
-
-ossimXmlAttribute::~ossimXmlAttribute()
-{
-}
-
-ossimXmlAttribute::ossimXmlAttribute()
-{
-}
-
-ossimXmlAttribute::ossimXmlAttribute(const ossimString& name,
-                                     const ossimString& value)
-{
-   setNameValue(name, value);
-}
-
-const ossimString& ossimXmlAttribute::getName()  const
-{
-   return theName;
-}
-
-const ossimString& ossimXmlAttribute::getValue() const
-{
-   return theValue;
-}
-
-void ossimXmlAttribute::setNameValue(const ossimString& name,
-                                     const ossimString& value)
-{
-   theName  = name;
-   theValue = value;
-}
-
-void ossimXmlAttribute::setName(const ossimString& name)
-{
-   theName = name;
-}
-
-void ossimXmlAttribute::setValue(const ossimString& value)
-{
-   theValue = value;
-}
-
-std::ostream& operator << (std::ostream& os, const ossimXmlAttribute* xml_attr)
-{
-   os << " " << xml_attr->theName << "=\"" << xml_attr->theValue << "\"";
-
-   return os;
-}
-
-
-bool ossimXmlAttribute::readName(std::istream& in)
-{
-   xmlskipws(in);
-   theName = "";
-   char c = in.peek();
-   while((c != ' ')&&
-         (c != '\n')&&
-	 (c != '\r')&&
-         (c != '\t')&&
-         (c != '=')&&
-         (c != '<')&&
-         (c != '/')&&
-         (c != '>')&&
-         (!in.fail()))
-   {
-      theName += (char)in.get();
-      c = in.peek();
-   }
-
-   return ((!in.fail())&&
-           (theName != ""));
-}
-
-bool ossimXmlAttribute::readValue(std::istream& in)
-{
-   xmlskipws(in);
-   if(in.fail()) return false;
-   theValue = "";
-   char c = in.peek();
-   bool done = false;
-	char startQuote = '\0';
-   if((c == '\'')||
-      (c == '"'))
-   {
-      startQuote = c;
-      theValue += in.get();
-    while(!done&&!in.fail())
-      {
-         c = in.peek();
-         if(c==startQuote)
-         {
-            theValue += c;
-            done = true;
-            in.ignore(1);
-         }
-         else if(c == '\n')
-         {
-            done = true;
-         }
-         else
-         {
-            theValue += in.get();
-         }
-      }
-   }
-
-   bool is_empty = false;
-   std::string::size_type p = 0;
-   //then this could be empty with two qoutes
-    if(theValue.size() == 2 && theValue[p] == startQuote && theValue[p+1] == startQuote)
-    {
-       theValue = "";
-       is_empty = true;
-    }
-   if(theValue != "")
-   {
-      std::string::iterator startIter = theValue.begin();
-      std::string::iterator endIter   = theValue.end();
-      --endIter;
-      if(*startIter == startQuote)
-      {
-         ++startIter;
-      }
-      else
-      {
-         return false;
-         setErrorStatus();
-      }
-      if(*endIter != startQuote)
-      {
-         return false;
-         setErrorStatus();
-      }
-      theValue = ossimString(startIter, endIter);
-   }
-   return ((!in.bad())&& (is_empty || theValue !=""));
-}
diff --git a/ossim/src/ossim/base/ossimXmlDocument.cpp b/ossim/src/ossim/base/ossimXmlDocument.cpp
deleted file mode 100644
index 3c37be0..0000000
--- a/ossim/src/ossim/base/ossimXmlDocument.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-//*******************************************************************
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer (ossim port by D. Burken)
-//
-// Description:  
-//
-// Contains definition of class ossimXmlDocument. This class provides read-only
-// parsing and accessing of an XML document file.
-//*****************************************************************************
-// $Id: ossimXmlDocument.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/base/ossimXmlAttribute.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <stack>
-#include <iostream>
-#include <fstream>
-
-
-// Static trace for debugging
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceDebug("ossimXmlDocument:debug");
-
-static std::istream& xmlskipws(std::istream& in)
-{
-   int c = in.peek();
-   while((!in.fail())&&
-         (( (c == ' ') || (c == '\t') || (c == '\n')|| (c == '\r') || (c<0x20) || (c>=0x7f) )))//|| (c<0x20) || (c >=0x2f) )))
-   {
-      in.ignore(1);
-      c = in.peek();
-   }
-   
-   return in;
-}
-
-static const int BUFFER_MAX_LEN = 1000;
-static const ossimString XPATH_DELIM ("/");
-
-RTTI_DEF1(ossimXmlDocument, "ossimXmlDocument", ossimObject)
-ossimXmlDocument::ossimXmlDocument(const ossimFilename& xmlFileName)
-   :
-   theRootNode  (0),
-   theXmlHeader("<?xml version='1.0'?>"),
-   theStrictCheckFlag(false)
-{
-   if(xmlFileName != "")
-   {
-      openFile(xmlFileName);
-   }
-}
-
-ossimXmlDocument::ossimXmlDocument(const ossimXmlDocument& src)
-:ossimObject(src),
-theRootNode(src.theRootNode.valid()?(ossimXmlNode*)src.theRootNode->dup():(ossimXmlNode*)0),
-theXmlHeader(src.theXmlHeader),
-theFilename(src.theFilename),
-theStrictCheckFlag(src.theStrictCheckFlag)
-{
-   
-}
-
-ossimXmlDocument::~ossimXmlDocument()
-{
-}
-
-bool ossimXmlDocument::write(const ossimFilename& file)
-{
-   std::ofstream out(file.c_str());
-
-   if(out)
-   {
-      out << *this << std::endl;
-   }
-   else
-   {
-      return false;
-   }
-
-   return true;
-}
-
-bool ossimXmlDocument::openFile(const ossimFilename& filename)
-{
-   
-   theFilename = filename;
-
-   if(theFilename == "")
-   {
-      return false;
-   }
-
-   //
-   // Open XML File:
-   // Note: Opening text document binary to overcome an apparent windows bug.
-   //
-   ifstream xml_stream (filename.c_str(), ios::binary);
-   if (!xml_stream)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: ossimXmlDocument::ossimXmlDocument\n"
-            << "encountered opening file <" << filename << "> for "
-            << "reading. Aborting..." << endl;
-      }
-      return false;
-   }
-
-   return read(xml_stream);
-}
-
-bool ossimXmlDocument::read(std::istream& in)
-{
-//   char buffer[BUFFER_MAX_LEN];
-//   streampos file_pos;
-//   bool readingHeader = true;
-   bool startTagCharacterFound = false;
-   char c = in.peek();
-
-   // Initially we will do our own skipping to make sure we ar not binary.
-   while(!in.bad() && (c != '<') && (c >= 0x20) && (c <= 0x7e))
-   {
-      in.ignore(1);
-      c = in.peek();
-   }
-
-   if (in.bad() || (c!='<'))
-   {
-      setErrorStatus();
-      return false;
-   }
-   startTagCharacterFound = true;
-
-   if(readHeader(in))
-   {
-      if(theXmlHeader=="")
-      {
-         if(startTagCharacterFound)
-         {
-            theXmlHeader = "<?xml version='1.0'?>";
-         }
-      }
-   }
-   if((!theXmlHeader.contains("xml version")) && theStrictCheckFlag)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "FATAL: ossimXmlDocument::ossimXmlDocument"
-            << "encountered parsing XML file <" << theFilename
-            << ">. The file does not appear to be XML v1.0. \n"
-            << "Header = \n" << theXmlHeader <<"\n"
-            << endl;
-      }
-      setErrorStatus();
-      return false;
-   }
-   theRootNode = new ossimXmlNode(in, 0);
-   setErrorStatus(theRootNode->getErrorStatus());
-   return (getErrorStatus()==ossimErrorCodes::OSSIM_OK);
-}
-
-void ossimXmlDocument::findNodes(const ossimString& arg_xpath,
-                            vector<ossimRefPtr<ossimXmlNode> >& result) const
-{
-   //
-   // First verify the root node exists:
-   //
-   if (!theRootNode.valid())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "WARNING: ossimXmlDocument::findNodes,\n"
-            << "No root node has been instantiated. Returning null "
-            << "node list..." << endl;
-      }
-      return;
-   }
-
-   //
-   // Make a copy to manipulate:
-   //
-   ossimString xpath (arg_xpath);
-   if (xpath.empty())
-      return;
-   
-   //
-   // Check if absolute path:
-   //
-   if (xpath[static_cast<std::string::size_type>(0)] !=
-       XPATH_DELIM[static_cast<std::string::size_type>(0)])
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "WARNING: ossimXmlDocument::findNodes\n"
-            << "Only absolute XPaths are supported. Returning null "
-            << "node list..." << endl;
-      }
-      return;
-   }
-
-   //
-   // Check that root tag matches path root:
-   //
-   ossimString rel_xpath (xpath.after(XPATH_DELIM));
-   ossimString root_tag (rel_xpath);
-   if (root_tag.contains(XPATH_DELIM))
-       root_tag = rel_xpath.before(XPATH_DELIM);
-   
-   if (root_tag != theRootNode->getTag())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "WARNING: ossimXmlDocument::findNodes\n"
-            << "XPath's root node <"<<root_tag<<"> does not match the "
-            << "stored root node's tag <" << theRootNode->getTag() << ">. "
-            << "Returning null node list..." << endl;
-      }
-      return;
-   }
-
-   //
-   // If the root node was the requested node, return it alone:
-   //
-   rel_xpath = rel_xpath.after(XPATH_DELIM);
-   if (rel_xpath.empty())
-   {
-      result.push_back(theRootNode);
-      return;
-   }
-   
-   //
-   // Pass the node request on to the root node with the relative path:
-   //
-   theRootNode->findChildNodes(rel_xpath, result);
-}
-
-ostream& operator << (ostream& os, const ossimXmlDocument& xml_doc) 
-{
-   os << xml_doc.theXmlHeader << endl;
-   if (xml_doc.theRootNode.valid())
-   {
-      os << (xml_doc.theRootNode.get()) << endl;
-   }
-//    else
-//       os << "-- no root node assigned -- " << endl;
-   
-   return os;
-}
-
-void ossimXmlDocument::initRoot(ossimRefPtr<ossimXmlNode> node)
-{
-   theRootNode = node;
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlDocument::getRoot()
-{
-   return theRootNode;
-}
-
-const ossimRefPtr<ossimXmlNode> ossimXmlDocument::getRoot()const
-{
-   return theRootNode;
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlDocument::removeRoot()
-{
-   ossimRefPtr<ossimXmlNode> root = theRootNode;
-
-   theRootNode = 0;
-
-   return root;
-}
-
-
-void ossimXmlDocument::fromKwl(const ossimKeywordlist& kwlToConvert)
-{
-
-   ossimKeywordlist kwl = kwlToConvert;
-   theRootNode = 0;
-   theRootNode = new ossimXmlNode;
-
-   
-   ossimString prefix = "";
-   ossimKeywordlist::KeywordMap& map              = kwl.getMap();
-   ossimKeywordlist::KeywordMap::iterator mapIter = map.begin();
-
-   while(mapIter != map.end())
-   {
-      ossimString key = mapIter->first;
-      key = key.substitute(".", "/", true);
-      theRootNode->addNode(key, mapIter->second);
-      ++mapIter;
-   }
-
-   // now collapse all keywordlist styles to the XML style
-   //
-   std::stack<ossimRefPtr<ossimXmlNode> > tempStack;
-   tempStack.push(theRootNode);
-   while(!tempStack.empty())
-   {
-      
-      ossimRefPtr<ossimXmlNode> node = tempStack.top();
-      tempStack.pop();
-      vector<ossimRefPtr<ossimXmlNode> >& childNodes = node->getChildNodes();
-      ossim_uint32 idx = 0;
-      for(idx = 0; idx < childNodes.size(); ++idx)
-      {
-         tempStack.push(childNodes[idx]);
-      }
-      if(node->getChildNodes().size() > 0)
-      {
-         if(node->getTag()!="")
-         {
-            node->addAttribute("name", node->getTag());
-         }
-         node->setTag("object");
-      }
-      
-      if(node->getTag() == "type")
-      {
-         if(node->getParentNode())
-         {
-            node->getParentNode()->removeChild("type");
-            node->getParentNode()->addAttribute("type", node->getText());
-         }
-      }
-      else if(node->getChildNodes().size() < 1)
-      {
-         if(node->getTag()!="")
-         {
-            node->addAttribute("name", node->getTag());
-         }
-         if(!node->getText().contains("\n"))
-         {
-            if(node->getText()!="")
-            {
-               node->addAttribute("value", node->getText());
-               node->setText("");
-            }
-         }
-         node->setTag("property");
-      }
-   }
-}
-
-void ossimXmlDocument::toKwl(ossimKeywordlist& kwl ,
-                             const ossimString& prefix)const
-{
-   if(theRootNode.valid())
-   {
-      theRootNode->toKwl(kwl, prefix);
-   }
-//    const std::vector<ossimRefPtr<ossimXmlNode> >& children = theRootNode->getChildNodes();
-   
-//    ossim_uint32 idx = 0;
-   
-//    for(idx = 0; idx < children.size(); ++idx)
-//    {
-//       children[idx]->toKwl(kwl, prefix);
-//    }
-}
-
-bool ossimXmlDocument::readHeader(std::istream& in)
-{
-   //---
-   // Clear the existing header so we don't get double:
-   // <?xml version='1.0'?><?xml version='1.0'?>
-   //---
-   theXmlHeader.clear();
-   
-   char c;
-   in>>xmlskipws;
-
-   while(in.peek() == '<')
-   {
-      std::stack<char> theLessThanStack;
-      theLessThanStack.push('<');
-      in.ignore(1);
-      c = in.peek();
-      // we will for now skip things like !DOCTYPE and any other things in the header of the document that start with <? or <!
-      if((c == '?')||
-         (c == '!'))
-      {
-         theXmlHeader += "<";
-         theXmlHeader += (char)in.get();
-         
-         while(!theLessThanStack.empty()&&
-               (!in.bad()))
-         {
-            if(in.peek() == '<')
-            {
-               theLessThanStack.push('<');
-            }
-            else if(in.peek() == '>')
-            {
-               theLessThanStack.pop();
-            }
-            theXmlHeader += (char)in.get();
-         }
-         if(!in.bad())
-         {
-            if(in.peek()=='\n'||
-               in.peek()=='\r')
-            {
-               theXmlHeader += (char)in.get();
-            }
-         }
-//          if(!in.bad())
-//          {
-//             theXmlHeader += (char)in.get();
-//          }
-         in>>xmlskipws;
-      }
-   }
-
-   return (!in.bad());
-}
-
diff --git a/ossim/src/ossim/base/ossimXmlNode.cpp b/ossim/src/ossim/base/ossimXmlNode.cpp
deleted file mode 100644
index ed7309a..0000000
--- a/ossim/src/ossim/base/ossimXmlNode.cpp
+++ /dev/null
@@ -1,1424 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Oscar Kramer <okramer at imagelinks.com> (ossim port by D. Burken)
-//
-// Description:  
-//
-// Contains definition of class ossimXmlNode.
-// 
-//*****************************************************************************
-// $Id: ossimXmlNode.cpp 20747 2012-04-18 15:24:12Z gpotts $
-
-#include <iostream>
-#include <stack>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/base/ossimXmlAttribute.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug("ossimXmlNode:debug");
-static const ossimString XPATH_DELIM ("/");
-
-RTTI_DEF2(ossimXmlNode, "ossimXmlNode", ossimObject, ossimErrorStatusInterface);
-
-static std::istream& xmlskipws(std::istream& in)
-{
-   int c = in.peek();
-   while( !in.fail() &&
-         (( (c== ' ') || (c == '\t') || (c == '\n')|| (c == '\r') || (c<0x20) || (c>=0x7f) ))
-         )
-   {
-      in.ignore(1);
-      c = in.peek();
-   }
-   
-   return in;
-}
-
-ossimXmlNode::ossimXmlNode(istream& xml_stream, ossimXmlNode* parent)
-:
-theParentNode (parent),
-theCDataFlag(false)
-{
-   read(xml_stream);
-}
-
-ossimXmlNode::ossimXmlNode()
-:theParentNode(0),
-theCDataFlag(false)
-{
-}
-
-ossimXmlNode::ossimXmlNode(const ossimXmlNode& src)
-:theTag(src.theTag),
-theParentNode(0),
-theText(src.theText),
-theCDataFlag(src.theCDataFlag)
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < src.theChildNodes.size();++idx)
-   {
-      theChildNodes.push_back((ossimXmlNode*)(src.theChildNodes[idx]->dup()));
-   }
-   for(idx = 0; idx < src.theAttributes.size();++idx)
-   {
-      theAttributes.push_back((ossimXmlAttribute*)(src.theAttributes[idx]->dup()));
-   }
-}
-
-ossimXmlNode::~ossimXmlNode()
-{
-}
-
-void ossimXmlNode::duplicateAttributes(ossimXmlNode::AttributeListType result)const
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx<theAttributes.size();++idx)
-   {
-      result.push_back((ossimXmlAttribute*)theAttributes[idx]->dup());
-   }
-	
-}
-
-void ossimXmlNode::duplicateChildren(ossimXmlNode::ChildListType& result)const
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx<theChildNodes.size();++idx)
-   {
-      result.push_back((ossimXmlNode*)theChildNodes[idx]->dup());
-   }
-}
-
-void ossimXmlNode::setParent(ossimXmlNode* parent)
-{
-   theParentNode = parent;
-}
-
-void ossimXmlNode::skipCommentTag(std::istream& in)
-{
-   char c;
-   while(!in.fail())
-   {
-      c = in.get();
-      if(c == '-')
-      {
-         if(in.peek() == '-')
-         {
-            in.ignore();
-            if(in.peek() == '>')
-            {
-               in.ignore();
-               return;
-            }
-         }
-      }
-   }
-}
-
-bool ossimXmlNode::read(std::istream& in)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimXmlNode::read: entered ......" << std::endl;
-   }
-   char c;
-   xmlskipws(in);
-   if(in.fail())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-      }
-      return false;
-   }
-   if(in.peek() == '<')
-   {
-      in.ignore(1);
-   }
-   if(in.fail())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-      }
-      return false;
-   }
-
-   ossimString endTag;
-   
-   if(!readTag(in, theTag))
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-      }
-      return false;
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theTag = " << theTag << "\n";
-   }
-   
-   if((!in.fail())&&readEndTag(in, endTag))
-   {
-      if((endTag == "")||
-         (endTag == theTag))
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return true;
-      }
-      else
-      {
-         setErrorStatus();
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return false;
-      }
-   }
-   // now parse attributes
-   ossimRefPtr<ossimXmlAttribute> attribute = new ossimXmlAttribute;
-   while(attribute->read(in))
-   {
-      theAttributes.push_back(new ossimXmlAttribute(*attribute));
-   }
-   // skip white space characters
-   //
-   xmlskipws(in);
-   
-   if(!in.fail()&&readEndTag(in, endTag))
-   {
-      if((endTag == "")||
-         (endTag == theTag))
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return true;
-      }
-      else
-      {
-         setErrorStatus();
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return false;
-      }
-   }
-   c = in.peek();
-   // make sure the attribute is closed
-   //
-   if(c != '>')
-   {
-      setErrorStatus();
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-      }
-      return false;
-   }
-   
-   in.ignore(1);
-   c = in.peek();
-   
-   // now do the text portion
-   if(!readTextContent(in))
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-      }
-      return false;
-   }
-   xmlskipws(in);
-   c = in.peek();
-   
-   if(c != '<')
-   {
-      setErrorStatus();
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-      }
-      return false;
-   }
-   in.ignore(1);
-   if(readEndTag(in, endTag))
-   {
-      if((endTag == "")||
-         (endTag == theTag))
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return true;
-      }
-      else
-      {
-         setErrorStatus();
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return false;
-      }
-   }
-   c = in.peek();
-
-   //---
-   // now if it's not an endtag then it must be a tag starting the new child
-   // node
-   //---
-   ossimRefPtr<ossimXmlNode> childNode;
-   do
-   {
-      childNode = new ossimXmlNode;
-      childNode->setParent(this);
-      if(childNode->read(in))
-      {
-         theChildNodes.push_back(childNode);
-      }
-      else
-      {
-         setErrorStatus();
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return false;
-      }
-      xmlskipws(in);
-      
-      c = in.peek();
-      if(c != '<')
-      {
-         setErrorStatus();
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-         }
-         return false;
-      }
-      in.ignore(1);
-      if(readEndTag(in, endTag))
-      {
-         if((endTag == "")||
-            (endTag == theTag))
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-            }
-            return true;
-         }
-         else
-         {
-            setErrorStatus();
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
-            }
-            return false;
-         }
-      }
-   }while( !in.fail() );
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimXmlNode::read: leaving ......\n";
-   }
-   return true;
-}
-
-
-void ossimXmlNode::findChildNodes(const ossimString& xpath,
-                                  ossimXmlNode::ChildListType& result)const
-{
-   //***
-   // Scan for trivial result (no children owned):
-   //***
-   if (theChildNodes.size() == 0)
-      return;
-   
-   //***
-   // Make a copy to manipulate:
-   //***
-   ossimString rel_xpath (xpath);
-   if (rel_xpath.empty())
-      return;
-   
-   //---
-   // First verify that this is not an absolute path:
-   //---
-   if (rel_xpath[static_cast<std::string::size_type>(0)] ==
-       XPATH_DELIM[static_cast<std::string::size_type>(0)])
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING: ossimXmlNode::findChildNodes\n"
-            << "Only relative XPaths can be searched from a node. "
-             << "Returning null list...\n";
-         }
-      return;
-   }
-   
-   //***
-   // Read the desired tag from the relative xpath
-   //***
-   ossimString desired_tag (rel_xpath);
-   if (rel_xpath.contains(XPATH_DELIM))
-      desired_tag = rel_xpath.before(XPATH_DELIM);
-   ossimString sub_xpath (rel_xpath.after(XPATH_DELIM));
-   
-   //***
-   // Loop over all child nodes for match:
-   //***
-   ossimXmlNode::ChildListType::const_iterator child_iter = theChildNodes.begin();
-   while(child_iter != theChildNodes.end())
-   {
-      if ((*child_iter)->getTag() == desired_tag)
-      {
-         if (sub_xpath.empty())
-         {
-            //***
-            // This was the final target node, simply append to the result:
-            //***
-            result.push_back(*child_iter);
-         }
-         else
-         {
-            //***
-            // This match identifies a possible tree to search given the
-            // remaining xpath (sub_xpath). Query this child node to search
-            // its tree for the remaining xpath:
-            //***
-            (*child_iter)->findChildNodes(sub_xpath, result);
-         }
-      }
-      
-      //***
-      // Proceed to next child:
-      //***
-      child_iter++;
-   }
-}
-
-const ossimRefPtr<ossimXmlNode> ossimXmlNode::findFirstNode(const ossimString& xpath)const
-{
-   if(theChildNodes.size() < 1) return 0;
-   //
-   // Make a copy to manipulate:
-   //
-   ossimString rel_xpath (xpath);
-   if (rel_xpath.empty())
-      return 0;
-   
-   //
-   // First verify that this is not an absolute path:
-   //
-   if (rel_xpath[static_cast<std::string::size_type>(0)] ==
-       XPATH_DELIM[static_cast<std::string::size_type>(0)])
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-         << "WARNING: ossimXmlNode::findChildNodes\n"
-         << "Only relative XPaths can be searched from a node. "
-         << "Returning null list...\n";
-
-      }
-      return 0;
-   }
-   
-   //
-   // Read the desired tag from the relative xpath
-   //
-   ossimString desired_tag (rel_xpath);
-   if (rel_xpath.contains(XPATH_DELIM))
-      desired_tag = rel_xpath.before(XPATH_DELIM);
-   ossimString sub_xpath (rel_xpath.after(XPATH_DELIM));
-   
-   ossimRefPtr<ossimXmlNode> result = 0;
-   
-   //
-   // Loop over all child nodes for match:
-   //
-   ossimXmlNode::ChildListType::const_iterator child_iter = theChildNodes.begin();
-   while((child_iter != theChildNodes.end())&&
-         (!result.valid()))
-   {
-      if ((*child_iter)->getTag() == desired_tag)
-      {
-         if (sub_xpath.empty())
-         {
-            return *child_iter;
-         }
-         else
-         {
-            //
-            // This match identifies a possible tree to search given the
-            // remaining xpath (sub_xpath). Query this child node to search
-            // its tree for the remaining xpath:
-            //
-            result = (*child_iter)->findFirstNode(sub_xpath);
-         }
-      }
-      
-      //
-      // Proceed to next child:
-      //
-      ++child_iter;
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlNode::findFirstNode(const ossimString& xpath)
-{
-   if(theChildNodes.size() < 1) return 0;
-   //
-   // Make a copy to manipulate:
-   //
-   ossimString rel_xpath (xpath);
-   if (rel_xpath.empty())
-      return 0;
-   
-   //
-   // First verify that this is not an absolute path:
-   //
-   if (rel_xpath[static_cast<std::string::size_type>(0)] ==
-       XPATH_DELIM[static_cast<std::string::size_type>(0)])
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-         << "WARNING: ossimXmlNode::findChildNodes\n"
-         << "Only relative XPaths can be searched from a node. "
-         << "Returning null list...\n";
-      }
-      return 0;
-   }
-   
-   //
-   // Read the desired tag from the relative xpath
-   //
-   ossimString desired_tag (rel_xpath);
-   if (rel_xpath.contains(XPATH_DELIM))
-      desired_tag = rel_xpath.before(XPATH_DELIM);
-   ossimString sub_xpath (rel_xpath.after(XPATH_DELIM));
-   
-   ossimRefPtr<ossimXmlNode> result = 0;
-   
-   //
-   // Loop over all child nodes for match:
-   //
-   ossimXmlNode::ChildListType::iterator child_iter = theChildNodes.begin();
-   while((child_iter != theChildNodes.end())&&
-         (!result.valid()))
-   {
-      if ((*child_iter)->getTag() == desired_tag)
-      {
-         if (sub_xpath.empty())
-         {
-            return *child_iter;
-         }
-         else
-         {
-            //
-            // This match identifies a possible tree to search given the
-            // remaining xpath (sub_xpath). Query this child node to search
-            // its tree for the remaining xpath:
-            //
-            result = (*child_iter)->findFirstNode(sub_xpath);
-         }
-      }
-      
-      //
-      // Proceed to next child:
-      //
-      ++child_iter;
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimXmlAttribute> ossimXmlNode::findAttribute(const ossimString& name)
-{
-   ossim_uint32 idx = 0;
-   
-   for(idx = 0; idx < theAttributes.size();++idx)
-   {
-      if(theAttributes[idx]->getName() == name)
-      {
-         return theAttributes[idx];
-      }
-   }
-   
-   return 0;
-}
-
-const ossimRefPtr<ossimXmlAttribute> ossimXmlNode::findAttribute(const ossimString& name)const
-{
-   ossim_uint32 idx = 0;
-   
-   for(idx = 0; idx < theAttributes.size();++idx)
-   {
-      if(theAttributes[idx]->getName() == name)
-      {
-         return theAttributes[idx];
-      }
-   }
-   
-   return 0;
-}
-
-void ossimXmlNode::setTag(const ossimString& tag)
-{
-   theTag = tag;
-}
-
-ossimString ossimXmlNode::getTag() const
-{
-   return theTag;
-}
-
-const ossimXmlNode* ossimXmlNode::getParentNode() const
-{
-   return theParentNode;
-}
-
-ossimXmlNode* ossimXmlNode::getParentNode()
-{
-   return theParentNode;
-}
-
-const ossimXmlNode::ChildListType& ossimXmlNode::getChildNodes() const
-{
-   return theChildNodes;
-}
-
-ossimXmlNode::ChildListType& ossimXmlNode::getChildNodes()
-{
-   return theChildNodes;
-}
-
-const ossimXmlNode::AttributeListType& ossimXmlNode::getAttributes() const
-{
-   return theAttributes;
-}
-
-bool ossimXmlNode::getAttributeValue(ossimString& value, const ossimString& name)const
-{
-   ossimRefPtr<ossimXmlAttribute> attribute = findAttribute(name);
-   
-   if(attribute.valid())
-   {
-      value = attribute->getValue();
-   }
-   
-   return attribute.valid();
-}
-
-bool ossimXmlNode::getChildTextValue(ossimString& value,
-                                     const ossimString& relPath)const
-{
-   ossimRefPtr<ossimXmlNode> node = findFirstNode(relPath);
-   if(node.valid())
-   {
-      value = node->getText();
-   }
-   
-   return node.valid();
-}
-
-
-void ossimXmlNode::setText(const ossimString& text)
-{
-   theText = text;
-}
-
-const ossimString& ossimXmlNode::getText() const
-{
-   return theText;
-}
-
-bool ossimXmlNode::cdataFlag()const
-{
-   return theCDataFlag;
-}
-
-void ossimXmlNode::setCDataFlag(bool value)
-{
-   theCDataFlag = value;
-}
-
-ostream& operator << (ostream& os, const ossimXmlNode& xml_node)
-{
-   return operator <<(os, &xml_node);
-}
-
-//**************************************************************************
-//  FRIEND OPERATOR
-//**************************************************************************
-ostream& operator << (ostream& os, const ossimXmlNode* xml_node) 
-{
-   //
-   // Determine the indentation level:
-   //
-   ossimString indent ("");
-   const ossimXmlNode* parent = xml_node->theParentNode;
-   while (parent)
-   {
-      indent += "   ";
-      parent = parent->theParentNode;
-   }
-   
-   //
-   // Dump the tag opening:
-   //
-   os << "\n" << indent << "<" << xml_node->theTag;
-   
-   //
-   // Dump any attributes:
-   //
-   if (xml_node->theAttributes.size())
-   {
-      ossimXmlNode::AttributeListType::const_iterator attr =
-      xml_node->theAttributes.begin();
-      while (attr != xml_node->theAttributes.end())
-      {
-         os << attr->get();
-         attr++;
-      }
-   }
-   
-   if((xml_node->theChildNodes.size() == 0)&&
-      (xml_node->theText == ""))
-   {
-      os << "/>";
-   }
-   else
-   {
-      os << ">";
-      
-      if(xml_node->cdataFlag())
-      {
-         os << "<![CDATA[" <<xml_node->theText <<  "]]>";
-      }
-      else
-      {
-         //
-         // Dump any text:
-         //
-         os << xml_node->theText;
-      }
-      //
-      // Dump any child nodes:
-      //
-      if (xml_node->theChildNodes.size())
-      {
-         ossimXmlNode::ChildListType::const_iterator nodes = xml_node->theChildNodes.begin();
-         while (nodes != xml_node->theChildNodes.end())
-         {
-            os << (*nodes).get();
-            nodes++;
-         }
-         os << "\n" << indent;
-      }
-      
-      //
-      // Dump the tag closing:
-      // 
-      os << "</" << xml_node->theTag << ">";
-   }
-   
-   return os;
-}
-
-void ossimXmlNode::addAttribute(ossimRefPtr<ossimXmlAttribute> attribute)
-{
-   theAttributes.push_back(attribute.get());
-}
-
-void ossimXmlNode::addAttribute(const ossimString& name,
-                                const ossimString& value)
-{
-   theAttributes.push_back(new ossimXmlAttribute(name, value));
-}
-
-bool  ossimXmlNode::setAttribute(const ossimString& name,
-                                 const ossimString& value,
-                                 bool addIfNotPresentFlag)
-{
-   bool result = false;
-   ossimRefPtr<ossimXmlAttribute> attribute = findAttribute(name);
-   if(attribute.valid())
-   {
-      attribute->setValue(value);
-      result = true;
-   }
-   else
-   {
-      if(addIfNotPresentFlag)
-      {
-         addAttribute(name, value);
-         result = true;
-      }
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlNode::addNode(const ossimString& relPath,
-                                                const ossimString& text)
-{
-   //
-   // Make a copy to manipulate:
-   //
-   ossimString relXpath (relPath);
-   if (relXpath.empty())
-      return 0;
-   
-   //
-   // First verify that this is not an absolute path:
-   //
-   if (relXpath[static_cast<std::string::size_type>(0)] ==
-       XPATH_DELIM[static_cast<std::string::size_type>(0)])
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimXmlNode::findChildNodes\n"
-         << "Only relative XPaths can be searched from a node. "
-         << "Returning null list...\n";
-         
-      }
-      return 0;
-   }
-   
-   //
-   // Read the desired tag from the relative xpath
-   //
-   ossimString desiredTag (relXpath);
-   if (relXpath.contains(XPATH_DELIM))
-   {
-      desiredTag = relXpath.before(XPATH_DELIM);
-   }
-   ossimString subPath (relXpath.after(XPATH_DELIM));
-   
-   ossimRefPtr<ossimXmlNode> node = findFirstNode(desiredTag);
-   
-   if(!node.valid())
-   {
-      if(subPath.empty())
-      {
-         node = addChildNode(desiredTag, text);
-      }
-      else
-      {
-         node = addChildNode(desiredTag, "");
-      }
-   }
-   if(!subPath.empty())
-   {
-      return node->addNode(subPath, text);
-   }
-   
-   return node;
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlNode::addOrSetNode(const ossimString& relPath,
-                                                     const ossimString& text)
-{
-   
-   ossimRefPtr<ossimXmlNode> result = addNode(relPath, text);
-   
-   result->setText(text);
-   
-   return result;
-}
-
-void ossimXmlNode::addChildNode(ossimRefPtr<ossimXmlNode> node)
-{
-   if(node->theParentNode)
-   {
-      node->theParentNode->removeChild(node);
-   }
-   node->theParentNode = this;
-   theChildNodes.push_back(node.get());
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlNode::addChildNode(const ossimString& tagName,
-                                                     const ossimString& text)
-{
-   ossimRefPtr<ossimXmlNode> node = new ossimXmlNode();
-   node->setParent(this);
-   node->theTag = tagName;
-   node->theText = text;
-   theChildNodes.push_back(node);
-   
-   return node;
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlNode::removeChild(ossimRefPtr<ossimXmlNode> node)
-{
-   ossimXmlNode::ChildListType::iterator iter = theChildNodes.begin();
-   while(iter != theChildNodes.end())
-   {
-      
-      if(node == iter->get())
-      {
-         ossimRefPtr<ossimXmlNode> temp = *iter;
-         
-         theChildNodes.erase(iter);
-         
-         return temp;
-      }
-      ++iter;
-   }
-   
-   return 0;
-}
-
-ossimRefPtr<ossimXmlNode> ossimXmlNode::removeChild(const ossimString& tag)
-{
-   ossimXmlNode::ChildListType::iterator iter = theChildNodes.begin();
-   while(iter != theChildNodes.end())
-   {
-      if(tag == iter->get()->theTag)
-      {
-         ossimRefPtr<ossimXmlNode> temp = *iter;
-         
-         theChildNodes.erase(iter);
-         
-         return temp;
-      }
-      ++iter;
-   }
-   
-   return 0;
-}
-void ossimXmlNode::addChildren(ossimXmlNode::ChildListType& children)
-{
-   ossim_uint32 idx;
-   for(idx = 0; idx < children.size(); ++idx)
-   {
-      addChildNode(children[idx].get());
-   }
-}
-
-void ossimXmlNode::setChildren(ossimXmlNode::ChildListType& children)
-{
-   clearChildren();
-   addChildren(children);
-}
-
-void ossimXmlNode::addAttributes(ossimXmlNode::AttributeListType& children)
-{
-   ossim_uint32 idx;
-   
-   for(idx = 0; idx < children.size(); ++idx)
-   {
-      addAttribute(children[idx].get());
-   }
-}
-
-void ossimXmlNode::setAttributes(ossimXmlNode::AttributeListType& children)
-{
-   clearAttributes();
-   addAttributes(children);
-}
-
-void ossimXmlNode::clear()
-{
-   theChildNodes.clear();
-   theAttributes.clear();
-   theTag="";
-   theText="";
-   theCDataFlag=false;
-}
-
-void ossimXmlNode::clearChildren()
-{
-   theChildNodes.clear();
-}
-
-void ossimXmlNode::clearAttributes()
-{
-   theAttributes.clear();
-}
-
-void ossimXmlNode::toKwl(ossimKeywordlist& kwl,
-                         const ossimString& prefix)const
-{
-   ossimString name = getTag();
-   ossimString value = getText();
-   
-   ossimString copyPrefix = prefix;
-   
-   if(name != "")
-   {
-      copyPrefix += (name+".");
-   }
-   if(theChildNodes.size() < 1)
-   {
-      kwl.add(prefix+name,
-              value,
-              true);
-   }
-
-   ossimString attributePrefix = copyPrefix + "@";
-   ossim_uint32 attributeIdx = 0;
-   for(attributeIdx = 0; attributeIdx < theAttributes.size(); ++attributeIdx)
-   {
-      kwl.add(attributePrefix+theAttributes[attributeIdx]->getName(),
-              theAttributes[attributeIdx]->getValue(), 
-              true);
-   }
-
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theChildNodes.size();++idx)
-   {
-      theChildNodes[idx]->toKwl(kwl,
-                                copyPrefix);
-   }
-   
-}
-
-bool ossimXmlNode::readTag(std::istream& in,
-                           ossimString& tag)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimXmlNode::readTag: entered ......\n";
-   }
-   xmlskipws(in);
-   
-   tag = "";
-   int c = in.peek();
-   
-   // bool validTag = false;
-   //    while(!validTag)
-   {
-      while( (c != ' ')&&
-            (c != '\n')&&
-            (c != '\t')&&
-            (c != '\r')&&
-            (c != '<')&&
-            (c != '>')&&
-            (c != '/')&&
-            (!in.fail()))
-      {
-         tag += (char)c;
-         in.ignore(1);
-         c = in.peek();
-         if(tag == "!--") // ignore comment tags
-         {
-            tag = "--";
-            break;
-         }
-      }
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimXmlNode::readTag: leaving ......\n";
-   }
-  
-   return ((tag != "")&&(!in.fail()));
-}
-
-bool ossimXmlNode::readCDataContent(std::istream& in)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimXmlNode::readCDataContent: entered ..." << std::endl;
-   }   
-   
-   // Ignore up to "]]>"
-   
-   bool result = false;
-
-   char c;
-
-   while(!in.fail())
-   {
-      c = in.get();
-      if ( c != ']' )
-      {
-         theText += c;
-      }
-      else // at "]"
-      {
-         c = in.get();
-         if( c == ']' ) // at "]]"
-         {
-            c = in.get();
-            if( c == '>' )
-            {
-               //in >> xmlskipws;
-               result = true;
-               break;
-            }
-         }
-      }
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "theText: " << theText
-         << "\nexit status: " << (result?"true":"false")
-         << "\nossimXmlNode::readCDataContent: leaving ..." << std::endl;
-   }
-   
-   return result;
-}
-
-#if 0
-bool ossimXmlNode::readTextContent(std::istream& in)
-{
-   xmlskipws(in);
-   
-   theText = "";
-   theCDataFlag = false;
-   
-   char buf[9];
-   buf[8]='\0';
-   
-   std::streampos initialPos = in.tellg();
-   
-   in.read(buf,9);
-   ossimString ostrBuf(buf);
-   
-   if(ostrBuf == "<![CDATA[")
-   {
-	   if(readCDataContent(in))
-      {
-         theCDataFlag = true;
-         return true;
-      }
-	   else
-	   {
-         return false;
-	   }
-   }
-   else if(ostrBuf.substr(0,4) == "<!--")
-   {
-	   in.seekg(initialPos);
-	   char c = in.get();
-	   // Strip comment
-	   while(!in.fail()) // continue until we see a --> pattern
-	   {
-         c = in.get();
-         if(c == '-')
-         {
-            c = in.get();
-            if(c == '-')
-            {
-               c = in.get();
-               if(c == '>')
-               {
-                  break;
-               }
-            }
-         }
-	   }
-   }
-   else if(ostrBuf.substr(0,1) ==  "<")
-   {
-	   in.seekg(initialPos);
-   }
-   else
-   {
-      in.seekg(initialPos);
-	   char c = in.peek();
-	   while(!in.fail() && c != '<')
-	   {
-         theText += (char)in.get();
-         c = in.peek();
-	   }
-   }
-   return !in.fail();
-}
-#endif
-#if 0
-bool ossimXmlNode::readTextContent(std::istream& in)
-{
-   xmlskipws(in);
-   
-   theText = "";
-   theCDataFlag = false;
-   char c = in.peek();
-   
-   do
-   {
-      if(c == '<')
-      {
-         in.ignore();
-         
-         // we will check for comments or CDATA
-         if(in.peek()=='!')
-         {
-            char buf1[4];
-            buf1[3] = '\0';
-            in.read(buf1, 3);
-            if(ossimString(buf1) == "!--")
-            {
-               // special text read
-               theText += buf1;
-               bool done = false;
-               do
-               {
-                  if(in.peek() != '-')
-                  {
-                     in.ignore();
-                  }
-                  else
-                  {
-                     in.ignore();
-                     if(in.peek() == '-')
-                     {
-                        in.ignore();
-                        if(in.peek() == '>')
-                        {
-                           in.ignore();
-                           done = true;
-                           c = in.peek();
-                        }
-                     }
-                  }
-               }while(!done&&!in.fail());
-            }
-            else
-            {
-               
-               char buf2[6];
-               buf2[5] = '\0';
-               in.read(buf2, 5);
-               if(in.fail())
-               {
-                  return false;
-               }
-               if(ossimString(buf1)+ossimString(buf2) == "![CDATA[")
-               {
-                  if(readCDataContent(in))
-                  {
-                     theCDataFlag = true;
-                     return true;
-                  }
-               }
-            }
-         }
-         else
-         {
-            in.putback(c);
-            return true;
-         }
-      }
-      else
-      {
-         theText += (char)in.get();
-         c = in.peek();
-      }
-   }while(!in.fail());
-   
-   return !in.fail();
-}
-#endif
-
-bool ossimXmlNode::readTextContent(std::istream& in)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimXmlNode::readTextContent: entered ..." << std::endl;
-   }
-   
-   //---
-   // Parse the text string.  Do it with no peeks, ignores, or putbacks as
-   // those seem to have issues on Windows (vs9).
-   //---
-   bool result = false;
-
-   theText = "";
-   theCDataFlag = false;
-   
-   xmlskipws(in);
-
-   if ( !in.fail() )
-   {
-      std::streampos initialPos = in.tellg();
-
-      char c = in.get();
-      
-      if ( c != '<' )
-      {
-         do // Get the text up to the next '<'.
-         {
-            theText += c;
-            c = in.get();
-         } while ( (c != '<') && !in.fail() );
-         
-         in.unget(); // Put '<' back.
-         result = !in.fail();
-      }
-      else // At "<" see if comment
-      {
-         c = in.get();
-
-         if ( c != '!' )
-         {
-            in.seekg(initialPos);
-            result = !in.fail();
-         }
-         else // at "<!"
-         {
-            c = in.get();
-            if ( c == '-' )
-            {
-               // Comment section: <!-- some comment -->
-               c = in.get();
-               if ( c == '-' ) // at "<!--"
-               {
-                  // Strip comment
-                  while( !in.fail() ) // continue until we see a --> pattern
-                  {
-                     c = in.get();
-                     if(c == '-')
-                     {
-                        c = in.get();
-                        if(c == '-')
-                        {
-                           c = in.get();
-                           if(c == '>')
-                           {
-                              result = !in.fail();
-                              break;
-                           }
-                        }
-                     }
-                  }
-               }
-            }
-            else if ( c == '[' ) // at "<!["
-            {
-               // CDATA section: <![CDATA[something-here]]>
-               c = in.get();
-               if ( c == 'C') // at "<![C:"
-               {
-                  c = in.get();
-                  if ( c == 'D' )// at "<![CD"
-                  {
-                     c = in.get();
-                     if ( c == 'A' ) // at "<![CDA"
-                     {
-                        c = in.get();
-                        if ( c == 'T' ) // at "<![CDAT"
-                        {
-                           c = in.get();
-                           if ( c == 'A' ) // at "<![CDATA"
-                           {
-                              c = in.get();
-                              if ( c == '[' ) // at "<!CDATA["
-                              {
-                                 if (readCDataContent(in))
-                                 {
-                                    theCDataFlag = true;
-                                    result = true;
-                                 }
-                              }
-                           }
-                        }
-                     }
-                  }
-               }
-            }
-         }
-      }
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "theText: " << theText
-         << "\ntheCDataFlag: " << (theCDataFlag?"true":"false")
-         << "\nexit status: " << (result?"true":"false")
-         << "\nossimXmlNode::readTextContent: leaving ..." << std::endl;
-   }
-   
-   return result;
-}
-
-bool ossimXmlNode::readEndTag(std::istream& in,
-                              ossimString& endTag)
-{
-   bool result = false;
-   char c = in.peek();
-   endTag = "";
-   
-   if(theTag == "--")// this is a comment tag
-   {
-      skipCommentTag(in);
-      endTag = "--";
-      return (!in.fail());
-   }
-   // check end tag
-   //
-   if(c == '/')
-   {
-      in.ignore();
-      readTag(in, endTag);
-      if(in.fail()) return false;
-      xmlskipws(in);
-      c = in.peek();
-      result = true;
-   }
-   else
-   {
-      return false;
-   }
-   if(c != '>')
-   {
-      setErrorStatus();
-      return false;
-   }
-   else
-   {
-      in.ignore(1);
-   }
-   if(in.fail()) result = false;
-   
-   return result;
-}
diff --git a/ossim/src/ossim/dll_main/makefile.vc b/ossim/src/ossim/dll_main/makefile.vc
deleted file mode 100644
index 4204a14..0000000
--- a/ossim/src/ossim/dll_main/makefile.vc
+++ /dev/null
@@ -1,14 +0,0 @@
-###
-# $Id: makefile.vc 9230 2006-07-05 21:10:46Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ	= 	ossimDllMain.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/elevation/makefile.vc b/ossim/src/ossim/elevation/makefile.vc
deleted file mode 100644
index ecb9eb1..0000000
--- a/ossim/src/ossim/elevation/makefile.vc
+++ /dev/null
@@ -1,32 +0,0 @@
-###
-# $Id: makefile.vc 16135 2009-12-18 15:07:01Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimDtedElevationDatabase.obj \
-ossimDtedFactory.obj \
-ossimDtedHandler.obj \
-ossimElevCellHandler.obj \
-ossimElevCellHandlerFactory.obj \
-ossimElevManager.obj \
-ossimElevSource.obj \
-ossimElevSourceFactory.obj \
-ossimElevationDatabase.obj \
-ossimElevationDatabaseFactory.obj \
-ossimElevationDatabaseRegistry.obj \
-ossimGeneralRasterElevFactory.obj \
-ossimGeneralRasterElevHandler.obj \
-ossimGeneralRasterElevationDatabase.obj \
-ossimHgtRef.obj \
-ossimSrtmElevationDatabase.obj \
-ossimSrtmFactory.obj \
-ossimSrtmHandler.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/elevation/ossimDtedElevationDatabase.cpp b/ossim/src/ossim/elevation/ossimDtedElevationDatabase.cpp
deleted file mode 100644
index ecdef9a..0000000
--- a/ossim/src/ossim/elevation/ossimDtedElevationDatabase.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-#include <ossim/elevation/ossimDtedElevationDatabase.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimTrace.h>
-#include <sstream>
-#include <iomanip>
-#include <cstdlib> /* for abs(int) */
-#include <OpenThreads/Thread> //### TODO: for debug, remove
-
-static ossimTrace traceDebug("ossimDtedElevationDatabase:debug");
-static OpenThreads::Mutex d_mutex; // for debug
-RTTI_DEF1(ossimDtedElevationDatabase, "ossimDtedElevationDatabase", ossimElevationCellDatabase);
-
-double ossimDtedElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
-{
-   if(!isSourceEnabled())
-      return ossim::nan();
-
-   double result = ossim::nan();
-   m_mutex.lock();
-   if(m_lastHandler.valid() && m_lastHandler->pointHasCoverage(gpt))
-   {
-      result = m_lastHandler->getHeightAboveMSL(gpt);
-   }
-   else
-   {
-      m_lastHandler = getOrCreateCellHandler(gpt);
-      if(m_lastHandler.valid())
-         result = m_lastHandler->getHeightAboveMSL(gpt);
-   }
-
-#if 0
-   d_mutex.lock();
-   cout << "THREAD ID: "<<OpenThreads::Thread::CurrentThread()->getThreadId()<<"  "
-         <<"ossimDtedElevationDatabase @ "<<(unsigned long)this<<"  m_lastHandler @ "
-         <<(unsigned long)m_lastHandler.get()<<endl; //### TODO: for debug, remove
-   d_mutex.unlock();
-#endif
-
-   m_mutex.unlock();
-   return result;
-}
-
-double ossimDtedElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
-{
-   double h = getHeightAboveMSL(gpt);
-   if(h != ossim::nan())
-   {
-      double offset = getOffsetFromEllipsoid(gpt);
-      
-      h += offset;
-   }
-   
-   return h;
-}
-bool ossimDtedElevationDatabase::open(const ossimString& connectionString)
-{
-   bool result = false;
-   ossimFilename file = ossimFilename(connectionString);
-   
-   result = openDtedDirectory(file);
-
-   return result;
-}
-
-bool ossimDtedElevationDatabase::openDtedDirectory(const ossimFilename& dir)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimDtedElevationDatabase::open entered ...\n";
-   }
-   bool result = dir.isDir();
-   if(result)
-   {
-      ossim_uint32 count = 0;
-      ossim_uint32 maxCount = 10;
-      ossimDirectory od;
-      result = od.open(dir);
-      if(result)
-      {
-         result = false;
-         ossimFilename f;
-         // Get the first directory.
-         od.getFirst(f, ossimDirectory::OSSIM_DIR_DIRS);
-         
-         do
-         {
-            ++count;
-            // Must be a directory.
-            if (f.isDir())
-            {
-               // Discard any full path.
-               ossimFilename fileOnly = f.file();
-               
-               // Downcase it.
-              fileOnly.downcase();
-               // Must start with 'e' or 'w'.
-               bool foundCell = ( ((fileOnly.c_str()[0] == 'e') || ( fileOnly.c_str()[0] == 'w')) &&
-                         (fileOnly.size() == 4));
-               if(foundCell)
-               {
-                  ossim_uint32 maxCount2 = 10;
-                  ossim_uint32 count2 = 0;
-                  ossimDirectory d2;
-                  if(d2.open(f))
-                  {
-                     d2.getFirst(f, ossimDirectory::OSSIM_DIR_FILES);
-                     do
-                     {
-                        ossimRefPtr<ossimDtedHandler> dtedHandler = new ossimDtedHandler();
-                        if(dtedHandler->open(f, false))
-                        {
-                           if(traceDebug())
-                           {
-                              ossimNotify(ossimNotifyLevel_DEBUG) << "ossimDtedElevationDatabase::open: Found dted file " << f << "\n";
-                           }
-                           result = true;
-                           m_extension = "."+f.ext();
-                           m_connectionString = dir;
-                           m_meanSpacing = dtedHandler->getMeanSpacingMeters();
-                       }
-                        dtedHandler->close();
-                        dtedHandler = 0;
-                        ++count2;
-                     }while(!result&&d2.getNext(f)&&(count2 < maxCount2));
-                  }
-               }
-            }
-         }while(!result&&(od.getNext(f))&&(count < maxCount));
-      }
-   }
-   
-   if(result)
-   {
-      if(!m_geoid.valid())
-      {
-         m_geoid = ossimGeoidManager::instance()->findGeoidByShortName("geoid1996", false);
-      }
-      
-      if(!m_geoid.valid()&&traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "ossimDtedElevationDatabase::open: Unable to load goeid grid 1996 for DTED database\n";
-      }
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimDtedElevationDatabase::open leaving ...\n";
-   }
-   return result;
-}
-
-bool ossimDtedElevationDatabase::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
-{
-   bool result = false;
-   
-   m_mutex.lock();
-   ossimDtedElevationDatabase* thisPtr = const_cast<ossimDtedElevationDatabase*>(this);
-   ossimRefPtr<ossimElevCellHandler> tempHandler = thisPtr->getOrCreateCellHandler(gpt);
-   m_mutex.unlock();
-
-   if(tempHandler.valid())
-   {
-      result = tempHandler->getAccuracyInfo(info, gpt);
-   }
-  return result;
-}
-
-void ossimDtedElevationDatabase::createRelativePath(ossimFilename& file, const ossimGpt& gpt)const
-{
-   ossimFilename lon, lat;
-   int ilon = static_cast<int>(floor(gpt.lond()));
-   
-   if (ilon < 0)
-   {
-      lon = "w";
-   }
-   else
-   {
-      lon = "e";
-   }
-   
-   ilon = abs(ilon);
-   std::ostringstream  s1;
-   s1 << std::setfill('0') << std::setw(3)<< ilon;
-   
-   lon += s1.str().c_str();//ossimString::toString(ilon);
-   
-   int ilat =  static_cast<int>(floor(gpt.latd()));
-   if (ilat < 0)
-   {
-      lat += "s";
-   }
-   else
-   {
-      lat += "n";
-   }
-   
-   ilat = abs(ilat);
-   std::ostringstream  s2;
-   
-   s2<< std::setfill('0') << std::setw(2)<< ilat;
-   
-   lat += s2.str().c_str();
-   
-   file = lon.dirCat(lat+m_extension);
-}
-ossimRefPtr<ossimElevCellHandler> ossimDtedElevationDatabase::createCell(const ossimGpt& gpt)
-{
-  ossimRefPtr<ossimElevCellHandler> result = 0;
-  ossimFilename f;
-  createFullPath(f, gpt);
-  if(f.exists())
-  {
-     ossimRefPtr<ossimDtedHandler> h = new ossimDtedHandler(f, m_memoryMapCellsFlag);
-     if (!(h->getErrorStatus()))
-     {
-        result = h.get();
-     }
-  }
-
-  return result;
-}
-
-bool ossimDtedElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix )
-{
-   bool result = ossimElevationCellDatabase::loadState(kwl, prefix);
-   if(result)
-   {
-      if(!m_connectionString.empty()&&ossimFilename(m_connectionString).exists())
-      {
-         result = open(m_connectionString);
-      }
-      else
-      {
-         // can't open the connection because it does not exists or empty
-         result = false;
-      }
-   }
-   
-   return result;
-}
-
-bool ossimDtedElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   bool result = ossimElevationCellDatabase::saveState(kwl, prefix);
-   
-   return result;
-}
-
-std::ostream& ossimDtedElevationDatabase::print(ostream& out) const
-{
-   ossimKeywordlist kwl;
-   saveState(kwl);
-   out << "\nossimDtedElevationDatabase @ "<< (ossim_uint64) this << "\n"
-         << kwl <<ends;
-   return out;
-}
-
diff --git a/ossim/src/ossim/elevation/ossimDtedHandler.cpp b/ossim/src/ossim/elevation/ossimDtedHandler.cpp
deleted file mode 100644
index 7a0c4ba..0000000
--- a/ossim/src/ossim/elevation/ossimDtedHandler.cpp
+++ /dev/null
@@ -1,578 +0,0 @@
-//*****************************************************************************
-// FILE: ossimDtedHandler.cc
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimDtedHandler. This class derives from
-//   ossimElevHandler. It is responsible for loading an individual DTED cell
-//   from disk. This elevation files are memory mapped.
-//
-//*****************************************************************************
-// $Id: ossimDtedHandler.cpp 21214 2012-07-03 16:20:11Z dburken $
-
-#include <cstdlib>
-#include <cstring> /* for memcpy */
-#include <ossim/elevation/ossimDtedHandler.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-RTTI_DEF1(ossimDtedHandler, "ossimDtedHandler" , ossimElevCellHandler)
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimDtedHandler:exec");
-static ossimTrace traceDebug ("ossimDtedHandler:debug");
-
-static const char ENABLE_STATS_KW[] = "elevation.compute_statistics.enabled";
-
-
-ossimDtedHandler::ossimDtedHandler(const ossimFilename& dted_file, bool memoryMapFlag)
-   :
-      ossimElevCellHandler(dted_file),
-      m_fileStr(),
-      m_numLonLines(0),
-      m_numLatPoints(0),
-      m_dtedRecordSizeInBytes(0),
-      m_edition(),
-      m_productLevel(),
-      m_compilationDate(),
-      m_offsetToFirstDataRecord(0),
-      m_latSpacing(0.0),
-      m_lonSpacing(0.0),
-      m_swCornerPost(),
-      m_swapBytesFlag(false)
-{
-
-   static const char MODULE[] = "ossimDtedHandler (Filename) Constructor";
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG " << MODULE <<": entering..." << std::endl;
-   }
-   
-   m_swapBytesFlag = ossim::byteOrder() == OSSIM_LITTLE_ENDIAN ? true : false;
-   //---
-   //  Open the dted file for reading.
-   //---
-   if (!open(dted_file, memoryMapFlag))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL " << MODULE << ": "
-            << "\nCould not open file:  " << dted_file.c_str()
-            << "\nReturning..." << std::endl;
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG " << MODULE << ": returning with error..." << std::endl;
-      }
-      return;
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG " << MODULE <<": Loading dted file: " << dted_file
-            << std::endl;
-      }
-   }
-
-   // DTED is stored in big endian.
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG " << MODULE << ": returning..." << std::endl;
-   }
-}
-
-ossimDtedHandler::~ossimDtedHandler()
-{
-   close();
-}
-
-bool ossimDtedHandler::getAccuracyInfo(ossimElevationAccuracyInfo& info,
-                                       const ossimGpt& /* gpt */ ) const
-{
-  info.m_confidenceLevel = .9;
-  info.m_absoluteLE = m_acc.absLE();
-  info.m_absoluteCE = m_acc.absCE();
-  info.m_relativeLE = m_acc.relLE();
-  info.m_relativeCE = m_acc.relCE();
-
-  info.m_surfaceName = m_dsi.productLevel();
-
-  return info.hasValidAbsoluteError();
-}
-
-double ossimDtedHandler::getHeightAboveMSL(const ossimGpt& gpt)
-{
-   if(m_fileStr.is_open())
-   {
-      return getHeightAboveMSL(gpt, true);
-   }
-   else if(m_memoryMap.size())
-   {
-      return getHeightAboveMSL(gpt, false);
-   }
-   
-   return ossim::nan();
-}
-
-bool ossimDtedHandler::open(const ossimFilename& file, bool memoryMapFlag)
-{
-   static const char* MODULE = "ossimDtedHandler::open";
-   close();
-   theFilename = file;
-   m_fileStr.clear();
-
-   m_fileStr.open(file.c_str(), 
-                  std::ios::in | std::ios::binary);
-   if(!m_fileStr.good())
-   {
-      return false;
-   }
-   m_numLonLines = 0;
-   m_numLatPoints = 0;
-   m_dtedRecordSizeInBytes = 0;
-   
-   // Attempt to parse.
-   m_vol.parse(m_fileStr);
-   m_hdr.parse(m_fileStr);
-   m_uhl.parse(m_fileStr);
-   m_dsi.parse(m_fileStr);
-   m_acc.parse(m_fileStr);
-
-   //***
-   // Check for errors.  Must have uhl, dsi and acc records.  vol and hdr
-   // are for magnetic tape only; hence, may or may not be there.
-   //***
-   if (m_uhl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
-       m_dsi.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
-       m_acc.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG " << MODULE << ": "
-         << "\nError parsing file:  " << file.c_str()
-         << "\nPossibly not a dted file."
-         << std::endl;
-      }
-      
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      close();
-      return false;
-   }
-   if(memoryMapFlag)
-   {
-      m_fileStr.seekg(0);
-      m_fileStr.clear();
-      m_memoryMap.resize(theFilename.fileSize());
-      m_fileStr.read((char*)(&m_memoryMap.front()), (std::streamsize)m_memoryMap.size());
-      m_fileStr.close();
-   }
-   
-   m_numLonLines  = m_uhl.numLonLines();
-   m_numLatPoints = m_uhl.numLatPoints();
-   m_latSpacing   = m_uhl.latInterval();
-   m_lonSpacing   = m_uhl.lonInterval();
-   m_dtedRecordSizeInBytes = m_numLatPoints*2+ossimDtedRecord::DATA_LENGTH;
-   
-   m_edition  = m_dsi.edition();
-   m_productLevel = m_dsi.productLevel();
-   m_compilationDate = m_dsi.compilationDate();
-   
-   m_offsetToFirstDataRecord = m_acc.stopOffset();
-   
-#if 0 /* Serious debug only... */
-   std::cout << m_numLonLines
-             << "\t" << m_numLatPoints
-             << "\t" << m_lonSpacing
-             << "\t" << m_latSpacing
-             << "\t" << m_dtedRecordSizeInBytes
-             << "\t" << theFilename.fileSize()
-             << "\t" << file
-             << "\t" << m_offsetToFirstDataRecord
-             << std::endl;
-#endif
-
-   //***
-   //  initialize the bounding rectangle:
-   //***
-   double south_boundary = m_uhl.latOrigin();
-   double west_boundary  = m_uhl.lonOrigin();
-   double north_boundary = south_boundary + m_latSpacing*(m_numLatPoints-1);
-   double east_boundary  = west_boundary  + m_lonSpacing*(m_numLonLines-1);
-   
-   // For ossimElevCellHandler::pointHasCoverage method.
-   theGroundRect = ossimGrect(ossimGpt(north_boundary, west_boundary, 0.0),
-                              ossimGpt(south_boundary, east_boundary, 0.0));
-   
-   m_swCornerPost.lat = south_boundary;
-   m_swCornerPost.lon = west_boundary;
-   
-   //***
-   //  Determine the mean spacing:
-   //***
-   double center_lat = (south_boundary + north_boundary)/2.0;
-   theMeanSpacing = (m_latSpacing + m_lonSpacing*ossim::cosd(center_lat))
-                     * ossimGpt().metersPerDegree().x / 2.0;
-   
-   //  Initialize the accuracy values:
-   theAbsLE90 = m_acc.absLE();
-   theAbsCE90 = m_acc.absCE();
-   
-   // Set the base class null height value.
-   theNullHeightValue = -32767.0;
-
-   //---
-   // Commented out as this writes an un-needed file.  (drb 20100611)
-   // Get the statistics.
-   // gatherStatistics();
-   //---
-
-   return true;
-}
-
-double ossimDtedHandler::getHeightAboveMSL(const ossimGpt& gpt, bool readFromFile)
-{
-   // Establish the grid indexes:
-   double xi = (gpt.lon - m_swCornerPost.lon) / m_lonSpacing;
-   double yi = (gpt.lat - m_swCornerPost.lat) / m_latSpacing;
-
-   // Check for right edge.
-   int x0 = static_cast<int>(xi);
-   int y0 = static_cast<int>(yi);
-
-   if(x0 == (m_numLonLines-1))
-   {
-      --x0; // Move over one post.
-   }
-   
-   // Check for top edge.
-   //    if (gpt.lat == theGroundRect.ul().lat)
-   if(y0 == (m_numLatPoints-1))
-   {
-      --y0; // Move down one post.
-   }
-
-   // Do some error checking.
-   if ( xi < 0.0 || yi < 0.0 ||
-        x0 > (m_numLonLines  - 2.0) ||
-        y0 > (m_numLatPoints - 2.0) )
-   {
-      return ossim::nan();
-   }
-
-   //***
-   // Grab the four points from the dted cell needed.  These are big endian,
-   // signed magnitude shorts so they must be interpreted accordingly.
-   //***
-   int offset = m_offsetToFirstDataRecord + x0 * m_dtedRecordSizeInBytes +
-                y0 * 2 + DATA_RECORD_OFFSET_TO_POST;
-
-   /// read the posts from the DTED file.
-   DtedHeight postData;
-   //
-   if ( readFromFile )
-   {
-     readPostsFromFile( postData, offset );
-   }
-   else
-   {
-     ossim_uint8* buf = &m_memoryMap.front();
-     {
-       ossim_uint16 us;
-
-       memcpy(&us, buf+offset, POST_SIZE);
-       postData.m_posts[0].m_height = convertSignedMagnitude(us);
-       memcpy(&us, buf+offset+POST_SIZE, POST_SIZE);
-       postData.m_posts[1].m_height = convertSignedMagnitude(us);
-
-       // Move over to the next column.
-       offset += m_dtedRecordSizeInBytes;
-       memcpy(&us, buf+offset, POST_SIZE);
-       postData.m_posts[2].m_height = convertSignedMagnitude(us);
-       memcpy(&us, buf+offset+POST_SIZE, POST_SIZE);
-       postData.m_posts[3].m_height = convertSignedMagnitude(us);
-     }
-   }
-   // Perform bilinear interpolation:
-   double wx1 = xi  - x0;
-   double wy1 = yi  - y0;
-   double wx0 = 1.0 - wx1;
-   double wy0 = 1.0 - wy1;
-   
-   postData.m_posts[0].m_weight = wx0*wy0;
-   postData.m_posts[1].m_weight = wx0*wy1;
-   postData.m_posts[2].m_weight = wx1*wy0;
-   postData.m_posts[3].m_weight = wx1*wy1;
-
-#if 0 /* Serious debug only... */
-   postData.debug();
-#endif
-
-   return postData.calcHeight();
-}
-
-void ossimDtedHandler::readPostsFromFile( DtedHeight &postData, int offset)
-{
-
-  OpenThreads::ScopedLock <OpenThreads::Mutex> lock( m_fileStrMutex );
-  ossim_sint16 ss;
-  ossim_uint16 us;
-  int postCount = 0;
-  // read the posts in blocks 2x2.
-  for ( int column = 0; column < NUM_POSTS_PER_BLOCK ; ++column )
-  {
-    m_fileStr.seekg( offset, std::ios::beg );
-    for ( int row = 0; row < NUM_POSTS_PER_BLOCK ; ++row )
-    {
-      if ( !m_fileStr.eof() )
-      {
-        us = 0;
-        m_fileStr.read( ( char* ) &us, POST_SIZE );
-        // check the read was ok
-        if ( m_fileStr.good() )
-        {
-          postData.m_posts[postCount].m_status = true;
-        }
-        else
-        {
-          // reset the goodbit
-          m_fileStr.clear();
-        }
-        ss = convertSignedMagnitude( us );
-        postData.m_posts[postCount].m_height = ss;
-      }
-      postCount++;
-    }
-    offset += m_dtedRecordSizeInBytes;
-  }
-}
-
-double ossimDtedHandler::getPostValue(const ossimIpt& gridPt) const
-{
-   static const char MODULE[] = "ossimDtedHandler::getPostValue";
-   
-   // Do some error checking.
-   if ( gridPt.x < 0.0 || gridPt.y < 0.0 ||
-        gridPt.x > (m_numLonLines  - 1) ||
-        gridPt.y > (m_numLatPoints - 1) )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING " << MODULE << ": No intersection..." << std::endl;
-      }
-      return ossim::nan();
-   }
-
-   if (!isOpen())
-   {
-      return ossim::nan();
-   }
-
-   int offset =
-      m_offsetToFirstDataRecord + gridPt.x * m_dtedRecordSizeInBytes +
-      gridPt.y * 2 + DATA_RECORD_OFFSET_TO_POST;
-   
-   // Put the file pointer at the start of the first elevation post.
-   m_fileStr.seekg(offset, std::ios::beg);
-
-   ossim_uint16 us;
-
-   // Get the post.
-   m_fileStr.read((char*)&us, POST_SIZE);
-   
-   return double(convertSignedMagnitude(us));
-}
-
-void ossimDtedHandler::gatherStatistics()
-{
-   //***
-   // Check to see if there is a statistics file already.  If so; do a lookup
-   // for the min and max values.
-   //***
-   ossimFilename stats_file = theFilename;//theFilename.path();
-   stats_file.setExtension("statistics");
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimDtedHandler::gatherStatistics(): Looking for "
-         << stats_file << " statistics file..." << std::endl;
-   }
-
-   ossimKeywordlist kwl;
-   const char* min_str = NULL;
-   const char* max_str = NULL;
-
-   if (stats_file.exists())
-   {
-      if (kwl.addFile(stats_file))
-      {
-         // Look for the min_pixel_value keyword.
-         min_str = kwl.find(ossimKeywordNames::MIN_VALUE_KW);
-         max_str = kwl.find(ossimKeywordNames::MAX_VALUE_KW);
-      }
-   }
-
-   if (min_str && max_str)
-   {
-      theMinHeightAboveMSL = atoi(min_str);
-      theMaxHeightAboveMSL = atoi(max_str);
-   }
-   else if (theComputeStatsFlag&&!m_memoryMap.size())  // Scan the cell and gather the statistics...
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "NOTICE ossimDtedHandler::gatherStatistics():"
-            << " scanning for min/max"
-            << "\nThis may take a while..." << std::endl;
-      }
-      // Start off with the min and max pegged.
-      theMinHeightAboveMSL =  32767;
-      theMaxHeightAboveMSL = -32767;
-      
-      // Put the file pointer at the start of the first elevation post.
-      m_fileStr.seekg(m_offsetToFirstDataRecord, std::ios::beg);
-      
-      //---
-      // Loop through all records and scan for lowest min and highest max.
-      // Each record contains a row of latitude points for a given longitude.
-      // There are eight bytes in front of the post and four checksum bytes at
-      // the end so ignore them.
-      //---
-      for (ossim_int32 i=0; i<m_numLonLines; ++i)  // longitude direction
-      {
-         m_fileStr.seekg(DATA_RECORD_OFFSET_TO_POST, std::ios::cur);
-         
-         for (ossim_int32 j=0; j<m_numLatPoints; ++j) // latitude direction
-         {
-            ossim_uint16 us;
-            ossim_sint16 ss;
-            m_fileStr.read((char*)&us, POST_SIZE);
-            ss = convertSignedMagnitude(us);
-            if (ss < theMinHeightAboveMSL && ss != NULL_POST)
-            {
-               theMinHeightAboveMSL = ss;
-            }
-            if (ss > theMaxHeightAboveMSL)
-            {
-               theMaxHeightAboveMSL = ss;
-            }
-         }
-         
-         m_fileStr.seekg(DATA_RECORD_CHECKSUM_SIZE, std::ios::cur);
-      }
-      
-      // Add the stats to the keyword list.
-      kwl.add(ossimKeywordNames::MIN_VALUE_KW, theMinHeightAboveMSL);
-      kwl.add(ossimKeywordNames::MAX_VALUE_KW, theMaxHeightAboveMSL);
-      
-      // Write out the statistics file.
-      kwl.write(stats_file.c_str());
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimDtedHandler::gatherStatistics:"
-         << "\ntheMinHeightAboveMSL:  " << theMinHeightAboveMSL
-         << "\ntheMaxHeightAboveMSL:  " << theMaxHeightAboveMSL
-         << std::endl;
-   }
-}
-
-ossimIpt ossimDtedHandler::getSizeOfElevCell() const
-{
-   return ossimIpt(m_numLonLines, m_numLatPoints);
-}
-
-ossimString  ossimDtedHandler::edition() const
-{
-   return m_edition;
-}
-
-ossimString  ossimDtedHandler::productLevel() const
-{
-   return m_productLevel;
-}
-
-ossimString  ossimDtedHandler::compilationDate() const
-{
-   return m_compilationDate;
-}
-
-const ossimDtedHandler& ossimDtedHandler::operator=(
-   const ossimDtedHandler& rhs)
-{
-   return rhs;
-}
-
-ossimDtedHandler::ossimDtedHandler(const ossimDtedHandler&)
-   :
-   ossimElevCellHandler()
-{}
-
-
-/// DtedPost methods
-ossimDtedHandler::DtedPost::~DtedPost(){}
-
-/// DtedHeight methods
-ossimDtedHandler::DtedHeight::DtedHeight() {}
-
-ossimDtedHandler::DtedHeight::~DtedHeight(){}
-
-double ossimDtedHandler::DtedHeight::calcHeight()
-{
-  double sum_weights = 0;
-  double sum_posts = 0;
-
-  for ( int i = 0; i < TOTAL_POSTS; ++i )
-  {
-    if ( m_posts[i].m_height == NULL_POST || !m_posts[i].m_status )
-    {
-      m_posts[i].m_weight = 0.0;
-    }
-  }
-
-  for ( int i = 0; i < TOTAL_POSTS; ++i )
-  {
-    sum_weights += m_posts[i].m_weight;
-    sum_posts += m_posts[i].m_height * m_posts[i].m_weight;
-  }
-  if ( sum_weights )
-  {
-    return sum_posts / sum_weights;
-  }
-  return ossim::nan();
-}
-
-void ossimDtedHandler::DtedHeight::debug()
-{
-  cout << "\np00:  " << m_posts[0].m_height
-       << "\np01:  " << m_posts[1].m_height
-       << "\np10:  " << m_posts[2].m_height
-       << "\np11:  " << m_posts[3].m_height
-       << "\nw00:  " << m_posts[0].m_weight
-       << "\nw01:  " << m_posts[1].m_weight
-       << "\nw10:  " << m_posts[2].m_weight
-       << "\nw11:  " << m_posts[3].m_weight
-       << "\ns00:  " << m_posts[0].m_status
-       << "\ns01:  " << m_posts[1].m_status
-       << "\ns10:  " << m_posts[2].m_status
-       << "\ns11:  " << m_posts[3].m_status
-       << std::endl;
-}
-
diff --git a/ossim/src/ossim/elevation/ossimElevCellHandler.cpp b/ossim/src/ossim/elevation/ossimElevCellHandler.cpp
deleted file mode 100644
index 572ec8e..0000000
--- a/ossim/src/ossim/elevation/ossimElevCellHandler.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//*****************************************************************************
-// FILE: ossimElevCellHandler.cc
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimElevCellHandler. This is the base
-//   class for all DEM file readers including DTED. Each file shall have its
-//   corresponding ossimElevCellHandler. When more than one file is accessed,
-//   an ossimElevCombiner is used which owns multiple instances of this class.
-//
-// SOFTWARE HISTORY:
-//>
-//   19Apr2001  Oscar Kramer
-//              Initial coding.
-//<
-//*****************************************************************************
-// $Id: ossimElevCellHandler.cpp 23623 2015-11-13 18:24:28Z gpotts $
-
-#include <ossim/elevation/ossimElevCellHandler.h>
-#include <ossim/base/ossimKeyword.h>
-#include <ossim/base/ossimGpt.h>
-
-RTTI_DEF1(ossimElevCellHandler, "ossimElevCellHandler" , ossimElevSource)
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimElevCellHandler:exec");
-static ossimTrace traceDebug ("ossimElevCellHandler:debug");
-
-static const ossimKeyword DEM_FILENAME_KW ("dem_filename",
-                                           "Name of DEM file to load.");
-static const ossimIpt ZERO_SIZE_IPT (0, 0);
-
-ossimElevCellHandler::ossimElevCellHandler ()
-   : ossimElevSource(),
-     theFilename(),
-     theMeanSpacing(0.0),
-     theAbsLE90(0.0),
-     theAbsCE90(0.0)
-{
-}
-
-ossimElevCellHandler::ossimElevCellHandler (const ossimElevCellHandler& src)
-   : ossimElevSource(src),
-     theFilename    (src.theFilename),
-     theMeanSpacing (src.theMeanSpacing),
-     theAbsLE90     (src.theAbsLE90),
-     theAbsCE90     (src.theAbsCE90)
-{
-}
-
-ossimElevCellHandler::ossimElevCellHandler(const char* filename)
-   : ossimElevSource(),
-     theFilename(filename),
-     theMeanSpacing(0.0),
-     theAbsLE90(0.0),
-     theAbsCE90(0.0)
-{}
-
-ossimElevCellHandler::~ossimElevCellHandler()
-{}
-
-const ossimFilename& ossimElevCellHandler::getFilename() const
-{
-   return theFilename;
-}
-
-double ossimElevCellHandler::getMeanSpacingMeters() const
-{
-   return theMeanSpacing;
-}
-
-bool ossimElevCellHandler::getAccuracyInfo(ossimElevationAccuracyInfo& info,
-                                           const ossimGpt& /* gpt*/ ) const
-{
-  info.m_confidenceLevel = .9;
-  info.m_absoluteLE = theAbsLE90;
-  info.m_absoluteCE = theAbsCE90;
-
-  return info.hasValidAbsoluteError();
-}
-
-bool ossimElevCellHandler::canConnectMyInputTo(
-   ossim_int32 /* inputIndex */,
-   const ossimConnectableObject* /* object */) const
-{         
-   return false;
-}
-
-std::ostream& ossimElevCellHandler::print(ostream& out) const
-{
-   out << "\nossimElevCellHandler @ "<< (ossim_uint64) this
-         << "\n theFilename = "<< theFilename
-         << "\n theMeanSpacing = "<< theMeanSpacing
-         << "\n theAbsLE90 = "<< theAbsLE90
-         << "\n theAbsCE90 = "<< theAbsCE90;
-         //<< ossimElevSource::print(out);
-   return out;
-}
-
diff --git a/ossim/src/ossim/elevation/ossimElevCellHandlerFactory.cpp b/ossim/src/ossim/elevation/ossimElevCellHandlerFactory.cpp
deleted file mode 100644
index cb29ed3..0000000
--- a/ossim/src/ossim/elevation/ossimElevCellHandlerFactory.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//*****************************************************************************
-// FILE: ossimElevCellHandlerFactory.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimElevCellHandlerFactory. This is
-//   a "super-factory" owning a list of subfactories for each particular DEM
-//   format class.
-//
-//   NOT CURRENTLY UTILIZED -- USE DTED MANAGER
-//
-// LIMITATIONS:
-//   The intention of this factory is to produce individual instances of
-//   elevation cell handlers. Presently this is not supported since DTED is
-//   the only elevation source being handled. DTED is loaded via the
-//   ossimDtedManager class as a DB interface, and not by accessing individual
-//   DTED handlers.
-//
-// SOFTWARE HISTORY:
-//>
-//   01Aug2001  Oscar Kramer (okramer at imagelinks.com)
-//              Initial coding.
-//<
-//*****************************************************************************
-//  $Id: ossimElevCellHandlerFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/elevation/ossimElevCellHandlerFactory.h>
-#include <ossim/base/ossimString.h>
-
-ossimElevCellHandlerFactory* ossimElevCellHandlerFactory::theInstance = 0;
-
-//*****************************************************************************
-//  STATIC METHOD: instance()
-//  
-//*****************************************************************************
-ossimElevCellHandlerFactory* ossimElevCellHandlerFactory::instance()
-{
-   if(!theInstance)
-      theInstance = new ossimElevCellHandlerFactory;
- 
-   return (ossimElevCellHandlerFactory*) theInstance; 
-} 
-
-//*****************************************************************************
-//  PROTECTED DEFAULT CONSTRUCTOR: ossimElevCellHandlerFactory
-//  
-//*****************************************************************************
-ossimElevCellHandlerFactory::ossimElevCellHandlerFactory()
-{
-   //***
-   // Add default sub factories to this factory's registry list:
-   // NOTE: DTED handlers are managed by their own ossimDtedManager so should
-   // never be created individually via a factory. This will be the typical
-   // pattern for all but custom DEM files.
-   //***
-//   registerFactory(ossimUsgsDemCellFactory::instance());
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimElevCellHandlerFactory::create(kwl, prefix)
-//  
-//*****************************************************************************
-ossimElevCellHandler*
-ossimElevCellHandlerFactory::create(const ossimKeywordlist &keywordList,
-                                    const char *prefix) const
-{
-   std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator
-      elevCellFactory;
-
-   ossimElevCellHandler* product = 0;
-   
-   elevCellFactory = theRegistry.begin();
-   while((elevCellFactory != theRegistry.end()) && (!product))
-   {
-      product = (*elevCellFactory)->create(keywordList, prefix);
-      elevCellFactory++;
-   }
-
-   return product;
-}
-
-//*****************************************************************************
-//  METHOD: ossimElevCellHandlerFactory::create(proj_name)
-//  
-//*****************************************************************************
-ossimElevCellHandler*
-ossimElevCellHandlerFactory::create(const ossimString &name) const 
-{
-   std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator
-      elevCellFactory;
-
-   ossimElevCellHandler* product = 0;
-   
-   elevCellFactory = theRegistry.begin();
-   while((elevCellFactory != theRegistry.end()) && (!product))
-   {
-      product = (*elevCellFactory)->create(name);
-      elevCellFactory++;
-   }
-
-   return product;
-}
-
-//*****************************************************************************
-//  METHOD: ossimElevCellHandlerFactory::getList()
-//  
-//*****************************************************************************
-std::list<ossimString> ossimElevCellHandlerFactory::getList() const 
-{
-   std::list<ossimString> rtn_list;
-   std::list<ossimString> sub_list;
-   std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator factory_iter;
-
-   factory_iter = theRegistry.begin();
-   while(factory_iter != theRegistry.end())
-   {
-      sub_list = (*factory_iter)->getList();
-      rtn_list.merge(sub_list);
-      factory_iter++;
-   }
-
-   return rtn_list;
-}
-
-
diff --git a/ossim/src/ossim/elevation/ossimElevManager.cpp b/ossim/src/ossim/elevation/ossimElevManager.cpp
deleted file mode 100644
index 20a4f02..0000000
--- a/ossim/src/ossim/elevation/ossimElevManager.cpp
+++ /dev/null
@@ -1,656 +0,0 @@
-//**************************************************************************
-// FILE: ossimElevManager.cpp
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimElevManager. This object 
-//   provides a single interface for accessing multiple elevation
-//   sources. This object owns one or more elevation sources in an ordered
-//   list. When queried for an elevation at a particular point, it searches
-//   the available sources for the best result, instantiating new sources if
-//   necessary.
-//
-// SOFTWARE HISTORY:
-//>
-//   23Apr2001  Oscar Kramer
-//              Initial coding.
-//<
-//**************************************************************************
-// $Id: ossimElevManager.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimEnvironmentUtility.h>
-#include <ossim/elevation/ossimElevationCellDatabase.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/elevation/ossimElevationDatabaseRegistry.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <algorithm>
-
-//ossimElevManager* ossimElevManager::m_instance = 0;
-static ossimTrace traceDebug("ossimElevManager:debug");
-
-//---
-// For std::sort of ElevationDatabaseListType
-// e.g.: std::sort( dbList.begin(), dbList.end(), dbSort );
-//---
-bool dbSort(ossimRefPtr<ossimElevationDatabase> a, ossimRefPtr<ossimElevationDatabase> b)
-{
-   bool result = false;
-   if ( a.valid() && b.valid() )
-   {
-      result = ( a->getMeanSpacingMeters() < b->getMeanSpacingMeters() );
-   }
-   return result;
-}
-
-ossimElevManager::ConnectionStringVisitor::ConnectionStringVisitor( const ossimString& value )
-   :
-   m_connectionString(value),
-   m_database(0)
-{}
-
-void ossimElevManager::ConnectionStringVisitor::visit(ossimObject* obj)
-{
-   if(!hasVisited(obj))
-   {
-      ossimElevationDatabase* databsase = dynamic_cast<ossimElevationDatabase*>(obj);
-      if(databsase)
-      {
-         if(m_connectionString == databsase->getConnectionString())
-         {
-            m_database = databsase;
-            m_stopTraversalFlag = true;
-         }
-      }
-   }
-}
-
-ossimElevManager* ossimElevManager::instance()
-{
-   static ossimElevManager inst;
-   return &inst;
-}
-
-ossimElevManager::ossimElevManager()
-   :ossimElevSource(),
-    m_maxRoundRobinSize(1),
-    m_defaultHeightAboveEllipsoid(ossim::nan()),
-    m_elevationOffset(ossim::nan()),
-    m_useGeoidIfNullFlag(false),
-    m_currentDatabaseIdx(0),
-    m_mutex()
-{
-   loadStandardElevationPaths();
-}
-
-ossimElevManager::~ossimElevManager()
-{
-   clear();
-}
-
-double ossimElevManager::getHeightAboveEllipsoid(const ossimGpt& gpt)
-{
-   double result = ossim::nan();
-
-   if (!isSourceEnabled())
-      return result;
-
-   ElevationDatabaseListType& elevDbList = getNextElevDbList();
-   for (ossim_uint32 idx = 0; (idx < elevDbList.size()) && ossim::isnan(result); ++idx)
-   {
-      result = elevDbList[idx]->getHeightAboveEllipsoid(gpt);
-   }
-
-   if (ossim::isnan(result))
-   {
-      // No elevation value was returned from the database, so try next best alternatives depending
-      // on ossim_preferences settings. Priority goes to default ellipsoid height if available:
-      if (!ossim::isnan(m_defaultHeightAboveEllipsoid))
-      {
-         result = m_defaultHeightAboveEllipsoid;
-      }
-      else if (m_useGeoidIfNullFlag)
-      {
-         result = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
-      }
-   }
-
-   // Next, ossim_preferences may have indicated an elevation offset to use (top of trees, error
-   // bias, etc):
-   if (!ossim::isnan(m_elevationOffset) && !ossim::isnan(result))
-      result += m_elevationOffset;
-
-   return result;
-}
-
-double ossimElevManager::getHeightAboveMSL(const ossimGpt& gpt)
-{
-   double result = ossim::nan();
-
-   if (!isSourceEnabled())
-      return result;
-
-   ElevationDatabaseListType& elevDbList = getNextElevDbList();
-   for (ossim_uint32 idx = 0; (idx < elevDbList.size()) && ossim::isnan(result); ++idx)
-   {
-      result = elevDbList[idx]->getHeightAboveMSL(gpt);
-   }
-
-   if (ossim::isnan(result) && m_useGeoidIfNullFlag)
-   {
-      // No elevation value was returned from the database, so try next best alternatives depending
-      // on ossim_preferences settings. First default to height at MSL itself:
-      result = 0.0; // MSL
-      if (!ossim::isnan(m_defaultHeightAboveEllipsoid))
-      {
-         // Use the default height above ellipsoid corrected for best guess of MSL above ellipsoid
-         // (i.e., the geoid):
-         double dh = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
-         if (!ossim::isnan(dh))
-            result = m_defaultHeightAboveEllipsoid - dh;
-      }
-   }
-
-   // ossim_preferences may have indicated an elevation offset to use (top of trees, error bias, etc)
-   if (!ossim::isnan(result) && (!ossim::isnan(m_elevationOffset)))
-      result += m_elevationOffset;
-
-   return result;
-}
-
-void ossimElevManager::loadStandardElevationPaths()
-{
-   ossimFilename userDir    = ossimEnvironmentUtility::instance()->getUserOssimSupportDir();
-   ossimFilename installDir = ossimEnvironmentUtility::instance()->getInstalledOssimSupportDir();
-   
-   userDir = userDir.dirCat("elevation");
-   installDir = installDir.dirCat("elevation");
-   
-   loadElevationPath(userDir);
-   loadElevationPath(installDir);
-   
-   ossimString paths = ossimEnvironmentUtility::instance()->getEnvironmentVariable("OSSIM_ELEVATION_PATH");
-   std::vector<ossimString> pathArray;
-   ossimString pathSeparator = ":";
-#if defined(WIN32) && !defined(CYGWIN)
-   pathSeparator = ";";
-#endif
-   
-   if(!paths.empty())
-   {
-      paths.split(pathArray, pathSeparator);
-      if(!pathArray.empty())
-      {
-         ossim_uint32 idx = 0;
-         for(idx = 0; idx < pathArray.size(); ++idx)
-         {
-            ossimFilename file(pathArray[idx]);
-            
-            if(file.exists())
-            {
-               loadElevationPath(file);
-            }
-         }
-      }
-   }
-}
-
-bool ossimElevManager::loadElevationPath(const ossimFilename& path)
-{
-   bool result = false;
-   ossimElevationDatabase* database = ossimElevationDatabaseRegistry::instance()->open(path);
-   
-   if(!database&&path.isDir())
-   {
-      ossimDirectory dir;
-      
-      if(dir.open(path))
-      {
-         ossimFilename file;
-         dir.getFirst(file, ossimDirectory::OSSIM_DIR_DIRS);
-         do
-         {
-            database = ossimElevationDatabaseRegistry::instance()->open(file);
-            if(database)
-            {
-               result = true;
-               addDatabase(database);
-            }
-         }while(dir.getNext(file));
-      }
-   }
-   else if(database)
-   {
-      result = true;
-      addDatabase(database);
-   }
-   
-   return result;
-}
-
-void ossimElevManager::getOpenCellList(std::vector<ossimFilename>& list) const
-{
-   if ( m_dbRoundRobin.size() )
-   {
-      ElevationDatabaseListType& elevDbList = m_dbRoundRobin[0];
-      for(ossim_uint32 idx = 0; idx < elevDbList.size(); ++idx)
-      {
-         // If this is a cell based database get the files:
-         ossimRefPtr<const ossimElevationCellDatabase> db =
-            dynamic_cast<const ossimElevationCellDatabase*>( elevDbList[idx].get() );
-         if ( db.valid() )
-         {
-            db->getOpenCellList(list);
-         }
-      }
-   }
-}
-
-void ossimElevManager::getCellsForBounds( const std::string& connectionString,
-                                          const ossim_float64& minLat,
-                                          const ossim_float64& minLon,
-                                          const ossim_float64& maxLat,
-                                          const ossim_float64& maxLon,
-                                          std::vector<std::string>& cells, 
-                                          ossim_uint32 maxNumberOfCells)
-{
-   ossimRefPtr<ossimElevationCellDatabase> cellDatabase = 0;
-
-   // See if the connectionString is already opened:
-   ossimString os = connectionString;
-   ossimElevManager::ConnectionStringVisitor visitor( os );
-   accept( visitor );
-   cellDatabase = dynamic_cast<ossimElevationCellDatabase*>( visitor.getElevationDatabase() );
-
-   if ( cellDatabase.valid() == false )
-   {
-      // Try to open it:
-      ossimRefPtr<ossimElevationDatabase> db =
-         ossimElevationDatabaseRegistry::instance()->open( ossimString(connectionString) );
-
-      if ( db.valid() )
-      {
-         cellDatabase = dynamic_cast<ossimElevationCellDatabase*>( db.get() );
-      }
-   }
-
-   // Lastly get the files:
-   if ( cellDatabase.valid() )
-   {
-      cellDatabase->getCellsForBounds( minLat, minLon, maxLat, maxLon, cells, maxNumberOfCells );
-   }
-   else
-   {
-      // Bummer:
-      cells.clear();
-   }
-}
-
-void ossimElevManager::getCellsForBounds( const ossim_float64& minLat,
-                                          const ossim_float64& minLon,
-                                          const ossim_float64& maxLat,
-                                          const ossim_float64& maxLon,
-                                          std::vector<std::string>& cells, 
-                                          ossim_uint32 maxNumberOfCells )
-{
-   //TODO: Presently incrementing by 0.1 deg. If an elev cell
-   // is smaller than this, it may be missed. Need to generalize to support arbitrary cell sizes.
-
-   //TODO: This method relies on the caching of open cells. If the bounds are too large too permit
-   // all cells to remain open, this method will incorrectly return a subset of all cells providing
-   // coverage.
-
-   // Ping the collection of databases for elevation values at regular intervals inside the bounds.
-   // This will autoload the best cells:
-   cells.clear();
-   const ossim_float64 DELTA_DEG = 0.1; // degree
-   ossimGpt gpt;
-   for (gpt.lat=minLat; gpt.lat<=maxLat; gpt.lat+=DELTA_DEG)
-   {
-      for (gpt.lon=minLon; gpt.lon<=maxLon; gpt.lon+=DELTA_DEG)
-      {
-         getHeightAboveMSL(gpt);
-      }
-   }
-
-   // Convert filename list to string list (why are they different)?
-   ossim_uint32 limitCells = maxNumberOfCells>0?maxNumberOfCells:static_cast<ossim_uint32>(9999999999);
-   std::vector<ossimFilename> open_cells;
-   getOpenCellList(open_cells);
-   std::vector<ossimFilename>::iterator iter = open_cells.begin();
-   while ((iter != open_cells.end()) && (cells.size() < limitCells))
-   {
-      cells.push_back(iter->string());
-      ++iter;
-   }
-}
-
-
-void ossimElevManager::getCellsForBounds( const ossimGrect& bbox,
-                                          std::vector<std::string>& cells,
-                                          ossim_uint32 maxCells)
-{
-   getCellsForBounds(bbox.lr().lat, bbox.ul().lon, bbox.ul().lat, bbox.lr().lon, cells, maxCells);
-}
-
-void ossimElevManager::clear()
-{
-   std::vector<ElevationDatabaseListType>::iterator i = m_dbRoundRobin.begin();
-   while ( i != m_dbRoundRobin.end() )
-   {
-      i->clear();
-      ++i;
-   }
-}
-
-void ossimElevManager::accept(ossimVisitor& visitor)
-{
-   std::vector<ElevationDatabaseListType>::iterator rri = m_dbRoundRobin.begin();
-   while ( rri != m_dbRoundRobin.end() )
-   {
-      ElevationDatabaseListType& elevDbList = *rri;
-
-      ossimElevManager::ElevationDatabaseListType::iterator i = elevDbList.begin();
-      while ( i != elevDbList.end() )
-      {
-         if ( (*i).valid() )
-         {
-            (*i)->accept( visitor );
-
-            if ( visitor.stopTraversal() )
-            {
-               break;
-            }
-         }
-         ++i;
-      }
-      ++rri;
-   }
-}
-
-bool ossimElevManager::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
-{
-   ElevationDatabaseListType& elevDbList = getNextElevDbList();
-   for(ossim_uint32 idx = 0;(idx < elevDbList.size()); ++idx)
-   {
-      if(elevDbList[idx]->getAccuracyInfo(info, gpt))
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-bool ossimElevManager::pointHasCoverage(const ossimGpt& gpt) const
-{
-   if ( m_dbRoundRobin.size() )
-   {
-      ElevationDatabaseListType& elevDbList = m_dbRoundRobin[0];
-      for(ossim_uint32 idx = 0;(idx < elevDbList.size()); ++idx)
-      {
-         if(elevDbList[idx]->pointHasCoverage(gpt))
-         {
-            return true;
-         }
-      }
-   }
-   return false;
-}
-
-bool ossimElevManager::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix, "elevation_offset", m_elevationOffset, true);
-   kwl.add(prefix, "default_height_above_ellipsoid", m_defaultHeightAboveEllipsoid, true);
-   kwl.add(prefix, "use_geoid_if_null", m_useGeoidIfNullFlag, true);
-   kwl.add(prefix, "threads", ossimString::toString(m_maxRoundRobinSize), true);
-
-   return ossimElevSource::saveState(kwl, prefix);
-}
-
-/**
- * Method to the load (recreate) the state of an object from a keyword
- * list.  Return true if ok or false on error.
- */
-bool ossimElevManager::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimElevManager::loadState: Entered..."
-      << std::endl;
-   }
-   if(!ossimElevSource::loadState(kwl, prefix))
-   {
-      return false;
-   }
-   ossimString copyPrefix(prefix);
-   ossimString elevationOffset = kwl.find(copyPrefix, "elevation_offset");
-   ossimString defaultHeightAboveEllipsoid = kwl.find(copyPrefix, "default_height_above_ellipsoid");
-   ossimString useGeoidIfNull = kwl.find(copyPrefix, "use_geoid_if_null");
-   ossimString elevRndRbnSize = kwl.find(copyPrefix, "threads");
-
-   if(!elevationOffset.empty())
-   {
-      m_elevationOffset = elevationOffset.toDouble();
-   }
-   if(!defaultHeightAboveEllipsoid.empty())
-   {
-      m_defaultHeightAboveEllipsoid = defaultHeightAboveEllipsoid.toDouble();
-   }
-   if(!useGeoidIfNull.empty())
-   {
-      m_useGeoidIfNullFlag = useGeoidIfNull.toBool();
-   }
-
-   ossim_uint32 numThreads = 1;
-   if(!elevRndRbnSize.empty())
-   {
-      if (elevRndRbnSize.contains("yes") || elevRndRbnSize.contains("true"))
-         numThreads = ossim::getNumberOfThreads();
-      else if (elevRndRbnSize.contains("no") || elevRndRbnSize.contains("false"))
-         numThreads = 1;
-      else
-      {
-         numThreads = elevRndRbnSize.toUInt32();
-         numThreads = numThreads > 0 ? numThreads : 1;
-      }
-   }
-   setRoundRobinMaxSize(numThreads);
-
-   ossimString regExpression =  ossimString("^(") + copyPrefix + "elevation_source[0-9]+.)";
-   vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
-   long numberOfSources = (long)keys.size();
-   ossim_uint32 offset = (ossim_uint32)(copyPrefix+"elevation_source").size();
-   ossim_uint32 idx = 0;
-   std::vector<int> theNumberList(numberOfSources);
-   for(idx = 0; idx < theNumberList.size();++idx)
-   {
-      ossimString numberStr(keys[idx].begin() + offset,
-                            keys[idx].end());
-      theNumberList[idx] = numberStr.toInt();
-   }
-   std::sort(theNumberList.begin(), theNumberList.end());
-   
-   for(idx=0;idx < theNumberList.size();++idx)
-   {
-      ossimString newPrefix = copyPrefix;
-      newPrefix += ossimString("elevation_source");
-      newPrefix += ossimString::toString(theNumberList[idx]);
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimElevManager::loadState:"
-         << "\nLooking for key:  " << newPrefix
-         << std::endl;
-      }
-
-      //---
-      // Check for enabled key first.  Default, if not found is true for
-      // legacy compatibility.
-      //---
-      bool enabled = true;
-      std::string key = newPrefix.string();
-      key += ".";
-      key += ossimKeywordNames::ENABLED_KW;
-      std::string value = kwl.findKey( key );
-      if ( value.size() )
-      {
-         enabled = ossimString(value).toBool();
-      }
-
-      if ( enabled )
-      {
-         // first check if new way is supported
-         ossimRefPtr<ossimElevationDatabase> database =
-            ossimElevationDatabaseRegistry::instance()->createDatabase(kwl, newPrefix+".");
-         if(database.valid())
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG ossimElevManager::loadState:"
-                  << "\nadding elevation database:  "
-                  << database->getClassName()
-                  << ": " << database->getConnectionString()
-                  << std::endl;
-            }  
-            addDatabase(database.get());
-         }
-         else
-         {
-            // if not new elevation load verify the old way by
-            // looking at the filename
-            //
-            ossimString fileKey = newPrefix;
-            fileKey += ".";
-            fileKey += ossimKeywordNames::FILENAME_KW;
-            ossimString lookup = kwl.find(prefix, fileKey.c_str());
-            if (!lookup.empty())
-            {
-               loadElevationPath(ossimFilename(lookup));
-            } // end if lookup
-         }
-      }
-
-   } // end for loop
-
-   return true;
-}
-
-void ossimElevManager::setRoundRobinMaxSize(ossim_uint32 new_size)
-{
-   m_maxRoundRobinSize = new_size;
-
-#ifdef DYNAMICALLY_ALLOCATE_ROUND_ROBIN
-   // Resize the round robin, preserves at least the first entry if any:
-   if (new_size < m_dbRoundRobin.size())
-      m_dbRoundRobin.resize(new_size);
-#else
-   // OLK 02/2015 -- Was hoping to dynamically allocate the round robin as needed but was running
-   // into issues, so just allocating full set here (containing empty lists at this point). The
-   // heavy lifting is in addDatabase() where copies are made for each entry in the round robin. It
-   // would have been best to keep the size of the round robin to an as-needed basis to avoid
-   // unnecessary duplicate lists. However, this is only relevant for small apps (like ossim-info)
-   // where minimal number of elevation look-ups are done. TODO: Figure out why MT run core dumps
-   // when dynamically sizing m_dbRoundRobin.
-   m_dbRoundRobin.resize(new_size);
-#endif
-
-}
-
-inline ossimElevManager::ElevationDatabaseListType& ossimElevManager::getNextElevDbList() const
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock (m_mutex);
-
-   // Quickly grab the DB to be used by this thread and increment DB index to be used by next thread
-   // May need to grow the list round robin as it is dynamically set as needed):
-   if (m_currentDatabaseIdx >= m_dbRoundRobin.size())
-   {
-      ossim_uint32 index = m_dbRoundRobin.size();
-      m_dbRoundRobin.resize(index+1);
-
-      // An entry existed prior, duplicate its contents for all Db lists in the round robin. Only
-      // duplicate as needed beyond what already existed:
-      ElevationDatabaseListType::iterator iter = m_dbRoundRobin[0].begin();
-      while (iter != m_dbRoundRobin[0].end())
-      {
-         ossimRefPtr<ossimElevationDatabase> dupDb = (ossimElevationDatabase*) (*iter)->dup();
-         m_dbRoundRobin[index].push_back(dupDb);
-         ++iter;
-      }
-   }
-
-   ossim_uint32 index = m_currentDatabaseIdx++;
-   if (m_currentDatabaseIdx == m_maxRoundRobinSize)
-      m_currentDatabaseIdx = 0;
-
-   return m_dbRoundRobin[index];
-}
-
-void ossimElevManager::addDatabase(ossimElevationDatabase* database)
-{
-   if(!database)
-      return;
-
-   if (m_dbRoundRobin.empty())
-      m_dbRoundRobin.resize(1);
-
-   std::vector<ElevationDatabaseListType>::iterator rri = m_dbRoundRobin.begin();
-   if (std::find(rri->begin(), rri->end(), database) == rri->end())
-   {
-      (*rri).push_back(database);
-      ++rri;
-
-      // Populate the parallel lists in the round-robin with duplicates:
-      while ( rri != m_dbRoundRobin.end() )
-      {
-         ossimRefPtr<ossimElevationDatabase> dupDb = (ossimElevationDatabase*) database->dup();
-         (*rri).push_back(dupDb);
-         ++rri;
-      }
-   }
-}
-
-double ossimElevManager::getMeanSpacingMeters() const
-{
-   double spacing = ossim::nan();
-   if ( m_dbRoundRobin.size() )
-   {
-       ElevationDatabaseListType& elevDbList = m_dbRoundRobin[0];
-      for(ossim_uint32 idx = 0;(idx < elevDbList.size()); ++idx)
-      {
-         double d_idx = elevDbList[idx]->getMeanSpacingMeters();
-         if (ossim::isnan(spacing) || (d_idx < spacing))
-         {
-            spacing = d_idx;
-         }
-      }
-   }
-   return spacing;
-}
-
-std::ostream& ossimElevManager::print(ostream& out) const
-{
-   out << "\nossimElevManager @ "<< (ossim_uint64) this
-         << "\nm_defaultHeightAboveEllipsoid = "<<m_defaultHeightAboveEllipsoid
-         << "\nm_elevationOffset = "<<m_elevationOffset
-         << "\nm_useGeoidIfNullFlag = "<<m_useGeoidIfNullFlag
-         << "\nm_currentDatabaseIdx = "<<m_currentDatabaseIdx
-         << "\nm_dbRoundRobin.size = "<<m_dbRoundRobin.size();
-   for (ossim_uint32 i=0; i<m_dbRoundRobin.size(); ++i)
-   {
-      out<<"\nm_dbRoundRobin["<<i<<"].size = "<<m_dbRoundRobin[i].size()<<endl;
-      for (ossim_uint32 j=0; j<m_dbRoundRobin[i].size(); ++j)
-         out<<"m_dbRoundRobin["<<i<<"]["<<j<<"] = "<<m_dbRoundRobin[i][j]->print(out)<<endl;
-   }
-   cout<<"\n"<<ossimElevSource::print(cout);
-   return out;
-}
-
-
diff --git a/ossim/src/ossim/elevation/ossimElevSource.cpp b/ossim/src/ossim/elevation/ossimElevSource.cpp
deleted file mode 100644
index 1d7ea62..0000000
--- a/ossim/src/ossim/elevation/ossimElevSource.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-//*****************************************************************************
-// FILE: ossimElevSource.cc
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimElevSource. This is the base class
-//   for all sources of elevation data. it maintains a single common static
-//   instance of the geoid for use by all instances of objects derived from
-//   this one. 
-//
-// SOFTWARE HISTORY:
-//>
-//   18Apr2001  Oscar Kramer
-//              Initial coding.
-//<
-//*****************************************************************************
-// $Id: ossimElevSource.cpp 23117 2015-01-29 22:33:13Z okramer $
-
-#include <ossim/elevation/ossimElevSource.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimEcefRay.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-RTTI_DEF1(ossimElevSource, "ossimElevSource" , ossimSource)
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimElevSource:exec");
-static ossimTrace traceDebug ("ossimElevSource:debug");
-
-
-static const char ENABLE_STATS_KW[] = "elevation.compute_statistics.enabled";
-
-ossimElevSource::ossimElevSource()
-   :
-      theMinHeightAboveMSL (0.0),
-      theMaxHeightAboveMSL (0.0),
-      theNullHeightValue   (ossim::nan()),
-      theSeaLevelValue     (OSSIM_DEFAULT_MEAN_SEA_LEVEL),
-      theGroundRect(),
-      theComputeStatsFlag(false)
-   
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimElevSource::ossimElevSource: entering..."
-         << std::endl;
-   }
-   
-   // User can turn on off with a keyword.
-   const char* lookup =
-      ossimPreferences::instance()->findPreference(ENABLE_STATS_KW);
-   if (lookup)
-   {
-     theComputeStatsFlag = ossimString(lookup).toBool();
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG:"
-         << "\ntheComputeStatsFlag:  "
-         << (theComputeStatsFlag?"true":"false")
-         << endl;
-   }
-
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimElevSource::ossimElevSource: returning..."
-         << std::endl;
-   }
-}
-
-ossimElevSource::ossimElevSource(const ossimElevSource& src)
-   :ossimSource(src),
-    theMinHeightAboveMSL(src.theMinHeightAboveMSL),
-    theMaxHeightAboveMSL(src.theMaxHeightAboveMSL),
-    theNullHeightValue(src.theNullHeightValue),
-    theSeaLevelValue(src.theSeaLevelValue),
-    theGroundRect(src.theGroundRect),
-    theComputeStatsFlag(src.theComputeStatsFlag)
-{
-}
-
-ossimElevSource::~ossimElevSource()
-{}
-
-double ossimElevSource::getHeightAboveEllipsoid(const ossimGpt& /* argGpt */)
-{
-   ossimNotify(ossimNotifyLevel_FATAL)
-      << "FATAL ossimElevSource::getHeightAboveEllipsoid Not implemented..."
-      << std::endl;
-   return theNullHeightValue;
-}
-
-//*****************************************************************************
-//  METHOD: intersectRay()
-//  
-//  Service method for intersecting a ray with the elevation surface to
-//  arrive at a ground point. The ray is expected to originate ABOVE the
-//  surface and pointing down.
-//
-//  NOTE: the gpt argument is expected to be initialized with the desired
-//  datum, including ellipsoid, for the proper intersection point to be
-//  computed.
-//
-//  LIMITATION: This release supports only single valued solutions, i.e., it
-//  is possible a ray passing through one side of a mountain and out the other
-//  will return an intersection with the far side. Eventually, a more robust
-//  algorithm will be employed.
-//
-//*****************************************************************************
-bool ossimElevSource::intersectRay(const ossimEcefRay& ray, ossimGpt& gpt, double defaultElevValue)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: entering..." << std::endl;
-
-   static const double CONVERGENCE_THRESHOLD = 0.001; // meters
-   static const int    MAX_NUM_ITERATIONS    = 50;
-   
-   double          h_ellips; // height above ellipsoid
-   bool            intersected;
-   ossimEcefPoint  prev_intersect_pt (ray.origin());
-   ossimEcefPoint  new_intersect_pt;
-   double          distance;
-   bool            done = false;
-   int             iteration_count = 0;
-
-   if(ray.hasNans()) 
-   {
-      gpt.makeNan();
-      return false;
-   }
-   //***
-   // Set the initial guess for horizontal intersect position as the ray's
-   // origin, and establish the datum and ellipsoid:
-   //***
-   const ossimDatum*     datum     = gpt.datum();
-   const ossimEllipsoid* ellipsoid = datum->ellipsoid();
-//    double lat, lon, h;
-
-//    ellipsoid->XYZToLatLonHeight(ray.origin().x(),
-//                                 ray.origin().y(),
-//                                 ray.origin().z(),
-//                                 lat, lon, h);
-//    ossimGpt nadirGpt(lat, lon, h);
-
-//    std::cout << "nadir pt = " << nadirGpt << std::endl;
-   
-   gpt = ossimGpt(prev_intersect_pt, datum);
-
-   //
-   // Loop to iterate on ray intersection with variable elevation surface:
-   //
-   do
-   {
-      //
-      // Intersect ray with ellipsoid inflated by h_ellips:
-      //
-      h_ellips = getHeightAboveEllipsoid(gpt);
-      if ( ossim::isnan(h_ellips) ) h_ellips = defaultElevValue;
-      
-      intersected = ellipsoid->nearestIntersection(ray,
-                                                   h_ellips,
-                                                   new_intersect_pt);
-      if (!intersected)
-      {
-         //
-         // No intersection (looking over the horizon), so set ground point
-         // to NaNs:
-         //
-         gpt.makeNan();
-         done = true;
-      }
-      else
-      {
-         //
-         // Assign the ground point to the latest iteration's intersection
-         // point:
-         //
-         gpt = ossimGpt(new_intersect_pt, datum);
-         
-         //
-         // Determine if convergence achieved:
-         //
-         distance = (new_intersect_pt - prev_intersect_pt).magnitude();
-         if (distance < CONVERGENCE_THRESHOLD)
-            done = true;
-         else
-         {
-            prev_intersect_pt = new_intersect_pt;
-         }
-      }
-
-      iteration_count++;
-
-   } while ((!done) && (iteration_count < MAX_NUM_ITERATIONS));
-
-   if (iteration_count == MAX_NUM_ITERATIONS)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimElevSource::intersectRay: Max number of iterations reached solving for ground "
-                                            << "point. Result is probably inaccurate." << std::endl;
-      }
-   }
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: returning..." << std::endl;
-   return intersected;
-}
-
-double ossimElevSource::getMinHeightAboveMSL() const
-{
-   return theMinHeightAboveMSL;
-}
-
-double ossimElevSource::getMaxHeightAboveMSL() const
-{
-   return theMaxHeightAboveMSL;
-}
-
-double ossimElevSource::getNullHeightValue() const
-{
-   return theNullHeightValue;
-}
-
-double ossimElevSource::getSeaLevelValue() const
-{
-   return theSeaLevelValue;
-}
-
-const ossimGrect& ossimElevSource::getBoundingGndRect() const
-{
-   return theGroundRect;
-}
-
-bool ossimElevSource::canConnectMyInputTo(ossim_int32 /* inputIndex */,
-                                          const ossimConnectableObject* /* object */)const
-{
-   return false;
-}
-
-void ossimElevSource::initialize()
-{}
-
-
-bool ossimElevSource::getComputeStatisticsFlag() const
-{
-   return theComputeStatsFlag;
-}
-
-void ossimElevSource::setComputeStatisticsFlag(bool flag)
-{
-   theComputeStatsFlag = flag;
-}
-
-std::ostream& ossimElevSource::print(std::ostream& out) const
-{
-   out << "\nossimElevSource @ "<< (ossim_uint64) this
-         << "\ntheMinHeightAboveMSL = "<<theMinHeightAboveMSL
-         << "\ntheMaxHeightAboveMSL = "<<theMaxHeightAboveMSL
-         << "\ntheNullHeightValue = "<<theNullHeightValue
-         << "\ntheSeaLevelValue = "<<theSeaLevelValue
-         << "\ntheGroundRect = "<<theGroundRect
-         << ossimSource::print(out);
-   return out;
-}
-
diff --git a/ossim/src/ossim/elevation/ossimElevSourceFactory.cpp b/ossim/src/ossim/elevation/ossimElevSourceFactory.cpp
deleted file mode 100644
index 9149404..0000000
--- a/ossim/src/ossim/elevation/ossimElevSourceFactory.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//----------------------------------------------------------------------------
-// FILE: ossimElevSourceFactory.cc
-//
-// Copyright (C) 2002 ImageLinks, Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Class definition for ossimElevSourceFactory.
-//
-// This is the base class interface for elevation source factories.  Contains
-// pure virtual methods that all elevation source factories must implement.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimElevSourceFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/elevation/ossimElevSourceFactory.h>
-
-RTTI_DEF1(ossimElevSourceFactory, "ossimElevSourceFactory" , ossimObject)
-
-ossimElevSourceFactory::ossimElevSourceFactory()
-   : theDirectory(ossimFilename::NIL)
-{
-}
-
-ossimElevSourceFactory::~ossimElevSourceFactory()
-{
-}
-
-ossimFilename ossimElevSourceFactory::getDirectory() const
-{
-   return theDirectory;
-}
-
-void ossimElevSourceFactory::setDirectory(const ossimFilename& directory)
-{
-   theDirectory = directory;
-}
-
diff --git a/ossim/src/ossim/elevation/ossimElevationCellDatabase.cpp b/ossim/src/ossim/elevation/ossimElevationCellDatabase.cpp
deleted file mode 100644
index 496bb33..0000000
--- a/ossim/src/ossim/elevation/ossimElevationCellDatabase.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-#include <ossim/elevation/ossimElevationCellDatabase.h>
-
-RTTI_DEF1(ossimElevationCellDatabase, "ossimElevationCellDatabase", ossimElevationDatabase);
-
-void ossimElevationCellDatabase::getOpenCellList(std::vector<ossimFilename>& list) const
-{
-   CellMap::const_iterator iter = m_cacheMap.begin();
-
-   while(iter!=m_cacheMap.end())
-   {
-      list.push_back(iter->second->m_handler->getFilename());
-      ++iter;
-   }
-
-}
-
-void ossimElevationCellDatabase::getCellsForBounds( const ossim_float64& minLat,
-                                                    const ossim_float64& minLon,
-                                                    const ossim_float64& maxLat,
-                                                    const ossim_float64& maxLon,
-                                                    std::vector<std::string>& cells,
-                                                    ossim_uint32 maxNumberOfCells )
-{
-   const ossim_float64 SEARCH_SPACING = 0.1;
-   ossimGpt gpt(0.0, 0.0, 0.0);
-   std::string f;
-   ossim_uint32 limitNumberOfCells = maxNumberOfCells>0?maxNumberOfCells:static_cast<ossim_uint32>(9999999999);
-   // Latitude loop:
-   ossim_float64 lat = minLat;
-   while ( (lat <= maxLat) &&(cells.size() < limitNumberOfCells))
-   {
-      gpt.lat = lat;
-
-      // Longitude loop:
-      ossim_float64 lon = minLon;
-      while ( (lon <= maxLon ) &&(cells.size()< limitNumberOfCells))
-      {
-         gpt.lon = lon;
-
-         ossimRefPtr<ossimElevCellHandler> h = getOrCreateCellHandler( gpt );
-         if ( h.valid() )
-         {
-            // Get the file name:
-            f = h->getFilename().string();
-            
-            if ( f.size() )
-            {
-               // See if it's already in the list, i.e. duplicate:
-               std::vector<std::string>::const_iterator i = cells.begin();
-               while ( i != cells.end() )
-               {
-                  if ( f == (*i) )
-                  {
-                     break;
-                  }
-                  ++i;
-               }
-               
-               if ( i == cells.end() )
-               {
-                  // Add it to the list:
-                  cells.push_back( f );
-               }
-            }
-         }
-
-         if ( lon < maxLon )
-         {
-            lon = ossim::min<ossim_float64>( (lon+SEARCH_SPACING), maxLon );
-         }
-         else
-         {
-            break;
-         }
-         
-      } // Matches: while ( lon <= maxLon )
-
-      if ( lat < maxLat )
-      {
-         lat = ossim::min<ossim_float64>( (lat+SEARCH_SPACING), maxLat );
-      }
-      else
-      {
-         break;
-      }
-      
-   } // Matches: while ( lat <= maxLat )
-   
-} // End: ossimElevationCellDatabase::getCellsForBounds( ... )
-
-ossimRefPtr<ossimElevCellHandler> ossimElevationCellDatabase::getOrCreateCellHandler(const ossimGpt& gpt)
-{
-  ossimRefPtr<ossimElevCellHandler> result = 0;
-  ossim_uint64 id = createId(gpt);
-  
-  {
-    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex);
-    CellMap::iterator iter = m_cacheMap.find(id);
-    if(iter != m_cacheMap.end())
-    {
-      iter->second->updateTimestamp();
-      result = iter->second->m_handler.get();
-      
-      return result.get();
-    }
-  }
-  
-  result = createCell(gpt);
-  
-  {
-    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex);
-    if(result.valid())
-    {
-      m_cacheMap.insert(std::make_pair(id, new CellInfo(id, result.get())));
-
-      // Check the map size and purge cells if needed.
-      if(m_cacheMap.size() > m_maxOpenCells)
-      {
-         flushCacheToMinOpenCells();
-      }
-    }
-  }
-
-  return result;
-}
-
-bool ossimElevationCellDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   ossimString minOpenCells = kwl.find(prefix, "min_open_cells");
-   ossimString maxOpenCells = kwl.find(prefix, "max_open_cells");
-   if(!minOpenCells.empty()&&
-      !maxOpenCells.empty())
-   {
-      m_minOpenCells = minOpenCells.toUInt32();
-      m_maxOpenCells = maxOpenCells.toUInt32();
-      if(m_maxOpenCells < m_minOpenCells)
-      {
-         std::swap(m_minOpenCells, m_maxOpenCells);
-      }
-   }
-   ossimString memoryMapCellsFlag = kwl.find(prefix, "memory_map_cells");
-   if(!memoryMapCellsFlag.empty())
-   {
-      m_memoryMapCellsFlag = memoryMapCellsFlag.toBool();
-   }
-   return ossimElevationDatabase::loadState(kwl, prefix);
-}
-
-bool ossimElevationCellDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   kwl.add(prefix, "memory_map_cells", m_memoryMapCellsFlag, true);
-   kwl.add(prefix, "min_open_cells", m_minOpenCells, true);
-   kwl.add(prefix, "max_open_cells", m_maxOpenCells, true);
-
-   if(m_geoid.valid())
-   {
-      kwl.add(prefix, "geoid.type", m_geoid->getShortName(), true);
-   }
-
-   return ossimElevationDatabase::saveState(kwl, prefix);
-}
-
-std::ostream& ossimElevationCellDatabase::print(ostream& out) const
-{
-   ossimKeywordlist kwl;
-   saveState(kwl);
-   out << "\nossimElevationCellDatabase @ "<< (ossim_uint64) this << kwl << ends;
-   return out;
-}
-
-
diff --git a/ossim/src/ossim/elevation/ossimElevationDatabase.cpp b/ossim/src/ossim/elevation/ossimElevationDatabase.cpp
deleted file mode 100644
index 303a9b3..0000000
--- a/ossim/src/ossim/elevation/ossimElevationDatabase.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <ossim/elevation/ossimElevationDatabase.h>
-
-RTTI_DEF1(ossimElevationDatabase, "ossimElevationDatabase", ossimObject);
-
-double ossimElevationDatabase::getOffsetFromEllipsoid(const ossimGpt& gpt)
-{
-   double result = 0.0;
-   if(m_geoid.valid())
-   {
-      result = m_geoid->offsetFromEllipsoid(gpt);
-   }
-   else 
-   {
-      result = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
-   }
-   
-   if(ossim::isnan(result))
-   {
-      result = 0.0;
-   }
-   
-   return result;
-}
-
-bool ossimElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   m_connectionString = kwl.find(prefix, "connection_string");
-   ossimString geoidType = kwl.find(prefix, "geoid.type");
-   if(m_connectionString.empty())
-   {
-      // try backward compatability to a filename
-      //
-      m_connectionString = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   }
-   if(!geoidType.empty())
-   {
-      m_geoid = ossimGeoidManager::instance()->findGeoidByShortName(geoidType);
-   }
-   return ossimSource::loadState(kwl, prefix);
-}
-
-bool ossimElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   kwl.add(prefix, "connection_string", m_connectionString, true);
-   
-   if(m_geoid.valid())
-   {
-      kwl.add(prefix, "geoid.type", m_geoid->getShortName(), true);
-   }
-   
-   return ossimSource::saveState(kwl, prefix);
-}
-
-std::ostream& ossimElevationDatabase::print(ostream& out) const
-{
-   ossimKeywordlist kwl;
-   saveState(kwl);
-   out << "\nossimElevationDatabase @ "<< (ossim_uint64) this
-         << kwl <<ends;
-   return out;
-}
diff --git a/ossim/src/ossim/elevation/ossimElevationDatabaseFactory.cpp b/ossim/src/ossim/elevation/ossimElevationDatabaseFactory.cpp
deleted file mode 100644
index 52b7800..0000000
--- a/ossim/src/ossim/elevation/ossimElevationDatabaseFactory.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-#include <ossim/elevation/ossimElevationDatabaseFactory.h>
-#include <ossim/elevation/ossimElevationDatabase.h>
-#include <ossim/elevation/ossimDtedElevationDatabase.h>
-#include <ossim/elevation/ossimSrtmElevationDatabase.h>
-#include <ossim/elevation/ossimGeneralRasterElevationDatabase.h>
-#include <ossim/elevation/ossimImageElevationDatabase.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-ossimElevationDatabaseFactory* ossimElevationDatabaseFactory::m_instance = 0;
-ossimElevationDatabaseFactory* ossimElevationDatabaseFactory::instance()
-{
-   if(!m_instance)
-   {
-      m_instance = new ossimElevationDatabaseFactory();
-   }
-   
-   return m_instance;
-}
-
-ossimElevationDatabase* ossimElevationDatabaseFactory::createDatabase(const ossimString& typeName)const
-{
-   if((typeName == STATIC_TYPE_NAME(ossimDtedElevationDatabase)) ||
-      (typeName == "dted")||
-      (typeName == "dted_directory"))
-      
-   {
-      return new ossimDtedElevationDatabase();
-   }
-   else if((typeName == STATIC_TYPE_NAME(ossimSrtmElevationDatabase)) ||
-           (typeName == "srtm")||
-           (typeName == "srtm_directory"))
-      
-   {
-      return new ossimSrtmElevationDatabase();
-   }
-   else if((typeName == STATIC_TYPE_NAME(ossimGeneralRasterElevationDatabase)) ||
-           (typeName == "general_raster")||
-           (typeName == "general_raster_directory"))
-      
-   {
-      return new ossimGeneralRasterElevationDatabase();
-   }
-   else if( (typeName == "ossimImageElevationDatabase") ||
-            (typeName == "image_directory"))
-      
-   {
-      return new ossimImageElevationDatabase();
-   }
-   
-   return 0;
-}
-
-ossimElevationDatabase* ossimElevationDatabaseFactory::createDatabase(const ossimKeywordlist& kwl,
-                                                                      const char* prefix)const
-{
-   ossimRefPtr<ossimElevationDatabase> result = 0;
-   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   if(!type.empty())
-   {
-      result = createDatabase(type);
-      if(result.valid())
-      {
-         if(!result->loadState(kwl, prefix))
-         {
-            result = 0;
-         }
-      }
-   }
-   
-   return result.release();
-}
-
-ossimElevationDatabase* ossimElevationDatabaseFactory::open(const ossimString& connectionString)const
-{
-   ossimRefPtr<ossimElevationDatabase> result = new ossimDtedElevationDatabase();
-   if(!result->open(connectionString))
-   {
-      result = new ossimSrtmElevationDatabase;
-      if(!result->open(connectionString))
-      {
-         result = new ossimGeneralRasterElevationDatabase;
-         if(!result->open(connectionString))
-         {
-            result = 0;
-         }
-         
-#if 0         
-         //---
-         // Commented out as the ossimImageElevationDatabase can load any type and the
-         // elevation manager is passing in elevation. This stops it opening your entire
-         // elevation directory if you happen to start you application where there is an
-         // elevation directory in there. Note you can still explicitly declare a
-         // "image_directory in your preferences.  drb - 20110509
-         //---
-         if(!result->open(connectionString))
-         {
-            result = new ossimImageElevationDatabase;
-            if(!result->open(connectionString))
-            {
-               result = 0;
-            }
-         }
-#endif
-      }
-   }
-   return result.release();
-}
-
-void ossimElevationDatabaseFactory::getTypeNameList(std::vector<ossimString>& typeList)const
-{
-   typeList.push_back(STATIC_TYPE_NAME(ossimDtedElevationDatabase));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSrtmElevationDatabase));
-   typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterElevationDatabase));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageElevationDatabase));
-}
diff --git a/ossim/src/ossim/elevation/ossimImageElevationDatabase.cpp b/ossim/src/ossim/elevation/ossimImageElevationDatabase.cpp
deleted file mode 100644
index c201c7b..0000000
--- a/ossim/src/ossim/elevation/ossimImageElevationDatabase.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimImageElevationDatabase.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  See class desciption in header file.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/elevation/ossimImageElevationDatabase.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/elevation/ossimImageElevationHandler.h>
-#include <ossim/util/ossimFileWalker.h>
-#include <cmath>
-
-static ossimTrace traceDebug(ossimString("ossimImageElevationDatabase:debug"));
-
-RTTI_DEF1(ossimImageElevationDatabase, "ossimImageElevationDatabase", ossimElevationCellDatabase);
-
-ossimImageElevationDatabase::ossimImageElevationDatabase()
-   :
-   ossimElevationCellDatabase(),
-   ossimFileProcessorInterface(),
-   m_entryMap(),
-   m_lastMapKey(0),
-   m_lastAccessedId(0)
-{
-}
-
-// Protected destructor as this is derived from ossimRefenced.
-ossimImageElevationDatabase::~ossimImageElevationDatabase()
-{
-}
-
-bool ossimImageElevationDatabase::open(const ossimString& connectionString)
-{
-   // return false; // tmp drb...
-   
-   static const char M[] = "ossimImageElevationDatabase::open";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n"
-         << "\nConnection string: " << connectionString << "\n";
-   }                   
-   
-   bool result = false;
-
-   close();
-
-   if ( connectionString.size() )
-   {
-      m_connectionString = connectionString.c_str();
-
-      loadFileMap();
-
-      if ( m_entryMap.size() )
-      {
-         result = true;
-      }
-      else
-      {
-         m_connectionString.clear();
-      }
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
-   }
-
-   return result;
-}
-
-void ossimImageElevationDatabase::close()
-{
-   m_meanSpacing = 0.0;
-   m_geoid = 0;
-   m_connectionString.clear();
-}
-
-double ossimImageElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
-{
-   double h = ossim::nan();
-   if(isSourceEnabled())
-   {
-      ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt);
-      if(handler.valid())
-      {
-         h = handler->getHeightAboveMSL(gpt); // still need to shift
-      }
-   }
-
-   return h;
-}
-
-double ossimImageElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
-{
-   double h = getHeightAboveMSL(gpt);
-   if(!ossim::isnan(h))
-   {
-      h += getOffsetFromEllipsoid(gpt);
-   }
-   return h;
-}
-
-ossimRefPtr<ossimElevCellHandler> ossimImageElevationDatabase::createCell(
-   const ossimGpt& gpt)
-{
-   ossimRefPtr<ossimElevCellHandler> result = 0;
-   
-   std::map<ossim_uint64, ossimImageElevationFileEntry>::iterator i = m_entryMap.begin();
-   while ( i != m_entryMap.end() )
-   {
-      if ( (*i).second.m_loadedFlag == false )
-      {
-         // not loaded
-         ossimRefPtr<ossimImageElevationHandler> h = new ossimImageElevationHandler();
-
-         if ( (*i).second.m_rect.isLonLatNan() )
-         {
-            if ( h->open( (*i).second.m_file ) )
-            {
-               // First time opened.  Capture the rectangle. for next time.
-               (*i).second.m_rect = h->getBoundingGndRect();
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimImageElevationDatabase::createCell WARN:\nCould not open: "
-                  << (*i).second.m_file << "\nRemoving file from map!" << std::endl;
-
-               // Get a copy of the iterator to delet.
-               std::map<ossim_uint64, ossimImageElevationFileEntry>::iterator badIter = i;
-               
-               ++i; // Go to next image.
-
-               // Must put lock around erase.
-               m_cacheMapMutex.lock();
-               m_entryMap.erase(badIter);
-               m_cacheMapMutex.unlock();
-               
-               continue; // Skip the rest of this loop.
-            }
-         }
-
-         // Check the North up bounding rectangle for intersect.
-         if ( (*i).second.m_rect.pointWithin(gpt) )
-         {
-            if ( h->isOpen() == false )
-            {
-               h->open( (*i).second.m_file );
-            }
-
-            if ( h->isOpen() )
-            {
-               //---
-               // Check point coverage again as image may not be geographic and pointHasCoverage
-               // has a check on worldToLocal point.
-               //---
-               if (  h->pointHasCoverage(gpt) )
-               {
-                  m_lastAccessedId = (*i).first;
-                  (*i).second.m_loadedFlag = true;
-                  result = h.get();
-                  break;
-               }
-               else
-               {
-                  h = 0;
-               }
-            }
-         }
-         else
-         {
-            h = 0;
-         }
-      }
-
-      ++i;
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimElevCellHandler> ossimImageElevationDatabase::getOrCreateCellHandler(
-   const ossimGpt& gpt)
-{
-   ossimRefPtr<ossimElevCellHandler> result = 0;
-   
-   // Note: Must do mutex lock / unlock around any cach map access.
-   m_cacheMapMutex.lock();
-
-   if ( m_cacheMap.size() )
-   {
-      //---
-      // Look in existing map for handler.
-      //
-      // Note: Cannot key off of id from gpt as cells can be any arbituary dimensions.
-      //---
-
-      CellMap::iterator lastAccessedCellIter = m_cacheMap.find(m_lastAccessedId);
-      CellMap::iterator iter = lastAccessedCellIter;
-        
-      // Check from last accessed to end.
-      while ( iter != m_cacheMap.end() )
-      {
-         if ( iter->second->m_handler->pointHasCoverage(gpt) )
-         {
-            result = iter->second->m_handler.get();
-            break;
-         }
-         ++iter;
-      }
-     
-      if ( result.valid() == false )
-      {
-         iter = m_cacheMap.begin();
-              
-         // Beginning to last accessed.
-         while ( iter != lastAccessedCellIter)
-         {
-            if ( iter->second->m_handler->pointHasCoverage(gpt) )
-            {
-               result = iter->second->m_handler.get();
-               break;
-            }
-            ++iter;
-         }
-      }
-
-      if ( result.valid() )
-      {
-         m_lastAccessedId  = iter->second->m_id;
-         iter->second->updateTimestamp();
-      }
-   }
-   m_cacheMapMutex.unlock();
-  
-   if ( result.valid() == false )
-   {
-      // Not in m_cacheMap.  Create a new cell for point if we have coverage.
-      result = createCell(gpt);
-
-      if(result.valid())
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex);
-
-         //---
-         // Add the cell to map.
-         // NOTE: ossimImageElevationDatabase::createCell sets m_lastAccessedId to that of
-         // the entries map key.
-         //---
-         m_cacheMap.insert(std::make_pair(m_lastAccessedId,
-                                          new CellInfo(m_lastAccessedId, result.get())));
-
-         ++m_lastMapKey;
-
-         // Check the map size and purge cells if needed.
-         if(m_cacheMap.size() > m_maxOpenCells)
-         {
-            flushCacheToMinOpenCells();
-         }
-      }
-   }
-
-   return result;
-}
-
-bool ossimImageElevationDatabase::pointHasCoverage(const ossimGpt& gpt) const
-{
-   //---
-   // NOTE:
-   //
-   // The bounding rect is the North up rectangle.  So if the underlying image projection is not
-   // a geographic projection and there is a rotation this could return false positives.  Inside
-   // the ossimImageElevationDatabase::createCell there is a call to
-   // ossimImageElevationHandler::pointHasCoverage which does a real check from the
-   // ossimImageGeometry of the image.
-   //---
-   bool result = false;
-   std::map<ossim_uint64, ossimImageElevationFileEntry>::const_iterator i = m_entryMap.begin();
-   while ( i != m_entryMap.end() )
-   {
-      if ( (*i).second.m_rect.pointWithin(gpt) )
-      {
-         result = true;
-         break;
-      }
-      ++i;
-   }
-   return result;
-}
-
-
-void ossimImageElevationDatabase::getBoundingRect(ossimGrect& rect) const
-{
-   // The bounding rect is the North up rectangle.  So if the underlying image projection is not
-   // a geographic projection and there is a rotation this will include null coverage area.
-   rect.makeNan();
-   std::map<ossim_uint64, ossimImageElevationFileEntry>::const_iterator i = m_entryMap.begin();
-   ossimGrect subRect;
-   while ( i != m_entryMap.end() )
-   {
-      subRect = i->second.m_rect;
-      if (subRect.isLonLatNan())
-      {
-         // The DEM source was not yet initialized:
-         ossimRefPtr<ossimImageElevationHandler> h = new ossimImageElevationHandler();
-         if ( h->open( i->second.m_file ) )
-            subRect = h->getBoundingGndRect();
-         else
-         {
-            ++i;
-            continue;
-         }
-      }
-      if (rect.isLonLatNan())
-         rect = subRect;
-      else
-         rect = rect.combine(subRect);
-      ++i;
-   }
-}
-
-
-bool ossimImageElevationDatabase::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
-{
-   if(pointHasCoverage(gpt))
-   {
-     info.m_surfaceName = "Image Elevation";
-   }
-
-   return false;
-}
-
-bool ossimImageElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   static const char M[] = "ossimImageElevationDatabase::loadState";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered..." << "\nkwl:\n" << kwl << "\n";
-   }     
-   bool result = false;
-   const char* lookup = kwl.find(prefix, "type");
-   if ( lookup )
-   {
-      std::string type = lookup;
-      if ( ( type == "image_directory" ) || ( type == "ossimImageElevationDatabase" ) )
-      {
-         result = ossimElevationCellDatabase::loadState(kwl, prefix);
-
-         if ( result )
-         {
-            loadFileMap();
-         }
-      }
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
-   }
-
-   return result;
-}
-
-bool ossimImageElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimElevationCellDatabase::saveState(kwl, prefix);
-}
-
-void ossimImageElevationDatabase::processFile(const ossimFilename& file)
-{
-   static const char M[] = "ossimImageElevationDatabase::processFile";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "file: " << file << "\n";
-   }
-
-   // Add the file.
-   m_entryMap.insert( std::make_pair(m_lastMapKey++, ossimImageElevationFileEntry(file)) );
-
-   if(traceDebug())
-   {
-      // Since ossimFileWalker is threaded output the file so we know which job exited.
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
-   } 
-}
-
-void ossimImageElevationDatabase::loadFileMap()
-{
-   if ( m_connectionString.size() )
-   {
-      // Create a file walker which will find files we can load from the connection string.
-      ossimFileWalker* fw = new ossimFileWalker();
-      
-      fw->initializeDefaultFilterList();
-
-      // This links the file walker back to our "processFile" method.
-      fw->setFileProcessor( this );
-      
-      ossimFilename f = m_connectionString;
-
-      // ossimFileWalker::walk will in turn call back to processFile method for each file it finds.
-      fw->walk(f); 
-      
-      delete fw;
-      fw = 0;
-   }
-}
-
-// Hidden from use:
-ossimImageElevationDatabase::ossimImageElevationDatabase(const ossimImageElevationDatabase& copy)
-: ossimElevationCellDatabase(copy)
-{
-   m_entryMap = copy.m_entryMap;
-   m_lastMapKey = copy.m_lastMapKey;
-   m_lastAccessedId = copy.m_lastAccessedId;
-}
-
-// Private container class:
-ossimImageElevationDatabase::ossimImageElevationFileEntry::ossimImageElevationFileEntry()
-   : m_file(),
-     m_rect(),
-     m_loadedFlag(false)
-{
-   m_rect.makeNan();
-}
-
-// Private container class:
-ossimImageElevationDatabase::ossimImageElevationFileEntry::ossimImageElevationFileEntry(
-   const ossimFilename& file)
-   : m_file(file),
-     m_rect(),
-     m_loadedFlag(false)
-{
-   m_rect.makeNan();
-}
-
-ossimImageElevationDatabase::ossimImageElevationFileEntry::ossimImageElevationFileEntry
-(const ossimImageElevationFileEntry& copy_this)
-   : m_file(copy_this.m_file),
-     m_rect(copy_this.m_rect),
-     m_loadedFlag(copy_this.m_loadedFlag)
-{
-}
-
-std::ostream& ossimImageElevationDatabase::print(ostream& out) const
-{
-   ossimKeywordlist kwl;
-   saveState(kwl);
-   out << "\nossimImageElevationDatabase @ "<< (ossim_uint64) this << "\n"
-         << kwl <<ends;
-   return out;
-}
-
-
diff --git a/ossim/src/ossim/elevation/ossimImageElevationHandler.cpp b/ossim/src/ossim/elevation/ossimImageElevationHandler.cpp
deleted file mode 100644
index ddee794..0000000
--- a/ossim/src/ossim/elevation/ossimImageElevationHandler.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimImageElevationHandler.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  See class desciption in header file.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/elevation/ossimImageElevationHandler.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-
-#include <iostream> // tmp drb
-using namespace std;
-
-#include <cmath>
-
-RTTI_DEF1(ossimImageElevationHandler, "ossimImageElevationHandler" , ossimElevCellHandler)
-
-// Define Trace flags for use within this file:
-static ossimTrace traceDebug ("ossimImageElevationHandler:debug");
-
-ossimImageElevationHandler::ossimImageElevationHandler()
-   :
-   ossimElevCellHandler(),
-   m_ih(0),
-   m_geom(0),
-   m_rect(),
-   m_mutex()
-{
-}
-
-ossimImageElevationHandler::ossimImageElevationHandler(const ossimFilename& file)
-   :
-   ossimElevCellHandler(),
-   m_ih(0),
-   m_geom(0),
-   m_rect(),
-   m_mutex()
-{
-   open(file);
-}
-
-bool ossimImageElevationHandler::open(const ossimFilename& file)
-{
-   static const char M[] = "ossimImageElevationHandler::open";
-   
-   bool result = false;
-
-   if ( isOpen() ) close();
-   
-   if ( file.size() )
-   {
-      //---
-      // NOTE: The false passed to open is flag to NOT open overviews. If code is ever changed
-      // to go between reduced resolution levels this should be changed.
-      //---
-      m_ih = ossimImageHandlerRegistry::instance()->open(file, true, false);
-      if ( m_ih.valid() )
-      {
-         m_geom = m_ih->getImageGeometry();
-         if ( m_geom.valid() )
-         {
-            result = true;
-
-            //---
-            // Image rect stored as a drect for ossimImageElevationHandler::pointHasCoverage
-            // method.
-            //---
-            m_rect = ossimDrect(0.0, 0.0,
-                                m_ih->getNumberOfSamples()-1, m_ih->getNumberOfLines()-1);
-
-            // Initialize base class stuff.
-            theFilename = file;
-
-            theMeanSpacing = (m_geom->getMetersPerPixel().x + m_geom->getMetersPerPixel().y) / 2.0;
-
-            // Set the ossimElevSource::theGroundRect
-            std::vector<ossimGpt> corner(4);
-            if ( m_geom->getCornerGpts(corner[0], corner[1], corner[2], corner[3]) )
-            {
-               ossimGpt ulGpt(corner[0]);
-               ossimGpt lrGpt(corner[0]);
-               for ( ossim_uint32 i = 1; i < 4; ++i )
-               {
-                  if ( corner[i].lon < ulGpt.lon ) ulGpt.lon = corner[i].lon;
-                  if ( corner[i].lat > ulGpt.lat ) ulGpt.lat = corner[i].lat;
-                  if ( corner[i].lon > lrGpt.lon ) lrGpt.lon = corner[i].lon;
-                  if ( corner[i].lat < lrGpt.lat ) lrGpt.lat = corner[i].lat;
-               }
-               theGroundRect = ossimGrect(ulGpt, lrGpt);
-            }
-            else
-            {
-               theGroundRect.makeNan();
-            }
-         }
-         // theAbsLE90 ???
-         // theAbsCE90 ???
-      }
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " DEBUG:"
-         << "\nmean spacing(meters): " << theMeanSpacing
-         << "\nunding rect: " << theGroundRect
-         << "\nreturn status: " << (result?"true\n":"false\n");
-   }
-         
-   return result;
-}
-
-
-ossimImageElevationHandler::~ossimImageElevationHandler()
-{
-   close();
-}
-
-double ossimImageElevationHandler::getHeightAboveMSL(const ossimGpt& gpt)
-{
-   double height = ossim::nan();
-
-   // Get the image point for the world point.
-   ossimDpt dpt;
-   m_geom->worldToLocal(gpt, dpt);
-
-   if ( m_rect.pointWithin(dpt) )
-   {
-      // Cast it to an int which will shift to nearest upper left post.
-      ossim_int32 x0 = static_cast<ossim_int32>(dpt.x);
-      ossim_int32 y0 = static_cast<ossim_int32>(dpt.y);
-      
-      // Right edge check.
-      if(x0 == static_cast<ossim_int32>(m_rect.lr().x))
-      {
-         --x0;
-      }
-      
-      // Bottom edge check.
-      if(y0 == static_cast<ossim_int32>(m_rect.lr().y))
-      {
-         --y0;
-      }
-
-      m_mutex.lock(); // Call to getTile not thread safe.
-      ossimRefPtr<ossimImageData> data = m_ih->getTile( ossimIrect(x0, y0, x0+1, y0+1), 0 );
-      if ( data.valid() )
-      {
-         ossimIrect dataRect = data->getImageRectangle();
-
-         double p00 = data->getPix( ossimIpt(x0,   y0)   );
-         double p01 = data->getPix( ossimIpt(x0+1, y0)   );
-         double p10 = data->getPix( ossimIpt(x0,   y0+1) );
-         double p11 = data->getPix( ossimIpt(x0+1, y0+1) );
-         
-         double xt0 = dpt.x - x0;
-         double yt0 = dpt.y - y0;
-         double xt1 = 1-xt0;
-         double yt1 = 1-yt0;
-         
-         double w00 = xt1*yt1;
-         double w01 = xt0*yt1;
-         double w10 = xt1*yt0;
-         double w11 = xt0*yt0;
-         
-         // Test for null posts and set the corresponding weights to 0:
-         const double NP = data->getNullPix(0);
-         
-         if (p00 == NP)
-            w00 = 0.0;
-         if (p01 == NP)
-            w01 = 0.0;
-         if (p10 == NP)
-            w10 = 0.0;
-         if (p11 == NP)
-            w11 = 0.0;
-         
-#if 0 /* Serious debug only... */
-         cout << "\np00:  " << p00
-              << "\np01:  " << p01
-              << "\np10:  " << p10
-              << "\np11:  " << p11
-              << "\nw00:  " << w00
-              << "\nw01:  " << w01
-              << "\nw10:  " << w10
-              << "\nw11:  " << w11
-              << endl;
-#endif
-         
-         double sum_weights = w00 + w01 + w10 + w11;
-         
-         if (sum_weights)
-            height = (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
-
-      } // if ( data.valid() )
-
-      m_mutex.unlock();
-      
-   } // if ( m_rect.pointWithin(dpt) )
-
-   return height;
-}
-
-ossimIpt ossimImageElevationHandler::getSizeOfElevCell() const
-{
-   ossimIpt sz(0,0);
-   if ( m_ih.valid() )
-   {
-      sz.x = static_cast<ossim_int32>(m_ih->getNumberOfSamples(0));
-      sz.y = static_cast<ossim_int32>(m_ih->getNumberOfLines(0));
-   }
-   return sz;
-}
-
-double ossimImageElevationHandler::getPostValue(const ossimIpt& gridPt ) const
-{
-   double height = ossim::nan();
-   if ( m_rect.pointWithin(ossimDpt(gridPt)) )
-   {
-      ossimRefPtr<ossimImageHandler> ih = const_cast<ossimImageHandler*>(m_ih.get());
-      
-      m_mutex.lock(); // Call to getTile(...) not thread safe.
-      ossimRefPtr<ossimImageData> data =
-         ih->getTile( ossimIrect(gridPt.x, gridPt.y, gridPt.x+1, gridPt.y+1), 0 );
-      if ( data.valid() )
-      {
-         height = data->getPix(0, 0);
-         if (height == data->getNullPix(0))
-            height = ossim::nan();
-      }
-      m_mutex.unlock();
-   }
-   return height;
-}
-
-ossimImageElevationHandler::ossimImageElevationHandler(const ossimImageElevationHandler& copy)
-{
-   *this = copy;
-}
-
-const ossimImageElevationHandler&
-ossimImageElevationHandler::operator=(const ossimImageElevationHandler& rhs)
-{
-   open(rhs.theFilename);
-   return *this;
-}
-
diff --git a/ossim/src/ossim/elevation/ossimSrtmElevationDatabase.cpp b/ossim/src/ossim/elevation/ossimSrtmElevationDatabase.cpp
deleted file mode 100644
index 93af011..0000000
--- a/ossim/src/ossim/elevation/ossimSrtmElevationDatabase.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/elevation/ossimSrtmElevationDatabase.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimTrace.h>
-#include <sstream>
-#include <iomanip>
-#include <cstdlib> /* for abs(int) */
-
-static ossimTrace traceDebug("ossimSrtmElevationDatabase:debug");
-
-RTTI_DEF1(ossimSrtmElevationDatabase, "ossimSrtmElevationDatabase", ossimElevationCellDatabase);
-
-double ossimSrtmElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
-{
-   if(isSourceEnabled())
-   {
-      ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt);
-      if(handler.valid())
-      {
-         return handler->getHeightAboveMSL(gpt); // still need to shift
-      }
-   }
-   return ossim::nan();
-}
-
-double ossimSrtmElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
-{
-   double h = getHeightAboveMSL(gpt);
-   if(h != ossim::nan())
-   {
-      h += getOffsetFromEllipsoid(gpt);
-   }
-   
-   return h;
-}
-bool ossimSrtmElevationDatabase::open(const ossimString& connectionString)
-{
-   bool result = false;
-   ossimFilename file = ossimFilename(connectionString);
-   m_connectionString = connectionString;
-   result = openSrtmDirectory(file);
-   
-   return result;
-}
-
-bool ossimSrtmElevationDatabase::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
-{
-   bool result = false;
-   info.makeNan();
-
-   if(pointHasCoverage(gpt))
-   {
-      result = true;
-      if(m_meanSpacing > 100.0)
-      {
-         // 30 arc second
-         info.m_absoluteCE  = 20.0;
-         info.m_absoluteLE = 16.0;
-         info.m_surfaceName = "SRTM30";
-
-      }
-      else if (m_meanSpacing > 40.0)
-      {
-        // SRTM 3 arc
-         info.m_absoluteCE  = 20.0;
-         info.m_absoluteLE = 16.0;
-         info.m_surfaceName = "SRTM3";
-      }
-      else
-      {
-          // SRTM 1 arc
-         info.m_absoluteCE = 20.0;
-         info.m_absoluteLE = 10.0;
-         info.m_surfaceName = "SRTM1";
-       }
-   }
-
-   return result;
-}
-
-bool ossimSrtmElevationDatabase::openSrtmDirectory(const ossimFilename& dir)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Entered....\n";
-   }
-   if(!m_geoid.valid())
-   {
-      m_geoid = ossimGeoidManager::instance()->findGeoidByShortName("geoid1996", false);
-   }
-   
-   //---
-   // Sample format:
-   //            dir
-   //         |          |
-   //    N35W121.hgt N35W121.hgt
-   //---
-   ossim_uint32 count = 0;
-   ossim_uint32 maxCount = 25;
-   if (!dir.isDir())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Not a directory, leaving ... " << dir << "\n";
-      }
-      return false;
-   }
-   
-   ossimDirectory od(dir);
-   if (od.isOpened() == false)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Unable to open directory " << dir << ", Leaving ... \n";
-      }
-      return false;
-   }
-   
-   ossimFilename f;
-   //ossimSrtmSupportData sd;
-   ossimRefPtr<ossimSrtmHandler> handler = new ossimSrtmHandler;
-   if(od.getFirst(f, ossimDirectory::OSSIM_DIR_FILES))
-   {
-      do
-      {
-         ++count;
-         if(handler->open(f))
-         {
-            m_meanSpacing = handler->getMeanSpacingMeters();
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Found file " << f << "\n";
-               if(!m_geoid.valid())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Unable to load goeid grid 1996 for SRTM database\n";
-               }
-            }
-            return true;
-         }
-      }while((od.getNext(f)) &&(count < maxCount));
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Leaving ... \n";
-   }
-   return false;
-}
-
-void ossimSrtmElevationDatabase::createRelativePath(ossimFilename& file, const ossimGpt& gpt)const
-{
-   int ilat =  static_cast<int>(floor(gpt.latd()));
-   if (ilat < 0)
-   {
-      file = "S";
-   }
-   else
-   {
-      file = "N";
-   }
-   
-   ilat = abs(ilat);
-   std::ostringstream  os1;
-   
-   os1 << std::setfill('0') << std::setw(2) <<ilat;
-   
-   file += os1.str().c_str();
-   
-   int ilon = static_cast<int>(floor(gpt.lond()));
-   
-   if (ilon < 0)
-   {
-      file += "W";
-   }
-   else
-   {
-      file += "E";
-   }
-   
-   ilon = abs(ilon);
-   std::ostringstream  os2;
-   os2 << std::setfill('0') << std::setw(3) << ilon;
-   
-   file += os2.str().c_str();
-   file.setExtension("hgt");
-}
-
-bool ossimSrtmElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix )
-{
-   bool result = ossimElevationCellDatabase::loadState(kwl, prefix);
-   if(result)
-   {
-      if(!m_connectionString.empty()&&ossimFilename(m_connectionString).exists())
-      {
-         result = open(m_connectionString);
-      }
-      else
-      {
-         // can't open the connection because it does not exists or empty
-         result = false;
-      }
-   }
-   
-   return result;
-}
-
-bool ossimSrtmElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   bool result = ossimElevationCellDatabase::saveState(kwl, prefix);
-   
-   return result;
-}
-
-ossimRefPtr<ossimElevCellHandler>
-ossimSrtmElevationDatabase::createCell(const ossimGpt& gpt)
-{
-
-  ossimRefPtr<ossimElevCellHandler> result = 0;
-  ossimFilename f;
-  createFullPath(f, gpt);
-
-  if(f.exists())
-  {
-     ossimRefPtr<ossimSrtmHandler> h = new ossimSrtmHandler();
-     if (h->open(f, m_memoryMapCellsFlag))
-     {
-        result = h.get();
-     }
-  }
-
-  return result;
-}
-
diff --git a/ossim/src/ossim/elevation/ossimSrtmFactory.cpp b/ossim/src/ossim/elevation/ossimSrtmFactory.cpp
deleted file mode 100644
index c56d2b1..0000000
--- a/ossim/src/ossim/elevation/ossimSrtmFactory.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Shuttle Radar Topography Mission (SRTM) factory to return an
-// ossimSrtmElevSource given a ground point.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimSrtmFactory.cpp 16123 2009-12-17 22:07:31Z dburken $
-
-#include <cstdlib> /* abs() */
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <ossim/elevation/ossimSrtmFactory.h>
-#include <ossim/elevation/ossimSrtmHandler.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimStreamFactoryRegistry.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/support_data/ossimSrtmFilename.h>
-#include <ossim/support_data/ossimSrtmSupportData.h>
-
-static ossimTrace traceDebug ("ossimSrtmFactory:debug");
-
-RTTI_DEF1(ossimSrtmFactory, "ossimSrtmFactory", ossimElevSourceFactory)
-
-ossimSrtmFactory::ossimSrtmFactory()
-   : ossimElevSourceFactory()
-{}
-
-ossimSrtmFactory::ossimSrtmFactory(const ossimFilename& dir)
-   : ossimElevSourceFactory()
-{
-   theDirectory = dir;
-}
-      
-ossimSrtmFactory::~ossimSrtmFactory()
-{}
-
-ossimElevSource* ossimSrtmFactory::getNewElevSource(const ossimGpt& gpt) const
-{
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimSrtmFactory::getNewElevSource: Entered..."
-         << std::endl;
-   }
-
-   ossimRefPtr<ossimElevCellHandler> srtmPtr;
-
-   if (theDirectory == ossimFilename::NIL)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "ossimSrtmFactory::getNewElevSource: "
-         << "SRTM directory has not been set!"
-         << "\nReturning null elevation source..."
-         << std::endl;
-      
-      return srtmPtr.release();
-   }
-
-   //---
-   // Build up a srtm file name.
-   //
-   // Standard for name is upper case 'N' and 'W' lower case "hgt" like:
-   // N27W081.hgt
-   //---
-   ossimFilename srtmFileBasename;
-
-   int ilat =  static_cast<int>(floor(gpt.latd()));
-   if (ilat < 0)
-   {
-      srtmFileBasename = "S";
-   }
-   else
-   {
-      srtmFileBasename = "N";
-   }
-
-   ilat = abs(ilat);
-   std::ostringstream  os1;
-   
-   os1 << std::setfill('0') << std::setw(2) <<ilat;
-   
-   srtmFileBasename += os1.str().c_str();
-
-   int ilon = static_cast<int>(floor(gpt.lond()));
-   
-   if (ilon < 0)
-   {
-      srtmFileBasename += "W";
-   }
-   else
-   {
-      srtmFileBasename += "E";
-   }
-
-   ilon = abs(ilon);
-   std::ostringstream  os2;
-   os2 << std::setfill('0') << std::setw(3) << ilon;
-   
-   srtmFileBasename += os2.str().c_str();
-   srtmFileBasename.setExtension(".hgt");
-
-   ossimFilename srtmFile = theDirectory.dirCat(srtmFileBasename);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimSrtmFactory::getNewElevSource:"
-         << "\nSearching for file:  " << srtmFile
-         << std::endl;
-   }
-
-   ossimRefPtr<ossimIFStream> is = ossimStreamFactoryRegistry::instance()->
-      createNewIFStream(srtmFile, std::ios::in | std::ios::binary);
-
-   // Look for the file mix case, then all lower case, then all upper case.
-   if (is.valid())
-   {
-      if(is->fail())
-      {
-         // Try down casing the whole thing.
-         srtmFileBasename = srtmFileBasename.downcase();
-         srtmFile = theDirectory.dirCat(srtmFileBasename);
-         
-         is =  ossimStreamFactoryRegistry::instance()->
-            createNewIFStream(srtmFile, std::ios::in | std::ios::binary);      
-         if (is.valid())
-         {
-            if(is->fail())
-            {
-               // OK, try upcasing the whole thing.
-               srtmFileBasename = srtmFileBasename.upcase();
-               srtmFile = theDirectory.dirCat(srtmFileBasename);
-               is =  ossimStreamFactoryRegistry::instance()->
-                  createNewIFStream(srtmFile, std::ios::in | std::ios::binary);
-            }
-         }
-      }
-   }
-
-   if ( is.valid() && (!is->fail()) )
-   {
-      is->close();
-      is = 0;
-      srtmPtr = new ossimSrtmHandler();
-      if(srtmPtr->open(srtmFile)&&srtmPtr->pointHasCoverage(gpt) )
-      {
-         return srtmPtr.release();
-      }
-      else
-      {
-         srtmPtr = 0;
-      }
-   }
-   return srtmPtr.release();
-}
diff --git a/ossim/src/ossim/elevation/ossimTiledElevationDatabase.cpp b/ossim/src/ossim/elevation/ossimTiledElevationDatabase.cpp
deleted file mode 100644
index c1a5e5d..0000000
--- a/ossim/src/ossim/elevation/ossimTiledElevationDatabase.cpp
+++ /dev/null
@@ -1,656 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimTiledElevationDatabase.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: See class desciption in header file.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/elevation/ossimTiledElevationDatabase.h>
-#include <ossim/base/ossimDblGrid.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimOrthoImageMosaic.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/util/ossimFileWalker.h>
-#include <cmath>
-
-static ossimTrace traceDebug(ossimString("ossimTiledElevationDatabase:debug"));
-
-RTTI_DEF1(ossimTiledElevationDatabase, "ossimTiledElevationDatabase", ossimElevationDatabase);
-
-ossimTiledElevationDatabase::ossimTiledElevationDatabase()
-   :
-   ossimElevationDatabase(),
-   ossimFileProcessorInterface(), 
-   m_entries(0),
-   m_grid(0),
-   m_referenceProj(0),
-   m_requestedRect(),
-   m_entryListRect(),
-   m_fileWalker(0)
-{
-   m_requestedRect.makeNan();
-   m_entryListRect.makeNan();
-
-   //---
-   // Use the ossimElevSource::theGroundRect to hold the mapped rect expanded to even post
-   // boundaries.
-   //---
-   theGroundRect.makeNan();
-}
-
-// Protected destructor as this is derived from ossimRefenced.
-ossimTiledElevationDatabase::~ossimTiledElevationDatabase()
-{
-   m_referenceProj = 0;   
-   m_entries.clear();
-   if ( m_grid )
-   {
-      delete m_grid;
-      m_grid = 0;
-   }
-   if ( m_fileWalker )
-   {
-      delete m_fileWalker;
-      m_fileWalker = 0;
-   }
-}
-
-bool ossimTiledElevationDatabase::open(const ossimString& connectionString)
-{
-   static const char M[] = "ossimTiledElevationDatabase::open";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n"
-         << "\nConnection string: " << connectionString << "\n";
-   }                   
-   
-   bool result = false;
-
-   close();
-
-   if ( connectionString.size() )
-   {
-      m_connectionString = connectionString.c_str();
-      result = true;
-   }
-
-   if ( m_entries.size() ) result = true;
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
-   }
-
-   return result;
-}
-
-void ossimTiledElevationDatabase::close()
-{
-   m_entryListRect.makeNan();
-   m_requestedRect.makeNan();
-   theGroundRect.makeNan();
-   m_referenceProj = 0;
-   m_entries.clear();
-   if ( m_grid )
-   {
-      delete m_grid;
-      m_grid = 0;
-   }
-   m_meanSpacing = 0.0;
-   m_geoid = 0;
-   m_connectionString.clear();
-}
-
-void ossimTiledElevationDatabase::mapRegion(const ossimGrect& region)
-{
-   static const char M[] = "ossimTiledElevationDatabase::mapRegion";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "region: " << region << "\n";
-   }
-   
-   if ( m_connectionString.size() )
-   {
-      // Wrap in try catch block as excptions can be thrown under the hood.
-      try
-      {
-         m_requestedRect = region;
-         
-         ossimFilename f = m_connectionString;
-         if ( f.exists() )
-         {
-            if ( !m_fileWalker )
-            {
-               m_fileWalker = new ossimFileWalker();
-               m_fileWalker->initializeDefaultFilterList();
-
-               m_fileWalker->setNumberOfThreads( ossim::getNumberOfThreads() );
-
-               // Must set this so we can stop recursion on directory based images.
-               m_fileWalker->setWaitOnDirFlag( true );
-
-               // This links the file walker back to our "processFile" method.
-               m_fileWalker->setFileProcessor( this );
-            }
-
-            // Walk the directory:
-            m_fileWalker->walk(f);
-
-            mapRegion();
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << M << " ERROR: Connection string does not exists: "
-               << m_connectionString.c_str()  << endl;
-         }
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Caught exception: " << e.what() << endl;
-         m_entries. clear();
-      }
-
-      // cleanup:
-      if ( m_fileWalker )
-      {
-         delete m_fileWalker;
-         m_fileWalker = 0;
-      }
-}
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-}
-
-void ossimTiledElevationDatabase::processFile(const ossimFilename& file)
-{
-   static const char M[] = "ossimTiledElevationDatabase::processFile";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "file: " << file << "\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
-   if ( sic->open(file, false) ) // False for do not open overviews.
-   {
-      if ( isDirectoryBasedImage( sic->getImageHandler() ) )
-      {
-         // Tell the walker not to recurse this directory.
-         m_fileWalker->setRecurseFlag(false);
-      }
-     
-      ossimRefPtr<ossimImageHandler> ih = sic->getImageHandler();
-      if ( ih.valid() && (m_requestedRect.isLonLatNan() == false) )
-      {
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if ( geom.valid() == false )
-         {
-            std::string errMsg = M;
-            errMsg += " ERROR:\nNo image geometry for image: ";
-            errMsg += ih->getFilename().string();
-            throw ossimException(errMsg);
-         }
-         
-         ossimRefPtr<ossimProjection> proj = geom->getProjection();
-         if ( proj.valid() == false )
-         {
-            std::string errMsg = M;
-            errMsg += " ERROR:\nNo image projection for image: ";
-            errMsg += ih->getFilename().string();
-            throw ossimException(errMsg);
-         }
-         
-         // Get the bounding rect:
-         ossimGrect boundingRect;
-         getBoundingRect(geom, boundingRect);
-         
-         if ( boundingRect.isLonLatNan() )
-         {
-            std::string errMsg = M;
-            errMsg += " ERROR:\nBounding rect has nans for image: ";
-            errMsg += ih->getFilename().string();
-            throw ossimException(errMsg); 
-         }
-         
-         if ( boundingRect.intersects(m_requestedRect) )
-         {
-            bool addEntryToList = false;
-            
-            if ( m_entries.size() == 0 ) // First time through.
-            {
-               addEntryToList = true;
-               m_entryListRect = boundingRect;
-               m_referenceProj = proj;
-               m_meanSpacing = (geom->getMetersPerPixel().x + geom->getMetersPerPixel().y) / 2.0;
-            }
-            else 
-            {
-               addEntryToList = isCompatible( ih.get(), geom.get(), proj.get() );
-               if ( addEntryToList )
-               {
-                  // Expand the rectangle.
-                  m_entryListRect.combine(boundingRect);
-               }
-            }
-            
-            if ( addEntryToList )
-            {
-               // If we're keeping it add a cache to the chain.
-               sic->addCache();
-               
-               //---
-               // Create the entry and give to addEntry which checks for duplicates in case
-               // mapRegion was called consecutively.
-               //---
-               ossimTiledElevationEntry entry(boundingRect, sic);
-               addEntry(entry);
-
-               // Once the requested rect is filled abort the file walk.
-               if ( m_requestedRect.completely_within( m_entryListRect ) )
-               {
-                  m_fileWalker->setAbortFlag(true);
-               }
-            }
-         }
-      }
-      else
-      {
-         std::string errMsg = M;
-         errMsg += " ERROR:\nNo image geometry for image: ";
-         errMsg += ih->getFilename().string();
-         throw ossimException(errMsg);
-      }
-   }
-
-   if(traceDebug())
-   {
-      // Since ossimFileWalker is threaded output the file so we know which job exited.
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
-   }   
-}
-
-void ossimTiledElevationDatabase::addEntry(const ossimTiledElevationEntry& entry)
-{
-   bool result = true;
-   std::vector<ossimTiledElevationEntry>::const_iterator i = m_entries.begin();
-   while ( i != m_entries.end() )
-   {
-      if ( (*i).m_sic->getFilename() == entry.m_sic->getFilename() )
-      {
-         result = false; // In list already.
-         break;
-      }
-      ++i;
-   }
-   if ( result )
-   {
-      m_entries.push_back(entry); // Add to list.
-   }
-}
-
-void ossimTiledElevationDatabase::initializeReferenceProjection()
-{
-   if ( m_entries.size() )
-   {
-      ossimRefPtr<ossimImageHandler> ih = m_entries[0].m_sic->getImageHandler();
-      if ( ih.valid() )
-      {
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if ( geom.valid() )
-         {
-            m_referenceProj = geom->getProjection();
-         }
-         // else throw exception ??? (drb)
-      }
-   }
-}
-
-double ossimTiledElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
-{
-   if ( m_grid )
-   {
-      return (*m_grid)(gpt.lon, gpt.lat);
-   }
-   return ossim::nan();
-}
-
-double ossimTiledElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
-{
-   double h = getHeightAboveMSL(gpt);
-   if(h != ossim::nan())
-   {
-      h += getOffsetFromEllipsoid(gpt);
-   }
-   return h;
-}
- 
-bool ossimTiledElevationDatabase::pointHasCoverage(const ossimGpt& gpt) const
-{
-   if ( theGroundRect.isLonLatNan() == false)
-   {
-      return theGroundRect.pointWithin(gpt);
-   }
-   return false;
-}
-
-bool ossimTiledElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   static const char M[] = "ossimTiledElevationDatabase::loadState";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered..." << "\nkwl:\n" << kwl << "\n";
-   }     
-   bool result = false;
-   const char* lookup = kwl.find(prefix, "type");
-   if ( lookup )
-   {
-      std::string type = lookup;
-      if ( ( type == "image_directory" ) || ( type == "ossimTiledElevationDatabase" ) )
-      {
-         result = ossimElevationDatabase::loadState(kwl, prefix);
-      }
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
-   }
-
-   return result;
-}
-
-bool ossimTiledElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimElevationDatabase::saveState(kwl, prefix);
-}
-
-// Private method:
-bool ossimTiledElevationDatabase::isDirectoryBasedImage(ossimRefPtr<ossimImageHandler> ih)
-{
-   bool result = false;
-   if ( ih.valid() )
-   {
-      // Get the image handler name.
-      ossimString imageHandlerName = ih->getClassName();
-      if ( (imageHandlerName == "ossimAdrgTileSource") ||
-           (imageHandlerName == "ossimCibCadrgTileSource") )  
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-bool ossimTiledElevationDatabase::isCompatible(ossimImageHandler* ih,
-                                               ossimImageGeometry* geom,
-                                               ossimProjection* proj) const
-{
-   //---
-   // Check for match of the following against the first entry:
-   // bands
-   // projection
-   // scalar type
-   // scale
-   //---
-   bool result = false;
-
-   if ( m_entries.size() && ih && geom && proj )
-   {
-      ossimRefPtr<const ossimImageHandler> entry0_ih = m_entries[0].m_sic->getImageHandler();
-      
-      // Check scalar type and bands.
-      if ( (entry0_ih->getOutputScalarType() == ih->getOutputScalarType()) &&
-           (entry0_ih->getNumberOfOutputBands() == ih->getNumberOfOutputBands()) )
-      {
-         // Check the scale.
-         ossimRefPtr<const ossimMapProjection> mapProj =
-            dynamic_cast<const ossimMapProjection*>(proj);
-         if ( mapProj.valid() )
-         {
-            ossimRefPtr<const ossimMapProjection> refMapProj =
-               dynamic_cast<const ossimMapProjection*>(m_referenceProj.get());
-            
-            if ( mapProj->isGeographic() )
-            {
-               if ( refMapProj->getDecimalDegreesPerPixel() ==
-                    mapProj->getDecimalDegreesPerPixel() )
-               {
-                  result = true;
-               }
-               else if ( refMapProj->getMetersPerPixel() ==
-                         mapProj->getMetersPerPixel() )
-               {
-                  result = true;
-               }
-            }
-         }
-         else // sensor model
-         {
-            if ( proj->getMetersPerPixel() == m_referenceProj->getMetersPerPixel() )
-            {
-               result = true;
-            }
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimTiledElevationDatabase::getBoundingRect(
-   ossimRefPtr<ossimImageGeometry> geom, ossimGrect& boundingRect) const
-{
-   if ( geom.valid() )
-   {
-      std::vector<ossimGpt> corner(4);
-      if ( geom->getCornerGpts(corner[0], corner[1], corner[2], corner[3]) )
-      {
-         ossimGpt ulGpt(corner[0]);
-         ossimGpt lrGpt(corner[0]);
-         for ( ossim_uint32 i = 1; i < 4; ++i )
-         {
-            if ( corner[i].lon < ulGpt.lon ) ulGpt.lon = corner[i].lon;
-            if ( corner[i].lat > ulGpt.lat ) ulGpt.lat = corner[i].lat;
-            if ( corner[i].lon > lrGpt.lon ) lrGpt.lon = corner[i].lon;
-            if ( corner[i].lat < lrGpt.lat ) lrGpt.lat = corner[i].lat;
-         }
-         boundingRect = ossimGrect(ulGpt, lrGpt);
-      }
-      else
-      {
-         boundingRect.makeNan();
-      }
-   }
-}
-void ossimTiledElevationDatabase::mapRegion()
-{
-   static const char M[] = "ossimTiledElevationDatabase::mapRegion";
-   
-   if ( m_entries.size() && ( m_requestedRect.isLonLatNan() == false ) )
-   {
-      ossimRefPtr<ossimOrthoImageMosaic> mosaic = new ossimOrthoImageMosaic();
-      std::vector<ossimTiledElevationEntry>::iterator i = m_entries.begin();
-      while ( i != m_entries.end() )
-      {
-         mosaic->connectMyInputTo( (*i).m_sic.get() );
-         ++i;
-      }
-
-      // Compute the requested rectangle in view space.
-      ossimRefPtr<ossimImageGeometry> geom = mosaic->getImageGeometry();
-      if ( geom.valid() )
-      {
-         ossimDpt ulDpt;
-         ossimDpt lrDpt;
-         geom->worldToLocal(m_requestedRect.ul(), ulDpt);
-         geom->worldToLocal(m_requestedRect.lr(), lrDpt);
-
-         // Expand out to fall on even view coordinates.
-         ulDpt.x = std::floor(ulDpt.x);
-         ulDpt.y = std::floor(ulDpt.y);
-         lrDpt.x = std::ceil(lrDpt.x);
-         lrDpt.y = std::floor(lrDpt.y);
-
-         // Get new(expanded) corners in ground space.
-         ossimGpt ulGpt;
-         ossimGpt lrGpt;
-         geom->localToWorld(ulDpt, ulGpt);
-         geom->localToWorld(lrDpt, lrGpt);
-         theGroundRect = ossimGrect(ulGpt, lrGpt);
-            
-         // Expanded requested rect in view space.
-         ossimIpt ulIpt = ulDpt;
-         ossimIpt lrIpt = lrDpt;
-         const ossimIrect VIEW_RECT(ulIpt, lrIpt);
-
-         // Get the data.
-         ossimRefPtr<ossimImageData> data = mosaic->getTile(VIEW_RECT, 0);
-         if ( data.valid() )
-         {
-            // Initialize the grid:
-            const ossimIpt SIZE( data->getWidth(), data->getHeight() );
-            const ossimDpt ORIGIN(ulGpt.lon, lrGpt.lat); // SouthWest corner
-            const ossimDpt SPACING( (lrGpt.lon-ulGpt.lon)/(SIZE.x-1),
-                                    (ulGpt.lat-lrGpt.lat)/(SIZE.y-1) );
-            if ( !m_grid ) m_grid = new ossimDblGrid();
-            m_grid->initialize(SIZE, ORIGIN, SPACING, ossim::nan());
-
-            if ( traceDebug() )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << M
-                  << "\nrequested view rect: " << VIEW_RECT
-                  << "\nexpanded ground rect: " << theGroundRect
-                  << "\norigin:  " << ORIGIN
-                  << "\nsize:    " << SIZE
-                  << "\nspacing: " << SPACING << std::endl;
-            }
-
-            // Fill the grid:
-            switch( data->getScalarType() )
-            {
-               case OSSIM_SINT16:
-               {
-                  fillGrid(ossim_sint16(0), data);
-                  break;
-               }
-               case OSSIM_SINT32:
-               {
-                  fillGrid(ossim_sint32(0), data);
-                  break;
-               }
-               case OSSIM_FLOAT32:
-               {
-                  fillGrid(ossim_float32(0), data);
-                  break;
-               }
-               case OSSIM_FLOAT64:
-               {
-                  fillGrid(ossim_float64(0), data);
-                  break;
-               }
-               case OSSIM_UINT8:
-               case OSSIM_SINT8:
-               case OSSIM_USHORT11:
-               case OSSIM_UINT16:
-               case OSSIM_UINT32:
-               case OSSIM_NORMALIZED_DOUBLE:
-               case OSSIM_NORMALIZED_FLOAT:
-               case OSSIM_SCALAR_UNKNOWN:
-               default:
-               {
-                  std::string errMsg = M;
-                  errMsg += " ERROR:\nUnhandled scalar type: ";
-                  errMsg += data->getScalarTypeAsString().string();
-                  throw ossimException(errMsg);
-               }
-            }
-            
-         } // if ( data.valid() )
-
-      } // if ( geom.valid() )
-
-   } // if ( m_entries.size() && ...
-}
-
-template <class T> void ossimTiledElevationDatabase::fillGrid(T /* dummyTemplate */,
-                                                              ossimRefPtr<ossimImageData> data)
-{
-   if ( data.valid() )
-   {
-      // Copy to grid reversing the lines as the ossimDblGrid's origin is the SW corner.
-      const ossim_float64 NP  = data->getNullPix(0);
-      const T* buf = static_cast<T*>(data->getBuf(0));
-      if ( buf )
-      {
-         const ossimIpt SIZE( data->getWidth(), data->getHeight() );
-         ossim_int32 bufIdx = (SIZE.y-1) * data->getWidth();
-         ossim_int32 grdY = 0;
-         for (ossim_int32 y = SIZE.y-1; y >= 0; --y)
-         {
-            for (ossim_int32 x = 0; x < SIZE.x; ++ x)
-            {
-               ossim_float64 v = static_cast<ossim_float64>(buf[bufIdx+x]);
-               m_grid->setNode(x, grdY, (v!=NP?v:ossim::nan()) );
-            }
-            bufIdx -= data->getWidth();
-            ++grdY;
-         }
-      }
-   }
-}
-
-// Hidden from use...
-ossimTiledElevationDatabase::ossimTiledElevationDatabase(
-   const ossimTiledElevationDatabase& /* copy_this */)
-{
-}
-
-// Private container class:
-ossimTiledElevationDatabase::ossimTiledElevationEntry::ossimTiledElevationEntry()
-   : m_rect(),
-     m_sic(0)
-{}
-                                                   
-ossimTiledElevationDatabase::ossimTiledElevationEntry::ossimTiledElevationEntry(
-   const ossimGrect& rect, ossimRefPtr<ossimSingleImageChain> sic )
-   : m_rect(rect),
-     m_sic(sic)
-{}
-
-std::ostream& ossimTiledElevationDatabase::print(ostream& out) const
-{
-   ossimKeywordlist kwl;
-   saveState(kwl,0);
-   out << "\nossimTiledElevationDatabase @ "<< (ossim_uint64) this << "\n"
-         << kwl <<ends;
-   return out;
-}
-
-
diff --git a/ossim/src/ossim/font/makefile.vc b/ossim/src/ossim/font/makefile.vc
deleted file mode 100644
index bb6c320..0000000
--- a/ossim/src/ossim/font/makefile.vc
+++ /dev/null
@@ -1,19 +0,0 @@
-###
-# $Id: makefile.vc 9232 2006-07-05 21:42:47Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimFont.obj \
-ossimFontFactoryRegistry.obj \
-ossimFreeTypeFont.obj \
-ossimFreeTypeFontFactory.obj \
-ossimGdBitmapFont.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/imaging/makefile.vc b/ossim/src/ossim/imaging/makefile.vc
deleted file mode 100644
index 5d13d07..0000000
--- a/ossim/src/ossim/imaging/makefile.vc
+++ /dev/null
@@ -1,238 +0,0 @@
-###
-# $Id: makefile.vc 16503 2010-02-03 23:57:20Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossim3x3ConvolutionFilter.obj \
-ossimAdrgHeader.obj \
-ossimAdrgTileSource.obj \
-ossimAnnotationEllipseObject.obj \
-ossimAnnotationFontObject.obj \
-ossimAnnotationGdBitmapFont.obj \
-ossimAnnotationLineObject.obj \
-ossimAnnotationMultiEllipseObject.obj \
-ossimAnnotationMultiLineObject.obj \
-ossimAnnotationMultiPolyLineObject.obj \
-ossimAnnotationMultiPolyObject.obj \
-ossimAnnotationObject.obj \
-ossimAnnotationObjectFactory.obj \
-ossimAnnotationPolyObject.obj \
-ossimAnnotationSource.obj \
-ossimAOD.obj \
-ossimAppFixedTileCache.obj \
-ossimAppTileCache.obj \
-ossimArcInfoGridWriter.obj \
-ossimAtbController.obj \
-ossimAtbMatchPoint.obj \
-ossimAtbPointSource.obj \
-ossimAtCorrGridRemapper.obj \
-ossimAtCorrRemapper.obj \
-ossimBandAverageFilter.obj \
-ossimBandClipFilter.obj \
-ossimBandMergeSource.obj \
-ossimBandSelector.obj \
-ossimBlendMosaic.obj \
-ossimBrightnessContrastSource.obj \
-ossimBrightnessMatch.obj \
-ossimBumpShadeTileSource.obj \
-ossimCacheTileSource.obj \
-ossimCastTileSourceFilter.obj \
-ossimCcfHead.obj \
-ossimCcfTileSource.obj \
-ossimCibCadrgTileSource.obj \
-ossimClosestToCenterCombiner.obj \
-ossimColorNormalizedFusion.obj \
-ossimConvolutionFilter1D.obj \
-ossimConvolutionSource.obj \
-ossimDdffield.obj \
-ossimDdffielddefn.obj \
-ossimDdfmodule.obj \
-ossimDdfrecord.obj \
-ossimDdfsubfielddefn.obj \
-ossimDdfutils.obj \
-ossimDiscrete3x3HatFilter.obj \
-ossimDiscreteConvolutionKernel.obj \
-ossimDoqqTileSource.obj \
-ossimDtedElevationImageSource.obj \
-ossimDtedTileSource.obj \
-ossimEastingNorthingCutter.obj \
-ossimEdgeFilter.obj \
-ossimElevImageSource.obj \
-ossimEnviHeaderFileWriter.obj \
-ossimEquationCombiner.obj \
-ossimERSFileWriter.obj \
-ossimERSTileSource.obj \
-ossimFeatherMosaic.obj \
-ossimFftFilter.obj \
-ossimFgdcFileWriter.obj \
-ossimFilter.obj \
-ossimFilterResampler.obj \
-ossimFilterTable.obj \
-ossimFixedTileCache.obj \
-ossimFusionCombiner.obj \
-ossimGammaRemapper.obj \
-ossimGeneralRasterInfo.obj \
-ossimGeneralRasterTileSource.obj \
-ossimGeneralRasterWriter.obj \
-ossimGeoAnnotationBitmap.obj \
-ossimGeoAnnotationEllipseObject.obj \
-ossimGeoAnnotationFontObject.obj \
-ossimGeoAnnotationGdBitmapFont.obj \
-ossimGeoAnnotationLineObject.obj \
-ossimGeoAnnotationMultiEllipseObject.obj \
-ossimGeoAnnotationMultiPolyLineObject.obj \
-ossimGeoAnnotationMultiPolyObject.obj \
-ossimGeoAnnotationObject.obj \
-ossimGeoAnnotationPolyLineObject.obj \
-ossimGeoAnnotationPolyObject.obj \
-ossimGeoAnnotationSource.obj \
-ossimGeographicAnnotationGrid.obj \
-ossimGeomFileWriter.obj \
-ossimGeoPolyCutter.obj \
-ossimGridRemapEngine.obj \
-ossimGridRemapEngineFactory.obj \
-ossimGridRemapSource.obj \
-ossimHistogramEqualization.obj \
-ossimHistogramMatchFilter.obj \
-ossimHistogramRemapper.obj \
-ossimHistogramThreshholdFilter.obj \
-ossimHistogramWriter.obj \
-ossimHistoMatchRemapper.obj \
-ossimHsiRemapper.obj \
-ossimHsiToRgbSource.obj \
-ossimHsvGridRemapEngine.obj \
-ossimHsvToRgbSource.obj \
-ossimIgenGenerator.obj \
-ossimImageChain.obj \
-ossimImageCombiner.obj \
-ossimImageData.obj \
-ossimImageDataFactory.obj \
-ossimImageDataHelper.obj \
-ossimImageDisplayWriter.obj \
-ossimImageFileWriter.obj \
-ossimImageGaussianFilter.obj \
-ossimImageGeometry.obj \
-ossimImageGeometryFactory.obj \
-ossimImageGeometryRegistry.obj \
-ossimImageHandler.obj \
-ossimImageHandlerFactoryBase.obj \
-ossimImageHandlerFactory.obj \
-ossimImageHandlerRegistry.obj \
-ossimImageHistogramSource.obj \
-ossimImageMetaData.obj \
-ossimImageMetaDataWriterFactoryBase.obj \
-ossimImageMetaDataWriterFactory.obj \
-ossimImageMetaDataWriterRegistry.obj \
-ossimImageModel.obj \
-ossimImageMosaic.obj \
-ossimImageReconstructionFilterFactory.obj \
-ossimImageReconstructionFilterRegistry.obj \
-ossimImageRenderer.obj \
-ossimImageSharpenFilter.obj \
-ossimImageSource.obj \
-ossimImageSourceFactoryBase.obj \
-ossimImageSourceFactory.obj \
-ossimImageSourceFactoryRegistry.obj \
-ossimImageSourceFilter.obj \
-ossimImageSourceHistogramFilter.obj \
-ossimImageSourceSequencer.obj \
-ossimImageStatisticsSource.obj \
-ossimImageToPlaneNormalFilter.obj \
-ossimImageWriter.obj \
-ossimImageWriterFactoryBase.obj \
-ossimImageWriterFactory.obj \
-ossimImageWriterFactoryRegistry.obj \
-ossimIndexToRgbLutFilter.obj \
-ossimIntensityAdjustmentFilter.obj \
-ossimJpegMemSrc.obj \
-ossimJpegTileSource.obj \
-ossimJpegWriter.obj \
-ossimJpegYCbCrToRgbSource.obj \
-ossimLandsatTileSource.obj \
-ossimLandsatTopoCorrectionFilter.obj \
-ossimLocalCorrelationFusion.obj \
-ossimMapCompositionSource.obj \
-ossimMaskFilter.obj \
-ossimMaxMosaic.obj \
-ossimMeanMedianFilter.obj \
-ossimMemoryImageSource.obj \
-ossimMetadataFileWriter.obj \
-ossimMonoGridRemapEngine.obj \
-ossimMultiBandHistogramTileSource.obj \
-ossimNBandToIndexFilter.obj \
-ossimNitf20Writer.obj \
-ossimNitfTileSource.obj \
-ossimNitfWriterBase.obj \
-ossimNitfWriter.obj \
-ossimNormalizedRemapTable.obj \
-ossimNormalizedS16RemapTable.obj \
-ossimNormalizedU11RemapTable.obj \
-ossimNormalizedU16RemapTable.obj \
-ossimNormalizedU8RemapTable.obj \
-ossimNullPixelFlip.obj \
-ossimOrthoImageMosaic.obj \
-ossimOverviewBuilderBase.obj \
-ossimOverviewBuilderFactoryBase.obj \
-ossimOverviewBuilderFactory.obj \
-ossimOverviewBuilderFactoryRegistry.obj \
-ossimOverviewSequencer.obj \
-ossimPixelFlipper.obj \
-ossimPolyCutter.obj \
-ossimQuickbirdNitfTileSource.obj \
-ossimQuickbirdTiffTileSource.obj \
-ossimReadmeFileWriter.obj \
-ossimRectangleCutFilter.obj \
-ossimResampler.obj \
-ossimRgbGridRemapEngine.obj \
-ossimRgbImage.obj \
-ossimRgbToGreyFilter.obj \
-ossimRgbToHsiSource.obj \
-ossimRgbToHsvSource.obj \
-ossimRgbToIndexFilter.obj \
-ossimRgbToJpegYCbCrSource.obj \
-ossimRLevelFilter.obj \
-ossimS16ImageData.obj \
-ossimScalarRemapper.obj \
-ossimScaleFilter.obj \
-ossimSFIMFusion.obj \
-ossimSingleImageChain.obj \
-ossimSrtmTileSource.obj \
-ossimSubImageTileSource.obj \
-ossimTableRemapper.obj \
-ossimTiffOverviewBuilder.obj \
-ossimTiffTileSource.obj \
-ossimTiffWriter.obj \
-ossimTileCache.obj \
-ossimTilePatch.obj \
-ossimTiling.obj \
-ossimTopographicCorrectionFilter.obj \
-ossimTrimFilter.obj \
-ossimTwoColorView.obj \
-ossimU11ImageData.obj \
-ossimU16ImageData.obj \
-ossimU8ImageData.obj \
-ossimUsgsDemTileSource.obj \
-ossimValueAssignImageSourceFilter.obj \
-ossimVectorRenderer.obj \
-ossimVertexExtractor.obj \
-ossimVirtualImageHandler.obj \
-ossimVirtualImageWriter.obj \
-ossimVirtualOverviewBuilder.obj \
-ossimVirtualOverviewSequencer.obj \
-ossimVpfAnnotationCoverageInfo.obj \
-ossimVpfAnnotationFeatureInfo.obj \
-ossimVpfAnnotationLibraryInfo.obj \
-ossimVpfAnnotationSource.obj \
-ossimVpfTileSource.obj \
-ossimWatermarkFilter.obj \
-ossimWorldFileWriter.obj
-
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/imaging/ossim3x3ConvolutionFilter.cpp b/ossim/src/ossim/imaging/ossim3x3ConvolutionFilter.cpp
deleted file mode 100644
index 5e9f80d..0000000
--- a/ossim/src/ossim/imaging/ossim3x3ConvolutionFilter.cpp
+++ /dev/null
@@ -1,634 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossim3x3ConvolutionFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <ossim/imaging/ossim3x3ConvolutionFilter.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimMatrixProperty.h>
-
-RTTI_DEF1(ossim3x3ConvolutionFilter, "ossim3x3ConvolutionFilter", ossimImageSourceFilter);
-
-ossim3x3ConvolutionFilter::ossim3x3ConvolutionFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theTile(NULL),
-    theNullPixValue(0),
-    theMinPixValue(0),
-    theMaxPixValue(0)
-{
-   theKernel[0][0] = 0.0; theKernel[0][1] = 0.0; theKernel[0][2] = 0.0;
-   theKernel[1][0] = 0.0; theKernel[1][1] = 1.0; theKernel[1][2] = 0.0;
-   theKernel[2][0] = 0.0; theKernel[2][1] = 0.0; theKernel[2][2] = 0.0;
-   
-}
-
-ossim3x3ConvolutionFilter::~ossim3x3ConvolutionFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossim3x3ConvolutionFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return theTile;
-   }
-
-   if(!isSourceEnabled())
-   {
-      return theInputConnection->getTile(tileRect, resLevel);
-   }
-
-   //---
-   // We have a 3x3 matrix so stretch the rect out to cover
-   // the required pixels.  We only need 1 pixel to the left
-   // and right of the center pixel.
-   //---
-   ossimIrect newRect(ossimIpt(tileRect.ul().x - 1,
-                               tileRect.ul().y - 1),
-                      ossimIpt(tileRect.lr().x + 1,
-                               tileRect.lr().y + 1));
-   
-   ossimRefPtr<ossimImageData> data = theInputConnection->getTile(newRect,
-                                                                  resLevel);
-
-   if(!data.valid() || !data->getBuf())
-   {
-      return data;
-   }
-
-    // First time through or after an initialize()...
-   if (!theTile.valid())
-   {
-      allocate();
-      if (!theTile.valid()) // Should never happen!
-      {
-         return data;
-      }
-   }
-
-   // First time through, after an initialize() or a setKernel()...
-   if (!theNullPixValue.size())
-   {
-      computeNullMinMax();
-      if (!theNullPixValue.size()) // Should never happen!
-      {
-         return data;
-      }
-   }
-
-   theTile->setImageRectangle(tileRect);
-   theTile->makeBlank();
-   
-   switch(data->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<ossim_uint8>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<ossim_uint8>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_FLOAT: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<float>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<float>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<ossim_uint16>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<ossim_uint16>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<ossim_sint16>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<ossim_sint16>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<double>(0), data, theTile);
-      }
-      else
-      {
-         convolvePartial(static_cast<double>(0), data, theTile);
-      }
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossim3x3ConvolutionFilter::getTile WARNING:\n"
-            << "Scalar type = " << theTile->getScalarType()
-            << " Not supported by ossim3x3ConvolutionFilter" << endl;
-         break;
-      }
-   }
-   theTile->validate();
-   
-   return theTile;
-}
-
-
-template<class T> void ossim3x3ConvolutionFilter::convolvePartial(
-   T,
-   ossimRefPtr<ossimImageData> inputData,
-   ossimRefPtr<ossimImageData> outputData)
-{
-   // let's set up some temporary variables so we don't
-   // have to call the functions in loops.  Iknow that compilers
-   // typically optimize this out but if we are in debug mode 
-   // with no optimization it will still run fast
-   //
-   double sum = 0.0;
-   ossim_int32 inputW          = (ossim_int32)inputData->getWidth();
-   ossim_int32 outputW         = (ossim_int32)outputData->getWidth();
-   ossim_int32 outputH         = (ossim_int32)outputData->getHeight();
-   ossim_int32 numberOfBands   = (ossim_int32)inputData->getNumberOfBands();
-   ossimIpt outputOrigin  = outputData->getOrigin();
-   ossimIpt inputOrigin   = inputData->getOrigin();
-   
-   ossim_int32 startInputOffset = std::abs(outputOrigin.y - inputOrigin.y)*
-      inputW + std::abs(outputOrigin.x - inputOrigin.x);
-   ossim_int32 ulKernelStart    = -inputW - 1;
-   ossim_int32 leftKernelStart  = -1;
-   ossim_int32 llKernelStart    = inputW  - 1;
-   
-   T* ulKernelStartBuf    = NULL;
-   T* leftKernelStartBuf  = NULL;
-   T* llKernelStartBuf    = NULL;
-   
-   for(ossim_int32 band = 0; band < numberOfBands; ++band)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(band))+startInputOffset;
-      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
-      T maxPix     = static_cast<T>(getMaxPixelValue(band));
-      T minPix     = static_cast<T>(getMinPixelValue(band));      
-      T nullPix    = static_cast<T>(inputData->getNullPix(band));
-      T oNullPix   = static_cast<T>(getNullPixelValue(band));
-      
-      if(inputBuf&&outputBuf)
-      {
-         for(ossim_int32 row = 0; row < outputW; ++row)
-         {
-            ossim_int32 rowOffset    = inputW*row;
-            ulKernelStartBuf   = inputBuf + (rowOffset + ulKernelStart);
-            leftKernelStartBuf = inputBuf + (rowOffset + leftKernelStart);
-            llKernelStartBuf   = inputBuf + (rowOffset + llKernelStart);
-            for(ossim_int32 col = 0; col < outputH; ++col)
-            {
-
-               if((ulKernelStartBuf[0]   != nullPix)&&
-                  (ulKernelStartBuf[1]   != nullPix)&&
-                  (ulKernelStartBuf[2]   != nullPix)&&
-                  (leftKernelStartBuf[0] != nullPix)&&
-                  (leftKernelStartBuf[1] != nullPix)&&
-                  (leftKernelStartBuf[2] != nullPix)&&
-                  (llKernelStartBuf[0]   != nullPix)&&
-                  (llKernelStartBuf[1]   != nullPix)&&
-                  (llKernelStartBuf[2]   != nullPix))
-               {
-                  sum = theKernel[0][0]*(double)ulKernelStartBuf[0] +
-                        theKernel[0][1]*(double)ulKernelStartBuf[1] +
-                        theKernel[0][2]*(double)ulKernelStartBuf[2] +
-                        theKernel[1][0]*(double)leftKernelStartBuf[0] +
-                        theKernel[1][1]*(double)leftKernelStartBuf[1] +
-                        theKernel[1][2]*(double)leftKernelStartBuf[2] +
-                        theKernel[2][0]*(double)llKernelStartBuf[0] +
-                        theKernel[2][1]*(double)llKernelStartBuf[1] +
-                        theKernel[2][2]*(double)llKernelStartBuf[2];
-                  
-                  if(sum > maxPix)
-                  {
-                     *outputBuf = maxPix;
-                  }
-                  else if(sum < minPix)
-                  {
-                     *outputBuf = minPix;
-                  }
-                  else
-                  {
-                     *outputBuf = static_cast<T>(sum);
-                  }
-               }
-               else {
-                  *outputBuf = oNullPix;
-               }
-               //
-               // Need to implement the convolution here
-               //
-               
-               ++ulKernelStartBuf;
-               ++leftKernelStartBuf;
-               ++llKernelStartBuf;
-               ++outputBuf;
-            }
-         }
-      }
-   }
-}
-
-template<class T> void ossim3x3ConvolutionFilter::convolveFull(
-   T,
-   ossimRefPtr<ossimImageData> inputData,
-   ossimRefPtr<ossimImageData> outputData)
-{
-   // let's set up some temporary variables so we don't
-   // have to call the functions in loops.  Iknow that compilers
-   // typically optimize this out but if we are in debug mode 
-   // with no optimization it will still run fast
-   //
-   double sum = 0.0;
-   ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
-   ossim_uint32 outputW       = outputData->getWidth();
-   ossim_uint32 outputH       = outputData->getHeight();
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-   ossimIpt outputOrigin = outputData->getOrigin();
-   ossimIpt inputOrigin  = inputData->getOrigin();
-   
-   ossim_int32 startInputOffset = std::abs(outputOrigin.y - inputOrigin.y)*
-      inputW + std::abs(outputOrigin.x - inputOrigin.x);
-   ossim_int32 ulKernelStart    = -inputW - 1;
-   ossim_int32 leftKernelStart  = -1;
-   ossim_int32 llKernelStart    = inputW  - 1;
-   
-   T* ulKernelStartBuf   = NULL;
-   T* leftKernelStartBuf = NULL;
-   T* llKernelStartBuf   = NULL;
-   
-   for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(band))+startInputOffset;
-      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
-      T maxPix     = static_cast<T>(getMaxPixelValue(band));
-      T minPix     = static_cast<T>(getMinPixelValue(band));
-      
-      if(inputBuf&&outputBuf)
-      {
-         for(ossim_uint32 row = 0; row < outputW; ++row)
-         {
-            ossim_int32 rowOffset    = inputW*row;
-            ulKernelStartBuf   = inputBuf + (rowOffset + ulKernelStart);
-            leftKernelStartBuf = inputBuf + (rowOffset + leftKernelStart);
-            llKernelStartBuf   = inputBuf + (rowOffset + llKernelStart);
-            for(ossim_uint32 col = 0; col < outputH; ++col)
-            {
-               sum = theKernel[0][0]*(double)ulKernelStartBuf[0] +
-                     theKernel[0][1]*(double)ulKernelStartBuf[1] +
-                     theKernel[0][2]*(double)ulKernelStartBuf[2] +
-                     theKernel[1][0]*(double)leftKernelStartBuf[0] +
-                     theKernel[1][1]*(double)leftKernelStartBuf[1] +
-                     theKernel[1][2]*(double)leftKernelStartBuf[2] +
-                     theKernel[2][0]*(double)llKernelStartBuf[0] +
-                     theKernel[2][1]*(double)llKernelStartBuf[1] +
-                     theKernel[2][2]*(double)llKernelStartBuf[2];
-               
-               if(sum > maxPix)
-               {
-                  *outputBuf = maxPix;
-               }
-               else if(sum < minPix)
-               {
-                  *outputBuf = minPix;
-               }
-               else
-               {
-                  *outputBuf = static_cast<T>(sum);
-               }
-               //
-               // Need to implement the convolution here.
-               //
-
-               
-               ++ulKernelStartBuf;
-               ++leftKernelStartBuf;
-               ++llKernelStartBuf;
-               ++outputBuf;
-            }
-         }
-      }
-   }
-}
-
-void ossim3x3ConvolutionFilter::initialize()
-{
-   //---
-   // NOTE:
-   // Since initialize get called often sequentially we will wipe things slick
-   // but not reallocate to avoid multiple delete/allocates.
-   //
-   // On the first getTile call things will be reallocated/computed.
-   //---
-   theTile = NULL;
-   clearNullMinMax();
-}
-
-void ossim3x3ConvolutionFilter::allocate()
-{   
-   if(theInputConnection)
-   {
-      ossimImageDataFactory* idf = ossimImageDataFactory::instance();
-      
-      theTile = idf->create(this,
-                            this);
-      
-      theTile->initialize();
-   }
-}
-
-void ossim3x3ConvolutionFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-   if(property->getName() == "Kernel")
-   {
-      ossimMatrixProperty* matrixProperty = PTR_CAST(ossimMatrixProperty,
-                                                     property.get());
-      if(matrixProperty)
-      {
-         theKernel[0][0] = (*matrixProperty)(0,0);
-         theKernel[1][0] = (*matrixProperty)(1,0);
-         theKernel[2][0] = (*matrixProperty)(2,0);
-         theKernel[0][1] = (*matrixProperty)(0,1);
-         theKernel[1][1] = (*matrixProperty)(1,1);
-         theKernel[2][1] = (*matrixProperty)(2,1);
-         theKernel[0][2] = (*matrixProperty)(0,2);
-         theKernel[1][2] = (*matrixProperty)(1,2);
-         theKernel[2][2] = (*matrixProperty)(2,2);
-
-      }
-      else
-      {
-         ossimImageSourceFilter::setProperty(property);
-      }
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossim3x3ConvolutionFilter::getProperty(const ossimString& name)const
-{
-   if(name == "Kernel")
-   {
-      ossimMatrixProperty* property = new ossimMatrixProperty(name);
-      property->resize(3,3);
-      (*property)(0,0) = theKernel[0][0];
-      (*property)(1,0) = theKernel[1][0];
-      (*property)(2,0) = theKernel[2][0];
-      (*property)(0,1) = theKernel[0][1];
-      (*property)(1,1) = theKernel[1][1];
-      (*property)(2,1) = theKernel[2][1];
-      (*property)(0,2) = theKernel[0][2];
-      (*property)(1,2) = theKernel[1][2];
-      (*property)(2,2) = theKernel[2][2];
-      property->setCacheRefreshBit();
-
-      return property;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossim3x3ConvolutionFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("Kernel");
-}
-
-bool ossim3x3ConvolutionFilter::saveState(ossimKeywordlist& kwl,
-                                          const char* prefix)const
-{   
-   kwl.add(prefix,
-           "rows",
-           3,
-           true);
-   
-   kwl.add(prefix,
-           "cols",
-           3,
-           true);
-   
-   for(ossim_int32 row = 0; row < 3; ++row)
-   {
-      for(ossim_int32 col =0; col < 3; ++col)
-      {
-         ossimString newPrefix = "m" +
-                                 ossimString::toString(row+1) + "_" +
-                                 ossimString::toString(col+1);
-         kwl.add(prefix,
-                 newPrefix,
-                 theKernel[row][col],
-                 true);          
-      }
-   }
-
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-
-bool ossim3x3ConvolutionFilter::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   ossimString newPrefix = prefix;
-   newPrefix += ossimString("m");
-   
-   for(ossim_int32 r = 0; r < 3; r++)
-   {
-      for(ossim_int32 c = 0; c < 3; c++)
-      {
-         theKernel[r][c] = 0.0;
-         
-         ossimString value = ossimString::toString(r+1);
-         value += "_";
-         value += ossimString::toString(c+1);
-         
-         const char* v = kwl.find(newPrefix.c_str(),
-                                  value.c_str());
-         if(v)
-         {
-            theKernel[r][c] = ossimString(v).toDouble();
-         }
-      }
-   }
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-void ossim3x3ConvolutionFilter::getKernel(double kernel[3][3])
-{
-   kernel[0][0] = theKernel[0][0];
-   kernel[0][1] = theKernel[0][1];
-   kernel[0][2] = theKernel[0][2];
-   kernel[1][0] = theKernel[1][0];
-   kernel[1][1] = theKernel[1][1];
-   kernel[1][2] = theKernel[1][2];
-   kernel[2][0] = theKernel[2][0];
-   kernel[2][1] = theKernel[2][1];
-   kernel[2][2] = theKernel[2][2];
-}
-
-void ossim3x3ConvolutionFilter::setKernel(double kernel[3][3])
-{
-   theKernel[0][0] = kernel[0][0];
-   theKernel[0][1] = kernel[0][1];
-   theKernel[0][2] = kernel[0][2];
-   theKernel[1][0] = kernel[1][0];
-   theKernel[1][1] = kernel[1][1];
-   theKernel[1][2] = kernel[1][2];
-   theKernel[2][0] = kernel[2][0];
-   theKernel[2][1] = kernel[2][1];
-   theKernel[2][2] = kernel[2][2];
-
-   // Will be recomputed first getTile call.
-   clearNullMinMax();
-}
-
-double ossim3x3ConvolutionFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   if( isSourceEnabled() && (band < theNullPixValue.size()) )
-   {
-      return theNullPixValue[band];
-   }
-
-   return ossim::defaultNull(getOutputScalarType());
-}
-
-double ossim3x3ConvolutionFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   if( isSourceEnabled() && (band < theMinPixValue.size()) )
-   {
-      return theMinPixValue[band];
-   }
-   
-   return ossimImageSource::getMinPixelValue(band);
-}
-
-double ossim3x3ConvolutionFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   if( isSourceEnabled() && (band < theMaxPixValue.size()) )
-   {
-      return theMaxPixValue[band];
-   }
-
-   return ossimImageSource::getMaxPixelValue(band);
-}
-
-void ossim3x3ConvolutionFilter::clearNullMinMax()
-{
-   theNullPixValue.clear();
-   theMinPixValue.clear();
-   theMaxPixValue.clear();
-}
-
-void ossim3x3ConvolutionFilter::computeNullMinMax()
-{
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-
-   theNullPixValue.resize(BANDS);
-   theMinPixValue.resize(BANDS);
-   theMaxPixValue.resize(BANDS);
-
-   ossim_float64 defaultNull = ossim::defaultNull(getOutputScalarType());
-   ossim_float64 defaultMin = ossim::defaultMin(getOutputScalarType());
-   ossim_float64 defaultMax = ossim::defaultMax(getOutputScalarType());
-  
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      if(theInputConnection)
-      {
-         ossim_float64 inputNull = theInputConnection->getNullPixelValue(band);
-         ossim_float64 inputMin  = theInputConnection->getMinPixelValue(band);
-         ossim_float64 inputMax  = theInputConnection->getMaxPixelValue(band);
-         ossim_float64 tempMin   = 0.0;
-         ossim_float64 tempMax   = 0.0;
-         ossim_float64 k         = 0.0;
-         for(int i=0;i<3;++i)
-         {
-            for(int j=0;j<3;++j)
-            {
-               k=theKernel[i][j];
-               tempMin += (k<0.0) ? k*inputMax : k*inputMin;
-               tempMax += (k>0.0) ? k*inputMax : k*inputMin;
-            }
-         }
-
-         if((inputNull < getMinPixelValue(band)) ||
-            (inputNull > getMaxPixelValue(band)))
-         {
-            theNullPixValue[band] = inputNull;
-         }
-         else
-         {
-            theNullPixValue[band] = defaultNull;
-         }
-
-         if((tempMin >= defaultMin) && (tempMin <= defaultMax))
-         {
-            theMinPixValue[band] = tempMin;
-         }
-         else
-         {
-            theMinPixValue[band] = defaultMin;
-         }
-
-         if((tempMax >= defaultMin) && (tempMax <= defaultMax))
-         {
-            theMaxPixValue[band] = tempMax;
-         }
-         else
-         {
-            theMaxPixValue[band] = defaultMax;
-         }
-         
-      }
-      else // No input connection...
-      {
-         theNullPixValue[band] = defaultNull;
-         theMinPixValue[band]  = defaultMin;
-         theMaxPixValue[band]  = defaultMax;
-      }
-      
-   } // End of band loop.
-}
-
diff --git a/ossim/src/ossim/imaging/ossimAOD.cpp b/ossim/src/ossim/imaging/ossimAOD.cpp
deleted file mode 100644
index ea212fe..0000000
--- a/ossim/src/ossim/imaging/ossimAOD.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kathy Minear
-//
-// Description:
-// 
-// Class to compute Aerosol Optical Depth (AOD) for with atmospheric
-// correction.
-// 
-//
-//*************************************************************************
-// $Id: ossimAOD.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <math.h>
-#include <ossim/imaging/ossimAOD.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-
-
-RTTI_DEF1(ossimAOD, "ossimAOD", ossimImageSourceFilter)
-
-static ossimTrace traceDebug("ossimAOD:debug");
-
-ossimAOD::ossimAOD(ossimObject* owner)
-   :
-      ossimImageSourceFilter  (owner),  // base class
-      theTile                 (NULL)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   disableSource();
-
-   // Construction not complete.
-}
-
-ossimAOD::ossimAOD(ossimImageSource* inputSource)
-   :
-      ossimImageSourceFilter  (NULL, inputSource),  // base class
-      theTile                 (NULL)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   disableSource();
-
-   if (inputSource == NULL)
-   {
-      setErrorStatus();
-      cerr << "ossimAOD::ossimAOD ERROR:"
-           << "\nNull input source passed to constructor!" << endl;
-      return;
-   }
-
-   initialize();
-}
-
-
-ossimAOD::ossimAOD(ossimObject* owner,
-                                         ossimImageSource* inputSource)
-   :
-      ossimImageSourceFilter  (owner, inputSource),  // base class     
-      theTile                 (NULL)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   disableSource();
-
-   if (inputSource == NULL)
-   {
-      setErrorStatus();
-      cerr << "ossimAOD::ossimAOD ERROR:"
-           << "\nNull input source passed to constructor!" << endl;
-      return;
-   }
-
-   initialize();
-}
-
-ossimAOD::~ossimAOD()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimAOD::getTile(const ossimIrect& tile_rect,
-                                              ossim_uint32 resLevel)
-{
-   if (!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-      
-   // Fetch tile from pointer from the input source.
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tile_rect,
-                                                                       resLevel);
-
-
-   if (!inputTile.valid())  // Just in case...
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimAOD::getTile ERROR:"
-         << "\nReceived null pointer to tile from input source!"
-         << "\nReturning blank tile."
-         << endl;
-      return inputTile;
-   }
-
-   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
-
-   if ( !theEnableFlag ||
-        (tile_status == OSSIM_NULL) ||
-        (tile_status == OSSIM_EMPTY) )
-   {
-      return inputTile;
-   }
-   
-   if (!theTile.valid())
-   {
-      allocate();
-      if (!theTile.valid())
-      {
-         return inputTile;
-      }
-   }
-
-   ossim_uint32 w     = tile_rect.width();
-   ossim_uint32 h     = tile_rect.height();
-   ossim_uint32 tw    = theTile->getWidth();
-   ossim_uint32 th    = theTile->getHeight();
-   // ossim_uint32 bands = theTile->getNumberOfBands();
-
-   // Set the origin of the output tile.
-   theTile->setOrigin(tile_rect.ul());
-
-   if(w*h != tw*th)
-   {
-      theTile->setWidthHeight(w, h);
-      theTile->initialize();
-   }
-   return theTile;
-}
-
-void ossimAOD::initialize()
-{
-   ossimImageSourceFilter::initialize();
-}
-
-void ossimAOD::allocate()
-{
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,
-                                                          theInputConnection);
-      theTile->initialize();
-      setInitializedFlag(true);
-      clearErrorStatus();
-   }
-   else
-   {
-      setInitializedFlag(false);
-      setErrorStatus();
-      cerr << "ossimAOD::initialize ERROR:"
-           << "\nCannot call method when input connection is NULL!"
-           << endl;
-   };
-
-   verifyEnabled();
-}
-
-bool ossimAOD::loadState(const ossimKeywordlist& /* kwl */, const char* /* prefix */)
-{
-   static const char MODULE[] = "ossimAOD::loadState()";
-
-   if (traceDebug())  CLOG << "entering..." << endl;
-
-   if (!theTile)
-   {
-      cerr << MODULE << " ERROR:"
-           << "Not initialized..." << endl;
-      return false;
-   }
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << *this
-           << "\nreturning..."
-           << endl;
-   }
-   
-   return true;
-}
-
-
-void ossimAOD::verifyEnabled()
-{
-   // Check all the pointers...
-   if ( !theInputConnection    || !theTile )
-   {
-      disableSource();
-      return;
-   }
-
-   enableSource();
-}
-
-ostream& ossimAOD::print(ostream& os) const
-{
-   os << "ossimAOD:"
-      << "\ntheEnableFlag:  " << (theEnableFlag?"enabled":"disabled")
-      << endl;
-
-   return os;
-}
-
-ostream& operator<<(ostream& os, const ossimAOD& hr)
-{
-   return hr.print(os);
-}
-
-void ossimAOD::writeTemplate(ostream& /* os */)
-{
-}
-
-ossimString ossimAOD::getShortName() const
-{
-   return ossimString("Aerosol Optical Depth");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimAdrgTileSource.cpp b/ossim/src/ossim/imaging/ossimAdrgTileSource.cpp
deleted file mode 100644
index 007fbb8..0000000
--- a/ossim/src/ossim/imaging/ossimAdrgTileSource.cpp
+++ /dev/null
@@ -1,677 +0,0 @@
-//*******************************************************************
-//
-// See top level LICENSE.txt file.
-//
-// Author: Ken Melero
-// Contributor: David A. Horner (DAH) - http://dave.thehorners.com
-// 
-// Description: This class give the capability to access tiles from an
-//              ADRG file.
-//
-//********************************************************************
-// $Id: ossimAdrgTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
-
-#include <ossim/imaging/ossimAdrgTileSource.h>
-#include <ossim/imaging/ossimAdrgHeader.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <iostream>
-
-RTTI_DEF1(ossimAdrgTileSource, "ossimAdrgTileSource", ossimImageHandler)
-
-//***
-// Static trace for debugging
-//***
-static ossimTrace traceDebug("ossimAdrgTileSource:debug");
-
-//***
-// NOTE:  Currently this tilesource is hard-coded to access tiles
-//        from the ZDR image file. This will change as I wrote support
-//        data classes for all the ADRG image files: ZDR, overview,
-//        and legend support data.  Next step in development will
-//        be to put in flags to access overview and legend image files.
-//***
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimAdrgTileSource::ossimAdrgTileSource()
-   :
-      ossimImageHandler(),
-      m_Tile(0),
-      m_TileBuffer(0),
-      m_FileStr(),
-      m_AdrgHeader(0)
-{
-   // Construction not complete.  Users should call "open" method.
-}
-
-ossimAdrgTileSource::~ossimAdrgTileSource()
-{
-   if(m_AdrgHeader)
-   {
-      delete m_AdrgHeader;
-      m_AdrgHeader = 0;
-   }
-   if (m_TileBuffer)
-   {
-      delete [] m_TileBuffer;
-      m_TileBuffer = 0;
-   }
-
-   close();
-}
-
-ossimRefPtr<ossimImageData> ossimAdrgTileSource::getTile(
-   const ossimIrect& rect,
-   ossim_uint32 resLevel)
-{
-   if (m_Tile.valid())
-   {
-      // Image rectangle must be set prior to calling getTile.
-      m_Tile->setImageRectangle(rect);
-      
-      if ( getTile( m_Tile.get(), resLevel ) == false )
-      {
-         if (m_Tile->getDataObjectStatus() != OSSIM_NULL)
-         {
-            m_Tile->makeBlank();
-         }
-      }
-   }
-   
-   return m_Tile;
-}
-
-bool ossimAdrgTileSource::getTile(ossimImageData* result,
-                                  ossim_uint32 resLevel)
-{
-   bool status = false;
-
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
-   {
-      result->ref();  // Increment ref count.
-
-      //---
-      // Check for overview tile.  Some overviews can contain r0 so always
-      // call even if resLevel is 0.  Method returns true on success, false
-      // on error.
-      //---
-      status = getOverviewTile(resLevel, result);
-      
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-         
-         ossimIrect tile_rect = result->getImageRectangle();
-         
-         ossimIrect image_rect = getImageRectangle(resLevel);
-         
-         result->makeBlank();
-         
-         //---
-         // See if any point of the requested tile is in the image.
-         //---
-         if ( tile_rect.intersects(image_rect) )
-         {
-            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
-            
-            // Load the tile buffer with data from the adrg.
-            status = fillBuffer(tile_rect, clip_rect, result);
-
-            if (status)
-            {
-               result->validate();
-            }
-         }
-      }
-
-      result->unref();  // Decrement ref count.
-   }
-
-   return status;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimAdrgTileSource::fillBuffer(const ossimIrect& /* tile_rect */,
-                                     const ossimIrect& clip_rect,
-                                     ossimImageData* tile)
-{
-   //***
-   // Shift the upper left corner of the "clip_rect" to the an even chunk
-   // boundry.
-   //***
-   ossimIpt tileOrigin = clip_rect.ul();
-   adjustToStartOfTile(tileOrigin);
-
-   //***
-   // Calculate the number of tiles needed in the line/sample directions.
-   //***
-   ossim_int32 size_in_x = clip_rect.lr().x - tileOrigin.x + 1;
-   ossim_int32 size_in_y = clip_rect.lr().y - tileOrigin.y + 1;
-   
-   ossim_int32 tiles_in_x_dir = size_in_x / ADRG_TILE_WIDTH  +
-      (size_in_x % ADRG_TILE_WIDTH  ? 1 : 0);
-   ossim_int32 tiles_in_y_dir = size_in_y / ADRG_TILE_HEIGHT +
-      (size_in_y % ADRG_TILE_HEIGHT ? 1 : 0);
-
-
-   ossimIpt ulTilePt = tileOrigin;
-   
-   // Chunk loop in line direction.
-   for (int32 y=0; y<tiles_in_y_dir; y++)
-   {
-      ulTilePt.x = tileOrigin.x;
-
-      // Tile loop in sample direction.
-      for (int32 x=0; x<tiles_in_x_dir; x++)
-      {
-         ossimIrect adrg_tile_rect(ulTilePt.x,
-                                   ulTilePt.y,
-                                   ulTilePt.x + ADRG_TILE_WIDTH- 1,
-                                   ulTilePt.y + ADRG_TILE_HEIGHT - 1);
-
-         if (adrg_tile_rect.intersects(clip_rect))
-         {
-            ossimIrect tile_clip_rect = clip_rect.clipToRect(adrg_tile_rect);
-            
-            //---
-            // Some point in the chip intersect the tile so grab the
-            // data.
-            //---
-            ossim_int32 row = (ossim_int32) ulTilePt.y / ADRG_TILE_HEIGHT; 
-            ossim_int32 col = (ossim_int32) ulTilePt.x / ADRG_TILE_WIDTH;
-            ossim_int32 tileOffset = m_AdrgHeader->tim(row, col);
-
-            if(tileOffset != 0)
-            {
-               // Get the data.
-               int seek_position = (tileOffset - 1) * 49152 + 2048;
-               int band;
-
-               // seek to start of chip
-               m_FileStr.seekg(seek_position, ios::beg);
-               for (band=0; band<3; band++)
-               {
-                  //***
-                  // Read the chip from the ccf file into the chunk buffer.
-                  // This will get all the bands.  Bands are interleaved by
-                  // chip.
-                  //***
-                  if (!m_FileStr.read((char*)m_TileBuffer,
-                                       ADRG_TILE_SIZE))
-                  {
-                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-                     return false;
-                  }
-
-                  tile->loadBand(m_TileBuffer,
-                                 adrg_tile_rect,
-                                 tile_clip_rect,
-                                 band);
-
-               } // End of band loop.
-               
-            } // End of if (tileOffset != 0)
-            
-         } // End of if (adrg_tile_rect.intersects(clip_rect))
-         
-         ulTilePt.x += ADRG_TILE_WIDTH;
-         
-      }  // End of tile loop in the sample direction.
-
-      ulTilePt.y += ADRG_TILE_HEIGHT;
-      
-   }  // End of tile loop in the line direction.
-
-   return true;
-}
-
-ossim_uint32 ossimAdrgTileSource::getNumberOfOutputBands()const
-{
-   return getNumberOfInputBands();
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-ossimIrect
-ossimAdrgTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   return ossimIrect(0,                         // upper left x
-                     0,                         // upper left y
-                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
-                     getNumberOfLines(reduced_res_level)   - 1); // lower right y
-}
-
-void ossimAdrgTileSource::close()
-{
-   if(m_AdrgHeader)
-   {
-      delete m_AdrgHeader;
-      m_AdrgHeader = 0;
-   }
-   if(m_FileStr.is_open())
-   {
-      m_FileStr.close();
-   }
-   m_Tile = 0;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimAdrgTileSource::open()
-{
-   static const char MODULE[] = "ossimAdrgTileSource::open";
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << "Entered..."<<std::endl;
-   }
-   if(isOpen())
-   {
-      close();
-   }
-   if(m_AdrgHeader)
-   {
-      delete m_AdrgHeader;
-      m_AdrgHeader = 0;
-   }
-   // Instantiate support data class to parse header file.
-   m_AdrgHeader = new ossimAdrgHeader(theImageFile);
-
-   // Check for errors.
-   if (m_AdrgHeader->errorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Error in ossimAdrg header detected." << std::endl;
-      }
-
-      close();
-      return false;
-   }
-
-   m_FileStr.open(m_AdrgHeader->imageFile().c_str(),
-                   ios::in | ios::binary);
-
-   // Check the file pointer.
-   if(!m_FileStr)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << MODULE << "\nCannot open:  "
-              << m_AdrgHeader->imageFile().c_str() << std::endl;
-      }
-      close();
-      
-      return false;
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE
-         << "File is opened -> "<< m_AdrgHeader->imageFile()<<std::endl;
-   }
-
-   // allow the base handler to check for other overrides
-   completeOpen();
-   // Allocate memory.
-   m_Tile      = ossimImageDataFactory::instance()->create(this, this);
-   m_Tile->initialize();
-   m_TileBuffer  = new ossim_uint8[ADRG_TILE_SIZE];
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nminLon:   " << m_AdrgHeader->minLon()
-         << "\nminLond:  " << m_AdrgHeader->minLongitude() 
-         << "\nminLat:   " << m_AdrgHeader->minLat()
-         << "\nminLatd:  " << m_AdrgHeader->minLatitude()
-         << "\nmaxLon:   " << m_AdrgHeader->maxLon()
-         << "\nmaxLond:  " << m_AdrgHeader->maxLongitude()
-         << "\nmaxLat:   " << m_AdrgHeader->maxLat()
-         << "\nmaxLatd:  " << m_AdrgHeader->maxLatitude()
-         << std::endl;
-   }
-   
-   return true;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimAdrgTileSource::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix) const
-{
-   // Currently nothing to do here.
-   return ossimImageHandler::saveState(kwl, prefix);
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimAdrgTileSource::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   if (ossimImageHandler::loadState(kwl, prefix))
-   {
-      if (open())
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossimRefPtr<ossimImageGeometry> ossimAdrgTileSource::getImageGeometry()
-{
-   if ( !theGeometry )
-   {
-      // Check for external geom:
-      theGeometry = getExternalImageGeometry();
-      
-      if ( !theGeometry )
-      {
-         // origin of latitude
-         ossim_float64 originLatitude = (m_AdrgHeader->maxLatitude() +
-                                         m_AdrgHeader->minLatitude()) / 2.0;
-         
-         // central meridian.
-         ossim_float64 centralMeridian = (m_AdrgHeader->maxLongitude() +
-                                          m_AdrgHeader->minLongitude()) / 2.0;
-         
-         //---
-         // Compute the pixel size in latitude and longitude direction.  This will
-         // be full image extents divided by full image lines and samples.
-         //---
-         
-         // Samples in full image (used to compute degPerPixelX).
-         ossim_float64 samples = m_AdrgHeader->samples();
-         
-         // Lines in full image (used to compute degPerPixelX).
-         ossim_float64 lines = m_AdrgHeader->lines();
-         
-         // Degrees in latitude direction of the full image.
-         ossim_float64 degrees_in_lat_dir = m_AdrgHeader->maxLatitude() -
-            m_AdrgHeader->minLatitude();
-         
-         // Degrees in longitude direction of the full image.
-         ossim_float64 degrees_in_lon_dir = m_AdrgHeader->maxLongitude() -
-            m_AdrgHeader->minLongitude();
-         
-         ossim_float64 degPerPixelY = degrees_in_lat_dir / lines;
-         ossim_float64 degPerPixelX = degrees_in_lon_dir / samples;
-         
-         //---
-         // The tie is determined with the following assumptions that need to be
-         // verified:
-         // 1) Rows and columns start at 1.
-         // 2) The min / max latitudes longitudes go to the edge of the pixel.
-         // 3) Latitude decreases by degPerPixelY with each line.
-         // 4) Longitude increases by degPerPixelX with each sample.
-         //---
-         ossim_float64 ul_lat = (m_AdrgHeader->maxLatitude() - 
-                                 ( (m_AdrgHeader->startRow() - 1) *
-                                   degPerPixelY ) - ( degPerPixelY * 0.5 ) );
-         ossim_float64 ul_lon = (m_AdrgHeader->minLongitude() +
-                                 ( (m_AdrgHeader->startCol() -1) *
-                                   degPerPixelX ) +  ( degPerPixelX * 0.5 ) );
-         
-         // projection type
-         ossimKeywordlist kwl;
-         const char* prefix = 0;
-         kwl.add(prefix,
-                 ossimKeywordNames::TYPE_KW,
-                 "ossimEquDistCylProjection",
-                 true);
-         
-         // datum.
-         kwl.add(prefix,
-                 ossimKeywordNames::DATUM_KW,
-                 "WGE",
-                 true);
-         
-         // origin latitude
-         kwl.add(prefix,
-                 ossimKeywordNames::ORIGIN_LATITUDE_KW,
-                 originLatitude,
-                 true);
-
-         // central meridin
-         kwl.add(prefix,
-                 ossimKeywordNames::CENTRAL_MERIDIAN_KW,
-                 centralMeridian,
-                 true);
-
-         // Save the tie point.
-         kwl.add(prefix,
-                 ossimKeywordNames::TIE_POINT_XY_KW,
-                 ossimDpt(ul_lon, ul_lat).toString().c_str(),
-                 true);
-         kwl.add(prefix,
-                 ossimKeywordNames::TIE_POINT_UNITS_KW,
-                 ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
-                 true);
-
-         // Save the scale.
-         kwl.add(prefix,
-                 ossimKeywordNames::TIE_POINT_LAT_KW,
-                 ul_lat,
-                 true);
-   
-         kwl.add(prefix,
-                 ossimKeywordNames::TIE_POINT_LON_KW,
-                 ul_lon,
-                 true);
-
-         // Save the scale.
-         kwl.add(prefix,
-                 ossimKeywordNames::PIXEL_SCALE_XY_KW,
-                 ossimDpt(degPerPixelX, degPerPixelY).toString().c_str(),
-                 true);
-         kwl.add(prefix,
-                 ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
-                 ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
-                 true);  
-
-         // lines
-         kwl.add(prefix,
-                 ossimKeywordNames::NUMBER_LINES_KW,
-                 getNumberOfLines());
-
-         // samples
-         kwl.add(prefix,
-                 ossimKeywordNames::NUMBER_SAMPLES_KW,
-                 getNumberOfSamples());
-
-         // res sets
-         kwl.add(prefix,
-                 ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW,
-                 getNumberOfDecimationLevels());
-
-         // bands
-         kwl.add(prefix,
-                 ossimKeywordNames::NUMBER_INPUT_BANDS_KW,
-                 getNumberOfInputBands());
-
-         // bands
-         kwl.add(prefix,
-                 ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
-                 getNumberOfOutputBands());
-   
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "\nminLon:             " << m_AdrgHeader->minLon()
-               << "\nminLond:            " << m_AdrgHeader->minLongitude() 
-               << "\nminLat:             " << m_AdrgHeader->minLat()
-               << "\nminLatd:            " << m_AdrgHeader->minLatitude()
-               << "\nmaxLon:             " << m_AdrgHeader->maxLon()
-               << "\nmaxLond:            " << m_AdrgHeader->maxLongitude()
-               << "\nmaxLat:             " << m_AdrgHeader->maxLat()
-               << "\nmaxLatd:            " << m_AdrgHeader->maxLatitude()
-               << "\nstartRow:           " << m_AdrgHeader->startRow()
-               << "\nstartCol:           " << m_AdrgHeader->startCol()
-               << "\nstopRow:            " << m_AdrgHeader->stopRow()
-               << "\nstopCol:            " << m_AdrgHeader->stopCol()
-               << "\nfull image lines:   " << lines
-               << "\nfull image samples: " << samples
-               << "\nkwl:\n"               << kwl
-               << std::endl;
-         }
-
-         ossimProjection* new_proj = ossimProjectionFactoryRegistry::instance()->createProjection(kwl);
-         theGeometry = new ossimImageGeometry;
-         theGeometry->setProjection(new_proj);  // assumes management of projection instance
-         
-      } // matches (after getExternalImageGeometry()):  if ( !theGeometry ) 
-      
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-      
-   } // matches: if ( !theGeometry )
-
-   return theGeometry;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossimScalarType ossimAdrgTileSource::getOutputScalarType() const
-{
-  return OSSIM_UCHAR;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimAdrgTileSource::getTileWidth() const
-{
-   return ( m_Tile.valid() ? m_Tile->getWidth() : 0 );
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimAdrgTileSource::getTileHeight() const
-{
-   return ( m_Tile.valid() ? m_Tile->getHeight() : 0 );
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimAdrgTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if ( (reduced_res_level == 0) && m_AdrgHeader )
-   {
-      return (m_AdrgHeader->stopRow() - m_AdrgHeader->startRow()) + 1;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfLines(reduced_res_level);
-   }
-
-   return 0;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimAdrgTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   if ( (reduced_res_level == 0) && m_AdrgHeader )
-   {
-      return (m_AdrgHeader->stopCol() - m_AdrgHeader->startCol()) + 1;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfSamples(reduced_res_level);
-   }
-
-   return 0;
-}
-
-ossim_uint32 ossimAdrgTileSource::getImageTileWidth() const
-{
-   return ADRG_TILE_WIDTH;
-}
-
-ossim_uint32 ossimAdrgTileSource::getImageTileHeight() const
-{
-   return ADRG_TILE_HEIGHT;
-}
-
-ossimRefPtr<ossimProperty> ossimAdrgTileSource::getProperty(const ossimString& name)const
-{
-	if(name == "file_type")
-	{
-		return new ossimStringProperty(name, "ADRG");
-	}
-	
-	return ossimImageHandler::getProperty(name);
-}
-
-void ossimAdrgTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-	ossimImageHandler::getPropertyNames(propertyNames);
-	propertyNames.push_back("file_type");
-}
-
-ossimString ossimAdrgTileSource::getShortName()const
-{
-   return ossimString("adrg");
-}
-
-ossimString ossimAdrgTileSource::getLongName()const
-{
-   return ossimString("adrg reader");
-}
-
-ossim_uint32 ossimAdrgTileSource::getNumberOfInputBands() const
-{
-   return m_AdrgHeader->numberOfBands();
-}
-
-bool ossimAdrgTileSource::isOpen()const
-{
-   return (m_AdrgHeader!=0);
-}
-
-void ossimAdrgTileSource::adjustToStartOfTile(ossimIpt& pt) const
-{
-   pt.x &= 0xffffff80;
-   pt.y &= 0xffffff80;
-}
diff --git a/ossim/src/ossim/imaging/ossimAnnotationLineObject.cpp b/ossim/src/ossim/imaging/ossimAnnotationLineObject.cpp
deleted file mode 100644
index c6f3c7f..0000000
--- a/ossim/src/ossim/imaging/ossimAnnotationLineObject.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimAnnotationLineObject.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimAnnotationLineObject.h>
-#include <ossim/imaging/ossimRgbImage.h>
-
-RTTI_DEF1(ossimAnnotationLineObject,
-          "ossimAnnotationLineObject",
-          ossimAnnotationObject)
-
-ossimAnnotationLineObject::ossimAnnotationLineObject()
-   :ossimAnnotationObject(),
-    theStart(0,0),
-    theEnd(0,0),
-    theBoundingRect(0,0,0,0)
-{
-}
-
-ossimAnnotationLineObject::ossimAnnotationLineObject(const ossimIpt& start,
-                                                     const ossimIpt& end,
-                                                     unsigned char r,
-                                                     unsigned char g,
-                                                     unsigned char b,
-                                                     long thickness)
-   :ossimAnnotationObject(r, g, b, thickness),
-    theStart(start),
-    theEnd(end)
-{
-   computeBoundingRect();
-}
-
-ossimAnnotationLineObject::ossimAnnotationLineObject(long x1,
-                                                     long y1,
-                                                     long x2,
-                                                     long y2,
-                                                     unsigned char r,
-                                                     unsigned char g,
-                                                     unsigned char b,
-                                                     long thickness)
-   :ossimAnnotationObject(r, g, b, thickness),
-    theStart(x1, y1),
-    theEnd(x2, y2)
-{
-   computeBoundingRect();
-}
-
-ossimAnnotationLineObject::ossimAnnotationLineObject(const ossimAnnotationLineObject& rhs)
-      :ossimAnnotationObject(rhs),
-       theStart(rhs.theStart),
-       theEnd(rhs.theEnd),
-       theBoundingRect(rhs.theBoundingRect)
-{
-}
-
-ossimObject* ossimAnnotationLineObject::dup()const
-{
-   return new ossimAnnotationLineObject(*this);
-}
-
-void ossimAnnotationLineObject::applyScale(double x, double y)
-{
-   theStart.x = ossim::round<int>(theStart.x*x);
-   theStart.y = ossim::round<int>(theStart.y*y);
-   theEnd.x   = ossim::round<int>(theEnd.x*x);
-   theEnd.y   = ossim::round<int>(theEnd.y*y);
-   computeBoundingRect();
-}
-
-ossimAnnotationObject* ossimAnnotationLineObject::getNewClippedObject(const ossimDrect& rect)const
-{
-   ossimAnnotationLineObject* result = (ossimAnnotationLineObject*)NULL;
-   ossimDpt start = theStart;
-   ossimDpt end   = theEnd;
-   
-   if(rect.clip(start, end))
-   {
-      result = (ossimAnnotationLineObject*)dup();
-      result->setLine(start, end);
-   }
-   
-   return result;
-}
-
-bool ossimAnnotationLineObject::intersects(const ossimDrect& rect)const
-{
-   ossimDpt start = theStart;
-   ossimDpt end   = theEnd;
-   
-   return rect.clip(start, end);
-}
-
-void ossimAnnotationLineObject::draw(ossimRgbImage& anImage)const
-{
-   if(anImage.getImageData().valid())
-   {
-      anImage.setDrawColor(theRed, theGreen, theBlue);
-      anImage.setThickness(theThickness);
-      ossimDrect imageRect = anImage.getImageData()->getImageRectangle();
-      ossimDpt start = theStart;
-      ossimDpt end   = theEnd;
-      
-      if(anImage.getImageData().valid())
-      {
-         // we need to extend it by a couple of pixels since
-         // if a pixel lies on the edge and then another pixel is just off
-         // the edge we will get a stair step and so for several pixels
-         // the line might be inside the image rectangle but the clip
-         // algorithm will only draw 1 pixel since it thinks the first
-         // point is inside and the second point is outside and will
-         // execute the clip algorithm keeping only the first
-         // point.
-         ossimDrect clipRect(imageRect.ul().x - 10,
-                             imageRect.ul().y - 10,
-                             imageRect.lr().x + 10,
-                             imageRect.lr().y + 10);
-         // now we can draw.
-         if(clipRect.clip(start, end))
-         {
-            anImage.drawLine(ossimIpt((int)start.x,
-                                      (int)start.y),
-                             ossimIpt((int)end.x,
-                                      (int)end.y));
-         }
-      }
-   }
-}
-
-std::ostream& ossimAnnotationLineObject::print(std::ostream& out)const
-{
-   out << "line_start:    " << theStart << endl
-       << "line_end:      " << theEnd   << endl
-       << "bounding_rect: " << theBoundingRect << endl;
-   return out;
-}
-
-void ossimAnnotationLineObject::getBoundingRect(ossimDrect& rect)const
-{
-   rect = theBoundingRect;
-}
-
-void ossimAnnotationLineObject::computeBoundingRect()
-{
-   vector<ossimDpt> pts(2);
-      
-   pts[0] = theStart;
-   pts[1] = theEnd;
-
-   theBoundingRect = ossimDrect(pts);
-}
-
-void ossimAnnotationLineObject::setLine(const ossimDpt& start,
-                                        const ossimDpt& end)
-{
-   theStart = start;
-   theEnd   = end;
-   computeBoundingRect();
-}
-void ossimAnnotationLineObject::getLine(ossimDpt& start, ossimDpt& end)
-{
-   start = theStart;
-   end   = theEnd;
-}
-
-bool ossimAnnotationLineObject::isPointWithin(const ossimDpt& point)const
-{
-  if(theBoundingRect.pointWithin(point))
-  {
-    // we will use the implicit form of a line to determine if the point is
-    // on the line.  For now we will just return true if it is within the 
-    // bounding rect.
-    return true;
-  }
-
-  return false;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimAnnotationMultiLineObject.cpp b/ossim/src/ossim/imaging/ossimAnnotationMultiLineObject.cpp
deleted file mode 100644
index f0231a7..0000000
--- a/ossim/src/ossim/imaging/ossimAnnotationMultiLineObject.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimAnnotationMultiLineObject.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimAnnotationMultiLineObject.h>
-
-RTTI_DEF1(ossimAnnotationMultiLineObject,
-          "ossimAnnotationMultiLineObject",
-          ossimAnnotationObject);
-
-void ossimAnnotationMultiLineObject::draw(ossimRgbImage& anImage)const
-{
-   if(anImage.getImageData().valid())
-   {
-      anImage.setDrawColor(theRed, theGreen, theBlue);
-      anImage.setThickness(theThickness);
-      ossimDrect imageRect = anImage.getImageData()->getImageRectangle();
-
-      
-      
-      if(theBoundingRect.intersects(imageRect))
-      {
-         // we need to extend it by a couple of pixels since
-         // if a pixel lies on the edge and then another pixel is just off
-         // the edge we will get a stair step and so for several pixels
-         // the line might be inside the image rectangle but the clip
-         // algorithm will only draw 1 pixel since it thinks the first
-         // point is inside and the second point is outside and will
-         // execute the clip algorithm keeping only the first
-         // point.
-         ossimDrect clipRect(imageRect.ul().x - 10,
-                             imageRect.ul().y - 10,
-                             imageRect.lr().x + 10,
-                             imageRect.lr().y + 10);
-         
-         for(ossim_uint32 i = 0; i < thePolyLineList.size(); ++i)
-         {
-            const vector<ossimDpt>& vList = thePolyLineList[i].getVertexList();
-            
-            if(vList.size() == 1)
-            {
-               anImage.drawLine(ossimIpt(vList[0]),
-                                ossimIpt(vList[0]));
-            }
-            else
-            {
-               for(ossim_uint32 i2 = 0; i2 < (vList.size()-1); ++i2)
-               {
-                  ossimDpt start = vList[i2];
-                  ossimDpt end   = vList[i2+1];
-                  // now we can draw.
-                  if(clipRect.clip(start, end))
-                  {
-                     anImage.drawLine(ossimIpt((int)start.x,
-                                               (int)start.y),
-                                      ossimIpt((int)end.x,
-                                               (int)end.y));
-                  }
-               }
-            }
-         }
-      }
-   }
-}
-
-bool ossimAnnotationMultiLineObject::intersects(const ossimDrect& rect)const
-{
-
-   for(ossim_uint32 i = 0; i < thePolyLineList.size(); ++i)
-   {
-      if(thePolyLineList[i].isWithin(rect))
-      {
-         return true;
-      }
-   }
-   return false;
-}
-
-
-void ossimAnnotationMultiLineObject::applyScale(double x,
-                                                double y)
-{
-   for(ossim_uint32 i=0; i < thePolyLineList.size(); ++i)
-   {
-      vector<ossimDpt>& vList = thePolyLineList[i].getVertexList();
-      
-      for(ossim_uint32 i2 = 0; i2 < vList.size(); ++i2)
-      {
-         vList[i].x *= x;
-         vList[i].y *= y;
-         vList[i].x *= x;
-         vList[i].y *= y;
-      }
-   }
-   theBoundingRect *= ossimDpt(x, y);
-}
-
-ossimAnnotationObject* ossimAnnotationMultiLineObject::getNewClippedObject(const ossimDrect& rect)const
-{
-   ossimAnnotationMultiLineObject* result = (ossimAnnotationMultiLineObject*)NULL;
-
-   if(intersects(rect))
-   {
-      vector<ossimPolyLine> lineList;
-      vector<ossimPolyLine> tempResult;
-      
-      ossimDrect clipRect(rect.ul().x - 10,
-                          rect.ul().y - 10,
-                          rect.lr().x + 10,
-                          rect.lr().y + 10);
-
-      for(ossim_uint32 i =0; i< thePolyLineList.size();++i)
-      {
-         if(thePolyLineList[i].clipToRect(tempResult, clipRect))
-         {
-            lineList.insert(lineList.end(),
-                            tempResult.begin(),
-                            tempResult.end());
-         }
-      }
-      
-      if(lineList.size() > 0)
-      {
-         result = new ossimAnnotationMultiLineObject(lineList,
-                                                     theRed,
-                                                     theGreen,
-                                                     theBlue,
-                                                     theThickness);
-      }
-   }
-   
-   return result;
-}
-
-bool ossimAnnotationMultiLineObject::isPointWithin(const ossimDpt& imagePoint)const
-{
-   for(ossim_uint32 i=0; i < thePolyLineList.size(); ++i)
-   {
-      if(thePolyLineList[i].isPointWithin(imagePoint))
-      {
-         return true;
-      }
-      
-   }
-
-   return false;
-}
-
-void ossimAnnotationMultiLineObject::computeBoundingRect()
-{
-   theBoundingRect.makeNan();
-   
-   if(thePolyLineList.size() == 1)
-   {
-      theBoundingRect = thePolyLineList[0].getBoundingRect();
-   }
-   else if(thePolyLineList.size() > 1)
-   {
-      for(ossim_uint32 i = 0; i < thePolyLineList.size(); ++i)
-      {
-         ossimDrect rect = thePolyLineList[i].getBoundingRect();
-         if(theBoundingRect.hasNans())
-         {
-            theBoundingRect = rect;
-         }
-         else if(!rect.hasNans())
-         {
-            theBoundingRect = theBoundingRect.combine(rect);
-         }
-      }
-   }
-}
-
-std::ostream& ossimAnnotationMultiLineObject::print(std::ostream& out)const
-{
-   ossimAnnotationObject::print(out);
-
-   for(ossim_uint32 i = 0; i < thePolyLineList.size();++i)
-   {
-      out << thePolyLineList[i] << endl
-          <<"______________________________________"<<endl;
-   }
-   return out;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimAnnotationObject.cpp b/ossim/src/ossim/imaging/ossimAnnotationObject.cpp
deleted file mode 100644
index 792e919..0000000
--- a/ossim/src/ossim/imaging/ossimAnnotationObject.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See LICENSE.txt file in the top level directory.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimAnnotationObject.cpp 9094 2006-06-13 19:12:40Z dburken $
-#include <ossim/imaging/ossimAnnotationObject.h>
-
-RTTI_DEF1(ossimAnnotationObject, "ossimAnnotationObject", ossimObject)
-
-ossim_uint32 ossimAnnotationObject::theIdCounter = 0;
-
-ossimAnnotationObject::~ossimAnnotationObject()
-{}
-
-void ossimAnnotationObject::restIdCounter()
-{
-  theIdCounter = 0;
-}
-
-ossim_uint32 ossimAnnotationObject::getNextId()
-{
-  ossim_uint32 id = theIdCounter;
-  ++theIdCounter;
-  return id;
-}
-
-ossimAnnotationObject::ossimAnnotationObject(ossim_uint8 r,
-                                             ossim_uint8 g,
-                                             ossim_uint8 b,
-                                             ossim_uint8 thickness)
-   :theRed(r),
-    theGreen(g),
-    theBlue(b),
-    theThickness(thickness)
-{
-  theId = getNextId();
-}
-
-void ossimAnnotationObject::setColor(ossim_uint8 r,
-                                     ossim_uint8 g,
-                                     ossim_uint8 b)
-{
-   theRed    = r;
-   theGreen = g;
-   theBlue   = b;
-}
-
-void ossimAnnotationObject::setThickness(ossim_uint8 thickness)
-{
-   theThickness = thickness;
-}
-
-void ossimAnnotationObject::getColor(ossim_uint8 &r,
-                                     ossim_uint8 &g,
-                                     ossim_uint8 &b)const
-{
-   r = theRed;
-   g = theGreen;
-   b = theBlue;
-}
-
-ossim_uint8 ossimAnnotationObject::getThickness()const
-{
-   return theThickness;
-}
-
-ossim_uint32 ossimAnnotationObject::getId()const
-{
-  return theId;
-}
-
-ossim_uint32 ossimAnnotationObject::setId()
-{
-  theId = getNextId();
-  return getId();
-}
-
-bool ossimAnnotationObject::saveState(ossimKeywordlist& kwl,
-                                      const char* prefix) const
-{
-   kwl.add(prefix, "red",       theRed);
-   kwl.add(prefix, "green",     theGreen);
-   kwl.add(prefix, "blue",      theBlue);
-   kwl.add(prefix, "thickness", theThickness);
-   
-   return ossimObject::saveState(kwl, prefix);
-}
-
-bool ossimAnnotationObject::loadState(const ossimKeywordlist& kwl,
-                                      const char* prefix)
-{
-   const char* red       = kwl.find(prefix, "red");
-   const char* green     = kwl.find(prefix, "green");
-   const char* blue      = kwl.find(prefix, "blue");
-   const char* thickness = kwl.find(prefix, "thickness");
-
-   if(red)
-   {
-      theRed = (ossim_uint8)ossimString(red).toLong();
-   }
-   if(green)
-   {
-      theGreen = (ossim_uint8)ossimString(green).toLong();
-   }
-   if(blue)
-   {
-      theBlue = (ossim_uint8)ossimString(blue).toLong();
-   }
-   if(thickness)
-   {
-      theThickness = (ossim_uint8)ossimString(thickness).toLong();
-   }
-   
-   return ossimObject::loadState(kwl, prefix);
-}
-
-bool ossimAnnotationObject::isPointWithin(const ossimDpt& /* imagePoint */) const
-{
-   return false;
-}
-
-ossimString ossimAnnotationObject::getName()const
-{
-   return theName;
-}
-
-void ossimAnnotationObject::setName(const ossimString& name)
-{
-   theName = name;
-}
-
-ossimDrect ossimAnnotationObject::getBoundingRect()const
-{
-   ossimDrect rect;
-   getBoundingRect(rect);
-   return rect;
-}
-
-void ossimAnnotationObject::applyScale(const ossimDpt& scale)
-{
-   applyScale(scale.x,
-              scale.y);
-}
-
-std::ostream& ossimAnnotationObject::print(ostream& out) const
-{
-   
-   out << setw(15)<<setiosflags(ios::left)<<"Red:" << (long)theRed   << endl
-       <<  setw(15)<<setiosflags(ios::left)<<"Green:" << (long)theGreen << endl
-       <<  setw(15)<<setiosflags(ios::left)<<"Blue" << (long)theBlue << endl
-       <<  setw(15)<<setiosflags(ios::left)<<"Thickness:"<<theThickness
-       << "color_red:   " << (long)theRed       << endl
-       << "color_green: " << (long)theGreen     << endl
-       << "color_blue:  " << (long)theBlue      << endl
-       << "thickness:   " << theThickness << endl;
-   return out;
-}
diff --git a/ossim/src/ossim/imaging/ossimAppFixedTileCache.cpp b/ossim/src/ossim/imaging/ossimAppFixedTileCache.cpp
deleted file mode 100644
index 13e566a..0000000
--- a/ossim/src/ossim/imaging/ossimAppFixedTileCache.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-//******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: This file contains the Application cache algorithm
-//
-//***********************************
-// $Id: ossimAppFixedTileCache.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <algorithm>
-#include <sstream>
-#include <ossim/imaging/ossimAppFixedTileCache.h>
-#include <ossim/imaging/ossimFixedTileCache.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimTrace.h>
-#include <OpenThreads/ScopedLock>
-
-ossimAppFixedTileCache* ossimAppFixedTileCache::theInstance = 0;
-ossimAppFixedTileCache::ossimAppFixedCacheId ossimAppFixedTileCache::theUniqueAppIdCounter = 0;
-const ossim_uint32 ossimAppFixedTileCache::DEFAULT_SIZE = 1024*1024*80;
-
-static const ossimTrace traceDebug("ossimAppFixedTileCache:debug");
-std::ostream& operator <<(std::ostream& out, const ossimAppFixedTileCache& rhs)
-{
-   std::map<ossimAppFixedTileCache::ossimAppFixedCacheId, ossimFixedTileCache*>::const_iterator iter = rhs.theAppCacheMap.begin();
-
-   if(iter == rhs.theAppCacheMap.end())
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "***** APP CACHE EMPTY *****" << endl;
-   }
-   else
-   {
-      while(iter != rhs.theAppCacheMap.end())
-      {
-         out << "Cache id = "<< (*iter).first << " size = " << (*iter).second->getCacheSize() << endl;
-         ++iter;
-      }
-   }
-
-   return out;
-}
-
-
-ossimAppFixedTileCache::ossimAppFixedTileCache()
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimAppFixedTileCache::ossimAppFixedTileCache() DEBUG: entered ..." << std::endl;
-   }
-   theInstance = this;
-   theTileSize = ossimIpt(64, 64);
-   theCurrentCacheSize = 0;
-
-   // ossim::defaultTileSize(theTileSize);
-   
-   ossim_uint32 cacheSize = ossimString(ossimPreferences::instance()->findPreference("cache_size")).toUInt32()*(1024*1024);
-   const char* tileSize = ossimPreferences::instance()->findPreference("tile_size");
-   if(tileSize)
-   {
-      ossimString tempString(tileSize);
-      std::vector<ossimString> splitString;
-      tempString = tempString.trim();
-      tempString.split(splitString, " ");
-      if(splitString.size() > 1)
-      {
-         theTileSize.x = splitString[0].toInt32();
-         theTileSize.y = splitString[1].toInt32();
-      }
-      else 
-      {
-         theTileSize = ossimIpt(64,64);
-      }
-         
-    }
-   if(cacheSize)
-   {
-      setMaxCacheSize(cacheSize);
-   }
-   else
-   {
-      setMaxCacheSize(DEFAULT_SIZE);
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG: cache tile size = " << theTileSize << std::endl
-         << "Cache size = " << cacheSize << " bytes" << std::endl;
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimAppFixedTileCache::ossimAppFixedTileCache() DEBUG: leaving ..." << std::endl;
-   }
-}
-
-ossimAppFixedTileCache::~ossimAppFixedTileCache()
-{
-   deleteAll();
-}
-
-ossimAppFixedTileCache *ossimAppFixedTileCache::instance(ossim_uint32  maxSize)
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimAppFixedTileCache;
-      if(maxSize)
-	{
-	  theInstance->setMaxCacheSize(maxSize);
-	}
-   }
-   return theInstance;
-}
-
-void ossimAppFixedTileCache::setMaxCacheSize(ossim_uint32 cacheSize)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   theMaxGlobalCacheSize = cacheSize;
-   theMaxCacheSize = cacheSize;
-   //   theMaxCacheSize      = (ossim_uint32)(theMaxGlobalCacheSize*.2);
-}
-
-void ossimAppFixedTileCache::flush()
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator currentIter = theAppCacheMap.begin();
-   
-   while(currentIter != theAppCacheMap.end())
-   {
-      (*currentIter).second->flush();
-      ++currentIter;
-   }
-   theCurrentCacheSize = 0;
-}
-
-void ossimAppFixedTileCache::flush(ossimAppFixedCacheId cacheId)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimFixedTileCache* cache = getCache(cacheId);
-   {
-      if(cache)
-      {
-         theCurrentCacheSize -= cache->getCacheSize();
-         cache->flush();
-      }
-   }
-}
-
-void ossimAppFixedTileCache::deleteCache(ossimAppFixedCacheId cacheId)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimRefPtr<ossimFixedTileCache> cache = getCache(cacheId);
-   {
-      std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator iter = theAppCacheMap.find(cacheId);
-      
-      if(cache.valid())
-      {
-         theAppCacheMap.erase(iter);
-         theCurrentCacheSize -= cache->getCacheSize();
-      }
-      cache = 0;
-   }
-}
-
-ossimAppFixedTileCache::ossimAppFixedCacheId ossimAppFixedTileCache::newTileCache(const ossimIrect& tileBoundaryRect,
-                                                                                  const ossimIpt& tileSize)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimAppFixedCacheId result = -1; 
-   ossimFixedTileCache* newCache = new ossimFixedTileCache;
-   if(tileSize.x == 0 ||
-      tileSize.y == 0)
-   {
-      // newCache->setRect(tileBoundaryRect, theTileSize);
-      newCache->setRect(tileBoundaryRect,
-                        newCache->getTileSize());
-   }
-   else
-   {
-      newCache->setRect(tileBoundaryRect, tileSize);
-   }
-   result = theUniqueAppIdCounter;
-   theAppCacheMap.insert(std::make_pair(result, newCache));
-   ++theUniqueAppIdCounter;
-   
-   return result;
-}
-
-ossimAppFixedTileCache::ossimAppFixedCacheId ossimAppFixedTileCache::newTileCache()
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimAppFixedCacheId result = -1;
-   ossimFixedTileCache* newCache = new ossimFixedTileCache;
-   
-   {
-      result = theUniqueAppIdCounter;
-      theAppCacheMap.insert(std::make_pair(result, newCache));
-      ++theUniqueAppIdCounter;
-   }
-   
-   return result;
-   
-}
-
-void ossimAppFixedTileCache::setRect(ossimAppFixedCacheId cacheId,
-                                     const ossimIrect& boundaryTileRect)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimFixedTileCache* cache = getCache(cacheId);
-   if(cache)
-   {
-      
-      ossim_uint32 cacheSize = cache->getCacheSize();
-      // cache->setRect(boundaryTileRect, theTileSize);
-      cache->setRect(boundaryTileRect,
-                     cache->getTileSize());      
-      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
-   }
-}
-
-void ossimAppFixedTileCache::setTileSize(ossimAppFixedCacheId cacheId,
-                                         const ossimIpt& tileSize)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimFixedTileCache* cache = getCache(cacheId);
-   if(cache)
-   {
-      ossim_uint32 cacheSize = cache->getCacheSize();
-      cache->setRect(cache->getTileBoundaryRect(), tileSize);
-      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
-      theTileSize = cache->getTileSize();
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimAppFixedTileCache::getTile(
-   ossimAppFixedCacheId cacheId,
-   const ossimIpt& origin)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimRefPtr<ossimImageData> result = 0;
-   ossimFixedTileCache* cache = getCache(cacheId);
-   if(cache)
-   {
-      result = cache->getTile(origin);
-   }
-
-   return result;
-}
-
-
-ossimRefPtr<ossimImageData> ossimAppFixedTileCache::addTile(
-                                                            ossimAppFixedCacheId cacheId,
-                                                            ossimRefPtr<ossimImageData> data,
-                                                            bool duplicateData)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimRefPtr<ossimImageData> result = 0;
-   ossimFixedTileCache *aCache = this->getCache(cacheId);
-   if(!aCache)
-   {         
-      return result;
-   }
-   ossim_uint32 dataSize = data->getDataSizeInBytes();
-
-   if( (theCurrentCacheSize+dataSize) > theMaxGlobalCacheSize)
-   {
-      shrinkGlobalCacheSize((ossim_int32)(theMaxGlobalCacheSize*0.1));
-   }
-
-   ossim_uint32 cacheSize = 0;
-   {
-      cacheSize = aCache->getCacheSize();
-   }
-   if(cacheSize > theMaxCacheSize)
-   {
-//       shrinkCacheSize(aCache,
-//                       (ossim_int32)(aCache->getCacheSize()*.1));
-      shrinkCacheSize(aCache,
-                      (ossim_int32)(1024*1024));
-   }
-   {
-      cacheSize = aCache->getCacheSize();
-      result    = aCache->addTile(data, duplicateData);
-   
-      theCurrentCacheSize += (aCache->getCacheSize() - cacheSize);
-   }
-   
-   return result;
-}
-
-void ossimAppFixedTileCache::deleteAll()
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   theCurrentCacheSize = 0;
-   theAppCacheMap.clear();
-}
-
-ossimRefPtr<ossimImageData> ossimAppFixedTileCache::removeTile(
-   ossimAppFixedCacheId cacheId,
-   const ossimIpt& origin)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimRefPtr<ossimImageData> result = 0;
-   
-   ossimFixedTileCache* cache = getCache(cacheId);
-   if(cache)
-   {
-      ossim_uint32 cacheSize = cache->getCacheSize();
-      result = cache->removeTile(origin);
-      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
-   }
-
-   return result;
-}
-
-void ossimAppFixedTileCache::deleteTile(ossimAppFixedCacheId cacheId,
-                                        const ossimIpt& origin)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimFixedTileCache* cache = getCache(cacheId);
-   if(cache)
-   {
-      ossim_uint32 cacheSize = cache->getCacheSize();
-      cache->deleteTile(origin);
-      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
-   }
-}
-
-ossimFixedTileCache* ossimAppFixedTileCache::getCache(
-   ossimAppFixedCacheId cacheId)
-{   
-   std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::const_iterator
-      currentIter = theAppCacheMap.find(cacheId);
-   ossimFixedTileCache* result = 0;
-   
-   if(currentIter != theAppCacheMap.end())
-   {
-      result = (*currentIter).second;
-   }
-
-   return result;
-}
-
-void ossimAppFixedTileCache::shrinkGlobalCacheSize(ossim_int32 byteCount)
-{
-   if(static_cast<ossim_uint32>(byteCount) >= theCurrentCacheSize)
-   {
-      flush();
-   }
-   else
-   {
-      while(byteCount > 0)
-      {
-         std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator iter = theAppCacheMap.begin();
-         while( (iter != theAppCacheMap.end())&&(byteCount>0))
-         {
-            ossimFixedTileCache* cache = getCache((*iter).first);
-            if(cache)
-            {
-               ossim_uint32 before = cache->getCacheSize();
-               cache->deleteTile();
-               ossim_uint32 after = cache->getCacheSize();
-               ossim_uint32 delta = (before - after);
-               byteCount -= delta;
-               theCurrentCacheSize -= (delta);
-            }
-            ++iter;
-         }
-      }
-   }
-}
-
-void ossimAppFixedTileCache::shrinkCacheSize(ossimAppFixedCacheId id,
-                                             ossim_int32 byteCount)
-{
-   ossimFixedTileCache* cache = getCache(id);
-
-   if(cache)
-   {
-      shrinkCacheSize(cache, byteCount);
-   }
-}
-
-void ossimAppFixedTileCache::shrinkCacheSize(ossimFixedTileCache* cache,
-                                             ossim_int32 byteCount)
-{
-   if(cache)
-   {
-      ossim_int32 cacheSize = cache->getCacheSize();
-      if(cacheSize <= byteCount)
-      {
-         cache->flush();
-      }
-      else
-      {
-         while(byteCount > 0)
-         {
-            ossim_uint32 before = cache->getCacheSize();
-            cache->deleteTile();
-            ossim_uint32 after = cache->getCacheSize();
-            ossim_uint32 delta = std::abs((int)(before - after));
-            if(delta)
-            {
-               byteCount -= delta;
-               theCurrentCacheSize -= (delta);
-            }
-            else
-            {
-               byteCount = 0;
-            }
-         }
-      }
-   }
-}
-
-const ossimIpt& ossimAppFixedTileCache::getTileSize(ossimAppFixedCacheId cacheId)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-   ossimFixedTileCache* cache = getCache(cacheId);
-   if(cache)
-   {
-      return cache->getTileSize();
-   }
-   return theTileSize;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimAppTileCache.cpp b/ossim/src/ossim/imaging/ossimAppTileCache.cpp
deleted file mode 100644
index f4c92ee..0000000
--- a/ossim/src/ossim/imaging/ossimAppTileCache.cpp
+++ /dev/null
@@ -1,303 +0,0 @@
-//******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: This file contains the Application cache algorithm
-//
-//***********************************
-// $Id: ossimAppTileCache.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimAppTileCache.h>
-#include <ossim/imaging/ossimTileCache.h>
-#include <ossim/base/ossimDataObject.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPreferences.h>
-
-ossimAppTileCache* ossimAppTileCache::theInstance = 0;
-
-// we will need to grab this from the preferences
-const ossim_uint32 ossimAppTileCache::DEFAULT_SIZE          = 80*1024*1024;
-const ossim_uint32 ossimAppTileCache::DEFAULT_BUCKET_SIZE          = 293;
-ossimAppTileCache::ossimAppCacheId ossimAppTileCache::theUniqueAppIdCounter = 1;
-
-ossimAppTileCache *ossimAppTileCache::instance(ossim_uint32  maxSize)
-{
-   if(!theInstance)
-   {
-      if(maxSize < 1)
-      {
-         ossimString cacheSize = ossimPreferences::instance()->findPreference("cache_size");
-         if(cacheSize!="")
-         {
-            maxSize = cacheSize.toUInt32()*1024*1024;
-         }
-         else
-         {
-            maxSize = DEFAULT_SIZE;
-         }
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "Setting SIZE----------------------- " << maxSize << std::endl;
-      }
-      theInstance = new ossimAppTileCache(maxSize);
-   }
-
-   return theInstance;
-}
-
-ossimAppTileCache::~ossimAppTileCache()
-{
-   deleteAll();
-}
-
-ossimAppTileCache::ossimAppCacheId ossimAppTileCache::newTileCache(ossim_uint32 bucketSize)
-{
-   ossimTileCache *aCache = 0;
-   ossimAppCacheId result = 0;
-
-   aCache = new ossimTileCache(bucketSize);
-
-   if(aCache)
-   {
-      theAppCache.insert(make_pair(theUniqueAppIdCounter, aCache));
-      result = theUniqueAppIdCounter;
-      ++theUniqueAppIdCounter;
-   }
-
-   return result;
-}
-
-/*!
- * Will retrieve a tile from the cache.
- */
-ossimDataObject *ossimAppTileCache::get(ossimAppCacheId id,
-                                        const ossimDpt3d &origin,
-                                        ossim_uint32 resLevel)
-{
-   ossimDataObject* result = 0;
-   if(id>0)
-   {
-      ossimTileCache *aCache = this->get(id);
-      if(aCache)
-      {
-         result = aCache->get(origin,
-                              resLevel);
-         if(result)
-         {
-            adjustQueue(id, origin, resLevel);
-         }
-      }
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimDataObject> ossimAppTileCache::removeTile(ossimAppCacheId id,
-                                              const ossimDpt3d &origin,
-                                              unsigned long resLevel)
-{
-   ossimRefPtr<ossimDataObject> result = 0;
-   if(id>0)
-   {
-      ossimTileCache *aCache = this->get(id);
-      if(aCache)
-      {
-         // remove from cache
-         result = aCache->remove(origin,
-                                 resLevel);
-         // adjust the byte count
-         if(result.valid())
-         {
-            theCurrentCacheSize -= result->getDataSizeInBytes();
-         }
-         removeTileFromQueue(id, origin, resLevel);
-      }
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimDataObject> ossimAppTileCache::insert(ossimAppCacheId appId,
-                                                       const ossimDpt3d &origin,
-                                                       const ossimDataObject* data,
-                                                       ossim_uint32 resLevel)
-{
-   static const char MODULE[] = "ossimAppTileCache::insert";
-   ossimDataObject *result = 0;
-
-   // find the cache and if it's not there then return NULL
-   ossimTileCache *aCache = this->get(appId);
-   if(!aCache)
-   {         
-      return result;
-   }
-   
-   ossimRefPtr<ossimDataObject> tileToInsert = 0;
-   long dataSize = data->getDataSizeInBytes();
-   
-   if( (theCurrentCacheSize+dataSize) > theMaxCacheSize)
-   {
-      do
-      {
-         ossimRefPtr<ossimDataObject> tile = removeTile();
-      }while((theCurrentCacheSize+dataSize) > theMaxCacheSize);
-   }
-
-   if(data)
-   {
-      tileToInsert = (ossimDataObject*)data->dup();
-
-      result = aCache->insert(origin,
-                              tileToInsert.get(),
-                              resLevel);
-      if(!result)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR: can't insert and should not happen"
-            << endl;
-
-         tileToInsert = 0;
-      }
-      else
-      {
-         theCurrentCacheSize += dataSize;
-         theUsedQueue.push_back(ossimAppCacheTileInfo(appId,
-                                                 origin,
-                                                 resLevel));
-      }
-   }
-
-   return result;
-}
-
-
-ossimTileCache* ossimAppTileCache::get(ossimAppCacheId id)
-{
-   ossimTileCache *result=0;
-   
-   AppIdIterator anIterator = theAppCache.find(id);
-   
-   if(anIterator != theAppCache.end())
-   {
-      result = (*anIterator).second;
-   }
-
-   return result;
-}
-
-void ossimAppTileCache::deleteCache(ossimAppCacheId appId)
-{
-   // first delete the cache
-   AppIdIterator anIterator = theAppCache.find(appId);
-   if(anIterator != theAppCache.end())
-   {
-      ossimTileCache *aCache = (*anIterator).second;
-      theCurrentCacheSize -= aCache->sizeInBytes();
-
-      delete aCache;
-
-      theAppCache.erase(anIterator);      
-   }
-   // now delete all occurences of the appCacheId in the queue
-   // used for LRU algorithm.
-   deleteAppCacheFromQueue(appId);
-}
-
-void ossimAppTileCache::deleteAll()
-{
-   AppIdIterator iter = theAppCache.begin();
-
-   while(iter != theAppCache.end())
-   {
-      delete (*iter).second;
-      ++iter;
-   }
-   
-   theAppCache.clear();
-}
-
-void ossimAppTileCache::removeTileFromQueue(ossimAppCacheId appId,
-                                       const ossimDpt3d &origin,
-                                       ossim_uint32 resLevel)
-{
-   list<ossimAppCacheTileInfo>::iterator anIterator;
-
-   anIterator = theUsedQueue.begin();
-   while(anIterator != theUsedQueue.end())
-   {
-      if( ((*anIterator).theAppCacheId == appId) &&
-          ((*anIterator).theOrigin     == origin)&&
-          ((*anIterator).theResLevel   == resLevel))
-      {
-         theUsedQueue.erase(anIterator);
-         return;
-      }
-      else
-      {
-         ++anIterator;
-      }
-   }
-}
-
-void ossimAppTileCache::deleteAppCacheFromQueue(ossimAppCacheId appId)
-{
-   list<ossimAppCacheTileInfo>::iterator anIterator;
-
-   anIterator = theUsedQueue.begin();
-   while(anIterator != theUsedQueue.end())
-   {
-      if( (*anIterator).theAppCacheId == appId)
-      {
-         anIterator = theUsedQueue.erase(anIterator);
-      }
-      else
-      {
-         ++anIterator;
-      }
-   }
-}
-
-ossimRefPtr<ossimDataObject> ossimAppTileCache::removeTile()
-{
-   ossimRefPtr<ossimDataObject> result;
-   if(!theUsedQueue.empty())
-   {
-      ossimAppCacheTileInfo &info = *(theUsedQueue.begin());
-
-      ossimTileCache *aCache = get(info.theAppCacheId);
-      if(aCache)
-      {
-         result            = aCache->remove(info.theOrigin,
-                                            info.theResLevel);
-         theCurrentCacheSize -= result->getDataSizeInBytes();
-      }
-      theUsedQueue.erase(theUsedQueue.begin());
-   }
-
-   return result;
-}
-
-void ossimAppTileCache::adjustQueue(ossimAppCacheId id,
-                                    const ossimDpt3d &origin,
-                                    ossim_uint32 resLevel)
-{
-   list<ossimAppCacheTileInfo>::iterator anIterator = theUsedQueue.begin();
-   ossimAppCacheTileInfo info(id, origin, resLevel);
-   
-   while(anIterator != theUsedQueue.end())
-   {
-     
-      if((*anIterator) == info)
-      {
-         theUsedQueue.erase(anIterator);
-         theUsedQueue.push_back(info);
-         return;
-      }
-      ++anIterator;
-   }              
-}
-
diff --git a/ossim/src/ossim/imaging/ossimArcInfoGridWriter.cpp b/ossim/src/ossim/imaging/ossimArcInfoGridWriter.cpp
deleted file mode 100644
index 5cd532c..0000000
--- a/ossim/src/ossim/imaging/ossimArcInfoGridWriter.cpp
+++ /dev/null
@@ -1,371 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimArcInfoGridWriter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstring>
-#include <cstdio>
-#include <fstream>
-#include <iostream>
-
-#include <ossim/imaging/ossimArcInfoGridWriter.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-
-#include <ossim/support_data/ossimAigStatistics.h>
-#include <ossim/support_data/ossimAigHeader.h>
-#include <ossim/support_data/ossimAigBounds.h>
-#include <ossim/support_data/ossimAigIndexFileHeader.h>
-#include <ossim/support_data/ossimAigDataFileHeader.h>
-
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-
-static const ossimTrace traceDebug("ossimArcInfoGridWriter:debug");
-
-RTTI_DEF1(ossimArcInfoGridWriter,
-          "ossimArcInfoGridWriter",
-          ossimImageFileWriter);
-
-//*******************************************************************
-// Constructor:
-//*******************************************************************
-ossimArcInfoGridWriter::ossimArcInfoGridWriter()
-   : ossimImageFileWriter(),
-     theOutputTileSize(256, 4)
-{
-}
-
-ossimArcInfoGridWriter::ossimArcInfoGridWriter(ossimImageSource* inputSource,
-                                 const ossimFilename& filename)
-   :ossimImageFileWriter(filename, inputSource)
-{
-}
-
-//*******************************************************************
-// Destructor
-//*******************************************************************
-ossimArcInfoGridWriter::~ossimArcInfoGridWriter()
-{
-   close();
-}
-
-bool ossimArcInfoGridWriter::writeFile()
-{
-   const char* MODULE = "ossimArcInfoGridWriter::writeFile";
-   if(!theInputConnection)
-   {
-      return false;
-   }
-   
-   ossimRefPtr<ossimCastTileSourceFilter> filter = new ossimCastTileSourceFilter;
-   filter->setOutputScalarType(OSSIM_FLOAT);
-   filter->connectMyInputTo(theInputConnection.get());
-   filter->initialize();
-   
-   open();
-
-   // make sure we have a region of interest
-   if(theAreaOfInterest.hasNans())
-   {
-      theInputConnection->initialize();
-      theAreaOfInterest = theInputConnection->getAreaOfInterest();
-   }
-   else
-   {
-      theInputConnection->setAreaOfInterest(theAreaOfInterest);
-   }
-   
-   if(theAreaOfInterest.hasNans()) return false;   
-   
-   theInputConnection->setTileSize(theOutputTileSize);
-   theInputConnection->setToStartOfSequence();
-   
-   bool result = writeBinaryAigHeader()&&
-                 writeBinaryAigBounds()&&
-                 writeBinaryAigStats();
-   if(result)
-   {
-      ossimFilename indexFile=ossimFilename(theFilename+"/"+"w001001x.adf");
-      ossimFilename dataFile=ossimFilename(theFilename+"/"+"w001001.adf");
-      
-      std::ofstream indexFileStream(indexFile.c_str(),
-                               ios::out|ios::binary);
-      std::ofstream dataFileStream(dataFile.c_str(),
-                              ios::out|ios::binary);
-      ossimEndian endian;
-
-      if(indexFileStream&&dataFileStream)
-      {
-         ossimAigIndexFileHeader aigIndexHeader;
-         ossimAigDataFileHeader  aigDataFileHeader;
-         
-         ossimRefPtr<ossimImageData> currentTile =
-            theInputConnection->getNextTile();
-         long tileNumber = 0;
-         long totalNumberOfTiles = theInputConnection->getNumberOfTiles();
-         ossim_int32 tileOffsetShorts = 0;
-         ossim_int32 tileSizeShorts   = 0;
-
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "Tile height  = " << theInputConnection->getTileHeight()
-            << std::endl
-            << "Tile width   = " << theInputConnection->getTileWidth()
-            << std::endl;
-         ossim_int32 tileSizeInShorts = 2*(theInputConnection->getTileHeight()*
-                                           theInputConnection->getTileWidth());
-         // Note: this is in shorts
-         //
-         aigIndexHeader.theFileSize += (4*totalNumberOfTiles);
-
-         // Note this is in shorts
-         //
-         
-         aigDataFileHeader.theFileSize = 50+
-                                         (tileSizeInShorts*totalNumberOfTiles) +
-                                         totalNumberOfTiles;
-         aigDataFileHeader.theTileSize = tileSizeInShorts;
-         
-         aigIndexHeader.writeStream(indexFileStream);
-         aigDataFileHeader.writeStream(dataFileStream);
-
-         if(traceDebug())
-         {
-            CLOG << "AIG INDEX HEADER = \n" << aigIndexHeader << std::endl;
-            CLOG << "AIG DATA FILE HEADER\n"
-                 << "file size = " << aigDataFileHeader.theFileSize
-                 << std::endl;
-         }
-         
-         while(currentTile.valid())
-         {
-            currentTile = filter->applyCast(currentTile);
-            
-            if(!currentTile->getBuf())
-            {
-               currentTile->initialize();
-            }
-
-            tileOffsetShorts = dataFileStream.tellp()/2;
-            tileSizeShorts   = 2*currentTile->getHeight()*currentTile->getWidth();
-            ossim_int16 tileSizeShorts16 = 2*currentTile->getHeight()*currentTile->getWidth();
-            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-            {
-               endian.swap(tileOffsetShorts);
-               endian.swap(tileSizeShorts);
-               endian.swap(tileSizeShorts16);
-               endian.swap((ossim_float32*)currentTile->getBuf(),
-                           currentTile->getWidth()*
-                           currentTile->getHeight());
-            }
-            
-            indexFileStream.write((char*)(&tileOffsetShorts), 4);
-            indexFileStream.write((char*)(&tileSizeShorts), 4);
-            dataFileStream.write((char*)(&tileSizeShorts16),
-                                 2);
-            dataFileStream.write((char*)(currentTile->getBuf()),
-                                 currentTile->getWidth()*currentTile->getHeight()*4);
-            
-            currentTile = theInputConnection->getNextTile();
-            ++tileNumber;
-         }
-      }
-   }
-   
-   close();
-   filter = 0;
-   return result;
-}
-
-bool ossimArcInfoGridWriter::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   return ossimImageFileWriter::saveState(kwl, prefix);
-}
-
-bool ossimArcInfoGridWriter::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   
-   return ossimImageFileWriter::loadState(kwl, prefix);
-}
-
-bool ossimArcInfoGridWriter::isOpen()const
-{
-   return (theFilename.isDir() && theFilename.exists());
-}
-
-bool ossimArcInfoGridWriter::open()
-{
-   if(theFilename.isDir()&&
-      theFilename.exists())
-   {
-      return true;
-   }
-   else
-   {
-      theFilename = theFilename.path();
-      if(theFilename.isDir()&&
-         theFilename.exists())
-      {
-         return true;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimArcInfoGridWriter::open(): Directory "
-            << theFilename << " doesn't exist" << std::endl;
-      }
-      
-   }
-   return false;   
-}
-
-void ossimArcInfoGridWriter::close()
-{
-}
-
-
-bool ossimArcInfoGridWriter::writeBinaryAigHeader()
-{
-   const char* MODULE = "ossimArcInfoGridWriter::writeBinaryAigHeader";
-   ossimAigHeader aigHeader;
-
-   ossimFilename file=ossimFilename(theFilename+"/"+"hdr.adf");
-
-   if(isOpen())
-   {
-      switch(theInputConnection->getOutputScalarType())
-      {
-         case OSSIM_UCHAR:
-         case OSSIM_SSHORT16:
-         case OSSIM_USHORT11:
-         case OSSIM_USHORT16:
-//      {
-//         aigHeader.setIntCoverage();
-//         break;
-//      }
-         case OSSIM_DOUBLE:
-         case OSSIM_FLOAT:
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            aigHeader.setFloatCoverage();
-            break;
-         }
-         default:
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimArcInfoGridWriter::writeBinaryAigHeader: "
-               << "unkown scalar type" << std::endl;
-         }
-      }
-      
-      // need to set pixel size
-      //
-
-      // code goes here
-      
-      // now setting number of tiles per row
-      aigHeader.theNumberOfTilesPerRow    = theInputConnection->getNumberOfTilesHorizontal();
-      aigHeader.theNumberOfTilesPerColumn = theInputConnection->getNumberOfTilesVertical();
-      aigHeader.theWidthOfTileInPixels    = theInputConnection->getTileWidth();
-      aigHeader.theHeightOfTileInPixels   = theInputConnection->getTileHeight();
-      
-      std::ofstream out;
-      out.open(file.c_str(), ios::out|ios::binary);
-
-      if(out)
-      {
-         if(traceDebug())
-         {
-            CLOG << "AIG_HEADER = \n" << aigHeader << std::endl;
-         }
-         return aigHeader.writeStream(out);
-      }
-   }
-   
-   return false;
-}
-
-bool ossimArcInfoGridWriter::writeBinaryAigBounds()
-{
-   const char* MODULE = "ossimArcInfoGridWriter::writeBinaryAigBounds";
-   ossimAigBounds aigBounds;
-   
-
-   // setup bounds
-   ossimIrect bounds = theInputConnection->getBoundingRect();
-   if(!bounds.hasNans())
-   {
-      aigBounds.ll_x = -.5;
-      aigBounds.ll_y = -.5;
-      aigBounds.ur_x = bounds.width()-.5;
-      aigBounds.ur_y = bounds.height()-.5;
-      
-      //
-      ossimFilename file=ossimFilename(theFilename+"/"+"dblbnd.adf");
-      
-      if(isOpen())
-      {
-         std::ofstream out;
-         out.open(file.c_str(), ios::out|ios::binary);
-         
-         if(out)
-         {
-            if(traceDebug())
-            {
-               CLOG << "AIG BOUNDS =\n" <<aigBounds << std::endl;
-            }
-            return aigBounds.writeStream(out);
-         }
-      }
-   }
-   
-   return false;
-}
-
-bool ossimArcInfoGridWriter::writeBinaryAigStats()
-{
-   ossimAigStatistics aigStats;
-
-
-   // setup bounds
-   aigStats.theMin  = theInputConnection->getMinPixelValue();
-   aigStats.theMax  = theInputConnection->getMaxPixelValue();
-   aigStats.theMean = (aigStats.theMax-aigStats.theMin)/2.0;
-
-   //
-   ossimFilename file=ossimFilename(theFilename+"/"+"sta.adf");
-
-   if(isOpen())
-   {
-      std::ofstream out;
-      out.open(file.c_str(), ios::out|ios::binary);
-      
-      if(out)
-      {
-         return aigStats.writeStream(out);
-      }
-   }
-
-   return false;
-}
-
-ossimString ossimArcInfoGridWriter::getExtension() const
-{
-   return ossimString("aig");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimAtCorrRemapper.cpp b/ossim/src/ossim/imaging/ossimAtCorrRemapper.cpp
deleted file mode 100644
index 4702b59..0000000
--- a/ossim/src/ossim/imaging/ossimAtCorrRemapper.cpp
+++ /dev/null
@@ -1,731 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kathy Minear
-//
-// Description:
-// Takes in DNs for any number of bands
-// Converts DNs to Radiance at the satellite values Lsat
-// Converts Lsat to Surface Reflectance values
-//
-//*************************************************************************
-// $Id: ossimAtCorrRemapper.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <cmath>
-
-#include <ossim/imaging/ossimAtCorrRemapper.h>
-#include <ossim/imaging/ossimAtCorrKeywords.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-
-RTTI_DEF1(ossimAtCorrRemapper, "ossimAtCorrRemapper", ossimImageSourceFilter);
-
-static ossimTrace traceDebug("ossimAtCorrRemapper:debug");
-
-ossimAtCorrRemapper::ossimAtCorrRemapper(ossimObject* owner,
-                                         ossimImageSource* inputSource,
-                                         const ossimString& sensorType)
-      :
-      ossimImageSourceFilter  (owner, inputSource),  // base class     
-      theTile                 (NULL),
-      theSurfaceReflectance   (NULL),
-      theUseInterpolationFlag(false),
-      theMinPixelValue        (0),  
-      theMaxPixelValue        (0),
-      theXaArray              (0),
-      theXbArray              (0),
-      theXcArray              (0),
-      theBiasArray            (0),
-      theGainArray            (0),
-      theCalCoefArray         (0),
-      theBandWidthArray       (0),
-      theSensorType(sensorType)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   disableSource();
-
-   initialize();
-}
-
-ossimAtCorrRemapper::~ossimAtCorrRemapper()
-{
-   if (theSurfaceReflectance)
-   {
-      delete [] theSurfaceReflectance;
-      theSurfaceReflectance = NULL;
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimAtCorrRemapper::getTile(
-   const ossimIrect& tile_rect,
-   ossim_uint32 resLevel)
-{
-#if 0
-   if (traceDebug())
-   {
-      cout << "ossimAtCorrRemapper::getTile DEBUG:"
-           << "\ntile_rect:  " << tile_rect << endl;
-   }
-#endif
-   
-   if (!isInitialized()||!theInputConnection)
-   {
-       cerr << "ossimAtCorrRemapper::getTile ERROR:"
-            << "\nNot initialized!"
-            << endl;
-       return ossimRefPtr<ossimImageData>();
-   }
-
-   if(!theTile.valid())
-   {
-      initialize();
-      if(!theTile)
-      {
-         return ossimRefPtr<ossimImageData>();
-      }
-   }
-   
-   // Fetch tile from pointer from the input source.
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tile_rect,
-                                                                       resLevel);
-
-   if (!inputTile.valid())  // Just in case...
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   // Check for remap bypass or empty / null input tile.
-   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
-   if (!theEnableFlag || tile_status == OSSIM_NULL ||
-       tile_status == OSSIM_EMPTY)
-   {
-      return inputTile;
-   }
-
-   ossim_uint32 w     = tile_rect.width();
-   ossim_uint32 h     = tile_rect.height();
-   ossim_uint32 tw    = theTile->getWidth();
-   ossim_uint32 th    = theTile->getHeight();
-   ossim_uint32 bands = theTile->getNumberOfBands();
-
-   // Set the origin of the output tile.
-   theTile->setOrigin(tile_rect.ul());
-
-   if(w*h != tw*th)
-   {
-      theTile->setWidthHeight(w, h);
-      theTile->initialize();
-      if(theSurfaceReflectance)
-      {
-         delete [] theSurfaceReflectance;
-         theSurfaceReflectance = NULL;
-      }
-   }
-   
-   if(!theSurfaceReflectance)
-   {
-      ossim_uint32 size  = tw*th*bands;
-#if 0
-      if (traceDebug())
-      {
-         cout << "ossimAtCorrRemapper::getTile DEBUG:"
-              << "\ntile_rect:    " << tile_rect
-              << "\ntile width:   " << tw
-              << "\ntile height:  " << th
-              << "\nbands:        " << bands
-              << "\nBuffer size:  " << size << endl;
-      }
-#endif
-      
-      theSurfaceReflectance = new double[size];
-   }
-
-   ossim_uint32 buffer_index = 0;
-   ossimIpt ul = tile_rect.ul();
-   ossimIpt lr = tile_rect.lr();
-   const double MP = theTile->getMinNormalizedPix(); // Minimum normalized pix.
-   double a, b, c;
-   buffer_index = 0;
-
-   cout << setprecision(6);
-   for (ossim_uint32 band=0; band < bands; ++band)
-   {
-      for(ossim_sint32 idxy = ul.y; idxy <= lr.y; ++idxy)
-      {
-         for(ossim_sint32 idxx = ul.x; idxx <= lr.x; ++idxx)
-         {
-            double p = inputTile->getPix(buffer_index);
-            
-            if (p>0.0)
-            {
-               if(!theUseInterpolationFlag)
-               {
-                  a = theXaArray[band];
-                  b = theXbArray[band];
-                  c = theXcArray[band];
-               }
-               else
-               {
-                  interpolate(ossimDpt(idxx, idxy),
-                              band,
-                              a,
-                              b,
-                              c);
-               }
-               if(theSensorType == "ls7ms")
-               {
-                  double radiance_at_satellite
-                     = (theGainArray[band] * p) + theBiasArray[band];
-                  
-                  double y =  (radiance_at_satellite * a) -  b;
-                  
-                  p = (y / (1.0 + (c * y)) );
-               }
-               else if(theSensorType == "qbms")
-               {
-                  double radiance_at_satellite
-                     = theCalCoefArray[band] * p / theBandWidthArray[band];
-                  
-                  double y =  (radiance_at_satellite * a) - b;
-                  
-                  p = (y / (1.0 + (c * y)) );
-               }
-               else if(theSensorType == "ikms")
-               {
-                  
-                 
-                  double radiance_at_satellite
-                     =   p  /((theCalCoefArray[band]/1.0)/ theBandWidthArray[band]);
-                  double y =  (radiance_at_satellite * a) -  b;
-    
-                  p = (y / (1.0 + (c * y)) );
-     
-               }  
-                   
-               // Note that "p" should now be normalized between 0.0 and 1.0;
-               
-               // ***
-               // Since it wasn't null to start with clip / clamp between minimum
-               // normalized pixel and one(max).
-               // ***
-               p =  ( p > MP ? ( p < 1.0 ? p : 1.0) : MP );
-               
-               // Scan the new tile and set the min / max.
-               if (p < theMinPixelValue[band])
-               {
-                  theMinPixelValue[band] = p;
-               }
-               else if (p > theMaxPixelValue[band])
-               {
-                  theMaxPixelValue[band] = p;
-               }
-               
-               theSurfaceReflectance[buffer_index] = p;
-            }
-            else
-            {
-               theSurfaceReflectance[buffer_index] = 0.0;  // pixel was null...
-            }
-            
-            ++buffer_index;
-            
-         }  // End of sample loop...
-         
-      } // End of line loop...
-      
-   } // End of band loop...
-
-   // Copy the buffer to the output tile at the same time unnormalizing it.
-   theTile->copyNormalizedBufferToTile(theSurfaceReflectance);
-   
-   // Validate the output to set the tile status.
-   theTile->validate();
-   
-   return theTile;
-}
-
-void ossimAtCorrRemapper::initialize()
-{
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,
-                                                          theInputConnection);
-      theTile->initialize();
-
-      if(theSurfaceReflectance)
-      {
-         delete []theSurfaceReflectance;
-         theSurfaceReflectance = NULL;
-      }
-      
-      ossim_uint32 tw    = theTile->getWidth();
-      ossim_uint32 th    = theTile->getHeight();
-      ossim_uint32 bands = theTile->getNumberOfBands();
-      ossim_uint32 size  = tw*th*bands;
-      if (traceDebug())
-      {
-         cout << "ossimAtCorrRemapper::initialize DEBUG:"
-              << "\ntile width:   " << tw
-              << "\ntile height:  " << th
-              << "\nbands:        " << bands
-              << "\nBuffer size:  " << size << endl;
-      }
-      
-      theSurfaceReflectance = new double[size];
-
-      setInitializedFlag(true);
-      clearErrorStatus();
-   }
-   else
-   {
-      setInitializedFlag(false);
-      setErrorStatus();
-   };
-
-   verifyEnabled();
-
-   if (traceDebug())
-   {
-      cout << "ossimAtCorrRemapper::initialize DEBUG:"
-           << *this
-           << endl;
-   }
-
-}
-
-bool ossimAtCorrRemapper::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   static const char MODULE[] = "ossimAtCorrRemapper::loadState()";
-
-   if (traceDebug())  CLOG << "entering..." << endl;
-
-   if (!theTile || !theSurfaceReflectance)
-   {
-      cerr << MODULE << " ERROR:"
-           << "Not initialized..." << endl;
-      return false;
-   }
-
-   ossim_uint32 bands = theTile->getNumberOfBands();
-
-   // Clear out the old values.
-   theMinPixelValue.clear();
-   theMaxPixelValue.clear();   
-   theXaArray.clear();
-   theXbArray.clear();
-   theXcArray.clear();
-   theBiasArray.clear();
-   theGainArray.clear();
-   theCalCoefArray.clear();
-   theBandWidthArray.clear();
- 
-   
-   // Now resize them.
-
-   // Start with arbitrary big number.
-   theMinPixelValue.resize(bands, 1.0);
-
-   // Start with arbitrary small number.
-   theMaxPixelValue.resize(bands, 0.0);
-
-   
-   theXaArray.resize(bands, 1.0);
-   theXbArray.resize(bands, 1.0);
-   theXcArray.resize(bands, 1.0);
-   
-   theBiasArray.resize(bands, 0.0);
-   theGainArray.resize(bands, 1.0);
-   theCalCoefArray.resize(bands);
-   theBandWidthArray.resize(bands);
-   
-   for(ossim_uint32 band = 0; band < bands; ++band)
-   {
-      const char* lookup = NULL;
-      ossimString band_string = ".band";
-      band_string += ossimString::toString(band+1);
-      
-      ossimString kw = AT_CORR_XA_KW;
-      kw += band_string;
-      lookup = kwl.find(prefix, kw.c_str());
-      if (lookup)
-      {
-         theXaArray[band] = atof(lookup);
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            CLOG << "DEBUG:"
-                 << "\nlookup failed for keyword:  " << kw.c_str() << endl;
-         }
-      }
-      
-      kw = AT_CORR_XB_KW;
-      kw += band_string;
-      lookup = kwl.find(prefix, kw.c_str());
-      if (lookup)
-      {
-         theXbArray[band] = atof(lookup);
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            CLOG << "DEBUG:"
-                 << "\nlookup failed for keyword:  " << kw.c_str()
-                 << endl;
-         }
-      }
-      
-      kw = AT_CORR_XC_KW;
-      kw += band_string;
-      lookup = kwl.find(prefix, kw.c_str());
-      if (lookup)
-      {
-         theXcArray[band] = atof(lookup);
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            CLOG << "DEBUG:"
-                 << "\nlookup failed for keyword:  " << kw.c_str()
-                 << endl;
-         }
-      }
-      
-      if(theSensorType == "ls7ms")
-      {
-         kw = AT_CORR_BIAS_KW;
-         kw += band_string;
-         lookup = kwl.find(prefix, kw.c_str());
-         if (lookup)
-         {
-            theBiasArray[band] = atof(lookup);
-         }
-         else
-         {
-            if (traceDebug())
-            {
-               CLOG << "DEBUG:"
-                    << "\nlookup failed for keyword:  " << kw.c_str()
-                    << endl;
-            }
-         }
-         
-         kw = AT_CORR_GAIN_KW;
-         kw += band_string;
-         lookup = kwl.find(prefix, kw.c_str());
-         if (lookup)
-         {
-            theGainArray[band] = atof(lookup);
-         }
-         else
-         {
-            if (traceDebug())
-            {
-               CLOG << "DEBUG:"
-                    << "\nlookup failed for keyword:  " << kw.c_str()
-                    << endl;
-            }
-         }
-      }
-      
-      if(theSensorType == "qbms")
-      {
-         kw = AT_CORR_CALCOEF_KW;
-         kw += band_string;
-         lookup = kwl.find(prefix, kw.c_str());
-         if (lookup)
-         {
-            theCalCoefArray[band] = atof(lookup);
-         }
-         else
-         {
-            if (traceDebug())
-            {
-               CLOG << "DEBUG:"
-                    << "\nlookup failed for keyword:  " << kw.c_str()
-                    << endl;
-            }
-         }
-         
-         kw = AT_CORR_BANDWIDTH_KW;
-         kw += band_string;
-         lookup = kwl.find(prefix, kw.c_str());
-         if (lookup)
-         {
-            theBandWidthArray[band] = atof(lookup);
-         }
-         else
-         {
-            if (traceDebug())
-            {
-               CLOG << "DEBUG:"
-                    << "\nlookup failed for keyword:  " << kw.c_str()
-                    << endl;
-            }
-         }
-      }
-      if(theSensorType == "ikms")
-      {
-         kw = AT_CORR_CALCOEF_KW;
-         kw += band_string;
-         lookup = kwl.find(prefix, kw.c_str());
-         if (lookup)
-         {
-            theCalCoefArray[band] = atof(lookup);
-         }
-         else
-         {
-            if (traceDebug())
-            {
-               CLOG << "DEBUG:"
-                    << "\nlookup failed for keyword:  " << kw.c_str()
-                    << endl;
-            }
-         }
-         
-         kw = AT_CORR_BANDWIDTH_KW;
-         kw += band_string;
-         lookup = kwl.find(prefix, kw.c_str());
-         if (lookup)
-         {
-            theBandWidthArray[band] = atof(lookup);
-         }
-         else
-         {
-            if (traceDebug())
-            {
-               CLOG << "DEBUG:"
-                    << "\nlookup failed for keyword:  " << kw.c_str()
-                    << endl;
-            }
-         }
-      }
-   }
-   
-   verifyEnabled();
-
-   if (theEnableFlag)
-   {
-      //***
-      // Call the base class to pick up the enable flag.  Note that this
-      // can override the state set from verifyEnabled() method.
-      //***
-      ossimString pref;
-      if (prefix) pref += prefix;
-      pref += "atmospheric_correction.";
-
-   }
-   
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << *this
-           << "returning..."
-           << endl;
-   }
-   
-   return true;
-}
-
-void ossimAtCorrRemapper::verifyEnabled()
-{
-   // Check all the pointers...
-   if ( !theInputConnection    || !theTile ||
-        !theSurfaceReflectance )
-   {
-      disableSource();
-      return;
-   }
-
-   ossim_uint32 bands = theTile->getNumberOfBands();
-   if ( (theMinPixelValue.size() != bands) ||
-        (theMaxPixelValue.size() != bands) ||
-        (theXaArray.size()       != bands) ||
-        (theXbArray.size()       != bands) ||
-        (theXcArray.size()       != bands) ||
-        (theBiasArray.size()     != bands) ||
-        (theGainArray.size()     != bands) ||
-        (theCalCoefArray.size()  != bands) ||
-        (theBandWidthArray.size()!= bands))
-   {
-      disableSource(); 
-      return;
-   }
-
-   enableSource();
-}
-
-ossimString ossimAtCorrRemapper::getShortName() const
-{
-   return ossimString("Atmospheric Correction Remapper");
-}
-
-vector<double> ossimAtCorrRemapper::getNormMinPixelValues() const
-{
-   return theMinPixelValue;
-}
-
-vector<double> ossimAtCorrRemapper::getNormMaxPixelValues() const
-{
-   return theMaxPixelValue;
-}
-
-void ossimAtCorrRemapper::getNormMinPixelValues(vector<double>& v) const
-{
-   v = theMinPixelValue;
-}
-
-void ossimAtCorrRemapper::getNormMaxPixelValues(vector<double>& v) const
-{
-   v = theMaxPixelValue;
-}
-
-const ossimString& ossimAtCorrRemapper::getSensorType() const
-{
-   return theSensorType;
-}
-
-void ossimAtCorrRemapper::setSensorType(const ossimString& sensorType)
-{
-   theSensorType = sensorType;
-}
-
-void ossimAtCorrRemapper::interpolate(const ossimDpt& /* pt */,
-                                      int band,
-                                      double& a,
-                                      double& b,
-                                      double& c)const
-{
-   a = theXaArray[band];
-   b = theXbArray[band];
-   c = theXcArray[band];
-}
-
-ostream& ossimAtCorrRemapper::print(ostream& os) const
-{
-   os << "ossimAtCorrRemapper:"
-      << "\ntheEnableFlag:  " << (theEnableFlag?"enabled":"disabled")
-      << endl;
-
-   os << setprecision(15) << setiosflags(ios::fixed);
-
-   ossim_uint32 band = 1;
-   vector<double>::const_iterator i = theMinPixelValue.begin();
-   while (i != theMinPixelValue.end())
-   {
-      os << "band[" << band << "] min:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-
-   band = 1;
-   i = theMaxPixelValue.begin();
-   while (i != theMaxPixelValue.end())
-   {
-      os << "band[" << band << "] max:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-
-   band = 1;
-   i = theXaArray.begin();
-   while (i != theXaArray.end())
-   {
-      os << "band[" << band << "] xa:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-
-   band = 1;
-   i = theXbArray.begin();
-   while (i != theXbArray.end())
-   {
-      os << "band[" << band << "] xb:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-
-   band = 1;
-   i = theXcArray.begin();
-   while (i != theXcArray.end())
-   {
-      os << "band[" << band << "] xc:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-
-   if(theSensorType == "ls7ms")
-   {
-      band = 1;
-      i = theBiasArray.begin();
-      while (i != theBiasArray.end())
-      {
-         os << "band[" << band << "] bias:  " << (*i) << endl;
-         ++i;
-         ++band;
-      }
-      
-      band = 1;
-      i = theGainArray.begin();
-      while (i != theGainArray.end())
-      {
-         os << "band[" << band << "] gain:  " << (*i) << endl;
-         ++i;
-         ++band;
-      }
-   }
-   if(theSensorType == "qbms")
-   {
-      band = 1;
-      i = theCalCoefArray.begin();
-      while (i != theCalCoefArray.end())
-      {
-         os << "band[" << band << "] calcoef:  " << (*i) << endl;
-         ++i;
-         ++band;
-      }
-
-      band = 1;
-      i = theBandWidthArray.begin();
-      while (i != theBandWidthArray.end())
-      {
-         os << "band[" << band << "] bandwidth:  " << (*i) << endl;
-         ++i;
-         ++band;
-      }
-   }
-   if(theSensorType == "ikms")
-   {
-      band = 1;
-      i = theCalCoefArray.begin();
-      while (i != theCalCoefArray.end())
-      {
-         os << "band[" << band << "] calcoef:  " << (*i) << endl;
-         ++i;
-         ++band;
-      }
-
-   }
-   return os;
-}
-
-ostream& operator<<(ostream& os, const ossimAtCorrRemapper& hr)
-{
-   return hr.print(os);
-}
-
-
-
diff --git a/ossim/src/ossim/imaging/ossimBandAverageFilter.cpp b/ossim/src/ossim/imaging/ossimBandAverageFilter.cpp
deleted file mode 100644
index a0525a7..0000000
--- a/ossim/src/ossim/imaging/ossimBandAverageFilter.cpp
+++ /dev/null
@@ -1,395 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBandAverageFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimBandAverageFilter.h>
-
-// used for constructing and an ossimImageData object
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-// used for error reporting and for general info reporting such as warnings
-#include <ossim/base/ossimErrorContext.h>
-
-#include <sstream>
-#include <iterator>
-
-static const char* WEIGHTS_KW = "weights";
-
-RTTI_DEF1(ossimBandAverageFilter,
-          "ossimBandAverageFilter",
-          ossimImageSourceFilter);
-
-ossimBandAverageFilter::ossimBandAverageFilter()
-   :ossimImageSourceFilter(),
-    theTile(NULL)
-{
-}
-
-ossimBandAverageFilter::ossimBandAverageFilter(ossimImageSource* input,
-                                               const std::vector<double>& weights)
-   :ossimImageSourceFilter(input),
-    theTile(NULL),
-    theWeights(weights)
-{
-}
-
-ossimBandAverageFilter::~ossimBandAverageFilter()
-{
-}
-
-ossim_uint32 ossimBandAverageFilter::getNumberOfOutputBands()const
-{
-   if(isSourceEnabled())
-   {
-      return 1;
-   }
-   
-   return ossimImageSourceFilter::getNumberOfOutputBands();
-}
-
-ossimRefPtr<ossimImageData> ossimBandAverageFilter::getTile(const ossimIrect& rect, ossim_uint32 resLevel)
-{
-   // first we will check to see if we have an input connection
-   //
-   if(!theInputConnection)
-   {
-      // this will probably be null since we aren't initialized.
-      // we really need to creae a default blank tile in OSSIM that is returned
-      return theTile;
-   }
-
-   ossimRefPtr<ossimImageData> inputData =
-      theInputConnection->getTile(rect, resLevel);
-
-   if(!inputData.valid())
-   {
-      return inputData;
-   }
-   
-   // If we are disabled or if the data object is empty or NULL or
-   // not enough bands we don't need to run our algorithm so return the input
-   // tile.
-   if(!isSourceEnabled() ||
-      (inputData->getDataObjectStatus() == OSSIM_NULL)||
-      (inputData->getDataObjectStatus() == OSSIM_EMPTY)||
-      (inputData->getNumberOfBands() < 2))
-   {
-      return inputData;
-   }
-
-   // check to see if we are initialized
-   if(!theTile.valid())
-   {
-      initialize();
-   }
-   
-   theTile->setImageRectangle(rect);
-
-   // now lets set up the template method to operate in native type and run
-   // the algorithm
-   //
-   switch(inputData->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      averageInput((ossim_uint8)0, // setup template variable
-                   inputData);
-      break;
-   }
-   case OSSIM_USHORT11:
-   case OSSIM_USHORT16:
-   {
-      averageInput((ossim_uint16)0, // setup template variable
-                   inputData);
-      break;
-   }
-   case OSSIM_SSHORT16:
-   {
-      averageInput((ossim_sint16)0, // setup template variable
-                   inputData);
-      break;
-   }
-   case OSSIM_NORMALIZED_FLOAT:
-   case OSSIM_FLOAT:
-   {
-      averageInput((float)0, // setup template variable
-                   inputData);
-      break;
-   }
-   case OSSIM_NORMALIZED_DOUBLE:
-   case OSSIM_DOUBLE:
-   {
-      averageInput((double)0, // setup template variable
-                   inputData);
-      break;
-   }
-   default:
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "Unsupported scalar type in file %d at line %d",
-                    __FILE__,
-                    __LINE__);
-
-      
-      theTile->makeBlank();
-      break;
-   }
-   }
-   
-   theTile->validate();
-
-   
-   return theTile;
-}
-
-
-
-void ossimBandAverageFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   
-   // theInputConnection is defined in ossimImageSourceFilter
-   // It is automatically set when an input is connected to this
-   // object
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-
-      // now initialize the tile
-      theTile->initialize();
-      checkWeights();
-   }
-}
-
-double ossimBandAverageFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getNullPixelValue(band);
-   }
-   // lets use the first band's null value as our null
-   return ossimImageSourceFilter::getMinPixelValue(0);
-}
-
-double ossimBandAverageFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled()||!theInputConnection)
-   {
-      return ossimImageSourceFilter::getMinPixelValue(band);
-   }
-
-   // loop through each band and find the min pix value
-   ossim_uint32 bandIndex = 0;
-   ossim_uint32 inputBands = theInputConnection->getNumberOfOutputBands();
-   double minValue = ossim::defaultMax(OSSIM_DOUBLE);
-   for(bandIndex = 0; bandIndex < inputBands; ++bandIndex)
-   {
-      double minPix = theInputConnection->getMinPixelValue(bandIndex);
-
-      if(minPix < minValue)
-      {
-         minValue = minPix;
-      }
-   }
-
-   return minValue;
-}
-
-double ossimBandAverageFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getMaxPixelValue(band);
-   }
-   
-   // loop through each band and find the max pix value
-   ossim_uint32 bandIndex = 0;
-   ossim_uint32 inputBands = theInputConnection->getNumberOfOutputBands();
-   double maxValue = ossim::defaultMin(OSSIM_DOUBLE);
-   for(bandIndex = 0; bandIndex < inputBands; ++bandIndex)
-   {
-      double maxPix = theInputConnection->getMaxPixelValue(bandIndex);
-
-      if(maxPix > maxValue)
-      {
-         maxValue = maxPix;
-      }
-   }
-   
-   return maxValue;
-}
-
-void ossimBandAverageFilter::checkWeights()
-{
-   // we have not been initialzed yet
-   //
-   if(!theTile)
-   {
-      return;
-   }
-
-   // Check to see if the weights array is the same size as the input
-   // list.  If not then resize it and populate them with the same weight
-   // value.  It does not matter if they sum to one since we will perform
-   // a weighted average in the execution of the algorithm
-   //
-   if(theWeights.size() != theInputConnection->getNumberOfOutputBands())
-   {
-      theWeights.resize(theInputConnection->getNumberOfOutputBands());  
-
-      std::fill(theWeights.begin(), theWeights.end(), 1);
-   }
-}
-
-
-template<class T> void ossimBandAverageFilter::averageInput(
-   T /* dummyVariable */, // used only for template type, value ignored
-   ossimRefPtr<ossimImageData> inputDataObject)
-{
-   // since we have already checked the input for empty or
-   // null we will now execute the algorithm.  We will make
-   //
-   // 
-   std::vector<T*> inputBands(inputDataObject->getNumberOfBands());
-   std::vector<double> nullValues(inputDataObject->getNumberOfBands());
-   ossim_uint32 i = 0;
-
-   // for efficiency we will copy the band pointers and
-   // null values so we don't have extra function calls
-   // on a per band basis
-   //
-   for(i = 0; i < inputDataObject->getNumberOfBands(); ++i)
-   {
-      inputBands[i] = static_cast<T*>(inputDataObject->getBuf(i));
-      nullValues[i] = inputDataObject->getNullPix(i);
-   }
-
-   // store the output buffer pointer
-   T* outputBuf = static_cast<T*>(theTile->getBuf(0));
-
-   // setup index values and boundary values
-   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
-   ossim_uint32 bandIndex = 0;
-   ossim_uint32 numberOfBands = inputDataObject->getNumberOfBands();
-   double outputNullPix = theTile->getNullPix(0);
-   
-   for(i = 0; i < upperBound; ++i)
-   {
-      double value=0.0;
-      double sumWeights=0.0;
-
-      // loop over each band only using the valid pixel data
-      // in the weighted average.
-      //
-      for(bandIndex = 0; bandIndex < numberOfBands; ++bandIndex)
-      {
-         // if valid then muliply the value by the weight and add it to
-         // current pixel value
-         if(*inputBands[bandIndex] != nullValues[bandIndex])
-         {
-            value += theWeights[bandIndex]*((double)*inputBands[bandIndex]);
-            sumWeights += theWeights[bandIndex];
-         }
-         // increment to the next pixel for the next time around
-         ++inputBands[bandIndex];
-      }
-
-      // check to see if we had any valid data.  If we did the weight
-      // should be greater than 0
-      if(sumWeights != 0.0)
-      {
-         value /= sumWeights;
-      }
-      else
-      {
-         // else we set the pixel to the output null value
-         value = outputNullPix;
-      }
-      // store the result in the outputBuffer.
-      *outputBuf = static_cast<T>(value);
-
-      // advance the output buffer to the next pixel value
-      ++outputBuf;
-   }
-}
-
-
-bool ossimBandAverageFilter::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   // get the value of the stored keyword
-   ossimString weightString = kwl.find(prefix, WEIGHTS_KW);
-   weightString = weightString.trim();
-   
-
-   theWeights.clear();
-   if(weightString != "")
-   {
-      // split the string list into an array of strings
-      std::vector<ossimString> weightList = weightString.split(" ");
-
-      // resize the weights to the size of the weight list
-      //
-      theWeights.resize(weightList.size());
-      ossim_uint32 i = 0;
-
-      // now store the weights to the array
-      for(i = 0; i < theWeights.size(); ++i)
-      {
-         theWeights[i] = weightList[i].toDouble();
-      }
-   }
-
-   // call base class to continue the load state
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-bool ossimBandAverageFilter::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix)const
-{
-   std::stringstream out;
-
-   // copy the weights  to a memory stream separated by space
-   std::copy(theWeights.begin(),
-             theWeights.end(),
-             ostream_iterator<double>(out, " "));
-
-   ossimString weightString = out.str();
-   weightString = weightString.trim();
-
-   
-   kwl.add(prefix, // prefix to help uniquely id or attributes
-           WEIGHTS_KW, // the keyword to identity our attribute
-           weightString.c_str(),     // the value 
-           true); // overwrite if already in the keywordlist
-   
-   // call base classes save to allow us to pass the information up
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-double ossimBandAverageFilter::getWeight(ossim_uint32 band)const
-{
-   if(band < theWeights.size())
-   {
-      return theWeights[band];
-   }
-   
-   return 0.0;
-}
-
-void ossimBandAverageFilter::setWeight(ossim_uint32 band, double weight)
-{
-   if(band < theWeights.size())
-   {
-      theWeights[band] = fabs(weight);
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimBandClipFilter.cpp b/ossim/src/ossim/imaging/ossimBandClipFilter.cpp
deleted file mode 100644
index c200e6b..0000000
--- a/ossim/src/ossim/imaging/ossimBandClipFilter.cpp
+++ /dev/null
@@ -1,699 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBandClipFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimBandClipFilter.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/imaging/ossimImageData.h>
-
-RTTI_DEF1(ossimBandClipFilter, "ossimBandClipFilter", ossimImageSourceFilter);
-
-ossimBandClipFilter::ossimBandClipFilter()
-   :ossimImageSourceFilter(),
-    theClipType(ossimBandClipType_NONE),
-    theTile(NULL)
-{
-   theTile = new ossimImageData(this, // I am the owner,
-                                OSSIM_NORMALIZED_FLOAT,
-                                1);
-   theTile->initialize();
-}
-
-ossimBandClipFilter::ossimBandClipFilter(ossimImageSource* inputSource,
-                                           const vector<double>& minPix,
-                                           const vector<double>& maxPix,
-                                           ossimBandClipType clipType)
-   :ossimImageSourceFilter(inputSource),
-    theClipType(clipType),
-    theTile(NULL)
-{
-   theTile = new ossimImageData(this, // I am the owner,
-                                OSSIM_NORMALIZED_FLOAT,
-                                1);
-   theTile->initialize();
-   setMinMaxPix(minPix, maxPix);
-}
-
-ossimBandClipFilter::ossimBandClipFilter(ossimImageSource* inputSource,
-                                         double minPix,
-                                         double maxPix,
-                                         ossimBandClipType clipType)
-   :ossimImageSourceFilter(inputSource),
-    theClipType(clipType),
-    theTile(NULL)
-{
-   theTile = new ossimImageData(this, // I am the owner,
-                                OSSIM_NORMALIZED_FLOAT,
-                                1);
-   theTile->initialize();
-   
-   theMinPix.push_back(minPix);
-   theMaxPix.push_back(maxPix);
-}
-
-ossimBandClipFilter::~ossimBandClipFilter()
-{
-}
-
-void ossimBandClipFilter::setClipType(ossimBandClipType clipType)
-{
-   theClipType = clipType;
-}
-
-ossimBandClipFilter::ossimBandClipType ossimBandClipFilter::getClipType()const
-{
-   return theClipType;
-}
-
-ossim_uint32 ossimBandClipFilter::getNumberOfValues()const
-{
-   // We make sure that all arrays have the same number
-   // of elements so we can use the size of any of them.
-   return (ossim_uint32)theMinPix.size();
-}
-
-void ossimBandClipFilter::setNumberOfValues(ossim_uint32 size)
-{
-
-   // lets do a non destructive set.  That way we can
-   // grow or shrink the list without destroying
-   // the original values.
-   //
-   if(!size)
-   {
-      theMinPix.clear();
-      theMaxPix.clear();
-      theMedian.clear();
-      return;
-   }
-
-   
-   vector<double> tempMin    = theMinPix;
-   vector<double> tempMax    = theMaxPix;
-   
-   theMinPix.resize(size);
-   theMaxPix.resize(size);
-   theMedian.resize(size);
-    
-   ossim_uint32 upperBound = (ossim_uint32)min(theMinPix.size(), tempMin.size());
-   ossim_uint32 index = 0;
-
-   for(index = 0; index < upperBound; ++index)
-   {
-      theMinPix[index] = tempMin[index];
-      theMaxPix[index] = tempMax[index];
-      
-      theMinPix[index] = theMinPix[index]>1?1:theMinPix[index];
-      theMinPix[index] = theMinPix[index]<0?0:theMinPix[index];
-      theMaxPix[index] = theMaxPix[index]>1?1:theMaxPix[index];
-      theMaxPix[index] = theMaxPix[index]<0?0:theMaxPix[index];
-      
-      theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
-   }
-   
-   for(;index < theMinPix.size();++index)
-   {
-      theMinPix[index] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
-      theMaxPix[index] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
-      theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
-            
-      theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
-   }
-}
-
-void ossimBandClipFilter::setMinMaxPix(const vector<double>& minPix,
-                                       const vector<double>& maxPix)
-{
-   theMinPix = minPix;
-   theMaxPix = maxPix;
-
-   setNumberOfValues((ossim_uint32)max(theMinPix.size(), theMaxPix.size()));
-}
-
-const std::vector<double>& ossimBandClipFilter::getMinPixList()const
-{
-   return theMinPix;
-}
-
-const std::vector<double> ossimBandClipFilter::getMaxPixList()const
-{
-   return theMaxPix;
-}
-
-double ossimBandClipFilter::getMinPix(ossim_uint32 index)const
-{
-   return index<theMinPix.size()?theMinPix[index]:0;
-}
-
-double ossimBandClipFilter::getMaxPix(ossim_uint32 index)const
-{
-   return index<theMaxPix.size()?theMaxPix[index]:0;
-}
-
-ossimRefPtr<ossimImageData> ossimBandClipFilter::getTile(
-   const ossimIrect& rect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return NULL;
-   }
-   
-   ossimRefPtr<ossimImageData> data =
-      theInputConnection->getTile(rect, resLevel);
-   if(!data.get())
-   {
-      return data;
-   }
-   ossimDataObjectStatus status = data->getDataObjectStatus();
-   if((status != OSSIM_NULL) &&
-      (status != OSSIM_EMPTY))
-   {
-      ossim_uint32 dw = data->getWidth();
-      ossim_uint32 dh = data->getHeight();
-      ossim_uint32 db = data->getNumberOfBands();
-
-      ossim_uint32 tw = theTile->getWidth();
-      ossim_uint32 th = theTile->getHeight();
-      ossim_uint32 tb = theTile->getNumberOfBands();
-
-      if(((tw*th)!=(dw*dh))||
-         (tb != db))
-      {
-         theTile = new ossimImageData(this,
-                                      OSSIM_NORMALIZED_FLOAT,
-                                      db,
-                                      dw,
-                                      dh);
-         theTile->initialize();
-      }
-
-      if(getNumberOfValues() != theTile->getNumberOfBands())
-      {
-         // Should this go on??? (drb)
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimBandClipFilter::getTile\n"
-            << "getNumberOfValues() != theTile->getNumberOfBands"
-            << endl;
-      }
-      
-      data->copyTileToNormalizedBuffer(static_cast<float*>(theTile->getBuf()));
-      theTile->setDataObjectStatus(data->getDataObjectStatus());
-      
-      switch(theClipType)
-      {
-         case ossimBandClipType_CLIP:
-         {
-            runClip();
-            break;
-         }
-         case ossimBandClipType_CLAMP:
-         {
-            runClamp();
-            break;
-         }
-         case ossimBandClipType_LINEAR_STRETCH:
-         {
-            runLinearStretch();
-            break;
-         }
-         case ossimBandClipType_MEDIAN_STRETCH:
-         {
-            runMedianStretch();
-            break;
-         }
-         default:
-            break;
-      }
-      data->copyNormalizedBufferToTile(static_cast<float*>(theTile->getBuf()));
-   }
-   
-   return data;
-}
-
-void ossimBandClipFilter::runClip()
-{
-   ossim_uint32 offset = 0;
-   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
-   for(ossim_uint32 band =0; band < theTile->getNumberOfBands(); ++band)
-   {
-      float *buf     = static_cast<float*>(theTile->getBuf(band));
-      float  minPix  = theMinPix[band];
-      float  maxPix  = theMaxPix[band];
-      float  nullPix = theTile->getNullPix(band);
-      
-      if(buf)
-      {
-         for(offset = 0; offset < upperBound; ++offset)
-         {
-            if((*buf < minPix)||
-               (*buf > maxPix))
-            {
-               *buf = nullPix;
-            }
-            ++buf;
-         }
-      }
-   }
-   theTile->validate();
-}
-
-void ossimBandClipFilter::runClamp()
-{
-   ossim_uint32 offset = 0;
-   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
-   for(ossim_uint32 band =0; band < theTile->getNumberOfBands(); ++band)
-   {
-      float *buf     = static_cast<float*>(theTile->getBuf(band));
-      float  minPix  = theMinPix[band];
-      float  maxPix  = theMaxPix[band];
-      float  nullPix = theTile->getNullPix(band);
-      
-      if(buf)
-      {
-         if(theTile->getDataObjectStatus() == OSSIM_PARTIAL)
-         {
-            for(offset = 0; offset < upperBound; ++offset)
-            {
-               if(*buf != nullPix)
-               {
-                  if(*buf < minPix)
-                  {
-                     *buf = minPix;
-                  }
-                  else if(*buf > maxPix)
-                  {
-                     *buf = maxPix;
-                  }
-               }
-               ++buf;
-            }
-         }
-         else
-         {
-            for(offset = 0; offset < upperBound; ++offset)
-            {
-               if(*buf < minPix)
-               {
-                  *buf = minPix;
-               }
-               else if(*buf > maxPix)
-               {
-                  *buf = maxPix;
-               }
-               ++buf;
-            }
-         }
-      }
-   }
-}
-
-void ossimBandClipFilter::runLinearStretch()
-{   
-   ossim_uint32 bands = (ossim_uint32)min(theTile->getNumberOfBands(), (ossim_uint32)theMinPix.size());
-   ossim_uint32 w     = theTile->getWidth();
-   ossim_uint32 h     = theTile->getHeight();
-   ossim_uint32 upperBound = w*h;
-   const double* minPixArray = theTile->getMinPix();
-   const double* maxPixArray = theTile->getMaxPix();
-      
-   float* *bandArray = new float*[bands];
-   ossim_uint32 band = 0;
-   for(band = 0; band < bands; ++band)
-   {
-      bandArray[band] = static_cast<float*>(theTile->getBuf(band));
-   }
-   
-   if(theTile->getDataObjectStatus() == OSSIM_PARTIAL)
-   {
-      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-      {
-         if(!theTile->isNull(offset))
-         {
-            for(band = 0; band < bands; ++band)
-            {
-               double delta = theMaxPix[band] - theMinPix[band];
-               double t     = (bandArray[band][offset] - theMinPix[band])/delta;
-               if(t < 0)
-               {
-                 bandArray[band][offset] = minPixArray[band];
-               }
-               else if(t > 1)
-               {
-                 bandArray[band][offset] = maxPixArray[band];
-               }
-               else
-               {
-                  bandArray[band][offset] = t;
-               }
-            }
-         }
-      }
-   }
-   else if(theTile->getDataObjectStatus() == OSSIM_FULL)
-   {
-      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            for(band = 0; band < bands; ++band)
-            {
-               double delta = theMaxPix[band] - theMinPix[band];
-               double t     = (bandArray[band][offset] - theMinPix[band])/delta;
-               
-              if(t < 0)
-              {
-                 bandArray[band][offset] = minPixArray[band];
-              }
-              else if(t > 1)
-              {
-                 bandArray[band][offset] = maxPixArray[band];
-              }
-              else
-              {
-                 bandArray[band][offset] = t;
-              }
-            }
-         }
-   }
-   delete [] bandArray;
-   
-}
-
-void ossimBandClipFilter::runMedianStretch()
-{
-   ossim_uint32 bands = theTile->getNumberOfBands();
-   float* *bandArray = new float*[bands];
-   ossim_uint32 band = 0;
-
-   for(band = 0; band < bands; ++band)
-   {
-      bandArray[band] = static_cast<float*>(theTile->getBuf(band));
-   }
-   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
-   
-   if(theTile->getDataObjectStatus() == OSSIM_PARTIAL)
-   {
-      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-      {
-         if(!theTile->isNull(offset))
-         {
-            for(band = 0; band < bands; ++band)
-            {
-               double side = (theMedian[band] - (double)bandArray[band][offset]);
-               
-               if(side > 0) // on the left
-               {
-                  double delta = fabs(theMedian[band] - theMinPix[band]);
-                  double t     = ((double)bandArray[band][offset] - theMinPix[band])/delta;
-                  if(t < 0)
-                  {
-                     bandArray[band][offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
-                  }
-                  else if(t > 1)
-                  {
-                     bandArray[band][offset] = theMedian[band];
-                  }
-                  else
-                  {
-                     bandArray[band][offset] = theMedian[band]*t;
-                  }
-               }
-               else // on the right
-               {
-                  double delta = theMaxPix[band] - theMedian[band];
-                  double t = ((double)bandArray[band][offset] - theMedian[band])/delta;
-                  
-                  if(t < 0)
-                  {
-                     bandArray[band][offset] = theMedian[band];
-                  }
-                  else if(t > 1)
-                  {
-                     bandArray[band][offset] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
-                  }
-                  else
-                  {
-                     bandArray[band][offset] = theMedian[band]+delta*t;
-                  }
-               }
-            }
-         }
-      }
-   }
-   else if(theTile->getDataObjectStatus() == OSSIM_FULL)
-   {
-      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-      {
-         for(band = 0; band < bands; ++band)
-         {
-            double side = (theMedian[band] - (double)bandArray[band][offset]);
-            
-            if(side > 0) // on the left
-            {
-               double delta = fabs(theMedian[band] - theMinPix[band]);
-               double t     = ((double)bandArray[band][offset] - theMinPix[band])/delta;
-               if(t < 0)
-               {
-                  bandArray[band][offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
-               }
-               else if(t > 1)
-               {
-                  bandArray[band][offset] = theMedian[band];
-               }
-               else
-               {
-                  bandArray[band][offset] = theMedian[band]*t;
-               }
-            }
-            else // on the right
-            {
-               double delta = theMaxPix[band] - theMedian[band];
-               double t = ((double)bandArray[band][offset] - theMedian[band])/delta;
-               
-               if(t < 0)
-               {
-                  bandArray[band][offset] = theMedian[band];
-               }
-               else if(t > 1)
-               {
-                  bandArray[band][offset] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
-               }
-               else
-               {
-                  bandArray[band][offset] = theMedian[band]+delta*t;
-               }
-            }
-         }
-      }
-   }
-
-   delete [] bandArray;
-}   
-
-void ossimBandClipFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   
-   if(theInputConnection)
-   {
-      ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
-
-      if(bands)
-      {
-         if(theMinPix.size() != bands)
-         {
-            setNumberOfValues(bands);
-         }
-      }
-   }
-}
-
-bool ossimBandClipFilter::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
-
-   if(result)
-   {
-      ossimString minRegExpression    = ossimString("^(") +
-                                        ossimString(prefix) +
-                                        "min[0-9]+)";
-      ossimString maxRegExpression    = ossimString("^(") +
-                                        ossimString(prefix) +
-                                        "max[0-9]+)";
-      ossimString medianRegExpression = ossimString("^(") +
-                                        ossimString(prefix) +
-                                        "median[0-9]+)";
-      
-      ossim_uint32 numberOfMins    = kwl.getNumberOfSubstringKeys(minRegExpression);
-      ossim_uint32 numberOfMaxs    = kwl.getNumberOfSubstringKeys(maxRegExpression);
-      ossim_uint32 numberOfMedians = kwl.getNumberOfSubstringKeys(medianRegExpression);
-      theMinPix.clear();
-      theMaxPix.clear();
-      theMedian.clear();
-
-      if(numberOfMins != numberOfMaxs)
-      {
-         ossim_int32 temp = (ossim_int32)min(numberOfMins, numberOfMaxs);
-         numberOfMins = temp;
-         numberOfMaxs = temp;
-      }
-      if(numberOfMins> 0)
-      {
-         ossimString prefixMin    = ossimString(prefix) + "min";
-         ossimString prefixMax    = ossimString(prefix) + "max";
-         ossimString prefixMedian = ossimString(prefix) + "median";
-         
-         ossim_uint32 numberOfMatches = 0;
-         ossim_uint32 index = 0;
-         const char* value=(const char*)NULL;
-         
-         while(numberOfMatches < numberOfMins)
-         {
-            value = kwl.find(prefixMin.c_str(),
-                             ossimString::toString(index).c_str());
-            if(value)
-            {
-               theMinPix.push_back(ossimString(value).toDouble());
-               ++numberOfMatches;
-            }
-            ++index;
-         }
-         index = 0;
-         numberOfMatches = 0;
-         while(numberOfMatches < numberOfMaxs)
-         {
-            value = kwl.find(prefixMax.c_str(),
-                             ossimString::toString(index).c_str());
-            if(value)
-            {
-               theMaxPix.push_back(ossimString(value).toDouble());
-               ++numberOfMatches;
-            }
-            ++index;
-         }
-         if(numberOfMedians != numberOfMins)
-         {
-            for(index = 0; index <  theMaxPix.size(); ++index)
-            {
-               theMedian.push_back((theMinPix[index]+theMaxPix[index])/2.0);
-            }
-         }
-         else
-         {
-            index = 0;
-            numberOfMatches = 0;
-            while(numberOfMatches < numberOfMedians)
-            {
-               value = kwl.find(prefixMedian.c_str(),
-                                ossimString::toString(index).c_str());
-               if(value)
-               {
-                  theMedian.push_back(ossimString(value).toDouble());
-                  ++numberOfMatches;
-               }
-               ++index;
-            }
-         }
-      }
-   }
-   const char* clip_type = kwl.find(prefix, "clip_type");
-   if(clip_type)
-   {
-     ossimString clipType = clip_type;
-      clipType = clipType.upcase().trim();
-
-      if(clipType == "NONE")
-      {
-         theClipType = ossimBandClipType_NONE;
-      }
-      else if(clipType == "CLIP")
-      {
-         theClipType = ossimBandClipType_CLIP;
-      }
-      else if(clipType == "LINEAR_STRETCH")
-      {
-         theClipType = ossimBandClipType_LINEAR_STRETCH;
-      }
-      else if(clipType == "MEDIAN_STRETCH")
-      {
-         theClipType = ossimBandClipType_MEDIAN_STRETCH;
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "ossimBandClipFilter::loadState NOTICE:\n"
-         << "Clip type not given defaulting to NONE" << endl;
-      theClipType = ossimBandClipType_NONE;
-   }
-
-   return result;
-}
-
-bool ossimBandClipFilter::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix)const
-{
-   ossimString minPrefix    = ossimString("min");
-   ossimString maxPrefix    = ossimString("max");
-   ossimString medianPrefix = ossimString("median");
-
-   for(ossim_uint32 index = 1; index <= getNumberOfValues(); ++index)
-   {
-      ossimString value = (minPrefix+ossimString::toString(index));
-      kwl.add(prefix,
-              value.c_str(),
-              theMinPix[index-1],
-              true);
-      value = (maxPrefix+ossimString::toString(index));
-      kwl.add(prefix,
-              value.c_str(),
-              theMaxPix[index-1],
-              true);
-      value = (medianPrefix+ossimString::toString(index));
-      kwl.add(prefix,
-              value.c_str(),
-              theMedian[index-1],
-              true);
-   }
-   ossimString clipType;
-   switch(theClipType)
-   {
-      case ossimBandClipType_NONE:
-      {
-         clipType = "NONE";
-         break;
-      }
-      case ossimBandClipType_CLIP:
-      {
-         clipType = "CLIP";
-         break;
-      }
-      case ossimBandClipType_LINEAR_STRETCH:
-      {
-         clipType = "LINEAR_STRETCH";
-         break;
-      }
-      case ossimBandClipType_MEDIAN_STRETCH:
-      {
-         clipType = "MEDIAN_STRETCH";
-         break;
-      }
-      default:
-         break;
-   }
-   kwl.add(prefix,
-           "clip_type",
-           clipType.c_str(),
-           true);
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimBandMergeSource.cpp b/ossim/src/ossim/imaging/ossimBandMergeSource.cpp
deleted file mode 100644
index 915f2eb..0000000
--- a/ossim/src/ossim/imaging/ossimBandMergeSource.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBandMergeSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimBandMergeSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimIrect.h>
-
-RTTI_DEF1(ossimBandMergeSource, "ossimBandMergeSource", ossimImageCombiner)
-
-ossimBandMergeSource::ossimBandMergeSource()
-   :ossimImageCombiner(),
-    theNumberOfOutputBands(0),
-    theTile(NULL)
-{
-}
-
-ossimBandMergeSource::ossimBandMergeSource(ossimConnectableObject::ConnectableObjectList& inputSources)
-   :ossimImageCombiner(inputSources),
-    theNumberOfOutputBands(0),
-    theTile(NULL)
-{
-   initialize();
-}
-
-ossimBandMergeSource::~ossimBandMergeSource()
-{
-   theNumberOfOutputBands = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimBandMergeSource::getTile(const ossimIrect& tileRect,
-                                                          ossim_uint32 resLevel)
-{
-   ossim_uint32 layerIdx = 0;
-   if( ( getNumberOfInputs() == 1) || !isSourceEnabled() )
-   {
-      return getNextTile(layerIdx, 0, tileRect, resLevel);
-   }
-
-   // test if initialized
-   if(!theTile.get())
-   {
-      allocate();
-   }
-   
-   if(!theTile.get())
-   {
-      return getNextTile(layerIdx, 0, tileRect, resLevel);
-   }
-   
-   long w     = tileRect.width();
-   long h     = tileRect.height();
-   long tileW = theTile->getWidth();
-   long tileH = theTile->getHeight();
-   if ((w != tileW) || (h != tileH))
-   {
-      theTile->setWidth(w);
-      theTile->setHeight(h);
-      if((w*h)!=(tileW*tileH))
-      {
-         theTile->initialize();
-      }
-      else
-      {
-         theTile->makeBlank();
-      }
-   }
-   else
-   {
-      theTile->makeBlank();
-   }
-
-   theTile->setOrigin(tileRect.ul());
-   getTile(theTile.get(), resLevel);
-
-   return theTile;
-}
-
-bool ossimBandMergeSource::getTile(ossimImageData* tile, ossim_uint32 resLevel)
-{
-   if (!tile)
-      return false;
-
-   ossim_uint32 layerIdx = 0;
-   if( ( getNumberOfInputs() == 1) || !isSourceEnabled() )
-   {
-      return getNextTile(layerIdx, 0, tile, resLevel);
-   }
-
-   tile->makeBlank();
-   ossim_uint32 currentBand = 0;
-   ossim_uint32 maxBands = tile->getNumberOfBands();
-   ossim_uint32 inputIdx = 0;
-   ossimRefPtr<ossimImageData> currentTile;
-   for(inputIdx = 0; inputIdx < getNumberOfInputs(); ++inputIdx)
-   {
-      ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(inputIdx));
-      ossim_uint32 maxInputBands = 1;
-
-      if(input)
-      {
-         currentTile = input->getTile(tile->getImageRectangle(), resLevel);
-         if(currentTile.valid())
-         {
-            maxInputBands = currentTile->getNumberOfBands();
-            //std::cout << "MAX INPUT BANDS === " << maxInputBands << "\n";
-            if (maxInputBands == 0)
-               maxInputBands = 1;
-         }
-      }
-      else
-      {
-         currentTile = 0;
-      }
-
-      if(currentTile.valid()&&(currentTile->getBuf()))
-      {
-         for(ossim_uint32 band = 0; (band < maxInputBands) && (currentBand < maxBands); ++band)
-         {
-            //std::cout << "Actual Band, BAND == " << currentBand << ", " << band << "\n";
-            // clear the band with the actual NULL
-            tile->fill(currentBand, tile->getNullPix(band));
-
-            if(currentTile.valid())
-            {
-               if((currentTile->getDataObjectStatus() != OSSIM_NULL) &&
-                  (currentTile->getDataObjectStatus() != OSSIM_EMPTY))
-               {
-                  memmove(tile->getBuf(currentBand),
-                          currentTile->getBuf(band),
-                          currentTile->getSizePerBandInBytes());
-               }
-            }
-            ++currentBand;
-         }
-      }
-   }
-   tile->validate();
-   return true;
-}
-
-double ossimBandMergeSource::getNullPixelValue(ossim_uint32 band)const
-{
-   ossim_uint32 currentBandCount = 0;
-   ossim_uint32 idx              = 0;
-
-   ossim_uint32 maxBands = getNumberOfOutputBands();
-   if(!maxBands) return 0.0;
-   
-   while((currentBandCount < maxBands)&&
-	 (idx < getNumberOfInputs()))
-   {
-      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(idx));
-      if(temp)
-      {
-	ossim_uint32 previousCount = currentBandCount;
-	currentBandCount += temp->getNumberOfOutputBands();
-
-         if(band < currentBandCount)
-         {
-            return temp->getNullPixelValue(band - previousCount);
-         }
-      }
-      ++idx;
-   }
-   
-   return ossim::nan();
-}
-
-double ossimBandMergeSource::getMinPixelValue(ossim_uint32 band)const
-{
-   ossim_uint32 currentBandCount = 0;
-   ossim_uint32 idx              = 0;
-
-   ossim_uint32 maxBands = getNumberOfOutputBands();
-   if(!maxBands) return 0.0;
-   
-   while((currentBandCount < maxBands)&&
-	 (idx < getNumberOfInputs()))
-   {
-      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(idx));
-      if(temp)
-      {
-	ossim_uint32 previousCount = currentBandCount;
-	currentBandCount += temp->getNumberOfOutputBands();
-
-         if(band < currentBandCount)
-         {
-            return temp->getMinPixelValue(band - previousCount); 
-         }
-      }
-      ++idx;
-   }
-   
-   return 0.0;
-}
-
-double ossimBandMergeSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   ossim_uint32 currentBandCount = 0;
-   ossim_uint32 idx              = 0;
-
-   ossim_uint32 maxBands = getNumberOfOutputBands();
-   if(!maxBands) return 0.0;
-   
-   while((currentBandCount < maxBands)&&
-	 (idx < getNumberOfInputs()))
-   {
-      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(idx));
-      if(temp)
-      {
-	ossim_uint32 previousCount = currentBandCount;
-	currentBandCount += temp->getNumberOfOutputBands();
-
-         if(band < currentBandCount)
-         {
-            return temp->getMaxPixelValue(band - previousCount);
-         }
-      }
-      ++idx;
-   }
-   
-   return ossim::nan();
-}
-
-void ossimBandMergeSource::initialize()
-{
-   ossimImageCombiner::initialize();
-
-   if(theTile.get())
-   {
-      theTile = NULL;
-   }
-   
-   theNumberOfOutputBands = computeNumberOfInputBands();
-}
-
-void ossimBandMergeSource::allocate()
-{
-   if(theNumberOfOutputBands)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,
-                                                          this);
-      theTile->initialize();
-   }
-}
-
-ossim_uint32 ossimBandMergeSource::computeNumberOfInputBands()const
-{
-   ossim_uint32 result = 0;
-   ossim_uint32 size   = getNumberOfInputs();
-   for(ossim_uint32 index = 0; index < size; ++index)
-   {
-      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(index));
-      if(temp)
-      {
-         if(temp->getNumberOfOutputBands() == 0)
-         {
-            ++result;
-         }
-         else
-         {
-            result += temp->getNumberOfOutputBands();
-         }
-      }
-   }
-   return result;
-}
-
-ossim_uint32 ossimBandMergeSource::getNumberOfOutputBands() const
-{
-   if(!theNumberOfOutputBands)
-   {
-      return computeNumberOfInputBands();
-   }
-   
-   return theNumberOfOutputBands;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimBandSelector.cpp b/ossim/src/ossim/imaging/ossimBandSelector.cpp
deleted file mode 100644
index 5c7f9e4..0000000
--- a/ossim/src/ossim/imaging/ossimBandSelector.cpp
+++ /dev/null
@@ -1,713 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Contains class declaration for ossimBandSelector.
-// 
-//*******************************************************************
-//  $Id: ossimBandSelector.cpp 23426 2015-07-15 14:51:23Z okramer $
-
-#include <ossim/imaging/ossimBandSelector.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <iostream>
-#include <algorithm>
-
-static ossimTrace traceDebug("ossimBandSelector:debug");
-
-RTTI_DEF1(ossimBandSelector,"ossimBandSelector", ossimImageSourceFilter)
-
-ossimBandSelector::ossimBandSelector()
-   :
-      ossimImageSourceFilter(),
-      theTile(0),
-      theOutputBandList(0),
-      theWithinRangeFlag(ossimBandSelectorWithinRangeFlagState_NOT_SET),
-      thePassThroughFlag(false),
-      theDelayLoadRgbFlag(false)
-   
-
-{
-//   theEnableFlag = false; // Start off disabled.
-   theEnableFlag = true; 
-}
-
-ossimBandSelector::~ossimBandSelector()
-{
-   theTile = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimBandSelector::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if (!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   // Get the tile from the source.
-   ossimRefPtr<ossimImageData> t = theInputConnection->getTile(tileRect, resLevel);
-
-   if (!isSourceEnabled())
-   {
-      return t;  // This tile source bypassed, return the input tile source.
-   }
-
-//   if (theOrderedCorrectlyFlag)
-//   {
-//      return t; // Input band order same as output band order.
-//   }
-
-   if(!theTile.valid()) // First time through, might not be initialized...
-   {
-      allocate();
-      if (!theTile.valid())
-      {
-         // Should never happen...
-         return t; // initialize failed.
-      }
-   }
-
-   theTile->setImageRectangle(tileRect);
-   if(theWithinRangeFlag == ossimBandSelectorWithinRangeFlagState_NOT_SET)
-   {
-      theWithinRangeFlag = ((outputBandsWithinInputRange() == true) ?
-                            ossimBandSelectorWithinRangeFlagState_IN_RANGE:
-                            ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE);
-   }
-   if(theWithinRangeFlag == ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE)
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   if ( !t.valid() ||
-        (t->getDataObjectStatus() == OSSIM_EMPTY) ||
-        (t->getDataObjectStatus() == OSSIM_NULL))
-   {
-      //---
-      // Since we're enabled, we must return our tile not "t" so the
-      // correct number of bands goes through the chain.
-      //---
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   // Copy selected bands to our tile.
-   for (ossim_uint32 i=0; i<theOutputBandList.size(); i++)
-   {
-      theTile->assignBand(t.get(), theOutputBandList[i], i);
-   }
-   
-   theTile->validate();
-
-   return theTile;
-}
-
-void ossimBandSelector::setOutputBandList( const vector<ossim_uint32>& outputBandList,
-                                           bool disablePassThru)
-{
-   if (outputBandList.size() == 0)
-      return;
-
-   theOutputBandList = outputBandList;  // Assign the new list.
-   if (disablePassThru)
-      return;
-
-   bool setBands = false;
-   ossimRefPtr<ossimImageHandler> ih = getBandSelectableImageHandler();
-   if ( ih.valid() )
-   {
-      // Our input is a single image chain that can do band selection.
-      if ( ih->setOutputBandList( outputBandList ) )
-      {
-         thePassThroughFlag = true;
-         setBands = true;
-         theTile = 0; // Don't need.
-      }
-   }
-
-   if ( setBands == false )
-   {
-      if ( theTile.valid() && ( theTile->getNumberOfBands() != outputBandList.size() ) )
-      {
-         theTile = 0;       // Force an allocate call next getTile.
-      }
-      theWithinRangeFlag = ossimBandSelectorWithinRangeFlagState_NOT_SET;
-      checkPassThrough();
-      //theOrderedCorrectlyFlag = isOrderedCorrectly();
-   }
-}
-
-ossim_uint32 ossimBandSelector::getNumberOfOutputBands() const
-{
-   ossim_uint32 bands;
-   
-   if(isSourceEnabled())
-   {
-      bands = static_cast<ossim_uint32>(theOutputBandList.size());
-   }
-   else
-   {
-      //---
-      // Note:
-      // This returns theInputConnection->getNumberOfOutputBands() which is our
-      // input.  Calling ossimBandSelector::getNumberOfInputBands() will produce
-      // an error if we are bypassed due to a band selectable image handler.
-      //---
-      bands = ossimImageSourceFilter::getNumberOfInputBands();
-   }
-
-   return bands;
-}
-
-ossim_uint32 ossimBandSelector::getNumberOfInputBands() const
-{
-   ossim_uint32 bands;
-
-   // See if we have a single image chain with band selectable image handler.
-   ossimRefPtr<ossimImageHandler> ih = getBandSelectableImageHandler();
-   if ( ih.valid() )
-   {
-      bands = ih->getNumberOfInputBands();
-   }
-   else
-   {
-      bands = ossimImageSourceFilter::getNumberOfInputBands();
-   }
-   
-   return bands;
-}
-
-void ossimBandSelector::initialize()
-{
-   // Base class will recapture "theInputConnection".
-   ossimImageSourceFilter::initialize();
-   
-   theWithinRangeFlag = ossimBandSelectorWithinRangeFlagState_NOT_SET;
-
-   if(theInputConnection)
-   {
-      if ( !theOutputBandList.size() ) 
-      {
-         // First time through...
-         if ( theDelayLoadRgbFlag )
-         {
-            //---
-            // "bands" key was set to "rgb" in loadState but there was not a
-            // connection to derive rgb bands from image handler.
-            //---
-            if ( getRgbBandList( theOutputBandList ) == false )
-            {
-               //---
-               // Could not derive from input. Assuming caller wanted three bands.
-               // Call to checkPassThrough()->outputBandsWithinInputRange()
-               // will check the range of output band list.
-               //---
-               theOutputBandList.resize(3);
-               theOutputBandList[0] = 0;
-               theOutputBandList[1] = 1;
-               theOutputBandList[2] = 2;
-            }
-            theDelayLoadRgbFlag = false; // clear flag.
-         }
-
-         if ( !theOutputBandList.size() )
-         {
-            // Set the output band list to input if not set above.
-            theInputConnection->getOutputBandList(theOutputBandList);
-         }
-      }
-
-      // NOTE: The following code was already being done in setOutputBandList(), so ignored here
-      // until someone complains. Need the ability to force this selector to be active even if
-      // the input handler is a band-selectable variety. (OLK Jul/2015)
-#if 0
-      // See if we have a single image chain with band selectable image handler.
-      ossimRefPtr<ossimImageHandler> ih = getBandSelectableImageHandler();
-      if ( ih.valid() )
-      {
-         if ( theOutputBandList.size() )
-         {
-            ih->setOutputBandList( theOutputBandList );
-         }
-         thePassThroughFlag = true;
-      }
-      else
-      {
-         checkPassThrough();
-      }
-#endif
-
-      if ( isSourceEnabled() )
-      {
-         // theOrderedCorrectlyFlag = isOrderedCorrectly();
-         
-         if ( theTile.valid() )
-         {
-            //---
-            // Check for:
-            // - ordered correctly
-            // - band change
-            // - scalar change
-            //---
-            if( ( theTile->getNumberOfBands() != theOutputBandList.size() ) ||
-                ( theTile->getScalarType() !=
-                  theInputConnection->getOutputScalarType() ) )
-            {
-               theTile = 0; // Don't need it.
-            }
-         }
-      }
-   }
-
-   if ( !isSourceEnabled() )
-   {
-      theTile = 0;
-   }
-}
-
-void ossimBandSelector::allocate()
-{
-   //initialize(); // Update the connection.
-   //theOrderedCorrectlyFlag = isOrderedCorrectly();
-   theTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile->initialize();
-}
-
-bool ossimBandSelector::isSourceEnabled()const
-{
-   bool result = ossimImageSourceFilter::isSourceEnabled();
-   if(result)
-   {
-      // if I am not marked to pass information on through then enable me
-      result = !thePassThroughFlag;
-   }
-   
-   return result;
-}
-
-double ossimBandSelector::getMinPixelValue(ossim_uint32 band)const
-{
-   if(theInputConnection)
-   {
-      if (isSourceEnabled())
-      {
-         if(band < theOutputBandList.size())
-         {
-            return theInputConnection->
-               getMinPixelValue(theOutputBandList[band]);
-         }
-         else
-         {
-            return theInputConnection->getMinPixelValue(band);
-         }
-      }
-      else
-      {
-         return theInputConnection->getMinPixelValue(band);
-      }
-   }
-   return 0;
-}
-
-double ossimBandSelector::getNullPixelValue(ossim_uint32 band)const
-{
-   if(theInputConnection)
-   {
-      if (isSourceEnabled())
-      {
-         if(band < theOutputBandList.size())
-         {
-            return theInputConnection->
-               getNullPixelValue(theOutputBandList[band]);
-         }
-         else
-         {
-            return theInputConnection->getNullPixelValue(band);
-         }
-      }
-      else
-      {
-         return theInputConnection->getNullPixelValue(band);
-      }
-   }
-   
-   return 0;
-}
-
-double ossimBandSelector::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(theInputConnection)
-   {
-      if (isSourceEnabled())
-      {
-         if(band < theOutputBandList.size())
-         {
-            return theInputConnection->
-               getMaxPixelValue(theOutputBandList[band]);
-         }
-         else
-         {
-            return theInputConnection->getMaxPixelValue(band);
-         }
-      }
-      else
-      {
-        return theInputConnection->getMaxPixelValue(band);
-      }
-   }
-   return 1.0/DBL_EPSILON;
-}
-
-bool ossimBandSelector::saveState(ossimKeywordlist& kwl,
-                                  const char* prefix)const
-{
-   ossimString temp;
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
-           static_cast<int>(theOutputBandList.size()),
-           true);
-   
-   ossimString bandsString;
-   ossim::toSimpleStringList(bandsString,
-                             theOutputBandList);
-   kwl.add(prefix,
-           ossimKeywordNames::BANDS_KW,
-           bandsString,
-           true);
-/*   
-   for(ossim_uint32 counter = 0; counter < theOutputBandList.size();counter++)
-   {
-      temp  = ossimKeywordNames::BAND_KW;
-      temp += ossimString::toString(counter+1);
-      
-      kwl.add(prefix,
-              temp.c_str(),
-              ossimString::toString(theOutputBandList[counter]+1).c_str());
-   }
-*/   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimBandSelector::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix)
-{
-   bool result = false;
-   
-   ossimImageSourceFilter::loadState(kwl, prefix);
-
-   theOutputBandList.clear();
-   
-   ossimString copyPrefix = prefix;
-   
-   ossimString bands = kwl.find(prefix, ossimKeywordNames::BANDS_KW);
-   if(!bands.empty())
-   {
-      ossimString bs = bands;
-      bs.downcase();
-      if ( bs == "rgb" )
-      {
-         // Flag initialize() to set the band list on first connection.
-         theDelayLoadRgbFlag = true;
-      }
-      else
-      {
-         // Load from key:value, e.g. bands:(2,1,0)
-         ossim::toSimpleVector(theOutputBandList, bands);
-         result = true;
-      }
-   }
-   else
-   {
-      ossimString regExpression =  ossimString("^(") + copyPrefix + "band[0-9]+)";
-      
-      vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
-      long numberOfBands = (long)keys.size();
-      ossim_uint32 offset = (ossim_uint32)(copyPrefix+"band").size();
-      std::vector<int>::size_type idx = 0;
-      std::vector<int> numberList(numberOfBands);
-      for(idx = 0; idx < keys.size();++idx)
-      {
-         ossimString numberStr(keys[idx].begin() + offset,
-                               keys[idx].end());
-         numberList[idx] = numberStr.toInt();
-      }
-      std::sort(numberList.begin(), numberList.end());
-      for(idx=0;idx < numberList.size();++idx)
-      {
-         const char* bandValue =
-         kwl.find(copyPrefix,
-                  ("band"+ossimString::toString(numberList[idx])).c_str());
-         theOutputBandList.push_back( ossimString(bandValue).toLong()-1);
-      }
-      result = true;
-   }
-
-   initialize();
-   
-   return result;
-}
-
-void ossimBandSelector::checkPassThrough()
-{
-   thePassThroughFlag = ((theInputConnection == 0)||!outputBandsWithinInputRange());
-   
-   // check if marked with improper bands
-   if(thePassThroughFlag) return;
-   
-   if(theInputConnection)
-   {
-      std::vector<ossim_uint32> inputList;
-      theInputConnection->getOutputBandList(inputList);
-
-      if ( inputList.size() == theOutputBandList.size() )
-      {
-         const std::vector<ossim_uint32>::size_type SIZE =
-            theOutputBandList.size();
-      
-         std::vector<ossim_uint32>::size_type i = 0;
-         while (i < SIZE)
-         {
-            if ( inputList[i] != theOutputBandList[i] )
-            {
-               break;
-            }
-            ++i;
-         }
-         if (i == SIZE)
-         {
-            thePassThroughFlag = true;
-         }
-      }
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimBandSelector::isOrderedCorrectly() ERROR:"
-         << "Method called prior to initialization!\n";
-      }
-   }
-
-}
-
-bool ossimBandSelector::outputBandsWithinInputRange() const
-{
-   bool result = false;
-   
-   if(theInputConnection)
-   {
-      result = true;
-      const ossim_uint32 HIGHEST_BAND = getNumberOfInputBands() - 1;
-      const ossim_uint32 OUTPUT_BANDS = (ossim_uint32)theOutputBandList.size();
-      for (ossim_uint32 i=0; i<OUTPUT_BANDS; ++i)
-      {
-         if (theOutputBandList[i] > HIGHEST_BAND)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimBandSelector::outputBandsWithinInputRange() ERROR:"
-               << "Output band greater than highest input band. "
-               << theOutputBandList[i] << " > " << HIGHEST_BAND << "."
-               << std::endl;
-            }
-            result = false;
-            break;
-         }
-      }
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimBandSelector::outputBandsWithinInputRange() ERROR:"
-         << "Method called prior to initialization!" << std::endl;
-      }
-   }
-   return result;
-}
-
-void ossimBandSelector::getOutputBandList(std::vector<ossim_uint32>& bandList) const
-{
-   if ( isSourceEnabled()&&theOutputBandList.size() )
-   {
-      bandList = theOutputBandList;
-   }
-   else if (theInputConnection)
-   {
-      theInputConnection->getOutputBandList(bandList);
-   }
-   else
-   {
-      bandList.clear();
-   }
-}
-
-ossimString ossimBandSelector::getLongName()const
-{
-   return ossimString("Band Selector, maps an input band to the output band.");
-}
-
-ossimString ossimBandSelector::getShortName()const
-{
-   return ossimString("Band Selector");
-}
-
-void ossimBandSelector::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-
-   if(property->getName() == "bandSelection")
-   {
-     ossimString str = property->valueToString();
-     std::vector<ossimString> str_vec;
-     std::vector<ossim_uint32> int_vec;
-     
-     str.split( str_vec, " " );
-     
-     for ( ossim_uint32 i = 0; i < str_vec.size(); ++i )
-     {
-        if(!str_vec[i].empty())
-        {
-           int_vec.push_back( str_vec[i].toUInt32() );
-        }
-     }
-     setOutputBandList( int_vec );
-   }
-   else if(property->getName() == "bands")
-   {
-      std::vector<ossim_uint32> selection;
-      if(ossim::toSimpleVector(selection, property->valueToString()))
-      {
-         theOutputBandList = selection;
-      }
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimBandSelector::getProperty(const ossimString& name)const
-{
-   if(name == "bandSelection")
-   {
-      std::vector<ossim_uint32> bands;
-	  
-	  getOutputBandList( bands );
-	  	  
-      std::vector<ossimString> bandNames;
-
-      for(ossim_uint32 i = 0; i < bands.size(); i++)
-      {
-         bandNames.push_back( ossimString::toString( bands[i] ) );
-      }
-	  
-	  ossimString str;
-	  
-	  str.join( bandNames, " " );
-	  
-      ossimStringProperty* stringProp = new ossimStringProperty(name, str);
-									
-      stringProp->clearChangeType();
-      stringProp->setReadOnlyFlag(false);
-      stringProp->setCacheRefreshBit();
-      
-      return stringProp;
-   }
-   else if(name == "bands")
-   {
-      ossimString bandsString;
-      ossim::toSimpleStringList(bandsString,
-                                theOutputBandList);
-      ossimStringProperty* stringProp = new ossimStringProperty(name, bandsString);
-      
-      stringProp->clearChangeType();
-      stringProp->setReadOnlyFlag(false);
-      stringProp->setCacheRefreshBit();
-      
-      return stringProp;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimBandSelector::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("bands");
-}
-
-ossimRefPtr<ossimImageHandler> ossimBandSelector::getBandSelectableImageHandler() const
-{
-   ossimRefPtr<ossimImageHandler> ih = 0;
-
-   if ( theInputConnection )
-   {
-      ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
-                                   true,
-                                   ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
-      
-      theInputConnection->accept(visitor);
-
-      // If there are multiple image handlers, e.g. a mosaic do not uses.
-      if ( visitor.getObjects().size() == 1 )
-      {
-         ih = visitor.getObjectAs<ossimImageHandler>( 0 );
-         if ( ih.valid() )
-         {
-            if ( ih->isBandSelector() == false )
-            {
-               ih = 0;
-            }
-         }
-      }
-      
-   } // Matches: if ( theInputConnection )
-   return ih;
-   
-} // End: ossimBandSelector::getBandSelectableImageHandler()
-
-bool ossimBandSelector::getRgbBandList(std::vector<ossim_uint32>& bandList) const
-{
-   bool result = false;
-   
-   if ( theInputConnection )
-   {
-      ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
-                                   true,
-                                   ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
-      
-      theInputConnection->accept(visitor);
-
-      // If there are multiple image handlers, e.g. a mosaic do not uses.
-      if ( visitor.getObjects().size() == 1 )
-      {
-         ossimRefPtr<ossimImageHandler> ih = visitor.getObjectAs<ossimImageHandler>( 0 );
-         if ( ih.valid() )
-         {
-            result = ih->getRgbBandList( bandList );
-         }
-      }
-      
-   } // Matches: if ( theInputConnection )
-
-   return result;
-   
-} // End: ossimBandSelector::getRgbBandList( ... )
diff --git a/ossim/src/ossim/imaging/ossimBandSeparateHandler.cpp b/ossim/src/ossim/imaging/ossimBandSeparateHandler.cpp
deleted file mode 100644
index 08da120..0000000
--- a/ossim/src/ossim/imaging/ossimBandSeparateHandler.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-//*************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description:
-// 
-// Image handler used when the multi-band image has each band represented by a different disk file.
-// This is the case for some Ikonos imagery. 
-//
-//*************************************************************************************************
-//  $Id: ossimBandSeparateHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#include <ossim/imaging/ossimBandSeparateHandler.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <algorithm>
-
-RTTI_DEF1(ossimBandSeparateHandler, "ossimBandSeparateHandler", ossimImageHandler)
-
-//*************************************************************************************************
-//!  Constructor (default):
-//*************************************************************************************************
-ossimBandSeparateHandler::ossimBandSeparateHandler()
-{ }
-
-//*************************************************************************************************
-//! Destructor:
-//*************************************************************************************************
-ossimBandSeparateHandler::~ossimBandSeparateHandler()
-{
-   close();
-}
-
-//*************************************************************************************************
-// Opens multiple band-files based on info in metadata file.
-//*************************************************************************************************
-bool ossimBandSeparateHandler::open()
-{
-   if (isOpen())
-      close();
-
-   // Fetch the list of band filenames:
-   vector<ossimFilename> file_names;
-   getBandFileNames(file_names);
-
-   // There should be a list of filenames populated:
-   if (file_names.size() == 0)
-      return false;
-
-   m_mergeSource = new ossimBandMergeSource;
-   ossimRefPtr<ossimImageHandler> handler = 0;
-   for (ossim_uint32 band=0; band<file_names.size(); ++band)
-   {
-      // Open input band file:
-      handler = ossimImageHandlerRegistry::instance()->open(file_names[band], true, false);
-      if (!handler.valid())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)<<"ossimBandSeparateHandler::open() -- "
-            "Expected to find band file at <"<<file_names[band]<<"> but could not open file."
-            " Image not opened."<<endl;
-         close();
-         return false;
-      }
-
-      // Add this band file to the merge source:
-      m_bandFiles.push_back(handler);
-      m_mergeSource->connectMyInputTo(band, handler.get());
-   }
-
-   completeOpen();
-   return true;
-}
-
-//*************************************************************************************************
-//! Deletes the overview and clears the valid image vertices.  Derived
-//! classes should implement.
-//*************************************************************************************************
-void ossimBandSeparateHandler::close()
-{
-   vector<ossimRefPtr<ossimImageHandler> >::iterator iter = m_bandFiles.begin();
-   while (iter != m_bandFiles.end())
-   {
-      (*iter)->close();
-      *iter = 0;
-      ++iter;
-   }
-   m_bandFiles.clear();
-   m_mergeSource = 0;
-}
-
-//*************************************************************************************************
-//! Derived classes must implement this method to be concrete.
-//! @return true if open, false if not.
-//*************************************************************************************************
-bool ossimBandSeparateHandler::isOpen()const
-{
-   if (m_bandFiles.size() > 0)
-      return true;
-
-   return false;
-}
-
-//*************************************************************************************************
-//! Fills the requested tile by pulling pixels from multiple file tiles as needed.
-//*************************************************************************************************
-ossimRefPtr<ossimImageData> ossimBandSeparateHandler::getTile(const ossimIrect& tile_rect, 
-                                                              ossim_uint32 resLevel)
-{
-   // First verify that there are band-files available:
-   if ((m_bandFiles.size() == 0) || !m_mergeSource.valid())
-      return ossimRefPtr<ossimImageData>();
-
-   // Check if res level represents data in the overview:
-   if (theOverview.valid() && (resLevel > 0))
-      return theOverview->getTile(tile_rect, resLevel);
-
-   // Just pass getTile call on to contained bandMergeSource:
-   return m_mergeSource->getTile(tile_rect, resLevel);
-}
-
-//*************************************************************************************************
-//! @param resLevel Reduced resolution level to return lines of.
-//! Default = 0
-//! @return The number of lines for specified reduced resolution level.
-//*************************************************************************************************
-ossim_uint32 ossimBandSeparateHandler::getNumberOfLines(ossim_uint32 resLevel) const
-{
-   if ((m_bandFiles.size() == 0))
-      return 0;
-
-   // Using simple decimation by powers of 2:
-   ossim_uint32 numlines = m_bandFiles[0]->getNumberOfLines() >> resLevel;
-   return numlines;
-}
-
-//*************************************************************************************************
-//! @param resLevel Reduced resolution level to return samples of.
-//! Default = 0
-//! @return The number of samples for specified reduced resolution level.
-//*************************************************************************************************
-ossim_uint32 ossimBandSeparateHandler::getNumberOfSamples(ossim_uint32 resLevel) const
-{
-   if ((m_bandFiles.size() == 0))
-      return 0;
-
-   // Using simple decimation by powers of 2:
-   ossim_uint32 numsamps = m_bandFiles[0]->getNumberOfSamples() >> resLevel;
-   return numsamps;
-}
-
-//*************************************************************************************************
-//! Method to save the state of an object to a keyword list.
-//! Return true if ok or false on error.
-//*************************************************************************************************
-bool ossimBandSeparateHandler::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimImageHandler::saveState(kwl, prefix);
-}
-
-//*************************************************************************************************
-//! Method to the load (recreate) the state of an object from a keyword
-//! list.  Return true if ok or false on error.
-//*************************************************************************************************
-bool ossimBandSeparateHandler::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if (!ossimImageHandler::loadState(kwl, prefix))
-      return false;
-
-   return open();
-}
-
-//*************************************************************************************************
-// Returns the number of bands of the first tile since all tiles need to have the same pixel type.
-//*************************************************************************************************
-ossim_uint32 ossimBandSeparateHandler::getNumberOfInputBands() const
-{
-   return (ossim_uint32) m_bandFiles.size();
-}
-
-//*************************************************************************************************
-//! Returns scalar type of first tile (should be the same for all tiles)
-//*************************************************************************************************
-ossimScalarType ossimBandSeparateHandler::getOutputScalarType() const
-{
-   if ((m_bandFiles.size() == 0) || (!m_bandFiles[0].valid()))
-      return OSSIM_SCALAR_UNKNOWN;
-
-   return m_bandFiles[0]->getOutputScalarType();
-}
-
-//*************************************************************************************************
-//! Overrides base connection method to connect output of merge source.
-// Returns TRUE if connection possible
-//*************************************************************************************************
-bool ossimBandSeparateHandler::canConnectMyOutputTo(ossim_int32 index, 
-                                                    const ossimConnectableObject* obj)
-{
-   if (!m_mergeSource.valid())
-      return false;
-
-   return m_mergeSource->canConnectMyOutputTo(index, obj);
-}
-
-//*************************************************************************************************
-//! Fetches the list of band file names from the header file. The header file name is contained
-//! in ossimImageHandler::theImageFile.
-//! NOTE TO PROGRAMMER: This class is presently tailored to the Ikonos metadata file specifying
-//! the individual band files. If other "metadata" formats are to be supported, then this class
-//! should be derived from. This method would therefore be pure virtual in this base-class and only 
-//! this method would need to be implemented in the derived classes.
-//*************************************************************************************************
-void ossimBandSeparateHandler::getBandFileNames(vector<ossimFilename>& file_names)
-{
-   file_names.clear();
-
-   // Ikonos expects metadata file with text extension:
-   if (theImageFile.ext() != "txt")
-      return;
-
-   // Attempt to open the metadata file:
-   ifstream is (theImageFile.chars());
-   if (is.fail())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"ossimBandSeparateHandler::open() -- "
-         "Cannot open text file at <"<<theImageFile<<">. Image not opened."<<endl;
-      return;
-   }
-
-   vector<ossimString> fname_list;
-   const ossimString separator (" ");
-   char line_buf[4096];
-   while (!is.eof())
-   {
-      is.getline(line_buf, 4096);
-      ossimString line_str (line_buf);
-
-      // Look for mention of multiple band files. It must indicate "separate files". This comes 
-      // before the list of band files:
-      if (line_str.contains("Multispectral Files:"))
-      {
-         if (!line_str.contains("Separate Files"))
-            return;
-      }
-
-      // Look for list of band files:
-      if (line_str.contains("Tile File Name:"))
-      {
-         ossimString file_list_str = line_str.after(":");
-         file_list_str.split(fname_list, separator, true);
-         break;
-      }
-   }
-   is.close();
-
-   // Set the path of individual band files to match metadata file path:
-   ossimFilename pathName (theImageFile.path());
-   for (size_t i=0; i<fname_list.size(); ++i)
-   {
-      ossimFilename fname (fname_list[i]);
-      fname.setPath(pathName);
-      file_names.push_back(fname);
-   }
-}
-
-//*************************************************************************************************
-//! Returns the geometry of the first band.
-//*************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimBandSeparateHandler::getImageGeometry()
-{
-   if ((m_bandFiles.size() == 0) || (!m_bandFiles[0].valid()))
-      return 0;
-
-   return m_bandFiles[0]->getImageGeometry();
-}
-
diff --git a/ossim/src/ossim/imaging/ossimBitMaskTileSource.cpp b/ossim/src/ossim/imaging/ossimBitMaskTileSource.cpp
deleted file mode 100644
index 889afa1..0000000
--- a/ossim/src/ossim/imaging/ossimBitMaskTileSource.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description:
-//
-// Contains class definition for ossimBitMaskTileSource.
-//*******************************************************************
-//  $Id: ossimBitMaskTileSource.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#include <ossim/imaging/ossimBitMaskTileSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimInterleaveTypeLut.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimBitMaskWriter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <cmath>
-
-RTTI_DEF1_INST(ossimBitMaskTileSource, "ossimBitMaskTileSource", ossimImageHandler);
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimBitMaskTileSource::ossimBitMaskTileSource()
-   :
-   ossimImageHandler(),
-   m_tile(NULL)
-{
-}
-
-//*************************************************************************************************
-// Destructor must free the buffers for each res level
-//*************************************************************************************************
-ossimBitMaskTileSource::~ossimBitMaskTileSource()
-{
-   close();
-}
-
-//*************************************************************************************************
-// Reset
-//*************************************************************************************************
-void ossimBitMaskTileSource::close()
-{
-   ossimImageHandler::close();  // base class
-
-   // Wipe the mask buffers:
-   vector<ossim_uint8*>::iterator iter = m_buffers.begin();
-   while (iter != m_buffers.end())
-   {
-      delete [] (*iter);
-      iter++;
-   }
-   m_buffers.clear();
-   m_bufferSizes.clear();
-   m_tile = NULL;
-}
-
-//*************************************************************************************************
-// Opens an OSSIM Bit Mask raster file. This is a custom formatted file with header info
-//**************************************************************************************************
-bool ossimBitMaskTileSource::open()
-{
-   static const char MODULE[] = "ossimBitMaskTileSource::open()";
-
-   if (!isSupportedExtension())
-   {
-      close();
-      return false;
-   }
-
-   close();
-
-   // Open the mask file and verify magic number, read header info as well and verify good values:
-   std::ifstream fileStream(theImageFile.chars(), ios::in|ios::binary);
-   if (!fileStream.good())
-      return false;
-   ossimString magic_number;
-   int num_res_levels = 0;
-   char space;
-   fileStream >> magic_number;
-   if (magic_number == ossimBitMaskWriter::MASK_FILE_MAGIC_NUMBER)
-   {
-      // This is a next-generation mask file with header:
-      fileStream >> theStartingResLevel >> num_res_levels;
-      for (int r=0; r<num_res_levels; r++)
-      {
-         ossimIpt buffer_size;
-         fileStream >> buffer_size.x >> buffer_size.y;
-         m_bufferSizes.push_back(buffer_size);
-      }
-      fileStream >> space;
-   }
-   else
-   {
-      // This is the old headerless "Ming mask" format. Need to query the source image for image size.
-      // This format implies a starting res level of 1:
-      if (!m_handler.valid())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << MODULE << " ERROR:\nInput file <"<<theImageFile<<"> has no header information and "
-            "no valid source image has been provided. Cannot process mask" << std::endl;
-         fileStream.close();
-         close();
-         return false;
-      }
-      theStartingResLevel = 1;
-      num_res_levels = m_handler->getNumberOfDecimationLevels() - 1;
-      fileStream.seekg(0);
-
-      // Need to compute buffer sizes since they are not available in the mask header:
-      ossimIpt image_size = m_handler->getBoundingRect(1).size();
-      ossimIpt buffer_size ((image_size.x+7)/8, image_size.y);
-      for (int r=0; r<num_res_levels; r++)
-      {
-          m_bufferSizes.push_back(buffer_size);
-          buffer_size.x = (buffer_size.x+1)/2;
-          buffer_size.y = (buffer_size.y+1)/2;
-      }
-   }
-
-   if (m_bufferSizes.empty())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << MODULE << " ERROR:\nInput file <"<<theImageFile<<"> is not recognized or has invalid "
-         "header information." << std::endl;
-      fileStream.close();
-      close();
-      return false;
-   }
-
-   // Good to go, Need to now establish sizes for and offsets to each res level:
-   for (int r=0; r<num_res_levels; ++r)
-   {
-      // Allocate buffer for this res level:
-      ossim_uint32 size = m_bufferSizes[r].x * m_bufferSizes[r].y; 
-      ossim_uint8* buffer = new ossim_uint8[size];
-      m_buffers.push_back((ossim_uint8*) buffer);
-
-      // Read from disk:
-      fileStream.read((char*)buffer, size);
-      if (fileStream.fail())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << MODULE << " ERROR:"
-            << "\nError encountered reading mask file <" << theImageFile << ">"<<std::endl;
-         fileStream.close();
-         close();
-         return false;
-      }
-   }
-
-   fileStream.close();
-
-   // Allocate the mask tile. This will be 8-bits per pixel (i.e., decompressed):
-   m_tile = ossimImageDataFactory::instance()->create(this, this);
-   m_tile->initialize();
-
-   // Computes decimation factors for additional reduced res sets:
-   establishDecimationFactors();
-
-   return true;
-}
-
-//**************************************************************************************************
-// "Open" here means only that the mask buffers are valid and ready for access
-//**************************************************************************************************
-bool ossimBitMaskTileSource::isOpen() const
-{
-   return ((m_buffers.size() != 0) || (m_maskWriter.valid()));
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimBitMaskTileSource::isSupportedExtension()
-{
-   ossimString ext = theImageFile.ext();
-   if (ext == "mask")
-      return true;
-
-   return false;
-}
-
-//*************************************************************************************************
-// Unpacks the mask data into a destination tile
-//*************************************************************************************************
-ossimRefPtr<ossimImageData> ossimBitMaskTileSource::getTile(const ossimIrect& tile_rect, 
-                                                            ossim_uint32 resLevel)
-{
-   static const ossim_uint8 MASK_BITS[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
-
-   // Allocate the mask tile. This will be 8-bits per pixel (i.e., decompressed):
-   if (!m_tile.valid())
-   {
-      m_tile = ossimImageDataFactory::instance()->create(this, this);
-      m_tile->initialize();
-   }
-
-   // Initial screening:
-   if (!(isOpen() && isSourceEnabled() && isValidRLevel(resLevel)))
-      return NULL;
-
-   // Check if requested rect falls inside valid mask area:
-   if (!getImageRectangle(resLevel).intersects(tile_rect))
-      return NULL;
-
-   // Check if tile size matches requested size:
-   if ((m_tile->getWidth() != tile_rect.width()) || (m_tile->getHeight() != tile_rect.height()))
-   {
-      m_tile->setWidthHeight(tile_rect.width(), tile_rect.height());
-      m_tile->initialize();
-   }
-   m_tile->setImageRectangle(tile_rect);
-
-   // Start with blank tile if rect partially intersects defined mask area:
-   ossimIrect image_rect (getImageRectangle(resLevel));
-   if (!tile_rect.completely_within(image_rect))
-      m_tile->makeBlank();
-   
-   //##### START DEBUG CODE #########################
-   // This else if identifies unassigned mask pixels being returned by this method incorrectly.
-   // See ossimMaskFilter::executeMaskFilterSelection() (OLK 2/11)
-   //m_tile->fill(128.0);//###
-   //##### END DEBUG CODE #########################
-
-   ossimIpt image_size (image_rect.size());
-   ossim_uint32 num_mask_cols = (image_size.x+7)/8; 
-   ossim_uint8* tilebuf = (ossim_uint8*) m_tile->getBuf(0);
-   ossim_uint32 tile_index = 0, mask_index = 0, start_bit=0;
-   ossimIpt ul (tile_rect.ul());
-   ossimIpt lr (tile_rect.lr());
-
-   // Decide if we use our own mask buffer (read from file) or borrow tha active mask writer's
-   // buffer:
-   ossim_uint8* maskbuf;
-   if (m_maskWriter.valid())
-      maskbuf = m_maskWriter->m_buffers[resLevel-theStartingResLevel];
-   else
-      maskbuf = m_buffers[resLevel-theStartingResLevel];
-
-   // Nested loop to fill tile:
-   for (int y=ul.y; (y<=lr.y)&&(y<image_size.y); y++)
-   {
-      mask_index = y*num_mask_cols + ul.x/8;
-      start_bit = ul.x % 8; // may not start on even mask byte boundary
-      for (int x=ul.x; x<=lr.x;)
-      {
-         if (x < image_size.x)
-         {
-            // fetch mask pixel and isolate bit of interest:
-            for (ossim_uint32 mask_bit=start_bit; mask_bit<8; ++mask_bit)
-            {
-               if (maskbuf[mask_index] & MASK_BITS[mask_bit])
-                  tilebuf[tile_index++] = 255;
-               else
-                  tilebuf[tile_index++] = 0;
-
-               // Advance the pixel column and check for end of image rect:
-               ++x;
-               if ((x >= image_size.x) || (x>lr.x))
-                  break;
-            }
-
-            ++mask_index; // advance the mask buffer index 1 after processing 8 tile samples
-            start_bit = 0;
-         }
-         else
-         {
-            // Tile buffer extends beyond valid mask rect, so assume it is masked (0):
-            tilebuf[tile_index++] = 0;
-            ++x;
-         }
-      }
-   }
-   
-   m_tile->validate();
-   return m_tile;
-}
-
-//*******************************************************************
-// Argument res_Level is relative to the full image
-//*******************************************************************
-bool ossimBitMaskTileSource::isValidRLevel(ossim_uint32 res_Level) const
-{
-   ossim_uint32 num_rlevels;
-   if (m_maskWriter.valid())
-      num_rlevels = (ossim_uint32) m_maskWriter->m_buffers.size();
-   else
-      num_rlevels = (ossim_uint32) m_buffers.size();
-
-   return ((res_Level >= theStartingResLevel) && 
-           ((res_Level-theStartingResLevel) < num_rlevels));
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimBitMaskTileSource::getNumberOfLines(ossim_uint32 res_Level) const
-{
-   if (!isValidRLevel(res_Level))
-      return 0;
-
-   if (m_maskWriter.valid())
-      return m_maskWriter->m_bufferSizes[res_Level-theStartingResLevel].y;
-
-   return m_bufferSizes[res_Level-theStartingResLevel].y;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimBitMaskTileSource::getNumberOfSamples(ossim_uint32 res_Level) const
-{
-   if (!isValidRLevel(res_Level))
-      return 0;
-
-   ossim_uint32 n = 0;
-   if (m_maskWriter.valid())
-      n = m_maskWriter->m_bufferSizes[res_Level-theStartingResLevel].x;
-   else
-      n = m_bufferSizes[res_Level-theStartingResLevel].x;
-
-   return n*8; // 8 pixels represented in one mask byte entry
-}
-
-ossimRefPtr<ossimImageGeometry> ossimBitMaskTileSource::getImageGeometry()
-{
-   return 0;
-}
-
-//*******************************************************************
-//! Overrides base class implementation.
-//*******************************************************************
-ossim_uint32 ossimBitMaskTileSource::getNumberOfDecimationLevels() const
-{
-   return (ossim_uint32) theDecimationFactors.size();
-}
-
-//*******************************************************************
-//! Overrides base class implementation.
-//*******************************************************************
-void ossimBitMaskTileSource::establishDecimationFactors()
-{
-   theDecimationFactors.clear();
-   ossim_uint32 num_res_levels = (ossim_uint32) m_buffers.size();
-   ossimDpt decimation(1, 1);
-   for (ossim_uint32 r=0; r<num_res_levels; r++)
-   {
-      theDecimationFactors.push_back(decimation);
-      decimation = decimation/2.0;
-   }
-}
-
-//*************************************************************************************************
-//! This class can be used during overview generation, in which case there will be a simultaneous
-//! mask writing. Instead of accessing a mask file (which may not yet exist), the mask buffer
-//! of the writer will be accessed directly instead of our own buffer.
-//*************************************************************************************************
-void ossimBitMaskTileSource::setAssociatedMaskWriter(ossimBitMaskWriter* maskWriter)
-{ 
-   m_maskWriter = maskWriter; 
-   if (m_maskWriter.valid())
-      theStartingResLevel = m_maskWriter->m_startingResLevel;
-}
-
-//*************************************************************************************************
-//! For backward compatibility with older mask format ("Ming Mask"), provide for associating
-//! the mask with an image handler:
-//*************************************************************************************************
-void ossimBitMaskTileSource::setAssociatedImageHandler(ossimImageHandler* handler)
-{
-   m_handler = handler;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimBitMaskWriter.cpp b/ossim/src/ossim/imaging/ossimBitMaskWriter.cpp
deleted file mode 100644
index f5c23c5..0000000
--- a/ossim/src/ossim/imaging/ossimBitMaskWriter.cpp
+++ /dev/null
@@ -1,482 +0,0 @@
-//*************************************************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description: Contains implementation of class for computing a mask from an input image.
-//   The mask is stored in a compressed format where one byte represents 8 bit-masks for masking
-//   8 image pixels. 
-//*************************************************************************************************
-//  $Id: ossimBitMaskWriter.cpp 3081 2011-12-22 16:34:12Z oscar.kramer $
-
-#include <ossim/imaging/ossimBitMaskWriter.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageHandler.h>
-
-const char* ossimBitMaskWriter::MASK_FILE_MAGIC_NUMBER = "OSSIM_BIT_MASK";
-const char* ossimBitMaskWriter::BM_STARTING_RLEVEL_KW = "starting_rlevel";
-
-//*************************************************************************************************
-// Constructor accepts handler to the source imagery being used to compute the mask.
-//*************************************************************************************************
-ossimBitMaskWriter::ossimBitMaskWriter()
-   :
-   m_flipper(0),
-   m_startingResLevel(0)
-{
-}
-
-//*************************************************************************************************
-// Destructor
-//*************************************************************************************************
-ossimBitMaskWriter::~ossimBitMaskWriter()
-{
-   // Make sure the mask file was written out before disappearing:
-   if (isOpen())
-      close();
-}
-
-//*************************************************************************************************
-// Returns true if buffers allocated:
-//*************************************************************************************************
-bool ossimBitMaskWriter::isOpen() const
-{
-   return (m_buffers.size() != 0);
-}
-
-//*************************************************************************************************
-// Returns true if buffers allocated:
-//*************************************************************************************************
-bool ossimBitMaskWriter::open()
-{
-   // Nothing to do yet. Eventually want to open the output stream here and write the buffer after
-   // each R-level is completed, so we don't need to keep vector of buffers in memory.
-   return true; 
-}
-
-//*************************************************************************************************
-// Reset
-//*************************************************************************************************
-void ossimBitMaskWriter::reset()
-{
-   // Wipe the mask buffers:
-   vector<ossim_uint8*>::iterator iter = m_buffers.begin();
-   while (iter != m_buffers.end())
-   {
-      delete [] (*iter);
-      iter++;
-   }
-   m_buffers.clear();
-   m_bufferSizes.clear();
-}
-
-//*************************************************************************************************
-//! Sets the NULL pixel value to consider when computing mask:
-//*************************************************************************************************
-void ossimBitMaskWriter::setBogusPixel(double pixel_value)
-{
-   if (!m_flipper.valid())
-      initializeFlipper();
-
-   m_flipper->setTargetValue(pixel_value);
-}
-
-//*************************************************************************************************
-//! Sets the range of pixels (inclusive) to be regarded as NULL pixels when computing mask
-//*************************************************************************************************
-void ossimBitMaskWriter::setBogusPixelRange(double min, double max)
-{
-   if (!m_flipper.valid())
-      initializeFlipper();
-
-   m_flipper->setTargetRange(min, max);
-}
-
-//*************************************************************************************************
-// Given a source's tile, derives the alpha mask and saves it in buffer for later writing to disk.
-//*************************************************************************************************
-void ossimBitMaskWriter::generateMask(ossimRefPtr<ossimImageData> tile, ossim_uint32 rLevel)
-{
-   static const ossim_uint8 MASK_BITS_0[] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE};
-   static const ossim_uint8 MASK_BITS_1[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
-
-   // We don't start doing anything until starting res or higher requested:
-   ossim_uint32 mask_rlevel = rLevel - m_startingResLevel;
-   if (!tile.valid())
-      return;
-
-   // We should have had this done by now, but just in case:
-   if (!m_flipper.valid())
-      initializeFlipper();
-
-   // The flipper is used to identify null pixels since it has more sophisticated filtering 
-   // than available from the tile object:
-   switch (tile->getScalarType())
-   {
-   case OSSIM_UCHAR:
-      m_flipper->flipPixels(ossim_uint8(0), tile.get(), rLevel);
-      break;
-   case OSSIM_UINT16:
-   case OSSIM_USHORT11:
-      m_flipper->flipPixels(ossim_uint16(0), tile.get(), rLevel);
-      break;
-   case OSSIM_SSHORT16:
-      m_flipper->flipPixels(ossim_sint16(0), tile.get(), rLevel);
-      break;
-   case OSSIM_UINT32:
-      m_flipper->flipPixels(ossim_uint32(0), tile.get(), rLevel);
-      break;
-   case OSSIM_SINT32:
-      m_flipper->flipPixels(ossim_sint32(0), tile.get(), rLevel);
-      break;
-   case OSSIM_FLOAT32:
-   case OSSIM_NORMALIZED_FLOAT:
-      m_flipper->flipPixels(float(0), tile.get(), rLevel);
-      break;
-   case OSSIM_NORMALIZED_DOUBLE:
-   case OSSIM_FLOAT64:
-      m_flipper->flipPixels(ossim_float64(0), tile.get(), rLevel);
-      break;
-   case OSSIM_SCALAR_UNKNOWN:
-   default:
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimBitMaskWriter::generateMask()-- "
-         "Unsupported scalar type!" << endl;
-      break;
-   }
-
-   ossimIpt image_size = computeImageSize(rLevel, tile.get());
-   ossim_uint32 num_mask_cols = (image_size.x+7)/8; // size of mask buffer after compression
-   ossim_uint32 num_mask_rows = image_size.y;
-   ossim_uint8* maskbuf = 0;
-
-   // Check if mask buffer for this R-level has already been allocated:
-   if (m_buffers.size() <= mask_rlevel)
-   {
-      ossim_uint32 size_of_maskbuf = num_mask_rows * num_mask_cols;
-      maskbuf = new ossim_uint8[size_of_maskbuf];
-      memset(maskbuf, 0, size_of_maskbuf);
-      m_buffers.push_back(maskbuf);
-      m_bufferSizes.push_back(ossimIpt(num_mask_cols, num_mask_rows));
-   }
-   else
-      maskbuf = m_buffers[mask_rlevel];
-
-   ossim_uint32 mask_index=0, tile_index=0, start_bit=0;
-   ossimIrect tile_rect (tile->getImageRectangle());
-   ossimIpt ul (tile_rect.ul());
-   ossimIpt lr (tile_rect.lr());
-
-   // Scan each pixel in the source tile and decide on mask value:
-   for (int y=ul.y; (y<=lr.y)&&(y<image_size.y); y++)
-   {
-      mask_index = y*num_mask_cols + ul.x/8;
-      start_bit = ul.x % 8; // may not start on even mask byte boundary
-
-      for (int x=ul.x; (x<=lr.x); /* incremented in bit loop below */ )         
-      {
-         if ( x < image_size.x )
-         {
-            // Process 8 samples and pack resultant mask into one byte:
-            maskbuf[mask_index] = 0;
-            for (ossim_uint32 mask_bit=start_bit; mask_bit<8; ++mask_bit)
-            {
-               // Decide whether to mask depending on pixel flipper outputting a NULL pixel. 
-               // if (tile->isNull(tile_index++))
-               if (tile->isNull(tile_index++))                  
-                  maskbuf[mask_index] &=  MASK_BITS_0[mask_bit];
-               else
-                  maskbuf[mask_index] |= MASK_BITS_1[mask_bit];
-               
-               // Advance the pixel column and check for end of image rect:
-               ++x;
-               if ((x >= image_size.x) || (x > lr.x))
-                  break;
-            }
-            ++mask_index; // advance the mask buffer index 1 after processing 8 tile samples
-            start_bit = 0;
-         }
-         else
-         {
-            ++x;
-            
-            ++tile_index;
-         }
-      }
-   } // Finished looping over all pixels in input tile
-
-   return;
-}
-
-//*************************************************************************************************
-//! Writes the mask file to path specified. Returns TRUE if successful.
-//*************************************************************************************************
-void ossimBitMaskWriter::close()
-{
-   static const char* MODULE = "ossimBitMaskWriter::writeMask()";
-   static const ossimString MASK_EXTENSION ("mask");
-
-   // Open the output file. Use default name if none provided.
-   if (theOutputName.empty()) // Couldn't figure out the name
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<" -- Error encountered trying to create mask file" 
-         " for writing because output file name was never initialized.";
-      return;
-   }
-
-   ofstream maskFileStream (theOutputName.chars(), ios::out|ios::binary);
-   if (!maskFileStream.is_open())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<" -- Error encountered trying to create mask file" 
-         "<"<<theOutputName<<"> for writing. Cannot write mask.";
-      return;
-   }
-
-   // Write the header info:
-   ossim_uint32 num_rlevels = (ossim_uint32) m_buffers.size();
-   maskFileStream << MASK_FILE_MAGIC_NUMBER <<" "<< m_startingResLevel <<" "<< num_rlevels<<" ";
-   for (ossim_uint32 r=0; r<num_rlevels; r++)
-      maskFileStream << m_bufferSizes[r].x <<" "<< m_bufferSizes[r].y <<" "; 
-   maskFileStream << ends;
-
-   // Loop over each res level and write buffers to disk:
-   for (ossim_uint32 rlevel = 0; rlevel<num_rlevels; ++rlevel)
-   {
-      ossim_uint32 bufsize = m_bufferSizes[rlevel].x * m_bufferSizes[rlevel].y;
-      maskFileStream.write((char*)(m_buffers[rlevel]), bufsize);
-   }
-
-   maskFileStream.close();
-   reset();
-
-   return;
-}
-
-//*************************************************************************************************
-//! Constructor accepts keywordlist with all info necessary to compute a mask. The caller will
-//! still need to call writeMask().
-//*************************************************************************************************
-bool ossimBitMaskWriter::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   // static const char* MODULE = "ossimBitMaskWriter::writeMask(kwl)";
-
-   initializeFlipper();
-
-   // Fetch optional output filename:
-   theOutputName = kwl.find(prefix, ossimKeywordNames::OUTPUT_FILE_KW);
-
-   // Initialize the pixel flipper. This filter is used to identify pixels targeted for masking by
-   // remapping them to the null pixel:
-   m_flipper->loadState(kwl, prefix);
-
-   // Read Starting res level:
-   m_startingResLevel = 0;
-   ossimString kw_value = kwl.find(prefix, BM_STARTING_RLEVEL_KW);
-   if (!kw_value.empty())
-      m_startingResLevel = kw_value.toUInt32();
-
-   return true;
-}
-
-//*************************************************************************************************
-// 
-//*************************************************************************************************
-void ossimBitMaskWriter::initializeFlipper()
-{
-   if (!m_flipper.valid())
-   {
-      m_flipper = new ossimPixelFlipper();
-      m_flipper->setReplacementMode(ossimPixelFlipper::REPLACE_ONLY_FULL_TARGETS);
-      m_flipper->setTargetValue(0);
-      m_flipper->setReplacementValue(0);
-   }
-
-   // This method gets called when an input connection is made as well as other times, so keep an
-   // eye out for valid input connection:
-   if (theInputObjectList.size() != 0)
-   {
-      m_flipper->connectMyInputTo(theInputObjectList[0].get());
-   }
-}
-
-//*************************************************************************************************
-// 
-//*************************************************************************************************
-bool ossimBitMaskWriter::canConnectMyInputTo(ossim_int32 /*myInputIndex*/, 
-                                             const ossimConnectableObject* object) const
-{
-   const ossimImageSource* ois = dynamic_cast<const ossimImageSource*>(object);
-   return (ois != NULL);
-}
-
-//*************************************************************************************************
-// 
-//*************************************************************************************************
-ossim_int32 ossimBitMaskWriter::connectMyInputTo (ossimConnectableObject *inputObject, 
-                                                  bool makeOutputConnection, 
-                                                  bool createEventFlag)
-{
-   ossimImageSource* input_source = dynamic_cast<ossimImageSource*>(inputObject);
-   if (input_source == NULL)
-      return -1;
-
-   // Base class takes care of connection with this object:
-   ossimConnectableObject::connectMyInputTo(input_source, makeOutputConnection, createEventFlag);
-
-   // This input should be an image handler, but may need to search the objects inputs in case
-   // it is chained:
-   ossimImageHandler* handler = dynamic_cast<ossimImageHandler*>(input_source);
-   if (handler == NULL)
-   {
-      // Need to search:
-      ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
-                                   true,
-                                   ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
-      
-      input_source->accept(visitor);
-      ossimRefPtr<ossimObject> obj = visitor.getObject();
-      if ( obj.valid() )
-      {
-         handler = dynamic_cast<ossimImageHandler*>( obj.get() );
-      }
-   }
-
-   // Should have a handler:
-   if (!handler)
-   { 
-      disconnectAllInputs();
-      return -1;
-   }
-
-   // A handler has been identified. Need the filename:
-   ossimFilename imageFile =  handler->getFilename();
-   if (imageFile.contains("ovr.tmp"))
-   {
-      // The handler is actually an overview, need some massaging to work since the overview may
-      // not have an R0 entry and R1 rect must be requested instead:
-      m_imageSize = handler->getBoundingRect(1).size() * 2; 
-      imageFile = imageFile.noExtension();
-   }
-   else
-   {
-      // This is normal image handler so it is OK to request R0 rect:
-      m_imageSize = handler->getBoundingRect(0).size(); 
-   }
-   if (theOutputName.empty())
-      theOutputName = imageFile.setExtension("mask");
-
-   // Check if the pixel flipper was initialized:
-   if (m_flipper.valid())
-      m_flipper->connectMyInputTo(input_source);
-   else
-      initializeFlipper();
-
-   return 0;
-}
-
-//*************************************************************************************************
-//! Since overviews may not yet exist when the mask is being written, we must compute the
-//! size of the mask buffer based on the original R0 image size.
-//*************************************************************************************************
-ossimIpt ossimBitMaskWriter::computeImageSize(ossim_uint32 rlevel, ossimImageData* tile) const
-{
-   if (rlevel == 0)
-      return m_imageSize;
-
-   ossimIpt isize (m_imageSize);
-   for (ossim_uint32 r=1; r<=rlevel; r++)
-   {
-      isize.x = (isize.x + 1) / 2;
-      isize.y = (isize.y + 1) / 2;
-   }
-
-   // Adjust size n X direction to even mask boundary:
-   ossimIpt tile_size (tile->getWidth(), tile->getHeight());
-   isize.x = ((int)(isize.x+7)/8) * 8;
-
-   return isize;
-}
-
-//*************************************************************************************************
-// For imagery that already has overviews built, but with artifact edge pixels (such as JP2-
-// compressed data), it is preferred to build the mask overviews directly from the R0 mask.
-// This method will build the specified number of R-levels (including R0) from the last defined
-// mask buffer. Returns TRUE if successful.
-// disk.
-//*************************************************************************************************
-bool ossimBitMaskWriter::buildOverviews(ossim_uint32 total_num_rlevels)
-{
-   // First establish the remaining number of R-levels to generate, and the last valid R-level
-   // currently in memory:
-   if (m_buffers.size() == 0)
-      return false;
-   if (m_buffers.size() == total_num_rlevels)
-      return true; // nothing to do
-   ossim_uint32 ref_rlevel = m_startingResLevel + (ossim_uint32) m_buffers.size() - 1;
-   ossim_uint32 ovr_rlevel = ref_rlevel + 1;
-
-   ossimIpt ref_size (m_bufferSizes[ref_rlevel-m_startingResLevel]);
-   ossim_uint8 *ref_buf = m_buffers[ref_rlevel-m_startingResLevel];
-   ossim_uint32 ref_index = 0, ovr_index = 0;
-   ossim_uint8 *ovr_buf = 0;
-   ossim_uint32 size_of_refbuf = ref_size.x * ref_size.y;
-
-   // Loop over all remaining res levels:
-   while (ovr_rlevel != total_num_rlevels)
-   {
-      // Allocate the buffer at this R-level:
-      ossimIpt ovr_size ((ref_size.x+1)/2, (ref_size.y+1)/2);
-      ossim_uint32 size_of_ovrbuf = ovr_size.x * ovr_size.y;
-      if (size_of_ovrbuf == 0)
-         return false;
-      ovr_buf = new ossim_uint8[size_of_ovrbuf];
-      memset(ovr_buf, 0, size_of_ovrbuf);
-      m_buffers.push_back(ovr_buf);
-      m_bufferSizes.push_back(ovr_size);
-
-      // Loop over each output overview pixel, considering the underlying rlevel (equivalent to
-      // nearest-neighbor resampling for overview at 2X decimation):
-      for (int y=0; y<ovr_size.y; y++)
-      {
-         ref_index = 2*y*ref_size.x;
-         ovr_index = y*ovr_size.x;
-
-         for (int x=0; x<ovr_size.x; x++)
-         {
-            ossim_uint8 a = 0;
-            ossim_uint8 b = 0;
-            if (ref_index < size_of_refbuf)
-            {
-               a = ref_buf[ref_index++];
-               if ((x < (ovr_size.x-1)) || !(ref_size.x & 1))
-                  b = ref_buf[ref_index++];
-            }
-            ovr_buf[ovr_index++] = ( (a & 0x80)       |
-                                    ((a & 0x20) << 1) |
-                                    ((a & 0x08) << 2) |
-                                    ((a & 0x02) << 3) |
-                                    ((b & 0x80) >> 4) |
-                                    ((b & 0x20) >> 3) |
-                                    ((b & 0x08) >> 2) |
-                                    ((b & 0x02) >> 1));
-
-         }
-      }
-
-      // Advance to next rlevel:
-      ref_buf = ovr_buf;
-      ref_size = ovr_size;
-      size_of_refbuf = size_of_ovrbuf;
-      ++ovr_rlevel;
-   }
-
-   return true;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimBlendMosaic.cpp b/ossim/src/ossim/imaging/ossimBlendMosaic.cpp
deleted file mode 100644
index af2db43..0000000
--- a/ossim/src/ossim/imaging/ossimBlendMosaic.cpp
+++ /dev/null
@@ -1,593 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBlendMosaic.cpp 20696 2012-03-19 12:36:40Z dburken $
-
-#include <ossim/imaging/ossimBlendMosaic.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimBlendMosaic, "ossimBlendMosaic", ossimImageMosaic)
-
-ossimBlendMosaic::ossimBlendMosaic()
-   : ossimImageMosaic(),
-     theNormResult(NULL)
-{
-}
-
-ossimBlendMosaic::ossimBlendMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
-   : ossimImageMosaic(inputSources),
-     theNormResult(NULL)
-{
-   initialize();
-}
-
-ossimBlendMosaic::~ossimBlendMosaic()
-{
-}
-
-void ossimBlendMosaic::initialize()
-{   
-   ossimImageMosaic::initialize();
-
-   allocate();
-
-   // only allocate this space if we have to
-   if(hasDifferentInputs())
-   {
-      theNormResult = new ossimImageData(this,
-                                         OSSIM_NORMALIZED_FLOAT,
-                                         theLargestNumberOfInputBands);
-      theNormResult->initialize();
-   }
-      
-   if(theWeights.size() < theInputObjectList.size())
-   {
-      for(ossim_uint32 index =(ossim_uint32)theWeights.size();
-          index < theInputObjectList.size();
-          ++index)
-      {
-         theWeights.push_back(1.0);
-      }
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimBlendMosaic::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{   
-   // ossimIpt origin = tileRect.ul();
-   if(!isSourceEnabled())
-   {
-      return ossimImageMosaic::getTile(tileRect, resLevel);
-   }
-   
-   ossim_uint32 size = getNumberOfInputs();
-   if(!theTile.get())
-   {
-      // try to initialize
-      initialize();
-
-      // if we still don't have a buffer
-      // then we will leave
-      if(!theTile.get())
-      {
-         return theTile;
-      }
-   }
-
-   if(size == 0)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-   if(size == 1)
-   {
-      return ossimImageMosaic::getTile(tileRect, resLevel);
-   }
-
-   theTile->setImageRectangle(tileRect);
-   theTile->makeBlank();
-   if(theNormResult.valid())
-   {
-      theNormResult->setImageRectangle(tileRect);
-      theNormResult->makeBlank();
-   }
-   
-   switch(theTile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint8>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint8>(0), tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SINT8:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint8>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint8>(0), tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_FLOAT32: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<float>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<float>(0), tileRect, resLevel);
-         }
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint16>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint16>(0), tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SINT16:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint16>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint16>(0), tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SINT32:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint32>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint32>(0), tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_UINT32:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint32>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint32>(0), tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<double>(0), tileRect, resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<double>(0), tileRect, resLevel);
-         }
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimBlendMosaic::getTile NOTICE:\n"
-            << "Scalar type = " << theTile->getScalarType()
-            << " Not supported by ossimImageMosaic" << endl;
-       }
-   }
-
-   return ossimRefPtr<ossimImageData>();   
-}
-
-template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combine(
-   T,
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-  ossimRefPtr<ossimImageData> currentImageData=NULL;
-  ossim_uint32 band;
-  double currentWeight = 1.0;
-  double previousWeight = 1.0;
-  // double sumOfWeights   = 1;
-  long offset = 0;
-  long row    = 0;
-  long col    = 0;
-  ossim_uint32 layerIdx = 0;
-  currentImageData = getNextTile(layerIdx, 0, tileRect, resLevel);
-  
-  if(!currentImageData.get()) // if we don't have one then return theTile
-  {
-     return theTile;
-  }
-  
-  T** srcBands  = new T*[theLargestNumberOfInputBands];
-  T** destBands = new T*[theLargestNumberOfInputBands];
-  T*  nullPix   = new T[theTile->getNumberOfBands()];
-  
-  previousWeight = theWeights[layerIdx];
-  //    // now get the previous weight and then combine the two into one.
-	 // let's assign the bands
-  for(band = 0; band < theLargestNumberOfInputBands; ++band)
-  {
-     destBands[band] = static_cast<T*>(theTile->getBuf(band));
-     nullPix[band]   = static_cast<T>(theTile->getNullPix(band));
-  }
-  while(currentImageData.get())
-  {
-      ossimDataObjectStatus currentStatus =
-         currentImageData->getDataObjectStatus();
-      
-      // set the current weight for the current tile.
-      currentWeight = theWeights[layerIdx];
-
-      // sumOfWeights = previousWeight+currentWeight;
-      if( (currentStatus != OSSIM_EMPTY) &&
-	  (currentStatus != OSSIM_NULL))
-       {	 
-	 long h = (long)currentImageData->getHeight();
-	 long w = (long)currentImageData->getWidth();
-	 offset = 0;
-	 ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-	 
-	 // let's assign the bands
-	 for(band = 0; band < minNumberOfBands; ++band)
-	   {
-	     srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
-	   }
-	 for(;band < theLargestNumberOfInputBands; ++band)
-	   {
-	     srcBands[band]  = srcBands[minNumberOfBands - 1];
-	   }
-
- 	 if(currentStatus == OSSIM_PARTIAL)
-         {
-            for(row = 0; row < h; ++row)
-            {
-               for(col = 0; col < w; ++col)
-               {
-                  if(!currentImageData->isNull(offset))
-                  {
-                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
-                     {
-                        if(destBands[band][offset] != nullPix[band])
-                        {
-//                            destBands[band][offset] = static_cast<T>((destBands[band][offset]*(1.0-currentWeight) +  
-//                                                                      srcBands[band][offset]*currentWeight));
-                           destBands[band][offset] = static_cast<T>((destBands[band][offset]*previousWeight + 
-                                                                     srcBands[band][offset]*currentWeight)/(previousWeight+currentWeight));
-                        }
-                        else
-                        {
-                           destBands[band][offset] = srcBands[band][offset];
-                        }
-                     }	 
-                  }
-                  ++offset;
-               }
-            }
-         }
-	 else
-         {
-            for(row = 0; row < h; ++row)
-            {
-               for(col = 0; col < w; ++col)
-               {
-                  for(band = 0; band < theLargestNumberOfInputBands; ++band)
-                  {			
-                     if(destBands[band][offset] != nullPix[band])
-                     {
-                        destBands[band][offset] = static_cast<T>((destBands[band][offset]*previousWeight+ 
-                                                                  srcBands[band][offset]*currentWeight)/(previousWeight + currentWeight));
-                     }
-                     else
-                     {
-                        destBands[band][offset] = srcBands[band][offset];
-                     }
-                  }
-                  ++offset;
-               }
-            }
-         }
-       }
-      currentImageData = getNextTile(layerIdx, tileRect, resLevel);
-      previousWeight   = (previousWeight+currentWeight)/2.0;
-    }
-  delete [] srcBands;
-  delete [] destBands;
-  delete [] nullPix;
-  theTile->validate();
-
-  return theTile;   
-}
-
-template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combineNorm(
-   T, const ossimIrect& tileRect, ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> currentImageData=NULL;
-   ossim_uint32 band;
-   double currentWeight = 1.0;
-   double previousWeight = 1.0;
-   // double sumOfWeights   = 1;
-   long offset = 0;
-   long row    = 0;
-   long col    = 0;
-   ossim_uint32 layerIdx = 0;
-   currentImageData = getNextNormTile(layerIdx, 0, tileRect, resLevel);
-  
-   if(!currentImageData.get()) // if we don't have one then return theTile
-   {
-      return theTile;
-   }
-   theNormResult->makeBlank();
-   float** srcBands  = new float*[theLargestNumberOfInputBands];
-   float** destBands = new float*[theLargestNumberOfInputBands];
-   float*  nullPix   = new float[theTile->getNumberOfBands()];
-  
-   previousWeight = theWeights[layerIdx];
-   //    // now get the previous weight and then combine the two into one.
-   // let's assign the bands
-   for(band = 0; band < theLargestNumberOfInputBands; ++band)
-   {
-      destBands[band] = static_cast<float*>(theNormResult->getBuf(band));
-      nullPix[band]   = static_cast<float>(theNormResult->getNullPix(band));
-   }
-   while(currentImageData.get())
-   {
-      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
-     
-      // set the current weight for the current tile.
-      currentWeight = theWeights[layerIdx];
-     
-      // sumOfWeights = previousWeight+currentWeight;
-      if( (currentStatus != OSSIM_EMPTY) &&
-          (currentStatus != OSSIM_NULL))
-      {	 
-         long h = (long)currentImageData->getHeight();
-         long w = (long)currentImageData->getWidth();
-         offset = 0;
-         ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-        
-         // let's assign the bands
-         for(band = 0; band < minNumberOfBands; ++band)
-         {
-            srcBands[band]  = static_cast<float*>(currentImageData->getBuf(band));
-         }
-         for(;band < theLargestNumberOfInputBands; ++band)
-         {
-            srcBands[band]  = srcBands[minNumberOfBands - 1];
-         }
-        
-         if(currentStatus == OSSIM_PARTIAL)
-         {
-            for(row = 0; row < h; ++row)
-            {
-               for(col = 0; col < w; ++col)
-               {
-                  if(!currentImageData->isNull(offset))
-                  {
-                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
-                     {
-                        if(destBands[band][offset] != nullPix[band])
-                        {
-                           destBands[band][offset] = static_cast<float>((destBands[band][offset]*previousWeight + 
-                                                                         srcBands[band][offset]*currentWeight)/(previousWeight+currentWeight));
-                        }
-                        else
-                        {
-                           destBands[band][offset] = srcBands[band][offset];
-                        }
-                     }	 
-                  }
-                  ++offset;
-               }
-            }
-         }
-         else
-         {
-            for(row = 0; row < h; ++row)
-            {
-               for(col = 0; col < w; ++col)
-               {
-                  for(band = 0; band < theLargestNumberOfInputBands; ++band)
-                  {			
-                     if(destBands[band][offset] != nullPix[band])
-                     {
-                        destBands[band][offset] = static_cast<float>((destBands[band][offset]*previousWeight+ 
-                                                                      srcBands[band][offset]*currentWeight)/(previousWeight + currentWeight));
-                     }
-                     else
-                     {
-                        destBands[band][offset] = srcBands[band][offset];
-                     }
-                  }
-                  ++offset;
-               }
-            }
-         }
-      }
-      currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
-      previousWeight   = (previousWeight+currentWeight)/2.0;
-   }
-   theNormResult->validate();
-   theTile->copyNormalizedBufferToTile((float*)theNormResult->getBuf());
-   delete [] srcBands;
-   delete [] destBands;
-   delete [] nullPix;
-   theTile->validate();
-
-   return theTile;   
-}
-
-bool ossimBlendMosaic::saveState(ossimKeywordlist& kwl,
-                                 const char* prefix)const
-{
-   bool result = ossimImageMosaic::saveState(kwl, prefix);
-
-   ossimString copyPrefix    = prefix;
-   for(ossim_uint32 index = 0; index < theWeights.size(); ++index)
-   {
-      ossimString weightStr = ossimString("weight") +
-                              ossimString::toString(index);
-      kwl.add(copyPrefix.c_str(),
-              weightStr.c_str(),
-              theWeights[index],
-              true);
-   }
-   
-   return result;
-}
-
-bool ossimBlendMosaic::loadState(const ossimKeywordlist& kwl,
-                                 const char* prefix)
-{
-   bool result = ossimImageMosaic::loadState(kwl, prefix);
-   ossim_uint32 count = 0;
-   theWeights.clear();
-   if(result)
-   {
-      ossimString copyPrefix    = prefix;
-      ossimString regExpression =  ossimString("^(") + copyPrefix + "weight[0-9]+)";
-      ossim_uint32 result = kwl.getNumberOfSubstringKeys(regExpression);
-            
-      ossim_uint32 numberOfMatches = 0;
-      while(numberOfMatches < result)
-      {
-         ossimString value = ossimString("weight") + ossimString::toString(count);
-
-         const char* lookup = kwl.find(copyPrefix.c_str(),
-                                       value.c_str());
-         
-         if(lookup)
-         {
-            ++numberOfMatches;
-            theWeights.push_back(ossimString(lookup).toDouble());
-         }
-
-         ++count;
-      }
-   }
-   
-   return result;
-}
-
-
-void ossimBlendMosaic::setNumberOfWeights(ossim_uint32 numberOfWeights)
-{
-   if(numberOfWeights > theWeights.size())
-   {
-      ossim_uint32 length = numberOfWeights - (ossim_uint32) theWeights.size();
-      for(ossim_uint32 index= 0; index < length; ++ index)
-      {
-         theWeights.push_back(1.0);
-      }
-   }
-   else if(numberOfWeights < theWeights.size())
-   {
-      // copy the list
-      vector<double> temp(theWeights.begin(),
-                          theWeights.begin()+numberOfWeights);
-      // now shrink
-      theWeights = temp;
-   }
-}
-
-void ossimBlendMosaic::setAllWeightsTo(double value)
-{
-   for(ossim_uint32 index = 0; index < theWeights.size(); ++index)
-   {
-      theWeights[index] = value;
-   }
-}
-
-void ossimBlendMosaic::normalizeWeights()
-{
-  double sumWeights=0.0;
-  ossim_uint32 index = 0;
-  for(index = 0; index < theWeights.size(); ++index)
-    {
-      sumWeights+=theWeights[index];
-    }
-  if(sumWeights > 0.0)
-    {
-      for(index = 0; index < theWeights.size(); ++index)
-	{
-	  theWeights[index] /= sumWeights;
-	}
-    }
-}
-
-void ossimBlendMosaic::findMinMax(double& minValue, double& maxValue)const
-{
-   if(theWeights.size() > 0)
-   {
-      minValue = maxValue = theWeights[0];
-
-      for(ossim_uint32 index = 1; index < theWeights.size(); ++index)
-      {
-         minValue = minValue < theWeights[index]?minValue:theWeights[index];
-         maxValue = maxValue > theWeights[index]?maxValue:theWeights[index];
-      }
-   }
-}
-
-void ossimBlendMosaic::setWeight(ossim_uint32 index, double weight)
-{
-   if(index < theWeights.size())
-   {
-      theWeights[index] = weight;
-   }
-}
-
-void ossimBlendMosaic::setWeights(const std::vector<double>& weights)
-{
-   theWeights = weights;
-}
-
-const vector<double>& ossimBlendMosaic::getWeights()const
-{
-   return theWeights;
-}
-
-double ossimBlendMosaic::getWeight(ossim_uint32 index) const
-{
-   if(index < theWeights.size())
-   {
-      return theWeights[index];
-   }
-   if(theWeights.size())
-   {
-      return theWeights[theWeights.size()-1];
-   }
-   return 0;
-}
diff --git a/ossim/src/ossim/imaging/ossimBrightnessMatch.cpp b/ossim/src/ossim/imaging/ossimBrightnessMatch.cpp
deleted file mode 100644
index 8e2cfc5..0000000
--- a/ossim/src/ossim/imaging/ossimBrightnessMatch.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: A brief description of the contents of the file.
-//
-//*************************************************************************
-// $Id: ossimBrightnessMatch.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimBrightnessMatch.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNormRgbVector.h>
-#include <ossim/base/ossimHsiVector.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-
-RTTI_DEF1(ossimBrightnessMatch,
-          "ossimBrightnessMatch",
-          ossimImageSourceFilter)
-   
-ossimBrightnessMatch::ossimBrightnessMatch()
-   :ossimImageSourceFilter(),
-    theTargetBrightness(0.5),
-    theInputBrightness(0.5)
-{
-   theInputBrightness = ossim::nan();
-   theBrightnessContrastSource = new ossimBrightnessContrastSource;
-}
-
-
-ossimBrightnessMatch::~ossimBrightnessMatch()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimBrightnessMatch::getTile(
-   const ossimIrect& tileRect, ossim_uint32 resLevel)
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getTile(tileRect, resLevel);
-   }
-   if(theInputConnection)
-   {
-      if(ossim::isnan(theInputBrightness))
-      {
-         computeInputBrightness();
-      }
-      return theBrightnessContrastSource->getTile(tileRect, resLevel);
-   }
-   return 0;
-}
-
-void ossimBrightnessMatch::initialize()
-{
-   theBrightnessContrastSource->connectMyInputTo(0, getInput());
-   theNormTile = 0;
-}
-
-void ossimBrightnessMatch::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property)
-   {
-      return;
-   }
-   ossimString name = property->getName();
-   if(name == "input_brightness")
-   {
-      theInputBrightness = property->valueToString().toDouble();
-      theBrightnessContrastSource->setBrightness(theTargetBrightness-theInputBrightness);
-   }
-   else if(name == "target_brightness")
-   {
-      theTargetBrightness = property->valueToString().toDouble();
-      theBrightnessContrastSource->setBrightness(theTargetBrightness-theInputBrightness);
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimBrightnessMatch::getProperty(const ossimString& name)const
-{
-   if(name == "target_brightness")
-   {
-      ossimNumericProperty* numeric = new ossimNumericProperty(name,
-                                                               ossimString::toString(theTargetBrightness),
-                                                               0.0, 1.0);
-      numeric->setNumericType(ossimNumericProperty::ossimNumericPropertyType_FLOAT64);
-      numeric->setCacheRefreshBit();
-      return numeric;
-   }
-   else if(name == "input_brightness")
-   {
-      ossimNumericProperty* numeric = new ossimNumericProperty(name,
-                                                               ossimString::toString(theInputBrightness),
-                                                               0.0, 1.0);
-      numeric->setNumericType(ossimNumericProperty::ossimNumericPropertyType_FLOAT64);
-      numeric->setCacheRefreshBit();
-      return numeric;
-   }
-
-    return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimBrightnessMatch::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   
-   propertyNames.push_back("input_brightness");
-   propertyNames.push_back("target_brightness");
-}
-
-
-bool ossimBrightnessMatch::loadState(const ossimKeywordlist& kwl,
-                                              const char* prefix)
-{
-   const char* input_brightness = kwl.find(prefix, "input_brightness");
-   const char* target_brightness = kwl.find(prefix, "target_brightness");
-
-   if(input_brightness)
-   {
-      theInputBrightness = ossimString(input_brightness).toDouble();
-   }
-   if(target_brightness)
-   {
-      theTargetBrightness = ossimString(target_brightness).toDouble();
-   }
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-bool ossimBrightnessMatch::saveState(ossimKeywordlist& kwl,
-                                              const char* prefix)const
-{
-   kwl.add(prefix,
-           "input_brightness",
-           theInputBrightness,
-           true);
-   kwl.add(prefix,
-           "target_brightness",
-           theTargetBrightness,
-            true);
-
-   return ossimImageSourceFilter::saveState(kwl, prefix);   
-}
-
-
-void ossimBrightnessMatch::computeInputBrightness()
-{
-   if(theInputConnection)
-   {
-      ossimIrect inputRect = getBoundingRect();
-      ossim_uint32 rlevel = 0;
-      ossim_uint32 nlevels = getNumberOfDecimationLevels();
-      if(nlevels>1)
-      {
-         while((ossim::max(inputRect.width(), inputRect.height()) > 2048)&&
-               (rlevel < nlevels))
-         {
-            ++rlevel;
-            inputRect = getBoundingRect(rlevel);
-         }
-      }
-      ossimIpt centerPt = inputRect.midPoint();
-      centerPt.x -= 1024;
-      centerPt.y -= 1024;
-      ossimIrect reqRect(centerPt.x,
-                         centerPt.y,
-                         centerPt.x + 2047,
-                         centerPt.x + 2047);
-      reqRect = reqRect.clipToRect(inputRect);
-      ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(reqRect, rlevel);
-
-      if(inputTile.valid())
-      {
-         theNormTile = new ossimImageData(0,
-                                          OSSIM_FLOAT32,
-                                          inputTile->getNumberOfBands());
-         theNormTile->initialize();
-         theNormTile->setImageRectangle(reqRect);
-         inputTile->copyTileToNormalizedBuffer((ossim_float32*)theNormTile->getBuf());
-         theNormTile->setDataObjectStatus(inputTile->getDataObjectStatus());
-         ossim_uint32 maxIdx = theNormTile->getWidth()*theNormTile->getHeight();
-         ossim_float32* bands[3];
-         double averageI = 0.0;
-         double count = 0.0;
-         ossim_uint32 offset = 0;
-         
-         bands[0] = (ossim_float32*)theNormTile->getBuf();
-         if(theNormTile->getNumberOfBands()>2)
-         {
-            bands[1] = (ossim_float32*)theNormTile->getBuf(1);
-            bands[2] = (ossim_float32*)theNormTile->getBuf(2);
-         }
-         else
-         {
-            bands[1] = bands[0];
-            bands[2] = bands[0];
-         }
-         ossimHsiVector hsi;
-         if(theNormTile->getDataObjectStatus() == OSSIM_FULL)
-         {
-            count = maxIdx;
-            
-            for(offset = 0; offset < maxIdx; ++offset)
-            {
-               hsi = ossimNormRgbVector(bands[0][offset], bands[1][offset], bands[2][offset]);
-               
-               averageI += hsi.getI();
-            }
-         }
-         else
-         {
-            for(offset = 0; offset < maxIdx; ++offset)
-            {
-               if((bands[0][offset] != 0.0)&&
-                  (bands[1][offset] != 0.0)&&
-                  (bands[2][offset] != 0.0))
-               {
-                  hsi = ossimNormRgbVector(bands[0][offset], bands[1][offset], bands[2][offset]);
-                  averageI += hsi.getI();
-                  
-                  ++count;
-               }
-            }
-         }
-         theInputBrightness = averageI / count;
-         theBrightnessContrastSource->setBrightness(theTargetBrightness-theInputBrightness);
-      }
-      else
-      {
-         theInputBrightness = .5;
-      }
-   }
-   theNormTile = 0;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimBumpShadeTileSource.cpp b/ossim/src/ossim/imaging/ossimBumpShadeTileSource.cpp
deleted file mode 100644
index 7650150..0000000
--- a/ossim/src/ossim/imaging/ossimBumpShadeTileSource.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimBumpShadeTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimBumpShadeTileSource.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimTilePatch.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimColumnVector3d.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeyword.h>
-#include <ossim/base/ossimMatrix3x3.h>
-#include <ossim/base/ossimRgbVector.h>
-
-static const char COLOR_RED_KW[]   = "color_red";
-static const char COLOR_GREEN_KW[] = "color_green";
-static const char COLOR_BLUE_KW[]  = "color_blue";
-
-RTTI_DEF1(ossimBumpShadeTileSource,
-          "ossimBumpShadeTileSource",
-          ossimImageCombiner);
-
-
-ossimBumpShadeTileSource::ossimBumpShadeTileSource()
-   :ossimImageCombiner(0, 2, 0, true, false),
-    m_tile(0),
-    m_lightSourceElevationAngle(45.0),
-    m_lightSourceAzimuthAngle(45.0),
-    m_lightDirection(3),
-    m_r(255),
-    m_g(255),
-    m_b(255)
-{
-   initialize();
-}
-
-ossimBumpShadeTileSource::~ossimBumpShadeTileSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimBumpShadeTileSource::getTile(
-   const  ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if (!getInput(0))
-      return 0;
-
-   if(!m_tile.get())
-   {
-      allocate();
-   }
-   if(!m_tile.valid())
-   {
-      return m_tile;
-   }
-
-   m_tile->setImageRectangle(tileRect);
-   m_tile->initialize();
-   getTile(m_tile.get(), resLevel);
-   return m_tile;
-   
-}
-
-bool ossimBumpShadeTileSource::getTile(ossimImageData* tile, ossim_uint32 resLevel)
-{
-   if (!getInput(0) || !tile) return false;
-   if(!isSourceEnabled()) return true;
-   
-   tile->makeBlank();
-   
-   ossimIrect tileRect = tile->getImageRectangle();
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(1));
-   ossimRefPtr<ossimImageData> colorData = 0;
-   if(colorSource)
-   {
-      colorData = new ossimImageData(colorSource, colorSource->getOutputScalarType(),
-                                     colorSource->getNumberOfOutputBands(),
-                                     tile->getWidth(), tile->getHeight());
-
-      // Caution: Must set rect prior to getTile:
-      colorData->setImageRectangle(tileRect);
-      
-      colorSource->getTile(colorData.get(), resLevel);
-   }
-
-   ossimImageSource* normalSource = PTR_CAST(ossimImageSource, getInput(0));
-   ossimRefPtr<ossimImageData> normalData =
-         new ossimImageData(normalSource, normalSource->getOutputScalarType(),
-                            normalSource->getNumberOfOutputBands(),
-                            tile->getWidth(), tile->getHeight());
-
-   // Caution: Must set rect prior to getTile:
-   normalData->setImageRectangle(tileRect);
-
-   normalSource->getTile(normalData.get(), resLevel);
-   ossimDataObjectStatus status = normalData->getDataObjectStatus();
-   if ((status == OSSIM_NULL) || (status == OSSIM_EMPTY) ||
-       (normalData->getNumberOfBands() != 3) ||
-       (normalData->getScalarType() != OSSIM_DOUBLE))
-   {
-      return false;
-   }
-
-   ossim_float64* normalBuf[3];
-   normalBuf[0] = static_cast<ossim_float64*>(normalData->getBuf(0));
-   normalBuf[1] = static_cast<ossim_float64*>(normalData->getBuf(1));
-   normalBuf[2] = static_cast<ossim_float64*>(normalData->getBuf(2));
-   ossim_float64 normalNp = normalData->getNullPix(0);
-
-   //---
-   // If we have some color data then use it for the bump
-   // else we will default to a grey scale bump shade.
-   //---
-   if ( colorData.get() &&
-        (colorData->getDataObjectStatus() != OSSIM_EMPTY) &&
-        (colorData->getDataObjectStatus() != OSSIM_NULL) )
-   {
-      switch(colorData->getScalarType())
-      {
-         case OSSIM_UCHAR:
-         {
-            ossim_uint8* resultBuf[3];
-            ossim_uint8* colorBuf[3];
-            resultBuf[0] = static_cast<ossim_uint8*>(tile->getBuf(0));
-            resultBuf[1] = static_cast<ossim_uint8*>(tile->getBuf(1));
-            resultBuf[2] = static_cast<ossim_uint8*>(tile->getBuf(2));
-            colorBuf[0]  = static_cast<ossim_uint8*>(colorData->getBuf(0));
-            if(colorData->getBuf(1))
-            {
-               colorBuf[1] = static_cast<ossim_uint8*>(colorData->getBuf(1));
-            }
-            else
-            {
-               colorBuf[1] = colorBuf[0];
-            }
-            if(colorData->getBuf(2))
-            {
-               colorBuf[2] = static_cast<ossim_uint8*>(colorData->getBuf(2));
-            }
-            else
-            {
-               colorBuf[2] = colorBuf[0];
-            }
-
-            long h = m_tile->getHeight();
-            long w = m_tile->getWidth();
-            for(long y = 0; y < h; ++y)
-            {
-               for(long x = 0; x < w; ++x)
-               {
-                  if((*normalBuf[0] != normalNp) &&
-                     (*normalBuf[1] != normalNp) &&
-                     (*normalBuf[2] != normalNp) )
-                  {
-                     if((*colorBuf[0])||(*colorBuf[1])||(*colorBuf[2]))
-                     {
-                        computeColor(*resultBuf[0],
-                                     *resultBuf[1],
-                                     *resultBuf[2],
-                                     *normalBuf[0],
-                                     *normalBuf[1],
-                                     *normalBuf[2],
-                                     *colorBuf[0],
-                                     *colorBuf[1],
-                                     *colorBuf[2]);
-                     }
-                     else
-                     {
-                        computeColor(*resultBuf[0],
-                                     *resultBuf[1],
-                                     *resultBuf[2],
-                                     *normalBuf[0],
-                                     *normalBuf[1],
-                                     *normalBuf[2],
-                                     m_r,
-                                     m_g,
-                                     m_b);
-                     }
-                  }
-                  else
-                  {
-                     *resultBuf[0] = *colorBuf[0];
-                     *resultBuf[1] = *colorBuf[1];
-                     *resultBuf[2] = *colorBuf[2];
-                  }
-                  resultBuf[0]++;
-                  resultBuf[1]++;
-                  resultBuf[2]++;
-                  colorBuf[0]++;
-                  colorBuf[1]++;
-                  colorBuf[2]++;
-                  normalBuf[0]++;
-                  normalBuf[1]++;
-                  normalBuf[2]++;
-               }
-            }
-            break;
-         }
-         default:
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "ossimBumpShadeTileSource::getTile NOTICE:\n"
-               << "only 8-bit unsigned char is supported." << endl;
-         }
-      }
-   }
-   else
-   {
-      ossim_uint8* resultBuf[3];
-      resultBuf[0] = static_cast<ossim_uint8*>(tile->getBuf(0));
-      resultBuf[1] = static_cast<ossim_uint8*>(tile->getBuf(1));
-      resultBuf[2] = static_cast<ossim_uint8*>(tile->getBuf(2));
-      long h = tile->getHeight();
-      long w = tile->getWidth();
-      for(long y = 0; y < h; ++y)
-      {
-         for(long x = 0; x < w; ++x)
-         {
-            if((*normalBuf[0] != normalNp) &&
-                  (*normalBuf[1] != normalNp) &&
-                  (*normalBuf[2] != normalNp) )
-            {
-               computeColor(*resultBuf[0],
-                            *resultBuf[1],
-                            *resultBuf[2],
-                            *normalBuf[0],
-                            *normalBuf[1],
-                            *normalBuf[2],
-                            m_r,
-                            m_g,
-                            m_b);
-            }
-            else
-            {
-               *resultBuf[0] = 0;
-               *resultBuf[1] = 0;
-               *resultBuf[2] = 0;
-            }
-            resultBuf[0]++;
-            resultBuf[1]++;
-            resultBuf[2]++;
-            normalBuf[0]++;
-            normalBuf[1]++;
-            normalBuf[2]++;
-         }
-      }
-   }
-
-   tile->validate();
-   return true;
-}
-
-void ossimBumpShadeTileSource::computeColor(ossim_uint8& r,
-                                            ossim_uint8& g,
-                                            ossim_uint8& b,
-                                            ossim_float64 normalX,
-                                            ossim_float64 normalY,
-                                            ossim_float64 normalZ,
-                                            ossim_uint8 dr,
-                                            ossim_uint8 dg,
-                                            ossim_uint8 db)const
-{
-   double c = /*fabs*/(normalX*m_lightDirection[0] +
-                   normalY*m_lightDirection[1] +
-                   normalZ*m_lightDirection[2]);
-   
-   r = ossimRgbVector::clamp(ossim::round<int>(c*dr), 1, 255);
-   g = ossimRgbVector::clamp(ossim::round<int>(c*dg), 1, 255);
-   b = ossimRgbVector::clamp(ossim::round<int>(c*db), 1, 255);
-}
-
-void ossimBumpShadeTileSource::initialize()
-{
-   ossimImageCombiner::initialize();
-
-   ossimImageSource* normalSource = dynamic_cast<ossimImageSource*>( getInput(0) );
-   if ( normalSource )
-   {
-      normalSource->initialize();
-   }
-   
-   ossimImageSource* colorSource = dynamic_cast<ossimImageSource*>( getInput(1) );
-   if ( colorSource )
-   {
-      colorSource->initialize();
-   }
-   
-   m_tile = 0;
-   
-   computeLightDirection();
-}
-
-void ossimBumpShadeTileSource::allocate()
-{
-   m_tile = ossimImageDataFactory::instance()->create(this, this);
-   m_tile->initialize();
-}
-
-void ossimBumpShadeTileSource::computeLightDirection()
-{
-   NEWMAT::Matrix m = ossimMatrix3x3::createRotationMatrix(m_lightSourceElevationAngle,
-                                                           0.0,
-                                                           -m_lightSourceAzimuthAngle); // make positive rotation clockwise for azimuth
-   NEWMAT::ColumnVector v(3);
-   v[0] = 0;
-   v[1] = 1;
-   v[2] = 0;
-   v = m*v;
-   // reflect Z.  We need the Z pointing up from the surface and not into it.
-   //
-   ossimColumnVector3d d(v[0], v[1], -v[2]);
-   d = d.unit();
-   m_lightDirection[0] = d[0];
-   m_lightDirection[1] = d[1];
-   m_lightDirection[2] = d[2];
-}
-
-bool ossimBumpShadeTileSource::loadState(const ossimKeywordlist& kwl,
-                                         const char* prefix)
-{
-   const char* elevationAngle = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
-   const char* azimuthAngle   = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
-   
-   
-   if(elevationAngle)
-   {
-      m_lightSourceElevationAngle = ossimString(elevationAngle).toDouble();
-   }
-
-   if(azimuthAngle)
-   {
-      m_lightSourceAzimuthAngle = ossimString(azimuthAngle).toDouble();
-   }
-
-   const char* lookup = kwl.find(prefix, COLOR_RED_KW);
-   if (lookup)
-   {
-      m_r = ossimString(lookup).toUInt8();
-   }
-   
-   lookup = kwl.find(prefix, COLOR_GREEN_KW);
-   if (lookup)
-   {
-      m_g = ossimString(lookup).toUInt8();
-   }
-   
-   lookup = kwl.find(prefix, COLOR_BLUE_KW);
-   if (lookup)
-   {
-      m_b = ossimString(lookup).toUInt8();
-   }
-    
-
-   computeLightDirection();
-
-   bool result = ossimImageSource::loadState(kwl, prefix);
-
-   theInputListIsFixedFlag  = true;
-   theOutputListIsFixedFlag = false;
-   if(!getNumberOfInputs()) setNumberOfInputs(2);
-   
-   return result;
-}
-
-bool ossimBumpShadeTileSource::saveState(ossimKeywordlist& kwl,
-                                         const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::ELEVATION_ANGLE_KW,
-           m_lightSourceElevationAngle,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::AZIMUTH_ANGLE_KW,
-           m_lightSourceAzimuthAngle,
-           true);
-
-   kwl.add(prefix, COLOR_RED_KW,   m_r, true);
-   kwl.add(prefix, COLOR_GREEN_KW, m_g, true);
-   kwl.add(prefix, COLOR_BLUE_KW,  m_b, true);
-   
-   return ossimImageSource::saveState(kwl, prefix);
-}
-
-ossimString ossimBumpShadeTileSource::getShortName()const
-{
-   return ossimString("bump shader");
-}
-
-ossimString ossimBumpShadeTileSource::getLongName()const
-{
-   return ossimString("Blinn's bump map filter");
-}
-
-ossim_uint32 ossimBumpShadeTileSource::getNumberOfOutputBands() const
-{
-   return 3;
-}
-
-ossimScalarType ossimBumpShadeTileSource::getOutputScalarType() const
-{
-   return OSSIM_UCHAR;
-}
-
-double ossimBumpShadeTileSource::getNullPixelValue()const
-{
-   return 0.0;
-}
-
-double ossimBumpShadeTileSource::getMinPixelValue(ossim_uint32 /* band */)const
-{
-   return 1.0;
-}
-
-double ossimBumpShadeTileSource::getMaxPixelValue(ossim_uint32 /* band */)const
-{
-   return 255.0;
-}
-
-double ossimBumpShadeTileSource::getAzimuthAngle()const
-{
-   return m_lightSourceAzimuthAngle;
-}
-
-double ossimBumpShadeTileSource::getElevationAngle()const
-{
-   return m_lightSourceElevationAngle;
-}
-
-void ossimBumpShadeTileSource::setAzimuthAngle(double angle)
-{
-   m_lightSourceAzimuthAngle = angle;
-}
-
-void ossimBumpShadeTileSource::setElevationAngle(double angle)
-{
-   m_lightSourceElevationAngle = angle;
-}
-
-bool ossimBumpShadeTileSource::canConnectMyInputTo(ossim_int32 inputIndex,
-                                                   const ossimConnectableObject* object)const
-{
-   return (object&&
-           ( (inputIndex>=0) && inputIndex < 2)&&
-           PTR_CAST(ossimImageSource, object));
-   
-}
-
-void ossimBumpShadeTileSource::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimBumpShadeTileSource::disconnectInputEvent(ossimConnectionEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimBumpShadeTileSource::propertyEvent(ossimPropertyEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimBumpShadeTileSource::refreshEvent(ossimRefreshEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimBumpShadeTileSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimString name = property->getName();
-   if(name == "lightSourceElevationAngle")
-   {
-      m_lightSourceElevationAngle = property->valueToString().toDouble();
-   }
-   else if(name == "lightSourceAzimuthAngle")
-   {
-      m_lightSourceAzimuthAngle = property->valueToString().toDouble();
-   }
-   else
-   {
-      ossimImageCombiner::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimBumpShadeTileSource::getProperty(const ossimString& name)const
-{
-   if(name == "lightSourceElevationAngle")
-   {
-      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(m_lightSourceElevationAngle), 0.0, 90.0);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   else if(name == "lightSourceAzimuthAngle")
-   {
-      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(m_lightSourceAzimuthAngle), 0, 360);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   
-   return ossimImageCombiner::getProperty(name);
-}
-
-void ossimBumpShadeTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageCombiner::getPropertyNames(propertyNames);
-   propertyNames.push_back("lightSourceElevationAngle");
-   propertyNames.push_back("lightSourceAzimuthAngle");
-}
-
-void ossimBumpShadeTileSource::setRgbColorSource(ossim_uint8 r,
-                                                 ossim_uint8 g,
-                                                 ossim_uint8 b)
-{
-   m_r = r;
-   m_g = g;
-   m_b = b;
-}
-
-void ossimBumpShadeTileSource::getRgbColorSource(ossim_uint8& r,
-                                                 ossim_uint8& g,
-                                                 ossim_uint8& b) const
-{
-   r = m_r;
-   g = m_g;
-   b = m_b;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimCacheTileSource.cpp b/ossim/src/ossim/imaging/ossimCacheTileSource.cpp
deleted file mode 100644
index 4c8e96c..0000000
--- a/ossim/src/ossim/imaging/ossimCacheTileSource.cpp
+++ /dev/null
@@ -1,510 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts 
-//
-// Description:  ossimCacheTileSource
-// 
-//*******************************************************************
-//  $Id: ossimCacheTileSource.cpp 20459 2012-01-17 01:30:36Z gpotts $
-
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/imaging/ossimCacheTileSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-static ossimTrace traceDebug("ossimCacheTileSource:debug");
-
-static const ossimString TILE_SIZE_XY_KW("tile_size_xy");
-static const ossimString USE_INPUT_TILE_SIZE_KW("use_input_tile_size");
-
-RTTI_DEF1(ossimCacheTileSource, "ossimCacheTileSource", ossimImageSourceFilter);
-   
-ossimCacheTileSource::ossimCacheTileSource()
-   : ossimImageSourceFilter(),
-     //theCacheId(ossimAppFixedTileCache::instance()->newTileCache()),
-     theTile(0),
-     theFixedTileSize(),
-     theCachingEnabled(true),
-     theEventProgressFlag(false),
-     theUseInputTileSizeFlag(false)
-{
-   ossim::defaultTileSize(theFixedTileSize);
-}
-
-ossimCacheTileSource::~ossimCacheTileSource()
-{
-   deleteRlevelCache();
-   //ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
-   
-   //theCacheId = -1;
-  // theBoundingRect.makeNan();
-}
-
-void ossimCacheTileSource::flush()
-{
-   //ossimAppFixedTileCache::instance()->flush(theCacheId);
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theRLevelCacheList.size();++idx)
-   {
-      ossimAppFixedTileCache::instance()->flush(theRLevelCacheList[idx]);
-   }
-
-}
-
-void ossimCacheTileSource::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   flush();
-   theTile = 0;
-}
-   
-void ossimCacheTileSource::allocate()
-{
-   theTile = 0;
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimCacheTileSource::getTile(
-   const ossimIrect& tileRect, ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> result = 0;
-   
-   if ( theInputConnection )
-   {
-      if ( isSourceEnabled() )
-      {
-         if(!theTile.valid())
-         {
-            allocate();
-         }
-         
-         if (theTile.valid())
-         {
-            theTile->setImageRectangle(tileRect);
-            theTile->makeBlank();
-            // see if we can get a valid cache at the given resolution level
-            if(getCacheId(resLevel) < 0)
-            {
-               return theInputConnection->getTile(tileRect, resLevel);
-            }
-            result = fillTile(resLevel);
-         }
-      }
-      else // Not enabled...
-      {
-         result = theInputConnection->getTile(tileRect, resLevel);
-      }
-
-   } // End:  if ( theInputConnection )
-
-   return result;
-}
-
-ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> tempTile = 0;
-   fireProgressEvent(0.0);
-   ossimIrect boundingRect = getBoundingRect(resLevel);
-   ossimIrect tileRect = theTile->getImageRectangle();
-   ossimIrect allignedRect = tileRect.clipToRect(boundingRect);
-   ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = getCacheId(resLevel); 
-   ossimIpt cacheTileSize =  ossimAppFixedTileCache::instance()->getTileSize(cacheId);
-   if ( !allignedRect.hasNans() )
-   {
-      allignedRect.stretchToTileBoundary(cacheTileSize);
-     // ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = theCacheId;
-      
-      // check to see if we need to loop
-      if((allignedRect == tileRect)&&
-         (static_cast<ossim_int32>(tileRect.width())  == cacheTileSize.x)&&
-         (static_cast<ossim_int32>(tileRect.height()) == cacheTileSize.y))
-      {
-         ossimIpt origin = tileRect.ul();
-         if(theCachingEnabled)
-         {
-            tempTile = ossimAppFixedTileCache::instance()->getTile(cacheId,
-                                                                   origin);
-         }
-         if(!tempTile.valid())
-         {
-            tempTile = theInputConnection->getTile(tileRect, resLevel);
-            
-            if(tempTile.valid())
-            {
-               if((tempTile->getBuf())&&
-                  (tempTile->getDataObjectStatus()!=OSSIM_EMPTY)&&
-                  theCachingEnabled)
-               {
-                  ossimAppFixedTileCache::instance()->addTile(cacheId,
-                                                              tempTile);
-               }
-            }
-         }
-//         else
-//         {
-//            std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n";
-//         }
-         
-         if(tempTile.valid())
-         {
-            if((tempTile->getDataObjectStatus() != OSSIM_NULL)&&
-               (tempTile->getDataObjectStatus() != OSSIM_EMPTY))
-            {
-               theTile->setDataObjectStatus(tempTile->getDataObjectStatus());
-               theTile->loadTile(tempTile.get());
-            }
-         }
-         fireProgressEvent(100.0);
-      }
-      else
-      {
-         
-         ossim_int32 boundaryHeight = allignedRect.height();
-         ossim_int32 boundaryWidth  = allignedRect.width();
-         ossimIpt origin(allignedRect.ul());
-         ossim_int32 totalTiles  = (boundaryHeight/cacheTileSize.y)*
-            (boundaryWidth/theFixedTileSize.x);
-         ossim_int32 currentTile = 0;
-         for(ossim_int32 row = 0;
-             row < boundaryHeight;
-             row+=theFixedTileSize.y)
-         {
-            origin.x  =  allignedRect.ul().x;
-            for(ossim_int32 col = 0;
-                col < boundaryWidth;
-                col+=theFixedTileSize.x)
-            {
-               ++currentTile;
-               if(theCachingEnabled)
-               {
-                  tempTile =
-                     ossimAppFixedTileCache::instance()->getTile(cacheId,
-                                                                 origin);
-               }
-               else
-               {
-                  tempTile = 0;
-               }
-               if(!tempTile.valid())
-               {
-                  ossimIrect rect(origin.x,
-                                  origin.y,
-                                  origin.x + cacheTileSize.x-1,
-                                  origin.y + cacheTileSize.y-1);
-                  
-                  tempTile = theInputConnection->getTile(rect, resLevel);
-                  
-                  if(tempTile.valid())
-                  {
-                     // drb if(theTile->getBuf()&&
-                     if(tempTile->getBuf()&&                        
-                        (tempTile->getDataObjectStatus()!=OSSIM_EMPTY)&&
-                        theCachingEnabled)
-                     {
-                        ossimAppFixedTileCache::instance()->
-                           addTile(cacheId, tempTile);
-                     }
-                  }
-               }
-             //  else
-             //  {
-             //     std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n";
-             // }
-               
-               if(tempTile.valid())
-               {
-                  if(tempTile->getBuf()&&
-                     (tempTile->getDataObjectStatus()!=OSSIM_EMPTY))
-                  {
-                     theTile->loadTile(tempTile.get());
-                  }
-               }
-               double percent = 100.0*((double)currentTile/(double)totalTiles);
-               fireProgressEvent(percent);
-               origin.x   += theFixedTileSize.x;
-            }
-            origin.y += theFixedTileSize.y;
-         }
-         theTile->validate();
-         fireProgressEvent(100);
-      }
-      
-   } // End of:  if ( !allignedRect.hasNans() )
-   
-   return theTile;
-}
-
-ossim_uint32 ossimCacheTileSource::getTileWidth() const
-{
-   return theFixedTileSize.x;
-}
-
-ossim_uint32 ossimCacheTileSource::getTileHeight() const
-{
-   return theFixedTileSize.y;  
-}
-
-bool ossimCacheTileSource::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   //ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
-   
-   //theCacheId = ossimAppFixedTileCache::instance()->newTileCache();
-   
-   deleteRlevelCache();
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::ENABLE_CACHE_KW);
-   if(lookup)
-   {
-      theCachingEnabled = ossimString(lookup).toBool();
-   }
-   lookup = kwl.find(prefix, USE_INPUT_TILE_SIZE_KW);
-   if(lookup)
-   {
-      theUseInputTileSizeFlag = ossimString(lookup).toBool();
-   }
-
-   lookup = kwl.find(prefix, TILE_SIZE_XY_KW);
-   if (lookup)
-   {
-      ossimIpt pt;
-      pt.toPoint(std::string(lookup));
-      setTileSize(pt);
-   }
-   
-   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
-
-   initialize();
-
-   return result;
-}
-
-bool ossimCacheTileSource::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::ENABLE_CACHE_KW,
-           theCachingEnabled,
-           true);
-   kwl.add(prefix,
-           USE_INPUT_TILE_SIZE_KW,
-           theUseInputTileSizeFlag,
-           true);
-   
-   kwl.add(prefix,
-           TILE_SIZE_XY_KW,
-           theFixedTileSize.toString().c_str());
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-ossimRefPtr<ossimProperty> ossimCacheTileSource::getProperty(
-   const ossimString& name)const
-{
-   // Lock for the length of this method.
-   
-   if (name == TILE_SIZE_XY_KW)
-   {
-      ossimRefPtr<ossimProperty> result =
-         new ossimStringProperty(name, theFixedTileSize.toString());
-      result->setCacheRefreshBit();
-      return result;
-   }
-   else if(name == ossimKeywordNames::ENABLE_CACHE_KW)
-   {
-      ossimRefPtr<ossimProperty> result = new ossimBooleanProperty(name,
-                                                                   theCachingEnabled);
-      result->setCacheRefreshBit();
-      return result;
-   }
-   else if(name == USE_INPUT_TILE_SIZE_KW)
-   {
-      ossimRefPtr<ossimProperty> result = new ossimBooleanProperty(name,
-                                                                   theUseInputTileSizeFlag);
-      result->setCacheRefreshBit();
-      return result;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimCacheTileSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if (!property) return;
-
-   ossimString name = property->getName();
-   if (name == TILE_SIZE_XY_KW)
-   {
-      ossimIpt pt;
-      pt.toPoint(property->valueToString());
-
-      if ( (pt.x > 7) && (pt.y > 7) )
-      {
-         setTileSize(pt);
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimCacheTileSource::setProperty NOTICE:"
-            << "\nTile dimensions must be at least 8!"
-            << "\nFormat = ( x, y )"
-            << std::endl;
-      }
-   }
-   else if(name == ossimKeywordNames::ENABLE_CACHE_KW)
-   {
-      setCachingEnabledFlag(property->valueToString().toBool());
-   }
-   else if(name == USE_INPUT_TILE_SIZE_KW)
-   {
-      theUseInputTileSizeFlag = property->valueToString().toBool();
-      if(theUseInputTileSizeFlag)
-      {
-         deleteRlevelCache();
-      }
-     // setCachingEnabledFlag(property->valueToString().toBool());
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-void ossimCacheTileSource::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(TILE_SIZE_XY_KW);
-   propertyNames.push_back(ossimKeywordNames::ENABLE_CACHE_KW);
-   propertyNames.push_back(USE_INPUT_TILE_SIZE_KW);
-   
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-}
-
-ossimString ossimCacheTileSource::getLongName()const
-{
-   return ossimString("Tile Cache , cache for ossimImageData objects.");
-}
-
-ossimString ossimCacheTileSource::getShortName()const
-{
-   return ossimString("Tile Cache");
-}
-
-void ossimCacheTileSource::setCachingEnabledFlag(bool value)
-{
-   if(!value && theCachingEnabled)
-   {
-      flush();
-   }
-   theCachingEnabled = value;
-}
-
-void ossimCacheTileSource::setEventProgressFlag(bool value)
-{
-   theEventProgressFlag = value;
-}
-
-void ossimCacheTileSource::getTileSize(ossimIpt& size) const
-{
-   size = theFixedTileSize;
-}
-
-void ossimCacheTileSource::setTileSize(const ossimIpt& size)
-{
-   if (size != theFixedTileSize)
-   {
-      theTile = 0; // Force an allocate of new tile.
-      theFixedTileSize = size;
-      initializeRlevelCache();
-     // ossimAppFixedTileCache::instance()->setTileSize(theCacheId, size);
-   }
-}
-
-void ossimCacheTileSource::fireProgressEvent(double percentComplete)
-{
-   if(theEventProgressFlag)
-   {
-      ossimProcessProgressEvent event(this, percentComplete);
-      fireEvent(event);
-   }
-}
-
-ossimAppFixedTileCache::ossimAppFixedCacheId ossimCacheTileSource::getCacheId(ossim_uint32 resLevel)
-{
-   ossimAppFixedTileCache::ossimAppFixedCacheId result = -1;
-   if(theRLevelCacheList.empty())
-   {
-      initializeRlevelCache();
-   }
-   if(resLevel < theRLevelCacheList.size())
-   {
-      if(theRLevelCacheList[resLevel] <0)
-      {
-         ossimIpt cacheTileSize(theFixedTileSize);
-         if(theUseInputTileSizeFlag)
-         {
-            cacheTileSize = ossimIpt(ossim::min(static_cast<ossim_int32>(theInputConnection->getTileWidth()),
-                                                static_cast<ossim_int32>(1024)), 
-                                     ossim::min(static_cast<ossim_int32>(theInputConnection->getTileHeight()),
-                                                static_cast<ossim_int32>(1024)));
-            
-         }
-
-         //std::cout << cacheTileSize << std::endl;
-         ossimIrect rect = getBoundingRect(resLevel);
-         
-         if((cacheTileSize.x > static_cast<ossim_int64>(rect.width()))&&
-            (cacheTileSize.y > static_cast<ossim_int64>(rect.height())))
-         {
-            cacheTileSize.x = ossim::max(static_cast<ossim_int64>(rect.width()), 
-                                         static_cast<ossim_int64>(64));
-            cacheTileSize.y = ossim::max(static_cast<ossim_int64>(rect.height()), 
-                                         static_cast<ossim_int64>(64));
-         }
-
-         rect.stretchToTileBoundary(theFixedTileSize);
-         theRLevelCacheList[resLevel] = ossimAppFixedTileCache::instance()->newTileCache(rect, cacheTileSize); 
-      }
-      result = theRLevelCacheList[resLevel];
-   }
-   
-   return result;
-}
-
-void ossimCacheTileSource::deleteRlevelCache()
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theRLevelCacheList.size();++idx)
-   {
-      ossimAppFixedTileCache::instance()->deleteCache(theRLevelCacheList[idx]);
-   }
-   theRLevelCacheList.clear();
-}
-
-void ossimCacheTileSource::initializeRlevelCache()
-{
-   ossim_uint32 nLevels = getNumberOfDecimationLevels();
-   deleteRlevelCache();
-   
-   if(nLevels > 0)
-   {
-      ossim_uint32 idx = 0;
-      theRLevelCacheList.resize(nLevels);
-      for(idx= 0; idx < theRLevelCacheList.size(); ++idx)
-      {
-         theRLevelCacheList[idx] = -1;
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimCastTileSourceFilter.cpp b/ossim/src/ossim/imaging/ossimCastTileSourceFilter.cpp
deleted file mode 100644
index 14cbb46..0000000
--- a/ossim/src/ossim/imaging/ossimCastTileSourceFilter.cpp
+++ /dev/null
@@ -1,689 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimCastTileSourceFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStringProperty.h>
-
-RTTI_DEF1( ossimCastTileSourceFilter,
-           "ossimCastTileSourceFilter",
-           ossimImageSourceFilter );
-
-ossimCastTileSourceFilter::ossimCastTileSourceFilter(ossimImageSource* input,
-						     ossimScalarType scalarType)
-   :ossimImageSourceFilter(NULL,input),
-    theTile(NULL),
-    theOutputScalarType(scalarType)
-{
-}
-
-ossimCastTileSourceFilter::~ossimCastTileSourceFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimCastTileSourceFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> inputTile;
-   
-   if(theInputConnection)
-   {
-      inputTile = theInputConnection->getTile(tileRect, resLevel);
-   }
-   return applyCast(inputTile);
-}
-
-ossimScalarType ossimCastTileSourceFilter::getOutputScalarType() const
-{
-   if(isSourceEnabled())
-   {
-      return theOutputScalarType;
-   }
-   else if(theInputConnection)
-   {
-      return theInputConnection->getOutputScalarType();
-   }
-
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-double ossimCastTileSourceFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      if(theInputConnection)
-      {
-         return theInputConnection->getNullPixelValue(band);
-      }
-   }
-   return ossim::defaultNull(getOutputScalarType());
-}
-
-double ossimCastTileSourceFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      if(theInputConnection)
-      {
-         return theInputConnection->getMinPixelValue(band);
-      }
-   }
-
-   if(theInputConnection)
-   {
-      double tempMin    = theInputConnection->getMinPixelValue(band);
-      
-      double defaultMin = ossim::defaultMin(theOutputScalarType);
-      double defaultMax = ossim::defaultMax(theOutputScalarType);
-
-      if((tempMin >= defaultMin) && (tempMin <= defaultMax))
-      {
-         defaultMin = tempMin;
-      }
-
-      return defaultMin;
-   }
-   
-   return ossimImageSource::getMinPixelValue(band);
-}
-
-double ossimCastTileSourceFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      if(theInputConnection)
-      {
-         return theInputConnection->getMaxPixelValue(band);
-      }
-   }
-   if(theInputConnection)
-   {
-      double tempMax    = theInputConnection->getMaxPixelValue(band);
-      
-      double defaultMax = ossim::defaultMax(theOutputScalarType);
-      double defaultMin = ossim::defaultMin(theOutputScalarType);
-
-      if((tempMax >= defaultMin) && (tempMax <= defaultMax))
-      {
-         defaultMax = tempMax;
-      }
-
-      return defaultMax;
-   }
-   return ossimImageSource::getMaxPixelValue(band);
-}
-
-ossimRefPtr<ossimImageData> ossimCastTileSourceFilter::applyCast(
-   ossimRefPtr<ossimImageData> inputTile)
-{
-   if(!inputTile.valid())
-   {
-      return inputTile;
-   }
-   
-   if(!theTile.valid() ||
-      (theTile->getNumberOfBands() != inputTile->getNumberOfBands()))
-   {
-      allocate(inputTile);
-   }
-   else
-   {
-      ossim_int32 tw =inputTile->getWidth(); 
-      ossim_int32 th =inputTile->getHeight(); 
-      ossim_int32 w = theTile->getWidth();
-      ossim_int32 h = theTile->getHeight();
-      theTile->setWidthHeight(tw, th);
-      
-      if((w*h != tw*th))
-      {
-         theTile->initialize();
-      }
-      else
-      {
-         theTile->makeBlank();
-      }
-      theTile->setOrigin(inputTile->getOrigin());
-   }
-   
-   if( (inputTile->getDataObjectStatus()==OSSIM_EMPTY) ||
-       (inputTile->getDataObjectStatus()==OSSIM_NULL))
-   {
-      return theTile;
-   }
-   
-   switch(inputTile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         ossim_uint8** bands = new ossim_uint8*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<ossim_uint8*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         ossim_sint8** bands = new ossim_sint8*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<ossim_sint8*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         ossim_uint16** bands =
-            new ossim_uint16*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<ossim_uint16*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         ossim_sint16** bands =
-            new ossim_sint16*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<ossim_sint16*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         ossim_sint32** bands =
-            new ossim_sint32*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<ossim_sint32*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         ossim_uint32** bands =
-            new ossim_uint32*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<ossim_uint32*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_FLOAT32: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         float** bands = new float*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<float*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         double** bands = new double*[inputTile->getNumberOfBands()];
-         
-         for(ossim_uint32 band = 0;
-             band < inputTile->getNumberOfBands();
-             ++band)
-         {
-            bands[band] = static_cast<double*>(inputTile->getBuf(band));
-         }
-         castInputToOutput(bands,
-                           inputTile->getNullPix(),
-                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         break;
-      }
-   }
-
-//   theTile->setDataObjectStatus(inputTile->getDataObjectStatus());
-   theTile->validate();
-   return theTile;
-}
-
-void ossimCastTileSourceFilter::setOutputScalarType(ossimScalarType scalarType)
-{
-   ossimScalarType old_type = theOutputScalarType;
-   theOutputScalarType = scalarType;
-
-   if ( (theOutputScalarType != old_type))
-   {
-      // must reinitialize...
-      theTile = NULL;
-      initialize();
-   }
-}
-
-void ossimCastTileSourceFilter::setOutputScalarType(ossimString scalarType)
-{
-   int scalar =
-      ossimScalarTypeLut::instance()->getEntryNumber(scalarType.c_str());
-   
-   if (scalar != ossimLookUpTable::NOT_FOUND)
-   {
-      setOutputScalarType(static_cast<ossimScalarType>(scalar));
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimCastTileSourceFilter::setOutputScalarType WARN:"
-         << "\nUnknown scalar type:  " << scalarType.c_str() << endl;
-   }
-}
-
-ossimString ossimCastTileSourceFilter::getOutputScalarTypeString()const
-{
-   return ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType);
-}
-
-void ossimCastTileSourceFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   if (theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
-   {
-      // default to OSSIM_UCHAR
-      theOutputScalarType = OSSIM_UCHAR;
-   }
-}
-
-bool ossimCastTileSourceFilter::saveState(ossimKeywordlist& kwl,
-                                          const char* prefix) const
-{
-   ossimImageSourceFilter::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           ossimKeywordNames::SCALAR_TYPE_KW,
-           ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType),
-           true);
-
-   return true;
-}
-
-bool ossimCastTileSourceFilter::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   ossimImageSourceFilter::loadState(kwl, prefix);
-
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimScalarRemapper::loadState WARN:\n"
-         << " ERROR detected in keyword list!  State not loaded."
-         << endl;
-      return false;
-   }
-
-   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
-
-   if (scalar != ossimLookUpTable::NOT_FOUND)
-   {
-      theOutputScalarType = static_cast<ossimScalarType>(scalar);
-   }
-
-   return true;
-}
-
-template<class inType>
-void ossimCastTileSourceFilter::castInputToOutput(inType **inBuffer,
-                                                  const double  *nullPix,
-                                                  bool   inPartialFlag)
-{
-   switch(theTile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         ossim_uint8** bands = new ossim_uint8*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<ossim_uint8*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         ossim_sint8** bands = new ossim_sint8*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<ossim_sint8*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         ossim_sint16** bands = new ossim_sint16*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<ossim_sint16*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         ossim_uint16** bands = new ossim_uint16*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<ossim_uint16*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         ossim_uint32** bands = new ossim_uint32*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<ossim_uint32*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         ossim_sint32** bands = new ossim_sint32*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<ossim_sint32*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      
-      case OSSIM_FLOAT32: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         float** bands = new float*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<float*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         double** bands = new double*[theTile->getNumberOfBands()];
-
-         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
-         {
-            bands[band] = static_cast<double*>(theTile->getBuf(band));
-         }
-      
-         castInputToOutput(inBuffer,
-                           nullPix,
-                           inPartialFlag,
-                           bands,
-                           theTile->getNullPix(),
-                           theTile->getNumberOfBands());
-         delete [] bands;
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimCastTileSourceFilter::castInputToOutput WARN:\n"
-            << "Scalar not set in ossimCastTileSourceFilter" << endl;
-         break;
-      }
-   }
-}
-
-template<class inType, class outType>
-void ossimCastTileSourceFilter::castInputToOutput(inType *inBuffer[],
-                                                  const double  *nullInPix,
-                                                  bool   inPartialFlag,
-                                                  outType *outBuffer[],
-                                                  const double  *nullOutPix,
-                                                  ossim_uint32   numberOfBands)
-{
-   ossim_uint32 size = theTile->getWidth()*theTile->getHeight();
-   if(!inPartialFlag)
-   {
-      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-      {
-         outType outMin = static_cast<outType>(theTile->getMinPix(band));
-         outType outMax = static_cast<outType>(theTile->getMaxPix(band));
-         
-         for(ossim_uint32 offset = 0; offset < size; ++offset)
-         {
-            double temp = inBuffer[band][offset];
-            if(temp < outMin) temp = outMin;
-            if(temp > outMax) temp = outMax;
-            outBuffer[band][offset] = static_cast<outType>(temp);
-         }
-      }
-   }
-   else
-   {
-      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-      {
-         inType np      = static_cast<inType>(nullInPix[band]);
-	     outType outNp  = static_cast<outType>(nullOutPix[band]);
-         outType outMin = static_cast<outType>(theTile->getMinPix(band));
-         outType outMax = static_cast<outType>(theTile->getMaxPix(band));
-         
-         for(ossim_uint32 offset = 0; offset < size; ++offset)
-         {
-            if(inBuffer[band][offset] != np)
-            {
-               double temp = inBuffer[band][offset];
-               if(temp < outMin) temp = outMin;
-               if(temp > outMax) temp = outMax;
-               outBuffer[band][offset] = static_cast<outType>(temp);
-            }
-	    else
-	    {
-		outBuffer[band][offset] = static_cast<outType>(outNp);
-		
-	    }
-         }
-      }
-   }
-}
-
-void ossimCastTileSourceFilter::allocate(const ossimRefPtr<ossimImageData> inputTile)
-{
-   theTile = ossimImageDataFactory::instance()->create(
-      this,
-      getOutputScalarType(),
-      inputTile->getNumberOfBands(),
-      inputTile->getWidth(),
-      inputTile->getHeight());
-   theTile->initialize();
-   theTile->setOrigin(inputTile->getOrigin());
-}
-
-void ossimCastTileSourceFilter::propertyEvent(ossimPropertyEvent& /* event */)
-{
-}
-
-void ossimCastTileSourceFilter::refreshEvent(ossimRefreshEvent& /* event */)
-{
-}
-
-void ossimCastTileSourceFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(property->getName() == ossimKeywordNames::SCALAR_TYPE_KW)
-   {
-      int scalar = ossimScalarTypeLut::instance()->getEntryNumber(property->valueToString());
-      
-      if (scalar != ossimLookUpTable::NOT_FOUND)
-      {
-         setOutputScalarType(static_cast<ossimScalarType>(scalar));
-      }
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimCastTileSourceFilter::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> resultProperty;
-   if(name == ossimKeywordNames::SCALAR_TYPE_KW)
-   {
-      ossimStringProperty* stringProperty = new ossimStringProperty(name,
-                                                                    ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType),
-                                                                    false);
-
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_UINT8));
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_SINT8));
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_UINT16));
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_SINT16));
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_UINT32));
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_SINT32));
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_FLOAT32));
-      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_FLOAT64));
-
-      stringProperty->setCacheRefreshBit();
-      resultProperty = stringProperty;
-   }
-   else
-   {
-      resultProperty = ossimImageSourceFilter::getProperty(name);
-   }
-   return resultProperty;
-}
-
-void ossimCastTileSourceFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   
-   propertyNames.push_back(ossimKeywordNames::SCALAR_TYPE_KW);
-}
-   
-
diff --git a/ossim/src/ossim/imaging/ossimCcfHead.cpp b/ossim/src/ossim/imaging/ossimCcfHead.cpp
deleted file mode 100644
index d9e9727..0000000
--- a/ossim/src/ossim/imaging/ossimCcfHead.cpp
+++ /dev/null
@@ -1,764 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for CcfHead.
-// 
-//*******************************************************************
-//  $Id: ossimCcfHead.cpp 13842 2008-11-04 19:40:10Z gpotts $
-
-#include <sstream>
-#include <iostream>
-#include <fstream>
-
-using namespace std;
-
-#include <ossim/imaging/ossimCcfHead.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimErrorContext.h>
-
-static const bool TRACE = false; // Temp until trace code implemented.
-
-ossimCcfHead::ossimCcfHead()
-   :
-      theCcfFile(),
-      theNumberOfBands(1),
-      thePixelType(OSSIM_UCHAR),
-      theFileType(),
-      theVersionNumber(0),
-      theLinesPerChip(0),
-      theSamplesPerChip(0),
-      theLineChipsPerChunk(0),
-      theSampleChipsPerChunk(0),
-      theRectInFullImageStartLine(0),
-      theRectInFuleImageStartSample(0),
-      theRectInFullImageStopLine(0),
-      theRectInFuleImageStopSample(0),
-      theNumberOfValidImageVertices(0),
-      theValidImageVertices(1),
-      theFirstBandHeaderPointer(0),
-      theRadiometryString(),
-      theBytesPerPixel(0),
-      theBytesPerChip(0),
-      theBytesPerChunk(0),
-      theCompressionType(),
-      theNumberOfRLevels(0),
-      theOccupiedFlag(1),
-      theStartOfData(1),
-      theNumberOfLines(1),
-      theNumberOfSamples(1),
-      theChunksInLineDir(1),
-      theChunksInSampleDir(1)
-{}
-
-//***************************************************************************
-// Public Constructor:
-//***************************************************************************
-ossimCcfHead::ossimCcfHead(const char* ccf_file)
-   :
-      theCcfFile(ccf_file),
-      theNumberOfBands(1),
-      thePixelType(OSSIM_UCHAR),
-      theFileType(),
-      theVersionNumber(0),
-      theLinesPerChip(0),
-      theSamplesPerChip(0),
-      theLineChipsPerChunk(0),
-      theSampleChipsPerChunk(0),
-      theRectInFullImageStartLine(0),
-      theRectInFuleImageStartSample(0),
-      theRectInFullImageStopLine(0),
-      theRectInFuleImageStopSample(0),
-      theNumberOfValidImageVertices(0),
-      theValidImageVertices(1),
-      theFirstBandHeaderPointer(0),
-      theRadiometryString(""),
-      theBytesPerPixel(0),
-      theBytesPerChip(0),
-      theBytesPerChunk(0),
-      theCompressionType(),
-      theNumberOfRLevels(0),
-      theOccupiedFlag(1),
-      theStartOfData(1),
-      theNumberOfLines(1),
-      theNumberOfSamples(1),
-      theChunksInLineDir(1),
-      theChunksInSampleDir(1)
-{
-   static const char MODULE[] = "ossimCcfHead::ossimCcfHead";
-   
-   if (!parseCcfHeader(ccf_file))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      
-      if (TRACE)
-      {
-         cerr << MODULE << " ERROR!"
-              << "\nError initializing from ccf_file:  " << ccf_file
-              << "\nReturning..." << std::endl;
-      }
-   }
-}
-
-//***************************************************************************
-// Destructor:
-//***************************************************************************
-ossimCcfHead::~ossimCcfHead()
-{}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-bool ossimCcfHead::parseCcfHeader(const char* ccf_file)
-{
-   static const char MODULE[] = "ossimCcfHead::parseossimCcfHeader";
-
-   theCcfFile = ccf_file;
-   
-   std::ifstream *is = new std::ifstream(ccf_file);
-
-   if (!(*is))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      
-      if (TRACE)
-      {
-         cerr << MODULE << " ERROR!"
-              << "\nCannot open file:  " << ccf_file << std::endl;
-      }
-      
-      is->close();
-      delete is;
-      
-      return false;
-   }
-
-   const ossim_uint32 MAX_LEN = 256;
-   char tmp[MAX_LEN];
-
-   // Check the first string should be "CCF" else get out...
-   // this might hang so I changed it to not use the
-   // >> operator unless it is a ccf file.  If it is another
-   // file we might not be guranteed a whitespace or \n character
-   // will exist and therefore the entrie file could have
-   // been read in.
-   //
-   char type[4];
-   is->read(type, 3);
-   type[3] = '\0';
-   theFileType = type;
-   if (theFileType != "CCF")
-   {
-      if (TRACE)
-      {
-         cerr << MODULE << " ERROR!"
-              << "\nNot a ccf file.  Returning..." << std::endl;
-      }
-
-      is->close();
-      delete is;
-
-      return false;
-   }
-
-   
-   // Check the version number.
-   (*is) >> tmp 
-         >> theVersionNumber;
-
-   //***
-   // Call the appropriate method for the version.  Currently only version 6
-   // supported as that was all I had in-house.  Feel free to add your own
-   // version reader!
-   //***
-   bool status = false;
-   
-   switch(theVersionNumber)
-   {
-   case 5:
-      status = parseV5CcfHeader(*is);
-      break;
-   case 6:
-      status = parseV6CcfHeader(*is);
-      break;
-   default:
-      // Version type not supported...
-      if (TRACE)
-      {
-         cerr << MODULE << " ERROR!"
-              << "\nUsupported version:  " << theVersionNumber
-              << "  Returning..." << std::endl;
-      }
-      is->close();
-      delete is;
-       return false;
-
-      break;
-   }
-   
-   // Close the stream.
-   is->close();
-   delete is;
-   //***
-   // Parse the radiometry string.  This will initialize "theNumberOfBands"
-   // and the pixel type.
-   //***
-   parseRadString();
-
-   return status;
-}
-
-//***************************************************************************
-// Private Method:
-//***************************************************************************
-bool ossimCcfHead::parseV5CcfHeader(std::istream& is)
-{
-   static const char MODULE[] = "CcfHead::parseV5CcfHeader";
-
-   // Check the stream.
-   if (!is)
-   {
-      if (TRACE)
-      {
-         cerr << MODULE << " Bad Stream passed to method!"
-              << "\nReturning..."
-              << std::endl;
-      }
-
-      return false;
-   }
-
-   const ossim_uint32 MAX_LEN = 256;
-   char tmp[MAX_LEN];
-   
-   //***
-   // These are all fixed/not used so just skip...
-   //***
-   is.read(tmp, 1);                   // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ccf_maker"
-
-   is >> tmp // "LinesPerChip"
-      >> theLinesPerChip
-      >> tmp // "SamplesPerChip"
-      >> theSamplesPerChip
-      >> tmp // "LineChipsPerChunk"
-      >> theLineChipsPerChunk
-      >> tmp // "SampleChipsPerChunk"   
-      >> theSampleChipsPerChunk;
-
-   is.read(tmp, 1);                   // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NumberOfBands"
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "RectInFullImageSpace"
-
-   is >> tmp // skip "StartLine"
-      >> theRectInFullImageStartLine
-      >> tmp // skip "StartSample"
-      >> theRectInFuleImageStartSample
-      >> tmp // skip "StopLine"
-      >> theRectInFullImageStopLine
-      >> tmp // skip "StopSample"
-      >> theRectInFuleImageStopSample;
-
-   // No valid image vertices in this version.
-   theNumberOfValidImageVertices = 0;
-   theValidImageVertices[0] = ossimIpt(0,0);
-   
-   is.read(tmp, 1);                   // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip blank line
-
-   is >> tmp                         // skip "FirstBandHeaderPointer"
-      >> theFirstBandHeaderPointer;  // Offset to band header.
-
-   // Seek to the band header record.
-   is.seekg(theFirstBandHeaderPointer, ios::beg);
-
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "BAND" line
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NextBandHeaderPointer" line
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ChunkMapPointer" line
-
-   is >> tmp;  // skip "Radiometry"
-
-   is.getline(tmp, MAX_LEN-1, '\n'); // Get the radiometry string.
-   const char* rad = tmp;
-   while ( *rad && (*rad == ' ')) rad++;  // Eat the whitespaces...
-   theRadiometryString = rad;
-
-   is >> tmp // skip "BytesPerPixel"
-      >> theBytesPerPixel
-      >> tmp // skip "BytesPerChip"
-      >> theBytesPerChip
-      >> tmp // skip "BytesPerChunk"
-      >> theBytesPerChunk
-      >> tmp // skip "CompressionType"
-      >> theCompressionType
-      >> tmp // skip "NumberOfRLevels"
-      >> theNumberOfRLevels;
-
-   if ((ossim_uint32)theNumberOfRLevels > theOccupiedFlag.size())
-   {
-      // Resize all the vectors.
-      theOccupiedFlag.resize(theNumberOfRLevels);
-      theStartOfData.resize(theNumberOfRLevels);
-      theNumberOfLines.resize(theNumberOfRLevels);
-      theNumberOfSamples.resize(theNumberOfRLevels);
-      theChunksInLineDir.resize(theNumberOfRLevels);
-      theChunksInSampleDir.resize(theNumberOfRLevels);
-   }
-
-   is.read(tmp, 1);                  // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
-   
-   ossim_uint32 i;
-   for (i=0; i<theNumberOfRLevels; i++)
-   {
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip the Rlevel line
-
-      ossim_uint32 tmp_long;
-      
-      is >> tmp // skip "Occupied"
-         >> tmp_long;
-
-      theOccupiedFlag[i] = tmp_long;
-
-      is >> tmp // skip "StartOfData"
-         >> tmp_long;
-
-      theStartOfData[i] = tmp_long;
-      
-      is >> tmp // skip "NumberOfLines"
-         >> tmp_long;
-
-      theNumberOfLines[i] = tmp_long;
-
-      is >> tmp // skip "NumberOfSamples"
-         >> tmp_long;
-
-      theNumberOfSamples[i] = tmp_long;
-
-      is >> tmp // skip "ChunksInLineDir"
-         >> tmp_long;
-
-      theChunksInLineDir[i] = tmp_long;
-
-      is >> tmp // skip "ChunksInSampleDir"
-         >> tmp_long;
-
-      theChunksInSampleDir[i] = tmp_long;
-
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineOffset" line
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineDecimation" line
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleOffset" line
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleDecimation" line
-      is.read(tmp, 1);                  // Eat the '\n'
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
-      is.read(tmp, 1);                  // Eat the '\n'
-   }
-
-   // Note:  The caller will close the stream.
-   
-   return true;
-}
-
-//***************************************************************************
-// Private Method:
-//***************************************************************************
-bool ossimCcfHead::parseV6CcfHeader(std::istream& is)
-{
-   static const char MODULE[] = "CcfHead::parseV6CcfHeader";
-
-   // Check the stream.
-   if (!is)
-   {
-      if (TRACE)
-      {
-         cerr << MODULE << " Bad Stream passed to method!"
-              << "\nReturning..."
-              << std::endl;
-      }
-
-      return false;
-   }
-
-   const ossim_uint32 MAX_LEN = 256;
-   char tmp[MAX_LEN];
-   
-   //***
-   // These are all fixed/not used so just skip...
-   //***
-   is.read(tmp, 1);                   // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ccf_maker"
-
-   is >> tmp // "LinesPerChip"
-      >> theLinesPerChip
-      >> tmp // "SamplesPerChip"
-      >> theSamplesPerChip
-      >> tmp // "LineChipsPerChunk"
-      >> theLineChipsPerChunk
-      >> tmp // "SampleChipsPerChunk"
-      >> theSampleChipsPerChunk;
-
-   is.read(tmp, 1);                   // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NumberOfBands"
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "RectInFullImageSpace"
-
-   is >> tmp // skip "StartLine"
-      >> theRectInFullImageStartLine
-      >> tmp // skip "StartSample"
-      >> theRectInFuleImageStartSample
-      >> tmp // skip "StopLine"
-      >> theRectInFullImageStopLine
-      >> tmp // skip "StopSample"
-      >> theRectInFuleImageStopSample
-      >> tmp // skip "ValidImageVertices"
-      >> theNumberOfValidImageVertices;
-
-   // Get the valid image vertices.
-   ossim_uint32 i;
-
-   if (theNumberOfValidImageVertices != theValidImageVertices.size())
-   {
-      theValidImageVertices.resize(theNumberOfValidImageVertices);
-   }
-
-   for (i=0; i<theNumberOfValidImageVertices; i++)
-   {
-      ossimString tmp_dbl;  // Can be doubles in header.
-      
-      is >> tmp      // skip "Vertex"
-         >> tmp      // skip Vertex number
-         >> tmp_dbl; // line
-
-      theValidImageVertices[i].y = static_cast<int>(tmp_dbl.toDouble());
-      tmp_dbl = "";
-      is >> tmp_dbl; // sample
-
-      theValidImageVertices[i].x = static_cast<int>(tmp_dbl.toDouble());
-   }
-
-   is.read(tmp, 1);                   // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip blank line
-
-   is >> tmp                         // skip "FirstBandHeaderPointer"
-      >> theFirstBandHeaderPointer;  // Offset to band header.
-
-   // Seek to the band header record.
-   is.seekg(theFirstBandHeaderPointer, ios::beg);
-
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "BAND" line
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NextBandHeaderPointer" line
-   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ChunkMapPointer" line
-
-   is >> tmp;  // skip "Radiometry"
-
-   is.getline(tmp, MAX_LEN-1, '\n'); // Get the radiometry string.
-   
-   const char* rad = tmp;
-   while ( *rad && (*rad == ' ')) rad++;  // Eat the whitespaces...
-   theRadiometryString = rad;
-
-   is >> tmp // skip "BytesPerPixel"
-      >> theBytesPerPixel
-      >> tmp // skip "BytesPerChip"
-      >> theBytesPerChip
-      >> tmp // skip "BytesPerChunk"
-      >> theBytesPerChunk
-      >> tmp // skip "CompressionType"
-      >> theCompressionType
-      >> tmp // skip "NumberOfRLevels"
-      >> theNumberOfRLevels;
-
-   if (theNumberOfRLevels > theOccupiedFlag.size())
-   {
-      // Resize all the vectors.
-      theOccupiedFlag.resize(theNumberOfRLevels);
-      theStartOfData.resize(theNumberOfRLevels);
-      theNumberOfLines.resize(theNumberOfRLevels);
-      theNumberOfSamples.resize(theNumberOfRLevels);
-      theChunksInLineDir.resize(theNumberOfRLevels);
-      theChunksInSampleDir.resize(theNumberOfRLevels);
-   }
-
-   is.read(tmp, 1);                  // eat the '\n'
-   is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
-   
-   for (i=0; i<theNumberOfRLevels; i++)
-   {
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip the Rlevel line
-
-      ossim_uint32 tmp_long;
-      
-      is >> tmp // skip "Occupied"
-         >> tmp_long;
-
-      theOccupiedFlag[i] = tmp_long;
-
-      is >> tmp // skip "StartOfData"
-         >> tmp_long;
-
-      theStartOfData[i] = tmp_long;
-      
-      is >> tmp // skip "NumberOfLines"
-         >> tmp_long;
-
-      theNumberOfLines[i] = tmp_long;
-
-      is >> tmp // skip "NumberOfSamples"
-         >> tmp_long;
-
-      theNumberOfSamples[i] = tmp_long;
-
-      is >> tmp // skip "ChunksInLineDir"
-         >> tmp_long;
-
-      theChunksInLineDir[i] = tmp_long;
-
-      is >> tmp // skip "ChunksInSampleDir"
-         >> tmp_long;
-
-      theChunksInSampleDir[i] = tmp_long;      
-
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineOffset" line
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineDecimation" line
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleOffset" line
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleDecimation" line
-      is.read(tmp, 1);                  // Eat the '\n'
-      is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
-      is.read(tmp, 1);                  // Eat the '\n'
-   }
-
-   // Note:  The caller will close the stream.
-   
-   return true;
-}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-std::ostream& ossimCcfHead::print(std::ostream& out) const
-{
-   static const char MODULE[] = "ossimCcfHead::print";
-
-   out << MODULE
-       << "\ntheErrorStatus:                 " << theErrorStatus
-       << "\ntheCcfFile:                     " << theCcfFile
-       << "\ntheNumberOfBands:               " << theNumberOfBands
-       << "\nthePixelType:                   "
-       << (ossimScalarTypeLut::instance()->getEntryString(thePixelType))
-       << "\ntheFileType:                    " << theFileType
-       << "\ntheVersionNumber:               " << theVersionNumber
-       << "\ntheLinesPerChip:                " << theLinesPerChip
-       << "\ntheSamplesPerChip:              " << theSamplesPerChip
-       << "\ntheLineChipsPerChunk:           " << theLineChipsPerChunk
-       << "\ntheSampleChipsPerChunk:         " << theSampleChipsPerChunk
-       << "\ntheRectInFullImageStartLine:    " << theRectInFullImageStartLine
-       << "\ntheRectInFuleImageStartSample:  " << theRectInFuleImageStartSample
-       << "\ntheRectInFullImageStopLine:     " << theRectInFullImageStopLine
-       << "\ntheRectInFuleImageStopSample:   " << theRectInFuleImageStopSample
-       << "\ntheNumberOfValidImageVertices:  "
-       << theNumberOfValidImageVertices;
-   
-   ossim_uint32 i;
-   
-   for (i=0; i<theNumberOfValidImageVertices; i++)
-   {
-      out << "\ntheValidImageVertices[" << i << "]:  "
-          << theValidImageVertices[i];
-   }
-   
-   out << "\ntheFirstBandHeaderPointer:  " << theFirstBandHeaderPointer
-       << "\ntheRadiometryString:        " << theRadiometryString
-       << "\ntheBytesPerPixel:           " << theBytesPerPixel
-       << "\ntheBytestPerChip:           " << theBytesPerChip
-       << "\ntheBytesPerChunk:           " << theBytesPerChunk
-       << "\ntheCompressionType:         " << theCompressionType
-       << "\ntheNumberOfRLevels:         " << theNumberOfRLevels;
-   
-   for (i=0; i<theNumberOfRLevels; i++)
-   {
-      out << "\ntheOccupiedFlag[" << i << "]:       " << theOccupiedFlag[i]
-          << "\ntheStartOfData[" << i << "]:        " << theStartOfData[i]
-          << "\ntheNumberOfLines[" << i << "]:      " << theNumberOfLines[i]
-          << "\ntheNumberOfSamples[" << i << "]:    " << theNumberOfSamples[i]
-          << "\ntheChunksInLineDir[" << i << "]:    " << theChunksInLineDir[i]
-          << "\ntheChunksInSampleDir[" << i << "]:  "
-          << theChunksInSampleDir[i];
-   }
-   
-   out << std::endl;
-
-   return ossimErrorStatusInterface::print(out);
-}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-ossim_uint32 ossimCcfHead::numberOfLines(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimCcfHead::numberOfLines";
-
-   if (reduced_res_level > highestReducedResSet() )
-   {
-      cerr << MODULE << " ERROR!"
-           << "\nInvalid reduced res level:  " << reduced_res_level
-           << "\nHighest reduced res level available:  "
-           << highestReducedResSet() << std::endl;   
-      return 0;
-   }
-
-   return theNumberOfLines[reduced_res_level];
-}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-ossim_uint32 ossimCcfHead::numberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimCcfHead::numberOfSamples";
-
-   if (reduced_res_level > highestReducedResSet() )
-   {
-      cerr << MODULE << " ERROR!"
-           << "\nInvalid reduced res level:  " << reduced_res_level
-           << "\nHighest reduced res level available:  "
-           << highestReducedResSet() << std::endl;   
-      return 0;
-   }
-   
-   return theNumberOfSamples[reduced_res_level];
-}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-ossim_uint32 ossimCcfHead::chunksInLineDir(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimCcfHead::chunksInLineDir";
-
-   if (reduced_res_level > highestReducedResSet() )
-   {
-      cerr << MODULE << " ERROR!"
-           << "\nInvalid reduced res level:  " << reduced_res_level
-           << "\nHighest reduced res level available:  "
-           << highestReducedResSet() << std::endl;   
-      return 0;
-   }
-   
-   return theChunksInLineDir[reduced_res_level];
-}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-ossim_uint32 ossimCcfHead::chunksInSampleDir(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimCcfHead::chunksInSampleDir";
-
-   if (reduced_res_level > highestReducedResSet() )
-   {
-      cerr << MODULE << " ERROR!"
-           << "\nInvalid reduced res level:  " << reduced_res_level
-           << "\nHighest reduced res level available:  "
-           << highestReducedResSet() << std::endl;   
-      return 0;
-   }
-   
-   return theChunksInSampleDir[reduced_res_level];
-}
-
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-std::streampos ossimCcfHead::startOfData(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimCcfHead::startOfData";
-
-   if (reduced_res_level > highestReducedResSet() )
-   {
-      cerr << MODULE << " ERROR!"
-           << "\nInvalid reduced res level:  " << reduced_res_level
-           << "\nHighest reduced res level available:  "
-           << highestReducedResSet() << std::endl;   
-      return 0;
-   }
-   
-   return theStartOfData[reduced_res_level];
-}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-ossimIrect ossimCcfHead::imageRect(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimCcfHead::imageRect";
-   
-   if (reduced_res_level > highestReducedResSet() )
-   {
-      cerr << MODULE << " ERROR!"
-           << "\nInvalid reduced res level:  " << reduced_res_level
-           << "\nHighest reduced res level available:  "
-           << highestReducedResSet() << std::endl;
-      return ossimIrect(0,0,0,0);
-   }
-
-   return ossimIrect(0,
-                     0,
-                     numberOfSamples(reduced_res_level) - 1,
-                     numberOfLines(reduced_res_level)   - 1);
-}
-
-//***************************************************************************
-// Public Method:
-//***************************************************************************
-void ossimCcfHead::parseRadString()
-{
-   static const char MODULE[] = "ossimCcfHead::parseRadString";
-   
-   if (theRadiometryString.contains("RadiomNBand"))
-   {
-      //***
-      // Complex string, must parse. Should look like:
-      // "RadiomNBand (3 3 Linear8 )"
-      //***
-      char tmp[80];
-      std::istringstream is(theRadiometryString);
-
-      is >> tmp;               // Skip the "RadiomNBand" string.
-      is.get(tmp, 3);          // Eat the space and the '('.
-      is >> theNumberOfBands;  // Get the number of bands.
-   }
-
-   if (theRadiometryString.contains("8"))
-   {
-      thePixelType = OSSIM_UCHAR;
-   }
-   else if(theRadiometryString.contains("16"))
-   {
-      thePixelType = OSSIM_USHORT16;
-   }
-   else if (theRadiometryString.contains("11"))
-   {
-      thePixelType = OSSIM_USHORT11;
-   }
-   else
-   {
-      cerr << MODULE << " Unknown radiometry!"
-           << "\ntheRadiometryString:  " << theRadiometryString << std::endl;
-   }
-
-   if (TRACE)
-   {
-      cout << MODULE
-           << "\ntheRadiometryString:  " << theRadiometryString
-           << "\ntheNumberOfBands:     " << theNumberOfBands
-           << "\nthePixelType:         "
-           << (ossimScalarTypeLut::instance()->getEntryString(thePixelType))
-           << std::endl;
-   }
-}
diff --git a/ossim/src/ossim/imaging/ossimCcfTileSource.cpp b/ossim/src/ossim/imaging/ossimCcfTileSource.cpp
deleted file mode 100644
index 19b929c..0000000
--- a/ossim/src/ossim/imaging/ossimCcfTileSource.cpp
+++ /dev/null
@@ -1,902 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimCcfTileSource.
-//*******************************************************************
-//  $Id: ossimCcfTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <algorithm>
-#include <ossim/imaging/ossimCcfTileSource.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimInterleaveTypeLut.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-using namespace std;
-
-RTTI_DEF1(ossimCcfTileSource, "ossimCcfTileSource", ossimImageHandler);
-
-//***
-// Define Trace flags for use within this file:
-//***
-
-static ossimTrace traceExec  ("ossimCcfTileSource:exec");
-static ossimTrace traceDebug ("ossimCcfTileSource:debug");
-
-// For interleave type enum to string conversions.
-static const ossimInterleaveTypeLut ILUT;
-
-ossimCcfTileSource::ossimCcfTileSource()
-   :
-      ossimImageHandler(),
-      theCcfHead(),
-      theTile(NULL),
-      theChipBuffer(NULL),
-      theFileStr(NULL),
-      theOutputBandList(1),
-      theByteOrder(ossim::byteOrder())
-{}
-
-ossimCcfTileSource::~ossimCcfTileSource()
-{
-  close();
-}
-
-ossimRefPtr<ossimImageData> ossimCcfTileSource::getTile(
-   const  ossimIrect& rect, ossim_uint32 resLevel)
-{
-   if (theTile.valid())
-   {
-      // Image rectangle must be set prior to calling getTile.
-      theTile->setImageRectangle(rect);
-      
-      if ( getTile( theTile.get(), resLevel ) == false )
-      {
-         if (theTile->getDataObjectStatus() != OSSIM_NULL)
-         {
-            theTile->makeBlank();
-         }
-      }
-   }
-
-   return theTile;
-}
-
-bool ossimCcfTileSource::getTile(ossimImageData* result,
-                                 ossim_uint32 resLevel)
-{
-   bool status = false;
-
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
-   {
-      result->ref();  // Increment ref count.
-
-      //---
-      // Check for overview tile.  Some overviews can contain r0 so always
-      // call even if resLevel is 0.  Method returns true on success, false
-      // on error.
-      //---
-      status = getOverviewTile(resLevel, result);
-      
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-         
-         ossimIrect tile_rect = result->getImageRectangle();
-         
-         ossimIrect image_rect = theCcfHead.imageRect(resLevel);
-   
-         //---
-         // See if any point of the requested tile is in the image.
-         //---
-         if ( tile_rect.intersects(image_rect) )
-         {
-            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
-            
-            if ( !tile_rect.completely_within(clip_rect) )
-            {
-               // Start with a blank tile.
-               result->makeBlank();
-            }
-            
-            // Load the tile buffer with data from the ccf.
-            status = fillBuffer(tile_rect,
-                                clip_rect,
-                                image_rect,
-                                resLevel,
-                                result);
-            if (status)
-            {
-               result->validate();
-            }
-         }
-      }
-      
-      result->unref();  // Decrement ref count.
-   }
-
-   return status;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimCcfTileSource::fillBuffer(const ossimIrect& tile_rect,
-                                    const ossimIrect& clip_rect,
-                                    const ossimIrect& image_rect,
-                                    ossim_uint32 reduced_res_level,
-                                    ossimImageData* tile)
-{
-   bool status = false;
-   
-   //***
-   // Determine the pixel type and make the appropriate tiles.
-   //***
-   switch (theCcfHead.pixelType())
-   {
-      case OSSIM_UCHAR:
-         status = fillUcharBuffer(tile_rect,
-                                  clip_rect,
-                                  image_rect,
-                                  reduced_res_level,
-                                  tile);
-         break;
-      case OSSIM_USHORT11:
-      case OSSIM_USHORT16:
-         status = fillUshortBuffer(tile_rect,
-                                   clip_rect,
-                                   image_rect,
-                                   reduced_res_level,
-                                   tile);
-         break;
-      default:
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimCcfTileSource fillBuffer ERROR:"
-            << "\nUnsupported pixel type!"
-            << "\nBuffer not filled.  Returning error." << endl;
-         break;
-   }
-
-   return status;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimCcfTileSource::fillUcharBuffer(const ossimIrect& tile_rect,
-                                         const ossimIrect& clip_rect,
-                                         const ossimIrect& /* image_rect */,
-                                         ossim_uint32 reduced_res_level,
-                                         ossimImageData* tile)
-{
-   if(!isOpen()) return false;
-      
-   const ossim_uint32 TILE_SIZE_PER_BAND     = tile->getSizePerBand();
-   const ossim_uint32 CHIP_SIZE_PER_BAND     = theCcfHead.chipSizePerBand();
-   const ossim_uint32 SAMPLES_PER_CHIP       = theCcfHead.samplesPerChip();
-   const ossim_uint32 LINES_PER_CHIP         = theCcfHead.linesPerChip();
-   const ossim_uint32 BYTES_PER_CHUNK        = theCcfHead.bytesPerChunk();
-   const ossim_uint32 BYTES_PER_CHIP         = theCcfHead.bytesPerChip();
-   const ossim_uint32 CHIPS_IN_SAMPLE_DIR    = theCcfHead.sampleChipsPerChunk();
-   const ossim_uint32 CHIPS_IN_LINE_DIR      = theCcfHead.lineChipsPerChunk();
-   const ossim_uint32 NUMBER_OF_INPUT_BANDS  = theCcfHead.numberOfBands();
-   const ossim_uint32 CHUNKS_IN_SAMPLE_DIR   = theCcfHead.chunksInSampleDir(reduced_res_level);
-   const ossim_uint32 CHUNK_SIDE_SIZE        = SAMPLES_PER_CHIP *
-                                        CHIPS_IN_SAMPLE_DIR;
-   const ossim_uint32 CHIP_OFFSET_TO_END     = SAMPLES_PER_CHIP - 1;
-
-   //***
-   // Shift the upper left corner of the "clip_rect" to the an even chunk
-   // boundry.
-   //***
-   ossimIpt chunkOrigin = clip_rect.ul();
-   adjustToStartOfChunk(chunkOrigin);
-
-   //***
-   // Calculate the number of chunks needed in the line/sample directions.
-   //***
-   ossim_uint32 size_in_x
-      = static_cast<ossim_uint32>(clip_rect.lr().x - chunkOrigin.x + 1);
-   ossim_uint32 size_in_y
-      = static_cast<ossim_uint32>(clip_rect.lr().y - chunkOrigin.y + 1);
-   ossim_uint32 w = (CHIPS_IN_SAMPLE_DIR*SAMPLES_PER_CHIP);
-   ossim_uint32 h = (CHIPS_IN_LINE_DIR*LINES_PER_CHIP);
-   ossim_uint32 chunks_in_x_dir = size_in_x / w  + (size_in_x % w  ? 1 : 0);
-   ossim_uint32 chunks_in_y_dir = size_in_y / h + (size_in_y % h ? 1 : 0);
-   
-   
-   //***
-   // Get the start of data for the "reduced_res_level" passed in.
-   //***
-   streampos startOfData = theCcfHead.startOfData(reduced_res_level);
-   ossimIpt ulChunkPt = chunkOrigin;
-
-   // Chunk loop in line direction.
-   for (ossim_uint32 y=0; y<chunks_in_y_dir; ++y)
-   {
-      ulChunkPt.x = chunkOrigin.x;
-
-      // Chunk loop in sample direction.
-      for (ossim_uint32 x=0; x<chunks_in_x_dir; ++x)
-      {
-         //***
-         // Sequence through the chips in the chunk.
-         // Grab the ccf data and stuff the tile buffer.
-         //***
-         ossimIpt chip_pt = ulChunkPt;
-
-         // Chip loop in line direction.
-         for (ossim_uint32 y_chip=0; y_chip<CHIPS_IN_LINE_DIR; ++y_chip) 
-         {
-            chip_pt.x = ulChunkPt.x;  // Reset x back to front of chunk.
-
-            // Chip loop in sample direction.
-            for (ossim_uint32 x_chip=0; x_chip<CHIPS_IN_SAMPLE_DIR; ++x_chip)
-            {
-               ossimIrect chip_rect(chip_pt.x,
-                               chip_pt.y,
-                               chip_pt.x + CHIP_OFFSET_TO_END,
-                               chip_pt.y + CHIP_OFFSET_TO_END);
-               
-               if (chip_rect.intersects(clip_rect))
-               {
-                  //***
-                  // Some point in the chip intersect the tile so grab the
-                  // data.
-                  //***
-
-                  //***
-                  // Get the seek position for the chunk.
-                  //***
-                  streampos tmp_offset
-                     = ( ulChunkPt.y / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK *
-                         CHUNKS_IN_SAMPLE_DIR ) +
-                     ( ulChunkPt.x / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK );
-
-                  streampos seek_position = startOfData + tmp_offset;
-
-                  // Now move it to the chip.
-                  tmp_offset
-                     = ( y_chip *  BYTES_PER_CHIP * CHIPS_IN_SAMPLE_DIR ) +
-                     (x_chip * BYTES_PER_CHIP);
-
-                  seek_position += tmp_offset;
-
-                  // Seek to the chip
-                  theFileStr->seekg(seek_position, ios::beg);
-
-                  //***
-                  // Read the chip from the ccf file into the chip buffer.
-                  // This will get all the bands.  Bands are interleaved by
-                  // chip.
-                  //***
-                  if (!theFileStr->read((char*)theChipBuffer, BYTES_PER_CHIP))
-                  {
-                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-                     cerr << "ossimCcfTileSource fillUchBuffer READ ERROR!"
-                          << "\nReturning from method." << endl;
-                     return false;
-                  }
-                  
-                  ossimIrect chip_clip_rect = clip_rect.clipToRect(chip_rect);
-
-                  //***
-                  // Band loop in sample direction.  Bands are interleaved by
-                  // chip.
-                  //***
-                  for (ossim_uint32 band=0; band<NUMBER_OF_INPUT_BANDS; ++band)
-                  {
-                     //***
-                     // Get a pointer positioned at the first valid pixel in
-                     // the chip.
-                     //***
-                     ossim_uint8* s
-                        = theChipBuffer +
-                        band * CHIP_SIZE_PER_BAND + 
-                        (chip_clip_rect.ul().y - chip_rect.ul().y) *
-                        SAMPLES_PER_CHIP + chip_clip_rect.ul().x -
-                        chip_rect.ul().x;
-                                
-                     //***
-                     // Get a pointer positioned at the first valid pixel in
-                     // the tile.
-                     //***
-                     ossim_uint8* d
-                        = (ossim_uint8*)tile->getBuf() +
-                        band * TILE_SIZE_PER_BAND +
-                        (chip_clip_rect.ul().y - tile_rect.ul().y) *
-                        tile->getWidth() + chip_clip_rect.ul().x -
-                        tile_rect.ul().x;      
-
-                     // Line loop through a chip.
-                     for (ossim_int32 chip_line = chip_clip_rect.ul().y;
-                          chip_line <= chip_clip_rect.lr().y;
-                          chip_line++)
-                     {
-                        // Sample loop through a chip.
-                        ossim_uint32 i=0;
-                        for (ossim_int32 chip_sample = chip_clip_rect.ul().x;
-                             chip_sample <= chip_clip_rect.lr().x;
-                             chip_sample++)
-                        {
-                           d[i] = s[i];
-                           i++;
-                        }
-
-                        // Increment the pointers by one line.
-                        s += SAMPLES_PER_CHIP;
-                        d += tile->getWidth();
-                     }
-                     
-                  } // End of band loop.
-                  
-               } // End of if (chip_rect.intersects(clip_rect))
-               
-               chip_pt.x += SAMPLES_PER_CHIP;
-               
-            } // End of chip loop in the sample direction.
-
-           chip_pt.y += LINES_PER_CHIP; 
-            
-         } // End of chip loop in the line direction.
-         
-         ulChunkPt.x += CHUNK_SIDE_SIZE;
-         
-      }  // End of chunk loop in the sample direction.
-
-      ulChunkPt.y += CHUNK_SIDE_SIZE;
-      
-   }  // End of chunk loop in the line direction.
-
-   return true;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimCcfTileSource::fillUshortBuffer(const ossimIrect& tile_rect,
-                                          const ossimIrect& clip_rect,
-                                          const ossimIrect& /* image_rect */,
-                                          ossim_uint32 reduced_res_level,
-                                          ossimImageData* tile)
-{
-   const ossim_uint32 TILE_SIZE_PER_BAND     = tile->getSizePerBand();
-   const ossim_uint32 CHIP_SIZE_PER_BAND     = theCcfHead.chipSizePerBand();
-   const ossim_uint32 SAMPLES_PER_CHIP       = theCcfHead.samplesPerChip();
-   const ossim_uint32 LINES_PER_CHIP         = theCcfHead.linesPerChip();
-   const ossim_uint32 BYTES_PER_CHUNK        = theCcfHead.bytesPerChunk();
-   const ossim_uint32 BYTES_PER_CHIP         = theCcfHead.bytesPerChip();
-   const ossim_uint32 CHIPS_IN_SAMPLE_DIR    = theCcfHead.sampleChipsPerChunk();
-   const ossim_uint32 CHIPS_IN_LINE_DIR      = theCcfHead.lineChipsPerChunk();
-   const ossim_uint32 NUMBER_OF_INPUT_BANDS  = theCcfHead.numberOfBands();
-   const ossim_uint32 CHUNKS_IN_SAMPLE_DIR   = theCcfHead.
-                                        chunksInSampleDir(reduced_res_level);
-   const ossim_uint32 CHUNK_SIDE_SIZE        = SAMPLES_PER_CHIP *
-                                        CHIPS_IN_SAMPLE_DIR;
-   const ossim_uint32 CHIP_OFFSET_TO_END     = SAMPLES_PER_CHIP - 1;
-   
-   //***
-   // Shift the upper left corner of the "clip_rect" to the an even chunk
-   // boundry.
-   //***
-   ossimIpt chunkOrigin = clip_rect.ul();
-   adjustToStartOfChunk(chunkOrigin);
-
-   //***
-   // Calculate the number of chunks needed in the line/sample directions.
-   //***
-   
-   ossim_uint32 size_in_x = clip_rect.lr().x - chunkOrigin.x + 1;
-   ossim_uint32 size_in_y = clip_rect.lr().y - chunkOrigin.y + 1;
-   ossim_uint32 w = (CHIPS_IN_SAMPLE_DIR*SAMPLES_PER_CHIP);
-   ossim_uint32 h = (CHIPS_IN_LINE_DIR*LINES_PER_CHIP);
-   ossim_uint32 chunks_in_x_dir = size_in_x / w  + (size_in_x % w  ? 1 : 0);
-   ossim_uint32 chunks_in_y_dir = size_in_y / h + (size_in_y % h ? 1 : 0);
-   //***
-   // Get the start of data for the "reduced_res_level" passed in.
-   //***
-   streampos startOfData = theCcfHead.startOfData(reduced_res_level);
-   ossimIpt ulChunkPt = chunkOrigin;
-
-   // Chunk loop in line direction.
-   for (ossim_uint32 y=0; y<chunks_in_y_dir; ++y)
-   {
-      ulChunkPt.x = chunkOrigin.x;
-
-      // Chunk loop in sample direction.
-      for (ossim_uint32 x=0; x<chunks_in_x_dir; ++x)
-      {
-         //***
-         // Sequence through the chips in the chunk.
-         // Grab the ccf data and stuff the tile buffer.
-         //***
-         ossimIpt chip_pt = ulChunkPt;
-
-         // Chip loop in line direction.
-         for (ossim_uint32 y_chip=0; y_chip<CHIPS_IN_LINE_DIR; ++y_chip) 
-         {
-            chip_pt.x = ulChunkPt.x;  // Reset x back to front of chunk.
-
-            // Chip loop in sample direction.
-            for (ossim_uint32 x_chip=0; x_chip<CHIPS_IN_SAMPLE_DIR; ++x_chip)
-            {
-               ossimIrect chip_rect(chip_pt.x,
-                               chip_pt.y,
-                               chip_pt.x + CHIP_OFFSET_TO_END,
-                               chip_pt.y + CHIP_OFFSET_TO_END);
-               
-               if (chip_rect.intersects(clip_rect))
-               {
-                  //***
-                  // Some point in the chip intersect the tile so grab the
-                  // data.
-                  //***
-
-                  //***
-                  // Get the seek position for the chunk.
-                  //***
-                  streampos tmp_offset
-                     = ( ulChunkPt.y / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK *
-                         CHUNKS_IN_SAMPLE_DIR ) +
-                     ( ulChunkPt.x / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK );
-
-                  streampos seek_position = startOfData + tmp_offset;
-
-                  // Now move it to the chip.
-                  tmp_offset
-                     = ( y_chip *  BYTES_PER_CHIP * CHIPS_IN_SAMPLE_DIR ) +
-                     (x_chip * BYTES_PER_CHIP);
-
-                  seek_position += tmp_offset;
-
-                  // Seek to the chip
-                  theFileStr->seekg(seek_position, ios::beg);
-
-                  //***
-                  // Read the chip from the ccf file into the chip buffer.
-                  // This will get all the bands.  Bands are interleaved by
-                  // chip.
-                  //***
-                  if (!theFileStr->read((char*)theChipBuffer, BYTES_PER_CHIP))
-                  {
-                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-                     cerr << "ossimCcfTileSource fillUshortBuffer READ ERROR!"
-                          << "Returning from method." << endl;
-                     return false;
-                  }
-                  
-                  ossimIrect chip_clip_rect = clip_rect.clipToRect(chip_rect);
-
-                  //***
-                  // Band loop in sample direction.  Bands are interleaved by
-                  // chip.
-                  //***
-                  for (ossim_uint32 band=0; band<NUMBER_OF_INPUT_BANDS; band++)
-                  {
-                     //***
-                     // Get a pointer positioned at the first valid pixel in
-                     // the chip.
-                     //***
-                     ossim_uint16* s
-                        = (ossim_uint16*)theChipBuffer +
-                        band * CHIP_SIZE_PER_BAND + 
-                        (chip_clip_rect.ul().y - chip_rect.ul().y) *
-                        SAMPLES_PER_CHIP + chip_clip_rect.ul().x -
-                        chip_rect.ul().x;       
-                     
-                     //***
-                     // Get a pointer positioned at the first valid pixel in
-                     // the tile.
-                     //***
-                     ossim_uint16* d
-                        = (ossim_uint16*)tile->getBuf() +
-                        band * TILE_SIZE_PER_BAND +
-                        (chip_clip_rect.ul().y - tile_rect.ul().y) *
-                        tile->getWidth() + chip_clip_rect.ul().x -
-                        tile_rect.ul().x;
-                     
-                     // Line loop through a chip.
-                     for (ossim_int32 chip_line = chip_clip_rect.ul().y;
-                          chip_line <= chip_clip_rect.lr().y;
-                          ++chip_line)
-                     {
-                        // Sample loop through a chip.
-                        ossim_uint32 i=0;
-                        for (ossim_int32 chip_sample = chip_clip_rect.ul().x;
-                             chip_sample <= chip_clip_rect.lr().x;
-                             ++chip_sample)
-                        {
-                           if (theByteOrder == OSSIM_LITTLE_ENDIAN)
-                           {
-                              //***
-                              // CCF data alway stored in big endian byte
-                              // order so swap the bytes.
-                              //***
-                              d[i] = (s[i] << 8) | (s[i] >> 8);
-                           }
-                           else
-                           {
-                              d[i] = s[i];
-                           }
-                           
-                           ++i;
-                        }
-
-                        // Increment the pointers by one line.
-                        s += SAMPLES_PER_CHIP;
-                        d += tile->getWidth();
-                     }
-                     
-                  } // End of band loop.
-                  
-               } // End of if (chip_rect.intersects(clip_rect))
-               
-               chip_pt.x += SAMPLES_PER_CHIP;
-               
-            } // End of chip loop in the sample direction.
-
-           chip_pt.y += LINES_PER_CHIP; 
-            
-         } // End of chip loop in the line direction.
-         
-         ulChunkPt.x += CHUNK_SIDE_SIZE;
-         
-      }  // End of chunk loop in the sample direction.
-
-      ulChunkPt.y += CHUNK_SIDE_SIZE;
-      
-   }  // End of chunk loop in the line direction.
-
-   return true;
-}
-   
-            
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-ossimIrect
-ossimCcfTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   return theCcfHead.imageRect(reduced_res_level);
-}
-
-//*******************************************************************
-// Public Method:
-//*******************************************************************
-bool ossimCcfTileSource::setOutputBandList(const vector<ossim_uint32>& outputBandList)
-{
-   static const char MODULE[] = "ossimCcfTileSource::setOutputBandList";
-   if (traceExec())  CLOG << "entering..." << endl;
-   
-   if (outputBandList.size() != theOutputBandList.size())
-   {
-      //***
-      // Verify that each individual band does not bust the range of input
-      // bands.
-      //***
-      for (ossim_uint32 i=0; i<outputBandList.size(); i++)
-      {
-         if (outputBandList[i] > (getNumberOfInputBands() - 1))
-         {
-            setErrorStatus();
-
-            cerr << MODULE << " ERROR:"
-                 << "\nOutput band number in list is greater than the "
-                 << "number of bands in the image source!"
-                 << "\noutputBandList[" << i << "]:  "
-                 << "\nHighest availabe band:  "
-                 << (getNumberOfInputBands() - 1)
-                 << "\nError status has been set!  Returning..."
-                 << endl;
-            return false;            
-         }
-      }
-
-      // Remove the old tiles and reallocate with the new size.
-      theTile = NULL;
-   }
-
-   theOutputBandList = outputBandList;  // Assign the new list.
-
-   if (traceExec())  CLOG << "returning..." << endl;
-   return true;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimCcfTileSource::saveState(ossimKeywordlist& kwl,
-                                   const char* prefix) const
-{
-   // Currently nothing to do here.
-   return ossimImageHandler::saveState(kwl, prefix);
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimCcfTileSource::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   if (ossimImageHandler::loadState(kwl, prefix))
-   {
-      if (open())
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimCcfTileSource::open()
-{
-   static const char MODULE[] = "ossimCcfTileSource::open";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   if(isOpen())
-   {
-      close();
-   }
-   
-   if (traceDebug())
-   {
-      CLOG << "DEBUG -- "
-           << "\n\t theImageFile: " << theImageFile << endl;
-   }
-   
-   if (theCcfHead.parseCcfHeader(theImageFile.c_str()) == false)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      if (traceExec())  CLOG << "returning with error..." << endl;
-      return false;
-   }
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG -- "
-           << "\n\t theImageFile: " << theImageFile
-           << "\n\t theCcfHead: " << theCcfHead
-           << endl;
-   }
-
-   theFileStr = new std::ifstream;
-   // Open up the file for reading.
-   theFileStr->open(theImageFile.c_str(), ios::in | ios::binary);
-   
-   if (!(*theFileStr))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      
-      cerr << MODULE << " ERROR!"
-           << "\nCould not open file:  " << theImageFile.c_str()
-           << "\nReturning..." << endl;
-      if (traceExec())  CLOG << "returning with error..." << endl;
-
-      delete theFileStr;
-      theFileStr = NULL;
-      return false;
-   }
-
-   theTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile->initialize();
-     
-   theChipBuffer  = new ossim_uint8[theCcfHead.bytesPerChip()];
-   
-   // Initialize the output band list.
-   if (getNumberOfInputBands() > theOutputBandList.size())
-   {
-      theOutputBandList.resize(getNumberOfInputBands());
-   }
-   
-   for (ossim_uint32 i=0; i<getNumberOfInputBands(); ++i)
-   {
-      theOutputBandList[i] = i; // One to one for initial setup.
-   }
-   
-   completeOpen();
-   
-   if (traceDebug() && theTile.valid())
-   {
-      CLOG << "DEBUG:"
-           << "\ntheTile:\n" << *theTile << endl;
-   }
-
-   if (traceExec())  CLOG << "returning..." << endl;
-   return true;
-}
-
-void ossimCcfTileSource::close()
-{
-   theTile = NULL;
-   if (theChipBuffer)
-   {
-      delete [] theChipBuffer;
-      theChipBuffer = NULL;
-   }
-   if(theFileStr)
-   {
-      theFileStr->close();
-      theFileStr->clear();
-      delete theFileStr;
-      theFileStr = NULL;
-   }
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossimScalarType ossimCcfTileSource::getOutputScalarType() const
-{
-   return theCcfHead.pixelType();
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimCcfTileSource::getTileWidth() const
-{
-   return ( theTile.valid() ? theTile->getWidth() : 0 );
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimCcfTileSource::getTileHeight() const
-{
-   return ( theTile.valid() ? theTile->getHeight() : 0 );
-}
-
-ossim_uint32 ossimCcfTileSource::getImageTileWidth() const
-{
-   return 32;
-}
-
-ossim_uint32 ossimCcfTileSource::getImageTileHeight() const
-{
-   return 32;
-}
-
-void ossimCcfTileSource::initVerticesFromHeader()
-{
-   theValidImageVertices.clear();
-   
-   const vector<ossimIpt>& validImageVertices
-      = theCcfHead.getValidImageVertices();
-   
-   ossim_uint32 upper = (ossim_uint32)validImageVertices.size();
-   if(!upper) return;
-   for(ossim_uint32 index = 0; index < upper; ++index)
-   {
-      theValidImageVertices.push_back(validImageVertices[index]);
-   }
-
-   if (traceDebug())
-   {
-      cout << "ossimCcfTileSource::initVerticesFromHeader DEBUG:"
-           << "\nValid image vertices:"
-           << endl;
-      for (ossim_uint32 i=0; i<upper; ++i)
-      {
-         cout << "\npoint[" << i << "]:  " << theValidImageVertices[i];
-      }
-      cout << endl;
-   }
-}
-
-bool ossimCcfTileSource::isEcgGeom(const ossimFilename& filename)const
-{
-   ossimFilename file = filename;
-   file.setExtension("geom");
-   
-   if(file.exists())
-   {
-      char bytes[3];
-      ifstream in(file.c_str());
-      
-      in.read((char*)bytes, 3);
-      ossimString testEcg(bytes,
-                          bytes + 3);
-      testEcg = testEcg.downcase();
-      if(in&&(testEcg == "ecg"))
-      {
-         return true;
-      }
-   }
-   return false;
-}
-
-ossimString ossimCcfTileSource::getShortName()const
-{
-   return ossimString("ccf");
-}
-
-ossimString ossimCcfTileSource::getLongName()const
-{
-   return ossimString("ccf reader");
-}
-
-ossim_uint32 ossimCcfTileSource::getNumberOfInputBands() const
-{
-   return theCcfHead.numberOfBands();
-}
-
-ossim_uint32 ossimCcfTileSource::getNumberOfOutputBands()const
-{
-   return getNumberOfInputBands();
-}
-
-ossim_uint32 ossimCcfTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   return theCcfHead.numberOfLines(reduced_res_level);
-}
-
-ossim_uint32 ossimCcfTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   return theCcfHead.numberOfSamples(reduced_res_level);
-}
-
-ossim_uint32 ossimCcfTileSource::getNumberOfDecimationLevels() const
-{
-   return theCcfHead.numberOfReducedResSets();
-}
-
-bool ossimCcfTileSource::isOpen()const
-{
-   return (theFileStr != NULL);
-}
-
-ossimRefPtr<ossimProperty> ossimCcfTileSource::getProperty(const ossimString& name)const
-{
-	if(name == "file_type")
-	{
-		
-		return new ossimStringProperty(name, "CCF");
-	}
-	return ossimImageHandler::getProperty(name);
-}
-
-void ossimCcfTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-	ossimImageHandler::getPropertyNames(propertyNames);
-	propertyNames.push_back("file_type");
-}
-
-void ossimCcfTileSource::adjustToStartOfChunk(ossimIpt& pt) const
-{
-   pt.x &= 0xffffff00;
-   pt.y &= 0xffffff00;
-}
-
-void ossimCcfTileSource::adjustToStartOfChip(ossimIpt& pt) const
-{
-   pt.x &= 0xffffffe0;
-   pt.y &= 0xffffffe0;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimCibCadrgTileSource.cpp b/ossim/src/ossim/imaging/ossimCibCadrgTileSource.cpp
deleted file mode 100644
index 8d287f2..0000000
--- a/ossim/src/ossim/imaging/ossimCibCadrgTileSource.cpp
+++ /dev/null
@@ -1,1334 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//********************************************************************
-// $Id: ossimCibCadrgTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <algorithm>
-
-#include <ossim/imaging/ossimCibCadrgTileSource.h>
-
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/support_data/ossimRpfFrame.h>
-#include <ossim/support_data/ossimRpfHeader.h>
-#include <ossim/support_data/ossimRpfToc.h>
-#include <ossim/support_data/ossimRpfTocEntry.h>
-#include <ossim/support_data/ossimRpfCompressionSection.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimCylEquAreaProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug = ossimTrace("ossimCibCadrgTileSource:debug");
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimCibCadrgTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-
-RTTI_DEF1(ossimCibCadrgTileSource, "ossimCibCadrgTileSource", ossimImageHandler)
-
-const ossim_uint32 ossimCibCadrgTileSource::CIBCADRG_FRAME_WIDTH  = 1536;
-const ossim_uint32 ossimCibCadrgTileSource::CIBCADRG_FRAME_HEIGHT = 1536;
-
-ossimCibCadrgTileSource::ossimCibCadrgTileSource()
-   :ossimImageHandler(),
-    theCompressedBuffer(0),
-    theUncompressedBuffer(0),
-    theNumberOfLines(0),
-    theNumberOfSamples(0),
-    theTile(0),
-    theTableOfContents(0),
-    theEntryToRender(0),
-    theEntryNumberToRender(1),
-    theTileSize(128, 128),
-    theProductType(OSSIM_PRODUCT_TYPE_UNKNOWN),
-    theSkipEmptyCheck(false)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimCibCadrgTileSource::ossimCibCadrgTileSource entered...\n";
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << "\n";
-#endif      
-   }
-   theWorkFrame = new ossimRpfFrame;
-   
-   // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
-   // convert to bytes
-   theCompressedBuffer   = new ossim_uint8[(64*64*12)/8];
-
-   // whether CIB or CADRG we will alocate the buffer
-   // to the larger of the 2 (CADRG is 3 bands)
-   theUncompressedBuffer = new ossim_uint8[256*256*3];
-                           
-}
-
-ossimCibCadrgTileSource::~ossimCibCadrgTileSource()
-{
-   if(theCompressedBuffer)
-   {
-      delete [] theCompressedBuffer;
-      theCompressedBuffer = 0;
-   }
-   if(theUncompressedBuffer)
-   {
-      delete [] theUncompressedBuffer;
-      theUncompressedBuffer = 0;
-   }
-   if(theWorkFrame)
-   {
-      delete theWorkFrame;
-      theWorkFrame = 0;
-   }
-   close();
-}
-
-ossimString ossimCibCadrgTileSource::getShortName()const
-{
-   return ossimString("CIB/CADRG");
-}
-
-ossimString ossimCibCadrgTileSource::getLongName()const
-{
-   return ossimString("CIB/CADRG reader");
-}
-
-
-void ossimCibCadrgTileSource::close()
-{
-   deleteAll();
-   ossimImageHandler::close();
-}
-
-bool ossimCibCadrgTileSource::isOpen()const
-{
-   return (theTableOfContents!=0);
-}
-
-bool ossimCibCadrgTileSource::open()
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimCibCadrgTileSource::open(): Entered....."
-         << "\ntheImageFile: " << theImageFile << std::endl;
-   }
-
-   bool result = false;
-   
-   if(isOpen())
-   {
-      close();
-   }
-
-   theTableOfContents = new ossimRpfToc;
-   
-   if(theTableOfContents)
-   {      
-      if(theTableOfContents->parseFile(theImageFile) == ossimErrorCodes::OSSIM_OK)
-      {
-         if(theTableOfContents->getNumberOfEntries() > 0)
-         {
-            vector<ossimString> scaleList = getProductScaleList();
-            if(scaleList.size() > 0)
-            {
-               std::vector<ossim_uint32> entryList;
-               getEntryList(entryList);
-               if(entryList.size() > 0)
-               {
-                  setCurrentEntry(entryList[0]);
-                  
-                  if(theEntryToRender)
-                  {
-                     // a CADRG is 1536x1536 per frame.
-                     theNumberOfLines   = theEntryToRender->getNumberOfLines();
-                     theNumberOfSamples = theEntryToRender->getNumberOfSamples();
-                  }
-
-                  if(theEntryToRender->getProductType().trim().upcase() == "CADRG")
-                  {
-                     theProductType = OSSIM_PRODUCT_TYPE_CADRG;
-                     result = true;
-                  }
-                  else if(theEntryToRender->getProductType().trim().upcase() == "CIB")
-                  {
-                     theProductType = OSSIM_PRODUCT_TYPE_CIB;
-                     result = true;
-                  }
-                  if ( result )
-                  {
-                     // This initializes tiles and buffers.
-                     allocateForProduct();
-                  }
-               }
-            }
-         }
-      }
-   }
-
-   if(!result)
-   {
-      theImageFile.clear();
-      close();
-   }
-
-#if 0 /* 20100414 - drb */
-   else
-   {
-      //---
-      // Adjust image rect so not to go over the -180 to 180 and -90 to 90
-      // bounds.
-      //---
-      // Note this did not do any boundary checking and was in conflict with setTocEntryToRender
-      // method calculation of lines and samps.
-      // setActualImageRect();
-
-      std::ifstream in(theImageFile.c_str(), std::ios::in|std::ios::binary);
-      if(in.good()&&theTableOfContents->getRpfHeader())
-      {
-      }
-      completeOpen();
-
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-   }
-#endif
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimCibCadrgTileSource::open(): Leaving at line " << __LINE__
-         << " result=" << (result?"true":"false") << std::endl;
-   }
-
-   return result;
-}
-
-void ossimCibCadrgTileSource::setSkipEmptyCheck( bool bSkipEmptyCheck )
-{
-   theSkipEmptyCheck = bSkipEmptyCheck;
-}
-
-ossimRefPtr<ossimImageData> ossimCibCadrgTileSource::getTile(
-   const  ossimIrect& rect, ossim_uint32 resLevel)
-{
-   if (theTile.valid())
-   {
-      // Image rectangle must be set prior to calling getTile.
-      theTile->setImageRectangle(rect);
-      
-      if ( getTile( theTile.get(), resLevel ) == false )
-      {
-         if (theTile->getDataObjectStatus() != OSSIM_NULL)
-         {
-            theTile->makeBlank();
-         }
-      }
-   }
-   
-   return theTile;
-}
-
-bool ossimCibCadrgTileSource::getTile(ossimImageData* result,
-                                      ossim_uint32 resLevel)
-{
-   bool status = false;
-
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) &&
-       (theProductType != OSSIM_PRODUCT_TYPE_UNKNOWN) )
-   {
-      if ( resLevel > 0 )
-      {
-         //---
-         // Check for overview tile.  Some overviews can contain r0 so always
-         // call even if resLevel is 0 (if overview is not virtual).  Method 
-         // returns true on success, false on error.
-         //---
-         status = getOverviewTile(resLevel, result);
-      }
-
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-
-         ossimIrect rect = result->getImageRectangle();
-
-         ossimIrect imageRect = getImageRectangle();
-
-         if ( rect.intersects(imageRect) )
-         {
-            //---
-            // Start with a blank tile in case there is not total coverage
-            // for rect.
-            //---
-            result->makeBlank();
-   
-            vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
-            if(frames.size() > 0)
-            {
-               //---
-               // Now lets render each frame.  Note we will have to find
-               // subframes
-               // that intersect the rectangle of interest for each frame.
-               //---
-               fillTile(rect, frames, result);
-               
-               // Revalidate tile status.
-               result->validate();
-            }
-         }
-         else
-         {
-            result->makeBlank();
-         }
-      }
-   }
-   
-   return status;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getNumberOfInputBands()const
-{
-   switch(theProductType)
-   {
-      case  OSSIM_PRODUCT_TYPE_UNKNOWN:
-      {
-         return 0;
-      }
-      case OSSIM_PRODUCT_TYPE_CIB:
-      {
-         return 1;
-      }
-      case OSSIM_PRODUCT_TYPE_CADRG:
-      {
-         return 3;
-      }
-   }
-   
-   return 0;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getNumberOfOutputBands()const
-{
-   switch(theProductType)
-   {
-      case  OSSIM_PRODUCT_TYPE_UNKNOWN:
-      {
-         return 0;
-      }
-      case OSSIM_PRODUCT_TYPE_CIB:
-      {
-         return 1;
-      }
-      case OSSIM_PRODUCT_TYPE_CADRG:
-      {
-         return 3;
-      }
-   }
-   
-   return 0;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return theNumberOfLines;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfLines(reduced_res_level);
-   }
-
-   return 0;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return theNumberOfSamples;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfSamples(reduced_res_level);
-   }
-
-   return 0;
-}
-
-ossimIrect ossimCibCadrgTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   return ossimIrect(0,                         // upper left x
-                     0,                         // upper left y
-                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
-                     getNumberOfLines(reduced_res_level)   - 1); // lower right y                     
-}
-   
-ossimRefPtr<ossimImageGeometry> ossimCibCadrgTileSource::getImageGeometry()
-{
-   if ( !theGeometry )
-   {
-      // Check for external geom:
-      theGeometry = getExternalImageGeometry();
-      
-      if ( !theGeometry && theEntryToRender )
-      {
-         theGeometry = theEntryToRender->getImageGeometry();
-      }
-
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-   }
-
-   return theGeometry;
-}
-   
-ossimScalarType ossimCibCadrgTileSource::getOutputScalarType() const
-{
-   return OSSIM_UCHAR;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getTileWidth() const
-{
-   return theTileSize.x;
-}
-   
-ossim_uint32 ossimCibCadrgTileSource::getTileHeight() const
-{
-   return theTileSize.y;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getCurrentEntry()const
-{
-   return (ossim_uint32)theEntryNumberToRender;
-}
-
-bool ossimCibCadrgTileSource::setCurrentEntry(ossim_uint32 entryIdx)
-{
-   bool result = false;
-
-   theDecimationFactors.clear();
-   
-   // Clear the geometry.
-   theGeometry = 0;
-   
-   // Must clear or openOverview will use last entries.
-   theOverviewFile.clear();
-   
-   if(setEntryToRender(entryIdx))
-   {
-      completeOpen();
-      result = true;
-   }
-
-   return result;
-}
-
-void ossimCibCadrgTileSource::getEntryList(std::vector<ossim_uint32>& entryList)const
-{
-   std::vector<ossimString> scaleList = getProductScaleList();
-   ossim_uint32 scaleIdx = 0;
-   ossim_uint32 entryIdx = 0;
-   for(scaleIdx = 0; scaleIdx < scaleList.size(); ++scaleIdx)
-   {
-      std::vector<ossim_int32> eList = getProductEntryList(scaleList[scaleIdx]);
-      
-      for(entryIdx = 0; entryIdx < eList.size(); ++entryIdx)
-      {
-         entryList.push_back(eList[entryIdx]);
-      }
-   }
-
-}
-
-bool ossimCibCadrgTileSource::setEntryToRender(ossim_uint32 index)
-{
-   if(isOpen())
-   {
-      const ossimRpfTocEntry *temp = theTableOfContents->getTocEntry(index);
-
-      if(temp)
-      {
-         if(!(temp->getBoundaryInformation().getCoverage().isGeographicRectNull()))
-         {
-            setTocEntryToRender(temp);
-            theEntryNumberToRender = index;
-            if(theEntryToRender)
-            {
-               if(theEntryToRender->getProductType().trim().upcase() == "CADRG")
-               {
-                  theProductType = OSSIM_PRODUCT_TYPE_CADRG;
-               }
-               else if(theEntryToRender->getProductType().trim().upcase() == "CIB")
-               {
-                  theProductType = OSSIM_PRODUCT_TYPE_CIB;
-               }
-               else
-               {
-                  theProductType = OSSIM_PRODUCT_TYPE_UNKNOWN;
-               }
-            }
-            
-            populateLut();
-            
-            return true;
-         }
-      }
-   }
-   
-   return false;
-}
-
-void ossimCibCadrgTileSource::setTocEntryToRender(const ossimRpfTocEntry* entry)
-{
-   if(isOpen()&&entry)
-   {
-      theEntryToRender = entry;
-      theNumberOfLines   = theEntryToRender->getNumberOfLines();
-      theNumberOfSamples = theEntryToRender->getNumberOfSamples();
-      theEntryNumberToRender = theTableOfContents->getTocEntryIndex(entry);
-   }
-}
-
-ossim_int32 ossimCibCadrgTileSource::getCurrentEntryIndex()const
-{
-   return theEntryNumberToRender;
-}
-
-const ossimRpfTocEntry* ossimCibCadrgTileSource::getCurrentTocEntry()const
-{
-   return theEntryToRender;
-}
-
-const ossimRpfToc*  ossimCibCadrgTileSource::getToc()const
-{
-   return theTableOfContents;
-}
-
-bool ossimCibCadrgTileSource::isValidRLevel(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return true;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->isValidRLevel(reduced_res_level);
-   }
-   else
-   {
-      return false;
-   }
-}
-
-vector<ossimString> ossimCibCadrgTileSource::getProductScaleList()const
-{
-   vector<ossimString> result;
-   
-   if(isOpen())
-   {
-      ossim_int32 upperBound = theTableOfContents->getNumberOfEntries();
-
-      for(ossim_int32 index = 0; index < upperBound; ++index)
-      {
-         const ossimRpfTocEntry* entry = theTableOfContents->getTocEntry(index);
-         ossimString scale = entry->getBoundaryInformation().getScale();
-
-         scale = scale.trim().upcase();
-         if(scale!="")
-         {
-            // CIB will have product scales like 5M or 10M
-            // and CADRG's will have product scales like
-            // 1:50K and 1:250K ...
-            // So if these patterns exist then add it to
-            // the product list.
-            if( ( std::find(scale.begin(), scale.end(), ':') != scale.end() )
-                ||
-                (scale[scale.size()-1]=='M'))
-            {
-               // only add it if it doesn't already exist
-               // on the list.
-               if(find(result.begin(), result.end(), scale) == result.end())
-               {
-                  result.push_back(scale);
-               }
-            }
-         }
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimCibCadrgTileSource::getProductScaleList DEBUG:"
-         << endl;
-
-      std::vector<ossimString>::const_iterator i = result.begin();
-      ossim_uint32 index = 0;
-      while (i != result.end())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "scale[" << index << "]:  " << (*i) << endl;
-         ++index;
-         ++i;
-      }
-   }
-   
-   return result;
-}
-
-vector<ossim_int32> ossimCibCadrgTileSource::getProductEntryList(const ossimString& productScale)const
-{
-   vector<ossim_int32> result;
-   
-   if(isOpen())
-   {
-      ossim_int32 upperBound = theTableOfContents->getNumberOfEntries();
-
-      for(ossim_int32 index = 0; index < upperBound; ++index)
-      {
-         const ossimRpfTocEntry* entry = theTableOfContents->getTocEntry(index);
-
-         if(entry)
-         {
-            // If the "skip empty check" is true, we don't check to see if the
-            // actual frame images exist. Otherwise the check is carried out,
-            // which is the default situation.
-            bool bIsEmpty = (theSkipEmptyCheck==false) ? entry->isEmpty() : false;
-
-            // if the entry is not empty then add it to the list.
-            if( bIsEmpty == false )
-            {
-               ossimString scale = entry->getBoundaryInformation().getScale();
-               scale = scale.trim().upcase();
-               if(scale==productScale)
-               {
-                  result.push_back(index);
-               }
-            }
-         }
-      }
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimCibCadrgTileSource::getProductEntryList DEBUG:"
-         << endl;
-
-      std::vector<ossim_int32>::const_iterator i = result.begin();
-      ossim_uint32 index = 0;
-      while (i != result.end())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "scale[" << index << "]:  " << (*i) << endl;
-         ++index;
-         ++i;
-      }
-   }
-   
-   return result;
-   
-}
-
-vector<ossimCibCadrgTileSource::ossimFrameEntryData> ossimCibCadrgTileSource::getIntersectingEntries(const ossimIrect& rect)
-{
-   vector<ossimFrameEntryData> result;
-
-   // make sure we have the Toc entry to render
-   if(!isOpen()) return result;
-   
-   ossimIrect imageRect = getImageRectangle();
-   if(rect.intersects(imageRect))
-   {
-      ossimIrect clipRect  = rect.clipToRect(imageRect);
-      ossimIrect frameRect(clipRect.ul().x/CIBCADRG_FRAME_WIDTH,
-                           clipRect.ul().y/CIBCADRG_FRAME_HEIGHT,
-                           clipRect.lr().x/CIBCADRG_FRAME_WIDTH,
-                           clipRect.lr().y/CIBCADRG_FRAME_HEIGHT);
-
-      ossimRpfFrameEntry tempEntry;
-
-      
-     for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
-      {
-         for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
-         {
-            if(theEntryToRender->getEntry((theEntryToRender->getNumberOfFramesVertical()-1) - row,
-                                          col,
-                                          tempEntry))
-            {
-               if(tempEntry.exists())
-               {
-                   result.push_back(ossimFrameEntryData(row,
-                                                        col,
-                                                        row*CIBCADRG_FRAME_HEIGHT,
-                                                        col*CIBCADRG_FRAME_WIDTH,
-                                                        tempEntry));
-               }
-            }
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimCibCadrgTileSource::fillTile(
-   const ossimIrect& tileRect,
-   const vector<ossimFrameEntryData>& framesInvolved,
-   ossimImageData* tile)
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0;
-       idx < framesInvolved.size();
-       ++idx)
-   {
-
-      if(theWorkFrame->parseFile(framesInvolved[idx].theFrameEntry.getFullPath())
-         == ossimErrorCodes::OSSIM_OK)
-      {
-         // we will fill a subtile.  We pass in which frame it is and the position of the frame.
-         // the actual pixel will be 1536*row and 1536 *col.
-         if(theProductType == OSSIM_PRODUCT_TYPE_CIB)
-         {
-            fillSubTileCib(*theWorkFrame,
-                           tileRect,
-                           framesInvolved[idx],
-                           tile);
-         }
-         else
-         {
-            fillSubTileCadrg(*theWorkFrame,
-                             tileRect,
-                             framesInvolved[idx],
-                             tile);
-         }
-      }
-   }
-}
-
-void ossimCibCadrgTileSource::fillSubTileCadrg(
-   const ossimRpfFrame&  aFrame,
-   const ossimIrect& tileRect,
-   const ossimFrameEntryData& frameEntryData,
-   ossimImageData* tile)
-{
-   // first let's grab the absolute position of the frame rectangle in pixel space
-   ossimIrect frameRect(frameEntryData.thePixelCol,
-                        frameEntryData.thePixelRow,
-                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
-                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
-
-   
-   // now clip it to the tile
-   ossimIrect clipRect = tileRect.clipToRect(frameRect);
-   
-   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
-   
-   if(!compressionSection)
-   {
-      return;
-   }
-
-   const vector<ossimRpfColorGrayscaleTable>& colorTable =
-      aFrame.getColorGrayscaleTable();
-
-   // ESH 03/2009 -- Partial fix for ticket #646.
-   // Crash fix on reading RPFs: Make sure the colorTable vector 
-   // has entries before trying to make use of them. 
-   int numTables = (int)colorTable.size();
-   if ( numTables <= 0 )
-   {
-      return;
-   }
-
-   ossim_uint8 *tempRows[3];
-   
-   tempRows[0] = theUncompressedBuffer;
-   tempRows[1] = (theUncompressedBuffer + 256*256);
-   tempRows[2] = (tempRows[1] + 256*256);
-   
-   // find the shift to 0,0
-   ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
-                      clipRect.ul().y - frameEntryData.thePixelRow);
-   
-   
-   // In order to compute the subframe we will need the corner offsets of
-   // the upper left of the frame and the upper left of the clip rect.  The
-   // clip rect should be completely within the frame.  This just translates the value
-   // to make the upper left of the frame be 0,0.
-   //
-   ossimIrect offsetRect(tempDelta.x,
-                         tempDelta.y,
-                         tempDelta.x + clipRect.width()-1,
-                         tempDelta.y + clipRect.height()-1);
-   
-   // each subframe is 64x64.  We will actually use 256x256 since
-   // we will be uncompressing them.  Note CADRG is a 256x256 tile
-   // compressed to 64x64x12 bit data
-   //
-    ossimIrect subFrameRect(offsetRect.ul().x/256,
-                            offsetRect.ul().y/256,
-                            (offsetRect.lr().x)/256,
-                            (offsetRect.lr().y)/256);
-   
-   ossim_uint32 readPtr  = 0;
-
-   ossim_int32 row = 0;
-   ossim_int32 col = 0;
-   ossim_uint32 i = 0;
-   ossim_uint32 j = 0;
-   ossim_int32 upperY = subFrameRect.lr().y;
-   ossim_int32 upperX = subFrameRect.lr().x;
-   ossim_int32 lowerY = subFrameRect.ul().y;
-   ossim_int32 lowerX = subFrameRect.ul().x; 
-   for(row = lowerY; row <= upperY; ++row)
-   {
-      for(col = lowerX; col <= upperX; ++col)
-      {
-         readPtr = 0;
-         if(aFrame.fillSubFrameBuffer(theCompressedBuffer, 0, row, col))
-         {
-            for (i = 0; i < 256; i += 4)
-            {
-               for (j = 0; j < 256; j += 8)
-               {
-                  ossim_uint16 firstByte  = theCompressedBuffer[readPtr++] & 0xff;
-                  ossim_uint16 secondByte = theCompressedBuffer[readPtr++] & 0xff;
-                  ossim_uint16 thirdByte  = theCompressedBuffer[readPtr++] & 0xff;
-                  
-                  //because dealing with half-bytes is hard, we
-                  //uncompress two 4x4 tiles at the same time. (a
-                  //4x4 tile compressed is 12 bits )
-                  // this little code was grabbed from openmap software.
-                  
-                  /* Get first 12-bit value as index into VQ table */
-                  // I think we need to swap
-                  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
-                  
-                  /* Get second 12-bit value as index into VQ table*/
-                  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
-                  
-                  for (ossim_uint32 t = 0; t < 4; ++t)
-                  {
-                     for (ossim_uint32 e = 0; e < 4; ++e)
-                     {
-                        ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
-                        ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
-
-                        ossim_uint32 pixindex = ((i+t)*256) +
-                                                 (j + e);
-                        const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
-                        const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
-                        
-                        
-                        tempRows[0][pixindex] = color1[0];
-                        tempRows[1][pixindex] = color1[1];
-                        tempRows[2][pixindex] = color1[2];
-                        
-                        tempRows[0][pixindex+4] = color2[0];
-                        tempRows[1][pixindex+4] = color2[1];
-                        tempRows[2][pixindex+4] = color2[2];
-                     } //for e
-                  } //for t
-               }  /* for j */
-            } //for i
-         }
-         else
-         {
-            memset(theUncompressedBuffer, 0, 256*256*3);
-         }
-         ossim_int32 tempCol = col*256;
-         ossim_int32 tempRow = row*256;
-         ossimIrect subRectToFill(frameRect.ul().x + tempCol,
-                                  frameRect.ul().y + tempRow,
-                                  frameRect.ul().x + tempCol + 255,
-                                  frameRect.ul().y + tempRow + 255);
-         tile->loadTile(theUncompressedBuffer,
-                        subRectToFill,
-                        OSSIM_BSQ);
-      }
-   }
-}
-
-void ossimCibCadrgTileSource::fillSubTileCib(
-   const ossimRpfFrame&  aFrame,
-   const ossimIrect& tileRect,
-   const ossimFrameEntryData& frameEntryData,
-   ossimImageData* tile)
-{
-   // first let's grab the absolute position of the frame rectangle in pixel
-   // space
-   ossimIrect frameRect(frameEntryData.thePixelCol,
-                        frameEntryData.thePixelRow,
-                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
-                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
-
-   
-   // now clip it to the tile
-   ossimIrect clipRect = tileRect.clipToRect(frameRect);
-
-   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
-   
-   if(!compressionSection)
-   {
-      return;
-   }
-
-   const vector<ossimRpfColorGrayscaleTable>& colorTable =
-      aFrame.getColorGrayscaleTable();
-
-   // ESH 03/2009 -- Partial fix for ticket #646.
-   // Crash fix on reading RPFs: Make sure the colorTable vector 
-   // has entries before trying to make use of them. 
-   int numTables = (int)colorTable.size();
-   if ( numTables <= 0 )
-   {
-      return;
-   }
-
-   // check to see if it does overlap.  If it doesn't then the width and height
-   // will be a single point
-   {
-      ossim_uint8 *tempRow;
-
-      tempRow = theUncompressedBuffer;
-      
-      // find the shift to 0,0
-      ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
-                         clipRect.ul().y - frameEntryData.thePixelRow);
-      
-      // In order to compute the subframe we will need the corner offsets of
-      // the upper left of the frame and the upper left of the clip rect.  The
-      // clip rect should be completely within the frame.  This just translates the value
-      // to make the upper left of the frame be 0,0.
-      //
-      ossimIrect offsetRect(tempDelta.x,
-                            tempDelta.y,
-                            tempDelta.x + clipRect.width()-1,
-                            tempDelta.y + clipRect.height()-1);
-
-      // each subframe is 64x64.  We will actually use 256x256 since
-      // we will be uncompressing them.  Note CADRG is a 256x256 tile
-      // compressed to 64x64x12 bit data
-      //
-      ossimIrect subFrameRect(offsetRect.ul().x/256,
-                              offsetRect.ul().y/256,
-                              (offsetRect.lr().x)/256,
-                              (offsetRect.lr().y)/256);
-
-      ossim_int32 row = 0;
-      ossim_int32 col = 0;
-      ossim_uint32 i = 0;
-      ossim_uint32 j = 0;
-      ossim_uint32 readPtr = 0;
-      for(row = subFrameRect.ul().y; row <= subFrameRect.lr().y; ++row)
-      {
-         for(col = subFrameRect.ul().x; col <= subFrameRect.lr().x; ++col)
-         {
-            readPtr = 0;
-            if(aFrame.fillSubFrameBuffer(theCompressedBuffer, 0, row, col))
-            {
-               for (i = 0; i < 256; i += 4)
-               {
-                  for (j = 0; j < 256; j += 8)
-                  {
-                     ossim_uint16 firstByte  = theCompressedBuffer[readPtr++] & 0xff;
-                     ossim_uint16 secondByte = theCompressedBuffer[readPtr++] & 0xff;
-                     ossim_uint16 thirdByte  = theCompressedBuffer[readPtr++] & 0xff;
-                     
-                     //because dealing with half-bytes is hard, we
-                     //uncompress two 4x4 tiles at the same time. (a
-                     //4x4 tile compressed is 12 bits )
-                     // this little code was grabbed from openmap software.
-                     
-                     /* Get first 12-bit value as index into VQ table */
-                     // I think we need to swap
-                     ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
-                     
-                     /* Get second 12-bit value as index into VQ table*/
-                     ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
-
-                     for (ossim_uint32 t = 0; t < 4; ++t)
-                     {
-                        for (ossim_uint32 e = 0; e < 4; ++e)
-                        {
-                           ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
-                           ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
-
-                           ossim_uint32 pixindex = ((i+t)*256) + (j + e);
-                           const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
-                           const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
-
-                           
-                           tempRow[pixindex]      = color1[0];
-                           tempRow[pixindex + 4]  = color2[0];
-                        } //for e
-                     } //for t
-                  }  /* for j */
-               } //for i
-            }
-            else
-            {
-               memset(theUncompressedBuffer, 0, 256*256);
-            }
-            ossim_int32 tCol = col*256;
-            ossim_int32 tRow = row*256;
-            ossimIrect subRectToFill(frameRect.ul().x + tCol,
-                                     frameRect.ul().y + tRow,
-                                     frameRect.ul().x + tCol + 255,
-                                     frameRect.ul().y + tRow + 255);
-            tile->loadTile(theUncompressedBuffer,
-                           subRectToFill,
-                           OSSIM_BSQ);
-         }
-      }
-   }  
-}
-
-void ossimCibCadrgTileSource::allocateForProduct()
-{
-   if(theProductType ==  OSSIM_PRODUCT_TYPE_UNKNOWN)
-   {
-      return;
-   }
-   if(theUncompressedBuffer)
-   {
-      delete [] theUncompressedBuffer;
-      theUncompressedBuffer = 0;
-   }
-   if(theCompressedBuffer)
-   {
-      delete [] theCompressedBuffer;
-      theCompressedBuffer = 0;
-   }
-   
-   // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
-   // convert to bytes
-   theCompressedBuffer   = new ossim_uint8[(64*64*12)/8];
-   if(theProductType == OSSIM_PRODUCT_TYPE_CIB)
-   {
-      theUncompressedBuffer = new ossim_uint8[256*256];
-   }
-   else
-   {
-      theUncompressedBuffer = new ossim_uint8[256*256*3];
-   }
-   
-   theTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile->initialize();
-}
-
-const ossimRpfTocEntry* ossimCibCadrgTileSource::findFirstFrame()
-{
-   vector<ossimString> products = getProductScaleList();
-   vector<ossim_int32> indexProducts;
-
-   if(products.size() > 0)
-   {
-      indexProducts = getProductEntryList(products[0]);
-
-      if(indexProducts.size()>0)
-      {
-         theEntryNumberToRender = indexProducts[0];
-         
-         return theTableOfContents->getTocEntry(indexProducts[0]);
-      }
-   }
-   
-   return 0;
-}
-
-
-void ossimCibCadrgTileSource::deleteAll()
-{
-   theOverview = 0;
-   if(theTableOfContents)
-   {
-      delete theTableOfContents;
-      theTableOfContents = 0;
-   }
-}
-
-bool ossimCibCadrgTileSource::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix)const
-{
-   bool result = ossimImageHandler::saveState(kwl, prefix);
-
-   kwl.add(prefix, 
-	   "entry",
-	   theEntryNumberToRender,
-	   true);
-
-   return result;
-}
-   
-bool ossimCibCadrgTileSource::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   const char* MODULE = "ossimCibCadrgTileSource::loadState";
-
-   if(traceDebug())
-   {
-      CLOG << "Entering..." << endl;
-   }
-   bool result = ossimImageHandler::loadState(kwl, prefix);
-
-   if(!result)
-   {
-	   if(traceDebug())
-	   {
-          CLOG << "Leaving..." << endl;
-       }
-      return false;
-   }
-   const char* lookup = 0;
-   lookup = kwl.find(ossimString(prefix), "entry");
-   ossim_int32 entry = ossimString(lookup).toInt32();
-
-   // if an entry is specified then
-   // call the open with an entry number
-   if(lookup)
-   {
-      if(traceDebug())
-      {
-         CLOG << "Leaving..." << endl;
-      }
-      result = ossimImageHandler::open(theImageFile);
-      setCurrentEntry(entry);
-      return result;
-   }
-
-   result = ossimImageHandler::open(theImageFile);
-   
-   return result;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getImageTileWidth() const
-{
-   return 256;
-}
-
-ossim_uint32 ossimCibCadrgTileSource::getImageTileHeight() const
-{
-   return 256;
-}
-
-bool ossimCibCadrgTileSource::isCib() const
-{
-   return (theProductType==OSSIM_PRODUCT_TYPE_CIB);
-}
-
-bool ossimCibCadrgTileSource::isCadrg() const
-{
-   return (theProductType==OSSIM_PRODUCT_TYPE_CADRG);
-}
-
-ossimString ossimCibCadrgTileSource::getProductScale() const
-{
-   ossimString result;
-   
-   const ossimRpfTocEntry* entry =
-      theTableOfContents->getTocEntry(theEntryNumberToRender);
-
-   if (entry)
-   {
-      result = entry->getBoundaryInformation().getScale();
-   }
-
-   return result;
-}
-
-ossimString ossimCibCadrgTileSource::getSecurityClassification()const
-{
-   ossimString result;
-   
-   const ossimRpfHeader* header =
-      theTableOfContents->getRpfHeader();
-
-   if (header)
-   {
-      result = header->getSecurityClassification();
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimProperty> ossimCibCadrgTileSource::getProperty(const ossimString& name)const
-{
-   if(name == "file_type")
-   {
-      if(theProductType == OSSIM_PRODUCT_TYPE_CIB)
-      {
-         return new ossimStringProperty("file_type", "CIB");
-      }
-      else if(theProductType == OSSIM_PRODUCT_TYPE_CADRG)
-      {
-         return new ossimStringProperty("file_type", "CADRG");
-      }
-      return 0;
-   }
-   return ossimImageHandler::getProperty(name);
-}
-
-void ossimCibCadrgTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageHandler::getPropertyNames(propertyNames);
-   propertyNames.push_back("file_type");
-
-   /**
-    * This code is crashing and not sure why in here. Looks like a bad GeoEye
-    * baseline merge.
-    */
-#if 0 
-   const ossimRpfHeader* header =
-      theTableOfContents->getRpfHeader();
-   if(header)
-   {
-      std::ifstream in(theImageFile.c_str(), std::ios::in|std::ios::binary);
-   }
-#endif
-}
-
-void ossimCibCadrgTileSource::populateLut()
-{
-   theLut = 0;
-   if(theEntryToRender)
-   {
-      ossim_uint32 w = theEntryToRender->getNumberOfFramesHorizontal();
-      ossim_uint32 h = theEntryToRender->getNumberOfFramesVertical();
-      ossim_uint32 wi, hi;
-      bool found = false;
-      ossimRpfFrameEntry tempEntry;
-      ossimRpfFrame aFrame;
-      for(wi = 0; ((wi < w)&&(!found)); ++wi)
-      {
-         for(hi = 0; ((hi < h)&&(!found)); ++hi)
-         {
-            theEntryToRender->getEntry(hi,
-                                       wi,
-                                       tempEntry);
-            if(tempEntry.getFullPath().exists())
-            {
-               found = true;
-            }
-         }
-      }
-      if(aFrame.parseFile(tempEntry.getFullPath())
-         == ossimErrorCodes::OSSIM_OK)
-      {
-         const vector<ossimRpfColorGrayscaleTable>& colorTable =
-            aFrame.getColorGrayscaleTable();
-
-         // ESH 03/2009 -- Partial fix for ticket #646.
-         // Crash fix on reading RPFs: Make sure the colorTable vector 
-         // has entries before trying to make use of them. 
-         int numTables = (int)colorTable.size();
-
-         ossim_uint32 numElements = (numTables > 0) ? colorTable[0].getNumberOfElements() : 0;
-         if(numElements > 0)
-         {
-            if((theProductType == OSSIM_PRODUCT_TYPE_CIB)||
-               (theProductType == OSSIM_PRODUCT_TYPE_CADRG))
-            {
-               theLut = new ossimNBandLutDataObject(numElements,
-                                                    3,
-                                                    OSSIM_UINT8);
-            }
-            else
-            {
-               theLut = 0;
-               return;
-            }
-            ossim_uint32 idx = 0;
-
-            for(idx = 0; idx < numElements;++idx)
-            {
-               const ossim_uint8* startOfData = colorTable[0].getStartOfData(idx);
-               switch(theProductType)
-               {
-                  case OSSIM_PRODUCT_TYPE_CIB:
-                  {
-                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     break;
-                  }
-                  case OSSIM_PRODUCT_TYPE_CADRG:
-                  {
-                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[1]);
-                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[2]);
-                     break;
-                  }
-                  default:
-                  {
-                     break;
-                  }
-               }
-            }
-         }
-      }
-   }
-}
-
-void ossimCibCadrgTileSource::updatePropertiesToFirstValidFrame()
-{
-   if(theEntryToRender)
-   {
-      ossim_uint32 w = theEntryToRender->getNumberOfFramesHorizontal();
-      ossim_uint32 h = theEntryToRender->getNumberOfFramesVertical();
-      ossim_uint32 wi, hi;
-      bool found = false;
-      ossimRpfFrameEntry tempEntry;
-      ossimRpfFrame aFrame;
-      for(wi = 0; ((wi < w)&&(!found)); ++wi)
-      {
-         for(hi = 0; ((hi < h)&&(!found)); ++hi)
-         {
-            theEntryToRender->getEntry(hi,
-                                       wi,
-                                       tempEntry);
-            if(tempEntry.getFullPath().exists())
-            {
-               found = true;
-            }
-         }
-      }
-      if(found)
-      {
-         if(aFrame.parseFile(tempEntry.getFullPath()) == ossimErrorCodes::OSSIM_OK)
-         {
-            
-         }
-      }	
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimClosestToCenterCombiner.cpp b/ossim/src/ossim/imaging/ossimClosestToCenterCombiner.cpp
deleted file mode 100644
index 90f889c..0000000
--- a/ossim/src/ossim/imaging/ossimClosestToCenterCombiner.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimClosestToCenterCombiner.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimClosestToCenterCombiner.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimClosestToCenterCombiner, "ossimClosestToCenterCombiner", ossimImageMosaic);
-
-ossimClosestToCenterCombiner::ossimClosestToCenterCombiner()
-   :ossimImageMosaic()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimClosestToCenterCombiner::getTile(const ossimIrect& rect,
-                                                                  ossim_uint32 resLevel)
-{
-   ossim_uint32 layerIdx = 0;
-   if(!isSourceEnabled())
-   {
-      return ossimImageMosaic::getTile(rect, resLevel);
-   }
-   if(!theTile.valid())
-   {
-      allocate();
-      if(!theTile.valid())
-      {
-         return 0;
-      }
-   }
-   theTile->setImageRectangle(rect);
-   theTile->makeBlank();
-   std::vector<ossimClosestToCenterCombinerInfo > normTileList;
-   ossimRefPtr<ossimImageData> currentTile = getNextNormTile(layerIdx, 0, rect);
-   while(currentTile.valid())
-   {
-      normTileList.push_back(ossimClosestToCenterCombinerInfo((ossimImageData*)currentTile->dup(),
-                                                              layerIdx));
-      currentTile = getNextNormTile(layerIdx, rect, resLevel);
-   }
-
-   
-   if(normTileList.size() == 1)
-   {
-      theTile->copyNormalizedBufferToTile((ossim_float32*)normTileList[0].theTile->getBuf());
-   }
-   else if(normTileList.size() > 1)
-   {
-      ossimRefPtr<ossimImageData> copyTile    = ossimImageDataFactory::instance()->create(0,
-                                                                                          OSSIM_NORMALIZED_FLOAT);
-      copyTile->setImageRectangleAndBands(rect,
-                                          getNumberOfOutputBands());
-      copyTile->initialize();
-                                                                                          
-      ossim_int32 idx   = 0;
-      ossim_uint32 w     = rect.width();
-      ossim_uint32 h     = rect.height();
-      ossim_uint32 idxW  = 0;
-      ossim_uint32 idxH  = 0;
-      ossimIpt origin    = rect.ul();
-      ossimIpt ulPt      = rect.ul();
-      ossim_uint32 band  = 0;
-      ossim_uint32 bands = copyTile->getNumberOfBands();
-      ossim_uint32 srcBandIdx = 0;
-      std::vector<ossim_float32*> bandList(bands);
-
-      for(band = 0; band < bands; ++band)
-      {
-         bandList[band] = (ossim_float32*)copyTile->getBuf(band);
-      }
-      ossim_uint32 offset   = 0;
-      origin.y = ulPt.y;
-      for(idxH = 0; idxH < h; ++idxH)
-      {
-         origin.x = ulPt.x;
-         for(idxW = 0; idxW < w;++idxW)
-         {
-            idx = findIdx(normTileList, origin, offset);
-
-            if(idx >=0)
-            {
-               for(band = 0; band < bands; ++band)
-               {
-                  srcBandIdx = ossim::min(normTileList[idx].theTile->getNumberOfBands(), band);
-                  
-                  bandList[band][offset] = *(((ossim_float32*)normTileList[idx].theTile->getBuf(srcBandIdx))+offset);
-               }
-            }
-            ++offset;
-            ++origin.x;
-         }
-         ++origin.y;
-      }
-      theTile->copyNormalizedBufferToTile((ossim_float32*)copyTile->getBuf());
-   }
-
-   theTile->validate();
-   
-   return theTile;
-
-}
-
-ossim_int32 ossimClosestToCenterCombiner::findIdx(const std::vector<ossimClosestToCenterCombinerInfo >& normTileList,
-                                                  const ossimIpt& pt, ossim_uint32 offset)const
-{
-   ossim_float32 distance = 1000000;
-   ossim_int32 returnIdx = -1;
-   ossim_float32 tempDistance;
-   ossim_int32 idx = 0;
-   ossim_int32 maxIdx = (ossim_int32)normTileList.size();
-   ossimIpt midPt;
-   ossimIrect rect;
-   for(idx = 0; idx < maxIdx; ++ idx)
-   {
-      rect = theFullResBounds[ normTileList[idx].theIndex ];
-      midPt = rect.midPoint();
-      
-      tempDistance = (pt-midPt).length();
-      if(tempDistance < distance)
-      {
-         if(normTileList[idx].theTile->getDataObjectStatus() == OSSIM_FULL)
-         {
-            distance = tempDistance;
-            returnIdx = idx;
-         }
-         else if(!normTileList[idx].theTile->isNull(offset))
-         {
-            distance = tempDistance;
-            returnIdx = idx;
-         }
-      }
-   }
-
-   return returnIdx;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimCodecFactory.cpp b/ossim/src/ossim/imaging/ossimCodecFactory.cpp
deleted file mode 100644
index ce626e9..0000000
--- a/ossim/src/ossim/imaging/ossimCodecFactory.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  Factory class definition for codec(encoder/decoder).
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/imaging/ossimCodecFactory.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-
-#include <ossim/imaging/ossimJpegCodec.h>
-
-#include <string>
-
-ossimCodecFactory* ossimCodecFactory::theInstance = 0;
-
-static const std::string TYPE_KW    = "type";
-
-ossimCodecFactory::~ossimCodecFactory()
-{}
-
-ossimCodecFactory* ossimCodecFactory::instance()
-{
-   if ( !theInstance )
-   {
-      theInstance = new ossimCodecFactory();
-   }
-   return theInstance;
-}
-ossimCodecBase* ossimCodecFactory::createCodec(const ossimString& type)const
-{
-   ossimRefPtr<ossimCodecBase> result;
-
-   if((type.downcase() == "jpeg") ||
-      (type == "ossimJpegCodec"))
-   {
-      result =  new ossimJpegCodec();
-   }
-
-   return result.release();
-}
-
-ossimCodecBase* ossimCodecFactory::createCodec(const ossimKeywordlist& kwl, const char* prefix)const
-{
-   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   ossimCodecBase* result = 0;
-   if(!type.empty())
-   {
-      result = this->createCodec(type);
-      if(result)
-      {
-         result->loadState(kwl, prefix);
-      }
-   }
-
-   return result;
-}
-
-void ossimCodecFactory::getTypeNameList(std::vector<ossimString>& typeNames)const
-{
-   typeNames.push_back("jpeg");
-}
-
-ossimCodecFactory::ossimCodecFactory()
-{}
-
-ossimCodecFactory::ossimCodecFactory(const ossimCodecFactory& /* obj */ )
-{}
-
-const ossimCodecFactory& ossimCodecFactory::operator=(
-   const ossimCodecFactory& /* rhs */)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimColorNormalizedFusion.cpp b/ossim/src/ossim/imaging/ossimColorNormalizedFusion.cpp
deleted file mode 100644
index 444663c..0000000
--- a/ossim/src/ossim/imaging/ossimColorNormalizedFusion.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Color normalized fusion
-//
-//*************************************************************************
-// $Id: ossimColorNormalizedFusion.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimColorNormalizedFusion.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/imaging/ossimImageData.h>
-
-RTTI_DEF1(ossimColorNormalizedFusion,
-          "ossimColorNormalizedFusion",
-          ossimFusionCombiner);
-
-ossimColorNormalizedFusion::ossimColorNormalizedFusion()
-   : ossimFusionCombiner()
-{
-}
-
-ossimColorNormalizedFusion::ossimColorNormalizedFusion(ossimObject* owner)
-   : ossimFusionCombiner(owner)
-{
-}
-
-ossimColorNormalizedFusion::~ossimColorNormalizedFusion()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimColorNormalizedFusion::getTile(
-   const ossimIrect& rect,
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> inputTile = getNormTile(rect, resLevel);
-
-   if(!inputTile.valid())
-   {
-      return NULL;
-   }
-   if(!theInputConnection||!theIntensityConnection)
-   {
-      return NULL;
-   }
-   
-   if((inputTile->getDataObjectStatus() == OSSIM_NULL)||
-      (inputTile->getDataObjectStatus() == OSSIM_EMPTY))
-   {
-      return NULL;
-   }
-
-   if(theTile.valid())
-   {
-      theTile->setImageRectangleAndBands(rect, inputTile->getNumberOfBands());
-   }
-
-   
-   ossim_float32* redBuff = (ossim_float32*)inputTile->getBuf(0);
-   ossim_float32* grnBuff = (ossim_float32*)inputTile->getBuf(1);
-   ossim_float32* bluBuff = (ossim_float32*)inputTile->getBuf(2);
-
-   if(!redBuff||!grnBuff||!bluBuff)
-   {
-      return 0;
-   }
-   ossimRefPtr<ossimImageData> inputIntensity = getNormIntensity(rect, resLevel);
-
-   if((!inputIntensity.valid()) ||
-      (!inputIntensity->getBuf()) ||
-      (inputIntensity->getDataObjectStatus() == OSSIM_EMPTY))
-   {
-      return 0;
-   }
-   
-   ossim_float32* mono_buff = (ossim_float32*)inputIntensity->getBuf(0);
-
-   // Since NULL_PIX_VALUE is only used for Pix8 comparisons cast it now.
-   const float NULL_PIX_VALUE = (ossim_float32)inputIntensity->getNullPix(0);
-   const float MIN_PIX_VALUE = (ossim_float32)inputIntensity->getMinPix(0);
-   const float MAX_PIX_VALUE = (ossim_float32)inputIntensity->getMaxPix(0);
-
-   float  rgb_sum;
-   float  r_wt; // Weight of red to rgb_sum.
-   float  g_wt; // Weight of green to rgb_sum.
-   float  b_wt; // Weight of blue to rgb_sum.
-   float  iVal;
-   float  redVal;
-   float  greenVal;
-   float  blueVal;
-
-   int size = theTile->getWidth()*theTile->getHeight();
-   
-   for (int i = 0; i < size;  i++)
-   {
-      //***
-      // If no intensity source, or, no rgb source make output pixels null.
-      //***
-      if ( (mono_buff[i] == NULL_PIX_VALUE) ||
-           (redBuff[i]   == NULL_PIX_VALUE &&
-            grnBuff[i]   == NULL_PIX_VALUE &&
-            bluBuff[i]   == NULL_PIX_VALUE) )
-           
-      {
-         redBuff[i] = NULL_PIX_VALUE;
-         grnBuff[i] = NULL_PIX_VALUE;
-         bluBuff[i] = NULL_PIX_VALUE;
-      }
-      else
-      {
-         redVal    = redBuff[i];
-         greenVal  = grnBuff[i];
-         blueVal   = bluBuff[i];
-         rgb_sum   = redVal + greenVal + blueVal + 3;
-	 r_wt      = 3 * (redVal + 1)   / rgb_sum;
-	 g_wt      = 3 * (greenVal + 1) / rgb_sum;
-	 b_wt      = 3 * (blueVal + 1)  / rgb_sum;
-         iVal      = mono_buff[i] + 1;
-	 
-	 redVal    = r_wt * iVal - 1;
-         greenVal  = g_wt * iVal - 1;
-	 blueVal   = b_wt * iVal - 1;
-
-         // Clip to max pixel value of radiometry.
-         if (redVal   > MAX_PIX_VALUE) redVal   = MAX_PIX_VALUE;
-         if (greenVal > MAX_PIX_VALUE) greenVal = MAX_PIX_VALUE;
-         if (blueVal  > MAX_PIX_VALUE) blueVal  = MAX_PIX_VALUE;
-
-         // Assign chip value, clamp to min pixel value of radiometry if zero.
-         redBuff[i] = (float)(redVal>0.0 ? redVal : MIN_PIX_VALUE);
-         grnBuff[i] = (float)(greenVal>0.0 ? greenVal : MIN_PIX_VALUE);
-         bluBuff[i] = (float)(blueVal>0.0 ? blueVal : MIN_PIX_VALUE);
-      }
-   } // End of loop through pixels in chip.
-   theTile->copyNormalizedBufferToTile((float*)inputTile->getBuf());
-   theTile->validate();
-
-   return theTile;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimConvolutionFilter1D.cpp b/ossim/src/ossim/imaging/ossimConvolutionFilter1D.cpp
deleted file mode 100644
index 56f82d8..0000000
--- a/ossim/src/ossim/imaging/ossimConvolutionFilter1D.cpp
+++ /dev/null
@@ -1,669 +0,0 @@
-//*******************************************************************
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//*************************************************************************
-// $Id: ossimConvolutionFilter1D.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <ossim/imaging/ossimConvolutionFilter1D.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimMatrixProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-
-RTTI_DEF1(ossimConvolutionFilter1D, "ossimConvolutionFilter1D", ossimImageSourceFilter);
-
-#define PROPNAME_KERNELSIZE "KernelSize"
-#define PROPNAME_KERNEL "Kernel"
-#define PROPNAME_ISHZ   "Horizontal"
-#define PROPNAME_CENTEROFFSET "CenterOffset"
-#define PROPNAME_STRICTNODATA "StrictNoData"
-
-ossimConvolutionFilter1D::ossimConvolutionFilter1D(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theCenterOffset(0),
-    theTile(NULL),
-    theIsHz(true),
-    theStrictNoData(true),
-    theNullPixValue(0),
-    theMinPixValue(0),
-    theMaxPixValue(0)
-{
-   //sets up an identity convolution
-   theKernel.push_back(1.0);
-}
-
-ossimConvolutionFilter1D::~ossimConvolutionFilter1D()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimConvolutionFilter1D::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return theTile;
-   }
-
-   if(!isSourceEnabled())
-   {
-      return theInputConnection->getTile(tileRect, resLevel);
-   }
-
-   //---
-   // We have a 1xn or nx1 matrix, + a center offset
-   // so stretch the input rect out to cover the required pixels
-   //---
-   ossimIrect  newRect;
-   ossim_uint32 kl = (ossim_uint32)theKernel.size(); //kernel length
-   if (theIsHz)
-   {
-      //horizontal kernel (row kernel)
-      newRect = ossimIrect(ossimIpt(tileRect.ul().x - theCenterOffset,
-                                    tileRect.ul().y),
-                           ossimIpt(tileRect.lr().x - theCenterOffset + kl -1,
-                                    tileRect.lr().y));
-   } else {
-      //vertical kernel
-      newRect = ossimIrect(ossimIpt(tileRect.ul().x,
-                                    tileRect.ul().y - theCenterOffset),
-                           ossimIpt(tileRect.lr().x,
-                                    tileRect.lr().y - theCenterOffset + kl -1));
-   }
-   ossimRefPtr<ossimImageData> data = theInputConnection->getTile(newRect,
-                                                                  resLevel);
-
-   if(!data.valid() || !data->getBuf())
-   {
-      return data;
-   }
-
-    // First time through or after an initialize()...
-   if (!theTile.valid())
-   {
-      allocate();
-      if (!theTile.valid()) // Should never happen!
-      {
-         return data;
-      }
-   }
-
-   // First time through, after an initialize() or a setKernel()...
-   if (!theNullPixValue.size())
-   {
-      computeNullMinMax();
-      if (!theNullPixValue.size()) // Should never happen!
-      {
-         return data;
-      }
-   }
-
-   theTile->setImageRectangle(tileRect);
-   theTile->makeBlank();
-   
-   switch(data->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<ossim_uint8>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<ossim_uint8>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_FLOAT: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<float>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<float>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<ossim_uint16>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<ossim_uint16>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<ossim_sint16>(0), data, theTile);
-         }
-         else
-         {
-            convolvePartial(static_cast<ossim_sint16>(0), data, theTile);
-         }
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         if(data->getDataObjectStatus() == OSSIM_FULL)
-         {
-            convolveFull(static_cast<double>(0), data, theTile);
-      }
-      else
-      {
-         convolvePartial(static_cast<double>(0), data, theTile);
-      }
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimConvolutionFilter1D::getTile WARNING:\n"
-            << "Scalar type = " << theTile->getScalarType()
-            << " Not supported by ossimConvolutionFilter1D" << endl;
-         break;
-      }
-   }
-   theTile->validate();
-   
-   return theTile;
-}
-
-
-template<class T> void ossimConvolutionFilter1D::convolvePartial(
-   T,
-   ossimRefPtr<ossimImageData> inputData,
-   ossimRefPtr<ossimImageData> outputData)
-{
-   // there may be NULL pixels in the input
-   ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
-   ossim_uint32 outputW       = outputData->getWidth();
-   ossim_uint32 outputH       = outputData->getHeight();
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-   
-   ossim_uint32 klength=(ossim_uint32)theKernel.size(),k;
-   ossim_int32 incrK = theIsHz ? 1 : inputW; //kernel increment in input : one col or one row
-   ossim_int32 iRow  = inputW - outputW; //jump to go to next row
-
-   double sum=0.0;
-   T* iKP; //kernel covered input pointer
-
-   ossim_int32 iCo = incrK*theCenterOffset; //center  pixel offset within the input buffer
-
-   for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(band));
-      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
-      T maxPix     = static_cast<T>(getMaxPixelValue(band));
-      T minPix     = static_cast<T>(getMinPixelValue(band));
-      T nullPix    = static_cast<T>(inputData->getNullPix(band));
-      T oNullPix   = static_cast<T>(getNullPixelValue(band));
-      
-      if(inputBuf&&outputBuf)
-      {
-         for(ossim_uint32 row = 0; row < outputH; ++row)
-         {
-            for(ossim_uint32 col = 0; col < outputW; ++col)
-            {
-               //center pixel may not be NULL
-               if (inputBuf[iCo] != nullPix)
-               {
-                  iKP = inputBuf; 
-                  sum = 0.0;
-                  for(k=0;k<klength;++k)
-                  {
-                     if (*iKP != nullPix) //just sum on non-NULL pixels (potential normailzation issue)
-                     {
-                        sum += theKernel[k] * (double)(*iKP);                   
-                     } else if (theStrictNoData)
-                     {
-                        break;
-                     }                     
-                     iKP += incrK;
-                  }
-                  if (k==klength)
-                  {
-                     if(sum > maxPix)
-                     {
-                        *outputBuf = maxPix;
-                     }
-                     else if(sum < minPix)
-                     {
-                        *outputBuf = minPix;
-                     }
-                     else
-                     {
-                        *outputBuf = static_cast<T>(sum);
-                     }
-                  } else {
-                     //theStrictNoData
-                     *outputBuf = oNullPix;
-                  }
-               } else {
-                  *outputBuf = oNullPix;
-               }
-               // move curent center position
-               inputBuf  += 1;
-               outputBuf += 1;
-            }
-            //move current center position
-            inputBuf  += iRow;
-            //outputBuf += 0;
-         }
-      }
-   }
-    
-   
-}
-
-template<class T> void ossimConvolutionFilter1D::convolveFull(
-   T,
-   ossimRefPtr<ossimImageData> inputData,
-   ossimRefPtr<ossimImageData> outputData)
-{
-   //inputData must be displaced according to the Kernel size and theCenterOffset +isHz
-   ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
-   ossim_uint32 outputW       = outputData->getWidth();
-   ossim_uint32 outputH       = outputData->getHeight();
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-   
-   ossim_uint32 klength=(ossim_uint32)theKernel.size(), k;
-   ossim_int32 incrK = theIsHz ? 1 : inputW; //kernel increment in input : one col or one row
-   ossim_int32 iRow  = inputW - outputW; //jump to go to next row
-
-   double sum=0.0;
-   T* iKP; //kernel covered input pointer
-
-   for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(band));
-      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
-      T maxPix     = static_cast<T>(getMaxPixelValue(band));
-      T minPix     = static_cast<T>(getMinPixelValue(band));
-      
-      if(inputBuf&&outputBuf)
-      {
-         for(ossim_uint32 row = 0; row < outputH; ++row)
-         {
-            for(ossim_uint32 col = 0; col < outputW; ++col)
-            {
-               sum = 0.0;
-               iKP = inputBuf;
-               for(k=0;k<klength;++k)
-               {
-                  sum += theKernel[k] * (double)(*iKP);
-                  iKP += incrK;
-               }
-               
-               if(sum > maxPix)
-               {
-                  *outputBuf = maxPix;
-               }
-               else if(sum < minPix)
-               {
-                  *outputBuf = minPix;
-               }
-               else
-               {
-                  *outputBuf = static_cast<T>(sum);
-               }
-               // move curent center position
-               inputBuf  += 1;
-               outputBuf += 1;
-            }
-            //move current center position
-            inputBuf  += iRow;
-            //outputBuf += 0;
-         }
-      }
-   }
-}
-
-void ossimConvolutionFilter1D::initialize()
-{
-   //---
-   // NOTE:
-   // Since initialize get called often sequentially we will wipe things slick
-   // but not reallocate to avoid multiple delete/allocates.
-   //
-   // On the first getTile call things will be reallocated/computed.
-   //---
-   theTile = NULL;
-   clearNullMinMax();
-}
-
-void ossimConvolutionFilter1D::allocate()
-{   
-   if(theInputConnection)
-   {
-      ossimImageDataFactory* idf = ossimImageDataFactory::instance();
-      
-      theTile = idf->create(this,
-                            this);
-      
-      theTile->initialize();
-   }
-}
-
-void ossimConvolutionFilter1D::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-
-   if(property->getName() == PROPNAME_KERNEL)
-   {
-      ossimMatrixProperty* matrixProperty = PTR_CAST(ossimMatrixProperty,
-                                                     property.get());
-      if(matrixProperty)
-      {
-         ossim_uint32 nc=matrixProperty->getNumberOfCols();
-         theKernel.resize(nc);
-         for(ossim_uint32 i=0;i<nc;++i)
-         {
-             theKernel[i] = (*matrixProperty)(0,i);
-         }
-         clearNullMinMax();
-      }
-      else
-      {
-         ossimImageSourceFilter::setProperty(property);
-      }
-   } else if (property->getName() == PROPNAME_ISHZ)  {
-      ossimBooleanProperty* booleanProperty = PTR_CAST(ossimBooleanProperty,
-                                                     property.get());
-      if(booleanProperty)
-      {
-         theIsHz = booleanProperty->getBoolean();
-      }
-   } else if (property->getName() == PROPNAME_STRICTNODATA)  {
-      ossimBooleanProperty* booleanProperty = PTR_CAST(ossimBooleanProperty,
-                                                     property.get());
-      if(booleanProperty)
-      {
-         theStrictNoData = booleanProperty->getBoolean();
-      }
-   } else if (property->getName() == PROPNAME_CENTEROFFSET)  {
-      ossimNumericProperty* numProperty = PTR_CAST(ossimNumericProperty,
-                                                     property.get());
-      if(numProperty)
-      {
-         theCenterOffset = numProperty->asInt32();
-      }
-   } else if (property->getName() == PROPNAME_KERNELSIZE)  {
-      ossimNumericProperty* numProperty = PTR_CAST(ossimNumericProperty,
-                                                     property.get());
-      if(numProperty)
-      {
-         theKernel.resize(numProperty->asUInt32());
-         clearNullMinMax();
-      }
-   } else {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimConvolutionFilter1D::getProperty(const ossimString& name)const
-{
-   if(name == PROPNAME_KERNEL)
-   {
-      ossimMatrixProperty* property = new ossimMatrixProperty(name);
-      property->resize(1,(int)theKernel.size());
-      for(ossim_uint32 i=0;i<theKernel.size();++i)
-      {
-        (*property)(0,i) = theKernel[i];
-      }
-      property->setCacheRefreshBit();
-      return property;
-   } else if (name==PROPNAME_ISHZ) {
-      ossimBooleanProperty* property = new ossimBooleanProperty(name,theIsHz);
-      property->setCacheRefreshBit();
-      return property;
-   } else if (name==PROPNAME_STRICTNODATA) {
-      ossimBooleanProperty* property = new ossimBooleanProperty(name,theStrictNoData);
-      property->setCacheRefreshBit();
-      return property;
-   } else if (name==PROPNAME_CENTEROFFSET) {
-      ossimNumericProperty* property = new ossimNumericProperty(name,ossimString::toString(theCenterOffset));
-      property->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT); //restrict to int type
-      property->setCacheRefreshBit();
-      return property;
-   } else if (name == PROPNAME_KERNELSIZE) {
-      ossimNumericProperty* property = new ossimNumericProperty(name,ossimString::toString((ossim_uint32)theKernel.size()),1.0,100.0);
-      property->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT); //restrict to int type
-      property->setCacheRefreshBit();
-      return property;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimConvolutionFilter1D::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back(PROPNAME_KERNELSIZE);
-   propertyNames.push_back(PROPNAME_KERNEL);
-   propertyNames.push_back(PROPNAME_CENTEROFFSET);
-   propertyNames.push_back(PROPNAME_ISHZ);
-   propertyNames.push_back(PROPNAME_STRICTNODATA);
-}
-
-bool ossimConvolutionFilter1D::saveState(ossimKeywordlist& kwl,
-                                         const char* prefix)const
-{   
-   kwl.add(prefix,
-           PROPNAME_KERNELSIZE,
-           static_cast<ossim_uint32>(theKernel.size()),
-           true);
-   kwl.add(prefix,
-          PROPNAME_CENTEROFFSET,
-           theCenterOffset,
-           true);
-   kwl.add(prefix,
-          PROPNAME_ISHZ,
-           theIsHz?"true":"false", //use string instead of boolean
-           true);
-   kwl.add(prefix,
-          PROPNAME_STRICTNODATA,
-           theStrictNoData?"true":"false", //use string instead of boolean
-           true);
-
-   for(ossim_uint32 row = 0; row < theKernel.size(); ++row)
-   {
-         ossimString newPrefix = "k" + ossimString::toString(row);
-         kwl.add(prefix,
-                 newPrefix,
-                 theKernel[row],
-                 true);          
-   }
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-
-bool ossimConvolutionFilter1D::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   //find kernel size
-   ossim_uint32 iks=0;
-   const char* ks = kwl.find(prefix, PROPNAME_KERNELSIZE);
-   if(ks)
-   {
-      iks = ossimString(ks).toUInt32();
-      if (iks<1)
-      {
-         cerr<<"ossimConvolutionFilter1D : warning bad "<< PROPNAME_KERNELSIZE <<" in state"<<endl;
-         iks=0;
-      }
-   } else {
-      iks=0;
-      cerr<<"ossimConvolutionFilter1D : warning no "<< PROPNAME_KERNELSIZE <<" in state"<<endl;
-   }
-
-   //load other props
-   const char* co = kwl.find(prefix, PROPNAME_CENTEROFFSET);
-   if(co)
-   {      
-      setCenterOffset(ossimString(co).toUInt32());
-   } else {
-      cerr<<"ossimConvolutionFilter1D : warning no "<< PROPNAME_CENTEROFFSET<<" in state"<<endl;
-   }
-   const char* ih = kwl.find(prefix, PROPNAME_ISHZ);
-   if(ih)
-   {      
-      setIsHorizontal(ossimString(ih).toBool());
-   } else {
-      cerr<<"ossimConvolutionFilter1D : warning no "<<PROPNAME_ISHZ<<" in state"<<endl;
-   }
-   const char* sn = kwl.find(prefix, PROPNAME_STRICTNODATA);
-   if(sn)
-   {      
-      setStrictNoData(ossimString(sn).toBool());
-   } else {
-      cerr<<"ossimConvolutionFilter1D : warning no "<<PROPNAME_STRICTNODATA<<" in state"<<endl;
-   }
-   //load kernel values
-   ossimString newPrefix = prefix;
-   newPrefix += ossimString("k");
-   theKernel.resize(iks);
-   for(ossim_uint32 r=0; r<iks; ++r)
-   {      
-      ossimString value = ossimString::toString(r);
-      
-      const char* v = kwl.find(newPrefix.c_str(),
-                               value.c_str());
-      if(v)
-      {
-         theKernel[r] = ossimString(v).toDouble();
-      } else {
-         cerr<<"ossimConvolutionFilter1D : warning no value for "<<newPrefix<<" in state"<<endl;
-         theKernel[r] = 0.0;
-      }
-   }
-   clearNullMinMax();
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-void ossimConvolutionFilter1D::setKernel(const std::vector<ossim_float64>& aKernel)
-{
-   theKernel = aKernel;
-   // Will be recomputed first getTile call.
-   clearNullMinMax();
-}
-
-double ossimConvolutionFilter1D::getNullPixelValue(ossim_uint32 band)const
-{
-   if( isSourceEnabled() && (band < theNullPixValue.size()) )
-   {
-      return theNullPixValue[band];
-   }
-
-   return ossim::defaultNull(getOutputScalarType());
-}
-
-double ossimConvolutionFilter1D::getMinPixelValue(ossim_uint32 band)const
-{
-   if( isSourceEnabled() && (band < theMinPixValue.size()) )
-   {
-      return theMinPixValue[band];
-   }
-   
-   return ossimImageSource::getMinPixelValue(band);
-}
-
-double ossimConvolutionFilter1D::getMaxPixelValue(ossim_uint32 band)const
-{
-   if( isSourceEnabled() && (band < theMaxPixValue.size()) )
-   {
-      return theMaxPixValue[band];
-   }
-
-   return ossimImageSource::getMaxPixelValue(band);
-}
-
-void ossimConvolutionFilter1D::clearNullMinMax()
-{
-   theNullPixValue.clear();
-   theMinPixValue.clear();
-   theMaxPixValue.clear();
-}
-
-void ossimConvolutionFilter1D::computeNullMinMax()
-{
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-
-   theNullPixValue.resize(BANDS);
-   theMinPixValue.resize(BANDS);
-   theMaxPixValue.resize(BANDS);
-
-   ossim_float64 defaultNull = ossim::defaultNull(getOutputScalarType());
-   ossim_float64 defaultMin = ossim::defaultMin(getOutputScalarType());
-   ossim_float64 defaultMax = ossim::defaultMax(getOutputScalarType());
-  
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      if(theInputConnection)
-      {
-         ossim_float64 inputNull = theInputConnection->getNullPixelValue(band);
-         ossim_float64 inputMin  = theInputConnection->getMinPixelValue(band);
-         ossim_float64 inputMax  = theInputConnection->getMaxPixelValue(band);
-         ossim_float64 tempMin   = 0.0;
-         ossim_float64 tempMax   = 0.0;
-         ossim_float64 k         = 0.0;
-         for(ossim_uint32 i=0;i<theKernel.size();++i)
-         {          
-               k=theKernel[i];
-               tempMin += (k<0.0) ? k*inputMax : k*inputMin;
-               tempMax += (k>0.0) ? k*inputMax : k*inputMin;          
-         }
-         
-         if((tempMin >= defaultMin) && (tempMin <= defaultMax))
-         {
-            theMinPixValue[band] = tempMin;
-         }
-         else
-         {
-            theMinPixValue[band] = defaultMin;
-         }
-
-         if((tempMax >= defaultMin) && (tempMax <= defaultMax))
-         {
-            theMaxPixValue[band] = tempMax;
-         }
-         else
-         {
-            theMaxPixValue[band] = defaultMax;
-         }
-         if((inputNull < theMinPixValue[band]) ||
-            (inputNull > theMaxPixValue[band]))
-         {
-            theNullPixValue[band] = inputNull;
-         }
-         else
-         {
-            theNullPixValue[band] = defaultNull;
-         }
-         
-      }
-      else // No input connection...
-      {
-         theNullPixValue[band] = defaultNull;
-         theMinPixValue[band]  = defaultMin;
-         theMaxPixValue[band]  = defaultMax;
-      }
-      
-   } // End of band loop.
-}
-
diff --git a/ossim/src/ossim/imaging/ossimConvolutionSource.cpp b/ossim/src/ossim/imaging/ossimConvolutionSource.cpp
deleted file mode 100644
index 3169678..0000000
--- a/ossim/src/ossim/imaging/ossimConvolutionSource.cpp
+++ /dev/null
@@ -1,527 +0,0 @@
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimConvolutionSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimConvolutionSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimDiscreteConvolutionKernel.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeyword.h>
-
-static const ossimKeyword NUMBER_OF_MATRICES = ossimKeyword("number_of_matrices", "");
-static const ossimKeyword NUMBER_OF_ROWS = ossimKeyword("rows", "");
-static const ossimKeyword NUMBER_OF_COLS = ossimKeyword("cols", "");
-
-RTTI_DEF1(ossimConvolutionSource, "ossimConvolutionSource", ossimImageSourceFilter);
-
-ossimConvolutionSource::ossimConvolutionSource()
-   : ossimImageSourceFilter(),
-     theTile(NULL)
-{
-}
-
-ossimConvolutionSource::ossimConvolutionSource(ossimImageSource* inputSource,
-                                               const NEWMAT::Matrix& convolutionMatrix)
-   : ossimImageSourceFilter(inputSource),
-     theTile(NULL)
-{
-   theConvolutionKernelList.push_back(new ossimDiscreteConvolutionKernel(convolutionMatrix));
-   setKernelInformation();
-   initialize();
-}
-
-ossimConvolutionSource::ossimConvolutionSource(ossimImageSource* inputSource,
-                                               const vector<NEWMAT::Matrix>& convolutionList)
-   : ossimImageSourceFilter(inputSource),
-     theTile(NULL)
-{
-   setConvolutionList(convolutionList);
-}
-
-ossimConvolutionSource::~ossimConvolutionSource()
-{
-   deleteConvolutionList();
-}
-
-void ossimConvolutionSource::setConvolution(const double* kernel,
-                                            int nrows,
-                                            int ncols,
-                                            bool doWeightedAverage)
-{
-   NEWMAT::Matrix m(nrows, ncols);
-   const double* tempPtr = kernel;
-   for(int row = 0; row < nrows; ++row)
-   {
-      for(int col = 0; col < ncols; ++col)
-      {
-         m[row][col] =*tempPtr;
-         ++tempPtr;
-      }
-   }
-   
-   setConvolution(m, doWeightedAverage);
-}
-
-void ossimConvolutionSource::setConvolutionList(const vector<NEWMAT::Matrix>& convolutionList,
-                                                bool doWeightedAverage)
-{
-   deleteConvolutionList();
-   ossim_uint32 idx;
-   for(idx = 0; idx < convolutionList.size(); ++idx)
-   {
-      theConvolutionKernelList.push_back(new ossimDiscreteConvolutionKernel(convolutionList[idx],
-                                                                            doWeightedAverage));
-   }
-
-   setKernelInformation();
-}
-
-ossimRefPtr<ossimImageData> ossimConvolutionSource::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection) return ossimRefPtr<ossimImageData>();
-
-   if((!isSourceEnabled())||
-      (theConvolutionKernelList.size() < 1))
-   {
-      return theInputConnection->getTile(tileRect, resLevel);
-   }
-   
-   if(!theTile.valid())
-   {
-      allocate();
-      if(!theTile.valid())  // Throw exception???
-      {
-         return theInputConnection->getTile(tileRect, resLevel);
-      }
-   }
-   
-   ossim_uint32 w  = tileRect.width();
-   ossim_uint32 h  = tileRect.height();
-   ossim_uint32 tw = theTile->getWidth();
-   ossim_uint32 th = theTile->getHeight();
-   theTile->setWidth(w);
-   theTile->setHeight(h);
-   if((w*h)!=(tw*th))
-   {
-      theTile->initialize();
-      theTile->makeBlank();
-   }
-   else
-   {
-      theTile->makeBlank();
-   }
-   theTile->setOrigin(tileRect.ul());
-   long offsetX = (theMaxKernelWidth)/2;
-   long offsetY = (theMaxKernelHeight)/2;
-   ossimIrect requestRect(tileRect.ul().x - offsetX,
-                          tileRect.ul().y - offsetY,
-                          tileRect.lr().x + offsetX,
-                          tileRect.lr().y + offsetY);
-   
-   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(requestRect,
-                                                                   resLevel);
-
-   if(!input.valid() ||
-      (input->getDataObjectStatus() == OSSIM_NULL)||
-      (input->getDataObjectStatus() == OSSIM_EMPTY))
-   {
-      return input;
-   }
-   switch(theTile->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      if(theConvolutionKernelList.size() == 1)
-      {
-         convolve(static_cast<ossim_uint8>(0),
-                  input,
-                  theConvolutionKernelList[0]);
-      }
-      else
-      {
-         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
-         ossim_uint32 idx;
-         for(idx = 0; idx < upperBound; ++idx)
-         {
-            convolve(static_cast<ossim_uint8>(0),
-                     input,
-                     theConvolutionKernelList[idx]);
-            input->loadTile(theTile.get());
-         }
-      }
-      break;
-   }
-   case OSSIM_USHORT16:
-   case OSSIM_USHORT11:
-   {
-      if(theConvolutionKernelList.size() == 1)
-      {
-         convolve(static_cast<ossim_uint16>(0),
-                  input,
-                  theConvolutionKernelList[0]);
-      }
-      else
-      {
-         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
-         ossim_uint32 idx;
-         for(idx = 0; idx < upperBound; ++idx)
-         {
-            convolve(static_cast<ossim_uint16>(0),
-                     input,
-                     theConvolutionKernelList[idx]);
-            input->loadTile(theTile.get());
-         }
-      }
-      break;
-   }
-   case OSSIM_SSHORT16:
-   {
-      if(theConvolutionKernelList.size() == 1)
-      {
-         convolve(static_cast<ossim_sint16>(0),
-                  input,
-                  theConvolutionKernelList[0]);
-      }
-      else
-      {
-         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
-         ossim_uint32 idx;
-         for(idx = 0; idx < upperBound; ++idx)
-         {
-            convolve(static_cast<ossim_sint16>(0),
-                     input,
-                     theConvolutionKernelList[idx]);
-            input->loadTile(theTile.get());
-         }
-      }
-      break;
-   }
-   case OSSIM_FLOAT:
-   case OSSIM_NORMALIZED_FLOAT:
-   {
-      if(theConvolutionKernelList.size() == 1)
-      {
-         convolve(static_cast<float>(0),
-                  input,
-                  theConvolutionKernelList[0]);
-      }
-      else
-      {
-         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
-         ossim_uint32 idx;
-         for(idx = 0; idx < upperBound; ++idx)
-         {
-            convolve(static_cast<float>(0),
-                     input,
-                     theConvolutionKernelList[idx]);
-            input->loadTile(theTile.get());
-         }
-      }
-      break;
-   }
-   case OSSIM_DOUBLE:
-   case OSSIM_NORMALIZED_DOUBLE:
-   {
-      if(theConvolutionKernelList.size() == 1)
-      {
-         convolve(static_cast<double>(0),
-                  input,
-                  theConvolutionKernelList[0]);
-      }
-      else
-      {
-         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
-         ossim_uint32 idx;
-         for(idx = 0; idx < upperBound; ++idx)
-         {
-            convolve(static_cast<double>(0),
-                     input,
-                     theConvolutionKernelList[idx]);
-            input->loadTile(theTile.get());
-         }
-      }
-      break;
-   }
-   default:
-   {
-      theTile->loadTile(input.get());
-   }
-   }
-   theTile->validate();
-   return theTile;
-}
-   
-template <class T>
-void ossimConvolutionSource::convolve(T /* dummyVariable */,
-                                      ossimRefPtr<ossimImageData> inputTile,
-                                      ossimDiscreteConvolutionKernel* kernel)
-{
-   ossimIpt startOrigin   = theTile->getOrigin();
-
-   // Make sure that the patch is not empty or NULL
-   //
-   ossimIpt startDelta(startOrigin.x - inputTile->getOrigin().x,
-                       startOrigin.y - inputTile->getOrigin().y);
-
-   ossimDataObjectStatus status = inputTile->getDataObjectStatus();
-   // let's setup some variables that we will need to do the
-   // convolution algorithm.
-   //
-   ossimIrect patchRect   = inputTile->getImageRectangle();
-   long tileHeight        = theTile->getHeight();
-   long tileWidth         = theTile->getWidth();
-   long outputBands       = theTile->getNumberOfBands();
-   long convolutionWidth  = kernel->getWidth();
-   long convolutionHeight = kernel->getHeight();
-   long convolutionOffsetX= convolutionWidth/2;
-   long convolutionOffsetY= convolutionHeight/2;
-   long patchWidth        = patchRect.width();
-   long convolutionTopLeftOffset = 0;
-   long convolutionCenterOffset  = 0;
-   
-   long outputOffset          = 0;
-   T np = 0;
-   
-   const double minPix  = ossim::defaultMin(getOutputScalarType());
-   const double maxPix  = ossim::defaultMax(getOutputScalarType());
-//   const double* maxPix  = inputTile->getMaxPix();
-   const double* nullPix = inputTile->getNullPix();
-   double convolveResult = 0;
-   
-   if(status == OSSIM_PARTIAL) // must check for NULLS
-   {
-      for(long y = 0; y <tileHeight; y++)
-      {
-         convolutionCenterOffset  = patchWidth*(startDelta.y + y) + startDelta.x;
-         convolutionTopLeftOffset = patchWidth*(startDelta.y + y - convolutionOffsetY) + startDelta.x-convolutionOffsetX;
-         
-         for(long x =0; x < tileWidth; x++)
-         {
-            if(!inputTile->isNull(convolutionCenterOffset))
-            {
-               for(long b = 0; b < outputBands; ++b)
-               {
-                  T* buf    = (T*)(inputTile->getBuf(b)) + convolutionTopLeftOffset;
-                  T* outBuf = (T*)(theTile->getBuf(b));
-                  kernel->convolveSubImage(buf,
-                                           patchWidth,
-                                           convolveResult,
-                                           (T)nullPix[b]);
-
-                  convolveResult = convolveResult < minPix? minPix:convolveResult;
-                  convolveResult = convolveResult > maxPix? maxPix:convolveResult;
-                  
-                  outBuf[outputOffset] = (T)convolveResult;
-               }
-            }
-            else
-            {
-               theTile->setNull(outputOffset);
-               
-            }
-            ++convolutionCenterOffset;
-            ++convolutionTopLeftOffset;
-            ++outputOffset;
-         }
-      }
-   }
-   else  // do not need to check for nulls here.
-   {
-      for(long b = 0; b < outputBands; ++b)
-      {                  
-         double convolveResult = 0;
-         const T* buf = (const T*)inputTile->getBuf(b);
-         T* outBuf    = (T*)(theTile->getBuf(b));
-         np =(T)nullPix[b];
-         outputOffset = 0;
-         
-         for(long y = 0; y <tileHeight; y++)
-         {
-            convolutionTopLeftOffset = patchWidth*(startDelta.y + y - convolutionOffsetY) + startDelta.x-convolutionOffsetX;
-            
-            for(long x =0; x < tileWidth; x++)
-            {
-               kernel->convolveSubImage(&buf[convolutionTopLeftOffset],
-                                        patchWidth,
-                                        convolveResult,
-                                        np);
-// NOT SURE IF I WANT TO CLAMP IN A CONVOLUTION SOURCE  
-// seems better to clamp to a scalar range instead of an input min max
-               convolveResult = convolveResult < minPix? (T)minPix:convolveResult;
-               convolveResult = convolveResult > maxPix?(T)maxPix:convolveResult;
-               outBuf[outputOffset] = (T)convolveResult;
-               ++outputOffset;
-               ++convolutionTopLeftOffset;
-            }
-         }
-      }
-   }
-}
-
-void ossimConvolutionSource::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   theTile = NULL;
-}
-
-void ossimConvolutionSource::allocate()
-{
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,
-                                                          theInputConnection);
-      theTile->initialize();
-   }
-}
-
-bool ossimConvolutionSource::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix)const
-{
-   ossim_uint32 numberOfMatrices = 0;
-   for(ossim_uint32 m = 0; m < theConvolutionKernelList.size();++m)
-   {
-      if(theConvolutionKernelList[m])
-      {
-         ++numberOfMatrices;
-         const NEWMAT::Matrix& kernel = theConvolutionKernelList[m]->getKernel();
-         ossimString mPrefix = "m" +
-                               ossimString::toString(numberOfMatrices) +
-                               ".";
-         kwl.add(prefix,
-                 (mPrefix + "rows").c_str(),
-                 kernel.Nrows(),
-                 true);
-         
-         kwl.add(prefix,
-                 (mPrefix + "cols").c_str(),
-                 kernel.Ncols(),
-                 true);
-         
-         for(ossim_int32 row = 0; row < kernel.Nrows(); ++row)
-         {
-            for(ossim_int32 col =0; col < kernel.Ncols(); ++col)
-            {
-               ossimString newPrefix = mPrefix +
-                                       ossimString::toString(row+1) + "_" +
-                                       ossimString::toString(col+1);
-               kwl.add(prefix,
-                       newPrefix,
-                       kernel[row][col],
-                       true);          
-            }
-         }
-      }
-   }
-
-   
-   kwl.add(prefix,
-           NUMBER_OF_MATRICES,
-           numberOfMatrices,
-           true);
-      
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-
-bool ossimConvolutionSource::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   deleteConvolutionList();
-
-   const char* numberOfMatrices = kwl.find(prefix, NUMBER_OF_MATRICES);
-
-   ossim_int32 matrixCount = ossimString(numberOfMatrices).toLong();
-   ossim_int32 numberOfMatches = 0;
-   ossim_int32 index = 0;
-   while(numberOfMatches < matrixCount)
-   {
-      ossimString newPrefix = prefix;
-      newPrefix += ossimString("m");
-      newPrefix += ossimString::toString(index);
-      newPrefix += ossimString(".");
-
-      const char* rows = kwl.find((newPrefix+NUMBER_OF_ROWS.key()).c_str());
-      const char* cols = kwl.find((newPrefix+NUMBER_OF_COLS.key()).c_str());
-
-      if(rows&&cols)
-      {
-         ++numberOfMatches;
-         ossim_int32 numberOfRows = ossimString(rows).toLong();
-         ossim_int32 numberOfCols = ossimString(cols).toLong();
-         NEWMAT::Matrix convolutionMatrix(numberOfRows, numberOfCols);
-         
-         
-         for(ossim_int32 r = 1; r <= numberOfRows; r++)
-         {
-            for(ossim_int32 c = 1; c <= numberOfCols; c++)
-            {
-               convolutionMatrix[r-1][c-1] = 0.0;
-               
-               ossimString value = ossimString::toString(r);
-               value += "_";
-               value += ossimString::toString(c);
-
-               const char* v = kwl.find(newPrefix.c_str(),
-                                        value.c_str());
-               if(v)
-               {
-                  convolutionMatrix[r-1][c-1] = ossimString(v).toDouble();
-               }
-            }
-         }
-         theConvolutionKernelList.push_back(new ossimDiscreteConvolutionKernel(convolutionMatrix));
-      }
-      ++index;
-   }
-   setKernelInformation();
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-void ossimConvolutionSource::setKernelInformation()
-{
-   ossim_uint32 index;
-   
-   if(theConvolutionKernelList.size() > 0)
-   {
-      theMaxKernelWidth  = theConvolutionKernelList[0]->getWidth();
-      theMaxKernelHeight = theConvolutionKernelList[0]->getHeight();
-      
-      for(index = 1; index < theConvolutionKernelList.size(); ++index)
-      {
-         ossim_int32 w = theConvolutionKernelList[index]->getWidth();
-         ossim_int32 h = theConvolutionKernelList[index]->getHeight();
-         theMaxKernelWidth  = theMaxKernelWidth < w?w:theMaxKernelWidth;
-         theMaxKernelHeight = theMaxKernelHeight < h?h:theMaxKernelHeight;
-      }
-   }
-}
-
-void ossimConvolutionSource::deleteConvolutionList()
-{
-   for(ossim_int32 index = 0; index < (ossim_int32)theConvolutionKernelList.size(); ++index)
-   {
-      delete theConvolutionKernelList[index];
-   }
-
-   theConvolutionKernelList.clear();
-}
-
-void ossimConvolutionSource::setConvolution(const NEWMAT::Matrix& convolutionMatrix, bool doWeightedAverage)
-{
-   std::vector<NEWMAT::Matrix> m;
-   
-   m.push_back(convolutionMatrix);
-   
-   setConvolutionList(m, doWeightedAverage);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimDespeckleFilter.cpp b/ossim/src/ossim/imaging/ossimDespeckleFilter.cpp
deleted file mode 100644
index 3131929..0000000
--- a/ossim/src/ossim/imaging/ossimDespeckleFilter.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-//*******************************************************************
-//  $Id: ossimDespeckleFilter.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#include <ossim/imaging/ossimDespeckleFilter.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeyword.h>
-#include <ossim/base/ossimNumericProperty.h>
-
-static const ossimKeyword FILTER_RADIUS_KW = ossimKeyword("filter_radius", "");
-
-RTTI_DEF1(ossimDespeckleFilter, "ossimDespeckleFilter", ossimImageSourceFilter);
-
-ossimDespeckleFilter::ossimDespeckleFilter()
-   : ossimImageSourceFilter(),
-     theTile(NULL),
-     theFilterRadius(1)
-{
-}
-
-ossimDespeckleFilter::ossimDespeckleFilter(ossimImageSource* inputSource, ossim_uint32 filter_radius)
-   : ossimImageSourceFilter(inputSource),
-     theTile(NULL),
-     theFilterRadius(filter_radius)
-{
-   initialize();
-}
-
-ossimDespeckleFilter::~ossimDespeckleFilter()
-{
-   theTile = 0;
-}
-
-ossimRefPtr<ossimImageData> 
-ossimDespeckleFilter::getTile(const ossimIrect& tileRect,ossim_uint32 resLevel)
-{
-   if (!theInputConnection) 
-      return NULL;
-
-   if (!isSourceEnabled())
-      return theInputConnection->getTile(tileRect, resLevel);
-   
-   if (!theTile.valid())
-   {
-      allocate();
-      if (!theTile.valid())  // Throw exception???
-         return theInputConnection->getTile(tileRect, resLevel);
-   }
-   
-   // Fetch input tile with kernel margins:
-   ossimIrect requestRect(tileRect.ul().x - theFilterRadius,
-                          tileRect.ul().y - theFilterRadius,
-                          tileRect.lr().x + theFilterRadius,
-                          tileRect.lr().y + theFilterRadius);
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(requestRect, resLevel);
-   if (!inputTile.valid())
-      return NULL;
-
-   ossim_uint32 w  = tileRect.width();
-   ossim_uint32 h  = tileRect.height();
-   ossim_uint32 tw = theTile->getWidth();
-   ossim_uint32 th = theTile->getHeight();
-   theTile->setWidth(w);
-   theTile->setHeight(h);
-   if((w*h)!=(tw*th))
-      theTile->initialize();
-      
-   theTile->makeBlank();
-   theTile->setOrigin(tileRect.ul());
-   
-   ossimDataObjectStatus status = inputTile->getDataObjectStatus();
-   if ((status == OSSIM_NULL) || (status == OSSIM_EMPTY))
-      return inputTile;
-
-   switch(inputTile->getScalarType())
-   {
-   case OSSIM_UCHAR:
-      despeckle(static_cast<ossim_uint8>(0), inputTile);
-      break;
-   
-   case OSSIM_USHORT16:
-   case OSSIM_USHORT11:
-      despeckle(static_cast<ossim_uint16>(0), inputTile);
-      break;
-
-   case OSSIM_SSHORT16:
-      despeckle(static_cast<ossim_sint16>(0), inputTile);
-      break;
-
-   case OSSIM_FLOAT:
-   case OSSIM_NORMALIZED_FLOAT:
-      despeckle(static_cast<float>(0), inputTile);
-      break;
-
-   case OSSIM_DOUBLE:
-   case OSSIM_NORMALIZED_DOUBLE:
-      despeckle(static_cast<double>(0), inputTile);
-      break;
-
-   default:
-      theTile->loadTile(inputTile.get());
-   }
-   
-   theTile->validate();
-   return theTile;
-}
-   
-template <class T>
-void ossimDespeckleFilter::despeckle(T /* dummyVariable */, ossimRefPtr<ossimImageData> inputTile)
-{
-   ossimIpt inUL  (inputTile->getImageRectangle().ul());
-   ossimIpt inLR  (inputTile->getImageRectangle().lr());
-   ossimIpt outUL (theTile->getImageRectangle().ul());
-   ossimIpt outLR (theTile->getImageRectangle().lr());
-   long inWidth   = inputTile->getWidth();
-   long outWidth  = theTile->getWidth();
-   long num_bands = theTile->getNumberOfBands();
-   
-      // Loop over all bands first:
-   for(long b = 0; b < num_bands; ++b)
-   {                  
-      const T* inbuf = (const T*) inputTile->getBuf(b);
-      T* outBuf = (T*) theTile->getBuf(b);
-      T null_pixel = (T) inputTile->getNullPix(b);
-
-      for (long y=outUL.y; y<=outLR.y; y++)
-      {
-         for (long x=outUL.x; x<=outLR.x; x++)
-         {
-            bool found_valid = false;
-            long idx = (y - inUL.y)*inWidth + x - inUL.x; // index to input buffer
-            long odx = (y-outUL.y)*outWidth + x - outUL.x;// index to output buffer
-          
-            T pixel = inbuf[idx];
-            if (pixel != null_pixel)
-            {
-               // Inside loop over input "kernel" pixels centered at x, y:
-               for (long iy=-theFilterRadius; (iy<=theFilterRadius) && !found_valid; iy++)
-               {
-                  // Compute row number in image space and skip this row if outside input tile:
-                  long row = y + iy;
-                  if ((row < inUL.y) || (row > inLR.y))
-                     continue;
-
-                  for (long ix=-theFilterRadius; (ix<=theFilterRadius) && !found_valid; ix++)
-                  {
-                     // Compute column number in image space and skip this col if outside input tile:
-                     long col = x + ix;
-                     if ((col < inUL.x) || (col > inLR.x))
-                        continue;
-
-                     // Compute offset into input buffer for the neighbor pixel. If we aren't at the 
-                     // kernel center, consider if valid neighbor was found:
-                     idx = (row - inUL.y)*inWidth + col - inUL.x;
-                     if ( ((iy != 0) || (ix != 0)) && (inbuf[idx] != null_pixel) )
-                        found_valid = true;
-                  }
-               }
-            }
-
-            // Finished scanning neighborhood. Save output to tile buffer:
-            if (found_valid)
-               outBuf[odx] = pixel;
-            else
-               outBuf[odx] = null_pixel;
-         }
-      }
-   }
-}
-
-void ossimDespeckleFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   theTile = NULL;
-}
-
-void ossimDespeckleFilter::allocate()
-{
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this, theInputConnection);
-      theTile->initialize();
-   }
-}
-
-bool ossimDespeckleFilter::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix, FILTER_RADIUS_KW, theFilterRadius, true);
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-
-bool ossimDespeckleFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   const char* lookup = kwl.find(prefix, FILTER_RADIUS_KW);
-   if (lookup)
-      theFilterRadius = ossimString(lookup).toInt32();
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-void ossimDespeckleFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimString name = property->getName();
-   if(name == "Filter Radius")
-      theFilterRadius = property->valueToString().toInt32();
-   else
-      ossimImageSourceFilter::setProperty(property);
-}
-
-ossimRefPtr<ossimProperty> ossimDespeckleFilter::getProperty(const ossimString& name)const
-{
-   if(name == "Filter Radius")
-   {
-      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(theFilterRadius), 1, 16.0);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimDespeckleFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("Filter Radius");
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimDilationFilter.cpp b/ossim/src/ossim/imaging/ossimDilationFilter.cpp
deleted file mode 100644
index dbfe1e2..0000000
--- a/ossim/src/ossim/imaging/ossimDilationFilter.cpp
+++ /dev/null
@@ -1,308 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimDilationFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
-
-#include <ossim/imaging/ossimDilationFilter.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <vector>
-#include <numeric>
-
-using namespace std;
-
-RTTI_DEF1(ossimDilationFilter, "ossimDilationFilter", ossimImageSourceFilter);
-
-// Keywords used throughout.
-static const ossimString WINDOW_SIZE_KW = "window_size";
-static const ossimString RECURSIVE_DILATION_KW = "recursive_dilation";
-
-ossimDilationFilter::ossimDilationFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theTile(0),
-    theTempTile(0),
-    theWindowSize(15),
-    theRecursiveFlag(false),
-    theNullFoundFlag(false)
-{
-   setDescription(ossimString("Dilation Filter"));
-}
-
-ossimDilationFilter::~ossimDilationFilter()
-{
-}
-
-void ossimDilationFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   theTile = NULL;
-}
-
-ossimRefPtr<ossimImageData> ossimDilationFilter::getTile(const ossimIrect& rect,
-                                                         ossim_uint32 resLevel)
-{
-   if(!isSourceEnabled())
-      return ossimImageSourceFilter::getTile(rect, resLevel);
-
-   ossimRefPtr<ossimImageData> inputData;
-   if (theRecursiveFlag)
-      inputData =  ossimImageSourceFilter::getTile(rect, resLevel);
-   else
-   {
-      ossim_uint32 halfSize = getWindowSize()>>1;
-      ossimIrect requestRect(rect.ul().x - halfSize,
-                             rect.ul().y - halfSize,
-                             rect.lr().x + halfSize,
-                             rect.lr().y + halfSize);
-
-      inputData =  ossimImageSourceFilter::getTile(requestRect, resLevel);
-   }
-
-   if(!inputData.valid() || !inputData->getBuf())
-      return inputData;
-
-   vector<ossimIpt> viv;
-   ossimImageSourceFilter::getValidImageVertices(viv, OSSIM_CLOCKWISE_ORDER, resLevel);
-   theValidImagePoly = ossimPolygon(viv);
-
-   if(!theTile.valid())
-   {
-      theTile = (ossimImageData*)inputData->dup();
-      theTile->setImageRectangle(rect);
-   }
-   else
-   {
-      theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
-   }
-
-   theNullFoundFlag = false;
-   switch(inputData->getScalarType())
-   {
-      case OSSIM_UINT8:
-         doDilation(ossim_uint8(0), inputData);
-         break;
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-         doDilation(ossim_uint16(0), inputData);
-         break;
-      case OSSIM_SINT16:
-         doDilation(ossim_sint16(0), inputData);
-         break;
-      case OSSIM_UINT32:
-         doDilation(ossim_uint32(0), inputData);
-         break;
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-         doDilation(ossim_float32(0), inputData);
-         break;
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-         doDilation(ossim_float64(0), inputData);
-         break;
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimDilationFilter::applyFilter WARNING:\n"
-            << "Unhandled scalar type!" << endl;
-      }
-   }
-   return theTile;
-}
-
-template <class T>
-void ossimDilationFilter::doDilation(T scalarType , ossimRefPtr<ossimImageData>& inputData)
-{
-   ossimDataObjectStatus status = inputData->getDataObjectStatus();
-
-   if ((status == OSSIM_FULL) || (status == OSSIM_EMPTY))
-   {
-      // Nothing to do just copy the tile.
-      theTile->loadTile(inputData.get());
-      return;
-   }
-
-   ossim_int32 halfWindow = (ossim_int32)(theWindowSize >> 1);
-   ossim_int32 x, y, kernelX, kernelY;   
-   ossim_int32 iw = (ossim_int32)inputData->getWidth();
-   ossim_int32 ih = (ossim_int32)inputData->getHeight();
-   ossim_int32 ow = (ossim_int32)theTile->getWidth();
-   ossim_int32 oh = (ossim_int32)theTile->getHeight();
-   ossim_uint32 numBands = ossim::min(theTile->getNumberOfBands(), inputData->getNumberOfBands());
-
-   // It may be that the input rect is the same size as the output (i.e., the tile bounds aren't
-   // expanded in the input's request to permit full kernels for output edge pixels:
-   ossim_uint32 i_offset = 0;
-   ossim_int32 delta = (ossim_int32)((iw - ow) >> 1);
-   ossim_int32 xi, yi;
-   if (delta > 0)
-      i_offset = (ossim_uint32) halfWindow*(iw + 1);
-
-   ossimIpt tile_ul (theTile->getImageRectangle().ul());
-   vector<double> values;
-   for(ossim_uint32 bandIdx = 0; bandIdx < numBands; ++bandIdx)
-   {
-      T* inputBuf     = (T*)inputData->getBuf(bandIdx);
-      T* outputBuf    = (T*)theTile->getBuf(bandIdx);
-      if (!inputBuf || !outputBuf)
-      {
-         return; // Shouldn't happen...
-      }
-
-      const T NP = (T)inputData->getNullPix(bandIdx);
-
-      for(y = 0; y < oh; ++y)
-      {
-         for(x = 0; x < ow; ++x)
-         {
-            // Get the center input pixel. Only process those points inside the valid image
-            // (to avoid dilation beyond valid image)
-            const T CP = *(inputBuf+i_offset);
-            ossimDpt ipt (tile_ul.x+x, tile_ul.y+y);
-            if ((CP == NP) && theValidImagePoly.isPointWithin(ipt))
-            {
-               theNullFoundFlag = true; // Needed for recursion
-               values.clear();
-               for(kernelY = -halfWindow; kernelY <= halfWindow; ++kernelY)
-               {
-                  yi = y + kernelY + delta;
-                  if ((yi < 0) || (y > ih))
-                     continue;
-
-                  for(kernelX = -halfWindow; kernelX <= halfWindow; ++kernelX)
-                  {
-                     xi = x + kernelX + delta;
-                     if ((xi < 0) || (x > iw))
-                        continue;
-
-                     T tempValue = *(inputBuf+kernelX+delta + (kernelY+delta)*iw);
-                     if(tempValue != NP)
-                        values.push_back((double)tempValue);
-                  }
-               }
-
-               if(values.size() > 0)
-               {
-                  double accum = accumulate(values.begin(), values.end(), 0.0);
-                  double average = accum/(double)values.size();
-                  (*outputBuf) = (T)average;
-               }
-               else
-               {
-                  (*outputBuf) = NP;
-               }
-
-            }
-            else // Center pixel (CP) not null.
-            {
-               (*outputBuf) = CP;
-            }
-
-            // Move over...
-            ++inputBuf;
-            ++outputBuf;
-
-         } // End of loop in x direction.
-
-         // Move down...
-         inputBuf += iw - ow;
-
-      }  // End of loop in y direction.
-
-   }  // End of band loop.
-
-   theTile->validate();
-
-   // Set up recursion for "dilation fill mode", we'll keep calling this getTile until all pixels
-   // are filled with non-null values:
-   if (theRecursiveFlag)
-   {
-      //cout << "Percent Full: "<<theTile->percentFull()<<endl; //###
-      //theTile->write("filtered.ras"); //###
-
-      status = theTile->getDataObjectStatus();
-      if (theNullFoundFlag)
-      {
-         theNullFoundFlag = false; // assume will fill, set true in next recursion if null found
-         theTempTile = new ossimImageData(*theTile.get());
-         doDilation(scalarType, theTempTile);
-      }
-   }
-}
-
-void ossimDilationFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if (!property.valid())
-      return;
-
-   ossimString name = property->getName();
-
-   if (name == WINDOW_SIZE_KW)
-   {
-      theWindowSize = property->valueToString().toUInt32();
-   }
-   else if (name == RECURSIVE_DILATION_KW)
-   {
-      ossimString value;
-      property->valueToString(value);
-      setRecursiveFlag(value.toBool());
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimDilationFilter::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> prop = 0;
-   if (name == WINDOW_SIZE_KW)
-   {
-      prop = new ossimNumericProperty(WINDOW_SIZE_KW, ossimString::toString(theWindowSize), 3, 25);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   else if (name == RECURSIVE_DILATION_KW)
-   {
-      prop = new ossimBooleanProperty(RECURSIVE_DILATION_KW, getRecursiveFlag());
-      prop->setFullRefreshBit();
-      return prop;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimDilationFilter::getPropertyNames(vector<ossimString>& propertyNames) const
-{
-   propertyNames.push_back(WINDOW_SIZE_KW);
-   propertyNames.push_back(RECURSIVE_DILATION_KW);
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-}
-
-bool ossimDilationFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   kwl.add(prefix, WINDOW_SIZE_KW.c_str(), theWindowSize, true);
-   kwl.add(prefix, RECURSIVE_DILATION_KW.c_str(), (theRecursiveFlag?"true":"false"), true);
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimDilationFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   const char* lookup = kwl.find(prefix, WINDOW_SIZE_KW.c_str());
-   if (lookup)
-      theWindowSize = ossimString(lookup).toUInt32();
-   
-   lookup = kwl.find(prefix, RECURSIVE_DILATION_KW.c_str());
-   if (lookup)
-      setRecursiveFlag(ossimString(lookup).toBool());
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimDoqqTileSource.cpp b/ossim/src/ossim/imaging/ossimDoqqTileSource.cpp
deleted file mode 100644
index 108302e..0000000
--- a/ossim/src/ossim/imaging/ossimDoqqTileSource.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimDoqqTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimDoqqTileSource.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/imaging/ossimGeneralRasterInfo.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/support_data/ossimDoqq.h>
-
-RTTI_DEF1(ossimDoqqTileSource,
-          "ossimDoqqTileSource",
-          ossimGeneralRasterTileSource);
-
-ossimDoqqTileSource::ossimDoqqTileSource()
-   :theHeaderInformation(0)
-{
-}
-
-ossimDoqqTileSource::~ossimDoqqTileSource()
-{
-   theHeaderInformation = 0;
-}
-
-bool ossimDoqqTileSource::open(const ossimFilename& filename)
-{
-   bool result = false;
-   
-   theHeaderInformation = new ossimDoqq(filename);
-   if(theHeaderInformation->errorStatus() == ossimDoqq::OSSIM_ERROR)
-   {
-      theHeaderInformation = 0;
-      
-      return result;
-   }
-   else
-   {
-     // Set the Acquisition Date
-     theAcqDate = theHeaderInformation->theAcqYear;
-     theAcqDate += "-";
-     theAcqDate += theHeaderInformation->theAcqMonth;
-     theAcqDate += "-";
-     theAcqDate += theHeaderInformation->theAcqDay;
-
-     vector<ossimFilename> f;
-     f.push_back(filename);
-     ossimGeneralRasterInfo genRasterInfo(f,
-					  OSSIM_UCHAR,
-					  OSSIM_BIP,
-					  theHeaderInformation->theRgb,
-					  theHeaderInformation->theLine,
-					  theHeaderInformation->theSample,
-					  theHeaderInformation->theHeaderSize,
-					  ossimGeneralRasterInfo::NONE,
-					  0);
-     
-     result = ossimGeneralRasterTileSource::open(genRasterInfo);
-   }
-
-   return result;
-} 
-
-//**************************************************************************************************
-//! Returns the image geometry object associated with this tile source or NULL if non defined.
-//! The geometry contains full-to-local image transform as well as projection (image-to-world)
-//**************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimDoqqTileSource::getImageGeometry()
-{
-   if (theGeometry.valid()) return theGeometry;
-   
-   if(theHeaderInformation.valid())
-   {
-      ossimKeywordlist kwl;
-      const char* prefix = 0; // legacy
-
-      ossimString proj  = theHeaderInformation->theProjection.trim().upcase();
-      ossimString datum = theHeaderInformation->theDatum.trim().upcase();
-
-      if(proj == ossimString("UTM") || proj == ossimString("1"))
-      {
-         kwl.add(prefix,
-                 ossimKeywordNames::TYPE_KW,
-                 "ossimUtmProjection",
-                 true);
-         kwl.add(prefix,
-                 ossimKeywordNames::ZONE_KW,
-                 theHeaderInformation->theUtmZone,
-                 true);
-      }
-      else
-      {
-         return ossimRefPtr<ossimImageGeometry>();
-      }
-
-      if(datum == ossimString("NAR") || datum == ossimString("4"))
-      {
-         kwl.add(prefix,
-                 ossimKeywordNames::DATUM_KW,
-                 "NAR-C", // North American Conus 1983
-                 true);
-      }
-      else if(datum == ossimString("NAS") || datum == ossimString("1"))
-      {
-         kwl.add(prefix,
-                 ossimKeywordNames::DATUM_KW,
-                 "NAS-C", // North American Conus 1927
-                 true);
-      }
-      else if(datum == ossimString("2"))
-      {
-         kwl.add(prefix,
-                 ossimKeywordNames::DATUM_KW,
-                 "WGD", // WGS 72
-                 true);
-      }
-      else if(datum == ossimString("3"))
-      {
-         kwl.add(prefix,
-                 ossimKeywordNames::DATUM_KW,
-                 "WGE", // WGS 84
-                 true);
-      }
-      else
-      {
-         return ossimRefPtr<ossimImageGeometry>();
-      }
-
-      kwl.add(prefix,
-              ossimKeywordNames::METERS_PER_PIXEL_X_KW,
-              theHeaderInformation->theGsd.x,
-              true);
-
-      kwl.add(prefix,
-              ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
-              theHeaderInformation->theGsd.y,
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_EASTING_KW,
-//            theHeaderInformation->theUE + (theHeaderInformation->theGsd/2.0),
-	      theHeaderInformation->theEasting,
-              true);
-
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_NORTHING_KW,
-//            theHeaderInformation->theUN - (theHeaderInformation->theGsd/2.0),
-	      theHeaderInformation->theNorthing,
-              true);
-
-      // Capture this for next time.
-      theGeometry = new ossimImageGeometry;
-      theGeometry->loadState(kwl, prefix);
-
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-      
-      return theGeometry;
-   }
-   return ossimRefPtr<ossimImageGeometry>();
-}
-
-ossimRefPtr<ossimProperty> ossimDoqqTileSource::getProperty(const ossimString& name)const
-{
-	if(name == "acquisition_date")
-	{
-		if(theHeaderInformation.valid())
-		{
-			std::stringstream out;
-			out << std::setw(4) << std::setfill(' ') << theHeaderInformation->theAcqYear.c_str()
-			<< std::setw(2) << setfill('0') << theHeaderInformation->theAcqMonth.c_str()
-			<< std::setw(2) << setfill('0') << theHeaderInformation->theAcqDay.c_str();
-			return new ossimStringProperty("acquisition_date", out.str());
-		}
-		return 0;
-	}
-	else if(name == "file_type")
-	{
-		return new ossimStringProperty("file_type", "DOQQ");
-	}
-	return ossimImageHandler::getProperty(name);
-}
-
-void ossimDoqqTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-	ossimImageHandler::getPropertyNames(propertyNames);
-	propertyNames.push_back("acquisition_date");
-	propertyNames.push_back("file_type");
-	
-}
-
-bool ossimDoqqTileSource::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   if(!ossimImageHandler::loadState(kwl, prefix))
-   {
-      return false;
-   }
-
-   if(lookup)
-   {
-      theHeaderInformation = new ossimDoqq(ossimFilename(lookup));
-      if(theHeaderInformation->errorStatus() != ossimDoqq::OSSIM_OK)
-      {
-         theHeaderInformation = 0;
-         return false;
-      }
-      else
-      {
-         ossimFilename filename(lookup);
-         vector<ossimFilename> f;
-         f.push_back(filename);
-         ossimGeneralRasterInfo genRasterInfo(f,
-                                              OSSIM_UCHAR,
-                                              OSSIM_BIP,
-                                              theHeaderInformation->theRgb,
-                                              theHeaderInformation->theLine,
-                                              theHeaderInformation->theSample,
-                                              theHeaderInformation->theHeaderSize,
-                                              ossimGeneralRasterInfo::NONE,
-                                              0);
-         return open(genRasterInfo);
-      }
-   }
-   else
-   {
-      return false;
-   }
-   
-   return true;
-}
-
-ossimString ossimDoqqTileSource::getShortName()const
-{
-   return ossimString("doqq");
-}
-
-ossimString ossimDoqqTileSource::getLongName()const
-{
-   return ossimString("doqq handler");
-}
-
-bool ossimDoqqTileSource::open(const ossimGeneralRasterInfo& info)
-{
-   return ossimGeneralRasterTileSource::open(info);
-}
-
-ossimString ossimDoqqTileSource::acqdate() const
-{
-   return theAcqDate;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimDtedTileSource.cpp b/ossim/src/ossim/imaging/ossimDtedTileSource.cpp
deleted file mode 100644
index d4671e9..0000000
--- a/ossim/src/ossim/imaging/ossimDtedTileSource.cpp
+++ /dev/null
@@ -1,683 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class declaration for ossimDtedTileSource.
-//
-//********************************************************************
-// $Id: ossimDtedTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimDtedTileSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/support_data/ossimDtedInfo.h>
-#include <cstdlib>
-#include <iostream>
-using namespace std;
-
-RTTI_DEF1(ossimDtedTileSource, "ossimDtedTileSource", ossimImageHandler)
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimDtedTileSource:debug");
-
-
-ossimDtedTileSource::ossimDtedTileSource()
-   :
-      ossimImageHandler(),
-      theTile(NULL),
-      theFileStr(),
-      theTileWidth(0),
-      theTileHeight(0),
-      theNumberOfLines(0),
-      theNumberOfSamps(0),
-      theOffsetToFirstDataRecord(0),
-      theDataRecordSize(0),
-      theMinHeight(0),
-      theMaxHeight(0),
-      thePostSpacing(0.0, 0.0),
-      theSwapBytesFlag(false)
-{
-   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
-   {
-      theSwapBytesFlag = true;
-   }
-
-   // Set the tile size to the default.
-   ossimIpt defaultTileSize;
-   ossim::defaultTileSize(defaultTileSize);
-   theTileWidth  = static_cast<ossim_uint32>(defaultTileSize.x);
-   theTileHeight = static_cast<ossim_uint32>(defaultTileSize.y);
-   
-   // Construction not complete.  Users should call "open" method.
-}
-
-ossimDtedTileSource::~ossimDtedTileSource()
-{
-   close();
-}
-
-ossimString ossimDtedTileSource::getShortName()const
-{
-   return ossimString("dted");
-}
-
-ossimString ossimDtedTileSource::getLongName()const
-{
-   return ossimString("dted reader");
-}
-
-ossimRefPtr<ossimImageData> ossimDtedTileSource::getTile(
-   const  ossimIrect& tile_rect, ossim_uint32 resLevel)
-{
-   if (!theTile.valid())
-   {
-      allocate(); // First getTile call or after changeTileSize.
-      if (!theTile.valid())
-      {
-         return ossimRefPtr<ossimImageData>(); // Throw exception???
-      }
-   }
-
-   // Image rectangle must be set prior to calling getTile.
-   theTile->setImageRectangle(tile_rect);
-   
-   if ( getTile( theTile.get(), resLevel ) == false )
-   {
-      if (theTile->getDataObjectStatus() != OSSIM_NULL)
-      {
-         theTile->makeBlank();
-      }
-   }
-
-   return theTile;
-}
-
-bool ossimDtedTileSource::getTile(ossimImageData* result,
-                                  ossim_uint32 resLevel)
-{
-   bool status = false;
-   
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
-   {
-      result->ref(); // Increment ref count.
-
-      //---
-      // Check for overview tile.  Some overviews can contain r0 so always
-      // call even if resLevel is 0.  Method returns true on success, false
-      // on error.
-      //---
-      status = getOverviewTile(resLevel, result);
-
-      if ( !status )  // Did not get an overview tile.
-      {  
-         ossimIrect image_rect = getImageRectangle(resLevel);
-
-         ossimIrect tile_rect = result->getImageRectangle();
-         
-         //---
-         // See if any point of the requested tile is in the image.
-         //---
-         if ( tile_rect.intersects(image_rect) )
-         {
-            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
-            
-            if ( !tile_rect.completely_within(clip_rect) )
-            {
-               // Start with a blank tile.
-               result->makeBlank();
-            }
-
-            // Load the tile buffer with data from the dted cell.
-            status = fillBuffer(tile_rect, clip_rect, result);
-            
-         } // End of if ( tile_rect.intersects(image_rect) )
-      }
-
-       result->unref(); // Decrement ref count.
-   }
-   
-   return status;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimDtedTileSource::fillBuffer(const ossimIrect& tile_rect,
-                                     const ossimIrect& clip_rect,
-                                     ossimImageData* tile)
-{
-   //***
-   // NOTE:
-   // Elevation posts are organized positive line up.
-   // The "tile_rect" and "clip_rect" is organized positive line down.
-   //***
-
-   const ossim_int32 TILE_WIDTH = tile->getWidth();
-   
-   //***
-   // Position the file pointer to the first record needed.
-   // Posts are organized positive line up so we're going to start at
-   // the lower left side of the cell so all reads are going forward in
-   // the file.
-   //***
-   ossim_int32 seek_position = theOffsetToFirstDataRecord +
-                         (clip_rect.ul().x * theDataRecordSize);
-   seek_position += DATA_RECORD_OFFSET_TO_POST +
-                    (theNumberOfLines - 1 - clip_rect.lr().y) * 2;
-   
-   //***
-   // Get a pointer positioned at the first valid pixel in
-   // the tile.  Tiles are organized positive line down.
-   //***
-   ossim_sint16* d = static_cast<ossim_sint16*>(tile->getBuf());
-   
-   // Loop in the longitude or sample direction.
-   for (ossim_int32 samp = clip_rect.ul().x; samp <= clip_rect.lr().x; samp++)
-   {
-      ossim_int32 d_offset = (clip_rect.lr().y - tile_rect.ul().y) *
-                       TILE_WIDTH +
-                       (samp - tile_rect.ul().x);
-
-      theFileStr.seekg(seek_position, ios::beg); // Seek to the first post.
-
-      for (ossim_int32 line = clip_rect.lr().y; line >= clip_rect.ul().y; line--)
-      {
-         // Grab all the post needed from the column.
-         ossim_uint16 temp;
-         ossim_sint16 s;
-         theFileStr.read((char*)&temp, POST_SIZE);
-         s = convertSignedMagnitude(temp);
-         d[d_offset] = s;
-         d_offset -= TILE_WIDTH;
-      }
-      seek_position += theDataRecordSize;
-   }
-
-   tile->validate();
-   
-   return true;
-}
-
-ossim_uint32 ossimDtedTileSource::getNumberOfOutputBands()const
-{
-   return getNumberOfInputBands();
-}
-
-ossimIrect
-ossimDtedTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   return ossimIrect(0,
-                     0,
-                     getNumberOfSamples(reduced_res_level) - 1,
-                     getNumberOfLines(reduced_res_level)   - 1);
-}
-
-bool ossimDtedTileSource::isOpen()const
-{
-   return theFileStr.is_open();
-}
-
-void ossimDtedTileSource::close()
-{
-   theFileStr.close();
-}
-
-bool ossimDtedTileSource::open()
-{
-   static const char MODULE[] = "ossimDtedTileSource::open";
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nAttempting to parse file:  " << theImageFile.c_str()
-           << endl;
-   }
-   
-   if (!theImageFile.exists()) // See if file exists.
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nFile " << theImageFile.c_str() << " does not exist!"
-              << endl;
-      }
-      return false;
-   }
-
-   // Open up the file for reading.
-   theFileStr.open(theImageFile.c_str(), ios::in | ios::binary);
-   if (!theFileStr)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      
-	  if(traceDebug())
-	  {
-		  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " ERROR!"
-											 << "\nCould not open file:  " << theImageFile.c_str()
-											 << "\nReturning..." << endl;
-		  CLOG << "returning with error..." << endl;
-	  }
-      return false;
-   }
-                                   
-   if(!theFileStr)
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nCannot open:  " << theImageFile.c_str()
-              << endl;
-      }
-      theFileStr.close();
-      return false;
-   }
-   m_vol.parse(theFileStr);
-   m_hdr.parse(theFileStr);
-   m_uhl.parse(theFileStr);
-   m_dsi.parse(theFileStr);
-   m_acc.parse(theFileStr);
-   
-   //***
-   // Check for errors.  Must have uhl, dsi and acc records.  vol and hdr
-   // are for magnetic tape only; hence, may or may not be there.
-   //***
-   if (m_uhl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
-       m_dsi.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
-       m_acc.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nError parsing file:  " << theImageFile.c_str()
-              << "\nPossibly not a dted file.\n";
-      }
-      
-      theFileStr.close();
-      return false;
-   }
-
-   // Get the cell specific info needed for later.
-   theNumberOfLines = m_uhl.numLatPoints();
-   theNumberOfSamps = m_uhl.numLonLines();
-   thePostSpacing.x = m_uhl.lonInterval();
-   thePostSpacing.y = m_uhl.latInterval();
-   theOffsetToFirstDataRecord = m_acc.stopOffset();
-   theDataRecordSize = DATA_RECORD_OFFSET_TO_POST +
-                       (theNumberOfLines * sizeof(ossim_sint16)) +
-                       DATA_RECORD_CHECKSUM_SIZE;
-
-   //---
-   // Note:
-   // Complete open calls loadMetaData which we have overriden to check for
-   // dot omd or dot statistics file.  If not there it will call
-   // gatherStatistics which will scan the file for min/max values.
-   //---
-   completeOpen();
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nNull pix:  " << getNullPixelValue(0)
-           << "\nMin  pix:  " << getMinPixelValue(0)
-           << "\nMax  pix:  " << getMaxPixelValue(0)
-           << "\ntheNumberOfLines:  " << theNumberOfLines
-           << "\ntheNumberOfSamps:  " << theNumberOfSamps
-           << "\ntheOffsetToFirstDataRecord:  " << theOffsetToFirstDataRecord
-           << "\ntheDataRecordSize:  " << theDataRecordSize << "\n";
-   }
-
-   return true;
-}
-
-void ossimDtedTileSource::allocate()
-{
-   //---
-   // Set up the tiles.  Note the blank tile will not get initialized to save
-   // memory.  This includes setting the min and max pixel value gathered
-   // from the statistics.
-   //---
-   theTile = ossimImageDataFactory::instance()->create(this, this);
-   if(theTile.valid())
-   {
-      theTile->initialize();
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG:"
-         << "\ntheTile:\n" << *theTile << "\n";
-   }
-}
-
-bool ossimDtedTileSource::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix) const
-{
-   // Currently nothing to do here.
-   return ossimImageHandler::saveState(kwl, prefix);
-}
-
-bool ossimDtedTileSource::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   if (ossimImageHandler::loadState(kwl, prefix))
-   {
-      if (ossimImageHandler::open(theImageFile))
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-//**************************************************************************************************
-// Returns the image geometry object associated with this tile source or NULL if not defined.
-// The geometry contains full-to-local image transform as well as projection (image-to-world)
-//**************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimDtedTileSource::getImageGeometry()
-{
-   if ( theGeometry.valid() )
-      return theGeometry;
-
-   // Compute the projection tie point (UL corner of dted cell). The UHL supplies the SW (LL) corner
-   // coordinates, so need to compute the UL lat from the cell spacing:
-   const ossimDatum* datum = ossimDatumFactory::instance()->wgs84();
-   ossim_float64 ul_lat = m_uhl.latOrigin() + (m_uhl.latInterval() * (m_uhl.numLatPoints()-1.0));
-   ossim_float64 ul_lon = m_uhl.lonOrigin();
-   ossimGpt tie(ul_lat, ul_lon, 0.0, datum);
-
-   //---
-   // This code is backed out as it affects the corner.
-   // E.g.: image0.ur_lon:  -88.999999999995
-   // Should be -89.0
-   // Used ossimImageGeometry::::getMetersPerPixel for a center of the image gsd. (drb)
-   // 
-   // We also need to define an origin for the projection as the center of the cell for proper GSD
-   // calculation (OLK 01/11: Used to set origin at 0,0 causing incorrect meters GSD to be
-   // computed)
-   // ossim_float64 mid_lat = m_uhl.latOrigin() + (m_uhl.latInterval()*m_uhl.numLatPoints()/2.0);
-   // ossim_float64 mid_lon = m_uhl.lonOrigin() + (m_uhl.lonInterval()*m_uhl.numLonLines()/2.0);
-   // ossimGpt origin (mid_lat, mid_lon, 0.0, datum);
-   //---
-   ossimGpt origin (0.0, 0.0, 0.0, datum);
-
-   // Make an Equidistant Cylindrical projection.
-   ossimRefPtr<ossimEquDistCylProjection> eq =
-      new ossimEquDistCylProjection(*(datum->ellipsoid()));
-      
-      // Set the scale:
-   eq->setOrigin(origin);
-   eq->setUlTiePoints(tie);
-   ossimDpt gsd(m_uhl.lonInterval(), m_uhl.latInterval());
-   eq->setDecimalDegreesPerPixel(gsd);
-
-   // Give it to the geometry object.
-   ossimRefPtr<ossimProjection> proj = eq.get();
-   
-   // Make the geometry:
-   theGeometry = new ossimImageGeometry;
-   
-   // Set the projection.
-   theGeometry->setProjection( proj.get() );
-
-   // Set image things the geometry object should know about.
-   initImageParameters( theGeometry.get() );
-   
-   return theGeometry;
-}
-
-ossimScalarType ossimDtedTileSource::getOutputScalarType() const
-{
-   return OSSIM_SSHORT16;  // Always signed 16 bit.
-}
-
-ossim_uint32 ossimDtedTileSource::getTileWidth() const
-{
-   return theTileWidth;
-}
-
-ossim_uint32 ossimDtedTileSource::getTileHeight() const
-{
-   return theTileHeight;
-}
-
-ossim_uint32 ossimDtedTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return theNumberOfLines;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfLines(reduced_res_level);
-   }
-
-   return 0;
-}
-
-ossim_uint32 ossimDtedTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return theNumberOfSamps;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfSamples(reduced_res_level);
-   }
-
-   return 0;
-}
-
-void ossimDtedTileSource::loadMetaData()
-{
-   ossimKeywordlist kwl;
-   const char* min_str = 0;
-   const char* max_str = 0;
-   
-   ossimFilename f = theImageFile.fileNoExtension();
-
-   // Check for omd file.
-   f.setExtension("omd");
-   if ( f.exists() )
-   {
-      kwl.addFile(f);
-      min_str = kwl.find("band1.min_value");
-      max_str = kwl.find("band1.max_value");
-   }
-
-   if ( !min_str || !max_str )
-   {
-      f.setExtension("statistics");
-      if ( f.exists() )
-      {
-         kwl.addFile(f);
-         min_str = kwl.find(ossimKeywordNames::MIN_VALUE_KW);
-         max_str = kwl.find(ossimKeywordNames::MAX_VALUE_KW);
-      }
-   }
-
-   if ( min_str || max_str )
-   {
-      theMinHeight = atoi(min_str);
-      theMaxHeight = atoi(max_str);
-   } 
-   else
-   {
-      gatherStatistics(false);
-   }
-}
-
-void ossimDtedTileSource::gatherStatistics(bool writeStatsFile)
-{
-   // Scan the cell and gather the statistics...
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedTileSource::gatherStatistics() scanning for min/max"
-         << "\nThis may take a while...\n";
-   }
-   
-   // Start off with the min and max pegged.
-   theMinHeight =  32767;
-   theMaxHeight = -32767;
-   
-   // Put the file pointer at the start of the first elevation post.
-   theFileStr.seekg(theOffsetToFirstDataRecord, ios::beg);
-   
-   //---
-   // Loop through all records and scan for lowest min and highest max.
-   // Each record contains a row of latitude points for a given longitude.
-   // There are eight bytes in front of the post and four checksum bytes at
-   // the end so ignore them.
-   //---
-   for (ossim_uint32 i=0; i<theNumberOfSamps; i++)  // longitude direction
-   {
-      theFileStr.seekg(DATA_RECORD_OFFSET_TO_POST, ios::cur);
-      
-      for (ossim_uint32 j=0; j<theNumberOfLines; j++) // latitude direction
-      {
-         ossim_uint16 temp;
-         ossim_sint16 s;
-         theFileStr.read((char*)&temp, POST_SIZE);
-         s = convertSignedMagnitude(temp);
-         if (s < theMinHeight && s != NULL_PIXEL) theMinHeight = s;
-         if (s > theMaxHeight) theMaxHeight = s;
-      }
-      
-      theFileStr.seekg(DATA_RECORD_CHECKSUM_SIZE, ios::cur);
-   }
-   
-   if ( writeStatsFile )
-   {
-      // Add the stats to the keyword list.
-      ossimKeywordlist kwl;
-      kwl.add(ossimKeywordNames::MIN_VALUE_KW, theMinHeight);
-      kwl.add(ossimKeywordNames::MAX_VALUE_KW, theMaxHeight);
-      
-      // Write out the statistics file.
-      ossimFilename f = theImageFile.fileNoExtension();
-      f.setExtension("statistics");
-      kwl.write( f.c_str() );
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDtedTileSource::gatherStatistics DEBUG:"
-         << "\ntheMinHeight:  " << theMinHeight
-         << "\ntheMaxHeight:  " << theMaxHeight
-         << "\n";
-   }
-}
-
-ossim_uint32 ossimDtedTileSource::getImageTileWidth() const
-{
-   return 0;
-}
-
-ossim_uint32 ossimDtedTileSource::getImageTileHeight() const
-{
-   return 0;
-}
-
-ossim_uint32 ossimDtedTileSource::getNumberOfInputBands() const
-{
-   return 1;
-}
-
-double ossimDtedTileSource::getNullPixelValue(ossim_uint32 /* band */)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getNullPix(0);
-   }
-   return -32767.0;
-}
-double ossimDtedTileSource::getMinPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getMinPix(band);
-   }
-   return theMinHeight;
-}
-
- double ossimDtedTileSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getMaxPix(band);
-   }
-   return theMaxHeight;
-}
-
-void ossimDtedTileSource::getPostSpacing(ossimDpt& postSpacing) const
-{
-   postSpacing.x = thePostSpacing.x;
-   postSpacing.y = thePostSpacing.y;
-}
-
-ossimRefPtr<ossimProperty> ossimDtedTileSource::getProperty(
-   const ossimString& name)const
-{
-   // look in base class.
-   ossimRefPtr<ossimProperty> result = ossimImageHandler::getProperty(name);
-
-   if (result.valid() == false)
-   {
-      ossimDtedInfo info;
-      if (info.open(theImageFile))
-      {
-         result = info.getProperty(name);
-      }
-   }
-
-   return result;
-}
-
-void ossimDtedTileSource::getPropertyNames(
-   std::vector<ossimString>& propertyNames) const
-{
-   ossimImageHandler::getPropertyNames(propertyNames);
-
-   ossimDtedInfo info;
-   if (info.open(theImageFile))
-   {
-      info.getPropertyNames(propertyNames);
-   }
-}
-
-const ossimDtedTileSource& ossimDtedTileSource::operator=(const  ossimDtedTileSource& rhs)
-{
-   return rhs;
-} 
-
-ossimDtedTileSource::ossimDtedTileSource(const ossimDtedTileSource&)
-{
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimERSTileSource.cpp b/ossim/src/ossim/imaging/ossimERSTileSource.cpp
deleted file mode 100644
index 334d823..0000000
--- a/ossim/src/ossim/imaging/ossimERSTileSource.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Chong-Ket Chuah
-//
-// Description:
-//
-// Implementation for the class "ossimERSTileSource".  ossimERSTileSource
-// is used for reading ER Mapper raster file format.  The format consists
-// of a raster file with no extension and a header file with the same name 
-// as the raster file but with an .ers extension.
-//
-//*******************************************************************
-//  $Id: ossimERSTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimERSTileSource.h>
-#include <ossim/support_data/ossimERS.h>
-
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/imaging/ossimImageGeometryRegistry.h>
-
-RTTI_DEF1(ossimERSTileSource, "ossimERSTileSource", ossimGeneralRasterTileSource);
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimERSTileSource::ossimERSTileSource()
-   :  ossimGeneralRasterTileSource(),
-      theHdr(NULL)
-{
-}
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimERSTileSource::ossimERSTileSource(const ossimKeywordlist& kwl,
-                                               const char* prefix)
-   :  ossimGeneralRasterTileSource(),
-      theHdr(NULL)
-{
-   if (loadState(kwl, prefix) == false)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-   }
-}
-
-//*******************************************************************
-// Destructor:
-//*******************************************************************
-ossimERSTileSource::~ossimERSTileSource()
-{
-   if (theHdr)
-   {
-      delete theHdr;
-      theHdr = NULL;
-   }
-}
-
-bool ossimERSTileSource::open(const ossimFilename& fileName)
-{
-   // Open and parse the header file
-   theHdr = new ossimERS(fileName);
-   
-//   theHdr->dump(cout);
-   
-   if(theHdr->errorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      delete theHdr;
-      theHdr = NULL;
-      return false;
-   }
-   else
-   {
-      vector<ossimFilename> f;
-	  ossimFilename fne;
-	  ossimFilename fpath = fileName.path();
-	  if (fpath.empty())
-		fne = fileName.fileNoExtension();
-	  else
-		fne = fpath+"/"+fileName.fileNoExtension();
-      f.push_back(fne);
-      ossimGeneralRasterInfo genRasterInfo(f,
-                                           theHdr->theCelltype,
-                                           OSSIM_BIL,
-                                           theHdr->theBands,
-                                           theHdr->theLine,
-                                           theHdr->theSample,
-                                           0,
-                                           ossimGeneralRasterInfo::NONE,
-                                           0);
-      if(theHdr->theHasNullCells)
-      {
-         ossim_uint32 i = 0;
-         ossim_uint32 bands = static_cast<ossim_uint32>(theHdr->theBands);
-         for(i = 0; i < bands; ++i)
-         {
-            genRasterInfo.getImageMetaData().setNullPix(i, theHdr->theNullCell);
-         }
-      }
-      ossimFilename metadataFile = fne;
-      metadataFile = metadataFile + ".omd";
-
-      if(metadataFile.exists())
-      {
-         ossimKeywordlist kwl;
-      
-         kwl.addFile(metadataFile.c_str());
-      
-         theMetaData.loadState(kwl);
-         ossim_uint32 i = 0;
-         ossim_uint32 bands = static_cast<ossim_uint32>(theHdr->theBands);
-         for(i = 0; i < bands; ++i)
-         {
-            if(theMetaData.getMinValuesValidFlag())
-            {
-               genRasterInfo.getImageMetaData().setMinPix(i, theMetaData.getMinPix(i));
-            }
-            if(theMetaData.getMaxValuesValidFlag())
-            {
-               genRasterInfo.getImageMetaData().setMaxPix(i, theMetaData.getMaxPix(i));
-            }
-            if(theMetaData.getNullValuesValidFlag())
-            {
-               genRasterInfo.getImageMetaData().setNullPix(i, theMetaData.getNullPix(i));
-            }
-         }
-      }
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "general raster info is\n";
-      genRasterInfo.print(ossimNotify(ossimNotifyLevel_INFO));
-      ossimGeneralRasterTileSource::open(genRasterInfo);
-   }
-	   
-   return true;
-}
-   
-
-ossimRefPtr<ossimImageGeometry> ossimERSTileSource::getImageGeometry()
-{
-   if ( !theGeometry )
-   {
-      // Check for external geom:
-      theGeometry = getExternalImageGeometry();
-      
-      if ( !theGeometry )
-      {
-         
-         theGeometry = new ossimImageGeometry;
-
-         if(theHdr)
-         {
-            ossimKeywordlist kwl;
-            if ( theHdr->toOssimProjectionGeom(kwl) )
-            {
-               theGeometry->loadState(kwl);  
-            }
-         }
-
-         // At this point it is assured theGeometry is set.
-         
-         //---
-         // WARNING:
-         // Must create/set the geometry at this point or the next call to
-         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
-         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
-         //---         
-         
-         // Check for set projection.
-         if ( !theGeometry->getProjection() )
-         {
-            // Try factories for projection.
-            ossimImageGeometryRegistry::instance()->extendGeometry(this);
-         }
-      }
-
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-   }
-   return theGeometry;
-}
-
-bool ossimERSTileSource::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-
-   if (lookup)
-   {
-      ossimFilename fileName = lookup;
-
-      bool result =  open(fileName);
-      ossimImageSource::loadState(kwl, prefix);
-      return result;
-   }
-      
-   return ossimGeneralRasterTileSource::loadState(kwl, prefix);
-}
-
-ossimString ossimERSTileSource::getShortName() const
-{
-   return ossimString("ERS");
-}
-
-ossimString ossimERSTileSource::getLongName() const
-{
-   return ossimString("ER Mapper Raster");
-}
-
-ossimString  ossimERSTileSource::className() const
-{
-   return ossimString("ossimERSTileSource");
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimEastingNorthingCutter.cpp b/ossim/src/ossim/imaging/ossimEastingNorthingCutter.cpp
deleted file mode 100644
index eff7d7f..0000000
--- a/ossim/src/ossim/imaging/ossimEastingNorthingCutter.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// $Id: ossimEastingNorthingCutter.cpp 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-
-#include <sstream>
-#include <ossim/imaging/ossimEastingNorthingCutter.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-
-RTTI_DEF2(ossimEastingNorthingCutter, "ossimEastingNorthingCutter", ossimRectangleCutFilter, ossimViewInterface);
-
-static ossimTrace traceDebug(ossimString("ossimEastingNorthingCutter:debug"));
-
-
-ossimEastingNorthingCutter::ossimEastingNorthingCutter(ossimObject* owner,
-                                                       ossimImageSource* inputSource)
-   :ossimRectangleCutFilter(owner,
-                            inputSource),
-    ossimViewInterface(0),
-    theViewProjection(0)
-{
-   theUlEastingNorthing.makeNan();
-   theLrEastingNorthing.makeNan();
-   theCutType = OSSIM_RECTANGLE_NULL_OUTSIDE;
-}
-
-ossimEastingNorthingCutter::ossimEastingNorthingCutter(ossimImageSource* inputSource)
-   :ossimRectangleCutFilter(inputSource),
-    ossimViewInterface(0),
-    theViewProjection(0)
-{
-   theUlEastingNorthing.makeNan();
-   theLrEastingNorthing.makeNan();
-   theCutType = OSSIM_RECTANGLE_NULL_OUTSIDE;
-}
-
-ossimEastingNorthingCutter::~ossimEastingNorthingCutter()
-{
-}
-
-void ossimEastingNorthingCutter::setEastingNorthingRectangle(const ossimDpt& ul,
-                                                             const ossimDpt& lr)
-{
-   theUlEastingNorthing = ul;
-   theLrEastingNorthing = lr;
-
-   transformVertices();
-}
-
-ossimDpt ossimEastingNorthingCutter::getUlEastingNorthing()const
-{
-   return theUlEastingNorthing;
-}
-
-ossimDpt ossimEastingNorthingCutter::getLrEastingNorthing()const
-{
-   return theLrEastingNorthing;
-}
-
-
-void ossimEastingNorthingCutter::initialize()
-{
-   ossimRectangleCutFilter::initialize();
-   transformVertices();
-}
-
-bool ossimEastingNorthingCutter::saveState(ossimKeywordlist& kwl,
-                                           const char* prefix)const
-{
-   kwl.add(prefix,
-           "ul_en",
-           ossimString::toString(theUlEastingNorthing.x) + " " +
-           ossimString::toString(theUlEastingNorthing.y),
-           true);
-   kwl.add(prefix,
-           "lr_en",
-           ossimString::toString(theLrEastingNorthing.x) + " " +
-           ossimString::toString(theLrEastingNorthing.y),
-           true);
-
-   return ossimRectangleCutFilter::saveState(kwl, prefix);
-}
-
-bool ossimEastingNorthingCutter::loadState(const ossimKeywordlist& kwl,
-                                           const char* prefix)
-{
-   const char *ul = kwl.find(prefix,
-                             "ul_en");
-   const char *lr = kwl.find(prefix,
-                             "lr_en");
-
-   theUlEastingNorthing.makeNan();
-   theLrEastingNorthing.makeNan();
-   
-   if(ul)
-   {
-      istringstream in(ul);
-      ossimString x;
-      ossimString y;
-      
-      in >> x >> y;
-      
-      theUlEastingNorthing.x = x.toDouble();
-      theUlEastingNorthing.y = y.toDouble();
-      
-   }
-   
-   if(lr)
-   {
-      istringstream in(lr);
-      ossimString x;
-      ossimString y;
-      
-      in >> x >> y;
-      
-      theLrEastingNorthing.x = x.toDouble();
-      theLrEastingNorthing.y = y.toDouble();
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimEastingNorthingCutter::loadState DEBUG:"
-         << "\ntheUlEastingNorthing:  " << theUlEastingNorthing
-         << "\ntheLrEastingNorthing:  " << theLrEastingNorthing
-         << endl;
-   }
-
-   return ossimRectangleCutFilter::loadState(kwl, prefix);
-}
-
-bool ossimEastingNorthingCutter::setView(ossimObject* baseObject)
-{
-   ossimProjection* tempProj = PTR_CAST(ossimProjection,
-                                        baseObject);
-   if(!tempProj)
-   {
-      return false;
-   }
-   
-
-   theViewProjection = tempProj;
-
-   transformVertices();
-
-   return true;
-}
-
-ossimObject* ossimEastingNorthingCutter::getView()
-{
-   return theViewProjection.get();
-}
-
-const ossimObject* ossimEastingNorthingCutter::getView()const
-{
-   return theViewProjection.get();
-}
-
-void ossimEastingNorthingCutter::transformVertices()
-{
-   theRectangle.makeNan();
-
-   if(theUlEastingNorthing.hasNans()||
-      theLrEastingNorthing.hasNans()||
-      (!theViewProjection))
-   {
-      return;
-   }
-
-   ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection,
-                                          theViewProjection.get());
-   ossimDpt ul;
-   ossimDpt lr;
-   ossimDpt easting;
-   ossimDpt northing;
-   if(mapProj)
-   {
-      mapProj->eastingNorthingToLineSample(theUlEastingNorthing, ul);
-      mapProj->eastingNorthingToLineSample(theLrEastingNorthing, lr);
-
-      ossimDrect drect(ul.x, ul.y, lr.x, lr.y);
-
-      theRectangle = drect;
-
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimEastingNorthingCutter::transformVertices DEBUG:"
-            << "original drect:  " << drect
-            << "\ntheRectangle:  " << theRectangle
-            << endl;
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimEdgeFilter.cpp b/ossim/src/ossim/imaging/ossimEdgeFilter.cpp
deleted file mode 100644
index 904858c..0000000
--- a/ossim/src/ossim/imaging/ossimEdgeFilter.cpp
+++ /dev/null
@@ -1,650 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimEdgeFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimEdgeFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimStringProperty.h>
-
-RTTI_DEF1(ossimEdgeFilter, "ossimEdgeFilter", ossimImageSourceFilter);
-
-#define PROP_EDGE_FILTER "Edge type"
-
-ossimEdgeFilter::ossimEdgeFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theTile(NULL),
-    theFilterType("Sobel")
-{
-}
-
-ossimEdgeFilter::ossimEdgeFilter(ossimImageSource* inputSource)
-   :ossimImageSourceFilter(inputSource),
-    theTile(NULL),
-    theFilterType("Sobel")
-{
-}
-
-ossimEdgeFilter::ossimEdgeFilter(ossimObject* owner,
-                                   ossimImageSource* inputSource)
-   :ossimImageSourceFilter(owner, inputSource),
-    theTile(NULL),
-    theFilterType("Sobel")
-{
-}
-
-ossimRefPtr<ossimImageData> ossimEdgeFilter::getTile(const ossimIrect& rect,
-                                                     ossim_uint32 resLevel)
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getTile(rect, resLevel);
-   }
-
-   // expand the rect out to cver the 3x3 horizontal and vertical
-   // kernel.
-   //
-   ossimIrect requestRect = rect;
-
-   adjustRequestRect(requestRect);
-   
-   ossimRefPtr<ossimImageData> inputData =
-      ossimImageSourceFilter::getTile(requestRect, resLevel);
-
-   if(!inputData.valid() || (!inputData->getBuf()))
-   {
-      return inputData;
-   }
-
-   if(!theTile.valid()) initialize();
-   if(!theTile.valid()) return theTile;
-      
-   theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
-   
-   switch(theTile->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      runFilter((ossim_uint8)0,
-                inputData);
-      break;
-   }
-   case OSSIM_FLOAT:
-   case OSSIM_NORMALIZED_FLOAT:
-   {
-      runFilter((ossim_float32)0,
-                inputData);
-      break;
-   }
-   case OSSIM_USHORT16:
-   case OSSIM_USHORT11:
-   {
-      runFilter((ossim_uint16)0,
-                inputData);
-      break;
-   }
-   case OSSIM_SSHORT16:
-   {
-      runFilter((ossim_sint16)0,
-                inputData);
-      break;
-   }
-   case OSSIM_DOUBLE:
-   case OSSIM_NORMALIZED_DOUBLE:
-   {
-      runFilter((ossim_float64)0,
-                inputData);
-      break;
-   }
-   default:
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimEdgeFilter::getTile WARN: Scalar type = " << theTile->getScalarType()
-                                         << " Not supported by ossimEdgeFilter" << std::endl;
-      break;
-   }
-   }
-
-   return theTile;
-}
-
-void ossimEdgeFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   theTile = NULL;
-
-   if(!isSourceEnabled())
-   {
-      return;
-   }
-   
-   theTile = ossimImageDataFactory::instance()->create(this, this);
-   if(theTile.valid())
-   {
-      theTile->initialize();
-   }
-
-}
-
-
-void ossimEdgeFilter::getFilterTypeNames(
-   std::vector<ossimString>& filterNames)const
-{
-   filterNames.push_back("Laplacian");
-   filterNames.push_back("Prewitt");
-   filterNames.push_back("Roberts");
-   filterNames.push_back("Sobel");
-   filterNames.push_back("LocalMax8");
-}
-
-ossimString ossimEdgeFilter::getFilterType()const
-{
-   return theFilterType;
-}
-
-void ossimEdgeFilter::setFilterType(const ossimString& filterType)
-{
-   ossimString tempFilterType = filterType;
-   tempFilterType = tempFilterType.downcase();
-   
-   if(tempFilterType.contains("sob"))
-   {
-      theFilterType = "Sobel";
-   }
-   else if(tempFilterType.contains("lap"))
-   {
-      theFilterType = "Laplacian";
-   }
-   else if(tempFilterType.contains("prew"))
-   {
-      theFilterType = "Prewitt";
-   }
-   else if(tempFilterType.contains("rob"))
-   {
-      theFilterType = "Roberts";
-   }
-   else if(tempFilterType.contains("localmax"))
-   {
-      theFilterType = "LocalMax8";
-   }
-   else
-   {
-      theFilterType = "Sobel";
-   }
-}
-
-void ossimEdgeFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-   
-   if(property->getName() == PROP_EDGE_FILTER)
-   {
-      theFilterType = property->valueToString();
-   }
-   else 
-   {
-      ossimImageSourceFilter::setProperty(property.get());
-   }
-
-}
-
-ossimRefPtr<ossimProperty> ossimEdgeFilter::getProperty(const ossimString& name)const
-{
-   if(name == PROP_EDGE_FILTER)
-   {
-      std::vector<ossimString> filterNames;
-      
-      getFilterTypeNames(filterNames);
-      ossimStringProperty* stringProp = new ossimStringProperty(PROP_EDGE_FILTER,
-								theFilterType,
-								false,
-								filterNames);
-      stringProp->clearChangeType();
-      stringProp->setReadOnlyFlag(false);
-      stringProp->setCacheRefreshBit();
-
-      return stringProp;
-   }
-
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimEdgeFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   
-   propertyNames.push_back(PROP_EDGE_FILTER);
-}
-
-
-void ossimEdgeFilter::adjustRequestRect(ossimIrect& requestRect)const
-{
-   ossimString filterType = theFilterType;
-   filterType = filterType.downcase();
-   ossimIrect rect = requestRect;
-   if(filterType.contains("sob")||
-      filterType.contains("lap")||
-      filterType.contains("pre")||
-      filterType.contains("localmax"))
-   {
-      requestRect = ossimIrect(rect.ul().x - 1,
-                               rect.ul().y - 1,
-                               rect.lr().x + 1,
-                               rect.lr().y + 1);
-   }
-   else if(filterType.contains("rob"))
-   {
-      requestRect = ossimIrect(rect.ul().x,
-                               rect.ul().y,
-                               rect.lr().x + 1,
-                               rect.lr().y + 1);
-   }
-   else
-   {
-      requestRect = ossimIrect(rect.ul().x - 1,
-                               rect.ul().y - 1,
-                               rect.lr().x + 1,
-                               rect.lr().y + 1);
-   }
-}
-
-template <class T>
-void ossimEdgeFilter::runFilter(T dummyVariable,
-                                ossimRefPtr<ossimImageData> inputData)
-{
-   ossimString filterType = theFilterType;
-   filterType = filterType.downcase();
-   
-   if(filterType.contains("sobel"))
-   {
-      runSobelFilter(dummyVariable, inputData);
-   }
-   else if(filterType.contains("lap"))
-   {
-      runLaplacianFilter(dummyVariable, inputData);
-   }
-   else if(filterType.contains("pre"))
-   {
-      runPrewittFilter(dummyVariable, inputData);
-   }
-   else if(filterType.contains("rob"))
-   {
-      runRobertsFilter(dummyVariable, inputData);
-   }
-   else if(filterType.contains("localmax"))
-   {
-      runLocalMax8Filter(dummyVariable, inputData);
-   }
-   else 
-   {
-      theTile->makeBlank();
-   }
-}
-
-template <class T>
-void ossimEdgeFilter::runSobelFilter(T /* dummyVariable */,
-                                     ossimRefPtr<ossimImageData> inputData)
-{
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-   double horizontalValue = 0.0;
-   double verticalValue = 0.0;
-   double value = 0.0;
-   // ossim_uint32 valueIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 width  = theTile->getWidth();
-   ossim_uint32 height = theTile->getHeight();
-   ossim_int32 rowIncrement  = inputData->getWidth();
-   ossim_int32 rowIncrement2 = 2*inputData->getWidth();
-   
-   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
-      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
-      T np         = static_cast<T>(theTile->getNullPix(bandIdx));
-      T minP       = static_cast<T>(theTile->getMinPix(bandIdx));
-      T maxP       = static_cast<T>(theTile->getMaxPix(bandIdx));
-
-      if(inputBuf&&outputBuf)
-      {
-         for(y = 0; y < height; ++y)
-         {
-            for(x = 0; x < width; ++x)
-            {
-               if( (*(inputBuf + rowIncrement + 1) != np))
-               {
-                  horizontalValue = ((double)inputBuf[0] - (double)inputBuf[rowIncrement2]) +
-                                    ((double)(inputBuf[1]*2.0) - (double)( inputBuf[rowIncrement2+1]*2.0)) +
-                                    ((double)(inputBuf[2]) - (double)(inputBuf[rowIncrement2+2]));
-
-                   verticalValue   = ((double)(inputBuf[2]) + (double)inputBuf[rowIncrement+2]*2.0 + (double)inputBuf[rowIncrement2+2]) -
-                                     (double)(inputBuf[0] + 2.0*(double)inputBuf[rowIncrement] + (double)inputBuf[rowIncrement2]);
-                  
-                  value = sqrt(horizontalValue*horizontalValue +  verticalValue*verticalValue);
-
-                  if((value == np) ||
-                     (value < minP))
-                  {
-                     *outputBuf = (static_cast<T>(minP));
-                  }
-                  else if(value > maxP)
-                  {
-                     *outputBuf = (static_cast<T>(maxP));
-                  }
-                  else
-                  {
-                     *outputBuf = (static_cast<T>(value));
-                  }
-                  
-               }
-               else
-               {
-                  *outputBuf = np;
-               }
-               ++outputBuf;
-               ++inputBuf;
-            }
-            inputBuf+=2;
-         }
-      }
-   }
-   theTile->validate();
-}
-
-template <class T>
-void ossimEdgeFilter::runPrewittFilter(T /* dummyVariable */,
-                                       ossimRefPtr<ossimImageData> inputData)
-{
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-   double horizontalValue = 0.0;
-   double verticalValue = 0.0;
-   double value = 0.0;
-   // ossim_uint32 valueIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 width  = theTile->getWidth();
-   ossim_uint32 height = theTile->getHeight();
-   ossim_int32 rowIncrement  = inputData->getWidth();
-   ossim_int32 rowIncrement2 = 2*inputData->getWidth();
-   
-   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
-      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
-      T np         = static_cast<T>(theTile->getNullPix(bandIdx));
-      T minP       = static_cast<T>(theTile->getMinPix(bandIdx));
-      T maxP       = static_cast<T>(theTile->getMaxPix(bandIdx));
-
-      if(inputBuf&&outputBuf)
-      {
-         for(y = 0; y < height; ++y)
-         {
-            for(x = 0; x < width; ++x)
-            {
-               if( (*(inputBuf + rowIncrement + 1) != np))
-               {
-                  horizontalValue = ((double)inputBuf[0] - (double)inputBuf[rowIncrement2]) +
-                                    ((double)(inputBuf[1]) - (double)( inputBuf[rowIncrement2+1])) +
-                                    ((double)(inputBuf[2]) - (double)(inputBuf[rowIncrement2+2]));
-
-                   verticalValue   = ((double)(inputBuf[2]) + (double)inputBuf[rowIncrement+2] + (double)inputBuf[rowIncrement2+2]) -
-                                     ((double)inputBuf[0] + (double)inputBuf[rowIncrement] + (double)inputBuf[rowIncrement2]);
-                  
-                  value = sqrt(horizontalValue*horizontalValue +  verticalValue*verticalValue);
-
-                  if((value == np) ||
-                     (value < minP))
-                  {
-                     *outputBuf = (static_cast<T>(minP));
-                  }
-                  else if(value > maxP)
-                  {
-                     *outputBuf = (static_cast<T>(maxP));
-                  }
-                  else
-                  {
-                     *outputBuf = (static_cast<T>(value));
-                  }
-                  
-               }
-               else
-               {
-                  *outputBuf = np;
-               }
-               ++outputBuf;
-               ++inputBuf;
-            }
-            inputBuf+=2;
-         }
-      }
-   }
-   theTile->validate();
-}
-
-template <class T>
-void ossimEdgeFilter::runRobertsFilter(T /* dummyVariable */,
-                                       ossimRefPtr<ossimImageData> inputData)
-{
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-   double v1 = 0.0;
-   double v2 = 0.0;
-   double value = 0.0;
-   // ossim_uint32 valueIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 width  = theTile->getWidth();
-   ossim_uint32 height = theTile->getHeight();
-   ossim_int32 rowIncrement  = inputData->getWidth();
-   
-   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
-      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
-      T np         = static_cast<T>(theTile->getNullPix(bandIdx));
-      T minP       = static_cast<T>(theTile->getMinPix(bandIdx));
-      T maxP       = static_cast<T>(theTile->getMaxPix(bandIdx));
-
-      if(inputBuf&&outputBuf)
-      {
-         for(y = 0; y < height; ++y)
-         {
-            for(x = 0; x < width; ++x)
-            {
-               if( (*inputBuf) != np)
-               {
-                  v1 = (double)inputBuf[0] - (double)(inputBuf[rowIncrement+1]);
-
-                  v2   = (double)inputBuf[1] - (double)inputBuf[rowIncrement];
-                  
-                  value = sqrt(v1*v1 +  v2*v2);
-
-                  if((value == np) ||
-                     (value < minP))
-                  {
-                     *outputBuf = (static_cast<T>(minP));
-                  }
-                  else if(value > maxP)
-                  {
-                     *outputBuf = (static_cast<T>(maxP));
-                  }
-                  else
-                  {
-                     *outputBuf = (static_cast<T>(value));
-                  }
-                  
-               }
-               else
-               {
-                  *outputBuf = np;
-               }
-               ++outputBuf;
-               ++inputBuf;
-            }
-            ++inputBuf;
-         }
-      }
-   }
-   theTile->validate();
-}
-
-template <class T>
-void ossimEdgeFilter::runLaplacianFilter(T /* dummyVariable */,
-                                         ossimRefPtr<ossimImageData> inputData)
-{
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-   // double horizontalValue = 0.0;
-   // double verticalValue = 0.0;
-   double value = 0.0;
-   // ossim_uint32 valueIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 width  = theTile->getWidth();
-   ossim_uint32 height = theTile->getHeight();
-   ossim_int32 rowIncrement  = inputData->getWidth();
-   ossim_int32 rowIncrement2 = 2*inputData->getWidth();
-   
-   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-   {
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
-      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
-      T np         = static_cast<T>(theTile->getNullPix(bandIdx));
-      T minP       = static_cast<T>(theTile->getMinPix(bandIdx));
-      T maxP       = static_cast<T>(theTile->getMaxPix(bandIdx));
-
-      if(inputBuf&&outputBuf)
-      {
-         for(y = 0; y < height; ++y)
-         {
-            for(x = 0; x < width; ++x)
-            {
-               if( (*(inputBuf + rowIncrement + 1) != np))
-               {
-                  
-                  value = fabs(((double)inputBuf[rowIncrement + 1]*4.0) -
-                               ((double)inputBuf[1] + (double)inputBuf[rowIncrement] + (double)inputBuf[rowIncrement + 2] + (double)inputBuf[rowIncrement2+1]));
-
-                  if((value == np) ||
-                     (value < minP))
-                  {
-                     *outputBuf = (static_cast<T>(minP));
-                  }
-                  else if(value > maxP)
-                  {
-                     *outputBuf = (static_cast<T>(maxP));
-                  }
-                  else
-                  {
-                     *outputBuf = (static_cast<T>(value));
-                  }
-                  
-               }
-               else
-               {
-                  *outputBuf = np;
-               }
-               ++outputBuf;
-               ++inputBuf;
-            }
-            inputBuf+=2;
-         }
-      }
-   }
-   theTile->validate();
-}
-
-template <class T>
-void ossimEdgeFilter::runLocalMax8Filter(T /* dummyVariable */,
-                                         ossimRefPtr<ossimImageData> inputData)
-{
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
-  
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 width  = theTile->getWidth();
-   ossim_uint32 height = theTile->getHeight();
-   ossim_int32 rowIncrement  = inputData->getWidth();
-   ossim_int32 rowIncrement2 = 2*inputData->getWidth(); 
-         
-   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-   {
-      //inputBuf has a 1 pixel edge compared to outputBuf
-      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
-      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
-      T np         = static_cast<T>(inputData->getNullPix(bandIdx)); //changed to input Null            
-
-      if(inputBuf&&outputBuf)
-      {
-         //one pass: maybe faster if changed to two passes
-         T* outB;
-         T* inB;
-         
-      	outB = outputBuf;         
-         inB  = inputBuf;         
-         for(y = 0; y < height; ++y)
-         {
-            for(x = 0; x < width; ++x)
-            {
-               if (inB[1+rowIncrement] != np)
-               {
-                  *outB = max<T>(
-                           max<T>(
-                            max<T>(inB[0],inB[1]),
-                            max<T>(inB[2],inB[rowIncrement])),
-                           max<T>(
-                            max<T>(inB[rowIncrement+2],inB[rowIncrement2]),
-                            max<T>(inB[rowIncrement2+1],inB[rowIncrement2+2])
-                            ));
-               }
-               else
-               {
-                  *outB = np;
-               }
-               ++outB;
-               ++inB;
-            }
-            inB+=2; //go to next line, jump due to edge
-         }       
-      }      
-   }
-   theTile->validate();
-}
-
-bool ossimEdgeFilter::saveState(ossimKeywordlist& kwl,
-                                          const char* prefix)const
-{   
-   kwl.add(prefix,
-           PROP_EDGE_FILTER,
-           getFilterType(),
-           true);
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-
-bool ossimEdgeFilter::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   const char* value = kwl.find(prefix,
-                                PROP_EDGE_FILTER );
-   if(value)
-   {
-      setFilterType(ossimString(value));
-   } else {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimEdgeFilter::loadState WARN: no filter type found" << std::endl;
-   }
-         
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimElevImageSource.cpp b/ossim/src/ossim/imaging/ossimElevImageSource.cpp
deleted file mode 100644
index 902db87..0000000
--- a/ossim/src/ossim/imaging/ossimElevImageSource.cpp
+++ /dev/null
@@ -1,822 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  Class provides an elevation image source from the elevation
-// manager.
-// 
-//*******************************************************************
-//  $Id: ossimElevImageSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimElevImageSource.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/projection/ossimLlxyProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ctime>
-
-RTTI_DEF1(ossimElevImageSource, "ossimElevImageSource", ossimImageSource)
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimElevImage:debug");
-   
-ossimElevImageSource::ossimElevImageSource()
-   :
-      ossimImageSource(NULL,
-                       0,
-                       0,
-                       true,
-                       false),// output list is not fixed
-      theElevManager(NULL),
-      theTile(NULL),
-      theTiePoint(),
-      theLatSpacing(0.0),
-      theLonSpacing(0.0),
-      theNumberOfLines(0),
-      theNumberOfSamps(0)
-{}
-
-ossimElevImageSource::ossimElevImageSource(ossimObject* owner)
-   :
-      ossimImageSource(owner,
-                       0,
-                       0,
-                       true,
-                       false),// output list is not fixed
-      theElevManager(NULL),
-      theTile(NULL),
-      theTiePoint(),
-      theLatSpacing(0.0),
-      theLonSpacing(0.0),
-      theNumberOfLines(0),
-      theNumberOfSamps(0)
-{}
-
-ossimElevImageSource::ossimElevImageSource(ossimObject* owner,
-                                           const ossimGpt& tie,
-                                           double latSpacing,
-                                           double lonSpacing,
-                                           ossim_uint32 numberLines,
-                                           ossim_uint32 numberSamples)
-   :
-      ossimImageSource(owner,
-                       0,
-                       0,
-                       true,
-                       false),// output list is not fixed
-      theElevManager(NULL),
-      theTile(NULL),
-      theTiePoint(tie),
-      theLatSpacing(latSpacing),
-      theLonSpacing(lonSpacing),
-      theNumberOfLines(numberLines),
-      theNumberOfSamps(numberSamples)
-{
-   initialize();
-}
-
-ossimElevImageSource::ossimElevImageSource(ossimObject* owner,
-                                           const ossimKeywordlist& kwl,
-                                           const char* prefix)
-   :
-      ossimImageSource(owner,
-                       0,
-                       0,
-                       true,
-                       false),
-      theElevManager(NULL),
-      theTile(NULL),
-      theTiePoint(),
-      theLatSpacing(0),
-      theLonSpacing(0),
-      theNumberOfLines(0),
-      theNumberOfSamps(0)
-{
-   if (loadState(kwl, prefix) == false)
-   {
-      setErrorStatus();
-   }
-}
-
-ossimElevImageSource::~ossimElevImageSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimElevImageSource::getTile(
-   const  ossimIrect& tile_rect,
-   ossim_uint32 resLevel)
-{
-   if (!theTile.get())
-   {
-      return theTile;
-   }
-   
-   // First make sure our tile is the right size.
-   ossim_int32 w = tile_rect.width();
-   ossim_int32 h = tile_rect.height();
-   ossim_int32 tileW = theTile->getWidth();
-   ossim_int32 tileH = theTile->getHeight();
-   if( (w != tileW) || (h != tileH) )
-   {
-      theTile->setWidth(w);
-      theTile->setHeight(h);
-      if((w*h)!=(tileW*tileH))
-      {
-         theTile->initialize();
-
-         //***
-         // Initialize can reset the min max to defaults if the min happens
-         // to be "0" so reset it just in case.
-         // NOTE:  We need to fix initialize!
-         //***
-         theTile->setMinPix(theElevManager->getMinHeightAboveMSL(), 0);
-         theTile->setMaxPix(theElevManager->getMaxHeightAboveMSL(), 0);
-      }
-   }
-
-   // Set the origin.
-   theTile->setOrigin(tile_rect.ul());
-      
-   
-   if(!isSourceEnabled())
-   {
-      // This tile source bypassed.
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   //***
-   // No overview support yet...
-   //***
-   if (resLevel)
-   {
-      // NOTE:  Need to add overview support.
-      cerr << "ossimElevImageSource::getTile ERROR:\nOverviews not supported!"
-           << endl;
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   ossimIrect image_rect = getImageRectangle(0);
-
-   if ( !tile_rect.intersects(image_rect) )
-   {
-      // No point in the tile falls within the set boundaries of this source.
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   // Ok fill the tile with the data from the post...
-   ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
-
-   if ( !tile_rect.completely_within(clip_rect) )
-   {
-      // Start with a blank tile since it won't be filled all the way.
-      theTile->makeBlank();
-   }
-
-
-   // Move the buffer pointer to the first valid pixel.
-   ossim_uint32 tile_width = theTile->getWidth();
-   
-   ossim_int32 start_offset = (clip_rect.lr().y - tile_rect.ul().y) * tile_width +
-      clip_rect.ul().x - tile_rect.ul().x;
-
-   //***
-   // Since most elevation formats have posts organized positive line up,
-   // start at the lower left side of the cell so all reads are going
-   // forward in the file.
-   //***
-   double start_lat = theTiePoint.latd() - theLatSpacing *
-      (clip_rect.lr().y - image_rect.ul().y);
-   if (start_lat < -90.0)
-   {
-      start_lat = -(start_lat + 180.0);  // Wrapped around the south poll.
-   }
-
-   double lon = theTiePoint.lond() + theLonSpacing *
-      (clip_rect.ul().x  - image_rect.ul().x);
-   if (lon > 180.0)
-   {
-      lon -= 360.0; // Went across the central meridian.
-   }
-
-   // Copy the data.
-   ossim_uint32 clipHeight = clip_rect.height();
-   ossim_uint32 clipWidth  = clip_rect.width();
-
-   // Get a pointer to the tile buffer.
-   ossim_float32* buf = static_cast<ossim_float32*>(theTile->getBuf());
-
-   for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-   {
-      double lat = start_lat;
-      ossim_int32 offset = start_offset;
-      for (ossim_uint32 line = 0; line < clipHeight; ++line)
-      {
-         ossimGpt gpt(lat, lon);
-         buf[offset+sample] = theElevManager->getHeightAboveMSL(gpt);
-         
-         lat += theLatSpacing;
-         if (lat > 90) lat = 180.0 - lat;
-
-         offset -= tile_width;
-      }
-      
-      lon += theLonSpacing;
-      if (lon > 180.0) lon = lon - 360.0; // Went across the central meridian.
-   }
-   
-#if 0   
-   for (ossim_uint32 line = 0; line < clipHeight; ++line)
-   {
-      double lon = start_lon;
-      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-      {
-         ossimGpt gpt(lat, lon);
-         buf[sample] = theElevManager->getHeightAboveMSL(gpt);
-         lon += theLonSpacing;
-         if (start_lon > 180.0)
-         {
-            start_lon -= 360.0; // Went across the central meridian.
-         }
-      }
-
-      buf += tile_width;
-      lat -= theLatSpacing;
-      if (lat < -90.0) lat = -(lat + 180.0);// Wrapped around the south poll.
-   }
-#endif
-   
-   theTile->validate();
-   return theTile;
-}
-
-bool ossimElevImageSource::saveState(ossimKeywordlist& kwl,
-                                  const char* prefix) const
-{
-   static const char MODULE[] = "ossimElevImageSource::saveState";
-
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      cerr << MODULE
-           << " ERROR detected in keyword list!  State not saved."
-           << endl;
-      return false;
-   }
-
-   // Save the state of the base class.
-   ossimImageSource::saveState(kwl, prefix);
-
-   // Save the tie point.
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LAT_KW,
-           theTiePoint.latd(),
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LON_KW,
-           theTiePoint.lond(),
-           true);
-
-   // Save the post spacing.
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-           theLatSpacing,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-           theLonSpacing,
-           true);
-
-   // Save the image size
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_LINES_KW,
-           theNumberOfLines,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_SAMPLES_KW,
-           theNumberOfSamps,
-           true);
-
-   // Save the min / max pixel values.
-   kwl.add(prefix,
-           ossimKeywordNames::MIN_VALUE_KW,
-           getMinPixelValue(0),
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::MAX_VALUE_KW,
-           getMaxPixelValue(0),
-           true);
-
-   return true;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimElevImageSource::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   static const char MODULE[] = "ossimElevImageSource::loadState";
-
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      cerr << MODULE
-           << " ERROR detected in keyword list!  State not load."
-           << endl;
-      return false;
-   }
-
-   // Base class...
-   ossimImageSource::loadState(kwl, prefix);
-   
-   const char* lookup;
-
-   // Get the tie point.
-   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LAT_KW);
-   if (lookup)
-   {
-      theTiePoint.latd(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nRequired keyword not found:  "
-              << ossimKeywordNames::TIE_POINT_LAT_KW
-              << "\nReturning false"
-              << endl;
-      }
-
-      return false;
-   }
-   
-   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LON_KW);
-   if (lookup)
-   {
-      theTiePoint.lond(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nRequired keyword not found:  "
-              << ossimKeywordNames::TIE_POINT_LON_KW
-              << "\nReturning false"
-              << endl;
-      }
-
-      return false;
-   }
-
-   // Get the post spacing.
-   lookup = kwl.find(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT);
-   if (lookup)
-   {
-      theLatSpacing = ossimString(lookup).toDouble();
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nRequired keyword not found:  "
-              << ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT
-              << "\nReturning false"
-              << endl;
-      }
-
-      return false;
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON);
-   if (lookup)
-   {
-      theLonSpacing = ossimString(lookup).toDouble();
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nRequired keyword not found:  "
-              << ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON
-              << "\nReturning false"
-              << endl;
-      }
-
-      return false;
-   }
-
-   // Get the image size.
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_LINES_KW);
-   if (lookup)
-   {
-      theNumberOfLines = ossimString(lookup).toULong();
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nRequired keyword not found:  "
-              << ossimKeywordNames::NUMBER_LINES_KW
-              << "\nReturning false"
-              << endl;
-      }
-
-      return false;
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_SAMPLES_KW);
-   if (lookup)
-   {
-      theNumberOfSamps = ossimString(lookup).toULong();
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nRequired keyword not found:  "
-              << ossimKeywordNames::NUMBER_SAMPLES_KW
-              << "\nReturning false"
-              << endl;
-      }
-
-      return false;
-   }
-
-   initialize();
-
-   //***
-   // See if the min / max keyword was set and reset it.
-   // Note this must be done after initialize since it sets the min / max from
-   // the elevation manager.
-   //***
-   lookup = kwl.find(prefix, ossimKeywordNames::MIN_VALUE_KW);
-   if (lookup)
-   {
-      setMinPixelValue(ossimString(lookup).toDouble());
-   }
-   lookup = kwl.find(prefix, ossimKeywordNames::MAX_VALUE_KW);
-   if (lookup)
-   {
-      setMaxPixelValue(ossimString(lookup).toDouble());
-   }
-
-   if (getErrorStatus() != ossimErrorCodes::OSSIM_OK)
-   {
-      return false;
-   }
-
-   //***
-   // Reset the base class to have a fixed input list of "0" size.
-   // Note:  To not do this will result in a core dump destroying objects
-   // connected to this output.
-   //***
-   theInputObjectList.clear();
-   theInputListIsFixedFlag = true;
-   theOutputListIsFixedFlag = false;
-  
-   return true;
-}
-
-void ossimElevImageSource::initialize()
-{
-   static const char MODULE[] = "ossimElevImageSource::initialize";
-   
-   if (traceDebug()) CLOG << " Entered..." << endl;
-   
-   //***
-   // First see if the manager pointer has been captured.
-   //***
-   if (!theElevManager) theElevManager = ossimElevManager::instance();
-
-   if (!theElevManager)
-   {
-      setErrorStatus();
-      cerr << MODULE << "ERROR:\nNULL elevation manager pointer!"
-           << "\nObject not initialized!" << endl;
-      return;
-   }
-
-   // Basic sanity checks.
-   if (!theLatSpacing || !theLonSpacing ||
-       !theNumberOfLines || !theNumberOfSamps)
-   {
-      setErrorStatus();
-      cerr << MODULE << "ERROR:"
-           << "\nMust set latitude/longitude spacing and number of line and"
-           << " samples."
-           << "Object not initialized!" << endl;
-      return;
-      
-   }
-
-   // Check the ground point.
-   if ( theTiePoint.latd() > 90.0  || theTiePoint.latd() < -90.0  ||
-        theTiePoint.lond() > 180.0 || theTiePoint.lond() < -180.0 )
-   {
-      setErrorStatus();
-      cerr << MODULE << "ERROR:\nBogus tie point."
-           << "\nObject not initialized!" << endl;
-      return;
-   }
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nTie point:  " << theTiePoint
-           << "\nLatitude spacing:  " << theLatSpacing
-           << "\nLongitude spacing:  " << theLonSpacing
-           << "\nLines:              " << theNumberOfLines
-           << "\nSamples:            " << theNumberOfSamps
-           << endl;
-   }
-   
-   //***
-   // Since this will return float data we need to set the min / max values
-   // of the data so that anybody who remaps it to eight bit will do it
-   // properly.  So scan the entire image rectangle using the manager.
-   // This will do two things, force the elevation manager to load all the
-   // cells, and at the same time the min / max elevation value will be set.
-   // NOTE:
-   // ??? Should the elevation manager clear the list of sources prior to
-   // the code segment so that the min / max is only from the cells we
-   // need!
-   //***
-
-   cout << "Initializing elevation manager..." << endl;
-
-#if 0
-   // Loop in the longitude or sample direction.
-   time_t start_t = time(NULL);
-   double lon = theTiePoint.lond();
-   for (ossim_uint32 samp = 0; samp < theNumberOfSamps; ++samp)
-   {
-      double lat = theTiePoint.latd() - theLatSpacing * (theNumberOfLines - 1);
-      if (lat < -90.0) lat = -(lat + 180.0); // Wrapped around the south poll.
-      
-      for (ossim_uint32 line = 0; line < theNumberOfLines; ++line)
-      {
-         ossimGpt gpt(lat, lon);
-         theElevManager->getHeightAboveMSL(gpt);
-
-         lat += theLatSpacing;
-         if (lat > 90) lat = 180 - lat; // Went across poll.
-      }
-      
-      lon += theLonSpacing;
-      if (lon > 180.0) lon -= 360.0; // Went across the central meridian.
-   }
-   time_t stop_t = time(NULL);
-   cout << "Finished loop two..." << endl;
-   cout << "Elapsed time for loop two:  " << (stop_t - start_t) << endl;
-#endif
-   
-   theTile = new ossimImageData(this,
-                                OSSIM_FLOAT);
-   theTile->initialize();
-
-   // Set the min / max for any normalization down the chain...
-   theTile->setMinPix(theElevManager->getMinHeightAboveMSL(), 0);
-   theTile->setMaxPix(theElevManager->getMaxHeightAboveMSL(), 0);
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nMin pix:            " << theTile->getMinPix(0)
-           << "\nMax pix:            " << theTile->getMaxPix(0)
-           << endl;
-   }
-}
-
-ossimIrect ossimElevImageSource::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   ossimIrect result(0, 0, theNumberOfSamps-1, theNumberOfLines-1);
-   
-   if (reduced_res_level != 0)
-   {
-      cerr << "ossimElevImageSource::getImageRectangle ERROR:"
-           << "\nOnly R0 is supported." << endl;
-   }
-
-   return result;
-}
-
-bool ossimElevImageSource::getImageGeometry(ossimKeywordlist& kwl,
-                                            const char* prefix)
-{
-   // Save off the image dimensions.
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_LINES_KW,
-           theNumberOfLines,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_SAMPLES_KW,
-           theNumberOfLines,
-           true);
-
-   // Save off the projection info (tie and post spacing).
-   ossimLlxyProjection proj(theTiePoint, theLatSpacing, theLonSpacing);
-   return proj.saveState(kwl, prefix);
-}
-
-void ossimElevImageSource::getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const
-{
-   if (resLevel)
-   {
-      cerr << "ossimElevImageSource::getDecimationFactor ERROR:"
-           << "\nReduced res sets currently not supported!"
-           << endl;
-   }
-
-   result.line = 1.0;
-   result.samp = 1.0;
-}
-
-void ossimElevImageSource::getDecimationFactors(vector<ossimDpt>& decimations) const
-{
-   ossimDpt pt(1.0, 1.0);
-   decimations.clear();
-   decimations.push_back(pt);
-}
-
-ossim_uint32 ossimElevImageSource::getNumberOfDecimationLevels()const
-{
-   return 1;
-}
-
-ossim_uint32 ossimElevImageSource::getNumberOfInputBands() const
-{
-   return 1;
-}
-
-ossimScalarType ossimElevImageSource::getOutputScalarType() const
-{
-   return OSSIM_FLOAT;
-}
-
-ossim_uint32 ossimElevImageSource::getTileWidth() const
-{
-   if (theTile.get()) return theTile->getWidth();
-
-   return 0;
-}
-
-ossim_uint32 ossimElevImageSource::getTileHeight() const
-{
-   if (theTile.get()) return theTile->getHeight();
-
-   return 0;
-}
-
-void ossimElevImageSource::changeTileSize(const ossimIpt& size)
-{
-   if (traceDebug())
-   {
-      cout << "ossimElevImageSource::changeTileSize DEBUG:"
-           << "\nx size:  " << size.x
-           << "\ny size:  " << size.y
-           << endl;
-   }
-
-   if (!theTile)
-   {
-      cerr << "ossimElevImageSource::changeTileSize ERROR:"
-           << "\nObject not initialized!  Returning..." << endl;
-      return;
-   }
-
-   theTile = new ossimImageData(this,
-                                OSSIM_FLOAT,
-                                1,
-                                size.x,
-                                size.y);
-   theTile->initialize();
-   
-   // Set the min / max for any normalization down the chain...
-   theTile->setMinPix(theElevManager->getMinHeightAboveMSL(), 0);
-   theTile->setMaxPix(theElevManager->getMaxHeightAboveMSL(), 0);
-}
-
-ossim_uint32 ossimElevImageSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level)
-   {
-      cerr << "ossimElevImageSource::getNumberOfLines ERROR:"
-           << "\nReduced res sets currently not supported!"
-           << endl;
-      return 0;
-   }
-
-   return theNumberOfLines;
-}
-
-ossim_uint32 ossimElevImageSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level)
-   {
-      cerr << "ossimElevImageSource::getNumberOfSamples ERROR:"
-           << "\nReduced res sets currently not supported!"
-           << endl;
-      return 0;
-   }
-
-   return theNumberOfSamps;
-}
-
-double ossimElevImageSource::getMinPixelValue(ossim_uint32 band) const
-{
-   if (band)
-   {
-      cerr << "ossimElevImageSource::getMinPixelValue ERROR:"
-           << "\nReduced res sets currently not supported!"
-           << endl;
-      return 0.0;
-   }
-
-   if (theTile.get())
-   {
-      return theTile->getMinPix(0);
-   }
-   else if (theElevManager)
-   {
-      return theElevManager->getMinHeightAboveMSL();
-   }
-
-   return 0.0;
-}
-
-double ossimElevImageSource::getMaxPixelValue(ossim_uint32 band) const
-{
-   if (band)
-   {
-      cerr << "ossimElevImageSource::getMaxPixelValue ERROR:"
-           << "\nReduced res sets currently not supported!"
-           << endl;
-      return 0.0;
-   }
-
-   if (theTile.get())
-   {
-      return theTile->getMaxPix(0);
-   }
-   else if (theElevManager)
-   {
-      return theElevManager->getMaxHeightAboveMSL();
-   }
-
-   return 0.0;
-}
-
-void ossimElevImageSource::setMinPixelValue(ossim_float64 min_pix)
-{
-   if (theTile.get()) 
-   {
-      theTile->setMinPix(min_pix, 0);
-      if (traceDebug())
-      {
-         cout << "ossimElevImageSource::setMinPixelValue DEBUG:"
-              << "\nMin pixel value:  " << min_pix
-              << endl;
-      }
-   }
-   else
-   {
-      cerr << "ossimElevImageSource::setMinPixelValue ERROR:"
-           << "\nObject not initialized!"
-           << endl;
-   }
-}
-
-void ossimElevImageSource::setMaxPixelValue(ossim_float64 max_pix)
-{
-   if (theTile.get()) 
-   {
-      theTile->setMaxPix(max_pix, 0);
-      if (traceDebug())
-      {
-         cout << "ossimElevImageSource::setMaxPixelValue DEBUG:"
-              << "\nMax pixel value:  " << max_pix
-              << endl;
-      }
-   }
-   else
-   {
-      cerr << "ossimElevImageSource::setMinPixelValue ERROR:"
-           << "\nObject not initialized!"
-           << endl;
-   }
-}      
-
diff --git a/ossim/src/ossim/imaging/ossimEnviHeaderFileWriter.cpp b/ossim/src/ossim/imaging/ossimEnviHeaderFileWriter.cpp
deleted file mode 100644
index bd2fe71..0000000
--- a/ossim/src/ossim/imaging/ossimEnviHeaderFileWriter.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Class definition for ossimEnviHeaderFileWriter.  Meta data class for
-// writing an ENVI (The Environment for Visualizing Images) header file.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimEnviHeaderFileWriter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimEnviHeaderFileWriter.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-
-
-RTTI_DEF1(ossimEnviHeaderFileWriter,
-          "ossimEnviHeaderFileWriter",
-          ossimMetadataFileWriter)
-
-ossimEnviHeaderFileWriter::ossimEnviHeaderFileWriter()
-   :
-   ossimMetadataFileWriter(),
-   theHdr()
-{
-}
-
-ossimEnviHeaderFileWriter::~ossimEnviHeaderFileWriter()
-{
-}
-
-bool ossimEnviHeaderFileWriter::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   bool result = false;
-   
-   if (ossimMetadataFileWriter::loadState(kwl, prefix))
-   {
-      result = theHdr.loadState(kwl, prefix);
-   }
-   
-   return result;
-}
-
-bool writeFile()
-{
-   bool result = true;
-
-   return result;
-}
-
-bool ossimEnviHeaderFileWriter::writeFile()
-{
-   theHdr.setLines(theAreaOfInterest.height());
-   theHdr.setSamples(theAreaOfInterest.width());
-   theHdr.setBands(theInputConnection->getNumberOfOutputBands());
-   
-   // Get the geometry from the input.
-   // Get the geometry from the input.
-   ossimMapProjection* mapProj = 0;
-   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
-   if ( inputGeom.valid() ) mapProj = PTR_CAST(ossimMapProjection, inputGeom->getProjection());
-   if (mapProj)
-   {
-      // Create the projection info.
-      ossimRefPtr<ossimMapProjectionInfo> projectionInfo
-         = new ossimMapProjectionInfo(mapProj, theAreaOfInterest);
-
-      // Set the tie points in the keyword list.
-      ossimKeywordlist kwl;
-      projectionInfo->getGeom(kwl);
-
-      // Pass it on to envi header to set the map info string from geometry.
-      theHdr.setMapInfo(kwl);
-   }
-
-   return theHdr.writeFile(theFilename);
-}
-
-void ossimEnviHeaderFileWriter::getMetadatatypeList(
-   std::vector<ossimString>& metadatatypeList) const
-{
-   metadatatypeList.push_back(ossimString("envi_header")); 
-}
-
-bool ossimEnviHeaderFileWriter::hasMetadataType(
-   const ossimString& metadataType)const
-{
-   return (metadataType == "envi_header");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimEnviTileSource.cpp b/ossim/src/ossim/imaging/ossimEnviTileSource.cpp
deleted file mode 100644
index 73fa333..0000000
--- a/ossim/src/ossim/imaging/ossimEnviTileSource.cpp
+++ /dev/null
@@ -1,282 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Image handler class for a raster files with an ENVI header file.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/imaging/ossimEnviTileSource.h>
-#include <ossim/base/ossimAffineTransform.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageGeometryRegistry.h>
-#include <ossim/projection/ossimAlphaSensorHRI.h>
-#include <ossim/projection/ossimAlphaSensorHSI.h>
-#include <ossim/support_data/ossimAlphaSensorSupportData.h>
-#include <ossim/support_data/ossimWavelength.h>
-
-
-RTTI_DEF1(ossimEnviTileSource,
-          "ossimEnviTileSource",
-          ossimGeneralRasterTileSource)
-
-static ossimTrace traceDebug("ossimEnviTileSource:debug");
-
-ossimEnviTileSource::ossimEnviTileSource()
-   :
-   ossimGeneralRasterTileSource(),
-   m_enviHdr()
-{
-}
-
-ossimEnviTileSource::~ossimEnviTileSource()
-{
-}
-
-bool ossimEnviTileSource::open()
-{
-   static const char MODULE[] = "ossimEnviTileSource::open";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\nimage file: " << theImageFile << std::endl;
-   }
-
-   bool result = false;
-   
-   if(isOpen())
-   {
-      close();
-   }
-
-   // Look for a header file:
-   ossimFilename hdr = theImageFile;
-   hdr.setExtension("hdr"); // image.hdr
-   if ( !hdr.exists() )
-   {
-      hdr = theImageFile;
-      hdr.string() += ".hdr"; // image.ras.hdr
-   }
-
-   if ( hdr.exists() )
-   {
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "header file: " << hdr << std::endl;
-      }
-
-      if ( m_enviHdr.open( hdr ) )
-      {
-         if ( m_rasterInfo.initializeFromEnviHdr( m_enviHdr ) )
-         {
-            // Set image file for initializeHandler method.
-            m_rasterInfo.setImageFile( theImageFile );
-            
-            // Look for an omd file:
-            ossimFilename omd = theImageFile;
-            omd.setExtension("omd"); // image.omd
-            if ( !omd.exists() )
-            {
-               omd.setExtension("kwl"); // image.kwl
-            }
-            
-            if ( omd.exists() )
-            {
-               if ( traceDebug() )
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG) << "omd file: " << omd << std::endl;
-               }
-
-               // Pick up adjusted min / max values if present.
-               ossimKeywordlist kwl( omd );
-               m_rasterInfo.getImageMetaData().updateMetaData( kwl, std::string("") );
-            }
-           
-            theMetaData = m_rasterInfo.getImageMetaData();
-            
-            result = initializeHandler();
-            if ( result )
-            {
-               completeOpen();
-               
-               //---
-               // This will set default output band list if we are a band selector and 
-               // "default bands" key is found in the envi header.  If "default bands"
-               // is not found it will set to identity(input = output).
-               //---
-               setDefaultBandList();
-            }
-         }
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
-   }
-   
-   return result;
-}
-   
-//************************************************************************************************
-//! Returns the image geometry object associated with this tile source or NULL if non defined.
-//! The geometry contains full-to-local image transform as well as projection (image-to-world)
-//************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimEnviTileSource::getImageGeometry()
-{
-   if ( !theGeometry )
-   {
-      // Check for external geom:
-      theGeometry = getExternalImageGeometry();
-      
-      if ( !theGeometry )
-      {
-         // Check the internal geometry first to avoid a factory call.
-         theGeometry = getInternalImageGeometry();
-
-         // At this point it is assured theGeometry is set.
-
-         //---
-         // WARNING:
-         // Must create/set theGeometry at this point or the next call to
-         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
-         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
-         //---         
-
-         // Check for set projection.
-         if ( theGeometry.valid()&&!theGeometry->getProjection() )
-         {
-            // Try factories for projection.
-            ossimImageGeometryRegistry::instance()->extendGeometry(this);
-         }
-      }
-      
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-   }
-   
-   return theGeometry;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimEnviTileSource::getInternalImageGeometry() const
-{
-   static const char MODULE[] = "ossimEnviTileSource::getInternalImageGeometry";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   ossimRefPtr<ossimImageGeometry> geom;
-
-// debugging to turn off model load
-//   return geom;
-
-   geom  = new ossimImageGeometry();
-
-    ossimRefPtr<ossimAlphaSensorSupportData> supData = new ossimAlphaSensorSupportData();
-    if ( supData->readSupportFiles( m_enviHdr ) )
-    {
-       if (supData->isHSI())
-       {
-          ossimRefPtr<ossimAlphaSensorHSI> sensor = new ossimAlphaSensorHSI();
-          if ( sensor->initialize( *(supData.get()) ) )
-          {
-             geom->setProjection( sensor.get() );
-          }
-       }
-       else
-       {
-          ossimRefPtr<ossimAlphaSensorHRI> sensor = new ossimAlphaSensorHRI();
-          if ( sensor->initialize( *(supData.get()) ) )
-          {
-             geom->setProjection( sensor.get() );
-          }
-       }
-       
-    } // Matches: if ( supData->readSupportFiles( m_enviHdr ) )
-    else
-    {
-      geom = 0;
-    }
-
-    return geom;
-}
-
-bool ossimEnviTileSource::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix)const
-{
-   return ossimGeneralRasterTileSource::saveState(kwl,prefix);
-}
-
-bool ossimEnviTileSource::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   return ossimGeneralRasterTileSource::loadState(kwl, prefix);
-}
-
-ossimRefPtr<ossimProperty> ossimEnviTileSource::getProperty(
-   const ossimString& name)const
-{
-   if(name == "file_type")
-   {
-      return new ossimStringProperty(name, getShortName());
-   }
-   
-   return ossimImageHandler::getProperty(name);
-}
-
-void ossimEnviTileSource::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
-{
-   ossimImageHandler::getPropertyNames(propertyNames);
-   propertyNames.push_back("file_type");
-}
-
-ossimString ossimEnviTileSource::getShortName() const
-{
-   return ossimString("ENVI");
-}
-   
-ossimString ossimEnviTileSource::getLongName() const
-{
-   return ossimString("ENVI reader");
-}
- 
-
-void ossimEnviTileSource::setDefaultBandList()
-{
-   if ( isBandSelector() )
-   {
-      // Look in ENVI header for "default bands":
-      std::vector<ossim_uint32> bands;
-      m_enviHdr.getDefaultBands( bands );
-
-      if ( !bands.size() && ( getNumberOfInputBands() > 2 ) )
-      {
-         // Try to derive RGB from wavelengths if found in ENVI header.
-         ossimWavelength wl;
-         if ( wl.initialize( m_enviHdr ) )
-         {
-            wl.getRgbBands( bands );
-         }
-      }
-      
-      if ( bands.size() )
-      {            
-         ossimImageHandler::setOutputBandList(bands, m_outputBandList);
-      }
-   }
-   
-   if ( m_outputBandList.empty() )
-   {
-      // Initialized to identity (input = output):
-      ossimImageSource::getOutputBandList( m_outputBandList );
-   }
-}
diff --git a/ossim/src/ossim/imaging/ossimEquationCombiner.cpp b/ossim/src/ossim/imaging/ossimEquationCombiner.cpp
deleted file mode 100644
index de715dc..0000000
--- a/ossim/src/ossim/imaging/ossimEquationCombiner.cpp
+++ /dev/null
@@ -1,3573 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimEquationCombiner.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <sstream>
-using namespace std;
-
-#include <ossim/imaging/ossimEquationCombiner.h>
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimConvolutionSource.h>
-#include <ossim/imaging/ossimSubImageTileSource.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/matrix/newmatio.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-RTTI_DEF1(ossimEquationCombiner, "ossimEquationCombiner", ossimImageCombiner);
-
-static const char* EQUATION_KW = "equation";
-
-
-class ossimBinaryOpAdd : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return v1 + v2;
-      }
-};
-
-class ossimBinaryOpAnd : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (double)(((ossim_uint32)v1) & ((ossim_uint32)v2));
-      }
-};
-
-class ossimBinaryOpOr : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (double)(((ossim_uint32)v1) | ((ossim_uint32)v2));
-      }
-};
-
-class ossimBinaryOpXor : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (double)(((ossim_uint32)v1) ^ ((ossim_uint32)v2));
-      }
-};
-
-class ossimBinaryOpSub : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return v1 - v2;
-      }
-};
-
-class ossimBinaryOpMax : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return std::max(v1, v2);
-      }
-};
-
-class ossimBinaryOpMin : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return std::min(v1, v2);
-      }
-};
-
-class ossimBinaryOpMul : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return v1 * v2;
-      }
-};
-
-class ossimBinaryOpDiv : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         if(fabs(v2)>FLT_EPSILON)
-            return v1 / v2;
-         
-         return 1.0/FLT_EPSILON;
-      }
-};
-
-class ossimBinaryOpMod : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         if(fabs(v2)>FLT_EPSILON)
-            return fmod(v1,v2);
-         
-         return 1.0/FLT_EPSILON;
-      }
-};
-
-class ossimBinaryOpPow : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return pow(v1, v2);
-      }
-};
-// boolean operators
-class ossimBinaryOpEqual : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (v1==v2)?1.0:0.0;
-      }
-};
-class ossimBinaryOpGreater : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (v1>v2)?1.0:0.0;
-      }
-};
-class ossimBinaryOpGreaterOrEqual : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (v1>=v2)?1.0:0.0;
-      }
-};
-class ossimBinaryOpLess : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (v1<v2)?1.0:0.0;
-      }
-};
-class ossimBinaryOpLessOrEqual : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (v1<=v2)?1.0:0.0;
-      }
-};
-class ossimBinaryOpDifferent : public ossimEquationCombiner::ossimBinaryOp
-{
-public:
-   virtual double apply(double v1, double v2)const
-      {
-         return (v1!=v2)?1.0:0.0;
-      }
-};
-class ossimUnaryOpNot : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return 1-v;
-      }
-};
-
-class ossimUnaryOpAbs : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return fabs(v);
-      }
-};
-
-class ossimUnaryOpOnesComplement : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return (double)((ossim_uint8)~((ossim_uint8)v));
-      }
-};
-
-class ossimUnaryOpLog : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return log(v);
-      }
-};
-
-class ossimUnaryOpLog10 : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return log10(v);
-      }
-};
-
-class ossimUnaryOpNeg : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return -v;
-      }
-};
-
-class ossimUnaryOpSqrt : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         if(v >= 0)
-         {
-            return sqrt(v);
-         }
-         
-         return -1;
-      }
-};
-
-class ossimUnaryOpExp : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return exp(v);
-      }
-};
-
-class ossimUnaryOpSin : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return sin(v);
-      }
-};
-
-class ossimUnaryOpSind : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return sin(v*M_PI/180.0);
-      }
-};
-
-class ossimUnaryOpASin : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         if(v > 1) v = 1;
-         if(v < -1) v = -1;
-         return asin(v);
-      }
-};
-
-class ossimUnaryOpASind : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         if(v > 1) v = 1;
-         if(v < -1) v = -1;
-         return (180/M_PI)*asin(v);
-      }
-};
-
-class ossimUnaryOpACos : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         if(v > 1) v = 1;
-         if(v < -1) v = -1;
-         return acos(v);
-      }
-};
-
-class ossimUnaryOpACosd : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         if(v > 1) v = 1;
-         if(v < -1) v = -1;
-         return (180/M_PI)*acos(v);
-      }
-};
-
-class ossimUnaryOpCos : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return cos(v);
-      }
-};
-
-class ossimUnaryOpCosd : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return cos(v*M_PI/180.0);
-      }
-};
-
-class ossimUnaryOpTan : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return tan(v);
-      }
-};
-
-class ossimUnaryOpTand : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return tan(v*M_PI/180.0);
-      }
-};
-
-class ossimUnaryOpATan : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return atan(v);
-      }
-};
-
-class ossimUnaryOpATand : public ossimEquationCombiner::ossimUnaryOp
-{
-public:
-   virtual double apply(double v)const
-      {
-         return (180/M_PI)*atan(v);
-      }
-};
-
-
-ossimEquationCombiner::ossimEquationCombiner()
-   :ossimImageCombiner(),
-    theOutputScalarType(OSSIM_FLOAT64),
-    theEquation(""),
-    theLexer(NULL),
-    theTile(NULL),
-    theCastFilter(NULL),
-    theCastOutputFilter(NULL)
-{
-   theLexer      = new ossimEquTokenizer;
-   theCastFilter = new ossimCastTileSourceFilter;
-   theCastFilter->setOutputScalarType(OSSIM_FLOAT64);
-}
-
-ossimEquationCombiner::ossimEquationCombiner(ossimConnectableObject::ConnectableObjectList& inputs)
-   :ossimImageCombiner(inputs),
-    theOutputScalarType(OSSIM_FLOAT64),
-    theEquation(""),
-    theLexer(NULL),
-    theTile(NULL),
-    theCastFilter(NULL),
-    theCastOutputFilter(NULL)
-{
-   theLexer      = new ossimEquTokenizer;
-   theCastFilter = new ossimCastTileSourceFilter;
-   theCastFilter->setOutputScalarType(OSSIM_FLOAT64);
-}
-
-ossimEquationCombiner::~ossimEquationCombiner()
-{
-   if(theLexer)
-   {
-      delete theLexer;
-      theLexer = NULL;
-   }
-
-   if(theCastFilter.valid())
-   {
-      theCastFilter->disconnect();
-      theCastFilter = 0;
-   }
-
-   if(theCastOutputFilter.valid())
-   {
-      theCastOutputFilter->disconnect();
-      theCastOutputFilter = 0;
-   }
-   // make sure they are cleared
-   clearStacks();
-}
-
-double ossimEquationCombiner::getNullPixelValue(ossim_uint32 band)const
-{
-   
-   if(theEquation == "")
-   {
-      if(getInput())
-      {
-         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
-         if(inter)
-         {
-            return inter->getNullPixelValue(band);
-         }
-      }
-   }
-   return ossim::defaultNull(getOutputScalarType());
-}   
-
-double ossimEquationCombiner::getMinPixelValue(ossim_uint32 band)const
-{
-   if(theEquation == "")
-   {
-      if(getInput())
-      {
-         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
-         if(inter)
-         {
-            return inter->getMinPixelValue(band);
-         }
-      }
-   }
-   return ossim::defaultMin(getOutputScalarType());
-}
-
-double ossimEquationCombiner::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(theEquation == "")
-   {
-      if(getInput())
-      {
-         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
-         if(inter)
-         {
-            return inter->getMaxPixelValue(band);
-         }
-      }
-   }
-   return ossim::defaultMax(getOutputScalarType());         
-}
-
-ossimScalarType ossimEquationCombiner::getOutputScalarType() const
-{
-
-   if(theEquation == "")
-   {
-      if(getInput())
-      {
-         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
-         if(inter)
-         {
-            return inter->getOutputScalarType();
-         }
-      }
-   }
-   
-   return theOutputScalarType;
-}
-
-
-ossimRefPtr<ossimImageData> ossimEquationCombiner::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theTile)
-   {
-      initialize();
-   }
-   long w = tileRect.width();
-   long h = tileRect.height();
-   long tw = theTile->getWidth();
-   long th = theTile->getHeight();
-   
-   if(theEquation != "")
-   {
-      theTile->setImageRectangle(tileRect);
-      
-      if(w*h != tw*th)
-      {
-         theTile->initialize();
-      }
-      else
-      {
-         theTile->makeBlank();
-      }
-      theCurrentResLevel = resLevel;
-      
-      ossimRefPtr<ossimImageData> outputTile =  parseEquation();
-
-      if(theCastOutputFilter.valid())
-      {
-         outputTile = theCastOutputFilter->applyCast(outputTile);
-      }
-      
-      return outputTile;
-   }
-   else
-   {
-      if(getInput())
-      {
-         ossimImageSource* inter =
-            PTR_CAST(ossimImageSource, getInput());
-         if(inter)
-         {
-            return inter->getTile(tileRect, resLevel);
-         }
-      }
-   }
-
-   return ossimRefPtr<ossimImageData>();
-}
-
-void ossimEquationCombiner::setOutputScalarType(ossimScalarType scalarType)
-{
-   if(theOutputScalarType != scalarType)
-   {
-      theOutputScalarType = scalarType;
-
-      if(theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
-      {
-         theOutputScalarType = OSSIM_FLOAT64;
-      }
-      if(theCastOutputFilter.valid())
-      {
-         theCastOutputFilter = 0;
-      }
-
-      if(theOutputScalarType != OSSIM_FLOAT64)
-      {
-         theCastOutputFilter = new ossimCastTileSourceFilter;
-         theCastOutputFilter->setOutputScalarType(theOutputScalarType);
-         theCastOutputFilter->connectMyInputTo(0, this);
-         theCastOutputFilter->initialize();
-      }
-   }
-}
-
-void ossimEquationCombiner::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-   
-   if(property->getName() == "Equation")
-   {
-      theEquation = property->valueToString();
-   }
-   else if(property->getName() == "Output scalar type")
-   {
-      setOutputScalarType(ossimScalarTypeLut::instance()->
-                          getScalarTypeFromString(property->valueToString()));
-   }
-   else
-   {
-      ossimImageCombiner::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimEquationCombiner::getProperty(const ossimString& name)const
-{
-   if(name == "Equation")
-   {
-      ossimStringProperty* stringProp = new ossimStringProperty("Equation",
-								theEquation,
-								false);
-      stringProp->clearChangeType();
-      stringProp->setReadOnlyFlag(false);
-      stringProp->setCacheRefreshBit();
-      
-      return stringProp;
-   }
-   else if(name == "Output scalar type")
-   {
-      ossimScalarTypeLut* sl = ossimScalarTypeLut::instance();
-      
-      std::vector<ossimString> scalarNames;
-
-      ossim_int32 tableSize = (ossim_int32)sl->getTableSize();
-      ossim_int32 idx;
-
-      for(idx = 0; idx < tableSize; ++idx)
-      {
-         scalarNames.push_back(sl->getEntryString(idx));
-      }
-      ossimStringProperty* stringProp = new ossimStringProperty("Output scalar type",
-								sl->getEntryString((ossim_int32)theOutputScalarType),
-								false,
-								scalarNames);
-      stringProp->clearChangeType();
-      stringProp->setReadOnlyFlag(false);
-      stringProp->setCacheRefreshBit();
-      
-      return stringProp;
-      
-   }
-
-   return ossimImageCombiner::getProperty(name);
-}
-
-void ossimEquationCombiner::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageCombiner::getPropertyNames(propertyNames);
-   propertyNames.push_back("Equation");
-   propertyNames.push_back("Output scalar type");
-}
-
-
-void ossimEquationCombiner::initialize()
-{
-   ossimImageCombiner::initialize();
-
-   theTile = ossimImageDataFactory::instance()->create(this, OSSIM_FLOAT64, getNumberOfOutputBands(), getTileWidth(), getTileHeight());
-   theTile->initialize();
-   if(theCastOutputFilter.valid())
-   {
-      theCastOutputFilter->initialize();
-   }
-}
-
-void ossimEquationCombiner::assignValue()
-{
-   if(!theValueStack.empty())
-   {
-      if(theValueStack.top().type == OSSIM_EQU_IMAGE_DATA_TYPE)
-      {
-         ossimImageData* topData = theValueStack.top().d.imageDataValue;
-         ossim_uint32 minBands = std::min(theTile->getNumberOfBands(),
-                                    topData->getNumberOfBands());
-         ossim_uint32 maxBands = theTile->getNumberOfBands();
-         ossim_uint32 band   = 0;
-         ossim_uint32 offset = 0;
-         ossim_uint32 size = theTile->getWidth()*theTile->getHeight();
-
-         if(topData->getDataObjectStatus() == OSSIM_PARTIAL)
-         {
-            for(band = 0; band < minBands; ++band)
-            {
-               double* inBuf  = (double*)topData->getBuf(band);
-               double* outBuf = (double*)theTile->getBuf(band);
-               double np      = topData->getNullPix(band);
-               if(outBuf && inBuf)
-               {
-                  for(offset = 0; offset < size; ++offset)
-                  {
-                     if(*inBuf != np)
-                     {
-                        *outBuf = *inBuf;
-                     }
-                     ++outBuf;
-                     ++inBuf;
-                  }
-               }
-            }
-            for(;band < maxBands; ++band)
-            {
-               double* inBuf  = (double*)topData->getBuf(minBands-1);
-               double* outBuf = (double*)theTile->getBuf(band);
-               double np      = topData->getNullPix(band);
-               
-               if(outBuf && inBuf)
-               {
-                  for(offset = 0; offset < size; ++offset)
-                  {
-                     if(*inBuf != np)
-                     {
-                        *outBuf = *inBuf;
-                     }
-                     ++outBuf;
-                     ++inBuf;
-                  }
-               }
-            }
-
-         }
-         else if(topData->getDataObjectStatus() == OSSIM_FULL)
-         {
-            for(band = 0; band < minBands; ++band)
-            {
-               double* inBuf  = (double*)theValueStack.top().d.imageDataValue->getBuf(band);
-               double* outBuf = (double*)theTile->getBuf(band);
-               if(outBuf && inBuf)
-               {
-                  for(offset = 0; offset < size; ++offset)
-                  {
-                     *outBuf = *inBuf;
-                     ++outBuf;
-                     ++inBuf;
-                  }
-               }
-            }
-            for(;band < maxBands; ++band)
-            {
-               double* inBuf  = (double*)theValueStack.top().d.imageDataValue->getBuf(minBands-1);
-               double* outBuf = (double*)theTile->getBuf(band);
-               
-               if(outBuf && inBuf)
-               {
-                  for(offset = 0; offset < size; ++offset)
-                  {
-                     *outBuf = *inBuf;
-                     ++outBuf;
-                     ++inBuf;
-                  }
-               }
-            }
-         }
-         
-         // Delete the object indirectly through an ossimRefPtr.
-         ossimRefPtr<ossimImageData> id = theValueStack.top().d.imageDataValue;
-         id = NULL;
-      }
-      else
-      {
-         double* buf  = static_cast<double*>(theTile->getBuf());
-         ossim_uint32 size = theTile->getSize();
-         double value = (double)theValueStack.top().d.doubleValue;
-         
-         for(ossim_uint32 offset = 0; offset < size; ++offset)
-         {
-            *buf = value;
-            ++buf;
-         }
-      }
-      
-      theValueStack.pop();
-   }
-}
-
-void ossimEquationCombiner::clearStacks()
-{
-
-   while(!theValueStack.empty())
-   {
-      if(theValueStack.top().type == OSSIM_EQU_IMAGE_DATA_TYPE)
-      {
-         // Delete the object indirectly through an ossimRefPtr.
-         ossimRefPtr<ossimImageData> id = theValueStack.top().d.imageDataValue;
-         id = NULL;
-      }
-
-      theValueStack.pop();
-   }
-}
-
-void ossimEquationCombiner::clearArgList(vector<ossimEquValue>& argList)
-{
-   for(ossim_uint32 i = 0; i < argList.size(); ++i)
-   {
-      if(argList[i].type == OSSIM_EQU_IMAGE_DATA_TYPE)
-      {
-         if(argList[i].d.imageDataValue)
-         {
-            // Delete the object indirectly through an ossimRefPtr.
-            ossimRefPtr<ossimImageData> id = argList[i].d.imageDataValue;
-            id = NULL;
-            argList[i].d.imageDataValue = (ossimImageData*)NULL;
-         }
-      }
-   }
-   argList.clear();
-}
-
-void ossimEquationCombiner::deleteArgList(vector<ossimEquValue>& args)
-{
-   int i = 0;
-
-   for(i = 0; i < (int)args.size(); ++i)
-   {
-      if(args[i].type == OSSIM_EQU_IMAGE_DATA_TYPE)
-      {
-         if(args[i].d.imageDataValue)
-         {
-            // Delete the object indirectly through an ossimRefPtr.
-            ossimRefPtr<ossimImageData> id = args[i].d.imageDataValue;
-            id = NULL;
-            args[i].d.imageDataValue = NULL;
-         }
-      }
-   }
-   
-   args.clear();
-}
-
-bool ossimEquationCombiner::parseArgList(vector<ossimEquValue>& args,
-                                         bool popValueStack)
-{
-   bool result = true;
-   
-   if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-   {
-      theCurrentId = theLexer->yylex();
-      do
-      {
-         if(parseExpression())
-         {
-            if(!theValueStack.empty())
-            {
-               args.push_back(theValueStack.top());
-               if(popValueStack)
-               {
-                  theValueStack.pop();
-               }
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "The expression at  arg " << (args.size()+1)
-                  << " is empty" << endl;
-               
-               result = false;
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               <<"Unable to parse expression" << endl;
-            result = false;
-         }
-         
-         if(theCurrentId == OSSIM_EQU_TOKEN_COMMA)
-         {
-            theCurrentId = theLexer->yylex();
-         }
-         else if(theCurrentId != OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               <<"Missing comma in argument list" << endl;
-            result = false;
-         }
-         
-      }while(result&&(theCurrentId != OSSIM_EQU_TOKEN_RIGHT_PAREN));
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Starting left parenthesis missing from arg list" << endl;
-      result = false;
-   }
-   
-   if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-   {
-      theCurrentId = theLexer->yylex(); // skip past right parenthesis
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         <<"No matching right parenthesis for arg list" << endl;
-      result = false;
-   }
-
-   if(!result && popValueStack)
-   {
-      clearArgList(args);
-   }
-   return result;
-}
-
-bool ossimEquationCombiner::parseAssignBand()
-{
-   bool result = true;
-   
-   vector<ossimEquValue> argList;
-
-   if(parseArgList(argList))
-   {
-      if((argList.size() == 3) ||
-         (argList.size() == 4))
-      {
-         ossimEquValue v3 = argList[2];
-         ossimEquValue v2 = argList[1];
-         ossimEquValue v1 = argList[0];
-         
-         if(argList.size() == 3)
-         {
-            if((v1.type == OSSIM_EQU_IMAGE_DATA_TYPE) &&
-               (v2.type == OSSIM_EQU_DOUBLE_TYPE))
-            {
-               ossimImageData *data = (ossimImageData*)v1.d.imageDataValue->dup();
-               ossimEquValue v;
-               
-               if(v3.type == OSSIM_EQU_IMAGE_DATA_TYPE)
-               {
-                  if(data->getBuf()&&
-                     v3.d.imageDataValue->getBuf())
-                  {
-                     if((ossim_uint32)(v2.d.doubleValue) < data->getNumberOfBands())
-                     {
-                        data->assignBand(v3.d.imageDataValue,
-                                         0,
-                                         (ossim_uint32)v2.d.doubleValue);
-                        
-                     }
-                  }
-               }
-               else
-               {
-                  if(data->getBuf()&&
-                     (ossim_uint32)v2.d.doubleValue < data->getNumberOfBands())
-                  {  
-                     ossim_uint32 upper = data->getWidth()*data->getHeight();
-                     double* buf = (double*)data->getBuf((ossim_uint32)v2.d.doubleValue);
-                     double value = v3.d.doubleValue;
-                     if(buf)
-                     {
-                        for(ossim_uint32 i = 0; i < upper; ++i)
-                        {
-                           *buf = value;
-                           ++buf;
-                        }  
-                     }
-                     else
-                     {
-                        result = false;
-                     }
-                  }
-               }
-               if(result)
-               {
-                  data->validate();
-                  v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-                  v.d.imageDataValue = data;
-                  theValueStack.push(v);
-               }
-            }
-            else
-            {
-               result = false;
-            }
-         }
-         else 
-         {
-            ossimEquValue v4 = argList[3];
-            if((v1.type == OSSIM_EQU_IMAGE_DATA_TYPE) &&
-               (v2.type == OSSIM_EQU_DOUBLE_TYPE)&&
-               (v3.type == OSSIM_EQU_IMAGE_DATA_TYPE)&&
-               (v4.type == OSSIM_EQU_DOUBLE_TYPE))
-            {
-               ossimImageData *data = (ossimImageData*)v1.d.imageDataValue->dup();
-               ossimEquValue v;
-               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-               v.d.imageDataValue = data;
-               if(data->getBuf()&&v3.d.imageDataValue->getBuf())
-               {
-                  
-                  ossim_uint32 index1 = (ossim_uint32)v4.d.doubleValue;
-                  ossim_uint32 index2 = (ossim_uint32)v2.d.doubleValue;
-                  
-                  if((index1 > data->getNumberOfBands()) ||
-                     (index1 > v3.d.imageDataValue->getNumberOfBands()))
-                  {
-                     result = false;
-                  }
-                  else
-                  {     
-                     data->assignBand(v3.d.imageDataValue,
-                                      index1,
-                                      index2);
-                     data->validate();
-                  }
-                  
-               }
-               
-               theValueStack.push(v);
-            }
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Invalid number of arguments to assign_band" << endl;
-         result = false;
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "unable to parse arguments for assign band" << endl;
-      result = false;
-   }
-
-   clearArgList(argList);
-
-   return result;
-}
-
-bool ossimEquationCombiner::parseStdFuncs()
-{
-   bool result = true;
-
-   switch(theCurrentId)
-   {
-   case OSSIM_EQU_TOKEN_ASSIGN_BAND:
-   {
-      theCurrentId = theLexer->yylex();
-      if(!parseAssignBand())
-      {
-         result = false;
-      }
-      
-      break;
-   }
-   case OSSIM_EQU_TOKEN_CONV:
-   {
-      theCurrentId = theLexer->yylex();
-      vector<ossimEquValue> args;
-      if(parseArgList(args))
-      {
-         ossimImageData* resultImage = (ossimImageData*)NULL;
-         if(applyConvolution(resultImage,
-                              args))
-         {
-            if(resultImage)
-            {
-               ossimEquValue v;
-               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-               v.d.imageDataValue = resultImage;
-               
-               theValueStack.push(v);
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "function conv error: resulting image is NULL" << endl;
-               result = false;
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Unable to apply convolution" << endl;
-            result = false;
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      
-      break;
-   }
-   case OSSIM_EQU_TOKEN_CLAMP:
-   {
-      theCurrentId = theLexer->yylex();
-      vector<ossimEquValue> args;
-      if(parseArgList(args))
-      {
-         ossimImageData* resultImage = (ossimImageData*)NULL;
-         if(applyClamp(resultImage,
-                       args))
-         {
-            if(resultImage)
-            {
-               ossimEquValue v;
-               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-               v.d.imageDataValue = resultImage;
-               
-               theValueStack.push(v);
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "function clamp error: resulting image is NULL" << endl;
-               result = false;
-            }
-            
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Unable to apply clamp" << endl;
-            result = false;
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      
-      break;
-   }
-   case OSSIM_EQU_TOKEN_BAND:
-   {
-    // need to parse the following rule for blurr function
-      //
-      // band(image data, number)
-      theCurrentId = theLexer->yylex();
-
-
-      vector<ossimEquValue> argList;
-
-      if(parseArgList(argList))
-      {
-         if(argList.size() == 2)
-         {
-            ossimEquValue v1 = argList[0];
-            ossimEquValue v2 = argList[1];
-            ossimImageData* tempData = NULL;
-            ossim_uint32 bandNumber           = 0;
-            if(v1.type == OSSIM_EQU_IMAGE_DATA_TYPE)
-            {
-               tempData = v1.d.imageDataValue;
-            }
-            else
-            {
-               result = false;
-            }
-            if(v2.type == OSSIM_EQU_DOUBLE_TYPE)
-            {
-               bandNumber = (ossim_uint32)(v2.d.doubleValue);
-            }
-            else
-            {
-               result = false;
-            }
-            if(bandNumber > tempData->getNumberOfBands())
-            {
-               result = false;
-            }
-            if(result)
-            {
-               ossimImageData* data = new ossimImageData(this,
-                                                         OSSIM_FLOAT64,
-                                                         1);
-               data->setWidthHeight(tempData->getWidth(),
-                                    tempData->getHeight());
-               data->setOrigin(tempData->getOrigin());
-               data->setNullPix(tempData->getNullPix(bandNumber),
-                                0);
-               data->setMinPix(tempData->getMinPix(bandNumber),
-                               0);
-               data->setMaxPix(tempData->getMaxPix(bandNumber),
-                               0);
-               data->initialize();
-               
-               if((tempData->getBuf())&&
-                  (bandNumber < tempData->getNumberOfBands()))
-               {
-                  data->assignBand(tempData,
-                                   bandNumber,
-                                   0);                           
-                  data->validate();
-               }
-               ossimEquValue v;
-               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-               v.d.imageDataValue = data;
-               theValueStack.push(v);
-            }
-            
-            if(tempData)
-            {
-               // Delete the object indirectly through an ossimRefPtr.
-               ossimRefPtr<ossimImageData> id = tempData;
-               tempData = NULL;
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Invalid number of args in function band" << endl;
-            
-            result = false;
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      
-      break;
-   }
-   case OSSIM_EQU_TOKEN_BLURR:
-   {
-      theCurrentId = theLexer->yylex();
-      vector<ossimEquValue> args;
-      if(parseArgList(args))
-      {
-         ossimImageData* resultImage = (ossimImageData*)NULL;
-         if(applyBlurr(resultImage,
-                       args))
-         {
-            if(resultImage)
-            {
-               ossimEquValue v;
-               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-               v.d.imageDataValue = resultImage;
-               
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-         else
-         {
-            result = false;
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      
-      break;
-   }
-   case OSSIM_EQU_TOKEN_SHIFT:
-   {
-      theCurrentId = theLexer->yylex();
-      vector<ossimEquValue> args;
-      if(parseArgList(args))
-      {
-         ossimImageData* resultImage = (ossimImageData*)NULL;
-         if(applyShift(resultImage,
-                       args))
-         {
-            if(resultImage)
-            {
-               ossimEquValue v;
-               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-               v.d.imageDataValue = resultImage;
-               
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-         else
-         {
-            result = false;
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      
-      break;
-   }
-   case OSSIM_EQU_TOKEN_MAX:
-   case OSSIM_EQU_TOKEN_MIN:
-   {
-      ossimBinaryOp* op = NULL;
-      if(theCurrentId == OSSIM_EQU_TOKEN_MIN) op = new ossimBinaryOpMin;
-      else op = new ossimBinaryOpMax;
-      
-      int argCount = 0;
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         bool done = false;
-         while(!done)
-         {
-            if(parseExpression())
-            {
-               
-               ++argCount;
-               if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-               {
-                  theCurrentId = theLexer->yylex();
-                  
-                  done = true;
-               }
-               else if(theCurrentId == OSSIM_EQU_TOKEN_COMMA)
-               {
-                  theCurrentId = theLexer->yylex();
-               }
-               else
-               {
-                  result = false;
-                  done = true;
-               }
-            }
-            else
-            {
-               done = true;
-               result = false;
-            }
-         }
-         if((argCount > 1)&&result)
-         {
-            result = true;
-            
-            ossimEquValue v;
-            ossimEquValue v1;
-            ossimEquValue v2;
-
-            v2 = theValueStack.top();
-            theValueStack.pop();
-            v1 = theValueStack.top();
-            theValueStack.pop();
-            argCount -=2;
-
-            do
-            {
-               if(applyOp(*op,
-                          v,
-                          v1,
-                          v2))
-               {
-                  theValueStack.push(v);
-               }
-               else
-               {
-                  result = false;
-                  argCount = 0;
-                  
-               }
-               --argCount;
-               
-               if((argCount>0)&&result)
-               {
-                  v2 = theValueStack.top();
-                  theValueStack.pop();
-                  v1 = theValueStack.top();
-                  theValueStack.pop();
-               }
-               
-            }while((argCount > 0)&&(result));
-         }
-         else
-         {
-            result = false;
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      if(op)
-      {
-         delete op;
-         op = NULL;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_ABS:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpAbs(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_SIN:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpSin(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_SIND:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpSind(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_ASIN:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpASin(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_ASIND:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpASind(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_COS:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpCos(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_COSD:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpCosd(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_ACOS:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpACos(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_ACOSD:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpACosd(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_TAN:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpTan(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_TAND:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpTand(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_ATAN:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpATan(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_ATAND:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpATand(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_LOG:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpLog(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_LOG10:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpLog10(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_SQRT:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpSqrt(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   case OSSIM_EQU_TOKEN_EXP:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
-      {
-         theCurrentId = theLexer->yylex();
-         result = parseExpression();
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            if(theValueStack.size() > 0)
-            {
-               theCurrentId = theLexer->yylex();
-               ossimEquValue v;
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-               
-               applyOp(ossimUnaryOpExp(),
-                       v,
-                       v1);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      break;
-   }
-   default:
-   {
-      result = false;
-   }
-   }
-
-   return result;
-}
-
-bool ossimEquationCombiner::parseUnaryFactor()
-{
-   bool result = false;
-
-   
-   if(theCurrentId == OSSIM_EQU_TOKEN_MINUS)
-   {
-      theCurrentId = theLexer->yylex();
-
-      if(parseFactor())
-      {
-         if(theValueStack.size() > 0)
-         {
-            ossimEquValue v;
-            ossimEquValue v1 = theValueStack.top();
-            theValueStack.pop();
-            
-            applyOp(ossimUnaryOpNeg(),
-                    v,
-                    v1);
-            
-            theValueStack.push(v);
-         }
-         else
-         {
-            result = false;
-         }
-
-         result = true;
-      }
-      else
-      {
-         result = false;
-      }
-   }
-   else if(theCurrentId == OSSIM_EQU_TOKEN_TILDE)
-   {
-      theCurrentId = theLexer->yylex();
-
-      if(parseFactor())
-      {
-         if(theValueStack.size() > 0)
-         {
-            ossimEquValue v;
-            ossimEquValue v1 = theValueStack.top();
-            theValueStack.pop();
-            
-            applyOp(ossimUnaryOpOnesComplement(),
-                    v,
-                    v1);
-            
-            theValueStack.push(v);
-         }
-         else
-         {
-            result = false;
-         }
-
-         result = true;
-      }
-      else
-      {
-         result = false;
-      }
-   }
-   return result;
-}
-
-bool ossimEquationCombiner::parseFactor()
-{
-   bool result = false;
-
-   switch(theCurrentId)
-   {
-   case OSSIM_EQU_TOKEN_CONSTANT:
-   {
-      ossimEquValue v;
-
-      v.type = OSSIM_EQU_DOUBLE_TYPE;
-      v.d.doubleValue = atof(theLexer->YYText());
-      theValueStack.push(v);
-      
-      theCurrentId = theLexer->yylex();
-      
-      result =  true;
-      break;
-   }
-   case OSSIM_EQU_TOKEN_PI:
-   {
-      ossimEquValue v;
-
-      v.type = OSSIM_EQU_DOUBLE_TYPE;
-      v.d.doubleValue = M_PI;
-      theValueStack.push(v);
-      
-      theCurrentId = theLexer->yylex();
-      
-      result =  true;
-      break;      
-   }
-   case OSSIM_EQU_TOKEN_IMAGE_VARIABLE:
-   {
-      theCurrentId = theLexer->yylex();
-      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_ARRAY_BRACKET)
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseExpression())
-         {
-            if(!theValueStack.empty())
-            {
-               if(theValueStack.top().type == OSSIM_EQU_DOUBLE_TYPE)
-               {
-                  if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_ARRAY_BRACKET)
-                  {
-                     theCurrentId = theLexer->yylex();
-                     ossim_uint32 index = (ossim_uint32)theValueStack.top().d.doubleValue;
-                     theValueStack.pop();
-                     ossimRefPtr<ossimImageData> data = getNewImageData(index);
-                     result = true;
-                     if(data.valid())
-                     {
-                        ossimEquValue v;
-                        v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-                        v.d.imageDataValue = data.release();
-                        theValueStack.push(v);
-
-                     }
-                     else
-                     {
-                        ossimNotify(ossimNotifyLevel_WARN)
-                           <<"Data is NULL for array operation" << endl;
-                     }
-                     result = true;
-                  }
-                  else
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << "Mismatched Right array bracket" << endl;
-                  }
-               }
-               else
-               {
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << "Expression between array brackets is not a number"
-                     << endl;
-               }
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "no expression within array brackets" << endl;
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Unabel to parse expression"<<endl;
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            <<"Need left array brackets to access an input source"<<endl;
-      }
-      
-      break;
-   }
-   case OSSIM_EQU_TOKEN_LEFT_PAREN:
-   {
-      theCurrentId = theLexer->yylex();
-      if(parseExpression())
-      {
-         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
-         {
-            result       =  true;
-            theCurrentId = theLexer->yylex();
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Right parenthesis missing" << endl;
-            result = false;
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Unable to parse expression within parenthesis" << endl;
-         result = false;
-      }
-      
-      break;
-   }
-   }
-   if(!result) result = parseUnaryFactor();
-   
-   if(!result) result = parseStdFuncs();
-   
-   return result;
-}
-
-bool ossimEquationCombiner::parseRestOfTerm()
-{
-   //---
-   // Parse the following rule:
-   // RestOfTerm: * Factor RestOfTerm | / Factor RestOfTerm |
-   // ^ Factor RestOfTerm
-   //---
-   bool result = true;
-   
-   switch(theCurrentId)
-   {
-      case OSSIM_EQU_TOKEN_MULT:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpMul(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "Multiplication requires two arguments" << endl;
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-         break;
-      }
-      case OSSIM_EQU_TOKEN_DIV:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpDiv(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_XOR:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpXor(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_AMPERSAND:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpAnd(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_OR_BAR:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpOr(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_MOD:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpMod(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_POWER:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpPow(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-         break;
-      }
-      case OSSIM_EQU_TOKEN_BEQUAL:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpEqual(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_BGREATER:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpGreater(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_BGREATEROREQUAL:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpGreaterOrEqual(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_BLESS:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpLess(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_BLESSOREQUAL:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpLessOrEqual(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-      case OSSIM_EQU_TOKEN_BDIFFERENT:
-      {
-         theCurrentId = theLexer->yylex();
-         if(parseFactor())
-         {
-            if(theValueStack.size() > 1)
-            {
-               ossimEquValue v;
-            
-               ossimEquValue v2 = theValueStack.top();
-               theValueStack.pop();
-               ossimEquValue v1 = theValueStack.top();
-               theValueStack.pop();
-            
-               applyOp(ossimBinaryOpDifferent(),
-                       v,
-                       v1,
-                       v2);
-            
-               theValueStack.push(v);
-            }
-            else
-            {
-               result = false;
-            }
-            if(result)
-            {
-               result = parseRestOfTerm();
-            }
-         }
-         else
-         {
-            result = false;
-         }
-
-         break;
-      }
-
-   }
-   
-   return result;
-}
-
-bool ossimEquationCombiner::parseTerm()
-{
-   // parse the following rule:
-   //
-   // Term : Factor RestOfTerm
-   
-   bool result = false;
-
-   result = parseFactor();
-   
-   if(result)
-   {
-      result = parseRestOfTerm();
-   }
-   
-   return result;
-}
-
-bool ossimEquationCombiner::parseRestOfExp()
-{
-   // parse the following rule:
-   // RestOfExpression : + Term RestOfExpression | - Term RestOfExpression | epsilon
-   //
-   bool result = true;
-   
-   if(theCurrentId == OSSIM_EQU_TOKEN_PLUS)
-   {
-      theCurrentId = theLexer->yylex();
-      if(parseTerm())
-      {
-
-         if(theValueStack.size() > 1)
-         {
-            ossimEquValue v;
-            
-            ossimEquValue v2 = theValueStack.top();
-            theValueStack.pop();
-            ossimEquValue v1 = theValueStack.top();
-            theValueStack.pop();
-            
-            
-            applyOp(ossimBinaryOpAdd(),
-                    v,
-                    v1,
-                    v2);              
-            
-            theValueStack.push(v);
-         }
-         else
-         {
-            result = false;
-         }
-         if(result)
-         {
-            result = parseRestOfExp();
-         }
-      }
-      else
-      {
-        result =  false;
-      }
-   }
-   else if(theCurrentId == OSSIM_EQU_TOKEN_MINUS)
-   {
-      theCurrentId = theLexer->yylex();
-      if(parseTerm())
-      {
-         if(theValueStack.size() > 1)
-         {
-            ossimEquValue v;
-            
-            ossimEquValue v2 = theValueStack.top();
-            theValueStack.pop();
-            ossimEquValue v1 = theValueStack.top();
-            theValueStack.pop();
-            
-            applyOp(ossimBinaryOpSub(),
-                    v,
-                    v1,
-                    v2);
-            
-            theValueStack.push(v);
-         }
-         else
-         {
-            result = false;
-         }
-         if(result)
-         {
-            result = parseRestOfExp();
-         }
-      }
-      else
-      {
-         result =  false;
-      }
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimImageData> ossimEquationCombiner::getImageData(ossim_uint32 index)
-{
-   ossimRefPtr<ossimImageData> result;
-   ossimConnectableObject* obj = getInput(index);
-   
-   if(obj)
-   {
-      theCastFilter->connectMyInputTo(0, obj);
-      result= (theCastFilter->getTile(theTile->getImageRectangle(),
-                                      theCurrentResLevel));
-      
-      if(result.valid())
-      {
-         result->setMinPix(theTile->getMinPix(), theTile->getNumberOfBands());
-         result->setMaxPix(theTile->getMaxPix(), theTile->getNumberOfBands());
-      }
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimImageData> ossimEquationCombiner::getNewImageData(
-   ossim_uint32 index)
-{
-   ossimRefPtr<ossimImageData> result = getImageData(index);
-
-   if(result.valid())
-   {
-      if(result->getBuf())
-      {
-         result = (ossimImageData*)result->dup();
-      }
-   }
-
-   return result;
-}
-
-bool ossimEquationCombiner::parseExpression()
-{
-   // parse the following rule:
-   // expression : Term ResOfExpression
-   //
-   
-   bool result = false;
-   
-   if(parseTerm())
-   {
-      result =  parseRestOfExp();
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimImageData> ossimEquationCombiner::parseEquation()
-{
-   ostringstream s;
-
-   s << theEquation;
-
-   istringstream inS(s.str());
-   theLexer->switch_streams(&inS, &ossimNotify(ossimNotifyLevel_WARN));
-
-   theCurrentId = theLexer->yylex();
-
-   while(theCurrentId)
-   {
-      if(!parseExpression())
-      {
-         break;
-      }
-   }
-
-   if(!theValueStack.empty())
-   {
-      assignValue();
-      theTile->validate();
-      clearStacks();
-   }
-   
-   return theTile;
-}    
-
-bool ossimEquationCombiner::applyClamp(ossimImageData* &result,
-                                       const vector<ossimEquValue>& argList)
-{
-   if(result)
-   {
-      // Delete the object indirectly through an ossimRefPtr.
-      ossimRefPtr<ossimImageData> id = result;
-      id = NULL;
-      result = (ossimImageData*) NULL;
-   }
-   if(argList.size() <3)
-   {
-      return false;
-   }
-
-   if(argList[0].type == OSSIM_EQU_DOUBLE_TYPE)
-   {
-      return false;
-   }
-   else if( (argList[1].type == OSSIM_EQU_DOUBLE_TYPE)&&
-            (argList[2].type == OSSIM_EQU_DOUBLE_TYPE))
-   {
-      result = argList[0].d.imageDataValue;
-      
-      if(argList[0].d.imageDataValue)
-      {
-         ossimDataObjectStatus status = result->getDataObjectStatus();
-         if((status != OSSIM_NULL) &&
-            (status != OSSIM_EMPTY))
-         {
-            double minValue = argList[1].d.doubleValue;
-            double maxValue = argList[2].d.doubleValue;
-            
-            if(minValue > maxValue)
-            {
-               std::swap(minValue, maxValue);
-            }
-            
-            int band   = 0;
-            int offset = 0;
-            
-            int upperBoundBand   = result->getNumberOfBands();
-            int offsetUpperBound = result->getWidth()*result->getHeight();
-
-            if(status == OSSIM_PARTIAL)
-            {
-               for(band = 0; band < upperBoundBand; ++band)
-               {
-                  double np = static_cast<double>(result->getNullPix(band));
-                  double *buf = static_cast<double*>(result->getBuf(band));
-                  for(offset = 0; offset < offsetUpperBound; ++ offset)
-                  {
-                     if( *buf != np )
-                     {
-                        if( (*buf) < minValue) *buf = minValue;
-                        else if( (*buf) >maxValue) *buf = maxValue;
-                     }
-                     ++buf;
-                  }
-               }
-            }
-            else
-            {
-               for(band = 0; band < upperBoundBand; ++band)
-               {
-                  double *buf = static_cast<double*>(result->getBuf(band));
-                  for(offset = 0; offset < offsetUpperBound; ++ offset)
-                  {
-                     if( (*buf) < minValue) *buf = minValue;
-                     else if( (*buf) >maxValue) *buf = maxValue;
-                     ++buf;
-                  }
-               }
-            }
-         }
-      }
-         
-      return true;
-   }
-   return false;
-}
-
-bool ossimEquationCombiner::applyConvolution(ossimImageData* &result,
-                                             const vector<ossimEquValue>& argList)
-{
-   if(result)
-   {
-      // Delete the object indirectly through an ossimRefPtr.
-      ossimRefPtr<ossimImageData> id = result;
-      id = NULL;
-      result = (ossimImageData*) NULL;
-   }
-   if(argList.size() <4) return false;
-   
-   for(ossim_uint32 i = 0; i < argList.size(); ++i)
-   {
-      if(argList[i].type != OSSIM_EQU_DOUBLE_TYPE)
-      {
-         return false;
-      }
-   }
-
-   ossim_uint32 index = (ossim_uint32)argList[0].d.doubleValue;
-   int rows = (int)argList[1].d.doubleValue;
-   int cols = (int)argList[2].d.doubleValue;
-   
-   if((rows*cols) != (int)(argList.size()-3))
-   {
-      return false;
-   }
-   
-   NEWMAT::Matrix m(rows,cols);
-
-    int count = 3;
-    for(int r = 0; r< rows;++r)
-    {
-       for(int c=0;c<cols;++c)
-       {
-          m[r][c] = argList[count].d.doubleValue;
-          ++count;
-       }
-    }
-   ossimConnectableObject* obj = getInput(index);
-   if(obj)
-   {
-      ossimRefPtr<ossimConvolutionSource> conv = new ossimConvolutionSource(NULL, m);
-
-      conv->connectMyInputTo(0, obj);
-      theCastFilter->connectMyInputTo(0, conv.get());
-      
-      ossimRefPtr<ossimImageData> tempData =
-         theCastFilter->getTile(theTile->getImageRectangle(),
-                                theCurrentResLevel);
-      if(tempData.valid())
-      {
-         result = (ossimImageData*)tempData->dup();
-      }
-      else
-      {
-         result = (ossimImageData*)theTile->dup();
-      }
-      conv->disconnect();
-      conv = 0;
-   }
-   if(result)
-   {
-      return true;
-   }
-
-   return false;
-}
-
-bool ossimEquationCombiner::applyBlurr(ossimImageData* &result,
-                                       const vector<ossimEquValue>& argList)
-{
-   if(result)
-   {
-      // Delete the object indirectly through an ossimRefPtr.
-      ossimRefPtr<ossimImageData> id = result;
-      id = NULL;
-      result = (ossimImageData*) NULL;
-   }
-   if(argList.size() !=3) return false;
-   
-   for(ossim_uint32 i = 0; i < argList.size(); ++i)
-   {
-      if(argList[i].type != OSSIM_EQU_DOUBLE_TYPE)
-      {
-         return false;
-      }
-   }
-
-   ossim_uint32 index = (ossim_uint32)argList[0].d.doubleValue;
-   int rows = (int)argList[1].d.doubleValue;
-   int cols = (int)argList[2].d.doubleValue;
-   
-   NEWMAT::Matrix m(rows, cols);
-
-   m = 1.0/(rows*cols);
-
-   ossimConnectableObject* obj = getInput(index);
-   if(obj)
-   {
-      ossimRefPtr<ossimConvolutionSource> conv = new ossimConvolutionSource(NULL,
-                                                                m);
-
-      conv->connectMyInputTo(0, obj);
-      theCastFilter->connectMyInputTo(0, conv.get());
-      theCastFilter->initialize();
-
-      ossimRefPtr<ossimImageData> tempData =
-         theCastFilter->getTile(theTile->getImageRectangle(),
-                                theCurrentResLevel);
-      if(tempData.valid())
-      {
-         result = (ossimImageData*)tempData->dup();
-      }
-      conv->disconnect();
-      conv = 0;
-   }
-
-   if(result)
-   {
-      return true;
-   }
-
-   return false;
-}
-
-bool ossimEquationCombiner::applyShift(ossimImageData* &result,
-                                       const vector<ossimEquValue>& argList)
-{
-   if(result)
-   {
-      // Delete the object indirectly through an ossimRefPtr.
-      ossimRefPtr<ossimImageData> id = result;
-      id = NULL;
-      result = (ossimImageData*) NULL;
-   }
-   if(argList.size() !=3) return false;
-   
-   for(ossim_uint32 i = 0; i < argList.size(); ++i)
-   {
-      if(argList[i].type != OSSIM_EQU_DOUBLE_TYPE)
-      {
-         return false;
-      }
-   }
-
-   ossim_uint32 index = (ossim_uint32)argList[0].d.doubleValue;
-   int x = (int)argList[1].d.doubleValue;
-   int y = (int)argList[2].d.doubleValue;
-
-   ossimConnectableObject* obj = getInput(index);
-   if(obj)
-   {
-      ossimRefPtr<ossimSubImageTileSource> shiftSource =
-         new ossimSubImageTileSource(NULL, ossimIpt(x, y));
-
-      shiftSource->connectMyInputTo(0, obj);
-      theCastFilter->connectMyInputTo(0, shiftSource.get());
-
-       ossimRefPtr<ossimImageData> tempData =
-          theCastFilter->getTile(theTile->getImageRectangle(),
-                                 theCurrentResLevel);
-       if(tempData.valid())
-       {
-          result = (ossimImageData*)tempData->dup();
-       }
-      shiftSource->disconnect();
-      shiftSource = 0;
-   }
-
-   if(result)
-   {
-      return true;
-   }
-
-   return false;
-}
-
-bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
-                                    ossimEquValue& result,
-                                    ossimEquValue& v1,
-                                    ossimEquValue& v2)
-{
-   bool returnValue = true;
-   
-   if(v1.type == OSSIM_EQU_DOUBLE_TYPE)
-   {
-      if(v2.type == OSSIM_EQU_DOUBLE_TYPE)
-      {
-         result.type = OSSIM_EQU_DOUBLE_TYPE;
-         result.d.doubleValue = op.apply(v1.d.doubleValue, v2.d.doubleValue);
-      }
-      else if(v2.type == OSSIM_EQU_IMAGE_DATA_TYPE)
-      {
-         returnValue = applyOp(op,
-                               v1.d.doubleValue,
-                               v2.d.imageDataValue);
-         
-         result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-         result.d.imageDataValue = v2.d.imageDataValue;
-      }
-      else
-      {
-         returnValue = false;
-      }
-   }
-   else if(v1.type == OSSIM_EQU_IMAGE_DATA_TYPE)
-   {
-      if(v2.type == OSSIM_EQU_DOUBLE_TYPE)
-      {
-         
-         returnValue = applyOp(op,
-                               v1.d.imageDataValue,
-                               v2.d.doubleValue);
-         
-         result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-         result.d.imageDataValue = v1.d.imageDataValue;
-         returnValue = true;
-      }
-      else if(v2.type == OSSIM_EQU_IMAGE_DATA_TYPE)
-      {
-         returnValue = applyOp(op,
-                               v1.d.imageDataValue,
-                               v2.d.imageDataValue);
-         result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-         result.d.imageDataValue = v1.d.imageDataValue;
-
-         // Delete the object indirectly through an ossimRefPtr.
-         ossimRefPtr<ossimImageData> id = v2.d.imageDataValue;
-         id = NULL;
-         v2.d.imageDataValue = (ossimImageData*)NULL;
-         returnValue = true;
-      }
-      else
-      {
-         returnValue = false;
-      }
-   }
-   else
-   {
-      returnValue = false;
-   }
-   
-   return returnValue;
-}
-
-bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
-                                    ossimImageData* v1,
-                                    double          v2)
-{   
-   double* buf = static_cast<double*>(v1->getBuf());
-   if(!buf) return true;
-   ossimDataObjectStatus status = v1->getDataObjectStatus();
-
-   if(status == OSSIM_EMPTY || status == OSSIM_NULL)
-   {
-      return true;
-   }
-
-   if(status == OSSIM_FULL )
-   {
-      ossim_uint32 size = v1->getSize();
-      double value = (static_cast<double>(v2));
-     
-      for(ossim_uint32 i = 0; i < size; ++i)
-      {
-         *buf = (double)op.apply(*buf, value);
-         ++buf;
-      }
-   }
-   else
-   {
-      ossim_uint32 sizePerBand = v1->getSizePerBand();
-      ossim_uint32 numberOfBands = v1->getNumberOfBands();
-
-      if(numberOfBands)
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            double* buf = static_cast<double*>(v1->getBuf(band));
-
-            if(buf)
-            {
-               double  np  = static_cast<double>(v1->getNullPix()[band]);
-               
-               for(ossim_uint32 offset = 0; offset < sizePerBand;++offset)
-               {
-                  if(*buf != np)
-                  {
-                     *buf = (double)op.apply(*buf, v2);
-                  }
-                  ++buf;
-               }
-            }
-         }
-      }
-   }
-   return true;
-}
-
-bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
-                                    double          v1,
-                                    ossimImageData* v2)
-{   
-   double* buf = static_cast<double*>(v2->getBuf());
-   if(!buf) return true;
-   ossimDataObjectStatus status = v2->getDataObjectStatus();
-
-   if(status == OSSIM_EMPTY || status == OSSIM_NULL)
-   {
-      return true;
-   }
-
-   if(status == OSSIM_FULL )
-   {
-      ossim_uint32 size = v2->getSize();
-      double value = (static_cast<double>(v1));
-     
-      for(ossim_uint32 i = 0; i < size; ++i)
-      {
-         *buf = (double)op.apply(value, *buf);
-         ++buf;
-      }
-   }
-   else
-   {
-      ossim_uint32 sizePerBand = v2->getSizePerBand();
-      ossim_uint32 numberOfBands = v2->getNumberOfBands();
-
-      if(numberOfBands)
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            double* buf = static_cast<double*>(v2->getBuf(band));
-
-            if(buf)
-            {
-               double  np  = static_cast<double>(v2->getNullPix()[band]);
-               
-               for(ossim_uint32 offset = 0; offset < sizePerBand; ++offset)
-               {
-                  if(*buf != np)
-                  {
-                     *buf = (double)op.apply((double)v1, *buf);
-                  }
-                  ++buf;
-               }
-            }
-         }
-      }
-   }
-   
-   return true;
-}
-
-bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
-                                    ossimImageData* v1,
-                                    ossimImageData* v2)
-{
-   ossim_uint32 minNumberOfBands = std::min(v1->getNumberOfBands(), v2->getNumberOfBands());
-   ossim_uint32 maxNumberOfBands = std::max(v1->getNumberOfBands(), v2->getNumberOfBands());
-   
-   ossim_uint32 size = v1->getWidth()*v1->getHeight();
-   ossimDataObjectStatus status1 = v1->getDataObjectStatus();
-   ossimDataObjectStatus status2 = v2->getDataObjectStatus();
-
-   double** bandV1   = new double*[maxNumberOfBands];
-   double** bandV2   = new double*[maxNumberOfBands];
-   double* bandV1Np  = new double[maxNumberOfBands];
-   double* bandV2Np  = new double[maxNumberOfBands];
-   ossim_uint32 band = 0;
-   for(band = 0; band < minNumberOfBands; ++band)
-   {
-      bandV1[band]   = (double*)v1->getBuf(band);
-      bandV2[band]   = (double*)v2->getBuf(band);
-      bandV1Np[band] = (double)v1->getNullPix(band);
-      bandV2Np[band] = (double)v2->getNullPix(band);
-   }
-   if(v1->getNumberOfBands() < v2->getNumberOfBands())
-   {
-      for(band = 0; band < maxNumberOfBands; ++band)
-      {
-         bandV1[band]   = (double*)v1->getBuf(minNumberOfBands-1);
-         bandV2[band]   = (double*)v2->getBuf(band);
-         bandV1Np[band] = (double)v1->getNullPix(minNumberOfBands-1);
-         bandV2Np[band] = (double)v2->getNullPix(band);
-      }
-   }
-   else if(v2->getNumberOfBands() < v1->getNumberOfBands())
-   {
-      for(band = 0; band < maxNumberOfBands; ++band)
-      {
-         bandV1[band]   = (double*)v1->getBuf(band);
-         bandV2[band]   = (double*)v2->getBuf(minNumberOfBands-1);
-         bandV1Np[band] = (double)v1->getNullPix(band);
-         bandV2Np[band] = (double)v2->getNullPix(minNumberOfBands-1);
-      }
-   }
-
-   if(status1 == OSSIM_EMPTY)
-   {
-      if(status2 == OSSIM_FULL)
-      {
-         for(band = 0; band < maxNumberOfBands; ++band)
-         {
-            double* buf1 = bandV1[band];
-            double* buf2 = bandV2[band];
-            
-            for(ossim_uint32 i = 0; i < size; ++i)
-            {
-               *buf1 = *buf2;
-               ++buf1;
-               ++buf2;
-            }
-         }
-      }
-      else if(status2 == OSSIM_PARTIAL)
-      {
-         for(band = 0; band < maxNumberOfBands; ++band)
-         {
-            double* buf1 = bandV1[band];
-            double* buf2 = bandV2[band];
-            double  nullPix2 = bandV2Np[band];
-            for(ossim_uint32 i = 0; i < size; ++i)
-            {
-               if(*buf2 != nullPix2)
-               {
-                  *buf1 = *buf2;
-               }
-               ++buf1;
-               ++buf2;
-            }
-         }
-      }
-      v1->setDataObjectStatus(status2);
-   }
-   else if((status1 == OSSIM_FULL)&&
-           (status2 == OSSIM_FULL))
-   { 
-      for(band = 0; band < maxNumberOfBands; ++band)
-      {
-         double* buf1 = bandV1[band];
-         double* buf2 = bandV2[band];
-         
-         for(ossim_uint32 i = 0; i < size; ++i)
-         {
-            *buf1 = op.apply(*buf1, *buf2);
-            ++buf1;
-            ++buf2;
-         }
-      }
-   }
-   else if((status1 == OSSIM_FULL)&&
-           (status2 == OSSIM_PARTIAL))
-   {
-      for(band = 0; band < maxNumberOfBands; ++band)
-      {
-         double* buf1 = bandV1[band];
-         double* buf2 = bandV2[band];
-         double  nullPix2 = bandV2Np[band];
-         for(ossim_uint32 i = 0; i < size; ++i)
-         {
-            if(*buf2 != nullPix2)
-            {
-               *buf1 = op.apply(*buf1, *buf2);
-            }
-               
-            ++buf1;
-            ++buf2;
-         }
-      }
-   }
-   else if((status1 == OSSIM_PARTIAL)&&
-           (status2 == OSSIM_FULL))
-   {
-      for(band = 0; band < maxNumberOfBands; ++band)
-      {
-         double* buf1 = bandV1[band];
-         double* buf2 = bandV2[band];
-         double  nullPix1 = bandV1Np[band];
-         for(ossim_uint32 i = 0; i < size; ++i)
-         {
-            if(*buf1 != nullPix1)
-            {
-               *buf1 = op.apply(*buf1, *buf2);
-            }
-               
-            ++buf1;
-            ++buf2;
-         }
-      }
-   }
-   else if((status1 == OSSIM_PARTIAL)&&
-           (status2 == OSSIM_PARTIAL))
-   {
-      for(band = 0; band < maxNumberOfBands; ++band)
-      {
-         double* buf1 = bandV1[band];
-         double* buf2 = bandV2[band];
-         double  nullPix1 = bandV1Np[band];
-         double  nullPix2 = bandV2Np[band];
-         for(ossim_uint32 i = 0; i < size; ++i)
-         {
-            if((*buf1 != nullPix1)&&
-               (*buf2 != nullPix2))
-            {
-               *buf1 = op.apply(*buf1, *buf2);
-            }
-               
-            ++buf1;
-            ++buf2;
-         }
-      }
-   }
-
-   delete [] bandV1;
-   delete [] bandV2;
-   delete [] bandV1Np;
-   delete [] bandV2Np;
-   
-   return true;
-}
-
-
-bool ossimEquationCombiner::applyOp(const ossimUnaryOp& op,
-                                    ossimEquValue& result,
-                                    ossimEquValue& v)
-{
-   bool returnValue = true;
-   
-   if(v.type == OSSIM_EQU_DOUBLE_TYPE)
-   {
-      result.type = OSSIM_EQU_DOUBLE_TYPE;
-      result.d.doubleValue = op.apply(v.d.doubleValue);
-   }
-   else if(v.type == OSSIM_EQU_IMAGE_DATA_TYPE)
-   {
-      returnValue = applyOp(op,
-                            v.d.imageDataValue);
-      result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
-      result.d.imageDataValue = v.d.imageDataValue;
-      returnValue = true;
-   }
-   else
-   {
-      returnValue = false;
-   }
-   
-   return returnValue;
-}
-
-bool ossimEquationCombiner::applyOp(const ossimUnaryOp& op,
-                                    ossimImageData* v)
-{   
-   double* buf = static_cast<double*>(v->getBuf());
-   if(!buf) return true;
-   ossimDataObjectStatus status = v->getDataObjectStatus();
-
-   if(status == OSSIM_EMPTY || status == OSSIM_NULL)
-   {
-      return true;
-   }
-
-   if(status == OSSIM_FULL )
-   {
-      ossim_uint32 size = v->getSize();
-     
-      for(ossim_uint32 i = 0; i < size; ++i)
-      {
-         *buf = (double)op.apply(*buf);
-         ++buf;
-      }
-   }
-   else
-   {
-      ossim_uint32 sizePerBand   = v->getSizePerBand();
-      ossim_uint32 numberOfBands = v->getNumberOfBands();
-
-      if(numberOfBands)
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            double* buf = static_cast<double*>(v->getBuf(band));
-
-            if(buf)
-            {
-               double  np  = static_cast<double>(v->getNullPix()[band]);
-               
-               for(ossim_uint32 offset = 0; offset < sizePerBand;++offset)
-               {
-                  if(*buf != np)
-                  {
-                     *buf = (double)op.apply(*buf);
-                  }
-                  ++buf;
-               }
-            }
-         }
-      }
-   }
-   
-   return true;
-}
-
-bool ossimEquationCombiner::saveState(ossimKeywordlist& kwl,
-                                      const char* prefix)const
-{
-   ossimString outputScalarType =
-      ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType);
-   
-   kwl.add(prefix,
-           EQUATION_KW,
-           theEquation.c_str(),
-           true);
-
-   kwl.add(prefix,
-           "output_scalar_type",
-           outputScalarType.c_str(),
-           true);
-   
-   return ossimImageCombiner::saveState(kwl,
-                                        prefix);
-}
-
-bool ossimEquationCombiner::loadState(const ossimKeywordlist& kwl,
-                                      const char* prefix)
-{
-   const char* equ    = kwl.find(prefix, EQUATION_KW);
-   const char* scalar = kwl.find(prefix, "output_scalar_type");
-   
-   bool result = ossimImageCombiner::loadState(kwl,
-                                               prefix);
-   
-   if(equ)
-   {
-      theEquation = equ;
-   }
-
-   if(scalar)
-   {      
-      setOutputScalarType(ossimScalarTypeLut::instance()->
-                          getScalarTypeFromString(scalar));
-   }
-
-   return result;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimFeatherMosaic.cpp b/ossim/src/ossim/imaging/ossimFeatherMosaic.cpp
deleted file mode 100644
index a5eb157..0000000
--- a/ossim/src/ossim/imaging/ossimFeatherMosaic.cpp
+++ /dev/null
@@ -1,476 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimFeatherMosaic.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimFeatherMosaic.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimLine.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug("ossimFeatherMosaic:debug");
-
-RTTI_DEF1(ossimFeatherMosaic, "ossimFeatherMosaic", ossimImageMosaic);
-
-ossimFeatherMosaic::ossimFeatherMosaic()
-   :ossimImageMosaic(),
-    theInputFeatherInformation(NULL),
-    theAlphaSum(NULL),
-    theResult(NULL),
-    theFeatherInfoSize(0)
-{
-}
-
-ossimFeatherMosaic::ossimFeatherMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
-   :ossimImageMosaic(inputSources),
-    theInputFeatherInformation(NULL),
-    theAlphaSum(NULL),
-    theResult(NULL),
-    theFeatherInfoSize(0)
-{
-   initialize();
-}
-
-ossimFeatherMosaic::~ossimFeatherMosaic()
-{
-   if(theInputFeatherInformation)
-   {
-      delete [] theInputFeatherInformation;
-      theInputFeatherInformation = NULL;
-   }
-   theFeatherInfoSize = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimFeatherMosaic::getTile(const ossimIrect& tileRect,
-                                            ossim_uint32 resLevel)
-{
-   long w = tileRect.width();
-   long h = tileRect.height();
-   ossimIpt origin = tileRect.ul();
-   
-   if(!isSourceEnabled())
-   {
-      return ossimImageMosaic::getTile(tileRect, resLevel);
-   }
-   if(!theTile||!theAlphaSum||!theResult||!theInputFeatherInformation)
-   {
-      initialize();
-
-      if(!theTile||!theAlphaSum||!theResult||!theInputFeatherInformation)
-      {
-         return ossimImageMosaic::getTile(tileRect, resLevel);
-      }
-   }
-   ossim_uint32 size = getNumberOfInputs();
-   theAlphaSum->setImageRectangle(tileRect);
-   theResult->setImageRectangle(tileRect);
-   
-   if(size == 0)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   if(size == 1)
-   {
-      return ossimImageMosaic::getTile(tileRect, resLevel);
-   }
-
-   long tileW = theTile->getWidth();
-   long tileH = theTile->getHeight();
-   if((w != tileW)||
-      (h != tileH))
-   {
-      theTile->setWidth(w);
-      theTile->setHeight(h);
-      if((w*h)!=(tileW*tileH))
-      {
-         theTile->initialize();
-      }
-   }
-   theTile->setOrigin(origin);
-   theTile->makeBlank();
-      
-   switch(theTile->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         return combine(static_cast<ossim_uint8>(0),
-                        tileRect, resLevel);
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         return combine(static_cast<ossim_uint16>(0),
-                        tileRect, resLevel);
-      }
-      case OSSIM_SSHORT16:
-      {
-         return combine(static_cast<ossim_sint16>(0),
-                        tileRect, resLevel);
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         return combine(static_cast<double>(0),
-                        tileRect, resLevel);
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         return combine(static_cast<float>(0),
-                        tileRect, resLevel);
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimFeatherMosaic::getTile: error, unknown scalar type!!!"
-            << std::endl;
-      }
-   }
-   return ossimRefPtr<ossimImageData>();
-}
-
-
-template <class T> ossimRefPtr<ossimImageData> ossimFeatherMosaic::combine(
-   T,
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> currentImageData;
-   ossim_uint32 band;
-   long upperBound = theTile->getWidth()*theTile->getHeight();
-   long offset = 0;
-   long row    = 0;
-   long col    = 0;
-   long numberOfTilesProcessed = 0;
-   float *sumBand       = static_cast<float*>(theAlphaSum->getBuf());
-   float         *bandRes = NULL;
-   ossimIpt point;
-   
-   theAlphaSum->fill(0.0);
-   theResult->fill(0.0);
-   
-   T** srcBands  = new T*[theLargestNumberOfInputBands];
-   T** destBands = new T*[theLargestNumberOfInputBands];
-   ossim_uint32 layerIdx = 0;
-   currentImageData  = getNextTile(layerIdx,
-                                   0,
-                                   tileRect,
-                                   resLevel);
-   if(!currentImageData.valid())
-   {
-      delete [] srcBands;
-      delete [] destBands;
-      return currentImageData;
-   }
-   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-   for(band = 0; band < minNumberOfBands; ++band)
-   {
-      srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-   }
-   // if the src is smaller than the destination in number
-   // of bands we will just duplicate the last band.
-   for(;band < theLargestNumberOfInputBands; ++band)
-   {
-      srcBands[band]  = srcBands[minNumberOfBands - 1];
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-   }
-
-   // most of the time we will not overlap so let's
-   // copy the first tile into destination and check later.
-   //
-   for(band = 0; band < theTile->getNumberOfBands();++band)
-   {
-      T* destBand = destBands[band];
-      T* srcBand  = srcBands[band];
-      if(destBand&&srcBand)
-      {
-         for(offset = 0; offset < upperBound;++offset)
-         {
-            *destBand = *srcBand;
-            ++srcBand; ++destBand;
-         }
-      }
-   }
-   theTile->setDataObjectStatus(currentImageData->getDataObjectStatus());
-
-   while(currentImageData.valid())
-   {
-      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
-      point = currentImageData->getOrigin();
-      long h = (long)currentImageData->getHeight();
-      long w = (long)currentImageData->getWidth();
-      if( (currentStatus != OSSIM_EMPTY) &&
-          (currentStatus != OSSIM_NULL))
-      {
-         ++numberOfTilesProcessed;
-         offset = 0;
-         minNumberOfBands = currentImageData->getNumberOfBands();
-         for(band = 0; band < minNumberOfBands; ++band)
-         {
-            srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
-         }
-         // if the src is smaller than the destination in number
-         // of bands we will just duplicate the last band.
-         for(;band < theLargestNumberOfInputBands; ++band)
-         {
-            srcBands[band]  = srcBands[minNumberOfBands - 1];
-         }
-          if(currentStatus == OSSIM_PARTIAL)
-          {
-            for(row = 0; row < h; ++row)
-            {
-               for(col = 0; col < w; ++col)
-               {
-                  if(!currentImageData->isNull(offset))
-                  {
-                     double weight = computeWeight(layerIdx,
-                                                   ossimDpt(point.x+col,
-                                                            point.y+row));
-                     
-                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
-                     {
-                        bandRes = static_cast<float*>(theResult->getBuf(band));
-                        bandRes[offset] += (srcBands[band][offset]*weight);
-                     }
-                     sumBand[offset] += weight;
-                  }
-                  ++offset;
-               }
-            }
-         }
-         else
-         {
-            offset = 0;
-            
-            for(row = 0; row < h; ++row)
-            {
-               for(col = 0; col < w; ++col)
-               {
-                     double weight = computeWeight(layerIdx,
-                                                   ossimDpt(point.x+col,
-                                                            point.y+row));
-                     
-                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
-                     {
-                        bandRes     = static_cast<float*>(theResult->getBuf(band));
-                        
-                        bandRes[offset] += (srcBands[band][offset]*weight);
-                     }
-                     sumBand[offset] += weight;
-                     ++offset;
-               }
-            }
-         }
-      }
-      currentImageData = getNextTile(layerIdx, tileRect, resLevel);
-   }
-   upperBound = theTile->getWidth()*theTile->getHeight();
-
-   if(numberOfTilesProcessed > 1)
-   {
-      const double* minPix = theTile->getMinPix();
-      const double* maxPix = theTile->getMaxPix();
-      const double* nullPix= theTile->getNullPix();
-      for(offset = 0; offset < upperBound;++offset)
-      {
-         for(band = 0; band < theTile->getNumberOfBands();++band)
-         {
-            T* destBand      = static_cast<T*>(theTile->getBuf(band));
-            float* weightedBand = static_cast<float*>(theResult->getBuf(band));
-
-            // this should be ok to test 0.0 instead of
-            // FLT_EPSILON range for 0 since we set it.
-            if(sumBand[offset] != 0.0)
-            {            
-               weightedBand[offset] = (weightedBand[offset])/sumBand[offset];
-               if(weightedBand[offset]<minPix[band])
-               {
-                  weightedBand[offset] = minPix[band];   
-               }
-               else if(weightedBand[offset] > maxPix[band])
-               {
-                  weightedBand[offset] = maxPix[band];                   
-               }
-            }
-            else
-            {
-               weightedBand[offset] = nullPix[band];
-            }
-            destBand[offset] = static_cast<T>(weightedBand[offset]);
-         }
-      }
-      theTile->validate();
-   }
-
-   delete [] srcBands;
-   delete [] destBands;
-
-   return theTile;
-}
-
-double ossimFeatherMosaic::computeWeight(long index,
-                                         const ossimDpt& point)const
-{
-   ossimFeatherInputInformation& info = theInputFeatherInformation[index];
-   double result = 0.0;
-   ossimDpt delta = point-info.theCenter;
-   
-   double length1 = fabs(delta.x*info.theAxis1.x + delta.y*info.theAxis1.y)/info.theAxis1Length;
-   double length2 = fabs(delta.x*info.theAxis2.x + delta.y*info.theAxis2.y)/info.theAxis2Length;
-
-   if(length1 > length2)
-   {
-      result = (1.0 - length1);
-   }
-   else
-   {
-      result = (1.0 - length2);
-   }
-   if(result < 0) result = 0;
-   
-   return result;
-}
-
-void ossimFeatherMosaic::initialize()
-{
-   ossimImageMosaic::initialize();
-
-   allocate();
-   if(theTile.valid())
-   {
-      theAlphaSum = new ossimImageData(this,
-                                       OSSIM_FLOAT,
-                                       1,
-                                       theTile->getWidth(),
-                                       theTile->getHeight());
-      theResult = new ossimImageData(this,
-                                     OSSIM_FLOAT,
-                                     theLargestNumberOfInputBands,
-                                     theTile->getWidth(),
-                                     theTile->getHeight());
-      theAlphaSum->initialize();
-      theResult->initialize();
-   }
-   std::vector<ossimIpt> validVertices;
-   if(!getNumberOfInputs()) return;
-
-   if(theInputFeatherInformation)
-   {
-      delete [] theInputFeatherInformation;
-      theInputFeatherInformation = NULL;
-   }
-   theFeatherInfoSize = getNumberOfInputs();
-   theInputFeatherInformation = new ossimFeatherInputInformation[theFeatherInfoSize];
-   for(long index = 0; index < theFeatherInfoSize; ++ index)
-   {
-      validVertices.clear();
-      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(index));
-      if(temp)
-      {
-         temp->getValidImageVertices(validVertices, OSSIM_CLOCKWISE_ORDER);
-         theInputFeatherInformation[index].setVertexList(validVertices);
-      }
-   }
-}
-
-
-ossimFeatherMosaic::ossimFeatherInputInformation::ossimFeatherInputInformation(const std::vector<ossimIpt>& validVertices)
-{
-   setVertexList(validVertices);
-}
-
-
-void ossimFeatherMosaic::ossimFeatherInputInformation::setVertexList(const std::vector<ossimIpt>& validVertices)
-{
-   const char* MODULE = "ossimFeatherMosaic::ossimFeatherInputInformation::setVertexList()";
-   
-   theValidVertices = validVertices;
-
-   theCenter       = ossimDpt(0,0);
-   theAxis1        = ossimDpt(1, 0);
-   theAxis2        = ossimDpt(0, 1);
-   theAxis1Length  = 1;
-   theAxis2Length  = 1;
-
-   double xSum=0.0, ySum=0.0;
-   ossim_uint32 upperBound = (ossim_uint32)validVertices.size();
-   if(upperBound)
-   {
-      for(ossim_uint32 index = 0; index < upperBound; ++index)
-      {
-         xSum += validVertices[index].x;
-         ySum += validVertices[index].y;
-      }
-
-      theCenter.x = xSum/upperBound;
-      theCenter.y = ySum/upperBound;
-
-      // for now we just want a quick implementation of something
-      // and we know that we have 4 vertices for the bounding valid
-      // vertices.
-      //
-      if(upperBound == 4)
-      {
-         ossimDpt edgeDirection1 = validVertices[1] - validVertices[0];
-         ossimDpt edgeDirection2 = validVertices[2] - validVertices[1];
-
-         theAxis1 = ossimDpt(-edgeDirection1.y, edgeDirection1.x);
-         
-         theAxis2 = ossimDpt(-edgeDirection2.y, edgeDirection2.x);
-
-         theAxis1 = theAxis1/theAxis1.length();
-         theAxis2 = theAxis2/theAxis2.length();
-
-         ossimLine line1(theCenter,
-                         theCenter + theAxis1*2);
-         ossimLine line2(validVertices[1],
-                         validVertices[0]);
-         ossimLine line3(theCenter,
-                         theCenter + theAxis2*2);
-         ossimLine line4(validVertices[2],
-                         validVertices[1]);
-         
-         ossimDpt intersectionPoint1 = line1.intersectInfinite(line2);
-         ossimDpt intersectionPoint2 = line3.intersectInfinite(line4);
-
-         
-         theAxis1Length = ossim::round<int>((theCenter-intersectionPoint1).length());
-         theAxis2Length = ossim::round<int>((theCenter-intersectionPoint2).length());
-
-          if(traceDebug())
-          {
-             CLOG << "theAxis1Length:       " << theAxis1Length << endl
-                  << "theAxis2Length:       " << theAxis2Length << endl
-                  << "center:               " << theCenter      << endl;
-          }
-      }
-   }
-}
-
-ostream& operator<<(ostream& out,
-                    const ossimFeatherMosaic::ossimFeatherInputInformation& data)
-{
-   out << "center: " << data.theCenter << endl
-       << "axis1:  " << data.theAxis1  << endl
-       << "axis2:  " << data.theAxis2  << endl
-       << "axis1_length: " << data.theAxis1Length << endl
-       << "axis2_length: " << data.theAxis2Length << endl
-       << "valid vertices: " << endl;
-   std::copy(data.theValidVertices.begin(),
-             data.theValidVertices.end(),
-             std::ostream_iterator<ossimDpt>(out, "\n"));
-   return out;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimFftFilter.cpp b/ossim/src/ossim/imaging/ossimFftFilter.cpp
deleted file mode 100644
index 5ccef66..0000000
--- a/ossim/src/ossim/imaging/ossimFftFilter.cpp
+++ /dev/null
@@ -1,473 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimFftFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimFftFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/matrix/newmat.h>
-#include <ossim/matrix/newmatap.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/base/ossimStringProperty.h>
-
-RTTI_DEF1(ossimFftFilter, "ossimFftFilter", ossimImageSourceFilter);
-
-ossimFftFilter::ossimFftFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theTile(0),
-    theDirectionType(ossimFftFilterDirectionType_FORWARD),
-    theScalarRemapper(new ossimScalarRemapper())
-{
-   theScalarRemapper->setOutputScalarType(OSSIM_DOUBLE);
-}
-
-ossimFftFilter::ossimFftFilter(ossimImageSource* inputSource)
-   :ossimImageSourceFilter(inputSource),
-    theTile(0),
-    theDirectionType(ossimFftFilterDirectionType_FORWARD),
-    theScalarRemapper(new ossimScalarRemapper())
-{
-   theScalarRemapper->setOutputScalarType(OSSIM_DOUBLE);
-}
-
-ossimFftFilter::ossimFftFilter(ossimObject* owner,
-                               ossimImageSource* inputSource)
-   :ossimImageSourceFilter(owner, inputSource),
-    theTile(0),
-    theDirectionType(ossimFftFilterDirectionType_FORWARD),
-    theScalarRemapper(new ossimScalarRemapper())
-{
-   theScalarRemapper->setOutputScalarType(OSSIM_DOUBLE);
-}
-
-ossimFftFilter::~ossimFftFilter()
-{
-   if(theScalarRemapper.valid())
-   {
-      theScalarRemapper->disconnect();
-      theScalarRemapper = 0;
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimFftFilter::getTile(const ossimIrect& rect,
-                                                    ossim_uint32 resLevel)
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getTile(rect, resLevel);
-   }
-   
-   ossimIrect tempRequest = rect;
-
-   ossim_uint32 w = rect.width();
-   ossim_uint32 h = rect.height();
-   
-   if(w & 1)
-   {
-      ++w;
-   }
-   if(h&1)
-   {
-      ++h;
-   }
-
-   tempRequest = ossimIrect(rect.ul().x,
-                            rect.ul().y,
-                            rect.ul().x + (w-1),
-                            rect.ul().y + (h-1));
-   
-   ossimRefPtr<ossimImageData> input;
-   input  = theScalarRemapper->getTile(tempRequest, resLevel);
-
-   if(!input.valid()) return input;
-   
-   if(!theTile.valid()) initialize();
-   if(!theTile.valid()) return theTile;
-   
-   theTile->setImageRectangle(rect);
-   ossimRefPtr<ossimImageData> tempTile = theTile;
-   
-   if(!input->getBuf())
-   {
-      return theTile;
-   }
-
-   if(rect != tempRequest)
-   {
-      tempTile = (ossimImageData*)theTile->dup();
-      tempTile->setImageRectangle(tempRequest);
-   }
-
-   runFft((ossim_float64)0, input, tempTile);
-          
-   if(tempTile != theTile)
-   {
-      theTile->loadTile(tempTile.get());
-   }
-   
-   theTile->validate();
-
-   return theTile;
-}
-
-void ossimFftFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   theTile = ossimImageDataFactory::instance()->create(this, this);
-   
-   if(theTile.valid())
-   {
-      theTile->initialize();
-   }
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
-   }
-   else
-   {
-      theScalarRemapper->setOutputScalarType(OSSIM_DOUBLE);
-   }
-   theScalarRemapper->connectMyInputTo(0, getInput());
-}
-
-ossimScalarType ossimFftFilter::getOutputScalarType() const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getOutputScalarType();
-   }
-   
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      return OSSIM_DOUBLE;
-   }
-   
-   return OSSIM_NORMALIZED_DOUBLE;
-}
-
-double ossimFftFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getNullPixelValue(band);
-   }
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      return ossim::nan();
-   }
-
-   // it will invert to a normalized float output
-   return 0.0;
-}
-
-double ossimFftFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getMinPixelValue(band);
-   }
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      return OSSIM_DEFAULT_MIN_PIX_DOUBLE;
-   }
-   return OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
-}
-
-double ossimFftFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getMaxPixelValue(band);
-   }
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      return OSSIM_DEFAULT_MAX_PIX_DOUBLE;
-   }
-   return OSSIM_DEFAULT_MAX_PIX_NORM_DOUBLE;
-}
-
-ossim_uint32 ossimFftFilter::getNumberOfOutputBands() const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getNumberOfOutputBands();
-   }
-   ossim_uint32 bands = ossimImageSourceFilter::getNumberOfOutputBands();
-   
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      bands *=2;
-   }
-   else 
-   {
-      bands /=2;
-   }
-
-   return bands;
-}
-
-void ossimFftFilter::setForward()
-{
-   theDirectionType = ossimFftFilterDirectionType_FORWARD;
-}
-
-void ossimFftFilter::setInverse()
-{
-   theDirectionType = ossimFftFilterDirectionType_INVERSE;
-}
-
-ossimString ossimFftFilter::getDirectionTypeAsString()const
-{
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      return "Forward";
-   }
-
-   return "Inverse";
-}
-
-void ossimFftFilter::setDirectionType(const ossimString& directionType)
-{
-   ossimString tempDirectionType = directionType;
-   tempDirectionType = tempDirectionType.downcase();
-   
-   if(tempDirectionType.contains("forward"))
-   {
-      setDirectionType(ossimFftFilterDirectionType_FORWARD);
-   }
-   else
-   {
-      setDirectionType(ossimFftFilterDirectionType_INVERSE);
-   }
-}
-
-void ossimFftFilter::setDirectionType(ossimFftFilterDirectionType directionType)
-{
-   theDirectionType = directionType;
-   if(theTile.valid())
-   {
-      theTile = NULL;
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimFftFilter::getProperty(const ossimString& name)const
-{
-   if(name == "FFT Direction")
-   {
-      std::vector<ossimString> filterNames;
-      filterNames.push_back("Forward");
-      filterNames.push_back("Inverse");
-      ossimStringProperty* stringProp = new ossimStringProperty("FFT Direction",
-								getDirectionTypeAsString(),
-								false,
-								filterNames);
-      stringProp->setCacheRefreshBit();
-
-      return stringProp;
-   }
-
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimFftFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-   
-   if(property->getName() == "FFT Direction")
-   {
-      if(theTile.valid())
-      {
-         theTile = NULL;
-      }
-      setDirectionType(property->valueToString());
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-void ossimFftFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("FFT Direction");
-}
-
-
-template <class T>
-void ossimFftFilter::runFft(T /* dummy */,
-                            ossimRefPtr<ossimImageData>& input,
-                            ossimRefPtr<ossimImageData>& output)
-{
-   // T*             inputBand  = 0;
-
-   NEWMAT::Matrix* realIn = new NEWMAT::Matrix(input->getHeight(),
-                                               input->getWidth());
-   NEWMAT::Matrix* imgIn = new NEWMAT::Matrix(input->getHeight(),
-                                              input->getWidth());
-   NEWMAT::Matrix* realOut = new NEWMAT::Matrix(input->getHeight(),
-                                                input->getWidth());
-   NEWMAT::Matrix* imgOut = new NEWMAT::Matrix(input->getHeight(),
-                                               input->getWidth());
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 w = input->getWidth();
-   ossim_uint32 h = input->getHeight();
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   if(theDirectionType == ossimFftFilterDirectionType_FORWARD)
-   {
-      ossim_uint32 bands = input->getNumberOfBands();
-      for(bandIdx = 0; bandIdx < bands; ++bandIdx)
-      {
-         ossim_float64* bandReal = 0;
-         ossim_float64* bandImg  = 0;
-         fillMatrixForward((T*)input->getBuf(bandIdx),
-                           (T)input->getNullPix(bandIdx),
-                           *realIn,
-                           *imgIn);
-         NEWMAT::FFT2(*realIn, *imgIn, *realOut, *imgOut);
-         bandReal = (ossim_float64*)output->getBuf(2*bandIdx);
-         bandImg  = (ossim_float64*)output->getBuf(2*bandIdx + 1);
-         if(bandReal&&bandImg)
-         {
-            for(y = 0; y < h; ++y)
-            {
-               for(x = 0; x < w; ++x)
-               {
-                  *bandReal = (ossim_float64)((*realOut)[y][x]);
-                  *bandImg  = (ossim_float64)((*imgOut)[y][x]);
-                  ++bandReal;
-                  ++bandImg;
-               }
-            }
-         }
-      }
-   }
-   else
-   {
-      ossim_float64* bandReal = 0;
-      ossim_uint32 bands = input->getNumberOfBands();
-      for(bandIdx = 0; bandIdx < bands; bandIdx+=2)
-      {
-         bandReal = (ossim_float64*)output->getBuf(bandIdx/2);
-         if(input->getBuf(bandIdx)&&
-            input->getBuf(bandIdx+1))
-         {
-            fillMatrixInverse((T*)input->getBuf(bandIdx),
-                              (T*)input->getBuf(bandIdx+1),
-                              *realIn,
-                              *imgIn);
-            NEWMAT::FFT2I(*realIn, *imgIn, *realOut, *imgOut);
-            for(y = 0; y < h; ++y)
-            {
-               for(x = 0; x < w; ++x)
-               {
-                  *bandReal = (ossim_float64)((*realOut)[y][x]);
-                  if(*bandReal > 1.0)
-                  {
-                     *bandReal = 1.0;
-               }
-                  if(*bandReal < 0.0)
-                  {
-                     *bandReal = 0.0;
-                  }
-                  ++bandReal;
-               }
-            }
-         }
-      }
-   }
-   
-   delete realIn;
-   delete imgIn;
-   delete realOut;
-   delete imgOut;
-}
-
-template <class T>
-void ossimFftFilter::fillMatrixForward(T *realPart,
-                                       T nullPix,
-                                       NEWMAT::Matrix& real,
-                                       NEWMAT::Matrix& img)const
-{
-   ossim_uint32 w = real.Ncols();
-   ossim_uint32 h = real.Nrows();
-   ossim_uint32 yIdx = 0;
-   ossim_uint32 xIdx = 0;
-   
-   for(yIdx = 0; yIdx < h; ++yIdx)
-   {
-      for(xIdx = 0; xIdx < w; ++xIdx)
-      {
-         if((double)(*realPart) != nullPix)
-         {
-            real[yIdx][xIdx] = (double)(*realPart);
-         }
-         else
-         {
-            real[yIdx][xIdx] = 0.0;
-         }
-         
-         img[yIdx][xIdx]  = 0.0;
-         
-         ++realPart;
-      }
-   }
-}
-
-template <class T>
-void ossimFftFilter::fillMatrixInverse(T *realPart,
-                                       T *imgPart,
-                                       NEWMAT::Matrix& real,
-                                       NEWMAT::Matrix& img)const
-{
-   ossim_uint32 w = real.Ncols();
-   ossim_uint32 h = real.Nrows();
-   ossim_uint32 yIdx = 0;
-   ossim_uint32 xIdx = 0;
-   
-   for(yIdx = 0; yIdx < h; ++yIdx)
-   {
-      for(xIdx = 0; xIdx < w; ++xIdx)
-      {
-         real[yIdx][xIdx] = (double)(*realPart);
-         img[yIdx][xIdx]  = (double)(*imgPart);
-         
-         ++realPart;
-         ++imgPart;
-      }
-   }
-}
-
-
-bool ossimFftFilter::loadState(const ossimKeywordlist& kwl,
-                               const char* prefix)
-{
-   const char* direction = kwl.find(prefix, "fft_direction");
-   if(direction)
-   {
-      setDirectionType(ossimString(direction));
-   }
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-bool ossimFftFilter::saveState(ossimKeywordlist& kwl,
-                               const char* prefix)const
-{
-   kwl.add(prefix,
-           "fft_direction",
-           getDirectionTypeAsString(),
-           true);
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimFgdcFileWriter.cpp b/ossim/src/ossim/imaging/ossimFgdcFileWriter.cpp
deleted file mode 100644
index a1cc6c3..0000000
--- a/ossim/src/ossim/imaging/ossimFgdcFileWriter.cpp
+++ /dev/null
@@ -1,956 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class to write out meta data in a Federal Geographic Data
-// Committe (FGDC) format.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimFgdcFileWriter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <ossim/imaging/ossimFgdcFileWriter.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <fstream>
-using namespace std;
-
-RTTI_DEF1(ossimFgdcFileWriter, "ossimFgdcFileWriter", ossimMetadataFileWriter)
-
-static ossimTrace traceDebug("ossimFgdcFileWriter:debug");
-
-   
-ossimFgdcFileWriter::ossimFgdcFileWriter()
-   :
-   theIndentionLevel(0),
-   theTabString("\t"),
-   theTemplate(),
-   theSourceImageFilename()
-{
-}
-
-ossimFgdcFileWriter::~ossimFgdcFileWriter()
-{
-}
-
-bool ossimFgdcFileWriter::writeFile()
-{
-   if(theFilename == ossimFilename::NIL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimFgdcFileWriter::writeFile no filename set!" << endl;
-      return false;
-   }
-   
-   if( !theInputConnection )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimFgdcFileWriter::writeFile no input connection!" << endl;
-      return false;
-   }
-
-   ofstream os(theFilename.c_str());
-   if (!os)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimFgdcFileWriter::writeFile no input connection!" << endl;
-      return false;
-   }
-
-   // Get the geometry from the input.
-   ossimMapProjection* mapProj = 0;
-   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
-   if ( inputGeom.valid() ) mapProj = PTR_CAST(ossimMapProjection, inputGeom->getProjection());
-   if (!mapProj)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimFgdcFileWriter::writeFile Not map projected."
-         << endl;
-      return false;
-   }
-
-   ossimMapProjectionInfo mpi(mapProj, theInputConnection->getBoundingRect());
-
-   os << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"
-      << "<?xml-stylesheet type=\"text/xsl\" href=\"/common/fgdc_classic.xsl\" ?>\n";
-   openTag(os, ossimString("metadata"),  true);
-   openTag(os, ossimString("idinfo"),    true);
-   openTag(os, ossimString("citation"),  true);
-   openTag(os, ossimString("citeinfo"),  true);
-   
-   openTag(os, ossimString("origin"),    false);
-   os << find(ossimString("/metadata/idinfo/citation/citeinfo/origin"));
-   closeTag(os, ossimString("origin"),   false);
-   
-   openTag(os, ossimString("pubdate"),    false);
-   os << find(ossimString("/metadata/idinfo/citation/citeinfo/pubdate"));
-   closeTag(os, ossimString("pubdate"),   false);
-
-   openTag(os, ossimString("title"),    false);
-   // os << find(ossimString("/metadata/idinfo/citation/citeinfo/title"));
-   os << theSourceImageFilename.c_str();
-   closeTag(os, ossimString("title"),   false);
-
-   openTag(os, ossimString("edition"),    false);
-   os << find(ossimString("/metadata/idinfo/citation/citeinfo/edition"));
-   closeTag(os, ossimString("edition"),   false);
-
-   openTag(os, ossimString("geoform"),    false);
-   os << find(ossimString("/metadata/idinfo/citation/citeinfo/geoform"));
-   closeTag(os, ossimString("geoform"),   false);
-
-   openTag(os, ossimString("serinfo"),  true);
-   openTag(os, ossimString("sername"),    false);
-   os << find(ossimString("/metadata/idinfo/citation/citeinfo/serinfo/sername"));
-   closeTag(os, ossimString("sername"),   false);
-
-   openTag(os, ossimString("issue"),    false);
-   os << theSourceImageFilename.c_str();
-   closeTag(os, ossimString("issue"),   false);
-
-   closeTag(os, ossimString("serinfo"),  true);
-
-   openTag(os, ossimString("pubinfo"),  true);
-
-   openTag(os, ossimString("pubplace"),    false);
-   os << find(ossimString("/metadata/idinfo/citation/citeinfo/pubinfo/pubplace"));
-   closeTag(os, ossimString("pubplace"),   false);
-
-   openTag(os, ossimString("publish"),    false);
-   os << find(ossimString("/metadata/idinfo/citation/citeinfo/pubinfo/publish"));
-   closeTag(os, ossimString("publish"),   false);
-
-   closeTag(os, ossimString("pubinfo"),  true);
-   closeTag(os, ossimString("citeinfo"),  true);
-   closeTag(os, ossimString("citation"),  true);
-
-   openTag(os, ossimString("descript"),  true);
-
-   openTag(os, ossimString("abstract"),    false);
-   os << find(ossimString("/metadata/idinfo/descript/abstract"));
-   closeTag(os, ossimString("abstract"),   false);
-
-   openTag(os, ossimString("purpose"),    false);
-   os << find(ossimString("/metadata/idinfo/descript/purpose"));
-   closeTag(os, ossimString("purpose"),   false);
-
-   openTag(os, ossimString("supplinf"),    false);
-   os << find(ossimString("/metadata/idinfo/descript/supplinf"));
-   closeTag(os, ossimString("supplinf"),   false);
-
-   closeTag(os, ossimString("descript"),  true);
-
-   openTag(os, ossimString("timeperd"),  true);
-   openTag(os, ossimString("timeinfo"),  true);
-   openTag(os, ossimString("sngdate"),  true);
-
-   openTag(os, ossimString("caldate"),    false);
-   os << find(ossimString("/metadata/idinfo/timeperd/timeinfo/sngdate/caldate"));
-   closeTag(os, ossimString("caldate"),   false);
-   
-   closeTag(os, ossimString("sngdate"),  true);
-   closeTag(os, ossimString("timeinfo"),  true);
-
-   
-   openTag(os, ossimString("current"),    false);
-   os << find(ossimString("/metadata/idinfo/timeperd/current"));
-   closeTag(os, ossimString("current"),   false);
-
-   closeTag(os, ossimString("timeperd"),  true);
-
-   openTag(os, ossimString("status"),  true);
-
-   openTag(os, ossimString("progress"),    false);
-   os << find(ossimString("/metadata/idinfo/status/progress"));
-   closeTag(os, ossimString("progress"),   false);
-
-   openTag(os, ossimString("update"),    false);
-   os << find(ossimString("/metadata/idinfo/status/update"));
-   closeTag(os, ossimString("update"),   false);
-
-   closeTag(os, ossimString("status"),  true);
-
-   openTag(os, ossimString("spdom"),  true);
-   openTag(os, ossimString("bounding"),  true);
-
-   if (mapProj->isGeographic())
-   {
-      openTag(os, ossimString("westbc"),    false);
-      os << ossimString::toString(mpi.ulGroundPt().lon);
-      closeTag(os, ossimString("westbc"),   false);
-      
-      openTag(os, ossimString("eastbc"),    false);
-      os << ossimString::toString(mpi.lrGroundPt().lon);
-      closeTag(os, ossimString("eastbc"),   false);
-      
-      openTag(os, ossimString("northbc"),    false);
-      os << ossimString::toString(mpi.ulGroundPt().lat);
-      closeTag(os, ossimString("northbc"),   false);
-      
-      openTag(os, ossimString("southbc"),    false);
-      os << ossimString::toString(mpi.lrGroundPt().lat);
-      closeTag(os, ossimString("southbc"),   false);
-   }
-   else
-   {
-      openTag(os, ossimString("westbc"),    false);
-      os << ossimString::toString(mpi.ulEastingNorthingPt().x);
-      closeTag(os, ossimString("westbc"),   false);
-      
-      openTag(os, ossimString("eastbc"),    false);
-      os << ossimString::toString(mpi.lrEastingNorthingPt().x);
-      closeTag(os, ossimString("eastbc"),   false);
-      
-      openTag(os, ossimString("northbc"),    false);
-      os << ossimString::toString(mpi.ulEastingNorthingPt().y);
-      closeTag(os, ossimString("northbc"),   false);
-      
-      openTag(os, ossimString("southbc"),    false);
-      os << ossimString::toString(mpi.ulEastingNorthingPt().y);
-      closeTag(os, ossimString("southbc"),   false);
-   }
-   
-   closeTag(os, ossimString("bounding"),  true);
-   closeTag(os, ossimString("spdom"),    true);
-
-   openTag(os, ossimString("keywords"), true);
-
-   openTag(os, ossimString("theme"), true);
-
-   openTag(os, ossimString("themekt"), false);
-   os << find(ossimString("/metadata/idinfo/keywords/theme/themekt"));
-   closeTag(os, ossimString("themekt"), false);
-
-   openTag(os, ossimString("themekey"), false);
-   os << find(ossimString("/metadata/idinfo/keywords/theme/themekey"));
-   closeTag(os, ossimString("themekey"), false);
-   
-   closeTag(os, ossimString("theme"), true);
-
-   closeTag(os, ossimString("keywords"), true);
-
-   openTag(os, ossimString("accconst"), false);
-   os << find(ossimString("/metadata/idinfo/accconst"));
-   closeTag(os, ossimString("accconst"), false);
-
-   openTag(os, ossimString("useconst"), false);
-   os << find(ossimString("/metadata/idinfo/useconst"));
-   closeTag(os, ossimString("useconst"), false);
-
-   openTag(os, ossimString("ptcontac"), true);
-   
-   openTag(os, ossimString("cntinfo"), true);
-   
-   openTag(os, ossimString("cntperp"), true);
-   openTag(os, ossimString("cntper"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntperp/cntper"));
-   closeTag(os, ossimString("cntper"), false);
-   closeTag(os, ossimString("cntperp"), true);
-
-   openTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("addrtype"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/addrtype"));
-   closeTag(os, ossimString("addrtype"), false);
-
-   openTag(os, ossimString("address"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/address"));
-   closeTag(os, ossimString("address"), false);
-
-   openTag(os, ossimString("city"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/city"));
-   closeTag(os, ossimString("city"), false);
-
-   openTag(os, ossimString("state"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/state"));
-   closeTag(os, ossimString("state"), false);
-
-   openTag(os, ossimString("postal"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/postal"));
-   closeTag(os, ossimString("postal"), false);
-
-   openTag(os, ossimString("country"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/country"));
-   closeTag(os, ossimString("country"), false);
-
-   closeTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("cntvoice"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntvoice"));
-   closeTag(os, ossimString("cntvoice"), false);
-  
-   openTag(os, ossimString("cntfax"), false);
-
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntfax"));
-   closeTag(os, ossimString("cntfax"), false);
-  
-   openTag(os, ossimString("cntemail"), false);
-   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntemail"));
-   closeTag(os, ossimString("cntemail"), false);
-   
-   closeTag(os, ossimString("cntinfo"), true);
-   closeTag(os, ossimString("ptcontac"), true);
-
-   openTag(os, ossimString("secinfo"), true);
-
-   openTag(os, ossimString("secclass"), false);
-   os << find(ossimString("/metadata/idinfo/secinfo/secclass"));
-   closeTag(os, ossimString("secclass"), false);
-
-   openTag(os, ossimString("secsys"), false);
-   os << find(ossimString("/metadata/idinfo/secinfo/secsys"));
-   closeTag(os, ossimString("secsys"), false);
-
-   openTag(os, ossimString("sechandl"), false);
-   os << find(ossimString("/metadata/idinfo/secinfo/sechandl"));
-   closeTag(os, ossimString("sechandl"), false);
-
-   closeTag(os, ossimString("secinfo"), true);
-   closeTag(os, ossimString("idinfo"), true);
-   
-   openTag(os, ossimString("distinfo"), true);
-   openTag(os, ossimString("distrib"), true);
-   openTag(os, ossimString("cntinfo"), true);
-   openTag(os, ossimString("cntperp"), true);
-   openTag(os, ossimString("cntper"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntperp/cntper"));
-
-   closeTag(os, ossimString("cntper"), false);
-   closeTag(os, ossimString("cntperp"), true);
-
-   openTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("addrtype"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/addrtype"));
-   closeTag(os, ossimString("addrtype"), false);
-
-   openTag(os, ossimString("address"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/address"));
-   closeTag(os, ossimString("address"), false);
-
-   openTag(os, ossimString("city"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/city"));
-   closeTag(os, ossimString("city"), false);
-
-   openTag(os, ossimString("state"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/state"));
-   closeTag(os, ossimString("state"), false);
-
-   openTag(os, ossimString("postal"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/postal"));
-   closeTag(os, ossimString("postal"), false);
-
-   openTag(os, ossimString("country"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/country"));
-   closeTag(os, ossimString("country"), false);
-
-   closeTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("cntvoice"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntvoice"));
-   closeTag(os, ossimString("cntvoice"), false);
-  
-   openTag(os, ossimString("cntfax"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntfax"));
-   closeTag(os, ossimString("cntfax"), false);
-  
-   openTag(os, ossimString("cntemail"), false);
-   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntemail"));
-   closeTag(os, ossimString("cntemail"), false);
-   
-   closeTag(os, ossimString("cntinfo"), true);
-   closeTag(os, ossimString("distrib"), true);
-
-   openTag(os, ossimString("resdesc"), false);
-   os << find(ossimString("/metadata/distinfo/resdesc"));
-   closeTag(os, ossimString("resdesc"), false);
-
-   openTag(os, ossimString("distliab"), false);
-   os << find(ossimString("/metadata/distinfo/distliab"));
-   closeTag(os, ossimString("distliab"), false);
-
-   openTag(os, ossimString("stdorder"), true);
-   openTag(os, ossimString("digform"), true);
-   openTag(os, ossimString("digtinfo"), true);
-   
-   openTag(os, ossimString("formname"), false);
-   os << find(ossimString("/metadata/distinfo/stdorder/digform/digtinfo/formname"));
-   closeTag(os, ossimString("formname"), false);
-
-   closeTag(os, ossimString("digtinfo"), true);
-
-   openTag(os, ossimString("digtopt"), true);
-   openTag(os, ossimString("onlinopt"), true);   
-   openTag(os, ossimString("computer"), true);
-   openTag(os, ossimString("networka"), true);
-
-   openTag(os, ossimString("networkr"), false);
-   os << find(ossimString("/metadata/distinfo/stdorder/digform/digtopt/onlinopt/computer/networka/networkr"));
-   closeTag(os, ossimString("networkr"), false);
-
-   closeTag(os, ossimString("networka"), true);
-   closeTag(os, ossimString("computer"), true);
-   closeTag(os, ossimString("onlinopt"), true);
-   closeTag(os, ossimString("digtopt"), true);
-   closeTag(os, ossimString("digform"), true);
-
-   openTag(os, ossimString("fees"), false);
-   os << find(ossimString("/metadata/distinfo/stdorder/fees"));
-   closeTag(os, ossimString("fees"), false);
-
-   closeTag(os, ossimString("stdorder"), true);
-   closeTag(os, ossimString("distinfo"), true);
-
-   openTag(os, ossimString("metainfo"), true);
-
-   openTag(os, ossimString("metd"), false);
-   os << find(ossimString("/metadata/metainfo/metd"));
-   closeTag(os, ossimString("metd"), false);
-
-   openTag(os, ossimString("metc"), true);
-   openTag(os, ossimString("cntinfo"), true);
-   openTag(os, ossimString("cntperp"), true);
-   
-   openTag(os, ossimString("cntper"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntperp/cntper"));
-   closeTag(os, ossimString("cntper"), false);
-
-   closeTag(os, ossimString("cntperp"), true);
-   
-   openTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("addrtype"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/addrtype"));
-   closeTag(os, ossimString("addrtype"), false);
-
-   openTag(os, ossimString("address"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/address"));
-   closeTag(os, ossimString("address"), false);
-
-   openTag(os, ossimString("city"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/city"));
-   closeTag(os, ossimString("city"), false);
-
-   openTag(os, ossimString("state"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/state"));
-   closeTag(os, ossimString("state"), false);
-
-   openTag(os, ossimString("postal"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/postal"));
-   closeTag(os, ossimString("postal"), false);
-
-   openTag(os, ossimString("country"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/country"));
-   closeTag(os, ossimString("country"), false);
-
-   closeTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("cntvoice"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntvoice"));
-   closeTag(os, ossimString("cntvoice"), false);
-  
-   openTag(os, ossimString("cntfax"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntfax"));
-   closeTag(os, ossimString("cntfax"), false);
-  
-   openTag(os, ossimString("cntemail"), false);
-   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntemail"));
-   closeTag(os, ossimString("cntemail"), false);
-   
-   closeTag(os, ossimString("cntinfo"), true);
-   closeTag(os, ossimString("metc"), true);
-
-   openTag(os, ossimString("metstdn"), false);
-   os << find(ossimString("/metadata/metainfo/metstdn"));
-   closeTag(os, ossimString("metstdn"), false);
-
-   openTag(os, ossimString("metstdv"), false);
-   os << find(ossimString("/metadata/metainfo/metstdv"));
-   closeTag(os, ossimString("metstdv"), false);
-
-   closeTag(os, ossimString("metainfo"), true);
-   closeTag(os, ossimString("metadata"), true);
-
-   os.close();
-
-   return true;
-}
-
-bool ossimFgdcFileWriter::writeTemplate(const ossimFilename& file) const
-{
-   ofstream os(file.c_str());
-   if (!os)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimFgdcFileWriter::writeTemplate Could not open: " << file
-         << endl;
-      return false;
-   }
-
-   os << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"
-      << "<?xml-stylesheet type=\"text/xsl\" href=\"/common/fgdc_classic.xsl\" ?>\n";
-   openTag(os, ossimString("metadata"),  true);
-   openTag(os, ossimString("idinfo"),    true);
-   openTag(os, ossimString("citation"),  true);
-   openTag(os, ossimString("citeinfo"),  true);
-   
-   openTag(os, ossimString("origin"),    false);
-   closeTag(os, ossimString("origin"),   false);
-   
-   openTag(os, ossimString("pubdate"),    false);
-   closeTag(os, ossimString("pubdate"),   false);
-
-   openTag(os, ossimString("title"),    false);
-   closeTag(os, ossimString("title"),   false);
-
-   openTag(os, ossimString("edition"),    false);
-   closeTag(os, ossimString("edition"),   false);
-
-   openTag(os, ossimString("geoform"),    false);
-   closeTag(os, ossimString("geoform"),   false);
-
-   openTag(os, ossimString("serinfo"),  true);
-   openTag(os, ossimString("sername"),    false);
-
-   closeTag(os, ossimString("sername"),   false);
-
-   openTag(os, ossimString("issue"),    false);
-   closeTag(os, ossimString("issue"),   false);
-
-   closeTag(os, ossimString("serinfo"),  true);
-
-   openTag(os, ossimString("pubinfo"),  true);
-
-   openTag(os, ossimString("pubplace"),    false);
-
-   closeTag(os, ossimString("pubplace"),   false);
-
-   openTag(os, ossimString("publish"),    false);
-   closeTag(os, ossimString("publish"),   false);
-
-   closeTag(os, ossimString("pubinfo"),  true);
-   closeTag(os, ossimString("citeinfo"),  true);
-   closeTag(os, ossimString("citation"),  true);
-
-   openTag(os, ossimString("descript"),  true);
-
-   openTag(os, ossimString("abstract"),    false);
-   closeTag(os, ossimString("abstract"),   false);
-
-   openTag(os, ossimString("purpose"),    false);
-   closeTag(os, ossimString("purpose"),   false);
-
-   openTag(os, ossimString("supplinf"),    false);
-   closeTag(os, ossimString("supplinf"),   false);
-
-   closeTag(os, ossimString("descript"),  true);
-
-   openTag(os, ossimString("timeperd"),  true);
-   openTag(os, ossimString("timeinfo"),  true);
-   openTag(os, ossimString("sngdate"),  true);
-
-   openTag(os, ossimString("caldate"),    false);
-   closeTag(os, ossimString("caldate"),   false);
-   
-   closeTag(os, ossimString("sngdate"),  true);
-   closeTag(os, ossimString("timeinfo"),  true);
-
-   
-   openTag(os, ossimString("current"),    false);
-   closeTag(os, ossimString("current"),   false);
-
-   closeTag(os, ossimString("timeperd"),  true);
-
-   openTag(os, ossimString("status"),  true);
-
-   openTag(os, ossimString("progress"),    false);
-   closeTag(os, ossimString("progress"),   false);
-
-   openTag(os, ossimString("update"),    false);
-   closeTag(os, ossimString("update"),   false);
-
-   closeTag(os, ossimString("status"),  true);
-
-   openTag(os, ossimString("spdom"),  true);
-   openTag(os, ossimString("bounding"),  true);
-
-   openTag(os, ossimString("westbc"),    false);
-   closeTag(os, ossimString("westbc"),   false);
-   openTag(os, ossimString("eastbc"),    false);
-
-   closeTag(os, ossimString("eastbc"),   false);
-   openTag(os, ossimString("northbc"),    false);
-
-   closeTag(os, ossimString("northbc"),   false);
-   openTag(os, ossimString("southbc"),    false);
-
-   closeTag(os, ossimString("southbc"),   false);
-
-   closeTag(os, ossimString("bounding"),  true);
-   closeTag(os, ossimString("spdom"),    true);
-
-   openTag(os, ossimString("keywords"), true);
-
-   openTag(os, ossimString("theme"), true);
-
-   openTag(os, ossimString("themekt"), false);
-   closeTag(os, ossimString("themekt"), false);
-
-   openTag(os, ossimString("themekey"), false);
-   closeTag(os, ossimString("themekey"), false);
-   
-   closeTag(os, ossimString("theme"), true);
-
-   closeTag(os, ossimString("keywords"), true);
-
-   openTag(os, ossimString("accconst"), false);
-   closeTag(os, ossimString("accconst"), false);
-
-   openTag(os, ossimString("useconst"), false);
-   closeTag(os, ossimString("useconst"), false);
-
-   openTag(os, ossimString("ptcontac"), true);
-   
-   openTag(os, ossimString("cntinfo"), true);
-   
-   openTag(os, ossimString("cntperp"), true);
-   openTag(os, ossimString("cntper"), false);
-   closeTag(os, ossimString("cntper"), false);
-   closeTag(os, ossimString("cntperp"), true);
-
-   openTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("addrtype"), false);
-   closeTag(os, ossimString("addrtype"), false);
-
-   openTag(os, ossimString("address"), false);
-   closeTag(os, ossimString("address"), false);
-
-   openTag(os, ossimString("city"), false);
-   closeTag(os, ossimString("city"), false);
-
-   openTag(os, ossimString("state"), false);
-   closeTag(os, ossimString("state"), false);
-
-   openTag(os, ossimString("postal"), false);
-   closeTag(os, ossimString("postal"), false);
-
-   openTag(os, ossimString("country"), false);
-   closeTag(os, ossimString("country"), false);
-
-   closeTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("cntvoice"), false);
-   closeTag(os, ossimString("cntvoice"), false);
-  
-   openTag(os, ossimString("cntfax"), false);
-   closeTag(os, ossimString("cntfax"), false);
-  
-   openTag(os, ossimString("cntemail"), false);
-   closeTag(os, ossimString("cntemail"), false);
-   
-   closeTag(os, ossimString("cntinfo"), true);
-   
-   closeTag(os, ossimString("ptcontac"), true);
-
-   openTag(os, ossimString("secinfo"), true);
-   openTag(os, ossimString("secclass"), false);
-   closeTag(os, ossimString("secclass"), false);
-   openTag(os, ossimString("secsys"), false);
-   closeTag(os, ossimString("secsys"), false);
-   openTag(os, ossimString("sechandl"), false);
-   closeTag(os, ossimString("sechandl"), false);
-   closeTag(os, ossimString("secinfo"), true);
-
-   closeTag(os, ossimString("idinfo"), true);
-
-   openTag(os, ossimString("distinfo"), true);
-   openTag(os, ossimString("distrib"), true);
-   openTag(os, ossimString("cntinfo"), true);
-   openTag(os, ossimString("cntperp"), true);
-   openTag(os, ossimString("cntper"), false);
-   closeTag(os, ossimString("cntper"), false);
-   closeTag(os, ossimString("cntperp"), true);
-
-   openTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("addrtype"), false);
-   closeTag(os, ossimString("addrtype"), false);
-
-   openTag(os, ossimString("address"), false);
-   closeTag(os, ossimString("address"), false);
-
-   openTag(os, ossimString("city"), false);
-   closeTag(os, ossimString("city"), false);
-
-   openTag(os, ossimString("state"), false);
-   closeTag(os, ossimString("state"), false);
-
-   openTag(os, ossimString("postal"), false);
-   closeTag(os, ossimString("postal"), false);
-
-   openTag(os, ossimString("country"), false);
-   closeTag(os, ossimString("country"), false);
-
-   closeTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("cntvoice"), false);
-   closeTag(os, ossimString("cntvoice"), false);
-  
-   openTag(os, ossimString("cntfax"), false);
-   closeTag(os, ossimString("cntfax"), false);
-  
-   openTag(os, ossimString("cntemail"), false);
-   closeTag(os, ossimString("cntemail"), false);
-   
-   closeTag(os, ossimString("cntinfo"), true);
-   closeTag(os, ossimString("distrib"), true);
-
-   openTag(os, ossimString("resdesc"), false);
-   closeTag(os, ossimString("resdesc"), false);
-
-   openTag(os, ossimString("distliab"), false);
-   closeTag(os, ossimString("distliab"), false);
-
-   openTag(os, ossimString("stdorder"), true);
-   openTag(os, ossimString("digform"), true);
-   openTag(os, ossimString("digtinfo"), true);
-   
-   openTag(os, ossimString("formname"), false);
-   closeTag(os, ossimString("formname"), false);
-
-   closeTag(os, ossimString("digtinfo"), true);
-
-   openTag(os, ossimString("digtopt"), true);
-   openTag(os, ossimString("onlinopt"), true);   
-   openTag(os, ossimString("computer"), true);
-   openTag(os, ossimString("networka"), true);
-
-   openTag(os, ossimString("networkr"), false);
-   closeTag(os, ossimString("networkr"), false);
-
-   closeTag(os, ossimString("networka"), true);
-   closeTag(os, ossimString("computer"), true);
-   closeTag(os, ossimString("onlinopt"), true);
-   closeTag(os, ossimString("digtopt"), true);
-   closeTag(os, ossimString("digform"), true);
-
-   openTag(os, ossimString("fees"), false);
-   closeTag(os, ossimString("fees"), false);
-
-   closeTag(os, ossimString("stdorder"), true);
-   closeTag(os, ossimString("distinfo"), true);
-
-   openTag(os, ossimString("metainfo"), true);
-
-   openTag(os, ossimString("metd"), false);
-   closeTag(os, ossimString("metd"), false);
-
-   openTag(os, ossimString("metc"), true);
-   openTag(os, ossimString("cntinfo"), true);
-   openTag(os, ossimString("cntperp"), true);
-   
-   openTag(os, ossimString("cntper"), false);
-   closeTag(os, ossimString("cntper"), false);
-
-   closeTag(os, ossimString("cntperp"), true);
-   
-   openTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("addrtype"), false);
-   closeTag(os, ossimString("addrtype"), false);
-
-   openTag(os, ossimString("address"), false);
-   closeTag(os, ossimString("address"), false);
-
-   openTag(os, ossimString("city"), false);
-   closeTag(os, ossimString("city"), false);
-
-   openTag(os, ossimString("state"), false);
-   closeTag(os, ossimString("state"), false);
-
-   openTag(os, ossimString("postal"), false);
-   closeTag(os, ossimString("postal"), false);
-
-   openTag(os, ossimString("country"), false);
-   closeTag(os, ossimString("country"), false);
-
-   closeTag(os, ossimString("cntaddr"), true);
-
-   openTag(os, ossimString("cntvoice"), false);
-   closeTag(os, ossimString("cntvoice"), false);
-  
-   openTag(os, ossimString("cntfax"), false);
-   closeTag(os, ossimString("cntfax"), false);
-  
-   openTag(os, ossimString("cntemail"), false);
-   closeTag(os, ossimString("cntemail"), false);
-   
-   closeTag(os, ossimString("cntinfo"), true);
-   closeTag(os, ossimString("metc"), true);
-
-   openTag(os, ossimString("metstdn"), false);
-   closeTag(os, ossimString("metstdn"), false);
-
-   openTag(os, ossimString("metstdv"), false);
-   closeTag(os, ossimString("metstdv"), false);
-
-   closeTag(os, ossimString("metainfo"), true);
-   closeTag(os, ossimString("metadata"), true);
-
-   os.close();
-
-	if(traceDebug())
-	{
-		ossimNotify(ossimNotifyLevel_NOTICE)
-      << "Wrote file:  " << file.c_str() << endl;
-	}
-   
-   return true;
-}
-   
-bool ossimFgdcFileWriter::loadState (const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   const char* lookup = kwl.find(prefix, "template");
-   if (lookup)
-   {
-      setTemplate(ossimFilename(lookup));
-   }
-   lookup = kwl.find(prefix, "source_image_filename");
-   if (lookup)
-   {
-      theSourceImageFilename = lookup;
-   }
-   lookup = kwl.find(prefix, "tab_string");
-   if (lookup)
-   {
-      theTabString = lookup;
-   }
-   lookup = kwl.find(prefix, "fgdc_template_doc");
-   if (lookup)
-   {
-      setTemplate(ossimFilename(lookup));
-   }
-   
-   return ossimMetadataFileWriter::loadState(kwl, prefix);
-}
-
-ossim_uint32 ossimFgdcFileWriter::getIndentionLevel() const
-{
-   return theIndentionLevel;
-}
-
-void ossimFgdcFileWriter::setIndentionLevel(ossim_uint32 level)
-{
-   theIndentionLevel = level;
-}
-
-ossimString ossimFgdcFileWriter::getTabString() const
-{
-   return theTabString;
-}
-
-void ossimFgdcFileWriter::setTabString(const ossimString& tabString)
-{
-   theTabString = tabString;
-}
-
-void ossimFgdcFileWriter::openTag(std::ostream& os,
-                                  const ossimString& tag,
-                                  bool newLine) const
-{
-   if ( theIndentionLevel && theTabString.size() )
-   {
-      ossimString tab;
-      for (ossim_uint32 i = 0; i < theIndentionLevel; ++i)
-      {
-         tab += theTabString;
-      }
-
-      os << tab.c_str();
-   }
-   
-   os << "<" << tag.c_str() << ">";
-
-   if (newLine)
-   {
-      os << "\n";
-      ++theIndentionLevel;
-   }
-}
-
-void ossimFgdcFileWriter::closeTag(std::ostream& os,
-                                   const ossimString& tag,
-                                   bool decrementLevel) const
-{
-   if ( decrementLevel && (theIndentionLevel > 1) && theTabString.size() )
-   {
-      ossimString tab;
-      for (ossim_uint32 i = 0; i < theIndentionLevel-1; ++i)
-      {
-         tab += theTabString;
-      }
-
-      os << tab.c_str();
-   }
-   
-   os << "</" << tag.c_str() << ">\n";
-
-   if (theIndentionLevel && decrementLevel)
-   {
-      --theIndentionLevel;
-   }
-}
-
-void ossimFgdcFileWriter::setTemplate(const ossimFilename& xmlTemplateFile)
-{
-   theTemplate.openFile(xmlTemplateFile);
-}
-
-ossimString ossimFgdcFileWriter::find(const ossimString& xpath) const
-{
-   ossimString result;
-
-   if (theTemplate.getErrorStatus())
-   {
-      return result;
-   }
-   
-   vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
-   theTemplate.findNodes(xpath, xml_nodes);
-
-   if (xml_nodes.size())
-   {
-      if (xml_nodes[0].valid())
-      {
-         result = xml_nodes[0]->getText();
-      }
-   }
-   return result;
-}
-
-void ossimFgdcFileWriter::getMetadatatypeList(
-   std::vector<ossimString>& metadatatypeList) const
-{
-   metadatatypeList.push_back(ossimString("ossim_fgdc")); 
-}
-
-bool ossimFgdcFileWriter::hasMetadataType(
-   const ossimString& metadataType)const
-{
-   return (metadataType == "ossim_fgdc");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimFilter.cpp b/ossim/src/ossim/imaging/ossimFilter.cpp
deleted file mode 100644
index 41515b4..0000000
--- a/ossim/src/ossim/imaging/ossimFilter.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%                        ZZZZZ   OOO    OOO   M   M                           %
-%                           ZZ  O   O  O   O  MM MM                           %
-%                         ZZZ   O   O  O   O  M M M                           %
-%                        ZZ     O   O  O   O  M   M                           %
-%                        ZZZZZ   OOO    OOO   M   M                           %
-%                                                                             %
-%                                                                             %
-%                      ImageMagick Image Zoom Methods                         %
-%                                                                             %
-%                                                                             %
-%                              Software Design                                %
-%                                John Cristy                                  %
-%                                 July 1992                                   %
-%                                                                             %
-%                                                                             %
-%  Copyright (C) 2000 ImageMagick Studio, a non-profit organization dedicated %
-%  to making software imaging solutions freely available.                     %
-%                                                                             %
-%  Permission is hereby granted, free of charge, to any person obtaining a    %
-%  copy of this software and associated documentation files ("ImageMagick"),  %
-%  to deal in ImageMagick without restriction, including without limitation   %
-%  the rights to use, copy, modify, merge, publish, distribute, sublicense,   %
-%  and/or sell copies of ImageMagick, and to permit persons to whom the       %
-%  ImageMagick is furnished to do so, subject to the following conditions:    %
-%                                                                             %
-%  The above copyright notice and this permission notice shall be included in %
-%  all copies or substantial portions of ImageMagick.                         %
-%                                                                             %
-%  The software is provided "as is", without warranty of any kind, express or %
-%  implied, including but not limited to the warranties of merchantability,   %
-%  fitness for a particular purpose and noninfringement.  In no event shall   %
-%  ImageMagick Studio be liable for any claim, damages or other liability,    %
-%  whether in an action of contract, tort or otherwise, arising from, out of  %
-%  or in connection with ImageMagick or the use or other dealings in          %
-%  ImageMagick.                                                               %
-%                                                                             %
-%  Except as contained in this notice, the name of the ImageMagick Studio     %
-%  shall not be used in advertising or otherwise to promote the sale, use or  %
-%  other dealings in ImageMagick without prior written authorization from the %
-%  ImageMagick Studio.                                                        %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%
-%
-*/
-#include <ossim/base/ossimConstants.h>
-#include <ossim/imaging/ossimFilter.h>
-#include <ossim/matrix/newmat.h>
-#include <iostream>
-
-
-RTTI_DEF(ossimFilter, "ossimFilter");
-RTTI_DEF1(ossimBoxFilter, "ossimBoxFilter",ossimFilter);
-RTTI_DEF1(ossimSincFilter, "ossimSincFilter",ossimFilter);
-RTTI_DEF1(ossimBellFilter, "ossimBellFilter",ossimFilter);
-RTTI_DEF1(ossimNearestNeighborFilter, "ossimNearestNeighborFilter",ossimFilter);
-RTTI_DEF1(ossimBesselFilter, "ossimBesselFilter",ossimFilter);
-RTTI_DEF1(ossimBesselOrderOneFilter, "ossimBesselOrderOneFilter",ossimFilter);
-RTTI_DEF1(ossimBlackmanFilter, "ossimBlackmanFilter",ossimFilter);
-RTTI_DEF1(ossimBlackmanSincFilter, "ossimBlackmanSincFilter",ossimFilter);
-RTTI_DEF1(ossimBlackmanBesselFilter, "ossimBlackmanBesselFilter",ossimFilter);
-RTTI_DEF1(ossimCatromFilter, "ossimCatromFilter",ossimFilter);
-RTTI_DEF1(ossimCubicFilter, "ossimCubicFilter",ossimFilter);
-RTTI_DEF1(ossimBSplineFilter, "ossimBSplineFilter",ossimFilter);
-RTTI_DEF1(ossimGaussianFilter, "ossimGaussianFilter",ossimFilter);
-RTTI_DEF1(ossimHanningFilter, "ossimHanningFilter",ossimFilter);
-RTTI_DEF1(ossimHammingFilter, "ossimHammingFilter",ossimFilter);
-RTTI_DEF1(ossimHermiteFilter, "ossimHermiteFilter",ossimFilter);
-RTTI_DEF1(ossimLanczosFilter, "ossimLanczosFilter",ossimFilter);
-RTTI_DEF1(ossimMitchellFilter, "ossimMitchellFilter",ossimFilter);
-RTTI_DEF1(ossimQuadraticFilter, "ossimQuadraticFilter",ossimFilter);
-RTTI_DEF1(ossimTriangleFilter, "ossimTriangleFilter",ossimFilter);
-RTTI_DEF1(ossimMagicFilter, "ossimMagicFilter",ossimFilter);
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-+   B e s s e l O r d e r O n e                                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  Method BesselOrderOne computes the Bessel function of x of the first kind
-%  of order 0:
-%
-%    Reduce x to |x| since j1(x)= -j1(-x), and for x in (0,8]
-%
-%       j1(x) = x*j1(x);
-%
-%    For x in (8,inf)
-%
-%       j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
-%
-%    where x1 = x-3*pi/4. Compute sin(x1) and cos(x1) as follow:
-%
-%       cos(x1) =  cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
-%               =  1/sqrt(2) * (sin(x) - cos(x))
-%       sin(x1) =  sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
-%               = -1/sqrt(2) * (sin(x) + cos(x))
-%
-%  The format of the BesselOrderOne method is:
-%
-%      double BesselOrderOne(double x)
-%
-%  A description of each parameter follows:
-%
-%    o value: Method BesselOrderOne returns the Bessel function of x of the
-%      first kind of orders 1.
-%
-%    o x: double value.
-%
-%
-*/
-
-static double J1(double x)
-{
-  double
-    p,
-    q;
-
-  register int
-    i;
-
-  static const double
-    Pone[] =
-    {
-       0.581199354001606143928050809e+21,
-      -0.6672106568924916298020941484e+20,
-       0.2316433580634002297931815435e+19,
-      -0.3588817569910106050743641413e+17,
-       0.2908795263834775409737601689e+15,
-      -0.1322983480332126453125473247e+13,
-       0.3413234182301700539091292655e+10,
-      -0.4695753530642995859767162166e+7,
-       0.270112271089232341485679099e+4
-    },
-    Qone[] =
-    {
-      0.11623987080032122878585294e+22,
-      0.1185770712190320999837113348e+20,
-      0.6092061398917521746105196863e+17,
-      0.2081661221307607351240184229e+15,
-      0.5243710262167649715406728642e+12,
-      0.1013863514358673989967045588e+10,
-      0.1501793594998585505921097578e+7,
-      0.1606931573481487801970916749e+4,
-      0.1e+1
-    };
-
-  p=Pone[8];
-  q=Qone[8];
-  for (i=7; i >= 0; i--)
-  {
-    p=p*x*x+Pone[i];
-    q=q*x*x+Qone[i];
-  }
-  return(p/q);
-}
-
-static double P1(double x)
-{
-  double
-    p,
-    q;
-
-  register int
-    i;
-
-  static const double
-    Pone[] =
-    {
-      0.352246649133679798341724373e+5,
-      0.62758845247161281269005675e+5,
-      0.313539631109159574238669888e+5,
-      0.49854832060594338434500455e+4,
-      0.2111529182853962382105718e+3,
-      0.12571716929145341558495e+1
-    },
-    Qone[] =
-    {
-      0.352246649133679798068390431e+5,
-      0.626943469593560511888833731e+5,
-      0.312404063819041039923015703e+5,
-      0.4930396490181088979386097e+4,
-      0.2030775189134759322293574e+3,
-      0.1e+1
-    };
-
-  p=Pone[5];
-  q=Qone[5];
-  for (i=4; i >= 0; i--)
-  {
-    p=p*(8.0/x)*(8.0/x)+Pone[i];
-    q=q*(8.0/x)*(8.0/x)+Qone[i];
-  }
-  return(p/q);
-}
-
-static double Q1(double x)
-{
-   double
-      p,
-      q;
-   
-   register int
-      i;
-   
-   static const double
-      Pone[] =
-   {
-      0.3511751914303552822533318e+3,
-      0.7210391804904475039280863e+3,
-      0.4259873011654442389886993e+3,
-      0.831898957673850827325226e+2,
-      0.45681716295512267064405e+1,
-      0.3532840052740123642735e-1
-   },
-      Qone[] =
-      {
-         0.74917374171809127714519505e+4,
-         0.154141773392650970499848051e+5,
-         0.91522317015169922705904727e+4,
-         0.18111867005523513506724158e+4,
-         0.1038187585462133728776636e+3,
-         0.1e+1
-      };
-      
-      p=Pone[5];
-      q=Qone[5];
-      for (i=4; i >= 0; i--)
-      {
-         p=p*(8.0/x)*(8.0/x)+Pone[i];
-         q=q*(8.0/x)*(8.0/x)+Qone[i];
-      }
-      return(p/q);
-}
-
-double ossimBesselOrderOneFilter::filter(double x, double /* support */)const
-{
-   double
-      p,
-      q;
-   
-   if (x == 0.0)
-      return(0.0);
-   p=x;
-   if (x < 0.0)
-      x=(-x);
-   if (x < 8.0)
-      return(p*J1(x));
-   q=sqrt(2.0/(M_PI*x))*(P1(x)*(1.0/sqrt(2.0)*(sin(x)-cos(x)))-8.0/x*Q1(x)*
-                         (-1.0/sqrt(2.0)*(sin(x)+cos(x))));
-   if (p < 0.0)
-      q=(-q);
-   return(q);
-
-}
-
-void ossimFilter::createMatrix(NEWMAT::Matrix& m,
-                               long width,
-                               double middle,
-                               double scale)const
-{
-   NEWMAT::ColumnVector colVec(width);
-   NEWMAT::RowVector    rowVec(width);
-
-   double t = 0.0;
-   double val = 0.0;
-   if(width == 1)
-   {
-      t = 0;
-      val = filter(t, getSupport());
-      colVec[0] = val;
-      rowVec[0] = val;
-   }
-   else
-   {
-      for(long index = 0; index < width; index++)
-      {
-         t = (double)index/(double)(width-1);
-         t = middle + (t - .5)*scale;
-         val = filter(t, getSupport());
-         colVec[index] = val;
-         rowVec[index] = val;
-      }
-   }
-
-   // do the outer product to construct the
-   // filter matrix
-   m = colVec * rowVec;
-}
-
-
-NEWMAT::Matrix *ossimFilter::newMatrix(long width,
-                                       double middle,
-                                       double scale)const
-{
-   NEWMAT::Matrix *result = new NEWMAT::Matrix(width, width);
-
-   createMatrix(*result,
-                width,
-                middle,
-                scale);
-
-   return result;
-}
-
-NEWMAT::RowVector *ossimFilter::newVector(long width,
-                                          double middle,
-                                          double scale)const
-{
-   NEWMAT::RowVector *result = new NEWMAT::RowVector(width);
-
-
-   double t = 0.0;
-   double val = 0.0;
-   for(long index = 0; index < width; index++)
-   {
-      t = (double)index/(double)(width-1);
-      t = middle + (t- .5)*scale;
-      val = filter(t, getSupport());
-      (*result)[index] = val;
-   }
-
-   return result;
-}
diff --git a/ossim/src/ossim/imaging/ossimFilterResampler.cpp b/ossim/src/ossim/imaging/ossimFilterResampler.cpp
deleted file mode 100644
index 897adc4..0000000
--- a/ossim/src/ossim/imaging/ossimFilterResampler.cpp
+++ /dev/null
@@ -1,951 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-
-// Contributor:
-//         David A. Horner (DAH) http://dave.thehorners.com
-//
-//*************************************************************************
-// $Id: ossimFilterResampler.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/imaging/ossimFilterTable.h>
-ossimFilterResampler::ossimFilterResampler()
-   :theMinifyFilter(new ossimNearestNeighborFilter()),
-    theMagnifyFilter(new ossimNearestNeighborFilter()),
-    theMinifyFilterType(ossimFilterResampler_NEAREST_NEIGHBOR),
-    theMagnifyFilterType(ossimFilterResampler_NEAREST_NEIGHBOR),
-    theScaleFactor(1.0, 1.0),
-    theInverseScaleFactor(1.0, 1.0),
-    theBlurFactor(1.0)
-{
-   setScaleFactor(ossimDpt(1.0, 1.0));
-   loadState(ossimPreferences::instance()->preferencesKWL(),"resampler.");
-
-}
-
-ossimFilterResampler::~ossimFilterResampler()
-{
-   if(theMinifyFilter)
-   {
-      delete theMinifyFilter;
-      theMinifyFilter = NULL;
-   }
-   if(theMagnifyFilter)
-   {
-      delete theMagnifyFilter;
-      theMagnifyFilter = NULL;
-   }
-}
-
-
-void ossimFilterResampler::resample(const ossimRefPtr<ossimImageData>& input,
-				    ossimRefPtr<ossimImageData>& output,
-				    const ossimDpt& ul,
-				    const ossimDpt& ur,
-				    const ossimDpt& deltaUl,
-				    const ossimDpt& deltaUr,
-				    const ossimDpt& length)
-{
-   resample(input,
-            output,
-            output->getImageRectangle(),
-            ul,
-            ur,
-            deltaUl,
-            deltaUr,
-            length);
-}
-
-void ossimFilterResampler::resample(const ossimRefPtr<ossimImageData>& input,
-				    ossimRefPtr<ossimImageData>& output,
-				    const ossimIrect& outputSubRect,
-				    const ossimDpt& ul,
-				    const ossimDpt& ur,
-				    const ossimDpt& deltaUl,
-				    const ossimDpt& deltaUr,
-				    const ossimDpt& length)
-{
-   if(!input.valid()   ||
-      !output.valid()  ||
-      !input->getBuf() ||
-      !output->getBuf())
-   {
-      return;
-   }
-   
-   ossimScalarType scalarType = input->getScalarType();
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         resampleBilinearTile(ossim_uint8(0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-			      ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         resampleBilinearTile(ossim_sint8(0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-			      ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-	 resampleBilinearTile(ossim_uint16(0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-			      ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-	 break;
-      }
-      case OSSIM_SINT16:
-      {
-	 resampleBilinearTile(ossim_sint16(0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-			      ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-	 break;
-      }      
-      case OSSIM_UINT32:
-      {
-	 resampleBilinearTile(ossim_uint32(0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-			      ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-	 break;
-      }      
-      case OSSIM_SINT32:
-      {
-	 resampleBilinearTile(ossim_sint32(0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-			      ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-	 break;
-      }      
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-	 resampleBilinearTile(ossim_float32(0.0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-               ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-	 break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-	 resampleBilinearTile(ossim_float64(0.0), // dummy template variable
-			      input,
-			      output,
-			      outputSubRect,
-			      ul,
-			      ur,
-			      deltaUl,
-			      deltaUr,
-			      length);
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimFilterResampler::resample error: unknown scalar type:  "
-            << scalarType << endl;
-      }
-   }
-}
-
-
-ossimFilter* ossimFilterResampler::createNewFilter(
-   ossimFilterResamplerType filterType,
-   ossimFilterResamplerType& result)
-{
-   switch(filterType)
-   {
-      case ossimFilterResampler_NEAREST_NEIGHBOR:
-      {
-         return new ossimNearestNeighborFilter();
-      }
-      case ossimFilterResampler_BOX:
-      {
-         return new ossimBoxFilter();
-      }
-      case ossimFilterResampler_GAUSSIAN:
-      {
-         return new ossimGaussianFilter();
-      }
-      case ossimFilterResampler_CUBIC:
-      {
-         return new ossimCubicFilter();
-      }
-      case ossimFilterResampler_HANNING:
-      {
-         return new ossimHanningFilter();
-      }
-      case ossimFilterResampler_HAMMING:
-      {
-         return new ossimHammingFilter();
-      }
-      case ossimFilterResampler_LANCZOS:
-      {
-         return new ossimLanczosFilter();
-      }
-      case ossimFilterResampler_CATROM:
-      {
-         return new ossimCatromFilter();
-      }
-      case ossimFilterResampler_MITCHELL:
-      {
-         return new ossimMitchellFilter();
-      }
-      case ossimFilterResampler_BLACKMAN:
-      {
-         return new ossimBlackmanFilter();
-      }
-      case ossimFilterResampler_BLACKMAN_SINC:
-      {
-         return new ossimBlackmanSincFilter();
-      }
-      case ossimFilterResampler_BLACKMAN_BESSEL:
-      {
-         return new ossimBlackmanBesselFilter();
-      }
-      case ossimFilterResampler_QUADRATIC:
-      {
-         return new ossimQuadraticFilter();
-      }
-      case ossimFilterResampler_TRIANGLE:
-      {
-         return new ossimTriangleFilter();
-      }
-      case ossimFilterResampler_HERMITE:
-      {
-         return new ossimHermiteFilter();
-      }
-      case ossimFilterResampler_BELL:
-      {
-         return new ossimGaussianFilter();
-      }
-      case ossimFilterResampler_BSPLINE:
-      {
-         return new ossimBSplineFilter();
-      }
-      case ossimFilterResampler_MAGIC:
-      {
-         return new ossimBSplineFilter();
-      }
-   }
-
-   result = ossimFilterResampler_NEAREST_NEIGHBOR;
-   return new ossimNearestNeighborFilter();
-}
-
-void ossimFilterResampler::setScaleFactor(const ossimDpt& scale)
-{
-   theScaleFactor = scale;
-   if(fabs(theScaleFactor.x) <= FLT_EPSILON)
-   {
-      theScaleFactor.x = 1.0;
-   }
-   if(fabs(theScaleFactor.y) <= FLT_EPSILON)
-   {
-      theScaleFactor.y = 1.0;
-   }
-
-   theInverseScaleFactor.x = 1.0/theScaleFactor.x;
-   theInverseScaleFactor.y = 1.0/theScaleFactor.y;
-}
-
-template <class T> void ossimFilterResampler::resampleBilinearTile(
-   T /* dummy */,
-   const ossimRefPtr<ossimImageData>& input,
-   ossimRefPtr<ossimImageData>& output,
-   const ossimIrect& outputSubRect,
-   const ossimDpt& inputUl,
-   const ossimDpt& inputUr,
-   const ossimDpt& deltaUl,
-   const ossimDpt& deltaUr,
-   const ossimDpt& outLength)
-{
-#if 0 /* Please leave for debug. */
-   std::cout << "INPUT  = \n" << *input << std::endl
-             << "OUTPUT = \n" << *output << std::endl
-             << "inputUL= " << inputUl << std::endl
-             << "inputUR= " << inputUr << std::endl
-             << "deltaUL= " << deltaUl << std::endl
-             << "deltaUr= " << deltaUr << std::endl
-             << "outlength= " << outLength << std::endl;
-#endif
-   
-   ossim_uint32  band, centerOffset;
-   ossim_float64 tmpFlt64, stepSizeWidth;
-
-   if(outLength.x>1) {
-      stepSizeWidth  = 1.0/(outLength.x-1.0);
-   } else {
-      stepSizeWidth   = 1.0;
-   }
-
-   // INPUT INFORMATION
-   ossim_uint32       inWidth      = input->getWidth();
-   ossim_uint32       inBandSize   = input->getSizePerBand();  // fix for out-of-bounds check OLK 06/2005
-   ossim_uint32       BANDS        = input->getNumberOfBands();
-   ossimIrect         inputRect    = input->getImageRectangle();
-
-   // OUTPUT INFORMATION
-   const ossim_float64* NULL_PIX      = output->getNullPix(); 
-   const ossim_float64* MIN_PIX       = output->getMinPix(); 
-   const ossim_float64* MAX_PIX       = output->getMaxPix(); 
-   ossimIrect           outputRect    = output->getImageRectangle();
-   ossim_uint32         resultRectH   = outputSubRect.height();
-   ossim_uint32         resultRectW   = outputSubRect.width();
-   ossim_uint32         outputRectW   = outputRect.width();
-
-   // calculate the offset into the data so we can refer to it at 0 index.
-   ossim_uint32 resultOffset=(outputSubRect.ul().y - outputRect.ul().y)*outputRectW +
-                             (outputSubRect.ul().x - outputRect.ul().x);
-
-   // make a local copy of the band pointers (at resultOffset)
-   ossim_float64 *densityvals=new ossim_float64[BANDS];
-   ossim_float64 *pixelvals=new ossim_float64[BANDS];
-   const T* *inputBuf  = new const T*[BANDS];
-   T* *resultBuf = new T*[BANDS];
-   if(!pixelvals||!inputBuf||!resultBuf)
-   {
-      return;
-   }
-   
-   for(band = 0; band < BANDS; ++band)
-   {
-      inputBuf[band] = static_cast<const T*>(input->getBuf(band));
-      resultBuf[band] = static_cast<T*>(output->getBuf(band))+resultOffset;
-   }
-
-   // FILTER INFORMAION
-   ossim_uint32 xkernel_width  = theFilterTable.getWidth();;
-   ossim_uint32 ykernel_height = theFilterTable.getHeight();
-   double xkernel_half_width   = theFilterTable.getXSupport();
-   double ykernel_half_height  = theFilterTable.getYSupport();
-
-   double initialx  = inputUl.x-inputRect.ul().x;
-   double initialy  = inputUl.y-inputRect.ul().y;
-   double terminalx = inputUr.x-inputRect.ul().x;
-   double terminaly = inputUr.y-inputRect.ul().y;
-   double pointx,pointy,deltaX,deltaY;
-   ossim_int32 starty,startx; 
-
-   if(xkernel_width==0 || ykernel_height==0)
-   {
-      // USING NEAREST NEIGHBOR
-      for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
-      {
-//          deltaX = (terminalx-initialx) * stepSizeWidth;
-//          deltaY = (terminaly-initialy) * stepSizeHeight;
-         // this should be stepsize width for both since we are traversing horizontal
-         deltaX = (terminalx-initialx) * stepSizeWidth;
-         deltaY = (terminaly-initialy) * stepSizeWidth;
-         pointx = initialx;
-         pointy = initialy;
-         for(ossim_uint32 resultX = 0; resultX < resultRectW; ++resultX)
-         {
-            // just sample center in input space.
-            centerOffset = ossim::round<int>(pointy)*inWidth + ossim::round<int>(pointx);
-            for(band=0;band<BANDS;++band)
-            {
-               resultBuf[band][resultX] = inputBuf[band][centerOffset];
-            }
-            pointy += deltaY;
-            pointx += deltaX;
-         } // End of loop in x direction.
-         
-         // increment pointers to where we are now.
-         for(band=0;band<BANDS;++band)
-         {
-            resultBuf[band] += outputRectW;
-         }
-         initialx += deltaUl.x;
-         initialy += deltaUl.y;
-         terminalx  += deltaUr.x;
-         terminaly  += deltaUr.y;
-      } // End of loop in y direction.
-      
-   }
-   else
-   {
-      // USING A KERNEL
-      const double* kernel;
-      ossim_uint32 iy,ix,sourceIndex,nullCount;
-      for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
-      {
-         deltaX = (terminalx-initialx) * stepSizeWidth;
-         deltaY = (terminaly-initialy) * stepSizeWidth;
-         pointx = initialx;
-         pointy = initialy;
-         for(ossim_uint32 resultX = 0; resultX < resultRectW; ++resultX)
-         {
-            starty  = ossim::round<int>(pointy - ykernel_half_height + .5);
-            startx  = ossim::round<int>(pointx - xkernel_half_width + .5);
-            centerOffset = ossim::round<int>(pointy)*inWidth + ossim::round<int>(pointx);
-            sourceIndex = starty*inWidth+startx;
-
-            // look at center pixel, make sure they aren't all null.
-            nullCount=0;
-            if(centerOffset<inBandSize)
-            {
-               for (band=0;band<BANDS;++band)
-               {
-                  if(inputBuf[band][centerOffset]==static_cast<T>(NULL_PIX[band]))
-                  {
-                     ++nullCount;
-                  }
-               }
-               // the center of the kernel is outside the input space, just set null.
-            }
-            else
-            {
-               nullCount=BANDS;
-            }
-
-            // make sure we have non-null data and we fit within the inputBuf.
-            if ( nullCount==BANDS || (sourceIndex>=inBandSize))
-            {
-               // we don't need to continue, just assign null!
-               for (band=0;band<BANDS;++band)
-               {
-                  resultBuf[band][resultX] = static_cast<T>(NULL_PIX[band]);
-               }
-            }
-            else
-            {  
-               kernel = theFilterTable.getClosestWeights(pointx,pointy);
-               if(kernel)
-               {
-                  // reset the pixel/density sums for each band to zero.
-                  memset(densityvals,'\0',sizeof(ossim_float64)*BANDS);
-                  memset(pixelvals,'\0',sizeof(ossim_float64)*BANDS);
-
-                  // apply kernel to input space.
-                  for (iy=0;((iy<ykernel_height)&&(sourceIndex<inBandSize));++iy)
-                  {
-                     for (ix = 0;((ix<xkernel_width)&&(sourceIndex<inBandSize));++ix)
-                     {
-                        tmpFlt64=*kernel; // pixel weight;
-                        for(band=0;band<BANDS;++band)
-                        {
-                           if(inputBuf[band][sourceIndex]!=NULL_PIX[band])
-                           {
-                              densityvals[band] += tmpFlt64;
-                              pixelvals[band] += (inputBuf[band][sourceIndex]*tmpFlt64);
-                           }
-                        }
-                        ++sourceIndex;
-                        ++kernel;
-                        if(sourceIndex>=inBandSize)
-                        {
-                           break;
-                        }
-                     }
-                     sourceIndex+=(inWidth-xkernel_width);
-                  }
-
-                  // actually assign the value to the output
-                  for (band = 0; band < BANDS; ++band)
-                  {
-                     if(densityvals[band]<=FLT_EPSILON)
-                     {
-                        //---
-                        // Setting tempFlt64 to pixelvals[band] causing 0's where -32768
-                        // should be when null check was skipped above.
-                        // tmpFlt64 = pixelvals[band];
-                        //---
-                        tmpFlt64 = NULL_PIX[band];
-                     }
-                     else
-                     {
-                        // normalize
-                        tmpFlt64 = pixelvals[band]/densityvals[band];
-                     }
-                     
-                     // clamp
-                     tmpFlt64 = (tmpFlt64>=MIN_PIX[band]?(tmpFlt64<MAX_PIX[band]?tmpFlt64:MAX_PIX[band]):MIN_PIX[band]); 
-                     // set resultant pixel value.
-                     resultBuf[band][resultX] = static_cast<T>(tmpFlt64);
-                  }
-
-                  // we didn't get a filter kernel, just set NULL in this disaster.
-               }
-               else
-               {
-                  for (band=0;band<BANDS;++band)
-                  {
-                     resultBuf[band][resultX] = static_cast<T>(NULL_PIX[band]);
-                  }
-               }                  
-            }
-            pointy += deltaY;
-            pointx += deltaX;
-         } // End of loop in x direction.
-
-         // increment pointers to where we are now.
-         for(band=0;band<BANDS;++band)
-         {
-            resultBuf[band] += outputRectW;
-         }
-         initialx += deltaUl.x;
-         initialy += deltaUl.y;
-         terminalx  += deltaUr.x;
-         terminaly  += deltaUr.y;
-      } // End of loop in y direction.
-   } // USING A KERNEL END
-
-   delete [] densityvals;
-   delete [] pixelvals;
-   delete [] resultBuf;
-   delete [] inputBuf;
-}
-
-ossimString ossimFilterResampler::getFilterTypeAsString(ossimFilterResamplerType type)const
-{
-   switch(type)
-   {
-      case ossimFilterResampler_NEAREST_NEIGHBOR:
-      {
-         return "nearest neighbor";
-      }
-      case ossimFilterResampler_BOX:
-      {
-         return "box";
-      }
-      case ossimFilterResampler_GAUSSIAN:
-      {
-         return "gaussian";
-      }
-      case ossimFilterResampler_CUBIC:
-      {
-         return "cubic";
-      }
-      case ossimFilterResampler_HANNING:
-      {
-         return "hanning";
-      }
-      case ossimFilterResampler_HAMMING:
-      {
-         return "hamming";
-      }
-      case ossimFilterResampler_LANCZOS:
-      {
-         return "lanczos";
-      }
-      case ossimFilterResampler_MITCHELL:
-      {
-         return "mitchell";
-      }
-      case ossimFilterResampler_CATROM:
-      {
-         return "catrom";
-      }
-      case ossimFilterResampler_BLACKMAN:
-      {
-         return "blackman";
-      }
-      case ossimFilterResampler_BLACKMAN_SINC:
-      {
-         return "sinc";
-      }
-      case ossimFilterResampler_BLACKMAN_BESSEL:
-      {
-         return "bessel";
-      }
-      case ossimFilterResampler_QUADRATIC:
-      {
-         return "quadratic";
-      }
-      case ossimFilterResampler_TRIANGLE:
-      {
-         return "bilinear";
-      }
-      case ossimFilterResampler_HERMITE:
-      {
-         return "hermite";
-      }
-      case ossimFilterResampler_BELL:
-      {
-         return "gaussian";
-      }
-      case ossimFilterResampler_BSPLINE:
-      {
-         return "bspline";
-      }
-      case ossimFilterResampler_MAGIC:
-      {
-         return "magic";
-      }
-   }
-
-   return "nearest neighbor";
-}
-
-void ossimFilterResampler::getFilterTypes(std::vector<ossimString>& filterTypes)const
-{
-  filterTypes.push_back("nearest neighbor");
-  filterTypes.push_back("bilinear");
-  filterTypes.push_back("cubic");
-//  filterTypes.push_back("bell");
-  filterTypes.push_back("bessel");
-  filterTypes.push_back("blackman");
-  filterTypes.push_back("box");
-  filterTypes.push_back("bspline");
-  filterTypes.push_back("catrom");
-  filterTypes.push_back("gaussian");
-  filterTypes.push_back("hanning");
-  filterTypes.push_back("hamming");
-  filterTypes.push_back("hermite");
-  filterTypes.push_back("lanczos");
-  filterTypes.push_back("mitchell");
-  filterTypes.push_back("quadratic");
-  filterTypes.push_back("sinc");
-  filterTypes.push_back("magic");
-}
-
-
-ossimFilterResampler::ossimFilterResamplerType ossimFilterResampler::getFilterType(const ossimString& type)const
-{
-   ossimString typeUpper = type;
-   typeUpper = typeUpper.upcase();
-
-   if(typeUpper.contains("BOX"))
-   {
-      return ossimFilterResampler_BOX;
-   }
-   else if(typeUpper.contains("NEAREST"))
-   {
-      return ossimFilterResampler_NEAREST_NEIGHBOR;
-   }
-   else if(typeUpper.contains("GAUSSIAN"))
-   {
-      return ossimFilterResampler_GAUSSIAN;
-   }
-   else if(typeUpper.contains("HANNING"))
-   {
-      return ossimFilterResampler_HANNING;
-   }
-   else if(typeUpper.contains("HAMMING"))
-   {
-      return ossimFilterResampler_HAMMING;
-   }
-   else if(typeUpper.contains("LANCZOS"))
-   {
-      return ossimFilterResampler_LANCZOS;
-   }
-   else if(typeUpper.contains("MITCHELL"))
-   {
-      return ossimFilterResampler_MITCHELL;
-   }
-   else if(typeUpper.contains("CATROM"))
-   {
-      return ossimFilterResampler_CATROM;
-   }
-   else if(typeUpper.contains("CUBIC"))
-   {
-      return ossimFilterResampler_CUBIC;
-   }
-   else if(typeUpper.contains("BESSEL"))
-   {
-      return ossimFilterResampler_BLACKMAN_BESSEL;
-   }
-   else if(typeUpper.contains("SINC"))
-   {
-      return ossimFilterResampler_BLACKMAN_SINC;
-   }
-   else if(typeUpper.contains("BLACKMAN"))
-   {
-      return ossimFilterResampler_BLACKMAN;
-   }
-   else if(typeUpper.contains("QUADRATIC"))
-   {
-      return ossimFilterResampler_QUADRATIC;
-   }
-   else if(typeUpper.contains("TRIANGLE"))
-   {
-      return ossimFilterResampler_TRIANGLE;
-   }
-   else if(typeUpper.contains("BILINEAR"))
-   {
-      return ossimFilterResampler_TRIANGLE;
-   }
-   else if(typeUpper.contains("HERMITE"))
-   {
-      return ossimFilterResampler_HERMITE;
-   }
-//    else if(typeUpper.contains("BELL"))
-//    {
-//       return ossimFilterResampler_BELL;
-//    }
-   else if(typeUpper.contains("BSPLINE"))
-   {
-      return ossimFilterResampler_BSPLINE;
-   }
-   else if(typeUpper.contains("MAGIC"))
-   {
-      return ossimFilterResampler_MAGIC;
-   }
-   
-   return ossimFilterResampler_NEAREST_NEIGHBOR;
-}
-
-void ossimFilterResampler::getKernelSupport(double& x, double& y)const
-{
-   const ossimFilter* horizontalFilter = getHorizontalFilter();
-   const ossimFilter* verticalFilter   = getVerticalFilter();
-
-   if(!horizontalFilter)
-   {
-      x = 0.0;
-   }
-   else
-   {
-//       x = theBlurFactor*ossim::max(1.0/theScaleFactor.x, 1.0)*
-//           horizontalFilter->getSupport();
-      x = horizontalFilter->getSupport();
-   }
-
-   if(!verticalFilter)
-   {
-      y = 0.0;
-   }
-   else
-   {
-//       y = theBlurFactor*ossim::max(1.0/theScaleFactor.y, 1.0)*
-//           verticalFilter->getSupport();
-      y = verticalFilter->getSupport();
-   }
-}
-
-const ossimFilter* ossimFilterResampler::getHorizontalFilter()const
-{
-   if(theScaleFactor.x < 1)
-   {
-      return theMinifyFilter;
-   }
-
-   return theMagnifyFilter;
-}
-
-const ossimFilter* ossimFilterResampler::getVerticalFilter()const
-{
-   if(theScaleFactor.y < 1)
-   {
-      return theMinifyFilter;
-   }
-
-   return theMagnifyFilter;
-}
-
-void ossimFilterResampler::setFilterType(const ossimString& type)
-{
-   setFilterType(type, type);
-}
-
-void ossimFilterResampler::setFilterType(ossimFilterResamplerType filterType)
-{
-   setFilterType(filterType, filterType);
-}
-void ossimFilterResampler::setFilterType(const ossimString& minifyType,
-                                         const ossimString& magnifyType)
-{
-   setFilterType(getFilterType(minifyType),
-                 getFilterType(magnifyType));
-}
-
-void ossimFilterResampler::setMinifyFilterType(const ossimString& minifyType)
-{
-   setMinifyFilterType(getFilterType(minifyType));
-}
-
-void ossimFilterResampler::setMagnifyFilterType(const ossimString& magnifyType)
-{
-   setMagnifyFilterType(getFilterType(magnifyType));
-}
-
-void ossimFilterResampler::setMinifyFilterType(ossimFilterResamplerType filterType)
-{
-   setFilterType(filterType,
-                 theMagnifyFilterType);
-}
-
-void ossimFilterResampler::setMagnifyFilterType(ossimFilterResamplerType filterType)
-{
-   setFilterType(theMinifyFilterType,filterType);
-}
-
-ossimString ossimFilterResampler::getMinifyFilterTypeAsString()const
-{
-   return getFilterTypeAsString(theMinifyFilterType);
-}
-
-ossimString ossimFilterResampler::getMagnifyFilterTypeAsString()const
-{
-   return getFilterTypeAsString(theMagnifyFilterType);
-}
-
-void ossimFilterResampler::setFilterType(
-   ossimFilterResamplerType minifyFilterType,
-   ossimFilterResamplerType magnifyFilterType)
-{
-   if(theMinifyFilter)
-   {
-      delete theMinifyFilter;
-      theMinifyFilter = NULL;
-   }
-   if(theMagnifyFilter)
-   {
-      delete theMagnifyFilter;
-      theMagnifyFilter = NULL;
-   }
-   
-   theMinifyFilterType  = minifyFilterType;
-   theMagnifyFilterType = magnifyFilterType;
-   
-   theMinifyFilter  = createNewFilter(minifyFilterType, theMinifyFilterType);
-   theMagnifyFilter = createNewFilter(magnifyFilterType, theMagnifyFilterType);
-   computeTable();
-}
-
-ossim_float64 ossimFilterResampler::getBlurFactor()const
-{
-   return theBlurFactor;
-}
-
-void ossimFilterResampler::setBlurFactor(ossim_float64 blur)
-{
-   theBlurFactor = blur;
-}
-
-bool ossimFilterResampler::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_X_KW,
-           theScaleFactor.x,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_Y_KW,
-           theScaleFactor.y,
-           true);
-   kwl.add(prefix,
-           "minify_type",
-           getFilterTypeAsString(theMinifyFilterType),
-           true);
-   kwl.add(prefix,
-           "magnify_type",
-           getFilterTypeAsString(theMagnifyFilterType),
-           true);
-
-   return true;
-}
-
-bool ossimFilterResampler::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   const char* lookup = 0;
-
-   lookup = kwl.find(prefix, ossimKeywordNames::SCALE_X_KW);
-   if (lookup)
-   {
-      theScaleFactor.x = ossimString(lookup).toDouble();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::SCALE_Y_KW);
-   if (lookup)
-   {
-      theScaleFactor.y = ossimString(lookup).toDouble();
-   }
-
-   ossimString minify;
-   lookup = kwl.find(prefix, "minify_type");
-   if (lookup)
-   {
-      minify = lookup;
-   }
-
-   ossimString magnify;
-   lookup = kwl.find(prefix, "magnify_type");
-   if (lookup)
-   {
-      magnify = lookup;
-   }
-
-   if(fabs(theScaleFactor.x) <= FLT_EPSILON)
-   {
-      theScaleFactor.x = 1.0;
-   }
-   if(fabs(theScaleFactor.y) <= FLT_EPSILON)
-   {
-      theScaleFactor.y = 1.0;
-   }
-
-   theInverseScaleFactor.x = 1.0/theScaleFactor.x;
-   theInverseScaleFactor.y = 1.0/theScaleFactor.y;
-   
-   setFilterType(getFilterType(minify),
-                 getFilterType(magnify));
-
-   return true;
-}
-
-void ossimFilterResampler::computeTable()
-{
-  theFilterTable.buildTable(32, *theMagnifyFilter);
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimFilterTable.cpp b/ossim/src/ossim/imaging/ossimFilterTable.cpp
deleted file mode 100644
index ee385d0..0000000
--- a/ossim/src/ossim/imaging/ossimFilterTable.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimFilterTable.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <iostream>
-#include <ossim/imaging/ossimFilterTable.h>
-#include <ossim/imaging/ossimFilter.h>
-
-ossimFilterTable::ossimFilterTable()
-   :theWeights(0),
-    theWidth(0),
-    theHeight(0),
-    theWidthHeight(0),
-    theXSupport(0),
-    theYSupport(0),
-    theFilterSteps(0)
-{
-   
-}
-
-ossimFilterTable::~ossimFilterTable()
-{
-   if(theWeights)
-   {
-      delete [] theWeights;
-      theWeights = 0;
-   }
-}
-
-void ossimFilterTable::buildTable(ossim_uint32  filterSteps,
-                                  const ossimFilter& filter)
-{
-   buildTable(filterSteps, filter, filter);
-}
-
-void ossimFilterTable::buildTable(ossim_uint32  filterSteps,
-                                  const ossimFilter& xFilter,
-                                  const ossimFilter& yFilter)
-{
-   ossim_int32 subpixelSample=0;
-   ossim_int32 subpixelLine=0;
-   double dx   = 0.0;
-   double dy   = 0.0;
-   double kernelH   = 0.0;
-   double kernelV   = 0.0;
-   double x = 0;
-   double y = 0;
-
-   double xsupport = ceil(xFilter.getSupport());
-   double ysupport = ceil(yFilter.getSupport());
-   double left    = 0;
-   double right   = 0;
-   double top     = 0;
-   double bottom  = 0;
-
-   theXSupport = (ossim_uint32)xsupport;
-   theYSupport = (ossim_uint32)ysupport;
-   theFilterSteps = filterSteps;
-   theWidth  = (2*theXSupport);
-   theHeight = (2*theYSupport);
-   theWidthHeight = theWidth*theHeight;
-   
-   allocateWeights();
-   left   = -(xsupport-1);
-   right  = xsupport;
-   top    = -(ysupport-1);
-   bottom = ysupport;
-   ossim_uint32 idx = 0;
-      
-   for (subpixelLine = 0; subpixelLine < (int)filterSteps; 
-        subpixelLine++)
-   {
-     
-     // Calculate subpixel sample step.
-     // ---------------------------------- 
-       dy = subpixelLine / (double)(filterSteps);
-       for (subpixelSample = 0; subpixelSample < (int)filterSteps; subpixelSample++)
-       {
-        
-         // Calculate subpixel sample step.
-         // ---------------------------------- 
-         dx = subpixelSample / (double)(filterSteps);
-         
-         for (kernelV=top; kernelV<=bottom;
-              kernelV++)
-         {
-             y = kernelV - dy;
-             double tempWeight = yFilter.filter(y, yFilter.getSupport());
-             for(kernelH=left; kernelH<=right;++kernelH)
-             {
-               x = kernelH - dx;
-                   
-               // Get the weight for the current pixel.
-               //   ----------------------------------------
-               theWeights[idx] = tempWeight*xFilter.filter(x, xFilter.getSupport());
-               ++idx;
-             }
-          }
-        }
-     }
-}
-
-ossim_uint32 ossimFilterTable::getWidthByHeight()const
-{
-   return theWidthHeight;
-}
-
-ossim_uint32 ossimFilterTable::getXSupport()const
-{
-   return theXSupport;
-}
-
-ossim_uint32 ossimFilterTable::getYSupport()const
-{
-   return theYSupport;
-}
-
-ossim_uint32 ossimFilterTable::getWidth()const
-{
-   return theWidth;
-}
-
-ossim_uint32 ossimFilterTable::getHeight()const
-{
-   return theHeight;
-}
-
-void ossimFilterTable::allocateWeights()
-{
-   if(theWeights)
-   {
-      delete [] theWeights;
-      theWeights = 0;
-   }
-
-   ossim_uint32 size = (theWidthHeight*(theFilterSteps*theFilterSteps));
-
-   if(size)
-   {
-      theWeights = new double[size];
-   }
-}
diff --git a/ossim/src/ossim/imaging/ossimGammaRemapper.cpp b/ossim/src/ossim/imaging/ossimGammaRemapper.cpp
deleted file mode 100644
index 404680f..0000000
--- a/ossim/src/ossim/imaging/ossimGammaRemapper.cpp
+++ /dev/null
@@ -1,435 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kathy Minear
-//
-// Description: Takes in DNs for any number of bands
-// Converts DNs to Radiance at the satellite values Lsat
-// Converts Lsat to Surface Reflectance values
-//
-//*************************************************************************
-// $Id: ossimGammaRemapper.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <cmath>
-
-#include <ossim/imaging/ossimGammaRemapper.h>
-#include <ossim/imaging/ossimAtCorrKeywords.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-
-RTTI_DEF1(ossimGammaRemapper, "ossimGammaRemapper", ossimImageSourceFilter)
-
-static const double DEFAULT_GAMMA = 1.0;
-
-
-static ossimTrace traceDebug("ossimGammaRemapper:debug");
-
-ossimGammaRemapper::ossimGammaRemapper(ossimObject* owner)
-   :
-      ossimImageSourceFilter  (owner),  // base class
-      theTile                 (NULL),
-      theBuffer               (NULL), 
-      theMinPixelValue        (0),
-      theMaxPixelValue        (0),
-      theGamma                (0),
-      theUserDisabledFlag     (false)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   disableSource();
-
-   // Construction not complete.
-}
-
-
-ossimGammaRemapper::ossimGammaRemapper(ossimImageSource* inputSource)
-   :
-      ossimImageSourceFilter  (NULL, inputSource),  // base class
-      theTile                 (NULL),
-      theBuffer               (NULL),
-      theMinPixelValue        (0),
-      theMaxPixelValue        (0),
-      theGamma                (0),
-      theUserDisabledFlag     (false)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   disableSource();
-
-   if (inputSource == NULL)
-   {
-      setErrorStatus();
-      cerr << "ossimGammaRemapper::ossimGammaRemapper ERROR:"
-           << "\nNull input source passed to constructor!" << endl;
-      return;
-   }
-
-   initialize();
-}
-
-
-ossimGammaRemapper::ossimGammaRemapper(ossimObject* owner,
-                                         ossimImageSource* inputSource)
-   :
-      ossimImageSourceFilter  (owner, inputSource),  // base class     
-      theTile                 (NULL),
-      theBuffer               (NULL),
-      theMinPixelValue        (0),
-      theMaxPixelValue        (0),
-      theGamma                (0)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   disableSource();
-
-   if (inputSource == NULL)
-   {
-      setErrorStatus();
-      cerr << "ossimGammaRemapper::ossimGammaRemapper ERROR:"
-           << "\nNull input source passed to constructor!" << endl;
-      return;
-   }
-
-   initialize();
-}
-
-ossimGammaRemapper::~ossimGammaRemapper()
-{
-   if (theBuffer)
-   {
-      delete [] theBuffer;
-      theBuffer = NULL;
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimGammaRemapper::getTile(const ossimIrect& tile_rect,
-                                            ossim_uint32 resLevel)
-{
-   if (!isInitialized())
-   {
-      cerr << "ossimGammaRemapper::getTile ERROR:"
-           << "\nNot initialized!"
-           << endl;
-      return ossimRefPtr<ossimImageData>();
-   }
-      
-   // Fetch tile from pointer from the input source.
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(
-      tile_rect, resLevel);
-
-   if (!inputTile.valid())  // Just in case...
-   {
-      cerr << "ossimGammaRemapper::getTile ERROR:"
-           << "\nReceived null pointer to tile from input source!"
-           << "\nReturning blank tile."
-           << endl;
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   // Get its status.
-   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
-   
-   //---
-   // Check for remap bypass:
-   //---
-   if (!theEnableFlag || tile_status == OSSIM_NULL ||!theTile.valid() ||
-       tile_status == OSSIM_EMPTY)
-   {
-      return inputTile;
-   }
-
-   ossim_uint32 w     = tile_rect.width();
-   ossim_uint32 h     = tile_rect.height();
-   ossim_uint32 tw    = theTile->getWidth();
-   ossim_uint32 th    = theTile->getHeight();
-   ossim_uint32 bands = theTile->getNumberOfBands();
-
-   // Set the origin of the output tile.
-   theTile->setOrigin(tile_rect.ul());
-
-   if(w*h != tw*th)
-   {
-      theTile->setWidthHeight(w, h);
-      theTile->initialize();
-      if(theBuffer)
-      {
-         delete [] theBuffer;
-         theBuffer = NULL;
-      }
-   }   
-   
-   if(!theBuffer)
-   {
-      theBuffer = new double[w*h*bands];
-   }
-   
-   // Copy the source tile into the buffer at the same time normalizing it.
-   inputTile->copyTileToNormalizedBuffer(theBuffer);
-   
-   // for each band, get the radiance value
-
-   ossim_uint32 buffer_index = 0;
-   const double MP = theTile->getMinNormalizedPix(); // Minimum normalized pix.
-   const ossim_uint32 PPTB = theTile->getSizePerBand();  // Pixels Per Tile Band
-
-   for (ossim_uint32 band=0; band<bands; ++band)
-   {
-      for (ossim_uint32 i=0; i<PPTB; ++i)
-      {
-         double p = theBuffer[buffer_index]; // input pixel
-         // double p = getPix(buffer_index);
-
-         if (p)
-         {
-            // cout<<"p before:  "<<p<<endl;
-            // Stretch it...
-            p = (p - theMinPixelValue[band]) /
-               (theMaxPixelValue[band] -
-                theMinPixelValue[band]);
-            
-            p = pow(p, theGamma[band]);
-           
-            
-            //***
-            // Since it wasn't null to start with clip / clamp between minimum
-            // normalized pixel and one(max).
-            //*** 
-            p =  ( p > MP ? ( p < 1.0 ? p : 1.0) : MP );  
-
-            theBuffer[buffer_index] = p;
-         }
-         else
-         {
-            theBuffer[buffer_index] = 0.0;
-         }
-         
-         ++buffer_index;
-      }
-   }
-   
-   // Copy the buffer to the output tile at the same time unnormalizing it.
-   theTile->copyNormalizedBufferToTile(theBuffer);
-   
-   // Set the status to that of the input tile.
-   theTile->setDataObjectStatus(tile_status);
-
-   return theTile;
-}
-
-void ossimGammaRemapper::initialize()
-{
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,
-                                                          theInputConnection);
-      theTile->initialize();
-
-      if(theBuffer)
-      {
-         delete []theBuffer;
-         theBuffer = NULL;
-      }
-      
-      ossim_uint32 tw    = theTile->getWidth();
-      ossim_uint32 th    = theTile->getHeight();
-      ossim_uint32 bands = theTile->getNumberOfBands();
-      
-      theBuffer = new double[tw*th*bands];
-      memset(theBuffer, '\0', tw*th*bands);
-
-      setInitializedFlag(true);
-      clearErrorStatus();
-   }
-   else
-   {
-      setInitializedFlag(false);
-      setErrorStatus();
-      cerr << "ossimGammaRemapper::initialize ERROR:"
-           << "\nCannot call method when input connection is NULL!"
-           << endl;
-   };
-
-   verifyEnabled();
-}
-
-void ossimGammaRemapper::setMinMaxPixelValues(const vector<double>& v_min,
-                                              const vector<double>& v_max)
-{
-   theMinPixelValue = v_min;
-   theMaxPixelValue = v_max;
-   verifyEnabled();
-}
-
-void ossimGammaRemapper::verifyEnabled()
-{
-   // Check all the pointers...
-   if ( !theInputConnection || !theTile || !theBuffer )
-   {
-      disableSource();
-      return;
-   }
-
-   ossim_uint32 bands = theTile->getNumberOfBands();
-   if ( (theMinPixelValue.size() != bands) ||
-        (theMaxPixelValue.size() != bands) )
-   {
-      disableSource(); 
-      return;
-   }
-
-   if (theUserDisabledFlag == false)
-   {
-      enableSource();
-   }
-
-   if (traceDebug())
-   {
-      cout << *this << endl;
-   }
-}
-
-bool ossimGammaRemapper::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   //***
-   // Call the base class to pick up the enable flag.  Note that the
-   // verifyEnabled flag can override this.
-   //***
-   ossimString pref;
-   if (prefix) pref += prefix;
-   pref += "gamma_remapper.";
-
-   if (!theTile)
-   {
-      cerr << "ossimGammaRemapper::loadState:  ERROR"
-           << "Not initialized yet!" << endl;
-      return false;
-   }
-
-   //---
-   // NOTE:
-   // base class seems to call initialize which in turn errors if you don't
-   // have a connection yet, so check for the enable keyword here...
-   // ossimSource::loadState(kwl, pref.c_str());
-   //---
-   cout << "pref:  " << pref
-        << "kw:  " << ossimKeywordNames::ENABLED_KW    << endl;
-   
-   const char* lookup = kwl.find(pref, ossimKeywordNames::ENABLED_KW);
-   if(lookup)
-   {
-      theEnableFlag = ossimString(lookup).toBool();
-      if (theEnableFlag == false)
-      {
-         // User want filter disabled...
-         theUserDisabledFlag = true;
-      }
-   }
-
-   ossim_uint32 bands = theTile->getNumberOfBands();
-
-   theGamma.clear();
-   theGamma.resize(bands, 1.0);
-
-   for(ossim_uint32 band = 0; band < bands; ++band)
-   {
-      ossimString band_string = ".band";
-      band_string += ossimString::toString(band+1);  // Start at one.
-
-      ossimString kw = GAMMA_REMAPPER_GAMMA_KW;
-      kw += band_string;
-      lookup = kwl.find(prefix, kw.c_str());
-      if (lookup)
-      {
-         theGamma[band] = atof(lookup);
-      }
-      else
-      {
-         cout << "MODULE NOTICE:"
-              << "\nlookup failed for keyword:  " << kw.c_str()
-              << "\nGamma set to " << DEFAULT_GAMMA << " for band:  "
-              << (band+1) << endl;
-         theGamma[band] = DEFAULT_GAMMA;
-      }
-   }
-
-   if (traceDebug())
-   {
-      cout << "ossimGammaRemapper DEBUG:"
-           << *this
-           << endl;
-   }
-   
-   return true;
-}
-
-ostream& ossimGammaRemapper::print(ostream& os) const
-{
-   os << setprecision(15) << setiosflags(ios::fixed)
-      << "ossimGammaRemapper:"
-      << "\ntheEnableFlag:  " << (theEnableFlag?"enabled":"disabled")
-      << endl;
-
-   ossim_uint32 band = 1;
-   vector<double>::const_iterator i = theMinPixelValue.begin();
-   while (i != theMinPixelValue.end())
-   {
-      os << "band[" << band << "] min:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-
-   band = 1;
-   i = theMaxPixelValue.begin();
-   while (i != theMaxPixelValue.end())
-   {
-      os << "band[" << band << "] max:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-   
-   band = 1;
-   i = theGamma.begin();
-   while (i != theGamma.end())
-   {
-      os << "band[" << band << "] gamma:  " << (*i) << endl;
-      ++i;
-      ++band;
-   }
-
-   return os;
-}
-
-void ossimGammaRemapper::enableSource()
-{
-   // Clear the flag...
-   theUserDisabledFlag = false;
-   ossimSource::enableSource();
-}
-
-ossimString ossimGammaRemapper::getShortName() const
-{
-   return ossimString("Gamma Remapper");
-}
-
-ostream& operator<<(ostream& os, const ossimGammaRemapper& hr)
-{
-   return hr.print(os);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimGeneralRasterInfo.cpp b/ossim/src/ossim/imaging/ossimGeneralRasterInfo.cpp
deleted file mode 100644
index a50351f..0000000
--- a/ossim/src/ossim/imaging/ossimGeneralRasterInfo.cpp
+++ /dev/null
@@ -1,1299 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// Contains class definition for ossimGeneralRasterInfo
-//*******************************************************************
-// $Id: ossimGeneralRasterInfo.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimGeneralRasterInfo.h>
-#include <ossim/base/ossimInterleaveTypeLut.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageMetaData.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-#include <ossim/support_data/ossimFgdcXmlDoc.h>
-
-#include <iostream>
-#include <iomanip>
-
-static const ossimKeyword
-NUMBER_LINES("number_lines",
-             "Number of lines in the raster image.");
-
-static const ossimKeyword
-NUMBER_SAMPLES("number_samples",
-               "Number of samples in the raster image.");
-
-static const ossimKeyword
-VALID_START_LINE("valid_start_line",
-                 "First valid line of raster image(zero based).");
-
-static const ossimKeyword
-VALID_STOP_LINE("valid_stop_line",
-                "Last valid line of raster image(zero based).");
-
-static const ossimKeyword
-VALID_START_SAMPLE("valid_start_sample",
-                   "First valid sample of raster image(zero based).");
-
-static const ossimKeyword
-VALID_STOP_SAMPLE("valid_stop_sample",
-                  "Last valid sample of raster image(zero based).");
-
-static const ossimKeyword
-SUB_IMAGE_OFFSET_LINE(
-   "sub_image_offset_line",
-   "Pixel line offset of sub-image in the full-image pixel space.");
-
-static const ossimKeyword
-SUB_IMAGE_OFFSET_SAMP(
-   "sub_image_offset_samp",
-   "Pixel sample offset of sub-image in the full-image pixel space."); 
-
-static const ossimKeyword
-HEADER_SIZE("header_size",
-            "Header size in bytes.");
-
-static const ossimKeyword
-SET_NULLS("set_fill_to_nulls_mode",
-          "0 = do nothing to pixels,\n1 = all zeroes to min values,\
-\n2 = zeroes to null on edges only.");
-
-static const ossimKeyword
-PIXELS_TO_CHOP("pixels_to_chop",
-               "Ammount of pixels to chop from edge.");
-
-static const ossimInterleaveTypeLut INTERLEAVE_TYPE_LUT;
-
-static ossimTrace traceDebug("ossimGeneralRasterInfo:debug");
-
-ossimGeneralRasterInfo::ossimGeneralRasterInfo()
-   :
-   theMetaData(),
-   theImageFileList(),
-   theInterleaveType(OSSIM_BIL),
-   theRawImageRect(),
-   theValidImageRect(),
-   theImageRect(),
-   theSubImageOffset(0,0),
-   theHeaderSize(0),
-   theSetNullsMode(NONE),
-   thePixelsToChop(0),
-   theImageDataByteOrder(OSSIM_LITTLE_ENDIAN)
-{
-   theRawImageRect.makeNan();
-   theValidImageRect.makeNan();
-   theImageRect.makeNan();
-}
-
-ossimGeneralRasterInfo::ossimGeneralRasterInfo(const std::vector<ossimFilename>& imageFileList,
-                                               ossimScalarType     pixelType,
-                                               ossimInterleaveType il_type,
-                                               ossim_int32         numberOfBands,
-                                               ossim_int32         lines,
-                                               ossim_int32         samples,
-                                               ossim_int32         headerSize,
-                                               ossimFillMode       nullsMode,
-                                               ossim_int32         pixelsToChop)
-   :
-   theMetaData(pixelType, numberOfBands),
-   theImageFileList(imageFileList),
-   theInterleaveType(il_type),
-   theRawImageRect(0,0,0,0),
-   theValidImageRect(0,0,0,0),
-   theImageRect(0,0,0,0),
-   theSubImageOffset(0,0),
-   theHeaderSize(headerSize),
-   theSetNullsMode(nullsMode),
-   thePixelsToChop(pixelsToChop),
-   theImageDataByteOrder(OSSIM_LITTLE_ENDIAN)
-{
-   theRawImageRect.set_lry(lines - 1);
-   theRawImageRect.set_lrx(samples - 1);
-   theValidImageRect = theRawImageRect;
-   theImageRect = theRawImageRect;
-}
-
-ossimGeneralRasterInfo::ossimGeneralRasterInfo(const ossimKeywordlist& kwl,
-                     const char* prefix)
-   :
-   theImageFileList(),
-   theInterleaveType(OSSIM_BIL),
-   theRawImageRect(0,0,0,0),
-   theValidImageRect(0,0,0,0),
-   theImageRect(0,0,0,0),
-   theSubImageOffset(0,0),
-   theHeaderSize(0),
-   theSetNullsMode(NONE),
-   thePixelsToChop(0),
-   theImageDataByteOrder(OSSIM_LITTLE_ENDIAN)
-{
-   theRawImageRect.makeNan();
-   theValidImageRect.makeNan();
-   theImageRect.makeNan();
-   
-   loadState(kwl, prefix);
-}
-
-ossimGeneralRasterInfo::ossimGeneralRasterInfo( const ossimGeneralRasterInfo& obj )
-   :
-   theMetaData           ( obj.theMetaData ),
-   theImageFileList      ( obj.theImageFileList ),
-   theInterleaveType     ( obj.theInterleaveType ),
-   theRawImageRect       ( obj.theRawImageRect ),
-   theValidImageRect     ( obj.theValidImageRect ),
-   theImageRect          ( obj.theImageRect ),
-   theSubImageOffset     ( obj.theSubImageOffset ),
-   theHeaderSize         ( obj.theHeaderSize ),
-   theSetNullsMode       ( obj.theSetNullsMode ),
-   thePixelsToChop       ( obj.thePixelsToChop ),
-   theImageDataByteOrder ( obj.theImageDataByteOrder )
-{
-}
-
-const ossimGeneralRasterInfo& ossimGeneralRasterInfo::operator=(
-   const ossimGeneralRasterInfo& rhs )
-{
-   if ( this != &rhs )
-   {
-      theMetaData           = rhs.theMetaData;
-      theImageFileList      = rhs.theImageFileList;
-      theInterleaveType     = rhs.theInterleaveType;
-      theRawImageRect       = rhs.theRawImageRect;
-      theValidImageRect     = rhs.theValidImageRect;
-      theImageRect          = rhs.theImageRect;
-      theSubImageOffset     = rhs.theSubImageOffset;
-      theHeaderSize         = rhs.theHeaderSize;
-      theSetNullsMode       = rhs.theSetNullsMode;
-      thePixelsToChop       = rhs.thePixelsToChop;
-      theImageDataByteOrder = rhs.theImageDataByteOrder;
-   }
-   return *this;
-}
-
-ossimGeneralRasterInfo::~ossimGeneralRasterInfo()
-{
-}
-
-void ossimGeneralRasterInfo::clear()
-{
-   theMetaData.clear();
-   theImageFileList.clear();
-   theInterleaveType = OSSIM_BIL;
-   theRawImageRect.makeNan();
-   theValidImageRect.makeNan();
-   theImageRect.makeNan();
-   theSubImageOffset.x = 0;
-   theSubImageOffset.y = 0;
-   theHeaderSize = 0;
-   theSetNullsMode = NONE;
-   thePixelsToChop = 0;
-   theImageDataByteOrder = OSSIM_LITTLE_ENDIAN;
-}
-
-const ossimIrect& ossimGeneralRasterInfo::imageRect() const
-{
-   return theImageRect;
-}
-
-const ossimIrect& ossimGeneralRasterInfo::validImageRect() const
-{
-   return theValidImageRect;
-}
-
-const ossimIrect& ossimGeneralRasterInfo::rawImageRect() const
-{
-   return theRawImageRect;
-}
-
-const ossimIpt& ossimGeneralRasterInfo::subImageOffset() const
-{
-   return theSubImageOffset;
-}
-
-ossim_int32 ossimGeneralRasterInfo::headerSize() const
-{
-   return theHeaderSize;
-}
-
-ossim_uint32 ossimGeneralRasterInfo::fillToNullsMode() const
-{
-   return theSetNullsMode;
-}
-  
-std::ostream& ossimGeneralRasterInfo::print(std::ostream& out) const
-{
-   //---
-   // This will print in a keyword format that can be read by the constructor.
-   // that takes a keyword list.
-   //---
-   ossimKeywordlist kwl;
-   saveState( kwl, 0 );
-   out << kwl << std::endl;
-   return out;
-}
-
-void ossimGeneralRasterInfo::setFillToNullsMode(ossim_uint32 mode)
-{
-   static const char MODULE[] = "ossimGeneralRasterInfo::setFillToNullMode";
-   if(mode < 3)
-   {
-      theSetNullsMode = (ossimFillMode)mode;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nmode out of bounds(0 - 2):  " << mode << std::endl
-         << "\nmode has not been changed." << std::endl;
-   }
-}
-
-ossim_int32 ossimGeneralRasterInfo::pixelsToChop() const
-{
-   return thePixelsToChop;
-} 
-
-ossimInterleaveType ossimGeneralRasterInfo::interleaveType() const
-{
-   return theInterleaveType;
-}
-
-const std::vector<ossimFilename>& ossimGeneralRasterInfo::getImageFileList() const
-{
-   return theImageFileList;
-}
-
-void ossimGeneralRasterInfo::setImageFileList(const std::vector<ossimFilename>& list)
-{
-   theImageFileList = list;
-}
-
-void ossimGeneralRasterInfo::setImageFile(const ossimFilename& file)
-{
-   theImageFileList.clear();
-   theImageFileList.push_back( file );
-}   
-
-void ossimGeneralRasterInfo::setImageDataByteOrder(ossimByteOrder byteOrder)
-{
-   theImageDataByteOrder = byteOrder;
-}
-
-void ossimGeneralRasterInfo::setHeaderSize(ossim_int32 headerSize)
-{
-   theHeaderSize = headerSize;
-}
-
-void ossimGeneralRasterInfo::setInterleaveType(ossimInterleaveType il_type)
-{
-   theInterleaveType = il_type;
-}
-
-void ossimGeneralRasterInfo::setImageRect(const ossimIrect& imageRect)
-{
-   theImageRect = imageRect;
-}
-
-void ossimGeneralRasterInfo::setValidImageRect(const ossimIrect &imageRect)
-{
-   theValidImageRect = imageRect;
-}
-
-void ossimGeneralRasterInfo::setRawImageRect(const ossimIrect &imageRect)
-{
-   theRawImageRect = imageRect;
-}
-
-void ossimGeneralRasterInfo::setSubImageOffset(const ossimIpt& d)
-{
-   theSubImageOffset = d;
-}
-
-ossimByteOrder ossimGeneralRasterInfo::getImageDataByteOrder() const
-{
-   return theImageDataByteOrder;
-}  
-
-bool ossimGeneralRasterInfo::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix) const
-{
-   for (ossim_uint32 i=0; i<theImageFileList.size(); ++i)
-   {
-      ossimString kw = ossimKeywordNames::FILENAME_KW;
-      kw += ossimString::toString(i+1);
-      kwl.add(prefix, theImageFileList[i].c_str());
-   }
-
-   theMetaData.saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           NUMBER_LINES,
-           ossimString::toString( rawLines() ), true);
-   kwl.add(prefix,
-           NUMBER_SAMPLES,
-           ossimString::toString( rawSamples() ),
-           true);
-   kwl.add(prefix,
-           HEADER_SIZE,
-           ossimString::toString(theHeaderSize),
-           true);
-   kwl.add(prefix,
-           SUB_IMAGE_OFFSET_LINE,
-           theSubImageOffset.line,
-           true);
-   kwl.add(prefix,
-           SUB_IMAGE_OFFSET_SAMP,
-           theSubImageOffset.samp,
-           true);
-   kwl.add(prefix,
-           VALID_START_LINE,
-           theValidImageRect.ul().y,
-           true);
-   kwl.add(prefix,
-           VALID_STOP_LINE,
-           theValidImageRect.lr().y,
-           true);
-   kwl.add(prefix,
-           VALID_START_SAMPLE,
-           theValidImageRect.ul().x,
-           true);
-   kwl.add(prefix,
-           VALID_STOP_SAMPLE,
-           theValidImageRect.ur().x,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::INTERLEAVE_TYPE_KW,
-           INTERLEAVE_TYPE_LUT.getEntryString(theInterleaveType),
-           true);
-
-   kwl.add(prefix,
-           PIXELS_TO_CHOP,
-           thePixelsToChop,
-           true);
-
-   kwl.add(prefix,
-           SET_NULLS,
-           theSetNullsMode,
-           true);
-
-
-   if (bytesPerPixel() > 1)
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::BYTE_ORDER_KW,
-              (theImageDataByteOrder == OSSIM_LITTLE_ENDIAN ? "little_endian" :
-               "big_endian"),
-              true);
-   }
-
-   return true;
-}
-
-bool ossimGeneralRasterInfo::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   static const char MODULE[] = "ossimGeneralRasterInfo::loadState";
-   if ( traceDebug() )
-   {
-      CLOG << "DEBUG: entered..."
-           << "\nprefix:  " << (prefix ? prefix : "")
-           << "\nInput keyword list:\n"
-           << kwl
-           << std::endl;
-   }   
-
-   bool result = false;
-
-   //---
-   // Look for required and option keyword.  Break from loop if required
-   // keyword is not found.
-   //---
-   while( 1 )
-   {
-      // Check for errors in the ossimKeywordlist.
-      if(kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-      {
-        if(traceDebug())
-        {
-          ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:\n"
-            << "Detected an error in the keywordlist:  " << kwl
-            << std::endl;
-        }
-         break;
-      }
-
-      std::string key;
-      ossimString value; // Use for keyword list lookups.
-      ossim_int32 lines = 0;
-      ossim_int32 samples = 0;
-
-      // Lines (required):
-      key = NUMBER_LINES;
-      value.string() = kwl.findKey( key );  // Required to have this.
-      if ( value.size() )
-      {
-         lines = value.toInt32();
-         if ( !lines )
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << " ERROR:\n"
-                  << "Required number of lines is 0!" << std::endl;
-            }
-            break;
-         } 
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << " ERROR:\n"
-               << "Required keyword not found:  " << key << std::endl;
-         }
-         break;
-      }
-
-      // Samples (required):
-      key = NUMBER_SAMPLES;
-      value.string() = kwl.findKey( key );  // Required to have this.
-      if ( value.size() )
-      {
-         samples = value.toInt32();
-         if ( !samples )
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << " ERROR:\n"
-                  << "Required number of samples is 0!" << std::endl;
-            }
-            break;
-         }          
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << " ERROR:\n"
-               << "Required keyword not found:  " << key << std::endl;
-         }
-         break;
-      }
-      
-      // Bands ossimImageMetaData::loadState checks for required bands:
-      if(!theMetaData.loadState(kwl, prefix))
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << " Error loading meta data!\n" << std::endl;
-         }
-         break;
-      }
-
-      // If we get here assign the rectangles:
-      theRawImageRect   = ossimIrect( 0, 0, samples - 1, lines - 1 );
-      theValidImageRect = theRawImageRect;
-      theImageRect      = theRawImageRect;
-
-      int tmp = INTERLEAVE_TYPE_LUT.getEntryNumber(kwl);
-      if (tmp == ossimLookUpTable::NOT_FOUND)
-      {
-         theInterleaveType = OSSIM_BIL;
-      }
-      else
-      {
-         theInterleaveType = static_cast<ossimInterleaveType>(tmp);
-      }
-      
-      // Get the image files.
-      if (theInterleaveType != OSSIM_BSQ_MULTI_FILE)
-      {
-         // Look for "filename" first, then deprecated "image_file".
-         key = ossimKeywordNames::FILENAME_KW;
-         value.string() = kwl.findKey( key );
-         if ( value.empty() )
-         {
-            // deprecated keyword...
-            key = ossimKeywordNames::IMAGE_FILE_KW;
-            value.string() = kwl.findKey( key );
-         }
-         
-         if ( value.size() )
-         {
-            //---
-            // omd (ossim metadata) files can have just the base filename, e.g. image.ras,
-            // in which case open will fail if not in the image dir.  So only put it in
-            // the list if it doesn't exits.
-            //---
-            ossimFilename f = value;
-            if ( f.exists() )
-            {
-               theImageFileList.clear();
-               theImageFileList.push_back(ossimFilename(value));
-            }
-         }
-
-         if ( theImageFileList.empty() )
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ERROR:\n"
-                  << "Required keyword not found:  "
-                  << ossimKeywordNames::FILENAME_KW << std::endl;
-            }
-            break;
-         }
-      }
-      else
-      {
-         // multiple file names.
-         ossim_int32 count = 0;
-         
-         // look for image file key word with no number.
-         // Required to have this.
-         key = ossimKeywordNames::FILENAME_KW;
-         value.string() = kwl.findKey( key );
-         if ( value.empty() )
-         {
-            // deprecated keyword...
-            key = ossimKeywordNames::IMAGE_FILE_KW;
-            value.string() = kwl.findKey( key );
-         }
-         
-         if ( value.size() )
-         {
-            theImageFileList.push_back(ossimFilename(value));
-            ++count;
-         }
-         
-         ossim_int32 i = 0;
-         while ( (count < numberOfBands()) && (i < 1000) )
-         {
-            key = ossimKeywordNames::FILENAME_KW;
-            key += ossimString::toString(i).string();
-            value.string() = kwl.findKey( key );
-            if ( value.empty() )
-            {
-               // Lookup for deprecated keyword.
-               key = ossimKeywordNames::IMAGE_FILE_KW;
-               key += ossimString::toString(i).string();
-               value.string() = kwl.findKey( key );
-            }
-            
-            if ( value.size() )
-            {
-               theImageFileList.push_back(ossimFilename(value));
-               ++count;
-            }
-            ++i;
-         }
-         
-         if (count != numberOfBands())  // Error, count should equal bands!
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << " ERROR:\n"
-                  << "Required keyword not found:  "
-                  << ossimKeywordNames::FILENAME_KW
-                  << "\nInterleave type is multi file; however,"
-                  << " not enough were pick up!"  << std::endl;
-            }
-            break;
-         }
-      }
-
-      key = VALID_START_LINE;
-      value.string() = kwl.findKey( key ); // Default is zero.
-      if ( value.size() )
-      {
-         theValidImageRect.set_uly( value.toInt32() );
-      }
-
-      key = VALID_STOP_LINE;
-      value.string() = kwl.findKey( key ); // Default is last line.
-      if ( value.size() )
-      {
-         theValidImageRect.set_lry( value.toInt32() );
-      }
-      
-      if (theValidImageRect.lr().y < theValidImageRect.ul().y)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << " ERROR:"
-            << "\nValid stop line < start line."
-            << "\nValid start line:  " << theValidImageRect.ul().y
-            << "\nValid stop line:   " << theValidImageRect.lr().y
-            << "\nError status has been set.  Returning." << std::endl;
-         break;
-      }
-
-      key = VALID_START_SAMPLE;
-      value.string() = kwl.findKey( key ); // Default is zero.
-      if ( value.size() )
-      {
-         theValidImageRect.set_ulx( value.toInt32() );
-      }
-
-      key = VALID_STOP_SAMPLE;
-      value.string() = kwl.findKey( key ); // Default is last sample.
-      if ( value.size() ) 
-      {
-         theValidImageRect.set_lrx( value.toInt32() );
-      }
-      
-      if (theValidImageRect.lr().x < theValidImageRect.ul().x)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << " ERROR:"
-            << "\nValid stop samp < start samp."
-            << "\nValid start samp:  " << theValidImageRect.ul().x
-            << "\nValid stop samp:   " << theValidImageRect.lr().x
-            << "\nError status has been set.  Returning." << std::endl;
-         break;
-      }
-      
-      theImageRect.set_lry(theValidImageRect.lr().y -
-                           theValidImageRect.ul().y);
-      theImageRect.set_lrx(theValidImageRect.lr().x -
-                           theValidImageRect.ul().x);
-      
-      key = SUB_IMAGE_OFFSET_LINE;
-      value.string() = kwl.findKey( key ); // Default is zero.
-      if ( value.size() )
-      {
-         theSubImageOffset.line = value.toInt32();
-      }
-
-      key = SUB_IMAGE_OFFSET_SAMP;
-      value.string() = kwl.findKey( key ); // Default is zero.
-      if ( value.size() )
-      {
-         theSubImageOffset.samp = atoi(value);
-      }
-
-      key = HEADER_SIZE;
-      value.string() = kwl.findKey( key ); // Default is zero.
-      if ( value.size() )
-      {
-         theHeaderSize = value.toInt32();
-      }
-
-      key = SET_NULLS;
-      value.string() = kwl.findKey( key ); // Default is 2.
-      if ( value.size() )
-      {
-         int tmp;
-         tmp = atoi(value);
-         if ((tmp < 3) && (tmp > -1))
-         {
-            theSetNullsMode = (ossimFillMode)tmp;
-         }
-         else
-         {
-            theSetNullsMode = ZEROES_TO_NULL_EDGES_ONLY;  // 2
-            ossimNotify(ossimNotifyLevel_WARN)
-               << " WARNING:"
-               << "\nset_fill_to_nulls_mode value out of range."
-               << "\nDefaulted to 2" << std::endl;
-         }
-      }
-
-      key = PIXELS_TO_CHOP;
-      value.string() = kwl.findKey( key ); // Default is zero.
-      if ( value.size() )
-      {
-         thePixelsToChop = value.toInt32();
-      }
-      
-      if (bytesPerPixel() > 1)
-      {
-         // get the byte order of the data.
-         key = ossimKeywordNames::BYTE_ORDER_KW;
-         value.string() = kwl.findKey( key );
-         if ( value.size() )
-         {
-            ossimString s(value);
-            if (s.trim() != "")  // Check for empty string.
-            {
-               s.downcase();
-               if (s.contains("big"))
-               {
-                  theImageDataByteOrder = OSSIM_BIG_ENDIAN;
-               }
-               else if(s.contains("little"))
-               {
-                  theImageDataByteOrder = OSSIM_LITTLE_ENDIAN;
-               }
-            }
-         }
-      }
-
-      // End of while forever loop.
-      result = true;
-      break;
-
-   } // Matches: while (1)
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE  << " Exit status: " << (result?"true":"false") << std::endl;
-   }      
-   
-   return result;
-   
-} // End: bool ossimGeneralRasterInfo::loadState
-
-bool ossimGeneralRasterInfo::open( const ossimFilename& imageFile )
-{
-   static const char MODULE[] = "ossimGeneralRasterInfo::open";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..." << "\nimageFile: " << imageFile << std::endl;
-   }
-
-   bool result = false;
-
-   // Wipe any previous state slick.
-   clear();
-
-   ossimFilename copyFile = imageFile;
-   if ( !imageFile.exists() )
-   {
-      copyFile = imageFile.expand();
-   }
-
-   // Look for the headrer of omd file as they are written out by img2rr.
-   ossimFilename hdr = copyFile;
-   hdr.setExtension("hdr"); // image.hdr
-   if ( !hdr.exists() )
-   {
-      hdr = imageFile;
-      hdr.string() += ".hdr"; // image.ras.hdr
-      if ( ! hdr.exists() )
-      {
-         hdr = imageFile;
-         hdr.setExtension("xml"); // image.xml
-      }
-   }
-
-   if ( hdr.exists() )
-   {
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "header file: " << hdr << std::endl;
-      }
-      
-      ossimString ext = hdr.ext().downcase();
-      
-      if ( ext == "hdr" )
-      {
-         if ( ossimEnviHeader::isEnviHeader( hdr ) )
-         {
-            result = initializeFromEnviHdr( hdr );
-         }
-         else
-         {
-            result = initializeFromHdr( imageFile, hdr );
-         }
-
-         if ( !result )
-         {
-            // Could be an ossim meta data file:
-            ossimKeywordlist kwl( hdr );
-            result = loadState( kwl, 0 );
-         }
-      }
-      else if ( ext == "xml" )
-      {
-         result = initializeFromXml( imageFile, hdr );
-      }
-   }
-   
-   //---
-   // Set the file name.  Needed for ossimGeneralRasterTileSource::open.
-   // Note set here above loadState call to stop loadState from returning
-   // false if no image file found.
-   //---
-   if ( theImageFileList.empty() )
-   {
-      setImageFile( imageFile );
-   }
-   
-   ossimFilename omd = imageFile;
-   omd.setExtension("omd"); // image.omd
-   if ( !omd.exists() )
-   {
-      omd.setExtension("kwl"); // image.kwl
-   }
-
-   if ( omd.exists() )
-   {
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "omd file: " << omd << std::endl;
-      }
-
-      ossimKeywordlist kwl( omd );
-
-      if ( result && theMetaData.getNumberOfBands() )
-      {
-         //---
-         // Just update the band info in case it has min/max values from
-         // a compute min/max scan.
-         //---
-         theMetaData.updateMetaData( kwl, std::string("") );
-      }
-      else
-      {
-         // We're not initialized yet so do a loadState:
-         result = loadState( kwl, 0 );
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE  << " Exit status: " << (result?"true":"false") << std::endl;
-   }
-   
-   return result;
-}
-
-bool ossimGeneralRasterInfo::initializeFromHdr( const ossimFilename& imageFile,
-                                                const ossimFilename& headerFile )
-{
-   bool result = false;
-
-   ossimKeywordlist kwl;
-   char delimeter = ' ';
-   kwl.change_delimiter(delimeter);
-
-   if ( kwl.addFile(headerFile) )
-   {
-      kwl.downcaseKeywords();
-      ossimString value;
-   
-      while( 1 ) 
-      {
-         //---
-         // Go through the data members in order.
-         // If a required item is not found break from loop.
-         //--
-         theMetaData.clear();
-
-         // scalar ( default ) - adjusted below :
-         theMetaData.setScalarType( OSSIM_UINT8 );
-
-         // Image file name:
-         theImageFileList.clear();
-         theImageFileList.push_back( imageFile );
-         
-         // interleave ( not required - default=BIL)
-         theInterleaveType = OSSIM_BIL;
-         value.string() = kwl.findKey( std::string("layout") );
-         if ( value.size() )
-         {
-            ossimInterleaveTypeLut lut;
-            ossim_int32 intrlv = lut.getEntryNumber( value.string().c_str(), true );
-            if ( intrlv != ossimLookUpTable::NOT_FOUND )
-            {
-               theInterleaveType = static_cast<ossimInterleaveType>(intrlv);
-            }
-         }
-
-         // bands ( required ):
-         ossim_uint32 bands = 0;
-         value.string() = kwl.findKey( std::string("nbands") );
-         if ( value.size() )
-         {
-            bands = value.toUInt32();
-         }
-         if ( !bands )
-         {
-            break;
-         }
-         theMetaData.setNumberOfBands( bands );
-
-         // lines ( required ):
-         ossim_int32 lines = 0;
-         value.string() = kwl.findKey( std::string("nrows") );
-         if ( value.size() )
-         {
-            lines = value.toInt32();
-         }
-         if ( !lines )
-         {
-            break;
-         }
-         
-         // samples ( required ):
-         ossim_int32 samples = 0;
-         value.string() = kwl.findKey( std::string("ncols") );
-         if ( value.size() )
-         {
-            samples = value.toInt32();
-         }
-         if ( !samples )
-         {
-            break;
-         }
-
-         // nodata or null value ( not required )
-         value.string() = kwl.findKey( std::string("nodata") );
-         if ( value.empty() )
-         {
-            value.string() = kwl.findKey( std::string("nodata_value") );
-         }
-         if ( value.size() )
-         {
-            ossim_float64 nullValue = value.toUInt32();
-            for ( ossim_uint32 band = 0; band < theMetaData.getNumberOfBands(); ++band )
-            {
-               theMetaData.setNullPix( band, nullValue );
-            }
-            theMetaData.setNullValuesValid(true);
-         }
-
-         // Set the rectangles:
-         theRawImageRect   = ossimIrect( 0, 0, samples - 1, lines - 1 );
-         theValidImageRect = theRawImageRect;
-         theImageRect      = theRawImageRect;         
-
-         // sample start ( not required ):
-         theSubImageOffset.x = 0;
-
-         // line start ( not required ):
-         theSubImageOffset.y = 0;
-
-         // header offset ( not required ):
-         theHeaderSize = 0;
-
-         // null mode:
-         theSetNullsMode = ossimGeneralRasterInfo::NONE;
-
-         // pixels to chop:
-         thePixelsToChop = 0; 
-
-         // Byte order, ( not required - defaulted to system if not found.
-         theImageDataByteOrder = ossim::byteOrder();
-         value.string() = kwl.findKey( std::string("byteorder") );
-         if ( value.size() )
-         {
-            ossim_uint32 i = value.toUInt32();
-            if ( i == 0 )
-            {
-               theImageDataByteOrder = OSSIM_LITTLE_ENDIAN;
-            }
-            else
-            {
-               theImageDataByteOrder = OSSIM_BIG_ENDIAN;
-            }
-         }
-
-         // Pixel type used for scalar below:
-         std::string pixelType = "N"; // not defined
-         value.string() = kwl.findKey( std::string("pixeltype") );
-         if ( value.size() )
-         {
-            pixelType = value.string();
-         }
-         
-         ossim_int32 nbits = -1;
-         value.string() = kwl.findKey( std::string("nbits") );
-         if ( value.size() )
-         {
-            nbits = value.toInt32();
-         }
-         else
-         {
-            nbits = getBitsPerPixel( imageFile );
-         }
-
-         switch( nbits )
-         {
-            case 8:
-            {
-               theMetaData.setScalarType( OSSIM_UINT8 );
-               break;
-            }
-            case 16:
-            {
-               if (pixelType == "S")
-               {
-                  theMetaData.setScalarType( OSSIM_SINT16 );
-               }
-               else
-               {
-                  theMetaData.setScalarType( OSSIM_UINT16 );
-               }
-               break;
-            }
-            case 32:
-            {
-               if( pixelType == "S")
-               {
-                  theMetaData.setScalarType( OSSIM_SINT32 );
-               }
-               else if( pixelType == "F")
-               {
-                  theMetaData.setScalarType( OSSIM_FLOAT32 );
-               }
-               else
-               {
-                  theMetaData.setScalarType( OSSIM_UINT32 );
-               }
-               break;
-            }
-            default:
-            {
-               if( (nbits < 8) && (nbits >= 1 ) )
-               {
-                  theMetaData.setScalarType( OSSIM_UINT8 );
-               }
-               break;
-            }
-         }
-
-         result = true;
-         break; // Trailing break to get out.
-      }
-   }
-
-   return result;
-   
-} // End: ossimGeneralRasterInfo::initializeFromHdr
-
-
-bool ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimFilename& headerFile )
-{
-   bool result = false;
-   ossimEnviHeader hdr;
-   if( hdr.open( headerFile ) )
-   {
-      result = initializeFromEnviHdr( hdr );
-   }
-   return result;
-}
-
-bool ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimEnviHeader& enviHdr )
-{
-   bool result = false;
-
-   while( 1 ) 
-   {
-      //---
-      // Go through the data members in order.
-      // If a required item is not found break from loop.
-      //--
-      theMetaData.clear();
-      
-      // scalar ( required ) :
-      if( enviHdr.getOssimScalarType() != OSSIM_SCALAR_UNKNOWN )
-      {
-         theMetaData.setScalarType( enviHdr.getOssimScalarType() );
-      }
-      else
-      {
-         break;
-      }
-      
-      theImageFileList.clear();
-      
-      // interleave ( required ):
-      theInterleaveType = enviHdr.getOssimInterleaveType();
-      if ( theInterleaveType == OSSIM_INTERLEAVE_UNKNOWN )
-      {
-         break;
-      }
-      
-      // bands ( required ):
-      if ( !enviHdr.getBands() )
-      {
-         break;
-      }
-      theMetaData.setNumberOfBands( enviHdr.getBands() );
-      
-      // lines ( required ):
-      ossim_uint32 lines = enviHdr.getLines();
-      if ( !lines )
-      {
-         break;
-      }
-      
-      // samples ( required ):
-      ossim_uint32 samples = enviHdr.getSamples();
-      if ( !samples )
-      {
-         break;
-      }
-      
-      // Set the rectangles:
-      theRawImageRect   = ossimIrect( 0, 0, samples - 1, lines - 1 );
-      theValidImageRect = theRawImageRect;
-      theImageRect      = theRawImageRect;         
-
-      // sample start ( not required ):
-      theSubImageOffset.x = enviHdr.getXStart();
-      
-      // line start ( not required ):
-      theSubImageOffset.y = enviHdr.getYStart();
-      
-      // header offset ( not required ):
-      theHeaderSize = enviHdr.getHeaderOffset();
-      
-      // null mode:
-      theSetNullsMode = ossimGeneralRasterInfo::NONE;
-      
-      // pixels to chop:
-      thePixelsToChop = 0; 
-      
-      // Byte order, this will be system if not found.
-      theImageDataByteOrder = enviHdr.getByteOrder();
-      
-      result = true;
-      break; // Trailing break to get out.
-   }
-   return result;
-   
-} // End: ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimEnviHeader& )
-
-bool ossimGeneralRasterInfo::initializeFromXml( const ossimFilename& imageFile,
-                                                const ossimFilename& headerFile )
-{
-   bool result = false;
-
-   ossimFgdcXmlDoc file;
-   if (file.open( headerFile ))
-   {
-      while( 1 ) 
-      {
-         //---
-         // Go through the data members in order.
-         // If a required item is not found break from loop.
-         //--
-         theMetaData.clear();
-
-         // scalar ( default ) - adjusted below :
-         theMetaData.setScalarType( OSSIM_UINT8 );
-
-         // Image file name:
-         theImageFileList.clear();
-         theImageFileList.push_back( imageFile );
-
-         // interleave ( defaulted ):
-         theInterleaveType = OSSIM_BIL;
-
-         // bands ( required ):
-         if ( !file.getNumberOfBands() )
-         {
-            break;
-         }
-         theMetaData.setNumberOfBands( file.getNumberOfBands() );
-         
-         ossimIpt size;
-         if ( file.getImageSize(size) ) // Lines, samples not image file size.
-         {
-            // lines, samples ( required ):
-            if ( !size.x || !size.y )
-            {
-               break;
-            }
-         }
-         else
-         {
-            break;
-         }
-
-         // Set the rectangles:
-         theRawImageRect   = ossimIrect( 0, 0, size.x - 1, size.y - 1 );
-         theValidImageRect = theRawImageRect;
-         theImageRect      = theRawImageRect;         
-
-         // sample start ( not required ):
-         theSubImageOffset.x = 0;
-
-         // line start ( not required ):
-         theSubImageOffset.y = 0;
-
-         // header offset ( not required ):
-         theHeaderSize = 0;
-
-         // null mode:
-         theSetNullsMode = ossimGeneralRasterInfo::NONE;
-
-         // pixels to chop:
-         thePixelsToChop = 0; 
-
-         // Byte order *** need this ***, defaulting to system for now:
-         theImageDataByteOrder = ossim::byteOrder();
-
-         // Adjust scalar if needed, note defaulted to 8 bit above:
-         ossimString eainfo;
-         file.getPath("/metadata/eainfo/detailed/enttyp/enttypd", eainfo);
-         ossim_int32 numBits = 0;
-         ossim_int64 fileSize = imageFile.fileSize(); // Image file size.
-         ossim_int32 numBytes = fileSize / size.x / size.y / numberOfBands();
-         if( numBytes > 0 && numBytes != 3 )
-         {
-            numBits = numBytes*8;
-         }
-         if( numBits == 16 )
-         {
-            theMetaData.setScalarType( OSSIM_UINT16 );
-         }
-         else if( numBits == 32 )
-         {
-            if(eainfo.contains("float"))
-            {
-               theMetaData.setScalarType( OSSIM_FLOAT32 );
-            }
-            else
-            {
-               theMetaData.setScalarType( OSSIM_UINT32 );
-            }
-         }
-
-         result = true;
-         break; // Trailing break to get out.
-      }
-   }
-
-   return result;
-   
-} // End: ossimGeneralRasterInfo::initializeFromXml
-
-ossim_int32 ossimGeneralRasterInfo::getBitsPerPixel( const ossimFilename& imageFile ) const
-{
-   // Note currently does not consider header size.
-   ossim_int32 result = 0;
-   
-   ossim_int64 fileSize = imageFile.size();
-   ossimIpt rectSize = theRawImageRect.size();
-   if ( fileSize && rectSize.x && rectSize.y && numberOfBands() )
-   {
-      result = ( fileSize / rectSize.x / rectSize.y / numberOfBands() ) * 8;
-   }
-   return result;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimGeneralRasterTileSource.cpp b/ossim/src/ossim/imaging/ossimGeneralRasterTileSource.cpp
deleted file mode 100644
index 1f7eb7b..0000000
--- a/ossim/src/ossim/imaging/ossimGeneralRasterTileSource.cpp
+++ /dev/null
@@ -1,1601 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimGeneralRasterTileSource.
-//*******************************************************************
-//  $Id: ossimGeneralRasterTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimGeneralRasterTileSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimInterleaveTypeLut.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStreamFactoryRegistry.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageGeometryRegistry.h>
-#include <ossim/projection/ossimMapProjectionFactory.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/support_data/ossimFgdcXmlDoc.h>
-
-RTTI_DEF1_INST(ossimGeneralRasterTileSource,
-               "ossimGeneralRasterTileSource",
-               ossimImageHandler)
-
-static ossimTrace traceDebug("ossimGeneralRasterTileSource:debug");
-
-// For interleave type enum to string conversions.
-static const ossimInterleaveTypeLut ILUT;
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimGeneralRasterTileSource::ossimGeneralRasterTileSource()
-   :
-      ossimImageHandler(),
-      m_tile(0),
-      m_buffer(0),
-      m_lineBuffer(0),
-      m_bufferInterleave(OSSIM_BIL),
-      m_fileStrList(0),
-      m_rasterInfo(),
-      m_bufferRect(0, 0, 0, 0),
-      m_swapBytesFlag(false),
-      m_bufferSizeInPixels(0),
-      m_outputBandList(0)
-{}
-
-ossimGeneralRasterTileSource::~ossimGeneralRasterTileSource()
-{
-   close();
-}
-
-ossimRefPtr<ossimImageData> ossimGeneralRasterTileSource::getTile(
-   const ossimIrect& tile_rect, ossim_uint32 resLevel)
-{
-   if ( m_tile.valid() == false )
-   {
-      allocateTile(); // First time through...
-   }
-   
-   if (m_tile.valid())
-   {
-      // Image rectangle must be set prior to calling getTile.
-      m_tile->setImageRectangle(tile_rect);
-      
-      if ( getTile( m_tile.get(), resLevel ) == false )
-      {
-         if (m_tile->getDataObjectStatus() != OSSIM_NULL)
-         {
-            m_tile->makeBlank();
-         }
-      }
-   }
-   
-   return m_tile;
-}
-
-bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
-                                           ossim_uint32 resLevel)
-{
-   bool status = false;
-   
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel)  &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
-   {
-      //---
-      // Check for overview tile.  Some overviews can contain r0 so always
-      // call even if resLevel is 0.  Method returns true on success, false
-      // on error.
-      //---
-      status = getOverviewTile(resLevel, result);
-      if (status)
-      {
-         if(getOutputScalarType() == OSSIM_USHORT11)
-         {
-            //---
-            // Temp fix:
-            // The overview handler could return a tile of OSSIM_UINT16 if
-            // the max sample value was not set to 2047.
-            //---
-            result->setScalarType(OSSIM_USHORT11);
-         }
-      }
-      
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-         
-         //---
-         // Subtract any sub image offset to get the zero based image space
-         // rectangle.
-         //---
-         ossimIrect tile_rect = result->getImageRectangle();
-         
-         // This should be the zero base image rectangle for this res level.
-         ossimIrect image_rect = getImageRectangle(resLevel);
-         
-         //---
-         // See if any point of the requested tile is in the image.
-         //---
-         if ( tile_rect.intersects(image_rect) )
-         {
-            // Make the tile rectangle zero base.
-            result->setImageRectangle(tile_rect);
-
-            // Initialize the tile if needed as we're going to stuff it.
-            if (result->getDataObjectStatus() == OSSIM_NULL)
-            {
-               result->initialize();
-            }
-
-            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
-
-            if ( ! tile_rect.completely_within(m_bufferRect) )
-            {
-               // A new buffer must be loaded.
-               if ( !tile_rect.completely_within(clip_rect) )
-               {
-                  //---
-                  // Start with a blank tile since the whole tile buffer will
-                  // not be
-                  // filled.
-                  //---
-                  result->makeBlank();
-               }
-
-               // Reallocate the buffer if needed.
-               if ( m_bufferSizeInPixels != result->getSize() )
-               {
-                  allocateBuffer( result );
-               }
-
-               ossimIpt size(static_cast<ossim_int32>(result->getWidth()),
-                             static_cast<ossim_int32>(result->getHeight()));
-
-               if( !fillBuffer(clip_rect.ul(), size) )
-               {
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << "Error from fill buffer..."
-                     << std::endl;
-                  //---
-                  // Error in filling buffer.
-                  //---
-                  setErrorStatus();
-                  status = false;
-               }
-            }
-            
-            result->loadTile(m_buffer,
-                             m_bufferRect,
-                             clip_rect,
-                             m_bufferInterleave);
-            result->validate();
-
-            // Set the rectangle back.
-            result->setImageRectangle(tile_rect);
-            
-         }
-         else // No intersection.
-         {
-            result->makeBlank();
-         }
-      }
-   }
-   return status;
-}
-
-bool ossimGeneralRasterTileSource::fillBuffer(const ossimIpt& origin, const ossimIpt& size)
-{
-
-   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBuffer";
-
-   // Note:  InterleaveType enumerations in "constants.h" file.
-   bool status = false;
-   switch ( m_rasterInfo.interleaveType() )
-   {
-      case OSSIM_BIP:
-      {
-         status = fillBIP(origin, size);
-         break;
-      }
-      case OSSIM_BIL:
-      {
-         status = fillBIL(origin, size);
-         break;
-      }
-      case OSSIM_BSQ:
-      {
-         status = fillBSQ(origin, size);
-         break;
-      }
-      case OSSIM_BSQ_MULTI_FILE:
-      {
-         status = fillBsqMultiFile(origin, size);
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:\n"
-            << " Unsupported interleave type:  "
-            << ILUT.getEntryString(m_rasterInfo.interleaveType())
-            << std::endl;
-      }
-   }
-   
-   if (status && m_swapBytesFlag)
-   {
-      ossimEndian oe;
-      oe.swap(m_rasterInfo.getImageMetaData().getScalarType(),
-              m_buffer,
-              m_bufferSizeInPixels);
-   }
-
-   return status;
-}
-
-bool ossimGeneralRasterTileSource::fillBIP(const ossimIpt& origin, const ossimIpt& size )
-{
-   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBIP ";
-
-   m_bufferRect.set_ul(origin);
-   m_bufferRect.set_lry(min( (origin.y + size.y -1),
-                              m_rasterInfo.imageRect().lr().y));
-   m_bufferRect.set_lrx(min( (origin.x + size.x -1),
-                              m_rasterInfo.imageRect().lr().x));
-
-   const ossim_int32 WIDTH                  = static_cast<ossim_int32>( m_bufferRect.width() ); 
-   const ossim_int32 HEIGHT                 = static_cast<ossim_int32>( m_bufferRect.height() ); 
-   const ossim_int32 INPUT_BANDS            = m_rasterInfo.numberOfBands();
-   const ossim_int32 OUTPUT_BANDS           = static_cast<ossim_int32>( m_outputBandList.size() );
-   const ossim_int32 BYTES_PER_PIXEL        = m_rasterInfo.bytesPerPixel();
-   const ossim_int32 INPUT_BYTES_PER_SAMPLE = BYTES_PER_PIXEL * INPUT_BANDS;
-   const ossim_int32 OUTPUT_BYTES_PER_SAMPLE = BYTES_PER_PIXEL * OUTPUT_BANDS;
-   
-   // Seek position.
-   std::streamoff rasterOffset = m_rasterInfo.offsetToFirstValidSample() +
-        origin.y * m_rasterInfo.bytesPerRawLine() +
-        origin.x * INPUT_BYTES_PER_SAMPLE;
-
-    // Input line buffer, all bands.
-   std::streamsize inputLineBufferWidth = WIDTH * INPUT_BYTES_PER_SAMPLE;
-  
-   // Output buffer width:
-   std::streamsize outputLineBufferWidth = WIDTH * OUTPUT_BYTES_PER_SAMPLE;
-
-#if 0 /* Please keep for debug. (drb) */
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nDEBUG:"
-         << "\norigin:                 " << origin
-         << "\nSeek position:          " << rasterOffset
-         << "\ninputLineBufferWidth:   " << inputLineBufferWidth
-         << "\noutputLineBufferWidth:  " << outputLineBufferWidth
-         << "\nINPUT_BANDS:            " << INPUT_BANDS
-         << "\nOUTPUT_BANDS:           " << OUTPUT_BANDS
-         << std::endl;
-#endif
-   
-   ossim_int32 bufferOffset = 0;   
-   
-   // Line loop:
-   ossim_int32 currentLine = 0;
-   while ( currentLine < HEIGHT )
-   {
-      // Seek to line.
-      m_fileStrList[0]->seekg(rasterOffset, ios::beg);
-      if (!(*m_fileStrList[0]))
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:\n"
-            << " Seek error!  Returning with error..." << std::endl;
-         return false;
-      }
-
-      // Read image data from line for all bands into line buffer.   
-      m_fileStrList[0]->read( (char*)m_lineBuffer, inputLineBufferWidth );
-      if ( m_fileStrList[0]->gcount() != inputLineBufferWidth ) 
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << "\nERROR:  Reading image line." << std::endl;
-         return false;
-      }
-      
-      // Sample loop:
-      for ( ossim_int32 sample = 0; sample < WIDTH; ++sample )
-      {
-         // Band loop:
-         for ( ossim_int32 band = 0; band < OUTPUT_BANDS; ++band )
-         {
-            ossim_int32 selectedBand = static_cast<ossim_int32>(m_outputBandList[band]);
-            memcpy( (void*)(m_buffer + bufferOffset +
-                            sample * OUTPUT_BYTES_PER_SAMPLE +
-                            band * BYTES_PER_PIXEL),
-                    (void*)(m_lineBuffer +
-                            sample * INPUT_BYTES_PER_SAMPLE + 
-                            selectedBand * BYTES_PER_PIXEL),
-                    BYTES_PER_PIXEL );
-         }
-      }
-               
-      ++currentLine;
-      bufferOffset += outputLineBufferWidth;
-      rasterOffset += m_rasterInfo.bytesPerRawLine();
-   }
-   
-   return true;
-   
-} // End: bool ossimGeneralRasterTileSource::fillBipBandSelect(...
-
-bool ossimGeneralRasterTileSource::fillBIL(const ossimIpt& origin,
-                                           const ossimIpt& size)
-{
-   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBIL";
-   
-   //***
-   // This will fill a buffer the full width of valid samples * tileHeight().
-   //***
-   m_bufferRect.set_ul(origin);
-   m_bufferRect.set_lry(min((origin.y + size.y - 1),
-                             m_rasterInfo.imageRect().lr().y));
-   m_bufferRect.set_lrx(min((origin.x + size.x - 1),
-                             m_rasterInfo.imageRect().lr().x));
-   
-   ossim_sint64 currentLine = origin.y;
-
-   // Bytes in one line all bands.
-   const std::streamoff LINE_OFFSET =
-      m_rasterInfo.bytesPerRawLine() * m_rasterInfo.numberOfBands();
-
-   // Start seek position.
-   std::streamoff offset = ( m_rasterInfo.offsetToFirstValidSample() +
-                             currentLine * LINE_OFFSET +
-                             origin.x * m_rasterInfo.bytesPerPixel() );
-
-   //---
-   // Loop through and process lines. 
-   //---
-   ossim_int32 linesProcessed = 0;
-   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
-   ossim_uint8* buf = m_buffer;
-
-#if 0 /* Please leave for debug.  (drb) */
-   ossimNotify(ossimNotifyLevel_DEBUG)
-      << "\nDEBUG:"
-      << "\norigin:                 " << origin
-      << "\nSeek position:          " << offset
-      << "\nStarting line number:   " << currentLine
-      << "\nbuffer_width:           " << buffer_width << std::endl;
-#endif
-
-   // Line loop:
-   while ((currentLine <= static_cast<ossim_sint64>(m_rasterInfo.imageRect().lr().y)) &&
-          linesProcessed < size.y)
-   {
-      // Band loop:
-      std::vector<ossim_uint32>::const_iterator i = m_outputBandList.begin();
-      while ( i != m_outputBandList.end() )
-      {
-         ossim_int64 band = static_cast<ossim_sint64>( (*i) );
-         const std::streamoff bandOffset = band * m_rasterInfo.bytesPerRawLine();
-         
-         // Seek to line.
-         m_fileStrList[0]->seekg(offset + bandOffset, ios::beg);
-         if (!m_fileStrList[0])
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:\n"
-               << " Seek error!  Returning with error..." << std::endl;
-            return false;
-         }
-         
-         // Read the line of image data.   
-         m_fileStrList[0]->read( (char*)buf, buffer_width );
-
-         if ( m_fileStrList[0]->gcount() != buffer_width ) 
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << "\nERROR:  Reading image line."
-               << "\ncurrentLine:  " << currentLine << std::endl;
-            return false;
-         }
-         
-         buf += buffer_width;
-         ++i;
-
-      } // End of band loop.
-      
-      ++linesProcessed;
-      ++currentLine;
-      offset += LINE_OFFSET;
-      
-   } // End: line loop
-   
-   return true;
-}
-   
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimGeneralRasterTileSource::fillBSQ(const ossimIpt& origin,
-                                           const ossimIpt& size)
-{
-   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBSQ";
-
-   // This will fill a buffer the full width of valid samples * tileHeight().
-
-   m_bufferRect.set_ul(origin);
-   
-   m_bufferRect.set_lry(min((origin.y + size.y -1),
-                             m_rasterInfo.imageRect().lr().y));
-   m_bufferRect.set_lrx(min((origin.x + size.x - 1),
-                             m_rasterInfo.imageRect().lr().x));
-   
-   // Start seek position.
-   std::streamoff startSeekPosition
-      = m_rasterInfo.offsetToFirstValidSample() +
-        origin.y * m_rasterInfo.bytesPerRawLine() +
-        origin.x * m_rasterInfo.bytesPerPixel();
-
-   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
-   
-   ossim_uint8* buf = (ossim_uint8*)m_buffer;
-
-   std::streamoff bandOffset
-      = m_rasterInfo.bytesPerRawLine() * m_rasterInfo.rawLines();
-
-#if 0 /* Please leave for debug. (drb) */
-   ossimNotify(ossimNotifyLevel_DEBUG)
-      << "\nDEBUG:"
-      << "\norigin:                 " << origin
-      << "\nSeek position:          " << startSeekPosition
-      << "\nStarting line number:   " << origin.y
-      << "\nbuffer_width:           " << buffer_width
-      << "\nbytesPerRawLine():      "
-      << m_rasterInfo.bytesPerRawLine()
-      << "\nm_rasterInfo.offsetToFirstValidSample():  "
-      << m_rasterInfo.offsetToFirstValidSample()
-      << "\nbandOffset: " << bandOffset << std::endl;
-#endif
-
-   ossim_int32 num_bands = m_rasterInfo.numberOfBands();
-   ossim_int32 height    = size.y;
-
-   // Band loop:
-   for (ossim_int32 band = 0; band < num_bands; ++band)
-   {
-      ossim_sint64 currentLine    = origin.y;
-      ossim_sint64 linesProcessed = 0;
-
-      std::streamoff offset = startSeekPosition + (band * bandOffset);
-
-      // Line loop:
-      while (currentLine <= m_rasterInfo.imageRect().lr().y &&
-             linesProcessed < height)
-      {
-         // Seek to line.
-         m_fileStrList[0]->seekg(offset, ios::beg);
-         if (!m_fileStrList[0])
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:\n"
-               << " Seek error!  Returning with error..." << std::endl;
-            return false;
-         }
-         
-         // Read the line of image data.   
-         m_fileStrList[0]->read( (char*)buf, buffer_width );
-         if ( m_fileStrList[0]->gcount() != buffer_width ) 
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << "\nERROR:  Reading image line."
-               << "\ncurrentLine:  " << currentLine << std::endl;
-            return false;
-         }
-
-         // Increment everybody accordingly.
-         buf += buffer_width;
-         offset += m_rasterInfo.bytesPerRawLine();
-         ++linesProcessed;
-         ++currentLine;
-
-      } // End of line loop.
-
-   } // End of band loop.
-   
-   return true;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimGeneralRasterTileSource::fillBsqMultiFile(const ossimIpt& origin, const ossimIpt& size)
-{
-   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBsqMultiFile";
-
-   if (traceDebug()) CLOG << " Entered..." << std::endl;
-   
-
-   // This will fill a buffer the full width of valid samples * tileHeight().
-   m_bufferRect.set_ul(origin);
-   
-   m_bufferRect.set_lry(min((origin.y + size.y -1),
-                             m_rasterInfo.imageRect().lr().y));
-   m_bufferRect.set_lrx(min((origin.x + size.x - 1),
-                             m_rasterInfo.imageRect().lr().x));
-   
-   //---
-   // Start seek position.
-   //---
-   std::streamoff startSeekPosition = m_rasterInfo.offsetToFirstValidSample() +
-      origin.y * m_rasterInfo.bytesPerRawLine() +
-      origin.x * m_rasterInfo.bytesPerPixel();
-   
-   //---
-   // Loop through and process lines. 
-   //---
-   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
-   
-   ossim_uint8* buf = (ossim_uint8*)m_buffer;
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nDEBUG:"
-         << "\norigin:                 " << origin
-         << "\nSeek position:          " << startSeekPosition
-         << "\nStarting line number:   " << origin.y
-         << "\nbuffer_width:           " << buffer_width
-         << "\nbuffer_rect:            " << m_bufferRect
-         << "\nbytesPerRawLine():      "
-         << m_rasterInfo.bytesPerRawLine()
-         << "\nm_rasterInfo.offsetToFirstValidSample():  "
-         << m_rasterInfo.offsetToFirstValidSample() << std::endl;
-   }
-#endif
-
-   // ossim_int32 num_bands = m_rasterInfo.numberOfBands();
-   std::vector<ossim_uint32>::const_iterator bandIter = m_outputBandList.begin();
-   while ( bandIter != m_outputBandList.end() )
-   {
-      ossim_int32 currentLine    = origin.y;
-      ossim_int32 linesProcessed = 0;
-      ossim_int64 offset         = startSeekPosition;
-      
-      while (currentLine <= m_rasterInfo.imageRect().lr().y && linesProcessed < size.y)
-      {
-         //---
-         // Seek to line.
-         //---
-         m_fileStrList[ *bandIter ]->seekg(offset, ios::beg);
-
-         if ( !m_fileStrList[ *bandIter ] )
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:\n"
-               << " Seek error!  Returning with error..." << std::endl;
-            return false;
-         }
-         
-         //---
-         // Read the line of image data.   
-         //---
-         m_fileStrList[ *bandIter ]->read((char*)buf, buffer_width);
-         
-         if ( m_fileStrList[ *bandIter ]->gcount() != buffer_width) 
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << "\nERROR:  Reading image line."
-               << "\ncurrentLine:  " << currentLine << std::endl;
-            return false;
-         }
-
-         // Increment everybody accordingly.
-         buf += buffer_width;
-         offset += m_rasterInfo.bytesPerRawLine();
-         ++linesProcessed;
-         ++currentLine;
-         
-      } // End of line loop.
-
-      ++bandIter; // Next band...
-
-   } // End: while ( bandIter ! = m_outputBandList.end() )
-   
-   return true;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimGeneralRasterTileSource::saveState(ossimKeywordlist& kwl,
-                                             const char* prefix) const
-{   
-   // Our stuff:
-   m_rasterInfo.saveState(kwl, prefix);
-
-   // Base class:
-   bool result = ossimImageHandler::saveState(kwl, prefix);
-   
-   if ( result && isBandSelector() && m_outputBandList.size() )
-   {
-      if ( isIdentityBandList( m_outputBandList ) == false )
-      {
-         // If we're not identity output the bands.
-         ossimString bandsString;
-         ossim::toSimpleStringList(bandsString, m_outputBandList);
-         kwl.add(prefix,
-                 ossimKeywordNames::BANDS_KW,
-                 bandsString,
-                 true);
-      }
-   }
-   
-   return result;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimGeneralRasterTileSource::loadState(const ossimKeywordlist& kwl,
-                                             const char* prefix)
-{
-   bool result = false;
-   m_outputBandList.clear();
-
-   if ( ossimImageHandler::loadState(kwl, prefix) )
-   {  
-      // Set the band list if key is present.
-      std::string pfx = ( prefix ? prefix : "" );
-      std::string key = ossimKeywordNames::BANDS_KW;
-      ossimString value;
-      value.string() = kwl.findKey( pfx, key );
-      if ( value.size() )
-      {
-         ossim::toSimpleVector( m_outputBandList, value );
-      }
-      result = open();
-   }
-   return result;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossimScalarType ossimGeneralRasterTileSource::getOutputScalarType() const
-{
-   return m_rasterInfo.getImageMetaData().getScalarType();
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimGeneralRasterTileSource::getTileWidth() const
-{
-   ossim_uint32 result = 0;
-   if ( m_tile.valid() )
-   {
-      m_tile->getWidth();
-   }
-   else
-   {
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-      result = tileSize.x;
-   }
-   return result;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimGeneralRasterTileSource::getTileHeight() const
-{
-   ossim_uint32 result = 0;
-   if ( m_tile.valid() )
-   {
-      m_tile->getHeight();
-   }
-   else
-   {
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-      result = tileSize.y;
-   }
-   return result;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool
-ossimGeneralRasterTileSource::isValidRLevel(ossim_uint32 reduced_res_level) const
-{
-   static const char MODULE[] = "ossimGeneralRasterTileSource::isValidRLevel";
-   
-   if (reduced_res_level == 0)
-   {
-      return true;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->isValidRLevel(reduced_res_level);
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE
-         << " Invalid reduced_res_level:  " << reduced_res_level
-         << "\nHighest available:  " << (getNumberOfDecimationLevels() - 1)
-         << std::endl;
-      return false;
-   }
-}
-
-
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32
-ossimGeneralRasterTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return m_rasterInfo.validLines();
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfLines(reduced_res_level);
-   }
-
-   return 0;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossim_uint32 ossimGeneralRasterTileSource::getNumberOfSamples(
-   ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return m_rasterInfo.validSamples();
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfSamples(reduced_res_level);
-   }
-
-   return 0;
-}
-
-double ossimGeneralRasterTileSource::getNullPixelValue(ossim_uint32 band) const
-{
-   return m_rasterInfo.getImageMetaData().getNullPix(band);
-}
-
-double ossimGeneralRasterTileSource::getMinPixelValue(ossim_uint32 band)const
-{
-   return m_rasterInfo.getImageMetaData().getMinPix(band);
-}
-
-double ossimGeneralRasterTileSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   return m_rasterInfo.getImageMetaData().getMaxPix(band);
-}
-
-bool ossimGeneralRasterTileSource::open()
-{
-   static const char MODULE[] = "ossimGeneralRasterTileSource::open";
-
-   if (traceDebug()) CLOG << " Entered..." << std::endl;
-   
-   bool result = false;
-   
-   if(isOpen())
-   {
-      close();
-   }
-   
-   //---
-   // Find the header file:
-   //
-   // We need lines, samples, bands, scalar and interleave at a minimum:
-   // 
-   // A general raster image requires a keyword list to get essential image
-   // information or meta data as its sometimes called.  The meta data file
-   // can have four types of extensions: ".omd", ".hdr", ".kwl" and xml.
-   // Look for them in that order.
-   // Note that the ".omd" extension is for "Ossim Meta Data" and was made
-   // up to avoid conflicting with other software packages ".hdr" files.
-   //---
-   if ( m_rasterInfo.open( theImageFile ) )
-   {
-      theMetaData = m_rasterInfo.getImageMetaData();
-      
-      result = initializeHandler();
-      if ( result )
-      {
-         completeOpen();
-
-         if ( isBandSelector() && m_outputBandList.size() &&
-              ( isIdentityBandList( m_outputBandList ) == false ) )
-         {
-            // This does range checking and will pass to overview if open.
-            setOutputBandList( m_outputBandList );
-         }
-      }
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
-   }
-   return result;
-}
-                                             
-bool ossimGeneralRasterTileSource::open( const ossimGeneralRasterInfo& info )
-{
-   if( isOpen() )
-   {
-      close();
-   }
-   
-   m_rasterInfo = info;
-
-   bool result = initializeHandler();
-
-   if ( result )
-   {
-      completeOpen();  
-
-      if ( isBandSelector() && m_outputBandList.size() &&
-           ( isIdentityBandList( m_outputBandList ) == false ) )
-      { 
-         // This does range checking and will pass to overview if open.
-         setOutputBandList( m_outputBandList );
-      }
-   }
-   
-   return result;
-}
-
-bool ossimGeneralRasterTileSource::initializeHandler()
-{
-   //---
-   // This private method assumes that "m_rasterInfo" object has been
-   // initialized.  Note that "close() should have already been called if
-   // there was an open file prior to this.
-   //---
-   std::vector<ossimFilename> aList = m_rasterInfo.getImageFileList();
-
-   for (ossim_uint32 i=0; i<aList.size(); ++i)
-   {
-      ossimFilename f = aList[i];
-      
-      // open it...
-      ossimRefPtr<ossimIFStream> is = ossimStreamFactoryRegistry::instance()->
-         createNewIFStream(f, std::ios::in|std::ios::binary);
-
-      // check the stream...
-      if(is.valid())
-      {
-         // Check the file stream.
-         if ( is->fail() )
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimGeneralRasterTileSource::open" << " ERROR:\n"
-               << "Cannot open:  " << f.c_str() << std::endl;
-            is = 0;
-            return false;
-         }
-      }
-
-      // Check the file size (removed).
-
-      m_fileStrList.push_back(is); // Add it to the list...
-   }
-
-   if ((aList.size()==1) && theImageFile.empty())
-   {
-      theImageFile = aList[0];
-   }
-
-   // Set the buffer interleave type.
-   m_bufferInterleave = m_rasterInfo.interleaveType();
-   if (m_bufferInterleave == OSSIM_BSQ_MULTI_FILE)
-   {
-      m_bufferInterleave = OSSIM_BSQ;
-   }
-
-   if ( m_outputBandList.empty() )
-   {
-      // Set starting output band list to identity.
-      ossimImageSource::getOutputBandList( m_outputBandList );
-   }
-
-   //---
-   // Get the byte order of the image data and host machine.  If different,
-   // set the swap bytes flag...
-   //---
-   if (m_rasterInfo.getImageDataByteOrder() != ossim::byteOrder())
-   {
-      m_swapBytesFlag = true;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimGeneralRasterTileSource::initializeHandler()" << " DEBUG:"
-         << "\nScalar type:  "
-         << ossimScalarTypeLut::instance()->
-         getEntryString(m_rasterInfo.getImageMetaData().getScalarType())
-         << "\nByte swapping is "
-         << (m_swapBytesFlag?"enabled.":"not enabled.")
-         // << "\nm_bufferSizeInPixels:  " << m_bufferSizeInPixels
-         // << "\nbuffer size:  " << buffer_size
-         << "\nRasterInfo:\n";
-      m_rasterInfo.print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-   
-   return true;
-}
-
-bool ossimGeneralRasterTileSource::isOpen() const
-{
-   bool result = false;
-   if (m_fileStrList.size() > 0)
-   {
-      if(m_fileStrList[0].valid())
-      {
-         result = !(m_fileStrList[0]->fail());
-      }
-   }
-   return result;
-}
-
-void ossimGeneralRasterTileSource::close()
-{
-   ossimImageHandler::close();  // base class
-
-   m_tile = 0; // Not a leak, ref ptr.
-   
-   if ( m_buffer )
-   {
-      delete [] m_buffer;
-      m_buffer = 0;
-      m_bufferSizeInPixels = 0; // Must zero out for check in getTile method.
-   }
-
-   if ( m_lineBuffer )
-   {
-      delete [] m_lineBuffer;
-      m_lineBuffer = 0;
-   }
-
-   std::vector<ossimRefPtr<ossimIFStream> >::iterator is = m_fileStrList.begin();
-   while (is != m_fileStrList.end())
-   {
-      (*is)->close();
-      // delete (*is);
-      // (*is) = 0;
-      ++is;
-   }
-   m_fileStrList.clear();
-}
-
-ossim_uint32 ossimGeneralRasterTileSource::getImageTileWidth() const
-{
-   return 0;
-}
-
-ossim_uint32 ossimGeneralRasterTileSource::getImageTileHeight() const
-{
-   return 0;
-}
-
-ossimString ossimGeneralRasterTileSource::getShortName()const
-{
-   return ossimString("ossim_raster");
-}
-
-ossimString ossimGeneralRasterTileSource::getLongName()const
-{
-   return ossimString("general raster reader");
-}
-
-ossim_uint32 ossimGeneralRasterTileSource::getNumberOfInputBands() const
-{
-   return m_rasterInfo.getImageMetaData().getNumberOfBands();
-}
-
-ossim_uint32 ossimGeneralRasterTileSource::getNumberOfOutputBands() const
-{
-   ossim_uint32 result = 0;
-   if ( isBandSelector() && m_outputBandList.size() )
-   {
-      result = (ossim_uint32)m_outputBandList.size();
-   }
-   else
-   {
-      result = m_rasterInfo.getImageMetaData().getNumberOfBands();
-   }  
-   return result;
-}
-
-ossimKeywordlist ossimGeneralRasterTileSource::getHdrInfo(ossimFilename hdrFile)
-{
-   ossimKeywordlist kwl;
-   char delimeter = ' ';
-   kwl.change_delimiter(delimeter);
-   kwl.addFile(hdrFile);
-   kwl.downcaseKeywords();
-
-   ossimKeywordlist geoKwl;
-   ossim_uint32 lines = 0;
-   ossim_uint32 samples = 0;
-   ossim_float32 noData = -9999;
-   ossimString scalarType = "ossim_uint8";
-   ossim_int32 numBands = 1;
-   // ossim_int32 skipBytes = 0;
-   ossim_int32 numBits = -1; 
-   ossimString chPixelType = "N"; // not defined
-   ossimString interleaveType = "BIL";
-   ossimString byteOrder;
-   bool noDataFound = false;
-
-   const char* lookup = kwl.find("ncols");
-   if (lookup)
-   {
-      samples = ossimString(lookup).toUInt32();
-      geoKwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
-   }
-
-   lookup = kwl.find("nrows");
-   if (lookup)
-   {
-      lines = ossimString(lookup).toUInt32();
-      geoKwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
-   }
-
-   // lookup = kwl.find("skipbytes");
-   // if (lookup)
-   // {
-   //    skipBytes = ossimString(lookup).toInt();
-   // }
-
-   lookup = kwl.find("nbands");
-   if (lookup)
-   {
-      numBands = ossimString(lookup).toInt();
-   }
-
-   lookup = kwl.find("nodata");
-   if (lookup)
-   {
-      noData = ossimString(lookup).toFloat32();
-      noDataFound = true;
-   }
-   lookup = kwl.find("nodata_value");
-   if (lookup)
-   {
-      noData = ossimString(lookup).toFloat32();
-      noDataFound = true;
-   }
-
-   lookup = kwl.find("nbits");
-   if (lookup)
-   {
-      numBits = ossimString(lookup).toInt();
-   }
-
-   lookup = kwl.find("pixeltype");
-   if (lookup)
-   {
-      chPixelType = ossimString(lookup);
-   }
-
-   lookup = kwl.find("layout");
-   if (lookup)
-   {
-      interleaveType = ossimString(lookup);
-   }
-
-   lookup = kwl.find("byteorder");
-   if (lookup)
-   {
-      byteOrder = ossimString(lookup);
-   }
-
-   if (numBits == -1)
-   {
-      FILE* fp;
-      ossim_int64 size = 0;
-      fp = fopen(theImageFile.c_str(), "r");
-      if (fp != 0)
-      {
-         fseek(fp, 0, SEEK_END);
-         size = ftell(fp);
-      }
-      fclose(fp);
-
-      if (lines > 0 && samples > 0)
-      {
-         ossim_int32 numBytes = size/samples/lines/numBands;
-         if( numBytes > 0 && numBytes != 3 )
-         {
-            numBits = numBytes*8;
-
-            if( numBytes == 4 )
-            {
-               chPixelType = "F";
-            }
-         }
-      }
-   }
-
-   if( numBits == 16 )
-   {
-      if (chPixelType == "S")
-      {
-         scalarType = "ossim_sint16";
-      }
-      else
-      {
-         scalarType = "ossim_uint16"; // default
-      }
-   }
-   else if( numBits == 32 )
-   {
-      if( chPixelType == "S")
-      {
-         scalarType = "ossim_sint32";
-      }
-      else if( chPixelType == "F")
-      {
-         scalarType = "ossim_float32";
-      }
-      else
-      {
-         scalarType = "ossim_uint32"; // default 
-      }
-   }
-   else if( numBits == 8 )
-   {
-      scalarType = "ossim_uint8";
-      numBits = 8;
-   }
-   else if( numBits < 8 && numBits >= 1 )
-   {
-      scalarType = "ossim_uint8";
-   }
-   else if(numBits == -1)
-   {
-      if( chPixelType == "F")
-      {
-         scalarType = "ossim_float32";
-         numBits = 32;
-      }
-      else
-      {
-         scalarType = "ossim_uint8";
-         numBits = 8;
-      }
-   }
-
-   if (noDataFound)
-   {
-      for (ossim_int32 i = 0; i < numBands; i++)
-      {
-         ossimString prefix = "band" + ossimString::toString(i+1) + ": ";
-         geoKwl.add(prefix, ossimKeywordNames::NULL_VALUE_KW, noData);
-      }
-   }
-
-   geoKwl.add(ossimKeywordNames::NUMBER_BANDS_KW, numBands);
-   geoKwl.add(ossimKeywordNames::SCALAR_TYPE_KW, scalarType);
-   geoKwl.add(ossimKeywordNames::INTERLEAVE_TYPE_KW, interleaveType);
-
-   return geoKwl;
-}
-
-ossimKeywordlist ossimGeneralRasterTileSource::getXmlInfo(ossimFilename xmlFile)
-{
-   ossimKeywordlist kwl;
-   ossimFgdcXmlDoc file;
-   if (file.open(xmlFile))
-   {
-
-      ossimString scalarType = "ossim_uint8";
-      ossim_int32 numBits = -1; 
-      ossimString interleaveType = "BIL";
-
-      ossimIpt size;
-      ossim_int32 samples = 0;
-      ossim_int32 lines = 0;
-      if (file.getImageSize(size))
-      {
-         samples = size.x;
-         lines = size.y;
-      }
-      if (samples > 0)
-      {
-         kwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
-      }
-      if (lines > 0)
-      {
-         kwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
-      }
-
-      ossim_int32 bands = file.getNumberOfBands();
-      if (bands > 0)
-      {
-         kwl.add(ossimKeywordNames::NUMBER_BANDS_KW, bands);
-      }
-      else
-      {
-         if (samples > 0 && lines > 0)//if there is no bands info but samples and lines info, default number of bands to 1
-         {
-            bands = 1;
-            kwl.add(ossimKeywordNames::NUMBER_BANDS_KW, bands);
-         }
-      }
-
-      ossimString eainfo;
-      file.getPath("/metadata/eainfo/detailed/enttyp/enttypd", eainfo);
-
-      if (numBits == -1)
-      {
-         if ( (lines > 0) && (samples > 0) && (bands > 0) )
-         {
-            ossim_int64 size = theImageFile.fileSize();            
-            ossim_int32 numBytes = size/samples/lines/bands;
-            if( numBytes > 0 && numBytes != 3 )
-            {
-               numBits = numBytes*8;
-            }
-         }
-      }
-
-      if( numBits == 16 )
-      {
-         scalarType = "ossim_uint16"; // default
-      }
-      else if( numBits == 32 )
-      {
-         if(eainfo.contains("float"))
-         {
-            scalarType = "ossim_float32";
-         }
-         else
-         {
-            scalarType = "ossim_uint32"; // default 
-         }
-      }
-      else if( numBits == 8 )
-      {
-         scalarType = "ossim_uint8";
-         numBits = 8;
-      }
-      else if( numBits < 8 && numBits >= 1 )
-      {
-         scalarType = "ossim_uint8";
-      }
-
-      kwl.add(ossimKeywordNames::SCALAR_TYPE_KW, scalarType);
-      kwl.add(ossimKeywordNames::INTERLEAVE_TYPE_KW, interleaveType);
-   }
-   return kwl;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimGeneralRasterTileSource::getImageGeometry()
-{
-   if ( !theGeometry.valid() )
-   {
-      // Check for external geom:
-      theGeometry = getExternalImageGeometry();
-
-      if ( !theGeometry.valid() )
-      {
-         theGeometry = new ossimImageGeometry();
-         
-         ossimString ext = theImageFile.ext();
-         ossimFilename hdrFile = theImageFile;
-         ossimFilename xmlFile = theImageFile;
-         hdrFile = hdrFile.setExtension("hdr");
-         xmlFile = xmlFile.setExtension("xml");
-         if (hdrFile.exists())
-         {
-            ossimKeywordlist geoKwl;
-            ossimKeywordlist kwl(hdrFile, ' ');
-            kwl.downcaseKeywords();
-            
-            ossim_uint32 lines = 0;
-            ossim_uint32 samples = 0;
-            ossim_float32 ll_lon = 0.0;
-            ossim_float32 ll_lat = 0.0;
-            ossim_float32 xCellSize = 1.0;
-            ossim_float32 yCellSize = 1.0;
-            
-            const char* lookup = kwl.find("ncols");
-            if (lookup)
-            {
-               samples = ossimString(lookup).toUInt32();
-               geoKwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
-            }
-            
-            lookup = kwl.find("nrows");
-            if (lookup)
-            {
-               lines = ossimString(lookup).toUInt32();
-               geoKwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
-            }
-            
-            lookup = kwl.find("cellsize");
-            if (lookup)
-            {
-               xCellSize = ossimString(lookup).toFloat32();
-               yCellSize = xCellSize;
-               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, yCellSize);
-               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, xCellSize);
-            }
-            
-            lookup = kwl.find("xdim");
-            if (lookup)
-            {
-               xCellSize = ossimString(lookup).toFloat32();
-               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, xCellSize);
-            }
-            
-            lookup = kwl.find("ydim");
-            if (lookup)
-            {
-               yCellSize = ossimString(lookup).toFloat32();
-               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, yCellSize);
-            }
-            
-            lookup = kwl.find("xllcenter");
-            if (lookup)
-            {
-               ossim_float32 centerX = ossimString(lookup).toFloat32();
-               ll_lon = centerX + xCellSize * 0.5;
-               geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
-            }
-            
-            lookup = kwl.find("yllcenter");
-            if (lookup)
-            {
-               ossim_float32 centerY = ossimString(lookup).toFloat32();
-               ll_lat = (centerY + (lines - 1) * yCellSize) + yCellSize * 0.5;
-               geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
-            }
-            
-            lookup = kwl.find("xllcorner");
-            if (lookup)
-            {
-               ll_lon = ossimString(lookup).toFloat32();
-               geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
-            }
-            
-            lookup = kwl.find("yllcorner");
-            if (lookup)
-            {
-               ossim_uint32 centerY = ossimString(lookup).toFloat32();
-               ll_lat = centerY + lines * yCellSize;
-               geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
-            }
-            
-            lookup = kwl.find("ulxmap");
-            if (lookup)
-            {
-               ll_lon = ossimString(lookup).toFloat32();
-               geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
-            }
-            
-            lookup = kwl.find("ulymap");
-            if (lookup)
-            {
-               ossim_uint32 centerY = ossimString(lookup).toFloat32();
-               ll_lat = centerY + lines * yCellSize;
-               geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
-            }
-            
-            kwl.add(ossimKeywordNames::ORIGIN_LATITUDE_KW, ll_lat);
-            
-            geoKwl.add(ossimKeywordNames::TYPE_KW, "ossimEquDistCylProjection");
-            
-            geoKwl.add(ossimKeywordNames::DATUM_KW, ossimDatumFactory::instance()->wgs84()->
-                       code());
-            
-            ossimRefPtr<ossimProjection> proj = ossimMapProjectionFactory::instance()->
-               createProjection(geoKwl);
-
-            if ( proj.valid() )
-            {
-               theGeometry->setProjection(proj.get());
-            }
-         }
-         else if (xmlFile.exists())
-         {
-            ossimFgdcXmlDoc file;
-            if ( file.open(xmlFile) )
-            {
-               ossimRefPtr<ossimProjection> proj = file.getProjection();
-               if ( !proj.valid() )
-               {
-                  proj = file.getGridCoordSysProjection();
-               }
-               if ( proj.valid() )
-               {
-                  theGeometry->setProjection(proj.get());
-               }
-            }
-            
-         } // xml file exist...
-
-      } // Matches second if ( !theGeometry.valid() )
-
-      //---
-      // WARNING:
-      // Must have theGeometry at this point or the next call to
-      // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
-      // as it does a recursive call back to ossimImageHandler::getImageGeometry().
-      //---         
-      
-      // Check for set projection.
-      if ( !theGeometry->getProjection() )
-      {
-         // Try factories for projection.
-         ossimImageGeometryRegistry::instance()->extendGeometry(this);
-      }
-
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-      
-   } // Matches first if ( !theGeometry.valid() )
-
-   return theGeometry;
-}
-
-bool ossimGeneralRasterTileSource::isBandSelector() const
-{
-   bool result = false;
-   if ( ( m_rasterInfo.interleaveType() == OSSIM_BSQ_MULTI_FILE ) ||
-        ( m_rasterInfo.interleaveType() == OSSIM_BIP ) ||
-        ( m_rasterInfo.interleaveType() == OSSIM_BIL ) )
-   {
-      result = true;
-   }
-
-   if ( result && theOverview.valid() )
-   {
-      result = theOverview->isBandSelector();
-   }   
-   return result;
-}
-
-bool ossimGeneralRasterTileSource::setOutputBandList(const std::vector<ossim_uint32>& band_list)
-{
-   bool result = false;
-   if ( isBandSelector() )
-   {
-      // Making a copy as passed in list could be our m_outputBandList.
-      std::vector<ossim_uint32> inputList = band_list;
-      result = ossimImageHandler::setOutputBandList( inputList, m_outputBandList );
-      if ( result && m_tile.valid() )
-      {
-         if ( m_tile->getNumberOfBands() != m_outputBandList.size() )
-         {
-            m_tile = 0; // Force a reinitialize on next getTile.
-         }
-      }
-   }
-   return result;
-}
-
-void ossimGeneralRasterTileSource::getOutputBandList(std::vector<ossim_uint32>& bandList) const
-{
-   bandList = m_outputBandList;
-}
-
-void ossimGeneralRasterTileSource::allocateTile()
-{
-   m_tile = 0;
-   ossim_uint32 bands = 0;
-   if ( m_outputBandList.empty() )
-   {
-      bands = m_rasterInfo.numberOfBands();
-   }
-   else
-   {
-      bands = (ossim_uint32)m_outputBandList.size();
-   }
-   
-   if ( bands )
-   {
-      m_tile = ossimImageDataFactory::instance()->create(
-         this, m_rasterInfo.getImageMetaData().getScalarType(), bands );
-      
-      if ( m_tile.valid() )
-      {
-         // These values can be overridden by loadState...
-         for(ossim_uint32 band = 0; band < bands; ++ band)
-         {
-            m_tile->setNullPix(m_rasterInfo.getImageMetaData().getNullPix(band), band);
-            m_tile->setMinPix(m_rasterInfo.getImageMetaData().getMinPix(band), band);
-            m_tile->setMaxPix(m_rasterInfo.getImageMetaData().getMaxPix(band), band);
-         }
-         m_tile->initialize(); // This does a makeBlank().
-      }
-   }
-}
-
-void ossimGeneralRasterTileSource::allocateBuffer( const ossimImageData* tile )
-{
-   if( m_buffer )
-   {
-      delete [] m_buffer;
-      m_buffer = 0;
-      m_bufferSizeInPixels = 0; // Must zero out for check in getTile method.
-   }
-   if ( m_lineBuffer )
-   {
-      delete [] m_lineBuffer;
-      m_lineBuffer = 0;
-   }
-   
-   if ( tile )
-   {
-      // Store the size of the buffer in pixels for swapping bytes.
-      m_bufferSizeInPixels = tile->getSize();
-      if ( m_bufferSizeInPixels )
-      {
-         // Initialize buffer. This is bytes, not pixels.
-         m_buffer = new ossim_uint8[ tile->getSizeInBytes() ];
-         
-         // Zero out the buffer rect.
-         m_bufferRect = ossimIrect(0, 0, 0, 0);
-      }
-
-      if ( m_rasterInfo.interleaveType() == OSSIM_BIP )
-      {
-         // Big enough to hold a whole line all bands.
-         ossim_uint32 widthInBytes =
-            tile->getWidth() * m_rasterInfo.getImageMetaData().getNumberOfBands() *
-            m_rasterInfo.getImageMetaData().getBytesPerPixel();
-         
-         m_lineBuffer = new ossim_uint8[ widthInBytes ];
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationBitmap.cpp b/ossim/src/ossim/imaging/ossimGeoAnnotationBitmap.cpp
deleted file mode 100644
index cc615fc..0000000
--- a/ossim/src/ossim/imaging/ossimGeoAnnotationBitmap.cpp
+++ /dev/null
@@ -1,205 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimGeoAnnotationBitmap.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimGeoAnnotationBitmap.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimImageProjectionModel.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimIrect.h>
-
-RTTI_DEF1(ossimGeoAnnotationBitmap,
-          "ossimGeoAnnotationBitmap",
-          ossimGeoAnnotationObject)
-   
-ossimGeoAnnotationBitmap::ossimGeoAnnotationBitmap(
-   const ossimGpt& center,
-   ossimRefPtr<ossimImageData> imageData,
-   unsigned char r,
-   unsigned char g,
-   unsigned char b)
-   :ossimGeoAnnotationObject(r, g, b),
-    theCenterPoint(center),
-    theProjectedPoint(0,0),
-    theImageData(NULL)
-{
-   if(imageData.valid() &&
-      (imageData->getScalarType()==OSSIM_UCHAR))
-   {
-      theImageData = imageData;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimGeoAnnotationBitmap::ossimGeoAnnotationBitmap\n"
-         << "Invalid image data passed to ossimGeoAnnotationBitmap "
-         << "constructor" << endl;
-   }
-}
-
-ossimGeoAnnotationBitmap::ossimGeoAnnotationBitmap(
-   const ossimGeoAnnotationBitmap& rhs)
-   :
-   ossimGeoAnnotationObject(rhs),
-   theCenterPoint(rhs.theCenterPoint),
-   theProjectedPoint(rhs.theProjectedPoint),
-   theImageData(rhs.theImageData)
-{
-}
-
-ossimGeoAnnotationBitmap::~ossimGeoAnnotationBitmap()
-{
-}
-
-ossimObject* ossimGeoAnnotationBitmap::dup()const
-{
-   return new ossimGeoAnnotationBitmap(*this);
-}
-
-bool ossimGeoAnnotationBitmap::intersects(const ossimDrect& rect) const
-{
-   if(theImageData.valid())
-   {
-      return theImageData->getImageRectangle().intersects(rect);
-   }
-   
-   return false;
-}
-
-ossimGeoAnnotationBitmap* ossimGeoAnnotationBitmap::getNewClippedObject(
-   const ossimDrect& /* rect */)const
-{
-   ossimGeoAnnotationBitmap* result = (ossimGeoAnnotationBitmap*)dup();
-   
-   ossimNotify(ossimNotifyLevel_WARN)
-      << "ossimGeoAnnotationBitmap::getNewClippedObject WRNING: "
-      << "not implemented" << std::endl;
-   
-   return result;
-}
-
-void ossimGeoAnnotationBitmap::applyScale(double /* x */, double /* y */)
-{
-     ossimNotify(ossimNotifyLevel_WARN)
-      << "ossimGeoAnnotationBitmap::applyScale WRNING: not implemented"
-      << std::endl; 
-}
-
-
-std::ostream& ossimGeoAnnotationBitmap::print(std::ostream& out)const
-{
-   out << "center:    " << theCenterPoint << endl;
-   return out;
-}
-
-void ossimGeoAnnotationBitmap::draw(ossimRgbImage& anImage)const
-{
-   ossimRefPtr<ossimImageData> destination = anImage.getImageData();
-
-   if(!destination)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimGeoAnnotationBitmap::draw\n"
-         << "ERROR: can't draw annotation bitmap to NULL buffer" << endl;
-      
-      return;
-   }
-   ossimIrect destinationRect = destination->getImageRectangle();
-   ossimIrect srcRect         = theImageData->getImageRectangle();
-   if(!srcRect.intersects(destinationRect))
-   {
-      return;
-   }
-   ossimIrect clipRect        = srcRect.clipToRect(destinationRect);
-   
-   long clipHeight = (long)clipRect.height();
-   long clipWidth  = (long)clipRect.width();
-
-
-   if(clipRect.width() != 1.0 &&
-      clipRect.height() != 1.0)
-   {         
-      long destinationOffset   = (long)(((clipRect.ul().y - destinationRect.ul().y)* destinationRect.width()) +
-                                        (clipRect.ul().x - destinationRect.ul().x));
-      long srcOffset   = (long)(((clipRect.ul().y - srcRect.ul().y)*srcRect.width()) +
-                         (clipRect.ul().x - srcRect.ul().x));
-      long destinationIndex = destinationOffset;
-      long srcIndex         = srcOffset;
-      long num_bands        = destination->getNumberOfBands();
-      ossim_int32 s_width = (ossim_int32)srcRect.width();
-      ossim_int32 d_width = (ossim_int32)destinationRect.width();
-      
-      num_bands = num_bands > 3? 3:num_bands;
-      
-      const ossim_uint8* imageDataBuf = static_cast<const ossim_uint8*>(theImageData->getBuf());
-      unsigned char colorArray[3];
-      colorArray[0] = theRed;
-      colorArray[1] = theGreen;
-      colorArray[2] = theBlue;
-      for (long band=0; band<num_bands; ++band)
-      {
-         ossim_uint8* destinationBand = static_cast<ossim_uint8*>(destination->getBuf(band));
-         destinationIndex       = destinationOffset;
-         srcIndex               = srcOffset;
-         for(long line = 0; line < clipHeight; ++line)
-         {
-            for(long col = 0; col < clipWidth; ++col)
-            {
-               if(imageDataBuf[srcIndex + col])
-               {
-                  destinationBand[destinationIndex + col] = colorArray[band];
-               }
-            }
-            srcIndex += s_width;
-            destinationIndex += d_width;
-         }
-      } 
-   }
-}
-
-void ossimGeoAnnotationBitmap::getBoundingRect(ossimDrect& rect)const
-{
-   rect = ossimDrect(0,0,0,0);
-
-   if(theImageData.valid())
-   {
-      rect = theImageData->getImageRectangle();
-   }
-}
-
-void ossimGeoAnnotationBitmap::transform(ossimImageGeometry* projection)
-{
-   if(projection)
-   {
-      projection->worldToLocal(theCenterPoint, theProjectedPoint);
-      theProjectedPoint = ossimIpt(theProjectedPoint);
-      if(theImageData.valid())
-      {
-         ossimDpt origin(theProjectedPoint.x - theImageData->getWidth()/2.0,
-                         theProjectedPoint.y - theImageData->getHeight()/2.0);
-         
-         theImageData->setOrigin(origin);
-      }
-   }
-}
-
-void ossimGeoAnnotationBitmap::setImageData(
-   ossimRefPtr<ossimImageData>& imageData)
-{
-   theImageData = imageData;
-}
-
-void ossimGeoAnnotationBitmap::computeBoundingRect()
-{
-   // nothing to be done since we don't support
-   // rotated bitmaps yet.
-}
-
diff --git a/ossim/src/ossim/imaging/ossimGridRemapEngineFactory.cpp b/ossim/src/ossim/imaging/ossimGridRemapEngineFactory.cpp
deleted file mode 100644
index c56c8ca..0000000
--- a/ossim/src/ossim/imaging/ossimGridRemapEngineFactory.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//*****************************************************************************
-// FILE: ossimGridRemapEngineFactory.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class ossimGridRemapEngineFactory
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimGridRemapEngineFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimGridRemapEngineFactory.h>
-#include <ossim/imaging/ossimHsvGridRemapEngine.h>
-#include <ossim/imaging/ossimRgbGridRemapEngine.h>
-#include <ossim/imaging/ossimMonoGridRemapEngine.h>
-
-//*****************************************************************************
-//  STATIC METHOD: ossimGridRemapEngineFactory::create()
-//  
-//*****************************************************************************
-ossimGridRemapEngine* ossimGridRemapEngineFactory::create(const char* s)
-{
-   if (!s)
-      return 0;
-   
-   if (strcmp(s, "ossimHsvGridRemapEngine") == 0)
-      return new ossimHsvGridRemapEngine;
-
-   else  if (strcmp(s, "ossimRgbGridRemapEngine") == 0)
-      return new ossimRgbGridRemapEngine;
-
-   else  if (strcmp(s, "ossimMonoGridRemapEngine") == 0)
-      return new ossimMonoGridRemapEngine;
-
-   return 0;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimHistoMatchRemapper.cpp b/ossim/src/ossim/imaging/ossimHistoMatchRemapper.cpp
deleted file mode 100644
index 530a23b..0000000
--- a/ossim/src/ossim/imaging/ossimHistoMatchRemapper.cpp
+++ /dev/null
@@ -1,350 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimHistoMatchRemapper.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimHistoMatchRemapper.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-ossimHistoMatchRemapper::ossimHistoMatchRemapper()
-   : ossimImageSourceFilter()
-{
-   theBlankTile = NULL;
-}
-
-ossimHistoMatchRemapper::ossimHistoMatchRemapper(ossimImageSource* inputSource,
-                                                 const vector<double>& targetMeanPerBand,
-                                                 const vector<double>& targetSigmaPerBand,
-                                                 const vector<double>& inputMeanPerBand,
-                                                 const vector<double>& inputSigmaPerBand)
-   : ossimImageSourceFilter(inputSource),
-     theTargetMeanPerBand(targetMeanPerBand),
-     theTargetSigmaPerBand(targetSigmaPerBand),
-     theInputMeanPerBand(inputMeanPerBand),
-     theInputSigmaPerBand(inputSigmaPerBand)
-{
-   theBlankTile = NULL;
-}
-
-
-ossimHistoMatchRemapper::~ossimHistoMatchRemapper()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimHistoMatchRemapper::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> tile;
-   if(theInputConnection)
-   {
-      tile = theInputConnection->getTile(tileRect, resLevel);
-   }
-   if(!tile.valid())
-   {
-      return NULL;
-   }
-   if((tile.valid() &&
-       ((tile->getDataObjectStatus()==OSSIM_NULL) ||
-        (tile->getDataObjectStatus()==OSSIM_EMPTY))))
-      
-   {
-      return tile;
-   }
-
-   theBlankTile->setOrigin(tileRect.ul());
-   ossim_uint32 numberOfBands = (ossim_uint32)theInputMeanPerBand.size();
-
-   numberOfBands = numberOfBands>tile->getNumberOfBands()?tile->getNumberOfBands():numberOfBands;
-   double result = 0;
-   if(isSourceEnabled())
-   {
-      long offsetBound = (long)(tile->getWidth()*tile->getHeight());
-      if(tile->getScalarType() == OSSIM_UCHAR)
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            unsigned char* buf = static_cast<unsigned char*>(tile->getBuf(band));
-            for(long offset=0; offset < offsetBound;++offset)
-            {
-               // if the input has no deviation we will just
-               // do a shift to the target mean
-               if(fabs(theInputSigmaPerBand[band]) < FLT_EPSILON)
-               {
-                  result = transLean(buf[offset],
-                                     theInputMeanPerBand[band],
-                                     theTargetMeanPerBand[band],
-                                     0,
-                                     255);
-               }
-               else
-               {
-                  result = transLeanStretch(buf[offset],
-                                            theInputMeanPerBand[band],
-                                            theInputSigmaPerBand[band],
-                                            theTargetMeanPerBand[band],
-                                            theTargetSigmaPerBand[band],
-                                            0,
-                                            255);
-               }
-               result = ((result>255)?255:result);
-               result = ((result<0)?0:result);
-               
-               buf[offset] = (unsigned char)result;
-            }
-         }
-      }
-   }
-
-   return tile;
-}
-
-void ossimHistoMatchRemapper::initialize()
-{
-   if(!theInputConnection)
-   {
-      return;
-   }
-   theBlankTile = new ossimImageData(this,
-                                     theInputConnection->getOutputScalarType(),
-                                     theInputConnection->getNumberOfOutputBands());
-}
-
-const vector<double>& ossimHistoMatchRemapper::getInputMeanValues()const
-{
-   return theInputMeanPerBand;
-}
-
-const vector<double>& ossimHistoMatchRemapper::getInputSigmaValues()const
-{
-   return theInputSigmaPerBand;
-}
-
-const vector<double>& ossimHistoMatchRemapper::getTargetMeanValues()const
-{
-   return theTargetMeanPerBand;
-}
-
-const vector<double>& ossimHistoMatchRemapper::getTargetSigmaValues()const
-{
-   return theTargetSigmaPerBand;
-}
-
-void ossimHistoMatchRemapper::setInputMeanValues(const vector<double>& newValues)
-{
-   theInputMeanPerBand = newValues;
-}
-
-void ossimHistoMatchRemapper::setInputSigmaValues(const vector<double>& newValues)
-{
-   theInputSigmaPerBand = newValues;
-}
-
-void ossimHistoMatchRemapper::setTargetMeanValues(const vector<double>& newValues)
-{
-   theTargetMeanPerBand = newValues;
-}
-
-void ossimHistoMatchRemapper::setTargetSigmaValues(const vector<double>& newValues)
-{
-   theTargetSigmaPerBand = newValues;
-}
-
-double  ossimHistoMatchRemapper::transLean   // returns vOut
-(
-   double vIn         //!< input value to be transformed
-   , double vBias       //!< bias value to be removed
-   , double vTarget     //!< value that will replace bias
-   , double vMin        //!< minimum valid value of vIn (inclusive)
-   , double vMax        //!< maximum valid value of vIn (inclusive)
-)
-{
-   // max change
-   const double vDelta = vTarget - vBias;
-   double weight=0.0;
-   
-   // weight max change dependend on proximity to end points
-   if (vIn <= vBias)
-   {
-      weight = fabs((vIn - vMin) / (vBias - vMin));
-   }
-   else
-   {
-      weight = fabs((vMax - vIn) / (vMax - vBias));
-   }
-   return  (vIn + (vDelta * weight));
-};
-
-double  ossimHistoMatchRemapper::transLeanStretch   // returns vOut
-        (
-          double vIn              //!< input value to be transformed
-        , double vBias            //!< bias value to be removed
-        , double vBiasStretch     //!< dispersion (+/-) about vBias
-        , double vTarget          //!< value that will replace bias
-        , double vTargetStretch   //!< dispersion (+/-) about vTarget
-        , double vMin             //!< minimum valid value of vIn (inclusive)
-        , double vMax             //!< maximum valid value of vIn (inclusive)
-        )
-{
-
-        // line segment end points
-        const double x1 = vMin;
-        const double x2 = vBias - vBiasStretch;
-        const double x3 = vBias + vBiasStretch;
-        const double x4 = vMax;
-        const double y1 = 0.0;
-        const double y2 = (vTarget + vTargetStretch) - (vBias + vBiasStretch);
-        const double y3 = (vTarget - vTargetStretch) - (vBias - vBiasStretch);
-        const double y4 = 0.0;
-
-
-        // perform appropriate linear lookup operation based on input value
-        double vOut = vIn;
-        if (vIn <= x2)
-        {
-                vOut = (vIn - x1) * (y2-y1)/(x2-x1) + y1 + vIn;
-        }
-        else
-        if (vIn <= x3)
-        {
-                vOut = (vIn - x2) * (y3-y2)/(x3-x2) + y2 + vIn;
-        }
-        else
-        {
-                vOut = (vIn - x3) * (y4-y3)/(x4-x3) + y3 + vIn;
-        }
-        
-        return vOut;
-}
-
-bool ossimHistoMatchRemapper::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   theTargetMeanPerBand.clear();
-   theTargetSigmaPerBand.clear();
-   theInputMeanPerBand.clear();
-   theInputSigmaPerBand.clear();
-   ossim_uint32 result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "target_mean[0-9]");
-   ossim_uint32 numberOfMatches=0;
-   ossim_uint32 index=0;
-
-   // load target mean
-   while(numberOfMatches < result)
-   {
-      ossimString key = prefix;
-      key += ossimString("target_mean");
-      key += ossimString::toString(index);
-      const char* lookup = kwl.find(key.c_str());
-      if(lookup)
-      {
-         theTargetMeanPerBand.push_back(ossimString(lookup).toDouble());
-         ++numberOfMatches;
-      }
-      ++index;
-   }
-   numberOfMatches = 0;
-   index = 0;
-   result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "target_sigma[0-9]");
-   // load target sigma
-   while(numberOfMatches < result)
-   {
-      ossimString key = prefix;
-      key += ossimString("target_sigma");
-      key += ossimString::toString(index);
-      const char* lookup = kwl.find(key.c_str());
-      if(lookup)
-      {
-         theTargetSigmaPerBand.push_back(ossimString(lookup).toDouble());
-         ++numberOfMatches;
-      }
-      ++index;
-   }
-
-   numberOfMatches = 0;
-   index = 0;
-   result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "input_mean[0-9]");
-   // load input mean
-   while(numberOfMatches < result)
-   {
-      ossimString key = prefix;
-      key += ossimString("input_mean");
-      key += ossimString::toString(index);
-      const char* lookup = kwl.find(key.c_str());
-      if(lookup)
-      {
-         theInputMeanPerBand.push_back(ossimString(lookup).toDouble());
-         ++numberOfMatches;
-      }
-      ++index;
-   }
-   
-   numberOfMatches = 0;
-   index = 0;
-   result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "input_sigma[0-9]");
-   // load input sigma
-   while(numberOfMatches < result)
-   {
-      ossimString key = prefix;
-      key += ossimString("input_sigma");
-      key += ossimString::toString(index);
-      const char* lookup = kwl.find(key.c_str());
-      if(lookup)
-      {
-         theInputSigmaPerBand.push_back(ossimString(lookup).toDouble());
-         ++numberOfMatches;
-      }
-      ++index;
-   }
-   
-   return true;
-}
-
-bool ossimHistoMatchRemapper::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   ossim_uint32 index = 1;
-   for(index=1;index <= theTargetMeanPerBand.size();++index)
-   {
-      ossimString key = ossimString("target_mean") + ossimString::toString(index);
-      kwl.add(prefix,
-              key.c_str(),
-              theTargetMeanPerBand[index-1],
-              true);
-   }
-   for(index=1;index <= theTargetSigmaPerBand.size();++index)
-   {
-      ossimString key = ossimString("target_sigma") + ossimString::toString(index);
-      kwl.add(prefix,
-              key.c_str(),
-              theTargetSigmaPerBand[index-1],
-              true);
-   }
-   for(index=1;index <= theInputMeanPerBand.size();++index)
-   {
-      ossimString key = ossimString("input_mean") + ossimString::toString(index);
-      kwl.add(prefix,
-              key.c_str(),
-              theInputMeanPerBand[index-1],
-              true);
-   }
-   for(index=1;index <= theInputSigmaPerBand.size();++index)
-   {
-      ossimString key = ossimString("input_sigma") + ossimString::toString(index);
-      kwl.add(prefix,
-              key.c_str(),
-              theInputSigmaPerBand[index-1],
-              true);
-   }
-   return true;  
-}
-                       
-
diff --git a/ossim/src/ossim/imaging/ossimHistogramEqualization.cpp b/ossim/src/ossim/imaging/ossimHistogramEqualization.cpp
deleted file mode 100644
index 5413613..0000000
--- a/ossim/src/ossim/imaging/ossimHistogramEqualization.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHistogramEqualization.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimHistogramEqualization.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeyword.h>
-
-RTTI_DEF1(ossimHistogramEqualization, "ossimHistogramEqualization", ossimImageSourceHistogramFilter)
-   
-static const ossimKeyword HISTOGRAM_INVERSE_FLAG_KW("inverse_flag",
-                                                    "specifies whether the inverse should be done for the getTile");
-
-static ossimTrace traceDebug("ossimHistogramEqualization:debug");
-
-ossimHistogramEqualization::ossimHistogramEqualization()
-   : ossimImageSourceHistogramFilter(),
-     theTile(NULL),
-     theAccumulationHistogram(NULL),
-     theInverseFlag(false)
-{
-}
-
-ossimHistogramEqualization::ossimHistogramEqualization(ossimImageSource* inputSource,
-                                                       ossimRefPtr<ossimMultiResLevelHistogram> histogram)
-   : ossimImageSourceHistogramFilter(inputSource, histogram),
-     theTile(0),
-     theAccumulationHistogram(0),
-     theInverseFlag(false)
-{
-   if(getHistogram().valid())
-   {
-      theAccumulationHistogram = getHistogram()->createAccumulationLessThanEqual();
-      initializeLuts();
-   }
-}
-
-ossimHistogramEqualization::ossimHistogramEqualization(ossimImageSource* inputSource,
-                                                       ossimRefPtr<ossimMultiResLevelHistogram> histogram,
-                                                       bool inverseFlag)
-   : ossimImageSourceHistogramFilter(inputSource, histogram),
-     theTile(NULL),
-     theAccumulationHistogram(0),
-     theInverseFlag(inverseFlag)
-{
-   if(getHistogram().valid())
-   {
-      theAccumulationHistogram = getHistogram()->createAccumulationLessThanEqual();
-      initializeLuts();
-   }
-}
-
-ossimHistogramEqualization::~ossimHistogramEqualization()
-{
-   deleteLuts();
-}
-
-ossimRefPtr<ossimImageData> ossimHistogramEqualization::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return NULL;
-   }
-   
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
-                                                                       resLevel);
-
-   if(!inputTile.valid()) return inputTile;
-   
-   if (!isSourceEnabled())
-   {
-      return inputTile;
-   }
-   
-   if(!theTile.valid())
-   {
-      allocate(); // First time through...
-   }
-   
-   // if (!theTile) throw exception!
-   
-   // Set the origin, resize if needed of the output tile.
-   theTile->setImageRectangleAndBands(inputTile->getImageRectangle(),
-				      inputTile->getNumberOfBands());
-   
-   if( !inputTile.valid() ||
-       inputTile->getDataObjectStatus() == OSSIM_NULL ||
-       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
-   {
-      return theTile;
-   }
-
-   if(!theAccumulationHistogram)
-   {
-      computeAccumulationHistogram();
-   }
-   if(theForwardLut.size() == 0 ||
-      theInverseLut.size() == 0)
-   {
-      initializeLuts();
-   }
-   if((theForwardLut.size() == 0) ||
-      (theInverseLut.size() == 0))
-   {
-      return inputTile;
-   }
-   
-   switch(inputTile->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         return runEqualizationAlgorithm(static_cast<ossim_uint8>(0),
-                                         inputTile);
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         return runEqualizationAlgorithm(static_cast<ossim_uint16>(0),
-                                         inputTile);
-      }
-      case OSSIM_SINT16:
-      {
-         return runEqualizationAlgorithm(static_cast<ossim_sint16>(0),
-                                         inputTile);
-      }
-      case OSSIM_UINT32:
-      {
-         return runEqualizationAlgorithm(static_cast<ossim_uint32>(0),
-                                         inputTile);
-      }
-      case OSSIM_SINT32:
-      {
-         return runEqualizationAlgorithm(static_cast<ossim_sint32>(0),
-                                         inputTile);
-      }
-      case OSSIM_FLOAT32:
-      {
-         return runEqualizationAlgorithm(static_cast<ossim_float32>(0),
-                                         inputTile);
-      }
-      case OSSIM_FLOAT64:
-      {
-         return runEqualizationAlgorithm(static_cast<ossim_float64>(0),
-                                         inputTile);
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramEqualization::getTile WARNING: Unsupported scalar type."
-            << endl;
-         break;
-      }
-   }
-   
-   return inputTile;
-}
-
-void ossimHistogramEqualization::setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram)
-{
-   ossimImageSourceHistogramFilter::setHistogram(histogram);
-   computeAccumulationHistogram();
-   initializeLuts();
-}
-
-bool ossimHistogramEqualization::saveState(ossimKeywordlist& kwl,
-                                           const char* prefix)const
-{
-   bool result = ossimImageSourceHistogramFilter::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           HISTOGRAM_INVERSE_FLAG_KW,
-           theInverseFlag,
-           true);
-   
-   return result;
-}
-
-bool ossimHistogramEqualization::loadState(const ossimKeywordlist& kwl,
-                                           const char* prefix)
-{
-   static const char MODULE[] = "ossimHistogramEqualization::loadState";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << " Entered..."
-         << "\nprefix:  " << prefix << endl;
-   }
-
-   const char* lookup = kwl.find(prefix,
-                                 HISTOGRAM_INVERSE_FLAG_KW);
-   if(lookup)
-   {
-      theInverseFlag = ossimString(lookup).toBool();
-   }
-   if(ossimImageSourceHistogramFilter::loadState(kwl, prefix))
-   {
-//      computeAccumulationHistogram();
-//      initializeLuts();
-   }
-   else
-   {
-      return false;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:" << MODULE;
-      this->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\nExited..." << endl;
-   }
-   
-   return true;
-}
-
-void ossimHistogramEqualization::computeAccumulationHistogram()
-{
-   if(getHistogram().valid())
-   {
-      theAccumulationHistogram = getHistogram()->createAccumulationLessThanEqual();
-   }
-}
-
-template <class T>
-ossimRefPtr<ossimImageData> ossimHistogramEqualization::runEqualizationAlgorithm(T, ossimRefPtr<ossimImageData> tile)
-{
-   
-   if(!theAccumulationHistogram ||
-      !getHistogram())
-   {
-      return tile;
-   }
-
-   // for now we will always pull from res 0 information
-   ossimRefPtr<ossimMultiBandHistogram> histo = getHistogram()->getMultiBandHistogram(0);
-
-   if(histo.valid())
-   {
-      ossim_uint32 maxBands = ( (histo->getNumberOfBands() >
-                                 tile->getNumberOfBands())?
-                                tile->getNumberOfBands():
-                                histo->getNumberOfBands());
-      
-      long offsetUpperBound = tile->getHeight()*tile->getWidth();
-
-      for(ossim_uint32 band = 0; band < maxBands; ++band)
-      {
-         ossimRefPtr<ossimHistogram> bandHisto = histo->getHistogram(band);
-         T* buf = static_cast<T*>(tile->getBuf(band));
-         double *histoLut = band<theForwardLut.size()?theForwardLut[band]:NULL;
-         ossim_uint32 actualBand = theBandList[band];
-         if(bandHisto.valid())
-         {
-            if(buf&&histoLut&&(actualBand <  histo->getNumberOfBands()))
-            {
-               if(theInverseFlag)
-               {
-                  histoLut = theInverseLut[actualBand];
-               }
-               if(histoLut)
-               {
-                  if(tile->getDataObjectStatus() == OSSIM_FULL)
-                  {
-                     T minPix = (T)tile->getMinPix(actualBand);
-                     T maxPix = (T)tile->getMaxPix(actualBand);
-                     for(long offset = 0; offset < offsetUpperBound; ++offset)
-                     {
-                        ossim_int32 idx = bandHisto->GetIndex(buf[offset]);
-                           
-                        if(idx>=0)
-                        {
-                           T value = (T)(histoLut[idx]);
-
-                           //---
-                           // Assign clamping to min max.
-                           // 
-                           // ESH 03/2009 -- Clamping to within min-max fixed
-                           //--- 
-                           buf[offset] = value < minPix ? minPix :
-                              (value > maxPix ? maxPix : value);
-                        }
-                     }
-                  }
-                  else
-                  {
-                     T minPix  = (T)tile->getMinPix(actualBand);
-                     T maxPix  = (T)tile->getMaxPix(actualBand);
-                     T nullPix = (T)tile->getNullPix(actualBand);
-                     for(long offset = 0; offset < offsetUpperBound; ++offset)
-                     {
-                        ossim_int32 idx = bandHisto->GetIndex(buf[offset]);
-                        
-                        if((buf[offset]!=nullPix)&&(idx>=0))
-                        {
-                           T value = (T)(histoLut[idx]);
-
-                           //---
-                           // Assign clamping to min max.
-                           // 
-                           // ESH 03/2009 -- Clamping to within min-max fixed
-                           //--- 
-                           buf[offset] = value < minPix ? minPix :
-                              (value > maxPix ? maxPix : value);
-                        }
-                        else
-                        {
-                           buf[offset] = nullPix;
-                        }
-                     }
-                  }
-               }
-            }
-         }
-      }
-      
-      tile->validate();
-   }
-   
-   return tile;
-}
-
-void ossimHistogramEqualization::initialize()
-{
-   // Base class will recapture "theInputConnection".
-   ossimImageSourceHistogramFilter::initialize();
-   if(theTile.valid())
-   {
-      theTile = NULL;
-   }
-}
-
-void ossimHistogramEqualization::allocate()
-{
-   theBandList.clear();
-   
-   if(theTile.valid())
-   {
-      theTile = NULL;
-   }
-   
-   if(theInputConnection)
-   {
-      theInputConnection->getOutputBandList(theBandList);
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      if(theTile.valid())
-      {
-         theTile->initialize();
-      }
-   }
-}
-
-void ossimHistogramEqualization::initializeLuts()
-{
-   if(theForwardLut.size() != 0 ||
-      theInverseLut.size() != 0)
-   {
-      deleteLuts();
-   }
-   if(!theAccumulationHistogram||!getHistogram())
-   {
-      return;
-   }
-   ossimRefPtr<ossimMultiBandHistogram> accumHisto = theAccumulationHistogram->getMultiBandHistogram(0);
-   ossimRefPtr<ossimMultiBandHistogram> histogram  = getHistogram()->getMultiBandHistogram(0);
-   ossimKeywordlist kwl;
-   theAccumulationHistogram->saveState(kwl);
-
-   if(accumHisto.valid()&&histogram.valid())
-   {
-      long maxBands = accumHisto->getNumberOfBands();
-      
-      for(long band = 0; band < maxBands; ++band)
-      {
-         // first we grab pointers to the histogram and the accumulation
-         // histogram
-         ossimRefPtr<ossimHistogram> h  = accumHisto->getHistogram(band);
-         ossimRefPtr<ossimHistogram> h2 = histogram->getHistogram(band);
-
-         if(h.valid()&&h2.valid())
-         {
-            // lets get the number of indices.
-            ossim_uint32 numberOfIndices = (ossim_uint32)h2->GetRes();
-            vector<double> countForInverse(numberOfIndices);
-            
-            theForwardLut.push_back(new double[numberOfIndices]);
-            theInverseLut.push_back(new double[numberOfIndices]);
-            
-            // let's grab the counts array
-            const float* histoCounts = h->GetCounts();
-
-//         double maxIntensity      = h2->GetMaxVal();
-            double maxIntensity      = h2->GetRangeMax();
-            double maxCount          = h->GetMaxCount();
-            
-            // now pre compute the transforms
-            double *forwardLut = theForwardLut[band];
-            double *inverseLut = theInverseLut[band];
-            
-//         double minIntensity  = h2->GetMinVal();
-            double minIntensity  = h2->GetRangeMin();
-            double delta = maxIntensity-minIntensity;
-            ossim_uint32 idx = 0;
-            
-            // clear out the inverse
-            //
-            for(idx = 0; idx < numberOfIndices; ++ idx)
-            {
-               inverseLut[idx] = ossim::nan();
-            }
-            for(idx = 0; idx < numberOfIndices; ++ idx)
-            {
-               forwardLut[idx]   = minIntensity + (histoCounts[idx]/maxCount)*delta;
-               
-               ossim_int32 inverseIdx = h2->GetIndex(forwardLut[idx]);
-               if(inverseIdx >= 0)
-               {
-                  inverseLut[inverseIdx]   = minIntensity + delta*(idx/(ossim_float32)numberOfIndices);
-               }
-            }
-            
-            // now solve the inverse lut
-            //
-            ossim_uint32 idxStart = 0;
-            ossim_uint32 idxEnd = 0;
-            
-            while((ossim::isnan(inverseLut[idxEnd]))&&(idxEnd <numberOfIndices)){ ++idxEnd;}
-            if((idxStart!=idxEnd)&&(idxEnd<numberOfIndices))
-            {
-               std::fill(inverseLut,
-                         inverseLut+idxEnd,
-                         inverseLut[idxEnd]);
-            }
-            idxStart = numberOfIndices-1;
-            while((ossim::isnan(inverseLut[idxStart]))&&(idxStart > 0)){ --idxStart;}
-            if(idxStart !=0)
-            {
-               std::fill(inverseLut+idxStart,
-                         inverseLut+numberOfIndices,
-                         inverseLut[idxStart]);
-            }
-            
-            idxStart = 0;
-            idxEnd   = 0;
-            ossim_float32 valueStart = 0.0;
-            ossim_float32 valueEnd = 0.0;
-            
-            while(idxStart < numberOfIndices)
-            {
-               idxEnd = idxStart;
-               if(ossim::isnan(inverseLut[idxStart]))
-               {
-                  while(ossim::isnan(inverseLut[idxEnd])&&(idxEnd < (numberOfIndices-1))) ++idxEnd;
-                  double length = (idxEnd-idxStart)+1;
-                  valueEnd = inverseLut[idxEnd];
-                  double deltaVal = (valueEnd-valueStart);
-                  ossim_uint32 tempIdx = idxStart;
-                  ossim_float32 count = 1.0;
-                  double t = 0.0;
-                  while(tempIdx < idxEnd)
-                  {
-                     t = (count/length);
-                     t = t>1.0?1.0:t;
-                     inverseLut[tempIdx] = valueStart + deltaVal*t;
-                     ++count;
-                     ++tempIdx;
-                  }
-                  idxStart = idxEnd;
-                  valueStart = valueEnd;
-               }
-               else
-               {
-                  valueStart = inverseLut[idxStart];
-                  ++idxStart;
-               }
-            }
-         }
-      }
-   }
-}
-
-bool ossimHistogramEqualization::setHistogram(const ossimFilename& filename)
-{
-   return ossimImageSourceHistogramFilter::setHistogram(filename);
-}
-
-bool ossimHistogramEqualization::getInverseFlag()const
-{
-   return theInverseFlag;
-}
-
-void ossimHistogramEqualization::setInverseFlag(bool inverseFlag)
-{
-   theInverseFlag = inverseFlag;
-}
-
-void ossimHistogramEqualization::deleteLuts()
-{
-   long band = 0;
-   
-   for(band = 0; band < (long)theForwardLut.size(); ++band)
-   {
-      delete [] theForwardLut[band];
-   }
-   theForwardLut.clear();
-   
-   for(band = 0; band < (long)theInverseLut.size(); ++band)
-   {
-      delete [] theInverseLut[band];      
-   }
-   
-   theInverseLut.clear();
-}
-
-const ossimFilename& ossimImageSourceHistogramFilter::getHistogramFilename() const
-{
-   return theFilename;
-}
-
-std::ostream& ossimHistogramEqualization::print(std::ostream& out) const
-{
-   // Base class...
-   return ossimImageSourceHistogramFilter::print(out);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimHistogramRemapper.cpp b/ossim/src/ossim/imaging/ossimHistogramRemapper.cpp
deleted file mode 100644
index 6b33e62..0000000
--- a/ossim/src/ossim/imaging/ossimHistogramRemapper.cpp
+++ /dev/null
@@ -1,2065 +0,0 @@
-//*******************************************************************
-// 
-// See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Histogram remapper class declaration.  Derived from ossimTableRemapper.
-//
-// Remaps a tile based on mode and histogram clip points.
-//
-//*************************************************************************
-// $Id: ossimHistogramRemapper.cpp 23182 2015-03-09 14:30:52Z okramer $
-
-#include <ossim/imaging/ossimHistogramRemapper.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimHistogramSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <cstdlib>
-#include <iomanip>
-
-RTTI_DEF1(ossimHistogramRemapper, "ossimHistogramRemapper", ossimTableRemapper)
-
-static ossimTrace traceDebug("ossimHistogramRemapper:debug");
-
-static const char* STRETCH_MODE[] = { "linear_one_piece",
-                                      "linear_1std_from_mean",
-                                      "linear_2std_from_mean",
-                                      "linear_3std_from_mean",
-                                      "linear_auto_min_max",
-                                      "stretch_unknown" };
-
-static const char NORMALIZED_LOW_CLIP_POINT_KW[] = "normalized_low_clip_point";
-static const char NORMALIZED_HIGH_CLIP_POINT_KW[]="normalized_high_clip_point";
-static const char MID_POINT_KW[] = "mid_point";
-static const char MIN_OUTPUT_VALUE_KW[] = "min_output_value";
-static const char MAX_OUTPUT_VALUE_KW[] = "max_output_value";
-static const char STRETCH_MODE_KW[] = "stretch_mode";
-static const char HISTOGRAM_FILENAME_KW[] = "histogram_filename";
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimHistogramRemapper.cpp 23182 2015-03-09 14:30:52Z okramer $";
-#endif
-
-ossimHistogramRemapper::ossimHistogramRemapper()
-   :
-   ossimTableRemapper(),  // base class
-   theStretchMode(ossimHistogramRemapper::LINEAR_ONE_PIECE),
-   theDirtyFlag(false),
-   theHistogram(0),
-   theNormalizedLowClipPoint(),
-   theNormalizedHighClipPoint(),
-   theMidPoint(),
-   theMinOutputValue(),
-   theMaxOutputValue(),
-   theBandList(),
-   theBypassFlag(true),
-   theResetBandIndicesFlag(false)
-{
-   setNumberOfInputs(2);
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimHistogramRemapper::ossimHistogramRemapper entered...\n";
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << "\n";
-#endif      
-   }
-}
-
-ossimHistogramRemapper::~ossimHistogramRemapper()
-{
-}
-
-void ossimHistogramRemapper::initialize()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimHistogramRemapper::initialize entered..." << endl;
-   }
-
-   theResetBandIndicesFlag=(dynamic_cast<const ossimHistogramSource*>(getInput(1))!=0);
-
-   //---
-   // Call the base class initialize.
-   // Note:  This will reset "theInputConnection" if it changed...
-   //---
-   ossimTableRemapper::initialize();
-	
-   // Check the band list to see if it's changes.
-   vector<ossim_uint32> bandList;
-   getOutputBandList(bandList);
-   ossim_uint32 idx = 0;
-   // bool emptyOutput = theBandList.empty();
-
-   if(theResetBandIndicesFlag)
-   {
-      for(idx = 0; idx < bandList.size();++idx)
-      {
-         bandList[idx] = idx;
-      }
-   }
-   if (theBandList.size() != 0 && bandList.size())
-   {
-      if (theBandList.size() != bandList.size())
-      {
-         // Somethings changed.  Set everthing back.
-         initializeClips();
-         setNullCount();
-         theTable.clear();
-         theDirtyFlag = true;
-      }
-      else
-      {
-         // Sizes same check the order.
-         for(ossim_uint32 band = 0; band < theBandList.size(); ++band)
-         {
-            if (theBandList[band] != bandList[band])
-            {
-               //initializeClips();
-               //setNullCount();
-               theDirtyFlag = true;
-               break;
-            }            
-         }
-      }
-   }
-   else
-   {
-      initializeMinMaxOutput();
-   }
-
-   // Update the band list with the latest.
-   theBandList = bandList;
-	
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimHistogramRemapper::initialize exited..." << endl;
-   }
-   verifyEnabled();
-
-}
-
-void ossimHistogramRemapper::reset()
-{
-   // We could delete theTable to free up memory???
-   setStretchMode(LINEAR_ONE_PIECE, false);
-   initializeClips();
-   verifyEnabled();
-}
-
-void
-ossimHistogramRemapper::setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram)
-{
-   theHistogram = histogram;
-   setNullCount();
-	
-   // Note: initializeClips before setNullCount since it relies on clips.
-   initializeClips();
-   theTable.clear();
-   theDirtyFlag = true;
-}
-
-bool ossimHistogramRemapper::openHistogram(const ossimFilename& histogram_file)
-{
-   ossimRefPtr<ossimMultiResLevelHistogram> h = new ossimMultiResLevelHistogram();
-   if (h->importHistogram(histogram_file))
-   {
-      setHistogram(h);
-      return true;
-   }
-	
-   // Import failed if here!
-   return false;
-}
-
-ossimRefPtr<ossimImageData> ossimHistogramRemapper::getTile(
-   const ossimIrect& tile_rect,
-   ossim_uint32 resLevel)
-{
-   
-#if 0 /* Please leave for debug. (drb) */
-   cout << "\ntheEnableFlag: " << theEnableFlag
-        << "\ntheBypassFlag: " << theBypassFlag
-        << "\ntheDirtyFlag:  " << theDirtyFlag
-        << endl;
-#endif
-   
-   if ( !theInputConnection )
-      return 0;
-
-   // Rebuild the table if dirty flag set:
-   if ( theDirtyFlag )
-      makeClean();
-
-   if ( !theEnableFlag || theBypassFlag )
-      return theInputConnection->getTile(tile_rect, resLevel);
-
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tile_rect, resLevel);
-   if(!inputTile.valid())
-      return 0;
-
-   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
-   if ( (tile_status == OSSIM_NULL) || (tile_status == OSSIM_EMPTY) )
-      return inputTile;
-
-   if (!theTile)
-      allocate(tile_rect);
-
-   theTile->setImageRectangle(tile_rect);
-   theTile->makeBlank();
-   switch (theOutputScalarType)
-   {
-   case OSSIM_UINT8:
-      applyLinearStretch(ossim_uint8(0), inputTile);
-      break;
-
-   case OSSIM_USHORT11:
-   case OSSIM_USHORT16:
-      applyLinearStretch(ossim_uint16(0), inputTile);
-      break;
-
-   case OSSIM_SSHORT16:
-      applyLinearStretch(ossim_sint16(0), inputTile);
-      //remapFromNativeTable(ossim_sint16(0), inputTile);
-      break;
-
-   case OSSIM_NORMALIZED_FLOAT:
-   case OSSIM_FLOAT:
-      applyLinearStretch(ossim_float32(0), inputTile);
-      //remapFromNativeTable(ossim_float32(0), inputTile);
-      break;
-
-   case OSSIM_NORMALIZED_DOUBLE:
-   case OSSIM_DOUBLE:
-      applyLinearStretch(ossim_float64(0), inputTile);
-      //remapFromNativeTable(ossim_float64(0), inputTile);
-      break;
-
-   case OSSIM_SCALAR_UNKNOWN:
-   default:
-      // Shouldn't hit this.
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimHistogramRemapper::getTile"
-         << "\nOutput scalar type is OSSIM_SCALAR_UNKNOWN!\n";
-      }
-   } // End of "switch (theTableType)"
-
-   theTile->validate();
-   return theTile;
-}
-
-template <class T> void ossimHistogramRemapper::applyLinearStretch(
-   T /* dummy */,
-   ossimRefPtr<ossimImageData>& inputTile)
-{
-   const ossim_uint32 BANDS = inputTile->getNumberOfBands();
-
-   // Sanity check.
-   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::buildTable ERROR!"
-            << " Line:  " << __LINE__ << endl;
-      }
-      return;
-   }
-
-
-   
-//   T* table = reinterpret_cast<T*>(&theTable.front());
-//   ossim_uint32 index = 0;
-   
-   // Finally, build the table...
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      ossimRefPtr<ossimHistogram> h  = getHistogram(band);
-      T* bandPtr = static_cast<T*>(inputTile->getBuf(band));
-      T* outputPtr = static_cast<T*>(theTile->getBuf(band));
-      if (h.get()&&bandPtr&&outputPtr)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimHistogramRemapper::buildLinearTable DEBUG:"
-               << "\nband:  " << band
-               << "\nmean:  " << h->GetMean()
-               << "\nstddev:  " << h->GetStandardDev()
-               << endl;
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::buildTable ERROR!"
-            << " Line:  " << __LINE__ << endl;
-         }
-         return; 
-      }
-      //std::cout << "MIN OUTPUT ==== " << theMinOutputValue[band] << std::endl;
-      const T NULL_PIX = static_cast<T>(getNullPixelValue(band));
-      const T MIN_PIX  = static_cast<T>(theMinOutputValue[band]);
-      const T MAX_PIX  = static_cast<T>(theMaxOutputValue[band]);
-
-      ossim_float64 min_clip_value =
-         h->LowClipVal(theNormalizedLowClipPoint[band]);
-      ossim_float64 max_clip_value =
-         h->HighClipVal(1.0-theNormalizedHighClipPoint[band]);
-      min_clip_value = floor(min_clip_value);
-      max_clip_value = ceil(max_clip_value);
-      //ossim_float64 gain = (MAX_PIX-MIN_PIX+1)/(max_clip_value-min_clip_value);
-      ossim_float64 gain = (MAX_PIX-MIN_PIX+1)/(max_clip_value-min_clip_value);
-      // ossim_float64 distMin = fabs(min_clip_value - MIN_PIX);
-      // ossim_float64 distMax = fabs(max_clip_value - MAX_PIX);
-      // ossim_float64 mean = (max_clip_value+min_clip_value)*0.5;
-
-      const ossim_uint32 PPB   = inputTile->getSizePerBand(); // pixels per band
-
-      ossim_uint32 idx = 0;
-      for(idx = 0; idx < PPB;++idx)
-      {
-         if ( bandPtr[idx] != NULL_PIX )
-         {
-            ossim_float64 p = bandPtr[idx];
-            if (p < min_clip_value)
-            {
-               p = MIN_PIX;
-            }
-            else if (p > max_clip_value)
-            {
-               p = MAX_PIX;
-            }
-            else
-            {
-               p = ((p - min_clip_value) * gain) + MIN_PIX;// - 1.0;
-            }
-
-            // Final range check:
-            outputPtr[idx] =
-               static_cast<T>( p >= MIN_PIX ? ( p <= MAX_PIX ? p : MAX_PIX ) : MIN_PIX );
-         }
-         else
-         {
-            outputPtr[idx] = NULL_PIX;
-         }
-      }
-
-   } // End of band loop.
-
-}
-
-void ossimHistogramRemapper::setLowNormalizedClipPoint(const ossim_float64& clip)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      setLowNormalizedClipPoint(clip, band);
-   }
-}
-
-void ossimHistogramRemapper::makeClean()
-{
-   if (theEnableFlag && theDirtyFlag) // Enabled and dirty.
-   {
-      // Always rebuild table if dirty.
-      buildTable();
-      
-      // Check for internal bypass.
-      verifyEnabled();
-
-      // Always clear the dirty flag.
-      theDirtyFlag = false;
-   }
-}
-
-void ossimHistogramRemapper::setLowNormalizedClipPoint(const ossim_float64& clip,
-                                                  ossim_uint32 zero_based_band)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-	
-   if (zero_based_band >= BANDS)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::setLowNormalizedClipPoint ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (BANDS-1) << endl;
-   }
-	
-   if (theNormalizedLowClipPoint.size() != BANDS)
-   {
-      initializeClips();
-   }
-	
-   if ( clip != theNormalizedLowClipPoint[zero_based_band] &&
-        clip < theNormalizedHighClipPoint[zero_based_band] )
-   {
-      theDirtyFlag = true;
-      theNormalizedLowClipPoint[zero_based_band] = clip;
-   }
-}
-
-void
-ossimHistogramRemapper::setHighNormalizedClipPoint(const ossim_float64& clip)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      setHighNormalizedClipPoint(clip, band);
-   }
-}
-
-void ossimHistogramRemapper::setHighNormalizedClipPoint(
-   const ossim_float64& clip, ossim_uint32 zero_based_band)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-	
-   if (zero_based_band >= BANDS)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::setHighNormalizedClipPoint ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (BANDS-1) << endl;
-   }
-	
-   if (theNormalizedHighClipPoint.size() != BANDS)
-   {
-      initializeClips();
-   }
-	
-   if ( clip != theNormalizedHighClipPoint[zero_based_band] &&
-        clip > theNormalizedLowClipPoint[zero_based_band] )
-   {
-      theDirtyFlag = true;
-      theNormalizedHighClipPoint[zero_based_band] = clip;
-   }
-}
-
-void ossimHistogramRemapper::setLowClipPoint(const ossim_float64& clip)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      setLowClipPoint(clip, band);
-   }
-}
-
-void ossimHistogramRemapper::setLowClipPoint(const ossim_float64& clip,
-                                             ossim_uint32 zero_based_band)
-{
-   // allow the call to getHistogram to happen this way we can calculate a histogram if 
-   // a histosource is connected to this object
-   //
-   //   if (!theHistogram) return;
-	
-   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
-   if (h.valid())
-   {
-      ossim_float64 d = h->getLowFractionFromValue(clip);
-      if (ossim::isnan(d) == false)
-      {
-         setLowNormalizedClipPoint(d, zero_based_band);
-      }
-   }
-}
-
-void ossimHistogramRemapper::setHighClipPoint(const ossim_float64& clip)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      setHighClipPoint(clip, band);
-   }
-}
-
-void ossimHistogramRemapper::setHighClipPoint(const ossim_float64& clip,
-                                              ossim_uint32 zero_based_band)
-{
-   // allow the call to getHistogram to happen this way we can calculate a histogram if 
-   // a histosource is connected to this object
-   //
-   //   if (!theHistogram) return;
-	
-   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
-   if (h.valid())
-   {
-      ossim_float64 d = h->getHighFractionFromValue(clip);
-      if (ossim::isnan(d) == false)
-      {
-         d = 1.0-d;
-         setHighNormalizedClipPoint(d, zero_based_band);
-      }
-   }
-}
-
-void ossimHistogramRemapper::setMidPoint(const ossim_float64& value)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      setMidPoint(value, band);
-   }
-}
-
-void ossimHistogramRemapper::setMidPoint(const ossim_float64& value,
-                                         ossim_uint32 zero_based_band)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-	
-   if (zero_based_band >= BANDS)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::setMidPoint ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (BANDS-1) << endl;
-   }
-	
-   if (theMidPoint.size() != BANDS)
-   {
-      initializeClips();
-   }
-	
-   if (theMidPoint[zero_based_band] != value)
-   {
-      theDirtyFlag = true;
-      theMidPoint[zero_based_band] = value;
-   }
-}
-
-void ossimHistogramRemapper::setMinOutputValue(const ossim_float64& value)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      setMinOutputValue(value, band);
-   }
-}
-
-void ossimHistogramRemapper::setMinOutputValue(const ossim_float64& value,
-                                               ossim_uint32 zero_based_band)
-{
-   if (theInputConnection)
-   {
-      const ossim_uint32 BANDS = getNumberOfInputBands();
-      
-      if (zero_based_band >= BANDS)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::setMinOutputValue ERROR:"
-            << "\nband " << zero_based_band << " is out of range!"
-            << "\nhighest band:  " << (BANDS-1) << endl;
-      }
-      
-      if (theMinOutputValue.size() != BANDS)
-      {
-         initializeClips();
-      }
-      
-      if ( value != theMinOutputValue[zero_based_band] &&
-           value >= theInputConnection->getMinPixelValue(zero_based_band) &&
-           value < theMaxOutputValue[zero_based_band] )
-      {
-         theDirtyFlag = true;
-         theMinOutputValue[zero_based_band] = value;
-      }
-   }
-}
-
-void ossimHistogramRemapper::setMaxOutputValue(const ossim_float64& value)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      setMaxOutputValue(value, band);
-   }
-}
-
-void ossimHistogramRemapper::setMaxOutputValue(const ossim_float64& value,
-                                               ossim_uint32 zero_based_band)
-{
-   if (theInputConnection)
-   {
-      const ossim_uint32 BANDS = getNumberOfInputBands();
-      
-      if (zero_based_band >= BANDS)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::setMidPoint ERROR:"
-            << "\nband " << zero_based_band << " is out of range!"
-            << "\nhighest band:  " << (BANDS-1) << endl;
-      }
-      
-      if (theMaxOutputValue.size() != BANDS)
-      {
-         initializeClips();
-      }
-      
-      if ( value != theMaxOutputValue[zero_based_band] &&
-           value <= theInputConnection->getMaxPixelValue(zero_based_band) &&
-           value >  theMinOutputValue[zero_based_band] )
-      {
-         theDirtyFlag = true;
-         theMaxOutputValue[zero_based_band] = value;
-      }
-   }
-}
-
-ossim_float64 ossimHistogramRemapper::getLowNormalizedClipPoint(ossim_uint32 zero_based_band) const
-{
-   if (theNormalizedLowClipPoint.size() == 0 ||
-       zero_based_band >= getNumberOfInputBands())
-   {
-      return ossim::nan();
-   }
-   
-   if (zero_based_band >= theNormalizedLowClipPoint.size())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::getLowNormalizedClipPoint ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (theNormalizedLowClipPoint.size()-1)
-         << endl;
-      return ossim::nan();
-   }
-	
-   return theNormalizedLowClipPoint[zero_based_band];
-}
-
-ossim_float64 ossimHistogramRemapper::getLowNormalizedClipPoint() const
-{
-   if (theNormalizedLowClipPoint.size() == 0)
-   {
-      return ossim::nan();
-   }
-   
-   ossim_float64 d = 0.0;
-   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedLowClipPoint.size();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      d += getLowNormalizedClipPoint(band);
-   }
-   
-   return (d / BANDS);
-}
-
-ossim_float64 ossimHistogramRemapper::getHighNormalizedClipPoint(ossim_uint32 zero_based_band) const
-{
-   if (theNormalizedHighClipPoint.size() == 0 ||
-       zero_based_band >= getNumberOfInputBands())
-   {
-      return ossim::nan();
-   }
-   
-   if (zero_based_band >= theNormalizedHighClipPoint.size())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::getHighNormalizedClipPoint ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (theNormalizedHighClipPoint.size()-1)
-         << endl;
-      return ossim::nan();
-   }
-	
-   return theNormalizedHighClipPoint[zero_based_band];
-}
-
-ossim_float64 ossimHistogramRemapper::getHighNormalizedClipPoint() const
-{
-   if (theNormalizedHighClipPoint.size() == 0)
-   {
-      return ossim::nan();
-   }
-   
-   ossim_float64 d = 0.0;
-   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedHighClipPoint.size();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      d += getHighNormalizedClipPoint(band);
-   }
-   
-   return (d / BANDS);
-}
-
-ossim_float64 ossimHistogramRemapper::getLowClipPoint(ossim_uint32 zero_based_band) const
-{
-   if(zero_based_band >= getNumberOfInputBands() ||
-      !theHistogram || zero_based_band >= theNormalizedLowClipPoint.size())
-   {
-      return ossim::nan();
-   }
-	
-   if (theNormalizedLowClipPoint[zero_based_band] == 0.0)
-   {
-      return getMinPixelValue(zero_based_band);
-   }   
-	
-   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
-   if (h.valid())
-   {
-      ossim_float64 d =
-         h->LowClipVal(theNormalizedLowClipPoint[zero_based_band]);
-		
-      return floor(d);
-   }
-	
-   return ossim::nan();
-}
-
-ossim_float64 ossimHistogramRemapper::getLowClipPoint() const
-{
-   if (theNormalizedLowClipPoint.size() == 0 || !theHistogram)
-   {
-      return ossim::nan();
-   }
-   
-   ossim_float64 d = 0.0;
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      d += getLowClipPoint(band);
-   }
-   
-   return (d / BANDS);
-}
-
-ossim_float64 ossimHistogramRemapper::getHighClipPoint(ossim_uint32 zero_based_band) const
-{
-   if(zero_based_band >= getNumberOfInputBands() ||
-      !theHistogram || zero_based_band >= theNormalizedHighClipPoint.size())
-   {
-      return ossim::nan();
-   }
-	
-   if (theNormalizedHighClipPoint[zero_based_band] == 1.0)
-   {
-      return getMaxPixelValue(zero_based_band);
-   }
-	
-   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
-   if (h.valid())
-   {
-      ossim_float64 d =
-         h->HighClipVal(1.0-theNormalizedHighClipPoint[zero_based_band]);
-      return ceil(d);
-   }
-   
-   return ossim::nan();
-}
-
-ossim_float64 ossimHistogramRemapper::getHighClipPoint() const
-{
-   if (theNormalizedHighClipPoint.size() == 0 || !theHistogram)
-   {
-      return ossim::nan();
-   }
-   
-   ossim_float64 d = 0.0;
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      d += getHighClipPoint(band);
-   }
-   
-   return (d / BANDS);
-}
-
-ossim_float64 ossimHistogramRemapper::getMidPoint(ossim_uint32 zero_based_band) const
-{
-   if (theMidPoint.size() == 0 ||
-       zero_based_band >= getNumberOfInputBands())
-   {
-      return ossim::nan();
-   }
-   
-   if (zero_based_band >= theMidPoint.size())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::getMidPoint ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (theMidPoint.size()-1)
-         << endl;
-      return ossim::nan();
-   }
-	
-   return theMidPoint[zero_based_band];
-}
-
-ossim_float64 ossimHistogramRemapper::getMidPoint() const
-{
-   if (theMidPoint.size() == 0)
-   {
-      return ossim::nan();
-   }
-   
-   ossim_float64 d = 0.0;
-   const ossim_uint32 BANDS = (ossim_uint32)theMidPoint.size();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      d += getMidPoint(band);
-   }
-   
-   return (d / BANDS);
-}
-
-ossim_float64 ossimHistogramRemapper::getMinOutputValue(ossim_uint32 zero_based_band) const
-{
-   if (theMinOutputValue.size() == 0 ||
-       zero_based_band >= getNumberOfInputBands())
-   {
-      return ossim::nan();
-   }
-   
-   if (zero_based_band >= theMinOutputValue.size())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::getMinOutputValue ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (theMinOutputValue.size()-1)
-         << endl;
-      return ossim::nan();
-   }
-	
-   return theMinOutputValue[zero_based_band];
-}
-
-ossim_float64 ossimHistogramRemapper::getMinOutputValue() const
-{
-   if (theMinOutputValue.size() == 0)
-   {
-      return ossim::nan();
-   }
-   
-   ossim_float64 d = 0.0;
-   const ossim_uint32 BANDS = (ossim_uint32)theMinOutputValue.size();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      d += getMinOutputValue(band);
-   }
-   
-   return (d / BANDS);
-}
-
-ossim_float64 ossimHistogramRemapper::getMaxOutputValue(ossim_uint32 zero_based_band) const
-{
-   if (theMaxOutputValue.size() == 0 ||
-       zero_based_band >= getNumberOfInputBands())
-   {
-      return ossim::nan();
-   }
-   
-   if (zero_based_band >= theMaxOutputValue.size())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHistogramRemapper::getMaxOutputValue ERROR:"
-         << "\nband " << zero_based_band << " is out of range!"
-         << "\nhighest band:  " << (theMaxOutputValue.size()-1)
-         << endl;
-      return ossim::nan();
-   }
-	
-   return theMaxOutputValue[zero_based_band];
-}
-
-ossim_float64 ossimHistogramRemapper::getMaxOutputValue() const
-{
-   if (theMaxOutputValue.size() == 0)
-   {
-      return ossim::nan();
-   }
-   
-   ossim_float64 d = 0.0;
-   const ossim_uint32 BANDS = (ossim_uint32)theMaxOutputValue.size();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      d += getMaxOutputValue(band);
-   }
-   
-   return (d / BANDS); 
-}
-
-bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   static const char MODULE[] = "ossimHistogramRemapper::loadState";
-   if (traceDebug())
-   {
-      CLOG << " Entered..."
-           << "\nprefix:  " << prefix << endl;
-   }
-   // Load the base class states...
-   bool status = ossimTableRemapper::loadState(kwl, prefix);
-   if (status)
-   {
-      const char* lookup = 0;
-      ossimString keyword;
-      
-      lookup = kwl.find(prefix, HISTOGRAM_FILENAME_KW);
-      if (lookup)
-      {
-         if ( !openHistogram(ossimFilename(lookup)) )
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimHistogramRemapper::loadState ERROR!"
-               << "\nCould not open file:  " << lookup
-               << "\nReturning..." << endl;
-            return false;
-         }
-      }
-     
-      //---
-      // Get the band specific keywords.
-      // NOTES:
-      // -  This loadState assumes the all keywords will have the same number
-      //    of bands.
-      // -  The set methods cannot be used here as there may not be a connection
-      //    yet that they need.
-      //---
-      ossim_uint32 bands = 0;
-      lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
-      if (lookup)
-      {
-         bands = ossimString::toUInt32(lookup);
-      }
-      else  // For backwards compatibility.
-      {
-         // Use the low clip to find number of bands...
-         keyword = NORMALIZED_LOW_CLIP_POINT_KW;
-         bands = kwl.numberOf(prefix, keyword);
-      }
-      //if(!bands&&theHistogram.valid())
-     // {
-     //    bands = theHistogram->getNumberOfBands();
-     // }
-
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimHistogramRemapper::loadState DEBUG:"
-            << "\nBands:  " << bands
-            << endl;
-      }
-      if (bands)
-      {
-         // Start with fresh clips.
-         initializeClips(bands);
-        for (ossim_uint32 band = 0; band < bands; ++band)
-         {
-            // Get the low clip.
-            keyword = NORMALIZED_LOW_CLIP_POINT_KW;
-            keyword += ".";
-            keyword += ossimKeywordNames::BAND_KW;
-            keyword += ossimString::toString(band+1);
-            lookup = kwl.find(prefix, keyword);
-            if(lookup)
-            {
-               theNormalizedLowClipPoint[band] = atof(lookup);
-            }
-            
-            // Get the high clip.
-            keyword = NORMALIZED_HIGH_CLIP_POINT_KW;
-            keyword += ".";
-            keyword += ossimKeywordNames::BAND_KW;
-            keyword += ossimString::toString(band+1);
-            lookup = kwl.find(prefix, keyword);
-            if(lookup)
-            {
-               theNormalizedHighClipPoint[band] = atof(lookup);
-            }
-            
-            // Get the mid point.
-            keyword = MID_POINT_KW;
-            keyword += ".";
-            keyword += ossimKeywordNames::BAND_KW;
-            keyword += ossimString::toString(band+1);
-            lookup = kwl.find(prefix, keyword);
-            if(lookup)
-            {
-               theMidPoint[band] = atof(lookup);
-            }
-            
-            // Get the min output value.
-            keyword = MIN_OUTPUT_VALUE_KW;
-            keyword += ".";
-            keyword += ossimKeywordNames::BAND_KW;
-            keyword += ossimString::toString(band+1);
-            lookup = kwl.find(prefix, keyword);
-            if(lookup)
-            {
-               theMinOutputValue[band] = atof(lookup);
-            }
-            
-            // Get the max output value.
-            keyword = MAX_OUTPUT_VALUE_KW;
-            keyword += ".";
-            keyword += ossimKeywordNames::BAND_KW;
-            keyword += ossimString::toString(band+1);
-            lookup = kwl.find(prefix, keyword);
-            if(lookup)
-            {
-               theMaxOutputValue[band] = atof(lookup);
-            }      
-         }
-     }
-     
-      lookup = kwl.find(prefix, STRETCH_MODE_KW);
-      if (lookup)
-      {
-         ossimString s = lookup;
-         s.downcase();
-         if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_ONE_PIECE])
-         {
-            theStretchMode = ossimHistogramRemapper::LINEAR_ONE_PIECE;
-         }
-         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN])
-         {
-            theStretchMode = ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN;
-         }
-         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN])
-         {
-            theStretchMode = ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN;
-         }
-         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN])
-         {
-            theStretchMode = ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN;
-         }
-         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX])
-         {
-            theStretchMode = ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX;
-         }
-         else
-         {
-            theStretchMode = ossimHistogramRemapper::STRETCH_UNKNOWN;
-         }
-      }
-
-      // Always set the dirty flag.
-      theDirtyFlag = true;
-   }
-   verifyEnabled();
-
-   if (traceDebug())
-   {
-      CLOG << "ossimHistogramRemapper::loadState DEBUG:"
-           << *this
-           << "\nExited..." << endl;
-   }
-   return status;
-}
-
-bool ossimHistogramRemapper::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix) const
-{
-   if (theHistogram.valid())
-   {
-      kwl.add(prefix,
-              HISTOGRAM_FILENAME_KW,
-              theHistogram->getHistogramFile().c_str(),
-              true);
-   }
-   kwl.add(prefix,
-           STRETCH_MODE_KW,
-           getStretchModeString().c_str(),
-           true);
-	
-   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedLowClipPoint.size();
-   
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_BANDS_KW,
-           BANDS,
-           true);
-	
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      ossimString keyword;
-		
-      // Save the low clip.
-      keyword = NORMALIZED_LOW_CLIP_POINT_KW;
-      keyword += ".";
-      keyword += ossimKeywordNames::BAND_KW;
-      keyword += ossimString::toString(band+1);
-      kwl.add(prefix,
-              keyword,
-              theNormalizedLowClipPoint[band],
-              true);
-		
-      // Save the high clip.
-      keyword = NORMALIZED_HIGH_CLIP_POINT_KW;
-      keyword += ".";
-      keyword += ossimKeywordNames::BAND_KW;
-      keyword += ossimString::toString(band+1);
-      kwl.add(prefix,
-              keyword,
-              theNormalizedHighClipPoint[band],
-              true);
-		
-      // Save the mid point.
-      keyword = MID_POINT_KW;
-      keyword += ".";
-      keyword += ossimKeywordNames::BAND_KW;
-      keyword += ossimString::toString(band+1);
-      kwl.add(prefix,
-              keyword,
-              theMidPoint[band],
-              true);
-		
-      // Save the min output value.
-
-      keyword = MIN_OUTPUT_VALUE_KW;
-      keyword += ".";
-      keyword += ossimKeywordNames::BAND_KW;
-      keyword += ossimString::toString(band+1);
-      kwl.add(prefix,
-              keyword,
-              theMinOutputValue[band],
-              true);
-		
-      // Save the max output value.
-      keyword = MAX_OUTPUT_VALUE_KW;
-      keyword += ".";
-      keyword += ossimKeywordNames::BAND_KW;
-      keyword += ossimString::toString(band+1);
-
-      kwl.add(prefix,
-              keyword,
-              theMaxOutputValue[band],
-              true);
-   }
-
-   return ossimTableRemapper::saveState(kwl, prefix);
-}
-
-void ossimHistogramRemapper::setStretchMode(StretchMode mode,
-                                            bool rebuildTable)
-{
-   if (theStretchMode != mode)
-   {
-      theStretchMode = mode;
-
-      if (rebuildTable)
-      {
-         buildTable();
-
-         // Check for internal bypass.
-         verifyEnabled();
-
-         // Clear the dirty flag.
-         theDirtyFlag = false;
-      }
-      else
-      {
-         theDirtyFlag = true;
-      }
-   }
-}
-
-void ossimHistogramRemapper::setStretchModeAsString(const ossimString& mode,
-                                                    bool rebuildTable)
-{
-   if( mode == "linear_one_piece")
-   {
-      setStretchMode(LINEAR_ONE_PIECE, rebuildTable);
-   }
-   else if(mode == "linear_1std_from_mean")
-   {
-      setStretchMode(LINEAR_1STD_FROM_MEAN, rebuildTable);
-   }
-   else if(mode == "linear_2std_from_mean")
-   {
-      setStretchMode(LINEAR_2STD_FROM_MEAN, rebuildTable);
-   }
-   else if(mode == "linear_3std_from_mean")
-   {
-      setStretchMode(LINEAR_3STD_FROM_MEAN, rebuildTable);
-   }
-   else if(mode == "linear_auto_min_max")
-   {
-      setStretchMode(LINEAR_AUTO_MIN_MAX, rebuildTable);
-   }
-   else
-   {
-      setStretchMode(STRETCH_UNKNOWN, false);
-   }   
-}
-
-void ossimHistogramRemapper::buildTable()
-{
-   setupTable();
-   switch(theStretchMode)
-   {
-      case ossimHistogramRemapper::LINEAR_ONE_PIECE:
-      {
-         buildLinearTable();
-         break;
-      }
-      case ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX:
-      {
-         buildAutoLinearMinMaxTable();
-         break;
-      }
-      case ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN:
-      case ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN:
-      case ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN:
-         buildLinearTableStdFromMean();
-         break;
-         
-      default:
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimHistogramRemapper::buildTable ERROR!"
-               << "\nUnknown stretch type!" << endl;
-         }
-         break;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimHistogramRemapper::buildTable DEBUG:\n" << endl;
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-}
-
-void ossimHistogramRemapper::buildLinearTable()
-{
-   switch (getOutputScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         buildLinearTable(ossim_uint8(0));
-         break;
-      }
-			
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         buildLinearTable(ossim_uint16(0));
-         break;
-      }
-			
-      case OSSIM_SINT16:
-      {
-         buildLinearTable(ossim_sint16(0));
-         break;
-      }
-
-      case OSSIM_UINT32:
-      {
-         buildLinearTable(ossim_uint32(0));
-         break;
-      }
-			
-      case OSSIM_SINT32:
-      {
-         buildLinearTable(ossim_sint32(0));
-         break;
-      }
-			
-      case OSSIM_NORMALIZED_FLOAT:      
-      case OSSIM_FLOAT:
-      {
-         buildLinearTable(ossim_float32(0));
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_DOUBLE:
-      {
-         buildLinearTable(ossim_float64(0));
-         break;
-      }
-			
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-            // Shouldn't hit this.
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimHistogramRemapper::buildLinearTable OSSIM_SCALAR_UNKNOWN!" << endl;
-         }
-         break;
-      }
-			
-   } // End of "switch (theTableType)"
-}
-
-void ossimHistogramRemapper::buildAutoLinearMinMaxTable()
-{
-   switch (getOutputScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         buildAutoLinearMinMaxTableTemplate(ossim_uint8(0));
-         break;
-      }
-			
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         buildAutoLinearMinMaxTableTemplate(ossim_uint16(0));
-         break;
-      }
-			
-      case OSSIM_SINT16:
-      {
-         buildAutoLinearMinMaxTableTemplate(ossim_sint16(0));
-         break;
-      }
-			
-      case OSSIM_NORMALIZED_FLOAT:      
-      case OSSIM_FLOAT:
-      {
-         buildAutoLinearMinMaxTableTemplate(ossim_float32(0));
-         break;
-      }
-			
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_DOUBLE:
-      {
-         buildAutoLinearMinMaxTableTemplate(ossim_float64(0));
-         break;
-      }
-			
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-         // Shouldn't hit this.
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimTableRemapper::buildTable OSSIM_SCALAR_UNKNOWN!"
-               << endl;
-         }
-         break;
-      }
-			
-   } // End of "switch (theTableType)"
-}
-
-template <class T> void ossimHistogramRemapper::buildLinearTable(T /* dummy */)
-{
-   // This builds a native table.
-   theTableType = ossimTableRemapper::NATIVE;
-   
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-
-   // Sanity check.
-   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::buildTable ERROR!"
-            << " Line:  " << __LINE__ << endl;
-      }
-      return;
-   }
-   
-   T* table = reinterpret_cast<T*>(&theTable.front());
-   ossim_uint32 index = 0;
-   
-   // Finally, build the table...
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      ossimRefPtr<ossimHistogram> h  = getHistogram(band);
-      if (h.get())
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimHistogramRemapper::buildLinearTable DEBUG:"
-               << "\nband:  " << band
-               << "\nmean:  " << h->GetMean()
-               << "\nstddev:  " << h->GetStandardDev()
-               << endl;
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::buildTable ERROR!"
-            << " Line:  " << __LINE__ << endl;
-         }
-         return; 
-      }
-		//std::cout << "MIN OUTPUT ==== " << theMinOutputValue[band] << std::endl;
-      const T NULL_PIX = static_cast<T>(getNullPixelValue(band));
-      const T MIN_PIX  = static_cast<T>(theMinOutputValue[band]);
-      const T MAX_PIX  = static_cast<T>(theMaxOutputValue[band]);
-
-      ossim_float64 min_clip_value =
-         h->LowClipVal(theNormalizedLowClipPoint[band]);
-      ossim_float64 max_clip_value =
-         h->HighClipVal(1.0-theNormalizedHighClipPoint[band]);
-      min_clip_value = floor(min_clip_value);
-      max_clip_value = ceil(max_clip_value);
-      ossim_float64 gain = (MAX_PIX-MIN_PIX+1)/(max_clip_value-min_clip_value);
-      
-      table[index] = NULL_PIX;
-      ++index;
-
-      for (ossim_uint32 pix = 1; pix < theTableBinCount; ++pix)
-      {
-         ossim_float64 p = pix;
-         if (p <= min_clip_value)
-         {
-            p = MIN_PIX;
-         }
-         else if (p >= max_clip_value)
-         {
-            p = MAX_PIX;
-         }
-         else
-         {
-            p = ((p - min_clip_value) * gain) + MIN_PIX - 1.0;
-         }
-
-         if(p == NULL_PIX)
-         {
-            p = MIN_PIX;
-         }
-         table[index] = static_cast<T>(p+0.5);
-			
-         ++index;
-      }
-   } // End of band loop.
-
-   // Clear the dirty flag so the table's not rebuilt on the next getTile.
-   theDirtyFlag = false;
-}
-
-template <class T> void ossimHistogramRemapper::buildAutoLinearMinMaxTableTemplate(T /* dummy */)
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-
-   // Sanity check.
-   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::buildAutoLinearMinMaxTableTemplate ERROR!"
-            << " Line:  " << __LINE__ << endl;
-      }
-      return;
-   }
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      ossimRefPtr<ossimHistogram> h      = getHistogram(band);
-      T nullPix = static_cast<T>(getNullPixelValue(band));
-      if(h.valid())
-      {
-         ossim_uint32 n     = h->GetRes();
-         ossim_float64 low  = h->GetMinVal();
-         ossim_float64 high = h->GetMaxVal();
-
-         double percentChange = .006;
-         if(n > 0)
-         {
-            double newCount       = 0.0;
-            double nextPercentage = 0.0;
-            double percentage = 0.0;
-            int idx = 0;
-            float * counts = h->GetCounts();
-            double count   = h->ComputeArea();
-				
-            for(idx = 0; idx < (ossim_int32)(n-1); ++idx)
-            {
-               if(nullPix != idx)
-               {
-                  newCount += counts[idx];
-               }
-               percentage = newCount / count;
-               nextPercentage =
-                  (newCount + counts[idx+1]) / count;
-//               if (std::fabs(percentage - 0.006) <
-//                   std::fabs(nextPercentage - 0.006))
-                  if (std::fabs(percentage - percentChange) <
-                      std::fabs(nextPercentage - percentChange))
-               {
-                  low = idx+1;
-                  break;
-               }
-               
-            }
-            newCount = 0.0;
-            for (idx = n-1; idx > 0; idx--)
-            {
-               newCount += counts[idx];
-               percentage = newCount / count;
-               nextPercentage =
-                  (newCount + counts[idx-1]) / count;
-               if (std::fabs(percentage - percentChange) <
-                   std::fabs(nextPercentage - percentChange))
-               {
-                  high=idx-1;
-                  break;
-               }
-            }
-            if(low > high)
-            {
-               low = 0;
-               high = n - 1;
-            }
-            //theMinOutputValue[band] = 1;
-            //theMaxOutputValue[band] = 65535;
-
-            //std::cout << "LOW ===== " << low << std::endl;
-            //std::cout << "HIGH ===== " << high << std::endl;
-            setLowClipPoint(low, band);
-            setHighClipPoint(high, band);
-         }
-      }
-   }
-   
-   buildLinearTable();
-}
-
-void ossimHistogramRemapper::buildLinearTableStdFromMean()
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-	
-   // Sanity check.
-   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHistogramRemapper::buildTable ERROR!"
-            << " Line:  " << __LINE__ << endl;
-      }
-      return;
-   }
-   
-   ossim_float64 multiplier = 1.0;
-   if (theStretchMode == LINEAR_2STD_FROM_MEAN)
-   {
-      multiplier =  2.0;
-   }
-   else if (theStretchMode == LINEAR_3STD_FROM_MEAN)
-   {
-      multiplier =  3.0;
-   }
-	
-   // Finally, build the table...
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      ossimRefPtr<ossimHistogram> h      = getHistogram(band);
-      ossim_float64 mean = 0.0;
-      ossim_float64 stdDev = 0.0;
-      if(h.valid())
-      {
-         mean     = h->GetMean();
-         stdDev   = h->GetStandardDev();
-      }
-      ossim_float64 lowClip  = mean - (stdDev * multiplier);
-      ossim_float64 highClip = mean + (stdDev * multiplier);
-		
-      // Clamp to min/max.
-      if (lowClip < theMinOutputValue[band])
-      {
-         lowClip = theMinOutputValue[band];
-      }
-      if (highClip > theMaxOutputValue[band])
-      {
-         highClip = theMaxOutputValue[band];
-      }
-      
-      setLowClipPoint(lowClip, band);
-      setMidPoint(mean, band);
-      setHighClipPoint(highClip, band);
-      
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimHistogramRemapper::buildLinearStdFromMean DEBUG:"
-            << "\nband:       " << band
-            << "\nmean:       " << mean
-            << "\nstddev:     " << stdDev
-            << "\nlow clip:   " << lowClip
-            << "\nhigh clip:  " << highClip
-            << endl;
-      }
-   }
-   
-   buildLinearTable();
-}
-
-void ossimHistogramRemapper::initializeClips()
-{
-   initializeClips(getNumberOfInputBands());
-}
-
-void ossimHistogramRemapper::initializeClips(ossim_uint32 bands)
-{
-   //---
-   // NOTE: This method deoes not set theDirtyFlag by design.
-   //---
-   if (bands)
-   {
-      theNormalizedLowClipPoint.resize(bands);
-      theNormalizedHighClipPoint.resize(bands);
-      theMidPoint.resize(bands);
-      theMinOutputValue.resize(bands);
-      theMaxOutputValue.resize(bands);
-      
-      for (ossim_uint32 band = 0; band < bands; ++band)
-      {
-         theNormalizedLowClipPoint[band]  = 0.0;
-         theNormalizedHighClipPoint[band] = 1.0;
-         theMidPoint[band] = 0.0;
-         
-         // Must have an output scalar type for getMin/Max call.
-         if (theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
-         {
-            theMinOutputValue[band] = ossim::defaultMin(theOutputScalarType);//getMinPixelValue(band);
-            theMaxOutputValue[band] = ossim::defaultMax(theOutputScalarType);//getMaxPixelValue(band);
-         }
-         else
-         {
-            theMinOutputValue[band] = 0.0;
-            theMaxOutputValue[band] = 0.0;
-         }
-      }
-   }
-}
-
-void ossimHistogramRemapper::initializeMinMaxOutput()
-{
-   ossim_uint32 nBands = getNumberOfInputBands();
-   theMinOutputValue.resize(nBands);
-   theMaxOutputValue.resize(nBands);
-   for (ossim_uint32 band = 0; band < nBands; ++band)
-   {
-         // Must have an output scalar type for getMin/Max call.
-         if (theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
-         {
-            theMinOutputValue[band] = ossim::defaultMin(theOutputScalarType);//getMinPixelValue(band);
-            theMaxOutputValue[band] = ossim::defaultMax(theOutputScalarType);//getMaxPixelValue(band);
-         }
-         else
-         {
-            theMinOutputValue[band] = 0.0;
-            theMaxOutputValue[band] = 0.0;
-         }
-  }
-
-}
-
-void ossimHistogramRemapper::setNullCount()
-{
-   // This will set the null bucket for all res zero bands to zero!
-   if (getHistogram(0).valid())
-   {
-      const ossim_uint32 BANDS = theHistogram->getNumberOfBands();
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         ossimRefPtr<ossimHistogram> h = theHistogram->getHistogram(band);
-         if (h.valid())
-         {
-            h->SetCount(0, 0);
-         }
-      }
-   }
-}
-
-ossimHistogramRemapper::StretchMode ossimHistogramRemapper::getStretchMode() const
-{
-   return theStretchMode;
-}
-
-ossimString ossimHistogramRemapper::getStretchModeString() const
-{
-   return ossimString(STRETCH_MODE[theStretchMode]);
-}
-
-ossim_uint32 ossimHistogramRemapper::getNumberOfStretchModes() const
-{
-   return ossimHistogramRemapper::STRETCH_UNKNOWN; // last index
-}
-
-ossimString
-ossimHistogramRemapper::getStretchModeString(ossim_uint32 index) const
-{
-   if (index < ossimHistogramRemapper::STRETCH_UNKNOWN)
-   {
-      return ossimString(STRETCH_MODE[index]);
-   }
-	
-   return ossimString(STRETCH_MODE[ossimHistogramRemapper::STRETCH_UNKNOWN]);
-   
-}
-
-ostream& ossimHistogramRemapper::print(ostream& os) const
-{
-   os << setiosflags(ios::fixed) << setprecision(15)
-      << "\nossimHistogramRemapper::print:"
-      << "\ntheStretchMode:         " << getStretchModeString().c_str()
-      << "\ntheDirtyFlag:           " << (theDirtyFlag?"true":"false")
-      << "\ntheBypassFlag:          " << (theBypassFlag?"true":"false")
-      
-      << "\ntheHistogram:           " << (theHistogram.valid()?"initialized":"null")
-      << "\ntheTableSizeInBytes:    " << theTable.size()
-      << endl;
-	
-   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedLowClipPoint.size();
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      os << "\ntheNormalizedLowClipPoint[" << band << "]:   "
-         << theNormalizedLowClipPoint[band]
-         << "\ntheNormalizedHighClipPoint[" << band << "]:  "
-         << theNormalizedHighClipPoint[band]
-         << "\ntheMidPoint[" << band << "]:                 "
-         << theMidPoint[band]
-         << "\ntheMinOutputValue[" << band << "]:           "
-         << theMinOutputValue[band]
-         << "\ntheMaxOutputValue[" << band << "]:           "
-         << theMaxOutputValue[band]
-         << endl;
-   }
-	
-   for (ossim_uint32 i = 0; i < theBandList.size(); ++i)
-   {
-      os << "theBandList[" << i << "]:  " << theBandList[i] << endl;
-   }
-
-   // Note: To set table call ossimTableRemapper::print or turn trace on
-   // for "ossimTableRemapper:debug"
-   
-   return os;
-}
-
-void ossimHistogramRemapper::setupTable()
-{
-   const ossim_uint32 BANDS = getNumberOfInputBands();
-   
-   if (theNormalizedLowClipPoint.size() == 0)
-   {
-      initializeClips(BANDS);
-   }
-   
-   ossim_uint32 values_per_band = 0;
-   ossim_uint32 bytes_per_pixel = 0;
-   
-   switch (theOutputScalarType)
-   {
-      case OSSIM_UINT8:
-         values_per_band = 256;  // 2 ^ 8
-         bytes_per_pixel = 1;
-         theTableType = ossimTableRemapper::NATIVE;
-         break;
-         
-      case OSSIM_USHORT11:
-         values_per_band = 2048; // 2 ^ 11
-         bytes_per_pixel = 2;
-         theTableType = ossimTableRemapper::NATIVE;
-         break;
-         
-      case OSSIM_UINT16:
-      case OSSIM_SINT16:
-         values_per_band = 65536; // 2 ^ 16
-         bytes_per_pixel = 2;
-         theTableType = ossimTableRemapper::NATIVE;
-         break;
-         
-      case OSSIM_UINT32:
-      case OSSIM_SINT32:
-         values_per_band = 65536; // 2 ^ 16
-         bytes_per_pixel = 4;
-         theTableType = ossimTableRemapper::NATIVE;
-         break;
-			
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT:
-         bytes_per_pixel = 4;
-         break;
-			
-      case OSSIM_NORMALIZED_DOUBLE:         
-      case OSSIM_DOUBLE:
-         bytes_per_pixel = 8;
-         theTableType = ossimTableRemapper::NORMALIZED;
-         break;
-         
-      default:
-         break;
-   }
-	
-   if ( theOutputScalarType == OSSIM_FLOAT ||
-        theOutputScalarType == OSSIM_DOUBLE ||
-        theOutputScalarType == OSSIM_NORMALIZED_FLOAT ||
-        theOutputScalarType == OSSIM_NORMALIZED_DOUBLE )
-   {
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         ossimRefPtr<ossimHistogram> h  = getHistogram(band);
-			
-         if (h.valid())
-         {
-            if (h->GetRes() > static_cast<ossim_int32>(values_per_band))
-            {
-               values_per_band = h->GetRes();
-            }
-         }
-      }
-   }      
-   
-   theTableBinCount  = values_per_band;
-   theTableBandCount = BANDS;
-
-   ossim_uint32 size_in_bytes = values_per_band * BANDS * bytes_per_pixel;
-   theTable.resize(size_in_bytes);
-
-   ossimImageSource* input = dynamic_cast<ossimImageSource*>(getInput());
-   double minPix = ossim::defaultMin(getOutputScalarType());
-   double maxPix = ossim::defaultMax(getOutputScalarType());
-   
-   if(input)
-   {
-      //---
-      // Last check for NaNs in key data members and set to some default if so.
-      // This could occur if someone stripped a keyword list down to a minimal
-      // set of keywords.
-      //---
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         minPix = input->getMinPixelValue(band);
-         maxPix = input->getMaxPixelValue(band);
-         if ( ossim::isnan(theMinOutputValue[band]) )
-         {
-            theMinOutputValue[band] = minPix;
-         }
-         if ( ossim::isnan(theMaxOutputValue[band]) )
-         {
-            theMaxOutputValue[band] = maxPix;
-         }
-      }   
-   }
-   else
-   {
-      //---
-      // Last check for NaNs in key data members and set to some default if so.
-      // This could occur if someone stripped a keyword list down to a minimal
-      // set of keywords.
-      //---
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         if ( ossim::isnan(theMinOutputValue[band]) )
-         {
-            theMinOutputValue[band] = minPix;
-         }
-         if ( ossim::isnan(theMaxOutputValue[band]) )
-         {
-            theMaxOutputValue[band] = maxPix;
-         }
-      }   
-   }
-}
-
-void ossimHistogramRemapper::verifyEnabled()
-{
-   //---
-   // Since this filter can be constructed with no input connection do not
-   // output and error, simply return.
-   //---	
-      setBypassFlag(true);
-   //if (theInputConnection)
-   {
-
-#if 1     
-      // Start off bypassed.
-
-      if (theStretchMode != STRETCH_UNKNOWN)
-      {
-         if(theHistogram.valid())
-         {
-            setBypassFlag(false);
-         }
-/*         
-         const ossim_uint32 BANDS =
-            (ossim_uint32)theNormalizedLowClipPoint.size();
-         for (ossim_uint32 band = 0; band < BANDS; ++band)
-         {
-            //const double MIN = ossimTableRemapper::getMinPixelValue(band);
-            //const double MAX = ossimTableRemapper::getMaxPixelValue(band);
-            if ( theNormalizedLowClipPoint[band]  != 0.0   ||
-                 theNormalizedHighClipPoint[band] != 1.0 )
-                // theMinOutputValue[band] != MIN ||
-                 //theMaxOutputValue[band] != MAX )
-            {
-               // Need to turn filter on.
-               setBypassFlag(false);
-               break;
-            }
-         }
-         */
-      }
-#endif
-   }
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimHistogramRemapper::verifyEnabled theBypassFlag: "
-         << (theBypassFlag ? "true" : "false") << endl;
-   }
-}
-
-ossimRefPtr<ossimMultiResLevelHistogram> ossimHistogramRemapper::getHistogram()
-{
-   return ossimRefPtr<ossimMultiResLevelHistogram>(theHistogram.get());
-}
-
-ossimRefPtr<const ossimMultiResLevelHistogram> ossimHistogramRemapper::getHistogram()const
-{
-   return ossimRefPtr<const ossimMultiResLevelHistogram>(theHistogram.get());
-}
-
-ossimRefPtr<ossimHistogram>
-ossimHistogramRemapper::getHistogram(ossim_uint32 zero_based_band,
-                                     ossim_uint32 res_level) const
-{
-   ossim_uint32 histogram_band = getHistogramBand(zero_based_band);
-   
-   if(!theHistogram.valid())
-   {
-      const ossimHistogramSource* source = dynamic_cast<const ossimHistogramSource*>(getInput(1));
-      if(source)
-      {
-         theHistogram = const_cast<ossimHistogramSource*>(source)->getHistogram();
-      }      
-   }
-   
-   if (theHistogram.valid())
-   {
-      if (histogram_band < theHistogram->getNumberOfBands())
-      {
-         return theHistogram->getHistogram(histogram_band, res_level);
-      }
-   }
-	
-   return 0;
-}
-
-ossimFilename ossimHistogramRemapper::getHistogramFile() const
-{
-   if (theHistogram.valid())
-   {
-      return theHistogram->getHistogramFile();
-   }
-	
-   return ossimFilename::NIL;
-}
-
-ossim_uint32
-ossimHistogramRemapper::getHistogramBand(ossim_uint32 input_band) const
-{
-   if(theResetBandIndicesFlag) return input_band;
-   vector<ossim_uint32> bandList;
-   getOutputBandList(bandList);
-   
-   const ossim_uint32 BANDS = (ossim_uint32)bandList.size();
-	
-   if (BANDS == 0)
-   {
-      return 0;
-   }
-	
-   return bandList[input_band];
-}
-
-ossimString ossimHistogramRemapper::getLongName()const
-{
-   return ossimString("Histogram Remapper, filter with controls for histogram stretching.");
-}
-
-ossimString ossimHistogramRemapper::getShortName()const
-{
-   return ossimString("Histogram Remapper");
-}
-
-// Private to disallow use...
-ossimHistogramRemapper::ossimHistogramRemapper(const ossimHistogramRemapper&)
-{
-}
-
-// Private to disallow use...
-ossimHistogramRemapper& ossimHistogramRemapper::operator=(const ossimHistogramRemapper&)
-{
-   return *this;
-}
-
-void ossimHistogramRemapper::setBypassFlag(bool flag)
-{
-   if (theBypassFlag != flag)
-   {
-      //---
-      // If switching from bypassed to enabled set
-      // the dirty flag.  We don't care about going the other way.
-      //---
-      if ( theBypassFlag && !flag )
-      {
-         theDirtyFlag = true;
-      }
-      theBypassFlag = flag;
-   }
-}
-
-double ossimHistogramRemapper::getMinPixelValue(ossim_uint32 band)const
-{
-   double result = ossimTableRemapper::getMinPixelValue(band);
-   if(theEnableFlag&&!theBypassFlag &&(band < theMinOutputValue.size()))
-   {
-      result = theMinOutputValue[band];
-   }
-  // if(theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
-  // {
-  //    return ossim::defaultMin(theOutputScalarType);
-  // }
-
-   return result;
-}
-
-double ossimHistogramRemapper::getMaxPixelValue(ossim_uint32 band)const
-{
-   double result = ossimTableRemapper::getMaxPixelValue(band);
-
-   if(theEnableFlag&&!theBypassFlag &&(band < theMaxOutputValue.size()))
-   {
-      result = theMaxOutputValue[band];
-   }
-   //if(theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
-  // {
-  //    result = ossim::defaultMax(theOutputScalarType);
-  // }
-
-   return result;
-}
-
-bool ossimHistogramRemapper::canConnectMyInputTo(ossim_int32 inputIndex,
-                                                 const ossimConnectableObject* object)const
-{
-   // we will alloe the histogram source only to be connected to input slot 2 and
-   // the first slot will be reserved for the ossimImageSource.
-   //
-   bool result = false;
-   if(inputIndex == 0) result = dynamic_cast<const ossimImageSource*>(object)!=0;
-   if(inputIndex == 1) result = dynamic_cast<const ossimHistogramSource*>(object)!=0;
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimHistogramThreshholdFilter.cpp b/ossim/src/ossim/imaging/ossimHistogramThreshholdFilter.cpp
deleted file mode 100644
index 549cf9e..0000000
--- a/ossim/src/ossim/imaging/ossimHistogramThreshholdFilter.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHistogramThreshholdFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimHistogramThreshholdFilter.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeyword.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimErrorContext.h>
-
-static const ossimKeyword MIN_VALUE_PERCENT_KW("min_percent",
-                                               "min percentage clip");
-
-static const ossimKeyword MAX_VALUE_PERCENT_KW("max_percent",
-                                               "max percentage value");
-
-
-RTTI_DEF1(ossimHistogramThreshholdFilter, "ossimHistogramThreshholdFilter", ossimImageSourceHistogramFilter)
-   
-ossimHistogramThreshholdFilter::ossimHistogramThreshholdFilter()
-   : ossimImageSourceHistogramFilter(),
-     theMinValuePercent(0.0),
-     theMaxValuePercent(0.0)
-{
-}
-
-ossimHistogramThreshholdFilter::ossimHistogramThreshholdFilter(double minValuePercent,
-                                                               double maxValuePercent,
-                                                               ossimImageSource* inputSource,
-                                                               ossimMultiResLevelHistogram* histogram)
-   : ossimImageSourceHistogramFilter(inputSource, histogram),
-     theMinValuePercent(minValuePercent),
-     theMaxValuePercent(maxValuePercent)
-{
-}
-
-ossimHistogramThreshholdFilter::~ossimHistogramThreshholdFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimHistogramThreshholdFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection) return NULL;
-   
-   ossimRefPtr<ossimImageData> inputTile =
-      theInputConnection->getTile(tileRect, resLevel);
-
-   if(!isSourceEnabled())
-   {
-      return inputTile;
-   }
-   if(inputTile.valid()  &&
-      inputTile->getBuf() &&
-      (inputTile->getDataObjectStatus()!=OSSIM_EMPTY))
-   {
-      switch(inputTile->getScalarType())
-      {
-         case OSSIM_UCHAR:
-         {
-            return runThreshholdStretchAlgorithm((ossim_uint8)0,
-                                                 inputTile);
-         }
-         case OSSIM_USHORT16:
-         case OSSIM_USHORT11:
-         {
-            return runThreshholdStretchAlgorithm((ossim_uint16)0,
-                                                 inputTile);
-         }
-         case OSSIM_SSHORT16:
-         {
-            return runThreshholdStretchAlgorithm(static_cast<ossim_sint16>(0),
-                                                 inputTile);
-         }
-         case OSSIM_DOUBLE:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            return runThreshholdStretchAlgorithm(static_cast<double>(0),
-                                                 inputTile);
-         }
-         case OSSIM_FLOAT:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            return runThreshholdStretchAlgorithm(static_cast<float>(0),
-                                                 inputTile);
-         }
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-         {
-            ossimSetError("ossimHistogramThreshholdFilter",
-                          ossimErrorCodes::OSSIM_ERROR,
-                          "Unknown scalar type");
-            break;
-         }
-      }
-   }
-
-   return inputTile;
-}
-
-
-bool ossimHistogramThreshholdFilter::loadState(const ossimKeywordlist& kwl,
-                                           const char* prefix)
-{
-   if(ossimImageSourceHistogramFilter::loadState(kwl, prefix))
-   {
-      const char* minPercent = kwl.find(prefix, MIN_VALUE_PERCENT_KW);
-      const char* maxPercent = kwl.find(prefix, MAX_VALUE_PERCENT_KW);
-
-      if(minPercent)
-      {
-         theMinValuePercent = ossimString(minPercent).toDouble();
-      }
-      else
-      {
-         theMinValuePercent = 0.0;
-      }
-      if(maxPercent)
-      {
-         theMaxValuePercent = ossimString(maxPercent).toDouble();
-      }
-      else
-      {
-         theMaxValuePercent = 0.0;
-      }
-   }
-   else
-   {
-      return false;
-   }
-
-   return true;
-}
-
-bool ossimHistogramThreshholdFilter::saveState(ossimKeywordlist& kwl,
-                                           const char* prefix)const
-{
-   if(ossimImageSourceHistogramFilter::saveState(kwl, prefix))
-   {
-      kwl.add(prefix,
-              MIN_VALUE_PERCENT_KW,
-              theMinValuePercent,
-              true);
-      kwl.add(prefix,
-              MAX_VALUE_PERCENT_KW,
-              theMaxValuePercent,
-              true);
-   }
-   else
-   {
-      return false;
-   }
-
-   return true;
-}
-
-void ossimHistogramThreshholdFilter::initialize()
-{
-   ossimImageSourceHistogramFilter::initialize();
-}
-
-template <class T>
-ossimRefPtr<ossimImageData> ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(
-   T /* dummyVariable */,
-   ossimRefPtr<ossimImageData>& tile)
-{
-   if(!getHistogram())
-   {
-      return tile;
-   }
-   
-   ossimRefPtr<ossimMultiBandHistogram> histo    = getHistogram()->getMultiBandHistogram(0);
-   if(histo.valid())
-   {
-      ossim_uint32 maxBands = ( (histo->getNumberOfBands() >
-                                 tile->getNumberOfBands())?
-                                tile->getNumberOfBands():
-                                histo->getNumberOfBands());
-      
-      long offsetUpperBound = tile->getHeight()*tile->getWidth();
-
-      for(ossim_uint32 band = 0; band < maxBands; ++band)
-      {
-         ossimRefPtr<ossimHistogram> h  = histo->getHistogram(band);
-         T* buf   = static_cast<T*>(tile->getBuf(band));
-         
-         if(h.valid()&&buf)
-         {
-            T np     = static_cast<T>(tile->getNullPix(band));
-            T minPix = static_cast<T>(tile->getMinPix(band));
-            T maxPix = static_cast<T>(tile->getMaxPix(band));
-            double range  = (maxPix - minPix);
-            double maxClip = (h->HighClipVal(theMaxValuePercent/100.0)/(double)h->GetRes());
-            double minClip = (h->LowClipVal(theMinValuePercent/100.0)/(double)h->GetRes());
-            ossim_float64 normPix;
-            double delta   = fabs(maxClip - minClip);
-            if(delta > 0.0)
-            {
-               for(long offset = 0; offset < offsetUpperBound; ++offset)
-               {
-                  if(buf[offset] != np)
-                  {
-                     normPix = ((double)buf[offset]-minPix)/range;
-                     if(normPix <= minClip)
-                     {
-                        buf[offset] = minPix;
-                     }
-                     else if(normPix >= maxClip)
-                     {
-                        buf[offset] = maxPix;
-                     }
-                     else 
-                     {
-                        double t = (normPix - minClip)/delta;
-                        T value = static_cast<T>(minPix + range*t);
-                        buf[offset] = value;
-                     }
-                  }
-               }
-            }
-         }
-      }
-
-      tile->validate();
-   }
-   
-   return tile;
-}
-
-void ossimHistogramThreshholdFilter::setMinValuePercent(double minValue)
-{
-   theMinValuePercent = minValue;
-}
-
-void ossimHistogramThreshholdFilter::setMaxValuePercent(double maxValue)
-{
-   theMaxValuePercent = maxValue;
-}
-
-double ossimHistogramThreshholdFilter::getMinValuePercent()const
-{
-   return theMinValuePercent;
-}
-
-double ossimHistogramThreshholdFilter::getMaxValuePercent()const
-{
-   return theMaxValuePercent;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimHistogramWriter.cpp b/ossim/src/ossim/imaging/ossimHistogramWriter.cpp
deleted file mode 100644
index b923323..0000000
--- a/ossim/src/ossim/imaging/ossimHistogramWriter.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHistogramWriter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/base/ossimProcessListener.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug("ossimHistogramWriter:debug");
-class ossimHistogramWriterProcessListener : public ossimProcessListener
-{
-public:
-   ossimHistogramWriterProcessListener(ossimConnectableObject* passon)
-      :thePassonTo(passon)
-      {
-      }
-   virtual void processProgressEvent(ossimProcessProgressEvent& event)
-      {
-         if(thePassonTo)
-         {
-            event.setObject(thePassonTo);
-            thePassonTo->fireEvent(event);
-         }
-      }
-
-   ossimConnectableObject* thePassonTo;  
-   
-};
-
-RTTI_DEF3(ossimHistogramWriter,
-          "ossimHistogramWriter",
-          ossimOutputSource,
-          ossimProcessInterface,
-          ossimConnectableObjectListener);
-
-ossimHistogramWriter::ossimHistogramWriter(ossimImageSource* inputSource,
-                                           ossimObject* owner)
-   : ossimOutputSource(owner,
-                       1,
-                       0,
-                       true,
-                       false),
-     theAreaOfInterest(),
-     theFilename(),
-     theFileStream(0),
-     theProcessListener(0),
-     theHistogramSource(0)
-{
-   theProcessListener = new ossimHistogramWriterProcessListener(this);
-   
-   theAreaOfInterest.makeNan();
-   connectMyInputTo(0, inputSource);
-}
-
-ossimHistogramWriter::~ossimHistogramWriter()
-{
-   if(isOpen())
-   {
-      close();
-   }
-   if(theProcessListener)
-   {
-      delete theProcessListener;
-      theProcessListener = 0;
-   }
-
-   // This does not need to be deleted here.  Simply stored for abort.
-   if (theHistogramSource)
-   {
-      theHistogramSource = 0;
-   }
-}
-
-void ossimHistogramWriter::setAreaOfInterest(const ossimIrect& rect)
-{
-   theAreaOfInterest = rect;
-}
-
-ossimObject* ossimHistogramWriter::getObject()
-{
-   return this;
-}
-
-bool ossimHistogramWriter::isOpen()const
-{
-   return (theFileStream != 0);
-}
-
-bool ossimHistogramWriter::open()
-{
-   if(isOpen())
-   {
-      close();
-   }
-   
-   theFileStream = new std::ofstream(theFilename.c_str());
-   
-   return theFileStream->good();
-}
-
-bool ossimHistogramWriter::open(const ossimFilename& filename)
-{
-   return ossimOutputSource::open(filename);
-}
-
-void ossimHistogramWriter::close()
-{
-   delete theFileStream;
-   theFileStream = 0;
-}
-
-void ossimHistogramWriter::setOutputName(const ossimString& outputName)
-{
-   ossimOutputSource::setOutputName(outputName);
-   setFilename(outputName);
-}
-
-void ossimHistogramWriter::setFilename(const ossimFilename& filename)
-{
-   theFilename = filename;
-}
-   
-bool ossimHistogramWriter::canConnectMyInputTo(
-   ossim_int32 inputIndex, const ossimConnectableObject* object)const
-{
-   return (object&&(inputIndex == 0)&& 
-           (PTR_CAST(ossimHistogramSource, object)||
-            PTR_CAST(ossimImageSource, object)));
-}
-
-const ossimObject* ossimHistogramWriter::getObject()const
-{
-   return this;
-}
-
-void ossimHistogramWriter::processProgressEvent(
-   ossimProcessProgressEvent& event)
-{
-   // we will raise the event if its coming from our
-   // input.  This means that we are connected to a
-   // ossimHistogramSource.
-   //
-   if(event.getObject() != this)
-   {
-      ossimProcessInterface::setCurrentMessage(event.getMessage());
-      setPercentComplete(event.getPercentComplete());
-   }
-}
-
-void ossimHistogramWriter::connectInputEvent(
-   ossimConnectionEvent& event)
-{
-   if(event.getObject() == this)
-   {
-      if(event.getOldObject())
-      {
-         event.getOldObject()->removeListener((ossimProcessListener*)this);
-      }
-      if(getInput(0)&&
-         PTR_CAST(ossimHistogramSource, getInput(0)))
-      {
-         getInput(0)->addListener( (ossimProcessListener*)this);
-      }
-   }
-}
-
-void ossimHistogramWriter::disconnectInputEvent(
-   ossimConnectionEvent& event)
-{
-   if(event.getOldObject()&&
-      PTR_CAST(ossimHistogramSource, getInput(0)))
-   {
-      event.getOldObject()->removeListener((ossimProcessListener*)this);
-   }
-}
-
-bool ossimHistogramWriter::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix)const
-{
-   bool result = ossimOutputSource::saveState(kwl, prefix);
-
-
-   return result;
-}
-
-bool ossimHistogramWriter::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   bool result = ossimOutputSource::loadState(kwl, prefix);
-
-   if(result)
-   {
-      if(!getNumberOfInputs())
-      {
-         setNumberOfInputs(1);
-      }
-   }
-
-   return result;
-}
-
-bool ossimHistogramWriter::execute()
-{
-   writeHistogram();
-   
-   return true;
-}
-
-void ossimHistogramWriter::writeHistogram()
-{
-   if(!getInput(0))
-   {
-      cerr << "ossimHistogramWriter::writeHistogram is not connected" << endl;
-      return;
-   }
-   ossimHistogramSource* histoSource = PTR_CAST(ossimHistogramSource, getInput(0));
-   bool deleteHistoSource = false;
-   if(!histoSource)
-   {
-      histoSource = new ossimImageHistogramSource;
-      histoSource->connectMyInputTo(0, getInput(0));
-      histoSource->enableSource();
-      deleteHistoSource = true;
-
-      //---
-      // Capture the pointer for abort call.  Note a ossimHistogramSource has
-      // no abort so the abort will only work through the
-      // ossimImageHistogramSource pointer.
-      //---
-      theHistogramSource = (ossimImageHistogramSource*)histoSource;
-   }
-
-   // Capture the pointer for abort call.
-   theHistogramSource = histoSource;
-   
-   histoSource->addListener( theProcessListener);
-   
-   ossimRefPtr<ossimMultiResLevelHistogram> histo = histoSource->getHistogram();
-
-   // Don't write histogram if abort flag was set...
-   if(histo.valid() && !isAborted() )
-   {
-      ossimKeywordlist kwl;
-      histo->saveState(kwl);
-      if(!isOpen())
-      {
-         open();
-         if(!isOpen())
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN) << "unable to open file " << theFilename << endl;
-            }
-         }
-      }
-      if( isOpen() )
-      {
-         kwl.writeToStream(*theFileStream);
-      }
-   }
-   histoSource->removeListener(theProcessListener);
-   
-   if(deleteHistoSource)
-   {
-      delete histoSource;
-      histoSource = 0;
-   }
-   theHistogramSource = 0;
-   
-   close();
-}
-
-void ossimHistogramWriter::abort()
-{
-   //---
-   // Call base abort. This sets the status to PROCESS_STATUS_ABORT_REQUEST so the processor
-   // knows to abort.
-   //---
-   ossimProcessInterface::abort();
-
-   // Propagate to histo source.
-   if (theHistogramSource)
-   {
-      ossimImageHistogramSource* histoSource =
-         PTR_CAST(ossimImageHistogramSource, theHistogramSource);
-      if (histoSource)
-      {
-         histoSource->abort();
-      }
-   }
-
-   //---
-   // Now set status to "ABORTED" so ossimProcessInterface::isAborted returns true so the
-   // writeHistogram method doesn't write the file if the process was aborted.
-   //---
-   setProcessStatus(PROCESS_STATUS_ABORTED);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimHsiRemapper.cpp b/ossim/src/ossim/imaging/ossimHsiRemapper.cpp
deleted file mode 100644
index 9387a24..0000000
--- a/ossim/src/ossim/imaging/ossimHsiRemapper.cpp
+++ /dev/null
@@ -1,3193 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Remapper to adjust hue, saturation and intensity.
-//
-//*************************************************************************
-// $Id: ossimHsiRemapper.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <ossim/imaging/ossimHsiRemapper.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNormRgbVector.h>
-#include <ossim/base/ossimHsiVector.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimNumericProperty.h>
-
-RTTI_DEF1(ossimHsiRemapper, "ossimHsiRemapper", ossimImageSourceFilter)
-
-static ossimTrace traceDebug("ossimHsiRemapper:debug");
-
-//***
-// State keywords:
-//***
-static const char MASTER_HUE_OFFSET_KW[] = "hsi_master_hue_offset";
-static const char MASTER_SATURATION_OFFSET_KW[] = "hsi_master_saturation_offset";
-static const char MASTER_INTENSITY_OFFSET_KW[] = "hsi_master_intensity_offset";
-static const char MASTER_INTENSITY_LOW_CLIP_KW[] = "hsi_master_intensity_low_clip";
-static const char MASTER_INTENSITY_HIGH_CLIP_KW[] = "hsi_master_intensity_high_clip";
-
-static const char RED_HUE_OFFSET_KW[] = "hsi_red_hue_offset";
-static const char RED_HUE_LOW_RANGE_KW[] = "hsi_red_hue_low_range";
-static const char RED_HUE_HIGH_RANGE_KW[] = "hsi_red_hue_high_range";
-static const char RED_HUE_BLEND_RANGE_KW[] = "hsi_red_hue_blend_range";
-static const char RED_SATURATION_OFFSET_KW[] = "hsi_red_saturation_offset";
-static const char RED_INTENSITY_OFFSET_KW[] = "hsi_red_intensity_offset";
-
-static const char YELLOW_HUE_OFFSET_KW[] = "hsi_yellow_hue_offset";
-static const char YELLOW_HUE_LOW_RANGE_KW[] = "hsi_yellow_hue_low_range";
-static const char YELLOW_HUE_HIGH_RANGE_KW[] = "hsi_yellow_hue_high_range";
-static const char YELLOW_HUE_BLEND_RANGE_KW[] = "hsi_yellow_hue_blend_range";
-static const char YELLOW_SATURATION_OFFSET_KW[] = "hsi_yellow_saturation_offset";
-static const char YELLOW_INTENSITY_OFFSET_KW[] = "hsi_yellow_intensity_offset";
-
-static const char GREEN_HUE_OFFSET_KW[] = "hsi_green_hue_offset";
-static const char GREEN_HUE_LOW_RANGE_KW[] = "hsi_green_hue_low_range";
-static const char GREEN_HUE_HIGH_RANGE_KW[] = "hsi_green_hue_high_range";
-static const char GREEN_HUE_BLEND_RANGE_KW[] = "hsi_green_hue_blend_range";
-static const char GREEN_SATURATION_OFFSET_KW[] = "hsi_green_saturation_offset";
-static const char GREEN_INTENSITY_OFFSET_KW[] = "hsi_green_intensity_offset";
-
-static const char CYAN_HUE_OFFSET_KW[] = "hsi_cyan_hue_offset";
-static const char CYAN_HUE_LOW_RANGE_KW[] = "hsi_cyan_hue_low_range";
-static const char CYAN_HUE_HIGH_RANGE_KW[] = "hsi_cyan_hue_high_range";
-static const char CYAN_HUE_BLEND_RANGE_KW[] = "hsi_cyan_hue_blend_range";
-static const char CYAN_SATURATION_OFFSET_KW[] = "hsi_cyan_saturation_offset";
-static const char CYAN_INTENSITY_OFFSET_KW[] = "hsi_cyan_intensity_offset";
-
-static const char BLUE_HUE_OFFSET_KW[] = "hsi_blue_hue_offset";
-static const char BLUE_HUE_LOW_RANGE_KW[] = "hsi_blue_hue_low_range";
-static const char BLUE_HUE_HIGH_RANGE_KW[] = "hsi_blue_hue_high_range";
-static const char BLUE_HUE_BLEND_RANGE_KW[] = "hsi_blue_hue_blend_range";
-static const char BLUE_SATURATION_OFFSET_KW[] = "hsi_blue_saturation_offset";
-static const char BLUE_INTENSITY_OFFSET_KW[] = "hsi_blue_intensity_offset";
-
-static const char MAGENTA_HUE_OFFSET_KW[] = "hsi_magenta_hue_offset";
-static const char MAGENTA_HUE_LOW_RANGE_KW[] = "hsi_magenta_hue_low_range";
-static const char MAGENTA_HUE_HIGH_RANGE_KW[] = "hsi_magenta_hue_high_range";
-static const char MAGENTA_HUE_BLEND_RANGE_KW[] = "hsi_magenta_hue_blend_range";
-static const char MAGENTA_SATURATION_OFFSET_KW[] = "hsi_magenta_saturation_offset";
-static const char MAGENTA_INTENSITY_OFFSET_KW[] = "hsi_magenta_intensity_offset";
-
-static const char WHITE_OBJECT_CLIP_KW[] = "hsi_white_object_clip";
-
-static const double DEFAULT_BLEND = 15.0;
-static const double MAX_BLEND     = 30.0;
-
-ossimHsiRemapper::ossimHsiRemapper()
-   :
-      ossimImageSourceFilter      (),  // base class
-      
-      theTile                     (NULL),
-      theBuffer                   (NULL),
-      theNormalizedMinPix         (0.0),
-
-      theMasterHueOffset          (0.0),
-      theMasterSaturationOffset   (0.0),
-      theMasterIntensityOffset    (0.0),
-      theMasterIntensityLowClip   (0.0),
-      theMasterIntensityHighClip  (1.0),
-      
-      theRedHueOffset             (0.0),
-      theRedHueLowRange           (-30.0),
-      theRedHueHighRange          (30.0),
-      theRedHueBlendRange         (DEFAULT_BLEND),
-      theRedSaturationOffset      (0.0),
-      theRedIntensityOffset       (0.0),
-      
-      theYellowHueOffset          (0.0),
-      theYellowHueLowRange        (30.0),
-      theYellowHueHighRange       (90.0),
-      theYellowHueBlendRange      (DEFAULT_BLEND),
-      theYellowSaturationOffset   (0.0),
-      theYellowIntensityOffset    (0.0),
-      
-      theGreenHueOffset           (0.0),
-      theGreenHueLowRange         (90.0),
-      theGreenHueHighRange        (150.0),
-      theGreenHueBlendRange       (DEFAULT_BLEND),
-      theGreenSaturationOffset    (0.0),
-      theGreenIntensityOffset     (0.0),
-      
-      theCyanHueOffset            (0.0),
-      theCyanHueLowRange          (150.0),
-      theCyanHueHighRange         (210.0),
-      theCyanHueBlendRange        (DEFAULT_BLEND),
-      theCyanSaturationOffset     (0.0),
-      theCyanIntensityOffset      (0.0),
-      
-      theBlueHueOffset            (0.0),
-      theBlueHueLowRange          (210.0),
-      theBlueHueHighRange         (270.0),
-      theBlueHueBlendRange        (DEFAULT_BLEND),
-      theBlueSaturationOffset     (0.0),
-      theBlueIntensityOffset      (0.0),
-      
-      theMagentaHueOffset         (0.0),
-      theMagentaHueLowRange       (270.0),
-      theMagentaHueHighRange      (330.0),
-      theMagentaHueBlendRange     (DEFAULT_BLEND),
-      theMagentaSaturationOffset  (0.0),
-      theMagentaIntensityOffset   (0.0),
-
-      theWhiteObjectClip          (1.0)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   //disableSource();
-   theValidFlag = false;
-   // Construction not complete.
-}
-
-ossimHsiRemapper::~ossimHsiRemapper()
-{
-   theTile = NULL;
-   if (theBuffer)
-   {
-      delete [] theBuffer;
-      theBuffer = NULL;
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimHsiRemapper::getTile(
-   const ossimIrect& tile_rect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   // Fetch tile from pointer from the input source.
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(
-      tile_rect, resLevel);
-
-   // Check for remap bypass or a null tile return from input:
-   if (!isSourceEnabled() || !inputTile||!theValidFlag)
-   {
-      return inputTile;
-   }
-
-   // Check for first time through or size change.
-   if ( !theTile.valid() ||  
-        tile_rect.height() != theTile->getHeight() ||
-        tile_rect.width()  != theTile->getWidth() )
-   {
-      allocate(tile_rect);
-   }
-
-   //---
-   // Set the image rectangle of the tile.
-   // Note that this will resize the tiles buffers if 
-   theTile->setImageRectangle(tile_rect);
-
-   // Get its status.
-   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
-   if ( (tile_status == OSSIM_NULL) || (tile_status == OSSIM_EMPTY) )
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   double* rgbBuf[3];
-   const ossim_uint32 PPT = theTile->getSizePerBand();  // Pixels Per Tile
-
-   rgbBuf[0] = theBuffer;
-   rgbBuf[1] = &(theBuffer[PPT]);
-   rgbBuf[2] = &(rgbBuf[1][PPT]);
-   
-   switch(inputTile->getNumberOfBands())
-   {
-      case 1:
-      case 2:
-      {
-         // Copy the first band only.
-         inputTile->copyTileBandToNormalizedBuffer(0, rgbBuf[0]);
-         memcpy(rgbBuf[1], rgbBuf[0], PPT*sizeof(double));
-         memcpy(rgbBuf[2], rgbBuf[0], PPT*sizeof(double));
-	 break;
-      }
-      case 3:
-      {
-         inputTile->copyTileToNormalizedBuffer(theBuffer);
-         break;
-      }
-      default:
-      {
-         inputTile->copyTileBandToNormalizedBuffer(0, rgbBuf[0]);
-         inputTile->copyTileBandToNormalizedBuffer(1, rgbBuf[1]);
-         inputTile->copyTileBandToNormalizedBuffer(2, rgbBuf[2]);
-	 break;
-      }
-   }   
-
-   ossimNormRgbVector rgb;
-   ossimHsiVector     hsi;
-   double r = 0.0;
-   double g = 0.0;
-   double b = 0.0;
-   double h = 0.0;
-   double s = 0.0;
-   double i = 0.0;
-   ossim_uint32 idx;
-   // Convert the rgb value to hsi and adjust values.
-   for (idx=0; idx<PPT; ++idx)
-   {
-      r = rgbBuf[0][idx];
-      g = rgbBuf[1][idx];
-      b = rgbBuf[2][idx];
-      
-      rgb = ossimNormRgbVector(r,g,b);
-      hsi = rgb;
-
-      h   = hsi.getH();
-      s   = hsi.getS();
-      i   = hsi.getI();
-      
-      if(i > FLT_EPSILON)
-      {
-         double h_offset = theMasterHueOffset;
-         double s_offset = theMasterSaturationOffset;
-         double i_offset = theMasterIntensityOffset;
-
-         //***
-         // Note:  For the purpose of checking to see if in the red range,
-         //        make the hue negative if it's >= 315.0 and < 360.0.
-         //        The red low and high ranges are stored in the same manner.
-         //***
-         double red_hue  = h;
-         if (red_hue  >= 315.0 && red_hue  < 360.0) red_hue  = red_hue - 360.0;
-                          
-         if ( red_hue >= theRedHueLowRange && red_hue <= theRedHueHighRange)
-         {
-            // Adjust the reds.
-            
-            double bf = 1.0; // blend factor
-            if ( red_hue < (theRedHueLowRange + theRedHueBlendRange) )
-            {
-               bf = (red_hue - theRedHueLowRange) / theRedHueBlendRange;
-            }
-            else if ( red_hue > (theRedHueHighRange - theRedHueBlendRange) )
-            {
-               bf = (theRedHueHighRange - red_hue) / theRedHueBlendRange;
-            }
-            
-            h_offset += (theRedHueOffset        * bf);
-            s_offset += (theRedSaturationOffset * bf);
-            i_offset += (theRedIntensityOffset  * bf);
-         }
-            
-         if (h >= theYellowHueLowRange && h <= theYellowHueHighRange) 
-         {
-            // Adjust the yellows.
-            
-            double bf = 1.0; // blend factor
-            if ( h < (theYellowHueLowRange + theYellowHueBlendRange) )
-            {
-               bf = (h - theYellowHueLowRange) / theYellowHueBlendRange;
-            }
-            else if ( h > (theYellowHueHighRange - theYellowHueBlendRange) )
-            {
-               bf = (theYellowHueHighRange - h) / theYellowHueBlendRange;
-            }
-            
-            h_offset += (theYellowHueOffset        * bf);
-            s_offset += (theYellowSaturationOffset * bf);
-            i_offset += (theYellowIntensityOffset  * bf);
-         }
-         
-         if (h >= theGreenHueLowRange && h <= theGreenHueHighRange) 
-         {
-            // Adjust the greens. 
-
-            double bf = 1.0; // blend factor
-            if ( h < (theGreenHueLowRange + theGreenHueBlendRange) )
-            {
-               bf = (h - theGreenHueLowRange) / theGreenHueBlendRange;
-            }
-            else if ( h > (theGreenHueHighRange - theGreenHueBlendRange) )
-            {
-               bf = (theGreenHueHighRange - h) / theGreenHueBlendRange;
-            }
-            
-            h_offset += (theGreenHueOffset        * bf);
-            s_offset += (theGreenSaturationOffset * bf);
-            i_offset += (theGreenIntensityOffset  * bf);
-         }
-
-         if (h >= theCyanHueLowRange && h <= theCyanHueHighRange) 
-         {
-            // Adjust the cyans.
-            
-            double bf = 1.0; // blend factor
-            if ( h < (theCyanHueLowRange + theCyanHueBlendRange) )
-            {
-               bf = (h - theCyanHueLowRange) / theCyanHueBlendRange;
-            }
-            else if ( h > (theCyanHueHighRange - theCyanHueBlendRange) )
-            {
-               bf = (theCyanHueHighRange - h) / theCyanHueBlendRange;
-            }
-            
-            h_offset += (theCyanHueOffset        * bf);
-            s_offset += (theCyanSaturationOffset * bf);
-            i_offset += (theCyanIntensityOffset  * bf);
-         }
-
-         if (h >= theBlueHueLowRange && h <= theBlueHueHighRange) 
-         {
-            // Adjust the blues.
-            
-            double bf = 1.0; // blend factor
-            if ( h < (theBlueHueLowRange + theBlueHueBlendRange) )
-            {
-               bf = (h - theBlueHueLowRange) / theBlueHueBlendRange;
-            }
-            else if ( h > (theBlueHueHighRange - theBlueHueBlendRange) )
-            {
-               bf = (theBlueHueHighRange - h) / theBlueHueBlendRange;
-            }
-            
-            h_offset += (theBlueHueOffset        * bf);
-            s_offset += (theBlueSaturationOffset * bf);
-            i_offset += (theBlueIntensityOffset  * bf);
-         }
-
-         if (h >= theMagentaHueLowRange && h <= theMagentaHueHighRange) 
-         {
-            // Adjust the magentas.
-            
-            double bf = 1.0; // blend factor
-            if ( h < (theMagentaHueLowRange + theMagentaHueBlendRange) )
-            {
-               bf = (h - theMagentaHueLowRange) / theMagentaHueBlendRange;
-            }
-            else if ( h > (theMagentaHueHighRange - theMagentaHueBlendRange) )
-            {
-               bf = (theMagentaHueHighRange - h) / theMagentaHueBlendRange;
-            }
-            
-            h_offset += (theMagentaHueOffset        * bf);
-            s_offset += (theMagentaSaturationOffset * bf);
-            i_offset += (theMagentaIntensityOffset  * bf);
-         }
-         
-         // Apply the hue offset.
-         h += h_offset;
-
-         // Make sure the hue is between 0 and 360...
-         if (h < 0.0) h += 360.0;
-         else if (h >= 360) h -= 360.0;
-
-         // Apply the saturation offset clamping/clipping to 0.0/1.0.
-         s += s_offset;
-         s = (s > 0.0 ? (s < 1.0 ? s : 1.0) : 0.0);
-         
-         // Apply the intensity offset clamping/clipping to 0.0/1.0.
-         i += i_offset;
-         i = (i > 0.0 ? (i < 1.0 ? i : 1.0) : 0.0);
-
-         // Stretch the intensity channel.
-//          i = (i - theMasterIntensityLowClip) *
-//              ( 1.0 / (theMasterIntensityHighClip -
-//                       theMasterIntensityLowClip) );
-         i = (i - theMasterIntensityLowClip)/(theMasterIntensityHighClip -
-                                              theMasterIntensityLowClip);
-         
-         hsi.setH(h);
-         hsi.setS(s);
-         hsi.setI(i);
-
-         rgb = hsi;
-         
-         r = rgb.getR();
-         g = rgb.getG();
-         b = rgb.getB();
-         if ( (theWhiteObjectClip < 1.0) &&
-              (r > theWhiteObjectClip)   &&
-              (g > theWhiteObjectClip)   &&
-              (b > theWhiteObjectClip) )
-         {
-            r = theWhiteObjectClip;
-            g = theWhiteObjectClip;
-            b = theWhiteObjectClip;
-         }
-         // Do min/max range check and assign back to buffer.
-         rgbBuf[0][idx] = r > theNormalizedMinPix ? (r < 1.0 ? r : 1.0) :
-            theNormalizedMinPix;
-         rgbBuf[1][idx] = g > theNormalizedMinPix ? (g < 1.0 ? g : 1.0) :
-            theNormalizedMinPix;
-         rgbBuf[2][idx] = b > theNormalizedMinPix ? (b < 1.0 ? b : 1.0) :
-            theNormalizedMinPix;
-      } // End of "if(i > FLT_EPSILON)"
-      else
-      {
-         rgbBuf[0][idx] = 0.0;
-         rgbBuf[1][idx] = 0.0;
-         rgbBuf[2][idx] = 0.0;
-      }
-         
-   }  // End of loop through pixels in a tile.
-   // Copy the buffer to the output tile.
-   theTile->copyNormalizedBufferToTile(theBuffer);
-   
-   // Update the tile status.
-   theTile->validate();
-
-   return theTile;
-}
-
-void ossimHsiRemapper::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   if (theTile.valid())
-   {
-      theTile = NULL;
-      if(theBuffer)
-      {
-         delete []theBuffer;
-         theBuffer = NULL;
-      }
-   }
-}
-
-void ossimHsiRemapper::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid()) return;
-   ossimString name = property->getName();
-   if(name == MASTER_HUE_OFFSET_KW)
-   {
-      setMasterHueOffset(property->valueToString().toDouble());
-   }
-   else if(name == MASTER_SATURATION_OFFSET_KW)
-   {
-      setMasterSaturationOffset(property->valueToString().toDouble());
-   }
-   else if(name == MASTER_INTENSITY_OFFSET_KW)
-   {
-      setMasterIntensityOffset(property->valueToString().toDouble());
-   }
-   else if(name == MASTER_INTENSITY_LOW_CLIP_KW)
-   {
-      setMasterIntensityLowClip(property->valueToString().toDouble());
-   }
-   else if(name == MASTER_INTENSITY_HIGH_CLIP_KW)
-   {
-      setMasterIntensityHighClip(property->valueToString().toDouble());
-   }
-   else if(name == RED_HUE_OFFSET_KW)
-   {
-      setRedHueOffset(property->valueToString().toDouble());
-   }
-   else if(name == RED_HUE_LOW_RANGE_KW)
-   {
-      setRedHueLowRange(property->valueToString().toDouble());
-   }
-   else if(name == RED_HUE_HIGH_RANGE_KW)
-   {
-      setRedHueHighRange(property->valueToString().toDouble());
-   }
-   else if(name == RED_HUE_BLEND_RANGE_KW)
-   {
-      setRedHueBlendRange(property->valueToString().toDouble());
-   }
-   else if(name == RED_SATURATION_OFFSET_KW)
-   {
-      setRedSaturationOffset(property->valueToString().toDouble());
-   }
-   else if(name == RED_INTENSITY_OFFSET_KW)
-   {
-      setRedIntensityOffset(property->valueToString().toDouble());
-  }
-   else if(name == YELLOW_HUE_OFFSET_KW)
-   {
-      setYellowHueOffset(property->valueToString().toDouble());
-   }
-   else if(name == YELLOW_HUE_LOW_RANGE_KW)
-   {
-      setYellowHueLowRange(property->valueToString().toDouble());
-   }
-   else if(name == YELLOW_HUE_HIGH_RANGE_KW)
-   {
-      setYellowHueHighRange(property->valueToString().toDouble());
-   }
-   else if(name == YELLOW_HUE_BLEND_RANGE_KW)
-   {
-      setYellowHueBlendRange(property->valueToString().toDouble());
-   }
-   else if(name == YELLOW_SATURATION_OFFSET_KW)
-   {
-      setYellowSaturationOffset(property->valueToString().toDouble());
-   }
-   else if(name == YELLOW_INTENSITY_OFFSET_KW)
-   {
-      setYellowIntensityOffset(property->valueToString().toDouble());
-   }
-   else if(name == GREEN_HUE_OFFSET_KW)
-   {
-      setGreenHueOffset(property->valueToString().toDouble());
-   }
-   else if(name == GREEN_HUE_LOW_RANGE_KW)
-   {
-      setGreenHueLowRange(property->valueToString().toDouble());
-   }
-   else if(name == GREEN_HUE_HIGH_RANGE_KW)
-   {
-      setGreenHueHighRange(property->valueToString().toDouble());
-   }
-   else if(name == GREEN_HUE_BLEND_RANGE_KW)
-   {
-      setGreenHueBlendRange(property->valueToString().toDouble());
-   }
-   else if(name == GREEN_SATURATION_OFFSET_KW)
-   {
-      setGreenSaturationOffset(property->valueToString().toDouble());
-   }
-   else if(name == GREEN_INTENSITY_OFFSET_KW)
-   {
-      setGreenIntensityOffset(property->valueToString().toDouble());
-   }
-   else if(name == CYAN_HUE_OFFSET_KW)
-   {
-      setCyanHueOffset(property->valueToString().toDouble());
-   }
-   else if(name == CYAN_HUE_LOW_RANGE_KW)
-   {
-      setCyanHueLowRange(property->valueToString().toDouble());
-   }
-   else if(name == CYAN_HUE_HIGH_RANGE_KW)
-   {
-      setCyanHueHighRange(property->valueToString().toDouble());
-   }
-   else if(name == CYAN_HUE_BLEND_RANGE_KW)
-   {
-      setCyanHueBlendRange(property->valueToString().toDouble());
-   }
-   else if(name == CYAN_SATURATION_OFFSET_KW)
-   {
-      setCyanSaturationOffset(property->valueToString().toDouble());
-   }
-   else if(name == CYAN_INTENSITY_OFFSET_KW)
-   {
-      setCyanIntensityOffset(property->valueToString().toDouble());
-   }
-   else if(name == BLUE_HUE_OFFSET_KW)
-   {
-      setBlueHueOffset(property->valueToString().toDouble());
-   }
-   else if(name == BLUE_HUE_LOW_RANGE_KW)
-   {
-      setBlueHueLowRange(property->valueToString().toDouble());
-   }
-   else if(name == BLUE_HUE_HIGH_RANGE_KW)
-   {
-      setBlueHueHighRange(property->valueToString().toDouble());
-   }
-   else if(name == BLUE_HUE_BLEND_RANGE_KW)
-   {
-      setBlueHueBlendRange(property->valueToString().toDouble());
-   }
-   else if(name == BLUE_SATURATION_OFFSET_KW)
-   {
-      setBlueSaturationOffset(property->valueToString().toDouble());
-   }
-   else if(name == BLUE_INTENSITY_OFFSET_KW)
-   {
-      setBlueIntensityOffset(property->valueToString().toDouble());
-   }
-   else if(name == MAGENTA_HUE_OFFSET_KW)
-   {
-      setMagentaHueOffset(property->valueToString().toDouble());
-   }
-   else if(name == MAGENTA_HUE_LOW_RANGE_KW)
-   {
-      setMagentaHueLowRange(property->valueToString().toDouble());
-   }
-   else if(name == MAGENTA_HUE_HIGH_RANGE_KW)
-   {
-      setMagentaHueHighRange(property->valueToString().toDouble());
-   }
-   else if(name == MAGENTA_HUE_BLEND_RANGE_KW)
-   {
-      setMagentaHueBlendRange(property->valueToString().toDouble());
-   }
-   else if(name == MAGENTA_SATURATION_OFFSET_KW)
-   {
-      setMagentaSaturationOffset(property->valueToString().toDouble());
-   }
-   else if(name == MAGENTA_INTENSITY_OFFSET_KW)
-   {
-      setMagentaIntensityOffset(property->valueToString().toDouble());
-   }
-   else if(name == WHITE_OBJECT_CLIP_KW)
-   {
-      setWhiteObjectClip(property->valueToString().toDouble());
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimHsiRemapper::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result;
-   if(name == MASTER_HUE_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMasterHueOffset), -180, 180);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MASTER_SATURATION_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMasterSaturationOffset), -1, 1);
-      result->setCacheRefreshBit();
-  }
-   else if(name == MASTER_INTENSITY_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMasterIntensityOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MASTER_INTENSITY_LOW_CLIP_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMasterIntensityLowClip), 0, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MASTER_INTENSITY_HIGH_CLIP_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMasterIntensityHighClip), 0, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == RED_HUE_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theRedHueOffset), -180, 180);
-      result->setCacheRefreshBit();
-   }
-   else if(name == RED_HUE_LOW_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theRedHueLowRange), -30, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == RED_HUE_HIGH_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theRedHueHighRange), -30, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == RED_HUE_BLEND_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theRedHueBlendRange), 0, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == RED_SATURATION_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theRedSaturationOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == RED_INTENSITY_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theRedIntensityOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == YELLOW_HUE_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueOffset), -180, 180);
-      result->setCacheRefreshBit();
-   }
-   else if(name == YELLOW_HUE_LOW_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueLowRange), 30, 90);
-      result->setCacheRefreshBit();
-   }
-   else if(name == YELLOW_HUE_HIGH_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueHighRange), 30, 90);
-      result->setCacheRefreshBit();
-   }
-   else if(name == YELLOW_HUE_BLEND_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueBlendRange), 0, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == YELLOW_SATURATION_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theYellowSaturationOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == YELLOW_INTENSITY_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theYellowIntensityOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == GREEN_HUE_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueOffset), -180, 180);
-      result->setCacheRefreshBit();
-   }
-   else if(name == GREEN_HUE_LOW_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueLowRange), 90, 150);
-      result->setCacheRefreshBit();
-   }
-   else if(name == GREEN_HUE_HIGH_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueHighRange), 90, 150);
-      result->setCacheRefreshBit();
-   }
-   else if(name == GREEN_HUE_BLEND_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueBlendRange), 0, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == GREEN_SATURATION_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theGreenSaturationOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == GREEN_INTENSITY_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theGreenIntensityOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == CYAN_HUE_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueOffset), -180, 180);
-      result->setCacheRefreshBit();
-   }
-   else if(name == CYAN_HUE_LOW_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueLowRange), 150, 210);
-      result->setCacheRefreshBit();
-   }
-   else if(name == CYAN_HUE_HIGH_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueHighRange), 150, 210);
-      result->setCacheRefreshBit();
-   }
-   else if(name == CYAN_HUE_BLEND_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueBlendRange), 0, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == CYAN_SATURATION_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theCyanSaturationOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == CYAN_INTENSITY_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theCyanIntensityOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == BLUE_HUE_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueOffset), -180, 180);
-      result->setCacheRefreshBit();
-   }
-   else if(name == BLUE_HUE_LOW_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueLowRange), 210, 270);
-      result->setCacheRefreshBit();
-   }
-   else if(name == BLUE_HUE_HIGH_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueHighRange), 210, 270);
-      result->setCacheRefreshBit();
-   }
-   else if(name == BLUE_HUE_BLEND_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueBlendRange), 0, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == BLUE_SATURATION_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theBlueSaturationOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == BLUE_INTENSITY_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theBlueIntensityOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MAGENTA_HUE_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueOffset), -180, 180);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MAGENTA_HUE_LOW_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueLowRange), 270, 330);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MAGENTA_HUE_HIGH_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueHighRange), 270, 330);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MAGENTA_HUE_BLEND_RANGE_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueBlendRange), 0, 30);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MAGENTA_SATURATION_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMagentaSaturationOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == MAGENTA_INTENSITY_OFFSET_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theMagentaIntensityOffset), -1, 1);
-      result->setCacheRefreshBit();
-   }
-   else if(name == WHITE_OBJECT_CLIP_KW)
-   {
-      result = new ossimNumericProperty(name, ossimString::toString(theWhiteObjectClip), 0.8, 1.0);
-      result->setCacheRefreshBit();
-   }
-   else
-   {
-     result = ossimImageSourceFilter::getProperty(name);
-   }
-   
-   return result;
-}
-
-void ossimHsiRemapper::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back(MASTER_HUE_OFFSET_KW);
-   propertyNames.push_back(MASTER_SATURATION_OFFSET_KW);
-   propertyNames.push_back(MASTER_INTENSITY_OFFSET_KW);
-   propertyNames.push_back(MASTER_INTENSITY_LOW_CLIP_KW);
-   propertyNames.push_back(MASTER_INTENSITY_HIGH_CLIP_KW);
-   propertyNames.push_back(RED_HUE_OFFSET_KW);
-   propertyNames.push_back(RED_HUE_LOW_RANGE_KW);
-   propertyNames.push_back(RED_HUE_HIGH_RANGE_KW);
-   propertyNames.push_back(RED_HUE_BLEND_RANGE_KW);
-   propertyNames.push_back(RED_SATURATION_OFFSET_KW);
-   propertyNames.push_back(RED_INTENSITY_OFFSET_KW);
-   propertyNames.push_back(YELLOW_HUE_OFFSET_KW);
-   propertyNames.push_back(YELLOW_HUE_LOW_RANGE_KW);
-   propertyNames.push_back(YELLOW_HUE_HIGH_RANGE_KW);
-   propertyNames.push_back(YELLOW_HUE_BLEND_RANGE_KW);
-   propertyNames.push_back(YELLOW_SATURATION_OFFSET_KW);
-   propertyNames.push_back(YELLOW_INTENSITY_OFFSET_KW);
-   propertyNames.push_back(GREEN_HUE_OFFSET_KW);
-   propertyNames.push_back(GREEN_HUE_LOW_RANGE_KW);
-   propertyNames.push_back(GREEN_HUE_HIGH_RANGE_KW);
-   propertyNames.push_back(GREEN_HUE_BLEND_RANGE_KW);
-   propertyNames.push_back(GREEN_SATURATION_OFFSET_KW);
-   propertyNames.push_back(GREEN_INTENSITY_OFFSET_KW);
-   propertyNames.push_back(CYAN_HUE_OFFSET_KW);
-   propertyNames.push_back(CYAN_HUE_LOW_RANGE_KW);
-   propertyNames.push_back(CYAN_HUE_HIGH_RANGE_KW);
-   propertyNames.push_back(CYAN_HUE_BLEND_RANGE_KW);
-   propertyNames.push_back(CYAN_SATURATION_OFFSET_KW);
-   propertyNames.push_back(CYAN_INTENSITY_OFFSET_KW);
-   propertyNames.push_back(BLUE_HUE_OFFSET_KW);
-   propertyNames.push_back(BLUE_HUE_LOW_RANGE_KW);
-   propertyNames.push_back(BLUE_HUE_HIGH_RANGE_KW);
-   propertyNames.push_back(BLUE_HUE_BLEND_RANGE_KW);
-   propertyNames.push_back(BLUE_SATURATION_OFFSET_KW);
-   propertyNames.push_back(BLUE_INTENSITY_OFFSET_KW);
-   propertyNames.push_back(MAGENTA_HUE_OFFSET_KW);
-   propertyNames.push_back(MAGENTA_HUE_LOW_RANGE_KW);
-   propertyNames.push_back(MAGENTA_HUE_HIGH_RANGE_KW);
-   propertyNames.push_back(MAGENTA_HUE_BLEND_RANGE_KW);
-   propertyNames.push_back(MAGENTA_SATURATION_OFFSET_KW);
-   propertyNames.push_back(MAGENTA_INTENSITY_OFFSET_KW);
-   propertyNames.push_back(WHITE_OBJECT_CLIP_KW);
-}
-
-
-void ossimHsiRemapper::allocate(const ossimIrect& rect)
-{
-   
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,this);
-      theTile->initialize();
-
-      ossim_uint32 width  = rect.width();
-      ossim_uint32 height = rect.height();
-      if(theBuffer)
-      {
-         delete [] theBuffer;
-         theBuffer = 0;
-      }
-      ossim_uint32 size = width * height * 3; // Buffer always 3 bands.
-      theBuffer = new double[size];
-      memset(theBuffer, '\0', sizeof(double) * size);
-      
-      // Get the minimum normalized pixel value.
-      theNormalizedMinPix = calculateMinNormValue();
-   }
-}
-
-bool ossimHsiRemapper::loadState(const ossimKeywordlist& kwl,
-                                 const char* prefix)
-{
-   static const char MODULE[] = "ossimHsiRemapper::loadState()";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entering..." << endl;
-   }
-
-   // Make a prefix.
-   ossimString tmpPrefix;
-   if (prefix) tmpPrefix += prefix;
-   
-   const char* lookupReturn;
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_HUE_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setMasterHueOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_SATURATION_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setMasterSaturationOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setMasterIntensityOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_LOW_CLIP_KW);
-   if(lookupReturn)
-   {
-      setMasterIntensityLowClip(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_HIGH_CLIP_KW);
-   if(lookupReturn)
-   {
-      setMasterIntensityHighClip(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setRedHueOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_LOW_RANGE_KW);
-   if(lookupReturn)
-   {
-      setRedHueLowRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_HIGH_RANGE_KW);
-   if(lookupReturn)
-   {
-      setRedHueHighRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_BLEND_RANGE_KW);
-   if(lookupReturn)
-   {
-      setRedHueBlendRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_SATURATION_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setRedSaturationOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_INTENSITY_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setRedIntensityOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setYellowHueOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_LOW_RANGE_KW);
-   if(lookupReturn)
-   {
-      setYellowHueLowRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_HIGH_RANGE_KW);
-   if(lookupReturn)
-   {
-      setYellowHueHighRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_BLEND_RANGE_KW);
-   if(lookupReturn)
-   {
-      setYellowHueBlendRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_SATURATION_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setYellowSaturationOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_INTENSITY_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setYellowIntensityOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setGreenHueOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_LOW_RANGE_KW);
-   if(lookupReturn)
-   {
-      setGreenHueLowRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_HIGH_RANGE_KW);
-   if(lookupReturn)
-   {
-      setGreenHueHighRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_BLEND_RANGE_KW);
-   if(lookupReturn)
-   {
-      setGreenHueBlendRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_SATURATION_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setGreenSaturationOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_INTENSITY_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setGreenIntensityOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setCyanHueOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_LOW_RANGE_KW);
-   if(lookupReturn)
-   {
-      setCyanHueLowRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_HIGH_RANGE_KW);
-   if(lookupReturn)
-   {
-      setCyanHueHighRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_BLEND_RANGE_KW);
-   if(lookupReturn)
-   {
-      setCyanHueBlendRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_SATURATION_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setCyanSaturationOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_INTENSITY_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setCyanIntensityOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setBlueHueOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_LOW_RANGE_KW);
-   if(lookupReturn)
-   {
-      setBlueHueLowRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_HIGH_RANGE_KW);
-   if(lookupReturn)
-   {
-      setBlueHueHighRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_BLEND_RANGE_KW);
-   if(lookupReturn)
-   {
-      setBlueHueBlendRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_SATURATION_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setBlueSaturationOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_INTENSITY_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setBlueIntensityOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setMagentaHueOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_LOW_RANGE_KW);
-   if(lookupReturn)
-   {
-      setMagentaHueLowRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_HIGH_RANGE_KW);
-   if(lookupReturn)
-   {
-      setMagentaHueHighRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_BLEND_RANGE_KW);
-   if(lookupReturn)
-   {
-      setMagentaHueBlendRange(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_SATURATION_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setMagentaSaturationOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_INTENSITY_OFFSET_KW);
-   if(lookupReturn)
-   {
-      setMagentaIntensityOffset(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(tmpPrefix.c_str(), WHITE_OBJECT_CLIP_KW);
-   if(lookupReturn)
-   {
-      setWhiteObjectClip(atof(lookupReturn));
-   }
-
-   //***
-   // Initialize the base class.  Do this last so that the enable/disable
-   // doesn't get overridden by the "set*" methods.
-   //***
-   ossimImageSourceFilter::loadState(kwl, tmpPrefix.c_str());
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << ""
-         << *this
-         << "\nreturning..."
-         << endl;
-   }
-
-   return true;
-}
-
-bool ossimHsiRemapper::saveState(ossimKeywordlist& kwl,
-                                 const char* prefix) const
-{
-   static const char MODULE[] = "ossimHsiRemapper::saveStateTo()";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << "entering..." << endl;
-   }
-
-   // Call the base class getStateFrom.
-   ossimImageSourceFilter::saveState(kwl, prefix);
-
-   kwl.add(prefix, MASTER_HUE_OFFSET_KW, theMasterHueOffset);
-
-   kwl.add(prefix, MASTER_SATURATION_OFFSET_KW, theMasterSaturationOffset);
-
-   kwl.add(prefix, MASTER_INTENSITY_OFFSET_KW, theMasterIntensityOffset);
-
-   kwl.add(prefix, MASTER_INTENSITY_LOW_CLIP_KW, theMasterIntensityLowClip);
-
-   kwl.add(prefix, MASTER_INTENSITY_HIGH_CLIP_KW, theMasterIntensityHighClip);
-
-   kwl.add(prefix, RED_HUE_OFFSET_KW, theRedHueOffset);
-
-   kwl.add(prefix, RED_HUE_LOW_RANGE_KW, theRedHueLowRange);
-
-   kwl.add(prefix, RED_HUE_HIGH_RANGE_KW, theRedHueHighRange);
-
-   kwl.add(prefix, RED_HUE_BLEND_RANGE_KW, theRedHueBlendRange);
-
-   kwl.add(prefix, RED_SATURATION_OFFSET_KW, theRedSaturationOffset);
-           
-   kwl.add(prefix, RED_INTENSITY_OFFSET_KW, theRedIntensityOffset);
-
-   kwl.add(prefix, YELLOW_HUE_OFFSET_KW, theYellowHueOffset);
-
-   kwl.add(prefix, YELLOW_HUE_LOW_RANGE_KW, theYellowHueLowRange);
-
-   kwl.add(prefix, YELLOW_HUE_HIGH_RANGE_KW, theYellowHueHighRange);
-           
-   kwl.add(prefix, YELLOW_HUE_BLEND_RANGE_KW, theYellowHueBlendRange);
-
-   kwl.add(prefix, YELLOW_SATURATION_OFFSET_KW, theYellowSaturationOffset);
-
-   kwl.add(prefix, YELLOW_INTENSITY_OFFSET_KW, theYellowIntensityOffset);
-
-   kwl.add(prefix, GREEN_HUE_OFFSET_KW, theGreenHueOffset);
-
-   kwl.add(prefix, GREEN_HUE_LOW_RANGE_KW, theGreenHueLowRange);
-
-   kwl.add(prefix, GREEN_HUE_HIGH_RANGE_KW, theGreenHueHighRange);
-
-   kwl.add(prefix, GREEN_HUE_BLEND_RANGE_KW, theGreenHueBlendRange);
-           
-   kwl.add(prefix, GREEN_SATURATION_OFFSET_KW, theGreenSaturationOffset);
-           
-   kwl.add(prefix, GREEN_INTENSITY_OFFSET_KW, theGreenIntensityOffset);
-
-   kwl.add(prefix, CYAN_HUE_OFFSET_KW, theCyanHueOffset);
-
-   kwl.add(prefix, CYAN_HUE_LOW_RANGE_KW, theCyanHueLowRange);
-
-   kwl.add(prefix, CYAN_HUE_HIGH_RANGE_KW, theCyanHueHighRange);
-           
-   kwl.add(prefix, CYAN_HUE_BLEND_RANGE_KW, theCyanHueBlendRange);
-           
-   kwl.add(prefix, CYAN_SATURATION_OFFSET_KW, theCyanSaturationOffset);
-           
-   kwl.add(prefix, CYAN_INTENSITY_OFFSET_KW, theCyanIntensityOffset);
-
-   kwl.add(prefix, BLUE_HUE_OFFSET_KW, theBlueHueOffset);
-
-   kwl.add(prefix, BLUE_HUE_LOW_RANGE_KW, theBlueHueLowRange);
-
-   kwl.add(prefix, BLUE_HUE_HIGH_RANGE_KW, theBlueHueHighRange);
-
-   kwl.add(prefix, BLUE_HUE_BLEND_RANGE_KW, theBlueHueBlendRange);
-
-   kwl.add(prefix, BLUE_SATURATION_OFFSET_KW, theBlueSaturationOffset);
-           
-   kwl.add(prefix, BLUE_INTENSITY_OFFSET_KW, theBlueIntensityOffset);
-           
-   kwl.add(prefix, MAGENTA_HUE_OFFSET_KW, theMagentaHueOffset);
-           
-   kwl.add(prefix, MAGENTA_HUE_LOW_RANGE_KW, theMagentaHueLowRange);
-           
-   kwl.add(prefix, MAGENTA_HUE_HIGH_RANGE_KW, theMagentaHueHighRange);
-           
-   kwl.add(prefix, MAGENTA_HUE_BLEND_RANGE_KW, theMagentaHueBlendRange);
-           
-   kwl.add(prefix, MAGENTA_SATURATION_OFFSET_KW, theMagentaSaturationOffset);
-
-   kwl.add(prefix, MAGENTA_INTENSITY_OFFSET_KW, theMagentaIntensityOffset);
-
-   kwl.add(prefix, WHITE_OBJECT_CLIP_KW, theWhiteObjectClip);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "returning..." << endl;
-   }
-
-   return true;
-}
-
-void ossimHsiRemapper::resetGroup(int color_group)
-{
-   switch (color_group)
-   {
-      case RED:
-         resetRed();
-         break;
-      case YELLOW:
-         resetYellow();
-         break;
-      case GREEN:
-         resetGreen();
-         break;
-      case CYAN:
-         resetCyan();
-         break;
-      case BLUE:
-         resetBlue();
-         break;
-      case MAGENTA:
-         resetMagenta();
-         break;
-      case ALL:
-         resetMaster();
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::setSaturationOffset NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::resetAll()
-{
-   theMasterHueOffset          = 0.0;
-   theMasterSaturationOffset   = 0.0;
-   theMasterIntensityOffset    = 0.0;
-   theMasterIntensityLowClip   = 0.0;
-   theMasterIntensityHighClip  = 1.0;
-   
-   theRedHueOffset             = 0.0;
-   theRedHueLowRange           = -30.0;
-   theRedHueHighRange          = 30.0;
-   theRedHueBlendRange         = DEFAULT_BLEND;
-   theRedSaturationOffset      = 0.0;
-   theRedIntensityOffset       = 0.0;
-   
-   theYellowHueOffset          = 0.0;
-   theYellowHueLowRange        = 30.0;
-   theYellowHueHighRange       = 90.0;
-   theYellowHueBlendRange      = DEFAULT_BLEND;
-   theYellowSaturationOffset   = 0.0;
-   theYellowIntensityOffset    = 0.0;
-   
-   theGreenHueOffset           = 0.0;
-   theGreenHueLowRange         = 90.0;
-   theGreenHueHighRange        = 150.0;
-   theGreenHueBlendRange       = DEFAULT_BLEND;
-   theGreenSaturationOffset    = 0.0;
-   theGreenIntensityOffset     = 0.0;
-   
-   theCyanHueOffset            = 0.0;
-   theCyanHueLowRange          = 150.0;
-   theCyanHueHighRange         = 210.0;
-   theCyanHueBlendRange        = DEFAULT_BLEND;
-   theCyanSaturationOffset     = 0.0;
-   theCyanIntensityOffset      = 0.0;
-   
-   theBlueHueOffset            = 0.0;
-   theBlueHueLowRange          = 210.0;
-   theBlueHueHighRange         = 270.0;
-   theBlueHueBlendRange        = DEFAULT_BLEND;
-   theBlueSaturationOffset     = 0.0;
-   theBlueIntensityOffset      = 0.0;
-   
-   theMagentaHueOffset         = 0.0;
-   theMagentaHueLowRange       = 270.0;
-   theMagentaHueHighRange      = 330.0;
-   theMagentaHueBlendRange     = DEFAULT_BLEND;
-   theMagentaSaturationOffset  = 0.0;
-   theMagentaIntensityOffset   = 0.0;
-
-   theWhiteObjectClip          = 1.0;
-   theValidFlag = false;
-   //disableSource();
-}
-
-void ossimHsiRemapper::resetMaster()
-{
-   theMasterHueOffset          = 0.0;
-   theMasterSaturationOffset   = 0.0;
-   theMasterIntensityOffset    = 0.0;
-   theMasterIntensityLowClip   = 0.0;
-   theMasterIntensityHighClip  = 1.0;
-
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::resetRed()
-{
-   theRedHueOffset             = 0.0;
-   theRedHueLowRange           = -30.0;
-   theRedHueHighRange          = 30.0;
-   theRedHueBlendRange         = DEFAULT_BLEND;
-   theRedSaturationOffset      = 0.0;
-   theRedIntensityOffset       = 0.0;
-
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::resetYellow()
-{
-   theYellowHueOffset          = 0.0;
-   theYellowHueLowRange        = 30.0;
-   theYellowHueHighRange       = 90.0;
-   theYellowHueBlendRange      = DEFAULT_BLEND;
-   theYellowSaturationOffset   = 0.0;
-   theYellowIntensityOffset    = 0.0;
-
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::resetGreen()
-{
-   theGreenHueOffset           = 0.0;
-   theGreenHueLowRange         = 90.0;
-   theGreenHueHighRange        = 150.0;
-   theGreenHueBlendRange       = DEFAULT_BLEND;
-   theGreenSaturationOffset    = 0.0;
-   theGreenIntensityOffset     = 0.0;
-
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::resetCyan()
-{
-   theCyanHueOffset            = 0.0;
-   theCyanHueLowRange          = 150.0;
-   theCyanHueHighRange         = 210.0;
-   theCyanHueBlendRange        = DEFAULT_BLEND;
-   theCyanSaturationOffset     = 0.0;
-   theCyanIntensityOffset      = 0.0;
-
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::resetBlue()
-{
-   theBlueHueOffset            = 0.0;
-   theBlueHueLowRange          = 210.0;
-   theBlueHueHighRange         = 270.0;
-   theBlueHueBlendRange        = DEFAULT_BLEND;
-   theBlueSaturationOffset     = 0.0;
-   theBlueIntensityOffset      = 0.0;
-
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::resetMagenta()
-{
-   theMagentaHueOffset         = 0.0;
-   theMagentaHueLowRange       = 270.0;
-   theMagentaHueHighRange      = 330.0;
-   theMagentaHueBlendRange     = DEFAULT_BLEND;
-   theMagentaSaturationOffset  = 0.0;
-   theMagentaIntensityOffset   = 0.0;
-
-   verifyEnabled();
-}
-
-void ossimHsiRemapper::verifyEnabled()
-{
-   // Start off disabled...
-   //disableSource();
-   theValidFlag = false;
-   if (!theInputConnection)
-   {
-      //***
-      // Since this filter can be constructed with no input connection do not
-      // output and error, simply return.
-      //***
-      return;
-   }
-   
-   //***
-   // Add all the offsets and the low clips.
-   // If greater than zero enable getTile method.
-   //***
-   double d = theMasterHueOffset         +
-           theMasterSaturationOffset  +
-           theMasterIntensityOffset   +
-           theMasterIntensityLowClip  +
-           theRedHueOffset            +
-           theRedSaturationOffset     +
-           theRedIntensityOffset      +
-           theYellowHueOffset         +
-           theYellowSaturationOffset  +
-           theYellowIntensityOffset   +
-           theGreenHueOffset          +
-           theGreenSaturationOffset   +
-           theGreenIntensityOffset    +
-           theCyanHueOffset           +
-           theCyanSaturationOffset    +
-           theCyanIntensityOffset     +
-           theBlueHueOffset           +
-           theBlueSaturationOffset    +
-           theBlueIntensityOffset     +
-           theMagentaHueOffset        +
-           theMagentaSaturationOffset +
-           theMagentaIntensityOffset;
-   
-   if ( d != 0.0 ||
-        theMasterIntensityHighClip != 1.0 ||
-        theWhiteObjectClip != 1.0 )
-   {
-      theValidFlag = true;
-     // enableSource();
-   }
-}
-
-void ossimHsiRemapper::setMasterHueOffset(double offset)
-{
-   if (offset >= -180.0 && offset <= 180.0)
-   {
-      theMasterHueOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMasterHueOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -180.0 and less than"
-         << "\nor equal to 180.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMasterSaturationOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theMasterSaturationOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMasterSaturationOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMasterIntensityOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theMasterIntensityOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMasterIntensityOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMasterIntensityLowClip(double clip)
-{
-   if (clip >= 0.0 && clip < theMasterIntensityHighClip)
-   {
-      theMasterIntensityLowClip = clip;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMasterIntensityClip range error:"
-         << "\nLow clip of " << clip << " is out of range!"
-         << "\nMust be equal to or greater than 0.0 and less than"
-         << "\nthe high clip of " << theMasterIntensityHighClip
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMasterIntensityHighClip(double clip)
-{
-   if (clip <= 1.0 && clip > theMasterIntensityLowClip)
-   {
-      theMasterIntensityHighClip = clip;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMasterIntensityHighClip range error:"
-         << "\nHigh clip of " << clip << " is out of range!"
-         << "\nMust be greater than low clip of "
-         << theMasterIntensityLowClip << " and less than 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setRedHueOffset(double offset)
-{
-   if (offset >= -180.0 && offset <= 180.0)
-   {
-      theRedHueOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setRedHueOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -180.0 and less than"
-         << "\nor equal to 180.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setRedHueLowRange(double range)
-{
-   //***
-   // Default red range: 330 - 30
-   // Allow 315 to 15 as long as it's less than the high range.
-   // Note:  Store the range as a negative if it's between 315 and 360.
-   //***
-   double r  = range;
-   double h  = theRedHueHighRange;
-
-   if (r >= 315.0 && r < 360.0) r = r - 360.0;
-   if (h >= 315.0 && h < 360.0) h = h - 360.0;
-
-   if (r >= -45.0 && r <= 15.0 && r < h)
-   {
-      theRedHueLowRange = r;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setRedHueLow range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setRedHueHighRange(double range)
-{
-   if (range == 360.0) range = 0.0;
-   
-   //***
-   // Default red range: 330 - 30
-   // Allow 345 to 45 as long as it's greater than the low range.
-   // Note:  Store the range as a negative if it's between 345 and 360.
-   //***
-
-   double r = range;
-   double l = theRedHueLowRange;
-
-   if (r >= 315.0 && r < 360.0) r = r - 360.0;
-   if (l >= 315.0 && l < 360.0) l = l - 360.0;
-
-   if (r >= -15.0 && r <= 45 && l < r)
-   {
-      theRedHueHighRange = r;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setRedHueHigh range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setRedHueBlendRange(double range)
-{
-   //***
-   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
-   // half range.  If so snap it to half range.
-   //***
-   if ( range >= 0.0  &&
-        range <= MAX_BLEND )
-   {
-      double half_range = (theRedHueHighRange - theRedHueLowRange) / 2.0;
-
-      if (range <= half_range)
-      {
-         theRedHueBlendRange = range;
-      }
-      else
-      {
-         // Put it in the middle of the range.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHsiRemapper::setRedHueBlendRange range error:"
-            << "\nRange of " << range << " is greater than the full range"
-            << "\ndivided by 2!"
-            << endl;
-         
-         theRedHueBlendRange = half_range;
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setRedHueBlendRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setRedSaturationOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theRedSaturationOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setRedSaturationOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setRedIntensityOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theRedIntensityOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setRedIntensityOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setYellowHueOffset(double offset)
-{
-   if (offset >= -180.0 && offset <= 180.0)
-   {
-      theYellowHueOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setYellowHueOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -180.0 and less than"
-         << "\nor equal to 180.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setYellowHueLowRange(double range)
-{
-   //***
-   // Default yellow range: 30 - 90
-   // Allow 15 to 75 as long as it's less than the high range.
-   //***
-   if ( range >= 15.0 &&
-        range <= 75.0 &&
-        range < theYellowHueHighRange )
-   {
-      theYellowHueLowRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setYellowHueLowRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setYellowHueHighRange(double range)
-{
-   //***
-   // Default yellow range: 30 - 90
-   // Allow 45 to 105 as long as it's greater than the low range.
-   //***
-   if ( range >= 45.0  &&
-        range <= 105.0 &&
-        range > theYellowHueLowRange )
-   {
-      theYellowHueHighRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setYellowHueHighRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setYellowHueBlendRange(double range)
-{
-   //***
-   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
-   // half range.  If so snap it to half range.
-   //***
-   if ( range >= 0.0  &&
-        range <= MAX_BLEND )
-   {
-      double half_range = (theYellowHueHighRange - theYellowHueLowRange) / 2.0;
-      
-      if (range <= half_range)
-      {
-         theYellowHueBlendRange = range;
-      }
-      else
-      {
-         // Put it in the middle of the range.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHsiRemapper::setYellowHueBlendRange range error:"
-            << "\nRange of " << range << " is greater than the full range"
-            << "\ndivided by 2!"
-            << endl;
-         
-         theYellowHueBlendRange = half_range;
-      } 
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setYellowHueBlendRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setYellowSaturationOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theYellowSaturationOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setYellowSaturationOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setYellowIntensityOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theYellowIntensityOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setYellowIntensityOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setGreenHueOffset(double offset)
-{
-   if (offset >= -180.0 && offset <= 180.0)
-   {
-      theGreenHueOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setGreenHueOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -180.0 and less than"
-         << "\nor equal to 180.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setGreenHueLowRange(double range)
-{
-   //***
-   // Default green range:  90 - 150
-   // Allow 75 to 135 as long as it's less than the high range.
-   //***
-
-   if ( range >= 75.0 &&
-        range <= 135.0 &&
-        range < theGreenHueHighRange )
-   {
-      theGreenHueLowRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setGreenHueLowRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setGreenHueHighRange(double range)
-{
-   //***
-   // Default green range:  90 - 150
-   // Allow 105 to 165 as long as it's greater than the low range.
-   //***
-
-   if ( range >= 105.0  &&
-        range <= 165.0 &&
-        range > theGreenHueLowRange )
-   {
-      theGreenHueHighRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setGreenHueHighRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setGreenHueBlendRange(double range)
-{
-   //***
-   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
-   // half range.  If so snap it to half range.
-   //***
-   if ( range >= 0.0  &&
-        range <= MAX_BLEND )
-   {
-      double half_range = (theGreenHueHighRange - theGreenHueLowRange) / 2.0;
-
-      if (range <= half_range)
-      {
-         theGreenHueBlendRange = range;
-      }
-      else
-      {
-         // Put it in the middle of the range.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHsiRemapper::setGreenHueBlendRange range error:"
-            << "\nRange of " << range << " is greater than the full range"
-            << "\ndivided by 2!"
-            << endl;
-         
-         theGreenHueBlendRange = half_range;
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setGreenHueBlendRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setGreenSaturationOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theGreenSaturationOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setGreenSaturationOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setGreenIntensityOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theGreenIntensityOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setGreenIntensityOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setCyanHueOffset(double offset)
-{
-   if (offset >= -180.0 && offset <= 180.0)
-   {
-      theCyanHueOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setCyanHueOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -180.0 and less than"
-         << "\nor equal to 180.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setCyanHueLowRange(double range)
-{
-   //***
-   // Default cyan range: 150 - 210
-   // Allow 135 to 195 as long as it's less than the high range.
-   //***
-   
-   if ( range >= 135.0 &&
-        range <= 195.0 &&
-        range < theCyanHueHighRange )
-   {
-      theCyanHueLowRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setCyanHueLowRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setCyanHueHighRange(double range)
-{
-   //***
-   // Default cyan range: 150 - 210
-   // Allow 165 to 225 as long as it's greater than the low range.
-   //***
-   
-   if ( range >= 165.0 &&
-        range <= 225.0 &&
-        range > theCyanHueLowRange )
-   {
-      theCyanHueHighRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setCyanHueHighRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setCyanHueBlendRange(double range)
-{
-   //***
-   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
-   // half range.  If so snap it to half range.
-   //***
-   if ( range >= 0.0  &&
-        range <= MAX_BLEND )
-   {
-      double half_range = (theCyanHueHighRange - theCyanHueLowRange) / 2.0;
-      
-      if (range <= half_range)
-      {
-         theCyanHueBlendRange = range;
-      }
-      else
-      {
-         // Put it in the middle of the range.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHsiRemapper::setCyanHueBlendRange range error:"
-            << "\nRange of " << range << " is greater than the full range"
-            << "\ndivided by 2!"
-            << endl;
-         
-         theCyanHueBlendRange = half_range;
-      } 
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setCyanHueBlendRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setCyanSaturationOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theCyanSaturationOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setCyanSaturationOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setCyanIntensityOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theCyanIntensityOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setCyanIntensityOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setBlueHueOffset(double offset)
-{
-   if (offset >= -180.0 && offset <= 180.0)
-   {
-      theBlueHueOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setBlueHueOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -180.0 and less than"
-         << "\nor equal to 180.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setBlueHueLowRange(double range)
-{
-   //***
-   // Default blue range: 210 - 270
-   // Allow 195 to 255 as long as it's less than the high range.
-   //***
-   if ( range >= 195.0 &&
-        range <= 255.0 &&
-        range < theBlueHueHighRange )
-   {
-      theBlueHueLowRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setBlueHueLowRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setBlueHueHighRange(double range)
-{
-   //***
-   // Default blue range: 210 - 270
-   // Allow 225 to 285 as long as it's greater than the low range.
-   //***
-   if ( range >= 225.0  &&
-        range <= 285.0 &&
-        range > theBlueHueLowRange )
-   {
-      theBlueHueHighRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setBlueHueHighRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setBlueHueBlendRange(double range)
-{
-   //***
-   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
-   // half range.  If so snap it to half range.
-   //***
-   if ( range >= 0.0  &&
-        range <= MAX_BLEND )
-   {
-      double half_range = (theBlueHueHighRange - theBlueHueLowRange) / 2.0;
-
-      if (range <= half_range)
-      {
-         theBlueHueBlendRange = range;
-      }
-      else
-      {
-         // Put it in the middle of the range.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHsiRemapper::setBlueHueBlendRange range error:"
-            << "\nRange of " << range << " is greater than the full range"
-            << "\ndivided by 2!"
-            << endl;
-         
-         theBlueHueBlendRange = half_range;
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setBlueHueBlendRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setBlueSaturationOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theBlueSaturationOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setBlueSaturationOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setBlueIntensityOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theBlueIntensityOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setBlueIntensityOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMagentaHueOffset(double offset)
-{
-   if (offset >= -180.0 && offset <= 180.0)
-   {
-      theMagentaHueOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMagentaHueOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -180.0 and less than"
-         << "\nor equal to 180.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMagentaHueLowRange(double range)
-{
-   //***
-   // Default magenta range:  270 - 330
-   // Allow 255 to 315 as long as it's less than the high range.
-   //***
-   if ( range >= 255.0 &&
-        range <= 315.0 &&
-        range < theMagentaHueHighRange )
-   {
-      theMagentaHueLowRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMagentaHueLowRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMagentaHueHighRange(double range)
-{
-   //***
-   // Default magenta range:  270 - 330
-   // Allow 285 to 345 as long as it's greater than the low range.
-   //***
-   if ( range >= 285.0  &&
-        range <= 345.0 &&
-        range > theMagentaHueLowRange )
-   {
-      theMagentaHueHighRange = range;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMagentaHueHighRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMagentaHueBlendRange(double range)
-{
-   //***
-   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
-   // half range.  If so snap it to half range.
-   //***
-   if ( range >= 0.0  &&
-        range <= MAX_BLEND )
-   {
-      double half_range = (theMagentaHueHighRange-theMagentaHueLowRange)/2.0;
-
-      if (range <= half_range)
-      {
-         theMagentaHueBlendRange = range;
-      }
-      else
-      {
-         // Put it in the middle of the range.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHsiRemapper::setMagentaHueBlendRange range error:"
-            << "\nRange of " << range << " is greater than the full range"
-            << "\ndivided by 2!"
-            << endl;
-         
-         theMagentaHueBlendRange = half_range;
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMagentaHueBlendRange range error:"
-         << "\nRange of " << range << " is out of range!"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMagentaSaturationOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theMagentaSaturationOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMagentaSaturationOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-void ossimHsiRemapper::setMagentaIntensityOffset(double offset)
-{
-   if (offset >= -1.0 && offset <= 1.0)
-   {
-      theMagentaIntensityOffset = offset;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimHsiRemapper::setMagentaIntensityOffset range error:"
-         << "\nOffset of " << offset << " is out of range!"
-         << "\nMust be equal to or greater than -1.0 and less than"
-         << "\nor equal to 1.0"
-         << endl;
-   }
-}
-
-double ossimHsiRemapper::calculateMinNormValue()
-{
-   static const char MODULE[] = "ossimHsiRemapper::calculateMinNormValue";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " Entered..." << endl;
-   }
-   
-   if (!theTile)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nClass not initialized!"
-         << endl;
-      return 0.0;
-   }
-
-   double min_pix = theTile->getMinPix(0);
-   double max_pix = theTile->getMaxPix(0);
-
-   for (ossim_uint32 band=1; band<theTile->getNumberOfBands(); ++band)
-   {
-      if (min_pix != theTile->getMinPix(band))
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Warning:"
-            << "\nMixed minimum values for bands..."
-            << endl;
-      }
-      if (max_pix != theTile->getMaxPix(band))
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << " Warning:"
-              << "\nMixed maximum values for bands..."
-              << endl;
-      }
-   }
-
-   if (min_pix < 0.0)
-   {
-      //
-      // Assigning some arbituary number for float data.
-      // This should really come from the normalizer (ossimImageData) of
-      // the data.
-      //
-      return OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
-   }
-
-   return (min_pix / max_pix);
-}
-
-ossim_uint32 ossimHsiRemapper::getNumberOfOutputBands() const
-{
-   if (isSourceEnabled()&&theValidFlag) // Always rgb tile out...
-   {
-      return 3;
-   }
-
-   // Filter bypassed so getTile will return input tile.
-   return ossimImageSourceFilter::getNumberOfInputBands();
-}
-
-
-double ossimHsiRemapper::getMasterHueOffset () const
-{
-   return theMasterHueOffset;
-}
-
-double ossimHsiRemapper::getMasterSaturationOffset() const
-{
-   return theMasterSaturationOffset;
-}
-
-double ossimHsiRemapper::getMasterIntensityOffset() const
-{
-   return theMasterIntensityOffset;
-}
-
-double ossimHsiRemapper::getMasterIntensityLowClip() const
-{
-   return theMasterIntensityLowClip;
-}
-
-double ossimHsiRemapper::getMasterIntensityHighClip() const
-{
-   return theMasterIntensityHighClip;
-}
-
-double ossimHsiRemapper::getRedHueOffset() const
-{
-   return theRedHueOffset;
-}
-
-double ossimHsiRemapper::getRedHueLowRange() const
-{
-   return theRedHueLowRange;
-}
-
-double ossimHsiRemapper::getRedHueHighRange() const
-{
-   return theRedHueHighRange;
-}
-
-double ossimHsiRemapper::getRedHueBlendRange() const
-{
-   return theRedHueBlendRange;
-}
-
-double ossimHsiRemapper::getRedSaturationOffset() const
-{
-   return theRedSaturationOffset;
-}
-
-double ossimHsiRemapper::getRedIntensityOffset() const
-{
-   return theRedIntensityOffset;
-}
-
-double ossimHsiRemapper::getYellowHueOffset () const
-{
-   return theYellowHueOffset;
-}
-
-double ossimHsiRemapper::getYellowHueLowRange() const
-{
-   return theYellowHueLowRange;
-}
-
-double ossimHsiRemapper::getYellowHueHighRange() const
-{
-   return theYellowHueHighRange;
-}
-
-double ossimHsiRemapper::getYellowHueBlendRange() const
-{
-   return theYellowHueBlendRange;
-}
-
-double ossimHsiRemapper::getYellowSaturationOffset() const
-{
-   return theYellowSaturationOffset;
-}
-
-double ossimHsiRemapper::getYellowIntensityOffset() const
-{
-   return theYellowIntensityOffset;
-}
-
-double ossimHsiRemapper::getGreenHueOffset () const
-{
-   return theGreenHueOffset;
-}
-
-double ossimHsiRemapper::getGreenHueLowRange() const
-{
-   return theGreenHueLowRange;
-}
-
-double ossimHsiRemapper::getGreenHueHighRange() const
-{
-   return theGreenHueHighRange;
-}
-
-double ossimHsiRemapper::getGreenHueBlendRange() const
-{
-   return theGreenHueBlendRange;
-}
-
-double ossimHsiRemapper::getGreenSaturationOffset() const
-{
-   return theGreenSaturationOffset;
-}
-
-double ossimHsiRemapper::getGreenIntensityOffset() const
-{
-   return theGreenIntensityOffset;
-}
-
-double ossimHsiRemapper::getCyanHueOffset () const
-{
-   return theCyanHueOffset;
-}
-
-double ossimHsiRemapper::getCyanHueLowRange() const
-{
-   return theCyanHueLowRange;
-}
-
-double ossimHsiRemapper::getCyanHueHighRange() const
-{
-   return theCyanHueHighRange;
-}
-
-double ossimHsiRemapper::getCyanHueBlendRange() const
-{
-   return theCyanHueBlendRange;
-}
-
-double ossimHsiRemapper::getCyanSaturationOffset() const
-{
-   return theCyanSaturationOffset;
-}
-
-double ossimHsiRemapper::getCyanIntensityOffset() const
-{
-   return theCyanIntensityOffset;
-}
-
-double ossimHsiRemapper::getBlueHueOffset () const
-{
-   return theBlueHueOffset;
-}
-
-double ossimHsiRemapper::getBlueHueLowRange() const
-{
-   return theBlueHueLowRange;
-}
-
-double ossimHsiRemapper::getBlueHueHighRange() const
-{
-   return theBlueHueHighRange;
-}
-
-double ossimHsiRemapper::getBlueHueBlendRange() const
-{
-   return theBlueHueBlendRange;
-}
-
-double ossimHsiRemapper::getBlueSaturationOffset() const
-{
-   return theBlueSaturationOffset;
-}
-
-double ossimHsiRemapper::getBlueIntensityOffset() const
-{
-   return theBlueIntensityOffset;
-}
-
-double ossimHsiRemapper::getMagentaHueOffset () const
-{
-   return theMagentaHueOffset;
-}
-
-double ossimHsiRemapper::getMagentaHueLowRange() const
-{
-   return theMagentaHueLowRange;
-}
-
-double ossimHsiRemapper::getMagentaHueHighRange() const
-{
-   return theMagentaHueHighRange;
-}
-
-double ossimHsiRemapper::getMagentaHueBlendRange() const
-{
-   return theMagentaHueBlendRange;
-}
-
-double ossimHsiRemapper::getMagentaSaturationOffset() const
-{
-   return theMagentaSaturationOffset;
-}
-
-double ossimHsiRemapper::getMagentaIntensityOffset() const
-{
-   return theMagentaIntensityOffset;
-}
-
-void ossimHsiRemapper::setHueOffset(int color_group, double offset)
-{
-   switch (color_group)
-   {
-      case RED:
-         setRedHueOffset(offset);
-         break;
-      case YELLOW:
-         setYellowHueOffset(offset);
-         break;
-      case GREEN:
-         setGreenHueOffset(offset);
-         break;
-      case CYAN:
-         setCyanHueOffset(offset);
-         break;
-      case BLUE:
-         setBlueHueOffset(offset);
-         break;
-      case MAGENTA:
-         setMagentaHueOffset(offset);
-         break;
-      case ALL:
-         setMasterHueOffset(offset);
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::setHueOffset NOTICE:  Range error!" << endl;
-   }
-}
-
-void ossimHsiRemapper::setHueLowRange(int color_group, double range)
-{
-   switch (color_group)
-   {
-      case RED:
-         setRedHueLowRange(range);
-         break;
-      case YELLOW:
-         setYellowHueLowRange(range);
-         break;
-      case GREEN:
-         setGreenHueLowRange(range);
-         break;
-      case CYAN:
-         setCyanHueLowRange(range);
-         break;
-      case BLUE:
-         setBlueHueLowRange(range);
-         break;
-      case MAGENTA:
-         setMagentaHueLowRange(range);
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::setHueLowRange NOTICE:  Range error!"
-            << endl;
-   }
-}
-
-void ossimHsiRemapper::setHueHighRange(int color_group, double range)
-{
-   switch (color_group)
-   {
-      case RED:
-         setRedHueHighRange(range);
-         break;
-      case YELLOW:
-         setYellowHueHighRange(range);
-         break;
-      case GREEN:
-         setGreenHueHighRange(range);
-         break;
-      case CYAN:
-         setCyanHueHighRange(range);
-         break;
-      case BLUE:
-         setBlueHueHighRange(range);
-         break;
-      case MAGENTA:
-         setMagentaHueHighRange(range);
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::setHueHighRange NOTICE:  Range error!"
-            << endl;
-   }
-}
-
-void ossimHsiRemapper::setHueBlendRange(int color_group, double range)
-{
-   switch (color_group)
-   {
-      case RED:
-         setRedHueBlendRange(range);
-         break;
-      case YELLOW:
-         setYellowHueBlendRange(range);
-         break;
-      case GREEN:
-         setGreenHueBlendRange(range);
-         break;
-      case CYAN:
-         setCyanHueBlendRange(range);
-         break;
-      case BLUE:
-         setBlueHueBlendRange(range);
-         break;
-      case MAGENTA:
-         setMagentaHueBlendRange(range);
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::setHueBlendRange NOTICE:  Range error!"
-            << endl;
-   }
-}
-
-void ossimHsiRemapper::setSaturationOffset(int color_group, double offset)
-{
-   switch (color_group)
-   {
-      case RED:
-         setRedSaturationOffset(offset);
-         break;
-      case YELLOW:
-         setYellowSaturationOffset(offset);
-         break;
-      case GREEN:
-         setGreenSaturationOffset(offset);
-         break;
-      case CYAN:
-         setCyanSaturationOffset(offset);
-         break;
-      case BLUE:
-         setBlueSaturationOffset(offset);
-         break;
-      case MAGENTA:
-         setMagentaSaturationOffset(offset);
-         break;
-      case ALL:
-         setMasterSaturationOffset(offset);
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::setSaturationOffset NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-}
-
-void ossimHsiRemapper::setIntensityOffset(int color_group, double offset)
-{
-   switch (color_group)
-   {
-      case RED:
-         setRedIntensityOffset(offset);
-         break;
-      case YELLOW:
-         setYellowIntensityOffset(offset);
-         break;
-      case GREEN:
-         setGreenIntensityOffset(offset);
-         break;
-      case CYAN:
-         setCyanIntensityOffset(offset);
-         break;
-      case BLUE:
-         setBlueIntensityOffset(offset);
-         break;
-      case MAGENTA:
-         setMagentaIntensityOffset(offset);
-         break;
-      case ALL:
-         setMasterIntensityOffset(offset);
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::setIntensityOffset NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-}
-
-double ossimHsiRemapper::getHueOffset(int color_group) const
-{
-   switch (color_group)
-   {
-      case RED:
-         return getRedHueOffset();
-         break;
-      case YELLOW:
-         return getYellowHueOffset();
-         break;
-      case GREEN:
-         return getGreenHueOffset();
-         break;
-      case CYAN:
-         return getCyanHueOffset();
-         break;
-      case BLUE:
-         return getBlueHueOffset();
-         break;
-      case MAGENTA:
-         return getMagentaHueOffset();
-         break;
-      case ALL:
-         return getMasterHueOffset();
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::getHueOffset NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-   return 0.0;
-}
-
-double ossimHsiRemapper::getHueLowRange(int color_group) const
-{
-   switch (color_group)
-   {
-      case RED:
-         return getRedHueLowRange();
-         break;
-      case YELLOW:
-         return getYellowHueLowRange();
-         break;
-      case GREEN:
-         return getGreenHueLowRange();
-         break;
-      case CYAN:
-         return getCyanHueLowRange();
-         break;
-      case BLUE:
-         return getBlueHueLowRange();
-         break;
-      case MAGENTA:
-         return getMagentaHueLowRange();
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::getHueLowRange NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-   return 0.0;
-}
-
-double ossimHsiRemapper::getHueHighRange(int color_group) const
-{
-   switch (color_group)
-   {
-      case RED:
-         return getRedHueHighRange();
-         break;
-      case YELLOW:
-         return getYellowHueHighRange();
-         break;
-      case GREEN:
-         return getGreenHueHighRange();
-         break;
-      case CYAN:
-         return getCyanHueHighRange();
-         break;
-      case BLUE:
-         return getBlueHueHighRange();
-         break;
-      case MAGENTA:
-         return getMagentaHueHighRange();
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::getHueHighRange NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-   return 0.0;
-}
-
-double ossimHsiRemapper::getHueBlendRange(int color_group) const
-{
-   switch (color_group)
-   {
-      case RED:
-         return getRedHueBlendRange();
-         break;
-      case YELLOW:
-         return getYellowHueBlendRange();
-         break;
-      case GREEN:
-         return getGreenHueBlendRange();
-         break;
-      case CYAN:
-         return getCyanHueBlendRange();
-         break;
-      case BLUE:
-         return getBlueHueBlendRange();
-         break;
-      case MAGENTA:
-         return getMagentaHueBlendRange();
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::getHueBlendRange NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-   return 0.0;
-}
-
-double ossimHsiRemapper::getSaturationOffset(int color_group) const
-{
-   switch (color_group)
-   {
-      case RED:
-         return getRedSaturationOffset();
-         break;
-      case YELLOW:
-         return getYellowSaturationOffset();
-         break;
-      case GREEN:
-         return getGreenSaturationOffset();
-         break;
-      case CYAN:
-         return getCyanSaturationOffset();
-         break;
-      case BLUE:
-         return getBlueSaturationOffset();
-         break;
-      case MAGENTA:
-         return getMagentaSaturationOffset();
-         break;
-      case ALL:
-         return getMasterSaturationOffset();
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::getSaturationOffset NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-   return 0.0;
-}
-
-double ossimHsiRemapper::getIntensityOffset(int color_group) const
-{
-   switch (color_group)
-   {
-      case RED:
-         return getRedIntensityOffset();
-         break;
-      case YELLOW:
-         return getYellowIntensityOffset();
-         break;
-      case GREEN:
-         return getGreenIntensityOffset();
-         break;
-      case CYAN:
-         return getCyanIntensityOffset();
-         break;
-      case BLUE:
-         return getBlueIntensityOffset();
-         break;
-      case MAGENTA:
-         return getMagentaIntensityOffset();
-         break;
-      case ALL:
-         return getMasterIntensityOffset();
-         break;
-      default:
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "ossimHsiRemapper::getIntensityOffset NOTICE:  Range error!"
-            << endl;
-         break;
-   }
-   return 0.0;
-}
-
-void ossimHsiRemapper::setWhiteObjectClip(double clip)
-{
-   if ( (clip >= .8) && (clip <= 1.0) )
-   {
-      theWhiteObjectClip = clip;
-      verifyEnabled();
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "HsiRemapper::setWhiteObjectClip range error:"
-         << "\nClip of " << clip << " is out of range!"
-         << "\nMust be between .8 and 1.0"
-         << endl;
-   }
-}
-
-double ossimHsiRemapper::getWhiteObjectClip() const
-{
-   return theWhiteObjectClip;
-}
-
-void ossimHsiRemapper::resetWhiteObjectClip()
-{
-   theWhiteObjectClip = 1.0;
-   verifyEnabled();
-}
-
-ossimString ossimHsiRemapper::getLongName()const
-{
-   return ossimString("HSI Remapper, filter with controls for all HSI(Hue, Saturation, and Intensity) adjustments.");
-}
-
-ossimString ossimHsiRemapper::getShortName()const
-{
-   return ossimString("HSI Remapper");
-}
-
-ostream& ossimHsiRemapper::print(ostream& os) const
-{
-   os << setiosflags(ios::fixed) << setprecision(2)
-      << "\nossimHsiRemapper:"
-      << "\ntheEnableFlag:                " << theEnableFlag
-
-      << "\ntheMasterHueOffset:           " << theMasterHueOffset
-      << "\ntheMasterSaturationOffset:    " << theMasterSaturationOffset
-      << "\ntheMasterIntensityOffset:     " << theMasterIntensityOffset
-      << "\ntheMasterIntensityLowClip:    " << theMasterIntensityLowClip
-      << "\ntheMasterIntensityHighClip:   " << theMasterIntensityHighClip
-      
-      << "\ntheRedHueOffset:              " << theRedHueOffset
-      << "\ntheRedHueLowRange:            " << theRedHueLowRange
-      << "\ntheRedHueHighRange:           " << theRedHueHighRange
-      << "\ntheRedSaturationOffset:       " << theRedSaturationOffset
-      << "\ntheRedIntensityOffset:        " << theRedIntensityOffset
-      
-      << "\ntheYellowHueOffset:           " << theYellowHueOffset
-      << "\ntheYellowHueLowRange:         " << theYellowHueLowRange
-      << "\ntheYellowHueHighRange:        " << theYellowHueHighRange
-      << "\ntheYellowSaturationOffset:    " << theYellowSaturationOffset
-      << "\ntheYellowIntensityOffset:     " << theYellowIntensityOffset
-      
-      << "\ntheGreenHueOffset:            " << theGreenHueOffset
-      << "\ntheGreenHueLowRange:          " << theGreenHueLowRange
-      << "\ntheGreenHueHighRange:         " << theGreenHueHighRange
-      << "\ntheGreenSaturationOffset:     " << theGreenSaturationOffset
-      << "\ntheGreenIntensityOffset:      " << theGreenIntensityOffset
-      
-      << "\ntheCyanHueOffset:             " << theCyanHueOffset
-      << "\ntheCyanHueLowRange:           " << theCyanHueLowRange
-      << "\ntheCyanHueHighRange:          " << theCyanHueHighRange
-      << "\ntheCyanSaturationOffset:      " << theCyanSaturationOffset
-      << "\ntheCyanIntensityOffset:       " << theCyanIntensityOffset
-      
-      << "\ntheBlueHueOffset:             " << theBlueHueOffset
-      << "\ntheBlueHueLowRange:           " << theBlueHueLowRange
-      << "\ntheBlueHueHighRange:          " << theBlueHueHighRange
-      << "\ntheBlueSaturationOffset:      " << theBlueSaturationOffset
-      << "\ntheBlueIntensityOffset:       " << theBlueIntensityOffset
-      
-      << "\ntheMagentaHueOffset:          " << theMagentaHueOffset
-      << "\ntheMagentaHueLowRange:        " << theMagentaHueLowRange
-      << "\ntheMagentaHueHighRange:       " << theMagentaHueHighRange
-      << "\ntheMagentaSaturationOffset:   " << theMagentaSaturationOffset
-      << "\ntheMagentaIntensityOffset:    " << theMagentaIntensityOffset
-
-      << "\ntheWhiteObjectClip:           " << theWhiteObjectClip
-      << endl;
-   
-   return os;
-}
-
-ostream& operator<<(ostream& os, const ossimHsiRemapper& hr)
-{
-   return hr.print(os);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimHsiToRgbSource.cpp b/ossim/src/ossim/imaging/ossimHsiToRgbSource.cpp
deleted file mode 100644
index 05027dd..0000000
--- a/ossim/src/ossim/imaging/ossimHsiToRgbSource.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHsiToRgbSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimHsiToRgbSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimHsiVector.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimHsiToRgbSource, "ossimHsiToRgbSource", ossimImageSourceFilter)
-
-ossimHsiToRgbSource::ossimHsiToRgbSource()
-   :ossimImageSourceFilter(),
-    theBlankTile(NULL),
-    theTile(NULL)
-{
-}
-
-ossimHsiToRgbSource::ossimHsiToRgbSource(ossimImageSource* inputSource)
-   : ossimImageSourceFilter(inputSource),
-    theBlankTile(NULL),
-    theTile(NULL)
-{
-}
-
-ossimHsiToRgbSource::~ossimHsiToRgbSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimHsiToRgbSource::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return NULL;  // This filter requires an input.
-   }
-   
-   ossimRefPtr<ossimImageData> inputTile =
-      theInputConnection->getTile(tileRect, resLevel);   
-   if(!isSourceEnabled())
-   {
-      return inputTile;
-   }
-   
-   if(!theTile.valid())
-   {
-      allocate(); // First time through...
-   }
-   
-   if( !inputTile.valid() ||
-       inputTile->getDataObjectStatus() == OSSIM_NULL ||
-       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
-   {
-      theBlankTile->setImageRectangle(tileRect);
-      return theBlankTile;
-   }
-
-   if((inputTile->getNumberOfBands()==3)&&
-      (inputTile->getScalarType()==OSSIM_NORMALIZED_FLOAT)&&
-      (inputTile->getDataObjectStatus()!=OSSIM_NULL))
-   {
-      // Set the origin, resize if needed of the output tile.
-      theTile->setImageRectangle(tileRect);
-      
-      ossim_uint8* outputBands[3];
-      float* inputBands[3];
-      outputBands[0] = static_cast<ossim_uint8*>(theTile->getBuf(0));
-      outputBands[1] = static_cast<ossim_uint8*>(theTile->getBuf(1));
-      outputBands[2] = static_cast<ossim_uint8*>(theTile->getBuf(2));
-      inputBands[0] = static_cast<float*>(inputTile->getBuf(0));
-      inputBands[1] = static_cast<float*>(inputTile->getBuf(1));
-      inputBands[2] = static_cast<float*>(inputTile->getBuf(2));
-      
-      long height = inputTile->getHeight();
-      long width  = inputTile->getWidth();
-      long offset = 0;
-      for(long row = 0; row < height; ++row)
-      {
-         for(long col = 0; col < width; ++col)
-         {
-            ossimHsiVector hsi(inputBands[0][offset],
-                               inputBands[1][offset],
-                               inputBands[2][offset]);
-            
-            ossimRgbVector rgb(hsi);
-            
-            
-            outputBands[0][offset] = rgb.getR();
-            outputBands[1][offset] = rgb.getG();
-            outputBands[2][offset] = rgb.getB();
-            
-            ++offset;
-         }
-      }
-   }
-   else
-   {
-      return inputTile;
-   }
-
-   theTile->validate();
-
-   return theTile;
-}
-
-void ossimHsiToRgbSource::initialize()
-{
-   ossimImageSourceFilter::initialize();
-}
-
-void ossimHsiToRgbSource::allocate()
-{
-   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile = (ossimImageData*)theBlankTile->dup();
-   theTile->initialize();
-}
-
-ossimScalarType ossimHsiToRgbSource::getOutputScalarType() const
-{
-   return OSSIM_UCHAR;
-}
-
-double ossimHsiToRgbSource::getNullPixelValue()const
-{
-   return 0.0;
-}
-
-double ossimHsiToRgbSource::getMinPixelValue(ossim_uint32 /* band */)const
-{
-   return OSSIM_DEFAULT_MIN_PIX_UCHAR;
-}
-
-double ossimHsiToRgbSource::getMaxPixelValue(ossim_uint32 /* band */)const
-{
-   return OSSIM_DEFAULT_MAX_PIX_UCHAR;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimHsvGridRemapEngine.cpp b/ossim/src/ossim/imaging/ossimHsvGridRemapEngine.cpp
deleted file mode 100644
index 9a49b8d..0000000
--- a/ossim/src/ossim/imaging/ossimHsvGridRemapEngine.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-//*****************************************************************************
-// FILE: ossimHsvGridRemapEngine.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class 
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimHsvGridRemapEngine.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimHsvGridRemapEngine.h>
-
-RTTI_DEF1(ossimHsvGridRemapEngine, "ossimHsvGridRemapEngine",
-          ossimGridRemapEngine);
-
-#include <ossim/imaging/ossimGridRemapSource.h>
-#include <ossim/imaging/ossimAtbPointSource.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDblGrid.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/base/ossimHsvVector.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimHsvGridRemapEngine:exec");
-static ossimTrace traceDebug ("ossimHsvGridRemapEngine:debug");
-
-//*****************************************************************************
-//  METHOD: ossimHsvGridRemapEngine::remapTile
-//  
-//*****************************************************************************
-ossimObject* ossimHsvGridRemapEngine::dup() const
-{
-   return new ossimHsvGridRemapEngine;
-}
-
-//*****************************************************************************
-//  METHOD: ossimHsvGridRemapEngine::remapTile
-//  
-//*****************************************************************************
-void ossimHsvGridRemapEngine::remapTile(const ossimDpt&       origin,
-                                        ossimGridRemapSource* remapper,
-                                        ossimRefPtr<ossimImageData>& tile)
-{
-   static const char MODULE[] = "ossimHsvGridRemapEngine::remapTile";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // Fetch tile size and NULL pixel value:
-   //***
-   int    width         = tile->getWidth();
-   int    height        = tile->getHeight();
-   int    offset        = 0;
-   
-   void* red_buf = tile->getBuf(0);
-   void* grn_buf = tile->getBuf(1);
-   void* blu_buf = tile->getBuf(2);
-
-   ossimDblGrid& gridH = *(remapper->getGrid(0));
-   ossimDblGrid& gridS = *(remapper->getGrid(1));
-   ossimDblGrid& gridV = *(remapper->getGrid(2));
-      
-   //---
-   // Remap according to pixel type:
-   //---
-   switch(tile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         for (double line=origin.line; line<origin.line+height; line+=1.0)
-         {
-            for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
-            {
-               //---
-               // Fetch pixel from the input tile band buffers and convert
-               // to HSV:
-               //---
-               ossimRgbVector rgb_pixel (((ossim_uint8*)red_buf)[offset],
-                                         ((ossim_uint8*)grn_buf)[offset],
-                                         ((ossim_uint8*)blu_buf)[offset]);
-               ossimHsvVector hsv_pixel (rgb_pixel);
-               
-               //---
-               // Remap pixel HSV  with spatially variant bias value:
-               //---
-               hsv_pixel.setH(hsv_pixel.getH() + gridH(samp,line));
-               hsv_pixel.setS(hsv_pixel.getS() + gridS(samp,line));
-               hsv_pixel.setV(hsv_pixel.getV() + gridV(samp,line));
-               
-               //---
-               // Convert back to RGB and write to the tile:
-               //---
-               rgb_pixel = hsv_pixel;  // auto-clamped
-               ((ossim_uint8*)red_buf)[offset] = rgb_pixel.getR();
-               ((ossim_uint8*)grn_buf)[offset] = rgb_pixel.getG();
-               ((ossim_uint8*)blu_buf)[offset] = rgb_pixel.getB();
-               
-               offset++;
-            }
-         }
-         break;
-      }
-      
-      case OSSIM_USHORT11:
-         break;
-         
-      case OSSIM_UINT16:
-         break;
-         
-      case OSSIM_SINT16:
-         break;	
-
-      case OSSIM_FLOAT64:
-         break;	
-
-      case OSSIM_NORMALIZED_DOUBLE:
-         break;	
-
-      case OSSIM_FLOAT32:
-         break;	
-
-      case OSSIM_NORMALIZED_FLOAT:
-         break;	
-
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         break;
-
-   }   // end switch statement
-
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-};
-
-//*****************************************************************************
-//  METHOD: ossimHsvGridRemapEngine::assignRemapValues
-//
-//  This engine defines the target value as an HSV vector of doubles, computed
-//  as the mean of all contributor HSV values.
-//  
-//*****************************************************************************
-void ossimHsvGridRemapEngine::assignRemapValues (
-   vector<ossimAtbPointSource*>& sources_list)
-{
-   static const char MODULE[] = "ossimHsvGridRemapEngine::assignRemapValues";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   int i; // index to individual sources
-
-   //***
-   // Declare a 2D array that will contain all of the contributing sources'
-   // HSV mean values. Also declare the accumulator target vector.
-   //***
-   int num_contributors = (int)sources_list.size();
-   double** contributor_pixel = new double* [num_contributors];
-   for (i=0; i<num_contributors; i++)
-      contributor_pixel[i] = new double[3];
-   double target_pixel[3] = {0.0, 0.0, 0.0};
-
-   //***
-   // Now loop over each remaining contributor and sum in its contribution:
-   //***
-   vector<ossimAtbPointSource*>::iterator source;
-   i = 0;
-   for(source  = sources_list.begin();
-       source != sources_list.end();
-       source++)
-   {
-      (*source)->getSourceValue(contributor_pixel[i]);
-
-      target_pixel[0] += contributor_pixel[i][0]/(double)num_contributors;
-      target_pixel[1] += contributor_pixel[i][1]/(double)num_contributors;
-      target_pixel[2] += contributor_pixel[i][2]/(double)num_contributors;
-
-      i++;
-   }
-
-   //***
-   // The target pixel has been established. Now need to compute the actual
-   // remap quantities that will be written to the appropriate remap grids:
-   //***
-   i = 0;
-   for(source  = sources_list.begin();
-       source != sources_list.end();
-       source++)
-   {
-      computeRemapNode(*source, contributor_pixel[i], target_pixel);
-      i++;
-   }
-
-   //***
-   // Delete locally allocated memory:
-   //***
-   for (i=0; i<num_contributors; i++)
-      delete [] contributor_pixel[i];
-   delete [] contributor_pixel;
-   
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimHsvGridRemapEngine::computeSourceValue
-//  
-//*****************************************************************************
-void ossimHsvGridRemapEngine::computeSourceValue(
-   ossimRefPtr<ossimImageData>& source, void* result)
-{
-   static const char MODULE[]="ossimHsvGridRemapEngine::computeSourceValue";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // This engine defines "value" as the HSV vector corresponding to the mean
-   // RGB pixel value of the source data:
-   //***
-   ossimRgbVector rgb_vector;
-   rgb_vector.setR((unsigned char) source->computeAverageBandValue(0));
-   rgb_vector.setG((unsigned char) source->computeAverageBandValue(1));
-   rgb_vector.setB((unsigned char) source->computeAverageBandValue(2));
-
-   //***
-   // Assign the HSV components to the result vector:
-   //***
-   ossimHsvVector hsv_vector (rgb_vector);
-   ((double*)result)[0] = (double) hsv_vector.getH();
-   ((double*)result)[1] = (double) hsv_vector.getS();
-   ((double*)result)[2] = (double) hsv_vector.getV();
-   
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimHsvGridRemapEngine::computeRemapNode
-//
-//  This engine defines the remap value as the difference between the target
-//  HSV vector and the individual point source's value vector.
-//
-//*****************************************************************************
-void ossimHsvGridRemapEngine::computeRemapNode(ossimAtbPointSource* ps,
-                                              void* source_value,
-                                              void* target_value)
-{
-   static const char MODULE[] = "ossimHsvGridRemapEngine::computeRemapNode";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // Compute the remap grid node value specific to this HSV implementation:
-   //***
-   double node[3];
-   node[0] = ((double*)target_value)[0] - ((double*)source_value)[0];
-   node[1] = ((double*)target_value)[1] - ((double*)source_value)[1];
-   node[2] = ((double*)target_value)[2] - ((double*)source_value)[2];
-
-   //***
-   // Fetch a pointer to the remapper feeding this point source in order to
-   // pass it the node value:
-   //***
-   ossimGridRemapSource* remapper = ps->getRemapSource();
-   remapper->setGridNode(ps->getViewPoint(), node);
-                         
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimHsvToRgbSource.cpp b/ossim/src/ossim/imaging/ossimHsvToRgbSource.cpp
deleted file mode 100644
index a2e01ce..0000000
--- a/ossim/src/ossim/imaging/ossimHsvToRgbSource.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimHsvToRgbSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimHsvToRgbSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimHsvVector.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimHsvToRgbSource, "ossimHsvToRgbSource", ossimImageSourceFilter)
-
-ossimHsvToRgbSource::ossimHsvToRgbSource()
-   :ossimImageSourceFilter(),
-    theBlankTile(NULL),
-    theTile(NULL)
-{
-}
-
-ossimHsvToRgbSource::ossimHsvToRgbSource(ossimImageSource* inputSource)
-   : ossimImageSourceFilter(inputSource),
-     theBlankTile(NULL),
-     theTile(NULL)
-{
-}
-
-ossimHsvToRgbSource::~ossimHsvToRgbSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimHsvToRgbSource::getTile(
-   const  ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(theInputConnection)
-   {
-      ossimRefPtr<ossimImageData> imageData =
-         theInputConnection->getTile(tileRect, resLevel);
-
-      if(!imageData.valid()) return theBlankTile;
-      
-      if(!isSourceEnabled())
-      {
-         return imageData;
-      }
-
-      if(!theTile.valid()) allocate();
-      if(!theTile.valid())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Unable to initialize ossimHsvToRgbSource in getTile"
-            << std::endl;
-         return ossimRefPtr<ossimImageData>();
-      }
-      
-      long w  = tileRect.width();
-      long h  = tileRect.height();
-      long tw = theTile->getWidth();
-      long th = theTile->getHeight();
-      
-      theBlankTile->setOrigin(tileRect.ul());
-      theBlankTile->setWidthHeight(w, h);
-      theTile->setWidthHeight(w, h);
-      theTile->setOrigin(tileRect.ul());
-      if( (tw*th) != (w*h))
-      {
-         theTile->initialize();
-      }
-      else
-      {
-         theTile->makeBlank();
-      }
-      
-      if((imageData->getNumberOfBands()==3)&&
-         (imageData->getScalarType()==OSSIM_NORMALIZED_FLOAT)&&
-         (imageData->getDataObjectStatus()!=OSSIM_NULL))
-      {
-         ossim_uint8* outputBands[3];
-         float* inputBands[3];
-         outputBands[0] = static_cast<ossim_uint8*>(theTile->getBuf(0));
-         outputBands[1] = static_cast<ossim_uint8*>(theTile->getBuf(1));
-         outputBands[2] = static_cast<ossim_uint8*>(theTile->getBuf(2));
-         inputBands[0] = static_cast<float*>(imageData->getBuf(0));
-         inputBands[1] = static_cast<float*>(imageData->getBuf(1));
-         inputBands[2] = static_cast<float*>(imageData->getBuf(2));
-         
-         long height = imageData->getHeight();
-         long width  = imageData->getWidth();
-         long offset = 0;
-         for(long row = 0; row < height; ++row)
-         {
-            for(long col = 0; col < width; ++col)
-            {
-               ossimHsvVector hsv(inputBands[0][offset],
-                                  inputBands[1][offset],
-                                  inputBands[2][offset]);
-               
-               ossimRgbVector rgb(hsv);
-
-               outputBands[0][offset] = rgb.getR();
-               outputBands[1][offset] = rgb.getG();
-               outputBands[2][offset] = rgb.getB();
-
-               ++offset;
-            }
-         }
-      }
-      else
-      {
-         return imageData;
-      }
-      theTile->validate();
-      return theTile;
-   }
-   
-   return theBlankTile;
-}
-
-void ossimHsvToRgbSource::initialize()
-{
-   theBlankTile = NULL;
-   theTile      = NULL;
-}
-
-void ossimHsvToRgbSource::allocate()
-{
-   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile = (ossimImageData*)theBlankTile->dup();
-   theTile->initialize();
-}
-
-ossimScalarType ossimHsvToRgbSource::getOutputScalarType() const
-{
-   return OSSIM_UINT8;
-}
-
-double ossimHsvToRgbSource::getNullPixelValue()const
-{
-   return 0;
-}
-
-double ossimHsvToRgbSource::getMinPixelValue(ossim_uint32 /* band */)const
-{
-   return OSSIM_DEFAULT_MIN_PIX_UCHAR;
-}
-
-double ossimHsvToRgbSource::getMaxPixelValue(ossim_uint32 /* band */)const
-{
-   return OSSIM_DEFAULT_MAX_PIX_UCHAR;
-}  
-
diff --git a/ossim/src/ossim/imaging/ossimIgenGenerator.cpp b/ossim/src/ossim/imaging/ossimIgenGenerator.cpp
deleted file mode 100644
index 8416e00..0000000
--- a/ossim/src/ossim/imaging/ossimIgenGenerator.cpp
+++ /dev/null
@@ -1,682 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimIgenGenerator.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimIgenGenerator.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/imaging/ossimGeoPolyCutter.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimUsgsQuad.h>
-
-void ossimIgenGenerator::generateSpecList(bool outputToFileFlag)
-{
-   if(theTilingFlag&&
-      (theTileSpacingUnits!=OSSIM_UNIT_UNKNOWN)&&
-      (!theTileSpacing.hasNans()))
-   {
-      generateTiledSpecList(outputToFileFlag);
-   }
-   else
-   {
-      generateNoTiledSpecList(outputToFileFlag);
-   }
-   
-}
-
-void ossimIgenGenerator::getImageFilenamesFromSpecList(std::vector<ossimFilename>& filenameList)
-{
-   if(!theSpecList.size())
-   {
-      generateSpecList();
-   }
-   if(theSpecList.size())
-   {
-      filenameList.clear();
-      for(ossim_uint32 i = 0; i < theSpecList.size(); ++i)
-      {
-         const char* filename = theSpecList[i].find("object2.",  ossimKeywordNames::FILENAME_KW);
-
-         if(filename)
-         {
-            filenameList.push_back(ossimFilename(filename));
-         }
-         else
-         {
-            filenameList.clear();
-            return;
-         }
-      }
-   }
-   
-}
-
-ossimGrect ossimIgenGenerator::getBoundingGround()const
-{
-   return ossimGrect(theOutputGeoPolygon[0],
-                     theOutputGeoPolygon[1],
-                     theOutputGeoPolygon[2],
-                     theOutputGeoPolygon[3]);
-}
-
-void ossimIgenGenerator::executeSpecList()
-{
-}
-
-void ossimIgenGenerator::setInput(ossimConnectableObject* input)
-{
-   theSpecList.clear();
-   generateInputKwl(input);
-   ossimImageSource* inputInterface = PTR_CAST(ossimImageSource,
-                                                        input);
-   if(inputInterface)
-   {
-      theInputBoundingRect = inputInterface->getBoundingRect();
-   }
-}
-
-
-void ossimIgenGenerator::generateChainForMultiInput(ossimConnectableObject* connectable)
-{
-   std::stack<ossimConnectableObject*> aStack;
-
-   generateChainForMultiInputRecurse(aStack, connectable);
-
-   ossim_int32 objectIndex = 1;
-   while(!aStack.empty())
-   {
-      ossimConnectableObject* current = aStack.top();
-      aStack.pop();
-      ossimString prefix = ossimString("object") + ossimString::toString(objectIndex) + ".";
-
-      current->saveState(theInputKwl, prefix.c_str());
-
-      ++objectIndex;
-   }
-   theInputKwl.add("type",
-                   "ossimImageChain",
-                   true);
-   
-}
-
-void ossimIgenGenerator::generateChainForMultiInputRecurse(std::stack<ossimConnectableObject*>& aStack,
-                                                           ossimConnectableObject* connectable)
-{
-   
-
-   if(connectable)
-   {
-      aStack.push(connectable);
-      for(ossim_uint32 i = 0; i < connectable->getNumberOfInputs(); ++i)
-      {
-         generateChainForMultiInputRecurse(aStack,
-                                           connectable->getInput(i));
-      }
-   }   
-}
-
-
-ossimProjection* ossimIgenGenerator::createProductProjection()const
-{
-   return ossimProjectionFactoryRegistry::instance()->createProjection(theViewKwl);
-}
-
-ossimObject* ossimIgenGenerator::createOutput()const
-{
-   return ossimObjectFactoryRegistry::instance()->createObject(theOutputKwl);
-}
-
-ossimObject* ossimIgenGenerator::createInput()const
-{
-   return ossimObjectFactoryRegistry::instance()->createObject(theInputKwl);
-}
-
-void ossimIgenGenerator::generateInputKwl(ossimConnectableObject* connectable)
-{
-   theInputKwl.clear();
-   if(connectable)
-   {
-      // if it has at least one non null input
-      // then  we must build a chain and save it out
-      if(connectable->getInput())
-      {
-         generateChainForMultiInput(connectable);
-      }
-      else // it is a single input
-      {
-         connectable->saveState(theInputKwl);
-      }
-   }
-}
-
-void ossimIgenGenerator::generateOutputKwl(ossimConnectableObject* connectable)
-{
-   theOutputKwl.clear();
-   if(connectable)
-   {
-      connectable->saveState(theOutputKwl);
-   }
-}
-
-void ossimIgenGenerator::generateViewKwl(ossimObject* view)
-{
-   theViewKwl.clear();
-   if(view)
-   {
-      view->saveState(theViewKwl);
-   }
-}
-   
-void ossimIgenGenerator::setDefaultOutput()
-{
-   
-}
-
-void ossimIgenGenerator::generateTiledSpecList(bool outputToFileFlag)
-{
-   theSpecList.clear();
-   theSpecFileList.clear();
-   ossimDpt spacing = theTileSpacing;
-
-   switch(theTileSpacingUnits)
-   {
-      case OSSIM_MINUTES:
-      {
-         spacing.x /= 60;
-         spacing.y /= 60;
-         generateGeoTiledSpecList(spacing, outputToFileFlag);
-         break;
-      }
-      case OSSIM_SECONDS:
-      {
-         spacing.x /= 3600;
-         spacing.y /= 3600;
-         generateGeoTiledSpecList(spacing, outputToFileFlag);
-         break;
-      }
-      case OSSIM_DEGREES:
-      {
-         generateGeoTiledSpecList(spacing, outputToFileFlag);
-         break;
-      }
-      case OSSIM_PIXEL:
-      {
-         generatePixelTiledSpecList(outputToFileFlag);
-         break;
-      }
-      default:
-         break;
-   }
-}
-
-void ossimIgenGenerator::generatePixelTiledSpecList(bool outputToFileFlag)
-{
-   ossimRefPtr<ossimProjection> proj = createProductProjection();
-
-   if((!proj)||(theOutputGeoPolygon.size() != 4))
-   {
-      return;
-   }
-   
-   ossimIrect inputRect = getInputBoundingRect();
-   inputRect.stretchToTileBoundary(theTileSpacing);
-   ossimGeoPolygon tempPoly;
-   ossimObject* obj = createInput();
-   ossimImageChain* chain = PTR_CAST(ossimImageChain,
-                                     obj);
-   ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
-   chain->add(cutter);
-   
-   ossimKeywordlist kwl;
-   ossimFilename outfile = theOutputKwl.find(ossimKeywordNames::FILENAME_KW);
-   
-   if(outfile == "")
-   {
-      cerr << "Valid filename not given, returning!" << endl;
-   }
-   
-   kwl.add("object2.", theOutputKwl, true);
-   kwl.add("product.projection.",theViewKwl, true);
-   addPixelType(kwl, "product.");   
-   ossimDpt p1;
-   ossimDpt p2;
-   ossimDpt p3;
-   ossimDpt p4;
-
-   
-   proj->worldToLineSample(theOutputGeoPolygon[0], p1);
-   proj->worldToLineSample(theOutputGeoPolygon[1], p2);
-   proj->worldToLineSample(theOutputGeoPolygon[2], p3);
-   proj->worldToLineSample(theOutputGeoPolygon[3], p4);
-
-   ossimIrect bounds(p1, p2, p3, p4);
-   if(inputRect.completely_within(bounds))
-   {
-      inputRect = bounds;
-   }
-
-   bounds.stretchToTileBoundary(theTileSpacing);
-   
-   ossim_sint32 i = 1;
-   for(ossim_sint32 ulY = bounds.ul().y; ulY < bounds.lr().y; ulY+=(ossim_sint32)theTileSpacing.y)
-   {
-      for(ossim_sint32 ulX = bounds.ul().x; ulX < bounds.lr().x; ulX+=(ossim_sint32)theTileSpacing.x)
-      {
-         ossimDrect rect(ulX,
-                         ulY,
-                         ulX + (theTileSpacing.x - 1),
-                         ulY + (theTileSpacing.y - 1));
-         ossimGpt gpt1;
-         ossimGpt gpt2;
-         ossimGpt gpt3;
-         ossimGpt gpt4;
-
-         proj->lineSampleToWorld(rect.ul(), gpt1);
-         proj->lineSampleToWorld(rect.ur(), gpt2);
-         proj->lineSampleToWorld(rect.lr(), gpt3);
-         proj->lineSampleToWorld(rect.ll(), gpt4);
-         
-         tempPoly.clear();
-         tempPoly.addPoint(gpt1);
-         tempPoly.addPoint(gpt2);
-         tempPoly.addPoint(gpt3);
-         tempPoly.addPoint(gpt4);
-         addPadding(tempPoly, tempPoly);
-         cutter->setPolygon(tempPoly);
-         chain->saveState(kwl, "object1.");
-         
-         ossimFilename specName(theSpecFileLocation);
-         specName = specName.dirCat(ossimFilename("igen" + ossimString::toString(i) + ".spec"));
-         ossimFilename tilename = outfile.path();
-         if(theTileNamingConvention == "id")
-         {
-            int tileId = getTileId(inputRect, ossimDpt(ulX+theTileSpacing.x/2, ulY+theTileSpacing.y/2), theTileSpacing);
-            tilename = tilename.dirCat(ossimFilename(outfile.fileNoExtension() + "_" +
-                                                     ossimString::toString(tileId)));
-            tilename.setExtension(outfile.ext());
-         }
-         
-         kwl.add("object2.",
-                 ossimKeywordNames::FILENAME_KW,
-                 tilename,
-                 true);
-         kwl.add("object2.input_connection1",
-                 kwl.find("object1.id"),
-                 true);
-         theSpecFileList.push_back(specName);
-         if(outputToFileFlag)
-         {
-            kwl.write(specName.c_str());
-         }
-         else
-         {
-            theSpecList.push_back(kwl);
-         }
-         i++;
-      }
-   }
-}
-
-void ossimIgenGenerator::generateGeoTiledSpecList(const ossimDpt& spacing, bool outputToFileFlag)
-{
-   ossimRefPtr<ossimProjection> proj = createProductProjection();
-   if((proj.valid())&&(theOutputGeoPolygon.size() == 4))
-   {
-      ossimDrect rect;
-
-      ossimIrect inputRect = getInputBoundingRect();
-      ossimGpt gpt1;
-      ossimGpt gpt2;
-      ossimGpt gpt3;
-      ossimGpt gpt4;
-      proj->lineSampleToWorld(inputRect.ul(), gpt1);
-      proj->lineSampleToWorld(inputRect.ur(), gpt2);
-      proj->lineSampleToWorld(inputRect.lr(), gpt3);
-      proj->lineSampleToWorld(inputRect.ll(), gpt4);
-
-      ossimDrect inputGroundRect(gpt1,
-                                 gpt2,
-                                 gpt3,
-                                 gpt4,
-                                 OSSIM_RIGHT_HANDED);
-      
-      rect = ossimDrect(theOutputGeoPolygon[0],
-                        theOutputGeoPolygon[1],
-                        theOutputGeoPolygon[2],
-                        theOutputGeoPolygon[3],
-                        OSSIM_RIGHT_HANDED);
-
-      rect.stretchToTileBoundary(spacing);
-      inputGroundRect.stretchToTileBoundary(spacing);
-      double ulLat = rect.ul().lat;
-      double ulLon = rect.ul().lon;
-      ossimGeoPolygon tempPoly;
-      ossimObject* obj = createInput();
-      ossimImageChain* chain = PTR_CAST(ossimImageChain,
-                                        obj);
-      ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
-      chain->add(cutter);
-      
-      ossimKeywordlist kwl;
-      ossimFilename outfile = theOutputKwl.find(ossimKeywordNames::FILENAME_KW);
-
-      if(outfile == "")
-      {
-         cerr << "Valid filename not given, returning!" << endl;
-      }
-      
-      kwl.add("object2.", theOutputKwl, true);
-      kwl.add("object2.input_connection1",
-              kwl.find("object1.id"),
-              true);
-      kwl.add("product.projection.",theViewKwl, true);
-      addPixelType(kwl, "product.");   
-      int i = 1;
-      int row = 0;
-      int col = 0;
-      //      int tileId = 0;
-      while(ulLat > rect.ll().lat)
-      {
-         ulLon = rect.ul().lon;
-         col = 0;
-         while(ulLon < rect.ur().lon)
-         {
-            tempPoly.clear();
-            tempPoly.addPoint(ulLat, ulLon, ossim::nan(), theOutputGeoPolygon[0].datum());
-            tempPoly.addPoint(ulLat, ulLon+spacing.lon, ossim::nan(), theOutputGeoPolygon[0].datum());
-            tempPoly.addPoint(ulLat-spacing.lat, ulLon+spacing.lon, ossim::nan(), theOutputGeoPolygon[0].datum());
-            tempPoly.addPoint(ulLat-spacing.lat, ulLon, ossim::nan(), theOutputGeoPolygon[0].datum());
-            
-            addPadding(tempPoly, tempPoly);
-            cutter->setPolygon(tempPoly);
-            chain->saveState(kwl, "object1.");
-
-            ossimFilename specName(theSpecFileLocation);
-            specName = specName.dirCat(ossimFilename("igen" + ossimString::toString(i) + ".spec"));
-	    ossimFilename tilename = outfile.path();
-	    if(theTileNamingConvention == "id")
-	      {
-		int tileId = getTileId(inputGroundRect, ossimDpt(ulLon, ulLat), spacing);
-		tilename = tilename.dirCat(ossimFilename(outfile.fileNoExtension() + "_" +
-							 ossimString::toString(tileId)));
-		tilename.setExtension(outfile.ext());
-	      }
-	    else
-	      {
-                 ossimUsgsQuad quad(ossimGpt(ulLat - (spacing.x), ulLon+(spacing.x), 0.0));
-                 if(spacing.x == 7.5/60.0)
-                 {
-                    tilename = tilename.dirCat(ossimFilename(quad.quarterQuadName().downcase().trim()));
-                 }
-                 else
-                 {
-                    tilename = tilename.dirCat(ossimFilename(quad.quarterQuadSegName().downcase().trim()));
-                 }
-                 
-                 tilename.setExtension(outfile.ext());
-	      }
-
-	    kwl.add("object2.",
-		    ossimKeywordNames::FILENAME_KW,
-		    tilename,
-		    true);
-            kwl.add("object2.input_connection1",
-                    kwl.find("object1.id"),
-                    true);
-            theSpecFileList.push_back(specName);
-            if(outputToFileFlag)
-            {
-               kwl.write(specName.c_str());
-            }
-            else
-            {
-               theSpecList.push_back(kwl);
-            }
-            ulLon += spacing.lon;
-            ++i;
-            ++col;
-         }
-         ++row;
-         ulLat -= spacing.lat;
-      }
-
-   }   
-}
-
-
-void ossimIgenGenerator::generateNoTiledSpecList(bool outputToFileFlag)
-{
-   theSpecList.clear();
-   theSpecFileList.clear();
-   
-   if(theViewKwl.getSize()&&
-      theInputKwl.getSize()&&
-      theOutputKwl.getSize())
-   {
-      ossimKeywordlist kwl;
-      if(theOutputGeoPolygon.size())
-      {
-         ossimRefPtr<ossimObject> obj = createInput();
-         ossimRefPtr<ossimImageChain> chain = PTR_CAST(ossimImageChain,
-                                                       obj.get());
-         if(chain.valid())
-         {
-            ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
-            
-            cutter->setPolygon(theOutputGeoPolygon);
-            
-            chain->add(cutter);
-            chain->saveState(kwl, "object1.");
-         }
-         else
-         {
-            kwl.add("object1.",theInputKwl, true);
-         }
-         obj = 0;
-      }
-      else
-      {
-         kwl.add("object1.",theInputKwl, true);
-      }
-      kwl.add("object2.", theOutputKwl, true);
-      kwl.add("object2.input_connection1",
-              kwl.find("object1.id"),
-              true);
-      kwl.add("product.projection.",theViewKwl, true);
-      addPixelType(kwl, "product.");   
-
-      ossimFilename specName(theSpecFileLocation +
-                             "/"+
-                             "igen1.spec");
-      
-      theSpecFileList.push_back(specName);
-      if(outputToFileFlag)
-      {
-         kwl.write(specName.c_str());
-      }
-      else
-      {
-         theSpecList.push_back(kwl);
-      }
-      
-      kwl.clear();
-   }
-}
-
-int ossimIgenGenerator::getTileId(const ossimDrect& rect,
-				  const ossimDpt& currentPt,
-				  const ossimDpt& spacing)const
-{
-   ossimDpt ul(rect.ul());
-   
-   double relY = fabs(ul.y - currentPt.y);
-   double relX = fabs(ul.x - currentPt.x);
-   
-   
-   ossim_int32 spacingY           = (ossim_int32)(relY/spacing.y);
-   ossim_int32 spacingX           = (ossim_int32)(relX/spacing.x);
-   ossim_int32 maxHorizontalTiles = (ossim_int32)( (rect.width()-1)/spacing.x);
-   
-   return spacingY*maxHorizontalTiles + spacingX;
-}
-
-
-ossimIrect ossimIgenGenerator::getInputBoundingRect()const
-{
-   ossimRefPtr<ossimObject> obj = createInput();
-   ossimImageSource* inter = PTR_CAST(ossimImageSource, obj.get());
-   ossimIrect result;
-
-   result.makeNan();
-   if(inter)
-   {
-      result = inter->getBoundingRect();
-   }
-   return result;
-}
-
-void ossimIgenGenerator::addPadding(ossimGeoPolygon& output,
-                                    const ossimGeoPolygon& input)const
-{
-   output = input;
-   switch(theTilePaddingUnits)
-   {
-      case OSSIM_PIXEL:
-      {
-         ossimRefPtr<ossimProjection> proj = createProductProjection();
-         if(proj.valid())
-         {
-            ossimDpt ul;
-            ossimDpt ur;
-            ossimDpt lr;
-            ossimDpt ll;
-
-            if(input.getOrdering() == OSSIM_CLOCKWISE_ORDER)
-            {
-               proj->worldToLineSample(input[0], ul);
-               proj->worldToLineSample(input[1], ur);
-               proj->worldToLineSample(input[2], lr);
-               proj->worldToLineSample(input[3], ll);
-            }
-            else
-            {
-               proj->worldToLineSample(input[0], ul);
-               proj->worldToLineSample(input[1], ll);
-               proj->worldToLineSample(input[2], lr);
-               proj->worldToLineSample(input[3], ur);
-            
-            }
-            
-            ul -= theTilePadding;
-            ur += ossimDpt(theTilePadding.x,
-                           -theTilePadding.y);
-            lr += theTilePadding;
-            ll += ossimDpt(-theTilePadding.x,
-                           theTilePadding.y);
-
-            proj->lineSampleToWorld(ul, output[0]);
-            proj->lineSampleToWorld(ur, output[1]);
-            proj->lineSampleToWorld(lr, output[2]);
-            proj->lineSampleToWorld(ll, output[3]);
-
-            output.setOrdering(OSSIM_CLOCKWISE_ORDER);
-         
-         }
-         break;
-      }
-      case OSSIM_DEGREES:
-      case OSSIM_MINUTES:
-      case OSSIM_SECONDS:
-      {
-         ossimGpt ul;
-         ossimGpt ur;
-         ossimGpt lr;
-         ossimGpt ll;
-         ossimDpt spacing = theTilePadding;
-
-         if(theTilePaddingUnits==OSSIM_MINUTES)
-         {
-            spacing.x /= 60;
-            spacing.y /= 60;
-         }
-         else if(theTilePaddingUnits==OSSIM_MINUTES)
-         {
-            spacing.x /= 3600;
-            spacing.y /= 3600;
-         }
-      
-         if(input.getOrdering() == OSSIM_CLOCKWISE_ORDER)
-         {
-            ul = input[0];
-            ur = input[1];
-            lr = input[2];
-            ll = input[3];
-         }
-         else
-         {
-            ul = input[0];
-            ll = input[1];
-            lr = input[2];
-            ur = input[3];
-         }
-         ul.lat += spacing.lat;
-         ul.lon -= spacing.lon;
-         ur.lat += spacing.lat;
-         ur.lon += spacing.lon;
-         lr.lat -= spacing.lat;
-         lr.lon += spacing.lon;
-         ll.lat -= spacing.lat;
-         ll.lon -= spacing.lon;
-
-         output[0] = ul;
-         output[1] = ur;
-         output[2] = lr;
-         output[3] = ll;
-         output.setOrdering(OSSIM_CLOCKWISE_ORDER);
-      
-         break;
-      }
-      case OSSIM_METERS:
-      {
-         break;
-      }
-      default:
-         break;
-   }
-}
-
-void ossimIgenGenerator::addPixelType(ossimKeywordlist& kwl, const char* prefix)
-{
-   if(thePixelType == OSSIM_PIXEL_IS_POINT)
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::PIXEL_TYPE_KW,
-              "PIXEL_IS_POINT",
-              true);
-   }
-   else
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::PIXEL_TYPE_KW,
-              "PIXEL_IS_AREA",
-              true);
-   }
-}
-
-void ossimIgenGenerator::setOutput(const ossimKeywordlist& kwl)
-{
-   theOutputKwl.clear();
-
-   theOutputKwl = kwl;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageCacheBase.cpp b/ossim/src/ossim/imaging/ossimImageCacheBase.cpp
deleted file mode 100644
index 1be233a..0000000
--- a/ossim/src/ossim/imaging/ossimImageCacheBase.cpp
+++ /dev/null
@@ -1,662 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Mingjie Su
-//
-//********************************************************************
-// $Id: ossimImageCacheBase.cpp 2685 2011-06-07 16:24:41Z david.burken $
-#include <algorithm>
-using namespace std;
-
-#include <ossim/imaging/ossimImageCacheBase.h>
-
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/support_data/ossimRpfFrame.h>
-#include <ossim/support_data/ossimRpfToc.h>
-#include <ossim/support_data/ossimRpfTocEntry.h>
-#include <ossim/support_data/ossimRpfCompressionSection.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimCylEquAreaProjection.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimPolygon.h>
-
-static ossimTrace traceDebug = ossimTrace("ossimImageCacheBase:debug");
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimImageCacheBase.cpp 2685 2011-06-07 16:24:41Z david.burken $";
-#endif
-
-RTTI_DEF1(ossimImageCacheBase, "ossimImageCacheBase", ossimImageHandler)
-
-ossimImageCacheBase::ossimImageCacheBase()
-   :
-   ossimImageHandler(),
-   m_actualImageRect(),
-   m_numberOfLines(0),
-   m_numberOfSamples(0),
-   m_numberOfBands(0),
-   m_fileNames(),
-   m_tileSize(128, 128),
-   m_workFrame(new ossimRpfFrame),
-   m_bBox_LL_Lon(0.0),
-   m_bBox_LL_Lat(0.0),
-   m_bBox_UR_Lon(0.0),
-   m_bBox_UR_Lat(0.0),
-   m_numOfFramesVertical(0),
-   m_numOfFramesHorizontal(0),
-   m_frame_width(0),
-   m_frame_height(0),
-   m_frameEntryArray()
-{
-  if (traceDebug())
-  {
-    ossimNotify(ossimNotifyLevel_DEBUG)
-      << "ossimImageCacheBase::ossimImageCacheBase entered...\n";
-#ifdef OSSIM_ID_ENABLED
-    ossimNotify(ossimNotifyLevel_DEBUG)
-      << "OSSIM_ID:  " << OSSIM_ID << "\n";
-#endif      
-  }
-
-  m_actualImageRect.makeNan();
-
-}
-
-ossimImageCacheBase::~ossimImageCacheBase()
-{
-  if(m_workFrame)
-  {
-    delete m_workFrame;
-    m_workFrame = 0;
-  }
-  close();
-}
-
-void ossimImageCacheBase::close()
-{
-  deleteAll();
-}
-
-bool ossimImageCacheBase::isOpen()const
-{
-  //return (theTableOfContents!=0);
-  ossimString ext = theImageFile.ext().downcase();
-
-  if(ext == "rpf")
-  {
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-bool ossimImageCacheBase::buildFrameEntryArray(ossimFilename imageFile, 
-                                               ossim_uint32 frameWidth, 
-                                               ossim_uint32 frameHeight)
-{
-   static const char MODULE[] = "ossimImageCacheBase::buildFrameEntryArray";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
-   }
-
-   // use to check if tiles have overlap pixels
-   ossim_float64 avgLat = 0.0;
-   ossim_float64 avgLon = 0.0;
-
-   m_frame_width = frameWidth;
-   m_frame_height = frameHeight;
-
-   std::ifstream in((imageFile).c_str() );
-   
-   std::string line;
-   ossim_uint32 index = 0; // used throughout
-   while( in.good() )
-   {
-      // Read in a line.
-      std::getline(in, line);
-
-      ossimString tmpStr = ossimString(line);
-      if (!tmpStr.empty())
-      {
-         if (index == 0)
-         {
-            std::vector<ossimString> box_lat_lon;
-            tmpStr.split(box_lat_lon, "|");
-            
-            if (box_lat_lon.size() > 2)
-            {
-               std::vector<ossimString> ll;
-               std::vector<ossimString> ur;
-               
-               box_lat_lon[0].split(ll, ",");
-               box_lat_lon[1].split(ur, ",");
-               ossimString bandStr = box_lat_lon[2];
-               
-               m_bBox_LL_Lon = ll[0].toFloat64();
-               m_bBox_LL_Lat = ll[1].toFloat64();
-               m_bBox_UR_Lon = ur[0].toFloat64();
-               m_bBox_UR_Lat = ur[1].toFloat64();
-               
-               checkLongitude(m_bBox_LL_Lon, m_bBox_UR_Lon);
-               
-               m_numberOfBands = ossimString(bandStr).toInt32();
-            }
-            else
-            {
-               return false;
-            }
-         }
-         else if (index == 1)
-         {
-            m_fileNames.push_back(tmpStr);
-            std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
-            if (frame_lat_lon.size() > 2)
-            {
-               ossimString ll_lon_lat = frame_lat_lon[1];
-               ossimString ur_lon_lat = frame_lat_lon[2];
-               ossim_float64 ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
-               ossim_float64 ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
-               ossim_float64 ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
-               ossim_float64 ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
-
-               checkLongitude(ll_lon, ur_lon);
-               
-               ossim_float64 bBox_lat_diff = std::fabs(m_bBox_UR_Lat - m_bBox_LL_Lat);
-               ossim_float64 bBox_lon_diff = std::fabs(m_bBox_UR_Lon - m_bBox_LL_Lon);
-               
-               ossim_float64 lat_diff = std::fabs(ur_lat - ll_lat);
-               ossim_float64 lon_diff = std::fabs(ur_lon - ll_lon);
-               
-               m_numOfFramesVertical   = static_cast<ossim_uint32>(bBox_lat_diff/lat_diff + 0.5);
-               m_numOfFramesHorizontal = static_cast<ossim_uint32>(bBox_lon_diff/lon_diff + 0.5);
-
-               avgLon = std::fabs(bBox_lon_diff/m_numOfFramesHorizontal);
-               avgLat = std::fabs(bBox_lat_diff/m_numOfFramesVertical);
-               
-               m_numberOfLines   = m_numOfFramesVertical*m_frame_height;
-               m_numberOfSamples = m_numOfFramesHorizontal*m_frame_width;
-
-               if ( traceDebug() )
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << "\nscene height in degrees: " << bBox_lat_diff
-                     << "\nscene width in degrees:  " << bBox_lon_diff
-                     << "\nframe height in degrees: " << lat_diff
-                     << "\nframe width in degrees:  " << lon_diff
-                     << "\nframes vertical:         " << m_numOfFramesVertical
-                     << "\nframes horizontal:       " << m_numOfFramesHorizontal
-                     << "\nlines:                   " << m_numberOfLines
-                     << "\nsamples:                 " << m_numberOfSamples << "\n";
-               }
-            }
-            else
-            {
-               return false;
-            }
-         }
-         else
-         {
-            m_fileNames.push_back(tmpStr);
-         }
-         
-      } // matches: if (!tmpStr.empty())
-      
-      ++index;
-      
-   } // matches: while( in.good() )
-   in.close();
-
-   m_frameEntryArray.resize(m_numOfFramesVertical);
-   for(index = 0; index < m_frameEntryArray.size(); ++index)
-   {
-      m_frameEntryArray[index].resize(m_numOfFramesHorizontal);
-   }
-
-   for(index = 0; index < m_fileNames.size(); ++index)
-   {
-      ossimString tmpStr = m_fileNames[index];
-      std::vector<ossimString> frameInfos = tmpStr.split("|");
-      if (frameInfos.size() > 1)
-      {
-         ossimString fileName = frameInfos[0];
-         ossimString ll_lon_lat = frameInfos[1];
-         ossimString ur_lon_lat = frameInfos[2];
-         double ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
-         double ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
-         double ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
-         double ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
-         
-         checkLongitude(ll_lon, ur_lon);
-         
-         ossim_float64 tmpColPostion = std::fabs(ll_lon - m_bBox_LL_Lon);
-         ossim_float64 tmpFrameLon = std::fabs(ur_lon - ll_lon);
-
-         if (std::fabs(tmpFrameLon - avgLon) > 0.002)
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << fileName << " has overlap pixels with other image." << std::endl;
-            return false;
-         }
-         
-         ossim_float64 tmpRowPostion = std::fabs(m_bBox_UR_Lat - ur_lat);
-         ossim_float64 tmpFrameLat = std::fabs(ur_lat - ll_lat);
-
-         if (std::fabs(tmpFrameLat - avgLat) > 0.002)
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << fileName << " has overlap pixels with other image." << std::endl;
-            return false;
-         }
-         
-         ossim_uint32 colNum = static_cast<ossim_uint32>(tmpColPostion/tmpFrameLon + 0.5);
-         ossim_uint32 rowNum = static_cast<ossim_uint32>(tmpRowPostion/tmpFrameLat + 0.5);
-         
-         if (colNum >= m_numOfFramesHorizontal)
-         {
-            colNum = m_numOfFramesHorizontal-1; // Clamp to last column.
-         }
-         
-         if (rowNum >= m_numOfFramesVertical)
-         {
-            rowNum = m_numOfFramesVertical-1; // Clamp to last row.
-         }
-
-         ossimRpfFrameEntry tempEntry;
-         tempEntry.setEntry(ossimFilename(""), fileName);
-         m_frameEntryArray[rowNum][colNum] = tempEntry;
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-   return true;
-}
-
-void ossimImageCacheBase::checkLongitude(ossim_float64& leftLon,
-                                             const ossim_float64& rightLon) const
-{
-   //---
-   // Test for scene coordinates being 180 to 180 and adjust leftLon to -180
-   // if so.
-   //
-   // NOTE:
-   // Setting tolerance to 1/7200 about 15 meters.
-   // Not sure if this is too loose or not. (drb)
-   //---
-   const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
-
-   if ( ossim::almostEqual(leftLon, 180.0, TOLERANCE) )
-   {
-      if ( ossim::almostEqual(rightLon, 180.0, TOLERANCE) )
-      {
-         leftLon = -180.0;
-      }
-   }
-}
-
-ossim_uint32 ossimImageCacheBase::getNumberOfInputBands()const
-{
-   return m_numberOfBands;
-}
-
-ossim_uint32 ossimImageCacheBase::getNumberOfOutputBands()const
-{
-  return m_numberOfBands;
-}
-
-ossim_uint32 ossimImageCacheBase::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return m_numberOfLines;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfLines(reduced_res_level);
-   }
-   
-   return 0;
-}
-
-ossim_uint32 ossimImageCacheBase::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return m_numberOfSamples;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfSamples(reduced_res_level);
-   }
-   
-   return 0;
-}
-
-void ossimImageCacheBase::setActualImageRect()
-{
-   m_actualImageRect = ossimIrect(0,0,m_numberOfLines, m_numberOfSamples);
-}
-
-ossimIrect ossimImageCacheBase::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   return ossimIrect(0,                         // upper left x
-                     0,                         // upper left y
-                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
-                     getNumberOfLines(reduced_res_level)   - 1); // lower right y                     
-}
-
-
-
-ossim_uint32 ossimImageCacheBase::getTileWidth() const
-{
-   return m_tileSize.x;
-}
-
-ossim_uint32 ossimImageCacheBase::getTileHeight() const
-{
-   return m_tileSize.y;
-}
-
-void ossimImageCacheBase::getEntryList(std::vector<ossim_uint32>& entryList)const
-{
-   entryList.push_back(0);
-}
-
-bool ossimImageCacheBase::isValidRLevel(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return true;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->isValidRLevel(reduced_res_level);
-   }
-   else
-   {
-      return false;
-   }
-}
-
-vector<ossimImageCacheBase::ossimFrameEntryData> ossimImageCacheBase::getIntersectingEntries(const ossimIrect& rect)
-{
-   vector<ossimFrameEntryData> result;
-
-   // make sure we have the Toc entry to render
-   if(!isOpen()) return result;
-
-   ossimIrect imageRect = getImageRectangle();
-   if(rect.intersects(imageRect))
-   {
-      ossimIrect clipRect  = rect.clipToRect(imageRect);
-      ossimIrect frameRect(clipRect.ul().x/m_frame_width,
-                           clipRect.ul().y/m_frame_height,
-                           clipRect.lr().x/m_frame_width,
-                           clipRect.lr().y/m_frame_height);
-
-      for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
-      {
-         for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
-         {
-            ossimRpfFrameEntry tempEntry = m_frameEntryArray[row][col];
-            if(tempEntry.exists())
-            {
-               result.push_back(ossimFrameEntryData(row,
-                                                    col,
-                                                    row*m_frame_height,
-                                                    col*m_frame_width,
-                                                    tempEntry));
-            }
-         }
-      }
-   }
-
-   return result;
-}
-
-void ossimImageCacheBase::deleteAll()
-{
-   theOverview = 0;
-}
-
-bool ossimImageCacheBase::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)const
-{
-   bool result = ossimImageHandler::saveState(kwl, prefix);
-
-   return result;
-}
-
-bool ossimImageCacheBase::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   const char* MODULE = "ossimImageCacheBase::loadState";
-
-   if(traceDebug())
-   {
-      CLOG << "Entering..." << endl;
-   }
-   bool result = ossimImageHandler::loadState(kwl, prefix);
-
-   if(!result)
-   {
-      if(traceDebug())
-      {
-         CLOG << "Leaving..." << endl;
-      }
-      return false;
-   }
-   const char* lookup = 0;
-   lookup = kwl.find(ossimString(prefix), "entry");
-   ossim_int32 entry = ossimString(lookup).toInt32();
-
-   // if an entry is specified then
-   // call the open with an entry number
-   if(lookup)
-   {
-      if(traceDebug())
-      {
-         CLOG << "Leaving..." << endl;
-      }
-      result = ossimImageHandler::open(theImageFile);
-      setCurrentEntry(entry);
-      return result;
-   }
-
-   result = ossimImageHandler::open(theImageFile);
-
-   return result;
-}
-
-ossim_uint32 ossimImageCacheBase::getImageTileWidth() const
-{
-   return 256;
-}
-
-ossim_uint32 ossimImageCacheBase::getImageTileHeight() const
-{
-   return 256;
-}
-
-void ossimImageCacheBase::establishDecimationFactors()
-{
-   theDecimationFactors.clear();
-   
-   // Just needed to set the first R level here, the base class can do the rest:
-   ossimImageHandler::establishDecimationFactors();
-}
-
-ossimRefPtr<ossimImageGeometry> ossimImageCacheBase::getImageGeometry()
-{
-   if (theGeometry.valid()) return theGeometry;
-
-   // datum
-   // WGS 84
-   ossimKeywordlist kwl;
-   const char* prefix = 0; // legacy
-   kwl.add(prefix,
-      ossimKeywordNames::DATUM_KW,
-      "WGE",
-      true);   
-
-   ossimGpt ul(m_bBox_UR_Lat,m_bBox_LL_Lon);
-   ossimGpt ll(m_bBox_LL_Lat,m_bBox_LL_Lon);
-   ossimGpt ur(m_bBox_UR_Lat,m_bBox_UR_Lon);
-   ossimGpt lr(m_bBox_LL_Lat,m_bBox_UR_Lon);
-
-   double latInterval = fabs(ul.latd() - lr.latd())/ getNumberOfLines();
-   double lonInterval = fabs(ul.lond() - ur.lond())/ getNumberOfSamples();
-
-   kwl.add(prefix,
-      ossimKeywordNames::UL_LAT_KW,
-      ul.latd(),//-(latInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::UL_LON_KW,
-      ul.lond(),//+(lonInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::LL_LAT_KW,
-      ll.latd(),//+(latInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::LL_LON_KW,
-      ll.lond(),//+(lonInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::LR_LAT_KW,
-      lr.latd(),//+(latInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::LR_LON_KW,
-      lr.lond(),//-(lonInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::UR_LAT_KW,
-      ur.latd(),//-(latInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::UR_LON_KW,
-      ur.lond(),//-(latInterval/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::NUMBER_INPUT_BANDS_KW,
-      getNumberOfInputBands(),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
-      getNumberOfOutputBands(),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::NUMBER_LINES_KW,
-      getNumberOfLines(),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::NUMBER_SAMPLES_KW,
-      getNumberOfSamples(),
-      true);
-
-
-   //---
-   // Make a projection to get the easting / northing of the tie point and
-   // the scale in meters.  This will only be used by the CIB.
-   //---
-   kwl.add(prefix,
-      ossimKeywordNames::DATUM_KW,
-      "WGE",
-      true);
-
-   ossimGpt origin((ul.latd()+lr.latd())*.5,
-      (ul.lond()+lr.lond())*.5,
-      0.0);
-
-   double deltaLatPerPixel = latInterval;
-   double deltaLonPerPixel = lonInterval;
-
-   ossimDpt tie;
-
-   tie.lat = ul.latd() - deltaLatPerPixel/2.0;
-   tie.lon = ul.lond() + deltaLonPerPixel/2.0;
-
-   kwl.add(prefix, 
-      ossimKeywordNames::TIE_POINT_XY_KW,
-      tie.toString(),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-      deltaLatPerPixel,
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-      deltaLonPerPixel,
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::ORIGIN_LATITUDE_KW,
-      origin.latd(),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::CENTRAL_MERIDIAN_KW,
-      origin.lond(),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::TIE_POINT_LAT_KW,
-      ul.latd()-(deltaLatPerPixel/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::TIE_POINT_LON_KW,
-      ul.lond()+(deltaLonPerPixel/2.0),
-      true);
-
-   kwl.add(prefix,
-      ossimKeywordNames::TYPE_KW,
-      "ossimEquDistCylProjection",
-      true);
-
-   // Capture this for next time.
-   theGeometry = new ossimImageGeometry;
-   theGeometry->loadState(kwl, prefix);
-
-   // Set image things the geometry object should know about.
-   initImageParameters( theGeometry.get() ); 
-
-   return theGeometry;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimImageCacheTileSource.cpp b/ossim/src/ossim/imaging/ossimImageCacheTileSource.cpp
deleted file mode 100644
index 3cf83cf..0000000
--- a/ossim/src/ossim/imaging/ossimImageCacheTileSource.cpp
+++ /dev/null
@@ -1,438 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Mingjie Su   
-//
-//********************************************************************
-// $Id: ossimImageCacheTileSource.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-#include <algorithm>
-using namespace std;
-
-#include <ossim/imaging/ossimImageCacheTileSource.h>
-
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/support_data/ossimRpfFrame.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimPolygon.h>
-
-static ossimTrace traceDebug = ossimTrace("ossimImageCacheTileSource:debug");
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimImageCacheTileSource.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $";
-#endif
-
-RTTI_DEF1(ossimImageCacheTileSource, "ossimImageCacheTileSource", ossimImageCacheBase)
-
-ossimImageCacheTileSource::ossimImageCacheTileSource()
-   :
-   ossimImageCacheBase(),
-   m_tile(0),
-   m_imageHandler(0),
-   m_minPixelValue(ossim::nan()),
-   m_maxPixelValue(ossim::nan()),
-   m_nullPixelValue(ossim::nan())
-{
-}
-
-ossimImageCacheTileSource::~ossimImageCacheTileSource()
-{
-   if(m_imageHandler.valid())
-   {
-      m_imageHandler = 0;
-   }
-  close();
-}
-
-ossimString ossimImageCacheTileSource::getShortName()const
-{
-  return ossimString("ImageCache");
-}
-
-ossimString ossimImageCacheTileSource::getLongName()const
-{
-  return ossimString("ImageCache reader");
-}
-
-
-void ossimImageCacheTileSource::close()
-{
-  deleteAll();
-}
-
-bool ossimImageCacheTileSource::open()
-{
-  if(traceDebug())
-  {
-    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageCacheTileSource::open(): Entered....." << std::endl;
-  }
-
-  ossimFilename imageFile = theImageFile;
-  bool result = true;
-
-  if(isOpen() == false)
-  {
-    close();
-    result = false;
-  }
-
-  if(result)
-  {
-    if (m_fileNames.size() == 0 && m_frameEntryArray.size() == 0)
-    {
-      if (buildFrameEntryArray(imageFile) == false)
-      {
-        return false;
-      }
-    }
-
-    //---
-    // Adjust image rect so not to go over the -180 to 180 and -90 to 90
-    // bounds.
-    //---
-    setActualImageRect();
-
-    // Set the base class image file name.
-    theImageFile = imageFile;
-    m_tile = ossimImageDataFactory::instance()->create(this, this);
-    m_tile->initialize();
-    completeOpen();
-  }
-
-  if(traceDebug())
-  {
-    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageCacheTileSource::open(): Leaving at line" << __LINE__ << std::endl;
-  }
-
-  return result;
-}
-
-bool ossimImageCacheTileSource::buildFrameEntryArray(ossimFilename imageFile)
-{
-   static const char MODULE[] = "ossimImageCacheTileSource::buildFrameEntryArray";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
-   }
-
-   std::ifstream in((imageFile).c_str() );
-   std::string line;
-   ossim_uint32 index = 0; // used throughout
-   ossim_uint32 frameWidth = 0;
-   ossim_uint32 frameHeight = 0;
-   while( in.good() )
-   {
-      // Read in a line.
-      std::getline(in, line);
-      ossimString tmpStr = ossimString(line);
-      if (index == 0)
-      {
-         std::vector<ossimString> box_lat_lon;
-         tmpStr.split(box_lat_lon, "|");
-         if (box_lat_lon.size() == 4)
-         {
-            std::vector<ossimString> pixelInfos = box_lat_lon[3].split(",");
-            if (pixelInfos.size() == 3)
-            {
-               m_minPixelValue = ossimString::toFloat64(pixelInfos[0]);
-               m_maxPixelValue = ossimString::toFloat64(pixelInfos[1]);
-               m_nullPixelValue = ossimString::toFloat64(pixelInfos[2]);
-            }
-         }
-      }
-      else if (index == 1)
-      {
-         std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
-         ossimFilename firstFile = frame_lat_lon[0];
-         if(m_workFrame->parseFile(firstFile) == ossimErrorCodes::OSSIM_ERROR)
-         {
-            m_imageHandler = ossimImageHandlerRegistry::instance()->open(firstFile);
-            if (m_imageHandler.valid())
-            {
-               frameWidth = m_imageHandler->getBoundingRect().width();
-               frameHeight = m_imageHandler->getBoundingRect().height();
-               break;
-            }
-         }
-         else
-         {
-            return false;
-         }
-      }
-      ++index;
-   }
-   in.close();
-
-   return ossimImageCacheBase::buildFrameEntryArray(imageFile, frameWidth, frameHeight);
-}
-
-ossimRefPtr<ossimImageData> ossimImageCacheTileSource::getTile(
-  const  ossimIrect& rect, ossim_uint32 resLevel)
-{
-  if (m_tile.valid())
-  {
-    // Image rectangle must be set prior to calling getTile.
-    m_tile->setImageRectangle(rect);
-
-    if ( getTile( m_tile.get(), resLevel ) == false )
-    {
-      if (m_tile->getDataObjectStatus() != OSSIM_NULL)
-      {
-        m_tile->makeBlank();
-      }
-    }
-  }
-
-  return m_tile;
-}
-
-bool ossimImageCacheTileSource::getTile(ossimImageData* result,
-                                      ossim_uint32 resLevel)
-{
-   bool status = false;
-   
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()))
-   {
-      if ( resLevel > 0 )
-      {
-         status = getOverviewTile(resLevel, result);
-      }
-      
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-         
-         ossimIrect rect = result->getImageRectangle();
-         
-         ossimIrect imageRect = getImageRectangle();
-         
-         if ( rect.intersects(imageRect) )
-         {
-            //---
-            // Start with a blank tile in case there is not total coverage
-            // for rect.
-            //---
-            result->makeBlank();
-            
-            vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
-            if(frames.size() > 0)
-            {
-               //---
-               // Now lets render each frame.  Note we will have to find
-               // subframes
-               // that intersect the rectangle of interest for each frame.
-               //---
-               fillTile(rect, frames, result);
-               
-               // Revalidate tile status.
-               result->validate();
-            }
-         }
-         else
-         {
-            result->makeBlank();
-         }
-      }
-   }
-   return status;
-}
-
-void ossimImageCacheTileSource::fillTile(
-   const ossimIrect& tileRect,
-   const vector<ossimFrameEntryData>& framesInvolved,
-   ossimImageData* tile)
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < framesInvolved.size(); ++idx)
-   {
-      if (m_imageHandler.valid())
-      {
-         if (m_imageHandler->getFilename() != framesInvolved[idx].theFrameEntry.getFullPath())
-         {
-            m_imageHandler = 0;
-            m_imageHandler = ossimImageHandlerRegistry::instance()->open(framesInvolved[idx].theFrameEntry.getFullPath());
-         }
-      }
-      else
-      {
-         m_imageHandler = ossimImageHandlerRegistry::instance()->open(framesInvolved[idx].theFrameEntry.getFullPath());
-      }
-
-      if (m_imageHandler.valid())
-      {
-         if (m_imageHandler->isOpen() == false)
-         {
-            m_imageHandler->open(framesInvolved[idx].theFrameEntry.getFullPath());
-         }
-
-         ossimIrect frameRect(framesInvolved[idx].thePixelCol,
-            framesInvolved[idx].thePixelRow,
-            framesInvolved[idx].thePixelCol + m_frame_width  - 1,
-            framesInvolved[idx].thePixelRow + m_frame_height - 1);
-
-         ossimIrect clipRect = tileRect.clipToRect(frameRect);
-
-         ossimIpt tempDelta(clipRect.ul().x - framesInvolved[idx].thePixelCol,
-            clipRect.ul().y - framesInvolved[idx].thePixelRow);
-
-         ossimIrect offsetRect(tempDelta.x,
-            tempDelta.y,
-            tempDelta.x + clipRect.width()-1,
-            tempDelta.y + clipRect.height()-1);
-
-         //if the current image size is different from the default size, resample the image data
-         if ( ( m_imageHandler->getBoundingRect().width() != m_frame_width ) ||
-              ( m_imageHandler->getBoundingRect().height() != m_frame_height ) )
-         {
-
-            //calculate the ratio
-            ossim_float64 widthRatio = static_cast<ossim_float64>(m_imageHandler->getBoundingRect().width())/static_cast<ossim_float64>(m_frame_width);
-            ossim_float64 heightRatio = static_cast<ossim_float64>(m_imageHandler->getBoundingRect().height())/static_cast<ossim_float64>(m_frame_height);
-
-            //initialize the rect bounding for getting image data from image handler
-            ossimDpt ul(offsetRect.ul().x*widthRatio, offsetRect.ul().y*heightRatio);
-            ossimDpt lr(offsetRect.lr().x*widthRatio, offsetRect.lr().y*heightRatio);
-
-            //---
-            // Floor, ceil to avoid rect size of zero from ul, lr, delta being only fractional
-            // resulting in size of 0 if cast to an int or passed to ossim<int>::round().
-            //---
-            ossimIrect actualOffsetRect(static_cast<ossim_int32>(std::floor(ul.x)),
-                                        static_cast<ossim_int32>(std::floor(ul.y)),
-                                        static_cast<ossim_int32>(std::ceil(lr.x)),
-                                        static_cast<ossim_int32>(std::ceil(lr.y)));
-
-            //get accurate rect in case the actual rect is larger than the rect of image 
-            actualOffsetRect = actualOffsetRect.clipToRect(m_imageHandler->getBoundingRect());
-            
-            ossimRefPtr<ossimImageData> imageData = m_imageHandler->getTile(actualOffsetRect);
-            if (imageData.valid())
-            {
-               ossimFilterResampler* resampler = new ossimFilterResampler();
-               
-               double denominatorY = 1.0;
-               double denominatorX = 1.0;
-               if(clipRect.height() > 2) // Cannot be zero.
-               {
-                  denominatorY = clipRect.height()-1.0;
-               }
-               if(clipRect.width() > 2) // Cannot be zero.
-               {
-                  denominatorX = clipRect.width()-1.0;
-               }
-
-               //create a tile and set the rect size
-               ossimRefPtr<ossimImageData> tmpTile = (ossimImageData*)imageData->dup();
-               tmpTile->setImageRectangle(offsetRect);
-               tmpTile->makeBlank();
-
-               ossimDpt deltaUl(((actualOffsetRect.ll().x - actualOffsetRect.ul().x)/denominatorX),
-                                ((actualOffsetRect.ll().y - actualOffsetRect.ul().y)/denominatorY));
-               ossimDpt deltaUr(((actualOffsetRect.lr().x - actualOffsetRect.ur().x)/denominatorX),
-                                ((actualOffsetRect.lr().y - actualOffsetRect.ur().y)/denominatorY));
-               ossimDpt length(offsetRect.width(),offsetRect.height());
-               
-               //resample the image data
-               resampler->resample(imageData, 
-                                   tmpTile,
-                                   actualOffsetRect.ul(),
-                                   actualOffsetRect.ur(),
-                                   deltaUl,
-                                   deltaUr,
-                                   length);
-
-               tile->loadTile(tmpTile->getBuf(), clipRect, OSSIM_BSQ);
-
-               tmpTile = 0;
-               delete resampler;
-               resampler = 0;
-            }
-         }
-         else
-         {
-            ossimRefPtr<ossimImageData> imageData = m_imageHandler->getTile(offsetRect);
-            if (imageData.valid())
-            {
-               tile->loadTile(imageData->getBuf(), clipRect, OSSIM_BSQ);
-            }
-         }
-      }
-   }
-}
-
-ossimScalarType ossimImageCacheTileSource::getOutputScalarType() const
-{
-   if (m_imageHandler.valid())
-   {
-      return m_imageHandler->getOutputScalarType();
-   }
-   return OSSIM_UCHAR;
-}
-
-double ossimImageCacheTileSource::getMinPixelValue(ossim_uint32 band)const
-{
-   if (ossim::isnan(m_minPixelValue))
-   {
-      return ossimImageHandler::getMinPixelValue(band);
-   }
-   return m_minPixelValue;
-}
-
-double ossimImageCacheTileSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   if (ossim::isnan(m_maxPixelValue))
-   {
-      return ossimImageHandler::getMaxPixelValue(band);
-   }
-   return m_maxPixelValue;
-}
-
-double ossimImageCacheTileSource::getNullPixelValue(ossim_uint32 band)const
-{
-   if (ossim::isnan(m_nullPixelValue))
-   {
-      return ossimImageHandler::getNullPixelValue(band);
-   }
-   return m_nullPixelValue;
-}
-
-ossim_uint32 ossimImageCacheTileSource::getNumberOfInputBands()const
-{
-   if (m_imageHandler.valid())
-   {
-      return m_imageHandler->getNumberOfInputBands();
-   }
-   return m_numberOfBands;
-}
-
-ossim_uint32 ossimImageCacheTileSource::getNumberOfOutputBands()const
-{
-   if (m_imageHandler.valid())
-   {
-      return m_imageHandler->getNumberOfInputBands();
-   }
-   return m_numberOfBands;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageChain.cpp b/ossim/src/ossim/imaging/ossimImageChain.cpp
deleted file mode 100644
index ddea903..0000000
--- a/ossim/src/ossim/imaging/ossimImageChain.cpp
+++ /dev/null
@@ -1,1834 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageChain.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimConnectableContainer.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimEventIds.h>
-#include <ossim/base/ossimObjectEvents.h>
-#include <ossim/base/ossimIdManager.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <algorithm>
-#include <iostream>
-#include <iterator>
-
-static ossimTrace traceDebug("ossimImageChain");
-
-
-RTTI_DEF3(ossimImageChain, "ossimImageChain", ossimImageSource,
-          ossimConnectableObjectListener, ossimConnectableContainerInterface);
-
-void ossimImageChain::processEvent(ossimEvent& event)
-{
-   ossimConnectableObjectListener::processEvent(event);
-   ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject, event.getCurrentObject());
-   
-   if((ossimConnectableObject*)getFirstSource() == obj)
-   {
-      if(event.isPropagatingToOutputs())
-      {
-         ossimConnectableObject::ConnectableObjectList& outputList = getOutputList();
-         ossim_uint32 idx = 0;
-         for(idx = 0; idx < outputList.size();++idx)
-         {
-            if(outputList[idx].valid())
-            {
-               outputList[idx]->fireEvent(event);
-               outputList[idx]->propagateEventToOutputs(event);
-            }
-         }
-      }
-   }
-}
-
-ossimImageChain::ossimImageChain()
-:ossimImageSource(0,
-                  0, // number of inputs
-                  0, // number of outputs
-                  false, // input's fixed
-                  false), // outputs are not fixed
-    ossimConnectableContainerInterface((ossimObject*)NULL),
-    theBlankTile(NULL),
-    theLoadStateFlag(false)
-{
-   ossimConnectableContainerInterface::theBaseObject = this;
-   //thePropagateEventFlag = false;
-   addListener((ossimConnectableObjectListener*)this);
-}
-
-ossimImageChain::~ossimImageChain()
-{
-   removeListener((ossimConnectableObjectListener*)this);
-   deleteList();
-}
-
-bool ossimImageChain::addFirst(ossimConnectableObject* obj)
-{
-   ossimConnectableObject* rightOfThisObj =
-      (ossimConnectableObject*)getFirstObject();
-
-   return insertRight(obj, rightOfThisObj);
-}
-
-bool ossimImageChain::addLast(ossimConnectableObject* obj)
-{
-   if(imageChainList().size() > 0)
-   {
-      ossimConnectableObject* lastSource = imageChainList()[ imageChainList().size() -1].get();
-//      if(dynamic_cast<ossimImageSource*>(obj)&&lastSource)
-      if(lastSource)
-      {
-//         obj->disconnect();
-         ossimConnectableObject::ConnectableObjectList tempIn = getInputList();
-         lastSource->disconnectAllInputs();
-         lastSource->connectMyInputTo(obj);
-         obj->changeOwner(this);
-         obj->connectInputList(tempIn);
-
-         tempIn = obj->getInputList();
-         theInputListIsFixedFlag = obj->getInputListIsFixedFlag();
-         setNumberOfInputs(obj->getNumberOfInputs());
-         imageChainList().push_back(obj);
-         
-         obj->addListener((ossimConnectableObjectListener*)this);
-         // Send an event to any listeners.
-         ossimContainerEvent event((ossimObject*)this,
-                                   OSSIM_EVENT_ADD_OBJECT_ID);
-         event.setObjectList(obj);
-         fireEvent(event);
-         return true;
-      }
-   }
-   else
-   {
-      return add(obj);
-   }
-
-   return false;;
-}
-
-ossimImageSource* ossimImageChain::getFirstSource()
-{
-   if(imageChainList().size()>0)
-   {
-      return dynamic_cast<ossimImageSource*>(imageChainList()[0].get());
-   }
-
-   return 0;
-}
-
-const ossimImageSource* ossimImageChain::getFirstSource() const
-{
-   if(imageChainList().size()>0)
-      return dynamic_cast<const ossimImageSource*>(imageChainList()[0].get());
-
-   return 0;
-}
-
-ossimObject* ossimImageChain::getFirstObject()
-{
-   if(imageChainList().size()>0)
-   {
-      return dynamic_cast<ossimImageSource*>(imageChainList()[0].get());
-   }
-
-   return 0;
-}
-
-ossimImageSource* ossimImageChain::getLastSource()
-{
-   if(imageChainList().size()>0)
-   {
-      return dynamic_cast<ossimImageSource*>((*(imageChainList().end()-1)).get());
-   }
-
-   return NULL;
-}
-
-const ossimImageSource* ossimImageChain::getLastSource() const
-{
-   if(imageChainList().size()>0)
-      return dynamic_cast<const ossimImageSource*>((*(imageChainList().end()-1)).get());
-
-   return NULL;
-}
-
-ossimObject* ossimImageChain::getLastObject()
-{
-   if(imageChainList().size()>0)
-   {
-      return dynamic_cast<ossimImageSource*>((*(imageChainList().end()-1)).get());
-   }
-
-   return 0;
-}
-
-ossimConnectableObject* ossimImageChain::findObject(const ossimId& id,
-                                                    bool /* recurse */)
-{
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      if((*current).get())
-      {
-         if(id == (*current)->getId())
-         {
-            return (*current).get();
-         }
-      }
-      
-      ++current;
-   }
-   
-   current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface,
-                                                         (*current).get());
-      
-      if(child)
-      {
-         ossimConnectableObject* object = child->findObject(id, true);
-
-         if(object) return object;
-      }
-      ++current;
-   }
-   
-   return NULL;
-}
-
-ossimConnectableObject* ossimImageChain::findObject(const ossimConnectableObject* obj,
-                                                    bool /* recurse */)
-{
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      if((*current).valid())
-      {
-         if(obj == (*current).get())
-         {
-            return (*current).get();
-         }
-      }
-      
-      ++current;
-   }
-   
-   current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
-      
-      if(child)
-      {
-         ossimConnectableObject* object = child->findObject(obj, true);
-
-         if(object) return object;
-      }
-      ++current;
-   }
-   
-   return 0;
-}
-
-ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const RTTItypeid& typeInfo,
-                                                               bool recurse)
-{
-   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      if((*current).valid()&&
-         (*current)->canCastTo(typeInfo))
-      {
-         return (*current).get();
-      }
-      ++current;
-   }
-
-   if(recurse)
-   {
-      current =  imageChainList().begin();
-      while(current != imageChainList().end())
-      {
-         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, 
-                                                            (*current).get());
-         
-         if(child)
-         {
-            ossimConnectableObject* temp = child->findFirstObjectOfType(typeInfo, recurse);
-            if(temp)
-            {
-               return temp;
-            }
-         }
-         ++current;
-      }
-   }
-   
-   return (ossimConnectableObject*)NULL;   
-}
-
-ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const ossimString& className,
-                                                               bool recurse)
-{
-   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      if((*current).valid()&&
-         (*current)->canCastTo(className) )
-      {
-         return (*current).get();
-      }
-      ++current;
-   }
-
-   if(recurse)
-   {
-      current =  imageChainList().begin();
-      while(current != imageChainList().end())
-      {
-         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
-         
-         if(child)
-         {
-            ossimConnectableObject* temp = child->findFirstObjectOfType(className, recurse);
-            if(temp)
-            {
-               return temp;
-            }
-         }
-         ++current;
-      }
-   }
-   
-   return (ossimConnectableObject*)0;   
-}
-
-ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfType(const RTTItypeid& typeInfo,
-                                                                           bool recurse)
-{
-   ossimConnectableObject::ConnectableObjectList result;
-   ossimConnectableObject::ConnectableObjectList::iterator current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      if((*current).valid()&&
-         (*current)->canCastTo(typeInfo))
-      {
-         ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), 
-                                                                                      result.end(), 
-                                                                                      (*current).get());
-         if(iter == result.end())
-         {
-            result.push_back((*current).get());
-         }
-      }
-      ++current;
-   }
-
-   if(recurse)
-   {
-      current =  imageChainList().begin();
-      while(current != imageChainList().end())
-      {
-         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
-         
-         if(child)
-         {
-            ossimConnectableObject::ConnectableObjectList temp;
-            temp = child->findAllObjectsOfType(typeInfo, recurse);
-            for(long index=0; index < (long)temp.size();++index)
-            {
-               ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), temp[index]);
-               if(iter == result.end())
-               {
-                  result.push_back(temp[index]);
-               }
-            }
-         }
-         ++current;
-      }
-   }
-   
-   return result;
-   
-}
-
-ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfType(const ossimString& className,
-                                                                           bool recurse)
-{
-   ossimConnectableObject::ConnectableObjectList result;
-   ossimConnectableObject::ConnectableObjectList::iterator current =  imageChainList().begin();
-   
-   while(current != imageChainList().end())
-   {
-      if((*current).valid()&&
-         (*current)->canCastTo(className))
-      {
-         ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), 
-                                                                         result.end(), 
-                                                                         (*current).get());
-         if(iter == result.end())
-         {
-            result.push_back((*current).get());
-         }
-      }
-      ++current;
-   }
-
-   if(recurse)
-   {
-      current =  imageChainList().begin();
-      while(current != imageChainList().end())
-      {
-         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
-         
-         if(child)
-         {
-            ossimConnectableObject::ConnectableObjectList temp;
-            temp = child->findAllObjectsOfType(className, recurse);
-            for(long index=0; index < (long)temp.size();++index)
-            {
-               ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), temp[index]);
-               if(iter == result.end())
-               {
-                  result.push_back(temp[index]);
-               }
-            }
-         }
-         ++current;
-      }
-   }
-   
-   return result;
-   
-}
-
-void ossimImageChain::makeUniqueIds()
-{
-   setId(ossimIdManager::instance()->generateId());
-   for(long index = 0; index < (long)imageChainList().size(); ++index)
-   {
-      ossimConnectableContainerInterface* container = PTR_CAST(ossimConnectableContainerInterface,
-                                                               imageChainList()[index].get());
-      if(container)
-      {
-         container->makeUniqueIds();
-      }
-      else
-      {
-         if(imageChainList()[index].valid())
-         {
-            imageChainList()[index]->setId(ossimIdManager::instance()->generateId());
-         }
-      }
-   }
-}
-
-ossim_uint32 ossimImageChain::getNumberOfObjects(bool recurse)const
-{
-   ossim_uint32 result = (ossim_uint32)imageChainList().size();
-   
-   if(recurse)
-   {
-      for(ossim_uint32 i = 0; i < imageChainList().size(); ++i)
-      {
-         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, imageChainList()[i].get());
-         if(child)
-         {
-            result += child->getNumberOfObjects(true);
-         }
-      }
-   }
-   
-   return result;   
-}
-
-ossim_uint32 ossimImageChain::getNumberOfSources() const
-{
-   ossimNotify(ossimNotifyLevel_NOTICE)
-      << "ossimImageChain::getNumberOfSources is deprecated!"
-      << "\nUse: ossimImageChain::getNumberOfObjects(false)"
-      << std::endl;
-   return getNumberOfObjects(false);
-}
-
-bool ossimImageChain::addChild(ossimConnectableObject* object)
-{
-   return add(object);
-}
-
-bool ossimImageChain::removeChild(ossimConnectableObject* object)
-{
-   bool result = false;
-   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  std::find(imageChainList().begin(), imageChainList().end(), object);
-   
-   
-   if(current!=imageChainList().end())
-   {
-      result = true;
-      object->removeListener((ossimConnectableObjectListener*)this);
-      if(current == imageChainList().begin())
-      {
-         object->removeListener((ossimConnectableObjectListener*)this);
-      }
-      if(imageChainList().size() == 1)
-      {
-         object->changeOwner(0);
-         current = imageChainList().erase(current);
-      }
-      else 
-      {
-         ossimConnectableObject::ConnectableObjectList input  = object->getInputList();
-         ossimConnectableObject::ConnectableObjectList output = object->getOutputList();
-         object->changeOwner(0);// set the owner to 0
-         bool erasingBeginning = (current == imageChainList().begin());
-         // bool erasingEnd = (current+1) == imageChainList().end();
-         current = imageChainList().erase(current);
-         object->disconnect();
-         
-         if(!imageChainList().empty())
-         {
-            if(erasingBeginning) // the one that receives the first getTile
-            {
-               (*imageChainList().begin())->addListener(this);
-            }
-            
-            else if(current==imageChainList().end()) // one that receives the last getTIle
-            {
-               current = imageChainList().begin()+(imageChainList().size()-1);
-               (*current)->connectInputList(input);
-               theInputObjectList = (*current)->getInputList();
-               theInputListIsFixedFlag = (*current)->getInputListIsFixedFlag();
-            }
-            else
-            {
-               // prepare interior setup and removal and connect surrounding nodes
-               // take the  outputs of the node we are removing and connect them to the old inputs 
-               ossim_uint32 outIndex = 0;
-               for(outIndex = 0; outIndex < output.size();++outIndex)
-               {
-                  output[outIndex]->connectInputList(input);
-               }
-            }
-         }
-      }
-
-      // Send an event to any listeners.
-      ossimContainerEvent event((ossimObject*)this,
-                                OSSIM_EVENT_REMOVE_OBJECT_ID);
-      event.setObjectList(object);
-      fireEvent(event);
-   }
-   
-   return result;
-}
-
-ossimConnectableObject* ossimImageChain::removeChild(const ossimId& id)
-{
-   ossimIdVisitor visitor( id,
-                           (ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS ) );
-   accept( visitor );
-   ossimConnectableObject* obj = visitor.getObject();
-   if ( obj )
-   {
-      removeChild(obj);
-   }
-   return obj;
-}
-
-void ossimImageChain::getChildren(vector<ossimConnectableObject*>& children,
-                                  bool immediateChildrenOnlyFlag)
-{
-   ossim_uint32 i = 0;
-   
-   vector<ossimConnectableObject*> temp;
-   for(i = 0; i < imageChainList().size();++i)
-   {
-      temp.push_back(imageChainList()[i].get());
-   }
-
-   for(i = 0; i < temp.size();++i)
-   {
-      ossimConnectableContainerInterface* interface = PTR_CAST(ossimConnectableContainerInterface,
-                                                               temp[i]);
-      if(immediateChildrenOnlyFlag)
-      {
-         children.push_back(temp[i]);
-      }
-      else if(!interface)
-      {
-         children.push_back(temp[i]);         
-      }
-   }
-   
-   if(!immediateChildrenOnlyFlag)
-   {
-      for(i = 0; i < temp.size();++i)
-      {
-         ossimConnectableContainerInterface* interface = PTR_CAST(ossimConnectableContainerInterface,
-                                                                  temp[i]);
-         if(interface)
-         {
-            interface->getChildren(children, false);
-         }
-      }
-   }
-}
-
-bool ossimImageChain::add(ossimConnectableObject* source)
-{
-   bool result = false;
-//   if(PTR_CAST(ossimImageSource, source))
-   {
-     source->changeOwner(this);
-     if(imageChainList().size() > 0)
-     {
-        source->disconnectAllOutputs();
-        theOutputListIsFixedFlag = source->getOutputListIsFixedFlag();
-        imageChainList()[0]->removeListener(this);
-        imageChainList().insert(imageChainList().begin(), source);
-        imageChainList()[0]->addListener(this);
-        source->addListener((ossimConnectableObjectListener*)this);
-        imageChainList()[0]->connectMyInputTo(imageChainList()[1].get());
-        result = true;
-     }
-     else
-     {
-        theInputListIsFixedFlag = false;
-        theOutputListIsFixedFlag = false;
-        
-        if(!theInputObjectList.empty())
-        {
-           source->connectInputList(getInputList());
-        }
-        theInputObjectList = source->getInputList();
-        theInputListIsFixedFlag = source->getInputListIsFixedFlag();
-     //   theOutputObjectList     = source->getOutputList();
-     //   theOutputListIsFixedFlag= source->getOutputListIsFixedFlag();
-        imageChainList().push_back(source);
-        source->addListener((ossimConnectableObjectListener*)this);
-        source->addListener(this);
-        result = true;
-     }
-   }
-
-   if (result && source)
-   {
-      ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
-      event.setObjectList(source);
-      fireEvent(event);
-   }
-   
-   return result;
-}
-
-bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
-                                  ossimConnectableObject* rightOfThisObj)
-{
-   if(!newObj&&!rightOfThisObj) return false;
-   if(!imageChainList().size())
-   {
-      return add(newObj);
-   }
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(imageChainList().begin(), imageChainList().end(), rightOfThisObj);
-   
-   if(iter!=imageChainList().end())
-   {
-      if(iter == imageChainList().begin())
-      {
-         return add(newObj);
-      }
-      else //if(PTR_CAST(ossimImageSource, newObj))
-      {
-         ossimConnectableObject::ConnectableObjectList outputList = rightOfThisObj->getOutputList();
-         rightOfThisObj->disconnectAllOutputs();
-
-         // Core dump fix.  Connect input prior to outputs. (drb)
-         newObj->connectMyInputTo(rightOfThisObj); 
-         newObj->connectOutputList(outputList);
-         newObj->changeOwner(this);
-         newObj->addListener((ossimConnectableObjectListener*)this);
-         imageChainList().insert(iter, newObj);
-         // Send event to any listeners.
-         ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
-         event.setObjectList(newObj);
-         fireEvent(event);
-         return true;
-      }
-   }
-
-   return false;
-}
-
-bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
-                                  const ossimId& id)
-{
-
-#if 1
-   ossimIdVisitor visitor( id, ossimVisitor::VISIT_CHILDREN );
-   accept( visitor );
-   ossimConnectableObject* obj = visitor.getObject();
-   if ( obj )
-   {
-      return insertRight(newObj, obj);
-   }
-   return false;
-#else
-   ossimConnectableObject* obj = findObject(id, false);
-   if(obj)
-   {
-      return insertRight(newObj, obj);
-   }
-
-   return false;
-#endif
-}
-
-bool ossimImageChain::insertLeft(ossimConnectableObject* newObj,
-                                 ossimConnectableObject* leftOfThisObj)
-{
-   if(!newObj&&!leftOfThisObj) return false;
-   if(!imageChainList().size())
-   {
-      return add(newObj);
-   }
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(imageChainList().begin(), imageChainList().end(), leftOfThisObj);
-   if(iter!=imageChainList().end())
-   {
-      if((iter+1)==imageChainList().end())
-      {
-         return addLast(newObj);
-      }
-      else
-      {
-         ossimConnectableObject::ConnectableObjectList inputList = leftOfThisObj->getInputList();
-         
-         newObj->connectInputList(inputList);
-         
-         leftOfThisObj->disconnectAllInputs();
-         leftOfThisObj->connectMyInputTo(newObj);
-         newObj->changeOwner(this);
-         newObj->addListener((ossimConnectableObjectListener*)this);
-         imageChainList().insert(iter+1, newObj);
-         // Send an event to any listeners.
-         ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
-         event.setObjectList(newObj);
-         fireEvent(event);
-         return true;
-      }
-   }
-
-   return false;
-}
-
-bool ossimImageChain::insertLeft(ossimConnectableObject* newObj,
-                                 const ossimId& id)
-{
-#if 1
-   ossimIdVisitor visitor( id,
-                           ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
-   accept( visitor );
-   ossimConnectableObject* obj = visitor.getObject();
-   if ( obj )
-   {
-      return insertLeft(newObj, obj);
-   }
-   return false;
-#else
-   ossimConnectableObject* obj = findObject(id, false);
-   if(obj)
-   {
-      return insertLeft(newObj, obj);
-   }
-   return false;
-#endif   
-}
-
-bool ossimImageChain::replace(ossimConnectableObject* newObj,
-                              ossimConnectableObject* oldObj)
-{
-   ossim_int32 idx = indexOf(oldObj);
-   if(idx >= 0)
-   {
-      ossimConnectableObject::ConnectableObjectList& inputList  = oldObj->getInputList();
-      ossimConnectableObject::ConnectableObjectList& outputList = oldObj->getOutputList();
-      oldObj->removeListener((ossimConnectableObjectListener*)this);
-      oldObj->removeListener(this);
-      oldObj->changeOwner(0);
-      imageChainList()[idx] = newObj;
-      newObj->connectInputList(inputList);
-      newObj->connectOutputList(outputList);
-      newObj->changeOwner(this);
-      newObj->addListener((ossimConnectableObjectListener*)this);
-      if(idx == 0)
-      {
-         newObj->addListener(this);
-      }
-   }
-   
-   return (idx >= 0);
-}
-
-ossimRefPtr<ossimImageData> ossimImageChain::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* inputSource = PTR_CAST(ossimImageSource,
-                                             imageChainList()[0].get());
-      
-      if(inputSource)
-      {
-         // make sure we initialize in reverse order.
-         // some source may depend on the initialization of
-         // its inputs
-         return inputSource->getTile(tileRect, resLevel);
-      }  
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* inputSource = PTR_CAST(ossimImageSource, getInput(0));
-         if(inputSource)
-         {
-            ossimRefPtr<ossimImageData> inputTile = inputSource->getTile(tileRect, resLevel);
-//            if(inputTile.valid())
-//            {
-//               std::cout << *(inputTile.get()) << std::endl;
-//            }
-            return inputTile.get();
-         }
-      }
-   }
-//   std::cout << "RETURNING A BLANK TILE!!!!" << std::endl;
-/*
-   if(theBlankTile.get())
-   {
-      theBlankTile->setImageRectangle(tileRect);
-   }
-   return theBlankTile;
- */
-   return 0;
-}
-
-ossim_uint32 ossimImageChain::getNumberOfInputBands() const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-      if(interface)
-      {
-         return interface->getNumberOfOutputBands();
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getNumberOfOutputBands();
-         }
-      }
-   }
-
-   return 0;
-}
-
-double ossimImageChain::getNullPixelValue(ossim_uint32 band)const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-      if(interface)
-      {
-         return interface->getNullPixelValue(band);
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getNullPixelValue(band);
-         }
-      }
-   }
-   
-   return ossim::defaultNull(getOutputScalarType());
-}
-
-double ossimImageChain::getMinPixelValue(ossim_uint32 band)const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-      if(interface)
-      {
-         return interface->getMinPixelValue(band);
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getMinPixelValue(band);
-         }
-      }
-   }
-
-   return ossim::defaultMin(getOutputScalarType());
-}
-
-double ossimImageChain::getMaxPixelValue(ossim_uint32 band)const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                                  imageChainList()[0].get());
-      if(inter)
-      {
-         return inter->getMaxPixelValue(band);
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getMaxPixelValue(band);
-         }
-      }
-   }
-
-   return ossim::defaultMax(getOutputScalarType());
-}
-
-void ossimImageChain::getOutputBandList(std::vector<ossim_uint32>& bandList) const
-{
-   if( (imageChainList().size() > 0) && isSourceEnabled() )
-   {
-      ossimRefPtr<const ossimImageSource> inter =
-         dynamic_cast<const ossimImageSource*>( imageChainList()[0].get() );
-      if( inter.valid() )
-      {
-         // cout << "cn: " << inter->getClassName() << endl;
-         inter->getOutputBandList(bandList);
-      }
-   }
-}
-   
-ossimScalarType ossimImageChain::getOutputScalarType() const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-      if(interface)
-      {
-         return interface->getOutputScalarType();
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getOutputScalarType();
-         }
-      }
-   }
-   
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-ossim_uint32 ossimImageChain::getTileWidth()const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         imageChainList()[0].get());
-         if(interface)
-         {
-            return interface->getTileWidth();;
-         }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getTileWidth();
-         }
-      }
-   }
-   
-   return 0;   
-}
-
-ossim_uint32 ossimImageChain::getTileHeight()const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         imageChainList()[0].get());
-         if(interface)
-         {
-            return interface->getTileHeight();
-         }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getTileHeight();
-         }
-      }
-   }
-   
-   return 0;   
-}
-   
-ossimIrect ossimImageChain::getBoundingRect(ossim_uint32 resLevel)const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-
-      if(interface)
-      {
-         return interface->getBoundingRect(resLevel);
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getBoundingRect();
-         }
-      }
-   }
-   ossimDrect rect;
-   rect.makeNan();
-   
-   return rect;
-   
-}
-
-void ossimImageChain::getValidImageVertices(vector<ossimIpt>& validVertices,
-                                            ossimVertexOrdering ordering,
-                                            ossim_uint32 resLevel)const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface =PTR_CAST(ossimImageSource,
-                                                     imageChainList()[0].get());
-
-      if(interface)
-      {
-         interface->getValidImageVertices(validVertices,
-                                          ordering,
-                                          resLevel);
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            interface->getValidImageVertices(validVertices,
-                                             ordering,
-                                             resLevel);
-         }
-      }
-   }
-}
-
-ossimRefPtr<ossimImageGeometry> ossimImageChain::getImageGeometry()
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource, imageChainList()[0].get());
-      if( interface )
-      {
-         return interface->getImageGeometry();
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource, getInput(0));
-         if(interface)
-         {
-            return interface->getImageGeometry();
-         }
-      }
-   }
-   return ossimRefPtr<ossimImageGeometry>();
-}
-
-void ossimImageChain::getDecimationFactor(ossim_uint32 resLevel,
-                                          ossimDpt& result) const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-      if(interface)
-      {
-         interface->getDecimationFactor(resLevel,
-                                        result);
-         return;
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            interface->getDecimationFactor(resLevel, result);
-            return;
-         }
-      }
-   }
-
-   result.makeNan();
-}
-
-void ossimImageChain::getDecimationFactors(vector<ossimDpt>& decimations) const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-      if(interface)
-      {
-         interface->getDecimationFactors(decimations);
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            interface->getDecimationFactors(decimations);
-            return;
-         }
-      }
-   }
-}
-
-ossim_uint32 ossimImageChain::getNumberOfDecimationLevels()const
-{
-   if((imageChainList().size() > 0)&&(isSourceEnabled()))
-   {
-      ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                      imageChainList()[0].get());
-
-      if(interface)
-      {
-         return interface->getNumberOfDecimationLevels();
-      }
-   }
-   else
-   {
-      if(getInput(0))
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource,
-                                                         getInput(0));
-         if(interface)
-         {
-            return interface->getNumberOfDecimationLevels();
-         }
-      }
-   }
-
-   return 1;
-}
-
-bool ossimImageChain::addAllSources(map<ossimId, vector<ossimId> >& idMapping,
-                                    const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   static const char* MODULE = "ossimImageChain::addAllSources";
-   ossimString copyPrefix = prefix;
-   bool result =  ossimImageSource::loadState(kwl, copyPrefix.c_str());
-
-   if(!result)
-   {
-      return result;
-   }
-   long index = 0;
-
-//   ossimSource* source = NULL;
-
-   vector<ossimId> inputConnectionIds;
-   ossimString regExpression =  ossimString("^(") + copyPrefix + "object[0-9]+.)";
-   vector<ossimString> keys =
-      kwl.getSubstringKeyList( regExpression );
-   long numberOfSources = (long)keys.size();//kwl.getNumberOfSubstringKeys(regExpression);
-
-   int offset = (int)(copyPrefix+"object").size();
-   int idx = 0;
-   std::vector<int> theNumberList(numberOfSources);
-   for(idx = 0; idx < (int)theNumberList.size();++idx)
-     {
-       ossimString numberStr(keys[idx].begin() + offset,
-			     keys[idx].end());
-       theNumberList[idx] = numberStr.toInt();
-     }
-   std::sort(theNumberList.begin(), theNumberList.end());
-   for(idx=0;idx < (int)theNumberList.size();++idx)
-   {
-      ossimString newPrefix = copyPrefix;
-      newPrefix += ossimString("object");
-      newPrefix += ossimString::toString(theNumberList[idx]);
-      newPrefix += ossimString(".");
-
-      if(traceDebug())
-      {
-         CLOG << "trying to create source with prefix: " << newPrefix
-              << std::endl;
-      }
-      ossimRefPtr<ossimObject> object = ossimObjectFactoryRegistry::instance()->createObject(kwl,
-                                                                                 newPrefix.c_str());
-      ossimConnectableObject* source = PTR_CAST(ossimConnectableObject, object.get());
-      
-      if(source)
-      {
-         // we did find a source so include it in the count
-         if(traceDebug())
-         {
-            CLOG << "Created source with prefix: " << newPrefix << std::endl;
-         }
-         //if(PTR_CAST(ossimImageSource, source))
-         {
-            ossimId id = source->getId();
-            inputConnectionIds.clear();
-            
-            findInputConnectionIds(inputConnectionIds,
-                                   kwl,
-                                   newPrefix);
-            if(inputConnectionIds.size() == 0)
-            {
-               // we will try to do a default connection
-               //
-               
-               if(imageChainList().size())
-               {
-                  if(traceDebug())
-                  {
-                     CLOG << "connecting " << source->getClassName() << " to "
-                          << imageChainList()[0]->getClassName() << std::endl;
-                  }
-                  source->connectMyInputTo(0, imageChainList()[0].get());
-               }
-            }
-            else
-            {
-               // we remember the connection id's so we can connect this later.
-               // this way we make sure all sources were actually
-               // allocated.
-               //
-               idMapping.insert(std::make_pair(id, inputConnectionIds));
-            }
-            add(source);
-         }
-      //   else
-      //   {
-            source = 0;
-      //   }
-      }
-      else
-      {
-         object = 0;
-         source = 0;
-      }
-      
-      ++index;
-   }
-   if(imageChainList().size())
-   {
-     ossimConnectableObject* obj = imageChainList()[(ossim_int32)imageChainList().size()-1].get();
-     if(obj)
-     {
-        setNumberOfInputs(obj->getNumberOfInputs());
-     }
-   }
-   
-   return result;
-}
-
-void ossimImageChain::findInputConnectionIds(vector<ossimId>& result,
-                                             const ossimKeywordlist& kwl,
-                                             const char* prefix)
-{
-   ossimString copyPrefix = prefix;
-   ossim_uint32 idx = 0;
-   
-   ossimString regExpression =  ossimString("^") + ossimString(prefix) + "input_connection[0-9]+";
-   vector<ossimString> keys =
-      kwl.getSubstringKeyList( regExpression );
-   
-   ossim_int32 offset = (ossim_int32)(copyPrefix+"input_connection").size();
-   ossim_uint32 numberOfKeys = (ossim_uint32)keys.size();
-   std::vector<int> theNumberList(numberOfKeys);
-   for(idx = 0; idx < theNumberList.size();++idx)
-   {
-      ossimString numberStr(keys[idx].begin() + offset,
-                            keys[idx].end());
-      theNumberList[idx] = numberStr.toInt();
-   }
-   std::sort(theNumberList.begin(), theNumberList.end());
-   copyPrefix += ossimString("input_connection");
-   for(idx=0;idx < theNumberList.size();++idx)
-   {
-      const char* lookup = kwl.find(copyPrefix,ossimString::toString(theNumberList[idx]));
-      if(lookup)
-      {
-         long id = ossimString(lookup).toLong();
-         result.push_back(ossimId(id));
-      }
-   }
-}
-                    
-
-bool ossimImageChain::connectAllSources(const map<ossimId, vector<ossimId> >& idMapping)
-{
-   // cout << "this->getId(): " << this->getId() << endl;
-   
-   if(idMapping.size())
-   {
-      map<ossimId, vector<ossimId> >::const_iterator iter = idMapping.begin();
-
-      
-      while(iter != idMapping.end())
-      {
-         // cout << "(*iter).first): " << (*iter).first << endl;
-#if 0
-         ossimConnectableObject* currentSource = findObject((*iter).first);
-#else
-         ossimIdVisitor visitor( (*iter).first,
-                                 (ossimVisitor::VISIT_CHILDREN ) );
-                                  // ossimVisitor::VISIT_INPUTS ) );
-         accept( visitor );
-         ossimConnectableObject* currentSource = visitor.getObject();
-#endif
-
-         if(currentSource)
-         {
-            // cout << "currentSource->getClassName: " << currentSource->getClassName() << endl;
-            long upperBound = (long)(*iter).second.size();
-            for(long index = 0; index < upperBound; ++index)
-            {
-               //cout << "(*iter).second[index]: " << (*iter).second[index] << endl;
-               
-               if((*iter).second[index].getId() > -1)
-               {
-#if 0
-                  ossimConnectableObject* inputSource =
-                      PTR_CAST(ossimConnectableObject, findObject((*iter).second[index]));
-#else
-                  visitor.reset();
-                  visitor.setId( (*iter).second[index] );
-                  accept( visitor );
-                  ossimConnectableObject* inputSource = visitor.getObject();
-#endif
-                  // cout << "inputSource is " << (inputSource?"good...":"null...") << endl;
-                  if ( inputSource )
-                  {
-                     // cout << "inputSource->getClassName(): " << inputSource->getClassName() << endl;
- 
-                     // Check for connection to self.
-                     if ( this != inputSource )
-                     {
-                        currentSource->connectMyInputTo(index, inputSource);
-                     }
-                     // else warning???
-                  }
-               }
-               else // -1 id
-               {
-                  currentSource->disconnectMyInput((ossim_int32)index);
-               }
-            }
-         }
-         else
-         {
-            cerr << "Could not find " << (*iter).first << " for source: ";
-            return false;
-         }
-         ++iter;
-      }
-   }
-
-   // abort();
-   return true;
-}
-
-bool ossimImageChain::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   bool result = true;
-   
-   result = ossimImageSource::saveState(kwl, prefix);
-
-   if(!result)
-   {
-      return result;
-   }
-   ossim_uint32 upper = (ossim_uint32)imageChainList().size();
-   ossim_uint32 counter = 1;
-
-   if (upper)
-   {
-      ossim_int32 idx = upper-1;
-      // start with the tail and go to the head fo the list.
-      for(;((idx >= 0)&&result);--idx, ++counter)
-      {
-         ossimString newPrefix = prefix;
-         
-         newPrefix += (ossimString("object") +
-                       ossimString::toString(counter) +
-                       ossimString("."));
-         result = imageChainList()[idx]->saveState(kwl, newPrefix.c_str());
-      }
-   }
-
-   return result;
-}
-
-bool ossimImageChain::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   static const char* MODULE = "ossimImageChain::loadState(kwl, prefix)";
-   deleteList();
-
-   ossimImageSource::loadState(kwl, prefix);
-   
-   
-   theLoadStateFlag = true;
-   bool result = true;
-   
-   map<ossimId, vector<ossimId> > idMapping;
-   result = addAllSources(idMapping, kwl, prefix);
-   if(!result)
-   {
-      CLOG << "problems adding sources" << std::endl;
-   }
-   result = connectAllSources(idMapping);
-   if(!result)
-   {
-      CLOG << "problems connecting sources" << std::endl;
-   }
-   
-   theLoadStateFlag = false;
-   return result;
-}
-
-
-void ossimImageChain::initialize()
-{
-   static const char* MODULE = "ossimImageChain::initialize()";
-   if (traceDebug()) CLOG << " Entered..." << std::endl;
-   
-   long upper = (ossim_uint32)imageChainList().size();
-   
-   for(long index = upper - 1; index >= 0; --index)
-   {
-      if(traceDebug())
-      {
-         CLOG << "initilizing source: "
-              << imageChainList()[index]->getClassName()
-              << std::endl;
-      }
-      if(imageChainList()[index].valid())
-      {
-         ossimSource* interface =
-            PTR_CAST(ossimSource, imageChainList()[index].get());
-
-         if(interface)
-         {
-            // make sure we initialize in reverse order.
-            // some source may depend on the initialization of
-            // its inputs
-            interface->initialize();
-         }
-      }
-   }
-   if (traceDebug()) CLOG << " Exited..." << std::endl;
-}
-
-void ossimImageChain::enableSource()
-{
-   ossim_int32 upper = static_cast<ossim_int32>(imageChainList().size());
-   ossim_int32 index = 0;
-   for(index = upper - 1; index >= 0; --index)
-   {
-      // make sure we initialize in reverse order.
-      // some source may depend on the initialization of
-      // its inputs
-     ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
-     if(source)
-     {
-        source->enableSource();
-     }
-   }
-   
-   theEnableFlag = true;
-}
-
-void ossimImageChain::disableSource()
-{
-   long upper = (ossim_uint32)imageChainList().size();
-   
-   for(long index = upper - 1; index >= 0; --index)
-   {
-      // make sure we initialize in reverse order.
-      // some source may depend on the initialization of
-      // its inputs
-     ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
-     if(source)
-     {
-        source->disableSource();
-     }
-   }
-   
-   theEnableFlag = false;
-}
-
-void ossimImageChain::prepareForRemoval(ossimConnectableObject* connectableObject)
-{
-   if(connectableObject)
-   {
-      connectableObject->removeListener((ossimConnectableObjectListener*)this);
-      connectableObject->changeOwner(0);
-      connectableObject->disconnect();   
-   }
-}
-
-bool ossimImageChain::deleteFirst()
-{
-   if (imageChainList().size() == 0) return false;
-
-   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
-   prepareForRemoval(imageChainList()[0].get());
-   // Clear any listeners, memory.
-   event.setObjectList(imageChainList()[0].get());
-   imageChainList()[0] = 0;
-   // Remove from the vector.
-   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator i = imageChainList().begin();
-   imageChainList().erase(i);
-   fireEvent(event);
-   return true;
-}
-
-bool ossimImageChain::deleteLast()
-{
-   if (imageChainList().size() == 0) return false;
-
-   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
-  // Clear any listeners, memory.
-   ossim_uint32 idx = (ossim_uint32)imageChainList().size() - 1;
-   prepareForRemoval(imageChainList()[idx].get());
-   event.setObjectList(imageChainList()[idx].get());
-   imageChainList()[idx] = 0;
-   // Remove from the vector.
-   imageChainList().pop_back();
-   fireEvent(event);
-   return true; 
-}
-
-void ossimImageChain::deleteList()
-{
-   ossim_uint32 upper = (ossim_uint32) imageChainList().size();
-   ossim_uint32 idx = 0;
-   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
-   for(; idx < upper; ++idx)
-   {
-      if(imageChainList()[idx].valid())
-      {
-         event.getObjectList().push_back(imageChainList()[idx].get());
-         prepareForRemoval(imageChainList()[idx].get());
-         imageChainList()[idx] = 0;
-      }
-   }
-  
-   imageChainList().clear();
-   fireEvent(event);
-}
-
-
-void ossimImageChain::disconnectInputEvent(ossimConnectionEvent& event)
-{
-   if(imageChainList().size())
-   {
-      if(event.getObject()==this)
-      {
-         if(imageChainList()[imageChainList().size()-1].valid())
-         {
-            for(ossim_uint32 i = 0; i < event.getNumberOfOldObjects(); ++i)
-            {
-               imageChainList()[imageChainList().size()-1]->disconnectMyInput(event.getOldObject(i));
-            }
-         }
-      }
-   }
-}
-
-void ossimImageChain::disconnectOutputEvent(ossimConnectionEvent& /* event */)
-{
-}
-
-void ossimImageChain::connectInputEvent(ossimConnectionEvent& event)
-{
-   if(imageChainList().size())
-   {
-      if(event.getObject()==this)
-      {
-         if(imageChainList()[imageChainList().size()-1].valid())
-         {
-            for(ossim_uint32 i = 0; i < event.getNumberOfNewObjects(); ++i)
-            {
-               ossimConnectableObject* obj = event.getNewObject(i);
-               imageChainList()[imageChainList().size()-1]->connectMyInputTo(findInputIndex(obj),
-                                                                               obj,
-                                                                               false);
-            }
-         }
-      }
-      else if(event.getObject() == imageChainList()[0].get())
-      {
-         if(!theLoadStateFlag)
-         {
-//            theInputObjectList = imageChainList()[0]->getInputList();
-         }
-      }
-      initialize();
-   }
-}
-
-void ossimImageChain::connectOutputEvent(ossimConnectionEvent& /* event */)
-{
-} 
-
-// void ossimImageChain::propertyEvent(ossimPropertyEvent& event)
-// {
-//    if(imageChainList().size())
-//    {
-//       ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
-//                                              event.getObject());
-      
-//       if(obj)
-//       {
-//          ossimImageSource* interface = findSource(obj->getId());
-         
-//          if(interface)
-//          {
-//             ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
-//                                                    interface.getObject());
-//             if(obj)
-//             {
-               
-//             }
-//          }
-//       }
-//    }
-// }
-
-void ossimImageChain::objectDestructingEvent(ossimObjectDestructingEvent& event)
-{
-   if(!event.getObject()) return;
-
-   if(imageChainList().size()&&(event.getObject()!=this))
-   {
-      removeChild(PTR_CAST(ossimConnectableObject,
-                           event.getObject()));
-   }
-}
-void ossimImageChain::propagateEventToOutputs(ossimEvent& event)
-{
-   //if(thePropagateEventFlag) return;
-
-   //thePropagateEventFlag = true;
-   if(imageChainList().size())
-   {
-      if(imageChainList()[imageChainList().size()-1].valid())
-      {
-         imageChainList()[imageChainList().size()-1]->fireEvent(event);
-         imageChainList()[imageChainList().size()-1]->propagateEventToOutputs(event);
-      }
-   }
-   //ossimConnectableObject::propagateEventToOutputs(event);
-  // thePropagateEventFlag = false;
-}
-void ossimImageChain::propagateEventToInputs(ossimEvent& event)
-{
-//   if(thePropagateEventFlag) return;
-
-//   thePropagateEventFlag = true;
-   if(imageChainList().size())
-   {
-      if(imageChainList()[0].valid())
-      {
-         imageChainList()[0]->fireEvent(event);
-         imageChainList()[0]->propagateEventToInputs(event);
-      }
-   }
-//   thePropagateEventFlag = false;
-}
-
-ossimConnectableObject* ossimImageChain::operator[](ossim_uint32 index)
-{
-   return getConnectableObject(index);
-}
-
-ossimConnectableObject* ossimImageChain::getConnectableObject(
-   ossim_uint32 index)
-{
-   if(imageChainList().size() && (index < imageChainList().size()))
-   {
-      return imageChainList()[index].get();
-   }
-   
-   return 0; 
-}
-
-ossim_int32 ossimImageChain::indexOf(ossimConnectableObject* obj)const
-{
-   ossim_uint32 idx = 0;
-   
-   for(idx = 0; idx < imageChainList().size();++idx)
-   {
-      if(imageChainList()[idx] == obj)
-      {
-         return (ossim_int32)idx;
-      }
-   }
-   
-   return -1;
-}
-
-void ossimImageChain::accept(ossimVisitor& visitor)
-{
-   if(!visitor.hasVisited(this))
-   {
-      visitor.visit(this);
-      ossimVisitor::VisitorType currentType = visitor.getVisitorType();
-      //---
-      // Lets make sure inputs and outputs are turned off for we are traversing all children
-      // and we should not have to have that enabled.
-      //---
-      visitor.turnOffVisitorType(ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_OUTPUTS);
-      if(visitor.getVisitorType() & ossimVisitor::VISIT_CHILDREN)
-      {
-         ConnectableObjectList::reverse_iterator current = imageChainList().rbegin();
-         while((current != imageChainList().rend())&&!visitor.stopTraversal())
-         {
-            ossimRefPtr<ossimConnectableObject> currentObject = (*current);
-            if(currentObject.get() && !visitor.hasVisited(currentObject.get())) currentObject->accept(visitor);
-            ++current;
-         }
-      }
-      visitor.setVisitorType(currentType);
-      ossimConnectableObject::accept(visitor);
-   }
-}
-
-//**************************************************************************************************
-// Inserts all of its children and inputs into the container provided. Since ossimImageChain is
-// itself a form of container, this method will consolidate this chain with the argument
-// container. Therefore this chain object will not be represented in the container (but its
-// children will be, with correct input and output connections to external objects).
-// Returns TRUE if successful.
-//**************************************************************************************************
-bool ossimImageChain::fillContainer(ossimConnectableContainer& container)
-{
-   // Grab the first source in the chain and let it fill the container with itself and inputs. This
-   // will traverse down the chain and will even pick up external sources that feed this chain:
-   ossimRefPtr<ossimConnectableObject> first_source = getFirstSource();
-   if (!first_source.valid())
-      return false;
-   first_source->fillContainer(container);
-
-   // Instead of adding ourselves, make sure my first source is properly connected to my output,
-   // thus obviating the need for this image chain (my chain items become part of 'container':
-   ConnectableObjectList& obj_list = getOutputList();
-   ossimRefPtr<ossimConnectableObject> output_connection = 0;
-   while (!obj_list.empty())
-   {
-      // Always pick off the beginning of the list since it is shrinking with each disconnect:
-      output_connection = obj_list[0];
-      disconnectMyOutput(output_connection.get(), true, false);
-      first_source->connectMyOutputTo(output_connection.get());
-   }
-   return true;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageData.cpp b/ossim/src/ossim/imaging/ossimImageData.cpp
deleted file mode 100644
index 9c54c9d..0000000
--- a/ossim/src/ossim/imaging/ossimImageData.cpp
+++ /dev/null
@@ -1,7326 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageData.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimErrorCodes.h>
-//#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimHistogram.h>
-//#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-//#include <ossim/base/ossimSource.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <algorithm>
-#include <cstring>
-#include <fstream>
-#include <iostream>
-#include <iterator>
-//#include <ostream>
-
-
-RTTI_DEF1(ossimImageData, "ossimImageData", ossimRectilinearDataObject)
-
-ossimImageData::ossimImageData()
-   : ossimRectilinearDataObject(2,            // 2d
-                                0,         // owner
-                                1,            // bands
-                                OSSIM_UINT8), // scalar
-     m_nullPixelValue(0),
-     m_minPixelValue(0),
-     m_maxPixelValue(0),
-     m_alpha(0),
-     m_origin(0, 0),
-     m_indexedFlag(false)
-{
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   m_spatialExtents[0] = tileSize.x;
-   m_spatialExtents[1] = tileSize.y;
-   initializeDefaults();
-}
-
-ossimImageData::ossimImageData(ossimSource*    owner,
-                               ossimScalarType scalar,
-                               ossim_uint32    bands)
-   : ossimRectilinearDataObject(2,
-                                owner,
-                                bands,
-                                scalar),
-     m_nullPixelValue(0),
-     m_minPixelValue(0),
-     m_maxPixelValue(0),
-     m_alpha(0),
-     m_origin(0, 0),
-     m_indexedFlag(false)
-{
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   m_spatialExtents[0] = tileSize.x;
-   m_spatialExtents[1] = tileSize.y;
-   initializeDefaults();
-}
-
-ossimImageData::ossimImageData(ossimSource* owner,
-                               ossimScalarType scalar,
-                               ossim_uint32 bands,
-                               ossim_uint32 width,
-                               ossim_uint32 height)
-   : ossimRectilinearDataObject(owner,
-                               bands,
-                               width, // 2-D array
-                               height,
-                               scalar),
-     m_nullPixelValue(0),
-     m_minPixelValue(0),
-     m_maxPixelValue(0),
-     m_alpha(0),
-     m_origin(0, 0),
-     m_indexedFlag(false)
-{   
-   m_spatialExtents[0] = width;
-   m_spatialExtents[1] = height;
-   initializeDefaults();
-}
-
-ossimImageData::ossimImageData(const ossimImageData &rhs)
-   : ossimRectilinearDataObject(rhs),
-     m_nullPixelValue(rhs.m_nullPixelValue),
-     m_minPixelValue(rhs.m_minPixelValue),
-     m_maxPixelValue(rhs.m_maxPixelValue),
-     m_alpha(rhs.m_alpha),
-     m_origin(rhs.m_origin),
-     m_indexedFlag(rhs.m_indexedFlag)
-{
-}
-
-const ossimImageData& ossimImageData::operator=(const ossimImageData& rhs)
-{
-   if (this != &rhs)
-   {
-      // ossimRectilinearDataObject initialization:
-      ossimRectilinearDataObject::operator=(rhs);
-      
-      // ossimImageData (this) members:
-      m_nullPixelValue = rhs.m_nullPixelValue;
-      m_minPixelValue  = rhs.m_minPixelValue;
-      m_maxPixelValue  = rhs.m_maxPixelValue;
-      m_alpha          = rhs.m_alpha;
-      m_origin         = rhs.m_origin;
-      m_indexedFlag    = rhs.m_indexedFlag;
-   }
-   return *this;
-}
-
-ossimImageData::~ossimImageData()
-{
-}
-
-bool ossimImageData::isValidBand(ossim_uint32 band) const
-{
-   return (band<getNumberOfDataComponents());
-}
-
-ossim_uint32 ossimImageData::getSize() const
-{
-   return (getSizePerBand() * getNumberOfDataComponents());
-}
-
-ossim_uint32 ossimImageData::getSizePerBand() const
-{
-   return (getHeight() * getWidth());
-}
-
-ossim_uint32 ossimImageData::getSizeInBytes() const
-{
-   return (getSizePerBandInBytes() * getNumberOfDataComponents());
-}
-
-ossim_uint32 ossimImageData::getSizePerBandInBytes() const
-{
-   return (getHeight() * getWidth() * getScalarSizeInBytes());
-}
-
-const ossim_uint8* ossimImageData::getAlphaBuf() const
-{
-   if (m_alpha.size() > 0)
-   {
-      return &m_alpha.front();
-   }
-   return 0;
-}
-
-ossim_uint8* ossimImageData::getAlphaBuf()
-{
-   if (m_alpha.size() > 0)
-   {
-      return &m_alpha.front();
-   }
-   return 0;
-}
-
-const void* ossimImageData::getBuf() const
-{
-   if (m_dataBuffer.size() > 0)
-   {
-      return static_cast<const void*>(&m_dataBuffer.front());
-   }
-   return 0;
-}
-
-void* ossimImageData::getBuf()
-{
-   if (m_dataBuffer.size() > 0)
-   {
-      return static_cast<void*>(&m_dataBuffer.front());
-   }
-   return 0;
-}
-
-const void* ossimImageData::getBuf(ossim_uint32 band) const
-{
-   const ossim_uint8* b = static_cast<const ossim_uint8*>(getBuf());
-   
-   if (isValidBand(band) && b != 0)
-   {
-      b += (band * getSizePerBandInBytes());
-      return static_cast<const void*>(b);
-   }
-   return 0;
-}
-
-void* ossimImageData::getBuf(ossim_uint32 band)
-{
-   ossim_uint8* b = static_cast<ossim_uint8*>(getBuf());
-   
-   if (isValidBand(band) && b != 0)
-   {
-      b += (band * getSizePerBandInBytes());
-      return static_cast<void*>(b);
-   }
-   return 0;
-}
-
-const ossim_uint8* ossimImageData::getUcharBuf() const
-{
-   if (m_scalarType == OSSIM_UINT8)
-   {
-      return static_cast<const ossim_uint8*>(getBuf());
-   }
-   return 0;
-}
-
-const ossim_uint16* ossimImageData::getUshortBuf() const
-{
-   if (m_scalarType == OSSIM_UINT16 ||
-       m_scalarType == OSSIM_USHORT11)
-   {
-      return static_cast<const ossim_uint16*>(getBuf());
-   }
-   return 0;
-}
-
-const ossim_sint16* ossimImageData::getSshortBuf() const
-{
-   if (m_scalarType == OSSIM_SINT16)
-   {
-      return static_cast<const ossim_sint16*>(getBuf());
-   }
-   return 0;
-}
-
-const ossim_float32* ossimImageData::getFloatBuf() const
-{
-   if (m_scalarType == OSSIM_FLOAT32 ||
-       m_scalarType == OSSIM_NORMALIZED_FLOAT)
-   {
-      return static_cast<const ossim_float32*>(getBuf());
-   }
-   return 0;
-}
-
-const ossim_float64* ossimImageData::getDoubleBuf() const
-{
-   if (m_scalarType == OSSIM_FLOAT64 ||
-       m_scalarType == OSSIM_NORMALIZED_DOUBLE)
-   {
-      return static_cast<const ossim_float64*>(getBuf());
-   }
-   return 0;
-}
-
-ossim_uint8* ossimImageData::getUcharBuf() 
-{
-   if (m_scalarType == OSSIM_UINT8)
-   {
-      return static_cast<ossim_uint8*>(getBuf());
-   }
-   return 0;
-}
-
-ossim_uint16* ossimImageData::getUshortBuf() 
-{
-   if (m_scalarType == OSSIM_UINT16 ||
-       m_scalarType == OSSIM_USHORT11)
-   {
-      return static_cast<ossim_uint16*>(getBuf());
-   }
-   return 0;
-}
-
-ossim_sint16* ossimImageData::getSshortBuf() 
-{
-   if (m_scalarType == OSSIM_SINT16)
-   {
-      return static_cast<ossim_sint16*>(getBuf());
-   }
-   return 0;
-}
-
-ossim_float32* ossimImageData::getFloatBuf() 
-{
-   if (m_scalarType == OSSIM_FLOAT32 ||
-       m_scalarType == OSSIM_NORMALIZED_FLOAT)
-   {
-      return static_cast<ossim_float32*>(getBuf());
-   }
-   return 0;
-}
-
-ossim_float64* ossimImageData::getDoubleBuf() 
-{
-   if (m_scalarType == OSSIM_FLOAT64 ||
-       m_scalarType == OSSIM_NORMALIZED_DOUBLE)
-   {
-      return static_cast<ossim_float64*>(getBuf());
-   }
-   return 0;
-}
-
-const ossim_uint8* ossimImageData::getUcharBuf(ossim_uint32 band) const
-{
-   if (m_scalarType == OSSIM_UINT8)
-   {
-      return static_cast<const ossim_uint8*>(getBuf(band));
-   }
-   return 0;
-}
-
-const ossim_uint16* ossimImageData::getUshortBuf(ossim_uint32 band) const
-{
-   if (m_scalarType == OSSIM_UINT16 ||
-       m_scalarType == OSSIM_USHORT11)
-   {
-      return static_cast<const ossim_uint16*>(getBuf(band));
-   }
-   return 0;
-}
-
-const ossim_sint16* ossimImageData::getSshortBuf(ossim_uint32 band) const
-{
-   if (m_scalarType == OSSIM_SINT16)
-   {
-      return static_cast<const ossim_sint16*>(getBuf(band));
-   }
-   return 0;
-}
-
-const ossim_float32* ossimImageData::getFloatBuf(ossim_uint32 band) const
-{
-   if (m_scalarType == OSSIM_FLOAT32 ||
-       m_scalarType == OSSIM_NORMALIZED_FLOAT)
-   {
-      return static_cast<const ossim_float32*>(getBuf(band));
-   }
-   return 0;
-}
-
-const ossim_float64* ossimImageData::getDoubleBuf(ossim_uint32 band) const
-{
-   if (m_scalarType == OSSIM_FLOAT64 ||
-       m_scalarType == OSSIM_NORMALIZED_DOUBLE)
-   {
-      return static_cast<const ossim_float64*>(getBuf(band));
-   }
-   return 0;
-}
-
-ossim_uint8* ossimImageData::getUcharBuf(ossim_uint32 band) 
-{
-   if (m_scalarType == OSSIM_UINT8)
-   {
-      return static_cast<ossim_uint8*>(getBuf(band));
-   }
-   return 0;
-}
-
-ossim_uint16* ossimImageData::getUshortBuf(ossim_uint32 band) 
-{
-   if (m_scalarType == OSSIM_UINT16 ||
-       m_scalarType == OSSIM_USHORT11)
-   {
-      return static_cast<ossim_uint16*>(getBuf(band));
-   }
-   return 0;
-}
-
-ossim_sint16* ossimImageData::getSshortBuf(ossim_uint32 band) 
-{
-   if (m_scalarType == OSSIM_SINT16)
-   {
-      return static_cast<ossim_sint16*>(getBuf(band));
-   }
-   return 0;
-}
-
-ossim_float32* ossimImageData::getFloatBuf(ossim_uint32 band) 
-{
-   if (m_scalarType == OSSIM_FLOAT32 ||
-       m_scalarType == OSSIM_NORMALIZED_FLOAT)
-   {
-      return static_cast<ossim_float32*>(getBuf(band));
-   }
-   return 0;
-}
-
-ossim_float64* ossimImageData::getDoubleBuf(ossim_uint32 band) 
-{
-   if (m_scalarType == OSSIM_FLOAT64 ||
-       m_scalarType == OSSIM_NORMALIZED_DOUBLE)
-   {
-      return static_cast<ossim_float64*>(getBuf(band));
-   }
-   return 0;
-}
-
-void ossimImageData::getNormalizedFloat(ossim_uint32 offset,
-                                        ossim_uint32 bandNumber,
-                                        ossim_float32& result)const
-{
-   // Make sure that the types and width and height are good.
-   if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
-   {
-      ossim_float32 p = 0.0;
-
-      switch (getScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            const unsigned char* sourceBuf = getUcharBuf(bandNumber);
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_SINT8:
-         {
-            const ossim_sint8* sourceBuf = static_cast<const ossim_sint8*>(getBuf(bandNumber));
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_USHORT11:
-         case OSSIM_UINT16:
-         {
-            const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            const ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_UINT32:
-         {
-            const ossim_uint32* sourceBuf =
-               static_cast<const ossim_uint32*>(getBuf(bandNumber));
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_SINT32:
-         {
-            const ossim_sint32* sourceBuf = static_cast<const ossim_sint32*>(getBuf(bandNumber));
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_FLOAT32:
-         {
-            const ossim_float32* sourceBuf = getFloatBuf(bandNumber);
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_FLOAT64:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            const ossim_float64* sourceBuf = getDoubleBuf(bandNumber);
-            p = sourceBuf[offset];
-            break;
-         }
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-         {
-            // Shouldn't hit this.
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
-               << std::endl;
-         }
-         
-      } // Matches: switch (getScalarType())
-
-      if ( p != m_nullPixelValue[bandNumber] )
-      {
-         const ossim_float32 DELTA = m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber] - 1;
-         const ossim_float32 OFFSET_TO_ONE = 1 - m_minPixelValue[bandNumber];
-         
-         result = ( p <= m_maxPixelValue[bandNumber] ) ?
-            ( ( p >= m_minPixelValue[bandNumber] ) ? ( p + OFFSET_TO_ONE ) / DELTA : 0.0 ) : 1.0;
-      }
-      else
-      {
-         result = 0.0;
-      }
-      
-   } // Matches: if( (getDataObjectStatus() ...
-   
-} // End: ossimImageData::getNormalizedFloat
-
-void ossimImageData::setNormalizedFloat(ossim_uint32 offset,
-                                        ossim_uint32 bandNumber,
-                                        ossim_float32 inputValue)
-{
-   // Make sure that the types and width and height are good.
-   if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
-   {
-
-      ossim_float32 p = 0.0;
-
-      if ( inputValue )
-      {
-         const ossim_float32 DELTA = m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber] - 1;
-         const ossim_float32 OFFSET_TO_MIN = m_minPixelValue[bandNumber] - 1;
-         p = inputValue * DELTA + OFFSET_TO_MIN + 0.5;
-         if ( p > m_maxPixelValue[bandNumber] )
-         {
-            p = m_maxPixelValue[bandNumber];
-         }
-      }
-      else
-      {
-         p = m_nullPixelValue[bandNumber];
-      }
-   
-      switch (getScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            unsigned char* sourceBuf = getUcharBuf(bandNumber);
-            sourceBuf[offset] = static_cast<ossim_uint8>( p );
-            break;
-         }
-         case OSSIM_SINT8:
-         {
-            ossim_sint8* sourceBuf = static_cast<ossim_sint8*>(getBuf(bandNumber));
-            sourceBuf[offset] = static_cast<ossim_sint8>( p );
-            break;
-         }
-         case OSSIM_USHORT11:
-         case OSSIM_UINT16:
-         {
-            ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
-            sourceBuf[offset] = static_cast<ossim_uint16>( p );
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
-            sourceBuf[offset] = static_cast<ossim_sint16>( p );
-            break;
-         }
-         case OSSIM_UINT32:
-         {
-            ossim_uint32* sourceBuf = static_cast<ossim_uint32*>(getBuf(bandNumber));
-            sourceBuf[offset] = static_cast<ossim_uint32>( p );
-            break;
-         }
-         case OSSIM_SINT32:
-         {
-            ossim_sint32* sourceBuf = static_cast<ossim_sint32*>(getBuf(bandNumber));
-            sourceBuf[offset] = static_cast<ossim_sint32>( p );
-            break;
-         }
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_FLOAT32:
-         {
-            ossim_float32* sourceBuf = getFloatBuf(bandNumber);
-            sourceBuf[offset] = p;
-            break;
-         }
-         case OSSIM_FLOAT64:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            ossim_float64* sourceBuf = getDoubleBuf(bandNumber);
-            sourceBuf[offset] = p;
-            break;
-         }
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-            // Shouldn't hit this.
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
-               << std::endl;
-            
-      } // Matches: switch (getScalarType())
-
-   } // Matches: if( (getDataObjectStatus() ...
-   
-} // End: ossimImageData::setNormalizedFloat
-
-void ossimImageData::convertToNormalizedFloat(ossimImageData* result)const
-{
-   if(!result)
-   {
-      return;
-   }
-   // make sure that the types and width and height are
-   // good.
-   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
-       (result->getNumberOfBands() != this->getNumberOfBands())||
-       (result->getWidth() != this->getWidth()) ||
-       (result->getHeight() != this->getHeight())||
-       (result->getDataObjectStatus() == OSSIM_NULL) ||
-       (getDataObjectStatus() == OSSIM_NULL))
-   {
-      return;
-   }
-
-   copyTileToNormalizedBuffer((ossim_float32*)result->getBuf());
-   result->setDataObjectStatus(getDataObjectStatus());
-}
-
-ossimRefPtr<ossimImageData> ossimImageData::newNormalizedFloat()const
-{
-   ossimRefPtr<ossimImageData> result =
-      new ossimImageData(0,
-                         OSSIM_NORMALIZED_FLOAT,
-                         this->getNumberOfBands(),
-                         this->getWidth(),
-                         this->getHeight());
-   
-   result->initialize();
-   
-   convertToNormalizedFloat(result.get());
-   
-   return result;
-}
-
-void ossimImageData::convertToNormalizedDouble(ossimImageData* result)const
-{
-   if(!result)
-   {
-      return;
-   }
-   // make sure that the types and width and height are
-   // good.
-   if( (result->getScalarType() != OSSIM_NORMALIZED_DOUBLE) ||
-       (result->getNumberOfBands() != this->getNumberOfBands())||
-       (result->getWidth() != this->getWidth()) ||
-       (result->getHeight() != this->getHeight())||
-       (result->getDataObjectStatus() == OSSIM_NULL) ||
-       (getDataObjectStatus() == OSSIM_NULL))
-   {
-      return;
-   }
-
-   copyTileToNormalizedBuffer((ossim_float64*)result->getBuf());
-   result->setDataObjectStatus(getDataObjectStatus());
-}
-
-ossimImageData* ossimImageData::newNormalizedDouble()const
-{
-   ossimImageData* result = new ossimImageData(0,
-                                               OSSIM_NORMALIZED_DOUBLE,
-                                               this->getNumberOfBands(),
-                                               this->getWidth(),
-                                               this->getHeight());
-   result->initialize();
-
-   convertToNormalizedDouble(result);
-   
-   return result;   
-}
-
-
-void ossimImageData::unnormalizeInput(ossimImageData* normalizedInput)
-{
-   if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
-      (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
-   {
-      //ERROR
-      return;
-   }
-
-   if(normalizedInput->getScalarType() == OSSIM_NORMALIZED_DOUBLE)
-   {
-      copyNormalizedBufferToTile((ossim_float64*)normalizedInput->getBuf());
-   }
-   else
-   {
-      copyNormalizedBufferToTile((ossim_float32*)normalizedInput->getBuf());
-   }
-}
-
-ossim_float64 ossimImageData::computeMeanSquaredError(
-   ossim_float64 meanValue,
-   ossim_uint32 bandNumber) const
-{
-   ossim_float64 result = -1; // invalid MSE
-   
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         result = computeMeanSquaredError(ossim_uint8(0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         result = computeMeanSquaredError(ossim_sint8(0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         result = computeMeanSquaredError(ossim_uint16(0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_SINT16:
-      {
-         result = computeMeanSquaredError(ossim_sint16(0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_UINT32:
-      {
-         result = computeMeanSquaredError(ossim_uint32(0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_SINT32:
-      {
-         result = computeMeanSquaredError(ossim_sint32(0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         result = computeMeanSquaredError(ossim_float32(0.0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         result = computeMeanSquaredError(ossim_float64(0.0),
-                                          meanValue,
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::computeMeanSquaredError File %s line %d\n\
-Invalid scalar type:  %d",
-                       __FILE__,
-                       __LINE__,
-                       getScalarType());
-         break;
-      }
-   }
-
-   return result;
-}
-   
-template <class T> ossim_float64 ossimImageData::computeMeanSquaredError(
-   T, /* dummyTemplate */
-   ossim_float64 meanValue,
-   ossim_uint32 bandNumber) const
-{
-   ossim_float64  result               = -1.0; // invalid MSE
-
-   if ( (getDataObjectStatus() == OSSIM_NULL) ||
-        (getDataObjectStatus() == OSSIM_EMPTY) )
-   {
-      return result;
-   }
-   
-   ossim_uint32  index           = 0;
-   ossim_float64 delta           = 0.0;
-   ossim_uint32  validPixelCount = 0;
-
-   const T* BUFFER = static_cast<const T*>(getBuf(bandNumber));
-   if(BUFFER)
-   {
-      const ossim_uint32 BOUNDS = getSizePerBand();
-      for(index = 0; index < BOUNDS; ++index)
-      {
-         if(!isNull(index))
-         {
-            delta = BUFFER[index] - meanValue;
-            result += (delta*delta);
-            ++validPixelCount;
-         }
-      }
-      if(validPixelCount > 0)
-      {
-         result /= validPixelCount;
-      }
-   }
-
-   return result;
-}
-
-
-//******************************************************************
-//
-// NOTE: I was checking for null and not adding it to the histogram.
-//       this was messing up the equalization algorithms since the
-//       accumulation histogram did not represent the area of the
-//       image.  For now I will leave out the check for "is null" and
-//       add this to the count so that the total accumulation is the
-//       area of the image.
-//
-//******************************************************************
-void ossimImageData::populateHistogram(ossimRefPtr<ossimMultiBandHistogram> histo)
-{
-   ossim_uint32 numberOfBands = getNumberOfBands();
-
-   if( (getDataObjectStatus() == OSSIM_NULL) ||
-       (getDataObjectStatus() == OSSIM_EMPTY)||
-       (!histo))
-   {
-      return;
-   }
-   switch(getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-            if(currentHisto.valid())
-            {
-               float* histoBins = currentHisto->GetCounts();
-               int binCount = currentHisto->GetRes();
-               ossim_uint8* buffer = (ossim_uint8*)getBuf(band);
-               ossim_uint32 upperBound = getWidth()*getHeight();
-               if ( binCount == 256 )
-               {
-                  for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-                  {
-                     ++histoBins[ buffer[offset] ];
-                  }
-               }
-               else
-               {
-                 for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-                  {
-                     currentHisto->UpCount((float)buffer[offset]);
-                  }
-               }
-            }
-         }
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-	 
-             ossim_uint16* buffer = (ossim_uint16*)getBuf(band);
-             if(currentHisto.valid())
-             {
-                ossim_uint32 upperBound = getWidth()*getHeight();
-                for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-                {
-                  currentHisto->UpCount((float)buffer[offset]);
-                }
-             }
-         }
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-            ossim_sint16* buffer = (ossim_sint16*)getBuf(band);
-            
-            if(currentHisto.valid())
-            {
-               ossim_uint32 upperBound = getWidth()*getHeight();
-               for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-               {
-                  currentHisto->UpCount((float)buffer[offset]);
-               }
-            }
-         }
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-            ossim_sint32* buffer = (ossim_sint32*)getBuf(band);
-            
-            if(currentHisto.valid())
-            {
-               ossim_uint32 upperBound = getWidth()*getHeight();
-               for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-               {
-                  currentHisto->UpCount((float)buffer[offset]);
-               }
-            }
-         }
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-            ossim_uint32* buffer = (ossim_uint32*)getBuf(band);
-            
-            if(currentHisto.valid())
-            {
-               ossim_uint32 upperBound = getWidth()*getHeight();
-               for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-               {
-                  currentHisto->UpCount((float)buffer[offset]);
-               }
-            }
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-            ossim_float64* buffer = (ossim_float64*)getBuf(band);
-            
-            if(currentHisto.valid())
-            {
-               ossim_uint32 upperBound = getWidth()*getHeight();
-               for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-               {
-                  currentHisto->UpCount((float)buffer[offset]);
-               }
-            }
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
-         {
-            ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
-            ossim_float32* buffer = (ossim_float32*)getBuf(band);
-            
-            if(currentHisto.valid())
-            {
-               ossim_uint32 upperBound = getWidth()*getHeight();
-               for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-               {
-                  currentHisto->UpCount((float)buffer[offset]);
-               }
-            }
-         }
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         //ERROR
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::populateHistogram\n"
-            << "Unknown scalar type." << std::endl;
-      }
-   }  // end of switch
-}
-
-ossim_float64 ossimImageData::computeAverageBandValue(ossim_uint32 bandNumber) const
-{
-   ossim_float64 result = 0.0;
-   
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         result = computeAverageBandValue(ossim_uint8(0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_SINT8:
-      {
-         result = computeAverageBandValue(ossim_sint8(0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         result = computeAverageBandValue(ossim_uint16(0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_SINT16:
-      {
-         result = computeAverageBandValue(ossim_sint16(0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_UINT32:
-      {
-         result = computeAverageBandValue(ossim_uint32(0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_SINT32:
-      {
-         result = computeAverageBandValue(ossim_sint32(0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         result = computeAverageBandValue(ossim_float32(0.0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         result = computeAverageBandValue(ossim_float64(0.0),
-                                          bandNumber);
-         break;
-      }  
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::computeAverageBandValue File %s line %d\n\
-Invalid scalar type:  %d",
-                       __FILE__,
-                       __LINE__,
-                       getScalarType());
-         break;
-      }
-   }
-
-   return result;
-}
-
-template <class T> ossim_float64 ossimImageData::computeAverageBandValue(
-   T, /* dummy */
-   ossim_uint32 bandNumber) const
-{
-   ossim_float64  result = 0.0;
-
-   if ( (getDataObjectStatus() == OSSIM_NULL) ||
-        (getDataObjectStatus() == OSSIM_EMPTY) )
-   {
-      return result;
-   }
-   
-   ossim_uint32 index = 0;
-   ossim_uint32 validPixelCount = 0;
-
-   const T* BUFFER = static_cast<const T*>(getBuf(bandNumber));
-   if(BUFFER)
-   {
-      const ossim_uint32 BOUNDS = getSizePerBand();
-      for(index = 0; index < BOUNDS; ++index)
-      {
-         if(!isNull(index))
-         {
-            result += BUFFER[index];
-            ++validPixelCount;
-         }
-      }
-      if(validPixelCount > 0)
-      {
-         result /= validPixelCount;
-      }
-   }
-
-   return result;
-}
-
-ossimDataObjectStatus ossimImageData::validate() const
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         return validate(ossim_uint8(0));
-      }
-      case OSSIM_SINT8:
-      {
-         return validate(ossim_sint8(0));
-      }
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         return validate(ossim_uint16(0));
-      }  
-      case OSSIM_SINT16:
-      {
-         return validate(ossim_sint16(0));
-      }
-         
-      case OSSIM_UINT32:
-      {
-         return validate(ossim_uint32(0));
-      }  
-      case OSSIM_SINT32:
-      {
-         return validate(ossim_sint32(0));
-      }  
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         return validate(ossim_float32(0.0));
-      }
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         return validate(ossim_float64(0.0));
-      }  
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
-         break;
-      }
-   }
-
-   return OSSIM_STATUS_UNKNOWN;
-}
-
-template <class T>
-ossimDataObjectStatus ossimImageData::validate(T /* dummyTemplate */ ) const
-{
-   if (m_dataBuffer.size() == 0)
-   {
-      setDataObjectStatus(OSSIM_NULL);
-      m_percentFull = 0;
-      return OSSIM_NULL;
-   }
-
-   ossim_uint32       count           = 0;
-   const ossim_uint32 SIZE            = getSize();
-   const ossim_uint32 BOUNDS          = getSizePerBand();
-   const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
-   
-   for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
-   {
-      const T NP = static_cast<T>(m_nullPixelValue[band]);
-      const T* p = static_cast<const T*>(getBuf(band));
-      
-      for (ossim_uint32 i = 0; i < BOUNDS; ++i)
-      {
-         // check if the band is null
-         if (p[i] != NP) ++count;         
-      }
-   }
-
-   if (!count)
-   {
-      setDataObjectStatus(OSSIM_EMPTY);
-      m_percentFull = 0;
-   }
-   else if (count == SIZE)
-   {
-      setDataObjectStatus(OSSIM_FULL);
-      m_percentFull = 100;
-   }
-   else
-   {
-      setDataObjectStatus(OSSIM_PARTIAL);
-      m_percentFull = 100.0 * count / SIZE;
-   }
-   return getDataObjectStatus();
-}
-
-void ossimImageData::makeBlank()
-{
-   if ( (m_dataBuffer.size() == 0) || (getDataObjectStatus() == OSSIM_EMPTY) )
-   {
-      return; // nothing to do...
-   }
-
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         makeBlank(ossim_uint8(0));
-         return;
-      }  
-      case OSSIM_SINT8:
-      {
-         makeBlank(ossim_sint8(0));
-         return;
-      }  
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         makeBlank(ossim_uint16(0));
-         return;
-      }  
-      case OSSIM_SINT16:
-      {
-         makeBlank(ossim_sint16(0));
-         return;
-      }  
-      case OSSIM_UINT32:
-      {
-         makeBlank(ossim_uint32(0));
-         return;
-      }
-      case OSSIM_SINT32:
-      {
-         makeBlank(ossim_sint32(0));
-         return;
-      }  
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         makeBlank(ossim_float32(0.0));
-         return;
-      }  
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         makeBlank(ossim_float64(0.0));
-         return;
-      }  
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::makeBlank File %s line %d\n\
-Invalid scalar type:  %d",
-                       __FILE__,
-                       __LINE__,
-                       getScalarType());
-         break;
-      }
-   }
-}
-
-template <class T> void ossimImageData::makeBlank(T /* dummyTemplate */ )
-{
-   // Note: Empty buffer or already OSSIM_EMPTY checked in public method.
-   
-   const ossim_uint32 BANDS = getNumberOfBands();
-   const ossim_uint32 SPB   = getSizePerBand();
-   ossim_uint32 sizePerBandInBytes = getSizePerBandInBytes();
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const T NP = static_cast<T>(m_nullPixelValue[band]);
-      if(NP == 0.0)
-      {
-         // do an optimize byte fill
-         memset(getBuf(band), '\0', sizePerBandInBytes);
-      }
-      else
-      {
-         // slower assign call
-         T* p = static_cast<T*>(getBuf(band));
-         for (ossim_uint32 i = 0; i < SPB; ++i)
-         {
-            p[i] = NP;
-         }
-      }
-   }
-   
-   setDataObjectStatus(OSSIM_EMPTY);
-}
-
-void ossimImageData::initialize()
-{
-   // let the base class allocate a buffer
-   ossimRectilinearDataObject::initialize();
-   
-   if (m_dataBuffer.size() > 0)
-   {
-      makeBlank();  // Make blank will set the status.
-   }
-}
-
-// Write the tile out to disk with a general raster header file.
-bool ossimImageData::write(const ossimFilename& f) const
-{
-   bool result = false;
-
-   std::ofstream os;
-   os.open(f.c_str(), ios::out | ios::binary);
-   if (os.good())
-   {
-      // Write the tile out.
-      os.write(static_cast<const char*>(getBuf()),
-               static_cast<std::streamsize>(getSizeInBytes()));
-      
-      result = os.good();
-      if (result)
-      {
-         // Write a header file that we can use to read the tile.
-         os.close();
-         ossimFilename hdrFile = f;
-         hdrFile.setExtension("hdr");
-         os.open(hdrFile.c_str(), ios::out);
-         result = os.good();
-         if (result)
-         {
-            os << "filename: " << f.c_str()
-               << "\nimage_type:  general_raster_bsq"
-               << "\nindexed: " << m_indexedFlag               
-               << "\ninterleave_type:  bsq"
-               << "\norigin: " << m_origin
-               << "\nnumber_bands: " << ossimString::toString(getNumberOfBands())
-               << "\nnumber_lines: " << ossimString::toString(getHeight())
-               << "\nnumber_samples: " << ossimString::toString(getWidth())
-               << "\nscalar_type: "
-               << ossimScalarTypeLut::instance()->getEntryString(getScalarType())
-               << "\n";
-            for(ossim_uint32 band=0; band < getNumberOfBands(); ++band)
-            {
-               ossimString bs = "band";
-               bs += ossimString::toString(band+1); 
-               os << bs.c_str() << ".min_value: " << m_minPixelValue[band] << "\n"
-                  << bs.c_str() << ".max_value: " << m_maxPixelValue[band] << "\n"
-                  << bs.c_str() << ".null_value: " << m_nullPixelValue[band]
-                  << std::endl;
-            }
-         }
-      }
-   }
-   os.close();
-   
-   return result;
-}
-
-bool ossimImageData::isWithin(ossim_int32 x, ossim_int32 y)
-{
-   return ((x >= m_origin.x) &&
-           (x <  m_origin.x + static_cast<ossim_int32>(m_spatialExtents[0])) &&
-           (y >= m_origin.y) &&
-           (y <  m_origin.y + static_cast<ossim_int32>(m_spatialExtents[1])));
-           
-}
-
-void ossimImageData::setValue(ossim_int32 x, ossim_int32 y, ossim_float64 color)
-{
-   if(m_dataBuffer.size() > 0 && isWithin(x, y))
-   {
-      ossim_uint32 band=0;
-
-      //***
-      // Compute the offset into the buffer for (x,y).  This should always
-      // come out positive.
-      //***
-      ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
-      ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
-      
-      ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
-      
-      switch (getScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               unsigned char* buf = static_cast<unsigned char*>(getBuf(band))+
-                  offset;
-               *buf = (unsigned char)color;
-            }
-            break;
-         }
-         case OSSIM_SINT8:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+
-                  offset;
-               *buf = (ossim_sint8)color;
-            }
-            break;
-         }
-         case OSSIM_UINT16:
-         case OSSIM_USHORT11:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+
-                  offset;
-               *buf = (ossim_uint16)color;
-            }
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               signed short* buf = static_cast<signed short*>(getBuf(band))+
-                  offset;
-               *buf = (signed short)color;
-            }
-            break;
-         }
-         case OSSIM_UINT32:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+
-                  offset;
-               *buf = (ossim_uint32)color;
-            }
-            break;
-         }
-         case OSSIM_SINT32:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+
-                  offset;
-               *buf = (ossim_sint32)color;
-            }
-            break;
-         }
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_FLOAT32:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
-               *buf = (ossim_float32)color;
-            }
-            break;
-         }
-         case OSSIM_FLOAT64:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            for(band = 0; band < m_numberOfDataComponents; band++)
-            {
-               ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
-               *buf = color;
-            }
-            break;
-         }
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-         {
-            //ERROR
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimImageData::setValue Unsupported scalar type!"
-               << std::endl;
-            
-         }
-         
-      } // End of:  switch (getScalarType())
-   }
-}
-
-void ossimImageData::initializeDefaults()
-{
-   initializeMinDefault();
-   initializeMaxDefault();
-   initializeNullDefault();
-}
-
-void ossimImageData::initializeMinDefault()
-{
-   if(!m_numberOfDataComponents)
-   {
-      return;
-   }
-
-   m_minPixelValue.resize(m_numberOfDataComponents);
-
-   ossim_float64 value = ossim::defaultMin( getScalarType() );
-   
-   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
-   {
-      m_minPixelValue[band]  = value;
-   }
-}
-
-void ossimImageData::initializeMaxDefault()
-{
-   if(!m_numberOfDataComponents)
-   {
-      return;
-   }
-
-   m_maxPixelValue.resize(m_numberOfDataComponents);
-
-   ossim_float64 value = ossim::defaultMax( getScalarType() );
-      
-   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
-   {
-      m_maxPixelValue[band]  = value;
-   }
-}
-
-void ossimImageData::initializeNullDefault()
-{
-   if(!m_numberOfDataComponents)
-   {
-      return;
-   }
-
-   m_nullPixelValue.resize(m_numberOfDataComponents);
-
-   ossim_float64 value = ossim::defaultNull( getScalarType() );
-   
-   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
-   {
-      m_nullPixelValue[band]  = value;
-   }
-}
-
-bool ossimImageData::isEqualTo(const ossimDataObject& rhs,
-                               bool deepTest)const
-{
-   ossimImageData* rhsPtr = PTR_CAST(ossimImageData, &rhs);
-   if(!rhsPtr) return false;
-   bool result = ( (m_scalarType         == rhsPtr->m_scalarType)&&
-                   (m_numberOfDataComponents == rhsPtr->m_numberOfDataComponents)&&
-                   (m_origin             == rhsPtr->m_origin)&&
-                   (getWidth()            == rhsPtr->getWidth())&&
-                   (getHeight()           == rhsPtr->getHeight()));
-
-   if(result)
-   {
-      bool test=true;
-      for(ossim_uint32 index = 0; index < m_numberOfDataComponents; ++index)
-      {
-         if(m_minPixelValue[index] != rhsPtr->m_minPixelValue[index])
-         {
-            test = false;
-            break;
-         }
-         if(m_maxPixelValue[index] != rhsPtr->m_maxPixelValue[index])
-         {
-            test = false;
-            break;
-         }
-         if(m_nullPixelValue[index] != rhsPtr->m_nullPixelValue[index])
-         {
-            test = false;
-            break;
-         }
-      }
-      result = test;
-   }
-   if(deepTest&&result)
-   {
-      if(getBuf() != 0 && rhsPtr->getBuf() != 0)
-      {
-         if(memcmp(getBuf(), rhsPtr->getBuf(), getSizeInBytes()) != 0)
-         {
-            result = false;
-         }
-      }
-      else if(getBuf() == 0 && rhsPtr->getBuf() == 0)
-      {
-         // nothing both are null so don't change the result.
-      }
-      else // one is null so not equal.
-      {
-         result = false;
-      }
-   }
-
-   return result;
-}
-
-ossimString ossimImageData::getScalarTypeAsString() const
-{
-   return ossimScalarTypeLut::instance()->getEntryString(getScalarType());
-}
-
-ossim_uint32 ossimImageData::getNumberOfBands() const
-{
-   return getNumberOfDataComponents();
-}
-
-ossim_float64 ossimImageData::getPix(const ossimIpt& position,
-                              ossim_uint32 band) const
-{
-   ossimIpt relative( position.x - m_origin.x,
-                      position.y - m_origin.y);
-   if((relative.x < 0) || (relative.x >= (ossim_int32)m_spatialExtents[0])) return 0.0;
-   if((relative.y < 0) || (relative.y >= (ossim_int32)m_spatialExtents[1])) return 0.0;
-   return getPix((m_spatialExtents[0])*relative.y + relative.x, band);
-}
-
-ossim_float64 ossimImageData::getPix(ossim_uint32 offset, ossim_uint32 band) const
-{
-   switch(m_scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         const ossim_uint8* buf = getUcharBuf(band);
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         const ossim_sint8* buf = static_cast<const ossim_sint8*>(getBuf(band));
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         const ossim_uint16* buf = getUshortBuf(band);
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         const ossim_sint16* buf = getSshortBuf(band);
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         const ossim_sint32* buf = static_cast<const ossim_sint32*>(getBuf(band));
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         const ossim_uint32* buf = static_cast<const ossim_uint32*>(getBuf(band));
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         const ossim_float64* buf = getDoubleBuf(band);
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }      
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         const ossim_float32* buf = getFloatBuf(band);
-         if(buf)
-         {
-            return (ossim_float64)buf[offset];
-         }
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         // Shouldn't hit this.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::fill Unsupported scalar type!"
-            << std::endl;   
-   }
-
-   return 0.0;
-}
-
-void ossimImageData::fill(ossim_uint32 band, ossim_float64 value)
-{
-   void* s         = getBuf(band);
-
-   if (s == 0) return; // nothing to do...
-
-   ossim_uint32 size_in_pixels = getWidth()*getHeight();
-   
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         ossim_uint8* p = getUcharBuf(band);
-         ossim_uint8 np = static_cast<ossim_uint8>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         ossim_sint8* p = static_cast<ossim_sint8*>(getBuf(band));
-         ossim_sint8 np = static_cast<ossim_sint8>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         ossim_uint16* p = getUshortBuf(band);
-         ossim_uint16 np = static_cast<ossim_uint16>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         ossim_sint16* p = getSshortBuf(band);
-         ossim_sint16 np = static_cast<ossim_sint16>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         ossim_uint32* p = static_cast<ossim_uint32*>(getBuf(band));
-         ossim_uint32 np = static_cast<ossim_uint32>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         ossim_sint32* p = static_cast<ossim_sint32*>(getBuf(band));
-         ossim_sint32 np = static_cast<ossim_sint32>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         ossim_float32* p = getFloatBuf(band);
-         ossim_float32 np = static_cast<ossim_float32>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         ossim_float64* p = getDoubleBuf(band);
-         ossim_float64 np = static_cast<ossim_float64>(value);
-         for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
-         
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::makeBlank File %s line %d\n\
-Invalid scalar type:  %d",
-                       __FILE__,
-                       __LINE__,
-                       getScalarType());
-         return;
-   }
-   
-   setDataObjectStatus(OSSIM_EMPTY);
-   
-}
-
-void ossimImageData::fill(ossim_float64 value)
-{
-   ossim_uint32 valueNullCount= 0;
-   for(ossim_uint32 band=0; band < getNumberOfBands(); ++band)
-   {
-      if (value == m_nullPixelValue[band])
-      {
-         ++valueNullCount;
-      }
-      
-      fill(band, value);
-   }
-
-   if (valueNullCount==0)
-   {
-      setDataObjectStatus(OSSIM_FULL);
-   }
-   else if(valueNullCount==getNumberOfBands())
-   {
-      setDataObjectStatus(OSSIM_EMPTY);
-   }
-   else
-   {
-      setDataObjectStatus(OSSIM_PARTIAL);
-   }
-}
-
-
-void ossimImageData::createTestTile()
-{
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      initialize();
-   }
-
-   if ( getDataObjectStatus() != OSSIM_NULL )
-   {
-      switch (getScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            createTestTile(ossim_uint8(0));
-            break;
-         }
-         case OSSIM_SINT8:
-         {
-            createTestTile(ossim_sint8(0));
-            break;
-         }
-         case OSSIM_UINT16:
-         case OSSIM_USHORT11:
-         {
-            createTestTile(ossim_uint16(0));
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            createTestTile(ossim_sint16(0));
-            break;
-         }
-         case OSSIM_UINT32:
-         {
-            createTestTile(ossim_uint32(0));
-            break;
-         }
-         case OSSIM_SINT32:
-         {
-            createTestTile(ossim_sint32(0));
-            break;
-         }
-         case OSSIM_FLOAT32:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            createTestTile(ossim_float32(0));
-            break;
-         }
-         case OSSIM_NORMALIZED_DOUBLE:
-         case OSSIM_FLOAT64:
-         {
-            createTestTile(ossim_float64(0));
-            break;
-         }
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-            ossimSetError(getClassName(),
-                          ossimErrorCodes::OSSIM_ERROR,
-                          "ossimImageData::createTestTile File %s line %d\nInvalid or unhandled scalar type:  %d",
-                          __FILE__,
-                          __LINE__,
-                          getScalarType());
-      }
-   }
-   else
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "ossimImageData::createTestTile File %s line %d\nTile must be initialed!",
-                    __FILE__,
-                    __LINE__,
-                    getScalarType());
-   }
-   
-} // End: ossimImageData::createTestTile()
-
-
-template <class T> void ossimImageData::createTestTile(T)
-{
-   if (getDataObjectStatus() != OSSIM_NULL)
-   {
-      const ossim_uint32  BANDS   = getNumberOfBands();
-      const ossim_uint32  LINES   = getHeight();
-      const ossim_uint32  SAMPS   = getWidth();
-      const ossim_float64 NP      = getNullPix(0);
-      const ossim_float64 MAX_PIX = getMaxPix(0);
-
-      const T STEP = static_cast<T>( (MAX_PIX-NP) / (LINES-1) );
-      
-      for(ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         T* s = (T*)getBuf(band);
-         T p = (T)NP;
-
-         for ( ossim_uint32 line = 0; line < LINES; ++line )
-         {
-            for ( ossim_uint32 samp = 0; samp < SAMPS; ++samp )
-            {
-               s[samp] = p;
-            }
-            p += STEP;
-            s += SAMPS;
-            
-         }
-      }
-
-      validate();
-   }
-   
-} // End: ossimImageData::createTestTile() template implementation.
-
-bool ossimImageData::isNull(ossim_uint32 offset)const
-{
-   ossim_uint32 numberOfBands = getNumberOfBands();
-   ossim_uint32 band=0;
-   if(!getBuf())
-   {
-      return true;
-   }
-
-   switch(getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         for(band = 0; band < numberOfBands; ++band)  
-         {
-            const ossim_uint8* buf = static_cast<const ossim_uint8*>(getBuf(band))+offset;
-            if((*buf) != (ossim_uint8)getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         for(band = 0; band < numberOfBands; ++band)  
-         {
-            const ossim_sint8* buf = static_cast<const ossim_sint8*>(getBuf(band))+offset;
-            if((*buf) != (ossim_uint8)getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_uint16* buf = static_cast<const ossim_uint16*>(getBuf(band))+offset;
-            if((*buf) != (ossim_uint16)getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_sint16* buf = static_cast<const ossim_sint16*>(getBuf(band))+offset;
-            if((*buf) != (ossim_sint16)getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_uint32* buf = static_cast<const ossim_uint32*>(getBuf(band))+offset;
-            if((*buf) != (ossim_uint32)getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_sint32* buf = static_cast<const ossim_sint32*>(getBuf(band))+offset;
-            if((*buf) != (ossim_sint32)getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
-            if((*buf) != 0.0)
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
-            if((*buf) != (ossim_float32)getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
-            if((*buf) != 0.0)
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
-            if((*buf) != getNullPix(band))
-            {
-               return false;
-            }
-         }
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         //ERROR
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::isNull Unsupported scalar type!"
-            << std::endl;
-      }
-   }
-   return true;
-}
-
-bool ossimImageData::isNull(ossim_uint32 offset, ossim_uint32 band)const
-{
-   switch(getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         const ossim_uint8* buf =
-            static_cast<const ossim_uint8*>(getBuf(band))+offset;
-         
-         if((*buf) != (ossim_uint8)getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         const ossim_sint8* buf =
-            static_cast<const ossim_sint8*>(getBuf(band))+offset;
-         
-         if((*buf) != (ossim_sint8)getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         const ossim_uint16* buf =
-            static_cast<const ossim_uint16*>(getBuf(band))+offset;
-         if((*buf) != (ossim_uint16)getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         const ossim_sint16* buf =
-            static_cast<const ossim_sint16*>(getBuf(band))+offset;
-         if((*buf) != (ossim_sint16)getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         const ossim_uint32* buf =
-            static_cast<const ossim_uint32*>(getBuf(band))+offset;
-         if((*buf) != (ossim_uint32)getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         const ossim_sint32* buf =
-            static_cast<const ossim_sint32*>(getBuf(band))+offset;
-         if((*buf) != (ossim_sint32)getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
-         if((*buf) != (ossim_float32)getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
-         if((*buf) != getNullPix(band))
-         {
-            return false;
-         }
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         //ERROR
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::isNull Unsupported scalar type!"
-            << std::endl;
-      }
-   }
-   return true;
-}
-
-bool ossimImageData::isNull(const ossimIpt& pt)const
-{
-   ossim_int32 xNew = (pt.x - m_origin.x);
-   ossim_int32 yNew = (pt.y - m_origin.y);
-   if(xNew < 0 || xNew >= static_cast<ossim_int32>(m_spatialExtents[0]) ||
-      yNew < 0 || yNew >= static_cast<ossim_int32>(m_spatialExtents[1]) )
-   {
-      return true;
-   }
-   ossim_uint32 offset = getWidth()*yNew + xNew;
-   
-   return isNull(offset);
-}
-
-bool ossimImageData::isNull(const ossimIpt& pt, ossim_uint32 band)const
-{
-   ossim_int32 xNew = (pt.x - m_origin.x);
-   ossim_int32 yNew = (pt.y - m_origin.y);
-   if(xNew < 0 || xNew >= static_cast<ossim_int32>(m_spatialExtents[0]) ||
-      yNew < 0 || yNew >= static_cast<ossim_int32>(m_spatialExtents[1]) )
-   {
-      return true;
-   }
-   ossim_uint32 offset = getWidth()*yNew + xNew;
-
-   return isNull(offset, band);
-}
-
-void ossimImageData::setNull(ossim_uint32 offset)
-{
-   ossim_uint32 numberOfBands = getNumberOfBands();
-   ossim_uint32 band=0;
-   switch(getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         for(band = 0; band < numberOfBands; ++band)  
-         {
-            ossim_uint8* buf = static_cast<ossim_uint8*>(getBuf(band))+offset;
-            *buf       = (ossim_uint8)getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         for(band = 0; band < numberOfBands; ++band)  
-         {
-            ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+offset;
-            *buf       = (ossim_sint8)getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+
-               offset;
-            *buf = (ossim_uint16)getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            ossim_sint16* buf = static_cast<ossim_sint16*>(getBuf(band))+
-               offset;
-            *buf = (ossim_sint16)getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+
-               offset;
-            *buf = (ossim_uint32)getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+
-               offset;
-            *buf = (ossim_sint32)getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
-            *buf = (ossim_float32)getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         for(band = 0; band < numberOfBands; band++)
-         {
-            ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
-            *buf = getNullPix(band);
-         }
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         //ERROR
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::isNull Unsupported scalar type!"
-            << std::endl;
-      }
-   }
-}
-
-void ossimImageData::setNull(ossim_uint32 offset, ossim_uint32 band)
-{
-   switch(getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         ossim_uint8* buf = static_cast<ossim_uint8*>(getBuf(band))+offset;
-         *buf       = (ossim_uint8)getNullPix(band);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+offset;
-         *buf       = (ossim_sint8)getNullPix(band);
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+offset;
-         *buf = (ossim_uint16)getNullPix(band);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         ossim_sint16* buf = static_cast<ossim_sint16*>(getBuf(band))+offset;
-         *buf = (ossim_sint16)getNullPix(band);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+offset;
-         *buf       = (ossim_uint32)getNullPix(band);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+offset;
-         *buf       = (ossim_sint32)getNullPix(band);
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
-         *buf = (ossim_float32)getNullPix(band);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
-         *buf = getNullPix(band);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         //ERROR
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::isNull Unsupported scalar type!"
-            << std::endl;
-      }
-   }
-}
-
-void ossimImageData::setNull(const ossimIpt& pt)
-{
-   ossim_int32 xNew = (pt.x - m_origin.x);
-   ossim_int32 yNew = (pt.y - m_origin.y);
-   
-   if(xNew < 0 || xNew >= (int)m_spatialExtents[0] ||
-      yNew < 0 || yNew >= (int)m_spatialExtents[1])
-   {
-      return;
-   }
-   ossim_uint32 offset = ((int)getWidth())*yNew + xNew;
-   
-   setNull(offset);
-}
-
-void ossimImageData::setNull(const ossimIpt& pt, ossim_uint32 band)
-{
-   ossim_int32 xNew = (pt.x - m_origin.x);
-   ossim_int32 yNew = (pt.y - m_origin.y);
-   
-   if(xNew < 0 || xNew >= (int)m_spatialExtents[0] ||
-      yNew < 0 || yNew >= (int)m_spatialExtents[1])
-   {
-      return;
-   }
-   ossim_uint32 offset = ((int)getWidth())*yNew + xNew;
-   
-   setNull(offset, band);
-}
-
-void ossimImageData::setNullPix(ossim_float64 null_pix)
-{
-   if(!m_numberOfDataComponents)
-   {
-      return;
-   }
-   m_nullPixelValue.resize(m_numberOfDataComponents);
-   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
-   {
-      m_nullPixelValue[band] = null_pix;
-   }
-}
-
-void ossimImageData::setNullPix(ossim_float64 null_pix, ossim_uint32 band)
-{
-   if( !m_numberOfDataComponents || (band >= m_numberOfDataComponents) )
-   {
-      return;
-   }
-   if (m_nullPixelValue.size() != m_numberOfDataComponents)
-   {
-      initializeNullDefault();
-   }
-   m_nullPixelValue[band] = null_pix;
-}
-
-void ossimImageData::setNullPix(const ossim_float64* nullPixArray,
-                                ossim_uint32 numberOfValues)
-{
-   if(!nullPixArray || !m_numberOfDataComponents)
-   {
-      return;
-   }
-
-   if (m_nullPixelValue.size() != m_numberOfDataComponents)
-   {
-      initializeNullDefault();
-   }
-   
-   for(ossim_uint32 band = 0;
-       (band < numberOfValues) && (band < m_numberOfDataComponents);
-       ++band)
-   {
-      m_nullPixelValue[band] = nullPixArray[band];
-   }
-}
-
-void ossimImageData::setMinPix(ossim_float64 min_pix)
-{
-   if(!m_numberOfDataComponents)
-   {
-      return;
-   }
-   m_minPixelValue.resize(m_numberOfDataComponents);
-   for(ossim_uint32 band = 0; band < m_minPixelValue.size(); ++band)
-   {
-      m_minPixelValue[band] = min_pix;
-   }
-}
-
-void ossimImageData::setMinPix(ossim_float64 min_pix, ossim_uint32 band)
-{
-   if( !m_numberOfDataComponents || (band >= m_numberOfDataComponents) )
-   {
-      return;
-   }
-   if (m_minPixelValue.size() != m_numberOfDataComponents)
-   {
-      initializeMinDefault();
-   }
-   m_minPixelValue[band] = min_pix;
-}
-
-void ossimImageData::setMinPix(const ossim_float64* minPixArray,
-                               ossim_uint32 numberOfValues)
-{
-   if( !minPixArray || !m_numberOfDataComponents )
-   {
-      return;
-   }
-
-   if (m_minPixelValue.size() != m_numberOfDataComponents)
-   {
-      initializeMinDefault();
-   }
-   
-   for(ossim_uint32 band = 0;
-       (band < numberOfValues) && (band < m_numberOfDataComponents);
-       ++band)
-   {
-      m_minPixelValue[band] = minPixArray[band];
-   }
-}
-
-void ossimImageData::setMaxPix(ossim_float64 max_pix)
-{
-   if(!m_numberOfDataComponents)
-   {
-      return;
-   }
-   m_maxPixelValue.resize(m_numberOfDataComponents);
-   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
-   {
-      m_maxPixelValue[band] = max_pix;
-   }
-}
-
-void ossimImageData::setMaxPix(ossim_float64 max_pix, ossim_uint32 band)
-{
-   if( !m_numberOfDataComponents || (band >= m_numberOfDataComponents) )
-   {
-      return;
-   }
-   if (m_maxPixelValue.size() != m_numberOfDataComponents)
-   {
-      initializeMaxDefault();
-   }
-   m_maxPixelValue[band] = max_pix;
-}
-
-void ossimImageData::setMaxPix(const ossim_float64* maxPixArray,
-                               ossim_uint32 /* numberOfValues */)
-{
-   if(!maxPixArray || !m_numberOfDataComponents )
-   {
-      return;
-   }
-
-   if (m_maxPixelValue.size() != m_numberOfDataComponents)
-   {
-      initializeMaxDefault();
-   }
-   
-   for(ossim_uint32 band = 0;
-       (band < m_numberOfDataComponents) &&
-          (band < m_numberOfDataComponents);
-       ++band)
-   {
-      m_maxPixelValue[band] = maxPixArray[band];
-   }
-}
-
-void ossimImageData::setNumberOfBands(ossim_uint32 bands,
-                                      bool reallocate)
-{
-   ossim_uint32 b  = getNumberOfBands();
-   if(bands && (b != bands))
-   {
-      setNumberOfDataComponents(bands);
-      if(reallocate)
-      {
-         ossimRectilinearDataObject::initialize();
-      }
-      
-      ossim_uint32 minBands = ossim::min(b, bands);
-
-
-      vector<ossim_float64> newNull(bands);
-      vector<ossim_float64> newMin(bands);
-      vector<ossim_float64> newMax(bands);
-
-      ossim_uint32 i = 0;
-      while (i < minBands)
-      {
-         newNull[i] = m_nullPixelValue[i];
-         newMin[i]  = m_minPixelValue[i];
-         newMax[i]  = m_maxPixelValue[i];
-         ++i;
-      }
-
-      if(b)
-      {
-        while (i < bands)
-        {
-           newNull[i] = m_nullPixelValue[b-1];
-           newMin[i]  = m_minPixelValue[b-1];
-           newMax[i]  = m_maxPixelValue[b-1];
-           ++i;
-        }
-      }
-      
-      m_nullPixelValue = newNull;
-      m_minPixelValue  = newMin;
-      m_maxPixelValue  = newMax;
-   }
-}
-
-void ossimImageData::setImageRectangleAndBands(const ossimIrect& rect,
-                                               ossim_uint32 numberOfBands)
-{
-   if(rect.hasNans())
-   {
-      return;
-   }
-   
-   ossim_uint32 bands   = getNumberOfBands();
-   ossim_uint32 w       = getWidth();
-   ossim_uint32 h       = getHeight();
-   ossim_uint32 nw      = rect.width();
-   ossim_uint32 nh      = rect.height();
-
-   setOrigin(rect.ul());
-   setWidthHeight(nw, nh);
-   setNumberOfBands(numberOfBands, false);
-   
-   // we will try to be non destructive on the resize of the number of bands
-   if( ( (w*h != nw*nh)  || ( bands != numberOfBands) ) &&
-       (theDataObjectStatus != OSSIM_NULL) )
-   {
-      initialize();
-   }
-}
-
-void ossimImageData::setImageRectangle(const ossimIrect& rect)
-{
-   if(rect.hasNans())
-   {
-      return;
-   }
-   
-   ossim_uint32 w  = getWidth();
-   ossim_uint32 h  = getHeight();
-   ossim_uint32 nw = rect.width();
-   ossim_uint32 nh = rect.height();
-
-   setOrigin(rect.ul());
-   setWidthHeight(nw, nh);
-
-   // we will try to be non destructive on the resize of the number of bands
-   if ( (w*h != nw*nh) && (theDataObjectStatus != OSSIM_NULL) )
-   {
-      initialize();
-   }
-}
-
-void ossimImageData::assign(const ossimDataObject* data)
-{
-   if(!data) return;
-   ossimImageData* d = PTR_CAST(ossimImageData, data);
-   if(d)
-   {
-      assign(d);
-   }
-}
-
-void ossimImageData::assign(const ossimImageData* data)
-{
-   ossimSource* tmp_owner = getOwner();
-   
-   ossimRectilinearDataObject::assign(data);
-
-   //***
-   // The data member "theSource" will be overwritten so capture it and then
-   // set it back.
-   //***
-   setOwner(tmp_owner);
-
-   if(this != data)
-   {
-      ossim_uint32 numberOfBands = getNumberOfBands();
-      if(!numberOfBands)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::assign\n"
-            << "Number of components is 0, can't assign" << std::endl;
-         return;
-      }
-      m_origin = data->m_origin;
-
-      m_minPixelValue  = data->m_minPixelValue;
-      m_maxPixelValue  = data->m_maxPixelValue;
-      m_nullPixelValue = data->m_nullPixelValue;
-
-      if (m_minPixelValue.size() == 0 ||
-          m_maxPixelValue.size() == 0 ||
-          m_nullPixelValue.size() == 0)
-      {
-         initializeDefaults();
-      }
-   }
-}
-
-void ossimImageData::assignBand(const ossimImageData* data,
-                                ossim_uint32 source_band,
-                                ossim_uint32 output_band)
-{
-   //***
-   // This method requires this image data to be initialized to the same
-   // size as the source data being copied.
-   //***
-
-   // Some basic error checking...
-   if ( !data->isValidBand(source_band) )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::assignBand ERROR:"
-         << "\nInvalid source band!" << std::endl;
-      return;
-   }
-   if ( !isValidBand(output_band) )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::assignBand ERROR:"
-         << "\nInvalid output band!" << std::endl;
-      return;
-   }
-   if (data->getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::assignBand ERROR:"
-         << "\nSource data status is null!" << std::endl;
-      return;
-   }
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::assignBand ERROR:"
-         << "\nThis status is null!" << std::endl;
-      return;
-   }
-   
-   //***
-   // Make sure this buffer is the same size; if not, return.
-   //***
-   ossim_uint32 source_size = data->getSizePerBandInBytes();
-      
-   if ( source_size != getSizePerBandInBytes() )
-   {
-      return;
-   }
-
-   // Get the pointers to the bands.
-   const void*  s = data->getBuf(source_band);
-   void*        d = getBuf(output_band);
-
-   // One last check.
-   if (s == 0 || d == 0)
-   {
-      return;
-   }
-
-   // Ok copy the image data...
-   memcpy(d, s, source_size);
-}
-
-void ossimImageData::loadBand(const void* src,
-                              const ossimIrect& src_rect,
-                              ossim_uint32 band)
-{
-   // Call the appropriate load method.
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadBandTemplate(ossim_uint8(0), src, src_rect, band);
-         return;
-
-      case OSSIM_SINT8:
-         loadBandTemplate(ossim_sint8(0), src, src_rect, band);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadBandTemplate(ossim_uint16(0), src, src_rect, band);
-         return;
-         
-      case OSSIM_SINT16:
-         loadBandTemplate(ossim_sint16(0), src, src_rect, band);
-         return;
-         
-      case OSSIM_UINT32:
-         loadBandTemplate(ossim_uint32(0), src, src_rect, band);
-         return;
-
-      case OSSIM_SINT32:
-         loadBandTemplate(ossim_sint32(0), src, src_rect, band);
-         return;
-         
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-         loadBandTemplate(ossim_float32(0), src, src_rect, band);
-         return;
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadBandTemplate(ossim_float64(0), src, src_rect, band);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadBand\n\
-File %s line %d\nUnknown scalar type!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::loadBand(const void* src,
-                              const ossimIrect& src_rect,
-                              const ossimIrect& clip_rect,
-                              ossim_uint32 band)
-{
-   // Call the appropriate load method.
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadBandTemplate(ossim_uint8(0), src, src_rect, clip_rect, band);
-         return;
-
-      case OSSIM_SINT8:
-         loadBandTemplate(ossim_sint8(0), src, src_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadBandTemplate(ossim_uint16(0), src, src_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_SINT16:
-         loadBandTemplate(ossim_sint16(0), src, src_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_UINT32:
-         loadBandTemplate(ossim_uint32(0), src, src_rect, clip_rect, band);
-         return;
-
-      case OSSIM_SINT32:
-         loadBandTemplate(ossim_sint32(0), src, src_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-         loadBandTemplate(ossim_float32(0), src, src_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadBandTemplate(ossim_float64(0), src, src_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadBand\n\
-File %s line %d\nUnknown scalar type!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-template <class T> void ossimImageData::loadBandTemplate(T, // dummy template variable
-                                                         const void* src,
-                                                         const ossimIrect& src_rect,
-                                                         ossim_uint32 band)
-{
-   const ossimIrect img_rect = getImageRectangle();
-
-   // Get the clip rect.
-   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-   
-   loadBandTemplate(T(0), src, src_rect, clip_rect, band);
-}
-
-template <class T> void ossimImageData::loadBandTemplate(T, // dummy template variable
-                                                         const void* src,
-                                                         const ossimIrect& src_rect,
-                                                         const ossimIrect& clip_rect,
-                                                         ossim_uint32 band)
-{
-   static const char  MODULE[] = "ossimImageData::loadBand";
-   
-   // Check the pointer.
-   if (!src)
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nNULL pointer passed to method!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return;
-   }
-   
-   // Check the band.
-   if (!isValidBand(band))
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nInvalid band:  %d",
-                    MODULE,
-                    __FILE__,
-                    __LINE__,
-                    band);
-      return;
-   }
-   
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Check for intersect.
-   if ( ! img_rect.intersects(src_rect) )
-   {
-      return; // Nothing to do here.
-   }
-
-   // Check the clip rect.
-   if (!clip_rect.completely_within(img_rect))
-   {
-      return;
-   }
-   
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL) initialize();
-
-   // Get the width of the buffers.
-   ossim_uint32 s_width = src_rect.width();
-   ossim_uint32 d_width = getWidth();
-   
-   const T* s = static_cast<const T*>(src);
-   T* d = static_cast<T*>(getBuf(band));
-
-   // Move the pointers to the first valid pixel.
-   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
-        clip_rect.ul().x - src_rect.ul().x;
-   
-   d += (clip_rect.ul().y - img_rect.ul().y) * d_width +
-        clip_rect.ul().x - img_rect.ul().x;
-   
-   // Copy the data.
-   ossim_uint32 clipHeight = clip_rect.height();
-   ossim_uint32 clipWidth  = clip_rect.width();
-  
-   for (ossim_uint32 line = 0; line < clipHeight; ++line)
-   {
-      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-      {
-         d[sample] = s[sample];
-      }
-
-      s += s_width;
-      d += d_width;
-   }
-}
-
-void ossimImageData::loadTile(const ossimImageData* src)
-{
-   if (!src)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::loadTile ERROR:"
-         << "Null tile passed to method!" << std::endl;
-      return;
-   }
-
-   if (!src->getBuf())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::loadTile ERROR:"
-         << "Source tile buff is null!" << std::endl;
-      return;
-   }
-
-   if (!this->getBuf())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::loadTile ERROR:"
-         << "This tile not initialized!" << std::endl;
-      return;
-   }
-
-   if (src->getNumberOfBands() != this->getNumberOfBands())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::loadTile ERROR:"
-         << "Tiles do not have same number of bands!" << std::endl;
-      return;
-   }
-
-   //***
-   // Set the status of this tile to the status of the source tile.
-   // Do this in place of validate.
-   //***
-   setDataObjectStatus(src->getDataObjectStatus());
-   
-   if(getScalarType() == src->getScalarType())
-   {      
-      loadTile((void*)(src->getBuf()),
-               src->getImageRectangle(),
-               OSSIM_BSQ);
-      setNullPix(src->getNullPix(), src->getNumberOfBands());
-   }
-   else // do a slow generic normalize to unnormalize copy
-   {
-      // Check the pointer.
-      ossimIrect src_rect = src->getImageRectangle();
-      const ossimIrect img_rect = getImageRectangle();
-      
-      // Check for intersect.
-      if ( !img_rect.intersects(src_rect) )
-      {
-         return; // Nothing to do here.
-      }
-
-      // Get the clip rect.
-      const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-      // Check the status and allocate memory if needed.
-      if (getDataObjectStatus() == OSSIM_NULL) initialize();
-      
-      // Get the width of the buffers.
-      ossim_uint32 num_bands     = getNumberOfBands();
-      ossim_uint32 s_width       = src_rect.width();
-      ossim_uint32 d_width       = getWidth();
-            
-      ossim_uint32 band;
-      
-      ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) *
-         s_width + (clip_rect.ul().x - src_rect.ul().x);      
-      
-      ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) *
-         d_width + (clip_rect.ul().x - img_rect.ul().x);
-      
-      ossim_uint32 clipHeight = clip_rect.height();
-      ossim_uint32 clipWidth  = clip_rect.width();
-
-      // Copy the data.
-      for (band=0; band<num_bands; ++band)
-      {
-         ossim_uint32 sourceIndex      = sourceOffset;
-         ossim_uint32 destinationIndex = destinationOffset;
-         ossim_float32 tempResult      = 0.0;
-
-         for (ossim_uint32 line = 0; line < clipHeight; ++line)
-         {
-            for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-            {
-               src->getNormalizedFloat(sourceIndex + sample,
-                                       band,
-                                       tempResult);
-               
-               this->setNormalizedFloat(destinationIndex + sample,
-                                        band,
-                                        tempResult);
-            }
-            sourceIndex      += s_width;
-            destinationIndex += d_width;
-         }
-      }
-   }
-}
-
-void ossimImageData::loadTile(const void* src,
-                              const ossimIrect& src_rect,
-                              ossimInterleaveType il_type)
-{
-   switch (il_type)
-   {
-   case OSSIM_BIP:
-      loadTileFromBip(src, src_rect);
-      return;
-   case OSSIM_BIL:
-      loadTileFromBil(src, src_rect);
-      return;
-   case OSSIM_BSQ:
-      loadTileFromBsq(src, src_rect);
-      return;
-   default:
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::loadTile ERROR:  unsupported interleave type!"
-         << std::endl;
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "ossimImageData::loadTile\n\
-File %s line %d\nUnknown interleave type!",
-                    __FILE__,
-                    __LINE__);      
-      return;
-   } // End of "switch (type)"
-}
-
-void ossimImageData::loadTileWithAlpha(const void* src,
-                              const ossimIrect& src_rect,
-                              ossimInterleaveType il_type)
-{
-   switch (il_type)
-   {
-   case OSSIM_BIP:
-      loadTileFromBipAlpha(src, src_rect);
-      return;
-/*   case OSSIM_BIL:
-      loadTileFromBil(src, src_rect);
-      return;
-   case OSSIM_BSQ:
-      loadTileFromBsq(src, src_rect);
-      return;
-      */
-   default:
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::loadTileWithAlpha ERROR:  unsupported interleave type!"
-         << std::endl;
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "ossimImageData::loadTile\n\
-File %s line %d\nUnknown interleave type!",
-                    __FILE__,
-                    __LINE__);      
-      return;
-   } // End of "switch (type)"
-}
-
-void ossimImageData::loadTile(const void* src,
-                              const ossimIrect& src_rect,
-                              const ossimIrect& clip_rect,
-                              ossimInterleaveType il_type)
-{
-   switch (il_type)
-   {
-   case OSSIM_BIP:
-      loadTileFromBip(src, src_rect, clip_rect);
-      return;
-   case OSSIM_BIL:
-      loadTileFromBil(src, src_rect, clip_rect);
-      return;
-   case OSSIM_BSQ:
-      loadTileFromBsq(src, src_rect, clip_rect);
-      return;
-   default:
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::loadTile ERROR:  unsupported interleave type!"
-         << std::endl;
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "ossimImageData::loadTile\n\
-File %s line %d\nUnknown interleave type!",
-                    __FILE__,
-                    __LINE__);      
-      return;
-   } // End of "switch (type)"
-}
-
-
-void ossimImageData::nullTileAlpha(const ossim_uint8* src,
-                                   const ossimIrect& src_rect,
-                                   bool multiplyAlphaFlag)
-{
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Get the clip rect.
-   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-   nullTileAlpha(src, src_rect, clip_rect, multiplyAlphaFlag);
-}
-
-void ossimImageData::nullTileAlpha(const ossim_uint8* src,
-                                   const ossimIrect& src_rect,
-                                   const ossimIrect& clip_rect,
-                                   bool multiplyAlphaFlag)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         nullTileAlphaTemplate(ossim_uint8(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-
-      case OSSIM_SINT8:
-         nullTileAlphaTemplate(ossim_sint8(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         nullTileAlphaTemplate(ossim_uint16(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-         
-      case OSSIM_SINT16:
-         nullTileAlphaTemplate(ossim_sint16(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-         
-      case OSSIM_UINT32:
-         nullTileAlphaTemplate(ossim_uint32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-
-      case OSSIM_SINT32:
-         nullTileAlphaTemplate(ossim_sint32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         nullTileAlphaTemplate(ossim_float32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         nullTileAlphaTemplate(ossim_float64(0), src, src_rect, clip_rect, multiplyAlphaFlag);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::nullTileAlpha\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-   
-}
-
-void ossimImageData::loadTileFromBip(const void* src,
-                                     const ossimIrect& src_rect)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadTileFromBipTemplate(ossim_uint8(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT8:
-         loadTileFromBipTemplate(ossim_sint8(0), src, src_rect);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadTileFromBipTemplate(ossim_uint16(0), src, src_rect);
-         return;
-         
-      case OSSIM_SINT16:
-         loadTileFromBipTemplate(ossim_sint16(0), src, src_rect);
-         return;
-         
-      case OSSIM_UINT32:
-         loadTileFromBipTemplate(ossim_uint32(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT32:
-         loadTileFromBipTemplate(ossim_sint32(0), src, src_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         loadTileFromBipTemplate(ossim_float32(0), src, src_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadTileFromBipTemplate(ossim_float64(0), src, src_rect);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadTileFromBip\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::loadTileFromBipAlpha(const void* src,
-                                     const ossimIrect& src_rect)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadTileFromBipAlphaTemplate(ossim_uint8(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT8:
-         loadTileFromBipAlphaTemplate(ossim_sint8(0), src, src_rect);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadTileFromBipAlphaTemplate(ossim_uint16(0), src, src_rect);
-         return;
-         
-      case OSSIM_SINT16:
-         loadTileFromBipAlphaTemplate(ossim_sint16(0), src, src_rect);
-         return;
-         
-      case OSSIM_UINT32:
-         loadTileFromBipAlphaTemplate(ossim_uint32(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT32:
-         loadTileFromBipAlphaTemplate(ossim_sint32(0), src, src_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         loadTileFromBipAlphaTemplate(ossim_float32(0), src, src_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadTileFromBipAlphaTemplate(ossim_float64(0), src, src_rect);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadTileFromBip\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::loadTileFromBip(const void* src,
-                                     const ossimIrect& src_rect,
-                                     const ossimIrect& clip_rect)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadTileFromBipTemplate(ossim_uint8(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT8:
-         loadTileFromBipTemplate(ossim_sint8(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadTileFromBipTemplate(ossim_uint16(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_SINT16:
-         loadTileFromBipTemplate(ossim_sint16(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_UINT32:
-         loadTileFromBipTemplate(ossim_uint32(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT32:
-         loadTileFromBipTemplate(ossim_sint32(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         loadTileFromBipTemplate(ossim_float32(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadTileFromBipTemplate(ossim_float64(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadTileFromBip\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::loadTileFromBil(const void* src,
-                                     const ossimIrect& src_rect)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadTileFromBilTemplate(ossim_uint8(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT8:
-         loadTileFromBilTemplate(ossim_sint8(0), src, src_rect);
-         return;
-
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadTileFromBilTemplate(ossim_uint16(0), src, src_rect);
-         return;
-      
-      case OSSIM_SINT16:
-         loadTileFromBilTemplate(ossim_sint16(0), src, src_rect);
-         return;
-      
-      case OSSIM_UINT32:
-         loadTileFromBilTemplate(ossim_uint32(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT32:
-         loadTileFromBilTemplate(ossim_sint32(0), src, src_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         loadTileFromBilTemplate(ossim_float32(0), src, src_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadTileFromBilTemplate(ossim_float64(0), src, src_rect);
-         return;
-
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadTileFromBil\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::loadTileFromBil(const void* src,
-                                     const ossimIrect& src_rect,
-                                     const ossimIrect& clip_rect)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadTileFromBilTemplate(ossim_uint8(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT8:
-         loadTileFromBilTemplate(ossim_sint8(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadTileFromBilTemplate(ossim_uint16(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_SINT16:
-         loadTileFromBilTemplate(ossim_sint16(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_UINT32:
-         loadTileFromBilTemplate(ossim_uint32(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT32:
-         loadTileFromBilTemplate(ossim_sint32(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         loadTileFromBilTemplate(ossim_float32(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadTileFromBilTemplate(ossim_float64(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadTileFromBil\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::loadTileFromBsq(const void* src,
-                                     const ossimIrect& src_rect)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadTileFromBsqTemplate(ossim_uint8(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT8:
-         loadTileFromBsqTemplate(ossim_sint8(0), src, src_rect);
-         return;
-
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadTileFromBsqTemplate(ossim_uint16(0), src, src_rect);
-         return;
-      
-      case OSSIM_SINT16:
-         loadTileFromBsqTemplate(ossim_sint16(0), src, src_rect);
-         return;
-      
-      case OSSIM_UINT32:
-         loadTileFromBsqTemplate(ossim_uint32(0), src, src_rect);
-         return;
-
-      case OSSIM_SINT32:
-         loadTileFromBsqTemplate(ossim_sint32(0), src, src_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         loadTileFromBsqTemplate(ossim_float32(0), src, src_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadTileFromBsqTemplate(ossim_float64(0), src, src_rect);
-         return;
-      
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadTileFromBsq\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::loadTileFromBsq(const void* src,
-                                     const ossimIrect& src_rect,
-                                     const ossimIrect& clip_rect)
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         loadTileFromBsqTemplate(ossim_uint8(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT8:
-         loadTileFromBsqTemplate(ossim_sint8(0), src, src_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         loadTileFromBsqTemplate(ossim_uint16(0), src, src_rect, clip_rect);
-         return;
-         
-      case OSSIM_SINT16:
-         loadTileFromBsqTemplate(ossim_sint16(0), src, src_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT32:
-         loadTileFromBsqTemplate(ossim_uint32(0), src, src_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT32:
-         loadTileFromBsqTemplate(ossim_sint32(0), src, src_rect, clip_rect);
-         return;
-      
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         loadTileFromBsqTemplate(ossim_float32(0), src, src_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         loadTileFromBsqTemplate(ossim_float64(0), src, src_rect, clip_rect);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::loadTileFromBsq\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::computeMinMaxPix(vector<ossim_float64>& minBands,
-                                      vector<ossim_float64>& maxBands) const
-{
-   if ( (getDataObjectStatus() == OSSIM_NULL) || 
-        (getDataObjectStatus() == OSSIM_EMPTY) )
-   {
-      return;
-   }
-
-   switch(m_scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         computeMinMaxPix((ossim_uint8)0,
-                          minBands,
-                          maxBands);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         computeMinMaxPix((ossim_sint8)0,
-                          minBands,
-                          maxBands);
-         break;
-         
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         computeMinMaxPix((ossim_uint16)0,
-                          minBands,
-                          maxBands);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         computeMinMaxPix((ossim_sint16)0,
-                          minBands,
-                          maxBands);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         computeMinMaxPix((ossim_uint32)0,
-                          minBands,
-                          maxBands);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         computeMinMaxPix((ossim_sint32)0,
-                          minBands,
-                          maxBands);
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         computeMinMaxPix((ossim_float32)0.0,
-                          minBands,
-                          maxBands);
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         computeMinMaxPix((ossim_float64)0.0,
-                          minBands,
-                          maxBands);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         // Shouldn't hit this.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::computeMinPix Unsupported scalar type!"
-            << std::endl;
-         break;
-      }
-   }
-}
-
-template <class T>
-void ossimImageData::computeMinMaxPix(T /* dummyValue */,
-                                      vector<ossim_float64>& minBands,
-                                      vector<ossim_float64>& maxBands) const
-{
-   const ossim_uint32 BANDS = getNumberOfBands();
-   const ossim_uint32 SPB   = getSizePerBand(); 
-   
-   if( minBands.size() != BANDS ||
-       maxBands.size() != BANDS )
-   {
-      minBands.resize(BANDS);
-      maxBands.resize(BANDS);
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         // Set min to max and max to min for starters.
-         minBands[band] = getMaxPix(band);
-         maxBands[band] = getMinPix(band);
-      }
-   }
-   
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const T* bandBuffer = (const T*)getBuf(band);
-      if(bandBuffer)
-      {
-         const T NP   = static_cast<T>(getNullPix(band));
-         ossim_float64 currentMin = minBands[band];
-         ossim_float64 currentMax = maxBands[band];
-         for(ossim_uint32 offset = 0; offset < SPB; ++offset)
-         {
-            T p = bandBuffer[offset];
-            if(p != NP)
-            {
-               if(p < currentMin)
-               {
-                  currentMin = p;
-               }
-               else if(p > currentMax)
-               {
-                  currentMax = p;
-               }
-            }
-         }
-         minBands[band] = currentMin;
-         maxBands[band] = currentMax;
-      }
-   }
-}
-
-void ossimImageData::computeMinMaxNulPix(vector<ossim_float64>& minBands,
-                                         vector<ossim_float64>& maxBands,
-                                         vector<ossim_float64>& nulBands) const
-{
-   if ( getDataObjectStatus() == OSSIM_NULL )
-   {
-      return;
-   }
-   
-   switch(m_scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         computeMinMaxNulPix((ossim_uint8)0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         computeMinMaxNulPix((ossim_sint8)0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;  
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         computeMinMaxNulPix((ossim_uint16)0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         computeMinMaxNulPix((ossim_sint16)0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         computeMinMaxNulPix((ossim_uint32)0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         computeMinMaxNulPix((ossim_sint32)0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         computeMinMaxNulPix((ossim_float32)0.0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         computeMinMaxNulPix((ossim_float64)0.0,
-                             minBands,
-                             maxBands,
-                             nulBands);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         // Shouldn't hit this.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::computeMinNulPix Unsupported scalar type!"
-            << std::endl;
-         break;
-      }
-   }
-}
-
-template <class T>
-void ossimImageData::computeMinMaxNulPix(T /* dummyValue */,
-                                         vector<ossim_float64>& minBands,
-                                         vector<ossim_float64>& maxBands,
-                                         vector<ossim_float64>& nulBands) const
-{
-   const ossim_uint32 BANDS = getNumberOfBands();
-   const ossim_uint32 SPB   = getSizePerBand(); 
-   T DEFAULT_NULL = static_cast<T>(ossim::defaultNull(getScalarType()));   
-
-   if( minBands.size() != BANDS ||
-       maxBands.size() != BANDS ||
-       nulBands.size() != BANDS )
-   {
-      // First time through.
-      minBands.resize(BANDS);
-      maxBands.resize(BANDS);
-      nulBands.resize(BANDS);
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         // Set min to max and max to min for starters.
-         minBands[band] = getMaxPix(band);
-         maxBands[band] = getMinPix(band);
-         nulBands[band] = getMaxPix(band);
-      }
-   }
-   
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const T* bandBuffer = (const T*)getBuf(band);
-      if(bandBuffer)
-      {
-         ossim_float64 currentMin = minBands[band];
-         ossim_float64 currentMax = maxBands[band];
-         ossim_float64 currentNul = nulBands[band];
-         for(ossim_uint32 offset = 0; offset < SPB; ++offset)
-         {
-            T p = bandBuffer[offset];
-
-            // Since we are scanning for nulls this is making an assumption that the default
-            // null is incorrect and should be ignored in this scan as it could have been
-            // introduced by a make blank on a partial tile so ignore it.
-            // NOTE (OLK 03/2015): It is a bad idea to ignore pixels with default nulls, as it may
-            // be the actual null value being used. By ignoring it, a new null will be latched
-            // corresponding to actual, non-null, minimum value. Unfortunately, when tiles are
-            // initialized, they are filled with default nulls since (with float-data), the
-            // null (if any exists) is not yet known -- effectively creating two null pixel values.
-            // The recommendation (if you're looking at this code, then you're probably having the
-            // problem that your nulls aren't being recognized), is to turn off the flag in your
-            // ossim prefs file with: overview_builder.scan_for_min_max_null_if_float: false
-            // (or just delete that line)
-            if ( p != DEFAULT_NULL )
-            {
-               // Must do null first as min depends on null.
-               if ( p < currentNul )
-               {
-                  currentNul = p;
-               }
-               if( ( p < currentMin ) && ( p > currentNul ) )
-               {
-                  currentMin = p;
-               }
-               else if( p > currentMax )
-               {
-                  currentMax = p;
-               }
-            }
-         }
-         minBands[band] = currentMin;
-         maxBands[band] = currentMax;
-         nulBands[band] = currentNul;
-      }
-   }
-}
-
-template <class T>
-void ossimImageData::loadTileFromBipTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect)
-{
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Get the clip rect.
-   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-   loadTileFromBipTemplate(T(0), src, src_rect, clip_rect);
-}
-template <class T>
-void ossimImageData::loadTileFromBipAlphaTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect)
-{
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Get the clip rect.
-   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-   loadTileFromBipAlphaTemplate(T(0), src, src_rect, clip_rect);
-}
-
-template <class T>
-void ossimImageData::loadTileFromBipTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect,
-                                             const ossimIrect& clip_rect)
-{
-   static const char  MODULE[] = "ossimImageData::loadTileFromBip";
-   
-   // Check the pointer.
-   if (!src)
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                     "%s File %s line %d\nNULL pointer passed to method!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return;
-   }
-   
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Check for intersect.
-   if ( ! img_rect.intersects(src_rect) )
-   {
-      return; // Nothing to do here.
-   }
-   
-   // Check the clip rect.
-   if (!clip_rect.completely_within(img_rect))
-   {
-      return;
-   }
-   
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL) initialize();
-
-   // Get the width of the buffers.
-   ossim_uint32 num_bands  = getNumberOfBands();
-   ossim_uint32 s_width    = (src_rect.width()) * num_bands;
-   ossim_uint32 d_width    = getWidth();
-   ossim_uint32 band       = 0;
-   const T* s        = static_cast<const T*>(src);
-   T** d             = new T*[num_bands];
-   
-   // Make destination pointers to each one.
-   for (band=0; band<num_bands; band++)
-   {
-      d[band] = static_cast<T*>(getBuf(band));
-      
-      // Move the pointers to the first valid pixel.
-      d[band] += (clip_rect.ul().y - img_rect.ul().y) * d_width +
-                 clip_rect.ul().x - img_rect.ul().x;
-   }
-   
-   // Move the source pointer to the first valid pixel.
-   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
-        (clip_rect.ul().x - src_rect.ul().x) * num_bands;
-   
-   // Copy the data.
-   ossim_uint32 clipHeight = clip_rect.height();
-   ossim_uint32 clipWidth  = clip_rect.width();
-   
-   for (ossim_uint32 line = 0; line < clipHeight; ++line)
-   {
-      ossim_uint32 j = 0;
-      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-      {
-         for (band=0; band<num_bands; band++)
-         {
-            d[band][sample] = s[j+band];
-         }
-         j += num_bands;
-      }
-      
-      s += s_width;
-      for (band=0; band<num_bands; band++)
-      {
-         d[band] += d_width;
-      }
-   }
-   
-   delete [] d;
-}
-
-template <class T>
-void ossimImageData::loadTileFromBipAlphaTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect,
-                                             const ossimIrect& clip_rect)
-{
-   static const char  MODULE[] = "ossimImageData::loadTileFromBip";
-   
-   // Check the pointer.
-   if (!src)
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                     "%s File %s line %d\nNULL pointer passed to method!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return;
-   }
-   
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Check for intersect.
-   if ( ! img_rect.intersects(src_rect) )
-   {
-      return; // Nothing to do here.
-   }
-   
-   // Check the clip rect.
-   if (!clip_rect.completely_within(img_rect))
-   {
-      return;
-   }
-   
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL) initialize();
-
-   // Get the width of the buffers.
-   ossim_uint32 num_bands  = getNumberOfBands();
-   ossim_uint32 s_width    = (src_rect.width()) * (num_bands+1);
-   ossim_uint32 d_width    = getWidth();
-   ossim_uint32 band       = 0;
-   const T* s        = static_cast<const T*>(src);
-   T** d             = new T*[num_bands];
-   
-   // Make destination pointers to each one.
-   for (band=0; band<num_bands; band++)
-   {
-      d[band] = static_cast<T*>(getBuf(band));
-      
-      // Move the pointers to the first valid pixel.
-      d[band] += (clip_rect.ul().y - img_rect.ul().y) * d_width +
-                 clip_rect.ul().x - img_rect.ul().x;
-   }
-   
-   // Move the source pointer to the first valid pixel. 
-   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
-        (clip_rect.ul().x - src_rect.ul().x) * (num_bands+1); // +1 for the alpha
-   
-   // Copy the data.
-   ossim_uint32 clipHeight = clip_rect.height();
-   ossim_uint32 clipWidth  = clip_rect.width();
-   
-   for (ossim_uint32 line = 0; line < clipHeight; ++line)
-   {
-      ossim_uint32 j = 0;
-      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-      {
-         for (band=0; band<num_bands; band++)
-         {
-            d[band][sample] = s[j+band];
-         }
-         j += (num_bands+1); // need to offset by the alpha channel
-      }
-      
-      s += s_width;
-      for (band=0; band<num_bands; band++)
-      {
-         d[band] += d_width;
-      }
-   }
-   
-   delete [] d;
-}
-   
-template <class T>
-void ossimImageData::loadTileFromBilTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect)
-{
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Get the clip rect.
-   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-   loadTileFromBilTemplate(T(0), src, src_rect, clip_rect);
-}
-   
-template <class T>
-void ossimImageData::loadTileFromBilTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect,
-                                             const ossimIrect& clip_rect)
-{
-   static const char  MODULE[] = "ossimImageData::loadTileFromBil";
-   
-   // Check the pointer.
-   if (!src)
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nNULL pointer passed to method!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return;
-   }
-   
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Check for intersect.
-   if ( ! img_rect.intersects(src_rect) )
-   {
-      return; // Nothing to do here.
-   }
-   
-   // Check the clip rect.
-   if (!clip_rect.completely_within(img_rect))
-   {
-      return;
-   }
-
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL) initialize();
-   
-   // Get the width of the buffers.
-   ossim_uint32 num_bands = getNumberOfBands();
-   ossim_uint32 s_width = (src_rect.lr().x - src_rect.ul().x + 1);
-   ossim_uint32 d_width = getWidth();
-   ossim_uint32 band = 0;
-   ossim_uint32 d_offset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
-                     clip_rect.ul().x - img_rect.ul().x;
-   
-   const T* s = static_cast<const T*>(src);
-
-   // Get the number of bands and make destination pointers to each one.
-   T** d = new T*[num_bands];
-   
-   for (band=0; band<num_bands; band++)
-   {
-      d[band] = static_cast<T*>(getBuf(band));
-      
-      // Move the pointers to the first valid pixel.
-      d[band] += d_offset;
-   }
-   
-   // Move the source pointer to the first valid pixel.
-   s += (clip_rect.ul().y - src_rect.ul().y) * s_width * num_bands +
-        clip_rect.ul().x - src_rect.ul().x;
-   
-   // Copy the data.
-   ossim_uint32 clipHeight = clip_rect.height();
-   ossim_uint32 clipWidth  = clip_rect.width();
-
-   for (ossim_uint32 line = 0; line < clipHeight; ++line)
-   {
-      for (band = 0; band < num_bands; ++band)
-      {
-         for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-         {
-            d[band][sample] = s[sample];
-         }
-         s       += s_width;
-         d[band] += d_width;
-      }
-   }
-
-   delete [] d;
-}
-   
-template <class T>
-void ossimImageData::loadTileFromBsqTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect)
-{
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Get the clip rect.
-   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-   loadTileFromBsqTemplate(T(0), src, src_rect, clip_rect);
-}
-
-template <class T>
-void ossimImageData::loadTileFromBsqTemplate(T, // dummy template variable
-                                             const void* src,
-                                             const ossimIrect& src_rect,
-                                             const ossimIrect& clip_rect)
-{
-   static const char  MODULE[] = "ossimImageData::loadTileFromBsq";
-   
-   // Check the pointer.
-   if (!src)
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nNULL pointer passed to method!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return;
-   }
-   
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Check for intersect.
-   if ( ! img_rect.intersects(src_rect) )
-   {
-      return; // Nothing to do here.
-   }
-
-   // Check the clip rect.
-   if (!clip_rect.completely_within(img_rect))
-   {
-      return;
-   }
-   
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL) initialize();
-   
-   // Get the width of the buffers.
-   ossim_uint32 num_bands = getNumberOfBands();
-   ossim_uint32 s_width = src_rect.width();
-   ossim_uint32 d_width = getWidth();
-   ossim_uint32 s_band_offset = s_width * src_rect.height();
-   
-   const T* s = static_cast<const T*>(src);
-   
-   ossim_uint32 band;
-   ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
-                              (clip_rect.ul().x - img_rect.ul().x);
-   ossim_uint32 destinationIndex = destinationOffset;
-   ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) * s_width +
-                         (clip_rect.ul().x - src_rect.ul().x);
-   ossim_uint32 sourceIndex = sourceOffset;
-   ossim_uint32 clipHeight = clip_rect.height();
-   ossim_uint32 clipWidth = clip_rect.width();
-
-   // Copy the data.
-   for (band=0; band<num_bands; band++)
-   {
-      T* destinationBand = static_cast<T*>(getBuf(band));
-      destinationIndex = destinationOffset;
-      sourceIndex = sourceOffset + s_band_offset*band;
-      
-      for (ossim_uint32 line = 0; line < clipHeight; ++line)
-      {
-         for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-         {
-            destinationBand[destinationIndex + sample]
-               = s[sourceIndex+sample];
-         }
-         sourceIndex += s_width;
-         destinationIndex += d_width;
-      }
-   }
-}
-
-void ossimImageData::loadTileFrom1Band(const void* src,
-				       const ossimIrect& src_rect)
-{
-   ossim_uint32 bands = getNumberOfBands();
-   for(ossim_uint32 band = 0; band < bands; ++band)
-   {
-      loadBand(src, src_rect, band);
-   }
-}
-
-void ossimImageData::loadTileFrom1Band(const ossimImageData* src)
-{
-  if(!src) return;
-  loadTileFrom1Band((const void*)src->getBuf(),
-		    src->getImageRectangle());
-}
-
-void ossimImageData::loadShortBand(const void* src,
-                                   const ossimIrect& src_rect,
-                                   ossim_uint32 band,
-                                   bool swap_bytes)
-{
-   static const char  MODULE[] = "ossimImageData::loadShortBand";
-
-   // Check the pointer.
-   if (!src)
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nNULL pointer passed to method!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return;
-   }
-
-   // Check the band.
-   if (!isValidBand(band))
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nInvalid band:  %d",
-                    MODULE,
-                    __FILE__,
-                    __LINE__,
-                    band);
-      return;
-   }
-
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Check for intersect.
-   if ( ! img_rect.intersects(src_rect) )
-   {
-      return; // Nothing to do here.
-   }
-
-   // Get the clip rect.
-   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
-
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL) initialize();
-
-   // Get the width of the buffers.
-   ossim_uint32 s_width = src_rect.width();
-   ossim_uint32 d_width = getWidth();
-
-   const ossim_uint16* s = static_cast<const ossim_uint16*>(src);
-   ossim_uint16* d = getUshortBuf(band);
-
-   // Move the pointers to the first valid pixel.
-   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
-        clip_rect.ul().x - src_rect.ul().x;
-   
-   d += (clip_rect.ul().y - img_rect.ul().y) * d_width +
-        clip_rect.ul().x - img_rect.ul().x;
-   
-   // Copy the data.
-   for (ossim_int32 line=clip_rect.ul().y; line<=clip_rect.lr().y; line++)
-   {
-      ossim_uint32 i = 0;
-      for (ossim_int32 sample=clip_rect.ul().x; sample<=clip_rect.lr().x; sample++)
-      {
-         d[i] = (swap_bytes ? ( (s[i] << 8) | (s[i] >> 8) ) :
-                 s[i]);
-         ++i;
-      }
-
-      s += s_width;
-      d += d_width;
-   }
-
-   validate();
-}
-
-bool ossimImageData::isPointWithin(const ossimIpt& point)const
-{
-   return ((point.x >= m_origin.x)&&
-           (point.y >= m_origin.y)&&
-           ((point.x - m_origin.x)<static_cast<ossim_int32>(m_spatialExtents[0]))&&
-           ((point.y - m_origin.y)<static_cast<ossim_int32>(m_spatialExtents[1])));
-}
-
-bool ossimImageData::isPointWithin(ossim_int32 x, ossim_int32 y)const
-{
-   return ((x >= m_origin.x)&&
-           (y >= m_origin.y)&&
-           ((x - m_origin.x) < static_cast<ossim_int32>(m_spatialExtents[0]))&&
-           ((y - m_origin.y) < static_cast<ossim_int32>(m_spatialExtents[1])));
-}
-
-void ossimImageData::unloadTile(void* dest,
-                                const ossimIrect& dest_rect,
-                                ossimInterleaveType type) const
-{
-   unloadTile(dest, dest_rect, getImageRectangle(), type);
-}
-
-void ossimImageData::unloadTile(void* dest,
-                                const ossimIrect& dest_rect,
-                                const ossimIrect& clip_rect,
-                                ossimInterleaveType type) const
-{
-   switch (type)
-   {
-      case OSSIM_BIP:
-         unloadTileToBip(dest, dest_rect, clip_rect);
-         return;
-      case OSSIM_BIL:
-         unloadTileToBil(dest, dest_rect, clip_rect);
-         return;
-      case OSSIM_BSQ:
-         unloadTileToBsq(dest, dest_rect, clip_rect);
-         return;
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::unloadTile\n\
-File %s line %d\nUnknown scalar type!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::unloadTileToBip(void* dest,
-                                     const ossimIrect& dest_rect,
-                                     const ossimIrect& clip_rect) const
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         unloadTileToBipTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT8:
-         unloadTileToBipTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         unloadTileToBipTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SINT16:
-         unloadTileToBipTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT32:
-         unloadTileToBipTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SINT32:
-         unloadTileToBipTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         unloadTileToBipTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         unloadTileToBipTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::unloadTileToBip\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::unloadTileToBipAlpha(void* dest,
-                                          const ossimIrect& dest_rect,
-                                          const ossimIrect& clip_rect) const
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         unloadTileToBipAlphaTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT8:
-         unloadTileToBipAlphaTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         unloadTileToBipAlphaTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SINT16:
-         unloadTileToBipAlphaTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT32:
-         unloadTileToBipAlphaTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SINT32:
-         unloadTileToBipAlphaTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         unloadTileToBipAlphaTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         unloadTileToBipAlphaTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::unloadTileToBipAlpha\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::unloadTileToBil(void* dest,
-                                     const ossimIrect& dest_rect,
-                                     const ossimIrect& clip_rect) const
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         unloadTileToBilTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT8:
-         unloadTileToBilTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         unloadTileToBilTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SINT16:
-         unloadTileToBilTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
-         return;
-
-      case OSSIM_UINT32:
-         unloadTileToBilTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT32:
-         unloadTileToBilTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         unloadTileToBilTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         unloadTileToBilTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::unloadTileToBil\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::unloadTileToBsq(void* dest,
-                                     const ossimIrect& dest_rect,
-                                     const ossimIrect& clip_rect) const
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         unloadTileToBsqTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT8:
-         unloadTileToBsqTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         unloadTileToBsqTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SINT16:
-         unloadTileToBsqTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_UINT32:
-         unloadTileToBsqTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
-         return;
-
-      case OSSIM_SINT32:
-         unloadTileToBsqTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         unloadTileToBsqTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         unloadTileToBsqTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::unloadTileToBsq\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::unloadBand(void* dest,
-                                const ossimIrect& dest_rect,
-                                ossim_uint32 band) const
-{
-   unloadBand(dest, dest_rect, getImageRectangle(), band);
-}
-
-void ossimImageData::unloadBand(void* dest,
-                                const ossimIrect& dest_rect,
-                                const ossimIrect& clip_rect,
-                                ossim_uint32 band) const
-{
-   // Call the appropriate load method.
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         unloadBandTemplate(ossim_uint8(0), dest, dest_rect, clip_rect, band);
-         return;
-
-      case OSSIM_SINT8:
-         unloadBandTemplate(ossim_sint8(0), dest, dest_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         unloadBandTemplate(ossim_uint16(0), dest, dest_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_SINT16:
-         unloadBandTemplate(ossim_sint16(0), dest, dest_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_UINT32:
-         unloadBandTemplate(ossim_uint32(0), dest, dest_rect, clip_rect, band);
-         return;
-
-      case OSSIM_SINT32:
-         unloadBandTemplate(ossim_sint32(0), dest, dest_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         unloadBandTemplate(ossim_float32(0), dest, dest_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         unloadBandTemplate(ossim_float64(0), dest, dest_rect, clip_rect, band);
-         return;
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "ossimImageData::unloadBand\n\
-File %s line %d\nUnsupported scalar type for method!",
-                       __FILE__,
-                       __LINE__);      
-         return;
-   }
-}
-
-void ossimImageData::unloadBand( void* dest,
-                                 ossim_uint32 src_band,
-                                 ossim_uint32 dest_band,
-                                 const ossimIrect& dest_rect,
-                                 ossimInterleaveType il_type,
-                                 OverwriteBandRule ow_type ) const
-{
-   unloadBand( dest, src_band, dest_band, dest_rect, getImageRectangle(), il_type, ow_type );
-}
-
-void ossimImageData::unloadBand( void* dest,
-                                 ossim_uint32 src_band,
-                                 ossim_uint32 dest_band,
-                                 const ossimIrect& dest_rect,
-                                 const ossimIrect& clip_rect,
-                                 ossimInterleaveType il_type,
-                                 OverwriteBandRule ow_type ) const
-{
-   static const char  MODULE[] = "ossimImageData::unloadBand";
-
-   if ( il_type == OSSIM_BSQ )
-   {
-      unloadBandToBsq( dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " NOTICE:"
-         << "\nUnsupported interleave type:  " << il_type << "  Returning..."
-         << std::endl;
-   }
-}
-
-void ossimImageData::unloadBandToBsq( void* dest,
-                                      ossim_uint32 src_band,
-                                      ossim_uint32 dest_band,
-                                      const ossimIrect& dest_rect,
-                                      const ossimIrect& clip_rect,
-                                      OverwriteBandRule ow_type ) const
-{
-   switch (getScalarType())
-   {
-      case OSSIM_UINT8:
-         unloadBandToBsqTemplate(ossim_uint8(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_SINT8:
-         unloadBandToBsqTemplate(ossim_sint8(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-         unloadBandToBsqTemplate(ossim_uint16(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_SINT16:
-         unloadBandToBsqTemplate(ossim_sint16(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_UINT32:
-         unloadBandToBsqTemplate(ossim_uint32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_SINT32:
-         unloadBandToBsqTemplate(ossim_sint32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-         unloadBandToBsqTemplate(ossim_float32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-         unloadBandToBsqTemplate(ossim_float64(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
-         return;
-
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-         ossimSetError(getClassName(),
-            ossimErrorCodes::OSSIM_ERROR,
-            "ossimImageData::unloadBandToBsq\n\
-            File %s line %d\nUnsupported scalar type for method!",
-            __FILE__,
-            __LINE__);      
-         return;
-   }
-}
-
-template <class T>
-void ossimImageData::unloadBandTemplate(T, // dummy template variable
-                                        void* dest,
-                                        const ossimIrect& dest_rect,
-                                        const ossimIrect& clip_rect,
-                                        ossim_uint32 band) const
-{
-   static const char  MODULE[] = "ossimImageData::unloadBand";
-
-   // Check the pointers.
-   if (!dest)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nNULL pointer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-   
-   ossimIrect img_rect = getImageRectangle();
-   
-   // Clip the clip_rect to the tile rect.
-   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
-
-   // Clip it again to the destination rect.
-   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
-   
-   // Check the output clip rect for intersection.
-   if (!output_clip_rect.intersects(img_rect))
-   {
-      return;
-   }
-   if ( !(output_clip_rect.intersects(dest_rect)) )
-   {
-      return;
-   }
-
-   // Check for valid band.
-   if (!isValidBand(band))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " NOTICE:"
-         << "\nInvalid band:  " << band << "  Returning..."
-         << std::endl;
-      return;
-   }
-   
-   ossim_uint32 buf_width = dest_rect.lr().x - dest_rect.ul().x + 1;
-
-   // Get a pointer to the source band buffer.
-   const T* s = reinterpret_cast<const T*>(getBuf(band));
-
-   // Get the offset for each source band.
-   ossim_uint32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
-      getWidth() + output_clip_rect.ul().x - img_rect.ul().x;
-   
-   // Move the pointers to the start.
-   T* d = reinterpret_cast<T*>(dest);
-
-   ossim_uint32 dest_offset = (output_clip_rect.ul().y - dest_rect.ul().y) *
-      buf_width + output_clip_rect.ul().x - dest_rect.ul().x;
-
-   d += dest_offset;
-   s += src_offset;
-
-   for (ossim_int32 line=output_clip_rect.ul().y;
-        line<=output_clip_rect.lr().y; ++line)
-   {
-      ossim_uint32 i=0;
-      for (ossim_int32 samp=clip_rect.ul().x;
-           samp<=output_clip_rect.lr().x; ++samp)
-      {
-         d[i] = s[i];
-         ++i;
-      }
-      d += buf_width;
-      s += getWidth();
-   }
-}
-
-template <class T> void
-ossimImageData::unloadTileToBipTemplate(T, // dummy template variable
-                                        void* dest,
-                                        const ossimIrect& dest_rect,
-                                        const ossimIrect& clip_rect) const
-{
-   static const char  MODULE[] = "ossimImageData::unloadTileToBip";
-   
-   // Check the pointer.
-   if (!dest)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nNULL pointer passed to method!  Returning..." << std::endl;
-      return;
-   }
-   
-   bool  dataIsNull = false;
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      dataIsNull = true;
-   }
-   
-   ossimIrect img_rect = getImageRectangle();
-   
-   // Clip the clip_rect to the tile rect.
-   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
-
-   // Clip it again to the destination rect.
-   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
-   
-   // Check the output clip rect for intersection.
-   if (output_clip_rect.hasNans())
-   {
-      return;
-   }
-   if ( !(output_clip_rect.intersects(dest_rect)) )
-   {
-      return;
-   }
-   
-   ossim_int32 num_bands = getNumberOfBands();
-   
-   ossim_int32 buf_width = dest_rect.width() * num_bands;
-
-   if(!dataIsNull)
-   {
-      // Get the number of bands and grab a pointers to each one.
-      const T** s = new const T*[num_bands];
-      
-      ossim_int32 band;
-      ossim_int32 s_width = getWidth();
-      
-      for (band=0; band<num_bands; band++)
-      {
-         s[band] = reinterpret_cast<const T*>(getBuf(band));
-      }
-      
-      // Move the pointers to the start.
-      T* d = reinterpret_cast<T*>(dest);      
-      
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) * buf_width +
-           (output_clip_rect.ul().x - dest_rect.ul().x) * num_bands;
-      
-      // Get the offset for each source band.
-      ossim_int32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
-         s_width + (output_clip_rect.ul().x - img_rect.ul().x);
-      
-      ossim_int32 output_clip_width  = output_clip_rect.width();
-      ossim_int32 output_clip_height = output_clip_rect.height();
-      
-      for (band=0; band<(ossim_int32)getNumberOfBands(); band++)
-      {
-         s[band] += src_offset;
-      }
-      
-      ossim_int32 j;
-      for (ossim_int32 line=0; line<output_clip_height; ++line)
-      {
-         j = 0;
-         for (ossim_int32 samp=0; samp<output_clip_width; ++samp, j+=num_bands)
-         {
-            for (band=0; band<num_bands; ++band)
-            {
-               d[j+band] = s[band][samp];
-            }
-         }
-         
-         // increment to next line...
-         d += buf_width;
-         for (band=0; band<num_bands; ++band)
-         {
-            s[band] += s_width;
-         }
-      
-      }
-      delete [] s;
-   }
-   else
-   {
-      ossim_int32 band = 0;
-      T* nulls = new T[num_bands];
-      for(band = 0; band < num_bands; ++band)
-      {
-         nulls[band] = static_cast<T>(m_nullPixelValue[band]);
-      }
-      // Move the pointers to the start.
-      T* d = reinterpret_cast<T*>(dest);
-      
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) * buf_width +
-           (output_clip_rect.ul().x - dest_rect.ul().x) * num_bands;
-
-      for (ossim_int32 line=output_clip_rect.ul().y;
-           line<=output_clip_rect.lr().y; ++line)
-      {
-         ossim_int32 i=0;
-         ossim_int32 j=0;
-         for (ossim_int32 samp=output_clip_rect.ul().x;
-              samp<=output_clip_rect.lr().x; ++samp)
-         {
-            for (band=0; band<num_bands; ++band)
-            {
-               d[j+band] = nulls[band];
-            }
-            ++i;  // increment to next pixel...
-            j+= num_bands;
-         }
-         
-         // increment to next line...
-         d += buf_width;
-      }
-      delete [] nulls;
-      nulls = 0;
-   }
-}
-
-template <class T> void
-ossimImageData::unloadTileToBipAlphaTemplate(T, // dummy template variable
-                                             void* dest,
-                                             const ossimIrect& dest_rect,
-                                             const ossimIrect& clip_rect) const
-{
-   static const char  M[] = "ossimImageData::unloadTileToBipAlphaTemplate";
-
-   // Sanity checks:
-
-   // Are we null:
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << M << " ERROR:"
-         << "\nAttempting to copy null tile!  Returning..." << std::endl;
-      return;
-   }
-   
-   // Check the pointer.
-   if (!dest)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << M << " ERROR:"
-         << "\nNULL pointer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if ( !hasAlpha() )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << M << " ERROR:"
-         << "\nTile has no alpha!  Returning..." << std::endl;
-      return; 
-   }
-   
-   ossimIrect img_rect = getImageRectangle();
-   
-   // Clip the clip_rect to the tile rect.
-   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
-
-   // Clip it again to the destination rect.
-   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
-   
-   // Check the output clip rect for intersection.
-   if (output_clip_rect.hasNans())
-   {
-      return;
-   }
-   if ( !(output_clip_rect.intersects(dest_rect)) )
-   {
-      return;
-   }
-   
-   const ossim_int32 NUM_DATA_BANDS = getNumberOfBands();
-   const ossim_int32 BANDS = NUM_DATA_BANDS + 1; // Has data plus alpha.
-   const ossim_float64 MAX_PIX = static_cast<T>(getMaxPix(0));
-   const ossim_float64 ALPHA_MAX_PIX = 255.00;
-   const ossim_int32 S_WIDTH = getWidth();
-   const ossim_int32 D_WIDTH = dest_rect.width() * BANDS;
-   const ossim_int32 OUTPUT_CLIP_WIDTH  = output_clip_rect.width();
-   const ossim_int32 OUTPUT_CLIP_HEIGHT = output_clip_rect.height();
-
-   bool uint8Flag = ( getScalarType() == OSSIM_UINT8 );
-   
-   // Get the offset for each source band relative to start of clip rect.
-   const ossim_int32 SRC_OFFSET = (output_clip_rect.ul().y - img_rect.ul().y) *
-      S_WIDTH + (output_clip_rect.ul().x - img_rect.ul().x);
-   
-   // Get pointers to each one band of image data.
-   std::vector<const T*> s(NUM_DATA_BANDS);
-   ossim_int32 band;
-   for (band = 0; band < NUM_DATA_BANDS; ++band)
-   {
-      s[band] = reinterpret_cast<const T*>(getBuf(band));
-
-      // Move to start of clip rect.
-      s[band] += SRC_OFFSET;
-   }
-
-   // Get pointer to the alpha channel:
-   const ossim_uint8* a = getAlphaBuf();
-
-   // Move to start of clip rect.
-   a += SRC_OFFSET;
-
-   // Pointer to the destination buffer.
-   T* d = reinterpret_cast<T*>(dest); 
-
-   // Move to start of clip rect.
-   d += (output_clip_rect.ul().y - dest_rect.ul().y) * D_WIDTH +
-      (output_clip_rect.ul().x - dest_rect.ul().x) * BANDS;
-   
-
-   // Loop to copy data:
-   for (ossim_int32 line = 0; line < OUTPUT_CLIP_HEIGHT; ++line)
-   {
-      ossim_int32 j = 0;
-      ossim_int32 alphaIdx = 0;
-      for (ossim_int32 samp = 0; samp < OUTPUT_CLIP_WIDTH; ++samp, j +=BANDS)
-      {
-         // Copy the pixels:
-         for (band = 0; band < NUM_DATA_BANDS; ++band)
-         {
-            d[j+band] = s[band][samp];
-         }
-         
-         // Copy alpha channel converting to scalar type.
-         if ( uint8Flag )
-         {
-            d[j+NUM_DATA_BANDS] = a[alphaIdx++];
-         }
-         else
-         {
-            d[j+NUM_DATA_BANDS] =
-               static_cast<T>( (a[alphaIdx++]/ALPHA_MAX_PIX) * MAX_PIX );
-         }
-      }
-      
-      // Increment pointers to next line...
-      d += D_WIDTH;
-      for (band = 0; band < NUM_DATA_BANDS; ++band)
-      {
-         s[band] += S_WIDTH;
-      }
-      a += S_WIDTH;
-   }
-}
-
-template <class T> void
-ossimImageData::unloadTileToBilTemplate(T,  // dummy template arg...
-                                        void* dest,
-                                        const ossimIrect& dest_rect,
-                                        const ossimIrect& clip_rect) const
-{
-  static const char  MODULE[] = "ossimImageData::unloadTileToBil";
-
-   // Check the pointers.
-   if (!dest)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nNULL pointer passed to method!  Returning..." << std::endl;
-      return;
-   }
-   bool dataIsNull = false;
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      dataIsNull = true;
-   }
-
-   ossimIrect img_rect = getImageRectangle();
-   
-   // Clip the clip_rect to the tile rect.
-   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
-
-   // Clip it again to the destination rect.
-   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
-   
-   // Check the output clip rect for intersection.
-   if (output_clip_rect.hasNans())
-   {
-      return;
-   }
-   if ( !(output_clip_rect.intersects(dest_rect)) )
-   {
-      return;
-   }
-
-   ossim_uint32 num_bands = getNumberOfBands();
-
-   ossim_uint32 buf_width = dest_rect.width();
-
-   if(!dataIsNull)
-   {
-      // Get the number of bands and grab a pointers to each one.
-      const T** s = new const T*[num_bands];
-      
-      ossim_uint32 band;
-      
-      for (band=0; band<num_bands; band++)
-      {
-         s[band] = reinterpret_cast<const T*>(getBuf(band));
-      }
-      
-      // Get the offset for each source band.
-      ossim_uint32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
-         getWidth() + (output_clip_rect.ul().x - img_rect.ul().x);
-      
-      // Move the pointers to the start.
-      T* d = reinterpret_cast<T*>(dest);
-
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) *
-         buf_width * num_bands +
-         (output_clip_rect.ul().x-dest_rect.ul().x);
-      
-      for (band=0; band<num_bands; ++band)
-      {
-         s[band] += src_offset;
-      }
-      
-      for (ossim_int32 line=output_clip_rect.ul().y;
-           line<=output_clip_rect.lr().y; ++line)
-      {
-         for (band=0; band<num_bands; ++band)
-         {
-            ossim_uint32 i=0;
-            for (ossim_int32 samp=output_clip_rect.ul().x;
-                 samp<=output_clip_rect.lr().x; ++samp)
-            {
-               d[i] = s[band][i];
-               ++i;
-            }
-            d       += buf_width;
-            s[band] += getWidth();
-         }
-      }
-      // Free up memory allocated for pointers.
-      delete [] s;
-   }
-   else
-   {
-      ossim_uint32 band = 0;
-      T* nulls = new T[num_bands];
-      for(band = 0; band < num_bands; ++band)
-      {
-         nulls[band] = static_cast<T>(m_nullPixelValue[band]);
-      }
-      
-      // Move the pointers to the start.
-      T* d = reinterpret_cast<T*>(dest);
-
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) *
-           buf_width * num_bands + (output_clip_rect.ul().x - dest_rect.ul().x);
-      
-      for (ossim_int32 line=output_clip_rect.ul().y;
-           line<=output_clip_rect.lr().y; ++line)
-      {
-         for (band=0; band<num_bands; ++band)
-         {
-            ossim_uint32 i=0;
-            for (ossim_int32 samp=output_clip_rect.ul().x;
-                 samp<=output_clip_rect.lr().x; ++samp)
-            {
-               d[i] = nulls[band];
-               ++i;
-            }
-            d += buf_width;
-         }
-      }
-      delete [] nulls;
-   }
-}
-
-template <class T> void ossimImageData::nullTileAlphaTemplate(
-   T,
-   const ossim_uint8* src,
-   const ossimIrect& src_rect,
-   const ossimIrect& clip_rect,
-   bool multiplyAlphaFlag)
-{
-   static const char  MODULE[] = "ossimImageData::nullTileAlphaTemplate";
-   
-   // Check the pointer.
-   if (!src)
-   {
-      // Set the error...
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "%s File %s line %d\nNULL pointer passed to method!",
-                    MODULE,
-                    __FILE__,
-                    __LINE__);
-      return;
-   }
-   
-   const ossimIrect img_rect = getImageRectangle();
-   
-   // Check for intersect.
-   if ( ! img_rect.intersects(src_rect) )
-   {
-      return; // Nothing to do here.
-   }
-
-   // Check the clip rect.
-   if (!clip_rect.completely_within(img_rect))
-   {
-      return;
-   }
-   
-   // Check the status and allocate memory if needed.
-   if (getDataObjectStatus() == OSSIM_NULL) initialize();
-   
-   // Get the width of the buffers.
-   ossim_uint32 num_bands = getNumberOfBands();
-   ossim_uint32 s_width = src_rect.width();
-   ossim_uint32 d_width = getWidth();
-   ossim_uint32 band;
-   ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
-                              (clip_rect.ul().x - img_rect.ul().x);
-   ossim_uint32 destinationIndex = destinationOffset;
-   ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) * s_width +
-                         (clip_rect.ul().x - src_rect.ul().x);
-   ossim_uint32 sourceIndex = sourceOffset;
-   ossim_uint32 clipHeight = clip_rect.height();
-   ossim_uint32 clipWidth = clip_rect.width();
-
-   if(!multiplyAlphaFlag)
-   {
-      // Copy the data.
-      for (band=0; band<num_bands; band++)
-      {
-         T* destinationBand = static_cast<T*>(getBuf(band));
-         destinationIndex = destinationOffset;
-         sourceIndex = sourceOffset;
-         T nullPix = (T)getNullPix(band);
-         T minPix = (T)getMinPix(band);
-         for (ossim_uint32 line = 0; line < clipHeight; ++line)
-         {
-            for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-            {
-               if(src[sourceIndex+sample] == 0)
-               {
-                  destinationBand[destinationIndex + sample] = nullPix;
-               }
-               else if(destinationBand[destinationIndex + sample] == nullPix)
-               {
-                  destinationBand[destinationIndex + sample] = minPix;
-               }
-            }
-            sourceIndex += s_width;
-            destinationIndex += d_width;
-         }
-      }
-   }
-   else
-   {
-      ossim_float64 normalizer = 1.0/255.0;
-      // Copy the data.
-      for (band=0; band<num_bands; band++)
-      {
-         T* destinationBand = static_cast<T*>(getBuf(band));
-         destinationIndex = destinationOffset;
-         sourceIndex = sourceOffset;
-         T nullPix = (T)getNullPix(band);
-         T minPix = (T)getMinPix(band);
-         for (ossim_uint32 line = 0; line < clipHeight; ++line)
-         {
-            for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
-            {
-               if(src[sourceIndex+sample] != 255)
-               {
-                  if(src[sourceIndex+sample] != 0)
-                  {
-                     destinationBand[destinationIndex + sample] = (T)(destinationBand[destinationIndex + sample]*
-                                                                      (src[sourceIndex+sample]*normalizer));
-                     if(destinationBand[destinationIndex + sample] == nullPix)
-                     {
-                        destinationBand[destinationIndex + sample] = minPix;
-                     }
-                  }
-                  else
-                  {
-                     destinationBand[destinationIndex + sample] = nullPix;
-                  }
-               }
-               else if(destinationBand[destinationIndex + sample] == nullPix)
-               {
-                  destinationBand[destinationIndex + sample] = minPix;
-               }
-            }
-            sourceIndex += s_width;
-            destinationIndex += d_width;
-         }
-      }
-      
-   }
-}
-
-template <class T> void
-ossimImageData::unloadTileToBsqTemplate(T,  // dummy template arg...
-                                        void* dest,
-                                        const ossimIrect& dest_rect,
-                                        const ossimIrect& clip_rect) const
-{
-   static const char  MODULE[] = "ossimImageData::unloadTileToBsq";
-   
-   // Check the pointers.
-   if (!dest)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nNULL pointer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   bool dataIsNull = false;
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      dataIsNull = true;
-   }
-
-   ossimIrect img_rect = getImageRectangle();
-   
-   // Clip the clip_rect to the tile rect.
-   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
-
-   // Clip it again to the destination rect.
-   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
-   
-   // Check the output clip rect for intersection.
-   if (output_clip_rect.hasNans())
-   {
-      return;
-   }
-   if ( !(output_clip_rect.intersects(dest_rect)) )
-   {
-      return;
-   }
-
-   ossim_uint32 num_bands = getNumberOfBands();
-   ossim_uint32 band      = 0;
-   if(!dataIsNull)
-   {
-      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
-      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
-      ossim_uint32 s_width       = getWidth();
-      ossim_uint32 s_offset      = (output_clip_rect.ul().y - img_rect.ul().y) *
-                                   s_width + (output_clip_rect.ul().x - img_rect.ul().x);
-
-      T* d        = static_cast<T*>(dest);
-      const T** s = new const T*[num_bands];
-
-      // Grab a pointers to each one.
-      for (band=0; band<num_bands; ++band)
-      {
-         s[band] = reinterpret_cast<const T*>(getBuf(band));
-
-         // Move to first valid pixel.
-         s[band] += s_offset;
-      }
-
-      // Move to first valid pixel.
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
-           (output_clip_rect.ul().x - dest_rect.ul().x);
-
-      for (band=0; band<num_bands; ++band)
-      {
-         ossim_uint32 d_buf_offset = 0;
-
-         for (ossim_int32 line=output_clip_rect.ul().y;
-              line<=output_clip_rect.lr().y; ++line)
-         {
-            ossim_int32 i=0;
-            for (ossim_int32 samp=output_clip_rect.ul().x;
-                 samp<=output_clip_rect.lr().x; ++samp)
-            {
-               d[d_buf_offset+i] = s[band][i];
-               ++i;
-            }
-
-            d_buf_offset += d_width;
-            s[band]      += s_width;
-         }
-         d += d_band_offset;
-      }
-      
-      // Free up memory allocated for pointers.
-      delete [] s;
-   }
-   else
-   {
-      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
-      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
-      
-      ossim_uint8* d = static_cast<ossim_uint8*>(dest);
-            
-      // Move to first valid pixel.
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
-           (output_clip_rect.ul().x - dest_rect.ul().x);
-      
-      for (band=0; band<num_bands; ++band)
-      {
-         ossim_uint8 np = static_cast<ossim_uint8>(m_nullPixelValue[band]);
-         ossim_uint32 d_buf_offset = 0;
-         
-         for (ossim_int32 line=output_clip_rect.ul().y;
-              line<=output_clip_rect.lr().y; ++line)
-         {
-            ossim_int32 i=0;
-            for (ossim_int32 samp=output_clip_rect.ul().x;
-                 samp<=output_clip_rect.lr().x; ++samp)
-            {
-               d[d_buf_offset+i] = np;
-               ++i;
-            }
-            
-            d_buf_offset += d_width;
-         }
-         d += d_band_offset;
-      }
-   }
-}
-
-template <class T> void
-ossimImageData::unloadBandToBsqTemplate(T,  // dummy template arg...
-                                        void* dest,
-                                        ossim_uint32 src_band,
-                                        ossim_uint32 dest_band,
-                                        const ossimIrect& dest_rect,
-                                        const ossimIrect& clip_rect,
-                                        OverwriteBandRule ow_type) const
-{
-   static const char  MODULE[] = "ossimImageData::unloadBandToBsq";
-
-   // Check the pointers.
-   if (!dest)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nNULL pointer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   bool dataIsNull = false;
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      dataIsNull = true;
-   }
-
-   ossimIrect img_rect = getImageRectangle();
-
-   // Clip the clip_rect to the tile rect.
-   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
-
-   // Clip it again to the destination rect.
-   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
-
-   // Check the output clip rect for intersection.
-   if (output_clip_rect.hasNans())
-   {
-      return;
-   }
-   if ( !(output_clip_rect.intersects(dest_rect)) )
-   {
-      return;
-   }
-
-   ossim_uint32 num_bands = getNumberOfBands();
-   ossim_uint32 band      = 0;
-   if(!dataIsNull)
-   {
-      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
-      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
-      ossim_uint32 s_width  = getWidth();
-      ossim_uint32 s_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
-         s_width + (output_clip_rect.ul().x - img_rect.ul().x);
-
-      T* d        = static_cast<T*>(dest);
-      const T** s = new const T*[num_bands];
-
-      // Grab a pointers to each one.
-      for (band=0; band<num_bands; ++band)
-      {
-         s[band] = reinterpret_cast<const T*>(getBuf(band));
-
-         // Move to first valid pixel.
-         s[band] += s_offset;
-      }
-
-      // Move to first valid pixel.
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
-           (output_clip_rect.ul().x - dest_rect.ul().x);
-
-      ossim_uint32 d_dest_band_offset = dest_band * d_band_offset;
-      ossim_uint32 d_buf_offset = 0;
-
-      for (ossim_int32 line=output_clip_rect.ul().y;
-         line<=output_clip_rect.lr().y; ++line)
-      {
-         ossim_int32 i=0;
-         for (ossim_int32 samp=output_clip_rect.ul().x;
-            samp<=output_clip_rect.lr().x; ++samp)
-         {
-            ossim_uint32 d_pixel_offset = d_buf_offset+i;
-            ossim_uint32 d_dest_band_pixel_offset = d_pixel_offset + d_dest_band_offset;
-
-            switch( ow_type )
-            {
-               case COLOR_DISCREPANCY:
-               case COLOR_DISCREPANCY_OF_ANY_FROM_DEST:
-               {
-                  T d_dest_band = d[d_dest_band_pixel_offset];
-
-                  for ( band=0; band<num_bands && band!=dest_band; ++band )
-                  {
-                     T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
-
-                     // test for color discrepancy
-                     if ( d_other_band != d_dest_band )
-                     {
-                        d[d_dest_band_pixel_offset] = s[src_band][i];
-                        break;
-                     }
-                  }
-               }
-               break;
-
-               case COLOR_DISCREPANCY_OF_ALL_FROM_DEST:
-               {
-                  T d_dest_band = d[d_dest_band_pixel_offset];
-
-                  bool bFoundSameValue = false;
-                  for ( band=0; band<num_bands && band!=dest_band; ++band )
-                  {
-                     T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
-
-                     // test for color sameness
-                     if ( d_other_band == d_dest_band )
-                     {
-                        bFoundSameValue = true;
-                        break;
-                     }
-                  }
-                  if ( bFoundSameValue == false )
-                  {
-                     d[d_dest_band_pixel_offset] = s[src_band][i];
-                  }
-               }
-               break;
-
-               case COLOR_EQUALITY_OF_ANY_TO_SRC:
-               {
-                  T d_src_band = s[src_band][i];
-
-                  for ( band=0; band<num_bands && band!=dest_band; ++band )
-                  {
-                     T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
-
-                     // test for color discrepancy
-                     if ( d_other_band == d_src_band )
-                     {
-                        d[d_dest_band_pixel_offset] = s[src_band][i];
-                        break;
-                     }
-                  }
-               }
-               break;
-
-               case COLOR_EQUALITY_OF_ALL_TO_SRC:
-               {
-                  T d_src_band = s[src_band][i];
-
-                  bool bFoundDifferentValue = false;
-                  for ( band=0; band<num_bands && band!=dest_band; ++band )
-                  {
-                     T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
-
-                     // test for color discrepancy
-                     if ( d_other_band != d_src_band )
-                     {
-                        bFoundDifferentValue = true;
-                        break;
-                     }
-                  }
-                  if ( bFoundDifferentValue == false )
-                  {
-                     d[d_dest_band_pixel_offset] = s[src_band][i];
-                  }
-               }
-               break;
-
-               case NULL_RULE:
-               default:
-               {
-                  d[d_dest_band_pixel_offset] = s[src_band][i];
-               }
-               break;
-            }
-
-            ++i;
-         }
-
-         d_buf_offset += d_width;
-         s[src_band]  += s_width;
-      }
-
-      // Free up memory allocated for pointers.
-      delete [] s;
-   }
-   else
-   {
-      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
-      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
-
-      ossim_uint8* d = static_cast<ossim_uint8*>(dest);
-
-      // Move to first valid pixel.
-      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
-         (output_clip_rect.ul().x - dest_rect.ul().x);
-
-      for (band=0; band<num_bands; ++band)
-      {
-         ossim_uint8 np = static_cast<ossim_uint8>(m_nullPixelValue[band]);
-         ossim_uint32 d_buf_offset = 0;
-
-         for (ossim_int32 line=output_clip_rect.ul().y;
-            line<=output_clip_rect.lr().y; ++line)
-         {
-            ossim_int32 i=0;
-            for (ossim_int32 samp=output_clip_rect.ul().x;
-               samp<=output_clip_rect.lr().x; ++samp)
-            {
-               d[d_buf_offset+i] = np;
-               ++i;
-            }
-
-            d_buf_offset += d_width;
-         }
-         d += d_band_offset;
-      }
-   }
-}
-
-ossimObject* ossimImageData::dup() const
-{
-   return new ossimImageData(*this);
-}
-
-void ossimImageData::copyTileToNormalizedBuffer(ossim_float64* buf)const
-{
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-   
-   switch(getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         memmove(buf, getBuf(), getDataSizeInBytes());
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
-         const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf());
-         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            buf[offset] = inputBuf[offset];
-         }
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         copyTileToNormalizedBuffer((ossim_float32)0, buf);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         copyTileToNormalizedBuffer((ossim_float64)0, buf);
-         break;
-      }
-      case OSSIM_UINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_uint8)0, buf);
-         break;
-      
-      }
-      case OSSIM_SINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_sint8)0, buf);
-         break;
-      
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_uint16)0, buf);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_sint16)0, buf);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_uint32)0, buf);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_sint32)0, buf);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "NOTICE:  copyTileToNormalizedBuffer not implemented yet"
-            << std::endl;
-      }
-      
-   }  // End of "switch(getScalarType())"
-}
-
-template <class T>
-void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
-                                                ossim_float64* buf) const
-{
-   const ossim_uint32 SIZE  = getSizePerBand();
-   const ossim_uint32 BANDS = getNumberOfBands();
-   
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const ossim_float64 MIN_PIX = getMinPix(band);
-      const ossim_float64 MAX_PIX = getMaxPix(band);
-      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-      const ossim_float64 NP      = getNullPix(band);
-
-      const T* s = (T*)getBuf(band);  // source
-      ossim_float64* d = (ossim_float64*)(buf + (band*SIZE));  // destination
-      
-      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-      {
-         ossim_float64 p = s[offset];
-         if(p != NP)
-         {
-            if( p == MIN_PIX)
-            {
-               d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
-            }
-            else
-            {
-               d[offset] = (p-MIN_PIX)/RANGE;
-            }
-         }
-         else
-         {
-            d[offset] = 0.0;
-         }
-      }
-   }   
-}
-
-template <class T>
-void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
-                                                ossim_float32* buf) const
-{
-   const ossim_uint32 SIZE  = getSizePerBand();
-   const ossim_uint32 BANDS = getNumberOfBands();
-   
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const ossim_float64 MIN_PIX = getMinPix(band);
-      const ossim_float64 MAX_PIX = getMaxPix(band);
-      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-      const ossim_float64 NP      = getNullPix(band);
-      
-      const T* s = (T*)getBuf(band);  // source
-      ossim_float32* d = (ossim_float32*)(buf + (band*SIZE));  // destination
-      
-      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-      {
-         ossim_float64 p = s[offset];
-         if(p != NP)
-         {
-            if( p == MIN_PIX)
-            {
-               d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
-            }
-            else
-            {
-               d[offset] = (p-MIN_PIX)/RANGE;
-            }
-         }
-         else
-         {
-            d[offset] = 0.0;
-         }
-      }
-   }   
-}
-
-template <class T>
-void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
-                                                ossim_uint32 band,
-                                                ossim_float64* buf) const
-{
-   const ossim_uint32  SIZE    = getSizePerBand();
-   const ossim_float64 MIN_PIX = getMinPix(band);
-   const ossim_float64 MAX_PIX = getMaxPix(band);
-   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-   const ossim_float64 NP      = getNullPix(band);
-   
-   const T* s = (T*)getBuf(band);  // source
-   ossim_float64* d = (ossim_float64*)(buf);  // destination
-   
-   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-   {
-         ossim_float64 p = s[offset];
-         if(p != NP)
-         {
-            if( p == MIN_PIX)
-            {
-               d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
-            }
-            else
-            {
-               d[offset] = (p-MIN_PIX)/RANGE;
-            }
-         }
-         else
-         {
-            d[offset] = 0.0;
-         }
-   }   
-}
-
-template <class T>
-void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
-                                                ossim_uint32 band,
-                                                ossim_float32* buf) const
-{
-   const ossim_uint32  SIZE    = getSizePerBand();
-   const ossim_float64 MIN_PIX = getMinPix(band);
-   const ossim_float64 MAX_PIX = getMaxPix(band);
-   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-   const ossim_float64 NP      = getNullPix(band);
-   
-   const T* s = (T*)getBuf(band);  // source
-   ossim_float32* d     = (ossim_float32*)(buf);  // destination
-   
-   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-   {
-      ossim_float64 p = s[offset];
-      if(p != NP)
-      {
-         if( p == MIN_PIX)
-         {
-            d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
-         }
-         else
-         {
-            d[offset] = (p-MIN_PIX)/RANGE;
-         }
-      }
-      else
-      {
-         d[offset] = 0.0;
-      }
-   }   
-}
-
-template <class T>
-void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
-                                                ossim_float64* buf)
-{
-   const ossim_uint32 SIZE  = getSizePerBand();
-   const ossim_uint32 BANDS = getNumberOfBands();
-   
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const ossim_float64 MIN_PIX = getMinPix(band);
-      const ossim_float64 MAX_PIX = getMaxPix(band);
-      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-      const T NP                  = (T)getNullPix(band);
-      
-      ossim_float64* s = buf + (band*SIZE); // source
-      T* d   = (T*)getBuf(band); // destination
-      
-      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-      {
-         const ossim_float64 P = s[offset];
-         if(P != 0.0)
-         {
-            d[offset] = (T)(MIN_PIX + RANGE*P);
-         }
-         else
-         {
-            d[offset] = NP;
-         }
-      }
-   }
-}
-
-template <class T>
-void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
-                                                ossim_float32* buf)
-{
-   const ossim_uint32 SIZE  = getSizePerBand();
-   const ossim_uint32 BANDS = getNumberOfBands();
-   
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const ossim_float64 MIN_PIX = getMinPix(band);
-      const ossim_float64 MAX_PIX = getMaxPix(band);
-      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-      const T             NP      = (T)getNullPix(band);
-      
-      ossim_float32* s = buf + (band*SIZE); // source
-      T* d   = (T*)getBuf(band); // destination
-      
-      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-      {
-         const ossim_float64 P = s[offset];
-         if(P != 0.0)
-         {
-	   ossim_float64 test = MIN_PIX + RANGE*P;
-	   if(test > MAX_PIX) test = MAX_PIX;
-	   d[offset] = (T)test;
-         }
-         else
-         {
-            d[offset] = NP;
-         }
-      }
-   }
-}
-
-template <class T>
-void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
-                                                ossim_uint32 band,
-                                                ossim_float64* buf)
-{
-   const ossim_uint32  SIZE    = getSizePerBand();
-   const ossim_float64 MIN_PIX = getMinPix(band);
-   const ossim_float64 MAX_PIX = getMaxPix(band);
-   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-   const T             NP      = (T)getNullPix(band);
-   
-   ossim_float64* s = buf; // source
-   T* d   = (T*)getBuf(band); // destination
-   
-   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-   {
-      const ossim_float64 P = s[offset];
-      if(P != 0.0)
-      {
-	   ossim_float64 test = MIN_PIX + RANGE*P;
-	   if(test > MAX_PIX) test = MAX_PIX;
-	   d[offset] = (T)test;
-      }
-      else
-      {
-         d[offset] = NP;
-      }
-   }
-}
-
-template <class T>
-void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
-                                                ossim_uint32 band,
-                                                ossim_float32* buf)
-{
-   const ossim_uint32 SIZE     = getSizePerBand();
-   const ossim_float64 MIN_PIX = getMinPix(band);
-   const ossim_float64 MAX_PIX = getMaxPix(band);
-   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
-   const T NP                  = (T)getNullPix(band);
-   
-   ossim_float32* s = buf; // source
-   T* d   = (T*)getBuf(band); // destination
-   
-   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
-   {
-      const ossim_float64 P = s[offset];
-      if(P != 0.0)
-      {
-	   ossim_float64 test = MIN_PIX + RANGE*P;
-	   if(test > MAX_PIX) test = MAX_PIX;
-	   d[offset] = (T)test;
-      }
-      else
-      {
-         d[offset] = NP;
-      }
-   }
-}
-
-void ossimImageData::copyTileBandToNormalizedBuffer(ossim_uint32 band,
-                                                    ossim_float64* buf) const
-{
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-   
-   if(!getBuf(band)) return;
-
-   switch(getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         memmove(buf, getBuf(band), getDataSizeInBytes());
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         ossim_uint32 upperBound = getWidth()*getHeight();
-         const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf(band));
-         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            buf[offset] = inputBuf[offset];
-         }
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         copyTileToNormalizedBuffer((ossim_float32)0, band, buf);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         copyTileToNormalizedBuffer((ossim_float64)0, band, buf);
-         break;
-      }
-      case OSSIM_UINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_uint8)0, band, buf);
-         break;
-      
-      }
-      case OSSIM_SINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_sint8)0, band, buf);
-         break;
-      
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_uint16)0, band, buf);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_sint16)0, band, buf);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_uint32)0, band, buf);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_sint32)0, band, buf);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
-            << " Unknown scalar type!"
-            << std::endl;
-      }
-      
-   }  // End of "switch(getScalarType())"
-   
-}
-
-void ossimImageData::copyTileToNormalizedBuffer(ossim_float32* buf)const
-{
-   
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-
-   switch(getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
-         const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf());
-         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            buf[offset] = inputBuf[offset];
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         memmove(buf, getBuf(), getDataSizeInBytes());
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         copyTileToNormalizedBuffer((ossim_float32)0, buf);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         copyTileToNormalizedBuffer((ossim_float64)0, buf);
-         break;
-      }
-      case OSSIM_UINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_uint8)0, buf);
-         break;
-      
-      }
-      case OSSIM_SINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_sint8)0, buf);
-         break;
-      
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_uint16)0, buf);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_sint16)0, buf);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_uint32)0, buf);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_sint32)0, buf);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "NOTICE:  copyTileToNormalizedBuffer not implemented yet"
-            << std::endl;
-      }
-      
-   }  // End of "switch(getScalarType())"
-}
-
-void ossimImageData::copyTileBandToNormalizedBuffer(ossim_uint32 band,
-                                                    ossim_float32* buf)const
-{
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-
-   switch(getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         ossim_uint32 upperBound = getWidth()*getHeight();
-         const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf(band));
-         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            buf[offset] = inputBuf[offset];
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         memmove(buf, getBuf(band), getSizePerBandInBytes());
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         copyTileToNormalizedBuffer((ossim_float32)0, band, buf);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         copyTileToNormalizedBuffer((ossim_float64)0, band, buf);
-         break;
-      }
-      case OSSIM_UINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_uint8)0, band, buf);
-         break;
-      
-      }
-      case OSSIM_SINT8:
-      {
-         copyTileToNormalizedBuffer((ossim_sint8)0, band, buf);
-         break;
-      
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_uint16)0, band, buf);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyTileToNormalizedBuffer((ossim_sint16)0, band, buf);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_uint32)0, band, buf);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyTileToNormalizedBuffer((ossim_sint32)0, band, buf);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
-            << " Unknown scalar type"
-            << std::endl;
-      }
-
-   }  // End of "switch(getScalarType())"
-}
-
-
-void ossimImageData::copyNormalizedBufferToTile(ossim_float64* buf)
-{
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-   
-   switch(getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         memmove(getBuf(), buf, getDataSizeInBytes());
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
-         ossim_float32* inputBuf = static_cast<ossim_float32*>(getBuf());
-         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            inputBuf[offset] = static_cast<ossim_float32>(buf[offset]);
-         }
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         copyNormalizedBufferToTile((ossim_float32)0, buf);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         copyNormalizedBufferToTile((ossim_float64)0, buf);
-         break;
-      }
-      case OSSIM_UINT8:
-      {
-         copyNormalizedBufferToTile((ossim_uint8)0, buf);
-         break;
-      
-      }
-      case OSSIM_SINT8:
-      {
-         copyNormalizedBufferToTile((ossim_sint8)0, buf);
-         break;
-      
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyNormalizedBufferToTile((ossim_uint16)0, buf);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyNormalizedBufferToTile((ossim_sint16)0, buf);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyNormalizedBufferToTile((ossim_uint32)0, buf);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyNormalizedBufferToTile((ossim_sint32)0, buf);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::copyNormalizedBufferToTile\n"
-            << "Unknown scalar type!" << std::endl;
-      }
-      
-   } // End of "switch(getScalarType())".
-}
-
-void ossimImageData::copyNormalizedBufferToTile(ossim_uint32 band,
-                                                ossim_float64* buf)
-{
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-
-   if(band < getNumberOfBands())
-   {
-      switch(getScalarType())
-      {
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            memmove(getBuf(band), buf, getSizePerBandInBytes());
-            break;
-         }
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            ossim_uint32 upperBound = getWidth()*getHeight();
-            ossim_float32* inputBuf = static_cast<ossim_float32*>(getBuf(band));
-            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-            {
-               inputBuf[offset] = static_cast<ossim_float32>(buf[offset]);
-            }
-            break;
-         }
-         case OSSIM_FLOAT32:
-         {
-            copyNormalizedBufferToTile((ossim_float32)0, band, buf);
-            break;
-         }
-         case OSSIM_FLOAT64:
-         {
-            copyNormalizedBufferToTile((ossim_float64)0, band, buf);
-            break;
-         }
-         case OSSIM_UINT8:
-         {
-            copyNormalizedBufferToTile((ossim_uint8)0, band, buf);
-            break;
-         
-         }
-         case OSSIM_SINT8:
-         {
-            copyNormalizedBufferToTile((ossim_sint8)0, band, buf);
-            break;
-         
-         }
-         case OSSIM_USHORT11:
-         case OSSIM_UINT16:
-         {
-            copyNormalizedBufferToTile((ossim_uint16)0, band, buf);
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            copyNormalizedBufferToTile((ossim_sint16)0, band, buf);
-            break;
-         }
-         case OSSIM_UINT32:
-         {
-            copyNormalizedBufferToTile((ossim_uint32)0, band, buf);
-            break;
-         }
-         case OSSIM_SINT32:
-         {
-            copyNormalizedBufferToTile((ossim_sint32)0, band, buf);
-            break;
-         }
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimImageData::copyNormalizedBufferToTile\n"
-               << "Unknown scalar type." << std::endl;
-         }
-         
-      } // End of "switch(getScalarType())".
-   }
-}
-
-void ossimImageData::copyNormalizedBufferToTile(ossim_float32* buf)
-{
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-
-   switch(getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
-         ossim_float64* inputBuf = static_cast<ossim_float64*>(getBuf());
-         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            inputBuf[offset] = buf[offset];
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         memmove(getBuf(), buf, getDataSizeInBytes());
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         copyNormalizedBufferToTile((ossim_float32)0, buf);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         copyNormalizedBufferToTile((ossim_float64)0, buf);
-         break;
-      }
-      case OSSIM_UINT8:
-      {
-         copyNormalizedBufferToTile((ossim_uint8)0, buf);
-         break;
-         
-      }
-      case OSSIM_SINT8:
-      {
-         copyNormalizedBufferToTile((ossim_sint8)0, buf);
-         break;
-         
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyNormalizedBufferToTile((ossim_uint16)0, buf);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyNormalizedBufferToTile((ossim_sint16)0, buf);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyNormalizedBufferToTile((ossim_uint32)0, buf);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyNormalizedBufferToTile((ossim_sint32)0, buf);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageDatacopyNormalizedBufferToTile\n"
-            << "Unknown scalar type!" << std::endl;
-      }
-      
-   }  // End of "switch(getScalarType())".
-}
-
-void ossimImageData::copyNormalizedBufferToTile(ossim_uint32 band,
-                                                ossim_float32* buf)
-{
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nNull buffer passed to method!  Returning..." << std::endl;
-      return;
-   }
-
-   if (getDataObjectStatus() == OSSIM_NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageData::copyNormalizedBufferToTile ERROR:"
-         << "\nThis object is null! Returning..." << std::endl;
-      return;
-   }
-
-   switch(getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         ossim_uint32 upperBound = getWidth()*getHeight();
-         ossim_float64* inputBuf = static_cast<ossim_float64*>(getBuf(band));
-         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-         {
-            inputBuf[offset] = buf[offset];
-         }
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         memmove(getBuf(band), buf, getSizePerBandInBytes());
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         copyNormalizedBufferToTile((ossim_float32)0, band, buf);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      {
-         copyNormalizedBufferToTile((ossim_float64)0, band, buf);
-         break;
-      }
-      case OSSIM_UINT8:
-      {
-         copyNormalizedBufferToTile((ossim_uint8)0, band, buf);
-         break;
-         
-      }
-      case OSSIM_SINT8:
-      {
-         copyNormalizedBufferToTile((ossim_sint8)0, band, buf);
-         break;
-         
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyNormalizedBufferToTile((ossim_uint16)0, band, buf);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyNormalizedBufferToTile((ossim_sint16)0, band, buf);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyNormalizedBufferToTile((ossim_uint32)0, band, buf);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyNormalizedBufferToTile((ossim_sint32)0, band, buf);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::copyNormalizedBufferToTile\n"
-            << "Unknown scalar type!" << std::endl;
-      }
-
-   }  // End of "switch(getScalarType())".
-}
-
-ossim_float64 ossimImageData::getMinNormalizedPix() const
-{
-   if (m_scalarType == OSSIM_NORMALIZED_DOUBLE ||
-       m_scalarType == OSSIM_NORMALIZED_FLOAT)
-   {
-      return m_minPixelValue[0];  // Already normalized.
-   }
-   return (1.0 / (m_maxPixelValue[0] - m_minPixelValue[0] + 1.0));
-}
-
-std::ostream& ossimImageData::print(std::ostream& out) const
-{
-   out << getClassName() << "::print:"
-       << "\nm_origin:  " << m_origin << "\n";
-   if(m_nullPixelValue.size())
-   {
-      out << "Null values: ";
-      
-      copy(m_nullPixelValue.begin(),
-           m_nullPixelValue.begin() + getNumberOfBands(),
-           std::ostream_iterator<ossim_float64>(out, " "));
-      out << "\n";
-   }
-   if(m_minPixelValue.size())
-   {
-      out << "Min values:  ";
-      
-      copy(m_minPixelValue.begin(),
-           m_minPixelValue.begin() + getNumberOfBands(),
-           std::ostream_iterator<ossim_float64>(out, " "));
-      out << "\n";
-   }
-   if(m_maxPixelValue.size())
-   {
-      out << "Max values:  ";
-      
-      copy(m_maxPixelValue.begin(),
-           m_maxPixelValue.begin() + getNumberOfBands(),
-           std::ostream_iterator<ossim_float64>(out, " "));
-      out << "\n";
-   }
-   out << "width:            " << getWidth()
-       << "\nheight:           " << getHeight()
-       << "\nimage rectangle:  " << getImageRectangle()
-       << "\nindexed:          " << m_indexedFlag
-       << "\nalpha size:       " << m_alpha.size()
-       << std::endl;
-
-   return ossimRectilinearDataObject::print(out);
-}
-
-void ossimImageData::stretchMinMax()
-{
-   if ( (getDataObjectStatus() != OSSIM_NULL) &&
-        (getDataObjectStatus() != OSSIM_EMPTY) )
-   {
-      switch (getScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            stretchMinMax(ossim_uint8(0));
-            return;
-         }  
-         case OSSIM_SINT8:
-         {
-            stretchMinMax(ossim_sint8(0));
-            return;
-         }  
-         case OSSIM_UINT16:
-         case OSSIM_USHORT11:
-         {
-            stretchMinMax(ossim_uint16(0));
-            return;
-         }  
-         case OSSIM_SINT16:
-         {
-            stretchMinMax(ossim_sint16(0));
-            return;
-         }  
-         case OSSIM_UINT32:
-         {
-            stretchMinMax(ossim_uint32(0));
-            return;
-         }
-         case OSSIM_SINT32:
-         {
-            stretchMinMax(ossim_sint32(0));
-            return;
-         }  
-         case OSSIM_FLOAT32:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            stretchMinMax(ossim_float32(0.0));
-            return;
-         }  
-         case OSSIM_NORMALIZED_DOUBLE:
-         case OSSIM_FLOAT64:
-         {
-            stretchMinMax(ossim_float64(0.0));
-            return;
-         }  
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-         {
-            setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
-            ossimSetError(getClassName(),
-                          ossimErrorCodes::OSSIM_ERROR,
-                          "ossimImageData::stretchMinMax File %s line %d\n\
-Invalid scalar type:  %d",
-                          __FILE__,
-                          __LINE__,
-                          getScalarType());
-            break;
-         }
-      }
-   }
-}
-
-template <class T> void ossimImageData::stretchMinMax(T /* dummyTemplate */)
-{
-   const ossim_uint32 BANDS  = getNumberOfBands();
-   const ossim_uint32 SPB    = getSizePerBand();
-
-   // scalar min
-   const ossim_float64 S_MIN = ossim::defaultMin(getScalarType());
-
-   // scalar max
-   const ossim_float64 S_MAX = ossim::defaultMax(getScalarType());
-
-   // scalar null
-   const ossim_float64 S_NUL = ossim::defaultNull(getScalarType());
-
-   // scalar range
-   const ossim_float64 S_RNG = S_MAX-S_MIN+1.0;
-
-   for(ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      T* s = static_cast<T*>(getBuf(band));
-
-      if (s)
-      {
-         const ossim_float64 T_NUL = m_nullPixelValue[band]; // tile null
-         const ossim_float64 T_MIN = m_minPixelValue[band];  // tile min
-         const ossim_float64 T_MAX = m_maxPixelValue[band];  // tile max
-         const ossim_float64 T_RNG = (T_MAX-T_MIN)+1;           // tile range
-         const ossim_float64 SPP = S_RNG / T_RNG; // stretch per pixel
-         
-         for(ossim_uint32 i = 0; i < SPB; ++i)
-         {
-            ossim_float64 p = s[i];
-            if ( p == T_NUL )
-            {
-               p = S_NUL;
-            }
-            else if (p <= T_MIN)
-            {
-               p = S_MIN;
-            }
-            else if (p >= T_MAX)
-            {
-               p = S_MAX;
-            }
-            else
-            {
-               // Stretch...
-               p = (p - T_MIN + 1.0) * SPP + S_MIN - 1.0;
-            }
-            s[i] = ossim::round<T>(p);
-         }
-
-         // Set the min, max, null:
-         m_minPixelValue[band]  = S_MIN;
-         m_maxPixelValue[band]  = S_MAX;
-         m_nullPixelValue[band] = S_NUL;
-         
-      }
-   } 
-}
-
-void ossimImageData::computeAlphaChannel()
-{
-   if ( getDataObjectStatus() != OSSIM_NULL )
-   {
-      switch (getScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            computeAlphaChannel(ossim_uint8(0));
-            return;
-         }  
-         case OSSIM_SINT8:
-         {
-            computeAlphaChannel(ossim_sint8(0));
-            return;
-         }  
-         case OSSIM_UINT16:
-         case OSSIM_USHORT11:
-         {
-            computeAlphaChannel(ossim_uint16(0));
-            return;
-         }  
-         case OSSIM_SINT16:
-         {
-            computeAlphaChannel(ossim_sint16(0));
-            return;
-         }  
-         case OSSIM_UINT32:
-         {
-            computeAlphaChannel(ossim_uint32(0));
-            return;
-         }
-         case OSSIM_SINT32:
-         {
-            computeAlphaChannel(ossim_sint32(0));
-            return;
-         }  
-         case OSSIM_FLOAT32:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            computeAlphaChannel(ossim_float32(0.0));
-            return;
-         }  
-         case OSSIM_NORMALIZED_DOUBLE:
-         case OSSIM_FLOAT64:
-         {
-            computeAlphaChannel(ossim_float64(0.0));
-            return;
-         }  
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-         {
-            setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
-            ossimSetError(getClassName(),
-                          ossimErrorCodes::OSSIM_ERROR,
-                          "ossimImageData::computeAlphaChannel File %s line %d\n\
-Invalid scalar type:  %d",
-                          __FILE__,
-                          __LINE__,
-                          getScalarType());
-            break;
-         }
-      }
-   }
-}
-
-template <class T> void ossimImageData::computeAlphaChannel(T /* dummyTemplate */)
-{
-   const ossim_uint32 SPB = getSizePerBand();
-   const ossim_uint8  ANP = 0;   // Alpha Null Pixel
-   const ossim_uint8  AVP = 255; // Alpha Valid Pixel
-
-   // Allocate the alpha channel if not already.
-   if (m_alpha.size() != SPB)
-   {
-      m_alpha.resize(SPB);
-   }
-
-   if (getDataObjectStatus() == OSSIM_FULL)
-   {
-      memset( static_cast<void*>(&m_alpha.front()),
-              static_cast<int>(AVP),
-              static_cast<int>(SPB) );
-   }
-   else if (getDataObjectStatus() == OSSIM_EMPTY)
-   {
-      // Start with alpha being set to 0.  
-      memset( static_cast<void*>(&m_alpha.front()),
-              static_cast<int>(ANP),
-              static_cast<int>(SPB) );
-   }
-   else // Partial must check each pixel.
-   {
-      const ossim_uint32 BANDS = getNumberOfBands();
-
-      std::vector<T> null_pix(BANDS);
-      std::vector<const T*> buf(BANDS); // Pointer to pixel data.
-      ossim_uint32 band;
-      for(band = 0; band < BANDS; ++band)
-      {
-         buf[band] = static_cast<const T*>(getBuf(band));
-         null_pix[band] = static_cast<T>(m_nullPixelValue[band]);
-      }
-   
-      for(ossim_uint32 i = 0; i < SPB; ++i)
-      {
-         //---
-         // Start with alpha being set to 0.  If any band has a valid pixel set
-         // to 255 and break from band loop.
-         //---
-         m_alpha[i] = ANP;
-         for(band = 0; band < BANDS; ++band)
-         {
-            if (buf[band][i] != null_pix[band])
-            {
-               m_alpha[i] = AVP;
-               break;
-            }
-         }
-      }
-   }
-   
-}  //  End: template <class T> void ossimImageData::computeAlphaChannel
-
-ossim_uint32 ossimImageData::getWidth()const
-{
-   return m_spatialExtents[0];
-}
-
-ossim_uint32 ossimImageData::getHeight()const
-{
-   return m_spatialExtents[1];
-}
-
-void ossimImageData::getWidthHeight(ossim_uint32& w, ossim_uint32& h)
-{
-   w = m_spatialExtents[0];
-   h = m_spatialExtents[1];
-}
-
-void ossimImageData::setWidth(ossim_uint32 width)
-{
-   m_spatialExtents[0] = width;
-}
-
-void ossimImageData::setHeight(ossim_uint32 height)
-{
-   m_spatialExtents[1] = height;
-}
-
-void ossimImageData::setWidthHeight(ossim_uint32 w, ossim_uint32 h)
-{
-   m_spatialExtents[0] = w;
-   m_spatialExtents[1] = h;
-}
-
-void ossimImageData::setOrigin(const ossimIpt& origin)
-{
-   m_origin = origin;
-}
-
-ossim_uint32 ossimImageData::getDataSizeInBytes()const
-{
-   return getSizeInBytes();
-}
-
-void ossimImageData::copyLine(const void* src,
-                              ossim_int32 lineNumber,
-                              ossim_int32 lineStartSample,
-                              ossim_int32 lineStopSample,
-                              ossimInterleaveType lineInterleave)
-{
-   switch(m_scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         copyLineTemplate((ossim_uint8)0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         copyLineTemplate((ossim_sint8)0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-         
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         copyLineTemplate((ossim_uint16)0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         copyLineTemplate((ossim_sint16)0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         copyLineTemplate((ossim_uint32)0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         copyLineTemplate((ossim_sint32)0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT32:
-      {
-         copyLineTemplate((ossim_float32)0.0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         copyLineTemplate((ossim_float64)0.0, src, lineNumber, lineStartSample,
-                          lineStopSample, lineInterleave);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         // Shouldn't hit this.
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageData::copyLine Unsupported scalar type!"
-            << std::endl;
-         break;
-      }
-   }
-   
-} // End: void ossimImageData::copyLine
-
-template <class T>
-void ossimImageData::copyLineTemplate(T /* dummyTemplate */,
-                                      const void* src,
-                                      ossim_int32 lineNumber,
-                                      ossim_int32 lineStartSample,
-                                      ossim_int32 lineStopSample,
-                                      ossimInterleaveType lineInterleave)
-{
-   if (src)
-   {
-      const ossimIrect RECT = getImageRectangle();
-
-      // Check for intersect:
-      if ( ( lineNumber       >= RECT.ul().y)     &&
-           ( lineNumber       <= RECT.lr().y)     &&
-           ( lineStartSample  <  lineStopSample)  &&
-           ( lineStartSample  <= RECT.lr().x)     &&
-           ( lineStopSample   >= RECT.ul().x) )
-      {
-         const ossim_int32 BANDS = static_cast<ossim_int32>(m_numberOfDataComponents);
-         const ossim_int32 START_SAMP =
-            (lineStartSample > RECT.ul().x)?lineStartSample:RECT.ul().x;
-         const ossim_int32 STOP_SAMP  =
-            (lineStopSample  < RECT.lr().x)?lineStopSample:RECT.lr().x;
-         const ossim_int32 SAMPS = STOP_SAMP - START_SAMP + 1;
-
-         std::vector<T*> d(BANDS);
-
-         ossim_int32 band;
-         for (band = 0; band < BANDS; ++band)
-         {
-            d[band] = static_cast<T*>(getBuf(band));
-
-            // Position at start sample.
-            d[band] +=  (lineNumber - RECT.ul().y) * RECT.width() + (START_SAMP - RECT.ul().x);
-         }
-         
-         if (lineInterleave == OSSIM_BIP)
-         {
-            const T* S = static_cast<const T*>(src); // Source buffer:
-            
-            // Position at start sample.
-            S += (START_SAMP - lineStartSample) * BANDS;
-            
-            ossim_int32 srcOffset = 0;
-            for (ossim_int32 samp = 0; samp < SAMPS; ++samp)
-            {
-               for (band = 0; band < BANDS; ++band)
-               {
-                  d[band][samp] = S[srcOffset++];
-               }
-            }
-         }
-         else
-         {
-            const ossim_int32 W = lineStopSample - lineStartSample + 1;
-            std::vector<const T*> S(BANDS);
-            for (band = 0; band < BANDS; ++band)
-            {
-               S[band] = static_cast<const T*>(src) + (START_SAMP - lineStartSample);
-               if (band)
-               {
-                  S[band] += band * W; // Move to line.
-               }
-            }
-
-            for (band = 0; band < BANDS; ++band)
-            {
-               for (ossim_int32 samp = 0; samp < SAMPS; ++samp)
-               {
-                  d[band][samp] = S[band][samp];
-               }
-            }
-         }
-         
-      } // intersect check
-      
-   } // if (src)
-   
-} // End: template <class T> void ossimImageData::copyLineTemplate
-
-void ossimImageData::setIndexedFlag(bool flag)
-{
-   m_indexedFlag = flag;
-}
-
-bool ossimImageData::getIndexedFlag() const
-{
-   return m_indexedFlag;
-}
-
-bool ossimImageData::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   bool result = ossimRectilinearDataObject::saveState(kwl, prefix);
-   ossimString null_pixels;
-   ossimString min_pixels;
-   ossimString max_pixels;
-   ossim::toSimpleStringList(null_pixels, m_nullPixelValue);
-   ossim::toSimpleStringList(min_pixels, m_minPixelValue);
-   ossim::toSimpleStringList(max_pixels, m_maxPixelValue);
-   
-   kwl.add(prefix, "null_pixels", null_pixels, true);
-   kwl.add(prefix, "min_pixels", min_pixels, true);
-   kwl.add(prefix, "max_pixels", max_pixels, true);
-   
-   ossimString alpha;
-   ossim::toSimpleStringList(alpha, m_alpha);
-   kwl.add(prefix, "alpha", alpha, true);
-   kwl.add(prefix, "indexed", m_indexedFlag, true);
-   kwl.add(prefix, "origin", m_origin.toString(), true);
-   return result;
-   
-}
-
-bool ossimImageData::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   bool result = ossimRectilinearDataObject::loadState(kwl, prefix);
-   m_spatialExtents.resize(2);
-   if(result)
-   {
-      const char* null_pixels = kwl.find(prefix, "null_pixels");
-      const char* min_pixels = kwl.find(prefix, "min_pixels");
-      const char* max_pixels = kwl.find(prefix, "max_pixels");
-      const char* alpha = kwl.find(prefix, "alpha");
-      const char* origin = kwl.find(prefix, "origin");
-      const char* indexed = kwl.find(prefix, "indexed");
-      ossimString rectString = kwl.find(prefix, "rect");
-      const char* numberOfBands = kwl.find(prefix, "number_bands");
-      m_nullPixelValue.clear();
-      m_minPixelValue.clear();
-      m_maxPixelValue.clear();
-      m_alpha.clear();
-      if(null_pixels)
-      {
-         if(!ossim::toSimpleVector(m_nullPixelValue, ossimString(null_pixels)))
-         {
-            return false;
-         }
-      }
-      if(min_pixels)
-      {
-         if(!ossim::toSimpleVector(m_minPixelValue, ossimString(min_pixels)))
-         {
-            return false;
-         }
-      }
-      if(max_pixels)
-      {
-         if(!ossim::toSimpleVector(m_maxPixelValue, ossimString(max_pixels)))
-         {
-            return false;
-         }
-      }
-      if(alpha)
-      {
-         if(!ossim::toSimpleVector(m_alpha, ossimString(alpha)))
-         {
-            return false;
-         }
-      }
-      if(origin)
-      {
-         m_origin.toPoint(origin);
-      }
-      m_indexedFlag = false;
-      if(indexed)
-      {
-         m_indexedFlag = ossimString(indexed).toBool();
-      }
-      if(!rectString.empty())
-      {
-        ossimIrect rect;
-
-        if(rect.toRect(rectString))
-        {
-          setImageRectangle(rect);
-        }
-      }
-      if(numberOfBands)
-      {
-        ossim_uint32 nBands = ossimString(numberOfBands).toUInt32();
-        setNumberOfDataComponents(nBands);
-        if(m_nullPixelValue.empty()||
-          m_minPixelValue.empty()||
-          m_maxPixelValue.empty())
-          {
-            initializeDefaults();
-          }
-      }
-   }
-   
-   return result;
-}                     
-
diff --git a/ossim/src/ossim/imaging/ossimImageDataFactory.cpp b/ossim/src/ossim/imaging/ossimImageDataFactory.cpp
deleted file mode 100644
index 7f2287d..0000000
--- a/ossim/src/ossim/imaging/ossimImageDataFactory.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// Contributor: David A. Horner (DAH) - http://dave.thehorners.com
-// 
-//*************************************************************************
-// $Id: ossimImageDataFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <ossim/imaging/ossimU11ImageData.h>
-#include <ossim/imaging/ossimU16ImageData.h>
-#include <ossim/imaging/ossimS16ImageData.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimImageDataFactory:debug");
-
-ossimImageDataFactory* ossimImageDataFactory::theInstance = 0;
-OpenThreads::Mutex ossimImageDataFactory::theInstanceMutex;
-ossimImageDataFactory::ossimImageDataFactory() 
-{
-   theInstance = 0;
-}
-
-ossimImageDataFactory::~ossimImageDataFactory()
-{
-   if(theInstance)
-   {
-      //delete theInstance;
-      theInstance = 0;
-   }
-}
-
-ossimImageDataFactory* ossimImageDataFactory::instance()
-{
-   theInstanceMutex.lock();
-   if(!theInstance)
-   {
-      theInstance = new ossimImageDataFactory;
-   }
-   theInstanceMutex.unlock();
-   return theInstance;
-}
-
-ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
-   ossimSource* owner,
-   ossimScalarType scalar,
-   ossim_uint32 bands)const
-{
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   ossim_uint32 width  = tileSize.x;
-   ossim_uint32 height = tileSize.y;
-   
-   // do some bounds checking and initialize to a default
-   bands  = (bands>0)?bands:1;
-   scalar = scalar != OSSIM_SCALAR_UNKNOWN?scalar:OSSIM_UINT8;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageDataFactory::create DEBUG:"
-         << "\nCaller:  "
-         << (owner ? owner->getClassName().c_str() : "unknown")
-         << "\nbands:   " << bands
-         << "\nwidth:   " << width
-         << "\nheight:  " << height
-         << "\nScalar type:  "
-         << (ossimScalarTypeLut::instance()->getEntryString(scalar))
-         << std::endl;
-   }
-   
-   ossimRefPtr<ossimImageData> result = 0;
-   switch(scalar)
-   {
-      case OSSIM_UINT8:
-      {
-         result = new ossimU8ImageData(owner, bands, width, height);
-         break;
-      }
-      case OSSIM_USHORT11:
-      {
-         result = new ossimU11ImageData(owner, bands, width, height);
-         break;
-      }
-      case OSSIM_UINT16:
-      {
-         result = new ossimU16ImageData(owner, bands, width, height);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         result = new ossimS16ImageData(owner, bands, width, height);
-         break;
-      }
-      default:
-      {
-         // create a generic image data implementation.
-         result = new ossimImageData(owner, scalar, bands, width, height);
-
-         // Set the scalar type for stretching.
-         ossimImageSource* inputSource = dynamic_cast<ossimImageSource*>(owner);
-         if( inputSource )
-         {
-            for(ossim_uint32 band = 0; band < bands; ++band)
-            {
-               result->setMinPix(inputSource->getMinPixelValue(band), band);
-               result->setMaxPix(inputSource->getMaxPixelValue(band), band);
-               result->setNullPix(inputSource->getNullPixelValue(band), band);
-            }
-         }
-         break;
-      }
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
-   ossimSource* owner,
-   ossimScalarType scalar,
-   ossim_uint32 bands,
-   ossim_uint32 width,
-   ossim_uint32 height)const
-{
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   // do some bounds checking and initialize to a default
-   bands  = bands  > 0?bands:1;
-   width  = width  > 0?width:tileSize.x;
-   height = height > 0?height:tileSize.y;
-   scalar = scalar != OSSIM_SCALAR_UNKNOWN?scalar:OSSIM_UINT8;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageDataFactory::create DEBUG:"
-         << "\nCaller:  "
-         << (owner ? owner->getClassName().c_str() : "unknown")
-         << "\nbands:   " << bands
-         << "\nwidth:   " << width
-         << "\nheight:  " << height
-         << "\nScalar type:  "
-         << (ossimScalarTypeLut::instance()->getEntryString(scalar))
-         << std::endl;
-   }
-   
-   ossimRefPtr<ossimImageData> result = 0;
-   switch(scalar)
-   {
-      case OSSIM_UINT8:
-      {
-         result = new ossimU8ImageData(owner, bands, width, height);
-         break;
-      }
-      case OSSIM_USHORT11:
-      {
-         result = new ossimU11ImageData(owner, bands, width, height);
-         break;
-      }
-      case OSSIM_UINT16:
-      {
-         result = new ossimU16ImageData(owner, bands, width, height);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         result = new ossimS16ImageData(owner, bands, width, height);
-         break;
-      }
-      default:
-      {
-         // create a generic image data implementation.
-         result = new ossimImageData(owner, scalar, bands, width, height);
-         break;
-      }
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
-   ossimSource* owner,
-   ossim_uint32 bands,
-   ossimImageSource* inputSource)const
-{
-   ossimRefPtr<ossimImageData> result = 0;
-
-   if(inputSource)
-   {
-      ossimScalarType scalar = inputSource->getOutputScalarType();
-      ossim_uint32 width  = inputSource->getTileWidth();
-      ossim_uint32 height = inputSource->getTileHeight();
-
-      result = create(owner, scalar, bands, width, height);
-      if ( result.valid() )
-      {
-         for(ossim_uint32 band = 0; band < bands; ++band)
-         {
-            result->setMinPix(inputSource->getMinPixelValue(band),   band);
-            result->setMaxPix(inputSource->getMaxPixelValue(band),   band);
-            result->setNullPix(inputSource->getNullPixelValue(band), band);
-         }
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageDataFactory::create ERROR:"
-         << "\nNULL input source!" << std::endl;
-   }
-   
-   return result;
-}
-
-
-ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
-   ossimSource* owner,
-   ossimImageSource* inputSource)const
-{
-   ossimRefPtr<ossimImageData> result = 0;
-
-   if(inputSource)
-   {
-      ossimScalarType scalar = inputSource->getOutputScalarType();
-      ossim_uint32 bands  = inputSource->getNumberOfOutputBands();
-      ossim_uint32 width  = inputSource->getTileWidth();
-      ossim_uint32 height = inputSource->getTileHeight();
-
-      result = create(owner, scalar, bands, width, height);
-      if ( result.valid() )
-      {
-         for(ossim_uint32 band = 0; band < bands; ++band)
-         {
-            result->setMinPix(inputSource->getMinPixelValue(band),   band);
-            result->setMaxPix(inputSource->getMaxPixelValue(band),   band);
-            result->setNullPix(inputSource->getNullPixelValue(band), band);
-         }
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimImageDataFactory::create ERROR:"
-         << "\nNULL input source!" << std::endl;
-   }
-
-   return result;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageDataHelper.cpp b/ossim/src/ossim/imaging/ossimImageDataHelper.cpp
deleted file mode 100644
index a5e6600..0000000
--- a/ossim/src/ossim/imaging/ossimImageDataHelper.cpp
+++ /dev/null
@@ -1,608 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageDataHelper.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimImageDataHelper.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/base/ossimLine.h>
-#include <vector>
-#include <algorithm>
-
-ossimImageDataHelper::ossimImageDataHelper(ossimImageData* imageData)
-{
-   setImageData(imageData);
-}
-
-
-void ossimImageDataHelper::setImageData(ossimImageData* imageData)
-{
-   theImageData = imageData;
-   if(theImageData)
-   {
-      theImageRectangle     = theImageData->getImageRectangle();
-      thePolyImageRectangle = theImageRectangle;
-//       thePolyImageRectangle = ossimPolyArea2d(theImageRectangle.ul(),
-//                                               theImageRectangle.ur(),
-//                                               theImageRectangle.lr(),
-//                                               theImageRectangle.ll());
-      theOrigin = theImageRectangle.ul();
-   }
-}
-
-void ossimImageDataHelper::copyInputToThis(const void* input,
-                                           const ossimPolygon& region,
-                                           bool clipPoly)
-{
-   if(!theImageData) return;
-   switch(theImageData->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         copyInputToThis(reinterpret_cast<const ossim_uint8*>(input),
-                         region,
-                         clipPoly);
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         copyInputToThis(reinterpret_cast<const ossim_uint16*>(input),
-                         region,
-                         clipPoly);
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         copyInputToThis(reinterpret_cast<const ossim_sint16*>(input),
-                         region,
-                         clipPoly);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-          copyInputToThis(reinterpret_cast<const ossim_sint32*>(input),
-                          region,
-                          clipPoly);
-          break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         copyInputToThis(reinterpret_cast<const float*>(input),
-                         region,
-                         clipPoly);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         copyInputToThis(reinterpret_cast<const double*>(input),
-                         region,
-                         clipPoly);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         break;
-      }
-   }   
-}
-
-void ossimImageDataHelper::fill(const ossimRgbVector& color,
-                                std::vector<ossimPolygon>& regionList,
-                                bool clipPoly)
-{
-   int i = 0;
-
-   for(i = 0; i < (int)regionList.size();++i)
-   {
-      fill(color,
-           regionList[i],
-           clipPoly);
-   }
-}
-
-
-void ossimImageDataHelper::fill(const double* values,
-                                std::vector<ossimPolygon>& regionList,
-                                bool clipPoly)
-{
-   int i = 0;
-
-   for(i = 0; i < (int)regionList.size();++i)
-   {
-      fill(values,
-           regionList[i],
-           clipPoly);
-   }
-}
-
-void ossimImageDataHelper::fill(const ossimRgbVector& color,
-                                const ossimPolygon& region,
-                                bool clipPoly)
-{
-   double colorArray[3];
-
-   colorArray[0] = color.getR();
-   colorArray[1] = color.getG();
-   colorArray[2] = color.getB();
-   switch(theImageData->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         if(theImageData->getNumberOfBands() <= 3)
-         {
-            fill(static_cast<ossim_uint8>(0),
-                 (const double*)colorArray,
-                 region,
-                 clipPoly);
-            
-         }
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      case OSSIM_SSHORT16:
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      default:
-      {
-         break;
-      }
-   }
-}
-
-void ossimImageDataHelper::fill(const ossimRgbVector& color,
-                                const ossimIrect& region,
-                                bool clipPoly)
-{
-   double colorArray[3];
-
-   colorArray[0] = color.getR();
-   colorArray[1] = color.getG();
-   colorArray[2] = color.getB();
-
-   switch(theImageData->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         if(theImageData->getNumberOfBands() <= 3)
-         {
-            fill(static_cast<ossim_uint8>(0),
-                 colorArray,
-                 region,
-                 clipPoly);
-            
-         }
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      case OSSIM_SSHORT16:
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         break;
-      }
-      default:
-         break;
-   }
-}
-
-void ossimImageDataHelper::fill(const double*  values,
-                                const ossimPolygon& region,
-                                bool clipPoly)
-{
-   switch(theImageData->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         fill(static_cast<ossim_uint8>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         fill(static_cast<ossim_uint16>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         fill(static_cast<ossim_sint16>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         fill(static_cast<float>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         fill(static_cast<double>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         break;
-      }
-   }
-}
-
-void ossimImageDataHelper::fill(const double*  values,
-                                const ossimIrect& region,
-                                bool clipPoly)
-{
-   switch(theImageData->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         fill(static_cast<ossim_uint8>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         fill(static_cast<ossim_uint16>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         fill(static_cast<ossim_sint16>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         fill(static_cast<float>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         fill(static_cast<double>(0),
-              values,
-              region,
-              clipPoly);
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         break;
-      }
-   }
-}
-
-
-
-template <class T>
-void ossimImageDataHelper::copyInputToThis(const T* inputBuf,
-                                           const ossimPolygon& region,
-                                           bool clipPoly)
-{
-   if(clipPoly)
-   {
-      ossimPolyArea2d polyArea(region);
-      ossimPolyArea2d clipArea = polyArea&thePolyImageRectangle;
-      
-      vector<ossimPolygon> clipList;
-      //      clipArea.getAllVisiblePolygons(clipList);
-      clipArea.getVisiblePolygons(clipList);
-
-      for(ossim_uint32 i = 0; i < clipList.size();++i)
-      {
-         copyInputToThis( inputBuf, clipList[i] );
-      }
-   }
-   else
-   {
-      copyInputToThis( inputBuf, region );
-   }
-}
-
-template <class T>
-void ossimImageDataHelper::copyInputToThis(const T* inputBuf,
-                                           const ossimPolygon& region)
-{ 
-   int n;
-   int i;
-   int y;
-   ossim_int32 miny, maxy, minx, maxx;
-   int x1, y1;
-   int x2, y2;
-   int ind1, ind2;
-   // int ints;
-   vector<int> polyInts;
-   T* buf = reinterpret_cast<T*>(theImageData->getBuf());
-   
-   ossim_int32 blockLength=theImageData->getWidth()*theImageData->getHeight();
-   ossim_int32 bandOffset = 0;
-   
-   region.getIntegerBounds(minx, miny, maxx, maxy);
-   ossim_int32 rowOffset = (miny-theOrigin.y)*theImageData->getWidth();
-   n = region.getVertexCount();
-   /* Fix in 1.3: count a vertex only once */
-   for (y = miny; (y <= maxy); y++)
-   {
-      polyInts.clear();
-      // ints = 0;
-      for (i = 0; (i < n); i++)
-      {
-         if (!i)
-         {
-            ind1 = n - 1;
-            ind2 = 0;
-         }
-         else
-         {
-            ind1 = i - 1;
-            ind2 = i;
-         }
-         y1 = ossim::round<int>(region[ind1].y);
-         y2 = ossim::round<int>(region[ind2].y);
-         if (y1 < y2)
-         {
-            x1 = ossim::round<int>(region[ind1].x);
-            x2 = ossim::round<int>(region[ind2].x);
-         }
-         else if (y1 > y2)
-         {
-            y2 = ossim::round<int>(region[ind1].y);
-            y1 = ossim::round<int>(region[ind2].y);
-            x2 = ossim::round<int>(region[ind1].x);
-            x1 = ossim::round<int>(region[ind2].x);
-         }
-         else
-         {
-            continue;
-         }
-         if ((y >= y1) && (y < y2))
-         {
-            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
-         }
-         else if ((y == maxy) && (y > y1) && (y <= y2))
-         {
-            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
-         }
-      }
-      std::sort(polyInts.begin(), polyInts.end());
-      
-      for (i = 0; (i < (int)polyInts.size()); i += 2)
-      {
-         ossim_int32 startX = polyInts[i]-theOrigin.x;
-         ossim_int32 endX   = polyInts[i+1]-theOrigin.x;
-         while(startX <= endX)
-         {
-            bandOffset = 0;
-	    int band;
-            for(band = 0; band < (ossim_int32)theImageData->getNumberOfBands();++band)
-            {
-               buf[rowOffset+bandOffset+startX] = (inputBuf[rowOffset+bandOffset+startX]);
-               bandOffset += blockLength;
-            }
-            ++startX;
-         }
-      }
-      rowOffset += theImageData->getWidth();
-   }
-}
-
-template <class T>
-void ossimImageDataHelper::fill(T dummyVariable,
-                                const double* values,
-                                const ossimPolygon& region,
-                                bool clipPoly)
-{
-   if(clipPoly)
-   {
-      ossimPolyArea2d polyArea(region);
-      ossimPolyArea2d clipArea = polyArea&thePolyImageRectangle;
-      
-      vector<ossimPolygon> clipList;
-      
-      clipArea.getVisiblePolygons(clipList);
-      
-      for(ossim_uint32 i = 0; i < clipList.size();++i)
-      {
-         fill( dummyVariable, values, clipList[i] );
-      }
-   }
-   else
-   {
-      fill( dummyVariable, values, region );
-   }
-}
-
-template <class T>
-void ossimImageDataHelper::fill(T dummyVariable,
-                                const double* values,
-                                const ossimIrect& region,
-                                bool clipPoly)
-{
-   if(clipPoly)
-   {
-      fill(dummyVariable,
-           values,
-           region.clipToRect(theImageData->getImageRectangle()));
-   }
-   else
-   {
-      fill(dummyVariable,
-           values,
-           region);
-   }
-}
-
-template <class T>
-void ossimImageDataHelper::fill(T /* dummyVariable */,
-                                const double* values,
-                                const ossimPolygon& region)
-{
-   int n;
-   int i;
-   int y;
-   ossim_int32 miny, maxy, minx, maxx;
-   int x1, y1;
-   int x2, y2;
-   int ind1, ind2;
-   // int ints;
-   vector<int> polyInts;
-   T* buf = reinterpret_cast<T*>(theImageData->getBuf());
-   
-   ossim_int32 blockLength=theImageData->getWidth()*theImageData->getHeight();
-   ossim_int32 bandOffset = 0;
-   
-   region.getIntegerBounds(minx, miny, maxx, maxy);
-   ossim_int32 rowOffset = (miny-theOrigin.y)*theImageData->getWidth();
-   n = region.getVertexCount();
-   /* Fix in 1.3: count a vertex only once */
-   for (y = miny; (y <= maxy); y++)
-   {
-      polyInts.clear();
-      // ints = 0;
-      for (i = 0; (i < n); i++)
-      {
-         if (!i)
-         {
-            ind1 = n - 1;
-            ind2 = 0;
-         }
-         else
-         {
-            ind1 = i - 1;
-            ind2 = i;
-         }
-         y1 = ossim::round<int>(region[ind1].y);
-         y2 = ossim::round<int>(region[ind2].y);
-         if (y1 < y2)
-         {
-            x1 = ossim::round<int>(region[ind1].x);
-            x2 = ossim::round<int>(region[ind2].x);
-         }
-            else if (y1 > y2)
-            {
-               y2 = ossim::round<int>(region[ind1].y);
-               y1 = ossim::round<int>(region[ind2].y);
-               x2 = ossim::round<int>(region[ind1].x);
-               x1 = ossim::round<int>(region[ind2].x);
-            }
-         else
-         {
-            continue;
-         }
-         if ((y >= y1) && (y < y2))
-         {
-            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
-         }
-         else if ((y == maxy) && (y > y1) && (y <= y2))
-         {
-            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
-         }
-      }
-      std::sort(polyInts.begin(), polyInts.end());
-      
-      for (i = 0; (i < (int)polyInts.size()); i += 2)
-      {
-         ossim_int32 startX = std::abs(polyInts[i]-theOrigin.x);
-         ossim_int32 endX   = std::abs(polyInts[i+1]-theOrigin.x);
-         while(startX <= endX)
-         {
-            bandOffset = 0;
-	    int band;
-            for(band = 0; band < (int)theImageData->getNumberOfBands();++band)
-            {
-               buf[rowOffset+bandOffset+startX] = (T)(values[band]);
-               bandOffset += blockLength;
-            }
-            ++startX;
-         }
-      }
-      rowOffset += theImageData->getWidth();
-   }
-}
-
-template <class T>
-void ossimImageDataHelper::fill(T /* dummyVariable */,
-                                const double* values,
-                                const ossimIrect& region)
-{
-   T* buf = reinterpret_cast<T*>(theImageData->getBuf());
-   
-   ossim_int32 blockLength=theImageData->getWidth()*theImageData->getHeight();
-   ossim_int32 bandOffset = 0;
-   ossim_int32 miny,maxy;
-   ossim_int32 minx, maxx;
-   ossim_int32 y = 0;
-   miny = region.ul().y-theOrigin.y;
-   maxy = region.lr().y-theOrigin.y;
-   minx = region.ul().x-theOrigin.x;
-   maxx = region.lr().x-theOrigin.x;
-   
-   ossim_int32 rowOffset = (miny)*theImageData->getWidth();
-   ossim_int32 startX = minx;
-   ossim_int32 endX   = maxx;
-   ossim_int32 bands  = (ossim_int32)theImageData->getNumberOfBands();
-
-   for (y = miny; (y <= maxy); ++y)
-   {
-      startX=minx;
-      while(startX <= endX)
-      {
-         bandOffset = 0;
-	 int band = 0;
-         for(band = 0; band < bands;++band)
-         {
-            buf[rowOffset+bandOffset+startX] = (T)(values[band]);
-            bandOffset += blockLength;
-         }
-         ++startX;
-      }
-      rowOffset += theImageData->getWidth();
-   }
-}
- 
-
diff --git a/ossim/src/ossim/imaging/ossimImageFileWriter.cpp b/ossim/src/ossim/imaging/ossimImageFileWriter.cpp
deleted file mode 100644
index 2019dee..0000000
--- a/ossim/src/ossim/imaging/ossimImageFileWriter.cpp
+++ /dev/null
@@ -1,1653 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Frank Warmerdam (warmerdam at pobox.com)
-//
-// Description:
-//
-// Contains class declaration for ossimImageFileWriter.
-//*******************************************************************
-//  $Id: ossimImageFileWriter.cpp 23068 2015-01-07 23:08:29Z okramer $
-
-
-#include <tiff.h> /* for tiff compression defines */
-
-#include <ossim/ossimConfig.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimImageTypeLut.h>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/imaging/ossimTiffOverviewBuilder.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-#include <ossim/imaging/ossimGeomFileWriter.h>
-#include <ossim/imaging/ossimEnviHeaderFileWriter.h>
-#include <ossim/imaging/ossimERSFileWriter.h>
-#include <ossim/imaging/ossimFgdcFileWriter.h>
-#include <ossim/imaging/ossimReadmeFileWriter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimWorldFileWriter.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimFilenameProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-
-static ossimTrace traceDebug("ossimImageFileWriter:debug");
-static const ossimString AUTO_CREATE_DIRECTORY_KW("auto_create_directory");
-
-#if OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimImageFileWriter.cpp 23068 2015-01-07 23:08:29Z okramer $";
-#endif
-
-RTTI_DEF3(ossimImageFileWriter,
-          "ossimImageFileWriter",
-          ossimImageWriter,
-          ossimProcessInterface,
-          ossimConnectableObjectListener)
-
-static const char SCALE_TO_EIGHT_BIT_KW[] = "scale_to_eight_bit";
-
-ossimImageFileWriter::ossimImageFileWriter(const ossimFilename& file,
-                                           ossimImageSource* inputSource,
-                                           ossimObject* owner)
-   : ossimImageWriter(owner,
-                      1,
-                      0,
-                      true,
-                      false),
-     ossimProcessInterface(),
-     ossimConnectableObjectListener(),
-     theViewController(NULL),
-     theProgressListener(NULL),
-     theFilename(file),
-     theOutputImageType(ossimImageTypeLut().getEntryString(OSSIM_IMAGE_TYPE_UNKNOWN)),
-     theWriteImageFlag(true),
-     theWriteOverviewFlag(false),
-     theWriteHistogramFlag(false),
-     theScaleToEightBitFlag(false),
-     theOverviewCompressType(COMPRESSION_NONE),
-     theOverviewJpegCompressQuality(75),
-     theWriteEnviHeaderFlag(false),
-     theWriteErsHeaderFlag(false),     
-     theWriteExternalGeometryFlag(false),
-     theWriteFgdcFlag(false),
-     theWriteJpegWorldFileFlag(false),
-     theWriteReadmeFlag(false),
-     theWriteTiffWorldFileFlag(false),
-     theWriteWorldFileFlag(false),
-     theAutoCreateDirectoryFlag(true),
-     theLinearUnits(OSSIM_UNIT_UNKNOWN),
-     thePixelType(OSSIM_PIXEL_IS_POINT)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageFileWriter::ossimImageFileWriter entered..."
-         << std::endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << std::endl;
-#endif
-   }
-
-   theInputConnection = new ossimImageSourceSequencer(inputSource);
-
-   // now map the sequencer to the same input
-   connectMyInputTo(0, inputSource);
-   initialize();
-
-   // make sure we listen to our input changes so we can change
-   // it for the sequencer as well.
-   ossimImageWriter::addListener((ossimConnectableObjectListener*)this);
-
-   theInputConnection->connectMyInputTo(0, inputSource, false);
-   theAreaOfInterest.makeNan();
-}
-
-ossimImageFileWriter::~ossimImageFileWriter()
-{
-   theInputConnection = 0;
-   theProgressListener = NULL;
-   removeListener((ossimConnectableObjectListener*)this);
-}
-
-void ossimImageFileWriter::initialize()
-{
-   if(theInputConnection.valid())
-   {
-      theInputConnection->initialize();
-
-      //---
-      // Area Of Interest(AOI):
-      // There are two AOIs to keep in sync.
-      // One owned by this base: ossimImageWriter::theAreaOfInterest
-      // One owned by the theInputConntion: ossimImageSourceSequencer::theAreaOfInterest
-      //---
-      if ( theAreaOfInterest.hasNans() == false )
-      {
-         //---
-         // ossimImageSourceSequencer::setAreaOfInterest does more than just set the
-         // variable, so only call if out of sync to avoid wasted cycles.
-         //--- 
-         if ( theAreaOfInterest != theInputConnection->getBoundingRect() )
-         {
-            theInputConnection->setAreaOfInterest( theAreaOfInterest );
-         }
-      }
-      else
-      {
-         // Set this AOI to bounding rect of input.
-         theAreaOfInterest = theInputConnection->getBoundingRect();
-      }
-   }
-}
-
-void ossimImageFileWriter::changeSequencer(ossimImageSourceSequencer* sequencer)
-{
-   if( sequencer )
-   {
-      theInputConnection = sequencer;
-      theInputConnection->connectMyInputTo(0, getInput(0));
-   }
-}
-
-bool ossimImageFileWriter::saveState(ossimKeywordlist& kwl,
-                                 const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           TYPE_NAME(this),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::FILENAME_KW,
-           theFilename.c_str(),
-           true);
-
-   kwl.add(prefix,
-           "create_envi_hdr",
-           (ossim_uint32)theWriteEnviHeaderFlag,
-           true);
-
-   kwl.add(prefix,
-           "create_ers_hdr",
-           (ossim_uint32)theWriteErsHeaderFlag,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW,
-           (ossim_uint32)theWriteExternalGeometryFlag,
-           true);
-
-   kwl.add(prefix,
-           "create_fgdc",
-           (ossim_uint32)theWriteFgdcFlag,
-           true);
-   
-   kwl.add(prefix,
-           "create_jpeg_world_file",
-           (ossim_uint32)theWriteJpegWorldFileFlag,
-           true);
-
-   kwl.add(prefix,
-           "create_readme",
-           (ossim_uint32)theWriteReadmeFlag,
-           true);
-   
-   kwl.add(prefix,
-           "create_tiff_world_file",
-           (ossim_uint32)theWriteTiffWorldFileFlag,
-           true);
-
-   kwl.add(prefix,
-           "create_world_file",
-           (ossim_uint32)theWriteWorldFileFlag,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CREATE_IMAGE_KW,
-           (ossim_uint32)theWriteImageFlag,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CREATE_OVERVIEW_KW,
-           (ossim_uint32)theWriteOverviewFlag,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CREATE_HISTOGRAM_KW,
-           (ossim_uint32)theWriteHistogramFlag,
-           true);
-
-   kwl.add(prefix,
-           SCALE_TO_EIGHT_BIT_KW,
-           (ossim_uint32)theScaleToEightBitFlag,
-           true);
-   kwl.add(prefix,
-           AUTO_CREATE_DIRECTORY_KW,
-           theAutoCreateDirectoryFlag,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::OVERVIEW_COMPRESSION_TYPE_KW,
-           theOverviewCompressType,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::OVERVIEW_COMPRESSION_QUALITY_KW,
-           theOverviewJpegCompressQuality,
-           true);
-
-   ossimImageTypeLut lut;
-   kwl.add(prefix,
-           ossimKeywordNames::IMAGE_TYPE_KW,
-           theOutputImageType,
-           true);
-
-   //---
-   // When "theLinearUnits" == "unknown" that is a key to the writer to just
-   // use whatever units makes sense for the projection.  Since "unknown"
-   // doesn't look good to the average user in a spec file, change to
-   // "default" if "unknown".  When read back in by the lookup table since
-   // "default" is not a valid "string" theLinearUnits will remain "unknown".
-   // Kind of a hack but it works:)  (drb)
-   //---
-   ossimString os = ossimUnitTypeLut::instance()->
-      getEntryString(theLinearUnits);
-   if (os == "unknown")
-   {
-      os = "default";  // Avoid saving as unknown for user readability.
-   }
-   kwl.add(prefix, "linear_units", os, true);
-
-   // Set the pixel type.
-   ossimString pixelType;
-   getPixelTypeString(pixelType);
-   kwl.add(prefix,
-           ossimKeywordNames::PIXEL_TYPE_KW,
-           pixelType.c_str(),
-           true);
-
-   return ossimSource::saveState(kwl, prefix);
-}
-
-bool ossimImageFileWriter::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   // Load the state of the base class.
-   bool result = ossimSource::loadState(kwl, prefix);
-
-   // Get the filename...
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   if(lookup)
-   {
-      ossimString filename = lookup;
-
-      lookup =  kwl.find(prefix, ossimKeywordNames::FILEPATH_KW);
-      if(lookup)
-      {
-         filename = ossimString(lookup) + filename;
-      }
-
-      setFilename(filename);
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
-   if(lookup)
-   {
-      if(ossimString(lookup).downcase().contains("area"))
-      {
-         thePixelType = OSSIM_PIXEL_IS_AREA;
-      }
-      else
-      {
-         thePixelType = OSSIM_PIXEL_IS_POINT;
-      }
-   }
-
-   lookup = kwl.find(prefix, "linear_units");
-   if(lookup)
-   {
-      ossimUnitType units = (ossimUnitType)ossimUnitTypeLut::instance()->
-         getEntryNumber(lookup, true);
-      if ( (units == OSSIM_METERS) ||
-           (units == OSSIM_FEET)   ||
-           (units == OSSIM_US_SURVEY_FEET) )
-      {
-         theLinearUnits = units;
-      }
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW);
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteExternalGeometryFlag = s.toBool();
-   }
-   
-   lookup = kwl.find(prefix, "create_envi_hdr");
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteEnviHeaderFlag = s.toBool();
-   }
-   
-   lookup = kwl.find(prefix, "create_ers_hdr");
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteErsHeaderFlag = s.toBool();
-   }
-
-   lookup = kwl.find(prefix, "create_fgdc");
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteFgdcFlag = s.toBool();
-   }
-   
-   lookup = kwl.find(prefix, "create_jpeg_world_file");
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteJpegWorldFileFlag = s.toBool();
-   }
-   
-   lookup = kwl.find(prefix, "create_readme");
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteReadmeFlag = s.toBool();
-   }
-   
-   lookup = kwl.find(prefix, "create_tiff_world_file");
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteTiffWorldFileFlag = s.toBool();
-   }
-
-   lookup = kwl.find(prefix, "create_world_file");
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteWorldFileFlag = s.toBool();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_IMAGE_KW);
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteImageFlag = s.toBool();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_OVERVIEW_KW);
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteOverviewFlag = s.toBool();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_HISTOGRAM_KW);
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theWriteHistogramFlag = s.toBool();
-   }
-
-   lookup = kwl.find(prefix, SCALE_TO_EIGHT_BIT_KW);
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theScaleToEightBitFlag = s.toBool();
-   }
-
-   lookup = kwl.find(prefix, AUTO_CREATE_DIRECTORY_KW);
-   if(lookup)
-   {
-      theAutoCreateDirectoryFlag = ossimString(lookup).toBool();
-   }
-   lookup = kwl.find(prefix, ossimKeywordNames::OVERVIEW_COMPRESSION_TYPE_KW);
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theOverviewCompressType = static_cast<ossim_uint16>(s.toUInt32());
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::OVERVIEW_COMPRESSION_QUALITY_KW);
-   if(lookup)
-   {
-      ossimString s = lookup;
-      theOverviewJpegCompressQuality = s.toInt32();
-   }
-
-   const char* outputImageType = kwl.find(prefix, ossimKeywordNames::IMAGE_TYPE_KW);
-   if(outputImageType)
-   {
-      theOutputImageType = outputImageType;
-   }
-
-   if(theInputObjectList.size() != 2)
-   {
-      theInputObjectList.resize(2);
-      theInputListIsFixedFlag = true;
-   }
-
-   theOutputListIsFixedFlag = false;
-
-   return result;
-}
-
-bool ossimImageFileWriter::writeOverviewFile(ossim_uint16 tiff_compress_type,
-                                             ossim_int32 jpeg_compress_quality, 
-                                             bool includeR0) 
-{
-   if(theFilename == "") return false;
-
-   // Get an image handler for the source file.
-   ossimRefPtr<ossimImageHandler> ih
-      = ossimImageHandlerRegistry::instance()->open(theFilename);
-
-   if (ih.valid() == false)
-   {
-      // Set the error...
-      return false;
-   }
-
-   ossimRefPtr<ossimTiffOverviewBuilder> ob = new ossimTiffOverviewBuilder();
-   
-   if ( ob->setInputSource(ih.get()) )
-   {
-      // Give the listener to the overview builder if set.
-      if (theProgressListener)
-      {
-         ob->addListener(theProgressListener);
-      }
-      
-      // Build a new file name for the overview.
-      ossimFilename overview_file = theFilename;
-      overview_file.setExtension(ossimString("ovr"));
-      ob->setCompressionType(tiff_compress_type);
-      ob->setJpegCompressionQuality(jpeg_compress_quality);
-      ob->setOutputFile(overview_file);
-      ob->setCopyAllFlag(includeR0);
-      ob->execute();
-
-      // Remove the listener from the overview builder.
-      if (theProgressListener)
-      {
-         ob->removeListener(theProgressListener);
-      }
-   }
-
-   return true;
-}
-
-bool ossimImageFileWriter::writeEnviHeaderFile() 
-{
-   if( (theFilename == "") || !theInputConnection ||
-       theAreaOfInterest.hasNans())
-   {
-      return false;
-   }
-
-   // Make the file name.
-   ossimFilename outputFile = theFilename;
-   outputFile.setExtension(ossimString("hdr"));
-
-   // Make the writer.
-   ossimRefPtr<ossimMetadataFileWriter> writer =
-      new ossimEnviHeaderFileWriter();
-   
-   // Set things up.
-   writer->connectMyInputTo(0, theInputConnection.get());
-   writer->initialize();
-   writer->setFilename(outputFile);
-   writer->setPixelType(thePixelType);
-   writer->setAreaOfInterest(theAreaOfInterest);
-   
-   // Write it to disk.
-   return writer->execute();
-}
-
-bool ossimImageFileWriter::writeErsHeaderFile() 
-{
-   if( (theFilename == "") || !theInputConnection ||
-       theAreaOfInterest.hasNans())
-   {
-      return false;
-   }
-   
-   // Make the file name.
-   ossimFilename outputFile = theFilename;
-   outputFile.setExtension(ossimString("ers"));
-
-   // Make the writer.
-   ossimRefPtr<ossimMetadataFileWriter> writer =
-	   new ossimERSFileWriter();
-   
-   // Set things up.
-   writer->connectMyInputTo(0, theInputConnection.get());
-   writer->initialize();
-   writer->setFilename(outputFile);
-   writer->setPixelType(thePixelType);
-   writer->setAreaOfInterest(theAreaOfInterest);
-   
-   // Write it to disk.
-   return writer->execute();
-}
-
-bool ossimImageFileWriter::writeExternalGeometryFile() 
-{
-   if( (theFilename == "") || !theInputConnection ||
-       theAreaOfInterest.hasNans())
-   {
-      return false;
-   }
-
-   // Make the file name.
-   ossimFilename geomFile = theFilename;
-   geomFile.setExtension(ossimString("geom"));
-
-   // Make the writer.
-   ossimRefPtr<ossimMetadataFileWriter> writer = new ossimGeomFileWriter();
-
-   // Set things up.
-//   writer->connectMyInputTo(0, theInputConnection.get());
-   writer->connectMyInputTo(0, theInputConnection.get());
-   writer->setFilename(geomFile);
-   writer->initialize();
-   writer->setPixelType(thePixelType);
-   writer->setAreaOfInterest(theAreaOfInterest);
-
-   // Write it to disk.
-   return writer->execute();
-}
-
-bool ossimImageFileWriter::writeFgdcFile() 
-{
-   if( (theFilename == "") || !theInputConnection ||
-       theAreaOfInterest.hasNans())
-   {
-      return false;
-   }
-
-   // Make the file name.
-   ossimFilename outputFile = theFilename;
-   outputFile.setExtension(ossimString("xml"));
-
-   // Make the writer.
-   ossimRefPtr<ossimMetadataFileWriter> writer = new ossimFgdcFileWriter();
-   
-   // Set things up.
-   writer->connectMyInputTo(0, theInputConnection.get());
-   writer->initialize();
-   writer->setFilename(outputFile);
-   writer->setPixelType(thePixelType);
-   writer->setAreaOfInterest(theAreaOfInterest);
-   
-   // Write it to disk.
-   return writer->execute();
-}
-
-bool ossimImageFileWriter::writeJpegWorldFile() 
-{
-   if(theFilename == "")
-   {
-      return false;
-   }
-   
-   // Make the file name.
-   ossimFilename file = theFilename;
-   file.setExtension(ossimString("jpw")); // jpw???
-
-   return writeWorldFile(file);
-}
-
-bool ossimImageFileWriter::writeReadmeFile() 
-{
-   if( (theFilename == "") || !theInputConnection ||
-       theAreaOfInterest.hasNans())
-   {
-      return false;
-   }
-
-   // Make the file name.
-   ossimFilename outputFile = theFilename.noExtension();
-   
-   outputFile += "_readme.txt";
-
-   // Make the writer.
-   ossimRefPtr<ossimMetadataFileWriter> writer =
-      new ossimReadmeFileWriter();
-   
-   // Set things up.
-   writer->connectMyInputTo(0, theInputConnection.get());
-   writer->initialize();
-   writer->setFilename(outputFile);
-   writer->setPixelType(thePixelType);
-   writer->setAreaOfInterest(theAreaOfInterest);
-   
-   // Write it to disk.
-   return writer->execute();
-}
-
-bool ossimImageFileWriter::writeTiffWorldFile() 
-{
-   if(theFilename == "")
-   {
-      return false;
-   }
-   
-   // Make the file name.
-   ossimFilename file = theFilename;
-   file.setExtension(ossimString("tfw"));
-
-   return writeWorldFile(file);
-}
-
-bool ossimImageFileWriter::writeMetaDataFiles() 
-{
-   bool status = true;
-   
-   if(theWriteEnviHeaderFlag&&!needsAborting())
-   {
-      if(writeEnviHeaderFile() == false)
-      {
-         status = false;
-
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of envi header file failed!" << endl;
-      }
-   }
-
-   if(theWriteErsHeaderFlag&&!needsAborting())
-   {
-      if(writeErsHeaderFile() == false)
-      {
-         status = false;
-
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of ers header file failed!" << endl;
-      }
-   }
-
-   if (theWriteExternalGeometryFlag&&!needsAborting())
-   {
-      if( writeExternalGeometryFile() == false)
-      {
-         status = false;
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of geometry file failed!" << endl;
-         }
-      }
-   }
-   if(theWriteFgdcFlag&&!needsAborting())
-   {
-      if(writeFgdcFile() == false)
-      {
-         status = false;
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of fgdc file failed!" << endl;
-         }
-      }
-   }
-   if(theWriteJpegWorldFileFlag&&!needsAborting())
-   {
-      if(writeJpegWorldFile() == false)
-      {
-         status = false;
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of jpeg world file failed!" << endl;
-         }
-      }
-   }
-   if(theWriteReadmeFlag&&!needsAborting())
-   {
-      if(writeReadmeFile() == false)
-      {
-         status = false;
-         
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of readme file failed!" << endl;
-         }
-      }
-   }
-   if(theWriteTiffWorldFileFlag&&!needsAborting())
-   {
-      if(writeTiffWorldFile() == false)
-      {
-         status = false;
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of tiff world file failed!" << endl;
-         }
-      }
-   }
-
-   if(theWriteWorldFileFlag&&!needsAborting())
-   {
-      if(writeWorldFile() == false)
-      {
-         status = false;
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of world file failed!" << endl;
-         }
-      }
-   }
-   
-   if (theWriteHistogramFlag&&!needsAborting())
-   {
-      if (!writeHistogramFile())
-      {
-         status = false;
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of histogram file failed!" << endl;
-         }
-      }
-   }
-
-   return status;
-}
-
-bool ossimImageFileWriter::writeHistogramFile() 
-{
-   if(needsAborting()) return false;
-   if(theFilename == "") return false;
-
-   ossimFilename histogram_file = theFilename;
-   histogram_file.setExtension(ossimString("his"));
-
-   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->
-      open(theFilename);
-
-   if (!handler)
-   {
-      return false;
-   }
-
-   ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
-
-   ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
-   histoSource->setMaxNumberOfRLevels(1); // Only compute for r0.
-   histoSource->connectMyInputTo(0, handler.get());
-   histoSource->enableSource();
-   writer->connectMyInputTo(0, histoSource.get());
-   writer->setFilename(histogram_file);
-   writer->addListener(&theStdOutProgress);
-   writer->execute();
-   writer->disconnect();
-   histoSource->disconnect();
-   handler->disconnect();
-   writer = 0; histoSource = 0; handler = 0;
-   return true;
-}
-
-void ossimImageFileWriter::disconnectInputEvent(ossimConnectionEvent& /* event */)
-{
-   if(!getInput(0))
-   {
-      theInputConnection->disconnectMyInput((ossim_int32)0, false);
-   }
-   theViewController = PTR_CAST(ossimViewController, getInput(1));
-
-   initialize();
-}
-
-void ossimImageFileWriter::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-   theInputConnection->connectMyInputTo((ossim_int32)0,
-                                        getInput(0),
-                                        false);
-   theViewController = PTR_CAST(ossimViewController, getInput(1));
-   initialize();
-}
-
-void ossimImageFileWriter::propertyEvent(ossimPropertyEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimImageFileWriter::setOutputImageType(const ossimString& type)
-{
-   theOutputImageType = type;
-}
-
-void ossimImageFileWriter::setOutputImageType(ossim_int32 type)
-{
-   ossimImageTypeLut lut;
-   theOutputImageType = lut.getEntryString(type);
-}
-
-ossimString ossimImageFileWriter::getOutputImageTypeString() const
-{
-   return theOutputImageType;
-
-}
-
-ossim_int32 ossimImageFileWriter::getOutputImageType() const
-{
-   ossimImageTypeLut lut;
-   return lut.getEntryNumber(theOutputImageType);
-}
-
-
-bool ossimImageFileWriter::getWriteImageFlag() const
-{
-   return theWriteImageFlag;
-}
-
-bool ossimImageFileWriter::getWriteHistogramFlag() const
-{
-   return theWriteHistogramFlag;
-}
-
-bool ossimImageFileWriter::getWriteOverviewFlag() const
-{
-   return theWriteOverviewFlag;
-}
-
-bool ossimImageFileWriter::getScaleToEightBitFlag() const
-{
-   return theScaleToEightBitFlag;
-}
-
-bool ossimImageFileWriter::getWriteEnviHeaderFlag() const
-{
-   return theWriteEnviHeaderFlag;
-}
-
-bool ossimImageFileWriter::getWriteErsHeaderFlag() const
-{
-   return theWriteErsHeaderFlag;
-}
-
-bool ossimImageFileWriter::getWriteExternalGeometryFlag() const
-{
-   return theWriteExternalGeometryFlag;
-}
-
-bool ossimImageFileWriter::getWriteFgdcFlag() const
-{
-   return theWriteFgdcFlag;
-}
-
-bool ossimImageFileWriter::getWriteJpegWorldFileFlag() const
-{
-   return theWriteJpegWorldFileFlag;
-}
-
-bool ossimImageFileWriter::getWriteReadmeFlag() const
-{
-   return theWriteReadmeFlag;
-}
-
-bool ossimImageFileWriter::getWriteTiffWorldFileFlag() const
-{
-   return theWriteTiffWorldFileFlag;
-}
-
-bool ossimImageFileWriter::getWriteWorldFileFlag() const
-{
-   return theWriteWorldFileFlag;
-}
-
-void ossimImageFileWriter::setWriteOverviewFlag(bool flag)
-{
-   theWriteOverviewFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteImageFlag(bool flag)
-{
-   theWriteImageFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteHistogramFlag(bool flag)
-{
-   theWriteHistogramFlag = flag;
-}
-
-void ossimImageFileWriter::setScaleToEightBitFlag(bool flag)
-{
-   theScaleToEightBitFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteEnviHeaderFlag(bool flag)
-{
-   theWriteEnviHeaderFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteErsHeaderFlag(bool flag)
-{
-   theWriteErsHeaderFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteExternalGeometryFlag(bool flag)
-{
-   theWriteExternalGeometryFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteFgdcFlag(bool flag)
-{
-   theWriteFgdcFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteJpegWorldFile(bool flag)
-{
-   theWriteJpegWorldFileFlag  = flag;
-}
-
-void ossimImageFileWriter::setWriteReadme(bool flag)
-{
-   theWriteReadmeFlag = flag;
-}
-
-void ossimImageFileWriter::setWriteTiffWorldFile(bool flag)
-{
-   theWriteTiffWorldFileFlag  = flag;
-}
-
-void ossimImageFileWriter::setWriteWorldFile(bool flag)
-{
-   theWriteWorldFileFlag  = flag;
-}
-
-ossimObject* ossimImageFileWriter::getObject()
-{
-   return this;
-}
-
-const ossimObject* ossimImageFileWriter::getObject() const
-{
-   return this;
-}
-
-void ossimImageFileWriter::setAreaOfInterest(const ossimIrect& inputRect)
-{
-   // This sets "theAreaOfInterest".
-   ossimImageWriter::setAreaOfInterest(inputRect);
-   
-   if( theInputConnection.valid() )
-   {
-      //---
-      // ossimImageSourceSequencer::setAreaOfInterest does more than just set the
-      // variable, so only call if out of sync to avoid wasted cycles.
-      //--- 
-      if ( theAreaOfInterest != theInputConnection->getBoundingRect() )
-      {
-         // Set the sequencer area of interest.
-         theInputConnection->setAreaOfInterest(inputRect);
-      }
-   }
-}
-
-ossimImageSourceSequencer* ossimImageFileWriter::getSequencer()
-{
-   return theInputConnection.get();
-}
-
-bool ossimImageFileWriter::execute()
-{
-   static const char MODULE[] = "ossimImageFileWriter::execute";
-   
-   if (!theInputConnection) // Must have a sequencer...
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG:\ntheInputConnection is NULL!" << endl;
-      }
-      return false;
-   }
-   
-   if (theFilename == "") // Must have a filename...
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG:\ntheFilename is empty!" << endl;
-      }
-      return false;
-   }
-   
-   
-   // make sure we have a region of interest
-   if(theAreaOfInterest.hasNans())
-   {
-      theInputConnection->initialize();
-      theAreaOfInterest = theInputConnection->getAreaOfInterest();
-   }
-   else
-   {
-      theInputConnection->setAreaOfInterest(theAreaOfInterest);
-   }
-
-   if(theAreaOfInterest.hasNans()) // Must have an area of interest...
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " ERROR:  Area of interest has nans!"
-            << "Area of interest:  "
-            << theAreaOfInterest
-            << "\nReturning..." << endl;
-      }
-
-      return false;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG:\n"
-         << "Area of interest:  " << theAreaOfInterest << endl;
-   }
-   
-   ossimRefPtr<ossimImageSource> savedInput;
-   if (theScaleToEightBitFlag)
-   {
-      if(theInputConnection->getOutputScalarType() != OSSIM_UINT8)
-      {
-         savedInput = new ossimScalarRemapper;
-         
-         savedInput->connectMyInputTo(0, theInputConnection->getInput(0));
-         theInputConnection->connectMyInputTo(0, savedInput.get());
-         theInputConnection->initialize();
-      }
-   }
-
-   ossimFilename path = theFilename.path();
-   if (!path.empty() && !path.exists() )
-   {
-      path.createDirectory(true);
-   }
-   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
-   //setPercentComplete(0.0); let writeFile set the precent complete
-   bool wroteFile = true;
-   bool result    = true;
-   if (theWriteImageFlag)
-   {
-      wroteFile = writeFile();
-   }
-  
-   /*
-   if(needsAborting())
-   {
-      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_ABORTED);
-   }
-   else
-   {
-      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
-   }
-   */
-   if (theWriteOverviewFlag&&!needsAborting())
-   {
-      // Writing overviews has been mpi'd so do on all processes.
-      if (!writeOverviewFile(theOverviewCompressType,
-                             theOverviewJpegCompressQuality))
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "Write of overview file failed!" << endl;
-         }
-      }
-   }
-
-   if(!needsAborting())
-   {
-      // Do these only on the master process. Note left to right precedence!
-      if (getSequencer() && getSequencer()->isMaster())
-      {
-         if (wroteFile)
-         {
-            if (writeMetaDataFiles() == false)
-            {
-               if(traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_WARN)
-                  << "Write of metadata file failed!" << endl;
-               }
-               result = false;
-            }
-         }
-         
-      } // End of "if (getSequencer() && getSequencer()->isMaster()))
-   }
-
-   if(savedInput.valid())
-   {
-      ossimConnectableObject* obj = theInputConnection->getInput(0);
-      if(obj)
-      {
-         theInputConnection->connectMyInputTo(0, obj->getInput(0));
-      }
-   }
-   if(!needsAborting())
-   {
-      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
-   }
-   else 
-   {
-      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_ABORTED);   
-   }
-
-   savedInput = 0;
-   return result;
-}
-
-bool ossimImageFileWriter::writeStream()
-{
-   //---
-   // Not implemented in this class. Derived classed should implement if
-   // they can write to a stream.
-   //--- 
-   return false;
-}
-
-ossimRefPtr<ossimOStream> ossimImageFileWriter::getOutputStream() const
-{
-   //---
-   // Not implemented in this class. Derived classed should implement if
-   // they can write to a stream.
-   //--- 
-   return ossimRefPtr<ossimOStream>();  
-}
-
-bool ossimImageFileWriter::setOutputStream(
-   ossimRefPtr<ossimOStream> /* stream */ )
-{
-   //---
-   // Not implemented in this class. Derived classed should implement if
-   // they can write to a stream.
-   //---
-   return false;
-}
-
-bool ossimImageFileWriter::setOutputStream(std::ostream& /* str */)
-{
-   //---
-   // Not implemented in this class. Derived classed should implement if
-   // they can write to a stream.
-   //---
-   return false;
-}
-
-
-void ossimImageFileWriter::setPercentComplete(double percentComplete)
-{
-   ossimProcessInterface::setPercentComplete(percentComplete);
-   ossimProcessProgressEvent event(this, percentComplete);
-   fireEvent(event);
-}
-
-void ossimImageFileWriter::setOutputName(const ossimString& outputName)
-{
-   ossimImageWriter::setOutputName(outputName);
-   setFilename(ossimFilename(outputName));
-}
-
-void ossimImageFileWriter::setFilename(const ossimFilename& file)
-{
-   theFilename = file;
-}
-
-const ossimFilename& ossimImageFileWriter::getFilename()const
-{
-   return theFilename;
-}
-
-bool ossimImageFileWriter::canConnectMyInputTo(ossim_int32 inputIndex,
-                                               const ossimConnectableObject* object)const
-{
-   return (object&&
-           ( (PTR_CAST(ossimImageSource, object)&&inputIndex == 0)||
-             (PTR_CAST(ossimViewController, object)&&inputIndex == 1)) );
-}
-
-ossim_uint16 ossimImageFileWriter::getOverviewCompressType() const
-{
-   return theOverviewCompressType;
-}
-
-ossim_int32  ossimImageFileWriter::getOverviewJpegCompressQuality() const
-{
-   return theOverviewJpegCompressQuality;
-}
-
-void ossimImageFileWriter::setOverviewCompressType(ossim_uint16 type)
-{
-   theOverviewCompressType = type;
-}
-
-void ossimImageFileWriter::setOverviewJpegCompressQuality(ossim_int32 quality)
-{
-   theOverviewJpegCompressQuality = quality;
-}
-
-void ossimImageFileWriter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-   
-   if(property->getName() == ossimKeywordNames::FILENAME_KW)
-   {
-      theFilename = property->valueToString();
-   }
-   else if (property->getName() == "create_envi_hdr")
-   {
-      theWriteEnviHeaderFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == "create_ers_hdr")
-   {
-      theWriteErsHeaderFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() ==
-            ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW)
-   {
-      theWriteExternalGeometryFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == "create_fgdc")
-   {
-      theWriteFgdcFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == "create_jpeg_world_file")
-   {
-      theWriteJpegWorldFileFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == "create_readme")
-   {
-      theWriteReadmeFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == "create_tiff_world_file")
-   {
-      theWriteTiffWorldFileFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == "create_world_file")
-   {
-      theWriteWorldFileFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == ossimKeywordNames::CREATE_IMAGE_KW)
-   {
-      theWriteImageFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == ossimKeywordNames::CREATE_OVERVIEW_KW)
-   {
-      theWriteOverviewFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == ossimKeywordNames::CREATE_HISTOGRAM_KW)
-   {
-      theWriteHistogramFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == SCALE_TO_EIGHT_BIT_KW)
-   {
-      theScaleToEightBitFlag = property->valueToString().toBool();
-   }
-   else if(property->getName() == AUTO_CREATE_DIRECTORY_KW)
-   {
-      theAutoCreateDirectoryFlag = property->valueToString().toBool();
-   }
-   else if (property->getName() == "linear_units")
-   {
-      theLinearUnits = (ossimUnitType)
-         (ossimUnitTypeLut::instance()->
-          getEntryNumber(property->valueToString()));
-   }
-   else if(property->getName() == ossimKeywordNames::IMAGE_TYPE_KW)
-   {
-      setOutputImageType(property->valueToString());
-   }
-   else if(property->getName() == ossimKeywordNames::PIXEL_TYPE_KW)
-   {
-      ossimStringProperty* stringProperty = PTR_CAST(ossimStringProperty,
-                                                     property.get());
-      if (stringProperty)
-      {
-         ossimString s;
-         stringProperty->valueToString(s);
-         setPixelType(s);
-      }
-   }
-   else
-   {
-      ossimImageWriter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimImageFileWriter::getProperty(const ossimString& name)const
-{
-   if(name == ossimKeywordNames::FILENAME_KW)
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, theFilename);
-
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_OUTPUT);
-
-      return filenameProp;
-   }
-   else if(name == ossimKeywordNames::IMAGE_TYPE_KW)
-   {
-      ossimStringProperty* prop =  new ossimStringProperty(name, theOutputImageType, false);
-      std::vector<ossimString> typeList;
-      getImageTypeList(typeList);
-      if(typeList.size() > 1)
-      {
-         prop->setReadOnlyFlag(false);
-         prop->setConstraints(typeList);
-         prop->setChangeType(ossimProperty::ossimPropertyChangeType_AFFECTS_OTHERS);
-      }
-      else
-      {
-         prop->setReadOnlyFlag(true);
-      }
-      return prop;
-   }
-   else if(name == AUTO_CREATE_DIRECTORY_KW)
-   {
-      return new ossimBooleanProperty(name, theAutoCreateDirectoryFlag);
-   }
-   else if (name == "create_envi_hdr")
-   {
-      return new ossimBooleanProperty(name, theWriteEnviHeaderFlag);
-   }
-   else if (name == "create_ers_hdr")
-   {
-      return new ossimBooleanProperty(name, theWriteErsHeaderFlag);
-   }
-   else if (name == ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW)
-   {
-      return new ossimBooleanProperty(name, theWriteExternalGeometryFlag);
-   }
-   else if (name == "create_fgdc")
-   {
-      return new ossimBooleanProperty(name, theWriteFgdcFlag);
-   }
-   else if (name == "create_jpeg_world_file")
-   {
-      return new ossimBooleanProperty(name, theWriteJpegWorldFileFlag);
-   }
-   else if (name == "create_readme")
-   {
-      return new ossimBooleanProperty(name, theWriteReadmeFlag);
-   }
-   else if (name == "create_tiff_world_file")
-   {
-      return new ossimBooleanProperty(name, theWriteTiffWorldFileFlag);
-   }
-   else if (name == "create_world_file")
-   {
-      return new ossimBooleanProperty(name, theWriteWorldFileFlag);
-   }
-   else if (name == ossimKeywordNames::CREATE_IMAGE_KW)
-   {
-      return new ossimBooleanProperty(name, theWriteImageFlag);
-   }
-   else if (name == ossimKeywordNames::CREATE_OVERVIEW_KW)
-   {
-      return new ossimBooleanProperty(name, theWriteOverviewFlag);
-   }
-   else if (name == ossimKeywordNames::CREATE_HISTOGRAM_KW)
-   {
-      return new ossimBooleanProperty(name, theWriteHistogramFlag);
-   }
-   else if (name == SCALE_TO_EIGHT_BIT_KW)
-   {
-      return new ossimBooleanProperty(name, theScaleToEightBitFlag);
-   }
-   else if (name == "linear_units")
-   {
-      // property value
-      ossimString value = ossimUnitTypeLut::instance()->
-         getEntryString(theLinearUnits);
-      
-      //---
-      // theLinearUnits is set to unknown as a default.  This keys the
-      // writer to use whatever makes sense for the given output.
-      // Since "unknown" is a bad name to present to users, we will
-      // use "default" if theLinearUnits is == "unknown".
-      //---
-      if (value == "unknown")
-      {
-         value = "default";
-      }
-      
-      // constraint list
-      vector<ossimString> constraintList;
-      constraintList.push_back(ossimString("default"));
-      constraintList.push_back(ossimString("meters"));
-      constraintList.push_back(ossimString("feet"));
-      constraintList.push_back(ossimString("us_survey_feet"));
-      
-      return new ossimStringProperty(name,
-                                     value,
-                                     false, // not editable
-                                     constraintList);
-   }
-   else if (name == ossimKeywordNames::PIXEL_TYPE_KW)
-   {
-      ossimString value;
-      getPixelTypeString(value);
-      ossimStringProperty* stringProp =
-         new ossimStringProperty(name,
-                                 value,
-                                 false); // editable flag
-      stringProp->addConstraint(ossimString("point"));
-      stringProp->addConstraint(ossimString("area"));
-      return stringProp;
-   }
-
-   return ossimImageWriter::getProperty(name);
-}
-
-void ossimImageFileWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageWriter::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(ossimString(ossimKeywordNames::FILENAME_KW));
-   propertyNames.push_back(ossimString("create_envi_hdr"));  
-   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW));
-   propertyNames.push_back(ossimString("create_fgdc"));
-   propertyNames.push_back(ossimString("create_jpeg_world_file"));
-   propertyNames.push_back(ossimString("create_readme"));
-   propertyNames.push_back(ossimString("create_tiff_world_file"));
-   propertyNames.push_back(ossimString("create_world_file"));   
-   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_IMAGE_KW));
-   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_OVERVIEW_KW));
-   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_HISTOGRAM_KW));
-   propertyNames.push_back(ossimString(AUTO_CREATE_DIRECTORY_KW));
-   propertyNames.push_back(ossimString(SCALE_TO_EIGHT_BIT_KW));
-   propertyNames.push_back(ossimString("linear_units"));
-   propertyNames.push_back(ossimString(ossimKeywordNames::PIXEL_TYPE_KW));
-   propertyNames.push_back(ossimString(ossimKeywordNames::IMAGE_TYPE_KW));
-
-}
-
-ossimString ossimImageFileWriter::getExtension() const
-{
-   // default unknown file extension
-   return ossimString("ext");
-}
-
-bool ossimImageFileWriter::getOutputHasInternalOverviews( void ) const
-{
-   // default value: don't assume internal overviews will
-   // be generated by image writers.
-   return false;
-}
-
-bool ossimImageFileWriter::hasImageType(const ossimString& imageType) const
-{
-   std::vector<ossimString> imageTypeList;
-   getImageTypeList(imageTypeList);
-
-   std::vector<ossimString>::const_iterator i = imageTypeList.begin();
-
-   while (i != imageTypeList.end())
-   {
-      if ( (*i) == imageType )
-      {
-         return true;
-      }
-      ++i;
-   }
-
-   return false; // not found...
-}
-
-bool ossimImageFileWriter::addListener(ossimListener* listener)
-{
-   theProgressListener = listener;
-   return ossimImageWriter::addListener(listener);
-}
-
-bool ossimImageFileWriter::removeListener(ossimListener* listener)
-{
-   if (listener == theProgressListener)
-   {
-      theProgressListener = NULL;
-   }
-   return ossimImageWriter::removeListener(listener);
-}
-
-void ossimImageFileWriter::setPixelType(ossimPixelType type)
-{
-   thePixelType = type;
-}
-
-void ossimImageFileWriter::setPixelType(const ossimString& type)
-{
-   ossimString s = type;
-   s.downcase();
-   if (s == "point")
-   {
-      setPixelType(OSSIM_PIXEL_IS_POINT);
-   }
-   else if (s == "area")
-   {
-      setPixelType(OSSIM_PIXEL_IS_AREA);
-   }
-}
-
-ossimPixelType ossimImageFileWriter::getPixelType() const
-{
-   return thePixelType;
-}
-
-void ossimImageFileWriter::getPixelTypeString(ossimString& type) const
-{
-   if (thePixelType == OSSIM_PIXEL_IS_POINT)
-   {
-      type = "point";
-   }
-   else
-   {
-      type = "area";
-   }
-}
-
-void ossimImageFileWriter::setTileSize(const ossimIpt& tileSize)
-{
-   if (theInputConnection.valid())
-   {
-      theInputConnection->setTileSize(tileSize);
-   }
-}
-
-bool ossimImageFileWriter::writeWorldFile() 
-{
-   bool result = false;
-   
-   if( theFilename.size() )
-   {
-      // Make the file name.
-      ossimFilename file = theFilename;
-      ossimString ext = file.ext().downcase();
-      
-      ossimString wfExt = ""; // World file extension.
-      
-      if ( ( ext == "tif" ) || ( ext == "tiff" ) )
-      {
-         wfExt = "tfw";
-      }
-      else if ( ( ext == "jpg" ) || ( ext == "jpeg" ) )
-      {
-         wfExt = "jpw";
-      }
-      else if ( ext == "png" )
-      {
-         wfExt = "pgw";
-      }
-      else if ( ext == "sid" )
-      {
-         wfExt = "sdw";
-      }
-      
-      if ( ext.size() )
-      {
-         file.setExtension(wfExt);
-         
-         result = writeWorldFile(file);
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Could not derive world file extension for: " << theFilename << "\n"; 
-      }
-   }
-   
-   if ( !result )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Write of world file failed!\n";
-   }   
-   
-   return result;
-}
-
-bool ossimImageFileWriter::writeWorldFile(const ossimFilename& file) 
-{
-   if( !theInputConnection || theAreaOfInterest.hasNans())
-   {
-      return false;
-   }
-
-   // Make the writer.
-   ossimRefPtr<ossimWorldFileWriter> writer = new ossimWorldFileWriter();
-   
-   // Set things up.
-   writer->connectMyInputTo(0, theInputConnection.get());
-   writer->initialize();
-   writer->setFilename(file);
-   writer->setAreaOfInterest(theAreaOfInterest);
-   writer->setLinearUnits(theLinearUnits);
-   writer->setPixelType(thePixelType);
-   
-   // Write it to disk.
-   return writer->execute(); 
-}
diff --git a/ossim/src/ossim/imaging/ossimImageGaussianFilter.cpp b/ossim/src/ossim/imaging/ossimImageGaussianFilter.cpp
deleted file mode 100644
index 5e2b0fd..0000000
--- a/ossim/src/ossim/imaging/ossimImageGaussianFilter.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-//*******************************************************************
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// class ossimImageGaussianFilter : tile source
-//*******************************************************************
-// $Id: ossimImageGaussianFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageGaussianFilter.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <cmath>
-
-RTTI_DEF1(ossimImageGaussianFilter, "ossimImageGaussianFilter", ossimImageSourceFilter);
-
-/** 
- * property names
- */
-static const char* PROPERTYNAME_GAUSSSTD     = "GaussStd";
-static const char* PROPERTYNAME_STRICTNODATA = "StrictNoData";
-
-ossimImageGaussianFilter::ossimImageGaussianFilter()
-   : ossimImageSourceFilter(),
-     theGaussStd(0.5),
-     theStrictNoData(true)
-{
-   // ingredients: 
-   // 2x  ConvolutionFilter1D
-   theHF=new ossimConvolutionFilter1D();
-   theVF=new ossimConvolutionFilter1D();
-
-   theHF->setIsHorizontal(true);
-   theVF->setIsHorizontal(false);
-   updateKernels();
-
-   theHF->setStrictNoData(theStrictNoData);
-   theVF->setStrictNoData(theStrictNoData);
-
-   //tie them up
-   theVF->connectMyInputTo(0,theHF.get());
-}
-
-ossimImageGaussianFilter::~ossimImageGaussianFilter()
-{
-   if(theHF.valid())
-   {
-      theHF->disconnect();
-      theHF = 0;
-   }
-   if(theVF.valid())
-   {
-      theVF->disconnect();
-      theVF = 0;
-   }
-}
-
-void ossimImageGaussianFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-
-   if (property->getName() == PROPERTYNAME_GAUSSSTD) {
-      ossimNumericProperty* sProperty = PTR_CAST(ossimNumericProperty,
-                                                     property.get());
-      if(sProperty)
-      {
-         setGaussStd(sProperty->asFloat64());
-      }
-   } else if (property->getName() == PROPERTYNAME_STRICTNODATA) {
-      ossimBooleanProperty* booleanProperty = PTR_CAST(ossimBooleanProperty,
-                                                     property.get());
-      if(booleanProperty)
-      {
-         setStrictNoData(booleanProperty->getBoolean());
-      }
-   } else {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimImageGaussianFilter::getProperty(const ossimString& name)const
-{
-   if (name == PROPERTYNAME_GAUSSSTD) {
-      ossimNumericProperty* property = new ossimNumericProperty(name,ossimString::toString(getGaussStd()),1e-13,100.0);
-      property->setCacheRefreshBit();
-      return property;
-   } else if (name == PROPERTYNAME_STRICTNODATA) {
-      ossimBooleanProperty* property = new ossimBooleanProperty(name,isStrictNoData());
-      property->setCacheRefreshBit();
-      return property;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimImageGaussianFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back(PROPERTYNAME_GAUSSSTD);
-   propertyNames.push_back(PROPERTYNAME_STRICTNODATA);
-}
-
-bool ossimImageGaussianFilter::saveState(ossimKeywordlist& kwl,
-                                          const char* prefix)const
-{   
-   kwl.add(prefix,
-           PROPERTYNAME_GAUSSSTD,
-           theGaussStd,
-           true);
-   kwl.add(prefix,
-           PROPERTYNAME_STRICTNODATA,
-           isStrictNoData()?"true":"false", //use string instead of boolean
-           true);
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-
-bool ossimImageGaussianFilter::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   const char* gs = kwl.find(prefix, PROPERTYNAME_GAUSSSTD);
-   if(gs)
-   {      
-      setGaussStd(ossimString(gs).toDouble());
-   } else {
-      cerr<<"ossimImageGaussianFilter : warning no "<< PROPERTYNAME_GAUSSSTD<<" in loadState"<<endl;
-   }
-   const char* sn = kwl.find(prefix, PROPERTYNAME_STRICTNODATA);
-   if(sn)
-   {      
-      setStrictNoData(ossimString(sn).toBool());
-   } else {
-      cerr<<"ossimConvolutionFilter1D : warning no "<<PROPERTYNAME_STRICTNODATA<<" in state"<<endl;
-   }
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-void ossimImageGaussianFilter::setGaussStd(const ossim_float64& v)
-{
-   theGaussStd = v;
-   updateKernels();
-}
-
-void ossimImageGaussianFilter::setStrictNoData(bool aStrict)
-{
-   theStrictNoData = aStrict;
-   theHF->setStrictNoData(aStrict);
-   theVF->setStrictNoData(aStrict);
-}
-
-void
-ossimImageGaussianFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   initializeProcesses();
-}
-
-ossimRefPtr<ossimImageData>
-ossimImageGaussianFilter::getTile(const ossimIrect &tileRect,ossim_uint32 resLevel)
-{
-    if(isSourceEnabled())
-    {
-       return theVF->getTile(tileRect, resLevel);
-    }
-    if(theInputConnection)
-    {
-       return theInputConnection->getTile(tileRect, resLevel);
-    }
-
-    return 0;
-}
-
-void
-ossimImageGaussianFilter::initializeProcesses()
-{
-   theHF->initialize();
-   theVF->initialize();
-}
-
-void
-ossimImageGaussianFilter::connectInputEvent(ossimConnectionEvent &event)
-{
-    ossimImageSourceFilter::connectInputEvent(event);
-    if(getInput())
-    {
-       theHF->connectMyInputTo(0, getInput());
-       initializeProcesses();
-    }
-    else
-    {
-       theHF->disconnectMyInput(0, false, false);
-       initializeProcesses();
-    }
-}
-
-void
-ossimImageGaussianFilter::disconnectInputEvent(ossimConnectionEvent &event)
-{
-    ossimImageSourceFilter::disconnectInputEvent(event);
-    if(getInput())
-    {
-       theHF->connectMyInputTo(0, getInput());
-       initializeProcesses();
-    }
-    else
-    {
-       theHF->disconnectMyInput(0, false, false);
-       initializeProcesses();
-    }
-}
-void
-ossimImageGaussianFilter::updateKernels()
-{
-   //update kernels based on GaussStd value :2.5 sigma on each side
-   // symetric kernel
-   static const ossim_float64 sigmaN = 2.5;
-   ossim_float64 sig22   = getGaussStd()*getGaussStd()*2.0;
-
-   ossim_uint32 halfw   = (ossim_uint32)(std::floor(getGaussStd() * sigmaN + 0.5));
-   ossim_uint32 supsize = 2*halfw + 1;
-
-   //fill with sym. gaussian (unnormalized)
-   vector<ossim_float64> newk(supsize);
-   ossim_float64 sum=1.0;
-   ossim_float64 v;
-   newk[halfw] = 1.0;
-   for(ossim_int32 i=(ossim_int32)halfw; i>0 ;--i) //reverse for summing
-   {
-      newk[halfw + i] = newk[halfw - i] = v = std::exp(-i*i/sig22);
-      sum += 2.0 * v;
-   }
-
-   //normalize
-   ossim_float64   invsum=1.0/sum;
-   for(ossim_uint32 i=0; i<supsize ;++i)
-   {
-      newk[i] *= invsum;
-   }
-
-   //send to 1d conv filters
-   theHF->setKernel(newk);
-   theVF->setKernel(newk);
-   theHF->setCenterOffset(halfw);
-   theVF->setCenterOffset(halfw);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageGeometry.cpp b/ossim/src/ossim/imaging/ossimImageGeometry.cpp
deleted file mode 100644
index 30166ef..0000000
--- a/ossim/src/ossim/imaging/ossimImageGeometry.cpp
+++ /dev/null
@@ -1,1750 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description: Class implementation of ossimImageGeometry. See .h file for class documentation.
-//
-//**************************************************************************************************
-// $Id$
-
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossim2dTo2dTransformRegistry.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <cmath>
-
-RTTI_DEF1(ossimImageGeometry, "ossimImageGeometry", ossimObject);
-
-//**************************************************************************************************
-// Default constructor defaults to unity transform with no projection  
-//**************************************************************************************************
-ossimImageGeometry::ossimImageGeometry()
-:   
-m_transform (0),
-m_projection(0),
-m_decimationFactors(0),
-m_imageSize(),
-m_targetRrds(0)
-{
-   m_imageSize.makeNan();
-}
-
-//**************************************************************************************************
-// Copy constructor -- performs a deep copy. This is needed when an imageSource in the chain
-// needs to modify the image geometry at that point in the chain. The image geometry to the left
-// of that imageSource must remain unchanged. This constructor permits that imageSource to 
-// maintain its own geometry based on the input geometry. All objects in the chain and to the right
-// would see this alternate geometry. See ossimScaleFilter for an example of this case.
-//**************************************************************************************************
-ossimImageGeometry::ossimImageGeometry(const ossimImageGeometry& copy_this)
-:
-ossimObject(copy_this),
-m_transform(copy_this.m_transform.valid()?(ossim2dTo2dTransform*)copy_this.m_transform->dup():((ossim2dTo2dTransform*)0)),
-m_projection(copy_this.m_projection.valid()?(ossimProjection*)copy_this.m_projection->dup():(ossimProjection*)0),
-m_decimationFactors(copy_this.m_decimationFactors),
-m_imageSize(copy_this.m_imageSize),
-m_targetRrds(copy_this.m_targetRrds)
-{
-}
-
-//**************************************************************************************************
-//! Constructs with projection and transform objects available for referencing. Either pointer
-//! can be NULL -- the associated mapping would be identity.
-//**************************************************************************************************
-ossimImageGeometry::ossimImageGeometry(ossim2dTo2dTransform* transform, ossimProjection* proj)
-:
-ossimObject(),
-m_transform(transform),
-m_projection(proj),
-m_decimationFactors(0),
-m_imageSize(),
-m_targetRrds(0)   
-{
-   m_imageSize.makeNan();
-}
-
-//**************************************************************************************************
-// Destructor is hidden. Only accessible via ossimRefPtr centrally managed
-//**************************************************************************************************
-ossimImageGeometry::~ossimImageGeometry()
-{
-   // Nothing to do
-}
-
-void ossimImageGeometry::rnToRn(const ossimDpt& inRnPt, ossim_uint32 inResolutionLevel,
-                                ossim_uint32 outResolutionLevel, ossimDpt& outRnPt) const
-{
-   if (inResolutionLevel != outResolutionLevel)
-   {
-      // Back out the decimation.
-      ossimDpt pt;
-      undecimatePoint(inRnPt, inResolutionLevel, pt);
-
-      // Decimate to new level.
-      decimatePoint(pt, outResolutionLevel, outRnPt);
-   }
-   else
-   {
-      outRnPt = inRnPt; // No transform required.
-   }
-}
-
-void ossimImageGeometry::rnToFull(const ossimDpt& rnPt,
-                                  ossim_uint32 resolutionLevel,
-                                  ossimDpt& fullPt) const
-{
-   // Back out the decimation.
-   ossimDpt localPt;
-   undecimatePoint(rnPt, resolutionLevel, localPt);
-
-   // Remove any shift/rotation.
-   if ( m_transform.valid() && !localPt.hasNans() )
-   {
-      m_transform->forward(localPt, fullPt);
-   }
-   else
-   {
-      fullPt = localPt; // No transform (shift/rotation)
-   }
-}
-
-void ossimImageGeometry::fullToRn(const ossimDpt& fullPt,
-                                  ossim_uint32 resolutionLevel,
-                                  ossimDpt& rnPt) const
-{
-   // Apply shift/rotation.
-   ossimDpt localPt;
-   if (m_transform.valid())
-   {
-      m_transform->inverse(fullPt, localPt);
-   }
-   else
-   {
-      localPt = fullPt; // No transform (shift/rotation)
-   }
-
-   // Apply the decimation.
-   decimatePoint(localPt, resolutionLevel, rnPt);
-}
-
-void ossimImageGeometry::rnToWorld(const ossimDpt& rnPt,
-                                   ossim_uint32 resolutionLevel,
-                                   ossimGpt& wpt) const
-{
-   ossimDpt localPt;
-   rnToRn(rnPt, resolutionLevel, m_targetRrds, localPt);
-   localToWorld(localPt, wpt);
-}
-
-void ossimImageGeometry::worldToRn(const ossimGpt& wpt,
-                                   ossim_uint32 resolutionLevel,
-                                   ossimDpt& rnPt) const
-{   
-   ossimDpt localPt;
-   worldToLocal(wpt, localPt);
-   rnToRn(localPt, m_targetRrds, resolutionLevel, rnPt);
-}
-
-//**************************************************************************************************
-//! Exposes the 3D projection from image to world coordinates. The caller should verify that
-//! a valid projection exists before calling this method. Returns TRUE if a valid ground point
-//! is available in the ground_pt argument. This method depends on the existence of elevation
-//! information. If no DEM is available, the results will be incorrect or inaccurate.
-//**************************************************************************************************
-bool ossimImageGeometry::localToWorld(const ossimDpt& local_pt, ossimGpt& world_pt) const
-{
-   //! Return a NAN point of no projection is defined:
-   if (!m_projection.valid())
-   {
-      world_pt.makeNan();
-      return false;
-   }
-
-   // First transform local pixel to full-image pixel:
-   ossimDpt full_image_pt;
-   rnToFull(local_pt, m_targetRrds, full_image_pt);
-
-   // Perform projection to world coordinates:
-   m_projection->lineSampleToWorld(full_image_pt, world_pt);
-
-    // Put longitude between -180 and +180 and latitude between -90 and +90 if not so. 
-    world_pt.wrap();
-    
-   return true;
-}
-
-//**************************************************************************************************
-//! Exposes the 3D projection from image to world coordinates given a constant height above 
-//! ellipsoid. The caller should verify that a valid projection exists before calling this
-//! method. Returns TRUE if a valid ground point is available in the ground_pt argument.
-//**************************************************************************************************
-bool ossimImageGeometry::localToWorld(const ossimDpt& local_pt, 
-                                      const double& h_ellipsoid, 
-                                      ossimGpt& world_pt) const
-{
-   //! Return a NAN point of no projection is defined:
-   if (!m_projection.valid())
-   {
-      world_pt.makeNan();
-      return false;
-   }
-
-   // First transform local pixel to full-image pixel:
-   ossimDpt full_image_pt;
-   rnToFull(local_pt, m_targetRrds, full_image_pt);
-
-   // Perform projection to world coordinates:
-   m_projection->lineSampleHeightToWorld(full_image_pt, h_ellipsoid, world_pt);
-
-   // Put longitude between -180 and +180 and latitude between -90 and +90 if not so. 
-   world_pt.wrap();
-    
-   return true;
-}
-
-//**************************************************************************************************
-//! Exposes the 3D world-to-local image coordinate reverse projection. The caller should verify 
-//! that a valid projection exists before calling this method. Returns TRUE if a valid image 
-//! point is available in the local_pt argument.
-//**************************************************************************************************
-bool ossimImageGeometry::worldToLocal(const ossimGpt& world_pt, ossimDpt& local_pt) const
-{
-   bool result = true;
-   
-   if ( m_projection.valid() )
-   {
-      //const ossimEquDistCylProjection* eqProj =
-      //   dynamic_cast<const ossimEquDistCylProjection*>( m_projection.get() );
-      
-      ossimDpt full_image_pt;
-
-      //***** GCP
-      // I am having major problems with the call and is messing up on Image that are edge to edge -180 to 180.
-      // It appears to wrap and think that the image is onl 1 pixel wide.  I am commenting out for now
-      // until a better solution can be done for points that wrap.  We need a general implementation that will work
-      // with any projector
-      //
-
-      //if ( eqProj && (m_imageSize.hasNans() == false) )
-     // {
-         // Call specialized method to handle wrapping...
-     //    eqProj->worldToLineSample( world_pt, m_imageSize, full_image_pt );
-     // }
-     // else if( isAffectedByElevation() )
-      if( isAffectedByElevation() )
-      {
-         ossimGpt copyPt( world_pt );
-         if(world_pt.isHgtNan())
-         {
-            copyPt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(copyPt);
-         }     
-
-         // Perform projection from world coordinates to full-image space:
-         m_projection->worldToLineSample(copyPt, full_image_pt);
-      }
-      else
-      {
-         // Perform projection from world coordinates to full-image space:
-         m_projection->worldToLineSample(world_pt, full_image_pt);
-      }
-      
-      // Transform to local space:
-      fullToRn(full_image_pt, m_targetRrds, local_pt);
-   }
-   else // No projection set:
-   {
-      local_pt.makeNan();
-      result = false;  
-   }
-   
-   return result;
-   
-} // End: ossimImageGeometry::worldToLocal(const ossimGpt&, ossimDpt&)
-
-//**************************************************************************************************
-//! Sets the transform to be used for local-to-full-image coordinate transformation
-//**************************************************************************************************
-void ossimImageGeometry::setTransform(ossim2dTo2dTransform* transform) 
-{ 
-   m_transform = transform; 
-}
-
-//**************************************************************************************************
-//! Sets the projection to be used for local-to-world coordinate transformation
-//**************************************************************************************************
-void ossimImageGeometry::setProjection(ossimProjection* projection) 
-{ 
-   m_projection = projection; 
-}
-
-//**************************************************************************************************
-//! Returns TRUE if this geometry is sensitive to elevation
-//**************************************************************************************************
-bool ossimImageGeometry::isAffectedByElevation() const
-{
-    if (m_projection.valid())
-        return m_projection->isAffectedByElevation();
-    return false;
-}
-
-//*************************************************************************************************
-//! Returns  GSD in meters in x- and y-directions. This may not be the same as the member 
-//! projection's stated resolution since a transform may be involved.
-//*************************************************************************************************
-ossimDpt ossimImageGeometry::getMetersPerPixel() const
-{
-   ossimDpt gsd;
-   getMetersPerPixel(gsd);
-   return gsd;
-}
-
-//*************************************************************************************************
-//! Computes GSD in meters in x- and y-directions. This may not be the same as the member 
-//! projection's stated resolution since a transform may be involved.
-//*************************************************************************************************
-void ossimImageGeometry::getMetersPerPixel( ossimDpt& gsd ) const
-{
-   if (m_projection.valid() && !m_transform.valid())
-   {
-      // No transform present, so simply query the projection for GSD:
-      gsd = m_projection->getMetersPerPixel();
-   }
-   else if (m_projection.valid() && (m_imageSize.hasNans() == false))
-   {
-      // A transform is involved, so need to use localToWorld call below:
-      ossimDpt pL0 (m_imageSize/2);
-      ossimDpt pLx (pL0.x+1, pL0.y);
-      ossimDpt pLy (pL0.x, pL0.y+1);
-      ossimGpt g0, gx, gy;
-
-      localToWorld(pL0, g0);
-      localToWorld(pLx, g0.height(), gx);
-      localToWorld(pLy, g0.height(), gy);
-
-      // Compute horizontal distance for one pixel:
-      gsd.x = g0.distanceTo(gx);
-      gsd.y = g0.distanceTo(gy);
-   }
-   else
-   {
-      // This object is not fully initialized:
-      gsd.makeNan();
-   }
-}
-
-//*************************************************************************************************
-// Returns the resolution of this image in degrees/pixel. Note that this only
-// makes sense if there is a projection associated with the image. Returns NaNs if no 
-// projection defined.
-//*************************************************************************************************
-ossimDpt ossimImageGeometry::getDegreesPerPixel() const
-{
-   ossimDpt dpp;
-   getDegreesPerPixel(dpp);
-   return dpp;
-}
-
-//*************************************************************************************************
-// Computes the resolution of this image in degrees/pixel. Note that this only
-// makes sense if there is a projection associated with the image. Returns NaNs if no 
-// projection defined.
-//*************************************************************************************************
-void ossimImageGeometry::getDegreesPerPixel( ossimDpt& dpp ) const
-{
-   const ossimMapProjection *map_proj = dynamic_cast<const ossimMapProjection *>(m_projection.get());
-   if (map_proj && !m_transform.valid())
-   {
-      // No transform present, so simply query the projection for resolution:
-      dpp = map_proj->getDecimalDegreesPerPixel();
-   }
-   else if (m_projection.valid() && (m_imageSize.hasNans() == false))
-   {
-      // A transform is involved, so need to use localToWorld call below:
-      ossimDpt pL0 (m_imageSize/2);
-      ossimDpt pLx (pL0.x+1, pL0.y);
-      ossimDpt pLy (pL0.x, pL0.y+1);
-      ossimGpt g0, gx, gy;
-
-      localToWorld(pL0, g0);
-      localToWorld(pLx, g0.height(), gx);
-      localToWorld(pLy, g0.height(), gy);
-
-      // Compute horizontal distance for one pixel:
-      double dlatx = std::fabs(g0.lat - gx.lat);
-      double dlaty = std::fabs(g0.lat - gy.lat);
-      double dlonx = std::fabs(g0.lon - gx.lon);
-      double dlony = std::fabs(g0.lon - gy.lon);
-      dpp.lat = sqrt(dlatx*dlatx + dlaty*dlaty);
-      dpp.lon = sqrt(dlonx*dlonx + dlony*dlony);
-   }
-   else
-   {
-      // This object is not fully initialized:
-      dpp.makeNan();
-   }
-}
-
-//**************************************************************************************************
-//! Prints contents to output stream.
-//**************************************************************************************************
-std::ostream& ossimImageGeometry::print(std::ostream& out) const
-{
-   out << "type: ossimImageGeometry" << std::endl;
-   if(m_transform.valid())
-   {
-      out << "  m_transform: ";
-      m_transform->print(out);
-   }
-   else
-   {
-      out << "  No transform defined. Using identity transform.\n";
-   }
-   
-   if(m_projection.valid())
-   {
-      out << "  m_projection: ";
-      m_projection->print(out);
-   }
-   else
-   {
-      out << "  No projection defined. ";
-   }
-
-   for ( std::vector<ossimDpt>::size_type i = 0; i < m_decimationFactors.size(); ++i )
-   {
-      cout << "m_decimationFactors[" << i << "]: " << m_decimationFactors[i] << "\n";
-   }
-
-   out << "m_imageSize: " << m_imageSize
-       << "\nm_targetRrds: " << m_targetRrds << "\n";
-
-   return out;
-}
-
-//**************************************************************************************************
-//! Returns TRUE if argument geometry has exactly the same instances for transform and 
-//! m_projection. This may need to be expanded to permit different instances of same transforms
-//**************************************************************************************************
-bool ossimImageGeometry::operator==(const ossimImageGeometry& other) const
-{
-    return ((m_transform == other.m_transform) && (m_projection == other.m_projection) &&
-            (decimationFactor(0) == other.decimationFactor(0)) );
-}
-
-//**************************************************************************************************
-//! Returns the decimation factor from R0 for the resolution level specified. For r_index=0, the 
-//! decimation factor is by definition 1.0. For the non-discrete case, r_index=1 returns a 
-//! decimation of 0.5. If the vector of discrete decimation factors (m_decimationFactors) is 
-//! empty, the factor will be computed as f=1/2^n
-//**************************************************************************************************
-ossimDpt ossimImageGeometry::decimationFactor(ossim_uint32 r_index) const
-{
-   ossim_uint32 size = (ossim_uint32)m_decimationFactors.size();
-   if (size)
-   {
-      if (r_index < size)
-      {
-         return m_decimationFactors[r_index];
-      }
-      
-      // Return the last defined decimation if the index requested exceeds list size:
-      return m_decimationFactors[size-1];
-   }
-
-   // Compute the decimation factor:
-   ossim_float64 factor = 1.0/(ossim_float64)(1 << r_index);
-   
-   return ossimDpt(factor, factor);
-}
-
-void ossimImageGeometry::decimationFactor(ossim_uint32 r_index,
-                                          ossimDpt& result) const
-{
-   const ossim_uint32 SIZE = (ossim_uint32)m_decimationFactors.size();
-   if (SIZE)
-   {
-      if (r_index < SIZE)
-      {
-         result = m_decimationFactors[r_index];
-      }
-      else
-      {
-         //---
-         // Return the last defined decimation if the index requested
-         // exceeds list size:
-         //---
-         result = m_decimationFactors[SIZE-1];
-      }
-   }
-   else
-   {
-      // Compute the decimation factor:
-      ossim_float64 factor = 1.0/(ossim_float64)(1 << r_index);
-      result.x = factor;
-      result.y = factor;
-   }
-}
-
-void ossimImageGeometry::decimationFactors(
-   std::vector<ossimDpt>& decimations) const
-{
-   decimations = m_decimationFactors;
-}
-
-//*****************************************************************************
-//! Attempts to initialize a transform and a projection given the KWL.
-//! Returns TRUE if no error encountered.
-//*****************************************************************************
-bool ossimImageGeometry::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   if (lookup)
-   {
-      if ( ossimString(lookup) == STATIC_TYPE_NAME(ossimImageGeometry) )
-      {
-         ossimObject::loadState(kwl, prefix);
-
-         // m_transform
-         ossimString transformPrefix = ossimString(prefix) + "transform.";
-         ossimRefPtr<ossim2dTo2dTransform> transform = ossim2dTo2dTransformRegistry::instance()->
-            createNativeObjectFromRegistry(kwl, transformPrefix.c_str());
-         if( transform.valid() )
-         {
-            m_transform = transform;
-         }
-
-         // m_projection:
-         ossimString projectionPrefix = ossimString(prefix) + "projection.";
-         ossimRefPtr<ossimProjection> projection = ossimProjectionFactoryRegistry::instance()->
-            createProjection(kwl, projectionPrefix.c_str());
-         if( projection.valid() )
-         {
-            m_projection = projection;
-         }
-
-         // m_decimationFactors:
-         ossimString decimations = kwl.find(prefix, "decimations");
-         if( decimations.size() )
-         {
-            m_decimationFactors.clear();
-            ossim::toVector(m_decimationFactors, decimations);
-         }
-
-         // m_imageSize:
-         ossimString imageSize = kwl.find(prefix, "image_size");
-         if( imageSize.size() )
-         {
-            m_imageSize.toPoint(imageSize);
-         }
-
-         // m_targetRrds:
-         ossimString targetRrds = kwl.find(prefix, "target_rrds");
-         if ( targetRrds.size() )
-         {
-            m_targetRrds = ossimString(targetRrds).toUInt32();
-         }
-      }
-      else
-      {
-         // Now look for projection spec (for backwards compatibility):
-         ossimProjection* projection = ossimProjectionFactoryRegistry::instance()->
-            createProjection(kwl, prefix);
-         if (projection)
-         {
-            setProjection(projection);
-         }
-      }
-   }
-   else
-   {
-      //---
-      // Old geometry file with no type keyword:
-      //---
-      ossimProjection* projection = ossimProjectionFactoryRegistry::instance()->
-         createProjection(kwl, prefix);
-      if (projection)
-      {
-         setProjection(projection);
-      } 
-   }
-   
-   return true;
-}
-
-//**************************************************************************************************
-//! Saves the transform (if any) and projection (if any) states to the KWL.
-//**************************************************************************************************
-bool ossimImageGeometry::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   bool good_save = true;
-
-   // m_transform:
-   if (m_transform.valid())
-   {
-      ossimString transformPrefix = ossimString(prefix) + "transform.";
-      good_save = m_transform->saveState(kwl, transformPrefix.c_str());
-   }
-
-   // m_projection:
-   if (m_projection.valid())
-   {
-      ossimString projectionPrefix = ossimString(prefix) + "projection.";
-      good_save &= m_projection->saveState(kwl, projectionPrefix.c_str());
-   }
-
-   // m_gsd:
-   ossimDpt gsd;
-   getMetersPerPixel(gsd);
-   kwl.add(prefix, "gsd", gsd.toString(), true);
-
-   // m_decimationFactors:
-   if(m_decimationFactors.size())
-   {
-      ossimString resultPoints;
-      ossim::toStringList(resultPoints, m_decimationFactors);
-      kwl.add(prefix, "decimations", resultPoints, true);
-   }
-   else
-   {
-      kwl.add(prefix, "decimations", "", true);
-   }
-
-   // m_imageSize:
-   kwl.add(prefix, "image_size", m_imageSize.toString(), true);
-
-   // m_targetRrds;
-   kwl.add(prefix, "target_rrds", m_targetRrds, true);
-
-   // Base class:
-   good_save &= ossimObject::saveState(kwl, prefix);
-   
-   return good_save;
-}
-
-void ossimImageGeometry::setTargetRrds(ossim_uint32 rrds)
-{
-   m_targetRrds = rrds;
-}
-
-ossim_uint32 ossimImageGeometry::getTargetRrds() const
-{
-   return m_targetRrds;
-}
-
-//**************************************************************************************************
-//! Replaces any existing transform and projection with those in the copy_this object
-//**************************************************************************************************
-const ossimImageGeometry& ossimImageGeometry::operator=(const ossimImageGeometry& copy_this)
-{
-   if (this != &copy_this)
-   {
-      // Get deep copy of 2D transform if one exists:
-      if (copy_this.m_transform.valid())
-      {
-         m_transform = (ossim2dTo2dTransform*) copy_this.m_transform->dup();
-      }
-      
-      // Now establish a deep copy of the projection, if any:
-      if (copy_this.m_projection.valid())
-      {
-         m_projection = (ossimProjection*) copy_this.m_projection->dup();
-      }
-      
-      // the Gsd should already be solved from the source we are copying from
-      m_imageSize         = copy_this.m_imageSize;
-      m_decimationFactors = copy_this.m_decimationFactors;
-      m_targetRrds        = copy_this.m_targetRrds;
-   }
-   return *this;
-}
-
-//**************************************************************************************************
-//! Returns the ossimGpts for the four image corner points
-//**************************************************************************************************
-bool ossimImageGeometry::getCornerGpts(ossimGpt& gul, ossimGpt& gur, 
-                                       ossimGpt& glr, ossimGpt& gll) const
-{
-   ossimDpt iul (0,0);
-   ossimDpt iur (m_imageSize.x-1, 0);
-   ossimDpt ilr (m_imageSize.x-1, m_imageSize.y-1);
-   ossimDpt ill (0, m_imageSize.y-1);
-
-   bool status = true;
-
-   status &= localToWorld(iul, gul);
-   status &= localToWorld(iur, gur);
-   status &= localToWorld(ilr, glr);
-   status &= localToWorld(ill, gll);
-
-   return status;
-}
-
-void ossimImageGeometry::getTiePoint(ossimGpt& tie, bool edge) const
-{
-   ossimGrect grect;
-   getBoundingGroundRect(grect);
-   if ( m_projection.valid() && (m_imageSize.hasNans() == false) )
-   {
-      // Use the easting/northing version of this method if underlying projection is meters:
-      const ossimMapProjection* map_proj = 
-         dynamic_cast<const ossimMapProjection*>(m_projection.get());
-      if (map_proj)
-      {
-         if(!map_proj->isGeographic())
-         {
-            ossimDpt enTie;
-            getTiePoint(enTie, edge);
-            if (!enTie.hasNans())
-               tie = m_projection->inverse(enTie);
-            else
-               tie.makeNan();
-         }
-         else
-         {
-            ossimDpt dpp = map_proj->getDecimalDegreesPerPixel();
-            dpp.lat*=0.5;
-            dpp.lon*=0.5;
-            tie = grect.ul();
-            if(edge)
-            {
-               tie.lat -= dpp.lat;
-               tie.lon += dpp.lon; 
-            }
-         }
-      }
-      else
-      {
-
-         // must be a sensor model so we will set to the upper left bounds of the image
-         tie = grect.ul();
-//         std::cout << "GRECT ======= " << grect << "\n";
-//         std::cout << m_projection->getClassName() << std::endl;
-//         ossimDpt pt = m_projection->forward( tie );
-//         std::cout << "FORWARD:" <<pt << std::endl;
-      }
-   }
-
-
-#if 0
-  // std::cout << "GRECT ======= " << grect << "\n";
-   if ( m_projection.valid() && (m_imageSize.hasNans() == false) )
-   {
-      // Use the easting/northing version of this method if underlying projection is meters:
-      const ossimMapProjection* map_proj = 
-         dynamic_cast<const ossimMapProjection*>(m_projection.get());
-      if (map_proj && !map_proj->isGeographic())
-      {
-         ossimDpt enTie;
-         getTiePoint(enTie, edge);
-         if (!enTie.hasNans())
-            tie = m_projection->inverse(enTie);
-         else
-            tie.makeNan();
-         return; // return here only because it bugs Dave
-      }
-
-      // Use projection to ground to establish UL extreme of image:
-      ossimDpt iul (0,0);
-      ossimDpt iur (m_imageSize.x-1, 0);
-      ossimDpt ilr (m_imageSize.x-1, m_imageSize.y-1);
-      ossimDpt ill (0, m_imageSize.y-1);
-      ossimDpt iRight(1, 0);
-      ossimDpt iDown(0, 1);
-      
-      ossimGpt gul;
-      ossimGpt gur; 
-      ossimGpt glr;
-      ossimGpt gll;
-      ossimGpt gRight;
-      ossimGpt gDown;
-      
-      localToWorld(iul, gul);
-      localToWorld(iur, gur);
-      localToWorld(ilr, glr);
-      localToWorld(ill, gll);
-      localToWorld(iRight, gRight);
-      localToWorld(iDown, gDown);
-      
-      std::cout << "gul: " << gul << "\n"
-                << "gur: " << gur << "\n"
-                << "glr: " << glr << "\n"
-                << "gll: " << gll << "\n"
-                << "gRight: " << gRight << "\n"
-                << "gDown:  " << gDown << "\n";
-      // Determine the direction of the image:
-      if ( gul.lat > gDown.lat ) // oriented north up
-      {
-         if ( gul.lat >= gRight.lat ) // straight up or leaning right
-         {
-            std::cout << "ONE\n";
-            tie.lat = gul.lat;
-            tie.lon = gll.lon;
-         }
-         else // leaning left
-         {
-            std::cout << "TWO\n";
-            tie.lat = gur.lat;
-            tie.lon = gul.lon;
-         }
-      }
-      else // south or on side
-      {
-         if ( gRight.lat >= gul.lat ) // straight down or leaning right
-         {
-            std::cout << "THREE\n";
-            tie.lat = glr.lat;
-            tie.lon = gur.lon;
-         }
-         else // leaning left
-         {
-            std::cout << "FOUR\n";
-            tie.lat = gll.lat;
-            tie.lon = glr.lon;
-         }   
-      }
-      std::cout << "TIE BEFORE ==== " << tie << "\n";
-
-      if ( edge )
-      {
-         ossimDpt pt = m_projection->forward( tie );
-         ossimDpt half_pixel_shift = m_projection->getMetersPerPixel() * 0.5;
-         pt.y += half_pixel_shift.y;
-         pt.x -= half_pixel_shift.x;
-         tie = m_projection->inverse( pt );
-      }
-      
-      std::cout << "TIE ==== " << tie << "\n";
-   } // if ( (m_imageSize.hasNans() == false) && m_projection.valid() )
-   else
-   { 
-      tie.lat = ossim::nan();
-      tie.lon = ossim::nan();
-   }
-#endif
-}
-
-//**************************************************************************************************
-// Assigns tie to the UL easting northing of the image. If edge is true, the E/N will be for the 
-// pixel-is-area representation
-//**************************************************************************************************
-void ossimImageGeometry::getTiePoint(ossimDpt& tie, bool edge) const
-{
-   if (!m_projection.valid() || m_imageSize.hasNans())
-   {
-      tie.makeNan();
-      return; // return here only because it bugs Dave
-   }
-
-   // Use the geographic version of this method if underlying projection is NOT map in meters:
-   const ossimMapProjection* map_proj = dynamic_cast<const ossimMapProjection*>(m_projection.get());
-   if (!map_proj || map_proj->isGeographic())
-   {
-      // Use the geographic version of this method to establish UL:
-      ossimGpt gTie;
-      gTie.hgt = 0.0;
-      getTiePoint(gTie, edge);
-      if (!gTie.hasNans())
-         tie = m_projection->forward( gTie );
-      else
-         tie.makeNan();
-      return; // return here only because it bugs Dave
-   }
-
-   // The underlying projection is a proper map projection in meters. Use easting northing 
-   // directly to avoid shifting the UL tiepoint because of skewed edge in geographic. Note:
-   // assume the image is North up:
-   ossimDpt iul (0,0);
-   ossimDpt ful;
-   rnToFull(iul, 0, ful);
-   map_proj->lineSampleToEastingNorthing(ful, tie);
-   if (edge && !tie.hasNans())
-   {
-      // Shift from pixel-is-point to pixel-is-area
-      ossimDpt half_pixel_shift = map_proj->getMetersPerPixel() * 0.5;
-      tie.y += half_pixel_shift.y;
-      tie.x -= half_pixel_shift.x;
-   }
-}
-
-//**************************************************************************************************
-void ossimImageGeometry::undecimatePoint(const ossimDpt& rnPt,
-                                         ossim_uint32 resolutionLevel,
-                                         ossimDpt& outPt) const
-{
-   // Back out the decimation.
-   ossimDpt decimation = decimationFactor(resolutionLevel);
-   
-   //---
-   // If no nans and one or both of the factors is not 1.0 decimation should
-   // be applied.
-   //---
-   if ( (decimation.x != 1.0) || (decimation.y != 1.0) ) 
-   {
-      if ( !decimation.hasNans() && !rnPt.hasNans() )
-      {
-         outPt.x = rnPt.x * (1.0/decimation.x);
-         outPt.y = rnPt.y * (1.0/decimation.y);
-      }
-      else
-      {
-         outPt.makeNan();
-      }
-   }
-   else
-   {
-      outPt = rnPt; // No decimation.
-   }
-}
-
-//**************************************************************************************************
-void ossimImageGeometry::decimatePoint(const ossimDpt& inPt,
-                                       ossim_uint32 resolutionLevel,
-                                       ossimDpt& rnPt) const
-{
-   
-   // Apply the decimation.
-   ossimDpt decimation = decimationFactor(resolutionLevel);
-
-   //---
-   // If no nans and one or both of the factors is not 1.0 decimation should
-   // be applied.
-   //---
-   if ( (decimation.x != 1.0) || (decimation.y != 1.0) ) 
-   {
-      if ( !decimation.hasNans() && !inPt.hasNans() )
-      {
-         rnPt.x = inPt.x * decimation.x;
-         rnPt.y = inPt.y * decimation.y;
-      }
-      else
-      {
-        rnPt.makeNan(); 
-      }
-   }
-   else
-   {
-      rnPt = inPt; // No decimation.
-   }
-}
-
-bool ossimImageGeometry::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
-{
-   bool result = ossimObject::isEqualTo(obj, compareType);
-   const ossimImageGeometry* rhs = dynamic_cast<const ossimImageGeometry*> (&obj);
-   if(rhs&&result) // we know the types are the same
-   {
-      result = ((m_decimationFactors.size() == rhs->m_decimationFactors.size())&&
-                m_imageSize.isEqualTo(rhs->m_imageSize)&& 
-                (m_targetRrds == rhs->m_targetRrds)); 
-      
-      if(result)
-      {
-         ossim_uint32 decimationIdx = 0;
-         for(decimationIdx = 0; result&&(decimationIdx < m_decimationFactors.size());++decimationIdx)
-         {
-            result = m_decimationFactors[decimationIdx].isEqualTo(rhs->m_decimationFactors[decimationIdx]);
-         }
-      }
-      
-      if(result && compareType==OSSIM_COMPARE_IMMEDIATE)
-      {
-         result = ((m_transform.get()  == rhs->m_transform.get())&& 
-                   (m_projection.get() == rhs->m_projection.get()));  //!< Maintains full_image-to-world_space transformation
-         
-      }
-      else
-      {
-         if(m_transform.valid()&&rhs->m_transform.valid())
-         {
-            result = m_transform->isEqualTo(*rhs->m_transform.get());
-         }
-         else if(reinterpret_cast<ossim_uint64>(m_transform.get()) | reinterpret_cast<ossim_uint64>(rhs->m_transform.get())) // one is null
-         {
-            result = false;
-         }
-         if(m_projection.valid()&&rhs->m_projection.valid())
-         {
-            result = m_projection->isEqualTo(*rhs->m_projection.get());
-         }
-         else if(reinterpret_cast<ossim_uint64>(m_projection.get()) | reinterpret_cast<ossim_uint64>(rhs->m_projection.get())) // one is null
-         {
-            result = false;
-         }
-         
-      }
-   }
-   return result;
-}
-
-bool ossimImageGeometry::getCrossesDateline()const
-{
-   bool result = false;
-   ossimIrect rect;
-   ossimGpt ul;
-   ossimGpt ur;
-   ossimGpt lr;
-   ossimGpt ll;
-   ossimGpt center;
-   ossimGpt wgs84;
-
-   getBoundingRect(rect);
-
-   localToWorld(rect.ul(), ul);
-   localToWorld(rect.ur(), ur);
-   localToWorld(rect.lr(), lr);
-   localToWorld(rect.ll(), ll);
-   localToWorld(rect.midPoint(), center);
-
-   if(ul.isLonNan()||ur.isLonNan()||lr.isLonNan()||ll.isLonNan()||center.isLonNan())
-   {
-      return result;
-   }
-   else
-   {
-      ul.changeDatum(wgs84.datum());
-      ur.changeDatum(wgs84.datum());
-      lr.changeDatum(wgs84.datum());
-      ll.changeDatum(wgs84.datum());
-      center.changeDatum(wgs84.datum());
-      result = ( (fabs(center.lond()-ul.lond()) > 180.0) ||
-                 (fabs(center.lond()-ur.lond()) > 180.0) ||
-                 (fabs(center.lond()-lr.lond()) > 180.0) ||
-                 (fabs(center.lond()-ll.lond()) > 180.0));
-   }
-
-   return result; 
-}
-
-void ossimImageGeometry::calculatePolyBounds(ossimPolyArea2d& result, ossim_int32 partitions)const
-{
-   if(!m_imageSize.hasNans())
-   {
-      ossim_int64 delta = 0;
-      ossim_int64 stepSizex = m_imageSize.x/partitions;
-      ossim_int64 stepSizey = m_imageSize.y/partitions;
-      ossim_int64 w1        = m_imageSize.x-1;
-      ossim_int64 h1        = m_imageSize.y-1;
-      ossimGpt    gpt;
-      ossimGpt t1,t2,t3,t4;
-      localToWorld(ossimDpt(0,0), t1);
-      localToWorld(ossimDpt(w1,0), t2);
-      localToWorld(ossimDpt(w1,h1), t3);
-      localToWorld(ossimDpt(0,h1), t4);
-      if(t1.isLatLonNan()||t2.isLatLonNan()||t3.isLatLonNan()||t4.isLatLonNan())
-      {
-         // need to print error if a corners are nan
-         return;
-      }
-
-      // set initial point
-      gpt = t1;
-      if(getCrossesDateline())
-      {
-         // make sure we have enough samples to cross the dateline properly
-         if(partitions < 20) partitions = 20;
-         stepSizex = m_imageSize.x/partitions;
-         stepSizey = m_imageSize.y/partitions;
-
-         ossimGpt previousPoint;
-         std::vector<std::vector<ossimDpt> > polygons(2);
-         ossim_uint32 whichPoly = 0;
-         //localToWorld(ossimDpt(0,0), gpt);
-         //gpt = t1;
- 
-         polygons[whichPoly].push_back(gpt);
-
-         previousPoint = gpt;
-
-         // top
-         for(delta = stepSizex; delta < w1;delta+=stepSizex)
-         {
-            localToWorld(ossimDpt(delta, 0), gpt);
-            if(!gpt.isLatLonNan())
-            {
-            // need to print error if a corner is nan
-
-               if(fabs(gpt.lond()-previousPoint.lond()) > 180.0)
-               {
-                  ossimGpt tempGpt;
-                  ossim_uint32 currentPolyIndex = whichPoly;
-                  whichPoly ^= 1;
-
-                  localToWorld(ossimDpt( (delta-stepSizex) + .5, 0), tempGpt);
-
-                  if(!tempGpt.isLatLonNan())
-                  {
-                     ossimDpt start = previousPoint;
-                     ossimDpt end   = tempGpt;
-                     ossimDpt deltaPoint = end-start;
-
-                     if(gpt.lond() > 0) // crossing negative to positive
-                     {
-                        ossim_float64 t = ((-180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimGpt(lat, -180.0));
-                        polygons[whichPoly].push_back(ossimGpt(lat, 180.0));
-                        //std::cout << "LON ==== " << -180 << " LAT === " << (start.y+deltaPoint.y*t) << "\n";
-
-                        //std::cout << "TOP CROSSING NEGATIVE TO POSITIVE\n";
-                     }
-                     else // crossing positive to negative 
-                     {
-                        ossim_float64 t = ((180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimGpt(lat, 180.0));
-                        polygons[whichPoly].push_back(ossimGpt(lat, -180.0));
-
-                        //std::cout << "TOP CROSSING POSITIVE TO NEGATIVE\n";
-                     }
-                     //std::cout << ossimDpt(previousPoint) << " --> " << ossimDpt(gpt) << "\n";
-                  }
-               }
-               polygons[whichPoly].push_back(gpt);
-               previousPoint = gpt;
-            }
-         }
-         // right
-         for(delta = stepSizey; delta<h1; delta+=stepSizey)
-         {
-            localToWorld(ossimDpt(w1, delta), gpt);
-            if(!gpt.isLatLonNan())
-            {
-
-               if(fabs(gpt.lond()-previousPoint.lond()) > 180.0)
-               {
-                  ossimGpt tempGpt;
-                  ossim_uint32 currentPolyIndex = whichPoly;
-                  whichPoly ^= 1;
-
-                  localToWorld(ossimDpt( w1, (delta-stepSizey)+0.5), tempGpt);
-                  if(!tempGpt.isLatLonNan())
-                  {
-                     ossimDpt start = previousPoint;
-                     ossimDpt end   = tempGpt;
-                     ossimDpt deltaPoint = end-start;
-
-                     if(gpt.lond() > 0) // crossing negative to positive
-                     {
-                        ossim_float64 t = ((-180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimGpt(lat, -180.0));
-                        polygons[whichPoly].push_back(ossimGpt(lat, 180.0));
-                       // std::cout << "RIGHT CROSSING NEGATIVE TO POSITIVE\n";
-                     }
-                     else // crossing positive to negative 
-                     {
-                        ossim_float64 t = ((180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimGpt(lat, 180.0));
-                        polygons[whichPoly].push_back(ossimGpt(lat, -180.0));
-                        //std::cout << "RIGHT CROSSING POSITIVE TO NEGATIVE\n";
-                     }
-                     //std::cout << ossimDpt(previousPoint) << " --> " << ossimDpt(gpt) << "\n";
-                  }
-               }
-               polygons[whichPoly].push_back(gpt);
-               previousPoint = gpt;
-            }
-         }
-
-         // bottom
-         for(delta = w1; delta > 0;delta-=stepSizex)
-         {
-            localToWorld(ossimDpt(delta, h1), gpt);
-            if(!gpt.isLatLonNan())
-            {
-               if(fabs(gpt.lond()-previousPoint.lond()) > 180.0)
-               {
-                  ossimGpt tempGpt;
-                  ossim_uint32 currentPolyIndex = whichPoly;
-                  whichPoly ^= 1;
-
-                  localToWorld(ossimDpt( (delta+stepSizex)-0.5, h1), tempGpt);
-                  if(!tempGpt.isLatLonNan())
-                  {
-                     ossimDpt start = previousPoint;
-                     ossimDpt end   = tempGpt;
-                     ossimDpt deltaPoint = end-start;
-
-                     if(gpt.lond() > 0) // crossing negative to positive
-                     {
-                        ossim_float64 t = ((-180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimGpt(lat, -180.0));
-                        polygons[whichPoly].push_back(ossimGpt(lat, 180.0));
-                        //std::cout << "BOTTOM CROSSING NEGATIVE TO POSITIVE\n";
-                     }
-                     else // crossing positive to negative 
-                     {
-                        ossim_float64 t = ((180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimGpt(lat, 180.0));
-                        polygons[whichPoly].push_back(ossimGpt(lat, -180.0));
-                        //std::cout << "BOTTOM CROSSING POSITIVE TO NEGATIVE\n";
-                     }
-                     //std::cout << ossimDpt(previousPoint) << " --> " << ossimDpt(gpt) << "\n";
-                  }
-               }
-               polygons[whichPoly].push_back(gpt);
-               previousPoint = gpt;
-            }
-         }
-         // left
-         for(delta = h1; delta > 0;delta-=stepSizey)
-         {
-            localToWorld(ossimDpt(0, delta), gpt);
-
-            if(!gpt.isLatLonNan())
-            {
-
-
-               if(fabs(gpt.lond()-previousPoint.lond()) > 180.0)
-               {
-                  ossimGpt tempGpt;
-                  ossim_uint32 currentPolyIndex = whichPoly;
-                  whichPoly ^= 1;
-
-                  localToWorld(ossimDpt( 0, (delta+stepSizey)-0.5), tempGpt);
-
-                  if(!tempGpt.isLatLonNan())
-                  {
-                     ossimDpt start = previousPoint;
-                     ossimDpt end   = tempGpt;
-                     ossimDpt deltaPoint = end-start;
-
-                     if(gpt.lond() > 0) // crossing negative to positive
-                     {
-                        ossim_float64 t = ((-180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimDpt(-180.0, lat));
-                        polygons[whichPoly].push_back(ossimDpt(180.0, lat));
-                        //std::cout << "LEFT CROSSING NEGATIVE TO POSITIVE\n";
-                     }
-                     else // crossing positive to negative 
-                     {
-                        ossim_float64 t = ((180-start.x)/deltaPoint.x);
-                        ossim_float64 lat = (start.y+deltaPoint.y*t);
-                        polygons[currentPolyIndex].push_back(ossimDpt(180.0, lat));
-                        polygons[whichPoly].push_back(ossimDpt(-180.0, lat));
-                        //std::cout << "LEFT CROSSING POSITIVE TO NEGATIVE\n";
-                     }
-                     //std::cout << ossimDpt(previousPoint) << " --> " << ossimDpt(gpt) << "\n";
-                  }
-
-               }
-               polygons[whichPoly].push_back(gpt);
-               previousPoint = gpt;
-            }
-         }
-         if(polygons[0].size() > 0) polygons[0].push_back(polygons[0][0]);
-         if(polygons[1].size() > 0) polygons[1].push_back(polygons[1][0]);
-
-         if((polygons[0].size() > 3)&&
-            (polygons[1].size() > 3))
-         {
-            result  = polygons[0];
-            if(!result.isValid()) result.setToBufferedShape();
-            ossimPolyArea2d tempPolyArea;
-            tempPolyArea = polygons[1];
-            if(!tempPolyArea.isValid()) tempPolyArea.setToBufferedShape();
-            result.add(tempPolyArea);
-         }
-
-      }
-      else
-      {
-         std::vector<ossimGpt> poly;
-         // if(!isAffectedByElevation())
-         // {
-         //    poly.push_back(t1);
-         //    poly.push_back(t2);
-         //    poly.push_back(t3);
-         //    poly.push_back(t4);
-         //    poly.push_back(t5);
-         // }
-         // else
-         {
-         //localToWorld(ossimDpt(0,0), gpt);
-            poly.push_back(gpt);
-            
-            // top
-            for(delta = stepSizex; delta < w1;delta+=stepSizex)
-            {
-               localToWorld(ossimDpt(delta, 0), gpt);
-               if(!gpt.isLatLonNan())
-               {
-                  poly.push_back(gpt);
-               }
-            }
-            localToWorld(ossimDpt(w1, 0), gpt);
-            if(!gpt.isLatLonNan())
-            {
-               poly.push_back(gpt);
-            }
-
-            //right
-            for(delta = stepSizey; delta<h1; delta+=stepSizey)
-            {
-               localToWorld(ossimDpt(w1, delta), gpt);
-               if(!gpt.isLatLonNan())
-               {
-                  poly.push_back(gpt);
-               }
-            }
-            localToWorld(ossimDpt(w1, h1), gpt);
-            if(!gpt.isLatLonNan())
-            {
-               poly.push_back(gpt);
-            }
-
-            //bottom
-            for(delta = w1; delta > 0;delta-=stepSizex)
-            {
-               localToWorld(ossimDpt(delta, h1), gpt);
-               if(!gpt.isLatLonNan())
-               {
-                  poly.push_back(gpt);
-               }
-            }
-            localToWorld(ossimDpt(0, h1), gpt);
-            if(!gpt.isLatLonNan())
-            {
-               poly.push_back(gpt);
-            }
-
-            //left
-            for(delta = h1; delta > 0;delta-=stepSizey)
-            {
-               localToWorld(ossimDpt(0, delta), gpt);
-               if(!gpt.isLatLonNan())
-               {
-                  poly.push_back(gpt);
-               }
-            }
-            localToWorld(ossimDpt(0, 0), gpt);
-            if(!gpt.isLatLonNan())
-            {
-               poly.push_back(gpt);
-            }
-            
-         }
-
-         result = poly;
-         if(!result.isValid()) result.setToBufferedShape();
-      }
-   }
-}
-
-
-void ossimImageGeometry::getBoundingRect(ossimIrect& bounding_rect) const
-{
-   if (m_imageSize.hasNans())
-   {
-      bounding_rect.makeNan();
-   }
-   else
-   {
-      bounding_rect.set_ulx(0);
-      bounding_rect.set_uly(0);
-      bounding_rect.set_lrx(m_imageSize.x-1);
-      bounding_rect.set_lry(m_imageSize.y-1);
-   }
-}
-
-void ossimImageGeometry::getBoundingRect(ossimDrect& bounding_rect) const
-{
-   if (m_imageSize.hasNans())
-   {
-      bounding_rect.makeNan();
-   }
-   else
-   {
-      bounding_rect.set_ulx(0);
-      bounding_rect.set_uly(0);
-      bounding_rect.set_lrx(m_imageSize.x-1);
-      bounding_rect.set_lry(m_imageSize.y-1);
-   }
-}
-
-void ossimImageGeometry::getBoundingGroundRect(ossimGrect& bounding_grect) const
-{
-   ossimGpt ul, ur, lr, ll;
-   getCornerGpts(ul, ur, lr, ll);
-   bounding_grect.ul().lat = ul.lat > ur.lat ? ul.lat : ur.lat;
-   bounding_grect.ul().lon = ul.lon < ll.lon ? ul.lon : ll.lon;
-   bounding_grect.lr().lat = ll.lat < lr.lat ? ll.lat : lr.lat;
-   bounding_grect.lr().lon = ur.lon > lr.lon ? ur.lon : lr.lon;
-}
-
-void ossimImageGeometry::applyScale(const ossimDpt& scale, bool recenterTiePoint)
-{
-   if ((scale.x != 0.0) && (scale.y != 0.0))
-   {
-      ossimMapProjection* map_Proj = dynamic_cast<ossimMapProjection*>(m_projection.get());
-      if ( map_Proj )
-      {
-         m_imageSize.x = ossim::round<ossim_int32>(m_imageSize.x / scale.x);
-         m_imageSize.y = ossim::round<ossim_int32>(m_imageSize.y / scale.y);
-         map_Proj->applyScale(scale, recenterTiePoint);
-      }
-   }
-}
-
-ossimAdjustableParameterInterface* ossimImageGeometry::getAdjustableParameterInterface()
-{
-   return PTR_CAST(ossimAdjustableParameterInterface, getProjection());
-}
-
-const ossimAdjustableParameterInterface* ossimImageGeometry::getAdjustableParameterInterface()const
-{
-   return dynamic_cast<const ossimAdjustableParameterInterface*>(getProjection());
-
-}
-
-bool ossimImageGeometry::computeImageToGroundPartialsWRTAdjParam(ossimDpt& result,
-                                                                           const ossimGpt& gpt,
-                                                                           ossim_uint32 idx,
-                                                                           ossim_float64 paramDelta)
-{
-   double den = 0.5/paramDelta; // this is the same as dividing by 2*delta
-   
-   result = ossimDpt(0.0,0.0);
-   ossimAdjustableParameterInterface* adjustableParamInterface = getAdjustableParameterInterface();
-   
-   if(!adjustableParamInterface) return false;
-   if(idx >= adjustableParamInterface->getNumberOfAdjustableParameters()) return false;
-   
-   ossimDpt p1, p2;
-   // double middle = adjustableParamInterface->getAdjustableParameter(idx);
-   double middle = adjustableParamInterface->getParameterCenter(idx);
-   
-   //set parm to high value
-   // adjustableParamInterface->setAdjustableParameter(idx, middle + paramDelta, true);
-   adjustableParamInterface->setParameterCenter(idx, middle + paramDelta, true);
-   worldToLocal(gpt, p1);
-   
-   //set parm to low value and gte difference
-   // adjustableParamInterface->setAdjustableParameter(idx, middle - paramDelta, true);
-   adjustableParamInterface->setParameterCenter(idx, middle - paramDelta, true);
-   worldToLocal(gpt, p2);
-   
-   //get partial derivative
-   result = (p2-p1)*den;
-   
-   //reset param
-   // adjustableParamInterface->setAdjustableParameter(idx, middle, true);
-   adjustableParamInterface->setParameterCenter(idx, middle, true);
-   
-   return !result.hasNans();
-}
-                         
-bool ossimImageGeometry::computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result, 
-                                                                            const ossimGpt& gpt,
-                                                                            ossim_float64 paramDelta)
-{
-   ossimAdjustableParameterInterface* adjustableParamInterface = getAdjustableParameterInterface();
-   
-   ossim_uint32 nAdjustables = adjustableParamInterface->getNumberOfAdjustableParameters();
-   
-   ossim_uint32 idx = 0;
-   
-   result = NEWMAT::Matrix(nAdjustables, 2);
-   for(;idx < nAdjustables; ++idx)
-   {
-      ossimDpt paramResResult;
-      computeImageToGroundPartialsWRTAdjParam(paramResResult,
-                                                        gpt,
-                                                        idx,
-                                                        paramDelta);
-      result[idx][0] = paramResResult.x;
-      result[idx][1] = paramResResult.y;
-   }
-   
-   return true;
-}
-
-bool ossimImageGeometry::computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result,
-                                                                            const ossimGpt& gpt,
-                                                                            const DeltaParamList& deltas)
-{
-   
-   ossimAdjustableParameterInterface* adjustableParamInterface = getAdjustableParameterInterface();
-   
-   ossim_uint32 nAdjustables = adjustableParamInterface->getNumberOfAdjustableParameters();
-   
-   if(nAdjustables != deltas.size()) return false;
-   ossim_uint32 idx = 0;
-   
-   result = NEWMAT::Matrix(nAdjustables, 2);
-   for(;idx < nAdjustables; ++idx)
-   {
-      ossimDpt paramResResult;
-      computeImageToGroundPartialsWRTAdjParam(paramResResult,
-                                                        gpt,
-                                                        idx,
-                                                        deltas[idx]);
-      // ROWxCOL
-      result[idx][0] = paramResResult.x;
-      result[idx][1] = paramResResult.y;
-   }
-   
-   return true;
-}
-
-bool ossimImageGeometry::computeGroundToImagePartials(NEWMAT::Matrix& result,
-                                                      const ossimGpt& gpt,
-                                                      const ossimDpt3d& deltaLlh)
-{
-   if(!getProjection()) return false;
-   ossimDpt p1;
-   ossimDpt p2;
-   
-   ossimDpt deltaWithRespectToLon;
-   ossimDpt deltaWithRespectToLat;
-   ossimDpt deltaWithRespectToH;
-   ossim_float64 h = ossim::isnan(gpt.height())?0.0:gpt.height();
-
-   // do the change in lon first for the dx, dy
-   //
-   worldToLocal(ossimGpt(gpt.latd(), gpt.lond()+deltaLlh.x, h, gpt.datum()), p1);
-   worldToLocal(ossimGpt(gpt.latd(), gpt.lond()-deltaLlh.x, h, gpt.datum()), p2);
-   
-   double den = 0.5/deltaLlh.x; // this is the same as dividing by 2*delta
-   deltaWithRespectToLon = (p2-p1)*den;
-   
-    
-   // do the change in lat for the dx, dy
-   //
-   worldToLocal(ossimGpt(gpt.latd()+deltaLlh.y, gpt.lond(), h, gpt.datum()), p1);
-   worldToLocal(ossimGpt(gpt.latd()-deltaLlh.y, gpt.lond(), h, gpt.datum()), p2);
-   
-   den = 0.5/deltaLlh.y; // this is the same as dividing by 2*delta
-   deltaWithRespectToLat = (p2-p1)*den;
-
-   
-   // do the change in height first for the dx, dy
-   //
-   worldToLocal(ossimGpt(gpt.latd(), gpt.lond(), h+deltaLlh.z, gpt.datum()), p1);
-   worldToLocal(ossimGpt(gpt.latd(), gpt.lond(), h-deltaLlh.z, gpt.datum()), p2);
-   
-   den = 0.5/deltaLlh.z; // this is the same as dividing by 2*delta
-   deltaWithRespectToH = (p2-p1)*den;
-   
-   
-   result = NEWMAT::Matrix(3,2);
-   
-   // set the matrix
-   //
-   result[1][0] = deltaWithRespectToLon.x*DEG_PER_RAD; 
-   result[1][1] = deltaWithRespectToLon.y*DEG_PER_RAD; 
-   result[0][0] = deltaWithRespectToLat.x*DEG_PER_RAD; 
-   result[0][1] = deltaWithRespectToLat.y*DEG_PER_RAD; 
-   result[2][0] = deltaWithRespectToH.x; 
-   result[2][1] = deltaWithRespectToH.y; 
-   
-   
-   return true; 
-}
-
-bool ossimImageGeometry::computeGroundToImagePartials(NEWMAT::Matrix& result,
-                                                      const ossimGpt& gpt)
-{
-   ossimDpt mpp = getMetersPerPixel();
-   ossimGpt originPoint;
-   ossim_float64 len = mpp.length();
-   
-   if(len > FLT_EPSILON)
-   {
-      ossim_float64 delta = originPoint.metersPerDegree().length();
-   
-      delta = len/delta;
-      
-      return computeGroundToImagePartials(result, 
-                                          gpt, 
-                                          ossimDpt3d(delta,
-                                                     delta,
-                                                     len));
-   }
-   
-   return false;
-}
-
-ossim_float64 ossimImageGeometry::upIsUpAngle() const
-{
-   ossim_float64 result = ossim::nan();
-
-   if ( m_projection.valid() )
-   {
-      if ( m_projection->isAffectedByElevation() )
-      {
-         const int NUMBER_OF_SAMPLES = 9;
-         
-         // In meters.  This is about a height of a 6 to 7 story building.
-         const double ELEVATION_DISPLACEMENT = 20;
-         
-         ossimDrect bounds;
-         getBoundingRect( bounds );
-         
-         if( !bounds.hasNans() )
-         {
-            ossim_float64 widthPercent  = bounds.width()*.1;
-            ossim_float64 heightPercent = bounds.height()*.1;
-            
-            //---
-            // Sanity check to make sure that taking 10 percent out on the image
-            // gets us to at least 1 pixel away.
-            //---
-            if(widthPercent < 1.0) widthPercent = 1.0;
-            if(heightPercent < 1.0) heightPercent = 1.0;
-            
-            // set up some work variables to help calculate the average partial
-            //
-            std::vector<ossimDpt> ipts(NUMBER_OF_SAMPLES);
-            std::vector<ossimGpt> gpts(NUMBER_OF_SAMPLES);
-            std::vector<ossimDpt> iptsDisplacement(NUMBER_OF_SAMPLES);
-            std::vector<ossimDpt> partials(NUMBER_OF_SAMPLES);
-            ossimDpt averageDelta(0.0,0.0);
-            
-            ossimDpt centerIpt = bounds.midPoint();
-            
-            //---
-            // Lets take an average displacement about the center point (3x3 grid)
-            // we will go 10 percent out of the width and height of the image and
-            // look at the displacement at those points and average them we will
-            // use the average displacement to compute the up is up rotation.
-            //---
-            
-            // top row:
-
-            // 45 degree left quadrant
-            // RP - FIX POINTS IN FIRST ROW
-            ipts[0] = centerIpt + ossimDpt(-widthPercent, -heightPercent);
-            // 45 degree middle top 
-            ipts[1] = centerIpt + ossimDpt(0.0,heightPercent);
-            // 45 degree right quadrant
-            ipts[2] = centerIpt + ossimDpt(widthPercent, -heightPercent);
-            
-            // middle row
-            ipts[3] = centerIpt + ossimDpt(-widthPercent, 0.0); // left middle
-            ipts[4] = centerIpt;
-            ipts[5] = centerIpt + ossimDpt(widthPercent, 0.0);
-            
-            // bottom row
-            ipts[6] = centerIpt + ossimDpt(-widthPercent, heightPercent);
-            ipts[7] = centerIpt + ossimDpt(0.0, heightPercent);
-            ipts[8] = centerIpt + ossimDpt(widthPercent, heightPercent);
-            
-            ossim_uint32 idx = 0;
-            for(idx = 0; idx < ipts.size(); ++idx)
-            {
-               double h = 0.0;
-               localToWorld(ipts[idx], gpts[idx]);
-               h = gpts[idx].height();
-               if(ossim::isnan(h)) h = 0.0;
-               gpts[idx].height(h + ELEVATION_DISPLACEMENT);
-               worldToLocal(gpts[idx], iptsDisplacement[idx]);
-               averageDelta = averageDelta + (iptsDisplacement[idx] - ipts[idx]);
-            }
-            
-            ossim_float64 averageLength = averageDelta.length();
-            if(averageLength < 1) return false;
-            
-            if(!ossim::almostEqual((double)0.0, (double)averageLength))
-            {
-               averageDelta = averageDelta/averageLength;
-            }
-            // RP - the rest of this calculation seems to be leading to less accurate results.  
-            // We already have the average image space displacement from raising the height for 9 points in the image 
-            // Just rotate based on this displacement, 
-            // scaling based on the image size distorts the direction of the up vector, leading to inaccurate results for non-square images
-            //
-            //ossimDpt averageLocation =  (ossimDpt(averageDelta.x*bounds.width(), 
-            //                                      averageDelta.y*bounds.height())+centerIpt) ;
-            //ossimGpt averageLocationGpt;
-            //ossimGpt centerGpt;
-            
-            //localToWorld(averageLocation, averageLocationGpt);
-            //localToWorld(ipts[0], centerGpt);
-            
-            ossimDpt deltaPt = averageDelta; //averageLocation - centerIpt; 
-            ossimDpt deltaUnitPt = deltaPt;
-            double len = deltaPt.length();
-            if(len > FLT_EPSILON)
-            {
-               deltaUnitPt  = deltaUnitPt/len;
-            }
-            
-            // Image space model positive y is down.  Let's reflect to positve y up.
-            deltaUnitPt.y *= -1.0; // Reflect y to be right handed.
-            
-            result = ossim::atan2d(deltaUnitPt.x, deltaUnitPt.y);
-            
-            //---
-            // We are essentially simulating camera rotation so negate the rotation
-            // value.
-            //---
-            result *= -1;
-            
-            if(result < 0) result += 360.0;
-            
-         }  // Matches: if( bounds.hasNans() == false )
-      }
-      else
-      {
-         result = 0;
-      }
-      
-   } // Matches: if ( m_projection.valid() && m_projection->isAffectedByElevation() )
-
-   return result;
-   
-} // End: ossimImageGeometry::upIsUpAngle()
-
-ossim_float64 ossimImageGeometry::northUpAngle()const
-{
-   ossim_float64 result = ossim::nan();
-
-   if ( m_projection.valid() )
-   {
-      ossimDrect bounds;
-      getBoundingRect( bounds );
-      
-      if( !bounds.hasNans() )
-      {
-         ossimDpt centerIpt = bounds.midPoint();
-
-         ossimDpt midBottomIpt( centerIpt.x, bounds.lr().y );
-         ossimDpt midTopIpt( centerIpt.x, bounds.ul().y );
-
-         ossimGpt midBottomGpt;
-         ossimGpt midTopGpt;
-         
-         localToWorld( midBottomIpt, midBottomGpt );
-         localToWorld( midTopIpt, midTopGpt );
-
-         if ( !midBottomGpt.hasNans() && !midTopGpt.hasNans() )
-         {
-            result = midBottomGpt.azimuthTo( midTopGpt );
-
-            if(result < 0) result += 360.0;
-         }
-      }
-      
-   } // Matches: if ( m_projection.valid() )
-
-   return result;
-   
-} // End: ossimImageGeometry::northUpAngle()
-
diff --git a/ossim/src/ossim/imaging/ossimImageGeometryFactory.cpp b/ossim/src/ossim/imaging/ossimImageGeometryFactory.cpp
deleted file mode 100644
index 58c7fde..0000000
--- a/ossim/src/ossim/imaging/ossimImageGeometryFactory.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-//*****************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class implementation of ossimImageGeometryFactory.
-// See .h file for class documentation.
-//
-//*****************************************************************************
-// $Id$
-#include <ossim/imaging/ossimImageGeometryFactory.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossim2dTo2dShiftTransform.h>
-#include <ossim/imaging/ossimNitfTileSource.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/support_data/ossimNitfIchipbTag.h>
-#include <ossim/support_data/ossimNitfStdidcTag.h>
-#include <ossim/projection/ossimSensorModel.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossim2dTo2dTransformRegistry.h>
-
-ossimImageGeometryFactory* ossimImageGeometryFactory::m_instance = 0;
-
-ossimImageGeometryFactory::ossimImageGeometryFactory()
-{
-   m_instance = this;
-}
-
-ossimImageGeometryFactory* ossimImageGeometryFactory::instance()
-{
-   if(!m_instance)
-   {
-      m_instance = new ossimImageGeometryFactory();
-   }
-   
-   return m_instance;
-}
-
-ossimImageGeometry* ossimImageGeometryFactory::createGeometry(
-   const ossimString& typeName)const
-{
-   if(typeName == "ossimImageGeometry")
-   {
-      return new ossimImageGeometry();
-   }
-   
-   return 0;
-}
-
-ossimImageGeometry* ossimImageGeometryFactory::createGeometry(
-   const ossimKeywordlist& kwl, const char* prefix)const
-{
-   ossimRefPtr<ossimImageGeometry> result = 0;
-   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   if(!type.empty())
-   {
-      result = createGeometry(type);
-      if(result.valid()&&!result->loadState(kwl, prefix))
-      {
-         result = 0;
-      }
-   }
-   
-   return result.release();
-}
-
-ossimImageGeometry* ossimImageGeometryFactory::createGeometry(
-   const ossimFilename& /* filename */, ossim_uint32 /* entryIdx */)const
-{
-   // currently don't support this option just yet by this factory
-   return 0;
-}
-
-bool ossimImageGeometryFactory::extendGeometry(ossimImageHandler* handler)const
-{
-   bool result = false;
-   if (handler)
-   {
-      bool add2D = true;
-      ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-      if(geom.valid())
-      {
-         if(!geom->getProjection())
-         {
-            geom->setProjection(createProjection(handler));
-            result = geom->hasProjection();
-         }
-         if(geom->getProjection())
-         {
-            if( !(dynamic_cast<ossimSensorModel*>(geom->getProjection())))
-            {
-               add2D = false;
-            }
-         }
-         if(!geom->getTransform()&&add2D)
-         {
-            geom->setTransform(createTransform(handler));
-            result |= geom->hasTransform();
-        }
-      }
-   }
-   return result;
-}
-
-void ossimImageGeometryFactory::getTypeNameList(
-   std::vector<ossimString>& typeList)const
-{
-   typeList.push_back("ossimImageGeometry");
-}
-
-ossim2dTo2dTransform* ossimImageGeometryFactory::createTransform(
-   ossimImageHandler* handler)const
-{
-   // Currently nothing to do...
-   
-   ossimRefPtr<ossim2dTo2dTransform> result = 0;
-   
-   ossimNitfTileSource* nitf = dynamic_cast<ossimNitfTileSource*> (handler);
-   
-   if(nitf)
-   {
-      result = createTransformFromNitf(nitf);
-   }
-   
-   return result.release();
-}
-
-ossimProjection* ossimImageGeometryFactory::createProjection(
-   ossimImageHandler* handler) const
-{
-   ossimRefPtr<ossimProjection> result =
-      ossimProjectionFactoryRegistry::instance()->createProjection(handler);
-
-   return result.release();
-}
-
-ossim2dTo2dTransform* ossimImageGeometryFactory::createTransformFromNitf(ossimNitfTileSource* nitf)const
-{
-   ossim2dTo2dTransform* result = 0;
-   
-   ossimRefPtr<ossimNitfImageHeader> hdr = nitf->getCurrentImageHeader();
-   if (!hdr)
-   {
-      return result;
-   }
-   
-   //---
-   // Test for the ichipb tag and set the sub image if needed.
-   // 
-   // NOTE # 1:
-   // 
-   // There are nitf writers that set the ichipb offsets and only have
-   // IGEOLO field present.  For these it has been determined
-   // (but still in question) that we should not apply the sub image offset.
-   //
-   // See trac # 1578
-   // http://trac.osgeo.org/ossim/ticket/1578
-   //
-   // NOTE # 2:
-   //
-   // Let the ICHIPB have precedence over the STDIDC tag as we could have a
-   // chip of a segment.
-   //---
-   ossimRefPtr<ossimNitfRegisteredTag> tag =
-   hdr->getTagData(ossimString("ICHIPB"));
-   if (tag.valid())
-   {
-      ossimNitfIchipbTag* ichipb = PTR_CAST(ossimNitfIchipbTag, tag.get());
-      if (ichipb)
-      {
-//         const ossimRefPtr<ossimNitfRegisteredTag> blocka =
-//         hdr->getTagData(ossimString("BLOCKA"));
-//         const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
-//         hdr->getTagData(ossimString("RPC00A"));              
-//         const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
-//         hdr->getTagData(ossimString("RPC00B"));
-         
-         //---
-         // If any of these tags are present we will use the sub image from
-         // the ichipb tag.
-         //---
-//         if ( blocka.get() || rpc00a.get() || rpc00b.get() )
-         
-         // ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE.  GO AHEAD AND ALWAYS INIT THE SHIFT
-         {
-            result = ichipb->newTransform();
-         }
-      }
-   }
-   
-   if ( !result)
-   {
-      //---
-      // Look for the STDIDC tag for a sub image (segment) offset.
-      //
-      // See: STDI-002 Table 7.3 for documentation.
-      //---
-      tag = hdr->getTagData(ossimString("STDIDC"));
-      if (tag.valid() && (hdr->getIMode() == "B") )
-      {
-         ossimDpt shift;
-         ossimNitfStdidcTag* stdidc = PTR_CAST(ossimNitfStdidcTag, tag.get());
-         if (stdidc)
-         {
-            ossim_int32 startCol = stdidc->getStartColumn().toInt32();
-            ossim_int32 startRow = stdidc->getStartRow().toInt32();
-            if ( (startCol > 0) && (startRow > 0) )
-            {
-               
-               // field are one based; hence, the - 1.
-               shift.x = (startCol-1) * hdr->getNumberOfPixelsPerBlockHoriz();
-               shift.y = (startRow-1) * hdr->getNumberOfPixelsPerBlockVert();
-            }
-            if(shift.x > 0 ||
-               shift.y > 0)
-            {
-               result = new ossim2dTo2dShiftTransform(shift);
-            }
-         }
-      }
-   }
-   
-   return result;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimImageGeometryRegistry.cpp b/ossim/src/ossim/imaging/ossimImageGeometryRegistry.cpp
deleted file mode 100644
index 89027e1..0000000
--- a/ossim/src/ossim/imaging/ossimImageGeometryRegistry.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//**************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Class implementation of ossimImageGeometryRegistry. See .h file for class documentation.
-//
-//**************************************************************************************************
-// $Id$
-#include <ossim/imaging/ossimImageGeometryRegistry.h>
-#include <ossim/imaging/ossimImageGeometryFactory.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-ossimImageGeometryRegistry* ossimImageGeometryRegistry::m_instance = 0;
-RTTI_DEF1(ossimImageGeometryRegistry, "ossimImageGeometryRegistry", ossimImageGeometryFactoryBase);
-ossimImageGeometryRegistry* ossimImageGeometryRegistry::instance()
-{
-   if(!m_instance)
-   {
-      m_instance = new ossimImageGeometryRegistry();
-      m_instance->registerFactory(ossimImageGeometryFactory::instance());
-      ossimObjectFactoryRegistry::instance()->registerFactory(m_instance);
-   }
-   
-   return m_instance;
-}
-
-bool ossimImageGeometryRegistry::extendGeometry(ossimImageHandler* handler)const
-{
-   bool result = false;
-   ossim_uint32 idx = 0;
-   for(;((idx < m_factoryList.size())&&!result); ++idx)
-   {
-      result = m_factoryList[idx]->extendGeometry(handler);
-   }
-   
-   return result;
-}
-
-ossimImageGeometry* ossimImageGeometryRegistry::createGeometry(const ossimString& typeName)const
-{
-   ossimRefPtr<ossimObject> obj = createObjectFromRegistry(typeName);
-   
-   ossimRefPtr<ossimImageGeometry> geomResult = dynamic_cast<ossimImageGeometry*>(obj.get());
-   
-   obj = 0;
-   
-   return geomResult.release();
-}
-
-ossimImageGeometry* ossimImageGeometryRegistry::createGeometry(const ossimKeywordlist& kwl,
-                                                               const char* prefix)const
-{
-   ossimRefPtr<ossimObject> obj = createObjectFromRegistry(kwl, prefix);
-   
-   ossimRefPtr<ossimImageGeometry> geomResult = dynamic_cast<ossimImageGeometry*>(obj.get());
-   
-   obj = 0;
-   
-   return geomResult.release();
-}
-
-ossimImageGeometry* ossimImageGeometryRegistry::createGeometry(const ossimFilename& filename,
-                                                                       ossim_uint32 entryIdx)const
-{
-   ossimImageGeometry* result = 0;
-   ossim_uint32 idx = 0;
-   for(;((idx < m_factoryList.size())&&!result); ++idx)
-   {
-      result = m_factoryList[idx]->createGeometry(filename, entryIdx);
-   }
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageHandler.cpp b/ossim/src/ossim/imaging/ossimImageHandler.cpp
deleted file mode 100644
index 4a24e5b..0000000
--- a/ossim/src/ossim/imaging/ossimImageHandler.cpp
+++ /dev/null
@@ -1,1689 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// This class defines an abstract image handler which all loaders should
-// derive from.
-//
-//*******************************************************************
-//  $Id: ossimImageHandler.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimContainerEvent.h>
-#include <ossim/base/ossimEventIds.h>
-#include <ossim/base/ossimFilenameProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageGeometryRegistry.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/imaging/ossimTiffOverviewBuilder.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <algorithm>
-
-RTTI_DEF1(ossimImageHandler, "ossimImageHandler", ossimImageSource)
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimImageHandler:debug");
-
-// Property keywords.
-static const char HAS_LUT_KW[]                 = "has_lut";
-static const char OPEN_OVERVIEW_FLAG_KW[]      = "open_overview_flag";
-static const char START_RES_LEVEL_KW[]         = "start_res_level";
-static const char SUPPLEMENTARY_DIRECTORY_KW[] = "supplementary_directory";
-static const char VALID_VERTICES_FILE_KW[]     = "valid_vertices_file";
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimImageHandler.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-
-// GARRETT! All of the decimation factors are scattered throughout. We want to fold that into 
-// the image geometry object. The code is ready in ossimImageGeometry for this (more or less), but
-// the ossimImageGeometry::m_decimationFactors is not being set nor referenced. Can you do this?
-// I'm a little foggy on how we want to incorporate R-level scaling into the geometry object.
-   
-ossimImageHandler::ossimImageHandler()
-:
-ossimImageSource(0, 0, 0, true, false /* output list is not fixed */ ),
-theImageFile(ossimFilename::NIL),
-theOverviewFile(ossimFilename::NIL),
-theSupplementaryDirectory(ossimFilename::NIL),
-theOverview(0),
-theValidImageVertices(0),
-theMetaData(),
-theGeometry(),
-theLut(0),
-theDecimationFactors(0),
-theImageID(""),
-theStartingResLevel(0),
-theOpenOverviewFlag(true),
-thePixelType(OSSIM_PIXEL_IS_POINT)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageHandler::ossimImageHandler() DEBUG:" << std::endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  "
-         << OSSIM_ID
-         << std::endl;
-#endif      
-   }
-}
-
-ossimImageHandler::~ossimImageHandler()
-{
-   theOverview = 0;
-}
-
-void ossimImageHandler::initialize()
-{
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimImageHandler::saveState(ossimKeywordlist& kwl,
-                                  const char* prefix) const
-{
-   static const char MODULE[] = "ossimImageHandler::saveState";
-
-   ossimImageSource::saveState(kwl, prefix);
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE
-         << " ERROR detected in keyword list!  State not saved."
-         << std::endl;
-      return false;
-   }
-
-   kwl.add(prefix, ossimKeywordNames::FILENAME_KW, theImageFile.c_str(), true);
-   kwl.add(prefix, HAS_LUT_KW, (theLut.valid()?"true":"false"), true);
-   kwl.add(prefix, ossimKeywordNames::IMAGE_ID_KW, theImageID, true);
-   kwl.add(prefix, ossimKeywordNames::OVERVIEW_FILE_KW, theOverviewFile.c_str(), true);
-   kwl.add(prefix, SUPPLEMENTARY_DIRECTORY_KW, theSupplementaryDirectory.c_str(), true);
-   kwl.add(prefix, START_RES_LEVEL_KW, theStartingResLevel, true);
-   kwl.add(prefix, OPEN_OVERVIEW_FLAG_KW, (theOpenOverviewFlag?"1":"0"), true);
-   kwl.add(prefix, ossimKeywordNames::PIXEL_TYPE_KW, (ossim_uint16) thePixelType, true);
-
-   return true;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimImageHandler::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix)
-{
-   static const char MODULE[] = "ossimImageHandler::loadState(kwl, prefix)";
-   theDecimationFactors.clear();
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: entered ..."
-         << std::endl;
-   }
-   
-   ossimImageSource::loadState(kwl, prefix);
-   
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE
-         << "WARNING: error detected in keyword list!  State not load."
-         << std::endl;
-      
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG: "
-            << "leaving with error in kwl ..." << std::endl;
-      }
-      return false;
-   }
-   
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   if (!lookup)
-   {
-      // Deprecated...
-      lookup = kwl.find(prefix, ossimKeywordNames::IMAGE_FILE_KW);
-   }
-   
-   if (lookup)
-   {
-      theImageFile = lookup;
-   }
-   
-   lookup = kwl.find(prefix, ossimKeywordNames::OVERVIEW_FILE_KW);
-   if(lookup)
-   {
-      theOverviewFile = ossimFilename(lookup);
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG:\n"
-         << "filename = " << theImageFile << std::endl;
-   }
-   
-   // Check for an external geometry file to initialize our image geometry object:
-   lookup = kwl.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
-   if (lookup)
-   {
-      ossimKeywordlist geomKwl;
-      if (geomKwl.addFile(lookup) == true)
-      {
-         theGeometry = new ossimImageGeometry;
-         theGeometry->loadState(geomKwl);
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << MODULE << " DEBUG:"
-               << "Loaded external geometry file:  "
-               << lookup
-               << "\n" << geomKwl << std::endl;
-         }
-      }
-   }
-   
-   // Check for an valid image vetices file.
-   lookup = kwl.find(prefix, VALID_VERTICES_FILE_KW);
-   if (lookup)
-   {
-      initVertices(lookup);
-   }
-
-   // Starting resolution level.
-   lookup = kwl.find(prefix, START_RES_LEVEL_KW);
-   if (lookup)
-   {
-      theStartingResLevel = ossimString(lookup).toUInt32();
-   }
-
-   // Open overview flag.
-   lookup = kwl.find(prefix, OPEN_OVERVIEW_FLAG_KW);
-   if (lookup)
-   {
-      setOpenOverviewFlag( ossimString(lookup).toBool() );
-   }
-
-   // The supplementary directory for finding the overview
-   lookup = kwl.find(prefix, SUPPLEMENTARY_DIRECTORY_KW);
-   if (lookup)
-   {
-      theSupplementaryDirectory = ossimFilename(lookup);
-   }
-
-   if(getNumberOfInputs())
-   {
-      theInputObjectList.clear();
-   }
-   theInputListIsFixedFlag = true;
-   
-   // Read image id if present:
-   theImageID = kwl.find(prefix, ossimKeywordNames::IMAGE_ID_KW);
-
-   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
-   if (lookup)
-   {
-      thePixelType = (ossimPixelType) atoi(lookup);
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: Leaving Ok ..."
-         << std::endl;
-   }
-   return true;
-}
-
-bool ossimImageHandler::initVertices(const char* file)
-{
-   static const char MODULE[] = "ossimImageHandler::initVertices";
-
-   ossimFilename f = file;
-   if (!f.exists()) return false;
-
-   ossimKeywordlist kwl(file);
-   
-   if (kwl.getErrorStatus() != ossimErrorCodes::OSSIM_OK)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimImageHandler::initVertices NOTICE:"
-            << "\nError reading valid vertice file:  " << file << std::endl;
-      }
-      return false;
-   }
-
-   // Clean out any old vertices...
-   theValidImageVertices.clear();
-
-   ossim_uint32 number_of_points = kwl.numberOf("point", "x");
-
-   for (ossim_uint32 i=0; i<number_of_points; ++i)
-   {
-      ossimIpt pt;
-      const char* lookup;
-      ossimString p = "point";
-      p += ossimString::toString(i);
-      
-      ossimString px = p + ".x";
-      lookup = kwl.find(px.c_str());
-      if (lookup)
-      {
-         pt.x = atoi(lookup);
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            CLOG << " ERROR:"
-                 << "\nlookup failed for:  " << px.c_str()
-                 << "\nReturning..."
-                 << std::endl;
-         }
-         return false;
-      }
-         
-      ossimString py = p + ".y";
-      lookup = kwl.find(py.c_str());
-      if (lookup)
-      {
-         pt.y = atoi(lookup);
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            CLOG << " ERROR:"
-                 << "\nLookup failed for:  " << py.c_str()
-                 << "\nReturning..."
-                 << std::endl;
-         }
-         return false;
-      }
-
-      theValidImageVertices.push_back(pt);
-   }
-
-   
-   if (traceDebug())
-   {
-      CLOG << " DEBUG:"
-           << "\nVertices file:  " << f
-           << "\nValid image vertices:"
-           << std::endl;
-      for (ossim_uint32 i=0; i<theValidImageVertices.size(); ++i)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "\npoint[" << i << "]:  " << theValidImageVertices[i];
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG) << std::endl;
-   }
-   
-   return true;
-}
-
-ossim_uint32 ossimImageHandler::getNumberOfDecimationLevels() const
-{
-   ossim_uint32 result = 1; // Add r0
-   if (theOverview.valid())
-   {
-      result += theOverview->getNumberOfDecimationLevels();
-   }
-   return result;
-}
-
-ossim_uint32 ossimImageHandler::getNumberOfReducedResSets() const
-{
-   return getNumberOfDecimationLevels();
-}
-
-ossimIrect ossimImageHandler::getImageRectangle(ossim_uint32 resLevel) const
-{
-   ossimIrect result;
-   
-   if( isOpen() && isValidRLevel(resLevel) )
-   {
-      ossim_int32 lines   = getNumberOfLines(resLevel);
-      ossim_int32 samples = getNumberOfSamples(resLevel);
-      if( !lines || !samples )
-      {
-         result.makeNan();
-      }
-      else
-      {
-         result = ossimIrect(0, 0, samples-1, lines-1);
-      }
-   }
-   else
-   {
-      result.makeNan();
-   }
-
-   return result;
-}
-
-ossimIrect ossimImageHandler::getBoundingRect(ossim_uint32 resLevel) const
-{
-   return getImageRectangle(resLevel);
-}
-
-
-void ossimImageHandler::getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const
-{
-   if (resLevel < theDecimationFactors.size())
-      result = theDecimationFactors[resLevel];
-   else
-      result.makeNan();
-}
-
-void ossimImageHandler::getDecimationFactors(vector<ossimDpt>& decimations) const
-{
-   decimations = theDecimationFactors;
-}
-
-//*************************************************************************************************
-// Method determines the decimation factors at each resolution level. This
-// base class implementation computes the decimation by considering the ratios in image size
-// between resolution levels, with fuzzy logic for rounding ratios to the nearest power of 2
-// if possible. Derived classes need to override this method if the decimations are provided
-// as part of the image metadata. In some cases (cf. ossimNitfTileSource), the derived class can
-// set the first R-level (R0) decimation in the case that it is not unity, and then invoke this
-// base class implementation to compute remaining R-levels, respecting the R0 decimation previously
-// set by derived class.
-//*************************************************************************************************
-void ossimImageHandler::establishDecimationFactors() 
-{
-   double line_decimation, samp_decimation, decimation, ratio;
-   ossim_uint32 num_lines, num_samps;
-   
-   // The error margin here is effectively the percent error tolerated between ideal number of 
-   // pixels for given power-of-2 decimation, and the actual number of pixels found at this 
-   // decimation level. Typically, the last level will have fewer pixels than expected, hence the 
-   // need for this logic...
-   static const double ERROR_MARGIN = 1.1;  // 10% allowance
-
-   // NOTE -- Until the end of this method, all decimation values are actually inverse quantities,
-   // i.e., a decimation of 0.5 typical for rlevel 1 is represented here as 2. This facilitates the
-   // fuzzy logic for recognizing powers of 2 (as integers)
-
-   // Default implementation assumes R0 is not decimated. Check for R0 defined by derived class
-   // however, in case this is not the case:
-   ossimDpt decimation_r0 (1.0, 1.0);
-   if (theDecimationFactors.size() > 0)
-   {
-      decimation_r0.x = 1.0/theDecimationFactors[0].x; // note use of inverse decimation
-      decimation_r0.y = 1.0/theDecimationFactors[0].y; 
-   }
-   else
-      theDecimationFactors.push_back(decimation_r0);
-
-   // Variables used in loop below:
-   ossim_uint32 num_lines_r0 = getNumberOfLines(0);
-   ossim_uint32 num_samps_r0 = getNumberOfSamples(0);
-   ossim_uint32 power_of_2_decimation = (ossim_uint32) decimation_r0.x;
-
-   // Remaining res levels are computed as a ratio of image size at R0 to image size at Rn:
-   ossim_uint32 nRlevels = getNumberOfDecimationLevels();
-   for(ossim_uint32 res_level = 1; res_level < nRlevels; ++res_level)
-   {
-      num_lines = getNumberOfLines(res_level);
-      num_samps = getNumberOfSamples(res_level);
-      
-      if ((num_lines < 2) || (num_samps < 2)) 
-         break;
-
-      line_decimation = decimation_r0.y * num_lines_r0 / (double)num_lines;
-      samp_decimation = decimation_r0.x * num_samps_r0 / (double)num_samps;
-      decimation = line_decimation<samp_decimation ? line_decimation:samp_decimation;
-
-      // Check for possible error due to inexact ratios.
-      // Loop until reasonable effort was made to establish the corresponding power-of-2 decimation.
-      // If close match is found, the exact integer value is assigned:
-      do 
-      {
-         power_of_2_decimation *= 2;
-         ratio = (double)power_of_2_decimation / decimation;
-         if (ratio < 1.0)
-            ratio = 1.0/ratio;
-         if (ratio < ERROR_MARGIN)
-            decimation = (double) power_of_2_decimation;
-
-      } while ((double) power_of_2_decimation < decimation);
-
-      // Convert the computed decimation back to fractional form before saving in the factors list:
-      decimation = 1.0/decimation;
-      theDecimationFactors.push_back(ossimDpt(decimation, decimation));
-   }
-}
-
-
-bool ossimImageHandler::buildHistogram(int numberOfRLevels)
-{
-   if(isOpen())
-   {
-      ossimFilename file =
-         getFilenameWithThisExtension(ossimString(".his"));
-      
-      ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
-      ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
-      
-      if(numberOfRLevels)
-      {
-         histoSource->setMaxNumberOfRLevels(numberOfRLevels);
-      }
-      else
-      {
-         histoSource->setMaxNumberOfRLevels(getNumberOfDecimationLevels());
-      }
-      histoSource->connectMyInputTo(0, this);
-      histoSource->enableSource();
-      writer->connectMyInputTo(0, histoSource.get());
-      writer->setFilename(file);
-      writer->addListener(&theStdOutProgress);
-      writer->execute();
-      histoSource->disconnect();
-      writer->disconnect();
-      histoSource = 0;
-      writer = 0;
-   }
-   else
-   {
-      return false;
-   }
-   
-   return true;
-}
-
-bool ossimImageHandler::buildAllHistograms(int numberOfRLevels)
-{
-   ossim_uint32 currentEntry = getCurrentEntry();
-   std::vector<ossim_uint32> entryList;
-   getEntryList(entryList);
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < entryList.size(); ++idx)
-   {
-      setCurrentEntry(entryList[idx]);
-      if(!buildHistogram(numberOfRLevels))
-      {
-         setCurrentEntry(currentEntry);
-         return false;
-      }
-   }
-   
-   setCurrentEntry(currentEntry);
-   return true;
-}
-
-bool ossimImageHandler::buildOverview(ossimImageHandlerOverviewCompressionType compressionType,
-                                      ossim_uint32 quality,
-                                      ossimFilterResampler::ossimFilterResamplerType resampleType,
-                                      bool includeFullResFlag)
-{
-   ossimFilename file = getFilenameWithThisExtension(ossimString(".ovr"));
-
-   theOverviewFile = file;
-   if(buildOverview(file, compressionType, quality, resampleType, includeFullResFlag))
-   {
-      openOverview();
-   }
-
-   return true;
-}
-
-bool ossimImageHandler::buildAllOverviews(ossimImageHandlerOverviewCompressionType compressionType,
-                                          ossim_uint32 quality,
-                                          ossimFilterResampler::ossimFilterResamplerType resampleType,
-                                          bool includeFullResFlag)
-{
-   ossim_uint32 currentEntry = getCurrentEntry();
-   std::vector<ossim_uint32> entryList;
-   getEntryList(entryList);
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < entryList.size(); ++idx)
-   {
-      setCurrentEntry(entryList[idx]);
-      if(!buildOverview(compressionType, quality, resampleType, includeFullResFlag))
-      {
-         setCurrentEntry(currentEntry);
-         return false;
-      }
-   }
-   
-   setCurrentEntry(currentEntry);
-   return true;
-}
-
-
-bool ossimImageHandler::buildOverview(const ossimFilename& filename,
-                                      ossimImageHandlerOverviewCompressionType compressionType,
-                                      ossim_uint32 quality,
-                                      ossimFilterResampler::ossimFilterResamplerType resampleType,
-                                      bool includeFullResFlag)
-{
-   closeOverview();
-   if(!isOpen())
-   {
-      return false;
-   }
-
-   theOverviewFile = filename;
-   ossimTiffOverviewBuilder tiffBuilder;
-   if ( tiffBuilder.setInputSource(this) == false )
-   {
-      return false;
-   }
-   
-   ossim_uint16 cType = COMPRESSION_NONE;
-   switch(compressionType)
-   {
-      case OSSIM_OVERVIEW_COMPRESSION_NONE:
-      {
-         cType = COMPRESSION_NONE;
-         break;
-      }
-      case OSSIM_OVERVIEW_COMPRESSION_JPEG:
-      {
-         cType = COMPRESSION_JPEG;
-         break;
-      }
-      case OSSIM_OVERVIEW_COMPRESSION_LZW:
-      {
-         cType = COMPRESSION_LZW;
-         break;
-      }
-      case OSSIM_OVERVIEW_COMPRESSION_DEFLATE:
-      {
-
-         cType = COMPRESSION_DEFLATE;
-         break;
-      }
-      case OSSIM_OVERVIEW_COMPRESSION_PACKBITS:
-      {
-         cType = COMPRESSION_PACKBITS;
-         break;
-      }
-   }
-   tiffBuilder.setJpegCompressionQuality(quality);
-   tiffBuilder.setCompressionType(cType);
-   tiffBuilder.setResampleType(resampleType);
-   tiffBuilder.buildOverview(filename, includeFullResFlag);
-
-   return true;
-}
-
-//*****************************************************************************
-//! Returns the image geometry object associated with this tile source or
-//! NULL if non defined.
-//! The geometry contains full-to-local image transform as well as projection
-//! (image-to-world).
-//*****************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimImageHandler::getImageGeometry()
-{
-   if ( !theGeometry )
-   {
-      //---
-      // Check factory for external geom:
-      //---
-      theGeometry = getExternalImageGeometry();
-
-      if ( !theGeometry )
-      {
-         //---
-         // WARNING:
-         // Must create/set the geometry at this point or the next call to
-         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
-         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
-         //---
-         theGeometry = new ossimImageGeometry();
-
-         //---
-         // And finally allow factories to extend the internal geometry.
-         // This allows plugins for tagged formats with tags not know in the base
-         // to extend the internal geometry.
-         //
-         // Plugins can do handler->getImageGeometry() then modify/extend.
-         //---
-         if(!ossimImageGeometryRegistry::instance()->extendGeometry( this ))
-         {
-            //---
-            // Check for internal, for geotiff, nitf and so on as last resort for getting some
-            // kind of geometry loaded
-            //---
-            theGeometry = getInternalImageGeometry();
-         }
-      }
-
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-   }
-   return theGeometry;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimImageHandler::getExternalImageGeometry() const
-{
-   ossimRefPtr<ossimImageGeometry> geom = 0;
-
-   // No geometry object has been set up yet. Check for external geometry file.
-   // Try "foo.geom" if image is "foo.tif":
-   ossimFilename filename = getFilenameWithThisExtension(ossimString(".geom"), false);
-   if(!filename.exists())
-   {
-      // Try "foo_e0.tif" if image is "foo.tif" where "e0" is entry index.
-      filename = getFilenameWithThisExtension(ossimString(".geom"), true);
-   }
-   if(!filename.exists())
-   {
-      // Try supplementary data directory for remote geometry:
-      filename = getFilenameWithThisExtension(ossimString(".geom"), false);
-      filename = theSupplementaryDirectory.dirCat(filename.file());
-   }
-   if(!filename.exists())
-   {
-      // Try supplementary data directory for remote geometry with entry index:
-      filename = getFilenameWithThisExtension(ossimString(".geom"), true);
-      filename = theSupplementaryDirectory.dirCat(filename.file());
-   }
-
-   if(filename.exists())
-   {
-      // Open the geom file as a KWL and initialize our geometry object:
-      filename = filename.expand();
-      ossimKeywordlist geomKwl(filename);
-
-      // Try loadState with no prefix.
-      std::string prefix = "";
-      std::string key = ossimKeywordNames::TYPE_KW;
-      std::string value = geomKwl.findKey(prefix, key);
-
-      if ( value.empty() || (value != "ossimImageGeometry") )
-      {
-         // Try with "image0." type prefix.
-         prefix += std::string("image") + ossimString::toString(getCurrentEntry()).string() +
-            std::string(".");
-         value = geomKwl.findKey(prefix, key);
-         
-         if ( value.empty() || (value != "ossimImageGeometry") )
-         {
-            // Try with "image0.geometry." prefix.
-            prefix += std::string( "geometry." );
-            value = geomKwl.findKey(prefix, key);
-            
-            if ( value.empty() || (value != "ossimImageGeometry") )
-            {
-               // Try with "geometry." prefix.
-               prefix = std::string( "geometry." );
-               value = geomKwl.findKey(prefix, key);
-            }
-         }
-      }
-      
-      if ( value == "ossimImageGeometry" )
-      {
-         geom = new ossimImageGeometry;
-         if( !geom->loadState(geomKwl, prefix.c_str()) )
-         {
-            geom = 0;
-         }
-      }
-   }
-   
-   return geom;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimImageHandler::getInternalImageGeometry() const
-{
-   // Default, derived classes should override.
-   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
-   return geom;
-}
-
-void ossimImageHandler::setImageGeometry( ossimImageGeometry* geom)
-{
-   theGeometry = geom;
-}
-
-void ossimImageHandler::saveImageGeometry() const
-{
-   ossimFilename geometryFile = getFilenameWithThisExtension(ossimString(".geom"));
-   saveImageGeometry(geometryFile);
-}
-
-void ossimImageHandler::saveImageGeometry(const ossimFilename& geometry_file) const
-{
-   if (theGeometry.valid())
-   {
-      ossimKeywordlist kwl;
-      theGeometry->saveState(kwl);
-      kwl.write(geometry_file.chars());
-   }
-}
-
-void ossimImageHandler::closeOverview()
-{
-   theOverview = 0;
-}
-
-const ossimImageHandler* ossimImageHandler::getOverview() const
-{
-   return theOverview.get();
-}
-
-bool ossimImageHandler::hasOverviews() const
-{
-   return (getNumberOfDecimationLevels() > 1);
-}
-
-bool ossimImageHandler::openOverview(const ossimFilename& overview_file)
-{
-   bool result = false;
-   
-   closeOverview();
-
-   if (overview_file != theImageFile) // Make sure we don't open ourselves.
-   {
-      //---
-      // Get the number of level before the call to opening the overview so
-      // the overview can be told what it's starting res level is.
-      //---
-      ossim_uint32 overviewStartingResLevel = getNumberOfDecimationLevels();
-
-
-      // Try to open:
-      theOverview = ossimImageHandlerRegistry::instance()->openOverview( overview_file );
-
-      if (theOverview.valid())
-      {
-         result = true;
-         
-         //---
-         // Set the owner in case the overview reader needs to get something
-         // from the it like min/max/null.
-         //---
-         theOverview->changeOwner(this);
-         
-         // Set the starting res level of the overview.
-         theOverview->setStartingResLevel(overviewStartingResLevel);
-         
-         // Capture the file name.
-         theOverviewFile = overview_file;
-
-         //---
-         // Some overview handlers cannot store what the null is.  Like dted
-         // null is -32767 not default -32768 so this allows passing this to the
-         // overview reader provided it overrides setMin/Max/NullPixel value
-         // methods. (drb)
-         //---
-         const ossim_uint32 BANDS = getNumberOfOutputBands();
-         for (ossim_uint32 band = 0; band < BANDS; ++band)
-         {
-            theOverview->setMinPixelValue(band, getMinPixelValue(band));
-            theOverview->setMaxPixelValue(band, getMaxPixelValue(band));
-            theOverview->setNullPixelValue(band, getNullPixelValue(band));
-         }
-
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "overview starting res level: " << overviewStartingResLevel
-               << "\noverview levels: "
-               << theOverview->getNumberOfDecimationLevels()
-               << "\nlevels: " << getNumberOfDecimationLevels()
-               << endl;
-         }
-         
-         //---
-         // This is not really a container event; however, using for now.
-         //---
-         ossimContainerEvent event(this,
-                                   OSSIM_EVENT_ADD_OBJECT_ID);
-         event.setObjectList(theOverview.get());
-         fireEvent(event);
-      }
-   }
-   
-   return result;
-}
-
-bool ossimImageHandler::openOverview()
-{
-   closeOverview();
-   
-   // 1) ESH 03/2009 -- Use the overview file set e.g. using a .spec file.
-   ossimFilename overviewFilename = getOverviewFile();
-   
-   if (overviewFilename.empty() || (overviewFilename.exists() == false) )
-   {
-      // 2) Generate the name from image name.
-      overviewFilename = createDefaultOverviewFilename();
-      
-      if (overviewFilename.empty() || (overviewFilename.exists() == false) )
-      {  
-         // 3) For backward compatibility check if single entry and _e0.ovr
-         overviewFilename = getFilenameWithThisExtension(ossimString(".ovr"), true);
-         if (overviewFilename.empty() || (overviewFilename.exists() == false) )
-         {
-            // 4) For overviews built with gdal look for foo.tif.ovr
-            overviewFilename = getFilename();
-            overviewFilename += ".ovr";
-         }
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "Looking for " << overviewFilename
-         << " overview file..." << std::endl;
-   }
-
-   bool status = false;
-   
-   if ( overviewFilename.exists() )
-   {
-      status = openOverview( overviewFilename );
-   }
-
-   if ( !status  && traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageHandler::openOverview NOTICE:"
-         << "\nCould not find an overview." << std::endl;
-   }
-
-   return status;
-}
-
-
-bool ossimImageHandler::writeValidImageVertices(const std::vector<ossimIpt>& vertices, const ossimFilename& file)
-{
-   ossimFilename tempFile = file;
-   if(tempFile == "")
-   {
-      tempFile = createDefaultValidVerticesFilename();
-   }
-   ossim_uint32 i = 0;
-   ossimKeywordlist tempKwl;
-   ossimPolygon poly(vertices);
-   
-   poly.checkOrdering();
-
-   // Capture the vertices.
-   theValidImageVertices = vertices;
-   
-   if(poly.getOrdering() == OSSIM_COUNTERCLOCKWISE_ORDER)
-   {
-      std::reverse(theValidImageVertices.begin(), theValidImageVertices.end());
-   }
-   
-   if(theValidImageVertices.size())
-   {
-      for(i = 0; i < theValidImageVertices.size(); ++i)
-      {
-         ossimString prefix = ossimString("point") + ossimString::toString(i) + ".";
-         tempKwl.add(prefix.c_str(),
-                     "x",
-                     theValidImageVertices[i].x,
-                     true);
-	 tempKwl.add(prefix.c_str(),
-                     "y",
-                     theValidImageVertices[i].y,
-                     true);
-      }
-      
-      tempKwl.write(tempFile.c_str());
-   }
-
-   if ( tempFile.exists() )
-   {
-      return true;
-   }
-
-   return false; // Write of file failed.
-}
-
-bool ossimImageHandler::openValidVertices(const ossimFilename& vertices_file)
-{
-   return initVertices(vertices_file);
-}
-
-bool ossimImageHandler::openValidVertices()
-{
-   ossimFilename vertices_file;
-   vertices_file = theImageFile.path();
-   vertices_file = vertices_file.dirCat(theImageFile.fileNoExtension());
-   if(getNumberOfEntries() > 1)
-   {
-      vertices_file += ossimString("_vertices") + "_e" + ossimString::toString(getCurrentEntry()) + ".kwl";
-   }
-   else
-   {
-      vertices_file += "_vertices.kwl";
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "Looking for " << vertices_file
-         << " vertices file..." << std::endl;
-   }
-
-   return openValidVertices(vertices_file);
-}
-
-bool ossimImageHandler::open(const ossimFilename& imageFile)
-{
-   if(isOpen())
-   {
-      close();
-   }
-
-   setFilename(imageFile);
-   
-   return open();
-}
-
-bool ossimImageHandler::open(const ossimFilename& imageFile,
-                             ossim_uint32 entryIndex)
-{
-   if(isOpen())
-   {
-      close();
-   }
-   setFilename(imageFile);
-   
-   bool result = open();
-
-   if(result)
-   {
-      return setCurrentEntry(entryIndex);
-   }
-
-   return result;
-}
-
-bool ossimImageHandler::isValidRLevel(ossim_uint32 resLevel) const
-{
-   bool result = false;
-   
-   const ossim_uint32 LEVELS = getNumberOfDecimationLevels();
-   
-   if ( !theStartingResLevel) // Not an overview.
-   {
-      result = (resLevel < LEVELS);
-   }
-   else  // Used as overview.
-   {
-      if (resLevel >= theStartingResLevel)
-      {
-         //---
-         // Adjust the res level to be zero based for this overview before
-         // checking.
-         //---
-         result = ( (resLevel - theStartingResLevel) < LEVELS);
-      }
-   }
-   
-   return result;
-}
-
-void ossimImageHandler::getValidImageVertices(vector<ossimIpt>& validVertices,
-                                              ossimVertexOrdering ordering,
-                                              ossim_uint32 resLevel) const
-{
-   ossimDpt decimation;
-   getDecimationFactor(resLevel, decimation);
-   if(decimation.hasNans())
-   {
-      return;
-   }
-   if (theValidImageVertices.size() != 0)
-   {
-      validVertices.clear();
-      for (ossim_uint32 i=0; i<theValidImageVertices.size(); ++i)
-      {
-         ossimIpt pt(ossim::round<int>(theValidImageVertices[i].x*decimation.x),
-                     ossim::round<int>(theValidImageVertices[i].y*decimation.y));
-         validVertices.push_back(pt);
-      }
-
-      if(ordering == OSSIM_COUNTERCLOCKWISE_ORDER)
-      {
-         std::reverse(validVertices.begin()+1, validVertices.end());
-      }
-   }
-   else
-   {
-      // Call the base class method which will set to bounding rectangle.
-      ossimImageSource::getValidImageVertices(validVertices, ordering, resLevel);
-   }
-}
-
-void ossimImageHandler::close()
-{
-   theOverview = 0;
-   theGeometry = 0;
-   theValidImageVertices.clear();
-   theDecimationFactors.clear();
-}
-
-bool ossimImageHandler::isBandSelector() const
-{
-   return false;
-}
-
-bool ossimImageHandler::setOutputBandList(const std::vector<ossim_uint32>& /* band_list */)
-{
-   return false;
-}
-
-bool ossimImageHandler::getRgbBandList(
-   std::vector<ossim_uint32>& /* bandList */) const
-{
-   return false;
-}
-
-bool ossimImageHandler::setOutputToInputBandList()
-{
-   bool result = false;
-   if ( isBandSelector() )
-   {
-      std::vector<ossim_uint32> bandList;
-      ossimImageSource::getOutputBandList( bandList );
-      result = setOutputBandList( bandList );
-   }
-   return result;
-}
-
-bool ossimImageHandler::isIdentityBandList( const std::vector<ossim_uint32>& bandList ) const
-{
-   bool result = false;
-   const ossim_uint32 BANDS = bandList.size();
-   if ( BANDS )
-   {
-      std::vector<ossim_uint32> inputList;
-      ossimImageSource::getOutputBandList( inputList ); // This populates an identity band list.
-
-      if ( inputList.size() == BANDS )
-      {
-         ossim_uint32 band = 0;
-         while ( band < BANDS )
-         {
-            if ( inputList[band] != bandList[band] )
-            {
-               break;
-            }
-            ++band;
-         }
-         if ( band == BANDS )
-         {
-            result = true;
-         }
-      }
-   }
-   return result;
-}
-
-// Protected convenience method:
-bool ossimImageHandler::setOutputBandList(const std::vector<ossim_uint32>& inBandList,
-                                          std::vector<ossim_uint32>& outBandList)
-{
-   bool result = false;
-
-   const ossim_uint32 INPUT_BANDS  = getNumberOfInputBands();
-   const ossim_uint32 OUTPUT_BANDS = inBandList.size();
-
-   if ( INPUT_BANDS && OUTPUT_BANDS )
-   {
-      result = true;
-      outBandList.resize( OUTPUT_BANDS );
-      for ( ossim_uint32 band = 0; band < OUTPUT_BANDS; ++band )
-      {
-         if ( inBandList[band] < INPUT_BANDS )
-         {
-            outBandList[band] = inBandList[band];
-         }
-         else // Out of range...
-         {
-            result = false;
-            break;
-         }
-      }
-      if ( result && theOverview.valid() )
-      {
-         result = theOverview->setOutputBandList( inBandList );
-      }
-   }
-
-   if ( result == false )
-   {
-      ossimImageSource::getOutputBandList( outBandList ); // Set to identity.
-   }
-
-   return result;
-}
-
-bool ossimImageHandler::isImageTiled() const
-{
-   return (getImageTileWidth() && getImageTileHeight());
-}
-
-void ossimImageHandler::loadMetaData()
-{
-  theMetaData.clear();
-
-  ossimFilename filename = getFilenameWithThisExtension(ossimString(".omd"), false);
-  if ( filename.exists() == false )
-  {
-     filename = getFilenameWithThisExtension(ossimString(".omd"), true);
-  }
-  if(filename.exists())
-  {
-     ossimKeywordlist kwl;
-     
-     kwl.addFile(filename.c_str());
-     
-     theMetaData.loadState(kwl);
-  }
-  else
-  {
-     theMetaData.setScalarType(getOutputScalarType());
-  }
-}
-
-double ossimImageHandler::getMinPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getMinPix(band);
-   }
-   return ossim::defaultMin(getOutputScalarType());
-}
-
-double ossimImageHandler::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getMaxPix(band);
-   }
-   return ossim::defaultMax(getOutputScalarType());
-}
-
-double ossimImageHandler::getNullPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getNullPix(band);
-   }
-   
-   return ossim::defaultNull(getOutputScalarType());
-}
-
-void ossimImageHandler::setMinPixelValue(ossim_uint32 band,
-                                         const ossim_float64& pix)
-{
-   theMetaData.setMinPix(band, pix);
-}
-
-void ossimImageHandler::setMaxPixelValue(ossim_uint32 band,
-                                         const ossim_float64& pix)
-{
-   theMetaData.setMaxPix(band, pix); 
-}
-
-void ossimImageHandler::setNullPixelValue(ossim_uint32 band,
-                                          const ossim_float64& pix)
-{
-   theMetaData.setNullPix(band, pix);  
-}
-
-ossim_uint32 ossimImageHandler::getCurrentEntry()const
-{
-   return 0;
-}
-
-bool ossimImageHandler::setCurrentEntry(ossim_uint32 /* entryIdx */)
-{
-   return true;
-}
-
-ossimFilename ossimImageHandler::getOverviewFile()const
-{
-   return theOverviewFile;
-}
-
-void ossimImageHandler::getEntryList(std::vector<ossim_uint32>& entryList)const
-{
-   entryList.push_back(0);
-}
-
-bool ossimImageHandler::useEntryIndex() const
-{
-   bool result = false;
-   if ( isOpen() )
-   {
-      std::vector<ossim_uint32> entryList;
-      getEntryList(entryList);
-
-      if ( entryList.size() )
-      {
-         if ( (entryList.size() > 1) || (entryList[0] != 0) ) result = true;
-      }
-   }
-   return result;
-}
-
-ossim_uint32 ossimImageHandler::getNumberOfEntries()const
-{
-   std::vector<ossim_uint32> tempList;
-   getEntryList(tempList);
-   
-   return (ossim_uint32)tempList.size();
-}
-
-void ossimImageHandler::getEntryNames(std::vector<ossimString>& entryStringList) const
-{
-   entryStringList.clear();
-}
-
-void ossimImageHandler::getEntryName( ossim_uint32 entryIdx, std::string& name ) const
-{
-   name = "";
-   std::vector<ossimString> entryNames;
-   getEntryNames(entryNames);
-   if (entryIdx < entryNames.size())
-      name = entryNames[entryIdx].string();
-}
-
-void ossimImageHandler::completeOpen()
-{
-   loadMetaData();
-   if ( theOpenOverviewFlag )
-   {
-      openOverview();
-   }
-   establishDecimationFactors();
-   openValidVertices();
-}
-
-bool ossimImageHandler::canConnectMyInputTo(ossim_int32 /* inputIndex */,
-                                            const ossimConnectableObject* /* object */)const
-{      
-   return false;
-}
-
-bool ossimImageHandler::hasMetaData()const
-{
-   return theMetaData.isValid();
-}
-
-void ossimImageHandler::setFilename(const ossimFilename& filename)
-{
-   theImageFile = filename;
-}
-
-const ossimFilename& ossimImageHandler::getFilename()const
-{
-   return theImageFile;
-}
-
-void ossimImageHandler::setSupplementaryDirectory(const ossimFilename& dir)
-{
-   if (dir.isDir())
-      theSupplementaryDirectory = dir;
-   else
-      theSupplementaryDirectory = dir.path();
-
-   // A change in supplementary directory presents an opportunity to find the OVR that could not be
-   // opened previously, as well as other support data items:
-   if (!theOverview.valid())
-   {
-      if (theDecimationFactors.size() > 0)
-      {
-        theDecimationFactors.clear();
-      }
-      completeOpen();
-   }
-}
-
-const ossimFilename& ossimImageHandler::getSupplementaryDirectory()const
-{
-   return theSupplementaryDirectory;
-}
-
-void ossimImageHandler::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if ( property.valid() )
-   {
-      if(property->getName() == ossimKeywordNames::ENTRY_KW)
-      {
-         setCurrentEntry(property->valueToString().toUInt32());
-      }
-      else if ( property->getName() == OPEN_OVERVIEW_FLAG_KW )
-      {
-         setOpenOverviewFlag( property->valueToString().toBool() );
-      }
-      else
-      {
-         ossimImageSource::setProperty(property);
-      }
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& name)const
-{
-
-   if(name == ossimKeywordNames::ENTRY_KW)
-   {
-      std::vector<ossim_uint32> entryList;
-      getEntryList(entryList);
-      
-      ossimStringProperty* stringProperty = new ossimStringProperty(name,
-                                                                    ossimString::toString(getCurrentEntry()));
-      ossim_uint32 idx = 0;
-      for(idx = 0; idx < entryList.size(); ++idx)
-      {
-         stringProperty->addConstraint(ossimString::toString(entryList[idx]));
-      }
-      stringProperty->setFullRefreshBit();
-      stringProperty->setEditableFlag(false);
-
-      return stringProperty;
-   }
-   else if(name == ossimKeywordNames::NUMBER_SAMPLES_KW)
-   {
-      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfSamples()));
-      prop->setReadOnlyFlag(true);
-      
-      return prop;
-   }
-   else if(name == ossimKeywordNames::NUMBER_LINES_KW)
-   {
-      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfLines()));
-      prop->setReadOnlyFlag(true);
-      
-      return prop;
-   }
-   else if(name == ossimKeywordNames::NUMBER_BANDS_KW)
-   {
-      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfInputBands()));
-      prop->setReadOnlyFlag(true);
-      
-      return prop;
-   }
-   else if(name == ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW)
-   {
-      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfDecimationLevels()));
-      prop->setReadOnlyFlag(true);
-      
-      return prop;
-   }
-   else if(name == ossimKeywordNames::SCALAR_TYPE_KW)
-   {
-      ossimStringProperty* prop = new ossimStringProperty(name, ossimScalarTypeLut::instance()->getEntryString(getOutputScalarType()));
-      prop->setReadOnlyFlag(true);
-      
-      return prop;
-   }
-   else if(name == "histogram_filename")
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, createDefaultHistogramFilename());
-      
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      filenameProp->setCacheRefreshBit();
-      
-      return filenameProp;
-      
-   }
-   else if(name == "geometry_filename")
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, createDefaultGeometryFilename());
-      
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      filenameProp->setCacheRefreshBit();
-      
-      return filenameProp;
-      
-   }
-   else if(name == "valid_vertices_filename")
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, createDefaultValidVerticesFilename());
-      
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      filenameProp->setCacheRefreshBit();
-      
-      return filenameProp;
-   }
-   else if(name == "metadata_filename")
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, createDefaultMetadataFilename());
-      
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      filenameProp->setCacheRefreshBit();
-      
-      return filenameProp;
-   }
-   else if(name == "overview_filename")
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, createDefaultOverviewFilename());
-      
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      filenameProp->setCacheRefreshBit();
-      
-      return filenameProp;
-   }
-   else if(name == "filename")
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, getFilename());
-      
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      filenameProp->setFullRefreshBit();
-      
-      return filenameProp;
-   }
-   else if ( name == OPEN_OVERVIEW_FLAG_KW)
-   {
-      ossimRefPtr<ossimProperty> result =
-         new ossimBooleanProperty(ossimString(OPEN_OVERVIEW_FLAG_KW), theOpenOverviewFlag); 
-      return result;
-   }
-   
-   return ossimImageSource::getProperty(name);
-}
-
-void ossimImageHandler::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSource::getPropertyNames(propertyNames);
-   propertyNames.push_back(ossimKeywordNames::ENTRY_KW);
-   propertyNames.push_back(ossimKeywordNames::NUMBER_SAMPLES_KW);
-   propertyNames.push_back(ossimKeywordNames::NUMBER_LINES_KW);
-   propertyNames.push_back(ossimKeywordNames::NUMBER_BANDS_KW);
-   propertyNames.push_back(ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW);
-   propertyNames.push_back(ossimKeywordNames::SCALAR_TYPE_KW);
-   propertyNames.push_back(OPEN_OVERVIEW_FLAG_KW);
-}
-
-ossimFilename ossimImageHandler::getFilenameWithThisExtension(
-   const ossimString& ext,
-   bool set_e0_prefix) const
-{
-   // Get the image file.
-   ossimFilename f = getFilename();
-
-   // If the supplementary directory is set, find the extension
-   // at that location instead of at the default.
-   if ( theSupplementaryDirectory.size() )
-   {
-      
-      ossimString drivePart;
-      ossimString pathPart;
-      ossimString filePart;
-      ossimString extPart;
-
-      f.split(drivePart,
-              pathPart,
-              filePart,
-              extPart);
-
-      ossimFilename newDrivePart = theSupplementaryDirectory.drive();
-      ossimFilename newPathPart  = theSupplementaryDirectory.after(newDrivePart);
-
-      f.merge( newDrivePart, newPathPart, filePart, extPart );
-   }
-
-   // Wipe out the extension.
-   f.setExtension("");
-
-   if (set_e0_prefix || (getNumberOfEntries() > 1))
-   {
-      f += "_e";
-      f += ossimString::toString(getCurrentEntry());
-   }
-   if (ext.size())
-   {
-      if (ext[static_cast<std::string::size_type>(0)] != '.')
-      {
-         f += ".";
-      }
-      f += ext;
-   }
-   return f;
-}
-
-bool ossimImageHandler::getOverviewTile(ossim_uint32 resLevel,
-                                        ossimImageData* result)
-{
-   bool status = false;
-   
-   if (theOverview.valid())
-   {
-      if (theOverview->isValidRLevel(resLevel) && result &&
-          (result->getNumberOfBands() == getNumberOfOutputBands()) )
-      {
-         status = theOverview->getTile(result, resLevel);
-      }
-   }
-   
-   return status;
-}
-
-ossimRefPtr<ossimNBandLutDataObject> ossimImageHandler::getLut()const
-{
-   return theLut;
-}
-
-bool ossimImageHandler::hasLut() const
-{
-   return theLut.valid();
-}
-
-ossimFilename ossimImageHandler::createDefaultOverviewFilename() const
-{
-   return getFilenameWithThisExtension("ovr");
-}
-   
-ossimFilename ossimImageHandler::createDefaultGeometryFilename() const
-{
-   return getFilenameWithThisExtension("geom");
-}
-
-ossimFilename ossimImageHandler::createDefaultMetadataFilename() const
-{
-   return getFilenameWithThisExtension("omd");
-}
-
-ossimFilename ossimImageHandler::createDefaultHistogramFilename() const
-{
-   return getFilenameWithThisExtension("his");
-}
-
-ossimFilename ossimImageHandler::createDefaultValidVerticesFilename() const
-{
-   ossimFilename result;
-   
-   result = theImageFile.path();
-   result = result.dirCat(theImageFile.fileNoExtension());
-   result += "_vertices";
-   if(getNumberOfEntries() > 1)
-   {
-      result += "_e";
-      result += ossimString::toString(getCurrentEntry());
-   }
-   result += ".kwl";
-   
-   return result;
-}
-
-ossim_uint32 ossimImageHandler::getStartingResLevel() const
-{
-   return theStartingResLevel;
-}
-
-void ossimImageHandler::setStartingResLevel(ossim_uint32 level)
-{
-   theStartingResLevel = level;
-}
-
-bool ossimImageHandler::getOpenOverviewFlag() const
-{
-   return theOpenOverviewFlag;
-}
-   
-void ossimImageHandler::setOpenOverviewFlag(bool flag)
-{
-   theOpenOverviewFlag = flag;
-
-   // If false close overview if open??? (drb)
-}
-
-void ossimImageHandler::initImageParameters(ossimImageGeometry* geom) const
-{
-   if ( geom )
-   {
-      // Set decimation levels
-      ossim_uint32 num_levels = getNumberOfDecimationLevels();
-      if ((num_levels > 0) && (num_levels != geom->getNumberOfDecimations()))
-      {
-         geom->setDiscreteDecimation(theDecimationFactors);
-      }
-
-      // Set image size.
-      if(geom->getImageSize().hasNans())
-      {
-         ossimIrect rect = getBoundingRect();
-         geom->setImageSize(ossimIpt(rect.width(), rect.height()));
-      } 
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageHandlerFactory.cpp b/ossim/src/ossim/imaging/ossimImageHandlerFactory.cpp
deleted file mode 100644
index 3ef7d5e..0000000
--- a/ossim/src/ossim/imaging/ossimImageHandlerFactory.cpp
+++ /dev/null
@@ -1,905 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimImageHandlerFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageHandlerFactory.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimAdrgTileSource.h>
-#include <ossim/imaging/ossimCcfTileSource.h>
-#include <ossim/imaging/ossimCibCadrgTileSource.h>
-#include <ossim/imaging/ossimDoqqTileSource.h>
-#include <ossim/imaging/ossimDtedTileSource.h>
-#include <ossim/imaging/ossimEnviTileSource.h>
-#include <ossim/imaging/ossimNitfTileSource.h>
-// #include <ossim/imaging/ossimPdfReader.h>
-#include <ossim/imaging/ossimQuickbirdNitfTileSource.h>
-#include <ossim/imaging/ossimSrtmTileSource.h>
-#include <ossim/imaging/ossimQuickbirdTiffTileSource.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/imaging/ossimUsgsDemTileSource.h>
-#include <ossim/imaging/ossimLandsatTileSource.h>
-#include <ossim/imaging/ossimGeneralRasterTileSource.h>
-#include <ossim/imaging/ossimERSTileSource.h>
-#include <ossim/imaging/ossimVpfTileSource.h>
-#include <ossim/imaging/ossimJpegTileSource.h>
-#include <ossim/imaging/ossimRpfCacheTileSource.h>
-#include <ossim/imaging/ossimImageCacheTileSource.h>
-#include <ossim/imaging/ossimQbTileFilesHandler.h>
-#include <ossim/imaging/ossimBitMaskTileSource.h>
-#include <ossim/imaging/ossimBandSeparateHandler.h>
-#include <ossim/imaging/ossimRangeDomeTileSource.h>
-#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
-
-#define ENABLE_POINT_CLOUD_HANDLER
-#ifdef ENABLE_POINT_CLOUD_HANDLER
-#include <ossim/point_cloud/ossimPointCloudImageHandler.h>
-#endif
-
-static const ossimTrace traceDebug("ossimImageHandlerFactory:debug");
-
-RTTI_DEF1(ossimImageHandlerFactory, "ossimImageHandlerFactory", ossimImageHandlerFactoryBase);
-
-ossimImageHandlerFactory* ossimImageHandlerFactory::theInstance = 0;
-ossimImageHandlerFactory::~ossimImageHandlerFactory()
-{
-   theInstance = (ossimImageHandlerFactory*)0;
-}
-
-ossimImageHandlerFactory* ossimImageHandlerFactory::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimImageHandlerFactory;
-
-      // let's turn off tiff error reporting
-      TIFFSetErrorHandler(0);
-      TIFFSetWarningHandler(0);
-   }
-
-   return theInstance;
-}
-
-ossimImageHandler* ossimImageHandlerFactory::open(const ossimFilename& fileName,
-                                                  bool openOverview) const
-{
-   static const char* M = "ossimImageHandlerFactory::open(filename) -- ";
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" Entering..." << std::endl;
-
-   ossimFilename copyFilename = fileName;
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "Attempting to open file: " << fileName.c_str()
-         << "\nopen overview flag: " << (openOverview?"true":"false") << "\n";
-   }
-
-   ossimRefPtr<ossimImageHandler> result = 0;
-   while (true)
-   {
-      // Check for empty file.
-      copyFilename.trim();
-      if (copyFilename.empty()) break;
-
-      // for all of our imagehandlers the filename must exist.
-      // if we have any imagehandlers that require an encoded string and is contrlled in this factory then
-      // we need to move this.
-      if (!copyFilename.exists())  break;
-
-      ossimString ext = copyFilename.ext().downcase();
-      if(ext == "gz")
-         copyFilename = copyFilename.setExtension("");
-
-      // Try opening from extension logic first (this is faster than instantiating each type).
-//      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying via extension...";
-//      result = openFromExtension(copyFilename);
-//      if (result.valid())  break;
-
-      //---
-      // If here do it the brute force way by going down the list of available
-      // readers...
-      //---
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying RPF Cache Image...\n";
-      result = new ossimRpfCacheTileSource;
-      result->setOpenOverviewFlag(openOverview);
-      if (result->open(copyFilename)) break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying RPF Image Cache Image...\n";
-      result = new ossimImageCacheTileSource;
-      result->setOpenOverviewFlag(openOverview);
-      if (result->open(copyFilename)) break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying JPEG...\n";
-      result = new ossimJpegTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename)) break;
-
-      // this must be checked first before the TIFF handler
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Quickbird TIFF...\n";
-      result = new ossimQuickbirdTiffTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename)) break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying TIFF...\n";
-      result = new ossimTiffTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying CIB/CADRG...\n";
-      result = new ossimCibCadrgTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying DOQQ...\n";
-      result = new ossimDoqqTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying DTED...\n";
-      result = new ossimDtedTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      // this must be checked first before the NITF raw handler
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Quickbird Nitf...\n";
-      result = new ossimQuickbirdNitfTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying NITF...\n";
-      result = new ossimNitfTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying USGS Dem...\n";
-      result = new ossimUsgsDemTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Landsat...\n";
-      result = new ossimLandsatTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying VPF...\n";
-      result = new ossimVpfTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ERS...\n";
-      result = new ossimERSTileSource;
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      //---
-      // The srtm and general raser readers were picking up j2k overviews because the
-      // matching base file has an "omd" file that the raster reader can load
-      // so added extension check.  (drb - 20100709)
-      //---
-      if (copyFilename.ext() != "ovr")
-      {
-         // Note:  ENVI should be in front of general raster..
-         if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ENVI...\n";
-         result = new ossimEnviTileSource;
-         result->setOpenOverviewFlag(openOverview);         
-         if (result->open(copyFilename))  break;
-
-         // Note:  SRTM should be in front of general raster..
-         if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying SRTM...\n";
-         result = new ossimSrtmTileSource;
-         result->setOpenOverviewFlag(openOverview);         
-         if (result->open(copyFilename))  break;
-
-         if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying General Raster...\n";
-         result = new ossimGeneralRasterTileSource; 
-         result->setOpenOverviewFlag(openOverview);        
-         if (result->open(copyFilename))  break;
-      }
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ADRG...\n";
-      result = new ossimAdrgTileSource();
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ossimQbTileFilesHandler...\n";
-      result = new ossimQbTileFilesHandler();
-      result->setOpenOverviewFlag(openOverview);
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Bit Mask...\n";
-      result = new ossimBitMaskTileSource();
-      result->setOpenOverviewFlag(openOverview);
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying band-separated files...\n";
-      result = new ossimBandSeparateHandler();
-      result->setOpenOverviewFlag(openOverview);      
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying CCF...\n";
-      result->setOpenOverviewFlag(openOverview);      
-      result = new ossimCcfTileSource();
-      if (result->open(copyFilename))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying OSSIM Range Domes...\n";
-      result->setOpenOverviewFlag(openOverview);
-      result = new ossimRangeDomeTileSource();
-      if (result->open(copyFilename))  break;
-
-#ifdef ENABLE_POINT_CLOUD_HANDLER
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Point Cloud...\n";
-      result->setOpenOverviewFlag(openOverview);
-      result = new ossimPointCloudImageHandler();
-      if (result->open(copyFilename))  break;
-#endif
-      result = 0;
-      break;
-   }
-
-   if (traceDebug())
-   {
-      if (result.valid())
-         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   SUCCESS" << std::endl;
-      else
-         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   Open FAILED" << std::endl;
-   }
-
-   return result.release();
-}
-
-ossimImageHandler* ossimImageHandlerFactory::open(const ossimKeywordlist& kwl,
-                                                  const char* prefix)const
-{
-   static const char* M = "ossimImageHandlerFactory::open(kwl,prefix) -- ";
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" entered..." << std::endl;
-
-   ossimRefPtr<ossimImageHandler> result = 0;
-   while (true)
-   {
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying adrg...\n";
-      result = new ossimAdrgTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ccf...\n";
-      result  = new ossimCcfTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying CIB/CADRG...\n";
-      result  = new ossimCibCadrgTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "trying RpfCache...\n";
-      result  = new ossimRpfCacheTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "trying Rpf ImageCache...\n";
-      result  = new ossimImageCacheTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying DOQQ...\n";
-      result  = new ossimDoqqTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying DTED...\n";
-      result  = new ossimDtedTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying jpeg...\n";
-      result  = new ossimJpegTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Quickbird NITF...\n";
-      result = new ossimQuickbirdNitfTileSource;
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying Nitf...\n";
-      result  = new ossimNitfTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      // Must be before tiff...
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Quickbird TIFF...\n";
-      result = new ossimQuickbirdTiffTileSource;
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying tiff...\n";
-      result  = new ossimTiffTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying USGS Dem...\n";
-      result  = new ossimUsgsDemTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Landsat...\n";
-      result  = new ossimLandsatTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying VPF...\n";
-      result = new ossimVpfTileSource;
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ERS...\n";
-      result = new ossimERSTileSource;
-      if (result->loadState(kwl, prefix))  break;
-
-      // Note:  ENVI should be in front of general raster...
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ENVI...\n"<< std::endl;
-      result  = new ossimEnviTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      // Note:  SRTM should be in front of general raster...
-      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying SRTM...\n"<< std::endl;
-      result  = new ossimSrtmTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying General Raster...\n"<< std::endl;
-      result  = new ossimGeneralRasterTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"trying ossimQbTileFilesHandler...\n"<<std::endl;
-      result = new ossimQbTileFilesHandler;
-      if (result->loadState(kwl, prefix))  break;
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"trying ossimQbTileFilesHandler...\n"<<std::endl;
-      result = new ossimQbTileFilesHandler;
-      if (result->loadState(kwl, prefix))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying band-separated files...\n";
-      result = new ossimBandSeparateHandler();
-      if (result->loadState(kwl, prefix))  break;
-
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Range Domes CSV...\n";
-      result = new ossimRangeDomeTileSource();
-      if (result->loadState(kwl, prefix))  break;
-
-#ifdef ENABLE_POINT_CLOUD_HANDLER
-      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ossimPointCloudImageHandler...\n";
-      result = new ossimPointCloudImageHandler();
-      if (result->loadState(kwl, prefix))  break;
-#endif
-      result = 0;
-      break;
-   }
-
-   if (traceDebug())
-   {
-      if (result.valid())
-         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   SUCCESS" << std::endl;
-      else
-         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   Open FAILED" << std::endl;
-   }
-
-   return result.release();
-}
-
-ossimRefPtr<ossimImageHandler> ossimImageHandlerFactory::openOverview(
-   const ossimFilename& file ) const
-{
-   ossimRefPtr<ossimImageHandler> result = 0;
-   if ( file.size() )
-   {
-      result = new ossimTiffTileSource;
-      
-      result->setOpenOverviewFlag( false ); // Always false.
-
-      if ( result->open( file ) == false )
-      {
-         result = 0;
-      }
-   }
-   return result;
-}
-
-#if 0
-ossimImageHandler* ossimImageHandlerFactory::openFromExtension(const ossimFilename& fileName) const
-{
-   
-   static const char* M = "ossimImageHandlerFactory::openFromExtension() -- ";
-   if(traceDebug()) 
-      ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Attempting to open <"<<fileName<<">"<<std::endl;
-
-   ossimString ext = fileName.ext().downcase();
-   ossimRefPtr<ossimImageHandler> result = 0;
-   
-   
-   while (true)
-   {
-      // OVR can be combined with "tif" once we get rid of ossimQuickbirdTiffTileSource
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying OVR...\n";
-      if (ext == "ovr")
-      {
-         result = new ossimTiffTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying TIF or TIFF...\n";
-      if ( (ext == "tif") || (ext == "tiff") )
-      {
-         // this must be checked first before the TIFF handler
-         result = new ossimQuickbirdTiffTileSource;
-         if(result->open(fileName)) break;
-         result = new ossimTiffTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying NTF or NITF...\n";
-      if ( (ext == "ntf") || (ext == "nitf") )
-      {
-         // this must be checked first before the NITF raw handler
-         result = new ossimQuickbirdNitfTileSource;
-         if(result->open(fileName)) break;
-         result = new ossimNitfTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying RPF...\n";
-      if ( (fileName == "rpf"))
-      {
-         result = new ossimRpfCacheTileSource;
-         if(result->open(fileName)) break;
-
-         result = new ossimImagefCacheTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying TOC...\n";
-      if ( (fileName == "a.toc") || (ext == "toc"))
-      {
-         result = new ossimCibCadrgTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying JPG or JPEG...\n";
-      if ( (ext == "jpg") || (ext == "jpeg") )
-      {
-         result = new ossimJpegTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying DOQ or DOQQ...\n";
-      if ( (ext == "doq") || (ext == "doqq") )
-      {
-         result = new ossimDoqqTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying DTn...\n";
-      if ( (ext == "dt2") || (ext == "dt1") || (ext == "dt3") ||
-         (ext == "dt4") || (ext == "dt5") || (ext == "dt0") )
-      {
-         result = new ossimDtedTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying HGT...\n";
-      if (ext == "hgt")
-      {
-         result = new ossimSrtmTileSource;
-         if(result->open(fileName)) break;
-      }  
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying HRI,HSI\n";
-      if ( (ext == "hri") || (ext == "hsi") )
-      {
-         result = new ossimEnviTileSource;
-         if(result->open(fileName)) break;
-      }  
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying DEM...\n";
-      if (ext == "dem")
-      {
-         result = new ossimUsgsDemTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying FST...\n";
-      if (ext == "fst")
-      {
-         result = new ossimLandsatTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying RAS or RAW...\n";
-      if ( (ext == "ras") || (ext == "raw") )
-      {
-         result = new ossimGeneralRasterTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying IMG...\n";
-      if (ext == "img")
-      {
-         result  = new ossimAdrgTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying CCF...\n";
-      if (ext == "ccf")
-      {
-         result = new ossimCcfTileSource;
-         if(result->open(fileName)) break;
-      }
-
-      result = 0;
-      break;
-   }
-   if (traceDebug())
-   {
-      if (result.valid())
-         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   SUCCESS" << std::endl;
-      else
-         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   Open FAILED" << std::endl;
-   }
-   return result.release();
-}
-#endif
-ossimObject* ossimImageHandlerFactory::createObject(const ossimString& typeName)const
-{
-   if(STATIC_TYPE_NAME(ossimAdrgTileSource) == typeName)
-   {
-      return new ossimAdrgTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimCcfTileSource) == typeName)
-   {
-      return new ossimCcfTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimCibCadrgTileSource) == typeName)
-   {
-      return new ossimCibCadrgTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimRpfCacheTileSource) == typeName)
-   {
-     return new ossimRpfCacheTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimImageCacheTileSource) == typeName)
-   {
-      return new ossimImageCacheTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimDoqqTileSource) == typeName)
-   {
-      return new ossimDoqqTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimDtedTileSource) == typeName)
-   {
-      return new ossimDtedTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimEnviTileSource) == typeName)
-   {
-      return new ossimEnviTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimJpegTileSource) == typeName)
-   {
-      return new ossimJpegTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimNitfTileSource) == typeName)
-   {
-      return new ossimNitfTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimTiffTileSource) == typeName)
-   {
-      return new ossimTiffTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimUsgsDemTileSource) == typeName)
-   {
-      return new ossimUsgsDemTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimLandsatTileSource) == typeName)
-   {
-      return new ossimLandsatTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimERSTileSource) == typeName)
-   {
-      return new ossimERSTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimSrtmTileSource) == typeName)
-   {
-      return new ossimSrtmTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimGeneralRasterTileSource) == typeName)
-   {
-      return new ossimGeneralRasterTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimQuickbirdNitfTileSource) == typeName)
-   {
-      return new ossimQuickbirdNitfTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimQbTileFilesHandler) == typeName)
-   {
-      return new ossimQbTileFilesHandler();
-   }
-   if(STATIC_TYPE_NAME(ossimBitMaskTileSource) == typeName)
-   {
-      return new ossimBitMaskTileSource();
-   }
-   if(STATIC_TYPE_NAME(ossimBandSeparateHandler) == typeName)
-   {
-      return new ossimBandSeparateHandler();
-   }
-   if(STATIC_TYPE_NAME(ossimRangeDomeTileSource) == typeName)
-   {
-      return new ossimRangeDomeTileSource();
-   }
-#ifdef ENABLE_POINT_CLOUD_HANDLER
-   if(STATIC_TYPE_NAME(ossimPointCloudImageHandler) == typeName)
-   {
-      return new ossimPointCloudImageHandler();
-   }
-#endif
-   if(STATIC_TYPE_NAME(ossimImageHandlerMtAdaptor) == typeName)
-   {
-      return new ossimImageHandlerMtAdaptor();
-   }
-   
-   return (ossimObject*)0;
-}
-
-void ossimImageHandlerFactory::getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const
-{
-   extensionList.push_back("img");
-   extensionList.push_back("ccf"); 
-   extensionList.push_back("toc");
-   extensionList.push_back("tif");
-   extensionList.push_back("tiff");
-   extensionList.push_back("doq");
-   extensionList.push_back("doqq");
-   extensionList.push_back("dt0");
-   extensionList.push_back("dt1");
-   extensionList.push_back("dt2");
-   extensionList.push_back("dt3");
-   extensionList.push_back("jpg");
-   extensionList.push_back("jpeg");
-   extensionList.push_back("dem");
-   extensionList.push_back("fst");
-   extensionList.push_back("hdr");
-   extensionList.push_back("ras");
-   extensionList.push_back("hgt");
-   extensionList.push_back("nsf");
-   extensionList.push_back("nitf");
-   extensionList.push_back("ntf");
-   extensionList.push_back("til");
-   extensionList.push_back("mask");
-   extensionList.push_back("txt");
-   extensionList.push_back("csv");
-}
-
-void ossimImageHandlerFactory::getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& ext)const
-{
-   static const char* M = "ossimImageHandlerFactory::getImageHandlersBySuffix() -- ";
-   // OVR can be combined with "tif" once we get rid of ossimQuickbirdTiffTileSource
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying OVR...\n";
-   ossimString testExt = ext.downcase();
-   if (testExt == "ovr")
-   {
-      result.push_back(new ossimTiffTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TIF or TIFF...\n";
-   if ( (testExt == "tif") || (testExt == "tiff") )
-   {
-      // this must be checked first before the TIFF handler
-      result.push_back(new ossimQuickbirdTiffTileSource);
-      result.push_back(new ossimTiffTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing NTF or NITF...\n";
-   if ( (testExt == "ntf") || (testExt == "nitf") )
-   {
-      // this must be checked first before the NITF raw handler
-      result.push_back(new ossimQuickbirdNitfTileSource);
-      result.push_back(new ossimNitfTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing RPF...\n";
-   if ( (testExt == "rpf"))
-   {
-      result.push_back(new ossimRpfCacheTileSource);
-      result.push_back(new ossimImageCacheTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TOC...\n";
-   if ( testExt == "toc")
-   {
-      result.push_back(new ossimCibCadrgTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing JPG or JPEG...\n";
-   if ( (testExt == "jpg") || (testExt == "jpeg") )
-   {
-      result.push_back(new ossimJpegTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DOQ or DOQQ...\n";
-   if ( (testExt == "doq") || (testExt == "doqq") )
-   {
-      result.push_back(new ossimDoqqTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DTn...\n";
-   ossimString regExpStr = "dt[0-9]";
-   ossimRegExp regExp(regExpStr);
-   if(regExp.find(testExt))
-   {
-      result.push_back(new ossimDtedTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing HGT...\n";
-   if (testExt == "hgt")
-   {
-      result.push_back(new ossimSrtmTileSource);
-      return;
-   }  
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing HRI,HSI...\n";
-   if ( (testExt == "hri") || (testExt == "hsi") )
-   {
-      result.push_back(new ossimEnviTileSource);
-      return;
-   }  
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DEM...\n";
-   if (testExt == "dem")
-   {
-      result.push_back(new ossimUsgsDemTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing FST...\n";
-   if (testExt == "fst")
-   {
-      result.push_back(new ossimLandsatTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing RAS or RAW or General Raster...\n";
-   if ( (testExt == "ras") || (testExt == "raw") || (testExt == "bil"))
-   {
-      result.push_back(new ossimGeneralRasterTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing IMG...\n";
-   if (testExt == "img")
-   {
-      result.push_back(new ossimAdrgTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing CCF...\n";
-   if (testExt == "ccf")
-   {
-      result.push_back(new ossimCcfTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TIL...\n";
-   if (testExt == "til")
-   {
-      result.push_back(new ossimQbTileFilesHandler);
-      return;
-   }
-
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing MASK...\n";
-   if (testExt == "mask")
-   {
-      result.push_back(new ossimBitMaskTileSource);
-      return;
-   }
-   
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TXT...\n";
-   if (testExt == "txt")
-   {
-      result.push_back(new ossimBandSeparateHandler);
-      return;
-   }
-
-   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing CSV...\n";
-   if (testExt == "csv")
-   {
-      result.push_back(new ossimRangeDomeTileSource);
-      return;
-   }
-}
-
-void ossimImageHandlerFactory::getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const
-{
-   ossimString test(mimeType.begin(), mimeType.begin()+6);
-   if(test == "image/")
-   {
-      ossimString mimeTypeTest(mimeType.begin() + 6, mimeType.end());
-      getImageHandlersBySuffix(result, mimeTypeTest);
-      if(mimeTypeTest == "dted")
-      {
-         result.push_back(new ossimDtedTileSource);
-      }
-   }
-}
-
-ossimObject* ossimImageHandlerFactory::createObject(const ossimKeywordlist& kwl,
-                                                    const char* prefix)const
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageHandlerFactory::createObject(kwl, prefix) DEBUG:"
-         << " entering ..." << std::endl;
-   }
-   ossimObject* result = (ossimObject*)0;
-   const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-
-   if(type)
-   {
-      if (ossimString(type).trim() == STATIC_TYPE_NAME(ossimImageHandler))
-      {
-         const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-
-         if (lookup)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG) << "BEBUG: filename " << lookup << std::endl;
-            }
-            // Call the open that takes a filename...
-            result = this->open(kwl, prefix);//ossimFilename(lookup));
-         }
-      }
-      else
-      {
-         result = createObject(ossimString(type));
-         if(result)
-         {
-            result->loadState(kwl, prefix);
-         }
-      }
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageHandlerFactory::createObject(kwl, prefix) DEBUG: returning result ..." << std::endl;
-   }
-   return result;
-}
-
-void ossimImageHandlerFactory::getTypeNameList(std::vector<ossimString>& typeList)const
-{
-   typeList.push_back(STATIC_TYPE_NAME(ossimAdrgTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimCcfTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimCibCadrgTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimEnviTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRpfCacheTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageCacheTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimDoqqTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimDtedTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimJpegTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimNitfTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimTiffTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimUsgsDemTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimLandsatTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimERSTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSrtmTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdNitfTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdTiffTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimQbTileFilesHandler));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBitMaskTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRangeDomeTileSource));
-
-#ifdef ENABLE_POINT_CLOUD_HANDLER
-   typeList.push_back(STATIC_TYPE_NAME(ossimPointCloudImageHandler));
-#endif
-
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageHandlerMtAdaptor));
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageHandlerFactoryBase.cpp b/ossim/src/ossim/imaging/ossimImageHandlerFactoryBase.cpp
deleted file mode 100644
index fd56487..0000000
--- a/ossim/src/ossim/imaging/ossimImageHandlerFactoryBase.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Garrett Potts (gpotts at imagelinks.com)
-//
-//*******************************************************************
-//  $Id: ossimImageHandlerFactoryBase.cpp 22632 2014-02-20 00:53:14Z dburken $
-#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
-
-RTTI_DEF1(ossimImageHandlerFactoryBase, "ossimImageHandlerFactoryBase", ossimObjectFactory);
-
-void ossimImageHandlerFactoryBase::getImageHandlersBySuffix(ImageHandlerList& /*result*/,
-                                                            const ossimString& /*ext*/)const
-{
-}
-
-void ossimImageHandlerFactoryBase::getImageHandlersByMimeType(ImageHandlerList& /*result*/,
-                                                              const ossimString& /*mimeType*/)const
-{
-}
-
-ossimRefPtr<ossimImageHandler> ossimImageHandlerFactoryBase::openOverview(
-   const ossimFilename& /* file */ ) const
-{
-   return ossimRefPtr<ossimImageHandler>(0);
-}
-
-
-ossimRefPtr<ossimImageHandler> ossimImageHandlerFactoryBase::open(
-   std::istream* /* str */,
-   std::streamoff /* restartPosition */,
-   bool /* youOwnIt */ ) const
-{
-   return ossimRefPtr<ossimImageHandler>(0);
-}
diff --git a/ossim/src/ossim/imaging/ossimImageHandlerRegistry.cpp b/ossim/src/ossim/imaging/ossimImageHandlerRegistry.cpp
deleted file mode 100644
index c47b5e0..0000000
--- a/ossim/src/ossim/imaging/ossimImageHandlerRegistry.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Contains class definition for ImageHandlerRegistry.
-//
-//*******************************************************************
-//  $Id: ossimImageHandlerRegistry.cpp 22636 2014-02-23 17:55:50Z dburken $
-
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerFactory.h>
-#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
-#include <algorithm>
-
-RTTI_DEF1(ossimImageHandlerRegistry, "ossimImageHandlerRegistry", ossimObjectFactory);
-
-//ossimImageHandlerRegistry* ossimImageHandlerRegistry::theInstance = 0;
-
-ossimImageHandlerRegistry::ossimImageHandlerRegistry()
-{
-   ossimObjectFactoryRegistry::instance()->registerFactory(this);
-   registerFactory(ossimImageHandlerFactory::instance());
-}
-
-ossimImageHandlerRegistry* ossimImageHandlerRegistry::instance()
-{
-   static ossimImageHandlerRegistry sharedInstance;
-   
-   return &sharedInstance;
-}
-
-ossimImageHandlerRegistry::~ossimImageHandlerRegistry()
-{
-   unregisterAllFactories();
-}
-
-
-ossimObject* ossimImageHandlerRegistry::createObject(const ossimKeywordlist& kwl,
-                                                     const char* prefix)const
-{
-   ossimObject* result = createObjectFromRegistry(kwl, prefix);
-   if(!result)
-   {
-      result = open(kwl, prefix);
-   }
-   return result;
-}
-
-ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::openBySuffix(const ossimFilename& file,
-                                                                       bool openOverview)const
-{
-   std::vector<ossimRefPtr<ossimImageHandler> > handlers;
-   
-   getImageHandlersBySuffix(handlers, file.ext());
-   ossim_uint32 idx = 0;
-   ossim_uint32 size = (ossim_uint32) handlers.size();
-   
-   for(idx = 0; idx < size; ++idx)
-   {
-      handlers[idx]->setOpenOverviewFlag(openOverview);
-      if(handlers[idx]->open(file))
-      {
-         return handlers[idx];
-      }
-   }
-   
-   return ossimRefPtr<ossimImageHandler>(0);
-}
-
-void ossimImageHandlerRegistry::getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result,
-                                                         const ossimString& ext)const
-{
-   vector<ossimImageHandlerFactoryBase*>::const_iterator iter = m_factoryList.begin();
-   ossimImageHandlerFactoryBase::ImageHandlerList temp;
-   while(iter != m_factoryList.end())
-   {
-      temp.clear();
-      (*iter)->getImageHandlersBySuffix(temp, ext);
-      
-      if(!temp.empty())
-      {
-         
-         // now append to the end of the typeList.
-         result.insert(result.end(),
-                       temp.begin(),
-                       temp.end());
-      }
-      ++iter;
-   }
-}
-
-void ossimImageHandlerRegistry::getImageHandlersByMimeType(
-   ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const
-{
-   vector<ossimImageHandlerFactoryBase*>::const_iterator iter = m_factoryList.begin();
-   ossimImageHandlerFactoryBase::ImageHandlerList temp;
-   while(iter != m_factoryList.end())
-   {
-      temp.clear();
-      (*iter)->getImageHandlersByMimeType(temp, mimeType);
-      
-      if(!temp.empty())
-      {
-         
-         // now append to the end of the typeList.
-         result.insert(result.end(),
-                       temp.begin(),
-                       temp.end());
-      }
-      ++iter;
-   }
-}
-
-void ossimImageHandlerRegistry::getTypeNameList( std::vector<ossimString>& typeList ) const
-{
-   getAllTypeNamesFromRegistry(typeList);
-}
-
-void ossimImageHandlerRegistry::getSupportedExtensions(
-   ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const
-{
-   vector<ossimString> result;
-   vector<ossimImageHandlerFactoryBase*>::const_iterator iter = m_factoryList.begin();
-
-   while(iter != m_factoryList.end())
-   {
-      (*iter)->getSupportedExtensions(extensionList);
-
-      ++iter;
-   }
-   
-}
-
-ossimImageHandler* ossimImageHandlerRegistry::open(const ossimFilename& fileName,
-                                                   bool trySuffixFirst,
-                                                   bool openOverview)const
-{
-   if(trySuffixFirst)
-   {
-      ossimRefPtr<ossimImageHandler> h = openBySuffix(fileName, openOverview);
-      if(h.valid())
-      {
-         return h.release();
-      }
-   }
-   
-   // now try magic number opens
-   //
-   ossimImageHandler*                   result = NULL;
-   vector<ossimImageHandlerFactoryBase*>::const_iterator factory;
-
-   factory = m_factoryList.begin();
-   while((factory != m_factoryList.end()) && !result)
-   {
-      result = (*factory)->open(fileName, openOverview);
-      ++factory;
-   }
-   
-   return result;
-}
-
-ossimImageHandler* ossimImageHandlerRegistry::open(const ossimKeywordlist& kwl,
-                                                   const char* prefix)const
-{
-   ossimImageHandler*                   result = NULL;
-   vector<ossimImageHandlerFactoryBase*>::const_iterator factory;
-   
-   factory = m_factoryList.begin();
-   while((factory != m_factoryList.end()) && !result)
-   {
-      result = (*factory)->open(kwl, prefix);
-      ++factory;
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::open( std::istream* str,
-                                                                std::streamoff restartPosition,
-                                                                bool youOwnIt ) const
-{
-   ossimRefPtr<ossimImageHandler> result = 0;
-   vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
-   while( factory != m_factoryList.end() )
-   {
-      result = (*factory)->open( str, restartPosition, youOwnIt );
-      if ( result.valid() )
-      {
-         break;
-      }
-      ++factory;
-   }  
-   return result; 
-}
-
-ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::openOverview(
-   const ossimFilename& file ) const
-{
-   ossimRefPtr<ossimImageHandler> result = 0;
-   vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
-   while( factory != m_factoryList.end() )
-   {
-      result = (*factory)->openOverview( file );
-      if ( result.valid() )
-      {
-         break;
-      }
-      ++factory;
-   }  
-   return result;
-}
-
-ossimObject* ossimImageHandlerRegistry::createObject(const ossimString& typeName) const
-{
-   return createObjectFromRegistry(typeName);
-}
-
-std::ostream& ossimImageHandlerRegistry::printReaderProps(std::ostream& out) const
-{
-   // Loop through factories:
-   vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
-   while( factory != m_factoryList.end() )
-   {
-      out << "factory: " << (*factory)->getClassName() << "\n";
-      
-      // Loop through factory image handlers:
-      std::vector<ossimString> readerList;
-      (*factory)->getTypeNameList(readerList);
-
-      std::vector<ossimString>::const_iterator i = readerList.begin();
-      while ( i != readerList.end() )
-      {
-         ossimRefPtr<ossimImageHandler> ih =
-            dynamic_cast<ossimImageHandler*>( (*factory)->createObject( (*i) ) );
-         if ( ih.valid() )
-         {
-            std::vector<ossimString> propertyList;
-            ih->getPropertyNames(propertyList);
-            out << "reader: " << ih->getClassName() << "\n";
-            
-            if ( propertyList.size() )
-            {
-               // Loop through image handler properties:
-               out << "properties:\n";
-               std::vector<ossimString>::const_iterator p = propertyList.begin();
-               while ( p != propertyList.end() )
-               {
-                  out << (*p) << "\n";
-                  ++p;
-               }
-            }
-         }
-         ++i;
-      }
-      ++factory;
-   }
-   out << std::endl;
-   return out;
-}
-
-ossimImageHandlerRegistry::ossimImageHandlerRegistry(const ossimImageHandlerRegistry& /* rhs */)
-   :  ossimObjectFactory()
-{}
-
-const ossimImageHandlerRegistry&
-ossimImageHandlerRegistry::operator=(const ossimImageHandlerRegistry& rhs)
-{ return rhs; }
-
-extern "C"
-{
-  void* ossimImageHandlerRegistryGetInstance()
-  {
-    return ossimImageHandlerRegistry::instance();
-  }
-}
diff --git a/ossim/src/ossim/imaging/ossimImageHistogramSource.cpp b/ossim/src/ossim/imaging/ossimImageHistogramSource.cpp
deleted file mode 100644
index bff2c33..0000000
--- a/ossim/src/ossim/imaging/ossimImageHistogramSource.cpp
+++ /dev/null
@@ -1,524 +0,0 @@
-//*******************************************************************
-//
-// License:  See LICENSE.txt file in the top level directory.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageHistogramSource.cpp 22737 2014-04-16 18:53:57Z gpotts $
-
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug("ossimImageHistogramSource:debug");
-
-  RTTI_DEF3(ossimImageHistogramSource, "ossimImageHistogramSource", ossimHistogramSource, ossimConnectableObjectListener, ossimProcessInterface);
-
-ossimImageHistogramSource::ossimImageHistogramSource(ossimObject* owner)
-   :ossimHistogramSource(owner,
-                         1,     // one input
-                         0,     // no outputs
-                         true,  // input list is fixed
-                         false),// output can still grow though
-    theHistogramRecomputeFlag(true),
-    theMaxNumberOfResLevels(1),
-    theComputationMode(OSSIM_HISTO_MODE_NORMAL),
-    theNumberOfTilesToUseInFastMode(100)
-{
-   theAreaOfInterest.makeNan();
-   addListener((ossimConnectableObjectListener*)this);
-	
-   theMinValueOverride     = ossim::nan();
-   theMaxValueOverride     = ossim::nan();
-   theNumberOfBinsOverride = -1;
-}
-
-ossimImageHistogramSource::~ossimImageHistogramSource()
-{
-   removeListener((ossimConnectableObjectListener*)this);
-}
-
-ossimObject* ossimImageHistogramSource::getObject()
-{
-   return this;
-}
-
-const ossimObject* ossimImageHistogramSource::getObject()const
-{
-   return this;
-}
-
-void ossimImageHistogramSource::setAreaOfInterest(const ossimIrect& rect)
-{
-   if(rect != theAreaOfInterest)
-   {
-      theHistogramRecomputeFlag = true;
-   }
-   theAreaOfInterest = rect;
-}
-
-ossimIrect ossimImageHistogramSource::getAreaOfInterest()const
-{
-   return theAreaOfInterest;
-}
-
-void ossimImageHistogramSource::getAreaOfInterest(ossimIrect& rect)const
-{
-   rect = theAreaOfInterest;
-}
-
-ossim_uint32 ossimImageHistogramSource::getMaxNumberOfRLevels()const
-{
-   return theMaxNumberOfResLevels;
-}
-
-void ossimImageHistogramSource::setMaxNumberOfRLevels(ossim_uint32 number)
-{
-   if(number != theMaxNumberOfResLevels)
-   {
-      theHistogramRecomputeFlag = true;
-   }
-   theMaxNumberOfResLevels = number;
-}
-
-ossimRefPtr<ossimMultiResLevelHistogram> ossimImageHistogramSource::getHistogram(const ossimIrect& rect)
-{
-   if((theAreaOfInterest != rect)||
-      (theAreaOfInterest.hasNans()))
-   {
-      theAreaOfInterest = rect;
-      theHistogramRecomputeFlag = true;
-   }
-	
-   return getHistogram();
-}
-
-bool ossimImageHistogramSource::execute()
-{
-   if(!isSourceEnabled())
-   {
-      return theHistogram.valid();
-   }
-   
-   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
-   if(theHistogramRecomputeFlag)
-   {
-      if(theAreaOfInterest.hasNans())
-      {
-         ossimImageSource* interface = PTR_CAST(ossimImageSource, getInput(0));
-         if(interface)
-         {
-            theAreaOfInterest = interface->getBoundingRect();
-         }
-      }
-      switch(theComputationMode)
-      {
-         case OSSIM_HISTO_MODE_FAST:
-         {
-            computeFastModeHistogram();
-            break;
-         }
-         case OSSIM_HISTO_MODE_NORMAL:
-         default:
-         {
-            computeNormalModeHistogram();
-            break;
-         }
-      }
-   }
-   
-   if (needsAborting())
-   {
-      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_ABORTED);
-      theHistogramRecomputeFlag = false;
-   }
-   else
-   {
-      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
-   }
-   
-   return true;
-}
-
-bool ossimImageHistogramSource::canConnectMyInputTo(ossim_int32 myInputIndex,
-                                                    const ossimConnectableObject* object)const
-{
-   return ((myInputIndex==0)&&PTR_CAST(ossimImageSource,
-                                       object));
-}
-
-void ossimImageHistogramSource::setNumberOfBinsOverride(ossim_int32 numberOfBinsOverride)
-{
-   theNumberOfBinsOverride = numberOfBinsOverride;
-}
-
-void ossimImageHistogramSource::setMinValueOverride(ossim_float32 minValueOverride)
-{
-   theMinValueOverride = minValueOverride;
-}
-void ossimImageHistogramSource::setMaxValueOverride(ossim_float32 maxValueOverride)
-{
-   theMaxValueOverride = maxValueOverride;
-}
-
-ossimHistogramMode ossimImageHistogramSource::getComputationMode()const
-{
-   return theComputationMode;
-}
-
-void ossimImageHistogramSource::setComputationMode(ossimHistogramMode mode)
-{
-   theComputationMode = mode;
-}
-
-void ossimImageHistogramSource::propertyEvent(ossimPropertyEvent& /* event */)
-{
-   theHistogramRecomputeFlag = true;
-}
-
-void ossimImageHistogramSource::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-   theHistogramRecomputeFlag = true;
-}
-
-ossimRefPtr<ossimMultiResLevelHistogram> ossimImageHistogramSource::getHistogram()
-{
-   execute();
-   return theHistogram;
-}
-
-void ossimImageHistogramSource::getBinInformation(ossim_uint32& numberOfBins,
-                                                  ossim_float64& minValue,
-                                                  ossim_float64& maxValue,
-                                                  ossim_uint32 band)const
-{
-   numberOfBins = 0;
-   minValue     = 0;
-   maxValue     = 0;
-	
-   ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(0));
-   if(input)
-   {
-      minValue = input->getMinPixelValue(band);
-      maxValue = input->getMaxPixelValue(band);
-      switch(input->getOutputScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            minValue     = 0;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_UCHAR;
-            numberOfBins = 256;
-				
-            break;
-         }
-         case OSSIM_USHORT11:
-         {
-            minValue     = 0;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT11;
-            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT11 + 1;
-				
-            break;
-         }
-         case OSSIM_UINT16:
-         {
-            minValue     = 0;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT16;
-            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16 + 1;
-				
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            minValue     = OSSIM_DEFAULT_MIN_PIX_SINT16;
-            maxValue     = OSSIM_DEFAULT_MAX_PIX_SINT16;
-            numberOfBins = (OSSIM_DEFAULT_MAX_PIX_SINT16-OSSIM_DEFAULT_MIN_PIX_SINT16) + 1;
-            break;
-         }
-         case OSSIM_SINT32:
-         case OSSIM_UINT32:
-         case OSSIM_FLOAT32:
-         case OSSIM_FLOAT64:
-         {
-				numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
-            break;
-         }
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            minValue     = 0;
-            maxValue     = 1.0;
-            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
-            break;
-         }
-         default:
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "Unsupported scalar type in ossimImageHistogramSource::computeHistogram()" << endl;
-            }
-            return;
-         }
-      }
-   }
-	
-   if(ossim::isnan(theMinValueOverride) == false)
-   {
-      minValue = (float)theMinValueOverride;
-   }
-   if(ossim::isnan(theMaxValueOverride) == false)
-   {
-      maxValue = (float)theMaxValueOverride;
-   }
-   if(theNumberOfBinsOverride > 0)
-   {
-      numberOfBins = theNumberOfBinsOverride;
-   }
-}
-
-void ossimImageHistogramSource::computeNormalModeHistogram()
-{
-   // ref ptr, not a leak.
-   theHistogram = new ossimMultiResLevelHistogram;
-	
-   ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(0));
-   if(!input)
-   {
-      setPercentComplete(100.0);
-      return;
-   }
-   
-   if(getInput(0))
-   {
-      // sum up all tiles needing processing.  We will use the sequencer.
-      //      ossim_uint32 numberOfResLevels = input->getNumberOfDecimationLevels();
-      ossim_uint32 index = 0;
-      double tileCount   = 0.0;
-      double totalTiles  = 0.0;
-      ossim_uint32 numberOfBands = input->getNumberOfOutputBands();
-      ossim_uint32 numberOfBins  = 0;
-      ossim_float64 minValue     = 0;
-      ossim_float64 maxValue     = 0;
-      getBinInformation(numberOfBins, minValue, maxValue, 0);
-		
-      ossimRefPtr<ossimImageSourceSequencer> sequencer = new ossimImageSourceSequencer;
-      sequencer->connectMyInputTo(0, getInput(0));
-      sequencer->initialize();
-      
-      vector<ossimDpt> decimationFactors;
-      input->getDecimationFactors(decimationFactors);
-      if ( !decimationFactors.size() )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimImageHistogramSource::computeNormalModeHistogram WARNING:"
-            << "\nNo decimation factors from input.  returning..." << std::endl;
-         return;
-      }
-      
-      ossim_uint32 resLevelsToCompute = ossim::min((ossim_uint32)theMaxNumberOfResLevels,
-                                                   (ossim_uint32)decimationFactors.size());
-         
-      if( decimationFactors.size() < theMaxNumberOfResLevels)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "Number Decimations is smaller than the request number of r-levels defaulting to the smallest of the 2 numbers" << endl;
-      }
-
-      theHistogram->create(resLevelsToCompute);
-      for(index = 0; index < resLevelsToCompute; ++index)
-      {
-         sequencer->setAreaOfInterest(theAreaOfInterest*decimationFactors[index]);
-         
-         totalTiles += sequencer->getNumberOfTiles();
-      }
-      
-      
-      if(numberOfBins > 0)
-      {
-         setPercentComplete(0.0);
-         for(index = 0;
-             (index < resLevelsToCompute);
-             ++index)
-         {
-            // Check for abort request.
-            if (needsAborting())
-            {
-               setPercentComplete(100);
-               break;
-            }
-            
-            //sequencer->setAreaOfInterest(input->getBoundingRect(index));
-            sequencer->setAreaOfInterest(theAreaOfInterest*decimationFactors[index]);
-            
-            sequencer->setToStartOfSequence();
-            theHistogram->getMultiBandHistogram(index)->create(numberOfBands,
-                                                               numberOfBins,
-                                                               minValue,
-                                                               maxValue);
-            
-            ossimRefPtr<ossimImageData> data = sequencer->getNextTile(index);
-            ++tileCount;
-            setPercentComplete((100.0*(tileCount/totalTiles)));
-            
-            ossim_uint32 resLevelTotalTiles = sequencer->getNumberOfTiles();
-            for (ossim_uint32 resLevelTileCount = 0;
-                 resLevelTileCount < resLevelTotalTiles;
-                 ++resLevelTileCount)
-            {
-               if(data.valid()&&data->getBuf()&&(data->getDataObjectStatus() != OSSIM_EMPTY))
-               {
-                  data->populateHistogram(theHistogram->getMultiBandHistogram(index));
-               }
-               
-               // Check for abort request.
-               if (needsAborting())
-               {
-                  setPercentComplete(100);
-                  break;
-               }
-               
-               
-               data = sequencer->getNextTile(index);
-               ++tileCount;
-               setPercentComplete((100.0*(tileCount/totalTiles)));
-            }
-         }
-      }
-      sequencer->disconnect();
-      sequencer = 0;
-   }
-}
-
-void ossimImageHistogramSource::computeFastModeHistogram()
-{
-   // We will only compute a full res histogram in fast mode.  and will only do a MAX of 100 tiles.
-   //
-   ossim_uint32 resLevelsToCompute = 1;
-	
-   // ref ptr, not a leak.
-   theHistogram = new ossimMultiResLevelHistogram;
-   theHistogram->create(resLevelsToCompute);
-   ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(0));
-   if(!input)
-   {
-      setPercentComplete(100.0);
-      return;
-   }
-   // sum up all tiles needing processing.  We will use the sequencer.
-   //      ossim_uint32 numberOfResLevels = input->getNumberOfDecimationLevels();
-   double tileCount   = 0.0;
-   double totalTiles  = 0.0;
-   ossim_uint32 numberOfBands = input->getNumberOfOutputBands();
-   ossim_uint32 numberOfBins  = 0;
-   ossim_float64 minValue     = 0;
-   ossim_float64 maxValue     = 0;
-   getBinInformation(numberOfBins, minValue, maxValue, 0);
-	
-   ossimIrect tileBoundary = theAreaOfInterest;
-   ossimIpt tileSize(ossim::max((ossim_uint32)input->getTileWidth(), (ossim_uint32)64),
-                     ossim::max((ossim_uint32)input->getTileHeight(), (ossim_uint32)64));
-	
-   tileBoundary.stretchToTileBoundary(tileSize);
-   ossim_uint32 tilesWide = (tileBoundary.width()/tileSize.x);
-   ossim_uint32 tilesHigh = (tileBoundary.height()/tileSize.y);
-   totalTiles = tilesWide*tilesHigh;
-   
-   if(totalTiles > theNumberOfTilesToUseInFastMode)
-   {
-      ossim_uint32 testTiles = (ossim_uint32) (std::sqrt((double)theNumberOfTilesToUseInFastMode)+.5);
-      tilesWide = testTiles>tilesWide?tilesWide:testTiles;
-      tilesHigh = testTiles>tilesHigh?tilesHigh:testTiles;
-   }
-   if(numberOfBins > 0)
-   {
-      ossimIpt origin = theAreaOfInterest.ul();
-		
-      ossim_uint32 widthWithExcess  = (ossim_uint32)(((ossim_float64)tileBoundary.width()/(tilesWide*tileSize.x))*tileSize.x);
-      ossim_uint32 heightWithExcess = ((ossim_uint32)((ossim_float64)tileBoundary.height()/(tilesHigh*tileSize.y))*tileSize.y);
-      theHistogram->getMultiBandHistogram(0)->create(numberOfBands,
-                                                     numberOfBins,
-                                                     minValue,
-                                                     maxValue);
-		
-      ossim_uint32 x = 0;
-      ossim_uint32 y = 0;
-      tileCount = 0;
-      totalTiles = tilesWide*tilesHigh;
-      for(y = 0; y < tilesHigh; ++y)
-      {
-         for(x = 0; x < tilesWide; ++x)
-         {
-            ossimIpt ul(origin.x + (x*widthWithExcess),
-                        origin.y + (y*heightWithExcess));
-            ossimIrect tileRect(ul.x, ul.y, ul.x + tileSize.x-1, ul.y + tileSize.y-1);
-            ossimRefPtr<ossimImageData> data = input->getTile(tileRect);
-				
-            if(data.valid()&&data->getBuf()&&(data->getDataObjectStatus() != OSSIM_EMPTY))
-            {
-               data->populateHistogram(theHistogram->getMultiBandHistogram(0));
-            }
-            ++tileCount;
-            setPercentComplete((100.0*(tileCount/totalTiles)));
-         }
-      }
-   }
-}
-
-bool ossimImageHistogramSource::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   ossimHistogramSource::loadState(kwl, prefix);  
-   setNumberOfInputs(2);
-   ossimString rect = kwl.find(prefix, "rect");
-
-   if(!rect.empty())
-   {
-      loadState(kwl, prefix);
-   }
-   else 
-   {
-      ossimString newPrefix = ossimString(prefix) + "area_of_interest.";
-      theAreaOfInterest.loadState(kwl, newPrefix);
-   }
-   
-   ossimString mode = kwl.find(prefix, "mode");
-   mode = mode.downcase();
-   if(mode == "normal")
-   {
-      theComputationMode = OSSIM_HISTO_MODE_NORMAL;
-   }
-   else if(mode == "fast")
-   {
-      theComputationMode = OSSIM_HISTO_MODE_FAST;
-   }
-   if(getNumberOfInputs()!=1)
-   {
-      setNumberOfInputs(1);
-   }
-   
-   ossimString numberOfTiles = kwl.find(prefix, "number_of_tiles");
-   if(!numberOfTiles.empty())
-   {
-      theNumberOfTilesToUseInFastMode = numberOfTiles.toUInt32();
-   }
-   theInputListIsFixedFlag = true;
-   theOutputListIsFixedFlag = false;
-	
-   return true;
-}
-
-bool ossimImageHistogramSource::saveState(ossimKeywordlist& kwl,
-                                          const char* prefix)const
-{
-   bool result = ossimHistogramSource::saveState(kwl, prefix);
-   if(result)
-   {
-      ossimString newPrefix = ossimString(prefix) + "area_of_interest.";
-      theAreaOfInterest.saveState(kwl, newPrefix);
-   }
-   return result;
-}
diff --git a/ossim/src/ossim/imaging/ossimImageMetaData.cpp b/ossim/src/ossim/imaging/ossimImageMetaData.cpp
deleted file mode 100644
index 3132a06..0000000
--- a/ossim/src/ossim/imaging/ossimImageMetaData.cpp
+++ /dev/null
@@ -1,535 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Contains class definition for ossimImageMetaData.
-// 
-//*******************************************************************
-//  $Id: ossimImageMetaData.cpp 21745 2012-09-16 15:21:53Z dburken $
-
-#include <ossim/imaging/ossimImageMetaData.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimTrace.h>
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-static ossimTrace traceDebug("ossimImageMetaData:debug");
-
-ossimImageMetaData::ossimImageMetaData()
-   :theNullPixelArray(0),
-    theMinPixelArray(0),
-    theMaxPixelArray(0),
-    theMinValuesValidFlag(false),
-    theMaxValuesValidFlag(false),
-    theNullValuesValidFlag(false),
-    theScalarType(OSSIM_SCALAR_UNKNOWN),
-    theBytesPerPixel(0),
-    theNumberOfBands(0)
-{
-}
-
-ossimImageMetaData::ossimImageMetaData(ossimScalarType aType,
-				       ossim_uint32 numberOfBands)
-   :theNullPixelArray(0),
-    theMinPixelArray(0),
-    theMaxPixelArray(0),
-    theMinValuesValidFlag(false),
-    theMaxValuesValidFlag(false),
-    theNullValuesValidFlag(false),
-    theScalarType(aType),
-    theBytesPerPixel(0),
-    theNumberOfBands(numberOfBands)
-{
-   if(theNumberOfBands)
-   {
-      theNullPixelArray = new double[theNumberOfBands];
-      theMinPixelArray  = new double[theNumberOfBands];
-      theMaxPixelArray  = new double[theNumberOfBands];
-      
-      setDefaultsForArrays();
-   }
-   theBytesPerPixel = ossim::scalarSizeInBytes( aType );
-}
-
-ossimImageMetaData::ossimImageMetaData(const ossimImageMetaData& rhs)
-   :
-   theNullPixelArray(0),
-   theMinPixelArray(0),
-   theMaxPixelArray(0),
-   theMinValuesValidFlag(rhs.theMinValuesValidFlag),
-   theMaxValuesValidFlag(rhs.theMaxValuesValidFlag),
-   theNullValuesValidFlag(rhs.theNullValuesValidFlag),
-   theScalarType(rhs.theScalarType),
-   theBytesPerPixel(rhs.theBytesPerPixel),
-   theNumberOfBands(rhs.theNumberOfBands)
-{
-   if(theNumberOfBands)
-   {
-      theNullPixelArray = new double[theNumberOfBands];
-      theMinPixelArray  = new double[theNumberOfBands];
-      theMaxPixelArray  = new double[theNumberOfBands];
-      
-      std::copy(rhs.theNullPixelArray,
-                rhs.theNullPixelArray+theNumberOfBands,
-                theNullPixelArray);
-      std::copy(rhs.theMinPixelArray,
-                rhs.theMinPixelArray+theNumberOfBands,
-                theMinPixelArray);
-      std::copy(rhs.theMaxPixelArray,
-                rhs.theMaxPixelArray+theNumberOfBands,
-                theMaxPixelArray);
-   }
-}
-
-const ossimImageMetaData& ossimImageMetaData::operator=( const ossimImageMetaData& rhs )
-{
-   if( this != &rhs )
-   {
-      clear();
-      theMinValuesValidFlag  = rhs.theMinValuesValidFlag;
-      theMaxValuesValidFlag  = rhs.theMaxValuesValidFlag;
-      theNullValuesValidFlag = rhs.theNullValuesValidFlag;
-      theNumberOfBands       = rhs.theNumberOfBands;
-      theScalarType          = rhs.theScalarType;
-      theBytesPerPixel       = rhs.theBytesPerPixel;
-      if(theNumberOfBands)
-      {
-         theNullPixelArray = new double[theNumberOfBands];
-         theMinPixelArray  = new double[theNumberOfBands];
-         theMaxPixelArray  = new double[theNumberOfBands];
-         
-         std::copy(rhs.theNullPixelArray,
-                   rhs.theNullPixelArray+theNumberOfBands,
-                   theNullPixelArray);
-         std::copy(rhs.theMinPixelArray,
-                   rhs.theMinPixelArray+theNumberOfBands,
-                   theMinPixelArray);
-         std::copy(rhs.theMaxPixelArray,
-                   rhs.theMaxPixelArray+theNumberOfBands,
-                   theMaxPixelArray);
-      }
-   }
-   return *this;
-}
-
-ossimImageMetaData::~ossimImageMetaData()
-{
-  clear();
-}
-
-void ossimImageMetaData::clear()
-{
-   if(theNullPixelArray)
-   {
-      delete [] theNullPixelArray;
-      theNullPixelArray = 0;
-   }
-   if(theMinPixelArray)
-   {
-      delete [] theMinPixelArray;
-      theMinPixelArray = 0;
-   }
-   if(theMaxPixelArray)
-   {
-      delete [] theMaxPixelArray;
-      theMaxPixelArray = 0;
-   }
-   theScalarType    = OSSIM_SCALAR_UNKNOWN;
-   theBytesPerPixel = 0;
-   theNumberOfBands = 0;
-}
-
-void ossimImageMetaData::setDefaultsForArrays()
-{
-   ossim_uint32 i=0;
-   
-   for(i = 0; i < theNumberOfBands; ++i)
-   {
-      theNullPixelArray[i] = ossim::defaultNull(theScalarType);
-      theMinPixelArray[i]  = ossim::defaultMin(theScalarType);
-      theMaxPixelArray[i]  = ossim::defaultMax(theScalarType);
-   }
-}
-
-void ossimImageMetaData::setNumberOfBands(ossim_uint32 numberOfBands)
-{
-   if(theNullPixelArray)
-   {
-      delete [] theNullPixelArray;
-      theNullPixelArray = 0;
-   }
-   if(theMinPixelArray)
-   {
-      delete [] theMinPixelArray;
-      theMinPixelArray = 0;
-   }
-   if(theMaxPixelArray)
-   {
-      delete [] theMaxPixelArray;
-      theMaxPixelArray = 0;
-   }
-   
-   theNumberOfBands = numberOfBands;
-
-   if(theNumberOfBands)
-   {
-      theNullPixelArray = new double[theNumberOfBands];
-      theMinPixelArray  = new double[theNumberOfBands];
-      theMaxPixelArray  = new double[theNumberOfBands];
-   
-      setDefaultsForArrays();
-   }
-}
-
-bool ossimImageMetaData::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   bool result = false; // return status
-   
-   // Clear the object:
-   clear();
-
-   std::string pfx = ( prefix ? prefix : "" );
-   
-   ossim_uint32 bands = getBandCount( kwl, pfx );
-   if ( bands )
-   {
-      result = true;
-
-      setNumberOfBands( bands );
-      
-      theMinValuesValidFlag  = true;
-      theMaxValuesValidFlag  = true;
-      theNullValuesValidFlag = true;
-
-      updateMetaData( kwl, pfx ); // Initializes the rest of object.
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << " ERROR:\n"
-            << "Required keyword not found:  " << ossimKeywordNames::NUMBER_BANDS_KW << std::endl;
-      }
-   }
-   
-   if (traceDebug())
-   {
-      print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-
-   return result;
-}
-
-bool ossimImageMetaData::saveState(ossimKeywordlist& kwl,
-				   const char* prefix)const
-{
-   if ( theNumberOfBands )
-   {
-      ossim_uint32 band = 0;
-      
-      for (band=0; band < theNumberOfBands; ++band)
-      {
-         ossimString kwMin = (ossimKeywordNames::BAND_KW +
-                              ossimString::toString(band+1) + "." +
-                              ossimKeywordNames::MIN_VALUE_KW);
-         ossimString kwMax = (ossimKeywordNames::BAND_KW +
-                              ossimString::toString(band+1) + "." +
-                              ossimKeywordNames::MAX_VALUE_KW);
-         ossimString kwNull = (ossimKeywordNames::BAND_KW +
-                               ossimString::toString(band+1) + "." +
-                               ossimKeywordNames::NULL_VALUE_KW);
-         
-         kwl.add(prefix,
-                 kwMin.c_str(),
-                 theMinPixelArray[band],
-                 true);
-         kwl.add(prefix,
-                 kwMax.c_str(),
-                 theMaxPixelArray[band],
-                 true);
-         kwl.add(prefix,
-                 kwNull.c_str(),
-                 theNullPixelArray[band],
-                 true);
-      }
-      // std::cout << "added bands ******************" << std::endl;
-      kwl.add(prefix,
-	      ossimKeywordNames::NUMBER_BANDS_KW,
-	      theNumberOfBands,
-	      true);
-      kwl.add(prefix,
-	      ossimKeywordNames::SCALAR_TYPE_KW,
-	      (ossimScalarTypeLut::instance()->getEntryString(theScalarType)),
-	      true);
-
-      kwl.add( prefix, "bytes_per_pixel", theBytesPerPixel, true );
-   }
-   
-   return true;
-}
-
-ossim_uint32 ossimImageMetaData::getNumberOfBands()const
-{
-   return theNumberOfBands;
-}
-
-void ossimImageMetaData::setScalarType(ossimScalarType aType)
-{
-   theScalarType    = aType;
-   theBytesPerPixel = ossim::scalarSizeInBytes( aType );
-}
-
-ossimScalarType ossimImageMetaData::getScalarType()const
-{
-   return theScalarType;
-}
-
-ossim_uint32 ossimImageMetaData::getBytesPerPixel() const
-{
-   return theBytesPerPixel;
-}
-
-void ossimImageMetaData::setMinPix(ossim_uint32 band, double pix)
-{
-   if((band < theNumberOfBands)&&(theMinPixelArray))
-   {
-      theMinPixelArray[band] = pix;
-   }
-}
-
-void ossimImageMetaData::setMaxPix(ossim_uint32 band, double pix)
-{
-   if((band < theNumberOfBands) && theMaxPixelArray)
-   {
-      theMaxPixelArray[band] = pix;
-   }
-}
-
-void ossimImageMetaData::setNullPix(ossim_uint32 band, double pix)
-{
-   if((band < theNumberOfBands)&&(theNullPixelArray))
-   {
-      theNullPixelArray[band] = pix;
-   }
-}
-
-double ossimImageMetaData::getMinPix(ossim_uint32 band)const
-{
-   if(theNumberOfBands&&theMinPixelArray)
-   {
-      ossim_uint32 i = ossim::min(band, (ossim_uint32)(theNumberOfBands-1));
-      
-      return theMinPixelArray[i];
-   }
-   return ossim::defaultMin(theScalarType);
-}
-
-double ossimImageMetaData::getMaxPix(ossim_uint32 band)const
-{
-   if(theNumberOfBands&&theMaxPixelArray)
-   {
-      ossim_uint32 i = ossim::min(band, (ossim_uint32)(theNumberOfBands-1));
-      
-      return theMaxPixelArray[i];
-   }
-   return ossim::defaultMax(theScalarType);
-}
-
-double ossimImageMetaData::getNullPix(ossim_uint32 band)const
-{
-   if(theNumberOfBands&&theNullPixelArray)
-   {
-      ossim_uint32 i = ossim::min(band, (ossim_uint32)(theNumberOfBands-1));
-      
-      return theNullPixelArray[i];
-   }
-   return ossim::defaultNull(theScalarType);
-}
-
-const double* ossimImageMetaData::getMinPixelArray()const
-{
-   return theMinPixelArray;
-}
-const double* ossimImageMetaData::getMaxPixelArray()const
-{
-   return theMaxPixelArray;
-}
-
-const double* ossimImageMetaData::getNullPixelArray()const
-{
-   return theNullPixelArray;
-}
-
-void ossimImageMetaData::setMinValuesValid(bool flag)
-{
-   theMinValuesValidFlag = flag;
-}
-
-void ossimImageMetaData::setMaxValuesValid(bool flag)
-{
-   theMaxValuesValidFlag = flag;
-}
-
-void ossimImageMetaData::setNullValuesValid(bool flag)
-{
-   theNullValuesValidFlag = flag;
-}
-
-bool ossimImageMetaData::getMinValuesValidFlag()const
-{
-   return theMinValuesValidFlag;
-}
-
-bool ossimImageMetaData::getMaxValuesValidFlag()const
-{
-   return theMaxValuesValidFlag;
-}
-
-bool ossimImageMetaData::getNullValuesValidFlag()const
-{
-   return theNullValuesValidFlag;
-}
-
-bool ossimImageMetaData::isValid()const
-{
-   return (theNumberOfBands > 0);
-//    return ((theNumberOfBands>0)&&
-//            (theScalarType != OSSIM_SCALAR_UNKNOWN));
-}
-
-void ossimImageMetaData::updateMetaData(
-   const ossimKeywordlist& kwl, const std::string& prefix )
-{
-   ossimString value;
-   std::string key;
-   
-   // Get the bands:
-   if ( !theNumberOfBands )
-   {
-      ossim_uint32 bands = getBandCount( kwl, prefix );
-      if ( bands )
-      {
-         setNumberOfBands( bands );
-      }
-   }
-
-   if ( theNumberOfBands )
-   {
-      //---
-      // See if bands are zero or one based.  Bands are ONE based in the "omd"
-      // file! If band0 is present assume zero based.
-      //---
-
-      ossimString regExpression = std::string("^(") + prefix + std::string("band0+.)");
-      std::vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
-
-      ossim_uint32 startBand = (keys.size() ? 0 : 1);
-
-      ossim_uint32 limit = theNumberOfBands+startBand; // For for loop:
-      
-      std::string bs = "band"; // band sting
-      std::string base;
-      
-      for ( ossim_uint32 band = startBand; band < limit; ++band )
-      {
-         base = bs + ossimString::toString( band ).string() + std::string(".") ;
-
-         // Min:
-         key = base + std::string(ossimKeywordNames::MIN_VALUE_KW);
-         value =  kwl.findKey( prefix, key );
-         
-         if ( value.size() )
-         {
-            theMinPixelArray[ band - startBand  ] = value.toFloat64();
-         }
-
-         // Max:
-         key = base + std::string(ossimKeywordNames::MAX_VALUE_KW);
-         value =  kwl.findKey( prefix, key );
-         if ( value.size() )
-         {
-            theMaxPixelArray[ band - startBand ] = value.toFloat64();
-         }
-
-         // Null:
-         key = base + std::string(ossimKeywordNames::NULL_VALUE_KW);
-         value =  kwl.findKey( prefix, key );
-         if ( value.size() )
-         {
-            theNullPixelArray[ band - startBand ] = value.toFloat64();
-         }
-      }  
-   }
-
-   // Scalar, only look for if not set.
-   if ( theScalarType == OSSIM_SCALAR_UNKNOWN )
-   {
-      std::string key = ossimKeywordNames::SCALAR_TYPE_KW; // "scalar_type"
-      value.string() = kwl.findKey( prefix, key );
-      if ( value.empty() )
-      {
-         key = "radiometry";
-         value.string() = kwl.findKey( prefix, key );
-      }
-      if ( value.size() )
-      {
-         theScalarType = ossimScalarTypeLut::instance()->getScalarTypeFromString( value );
-      }
-      
-      if ( theScalarType != OSSIM_SCALAR_UNKNOWN )
-      {
-         theBytesPerPixel = ossim::scalarSizeInBytes( theScalarType );
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageMetaData::updateMetaData DEBUG"
-         << *this << std::endl;
-   }
-}
-
-std::ostream& ossimImageMetaData::print(std::ostream& out) const
-{
-   ossimKeywordlist kwl;
-   saveState( kwl, 0 );
-   out << kwl << std::endl;
-   return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimImageMetaData& obj)
-{
-   return obj.print( out );
-}
-
-ossim_uint32 ossimImageMetaData::getBandCount(const ossimKeywordlist& kwl,
-                                              const std::string& prefix) const
-{
-   ossim_uint32 result = 0;
-
-   ossimString value;
-   value.string() = kwl.findKey( prefix, std::string(ossimKeywordNames::NUMBER_BANDS_KW) );
-   if ( value.size() )
-   {
-      result = value.toUInt32();
-   }
-   else
-   {
-      value.string() = std::string("^(") + prefix + std::string("band[0-9]+.)");
-      std::vector<ossimString> keys = kwl.getSubstringKeyList( value );
-      result = static_cast<ossim_uint32>( keys.size() );
-   }
-   return result;   
-}
diff --git a/ossim/src/ossim/imaging/ossimImageMetaDataWriterFactoryBase.cpp b/ossim/src/ossim/imaging/ossimImageMetaDataWriterFactoryBase.cpp
deleted file mode 100644
index b7f618c..0000000
--- a/ossim/src/ossim/imaging/ossimImageMetaDataWriterFactoryBase.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//----------------------------------------------------------------------------
-// $Id: ossimImageMetaDataWriterFactoryBase.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageMetaDataWriterFactoryBase.h>
-
-RTTI_DEF1(ossimImageMetaDataWriterFactoryBase,
-          "ossimImageMetaDataWriterFactoryBase",
-          ossimObjectFactory);
-
-ossimImageMetaDataWriterFactoryBase::ossimImageMetaDataWriterFactoryBase()
-{
-}
-
-ossimImageMetaDataWriterFactoryBase::ossimImageMetaDataWriterFactoryBase(
-   const ossimImageMetaDataWriterFactoryBase&)
-{
-}
-
-const ossimImageMetaDataWriterFactoryBase&
-ossimImageMetaDataWriterFactoryBase::operator=(
-   const ossimImageMetaDataWriterFactoryBase&)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageMetaDataWriterRegistry.cpp b/ossim/src/ossim/imaging/ossimImageMetaDataWriterRegistry.cpp
deleted file mode 100644
index 50f3267..0000000
--- a/ossim/src/ossim/imaging/ossimImageMetaDataWriterRegistry.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//----------------------------------------------------------------------------
-// $Id: ossimImageMetaDataWriterRegistry.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <ossim/imaging/ossimImageMetaDataWriterRegistry.h>
-#include <ossim/imaging/ossimImageMetaDataWriterFactory.h>
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <algorithm>
-
-//ossimImageMetaDataWriterRegistry*
-//ossimImageMetaDataWriterRegistry::theInstance= NULL;
-
-ossimImageMetaDataWriterRegistry::ossimImageMetaDataWriterRegistry()
-{
-   registerFactory(ossimImageMetaDataWriterFactory::instance());
-   ossimObjectFactoryRegistry::instance()->registerFactory(this);
-}
-
-ossimImageMetaDataWriterRegistry::~ossimImageMetaDataWriterRegistry()
-{
-   ossimObjectFactoryRegistry::instance()->unregisterFactory(this);
-}
-
-ossimImageMetaDataWriterRegistry* ossimImageMetaDataWriterRegistry::instance()
-{
-   static ossimImageMetaDataWriterRegistry sharedInstance;
-
-   return &sharedInstance;
-}
-
-void ossimImageMetaDataWriterRegistry::registerFactory(
-   ossimImageMetaDataWriterFactoryBase* factory)
-{
-   if(factory&&!findFactory(factory))
-   {
-      theFactoryList.push_back(factory);
-   }
-}
-
-void ossimImageMetaDataWriterRegistry::unregisterFactory(
-   ossimImageMetaDataWriterFactoryBase* factory)
-{
-   std::vector<ossimImageMetaDataWriterFactoryBase*>::iterator iter =
-      std::find(theFactoryList.begin(),
-                theFactoryList.end(),
-                factory);
-   if(iter != theFactoryList.end())
-   {
-      theFactoryList.erase(iter);
-   }
-}
-
-bool ossimImageMetaDataWriterRegistry::findFactory(
-   ossimImageMetaDataWriterFactoryBase* factory)const
-{
-   return (std::find(theFactoryList.begin(),
-                     theFactoryList.end(),
-                     factory)!=theFactoryList.end());
-}
-
-
-ossimObject* ossimImageMetaDataWriterRegistry::createObject(
-   const ossimString& typeName) const
-{
-   ossimObject* result = NULL;
-   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator factory;
-   
-   factory = theFactoryList.begin();
-   while((factory != theFactoryList.end()) && !result)
-   {
-      result = (*factory)->createObject(typeName);
-      ++factory;
-   }
-   
-   return result;
-}
-
-ossimObject* ossimImageMetaDataWriterRegistry::createObject(
-   const ossimKeywordlist& kwl,
-   const char* prefix) const
-{
-   ossimObject* result = NULL;
-   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator factory;
-
-   factory = theFactoryList.begin();
-   while((factory != theFactoryList.end()) && !result)
-   {
-     result = (*factory)->createObject(kwl, prefix);
-     ++factory;
-   }
-   return result;
-}
-
-ossimRefPtr<ossimMetadataFileWriter>
-ossimImageMetaDataWriterRegistry::createWriter(const ossimString& type) const
-{
-   ossimRefPtr<ossimMetadataFileWriter> result = NULL;
-   
-   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator factory;
-   factory = theFactoryList.begin();
-   while((factory != theFactoryList.end()) && !result)
-   {
-     result = (*factory)->createWriter(type);
-     ++factory;
-   }
-   return result;
-}
-
-void ossimImageMetaDataWriterRegistry::getTypeNameList(
-   std::vector<ossimString>& typeList) const
-{
-   std::vector<ossimString> result;
-   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator iter =
-      theFactoryList.begin();
-
-   while(iter != theFactoryList.end())
-   {
-      result.clear();
-      (*iter)->getTypeNameList(result);
-
-      // now append to the end of the typeList.
-      typeList.insert(typeList.end(),
-                      result.begin(),
-                      result.end());
-      ++iter;
-   }
-}
-
-void ossimImageMetaDataWriterRegistry::getMetadatatypeList(
-   std::vector<ossimString>& metadatatypeList) const
-{
-   //---
-   // Since this is the master registry for all meta data writer factories
-   // we will start with a cleared list.
-   //---
-   metadatatypeList.clear();
-   
-   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator iter =
-      theFactoryList.begin();
-   
-   while(iter != theFactoryList.end())
-   {
-      (*iter)->getMetadatatypeList(metadatatypeList);
-      ++iter;
-   } 
-}
-
-ossimImageMetaDataWriterRegistry::ossimImageMetaDataWriterRegistry(
-   const ossimImageMetaDataWriterRegistry& /* rhs */)
-{
-}
-
-const ossimImageMetaDataWriterRegistry&
-ossimImageMetaDataWriterRegistry::operator=(
-   const ossimImageMetaDataWriterRegistry& /* rhs */)
-{
-   return *this;
-}
-
-extern "C"
-{
-   void* ossimImageMetaDataWriterRegistryGetInstance()
-   {
-      return ossimImageMetaDataWriterRegistry::instance();
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageModel.cpp b/ossim/src/ossim/imaging/ossimImageModel.cpp
deleted file mode 100644
index b69bc78..0000000
--- a/ossim/src/ossim/imaging/ossimImageModel.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class definition of ossimImageModel.
-//
-//-----------------------------------------------------------------------------
-// $Id$
-
-#include <string>
-
-#include <ossim/imaging/ossimImageModel.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/imaging/ossimImageHandler.h>
-
-RTTI_DEF1(ossimImageModel, "ossimImageModel", ossimObject);
-
-ossimImageModel::ossimImageModel()
-   : ossimObject(),
-     theSubImageOffset(),
-     theDecimationFactors(),
-     theLines(0),
-     theSamples(0),
-     theTargetRrds(0)
-{
-}
-
-ossimImageModel::~ossimImageModel()
-{
-}
-
-void ossimImageModel::initialize(const ossimImageHandler& ih)
-{
-   theSubImageOffset = ossimDpt();
-   theLines          = ih.getNumberOfLines(0);
-   theSamples        = ih.getNumberOfSamples(0);
-   ih.getDecimationFactors(theDecimationFactors);
-}
-
-void ossimImageModel::rnToR0(ossim_uint32 rrds,
-                             const ossimDpt& rnPt,
-                             ossimDpt& r0Pt) const
-{
-   if ( rrds < theDecimationFactors.size() )
-   {
-      r0Pt.x = rnPt.x / theDecimationFactors[rrds].x;
-      r0Pt.y = rnPt.y / theDecimationFactors[rrds].y;
-   }
-   else
-   {
-      std::string e = "ossimImageModel::rnToR0 rrds out of range!";
-      throw ossimException(e);
-   }
-}
-void ossimImageModel::rnToR0(const ossimDpt& rnPt, ossimDpt& r0Pt) const
-{
-   rnToR0(theTargetRrds, rnPt, r0Pt);
-}
-   
-void ossimImageModel::r0ToRn(ossim_uint32 rrds,
-                             const ossimDpt& r0Pt,
-                             ossimDpt& rnPt) const
-{
-   if ( rrds < theDecimationFactors.size() )
-   {
-      rnPt.x = r0Pt.x * theDecimationFactors[rrds].x;
-      rnPt.y = r0Pt.y * theDecimationFactors[rrds].y;
-   }
-   else
-   {
-      std::string e = "ossimImageModel::r0ToRn rrds out of range!";
-      throw ossimException(e);
-   }
-}
-
-void ossimImageModel::r0ToRn(const ossimDpt& r0Pt, ossimDpt& rnPt) const
-{
-   r0ToRn(theTargetRrds, r0Pt, rnPt);
-}
-
-void ossimImageModel::getSubImageOffset(ossim_uint32 rrds,
-                                        ossimDpt& offset) const
-{
-   if ( rrds < theDecimationFactors.size() )
-   {
-      offset.x = theSubImageOffset.x * theDecimationFactors[rrds].x;
-      offset.y = theSubImageOffset.y * theDecimationFactors[rrds].y;
-   }
-   else
-   {
-      std::string e = "ossimImageModel::getSubImageOffset rrds out of range!";
-      throw ossimException(e);
-   } 
-}
-
-void ossimImageModel::getImageRectangle(ossim_uint32 rrds,
-                                        ossimDrect& rect) const
-{
-   if ( rrds < theDecimationFactors.size() )
-   {
-      ossim_float64 lrX = theSamples * theDecimationFactors[rrds].x - 1.0;
-      ossim_float64 lrY = theLines   * theDecimationFactors[rrds].y - 1.0;
-      ossimDrect r(0.0, 0.0, lrX, lrY);
-      rect = r;
-   }
-   else
-   {
-      std::string e = "ossimImageModel::getImageRectangle rrds out of range!";
-      throw ossimException(e);
-   } 
-}
-
-void ossimImageModel::getBoundingRectangle(ossim_uint32 rrds,
-                                           ossimDrect& rect) const
-{
-   if ( rrds < theDecimationFactors.size() )
-   {
-      ossim_float64 urX = theSubImageOffset.x * theDecimationFactors[rrds].x;
-      ossim_float64 urY = theSubImageOffset.y * theDecimationFactors[rrds].y;
-      
-      ossim_float64 lrX = urX + theSamples*theDecimationFactors[rrds].x - 1.0;
-      ossim_float64 lrY = urY + theLines  *theDecimationFactors[rrds].y - 1.0;
-      ossimDrect r(0, 0, lrX, lrY);
-      rect = r;
-   }
-   else
-   {
-      std::string e =
-         "ossimImageModel::getBoundingRectangle rrds out of range!";
-      throw ossimException(e);
-   }  
-}
-ossim_uint32 ossimImageModel::getNumberOfDecimationLevels()const
-{
-   return (ossim_uint32)theDecimationFactors.size();
-}
-
-void ossimImageModel::setTargetRrds(ossim_uint32 rrds)
-{
-   theTargetRrds = rrds;
-}
-
-ossim_uint32 ossimImageModel::getTargetRrds() const
-{
-   return theTargetRrds;
-}
-
-   
-
-
diff --git a/ossim/src/ossim/imaging/ossimImageMosaic.cpp b/ossim/src/ossim/imaging/ossimImageMosaic.cpp
deleted file mode 100644
index 51eab66..0000000
--- a/ossim/src/ossim/imaging/ossimImageMosaic.cpp
+++ /dev/null
@@ -1,525 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-// 
-// Description: implementation for image mosaic
-//
-//*************************************************************************
-// $Id: ossimImageMosaic.cpp 15766 2009-10-20 12:37:09Z gpotts $
-
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimTrace.h>
-static const ossimTrace traceDebug("ossimImageMosaic:debug");
-
-using namespace std;
-
-RTTI_DEF1(ossimImageMosaic, "ossimImageMosaic", ossimImageCombiner)
-ossimImageMosaic::ossimImageMosaic()
-   :ossimImageCombiner(),
-    theTile(NULL)
-{
-
-}
-
-ossimImageMosaic::ossimImageMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
-    : ossimImageCombiner(inputSources),
-      theTile(NULL)
-{
-}
-
-
-ossimImageMosaic::~ossimImageMosaic()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimImageMosaic::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   long size = getNumberOfInputs();
-   ossim_uint32 layerIdx = 0;
-   // If there is only one in the mosaic then just return it.
-   if(size == 1)
-   {
-      return getNextTile(layerIdx, 0, tileRect, resLevel);
-   }
-   
-   ossimIpt origin = tileRect.ul();
-   ossim_uint32 w = tileRect.width();
-   ossim_uint32 h = tileRect.height();
-   
-   if(!theTile.valid())
-   {
-      // try to initialize
-      allocate();
-
-      // if we still don't have a buffer
-      // then we will leave
-      if(!theTile.valid())
-      {
-         return ossimRefPtr<ossimImageData>();
-      }
-   }
-   
-   ossim_uint32 tileW = theTile->getWidth();
-   ossim_uint32 tileH = theTile->getHeight();
-   if((w != tileW)||
-      (h != tileH))
-   {
-      theTile->setWidth(w);
-      theTile->setHeight(h);
-      if((w*h)!=(tileW*tileH))
-      {
-         theTile->initialize();
-      }
-   }
-   theTile->setOrigin(origin);
-
-   //---
-   // General Note:
-   //
-   // Note: I will not check for disabled or enabled since we have
-   // no clear way to handle this within a mosaic. The default will be
-   // to do a simple a A over B type mosaic.  Derived classes should
-   // check for the enabled and disabled and always
-   // use this default implementation if they are disabled.
-   //---
-
-   theTile->setOrigin(origin);
-   theTile->makeBlank();
-   switch(theTile->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint8>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint8>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SINT8:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint8>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint8>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_FLOAT: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<float>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<float>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint16>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint16>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SSHORT16:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint16>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint16>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SINT32:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint32>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint32>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_UINT32:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint32>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint32>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<double>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<double>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Scalar type = " << theTile->getScalarType()
-            << " Not supported by ossimImageMosaic" << endl;
-      }
-   }
-
-   return ossimRefPtr<ossimImageData>();
-}
-
-void ossimImageMosaic::initialize()
-{
-  ossimImageCombiner::initialize();
-  theTile = NULL;
-}
-
-void ossimImageMosaic::allocate()
-{
-   theTile = NULL;
-   
-   if( (getNumberOfInputs() > 0) && getInput(0) )
-   {
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-   }
-}
-
-bool ossimImageMosaic::saveState(ossimKeywordlist& kwl,
-                                 const char* prefix)const
-{
-   return ossimImageCombiner::saveState(kwl, prefix);
-}
-
-bool ossimImageMosaic::loadState(const ossimKeywordlist& kwl,
-                                 const char* prefix)
-{
-   return ossimImageCombiner::loadState(kwl, prefix);
-}
-
-template <class T> ossimRefPtr<ossimImageData> ossimImageMosaic::combineNorm(
-   T,// dummy template variable 
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossim_uint32 layerIdx = 0;
-   //---
-   // Get the first tile from the input sources.  If this(index 0) is blank
-   // that means there are no layers so go no further.
-   //---
-   ossimRefPtr<ossimImageData> currentImageData =
-      getNextNormTile(layerIdx, 0, tileRect, resLevel);
-   if(!currentImageData)
-   {
-      return theTile;
-   }
-   
-   ossimRefPtr<ossimImageData> destination = theTile;
-   ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
-
-   
-   float** srcBands         = new float*[theLargestNumberOfInputBands];
-   float*  srcBandsNullPix  = new float[theLargestNumberOfInputBands];
-   T**     destBands        = new T*[theLargestNumberOfInputBands];
-   T*      destBandsNullPix = new T[theLargestNumberOfInputBands];
-   T*      destBandsMinPix  = new T[theLargestNumberOfInputBands];
-   T*      destBandsMaxPix  = new T[theLargestNumberOfInputBands];
-   
-   ossim_uint32 band;
-   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
-   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-   for(band = 0; band < minNumberOfBands; ++band)
-   {
-      srcBands[band]  = static_cast<float*>(currentImageData->getBuf(band));
-      srcBandsNullPix[band]  = static_cast<float>(currentImageData->getNullPix(band));
-      
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
-      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
-   }
-   
-   // if the src is smaller than the destination in number
-   // of bands we will just duplicate the last band.
-   for(;band < theLargestNumberOfInputBands; ++band)
-   {
-      srcBands[band]  = static_cast<float*>(srcBands[minNumberOfBands - 1]);
-      srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(minNumberOfBands - 1));
-      
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
-      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
-   }
-
-   // Loop to copy from layers to output tile.
-   while(currentImageData.valid())
-   {
-      //---
-      // Check the status of the source tile.  If empty get the next source
-      // tile and loop back.
-      //---
-       ossimDataObjectStatus currentStatus =
-         currentImageData->getDataObjectStatus();
-      if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
-      {
-         currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
-         continue;
-      }
-      
-      ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-      
-      for(band = 0; band < minNumberOfBands; ++band)
-      {
-         srcBands[band] = static_cast<float*>(currentImageData->getBuf(band));
-         srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
-      }
-      // if the src is smaller than the destination in number
-      // of bands we will just duplicate the last band.
-      for(;band < theLargestNumberOfInputBands; ++band)
-      {
-         srcBands[band] = srcBands[minNumberOfBands - 1];
-         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
-      }
-      
-      if ( (currentStatus == OSSIM_FULL) &&
-           (destinationStatus == OSSIM_EMPTY) )
-      {
-         // Copy full tile to empty tile.
-         for(band=0; band < theLargestNumberOfInputBands; ++band)
-         {
-            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
-            float minP  = destBandsMinPix[band];
-            
-            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-            {
-               destBands[band][offset] =
-                  (T)( minP + delta*srcBands[band][offset]);
-            }
-         }
-      }
-      else // Copy tile checking all the pixels...
-      {
-         for(band = 0; band < theLargestNumberOfInputBands; ++band)
-         {
-            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
-            float minP  = destBandsMinPix[band];
-            
-            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-            {
-               if (destBands[band][offset] == destBandsNullPix[band])
-               {
-                  if (srcBands[band][offset] != srcBandsNullPix[band])
-                  {
-                     destBands[band][offset] =
-                        (T)(minP + delta*srcBands[band][offset]);
-                  }
-               }
-            }
-         }
-      }
-
-      // Validate output tile and return if full.
-      destinationStatus = destination->validate();
-      if (destinationStatus == OSSIM_FULL)
-      {
-         
-         break;//return destination;
-      }
-
-      // If we get here we're are still not full.  Get a tile from next layer.
-      currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
-   }
-
-   // Cleanup...
-   delete [] srcBands;
-   delete [] destBands;
-   delete [] srcBandsNullPix;
-   delete [] destBandsNullPix;
-   delete [] destBandsMinPix;
-   delete [] destBandsMaxPix;
-
-   return destination;
-}
-
-template <class T> ossimRefPtr<ossimImageData> ossimImageMosaic::combine(
-   T,// dummy template variable 
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossim_uint32 layerIdx = 0;
-   //---
-   // Get the first tile from the input sources.  If this(index 0) is blank
-   // that means there are no layers so go no further.
-   //---
-   ossimRefPtr<ossimImageData> currentImageData =
-      getNextTile(layerIdx, 0, tileRect, resLevel);
-   if (!currentImageData)
-   {
-      return theTile;
-   }
-
-   ossimRefPtr<ossimImageData> destination = theTile;
-   ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
-
-   T** srcBands         = new T*[theLargestNumberOfInputBands];
-   T*  srcBandsNullPix  = new T[theLargestNumberOfInputBands];
-   T** destBands        = new T*[theLargestNumberOfInputBands];
-   T*  destBandsNullPix = new T[theLargestNumberOfInputBands];
-      
-   ossim_uint32 band;
-   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
-   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-   for(band = 0; band < minNumberOfBands; ++band)
-   {
-      srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      srcBandsNullPix[band]  = static_cast<T>(currentImageData->getNullPix(band));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-   }
-   // if the src is smaller than the destination in number
-   // of bands we will just duplicate the last band.
-   for(;band < theLargestNumberOfInputBands; ++band)
-   {
-      srcBands[band]  = static_cast<T*>(srcBands[minNumberOfBands - 1]);
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-   }
-
-   // Loop to copy from layers to output tile.
-   while(currentImageData.valid())
-   {
-      //---
-      // Check the status of the source tile.  If empty get the next source
-      // tile and loop back.
-      //---
-      ossimDataObjectStatus currentStatus =
-         currentImageData->getDataObjectStatus();
-      if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
-      {
-         currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
-         continue;
-      }
-      
-      ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-
-      for(band = 0; band < minNumberOfBands; ++band)
-      {
-         srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
-         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
-      }
-      // if the src is smaller than the destination in number
-      // of bands we will just duplicate the last band.
-      for(;band < theLargestNumberOfInputBands; ++band)
-      {
-         srcBands[band] = srcBands[minNumberOfBands - 1];
-         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
-      }
-
-      if ( (currentStatus == OSSIM_FULL) &&
-           (destinationStatus == OSSIM_EMPTY) )
-      {
-         // Copy full tile to empty tile.
-         for(ossim_uint32 band=0; band < theLargestNumberOfInputBands; ++band)
-         {
-            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-            {
-               destBands[band][offset] = srcBands[band][offset];
-            }
-         }
-      }
-      else // Copy tile checking all the pixels...
-      {
-         for(band = 0; band < theLargestNumberOfInputBands; ++band)
-         {
-            
-            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-            {
-               if(destBands[band][offset] == destBandsNullPix[band])
-               {
-                  destBands[band][offset] = srcBands[band][offset];
-               }
-            }
-         }
-      }
-
-      // Validate output tile and return if full.
-      destinationStatus = destination->validate();
-      if (destinationStatus == OSSIM_FULL)
-      {
-         break;//return destination;
-      }
-
-      // If we get here we're are still not full.  Get a tile from next layer.
-      currentImageData = getNextTile(layerIdx, tileRect, resLevel);
-   }
-   
-   // Cleanup...
-   delete [] srcBands;
-   delete [] destBands;
-   delete [] srcBandsNullPix;
-   delete [] destBandsNullPix;
-   
-   return destination;
-}
diff --git a/ossim/src/ossim/imaging/ossimImageRenderer.cpp b/ossim/src/ossim/imaging/ossimImageRenderer.cpp
deleted file mode 100644
index 9b1e5dd..0000000
--- a/ossim/src/ossim/imaging/ossimImageRenderer.cpp
+++ /dev/null
@@ -1,2401 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimImageRenderer.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimProcessProgressEvent.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimConnectableContainerInterface.h>
-#include <ossim/base/ossimViewController.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimDiscrete3x3HatFilter.h>
-#include <ossim/imaging/ossimDiscreteNearestNeighbor.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimImageViewTransformFactory.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <iostream>
-using namespace std;
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimImageRenderer.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-
-static ossimTrace traceDebug("ossimImageRenderer:debug");
-
-RTTI_DEF2(ossimImageRenderer, "ossimImageRenderer", ossimImageSourceFilter, ossimViewInterface);
-
-
-
-void ossimImageRenderer::ossimRendererSubRectInfo::splitHorizontal(std::vector<ossimRendererSubRectInfo>& result)const
-{
-   ossimIrect vrect(m_Vul,
-                    m_Vur,
-                    m_Vlr,
-                    m_Vll);
-   ossim_int32 w  = vrect.width();
-   // ossim_int32 h  = vrect.height();
-   ossim_int32 w2 = w>>1;
-   ossimIrect tempLeftRect(m_Vul.x, 
-                           m_Vul.y, 
-                           m_Vul.x+w2-1, 
-                           m_Vlr.y);
-   ossimIrect tempRightRect(tempLeftRect.ur().x+1, 
-                            m_Vul.y, 
-                            m_Vur.x, 
-                            m_Vlr.y);
-
-
-   ossimRendererSubRectInfo left(m_transform.get());
-   ossimRendererSubRectInfo right(m_transform.get());
-
-   left.m_viewBounds = m_viewBounds;
-   right.m_viewBounds = m_viewBounds;
-
-   left.m_Vul = tempLeftRect.ul();
-   left.m_Vur = tempLeftRect.ur();
-   left.m_Vlr = tempLeftRect.lr();
-   left.m_Vll = tempLeftRect.ll();
-
-   right.m_Vul = tempRightRect.ul();
-   right.m_Vur = tempRightRect.ur();
-   right.m_Vlr = tempRightRect.lr();
-   right.m_Vll = tempRightRect.ll();
-
-   left.transformViewToImage();
-   right.transformViewToImage();
-
-   if(left.imageIsNan())
-   {
-      if(left.m_viewBounds->intersects(left.getViewRect()))
-      {
-         result.push_back(left);
-      }
-   }
-   else
-   {
-      result.push_back(left);
-   }
-   if(right.imageIsNan())
-   {
-      if(right.m_viewBounds->intersects(right.getViewRect()))
-      {
-         result.push_back(right);
-      }
-   }
-   else
-   {
-      result.push_back(right);
-   }
-}
-
-void ossimImageRenderer::ossimRendererSubRectInfo::splitVertical(std::vector<ossimRendererSubRectInfo>& result)const
-{
-   ossimIrect vrect(m_Vul,
-                    m_Vur,
-                    m_Vlr,
-                    m_Vll);
-   // ossim_int32 w  = vrect.width();
-   ossim_int32 h  = vrect.height();
-   ossim_int32 h2 = h>>1;
-   ossimIrect tempTopRect(m_Vul.x, 
-                          m_Vul.y, 
-                          m_Vlr.x, 
-                          m_Vul.y+h2-1);
-   ossimIrect tempBottomRect(m_Vul.x, 
-                             tempTopRect.lr().y+1, 
-                             m_Vlr.x, 
-                             m_Vlr.y);
-
-   ossimRendererSubRectInfo top(m_transform.get());
-   ossimRendererSubRectInfo bottom(m_transform.get());
-
-   top.m_viewBounds    = m_viewBounds;
-   bottom.m_viewBounds = m_viewBounds;
-
-   top.m_Vul = tempTopRect.ul();
-   top.m_Vur = tempTopRect.ur();
-   top.m_Vlr = tempTopRect.lr();
-   top.m_Vll = tempTopRect.ll();
-
-   bottom.m_Vul = tempBottomRect.ul();
-   bottom.m_Vur = tempBottomRect.ur();
-   bottom.m_Vlr = tempBottomRect.lr();
-   bottom.m_Vll = tempBottomRect.ll();
-
-   top.transformViewToImage();
-   bottom.transformViewToImage();
-
-   if(top.imageIsNan())
-   {
-      if(top.m_viewBounds->intersects(top.getViewRect()))
-      {
-         result.push_back(top);
-      }
-   }
-   else
-   {
-      result.push_back(top);
-   }
-   if(bottom.imageIsNan())
-   {
-      if(bottom.m_viewBounds->intersects(bottom.getViewRect()))
-      {
-         result.push_back(bottom);
-      }
-   }
-   else
-   {
-      result.push_back(bottom);
-   }
-}
-
-void ossimImageRenderer::ossimRendererSubRectInfo::splitAll(std::vector<ossimRendererSubRectInfo>& result)const
-{
-   //std::cout << "FULL Split\n" << std::endl;
-   // let splitAll for now.  We can still optimize but will do that later
-   ossimIrect tempUlRect;
-   ossimIrect tempUrRect;
-   ossimIrect tempLrRect;
-   ossimIrect tempLlRect;
-   ossimIrect vrect(m_Vul,
-                    m_Vur,
-                    m_Vlr,
-                    m_Vll);
-   ossim_int32 w  = vrect.width();
-   ossim_int32 h  = vrect.height();
-   ossim_int32 w2 = w>>1;
-   ossim_int32 h2 = h>>1;
-
-   tempUlRect = ossimIrect(m_Vul.x,
-                           m_Vul.y,
-                           m_Vul.x + (w2 - 1),
-                           m_Vul.y + (h2 - 1));
-  
-   tempUrRect = ossimIrect(tempUlRect.ur().x+1,
-                           m_Vul.y,
-                           m_Vur.x,
-                           m_Vul.y + (h2 - 1));
-  
-   tempLrRect = ossimIrect(tempUlRect.lr().x,
-                           tempUlRect.lr().y+1,
-                           m_Vlr.x,
-                           m_Vlr.y);
-  
-   tempLlRect = ossimIrect(m_Vul.x,
-                           tempUlRect.ll().y+1,
-                           tempLrRect.ul().x,
-                           tempLrRect.ll().y);
-
-//  std::cout << "VR: " << vrect.width() << ", " << vrect.height() << "\n"
-//            << "UL: " << tempUlRect.width() << ", " << tempUlRect.height() << "\n"
-//            << "UR: " << tempUrRect.width() << ", " << tempUrRect.height() << "\n"
-//            << "LR: " << tempLrRect.width() << ", " << tempLrRect.height() << "\n"
-//            << "LL: " << tempLlRect.width() << ", " << tempLlRect.height() << "\n";
-
-   ossimRendererSubRectInfo ul(m_transform.get(),tempUlRect.ul(), tempUlRect.ur(),tempUlRect.lr(), tempUlRect.ll());
-   ossimRendererSubRectInfo ur(m_transform.get(),tempUrRect.ul(), tempUrRect.ur(),tempUrRect.lr(), tempUrRect.ll());
-   ossimRendererSubRectInfo lr(m_transform.get(),tempLrRect.ul(), tempLrRect.ur(),tempLrRect.lr(), tempLrRect.ll());
-   ossimRendererSubRectInfo ll(m_transform.get(),tempLlRect.ul(), tempLlRect.ur(),tempLlRect.lr(), tempLlRect.ll());
-
-   ul.m_viewBounds = m_viewBounds;
-   ur.m_viewBounds = m_viewBounds;
-   lr.m_viewBounds = m_viewBounds;
-   ll.m_viewBounds = m_viewBounds;
-
-   ul.transformViewToImage();
-   ur.transformViewToImage();
-   lr.transformViewToImage();
-   ll.transformViewToImage();
-
-   if(ul.imageIsNan())
-   {
-      if(ul.m_viewBounds->intersects(ul.getViewRect()))
-      {
-         result.push_back(ul);
-      }
-   }
-   else
-   {
-      result.push_back(ul);
-   }
-   if(ur.imageIsNan())
-   {
-      if(ur.m_viewBounds->intersects(ur.getViewRect()))
-      {
-         result.push_back(ur);
-      }
-   }
-   else
-   {
-      result.push_back(ur);
-   }
-   if(lr.imageIsNan())
-   {
-      if(lr.m_viewBounds->intersects(lr.getViewRect()))
-      {
-         result.push_back(lr);
-      }
-   }
-   else
-   {
-      result.push_back(lr);
-   }
-   if(ll.imageIsNan())
-   {
-      if(ll.m_viewBounds->intersects(ll.getViewRect()))
-      {
-         result.push_back(ll);
-      }
-   }
-   else
-   {
-      result.push_back(ll);
-   }
-}
-
-void ossimImageRenderer::ossimRendererSubRectInfo::splitView(std::vector<ossimRendererSubRectInfo>& result)const
-{
-  ossim_uint16 splitFlags = getSplitFlags();
-  // just do horizontal split for test
-
-  ossimIrect vrect(m_Vul,
-                  m_Vur,
-                  m_Vlr,
-                  m_Vll);
-  ossim_int32 w  = vrect.width();
-  ossim_int32 h  = vrect.height();
-  ossim_int32 w2 = w>>1;
-  ossim_int32 h2 = h>>1;
-  
-  if((w2 <2)&&(h2<2))
-  {
-    if(splitFlags)
-    {
-      ossimRendererSubRectInfo rect(m_transform.get(),m_Vul, 
-                              m_Vul, 
-                              m_Vul, 
-                              m_Vul);
-      rect.m_viewBounds = m_viewBounds;
-      rect.transformViewToImage();
-
-      if(rect.imageIsNan())
-      {
-        if(rect.m_viewBounds->intersects(rect.getViewRect()))
-        {
-          result.push_back(rect);
-        }
-      }
-      else
-      {
-        result.push_back(rect);
-      }
-    }
-  }
-  // horizontal split if only the upper left and lower left 
-  // vertices need splitting 
-  else if((splitFlags==(UPPER_LEFT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG))||
-          (splitFlags==(UPPER_RIGHT_SPLIT_FLAG|LOWER_RIGHT_SPLIT_FLAG)))
-  {
-   // std::cout << "Horizontal Split\n" << std::endl;    
-    if(w > 1)
-    {
-      splitHorizontal(result);
-    }
-  }  
-  // check vertical only split
-  else if((splitFlags==(UPPER_LEFT_SPLIT_FLAG|UPPER_RIGHT_SPLIT_FLAG))||
-          (splitFlags==(LOWER_RIGHT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG)))
-  {
-    //std::cout << "Vertical Split\n" << std::endl;
-
-    if(h>1)
-    {
-      splitVertical(result);
-    }
-  }
-  else if(splitFlags)//if((w>1)&&(h>1)&&(splitFlags))
-  {
-    if((w<2)&&(h>1))
-    {
-      splitVertical(result);
-    }
-    else if((w>1)&&(h<2))
-    {
-      splitHorizontal(result);
-    }
-    else
-    {
-      splitAll(result);
-    }
-  }
-}
-void ossimImageRenderer::ossimRendererSubRectInfo::transformImageToView()
-{
-   ossimDpt vul;
-   ossimDpt vur;
-   ossimDpt vlr;
-   ossimDpt vll;
-   m_transform->imageToView(m_Iul,
-                          vul);
-   m_transform->imageToView(m_Iur,
-                          vur);
-   m_transform->imageToView(m_Ilr,
-                          vlr);
-   m_transform->imageToView(m_Ill,
-                          vll);
-   
-   m_Vul = vul;
-   m_Vur = vur;
-   m_Vlr = vlr;
-   m_Vll = vll;
-}
-
-bool ossimImageRenderer::ossimRendererSubRectInfo::tooBig()const
-{
-  ossimDrect vRect = getViewRect();
-
-  return ((vRect.width() > 64) || (vRect.height() > 64));
-}
-
-ossim_uint16 ossimImageRenderer::ossimRendererSubRectInfo::getSplitFlags()const
-{
-  ossim_uint16 result = SPLIT_NONE;
-  ossimDrect vRect = getViewRect();
-
-  if(imageIsNan())
-  {
-    if(m_viewBounds->intersects(getViewRect()))
-    {
-//      result = SPLIT_ALL;
-    }
-    else
-    {
-      return result;
-    }
-  }
-  /*
-  if(result != SPLIT_ALL)
-  {
-    if(m_ulRoundTripError.hasNans()&&m_urRoundTripError.hasNans()&&
-        m_lrRoundTripError.hasNans()&&m_llRoundTripError.hasNans())
-    {
-      if(m_viewBounds->intersects(getViewRect()))
-      {
-        result = SPLIT_ALL;
-      }
-      return result;
-    }
-    else if(tooBig())
-    {
-      result = SPLIT_ALL;
-    }
-  }
-
-  if(result != SPLIT_ALL)
-  {
-    if(m_ulRoundTripError.hasNans()) result |= UPPER_LEFT_SPLIT_FLAG;
-    if(m_urRoundTripError.hasNans()) result |= UPPER_RIGHT_SPLIT_FLAG;
-    if(m_lrRoundTripError.hasNans()) result |= LOWER_RIGHT_SPLIT_FLAG;
-    if(m_llRoundTripError.hasNans()) result |= LOWER_LEFT_SPLIT_FLAG;
-  }
-*/
-  if(result != SPLIT_ALL)
-  {
-    ossim_float64 sensitivityScale = m_ImageToViewScale.length();
-    //std::cout << sensitivityScale << std::endl;
-    if(sensitivityScale < 1.0) sensitivityScale = 1.0/sensitivityScale;
-
-
-     // if((m_ulRoundTripError.length() > sensitivityScale)||
-     //    (m_urRoundTripError.length() > sensitivityScale)||
-     //    (m_lrRoundTripError.length() > sensitivityScale)||
-     //    (m_llRoundTripError.length() > sensitivityScale))
-     // {
-     //   std::cout << "________________\n";
-
-     //   std::cout << "Sens:  " << sensitivityScale << "\n"
-     //             << "View:  " << getViewRect() << "\n"
-     //             << "UL:    " << m_ulRoundTripError.length() << "\n"
-     //             << "UR:   " << m_urRoundTripError.length() << "\n"
-     //             << "LR:   " << m_lrRoundTripError.length() << "\n"
-     //             << "LL:   " << m_llRoundTripError.length() << "\n";
-     // }
-   // if(m_ulRoundTripError.length() > sensitivityScale) result |= UPPER_LEFT_SPLIT_FLAG;
-   // if(m_urRoundTripError.length() > sensitivityScale) result |= UPPER_RIGHT_SPLIT_FLAG;
-   // if(m_lrRoundTripError.length() > sensitivityScale) result |= LOWER_RIGHT_SPLIT_FLAG;
-   // if(m_llRoundTripError.length() > sensitivityScale) result |= LOWER_LEFT_SPLIT_FLAG;
-       // std::cout << result << " == " << SPLIT_ALL << "\n";
-
-    if((result!=SPLIT_ALL)&&!canBilinearInterpolate(sensitivityScale))
-    {
-      // std::cout << "TESTING BILINEAR!!!!\n";
-      result = SPLIT_ALL;
-
-    }
-    else
-    {
-      // std::cout << "CAN BILINEAR!!!!\n";
-    }
-  }
-
-  return result;
-}
-
-void ossimImageRenderer::ossimRendererSubRectInfo::transformViewToImage()
-{
-//  std::cout << "TRANSFORM VIEW TO IMAGE!!!!!!!!!!!!!!\n";
-
-   ossimDrect vrect = getViewRect();
-   ossim_float64 w = vrect.width();
-   ossim_float64 h = vrect.height();
-   // ossim_float64 w2 = w*0.5;
-   // ossim_float64 h2 = h*0.5;
-
-   m_transform->viewToImage(m_Vul, m_Iul);
-   m_transform->viewToImage(m_Vur, m_Iur);
-   m_transform->viewToImage(m_Vlr, m_Ilr);
-   m_transform->viewToImage(m_Vll, m_Ill);
-
-//  m_ulRoundTripError = m_transform->getRoundTripErrorView(m_Vul);
-//  m_urRoundTripError = m_transform->getRoundTripErrorView(m_Vur);
-//  m_lrRoundTripError = m_transform->getRoundTripErrorView(m_Vlr);;
-//  m_llRoundTripError = m_transform->getRoundTripErrorView(m_Vll);;
-
-#if 1
-   m_VulScale = computeViewToImageScale(m_Vul, ossimDpt(w,h));
-   m_VurScale = computeViewToImageScale(m_Vur, ossimDpt(-w,h));
-   m_VlrScale = computeViewToImageScale(m_Vlr, ossimDpt(-w,-h));
-   m_VllScale = computeViewToImageScale(m_Vll, ossimDpt(w,-h));
-
-   ossim_int32 n = 0;
-   m_ViewToImageScale.x = 0.0;
-   m_ViewToImageScale.y = 0.0;
-
-   if(!m_VulScale.hasNans())
-   {
-      m_ViewToImageScale += m_VulScale; 
-      ++n;
-   }
-   if(!m_VurScale.hasNans())
-   {
-      m_ViewToImageScale += m_VurScale; 
-      ++n;
-   }
-   if(!m_VlrScale.hasNans())
-   {
-      m_ViewToImageScale += m_VlrScale; 
-      ++n;
-   }
-   if(!m_VllScale.hasNans())
-   {
-      m_ViewToImageScale += m_VllScale; 
-      ++n;
-   }
-
-   if(!n)
-   {
-      m_ViewToImageScale.makeNan();
-      m_ImageToViewScale.makeNan();
-   }
-   else
-   {
-      m_ViewToImageScale.x/=n;
-      m_ViewToImageScale.y/=n;
-
-      m_ImageToViewScale.x = 1.0/m_ViewToImageScale.x;
-      m_ImageToViewScale.y = 1.0/m_ViewToImageScale.y;
-   }
-
-
-//std::cout << m_ViewToImageScale << std::endl;
-#else
-   {
-      m_ViewToImageScale = ossimDpt(1.0, 1.0);
-      
-      ossimDpt topDelta    = m_Iur - m_Iul;
-      ossimDpt rightDelta  = m_Ilr - m_Iur;
-      ossimDpt bottomDelta = m_Ill - m_Ilr;
-      ossimDpt leftDelta   = m_Iul - m_Ill;
-      
-      double topLen    = topDelta.length();
-      double bottomLen = bottomDelta.length();
-      double rightLen  = rightDelta.length();
-      double leftLen   = leftDelta.length();
-      
-      double averageHoriz = ((topLen)  + (bottomLen))*.5;
-      double averageVert  = ((leftLen) + (rightLen))*.5;
-      
-      ossimDpt deltaViewP1P2 = m_Vul - m_Vur;
-      ossimDpt deltaViewP1P3 = m_Vul - m_Vll;
-      
-      double lengthViewP1P2 = deltaViewP1P2.length();//+1;
-      double lengthViewP1P3 = deltaViewP1P3.length();//+1;
-
-      if(lengthViewP1P2 > FLT_EPSILON)
-      {
-         m_ViewToImageScale.x = averageHoriz/lengthViewP1P2;
-      }
-      else
-      {
-         m_ViewToImageScale.makeNan();
-      }
-      if(lengthViewP1P3 > FLT_EPSILON)
-      {
-         m_ViewToImageScale.y = averageVert/lengthViewP1P3;
-      }
-      else
-      {
-         m_ViewToImageScale.makeNan();
-      }
-
-      if(!m_ViewToImageScale.hasNans())
-      {
-         m_ImageToViewScale.x = 1.0/m_ViewToImageScale.x;
-         m_ImageToViewScale.y = 1.0/m_ViewToImageScale.y;
-      }
-      else
-      {
-         m_ImageToViewScale.makeNan();
-      }
-   }
-#endif
-}
-
-ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::computeViewToImageScale(const ossimDpt& viewPt,
-                           const ossimDpt& delta)const
-{
-  ossimDpt result;
-  result.makeNan();
-  if(viewPt.hasNans()) return result; 
-  ossimDpt ipt;
-  m_transform->viewToImage(viewPt, ipt);
-
-  if(!ipt.isNan())
-  {
-//    ossimDpt delta;
-//    transform->viewToImage(viewPt+ossimDpt(0.5,0.5), delta);
-
-//    delta = delta-ipt;
-//    result.x = delta.length()/std::sqrt(2);
- //   result.y = result.x;
-
-    ossimDpt dx;
-    ossimDpt dy;
-
-    m_transform->viewToImage(viewPt + ossimDpt(delta.x,0.0), dx);
-    m_transform->viewToImage(viewPt + ossimDpt(0.0,delta.y), dy);
-    dx = dx-ipt;
-    dy = dy-ipt;
-
-    result.x = dx.length()/fabs(delta.x);
-    result.y = dy.length()/fabs(delta.y);
-  }
-
-  return result;
-}
-
-void ossimImageRenderer::ossimRendererSubRectInfo::stretchImageOut(bool enableRound)
-{
-   ossimDpt topDelta    = m_Iur - m_Iul;
-   ossimDpt rightDelta  = m_Ilr - m_Iur;
-   ossimDpt bottomDelta = m_Ill - m_Ilr;
-   ossimDpt leftDelta   = m_Iul - m_Ill;
-
-   topDelta = topDelta*(1.0/topDelta.length());
-   rightDelta = rightDelta*(1.0/rightDelta.length());
-   bottomDelta = bottomDelta*(1.0/bottomDelta.length());
-   leftDelta = leftDelta*(1.0/leftDelta.length());
-
-   m_Iul = m_Iul + ((leftDelta - topDelta)*.5);
-   m_Iur = m_Iur + ((topDelta - rightDelta)*.5);
-   m_Ilr = m_Ilr + ((rightDelta - bottomDelta)*.5);
-   m_Ill = m_Ill + ((bottomDelta - leftDelta)*.5);
-
-   if(enableRound)
-   {
-      m_Iul = ossimIpt(ossim::round<int>(m_Iul.x),
-                        ossim::round<int>(m_Iul.y));
-      m_Iur = ossimIpt(ossim::round<int>(m_Iur.x),
-                        ossim::round<int>(m_Iur.y));
-      m_Ilr = ossimIpt(ossim::round<int>(m_Ilr.x),
-                        ossim::round<int>(m_Ilr.y));
-      m_Ill = ossimIpt(ossim::round<int>(m_Ill.x),
-                        ossim::round<int>(m_Ill.y));
-   }
-}
-
-bool ossimImageRenderer::ossimRendererSubRectInfo::isIdentity()const
-{
-//    ossimDpt deltaP1P2 = m_Iul - m_Iur;
-//    ossimDpt deltaP1P3 = m_Iul - m_Ill;
-   
-//    ossimDpt deltaViewP1P2 = m_Vul - m_Vur;
-//    ossimDpt deltaViewP1P3 = m_Vul - m_Vll;
-   
-//    bool horizontalSigns = ossimGetSign(deltaP1P2.x)==ossimGetSign(deltaViewP1P2.x);
-//    bool verticalSigns   = ossimGetSign(deltaP1P3.y)==ossimGetSign(deltaViewP1P3.y);
-
-//    // check first to see if any horizontal or vertical flipping
-//    //
-//    if(horizontalSigns && verticalSigns)
-//    {
-//       // check scales to see if they are 1
-//       if(fabs(1-m_ViewToImageScale.x) <= FLT_EPSILON &&
-//          fabs(1-m_ViewToImageScale.y) <= FLT_EPSILON)
-//       {
-//          return true;
-//       }
-//    }
-
-    double iulDelta = (m_Iul-m_Vul).length();
-    double iurDelta = (m_Iur-m_Vur).length();
-    double ilrDelta = (m_Ilr-m_Vlr).length();
-    double illDelta = (m_Ill-m_Vll).length();
-
-    return ((iulDelta <= FLT_EPSILON)&&
-            (iurDelta <= FLT_EPSILON)&&
-            (ilrDelta <= FLT_EPSILON)&&
-            (illDelta <= FLT_EPSILON));
-}
-
-
-bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double error)const
-{
-  bool result = false;
-
-      // now check point placement
-  ossimDpt imageToViewScale = getAbsValueImageToViewScales();
-
-  double testScale = imageToViewScale.length();
-
-//  ossimDpt errorUl = transform->getRoundTripErrorView(m_Vul);
-//  ossimDpt errorUr = transform->getRoundTripErrorView(m_Vur);
-//  ossimDpt errorLr = transform->getRoundTripErrorView(m_Vlr);
-//  ossimDpt errorLl = transform->getRoundTripErrorView(m_Vll);
-
-//  if((errorUl.length() > 2 )||
-//     (errorUr.length() > 2 )||
-//     (errorLr.length() > 2 )||
-//     (errorLl.length() > 2))
-//     {
-//        return result;
-//     }
-//  std::cout << "_______________________\n"
-//            << "errorUl: " << errorUl << "\n"
-//            << "errorUr: " << errorUr << "\n"
-//            << "errorLr: " << errorLr << "\n"
-//            << "errorLl: " << errorLl << "\n";
-
-  // if there is a large shrink or expansion then just return true.
-  // You are probably not worried about error in bilinear interpolation
-  //
-  if((testScale > 256)||
-     (testScale < 1.0/256.0))
-  {
-     return true;
-  }
-
-  if(m_VulScale.hasNans()||
-     m_VurScale.hasNans()||
-     m_VlrScale.hasNans()||
-     m_VllScale.hasNans())
-  {
-    return result;
-  }
-
-//  std::cout << "ulScale: " << m_VulScale << "\n"
-//            << "urScale: " << m_VurScale << "\n"
-//            << "lrScale: " << m_VlrScale << "\n"
-//            << "llScale: " << m_VllScale << "\n";
-
-
-  // check overage power of 2 variance
-  // If there is a variance of 1 resolution level
-  // then we must split further
-  //
-  ossim_float64 averageUlScale = m_VulScale.length();
-  ossim_float64 averageUrScale = m_VurScale.length();
-  ossim_float64 averageLrScale = m_VlrScale.length();
-  ossim_float64 averageLlScale = m_VllScale.length();
-
-  // std::cout << "_________________________\n";
-  // std::cout << log(averageUlScale)/(log(2)) << "\n";
-  // std::cout << log(averageUrScale)/(log(2)) << "\n";
-  // std::cout << log(averageLrScale)/(log(2)) << "\n";
-  // std::cout << log(averageLlScale)/(log(2)) << "\n";
-
-
-  ossim_float64 ratio1 = averageUlScale/averageUrScale;
-  ossim_float64 ratio2 = averageUlScale/averageLrScale;
-  ossim_float64 ratio3 = averageUlScale/averageLlScale;
-
-  // std::cout << "_________________________\n";
-  // std::cout << "ratio1: " << ratio1 << "\n";
-  // std::cout << "ratio2: " << ratio2 << "\n";
-  // std::cout << "ratio3: " << ratio3 << "\n";
-
-  
-  // make sure all are within a power of 2 shrink or expand
-  // which means the range of each ratio should be 
-  // between .5 and 2
-  result = (((ratio1 < 2) && (ratio1 > 0.5))&&
-            ((ratio2 < 2) && (ratio2 > 0.5))&&
-            ((ratio3 < 2) && (ratio3 > 0.5))); 
-
-  //result = ((diff1<=2)&&(diff2<=2)&&(diff3<=2));
-  //std::cout << "DIFF1: " << diff1 << std::endl;
-  //std::cout << "DIFF2: " << diff2 << std::endl;
-  //std::cout << "DIFF3: " << diff3 << std::endl;
-
-
-  if(result)
-  {
-#if 1
-    ossimDpt vUpper, vRight, vBottom, vLeft, vCenter;
-    ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
-    ossimDpt testUpper, testRight, testBottom, testLeft, testCenter;
-
-    getViewMids(vUpper, vRight, vBottom, vLeft, vCenter);
-    getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
-    
-    // get the model centers for the mid upper left right bottom
-    m_transform->viewToImage(vCenter, testCenter);
-
-    if(testCenter.hasNans())
-    {
-       return false;
-    }
-
-    m_transform->viewToImage(vUpper, testUpper);
-    if(testCenter.hasNans())
-    {
-       return false;
-    }
-    m_transform->viewToImage(vRight, testRight);
-    if(testRight.hasNans())
-    {
-       return false;
-    }
-    m_transform->viewToImage(vBottom, testBottom);
-    if(testBottom.hasNans())
-    {
-       return false;
-    }
-    m_transform->viewToImage(vLeft, testLeft);
-    if(testLeft.hasNans())
-    {
-       return false;
-    }
-
-    // now get the model error to bilinear estimate of those points
-    double errorCheck1 = (testCenter - iCenter).length();
-    double errorCheck2 = (testUpper - iUpper).length();
-    double errorCheck3 = (testRight - iRight).length();
-    double errorCheck4 = (testBottom - iBottom).length();
-    double errorCheck5 = (testLeft - iLeft).length();
-    result = ((errorCheck1 < error)&&
-              (errorCheck2 < error)&&
-              (errorCheck3 < error)&&
-              (errorCheck4 < error)&&
-              (errorCheck5 < error));
-   // std::cout <<"__________________________\n"
-   //       << "ERROR1:" <<errorCheck1 << "\n" 
-   //       << "ERROR2:" <<errorCheck2 << "\n" 
-   //       << "ERROR3:" <<errorCheck3 << "\n" 
-   //       << "ERROR4:" <<errorCheck4 << "\n" 
-   //       << "ERROR5:" <<errorCheck5 << "\n"
-   //       << "SENS:  " << error <<  "\n"; 
-
-#else
-    ossimDpt vUpper, vRight, vBottom, vLeft, vCenter;
-    ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
-
-    ossimDpt testCenter;
-    getViewMids(vUpper, vRight, vBottom, vLeft, vCenter);
-    getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
-
-    ossimDpt iFullRes(iCenter.x*imageToViewScale.x,
-          iCenter.y*imageToViewScale.y);
-
-    m_transform->viewToImage(vCenter, testCenter);
-
-    if(testCenter.hasNans())
-    {
-       return false;
-    }
-    ossimDpt testFullRes(testCenter.x*imageToViewScale.x,
-             testCenter.y*imageToViewScale.y);
-
-    double errorCheck1 = (testFullRes - iFullRes).length();
-
-    iFullRes = ossimDpt(iUpper.x*imageToViewScale.x,
-            iUpper.y*imageToViewScale.y);
-
-    m_transform->viewToImage(vUpper, testCenter);
-    if(testCenter.hasNans())
-    {
-       return false;
-    }
-    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
-         testCenter.y*imageToViewScale.y);
-    double errorCheck2 = (testFullRes - iFullRes).length();
-
-    iFullRes = ossimDpt(iRight.x*imageToViewScale.x,
-            iRight.y*imageToViewScale.y);
-
-    m_transform->viewToImage(vRight, testCenter);
-    if(testCenter.hasNans())
-    {
-       return false;
-    }
-    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
-         testCenter.y*imageToViewScale.y);
-    double errorCheck3 = (testFullRes - iFullRes).length();
-
-    iFullRes = ossimDpt(iBottom.x*imageToViewScale.x,
-            iBottom.y*imageToViewScale.y);
-
-    m_transform->viewToImage(vBottom, testCenter);
-    if(testCenter.hasNans())
-    {
-       return false;
-    }
-    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
-         testCenter.y*imageToViewScale.y);
-    double errorCheck4 = (testFullRes - iFullRes).length();
-
-    iFullRes = ossimDpt(iLeft.x*imageToViewScale.x,
-            iLeft.y*imageToViewScale.y);
-
-    m_transform->viewToImage(vLeft, testCenter);
-    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
-         testCenter.y*imageToViewScale.y);
-    double errorCheck5 = (testFullRes - iFullRes).length();
-
-   std::cout <<"__________________________\n"
-         << "ERROR1:" <<errorCheck1 << "\n" 
-         << "ERROR2:" <<errorCheck2 << "\n" 
-         << "ERROR3:" <<errorCheck3 << "\n" 
-         << "ERROR4:" <<errorCheck4 << "\n" 
-         << "ERROR5:" <<errorCheck5 << "\n"
-         << "SENS:  " << error <<  "\n"; 
-
-    result = ((errorCheck1 < error)&&
-      (errorCheck2 < error)&&
-      (errorCheck3 < error)&&
-      (errorCheck4 < error)&&
-      (errorCheck5 < error));
-    // std::cout << "CAN INTERPOLATE? " << result <<"\n";
-#endif
-  }
-  return result;
-
-}
-
-void ossimImageRenderer::ossimRendererSubRectInfo::getViewMids(ossimDpt& upperMid,
-				     ossimDpt& rightMid,
-				     ossimDpt& bottomMid,
-				     ossimDpt& leftMid,
-				     ossimDpt& center)const
-{
-  
-  upperMid  = (m_Vul + m_Vur)*.5;
-  rightMid  = (m_Vur + m_Vlr)*.5;
-  bottomMid = (m_Vlr + m_Vll)*.5;
-  leftMid   = (m_Vul + m_Vll)*.5;
-  center    = (m_Vul + m_Vur + m_Vlr + m_Vll)*.25;
-}
-
-void ossimImageRenderer::ossimRendererSubRectInfo::getImageMids(ossimDpt& upperMid,
-				      ossimDpt& rightMid,
-				      ossimDpt& bottomMid,
-				      ossimDpt& leftMid,
-				      ossimDpt& center)const
-{
-  if(imageHasNans())
-  {
-    upperMid.makeNan();
-    rightMid.makeNan();
-    bottomMid.makeNan();
-    leftMid.makeNan();
-    center.makeNan();
-  }
-  else
-  {
-    upperMid  = (m_Iul + m_Iur)*.5;
-    rightMid  = (m_Iur + m_Ilr)*.5;
-    bottomMid = (m_Ilr + m_Ill)*.5;
-    leftMid   = (m_Iul + m_Ill)*.5;
-    center    = (m_Iul + m_Iur + m_Ilr + m_Ill)*.25;
-  }
-}
-
-ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getParametricCenter(const ossimDpt& ul, const ossimDpt& ur, 
-									   const ossimDpt& lr, const ossimDpt& ll)const
-{
-  ossimDpt top    = ur - ul;
-  ossimDpt bottom = lr - ll;
-  
-  ossimDpt centerTop = ul + top * .5;
-  ossimDpt centerBottom = ll + bottom * .5;
-
-  return centerBottom + (centerBottom - centerTop)*.5;
-}
-
-ossimImageRenderer::ossimImageRenderer()
-:
-ossimImageSourceFilter(),
-ossimViewInterface(0),
-m_Resampler(0),
-m_BlankTile(0),
-m_Tile(0),
-m_TemporaryBuffer(0),
-m_StartingResLevel(0),
-m_ImageViewTransform(0),
-m_inputR0Rect(),
-m_viewRect(),
-m_rectsDirty(true),
-m_MaxRecursionLevel(5),
-m_AutoUpdateInputTransform(true),
-m_MaxLevelsToCompute(999999) // something large so it will always compute
-{
-    ossimViewInterface::theObject = this;
-    m_Resampler = new ossimFilterResampler();
-    m_ImageViewTransform = new ossimImageViewProjectionTransform;
-}
-
-ossimImageRenderer::ossimImageRenderer(ossimImageSource* inputSource,
-                                       ossimImageViewTransform* imageViewTrans)
-   : ossimImageSourceFilter(inputSource),
-     ossimViewInterface(0),
-     m_Resampler(0),
-     m_BlankTile(0),
-     m_Tile(0),
-     m_TemporaryBuffer(0),
-     m_StartingResLevel(0),
-     m_ImageViewTransform(imageViewTrans),
-     m_inputR0Rect(),
-     m_viewRect(),
-     m_rectsDirty(true),
-     m_MaxRecursionLevel(5),
-     m_AutoUpdateInputTransform(true),
-     m_MaxLevelsToCompute(999999) // something large so it will always compute
-{
-   ossimViewInterface::theObject = this;
-   m_Resampler = new ossimFilterResampler();
-   if(!m_ImageViewTransform.valid())
-   {
-      m_ImageViewTransform = new ossimImageViewProjectionTransform;
-   }
-}
-
-ossimImageRenderer::~ossimImageRenderer()
-{
-  m_ImageViewTransform = 0;
-
-   if(m_Resampler)
-   {
-      delete m_Resampler;
-      m_Resampler = 0;
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
-   const  ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-  // std::cout << "_________________________\n";
-   static const char MODULE[] = "ossimImageRenderer::getTile";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " Requesting view rect = "
-         << tileRect << endl;
-   }
-
-   // long w = tileRect.width();
-   // long h = tileRect.height();
-   // ossimIpt origin = tileRect.ul();
-   
-   if( !m_BlankTile.valid() || !m_Tile.valid() )
-   {
-      allocate();
-      if ( !m_BlankTile.valid() || !m_Tile.valid() )
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimImageRenderer::getTile tile allocation failure!\n"
-               << endl;
-         }
-         return ossimImageSourceFilter::getTile(tileRect, resLevel);
-      }
-   }
-
-   m_BlankTile->setImageRectangle(tileRect);
-   
-   if(!theInputConnection)
-   {
-      return m_BlankTile;
-   }
-   
-   if ( !isSourceEnabled()||(!m_ImageViewTransform.valid())||
-        (!m_ImageViewTransform->isValid()) )
-   {
-      // This tile source bypassed, return the input tile source.
-      return theInputConnection->getTile(tileRect, resLevel);  
-   }
-
-   if( m_rectsDirty )
-   {
-      initializeBoundingRects();
-
-      // We can't go on without these...
-      if ( m_rectsDirty )
-      {
-         return m_BlankTile;
-      }
-   }
-   
-   if(m_viewRect.width() < 4 && m_viewRect.height() < 4)
-   {
-      return m_BlankTile;
-   }
-
-   if( !theInputConnection || !m_viewRect.intersects(tileRect) )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << "No intersection, Returning...." << endl;
-      }
-      return m_BlankTile;
-   }
-   
-   if(!m_Tile)
-   {
-      return theInputConnection->getTile(tileRect, resLevel);
-   }
-
-   // long tw = m_Tile->getWidth();
-   // long th = m_Tile->getHeight();
-   
-   m_Tile->setImageRectangle(tileRect);
-   m_Tile->makeBlank();
- 
-
-  //if(!(m_viewArea.intersects(ossimPolyArea2d(tileRect))))
-  //{
-  //  return m_BlankTile;
-  //} 
-
-#if 0
-   // expand a small patch just to alleviate errors in the size of the rect when resampling
-     // ossimIrect viewRectClip = tileRect.clipToRect(ossimIrect(m_viewRect.ul() + ossimIpt(-8,-8),
-     //                                                          m_viewRect.lr() + ossimIpt(8,8)));
-   ossimIrect viewRectClip = tileRect.clipToRect(m_viewRect);
-   std::cout << "_____________________" << std::endl;
-   std::cout << "viewRectClip = " <<  viewRectClip << std::endl;
-//   std::cout << "tileRect = " <<  tileRect << std::endl;
-//   std::cout << "m_viewRect = " <<  m_viewRect << std::endl;
-   ossimRendererSubRectInfo subRectInfo(viewRectClip.ul(),
-                                        viewRectClip.ur(),
-                                        viewRectClip.lr(),
-                                        viewRectClip.ll());
-#else
-   ossimRendererSubRectInfo subRectInfo(m_ImageViewTransform.get(),
-                                        tileRect.ul(),
-                                        tileRect.ur(),
-                                        tileRect.lr(),
-                                        tileRect.ll());
-
-
-#endif
-   subRectInfo.m_viewBounds = &m_viewArea;
-   subRectInfo.transformViewToImage();
-
-   if((!m_viewArea.intersects(subRectInfo.getViewRect())))
-   {
-     return m_BlankTile;
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " image rect = " << subRectInfo.getImageRect() << std::endl;
-   }
-
-   // If the image rect is completely outside of the valid image, there is no need to resample:
-   // (OLK 11/18)
-//   if ((!subRectInfo.imageHasNans())&&!m_inputR0Rect.intersects(subRectInfo.getImageRect()))
-//   {
-//      return m_Tile;
-//   }
-   recursiveResample(m_Tile, subRectInfo, 1);
-   
-   if(m_Tile.valid())
-   {
-      m_Tile->validate();
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << "Returning...." << endl;
-   }
-   return m_Tile;
-}
-
-void ossimImageRenderer::recursiveResample(ossimRefPtr<ossimImageData> outputData,
-                                           const ossimRendererSubRectInfo& rectInfo,
-                                           ossim_uint32 level)
-{
-   ossimIrect tempViewRect = rectInfo.getViewRect();
-   //std::cout << rectInfo << std::endl;
-   if(rectInfo.imageIsNan())
-   {
-    if(!rectInfo.tooBig()) return;
-   } 
-
-  if(tempViewRect.width() <2 &&
-      tempViewRect.height() <2)
-  {
-      if(!rectInfo.imageHasNans())
-      {
-         fillTile(outputData,
-                  rectInfo);
-      }
-      return;
-  }
-  //
-  std::vector<ossimRendererSubRectInfo> splitRects;
-  rectInfo.splitView(splitRects);
-
-//std::cout << "SHOULD BE SPLITTING: " << splitRects.size() <<"\n";
-  ossim_uint32 idx = 0;
-  if(!splitRects.empty())
-  {
-   // std::cout << "SPLITTING " << level << ", " << tempViewRect << "\n";
-    for(idx = 0; idx < splitRects.size();++idx)
-    {
-      recursiveResample(outputData,
-                        splitRects[idx],
-                        level + 1);
-    }
-  }
-  else if(!rectInfo.imageHasNans())
-  {
-    fillTile(outputData,
-            rectInfo);
-  }
-}
-
-#define RSET_SEARCH_THRESHHOLD 0.1
-
-void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
-                                  const ossimRendererSubRectInfo& rectInfo)
-{
-   if(!outputData.valid() || !outputData->getBuf() || rectInfo.imageHasNans())
-   {
-      return;
-   }
-   ossimDrect vrect = rectInfo.getViewRect();
-   
-   ossimDpt imageToViewScale = rectInfo.getAbsValueImageToViewScales();
-   
-   if(imageToViewScale.hasNans()) return;
-   
-   ossimDpt tile_size = ossimDpt(vrect.width(), vrect.height());
-   double kernelSupportX, kernelSupportY;
-   
-   double resLevelX = log( 1.0 / imageToViewScale.x )/ log( 2.0 );
-   double resLevelY = log( 1.0 / imageToViewScale.y )/ log( 2.0 );
-   double resLevel0 = resLevelX < resLevelY ? resLevelX : resLevelY;
-   long closestFitResLevel = (long)floor( resLevel0 );
-   
-   //double averageScale = (imageToViewScale.x + imageToViewScale.y) / 2.0;
-   //long closestFitResLevel = (long)floor( log( 1.0 / averageScale )/ log( 2.0 ) );
-   
-   ossim_uint32 resLevel = closestFitResLevel<0 ? 0:closestFitResLevel;
-   resLevel += m_StartingResLevel;
-
-   //---
-   // ESH 02/2009: If requested resLevel is too high, let's lower it to one
-   // that is ok.
-   //---
-#if 0
-   const ossim_uint32 NUM_LEVELS = theInputConnection->getNumberOfDecimationLevels();
-   if ( (NUM_LEVELS > 0) && (resLevel >=  NUM_LEVELS) )
-   {
-      resLevel = NUM_LEVELS - 1;
-   }
-#endif
-   //---
-   // ESH 11/2008: Check the rset at the calculated resLevel to see
-   // if it has the expected decimation factor. It it does, we can 
-   // use this rset and assume it is at resLevel.
-   //--- 
-   ossimDpt decimation;
-   decimation.makeNan(); // initialize to nan.
-   theInputConnection->getDecimationFactor(resLevel, decimation);
-   double requestScale = 1.0 / (1<<resLevel);
-   double closestScale = decimation.hasNans() ? requestScale : decimation.x;
-
-#if 0
-   double differenceTest = 0.0;
-   if (closestScale != 0.0)
-   {
-      differenceTest = (1.0/closestScale) - (1.0/requestScale);
-   }
-
-   //---
-   // ESH 11/2008: Add in threshold test so search only happens when 
-   //              necessary.
-   // We do an rset search if 1 of 2 conditions is met: either
-   //   1) the rset is really different in size from the requested size, or
-   //   2) they're similar in size, and the actual rset is smaller than 
-   //      the requested size.
-   //---
-   if ( (fabs(differenceTest) > RSET_SEARCH_THRESHHOLD) || 
-        ((fabs(differenceTest) < RSET_SEARCH_THRESHHOLD) &&
-         (differenceTest < 0.0) ) )
-   {
-      //---
-      // ESH 11/2008: We test for the best rset. We assume 
-      // that decimation level always decreases as resLevel increases, so 
-      // the search can end before testing all rsets.
-      //---
-      ossim_uint32 savedResLevel = resLevel;
-      closestScale = 1.0; // resLevel 0
-      resLevel = 0;
-      ossim_uint32 i;
-      for( i=1; i<NUM_LEVELS; ++i )
-      {
-         theInputConnection->getDecimationFactor(i, decimation);
-         if(decimation.hasNans() == false )
-         {
-            double testDiscrepancy = decimation.x - requestScale;
-            if ( testDiscrepancy < 0.0 ) // we're done
-            {
-               break;
-            }
-            else
-            {
-               closestScale = decimation.x;
-               resLevel = i;
-            }
-         }
-         else // use the default value
-         {
-            closestScale = requestScale;
-            resLevel = savedResLevel;
-            break;
-         }
-      }
-   }
-#endif
-   ossimDpt nul(rectInfo.m_Iul.x*closestScale,
-                rectInfo.m_Iul.y*closestScale);
-   ossimDpt nll(rectInfo.m_Ill.x*closestScale,
-                rectInfo.m_Ill.y*closestScale);
-   ossimDpt nlr(rectInfo.m_Ilr.x*closestScale,
-                rectInfo.m_Ilr.y*closestScale);
-   ossimDpt nur(rectInfo.m_Iur.x*closestScale,
-                rectInfo.m_Iur.y*closestScale);
-   
-   m_Resampler->getKernelSupport( kernelSupportX, kernelSupportY );
-   
-   ossimDrect boundingRect = ossimDrect( nul, nll, nlr, nur );
-   
-
-   boundingRect = ossimIrect((ossim_int32)floor(boundingRect.ul().x - (kernelSupportX)-.5),
-                             (ossim_int32)floor(boundingRect.ul().y - (kernelSupportY)-.5),
-                             (ossim_int32)ceil (boundingRect.lr().x + (kernelSupportX)+.5),
-                             (ossim_int32)ceil (boundingRect.lr().y + (kernelSupportY)+.5));
-   
-   ossimDrect requestRect = boundingRect;
-   
-   ossimRefPtr<ossimImageData> data = getTileAtResLevel(requestRect, resLevel);
-   
-   ossimDataObjectStatus status = OSSIM_NULL;
-   if( data.valid() )
-   {
-      status = data->getDataObjectStatus();
-   }
-   if( (status == OSSIM_NULL) || (status == OSSIM_EMPTY) )
-   {
-      return;
-   }
-   
-   if((boundingRect.width() <2)&&(boundingRect.height()<2))
-   {
-              
-//    return;
-   }// std::cout << "SMALL RECT!!!!!!\n";
-   else
-   {
-     ossimDrect inputRect = m_inputR0Rect;
-     inputRect = inputRect*ossimDpt(closestScale, closestScale);
-     m_Resampler->setBoundingInputRect(inputRect);
-     
-     double denominatorY = 1.0;
-     if(tile_size.y > 2)
-     {
-        denominatorY = tile_size.y-1.0;
-     }
-     
-     ossimDpt newScale( imageToViewScale.x / closestScale,
-                       imageToViewScale.y / closestScale );
-     m_Resampler->setScaleFactor(newScale);
-     
-
-  //std::cout << "SPLIT VIEW RECT: " << vrect << std::endl;
-  //std::cout << "VIEW RECT: " << outputData->getImageRectangle() << std::endl;
-
-
-     m_Resampler->resample(data,
-                           outputData,
-                           vrect,
-                           nul,
-                           nur,
-                           ossimDpt( ( (nll.x - nul.x)/denominatorY ),
-                                     ( (nll.y - nul.y)/denominatorY ) ),
-                           ossimDpt( ( (nlr.x - nur.x)/denominatorY ),
-                                     ( (nlr.y - nur.y)/denominatorY ) ),
-                           tile_size);
-   }
-   
-}
-
-long ossimImageRenderer::computeClosestResLevel(const std::vector<ossimDpt>& decimationFactors,
-                                                double scale)const
-{
-   long result = 0;
-   long upper  = (long)decimationFactors.size();
-   bool done   = false;
-   
-   if(upper > 1)
-   {
-      while((result < upper)&&!done)
-      {
-         if(scale < decimationFactors[result].x)
-         {
-            ++result;
-         }
-         else
-         {
-            done = true;
-         }
-      }
-      
-      // now use the higher res level and resample down
-      //
-      if(result)
-      {
-         --result;
-      }
-   }
-   return result;
-}
-
-ossimIrect ossimImageRenderer::getBoundingRect(ossim_uint32 resLevel)const
-{
-   //---
-   // 01 November 2011:
-   // Backed out expand code as the ossimImageViewProjectionTransform::getImageToViewBounds
-   // does not handle image on the edge of international date line. D. Burken
-   //---
-   
-   // The input bounding rect as returned here corresponds to "pixel-is-point", i.e., the center
-   // of the pixel area for the corners and not the edges which extend 1/2 pixel in all 
-   // directions. Because the view is probably a different GSD, first expand the input
-   // bounding rect to the edge before transforming to a view rect. Then shrink the view rect by
-   // 1/2 pixel to get it to the pixel center (OSSIM convention for bounding rect -- this may 
-   // need to be revisited in light of the need to match edges, not pixel centers, OLK 09/11).
-
-   // Code functionality moved to below method. (drb - 08 Nov. 2011)
-   
-   ossimIrect result;
-   getBoundingRect( result, resLevel );
-   return result;
-}
-
-void ossimImageRenderer::getBoundingRect(ossimIrect& rect, ossim_uint32 resLevel) const
-{
-   if ( isSourceEnabled() )
-   {
-      rect = m_viewRect;
-   }
-   else if ( theInputConnection )
-   {
-      rect = theInputConnection->getBoundingRect(resLevel);
-   }
-   else
-   {
-      rect.makeNan();
-   }
-
-#if 0 /* Please leave for debug. */
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageRenderer::getBoundingRect(rect, resLevel) debug:\nbounds  = "
-         << rect << "\n";
-   }
-#endif  
-}
-
-void ossimImageRenderer::initializeBoundingRects()
-{
-   m_rectsDirty = true;
-   
-   // Get the input bounding rect:
-   if ( theInputConnection && m_ImageViewTransform.valid())
-   {
-      m_inputR0Rect = theInputConnection->getBoundingRect(0);
-      if (!m_inputR0Rect.hasNans() )
-      {
-         // This will call ossim::round<int> on the dpt's.
-         m_viewRect = m_ImageViewTransform->getImageToViewBounds(m_inputR0Rect);
-         if ( m_viewRect.hasNans() == false )
-         {
-            // Clear the dirty flag:
-            m_rectsDirty = false;
-         }
-         
-         // now get a coarse estimate of the boundary poly
-         ossimDpt uli = m_inputR0Rect.ul();
-         ossimDpt uri = m_inputR0Rect.ur();
-         ossimDpt lri = m_inputR0Rect.lr();
-         ossimDpt lli = m_inputR0Rect.ll();
-         ossim_int32 stepSize = 50;
-
-         std::vector<ossimDpt> poly;
-
-         ossimDpt deltaUpper = (uri-uli)*(1.0/stepSize);
-         ossimDpt deltaRight = (lri-uri)*(1.0/stepSize);
-         ossimDpt deltaLower = (lli-lri)*(1.0/stepSize);
-         ossimDpt deltaLeft  = (uli-lli)*(1.0/stepSize);
-
-         ossimDpt p;
-         ossim_int32 idx = 0;
-         ossimDpt initialPoint= uli;
-
-         for(idx = 0; idx < stepSize;++idx)
-         {
-            m_ImageViewTransform->imageToView(initialPoint, p);
-            if(!p.hasNans())
-            {
-               poly.push_back(p);
-            }
-            initialPoint.x+=deltaUpper.x;
-            initialPoint.y+=deltaUpper.y;
-         }
-
-         initialPoint= uri;
-         for(idx = 0; idx < stepSize;++idx)
-         {
-            m_ImageViewTransform->imageToView(initialPoint, p);
-            if(!p.hasNans())
-            {
-               poly.push_back(p);
-            }
-            initialPoint.x+=deltaRight.x;
-            initialPoint.y+=deltaRight.y;
-         }
-
-         initialPoint= lri;
-         for(idx = 0; idx < stepSize;++idx)
-         {
-            m_ImageViewTransform->imageToView(initialPoint, p);
-            if(!p.hasNans())
-            {
-               poly.push_back(p);
-            }
-            initialPoint.x+=deltaLower.x;
-            initialPoint.y+=deltaLower.y;
-         }
-
-         initialPoint= lli;
-         for(idx = 0; idx < stepSize;++idx)
-         {
-            m_ImageViewTransform->imageToView(initialPoint, p);
-            if(!p.hasNans())
-            {
-               poly.push_back(p);
-            }
-            initialPoint.x+=deltaLeft.x;
-            initialPoint.y+=deltaLeft.y;
-         }
-
-         // Close the polygon and set the view area:
-         if (poly.size() >= 4)
-         {
-            poly.push_back(poly[0]);
-            m_viewArea = ossimPolyArea2d(ossimPolygon(poly));
-         }
-      }
-      
-      //ossimPolyArea2d testPolyarea = polyArea&ossimPolyArea2d(tileRect);
-   }
-
-   if ( m_rectsDirty )
-   {
-      m_viewRect.makeNan();
-   }
-   
-#if 0 /* Please leave for debug. */
-   ossimNotify(ossimNotifyLevel_DEBUG)
-      << "ossimImageRenderer::initializeBoundingRects() debug:\n"
-      << "\ninput rect: " << m_inputR0Rect
-      << "\nview rect:  " << m_viewRect << endl;
-#endif
-}
-
-void ossimImageRenderer::initialize()
-{
-   // Call the base class initialize.
-   // Note:  This will reset "theInputConnection" if it changed...
-   ossimImageSourceFilter::initialize();
-
-   deallocate();
-
-   m_rectsDirty = true;
-
-   // we will only do this if we are enabled for this could be expensive
-   if (m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid() && isSourceEnabled())
-   {
-      checkIVT(); // This can initialize bounding rects and clear dirty flag.
-   }
-
-   if ( m_rectsDirty )
-   {
-      initializeBoundingRects();
-   }
-}
-
-void ossimImageRenderer::deallocate()
-{
-   m_Tile            = 0;
-   m_BlankTile       = 0;
-   m_TemporaryBuffer = 0;
-}
-
-void ossimImageRenderer::allocate()
-{
-   deallocate();
-
-   if(theInputConnection)
-   {
-      m_Tile = ossimImageDataFactory::instance()->create(this, this);
-      m_BlankTile  = ossimImageDataFactory::instance()->create(this, this);
-      
-      m_Tile->initialize();
-   }
-}
-
-bool ossimImageRenderer::saveState(ossimKeywordlist& kwl,
-                                   const char* prefix)const
-{
-   if(m_ImageViewTransform.valid())
-   {
-      ossimString newPrefix = ossimString(prefix) + ossimString("image_view_trans.");
-      
-      m_ImageViewTransform->saveState(kwl, newPrefix.c_str());
-   }
-   if(m_Resampler)
-   {
-      m_Resampler->saveState(kwl,
-                              (ossimString(prefix)+"resampler.").c_str());
-   }
-   kwl.add(prefix,
-           "max_levels_to_compute",
-           m_MaxLevelsToCompute);
-   
-   return ossimImageSource::saveState(kwl, prefix);
-}
-
-bool ossimImageRenderer::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimImageRenderer::loadState entered..." << endl;
-      
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << endl;
-#endif      
-   }
-   
-   ossimString newPrefix = ossimString(prefix) + ossimString("image_view_trans.");
-   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
-   
-   if(m_Resampler)
-   {
-      m_Resampler->loadState(kwl,
-                              (ossimString(prefix)+"resampler.").c_str());
-   }
-   m_ImageViewTransform = 0;
-   m_ImageViewTransform = ossimImageViewTransformFactory::instance()->createTransform(kwl, newPrefix.c_str());
-   if(!m_ImageViewTransform)
-   {
-      m_ImageViewTransform = new ossimImageViewProjectionTransform;
-   }
-   const char* maxLevelsToCompute = kwl.find(prefix,
-                                             "max_levels_to_compute");
-   if(maxLevelsToCompute)
-   {
-      m_MaxLevelsToCompute = ossimString(maxLevelsToCompute).toUInt32();
-   }
-   
-   return result;
-}
-
-void ossimImageRenderer::setImageViewTransform(ossimImageViewTransform* ivt)
-{
-   m_ImageViewTransform = ivt;
-   
-   m_rectsDirty = true; // Want to recompute bounding rects.
-   
-   if ( m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid() && isSourceEnabled() )
-   {
-      checkIVT(); // This can initialize bounding rects and clear dirty flag.
-   }
-   
-   if ( m_rectsDirty ) 
-   {
-      initializeBoundingRects();
-   }
-}
-
-bool ossimImageRenderer::setView(ossimObject* baseObject)
-{
-   bool new_view_set = false;
-   if(m_ImageViewTransform.valid())
-   {
-      new_view_set = m_ImageViewTransform->setView(baseObject);
-
-      // If view changes reset the bounding rects.
-      initializeBoundingRects();
-   }
-   return new_view_set;
-}
-
-ossimObject* ossimImageRenderer::getView()
-{
-   if(m_ImageViewTransform.valid())
-   {
-      return m_ImageViewTransform->getView();
-   }
-   return 0;
-}
-
-const ossimObject* ossimImageRenderer::getView()const
-{
-   if(m_ImageViewTransform.valid())
-   {
-      return m_ImageViewTransform->getView();
-   }
-   return 0;
-}
-
-void ossimImageRenderer::getValidImageVertices(vector<ossimIpt>& validVertices,
-                                               ossimVertexOrdering ordering,
-                                               ossim_uint32 resLevel)const
-{
-   if(theInputConnection&&m_ImageViewTransform.valid()&&m_ImageViewTransform->isValid())
-   {
-      theInputConnection->getValidImageVertices(validVertices, ordering, resLevel);
-      if(isSourceEnabled())
-      {
-         ossim_uint32 inputSize = (ossim_uint32)validVertices.size();
-         if(inputSize)
-         {
-            ossimDpt viewPt;
-            ossim_uint32 idx = 0;
-            // transform each point to the view
-            for(idx = 0; idx < inputSize; ++idx)
-            {
-               m_ImageViewTransform->imageToView(validVertices[idx], viewPt);
-               
-               // round it to the nearest pixel
-               //
-               validVertices[idx] = ossimIpt(viewPt);
-            }
-         }
-      }
-   }
-}
-
-//*************************************************************************************************
-// Returns the geometry associated with the image being served out of the renderer. This
-// corresponds to the view geometry defined in theIVT.
-//*************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimImageRenderer::getImageGeometry()
-{
-   // Make sure the IVT was properly initialized
-   if (m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid())
-      checkIVT();
-
-   ossimImageViewProjectionTransform* ivpt = PTR_CAST(ossimImageViewProjectionTransform, 
-                                                      m_ImageViewTransform.get());
-   if (ivpt)
-   {
-      // we need to return the right side since the geometry changed to a view geometry
-      return ivpt->getViewGeometry();
-   }
-
-   return ossimRefPtr<ossimImageGeometry>();
-}
-
-void ossimImageRenderer::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
-   if(!m_ImageViewTransform.valid())
-      m_ImageViewTransform  = new ossimImageViewProjectionTransform;
-   
-   checkIVT();
-   initialize();
-}
-
-void ossimImageRenderer::disconnectInputEvent(ossimConnectionEvent& /* event */)
-{
-   ossimImageViewProjectionTransform* ivpt = PTR_CAST(ossimImageViewProjectionTransform,
-                                                      m_ImageViewTransform.get());
-   if(ivpt)
-      ivpt->setImageGeometry(0);
-   
-   theInputConnection = 0;
-}
-
-void ossimImageRenderer::propertyEvent(ossimPropertyEvent& /* event */)
-{
-   checkIVT();
-   initialize();
-}
-
-void ossimImageRenderer::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimString tempName = property->getName();
-   
-   if((tempName == "Filter type")||
-      (tempName == "filter_type"))
-   {
-      if(m_Resampler)
-      {
-         m_Resampler->setFilterType(property->valueToString());
-      }
-   }
-   //   else if(tempName == "Blur factor")
-   //     {
-   //       if(m_Resampler)
-   // 	{
-   // 	  m_Resampler->setBlurFactor(property->valueToString().toDouble());
-   // 	}
-   //     }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-      
-ossimRefPtr<ossimProperty> ossimImageRenderer::getProperty(const ossimString& name)const
-{
-   ossimString tempName = name;
-   
-   if((tempName == "Filter type")||
-      (tempName == "filter_type"))
-   {
-      std::vector<ossimString> filterNames;
-      m_Resampler->getFilterTypes(filterNames);
-      
-      ossimStringProperty* stringProp = new ossimStringProperty("filter_type",
-								m_Resampler->getMinifyFilterTypeAsString(),
-								false,
-								filterNames);
-      stringProp->clearChangeType();
-      stringProp->setReadOnlyFlag(false);
-      stringProp->setCacheRefreshBit();
-      
-      return stringProp;
-   }
-//   else if(tempName == "Blur factor")
-//   {
-//      ossimNumericProperty* numericProperty = new ossimNumericProperty("Blur factor",
-//                                                                       ossimString::toString((double)m_Resampler->getBlurFactor()));
-   
-//      numericProperty->setConstraints(0.0, 50.0);
-//      numericProperty->setNumericType(ossimNumericProperty::ossimNumericPropertyType_FLOAT64);
-//      numericProperty->setCacheRefreshBit();
-   
-//      return numericProperty;
-//   }
-   
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimImageRenderer::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-  ossimImageSourceFilter::getPropertyNames(propertyNames);
-
-  propertyNames.push_back("Filter type");
-//  propertyNames.push_back("Blur factor");
-}
-
-//*************************************************************************************************
-// Insures that a proper IVT is established.
-//*************************************************************************************************
-void ossimImageRenderer::checkIVT()
-{
-   if(!isSourceEnabled())
-      return;
-
-   // Check validity of the IVT:
-   if (m_ImageViewTransform->isValid())
-      return;
-
-   // Detected uninitialized IVT. We are only concerned with projection IVTs (IVPTs) so 
-   // make sure that's what we're working with:
-   ossimImageViewProjectionTransform* ivpt = 
-      PTR_CAST(ossimImageViewProjectionTransform, m_ImageViewTransform.get());
-   ossimImageSource* inputSrc = PTR_CAST(ossimImageSource, getInput(0));
-
-   if(!ivpt || !inputSrc) 
-      return; // nothing to do here yet.
-
-   // Fetch the input image geometry from the IVPT to see if one needs to be established:
-   ossimRefPtr<ossimImageGeometry> inputGeom = ivpt->getImageGeometry();
-   if ( !inputGeom )
-   {
-      // Ask the input source for a geometry:
-      inputGeom = inputSrc->getImageGeometry();
-      if ( !inputGeom )
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)<<"ossimImageRenderer::checkTransform() -- "
-            "No input image geometry could be established for this renderer."<<endl;
-         }
-         return;
-      }
-      ivpt->setImageGeometry( inputGeom.get() );
-      m_rectsDirty = true;
-   }
-
-   // Now check the output view geometry:
-   ossimRefPtr<ossimImageGeometry> outputGeom = ivpt->getViewGeometry();
-   if (!outputGeom)
-   {
-      ossimRefPtr<ossimImageGeometry> myOutGeom = new ossimImageGeometry;
-
-      //---
-      // If the input geometry sports a map projection instead of a 3D
-      // projector, use the same map projection for the view.
-      // 
-      // Note: Don't use map projections with model transforms as they don't
-      // allow for changing resolution.
-      //---
-      const ossimProjection*  inputProj = inputGeom->getProjection();
-      const ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, inputProj);
-      if (mapProj && !mapProj->hasModelTransform() )
-      {
-         ossimProjection* my_proj = PTR_CAST(ossimProjection, mapProj->dup());
-         myOutGeom->setProjection(my_proj);
-      }
-      else 
-      {
-         // The input geometry uses a 3D projection, so let's default here to a
-         // ossimEquDistCylProjection for the view:
-         ossimMapProjection* myMapProj = new ossimEquDistCylProjection;
-         ossimDpt meters = inputGeom->getMetersPerPixel();
-         double GSD = (meters.x + meters.y)/2.0;
-         meters.x = GSD;
-         meters.y = GSD;
-         if(inputProj)
-         {
-            //---
-            // Update the map projection.  Since ossimMapProjection::setOrigin calls
-            // ossimMapProjection::update we do that before setUlTiePoints as it in
-            // turn calls setUlEastingNorthing(forward(gpt)) which depends on the orgin.
-            //---
-            myMapProj->setOrigin(inputProj->origin());
-            myMapProj->setUlTiePoints( inputProj->origin() );
-
-         }
-         myMapProj->setMetersPerPixel(meters);
-         myOutGeom->setProjection(myMapProj);
-      }
-      
-      // Set up our IVT with the new output geometry:
-      ivpt->setViewGeometry(myOutGeom.get());
-
-      // Must reinitialize bounding rects before calling ossimImageGeometry::setImageSize().
-      initializeBoundingRects();
-
-      // Set the size on the ossimImageGeometry.
-      ossimIrect rect;
-      getBoundingRect(rect, 0);
-      myOutGeom->setImageSize( rect.size() );
-   }
-
-   if ( m_rectsDirty )
-   {
-      initializeBoundingRects();
-   }
-}
-
-void ossimImageRenderer::getDecimationFactor(ossim_uint32 resLevel,
-					     ossimDpt& result)const
-{
-   if(isSourceEnabled())
-   {
-      result = ossimDpt(1,1);
-   }
-   else
-   {
-      ossimImageSourceFilter::getDecimationFactor(resLevel,
-						  result);
-   }
-}
-
-void ossimImageRenderer::getDecimationFactors(vector<ossimDpt>& decimations)const
-{
-   if(isSourceEnabled())
-   {
-      decimations.push_back(ossimDpt(1,1));
-   }
-   else
-   {
-      ossimImageSourceFilter::getDecimationFactors(decimations);
-   }
-}
-
-ossim_uint32 ossimImageRenderer::getNumberOfDecimationLevels()const
-{
-   if(isSourceEnabled())
-   {
-      return 1;
-   }
-   
-   return ossimImageSourceFilter::getNumberOfDecimationLevels();
-}
-
-void ossimImageRenderer::stretchQuadOut(const ossimDpt& amount,
-                                        ossimDpt& ul,
-                                        ossimDpt& ur,
-                                        ossimDpt& lr,
-                                        ossimDpt& ll)
-{
-   ossimDpt upper  = ur - ul;
-   ossimDpt right  = lr - ur;
-   ossimDpt bottom = ll - lr;
-   ossimDpt left   = ul - ll;
-   
-   upper = (upper*(1.0 / upper.length()));
-   upper.x *= amount.x;
-   upper.y *= amount.y;
-   right = (right*(1.0 / right.length()));
-   right.x *= amount.x;
-   right.y *= amount.y;
-   bottom = (bottom*(1.0 / bottom.length()));
-   bottom.x *= amount.x;
-   bottom.y *= amount.y;
-   left = (left*(1.0 / left.length()));
-   left.x *= amount.x;
-   left.y *= amount.y;
-   
-   
-   ul = ul - upper + left;
-   ur = ur + upper - right;
-   lr = lr + left - bottom;
-   ll = ll - left + bottom;
-}
-
-ossimRefPtr<ossimImageData>  ossimImageRenderer::getTileAtResLevel(const ossimIrect& boundingRect,
-                                                       ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      m_BlankTile->setImageRectangle(boundingRect);
-      
-      return m_BlankTile;
-   }
-   
-   ossim_uint32 levels = theInputConnection->getNumberOfDecimationLevels();
-   
-   // ossim_uint32 maxValue = (ossim_uint32)ossim::max((ossim_uint32)m_BoundingRect.width(),
-   //                                            (ossim_uint32)m_BoundingRect.height());
-   if(resLevel == 0)
-   {
-      return theInputConnection->getTile(boundingRect);
-   }
-   if(resLevel < levels)
-   {
-      if(theInputConnection)
-      {
-         return theInputConnection->getTile(boundingRect,
-                                            resLevel);
-      }
-      else
-      {
-         return m_BlankTile;
-      }
-   }
-   else if((resLevel - levels) < m_MaxLevelsToCompute)
-   {
-      // check to see how many decimations we must achiev for the
-      // request
-      //
-      int decimations = (resLevel - (levels-1));
-      ossimIpt tileSize(theInputConnection->getTileWidth(),
-                        theInputConnection->getTileHeight());
-      
-      ossim_int32 multiplier = (1 << decimations);
-      
-      ossim_int32 xIndex = 0;
-      ossim_int32 yIndex = 0;
-      
-      // adjust the tilesize so it at least will cover the multiplier
-      // We will probably come up with something better later but for now
-      // this will do.
-      if(multiplier > tileSize.x)
-      {
-         tileSize.x = multiplier;
-      }
-      if(multiplier > tileSize.y)
-      {
-         tileSize.y = multiplier;
-      }
-      
-      // set the rect that covers the requested RLevel to the valid RLevel. 
-      // the valid RLevel is what is available on the input side.
-      //
-      ossimIrect requestedRectAtValidRLevel = boundingRect;
-      requestedRectAtValidRLevel.stretchToTileBoundary(tileSize);
-      ossimIrect mappedRequestedRect = requestedRectAtValidRLevel;
-      requestedRectAtValidRLevel  = requestedRectAtValidRLevel*((double)multiplier);
-      
-      if(!m_TemporaryBuffer)
-      {
-         m_TemporaryBuffer = (ossimImageData*)m_BlankTile->dup();
-         m_TemporaryBuffer->setImageRectangle(mappedRequestedRect);
-         m_TemporaryBuffer->initialize();
-      }
-      else
-      {
-         m_TemporaryBuffer->setImageRectangle(mappedRequestedRect);
-         m_TemporaryBuffer->makeBlank();
-      }
-      
-     // ossim_uint32 totalCount   = ((requestedRectAtValidRLevel.lr().y-requestedRectAtValidRLevel.ul().y)*
-   //                                (requestedRectAtValidRLevel.lr().x-requestedRectAtValidRLevel.ul().x));
-      ossim_uint32 currentCount = 0;
-      ossimIrect boundingRect = theInputConnection->getBoundingRect(levels-1);
-      for(yIndex = requestedRectAtValidRLevel.ul().y;yIndex < requestedRectAtValidRLevel.lr().y; yIndex += tileSize.y)
-      {
-         for(xIndex = requestedRectAtValidRLevel.ul().x; xIndex < requestedRectAtValidRLevel.lr().x; xIndex+=tileSize.x)
-         {
-            ossimIrect request(xIndex,
-                               yIndex,
-                               xIndex + (tileSize.x-1),
-                               yIndex + (tileSize.y-1));
-            ossimRefPtr<ossimImageData> data = theInputConnection->getTile(request, levels-1);
-            
-            if(data.valid() && (data->getDataObjectStatus()!=OSSIM_EMPTY)&&
-               data->getBuf()&&
-               boundingRect.intersects(request))
-            {
-               switch(data->getScalarType())
-               {
-                  case OSSIM_UINT8:
-                  {
-                     resampleTileToDecimation((ossim_uint8)0,
-                                              m_TemporaryBuffer,
-                                              data,
-                                              multiplier);
-                     break;
-                  }
-                  case OSSIM_SINT16:
-                  {
-                     resampleTileToDecimation((ossim_sint16)0,
-                                              m_TemporaryBuffer,
-                                              data,
-                                              multiplier);
-                     break;
-                  }
-                  case OSSIM_UINT16:
-                  case OSSIM_USHORT11:
-                  {
-                     resampleTileToDecimation((ossim_uint16)0,
-                                              m_TemporaryBuffer,
-                                              data,
-                                              multiplier);
-                     break;
-                  }
-                  case OSSIM_FLOAT32:
-                  case OSSIM_NORMALIZED_FLOAT:
-                  {
-                     resampleTileToDecimation((ossim_float32)0,
-                                              m_TemporaryBuffer,
-                                              data,
-                                              multiplier);
-                     break;
-                  }
-                  case OSSIM_FLOAT64:
-                  case OSSIM_NORMALIZED_DOUBLE:
-                  {
-                     resampleTileToDecimation((ossim_float64)0,
-                                              m_TemporaryBuffer,
-                                              data,
-                                              multiplier);
-                     break;
-                  }
-                  case OSSIM_SCALAR_UNKNOWN:
-                  default:
-                  {
-                     break;
-                  }
-               }
-            }
-            ++currentCount;
-         }
-      }
-      m_TemporaryBuffer->validate();
-      return m_TemporaryBuffer;
-   }
-
-   return 0;
-}
-
-void ossimImageRenderer::setMaxLevelsToCompute(ossim_uint32 maxLevels)
-{
-   m_MaxLevelsToCompute = maxLevels;
-}
-
-ossim_uint32 ossimImageRenderer::getMaxLevelsToCompute()const
-{
-   return m_MaxLevelsToCompute;
-}
-
-template <class T>
-void ossimImageRenderer::resampleTileToDecimation(T /* dummyVariable */,
-						  ossimRefPtr<ossimImageData> result,
-						  ossimRefPtr<ossimImageData> tile,
-						  ossim_uint32 multiplier)
-{
-   if(tile->getDataObjectStatus() == OSSIM_EMPTY ||
-      !tile->getBuf())
-   {
-      return;
-   }
-   
-   ossim_int32 maxX     = (ossim_int32)tile->getWidth();
-   ossim_int32 maxY     = (ossim_int32)tile->getHeight();
-   ossim_int32 resultHeight = result->getHeight();
-   ossim_int32* offsetX = new ossim_int32[maxX];
-   ossim_int32* offsetY = new ossim_int32[maxY];
-   ossim_int32 i        = 0;
-   ossim_int32 resultWidth     = (ossim_int32)result->getWidth();
-   ossimIpt tileOrigin   = tile->getOrigin();
-   ossimIpt resultOrigin = result->getOrigin();
-   
-   // create a lookup table. that maps the tile to the result
-   for(i = 0; i < maxX; ++i)
-   {
-      offsetX[i] = (i+tileOrigin.x)/(ossim_int32)multiplier - resultOrigin.x;
-      if(offsetX[i] < 0 )
-      {
-         offsetX[i] = 0;
-      }
-      else if(offsetX[i] >= resultWidth)
-      {
-         offsetX[i] = resultWidth-1;
-      }
-   }
-   for(i = 0; i < maxY; ++i)
-   {
-      offsetY[i] = ( ((i+tileOrigin.y)/(ossim_int32)multiplier) - resultOrigin.y);
-      if(offsetY[i] < 0 )
-      {
-         offsetY[i] = 0;
-      }
-      else if(offsetY[i] >= resultHeight)
-      {
-         offsetY[i] = resultHeight-1;
-      }
-      offsetY[i] *= resultWidth;
-   }
-   
-   if(tile->getDataObjectStatus() == OSSIM_FULL)
-   {
-      ossim_int32 numberOfBands = (ossim_int32)std::min(result->getNumberOfBands(),
-                                                        tile->getNumberOfBands());
-      ossim_int32 band = 0;
-      for(band = 0; band < numberOfBands; ++band)
-      {
-         T* tileBuf   = static_cast<T*>(tile->getBuf(band));
-         T* resultBuf = static_cast<T*>(result->getBuf(band));
-         ossim_int32 dx = 0;
-         ossim_int32 dy = 0;
-         ossim_int32 boxAverageX = 0;
-         ossim_int32 boxAverageY = 0;
-         for(dy = 0; dy < maxY; dy+=multiplier)
-         {
-            for(dx = 0; dx < maxX; dx+=multiplier)
-            {
-               double sum = 0.0;
-               for(boxAverageY = 0; 
-                   ((boxAverageY < (ossim_int32)multiplier)&& 
-                    ((boxAverageY+dy)<maxY)); ++boxAverageY)
-               {
-                  for(boxAverageX = 0; 
-                      ((boxAverageX < (ossim_int32)multiplier)&& 
-                       ((boxAverageX+dx)<maxX)); ++boxAverageX)
-                  {
-                     sum += tileBuf[((boxAverageY+dy)*maxX + boxAverageX + dx)];
-                  }
-               }
-               sum /= (double)(multiplier*multiplier);
-               resultBuf[ offsetX[dx] + offsetY[dy] ] = (T)sum;
-            }
-         }
-      }
-   }
-   else
-   {
-      ossim_int32 numberOfBands = (ossim_int32)std::min(result->getNumberOfBands(),
-                                                        tile->getNumberOfBands());
-      ossim_int32 band = 0;
-      for(band = 0; band < numberOfBands; ++band)
-      {
-         T* tileBuf   = static_cast<T*>(tile->getBuf(band));
-         T* resultBuf = static_cast<T*>(result->getBuf(band));
-         T tileBufNp  = static_cast<T>(tile->getNullPix(band));
-         ossim_int32 dx = 0;
-         ossim_int32 dy = 0;
-         ossim_int32 boxAverageX = 0;
-         ossim_int32 boxAverageY = 0;
-         for(dy = 0; dy < maxY; dy+=multiplier)
-         {
-            for(dx = 0; dx < maxX; dx+=multiplier)
-            {
-               double sum = 0.0;
-               if(tileBuf[((dy+(multiplier>>1))*maxX + dx+(multiplier>>1))] != tileBufNp)
-               {
-                  ossim_uint32 nullCount = 0;
-                  for(boxAverageY = 0; 
-                      ((boxAverageY < (ossim_int32)multiplier)&& 
-                       ((boxAverageY+dy)<maxY)); ++boxAverageY)
-                  {
-                     for(boxAverageX = 0; 
-                         ((boxAverageX < (ossim_int32)multiplier)&& 
-                          ((boxAverageX+dx)<maxX)); ++boxAverageX)
-                     {
-                        T value = tileBuf[((boxAverageY+dy)*maxX + boxAverageX + dx)];
-                        if(value != tileBufNp)
-                        {
-                           sum += value;
-                        }
-                        else
-                        {
-                           ++nullCount;
-                        }
-                     }
-                  }
-                  ossim_uint32 area = multiplier*multiplier;
-                  sum /= (double)(area);
-                  if(nullCount!= area)
-                  {
-                     resultBuf[ offsetX[dx] + offsetY[dy] ] = (T)sum;
-                  }
-               }
-            }
-         }
-      }
-      
-   }
-   
-  delete [] offsetX;
-  delete [] offsetY;
-}
-
-ossimString ossimImageRenderer::getLongName() const
-{
-   return ossimString("Image Renderer");
-}
-
-ossimString ossimImageRenderer::getShortName() const
-{
-   return ossimString("Image Renderer"); 
-}
-
-void ossimImageRenderer::refreshEvent(ossimRefreshEvent& event)
-{
-   ossimImageSourceFilter::refreshEvent(event);
-   ossimImageSourceFilter::initialize(); // init connections
-   if((event.getObject()!=this)&&
-      (event.getRefreshType() & ossimRefreshEvent::REFRESH_GEOMETRY))
-   {
-      ossimRefPtr<ossimImageGeometry> inputGeom =
-         theInputConnection?theInputConnection->getImageGeometry():0;
-      if(inputGeom.valid())
-      {
-         ossimImageViewProjectionTransform* ivpt = PTR_CAST(ossimImageViewProjectionTransform, 
-                                                            m_ImageViewTransform.get());
-         if(ivpt)
-         {
-            ivpt->setImageGeometry(inputGeom.get());
-         }
-      }
-   }
-   initialize();
-}
-
-void ossimImageRenderer::enableSource()
-{
-   if ( isSourceEnabled() == false )
-   {
-      setEnableFlag( true );
-   }
-}
-
-void ossimImageRenderer::disableSource()
-{
-   if ( isSourceEnabled() )
-   {
-      setEnableFlag( false );
-   }
-}
-
-void ossimImageRenderer::setEnableFlag(bool flag)
-{
-   if ( getEnableFlag() != flag )
-   {
-      ossimImageSourceFilter::setEnableFlag( flag );
-      checkIVT();
-      initialize();
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageSharpenFilter.cpp b/ossim/src/ossim/imaging/ossimImageSharpenFilter.cpp
deleted file mode 100644
index 0772f5d..0000000
--- a/ossim/src/ossim/imaging/ossimImageSharpenFilter.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageSharpenFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <cstdlib> /* for abs() */
-#include <ossim/imaging/ossimImageSharpenFilter.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimNumericProperty.h>
-
-RTTI_DEF1(ossimImageSharpenFilter, "ossimImageSharpenFilter", ossimImageSourceFilter);
-
-static const char* KERNEL_WIDTH_KW = "kernel_width";
-static const char* KERNEL_SIGMA_KW = "kernel_sigma";
-
-ossimImageSharpenFilter::ossimImageSharpenFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-   theWidth(3),
-   theSigma(.5)
-{
-   theConvolutionSource = new ossimConvolutionSource;
-}
-
-ossimImageSharpenFilter::~ossimImageSharpenFilter()
-{
-}
-
-void ossimImageSharpenFilter::setWidthAndSigma(ossim_uint32 w, ossim_float64 sigma)
-{
-   theWidth = w;
-   theWidth |= 1;
-   if(theWidth < 3) theWidth = 3;
-   theSigma = sigma;
-   buildConvolutionMatrix();
-}
-
-ossimRefPtr<ossimImageData> ossimImageSharpenFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return NULL;
-   }
-   if(!isSourceEnabled())
-   {
-      return theInputConnection->getTile(tileRect, resLevel);
-   }
-   return theConvolutionSource->getTile(tileRect, resLevel);   
-}
-
-void ossimImageSharpenFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-   if(theConvolutionSource->getInput()!=getInput())
-   {
-      theConvolutionSource->disconnectAllInputs();
-      theConvolutionSource->connectMyInputTo(0, getInput());
-   }
-   buildConvolutionMatrix();   
-}
-
-void ossimImageSharpenFilter::buildConvolutionMatrix()
-{
-   std::vector<double> theKernel(theWidth*theWidth);
-   double* kernel = &theKernel.front();
-   //width = findWidth(sigma);
-   ossim_int32 i = 0 ;
-   ossim_int32 u = 0 ;
-   ossim_int32 v = 0 ;
-   double normalize = 0.0 ;
-   ossim_int32 w2 = theWidth>>1;
-   for (v = -w2; v <= w2; ++v)
-   {
-      for (u = -w2; u <= w2; ++u)
-      {
-         double value = laplacianOfGaussian(u, v, theSigma);
-         kernel[i] = value;
-         normalize += kernel[i] ;
-         ++i ;
-      }
-   }
-   if (fabs(normalize) <= 1e-6)
-   {
-      normalize = 1.0;
-   }
-   normalize=(1.0/normalize);
-   ossim_int32 size = static_cast<ossim_int32>(theWidth*theWidth);
-   for (i = 0; i < size; ++i)
-   {
-      kernel[i]=kernel[i]*normalize;
-   } 
-      
-#if 0
-   // print the kernel
-   for (i = 0; i < theWidth*theWidth; ++i)
-   {
-      if((i%theWidth)==0)
-      {
-         std::cout << std::endl;
-      }
-      std::cout << kernel[i] <<", ";
-   } 
-   std::cout << std::endl;
-#endif
-   theConvolutionSource->setConvolution(kernel, theWidth, theWidth, false);
-}
-
-void ossimImageSharpenFilter::connectInputEvent(ossimConnectionEvent &event)
-{
-   ossimImageSourceFilter::connectInputEvent(event);
-   theConvolutionSource->connectMyInputTo(0, getInput());
-   buildConvolutionMatrix();
-}
-
-void ossimImageSharpenFilter::disconnectInputEvent(ossimConnectionEvent &event)
-{
-   ossimImageSourceFilter::disconnectInputEvent(event);
-   theConvolutionSource->connectMyInputTo(0, getInput());
-}
-
-ossimString ossimImageSharpenFilter::getShortName() const
-{
-   return ossimString("Sharpen");
-}
-
-ossimString ossimImageSharpenFilter::getLongName() const
-{
-   return ossimString("Sharpens the input");
-}
-
-void ossimImageSharpenFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   //std::cout << "ossimImageSharpenFilter::setProperty with name = " << property->getName() << std::endl;
-   if(!property) return;
-   if(property->getName() == KERNEL_WIDTH_KW)
-   {
-      theWidth = property->valueToString().toUInt32();
-      theWidth |=1;
-      if(theWidth < 3) theWidth = 3;
-      initialize();
-   }
-   else if(property->getName() == KERNEL_SIGMA_KW)
-   {
-      theSigma = property->valueToString().toDouble();
-      if(theSigma < .1) theSigma = .1;
-      initialize();
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property.get());
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimImageSharpenFilter::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> property = 0;
-   if(name == KERNEL_WIDTH_KW)
-   {
-      property = new ossimNumericProperty(name,
-                                          ossimString::toString(theWidth),
-                                          3.0,
-                                          64.0);
-      property->setCacheRefreshBit();
-      
-   }
-   else if(name == KERNEL_SIGMA_KW)
-   {
-      property = new ossimNumericProperty(name,
-                                          ossimString::toString(theSigma),
-                                          .1,
-                                          32);
-      property->setCacheRefreshBit();
-   }
-   else 
-   {
-      property = ossimImageSourceFilter::getProperty(name);
-   }
-   
-   return property.get();
-}
-
-void ossimImageSharpenFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back(KERNEL_WIDTH_KW);
-   propertyNames.push_back(KERNEL_SIGMA_KW);
-}
-
-bool ossimImageSharpenFilter::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
-   ossimString kernelWidth = kwl.find(prefix, KERNEL_WIDTH_KW);
-   ossimString kernelSigma = kwl.find(prefix, KERNEL_SIGMA_KW);
-   kernelWidth = kernelWidth.trim();
-   kernelSigma = kernelSigma.trim();
-   if(!kernelWidth.empty())
-   {
-      theWidth = kernelWidth.toUInt32();
-      theWidth |= 1; // make it odd and check for size
-      if(theWidth < 3) theWidth = 3;
-   }
-   if(!kernelSigma.empty())
-   {
-      theSigma = kernelSigma.toFloat64();
-   }
-   buildConvolutionMatrix();
-   return result;
-}
-
-bool ossimImageSharpenFilter::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)const
-{
-   kwl.add(prefix, KERNEL_WIDTH_KW, theWidth, true);
-   kwl.add(prefix, KERNEL_SIGMA_KW, theSigma, true);
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageSource.cpp b/ossim/src/ossim/imaging/ossimImageSource.cpp
deleted file mode 100644
index 43c1c5a..0000000
--- a/ossim/src/ossim/imaging/ossimImageSource.cpp
+++ /dev/null
@@ -1,379 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimImageSource,
-          "ossimImageSource" ,
-          ossimSource)
-
-ossimImageSource::ossimImageSource(ossimObject* owner)
-   :ossimSource(owner, 0,0,false,false)
-{
-}
-
-ossimImageSource::ossimImageSource(ossimObject* owner,
-                                   ossim_uint32 inputListSize,
-                                   ossim_uint32 outputListSize,
-                                   bool inputListIsFixedFlag,
-                                   bool outputListIsFixedFlag)
-   :
-      ossimSource(owner, inputListSize, outputListSize,
-                  inputListIsFixedFlag, outputListIsFixedFlag)
-{
-}
-
-ossimImageSource::~ossimImageSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimImageSource::getTile(const ossimIpt& origin,
-                                                      ossim_uint32 resLevel)
-{
-   ossimIrect tileRect(origin.x,
-                       origin.y,
-                       origin.x + getTileWidth()  - 1,
-                       origin.y + getTileHeight() - 1);
-   
-   return getTile(tileRect, resLevel);
-}
-
-ossimRefPtr<ossimImageData> ossimImageSource::getTile(const ossimIrect& rect,
-                                                      ossim_uint32 resLevel)
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                      getInput(0));
-   if(inter)
-   {
-      return inter->getTile(rect, resLevel);
-   }
-   return NULL;
-}
-
-
-bool ossimImageSource::getTile(ossimImageData* result, ossim_uint32 resLevel)
-{
-   // This is the default implementation that is not thread-friendly as it uses the object's tile
-   // then simply assigns its buffer to the provided tile. Eventually, all image sources should
-   // override this method.
-   bool status = true;
-   if (result)
-   {
-      ossimIrect tileRect = result->getImageRectangle();
-      ossimRefPtr<ossimImageData> id = getTile(tileRect, resLevel);
-      if (id.valid())
-      {
-         *result = *(id.get());
-         result->loadTile(id.get()); // Deep copy
-      }
-      else
-      {
-         status = false;
-      }
-   }
-
-   return status;
-}
-
-void ossimImageSource::getDecimationFactor(ossim_uint32 resLevel,
-                                           ossimDpt& result)const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      inter->getDecimationFactor(resLevel, result);
-   }
-}
-
-void ossimImageSource::getDecimationFactors(std::vector<ossimDpt>& decimations)const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      inter->getDecimationFactors(decimations);
-   }
-}
-
-ossim_uint32 ossimImageSource::getNumberOfDecimationLevels() const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      return inter->getNumberOfDecimationLevels();
-   }
-   return 0;
-}
-
-ossimScalarType ossimImageSource::getOutputScalarType() const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      return inter->getOutputScalarType();
-   }
-   
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-ossim_uint32 ossimImageSource::getTileWidth()  const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      return inter->getTileWidth();
-   }
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   
-   return tileSize.x;
-}
-
-ossim_uint32 ossimImageSource::getTileHeight() const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
-   if(inter)
-   {
-      return inter->getTileHeight();
-   }
-   
-   ossimIpt tileSize;
-   ossim::defaultTileSize(tileSize);
-   
-   return tileSize.y;
-}
-
-ossimIrect ossimImageSource::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
-   if(inter)
-   {
-      return inter->getBoundingRect(resLevel);
-   }
-   ossimIrect rect;
-   rect.makeNan();
-   return rect;
-}
-
-void ossimImageSource::getBoundingRect(ossimIrect& rect, ossim_uint32 resLevel) const
-{
-   rect = getBoundingRect( resLevel );
-}
-
-bool ossimImageSource::saveState(ossimKeywordlist& kwl,
-                                 const char* prefix)const
-{
-   return ossimSource::saveState(kwl, prefix);
-}
-
-bool ossimImageSource::loadState(const ossimKeywordlist& kwl,
-                                 const char* prefix)
-{
-   return ossimSource::loadState(kwl, prefix);
-}
-
-//*****************************************************************************
-//  METHOD: ossimImageSource::getValidImageVertices()
-//*****************************************************************************
-void ossimImageSource::getValidImageVertices(std::vector<ossimIpt>& validVertices,
-                                             ossimVertexOrdering ordering,
-                                             ossim_uint32 resLevel)const
-{
-  ossimImageSource* inter = PTR_CAST(ossimImageSource,
-					      getInput(0));
-  if(inter)
-    {
-      return inter->getValidImageVertices(validVertices,
-					  ordering,
-                                          resLevel);
-    }
-   ossimIrect boundingRect = getBoundingRect(resLevel);
-   validVertices.clear();
-   
-   if(ordering == OSSIM_CLOCKWISE_ORDER)
-   {
-      validVertices.push_back(boundingRect.ul());
-      validVertices.push_back(boundingRect.ur());
-      validVertices.push_back(boundingRect.lr());
-      validVertices.push_back(boundingRect.ll());
-   }
-   else
-   {
-      validVertices.push_back(boundingRect.ul());
-      validVertices.push_back(boundingRect.ll());
-      validVertices.push_back(boundingRect.lr());
-      validVertices.push_back(boundingRect.ur());
-   }
-}
-
-double ossimImageSource::getNullPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      return inter->getNullPixelValue(band);
-   }
-   
-   return ossim::defaultNull(getOutputScalarType());
-}
-
-double ossimImageSource::getMinPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      return inter->getMinPixelValue(band);
-   }
-   return ossim::defaultMin(getOutputScalarType());
-}
-
-double ossimImageSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource,
-                                               getInput(0));
-   if(inter)
-   {
-      return inter->getMaxPixelValue(band);
-   }
-   
-   return ossim::defaultMax(getOutputScalarType());
-}
-
-//**************************************************************************************************
-// Default implementation returns the image geometry object associated with the first input source 
-// (if any) connected to this source, or NULL.
-//**************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimImageSource::getImageGeometry()
-{
-   ossimRefPtr<ossimImageGeometry> result = 0;
-   if ( getInput(0) )
-   {
-      ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
-      if( inter )
-      {
-         result = inter->getImageGeometry();
-      }
-   }
-   return result;
-}
-
-//**************************************************************************************************
-//! Default implementation sets geometry of the first input to the geometry specified.
-//**************************************************************************************************
-void ossimImageSource::setImageGeometry(const ossimImageGeometry* geom)
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
-   if (inter)
-   {
-      inter->setImageGeometry(geom);
-   }
-}
-
-void ossimImageSource::saveImageGeometry() const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
-   if (inter)
-   {
-      inter->saveImageGeometry();
-   }
-}
-
-void ossimImageSource::saveImageGeometry(const ossimFilename& geometry_file) const
-{
-   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
-   if (inter)
-   {
-      inter->saveImageGeometry(geometry_file);
-   }
-}
-
-void ossimImageSource::getOutputBandList(std::vector<ossim_uint32>& bandList) const
-{
-   const ossim_uint32 INPUT_BANDS = getNumberOfInputBands();
-   if ( INPUT_BANDS )
-   {
-      bandList.resize( INPUT_BANDS );
-      for ( ossim_uint32 band = 0; band < INPUT_BANDS; ++band )
-      {
-         bandList[band] = band;
-      }
-   }
-   else
-   {
-      bandList.clear();
-   }
-}
-
-ossim_uint32 ossimImageSource::getNumberOfOutputBands() const
-{
-   return getNumberOfInputBands();
-}
-
-ossimRefPtr<ossimProperty> ossimImageSource::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = ossimSource::getProperty(name);
-
-   ossimString tempName = name;
-   if(result.valid())
-   {
-      if(tempName.downcase() == ossimKeywordNames::ENABLED_KW)
-      {
-         result->clearChangeType();
-         
-         // we will at least say its a radiometric change
-         //
-         result->setFullRefreshBit();
-      }
-   }
-
-   return result;
-}
-
-void ossimImageSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimSource::setProperty(property);
-}
-
-void ossimImageSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimSource::getPropertyNames(propertyNames);
-}
-
-bool ossimImageSource::isIndexedData() const
-{
-   bool result = false;
-   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
-   if (inter)
-   {
-      result = inter->isIndexedData();
-   }
-   return result;
-}
-
-// Protected to hide from use...
-ossimImageSource::ossimImageSource (const ossimImageSource& /* rhs */)
-   :ossimSource() 
-{}
-
-// Protected to hide from use...
-const ossimImageSource& ossimImageSource::operator=(const ossimImageSource&)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageSourceFactory.cpp b/ossim/src/ossim/imaging/ossimImageSourceFactory.cpp
deleted file mode 100644
index afe4546..0000000
--- a/ossim/src/ossim/imaging/ossimImageSourceFactory.cpp
+++ /dev/null
@@ -1,591 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: This is the image source factory.
-//              It will try to create image filters
-//              first then it will try the image writers
-//              and image handlers (image readers)
-//
-//*************************************************************************
-// $Id: ossimImageSourceFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageSourceFactory.h>
-#include <ossim/imaging/ossimConvolutionFilter1D.h>
-#include <ossim/imaging/ossimImageGaussianFilter.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimCacheTileSource.h>
-#include <ossim/imaging/ossimFeatherMosaic.h>
-#include <ossim/imaging/ossimHistogramRemapper.h>
-#include <ossim/imaging/ossimNullPixelFlip.h>
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/imaging/ossimClosestToCenterCombiner.h>
-#include <ossim/imaging/ossimBlendMosaic.h>
-#include <ossim/imaging/ossimMaxMosaic.h>
-#include <ossim/imaging/ossimOrthoImageMosaic.h>
-#include <ossim/imaging/ossimPiecewiseRemapper.h>
-#include <ossim/imaging/ossimColorNormalizedFusion.h>
-#include <ossim/imaging/ossimLocalCorrelationFusion.h>
-#include <ossim/imaging/ossimSFIMFusion.h>
-#include <ossim/imaging/ossimTopographicCorrectionFilter.h>
-#include <ossim/imaging/ossimBandSelector.h>
-#include <ossim/imaging/ossimNBandToIndexFilter.h>
-#include <ossim/imaging/ossimRgbToGreyFilter.h>
-#include <ossim/imaging/ossimRgbToJpegYCbCrSource.h>
-#include <ossim/imaging/ossimRgbToHsvSource.h>
-#include <ossim/imaging/ossimRgbToHsiSource.h>
-#include <ossim/imaging/ossimHsiToRgbSource.h>
-#include <ossim/imaging/ossimHsvToRgbSource.h>
-#include <ossim/imaging/ossimHsiRemapper.h>
-#include <ossim/imaging/ossimJpegYCbCrToRgbSource.h>
-#include <ossim/imaging/ossimPolyCutter.h>
-#include <ossim/imaging/ossimGeoPolyCutter.h>
-#include <ossim/imaging/ossimHistogramEqualization.h>
-#include <ossim/imaging/ossimHistogramMatchFilter.h>
-#include <ossim/imaging/ossimHistogramThreshholdFilter.h>
-#include <ossim/imaging/ossimConvolutionSource.h>
-#include <ossim/imaging/ossimSICDToDetectedImage.h>
-#include <ossim/imaging/ossimBrightnessContrastSource.h>
-#include <ossim/imaging/ossimBrightnessMatch.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimBandMergeSource.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/imaging/ossimBumpShadeTileSource.h>
-#include <ossim/imaging/ossimSubImageTileSource.h>
-#include <ossim/imaging/ossimRLevelFilter.h>
-#include <ossim/imaging/ossimBandClipFilter.h>
-#include <ossim/imaging/ossimValueAssignImageSourceFilter.h>
-#include <ossim/imaging/ossimImageSharpenFilter.h>
-#include <ossim/imaging/ossim3x3ConvolutionFilter.h>
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-#include <ossim/imaging/ossimEquationCombiner.h>
-#include <ossim/imaging/ossimImageGaussianFilter.h>
-#include <ossim/imaging/ossimMaskFilter.h>
-#include <ossim/imaging/ossimPixelFlipper.h>
-#include <ossim/imaging/ossimElevImageSource.h>
-#include <ossim/imaging/ossimLandsatTopoCorrectionFilter.h>
-#include <ossim/imaging/ossimGeoAnnotationSource.h>
-#include <ossim/imaging/ossimMapCompositionSource.h>
-#include <ossim/imaging/ossimScaleFilter.h>
-#include <ossim/imaging/ossimEastingNorthingCutter.h>
-#include <ossim/imaging/ossimEdgeFilter.h>
-#include <ossim/imaging/ossimFftFilter.h>
-#include <ossim/imaging/ossimWatermarkFilter.h>
-#include <ossim/imaging/ossimTrimFilter.h>
-#include <ossim/imaging/ossimTwoColorView.h>
-#include <ossim/imaging/ossimMemoryImageSource.h>
-#include <ossim/imaging/ossimGridRemapSource.h>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimRectangleCutFilter.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/imaging/ossimMultiBandHistogramTileSource.h>
-#include <ossim/imaging/ossimBandAverageFilter.h>
-#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
-#include <ossim/imaging/ossimAtCorrGridRemapper.h>
-#include <ossim/imaging/ossimAtCorrRemapper.h>
-#include <ossim/imaging/ossimDilationFilter.h>
-
-// Not sure if we want to keep this here
-#include <ossim/imaging/ossimAtbController.h>
-
-#include <ossim/base/ossimTrace.h>
-
-RTTI_DEF1(ossimImageSourceFactory, "ossimImageSourceFactory", ossimImageSourceFactoryBase);
-
-static ossimTrace traceDebug("ossimImageSourceFactory:debug");
-
-ossimImageSourceFactory* ossimImageSourceFactory::theInstance=NULL;
-
-ossimImageSourceFactory::~ossimImageSourceFactory()
-{
-   theInstance = NULL;
-   ossimObjectFactoryRegistry::instance()->unregisterFactory(this);
-}
-ossimImageSourceFactory* ossimImageSourceFactory::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimImageSourceFactory;
-   }
-
-   return theInstance;
-}
-
-ossimObject* ossimImageSourceFactory::createObject(const ossimString& name)const
-{
-
-   // lets do the filters first
-   if( name == STATIC_TYPE_NAME(ossimBandSelector) ||
-       name == "ossimNativeBandSelectorTileSource" ) 
-   {
-      //---
-      // For backwards compatibility check old name:
-      // "ossimNativeBandSelectorTileSource"
-      //---
-      return new ossimBandSelector;
-   }
-   else if(name ==  STATIC_TYPE_NAME(ossimNullPixelFlip))
-   {
-      return new ossimNullPixelFlip;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageRenderer))
-   {
-      return new ossimImageRenderer;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimCacheTileSource))
-   {
-      return new ossimCacheTileSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimColorNormalizedFusion))
-   {
-      return new ossimColorNormalizedFusion;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimLocalCorrelationFusion))
-   {
-      return new ossimLocalCorrelationFusion;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimSFIMFusion))
-   {
-      return new ossimSFIMFusion;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimBlendMosaic))
-   {
-      return new ossimBlendMosaic;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimMaxMosaic))
-   {
-      return new ossimMaxMosaic;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimHistogramRemapper))
-   {
-      return new ossimHistogramRemapper;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageMosaic))
-   {
-      return new ossimImageMosaic;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimClosestToCenterCombiner))
-   {
-      return new ossimClosestToCenterCombiner;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimRgbToGreyFilter))
-   {
-      return new ossimRgbToGreyFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimNBandToIndexFilter))
-   {
-      return new ossimNBandToIndexFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageChain))
-   {
-      return new ossimImageChain;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimPolyCutter))
-   {
-      return new ossimPolyCutter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimGeoPolyCutter))
-   {
-      return new ossimGeoPolyCutter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimJpegYCbCrToRgbSource))
-   {
-      return new ossimJpegYCbCrToRgbSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimRgbToJpegYCbCrSource))
-   {
-      return new ossimRgbToJpegYCbCrSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimHsiToRgbSource))
-   {
-      return new ossimHsiToRgbSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimRgbToHsiSource))
-   {
-      return new ossimRgbToHsiSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimHsvToRgbSource))
-   {
-      return new ossimHsvToRgbSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimRgbToHsvSource))
-   {
-      return new ossimRgbToHsvSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimHistogramEqualization))
-   {
-      return new ossimHistogramEqualization;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimHistogramMatchFilter))
-   {
-      return new ossimHistogramMatchFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimHistogramThreshholdFilter))
-   {
-      return new ossimHistogramThreshholdFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimGeoAnnotationSource))
-   {
-      return new ossimGeoAnnotationSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimConvolutionSource))
-   {
-      return new ossimConvolutionSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimSICDToDetectedImage))
-   {
-	   return new ossimSICDToDetectedImage;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimBrightnessContrastSource))
-   {
-      return new ossimBrightnessContrastSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimBrightnessMatch))
-   {
-      return new ossimBrightnessMatch;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimScalarRemapper))
-   {
-      return new ossimScalarRemapper;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimBandMergeSource))
-   {
-      return new ossimBandMergeSource;
-   }  
-   else if(name == STATIC_TYPE_NAME(ossimFeatherMosaic))
-   {
-      return new ossimFeatherMosaic;
-   }  
-   else if(name == STATIC_TYPE_NAME(ossimGridRemapSource))
-   {
-      return new ossimGridRemapSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimEquationCombiner))
-   {
-      return new ossimEquationCombiner;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimConvolutionFilter1D))
-   {
-      return new ossimConvolutionFilter1D;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageGaussianFilter))
-   {
-      return new ossimImageGaussianFilter;
-   }
-   // Not sure if we want to keep this here
-   else if(name == STATIC_TYPE_NAME(ossimAtbController))
-   {
-      return new ossimAtbController;
-   }  
-   else if(name == STATIC_TYPE_NAME(ossimIndexToRgbLutFilter))
-   {
-      return new ossimIndexToRgbLutFilter;
-   }
-   else if(name ==  STATIC_TYPE_NAME(ossimBumpShadeTileSource))
-   {
-      return new ossimBumpShadeTileSource;
-   }
-   else if(name ==  STATIC_TYPE_NAME(ossimSubImageTileSource))
-   {
-      return new ossimSubImageTileSource;
-   }
-   else if(name ==  STATIC_TYPE_NAME(ossimRLevelFilter))
-   {
-      return new ossimRLevelFilter;
-   }
-   else if(name ==  STATIC_TYPE_NAME(ossimBandClipFilter))
-   {
-      return new ossimBandClipFilter;
-   }
-   else if(name ==  STATIC_TYPE_NAME(ossimHsiRemapper))
-   {
-      return new ossimHsiRemapper;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimHistogramWriter))
-   {
-      return new ossimHistogramWriter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageHistogramSource))
-   {
-      return new ossimImageHistogramSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimRectangleCutFilter))
-   {
-      return new ossimRectangleCutFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimCastTileSourceFilter))
-   {
-      return new ossimCastTileSourceFilter;
-   }
-   // all the image handlers
-   else if(name == STATIC_TYPE_NAME(ossimValueAssignImageSourceFilter))
-   {
-      return new ossimValueAssignImageSourceFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageSharpenFilter))
-   {
-      return new ossimImageSharpenFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossim3x3ConvolutionFilter))
-   {
-      return new ossim3x3ConvolutionFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimOrthoImageMosaic))
-   {
-      return new ossimOrthoImageMosaic;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimPiecewiseRemapper))
-   {
-      return new ossimPiecewiseRemapper;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimMapCompositionSource))
-   {
-      return new ossimMapCompositionSource;
-   }
-   else if(name ==  STATIC_TYPE_NAME(ossimElevImageSource))
-   {
-      return new ossimElevImageSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimMaskFilter))
-   {
-      return new ossimMaskFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimMultiBandHistogramTileSource))
-   {
-      return new ossimMultiBandHistogramTileSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimBandAverageFilter))
-   {
-      return new ossimBandAverageFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimPixelFlipper))
-   {
-      return new ossimPixelFlipper();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimScaleFilter))
-   {
-      return new ossimScaleFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageToPlaneNormalFilter))
-   {
-      return new ossimImageToPlaneNormalFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimTopographicCorrectionFilter))
-   {
-      return new ossimTopographicCorrectionFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimLandsatTopoCorrectionFilter))
-   {
-      return new ossimLandsatTopoCorrectionFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimAtCorrRemapper))
-   {
-      return new ossimAtCorrRemapper();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimAtCorrGridRemapper))
-   {
-      return new ossimAtCorrGridRemapper();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimEastingNorthingCutter))
-   {
-      return new ossimEastingNorthingCutter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimEdgeFilter))
-   {
-      return new ossimEdgeFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimFftFilter))
-   {
-      return new ossimFftFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimWatermarkFilter))
-   {
-      return new ossimWatermarkFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageGaussianFilter))
-   {
-      return new ossimImageGaussianFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimTrimFilter))
-   {
-      return new ossimTrimFilter();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimTwoColorView))
-   {
-      return new ossimTwoColorView;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageHistogramSource))
-   {
-      return new ossimImageHistogramSource();
-   }
-   else if(name == STATIC_TYPE_NAME(ossimImageSourceFilter))
-   {
-      // this is just a pass through source
-      return new ossimImageSourceFilter;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimMemoryImageSource))
-   {
-      // this is just a pass through source
-      return new ossimMemoryImageSource;
-   }
-   else if(name == STATIC_TYPE_NAME(ossimDilationFilter))
-   {
-      return new ossimDilationFilter();
-   }
-   return NULL;
-}
-
-ossimObject* ossimImageSourceFactory::createObject(const ossimKeywordlist& kwl,
-                                                   const char* prefix)const
-{
-   static const char* MODULE = "ossimImageSourceFactory::createSource";
-   
-   ossimString copyPrefix;
-   if (prefix)
-   {
-      copyPrefix = prefix;
-   }
-   
-   ossimObject* result = NULL;
-   
-   if(traceDebug())
-   {
-      CLOG << "looking up type keyword for prefix = " << copyPrefix << endl;
-   }
-
-   const char* lookup = kwl.find(copyPrefix, "type");
-   if(lookup)
-   {
-      ossimString name = lookup;
-      result           = createObject(name);
-      
-      if(result)
-      {
-         if(traceDebug())
-         {
-            CLOG << "found source " << result->getClassName() << " now loading state" << endl;
-         }
-         result->loadState(kwl, copyPrefix.c_str());
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            CLOG << "type not found " << lookup << endl;
-         }
-      }
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         CLOG << "type keyword not found" << endl;
-      }
-   }
-   return result;
-}
-
-void ossimImageSourceFactory::getTypeNameList(std::vector<ossimString>& typeList)const
-{
-   typeList.push_back(STATIC_TYPE_NAME(ossimBandSelector));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageRenderer));
-   typeList.push_back(STATIC_TYPE_NAME(ossimCacheTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBlendMosaic));
-   typeList.push_back(STATIC_TYPE_NAME(ossimMaxMosaic));   
-   typeList.push_back(STATIC_TYPE_NAME(ossimNullPixelFlip));
-   typeList.push_back(STATIC_TYPE_NAME(ossimColorNormalizedFusion));
-   typeList.push_back(STATIC_TYPE_NAME(ossimLocalCorrelationFusion));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSFIMFusion));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramRemapper));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageMosaic));
-   typeList.push_back(STATIC_TYPE_NAME(ossimClosestToCenterCombiner));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToGreyFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimNBandToIndexFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageChain));
-   typeList.push_back(STATIC_TYPE_NAME(ossimPolyCutter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimGeoPolyCutter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimJpegYCbCrToRgbSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToJpegYCbCrSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHsiToRgbSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToHsiSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHsvToRgbSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToHsvSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramEqualization));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramMatchFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramThreshholdFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimGeoAnnotationSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimConvolutionSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSICDToDetectedImage));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBrightnessContrastSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBrightnessMatch));
-   typeList.push_back(STATIC_TYPE_NAME(ossimScalarRemapper));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBandMergeSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimFeatherMosaic));
-   typeList.push_back(STATIC_TYPE_NAME(ossimGridRemapSource));
-   // Not sure if we want to keep this here
-   typeList.push_back(STATIC_TYPE_NAME(ossimAtbController));
-   typeList.push_back(STATIC_TYPE_NAME(ossimIndexToRgbLutFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBumpShadeTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSubImageTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRLevelFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBandClipFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHsiRemapper));
-   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramWriter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageHistogramSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRectangleCutFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimElevImageSource));
-   
-   typeList.push_back(STATIC_TYPE_NAME(ossimValueAssignImageSourceFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageSharpenFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossim3x3ConvolutionFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimOrthoImageMosaic));
-   typeList.push_back(STATIC_TYPE_NAME(ossimPiecewiseRemapper));
-   typeList.push_back(STATIC_TYPE_NAME(ossimMapCompositionSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimCastTileSourceFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimEquationCombiner));
-   typeList.push_back(STATIC_TYPE_NAME(ossimConvolutionFilter1D));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageGaussianFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimMaskFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimMultiBandHistogramTileSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBandAverageFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimPixelFlipper));
-   typeList.push_back(STATIC_TYPE_NAME(ossimScaleFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageToPlaneNormalFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimTopographicCorrectionFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimLandsatTopoCorrectionFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimAtCorrRemapper));
-   typeList.push_back(STATIC_TYPE_NAME(ossimAtCorrGridRemapper));
-   typeList.push_back(STATIC_TYPE_NAME(ossimEastingNorthingCutter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimEdgeFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimFftFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimWatermarkFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageGaussianFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimTrimFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimTwoColorView));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageHistogramSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimImageSourceFilter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimMemoryImageSource));
-   typeList.push_back(STATIC_TYPE_NAME(ossimDilationFilter));
-}
-
-// Hide from use...
-ossimImageSourceFactory::ossimImageSourceFactory()
-   :ossimImageSourceFactoryBase()
-{}
-
-ossimImageSourceFactory::ossimImageSourceFactory(const ossimImageSourceFactory&)
-   :ossimImageSourceFactoryBase()
-{}
-
-const ossimImageSourceFactory& ossimImageSourceFactory::operator=(ossimImageSourceFactory&)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageSourceFilter.cpp b/ossim/src/ossim/imaging/ossimImageSourceFilter.cpp
deleted file mode 100644
index 755dfee..0000000
--- a/ossim/src/ossim/imaging/ossimImageSourceFilter.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-//*******************************************************************
-//  $Id: ossimImageSourceFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimProperty.h>
- 
-static ossimTrace traceDebug("ossimImageSourceFilter:degug");
-
-RTTI_DEF2(ossimImageSourceFilter, "ossimImageSourceFilter", ossimImageSource, ossimConnectableObjectListener)
-
-ossimImageSourceFilter::ossimImageSourceFilter(ossimObject* owner)
-   : ossimImageSource(owner,
-                      1, // number of inputs
-                      0, // number of outputs
-                      true, // input's fixed
-                      false), // outputs ar not fixed
-     theInputConnection(NULL)
-{
-   addListener((ossimConnectableObjectListener*)this);
-}
-
-ossimImageSourceFilter::ossimImageSourceFilter(ossimImageSource* inputSource)
-   : ossimImageSource(NULL,
-                      1,
-                      0,
-                      true,
-                      false),
-     theInputConnection(inputSource)
-{
-   if(inputSource)
-   {
-     connectMyInputTo(0, inputSource);
-   }
-   addListener((ossimConnectableObjectListener*)this);
-}
-
-ossimImageSourceFilter::ossimImageSourceFilter(ossimObject* owner,
-                                               ossimImageSource* inputSource)
-   : ossimImageSource(owner,
-                      1,
-                      0,
-                      true,
-                      false),
-     theInputConnection(inputSource)
-{
-   if(inputSource)
-   {
-      theInputObjectList[0] = inputSource;
-      inputSource->connectMyOutputTo(this, false);
-   }
-   addListener((ossimConnectableObjectListener*)this);
-}
-
-
-ossimImageSourceFilter::~ossimImageSourceFilter()
-{
-   removeListener((ossimConnectableObjectListener*)this);
-   theInputConnection = NULL;
-}
-
-ossim_uint32 ossimImageSourceFilter::getNumberOfInputBands()const
-{
-   if(theInputConnection)
-   {
-      return theInputConnection->getNumberOfOutputBands();
-   }
-
-   return 0;
-}
-
-void ossimImageSourceFilter::initialize()
-{
-   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
-}
-
-bool ossimImageSourceFilter::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   bool result = ossimImageSource::loadState(kwl, prefix);
-
-   // make sure we have 1 input.
-   //setNumberOfInputs(1);
-
-   // we will fix the input
-   //if(!theInputListIsFixedFlag)
-  // {
-  //    theInputListIsFixedFlag = true;
-  // }
-   
-   return result;
-}
-
-bool ossimImageSourceFilter::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix)const
-{
-   return ossimImageSource::saveState(kwl, prefix);
-}
-
-
-bool ossimImageSourceFilter::canConnectMyInputTo(ossim_int32 inputIndex,
-						 const ossimConnectableObject* object)const
-{
-  
-  return ((PTR_CAST(ossimImageSource, object)||!object) && ( inputIndex == 0 ) );
-}
-
-void ossimImageSourceFilter::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-  if(traceDebug())
-    {
-       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::connectInputEvent: ";
-
-       if(getInput())
-       {
-          ossimNotify(ossimNotifyLevel_DEBUG) << "to" <<  getInput()->getClassName() << std::endl;
-       }
-       else
-       {
-          ossimNotify(ossimNotifyLevel_DEBUG) << "to NULL" << std::endl;
-       }
-    }
-  theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
-  initialize();
-  if(traceDebug())
-  {
-     if(theInputConnection)
-     {
-        ossimNotify(ossimNotifyLevel_DEBUG) << "theInputConnection was set to " << getInput()->getClassName() << std::endl;
-     }
-     else
-     {
-        ossimNotify(ossimNotifyLevel_DEBUG) << "theInputConnection was set to NULL" <<  std::endl;
-     }
-     ossimNotify(ossimNotifyLevel_DEBUG) << "Leaving ossimImageSourceFilter::connectInput" << std::endl;
-  }
-}
-void ossimImageSourceFilter::disconnectInputEvent(ossimConnectionEvent& /* event */)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::disconnectInputEvent" << std::endl;
-   }
-   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
-   initialize();
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "Leaving ossimImageSourceFilter::disconnectInput" << std::endl;
-   }
-}
-void ossimImageSourceFilter::propertyEvent(ossimPropertyEvent& /* event */)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::propertyEvent DEBUG: Entering..." << std::endl;
-   }
-   initialize();
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::propertyEvent DEBUG: Leaving..." << std::endl;
-   }
-}
-
-void ossimImageSourceFilter::refreshEvent(ossimRefreshEvent& /* event */)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::refreshEvent " << std::endl;
-   }
-   initialize();
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::refreshEvent " << std::endl;
-   }
-}
-
-void ossimImageSourceFilter::getOutputBandList(std::vector<ossim_uint32>& bandList) const
-{
-   if(theInputConnection)
-   {
-      return theInputConnection->getOutputBandList(bandList);
-   }
-
-   return ossimImageSource::getOutputBandList(bandList);
-}
-
-void ossimImageSourceFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimImageSource::setProperty(property);
-}
-
-ossimRefPtr<ossimProperty> ossimImageSourceFilter::getProperty(const ossimString& name)const
-{
-   return ossimImageSource::getProperty(name);
-   
-}
-
-void ossimImageSourceFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSource::getPropertyNames(propertyNames);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageSourceSequencer.cpp b/ossim/src/ossim/imaging/ossimImageSourceSequencer.cpp
deleted file mode 100644
index d9cff23..0000000
--- a/ossim/src/ossim/imaging/ossimImageSourceSequencer.cpp
+++ /dev/null
@@ -1,449 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-//*******************************************************************
-//  $Id: ossimImageSourceSequencer.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageWriter.h>
-
-RTTI_DEF2(ossimImageSourceSequencer, "ossimImageSourceSequencer",
-          ossimImageSource, ossimConnectableObjectListener);
-
-static ossimTrace traceDebug("ossimImageSourceSequencer:debug");
-   
-ossimImageSourceSequencer::ossimImageSourceSequencer(ossimImageSource* inputSource,
-                                                     ossimObject* owner)
-:ossimImageSource(owner,
-                  1,
-                  1,
-                  true,
-                  false),
-    theBlankTile(NULL),
-    theAreaOfInterest(0,0,0,0),
-    theTileSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT),
-    theNumberOfTilesHorizontal(0),
-    theNumberOfTilesVertical(0),
-    theCurrentTileNumber(0)
-{
-   ossim::defaultTileSize(theTileSize);
-   theAreaOfInterest.makeNan();
-   theInputConnection    = inputSource;
-   if(inputSource)
-   {
-     connectMyInputTo(0, inputSource);
-     initialize(); // Derived class depends on this initialization to happen now. DO NOT MOVE.
-   }
-   addListener( (ossimConnectableObjectListener*)this);
-}
-
-ossimImageSourceSequencer::~ossimImageSourceSequencer()
-{
-   removeListener((ossimConnectableObjectListener*)this);
-}
-
-ossim_int64 ossimImageSourceSequencer::getNumberOfTiles()const
-{
-   return (theNumberOfTilesHorizontal*theNumberOfTilesVertical);
-}
-
-
-ossim_int64 ossimImageSourceSequencer::getNumberOfTilesHorizontal()const
-{
-   return theNumberOfTilesHorizontal;
-}
-
-ossim_int64 ossimImageSourceSequencer::getNumberOfTilesVertical()const
-{
-   return theNumberOfTilesVertical;
-}
-
-ossimScalarType ossimImageSourceSequencer::getOutputScalarType() const
-{
-   if(theInputConnection)
-   {
-      return theInputConnection->getOutputScalarType();
-   }
-   
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-ossimIpt ossimImageSourceSequencer::getTileSize()const
-{
-   return theTileSize;
-}
-
-void ossimImageSourceSequencer::setTileSize(const ossimIpt& tileSize)
-{
-   theTileSize = tileSize;
-   updateTileDimensions();
-//   initialize();
-}
-
-void ossimImageSourceSequencer::setTileSize(ossim_int32 width, ossim_int32 height)
-{
-   setTileSize(ossimIpt(width, height));
-}
-
-void ossimImageSourceSequencer::updateTileDimensions()
-{
-   bool status = false;
-   if( !theAreaOfInterest.hasNans() && !theTileSize.hasNans() )
-   {
-      ossim_float64 aoiWidth   = theAreaOfInterest.width();
-      ossim_float64 aoiHeight  = theAreaOfInterest.height();
-      ossim_float64 tileWidth  = theTileSize.x;
-      ossim_float64 tileHeight = theTileSize.y;
-      
-      if ( (aoiWidth > 0.0) && (aoiHeight > 0.0) &&
-           (tileWidth > 0.0) && (tileHeight > 0.0) )
-      {
-         theNumberOfTilesHorizontal
-            = static_cast<ossim_int64>(std::ceil(aoiWidth/tileWidth));
-         theNumberOfTilesVertical
-            = static_cast<ossim_int64>(std::ceil(aoiHeight/tileHeight));
-         status = true;
-      }
-   }
-
-   if ( !status )
-   {
-      theNumberOfTilesHorizontal = 0;
-      theNumberOfTilesVertical   = 0;
-   }
-}
-
-void ossimImageSourceSequencer::initialize()
-{
-   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
-
-   if(theInputConnection)
-   {
-      if(theTileSize.hasNans())
-      {
-         theTileSize.x = theInputConnection->getTileWidth();
-         theTileSize.y = theInputConnection->getTileHeight();
-      }
-
-      ossimDrect rect = theInputConnection->getBoundingRect();
-      if(rect.hasNans())
-      {
-         theAreaOfInterest.makeNan();
-      }
-      else
-      {
-         rect.stretchOut();
-         setAreaOfInterest(rect);
-      }
-      updateTileDimensions();
-      
-      theBlankTile  = ossimImageDataFactory::instance()->create(this,
-                                                                this);
-      if(theBlankTile.valid())
-      {
-         theBlankTile->initialize();
-      }
-   }
-}
-
-bool ossimImageSourceSequencer::canConnectMyInputTo(ossim_int32 /* inputIndex */,
-						    const ossimConnectableObject* object)const
-{      
-   return (object&& PTR_CAST(ossimImageSource, object));
-}
-
-void ossimImageSourceSequencer::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimImageSourceSequencer::disconnectInputEvent(ossimConnectionEvent& /* event */)
-{
-   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
-}
-
-ossimIrect ossimImageSourceSequencer::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimDrect temp;
-   temp.makeNan();
-   
-   if(!theInputConnection) return temp;
-   
-   if(theAreaOfInterest.hasNans())
-   {
-      return theInputConnection->getBoundingRect(resLevel);
-   }
-   
-   return theAreaOfInterest;
-}
-
-void ossimImageSourceSequencer::getDecimationFactor(ossim_uint32 resLevel,
-                                                    ossimDpt& result) const
-{
-   if(theInputConnection)
-   {
-      theInputConnection->getDecimationFactor(resLevel, result);
-   }
-   result.makeNan();
-}
-
-void ossimImageSourceSequencer::getDecimationFactors(vector<ossimDpt>& decimations) const
-{
-   if(theInputConnection)
-   {
-      theInputConnection->getDecimationFactors(decimations);
-   }   
-}
-
-ossim_uint32 ossimImageSourceSequencer::getNumberOfDecimationLevels()const
-{
-   ossim_uint32 result = 0;
-   if(theInputConnection)
-   {
-      result = theInputConnection->getNumberOfDecimationLevels();
-   }
-   return result;
-}
-
-void ossimImageSourceSequencer::setAreaOfInterest(const ossimIrect& areaOfInterest)
-{
-   if(areaOfInterest.hasNans())
-   {
-      theAreaOfInterest.makeNan();
-      theNumberOfTilesHorizontal = 0;
-      theNumberOfTilesVertical   = 0;
-   }
-
-   // let's round it to the nearest pixel value before setting it.
-   theAreaOfInterest = areaOfInterest;
-   updateTileDimensions();
-}
-
-const ossimIrect& ossimImageSourceSequencer::getAreaOfInterest()const
-{
-   return theAreaOfInterest;
-}
-
-void ossimImageSourceSequencer::setToStartOfSequence()
-{
-   theCurrentTileNumber = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
-   const ossimIrect& rect, ossim_uint32 resLevel)
-{
-   if(theInputConnection)
-   {
-      ossimRefPtr<ossimImageData> tile =
-         theInputConnection->getTile(rect, resLevel);
-      if (tile.valid()&&tile->getBuf())
-      {
-         return tile;
-      }
-      else
-      {
-         // We should return a valid tile for the writers.
-         theBlankTile->setImageRectangle(rect);
-         return theBlankTile;
-      }
-   }
-
-   return 0;
-}
-
-ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getNextTile( ossim_uint32 resLevel )
-{
-   ossimRefPtr<ossimImageData> result = 0;
-   if ( theInputConnection )
-   {
-      ossimIrect tileRect;
-      if ( getTileRect( theCurrentTileNumber, tileRect ) )
-      {
-         ++theCurrentTileNumber;
-         result = theInputConnection->getTile(tileRect, resLevel);
-         if( !result.valid() || !result->getBuf() )
-         {	 
-            theBlankTile->setImageRectangle(tileRect);
-            result = theBlankTile;
-         }
-      }
-   }
-   return result;
-}
-
-ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
-   ossim_int64 id, ossim_uint32 resLevel)
-{
-   static const char* MODULE= "ossimImageSourceSequencer::getTile(id, resLevel)";
-   if(traceDebug())
-   {
-      CLOG << "entering.."<<endl;
-   }
-
-   ossimRefPtr<ossimImageData> result = 0;
-
-   if(theInputConnection)
-   {
-      // if we have no tiles try to initialize.
-      if(getNumberOfTiles() == 0)
-      {
-         initialize();
-      }
-
-      ossimIrect tileRect;
-      if ( getTileRect( id, tileRect ) )
-      {
-         result = theInputConnection->getTile(tileRect, resLevel);
-         if( !result.valid() || !result->getBuf() )
-         {	 
-            theBlankTile->setImageRectangle(tileRect);
-            result = theBlankTile;
-         }
-      }
-      else // getTileRect failed...
-      {
-         if(traceDebug())
-         {
-            CLOG << "was not able to get an origin for id = " << id << endl;
-         }
-      }
-   }
-   else // no connection...
-   {
-      if(traceDebug())
-      {
-         CLOG << "No input connection so returing NULL" << endl;
-      }
-   }
-   if(traceDebug())
-   {
-      CLOG << "leaving.."<<endl;
-   }
-   
-   return result;
-}
-
-bool ossimImageSourceSequencer::getTileOrigin(ossim_int64 id, ossimIpt& origin) const
-{
-   bool result = false;
-   if( id >= 0 )
-   {
-      if( (theNumberOfTilesHorizontal > 0) && (theCurrentTileNumber < getNumberOfTiles()) )
-      {
-         ossim_int64 y = id / theNumberOfTilesHorizontal;
-         ossim_int64 x = id % theNumberOfTilesHorizontal;
-         if( (x < theNumberOfTilesHorizontal) && (y < theNumberOfTilesVertical) )
-         {
-            ossim_int64 ulx = theAreaOfInterest.ul().x;
-            ossim_int64 uly = theAreaOfInterest.ul().y;
-            ossim_int64 tx  = theTileSize.x;
-            ossim_int64 ty  = theTileSize.y; 
-            x = ulx + x * tx;
-            y = uly + y * ty;
-
-            //---
-            // ossimIpt currently signed 32 bit so make sure we didn't bust the
-            // bounds.
-            //---
-            if ( (x <= OSSIM_DEFAULT_MAX_PIX_SINT32) && ( y <= OSSIM_DEFAULT_MAX_PIX_SINT32) )
-            {
-               origin.x = (ossim_int32)x;
-               origin.y = (ossim_int32)y;
-               result = true;
-            }
-         }
-      }
-   }
-   return result;
-}
-
-bool ossimImageSourceSequencer::getTileRect(ossim_int64 tile_id, ossimIrect& tileRect) const
-{
-   // Fetch tile origin for this tile:
-   ossimIpt origin;
-   bool result = getTileOrigin(tile_id, origin);
-   if ( result )
-   {
-      // Establish the tile rect of interest for this tile:
-      tileRect.set_ul (origin);
-      tileRect.set_lrx(origin.x + theTileSize.x - 1);
-      tileRect.set_lry(origin.y + theTileSize.y - 1);
-   }
-   return result;
-}
-
-double ossimImageSourceSequencer::getNullPixelValue(ossim_uint32 band)const
-{
-   if (theInputConnection)
-   {
-      return theInputConnection->getNullPixelValue(band);
-   }
-
-   return ossimImageSource::getNullPixelValue(band);
-}
-
-double ossimImageSourceSequencer::getMinPixelValue(ossim_uint32 band)const
-{
-   if (theInputConnection)
-   {
-      return theInputConnection->getMinPixelValue(band);
-   }
-   
-   return ossimImageSource::getMinPixelValue(band);  
-}
-
-double ossimImageSourceSequencer::getMaxPixelValue(ossim_uint32 band)const
-{
-   if (theInputConnection)
-   {
-      return theInputConnection->getMaxPixelValue(band);
-   }
-   
-   return ossimImageSource::getMaxPixelValue(band);  
-}
-
-ossim_uint32 ossimImageSourceSequencer::getNumberOfInputBands()const
-{
-   if(theInputConnection)
-   {
-      return theInputConnection->getNumberOfOutputBands();
-   }
-
-   return 0;
-}
-
-ossim_uint32 ossimImageSourceSequencer::getTileWidth() const
-{
-   return theTileSize.x;
-}
-
-ossim_uint32 ossimImageSourceSequencer::getTileHeight()const
-{
-   return theTileSize.y;
-}
-
-void ossimImageSourceSequencer::slaveProcessTiles()
-{
-}
-
-bool ossimImageSourceSequencer::isMaster() const
-{
-   return true;
-}
-
-
-
diff --git a/ossim/src/ossim/imaging/ossimImageStatisticsSource.cpp b/ossim/src/ossim/imaging/ossimImageStatisticsSource.cpp
deleted file mode 100644
index c5da468..0000000
--- a/ossim/src/ossim/imaging/ossimImageStatisticsSource.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-#include <ossim/imaging/ossimImageStatisticsSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-
-ossimImageStatisticsSource::ossimImageStatisticsSource()
-      :ossimSource(0,
-                   1,
-                   0,
-                   true,
-                   false)
-{
-}
-
-ossimImageStatisticsSource::~ossimImageStatisticsSource()
-{
-   
-}
-
-void ossimImageStatisticsSource::computeStatistics()
-{
-   ossimImageSource* anInterface = PTR_CAST(ossimImageSource,
-                                                     getInput());
-
-   if(anInterface&&isSourceEnabled())
-   {
-      clearStatistics();
-      ossimScalarType outputScalarType = anInterface->getOutputScalarType();
-
-      switch(outputScalarType)
-      {
-         case OSSIM_UCHAR:
-         {
-            computeStatisticsTemplate((ossim_uint8)0);
-            break;
-         }
-         case OSSIM_USHORT16:
-         case OSSIM_USHORT11:
-         {
-            computeStatisticsTemplate((ossim_uint16)0);
-            break;
-         }
-         case OSSIM_SSHORT16:
-         {
-            computeStatisticsTemplate((ossim_sint16)0);
-            break;
-         }
-         case OSSIM_DOUBLE:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            computeStatisticsTemplate((ossim_float64)0);
-            break;
-         }
-         case OSSIM_FLOAT:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            computeStatisticsTemplate((ossim_float32)0);
-            break;
-         }
-		 default :
-		 {
-			 break;
-		 }
-      }
-   }
-}
-
-bool ossimImageStatisticsSource::canConnectMyInputTo(ossim_int32 inputIndex,
-                                                     const ossimConnectableObject* object)const
-{
-   return (PTR_CAST(ossimImageSource, object)&&(inputIndex < 1));
-}
-
-template <class T>
-void ossimImageStatisticsSource::computeStatisticsTemplate(T /* dummyVariable */)
-{
-   ossimRefPtr<ossimImageSourceSequencer> sequencer = new ossimImageSourceSequencer;
-
-   sequencer->connectMyInputTo(getInput());
-   sequencer->setToStartOfSequence();
-   ossim_uint32 bands = sequencer->getNumberOfOutputBands();
-
-   if(bands)
-   {
-      setStatsSize(bands);
-      ossimRefPtr<ossimImageData> dataObject;
-      
-      while( (dataObject=sequencer->getNextTile()).valid() )
-      {
-         ossim_uint32 bandIdx = 0;
-         bands = dataObject->getNumberOfBands();
-         ossimDataObjectStatus status = dataObject->getDataObjectStatus();
-         if((status != OSSIM_EMPTY)&&
-            (dataObject->getBuf()))
-         {
-            ossim_uint32 offsetMax = dataObject->getWidth()*dataObject->getHeight();
-            for(bandIdx = 0; bandIdx < bands; ++bandIdx)
-            {
-               ossim_float64 pixelCount = 0.0;
-               ossim_uint32 offset = 0;
-               T* dataPtr   = static_cast<T*>(dataObject->getBuf(bandIdx));
-               T nullPixel = static_cast<T>(dataObject->getNullPix(bandIdx)); 
-               for(offset = 0; offset < offsetMax; ++offset)
-               {
-                  if((*dataPtr) != nullPixel)
-                  {
-                     theMean[bandIdx] += *dataPtr;
-                     if((*dataPtr) < theMin[bandIdx])
-                     {
-                        theMin[bandIdx] = (*dataPtr);
-                     }
-                     if((*dataPtr) > theMax[bandIdx])
-                     {
-                        theMax[bandIdx] = (*dataPtr);
-                     }
-                     ++pixelCount;
-                  }
-                  ++dataPtr;
-               }
-               if(pixelCount > 0)
-               {
-                  theMean[bandIdx] /= pixelCount;
-               }
-            }
-         }
-      }
-   }
-   
-   sequencer->disconnect();
-   sequencer = 0;
-}
-
-const std::vector<ossim_float64>& ossimImageStatisticsSource::getMean()const
-{
-   return theMean;
-}
-
-const std::vector<ossim_float64>& ossimImageStatisticsSource::getMin()const
-{
-   return theMin;
-}
-
-const std::vector<ossim_float64>& ossimImageStatisticsSource::getMax()const
-{
-   return theMax;
-}
-
-void ossimImageStatisticsSource::clearStatistics()
-{
-   theMean.clear();
-   theMin.clear();
-   theMax.clear();
-}
-
-void ossimImageStatisticsSource::setStatsSize(ossim_uint32 size)
-{
-   theMean.resize(size);
-   theMin.resize(size);
-   theMax.resize(size);
-
-   std::fill(theMean.begin(),
-             theMean.end(),
-             (ossim_float64)0.0);
-   std::fill(theMin.begin(),
-             theMin.end(),
-             OSSIM_DEFAULT_MAX_PIX_DOUBLE);
-   std::fill(theMax.begin(),
-             theMax.end(),
-             (ossim_float64)OSSIM_DEFAULT_MIN_PIX_DOUBLE);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageToPlaneNormalFilter.cpp b/ossim/src/ossim/imaging/ossimImageToPlaneNormalFilter.cpp
deleted file mode 100644
index 9be3fc5..0000000
--- a/ossim/src/ossim/imaging/ossimImageToPlaneNormalFilter.cpp
+++ /dev/null
@@ -1,489 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimImageToPlaneNormalFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-
-static const char* SMOOTHNESS_FACTOR_KW="smoothness_factor";
-
-RTTI_DEF1(ossimImageToPlaneNormalFilter, "ossimImageToPlaneNormalFilter", ossimImageSourceFilter);
-
-ossimImageToPlaneNormalFilter::ossimImageToPlaneNormalFilter()
-   :ossimImageSourceFilter(),
-    theTile(NULL),
-    theBlankTile(NULL),
-    theTrackScaleFlag(true),
-    theXScale(1.0),
-    theYScale(1.0),
-    theSmoothnessFactor(1.0)
-{
-}
-
-ossimImageToPlaneNormalFilter::ossimImageToPlaneNormalFilter(ossimImageSource* inputSource)
-   :ossimImageSourceFilter(inputSource),
-    theTile(NULL),
-    theBlankTile(NULL),
-    theTrackScaleFlag(true),
-    theXScale(1.0),
-    theYScale(1.0),
-    theSmoothnessFactor(1.0)
-{
-}
-
-ossimRefPtr<ossimImageData> ossimImageToPlaneNormalFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!isSourceEnabled()||!theInputConnection)
-   {
-      return ossimImageSourceFilter::getTile(tileRect, resLevel);
-   }
-
-   if(!theTile.valid())
-   {
-      initialize();
-   }
-
-   if(!theTile.valid())
-   {
-      return ossimImageSourceFilter::getTile(tileRect, resLevel);
-   }
-
-   theTile->setImageRectangle(tileRect);
-
-   ossimIrect requestRect(tileRect.ul().x - 1,
-                          tileRect.ul().y - 1,
-                          tileRect.lr().x + 1,
-                          tileRect.lr().y + 1);
-
-   ossimRefPtr<ossimImageData> input =
-      theInputConnection->getTile(requestRect, resLevel);
-
-   if(!input||(input->getDataObjectStatus()==OSSIM_EMPTY)||!input->getBuf())
-   {
-      if(tileRect.completely_within(theInputBounds))
-      {
-         initializeTile();
-         theTile->validate();
-         return theTile.get();
-      }
-      theBlankTile->setImageRectangle(tileRect);
-      return theBlankTile;
-   }
-
-   double oldScaleX = theXScale;
-   double oldScaleY = theYScale;
-
-   if(resLevel > 0)
-   {
-      ossimDpt scaleFactor;
-      theInputConnection->getDecimationFactor(resLevel, scaleFactor);
-
-      if(!scaleFactor.hasNans())
-      {
-         theXScale *= scaleFactor.x;
-         theYScale *= scaleFactor.y;
-      }
-   }
-
-   computeNormals(input, theTile);
-
-   theXScale = oldScaleX;
-   theYScale = oldScaleY;
-
-   theTile->validate();
-
-   return theTile;
-}
-
-void ossimImageToPlaneNormalFilter::initializeTile()
-{
-   double* x = static_cast<double*>(theTile->getBuf(0));
-   double* y = static_cast<double*>(theTile->getBuf(1));
-   double* z = static_cast<double*>(theTile->getBuf(2));
-   
-   if(x) std::fill(x, x+theTile->getSizePerBand(), 0.0);
-   if(y) std::fill(y, y+theTile->getSizePerBand(), 0.0);
-   if(z) std::fill(z, z+theTile->getSizePerBand(), 1.0);
-}
-
-void ossimImageToPlaneNormalFilter::initialize()
-{
-   if(theInputConnection)
-   {
-      theInputConnection->initialize();
-      
-      theInputBounds = theInputConnection->getBoundingRect();
-      theTile      = ossimImageDataFactory::instance()->create(this, this);
-      theBlankTile = (ossimImageData*)(theTile->dup());
-      theTile->initialize();
-
-      if(theTrackScaleFlag)
-      {
-         ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();
-         if( geom.valid() )
-         {
-            ossimDpt pt = geom->getMetersPerPixel();
-            if(!pt.hasNans())
-            {
-               theXScale = 1.0/pt.x;
-               theYScale = 1.0/pt.y;
-            }
-         }
-      }
-   }
-}
-
-void ossimImageToPlaneNormalFilter::computeNormals(
-   ossimRefPtr<ossimImageData>& inputTile,
-   ossimRefPtr<ossimImageData>& outputTile)
-{
-   switch(inputTile->getScalarType())
-   {
-      case OSSIM_SSHORT16:
-      {
-         computeNormalsTemplate((ossim_sint16)0,
-                                inputTile,
-                                outputTile);
-         break;
-      }
-      case OSSIM_UCHAR:
-      {
-         computeNormalsTemplate((ossim_uint8)0,
-                                inputTile,
-                                outputTile);
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_USHORT16:
-      {
-         computeNormalsTemplate((ossim_uint16)0,
-                                inputTile,
-                                outputTile);
-         break;
-      }
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_DOUBLE:
-      {
-         computeNormalsTemplate((ossim_float64)0,
-                                inputTile,
-                                outputTile);
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT:
-      {
-         computeNormalsTemplate((ossim_float32)0,
-                                inputTile,
-                                outputTile);
-         break;
-      }
-      default:
-         break;
-   }
-}
-
-template <class T> void ossimImageToPlaneNormalFilter::computeNormalsTemplate(
-   T /* inputScalarTypeDummy */,
-   ossimRefPtr<ossimImageData>& inputTile,
-   ossimRefPtr<ossimImageData>& outputTile)
-{
-   T inputNull = (T) inputTile->getNullPix(0);
-   T* inbuf = (T*) inputTile->getBuf();
-   T outputNull = (T) outputTile->getNullPix(0);
-   double* normX = (double*)outputTile->getBuf(0);
-   double* normY = (double*)outputTile->getBuf(1);
-   double* normZ = (double*)outputTile->getBuf(2);
-   ossim_int32 inbuf_width = inputTile->getWidth();
-   ossim_int32 normbuf_width = outputTile->getWidth();
-   ossim_int32 normbuf_height = outputTile->getHeight();
-   ossimColumnVector3d normal;
-   bool valid_component = true;
-   for (ossim_int32 y=0; y<normbuf_height; y++)
-   {
-      // Establish offsets into the image and output normals buffers given row:
-      ossim_uint32 n = y*normbuf_width;
-      ossim_uint32 i = (y+1)*inbuf_width + 1;
-      
-      // Loop to compute the gradient (normal) vector [dh/dx, dh/dy, 1]:
-      for (ossim_int32 x=0; x<normbuf_width; x++)
-      {
-         // Default in case of null inputs is a flat earth:
-         normal[0] = 0;
-         normal[1] = 0;
-         normal[2] = 1.0;
-
-         // Compute the x-direction differential:
-         if (inbuf[i+1] != inputNull)
-         {
-            if (inbuf[i-1] != inputNull)
-               normal[0] = theXScale*theSmoothnessFactor*(inbuf[i+1] - inbuf[i-1]) / 2.0;
-            else if (inbuf[i] != inputNull)
-               normal[0] = theXScale*theSmoothnessFactor*(inbuf[i+1] - inbuf[i]);
-         }
-         else if ((inbuf[i] != inputNull) && (inbuf[i-1] != inputNull))
-         {
-            normal[0] = theXScale*theSmoothnessFactor*(inbuf[i] - inbuf[i-1]);
-         }
-         else
-         {
-            valid_component = false;
-         }
-
-         // Compute the y-direction differential:
-         if (valid_component)
-         {
-            if (inbuf[i+inbuf_width] != inputNull)
-            {
-               if (inbuf[i-inbuf_width] != inputNull)
-                  normal[1] = theYScale*theSmoothnessFactor*(inbuf[i+inbuf_width] - inbuf[i-inbuf_width]) / 2.0;
-               else if (inbuf[i] != inputNull)
-                  normal[1] = theYScale*theSmoothnessFactor*(inbuf[i+inbuf_width] - inbuf[i]);
-            }
-            else if ((inbuf[i] != inputNull) && (inbuf[i-inbuf_width] != inputNull))
-            {
-               normal[1] = theYScale*theSmoothnessFactor*(inbuf[i] - inbuf[i-inbuf_width]);
-            }
-            else
-            {
-               valid_component = false;
-            }
-         }
-
-         // Stuff the normalized gradient vector into the output buffers:
-         if (valid_component)
-         {
-            normal = normal.unit();
-            normX[n] = normal[0];
-            normY[n] = normal[1];
-            normZ[n] = normal[2];
-         }
-         else
-         {
-            normX[n] = outputNull;
-            normY[n] = outputNull;
-            normZ[n] = outputNull;
-         }
-         
-         ++n;
-         ++i;
-         valid_component = true;
-      }
-   }
-}
-
-bool ossimImageToPlaneNormalFilter::loadState(const ossimKeywordlist& kwl,
-                                              const char* prefix)
-{
-   ossimString scaleX     = kwl.find(prefix, ossimKeywordNames::SCALE_PER_PIXEL_X_KW);
-   ossimString scaleY     = kwl.find(prefix, ossimKeywordNames::SCALE_PER_PIXEL_Y_KW);
-   ossimString trackFlag  = kwl.find(prefix, "track_scale_flag");
-   ossimString smoothness = kwl.find(prefix, SMOOTHNESS_FACTOR_KW);
-
-   if(scaleX != "")
-   {
-      theXScale = scaleX.toDouble();
-   }
-   if(scaleY != "")
-   {
-      theYScale = scaleY.toDouble();
-   }
-   if(trackFlag != "")
-   {
-      theTrackScaleFlag = trackFlag.toBool();
-   }
-   if(smoothness!="")
-   {
-      theSmoothnessFactor = smoothness.toDouble();
-   }
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-bool ossimImageToPlaneNormalFilter::saveState(ossimKeywordlist& kwl,
-                                              const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_PER_PIXEL_X_KW,
-           theXScale,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_PER_PIXEL_Y_KW,
-           theXScale,
-           true);
-
-   kwl.add(prefix,
-           "track_scale_flag",
-           (ossim_uint32)theTrackScaleFlag,
-           true);
-
-   kwl.add(prefix,
-           SMOOTHNESS_FACTOR_KW,
-           theSmoothnessFactor,
-           true);
-
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-double ossimImageToPlaneNormalFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getMinPixelValue(band);
-   }
-   return -1;
-}
-
-double ossimImageToPlaneNormalFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getMaxPixelValue(band);
-   }
-   return 1.0;
-}
-
-ossimScalarType ossimImageToPlaneNormalFilter::getOutputScalarType() const
-{
-   if(isSourceEnabled())
-   {
-      return OSSIM_DOUBLE;
-   }
-   
-   return ossimImageSourceFilter::getOutputScalarType();
-}
-
-ossim_uint32 ossimImageToPlaneNormalFilter::getNumberOfOutputBands() const
-{
-   if(isSourceEnabled())
-   {
-      return 3;
-   }
-   return ossimImageSourceFilter::getNumberOfOutputBands();
-}
-
-void ossimImageToPlaneNormalFilter::setXScale(const double& scale)
-{
-   theXScale = scale;
-}
-
-double ossimImageToPlaneNormalFilter::getXScale()const
-{
-   return theXScale;
-}
-
-double ossimImageToPlaneNormalFilter::getYScale()const
-{
-   return theYScale;
-}
-
-void ossimImageToPlaneNormalFilter::setYScale(const double& scale)
-{
-   theYScale = scale;
-}
-
-void ossimImageToPlaneNormalFilter::setTrackScaleFlag(bool flag)
-{
-   theTrackScaleFlag = flag;
-}
-
-bool ossimImageToPlaneNormalFilter::getTrackScaleFlag()const
-{
-   return theTrackScaleFlag;
-}
-
-void ossimImageToPlaneNormalFilter::setSmoothnessFactor(double value)
-{
-   theSmoothnessFactor = value;
-}
-
-double ossimImageToPlaneNormalFilter::getSmoothnessFactor()const
-{
-   return theSmoothnessFactor;
-}
-
-void ossimImageToPlaneNormalFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimString name = property->getName();
-   if((name == "smoothnessFactor")||
-      (name == "gain"))
-   {
-      theSmoothnessFactor = property->valueToString().toDouble();
-      initialize();
-   }
-   else if(name == "xscale")
-   {
-      theXScale = property->valueToString().toDouble();
-      initialize();
-   }
-   else if(name == "yscale")
-   {
-      theYScale = property->valueToString().toDouble();
-      initialize();
-   }
-   else if(name == "autoTrackScaleFlag")
-   {
-      theTrackScaleFlag = property->valueToString().toDouble();
-      initialize();
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimImageToPlaneNormalFilter::getProperty(const ossimString& name)const
-{
-   if((name == "smoothnessFactor")||
-      (name == "gain"))
-   {
-      ossimNumericProperty* prop = new ossimNumericProperty("gain", ossimString::toString(theSmoothnessFactor), .0001, 40);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   else if(name == "xscale")
-   {
-      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(theXScale), .0001, 50000);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   else if(name == "yscale")
-   {
-      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(theYScale), .0001, 50000);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   else if(name == "autoTrackScaleFlag")
-   {
-      ossimBooleanProperty* prop = new ossimBooleanProperty(name, theTrackScaleFlag);
-      prop->setCacheRefreshBit();
-      return prop;
-   }
-   
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimImageToPlaneNormalFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("gain");
-   propertyNames.push_back("xscale");
-   propertyNames.push_back("yscale");
-   propertyNames.push_back("autoTrackScaleFlag");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageWriterFactory.cpp b/ossim/src/ossim/imaging/ossimImageWriterFactory.cpp
deleted file mode 100644
index 715fc88..0000000
--- a/ossim/src/ossim/imaging/ossimImageWriterFactory.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-// $Id: ossimImageWriterFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageWriterFactory.h>
-#include <ossim/base/ossimImageTypeLut.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/imaging/ossimGeneralRasterWriter.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimJpegWriter.h>
-#include <ossim/imaging/ossimNitfWriter.h>
-#include <ossim/imaging/ossimNitf20Writer.h>
-#include <ossim/imaging/ossimPdfWriter.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-
-ossimImageWriterFactory* ossimImageWriterFactory::theInstance = (ossimImageWriterFactory*)NULL;
-
-
-ossimImageWriterFactory* ossimImageWriterFactory::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimImageWriterFactory;
-      ossimImageWriterFactoryRegistry::instance()->registerFactory(theInstance);
-   }
-
-   return theInstance;
-}
-
-ossimImageWriterFactory::~ossimImageWriterFactory()
-{
-   theInstance = (ossimImageWriterFactory*)NULL;
-}
-
-ossimImageFileWriter *ossimImageWriterFactory::createWriterFromExtension(
-   const ossimString& fileExtension)const
-{
-   ossimImageFileWriter* result = 0;
-
-   ossimString ext = fileExtension;
-   ext.downcase();
-   
-   if( (ext == "tif")|| (ext == "tiff") )
-   {
-      result = new ossimTiffWriter;
-   }
-   else if( (ext == "jpg")|| (ext == "jpeg") )
-   {
-      result = new ossimJpegWriter;
-   }
-   else if( (ext == "ras") || (ext == "bsq") )
-   {
-      // Default is OSSIM_GENERAL_RASTER_BSQ
-      result = new ossimGeneralRasterWriter;
-   }
-   else if(ext == "bil")
-   {
-      result = new ossimGeneralRasterWriter;
-      result->setOutputImageType(OSSIM_GENERAL_RASTER_BIL);
-   }
-   else if(ext == "bip")
-   {
-      result = new ossimGeneralRasterWriter;
-      result->setOutputImageType(OSSIM_GENERAL_RASTER_BIP);
-   }
-   else if((ext == "ntf")||
-           (ext == "nitf"))
-   {
-      result = new ossimNitfWriter;
-   }
-   else if( ext == "pdf" )
-   {
-      result = new ossimPdfWriter;
-   }
-   
-   return result;
-}
-
-ossimImageFileWriter*
-ossimImageWriterFactory::createWriter(const ossimKeywordlist& kwl,
-                                      const char *prefix)const
-{
-   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   ossimImageFileWriter* result = (ossimImageFileWriter*)NULL;
-   
-   if(type != "")
-   {
-      result = createWriter(type);
-      if (result)
-      {
-         if (result->hasImageType(type))
-         {
-            ossimKeywordlist kwl2(kwl);
-            kwl2.add(prefix,
-                     ossimKeywordNames::IMAGE_TYPE_KW,
-                     type,
-                     true);
-         
-            result->loadState(kwl2, prefix);
-         }
-         else
-         {
-            result->loadState(kwl, prefix);
-         }
-      }
-   }
-
-   return result;
-}
-
-ossimImageFileWriter*
-ossimImageWriterFactory::createWriter(const ossimString& typeName)const
-{
-   ossimString mimeType = typeName;
-   mimeType = mimeType.downcase();
-	
-   // Check for tiff writer.
-   ossimRefPtr<ossimImageFileWriter> writer = createFromMimeType(mimeType);
-	
-   if(writer.valid())
-   {
-      return writer.release();
-   }
- 
-   writer = new ossimTiffWriter;
-   
-   if (STATIC_TYPE_NAME(ossimTiffWriter) == typeName )
-   {
-      return writer.release();
-   }
-   else
-   {
-      // See if the type name is supported by the writer.
-      if ( writer->hasImageType(typeName) )
-      {
-         writer->setOutputImageType(typeName);
-         return writer.release();
-      }
-   }
-
-   // Check for jpeg writer.
-   writer = new ossimJpegWriter;
-   if ( writer->getClassName() == typeName )
-   {
-      return writer.release();
-   }
-   else
-   {
-      // See if the type name is supported by the writer.
-      if ( writer->hasImageType(typeName) )
-      {
-         writer->setOutputImageType(typeName);
-         return writer.release();
-      }
-   }
-	
-   // Check for general raster writer.
-   writer = new ossimGeneralRasterWriter;
-   if ( writer->getClassName() == typeName )
-   {
-      return writer.release();
-   }
-   else
-   {
-      // See if the type name is supported by the writer.
-      if ( writer->hasImageType(typeName) )
-      {
-         writer->setOutputImageType(typeName);
-         return writer.release();
-      }
-   }
-
-   // Check for nitf writer.
-   writer = new ossimNitfWriter;
-   if ( writer->getClassName() == typeName )
-   {
-      return writer.release();
-   }
-   else
-   {
-      // See if the type name is supported by the writer.
-      if ( writer->hasImageType(typeName) )
-      {
-         writer->setOutputImageType(typeName);
-         return writer.release();
-      }
-   }
-
-   // Check for nitf writer.
-   writer = new ossimNitf20Writer;
-   if ( writer->getClassName() == typeName )
-   {
-      return writer.release();
-   }
-   else
-   {
-      // See if the type name is supported by the writer.
-      if ( writer->hasImageType(typeName) )
-      {
-         writer->setOutputImageType(typeName);
-         return writer.release();
-      }
-   }
-
-   // Check for pdf writer.
-   writer = new ossimPdfWriter;
-   if ( writer->getClassName() == typeName )
-   {
-      return writer.release();
-   }
-   else
-   {
-      // See if the type name is supported by the writer.
-      if ( writer->hasImageType(typeName) )
-      {
-         writer->setOutputImageType(typeName);
-         return writer.release();
-      }
-   }
-   
-   writer = 0; // Not a nitf writer.   
-
-   return writer.release(); // Return a null writer.
-}
-
-ossimImageFileWriter* ossimImageWriterFactory::createFromMimeType(
-   const ossimString& mimeType)const
-{
-   if((mimeType == "image/jpeg")||
-      (mimeType == "image/jpg"))
-   {
-      ossimJpegWriter* writer = new ossimJpegWriter;
-      writer->setOutputImageType("jpeg");
-      return writer;
-   }
-   else if((mimeType == "image/tiff")||
-           (mimeType == "image/tif")||
-           (mimeType == "image/gtif")||
-           (mimeType == "image/gtiff"))
-   {
-      ossimTiffWriter* writer = new ossimTiffWriter;
-      writer->setOutputImageType("tiff_tiled_band_separate");
-      return writer;
-   }
-   else if((mimeType == "image/nitf") ||
-           (mimeType == "image/ntf"))
-   {
-      ossimNitfWriter* writer = new ossimNitfWriter;
-      writer->setOutputImageType("nitf_block_band_separate");
-      return writer;
-   }
-   else if((mimeType == "image/ras"))
-   {
-      ossimGeneralRasterWriter* writer = new ossimGeneralRasterWriter;
-      writer->setOutputImageType("general_raster_bsq");
-      return writer;
-   }
-   else if((mimeType == "application/pdf")||
-           (mimeType == "image/pdf"))
-   {
-      ossimPdfWriter* writer = new ossimPdfWriter;
-      writer->setOutputImageType("ossim_pdf");
-      return writer;
-   }
-   return 0;
-}
-
-ossimObject* ossimImageWriterFactory::createObject(const ossimKeywordlist& kwl,
-                                                   const char *prefix)const
-{
-   return createWriter(kwl, prefix);
-}
-
-ossimObject* ossimImageWriterFactory::createObject(const ossimString& typeName)const
-{
-   return createWriter(typeName);
-}
-
-
-void ossimImageWriterFactory::getExtensions(std::vector<ossimString>& result)const
-{
-   result.push_back("ras");
-   result.push_back("bsq");
-   result.push_back("bil");
-   result.push_back("bip");
-   result.push_back("tif");
-   result.push_back("jpg");
-   result.push_back("ntf");
-   result.push_back("pdf");
-}
-
-void ossimImageWriterFactory::getTypeNameList(std::vector<ossimString>& typeList)const
-{
-   typeList.push_back(STATIC_TYPE_NAME(ossimTiffWriter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimJpegWriter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterWriter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimNitfWriter));
-   typeList.push_back(STATIC_TYPE_NAME(ossimNitf20Writer));
-   typeList.push_back(STATIC_TYPE_NAME(ossimPdfWriter));   
-}
-
-void ossimImageWriterFactory::getImageFileWritersBySuffix(
-   ossimImageWriterFactoryBase::ImageFileWriterList& result, const ossimString& ext)const
-{
-   ossimString testExt = ext.downcase();
-   if(testExt == "tiff" || testExt == "tif")
-   {
-      result.push_back(new ossimTiffWriter);
-   }
-   else if(testExt == "ntf" || testExt == "nitf")
-   {
-      result.push_back(new ossimNitfWriter);
-   }
-   else if(testExt == "jpg" || testExt == "jpeg")
-   {
-      result.push_back(new ossimJpegWriter);
-   }
-   else if(testExt == "ras" || testExt == "bsq" || testExt == "bil" || testExt == "bip")
-   {
-      result.push_back(new ossimGeneralRasterWriter);
-   }
-   else if( testExt == "pdf" )
-   {
-      result.push_back( new ossimPdfWriter );
-   }
-}
-
-void ossimImageWriterFactory::getImageFileWritersByMimeType(
-   ossimImageWriterFactoryBase::ImageFileWriterList& result, const ossimString& mimeType ) const
-{
-   ossimString testExt = mimeType.downcase();
-   testExt = ossimString(testExt.begin()+6, testExt.end());
-   
-   getImageFileWritersBySuffix(result, testExt);
-}
-
-void ossimImageWriterFactory::getImageTypeList( std::vector<ossimString>& imageTypeList ) const
-{
-   // Add the tiff writer types.
-   ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter;
-   writer->getImageTypeList(imageTypeList);
-
-   // Add the jpeg writer types.
-   writer = new ossimJpegWriter;
-   writer->getImageTypeList(imageTypeList);
-
-   // Add the general raster writer types.
-   writer = new ossimGeneralRasterWriter;
-   writer->getImageTypeList(imageTypeList);
-
-   // Add the nitf writer types.
-   writer = new ossimNitfWriter;
-   writer->getImageTypeList(imageTypeList);
-   
-   // Add the nitf writer types.
-   writer = new ossimNitf20Writer;
-   writer->getImageTypeList(imageTypeList);
-   
-   // Add the pdf writer types.
-   writer = new ossimPdfWriter;
-   writer->getImageTypeList(imageTypeList);
-   
-   writer = 0;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimImageWriterFactoryRegistry.cpp b/ossim/src/ossim/imaging/ossimImageWriterFactoryRegistry.cpp
deleted file mode 100644
index 8d2dc42..0000000
--- a/ossim/src/ossim/imaging/ossimImageWriterFactoryRegistry.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Frank Warmerdam (warmerda at home.com)
-//
-//*******************************************************************
-//  $Id: ossimImageWriterFactoryRegistry.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimImageWriterFactory.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimString.h>
-#include <algorithm>
-#include <iterator>
-#include <ostream>
-
-//ossimImageWriterFactoryRegistry* ossimImageWriterFactoryRegistry::theInstance = NULL;
-
-ossimImageWriterFactoryRegistry::ossimImageWriterFactoryRegistry()
-{
-}
-
-ossimImageWriterFactoryRegistry* ossimImageWriterFactoryRegistry::instance()
-{
-   static ossimImageWriterFactoryRegistry inst;
-   static bool initInst = false;
-   if(!initInst)
-   {
-      ossimObjectFactoryRegistry::instance()->registerFactory(&inst);
-      ossimImageWriterFactory::instance();
-      initInst = true;
-   }
-
-   return &inst;
-//   if(!theInstance)
-//   {
-//      theInstance = new ossimImageWriterFactoryRegistry;
-//   }
-
-//   return theInstance;
-}
-
-
-ossimImageFileWriter* ossimImageWriterFactoryRegistry::createWriter(const ossimFilename& filename)const
-{
-   ossimImageFileWriter * writer = createWriterFromExtension(filename.ext().downcase());
-   if(writer)
-   {
-      writer->setFilename(filename);
-   }
-   
-   return writer;
-}
-
-ossimObject* ossimImageWriterFactoryRegistry::createObject(const ossimKeywordlist &kwl,
-                                                           const char *prefix)const
-{
-   return createObjectFromRegistry(kwl, prefix);
-}
-
-ossimObject* ossimImageWriterFactoryRegistry::createObject(const ossimString& typeName)const
-{
-   return createObjectFromRegistry(typeName);
-}
-
-void ossimImageWriterFactoryRegistry::getTypeNameList(std::vector<ossimString>& typeList)const
-{
-   getAllTypeNamesFromRegistry(typeList);
-}
-
-ossimImageFileWriter *ossimImageWriterFactoryRegistry::createWriterFromExtension(const ossimString& fileExtension)const
-{
-   ossimImageFileWriter *writer = NULL;
-   ossimImageWriterFactoryBase::ImageFileWriterList result;
-   getImageFileWritersBySuffix(result, fileExtension);
-   if(!result.empty())
-   {
-      writer = result[0].release();
-      result.clear();
-   }
-   return writer;
-}
-
-ossimImageFileWriter *ossimImageWriterFactoryRegistry::createWriter(const ossimKeywordlist &kwl,
-                                                                const char *prefix)const
-{
-   // let's see if we ned to return an object based on extension.
-   // this is specified by the type to be a generic
-   // ossimImageFileWriter
-   //
-   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-
-   if(type == "ossimImageFileWriter")
-   {
-      ossimFilename filename = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-
-      if((filename != "")&&
-         (filename.ext() != ""))
-      {
-         ossimImageFileWriter* writer = createWriterFromExtension(filename.ext());
-
-         if(writer)
-         {
-            writer->setFilename(filename);
-         }
-         return writer;
-      }
-   }
-   
-   vector<ossimImageWriterFactoryBase*>::const_iterator factories;
-   ossimImageFileWriter *result = NULL;
-
-   factories = m_factoryList.begin();
-   while(factories != m_factoryList.end())
-   {
-      result = (*factories)->createWriter(kwl, prefix);
-      if(result)
-      {
-         return result;
-      }
-      ++factories;
-   }
-
-   return result;
-}
-
-ossimImageFileWriter *ossimImageWriterFactoryRegistry::createWriter(const ossimString& typeName)const
-{
-   vector<ossimImageWriterFactoryBase*>::const_iterator factories;
-   ossimImageFileWriter *result = NULL;
-
-   factories = m_factoryList.begin();
-   while(factories != m_factoryList.end())
-   {
-      result = (*factories)->createWriter(typeName);
-      if(result)
-      {
-         return result;
-      }
-      ++factories;
-   }
-
-   return result;
-}
-
-
-void ossimImageWriterFactoryRegistry::getImageTypeList(std::vector<ossimString>& typeList)const
-{
-   vector<ossimString> result;
-   vector<ossimImageWriterFactoryBase*>::const_iterator iter = m_factoryList.begin();
-   
-   while(iter != m_factoryList.end())
-   {
-      result.clear();
-      (*iter)->getImageTypeList(result);
-      
-      // now append to the end of the typeList.
-      typeList.insert(typeList.end(),
-                      result.begin(),
-                      result.end());
-      ++iter;
-   }  
-}
-
-void ossimImageWriterFactoryRegistry::getImageFileWritersBySuffix(ossimImageWriterFactoryBase::ImageFileWriterList& result,
-                                                                  const ossimString& ext)const
-{
-   ossimImageWriterFactoryBase::ImageFileWriterList tempResult;
-   vector<ossimImageWriterFactoryBase*>::const_iterator iter = m_factoryList.begin();
-   
-   while(iter != m_factoryList.end())
-   {
-      result.clear();
-      (*iter)->getImageFileWritersBySuffix(tempResult, ext);
-      
-      // now append to the end of the typeList.
-      result.insert(result.end(),
-                      tempResult.begin(),
-                      tempResult.end());
-      ++iter;
-   }  
-   
-}
-
-void ossimImageWriterFactoryRegistry::getImageFileWritersByMimeType(ossimImageWriterFactoryBase::ImageFileWriterList& result,
-                                                                    const ossimString& mimeType)const
-{
-   ossimImageWriterFactoryBase::ImageFileWriterList tempResult;
-   vector<ossimImageWriterFactoryBase*>::const_iterator iter = m_factoryList.begin();
-   
-   while(iter != m_factoryList.end())
-   {
-      result.clear();
-      (*iter)->getImageFileWritersByMimeType(tempResult, mimeType);
-      
-      // now append to the end of the typeList.
-      result.insert(result.end(),
-                    tempResult.begin(),
-                    tempResult.end());
-      ++iter;
-   }  
-}
-
-std::ostream& ossimImageWriterFactoryRegistry::printImageTypeList(
-   std::ostream& out)const
-{
-   std::vector<ossimString> outputType;
-   
-   this->getImageTypeList(outputType);
-   std::copy(outputType.begin(),
-             outputType.end(),
-             std::ostream_iterator<ossimString>(out, "\n"));
-   out << std::endl;
-   return out;
-}
-
-std::ostream& ossimImageWriterFactoryRegistry::printWriterProps(std::ostream& out)const
-{
-   // Loop through factories:
-   vector<ossimImageWriterFactoryBase*>::const_iterator factoryIter = m_factoryList.begin();
-   while( factoryIter != m_factoryList.end() )
-   {
-      out << "factory: " << (*factoryIter)->getClassName() << "\n\n";
-
-      // Loop through writer classes in factory.
-      std::vector<ossimString> typeNames;
-      (*factoryIter)->getTypeNameList(typeNames);
-      std::vector<ossimString>::const_iterator typeNamesIter = typeNames.begin();
-      while (typeNamesIter != typeNames.end())
-      {
-         ossimRefPtr<ossimImageFileWriter> writer = (*factoryIter)->createWriter(*typeNamesIter);
-         if ( writer.valid() )
-         {
-            out << "writer:\n" << writer->getClassName() << "\n";
-
-            // Loop through writer types, e.g. tiff_tiled_band_separate
-            std::vector<ossimString> imageTypeList;
-            writer->getImageTypeList(imageTypeList);
-            std::vector<ossimString>::const_iterator imageTypeListIter = imageTypeList.begin();
-            out << "\ntypes:\n";
-            while ( imageTypeListIter != imageTypeList.end() )
-            {
-               out << (*imageTypeListIter) << "\n";
-               ++imageTypeListIter;
-            }
-
-            // Loop through writer properties, e.g. compression_quality.
-            out << "\nproperties:\n";
-            std::vector<ossimString> propNames;
-            writer->getPropertyNames(propNames);
-            std::vector<ossimString>::const_iterator propNamesIter = propNames.begin();
-            while ( propNamesIter != propNames.end() )
-            {
-               out << (*propNamesIter) << "\n";
-               
-               ++propNamesIter;
-            }
-            out << "\n";
-         }
-
-         ++typeNamesIter;
-      }
-      
-      ++factoryIter;
-   }
-   return out;
-}
-
-extern "C"
-{
-  void* ossimImageWriterFactoryRegistryGetInstance()
-  {
-    return ossimImageWriterFactoryRegistry::instance();
-  }
-}
-
-ossimImageWriterFactoryRegistry::ossimImageWriterFactoryRegistry(const ossimImageWriterFactoryRegistry&)
-   :
-      ossimObjectFactory()
-{
-}
-
-void ossimImageWriterFactoryRegistry::operator=(const ossimImageWriterFactoryRegistry&)
-{
-}
-
diff --git a/ossim/src/ossim/imaging/ossimIndexToRgbLutFilter.cpp b/ossim/src/ossim/imaging/ossimIndexToRgbLutFilter.cpp
deleted file mode 100644
index d81b2a3..0000000
--- a/ossim/src/ossim/imaging/ossimIndexToRgbLutFilter.cpp
+++ /dev/null
@@ -1,514 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Oscar Kramer
-//
-//*************************************************************************
-// $Id: ossimIndexToRgbLutFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimFilenameProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-
-static const ossimTrace traceDebug("ossimIndexToRgbLutFilter:debug");
-
-RTTI_DEF1(ossimIndexToRgbLutFilter, "ossimIndexToRgbLutFilter", ossimImageSourceFilter);
-
-static const char* MIN_VALUE_KW = "min_value";
-static const char* MAX_VALUE_KW = "max_value";
-static const char* MODE_KW = "mode";
-static const char* LUT_FILE_KW = "lut_file";
-
-ossimIndexToRgbLutFilter::ossimIndexToRgbLutFilter()
-:ossimImageSourceFilter(),
- theMinValue(ossim::nan()),
- theMaxValue(ossim::nan()),
- theMinValueOverride(false),
- theMaxValueOverride(false),
- theMode(REGULAR),
- theTile(0),
- theLutFile("")
-{
-   setDescription("Look-up-table remapper from single-band index image to 24-bit RGB.");
-}
-
-ossimIndexToRgbLutFilter::~ossimIndexToRgbLutFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimIndexToRgbLutFilter::getTile(const ossimIrect& tileRect,
-                                                              ossim_uint32 resLevel)
-{
-   if(!theInputConnection || (theLut.size() == 0))
-      return 0;
-
-   ossimRefPtr<ossimImageData> tile = theInputConnection->getTile(tileRect, resLevel);
-   if (!tile || !tile->getBuf())
-      return 0;
-   if(!theTile)
-   {
-      allocate();
-      if (!theTile)
-         return 0;
-   }
-
-   theTile->setImageRectangle(tileRect);
-   theTile->makeBlank();
-
-   // Quick handling special case of empty input tile:
-   if (tile->getDataObjectStatus() == OSSIM_EMPTY)
-      return theTile;
-
-   ossim_uint8* outBuf[3];
-   outBuf[0] = (ossim_uint8*)(theTile->getBuf(0));
-   outBuf[1] = (ossim_uint8*)(theTile->getBuf(1));
-   outBuf[2] = (ossim_uint8*)(theTile->getBuf(2));
-
-   ossim_uint32 maxLength = tile->getWidth()*tile->getHeight();
-   ossimRgbVector color;
-   const ossimRgbVector null_color (theTile->getNullPix(0), theTile->getNullPix(1), theTile->getNullPix(2));
-   double index;
-   std::map<double, ossimRgbVector>::const_iterator lut_entry;
-   double null_index = theInputConnection->getNullPixelValue();
-
-   for (ossim_uint32 pixel=0; pixel<maxLength; ++pixel)
-   {
-      // Convert input pixel to a double index value:
-      switch(tile->getScalarType())
-      {
-      case OSSIM_DOUBLE:
-         index = ((double*) tile->getBuf())[pixel];
-         break;
-      case OSSIM_SSHORT16:
-         index = (double)(((ossim_sint16*) tile->getBuf())[pixel]);
-         break;
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-         index = (double)(((float*) tile->getBuf())[pixel]);
-         break;
-      case OSSIM_UCHAR:
-         index = (double)(((ossim_uint8*) tile->getBuf())[pixel]);
-         break;
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-         index = (double)(((ossim_uint16*) tile->getBuf())[pixel]);
-         break;
-      default:
-         break;
-      }
-
-      // Do not remap null pixels, leave the output pixel "blank" which is null-pixel value:
-      if (index == null_index)
-         continue;
-
-      // REGULAR mode needs to clamp the indices to min max for non-null pixels:
-      if (theMode == REGULAR)
-      {
-         if (index < theMinValue)
-            index = theMinValue;
-         else if (index > theMaxValue)
-            index = theMaxValue;
-      }
-
-      // Now perform look-up depending on mode:
-      if (theMode == LITERAL)
-      {
-         lut_entry = theLut.find(index);
-         if (lut_entry == theLut.end())
-            color = null_color;
-         else
-            color = lut_entry->second;
-      }
-      else
-      {
-         // Vertices and Regular mode perform same interpolation here between the line segments
-         // vertices:
-         lut_entry = theLut.find(index);
-         if (lut_entry != theLut.end())
-         {
-            // Got exact match, no interpolation needed:
-            color = lut_entry->second;
-         }
-         else
-         {
-            lut_entry = theLut.upper_bound(index);
-            if ((lut_entry == theLut.end()) || (lut_entry == theLut.begin()))
-               color = null_color;
-            else
-            {
-               // Need to linearly interpolate:
-               double index_hi = lut_entry->first;
-               ossimRgbVector color_hi (lut_entry->second);
-               --lut_entry;
-               double index_lo = lut_entry->first;
-               ossimRgbVector color_lo (lut_entry->second);
-               double w_lo = (index_hi - index)/(index_hi - index_lo);
-               double w_hi = 1.0 - w_lo;
-               color.setR(ossim::round<ossim_uint8, double>( color_hi.getR()*w_hi + color_lo.getR()*w_lo ));
-               color.setG(ossim::round<ossim_uint8, double>( color_hi.getG()*w_hi + color_lo.getG()*w_lo ));
-               color.setB(ossim::round<ossim_uint8, double>( color_hi.getB()*w_hi + color_lo.getB()*w_lo ));
-            }
-         }
-      }
-
-      // Assign this output pixel:
-      outBuf[0][pixel]  = color.getR();
-      outBuf[1][pixel]  = color.getG();
-      outBuf[2][pixel]  = color.getB();
-
-   } // end loop over tile's pixels
-
-   theTile->validate();
-   return theTile;
-}
-
-void ossimIndexToRgbLutFilter::allocate()
-{
-   if(!theInputConnection) return;
-
-   theTile = ossimImageDataFactory::instance()->create(this, 3, this);
-   if(theTile.valid())
-   {
-      theTile->initialize();
-   }
-}
-
-void ossimIndexToRgbLutFilter::initialize()
-{
-   // This assigns theInputConnection if one is there.
-   ossimImageSourceFilter::initialize();
-
-   // theTile will get allocated on first getTile call.
-   theTile = 0;
-
-   if ( theInputConnection )
-   {
-      // Initialize the chain on the left hand side of us.
-      theInputConnection->initialize();
-      if(!theMinValueOverride)
-         theMinValue = theInputConnection->getMinPixelValue(0);
-      if(!theMaxValueOverride)
-         theMaxValue = theInputConnection->getMaxPixelValue(0);
-      if(theMinValue > theMaxValue)
-         swap(theMinValue, theMaxValue);
-   }
-}
-
-void ossimIndexToRgbLutFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(property.valid())
-   {
-      ossimString value = property->valueToString();
-      value = value.trim();
-
-      if(property->getName() == "LUT file")
-      {
-         setLut(ossimFilename(property->valueToString()));
-      }
-      else
-      {
-         ossimImageSourceFilter::setProperty(property);
-      }
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimIndexToRgbLutFilter::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> property = 0;
-   if(name == "LUT file")
-   {
-      ossimFilenameProperty* filenameProperty = new ossimFilenameProperty(name, theLutFile);
-      filenameProperty->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      filenameProperty->clearChangeType();
-      filenameProperty->setCacheRefreshBit();
-      filenameProperty->setReadOnlyFlag(false);
-      property = filenameProperty;
-   }
-   else
-   {
-      property = ossimImageSourceFilter::getProperty(name);
-   }
-   return property;
-}
-
-void ossimIndexToRgbLutFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("LUT file");
-}
-
-bool ossimIndexToRgbLutFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   if (theMinValueOverride)
-      kwl.add(prefix, MIN_VALUE_KW, theMinValue, true);
-
-   if (theMaxValueOverride)
-      kwl.add(prefix, MAX_VALUE_KW, theMaxValue, true);
-
-   ossimString value;
-   switch (theMode)
-   {
-   case LITERAL:
-      value = "literal";
-      break;
-   case VERTICES:
-      value = "vertices";
-      break;
-   default:
-      value = "regular";
-   }
-   kwl.add(prefix, MODE_KW,  value.c_str(), true);
-
-   bool rtn_stat = true;
-
-   // Save the actual LUT:
-   const ossimString entry_kw ("entry");
-   ossimString color_keyword, base_keyword;
-   ossimRgbVector rgbVector;
-   ossimString blank(" ");
-
-   ossim_uint32 entry = 0;
-   std::map<double, ossimRgbVector>::const_iterator iter =  theLut.begin();
-   while (iter != theLut.end())
-   {
-      base_keyword = entry_kw + ossimString::toString(entry);
-      if ((theMode == LITERAL) || (theMode == VERTICES))
-      {
-         // Index and color are sub-entries for these modes:
-         kwl.add(prefix, (base_keyword+".index").chars(), iter->first);
-         color_keyword = base_keyword + ".color";
-      }
-      else
-      {
-         color_keyword = base_keyword;
-      }
-
-      rgbVector = iter->second;
-      value = ossimString::toString((int)rgbVector.getR()) + blank +
-            ossimString::toString((int)rgbVector.getG()) + blank +
-            ossimString::toString((int)rgbVector.getB());
-      kwl.add(prefix, color_keyword.chars(), value.chars());
-      ++iter;
-      ++entry;
-   }
-
-   rtn_stat &= ossimImageSourceFilter::saveState(kwl, prefix);
-   return rtn_stat;
-}
-
-bool ossimIndexToRgbLutFilter::loadState(const ossimKeywordlist& orig_kwl, const char* prefix)
-{
-   bool return_state = true;
-   ossimKeywordlist* kwl = new ossimKeywordlist(orig_kwl); // need non-const copy
-
-   // First look for a LUT filename, and add its contents to the original KWL:
-   theLutFile = kwl->find(prefix, LUT_FILE_KW);
-   if (!theLutFile.empty())
-   {
-      // Need new (non const) KWL to hold merged contents, maintaining proper prefix if any:
-      ossimKeywordlist lut_kwl;
-      if (lut_kwl.addFile(theLutFile))
-         kwl->add(prefix, lut_kwl, false); // appends all entries of lut_kwl with prefix before adding
-   }
-
-   theMinValueOverride = false;
-   ossimString lookup = kwl->find(prefix, MIN_VALUE_KW);
-   if(!lookup.empty())
-   {
-      theMinValue =lookup.toDouble();
-      theMinValueOverride = true;
-   }
-
-   theMaxValueOverride = false;
-   lookup = kwl->find(prefix, MAX_VALUE_KW);
-   if(!lookup.empty())
-   {
-      theMaxValue = lookup.toDouble();
-      theMaxValueOverride = true;
-   }
-
-   lookup =  kwl->find(prefix, MODE_KW);
-   if (lookup.contains("literal"))
-      theMode = LITERAL;
-   else if (lookup.contains("vertices"))
-      theMode = VERTICES;
-   else
-      theMode = REGULAR;
-
-   return_state &= initializeLut(kwl, prefix);
-   return_state &= ossimImageSourceFilter::loadState(orig_kwl, prefix);
-
-   delete kwl;
-   return return_state;
-}
-
-bool ossimIndexToRgbLutFilter::initializeLut(const ossimKeywordlist* kwl, const char* prefix)
-{
-   theLut.clear();
-
-   const ossimString entry_kw ("entry");
-   ossimString keyword, base_keyword;
-   ossimString indexStr, rgbStr;
-   ossimString blank(" ");
-   std::vector<ossimString> rgbList;
-   double index;
-   ossimRgbVector rgbVector (0,0,0);
-   bool rtn_state = true;
-
-   ossim_uint32 numEntries=0;
-   while (true)
-   {
-      base_keyword = entry_kw + ossimString::toString(numEntries);
-      if ((theMode == LITERAL) || (theMode == VERTICES))
-      {
-         // Index and color are subentries for this mode:
-         keyword = base_keyword + ".index";
-         indexStr = kwl->find(prefix, keyword.chars());
-         if (indexStr.empty())
-            break;
-
-         index = indexStr.toDouble();
-         keyword = base_keyword + ".color";
-         rgbStr = kwl->find(prefix, keyword.chars());
-      }
-      else
-      {
-         // REGULAR mode: index is computed later to arrive at equally-spaced vertices. For now,
-         // just store entry number as index:
-         index = (double) numEntries;
-         keyword = base_keyword;
-         rgbStr = kwl->find(prefix, keyword.chars());
-         if (rgbStr.empty())
-         {
-            // Perhaps old bloated form with separate keywords for R, G, B
-            rgbStr = kwl->find(prefix, (keyword + ".r").chars());
-            rgbStr += " ";
-            rgbStr += kwl->find(prefix, (keyword + ".g").chars());
-            rgbStr += " ";
-            rgbStr += kwl->find(prefix, (keyword + ".b").chars());
-            if (rgbStr.length() < 5)
-               break;
-         }
-      }
-
-      rgbStr.split(rgbList, blank, true);
-      if (rgbList.size() != 3)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)<<"ossimIndexToRgbLutFilter::initializeLut() -- "
-               "Bad color specification in LUT KWL. LUT is not properly initialized."<<endl;
-         return false;
-      }
-
-      rgbVector.setR(rgbList[0].toUInt8());
-      rgbVector.setG(rgbList[1].toUInt8());
-      rgbVector.setB(rgbList[2].toUInt8());
-      theLut.insert(std::pair<double, ossimRgbVector>(index, rgbVector));
-      rgbList.clear();
-      ++numEntries;
-   }
-
-   // For REGULAR mode, need to adjust the indices to reflect a piecewise linear LUT with equally
-   // spaced vertices:
-   if (theMode == REGULAR)
-   {
-      std::map<double, ossimRgbVector> orig_lut = theLut;
-      std::map<double, ossimRgbVector>::iterator iter =  orig_lut.begin();
-      theLut.clear();
-
-      if (numEntries == 1)
-      {
-         // Insert the implied start index at black and endpoint at specified color:
-         theLut.insert(std::pair<double, ossimRgbVector>(theMinValue, ossimRgbVector (1, 1, 1)));
-         theLut.insert(std::pair<double, ossimRgbVector>(theMaxValue, iter->second));
-      }
-      else
-      {
-         // Loop to create equally-spaced vertices between min and max index values:
-         double interval = (theMaxValue - theMinValue) / (numEntries - 1);
-         while (iter != orig_lut.end())
-         {
-            index = theMinValue + iter->first*interval;
-            theLut.insert(std::pair<double, ossimRgbVector>(index, iter->second));
-            ++iter;
-         }
-      }
-   }
-
-   return rtn_state;
-}
-
-ossim_uint32 ossimIndexToRgbLutFilter::getNumberOfOutputBands() const
-{
-   if(isSourceEnabled())
-   {
-      return 3;
-   }
-   return ossimImageSourceFilter::getNumberOfOutputBands();
-}
-
-ossimScalarType ossimIndexToRgbLutFilter::getOutputScalarType() const
-{
-   if(isSourceEnabled())
-   {
-      return OSSIM_UCHAR;
-   }
-
-   return ossimImageSourceFilter::getOutputScalarType();
-}
-
-void ossimIndexToRgbLutFilter::setLut(const ossimFilename& file)
-{
-   theLutFile = file;
-   if(file.exists())
-   {
-      ossimKeywordlist kwl(file.c_str());
-      loadState(kwl);
-   }
-}
-
-double ossimIndexToRgbLutFilter::getMinValue()const
-{
-   return theMinValue;
-}
-
-double ossimIndexToRgbLutFilter::getMaxValue()const
-{
-   return theMaxValue;
-}
-
-void ossimIndexToRgbLutFilter::setMinValue(double value)
-{
-   theMinValue = value;
-}
-
-void ossimIndexToRgbLutFilter::setMaxValue(double value)
-{
-   theMaxValue = value;
-}
-
-double ossimIndexToRgbLutFilter::getNullPixelValue(ossim_uint32 /* band */ )const
-{
-   return 0.0;
-}
-
-double ossimIndexToRgbLutFilter::getMinPixelValue(ossim_uint32 /* band */)const
-{
-   return 1.0;
-}
-
-double ossimIndexToRgbLutFilter::getMaxPixelValue(ossim_uint32 /* band */)const
-{
-   return 255.0;
-}
-
-
-
diff --git a/ossim/src/ossim/imaging/ossimIntensityAdjustmentFilter.cpp b/ossim/src/ossim/imaging/ossimIntensityAdjustmentFilter.cpp
deleted file mode 100644
index aceeabb..0000000
--- a/ossim/src/ossim/imaging/ossimIntensityAdjustmentFilter.cpp
+++ /dev/null
@@ -1,289 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-// $Id: ossimIntensityAdjustmentFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimIntensityAdjustmentFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimHsvVector.h>
-#include <ossim/base/ossimRgbVector.h>
-
-RTTI_DEF1(ossimIntensityAdjustmentFilter, "ossimIntensityAdjustmentFilter", ossimImageSourceFilter);
-
-ossimIntensityAdjustmentFilter::ossimIntensityAdjustmentFilter()
-   :ossimImageSourceFilter(),
-    theMeanIntensityTarget(ossim::nan()),
-    theNormTile(NULL),
-    theTile(NULL),
-    theBlankTile(NULL)
-{
-   theGridBounds.makeNan();
-}
-
-ossimIntensityAdjustmentFilter::~ossimIntensityAdjustmentFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimIntensityAdjustmentFilter::getTile(
-   const ossimIrect& rect,
-   ossim_uint32 resLevel)
-{
-   if (!theTile.valid())
-   {
-      allocate(); // first time through.
-   }
-   
-   if(theBlankTile.valid())
-   {
-      theBlankTile->setImageRectangle(rect);
-   }
-   if(!theInputConnection)
-   {
-      return theBlankTile;
-   }
-   ossimRefPtr<ossimImageData> data =
-      theInputConnection->getTile(rect, resLevel);
-   
-   if(!isSourceEnabled())
-   {
-      return data;
-   }
-   theTile->setImageRectangle(rect);
-   theNormTile->setImageRectangle(rect);
-   loadNormTile(data);
-
-   if(ossim::isnan(theMeanIntensityTarget))
-   {
-      theMeanIntensityTarget = theMeanIntensityGrid.meanValue();
-   }
-
-   loadNormTile(data);
-   
-   if((theNormTile->getDataObjectStatus()!=OSSIM_NULL)&&
-      (theNormTile->getDataObjectStatus()!=OSSIM_EMPTY))
-   {
-      float* buf[3];
-      if(data->getNumberOfBands() == 3)
-      {
-         buf[0] = (float*)theNormTile->getBuf(0);
-         buf[1] = (float*)theNormTile->getBuf(1);
-         buf[2] = (float*)theNormTile->getBuf(2);
-      }
-      else
-      {
-         buf[0] = (float*)theNormTile->getBuf(0);
-         buf[1] = (float*)theNormTile->getBuf(0);
-         buf[2] = (float*)theNormTile->getBuf(0);
-         
-      }
-      ossim_int32 y = 0;
-      ossim_int32 x = 0;
-      ossim_int32 upperY = theNormTile->getHeight();
-      ossim_int32 upperX = theNormTile->getWidth();
-      ossimIpt origin = rect.ul();
-      
-      for(y = 0; y < upperY; ++y)
-      {
-         for(x = 0; x < upperX; ++x)
-         {
-            ossimIpt pt = ossimIpt(origin.x + x,
-                                   origin.y + y) - theGridBounds.ul();
-
-            if((buf[0] != 0) &&
-               (buf[1] != 0) &&
-               (buf[2] != 0))
-            {
-               
-               ossimRgbVector rgb((ossim_uint8)(*(buf[0])*255.0),
-                                  (ossim_uint8)(*(buf[1])*255.0),
-                                  (ossim_uint8)(*(buf[2])*255.0));
-               ossimHsvVector hsv(rgb);
-               
-               hsv.setV(matchTargetMean(hsv.getV(),
-                                        theMeanIntensityGrid(pt.x, pt.y),
-                                        theMeanIntensityTarget,
-                                        theNormTile->getMinPix(0),
-                                        theNormTile->getMaxPix(0)));
-               ossimRgbVector result(hsv);
-               
-               *buf[0] = result.getR()/255.0;
-               *buf[1] = result.getG()/255.0;
-               *buf[2] = result.getB()/255.0;
-            }
-            
-            ++buf[0];
-            ++buf[1];
-            ++buf[2];
-         }
-      }
-   }
-   theTile->copyNormalizedBufferToTile((float*)theNormTile->getBuf());
-   theTile->validate();
-   
-   return theTile;
-}
-
-void ossimIntensityAdjustmentFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   theNormTile = NULL;
-   theBlankTile = NULL;
-   
-   if(theInputConnection)
-   {
-      theGridBounds = theInputConnection->getBoundingRect();
-   }
-   else
-   {
-      theGridBounds.makeNan();
-   }
-}
-
-void ossimIntensityAdjustmentFilter::allocate()
-{
-   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile = (ossimImageData*)theBlankTile->dup();
-   theTile->initialize();
-}
-
-void ossimIntensityAdjustmentFilter::createAndPopulateGrid(const ossimIpt& spacing,
-                                                           double targetMean)
-{
-   if(theInputConnection)
-   {
-      ossim_uint32 x = 0;
-      ossim_uint32 y = 0;
-
-      theGridBounds        = theInputConnection->getBoundingRect();
-
-      ossimDrect rect(0,
-                      0,
-                      theGridBounds.width()-1,
-                      theGridBounds.height()-1);
-                      
-      theMeanIntensityGrid = ossimDblGrid(rect,
-                                          ossimDpt(spacing),
-                                          0);
-
-      for(y = 0; y <= theGridBounds.height(); y+=spacing.y)
-      {
-         for(x = 0; x <= theGridBounds.width(); x+=spacing.x)
-         {
-            ossimIpt ul(x - 16,
-                        y - 16);
-            
-            ossimIrect sampleRect(ul.x,
-                                  ul.y,
-                                  ul.x + 31,
-                                  ul.y + 31);
-            ossimRefPtr<ossimImageData> data = theInputConnection->getTile(sampleRect);
-            double mean = computeMeanIntensity(data);
-            theMeanIntensityGrid.setNearestNode(ossimDpt(x, y), mean);
-         }
-      }
-//      theMeanIntensityGrid.interpolateNullValuedNodes();
-   }
-   theMeanIntensityTarget = targetMean;
-}
-
-double ossimIntensityAdjustmentFilter::computeMeanIntensity(
-   ossimRefPtr<ossimImageData>& data)
-{
-   double result  = 0;
-   double divisor = 0;
-
-   if(data.valid() &&
-      (data->getDataObjectStatus()!=OSSIM_NULL)&&
-      (data->getDataObjectStatus()!=OSSIM_EMPTY))
-   {
-      loadNormTile(data);
-
-      int i = 0;
-      int upper = data->getWidth()*data->getHeight();
-      float* buf[3];
-      if(data->getNumberOfBands() == 3)
-      {
-         buf[0] = (float*)theNormTile->getBuf(0);
-         buf[1] = (float*)theNormTile->getBuf(1);
-         buf[2] = (float*)theNormTile->getBuf(2);
-      }
-      else
-      {
-         buf[0] = (float*)theNormTile->getBuf();
-         buf[1] = (float*)theNormTile->getBuf();
-         buf[2] = (float*)theNormTile->getBuf();
-      }
-      for(i = 0; i < upper; ++i)
-      {
-         ossimRgbVector rgb((ossim_uint8)(*(buf[0])*255.0),
-                            (ossim_uint8)(*(buf[1])*255.0),
-                            (ossim_uint8)(*(buf[2])*255.0));
-         ossimHsvVector hsv(rgb);
-         if(hsv.getV() > 0.0)
-         {
-            result += hsv.getV();
-            divisor += 1.0;
-         }
-         ++buf[0];
-         ++buf[1];
-         ++buf[2];
-      }
-   }
-
-   if(divisor > 0.0)
-   {
-      result /= divisor;
-   }
-   return result;
-}
-
-void ossimIntensityAdjustmentFilter::loadNormTile(ossimRefPtr<ossimImageData>& data)
-{
-   if(!theNormTile)
-   {
-      theNormTile = ossimImageDataFactory::instance()->create(this,
-                                                              OSSIM_NORMALIZED_FLOAT,
-                                                              data->getNumberOfBands(),
-                                                              data->getWidth(),
-                                                              data->getHeight());
-      theNormTile->initialize();
-   }
-   else
-   {
-      theNormTile->setImageRectangle(data->getImageRectangle());
-   }
-   data->copyTileToNormalizedBuffer((float*)theNormTile->getBuf());
-   theNormTile->validate();
-}
-
-double ossimIntensityAdjustmentFilter::matchTargetMean(double inputValue,
-                                                       double meanValue,
-                                                       double targetMean,
-                                                       double minValue,
-                                                       double maxValue)
-{
-    // max change
-   const double delta = targetMean - meanValue;
-   double weight=0.0;
-   
-   // weight max change dependend on proximity to end points
-   if (inputValue <= meanValue)
-   {
-      weight = fabs((inputValue - minValue) / (meanValue - minValue));
-   }
-   else
-   {
-      weight = fabs((maxValue - inputValue) / (maxValue - meanValue));
-   }
-
-   return  (inputValue + (delta * weight));
-}
-
diff --git a/ossim/src/ossim/imaging/ossimJpegCodec.cpp b/ossim/src/ossim/imaging/ossimJpegCodec.cpp
deleted file mode 100644
index ce06d8e..0000000
--- a/ossim/src/ossim/imaging/ossimJpegCodec.cpp
+++ /dev/null
@@ -1,510 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: class declaration for base codec(encoder/decoder).
-// 
-//----------------------------------------------------------------------------
-// $Id$
-#include <ossim/imaging/ossimJpegCodec.h>
-
-// we need to get rid of the jpedlib include in this header
-#include <ossim/imaging/ossimJpegMemSrc.h>
-// same for here
-#include <ossim/imaging/ossimJpegMemDest.h>
-
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNumericProperty.h>
-
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <jpeglib.h>                   /** for jpeg stuff */
-
-RTTI_DEF1(ossimJpegCodec, "ossimJpegCodec", ossimCodecBase);
-ossimJpegCodec::ossimJpegCodec()
-:m_quality(100)
-{
-}
-
-ossimJpegCodec::~ossimJpegCodec()
-{
-}
-
-ossimString ossimJpegCodec::getCodecType()const
-{
-	return ossimString("jpeg");
-}
-
-bool ossimJpegCodec::encode( const ossimRefPtr<ossimImageData>& in,
-                             std::vector<ossim_uint8>& out )const
-{
-   bool result = false;
-   if ( in.valid() && (in->getDataObjectStatus() != OSSIM_NULL) )
-   {
-      if ( in->getScalarType() == OSSIM_UINT8 )
-      {
-         // Open a memory stream up to put the jpeg image in memory:
-         std::stringstream jpegStreamBuf;
-         
-         //---
-         // Initialize JPEG compression library:
-         // NOTE: JDIMENSION is an "unsigned int"
-         //---
-         struct jpeg_compress_struct cinfo;
-         struct jpeg_error_mgr jerr;
-         cinfo.err = jpeg_std_error( &jerr );
-         jpeg_create_compress(&cinfo);
-      
-         // Define a custom stream destination manager for jpeglib to write compressed block:
-         jpeg_cpp_stream_dest(&cinfo, jpegStreamBuf);
-      
-         /* Setting the parameters of the output file here */
-         cinfo.image_width = in->getWidth();
-         cinfo.image_height = in->getHeight();
-   
-         // Bands must be one or three for this writer.
-         const ossim_uint32 INPUT_BANDS = in->getNumberOfBands();
-         if ( (INPUT_BANDS == 1) || (INPUT_BANDS == 3) )
-         {
-            cinfo.input_components = INPUT_BANDS;
-         }
-         else
-         {
-            if ( INPUT_BANDS < 3 )
-            {
-               cinfo.input_components = 1; // Use first band.
-            }
-            else
-            {
-               cinfo.input_components = 3; // Use the first 3 bands.
-            }
-         }
-      
-         // colorspace of input image 
-         if ( cinfo.input_components == 3)
-         {
-            cinfo.in_color_space = JCS_RGB;
-         }
-         else
-         {
-            cinfo.in_color_space = JCS_GRAYSCALE;
-         }
-      
-         // Default compression parameters, we shouldn't be worried about these.
-         jpeg_set_defaults( &cinfo );
-      
-         jpeg_set_quality(&cinfo, m_quality, TRUE); //limit to baseline-JPEG values
-      
-         // Now do the compression...
-         jpeg_start_compress( &cinfo, TRUE );
-      
-         // Line buffer:
-         ossim_uint32 buf_size = cinfo.input_components*cinfo.image_width;
-         std::vector<ossim_uint8> buf(buf_size);
-      
-         // Compress the tile on line at a time:
-      
-         JSAMPROW row_pointer[1]; // Pointer to a single row.
-         row_pointer[0] = (JSAMPLE*)&buf.front();
-
-         // Get pointers to the input data:
-         std::vector<const ossim_uint8*> inBuf(cinfo.input_components);
-         for ( ossim_int32 band = 0; band < cinfo.input_components; ++band )
-         {
-            inBuf[band] = in->getUcharBuf(band);
-         }
-
-         ossim_uint32 inIdx = 0;
-         for (ossim_uint32 line=0; line< cinfo.image_height; ++line)
-         {
-            // Convert from band sequential to band interleaved by pixel.
-            ossim_uint32 outIdx = 0;
-            for ( ossim_uint32 p = 0; p < cinfo.image_width; ++p )
-            {
-               for ( ossim_int32 band = 0; band < cinfo.input_components; ++band )
-               {
-                  buf[outIdx++] = inBuf[band][inIdx];
-               }
-               ++inIdx;
-            }
-
-            // Write it...
-            jpeg_write_scanlines( &cinfo, row_pointer, 1 );
-         }
-      
-         // Similar to read file, clean up after we're done compressing.
-         jpeg_finish_compress( &cinfo );
-         jpeg_destroy_compress( &cinfo );
-
-         // Copy the memory stream to output vector.
-         out.resize(jpegStreamBuf.str().size());
-         jpegStreamBuf.seekg(0, std::ios_base::beg);
-         jpegStreamBuf.read((char*)&out.front(), jpegStreamBuf.str().size());
-
-         result = true;
-      }
-      else // Scalar type check...
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimCodecFactory::encodeJpeg ERROR:"
-            << "\nPassing non-eight bit data to eight bit encoder!" << std::endl;
-      }
-      
-   } // Matches: if ( in.valid() ... )
-   
-   return result;
-
-}
-
-bool ossimJpegCodec::decode( const std::vector<ossim_uint8>& in,
-                             ossimRefPtr<ossimImageData>& out ) const
-{
-   bool result = false;
-
-   // Check for jpeg signature:
-   if ( in.size() > 3 )
-   {
-      if ( (in[0] == 0xff) &&
-           (in[1] == 0xd8) &&
-           (in[2] == 0xff) )
-      {
-         if (in[3] == 0xe0)
-         {
-            result = decodeJpeg( in, out );
-         }
-         else if (in[3] == 0xdb)
-         {
-            result = decodeJpegToRgb( in, out );
-         }
-      }
-   }
-   
-   return result;	
-}
-
-bool ossimJpegCodec::decodeJpeg( const std::vector<ossim_uint8>& in,
-                                    ossimRefPtr<ossimImageData>& out ) const
-{
-   bool result = false;
-
-   /* This struct contains the JPEG decompression parameters and pointers
-    * to working space (which is allocated as needed by the JPEG library).
-    */
-   jpeg_decompress_struct cinfo;
-   
-   /* We use our private extension JPEG error handler.
-    * Note that this struct must live as long as the main JPEG parameter
-    * struct, to avoid dangling-pointer problems.
-    */
-   ossimJpegErrorMgr jerr;
-   
-   /* Step 1: allocate and initialize JPEG decompression object */
-   
-   /* We set up the normal JPEG error routines, then override error_exit. */
-   cinfo.err = jpeg_std_error(&jerr.pub);
-   
-   jerr.pub.error_exit = ossimJpegErrorExit;
-   
-   /* Establish the setjmp return context for my_error_exit to use. */
-   if (setjmp(jerr.setjmp_buffer) == 0)
-   {
-      result = true;
-      
-      /* Now we can initialize the JPEG decompression object. */
-      jpeg_CreateDecompress(&cinfo, JPEG_LIB_VERSION, sizeof(cinfo));
-      
-      //---
-      // Step 2: specify data source.  In this case we will uncompress from
-      // memory so we will use "ossimJpegMemorySrc" in place of " jpeg_stdio_src".
-      //---
-      ossimJpegMemorySrc ( &cinfo, &(in.front()), (size_t)(in.size()) );
-      
-      /* Step 3: read file parameters with jpeg_read_header() */
-      jpeg_read_header(&cinfo, TRUE);
-      
-      /* Step 4: set parameters for decompression */
-      
-      /* Step 5: Start decompressor */
-      jpeg_start_decompress(&cinfo);
-
-      const ossim_uint32 SAMPLES = cinfo.output_width;
-      const ossim_uint32 LINES   = cinfo.output_height;
-      const ossim_uint32 BANDS   = cinfo.output_components;
-
-#if 0       /* Please leave for debug. (drb) */
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "jpeg cinfo.output_width:  " << cinfo.output_width
-            << "\njpeg cinfo.output_height: " << cinfo.output_height
-            << "\njpeg cinfo.out_color_space: " << cinfo.out_color_space
-            << "\n";
-      }
-#endif
-
-      if ( out.valid() )
-      {
-         // This will resize tile if not correct.
-         out->setImageRectangleAndBands(
-            ossimIrect(0,0,(ossim_int32)SAMPLES-1,(ossim_int32)LINES-1), BANDS );
-      }
-      else
-      {
-         out = new ossimU8ImageData( 0, BANDS, SAMPLES, LINES );
-         out->initialize();
-      }
-      
-      // Get pointers to the cache tile buffers.
-      std::vector<ossim_uint8*> destinationBuffer(BANDS);
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         destinationBuffer[band] = out->getUcharBuf(band);
-      }
-      
-      std::vector<ossim_uint8> lineBuffer(SAMPLES * cinfo.output_components);
-      JSAMPROW jbuf[1];
-      jbuf[0] = (JSAMPROW) &(lineBuffer.front());
-      
-      while (cinfo.output_scanline < LINES)
-      {
-         // Read a line from the jpeg file.
-         jpeg_read_scanlines(&cinfo, jbuf, 1);
-         
-         //---
-         // Copy the line which if band interleaved by pixel the the band
-         // separate buffers.
-         //---
-         ossim_uint32 index = 0;
-         for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)         
-         {
-            for (ossim_uint32 band = 0; band < BANDS; ++band)
-            {
-               destinationBuffer[band][sample] = lineBuffer[index];
-               ++index;
-            }
-         }
-         
-         for (ossim_uint32 band = 0; band < BANDS; ++band)
-         {
-            destinationBuffer[band] += SAMPLES;
-         }
-      }
-
-      // Set the tile status:
-      out->validate();
-
-      // clean up...
-      
-      jpeg_finish_decompress(&cinfo);
-      
-   } // Matches: if (setjmp(jerr.setjmp_buffer) == 0)
-
-   jpeg_destroy_decompress(&cinfo);
-   
-   return result;
-}
-
-bool ossimJpegCodec::decodeJpegToRgb(const std::vector<ossim_uint8>& in,
-                                     ossimRefPtr<ossimImageData>& out ) const
-   
-{   
-   bool result = false;
-   
-   ossim_int32 jpegColorSpace = getColorSpace( in );
-
-   if ( jpegColorSpace == JCS_CMYK )
-   {
-      ossimRefPtr<ossimImageData> cmykTile = 0;
-
-      result = decodeJpeg( in, cmykTile ); // Decode to CMYK tile.
-      if ( result )
-      {
-         if ( cmykTile.valid() )
-         {
-            const ossim_uint32 INPUT_BANDS = cmykTile->getNumberOfBands();
-            if ( INPUT_BANDS == 4 )
-            {
-               const ossim_uint32 OUTPUT_BANDS = 3;
-               const ossimIrect   RECT         = cmykTile->getImageRectangle();
-               const ossim_uint32 LINES        = RECT.height();
-               const ossim_uint32 SAMPLES      = RECT.width();
-               ossim_uint32 band = 0;
-               
-               // Set or create output tile:
-               if ( out.valid() )
-               {
-                  // This will resize tile if not correct.
-                  out->setImageRectangleAndBands( RECT, OUTPUT_BANDS );
-               }
-               else
-               {
-                  out = new ossimU8ImageData( 0, OUTPUT_BANDS, SAMPLES, LINES );
-                  out->initialize();
-               }
-               
-               // Assign pointers to bands.
-               std::vector<const ossim_uint8*> inBands(INPUT_BANDS);
-               for ( band = 0; band < INPUT_BANDS; ++band )
-               {
-                  inBands[band] = cmykTile->getUcharBuf( band );
-               }
-               std::vector<ossim_uint8*> outBands(INPUT_BANDS);
-               for ( band = 0; band < OUTPUT_BANDS; ++band )
-               {
-                  outBands[band] = out->getUcharBuf( band );
-               }
-               
-               const ossim_uint8 NP   = 0;   // null pixel
-               const ossim_uint8 MAXP = 255; // max pixel
-               
-               std::vector<ossim_float32> cmyk(INPUT_BANDS, 0.0);
-               std::vector<ossim_float32> rgb(OUTPUT_BANDS, 0.0);
-               
-               for ( ossim_uint32 line = 0; line < LINES; ++line )
-               {
-                  for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)
-                  {
-                     //---
-                     // NOTE:
-                     // This current does NOT work, colors come out wrong, with
-                     // the one dataset that I have:
-                     // "2015_05_05_Whitehorse_3857.gpkg"
-                     // (drb - 03 June 2015)
-                     //---
-                     
-                     cmyk[0] = inBands[0][sample]; // C
-                     cmyk[1] = inBands[1][sample]; // M
-                     cmyk[2] = inBands[2][sample]; // Y
-                     cmyk[3] = inBands[3][sample]; // K
-
-                     //---
-                     // The red (R) color is calculated from the cyan (C) and black (K) colors.
-                     // The green color (G) is calculated from the magenta (M) and black (K) colors.
-                     // The blue color (B) is calculated from the yellow (Y) and black (K) colors.
-                     //---
-                     // rgb[0] = (255.0-cmyk[0]) * 255.0-cmyk[3];
-                     // rgb[1] = (255.0-cmyk[1]) * 255.0-cmyk[3];
-                     // rgb[2] = (255.0-cmyk[2]) * 255.0-cmyk[3];
-                     rgb[0] = (cmyk[0]) * cmyk[3]/255.0;
-                     rgb[1] = (cmyk[1]) * cmyk[3]/255.0;
-                     rgb[2] = (cmyk[2]) * cmyk[3]/255.0;
-                     
-                     outBands[0][sample] =
-                        ( (rgb[0] >= 0.0) ? ( (rgb[0] <= 255.0) ?
-                                              (ossim_uint8)rgb[0] : MAXP ) : NP );
-                     outBands[1][sample] =
-                        ( (rgb[1] >= 0.0) ? ( (rgb[1] <= 255.0) ?
-                                              (ossim_uint8)rgb[1] : MAXP ) : NP );
-                     outBands[2][sample] =
-                        ( (rgb[2] >= 0.0) ? ( (rgb[2] <= 255.0) ?
-                                              (ossim_uint8)rgb[2] : MAXP ) : NP );
-                     
-                  } // End sample loop.
-                  
-                  // Increment pointers.
-                  for (ossim_uint32 band = 0; band < OUTPUT_BANDS; ++band)
-                  {
-                     inBands[band]  += SAMPLES;
-                     outBands[band] += SAMPLES;
-                  }
-                  inBands[3] += SAMPLES; // Last band of input.
-                  
-               } // End of line loop.
-               
-               // Set the tile status:
-               out->validate();
-               
-            } // Matches sanity check: if ( INPUT_BANDS == 4 )
-
-         }  // Matches: if ( cmykTile.valid() )
-         
-      } // Matches: if ( decodeJpeg( in, cmykTile ) )
-      
-   } // Matches: if ( jpegColorSpace == JCS_CMYK )
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimJpegCodec::decodeJpegRgb: WARNING: "
-            << "Unhandled jpeg output color space!" << std::endl;
-   }
-
-   return result;
-   
-} // End: ossimJpegCodec::decodeJpegRgb( ... )
-
-ossim_int32 ossimJpegCodec::getColorSpace( const std::vector<ossim_uint8>& in ) const
-{
-   J_COLOR_SPACE result = JCS_UNKNOWN;
-
-   if ( in.size() )
-   {
-      jpeg_decompress_struct cinfo;
-      ossimJpegErrorMgr jerr;
-      cinfo.err = jpeg_std_error(&jerr.pub);
-      jerr.pub.error_exit = ossimJpegErrorExit;
-      
-      /* Establish the setjmp return context for my_error_exit to use. */
-      if (setjmp(jerr.setjmp_buffer) == 0)
-      {
-         jpeg_CreateDecompress(&cinfo, JPEG_LIB_VERSION, sizeof(cinfo));
-         ossimJpegMemorySrc ( &cinfo, &(in.front()), (size_t)(in.size()) );
-         jpeg_read_header(&cinfo, TRUE);
-         result = cinfo.out_color_space;
-         jpeg_destroy_decompress(&cinfo);
-      }
-   }
-   return result;
-}
-
-void ossimJpegCodec::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(property->getName() == ossimKeywordNames::QUALITY_KW)
-   {
-      m_quality = property->valueToString().toUInt32();
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimJpegCodec::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result;
-
-   if(name == ossimKeywordNames::QUALITY_KW)
-   {
-      result = new ossimNumericProperty(ossimKeywordNames::QUALITY_KW,
-                           ossimString::toString(m_quality),
-                           0,
-                           100);
-   }
-   else
-   {
-      result = ossimCodecBase::getProperty(name);
-   }
-   return result;
-}
-void ossimJpegCodec::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimCodecBase::getPropertyNames(propertyNames);
-   propertyNames.push_back(ossimKeywordNames::QUALITY_KW);
-}
-
-bool ossimJpegCodec::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-	const char* quality = kwl.find(prefix, ossimKeywordNames::QUALITY_KW);
-
-	if(quality)
-	{
-		m_quality = ossimString(quality).toUInt32();
-	}
-
-	return ossimCodecBase::loadState(kwl, prefix);
-}
-
-bool ossimJpegCodec::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-	kwl.add(prefix, ossimKeywordNames::QUALITY_KW, m_quality);
-
-	return ossimCodecBase::saveState(kwl, prefix);
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimJpegMemDest.cpp b/ossim/src/ossim/imaging/ossimJpegMemDest.cpp
deleted file mode 100644
index 58c6e8c..0000000
--- a/ossim/src/ossim/imaging/ossimJpegMemDest.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file
-//
-// Most of code and comments below are from jpeg-6b "example.c" file. See 
-// http://www4.cs.fau.de/Services/Doc/graphics/doc/jpeg/libjpeg.html
-//
-// Author:  Oscar Kramer (From example by Thomas Lane)
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/imaging/ossimJpegMemDest.h>
-#include <cstdlib> /* free, malloc */
-
-/* *** Custom destination manager for JPEG writer *** */
-
-typedef struct 
-{
-   struct jpeg_destination_mgr pub; /* public fields */
-   std::ostream* stream;		/* target stream */
-   JOCTET* buffer;		/* start of buffer */
-} cpp_dest_mgr;
-
-#define OUTPUT_BUF_SIZE  4096	/* choose an efficiently fwrite'able size */
-
-void init_destination (j_compress_ptr cinfo)
-{
-   cpp_dest_mgr* dest = (cpp_dest_mgr*) cinfo->dest;
-
-   /* Allocate the output buffer --- it will be released when done with image */
-   dest->buffer = (JOCTET *)
-      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * sizeof(JOCTET));
-
-   dest->pub.next_output_byte = dest->buffer;
-   dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
-}
-
-boolean empty_output_buffer (j_compress_ptr cinfo)
-{
-   cpp_dest_mgr* dest = (cpp_dest_mgr*) cinfo->dest;
-   dest->stream->write ((char*)dest->buffer, OUTPUT_BUF_SIZE);
-
-   dest->pub.next_output_byte = dest->buffer;
-   dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
-
-   return TRUE;
-}
-
-
-void term_destination (j_compress_ptr cinfo)
-{
-   cpp_dest_mgr* dest = (cpp_dest_mgr*) cinfo->dest;
-   size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
-
-   /* Write any data remaining in the buffer */
-   if (datacount > 0) 
-      dest->stream->write ((char*)dest->buffer, datacount);
-
-   dest->stream->flush();
-   free (cinfo->dest);
-}
-
-void jpeg_cpp_stream_dest (j_compress_ptr cinfo, std::ostream& stream)
-{
-   cpp_dest_mgr* dest;
-
-   /* first time for this JPEG object? */
-   if (cinfo->dest == NULL) 
-      cinfo->dest = (struct jpeg_destination_mgr *) malloc (sizeof(cpp_dest_mgr));
-
-   dest = (cpp_dest_mgr*) cinfo->dest;
-   dest->pub.init_destination = init_destination;
-   dest->pub.empty_output_buffer = empty_output_buffer;
-   dest->pub.term_destination = term_destination;
-   dest->stream = &stream;
-}
diff --git a/ossim/src/ossim/imaging/ossimJpegMemSrc.cpp b/ossim/src/ossim/imaging/ossimJpegMemSrc.cpp
deleted file mode 100644
index 7a35f76..0000000
--- a/ossim/src/ossim/imaging/ossimJpegMemSrc.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//----------------------------------------------------------------------------
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken, original code from Thomas G. Lane (memsrc.c)
-//
-// Description:
-// Code to use jpeg-6b library to read jpeg image from memory.
-//----------------------------------------------------------------------------
-// $Id$
-
-//---
-// Original code from Thomas G. Lane, header comment follows.
-//---
-
-/*
- * memsrc.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains decompression data source routines for the case of
- * reading JPEG data from a memory buffer that is preloaded with the entire
- * JPEG file.  This would not seem especially useful at first sight, but
- * a number of people have asked for it.
- * This is really just a stripped-down version of jdatasrc.c.  Comparison
- * of this code with jdatasrc.c may be helpful in seeing how to make
- * custom source managers for other purposes.
- */
-
-/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
-/* #include <jinclude.h> */
-
-#include <ossim/imaging/ossimJpegMemSrc.h>
-#include <jerror.h>
-extern "C"
-{
-void ossimJpegErrorExit (j_common_ptr cinfo)
-{
-   /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
-   ossimJpegErrorPtr myerr = (ossimJpegErrorPtr) cinfo->err;
-   
-   /* Always display the message. */
-   /* We could postpone this until after returning, if we chose. */
-   (*cinfo->err->output_message) (cinfo);
-   
-   /* Return control to the setjmp point */
-   longjmp(myerr->setjmp_buffer, 1);
-}
-
-
-/* Expanded data source object for memory input */
-
-struct ossimJpegSourceMgr
-{
-   struct jpeg_source_mgr pub;	/* public fields */
-   JOCTET eoi_buffer[2];	/* a place to put a dummy EOI */
-};
-
-typedef ossimJpegSourceMgr* ossimJpegSourceMgrPtr;
-
-
-/*
- * Initialize source --- called by jpeg_read_header
- * before any data is actually read.
- */
-
-void init_source (j_decompress_ptr /* cinfo */)
-{
-  /* No work, since jpeg_memory_src set up the buffer pointer and count.
-   * Indeed, if we want to read multiple JPEG images from one buffer,
-   * this *must* not do anything to the pointer.
-   */
-}
-
-
-/*
- * Fill the input buffer --- called whenever buffer is emptied.
- *
- * In this application, this routine should never be called; if it is called,
- * the decompressor has overrun the end of the input buffer, implying we
- * supplied an incomplete or corrupt JPEG datastream.  A simple error exit
- * might be the most appropriate response.
- *
- * But what we choose to do in this code is to supply dummy EOI markers
- * in order to force the decompressor to finish processing and supply
- * some sort of output image, no matter how corrupted.
- */
-boolean fill_input_buffer (j_decompress_ptr cinfo)
-{
-  ossimJpegSourceMgrPtr src = (ossimJpegSourceMgrPtr) cinfo->src;
-
-  WARNMS(cinfo, JWRN_JPEG_EOF);
-
-  /* Create a fake EOI marker */
-  src->eoi_buffer[0] = (JOCTET) 0xFF;
-  src->eoi_buffer[1] = (JOCTET) JPEG_EOI;
-  src->pub.next_input_byte = src->eoi_buffer;
-  src->pub.bytes_in_buffer = 2;
-
-  return TRUE;
-}
-
-
-/*
- * Skip data --- used to skip over a potentially large amount of
- * uninteresting data (such as an APPn marker).
- *
- * If we overrun the end of the buffer, we let fill_input_buffer deal with
- * it.  An extremely large skip could cause some time-wasting here, but
- * it really isn't supposed to happen ... and the decompressor will never
- * skip more than 64K anyway.
- */
-void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
-{
-  ossimJpegSourceMgrPtr src = (ossimJpegSourceMgrPtr) cinfo->src;
-
-  if (num_bytes > 0) {
-    while (num_bytes > (long) src->pub.bytes_in_buffer) {
-      num_bytes -= (long) src->pub.bytes_in_buffer;
-      (void) fill_input_buffer(cinfo);
-      /* note we assume that fill_input_buffer will never return FALSE,
-       * so suspension need not be handled.
-       */
-    }
-    src->pub.next_input_byte += (size_t) num_bytes;
-    src->pub.bytes_in_buffer -= (size_t) num_bytes;
-  }
-}
-
-
-/*
- * An additional method that can be provided by data source modules is the
- * resync_to_restart method for error recovery in the presence of RST markers.
- * For the moment, this source module just uses the default resync method
- * provided by the JPEG library.  That method assumes that no backtracking
- * is possible.
- */
-
-
-/*
- * Terminate source --- called by jpeg_finish_decompress
- * after all data has been read.  Often a no-op.
- *
- * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
- * application must deal with any cleanup that should happen even
- * for error exit.
- */
-void term_source (j_decompress_ptr /* cinfo */)
-{
-  /* no work necessary here */
-}
-
-
-/*
- * Prepare for input from a memory buffer.
- */
-void ossimJpegMemorySrc (j_decompress_ptr cinfo,
-                         const JOCTET * buffer,
-                         std::size_t bufsize)
-{
-  ossimJpegSourceMgrPtr src;
-
-  /* The source object is made permanent so that a series of JPEG images
-   * can be read from a single buffer by calling jpeg_memory_src
-   * only before the first one.
-   * This makes it unsafe to use this manager and a different source
-   * manager serially with the same JPEG object.  Caveat programmer.
-   */
-  if (cinfo->src == NULL) {	/* first time for this JPEG object? */
-    cinfo->src = (struct jpeg_source_mgr *)
-      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
-				  sizeof(ossimJpegSourceMgr));
-  }
-
-  src = (ossimJpegSourceMgrPtr) cinfo->src;
-  src->pub.init_source = init_source;
-  src->pub.fill_input_buffer = fill_input_buffer;
-  src->pub.skip_input_data = skip_input_data;
-  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
-  src->pub.term_source = term_source;
-
-  src->pub.next_input_byte = buffer;
-  src->pub.bytes_in_buffer = bufsize;
-}
-}
-
diff --git a/ossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp b/ossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp
deleted file mode 100644
index ea5a383..0000000
--- a/ossim/src/ossim/imaging/ossimJpegStdIOSrc.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/*=========================================================================
- 
- Program:   ORFEO Toolbox
- Language:  C++
- Date:      $Date$
- Version:   $Revision$
- 
- 
- Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
- See OTBCopyright.txt for details.
- 
- This software is distributed WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE.  See the above copyright notices for more information.
- 
- =========================================================================*/
-
-/*
- * jdatasrc.c
- *
- * Copyright (C) 1994-1996, Thomas G. Lane.
- * This file is part of the Independent JPEG Group's software.
- * For conditions of distribution and use, see the accompanying README file.
- *
- * This file contains decompression data source routines for the case of
- * reading JPEG data from a file (or any stdio stream).  While these routines
- * are sufficient for most applications, some will want to use a different
- * source manager.
- * IMPORTANT: we assume that fread() will correctly transcribe an array of
- * JOCTETs from 8-bit-wide elements on external storage.  If char is wider
- * than 8 bits on your machine, you may need to do some tweaking.
- */
-
-/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
-
-#include <ossim/imaging/ossimJpegStdIOSrc.h>
-#include <jerror.h>
-
-
-#define INPUT_BUF_SIZE  4096  /* choose an efficiently fread'able size */
-
-#define JFREAD(file,buf,sizeofbuf)  \
-((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
-
-/*
- * In ANSI C, and indeed any rational implementation, size_t is also the
- * type returned by sizeof().  However, it seems there are some irrational
- * implementations out there, in which sizeof() returns an int even though
- * size_t is defined as long or unsigned long.  To ensure consistent results
- * we always use this SIZEOF() macro in place of using sizeof() directly.
- */
-
-#define SIZEOF(object)  ((size_t) sizeof(object))
-
-extern "C"
-{
-   
-   /* Expanded data source object for stdio input */
-   
-   typedef struct {
-      struct jpeg_source_mgr pub;  /* public fields */
-      
-      FILE * infile;    /* source stream */
-      JOCTET * buffer;    /* start of buffer */
-      boolean start_of_file;  /* have we gotten any data yet? */
-   } ossimJpegStdIOSourceMgr;
-   
-   typedef ossimJpegStdIOSourceMgr * ossimJpegStdIOSourceMgrPtr;
-   
-   
-   
-   /*
-    * Initialize source --- called by jpeg_read_header
-    * before any data is actually read.
-    */
-   
-   void
-   ossimJpegStdIOSrc_init_source (j_decompress_ptr cinfo)
-   {
-      ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
-      
-      /* We reset the empty-input-file flag for each image,
-       * but we don't clear the input buffer.
-       * This is correct behavior for reading a series of images from one source.
-       */
-      src->start_of_file = TRUE;
-   }
-   
-   
-   /*
-    * Fill the input buffer --- called whenever buffer is emptied.
-    *
-    * In typical applications, this should read fresh data into the buffer
-    * (ignoring the current state of next_input_byte & bytes_in_buffer),
-    * reset the pointer & count to the start of the buffer, and return TRUE
-    * indicating that the buffer has been reloaded.  It is not necessary to
-    * fill the buffer entirely, only to obtain at least one more byte.
-    *
-    * There is no such thing as an EOF return.  If the end of the file has been
-    * reached, the routine has a choice of ERREXIT() or inserting fake data into
-    * the buffer.  In most cases, generating a warning message and inserting a
-    * fake EOI marker is the best course of action --- this will allow the
-    * decompressor to output however much of the image is there.  However,
-    * the resulting error message is misleading if the real problem is an empty
-    * input file, so we handle that case specially.
-    *
-    * In applications that need to be able to suspend compression due to input
-    * not being available yet, a FALSE return indicates that no more data can be
-    * obtained right now, but more may be forthcoming later.  In this situation,
-    * the decompressor will return to its caller (with an indication of the
-    * number of scanlines it has read, if any).  The application should resume
-    * decompression after it has loaded more data into the input buffer.  Note
-    * that there are substantial restrictions on the use of suspension --- see
-    * the documentation.
-    *
-    * When suspending, the decompressor will back up to a convenient restart point
-    * (typically the start of the current MCU). next_input_byte & bytes_in_buffer
-    * indicate where the restart point will be if the current call returns FALSE.
-    * Data beyond this point must be rescanned after resumption, so move it to
-    * the front of the buffer rather than discarding it.
-    */
-   
-   boolean
-   ossimJpegStdIOSrc_fill_input_buffer (j_decompress_ptr cinfo)
-   {
-      ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
-      size_t nbytes;
-      
-      nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);
-      
-      if (nbytes <= 0) {
-         if (src->start_of_file)  /* Treat empty input file as fatal error */
-            ERREXIT(cinfo, JERR_INPUT_EMPTY);
-         WARNMS(cinfo, JWRN_JPEG_EOF);
-         /* Insert a fake EOI marker */
-         src->buffer[0] = (JOCTET) 0xFF;
-         src->buffer[1] = (JOCTET) JPEG_EOI;
-         nbytes = 2;
-      }
-      
-      src->pub.next_input_byte = src->buffer;
-      src->pub.bytes_in_buffer = nbytes;
-      src->start_of_file = FALSE;
-      
-      return TRUE;
-   }
-   
-   
-   /*
-    * Skip data --- used to skip over a potentially large amount of
-    * uninteresting data (such as an APPn marker).
-    *
-    * Writers of suspendable-input applications must note that skip_input_data
-    * is not granted the right to give a suspension return.  If the skip extends
-    * beyond the data currently in the buffer, the buffer can be marked empty so
-    * that the next read will cause a fill_input_buffer call that can suspend.
-    * Arranging for additional bytes to be discarded before reloading the input
-    * buffer is the application writer's problem.
-    */
-   
-   void
-   ossimJpegStdIOSrc_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
-   {
-      ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
-      
-      /* Just a dumb implementation for now.  Could use fseek() except
-       * it doesn't work on pipes.  Not clear that being smart is worth
-       * any trouble anyway --- large skips are infrequent.
-       */
-      if (num_bytes > 0) {
-         while (num_bytes > (long) src->pub.bytes_in_buffer) {
-            num_bytes -= (long) src->pub.bytes_in_buffer;
-            (void) ossimJpegStdIOSrc_fill_input_buffer(cinfo);
-            /* note we assume that fill_input_buffer will never return FALSE,
-             * so suspension need not be handled.
-             */
-         }
-         src->pub.next_input_byte += (size_t) num_bytes;
-         src->pub.bytes_in_buffer -= (size_t) num_bytes;
-      }
-   }
-   
-   
-   /*
-    * An additional method that can be provided by data source modules is the
-    * resync_to_restart method for error recovery in the presence of RST markers.
-    * For the moment, this source module just uses the default resync method
-    * provided by the JPEG library.  That method assumes that no backtracking
-    * is possible.
-    */
-   
-   
-   /*
-    * Terminate source --- called by jpeg_finish_decompress
-    * after all data has been read.  Often a no-op.
-    *
-    * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
-    * application must deal with any cleanup that should happen even
-    * for error exit.
-    */
-   
-   void
-   ossimJpegStdIOSrc_term_source (j_decompress_ptr cinfo)
-   {
-      (void)cinfo;
-      /* no work necessary here */
-   }
-   
-   
-   /*
-    * Prepare for input from a stdio stream.
-    * The caller must have already opened the stream, and is responsible
-    * for closing it after finishing decompression.
-    */
-   
-   void
-   ossimJpegStdIOSrc (j_decompress_ptr cinfo, FILE * infile)
-   {
-      ossimJpegStdIOSourceMgrPtr src;
-      
-      /* The source object and input buffer are made permanent so that a series
-       * of JPEG images can be read from the same file by calling jpeg_stdio_src
-       * only before the first one.  (If we discarded the buffer at the end of
-       * one image, we'd likely lose the start of the next one.)
-       * This makes it unsafe to use this manager and a different source
-       * manager serially with the same JPEG object.  Caveat programmer.
-       */
-      if (cinfo->src == NULL) {  /* first time for this JPEG object? */
-         cinfo->src = (struct jpeg_source_mgr *)
-         (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
-                                     SIZEOF(ossimJpegStdIOSourceMgr));
-         src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
-         src->buffer = (JOCTET *)
-         (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
-                                     INPUT_BUF_SIZE * SIZEOF(JOCTET));
-      }
-      
-      src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
-      src->pub.init_source = ossimJpegStdIOSrc_init_source;
-      src->pub.fill_input_buffer = ossimJpegStdIOSrc_fill_input_buffer;
-      src->pub.skip_input_data = ossimJpegStdIOSrc_skip_input_data;
-      src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
-      src->pub.term_source = ossimJpegStdIOSrc_term_source;
-      src->infile = infile;
-      src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
-      src->pub.next_input_byte = NULL; /* until buffer loaded */
-   }
-}
diff --git a/ossim/src/ossim/imaging/ossimJpegYCbCrToRgbSource.cpp b/ossim/src/ossim/imaging/ossimJpegYCbCrToRgbSource.cpp
deleted file mode 100644
index 4e3ce37..0000000
--- a/ossim/src/ossim/imaging/ossimJpegYCbCrToRgbSource.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimJpegYCbCrToRgbSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimJpegYCbCrToRgbSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimJpegYCbCrVector.h>
-#include <ossim/base/ossimRgbVector.h>
-
-RTTI_DEF1(ossimJpegYCbCrToRgbSource,
-          "ossimJpegYCbCrToRgbSource" ,
-          ossimImageSourceFilter)
-
-ossimJpegYCbCrToRgbSource::ossimJpegYCbCrToRgbSource()
-   :ossimImageSourceFilter(),
-    theBlankTile()
-{
-}
-
-ossimJpegYCbCrToRgbSource::ossimJpegYCbCrToRgbSource(ossimImageSource* inputSource)
-   : ossimImageSourceFilter(inputSource),
-     theBlankTile()
-{
-}
-
-ossimJpegYCbCrToRgbSource::~ossimJpegYCbCrToRgbSource()
-{
-}
-
-void ossimJpegYCbCrToRgbSource::initialize()
-{
-   ossimImageSourceFilter::initialize();
-}
-
-void ossimJpegYCbCrToRgbSource::allocate()
-{
-   theBlankTile = new ossimImageData(this,
-                                     OSSIM_UCHAR,
-                                     3);
-}
-
-ossimRefPtr<ossimImageData> ossimJpegYCbCrToRgbSource::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if (!theBlankTile.valid())
-   {
-      allocate(); // first time through.
-   }
-   
-   if(theBlankTile.valid())
-   {
-      theBlankTile->setOrigin(tileRect.ul());
-      theBlankTile->setWidthHeight(tileRect.width(), tileRect.height());
-   }
-   
-   if(theInputConnection)
-   {
-      ossimRefPtr<ossimImageData> imageData =
-         theInputConnection->getTile(tileRect, resLevel);
-
-      if(!imageData.valid())
-      {
-         return theBlankTile;
-      }
-      if((isSourceEnabled())&&
-         (imageData->getNumberOfBands()==3)&&
-         (imageData->getScalarType()==OSSIM_UCHAR)&&
-         (imageData->getDataObjectStatus()!=OSSIM_NULL)&&
-         (imageData->getDataObjectStatus()!=OSSIM_EMPTY))
-      {
-         ossim_uint8* bands[3];
-         
-         bands[0] = static_cast<ossim_uint8*>(imageData->getBuf(0));
-         bands[1] = static_cast<ossim_uint8*>(imageData->getBuf(1));
-         bands[2] = static_cast<ossim_uint8*>(imageData->getBuf(2));
-         
-         long height = imageData->getHeight();
-         long width  = imageData->getWidth();
-         long offset = 0;
-         for(long row = 0; row < height; ++row)
-         {
-            for(long col = 0; col < width; ++col)
-            {
-               
-               ossimJpegYCbCrVector ycbcr(bands[0][offset],
-                                          bands[1][offset],
-                                          bands[2][offset]);
-               ossimRgbVector rgb(ycbcr);
-               
-               
-               bands[0][offset] = rgb.getR();
-               bands[1][offset] = rgb.getG();
-               bands[2][offset] = rgb.getB();
-               
-               ++offset;
-            }
-         }
-         imageData->validate();
-      }
-      return imageData;
-   }
-   
-   return theBlankTile;
-}  
-
diff --git a/ossim/src/ossim/imaging/ossimLandsatTopoCorrectionFilter.cpp b/ossim/src/ossim/imaging/ossimLandsatTopoCorrectionFilter.cpp
deleted file mode 100644
index 598241f..0000000
--- a/ossim/src/ossim/imaging/ossimLandsatTopoCorrectionFilter.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimLandsatTopoCorrectionFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimLandsatTopoCorrectionFilter.h>
-#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
-#include <ossim/support_data/ossimFfL7.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossim2dLinearRegression.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimVisitor.h>
-#include <iostream>
-
-RTTI_DEF1(ossimLandsatTopoCorrectionFilter, "ossimLandsatTopoCorrectionFilter",ossimTopographicCorrectionFilter);
-ossimLandsatTopoCorrectionFilter::ossimLandsatTopoCorrectionFilter()
-   :ossimTopographicCorrectionFilter(),
-    theLandsatHeader("")
-{
-}
-
-ossimLandsatTopoCorrectionFilter::~ossimLandsatTopoCorrectionFilter()
-{
-}
-
-ossimLandsatTopoCorrectionFilter::ossimLandsatTopoCorrectionFilter(ossimImageSource* colorSource,
-                                                                   ossimImageSource* elevSource,
-                                                                   const ossimFilename& landsatFileName)
-   :ossimTopographicCorrectionFilter(colorSource,
-                                     elevSource),
-    theLandsatHeader(landsatFileName)
-{
-}
-
-void ossimLandsatTopoCorrectionFilter::initialize()
-{
-   
-   ossimTopographicCorrectionFilter::initialize();
-   if(theLandsatHeader == "")
-   {
-      setLandsatHeader(findLandsatHeader());
-   }
-   else
-   {
-      setLandsatHeader(theLandsatHeader);
-   }
-}
-
-void ossimLandsatTopoCorrectionFilter::setLandsatHeader(const ossimFilename& header)
-{
-   if(header != "")
-   {
-      theLandsatHeader = header;
-      ossimRefPtr<ossimFfL7> headerL7 = new ossimFfL7(header.c_str());
-      headerL7->getGain(theGain);
-      headerL7->getBias(theBias);
-      headerL7->getSunElevation(theLightSourceElevationAngle);
-      headerL7->getSunAzimuth(theLightSourceAzimuthAngle);
-      computeLightDirection();
-      theJulianDay = headerL7->getJulianDay();
-   }
-}
-
-ossimFilename ossimLandsatTopoCorrectionFilter::findLandsatHeader()
-{
-   ossimFilename result;
-
-   if(!getInput(0))
-   {
-      return result;
-   }
-
-   ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
-                                true,
-                                ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
-   getInput(0)->accept(visitor);
-   
-   // If there are multiple image handlers, e.g. a mosaic do not uses.
-   ossimRefPtr<ossimImageHandler> handler = 0;   
-   if ( visitor.getObjects().size() == 1 )
-   {
-      handler = visitor.getObjectAs<ossimImageHandler>( 0 );
-   }
-
-   if( handler.valid() )
-   {
-      ossimFilename imageFile = handler->getFilename();
-      imageFile.setExtension("fst");
-      if(imageFile.exists())
-      {
-         result = imageFile;
-      }
-      else
-      {
-         imageFile.setExtension("FST");
-         if(imageFile.exists())
-         {
-            result = imageFile;
-         }
-         else
-         {
-            ossimDirectory dir;
-
-            if(dir.open(imageFile.path()))
-            {
-               vector<ossimFilename> fileList;
-
-               dir.findAllFilesThatMatch(fileList,
-                                         ".*.fst");
-               if(fileList.size() <1)
-               {
-                  dir.findAllFilesThatMatch(fileList,
-                                            ".*.FST");
-               }
-               for(int i = 0; i < (int)fileList.size(); ++i)
-               {
-                  if(fileList[i].contains("_hpn")||
-                     fileList[i].contains("_hrf")||
-                     fileList[i].contains("_htm"))
-                  {
-                     result = fileList[i];
-                     break;
-                  }
-               }
-            }
-         }
-      }
-   }
-   return result;
-}
-
-// void ossimLandsatTopoCorrectionFilter::addRegressionPoints(std::vector<ossim2dLinearRegression>& regressionPoints,
-//                                                            ossimImageData* colorData,
-//                                                            ossimImageData* normalData)
-// {
-//    ossim_uint32 b = 0;
-   
-//    for(b = 0; b < colorData->getNumberOfBands(); ++b)
-//    {
-//       ossim_float64* normalBands[3];
-//       normalBands[0] = normalData->getBuf(0);
-//       normalBands[1] = normalData->getBuf(1);
-//       normalBands[2] = normalData->getBuf(2);
-//       ossim_float64* colorData = 
-// }
-
-#if 0
-void ossimLandsatTopoCorrectionFilter::computeC()
-{
-   theCComputedFlag = false;
-   ossim_uint32 totalNumberOfPixelsUsed = 0;
-   if(getInput(0)&&getInput(1))
-   {
-      std::vector<ossim2dLinearRegression> linearRegression(6);
-      
-      ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-      ossimImageSource* normalSource  = PTR_CAST(ossimImageSource, getInput(1));
-      ossimFfL7 headerL7(theLandsatHeader.c_str());
-
-      if(theLandsatHeader == "")
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "No landsat header found " << std::endl;
-         return;
-      }
-      if(colorSource->getNumberOfOutputBands() < 6)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "The color source needs all the vir bands from the landsat" << std::endl
-                                            << "Not enough bands to process the request" << std::endl;
-         return;
-      }
-      
-      ossimIrect normalRect = normalSource->getBoundingRect();
-      ossimIrect colorRect  = colorSource->getBoundingRect();
-      ossimIrect clipRect   = normalRect.clipToRect(colorRect);
-      ossimIpt ul = clipRect.ul();
-      ossimIpt lr = clipRect.lr();
-      long julianDay = headerL7.getJulianDay();
-      double d2 =pow( (double)(1 - 0.01674 * ossim::cosd(0.9856*(julianDay-4)) ), 2.0);
-      ossim_uint32 numberOfPixelsUsedForTile = 0;
-      for(int y = ul.y; ((y < lr.y)&&(totalNumberOfPixelsUsed<1000));++y)
-      {
-         for(int x = ul.x; ((x < lr.x)&&(totalNumberOfPixelsUsed<1000)); ++x)
-         {
-            ossimIrect reqRect(x,
-                               y,
-                               x + 127,
-                               y + 127);
-            ossimIrect reqClip = reqRect.clipToRect(clipRect);
-            ossimImageData* colorData  = colorSource->getTile(reqClip, 0);
-            ossimImageData* normalData = normalSource->getTile(reqClip, 0);
-            ossim_uint8* colorBands[6];
-            double* normalBands[3];
-            double normalBandsNp[3];
-            ossim_uint8 colorBandsNp[6];
-            colorBands[0] = (ossim_uint8*)colorData->getBuf(0);
-            colorBands[1] = (ossim_uint8*)colorData->getBuf(1);
-            colorBands[2] = (ossim_uint8*)colorData->getBuf(2);
-            colorBands[3] = (ossim_uint8*)colorData->getBuf(3);
-            colorBands[4] = (ossim_uint8*)colorData->getBuf(4);
-            colorBands[5] = (ossim_uint8*)colorData->getBuf(5);
-            colorBandsNp[0] = (ossim_uint8)colorData->getNullPix(0);
-            colorBandsNp[1] = (ossim_uint8)colorData->getNullPix(1);
-            colorBandsNp[2] = (ossim_uint8)colorData->getNullPix(2);
-            colorBandsNp[3] = (ossim_uint8)colorData->getNullPix(3);
-            colorBandsNp[4] = (ossim_uint8)colorData->getNullPix(4);
-            colorBandsNp[5] = (ossim_uint8)colorData->getNullPix(5);
-            normalBands[0] = (double*)normalData->getBuf(0);
-            normalBands[1] = (double*)normalData->getBuf(1);
-            normalBands[2] = (double*)normalData->getBuf(2);
-            normalBandsNp[0] = normalData->getNullPix(0);
-            normalBandsNp[1] = normalData->getNullPix(1);
-            normalBandsNp[2] = normalData->getNullPix(2);
-            ossim_uint32 offset = 0;
-            ossim_uint32 numberOfPixels = reqClip.width()*reqClip.height();
-            numberOfPixelsUsedForTile = 0;
-            for(offset = 0; ((offset < numberOfPixels)&&(numberOfPixelsUsedForTile < 10)); ++offset)
-            {
-               if((*colorBands[0] != colorBandsNp[0])&&
-                  (*colorBands[1] != colorBandsNp[1])&&
-                  (*colorBands[2] != colorBandsNp[2])&&
-                  (*colorBands[3] != colorBandsNp[3])&&
-                  (*colorBands[4] != colorBandsNp[4])&&
-                  (*colorBands[5] != colorBandsNp[5])&&
-                  (*normalBands[0] != normalBandsNp[0])&&
-                  (*normalBands[1] != normalBandsNp[1])&&
-                  (*normalBands[2] != normalBandsNp[2]))
-               {
-                  double ndviTest = (((double)*colorBands[3] - (double)*colorBands[2])/
-                                     ((double)*colorBands[3] + (double)*colorBands[2]));
-                  if(ndviTest > 0.0)
-                  {
-                     double radiance5 = theBias[5]+(*colorBands[5]*theGain[5]);
-//                     double p = (M_PI*radiance5*d2)/(esun[5]*cosd(90-theLightSourceAzimuthAngle));
-
-//                    if(p < .05)
-                     {
-                        double cosineI = ((*normalBands[0])*theLightDirection[0] +
-                                          (*normalBands[1])*theLightDirection[1] +
-                                          (*normalBands[2])*theLightDirection[2]);
-
-                        double radiance0 = theBias[0]+(*colorBands[0]*theGain[0]);
-                        double radiance1 = theBias[1]+(*colorBands[1]*theGain[1]);
-                        double radiance2 = theBias[2]+(*colorBands[2]*theGain[2]);
-                        double radiance3 = theBias[3]+(*colorBands[3]*theGain[3]);
-                        double radiance4 = theBias[4]+(*colorBands[4]*theGain[4]);
-                        cosineI = fabs(cosineI);
-                        if(cosineI > 1.0) cosineI = 1.0;
-                        if(cosineI < 0.0) cosineI = 0.0;
-                       cosineI = acos(cosineI);
-// //                         linearRegression[0].addPoint(ossimDpt( cosineI,(double)(*colorBands[0])));
-// //                         linearRegression[1].addPoint(ossimDpt( cosineI,(double)(*colorBands[1])));
-// //                         linearRegression[2].addPoint(ossimDpt( cosineI,(double)(*colorBands[2])));
-// //                         linearRegression[3].addPoint(ossimDpt( cosineI,(double)(*colorBands[3])));
-// //                         linearRegression[4].addPoint(ossimDpt( cosineI,(double)(*colorBands[4])));
-// //                         linearRegression[5].addPoint(ossimDpt( cosineI,(double)(*colorBands[5])));
-
-                        linearRegression[0].addPoint(ossimDpt( cosineI,radiance0));
-                        linearRegression[1].addPoint(ossimDpt( cosineI,radiance1));
-                        linearRegression[2].addPoint(ossimDpt( cosineI,radiance2));
-                        linearRegression[3].addPoint(ossimDpt( cosineI,radiance3));
-                        linearRegression[4].addPoint(ossimDpt( cosineI,radiance4));
-                        linearRegression[5].addPoint(ossimDpt( cosineI,radiance5));
-                        
-                        ++numberOfPixelsUsedForTile;
-                        ++totalNumberOfPixelsUsed;
-                     }
-                  }
-               }
-               ++colorBands[0];
-               ++colorBands[1];
-               ++colorBands[2];
-               ++colorBands[3];
-               ++colorBands[4];
-               ++colorBands[5];
-               ++normalBands[0];
-               ++normalBands[1];
-               ++normalBands[2];
-            }
-         }
-      }
-      if(totalNumberOfPixelsUsed > 2)
-      {
-         linearRegression[0].solve();
-         linearRegression[1].solve();
-         linearRegression[2].solve();
-         linearRegression[3].solve();
-         linearRegression[4].solve();
-         linearRegression[5].solve();
-         
-         ossimNotify(ossimNotifyLevel_INFO) << "linear regression results = " << endl
-                                             << linearRegression[0] << endl
-                                             << linearRegression[1] << endl
-                                             << linearRegression[2] << endl
-                                             << linearRegression[3] << endl
-                                             << linearRegression[4] << endl
-                                             << linearRegression[5] << endl;
-         double b,m;
-         linearRegression[0].getEquation(m, b);
-         theC[0] = b/m;
-         linearRegression[1].getEquation(m, b);
-         theC[1] = b/m;
-         linearRegression[2].getEquation(m, b);
-         theC[2] = b/m;
-         linearRegression[3].getEquation(m, b);
-         theC[3] = b/m;
-         linearRegression[4].getEquation(m, b);
-         theC[4] = b/m;
-         linearRegression[5].getEquation(m, b);
-         theC[5] = b/m;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_INFO) << "No points found in regression test" << endl;
-      }
-               
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "No input connected to the ossimLandsatTopoCorrectionFilter" << std::endl;
-      return;
-   }
-   
-   theCComputedFlag = true;
-}
-#endif
-
-bool ossimLandsatTopoCorrectionFilter::loadState(const ossimKeywordlist& kwl,
-                                                 const char* prefix)
-{
-   ossimTopographicCorrectionFilter::loadState(kwl, prefix);
-   const char* filename = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-
-   if(filename)
-   {
-      setLandsatHeader(filename);
-   }
-
-   return true;
-}
-
-bool ossimLandsatTopoCorrectionFilter::saveState(ossimKeywordlist& kwl,
-                                                 const char* prefix)const
-{
-   ossimTopographicCorrectionFilter::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           ossimKeywordNames::FILENAME_KW,
-           theLandsatHeader.c_str(),
-           true);
-   
-   return true;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimMapCompositionSource.cpp b/ossim/src/ossim/imaging/ossimMapCompositionSource.cpp
deleted file mode 100644
index e7c7fa6..0000000
--- a/ossim/src/ossim/imaging/ossimMapCompositionSource.cpp
+++ /dev/null
@@ -1,3801 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimMapCompositionSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimMapCompositionSource.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <ossim/imaging/ossimImageDataHelper.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/imaging/ossimAnnotationFontObject.h>
-#include <ossim/imaging/ossimAnnotationLineObject.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/font/ossimFontFactoryRegistry.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimDms.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimColorProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimFontProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimTextProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <sstream>
-
-using namespace std;
-
-static const char* GRID_TYPE_ENUM_NAMES[]     = {"none", "line", "reseaux"};
-static const char* VIEW_WIDTH_KW              = "view_width";
-static const char* VIEW_HEIGHT_KW             = "view_height";
-static const char* METER_GRID_SPACING_X_KW    = "meter_grid_spacing_x";
-static const char* METER_GRID_SPACING_Y_KW    = "meter_grid_spacing_y";
-static const char* GEO_GRID_SPACING_LON_KW    = "geo_grid_spacing_lon";
-static const char* GEO_GRID_SPACING_LAT_KW    = "geo_grid_spacing_lat";
-static const char* METER_GRID_TYPE_KW         = "meter_grid_type";
-static const char* GEO_GRID_TYPE_KW           = "geo_grid_type";
-static const char* TOP_BORDER_LENGTH_KW       = "top_border_length";
-static const char* BOTTOM_BORDER_LENGTH_KW    = "bottom_border_length";
-static const char* LEFT_BORDER_LENGTH_KW      = "top_border_length";
-static const char* RIGHT_BORDER_LENGTH_KW     = "right_border_length";
-static const char* BORDER_COLOR_KW            = "border_color";
-static const char* GEO_GRID_COLOR_KW          = "geo_grid_color";
-static const char* METER_GRID_COLOR_KW        = "meter_grid_color";
-static const char* TITLE_STRING_KW            = "title_string";
-static const char* TITLE_COLOR_KW             = "title_color";
-
-static const char* TOP_GEO_LABEL_COLOR_KW     = "top_geo_label_color";
-static const char* BOTTOM_GEO_LABEL_COLOR_KW  = "bottom_geo_label_color";
-static const char* LEFT_GEO_LABEL_COLOR_KW    = "left_geo_label_color";
-static const char* RIGHT_GEO_LABEL_COLOR_KW   = "right_geo_label_color";
-
-static const char* TOP_METER_LABEL_COLOR_KW     = "top_meter_label_color";
-static const char* BOTTOM_METER_LABEL_COLOR_KW  = "bottom_meter_label_color";
-static const char* LEFT_METER_LABEL_COLOR_KW    = "left_meter_label_color";
-static const char* RIGHT_METER_LABEL_COLOR_KW   = "right_meter_label_color";
-
-static const char* TOP_GEO_LABEL_FORMAT_KW    = "top_geo_label_format";
-static const char* BOTTOM_GEO_LABEL_FORMAT_KW = "bottom_geo_label_format";
-static const char* LEFT_GEO_LABEL_FORMAT_KW   = "left_geo_label_format";
-static const char* RIGHT_GEO_LABEL_FORMAT_KW  = "right_geo_label_format";
-
-static const char* TOP_GEO_LABEL_FLAG_KW      = "top_geo_label_flag";
-static const char* BOTTOM_GEO_LABEL_FLAG_KW   = "bottom_geo_label_flag";
-static const char* LEFT_GEO_LABEL_FLAG_KW     = "left_geo_label_flag";
-static const char* RIGHT_GEO_LABEL_FLAG_KW    = "right_geo_label_flag";
-
-static const char* TOP_METER_LABEL_FLAG_KW    = "top_meter_label_flag";
-static const char* BOTTOM_METER_LABEL_FLAG_KW = "bottom_meter_label_flag";
-static const char* LEFT_METER_LABEL_FLAG_KW   = "left_meter_label_flag";
-static const char* RIGHT_METER_LABEL_FLAG_KW  = "right_meter_label_flag";
-
-static const char* TOP_GEO_LABEL_FONT_KW      = "top_geo_label_font";
-static const char* BOTTOM_GEO_LABEL_FONT_KW   = "bottom_geo_label_font";
-static const char* LEFT_GEO_LABEL_FONT_KW     = "left_geo_label_font";
-static const char* RIGHT_GEO_LABEL_FONT_KW    = "right_geo_label_font";
-static const char* TOP_METER_LABEL_FONT_KW    = "top_meter_label_font";
-static const char* BOTTOM_METER_LABEL_FONT_KW = "bottom_meter_label_font";
-static const char* LEFT_METER_LABEL_FONT_KW   = "left_meter_label_font";
-static const char* RIGHT_METER_LABEL_FONT_KW  = "right_meter_label_font";
-static const char* TITLE_FONT_KW              = "title_font";
-
-static ossimTrace traceDebug("ossimMapCompositionSource:debug");
-
-RTTI_DEF1(ossimMapCompositionSource, "ossimMapCompositionSource", ossimAnnotationSource);
-ossimMapCompositionSource::ossimMapCompositionSource()
-   :ossimAnnotationSource(),
-    theMeterGridType(OSSIM_GRID_NONE),
-    theGeographicGridType(OSSIM_GRID_LINE),
-    theTopBorderLength(200),
-    theBottomBorderLength(200),
-    theLeftBorderLength(300),
-    theRightBorderLength(300),
-    theBorderColor(255,255,255),
-    theGeographicGridColor(255,255,255),
-    theMeterGridColor(255,255,255),
-    theTitleString(""),
-    theTitleFont(NULL),
-    theTitleColor(1, 1, 1),
-    theTopGeographicLabelColor(1, 1, 1),
-    theBottomGeographicLabelColor(1, 1, 1),
-    theLeftGeographicLabelColor(1, 1, 1),
-    theRightGeographicLabelColor(1, 1, 1),
-    theTopMeterLabelColor(1, 1, 1),
-    theBottomMeterLabelColor(1, 1, 1),
-    theLeftMeterLabelColor(1, 1, 1),
-    theRightMeterLabelColor(1, 1, 1),
-    theGeographicTopLabelFont(NULL),
-    theGeographicBottomLabelFont(NULL),
-    theGeographicLeftLabelFont(NULL),
-    theGeographicRightLabelFont(NULL),
-    theMeterTopLabelFont(NULL),
-    theMeterBottomLabelFont(NULL),
-    theMeterLeftLabelFont(NULL),
-    theMeterRightLabelFont(NULL),
-    theTopGeographicFormat("dd at mm'ss\".ssssC"),
-    theBottomGeographicFormat("dd at mm'ss\".ssssC"),
-    theLeftGeographicFormat("dd at mm'ss\".ssssC"),
-    theRightGeographicFormat("dd at mm'ss\".ssssC"),
-    theTopGeographicLabelFlag(true),
-    theBottomGeographicLabelFlag(true),
-    theLeftGeographicLabelFlag(true),
-    theRightGeographicLabelFlag(true),
-    theTopGeographicTickFlag(true),
-    theBottomGeographicTickFlag(true),
-    theLeftGeographicTickFlag(true),
-    theRightGeographicTickFlag(true),
-    theTopMeterLabelFlag(false),
-    theBottomMeterLabelFlag(false),
-    theLeftMeterLabelFlag(false),
-    theRightMeterLabelFlag(false),
-    theTopMeterTickFlag(false),
-    theBottomMeterTickFlag(false),
-    theLeftMeterTickFlag(false),
-    theRightMeterTickFlag(false),
-    theGeographicSpacing(1.0, 1.0),
-    theMeterSpacing(3600*30, 3600*30)
-{
-   theViewWidthHeight = ossimIpt(-1,-1);
-   vector<ossimFontInformation> info;
-   ossimFontFactoryRegistry::instance()->getFontInformation(info);
-
-   if(info.size())
-   {
-      theGeographicTopLabelFont = ossimFontFactoryRegistry::instance()->createFont(info[0]);
-      theGeographicTopLabelFontInfo = info[0];
-      theGeographicTopLabelFontInfo.thePointSize = ossimIpt(12,12);
-
-      if(theGeographicTopLabelFont.valid())
-      {
-         theGeographicBottomLabelFont     = (ossimFont*)theGeographicTopLabelFont->dup();
-         theGeographicBottomLabelFontInfo = theGeographicTopLabelFontInfo;
-         theGeographicLeftLabelFont       = (ossimFont*)theGeographicTopLabelFont->dup();
-         theGeographicLeftLabelFontInfo   = theGeographicTopLabelFontInfo;
-         theGeographicRightLabelFont      = (ossimFont*)theGeographicTopLabelFont->dup();
-         theGeographicRightLabelFontInfo  = theGeographicTopLabelFontInfo;
-
-         theMeterTopLabelFont             = (ossimFont*)theGeographicTopLabelFont->dup();
-         theMeterTopLabelFontInfo         = theGeographicTopLabelFontInfo;
-         theMeterBottomLabelFont          = (ossimFont*)theGeographicTopLabelFont->dup();
-         theMeterBottomLabelFontInfo      = theGeographicTopLabelFontInfo;
-         theMeterLeftLabelFont            = (ossimFont*)theGeographicTopLabelFont->dup();
-         theMeterLeftLabelFontInfo        = theGeographicTopLabelFontInfo;
-         theMeterRightLabelFont           = (ossimFont*)theGeographicTopLabelFont->dup();
-         theMeterRightLabelFontInfo       = theGeographicTopLabelFontInfo;
-         
-         theTitleFont                     = (ossimFont*)theGeographicTopLabelFont->dup();
-         theTitleFontInfo                 = theGeographicTopLabelFontInfo;
-         theTitleFontInfo.thePointSize    = ossimIpt(48, 48);
-      }
-   }
-}
-
-ossimMapCompositionSource::~ossimMapCompositionSource()
-{
-   theGeographicTopLabelFont = 0;
-   theGeographicBottomLabelFont = 0;
-   theGeographicLeftLabelFont = 0;
-   theGeographicRightLabelFont = 0;
-   theMeterTopLabelFont = 0;
-   theMeterBottomLabelFont = 0;
-   theMeterLeftLabelFont = 0;
-
-   theMeterRightLabelFont = 0;
-   theTitleFont = 0;
-   deleteFixedAnnotations();
-}
-
-ossimRefPtr<ossimImageData> ossimMapCompositionSource::getTile(const ossimIrect& tileRect,
-                                                               ossim_uint32 resLevel)
-{
-   if(!theTile)
-   {
-      allocate(tileRect);
-      if(!theTile)
-      {
-         if(theInputConnection)
-         {
-            return theInputConnection->getTile(tileRect, resLevel);
-         }
-      }
-   }
-   theTile->setImageRectangle(tileRect);
-   theTile->makeBlank();
-   
-   if(theInputConnection)
-   {
-      ossimRefPtr<ossimImageData> tile = theInputConnection->getTile(tileRect,
-                                                                     resLevel);
-
-      if(tile.valid())
-      {
-         if(tile->getScalarType() != OSSIM_UCHAR)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimMapCompositionSource::getTile\n"
-               << "Error input is not uchar" << endl;
-            return tile;
-         }
-         else
-         {
-            if(tile->getBuf()&&(tile->getDataObjectStatus() != OSSIM_EMPTY))
-            {
-               int band = 0;
-               int outBands = theTile->getNumberOfBands();
-               int minBand = std::min((long)theTile->getNumberOfBands(),
-                                      (long)tile->getNumberOfBands());
-               for(band = 0; band < minBand; ++band)
-               {
-                  theTile->loadBand(tile->getBuf(band),
-                                    tile->getImageRectangle(),
-                                    band);
-               }
-               // copy last band of input tile to all output
-               // bands if the input tile did not have enough bands.
-               //
-               for(;band < outBands;++band)
-               {
-                  theTile->loadBand(tile->getBuf(minBand-1),
-                                    tile->getImageRectangle(),
-                                    band);
-               }
-            }
-	    drawBorders();
-	    drawAnnotations(theTile);
-         }
-      }
-   }
-   theTile->validate();
-   return theTile;
-}
-
-void ossimMapCompositionSource::setGeographicLabelFormat(const ossimString format)
-{
-   if( (format == theTopGeographicFormat)&&
-       (format == theBottomGeographicFormat)&&
-       (format == theLeftGeographicFormat)&&
-       (format == theRightGeographicFormat))
-   {
-      return;
-   }
-   theTopGeographicFormat    = format;
-   theBottomGeographicFormat = format;
-   theLeftGeographicFormat   = format;
-   theRightGeographicFormat  = format;
-}
-
-void ossimMapCompositionSource::setTopGeographicLabelFormat(const ossimString& format)
-{
-   if(format == theTopGeographicFormat)
-   {
-      return;
-   }
-   theTopGeographicFormat = format;
-}
-
-void ossimMapCompositionSource::setBottomGeographicLabelFormat(const ossimString& format)
-{
-   if(format == theBottomGeographicFormat)
-   {
-      return;
-   }
-   theBottomGeographicFormat = format;
-
-   // need to reset the fonts
-//   layoutAnnotations();
-}
-
-void ossimMapCompositionSource::setLeftGeographicLabelFormat(const ossimString& format)
-{
-   if(format == theLeftGeographicFormat)
-   {
-      return;
-   }
-   theLeftGeographicFormat = format;
-
-   // need to reset the fonts
-//   layoutAnnotations();
-}
-
-void ossimMapCompositionSource::setRightGeographicLabelFormat(const ossimString& format)
-{
-   if(format == theRightGeographicFormat)
-   {
-      return;
-   }
-   theRightGeographicFormat = format;
-
-}
-
-void ossimMapCompositionSource::setTitleFont(const ossimFontInformation& fontInfo)
-{
-   if(theTitleFontInfo == fontInfo)
-   {
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-   if(font)
-   {
- 
-      theTitleFont     = font;
-      theTitleFontInfo = fontInfo;      
-   }
-}
-
-void ossimMapCompositionSource::setGeographicTopLabelFont(const ossimFontInformation& fontInfo)
-{
-   const char* MODULE = "ossimMapCompositionSource::setGeographicTopLabelFont";
-   
-   if(traceDebug())
-   {
-      CLOG << "Entering...." <<endl;
-   }
-   if(theGeographicTopLabelFontInfo == fontInfo)
-   {
-      if(traceDebug())
-      {
-         CLOG << "Font info the same exiting...." <<endl
-              << theGeographicTopLabelFontInfo << endl;
-      }
-      
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      if(traceDebug())
-      {
-         CLOG << "Previous font info " <<endl
-              << theGeographicTopLabelFont.get() << endl;
-      }
-      theGeographicTopLabelFont = font;
-      theGeographicTopLabelFontInfo = fontInfo;
-
-      if(traceDebug())
-      {
-         CLOG << "New font info " <<endl
-              << theGeographicTopLabelFont.get() << endl;
-      }      
-   }
-}
-
-void ossimMapCompositionSource::setGeographicBottomLabelFont(const ossimFontInformation& fontInfo)
-{
-   if(theGeographicBottomLabelFontInfo == fontInfo)
-   {
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      theGeographicBottomLabelFont     = font;
-      theGeographicBottomLabelFontInfo = fontInfo;
-
-   }
-}
-
-void ossimMapCompositionSource::setGeographicLeftLabelFont(const ossimFontInformation& fontInfo)
-{
-   if(theGeographicRightLabelFontInfo == fontInfo)
-   {
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      theGeographicLeftLabelFont     = font;
-      theGeographicLeftLabelFontInfo = fontInfo;
-
-   }
-}
-
-void ossimMapCompositionSource::setGeographicRightLabelFont(const ossimFontInformation& fontInfo)
-{
-   if(theGeographicRightLabelFontInfo == fontInfo)
-   {
-      return;
-   }
-   
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      theGeographicRightLabelFont = font;
-      theGeographicRightLabelFontInfo = fontInfo;
-   }
-}
-
-
-void ossimMapCompositionSource::setMeterTopLabelFont(const ossimFontInformation& fontInfo)
-{
-   if(theMeterTopLabelFontInfo == fontInfo)
-   {
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      theMeterTopLabelFont     = font;
-      theMeterTopLabelFontInfo = fontInfo;
-   }
-}
-
-void ossimMapCompositionSource::setMeterBottomLabelFont(const ossimFontInformation& fontInfo)
-{
-   if(theMeterBottomLabelFontInfo == fontInfo)
-   {
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      theMeterBottomLabelFont     = font;
-      theMeterBottomLabelFontInfo = fontInfo;
-   }
-}
-
-void ossimMapCompositionSource::setMeterLeftLabelFont(const ossimFontInformation& fontInfo)
-{
-   if(theMeterLeftLabelFontInfo == fontInfo)
-   {
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      theMeterLeftLabelFont     = font;
-      theMeterLeftLabelFontInfo = fontInfo;
-   }
-}
-
-void ossimMapCompositionSource::setMeterRightLabelFont(const ossimFontInformation& fontInfo)
-{
-   if(theMeterRightLabelFontInfo == fontInfo)
-   {
-      return;
-   }
-   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
-
-   if(font)
-   {
-      theMeterRightLabelFont     = font;
-      theMeterRightLabelFontInfo = fontInfo;
-   }
-}
-
-ossimIrect ossimMapCompositionSource::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimIrect result;
-
-   result.makeNan();
-   if(theInputConnection)
-   {
-      ossimIrect inputRect  = getViewingRect();
-
-      if(!inputRect.hasNans())
-      {
-         ossimDpt decimation;
-         getDecimationFactor(resLevel,
-                             decimation);
-         int leftBorderLength   = theLeftBorderLength;
-         int rightBorderLength  = theRightBorderLength;
-         int topBorderLength    = theTopBorderLength;
-         int bottomBorderLength = theBottomBorderLength;
-
-         ossimIpt p1(inputRect.ul().x - leftBorderLength,
-                     inputRect.ul().y - topBorderLength);
-         
-         ossimIpt p2(inputRect.ur().x + rightBorderLength,
-                     inputRect.ur().y - topBorderLength);
-         
-         ossimIpt p3(inputRect.lr().x + rightBorderLength,
-                     inputRect.lr().y + bottomBorderLength);
-         
-         ossimIpt p4(inputRect.ll().x - leftBorderLength,
-                     inputRect.ll().y + bottomBorderLength);
-
-         result = ossimIrect(p1, p2, p3, p4);
-         
-         if(!decimation.hasNans())
-         {
-            result*=decimation;
-         }
-      }
-   }
-   return result;
-}
-
-void ossimMapCompositionSource::layoutAnnotations()
-{
-   deleteFixedAnnotations();
-
-   addTitle();
-   addGridLabels();
-   if(theGeographicGridType == OSSIM_GRID_LINE)
-   {
-      addGeographicGridLines();
-   }
-   else if(theGeographicGridType == OSSIM_GRID_RESEAUX)
-   {
-      addGeographicGridReseaux();
-   }
-   
-   if(theMeterGridType == OSSIM_GRID_LINE)
-   {
-      addMeterGridLines();
-   }
-   else if(theMeterGridType == OSSIM_GRID_RESEAUX)
-   {
-      addMeterGridReseaux();
-   }
-}
-
-
-void ossimMapCompositionSource::initialize()
-{
-   ossimAnnotationSource::initialize();   
-
-   theTile = 0;
-   if(theInputConnection)
-   {
-      computeBorderRects();
-      layoutAnnotations();
-   }
-   else 
-   {
-      deleteFixedAnnotations();
-   }
-}
-
-void ossimMapCompositionSource::computeBorderRects()
-{
-   if(theInputConnection)
-   {
-      ossimIrect inputRect = getViewingRect();;
-      
-      theTopBorder = ossimIrect(inputRect.ul().x - theLeftBorderLength,
-                                inputRect.ul().y - theTopBorderLength,
-                                inputRect.ur().x + theRightBorderLength,
-                                inputRect.ur().y);
-      
-      theBottomBorder = ossimIrect(inputRect.ll().x - theLeftBorderLength,
-                                   inputRect.ll().y,
-                                   inputRect.lr().x + theRightBorderLength,
-                                   inputRect.lr().y + theBottomBorderLength);
-      
-      theLeftBorder   = ossimIrect(theTopBorder.ul().x,
-                                   theTopBorder.ll().y,
-                                   inputRect.ll().x,
-                                   inputRect.ll().y);
-      
-      theRightBorder   = ossimIrect(inputRect.ur().x,
-                                    inputRect.ur().y,
-                                    theBottomBorder.lr().x,
-                                    inputRect.lr().y);
-   }
-   else
-   {
-      theTopBorder.makeNan();
-      theBottomBorder.makeNan();
-      theLeftBorder.makeNan();
-      theRightBorder.makeNan();
-   }
-      
-}
-
-void ossimMapCompositionSource::drawBorders()
-{
-   if(theTile.valid())
-   {
-      ossimIrect top    = theTopBorder;
-      ossimIrect bottom = theBottomBorder;
-      ossimIrect left   = theLeftBorder;
-      ossimIrect right  = theRightBorder;
-
-//       if(resLevel)
-//       {
-//          ossimDpt decimation;
-//          getDecimationFactor(resLevel,
-//                              decimation);
-
-//          if(!decimation.hasNans())
-//          {
-//             top*=decimation;
-//             bottom*=decimation;
-//             left*=decimation;
-//             right*=decimation;            
-//          }
-//       }
-      ossimIrect tileRect = theTile->getImageRectangle();
-      
-      ossimImageDataHelper helper(theTile.get());
-      
-      if(top.intersects(tileRect))
-      {
-         helper.fill(theBorderColor,
-                     top.clipToRect(tileRect),false);
-      }
-      if(bottom.intersects(tileRect))
-      {
-         helper.fill(theBorderColor,
-                     bottom.clipToRect(tileRect),false);
-      }
-      if(left.intersects(tileRect))
-      {
-         helper.fill(theBorderColor,
-                     left.clipToRect(tileRect),false);
-      }
-      if(right.intersects(tileRect))
-      {
-         helper.fill(theBorderColor,
-                     right.clipToRect(tileRect),false);
-      }
-   }
-}
-
-void ossimMapCompositionSource::addGridLabels()
-{
-   addGeographicTopGridLabels();
-   addGeographicBottomGridLabels();
-   addGeographicLeftGridLabels();
-   addGeographicRightGridLabels();
-
-   addMeterGridLabels();
-}
-
-void ossimMapCompositionSource::addGeographicTopGridLabels()
-{
-   const char* MODULE = "ossimMapCompositionSource::addGeographicTopGridLabels";
-   if(traceDebug())
-   {
-      CLOG << "Entering...." << endl;
-   }
-   if((!theTopGeographicLabelFlag)&&(!theTopGeographicTickFlag))
-   {
-      if(traceDebug())
-      {
-         CLOG << "Exiting, flags are false...." << endl;
-      }
-      return;
-   }
-   
-   if(theInputConnection)
-   { 
-      const ossimMapProjection* mapProj = inputMapProjection();
-      ossimGpt gpt[4];
-      ossimDrect rect = getViewingRect();
-
-      if(rect.hasNans()) return;
-      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
-      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
-      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
-      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
-      
-      ossimDrect grect(gpt[0], gpt[1], gpt[2], gpt[3], OSSIM_RIGHT_HANDED);
-
-      if(grect.hasNans()) return;
-      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-      
-      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-
-      while(ulLatLon.lat > 90)
-      {
-         ulLatLon.lat -= theGeographicSpacing.lat;
-      }
-      while(ulLatLon.lon < -180)
-      {
-         ulLatLon.lon += theGeographicSpacing.lon;
-      }
-      while(lrLatLon.lat < -90)
-      {
-         ulLatLon.lat += theGeographicSpacing.lat;
-      }
-      while(lrLatLon.lon > 180)
-      {
-         ulLatLon.lon -= theGeographicSpacing.lon;
-      }
-      
-      ossimDrect latLonSpacing(ulLatLon,
-                               lrLatLon,
-                               OSSIM_RIGHT_HANDED);
-
-      if(traceDebug())
-      {
-         CLOG << "labeling bounding geo rect = " << latLonSpacing << endl;
-      }
-      // do the top side labels.
-      for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
-      {
-         ossimDpt tipt; // top
-         ossimDpt bipt; // bottom
-         
-         ossimGpt tgpt(latLonSpacing.ul().y,
-                       lon,
-                       0.0,
-                       gpt[0].datum());
-
-         ossimGpt bgpt(latLonSpacing.lr().y,
-                       lon,
-                       0.0,
-                       gpt[0].datum());
-         
-         mapProj->worldToLineSample(tgpt, tipt);
-         mapProj->worldToLineSample(bgpt, bipt);
-
-         
-         if((!tipt.hasNans()&& !bipt.hasNans()) && rect.clip(tipt, bipt))
-         {
-            ossimIpt rounded(tipt);
-            if( (rounded.x >= rect.ul().x)&&
-                (rounded.x <= rect.lr().x))
-            {
-               if(theTopGeographicLabelFlag)
-               {
-                  ossimDms dms(tgpt.lond(), false);
-               
-                  ossimString dmsString = dms.toString(theTopGeographicFormat.c_str());
-                  ossimAnnotationFontObject* lonLabel = 
-                     new ossimAnnotationFontObject(ossimIpt(0,0), dmsString);
-                  lonLabel->setFont(theGeographicTopLabelFont.get());
-                  lonLabel->setGeometryInformation(theGeographicTopLabelFontInfo);
-                  lonLabel->computeBoundingRect();
-                  ossimDrect boundsD;
-                  lonLabel->getBoundingRect(boundsD);
-                  
-                  ossimIpt center( rounded.x, ossim::round<int>(rect.ul().y-(boundsD.height()/2)));
-               
-                  lonLabel->setColor(theTopGeographicLabelColor.getR(), theTopGeographicLabelColor.getG(), theTopGeographicLabelColor.getB());
-                  lonLabel->setCenterPosition(center);
-                  lonLabel->computeBoundingRect();
-
-                  ossimDrect labelRect;
-                  lonLabel->getBoundingRect(labelRect);
-                  
-                  if(rect.intersects(labelRect))
-                  {
-                     ossimIrect intersection = rect.clipToRect(labelRect);
-                     center.y -= ossim::round<int>(rect.ul().y - intersection.lr().y);
-                  }
-
-                  center.y -= 24; // this will need to be the tick height later;
-                  lonLabel->setCenterPosition(center);
-                  lonLabel->computeBoundingRect();
-                  
-                  addFixedAnnotation(lonLabel);
-               }
-               if(theTopGeographicTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject
-                     (ossimIpt(rounded.x,ossim::round<int>(rect.ul().y-24)),
-                      ossimIpt(rounded.x, ossim::round<int>(rect.ul().y)));
-                  lineLabel->setColor(theTopGeographicLabelColor.getR(), theTopGeographicLabelColor.getG(), theTopGeographicLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-            }
-         }
-      }
-   }
-   if(traceDebug())
-   {
-      CLOG << "Exiting...." << endl;
-   }
-}
-
-void ossimMapCompositionSource::addGeographicBottomGridLabels()
-{
-   if((!theBottomGeographicLabelFlag)&&(!theBottomGeographicTickFlag))
-   {
-      return;
-   }
-
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   { 
-      ossimGpt gpt[4];
-      ossimDrect rect = getViewingRect();
-
-      if(rect.hasNans()) return;
-      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
-      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
-      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
-      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
-      
-      ossimDrect grect(gpt[0], gpt[1], gpt[2], gpt[3], OSSIM_RIGHT_HANDED);
-
-      if(grect.hasNans()) return;
-      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-      
-      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-
-      while(ulLatLon.lat > 90)
-      {
-         ulLatLon.lat -= theGeographicSpacing.lat;
-      }
-      while(ulLatLon.lon < -180)
-      {
-         ulLatLon.lon += theGeographicSpacing.lon;
-      }
-      while(lrLatLon.lat < -90)
-      {
-         ulLatLon.lat += theGeographicSpacing.lat;
-      }
-      while(lrLatLon.lon > 180)
-      {
-         ulLatLon.lon -= theGeographicSpacing.lon;
-      }
-      
-      ossimDrect latLonSpacing(ulLatLon,
-                               lrLatLon,
-                               OSSIM_RIGHT_HANDED);
-
-      // do the top side labels.
-      for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
-      {
-         ossimDpt tipt; // top
-         ossimDpt bipt; // bottom
-         
-         ossimGpt tgpt(latLonSpacing.ul().y,
-                       lon,
-                       0.0,
-                       gpt[0].datum());
-
-         ossimGpt bgpt(latLonSpacing.lr().y,
-                       lon,
-                       0.0,
-                       gpt[0].datum());
-         
-         mapProj->worldToLineSample(tgpt, tipt);
-         mapProj->worldToLineSample(bgpt, bipt);
-
-         if(rect.clip(tipt, bipt))
-         {
-            ossimIpt rounded(bipt);
-            if( (rounded.x >= rect.ul().x)&&
-                (rounded.x <= rect.lr().x))
-            {
-               if(theBottomGeographicLabelFlag)
-               {
-                  ossimDms dms(bgpt.lond(), false);
-                  
-                  ossimString dmsString = dms.toString(theBottomGeographicFormat.c_str());
-                  ossimAnnotationFontObject* lonLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                                      dmsString);
-                  lonLabel->setGeometryInformation(theGeographicBottomLabelFontInfo);
-                  lonLabel->setFont(theGeographicBottomLabelFont.get());
-//                  lonLabel->setFont(theGeographicBottomLabelFont->dup());
-                  
-                  lonLabel->computeBoundingRect();
-                  ossimDrect boundsD;
-                  lonLabel->getBoundingRect(boundsD);
-                  ossimIrect bounds = boundsD;
-                  
-                  ossimIpt center( rounded.x,
-                                   ossim::round<int>(rect.lr().y+(bounds.height()/2)));
-                  
-                  lonLabel->setColor(theBottomGeographicLabelColor.getR(), theBottomGeographicLabelColor.getG(), theBottomGeographicLabelColor.getB());
-                  lonLabel->setCenterPosition(center);
-                  lonLabel->computeBoundingRect();
-                  lonLabel->getBoundingRect(boundsD);
-                  bounds = boundsD;
-
-                  ossimDrect labelRect;
-                  lonLabel->getBoundingRect(labelRect);
-                  
-                  if(rect.intersects(labelRect))
-                  {
-                     ossimIrect intersection = rect.clipToRect(labelRect);
-                     center.y += ossim::round<int>(rect.lr().y - intersection.ul().y);
-                  }
-
-                  center.y += 24; // this will need to be the tick height later;
-                  lonLabel->setCenterPosition(center);
-                  lonLabel->computeBoundingRect();
-
-
-                  addFixedAnnotation(lonLabel);
-               }
-               if(theBottomGeographicTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(rounded.x,
-                                                                                                ossim::round<int>(rect.lr().y+24)),
-                                                                                       ossimIpt(rounded.x,
-                                                                                                ossim::round<int>(rect.lr().y)));
-                  lineLabel->setColor(theBottomGeographicLabelColor.getR(), theBottomGeographicLabelColor.getG(), theBottomGeographicLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-            }         
-         }
-      }
-   }   
-}
-
-void ossimMapCompositionSource::addGeographicLeftGridLabels()
-{
-   if((!theLeftGeographicLabelFlag)&&(!theLeftGeographicTickFlag))
-   {
-      return;
-   }
-   
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   { 
-      ossimGpt gpt[4];
-      ossimDrect rect = getViewingRect();
-
-      if(rect.hasNans()) return;
-      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
-      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
-      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
-      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
-      
-      ossimDrect grect(gpt[0],
-                       gpt[1],
-                       gpt[2],
-                       gpt[3],
-                       OSSIM_RIGHT_HANDED);
-
-      if(grect.hasNans()) return;
-      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-      
-      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-
-      while(ulLatLon.lat > 90)
-      {
-         ulLatLon.lat -= theGeographicSpacing.lat;
-      }
-      while(ulLatLon.lon < -180)
-      {
-         ulLatLon.lon += theGeographicSpacing.lon;
-      }
-      while(lrLatLon.lat < -90)
-      {
-         ulLatLon.lat += theGeographicSpacing.lat;
-      }
-      while(lrLatLon.lon > 180)
-      {
-         ulLatLon.lon -= theGeographicSpacing.lon;
-      }
-      
-      ossimDrect latLonSpacing(ulLatLon,
-                               lrLatLon,
-                               OSSIM_RIGHT_HANDED);
-      // do the left side labels
-      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
-      {
-         ossimDpt lipt;
-         ossimDpt ript;
-         ossimGpt lgpt(lat,
-                       latLonSpacing.ul().x,
-                       0.0,
-                       gpt[0].datum());
-         ossimGpt rgpt(lat,
-                       latLonSpacing.ur().x,
-                       0.0,
-                       gpt[0].datum());
-
-         
-         mapProj->worldToLineSample(lgpt, lipt);
-         mapProj->worldToLineSample(rgpt, ript);
-         if(rect.clip(lipt, ript))
-         {
-            ossimIpt rounded(lipt);
-            if( (rounded.y >= rect.ul().y)&&
-                (rounded.y <= rect.lr().y))
-            {
-               if(theLeftGeographicLabelFlag)
-               {
-                  ossimDms dms(lgpt.latd());
-                  
-                  ossimString dmsString = dms.toString(theLeftGeographicFormat.c_str());
-                  ossimAnnotationFontObject* latLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                                      dmsString);
-                  latLabel->setGeometryInformation(theGeographicLeftLabelFontInfo);
-                  latLabel->setFont(theGeographicLeftLabelFont.get());
-//                  latLabel->setFont(theGeographicLeftLabelFont->dup());
-                  
-                  latLabel->computeBoundingRect();
-                  ossimDrect boundsD;
-                  latLabel->getBoundingRect(boundsD);
-                  ossimIrect bounds = boundsD;
-                  
-                  ossimIpt center( ossim::round<int>((rect.ul().x - (bounds.width()/2))),
-                                   rounded.y);
-                  
-                  latLabel->setColor(theLeftGeographicLabelColor.getR(), theLeftGeographicLabelColor.getG(), theLeftGeographicLabelColor.getB());
-                  latLabel->setCenterPosition(center);
-                  latLabel->computeBoundingRect();
-                  latLabel->getBoundingRect(boundsD);
-                  bounds = boundsD;
-
-                  ossimDrect labelRect;
-                  latLabel->getBoundingRect(labelRect);
-                  
-                  if(rect.intersects(labelRect))
-                  {
-                     ossimIrect intersection = rect.clipToRect(labelRect);
-                     center.x -= ossim::round<int>(rect.ul().x - intersection.ur().x);
-                  }
-
-                  center.x -= 24; // this will need to be the tick height later;
-                  latLabel->setCenterPosition(center);
-                  latLabel->computeBoundingRect();
-
-
-                  
-                  addFixedAnnotation(latLabel);
-               }
-               
-               if(theLeftGeographicTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(rect.ul().x),
-                                                                                                rounded.y),
-                                                                                       ossimIpt(ossim::round<int>(rect.ul().x-23),
-                                                                                                rounded.y));
-                  lineLabel->setColor(theLeftGeographicLabelColor.getR(), theLeftGeographicLabelColor.getG(), theLeftGeographicLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-            }
-         }
-      }
-   }
-}
-
-void ossimMapCompositionSource::addGeographicRightGridLabels()
-{
-   if((!theRightGeographicLabelFlag)&&(!theRightGeographicTickFlag))
-   {
-      return;
-   }
-
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   { 
-      ossimGpt gpt[4];
-      ossimDrect rect = getViewingRect();
-
-      if(rect.hasNans()) return;
-      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
-      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
-      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
-      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
-      
-      ossimDrect grect(gpt[0],
-                       gpt[1],
-                       gpt[2],
-                       gpt[3],
-                       OSSIM_RIGHT_HANDED);
-
-      if(grect.hasNans()) return;
-      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-      
-      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-
-      while(ulLatLon.lat > 90)
-      {
-         ulLatLon.lat -= theGeographicSpacing.lat;
-      }
-      while(ulLatLon.lon < -180)
-      {
-         ulLatLon.lon += theGeographicSpacing.lon;
-      }
-      while(lrLatLon.lat < -90)
-      {
-         ulLatLon.lat += theGeographicSpacing.lat;
-      }
-      while(lrLatLon.lon > 180)
-      {
-         ulLatLon.lon -= theGeographicSpacing.lon;
-      }
-      
-      ossimDrect latLonSpacing(ulLatLon,
-                               lrLatLon,
-                               OSSIM_RIGHT_HANDED);
-      // do the left side labels
-      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
-      {
-         ossimDpt lipt;
-         ossimDpt ript;
-         ossimGpt lgpt(lat,
-                       latLonSpacing.ul().x,
-                       0.0,
-                       gpt[0].datum());
-         ossimGpt rgpt(lat,
-                       latLonSpacing.ur().x,
-                       0.0,
-                       gpt[0].datum());
-         
-         
-         mapProj->worldToLineSample(lgpt, lipt);
-         mapProj->worldToLineSample(rgpt, ript);
-         
-         if(rect.clip(lipt, ript))
-         {
-            ossimIpt rounded(ript);
-            if( (rounded.y >= rect.ul().y)&&
-                (rounded.y <= rect.lr().y))
-            {
-               if(theRightGeographicLabelFlag)
-               {
-                  ossimDms dms(rgpt.latd());
-                  
-                  ossimString dmsString = dms.toString(theRightGeographicFormat.c_str());
-                  ossimAnnotationFontObject* latLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                                      dmsString);
-                  latLabel->setGeometryInformation(theGeographicRightLabelFontInfo);
-                  latLabel->setFont(theGeographicRightLabelFont.get());
-//                  latLabel->setFont(theGeographicRightLabelFont->dup());
-                  latLabel->computeBoundingRect();
-                  ossimDrect boundsD;
-                  latLabel->getBoundingRect(boundsD);
-                  ossimIrect bounds = boundsD;
-                  
-                  ossimIpt center( ossim::round<int>((rect.ur().x + (bounds.width()/2))),
-                                   rounded.y);
-               
-                  latLabel->setColor(theRightGeographicLabelColor.getR(), theRightGeographicLabelColor.getG(), theRightGeographicLabelColor.getB());
-                  latLabel->setCenterPosition(center);
-                  latLabel->computeBoundingRect();
-                  latLabel->getBoundingRect(boundsD);
-                  bounds = boundsD;
-
-                  ossimDrect labelRect;
-                  latLabel->getBoundingRect(labelRect);
-                  
-                  if(rect.intersects(labelRect))
-                  {
-                     ossimIrect intersection = rect.clipToRect(labelRect);
-                     center.x -= ossim::round<int>(rect.ur().x - intersection.ul().x);
-                  }
-
-                  center.x += 24; // this will need to be the tick height later;
-                  latLabel->setCenterPosition(center);
-                  latLabel->computeBoundingRect();
-                  
-
-                  addFixedAnnotation(latLabel);
-               }
-               
-               if(theRightGeographicTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(rect.lr().x),
-                                                                                                rounded.y),
-                                                                                       ossimIpt(ossim::round<int>(rect.lr().x+23),
-                                                                                                rounded.y));
-                  
-                  lineLabel->setColor(theRightGeographicLabelColor.getR(), theRightGeographicLabelColor.getG(), theRightGeographicLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-            }
-         }
-      }
-   }
-}
-
-void ossimMapCompositionSource::addGeographicGridLines()
-{
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   { 
-      ossimGpt gpt[4];
-      ossimDrect rect = getViewingRect();
-
-      if(rect.hasNans()) return;
-      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
-      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
-      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
-      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
-      
-      ossimDrect grect(gpt[0],
-                       gpt[1],
-                       gpt[2],
-                       gpt[3],
-                       OSSIM_RIGHT_HANDED);
-
-      if(grect.hasNans()) return;
-      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-      
-      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-
-      while(ulLatLon.lat > 90)
-      {
-         ulLatLon.lat -= theGeographicSpacing.lat;
-      }
-      while(ulLatLon.lon < -180)
-      {
-         ulLatLon.lon += theGeographicSpacing.lon;
-      }
-      while(lrLatLon.lat < -90)
-      {
-         ulLatLon.lat += theGeographicSpacing.lat;
-      }
-      while(lrLatLon.lon > 180)
-      {
-         ulLatLon.lon -= theGeographicSpacing.lon;
-      }
-      
-      ossimDrect latLonSpacing(ulLatLon,
-                               lrLatLon,
-                               OSSIM_RIGHT_HANDED);
-
-
-      for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
-      {
-         ossimDpt tipt; // top
-         ossimDpt bipt; // bottom
-         
-         ossimGpt tgpt(latLonSpacing.ul().y,
-                       lon,
-                       0.0,
-                       gpt[0].datum());
-
-         ossimGpt bgpt(latLonSpacing.lr().y,
-                       lon,
-                       0.0,
-                       gpt[0].datum());
-         
-         mapProj->worldToLineSample(tgpt, tipt);
-         mapProj->worldToLineSample(bgpt, bipt);
-
-         if(rect.clip(tipt, bipt))
-         {
-            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(tipt, bipt);
-            line->setColor(theGeographicGridColor.getR(),
-                           theGeographicGridColor.getG(),
-                           theGeographicGridColor.getB());
-            addFixedAnnotation(line);
-         }
-      }
-      // do the left side labels
-      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
-      {
-         ossimDpt lipt;
-         ossimDpt ript;
-         ossimGpt lgpt(lat,
-                       latLonSpacing.ul().x,
-                       0.0,
-                       gpt[0].datum());
-         ossimGpt rgpt(lat,
-                       latLonSpacing.ur().x,
-                       0.0,
-                       gpt[0].datum());
-
-         mapProj->worldToLineSample(lgpt, lipt);
-         mapProj->worldToLineSample(rgpt, ript);
-         
-         if(rect.clip(lipt, ript))
-         {
-            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(lipt,
-                                                                            ript);
-         
-            line->setColor(theGeographicGridColor.getR(),
-                                theGeographicGridColor.getG(),
-                                theGeographicGridColor.getB());
-         
-            addFixedAnnotation(line);
-         }
-      }
-   }   
-}
-
-void ossimMapCompositionSource::addGeographicGridReseaux()
-{
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   { 
-      ossimGpt gptArray[4];
-      ossimDrect rect = getViewingRect();
-      
-      mapProj->lineSampleToWorld(rect.ul(), gptArray[0]);
-      mapProj->lineSampleToWorld(rect.ur(), gptArray[1]);
-      mapProj->lineSampleToWorld(rect.lr(), gptArray[2]);
-      mapProj->lineSampleToWorld(rect.ll(), gptArray[3]);
-      
-      ossimDrect grect(gptArray[0],
-                       gptArray[1],
-                       gptArray[2],
-                       gptArray[3],
-                       OSSIM_RIGHT_HANDED);
-
-      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-      
-      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
-                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
-      
-      ossimDrect latLonSpacing(ulLatLon,
-                               lrLatLon,
-                               OSSIM_RIGHT_HANDED);
-
-      ossimDpt ipt; // top
-      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
-      {
-         for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
-         {
-            
-            ossimGpt gpt(lat,
-                         lon,
-                         0.0,
-                         gptArray[0].datum());
-            
-            mapProj->worldToLineSample(gpt, ipt);
-
-            ossimIpt rounded(ipt);
-            if(rect.pointWithin(ossimDpt(rounded)))
-            {
-               ossimIpt horizontalStart(rounded.x-10, rounded.y);
-               ossimIpt horizontalEnd(rounded.x+10, rounded.y);
-
-               ossimIpt verticalStart(rounded.x, rounded.y-10);
-               ossimIpt verticalEnd(rounded.x, rounded.y+10);
-               
-               ossimAnnotationLineObject* line1 = new ossimAnnotationLineObject(horizontalStart, horizontalEnd);
-               ossimAnnotationLineObject* line2 = new ossimAnnotationLineObject(verticalStart,verticalEnd);
-
-               line1->setColor(theGeographicGridColor.getR(),
-                               theGeographicGridColor.getG(),
-                               theGeographicGridColor.getB());
-               line2->setColor(theGeographicGridColor.getR(),
-                               theGeographicGridColor.getG(),
-                               theGeographicGridColor.getB());
-               addFixedAnnotation(line1);
-               addFixedAnnotation(line2);
-            }  
-         }
-      }
-   }   
-}
-
-void ossimMapCompositionSource::addMeterGridLines()
-{
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   { 
-      ossimDpt dptArray[4];
-      ossimDrect rect = getViewingRect();
-      
-      mapProj->lineSampleToEastingNorthing(rect.ul(), dptArray[0]);
-      mapProj->lineSampleToEastingNorthing(rect.ur(), dptArray[1]);
-      mapProj->lineSampleToEastingNorthing(rect.lr(), dptArray[2]);
-      mapProj->lineSampleToEastingNorthing(rect.ll(), dptArray[3]);
-      
-      ossimDrect drect(dptArray[0], dptArray[1], dptArray[2], dptArray[3], OSSIM_RIGHT_HANDED);
-      
-      ossimDpt ulMeter(((int)((drect.ul().x-theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
-                       ((int)((drect.ul().y+theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
-      
-      ossimDpt lrMeter(((int)((drect.lr().x+theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
-                        ((int)((drect.lr().y-theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
-      
-      ossimDrect meterSpacing(ulMeter,
-                              lrMeter,
-                              OSSIM_RIGHT_HANDED);
-
-      for(double horizontal = meterSpacing.ul().x;
-          horizontal <= meterSpacing.lr().x;
-          horizontal+=theMeterSpacing.x)
-      {
-         ossimDpt tipt; // top
-         ossimDpt bipt; // bottom
-
-         ossimDpt tdpt(horizontal, meterSpacing.ul().y);
-
-         ossimDpt bdpt(horizontal, meterSpacing.lr().y);
-         
-         mapProj->eastingNorthingToLineSample(tdpt, tipt);
-         mapProj->eastingNorthingToLineSample(bdpt, bipt);
-         
-         if(rect.clip(tipt, bipt))
-         {
-            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(tipt, bipt);
-            line->setColor(theMeterGridColor.getR(),
-                           theMeterGridColor.getG(),
-                           theMeterGridColor.getB());
-            addFixedAnnotation(line);
-         }
-      }
-      // do the left side labels
-      for(double vertical = meterSpacing.ul().y;
-          vertical >= meterSpacing.lr().y;
-          vertical-=theMeterSpacing.y)
-      {
-         ossimDpt lipt;
-         ossimDpt ript;
-         ossimDpt ldpt(meterSpacing.ul().x, vertical);
-         ossimDpt rdpt(meterSpacing.ur().x, vertical);
-
-         mapProj->eastingNorthingToLineSample(ldpt,  lipt);
-         mapProj->eastingNorthingToLineSample(rdpt,  ript);
-         
-         if(rect.clip(lipt, ript))
-         {
-            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(lipt, ript);
-         
-            line->setColor(theMeterGridColor.getR(),
-                           theMeterGridColor.getG(),
-                           theMeterGridColor.getB());
-            
-            addFixedAnnotation(line);
-         }
-      }
-   }
-}
-
-void ossimMapCompositionSource::addMeterGridLabels()
-{
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   {
-      ossimDpt dptArray[4];
-      ossimDrect rect = getViewingRect();
-      
-      mapProj->lineSampleToEastingNorthing(rect.ul(), dptArray[0]);
-      mapProj->lineSampleToEastingNorthing(rect.ur(), dptArray[1]);
-      mapProj->lineSampleToEastingNorthing(rect.lr(), dptArray[2]);
-      mapProj->lineSampleToEastingNorthing(rect.ll(), dptArray[3]);
-      
-      ossimDrect drect(dptArray[0],
-                       dptArray[1],
-                       dptArray[2],
-                       dptArray[3],
-                       OSSIM_RIGHT_HANDED);
-      
-      ossimDpt ulMeter(((int)((drect.ul().x-theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
-                       ((int)((drect.ul().y+theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
-      
-      ossimDpt lrMeter(((int)((drect.lr().x+theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
-                        ((int)((drect.lr().y-theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
-      
-      ossimDrect meterSpacing(ulMeter,
-                              lrMeter,
-                              OSSIM_RIGHT_HANDED);
-      
-      ossimDrect labelRect;
-
-      // Since we support overlapping grid lables.  We will shift
-      // the meter label if there exists a gegraphic label.  To
-      // do this we need to compute an extra shift length based
-      // on the font type on each of the sides.  We could actually make this
-      // shift adjustable later????
-      //
-      long extraTopDelta     = 0;
-      long extraBottomDelta  = 0;
-      long extraLeftDelta    = 0;
-      long extraRightDelta   = 0;
-         
-      if(theTopGeographicLabelFlag&&theGeographicTopLabelFont.valid())
-      {  
-         ossimDms dms(180, false);
-         ossimString dmsString = dms.toString(theTopGeographicFormat.c_str());
-         
-         theGeographicTopLabelFont->setString(dmsString);
-         ossimIrect box;
-         
-         theGeographicTopLabelFont->getBoundingBox(box);
-         extraTopDelta = box.height();
-      }
-      if(theBottomGeographicLabelFlag&&theGeographicBottomLabelFont.valid())
-      {  
-         ossimDms dms(180, false);
-         ossimString dmsString = dms.toString(theBottomGeographicFormat.c_str());
-         theGeographicBottomLabelFont->setString(dmsString);
-         ossimIrect box;
-         
-         theGeographicBottomLabelFont->getBoundingBox(box);
-         extraBottomDelta = box.height();
-      }
-      if(theLeftGeographicLabelFlag&&theGeographicLeftLabelFont.valid())
-      {  
-         ossimDms dms(90.0, true);
-         ossimString dmsString = dms.toString(theLeftGeographicFormat.c_str());
-         theGeographicLeftLabelFont->setString(dmsString);
-         ossimIrect box;
-         
-         theGeographicLeftLabelFont->getBoundingBox(box);
-         extraLeftDelta = box.width();
-      }
-      if(theRightGeographicLabelFlag&&theGeographicRightLabelFont.valid())
-      {  
-         ossimDms dms(90.0, true);
-         ossimString dmsString = dms.toString(theRightGeographicFormat.c_str());
-         
-         theGeographicRightLabelFont->setString(dmsString);
-         ossimIrect box;
-         
-         theGeographicRightLabelFont->getBoundingBox(box);
-         extraRightDelta = box.width();
-      }
-
-      if(theTopMeterLabelFlag || theBottomMeterLabelFlag)
-      {
-         for(double horizontal = meterSpacing.ul().x;
-             horizontal <= meterSpacing.lr().x;
-             horizontal+=theMeterSpacing.x)
-         {
-            ossimDpt tipt; // top
-            ossimDpt bipt; // bottom
-            
-            ossimDpt tdpt(horizontal,
-                          meterSpacing.ul().y);
-            
-            ossimDpt bdpt(horizontal,
-                          meterSpacing.lr().y);
-            
-            mapProj->eastingNorthingToLineSample(tdpt, tipt);
-            mapProj->eastingNorthingToLineSample(bdpt, bipt);
-            
-            rect.clip(tipt, bipt);
-            
-            tipt = ossimIpt(tipt);
-            bipt = ossimIpt(bipt);
-            
-            if(theTopMeterLabelFlag&&rect.clip(tipt, bipt))
-            {
-               ossimAnnotationFontObject* topLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                                   ossimString::toString(horizontal).c_str());
-               
-               
-               topLabel->setFont(theMeterTopLabelFont.get());
-               
-               topLabel->setGeometryInformation(theMeterTopLabelFontInfo);
-               topLabel->computeBoundingRect();
-               ossimDrect boundsTop;
-               topLabel->getBoundingRect(boundsTop);
-               
-               ossimIpt centerTop(ossim::round<int>(tipt.x),
-                                  ossim::round<int>(rect.ul().y-(boundsTop.height()/2)));
-               
-               topLabel->setColor(theTopMeterLabelColor.getR(),
-                                  theTopMeterLabelColor.getG(),
-                                  theTopMeterLabelColor.getB());
-               
-               
-               topLabel->setCenterPosition(centerTop);
-               topLabel->computeBoundingRect();
-               
-               topLabel->getBoundingRect(labelRect);
-               
-               if(rect.intersects(labelRect))
-               {
-                  ossimIrect intersection = rect.clipToRect(labelRect);
-                  centerTop.y -= ossim::round<int>(rect.ul().y - intersection.lr().y);
-               }
-               
-               centerTop.y -= (24+extraTopDelta); // this will need to be the tick height later;
-               topLabel->setCenterPosition(centerTop);
-               topLabel->computeBoundingRect();
-               addFixedAnnotation(topLabel);
-
-               if(theTopMeterTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(tipt.x),
-                                                                                                ossim::round<int>(tipt.y-24)),
-                                                                                       ossimIpt(ossim::round<int>(tipt.x),
-                                                                                                ossim::round<int>(tipt.y)));
-                  
-                  lineLabel->setColor(theTopMeterLabelColor.getR(), theTopMeterLabelColor.getG(), theTopMeterLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-            }
-         // ------------------------- BOTTOM ----------------------------
-            
-            if(theBottomMeterLabelFlag&&rect.pointWithin(bipt))
-            {
-               ossimAnnotationFontObject* bottomLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                                      ossimString::toString(horizontal).c_str());
-               
-               
-               bottomLabel->setFont(theMeterBottomLabelFont.get());
-               
-               bottomLabel->setGeometryInformation(theMeterBottomLabelFontInfo);
-               bottomLabel->computeBoundingRect();
-               ossimDrect boundsBottom;
-               bottomLabel->getBoundingRect(boundsBottom);
-               
-               ossimIpt centerBottom(ossim::round<int>(bipt.x),
-                                     ossim::round<int>(rect.lr().y+(boundsBottom.height()/2)));
-               
-               bottomLabel->setColor(theBottomMeterLabelColor.getR(),
-                                     theBottomMeterLabelColor.getG(),
-                                     theBottomMeterLabelColor.getB());
-               
-               
-               bottomLabel->setCenterPosition(centerBottom);
-               bottomLabel->computeBoundingRect();
-               
-               bottomLabel->getBoundingRect(labelRect);
-               
-               if(rect.intersects(labelRect))
-               {
-                  ossimIrect intersection = rect.clipToRect(labelRect);
-                  centerBottom.y += ossim::round<int>(rect.lr().y - intersection.ul().y);
-               }
-               
-               centerBottom.y += (24+extraBottomDelta); // this will need to be the tick height later;
-               bottomLabel->setCenterPosition(centerBottom);
-               bottomLabel->computeBoundingRect();
-               addFixedAnnotation(bottomLabel);
-               if(theBottomMeterTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(bipt.x),
-                                                                                                ossim::round<int>(bipt.y+24)),
-                                                                                       ossimIpt(ossim::round<int>(bipt.x),
-                                                                                                ossim::round<int>(bipt.y)));
-                  
-                  lineLabel->setColor(theBottomMeterLabelColor.getR(), theBottomMeterLabelColor.getG(), theBottomMeterLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-            }            
-         }
-      }
-      if(theLeftMeterLabelFlag || theRightMeterLabelFlag)
-      {
-         for(double vertical = meterSpacing.ul().y;
-             vertical >= meterSpacing.lr().y;
-             vertical-=theMeterSpacing.y)
-         {
-            ossimDpt lipt;
-            ossimDpt ript;
-            ossimDpt ldpt(meterSpacing.ul().x,
-                          vertical);
-            ossimDpt rdpt(meterSpacing.ur().x,
-                          vertical);
-            
-            mapProj->eastingNorthingToLineSample(ldpt, lipt);
-            mapProj->eastingNorthingToLineSample(rdpt, ript);
-            
-            if(rect.clip(lipt, ript))
-            {
-               //------------------------------------------------ Left label ----------------------------------------------
-               ossimAnnotationFontObject* leftLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                                    ossimString::toString(vertical).c_str());
-               
-               
-               leftLabel->setFont(theMeterLeftLabelFont.get());
-               
-               leftLabel->setGeometryInformation(theMeterLeftLabelFontInfo);
-               leftLabel->computeBoundingRect();
-               ossimDrect boundsLeft;
-               leftLabel->getBoundingRect(boundsLeft);
-               
-               ossimIpt centerLeft(ossim::round<int>(rect.ul().x-(boundsLeft.width()/2)),
-                                   ossim::round<int>(lipt.y));
-                                  
-               
-               leftLabel->setColor(theLeftMeterLabelColor.getR(),
-                                   theLeftMeterLabelColor.getG(),
-                                   theLeftMeterLabelColor.getB());
-               
-               
-               leftLabel->setCenterPosition(centerLeft);
-               leftLabel->computeBoundingRect();
-               
-               leftLabel->getBoundingRect(labelRect);
-               
-               if(rect.intersects(labelRect))
-               {
-                  ossimIrect intersection = rect.clipToRect(labelRect);
-                  centerLeft.x -= ossim::round<int>(intersection.lr().x - rect.ul().x);
-               }
-               
-               centerLeft.x -= (24+extraLeftDelta); // this will need to be the tick height later;
-               leftLabel->setCenterPosition(centerLeft);
-               leftLabel->computeBoundingRect();
-               addFixedAnnotation(leftLabel);
-               if(theLeftMeterTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(lipt.x-24),
-                                                                                                ossim::round<int>(lipt.y)),
-                                                                                       ossimIpt(ossim::round<int>(lipt.x),
-                                                                                                ossim::round<int>(lipt.y)));
-                  
-                  lineLabel->setColor(theLeftMeterLabelColor.getR(), theLeftMeterLabelColor.getG(), theLeftMeterLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-
-               
-               //--------------------------------RIGHT-----------------------------------------------------------
-               ossimAnnotationFontObject* rightLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                                     ossimString::toString(vertical).c_str());
-               
-               
-               rightLabel->setFont(theMeterRightLabelFont.get());
-               
-               rightLabel->setGeometryInformation(theMeterRightLabelFontInfo);
-               rightLabel->computeBoundingRect();
-               ossimDrect boundsRight;
-               rightLabel->getBoundingRect(boundsRight);
-               
-               ossimIpt centerRight(ossim::round<int>(rect.ur().x+(boundsRight.width()/2)),
-                                    ossim::round<int>(ript.y));
-                                  
-               
-               rightLabel->setColor(theRightMeterLabelColor.getR(),
-                                    theRightMeterLabelColor.getG(),
-                                    theRightMeterLabelColor.getB());
-               
-               
-               rightLabel->setCenterPosition(centerRight);
-               rightLabel->computeBoundingRect();
-               
-               rightLabel->getBoundingRect(labelRect);
-               
-               if(rect.intersects(labelRect))
-               {
-                  ossimIrect intersection = rect.clipToRect(labelRect);
-                  centerRight.x += ossim::round<int>(intersection.ul().x - rect.ur().x);
-               }
-               
-               centerRight.x += (24+extraRightDelta); // this will need to be the tick height later;
-               rightLabel->setCenterPosition(centerRight);
-               rightLabel->computeBoundingRect();
-               addFixedAnnotation(rightLabel);
-               if(theRightMeterTickFlag)
-               {
-                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(ript.x+24),
-                                                                                                ossim::round<int>(ript.y)),
-                                                                                       ossimIpt(ossim::round<int>(ript.x),
-                                                                                                ossim::round<int>(ript.y)));
-                  
-                  lineLabel->setColor(theRightMeterLabelColor.getR(), theRightMeterLabelColor.getG(), theRightMeterLabelColor.getB());
-                  addFixedAnnotation(lineLabel);
-               }
-            }
-         }
-      }
-   }
-}
-
-
-void ossimMapCompositionSource::addMeterGridReseaux()
-{
-   const ossimMapProjection* mapProj = inputMapProjection();
-   if(mapProj)
-   { 
-      ossimDpt dpt[4];
-      ossimDrect rect = getViewingRect();
-      
-      mapProj->lineSampleToEastingNorthing(rect.ul(), dpt[0]);
-      mapProj->lineSampleToEastingNorthing(rect.ur(), dpt[1]);
-      mapProj->lineSampleToEastingNorthing(rect.lr(), dpt[2]);
-      mapProj->lineSampleToEastingNorthing(rect.ll(), dpt[3]);
-      
-      ossimDrect drect(dpt[0],
-                       dpt[1],
-                       dpt[2],
-                       dpt[3],
-                       OSSIM_RIGHT_HANDED);
-
-      ossimDpt ulMeter(((int)((drect.ul().x-theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
-                       ((int)((drect.ul().y+theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
-      
-      ossimDpt lrMeter(((int)((drect.lr().x+theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
-                        ((int)((drect.lr().y-theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
-
-      ossimDrect meterSpacing(ulMeter,
-                              lrMeter,
-                              OSSIM_RIGHT_HANDED);
-
-      ossimDpt ipt; // top
-
-      for(double vertical = meterSpacing.ul().y; vertical >= meterSpacing.lr().y; vertical-=theMeterSpacing.y)
-      {
-         for(double horizontal = meterSpacing.ul().x;  horizontal <= meterSpacing.lr().x; horizontal+=theMeterSpacing.x)
-         {            
-            ossimDpt dpt(horizontal,
-                         vertical);
-            
-            mapProj->eastingNorthingToLineSample(dpt, ipt);
-
-            ossimIpt rounded(ipt);
-            if(rect.pointWithin(ossimDpt(rounded)))
-            {
-               ossimIpt horizontalStart(rounded.x-10, rounded.y);
-               ossimIpt horizontalEnd(rounded.x+10, rounded.y);
-
-               ossimIpt verticalStart(rounded.x, rounded.y-10);
-               ossimIpt verticalEnd(rounded.x, rounded.y+10);
-               
-               ossimAnnotationLineObject* line1 = new ossimAnnotationLineObject(horizontalStart, horizontalEnd);
-               ossimAnnotationLineObject* line2 = new ossimAnnotationLineObject(verticalStart,verticalEnd);
-
-               line1->setColor(theMeterGridColor.getR(),
-                               theMeterGridColor.getG(),
-                               theMeterGridColor.getB());
-
-               line2->setColor(theMeterGridColor.getR(),
-                               theMeterGridColor.getG(),
-                               theMeterGridColor.getB());
-               addFixedAnnotation(line1);
-               addFixedAnnotation(line2);
-            }  
-         }
-      }
-   }   
-}
-
-void ossimMapCompositionSource::addTitle()
-{
-   ossimAnnotationFontObject* title = new ossimAnnotationFontObject(ossimIpt(0,0),
-                                                                    theTitleString);
-   title->setGeometryInformation(theTitleFontInfo);
-   title->setFont(theTitleFont.get());
-   title->setColor(theTitleColor.getR(),
-                   theTitleColor.getG(),
-                   theTitleColor.getB());
-   title->setCenterPosition(theTopBorder.midPoint());
-   title->computeBoundingRect();
-
-   addFixedAnnotation(title);
-}
-
-ossimIrect ossimMapCompositionSource::getViewingRect()const
-{
-   ossimIrect result;
-   result.makeNan();
-
-   if(theInputConnection)
-   {
-      result = theInputConnection->getBoundingRect();
-
-      if(!result.hasNans())
-      {
-         ossimIpt mid = result.midPoint();
-         ossim_int32 w = result.width();
-         ossim_int32 h = result.width();
-
-         if(theViewWidthHeight.x >-1)
-         {
-            w = theViewWidthHeight.x;
-         }
-         if(theViewWidthHeight.y >-1)
-         {
-            h = theViewWidthHeight.y;
-         }
-         ossimIpt ul(mid.x - w/2,
-                     mid.y - h/2);
-         
-         result = ossimIrect(ul.x,
-                             ul.y,
-                             ul.x + w-1,
-                             ul.y + h -1);
-      }
-   }
-
-   return result;
-}
-
-void ossimMapCompositionSource::drawAnnotations(
-   ossimRefPtr<ossimImageData> tile)
-{
-   if (!theImage)
-   {
-      return;
-   }
-      
-   theImage->setCurrentImageData(theTile);
-   
-   if(theImage->getImageData().valid())
-   {
-      ossimAnnotationSource::AnnotationObjectListType::iterator object = theFixedAnnotationList.begin();
-      while(object != theFixedAnnotationList.end())
-      {
-         if((*object).valid())
-         {
-            (*object)->draw(*theImage);
-         }
-         ++object;
-      }      
-   }
-   
-   ossimAnnotationSource::drawAnnotations(tile);
-}
-
-void ossimMapCompositionSource::deleteFixedAnnotations()
-{
-   theFixedAnnotationList.clear();
-}
-
-
-void ossimMapCompositionSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid()) return;
-   
-   ossimRefPtr<ossimProperty>        tempProp     = 0;
-   ossimFontProperty*    fontProp     = 0;
-   ossimColorProperty*   colorProp    = 0;
-   ossimBooleanProperty* booleanProp  = 0;
-   
-   if(property->getName() == "Geographic label properties")
-   {
-      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
-                                                       property.get());
-      if(containerProp)
-      {
-         // first set the font format
-         //
-         tempProp = containerProp->getProperty("Top font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setGeographicTopLabelFont(fontProp->getFontInformation());
-         }
-         tempProp = containerProp->getProperty("Bottom font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setGeographicBottomLabelFont(fontProp->getFontInformation());
-         }
-         tempProp = containerProp->getProperty("Left font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setGeographicLeftLabelFont(fontProp->getFontInformation());
-         }
-         tempProp = containerProp->getProperty("Right font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setGeographicRightLabelFont(fontProp->getFontInformation());
-         }
-
-         // set color property
-         tempProp = containerProp->getProperty("Top color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setTopGeographicLabelColor(colorProp->getColor());
-         }
-         tempProp = containerProp->getProperty("Bottom color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setBottomGeographicLabelColor(colorProp->getColor());
-         }
-         tempProp = containerProp->getProperty("Left color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setLeftGeographicLabelColor(colorProp->getColor());
-         }
-         tempProp = containerProp->getProperty("Right color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setRightGeographicLabelColor(colorProp->getColor());
-         }
-
-         // set enable flags
-         tempProp = containerProp->getProperty("Top enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setTopGeographicLabelFlag(booleanProp->getBoolean());
-         }
-
-         tempProp = containerProp->getProperty("Bottom enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setBottomGeographicLabelFlag(booleanProp->getBoolean());
-         }
-
-         tempProp = containerProp->getProperty("Left enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setLeftGeographicLabelFlag(booleanProp->getBoolean());
-         }
-
-         tempProp = containerProp->getProperty("Right enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setRightGeographicLabelFlag(booleanProp->getBoolean());
-         }
-         
-         tempProp = containerProp->getProperty("Top tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setTopGeographicTickMarkFlag(booleanProp->getBoolean());
-         }
-         tempProp = containerProp->getProperty("Bottom tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setBottomGeographicTickMarkFlag(booleanProp->getBoolean());
-         }
-         tempProp = containerProp->getProperty("Left tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setLeftGeographicTickMarkFlag(booleanProp->getBoolean());
-         }
-         tempProp = containerProp->getProperty("Right tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setRightGeographicTickMarkFlag(booleanProp->getBoolean());
-         }
-      }
-   }
-   else if(property->getName() == "Geographic grid properties")
-   {
-      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
-                                                       property.get());
-      if(containerProp)
-      {
-         tempProp = containerProp->getProperty("Grid type");
-         if(tempProp.valid())
-         {
-            ossimString value = tempProp->valueToString();
-
-            if(value == "none")
-            {
-               setGeographicGridType(OSSIM_GRID_NONE);
-            }
-            else if(value == "line")
-            {
-               setGeographicGridType(OSSIM_GRID_LINE);
-            }
-            else if(value == "reseaux")
-            {
-               setGeographicGridType(OSSIM_GRID_RESEAUX);
-            }
-         }
-         tempProp = containerProp->getProperty("Horizontal spacing");
-         if(tempProp.valid())
-         {
-            setGeographicSpacingLon(tempProp->valueToString().toDouble());
-         }
-
-         tempProp = containerProp->getProperty("Vertical spacing");
-         if(tempProp.valid())
-         {
-            setGeographicSpacingLat(tempProp->valueToString().toDouble());
-         }
-
-         tempProp = containerProp->getProperty("Color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(tempProp.valid())
-         {
-            setGeographicGridColor(colorProp->getColor());
-         }
-      }
-   }
-   else if(property->getName() == "Meter label properties")
-   {
-      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
-                                                       property.get());
-      if(containerProp)
-      {
-         // first set the font format
-         //
-         tempProp = containerProp->getProperty("Top font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setMeterTopLabelFont(fontProp->getFontInformation());
-         }
-         tempProp = containerProp->getProperty("Bottom font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setMeterBottomLabelFont(fontProp->getFontInformation());
-         }
-         tempProp = containerProp->getProperty("Left font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setMeterLeftLabelFont(fontProp->getFontInformation());
-         }
-         tempProp = containerProp->getProperty("Right font");
-         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
-         if(fontProp)
-         {
-            setMeterRightLabelFont(fontProp->getFontInformation());
-         }
-
-         // set color property
-         tempProp = containerProp->getProperty("Top color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setTopMeterLabelColor(colorProp->getColor());
-         }
-         tempProp = containerProp->getProperty("Bottom color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setBottomMeterLabelColor(colorProp->getColor());
-         }
-         tempProp = containerProp->getProperty("Left color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setLeftMeterLabelColor(colorProp->getColor());
-         }
-         tempProp = containerProp->getProperty("Right color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(colorProp)
-         {
-            setRightMeterLabelColor(colorProp->getColor());
-         }
-
-         // set enable flags
-         tempProp = containerProp->getProperty("Top enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setTopMeterLabelFlag(booleanProp->getBoolean());
-         }
-
-         tempProp = containerProp->getProperty("Bottom enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setBottomMeterLabelFlag(booleanProp->getBoolean());
-         }
-
-         tempProp = containerProp->getProperty("Left enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setLeftMeterLabelFlag(booleanProp->getBoolean());
-         }
-
-         tempProp = containerProp->getProperty("Right enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setRightMeterLabelFlag(booleanProp->getBoolean());
-         }
-         
-         tempProp = containerProp->getProperty("Top tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setTopMeterTickMarkFlag(booleanProp->getBoolean());
-         }
-         tempProp = containerProp->getProperty("Bottom tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setBottomMeterTickMarkFlag(booleanProp->getBoolean());
-         }
-         tempProp = containerProp->getProperty("Left tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setLeftMeterTickMarkFlag(booleanProp->getBoolean());
-         }
-         tempProp = containerProp->getProperty("Right tick enabled");
-         booleanProp = PTR_CAST(ossimBooleanProperty,
-                                tempProp.get());
-         if(booleanProp)
-         {
-            setRightMeterTickMarkFlag(booleanProp->getBoolean());
-         }
-      }
-   }
-   else if(property->getName() == "Meter grid properties")
-   {
-      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
-                                                       property.get());
-      if(containerProp)
-      {
-         tempProp = containerProp->getProperty("Grid type");
-         if(tempProp.valid())
-         {
-            ossimString value = tempProp->valueToString();
-
-            if(value == "none")
-            {
-               setMeterGridType(OSSIM_GRID_NONE);
-            }
-            else if(value == "line")
-            {
-               setMeterGridType(OSSIM_GRID_LINE);
-            }
-            else if(value == "reseaux")
-            {
-               setMeterGridType(OSSIM_GRID_RESEAUX);
-            }
-         }
-         tempProp = containerProp->getProperty("Horizontal spacing");
-         if(tempProp.valid())
-         {
-            setMeterSpacingX(tempProp->valueToString().toDouble());
-         }
-
-         tempProp = containerProp->getProperty("Vertical spacing");
-         if(tempProp.valid())
-         {
-            setMeterSpacingY(tempProp->valueToString().toDouble());
-         }
-
-         tempProp = containerProp->getProperty("Color");
-         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
-         if(tempProp.valid())
-         {
-            setMeterGridColor(colorProp->getColor());
-         }
-      }
-   }
-   else if(property->getName() == "Title properties")
-   {
-      ossimContainerProperty* container = PTR_CAST(ossimContainerProperty,
-                                                   property.get());
-      if(container)
-      {
-         ossimProperty* titleProp = container->getProperty("Title").get();
-         if(titleProp)
-         {
-            setTitle(titleProp->valueToString());
-         }
-         ossimFontProperty* fontProp = PTR_CAST(ossimFontProperty,
-                                                container->getProperty("Font").get());
-         ossimColorProperty* colorProp = PTR_CAST(ossimColorProperty,
-                                                  container->getProperty("Color").get());
-
-         if(fontProp)
-         {
-            setTitleFont(fontProp->getFontInformation());
-         }
-         if(colorProp)
-         {
-            setTitleColor(colorProp->getColor());
-         }
-      }
-   }
-   else if(property->getName() == "Viewport properties")
-   {
-      ossimContainerProperty* container = PTR_CAST(ossimContainerProperty,
-                                                   property.get());
-      if(container)
-      {
-         int w = -1;
-         int h = -1;
-         tempProp = container->getProperty("Width");
-         if(tempProp.valid())
-         {
-            w = tempProp->valueToString().toInt32();
-         }
-         tempProp = container->getProperty("Height");
-         if(tempProp.valid())
-         {
-            h = tempProp->valueToString().toInt32();
-         }
-         setViewWidthHeight(ossimIpt(w, h));
-      }
-   }
-   else if(property->getName() == "Border color")
-   {
-      colorProp = PTR_CAST(ossimColorProperty,
-                           property.get());
-      if(colorProp)
-      {
-         setBorderColor(colorProp->getColor());
-      }
-   }
-   else if(property->getName() == "Border size")
-   {
-      ossimContainerProperty* container = PTR_CAST(ossimContainerProperty,
-                                                   property.get());
-      if(container)
-      {
-         tempProp = container->getProperty("Top");
-         if(tempProp.valid())
-         {
-            setTopBorderLength(tempProp->valueToString().toInt32());
-            
-         }
-         tempProp = container->getProperty("Bottom");
-         if(tempProp.valid())
-         {
-            setBottomBorderLength(tempProp->valueToString().toInt32());
-            
-         }
-         tempProp = container->getProperty("Left");
-         if(tempProp.valid())
-         {
-            setLeftBorderLength(tempProp->valueToString().toInt32());
-            
-         }
-         tempProp = container->getProperty("Right");
-         if(tempProp.valid())
-         {
-            setRightBorderLength(tempProp->valueToString().toInt32());
-         }
-      }
-   }
-   else
-   {
-      ossimAnnotationSource::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimMapCompositionSource::getProperty(const ossimString& name)const
-{
-   if(name == "Viewport properties")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-
-      container->addChild(new ossimNumericProperty("Width",
-                                                   ossimString::toString(theViewWidthHeight.x),
-                                                   -1,1.0/DBL_EPSILON));
-      container->addChild(new ossimNumericProperty("Height",
-                                                   ossimString::toString(theViewWidthHeight.y),
-                                                   -1,1.0/DBL_EPSILON));
-      container->setCacheRefreshBit();
-      return container;
-   }
-   else if(name == "Geographic label properties")
-   {
-
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      
-      container->addChild(new ossimFontProperty("Top font",
-                                                theGeographicTopLabelFontInfo));
-      container->addChild(new ossimColorProperty("Top color",
-                                                 theTopGeographicLabelColor));
-      container->addChild(new ossimBooleanProperty("Top enabled",
-                                                   theTopGeographicLabelFlag));
-      container->addChild(new ossimBooleanProperty("Top tick enabled",
-                                                   theTopGeographicTickFlag));
-      
-      container->addChild(new ossimFontProperty("Bottom font",
-                                                theGeographicBottomLabelFontInfo));
-      container->addChild(new ossimColorProperty("Bottom color",
-                                                 theBottomGeographicLabelColor));
-      container->addChild(new ossimBooleanProperty("Bottom enabled",
-                                                   theBottomGeographicLabelFlag));
-      container->addChild(new ossimBooleanProperty("Bottom tick enabled",
-                                                   theBottomGeographicTickFlag));
-      
-      container->addChild(new ossimFontProperty("Left font",
-                                                theGeographicLeftLabelFontInfo));
-      container->addChild(new ossimColorProperty("Left color",
-                                                 theLeftGeographicLabelColor));
-      container->addChild(new ossimBooleanProperty("Left enabled",
-                                                   theLeftGeographicLabelFlag));
-      container->addChild(new ossimBooleanProperty("Left tick enabled",
-                                                   theLeftGeographicTickFlag));
-      
-      container->addChild(new ossimFontProperty("Right font",
-                                                theGeographicRightLabelFontInfo));
-      container->addChild(new ossimColorProperty("Right color",
-                                                 theRightGeographicLabelColor));
-      container->addChild(new ossimBooleanProperty("Right enabled",
-                                                   theRightGeographicLabelFlag));
-      container->addChild(new ossimBooleanProperty("Right tick enabled",
-                                                   theRightGeographicTickFlag));
-      container->setCacheRefreshBit();
-      return container;
-   }
-   else if(name == "Geographic grid properties")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      std::vector<ossimString> gridTypeConstraints;
-      ossimString value = GRID_TYPE_ENUM_NAMES[(int)theGeographicGridType];
-
-      gridTypeConstraints.push_back("none");
-      gridTypeConstraints.push_back("line");
-      gridTypeConstraints.push_back("reseaux");
-      
-      container->addChild(new ossimStringProperty("Grid type",
-                                                  value,
-                                                  false,
-                                                  gridTypeConstraints));
-      container->addChild(new ossimColorProperty("Color",
-                                                 theGeographicGridColor));
-
-      container->addChild(new ossimNumericProperty("Horizontal spacing",
-                                                   ossimString::toString(theGeographicSpacing.x),
-                                                   0.0, 180.0));
-
-      container->addChild(new ossimNumericProperty("Vertical spacing",
-                                                   ossimString::toString(theGeographicSpacing.y),
-                                                   0.0, 180.0));
-                                                   
-      container->setCacheRefreshBit();
-      return container;
-   }
-   else if(name == "Meter label properties")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      
-      container->addChild(new ossimFontProperty("Top font",
-                                                theMeterTopLabelFontInfo));
-      container->addChild(new ossimColorProperty("Top color",
-                                                 theTopMeterLabelColor));
-      container->addChild(new ossimBooleanProperty("Top enabled",
-                                                   theTopMeterLabelFlag));
-      container->addChild(new ossimBooleanProperty("Top tick enabled",
-                                                   theTopMeterTickFlag));
-      
-      container->addChild(new ossimFontProperty("Bottom font",
-                                                theMeterBottomLabelFontInfo));
-      container->addChild(new ossimColorProperty("Bottom color",
-                                                 theBottomMeterLabelColor));
-      container->addChild(new ossimBooleanProperty("Bottom enabled",
-                                                   theBottomMeterLabelFlag));
-      container->addChild(new ossimBooleanProperty("Bottom tick enabled",
-                                                   theBottomMeterTickFlag));
-      
-      container->addChild(new ossimFontProperty("Left font",
-                                                theMeterLeftLabelFontInfo));
-      container->addChild(new ossimColorProperty("Left color",
-                                                 theLeftMeterLabelColor));
-      container->addChild(new ossimBooleanProperty("Left enabled",
-                                                   theLeftMeterLabelFlag));
-      container->addChild(new ossimBooleanProperty("Left tick enabled",
-                                                   theLeftMeterTickFlag));
-      
-      container->addChild(new ossimFontProperty("Right font",
-                                                theMeterRightLabelFontInfo));
-      container->addChild(new ossimColorProperty("Right color",
-                                                 theRightMeterLabelColor));
-      container->addChild(new ossimBooleanProperty("Right enabled",
-                                                   theRightMeterLabelFlag));
-      container->addChild(new ossimBooleanProperty("Right tick enabled",
-                                                   theRightMeterTickFlag));
-      
-      container->setCacheRefreshBit();
-      return container;
-   }
-   else if(name == "Meter grid properties")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      std::vector<ossimString> gridTypeConstraints;
-      ossimString value = GRID_TYPE_ENUM_NAMES[(int)theMeterGridType];
-
-      gridTypeConstraints.push_back("none");
-      gridTypeConstraints.push_back("line");
-      gridTypeConstraints.push_back("reseaux");
-      
-      container->addChild(new ossimStringProperty("Grid type",
-                                                  value,
-                                                  false,
-                                                  gridTypeConstraints));
-      container->addChild(new ossimColorProperty("Color",
-                                                 theMeterGridColor));
-      
-      container->addChild(new ossimNumericProperty("Horizontal spacing",
-                                                   ossimString::toString(theMeterSpacing.x),
-                                                   0.0, 1.0/DBL_EPSILON));
-
-      container->addChild(new ossimNumericProperty("Vertical spacing",
-                                                   ossimString::toString(theMeterSpacing.y),
-                                                   0.0, 1.0/DBL_EPSILON));
-      container->setCacheRefreshBit();
-      return container;
-   }
-   else if(name == "Title properties")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      container->addChild(new ossimTextProperty("Title",
-                                                theTitleString));
-      container->addChild(new ossimFontProperty("Font",
-                                                theTitleFontInfo));
-      container->addChild(new ossimColorProperty("Color",
-                                                 theTitleColor));
-      
-      container->setCacheRefreshBit();
-      return container;
-   }
-   else if(name == "Border size")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      
-      container->addChild(new ossimNumericProperty("Top",
-                                                   ossimString::toString(theTopBorderLength),
-                                                   0,10000));
-      container->addChild(new ossimNumericProperty("Bottom",
-                                                   ossimString::toString(theBottomBorderLength),
-                                                   0,10000));
-      container->addChild(new ossimNumericProperty("Left",
-                                                   ossimString::toString(theLeftBorderLength),
-                                                   0,10000));
-      container->addChild(new ossimNumericProperty("Right",
-                                                   ossimString::toString(theRightBorderLength),
-                                                   0,10000));
-      container->setCacheRefreshBit();
-      return container;
-   }
-   else if(name == "Border color")
-   {
-      ossimColorProperty* colorProp = new ossimColorProperty(name,
-                                                             theBorderColor);
-      colorProp->setCacheRefreshBit();
-      
-      return colorProp;
-   }
-   else if(name == "Viewport properties")
-   {
-      
-   }
-   return ossimAnnotationSource::getProperty(name);
-}
-
-void ossimMapCompositionSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimAnnotationSource::getPropertyNames(propertyNames);
-
-   
-   propertyNames.push_back("Title properties");
-   propertyNames.push_back("Border size");
-   propertyNames.push_back("Border color");
-   propertyNames.push_back("Viewport properties");
-   propertyNames.push_back("Geographic label properties");
-   propertyNames.push_back("Geographic grid properties");
-   propertyNames.push_back("Meter label properties");
-   propertyNames.push_back("Meter grid properties");
-}
-
-bool ossimMapCompositionSource::saveState(ossimKeywordlist& kwl,
-                                          const char* prefix)const
-{
-   kwl.add(prefix,
-           VIEW_WIDTH_KW,
-           theViewWidthHeight.x,
-           true);
-   
-   kwl.add(prefix,
-           VIEW_HEIGHT_KW,
-           theViewWidthHeight.x,
-           true);
-   
-   kwl.add(prefix,
-           METER_GRID_SPACING_X_KW,
-           theMeterSpacing.x,
-           true);
-
-   kwl.add(prefix,
-           METER_GRID_SPACING_Y_KW,
-           theMeterSpacing.y,
-           true);
-   
-   kwl.add(prefix,
-           GEO_GRID_SPACING_LON_KW,
-           theGeographicSpacing.lon,
-           true);
-
-   kwl.add(prefix,
-           GEO_GRID_SPACING_LAT_KW,
-           theGeographicSpacing.lat,
-           true);
-
-   ossimString meterGridType = "line";
-   if(theMeterGridType == OSSIM_GRID_NONE)
-   {
-      meterGridType = "none";
-   }
-   else if(theMeterGridType == OSSIM_GRID_RESEAUX)
-   {
-      meterGridType = "reseaux";
-   }
-   
-   kwl.add(prefix,
-           METER_GRID_TYPE_KW,
-           meterGridType.c_str(),
-           true);
-
-   ossimString geoGridType = "line";
-   if(theGeographicGridType == OSSIM_GRID_NONE)
-   {
-      geoGridType = "none";
-   }
-   else if(theGeographicGridType == OSSIM_GRID_RESEAUX)
-   {
-      geoGridType = "reseaux";
-   }
-
-   kwl.add(prefix,
-           GEO_GRID_TYPE_KW,
-           geoGridType.c_str(),
-           true);
-
-   kwl.add(prefix,
-           TOP_BORDER_LENGTH_KW,
-           theTopBorderLength,
-           true);
-   
-   kwl.add(prefix,
-           BOTTOM_BORDER_LENGTH_KW,
-           theBottomBorderLength,
-           true);
-
-   kwl.add(prefix,
-           LEFT_BORDER_LENGTH_KW,
-           theLeftBorderLength,
-           true);
-
-   kwl.add(prefix,
-           RIGHT_BORDER_LENGTH_KW,
-           theRightBorderLength,
-           true);
-
-   kwl.add(prefix,
-           BORDER_COLOR_KW,
-           (ossimString::toString(theBorderColor.getR()) +" "+
-            ossimString::toString(theBorderColor.getG()) +" "+
-            ossimString::toString(theBorderColor.getB())).c_str(),
-           true);
-
-   kwl.add(prefix,
-           GEO_GRID_COLOR_KW,
-           (ossimString::toString(theGeographicGridColor.getR()) +" "+
-            ossimString::toString(theGeographicGridColor.getG()) +" "+
-            ossimString::toString(theGeographicGridColor.getB())).c_str(),
-           true);
-
-   kwl.add(prefix,
-           METER_GRID_COLOR_KW,
-           (ossimString::toString(theMeterGridColor.getR()) +" "+
-            ossimString::toString(theMeterGridColor.getG()) +" "+
-            ossimString::toString(theMeterGridColor.getB())).c_str(),
-           true);
-
-   kwl.add(prefix,
-           TITLE_STRING_KW,
-           theTitleString.c_str(),
-           true);
-   
-   kwl.add(prefix,
-           TITLE_COLOR_KW,
-           (ossimString::toString(theTitleColor.getR()) +" "+
-            ossimString::toString(theTitleColor.getG()) +" "+
-            ossimString::toString(theTitleColor.getB())).c_str(),
-           true);
-
-   kwl.add(prefix,
-           TOP_GEO_LABEL_COLOR_KW,
-           (ossimString::toString(theTopGeographicLabelColor.getR()) +" "+
-            ossimString::toString(theTopGeographicLabelColor.getG()) +" "+
-            ossimString::toString(theTopGeographicLabelColor.getB())).c_str(),
-           true);
-
-   kwl.add(prefix,
-           BOTTOM_GEO_LABEL_COLOR_KW,
-           (ossimString::toString(theBottomGeographicLabelColor.getR()) +" "+
-            ossimString::toString(theBottomGeographicLabelColor.getG()) +" "+
-            ossimString::toString(theBottomGeographicLabelColor.getB())).c_str(),
-           true);
-   kwl.add(prefix,
-           LEFT_GEO_LABEL_COLOR_KW,
-           (ossimString::toString(theLeftGeographicLabelColor.getR()) +" "+
-            ossimString::toString(theLeftGeographicLabelColor.getG()) +" "+
-            ossimString::toString(theLeftGeographicLabelColor.getB())).c_str(),
-           true);
-   kwl.add(prefix,
-           RIGHT_GEO_LABEL_COLOR_KW,
-           (ossimString::toString(theRightGeographicLabelColor.getR()) +" "+
-            ossimString::toString(theRightGeographicLabelColor.getG()) +" "+
-            ossimString::toString(theRightGeographicLabelColor.getB())).c_str(),
-           true);
-
-   kwl.add(prefix,
-           TOP_GEO_LABEL_FORMAT_KW,
-           theTopGeographicFormat,
-           true);
-
-   kwl.add(prefix,
-           BOTTOM_GEO_LABEL_FORMAT_KW,
-           theBottomGeographicFormat,
-           true);
-   kwl.add(prefix,
-           LEFT_GEO_LABEL_FORMAT_KW,
-           theLeftGeographicFormat,
-           true);
-   kwl.add(prefix,
-           RIGHT_GEO_LABEL_FORMAT_KW,
-           theRightGeographicFormat,
-           true);
-
-   kwl.add(prefix,
-           TOP_GEO_LABEL_FLAG_KW,
-           (int)theTopGeographicLabelFlag,
-           true);
-
-   kwl.add(prefix,
-           BOTTOM_GEO_LABEL_FLAG_KW,
-           (int)theBottomGeographicLabelFlag,
-           true);
-
-   kwl.add(prefix,
-           LEFT_GEO_LABEL_FLAG_KW,
-           (int)theLeftGeographicLabelFlag,
-           true);
-
-   kwl.add(prefix,
-           RIGHT_GEO_LABEL_FLAG_KW,
-           (int)theRightGeographicLabelFlag,
-           true);
-
-   kwl.add(prefix,
-           TOP_METER_LABEL_COLOR_KW,
-           (ossimString::toString(theTopMeterLabelColor.getR()) +" "+
-            ossimString::toString(theTopMeterLabelColor.getG()) +" "+
-            ossimString::toString(theTopMeterLabelColor.getB())).c_str(),
-           true);
-
-   kwl.add(prefix,
-           BOTTOM_METER_LABEL_COLOR_KW,
-           (ossimString::toString(theBottomMeterLabelColor.getR()) +" "+
-            ossimString::toString(theBottomMeterLabelColor.getG()) +" "+
-            ossimString::toString(theBottomMeterLabelColor.getB())).c_str(),
-           true);
-   kwl.add(prefix,
-           LEFT_METER_LABEL_COLOR_KW,
-           (ossimString::toString(theLeftMeterLabelColor.getR()) +" "+
-            ossimString::toString(theLeftMeterLabelColor.getG()) +" "+
-            ossimString::toString(theLeftMeterLabelColor.getB())).c_str(),
-           true);
-   kwl.add(prefix,
-           RIGHT_METER_LABEL_COLOR_KW,
-           (ossimString::toString(theRightMeterLabelColor.getR()) +" "+
-            ossimString::toString(theRightMeterLabelColor.getG()) +" "+
-            ossimString::toString(theRightMeterLabelColor.getB())).c_str(),
-           true);
-
-
-   kwl.add(prefix,
-           TOP_METER_LABEL_FLAG_KW,
-           (int)theTopMeterLabelFlag,
-           true);
-
-   kwl.add(prefix,
-           BOTTOM_METER_LABEL_FLAG_KW,
-           (int)theBottomMeterLabelFlag,
-           true);
-
-   kwl.add(prefix,
-           LEFT_METER_LABEL_FLAG_KW,
-           (int)theLeftMeterLabelFlag,
-           true);
-
-   kwl.add(prefix,
-           RIGHT_METER_LABEL_FLAG_KW,
-           (int)theRightMeterLabelFlag,
-           true);
-   
-   theGeographicTopLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(TOP_GEO_LABEL_FONT_KW) + ".").c_str());
-   theGeographicBottomLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(BOTTOM_GEO_LABEL_FONT_KW) + ".").c_str());
-   theGeographicLeftLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(LEFT_GEO_LABEL_FONT_KW) + ".").c_str());
-   theGeographicRightLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(RIGHT_GEO_LABEL_FONT_KW) + ".").c_str());
-
-   theMeterTopLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(TOP_METER_LABEL_FONT_KW) + ".").c_str());
-   theMeterBottomLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(BOTTOM_METER_LABEL_FONT_KW) + ".").c_str());
-   theMeterLeftLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(LEFT_METER_LABEL_FONT_KW) + ".").c_str());
-   theMeterRightLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(RIGHT_METER_LABEL_FONT_KW) + ".").c_str());
-   
-   theTitleFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(TITLE_FONT_KW) + ".").c_str());
-   
-           
-   return ossimImageSource::saveState(kwl, prefix);
-   
-}
-
-bool ossimMapCompositionSource::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   const char* viewWidth            = kwl.find(prefix, VIEW_WIDTH_KW);
-   const char* viewHeight           = kwl.find(prefix, VIEW_HEIGHT_KW);
-   const char* meterGridSpacingX    = kwl.find(prefix, METER_GRID_SPACING_X_KW);
-   const char* meterGridSpacingY    = kwl.find(prefix, METER_GRID_SPACING_Y_KW);
-   const char* geoGridSpacingLon    = kwl.find(prefix, GEO_GRID_SPACING_LON_KW);
-   const char* geoGridSpacingLat    = kwl.find(prefix, GEO_GRID_SPACING_LAT_KW);
-   const char* meterGridType        = kwl.find(prefix, METER_GRID_TYPE_KW);
-   const char* geoGridType          = kwl.find(prefix, GEO_GRID_TYPE_KW);
-   const char* topBorderLength      = kwl.find(prefix, TOP_BORDER_LENGTH_KW);
-   const char* bottomBorderLength   = kwl.find(prefix, BOTTOM_BORDER_LENGTH_KW);
-   const char* leftBorderLength     = kwl.find(prefix, LEFT_BORDER_LENGTH_KW);
-   const char* rightBorderLength    = kwl.find(prefix, RIGHT_BORDER_LENGTH_KW);
-   
-   const char* borderColor          = kwl.find(prefix, BORDER_COLOR_KW);
-   const char* geoGridColor         = kwl.find(prefix, GEO_GRID_COLOR_KW);
-   const char* meterGridColor       = kwl.find(prefix, METER_GRID_COLOR_KW);
-   const char* titleString          = kwl.find(prefix, TITLE_STRING_KW);
-   const char* titleColor           = kwl.find(prefix, TITLE_COLOR_KW);
-
-   const char* topGeoLabelColor     = kwl.find(prefix, TOP_GEO_LABEL_COLOR_KW);
-   const char* bottomGeoLabelColor  = kwl.find(prefix, BOTTOM_GEO_LABEL_COLOR_KW);
-   const char* leftGeoLabelColor    = kwl.find(prefix, LEFT_GEO_LABEL_COLOR_KW);
-   const char* rightGeoLabelColor   = kwl.find(prefix, RIGHT_GEO_LABEL_COLOR_KW);
-
-   const char* topMeterLabelColor     = kwl.find(prefix, TOP_METER_LABEL_COLOR_KW);
-   const char* bottomMeterLabelColor  = kwl.find(prefix, BOTTOM_METER_LABEL_COLOR_KW);
-   const char* leftMeterLabelColor    = kwl.find(prefix, LEFT_METER_LABEL_COLOR_KW);
-   const char* rightMeterLabelColor   = kwl.find(prefix, RIGHT_METER_LABEL_COLOR_KW);
-   
-   const char* topGeoLabelFormat    = kwl.find(prefix, TOP_GEO_LABEL_FORMAT_KW);
-   const char* bottomGeoLabelFormat = kwl.find(prefix, BOTTOM_GEO_LABEL_FORMAT_KW);
-   const char* leftGeoLabelFormat   = kwl.find(prefix, LEFT_GEO_LABEL_FORMAT_KW);
-   const char* rightGeoLabelFormat  = kwl.find(prefix, RIGHT_GEO_LABEL_FORMAT_KW);
-
-   const char* topGeoLabelFlag      = kwl.find(prefix, TOP_GEO_LABEL_FLAG_KW);
-   const char* bottomGeoLabelFlag   = kwl.find(prefix, BOTTOM_GEO_LABEL_FLAG_KW);
-   const char* leftGeoLabelFlag     = kwl.find(prefix, LEFT_GEO_LABEL_FLAG_KW);
-   const char* rightGeoLabelFlag    = kwl.find(prefix, RIGHT_GEO_LABEL_FLAG_KW);
-
-   const char* topMeterLabelFlag    = kwl.find(prefix, TOP_METER_LABEL_FLAG_KW);
-   const char* bottomMeterLabelFlag = kwl.find(prefix, BOTTOM_METER_LABEL_FLAG_KW);
-   const char* leftMeterLabelFlag   = kwl.find(prefix, LEFT_METER_LABEL_FLAG_KW);
-   const char* rightMeterLabelFlag  = kwl.find(prefix, RIGHT_METER_LABEL_FLAG_KW);
-
-   deleteFixedAnnotations();
-   theViewWidthHeight.makeNan();
-   
-   if(viewWidth)
-   {
-      theViewWidthHeight.x = ossimString(viewWidth).toLong();
-   }
-   if(viewHeight)
-   {
-      theViewWidthHeight.y = ossimString(viewHeight).toLong();
-   }
-   
-   if(meterGridSpacingX)
-   {
-      theMeterSpacing.x = ossimString(meterGridSpacingX).toDouble();
-   }
-
-   if(meterGridSpacingY)
-   {
-      theMeterSpacing.y = ossimString(meterGridSpacingY).toDouble();
-   }
-   if(geoGridSpacingLon)
-   {
-      theGeographicSpacing.lon = ossimString(geoGridSpacingLon).toDouble();
-   }
-   if(geoGridSpacingLat)
-   {
-      theGeographicSpacing.lat = ossimString(geoGridSpacingLat).toDouble();
-   }
-   if(meterGridType)
-   {
-      ossimString type = ossimString(meterGridType).trim().downcase();
-      if(type == "reseaux")
-      {
-         theMeterGridType = OSSIM_GRID_RESEAUX;
-      }
-      else if(type == "line")
-      {
-         theMeterGridType = OSSIM_GRID_LINE;
-      }
-      else
-      {
-         theMeterGridType = OSSIM_GRID_NONE;
-      }
-   }
-
-   if(geoGridType)
-   {
-      ossimString type = ossimString(geoGridType).trim().downcase();
-      if(type == "reseaux")
-      {
-         theGeographicGridType = OSSIM_GRID_RESEAUX;
-      }
-      else if(type == "line")
-      {
-         theGeographicGridType = OSSIM_GRID_LINE;
-      }
-      else
-      {
-         theGeographicGridType = OSSIM_GRID_NONE;
-      }
-   }
-
-   if(topBorderLength)
-   {
-      theTopBorderLength = ossimString(topBorderLength).toULong();
-   }
-
-   if(bottomBorderLength)
-   {
-      theBottomBorderLength = ossimString(bottomBorderLength).toULong();
-   }
-   if(leftBorderLength)
-   {
-      theLeftBorderLength = ossimString(leftBorderLength).toULong();
-   }
-   if(rightBorderLength)
-   {
-      theRightBorderLength = ossimString(rightBorderLength).toULong();
-   }
-
-   if(borderColor)
-   {
-      istringstream in(borderColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-
-      theBorderColor = ossimRgbVector((ossim_uint8)r.toUInt32(), 
-                                      (ossim_uint8)g.toUInt32(), 
-                                      (ossim_uint8)b.toUInt32());
-   }
-
-   if(geoGridColor)
-   {
-      istringstream in(geoGridColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theGeographicGridColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(meterGridColor)
-   {
-      istringstream in(meterGridColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theMeterGridColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());      
-   }
-
-   if(titleString)
-   {
-      theTitleString = titleString;
-   }
-   
-   if(titleColor)
-   {
-      istringstream in(titleColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      
-      theTitleColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(topGeoLabelColor)
-   {
-      istringstream in(topGeoLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theTopGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(bottomGeoLabelColor)
-   {
-      istringstream in(bottomGeoLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theBottomGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(leftGeoLabelColor)
-   {
-      istringstream in(leftGeoLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-
-      theLeftGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(rightGeoLabelColor)
-   {
-      istringstream in(rightGeoLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theRightGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-
-/////
-   if(topMeterLabelColor)
-   {
-      istringstream in(topMeterLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theTopMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(bottomMeterLabelColor)
-   {
-      istringstream in(bottomMeterLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theBottomMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(leftMeterLabelColor)
-   {
-      istringstream in(leftMeterLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theLeftMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(rightMeterLabelColor)
-   {
-      istringstream in(rightMeterLabelColor);
-
-      ossimString r;
-      ossimString g;
-      ossimString b;
-      in >> r >> g >> b;
-      
-      theRightMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
-   }
-
-   if(topGeoLabelFormat)
-   {
-      theTopGeographicFormat = topGeoLabelFormat;
-   }
-   
-   if(bottomGeoLabelFormat)
-   {
-      theBottomGeographicFormat = bottomGeoLabelFormat;
-   }
-   
-   if(leftGeoLabelFormat)
-   {
-      theLeftGeographicFormat = leftGeoLabelFormat;
-   }
-   
-   if(rightGeoLabelFormat)
-   {
-      theRightGeographicFormat = rightGeoLabelFormat;
-   }
-
-   if(topGeoLabelFlag)
-   {
-      theTopGeographicLabelFlag = ossimString(topGeoLabelFlag).toBool();
-   }
-   if(bottomGeoLabelFlag)
-   {
-      theBottomGeographicLabelFlag = ossimString(bottomGeoLabelFlag).toBool();
-   }
-   if(leftGeoLabelFlag)
-   {
-      theLeftGeographicLabelFlag = ossimString(leftGeoLabelFlag).toBool();
-   }
-   if(rightGeoLabelFlag)
-   {
-      theRightGeographicLabelFlag = ossimString(rightGeoLabelFlag).toBool();
-   }
-
-   if(topMeterLabelFlag)
-   {
-      theTopMeterLabelFlag = ossimString(topMeterLabelFlag).toBool();
-   }
-   if(bottomMeterLabelFlag)
-   {
-      theBottomMeterLabelFlag = ossimString(bottomMeterLabelFlag).toBool();
-   }
-   if(leftMeterLabelFlag)
-   {
-      theLeftMeterLabelFlag = ossimString(leftMeterLabelFlag).toBool();
-   }
-   if(rightMeterLabelFlag)
-   {
-      theRightMeterLabelFlag = ossimString(rightMeterLabelFlag).toBool();
-   }
-   
-   theGeographicTopLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(TOP_GEO_LABEL_FONT_KW) + ".").c_str());
-   theGeographicBottomLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(BOTTOM_GEO_LABEL_FONT_KW) + ".").c_str());
-   theGeographicLeftLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(LEFT_GEO_LABEL_FONT_KW) + ".").c_str());
-   theGeographicRightLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(RIGHT_GEO_LABEL_FONT_KW) + ".").c_str());
-
-   theMeterTopLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(TOP_METER_LABEL_FONT_KW) + ".").c_str());
-   theMeterBottomLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(BOTTOM_METER_LABEL_FONT_KW) + ".").c_str());
-   theMeterLeftLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(LEFT_METER_LABEL_FONT_KW) + ".").c_str());
-   theMeterRightLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(RIGHT_METER_LABEL_FONT_KW) + ".").c_str());
-   
-   theTitleFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(TITLE_FONT_KW) + ".").c_str());
-   theTitleFont = ossimFontFactoryRegistry::instance()->createFont(theTitleFontInfo);
-   theGeographicTopLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicTopLabelFontInfo);
-   theGeographicBottomLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicBottomLabelFontInfo);
-   theGeographicLeftLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicLeftLabelFontInfo);
-   theGeographicRightLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicRightLabelFontInfo);
-
-   theMeterTopLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterTopLabelFontInfo);
-   theMeterBottomLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterBottomLabelFontInfo);
-   theMeterLeftLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterLeftLabelFontInfo);
-   theMeterRightLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterRightLabelFontInfo);
-   
-   vector<ossimFontInformation> info;
-
-   
-   if(!theTitleFont)
-   {
-      theTitleFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theTitleFont->getFontInformation(info);
-      theTitleFontInfo = info[0];
-   }
-   if(!theGeographicTopLabelFont)
-   {
-      info.clear();
-      theGeographicTopLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theGeographicTopLabelFont->getFontInformation(info);
-      theGeographicTopLabelFontInfo = info[0];
-   }
-   if(!theGeographicBottomLabelFont)
-   {
-      info.clear();
-      theGeographicBottomLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theGeographicBottomLabelFont->getFontInformation(info);
-      theGeographicBottomLabelFontInfo = info[0];
-   }
-   if(!theGeographicLeftLabelFont)
-   {
-      info.clear();
-      theGeographicLeftLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theGeographicLeftLabelFont->getFontInformation(info);
-      theGeographicLeftLabelFontInfo = info[0];
-   }
-   if(!theGeographicRightLabelFont)
-   {
-      info.clear();
-      theGeographicRightLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theGeographicRightLabelFont->getFontInformation(info);
-      theGeographicRightLabelFontInfo = info[0];
-   }
-
-   if(!theMeterTopLabelFont)
-   {
-      info.clear();
-      theMeterTopLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theMeterTopLabelFont->getFontInformation(info);
-      theMeterTopLabelFontInfo = info[0];
-   }
-   if(!theMeterBottomLabelFont)
-   {
-      info.clear();
-      theMeterBottomLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theMeterBottomLabelFont->getFontInformation(info);
-      theMeterBottomLabelFontInfo = info[0];
-   }
-   if(!theMeterLeftLabelFont)
-   {
-      info.clear();
-      theMeterLeftLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theMeterLeftLabelFont->getFontInformation(info);
-      theMeterLeftLabelFontInfo = info[0];
-   }
-   if(!theMeterRightLabelFont)
-   {
-      info.clear();
-      theMeterRightLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
-      theMeterRightLabelFont->getFontInformation(info);
-      theMeterRightLabelFontInfo = info[0];
-   }
-
-   bool result =  ossimAnnotationSource::loadState(kwl,
-                                                   prefix);
-   layoutAnnotations();
-
-   return result;
-}
-
-ossimScalarType ossimMapCompositionSource::getOutputScalarType() const
-{
-   return OSSIM_UCHAR;
-}
-
-ossim_uint32 ossimMapCompositionSource::getNumberOfOutputBands() const
-{
-   return 3;
-}
-
-ossimIpt ossimMapCompositionSource::getViewWidthHeight()const
-{
-   return theViewWidthHeight;
-}
-
-void ossimMapCompositionSource::getViewWidthHeight(ossimIpt& widthHeight)const
-{
-   widthHeight = theViewWidthHeight;
-}
-
-void ossimMapCompositionSource::setViewWidthHeight(const ossimIpt& widthHeight)
-{
-   theViewWidthHeight = widthHeight;
-}
-
-ossim_int32 ossimMapCompositionSource::getTopBorderLength()const
-{
-   return theTopBorderLength;
-}
-
-ossim_int32 ossimMapCompositionSource::getBottomBorderLength()const
-{
-   return theBottomBorderLength;
-}
-
-ossim_int32 ossimMapCompositionSource::getLeftBorderLength()const
-{
-   return theLeftBorderLength;
-}
-
-ossim_int32 ossimMapCompositionSource::getRightBorderLength()const
-{
-   return theRightBorderLength;
-}
-
-void ossimMapCompositionSource::setTopBorderLength(ossim_int32 length)
-{
-   theTopBorderLength = length;
-}
-
-void ossimMapCompositionSource::setBottomBorderLength(ossim_int32 length)
-{
-   theBottomBorderLength = length;
-}
-
-void ossimMapCompositionSource::setLeftBorderLength(ossim_int32 length)
-{
-   theLeftBorderLength = length;
-}
-
-void ossimMapCompositionSource::setRightBorderLength(ossim_int32 length)
-{
-   theRightBorderLength = length;
-}
-
-void ossimMapCompositionSource::setGeographicSpacingLat(double value)
-{
-   theGeographicSpacing.lat = value;
-}
-
-void ossimMapCompositionSource::setGeographicSpacingLon(double value)
-{
-   theGeographicSpacing.lon = value;
-}
-
-void ossimMapCompositionSource::setMeterSpacingX(double value)
-{
-   theMeterSpacing.x = value;
-}
-
-void ossimMapCompositionSource::setMeterSpacingY(double value)
-{
-   theMeterSpacing.y = value;
-}
-
-void ossimMapCompositionSource::setMeterSpacing(double x, double y)
-{
-   theMeterSpacing.x = x;
-   theMeterSpacing.y = y;
-}
-
-void ossimMapCompositionSource::setGeographicSpacing(double lat, double lon)
-{
-   theGeographicSpacing.lat = lat;
-   theGeographicSpacing.lon = lon;
-}
-
-ossimDpt ossimMapCompositionSource::getGeographicSpacing()const
-{
-   return theGeographicSpacing;
-}
-
-ossimDpt ossimMapCompositionSource::getMeterSpacing()const
-{
-   return theMeterSpacing;
-}
-
-ossimString ossimMapCompositionSource::getTopGeographicLabelFormat()const
-{
-   return theTopGeographicFormat;
-}
-
-ossimString ossimMapCompositionSource::getBottomGeographicLabelFormat()const
-{
-   return theBottomGeographicFormat;
-}
-
-ossimString ossimMapCompositionSource::getLeftGeographicLabelFormat()const
-{
-   return theLeftGeographicFormat;
-}
-
-ossimString ossimMapCompositionSource::getRightGeographicLabelFormat()const
-{
-   return theRightGeographicFormat;
-}
-
-ossimString ossimMapCompositionSource::getTitle()const
-{
-   return theTitleString;
-}
-
-ossimRgbVector ossimMapCompositionSource::getTitleColor()const
-{
-   return theTitleColor;
-}
-
-void ossimMapCompositionSource::setTitleColor(const ossimRgbVector& color)
-{
-   if(theTitleColor != color)
-   {
-      theTitleColor = color;
-   }
-}
-
-void ossimMapCompositionSource::setTitle(const ossimString& s)
-{
-   if(theTitleString != s)
-   {
-      theTitleString = s;
-   }
-         
-}
-
-ossimFontInformation ossimMapCompositionSource::getTitleFont()const
-{
-   return theTitleFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getGeographicTopLabelFontInfo()const
-{
-   return theGeographicTopLabelFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getGeographicBottomLabelFontInfo()const
-{
-   return theGeographicBottomLabelFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getGeographicLeftLabelFontInfo()const
-{
-   return theGeographicLeftLabelFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getGeographicRightLabelFontInfo()const
-{
-   return theGeographicRightLabelFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getMeterTopLabelFontInfo()const
-{
-   return theMeterTopLabelFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getMeterBottomLabelFontInfo()const
-{
-   return theMeterBottomLabelFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getMeterLeftLabelFontInfo()const
-{
-   return theMeterLeftLabelFontInfo;
-}
-
-ossimFontInformation ossimMapCompositionSource::getMeterRightLabelFontInfo()const
-{
-   return theMeterRightLabelFontInfo;
-}
-   
-ossimRgbVector ossimMapCompositionSource::getBorderColor()const
-{
-   return theBorderColor;
-}
-
-void ossimMapCompositionSource::setBorderColor(const ossimRgbVector& color)
-{
-   theBorderColor=color;
-}
-
-ossimRgbVector ossimMapCompositionSource::getGeographicGridColor()const
-{
-   return theGeographicGridColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getMeterGridColor()const
-{
-   return theMeterGridColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getTopGeographicLabelColor()const
-{
-   return theTopGeographicLabelColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getBottomGeographicLabelColor()const
-{
-   return theBottomGeographicLabelColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getLeftGeographicLabelColor()const
-{
-   return theLeftGeographicLabelColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getRightGeographicLabelColor()const
-{
-   return theRightGeographicLabelColor;
-}
-
-void ossimMapCompositionSource::setGeographicGridColor(const ossimRgbVector& color)
-{
-   theGeographicGridColor = color;
-}
-
-void ossimMapCompositionSource::setTopGeographicLabelColor(const ossimRgbVector& color)
-{
-   theTopGeographicLabelColor = color;
-}
-
-void ossimMapCompositionSource::setBottomGeographicLabelColor(const ossimRgbVector& color)
-{
-   theBottomGeographicLabelColor = color;
-}
-
-void ossimMapCompositionSource::setLeftGeographicLabelColor(const ossimRgbVector& color)
-{
-   theLeftGeographicLabelColor = color;
-}
-
-void ossimMapCompositionSource::setRightGeographicLabelColor(const ossimRgbVector& color)
-{
-   theRightGeographicLabelColor = color;
-}
-
-void ossimMapCompositionSource::setGeographicLabelColor(const ossimRgbVector& color)
-{
-   setTopGeographicLabelColor(color);
-   setBottomGeographicLabelColor(color);
-   setLeftGeographicLabelColor(color);
-   setRightGeographicLabelColor(color);
-}
-
-ossimRgbVector ossimMapCompositionSource::getTopMeterLabelColor()const
-{
-   return theTopMeterLabelColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getBottomMeterLabelColor()const
-{
-   return theBottomMeterLabelColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getLeftMeterLabelColor()const
-{
-   return theLeftMeterLabelColor;
-}
-
-ossimRgbVector ossimMapCompositionSource::getRightMeterLabelColor()const
-{
-   return theRightMeterLabelColor;
-}
-   
-void ossimMapCompositionSource::setTopMeterLabelColor(const ossimRgbVector& color)
-{
-   theTopMeterLabelColor = color;
-}
-
-void ossimMapCompositionSource::setBottomMeterLabelColor(const ossimRgbVector& color)
-{
-   theBottomMeterLabelColor = color;
-}
-
-void ossimMapCompositionSource::setLeftMeterLabelColor(const ossimRgbVector& color)
-{
-   theLeftMeterLabelColor = color;
-}
-
-void ossimMapCompositionSource::setRightMeterLabelColor(const ossimRgbVector& color)
-{
-   theRightMeterLabelColor = color;
-}
-
-void ossimMapCompositionSource::setMeterLabelColor(const ossimRgbVector& color)
-{
-   setTopMeterLabelColor(color);
-   setBottomMeterLabelColor(color);
-   setLeftMeterLabelColor(color);
-   setRightMeterLabelColor(color);
-}
-   
-void ossimMapCompositionSource::setMeterGridColor(const ossimRgbVector& color)
-{
-   theMeterGridColor = color;
-}
-
-void ossimMapCompositionSource::setMeterGridType(ossimGridLineType gridType)
-{
-   theMeterGridType = gridType;
-}
-
-void ossimMapCompositionSource::setGeographicGridType(ossimGridLineType gridType)
-{
-   theGeographicGridType = gridType;
-}
-
-void ossimMapCompositionSource::setBorderColor(ossimRgbVector& color)
-{
-   theBorderColor = color;
-}
-
-ossimMapCompositionSource::ossimGridLineType ossimMapCompositionSource::getGeographicGridType()const
-{
-   return theGeographicGridType;
-}
-
-ossimMapCompositionSource::ossimGridLineType ossimMapCompositionSource::getMeterGridType()const
-{
-   return theMeterGridType;
-}
- 
-void ossimMapCompositionSource::setGeographicTickMarkFlag(bool flag)
-{
-   setTopGeographicTickMarkFlag(flag);
-   setBottomGeographicTickMarkFlag(flag);
-   setLeftGeographicTickMarkFlag(flag);
-   setRightGeographicTickMarkFlag(flag);
-}
-
-void ossimMapCompositionSource::setTopGeographicTickMarkFlag(bool flag)
-{
-   theTopGeographicTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setBottomGeographicTickMarkFlag(bool flag)
-{
-   theBottomGeographicTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setLeftGeographicTickMarkFlag(bool flag)
-{
-   theLeftGeographicTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setRightGeographicTickMarkFlag(bool flag)
-{
-   theRightGeographicTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setTopGeographicLabelFlag(bool flag)
-{
-   theTopGeographicLabelFlag = flag;
-}
-
-void ossimMapCompositionSource::setBottomGeographicLabelFlag(bool flag)
-{
-   theBottomGeographicLabelFlag = flag;
-}
-
-void ossimMapCompositionSource::setLeftGeographicLabelFlag(bool flag)
-{
-   theLeftGeographicLabelFlag = flag;
-}
-
-void ossimMapCompositionSource::setRightGeographicLabelFlag(bool flag)
-{
-   theRightGeographicLabelFlag = flag;
-}
-
-bool ossimMapCompositionSource::getTopGeographicTickMarkFlag()const
-{
-   return theTopGeographicTickFlag;
-}
-
-bool ossimMapCompositionSource::getBottomGeographicTickMarkFlag()const
-{
-   return theBottomGeographicTickFlag;
-}
-
-bool ossimMapCompositionSource::getLeftGeographicTickMarkFlag()const
-{
-   return theLeftGeographicTickFlag;
-}
-
-bool ossimMapCompositionSource::getRightGeographicTickMarkFlag()const
-{
-   return theRightGeographicTickFlag;
-}
-
-bool ossimMapCompositionSource::getTopGeographicLabelFlag()const
-{
-   return theTopGeographicLabelFlag;
-}
-
-bool ossimMapCompositionSource::getBottomGeographicLabelFlag()const
-{
-   return theBottomGeographicLabelFlag;
-}
-
-bool ossimMapCompositionSource::getLeftGeographicLabelFlag()const
-{
-   return theLeftGeographicLabelFlag;
-}
-
-bool ossimMapCompositionSource::getRightGeographicLabelFlag()const
-{
-   return theRightGeographicLabelFlag;
-}
-
-void ossimMapCompositionSource::setMeterTickMarkFlag(bool flag)
-{
-   setTopMeterTickMarkFlag(flag);
-   setBottomMeterTickMarkFlag(flag);
-   setLeftMeterTickMarkFlag(flag);
-   setRightMeterTickMarkFlag(flag);
-}
-
-void ossimMapCompositionSource::setTopMeterTickMarkFlag(bool flag)
-{
-   theTopMeterTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setBottomMeterTickMarkFlag(bool flag)
-{
-   theBottomMeterTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setLeftMeterTickMarkFlag(bool flag)
-{
-   theLeftMeterTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setRightMeterTickMarkFlag(bool flag)
-{
-   theRightMeterTickFlag = flag;
-}
-
-void ossimMapCompositionSource::setTopMeterLabelFlag(bool flag)
-{
-   theTopMeterLabelFlag = flag;
-}
-
-void ossimMapCompositionSource::setBottomMeterLabelFlag(bool flag)
-{
-   theBottomMeterLabelFlag = flag;
-}
-
-void ossimMapCompositionSource::setLeftMeterLabelFlag(bool flag)
-{
-   theLeftMeterLabelFlag = flag;
-}
-
-void ossimMapCompositionSource::setRightMeterLabelFlag(bool flag)
-{
-   theRightMeterLabelFlag = flag;
-}
-   
-bool ossimMapCompositionSource::getTopMeterTickMarkFlag()const
-{
-   return theTopMeterTickFlag;
-}
-
-bool ossimMapCompositionSource::getBottomMeterTickMarkFlag()const
-{
-   return theBottomMeterTickFlag;
-}
-
-bool ossimMapCompositionSource::getLeftMeterTickMarkFlag()const
-{
-   return theLeftMeterTickFlag;
-}
-
-bool ossimMapCompositionSource::getRightMeterTickMarkFlag()const
-{
-   return theRightMeterTickFlag;
-}
-
-bool ossimMapCompositionSource::getTopMeterLabelFlag()const
-{
-   return theTopMeterLabelFlag;
-}
-
-bool ossimMapCompositionSource::getBottomMeterLabelFlag()const
-{
-   return theBottomMeterLabelFlag;
-}
-
-bool ossimMapCompositionSource::getLeftMeterLabelFlag()const
-{
-   return theLeftMeterLabelFlag;
-}
-
-bool ossimMapCompositionSource::getRightMeterLabelFlag()const
-{
-   return theRightMeterLabelFlag;
-}
-
-void ossimMapCompositionSource::addFixedAnnotation(ossimAnnotationObject* obj)
-{
-   if(obj)
-   {
-      theFixedAnnotationList.push_back(obj);
-   }
-}
-
-//**************************************************************************************************
-//! Fetches the input connection's image geometry and verifies that it is a map projection.
-//! Returns NULL if no valid projection found.
-//**************************************************************************************************
-const ossimMapProjection* ossimMapCompositionSource::inputMapProjection() const
-{
-   if (!theInputConnection)
-      return 0;
-
-   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
-   if (!inputGeom)
-      return 0;
-
-   return PTR_CAST(ossimMapProjection, inputGeom->getProjection());
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimMaskFilter.cpp b/ossim/src/ossim/imaging/ossimMaskFilter.cpp
deleted file mode 100644
index 63d0bd5..0000000
--- a/ossim/src/ossim/imaging/ossimMaskFilter.cpp
+++ /dev/null
@@ -1,863 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// Modified by: Elan Sharghi (1/20/2009)
-// Description: Class definition for ossimMaskFilter.
-//
-//*************************************************************************
-// $Id: ossimMaskFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimMaskFilter.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-
-static const char * MASK_FILTER_MASK_TYPE_KW = "mask_type";
-
-RTTI_DEF1(ossimMaskFilter, "ossimMaskFilter", ossimImageSource);
-
-ossimMaskFilter::ossimMaskFilter(ossimObject* owner)
-   :
-   ossimImageSource(owner, 1, 1, true, false),
-   theMaskType(OSSIM_MASK_TYPE_SELECT),
-   theTile(0)
-{
-}
-
-ossimMaskFilter::~ossimMaskFilter()
-{
-}
-
-//*************************************************************************************************
-void ossimMaskFilter::setMaskSource(ossimImageSource* maskSource)
-{
-   theMaskSource = maskSource;
-}
-
-ossimRefPtr<ossimImageData> ossimMaskFilter::getTile(const ossimIrect& rect,
-                                                     ossim_uint32 resLevel)
-{
-   ossimImageSource* imageSource = PTR_CAST(ossimImageSource, getInput(0));
-   if (!imageSource || !theMaskSource.valid())
-   {
-      ossimRefPtr<ossimImageData>();
-      return theTile;
-   }
-
-   ossimRefPtr<ossimImageData> imageSourceData;
-   ossimRefPtr<ossimImageData> maskSourceData;
-   
-   imageSourceData = imageSource->getTile(rect, resLevel);
-   if(!isSourceEnabled())
-      return imageSourceData;
-   
-   if (!theTile.valid())
-      allocate();
-
-   maskSourceData = theMaskSource->getTile(rect, resLevel);
-   if(!imageSourceData.valid() || !theTile.valid())
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-   
-   theTile->setOrigin(rect.ul());
-   if(theTile->getImageRectangle() != rect)
-   {
-      theTile->setImageRectangle(rect);
-      theTile->initialize();
-   }
-   if(!imageSourceData.valid())
-   {
-      return theTile;
-   }
-   if(!maskSourceData.valid()) 
-   {
-      return imageSourceData;
-   }
-   
-   if(imageSourceData->getDataObjectStatus() != OSSIM_NULL)
-   {
-      return executeMaskFilter(imageSourceData, maskSourceData);  
-   }
-   
-   return theTile;
-}
-
-bool ossimMaskFilter::canConnectMyInputTo(ossim_int32 /* index */,
-                                          const ossimConnectableObject* object)const
-{
-   return (PTR_CAST(ossimImageSource, object)!= 0);
-}
-
-void ossimMaskFilter::initialize()
-{
-   if(getInput(0))
-   {
-      // Force an allocate on the next getTile.
-      theTile = 0;
-   }
-}
-
-void ossimMaskFilter::allocate()
-{
-   if(getInput())
-   {
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilter(
-   ossimRefPtr<ossimImageData> imageSourceData,
-   ossimRefPtr<ossimImageData> maskSourceData)
-{
-   if(!theTile)
-   {
-      theTile = (ossimImageData*)imageSourceData->dup();
-      if(!theTile->getBuf())
-      {
-         theTile->initialize();
-      }
-   }
-   else
-   {
-      ossim_uint32 tw = theTile->getWidth();
-      ossim_uint32 th = theTile->getHeight();
-      ossim_uint32 dw = imageSourceData->getWidth();
-      ossim_uint32 dh = imageSourceData->getHeight();
-      
-      theTile->setWidthHeight(imageSourceData->getWidth(),
-			      imageSourceData->getHeight());
-      theTile->setOrigin(imageSourceData->getOrigin());
-      if((tw*th) != (dw*dh))
-      {
-         theTile->initialize();
-      }
-      theTile->setDataObjectStatus(imageSourceData->getDataObjectStatus());
-   }
-   theTile->loadTile(imageSourceData.get());
-   theTile->setDataObjectStatus(imageSourceData->getDataObjectStatus());
-   switch(theMaskType)
-   {
-      case OSSIM_MASK_TYPE_SELECT:
-      case OSSIM_MASK_TYPE_SELECT_CLAMP_MIN:
-      {
-         return executeMaskFilterSelect(theTile, maskSourceData);
-      }
-      case OSSIM_MASK_TYPE_INVERT:
-      {
-         return executeMaskFilterInvertSelect(theTile, maskSourceData);
-      }
-      case OSSIM_MASK_TYPE_WEIGHTED:
-      {
-         return executeMaskFilterWeighted(theTile, maskSourceData);
-      }
-      case OSSIM_MASK_TYPE_BINARY:
-      case OSSIM_MASK_TYPE_BINARY_INVERSE:
-      {
-         return executeMaskFilterBinary(theTile, maskSourceData);
-      }
-   }
-   
-   return imageSourceData;
-}
-
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelect(
-   ossimRefPtr<ossimImageData> imageSourceData,
-   ossimRefPtr<ossimImageData> maskSourceData)
-{
-   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
-      return imageSourceData;
-   }
-
-   switch(imageSourceData->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      executeMaskFilterSelection((ossim_uint8)0,
-                                 (ossim_uint8)0,
-                                 imageSourceData,
-                                 maskSourceData);
-      break;
-   }
-   case OSSIM_USHORT11:
-   case OSSIM_USHORT16:
-   {
-      executeMaskFilterSelection((ossim_uint16)0,
-                                 (ossim_uint8)0,
-                                 imageSourceData,
-                                 maskSourceData);
-      break;
-   }
-   case OSSIM_SSHORT16:
-   {
-      executeMaskFilterSelection((ossim_sint16)0,
-                                 (ossim_uint8)0,
-                                 imageSourceData,
-                                 maskSourceData);
-      break;
-   }
-   case OSSIM_FLOAT:
-   case OSSIM_NORMALIZED_FLOAT:
-   {
-      executeMaskFilterSelection((float)0,
-                                 (ossim_uint8)0,
-                                 imageSourceData,
-                                 maskSourceData);
-      break;
-   }
-   case OSSIM_DOUBLE:
-   case OSSIM_NORMALIZED_DOUBLE:
-   {
-      executeMaskFilterSelection((double)0,
-                                 (ossim_uint8)0,
-                                 imageSourceData,
-                                 maskSourceData);
-      break;
-   }
-   default:
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
-      break;
-   }   
-   }
-
-   return theTile;
-}
-
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterInvertSelect(ossimRefPtr<ossimImageData> imageSourceData,
-                                                                           ossimRefPtr<ossimImageData> maskSourceData)
-{
-   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
-      return imageSourceData;
-   }
-
-   switch(imageSourceData->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      executeMaskFilterInvertSelection((ossim_uint8)0,
-                                       (ossim_uint8)0,
-                                       imageSourceData,
-                                       maskSourceData);
-      break;
-   }
-   case OSSIM_USHORT11:
-   case OSSIM_USHORT16:
-   {
-      executeMaskFilterInvertSelection((ossim_uint16)0,
-                                       (ossim_uint8)0,
-                                       imageSourceData,
-                                       maskSourceData);
-      break;
-   }
-   case OSSIM_SSHORT16:
-   {
-      executeMaskFilterInvertSelection((ossim_sint16)0,
-                                       (ossim_uint8)0,
-                                       imageSourceData,
-                                       maskSourceData);
-      break;
-   }
-   case OSSIM_FLOAT:
-   case OSSIM_NORMALIZED_FLOAT:
-   {
-      executeMaskFilterInvertSelection((float)0,
-                                       (ossim_uint8)0,
-                                       imageSourceData,
-                                       maskSourceData);
-      break;
-   }
-   case OSSIM_DOUBLE:
-   case OSSIM_NORMALIZED_DOUBLE:
-   {
-      executeMaskFilterInvertSelection((double)0,
-                                       (ossim_uint8)0,
-                                       imageSourceData,
-                                       maskSourceData);
-      break;
-   }
-   default:
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
-      break;
-   }   
-   }
-
-   return theTile;
-}
-
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterWeighted(ossimRefPtr<ossimImageData> imageSourceData,
-                                                                       ossimRefPtr<ossimImageData> maskSourceData)
-{
-   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
-      return imageSourceData;
-   }
-
-   switch(imageSourceData->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      executeMaskFilterWeighted((ossim_uint8)0,
-                                (ossim_uint8)0,
-                                imageSourceData,
-                                maskSourceData);
-      break;
-   }
-   case OSSIM_USHORT11:
-   case OSSIM_USHORT16:
-   {
-      executeMaskFilterWeighted((ossim_uint16)0,
-                                (ossim_uint8)0,
-                                imageSourceData,
-                                maskSourceData);
-      break;
-   }
-   case OSSIM_SSHORT16:
-   {
-      executeMaskFilterWeighted((ossim_sint16)0,
-                                (ossim_uint8)0,
-                                imageSourceData,
-                                maskSourceData);
-      break;
-   }
-   case OSSIM_FLOAT:
-   case OSSIM_NORMALIZED_FLOAT:
-   {
-      executeMaskFilterWeighted((float)0,
-                                (ossim_uint8)0,
-                                imageSourceData,
-                                maskSourceData);
-      break;
-   }
-   case OSSIM_DOUBLE:
-   case OSSIM_NORMALIZED_DOUBLE:
-   {
-      executeMaskFilterWeighted((double)0,
-                                (ossim_uint8)0,
-                                imageSourceData,
-                                maskSourceData);
-      break;
-   }
-   default:
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
-      break;
-   }   
-   }
-
-   return theTile;
-}
-
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterBinary(
-   ossimRefPtr<ossimImageData> imageSourceData, ossimRefPtr<ossimImageData> maskSourceData)
-{
-   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterBinary WARNING: Only uchar masks are supported" << endl;
-      return imageSourceData;
-   }
-   
-   switch(imageSourceData->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         executeMaskFilterBinarySelection((ossim_uint8)0,
-                                          (ossim_uint8)0,
-                                          imageSourceData,
-                                          maskSourceData);
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_USHORT16:
-      {
-         executeMaskFilterBinarySelection((ossim_uint16)0,
-                                          (ossim_uint8)0,
-                                          imageSourceData,
-                                          maskSourceData);
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         executeMaskFilterBinarySelection((ossim_sint16)0,
-                                          (ossim_uint8)0,
-                                          imageSourceData,
-                                          maskSourceData);
-         break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         executeMaskFilterBinarySelection((float)0,
-                                          (ossim_uint8)0,
-                                          imageSourceData,
-                                          maskSourceData);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         executeMaskFilterBinarySelection((double)0,
-                                          (ossim_uint8)0,
-                                          imageSourceData,
-                                          maskSourceData);
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterBinary WARNING: Unknown scalar type" << endl;
-         break;
-      }
-   }
-
-   return theTile;
-}
-
-template <class inputT, class maskT>
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelection(
-   inputT /* dummyInput */,
-   maskT  /* dummyMask */,
-   ossimRefPtr<ossimImageData> imageSourceData,
-   ossimRefPtr<ossimImageData> maskSourceData)
-{
-   ossimDataObjectStatus maskDataStatus  = maskSourceData->getDataObjectStatus();
-   ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
-
-   // First just check if mask is full, which means pass the image source along untouched:
-   if (maskDataStatus == OSSIM_FULL)
-   {
-      theTile = imageSourceData;
-      return theTile;
-   }
-
-   // Then check for a total mask (all mask values are 0) and return empty tile if so:
-   if( (maskDataStatus == OSSIM_NULL) || (maskDataStatus == OSSIM_EMPTY))
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   // Finally check for blank source tile and return it if so:
-   if( (inputDataStatus == OSSIM_NULL) || (inputDataStatus == OSSIM_EMPTY))
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
-   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
-   if(maskBands&&inputBands)
-   {
-      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
-      for(ossim_uint32 band = 0; band < inputBands; ++band)
-      {
-         maskT*  bufMask = static_cast<maskT*> ( maskSourceData->getBuf() );
-         inputT* bufIn   = static_cast<inputT*>( imageSourceData->getBuf(band) );
-         inputT* bufOut  = static_cast<inputT*>( theTile->getBuf(band) );
-         inputT  nullPix = static_cast<inputT> ( theTile->getNullPix(band) );
-         inputT  minPix  = static_cast<inputT> ( theTile->getMinPix(band) );
-         ossim_uint32 offset = 0;
-         for(offset = 0; offset < maxOffset; ++offset)
-         {
-            if(*bufMask)
-            {
-               if ( theMaskType == OSSIM_MASK_TYPE_SELECT )
-               {
-                  *bufOut = *bufIn;
-               }
-               else
-               {
-                  //---
-                  // OSSIM_MASK_TYPE_SELECT_CLAMP_MIN
-                  // Use input pixel clamping any nulls to min.
-                  //---
-                  *bufOut = *bufIn != nullPix ? *bufIn : minPix;
-               }
-            }
-            else
-            {
-               *bufOut = nullPix;
-            }
-            ++bufOut;
-            ++bufIn;
-            ++bufMask;
-         }
-      }
-      theTile->validate();
-   }
-   
-   return theTile;
-}
-
-template <class inputT, class maskT>
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterInvertSelection(
-   inputT /* dummyInput */,
-   maskT  /* dummyMask */,
-   ossimRefPtr<ossimImageData> imageSourceData,
-   ossimRefPtr<ossimImageData> maskSourceData)
-{
-   ossimDataObjectStatus maskDataStatus  = maskSourceData->getDataObjectStatus();
-   ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
-
-   // First just check if mask is empty, which means pass the image source along untouched:
-   if( (maskDataStatus == OSSIM_NULL) || (maskDataStatus == OSSIM_EMPTY))
-   {
-      theTile = imageSourceData;
-      return theTile;
-   }
-
-   // Then check for a total mask (all mask values are 1) and return empty tile if so:
-   if (maskDataStatus == OSSIM_FULL)
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   // Finally check for blank source tile and return it if so:
-   if( (inputDataStatus == OSSIM_NULL) || (inputDataStatus == OSSIM_EMPTY))
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
-   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
-   if(maskBands&&inputBands)
-   {
-      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
-      for(ossim_uint32 band = 0; band < inputBands; ++band)
-      {
-         maskT*    bufMask = (maskT*)maskSourceData->getBuf();
-         inputT* bufIn     = (inputT*)imageSourceData->getBuf(band);
-         inputT* bufOut    = (inputT*)theTile->getBuf(band);
-         inputT  np        = (inputT)theTile->getNullPix(band);
-         ossim_uint32 offset = 0;
-         for(offset = 0; offset < maxOffset; ++offset)
-         {
-            if(!*bufMask)
-            {
-               *bufOut = *bufIn;
-            }
-            else
-            {
-               *bufOut = np;
-            }
-            ++bufOut;
-            ++bufIn;
-            ++bufMask;
-         }
-      }
-      theTile->validate();
-   }
-   
-   return theTile;
-}
-
-template <class inputT, class maskT>
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterWeighted(
-   inputT /* dummyInput */,
-   maskT  /* dummyMask */,
-   ossimRefPtr<ossimImageData> imageSourceData,
-   ossimRefPtr<ossimImageData> maskSourceData)
-{
-   ossimDataObjectStatus maskDataStatus  = maskSourceData->getDataObjectStatus();
-   ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
-
-   if( (maskDataStatus == OSSIM_NULL)||
-       (maskDataStatus == OSSIM_EMPTY))
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-   if( (inputDataStatus == OSSIM_NULL)||
-       (inputDataStatus == OSSIM_EMPTY))
-   {
-      return theTile;
-   }
-   
-   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
-   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
-   if(maskBands&&inputBands)
-   {
-      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
-      for(ossim_uint32 band = 0; band < inputBands; ++band)
-      {
-         maskT*    bufMask = (maskT*)maskSourceData->getBuf();
-         inputT* bufIn     = (inputT*)imageSourceData->getBuf(band);
-         inputT* bufOut    = (inputT*)theTile->getBuf(band);
-         inputT  np        = (inputT)theTile->getNullPix(band);
-         inputT  minp      = (inputT)theTile->getMinPix(band);
-         ossim_uint32 offset = 0;
-
-         if(inputDataStatus == OSSIM_PARTIAL)
-         {
-            for(offset = 0; offset < maxOffset; ++offset)
-            {
-               if(*bufIn != np)
-               {
-                  *bufOut = (inputT)((*bufIn)*((double)(*bufMask)/255.0));
-                  if((*bufOut != np)&&
-                     (*bufOut < minp))
-                  {
-                     *bufOut = minp;
-                  }
-               }
-               else
-               {
-                  *bufOut = np;
-               }
-               ++bufOut;
-               ++bufIn;
-               ++bufMask;
-            }
-         }
-         else
-         {
-            for(offset = 0; offset < maxOffset; ++offset)
-            {
-               *bufOut = (inputT)((*bufIn)*((double)(*bufMask)/255.0));
-               if((*bufOut != np)&&
-                  (*bufOut < minp))
-               {
-                  *bufOut = minp;
-               }
-               ++bufOut;
-               ++bufIn;
-               ++bufMask;
-            }
-         }
-      }
-      theTile->validate();
-   }
-   
-   return theTile;
-}
-
-template <class inputT, class maskT>
-ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterBinarySelection(
-   inputT /* dummyInput */,
-   maskT  /* dummyMask  */ ,
-   ossimRefPtr<ossimImageData> imageSourceData,
-   ossimRefPtr<ossimImageData> maskSourceData)
-{
-   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
-   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
-   if(maskBands&&inputBands)
-   {
-      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
-      for(ossim_uint32 band = 0; band < inputBands; ++band)
-      {
-         maskT*  bufMask   = (maskT*)maskSourceData->getBuf();
-         inputT* bufOut    = (inputT*)theTile->getBuf(band);
-         const inputT  NP  = (inputT)theTile->getNullPix(band);
-         const inputT  MP  = (inputT)theTile->getMaxPix(band);
-         ossim_uint32 offset = 0;
-         for(offset = 0; offset < maxOffset; ++offset)
-         {
-            if (theMaskType == OSSIM_MASK_TYPE_BINARY_INVERSE)
-            {
-               if(*bufMask)      // if mask == 1
-                  *bufOut = MP;  // set to max pix
-               else              // if mask == 0
-                  *bufOut = NP;  // set to null pix
-            }
-            else
-            {
-               if(*bufMask)      // if mask == 1
-                  *bufOut = NP;  // set to null pix
-               else              // if mask == 0
-                  *bufOut = MP;  // set to max pix
-            }
-            ++bufOut;
-            ++bufMask;
-         }
-      }
-      theTile->validate();
-   }
-   
-   return theTile;
-}
-
-void ossimMaskFilter::setMaskType(ossimFileSelectionMaskType type)
-{
-   theMaskType = type;
-}
-
-void ossimMaskFilter::setMaskType(const ossimString& type)
-{
-   if(type != "")
-   {
-      ossimString maskType = type;
-      maskType.downcase();
-
-      if(maskType == "select")
-      {
-         theMaskType = OSSIM_MASK_TYPE_SELECT;
-      }
-      else if(maskType == "invert")
-      {
-         theMaskType = OSSIM_MASK_TYPE_INVERT;
-      }
-      else if(maskType == "weighted")
-      {
-         theMaskType = OSSIM_MASK_TYPE_WEIGHTED;
-      }
-      else if(maskType == "binary")
-      {
-         theMaskType = OSSIM_MASK_TYPE_BINARY;
-      }
-      else if(maskType == "binary_inverse")
-      {
-         theMaskType = OSSIM_MASK_TYPE_BINARY_INVERSE;
-      }
-      else if(maskType == "select_clamp_min")
-      {
-         theMaskType = OSSIM_MASK_TYPE_SELECT_CLAMP_MIN;
-      } 
-   }
-}
-
-ossimMaskFilter::ossimFileSelectionMaskType ossimMaskFilter::getMaskType()const
-{
-   return theMaskType;
-}
-
-ossimString ossimMaskFilter::getMaskTypeString() const
-{
-   ossimString maskType;
-   
-   switch(theMaskType)
-   {
-      case OSSIM_MASK_TYPE_SELECT:
-      {
-         maskType = "select";
-         break;
-      }
-      case OSSIM_MASK_TYPE_INVERT:
-      {
-         maskType = "invert";
-         break;
-      }
-      case OSSIM_MASK_TYPE_WEIGHTED:
-      {
-         maskType = "weighted";
-         break;
-      }
-      case OSSIM_MASK_TYPE_BINARY:
-      {
-         maskType = "binary";
-         break;
-      }
-      case OSSIM_MASK_TYPE_BINARY_INVERSE:
-      {
-         maskType = "binary_inverse";
-         break;
-      }
-      case OSSIM_MASK_TYPE_SELECT_CLAMP_MIN:
-      {
-         maskType = "select_clamp_min";
-         break;
-      }
-   }
-
-   return maskType;
-}
-
-bool ossimMaskFilter::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   bool result = ossimImageSource::loadState(kwl, prefix);
-   
-   theInputListIsFixedFlag  = true;
-   theOutputListIsFixedFlag = false;
-   setNumberOfInputs(2);
-
-   const char* lookup = kwl.find(prefix, MASK_FILTER_MASK_TYPE_KW);
-   if (lookup)
-   {
-      setMaskType(ossimString(lookup));
-   }
-
-   return result;
-}
-
-bool ossimMaskFilter::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   kwl.add(prefix,
-           MASK_FILTER_MASK_TYPE_KW,
-           getMaskTypeString().c_str(),
-           true);
-   
-   return ossimImageSource::saveState(kwl, prefix);
-}
-
-void ossimMaskFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if( property.valid() )
-   {
-      if(property->getName() == MASK_FILTER_MASK_TYPE_KW)
-      {
-         setMaskType(property->valueToString());
-      }
-      else
-      {
-         ossimImageSource::setProperty(property);
-      }
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimMaskFilter::getProperty(
-   const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   
-   if(name == MASK_FILTER_MASK_TYPE_KW)
-   {
-      std::vector<ossimString> constraintList;
-      constraintList.push_back(ossimString("select"));
-      constraintList.push_back(ossimString("invert"));
-      constraintList.push_back(ossimString("weighted"));
-      
-      result = new ossimStringProperty(MASK_FILTER_MASK_TYPE_KW,
-                                       getMaskTypeString(),
-                                       false,
-                                       constraintList);
-   }
-   else
-   {
-      result = ossimImageSource::getProperty(name);
-   }
-   return result;
-}
-
-void ossimMaskFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSource::getPropertyNames(propertyNames);
-   propertyNames.push_back(MASK_FILTER_MASK_TYPE_KW);
-}
-
-ossim_uint32 ossimMaskFilter::getNumberOfInputBands() const
-{
-   ossimImageSource* img_source = PTR_CAST(ossimImageSource, getInput());
-   if (img_source)
-      return img_source->getNumberOfInputBands();
-   return 0;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimMaxMosaic.cpp b/ossim/src/ossim/imaging/ossimMaxMosaic.cpp
deleted file mode 100644
index fd18d14..0000000
--- a/ossim/src/ossim/imaging/ossimMaxMosaic.cpp
+++ /dev/null
@@ -1,556 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 SANZ Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Kenneth Melero (kmelero at sanz.com)
-//
-// Description: This combiner is designed to "float" the maximum pixel value
-//              of all inputs to top of the mosaic output. 
-//
-//*************************************************************************
-// $Id: ossimMaxMosaic.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimMaxMosaic.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimTrace.h>
-
-static const ossimTrace traceDebug("ossimMaxMosaic:debug");
-
-using namespace std;
-
-RTTI_DEF1(ossimMaxMosaic, "ossimMaxMosaic", ossimImageCombiner)
-ossimMaxMosaic::ossimMaxMosaic()
-   :ossimImageCombiner(),
-    theTile(NULL)
-{
-}
-
-ossimMaxMosaic::ossimMaxMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
-    : ossimImageCombiner(inputSources),
-      theTile(NULL)
-{
-}
-
-
-ossimMaxMosaic::~ossimMaxMosaic()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimMaxMosaic::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   long size = getNumberOfInputs();
-   ossim_uint32 layerIdx = 0;
-   // If there is only one in the mosaic then just return it.
-   if(size == 1)
-   {
-      return getNextTile(layerIdx, 0, tileRect, resLevel);
-   }
-   
-   ossimIpt origin = tileRect.ul();
-   ossim_uint32 w = tileRect.width();
-   ossim_uint32 h = tileRect.height();
-   
-   if(!theTile.valid())
-   {
-      // First time through...
-      allocate();
-
-      // If we still don't have a buffer then we will leave.
-      if(!theTile.valid())
-      {
-         return ossimRefPtr<ossimImageData>();
-      }
-   }
-   
-   ossim_uint32 tileW = theTile->getWidth();
-   ossim_uint32 tileH = theTile->getHeight();
-   if((w != tileW)||
-      (h != tileH))
-   {
-      theTile->setWidth(w);
-      theTile->setHeight(h);
-      if((w*h)!=(tileW*tileH))
-      {
-         theTile->initialize();
-      }
-   }
-   theTile->setOrigin(origin);
-
-   //---
-   // General Note:
-   //
-   // Note: I will not check for disabled or enabled since we have
-   // no clear way to handle this within a mosaic. The default will be
-   // to do a simple a A over B type mosaic.  Derived classes should
-   // check for the enabled and disabled and always
-   // use this default implementation if they are disabled.
-   //---
-   theTile->setOrigin(origin);
-   theTile->makeBlank();
-   switch(theTile->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint8>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint8>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SINT8:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint8>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint8>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_FLOAT: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<float>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<float>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint16>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint16>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SSHORT16:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint16>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint16>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SINT32:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_sint32>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_sint32>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_UINT32:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<ossim_uint32>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<ossim_uint32>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         if(!hasDifferentInputs())
-         {
-            return combine(static_cast<double>(0),
-                           tileRect,
-                           resLevel);
-         }
-         else
-         {
-            return combineNorm(static_cast<double>(0),
-                               tileRect,
-                               resLevel);
-         }
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Scalar type = " << theTile->getScalarType()
-            << " Not supported by ossimMaxMosaic" << endl;
-      }
-   }
-
-   return ossimRefPtr<ossimImageData>();
-}
-
-void ossimMaxMosaic::initialize()
-{
-  ossimImageCombiner::initialize();
-  theTile = NULL;
-}
-
-void ossimMaxMosaic::allocate()
-{
-   theTile = NULL;
-   
-   if( (getNumberOfInputs() > 0) && getInput(0) )
-   {
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-   }
-}
-
-bool ossimMaxMosaic::saveState(ossimKeywordlist& kwl,
-                                 const char* prefix)const
-{
-   return ossimImageCombiner::saveState(kwl, prefix);
-}
-
-bool ossimMaxMosaic::loadState(const ossimKeywordlist& kwl,
-                                 const char* prefix)
-{
-   return ossimImageCombiner::loadState(kwl, prefix);
-}
-
-template <class T> ossimRefPtr<ossimImageData> ossimMaxMosaic::combineNorm(
-   T,// dummy template variable 
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossim_uint32 layerIdx = 0;
-   ossimRefPtr<ossimImageData> destination = theTile;
-   
-   ossimRefPtr<ossimImageData> currentImageData =
-      getNextNormTile(layerIdx, 0, tileRect, resLevel);
-      
-   if(!currentImageData)
-   {
-      return currentImageData;
-   }
-   
-   std::vector<float*> srcBands(theLargestNumberOfInputBands); 
-   std::vector<float> srcBandsNullPix(theLargestNumberOfInputBands); 
-   std::vector<T*> destBands(theLargestNumberOfInputBands);
-   std::vector<T> destBandsNullPix(theLargestNumberOfInputBands);
-   std::vector<T> destBandsMinPix(theLargestNumberOfInputBands);
-   std::vector<T> destBandsMaxPix(theLargestNumberOfInputBands);
-   //float** srcBands        = new float*[theLargestNumberOfInputBands];
-   //float* srcBandsNullPix  = new float[theLargestNumberOfInputBands];
-   //T** destBands = new T*[theLargestNumberOfInputBands];
-   //T* destBandsNullPix = new T[theLargestNumberOfInputBands];
-   //T* destBandsMinPix = new T[theLargestNumberOfInputBands];
-   //T* destBandsMaxPix = new T[theLargestNumberOfInputBands];
-      
-   ossim_uint32 band;
-   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
-   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-   for(band = 0; band < minNumberOfBands; ++band)
-   {
-      srcBands[band]  = static_cast<float*>(currentImageData->getBuf(band));
-      srcBandsNullPix[band]  = static_cast<float>(currentImageData->getNullPix(band));
-      
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
-      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
-   }
-   // if the src is smaller than the destination in number
-   // of bands we will just duplicate the last band.
-   for(;band < theLargestNumberOfInputBands; ++band)
-   {
-      srcBands[band]  = static_cast<float*>(srcBands[minNumberOfBands - 1]);
-      srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(minNumberOfBands - 1));
-      
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
-      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
-   }
-   // most of the time we will not overlap so let's
-   // copy the first tile into destination and check later.
-   //
-   ossim_uint32 tempBandIdx = 0;
-   for(band = 0; band < theTile->getNumberOfBands();++band)
-   {
-      if(band < currentImageData->getNumberOfBands())
-      {
-         theTile->copyNormalizedBufferToTile(band,
-                                             (float*)currentImageData->getBuf(band));
-         ++tempBandIdx;
-      }
-      else
-      {
-         if(tempBandIdx)
-         {
-            theTile->copyNormalizedBufferToTile(band,
-                                                (float*)currentImageData->getBuf(tempBandIdx-1));
-         }
-      }
-   }
-   destination->validate();
-   
-   currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
-
-   while(currentImageData.valid())
-   {  
-      ossim_uint32 minNumberOfBands           = currentImageData->getNumberOfBands();
-      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
-      ossimDataObjectStatus destinationStatus = destination->getDataObjectStatus();
-      
-      if(destinationStatus == OSSIM_FULL)
-      {
-         return destination;
-      }
-      for(band = 0; band < minNumberOfBands; ++band)
-      {
-         srcBands[band]        = static_cast<float*>(currentImageData->getBuf(band));
-         srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
-      }
-      // if the src is smaller than the destination in number
-      // of bands we will just duplicate the last band.
-      for(;band < theLargestNumberOfInputBands; ++band)
-      {
-         srcBands[band] = srcBands[minNumberOfBands - 1];
-         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
-      }
-
-      if((destinationStatus == OSSIM_EMPTY)&&
-         (currentStatus     != OSSIM_EMPTY)&&
-         (currentStatus     != OSSIM_NULL))
-      {
-         ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
-         for(band=0; band < theLargestNumberOfInputBands; ++band)
-         {
-            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
-            float minP  = destBandsMinPix[band];
-            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-            {
-               destBands[band][offset] = (T)( minP + delta*srcBands[band][offset]);
-            }
-         }
-      }
-      else if((destinationStatus == OSSIM_PARTIAL)&&
-              (currentStatus     != OSSIM_EMPTY)&&
-              (currentStatus     != OSSIM_NULL))
-      {
-         for(band = 0; band < theLargestNumberOfInputBands; ++band)
-         {
-            
-            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
-            float minP  = destBandsMinPix[band];
-            for(ossim_uint32 offset = 0;
-                offset < upperBound;
-                ++offset)
-            {
-               
-               if(destBands[band][offset] == destBandsNullPix[band])
-               {
-                  destBands[band][offset] = (T)(minP + delta*srcBands[band][offset]);
-               }
-            }
-         }
-      }
-      destination->validate();
-      
-      currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
-   }
-   // Cleanup...
-  // delete [] srcBands;
-  // delete [] srcBandsNullPix;
-  // delete [] destBands;
-  // delete [] destBandsNullPix;
-  // delete [] destBandsMinPix;
-  // delete [] destBandsMaxPix;
-
-   return destination;
-}
-
-template <class T> ossimRefPtr<ossimImageData> ossimMaxMosaic::combine(
-   T,// dummy template variable 
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossim_uint32 layerIdx = 0;
-   ossimRefPtr<ossimImageData> destination = theTile;
-   
-   ossimRefPtr<ossimImageData> currentImageData = getNextTile(layerIdx, 0, tileRect, resLevel);
-   if(!currentImageData)
-   {   
-      return currentImageData;
-   }  
-
-   T** srcBands         = new T*[theLargestNumberOfInputBands];
-   T*  srcBandsNullPix  = new T[theLargestNumberOfInputBands];
-   T** destBands        = new T*[theLargestNumberOfInputBands];
-   T*  destBandsNullPix = new T[theLargestNumberOfInputBands];
-      
-   ossim_uint32 band;
-   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
-   ossim_uint32 bandIndex  = 0;
-
-   ossim_uint32 offset=0;
-   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
-   for(band = 0; band < minNumberOfBands; ++band)
-   {
-      srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      srcBandsNullPix[band]  = static_cast<T>(currentImageData->getNullPix(band));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-   }
-   // if the src is smaller than the destination in number
-   // of bands we will just duplicate the last band.
-   for(;band < theLargestNumberOfInputBands; ++band)
-   {
-      srcBands[band]  = static_cast<T*>(srcBands[minNumberOfBands - 1]);
-      destBands[band] = static_cast<T*>(theTile->getBuf(band));
-      srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
-      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
-   }
-   // most of the time we will not overlap so let's
-   // copy the first tile into destination and check later.
-   //
-   for(band = 0; band < theTile->getNumberOfBands();++band)
-   {
-      T* destBand = destBands[band];
-      T* srcBand  = srcBands[band];
-      if(destBand&&srcBand)
-      {
-         for(offset = 0; offset < upperBound;++offset)
-         {
-            *destBand = *srcBand;
-            ++srcBand; ++destBand;
-         }
-      }
-   }
-   destination->setDataObjectStatus(currentImageData->getDataObjectStatus());
-
-   currentImageData = getNextTile(layerIdx,
-                                  tileRect,
-                                  resLevel);
-
-   while(currentImageData.valid())
-   {  
-      ossim_uint32 minNumberOfBands           = currentImageData->getNumberOfBands();
-      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
-      ossimDataObjectStatus destinationStatus = destination->getDataObjectStatus();
-      
-      for(band = 0; band < minNumberOfBands; ++band)
-      {
-         srcBands[band]        = static_cast<T*>(currentImageData->getBuf(band));
-         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
-      }
-      // if the src is smaller than the destination in number
-      // of bands we will just duplicate the last band.
-      for(;band < theLargestNumberOfInputBands; ++band)
-      {
-         srcBands[band] = srcBands[minNumberOfBands - 1];
-         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
-      }
-
-      if((destinationStatus == OSSIM_PARTIAL)&&
-	 (currentStatus     != OSSIM_EMPTY)&&
-	 (currentStatus     != OSSIM_NULL))
-      {
-         for(bandIndex = 0; bandIndex < theLargestNumberOfInputBands; ++bandIndex)
-         {
-	      
-            for(ossim_uint32 offset = 0;
-                offset < upperBound;
-                ++offset)
-            {
-               if(srcBands[bandIndex][offset] > destBands[bandIndex][offset])
-               {
-                  destBands[bandIndex][offset] = srcBands[bandIndex][offset];
-               }
-            }
-         }
-      }
-      else
-      {
-         ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
-         for(ossim_uint32 band=0; band < theLargestNumberOfInputBands; ++band)
-         {
-            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
-            {
-               if(srcBands[band][offset] > destBands[band][offset])
-               {
-                  destBands[band][offset] = srcBands[band][offset];
-               }
-            }
-         }
-      }
-      
-      destination->validate();
-      
-      currentImageData = getNextTile(layerIdx,tileRect, resLevel);
-   }
-   // Cleanup...
-   delete [] srcBands;
-   delete [] srcBandsNullPix;
-   delete [] destBands;
-   delete [] destBandsNullPix;
-   return destination;
-}
-
-ossimString ossimMaxMosaic::getShortName()const
-{
-   return ossimString("ossimMaxMosaic");
-}
-
-ossimString ossimMaxMosaic::getLongName()const
-{
-   return ossimString("Max Mosaic");
-}
-
-ossimString ossimMaxMosaic::getDescription()const
-{
-   return ossimString("Combiner which puts maximum dn value on image.");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimMeanMedianFilter.cpp b/ossim/src/ossim/imaging/ossimMeanMedianFilter.cpp
deleted file mode 100644
index 026d7e0..0000000
--- a/ossim/src/ossim/imaging/ossimMeanMedianFilter.cpp
+++ /dev/null
@@ -1,931 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimMeanMedianFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimMeanMedianFilter.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <vector>
-#include <algorithm>
-#include <numeric>
-using namespace std;
-
-
-RTTI_DEF1(ossimMeanMedianFilter,
-          "ossimMeanMedianFilter",
-          ossimImageSourceFilter);
-
-// Keywords used throughout.
-static const ossimString WINDOW_SIZE_KW = "window_size";
-static const ossimString FILTER_TYPE_KW = "filter_type";
-static const ossimString AUTO_GROW_KW   = "auto_grow_rectangle_flag";
-
-ossimMeanMedianFilter::ossimMeanMedianFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theTile(0),
-    theFilterType(OSSIM_MEDIAN),
-    theWindowSize(3),
-    theEnableFillNullFlag(false),
-    theAutoGrowRectFlag(false)
-{
-   setDescription(ossimString("Mean Median Filter"));
-}
-
-ossimMeanMedianFilter::~ossimMeanMedianFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimMeanMedianFilter::getTile(
-   const ossimIrect& rect, ossim_uint32 resLevel)
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getTile(rect, resLevel);
-   }
-
-   ossim_uint32 halfSize = getWindowSize()>>1;
-
-   ossimIrect requestRect(rect.ul().x - halfSize,
-                          rect.ul().y - halfSize,
-                          rect.lr().x + halfSize,
-                          rect.lr().y + halfSize);
-
-   ossimRefPtr<ossimImageData> inputData =
-      ossimImageSourceFilter::getTile(requestRect, resLevel);
-   if(!inputData.valid() || !inputData->getBuf())
-   {
-      return inputData;
-   }
-
-   if(!theTile.valid())
-   {
-      theTile = (ossimImageData*)inputData->dup();
-      theTile->setImageRectangle(rect);
-   }
-   else
-   {
-      theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
-   }
-
-   applyFilter(inputData);
-
-   theTile->setDataObjectStatus(inputData->getDataObjectStatus());
-   if(theEnableFillNullFlag)
-   {
-      theTile->validate();
-   }
-
-   return theTile;
-}
-
-void ossimMeanMedianFilter::setWindowSize(ossim_uint32 windowSize)
-{
-   theWindowSize = windowSize;
-}
-
-ossim_uint32 ossimMeanMedianFilter::getWindowSize()const
-{
-   return theWindowSize;
-}
-
-void ossimMeanMedianFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   theTile = NULL;
-}
-
-void ossimMeanMedianFilter::applyFilter(ossimRefPtr<ossimImageData>& input)
-{
-   switch(input->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         switch (theFilterType)
-         {
-            case OSSIM_MEDIAN:
-            case OSSIM_MEDIAN_FILL_NULLS:
-               applyMedian(ossim_uint8(0), input);
-               break;
-               
-            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
-               applyMedianNullCenterOnly(ossim_uint8(0), input);
-               break;
-               
-            case OSSIM_MEAN:
-            case OSSIM_MEAN_FILL_NULLS:
-               applyMean(ossim_uint8(0), input);
-               break;
-
-            case OSSIM_MEAN_NULL_CENTER_ONLY:
-               applyMeanNullCenterOnly(ossim_uint8(0), input);
-               
-            default:
-               break;
-         }
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         switch (theFilterType)
-         {
-            case OSSIM_MEDIAN:
-            case OSSIM_MEDIAN_FILL_NULLS:
-               applyMedian(ossim_uint16(0), input);
-               break;
-               
-            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
-               applyMedianNullCenterOnly(ossim_uint16(0), input);
-               break;
-               
-            case OSSIM_MEAN:
-            case OSSIM_MEAN_FILL_NULLS:
-               applyMean(ossim_uint16(0), input);
-               break;
-
-            case OSSIM_MEAN_NULL_CENTER_ONLY:
-               applyMeanNullCenterOnly(ossim_uint16(0), input);
-               break;
-               
-            default:
-               break;
-         }
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         switch (theFilterType)
-         {
-            case OSSIM_MEDIAN:
-            case OSSIM_MEDIAN_FILL_NULLS:
-               applyMedian(ossim_sint16(0), input);
-               break;
-               
-            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
-               applyMedianNullCenterOnly(ossim_sint16(0), input);
-               break;
-               
-            case OSSIM_MEAN:
-            case OSSIM_MEAN_FILL_NULLS:
-               applyMean(ossim_sint16(0), input);
-               break;
-
-            case OSSIM_MEAN_NULL_CENTER_ONLY:
-               applyMeanNullCenterOnly(ossim_sint16(0), input);
-               break;
-               
-            default:
-               break;
-         }
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         switch (theFilterType)
-         {
-            case OSSIM_MEDIAN:
-            case OSSIM_MEDIAN_FILL_NULLS:
-               applyMedian(ossim_uint32(0), input);
-               break;
-               
-            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
-               applyMedianNullCenterOnly(ossim_uint32(0), input);
-               break;
-               
-            case OSSIM_MEAN:
-            case OSSIM_MEAN_FILL_NULLS:
-               applyMean(ossim_uint32(0), input);
-               break;
-
-            case OSSIM_MEAN_NULL_CENTER_ONLY:
-               applyMeanNullCenterOnly(ossim_uint32(0), input);
-               break;
-               
-            default:
-               break;
-         }
-      }
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         switch (theFilterType)
-         {
-            case OSSIM_MEDIAN:
-            case OSSIM_MEDIAN_FILL_NULLS:
-               applyMedian(ossim_float32(0.0), input);
-               break;
-               
-            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
-               applyMedianNullCenterOnly(ossim_float32(0.0), input);
-               break;
-               
-            case OSSIM_MEAN:
-            case OSSIM_MEAN_FILL_NULLS:
-               applyMean(ossim_float32(0.0), input);
-               break;
-
-            case OSSIM_MEAN_NULL_CENTER_ONLY:
-               applyMeanNullCenterOnly(ossim_float32(0.0), input);
-               break;
-               
-            default:
-               break;
-         }
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         switch (theFilterType)
-         {
-            case OSSIM_MEDIAN:
-            case OSSIM_MEDIAN_FILL_NULLS:
-               applyMedian(ossim_float64(0.0), input);
-               break;
-               
-            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
-               applyMedianNullCenterOnly(ossim_float64(0.0), input);
-               break;
-               
-            case OSSIM_MEAN:
-            case OSSIM_MEAN_FILL_NULLS:
-               applyMean(ossim_float64(0.0), input);
-               break;
-
-            case OSSIM_MEAN_NULL_CENTER_ONLY:
-               applyMeanNullCenterOnly(ossim_float64(0.0), input);
-               break;
-               
-            default:
-               break;
-         }
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimMeanMedianFilter::applyFilter WARNING:\n"
-            << "Unhandled scalar type!" << endl;
-      }
-   }
-}
-
-template <class T>
-void ossimMeanMedianFilter::applyMean(T /* dummyVariable */,
-                                      ossimRefPtr<ossimImageData>& inputData)
-{
-   ossim_uint32 halfWindow = (theWindowSize >> 1);
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 kernelX   = 0;
-   ossim_uint32 kernelY   = 0;
-   ossim_uint32 kernelIdx = 0;
-   ossim_uint32 iw  = inputData->getWidth();
-   ossim_uint32 ow  = theTile->getWidth();
-   ossim_uint32 oh = theTile->getHeight();
-   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
-                                         inputData->getNumberOfBands());
-   ossimDataObjectStatus status = inputData->getDataObjectStatus();
-   std::vector<double> values(theWindowSize*theWindowSize);
-
-   if(status == OSSIM_FULL)
-   {
-      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-      {
-         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
-         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
-
-         if(inputBuf&&outputBuf)
-         {
-            for(y = 0; y < oh; ++y)
-            {
-               for(x = 0; x < ow; ++x)
-               {
-                  kernelIdx = 0;
-                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
-                  {
-                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
-                     {
-                        values[kernelIdx] = *(inputBuf+kernelX + kernelY*iw);
-                        ++kernelIdx;
-                     }
-                  }
-
-
-                  if(values.size() > 0)
-                  {
-                     double sum = std::accumulate(values.begin(),
-                                                  values.end(),
-                                                  0.0);
-                     double average = sum/(double)values.size();
-                     (*outputBuf) = (T)average;
-                  }
-                  ++inputBuf;
-                  ++outputBuf;
-               }
-
-               inputBuf+=(halfWindow<<1);
-            }
-         }
-      }
-   }
-   else
-   {
-      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-      {
-         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
-         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
-         T np            = (T)inputData->getNullPix(bandIdx);
-         if(inputBuf&&outputBuf)
-         {
-            for(y = 0; y < oh; ++y)
-            {
-               for(x = 0; x < ow; ++x)
-               {
-                  values.clear();
-                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
-                  {
-                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
-                     {
-                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
-
-                        if(tempValue != np)
-                        {
-                           values.push_back((double)tempValue);
-                        }
-                     }
-                  }
-
-
-                  if(values.size() > 0)
-                  {
-                     double accumulate = std::accumulate(values.begin(),
-                                                         values.end(),
-                                                         0.0);
-                     double average = accumulate/(double)values.size();
-                     if(*(inputBuf+halfWindow + halfWindow*iw) == np)
-                     {
-                        if(theEnableFillNullFlag)
-                        {
-                           (*outputBuf) = (T)average;
-                        }
-                        else
-                        {
-                           (*outputBuf) = np;
-                        }
-                     }
-                     else
-                     {
-                        (*outputBuf) = (T)average;
-                     }
-                  }
-                  else
-                  {
-                     *outputBuf = np;
-                  }
-                  ++inputBuf;
-                  ++outputBuf;
-               }
-
-               inputBuf+=(halfWindow<<1);
-            }
-         }
-      }
-   }
-}
-
-template <class T> void ossimMeanMedianFilter::applyMeanNullCenterOnly(
-   T /* dummyVariable */,
-   ossimRefPtr<ossimImageData>& inputData)
-{
-   ossim_uint32 halfWindow = (theWindowSize >> 1);
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 kernelX   = 0;
-   ossim_uint32 kernelY   = 0;
-   ossim_uint32 iw  = inputData->getWidth();
-   ossim_uint32 ow  = theTile->getWidth();
-   ossim_uint32 oh = theTile->getHeight();
-   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
-                                         inputData->getNumberOfBands());
-   ossimDataObjectStatus status = inputData->getDataObjectStatus();
-   std::vector<double> values;
-
-   if(status == OSSIM_FULL)
-   {
-      // Nothing to do just copy the tile.
-      theTile->loadTile(inputData.get());
-   }
-   else
-   {
-      // Partial tile with nulls in it.
-      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-      {
-         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
-         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
-         if (!inputBuf || !outputBuf)
-         {
-            return; // Shouldn't happen...
-         }
-         
-         const T NP = (T)inputData->getNullPix(bandIdx);
-
-         for(y = 0; y < oh; ++y)
-         {
-            for(x = 0; x < ow; ++x)
-            {
-               // Get the center input pixel.
-               const T CP = *(inputBuf+halfWindow + halfWindow*iw);
-               if (CP == NP)
-               {
-                  values.clear();
-                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
-                  {
-                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
-                     {
-                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
-                        
-                        if(tempValue != NP)
-                        {
-                           values.push_back((double)tempValue);
-                        }
-                     }
-                  }
-                  
-                  if(values.size() > 0)
-                  {
-                     double accumulate = std::accumulate(values.begin(),
-                                                         values.end(),
-                                                         0.0);
-                     double average = accumulate/(double)values.size();
-                     (*outputBuf) = (T)average;
-                  }
-                  else
-                  {
-                     (*outputBuf) = NP;
-                  }
-                  
-               }
-               else // Center pixel (CP) not null.
-               {
-                  (*outputBuf) = CP;
-               }
-               
-               // Move over...
-               ++inputBuf;
-               ++outputBuf;
-               
-            } // End of loop in x direction.
-
-            // Move down...
-            inputBuf+=(halfWindow<<1);
-            
-         }  // End of loop in y direction.
-         
-      }  // End of band loop.
-      
-   }  // End of else "partial tile" block.
-}
-
-template <class T>
-void ossimMeanMedianFilter::applyMedian(T /* dummyVariable */,
-                                        ossimRefPtr<ossimImageData>& inputData)
-{
-   ossim_uint32 halfWindow = (theWindowSize >> 1);
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 kernelX   = 0;
-   ossim_uint32 kernelY   = 0;
-   ossim_uint32 kernelIdx = 0;
-   ossim_uint32 iw  = inputData->getWidth();
-   ossim_uint32 ow  = theTile->getWidth();
-   ossim_uint32 oh = theTile->getHeight();
-   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
-                                         inputData->getNumberOfBands());
-   ossimDataObjectStatus status = inputData->getDataObjectStatus();
-   std::vector<T> values(theWindowSize*theWindowSize);
-
-   if(status == OSSIM_FULL)
-   {
-      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-      {
-         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
-         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
-
-         if(inputBuf&&outputBuf)
-         {
-            for(y = 0; y < oh; ++y)
-            {
-               for(x = 0; x < ow; ++x)
-               {
-                  kernelIdx = 0;
-                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
-                  {
-                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
-                     {
-                        values[kernelIdx] = *(inputBuf+kernelX + kernelY*iw);
-                        ++kernelIdx;
-                     }
-                  }
-
-                  std::sort(values.begin(),
-                            values.end());
-
-                  if(values.size() > 0)
-                  {
-                     (*outputBuf) = values[values.size()>>1];
-                  }
-                  ++inputBuf;
-                  ++outputBuf;
-               }
-
-               inputBuf+=(halfWindow<<1);
-            }
-         }
-      }
-   }
-   else
-   {
-      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-      {
-         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
-         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
-         T np            = (T)inputData->getNullPix(bandIdx);
-         if(inputBuf&&outputBuf)
-         {
-            for(y = 0; y < oh; ++y)
-            {
-               for(x = 0; x < ow; ++x)
-               {
-                  values.clear();
-                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
-                  {
-                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
-                     {
-                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
-
-                        if(tempValue != np)
-                        {
-                           values.push_back(tempValue);
-                        }
-                     }
-                  }
-
-                  std::sort(values.begin(),
-                            values.end());
-
-                  if(values.size() > 0)
-                  {
-                     if(*(inputBuf+halfWindow + halfWindow*iw) == np)
-                     {
-                        if(theEnableFillNullFlag)
-                        {
-                           (*outputBuf) = values[values.size()>>1];
-                        }
-                        else
-                        {
-                           (*outputBuf) = np;
-                        }
-                     }
-                     else
-                     {
-                        (*outputBuf) = values[values.size()>>1];
-                     }
-                  }
-                  else
-                  {
-                     *outputBuf = np;
-                  }
-                  ++inputBuf;
-                  ++outputBuf;
-               }
-
-               inputBuf+=(halfWindow<<1);
-            }
-         }
-      }
-   }
-}
-
-template <class T> void ossimMeanMedianFilter::applyMedianNullCenterOnly (
-   T /* dummyVariable */,
-   ossimRefPtr<ossimImageData>& inputData)
-{
-   ossim_uint32 halfWindow = (theWindowSize >> 1);
-   ossim_uint32 bandIdx = 0;
-   ossim_uint32 x = 0;
-   ossim_uint32 y = 0;
-   ossim_uint32 kernelX   = 0;
-   ossim_uint32 kernelY   = 0;
-   ossim_uint32 iw  = inputData->getWidth();
-   ossim_uint32 ow  = theTile->getWidth();
-   ossim_uint32 oh = theTile->getHeight();
-   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
-                                         inputData->getNumberOfBands());
-   ossimDataObjectStatus status = inputData->getDataObjectStatus();
-   std::vector<T> values;
-
-   if(status == OSSIM_FULL)
-   {
-      // Nothing to do just copy the tile.
-      theTile->loadTile(inputData.get());
-   }
-   else
-   {
-       // Partial tile with nulls in it.
-      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-      {
-         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
-         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
-         if (!inputBuf || !outputBuf)
-         {
-            return; // Shouldn't happen...
-         }
-         
-         const T NP = (T)inputData->getNullPix(bandIdx);
-
-         for(y = 0; y < oh; ++y)
-         {
-            for(x = 0; x < ow; ++x)
-            {
-               // Get the center input pixel.
-               const T CP = *(inputBuf+halfWindow + halfWindow*iw);
-               if (CP == NP)
-               {
-                  values.clear();
-                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
-                  {
-                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
-                     {
-                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
-                        
-                        if(tempValue != NP)
-                        {
-                           values.push_back(tempValue);
-                        }
-                     }
-                  }
-
-                  std::sort(values.begin(),
-                            values.end());
-                  
-                  if(values.size() > 0)
-                  {
-                     (*outputBuf) = values[values.size()>>1];
-                  }
-                  else
-                  {
-                     (*outputBuf) = NP;
-                  }
-               }
-               else // Center pixel (CP) not null.
-               {
-                  (*outputBuf) = CP;
-               }
-
-               // Move over...
-               ++inputBuf;
-               ++outputBuf;
-               
-            }  // End of loop in x direction.
-
-            // Move down...
-            inputBuf+=(halfWindow<<1);
-            
-         }  // End of loop in y direction.
-         
-      }  // End of band loop.
-      
-   }  // End of else "partial tile" block.
-}
-
-void ossimMeanMedianFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid())
-   {
-      return;
-   }
-
-   ossimString name = property->getName();
-
-   if (name == WINDOW_SIZE_KW)
-   {
-      theWindowSize = property->valueToString().toUInt32();
-   }
-   else if (name == FILTER_TYPE_KW)
-   {
-      ossimString value = property->valueToString();
-      setFilterType(value);
-   }
-   else if (name == AUTO_GROW_KW)
-   {
-      ossimString value;
-      property->valueToString(value);
-      setAutoGrowRectFlag(value.toBool());
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimMeanMedianFilter::getProperty(const ossimString& name)const
-{
-   if (name == WINDOW_SIZE_KW)
-   {
-      ossimProperty* prop =
-         new ossimNumericProperty(WINDOW_SIZE_KW,
-                                  ossimString::toString(theWindowSize),
-                                  3,
-                                  25);
-      prop->setCacheRefreshBit();
-
-      return prop;
-   }
-   else if (name == FILTER_TYPE_KW)
-   {
-      std::vector<ossimString> constraintList;
-      getFilterTypeList(constraintList);
-      ossimString value = getFilterTypeString();
-      ossimProperty* prop = new ossimStringProperty(FILTER_TYPE_KW,
-                                                    value,
-                                                    false,
-                                                    constraintList);
-      prop->setCacheRefreshBit();
-      
-      return prop;
-   }
-   else if (name == AUTO_GROW_KW)
-   {
-      ossimRefPtr<ossimProperty> p = new ossimBooleanProperty(
-         AUTO_GROW_KW, getAutoGrowRectFlag());
-      p->setFullRefreshBit();
-      return p;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimMeanMedianFilter::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(WINDOW_SIZE_KW);
-   propertyNames.push_back(FILTER_TYPE_KW);
-   propertyNames.push_back(AUTO_GROW_KW);
-
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-}
-
-bool ossimMeanMedianFilter::saveState(ossimKeywordlist& kwl,
-                                      const char* prefix)const
-{
-   kwl.add(prefix,
-           WINDOW_SIZE_KW.c_str(),
-           theWindowSize,
-           true);
-   kwl.add(prefix,
-           FILTER_TYPE_KW.c_str(),
-           getFilterTypeString(),
-           true);
-   kwl.add(prefix,
-           AUTO_GROW_KW.c_str(),
-           (theAutoGrowRectFlag?"true":"false"),
-           true);   
-
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimMeanMedianFilter::loadState(const ossimKeywordlist& kwl,
-                                      const char* prefix)
-{
-   const char* lookup = NULL;
-   
-   lookup = kwl.find(prefix, WINDOW_SIZE_KW.c_str());
-   if(lookup)
-   {
-      theWindowSize = ossimString(lookup).toUInt32();
-   }
-   
-   lookup = kwl.find(prefix, FILTER_TYPE_KW.c_str());
-   if(lookup)
-   {
-      ossimString type = lookup;
-      setFilterType(type);
-   }
-
-   lookup = kwl.find(prefix, AUTO_GROW_KW.c_str());
-   if(lookup)
-   {
-      ossimString flag = lookup;
-      setAutoGrowRectFlag(flag.toBool());
-   }
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-void ossimMeanMedianFilter::setFilterType(ossimMeanMedianFilterType type)
-{
-   theFilterType = type;
-}
-
-void ossimMeanMedianFilter::setFilterType(const ossimString& type)
-{
-   ossimString s = type;
-   s.downcase();
-
-   std::vector<ossimString> list;
-   getFilterTypeList(list);
-   
-   for (ossim_uint32 i = 0; i < list.size(); ++i)
-   {
-      if (s == list[i])
-      {
-         theFilterType = static_cast<ossimMeanMedianFilterType>(i);
-      }
-   }
-
-   if ( (theFilterType == OSSIM_MEDIAN_FILL_NULLS) ||
-        (theFilterType == OSSIM_MEAN_FILL_NULLS) )
-   {
-      theEnableFillNullFlag = true;
-   }
-   else
-   {
-      theEnableFillNullFlag = false;
-   }
-}
-
-void ossimMeanMedianFilter::setAutoGrowRectFlag(bool flag)
-{
-   theAutoGrowRectFlag = flag;
-}
-
-bool ossimMeanMedianFilter::getAutoGrowRectFlag() const
-{
-   return theAutoGrowRectFlag;
-}
-
-ossimString ossimMeanMedianFilter::getFilterTypeString() const
-{
-   std::vector<ossimString> list;
-   getFilterTypeList(list);
-   return list[theFilterType];
-}
-
-void ossimMeanMedianFilter::getFilterTypeList(
-   std::vector<ossimString>& list) const
-{
-   list.resize(OSSIM_MEAN_NULL_CENTER_ONLY+1);
-
-   list[0] = ossimString("median");
-   list[1] = ossimString("median_fill_nulls");
-   list[2] = ossimString("median_null_center_only");
-   list[3] = ossimString("mean");
-   list[4] = ossimString("mean_fill_nulls");
-   list[5] = ossimString("mean_null_center_only");
-}
-
-ossimIrect ossimMeanMedianFilter::getBoundingRect(ossim_uint32 resLevel)const
-{
-   // Get the input rectangle.
-   ossimIrect rect = ossimImageSourceFilter::getBoundingRect(resLevel);
-   if (!theAutoGrowRectFlag || rect.hasNans())
-   {
-      return rect; // Not in autogrow mode or no input connection yet...
-   }
-
-   if ( (theFilterType == OSSIM_MEDIAN_FILL_NULLS)       ||
-        (theFilterType == OSSIM_MEDIAN_NULL_CENTER_ONLY) ||
-        (theFilterType == OSSIM_MEAN_FILL_NULLS)         ||
-        (theFilterType == OSSIM_MEAN_NULL_CENTER_ONLY) )
-   {
-      ossimIpt pt = rect.ul();
-      const ossim_int32 HW = (theWindowSize >> 1); // half window size.
-
-      // Adjust the upper left.
-      pt.x = pt.x-HW;
-      pt.y = pt.y-HW;
-      rect.set_ul(pt);
-
-      // Adjust the lower right.
-      pt = rect.lr();
-      pt.x = pt.x+HW;
-      pt.y = pt.y+HW;
-      rect.set_lr(pt);
-   }
-
-   return rect;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimMemoryImageSource.cpp b/ossim/src/ossim/imaging/ossimMemoryImageSource.cpp
deleted file mode 100644
index 1ea36cb..0000000
--- a/ossim/src/ossim/imaging/ossimMemoryImageSource.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-//*******************************************************************. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-//
-#include <ossim/imaging/ossimMemoryImageSource.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-RTTI_DEF1(ossimMemoryImageSource, "ossimMemoryImageSource", ossimImageSource);
-
-ossimMemoryImageSource::ossimMemoryImageSource()
-   :ossimImageSource(0, 0, 1, true, false)
-{
-   m_boundingRect.makeNan();
-}
-
-void ossimMemoryImageSource::setImage(ossimRefPtr<ossimImageData> image)
-{
-   m_image = image.get();
-	if(m_image.valid())
-	{
-		m_boundingRect = m_image->getImageRectangle();
-	}
-	else
-	{
-		m_boundingRect.makeNan();
-	}
-   m_result = 0;
-}
-
-void ossimMemoryImageSource::setImage(ossimScalarType scalarType,
-                                      ossim_uint32 numberOfBands,
-                                      ossim_uint32 width,
-                                      ossim_uint32 height)
-{
-   m_image = new ossimImageData(0,
-                                 scalarType,
-                                 numberOfBands,
-                                 width,
-                                 height);
-   m_image->initialize();
-   
-   m_boundingRect = m_image->getImageRectangle();
-   m_result = 0;
-}
-
-void ossimMemoryImageSource::setRect(ossim_uint32 ulx,
-                                     ossim_uint32 uly,
-                                     ossim_uint32 width,
-                                     ossim_uint32 height)
-{
-   if(m_image.valid())
-   {
-      m_image->setImageRectangle(ossimIrect(ulx, uly,
-                                             ulx + (width-1),
-                                             uly + (height-1)));
-      m_boundingRect = m_image->getImageRectangle();
-   }
-}
-
-ossim_uint32 ossimMemoryImageSource::getNumberOfInputBands() const
-{
-   if(m_image.valid())
-   {
-      return m_image->getNumberOfBands();
-   }
-   return 0;;
-}
-
-ossim_uint32 ossimMemoryImageSource::getNumberOfOutputBands() const
-{
-   return getNumberOfInputBands();
-}
-
-ossimScalarType ossimMemoryImageSource::getOutputScalarType() const
-{
-   if(m_image.valid())
-   {
-      return m_image->getScalarType();
-   }
-   
-   return ossimImageSource::getOutputScalarType();
-}
-
-double ossimMemoryImageSource::getNullPixelValue(ossim_uint32 band)const
-{
-   if(m_image.valid())
-   {
-      if(band < getNumberOfInputBands())
-      {
-         return m_image->getNullPix(band);
-      }
-   }
-   return ossimImageSource::getNullPixelValue(band);
-}
-
-double ossimMemoryImageSource::getMinPixelValue(ossim_uint32 band)const
-{
-   if(m_image.valid())
-   {
-      if(band < getNumberOfInputBands())
-      {
-         return m_image->getMinPix(band);
-      }
-   }
-   return ossimImageSource::getMinPixelValue(band);
-}
-
-double ossimMemoryImageSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(m_image.valid())
-   {
-      if(band < getNumberOfInputBands())
-      {
-         return m_image->getMaxPix(band);
-      }
-   }
-   return ossimImageSource::getMaxPixelValue(band);
-}
-
-ossimIrect ossimMemoryImageSource::getBoundingRect(ossim_uint32 resLevel)const
-{
-   if(resLevel == 0)
-   {
-      if(m_image.valid())
-      {
-         return m_boundingRect;
-      }
-   }
-
-   return ossimImageSource::getBoundingRect(resLevel);
-}
-
-ossimRefPtr<ossimImageData> ossimMemoryImageSource::getTile(const ossimIrect& rect,
-                                                            ossim_uint32 /* resLevel */)
-{
-   if(!isSourceEnabled()||!m_image.valid()||m_boundingRect.hasNans()) return 0;
-   if(!m_result.valid())
-   {
-      m_result = new ossimImageData(0, getOutputScalarType(), getNumberOfOutputBands(), rect.width(), rect.height());
-      m_result->initialize();       
-   }
-
-   m_result->setImageRectangle(rect);
-   m_result->makeBlank();
-   ossimIrect clampRect = m_image->getImageRectangle().clipToRect(rect);
-	
-   m_result->loadTile(m_image->getBuf(),
-	                    m_boundingRect,
-	                    OSSIM_BSQ);
-
-	m_result->validate();
-   return m_result;
-}
-
-
-bool ossimMemoryImageSource::canConnectMyInputTo(ossim_int32 /* myInputIndex */,
-                                                 const ossimConnectableObject* /* object */)const
-{
-   return false;
-}
-   
-void ossimMemoryImageSource::initialize()
-{
-   m_result = 0;
-}
-
-ossim_uint32 ossimMemoryImageSource::getNumberOfDecimationLevels() const
-{
-   return 1;
-}
-
-void ossimMemoryImageSource::getDecimationFactor(ossim_uint32 resLevel,
-                                                 ossimDpt& result) const
-{
-   if (resLevel == 0)
-   {
-      result.x = 1.0;
-      result.y = 1.0;
-   }
-   else
-   {
-      result.x = 1.0 / (1<<resLevel);
-      result.y = result.x;
-   }
-}
-
-void ossimMemoryImageSource::getDecimationFactors(std::vector<ossimDpt>& decimations)const
-{
-   decimations.push_back(ossimDpt(1.0,1.0));
-}
-
-
-bool ossimMemoryImageSource::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   
-   ossimString imagePrefix = ossimString(prefix) + "image.";
-   ossimString geomPrefix = ossimString(prefix) + "geom.";
-   if(m_image.valid())
-   {
-      m_image->saveState(kwl, imagePrefix);
-   }
-   if(m_geometry.valid())
-   {
-      m_geometry->saveState(kwl, geomPrefix);
-   }
-   return ossimImageSource::saveState(kwl, prefix);
-}
-
-bool ossimMemoryImageSource::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   bool returnResult =  ossimImageSource::loadState(kwl, prefix);
-   m_geometry = 0;
-   if(returnResult)
-   {
-      ossimString imagePrefix = ossimString(prefix) + "image.";
-      ossimString geomPrefix = ossimString(prefix) + "geom.";
-      
-      ossimString type = kwl.find(imagePrefix, "type");
-      if(!type.empty())
-      {
-         m_image = new ossimImageData();
-         returnResult = m_image->loadState(kwl, imagePrefix.c_str());
-         m_image->initialize();
-         m_boundingRect = m_image->getImageRectangle();
-      }
-      
-      if(returnResult)
-      {
-         type = kwl.find(geomPrefix, "type");
-         if(!type.empty())
-         {
-            m_geometry = new ossimImageGeometry();
-            returnResult = m_geometry->loadState(kwl, geomPrefix.c_str());
-         }
-      }
-   }
-   m_result = 0;
-   return returnResult;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimMetadataFileWriter.cpp b/ossim/src/ossim/imaging/ossimMetadataFileWriter.cpp
deleted file mode 100644
index faf6467..0000000
--- a/ossim/src/ossim/imaging/ossimMetadataFileWriter.cpp
+++ /dev/null
@@ -1,278 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2003 Stroage Area Networks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kenneth Melero (kmelero at sanz.com)
-//
-//*******************************************************************
-//  $Id: ossimMetadataFileWriter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimMetadataFileWriter.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimViewController.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimFilenameProperty.h>
-
-RTTI_DEF3(ossimMetadataFileWriter,
-          "ossimMetadataFileWriter",
-          ossimConnectableObject,
-          ossimProcessInterface,
-          ossimConnectableObjectListener);
-
-static ossimTrace traceDebug("ossimMetadataFileWriter:degug");
-
-ossimMetadataFileWriter::ossimMetadataFileWriter()
-   :ossimConnectableObject(0),
-      ossimProcessInterface(),
-      ossimConnectableObjectListener(),
-      theInputConnection(NULL),
-      theFilename(),
-      thePixelType(OSSIM_PIXEL_IS_POINT),
-      theAreaOfInterest()
-{
-   addListener((ossimConnectableObjectListener*)this);
-   theAreaOfInterest.makeNan();
-}
-
-ossimMetadataFileWriter::~ossimMetadataFileWriter()
-{
-   removeListener((ossimConnectableObjectListener*)this);
-}
-
-void ossimMetadataFileWriter::initialize()
-{
-   theInputConnection = dynamic_cast<ossimImageSource*> (getInput(0));
-}
-
-bool ossimMetadataFileWriter::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   bool result = ossimConnectableObject::loadState(kwl, prefix);
-
-   // Get the filename...
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   if(lookup)
-   {
-      ossimString filename = lookup;
-
-      setFilename(filename);
-   }
-
-   // Note: Defaulted to point in constructor.
-   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
-   if (lookup)
-   {
-      ossimString s = lookup;
-      s.downcase();
-      if (s.contains("area"))
-      {
-         thePixelType = OSSIM_PIXEL_IS_AREA;
-      }
-      else if (s.contains("point"))
-      {
-         thePixelType = OSSIM_PIXEL_IS_POINT;
-      }
-   }
-   
-   if(theInputObjectList.size() != 1)
-   {
-      theInputObjectList.resize(1);
-      theInputListIsFixedFlag = true;
-   }
-   
-   theOutputListIsFixedFlag = false;
-      
-   return result;
-}
-
-void ossimMetadataFileWriter::disconnectInputEvent(ossimConnectionEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimMetadataFileWriter::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimMetadataFileWriter::propertyEvent(ossimPropertyEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimMetadataFileWriter::setPixelType(ossimPixelType pixelType)
-{
-   thePixelType = pixelType;
-}
-
-ossimPixelType ossimMetadataFileWriter::getPixelType()const
-{
-   return thePixelType;
-}
-
-ossimObject* ossimMetadataFileWriter::getObject()
-{
-   return this;
-}
-
-const ossimObject* ossimMetadataFileWriter::getObject() const
-{
-   return this;
-}
-
-bool ossimMetadataFileWriter::execute()
-{
-   bool result = false;
-   if (!theInputConnection)
-   {
-      initialize();
-      if (!theInputConnection)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimMetadataFileWriter::execute DEBUG:\n"
-               << "theInputConnection is null!"
-               << endl;
-         }
-         return result;
-      }
-   }
-   
-   if(theFilename == ossimFilename::NIL)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimMetadataFileWriter::execute DEBUG:\n"
-            << "theFilename is not set!"
-            << endl;
-      }
-      return result;
-   }
-   
-   //---
-   // If theAreaOfInterest hasNans then it was probably not set so use
-   // the bounding rectangle of the input source.
-   //---
-   if (theAreaOfInterest.hasNans())
-   {
-      theAreaOfInterest = theInputConnection->getBoundingRect();
-      if (theAreaOfInterest.hasNans())
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimMetadataFileWriter::execute DEBUG:\n"
-               << "theAreaOfInterest is not set!"
-               << endl;
-         }
-         return result;
-      }
-   }
-
-   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
-
-   setPercentComplete(0.0);
-
-   result = writeFile();
-
-   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimMetadataFileWriter::execute DEBUG:\n"
-         << (result?"successful":"unsuccessful") << " write of file:  "
-         << theFilename
-         << endl;
-   }
-   
-   return result;
-}
-
-void ossimMetadataFileWriter::setPercentComplete(double percentComplete)
-{
-   ossimProcessInterface::setPercentComplete(percentComplete);
-   ossimProcessProgressEvent event(this,
-                                   percentComplete);
-   fireEvent(event);      
-}
-
-void ossimMetadataFileWriter::setFilename(const ossimFilename& file)
-{
-   theFilename = file;
-}
-
-const ossimFilename& ossimMetadataFileWriter::getFilename() const
-{
-   return theFilename;
-}
-
-bool ossimMetadataFileWriter::canConnectMyInputTo(ossim_int32 inputIndex,
-                                                  const ossimConnectableObject* object) const
-{
-   return (object &&
-           ((PTR_CAST(ossimImageSource, object) &&
-             inputIndex == 0)||
-            (PTR_CAST(ossimViewController, object) &&
-             inputIndex == 1)));
-}
-
-void ossimMetadataFileWriter::setAreaOfInterest(
-   const ossimIrect& areaOfInterest)
-{
-   theAreaOfInterest = areaOfInterest;
-}
-
-ossimIrect ossimMetadataFileWriter::getAreaOfInterest() const
-{
-   return theAreaOfInterest;
-}
-
-void ossimMetadataFileWriter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid())return;
-   
-   ossimString name = property->getName();
-
-   if(name == ossimKeywordNames::FILENAME_KW)
-   {
-      setFilename(property->valueToString());
-   }
-   else
-   {
-      ossimConnectableObject::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimMetadataFileWriter::getProperty(const ossimString& name)const
-{
-   if(name == ossimKeywordNames::FILENAME_KW)
-   {
-      ossimFilenameProperty* filenameProp =
-         new ossimFilenameProperty(name, theFilename);
-      
-      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_OUTPUT);
-      
-      return filenameProp;
-      
-   }
-
-   return ossimConnectableObject::getProperty(name);
-}
-
-void ossimMetadataFileWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimConnectableObject::getPropertyNames(propertyNames);
-   propertyNames.push_back(ossimKeywordNames::FILENAME_KW);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimMonoGridRemapEngine.cpp b/ossim/src/ossim/imaging/ossimMonoGridRemapEngine.cpp
deleted file mode 100644
index aa8d782..0000000
--- a/ossim/src/ossim/imaging/ossimMonoGridRemapEngine.cpp
+++ /dev/null
@@ -1,367 +0,0 @@
-//*****************************************************************************
-// FILE: ossimMonoGridRemapEngine.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class 
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimMonoGridRemapEngine.cpp 23673 2015-12-21 09:46:43Z rashadkm $
-
-#include <ossim/imaging/ossimMonoGridRemapEngine.h>
-
-RTTI_DEF1(ossimMonoGridRemapEngine, "ossimMonoGridRemapEngine",
-          ossimGridRemapEngine);
-
-#include <ossim/imaging/ossimGridRemapSource.h>
-#include <ossim/imaging/ossimAtbPointSource.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDblGrid.h>
-#include <ossim/imaging/ossimImageData.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimMonoGridRemapEngine:exec");
-static ossimTrace traceDebug ("ossimMonoGridRemapEngine:debug");
-static bool TRACE_FLAG = true;
-
-//*****************************************************************************
-//  METHOD: ossimMonoGridRemapEngine::dup
-//  
-//*****************************************************************************
-ossimObject* ossimMonoGridRemapEngine::dup() const
-{
-   return new ossimMonoGridRemapEngine;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMonoGridRemapEngine::remapTile
-//  
-//*****************************************************************************
-void ossimMonoGridRemapEngine::remapTile(const ossimDpt&       origin,
-                                        ossimGridRemapSource* remapper,
-                                        ossimRefPtr<ossimImageData>& tile)
-{
-   static const char MODULE[] = "ossimMonoGridRemapEngine::remapTile";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // Fetch tile size and NULL pixel value:
-   //***
-   int    width         = tile->getWidth();
-   int    height        = tile->getHeight();
-   int    offset        = 0;
-   double null;
-
-   //***
-   // Determine null pixel values so that we can recognize a null coming in and
-   // not remap it:
-   //***
-   null = tile->getNullPix(0);
-   ossimDblGrid& grid = *(remapper->getGrid(0));
-   
-   //***
-   // Remap according to pixel type:
-   //***
-   switch(tile->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      ossim_uint8* tile_buf  = (ossim_uint8*)tile->getBuf(0);
-      short  pixel;
-      
-      for (double line=origin.line; line<origin.line+height; line+=1.0)
-      {
-         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
-         {
-            //***
-            // Scan for null pixel before adding remap delta:
-            //***
-            if (tile_buf[offset] != (ossim_uint8) null)
-            {
-               //***
-               // Remap MONO pixel with spatially variant bias value:
-               //***
-               pixel = tile_buf[offset] + (short) grid(samp,line);
-
-               //***
-               // Clamp:
-               //***
-               if      (pixel<0)   tile_buf[offset] = 0;
-               else if (pixel>255) tile_buf[offset] = 255;
-               else                tile_buf[offset] = pixel;
-               
-               //***
-               // Avoid NULLS:
-               //***
-               if (tile_buf[offset] == (ossim_uint8) null) tile_buf[offset]++;
-            }
-            
-            offset++;
-         }
-      }
-      break;
-   }
-   
-   case OSSIM_USHORT11:
-   {
-      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
-      int  pixel;
-      
-      for (double line=origin.line; line<origin.line+height; line+=1.0)
-      {
-         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
-         {
-            //***
-            // Scan for null pixel before adding remap delta:
-            //***
-            if (tile_buf[offset] != (ossim_uint16) null)
-            {
-               //***
-               // Remap MONO pixel with spatially variant bias value:
-               //***
-               pixel = tile_buf[offset] + (int) grid(samp,line);
-
-               //***
-               // Clamp:
-               //***
-               if      (pixel<0)    tile_buf[offset] = 0;
-               else if (pixel>2047) tile_buf[offset] = 2047;
-               else                 tile_buf[offset] = pixel;
-               
-               //***
-               // Avoid NULLS:
-               //***
-               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
-            }
-            
-            offset++;
-         }
-      }
-      break;
-   }
-   
-   case OSSIM_USHORT16:
-   {
-      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
-      int  pixel;
-      
-      for (double line=origin.line; line<origin.line+height; line+=1.0)
-      {
-         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
-         {
-            //***
-            // Scan for null pixel before adding remap delta:
-            //***
-            if (tile_buf[offset] != (ossim_uint16) null)
-            {
-               //***
-               // Remap MONO pixel with spatially variant bias value:
-               //***
-               pixel = tile_buf[offset] + (int) grid(samp,line);
-
-               //***
-               // Clamp:
-               //***
-               if      (pixel<0)     tile_buf[offset] = 0;
-               else if (pixel>65535) tile_buf[offset] = 65535;
-               else                  tile_buf[offset] = pixel;
-               
-               //***
-               // Avoid NULLS:
-               //***
-               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
-            }
-            
-            offset++;
-         }
-      }
-      break;
-   }
-   
-   case OSSIM_SSHORT16:
-   {
-      short* tile_buf  = (short*)tile->getBuf(0);
-      int  pixel;
-      
-      for (double line=origin.line; line<origin.line+height; line+=1.0)
-      {
-         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
-         {
-            //***
-            // Scan for null pixel before adding remap delta:
-            //***
-            if (tile_buf[offset] != (short) null)
-            {
-               //***
-               // Remap MONO pixel with spatially variant bias value:
-               //***
-               pixel = tile_buf[offset] + (short) grid(samp,line);
-
-               //***
-               // Clamp:
-               //***
-               if      (pixel<-32766) tile_buf[offset] = -32766;
-               else if (pixel> 32767) tile_buf[offset] = 32767;
-               else                   tile_buf[offset] = pixel;
-               
-               //***
-               // Avoid NULLS:
-               //***
-               if (tile_buf[offset] == (short) null) tile_buf[offset]++;
-            }
-            
-            offset++;
-         }
-      }
-      break;
-   }
-   default:
-   {
-	   ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimMonoGridRemapEngine::remapTile: Scalar type not handled" << std::endl;
-	   break;
-   }
-	   
-   }   // end switch statement
-
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-};
-
-//*****************************************************************************
-//  METHOD: ossimMonoGridRemapEngine::assignRemapValues
-//
-//  This engine defines the target value as an MONO vector of doubles, computed
-//  as the mean of all contributor MONO values.
-//  
-//*****************************************************************************
-void ossimMonoGridRemapEngine::assignRemapValues (
-   vector<ossimAtbPointSource*>& sources_list)
-{
-   static const char MODULE[] = "ossimMonoGridRemapEngine::assignRemapValues";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   int i; // index to individual sources
-
-   //***
-   // Declare a 2D array that will contain all of the contributing sources'
-   // MONO mean values. Also declare the accumulator target vector.
-   //***
-   int num_contributors = (int)sources_list.size();
-   double** contributor_pixel = new double* [num_contributors];
-   for (i=0; i<num_contributors; i++)
-      contributor_pixel[i] = new double[1];
-   double target_pixel = 0.0;
-
-   //***
-   // Now loop over each remaining contributor and sum in its contribution:
-   //***
-   vector<ossimAtbPointSource*>::iterator source;
-   i = 0;
-   for(source=sources_list.begin();
-       source!=sources_list.end();
-       source++)
-   {
-      (*source)->getSourceValue(contributor_pixel[i]);
-      target_pixel += contributor_pixel[i][0]/(double)num_contributors;
-      ++i;
-   }
-
-   //***
-   // The target pixel has been established. Now need to compute the actual
-   // remap quantities that will be written to the appropriate remap grids:
-   //***
-   i = 0;
-   for(source=sources_list.begin();
-       source!=sources_list.end();
-       source++)
-   {
-      computeRemapNode(*source, contributor_pixel[i], &target_pixel);
-      ++i;
-   }
-
-   // ***
-   // Delete locally allocated memory:
-   // ***
-   for (i=0; i<num_contributors; ++i)
-   {
-      delete [] contributor_pixel[i];
-   }
-   delete [] contributor_pixel;
-   
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMonoGridRemapEngine::computeSourceValue
-//  
-//*****************************************************************************
-void ossimMonoGridRemapEngine::computeSourceValue(
-   ossimRefPtr<ossimImageData>& source, void* result)
-{
-   static const char MODULE[]="ossimMonoGridRemapEngine::computeSourceValue";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // This engine defines "value" as the MONO vector corresponding to the mean
-   // MONO pixel value of the source data:
-   //***
-   ((double*)result)[0] = source->computeAverageBandValue(0);
-   
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMonoGridRemapEngine::computeRemapNode
-//
-//  This engine defines the remap value as the difference between the target
-//  MONO vector and the individual point source's value vector.
-//
-//*****************************************************************************
-void ossimMonoGridRemapEngine::computeRemapNode(ossimAtbPointSource* ps,
-                                              void* source_value,
-                                              void* target_value)
-{
-   static const char MODULE[] = "ossimMonoGridRemapEngine::computeRemapNode";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // Compute the remap grid node value specific to this MONO implementation:
-   //***
-   double node;
-   node = ((double*)target_value)[0] - ((double*)source_value)[0];
-
-   //***
-   // Fetch a pointer to the remapper feeding this point source in order to
-   // pass it the node value:
-   //***
-   ossimGridRemapSource* remapper = ps->getRemapSource();
-   remapper->setGridNode(ps->getViewPoint(), &node);
-                         
-   if (traceDebug() || TRACE_FLAG)
-   {
-      CLOG << "DEBUG -- "
-           << "\n\t ps->getViewPoint() = "<<ps->getViewPoint()
-           << "\n\t source_value = "<<((double*)source_value)[0]
-           << "\n\t target_value = "<<((double*)target_value)[0]
-           << "\n\t node = "<<node
-           << "\n\t remapper at "<<remapper<<endl;
-   }
-
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimMultiBandHistogramTileSource.cpp b/ossim/src/ossim/imaging/ossimMultiBandHistogramTileSource.cpp
deleted file mode 100644
index 6536d98..0000000
--- a/ossim/src/ossim/imaging/ossimMultiBandHistogramTileSource.cpp
+++ /dev/null
@@ -1,369 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimMultiBandHistogramTileSource.cpp 17195 2010-04-23 17:32:18Z dburken $
-#include <ossim/imaging/ossimMultiBandHistogramTileSource.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeyword.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <algorithm>
-
-static const char* MIN_VALUE_PERCENT_KW = "min_percent";
-static const char* MAX_VALUE_PERCENT_KW = "max_percent";
-static const char* ALGORITHM_KW         = "algorithm";
-
-RTTI_DEF1(ossimMultiBandHistogramTileSource,
-          "ossimMultiBandHistogramTileSource",
-          ossimImageSourceHistogramFilter)
-   
-ossimMultiBandHistogramTileSource::ossimMultiBandHistogramTileSource()
-   : ossimImageSourceHistogramFilter(),
-     theTile(0),
-     theAlgorithm(OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM)
-{
-   disableSource();
-}
-
-ossimMultiBandHistogramTileSource::ossimMultiBandHistogramTileSource(
-   double /* minValuePercent */,
-   double /* maxValuePercent */,
-   ossimImageSource* inputSource,
-   ossimMultiResLevelHistogram* histogram)
-   : ossimImageSourceHistogramFilter(inputSource, histogram),
-     theTile(0),
-     theAlgorithm(OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM)
-{
-   disableSource();
-}
-
-ossimMultiBandHistogramTileSource::~ossimMultiBandHistogramTileSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimMultiBandHistogramTileSource::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection) return 0;
-   
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
-                                                                       resLevel);
-   
-   if(!isSourceEnabled() || !inputTile.valid())
-   {
-      return inputTile;
-   }
-
-   if(!theTile.valid())
-   {
-      allocate(); // First time through...
-   }
-   
-   if( !theTile.valid() ||
-       !theMinValuePercentArray.size() ||
-       !theMaxValuePercentArray.size() )
-   {
-      return inputTile;
-   }
-   
-   theTile->setImageRectangle(tileRect);
-   if(inputTile->getBuf()&&
-      (inputTile->getDataObjectStatus()!=OSSIM_EMPTY))
-   {
-      theTile->loadTile(inputTile.get());
-      switch(inputTile->getScalarType())
-      {
-         case OSSIM_UCHAR:
-         {
-            return runLinearStretchAlgorithm((ossim_uint8)0,
-                                             theTile);
-         }
-         case OSSIM_USHORT16:
-         case OSSIM_USHORT11:
-         {
-            return runLinearStretchAlgorithm((ossim_uint16)0,
-                                             theTile);
-         }
-         case OSSIM_SSHORT16:
-         {
-            return runLinearStretchAlgorithm(static_cast<ossim_sint16>(0),
-                                             theTile);
-         }
-         case OSSIM_DOUBLE:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            return runLinearStretchAlgorithm(static_cast<double>(0),
-                                             theTile);
-         }
-         case OSSIM_FLOAT:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            return runLinearStretchAlgorithm(static_cast<float>(0),
-                                             theTile);
-         }
-         case OSSIM_SCALAR_UNKNOWN:
-         default:
-         {
-            ossimSetError("ossimMultiBandHistogramTileSource",
-                          ossimErrorCodes::OSSIM_ERROR,
-                          "Unknown scalar type");
-            break;
-         }
-      }
-      theTile->validate();
-      return theTile;
-   }
-   
-   return inputTile;
-}
-
-void ossimMultiBandHistogramTileSource::initialize()
-{
-   ossimImageSourceHistogramFilter::initialize();
-
-   // Force an allocate on the next getTile.
-   theTile = 0;
-}
-
-void ossimMultiBandHistogramTileSource::allocate()
-{
-   theTile = ossimImageDataFactory::instance()->create(this, this);
-
-   if(theTile.valid())
-   {
-      theTile->initialize();
-
-      ossim_uint32 numberOfBands = theTile->getNumberOfBands();
-      ossim_uint32 i = 0;
-      if(numberOfBands)
-      {
-         std::vector<double> copyArray;
-         
-         if(numberOfBands > theMinValuePercentArray.size())
-         {
-            copyArray = theMinValuePercentArray;
-            theMinValuePercentArray.resize(numberOfBands);
-            if(numberOfBands < copyArray.size())
-            {
-               std::copy(copyArray.begin(),
-                         copyArray.end(),
-                         theMinValuePercentArray.begin());
-            }
-            else
-            {
-               std::copy(copyArray.begin(),
-                         copyArray.begin() + copyArray.size(),
-                         theMinValuePercentArray.begin());
-            }
-         }
-         if(numberOfBands != theMaxValuePercentArray.size())
-         {
-            copyArray = theMaxValuePercentArray;
-            theMaxValuePercentArray.resize(numberOfBands);
-            if(numberOfBands < copyArray.size())
-            {
-               std::copy(copyArray.begin(),
-                         copyArray.end(),
-                         theMaxValuePercentArray.begin());
-            }
-            else
-            {
-               std::copy(copyArray.begin(),
-                         copyArray.begin() + copyArray.size(),
-                         theMaxValuePercentArray.begin());
-            }
-         }
-         if(numberOfBands > theMinValuePercentArray.size())
-         {
-            for(i = (ossim_uint32)theMinValuePercentArray.size(); i < numberOfBands; ++i)
-            {
-               theMinValuePercentArray[i] = 0.0;
-               theMaxValuePercentArray[i] = 0.0;
-            }
-         }
-      }
-   }
-}
-
-bool ossimMultiBandHistogramTileSource::loadState(const ossimKeywordlist& kwl,
-                                           const char* prefix)
-{
-   theMinValuePercentArray.clear();
-   theMaxValuePercentArray.clear();
-   if(ossimImageSourceHistogramFilter::loadState(kwl, prefix))
-   {
-      ossimNotify(ossimNotifyLevel_INFO) << "ossimMultiBandHistogramTileSource::loadState INFO: histogram filter was loaded" << std::endl;
-      ossimString regExpression = ossimString("^(") + ossimString(prefix) + ossimString(MIN_VALUE_PERCENT_KW) + ossimString("[0-9]+)");
-
-      long numberOfSources = kwl.getNumberOfSubstringKeys(regExpression);
-      
-      unsigned long numberOfMatches = 0;
-      ossim_uint32 i = 0;
-      while(numberOfMatches < static_cast<unsigned long>(numberOfSources))
-      {
-         ossimString key = ossimString(MIN_VALUE_PERCENT_KW) + ossimString::toString(i);
-         const char* value = kwl.find(prefix, key); 
-         if(value)
-         {
-            theMinValuePercentArray.push_back(ossimString(value).toDouble());
-            ++numberOfMatches;
-         }      
-         ++i;
-      }
-
-      numberOfMatches = 0;
-      i               = 0;
-      regExpression = ossimString("^(") + ossimString(prefix) + ossimString(MAX_VALUE_PERCENT_KW) + ossimString("[0-9]+)");
-      numberOfSources = kwl.getNumberOfSubstringKeys(regExpression);
-      while(numberOfMatches < static_cast<unsigned long>(numberOfSources))
-      {
-         ossimString key = ossimString(MAX_VALUE_PERCENT_KW) + ossimString::toString(i);
-         const char* value = kwl.find(prefix, key); 
-
-         if(value)
-         {
-            theMaxValuePercentArray.push_back(ossimString(value).toDouble());
-            ++numberOfMatches;
-         }      
-         ++i;
-      }
-
-      ossimString algorithm = kwl.find(prefix,
-                                       ALGORITHM_KW);
-      algorithm = algorithm.downcase();
-      theAlgorithm = OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM;
-      if(algorithm != "")
-      {
-         if(algorithm.contains("linear"))
-         {
-           theAlgorithm = OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM;
-         }
-      }
-   }
-   return true;
-}
-
-bool ossimMultiBandHistogramTileSource::saveState(ossimKeywordlist& kwl,
-                                           const char* prefix)const
-{
-   ossimImageSourceHistogramFilter::saveState(kwl, prefix);
-   ossim_int32 i = 0;
-
-   for(i = 0; i< (ossim_int32)theMinValuePercentArray.size();++i)
-   {
-      kwl.add(prefix,
-              ossimString(MIN_VALUE_PERCENT_KW) + ossimString::toString(i),
-              theMinValuePercentArray[i],
-              true);
-   }
-   for(i = 0; i< (ossim_int32)theMaxValuePercentArray.size();++i)
-   {
-      kwl.add(prefix,
-              ossimString(MAX_VALUE_PERCENT_KW) + ossimString::toString(i),
-              theMaxValuePercentArray[i],
-              true);
-   }
-   ossimString algorithmString;
-
-   switch(theAlgorithm)
-   {
-   case OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM:
-   {
-      algorithmString = "linear_stretch";
-      break;
-   }
-   case OSSIM_HISTOGRAM_NO_ALGORITHM:
-   {
-      algorithmString = "none";
-      break;
-   }
-   default:
-   {
-      algorithmString = "none";
-      break;
-   }
-   }
-
-   kwl.add(prefix,
-           ALGORITHM_KW,
-           algorithmString.c_str(),
-           true);
-   
-   return true;
-}
-
-template <class T>
-ossimRefPtr<ossimImageData> ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(
-   T /* dummyVariable */, ossimRefPtr<ossimImageData>& tile)
-{
-   if(!getHistogram())
-   {
-      return tile;
-   }
-
-   ossimRefPtr<ossimMultiBandHistogram> histo    = getHistogram()->getMultiBandHistogram(theCurrentResLevel);
-   if(histo.valid())
-   {
-      ossim_uint32 maxBands = ( (histo->getNumberOfBands() >
-                           tile->getNumberOfBands())?
-                          tile->getNumberOfBands():
-                          histo->getNumberOfBands());
-
-      long offsetUpperBound = tile->getHeight()*tile->getWidth();
-
-      for(ossim_uint32 band = 0; band < maxBands; ++band)
-      {
-         ossimRefPtr<ossimHistogram> h  = histo->getHistogram(band);
-         
-         T* buf   = static_cast<T*>(tile->getBuf(band));
-         T np     = static_cast<T>(tile->getNullPix(band));
-         T minPix = static_cast<T>(tile->getMinPix(band));
-         T maxPix = static_cast<T>(tile->getMaxPix(band));
-         T range  = (maxPix - minPix);
-         if(h.valid()&&buf)
-         {
-            
-            double maxClip = minPix + (h->HighClipVal(theMaxValuePercentArray[band])/(double)h->GetRes())*range;
-            double minClip = minPix + (h->LowClipVal(theMinValuePercentArray[band])/(double)h->GetRes())*range;
-            double delta   = (maxClip - minClip);
-            
-            if(fabs(delta) > 0.0)
-            {
-               for(long offset = 0; offset < offsetUpperBound; ++offset)
-               {
-                  if(buf[offset] != np)
-                  {
-                     if(buf[offset] < minClip)
-                     {
-                        buf[offset] = minPix;
-                     }
-                     else if(buf[offset] > maxClip)
-                     {
-                        buf[offset] = maxPix;
-                     }
-                     else
-                     {
-                        T value = static_cast<T>(minPix + ((buf[offset] - minClip)/delta)*range);
-                        buf[offset] = value>maxPix?maxPix:value;
-                     }
-                  }
-               }
-            }
-         }
-      }
-
-      tile->validate();
-   }
-   
-   return tile;
-}
diff --git a/ossim/src/ossim/imaging/ossimNBandToIndexFilter.cpp b/ossim/src/ossim/imaging/ossimNBandToIndexFilter.cpp
deleted file mode 100644
index 869f22e..0000000
--- a/ossim/src/ossim/imaging/ossimNBandToIndexFilter.cpp
+++ /dev/null
@@ -1,566 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimNBandToIndexFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimNBandToIndexFilter.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimFilenameProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-
-static const char* KEEP_QUANTIZED_VALUE_FLAG_KW = "keep_quantized_value_flag";
-
-RTTI_DEF1(ossimNBandToIndexFilter,
-          "ossimNBandToIndexFilter",
-          ossimImageSourceFilter);
-
-ossimNBandToIndexFilter::ossimNBandToIndexFilter()
-   :ossimImageSourceFilter(),
-    theLut(0),
-    theTile(0),
-    theKeepQuantizedValueFlag(false)
-{
-}
-
-ossimNBandToIndexFilter::~ossimNBandToIndexFilter()
-{
-}
-
-void ossimNBandToIndexFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   // Force allocate on next getTile.
-   theTile      = 0;
-   if(theLut.valid())
-   {
-      if(theKeepQuantizedValueFlag)
-      {
-         ossimNBandLutDataObject::LUT_ENTRY_TYPE minValue;
-         ossimNBandLutDataObject::LUT_ENTRY_TYPE maxValue;
-         ossim_uint32 bands = theLut->getNumberOfBands();
-         ossim_uint32 idx   = 0;
-         if(theMinValues.size() != bands)
-         {
-            theMinValues.resize(bands);
-            theMaxValues.resize(bands);
-            theNullValues.resize(bands);
-         }
-         std::fill(theNullValues.begin(),
-                   theNullValues.end(), 0);
-         for(idx = 0; idx < bands; ++idx)
-         {
-            theLut->getMinMax(idx, minValue, maxValue);
-            theMinValues[idx] = minValue;
-            theMaxValues[idx] = maxValue;
-            theNullValues[idx] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(ossimImageSourceFilter::getNullPixelValue(idx));
-         }
-      }
-      else
-      {
-         if(theMinValues.size() != 1)
-         {
-            theMinValues.resize(1);
-            theMaxValues.resize(1);
-            theNullValues.resize(1);
-         }
-         theMinValues[0]  = 0;
-         theMaxValues[0]  = theLut->getNumberOfEntries()-1;
-         theNullValues[0] = theLut->getNullPixelIndex();
-      }
-   }
-}
-
-void ossimNBandToIndexFilter::allocate()
-{
-   theTile      = 0;
-   
-   if(isSourceEnabled()&&theInputConnection)
-   {
-      theTile      = ossimImageDataFactory::instance()->create(this, this);
-      if(theTile.valid())
-      {
-         theTile->initialize();
-      }
-   }
-}
-
-void ossimNBandToIndexFilter::disableSource()
-{
-   ossimImageSourceFilter::disableSource();
-   theTile = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::getTile(const ossimIrect& origin,
-                                                             ossim_uint32 resLevel)
-{
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getTile(origin, resLevel);
-   }
-   if(!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   if(!theTile.valid())
-   {
-      allocate();
-   }
-   
-   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(origin,
-                                                                   resLevel);
-
-   if(!theTile.valid() || !input.valid())
-   {
-      return input;
-   }
-
-   theTile->setImageRectangle(origin);
-   theTile->setDataObjectStatus(OSSIM_FULL);
-   theTile->makeBlank();
-
-   return convertInputTile(input.get());
-}
-
-ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertInputTile(ossimImageData* tile)
-{
-   switch(getOutputScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         return convertOutputTileTemplate((ossim_uint8)0,
-                                          tile);
-         break;
-      }
-      case OSSIM_UINT16:
-      {
-         return convertOutputTileTemplate((ossim_uint16)0,
-                                          tile);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         return convertOutputTileTemplate((ossim_uint32)0,
-                                         tile);
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimNBandToIndexFilter::convertInputTile: Unsupported scalar type for conversion" << std::endl;
-      }
-   }
-
-   return theTile;
-}
-
-template <class T>
-ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertOutputTileTemplate(T outputDummy,
-                                                                               ossimImageData* inputTile)
-{
-   switch(inputTile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         return convertInputTileToOutputTemplate((ossim_uint8)0,
-                                                 outputDummy,
-                                                 inputTile);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         return convertInputTileToOutputTemplate((ossim_sint8)0,
-                                                 outputDummy,
-                                                 inputTile);
-      }
-      case OSSIM_UINT16:
-      {
-         return convertInputTileToOutputTemplate((ossim_uint16)0,
-                                                 outputDummy,
-                                                 inputTile);
-      }
-      case OSSIM_SINT32:
-      {
-         return convertInputTileToOutputTemplate((ossim_sint32)0,
-                                                 outputDummy,
-                                                 inputTile);
-      }
-      case OSSIM_UINT32:
-      {
-         return convertInputTileToOutputTemplate((ossim_uint32)0,
-                                                 outputDummy,
-                                                 inputTile);
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "convertInputTileToOutputTemplate::convertOutputTileTemplate: Unsupported scalar type for conversion." << std::endl;
-      }
-   }
-
-   return theTile;
-}
-
-template <class T1, class T2>
-ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertInputTileToOutputTemplate(
-   T1 /* inputDummy */,
-   T2 /* outputDummy */,
-   ossimImageData* inputTile)
-{
-   if (!inputTile)
-   {
-      return theTile;
-   }
-   
-   const ossim_uint32 BANDS = inputTile->getNumberOfBands();
-
-   if (!BANDS)
-   {
-      return theTile;
-   }
-//   T2** outBand = (T2*)theTile->getBuf();
-
-   ossim_uint32 numberOfBands = theLut->getNumberOfBands();
-   
-   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> bandValuesTemplate(numberOfBands);
-
-   ossimNBandLutDataObject::LUT_ENTRY_TYPE* bandValues = &bandValuesTemplate.front();//new ossimNBandLutDataObject::LUT_ENTRY_TYPE[numberOfBands];
-
-   std::fill(bandValuesTemplate.begin(), bandValuesTemplate.end(), 0);
-   numberOfBands = ossim::min(BANDS,
-                            numberOfBands);
-   if(!numberOfBands) return theTile;
-   std::vector<T1*> band(numberOfBands);
-   std::vector<T2*> outBand(numberOfBands);
-  // T1** band = new T1*[numberOfBands];
-   //T2** outBand = new T2*[numberOfBands];
-   ossim_int32 idx   = 0;
-
-   for(idx = 0; idx < (ossim_int32)numberOfBands; ++idx)
-   {
-      band[idx] = (T1*)inputTile->getBuf(idx);
-      outBand[idx] = (T2*)theTile->getBuf(idx);
-   }
-   if(band[0])
-   {
-      if(inputTile->getDataObjectStatus() == OSSIM_FULL)
-      {
-         ossim_uint32 upper = inputTile->getWidth()*inputTile->getHeight();
-         ossim_uint32 idx2=0;
-         for(ossim_uint32 offset = 0; offset < upper; ++offset)
-         {
-            for(idx2 = 0; idx2 < numberOfBands; ++idx2)
-            {
-               bandValues[idx2] = *band[idx2];
-               ++band[idx2];
-            }
-            //---
-            // Note call the ossimNBandLutDataObject::findIndex that takes a size as the input
-            // data may have dropped the alpha channel.
-            //---
-            idx = theLut->findIndex(bandValues, numberOfBands);
-
-            if(!theKeepQuantizedValueFlag)
-            {
-               *outBand[0] = (T2)idx;
-               ++outBand[0];
-            }
-            else
-            {
-               for(idx2 = 0; idx2 < numberOfBands; ++idx2)
-               {
-                  if(idx >=0)
-                  {
-                     *outBand[idx2] = (T2)(*theLut)[idx][idx2];
-                     ++outBand[idx2];
-                  }
-               }
-            }
-         }
-      }
-      else if(inputTile->getDataObjectStatus() == OSSIM_PARTIAL)
-      {
-         ossim_uint32 upper = inputTile->getWidth()*inputTile->getHeight();
-         ossim_uint32 idx2=0;
-         for(ossim_uint32 offset = 0; offset < upper; ++offset)
-         {
-            for(idx2 = 0; idx2 < numberOfBands; ++idx2)
-            {
-               bandValues[idx2] = *band[idx2];
-               ++band[idx2];
-            }
-            idx = -1;
-            if(!inputTile->isNull(offset))
-            {
-               //---
-               // Note call the ossimNBandLutDataObject::findIndex that takes a size as the input
-               // data may have dropped the alpha channel.
-               //---
-               idx = theLut->findIndex(bandValues, numberOfBands);
-            }
-            if(!theKeepQuantizedValueFlag)
-            {
-               if(idx>=0)
-               {
-                  *outBand[0] = (T2)idx;
-               }
-               ++outBand[0];
-            }
-            else
-            {
-               for(idx2 = 0; idx2 < numberOfBands; ++idx2)
-               {
-                  if(idx >=0)
-                  {
-                     if(idx>=0)
-                     {
-                        *outBand[idx2] = (T2)(*theLut)[idx][idx2];
-                     }
-                  }
-                  ++outBand[idx2];
-               }
-            }
-         }
-      }
-   }
-   if(theKeepQuantizedValueFlag)
-   {
-      theTile->validate();
-   }
-   else
-   {
-      theTile->setDataObjectStatus(OSSIM_FULL);
-   }
-
-  
-   return theTile;
-}
-
-bool ossimNBandToIndexFilter::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)const
-{
-   ossimString newPrefix = prefix;
-   newPrefix = newPrefix + "lut.";
-
-   if(theLut.valid())
-   {
-      theLut->saveState(kwl, newPrefix.c_str());
-   }
-
-   kwl.add(prefix,
-           KEEP_QUANTIZED_VALUE_FLAG_KW,
-           theKeepQuantizedValueFlag?"true":"false",
-           true);
-           
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimNBandToIndexFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   ossimString newPrefix = prefix;
-   newPrefix = newPrefix + "lut.";
-
-   if(!theLut.valid())
-   {
-      theLut = new ossimNBandLutDataObject;
-   }
-   theLut->loadState(kwl, newPrefix.c_str());
-
-   const char* flag = kwl.find(prefix, KEEP_QUANTIZED_VALUE_FLAG_KW);
-   if(flag)
-   {
-      theKeepQuantizedValueFlag = ossimString(flag).toBool();
-   }
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-bool ossimNBandToIndexFilter::isSourceEnabled()const
-{
-   bool result = ossimSource::isSourceEnabled()&&theInputConnection;
-
-   // only support 3 band integral values, no floating point for now.
-   //
-   if(result)
-   {
-      
-      ossimScalarType inputScalarType = theInputConnection->getOutputScalarType();
-      if(!theLut.valid() ||
-         (theLut->getNumberOfEntries()<1)||
-         (inputScalarType==OSSIM_FLOAT32)||
-         (inputScalarType==OSSIM_FLOAT64)||
-         (theInputConnection->getNumberOfOutputBands()!=3))
-      {
-         result = false;
-      }
-   }
-   
-   return result;
-}
-
-ossim_uint32 ossimNBandToIndexFilter::getNumberOfOutputBands() const
-{
-   if(isSourceEnabled())
-   {
-      if(theKeepQuantizedValueFlag)
-      {
-         if(theLut.valid())
-         {
-            return theLut->getNumberOfBands();
-         }
-      }
-      else
-      {
-         return 1;
-      }
-   }
-   
-   return ossimImageSourceFilter::getNumberOfOutputBands();
-}
-   
-ossimScalarType ossimNBandToIndexFilter::getOutputScalarType() const
-{
-   if(isSourceEnabled())
-   {
-      
-      ossim_uint32 numberOfEntries = theLut->getNumberOfEntries();
-      
-      if(numberOfEntries < 257)
-      {
-         return OSSIM_UCHAR;
-      }
-      else if(numberOfEntries < 65537)
-      {
-         return OSSIM_UINT16;
-      }
-      else
-      {
-         return OSSIM_UINT32;
-      }
-   }
-   
-   return ossimImageSourceFilter::getOutputScalarType();
-}
-
-void ossimNBandToIndexFilter::setLut(ossimNBandLutDataObject& lut)
-{
-   theLut = new ossimNBandLutDataObject(lut);
-}
-
-double ossimNBandToIndexFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   if(isSourceEnabled())
-   {
-      if(theLut->getNullPixelIndex() >= 0)
-      {
-         return theLut->getNullPixelIndex();
-      }
-   }
-   
-   return ossimImageSourceFilter::getNullPixelValue(band);
-}
-
-double ossimNBandToIndexFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   if(isSourceEnabled())
-   {
-      if(band < theMinValues.size())
-      {
-         return (double)theMinValues[band];
-      }
-   }
-//    if(isSourceEnabled())
-//    {
-//       if(getNullPixelValue() != 0)
-//       {
-//          return 0;
-//       }
-//       else
-//       {
-//          return 1;
-//       }
-//       return 0;
-//    }
-   
-   return ossimImageSourceFilter::getMinPixelValue();
-}
-
-double ossimNBandToIndexFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(isSourceEnabled())
-   {
-      if(band < theMaxValues.size())
-      {
-         return (double)theMaxValues[band];
-      }
-//       if(theLut->getNullPixelIndex() != ((ossim_int32)(theLut->getNumberOfEntries())-1))
-//       {
-//          return theLut->getNumberOfEntries();
-//       }
-//       else
-//       {
-//          return (theLut->getNumberOfEntries()-1);
-//       }
-   }
-   
-   return ossimImageSourceFilter::getMaxPixelValue();
-}
-
-void ossimNBandToIndexFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(property->getName() == ossimKeywordNames::FILENAME_KW)
-   {
-      ossimKeywordlist kwl;
-      if(kwl.addFile(ossimFilename(property->valueToString())))
-      {
-         theLut = new ossimNBandLutDataObject;
-         theLut->loadState(kwl);
-      }
-   }
-   else if(property->getName() == KEEP_QUANTIZED_VALUE_FLAG_KW)
-   {
-      theKeepQuantizedValueFlag = property->valueToString().toBool();
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNBandToIndexFilter::getProperty(const ossimString& name)const
-{
-   if(name == ossimKeywordNames::FILENAME_KW)
-   {
-      ossimFilenameProperty* property = new ossimFilenameProperty(name, theLutFilename);
-      property->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      property->setCacheRefreshBit();
-      
-      return property;
-   }
-   else if(name == KEEP_QUANTIZED_VALUE_FLAG_KW)
-   {
-      ossimBooleanProperty* property = new ossimBooleanProperty(name, theKeepQuantizedValueFlag);
-      property->setCacheRefreshBit();
-
-      return property;
-   }
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimNBandToIndexFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(ossimKeywordNames::FILENAME_KW);
-   propertyNames.push_back(KEEP_QUANTIZED_VALUE_FLAG_KW);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimNitf20Writer.cpp b/ossim/src/ossim/imaging/ossimNitf20Writer.cpp
deleted file mode 100644
index 21da55f..0000000
--- a/ossim/src/ossim/imaging/ossimNitf20Writer.cpp
+++ /dev/null
@@ -1,833 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimNitf20Writer.cpp 2982 2011-10-10 21:28:55Z david.burken $
-
-
-#include <ossim/imaging/ossimNitf20Writer.h>
-#include <ossim/imaging/ossimNitfTileSource.h>
-#include <ossim/base/ossimDate.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimRpcSolver.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/imaging/ossimRectangleCutFilter.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
-#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
-#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
-#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
-#include <ossim/support_data/ossimNitfNameConversionTables.h>
-#include <ossim/support_data/ossimNitfBlockaTag.h>
-#include <tiffio.h>
-#include <fstream>
-#include <algorithm>
-#include <sstream>
-#include <iomanip>
-
-RTTI_DEF1(ossimNitf20Writer, "ossimNitf20Writer", ossimNitfWriterBase);
-
-static ossimTrace traceDebug(ossimString("ossimNitfWriter:debug"));
-     
-static ossimString monthConversionTable[] = {"   ", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
-
-ossimNitf20Writer::ossimNitf20Writer(const ossimFilename& filename,
-                                     ossimImageSource* inputSource)
-   : ossimNitfWriterBase(filename, inputSource),
-     theOutputStream(0),
-     theFileHeader(),
-     theImageHeader(),
-     theEnableRpcbTagFlag(false),
-     theEnableBlockaTagFlag(true),
-     theCopyFieldsFlag(false)
-{
-   //---
-   // Since the internal nitf tags are not very accurate, write an external
-   // geometry out as default behavior.  Users can disable this via the
-   // property interface or keyword list.
-   //---
-   setWriteExternalGeometryFlag(true);
-   
-   theFileHeader      = new ossimNitfFileHeaderV2_0;
-   theImageHeader     = new ossimNitfImageHeaderV2_0;
-   theOutputImageType = "nitf20_block_band_separate";
-
-   // These are always set:
-   theFileHeader->setEncryption( ossimString("0") );
-   theImageHeader->setJustification( ossimString("R") );
-   
-   // Set any site defaults.
-   initializeDefaultsFromConfigFile(
-      dynamic_cast<ossimNitfFileHeaderV2_X*>(theFileHeader.get()),
-      dynamic_cast<ossimNitfImageHeaderV2_X*>(theImageHeader.get()) );
-}
-
-ossimNitf20Writer::~ossimNitf20Writer()
-{
-   //---
-   // This looks like a leak but it's not as both of these are ossimRefPtr's.
-   //---
-   theFileHeader=0;
-   theImageHeader=0;
-   
-   close();
-}
-
-bool ossimNitf20Writer::isOpen()const
-{
-   return (theOutputStream != 0);
-}
-
-bool ossimNitf20Writer::open()
-{
-   if(isOpen())
-   {
-      close();
-   }
-   theOutputStream = new std::ofstream;
-   theOutputStream->open(theFilename.c_str(), ios::out|ios::binary);
-   
-   return theOutputStream->good();
-}
-
-void ossimNitf20Writer::close()
-{
-   if(theOutputStream)
-   {
-      theOutputStream->close();
-      delete theOutputStream;
-      theOutputStream = (std::ofstream*)0;
-   }
-}
-
-bool ossimNitf20Writer::writeFile()
-{
-   if(!theInputConnection->isMaster())
-   {
-      theInputConnection->slaveProcessTiles();
-
-      return true;
-   }
-
-   open();
-
-   if (!isOpen())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitf20Writer::writeFile ERROR:"
-            << " Could not open!  Returning..."
-            << std::endl;
-      }
-
-      return false;
-   }
-
-   // Write out the geometry info.
-   writeGeometry(theImageHeader.get(), theInputConnection.get());
-   
-   addTags();
-   
-   bool result = false;
-   if((theOutputImageType == "nitf20_block_band_separate")||
-      (theOutputImageType == "image/nitf20"))
-   {
-      result =  writeBlockBandSeparate();
-   }
-   else if(theOutputImageType == "nitf20_block_band_sequential")
-   {
-      result =  writeBlockBandSequential();
-   }
-   
-   close();
-   
-   return result;
-}
-
-void ossimNitf20Writer::getImageTypeList(std::vector<ossimString>& imageTypeList)const
-{
-   imageTypeList.push_back(ossimString("nitf20_block_band_separate"));
-   imageTypeList.push_back(ossimString("nitf20_block_band_sequential"));
-}
-
-void ossimNitf20Writer::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-   
-   ossimString name = property->getName();
-   
-   if(name == "file_header")
-   {
-      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
-                                                           property.get());
-      if(containerProperty)
-      {
-         std::vector<ossimRefPtr<ossimProperty> > propertyList;
-         containerProperty->getPropertyList(propertyList);
-         theFileHeader->setProperties(propertyList);
-      }
-   }
-   else if(name == "image_header")
-   {
-      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
-                                                           property.get());
-      if(containerProperty)
-      {
-         std::vector<ossimRefPtr<ossimProperty> > propertyList;
-         containerProperty->getPropertyList(propertyList);
-         theImageHeader->setProperties(propertyList);
-      }
-   }
-   else if (name == "enable_rpcb_tag")
-   {
-      theEnableRpcbTagFlag = property->valueToString().toBool();
-   }
-   else if (name == "enable_blocka_tag")
-   {
-      theEnableBlockaTagFlag = property->valueToString().toBool();
-   }
-   else if(name == "copy_fields_flag")
-   {
-      theCopyFieldsFlag = property->valueToString().toBool();
-   }
-   else
-   {
-      // just in case it was an nitf specific tag we can pass it safely like this
-      theFileHeader->setProperty(property);
-      theImageHeader->setProperty(property);
-      ossimImageFileWriter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitf20Writer::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   
-   if(name == "file_header")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      std::vector<ossimRefPtr<ossimProperty> > propertyList;
-      
-      theFileHeader->getPropertyList(propertyList);
-      container->addChildren(propertyList);
-      
-      result = container;
-   }
-   else if(name == "image_header")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      std::vector<ossimRefPtr<ossimProperty> > propertyList;
-      
-      theImageHeader->getPropertyList(propertyList);
-      container->addChildren(propertyList);
-      
-      result = container;
-   }
-   else if(name == "enable_rpcb_tag")
-   {
-      ossimBooleanProperty* boolProperty =
-         new ossimBooleanProperty(name, theEnableRpcbTagFlag);
-
-      result = boolProperty;
-   }   
-   else if(name == "enable_blocka_tag")
-   {
-      ossimBooleanProperty* boolProperty =
-         new ossimBooleanProperty(name, theEnableBlockaTagFlag);
-
-      result = boolProperty;
-   }   
-   else if(name == "copy_fields_flag")
-   {
-      ossimBooleanProperty* boolProperty =
-      new ossimBooleanProperty(name, theCopyFieldsFlag);
-      
-      result = boolProperty;
-   }
-   else
-   {
-      return ossimImageFileWriter::getProperty(name);
-   }
-
-   return result;
-}
-
-void ossimNitf20Writer::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageFileWriter::getPropertyNames(propertyNames);
-
-   propertyNames.push_back("file_header");
-   propertyNames.push_back("image_header");
-   propertyNames.push_back("enable_rpcb_tag");
-   propertyNames.push_back("enable_blocka_tag");
-   propertyNames.push_back("copy_fields_flag");
-}
-
-bool ossimNitf20Writer::writeBlockBandSeparate()
-{
-   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
-   ossim_uint64 byteSize      = ossim::scalarSizeInBytes(scalarType);
-   ossimIrect rect            = theInputConnection->getBoundingRect();
-   ossim_uint64 bands         = theInputConnection->getNumberOfOutputBands();
-   ossim_uint64 idx           = 0;
-   ossim_uint64 headerStart   = (ossim_uint64)theOutputStream->tellp();
-
-   ossimIpt blockSize(64, 64);
-   ossim_uint64 blocksHorizontal = (ossim_uint32)ceil(((double)rect.width()/(double)blockSize.x));
-   ossim_uint64 blocksVertical   = (ossim_uint32)ceil(((double)rect.height()/(double)blockSize.y));
-
-   ossimNitfImageInfoRecordV2_0 imageInfoRecord;
-   //imageInfoRecord.setSubheaderLength(439); // ok if no tags
-   imageInfoRecord.setImageLength(bands*byteSize*blocksVertical*blockSize.y*blocksHorizontal*blockSize.x);
-
-   theFileHeader->addImageInfoRecord(imageInfoRecord);
-
-   //---
-   // This makes space for the file header; it is written again at the end of
-   // this method with updated values
-   // need a better way to get the length.  This should be queried on the
-   // header before writing
-   //---
-   theFileHeader->writeStream(*theOutputStream); 
-   ossim_uint64 headerLength = ((ossim_uint64)theOutputStream->tellp() - headerStart) /* + 1 */;
-   
-   ossimString representation;
-   theImageHeader->setActualBitsPerPixel(
-      ossim::getActualBitsPerPixel(scalarType));
-   theImageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
-   theImageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
-   theImageHeader->setNumberOfBands(bands);
-   theImageHeader->setImageMode('B');// blocked
-
-   if((bands == 3)&&
-      (scalarType == OSSIM_UCHAR))
-   {
-      theImageHeader->setRepresentation("RGB");
-      theImageHeader->setCategory("VIS");
-   }
-   else if(bands == 1)
-   {
-      theImageHeader->setRepresentation("MONO");
-      theImageHeader->setCategory("MS");
-   }
-   else
-   {
-      theImageHeader->setRepresentation("MULTI");
-      theImageHeader->setCategory("MS");
-   }
-   
-   theImageHeader->setBlocksPerRow(blocksHorizontal);
-   theImageHeader->setBlocksPerCol(blocksVertical);
-   theImageHeader->setNumberOfPixelsPerBlockRow(blockSize.x);
-   theImageHeader->setNumberOfPixelsPerBlockCol(blockSize.y);
-   theImageHeader->setNumberOfRows(rect.height());
-   theImageHeader->setNumberOfCols(rect.width());
-
-   ossimNitfImageBandV2_0 bandInfo;
-   for(idx = 0; idx < bands; ++idx)
-   {
-      std::ostringstream out;
-      
-      out << std::setfill('0')
-          << std::setw(2)
-          << idx;
-      
-      bandInfo.setBandRepresentation(out.str().c_str());
-      theImageHeader->setBandInfo(idx,
-                              bandInfo);
-   }
-
-   ossim_uint64 imageHeaderStart = theOutputStream->tellp();
-   theImageHeader->writeStream(*theOutputStream);
-   ossim_uint64 imageHeaderEnd = theOutputStream->tellp();
-   ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
-
-   theInputConnection->setTileSize(blockSize);
-   ossim_uint64 numberOfTiles   = theInputConnection->getNumberOfTiles();
-   theInputConnection->setToStartOfSequence();
-   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
-   ossim_uint64 tileNumber = 1;
-   ossimEndian endian;
-
-   
-   while( data.valid() && !needsAborting())
-   {
-      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-      {
-         switch(data->getScalarType())
-         {
-            case OSSIM_USHORT16:
-            case OSSIM_USHORT11:
-            {
-               endian.swap((ossim_uint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_SSHORT16:
-            {
-               endian.swap((ossim_sint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_FLOAT:
-            case OSSIM_NORMALIZED_FLOAT:
-            {
-               endian.swap((ossim_float32*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_DOUBLE:
-            case OSSIM_NORMALIZED_DOUBLE:
-            {
-               endian.swap((ossim_float64*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            default:
-               break;
-         }
-      }
-      
-      theOutputStream->write((char*)(data->getBuf()),
-                             data->getSizeInBytes());
-      
-      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
-      
-      if(!needsAborting())
-      {
-         data = theInputConnection->getNextTile();
-      }
-      ++tileNumber;
-   }
-
-   std::streamoff pos = theOutputStream->tellp();
-
-   setComplexityLevel(pos, theFileHeader.get());
-
-   /*
-    * Need to change the way I compute file length and header length later
-    * We need to figure out a better way to compute.
-    */
-   theFileHeader->setFileLength(static_cast<ossim_uint64>(pos));
-   theFileHeader->setHeaderLength(headerLength);
-   theOutputStream->seekp(0, ios::beg);
-   imageInfoRecord.setSubheaderLength(imageHeaderSize);
-   theFileHeader->replaceImageInfoRecord(0, imageInfoRecord);
-   theFileHeader->writeStream(*theOutputStream);
-   
-   return true;
-}
-
-bool ossimNitf20Writer::writeBlockBandSequential()
-{
-   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
-   ossim_uint64    byteSize   = ossim::scalarSizeInBytes(scalarType);
-   ossimIrect      rect       = theInputConnection->getBoundingRect();
-   ossim_uint64    bands      = theInputConnection->getNumberOfOutputBands();
-   ossim_uint64    idx        = 0;
-   ossim_uint64    headerStart   = (ossim_uint64)theOutputStream->tellp();
-
-   ossimIpt blockSize(64, 64);
-
-   ossim_uint64 blocksHorizontal = theInputConnection->getNumberOfTilesHorizontal();
-   ossim_uint64 blocksVertical   = theInputConnection->getNumberOfTilesVertical();
-   theInputConnection->setTileSize(blockSize);
-   ossim_uint64 numberOfTiles   = theInputConnection->getNumberOfTiles();
-   theInputConnection->setToStartOfSequence();
-   
-   ossimNitfImageInfoRecordV2_0 imageInfoRecord;
- //  imageInfoRecord.setSubheaderLength(439);
-   imageInfoRecord.setImageLength(bands*byteSize*blocksHorizontal*blocksVertical*blockSize.x*blockSize.y);
-
-   ossimDate currentDate;
-   
-   theFileHeader->setDate(currentDate);
-   theFileHeader->addImageInfoRecord(imageInfoRecord);
-
-   //---
-   // This makes space for the file header; it is written again at the end of
-   // this method with updated values
-   // need a better way to get the length.  This should be queried on the
-   // header before writing
-   //---  
-   theFileHeader->writeStream(*theOutputStream);
-   ossim_uint64 headerLength = ((ossim_uint64)theOutputStream->tellp() - headerStart) /* + 1 */;
-   
-   ossimString representation;
-   theImageHeader->setActualBitsPerPixel(
-      ossim::getActualBitsPerPixel(scalarType));
-   theImageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
-   theImageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
-   theImageHeader->setNumberOfBands(bands);
-   theImageHeader->setImageMode('S');// blocked
-   
-   if((bands == 3)&&
-      (scalarType == OSSIM_UCHAR))
-   {
-      theImageHeader->setRepresentation("RGB");
-      theImageHeader->setCategory("VIS");
-   }
-   else if(bands == 1)
-   {
-      theImageHeader->setRepresentation("MONO");
-      theImageHeader->setCategory("MS");
-   }
-   else
-   {
-      theImageHeader->setRepresentation("MULTI");
-      theImageHeader->setCategory("MS");
-   }
-   theImageHeader->setBlocksPerRow(blocksHorizontal);
-   theImageHeader->setBlocksPerCol(blocksVertical);
-   theImageHeader->setNumberOfPixelsPerBlockRow(blockSize.x);
-   theImageHeader->setNumberOfPixelsPerBlockCol(blockSize.y);
-   theImageHeader->setNumberOfRows(rect.height());
-   theImageHeader->setNumberOfCols(rect.width());
-
-   ossimNitfImageBandV2_0 bandInfo;
-   for(idx = 0; idx < bands; ++idx)
-   {
-      std::ostringstream out;
-      
-      out << std::setfill('0')
-          << std::setw(2)
-          << idx;
-      
-      bandInfo.setBandRepresentation(out.str().c_str());
-      theImageHeader->setBandInfo(idx,
-                              bandInfo);
-   }
-
-   int imageHeaderStart = theOutputStream->tellp();
-   theImageHeader->writeStream(*theOutputStream);
-   int imageHeaderEnd = theOutputStream->tellp();
-   int imageHeaderSize = imageHeaderEnd - imageHeaderStart;
-
-   // ossimIpt ul = rect.ul();
-   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
-   ossim_uint64 tileNumber = 0;
-   ossimEndian endian;
-
-   // get the start to the first band of data block
-   //
-   ossim_uint64 streamOffset = theOutputStream->tellp();
-   
-   // holds the total pixels to the next band
-
-   ossim_uint64 blockSizeInBytes = blockSize.x*blockSize.y*ossim::scalarSizeInBytes(data->getScalarType());
-   ossim_uint64 bandOffsetInBytes = (blockSizeInBytes*blocksHorizontal*blocksVertical);
-
-   bool needSwapping = endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN;
-   while(data.valid() && !needsAborting())
-   {
-      if(needSwapping)
-      {
-         switch(data->getScalarType())
-         {
-            case OSSIM_USHORT16:
-            case OSSIM_USHORT11:
-            {
-               endian.swap((ossim_uint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_SSHORT16:
-            {
-               endian.swap((ossim_sint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_FLOAT:
-            case OSSIM_NORMALIZED_FLOAT:
-            {
-               endian.swap((ossim_float32*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_DOUBLE:
-            case OSSIM_NORMALIZED_DOUBLE:
-            {
-               endian.swap((ossim_float64*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            default:
-               break;
-         }
-      }
-
-      for(idx = 0; idx < bands; ++idx)
-      {
-         theOutputStream->seekp(streamOffset+ // start of image stream
-                                tileNumber*blockSizeInBytes + // start of block for band separate output
-                                bandOffsetInBytes*idx, // which band offset is it
-                                ios::beg); 
-         
-         theOutputStream->write((char*)(data->getBuf(idx)),
-                                blockSizeInBytes);
-      }
-      ++tileNumber;
-      
-      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
-
-      if(!needsAborting())
-      {
-         data = theInputConnection->getNextTile();
-      }
-   }
-   
-   std::streamoff pos = theOutputStream->tellp();
-
-   setComplexityLevel(pos, theFileHeader.get());
-
-   /*
-    * Need to change the way I compute file length and header length later
-    * We need to figure out a better way to compute.
-    */
-   theFileHeader->setFileLength(static_cast<ossim_uint64>(pos));
-   theFileHeader->setHeaderLength(headerLength);
-   theOutputStream->seekp(0, ios::beg);
-   imageInfoRecord.setSubheaderLength(imageHeaderSize);
-   theFileHeader->replaceImageInfoRecord(0, imageInfoRecord);
-   theFileHeader->writeStream(*theOutputStream);
-   
-   return true;
-}
-
-
-void ossimNitf20Writer::addRegisteredTag(
-   ossimRefPtr<ossimNitfRegisteredTag> registeredTag)
-{
-   ossimNitfTagInformation tagInfo;
-   tagInfo.setTagData(registeredTag.get());
-     theImageHeader->addTag(tagInfo);
-}
-
-void ossimNitf20Writer::addTags()
-{
-   ossimDate currentDate;
-   theFileHeader->setDate(currentDate);
-   
-   if(theCopyFieldsFlag)
-   {
-      ossimTypeNameVisitor visitor(ossimString("ossimNitfTileSource"),
-                                   true,
-                                   (ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS));
-      accept(visitor);
-      
-      // If there are multiple image handlers, e.g. a mosaic do not uses.
-      ossimRefPtr<ossimNitfTileSource> nitf = 0;
-      if ( visitor.getObjects().size() == 1 )
-      {
-         nitf = visitor.getObjectAs<ossimNitfTileSource>( 0 );
-      }
-
-      if( nitf.valid() )
-      {
-         ossimString value;
-         ossimPropertyInterface* fileHeaderProperties = dynamic_cast<ossimPropertyInterface*>(theFileHeader.get());
-         ossimPropertyInterface* imageHeaderProperties = dynamic_cast<ossimPropertyInterface*>(theImageHeader.get());
-         bool nitf21Flag = false;
-         const ossimNitfFileHeader*   header      = nitf->getFileHeader();
-         const ossimNitfImageHeader*  imageHeader = nitf->getCurrentImageHeader();
-         if(header)
-         {
-            ossimString version = header->getPropertyValueAsString("fhdr");
-            nitf21Flag = version.contains("2.1");
-            value = header->getPropertyValueAsString("stype");
-            if(value.size())
-            {
-               fileHeaderProperties->setProperty("stype", value);
-            }
-            value = header->getPropertyValueAsString("ostaid");
-            if(value.size())
-            {
-               fileHeaderProperties->setProperty("ostaid", value);
-            }
-            value = header->getPropertyValueAsString("ftitle");
-            if(value.size())
-            {
-               fileHeaderProperties->setProperty("ftitle", value);
-            }
-            value = header->getPropertyValueAsString("fsclas");
-            if(value.size())
-            {
-               fileHeaderProperties->setProperty("fsclas", value);
-            }
-            value = header->getPropertyValueAsString("oname");
-            if(value.size())
-            {
-               fileHeaderProperties->setProperty("oname", value);
-            }
-            value = header->getPropertyValueAsString("ophone");
-            if(value.size())
-            {
-               fileHeaderProperties->setProperty("ophone", value);
-            }
-            int idx = 0;
-            for(idx = 0; idx < header->getNumberOfTags(); ++idx)
-            {
-               ossimNitfTagInformation info;
-               header->getTagInformation(info,
-                                         idx);
-               theFileHeader->addTag(info);
-            }
-            value = header->getPropertyValueAsString("");
-            if(value.size())
-            {
-               fileHeaderProperties->setProperty("", value);
-            }
-            value = header->getPropertyValueAsString("fdt");
-            if(value.size()==14)
-            {
-               if(nitf21Flag)
-               {
-                  ossimString year(value.begin()+2, value.begin()+4);
-                  ossimString mon(value.begin()+4, value.begin()+6);
-                  ossimString day(value.begin()+6, value.begin()+8);
-                  ossimString hour(value.begin()+8, value.begin()+10);
-                  ossimString min(value.begin()+10, value.begin()+12);
-                  ossimString sec(value.begin()+12, value.begin()+14);
-                  if(mon.toUInt32() < 13)
-                  {
-                     mon = monthConversionTable[mon.toUInt32()];
-                  }
-                  fileHeaderProperties->setProperty("fdt", day+hour+min+sec+"Z"+mon+year);
-               }
-               else
-               {
-                  fileHeaderProperties->setProperty("fdt", value);
-               }
-            }
-         }
-         if(imageHeader)
-         {
-            ossim_uint32 idx = 0;
-            for(idx = 0; idx < imageHeader->getNumberOfTags(); ++idx)
-            {
-               ossimNitfTagInformation info;
-               imageHeader->getTagInformation(info,
-                                              idx);
-               theImageHeader->addTag(info);
-            }
-            value = imageHeader->getPropertyValueAsString("tgtid");
-            if(value.size())
-            {
-               imageHeaderProperties->setProperty("tgtid", value);
-            }
-            value = imageHeader->getPropertyValueAsString("isclas");
-            if(value.size())
-            {
-               imageHeaderProperties->setProperty("isclas", value);
-            }
-            value = imageHeader->getPropertyValueAsString("igeolo");
-            if(value.size())
-            {
-               imageHeaderProperties->setProperty("igeolo", value);
-            }
-            value = imageHeader->getPropertyValueAsString("ititle");
-            if(nitf21Flag)
-            {
-               value = imageHeader->getPropertyValueAsString("iid2");
-            }
-            if(value.size())
-            {
-               imageHeaderProperties->setProperty("ititle", value);
-            }
-            if(!nitf21Flag)
-            {
-               value = imageHeader->getPropertyValueAsString("iscaut");
-               if(value.size())
-               {
-                  imageHeaderProperties->setProperty("iscaut", value);
-               }
-               value = imageHeader->getPropertyValueAsString("iscode");
-               if(value.size())
-               {
-                  imageHeaderProperties->setProperty("iscode", value);
-               }
-               value = imageHeader->getPropertyValueAsString("isctlh");
-               if(value.size())
-               {
-                  imageHeaderProperties->setProperty("isctlh", value);
-               }
-               value = imageHeader->getPropertyValueAsString("isrel");
-               if(value.size())
-               {
-                  imageHeaderProperties->setProperty("isrel", value);
-               }
-               value = imageHeader->getPropertyValueAsString("isctln");
-               if(value.size())
-               {
-                  imageHeaderProperties->setProperty("isctln", value);
-               }
-               value = imageHeader->getPropertyValueAsString("isdwng");
-               if(value.size())
-               {
-                  imageHeaderProperties->setProperty("isdevt", value);
-               }
-               value = imageHeader->getPropertyValueAsString("isorce");
-               if(value.size())
-               {
-                  imageHeaderProperties->setProperty("isorce", value);
-               }
-            }
-            value = imageHeader->getPropertyValueAsString("idatim");
-            if(value.size()==14)
-            {
-               if(nitf21Flag)
-               {
-                  ossimString year(value.begin()+2, value.begin()+4);
-                  ossimString mon(value.begin()+4, value.begin()+6);
-                  ossimString day(value.begin()+6, value.begin()+8);
-                  ossimString hour(value.begin()+8, value.begin()+10);
-                  ossimString min(value.begin()+10, value.begin()+12);
-                  ossimString sec(value.begin()+12, value.begin()+14);
-                  if(mon.toUInt32() < 13)
-                  {
-                     mon = monthConversionTable[mon.toUInt32()];
-                  }
-                  imageHeaderProperties->setProperty("idatim", day+hour+min+sec+"Z"+mon+year);
-               }
-               else
-               {
-                  imageHeaderProperties->setProperty("idatim", value);
-               }
-            }
-         }
-         
-         // we will port over only a selected few 
-      }
-   }
-}
-
-bool ossimNitf20Writer::saveState(ossimKeywordlist& kwl,
-                                  const char* prefix) const
-{
-   return ossimNitfWriterBase::saveState(kwl, prefix);
-}
-
-bool ossimNitf20Writer::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix)
-{
-   return ossimNitfWriterBase::loadState(kwl, prefix);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimNitfTileSource.cpp b/ossim/src/ossim/imaging/ossimNitfTileSource.cpp
deleted file mode 100644
index ea1c3d0..0000000
--- a/ossim/src/ossim/imaging/ossimNitfTileSource.cpp
+++ /dev/null
@@ -1,3419 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  Contains class definition for ossimNitfTileSource.
-// 
-//*******************************************************************
-//  $Id: ossimNitfTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimNitfTileSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimInterleaveTypeLut.h>
-#include <ossim/base/ossimPackedBits.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimJpegMemSrc.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/imaging/ossimJpegDefaultTable.h>
-#include <ossim/base/ossim2dTo2dShiftTransform.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/support_data/ossimNitfIchipbTag.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfStdidcTag.h>
-#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
-
-#if defined(JPEG_DUAL_MODE_8_12)
-#include <ossim/imaging/ossimNitfTileSource_12.h>
-#endif
-
-#include <jerror.h>
-#include <fstream>
-#include <algorithm> /* for std::fill */
-
-RTTI_DEF1_INST(ossimNitfTileSource, "ossimNitfTileSource", ossimImageHandler)
-
-#ifdef OSSIM_ID_ENABLED
-   static const char OSSIM_ID[] = "$Id: ossimNitfTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-   
-//---
-// NOTE:  This should match the enumerations for ReadMode.
-//---
-static const char* READ_MODE[] = { "READ_MODE_UNKNOWN",
-                                   "READ_BIB_BLOCK",
-                                   "READ_BIP_BLOCK",
-                                   "READ_BIR_BLOCK",
-                                   "READ_BSQ_BLOCK",
-                                   "READ_BIB",
-                                   "READ_BIP",
-                                   "READ_BIR",
-                                   "READ_JPEG_BLOCK" };
-
-//***
-// Static trace for debugging
-//***
-static ossimTrace traceDebug("ossimNitfTileSource:debug");
-
-// 64x64*12bits
-// divide by 8 bits to get bytes gives you 6144 bytes
-static const ossim_uint32   OSSIM_NITF_VQ_BLOCKSIZE = 6144;
-
-ossimNitfTileSource::ossimNitfTileSource()
-   :
-      ossimImageHandler(),
-      theTile(0),
-      theCacheTile(0),
-      theNitfFile(new ossimNitfFile()),
-      theNitfImageHeader(0),
-      theReadMode(READ_MODE_UNKNOWN),
-      theScalarType(OSSIM_SCALAR_UNKNOWN),
-      theSwapBytesFlag(false),
-      theNumberOfInputBands(0),
-      theNumberOfOutputBands(0),
-      theBlockSizeInBytes(0),
-      theReadBlockSizeInBytes(0),
-      theNumberOfImages(0),
-      theCurrentEntry(0),
-      theImageRect(0,0,0,0),
-      theFileStr(),
-      theOutputBandList(),
-      theCacheSize(0, 0),
-      theCacheTileInterLeaveType(OSSIM_INTERLEAVE_UNKNOWN),
-      theCacheEnabledFlag(false),
-      theCacheId(-1),
-      thePackedBitsFlag(false),
-      theCompressedBuf(0),
-      theNitfBlockOffset(0),
-      theNitfBlockSize(0),
-      m_isJpeg12Bit(false),
-      m_jpegOffsetsDirty(false)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::ossimNitfTileSource entered..." << endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
-#endif
-   }
-
-}
-
-ossimNitfTileSource::~ossimNitfTileSource()
-{
-   destroy();
-}
-
-void ossimNitfTileSource::destroy()
-{
-   if (theCacheId != -1)
-   {
-      ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
-      theCacheId = -1;
-   }
-
-   // Delete the list of image headers.
-   theNitfImageHeader.clear();
-
-   if(theFileStr.is_open())
-   {
-      theFileStr.close();
-   }
-
-   theCacheTile = 0;
-   theTile      = 0;
-   theOverview  = 0;
- }
-
-bool ossimNitfTileSource::isOpen()const
-{
-   return (theNitfImageHeader.size() > 0);
-}
-
-bool ossimNitfTileSource::open()
-{
-   bool result = false;
-   
-   if(isOpen())
-   {
-      close();
-   }
-   
-   theErrorStatus = ossimErrorCodes::OSSIM_OK;
-
-   if ( parseFile() )
-   {
-      result = allocate();
-   }
-   if (result)
-   {
-      completeOpen();
-   }
-   
-   return result;
-}
-
-void ossimNitfTileSource::close()
-{
-   destroy();
-}
-
-bool ossimNitfTileSource::parseFile()
-{
-   static const char MODULE[] = "ossimNitfTileSource::parseFile";
-   
-   ossimFilename file = getFilename();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: Nitf file =  " << file << endl;
-   }
-
-   if (file.empty())
-   {
-      setErrorStatus();
-      return false;
-   }
-
-   if ( !theNitfFile )  // A close deletes "theNitfFile".
-   {
-      theNitfFile = new ossimNitfFile();
-   }
-   
-   if ( !theNitfFile->parseFile(file) )
-   {
-      setErrorStatus();
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << "DEBUG:" << "\nError parsing file!" << endl;
-      }
-
-      return false;
-   }
-
-   // Get the number of images within the file.
-   theNumberOfImages = theNitfFile->getHeader()->getNumberOfImages();
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << "DEBUG:\nNumber of images "
-         <<theNumberOfImages << std::endl; 
-   }
-   
-   if ( theNumberOfImages == 0 )
-   {
-      setErrorStatus();
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << "DEBUG:\nNo images in file!" << endl;
-      }
-      
-      return false;
-   }
-   theEntryList.clear();
-   //---
-   // Get image header pointers.  Note there can be multiple images in one
-   // image file.
-   //---
-   for (ossim_uint32 i = 0; i < theNumberOfImages; ++i)
-   {
-      ossimRefPtr<ossimNitfImageHeader> hdr = theNitfFile->getNewImageHeader(i);
-      if (!hdr)
-      {
-         setErrorStatus();
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " ERROR:\nNull image header!" << endl;
-         }
-         
-         return false;
-      }
-      if (traceDebug())
-      {
-         if(hdr.valid())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << MODULE << "DEBUG:"
-               << "\nImage header[" << i << "]:\n" << *hdr
-               << endl;
-         }
-      }
-
-      if( !hdr->isCompressed() )
-      {
-         // Skip entries tagged NODISPLAY, e.g. cloud mask entries.
-         if (hdr->getRepresentation() != "NODISPLY")
-         {
-            theEntryList.push_back(i);
-            theNitfImageHeader.push_back(hdr);
-         }
-         else 
-         {
-            ossimString cat = hdr->getCategory().trim().downcase();
-            // this is an NGA Highr Resoluion Digital Terrain Model NITF format
-            if(cat == "dtem")
-            {
-               theEntryList.push_back(i);
-               theNitfImageHeader.push_back(hdr);
-            }
-         }
-
-      }
-      else if ( canUncompress(hdr.get()) )
-      {
-         theEntryList.push_back(i);
-         theCacheEnabledFlag = true;
-         theNitfImageHeader.push_back(hdr);
-
-         if (hdr->getBitsPerPixelPerBand() == 8)
-         {
-            m_isJpeg12Bit = false;
-         }
-         else if (hdr->getBitsPerPixelPerBand() == 12)
-         {
-           m_isJpeg12Bit = true;
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "Entry " << i
-               <<" has an unsupported compression code = "
-               << hdr->getCompressionCode() << std::endl;
-         }
-         return false;
-      }
-   }
-
-   if(theEntryList.size()<1)
-   {
-      return false;
-   }
-   
-   //### WHY IS THIS HERE? THIS CAUSED A BUG BECAUSE theCurrentEntry was previously initialized 
-   //### in loadState() according to a KWL. Any entry index in the KWL was being ignored.
-   //if(theEntryList.size()>0)
-   //{
-   //   theCurrentEntry = theEntryList[0];
-   //}
-
-   theNumberOfImages = (ossim_uint32)theNitfImageHeader.size();
-   
-   if (theNitfImageHeader.size() != theNumberOfImages)
-   {
-      setErrorStatus();
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE
-            << "DEBUG:\nNumber of header not equal number of images!"
-            << endl;
-      }
-      
-      return false;
-   }
-
-   // Check the current entry range.
-   if ( theCurrentEntry >= theNumberOfImages )
-   {
-      if(theEntryList.size())
-      {
-         theCurrentEntry = theEntryList[0];
-      }
-   }
-   
-   // Initialize the lut to the current entry if the current entry has a lut.
-   initializeLut();
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG:"
-         << "\nCurrent entry:  " << theCurrentEntry
-         << endl;
-   }
-
-
-   // Open up a stream to the file.
-   theFileStr.open(file.c_str(), ios::in | ios::binary);
-   if (!theFileStr)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " ERROR:"
-            << "\nCannot open:  " << file.c_str() << endl;
-      }
-      return false;
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " leaving with true..." << endl;
-      
-   }
-   
-   return true;
-}
-
-bool ossimNitfTileSource::allocate()
-{
-   // Clear out the cache if there was any.
-   if (theCacheId != -1)
-   {
-      ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
-      theCacheId = -1;
-   }
-
-   // Clear buffers:
-   theTile = 0;
-   theCacheTile = 0;
-   theCompressedBuf.clear();
-
-   // Set the scalar type.
-   initializeScalarType();
-   if (theScalarType == OSSIM_SCALAR_UNKNOWN)
-   {
-      return false;
-   }
-
-   // Set the swap bytes flag.
-   initializeSwapBytesFlag();
-   
-   // Set the read mode.
-   initializeReadMode();
-   if (theReadMode == READ_MODE_UNKNOWN)
-   {
-      return false;
-   }
-   
-   // Set the number of bands.
-   initializeBandCount();
-   if (theNumberOfInputBands == 0)
-   {
-      return false;
-   }
-   
-   // Initialize the image rectangle. before the cache size is done
-   if (initializeImageRect() == false)
-   {
-      return false;
-   }
-   
-   // Initialize the cache size.  Must be done before
-   // setting the blocksize.  Since bit encoded data may very
-   // and we need to know if the nitf file needs to be accessed
-   // like a general raster.
-   //
-   initializeCacheSize();
-   if ( (theCacheSize.x == 0) || (theCacheSize.y == 0) )
-   {
-      return false;
-   }
-   
-   // Initialize the block size.
-   if (initializeBlockSize() == false)
-   {
-      return false;
-   }
-
-   // Initialize the cache tile interleave type.
-   initializeCacheTileInterLeaveType();
-   if (theCacheTileInterLeaveType == OSSIM_INTERLEAVE_UNKNOWN)
-   {
-      return false;
-   }
-
-   return true;
-}
-
-bool ossimNitfTileSource::allocateBuffers()
-{
-   //---
-   // Initialize the cache tile.  This will be used for a block buffer even
-   // if the cache is disabled.
-   //---
-   initializeCacheTile();
-   if (!theCacheTile.valid())
-   {
-      return false;
-   }
-
-   // Initialize the cache if enabled.
-   if (theCacheEnabledFlag)
-   {
-      theCacheId = ossimAppFixedTileCache::instance()->
-         newTileCache(theBlockImageRect, theCacheSize);
-   }
-
-   //---
-   // Initialize the compressed buffer if needed.
-   //---
-   initializeCompressedBuf();
-
-   //---
-   // Make the output tile.
-   //---
-   initializeOutputTile();
-
-   return true;
-}
-
-bool ossimNitfTileSource::canUncompress(const ossimNitfImageHeader* hdr) const
-{
-
-   bool result = false;
-   if (hdr)
-   {
-      ossimString code = hdr->getCompressionCode();
-
-      if (code == "C3") // jpeg
-      {
-         if (hdr->getBitsPerPixelPerBand() == 8)
-         {
-            result = true;
-         }
-         else if (hdr->getBitsPerPixelPerBand() == 12)
-         {
-           result = true;
-         }
-         else
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "Entry with jpeg compression (C3) has an unsupported "
-                  << "JPEG data precision: " << hdr->getBitsPerPixelPerBand()
-                  << std::endl;
-            }
-         }
-      }
-      else if(isVqCompressed( code ) &&
-              (hdr->getCompressionHeader().valid()) )
-      {
-         // we will only support single band vq compressed NITFS
-         // basically CIB and CADRG products are single band code words.
-         //
-         if(hdr->getNumberOfBands() == 1)
-         {
-            result = true;
-         }
-      }
-   }
-   return result;
-}
-
-void ossimNitfTileSource::initializeReadMode()
-{
-   // Initialize the read mode.
-   theReadMode = READ_MODE_UNKNOWN;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return;
-   }
-
-   ossim_uint32 numberOfBlocks = getNumberOfBlocks();
-   ossimString imode           = hdr->getIMode();
-   ossimString compressionCode = hdr->getCompressionCode();
-
-   if ( (compressionCode == "C3") && ((imode == "B")||(imode == "P")) )
-   {
-      theReadMode = READ_JPEG_BLOCK; 
-   }
-   else if (numberOfBlocks > 1)
-   {
-      if (imode == "B")
-      {
-         theReadMode = READ_BIB_BLOCK;
-      }
-      else if (imode == "P")
-      {
-         theReadMode = READ_BIP_BLOCK;
-      }
-      else if (imode == "R")
-      {
-         theReadMode = READ_BIR_BLOCK;
-      }
-      else if (imode == "S")
-      {
-         theReadMode = READ_BSQ_BLOCK;
-      }
-   }
-   else // The entire image comprises one block.
-   {
-      if (imode == "B")
-      {
-         theReadMode = READ_BIB;
-      }
-      else if (imode == "P")
-      {
-         theReadMode = READ_BIP;
-      }
-      else if (imode == "R")
-      {
-         theReadMode = READ_BIR;
-      }
-      else if (imode == "S")
-      {
-         theReadMode = READ_BSQ_BLOCK;
-      }
-   }        
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::initializeReadMode DEBUG:"
-         << "\nnumberOfBlocks:  " << numberOfBlocks
-         << "\nIMODE:           " << imode
-         << "\nRead Mode:       " << READ_MODE[theReadMode]
-         << endl;
-   }
-}
-
-void ossimNitfTileSource::initializeScalarType()
-{
-   thePackedBitsFlag = false;
-   // Initialize the read mode.
-   theScalarType = OSSIM_SCALAR_UNKNOWN;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return;
-   }
-
-   ossim_int32 bitsPerPixel = hdr->getActualBitsPerPixelPerBand();
-   if (bitsPerPixel < 1)
-   {
-      bitsPerPixel = hdr->getBitsPerPixelPerBand();
-   }
-
-   ossimString pixelValueType = hdr->getPixelValueType().upcase();
-   
-   switch (bitsPerPixel)
-   {
-      case 8:
-      {
-         theScalarType = OSSIM_UINT8;
-         break;
-      }
-      case 11:
-      {
-         if(pixelValueType == "SI")
-         {
-            theScalarType = OSSIM_SINT16;
-         }
-         else
-         {
-            theScalarType = OSSIM_USHORT11;
-         }
-         break;
-      }
-      case  9:
-      case 10:
-      case 12:
-      case 13:
-      case 14:
-      case 15:
-      case 16:         
-      {
-         if(pixelValueType == "SI")
-         {
-            theScalarType = OSSIM_SINT16;
-         }
-         else
-         {
-            theScalarType = OSSIM_UINT16;
-         }
-         break;
-      }
-      case 32:
-      {
-         if(pixelValueType == "SI")
-         {
-            theScalarType = OSSIM_SINT32;
-         }
-         else if(pixelValueType == "R")
-         {
-            theScalarType = OSSIM_FLOAT32;
-         }
-         break;
-      }
-      case 64:
-      {
-         if(pixelValueType == "R")
-         {
-            theScalarType = OSSIM_FLOAT64;
-         }
-         
-         break;
-      }
-      default:
-      {
-         if(hdr->isCompressed())
-         {
-            thePackedBitsFlag = true;
-            if(bitsPerPixel < 8)
-            {
-               theScalarType = OSSIM_UINT8;
-            }
-            else if(bitsPerPixel < 16)
-            {
-               theScalarType = OSSIM_UINT16;
-            }
-            else if(bitsPerPixel < 32)
-            {
-               theScalarType = OSSIM_FLOAT32;
-            }
-         }
-         else
-         {
-            if(bitsPerPixel<8)
-            {
-               theScalarType = OSSIM_UINT8;
-            }
-         }
-         break;
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::initializeScalarType DEBUG:"
-         << "\nScalar type:  "
-         << (ossimScalarTypeLut::instance()->getEntryString(theScalarType))
-         << "\nPacked bits:  " << (thePackedBitsFlag?"true":"false")
-         << endl;
-   }
-}
-
-void ossimNitfTileSource::initializeSwapBytesFlag()
-{
-   if ( (theScalarType != OSSIM_UINT8) &&
-        (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN) )
-   {
-      theSwapBytesFlag = true;
-   }
-   else
-   {
-     theSwapBytesFlag = false;
-   }
-}
-
-void ossimNitfTileSource::initializeBandCount()
-{
-   // Initialize the read mode.
-   theNumberOfInputBands = 0;
-   theNumberOfOutputBands = 0;
-   theOutputBandList.clear();
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return;
-   }
-
-   if(!isVqCompressed(hdr->getCompressionCode()))
-   {
-      theNumberOfInputBands = hdr->getNumberOfBands();
-      theNumberOfOutputBands = hdr->getNumberOfBands();
-      if(hdr->getRepresentation().contains("LUT")&&(theNumberOfInputBands == 1))
-      {
-         theNumberOfOutputBands = 3;
-      }
-   }
-   else 
-   {
-      ossimRefPtr<ossimNitfImageBand> bandInfo = hdr->getBandInformation(0);
-      if ( bandInfo.valid() )
-      {
-         theNumberOfInputBands = 1;
-         theNumberOfOutputBands = bandInfo->getNumberOfLuts();
-      }
-   }
-   
-   theOutputBandList.resize(theNumberOfOutputBands);
-   
-   for (ossim_uint32 i=0; i < theNumberOfOutputBands; ++i)
-   {
-      theOutputBandList[i] = i; // One to one for initial setup.
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::initializeBandCount DEBUG:"
-         << "\nInput Band count:  " << theNumberOfInputBands
-         << "\nOutput Band count:  " << theNumberOfOutputBands
-         << endl;
-   }
-}
-
-bool ossimNitfTileSource::initializeBlockSize()
-{
-   theBlockSizeInBytes     = 0;
-   theReadBlockSizeInBytes = 0;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return false;
-   }
-
-   ossim_uint32 bytesRowCol = 0;
-   ossim_uint32 bytesRowColCacheTile = 0;
-
-   if(isVqCompressed(hdr->getCompressionCode()))
-   {
-      bytesRowCol = OSSIM_NITF_VQ_BLOCKSIZE;
-   }
-   else
-   {
-      bytesRowCol = (hdr->getNumberOfPixelsPerBlockHoriz()*
-                     hdr->getNumberOfPixelsPerBlockVert()*
-                     hdr->getBitsPerPixelPerBand()) / 8;
-   }
-   
-   bytesRowColCacheTile = (theCacheSize.x*
-                           theCacheSize.y*
-                           hdr->getBitsPerPixelPerBand())/8;
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG:"
-         << "\ncompressionHeader:  " << compressionHeader
-         << "\ngetNumberOfPixelsPerBlockHoriz():  "
-         << hdr->getNumberOfPixelsPerBlockHoriz()
-         << "\ngetNumberOfPixelsPerBlockVert():  "
-         << hdr->getNumberOfPixelsPerBlockVert()
-         << "\ngetBitsPerPixelPerBand():  "
-         << hdr->getBitsPerPixelPerBand()
-         << "\nbytesRowCol:  " << bytesRowCol
-         << "\nbytesRowColCacheTile:  " << bytesRowColCacheTile
-         << endl;
-   }
-#endif
-   
-   theBlockSizeInBytes = bytesRowCol;
-   theReadBlockSizeInBytes = theBlockSizeInBytes;
-   switch (theReadMode)
-   {
-      case READ_BSQ_BLOCK:
-      case READ_BIB_BLOCK:
-      {
-         break;
-      }
-      case READ_BIB:
-      {
-         theReadBlockSizeInBytes = bytesRowColCacheTile;
-         break;
-      }
-      
-      case READ_BIP_BLOCK:
-      case READ_BIR_BLOCK:
-      {
-         theBlockSizeInBytes     *= theNumberOfInputBands;
-         theReadBlockSizeInBytes *= theNumberOfInputBands;
-         break;
-      }
-      case READ_BIP:
-      case READ_BIR:   
-      {
-         theBlockSizeInBytes *= theNumberOfInputBands;
-         theReadBlockSizeInBytes = bytesRowColCacheTile*theNumberOfInputBands;
-         break;
-      }
-      case READ_JPEG_BLOCK:
-      {
-         theBlockSizeInBytes *= theNumberOfInputBands;
-         ossimString code = hdr->getCompressionCode();
-         if (code == "C3") // jpeg
-         {
-            m_jpegOffsetsDirty  = true;
-         }
-         break;
-      }
-      default:
-      {
-         return false;
-      }
-   }
-
-//#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::initializeBlockSize DEBUG:"
-         << "\nNumber of input bands:          " << theNumberOfInputBands
-         << "\nNumber of output bands:          " << theNumberOfOutputBands
-         << "\nBlock size in bytes:      " << theBlockSizeInBytes
-         << "\nRead block size in bytes: " << theReadBlockSizeInBytes
-         << endl;
-   }
-//#endif
-
-   return true;
-}
-
-//*************************************************************************************************
-// Virtual method determines the decimation factors at each resolution level. 
-// This implementation derives the R0 decimation from the image metadata if available, then hands
-// off the computation of remaining R-levels to the base class implementation.
-//*************************************************************************************************
-void ossimNitfTileSource::establishDecimationFactors()
-{
-   theDecimationFactors.clear();
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (hdr)
-   {
-      double decimation;
-      hdr->getDecimationFactor(decimation);
-      if ((decimation != 0.0) && !ossim::isnan(decimation))
-      {
-         //---
-         // Note: Commented out as other code is picking up the resolution and then we're applying
-         // a decimation on top of that. (drb Aug. 2011)
-         // ossimDpt dec_2d (decimation, decimation);
-         //---
-         ossimDpt dec_2d (1.0, 1.0);
-         theDecimationFactors.push_back(dec_2d);
-      }
-   }
-
-   // Just needed to set the first R level here, the base class can do the rest:
-   ossimImageHandler::establishDecimationFactors();
-}
-
-#if 0
-ossimImageGeometry* ossimNitfTileSource::getImageGeometry()
-{
-   //---
-   // Call base class getImageGeometry which will check for external geometry
-   // or an already set geometry.
-   //---
-   ossimImageGeometry* result = ossimImageHandler::getImageGeometry();
-
-   if (result)
-   {
-      if ( !result->getTransform() )
-      {
-         ossimRefPtr<ossim2dTo2dTransform> transform = 0;
-         
-         const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-         if (hdr)
-         {
-            //---
-            // Test for the ichipb tag and set the sub image if needed.
-            // 
-            // NOTE # 1:
-            // 
-            // There are nitf writers that set the ichipb offsets and only have
-            // IGEOLO field present.  For these it has been determined
-            // (but still in question) that we should not apply the sub image
-            // offset.
-            //
-            // See trac # 1578
-            // http://trac.osgeo.org/ossim/ticket/1578
-            //
-            // NOTE # 2:
-            //
-            // Let the ICHIPB have precedence over the STDIDC tag as we could
-            // have a chip of a segment.
-            //---
-            ossimRefPtr<ossimNitfRegisteredTag> tag =
-               hdr->getTagData(ossimString("ICHIPB"));
-            if (tag.valid())
-            {
-               ossimNitfIchipbTag* ichipb =
-                  PTR_CAST(ossimNitfIchipbTag, tag.get());
-               if (ichipb)
-               {
-//                  const ossimRefPtr<ossimNitfRegisteredTag> blocka =
-//                     hdr->getTagData(ossimString("BLOCKA"));
-//                  const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
-//                     hdr->getTagData(ossimString("RPC00A"));              
-//                  const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
-//                     hdr->getTagData(ossimString("RPC00B"));
-                  
-                  //---
-                  // If any of these tags are present we will use the sub
-                  // image from the ichipb tag.
-                  //---
-//                  if ( blocka.get() || rpc00a.get() || rpc00b.get() )
-                  // ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE.  GO AHEAD AND ALWAYS INIT THE SHIFT
-                  {
-                     transform = ichipb->newTransform();
-                  }
-               }
-            }
-   
-            if ( !transform)
-            {
-               //---
-               // Look for the STDIDC tag for a sub image (segment) offset.
-               //
-               // See: STDI-002 Table 7.3 for documentation.
-               //---
-               tag = hdr->getTagData(ossimString("STDIDC"));
-               if (tag.valid() && (hdr->getIMode() == "B") )
-               {
-                  ossimDpt shift;
-                  ossimNitfStdidcTag* stdidc =
-                     PTR_CAST(ossimNitfStdidcTag, tag.get());
-                  if (stdidc)
-                  {
-                     ossim_int32 startCol = stdidc->getStartColumn().toInt32();
-                     ossim_int32 startRow = stdidc->getStartRow().toInt32();
-                     if ( (startCol > 0) && (startRow > 0) )
-                     {
-                        
-                        // field are one based; hence, the - 1.
-                        shift.x = (startCol-1) *
-                           hdr->getNumberOfPixelsPerBlockHoriz();
-                        shift.y = (startRow-1) *
-                           hdr->getNumberOfPixelsPerBlockVert();
-                     }
-                     if(shift.x > 0 ||
-                        shift.y > 0)
-                     {
-                        transform = new ossim2dTo2dShiftTransform(shift);
-                     }
-                  }
-               }
-            }
-            
-         } // matches: if (hdr)
-
-         if ( transform.valid() )
-         {
-            result->setTransform( transform.get() );
-         }
-         //else
-         //{
-         //   ossimImageGeometryRegistry::instance()->createTransform(this);
-         //}
-         
-         
-      } // matches: if ( !result->getTransform() )
-
-      if ( !result->getProjection() )
-      {
-         ossimRefPtr<ossimProjection> proj =
-            ossimProjectionFactoryRegistry::instance()->
-               createProjection(this);
-         if ( proj.valid() )
-         {
-            result->setProjection( proj.get() );
-         }
-         //else
-         //{
-         //   ossimImageGeometryRegistry::instance()->createProjection(this);
-         //}
-         
-      }
-      
-   } // matches: if (result)
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::createImageGeometry DEBUG:\n";
-
-      if (result)
-      {
-         result->print(ossimNotify(ossimNotifyLevel_DEBUG)) << "\n";
-      }
-   }
-
-   return result;
-}
-#endif
-
-bool ossimNitfTileSource::initializeImageRect()
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      theImageRect.makeNan();
-      return false;
-   }
-   
-   theBlockImageRect = hdr->getBlockImageRect();
-   theImageRect      = hdr->getImageRect();
-
-   if (traceDebug())
-   {
-      ossimIpt iloc;
-      hdr->getImageLocation(iloc); // for temp debug (drb)
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::initializeImageRect DEBUG:"
-         << "\noffset from ILOC field:  " << iloc
-         << "\nImage Rect:              " << theImageRect
-         << "\nBlock rect:              " << theBlockImageRect
-         << endl;
-   }
-   return true;
-}
-
-void ossimNitfTileSource::initializeCacheSize()
-{
-   theCacheSize.x = 0;
-   theCacheSize.y = 0;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return;
-   }
-   switch (theReadMode)
-   {
-      case READ_BIB_BLOCK:
-      case READ_BIP_BLOCK:
-      case READ_BIR_BLOCK:
-      case READ_BSQ_BLOCK:
-      case READ_JPEG_BLOCK:
-         theCacheSize.x = hdr->getNumberOfPixelsPerBlockHoriz();
-         theCacheSize.y = hdr->getNumberOfPixelsPerBlockVert();
-         break;
-
-      case READ_BIB:
-      case READ_BIP:
-      case READ_BIR:
-         theCacheSize.x = hdr->getNumberOfPixelsPerBlockHoriz();
-         theCacheSize.y = hdr->getNumberOfPixelsPerBlockVert();
-//          theCacheSize.x = getNumberOfSamples(0);
-//          theCacheSize.y = getTileHeight();
-//          if(theCacheSize.y > hdr->getNumberOfPixelsPerBlockVert())
-//          {
-//             theCacheSize.y = hdr->getNumberOfPixelsPerBlockVert();
-//          }
-         break;
-
-      default:
-         break;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::initializeCacheSize DEBUG:"
-         << "\nCache size:  " << theCacheSize
-         << endl;
-   }
-}
-
-void ossimNitfTileSource::initializeCacheTileInterLeaveType()
-{
-   theCacheTileInterLeaveType = OSSIM_INTERLEAVE_UNKNOWN;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return;
-   }
-
-   switch (theReadMode)
-   {
-      case READ_BIB_BLOCK:
-      case READ_BSQ_BLOCK:
-      case READ_BIB:
-      case READ_JPEG_BLOCK:  
-         theCacheTileInterLeaveType = OSSIM_BSQ;
-         break;
-
-      case READ_BIP_BLOCK:
-      case READ_BIP:
-         theCacheTileInterLeaveType = OSSIM_BIP;
-         break;
-
-      case READ_BIR_BLOCK:
-      case READ_BIR:
-         theCacheTileInterLeaveType = OSSIM_BIL;
-         break;
-
-      default:
-         break;
-   }
-
-   if (traceDebug())
-   {
-      ossimInterleaveTypeLut lut;
-      
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::initializeCacheTileInterLeaveType DEBUG:"
-         << "\nCache tile interleave type:  "
-         << lut.getEntryString(theCacheTileInterLeaveType)
-         << endl;
-   }
-}
-
-void ossimNitfTileSource::initializeCacheTile()
-{
-   theCacheTile = ossimImageDataFactory::instance()->create(
-      this,
-      theScalarType,
-      theNumberOfOutputBands,
-      theCacheSize.x,
-      theCacheSize.y);
-
-   theCacheTile->initialize();
-}
-
-void ossimNitfTileSource::initializeCompressedBuf()
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return;
-   }
-
-   if( (hdr->getRepresentation().upcase().contains("LUT")) ||
-       ( isVqCompressed(hdr->getCompressionCode()) ) )
-   {
-      theCompressedBuf.resize(theReadBlockSizeInBytes);
-      std::fill(theCompressedBuf.begin(), theCompressedBuf.end(), '\0');
-   }
-}
-
-void ossimNitfTileSource::initializeOutputTile()
-{
-   //---
-   // Make the output tile.  This implementation will use default tile size.
-   ossimImageDataFactory* idf = ossimImageDataFactory::instance();
-   theTile = idf->create(this, this);
-   theTile->initialize();
-}
-
-void ossimNitfTileSource::initializeLut()
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (hdr)
-   {
-      if ( hdr->hasLut() )
-      {
-         //---
-         // NOTE: Only band 0 ??? (drb)
-         //---
-         theLut = theNitfImageHeader[theCurrentEntry]->createLut(0);
-      }
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimNitfTileSource::getTile(
-   const  ossimIrect& tileRect, ossim_uint32 resLevel)
-{
-   // This tile source bypassed, or invalid res level, return a blank tile.
-   if(!isSourceEnabled() || !isOpen() || !isValidRLevel(resLevel))
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   if ( !theTile.valid() )
-   {
-      // First call to getTile:
-      allocateBuffers();
-      if ( !theTile.valid() )
-      {
-         return theTile;
-      }
-   }
-
-   // Rectangle must be set prior to getOverviewTile call.
-   theTile->setImageRectangle(tileRect);
-
-   if (resLevel)
-   {
-      if ( getOverviewTile(resLevel, theTile.get() ) )
-      {
-         return theTile;
-      }
-   }
-   
-   ossim_uint32 level = resLevel;
-   if (theStartingResLevel)  // Used as overview.
-   {
-      if (theStartingResLevel <= resLevel)
-      {
-         //---
-         // Adjust the level to be relative to the reader using this as
-         // overview.
-         //---
-         level -= theStartingResLevel; 
-      }
-   }
-
-   //---
-   // See if the whole tile is going to be filled, if not, start out with
-   // a blank tile so data from a previous load gets wiped out.
-   //---
-   if ( !tileRect.completely_within(theImageRect) )
-   {
-      // Start with a blank tile.
-      theTile->makeBlank();
-   }
-
-   //---
-   // See if any point of the requested tile is in the image.
-   //---
-   if ( tileRect.intersects(theBlockImageRect) )
-   {
-      ossimIrect clipRect = tileRect.clipToRect(theImageRect);
-            
-      // See if the requested clip rect is already in the cache tile.
-      if ( (clipRect.completely_within(theCacheTile->getImageRectangle()))&&
-           (theCacheTile->getDataObjectStatus() != OSSIM_EMPTY)&&
-           (theCacheTile->getBuf()))
-      {
-         //---
-         // Note: Clip the cache tile(nitf block) to the image clipRect since
-         // there are nitf blocks that go beyond the image dimensions, i.e.,
-         // edge blocks.
-         //---
-         ossimIrect cr =
-               theCacheTile->getImageRectangle().clipToRect(clipRect);
-         theTile->loadTile(theCacheTile->getBuf(),
-                           theCacheTile->getImageRectangle(),
-                           cr,
-                           theCacheTileInterLeaveType);
-         //---
-         // Validate the tile.  This will set the status to full, partial
-         // or empty.  Must be performed if any type of combining is to be
-         // performed down the chain.
-         //---
-         theTile->validate();
-      }
-      else
-      {
-         if ( loadTile(clipRect) == true )
-         {
-            //---
-            // Validate the tile.  This will set the status to full, partial
-            // or empty.  Must be performed if any type of combining is to be
-            // performed down the chain.
-            //---
-            theTile->validate();
-         }
-         else
-         {
-            //---
-            // Commented setting error status out for jpeg data that had several bad
-            // blocks but the rest of the image was good.  If the error status is
-            // set the overview builder stops! (drb) 10 May 2013
-            // Flag an error for callers:
-            // setErrorStatus();
-            
-            ossimNotify(ossimNotifyLevel_WARN)
-               << __FILE__ << " " << __LINE__
-               << " loadTile failed!"
-               << std::endl;
-
-            theTile->makeBlank(); // loadTile failed...
-         }
-      }
-   } // End of if ( tileRect.intersects(image_rect) )
-
-   return theTile;   
-}
-
-bool ossimNitfTileSource::loadTile(const ossimIrect& clipRect)
-{
-   ossimIrect zbClipRect  = clipRect;
-
-   const ossim_uint32 BLOCK_HEIGHT = theCacheSize.y;
-   const ossim_uint32 BLOCK_WIDTH  = theCacheSize.x;
-
-   zbClipRect.stretchToTileBoundary(ossimIpt(BLOCK_WIDTH, BLOCK_HEIGHT));
-   
-   //---
-   // Shift the upper left corner of the "clip_rect" to the an even nitf
-   // block boundry.  
-   //---
-   ossimIpt nitfBlockOrigin = zbClipRect.ul();
-
-   // Vertical block loop.
-   ossim_int32 y = nitfBlockOrigin.y;
-   while (y < zbClipRect.lr().y)
-   {
-      // Horizontal block loop.
-      ossim_int32 x = nitfBlockOrigin.x;
-      while (x < zbClipRect.lr().x)
-      {
-         if ( loadBlockFromCache(x, y, clipRect) == false )
-         {
-            if ( loadBlock(x, y) )
-            {
-               //---
-               // Note: Clip the cache tile(nitf block) to the image clipRect
-               // since there are nitf blocks that go beyond the image
-               // dimensions, i.e., edge blocks.
-               //---    
-               ossimIrect cr =
-                  theCacheTile->getImageRectangle().clipToRect(clipRect);
-               
-               theTile->loadTile(theCacheTile->getBuf(),
-                                 theCacheTile->getImageRectangle(),
-                                 cr,
-                                 theCacheTileInterLeaveType);
-            }
-            else
-            {
-               // Error loading...
-               return false;
-            }
-         }
-         
-         x += BLOCK_WIDTH; // Go to next block.
-      }
-      
-      y += BLOCK_HEIGHT; // Go to next row of blocks.
-   }
-
-   return true;
-}
-
-bool ossimNitfTileSource::loadBlockFromCache(ossim_uint32 x, ossim_uint32 y,
-                                             const ossimIrect& clipRect)
-{
-   bool result = false;
-   
-   if (theCacheEnabledFlag)
-   {
-      //---
-      // The origin set in the cache tile must have the sub image offset in it
-      // since "theTile" is relative to any sub image offset.  This is so that
-      // "theTile->loadTile(theCacheTile)" will work.
-      //---
-      ossimIpt origin(x, y);
-
-      ossimRefPtr<ossimImageData> tempTile =
-         ossimAppFixedTileCache::instance()->getTile(theCacheId, origin);
-      if (tempTile.valid())
-      {
-         //---
-         // Note: Clip the cache tile(nitf block) to the image clipRect since
-         // there are nitf blocks that go beyond the image dimensions, i.e.,
-         // edge blocks.
-         //---    
-         ossimIrect cr =
-            tempTile->getImageRectangle().clipToRect(clipRect);
-
-         theTile->loadTile(tempTile.get()->getBuf(),
-                           tempTile->getImageRectangle(),
-                           cr,
-                           theCacheTileInterLeaveType);
-         result = true;
-      }
-   }
-   
-   return result;
-}
-
-bool ossimNitfTileSource::loadBlock(ossim_uint32 x, ossim_uint32 y)
-{
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::loadBlock DEBUG:"
-         << "  x:  " << x << " y:  " << y << endl;
-   }
-#endif
-   
-   //---
-   // The origin set in the cache tile must have the sub image offset in it
-   // since "theTile" is relative to any sub image offset.  This is so that
-   // "theTile->loadTile(theCacheTile)" will work.
-   //---
-   ossimIpt origin(x, y);
-    
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   theCacheTile->setOrigin(origin);
-   ossim_uint32 readSize = theReadBlockSizeInBytes;
-   if(!theCacheTile->getImageRectangle().completely_within(theBlockImageRect))
-   {
-      readSize = getPartialReadSize(origin);
-   }
-   if((hdr->hasBlockMaskRecords())||
-      (readSize != theReadBlockSizeInBytes))
-   {
-      theCacheTile->makeBlank();
-   }
-
-   switch (theReadMode)
-   {
-      case READ_BIR:  
-      case READ_BIR_BLOCK:
-      case READ_BIP:  
-      case READ_BIP_BLOCK:
-      {
-         std::streamoff p;
-         if(getPosition(p, x, y, 0))
-         {
-            theFileStr.seekg(p, ios::beg);
-            char* buf = (char*)(theCacheTile->getBuf());
-            if (!theFileStr.read(buf, readSize))
-            {
-               theFileStr.clear();
-               ossimNotify(ossimNotifyLevel_FATAL)
-                  << "ossimNitfTileSource::loadBlock BIP Read Error!"
-                  << "\nReturning error..." << endl;
-               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-               
-               return false;
-            }
-         }
-         break;
-      }
-      case READ_BSQ_BLOCK:
-      case READ_BIB_BLOCK:
-      case READ_BIB:
-      {
-         //---
-         // NOTE:
-         // With some of these types we could do one read and get all bands.
-         // The reads are done per for future enabling on band selection
-         // at the image handler level.
-         //---
-         for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
-         {
-            ossim_uint8* buf =0;
-            if(isVqCompressed(hdr->getCompressionCode())||
-               hdr->getRepresentation().upcase().contains("LUT"))
-            {
-               buf = (ossim_uint8*)&(theCompressedBuf.front());
-            }
-            else
-            {
-               buf = (ossim_uint8*)(theCacheTile->getBuf(band));
-            }
-            std::streamoff p;
-            if(getPosition(p, x, y, band))
-            {
-               theFileStr.seekg(p, ios::beg);
-               if (!theFileStr.read((char*)buf, readSize))
-               {
-                  theFileStr.clear();
-                  ossimNotify(ossimNotifyLevel_FATAL)
-                     << "ossimNitfTileSource::loadBlock Read Error!"
-                     << "\nReturning error..." << endl;
-                  theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-                  return false;
-               }
-               else if(hdr->getCompressionCode() == "C4")
-               {
-                  vqUncompressC4(theCacheTile,
-                                 (ossim_uint8*)&(theCompressedBuf.front()));
-               }
-
-               else if(hdr->getCompressionCode() == "M4")
-               {
-                  vqUncompressM4(theCacheTile,
-                                 (ossim_uint8*)&(theCompressedBuf.front()));
-               }
-               else if(hdr->getRepresentation().upcase().contains("LUT"))
-               {
-                  lutUncompress(theCacheTile,
-                                (ossim_uint8*)&(theCompressedBuf.front()));
-               }
-            }
-         }
-         break;
-      }
-      case READ_JPEG_BLOCK:
-      {
-         if (uncompressJpegBlock(x, y) == false)
-         {
-            theCacheTile->makeBlank();
-            theFileStr.clear();
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "ossimNitfTileSource::loadBlock Read Error!"
-               << "\nReturning error..." << endl;
-            return false;
-         }
-         break;
-      }
-      default:
-         break;
-   }
-   
-   if(thePackedBitsFlag)
-   {
-      explodePackedBits(theCacheTile);
-   }
-   // Check for swap bytes.
-   if (theSwapBytesFlag)
-   {
-      ossimEndian swapper;
-      swapper.swap(theScalarType,
-                   theCacheTile->getBuf(),
-                   theCacheTile->getSize());
-   }
-
-   if ( !isVqCompressed(hdr->getCompressionCode()) )
-   {
-      convertTransparentToNull(theCacheTile);
-   }
-
-   // Set the origin of the cache tile.
-   theCacheTile->validate();
-   if (theCacheEnabledFlag)
-   {
-      // Add it to the cache for the next time.
-      ossimAppFixedTileCache::instance()->addTile(theCacheId, theCacheTile);
-   }
-   
-   return true;
-}
-
-void ossimNitfTileSource::explodePackedBits(ossimRefPtr<ossimImageData> packedBuffer)const
-{
-   ossim_uint8* tempBuf = new ossim_uint8[packedBuffer->getSizePerBandInBytes()];
-   ossim_uint32 idx      = 0;
-   ossim_uint32 bandIdx  = 0;
-   ossim_uint32 h = packedBuffer->getHeight();
-   ossim_uint32 w = packedBuffer->getWidth();
-   ossim_uint32 maxIdx = w*h;
-   ossim_uint32 bandCount = packedBuffer->getNumberOfBands();
-   switch(packedBuffer->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         
-         ossim_uint8* outputBuf = (ossim_uint8*)tempBuf;
-         for(bandIdx = 0; bandIdx < bandCount; ++bandIdx)
-         {
-            ossimPackedBits packedBits((ossim_uint8*)packedBuffer->getBuf(bandIdx),
-                                           getCurrentImageHeader()->getBitsPerPixelPerBand());
-            for(idx = 0; idx < maxIdx; ++idx)
-            {
-               *outputBuf = (ossim_uint8)packedBits.getValueAsUint32(idx);
-               ++outputBuf;
-            }
-            
-            memcpy((char*)packedBuffer->getBuf(bandIdx),
-                   (char*)tempBuf,
-                   theCacheTile->getSizePerBandInBytes()*bandCount);
-         }
-         break;
-      }
-      case OSSIM_UINT16:
-      {
-         
-         ossim_uint16* outputBuf = (ossim_uint16*)tempBuf;
-         for(bandIdx = 0; bandIdx < bandCount; ++bandIdx)
-         {
-            ossimPackedBits packedBits((ossim_uint8*)packedBuffer->getBuf(bandIdx),
-                                           getCurrentImageHeader()->getBitsPerPixelPerBand());
-            for(idx = 0; idx < maxIdx; ++idx)
-            {
-               *outputBuf = (ossim_uint16)packedBits.getValueAsUint32(idx);
-               ++outputBuf;
-            }
-            
-            memcpy((char*)packedBuffer->getBuf(bandIdx),
-                   (char*)tempBuf,
-                   theCacheTile->getSizePerBandInBytes()*bandCount);
-         }
-         break;
-      }
-      case OSSIM_FLOAT:
-      {
-         ossim_float32* outputBuf = (ossim_float32*)tempBuf;
-         for(bandIdx = 0; bandIdx < bandCount; ++bandIdx)
-         {
-            ossimPackedBits packedBits((ossim_uint8*)packedBuffer->getBuf(bandIdx),
-                                           getCurrentImageHeader()->getBitsPerPixelPerBand());
-            for(idx = 0; idx < maxIdx; ++idx)
-            {
-               *outputBuf = (ossim_float32)packedBits.getValueAsUint32(idx);
-               ++outputBuf;
-            }
-            
-            memcpy((char*)packedBuffer->getBuf(bandIdx),
-                   (char*)tempBuf,
-                   theCacheTile->getSizePerBandInBytes()*bandCount);
-         }
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-   delete [] tempBuf;
-}
-
-void ossimNitfTileSource::convertTransparentToNull(ossimRefPtr<ossimImageData> tile)const
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-
-   if(!hdr||!tile) return;
-
-   if(!tile->getBuf()) return;
-   ossimIpt tempOrigin = tile->getOrigin();
-   ossim_uint32 blockNumber = getBlockNumber(tempOrigin);
-   ossim_uint32 numberOfBands = tile->getNumberOfBands();
-   ossim_uint32 band = 0;
-
-   if(hdr->hasPadPixelMaskRecords())
-   {
-      if(hdr->hasTransparentCode())
-      {
-         ossim_uint32 idx = 0;
-         ossim_uint32 maxIdx = tile->getWidth()*tile->getHeight();
-         
-         for (band = 0; band < numberOfBands; ++band)
-         {
-            if(hdr->getPadPixelMaskRecordOffset(blockNumber,
-                                                band)!=0xffffffff)
-            {
-               switch(tile->getScalarType())
-               {
-                  case OSSIM_UINT8:
-                  {
-                     ossim_uint8 transparentValue = hdr->getTransparentCode();
-                     ossim_uint8* buf = (ossim_uint8*)tile->getBuf(band);
-                     ossim_uint8 nullPix = (ossim_uint8)tile->getNullPix(band);
-                     for(idx = 0; idx < maxIdx; ++idx)
-                     {
-                        if(*buf == transparentValue)
-                        {
-                           *buf = nullPix;
-                        }
-                        ++buf;
-                     }
-                     break;
-                  }
-                  case OSSIM_USHORT11:
-                  case OSSIM_UINT16:
-                  {
-                     ossim_uint16 transparentValue = hdr->getTransparentCode();
-                     ossim_uint16* buf = (ossim_uint16*)tile->getBuf(band);
-                     ossim_uint16 nullPix = (ossim_uint16)tile->getNullPix(band);
-                     for(idx = 0; idx < maxIdx; ++idx)
-                     {
-                        if(*buf == transparentValue)
-                        {
-                           *buf = nullPix;
-                        }
-                        ++buf;
-                     }
-                     break;
-                  }
-                  case OSSIM_SINT16:
-                  {
-                     ossim_sint16 transparentValue = hdr->getTransparentCode();
-                     ossim_sint16* buf = (ossim_sint16*)tile->getBuf(band);
-                     ossim_sint16 nullPix = (ossim_sint16)tile->getNullPix(band);
-                     for(idx = 0; idx < maxIdx; ++idx)
-                     {
-                        if(*buf == transparentValue)
-                        {
-                           *buf = nullPix;
-                        }
-                        ++buf;
-                     }
-                     break;
-                  }
-                  default:
-                  {
-                     break;
-                  }
-               }
-            }
-         }
-      }
-   }
-}
-
-
-double ossimNitfTileSource::getMinPixelValue(ossim_uint32 band)const
-{
-   double result = ossimImageHandler::getMinPixelValue(band);
-
-   if(thePackedBitsFlag)
-   {
-      if(result < 1.0) result = 1.0;
-   }
-   
-   return result;
-}
-
-double ossimNitfTileSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   double result = ossimImageHandler::getMaxPixelValue(band);
-
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if(hdr)
-   {
-      if(thePackedBitsFlag)
-      {
-         double test = 1<<(hdr->getBitsPerPixelPerBand());
-         
-         if(result > test) result = test;
-      }
-      else
-      {
-         ossim_int32 bitsPerPixel = hdr->getActualBitsPerPixelPerBand();
-         switch (bitsPerPixel)
-         {
-            case 11:
-            {
-               if (result > 2047.0)
-               {
-                  result = 2047.0;
-               }
-               break;
-            }
-            case 12:
-            {
-               if (result > 4095.0)
-               {
-                  result = 4095.0;
-               }
-               break;
-            }
-            default:
-               break;
-         }
-      }
-   }
-
-   return result;
-}
-
-double ossimNitfTileSource::getNullPixelValue(ossim_uint32 band)const
-{
-   double result = ossimImageHandler::getNullPixelValue(band);
-
-   if(thePackedBitsFlag)
-   {
-      if((result < 0) ||
-         (result > getMaxPixelValue(band)))
-         {
-            result = 0.0;
-         }
-   }
-
-
-   return result;
-}
-
-
-bool ossimNitfTileSource::getPosition(std::streamoff& streamPosition,
-                                      ossim_uint32 x,
-                                      ossim_uint32 y,
-                                      ossim_uint32 band) const
-{
-   //
-   // NOTE:  "theCacheSize is always relative to a block size except in
-   // the case where a block is the entire image.
-   //
-   streamPosition = 0;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return streamPosition;
-   }
-
-   ossim_uint64 blockNumber = getBlockNumber(ossimIpt(x,y));
-   
-#if 0
-   cout << "ossimNitfTileSource::getPosition blockNumber:  "
-        << blockNumber << endl;
-#endif
-   
-   streamPosition = (std::streamoff)hdr->getDataLocation(); // Position to first block.
-   if(hdr->hasBlockMaskRecords())
-   {
-      ossim_uint64 blockOffset = hdr->getBlockMaskRecordOffset(blockNumber,
-                                                               band);
-      if(blockOffset == 0xffffffff)
-      {
-         return false;
-      }
-      streamPosition += blockOffset;
-   }
-   
-   switch (theReadMode)
-   {
-      case READ_BIB_BLOCK:
-      {
-         if(!hdr->hasBlockMaskRecords())
-         {
-            streamPosition +=
-            (std::streamoff)((ossim_uint64)blockNumber * 
-                (ossim_uint64)getBlockOffset()) +
-               ((ossim_uint64)getBandOffset() * band);
-         }
-         else
-         {
-            streamPosition += (std::streamoff)((ossim_uint64)getBandOffset() * (ossim_uint64)band);
-            
-         }
-         break;
-      }
-      
-      case READ_BIB:
-      {
-         streamPosition +=
-         (std::streamoff) ((ossim_uint64)blockNumber * (ossim_uint64)theReadBlockSizeInBytes)+
-            ((ossim_uint64)getBandOffset() * (ossim_uint64)band);
-         break;
-      }
-      
-      case READ_BSQ_BLOCK:
-      {
-         
-         if(!hdr->hasBlockMaskRecords())
-         {
-            streamPosition += (std::streamoff)((ossim_uint64)blockNumber * 
-                                               (ossim_uint64)getBlockOffset()) +
-                                              ((ossim_uint64)getBandOffset() * 
-                                               (ossim_uint64)band);
-         }
-         
-         break;
-      }
-      case READ_JPEG_BLOCK:
-      {
-         streamPosition += (std::streamoff)((ossim_uint64)blockNumber * (ossim_uint64)theReadBlockSizeInBytes);
-         break;
-      }
-      default:
-      {
-         if(!hdr->hasBlockMaskRecords())
-         {
-            streamPosition += (std::streamoff)((ossim_uint64)blockNumber*(ossim_uint64)getBlockOffset());
-         }
-         
-         break;
-      }
-   }
-
-   return true;
-}
-
-std::streampos ossimNitfTileSource::getBandOffset() const
-{
-   std::streampos bandOffset = 0;
-
-   switch (theReadMode)
-   {
-      case READ_BIB_BLOCK:
-      case READ_BIP_BLOCK:
-      case READ_BIR_BLOCK:
-      case READ_BIB:
-      case READ_BIP:
-      case READ_BIR:
-         bandOffset = theBlockSizeInBytes;
-         break;
-         
-      case READ_BSQ_BLOCK:
-         bandOffset = getNumberOfBlocks() * theBlockSizeInBytes;
-         break;
-
-      default:
-         break;
-   }
-
-   return bandOffset;
-}
-
-std::streampos ossimNitfTileSource::getBlockOffset() const
-{
-   std::streampos blockOffset = 0;
-   std::streampos blockSizeInBytes = 0;
-   if (getNumberOfBlocks() == 1)
-   {
-      blockSizeInBytes = theReadBlockSizeInBytes;
-   }
-   else
-   {
-      blockSizeInBytes = theBlockSizeInBytes;
-   }
-   
-   switch (theReadMode)
-   {
-      case READ_BIB_BLOCK:
-      case READ_BIB:
-         // Band interleaved by block.
-         blockOffset = blockSizeInBytes * theNumberOfInputBands;
-         break;
-         
-      case READ_BIR_BLOCK:
-      case READ_BSQ_BLOCK:
-      case READ_BIP_BLOCK:
-      case READ_BIP:
-      case READ_BIR:
-         // Blocks side by side.
-         blockOffset = blockSizeInBytes;
-         break;
-      case READ_JPEG_BLOCK:
-        blockSizeInBytes = theReadBlockSizeInBytes;
-        break;
-   
-      default:
-         break;
-   }
-
-   return blockOffset;
-}
-   
-ossim_uint32 ossimNitfTileSource::getNumberOfBlocks() const
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return 0;
-   }
-
-   return static_cast<ossim_uint32>( hdr->getNumberOfBlocksPerRow() *
-                                     hdr->getNumberOfBlocksPerCol() );
-}
-
-bool ossimNitfTileSource::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   if ( !ossimImageHandler::loadState(kwl, prefix) )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfTileSource::loadState(kwl, prefix) DEBUG:"
-            << "\nUnable to load, exiting..." << std::endl;
-      }
-      return false;
-   }
-   
-   const char* lookup = kwl.find(prefix, "entry");
-   if (lookup)
-   {
-      ossimString s(lookup);
-      theCurrentEntry = s.toUInt32();
-   }
-
-   lookup = kwl.find(prefix,ossimKeywordNames::ENABLE_CACHE_KW);
-   if (lookup)
-   {
-      ossimString s(lookup);
-      theCacheEnabledFlag = s.toBool();
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::loadState(kwl, prefix) DEBUG:"
-         << "\nCurrent entry:      " << theCurrentEntry
-         << "\nCache enable flag:  " << theCacheEnabledFlag
-         << std::endl;
-   }
-   
-   return open();
-}
-
-bool ossimNitfTileSource::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix) const
-{
-   // Add the entry number.
-   kwl.add(prefix, "entry", theCurrentEntry, true);
-
-   // Add the cache_enable flag.
-   kwl.add(prefix, ossimKeywordNames::ENABLE_CACHE_KW, theCacheEnabledFlag, true);
-
-   // Call the base class save state.
-   return ossimImageHandler::saveState(kwl, prefix);
-}
-
-ossimScalarType ossimNitfTileSource::getOutputScalarType() const
-{
-   return theScalarType;
-}
-
-ossim_uint32 ossimNitfTileSource::getTileWidth() const
-{
-   ossim_uint32 result = 0;
-   if(!theCacheSize.hasNans()&& theCacheSize.x > 0)
-   {
-      result = theCacheSize.x;
-   }
-   else
-   {
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-      result = static_cast<ossim_uint32>(tileSize.x);
-   }
-   return result;
-}
-
-ossim_uint32 ossimNitfTileSource::getTileHeight() const
-{
-   ossim_uint32 result = 0;
-   if(!theCacheSize.hasNans()&& theCacheSize.y > 0)
-   {
-      result = theCacheSize.y;
-   }
-   else
-   {
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-      result = static_cast<ossim_uint32>(tileSize.y);
-   }
-   return result;
-}
-
-ossim_uint32 ossimNitfTileSource::getNumberOfInputBands() const
-{
-   return theNumberOfInputBands;
-}
-
-ossim_uint32 ossimNitfTileSource::getNumberOfOutputBands() const
-{
-   return theNumberOfOutputBands;
-}
-
-ossim_uint32 ossimNitfTileSource::getNumberOfLines(ossim_uint32 resLevel) const
-{
-   ossim_uint32 result = 0;
-   if (resLevel == 0)
-   {
-      const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-      if (hdr)
-      {
-         result = hdr->getNumberOfRows();
-      }
-   }
-   else if (theOverview.valid())
-   {
-      result = theOverview->getNumberOfLines(resLevel);
-   }
-   return result;
-}
-
-ossim_uint32 ossimNitfTileSource::getNumberOfSamples(ossim_uint32 resLevel) const
-{
-   ossim_uint32 result = 0;
-   if (resLevel == 0)
-   {
-      const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-      if (hdr)
-      {
-         result = hdr->getNumberOfCols();
-      }
-   }
-   else if (theOverview.valid())
-   {
-      result = theOverview->getNumberOfSamples(resLevel);
-   }
-   return result;
-}
-
-ossim_uint32 ossimNitfTileSource::getBlockNumber(const ossimIpt& block_origin) const
-{
-   ossim_uint32 blockNumber = 0;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return blockNumber; 
-   }
-
-   ossim_uint32 blockY;
-   ossim_uint32 blockX;
-   blockX  = (block_origin.x /
-              theCacheSize.x);
-   blockY= (block_origin.y /
-            theCacheSize.y);
-
-   switch (theReadMode)
-   {
-      case READ_BIB_BLOCK:
-      case READ_BIP_BLOCK:
-      case READ_BIR_BLOCK:
-      case READ_BSQ_BLOCK:
-      case READ_JPEG_BLOCK:
-      {
-         blockNumber = ((blockY*hdr->getNumberOfBlocksPerRow()) +
-                        blockX);
-         break;
-      }
-      case READ_BIB:
-      case READ_BIP:
-      case READ_BIR:
-         //---
-         // These read modes are for a single block image.  The cache size will
-         // be set to the width of the image (block) by the height of one tile.
-         //
-         // This is to avoid reading an entire large image with a single block
-         // into memory.
-         //---
-         blockNumber = blockY;
-         break;
-
-      default:
-         break;
-   }
-   return blockNumber;
-}
-
-ossim_uint32 ossimNitfTileSource::getPartialReadSize(const ossimIpt& /* blockOrigin */)const
-{
-   ossim_uint32 result = 0;
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return result;
-   }
-   
-   if(theCacheTile->getImageRectangle().completely_within(theBlockImageRect))
-   {
-      return theReadBlockSizeInBytes;
-   }
-   ossimIrect clipRect = theCacheTile->getImageRectangle().clipToRect(theBlockImageRect);
-   
-   result = (theCacheSize.x*
-             clipRect.height()*
-             hdr->getBitsPerPixelPerBand())/8;
-   
-   switch (theReadMode)
-   {
-      case READ_BSQ_BLOCK:
-      case READ_BIB_BLOCK:
-      case READ_BIB:
-      {
-         // purposely left blank.  only hear for clarity.
-         break;
-      }
-
-      case READ_BIP_BLOCK:
-      case READ_BIR_BLOCK:
-      case READ_BIP:
-      case READ_BIR:   
-      {
-         result *= theNumberOfInputBands;
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-   return result;
-}
-
-bool ossimNitfTileSource::isVqCompressed(const ossimString& compressionCode)const
-{
-   return((compressionCode == "C4")||
-          (compressionCode == "M4"));
-}
-
-
-ossim_uint32 ossimNitfTileSource::getImageTileWidth() const
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return 0;
-   }
-   return hdr->getNumberOfPixelsPerBlockHoriz();
-}
-
-ossim_uint32 ossimNitfTileSource::getImageTileHeight() const
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return 0;
-   }
-   return hdr->getNumberOfPixelsPerBlockVert();
-}
-
-ossimString ossimNitfTileSource::getShortName()const
-{
-   return ossimString("nitf");
-}
-
-ossimString ossimNitfTileSource::getLongName()const
-{
-   return ossimString("nitf reader");
-}
-
-ossim_uint32 ossimNitfTileSource::getCurrentEntry() const
-{
-   return theCurrentEntry;
-}
-
-ossim_uint32 ossimNitfTileSource::getNumberOfEntries() const
-{
-   return (ossim_uint32)theEntryList.size();
-}
-
-void ossimNitfTileSource::getEntryList(std::vector<ossim_uint32>& entryList)const
-{
-   entryList = theEntryList;
-//    entryList.resize(theNumberOfImages);
-//    for (ossim_uint32 i = 0; i < theNumberOfImages; ++i)
-//    {
-//       entryList[i] = i;
-//    }
-}
-
-bool ossimNitfTileSource::setCurrentEntry(ossim_uint32 entryIdx)
-{
-   bool result = true;
-   if (theCurrentEntry != entryIdx)
-   {
-      if ( isOpen() )
-      {
-         if ( entryIdx < theNumberOfImages )
-         {
-            // Clear the geometry.
-            theGeometry = 0;
-            
-            // Must clear or openOverview will use last entries.
-            theOverviewFile.clear();
-            
-            theCurrentEntry = entryIdx;
-            
-            //---
-            // Since we were previously open and the the entry has changed we
-            // need to reinitialize some things.
-            //---
-            result = allocate();
-            if (result)
-            {
-               completeOpen();
-            }
-         }
-         else
-         {
-            result = false; // Entry index out of range.
-         }
-      }
-      else
-      {
-         //---
-         // Not open.
-         // Allow this knowing that the parseFile will check for out of range.
-         //---
-         theCurrentEntry = entryIdx;
-      }
-   }
-   
-   if(result)
-   {
-      if(theNitfImageHeader[theCurrentEntry]->getRepresentation().contains("LUT"))
-      {
-         theLut = theNitfImageHeader[theCurrentEntry]->createLut(0);
-      }
-      
-      
-   }
-   return result;
-}
-
-bool ossimNitfTileSource::getCacheEnabledFlag() const
-{
-   return theCacheEnabledFlag;
-}
-
-void ossimNitfTileSource::setCacheEnabledFlag(bool flag)
-{
-   if (flag != theCacheEnabledFlag)
-   {
-      // State of caching has changed...
-
-      theCacheEnabledFlag = flag;
-
-      if ( theCacheEnabledFlag) // Cache enabled.
-      {
-         theCacheId = ossimAppFixedTileCache::instance()->
-            newTileCache(theBlockImageRect, theCacheSize);
-      }
-      else // Cache disabled...
-      {
-         // Clean out the cache if there was one.
-         if (theCacheId != -1)
-         {
-            ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
-            theCacheId = -1;
-         }
-      }
-   }
-}
-
-const ossimNitfFileHeader* ossimNitfTileSource::getFileHeader()const
-{
-   if(theNitfFile.valid())
-   {
-      return theNitfFile->getHeader();
-   }
-   
-   return 0;
-}
-
-ossimNitfFileHeader* ossimNitfTileSource::getFileHeader()
-{
-   if(theNitfFile.valid())
-   {
-      return theNitfFile->getHeader();
-   }
-   
-   return 0;
-}
-
-const ossimNitfImageHeader* ossimNitfTileSource::getCurrentImageHeader() const
-{
-   if(theNitfImageHeader.size())
-   {
-      return theNitfImageHeader[theCurrentEntry].get();
-   }
-   
-   return 0;
-}
-
-ossimNitfImageHeader* ossimNitfTileSource::getCurrentImageHeader()
-{
-   if(theNitfImageHeader.size())
-   {
-      return theNitfImageHeader[theCurrentEntry].get();
-   }
-   
-   return 0;
-}
-
-bool ossimNitfTileSource::getRgbBandList(std::vector<ossim_uint32>& bandList) const
-{
-   bool result = false;
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-   const ossim_uint32 BOGUS = 99999;
-   if ( hdr && (BANDS > 2) )
-   {
-      ossim_uint32 r = BOGUS;
-      ossim_uint32 g = BOGUS;
-      ossim_uint32 b = BOGUS;
-
-      for ( ossim_uint32 i = 0; i < BANDS; ++i )
-      {
-         const ossimRefPtr<ossimNitfImageBand> imageBand = hdr->getBandInformation( i );
-         if ( imageBand.valid() )
-         {
-            ossimString os = imageBand->getBandRepresentation();
-            os.trim(); // Remove trailing spaces.
-            os.upcase();
-            if ( os == "R" )
-            {
-               r = i;
-            }
-            else if ( os == "G" )
-            {
-               g = i;
-            }
-            else if ( os == "B" )
-            {
-               b = i;
-            }
-            
-            if ( ( i > 1 ) &&
-                 ( r != BOGUS ) && ( g != BOGUS ) && ( b != BOGUS ) )
-            {
-               result = true;
-               bandList.resize(3);
-               bandList[0] = r;
-               bandList[1] = g;
-               bandList[2] = b;
-               break; // done...
-            }
-         }
-      }
-      // TODO: Derive rgb from ISUBCAT wavelength or other nitf tags.
-   }
-   
-   return result;
-   
-} // End: ossimNitfTileSource::getRgbBandList( ... )
-
-void ossimNitfTileSource::setBoundingRectangle(const ossimIrect& imageRect)
-{
-   theImageRect = imageRect;
-   // now shift the internal block rect as well
-   theBlockImageRect = (theBlockImageRect - theBlockImageRect.ul());
-}
-
-ossimRefPtr<ossimProperty> ossimNitfTileSource::getProperty(const ossimString& name)const
-{
-   if (name == ossimKeywordNames::ENABLE_CACHE_KW)
-   {
-      ossimProperty* p = new ossimBooleanProperty(name, theCacheEnabledFlag);
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   else 
-   {
-      if(theNitfFile.valid())
-      {
-         if(theNitfFile->getHeader())
-         {
-            ossimRefPtr<ossimProperty> p = theNitfFile->getHeader()->getProperty(name);
-            if(p.valid())
-            {
-               p->setReadOnlyFlag(true);
-               return p;
-            }
-         }
-      }
-      const ossimNitfImageHeader* imageHeader = getCurrentImageHeader();
-      if(imageHeader)
-      {
-         ossimRefPtr<ossimProperty> p = imageHeader->getProperty(name);
-         if(p.valid())
-         {
-            p->setReadOnlyFlag(true);
-            return p;
-         }
-      }
-   }
-
-   return ossimImageHandler::getProperty(name);
-}
-
-void ossimNitfTileSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if (!property) return;
-   
-   ossimString name = property->getName();
-
-   if (name == ossimKeywordNames::ENABLE_CACHE_KW)
-   {
-      ossimBooleanProperty* obj = PTR_CAST(ossimBooleanProperty,
-                                           property.get());
-      if (obj)
-      {
-         setCacheEnabledFlag(obj->getBoolean());
-      }
-   }
-   else
-   {
-      ossimImageHandler::setProperty(property);
-   }
-}
-
-void ossimNitfTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageHandler::getPropertyNames(propertyNames);
-   propertyNames.push_back(ossimKeywordNames::ENABLE_CACHE_KW);
-   if(theNitfFile->getHeader())
-   {
-      theNitfFile->getHeader()->getPropertyNames(propertyNames);
-   }
-   const ossimNitfImageHeader* imageHeader = getCurrentImageHeader();
-   if(imageHeader)
-   {
-      imageHeader->getPropertyNames(propertyNames);
-   }
-}
-
-ossimString ossimNitfTileSource::getSecurityClassification() const
-{
-   if(getCurrentImageHeader())
-   {
-      return getCurrentImageHeader()->getSecurityClassification();
-   }
-   
-   return "U";
-}
-
-void ossimNitfTileSource::lutUncompress(ossimRefPtr<ossimImageData> destination, ossim_uint8* source)
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr||!destination)
-   {
-      return;
-   }
-   if((destination->getNumberOfBands()<3)||
-      (!destination->getBuf())||
-      (destination->getScalarType()!=OSSIM_UINT8)||
-      (!theLut.valid()))
-   {
-      return;
-   }
-
-   if(destination->getNumberOfBands()!=theLut->getNumberOfBands())
-   {
-      return;
-   }
-   
-   ossim_uint8* tempRows[3];
-   tempRows[0] = (ossim_uint8*)destination->getBuf(0);
-   tempRows[1] = (ossim_uint8*)destination->getBuf(1);
-   tempRows[2] = (ossim_uint8*)destination->getBuf(2);
-   
-   ossim_uint8* srcPtr = source;
-   ossim_uint32 compressionYidx   = 0;
-   ossim_uint32 compressionXidx   = 0;
-   ossim_uint32 uncompressIdx     = 0;
-   ossim_uint32 h = destination->getHeight();
-   ossim_uint32 w = destination->getWidth();
-   
-   for(compressionYidx = 0; compressionYidx < h; ++compressionYidx)
-   {
-      for(compressionXidx = 0; compressionXidx < w; ++compressionXidx)
-      {
-         tempRows[0][uncompressIdx] = (*theLut)[*srcPtr][0];
-         tempRows[1][uncompressIdx] = (*theLut)[*srcPtr][1];
-         tempRows[2][uncompressIdx] = (*theLut)[*srcPtr][2];
-         ++srcPtr;
-         ++uncompressIdx;
-      }
-   }
-}
-
-void ossimNitfTileSource::vqUncompressC4(
-   ossimRefPtr<ossimImageData> destination, ossim_uint8* source)
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr||!destination)
-   {
-      return;
-   }
-
-   const ossim_uint32 BANDS = destination->getNumberOfBands();
-
-   if( ( (BANDS != 1) && (BANDS!=3) ) ||
-       (!destination->getBuf()) ||
-       (destination->getScalarType()!=OSSIM_UINT8) ||
-       !theLut.valid() ||
-       (theLut->getNumberOfBands() != BANDS) )
-   {
-      return;
-   }
-   
-   ossimNitfVqCompressionHeader* compressionHeader =
-      PTR_CAST(ossimNitfVqCompressionHeader,
-               hdr->getCompressionHeader().get());
-
-   if(!compressionHeader)
-   {
-      return;
-   }
-   
-   const std::vector<ossimNitfVqCompressionOffsetTableData>& table =
-      compressionHeader->getTable();
-
-   ossimRefPtr<ossimNitfImageBand> bandInfo = hdr->getBandInformation(0);
-   
-   if(!bandInfo.valid()) return;
-   
-   std::vector<ossimRefPtr<ossimNitfImageLut> > luts(BANDS);
-   std::vector<ossim_uint8*> tempRows(BANDS);
-   
-   ossim_uint32 band;
-   for (band =0; band<BANDS; ++band)
-   {
-      luts[band] = bandInfo->getLut(band);
-      if ( luts[band].valid() )
-      {
-         tempRows[band] = (ossim_uint8*)destination->getBuf(band);
-      }
-      else
-      {
-         return;
-      }
-   }
-
-   ossimPackedBits bits(source, compressionHeader->getImageCodeBitLength());
-
-
-   const ossim_uint32 ROWS = static_cast<ossim_uint32>(table.size());
-   const ossim_uint32 COLS =
-      static_cast<ossim_uint32>(table[0].
-                                theNumberOfValuesPerCompressionLookup);
-   const ossim_uint32 COMPRESSION_HEIGHT =
-      compressionHeader->getNumberOfImageRows();
-   const ossim_uint32 COMPRESSION_WIDTH  =
-      compressionHeader->getNumberOfImageCodesPerRow();
-   ossim_uint32 DEST_WIDTH  = destination->getWidth();
-   
-   ossim_uint32 compressionIdx = 0;
-   ossim_uint32 uncompressIdx  = 0;
-   ossim_uint32 uncompressYidx = 0;
-   ossim_uint8  lutValue = 0;
-   ossim_uint8* data     = 0;
-   ossim_uint32 codeWord = 0;
-   
-   for(ossim_uint32 compressionYidx = 0;
-       compressionYidx < COMPRESSION_HEIGHT;
-       ++compressionYidx)
-   {
-      uncompressYidx = compressionYidx * ROWS * DEST_WIDTH;
-      
-      for(ossim_uint32 compressionXidx = 0;
-          compressionXidx < COMPRESSION_WIDTH;
-          ++compressionXidx)
-      {
-         uncompressIdx = uncompressYidx + COLS * compressionXidx;
-
-         codeWord = bits.getValueAsUint32(compressionIdx++);
-         codeWord *= COLS;
-
-         for(ossim_uint32 rowIdx = 0; rowIdx < ROWS; ++rowIdx)
-         {
-            data = &(table[rowIdx].theData[codeWord]);
-            
-            for(ossim_uint32 colIdx = 0; colIdx < COLS; ++colIdx)
-            {
-               lutValue = (*data)&0xff;
-
-               for (band = 0; band < BANDS; ++band)
-               {
-                  ossim_uint8 p = (*theLut.get())[lutValue][band];
-                  tempRows[band][uncompressIdx+colIdx] = p;
-               }
-               ++data;
-               
-            } // column loop
-
-            uncompressIdx += DEST_WIDTH;
-            
-         } // row loop
-
-      } // x compression loop
-      
-   } // y compression loop
-}
-
-void ossimNitfTileSource::vqUncompressM4(
-   ossimRefPtr<ossimImageData> destination, ossim_uint8* source)
-{
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr||!destination)
-   {
-      return;
-   }
-
-   const ossim_uint32 BANDS = destination->getNumberOfBands();
-
-   if(( (BANDS != 1)&&(BANDS!=3) ) ||
-      (!destination->getBuf())||
-      (destination->getScalarType()!=OSSIM_UINT8))
-   {
-      return;
-   }
-   
-   ossimNitfVqCompressionHeader* compressionHeader =
-      PTR_CAST(ossimNitfVqCompressionHeader,
-               hdr->getCompressionHeader().get());
-
-   if(!compressionHeader)
-   {
-      return;
-   }
-
-   const std::vector<ossimNitfVqCompressionOffsetTableData>& table =
-      compressionHeader->getTable();
-
-   ossimRefPtr<ossimNitfImageBand> bandInfo = hdr->getBandInformation(0);
-   
-   if(!bandInfo.valid()) return;
-   
-   std::vector<ossimRefPtr<ossimNitfImageLut> > luts(BANDS);
-   std::vector<ossim_uint8*> tempRows(BANDS);
-
-   ossim_uint32 band;
-   for (band =0; band<BANDS; ++band)
-   {
-      luts[band] = bandInfo->getLut(band);
-      if ( luts[band].valid() )
-      {
-         tempRows[band] = (ossim_uint8*)destination->getBuf(band);
-      }
-      else
-      {
-         return;
-      }
-   }
-
-   const ossim_uint8 NI = 216; // null index (transparency index).
-   const ossim_uint8 NP = 0;   // null pixel
-
-   ossim_uint32 destWidth  = destination->getWidth();
-   ossimPackedBits bits(source, compressionHeader->getImageCodeBitLength());
-
-   ossim_uint32 compressionYidx   = 0;
-   ossim_uint32 compressionXidx   = 0;
-   ossim_uint32 compressionIdx    = 0;
-   ossim_uint32 uncompressIdx     = 0;
-   ossim_uint32 uncompressYidx    = 0;
-   ossim_uint32 rows   = (ossim_uint32)table.size();
-   ossim_uint32 cols   = 0;
-   ossim_uint32 rowIdx = 0;
-   ossim_uint32 colIdx = 0;
-   if(rows)
-   {
-      cols = table[0].theNumberOfValuesPerCompressionLookup;
-   }
-   ossim_uint32 compressionHeight = compressionHeader->getNumberOfImageRows();
-   ossim_uint32 compressionWidth  =
-      compressionHeader->getNumberOfImageCodesPerRow();
-   ossim_uint8 lutValue = 0;
-   ossim_uint8* data=0;
-
-   for(compressionYidx = 0;
-       compressionYidx < compressionHeight;
-       ++compressionYidx)
-   {
-      uncompressYidx = compressionYidx*rows*destWidth;
-
-      for(compressionXidx = 0;
-          compressionXidx < compressionWidth;
-          ++compressionXidx)
-      {
-         uncompressIdx = uncompressYidx + cols*compressionXidx;
-         ossim_uint32 codeWord = bits.getValueAsUint32(compressionIdx);
-         
-         bool transparent = false;
-         if (codeWord == 4095)
-         {
-            //---
-            // Check to see if the whole kernel is transparent.  If no, the
-            // null index '216' could be used for valid pixels.
-            //
-            // For more see docs:
-            // MIL-PRF-89041A 3.13.1.2 Transparent pixels
-            // MIL-STD-2411
-            //---
-            codeWord *= cols;
-            transparent = true;
-            for(rowIdx = 0; rowIdx < rows; ++rowIdx)
-            {
-               data = &table[rowIdx].theData[codeWord];
-               
-               for(colIdx = 0; colIdx < cols; ++colIdx)
-               {
-                  lutValue = (*data)&0xff;
-                  if (lutValue != NI)
-                  {
-                     // Not a kernel full of transparent pixels.
-                     transparent = false;
-                     break;
-                  }
-                  ++data;
-               }
-               if (!transparent)
-               {
-                  break;
-               }
-               uncompressIdx += destWidth;
-            }
-         }
-
-         // Reset everyone for loop to copy pixel data from lut.
-         uncompressIdx = uncompressYidx + cols*compressionXidx;
-         codeWord = bits.getValueAsUint32(compressionIdx);
-         codeWord *= cols;
-
-         for(rowIdx = 0; rowIdx < rows; ++rowIdx)
-         {
-            data = &table[rowIdx].theData[codeWord];
-            
-            for(colIdx = 0; colIdx < cols; ++colIdx)
-            {
-               lutValue = (*data)&0xff;
-               
-               for (band = 0; band < BANDS; ++band)
-               {
-                  ossim_uint8 p = luts[band]->getValue(lutValue);
-                  tempRows[band][uncompressIdx+colIdx] = (!transparent?p:NP);
-               }
-               ++data;
-            }
-
-            uncompressIdx += destWidth;
-         }
-         ++compressionIdx;
-         
-      } // x loop
-      
-   } // y loop
-}
-
-bool ossimNitfTileSource::scanForJpegBlockOffsets()
-{
-   // Find, capture all jpeg block offsets and sizes for an entry.
-   
-   bool allBlocksFound = false;
-   
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-
-   if ( !hdr || (theReadMode != READ_JPEG_BLOCK) || !theFileStr )
-   {
-      return allBlocksFound; // Get out...
-   }
-
-   theNitfBlockOffset.clear();
-   theNitfBlockSize.clear();
-
-   //---
-   // Get the totol blocks.
-   // Note:  There can be more than one jpeg image in the nitf.  So after blocks
-   // found equals total_blocks get out.
-   //---
-   ossim_uint32 total_blocks = hdr->getNumberOfBlocksPerRow()*hdr->getNumberOfBlocksPerCol();
-   
-   //---
-   // NOTE:
-   // SOI = 0xffd8 Start of image
-   // EOI = 0xffd9 End of image
-   // DHT = 0xffc4 Define Huffman Table(s)
-   // DQT = 0xffdb Define Quantization Table(s)
-   //---
-
-   // Seek to the first block.
-   theFileStr.seekg(hdr->getDataLocation(), ios::beg);
-
-   if ( theFileStr.good() )
-   {
-      const ossim_uint8 AP6 = 0xe6;
-      const ossim_uint8 AP7 = 0xe7;
-      const ossim_uint8 DHT = 0xc4;
-      const ossim_uint8 DQT = 0xdb;
-      const ossim_uint8 EOI = 0xd9;
-      const ossim_uint8 FF  = 0xff;
-      const ossim_uint8 SOI = 0xd8;
-      const ossim_uint8 SOS = 0xda;
-
-      union
-      {
-         char c;
-         ossim_uint8 uc;
-      } ct;
-
-      std::streamoff soiOffset = 0;
-      std::streamoff eoiOffset = 0;
-      ossim_uint16   length    = 0;
-
-      ossimEndian* swapper = 0;
-      if ( ossim::byteOrder() == OSSIM_LITTLE_ENDIAN )
-      {
-         swapper = new ossimEndian();
-      }
-      
-      // Find all the SOI markers.
-      while ( theFileStr.get( ct.c ) && !allBlocksFound ) 
-      {
-         if ( ct.uc == FF ) // Found FF byte.
-         {
-            // Loop to skip multiple 0xff's in cases like FF FF D8
-            while ( theFileStr.get( ct.c ) )
-            {
-               if ( ct.uc != FF)
-               {
-                  break;
-               }
-            }
-         
-            if ( ct.uc == SOI ) 
-            {
-               // At SOI 0xFFD8 marker... SOI marker offset is two bytes back.
-               soiOffset = ((std::streamoff)theFileStr.tellg()) - 2;
-
-               // Now look for matching EOI.
-               while ( theFileStr.get( ct.c ) )
-               {
-                  if ( ct.uc == FF ) // Found FF byte.
-                  {
-                     // Loop to skip multiple 0xff's in cases like FF FF D8
-                     while ( theFileStr.get( ct.c ) )
-                     {
-                        if ( ct.uc != FF )
-                        {
-                           break;
-                        }
-                     }
-
-                     if ( ct.uc == EOI )
-                     {
-                        // At EOI 0xD9marker...
-                        eoiOffset = theFileStr.tellg();
-
-                        // Capture offset:
-                        theNitfBlockOffset.push_back( soiOffset );
-
-                        // Capture block size:
-                        theNitfBlockSize.push_back( eoiOffset - soiOffset );
-
-                        //---
-                        // Since there can be more than one jpeg entry in a file, breeak out of
-                        // loop when we hit block size.
-                        //---
-                        if ( theNitfBlockOffset.size() == total_blocks )
-                        {
-                           allBlocksFound = true;
-                        }
-
-                        break; // From "find EOI" while loop.
-                     }
-                     //---
-                     // These are things to skip to avoid hitting random sequence of FFD9
-                     // and picking up a false EOI.
-                     // Not a complete set of markers but all test data works.
-                     // drb - 14 May 2013.
-                     //---
-                     else if ( ( ct.uc == AP6 ) || ( ct.uc == AP7 ) || ( ct.uc == DHT ) ||
-                               ( ct.uc == DQT ) || ( ct.uc == SOS ) ||
-                               ( ( ct.uc >= 0xc0 ) && ( ct.uc <= 0xcF ) )
-                               )
-                     {
-                        // Length two byte big endian.
-                        theFileStr.read( (char*)&length, 2 );
-                        if ( swapper )
-                        {
-                           swapper->swap( length );
-                        }
-                        // Length includes two length bytes.
-
-                        // Seek to the end of the record.
-                        theFileStr.seekg( length - 2, std::ios_base::cur );
-                     }
-
-                  } //  Matches: if ( ct.uc == FF )
-                  
-               } // Matches: while ( theFileStr.get( ut.c ) ) "find EOI loop" 
-               
-            } // Matches: if ( ut.uc == SOI ) "SOI marker found"
-
-         } // Matches: if ( ut.uc == FF )
-
-      } // Matches: while ( theFileStr.get( ut.c ) && !allBlocksFound )
-
-      if ( swapper )
-      {
-         delete swapper;
-         swapper = 0;
-      }
-
-   } // Matches: if ( theFileStr.good() )
-
-   theFileStr.seekg(0, ios::beg);
-   theFileStr.clear();
-
-#if 0 /* Please leave for debug. (drb) */
-   std::streamoff startOfData = hdr->getDataLocation();
-   ossimNotify(ossimNotifyLevel_WARN) << "current entry: " << theCurrentEntry << "\n";
-   for (ossim_uint32 i = 0; i < total_blocks; ++i)
-   {
-      cout << "theNitfBlockOffset[" << i << "]: " << theNitfBlockOffset[i]
-           << "\nrealative_offset[" << i << "]:   " << (theNitfBlockOffset[i] - startOfData)
-           << "\ntheNitfBlockSize[" << i << "]:   " << theNitfBlockSize[i]
-           << "\n";
-   }
-#endif
-   
-   if ( !allBlocksFound )
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG:"
-            << "\nBlock offset count wrong!"
-            << "\nexpected blocks:        " << total_blocks
-            << "\noffset array count:     " << theNitfBlockOffset.size()
-            << "\nblock size array count: " << theNitfBlockSize.size()
-            << std::endl;
-      }
-      theNitfBlockOffset.clear();
-      theNitfBlockSize.clear();
-   }
-
-   return allBlocksFound;
-}
-
-bool ossimNitfTileSource::uncompressJpegBlock(ossim_uint32 x, ossim_uint32 y)
-{
-   ossim_uint32 blockNumber = getBlockNumber( ossimIpt(x,y) );
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfTileSource::uncompressJpegBlock DEBUG:"
-         << "\nblockNumber:  " << blockNumber
-         << std::endl;
-   }
-
-   //---
-   // Logic to hold off on scanning for offsets until a block is actually needed
-   // to speed up loads for things like ossim-info that don't actually read
-   // pixel data.
-   //---
-   if ( m_jpegOffsetsDirty )
-   {
-      if ( scanForJpegBlockOffsets() )
-      {
-         m_jpegOffsetsDirty = false;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "ossimNitfTileSource::uncompressJpegBlock scan for offsets error!"
-            << "\nReturning error..." << endl;
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         return false;
-      }
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\noffset to block: " << theNitfBlockOffset[blockNumber]
-         << "\nblock size: " << theNitfBlockSize[blockNumber]
-         << std::endl;
-   }
-   
-   // Seek to the block.
-   theFileStr.seekg(theNitfBlockOffset[blockNumber], ios::beg);
-   
-   // Read the block into memory.
-   std::vector<ossim_uint8> compressedBuf(theNitfBlockSize[blockNumber]);
-   if (!theFileStr.read((char*)&(compressedBuf.front()),
-                        theNitfBlockSize[blockNumber]))
-   {
-      theFileStr.clear();
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "ossimNitfTileSource::uncompressJpegBlock Read Error!"
-         << "\nReturning error..." << endl;
-      return false;
-   }
-   
-   if (m_isJpeg12Bit)
-   {
-#if defined(JPEG_DUAL_MODE_8_12)
-      return ossimNitfTileSource_12::uncompressJpeg12Block(x,y,theCacheTile, 
-       getCurrentImageHeader(), theCacheSize, compressedBuf, theReadBlockSizeInBytes, 
-       theNumberOfOutputBands);
-#endif  
-   }
-
-   //---
-   // Most of comments below from jpeg-6b "example.c" file.
-   //---
-   
-   /* This struct contains the JPEG decompression parameters and pointers
-    * to working space (which is allocated as needed by the JPEG library).
-    */
-   jpeg_decompress_struct cinfo;
-   
-   /* We use our private extension JPEG error handler.
-    * Note that this struct must live as long as the main JPEG parameter
-    * struct, to avoid dangling-pointer problems.
-    */
-   ossimJpegErrorMgr jerr;
-   
-   /* Step 1: allocate and initialize JPEG decompression object */
-   
-   /* We set up the normal JPEG error routines, then override error_exit. */
-   cinfo.err = jpeg_std_error(&jerr.pub);
- 
-   jerr.pub.error_exit = ossimJpegErrorExit;
-
-   /* Establish the setjmp return context for my_error_exit to use. */
-   if (setjmp(jerr.setjmp_buffer))
-   {
-      /* If we get here, the JPEG code has signaled an error.
-       * We need to clean up the JPEG object, close the input file, and return.
-       */
-     jpeg_destroy_decompress(&cinfo);
-     return false;
-   }
-
-   /* Now we can initialize the JPEG decompression object. */
-   jpeg_CreateDecompress(&cinfo, JPEG_LIB_VERSION, sizeof(cinfo));
-   
-   //---
-   // Step 2: specify data source.  In this case we will uncompress from
-   // memory so we will use "ossimJpegMemorySrc" in place of " jpeg_stdio_src".
-   //---
-   ossimJpegMemorySrc (&cinfo,
-                       &(compressedBuf.front()),
-                       static_cast<size_t>(theReadBlockSizeInBytes));
-
-   /* Step 3: read file parameters with jpeg_read_header() */
-   jpeg_read_header(&cinfo, TRUE);
-  
-   // Check for Quantization tables.
-   if (cinfo.quant_tbl_ptrs[0] == NULL)
-   {
-      // This will load table specified in COMRAT field.
-      if (loadJpegQuantizationTables(cinfo) == false)
-      {
-        jpeg_destroy_decompress(&cinfo);
-        return false;
-      }
-   }
-
-   // Check for huffman tables.
-   if (cinfo.ac_huff_tbl_ptrs[0] == NULL)
-   {
-      // This will load default huffman tables into .
-      if (loadJpegHuffmanTables(cinfo) == false)
-      {
-        jpeg_destroy_decompress(&cinfo);
-        return false;
-      }
-   }
-
-   /* Step 4: set parameters for decompression */
-   
-   /* In this example, we don't need to change any of the defaults set by
-    * jpeg_read_header(), so we do nothing here.
-    */
-
-   /* Step 5: Start decompressor */
-   jpeg_start_decompress(&cinfo);
-
-#if 0 /* Please leave for debug. (drb) */
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "jpeg cinfo.output_width:  " << cinfo.output_width
-         << "\njpeg cinfo.output_height: " << cinfo.output_height
-         << "\n";
-   }
-#endif
-   
-   const ossim_uint32 SAMPLES = cinfo.output_width;
-
-   //---
-   // Note: Some nitf will be tagged with a given number of lines but the last
-   // jpeg block may go beyond that to a complete block.  So it you clamp to
-   // last line of the nitf you will get a libjpeg error:
-   // 
-   // "Application transferred too few scanlines"
-   //
-   // So here we will always read the full jpeg block even if it is beyond the
-   // last line of the nitf.
-   //---
-   const ossim_uint32 LINES_TO_READ =
-      min(static_cast<ossim_uint32>(theCacheSize.y), cinfo.output_height);
-
-   /* JSAMPLEs per row in output buffer */
-   const ossim_uint32 ROW_STRIDE = SAMPLES * cinfo.output_components;
-
-   if ( (SAMPLES < theCacheTile->getWidth() ) ||
-        (LINES_TO_READ < theCacheTile->getHeight()) )
-   {
-      theCacheTile->makeBlank();
-   }
-
-   if ( (SAMPLES > theCacheTile->getWidth()) ||
-        (LINES_TO_READ > theCacheTile->getHeight()) )
-   {
-     // Error...
-     jpeg_finish_decompress(&cinfo);
-     jpeg_destroy_decompress(&cinfo);
-     return false;
-   }
-
-   // Get pointers to the cache tile buffers.
-   std::vector<ossim_uint8*> destinationBuffer(theNumberOfInputBands);
-   for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
-   {
-     destinationBuffer[band] = theCacheTile->getUcharBuf(band);
-   }
-
-   std::vector<ossim_uint8> lineBuffer(ROW_STRIDE);
-   JSAMPROW jbuf[1];
-   jbuf[0] = (JSAMPROW) &(lineBuffer.front());
-
-   while (cinfo.output_scanline < LINES_TO_READ)
-   {
-     // Read a line from the jpeg file.
-     jpeg_read_scanlines(&cinfo, jbuf, 1);
-
-     //---
-     // Copy the line which if band interleaved by pixel the the band
-     // separate buffers.
-     //
-     // Note:
-     // Not sure if IMODE of 'B' is interleaved the same as image with
-     // IMODE of 'P'.
-     //
-     // This works with all samples with IMODE of B and P but I only have
-     // one band 'B' and three band 'P'.  So if we ever get a three band
-     // 'B' it could be wrong here. (drb - 20090615)
-     //---
-     ossim_uint32 index = 0;
-     for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)         
-     {
-       for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
-       {
-         destinationBuffer[band][sample] = lineBuffer[index];
-         ++index;
-       }
-     }
-
-     for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
-     {
-       destinationBuffer[band] += theCacheSize.x;         
-     }
-   }
-
-   // clean up...
-
-   jpeg_finish_decompress(&cinfo);
-   jpeg_destroy_decompress(&cinfo);
-
-   return true;
-}
-
-//---
-// Default JPEG quantization tables
-// Values from: MIL-STD-188-198, APPENDIX A
-//---
-bool ossimNitfTileSource::loadJpegQuantizationTables(
-   jpeg_decompress_struct& cinfo) const
-{
-   //---
-   // Check to see if table is present.  We will only look at the first table
-   // in the array of arrays.
-   // 
-   // NOTE:  There are four tables in the array "cinfo.quant_tbl_ptrs".  It
-   // looks like the standard is to use the first table. (not sure though)
-   //---
-   if (cinfo.quant_tbl_ptrs[0] != NULL)
-   {
-      return false;
-   }
-
-   // Get the COMRAT (compression rate code) from the header:
-   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
-   if (!hdr)
-   {
-      return false;
-   }
-   
-   ossimString comrat = hdr->getCompressionRateCode();
-   ossim_uint32 tableIndex = 0;
-   if (comrat.size() >= 4)
-   {
-      // COMRAT string like: "00.2" = use table 2. (between 1 and 5).
-      ossimString s;
-      s.push_back(comrat[static_cast<std::string::size_type>(3)]);
-      ossim_int32 comTbl = s.toInt32();
-      if ( (comTbl > 0) && (comTbl < 6) )
-      {
-         tableIndex = comTbl-1;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimNitfTileSource::loadJpegQuantizationTables WARNING\n"
-            << "\nNo quantization tables specified!"
-            << endl;
-         return false;  
-      }
-   }
-
-   cinfo.quant_tbl_ptrs[0] = jpeg_alloc_quant_table((j_common_ptr) &cinfo);
- 
-   JQUANT_TBL* quant_ptr = cinfo.quant_tbl_ptrs[0]; // quant_ptr is JQUANT_TBL*
-
-   for (ossim_int32 i = 0; i < 64; ++i)
-   {
-      /* Qtable[] is desired quantization table, in natural array order */
-      quant_ptr->quantval[i] = QTABLE_ARRAY[tableIndex][i];
-   }
-   return true;
-}
-
-//---
-// Default JPEG Huffman tables
-// Values from: MIL-STD-188-198, APPENDIX B
-//---
-bool ossimNitfTileSource::loadJpegHuffmanTables(
-   jpeg_decompress_struct& cinfo) const
-{
-   if ( (cinfo.ac_huff_tbl_ptrs[0] != NULL) &&
-        (cinfo.dc_huff_tbl_ptrs[0] != NULL) )
-   {
-      return false;
-   }
-
-   cinfo.ac_huff_tbl_ptrs[0] = jpeg_alloc_huff_table((j_common_ptr)&cinfo);
-   cinfo.dc_huff_tbl_ptrs[0] = jpeg_alloc_huff_table((j_common_ptr)&cinfo);
-
-   ossim_int32 i;
-   JHUFF_TBL* huff_ptr;
-   
-   // Copy the ac tables.
-   huff_ptr = cinfo.ac_huff_tbl_ptrs[0]; /* huff_ptr is JHUFF_TBL* */     
-   for (i = 0; i < 16; ++i) 
-   {
-      // huff_ptr->bits is array of 17 bits[0] is unused; hence, the i+1
-      huff_ptr->bits[i+1] = AC_BITS[i]; 
-   }
-   
-   for (i = 0; i < 256; ++i)
-   {
-      huff_ptr->huffval[i] = AC_HUFFVAL[i];
-   }
-   
-   // Copy the dc tables.
-   huff_ptr = cinfo.dc_huff_tbl_ptrs[0]; /* huff_ptr is JHUFF_TBL* */
-   for (i = 0; i < 16; ++i)
-   {
-      // huff_ptr->bits is array of 17 bits[0] is unused; hence, the i+1
-      huff_ptr->bits[i+1] = DC_BITS[i];
-   }
-   
-   for (i = 0; i < 256; i++)
-   {
-      /* symbols[] is the list of Huffman symbols, in code-length order */
-      huff_ptr->huffval[i] = DC_HUFFVAL[i];
-   }
-   return true;
-}
-
-// Protected to disallow use...
-ossimNitfTileSource::ossimNitfTileSource(const ossimNitfTileSource& /* obj */)
-{
-}
-
-// Protected to disallow use...
-ossimNitfTileSource& ossimNitfTileSource::operator=(
-   const ossimNitfTileSource& /* rhs */)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimNitfTileSource_12.cpp b/ossim/src/ossim/imaging/ossimNitfTileSource_12.cpp
deleted file mode 100644
index 73e046f..0000000
--- a/ossim/src/ossim/imaging/ossimNitfTileSource_12.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description:
-//
-// Contains class declaration for NitfTileSource_12.
-//
-//*******************************************************************
-//  $Id: ossimNitfTileSource_12.cpp 958 2010-06-03 23:00:32Z ming.su $
-
-//#if defined(JPEG_DUAL_MODE_8_12)
-#include <fstream>
-
-#if defined(JPEG_DUAL_MODE_8_12)
-#include <jpeg12/jpeglib.h>
-
-//ossim includes
-#include <ossim//imaging/ossimJpegMemSrc.h>
-#include <ossim/imaging/ossimNitfTileSource_12.h>
-#include <ossim/imaging/ossimJpegDefaultTable.h>
-
-bool ossimNitfTileSource_12::uncompressJpeg12Block(ossim_uint32 x, ossim_uint32 y,
-                                                   ossimRefPtr<ossimImageData> cacheTile,
-                                                   ossimNitfImageHeader* hdr,
-                                                   ossimIpt cacheSize,
-                                                   std::vector<ossim_uint8> compressedBuf,
-                                                   ossim_uint32 readBlockSizeInBytes,
-                                                   ossim_uint32 bands)
-{
-   jpeg_decompress_struct cinfo;
-
-   ossimJpegErrorMgr jerr;
-
-   cinfo.err = jpeg_std_error(&jerr.pub);
-   
-   jerr.pub.error_exit = ossimJpegErrorExit;
-
-   /* Establish the setjmp return context for my_error_exit to use. */
-   if (setjmp(jerr.setjmp_buffer))
-   {
-     jpeg_destroy_decompress(&cinfo);
-   
-     return false;
-   }
-
-   jpeg_CreateDecompress(&cinfo, JPEG_LIB_VERSION, sizeof(cinfo));
-  
-   //---
-   // Step 2: specify data source.  In this case we will uncompress from
-   // memory so we will use "ossimJpegMemorySrc" in place of " jpeg_stdio_src".
-   //---
-   ossimJpegMemorySrc (&cinfo,
-                       &(compressedBuf.front()),
-                       static_cast<size_t>(readBlockSizeInBytes));
-
-   /* Step 3: read file parameters with jpeg_read_header() */
-  
-   jpeg_read_header(&cinfo, TRUE);
-  
-   
-   // Check for Quantization tables.
-   if (cinfo.quant_tbl_ptrs[0] == NULL)
-   {
-      // This will load table specified in COMRAT field.
-      if (loadJpegQuantizationTables(hdr, cinfo) == false)
-      {
-        jpeg_destroy_decompress(&cinfo);
-        return false;
-      }
-   }
-
-   // Check for huffman tables.
-   if (cinfo.ac_huff_tbl_ptrs[0] == NULL)
-   {
-      // This will load default huffman tables into .
-      if (loadJpegHuffmanTables(cinfo) == false)
-      {
-        jpeg_destroy_decompress(&cinfo);
-        return false;
-      }
-   }
-
-   /* Step 4: set parameters for decompression */
-   
-   /* In this example, we don't need to change any of the defaults set by
-    * jpeg_read_header(), so we do nothing here.
-    */
-
-   /* Step 5: Start decompressor */
-   
-   jpeg_start_decompress(&cinfo);
-  
-   const ossim_uint32 SAMPLES = cinfo.output_width;
-
-   //---
-   // Note: Some nitf will be tagged with a given number of lines but the last
-   // jpeg block may go beyond that to a complete block.  So it you clamp to
-   // last line of the nitf you will get a libjpeg error:
-   // 
-   // "Application transferred too few scanlines"
-   //
-   // So here we will always read the full jpeg block even if it is beyond the
-   // last line of the nitf.
-   //---
-   const ossim_uint32 LINES_TO_READ =
-      min(static_cast<ossim_uint32>(cacheSize.y), cinfo.output_height);
-
-   /* JSAMPLEs per row in output buffer */
-   const ossim_uint32 ROW_STRIDE = SAMPLES * cinfo.output_components;
-
-   if ( (SAMPLES < cacheTile->getWidth() ) ||
-        (LINES_TO_READ < cacheTile->getHeight()) )
-   {
-      cacheTile->makeBlank();
-   }
-
-   if ( (SAMPLES > cacheTile->getWidth()) ||
-        (LINES_TO_READ > cacheTile->getHeight()) )
-   {
-     jpeg_finish_decompress(&cinfo);
-     jpeg_destroy_decompress(&cinfo);
-
-     return false;
-   }
-   
-   // Get pointers to the cache tile buffers.
-   std::vector<ossim_uint16*> destinationBuffer(bands);
-   ossim_uint32 band = 0;
-   for (band = 0; band < bands; ++band)
-   {
-     destinationBuffer[band] = cacheTile->getUshortBuf(band);
-   }
-
-   std::vector<ossim_uint16> lineBuffer(ROW_STRIDE);
-   JSAMPROW jbuf[1];
-   jbuf[0] = (JSAMPROW) &(lineBuffer.front());
-
-   while (cinfo.output_scanline < LINES_TO_READ)
-   {
-     // Read a line from the jpeg file.
-     jpeg_read_scanlines(&cinfo, jbuf, 1);
-
-     ossim_uint32 index = 0;
-     for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)         
-     {
-       for (band = 0; band < bands; ++band)
-       {
-         destinationBuffer[band][sample] = lineBuffer[index];
-         ++index;
-       }
-     }
-
-     for (band = 0; band < bands; ++band)
-     {
-       destinationBuffer[band] += cacheSize.x;         
-     }
-   }
-
-   jpeg_finish_decompress(&cinfo);
-   jpeg_destroy_decompress(&cinfo);
- 
-   return true;
-}
-
-bool ossimNitfTileSource_12::loadJpegQuantizationTables(ossimNitfImageHeader* hdr,
-                                jpeg_decompress_struct& cinfo)
-{
-  if (!hdr)
-  {
-    return false;
-  }
-
-  ossimString comrat = hdr->getCompressionRateCode();
-  ossim_uint32 tableIndex = 0;
-  if (comrat.size() >= 4)
-  {
-    // COMRAT string like: "00.2" = use table 2. (between 1 and 5).
-    ossimString s;
-    s.push_back(comrat[static_cast<std::string::size_type>(3)]);
-    ossim_int32 comTbl = s.toInt32();
-    if ( (comTbl > 0) && (comTbl < 6) )
-    {
-      tableIndex = comTbl-1;
-    }
-    else
-    {
-      ossimNotify(ossimNotifyLevel_WARN)
-        << "ossimNitfTileSource_12::loadJpegQuantizationTables WARNING\n"
-        << "\nNo quantization tables specified!"
-        << endl;
-      return false;  
-    }
-  }
-
-  cinfo.quant_tbl_ptrs[0] = jpeg_alloc_quant_table((j_common_ptr) &cinfo);
-
-  JQUANT_TBL* quant_ptr = cinfo.quant_tbl_ptrs[0]; // quant_ptr is JQUANT_TBL*
-
-  for (ossim_int32 i = 0; i < 64; ++i)
-  {
-    /* Qtable[] is desired quantization table, in natural array order */
-    quant_ptr->quantval[i] = QTABLE_ARRAY[tableIndex][i];
-  }
-  return true;
-}
-
-bool ossimNitfTileSource_12::loadJpegHuffmanTables(jpeg_decompress_struct& cinfo)
-{
-  if ( (cinfo.ac_huff_tbl_ptrs[0] != NULL) &&
-    (cinfo.dc_huff_tbl_ptrs[0] != NULL) )
-  {
-    return false;
-  }
-
-  cinfo.ac_huff_tbl_ptrs[0] = jpeg_alloc_huff_table((j_common_ptr)&cinfo);
-  cinfo.dc_huff_tbl_ptrs[0] = jpeg_alloc_huff_table((j_common_ptr)&cinfo);
-
-  ossim_int32 i;
-  JHUFF_TBL* huff_ptr;
-
-  // Copy the ac tables.
-  huff_ptr = cinfo.ac_huff_tbl_ptrs[0]; /* huff_ptr is JHUFF_TBL* */     
-  for (i = 0; i < 16; ++i) 
-  {
-    // huff_ptr->bits is array of 17 bits[0] is unused; hence, the i+1
-    huff_ptr->bits[i+1] = AC_BITS[i]; 
-  }
-
-  for (i = 0; i < 256; ++i)
-  {
-    huff_ptr->huffval[i] = AC_HUFFVAL[i];
-  }
-
-  // Copy the dc tables.
-  huff_ptr = cinfo.dc_huff_tbl_ptrs[0]; /* huff_ptr is JHUFF_TBL* */
-  for (i = 0; i < 16; ++i)
-  {
-    // huff_ptr->bits is array of 17 bits[0] is unused; hence, the i+1
-    huff_ptr->bits[i+1] = DC_BITS[i];
-  }
-
-  for (i = 0; i < 256; i++)
-  {
-    /* symbols[] is the list of Huffman symbols, in code-length order */
-    huff_ptr->huffval[i] = DC_HUFFVAL[i];
-  }
-  return true;
-}
-
-#endif /* defined(JPEG_DUAL_MODE_8_12) */
-
diff --git a/ossim/src/ossim/imaging/ossimNitfWriter.cpp b/ossim/src/ossim/imaging/ossimNitfWriter.cpp
deleted file mode 100644
index 48146e7..0000000
--- a/ossim/src/ossim/imaging/ossimNitfWriter.cpp
+++ /dev/null
@@ -1,930 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimNitfWriter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimNitfWriter.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimRpcSolver.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimRectangleCutFilter.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
-#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
-#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
-#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
-#include <ossim/support_data/ossimNitfNameConversionTables.h>
-#include <ossim/support_data/ossimNitfBlockaTag.h>
-#include <ossim/support_data/ossimNitfImageDataMaskV2_1.h>
-#include <tiffio.h>
-#include <fstream>
-#include <algorithm>
-#include <sstream>
-#include <iomanip>
-
-RTTI_DEF1(ossimNitfWriter, "ossimNitfWriter", ossimNitfWriterBase);
-
-static ossimTrace traceDebug(ossimString("ossimNitfWriter:debug"));
-
-// Maximum file size
-static const ossim_uint64 KB = 1024;
-static const ossim_uint64 MB = KB * KB;
-static const ossim_uint64 MB50 = 50 * MB;
-static const ossim_uint64 GB = KB * MB;
-static const ossim_uint64 GB2 = 2 * GB;
-static const ossim_uint64 GB10 = 10 * GB;
-                            
-ossimNitfWriter::ossimNitfWriter(const ossimFilename& filename,
-                                 ossimImageSource* inputSource)
-   : ossimNitfWriterBase(filename, inputSource),
-     m_outputStream(0),
-     m_fileHeader(0),
-     m_imageHeader(0),
-     m_textHeader(0),
-     m_textEntry(),
-     m_blockSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT)
-{
-   //---
-   // Since the internal nitf tags are not very accurate, write an external
-   // geometry out as default behavior.  Users can disable this via the
-   // property interface or keyword list.
-   //---
-   setWriteExternalGeometryFlag(true);
-   
-   m_fileHeader       = new ossimNitfFileHeaderV2_1;
-   m_imageHeader      = new ossimNitfImageHeaderV2_1;
-
-   // m_textHeader is conditional so we will not new here.
-   
-   theOutputImageType = "nitf_block_band_separate";
-
-   //---
-   // The tile size can be set in the preferences via "tile_size" keyword.
-   // This will get it if set; else, set to default.
-   //---
-   ossim::defaultTileSize(m_blockSize);
-
-   // These are always set:
-   m_fileHeader->setEncryption( ossimString("0") );
-   m_imageHeader->setJustification( ossimString("R") );
-
-   // Set any site defaults.
-   initializeDefaultsFromConfigFile(
-      dynamic_cast<ossimNitfFileHeaderV2_X*>(m_fileHeader.get()),
-      dynamic_cast<ossimNitfImageHeaderV2_X*>(m_imageHeader.get()) );
-}
-
-ossimNitfWriter::~ossimNitfWriter()
-{
-   //---
-   // This looks like a leak but it's not as both of these are ossimRefPtr's.
-   //---
-   m_fileHeader=0;
-   m_imageHeader=0;
-   m_textHeader=0;
-
-   close();
-}
-
-bool ossimNitfWriter::isOpen()const
-{
-   return m_outputStream;
-}
-
-bool ossimNitfWriter::open()
-{
-   if(isOpen())
-   {
-      close();
-   }
-   m_outputStream = new ossimOFStream64(theFilename.c_str(), 
-                                            ios::out|ios::binary);
-   //new std::ofstream;
-   //m_outputStream->open(theFilename.c_str(), ios::out|ios::binary);
-   
-   return m_outputStream->good();
-}
-
-void ossimNitfWriter::close()
-{
-   if(m_outputStream)
-   {
-      m_outputStream->close();
-      delete m_outputStream;
-      m_outputStream = 0;
-   }
-}
-
-bool ossimNitfWriter::writeFile()
-{
-   if(!theInputConnection->isMaster())
-   {
-      theInputConnection->slaveProcessTiles();
-
-      return true;
-   }
-
-   open();
-
-   if (!isOpen())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfWriter::writeFile ERROR:"
-            << " Could not open!  Returning..."
-            << std::endl;
-      }
-
-      return false;
-   }
-   
-   // Write out the geometry info.
-   writeGeometry(m_imageHeader.get(), theInputConnection.get());
-
-   // addStandardTags();
-   
-   bool result = false;
-   if((theOutputImageType == "nitf_block_band_separate")||
-      (theOutputImageType == "image/nitf"))
-   {
-      result =  writeBlockBandSeparate();
-   }
-   else if(theOutputImageType == "nitf_block_band_sequential")
-   {
-      result =  writeBlockBandSequential();
-   }
-   
-   close();
-   
-   return result;
-}
-
-void ossimNitfWriter::getImageTypeList(std::vector<ossimString>& imageTypeList)const
-{
-   imageTypeList.push_back(ossimString("nitf_block_band_separate"));
-   imageTypeList.push_back(ossimString("nitf_block_band_sequential"));
-}
-
-void ossimNitfWriter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-   
-   ossimString name = property->getName();
-   
-   if(name == "file_header")
-   {
-      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
-                                                           property.get());
-      if(containerProperty)
-      {
-         std::vector<ossimRefPtr<ossimProperty> > propertyList;
-         containerProperty->getPropertyList(propertyList);
-         m_fileHeader->setProperties(propertyList);
-      }
-   }
-   else if(name == "image_header")
-   {
-      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
-                                                           property.get());
-      if(containerProperty)
-      {
-         std::vector<ossimRefPtr<ossimProperty> > propertyList;
-         containerProperty->getPropertyList(propertyList);
-         m_imageHeader->setProperties(propertyList);
-      }
-   }
-   else if(name == "block_size")
-   {
-      ossimIpt blockSize;
-      blockSize.x = property->valueToString().toInt32();
-      blockSize.y = blockSize.x;
-      setTileSize(blockSize);
-   }
-   else
-   {
-      ossimNitfWriterBase::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitfWriter::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   
-   if(name == "file_header")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      std::vector<ossimRefPtr<ossimProperty> > propertyList;
-      
-      m_fileHeader->getPropertyList(propertyList);
-      container->addChildren(propertyList);
-      
-      result = container;
-   }
-   else if(name == "image_header")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      std::vector<ossimRefPtr<ossimProperty> > propertyList;
-      
-      m_imageHeader->getPropertyList(propertyList);
-      container->addChildren(propertyList);
-      
-      result = container;
-   }
-   else if(name == "des_header")
-   {
-      ossimContainerProperty* container = new ossimContainerProperty(name);
-      std::vector<ossimRefPtr<ossimProperty> > propertyList;
-
-      // Create a temporary DES in order to populate propertyList.
-      ossimNitfDataExtensionSegmentV2_1 des;
-      des.getPropertyList(propertyList);
-      container->addChildren(propertyList);
-
-      result = container;
-   }
-   else if(name == "block_size")
-   {
-      ossimStringProperty* stringProp =
-         new ossimStringProperty(name,
-                                 ossimString::toString(m_blockSize.x),
-                                 false); // editable flag
-      stringProp->addConstraint(ossimString("64"));
-      stringProp->addConstraint(ossimString("128"));
-      stringProp->addConstraint(ossimString("256"));      
-      stringProp->addConstraint(ossimString("512"));      
-      stringProp->addConstraint(ossimString("1024"));      
-      stringProp->addConstraint(ossimString("2048"));      
-      return stringProp;
-   }
-   else
-   {
-      return ossimNitfWriterBase::getProperty(name);
-   }
-
-   return result;
-}
-
-void ossimNitfWriter::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfWriterBase::getPropertyNames(propertyNames);
-
-   propertyNames.push_back("file_header");
-   propertyNames.push_back("image_header");
-   propertyNames.push_back("des_header");
-   propertyNames.push_back("block_size");
-}
-
-bool ossimNitfWriter::writeBlockBandSeparate()
-{
-   ossimScalarType scalarType  = theInputConnection->getOutputScalarType();
-   ossim_uint64    byteSize    = ossim::scalarSizeInBytes(scalarType);
-   ossimIrect      rect        = theInputConnection->getBoundingRect();
-   ossim_uint64    bands       = theInputConnection->getNumberOfOutputBands();
-   ossim_uint64    idx         = 0;
-   ossim_uint64    headerStart = (ossim_uint64)m_outputStream->tellp64();
-
-   // Set the sequencer block size to be the same as output.
-   theInputConnection->setTileSize(m_blockSize);
-   
-   ossim_uint64 blocksHorizontal = theInputConnection->getNumberOfTilesHorizontal();
-   ossim_uint64 blocksVertical   = theInputConnection->getNumberOfTilesVertical();
-   ossim_uint64 numberOfTiles    = theInputConnection->getNumberOfTiles();
-
-   ossimNitfImageInfoRecordV2_1 imageInfoRecord;
-   imageInfoRecord.setSubheaderLength(439); // ok if no tags
-   imageInfoRecord.setImageLength(bands*byteSize*blocksVertical*m_blockSize.y*blocksHorizontal*m_blockSize.x);
-
-   m_fileHeader->setDate();
-   m_fileHeader->addImageInfoRecord(imageInfoRecord);
-
-   if ( m_textHeader.valid() )
-   {
-      // Add any text headers
-      ossimNitfTextFileInfoRecordV2_1 textInfoRecord;
-      textInfoRecord.setSubheaderLength(285); //default
-      // Set length of text to be that of input text
-      textInfoRecord.setTextLength(m_textEntry.length()); 
-      m_fileHeader->addTextInfoRecord(textInfoRecord);
-   }  
-
-   // Get the overflow tags from the file header and the image subheader
-   takeOverflowTags(true, true);
-   takeOverflowTags(true, false);
-   takeOverflowTags(false, true);
-   takeOverflowTags(false, false);
-
-   for (vector<ossimNitfDataExtensionSegmentV2_1>::iterator iter = m_dataExtensionSegments.begin();
-      iter != m_dataExtensionSegments.end(); iter++)
-   {
-      ossimNitfDataExtSegInfoRecordV2_1 desInfoRecord;
-      iter->setSecurityMarkings(*m_fileHeader);
-      std::ostringstream headerOut;
-      headerOut << std::setw(4)
-                << std::setfill('0')
-                << std::setiosflags(ios::right)
-                << iter->getHeaderLength();
-      strcpy(desInfoRecord.theDataExtSegSubheaderLength, headerOut.str().c_str());
-
-      std::ostringstream dataOut;
-      dataOut << std::setw(9)
-                << std::setfill('0')
-                << std::setiosflags(ios::right)
-                << iter->getDataLength();
-      strcpy(desInfoRecord.theDataExtSegLength, dataOut.str().c_str());
-
-      m_fileHeader->addDataExtSegInfoRecord(desInfoRecord);
-   }
-
-   //---
-   // This makes space for the file header; it is written again at the end of
-   // this method with updated values
-   // need a better way to get the length.  This should be queried on the
-   // header before writing
-   //---
-   m_fileHeader->writeStream(*m_outputStream); 
-   ossim_uint64 headerLength = ((ossim_uint64)m_outputStream->tellp64() - headerStart) /* + 1 */;
-   
-   ossimString representation;
-   m_imageHeader->setActualBitsPerPixel(ossim::getActualBitsPerPixel(scalarType));
-   m_imageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
-   m_imageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
-   m_imageHeader->setNumberOfBands(bands);
-   m_imageHeader->setImageMode('B');// blocked
-
-   bool masked = (m_imageHeader->getCompressionCode() == "NM");
-   ossimNitfImageDataMaskV2_1 datamask;
-   datamask.setBlockCount(blocksVertical * blocksHorizontal);
-   ossim_uint64 blockLength = bands * byteSize * m_blockSize.x * m_blockSize.y;
-   datamask.setBlockLengthInBytes(blockLength);
-   std::vector<char> blockZeros;
-
-
-   if((bands == 3)&&
-      (scalarType == OSSIM_UCHAR))
-   {
-      m_imageHeader->setRepresentation("RGB");
-      m_imageHeader->setCategory("VIS");
-   }
-   else if(bands == 1)
-   {
-      m_imageHeader->setRepresentation("MONO");
-      m_imageHeader->setCategory("MS");
-   }
-   else
-   {
-      m_imageHeader->setRepresentation("MULTI");
-      m_imageHeader->setCategory("MS");
-   }
-   
-   m_imageHeader->setBlocksPerRow(blocksHorizontal);
-   m_imageHeader->setBlocksPerCol(blocksVertical);
-   m_imageHeader->setNumberOfPixelsPerBlockRow(m_blockSize.x);
-   m_imageHeader->setNumberOfPixelsPerBlockCol(m_blockSize.y);
-   m_imageHeader->setNumberOfRows(rect.height());
-   m_imageHeader->setNumberOfCols(rect.width());
-
-   ossimNitfImageBandV2_1 bandInfo;
-   for(idx = 0; idx < bands; ++idx)
-   {
-      std::ostringstream out;
-      
-      out << std::setfill('0')
-          << std::setw(2)
-          << idx;
-      
-      bandInfo.setBandRepresentation(out.str().c_str());
-      m_imageHeader->setBandInfo(idx, bandInfo);
-   }
-
-   ossim_uint64 imageHeaderStart = m_outputStream->tellp64();
-   m_imageHeader->writeStream(*m_outputStream);
-   ossim_uint64 imageHeaderEnd = m_outputStream->tellp64();
-   ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
-
-   // Start the sequence through tiles:
-   theInputConnection->setToStartOfSequence();
-   
-   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
-   ossim_uint64 tileNumber = 1;
-   ossimEndian endian;
-   
-   // write out mask if needed
-   if(masked)
-   {
-      blockZeros.resize(blockLength);
-      memset(&blockZeros.front(), '\0', blockLength);
-      datamask.writeStream(*m_outputStream);
-   }
-   while( data.valid() && !needsAborting())
-   {
-      bool write = true;
-      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-      {
-         switch(data->getScalarType())
-         {
-            case OSSIM_USHORT16:
-            case OSSIM_USHORT11:
-            {
-               endian.swap((ossim_uint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_SSHORT16:
-            {
-               endian.swap((ossim_sint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_FLOAT:
-            case OSSIM_NORMALIZED_FLOAT:
-            {
-               endian.swap((ossim_float32*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_DOUBLE:
-            case OSSIM_NORMALIZED_DOUBLE:
-            {
-               endian.swap((ossim_float64*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            default:
-               break;
-         }
-      }
-      
-      if (masked)
-      {
-         if (memcmp(data->getBuf(), &blockZeros.front(), blockLength) == 0)
-         {
-            write = false;
-            datamask.setIncludeBlock(tileNumber-1, false);
-         }
-      }
-      if(write)
-      {
-         m_outputStream->write((char*)(data->getBuf()), data->getSizeInBytes());         
-      }
-      
-      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
-      
-      if(!needsAborting())
-      {
-         data = theInputConnection->getNextTile();
-      }
-      ++tileNumber;
-   }
-
-   // ossim_uint64 imageSegmentEnd = m_outputStream->tellp64();
-
-   // Let's write our text header
-   if ( m_textHeader.valid() )
-   {
-      m_textHeader->writeStream(*m_outputStream); 
-      //Now write the text
-      m_outputStream->write((char*)(m_textEntry.c_str()), m_textEntry.length());
-   }   
-
-
-   for (vector<ossimNitfDataExtensionSegmentV2_1>::iterator iter = m_dataExtensionSegments.begin();
-      iter != m_dataExtensionSegments.end(); iter++)
-   {
-      iter->writeStream(*m_outputStream);
-   }
-
-   if (masked)
-   {
-      m_outputStream->seekp(imageHeaderEnd);
-      datamask.writeStream(*m_outputStream);
-      //delete [] blockZeros;
-   }
-
-   std::streamoff pos = m_outputStream->tellp64();
-
-   setComplexityLevel(pos, m_fileHeader.get());
-
-   /*
-    * Need to change the way I compute file length and header length later
-    * We need to figure out a better way to compute.
-    */
-   m_fileHeader->setFileLength(static_cast<ossim_uint64>(pos));
-   m_fileHeader->setHeaderLength(headerLength);
-   m_outputStream->seekp(0, ios::beg);
-   imageInfoRecord.setSubheaderLength(imageHeaderSize);
-   m_fileHeader->replaceImageInfoRecord(0, imageInfoRecord);
-   m_fileHeader->writeStream(*m_outputStream);
-   
-   return true;
-}
-
-bool ossimNitfWriter::writeBlockBandSequential()
-{
-   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
-   ossim_uint64    byteSize   = ossim::scalarSizeInBytes(scalarType);
-   ossimIrect      rect       = theInputConnection->getBoundingRect();
-   ossim_uint64    bands      = theInputConnection->getNumberOfOutputBands();
-   ossim_uint64    idx        = 0;
-   ossim_uint64    headerStart   = (ossim_uint64)m_outputStream->tellp64();
-
-   // Set the sequencer block size to be the same as output.
-   theInputConnection->setTileSize(m_blockSize);
-   
-   ossim_uint64 blocksHorizontal = theInputConnection->getNumberOfTilesHorizontal();
-   ossim_uint64 blocksVertical   = theInputConnection->getNumberOfTilesVertical();
-   ossim_uint64 numberOfTiles    = theInputConnection->getNumberOfTiles();
-
-   ossimNitfImageInfoRecordV2_1 imageInfoRecord;
-   imageInfoRecord.setSubheaderLength(439);
-   imageInfoRecord.setImageLength(bands*byteSize*blocksHorizontal*blocksVertical*m_blockSize.x*m_blockSize.y);
-
-   m_fileHeader->setDate();
-   m_fileHeader->addImageInfoRecord(imageInfoRecord);
-
-   if ( m_textHeader.valid() )
-   {
-      // Add any text headers
-      ossimNitfTextFileInfoRecordV2_1 textInfoRecord;
-      textInfoRecord.setSubheaderLength(285); //default
-      // Set length of text to be that of input text
-      textInfoRecord.setTextLength(m_textEntry.length()); 
-      m_fileHeader->addTextInfoRecord(textInfoRecord);
-   }
-
-   //---
-   // This makes space for the file header; it is written again at the end of
-   // this method with updated values
-   // need a better way to get the length.  This should be queried on the
-   // header before writing
-   //---  
-   m_fileHeader->writeStream(*m_outputStream);
-   ossim_uint64 headerLength = ((ossim_uint64)m_outputStream->tellp64() - headerStart) /* + 1 */;
-   
-   ossimString representation;
-   m_imageHeader->setActualBitsPerPixel(ossim::getActualBitsPerPixel(scalarType));
-   m_imageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
-   m_imageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
-   m_imageHeader->setNumberOfBands(bands);
-   m_imageHeader->setImageMode('S');// blocked
-   
-   if((bands == 3)&&
-      (scalarType == OSSIM_UCHAR))
-   {
-      m_imageHeader->setRepresentation("RGB");
-      m_imageHeader->setCategory("VIS");
-   }
-   else if(bands == 1)
-   {
-      m_imageHeader->setRepresentation("MONO");
-      m_imageHeader->setCategory("MS");
-   }
-   else
-   {
-      m_imageHeader->setRepresentation("MULTI");
-      m_imageHeader->setCategory("MS");
-   }
-   m_imageHeader->setBlocksPerRow(blocksHorizontal);
-   m_imageHeader->setBlocksPerCol(blocksVertical);
-   m_imageHeader->setNumberOfPixelsPerBlockRow(m_blockSize.x);
-   m_imageHeader->setNumberOfPixelsPerBlockCol(m_blockSize.y);
-   m_imageHeader->setNumberOfRows(rect.height());
-   m_imageHeader->setNumberOfCols(rect.width());
-
-   ossimNitfImageBandV2_1 bandInfo;
-   for(idx = 0; idx < bands; ++idx)
-   {
-      std::ostringstream out;
-      
-      out << std::setfill('0')
-          << std::setw(2)
-          << idx;
-      
-      bandInfo.setBandRepresentation(out.str().c_str());
-      m_imageHeader->setBandInfo(idx, bandInfo);
-   }
-
-   ossim_uint64 imageHeaderStart = m_outputStream->tellp64();
-   m_imageHeader->writeStream(*m_outputStream);
-   ossim_uint64 imageHeaderEnd = m_outputStream->tellp64();
-   ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
-
-   // ossimIpt ul = rect.ul();
-
-   // Start the sequence through tiles:
-   theInputConnection->setToStartOfSequence();
-
-   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
-   ossim_uint64 tileNumber = 0;
-   ossimEndian endian;
-
-   // get the start to the first band of data block
-   //
-   ossim_uint64 streamOffset = m_outputStream->tellp64();
-   
-   // holds the total pixels to the next band
-
-   ossim_uint64 blockSizeInBytes = m_blockSize.x*m_blockSize.y*ossim::scalarSizeInBytes(data->getScalarType());
-   ossim_uint64 bandOffsetInBytes = (blockSizeInBytes*blocksHorizontal*blocksVertical);
-
-   bool needSwapping = endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN;
-   while(data.valid() && !needsAborting())
-   {
-      if(needSwapping)
-      {
-         switch(data->getScalarType())
-         {
-            case OSSIM_USHORT16:
-            case OSSIM_USHORT11:
-            {
-               endian.swap((ossim_uint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_SSHORT16:
-            {
-               endian.swap((ossim_sint16*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_FLOAT:
-            case OSSIM_NORMALIZED_FLOAT:
-            {
-               endian.swap((ossim_float32*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            case OSSIM_DOUBLE:
-            case OSSIM_NORMALIZED_DOUBLE:
-            {
-               endian.swap((ossim_float64*)data->getBuf(),
-                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
-               break;
-            }
-            default:
-               break;
-         }
-      }
-
-      for(idx = 0; idx < bands; ++idx)
-      {
-         m_outputStream->seekp(streamOffset+ // start of image stream
-                               tileNumber*blockSizeInBytes + // start of block for band separate output
-                               bandOffsetInBytes*idx, // which band offset is it
-                               ios::beg); 
-         
-         m_outputStream->write((char*)(data->getBuf(idx)),
-                               blockSizeInBytes);
-      }
-      ++tileNumber;
-      
-      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
-      
-      if(!needsAborting())
-      {
-         data = theInputConnection->getNextTile();
-      }
-   }
-
-   // Let's write our text header
-   if ( m_textHeader.valid() )
-   {
-      m_textHeader->writeStream(*m_outputStream); 
-      //Now write the text
-      m_outputStream->write((char*)(m_textEntry.c_str()), m_textEntry.length());
-   }   
-
-   ossim_uint64 pos = m_outputStream->tellp64();
-
-   setComplexityLevel(pos, m_fileHeader.get());
-
-   /*
-    * Need to change the way I compute file length and header length later
-    * We need to figure out a better way to compute.
-    */
-   m_fileHeader->setFileLength(static_cast<ossim_uint64>(pos));
-   m_fileHeader->setHeaderLength(headerLength);
-   m_outputStream->seekp(0, ios::beg);
-   imageInfoRecord.setSubheaderLength(imageHeaderSize);
-   m_fileHeader->replaceImageInfoRecord(0, imageInfoRecord);
-   m_fileHeader->writeStream(*m_outputStream);
-   
-   return true;
-}
-
-void ossimNitfWriter::addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag,
-   bool unique)
-{
-   addRegisteredTag(registeredTag, unique, 1, ossimString("IXSHD"));
-}
-
-void ossimNitfWriter::addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag,
-   bool unique, const ossim_uint32& ownerIndex, const ossimString& tagType)
-{
-   ossimNitfTagInformation tagInfo;
-   tagInfo.setTagData(registeredTag.get());
-   tagInfo.setTagType(tagType);
-
-   switch (ownerIndex)
-   {
-      case 0:
-      {
-         m_fileHeader->addTag(tagInfo, unique);
-         break;
-      }
-
-      case 1:
-      {
-         m_imageHeader->addTag(tagInfo, unique);
-         break;
-      }
-
-      default:
-      {
-         // Do nothing
-      }
-   }
-}
-
-bool ossimNitfWriter::addTextToNitf(std::string &inputText)
-{
-   // Initialize the m_textHeader
-   m_textEntry = inputText;
-   if ( m_textHeader.valid() == false )
-   {
-      // Only created if we need it.
-      m_textHeader = new ossimNitfTextHeaderV2_1;
-   }
-   return true;
-}
-void ossimNitfWriter::getTileSize(ossimIpt& size) const
-{
-   size = m_blockSize;
-}
-
-void ossimNitfWriter::setTileSize(const ossimIpt& tileSize)
-{
-   const ossim_int32 MIN_BLOCK_SIZE = 64;
-   if ( (tileSize.x % MIN_BLOCK_SIZE) || (tileSize.y % MIN_BLOCK_SIZE) )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfWriter::setTileSize ERROR:"
-            << "\nBlock size must be a multiple of " << MIN_BLOCK_SIZE
-            << "\nSize remains:  " << m_blockSize
-            << std::endl;
-      }
-   }
-   else
-   {
-      m_blockSize = tileSize;
-   }
-}
-
-#if 0
-void ossimNitfWriter::addStandardTags()
-{
-
-   if(!theInputConnection)
-   {
-      return;
-   }
-   
-   // commenting this out for now.  For some reason the pixels
-   // are off when I add this tag.  I checked the parsing and it
-   // appears to be the correct length???  So, I am not sure
-   // why we are off when reading the output back in.
-   //
-   // first lets do the projection tag.  I REALLY need to add
-   // parameter support soon or this tag is useless.
-   //
-   ossimKeywordlist kwl;
-   theInputConnection->getImageGeometry(kwl);
-   ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->createProjection(kwl);
-   ossimNitfNameConversionTables table;
-   ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj.get());
-   ossimNitfTagInformation tagInfo;
-   
-   if(mapProj)
-   {
-
-      if(!PTR_CAST(ossimUtmProjection, mapProj))
-      {
-         ossimRefPtr<ossimNitfProjectionParameterTag> parameterTag = new ossimNitfProjectionParameterTag;
-         
-         ossimString nitfCode = table.convertMapProjectionNameToNitfCode(proj->getClassName());
-         ossimString nitfName = table.convertNitfCodeToNitfProjectionName(nitfCode);
-         
-         parameterTag->setName(nitfName);
-         parameterTag->setCode(nitfCode);
-         parameterTag->setFalseX(mapProj->getFalseEasting());
-         parameterTag->setFalseY(mapProj->getFalseNorthing());
-         
-         tagInfo.setTagData(parameterTag.get());
-         m_imageHeader->addTag(tagInfo);
-      }
-   }
-}
-#endif
-
-bool ossimNitfWriter::saveState(ossimKeywordlist& kwl,
-                                const char* prefix) const
-{
-   return ossimNitfWriterBase::saveState(kwl, prefix);
-}
-
-bool ossimNitfWriter::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   return ossimNitfWriterBase::loadState(kwl, prefix);
-}
-
-ossimNitfImageHeaderV2_1 *ossimNitfWriter::getImageHeader()
-{
-   return m_imageHeader.get();
-}
-
-ossimNitfFileHeaderV2_1 *ossimNitfWriter::getFileHeader()
-{
-   return m_fileHeader.get();
-}
-
-void ossimNitfWriter::addDataExtensionSegment(const ossimNitfDataExtensionSegmentV2_1& des, bool allowTreOverflow)
-{
-   if (allowTreOverflow == false)
-   {
-      ossimRefPtr<ossimProperty> pId = des.getProperty(ossimNitfDataExtensionSegmentV2_1::DESID_KW);
-      if (pId == NULL || pId->valueToString() == "TRE_OVERFLOW" ||
-         pId->valueToString() == "REGISTERED EXTENSIONS" || pId->valueToString() == "CONTROLLED EXTENSIONS")
-      {
-         return;
-      }
-   }
-
-   m_dataExtensionSegments.push_back(des);
-}
-void ossimNitfWriter::takeOverflowTags(bool useFileHeader, bool userDefinedTags)
-{
-   ossimString itemIndex;
-   std::vector<ossimNitfTagInformation> overflowTags;
-   const ossim_uint32 potentialDesIndex = m_dataExtensionSegments.size() + 1;
-
-   if (useFileHeader)
-   {
-      m_fileHeader->takeOverflowTags(overflowTags, potentialDesIndex, userDefinedTags);
-      itemIndex = "0";
-   }
-   else
-   {
-      m_imageHeader->takeOverflowTags(overflowTags, potentialDesIndex, userDefinedTags);
-      itemIndex = "1";
-   }
-
-   if (overflowTags.empty() == false)
-   {
-      ossimNitfDataExtensionSegmentV2_1 des;
-      ossimRefPtr<ossimProperty> pDe =
-         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DE_KW, "DE");
-      des.setProperty(pDe);
-
-      ossimRefPtr<ossimProperty> pId =
-         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESID_KW, "TRE_OVERFLOW");
-      des.setProperty(pId);
-
-      ossimRefPtr<ossimProperty> pVersion =
-         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESVER_KW, "1");
-      des.setProperty(pVersion);
-
-      ossimRefPtr<ossimProperty> pOverflow =
-         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESOFLW_KW, overflowTags[0].getTagType());
-      des.setProperty(pOverflow);
-
-      ossimRefPtr<ossimProperty> pItem =
-         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESITEM_KW, itemIndex);
-      des.setProperty(pItem);
-
-      des.setTagList(overflowTags);
-      addDataExtensionSegment(des, true);
-   }
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimNitfWriterBase.cpp b/ossim/src/ossim/imaging/ossimNitfWriterBase.cpp
deleted file mode 100644
index ac0c6dd..0000000
--- a/ossim/src/ossim/imaging/ossimNitfWriterBase.cpp
+++ /dev/null
@@ -1,361 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: OSSIM Kakadu based nitf writer.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfWriterBase.cpp 2981 2011-10-10 21:14:02Z david.burken $
-
-#include <ossim/imaging/ossimNitfWriterBase.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageSourceSequencer.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimRpcSolver.h>
-#include <ossim/support_data/ossimNitfBlockaTag.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/support_data/ossimNitfTagInformation.h>
-
-static const char ENABLE_BLOCKA_KW[] = "enable_blocka_tag";
-static const char ENABLE_RPCB_KW[]   = "enable_rpcb_tag";
-
-RTTI_DEF1(ossimNitfWriterBase, "ossimNitfWriterBase", ossimImageFileWriter)
-   
-static ossimTrace traceDebug(ossimString("ossimNitfWriterBase:debug"));
-
-ossimNitfWriterBase::ossimNitfWriterBase()
-   : ossimImageFileWriter(),
-     theEnableRpcbTagFlag(false),
-     theEnableBlockaTagFlag(true)
-{
-}
-
-ossimNitfWriterBase::ossimNitfWriterBase(const ossimFilename& filename,
-                                         ossimImageSource* inputSource)
-   : ossimImageFileWriter(filename, inputSource, 0),
-     theEnableRpcbTagFlag(false),
-     theEnableBlockaTagFlag(true)
-{
-}
-
-ossimNitfWriterBase::~ossimNitfWriterBase()
-{
-}
-
-void ossimNitfWriterBase::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(property.valid())
-   {
-      ossimString name = property->getName();
-
-      if (name == ENABLE_RPCB_KW)
-      {
-         theEnableRpcbTagFlag = property->valueToString().toBool();
-      }
-      else if (name == ENABLE_BLOCKA_KW)
-      {
-         theEnableBlockaTagFlag = property->valueToString().toBool();
-      }
-      else
-      {
-         ossimImageFileWriter::setProperty(property);
-      }
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitfWriterBase::getProperty(
-   const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   
-   if(name == ENABLE_RPCB_KW)
-   {
-      result = new ossimBooleanProperty(name, theEnableRpcbTagFlag);
-   }   
-   else if(name == ENABLE_BLOCKA_KW)
-   {
-      result = new ossimBooleanProperty(name, theEnableBlockaTagFlag);
-   }   
-   else
-   {
-      result = ossimImageFileWriter::getProperty(name);
-   }
-
-   return result;
-}
-
-void ossimNitfWriterBase::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
-{
-   ossimImageFileWriter::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(ENABLE_BLOCKA_KW);
-   propertyNames.push_back(ENABLE_RPCB_KW);
-}
-
-
-bool ossimNitfWriterBase::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix) const
-{
-   kwl.add(prefix, ENABLE_RPCB_KW, theEnableRpcbTagFlag, true);
-   kwl.add(prefix, ENABLE_BLOCKA_KW, theEnableBlockaTagFlag, true);
-
-   return ossimImageFileWriter::saveState(kwl, prefix);
-}
-
-bool ossimNitfWriterBase::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   // Look for the rpcb enable flag keyword.
-   const char* lookup = kwl.find(prefix, ENABLE_RPCB_KW);
-   if(lookup)
-   {
-      ossimString os = lookup;
-      theEnableRpcbTagFlag = os.toBool();
-   }
-
-   // Look for the blocka enable flag keyword.
-   lookup = kwl.find(prefix, ENABLE_BLOCKA_KW);
-   if(lookup)
-   {
-      ossimString os = lookup;
-      theEnableBlockaTagFlag = os.toBool();
-   }
-
-   return ossimImageFileWriter::loadState(kwl, prefix);
-}
-
-void ossimNitfWriterBase::writeGeometry(ossimNitfImageHeaderV2_X* hdr,
-                                        ossimImageSourceSequencer* seq)
-{
-   if (hdr && seq)
-   {
-      ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();
-      ossimKeywordlist kwl;
-
-      if (geom.valid()&&geom->hasProjection())
-      {
-         // Get the requested bounding rectangles.
-         ossimIrect rect = seq->getBoundingRect();
-         
-         // See if it's a map projection; else, a sensor model.
-         ossimMapProjection* mapProj =
-            PTR_CAST(ossimMapProjection, geom->getProjection());
-         if (mapProj)
-         {
-            // Use map info to get the corners.
-            ossimMapProjectionInfo mapInfo(mapProj, rect);
-            mapInfo.setPixelType(OSSIM_PIXEL_IS_AREA);
-            
-            // See if it's utm.
-            ossimUtmProjection* utmProj = PTR_CAST(ossimUtmProjection,
-                                                   mapProj);
-            if(utmProj)
-            {
-               ossimDpt ul = mapInfo.ulEastingNorthingPt();
-               ossimDpt ur = mapInfo.urEastingNorthingPt();
-               ossimDpt lr = mapInfo.lrEastingNorthingPt();
-               ossimDpt ll = mapInfo.llEastingNorthingPt();
-               
-               if(utmProj->getHemisphere() == 'N')
-               {
-                  hdr->setUtmNorth(utmProj->getZone(), ul, ur, lr, ll);
-               }
-               else
-               {
-                  hdr->setUtmSouth(utmProj->getZone(), ul, ur, lr, ll);
-               }
-            }
-            else
-            {
-               ossimGpt ul = mapInfo.ulGroundPt();
-               ossimGpt ur = mapInfo.urGroundPt();
-               ossimGpt lr = mapInfo.lrGroundPt();
-               ossimGpt ll = mapInfo.llGroundPt();
-               hdr->setGeographicLocationDms(ul, ur, lr, ll);
-            }
-
-            if (theEnableBlockaTagFlag)
-            {
-               addBlockaTag(mapInfo, hdr);
-            }
-         }
-         
-         if (theEnableRpcbTagFlag)
-         {
-            addRpcbTag(rect, geom->getProjection(), hdr);
-         }
-         
-      } // matches:  if (proj.valid())
-      
-   } // matches: if (hdr && seq)
-}
-
-void ossimNitfWriterBase::addBlockaTag(ossimMapProjectionInfo& mapInfo,
-                                       ossimNitfImageHeaderV2_X* hdr)
-{
-   if (hdr)
-   {
-      // Capture the current pixel type.
-      ossimPixelType originalPixelType = mapInfo.getPixelType();
-      
-      // This tag wants corners as area:
-      mapInfo.setPixelType(OSSIM_PIXEL_IS_AREA);
-      
-      // Stuff the blocka tag which has six digit precision.
-      ossimNitfBlockaTag* blockaTag = new ossimNitfBlockaTag();
-      
-      // Set the block number.
-      blockaTag->setBlockInstance(1);
-      
-      // Set the number of lines.
-      blockaTag->setLLines(mapInfo.linesPerImage());
-      
-      // Set first row, first column.
-      blockaTag->setFrfcLoc(ossimDpt(mapInfo.ulGroundPt()));
-      
-      // Set first row, last column.
-      blockaTag->setFrlcLoc(ossimDpt(mapInfo.urGroundPt()));
-      
-      // Set last row, last column.
-      blockaTag->setLrlcLoc(ossimDpt(mapInfo.lrGroundPt()));
-      
-      // Set last row, first column.
-      blockaTag->setLrfcLoc(ossimDpt(mapInfo.llGroundPt()));
-      
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfWriterBase::addBlockaTag DEBUG:"
-            << "\nBLOCKA Tag:" << *((ossimObject*)(blockaTag))
-            << std::endl;
-      }
-      
-      // Add the tag to the header.
-      ossimRefPtr<ossimNitfRegisteredTag> blockaTagRp = blockaTag;
-      ossimNitfTagInformation blockaTagInfo(blockaTagRp);
-      hdr->addTag(blockaTagInfo);
-      
-      // Reset the pixel type to original value
-      mapInfo.setPixelType(originalPixelType);
-      
-   } // matches: if (hdr)
-}
-
-void ossimNitfWriterBase::addRpcbTag(const ossimIrect& rect,
-                                     ossimProjection* proj,
-                                     ossimNitfImageHeaderV2_X* hdr)
-{
-   if (proj && hdr)
-   {
-      bool useElevation = false;
-      
-      if (PTR_CAST(ossimMapProjection, proj))
-      {
-         // If we're already map projected turn the elevation off.
-         useElevation = false;
-      }
-      
-      // Make an rpc solver.
-      ossimRefPtr<ossimRpcSolver> rs = new ossimRpcSolver(useElevation);
-      
-      // Compute the coefficients.
-      rs->solveCoefficients(ossimDrect(rect), proj, 64, 64);
-      
-      // Add the tag.
-      ossimRefPtr<ossimNitfRegisteredTag> tag = rs->getNitfRpcBTag();
-      ossimNitfTagInformation tagInfo(tag);
-      hdr->addTag(tagInfo);
-      
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfWriterBase::addRpcbTag DEBUG:"
-            << "\nRPCB Tag:" << *((ossimObject*)(tag.get()))
-            << "\nProjection:\n";
-         
-         proj->print(ossimNotify(ossimNotifyLevel_DEBUG));
-         
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "\nRect: " << rect << std::endl;
-      }
-      
-   } // matches: if (proj && hdr)
-}
-
-void ossimNitfWriterBase::setComplexityLevel(std::streamoff endPosition,
-                                             ossimNitfFileHeaderV2_X* hdr)
-{
-   if (hdr)
-   {
-      //---
-      // See MIL-STD-2500C, Table A-10:
-      //
-      // Lots of rules here, but for now we will key off of file size.
-      //---
-      const std::streamoff MB   = 1024 * 1024;
-      const std::streamoff MB50 = 50   * MB;
-      const std::streamoff GIG  = 1000 * MB;
-      const std::streamoff GIG2 = 2    * GIG;
-      
-      ossimString complexity = "03"; // Less than 50 mb.
-      
-      if ( (endPosition >= MB50) && (endPosition < GIG) )
-      {
-         complexity = "05";
-      }
-      else if ( (endPosition >= GIG) && (endPosition < GIG2) )
-      {
-         complexity = "06";
-      }
-      else if (endPosition >= GIG2)
-      {
-         complexity = "07";
-      }
-      
-      hdr->setComplexityLevel(complexity);
-   }
-}
-
-ossimString ossimNitfWriterBase::getExtension() const
-{
-   return ossimString("ntf");
-}
-
-void ossimNitfWriterBase::initializeDefaultsFromConfigFile( ossimNitfFileHeaderV2_X* fileHdr,
-                                                            ossimNitfImageHeaderV2_X* imgHdr )
-{
-   // Look in prefs for site configuration file:
-   const char* lookup = ossimPreferences::instance()->
-      findPreference("nitf_writer.site_configuration_file");
-   if ( lookup && fileHdr && imgHdr )
-   {
-      ossimKeywordlist kwl;
-      if ( kwl.addFile( lookup ) )
-      {
-         fileHdr->loadState( kwl, "nitf.file." );
-         imgHdr->loadState( kwl, "nitf.image." );
-      }
-   }
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimNormalizedRemapTable.cpp b/ossim/src/ossim/imaging/ossimNormalizedRemapTable.cpp
deleted file mode 100644
index 9855e7b..0000000
--- a/ossim/src/ossim/imaging/ossimNormalizedRemapTable.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for NormalizedRemapTable.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedRemapTable.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimNormalizedRemapTable.h>
-
-ossimNormalizedRemapTable::ossimNormalizedRemapTable()
-{
-}
-
-ossimNormalizedRemapTable::~ossimNormalizedRemapTable()
-{
-}
-
-// Private copy constructor.
-ossimNormalizedRemapTable::ossimNormalizedRemapTable(
-   const ossimNormalizedRemapTable&)
-{}
-
-// Private assignment operator.
-ossimNormalizedRemapTable& ossimNormalizedRemapTable::operator=(
-   const ossimNormalizedRemapTable&)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimNormalizedS16RemapTable.cpp b/ossim/src/ossim/imaging/ossimNormalizedS16RemapTable.cpp
deleted file mode 100644
index 7989fc9..0000000
--- a/ossim/src/ossim/imaging/ossimNormalizedS16RemapTable.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class definition for ossimNormalizedS16RemapTable.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedS16RemapTable.cpp 9963 2006-11-28 21:11:01Z gpotts $
-
-#include <ossim/imaging/ossimNormalizedS16RemapTable.h>
-
-ossim_float64 ossimNormalizedS16RemapTable::theTable[TABLE_ENTRIES];
-bool          ossimNormalizedS16RemapTable::theTableIsInitialized = false;
-
-ossimNormalizedS16RemapTable::ossimNormalizedS16RemapTable()
-   : ossimNormalizedRemapTable()
-{
-   if (!theTableIsInitialized)
-   {
-      const ossim_int32   ENTRIES     = getEntries();
-      const ossim_float64 DENOMINATOR = getNormalizer();
-      
-      //---
-      // Initialize the remap table.
-      //
-      // Specialized for elevation, make -32768 and -32767 map to 0 since
-      // DTED NULL is -32767.
-      //
-      // NOTE: Zero will always remap back to -32768 with this hack.  This
-      // could cause issues on writers that use pixFromNorm(). (drb)
-      //---
-      theTable[0] = 0.0; // Index zero always for null.
-      theTable[1] = 0.0; // Specialized for DTED.
-
-      for (ossim_int32 i = 2; i < ENTRIES; ++i)
-      {
-         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
-      }
-
-      theTableIsInitialized = true;
-   }
-}
-
-ossimNormalizedS16RemapTable::~ossimNormalizedS16RemapTable()
-{}
-
diff --git a/ossim/src/ossim/imaging/ossimNormalizedU11RemapTable.cpp b/ossim/src/ossim/imaging/ossimNormalizedU11RemapTable.cpp
deleted file mode 100644
index 5e126ae..0000000
--- a/ossim/src/ossim/imaging/ossimNormalizedU11RemapTable.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class definition for ossimNormalizedU11RemapTable.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedU11RemapTable.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimNormalizedU11RemapTable.h>
-
-ossim_float64 ossimNormalizedU11RemapTable::theTable[TABLE_ENTRIES];
-bool          ossimNormalizedU11RemapTable::theTableIsInitialized = false;
-
-ossimNormalizedU11RemapTable::ossimNormalizedU11RemapTable()
-   : ossimNormalizedRemapTable()
-{
-   if (!theTableIsInitialized)
-   {
-      const ossim_int32   ENTRIES     = getEntries();
-      const ossim_float64 DENOMINATOR = getNormalizer();
-      
-      //---
-      // Initialize the remap table.
-      //---
-      theTable[0] = 0.0; // Index zero always for null.
-      for (ossim_int32 i = 1; i < ENTRIES; ++i)
-      {
-         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
-      }
-
-      theTableIsInitialized = true;
-   }
-}
-
-ossimNormalizedU11RemapTable::~ossimNormalizedU11RemapTable()
-{}
-
diff --git a/ossim/src/ossim/imaging/ossimNormalizedU16RemapTable.cpp b/ossim/src/ossim/imaging/ossimNormalizedU16RemapTable.cpp
deleted file mode 100644
index 2c2f7a6..0000000
--- a/ossim/src/ossim/imaging/ossimNormalizedU16RemapTable.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class definition for ossimNormalizedU16RemapTable.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedU16RemapTable.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimNormalizedU16RemapTable.h>
-
-ossim_float64 ossimNormalizedU16RemapTable::theTable[TABLE_ENTRIES];
-bool          ossimNormalizedU16RemapTable::theTableIsInitialized = false;
-
-
-ossimNormalizedU16RemapTable::ossimNormalizedU16RemapTable()
-   : ossimNormalizedRemapTable()
-{
-   if (!theTableIsInitialized)
-   {
-      const ossim_int32   ENTRIES     = getEntries();
-      const ossim_float64 DENOMINATOR = getNormalizer();
-      
-      //---
-      // Initialize the remap table.
-      //---
-      theTable[0] = 0.0; // Index zero always for null.
-      for (ossim_int32 i = 1; i < ENTRIES; ++i)
-      {
-         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
-      }
-
-      theTableIsInitialized = true;
-   }
-}
-
-ossimNormalizedU16RemapTable::~ossimNormalizedU16RemapTable()
-{}
-
-
-
diff --git a/ossim/src/ossim/imaging/ossimNormalizedU8RemapTable.cpp b/ossim/src/ossim/imaging/ossimNormalizedU8RemapTable.cpp
deleted file mode 100644
index d956394..0000000
--- a/ossim/src/ossim/imaging/ossimNormalizedU8RemapTable.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-//
-// Contains class definition for ossimNormalizedU8RemapTable.
-// 
-//*******************************************************************
-//  $Id: ossimNormalizedU8RemapTable.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimNormalizedU8RemapTable.h>
-
-ossim_float64 ossimNormalizedU8RemapTable::theTable[TABLE_ENTRIES];
-bool          ossimNormalizedU8RemapTable::theTableIsInitialized = false;
-
-ossimNormalizedU8RemapTable::ossimNormalizedU8RemapTable()
-   : ossimNormalizedRemapTable()
-{
-   if (!theTableIsInitialized)
-   {
-      const ossim_int32   ENTRIES     = getEntries();
-      const ossim_float64 DENOMINATOR = getNormalizer();
-      
-      //---
-      // Initialize the remap table.
-      //---
-      theTable[0] = 0.0; // Index zero always for null.
-      for (ossim_int32 i = 1; i < ENTRIES; ++i)
-      {
-         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
-      }
-
-      theTableIsInitialized = true;
-   }
-}
-
-ossimNormalizedU8RemapTable::~ossimNormalizedU8RemapTable()
-{}
-
-
diff --git a/ossim/src/ossim/imaging/ossimNullPixelFlip.cpp b/ossim/src/ossim/imaging/ossimNullPixelFlip.cpp
deleted file mode 100644
index ecfe2b6..0000000
--- a/ossim/src/ossim/imaging/ossimNullPixelFlip.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// 
-//*******************************************************************
-//  $Id$
-
-#include <ossim/imaging/ossimNullPixelFlip.h>
-#include <ossim/imaging/ossimImageData.h>
-
-RTTI_DEF1(ossimNullPixelFlip, "ossimNullPixelFlip", ossimImageSourceFilter);
-ossimNullPixelFlip::ossimNullPixelFlip()
-:m_clipMode(ClipMode_BOUNDING_RECT),
-m_replacementType(ReplacementType_MINPIX)
-{
-}
-
-void ossimNullPixelFlip::initialize()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimNullPixelFlip::getTile(const ossimIrect& tile_rect,
-                                                        ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> result = ossimImageSourceFilter::getTile(tile_rect, resLevel);
-   if(!isSourceEnabled()||!result.valid())
-   {
-      return result.get();
-   }
-   ossimDataObjectStatus status =  result->getDataObjectStatus();
-   
-   if((status == OSSIM_FULL)||
-      (status == OSSIM_NULL))
-   {
-      return result.get();
-   }
-   // Call the appropriate load method.
-   switch (result->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         flipPixels(ossim_uint8(0), result.get(), resLevel);
-         break;
-      }
-         
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         flipPixels(ossim_uint16(0), result.get(), resLevel);
-         break;
-      }
-         
-      case OSSIM_SSHORT16:
-      {
-         flipPixels(ossim_sint16(0), result.get(), resLevel);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         flipPixels(ossim_uint32(0), result.get(), resLevel);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         flipPixels(ossim_sint32(0), result.get(), resLevel);
-         break;
-      }
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         flipPixels(ossim_float32(0), result.get(), resLevel);
-         break;
-      }
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         flipPixels(ossim_float64(0), result.get(), resLevel);
-         break;
-      }
-         
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-//         ossimNotify(ossimNotifyLevel_WARN)
-//         << "ossimPixelFlipper::getTile Unsupported scalar type!" << endl;
-         break;
-      }
-   }
-   
-   return result;
-}
-
-template <class T>
-void ossimNullPixelFlip::flipPixels(T /* dummy */,
-                                   ossimImageData* inputTile,
-                                   ossim_uint32 resLevel)
-{
-   if (!inputTile) return;
-   ossimDataObjectStatus status =  inputTile->getDataObjectStatus();
-   ossimIrect rect = inputTile->getImageRectangle();
-   ossimIrect imageBounds = getBoundingRect(resLevel);
-   ossimIrect clipRect;
-   if(!rect.intersects(imageBounds))
-   {
-      return;
-   }
-   clipRect = rect.clipToRect(imageBounds);
-   if((status == OSSIM_EMPTY)||
-      (status == OSSIM_PARTIAL))
-   {
-      if(!rect.completely_within(imageBounds))
-      {
-         ossim_uint32 bands = inputTile->getNumberOfBands();
-         ossimIpt origin = clipRect.ul() - rect.ul();
-         ossim_uint32 bandIdx = 0;
-         ossim_uint32 inputW = inputTile->getWidth();
-         ossim_uint32 originOffset = origin.y*inputW + origin.x;
-         ossim_uint32 w = clipRect.width();
-         ossim_uint32 h = clipRect.height();
-         ossim_uint32 x = 0;
-         ossim_uint32 y = 0;
-         for(bandIdx = 0; bandIdx < bands; ++bandIdx)
-         {
-            T* bandPtr = static_cast<T*>(inputTile->getBuf(bandIdx)) + originOffset;
-            T  nullValue = static_cast<T>(inputTile->getNullPix(bandIdx));
-            T  replaceValue = (m_replacementType==ReplacementType_MINPIX?static_cast<T>(inputTile->getMinPix(bandIdx)):
-                               static_cast<T>(inputTile->getMaxPix(bandIdx)));
-            for(y = 0; y < h; ++y)
-            {
-               for(x = 0; x < w; ++x)
-               {
-                  if(bandPtr[x] == nullValue)
-                  {
-                     bandPtr[x] = replaceValue;
-                  }
-               }
-               bandPtr += inputW;
-            }
-         }
-      }
-      else
-      {
-         ossim_uint32 bands = inputTile->getNumberOfBands();
-         ossim_uint32 bandIdx = 0;
-         ossim_uint32 size = inputTile->getWidth()*inputTile->getHeight();
-         for(bandIdx = 0; bandIdx < bands; ++bandIdx)
-         {
-            T* bandPtr = static_cast<T*>(inputTile->getBuf(bandIdx));
-            T  nullValue = static_cast<T>(inputTile->getNullPix(bandIdx));
-            T  replaceValue = (m_replacementType==ReplacementType_MINPIX?static_cast<T>(inputTile->getMinPix(bandIdx)):
-                               static_cast<T>(inputTile->getMaxPix(bandIdx)));
-                               
-            ossim_uint32 idx = 0;
-            for(idx = 0; idx < size;++idx)
-            {
-               if((*bandPtr) == nullValue)
-               {
-                  (*bandPtr) = replaceValue;
-               }
-               ++bandPtr;
-            }
-         }
-         inputTile->setDataObjectStatus(OSSIM_FULL);
-      }
-   }
-}
diff --git a/ossim/src/ossim/imaging/ossimOverviewSequencer.cpp b/ossim/src/ossim/imaging/ossimOverviewSequencer.cpp
deleted file mode 100644
index 33a4999..0000000
--- a/ossim/src/ossim/imaging/ossimOverviewSequencer.cpp
+++ /dev/null
@@ -1,1049 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Sequencer for building overview files.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimOverviewSequencer.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimOverviewSequencer.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimMultiResLevelHistogram.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageMetaData.h>
-#include <ossim/parallel/ossimMpi.h>
-
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimOverviewSequencer.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-
-static ossimTrace traceDebug("ossimOverviewSequencer:debug");
-
-ossimOverviewSequencer::ossimOverviewSequencer()
-   :
-   ossimReferenced(),
-   ossimErrorStatusInterface(),
-   m_imageHandler(0),
-   m_maskWriter(0),
-   m_maskFilter(0),
-   m_tile(0),
-   m_areaOfInterest(),
-   m_tileSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT),
-   m_numberOfTilesHorizontal(0),
-   m_numberOfTilesVertical(0),
-   m_currentTileNumber(0),
-   m_sourceResLevel(0),
-   m_dirtyFlag(true),
-   m_decimationFactor(2),
-   m_resampleType(ossimFilterResampler::ossimFilterResampler_BOX),
-   m_histogram(0),
-   m_histoMode(OSSIM_HISTO_MODE_UNKNOWN),
-   m_histoTileIndex(1),
-   m_scanForMinMax(false),
-   m_scanForMinMaxNull(false),
-   m_minValues(0),
-   m_maxValues(0),
-   m_nulValues(0)
-{
-   m_areaOfInterest.makeNan();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimOverviewSequencer::ossimOverviewSequencer entered..."
-         << "\nmpi rank:  "<< ossimMpi::instance()->getRank()
-         << std::endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID
-                                         << std::endl;
-#endif
-   }
-}
-
-ossimOverviewSequencer::~ossimOverviewSequencer()
-{
-   m_imageHandler = 0;
-   m_maskFilter   = 0;
-   m_maskWriter   = 0;
-   m_tile         = 0;
-   m_histogram    = 0;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimOverviewSequencer::~ossimOverviewSequencer entered..."
-         << "\nmpi rank:  " << ossimMpi::instance()->getRank()
-         << std::endl;
-   }
-}
-
-ossim_uint32 ossimOverviewSequencer::getNumberOfTiles() const
-{
-   return (m_numberOfTilesHorizontal*m_numberOfTilesVertical);
-}
-
-ossim_uint32 ossimOverviewSequencer::getNumberOfTilesHorizontal()const
-{
-   return m_numberOfTilesHorizontal;
-}
-
-ossim_uint32 ossimOverviewSequencer::getNumberOfTilesVertical()const
-{
-   return m_numberOfTilesVertical;
-}
-
-void ossimOverviewSequencer::getOutputImageRectangle(ossimIrect& rect) const
-{
-   if (m_areaOfInterest.hasNans())
-   {
-      rect.makeNan(); // not initialized...
-   }
-   else
-   {
-      ossim_int32 width  = m_areaOfInterest.width()  / m_decimationFactor;
-      ossim_int32 height = m_areaOfInterest.height() / m_decimationFactor;
-
-      //---
-      // NOTE:
-      // This will add a sample or line if there is a remainder like:
-      // 1025 / 2 = 512 will then become 513.  It will be up to the resample
-      // tile method to fill the extra sample correctly.
-      //---
-      if (m_areaOfInterest.width() % m_decimationFactor)
-      {
-         ++width;
-      }
-      if (m_areaOfInterest.height() % m_decimationFactor)
-      {
-         ++height;
-      }
-      
-      rect = ossimIrect(0, 0, width-1, height-1);
-   }
-}
-
-void ossimOverviewSequencer::setImageHandler(ossimImageHandler* input)
-{
-   m_imageHandler = input;
-   m_areaOfInterest.makeNan();
-   m_dirtyFlag = true;
-
-   if (m_maskWriter.valid())
-      m_maskWriter->connectMyInputTo(m_imageHandler.get());
-}
-
-void ossimOverviewSequencer::setSourceLevel(ossim_uint32 level)
-{
-   m_sourceResLevel = level;
-   m_areaOfInterest.makeNan();
-   m_dirtyFlag = true;
-}
-
-ossimHistogramMode ossimOverviewSequencer::getHistogramMode() const
-{
-   return m_histoMode;
-}
-
-void ossimOverviewSequencer::setHistogramMode(ossimHistogramMode mode)
-{
-   m_histoMode = mode;
-   m_dirtyFlag = true;
-}
-
-void ossimOverviewSequencer::writeHistogram()
-{
-   if ( m_histogram.valid() && m_imageHandler.valid() )
-   {
-      writeHistogram( m_imageHandler->getFilenameWithThisExtension("his") );
-   }
-}
-
-void ossimOverviewSequencer::writeHistogram(const ossimFilename& file)
-{
-   if ( m_histogram.valid() )
-   {
-      ossimRefPtr<ossimMultiResLevelHistogram> histo = new ossimMultiResLevelHistogram;
-      histo->addHistogram( m_histogram.get() );
-      ossimKeywordlist kwl;
-      histo->saveState(kwl);
-      kwl.write(file.c_str());
-   }
-}
-
-void ossimOverviewSequencer::initialize()
-{
-   if ( m_dirtyFlag == false )
-   {
-      return; // Already initialized.
-   }
-   
-   if ( !m_imageHandler )
-   {
-      return;
-   }
-
-   ossimImageSource* imageSource = m_imageHandler.get();
-   if (m_maskFilter.valid())
-      imageSource = m_maskFilter.get();
-
-   // Check the area of interest and set from image if needed.
-   if ( m_areaOfInterest.hasNans() )
-   {
-      m_areaOfInterest = m_imageHandler->getImageRectangle(m_sourceResLevel);
-   }
-
-   // Check the tile size and set from image if needed.
-   if ( m_tileSize.hasNans() )
-   {
-      m_tileSize.x = imageSource->getTileWidth();
-      m_tileSize.y = imageSource->getTileHeight();
-   }
-
-   // Update m_numberOfTilesHorizontal and m_numberOfTilesVertical.
-   updateTileDimensions();
-
-   // Start on first tile.
-   m_currentTileNumber = 0;
-
-   // Use this factory constructor as it copies the min/max/nulls from the image handler.
-   m_tile = ossimImageDataFactory::instance()->
-      create( 0, imageSource->getNumberOfOutputBands(), imageSource);
-   
-   if(m_tile.valid())
-   {
-      // Set the width and height.
-      m_tile->setWidthHeight(static_cast<ossim_uint32>(m_tileSize.x),
-                             static_cast<ossim_uint32>(m_tileSize.y) );
-      // Initialize tile buffer.
-      m_tile->initialize();
-   }
-
-   if (m_histoMode != OSSIM_HISTO_MODE_UNKNOWN)
-   {
-      m_histogram = new ossimMultiBandHistogram;
-      
-      m_histogram->create(imageSource);
-
-      if (m_histoMode == OSSIM_HISTO_MODE_NORMAL)
-      {
-         m_histoTileIndex = 1; // Sample every tile.
-      }
-      else
-      {
-         const ossim_float64 PIXEL_TO_SAMPLE = 100.0 * 256.0 * 256.0; // 100 256x256 tiles.
-         ossim_float64 pixels = m_tileSize.x * m_tileSize.y * getNumberOfTiles();
-
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "pixels: " << pixels << "\n"
-               << "PIXEL_TO_SAMPLE: " << PIXEL_TO_SAMPLE << "\n";
-         }
-         
-         if (pixels > PIXEL_TO_SAMPLE)
-         {
-            m_histoTileIndex = ossim::round<ossim_uint32>(pixels/PIXEL_TO_SAMPLE);
-         }
-         else
-         {
-            m_histoTileIndex = 1; // Sample every tile.
-         }
-      }
-   }
-   else
-   {
-      m_histogram = 0;
-   }
-
-
-   if ( m_scanForMinMax || m_scanForMinMaxNull )
-   {
-      //---
-      // The methods ossimImageData::computeMinMaxNullPix and computeMinMaxPix
-      // will resize and set min to max, max to min and null to max if the arrays passed in
-      // are empty.
-      //---
-      clearMinMaxNullArrays();
-   }
-   
-   m_dirtyFlag = false;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "aoi:                      " << m_areaOfInterest
-         << "\ntile size:              " << m_tileSize
-         << "\ntiles wide:             " << m_numberOfTilesHorizontal
-         << "\ntiles high:             " << m_numberOfTilesVertical
-         << "\nsource rlevel:          " << m_sourceResLevel
-         << "\ndecimation factor:      " << m_decimationFactor
-         << "\nresamp type:            " << m_resampleType
-         << "\nscan for min max:       " << (m_scanForMinMax?"true\n":"false\n")
-         << "\nscan for min, max null: " << (m_scanForMinMaxNull?"true\n":"false\n")
-         << "\nhisto mode:             " << m_histoMode << "\n";
-      if (m_histoMode != OSSIM_HISTO_MODE_UNKNOWN)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Sampling every " << m_histoTileIndex << " tile(s) for histogram.\n";
-      }
-   }
-}
-
-void ossimOverviewSequencer::setToStartOfSequence()
-{
-   m_currentTileNumber = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimOverviewSequencer::getNextTile()
-{
-   if ( m_dirtyFlag )
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   // Get the rectangle to grab from the image.
-   ossimIrect inputRect;
-   getInputTileRectangle(inputRect);
-
-   // Get the output rectangle.
-   ossimIrect outputRect;
-   getOutputTileRectangle(outputRect);
-
-   // Capture the output rectangle.
-   m_tile->setImageRectangle(outputRect);
-
-   // Start with a blank tile.
-   m_tile->makeBlank();
-
-   // Grab the input tile.
-   ossimRefPtr<ossimImageData> inputTile;
-   if (m_maskFilter.valid())
-   {
-      inputTile = m_maskFilter->getTile(inputRect, m_sourceResLevel);
-
-      // Check for errors reading tile and set our error status for callers.
-      if ( m_maskFilter->hasError() )
-      {
-         setErrorStatus();
-      }
-   }
-   else
-   {
-      inputTile = m_imageHandler->getTile(inputRect, m_sourceResLevel);
-
-      // Check for errors reading tile and set our error status for callers.
-      if ( m_imageHandler->hasError() )
-      {
-         setErrorStatus();
-      }
-   }
-
-   if ( hasError() )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimOverviewSequencer::getNextTile  ERROR:"
-         << "\nError set reading tile:  " << m_currentTileNumber << std::endl;
-      if ( inputTile.valid() )
-      {
-         inputTile->makeBlank();
-      }
-   }
-   else if ( inputTile.valid() )
-   {
-      if ( m_scanForMinMaxNull )
-      {
-         inputTile->computeMinMaxNulPix(m_minValues, m_maxValues, m_nulValues);
-      }
-      else if ( m_scanForMinMax )
-      {
-         inputTile->computeMinMaxPix(m_minValues, m_maxValues);
-      }
-      
-      if ( ( m_histoMode != OSSIM_HISTO_MODE_UNKNOWN ) &&
-           ( (m_currentTileNumber % m_histoTileIndex) == 0 ) )
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimOverviewSequencer::getNextTile DEBUG:"
-               << "\npopulating histogram for tile: " << m_currentTileNumber
-               << "\n";
-         }
-         inputTile->populateHistogram(m_histogram);
-      }
-      
-      if ( (inputTile->getDataObjectStatus() == OSSIM_PARTIAL) ||
-           (inputTile->getDataObjectStatus() == OSSIM_FULL ) )
-      {
-         // Resample the tile.
-         resampleTile(inputTile.get());
-         m_tile->validate();
-         
-         // Scan the resampled pixels for bogus values to be masked out (if masking enabled)
-         if (m_maskWriter.valid())
-            m_maskWriter->generateMask(m_tile, m_sourceResLevel+1);
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimOverviewSequencer::getNextTile DEBUG:"
-         << "\nRequest failed for input rect: " << inputRect
-         << "\nRes level:  " << m_sourceResLevel << std::endl;
-   }
-
-   // Increment the tile index.
-   ++m_currentTileNumber;
-
-   return m_tile;
-}
-
-void ossimOverviewSequencer::slaveProcessTiles()
-{
-}
-
-bool ossimOverviewSequencer::isMaster() const
-{
-   return true;
-}
-
-ossimIpt ossimOverviewSequencer::getTileSize() const
-{
-   return m_tileSize;
-}
-
-void ossimOverviewSequencer::setTileSize(const ossimIpt& tileSize)
-{
-   m_tileSize = tileSize;
-   updateTileDimensions();
-   m_dirtyFlag = true;
-}
-
-void ossimOverviewSequencer::setResampleType(
-   ossimFilterResampler::ossimFilterResamplerType resampleType)
-{
-   m_resampleType = resampleType;
-}
-
-void ossimOverviewSequencer::setScanForMinMax(bool flag)
-{
-   m_scanForMinMax  = flag;
-}
-
-bool ossimOverviewSequencer::getScanForMinMax() const
-{
-   return m_scanForMinMax;
-}
-
-void ossimOverviewSequencer::setScanForMinMaxNull(bool flag)
-{
-   m_scanForMinMaxNull = flag;
-}
-
-bool ossimOverviewSequencer::getScanForMinMaxNull() const
-{
-   return m_scanForMinMaxNull;
-}
-
-void ossimOverviewSequencer::clearMinMaxNullArrays()
-{
-   m_minValues.clear();
-   m_maxValues.clear();
-   m_nulValues.clear();
-}
-
-bool ossimOverviewSequencer::writeOmdFile(const std::string& file)
-{
-   static const char M[] = "ossimOverviewSequencer::writeOmdFile";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\nfile: " << file << endl;
-   }
-
-   //---
-   // This method writes an omd file to disk.  Typically called after sequencing trough tile that
-   // were scanned for min, max, and potentially null values.
-   // Since this can be called without a scan there is extra logic in here to initialize values
-   // if so.  Also there are sanity checks for cases where there is no null value, i.e. a
-   // full tile, in which case assumptions have to be made...
-   //---
-   
-   bool result = false;
-   if ( file.size() && m_imageHandler.valid() )
-   {
-      const ossim_uint32 BANDS = m_imageHandler->getNumberOfInputBands();
-      const ossimScalarType SCALAR = m_imageHandler->getOutputScalarType();
-      const ossim_float64 DEFAULT_NULL = ossim::defaultNull(SCALAR);
-
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Original array values:\n";
-         std::vector<ossim_float64>::const_iterator i = m_minValues.begin();
-         ossim_int32 band = 0;
-         while ( i < m_minValues.end() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "min[" << band++ << "]: " << *i << "\n";
-            ++i;
-         }
-         i = m_maxValues.begin();
-         band = 0;
-         while ( i < m_maxValues.end() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "max[" << band++ << "]: " << *i << "\n";
-            ++i;
-         }
-         i = m_nulValues.begin();
-         band = 0;
-         while ( i < m_nulValues.end() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "nul[" << band++ << "]: " << *i << "\n";
-            ++i;
-         }
-      }
-      
-      if ( (m_scanForMinMax == true) || (m_nulValues.size() !=  BANDS) )
-      {
-         // Only scanned for min and max so set the null.
-         if (m_nulValues.size() !=  BANDS)
-         {
-            m_nulValues.resize(BANDS);
-         }
-         for (ossim_uint32 band = 0; band < BANDS; ++band)
-         {
-            m_nulValues[band] = m_imageHandler->getNullPixelValue(band);
-         }
-      }
-      else if ( m_scanForMinMaxNull == true )
-      {
-         //---
-         // The arrays (sizes) should be set if we did the scan.
-         // Note that scanning for null only works if there IS a null in the image; hence, the
-         // extra sanity checks as if there are no null then the null gets set to the real min.
-         //
-         // This is very dangerous code as it makes assumptions (drb)...
-         //---
-         if ( (m_minValues.size() ==  BANDS) &&
-              (m_maxValues.size() ==  BANDS) &&
-              (m_nulValues.size() ==  BANDS) )
-         {
-            switch(SCALAR)
-            {
-               case OSSIM_UINT8:
-               case OSSIM_SINT8:                  
-               case OSSIM_UINT16:
-               case OSSIM_USHORT11:
-               case OSSIM_UINT32:
-               {
-                  // All of these should have a null of 0.
-                  for (ossim_uint32 band = 0; band < BANDS; ++band)
-                  {
-                     if ( m_nulValues[band] > DEFAULT_NULL )
-                     {
-                        if ( m_nulValues[band] < m_minValues[band] )
-                        {
-                           m_minValues[band] = m_nulValues[band];
-                        }
-                        m_nulValues[band] = DEFAULT_NULL;
-                     }
-                  }
-                  break;
-               }
-               case OSSIM_SINT16:
-               {
-                  for (ossim_uint32 band = 0; band < BANDS; ++band)
-                  {
-                     if ( ( m_nulValues[band] != DEFAULT_NULL ) && // -32768
-                          ( m_nulValues[band] != -32767.0 )    &&
-                          ( m_nulValues[band] != -32766.0 )    &&
-                          ( m_nulValues[band] != -9999.0 ) )
-                     {
-                        if ( ( m_nulValues[band] > -9999.0 ) &&
-                             ( m_nulValues[band] < m_minValues[band] ) )
-                        {
-                           m_minValues[band] = m_nulValues[band];
-                        }
-                        m_nulValues[band] = DEFAULT_NULL;
-                     }
-                  }
-                  break;
-               }
-               case OSSIM_SINT32:
-               {
-                  for (ossim_uint32 band = 0; band < BANDS; ++band)
-                  {
-                     if ( ( m_nulValues[band] != DEFAULT_NULL ) &&
-                          ( m_nulValues[band] != -32768.0 ) &&        // Common null
-                          ( m_nulValues[band] != -32767.0 ) &&       // The other common null.
-                          ( m_nulValues[band] != -32766.0 ) &&
-                          ( m_nulValues[band] != -9999.0  ) &&
-                          ( m_nulValues[band] != -99999.0 ) )
-                     {
-                        if ( ( m_nulValues[band] > -9999.0 ) &&
-                             ( m_nulValues[band] < m_minValues[band] ) )
-                        {
-                           m_minValues[band] = m_nulValues[band];
-                        }
-                        m_nulValues[band] = DEFAULT_NULL;
-                     } 
-                  }
-                  break;
-               }
-               case OSSIM_FLOAT32:
-               case OSSIM_FLOAT64: 
-               {
-                  for (ossim_uint32 band = 0; band < BANDS; ++band)
-                  {
-                     if ( ( m_nulValues[band] != DEFAULT_NULL ) &&
-                          ( m_nulValues[band] != -32768.0 ) &&  
-                          ( m_nulValues[band] != -32767.0 ) && 
-                          ( m_nulValues[band] != -32766.0 ) &&
-                          ( m_nulValues[band] != -9999.0  ) &&
-                          ( m_nulValues[band] != -99999.0 ) )
-                     {
-                        if ( ( m_nulValues[band] > -9999 ) &&
-                             ( m_nulValues[band] < m_minValues[band] ) )
-                        {
-                           m_minValues[band] = m_nulValues[band];
-                        }
-                        m_nulValues[band] = DEFAULT_NULL;
-                     } 
-                  }
-                  break;
-               }
-               case OSSIM_NORMALIZED_FLOAT:
-               case OSSIM_NORMALIZED_DOUBLE:
-               {
-                  for (ossim_uint32 band = 0; band < BANDS; ++band)
-                  {
-                     if ( ( m_nulValues[band] != DEFAULT_NULL ) &&
-                          ( m_nulValues[band] > 0.0) )
-                     {
-                        if ( m_nulValues[band] < m_minValues[band] )
-                        {
-                           m_minValues[band] = m_nulValues[band];
-                        }
-                        m_nulValues[band] = 0.0;
-                     }
-                  }
-                  break;
-               }
-               case OSSIM_SCALAR_UNKNOWN:
-               default:
-               {
-                  if(traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_DEBUG)
-                        << __FILE__ << ":" << __LINE__
-                        << " " << M << "\nUnhandled scalar type:  " << SCALAR << std::endl;
-                  }
-                  break;
-               }
-
-            } // End: switch(SCALAR)
-            
-         } // Matches: if ( (m_minValues.size() ==  BANDS) &&...
-         else
-         {
-            // ERROR!
-            ossimNotify(ossimNotifyLevel_WARN)
-               << M << "ERROR:\nMin, max and null array sizes bad! No omd file will be written."
-               << std::endl;
-         }
-         
-      } // Matches: else if ( m_scanForMinMaxNull == true )
-      else
-      {
-         // Get the values from the image handler.
-         if (m_minValues.size() !=  BANDS)
-         {
-            m_minValues.resize(BANDS);
-            for (ossim_uint32 band = 0; band < BANDS; ++band)
-            {
-               m_minValues[band] = m_imageHandler->getMinPixelValue(band);
-            }
-         }
-         if (m_maxValues.size() !=  BANDS)
-         {
-            m_maxValues.resize(BANDS);
-            for (ossim_uint32 band = 0; band < BANDS; ++band)
-            {
-               m_maxValues[band] = m_imageHandler->getMaxPixelValue(band);
-            }
-         }
-         if (m_nulValues.size() !=  BANDS)
-         {
-            m_nulValues.resize(BANDS);
-            for (ossim_uint32 band = 0; band < BANDS; ++band)
-            {
-               m_nulValues[band] = m_imageHandler->getNullPixelValue(band);
-            }
-         }
-      }
-
-      // Last size check as the m_scanForMinMaxNull block could have failed.
-      if ( ( m_minValues.size() ==  BANDS ) &&
-           ( m_maxValues.size() ==  BANDS ) &&
-           ( m_nulValues.size() ==  BANDS ) )
-      {
-         // Write the omd file:
-         ossimKeywordlist kwl;
-         if( ossimFilename(file).exists())
-         {
-            // Pick up existing omd file.
-            kwl.addFile(file.c_str());
-         }
-         ossimImageMetaData metaData(SCALAR, BANDS);
-         for(ossim_uint32 band = 0; band < BANDS; ++band)
-         {
-            metaData.setMinPix(band,  m_minValues[band]);
-            metaData.setMaxPix(band,  m_maxValues[band]);
-            metaData.setNullPix(band, m_nulValues[band]);
-         }
-         // Save to keyword list.
-         metaData.saveState(kwl);
-         
-         // Write to disk.
-         result = kwl.write(file.c_str());
-         if ( result )
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE) << "Wrote file: " << file << "\n";
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "ERROR writing file: " << file << "\n";
-         }
-      }
-
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Final array values:\n";
-         std::vector<ossim_float64>::const_iterator i = m_minValues.begin();
-         ossim_int32 band = 0;
-         while ( i < m_minValues.end() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "min[" << band++ << "]: " << *i << "\n";
-            ++i;
-         }
-         i = m_maxValues.begin();
-         band = 0;
-         while ( i < m_maxValues.end() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "max[" << band++ << "]: " << *i << "\n";
-            ++i;
-         }
-         i = m_nulValues.begin();
-         band = 0;
-         while ( i < m_nulValues.end() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "nul[" << band++ << "]: " << *i << "\n";
-            ++i;
-         }
-      }
-
-   } // Matches: if ( file && m_imageHandler.valid() )
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exit status" << (result?"true\n":"false\n");
-   }
-   
-   return result;
-}
-
-void ossimOverviewSequencer::getInputTileRectangle(ossimIrect& inputRect) const
-{
-   if (!m_imageHandler) return;
-   
-   getOutputTileRectangle(inputRect);
-   inputRect = inputRect * m_decimationFactor;
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimOverviewSequencer::getInputTileRectangle DEBUG:"
-         << "input rect: " << inputRect << std::endl;
-   }
-#endif
-}
-
-void ossimOverviewSequencer::getOutputTileRectangle(
-   ossimIrect& outputRect) const
-{
-   // Get the row and column.
-   ossim_int32 row = m_currentTileNumber / m_numberOfTilesHorizontal;
-   ossim_int32 col = m_currentTileNumber % m_numberOfTilesHorizontal;
-
-   ossimIpt pt;
-
-   // Set the upper left.
-   pt.y = row * m_tileSize.y;
-   pt.x = col * m_tileSize.x;
-   outputRect.set_ul(pt);
-
-   // Set the lower right.
-   pt.y = pt.y + m_tileSize.y - 1;
-   pt.x = pt.x + m_tileSize.x - 1;   
-   outputRect.set_lr(pt);
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimOverviewSequencer::getOutputTileRectangle DEBUG:"
-         << "output rect: " << outputRect << std::endl;
-   }
-#endif
-}
-
-void ossimOverviewSequencer::updateTileDimensions()
-{
-   if( m_areaOfInterest.hasNans() || m_tileSize.hasNans() )
-   {
-      m_numberOfTilesHorizontal = 0;
-      m_numberOfTilesVertical   = 0;
-      m_dirtyFlag = true;
-   }
-   else
-   {
-      // Get the output rectangle.
-      ossimIrect rect;
-      getOutputImageRectangle(rect);
-      
-      m_numberOfTilesHorizontal =
-         static_cast<ossim_uint32>( rect.width()  / m_tileSize.x );
-      m_numberOfTilesVertical =
-         static_cast<ossim_uint32>( rect.height() / m_tileSize.y );
-
-      if (rect.width()  % m_tileSize.x)
-      {
-         ++m_numberOfTilesHorizontal;
-      }
-      if (rect.height() % m_tileSize.y)
-      {
-         ++m_numberOfTilesVertical;
-      }
-   }
-}
-
-void ossimOverviewSequencer::resampleTile(const ossimImageData* inputTile)
-{
-   switch(m_imageHandler->getOutputScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         resampleTile(inputTile, ossim_uint8(0));
-         break;
-      }
-
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         resampleTile(inputTile, ossim_uint16(0));
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         resampleTile(inputTile, ossim_sint16(0));
-         break;
-      }
-
-      case OSSIM_UINT32:
-      {
-         resampleTile(inputTile, ossim_uint32(0));
-         break;
-      }
-         
-      case OSSIM_SINT32:
-      {
-         resampleTile(inputTile, ossim_sint32(0));
-         break;
-      }
-         
-      case OSSIM_FLOAT32:
-      {
-         resampleTile(inputTile, ossim_float32(0.0));
-         break;
-      }
-         
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         resampleTile(inputTile, ossim_float64(0.0));
-         break;
-      }
-      default:
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimOverviewSequencer::resampleTile Unkown pixel type!"
-            << std::endl;
-         return;
-         
-   } // End of "switch(m_imageHandler->getOutputScalarType())"
-}
-
-template <class T>
-void  ossimOverviewSequencer::resampleTile(const ossimImageData* inputTile, T  /* dummy */ )
-{
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimOverviewSequencer::resampleTile DEBUG: "
-         << "\ncurrent tile: " << m_currentTileNumber
-         << "\ninput tile:\n" << *inputTile
-         << "output tile:\n" << *(m_tile.get())
-         << endl;
-   }
-#endif
-   
-   const ossim_uint32 BANDS = m_tile->getNumberOfBands();
-   const ossim_uint32 LINES = m_tile->getHeight();
-   const ossim_uint32 SAMPS = m_tile->getWidth();
-   const ossim_uint32 INPUT_WIDTH = m_decimationFactor*m_tileSize.x;
-   
-   T nullPixel              = 0;
-   ossim_float64 weight     = 0.0;
-   ossim_float64 value      = 0.0;
-   ossim_uint32 sampOffset  = 0;
-   
-   if (m_resampleType == ossimFilterResampler::ossimFilterResampler_NEAREST_NEIGHBOR)
-   {
-      for (ossim_uint32 band=0; band<BANDS; ++band)
-      {
-         const T* s = static_cast<const T*>(inputTile->getBuf(band)); // source
-         T*       d = static_cast<T*>(m_tile->getBuf(band)); // destination
-         
-         nullPixel = static_cast<T>(inputTile->getNullPix(band));
-         weight = 0.0;
-         value  = 0.0;
-         
-         for (ossim_uint32 i=0; i<LINES; ++i)
-         {
-            for (ossim_uint32 j=0; j<SAMPS; ++j)
-            {
-               sampOffset = j*m_decimationFactor;
-               
-               weight = 1.0;
-               value  = *(s + i*m_decimationFactor*INPUT_WIDTH + sampOffset);
-               
-               if(weight)
-               {
-                  d[j] = static_cast<T>( value/weight );
-               }
-               else
-               {
-                  d[j] = nullPixel;
-               }
-               
-            } // End of sample loop.
-            
-            d += m_tileSize.x;
-            
-         } // End of line loop.
-         
-      } // End of band loop.
-      
-   }
-   else // ossimFilterResampler::ossimFilterResampler_BOX
-   {
-      ossim_uint32 lineOffset1 = 0;
-      ossim_uint32 lineOffset2 = 0;
-      ossim_float64 ul = 0.0;
-      ossim_float64 ur = 0.0;
-      ossim_float64 ll = 0.0;
-      ossim_float64 lr = 0.0;
-
-      for (ossim_uint32 band=0; band<BANDS; ++band)
-      {
-         const T* s = static_cast<const T*>(inputTile->getBuf(band)); // source
-         T*       d = static_cast<T*>(m_tile->getBuf(band)); // destination
-
-         nullPixel = static_cast<T>(inputTile->getNullPix(band));
-         weight = 0.0;
-         value  = 0.0;
-         
-         for (ossim_uint32 i=0; i<LINES; ++i)
-         {
-            lineOffset1 = i*m_decimationFactor*INPUT_WIDTH;
-            lineOffset2 = (i*m_decimationFactor+1)*INPUT_WIDTH;
-            
-            for (ossim_uint32 j=0; j<SAMPS; ++j)
-            {
-               sampOffset = j*m_decimationFactor;
-               
-               weight = 0.0;
-               value  = 0.0;
-               
-               //---
-               // Grab four pixels from the source, average, and assign
-               // to output.
-               //---
-               ul = *(s + lineOffset1 + sampOffset);
-               ur = *(s + lineOffset1 + sampOffset + 1);
-               ll = *(s + lineOffset2 + sampOffset);
-               lr = *(s + lineOffset2 + sampOffset + 1);
-               
-               if(ul != nullPixel)
-               {
-                  ++weight;
-                  value += ul;
-               }
-               if(ur != nullPixel)
-               {
-                  ++weight;
-                  value += ur;
-               }
-               if(ll != nullPixel)
-               {
-                  ++weight;
-                  value += ll;
-               }
-               if(lr != nullPixel)
-               {
-                  ++weight;
-                  value += lr;
-               }
-
-               if(weight)
-               {
-                  d[j] = static_cast<T>( value/weight );
-               }
-               else
-               {
-                  d[j] = nullPixel;
-               }
-            
-            } // End of sample loop.
-            
-            d += m_tileSize.x;
-            
-         } // End of line loop.
-         
-      } // End of band loop.
-   }
-}
-
-void ossimOverviewSequencer::setBitMaskObjects(ossimBitMaskWriter* mask_writer,
-                                               ossimMaskFilter* mask_filter)
-{
-   m_maskWriter = mask_writer;
-   m_maskFilter = mask_filter;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimPdfWriter.cpp b/ossim/src/ossim/imaging/ossimPdfWriter.cpp
deleted file mode 100644
index fbc891e..0000000
--- a/ossim/src/ossim/imaging/ossimPdfWriter.cpp
+++ /dev/null
@@ -1,1888 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file
-//
-// Author:  David Burken
-//
-// Description: OSSIM Portable Document Format (PDF) writer.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/imaging/ossimPdfWriter.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/imaging/ossimBandSelector.h>
-#include <ossim/imaging/ossimGeneralRasterWriter.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimJpegMemDest.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ctime>
-#include <fstream>
-#include <iomanip>
-#include <ostream>
-#include <sstream>
-#include <string>
-#include <vector>
-
-RTTI_DEF1(ossimPdfWriter,
-	  "ossimPdfWriter",
-	  ossimImageFileWriter)
-
-//---
-// For trace debugging (to enable at runtime do:
-// your_app -T "ossimPdfWriter:debug" your_app_args
-//---
-static ossimTrace traceDebug("ossimPdfWriter:debug");
-static ossimTrace traceLog("ossimPdfWriter:log");
-
-// Property keywords:
-static const std::string AUTHOR_KW        = "Author";
-static const std::string CREATOR_KW       = "Creator";
-static const std::string CREATION_DATE_KW = "CreationDate";
-static const std::string KEYWORDS_KW      = "Keywords";
-static const std::string MOD_DATE_KW      = "ModDate";
-static const std::string PRODUCER_KW      = "Producer";
-static const std::string SUBJECT_KW       = "Subject";
-static const std::string TITLE_KW         = "Title";
-
-//---
-// For the "ident" program which will find all exanded $Id$ macros and print them.
-//---
-#if OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id$";
-#endif
-
-ossimPdfWriter::ossimPdfWriter()
-   : ossimImageFileWriter(),
-     m_str(0),
-     m_ownsStream(false),
-     m_savedInput(0),
-     m_kwl( new ossimKeywordlist() ),
-     m_mutex()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPdfWriter::ossimPdfWriter entered" << std::endl;
-#if OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  "
-         << OSSIM_ID
-         << std::endl;
-#endif
-   }
-   
-   // Since there is no internal geometry set the flag to write out one.
-   setWriteExternalGeometryFlag(true);
-   
-   theOutputImageType = "ossim_pdf";
-}
-
-ossimPdfWriter::~ossimPdfWriter()
-{
-   // This will flush stream and delete it if we own it.
-   close();
-
-   m_kwl = 0; // Not a leak, ossimRefPtr
-}
-
-ossimString ossimPdfWriter::getShortName() const
-{
-   return ossimString("ossim_pdf_writer");
-}
-
-ossimString ossimPdfWriter::getLongName() const
-{
-   return ossimString("ossim pdf writer");
-}
-
-ossimString ossimPdfWriter::getClassName() const
-{
-   return ossimString("ossimPdfWriter");
-}
-
-bool ossimPdfWriter::writeFile()
-{
-   bool result = false;
-   
-   if( theInputConnection.valid() && ( getErrorStatus() == ossimErrorCodes::OSSIM_OK ) )
-   {
-      //---
-      // Make sure we can open the file.  Note only the master process is used for
-      // writing...
-      //---
-      if(theInputConnection->isMaster())
-      {
-         if (!isOpen())
-         {
-            open();
-         }
-      }
-      
-      result = writeStream();
-   }
-
-   return result;
-}
-
-bool ossimPdfWriter::writeStream()
-{
-   static const char MODULE[] = "ossimPdfWriter::writeStream";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\nCurrent options:\n"
-         << *(m_kwl.get()) <<  std::endl;
-   }
-   
-   bool result = false;
-
-   if ( isOpen() )
-   {
-      // Make sure we have a region of interest.
-      if( theAreaOfInterest.hasNans() )
-      {
-         theInputConnection->initialize();
-         theAreaOfInterest = theInputConnection->getAreaOfInterest();
-      }
-      else
-      {
-         theInputConnection->setAreaOfInterest( theAreaOfInterest );
-      }
-
-      ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
-      ossimScalarType scalarType = theInputConnection->getOutputScalarType();
-
-     // std::cout <<"BANDS ======== " << bands << "   scalarType = " << scalarType << std::endl;
-      if(((bands == 3) || (bands == 1))&&(scalarType == OSSIM_UINT8))
-      {
-         // Write the image:
-         result = writeImage( m_str );
-      }
-      else
-      {
-	ossimNotify(ossimNotifyLevel_INFO) << MODULE << " result = false" << std::endl;
-	// need some kind of error
-	result = false;
-      }
-
-      close();
-
-
-      // Reset the input to the image source sequence if it was modified.      
-      if ( m_savedInput.get() != theInputConnection->getInput( 0 ) )
-      {
-         theInputConnection->connectMyInputTo( 0, m_savedInput.get() );  
-      }
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exit status = " << (result?"true":"false") << std::endl;
-   }
-
-   return result;
-   
-} // bool ossimPdfWriter::writeStream()
-
-void ossimPdfWriter::writeHeader( std::ostream* str )
-{
-   // Header:
-   if ( str )
-   {
-      // Open in binary mode:
-      std::ostringstream os( std::ios_base::out|std::ios_base::binary );
-      
-      os << "%PDF-1.7\n";
-
-      //---
-      // Add comment with four characters greater than 127 to flag "binary pdf".
-      // Standard/norm from spec is "0xE2E3CFD3":
-      //---
-      std::vector<ossim_uint8> binData(4);
-      binData[0] = 0xE2;
-      binData[1] = 0xE3;
-      binData[2] = 0xCF;
-      binData[3] = 0xD3;
-
-      os << "%";
-      os.write( (char*)&binData.front(), binData.size() );
-      os << "\n";
-
-      // Write it:
-      str->write( os.str().data(), os.str().size() );
-
-      if ( traceLog() )
-      {
-         // Has binary data in it???
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-}
-
-void ossimPdfWriter::writeCatalog( std::ostream* str,
-                                   std::vector<std::streamoff>& xref )
-{
-   // Write the Catalog object.  This assumes an order of:
-   if ( str )
-   {
-      // Capture position:
-      xref.push_back( (std::streamoff)m_str->tellp() );
-
-      std::ostringstream os; // tmp stream...
-      os << xref.size() << " 0 obj\n"
-         << "  << /Type /Catalog\n"
-         << "     /Pages "    << xref.size()+1 << " 0 R\n" // Reference to Pages.
-         << "  >>\n"
-         << "endobj\n";
-
-      // Write it:
-      str->write( os.str().data(), os.str().size() );
-
-      if ( traceLog() )
-      {
-         // Has binary data in it???
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-}
-
-#if 0
-void ossimPdfWriter::writeOutlines( std::ostream* str,
-                                    std::vector<std::streamoff>& xref )
-{
-   // Write the Outlines object:
-   if ( str )
-   {
-      // Capture position:
-      xref.push_back( (std::streamoff)m_str->tellp() );
-
-      std::ostringstream os; // tmp stream...
-      os << xref.size() << " 0 obj\n"
-         << "  << /Type /Outlines\n"
-         << "     /Count 0\n"
-         << "  >>\n"
-         << "endobj\n";
-
-      str->write( os.str().data(), os.str().size() );
-
-      if ( traceLog() )
-      {
-         // Has binary data in it???
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-}
-#endif
-
-void ossimPdfWriter::writePages( std::ostream* str,
-                                 std::vector<std::streamoff>& xref )
-{
-   // Write Pages object.
-   if ( str )
-   {
-      // Capture position:
-      xref.push_back( (std::streamoff)str->tellp() );
-
-      std::ostringstream os;
-      os << xref.size() << " 0 obj\n"
-         << "  << /Type /Pages\n"
-         << "     /Kids [ " << xref.size()+1 << " 0 R ]\n" // Reference to Page.
-         << "     /Count 1\n"
-         << "  >>\n"
-         << "endobj\n";
-
-      str->write( os.str().data(), os.str().size() );
-      
-      if ( traceLog() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-}
-
-void ossimPdfWriter::writeInfo( std::ostream* str,
-                                std::vector<std::streamoff>& xref )
-{
-   // Write Pages object.
-   if ( str )
-   {
-      // Capture position:
-      xref.push_back( (std::streamoff)str->tellp() );
-
-      std::ostringstream os;
-      os << xref.size() << " 0 obj % Document Information Dictionary\n";
-
-      // Tile:
-      std::string s;
-      getTitle( s );
-      if ( s.size() )
-      {
-         os << "   << /Title (" << s << ")\n";
-      }
-      
-      // Author:
-      getAuthor( s );
-      if ( s.size() )
-      {
-         os << "      /Author (" << s << ")\n";
-      }
-
-      // Creator:
-      getCreator( s );
-      if ( s.size() )
-      {
-         os << "      /Creator (" << s << ")\n";
-      }
-
-      // Producer:
-      getProducer( s );
-      if ( s.size() )
-      {
-         os << "      /Producer (" << s << ")\n";
-      }
-
-      // Creation date ( D : YYYYMMDDHHmmSSOHH ' mm ' ):
-      getCreationDate( s );
-      if ( s.size() )
-      {
-         os << "      /CreationDate " << s << "\n";
-      }
-
-      // Modification date ( D : YYYYMMDDHHmmSSOHH ' mm ' ):
-      getModDate( s );
-      if ( s.size() )
-      {
-         os << "      /ModDate " << s << "\n";
-      }
-
-      os << "   >>\n"
-            << "endobj\n";
-
-      str->write( os.str().data(), os.str().size() );
-      
-      if ( traceLog() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-   
-} // End: ossimPdfWriter::writeInfo
-
-bool ossimPdfWriter::writeImage( std::ostream* str )
-{
-   bool status = false;
-   
-   if ( str )
-   {
-
-      //---
-      // This will remap input to eight bit if not already and make input one or
-      // three band depending on number of bands.
-      //---
-      setupInputChain();
-         
-      // Set the sequence tile size:
-      ossimIpt tileSize;
-      getTileSize( tileSize );
-      theInputConnection->setTileSize( tileSize );
-      
-      // Start the sequence at the first tile.
-      theInputConnection->setToStartOfSequence();
-      
-      const ossim_uint32 WIDTH  = theAreaOfInterest.width();
-      const ossim_uint32 HEIGHT = theAreaOfInterest.height();
-      const ossim_uint32 TW     = theInputConnection->getNumberOfTilesHorizontal();    
-      const ossim_uint32 TH     = theInputConnection->getNumberOfTilesVertical();
-      const ossim_uint32 TILES  = theInputConnection->getNumberOfTiles();
-
-#if 0 /* Please save for debug. (drb) */
-      ossimIrect   boundingRect  = theInputConnection->getBoundingRect();
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "\nBounding rect: " << theInputConnection->getBoundingRect()
-         << "\nAOI:           " << theAreaOfInterest  
-         << "\nBands:         " << theInputConnection->getNumberOfOutputBands()
-         << "\ntilesWide:     " << TW
-         << "\ntilesHigh:     " << TH
-         << "\ntileWidth:     " << tileWidth
-         << "\ntileHeight     " << tileHeight << std::endl;
-#endif
-
-      if ( traceLog() )
-      {
-         ossimKeywordlist logKwl;
-         theInputConnection->saveStateOfAllInputs(logKwl);      
-         ossimFilename logFile = getFilename();
-         logFile.setExtension("log");
-         ossimKeywordlist kwl;
-         theInputConnection->saveStateOfAllInputs(kwl);
-         kwl.write(logFile.c_str() );
-      }
-      
-      // Cross reference(xref) table.  Holds the offset of each object.  Written at the end.
-      std::vector<std::streamoff> xref;
-         
-      //---
-      // Header:
-      //---
-      writeHeader( str );
-         
-      //---
-      // Catalog object:
-      //---
-      writeCatalog( str, xref );
-         
-      //---
-      // Outlines object:
-      //---
-      // writeOutlines( m_str, xref );
-         
-      //---
-      // Pages object:
-      //---
-      writePages( str, xref );
-      
-      //---
-      // Page object:
-      //---
-      
-      // Capture position:
-      xref.push_back( (std::streamoff)str->tellp() );
-      
-      std::ostringstream os1;
-      os1 << xref.size() << " 0 obj\n"
-          << "  << /Type /Page\n"
-          << "     /Parent "    << xref.size()-1 << " 0 R\n" // Parent always one back.
-          << "     /Resources " << xref.size()+1 << " 0 R\n" // Next object.
-          << "     /MediaBox[0.0 0.0 " << WIDTH << " " << HEIGHT << "]\n"
-          // Contents = Resources_dictionary + tiles + base_form + 1):
-          << "     /Contents["  << (xref.size()+TILES+3) << " 0 R]\n";
-      
-      ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();      
-      if ( geom.valid() )
-      {
-         // Coordinate Transformation Matrix (CTM)
-         std::string lgiDictString;
-         getLgiDict( geom.get(), theAreaOfInterest, lgiDictString );
-         
-         if ( lgiDictString.size() )
-         {
-            os1 << lgiDictString;
-         }
-      }
-      
-      os1 << "  >>\n"
-         << "endobj\n"; // Matches: <</Type /Page"
-      
-      str->write( os1.str().data(), os1.str().size() );
-      if ( traceLog() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << os1.str() << "\n";
-      }
-      
-      // End /Page object
-      
-      //---
-      // Resource dictionary for page:
-      //---
-      
-      // Capture position:
-      xref.push_back( (std::streamoff)str->tellp() );
-
-      std::ostringstream os2;
-      os2 << xref.size() << " 0 obj % Resource dictionary for page.\n"
-          << "  << /ProcSet[/PDF/ImageB/ImageC]\n"
-          << "     /XObject << /Basemap_Form " << (xref.size()+TILES+1) << " 0 R ";
-
-      // Write in the tiles:
-      ossim_uint32 objIndex = static_cast<ossim_uint32>(xref.size()+1);
-      ossim_uint32 x;
-      ossim_uint32 y;
-      for ( x = 0; x < TW; ++x )
-      {
-         for ( y = 0; y < TH; ++y )
-         {
-            os2 << getTileString( x, y ) << " " << objIndex << " 0 R ";
-
-            ++objIndex;
-         }
- 
-      }
-      os2 << ">>\n" // Matches: /XObject<<
-          << "  >>\nendobj\n"; // Matches: % Resources...";
-
-      str->write( os2.str().data(), os2.str().size() );
-      if ( traceLog() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << os2.str() << "\n";
-      }
-      
-      // End Resources dictionary.
-
-      //---
-      // Now write the XObjects jpeg tiles:
-      //---
-      ossim_uint32 tileNumber = 0;
-      std::vector<ossimIrect> outputTileRects;
-      while ( tileNumber < TILES )
-      {
-         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
-         if( id.valid() )
-         {
-            // To hold output tile rect clamped to AOI.
-            ossimIrect outputTileRect;
-
-            switch ( getImageType() )
-            {
-               case ossimPdfWriter::RAW:
-               {
-                  writeRawTile( str, xref, id.get(), theAreaOfInterest, outputTileRect );
-                  break;
-               }
-               case ossimPdfWriter::JPEG:
-               default:
-               {
-                  writeJpegTile( str, xref, id.get(), theAreaOfInterest, outputTileRect );
-                  break;
-               }
-            }
-
-            // Capture tile rect:
-            outputTileRects.push_back( outputTileRect );
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimPdfWriter::writeImage ERROR:"
-               << "\nNULL Tile encountered, tile number=" << tileNumber
-               << std::endl;
-            status = false;
-            break;
-         }
-
-         ++tileNumber;
-
-         setPercentComplete( tileNumber / TILES * 100.0 );
-      }
-
-      if ( tileNumber == TILES )
-      {
-         status = true;
-      }
-
-      if ( status )
-      {
-         //---
-         // XObect Form for image tiles:
-         //---
-         
-         // Capture position:
-         xref.push_back( (std::streamoff)str->tellp() );
-
-         ossimIpt llPageOffset;
-         getLowerLeftPageOffset( theAreaOfInterest, llPageOffset );
-
-         std::ostringstream os3;
-         
-         // Tile loop - ontents for each ile:
-         tileNumber = 0;
-         ossim_uint32 x;
-         ossim_uint32 y;
-         for ( x = 0; x < TW; ++x )
-         {
-            for ( y = 0; y < TH; ++y )
-            {
-               //---
-               // PDF space is positive y = up, positive x = right.
-               // ossim image space is positive y down.
-               // 0, 0 is lower left corner in pdf space so "y of 0" in pdf space is
-               // theAreaOfInterest.ll().y in image space.
-               //---
-               ossim_int32 width = outputTileRects[tileNumber].width();
-
-               ossim_int32 height = outputTileRects[tileNumber].height();
-               
-               ossim_int32 llOffsetX =
-                  llPageOffset.x + outputTileRects[tileNumber].ll().x - theAreaOfInterest.ll().x;
-
-               ossim_int32 llOffsetY = llPageOffset.y + theAreaOfInterest.lr().y -
-                  outputTileRects[tileNumber].ll().y;
-               
-               os3 << "   q\n"                      // Save graphics state
-                   << "      " << width << " 0 0 " << height << " "
-                   << llOffsetX << " " << llOffsetY << " cm\n"
-                   << "      " << getTileString( x, y ) << " Do\n"
-                   << "   Q\n"; // Restore graphics state.
-               ++tileNumber;
-            }
-         }
-
-         std::ostringstream os4;
-         os4 << xref.size() << " 0 obj % /XObject/Form dictionary for image tiles.\n"
-             << "   << /Type /XObject\n"
-             << "      /Subtype /Form\n"
-             << "      /Length " << os3.str().size() << "\n"
-             << "      /BBox["
-             << llPageOffset.x << " " << llPageOffset.y << " "
-             << WIDTH << " " << HEIGHT << "]\n"
-             << "   >>\n"
-             << "stream\n";
-
-         // Write the content stream to tmp stream.
-         os4.write( os3.str().data(), os3.str().size() );
-         
-         os4 << "\n"
-             << "endstream\n"
-             << "endobj\n";
-
-         // Write the tmp stream to output stream.
-         str->write( os4.str().data(), os4.str().size() );
-         
-         if ( traceLog() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << os4.str() << "\n";
-         }
-         
-         //---
-         // Contents of page:
-         //---
-         
-         // Capture position:
-         xref.push_back( (std::streamoff)str->tellp() );
-
-         std::ostringstream os5;
-         os5 << "/Basemap_Form Do";
-         
-         std::ostringstream os6;
-         os6 << xref.size() << " 0 obj % Contents of page.\n"
-             << "   << /Length " << os5.str().size() << " >>\n"
-             << "stream\n";
-
-         os6.write( os5.str().data(), os5.str().size() );
-         os6 << "\n"
-             << "endstream\n"
-             << "endobj\n";
-         
-         str->write( os6.str().data(), os6.str().size() );
-         if ( traceLog() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << os6.str() << "\n";
-         }
-         
-         m_mutex.lock(); // Code not thread safe.
-         
-         // Document Information dictionary:
-         writeInfo( str, xref );
-         
-         m_mutex.unlock();
-         
-         //---
-         // Cross reference tables:
-         //---
-         
-         // Capture start of xref for the second to last line:
-         std::streamoff xrefOffset = (std::streamoff)m_str->tellp();
-         
-         writeXref( m_str, xref );
-         
-         //---
-         // Trailer:
-         //---
-         writeTrailer( m_str, static_cast<ossim_uint32>(xref.size()+1), xrefOffset );
-      }
-      
-   } // Matches: if ( str ...
-   
-   return status;
-
-} // End: ossimPdfWriter::writeImage
-
-void ossimPdfWriter::writeJpegTile( std::ostream* str,
-                                    std::vector<std::streamoff>& xref,
-                                    ossimImageData* id,
-                                    const ossimIrect& aoi,
-                                    ossimIrect& outputTileRect )
-{
-   //---
-   // Most of code and comments below are from jpeg-6b "example.c" file. See 
-   // http://www4.cs.fau.de/Services/Doc/graphics/doc/jpeg/libjpeg.html
-   //---
-
-   //---
-   // Initialize JPEG compression library:
-   // Note: JDIMENSION is typedefed to an unsigned int.
-   //---
-   struct jpeg_compress_struct cinfo;
-   struct jpeg_error_mgr jerr;
-   cinfo.err = jpeg_std_error( &jerr );
-   jpeg_create_compress(&cinfo);
-
-   //---
-   // Need to define a custom ostream destination manager for jpeglib to write compressed block:
-   // Note: Write the tile to a temp memory stream to get the size up front.
-   //---
-   std::ostringstream tileStream;
-   jpeg_cpp_stream_dest(&cinfo, tileStream);
-   
-   
-   // Setting the parameters of the output file here.
-   const ossim_uint32 BANDS = id->getNumberOfBands();
-   const ossim_uint32 TW    = id->getWidth();
-   const ossim_uint32 TH    = id->getHeight();
-   
-
-   // Assign width, height clamping to the aoi.      
-   cinfo.image_width = ossim::min<ossim_uint32>(
-      TW, aoi.lr().x - id->getOrigin().x + 1 );
-   cinfo.image_height = ossim::min<ossim_uint32>(
-      TH, aoi.lr().y - id->getOrigin().y + 1 );
-   cinfo.input_components = BANDS;
-
-   // Capture the output tile rect:
-   outputTileRect = ossimIrect( id->getOrigin(),
-                                ossimIpt( id->getOrigin().x + cinfo.image_width - 1,
-                                          id->getOrigin().y + cinfo.image_height - 1 ) );
-   
-   // colorspace of input image 
-   if ( BANDS == 3 )
-   {
-      cinfo.in_color_space = JCS_RGB;
-   }
-   else
-   {
-      cinfo.in_color_space = JCS_GRAYSCALE;
-   }
-   
-   // Default compression parameters...
-   jpeg_set_defaults( &cinfo );
-   
-   /* Now do the compression .. */
-   jpeg_start_compress( &cinfo, TRUE );
-   
-   // Compress the tile on line at a time:
-   JSAMPLE** samp_array = new JSAMPLE* [cinfo.image_height];
-   
-   //---
-   // Get a pointer to the source data.
-   // Needs to be band interleaved by pixel(BIP), so convert if needed.
-   //---
-   ossimRefPtr<ossimImageData> tempTile = 0;
-   ossim_uint8* tile = 0;
-   if ( ( BANDS == 1 ) &&
-        ( cinfo.image_width == id->getWidth() ) &&
-        ( cinfo.image_height == id->getHeight() ) )
-   {
-      tile = id->getUcharBuf();
-   }
-   else
-   {
-      // Convert from OSSIM's native BSQ interleave to BIP.
-      tempTile = new ossimImageData(
-         0, OSSIM_UINT8, BANDS, cinfo.image_width, cinfo.image_height );
-      tempTile->setOrigin( id->getOrigin() );
-      tempTile->initialize();
-      tile = tempTile->getUcharBuf();
-      id->unloadTile( tile, tempTile->getImageRectangle(), OSSIM_BIP );
-   }
-      
-   for ( ossim_uint32 row=0; row<cinfo.image_height; ++row )
-   {
-      samp_array[row] = (JSAMPLE*) tile + row*cinfo.input_components*cinfo.image_width;
-   }
-   
-   jpeg_write_scanlines( &cinfo, samp_array, cinfo.image_height );
-
-   //---
-   // Clean up after done compressing:
-   // Note: MUST do before writing to output stream below.
-   //---
-   jpeg_finish_compress( &cinfo );
-   jpeg_destroy_compress( &cinfo );
-   delete [] samp_array;
-   samp_array = 0;
-
-   // Capture position:
-   xref.push_back( (std::streamoff)str->tellp() );
-   
-   std::ostringstream os1;
-   os1 << xref.size() << " 0 obj\n"
-       << "   << /Type /XObject\n"
-       << "      /Subtype /Image\n"
-       << "      /Length " << tileStream.str().size() << "\n"
-       << "      /Filter[/DCTDecode]\n"
-       << "      /BitsPerComponent 8"
-       << "      /ColorSpace " << (BANDS==1?"/DeviceGray\n":"/DeviceRGB\n")
-       << "      /Width " << cinfo.image_width
-       << "      /Height " << cinfo.image_height
-       << "   >>\n"
-       << "stream\n";
-   
-   str->write( os1.str().data(), os1.str().size() );
-   
-   if ( traceLog() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << os1.str()
-         << "*** image stream not displayed ***\n"
-         << "endstream\n"
-         << "endobj\n\n";
-   }
-
-   // Write the image tile from memory to output stream.
-   str->write( tileStream.str().data(), tileStream.str().size() );
-
-   // Close out stream object.
-   *str << "\n"
-        << "endstream\n"
-        << "endobj\n";
-   
-} // End: ossimPdfWriter::writeJpegTile( ... )
-
-void ossimPdfWriter::writeRawTile( std::ostream* str,
-                                   std::vector<std::streamoff>& xref,
-                                   ossimImageData* id,
-                                   const ossimIrect& aoi,
-                                   ossimIrect& outputTileRect )
-{
-   const ossim_uint32 BANDS = id->getNumberOfBands();
-   const ossim_uint32 TW    = id->getWidth();
-   const ossim_uint32 TH    = id->getHeight();
-
-   // Assign width, height clamping to the aoi.      
-   ossim_uint32 width = ossim::min<ossim_uint32>(
-      TW, aoi.lr().x - id->getOrigin().x + 1  );
-   ossim_uint32 height = ossim::min<ossim_uint32>(
-      TH, aoi.lr().y - id->getOrigin().y + 1 );
-
-   // Capture the output tile rect:
-   outputTileRect = ossimIrect( id->getOrigin(),
-                                ossimIpt( id->getOrigin().x + width - 1,
-                                          id->getOrigin().y + height - 1 ) );
-
-   //---
-   // Get a pointer to the source data.
-   // Needs to be band interleaved by pixel(BIP), so convert if needed.
-   //---
-   ossimRefPtr<ossimImageData> tempTile = 0;
-   ossim_uint8* tile = 0;
-   ossim_uint32 length = 0;
-   if ( ( BANDS == 1 ) && ( width == id->getWidth() ) && ( height == id->getHeight() ) )
-   {
-      tile   = id->getUcharBuf();
-      length = id->getSizeInBytes();
-   }
-   else
-   {
-      // Convert from OSSIM's native BSQ interleave to BIP.
-      tempTile = new ossimImageData( 0, OSSIM_UINT8, BANDS, width, height );
-      tempTile->setOrigin( id->getOrigin() );
-      tempTile->initialize();
-      tile = tempTile->getUcharBuf();
-      id->unloadTile( tile, tempTile->getImageRectangle(), OSSIM_BIP );
-      length = tempTile->getSizeInBytes();
-   }
-
-   // Capture position:
-   xref.push_back( (std::streamoff)str->tellp() );
-   
-   std::ostringstream os1;
-   os1 << xref.size() << " 0 obj\n"
-       << "   << /Type /XObject\n"
-       << "      /Subtype /Image\n"
-       << "      /Length " << length << "\n"
-       << "      /BitsPerComponent 8"
-       << "      /ColorSpace " << (BANDS==1?"/DeviceGray\n":"/DeviceRGB\n")
-       << "      /Width " << width
-       << "      /Height " << height
-       << "   >>\n"
-       << "stream\n";
-
-   str->write( os1.str().data(), os1.str().size() );
-   
-   if ( traceLog() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << os1.str()
-         << "*** image stream not displayed ***\n"
-         << "endstream\n"
-         << "endobj\n\n";
-   }
-
-   // Write the image tile from memory to output stream.
-   str->write( (char*)tile, length );
-   
-   // Close out stream object.
-   *str << "\n"
-        << "endstream\n"
-        << "endobj\n";
-   
-} // End ossimPdfWriter::writeRawTile( ... )
-
-void ossimPdfWriter::writeXref( std::ostream* str,
-                                const std::vector<std::streamoff>& xref )
-{
-   if ( str )
-   {
-      std::ostringstream os;
-      os << "xref\n"
-         << "0 " << (xref.size()+1) << "\n"
-         << "0000000000 65535 f \n";
-            
-      std::vector<std::streamoff>::const_iterator i = xref.begin();
-      while ( i != xref.end() )
-      {
-         os << std::setiosflags(std::ios_base::fixed|std::ios_base::right)
-            << std::setfill('0')
-            << std::setw(10)
-            << (*i)
-            << " 00000 n \n";
-         ++i;
-      }
-      
-      // os << "\n";
-      
-      str->write( os.str().data(), os.str().size() );
-      
-      if ( traceLog() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-}
-
-void ossimPdfWriter::writeTrailer( std::ostream* str,
-                                   ossim_uint32 entrySize,
-                                   std::streamoff xrefOffset )
-{
-   if ( str )
-   {
-      std::ostringstream os;
-      os << "trailer\n"
-         << "   << /Size " << entrySize << "\n"
-         << "      /Root 1 0 R\n"
-         << "      /Info " << entrySize-1 << " 0 R\n"
-         << "   >>\n"
-         << "startxref\n"
-         << xrefOffset << "\n"
-         << "%%EOF\n";
-      // << "%%EOF";
-
-      str->write( os.str().data(), os.str().size() );
-
-      if ( traceLog() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-}
-
-#if 0
-void ossimPdfWriter::writeDummy( std::ostream* str,
-                                 std::vector<std::streamoff>& xref  )
-{
-   // Write a blank object.
-   if ( str )
-   {
-      // Capture position:
-      xref.push_back( (std::streamoff)str->tellp() );
-      
-      std::ostringstream os;
-      os << xref.size() << " 0 obj % dummy\n"
-         << "endobj\n";
-      
-      str->write( os.str().data(), os.str().size() );
-      
-      if ( traceLog() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
-      }
-   }
-}
-#endif
-
-bool ossimPdfWriter::saveState(ossimKeywordlist& kwl,
-                               const char* prefix)const
-{
-   return ossimImageFileWriter::saveState(kwl, prefix);
-}
-
-bool ossimPdfWriter::loadState(const ossimKeywordlist& kwl,
-                               const char* prefix)
-{
-   return ossimImageFileWriter::loadState(kwl, prefix);
-}
-
-bool ossimPdfWriter::isOpen() const
-{
-   bool result = false;
-   if (m_str)
-   {
-      const std::ofstream* fs = dynamic_cast<const std::ofstream*>(m_str);
-      if ( fs )
-      {
-         result = fs->is_open();
-      }
-      else
-      {
-         // Pointer good enough...
-         result = true;
-      }
-   }
-   return result;
-}
-
-
-bool ossimPdfWriter::open()
-{
-   bool result = false;
-   
-   close();
-
-   // Check for empty filenames.
-   if (theFilename.size())
-   {
-      std::ofstream* os = new std::ofstream();
-      os->open(theFilename.c_str(), ios::out | ios::binary);
-      if(os->is_open())
-      {
-         m_str = os;
-         m_ownsStream = true;
-         result = true;
-      }
-      else
-      {
-         delete os;
-         os = 0;
-      }
-   }
-   return result;
-}
-
-void ossimPdfWriter::close()
-{
-   if (m_str)      
-   {
-      m_str->flush();
-
-      if (m_ownsStream)
-      {
-         delete m_str;
-         m_str = 0;
-         m_ownsStream = false;
-      }
-   }
-}
-
-void ossimPdfWriter::getImageTypeList(std::vector<ossimString>& imageTypeList)const
-{
-   imageTypeList.push_back(ossimString("ossim_pdf"));
-}
-
-ossimString ossimPdfWriter::getExtension() const
-{
-   return ossimString("pdf");
-}
-
-bool ossimPdfWriter::hasImageType(const ossimString& imageType) const
-{
-   bool result = false;
-   if ( (imageType == "ossim_pdf") || (imageType == "image/pdf")||(imageType == "application/pdf") )
-   {
-      result = true;
-   }
-   return result;
-}
-
-void ossimPdfWriter::setProperty( ossimRefPtr<ossimProperty> property )
-{
-   if ( property.valid() )
-   {
-      std::string name = property->getName().string();
-      if ( name.size() )
-      {
-         if ( ( name == ossimKeywordNames::IMAGE_TYPE_KW ) ||
-              ( name == AUTHOR_KW ) ||
-              ( name == CREATOR_KW ) ||
-              ( name == CREATION_DATE_KW ) ||
-              ( name == KEYWORDS_KW ) ||
-              ( name == MOD_DATE_KW ) ||
-              ( name == ossimKeywordNames::OUTPUT_TILE_SIZE_KW ) ||
-              ( name == PRODUCER_KW ) ||
-              ( name == SUBJECT_KW ) ||
-              ( name == TITLE_KW ) )
-         {
-            addOption( name, property->valueToString().string() );
-         }
-         else
-         {
-            ossimImageFileWriter::setProperty(property);
-         }
-      }
-   }
-   
-} // ossimPdfWriter::setProperty
-
-ossimRefPtr<ossimProperty> ossimPdfWriter::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> prop = 0;
-
-   if ( name.size() )
-   {
-      if ( name == AUTHOR_KW )
-      {
-         ossimString value;
-         getAuthor( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, true);
-         prop = stringProp.get();
-      }
-      else if ( name == CREATOR_KW )
-      {
-         ossimString value;
-         getCreator( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, true);
-         prop = stringProp.get();
-      }
-      else if ( name == CREATION_DATE_KW )
-      {
-         ossimString value;
-         getCreationDate( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, true);
-         prop = stringProp.get();
-      }
-      else if ( name == ossimKeywordNames::IMAGE_TYPE_KW )
-      {
-         ossimString value;
-         getImageType( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, false); //  editable flag = false
-         
-         // Alway support jpeg.
-         stringProp->addConstraint( ossimString("jpeg") );
-         
-         // Alway support raw (general raster).
-         stringProp->addConstraint( ossimString("raw") );
-
-         prop = stringProp.get();
-      }
-      else if ( name == KEYWORDS_KW )
-      {
-         ossimString value;
-         getKeywords( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, true);
-         prop = stringProp.get();
-      }
-      else if ( name == MOD_DATE_KW )
-      {
-         ossimString value;
-         getModDate( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, true);
-         prop = stringProp.get();
-      }
-      else if( name == ossimKeywordNames::OUTPUT_TILE_SIZE_KW )
-      {
-         ossimString value;
-         getTileSize( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, false);
-         stringProp->addConstraint(ossimString("16"));
-         stringProp->addConstraint(ossimString("32"));
-         stringProp->addConstraint(ossimString("64"));
-         stringProp->addConstraint(ossimString("128"));
-         stringProp->addConstraint(ossimString("256"));      
-         stringProp->addConstraint(ossimString("512"));      
-         stringProp->addConstraint(ossimString("1024"));      
-         stringProp->addConstraint(ossimString("2048"));      
-         prop = stringProp.get();
-      }
-      else if ( name == SUBJECT_KW )
-      {
-         ossimString value;
-         getSubject( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, true);
-         prop = stringProp.get();
-      }
-      else if ( name == TITLE_KW )
-      {
-         ossimString value;
-         getSubject( value.string() );
-         ossimRefPtr<ossimStringProperty> stringProp =
-            new ossimStringProperty( name, value, true);
-         prop = stringProp.get();
-      }
-      else
-      {
-         prop = ossimImageFileWriter::getProperty(name);
-      }
-   }
-   
-   return prop;
-   
-} // End: ossimPdfWriter::getProperty
-
-void ossimPdfWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back( ossimString( AUTHOR_KW ) );
-   propertyNames.push_back( ossimString( CREATOR_KW ) );
-   propertyNames.push_back( ossimString( CREATION_DATE_KW ) );
-   propertyNames.push_back( ossimString( ossimKeywordNames::IMAGE_TYPE_KW ) );
-   propertyNames.push_back( ossimString( KEYWORDS_KW ) );
-   propertyNames.push_back( ossimString( MOD_DATE_KW ) );
-   propertyNames.push_back( ossimString( ossimKeywordNames::OUTPUT_TILE_SIZE_KW ) );
-   propertyNames.push_back( ossimString( PRODUCER_KW ) );
-   propertyNames.push_back( ossimString( SUBJECT_KW ) );
-   propertyNames.push_back( ossimString( TITLE_KW ) );
-
-   ossimImageFileWriter::getPropertyNames(propertyNames);
-}
-
-bool ossimPdfWriter::setOutputStream(std::ostream& stream)
-{
-   if (m_ownsStream && m_str)
-   {
-      delete m_str;
-   }
-   m_str = &stream;
-   m_ownsStream = false;
-   return true;
-}
-
-void ossimPdfWriter::setupInputChain()
-{
-   if ( theInputConnection.get() )
-   {
-      // Capture the input to the image source sequencer(theInputConnection).
-      m_savedInput = theInputConnection->getInput( 0 );
-      
-      ossimScalarType inputScalar = theInputConnection->getOutputScalarType();
-      ossim_uint32 bands          = theInputConnection->getNumberOfOutputBands();
-
-      if( inputScalar != OSSIM_UINT8 )
-      {
-         // Make eight bit.
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimPdfWriter::setupInputChain WARNING:"
-               << "\nData is being scaled to 8 bit!"
-               << "\nOriginal scalar type:  "
-               << ossimScalarTypeLut::instance()->
-               getEntryString(inputScalar).c_str()
-               << std::endl;
-         }
-         
-         //---
-         // Attach a scalar remapper to the end of the input chain.  This will
-         // need to be unattached and deleted at the end of this.
-         //---
-         ossimRefPtr<ossimScalarRemapper> sr = new ossimScalarRemapper;
-
-         // Connect remapper's input to sequencer input.
-         sr->connectMyInputTo( 0, theInputConnection->getInput(0) );
-
-         // Connet sequencer to remapper.
-         theInputConnection->connectMyInputTo(0, sr.get() );
-
-         // Initialize connections.
-         theInputConnection->initialize();
-      }
-
-      // Must be one or three band. Note bands are zero based...      
-      if ( ( bands != 1 ) && ( bands != 3 ) )
-      {
-         std::vector<ossim_uint32> bandList;
-         
-         // Always have one band.
-         bandList.push_back( 0 );
-
-         if ( bands > 3 )
-         {
-            // Use the first three bands.
-            bandList.push_back( 1 );
-            bandList.push_back( 2 );
-         }
-
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimPdfWriter::setupInputChain WARNING:"
-               << "\nOutput bands must be 1 or 3 and are being filterd!"
-               << "\nOriginal band count: " << bands
-               << "\nNew band count: " << bandList.size()
-               << std::endl;
-         }
-         
-         ossimRefPtr<ossimBandSelector> bs = new ossimBandSelector();
-
-         // Set the the band selector list.
-         bs->setOutputBandList( bandList );
-         
-         // Connect band selector's input to sequencer input.
-         bs->connectMyInputTo( 0, theInputConnection->getInput(0) );
-
-         // Connet sequencer to band selector.
-         theInputConnection->connectMyInputTo(0, bs.get() );
-
-         // Initialize connections.
-         theInputConnection->initialize();
-      }
-
-      if (  m_savedInput != theInputConnection->getInput( 0 ) )
-      {
-         //---
-         // If the input to the image source sequencer change the AOI
-         // MUST be reset as it gets wiped.
-         //---
-         theInputConnection->setAreaOfInterest( theAreaOfInterest );
-      }
-      
-   } // Matches: if ( theInputConnection )
-
-} // End: void ossimPdfWriter::setupInputChain()
-
-ossimPdfWriter::ossimPdfImageType ossimPdfWriter::getImageType() const
-{
-   ossimPdfWriter::ossimPdfImageType result = ossimPdfWriter::UNKNOWN;
-
-   // Get the type and downcase.
-   ossimString os;
-   getImageType( os.string() );
-   os.downcase();
-
-   if ( os == "jpeg" )
-   {
-      result = ossimPdfWriter::JPEG;
-   }
-   else if ( os == "raw" )
-   {
-      result = ossimPdfWriter::RAW;
-   }
-   else
-   {
-      // Unknown value:
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimPdfWriter::getImageCompression WARN\n"
-         << "Unhandled image compression type: " << os << std::endl;
-   }
-   return result;
-}
-
-void ossimPdfWriter::getImageType( std::string& type ) const
-{
-   type = m_kwl->findKey( std::string(ossimKeywordNames::IMAGE_TYPE_KW) );
-   if ( type.empty() )
-   {
-      type = "jpeg"; // default
-   }
-}
-
-void ossimPdfWriter::addOption(  const std::string& key, const std::string& value )
-{
-   m_mutex.lock();
-   if ( m_kwl.valid() )
-   {
-      if ( key.size() && value.size() )
-      {
-         m_kwl->addPair( key, value );
-      }
-   }
-   m_mutex.unlock();
-}
-
-#if 0
-void ossimPdfWriter::getMediaBoxSize(  ossim_uint32 imageWidth,
-                                       ossim_uint32 imageHeight,
-                                       ossimIpt& size ) const
-{
-   //---
-   // This could be an option / property.
-   // 612 x 792 = 8.5 x 11 inches at 72 dots per inch (612/72 x 792/72)
-   //---
-   size.x = static_cast<ossim_uint32>(imageWidth);
-   size.y = static_cast<ossim_uint32>(imageHeight);
-}
-#endif
-
-void ossimPdfWriter::getLowerLeftPageOffset( const ossimIrect& aoi, ossimIpt& offset ) const
-{
-   if ( aoi.hasNans() == false )
-   {
-      // Get the page size.
-      // ossimIpt mediaBoxSize;
-      // getMediaBoxSize( mediaBoxSize );
-
-      // Temp hard coded. (drb)
-      offset.x = 0;
-      offset.y = 0;
-   }
-   else
-   {
-      offset.x = 0;
-      offset.y = 0;
-   }
-}
-
-void ossimPdfWriter::getLgiDict( ossimImageGeometry* geom,
-                                 const ossimIrect& aoi,
-                                 std::string& s ) const
-{
-   s.clear(); // Empty string indicates error.
-
-   if ( geom && !aoi.hasNans() )
-   {
-      // Coordinate Transformation Matrix (CTM)
-      std::string ctmString;
-      getLgiDictCtm( geom, aoi, ctmString );
-
-      if ( ctmString.size() )
-      {
-         // ProjectionType
-         std::string projectionString;
-         getLgiDictProjection( geom, projectionString );
-         
-         if ( projectionString.size() )
-         {
-            //---
-            // Neatline: Not required for single frame.
-            // std::string neatLineString;
-            // getLgiDictNeatline( geom, neatLineString );
-            //---
-            
-            // if ( neatLineString.size() )
-            // {
-            // cout << "d..." << endl;
-               
-            // Description
-            std::string descriptionString;
-            getLgiDictDescription( geom, descriptionString );
-            
-            if ( descriptionString.size() )
-            {
-               std::ostringstream os;
-               os << "/LGIDict"
-                  << "[<<"
-                  << ctmString
-                  << "/Version(2.1)"
-                  << projectionString
-                  // << neatLineString
-                  << descriptionString
-                  << "/Type/LGIDict>>]";
-               
-               s = os.str();
-               // }
-            }
-         }
-      }
-   }
-   
-} // End: ossimPdfWriter::getLgiDictString
-
-void ossimPdfWriter::getLgiDictDatum( ossimImageGeometry* geom,
-                                      std::string& s ) const
-{
-   s.clear();
-   if ( geom )
-   {
-      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
-      if ( mapProj.valid() )
-      {
-         const ossimDatum* datum = mapProj->getDatum();
-         if ( datum )
-         {
-            s = "/Datum(";
-            s += datum->code().string();
-            s += ")";
-         }
-      }
-   }
-   
-} // End: ossimPdfWriter::getLgiDictDatum
-
-void ossimPdfWriter::getLgiDictDescription( ossimImageGeometry* geom,
-                                            std::string& s ) const
-{
-   s.clear();
-   if ( geom )
-   {
-      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
-      if ( mapProj.valid() )
-      {
-         const ossimDatum* datum = mapProj->getDatum();
-         if ( datum )
-         {
-            std::string code = datum->code().string();
-
-            if ( code == "WGE" )
-            {
-               s = "/Description(WGS 84)";
-            }
-         }
-      }
-   }
-   
-} // End: ossimPdfWriter::getLgiDictDescription
-
-#if 0
-void ossimPdfWriter::getLgiDictNeatline( ossimImageGeometry* geom,
-                                         std::string& s ) const
-{
-   s.clear();
-   if ( geom )
-   {
-      std::ostringstream os;
-
-      // Tmp drb...
-      os << "/Neatline[(0.0000000000)(0.0000000000)(0.0000000000)(718.0800000000)(609.8400000000)(718.0800000000)(609.8400000000)(0.0000000000)]";
-
-      s = os.str();
-   }
-   
-} // End: ossimPdfWriter::getLgiDictNeatline
-#endif
-
-void ossimPdfWriter::getLgiDictProjection( ossimImageGeometry* geom,
-                                           std::string& s ) const
-{
-   s.clear(); // Empty string indicates error.
-   
-   // Projection:
-   std::string projType;
-   getLgiDictProjectionType( geom, projType );
-   
-   // Datum:
-   std::string datumString;
-   getLgiDictDatum( geom, datumString );
-   
-   // Description
-   std::string descriptionString;
-   getLgiDictDescription( geom, descriptionString );
-
-   if ( projType.size() && datumString.size() )
-   {
-      std::ostringstream os;
-      os << "/Projection<<"
-         << projType
-         << descriptionString
-         << datumString
-         << "/Type/Projection>>"
-         << "/Display<<"
-         << projType
-         << descriptionString
-         << datumString
-         << "/Type/Projection>>";
-
-      s = os.str();
-   }
-   
-} // End: ossimPdfWriter::getLgiDictProjection
-
-void ossimPdfWriter::getLgiDictCtm( ossimImageGeometry* geom,
-                                    const ossimIrect& aoi,
-                                    std::string& s ) const
-{
-   s.clear(); // Empty string indicates error.
-
-   ossimDpt scale;
-   scale.makeNan();
-   ossimDpt dTie;
-   dTie.makeNan();
-   
-   ossimRefPtr<ossimProjection> proj = geom->getProjection();
-   if ( proj.valid() )
-   {
-      ossimRefPtr<ossimMapProjection> mapProj = dynamic_cast<ossimMapProjection*>( proj.get() );
-      if ( mapProj.valid() )
-      {
-         if ( mapProj->isGeographic() )
-         {
-            // Degrees per pixel.
-            geom->getDegreesPerPixel( scale );
-
-            if ( !scale.hasNans() )
-            {
-               // Tie point: Lat, lon of lower left corner. 
-               ossimGpt gTie;
-               geom->localToWorld( ossimDpt( aoi.ll() ), gTie );
-
-               // Check just lat and lon disregard height.
-               if ( !ossim::isnan(gTie.lon) && !ossim::isnan(gTie.lon) )
-               {
-                  dTie.x = gTie.lon;
-                  dTie.y = gTie.lat;
-               }
-            }
-         }
-      }
-   }
-
-   if ( !scale.hasNans() && !dTie.hasNans() )
-   {
-      //---
-      // Example string:
-      // (0.0000381944)(0.0000000000)(0.0000000000)(0.0000381944)(-77.0558525000)(38.8388091667)
-      // NOTE: (0,0) is lower left corner in pdf space.
-      ossim_float64 d = 0.0;
-      std::ostringstream os;
-      os << setprecision(15) // Not sure if this should be 10??? (drb)
-         << std::setiosflags(std::ios_base::fixed|std::ios_base::right)
-         << std::setfill('0')
-         << "/CTM[(" << scale.x << ")(" << d << ")(" << d << ")("
-         << scale.y << ")(" << dTie.x << ")(" << dTie.y << ")]";
-      
-      s = os.str();
-   }
-   
-} // End: ossimPdfWriter::getCtmString
-
-void ossimPdfWriter::getLgiDictProjectionType( ossimImageGeometry* geom, std::string& s ) const
-{
-   //---
-   // Initialize the projection string from geometry:
-   // Currently only coded for geographic and UTM projection.
-   //---
-   
-   s.clear(); // Empty string indicates error.
-
-   if ( geom )
-   {
-      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
-      if ( mapProj.valid() )
-      {
-         if ( mapProj->isGeographic() )
-         {
-            s = "/ProjectionType(GEOGRAPHIC)";
-         }
-         else
-         {
-            // Check for UTM:
-            ossimRefPtr<const ossimUtmProjection> utmProj =
-               dynamic_cast<const ossimUtmProjection*>( mapProj.get() );
-            if ( utmProj.valid() )
-            {
-               ossim_int32 zone = utmProj->getZone();
-               char hemisphere = utmProj->getHemisphere();
-               std::ostringstream os;
-               os << "/ProjectionType(UT)"
-                  << "/Zone(" << zone << ")"
-                  << "/Hemisphere(" << hemisphere << ")";
-               s = os.str();
-            }
-         }
-      }
-      
-   } // Matches if ( geom )
-   
-} // End: ossimPdfWriter::getProjectionType
-
-ossim_uint32 ossimPdfWriter::getEpsgCode( const ossimImageGeometry* geom ) const
-{
-   ossim_uint32 code = 32767;
-   if ( geom )
-   {
-      ossimRefPtr<const ossimProjection> proj = geom->getProjection();
-      if ( proj.valid() )
-      {
-         // Map projection:
-         ossimRefPtr<const ossimMapProjection> mapProj =
-            dynamic_cast<const ossimMapProjection*>( proj.get() );
-            
-         if ( mapProj.valid() )
-         {
-            code = mapProj->getPcsCode();
-         }
-      }
-   }
-   return code;
-}
-
-#if 0
-void ossimPdfWriter::getNumberOfTiles( ossim_uint32 imageWidth,
-                                       ossim_uint32 imageHeight,
-                                       ossimIpt size ) const
-{
-   const ossim_int32 DEFAULT_TILE_DIMENSION = 1024;
-
-   size.x = imageWidth / DEFAULT_TILE_DIMENSION;
-   size.y = imageHeight / DEFAULT_TILE_DIMENSION;   
-
-   if ( imageWidth % DEFAULT_TILE_DIMENSION )
-   {
-      ++size.x;
-   }
-   if ( imageHeight % DEFAULT_TILE_DIMENSION )
-   {
-      ++size.y;
-   }
-   
-} // End: getNumberOfTiles( ... )
-#endif
-
-void ossimPdfWriter::getTitle( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( TITLE_KW );
-   
-   if ( s.empty() )
-   {
-      if ( theFilename.size() )
-      {
-         // Set to basename of file.
-         s = theFilename.file().string();
-      }
-   }
-}
-
-void ossimPdfWriter::getAuthor( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( AUTHOR_KW );
-   
-   if ( s.empty() )
-   {
-      s = "ossim"; // Default: ???
-   }
-}
-
-void ossimPdfWriter::getSubject( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( SUBJECT_KW );
-}
-
-void ossimPdfWriter::getKeywords( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( KEYWORDS_KW ); 
-}
-
-void ossimPdfWriter::getCreator( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( CREATOR_KW );
-   
-   if ( s.empty() )
-   {
-      s = "ossim"; // Default: ???
-   }
-}
-
-void ossimPdfWriter::getProducer( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( PRODUCER_KW );
-   
-   if ( s.empty() )
-   {
-      s = "ossim"; // Default: ???
-   }
-}
-
-void ossimPdfWriter::getCreationDate( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( CREATION_DATE_KW );
-   
-   if ( s.empty() )
-   {
-      getGmtDate( s ); 
-   }
-}
-
-void ossimPdfWriter::getModDate( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( MOD_DATE_KW );
-   
-   if ( s.empty() )
-   {
-      getGmtDate( s );
-   }
-}
-
-void ossimPdfWriter::getGmtDate( std::string& s ) const
-{
-   // Get the time:
-   time_t now;
-   time(&now);
-   
-   // Convert to UTC:
-   tm* gt = gmtime(&now);
-
-   if ( gt )
-   {
-      //---
-      // Format(26 charactors including trailing null):
-      // (D:YYYYMMDDHHmmSSZ00'00')
-      char dateChars[26];
-      dateChars[25] = '\0';
-      strftime(dateChars, 26, "(D:%Y%m%d%H%M%SZ00'00')", gt);
-      s = dateChars;
-   }
-   
-} // End: ossimPdfWriter::getGmtDate
-
-void ossimPdfWriter::getTileSize( std::string& s ) const
-{
-   // Check if in keyword list.
-   s = m_kwl->findKey( std::string( ossimKeywordNames::OUTPUT_TILE_SIZE_KW ) );
-   if ( s.empty() )
-   {
-      ossimIpt tileSize;
-      ossim::defaultTileSize( tileSize );
-      s = ossimString::toString( tileSize.x ).string(); 
-   }
-}
-
-void ossimPdfWriter::getTileSize( ossimIpt& tileSize ) const
-{
-   std::string s;
-   getTileSize( s );
-   if ( s.size() )
-   {
-      tileSize.x = ossimString(s).toInt32();
-   }
-   else
-   {
-      tileSize.x = 1024; // default
-   }
-   tileSize.y = tileSize.x;
-}
-
-std::string ossimPdfWriter::getTileString( ossim_uint32 x, ossim_uint32 y ) const
-{
-   // Format like:  /Tile_0001_0002
-   std::ostringstream os;
-   os << std::setiosflags(std::ios_base::fixed|std::ios_base::right)
-      << std::setfill('0')
-      << "/Tile_"
-      << std::setw(4) << x
-      << "_"
-      << std::setw(4) << y;
-   
-   return os.str();
-}
diff --git a/ossim/src/ossim/imaging/ossimPiecewiseRemapper.cpp b/ossim/src/ossim/imaging/ossimPiecewiseRemapper.cpp
deleted file mode 100644
index b7ed009..0000000
--- a/ossim/src/ossim/imaging/ossimPiecewiseRemapper.cpp
+++ /dev/null
@@ -1,926 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Piecewise remapper class definition. Derived from ossimTableRemapper.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/imaging/ossimPiecewiseRemapper.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <iomanip>
-#include <iostream>
-#include <limits>
-#include <sstream>
-
-RTTI_DEF1(ossimPiecewiseRemapper, "ossimPiecewiseRemapper", ossimTableRemapper)
-
-
-static const std::string REMAP_KW      = "remap";
-static const std::string REMAP_TYPE_KW = "remap_type";
-
-static ossimTrace traceDebug("ossimPiecewiseRemapper:debug");
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id$";
-#endif
-
-// Private container class for points.
-ossimPiecewiseRemapper::ossimRemapSet::ossimRemapSet()
-   :
-   m_set(0)
-{
-}
-
-ossimPiecewiseRemapper::ossimRemapSet::ossimRemapSet(const ossimRemapSet& obj)
-   :
-   m_set(obj.m_set)
-{
-}
-
-const ossimPiecewiseRemapper::ossimRemapSet&
-ossimPiecewiseRemapper::ossimRemapSet::operator=( const ossimRemapSet& rhs )
-{
-   if ( this != &rhs )
-   {
-      m_set = rhs.m_set;
-   }
-   return *this;
-}
-
-// Private container class for points.
-ossimPiecewiseRemapper::ossimBandRemap::ossimBandRemap()
-   :
-   m_remap(0)
-{
-}
-
-ossimPiecewiseRemapper::ossimBandRemap::ossimBandRemap(const ossimBandRemap& obj)
-   :
-   m_remap(obj.m_remap)
-{
-}
-
-const ossimPiecewiseRemapper::ossimBandRemap&
-ossimPiecewiseRemapper::ossimBandRemap::operator=( const ossimBandRemap& rhs )
-{
-   if ( this != &rhs )
-   {
-      m_remap = rhs.m_remap;
-   }
-   return *this;
-}
-
-void ossimPiecewiseRemapper::ossimBandRemap::loadState( const ossimKeywordlist& kwl,
-                                                        const std::string& prefix,
-                                                        ossim_uint32 band )
-{
-   //---
-   // Band Remap set example:
-   // band0.remap0:((0, 127, 0, 127), (128, 255, 128, 382))
-   // band0.remap1:((0, 382, 0, 255))
-   //---
-
-   // Clear the sets:
-   m_remap.clear();
-   
-   // Get the number of remaps for this band.
-   std::string keyBase = "band";
-   keyBase += ossimString::toString(band).string();
-   keyBase += ".";
-   keyBase += REMAP_KW;
-   
-   ossim_uint32 NUMBER_REMAPS = kwl.numberOf(prefix.c_str(), keyBase.c_str());
-   ossim_uint32 found = 0;
-   ossim_uint32 index = 0;
-   
-   // Loop to find band remaps.  This allows for skipping indexes. 
-   while ( found < NUMBER_REMAPS )
-   {
-      std::string key = keyBase + ossimString::toString(index).string();
-      std::string value = kwl.findKey( prefix, key );
-      if ( value.size() )
-      {
-         ossimPiecewiseRemapper::ossimRemapSet set;
-         if ( initRemapSetFromString( value, set ) )
-         {
-            m_remap.push_back( set );
-         }
-         ++found;
-      }
-      
-      ++index;
-      if ( index > (NUMBER_REMAPS+100) )
-      {
-         break;
-      }
-   }
-   
-} // End: ossimPiecewiseRemapper::ossimBandRemap::loadState
-      
-void ossimPiecewiseRemapper::ossimBandRemap::saveState(
-   ossimKeywordlist& kwl,
-   const std::string& prefix,
-   ossimPiecewiseRemapper::PiecewiseRemapType remapType,
-   ossim_uint32 band ) const
-{
-   //---
-   // Remap set:
-   // Remap set: "band0.remap0":
-   // band0.remap0:((0, 127, 0, 127), (128, 255, 128, 382))
-   // band0.remap1:((0, 382, 0, 255))
-   //---
-   ossim_uint32 remapIndex = 0;
-   std::vector<ossimRemapSet>::const_iterator i = m_remap.begin();
-   while ( i != m_remap.end() )
-   {
-      std::string key = "band";
-      key += ossimString::toString(band).string();
-      key += ".";
-      key += REMAP_KW;
-      key += ossimString::toString(remapIndex).string();
-      std::string value;
-      getRemapSetString( remapType, (*i), value );
-      kwl.addPair( prefix, key, value );
-      ++i;
-      ++remapIndex;
-   }
-   
-} // End: ossimPiecewiseRemapper::ossimBandRemap::saveState
-
-bool ossimPiecewiseRemapper::ossimBandRemap::initRemapSetFromString(
-   const std::string& s, ossimPiecewiseRemapper::ossimRemapSet& set ) const
-{
-   //---
-   // Example:
-   // ((0, 127, 0, 127), (128, 255, 128, 382))
-   //---
-
-   bool result = false;
-
-   if ( s.size() )
-   {
-      std::istringstream in( s );
-      char c;
-      ossim_float64 d;
-      
-      // Gobble the open '('
-      while ( !in.bad() && !in.eof() )
-      {
-         c = in.get();
-         if ( c == '(' ) break;
-      }
-      
-      // Main loop:
-      while( !in.bad() && !in.eof() )
-      {
-         c = in.get();
-         
-         if ( c == ')' ) // Possible end of quadruple...
-         {
-            // Gobble next comma:
-            while( !in.bad() && !in.eof() )
-            {
-               c = in.get();
-               if ( c == ',' )
-               {
-                  break;
-               }
-            }
-            c = in.get();
-         }
-         
-         if ( (c == '(') || (c == ',') )
-         {
-            // Next string should be a number:
-            in >> d;
-            if ( in.good() )
-            {
-               set.m_set.push_back(d);
-            }
-            else
-            {
-               break;
-            }
-         }
-      }
-
-      if ( set.m_set.size() )
-      {
-         result = true;
-      }
-   }
-
-   if ( !result )
-   {
-      set.m_set.clear();
-   }
-
-   return result;
-   
-} // End: ossimPiecewiseRemapper::ossimBandRemap::initRemapSetFromString( ... )
-
-void ossimPiecewiseRemapper::ossimBandRemap::getRemapSetString(
-   ossimPiecewiseRemapper::PiecewiseRemapType remapType,
-   const ossimPiecewiseRemapper::ossimRemapSet& set, 
-   std::string& s ) const
-{
-   if ( remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
-   {
-      getLinearRemapSetString( set, s );
-   }
-}
-
-void ossimPiecewiseRemapper::ossimBandRemap::getLinearRemapSetString(
-   const ossimPiecewiseRemapper::ossimRemapSet& set, 
-   std::string& s ) const
-{
-   //---
-   // Save in the form of:
-   // ((0, 127, 0, 127), (128, 255, 128, 382))
-   //---
-   s.clear();
-   if ( set.m_set.size() )
-   {
-      const ossim_uint32 TUPLES = set.m_set.size() / 4;
-      if ( TUPLES )
-      {  
-         std::ostringstream os;
-         os << std::setprecision(15)
-            << "(";
-         for ( ossim_uint32 i = 0; i < TUPLES; ++i )
-         {
-            ossim_uint32 setIdx = i*4;
-            os << "("
-               << set.m_set[ setIdx ]
-               << ","
-               << set.m_set[ setIdx + 1 ]
-               << ","
-               << set.m_set[ setIdx + 2 ]
-               << ","
-               << set.m_set[ setIdx + 3 ]
-               << ")";
-            if ( i < (TUPLES-1) )
-            {
-               os << ","; // Comma between quadruples.
-            }
-         }
-         os << ")";
-         s = os.str();
-      }
-   }
-   
-} // End: ossimPiecewiseRemapper::ossimBandRemap::getLinearRemapSetString( ... )
-
-ossimPiecewiseRemapper::ossimPiecewiseRemapper()
-   :
-   ossimTableRemapper(),  // base class
-   m_dirty(false),
-   m_remapType(ossimPiecewiseRemapper::UNKNOWN),
-   m_bandRemap(0),
-   m_min(0),
-   m_max(0)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPiecewiseRemapper::ossimPiecewiseRemapper entered...\n";
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << "\n";
-#endif      
-   }
-}
-
-ossimPiecewiseRemapper::~ossimPiecewiseRemapper()
-{
-}
-
-void ossimPiecewiseRemapper::initialize()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPiecewiseRemapper::initialize entered..." << endl;
-   }
-
-   //---
-   // Call the base class initialize.
-   // Note:  This will reset "theInputConnection" if it changed...
-   //---
-   ossimTableRemapper::initialize();
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPiecewiseRemapper::initialize exited..." << endl;
-   }
-}
-
-void ossimPiecewiseRemapper::setRemapType( const std::string& type )
-{
-   if ( (type == "linear_native") ||
-        (ossimString(type).downcase() == "linear_native") )
-   {
-      m_remapType = ossimPiecewiseRemapper::LINEAR_NATIVE;
-   }
-   else
-   {
-      m_remapType = ossimPiecewiseRemapper::UNKNOWN;
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimPiecewiseRemapper::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> result = 0;
-   
-   if ( theInputConnection )
-   {
-      if ( m_dirty )
-      {
-         // Rebuild the table if dirty flag set:
-         buildTable();
-      }
-
-      if ( theEnableFlag && theTable.size() ) 
-      {
-         //---
-         // Not bypassed and has a table...
-         // Base handles the rest...
-         //---
-         result = ossimTableRemapper::getTile(tileRect, resLevel);
-      }
-      else
-      {
-         // Fetch tile from pointer from the input source.
-         result = theInputConnection->getTile(tileRect, resLevel);
-      }
-   }
-
-   return result;
-}
-
-void ossimPiecewiseRemapper::getRemapTypeString(
-   ossimPiecewiseRemapper::PiecewiseRemapType remapType, std::string& s ) const
-{
-   if ( remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
-   {
-      s = "linear_native";
-   }
-   else
-   {
-      s = "unknown";
-   }
-}
-
-bool ossimPiecewiseRemapper::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   static const char MODULE[] = "ossimPiecewiseRemapper::loadState";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " Entered..." << "\nprefix:  " << (prefix?prefix:"null") << endl;
-   }
-
-   bool status = false;
-   std::string p = ( prefix ? prefix : "" );
-
-   // Check type first before going on:
-   std::string key = ossimKeywordNames::TYPE_KW;
-   std::string value;
-   value = kwl.findKey( p, key );
-
-   if ( value == "ossimPiecewiseRemapper" )
-   {
-      // Load the base class states...
-      status = ossimTableRemapper::loadState(kwl, prefix);
-      
-      if (status)
-      {
-         // Look for scalar type keyword.
-         // ossim_int32 st = ossimScalarTypeLut::instance()->getEntryNumber(kwl, p.c_str(), true);
-
-         // Lookup table returns -1 if not found so check return...
-         // if ( (st != -1) && (st != OSSIM_SCALAR_UNKNOWN) )
-         // {
-         // m_outputScalarType = static_cast<ossimScalarType>(st);
-         //}
-         
-         // Remap type "remap_type":
-         value = kwl.findKey( p, REMAP_TYPE_KW );
-         if ( value.size() )
-         {
-            setRemapType( value );
-            
-            if ( m_remapType != ossimPiecewiseRemapper::UNKNOWN )
-            {
-               // Get the number of bands "number_bands":
-               ossim_uint32 bands = 0;
-               key = ossimKeywordNames::NUMBER_BANDS_KW;
-               value = kwl.findKey( p, key );
-               if ( value.size() )
-               {
-                  bands = ossimString(value).toUInt32();
-               }
-               
-               if ( bands )
-               {
-                  // Start with clean remap set:
-                  m_bandRemap.clear();
-                  m_bandRemap.resize( bands );
-                  
-                  m_min.clear();
-                  m_max.clear();
-
-                  // Loop through bands:
-                  for ( ossim_uint32 band = 0; band < bands; ++band )
-                  {
-                     // Band remap:
-                     m_bandRemap[band].loadState( kwl, p, band );
-                     
-                     // Min:
-                     std::string keyBase = ossimKeywordNames::MIN_VALUE_KW;
-                     keyBase += ".band";
-                     key = keyBase + ossimString::toString(band).string();
-                     value =  kwl.findKey( p, key );
-                     if ( value.size() )
-                     {
-                        m_min.push_back( ossimString(value).toFloat64() );
-                     }
-                     
-                     // Max:
-                     keyBase = ossimKeywordNames::MAX_VALUE_KW;
-                     keyBase += ".band";
-                     key = keyBase + ossimString::toString(band).string();
-                     value =  kwl.findKey( p, key );
-                     if ( value.size() )
-                     {
-                        m_max.push_back( ossimString(value).toFloat64() );
-                     }
-                     
-                  } // End: Band loop
-                  
-                  if ( m_bandRemap.size() && ( !m_min.size() || !m_max.size() ) )
-                  {
-                     initMinMax(); // Initialize from the m_reampSet tuples.
-                  }
-               }
-            }
-         }
-
-         if ( m_bandRemap.size() )
-         {
-            m_dirty = true;
-         }
-         
-      } // Matches: status = ossimTableRemapper::loadState(kwl, prefix); if (status){...
-      else
-      {
-         // Sets base: ossimSource::theEnableFlag
-         setEnableFlag(false);
-      }
-
-
-      // Tmp drb:
-      // initMinMax();
-      
-   } // Matches: if ( value == "ossimPiecewiseRemapper" )
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:\n";
-      this->print( ossimNotify(ossimNotifyLevel_DEBUG) );
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\nExited..." << endl;
-   }
-   return status;
-   
-} // End: ossimPiecewiseRemapper::loadState
-
-bool ossimPiecewiseRemapper::saveState( ossimKeywordlist& kwl,
-                                        const char* prefix) const
-{
-   bool result = false;
-   
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-   
-   if ( ( m_remapType != ossimPiecewiseRemapper::UNKNOWN ) &&
-        ( m_bandRemap.size() == BANDS ) )
-   {
-      std::string p = ( prefix ? prefix : "" );
-
-      // Bands:
-      std::string value = ossimString::toString(BANDS).string();
-      kwl.addPair( p, std::string(ossimKeywordNames::NUMBER_BANDS_KW), value );
-      
-      // Remap type:
-      getRemapTypeString( m_remapType, value );
-      kwl.addPair( p, REMAP_TYPE_KW, value );
-
-      // Save the band remaps.
-      if ( m_bandRemap.size() == BANDS )
-      {
-         for ( ossim_uint32 band = 0; band < BANDS; ++band )
-         {
-            m_bandRemap[band].saveState( kwl, p, m_remapType, band );
-         }
-      }
-      
-      // Min/max values:
-      if ( ( m_min.size() == BANDS ) && ( m_max.size() == BANDS ) )
-      {
-         std::string minBase = ossimKeywordNames::MIN_VALUE_KW;
-         minBase += ".band";
-         std::string maxBase = ossimKeywordNames::MAX_VALUE_KW;
-         maxBase += ".band";
-         
-         for ( ossim_uint32 band = 0; band < BANDS; ++band )
-         {
-            // Min:
-            std::string key = minBase + ossimString::toString(band).string();
-            kwl.add( p.c_str(), key.c_str(), m_min[band] );
-
-            // Max:
-            key = maxBase + ossimString::toString(band).string();
-            kwl.add( p.c_str(), key.c_str(), m_max[band] );
-         }
-      }
-
-      // Base class:
-      result = ossimTableRemapper::saveState(kwl, prefix);
-   }
-   
-   return result;
-}
-
-ostream& ossimPiecewiseRemapper::print(ostream& os) const
-{
-   ossimKeywordlist kwl;
-   saveState( kwl, 0 );
-   
-   os << setiosflags(ios::fixed) << setprecision(15)
-      << "\nossimPiecewiseRemapper::print:\n"
-      << kwl
-      << "\n";
-   
-   return os;
-}
-
-ossimString ossimPiecewiseRemapper::getClassName() const
-{
-   return ossimString("ossimPiecewiseRemapper");
-}
-
-ossimString ossimPiecewiseRemapper::getLongName()const
-{
-   return ossimString("OSSIM Piecewise Remapper");
-}
-
-ossimString ossimPiecewiseRemapper::getShortName()const
-{
-   return ossimString("Piecewise Remapper");
-}
-
-double ossimPiecewiseRemapper::getMinPixelValue(ossim_uint32 band)const
-{
-   ossim_float64 result = ossimTableRemapper::getMinPixelValue(band);
-   if ( theEnableFlag && (band < m_min.size()) )
-   {
-      result = m_min[band];
-   }
-   return result;
-}
-
-ossim_float64 ossimPiecewiseRemapper::getMaxPixelValue(ossim_uint32 band) const
-{
-   ossim_float64 result = ossimTableRemapper::getMaxPixelValue(band);
-   if ( theEnableFlag && (band < m_max.size()) )
-   {
-      result = m_max[band];
-   }
-   return result;
-}
-
-void ossimPiecewiseRemapper::initMinMax()
-{
-#if 0
-   if ( m_remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
-   {
-      //---
-      // Each remap set holds a group of tuples for the band.
-      // Tuple format example: <min_in> <max_in> <min_out> <max_out>
-      //---
-      const ossim_uint32 BANDS = getNumberOfOutputBands();
-
-      if ( m_bandRemap.size() == BANDS )
-      {
-         m_min.resize( BANDS );
-         m_max.resize( BANDS );
-         
-         // First time through:
-         for( ossim_uint32 band = 0; band < BANDS; ++band )
-         {
-            const ossim_uint32 TUPLES = m_bandRemap[band].m_set.size() / 4;
-            for ( ossim_uint32 tuple = 0; tuple < TUPLES; ++tuple )
-            {
-               //---
-               // Min: get min of "min_out" from sets.
-               // Max: get max of "max_out" from sets.
-               //---
-               if ( tuple == 0 )
-               {
-                  m_min[band] = m_bandRemap[band].m_set[tuple*4+2];
-                  m_max[band] = m_bandRemap[band].m_set[tuple*4+3];
-               }
-               else
-               {
-                  if ( m_bandRemap[band].m_set[tuple*4+2] < m_min[band] )
-                  {
-                     m_min[band] = m_bandRemap[band].m_set[tuple*4+2];
-                  }
-                  if ( m_bandRemap[band].m_set[tuple*4+3] > m_max[band] )
-                  {
-                     m_max[band] = m_bandRemap[band].m_set[tuple*4+3];
-                  }
-               }  
-            }
-
-            //---
-            // Clamp min to scalar min as this is used for getMinPixelValue.
-            // This will keep a remap of:
-            // ((0, 127, 0, 127), (128, 255, 128, 382))
-            // From having a min and null of 0...
-            //---
-            if ( m_outputScalarType != OSSIM_SCALAR_UNKNOWN )
-            {
-               if ( m_min[band] < ossim::defaultMin( m_outputScalarType ) )
-               {
-                  m_min[band] = ossim::defaultMin( m_outputScalarType );
-               }
-            }
-            
-         } // End: band loop...
-      }
-   }
-   else
-   {
-      m_min.clear();
-      m_max.clear();
-   }
-#endif
-
-   // Disabled for now (drb)
-   m_min.clear();
-   m_max.clear();
-   
-   
-} // End: ossimPiecewiseRemapper::initMinMax()
-
-void ossimPiecewiseRemapper::buildTable()
-{
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-   if ( BANDS && (m_bandRemap.size() == BANDS) &&
-        ( m_remapType == ossimPiecewiseRemapper::LINEAR_NATIVE ) )
-   {
-      setupTable();
-
-      if ( theTable.size() )
-      {
-         if ( m_remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
-         {
-            buildLinearNativeTable();
-         }
-      }
-   }
-   else
-   {
-      // No remaps:
-      theTable.clear();
-   }
-
-   // Clear the dirty flag.
-   m_dirty = false;
-   
-} // End: ossimPiecewiseRemapper::buildTable()
-
-void ossimPiecewiseRemapper::buildLinearNativeTable()
-{
-   switch ( getOutputScalarType() )
-   {
-      case OSSIM_UINT8:
-      {
-         buildLinearNativeTable(ossim_uint8(0));
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         buildLinearNativeTable(ossim_uint16(0));
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         buildLinearNativeTable(ossim_sint16(0));
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         buildLinearNativeTable(ossim_uint32(0));
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         buildLinearNativeTable(ossim_sint32(0));
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-            // Shouldn't hit this.
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimHistogramRemapper::buildLinearNativeTable OSSIM_SCALAR_UNKNOWN!" << endl;
-         }
-         break;
-      }
-			
-   } // End of "switch (theTableType)"
-      
-} // End: void ossimPiecewiseRemapper::buildLinearNativeTable()
-
-template <class T> void ossimPiecewiseRemapper::buildLinearNativeTable(T /* dummy */)
-{
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-   
-   if ( BANDS && (m_bandRemap.size() == BANDS) && theTable.size() )
-   {
-      T* table = reinterpret_cast<T*>(&theTable.front());
-
-      ossim_uint32 index = 0;
-      
-      bool isInteger = std::numeric_limits<T>::is_integer; // Flag to round or not.
-      
-      // Band loop:
-      for(ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         // First bin is always for null.
-         table[index++] = (T)getNullPixelValue(band);
-         
-         const ossim_float64 MIN_PIX = getMinPixelValue(band);
-         const ossim_float64 MAX_PIX = getMaxPixelValue(band);
-
-         for( ossim_uint32 bin = 1; bin < theTableBinCount; ++bin )
-         {
-            ossim_float64 p = MIN_PIX + bin - 1;
-
-#if 0 /* Please keep for debug. (drb) */
-            cout << "\ninput pix[" << bin << "]: " << p << endl;
-#endif
-            
-            // Loop through remaps:
-            std::vector<ossimRemapSet>::const_iterator i = m_bandRemap[band].m_remap.begin();
-            while ( i != m_bandRemap[band].m_remap.end() )
-            {
-               //---
-               // Each remap set holds a group of tuples for the band.
-               // Tuple format example: <min_in> <max_in> <min_out> <max_out>
-               //---
-               const ossim_uint32 TUPLES = (*i).m_set.size() / 4;
-               for ( ossim_uint32 set = 0; set < TUPLES; ++set )
-               {
-                  // Range check it:
-                  if ( ( p >= (*i).m_set[set*4] ) &&  // input min
-                       ( p <= (*i).m_set[set*4+1] ) ) // input max
-                  {
-                     //---
-                     // p = (p - output_min) * (output_max-output_min)/(input_max-input_min)
-                     // + output_min;
-                     //---
-                     p = (p - (*i).m_set[set*4]) *
-                        ((*i).m_set[set*4+3]-(*i).m_set[set*4+2]) /
-                        ((*i).m_set[set*4+1]-(*i).m_set[set*4]) +
-                        (*i).m_set[set*4];
-
-#if 0 /* Please keep for debug. (drb) */
-                     cout << "remapp_pix[" << bin << "][" << set << "]: " << p << endl;
-#endif
-                  }
-                  
-               } // End: TUPLE loop
-
-               ++i; // Next remap.
-
-            } // End: remap loop:
-
-            if ( isInteger )
-            {
-               p = ossim::round<ossim_float64>(p); // Round to integer correctly.
-            }
-            
-#if 0 /* Please keep for debug. (drb) */
-            cout << "output_pix[" << bin << "]: " << p << endl;
-#endif
-            
-            // Assign to table with min/max clip:
-            table[bin] = (T)( ( p >= MIN_PIX ) ? ( ( p <= MAX_PIX ) ? p : MAX_PIX ) : MIN_PIX);
-            
-         } // End: bin loop
-         
-      } // End: band loop
-      
-   } // Matches: if ( theTable.size() )
-
-#if 0 /* Please leave for debug. (drb) */
-   ossimTableRemapper::print( cout );
-#endif
-   
-} // End: template <class T> void ossimPiecewiseRemapper::buildLinearNativeTable(T dummy)
-
-void ossimPiecewiseRemapper::setupTable()
-{
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-   if ( BANDS )
-   {
-      ossim_uint32 values_per_band = 0;
-      ossim_uint32 bytes_per_pixel = 0;
-      
-      switch (theOutputScalarType)
-      {
-         case OSSIM_UINT8:
-            values_per_band = 256;  // 2 ^ 8
-            bytes_per_pixel = 1;
-            theTableType = ossimTableRemapper::NATIVE;
-            break;
-            
-         case OSSIM_USHORT11:
-            values_per_band = 2048; // 2 ^ 11
-            bytes_per_pixel = 2;
-            theTableType = ossimTableRemapper::NATIVE;
-            break;
-            
-         case OSSIM_UINT16:
-         case OSSIM_SINT16:
-            values_per_band = 65536; // 2 ^ 16
-            bytes_per_pixel = 2;
-            theTableType = ossimTableRemapper::NATIVE;
-            break;
-            
-         case OSSIM_UINT32:
-         case OSSIM_SINT32:
-            values_per_band = 65536; // 2 ^ 16
-            bytes_per_pixel = 4;
-            theTableType = ossimTableRemapper::NATIVE;
-            break;
-            
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_FLOAT:
-            bytes_per_pixel = 4;
-            break;
-            
-         case OSSIM_NORMALIZED_DOUBLE:         
-         case OSSIM_DOUBLE:
-            bytes_per_pixel = 8;
-            theTableType = ossimTableRemapper::NORMALIZED;
-            break;
-            
-         default:
-            break;
-      }
-   
-      theTableBinCount  = values_per_band;
-      theTableBandCount = BANDS;
-
-      ossim_uint32 size_in_bytes = values_per_band * BANDS * bytes_per_pixel;
-      theTable.resize(size_in_bytes);
-   }
-   
-} // End: ossimPiecwiseRemapper::getTableSize()
-
-// Private to disallow use...
-ossimPiecewiseRemapper::ossimPiecewiseRemapper(const ossimPiecewiseRemapper&)
-{
-}
-
-// Private to disallow use...
-ossimPiecewiseRemapper& ossimPiecewiseRemapper::operator=(const ossimPiecewiseRemapper&)
-{
-   return *this;
-}
-
-
-
diff --git a/ossim/src/ossim/imaging/ossimPixelFlipper.cpp b/ossim/src/ossim/imaging/ossimPixelFlipper.cpp
deleted file mode 100644
index 68f58b7..0000000
--- a/ossim/src/ossim/imaging/ossimPixelFlipper.cpp
+++ /dev/null
@@ -1,1143 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Filter to toggle pixel values.
-//
-//*************************************************************************
-// $Id: ossimPixelFlipper.cpp 21631 2012-09-06 18:10:55Z dburken $
-
-
-#include <ossim/imaging/ossimPixelFlipper.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <OpenThreads/ScopedLock>
-#include <cstdlib>
-
-RTTI_DEF1(ossimPixelFlipper, "ossimPixelFlipper", ossimImageSourceFilter)
-
-static ossimTrace traceDebug("ossimPixelFlipper:debug");
-
-const char ossimPixelFlipper::PF_TARGET_VALUE_KW[]      = "target_value";
-const char ossimPixelFlipper::PF_TARGET_RANGE_KW[]      = "target_range";
-const char ossimPixelFlipper::PF_REPLACEMENT_VALUE_KW[] = "replacement_value";
-const char ossimPixelFlipper::PF_REPLACEMENT_MODE_KW[]  = "replacement_mode";
-const char ossimPixelFlipper::PF_CLAMP_VALUE_KW[]       = "clamp_value"; // deprecated by clamp_value_hi
-const char ossimPixelFlipper::PF_CLAMP_VALUE_LO_KW[]    = "clamp_value_lo";
-const char ossimPixelFlipper::PF_CLAMP_VALUE_HI_KW[]    = "clamp_value_hi";
-const char ossimPixelFlipper::PF_CLIP_MODE_KW[]         = "border_clip_mode";
-
-static const char TARGET_LOWER_LIMIT_PROP_NAME[] = "target_range_lower_limit";
-static const char TARGET_UPPER_LIMIT_PROP_NAME[] = "target_range_upper_limit";
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimPixelFlipper.cpp 21631 2012-09-06 18:10:55Z dburken $";
-#endif
-
-ossimPixelFlipper::ossimPixelFlipper(ossimObject* owner)
-   :
-      ossimImageSourceFilter(owner),
-      theTargetValueLo(0.0),
-      theTargetValueHi(0.0),
-      theReplacementValue(1.0),
-      theReplacementMode(ossimPixelFlipper::REPLACE_BAND_IF_TARGET),
-      theClampValueLo(ossim::nan()),
-      theClampValueHi(ossim::nan()),
-      theClampingMode(DISABLED),
-      theClipMode(NONE)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPixelFlipper::ossimPixelFlipper entered...\n";
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << "\n";
-#endif      
-   }
-   
-   setDescription(ossimString("Pixel Flipper"));
-   enableSource();
-}
-
-ossimPixelFlipper::~ossimPixelFlipper()
-{}
-
-ossimRefPtr<ossimImageData> ossimPixelFlipper::getTile(
-   const ossimIrect& tile_rect, ossim_uint32 resLevel)
-{
-
-   if(!theInputConnection)
-   {
-      return 0;
-   }
-
-   // Fetch tile from pointer from the input source.
-   ossimRefPtr<ossimImageData> inputTile =
-      theInputConnection->getTile(tile_rect, resLevel);
-   
-   if (!inputTile.valid() || !isSourceEnabled()) return inputTile;
-   
-   if (!inputTile->getBuf()) return inputTile;
-   
-   // Lock for the length of this method.
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-   
-   // Call the appropriate load method.
-   switch (inputTile->getScalarType())
-   {
-      
-      case OSSIM_UCHAR:
-      {
-         flipPixels(ossim_uint8(0), inputTile.get(), resLevel);
-         break;
-      }
-      
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         flipPixels(ossim_uint16(0), inputTile.get(), resLevel);
-         break;
-      }
-      
-      case OSSIM_SSHORT16:
-      {
-         flipPixels(ossim_sint16(0), inputTile.get(), resLevel);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         flipPixels(ossim_uint32(0), inputTile.get(), resLevel);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         flipPixels(ossim_sint32(0), inputTile.get(), resLevel);
-         break;
-      }
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         flipPixels(float(0), inputTile.get(), resLevel);
-         break;
-      }
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_FLOAT64:
-      {
-         flipPixels(ossim_float64(0), inputTile.get(), resLevel);
-         break;
-      }
-      
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimPixelFlipper::getTile Unsupported scalar type!" << endl;
-         break;
-      }
-   }
-   
-   inputTile->validate();
-   return inputTile;
-}
-
-template <class T>
-void ossimPixelFlipper::flipPixels(T /* dummy */,
-                                   ossimImageData* inputTile,
-                                   ossim_uint32 resLevel)
-{
-   if (!inputTile) return;
-
-   T targetLo    = static_cast<T>(theTargetValueLo);
-   T targetHi    = static_cast<T>(theTargetValueHi);
-   T replacement = static_cast<T>(theReplacementValue);
-   T clampLo       = static_cast<T>(theClampValueLo);
-   T clampHi       = static_cast<T>(theClampValueHi);
-
-   // Get pointers to data for each band.
-   ossim_uint32 bands = inputTile->getNumberOfBands();
-   ossim_uint32 band;
-   T** buf = new T*[bands];
-   for(band=0; band<bands; ++band)
-      buf[band] = static_cast<T*>(inputTile->getBuf(band));
-
-   ossimIrect rect = inputTile->getImageRectangle();
-   ossimIpt ul = rect.ul();
-   ossimIpt lr = rect.lr();
-
-   // Check the relation between tile rect and the area of interest (either bounding rect or
-   // valid vertices polygons). If completely outside, we can return with empty buffer.get If
-   // partially inside, we'll need to test individual pixels.
-   bool is_outside_aoi = false;
-   bool needsTesting = false;
-   if ((theClipMode == BOUNDING_RECT) && (resLevel < theBoundingRects.size()))
-   {
-      if(!rect.intersects(theBoundingRects[resLevel]))
-         is_outside_aoi = true;
-      else
-         needsTesting = !rect.completely_within(theBoundingRects[resLevel]);
-   }
-   else if ((theClipMode == VALID_VERTICES) && (resLevel < theValidVertices.size()))
-   {
-      bool ulFlag = theValidVertices[resLevel].isPointWithin(rect.ul());
-      bool urFlag = theValidVertices[resLevel].isPointWithin(rect.ur());
-      bool lrFlag = theValidVertices[resLevel].isPointWithin(rect.lr());
-      bool llFlag = theValidVertices[resLevel].isPointWithin(rect.ll());
-      if((!ulFlag) && (!urFlag) && (!lrFlag) && (!llFlag))
-         is_outside_aoi = true;
-      else
-         needsTesting = !(ulFlag && urFlag && lrFlag && llFlag);
-   }
-   if (is_outside_aoi)
-   {
-      // none of the tile is inside so just return with empty tile:
-      delete [] buf;
-      return; 
-   }
-
-   ossim_uint32 i = 0;  // index into band buffers;
-   ossimIpt pixel_loc; 
-   bool can_replace, found_candidate;
-
-   // Begin loop over each pixel in the tile. The individual bands are handled inside this loop:
-   for(pixel_loc.y = ul.y; pixel_loc.y <= lr.y; ++pixel_loc.y)
-   {
-      for(pixel_loc.x = ul.x; pixel_loc.x <= lr.x; ++pixel_loc.x)
-      {
-         // First consider if we need to test the pixel for border clipping:
-         if (needsTesting)
-         {
-            bool is_inside = true; // Assume it will pass the border test
-            if (theClipMode == BOUNDING_RECT)
-               is_inside = theBoundingRects[resLevel].pointWithin(pixel_loc);
-            else if (theClipMode == VALID_VERTICES)
-               is_inside = theValidVertices[resLevel].isPointWithin(pixel_loc);
-
-            if (!is_inside)
-            {
-               // Remap this pixel to the replacement value (all bands)
-               for (band=0; band<bands; ++band)
-                  buf[band][i] = replacement;
-
-               // Proceed to next pixel location:
-               ++i;
-               continue; 
-            }
-         }
-
-         // If clamping specified, the target replacement function is disabled:
-         if (theClampingMode)
-         {
-            switch (theReplacementMode)
-            {
-            case REPLACE_BAND_IF_TARGET:
-            case REPLACE_ALL_BANDS_IF_ANY_TARGET:
-               for (band=0; band<bands; ++band)
-               {
-                  if (!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo))
-                     buf[band][i] = clampLo;
-                  else if (!ossim::isnan(theClampValueHi) && (buf[band][i] > clampHi))
-                     buf[band][i] = clampHi;
-               }
-               break;
-
-            case REPLACE_BAND_IF_PARTIAL_TARGET: 
-            case REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
-               // First band loop to establish if pixel qualifies for replacement (at least one 
-               // band must be valid):
-               can_replace = false;
-               found_candidate = false;
-               for (band=0; (band < bands) && !(can_replace && found_candidate); ++band)
-               {
-                  if ((!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo)) ||
-                     (!ossim::isnan(theClampValueHi) && (buf[band][i] > clampHi)))
-                     found_candidate = true;
-                  else
-                     can_replace = true;
-               }
-               if (can_replace && found_candidate)
-               {
-                  // This pixel has at least one band with normal value, so need to rescan bands
-                  // to find pixels that need replacing (are within the target range):
-                  for (band=0; band<bands; ++band)
-                  {
-                     if (!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo))
-                        buf[band][i] = clampLo;
-                     else if (!ossim::isnan(theClampValueHi) && buf[band][i] > clampHi)
-                        buf[band][i] = clampHi;
-                  }
-               }
-               break;
-
-            case REPLACE_ONLY_FULL_TARGETS:
-               // First band loop to establish if pixel qualifies for replacement (all 
-               // bands must be in target range):
-               can_replace = true;
-               for (band=0; (band < bands) && can_replace; ++band)
-               {
-                  if ((ossim::isnan(theClampValueLo) || (buf[band][i] >= clampLo)) &&
-                      (ossim::isnan(theClampValueHi) || (buf[band][i] <= clampHi)))
-                     can_replace = false;
-               }
-               if (can_replace)
-               {
-                  // Map all pixels to replacement value: 
-                  for (band=0; band<bands; ++band)
-                  {
-                     if (!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo))
-                        buf[band][i] = clampLo;
-                     else if (!ossim::isnan(theClampValueHi) && buf[band][i] > clampHi)
-                        buf[band][i] = clampHi;
-                  }
-               }
-               break;
-            } // close switch
-
-            // Proceed to next pixel location:
-            ++i;
-            continue; 
-         }
-
-         // If we got here (the continue statement was not reached) then
-         // the pixel value now needs to be checked for possible target replacement:
-         switch (theReplacementMode)
-         {
-         case REPLACE_BAND_IF_TARGET:
-            for (band=0; band<bands; ++band)
-            {
-               if ((buf[band][i] >= targetLo) && (buf[band][i] <=targetHi)) 
-                  buf[band][i] = theReplacementValue;
-            }
-            break;
-
-         case REPLACE_BAND_IF_PARTIAL_TARGET: 
-
-            // First band loop to establish if pixel qualifies for replacement (at least one 
-            // band must be valid):
-            can_replace = false;
-            found_candidate = false;
-            for (band=0; (band < bands) && !(can_replace && found_candidate); ++band)
-            {
-               //  check for target range replacement qualification:
-               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
-                  can_replace = true; // Has valid band
-               else
-                  found_candidate = true; // found band within target range
-            }
-            if (can_replace && found_candidate)
-            {
-               // This pixel has at least one band with normal value, so need to rescan bands
-               // to find pixels that need replacing (are within the target range):
-               for (band=0; band<bands; ++band)
-               {
-                  if ((buf[band][i] >= targetLo) && (buf[band][i] <= targetHi)) 
-                     buf[band][i] = theReplacementValue;
-               }
-            }
-            break;
-
-         case REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
-
-            // First band loop to establish if pixel qualifies for replacement (at least one 
-            // band must be valid):
-            can_replace = false;
-            found_candidate = false;
-            for (band=0; (band < bands) && !(can_replace && found_candidate); ++band)
-            {
-               // check for target range replacement qualification:
-               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
-                  can_replace = true;
-               else
-                  found_candidate = true;
-            }
-            if (can_replace && found_candidate)
-            {
-               // This pixel has at least one band with normal value and one with target, so 
-               // map all bands to target:
-               for (band=0; band<bands; ++band)
-                  buf[band][i] = theReplacementValue;
-            }
-            break;
-
-         case REPLACE_ONLY_FULL_TARGETS:
-
-            // First band loop to establish if pixel qualifies for replacement (all 
-            // bands must be in target range):
-            can_replace = true;
-            for (band=0; (band < bands) && can_replace; ++band)
-            {
-               // check for target range replacement qualification:
-               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
-                  can_replace = false;
-            }
-            if (can_replace)
-            {
-               // Map all pixels to replacement value: 
-               for (band=0; band<bands; ++band)
-                  buf[band][i] = theReplacementValue;
-            }
-            break;
-
-         case REPLACE_ALL_BANDS_IF_ANY_TARGET:
-
-            // First band loop to establish if pixel qualifies for replacement (all 
-            // bands must be in target range):
-            can_replace = false;
-            for (band=0; (band < bands) && !can_replace; ++band)
-            {
-               // check for target range replacement qualification:
-               if ((buf[band][i] >= targetLo) && (buf[band][i] <= targetHi))
-                  can_replace = true;
-            }
-            if (can_replace)
-            {
-               // Map all pixels to replacement value: 
-               for (band=0; band<bands; ++band)
-                  buf[band][i] = theReplacementValue;
-            }
-            break;
-         } // close switch
-
-         // Reached end of processing for one pixel location. Increment the band buffers index:
-         ++i;
-      } // end of loop over pixel_loc.x
-   } // end of loop over pixel_loc.y
-   
-   delete [] buf;
-   inputTile->validate();
-}
-
-template <class T> void ossimPixelFlipper::clipTile(T /* dummy */,
-                                                    ossimImageData* inputTile,
-                                                    ossim_uint32 resLevel)
-{
-   if(theClipMode == NONE)
-   {
-      theClipTileBuffer = 0;
-      return;
-   }
-   if(!inputTile) return;
-   if(!inputTile->getBuf()||
-      (inputTile->getDataObjectStatus() == OSSIM_EMPTY))
-   {
-      return;
-   }
-   allocateClipTileBuffer(inputTile);
-
-
-   if(theClipTileBuffer.valid())
-   {
-      ossimIrect tileRect = inputTile->getImageRectangle();
-      // force to all nulls
-      theClipTileBuffer->setDataObjectStatus(OSSIM_FULL);
-      theClipTileBuffer->makeBlank();
-      
-      switch(theClipMode)
-      {
-         case NONE:
-         {
-            break;
-         }
-         case BOUNDING_RECT:
-         {
-            if(resLevel < theBoundingRects.size())
-            {
-               if(tileRect.completely_within(theBoundingRects[resLevel])||
-                  theBoundingRects[resLevel].hasNans())
-               {
-                  return;
-               }
-               else
-               {
-                  if(tileRect.intersects(theBoundingRects[resLevel]))
-                  {
-                     ossimIrect clipRect = tileRect.clipToRect(theBoundingRects[resLevel]);
-
-                     theClipTileBuffer->setImageRectangle(clipRect);
-                     
-                     theClipTileBuffer->loadTile(inputTile);
-                     inputTile->makeBlank();
-                     inputTile->loadTile(theClipTileBuffer.get());
-                     inputTile->validate();
-                  }
-                  else
-                  {
-                     inputTile->makeBlank();
-                  }
-               }
-            }
-            break;
-         }
-         case VALID_VERTICES:
-         {
-            if(resLevel < theValidVertices.size())
-            {
-               const ossimPolygon& p = theValidVertices[resLevel];
-               bool ulWithin = p.isPointWithin(tileRect.ul());
-               bool urWithin = p.isPointWithin(tileRect.ur());
-               bool lrWithin = p.isPointWithin(tileRect.lr());
-               bool llWithin = p.isPointWithin(tileRect.ll());
-               
-               if(ulWithin&&
-                  urWithin&&
-                  lrWithin&&
-                  llWithin)
-               {
-                  return;
-               }
-               else if(!(ulWithin|| // if none are in
-                         urWithin||
-                         lrWithin||
-                         llWithin))
-               {
-                  inputTile->makeBlank();
-                  return;
-               }
-               else
-               {
-                  ossimIpt ul = tileRect.ul();
-                  ossimIpt origin;
-                  ossim_uint32 x = 0;
-                  ossim_uint32 y = 0;
-                  ossim_uint32 w = inputTile->getWidth();
-                  ossim_uint32 h = inputTile->getHeight();
-                  ossim_uint32 offset = 0;
-                  origin.y = ul.y;
-                  for(y = 0; y < h; ++y)
-                  {
-                     origin.x = ul.x;
-                     for(x = 0; x < w; ++x)
-                     {
-                        if(!p.isPointWithin(origin))
-                        {
-                           inputTile->setNull(offset);
-                        }
-                        ++offset;
-                        ++origin.x;
-                     }
-                     ++origin.y;
-                  }
-               }
-            }
-            break;
-         }
-      }
-   }
-}
-
-
-void ossimPixelFlipper::allocateClipTileBuffer(ossimRefPtr<ossimImageData> inputImage)
-{
-   if(inputImage.valid())
-   {
-      bool needDupFlag = false;
-      if(theClipTileBuffer.valid())
-      {
-         if((theClipTileBuffer->getScalarType() != inputImage->getScalarType())||
-            theClipTileBuffer->getNumberOfBands() != theClipTileBuffer->getNumberOfBands())
-         {
-            needDupFlag = true;
-         }
-         else
-         {
-            theClipTileBuffer->setImageRectangle(inputImage->getImageRectangle());
-         }
-      }
-      else
-      {
-         needDupFlag = true;
-      }
-      if(needDupFlag)
-      {
-         theClipTileBuffer = (ossimImageData*)inputImage->dup();
-      }
-   }
-}
-
-void ossimPixelFlipper::initialize()
-{
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-   ossimImageSourceFilter::initialize();
-   theValidVertices.clear();
-   theBoundingRects.clear();
-
-   ossim_uint32 rlevels = getNumberOfDecimationLevels();
-   ossim_uint32 idx = 0;
-
-   if(rlevels)
-   {
-      if(theValidVertices.size() != rlevels)
-      {
-         theValidVertices.resize(rlevels);
-      }
-      if(theBoundingRects.size() != rlevels)
-      {
-         theBoundingRects.resize(rlevels);
-      }
-      for(idx = 0; idx < rlevels; ++idx)
-      {
-         std::vector<ossimIpt> validVertices;
-         getValidImageVertices(validVertices,
-                               OSSIM_CLOCKWISE_ORDER,
-                               idx);
-         theValidVertices[idx] = ossimPolygon(validVertices);
-         theBoundingRects[idx] = getBoundingRect(idx);
-      }
-   }
-}
-
-ossimScalarType ossimPixelFlipper::getOutputScalarType() const
-{
-   if(theInputConnection)
-   {
-      ossimScalarType scalar = theInputConnection->getOutputScalarType();
-      {
-         if (scalar == OSSIM_USHORT16 && theClampValueHi == 2047.0)
-         {
-            //---
-            // Special case:
-            // We have an unsigned 16 bit type but we want to call it
-            // USHORT11 ( (2^11- 1) = 2047 ).
-            //---
-            return OSSIM_USHORT11;
-         }
-         return scalar;
-      }
-   }
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-ossim_float64 ossimPixelFlipper::getMaxPixelValue (ossim_uint32 band) const
-{
-   const ossim_float64 MIN = ossimImageSourceFilter::getMinPixelValue(band);
-   const ossim_float64 MAX = ossimImageSourceFilter::getMaxPixelValue(band);
-
-   if ((theClampValueHi > MIN) && (theClampValueHi < MAX))
-      return theClampValueHi;
-
-   return MAX;
-}
-
-ossim_float64 ossimPixelFlipper::getMinPixelValue (ossim_uint32 band) const
-{
-   const ossim_float64 MIN = ossimImageSourceFilter::getMinPixelValue(band);
-   const ossim_float64 MAX = ossimImageSourceFilter::getMaxPixelValue(band);
-
-   if ((theClampValueLo > MIN) && (theClampValueLo < MAX))
-      return theClampValueLo;
-
-   return MIN;
-}
-
-bool ossimPixelFlipper::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix)
-{
-   const char* lookupReturn;
-   
-   lookupReturn = kwl.find(prefix, PF_TARGET_VALUE_KW);
-   if(lookupReturn)
-   {
-      setTargetValue(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(prefix, PF_TARGET_RANGE_KW);
-   if(lookupReturn)
-   {
-      ossimString min_max_string (lookupReturn);
-      ossimString separator (" ");
-      ossim_float64 min_target = min_max_string.before(separator).toFloat64();
-      ossim_float64 max_target = min_max_string.after(separator).toFloat64();
-      setTargetRange(min_target, max_target);
-   }
-
-   lookupReturn = kwl.find(prefix, PF_REPLACEMENT_VALUE_KW);
-   if(lookupReturn)
-   {
-      setReplacementValue(atof(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(prefix, PF_REPLACEMENT_MODE_KW);
-   if(lookupReturn)
-   {
-      ossimString modeString = lookupReturn;
-      setReplacementMode(modeString);
-   }
-
-   lookupReturn = kwl.find(prefix, PF_CLAMP_VALUE_KW);
-   if(lookupReturn)
-   {
-      setClampValue(atof(lookupReturn), true);
-   }
-
-   lookupReturn = kwl.find(prefix, PF_CLAMP_VALUE_LO_KW);
-   if(lookupReturn)
-   {
-      setClampValue(atof(lookupReturn), false);
-   }
-
-   lookupReturn = kwl.find(prefix, PF_CLAMP_VALUE_HI_KW);
-   if(lookupReturn)
-   {
-      setClampValue(atof(lookupReturn), true);
-   }
-
-   lookupReturn = kwl.find(prefix, PF_CLIP_MODE_KW);
-   if(lookupReturn)
-   {
-      ossimString modeString = lookupReturn;
-      setClipMode(modeString);
-   }
-
-   bool status = ossimImageSourceFilter::loadState(kwl, prefix);
-
-   if (traceDebug())
-   {
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-
-   return status;
-}
-
-bool ossimPixelFlipper::saveState(ossimKeywordlist& kwl,
-                                 const char* prefix) const
-{
-   // Call the base class saveState.
-   ossimImageSourceFilter::saveState(kwl, prefix);
-
-   if (theTargetValueHi != theTargetValueLo)
-   {
-      ossimString s (ossimString::toString(theTargetValueLo) + " " + 
-         ossimString::toString(theTargetValueHi));
-      kwl.add(prefix, PF_TARGET_RANGE_KW, s);
-   }
-   else
-   {
-      kwl.add(prefix, PF_TARGET_VALUE_KW, theTargetValueLo);
-   }
-   kwl.add(prefix, PF_REPLACEMENT_VALUE_KW, theReplacementValue);
-   kwl.add(prefix, PF_REPLACEMENT_MODE_KW,  getReplacementModeString().c_str());
-
-   if (theClampingMode)
-   {
-      kwl.add(prefix, PF_CLAMP_VALUE_LO_KW,    theClampValueLo);
-      kwl.add(prefix, PF_CLAMP_VALUE_HI_KW,    theClampValueHi);
-   }
-   kwl.add(prefix, PF_CLIP_MODE_KW,  getClipModeString().c_str());
-
-   return true;
-}
-
-void ossimPixelFlipper::setTargetValue(ossim_float64 target_value)
-{
-   //---
-   // Since this is the value to replace we will allow for any value as it
-   // won't affect the output null, min and max ranges.  This will fix a
-   // tiled nitf with max of 2047(11bit) with edge tile fill values of 2048.
-   //---
-   OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-
-   theTargetValueLo = target_value;
-   theTargetValueHi = target_value; 
-}
-
-void ossimPixelFlipper::setTargetRange(ossim_float64 target_min, ossim_float64 target_max)
-{
-   //---
-   // Since this is the value to replace we will allow for any value as it
-   // won't affect the output null, min and max ranges.  This will fix a
-   // tiled nitf with max of 2047(11bit) with edge tile fill values of 2048.
-   //---
-   OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-
-   theTargetValueLo = target_min;
-   theTargetValueHi = target_max; 
-}
-
-void ossimPixelFlipper::setReplacementValue(ossim_float64 replacement_value)
-{
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-
-   // Range check to ensure within null, min and max of output radiometry.
-   if (inRange(replacement_value))
-   {
-      theReplacementValue = replacement_value;
-   }
-}
-
-void ossimPixelFlipper::setClampValue(ossim_float64 clamp_value, bool clamp_max_value)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-
-   if (inRange(clamp_value))
-   {
-      // Stupid MS compiler complains if we do an |= on enum type. (OLK 1/11)
-      int temp_int = (int) theClampingMode;
-      if (clamp_max_value)
-      {
-         theClampValueHi = clamp_value;
-         temp_int |= (int) CLAMPING_HI;
-      }
-      else
-      {
-         theClampValueLo = clamp_value;
-         temp_int |= (int) CLAMPING_LO;
-      }
-      theClampingMode = (ClampingMode) temp_int;
-   }
-}
-
-void ossimPixelFlipper::setClampValues(ossim_float64 clamp_value_lo, ossim_float64 clamp_value_hi)
-{
-   theClampingMode = DISABLED; // reset and let next calls set accordingly
-   setClampValue(clamp_value_lo, false);
-   setClampValue(clamp_value_hi, true);
-}
-
-void ossimPixelFlipper::setReplacementMode(ossimPixelFlipper::ReplacementMode mode)
-{
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-   theReplacementMode = mode;
-}
-
-bool ossimPixelFlipper::setReplacementMode(const ossimString& modeString)
-{
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-
-   ossimString mode = modeString;
-   mode.upcase();
-   if (mode == "REPLACE_BAND_IF_TARGET")
-   {
-      theReplacementMode = REPLACE_BAND_IF_TARGET;
-   }
-   else if (mode == "REPLACE_BAND_IF_PARTIAL_TARGET")
-   {
-      theReplacementMode = REPLACE_BAND_IF_PARTIAL_TARGET;
-   }
-   else if (mode == "REPLACE_ALL_BANDS_IF_PARTIAL_TARGET")
-   {
-      theReplacementMode = REPLACE_ALL_BANDS_IF_PARTIAL_TARGET;
-   }
-   else if (mode == "REPLACE_ONLY_FULL_TARGETS")
-   {
-      theReplacementMode = REPLACE_ONLY_FULL_TARGETS;
-   }
-   else if (mode == "REPLACE_ALL_BANDS_IF_ANY_TARGET")
-   {
-      theReplacementMode = REPLACE_ALL_BANDS_IF_ANY_TARGET;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimPixelFlipper::setReplacementMode warning:\n"
-         << "Invalid mode:  " << modeString
-         << endl;
-      return false;
-   }
-   return true;
-}
-
-void ossimPixelFlipper::setClipMode(ossimPixelFlipper::ClipMode mode)
-{
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-   theClipMode = mode;
-}
-
-void ossimPixelFlipper::setClipMode(const ossimString& modeString)
-{
-   ossimString mode = modeString;
-   mode.downcase();
-   if (mode == "none")
-   {
-      setClipMode(NONE);
-   }
-   else if (mode == "bounding_rect")
-   {
-      setClipMode(BOUNDING_RECT);
-   }
-   else if (mode == "valid_vertices")
-   {
-      setClipMode(VALID_VERTICES);
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimPixelFlipper::setClipMode warning:\n"
-         << "Invalid mode:  " << modeString
-         << endl;
-   }
-}
-
-//ossim_float64 ossimPixelFlipper::getTargetValue() const
-//{
-//   return theTargetValueLo;
-//}
-
-ossim_float64 ossimPixelFlipper::getReplacementValue() const
-{
-   return theReplacementValue;
-}
-
-ossimPixelFlipper::ReplacementMode ossimPixelFlipper::getReplacementMode()  const
-{
-   return theReplacementMode;
-}
-   
-ossimString ossimPixelFlipper::getReplacementModeString()  const
-{
-   switch(theReplacementMode)
-   {
-      case REPLACE_BAND_IF_TARGET:
-         return ossimString("REPLACE_BAND_IF_TARGET");
-      case REPLACE_BAND_IF_PARTIAL_TARGET:
-         return ossimString("REPLACE_BAND_IF_PARTIAL_TARGET");
-      case REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
-         return ossimString("REPLACE_ALL_BANDS_IF_PARTIAL_TARGET");
-      case REPLACE_ONLY_FULL_TARGETS:
-         return ossimString("REPLACE_ONLY_FULL_TARGETS");
-      case REPLACE_ALL_BANDS_IF_ANY_TARGET:
-         return ossimString("REPLACE_ALL_BANDS_IF_ANY_TARGET");
-      default:
-         break;
-   }
-
-   return ossimString("UNKNOWN_MODE");
-}
-
-ossimString ossimPixelFlipper::getClipModeString()  const
-{
-   if (theClipMode == BOUNDING_RECT)
-      return ossimString("bounding_rect");
-
-   if (theClipMode == VALID_VERTICES)
-      return ossimString("valid_vertices");
-
-   return ossimString("none");
-}
-
-ossimPixelFlipper::ClipMode ossimPixelFlipper::getClipMode() const
-{
-   return theClipMode;
-}
-
-std::ostream& ossimPixelFlipper::print(std::ostream& out) const
-{
-   out << "ossimPixelFlipper::print:"
-       << "\ntarget value Lo:    " << theTargetValueLo
-       << "\ntarget value Hi:    " << theTargetValueHi
-       << "\nreplacement value:  " << theReplacementValue
-       << "\nclamp value Lo:     " << theClampValueLo
-       << "\nclamp value Hi:     " << theClampValueHi
-       << "\nreplacement mode:   " << getReplacementModeString().c_str()
-       << "\nclip_mode:          " << getClipModeString().c_str()
-      << endl;
-   return out;
-}
-
-ossimRefPtr<ossimProperty> ossimPixelFlipper::getProperty(
-   const ossimString& name)const
-{
-   // Lock for the length of this method.
-	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
-
-   if (name == PF_TARGET_VALUE_KW)
-   {
-      ossimProperty* p =
-         new ossimNumericProperty(name,
-         ossimString::toString(theTargetValueLo));
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   if (name == PF_TARGET_RANGE_KW)
-   {
-      ossimProperty* p =
-         new ossimNumericProperty(name,
-         ossimString::toString(theTargetValueLo));
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   if (name == TARGET_UPPER_LIMIT_PROP_NAME)
-   {
-      ossimProperty* p =
-         new ossimNumericProperty(name,
-         ossimString::toString(theTargetValueHi));
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   else if (name == PF_REPLACEMENT_VALUE_KW)
-   {
-      ossimProperty* p =
-         new ossimNumericProperty(name,
-                                  ossimString::toString(theReplacementValue));
-       p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   else if (name == PF_CLAMP_VALUE_LO_KW)
-   {
-      ossimProperty* p =
-         new ossimNumericProperty(name, ossimString::toString(theClampValueLo));
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   else if (name == PF_CLAMP_VALUE_HI_KW)
-   {
-      ossimProperty* p =
-         new ossimNumericProperty(name, ossimString::toString(theClampValueHi));
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   else if (name == PF_REPLACEMENT_MODE_KW)
-   {
-      vector<ossimString> constraintList(5);
-      constraintList[0] = "REPLACE_BAND_IF_TARGET";
-      constraintList[1] = "REPLACE_BAND_IF_PARTIAL_TARGET";
-      constraintList[2] = "REPLACE_ALL_BANDS_IF_PARTIAL_TARGET";
-      constraintList[3] = "REPLACE_ONLY_FULL_TARGETS";
-      constraintList[4] = "REPLACE_ALL_BANDS_IF_ANY_TARGET";
-      
-      ossimStringProperty* p =
-         new ossimStringProperty(name,
-                                 getReplacementModeString(),
-                                 false,
-                                 constraintList);
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   else if (name == PF_CLIP_MODE_KW)
-   {
-      vector<ossimString> constraintList(3);
-      constraintList[0] = "none";
-      constraintList[1] = "bounding_rect";
-      constraintList[2] = "valid_vertices";
-      
-      ossimStringProperty* p =
-         new ossimStringProperty(name,
-                                 getClipModeString(),
-                                 false,
-                                 constraintList);
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   ossimRefPtr<ossimProperty> result = ossimSource::getProperty(name);
-
-   if(result.valid())
-   {
-      if(result->getName() == ossimKeywordNames::ENABLED_KW)
-      {
-         result->clearChangeType();
-         
-         // we will at least say its a radiometric change
-         //
-         result->setCacheRefreshBit();
-      }
-   }
-
-   return result;
-}
-
-void ossimPixelFlipper::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if (!property) return;
-
-   ossimString os = property->valueToString();
-   
-   ossimString name = property->getName();
-   if (name == PF_TARGET_VALUE_KW)
-   {
-      setTargetValue(os.toDouble());
-   }
-   if (name == TARGET_LOWER_LIMIT_PROP_NAME)
-   {
-      setTargetRange(os.toDouble(), theTargetValueHi);
-   }
-   if (name == TARGET_UPPER_LIMIT_PROP_NAME)
-   {
-      setTargetRange(theTargetValueLo, os.toDouble());
-   }
-   else if  (name == PF_REPLACEMENT_VALUE_KW)
-   {
-      setReplacementValue(os.toDouble());
-   }
-   else if  (name == PF_REPLACEMENT_MODE_KW)
-   {
-      setReplacementMode(os);
-   }
-   else if  (name == PF_CLAMP_VALUE_LO_KW)
-   {
-      setClampValue(os.toDouble(), false);
-   }
-   else if  (name == PF_CLAMP_VALUE_HI_KW)
-   {
-      setClampValue(os.toDouble(), true);
-   }
-   else if  (name == PF_CLIP_MODE_KW)
-   {
-      setClipMode(os);
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-void ossimPixelFlipper::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(PF_TARGET_VALUE_KW);
-   propertyNames.push_back(TARGET_LOWER_LIMIT_PROP_NAME);
-   propertyNames.push_back(TARGET_UPPER_LIMIT_PROP_NAME);
-   propertyNames.push_back(PF_REPLACEMENT_VALUE_KW);
-   propertyNames.push_back(PF_REPLACEMENT_MODE_KW);
-   propertyNames.push_back(PF_CLAMP_VALUE_LO_KW);
-   propertyNames.push_back(PF_CLAMP_VALUE_HI_KW);
-   propertyNames.push_back(PF_CLIP_MODE_KW);
-   
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-}
-
-ossimString ossimPixelFlipper::getShortName()const
-{
-   return ossimString("Pixel flipper");
-}
-
-bool ossimPixelFlipper::inRange(ossim_float64 value) const
-{
-   if (!theInputConnection)
-   {
-      //---
-      // Not initialized yet...  We're going to return true so that things
-      // like loadState work with the assumption that the caller know's
-      // the correct range.  This check is really intended for an uncheck
-      // range on the gui side.
-      //---
-      return true;
-   }
-   
-   const ossim_float64 NULL_PIX = ossimImageSourceFilter::getNullPixelValue();
-   const ossim_float64 MIN_PIX  = ossimImageSourceFilter::getMinPixelValue();
-   const ossim_float64 MAX_PIX  = ossimImageSourceFilter::getMaxPixelValue();
-
-   if ( (value == NULL_PIX) || ((value >= MIN_PIX) && (value <= MAX_PIX)) )
-   {
-      return true;
-   }
-
-   ossimNotify(ossimNotifyLevel_WARN)
-      << "\nossimPixelFlipper::inRange WARNING:"
-      << "\nvalue \"" << value
-      << "\" is out of range!"
-      << "\nInput source null = " << NULL_PIX
-      << "\nInput source min  = " << MIN_PIX
-      << "\nInput source max  = " << MAX_PIX
-      << endl;
-
-   return false;
-}
diff --git a/ossim/src/ossim/imaging/ossimPolyCutter.cpp b/ossim/src/ossim/imaging/ossimPolyCutter.cpp
deleted file mode 100644
index 33a5231..0000000
--- a/ossim/src/ossim/imaging/ossimPolyCutter.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimPolyCutter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimPolyCutter.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimRgbImage.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimActiveEdgeTable.h>
-static const char* NUMBER_POLYGONS_KW = "number_polygons";
-
-RTTI_DEF1(ossimPolyCutter, "ossimPolyCutter", ossimImageSourceFilter)
-
-ossimPolyCutter::ossimPolyCutter()
-   : ossimImageSourceFilter(),
-     theTile(NULL),
-     theCutType(OSSIM_POLY_NULL_OUTSIDE),
-     m_boundingOverwrite(false)
-{
-   thePolygonList.push_back(ossimPolygon());
-   theBoundingRect.makeNan();
-}
-
-// ossimPolyCutter::ossimPolyCutter(ossimImageSource* inputSource,
-//                                  ossimPolyArea2d* polygon)
-ossimPolyCutter::ossimPolyCutter(ossimImageSource* inputSource,
-                                 const ossimPolygon& polygon)
-   : ossimImageSourceFilter(inputSource),
-     theTile(NULL),
-     theCutType(OSSIM_POLY_NULL_INSIDE),
-     m_boundingOverwrite(false)
-{
-   thePolygonList.push_back(polygon);
-   computeBoundingRect();
-   initialize();
-}
-
-ossimPolyCutter::~ossimPolyCutter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimPolyCutter::getTile(const ossimIrect& tileRect,
-                                                     ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return theTile;
-   }
-   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(tileRect,
-                                                                   resLevel);
-   
-   if(!isSourceEnabled() || theBoundingRect.hasNans() || !input.valid())
-   {
-      return input;
-   }
-   
-   if((input->getDataObjectStatus() == OSSIM_EMPTY) ||
-      (input->getDataObjectStatus() == OSSIM_NULL))
-   {
-      return input;
-   }
-
-   if(!theTile.valid())
-   {
-      allocate(); // First time through...
-   }
-
-   if(!theTile.valid())
-   {
-      return input;
-   }
-   
-   theTile->setImageRectangle(tileRect);
-   
-   theTile->loadTile(input.get());
-   theTile->setDataObjectStatus(input->getDataObjectStatus());
-   vector<ossimPolygon>* polyList = &thePolygonList;
-   vector<ossimPolygon>  scaledPoly;
-   
-   ossimIrect boundingRect = getBoundingRect(resLevel);
-   if(resLevel)
-   {
-      ossimDpt decimation;
-      getDecimationFactor(resLevel, decimation);
-
-      if(!decimation.hasNans())
-      {
-         for(int polyIndex = 0;
-             polyIndex < (int)thePolygonList.size();
-             ++polyIndex)
-         {
-            scaledPoly.push_back(thePolygonList[polyIndex]*decimation);
-         }
-         polyList = &scaledPoly;
-      }
-   }
-   
-   if(polyList->size()&&
-      theTile->getDataObjectStatus()!=OSSIM_NULL)
-   {
-//       ossimActiveEdgeTable aet;
-      
-      
-      if(theCutType == OSSIM_POLY_NULL_OUTSIDE)
-      {
-         if(boundingRect.intersects(tileRect))
-         {
-            theTile->makeBlank();
-            theHelper.setImageData(theTile.get());
-            for(int polyIndex = 0; polyIndex < (int)polyList->size(); ++polyIndex)
-            {
-               theHelper.copyInputToThis(input->getBuf(),
-                                      (*polyList)[polyIndex]);
-            }
-            theTile->validate();
-         }
-         else
-         {
-            theTile->makeBlank();
-         }
-      }
-      else if(theCutType == OSSIM_POLY_NULL_INSIDE)
-      {
-         if(boundingRect.intersects(tileRect))
-         {
-            theHelper.setImageData(theTile.get());
-            for(int polyIndex = 0;
-                polyIndex < (int)polyList->size();
-                ++polyIndex)
-            {
-               theHelper.fill(theTile->getNullPix(),
-                           (*polyList)[polyIndex]);
-            }
-         }
-         theTile->validate();
-      }
-      
-   }
-   return theTile;
-}
-
-ossimIrect ossimPolyCutter::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimIrect result;
-
-   result.makeNan();
-   if(!theInputConnection)
-   {
-      return result;
-   }
-   if(!isSourceEnabled())
-   {
-      return ossimImageSourceFilter::getBoundingRect(resLevel);
-   }
-   
-   result = theInputConnection->getBoundingRect(resLevel);
-
-   if(isSourceEnabled()&&(!theBoundingRect.hasNans()))
-   {
-      if(theCutType == OSSIM_POLY_NULL_OUTSIDE)
-      {
-         ossimDpt decimation;
-         getDecimationFactor(resLevel, decimation);
-         if(decimation.hasNans())
-         {
-            result =  theBoundingRect;
-         }
-         else
-         {
-            result = theBoundingRect*decimation;
-         }
-      }
-   }
-   else if(isSourceEnabled())
-   {
-      return theBoundingRect;
-   }
-   
-   return result;
-}
-
-void ossimPolyCutter::initialize()
-{
-   // Capture the input connection.
-   ossimImageSourceFilter::initialize();
-
-   // Force an allocate on next getTile.
-   theTile = NULL;
-}
-
-void ossimPolyCutter::allocate()
-{
-   theTile=NULL;
-   if(theInputConnection)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,
-                                                          theInputConnection);
-      theTile->initialize();
-
-   }
-}
-
-bool ossimPolyCutter::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   ossimString newPrefix = prefix;
-
-   for(int i = 0; i < (int)thePolygonList.size();++i)
-   {
-      newPrefix = ossimString(prefix) + "polygon" + ossimString::toString(i)+".";
-
-      thePolygonList[i].saveState(kwl, newPrefix.c_str());
-   }
-   kwl.add(prefix,
-           NUMBER_POLYGONS_KW,
-           (int)thePolygonList.size(),
-           true);
-   
-   ossimString fillType = "null_inside";
-   if(theCutType == OSSIM_POLY_NULL_OUTSIDE)
-   {
-      fillType = "null_outside";
-   }
-   kwl.add(prefix,
-           "cut_type",
-           fillType.c_str(),
-           true);   
-  
-   return ossimImageSourceFilter::saveState(kwl, prefix);;
-}
-
-bool ossimPolyCutter::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   const char* numberPolygons = kwl.find(prefix, NUMBER_POLYGONS_KW);
-
-   ossimString newPrefix;
-   if(numberPolygons)
-   {
-      thePolygonList.clear();
-      int npolys = ossimString(numberPolygons).toLong();
-      for(int i = 0; i < npolys;++i)
-      {
-         thePolygonList.push_back(ossimPolygon());
-         
-         newPrefix = ossimString(prefix) + "polygon" + ossimString::toString(i)+".";
-         
-         thePolygonList[i].loadState(kwl, newPrefix.c_str());
-      }
-   }
-
-   const char* lookup = kwl.find(prefix,
-                                 "cut_type");
-   if(lookup)
-   {
-      theCutType = OSSIM_POLY_NULL_INSIDE;
-      ossimString test = lookup;
-      if(test == "null_outside")
-      {
-         theCutType = OSSIM_POLY_NULL_OUTSIDE;
-      }
-   }
-   else
-   {
-      theCutType = OSSIM_POLY_NULL_OUTSIDE;
-   }
-
-   computeBoundingRect();
-
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-void ossimPolyCutter::setPolygon(const vector<ossimDpt>& polygon,
-                                 ossim_uint32 index)
-{
-   if(index < polygon.size())
-   {
-      thePolygonList[index] = polygon;
-
-      computeBoundingRect();
-   }
-
-}
-
-void ossimPolyCutter::setPolygon(const vector<ossimIpt>& polygon,
-                                 ossim_uint32 index)
-{
-   if(polygon.size())
-   {
-      thePolygonList[index] = polygon;
-      computeBoundingRect();
-   }
-}
-
-void ossimPolyCutter::addPolygon(const vector<ossimIpt>& polygon)
-{
-   thePolygonList.push_back(ossimPolygon(polygon));
-   computeBoundingRect();
-}
-
-void ossimPolyCutter::addPolygon(const vector<ossimDpt>& polygon)
-{
-   thePolygonList.push_back(ossimPolygon(polygon));
-   computeBoundingRect();
-}
-
-void ossimPolyCutter::addPolygon(const ossimPolygon& polygon)
-{
-   thePolygonList.push_back(ossimPolygon(polygon));
-   computeBoundingRect();
-}
-
-
-void ossimPolyCutter::setCutType(ossimPolyCutterCutType cutType)
-{
-   theCutType = cutType;
-}
-
-ossimPolyCutter::ossimPolyCutterCutType ossimPolyCutter::getCutType()const
-{
-   return theCutType;
-}
-
-void ossimPolyCutter::clear()
-{
-   setNumberOfPolygons(0);
-}
-
-void ossimPolyCutter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimImageSourceFilter::setProperty(property);
-}
-
-ossimRefPtr<ossimProperty> ossimPolyCutter::getProperty(const ossimString& name)const
-{
-
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimPolyCutter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-} 
-
-void ossimPolyCutter::computeBoundingRect()
-{
-   ossimIrect bounds;
-   theBoundingRect.makeNan();
-
-   for(int i = 0; i < (int)thePolygonList.size(); ++i)
-   {
-      thePolygonList[i].getBoundingRect(bounds);
-
-      if(!bounds.hasNans())
-      {
-         if(theBoundingRect.hasNans())
-         {
-            theBoundingRect = bounds;
-         }
-         else
-         {
-            theBoundingRect = theBoundingRect.combine(bounds);
-         }
-      }
-   }
-}
-
-const ossimIrect& ossimPolyCutter::getRectangle() const
-{
-   return theBoundingRect;
-}
-
-void ossimPolyCutter::setRectangle(const ossimIrect& rect)
-{
-   theBoundingRect = rect;
-   m_boundingOverwrite = true;
-}
-
-void ossimPolyCutter::setNumberOfPolygons(ossim_uint32 count)
-{
-   if(!count)
-   {
-      thePolygonList.clear();
-      thePolygonList.clear();
-   }
-   else
-   {
-      thePolygonList.resize(count);
-   }
-}
-
-std::vector<ossimPolygon>& ossimPolyCutter::getPolygonList()
-{
-   return thePolygonList;
-}
-
-const std::vector<ossimPolygon>& ossimPolyCutter::getPolygonList()const
-{
-   return thePolygonList;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimQbTileFilesHandler.cpp b/ossim/src/ossim/imaging/ossimQbTileFilesHandler.cpp
deleted file mode 100644
index 5c37e1b..0000000
--- a/ossim/src/ossim/imaging/ossimQbTileFilesHandler.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-//*************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description: Image handler used for tiled Quickbird imagery. 
-//
-//*************************************************************************************************
-//  $Id: ossimQbTileFilesHandler.cpp 2814 2011-07-05 13:40:16Z oscar.kramer $
-
-#include <ossim/imaging/ossimQbTileFilesHandler.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimTiffOverviewBuilder.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/support_data/ossimQuickbirdTile.h>
-#include <ossim/projection/ossimQuickbirdRpcModel.h>
-#include <algorithm>
-
-RTTI_DEF1(ossimQbTileFilesHandler, "ossimQbTileFilesHandler", ossimTiledImageHandler)
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimQbTileFilesHandler:debug");
-
-//*************************************************************************************************
-//!  Constructor (default):
-//*************************************************************************************************
-ossimQbTileFilesHandler::ossimQbTileFilesHandler()
-{
-}
-
-//*************************************************************************************************
-//! Destructor:
-//*************************************************************************************************
-ossimQbTileFilesHandler::~ossimQbTileFilesHandler()
-{
-}
-
-//*************************************************************************************************
-//! Opens the image file given entry index. This class does not support multiple entries.
-//! @param imageFile File to open.
-//! @param entryIndex
-//! @return false if entry index other than 0 specified.
-//*************************************************************************************************
-bool ossimQbTileFilesHandler::open()
-{
-   static const char* MODULE = "ossimQbTileFilesHandler::open() -- ";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         <<MODULE << "Entering...\nimage: " << theImageFile << "\n";
-   }
-   
-   // Test for extension: image.til
-   ossimString ext = theImageFile.ext().downcase();
-   if ( ext == "ovr" )
-   {
-      return false; // Don't try to open overviews.
-   }
-   
-   ossimRegExp regExp("^[t|T][i|I][l|L]");
-   if ( regExp.find( ext.c_str() ) )
-   {
-      if (!theImageFile.exists())
-      {
-         return false;
-      }
-   }
-      
-   // Use ossimQuickbirdTile object for parsing the TIL file and fetching the data structure 
-   // containing tile-file info:
-   if (traceDebug())
-      ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"OPENING ossimQuickbirdTile..."<<std::endl;
-   
-   ossimQuickbirdTile qbt;
-   bool success = qbt.open(theImageFile);
-   if (!success)
-      return false;
-   
-   // Populate our own data structure given the QBT map:
-   ossimFilename image_dir (theImageFile.path());
-   const ossimQuickbirdTile::TileMap& qbtTileMap = qbt.getMap();
-
-   m_fullImgRect.makeNan();
-   ossimIrect subImageRect;
-   ossimQuickbirdTile::TileMap::const_iterator qbt_iter = qbtTileMap.begin();
-   ossimImageHandlerRegistry* factory = ossimImageHandlerRegistry::instance();
-   while (qbt_iter != qbtTileMap.end())
-   {
-      ossimQuickbirdTileInfo info ((*qbt_iter).second);
-      ossimTileFile tilefile;
-      tilefile.tileFilename = (*qbt_iter).second.theFilename;
-      tilefile.tileFilename.setPath(image_dir);
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Using factory to open <"
-            <<tilefile.tileFilename<<">"<<std::endl;
-      }
-
-      // Now open up the handlers for this tile-file:
-      tilefile.imageHandler = factory->open(tilefile.tileFilename);
-      if (tilefile.imageHandler.valid())
-      {
-         // Valid handler, populate remaining items of interest and push it on our list...
-         // Fetch image coordinates in full-view:
-         subImageRect.set_ulx((*qbt_iter).second.theUlXOffset);
-         subImageRect.set_uly((*qbt_iter).second.theUlYOffset);
-         subImageRect.set_lrx((*qbt_iter).second.theLrXOffset);
-         subImageRect.set_lry((*qbt_iter).second.theLrYOffset);
-         tilefile.subImageRects.push_back(subImageRect);
-
-         // Update bounding image rectangle:
-         m_fullImgRect = m_fullImgRect.combine(subImageRect);
-         m_tileFiles.push_back(tilefile);
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Pushed <"<<tilefile.tileFilename<<"> on"
-               "to tile-files list."<<std::endl;
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<"TIL file listed <"
-            <<tilefile.tileFilename<<"> as one of the tiles, but the file could not be opened. "
-            <<"This is being ignored but may cause a problem downstream."<<std::endl;
-      }
-   
-      ++qbt_iter;   
-   }
-
-   // Need to check the full-image rect for validity. May need to explore the .IMD file if this 
-   // was not properly initialized:
-   if (m_fullImgRect.hasNans())
-   {
-      if (!computeImageRects())
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Could not establish image rectangles."
-               <<std::endl;
-         }
-         return false;
-      }
-   }
-
-   if (traceDebug())
-      ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Finished loading tiles."<<std::endl;
-
-   bool open_good = false;
-   if ((m_tileFiles.size() != 0) && m_tileFiles[0].imageHandler.valid())
-   {
-      completeOpen();
-      open_good = true;
-      
-      if (traceDebug())
-         ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Open successful."<<std::endl;
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Returning with <"
-         <<ossimString::toString(open_good)<<">"<<std::endl;
-   }
-   return open_good;
-}
-
-//*************************************************************************************************
-//! Fetch the tile-files common RPC data file and create the projection for this image
-//*************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimQbTileFilesHandler::getImageGeometry()
-{
-   // Try external geom first:
-   theGeometry = getExternalImageGeometry();
-   if (theGeometry.valid())
-      return theGeometry;  // We should return here.
-   
-   // The dataset is expected to have an RPC model associated with it:
-   ossimRefPtr<ossimQuickbirdRpcModel> model = new ossimQuickbirdRpcModel(this);
-   if (!model->getErrorStatus())
-   {
-      theGeometry = new ossimImageGeometry;
-      theGeometry->setProjection(model.get());
-      
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-
-      return theGeometry;
-   }
-   return ossimRefPtr<ossimImageGeometry>();
-}
-
-//*************************************************************************************************
-//! Initializes tile image rects by considering adjacent row/col offsets. Called when TIL
-//! doesn't contain the info. Returns true if successful.
-//*************************************************************************************************
-bool ossimQbTileFilesHandler::computeImageRects()
-{
-   try
-   {
-      ossimQuickbirdMetaData oqmd;
-      if (!oqmd.open(theImageFile))
-         throw 1;
-
-      ossimIpt image_size (oqmd.getImageSize());
-      if (image_size.hasNans())
-         throw 2;
-
-      ossimIpt full_image_lr (image_size.x-1, image_size.y-1);
-      m_fullImgRect.set_ulx(0);
-      m_fullImgRect.set_uly(0);
-      m_fullImgRect.set_lr(full_image_lr);
-
-      // Now consider the subrects for each tile. It is assumed that all tiles (except right
-      // and bottom) will be of uniform size. The TIL file should have at least provided the row
-      // and column offsets for each tile into the full image. This is equivalent to the UL corner.
-      // It is presumed that the TIL failed to provide the LR corner since this method was called.
-      int dx=0, dy=0, i=0;
-      int num_tiles = (int) m_tileFiles.size();
-      while (((dx == 0) || (dy == 0)) && (i < num_tiles-1))
-      {
-         if (dx == 0)
-            dx = m_tileFiles[i+1].subImageRects[0].ul().x - m_tileFiles[i].subImageRects[0].ul().x;
-         if (dy == 0)
-            dy = m_tileFiles[i+1].subImageRects[0].ul().y - m_tileFiles[i].subImageRects[0].ul().y;
-         ++i;
-      }
-
-      // We should have the nominal tile size now. Check this is so:
-      if ((dx == 0) || (dy == 0))
-      {
-         // Prior scheme failed for establishing the tile dimensions. Final resort is to open the first
-         // available tile file and query its dimensions:
-         if (num_tiles == 0)
-            throw 3;
-         if (m_tileFiles[0].imageHandler.valid())
-         {
-            // we have an open handler, so just query it:
-            dy = m_tileFiles[0].imageHandler->getNumberOfLines();
-            dx = m_tileFiles[0].imageHandler->getNumberOfSamples();
-         }
-         else
-         {
-            // Struck out, just assume the tile is square:
-            if ((dx == 0) && (dy == 0))
-               throw 4;
-            if (dy == 0)
-               dy = dx;
-            else
-               dx = dy;
-         }
-      }
-
-      // Loop over all tiles to properly assign their image rectangles:
-      for (i=0; i<num_tiles; i++)
-      {
-         ossimIpt ul (m_tileFiles[i].subImageRects[0].ul());
-         ossimIpt lr (ul.x + dx - 1, ul.y + dy - 1);
-
-         // Check to make sure we don't exceed extents of full image:
-         if (lr.x > full_image_lr.x)
-            lr.x = full_image_lr.x;
-         if (lr.y > full_image_lr.y)
-            lr.y = full_image_lr.y;
-
-         m_tileFiles[i].subImageRects[0].set_lr(lr);
-      }
-   }
-   
-   catch (...)
-   {
-      // Could not establish the rectangles:
-      return false;
-   }
-
-   return true;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp b/ossim/src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp
deleted file mode 100644
index f6a25b6..0000000
--- a/ossim/src/ossim/imaging/ossimQuickbirdNitfTileSource.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-//*******************************************************************
-//  $Id: ossimQuickbirdNitfTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimQuickbirdNitfTileSource.h>
-#include <ossim/support_data/ossimQuickbirdTile.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossim2dTo2dShiftTransform.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-
-RTTI_DEF1(ossimQuickbirdNitfTileSource, "ossimQuickbirdNitfTileSource", ossimNitfTileSource);
-
-static const ossimTrace traceDebug("ossimQuickbirdNitfTileSource:debug");
-
-bool ossimQuickbirdNitfTileSource::open()
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimQuickbirdNitfTileSource::open(file) DEBUG: entered ..."
-         << std::endl;
-   }
-   
-   ossimFilename file = theImageFile;
-   file = file.replaceAllThatMatch("_R[0-9]+C[0-9]+");
-   ossimQuickbirdTile tileFile;
-   bool openedTileFile = false;
-   file.setExtension("TIL");
-   
-   if(!tileFile.open(file))
-   {
-      file.setExtension("TIL");
-      if(tileFile.open(file))
-      {
-         openedTileFile = true;
-      }
-      else
-      {
-         file.setExtension("til");
-         if(tileFile.open(file))
-         {
-            openedTileFile = true;
-         }
-      }
-   }
-   else
-   {
-      openedTileFile = true;
-   }
-   
-   if(openedTileFile)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimQuickbirdNitfTileSource::open(file) DEBUG:"
-            << "\nOpened tile file" << std::endl;
-      }
-
-      // Call the base class open...
-      if(!ossimNitfTileSource::open())
-      {
-         return false;
-      }
-      
-      ossimQuickbirdTileInfo info;
-      ossimIrect tempBounds = getCurrentImageHeader()->getImageRect();
-      
-      
-      tempBounds = ossimIrect(0,
-                              0,
-                              tempBounds.width() - 1,
-                              tempBounds.height() - 1);
-      
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimQuickbirdNitfTileSource::open(file) DEBUG:"
-            << "\nheader rectangle = " << tempBounds << std::endl;
-      }
-      
-      ossimIpt ulPt;
-      ossimIpt urPt;
-      ossimIpt lrPt;
-      ossimIpt llPt;
-      ossimDpt shift;
-      if(tileFile.getInfo(info, theImageFile.file().upcase()))
-      {
-         ulPt.makeNan();
-         urPt.makeNan();
-         lrPt.makeNan();
-         llPt.makeNan();
-         
-         if((info.theUlXOffset != OSSIM_INT_NAN) &&
-            (info.theUlYOffset != OSSIM_INT_NAN))
-         {
-            shift = ossimIpt(info.theUlXOffset, info.theUlYOffset);
-         }
-         else
-         {
-            shift = ossimIpt(0,0);
-         }
-         m_transform = new ossim2dTo2dShiftTransform(shift);
-      }
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimQuickbirdNitfTileSource::open(file) DEBUG:"
-            << "\nUl = " << ulPt
-            << "\nUr = " << urPt
-            << "\nLr = " << lrPt
-            << "\nLl = " << llPt
-            << "\ntheImageRect:  " << getImageRectangle(0)
-            << "\nExiting..." 
-            << std::endl;
-      }
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimQuickbirdNitfTileSource::open(file) DEBUG"
-            << "Not opened..."
-            << std::endl;
-      }
-   }
-   
-   return openedTileFile;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimQuickbirdNitfTileSource::getImageGeometry()
-{
-   ossimRefPtr<ossimImageGeometry> result = ossimImageHandler::getImageGeometry();
-   if( result.valid() )
-   {
-      if(!result->getTransform())
-      {
-         result->setTransform(m_transform.get());
-      }
-   }
-   return result;
-}
-
-bool ossimQuickbirdNitfTileSource::saveState(ossimKeywordlist& kwl,
-                                             const char* prefix)const
-{
-   return ossimNitfTileSource::saveState( kwl, prefix );
-}
-
-bool ossimQuickbirdNitfTileSource::loadState(const ossimKeywordlist& kwl,
-                                            const char* prefix)
-   
-{
-   return ossimNitfTileSource::loadState( kwl, prefix );
-}
-
diff --git a/ossim/src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp b/ossim/src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp
deleted file mode 100644
index 846b587..0000000
--- a/ossim/src/ossim/imaging/ossimQuickbirdTiffTileSource.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-// 
-// Copied from ossimQuickbirdTiffTileSource written by Garrett Potts.
-//
-// Description:
-//
-// Class definition for specialized image handler to pick up offsets from
-// Quick Bird ".TIL" files.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimQuickbirdTiffTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
-
-#include <ossim/imaging/ossimQuickbirdTiffTileSource.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/support_data/ossimQuickbirdTile.h>
-#include <ossim/projection/ossimQuickbirdRpcModel.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossimTrace.h>
-
-RTTI_DEF1(ossimQuickbirdTiffTileSource,
-          "ossimQuickbirdTiffTileSource",
-          ossimTiffTileSource);
-
-static const ossimTrace traceDebug("ossimQuickbirdTiffTileSource:debug");
-
-//*************************************************************************************************
-// Checks for presence of required info before flagging successful open
-//*************************************************************************************************
-bool ossimQuickbirdTiffTileSource::open()
-{
-   static const char M[] = "ossimQuickbirdTiffTileSource::open()";
-   
-   bool result = false;
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " ENTERED ..." << std::endl;
-   }
-
-   m_tileInfoFilename = theImageFile.noExtension().replaceAllThatMatch("_R[0-9]+C[0-9]+");
-   
-   // QB is recognized by the presence of a tile info file. Fail if not present:
-   m_tileInfoFilename.setExtension("TIL");
-
-   if ( !m_tileInfoFilename.exists() )
-   {
-      m_tileInfoFilename.setExtension("til");
-   }
-
-   if ( m_tileInfoFilename.exists() )
-   {
-      // Call the base class open...
-      result = ossimTiffTileSource::open();
-   }
-
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
-   }
-   
-   return result;
-}
-
-//*************************************************************************************************
-// I know what I am. I am a Quickbird TIFF image. I may be standalone or tiled with row-column
-// designation in the file name. My projection information is available (possibly) in an 
-// accompanying RPC file and/or internal TIF tag, and my transform info (sub-image offset) is 
-// available in a TILE info file (*.til) or internal TIF tag. Therefore, I (and not some outside
-// factory) am best qualified for establishing my image geometry.
-//*************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimQuickbirdTiffTileSource::getImageGeometry()
-{
-   if ( !theGeometry )
-   {
-      //---
-      // Check factory for external geom:
-      //---
-      theGeometry = getExternalImageGeometry();
-      
-      if ( !theGeometry )
-      {
-         theGeometry = new ossimImageGeometry();
-         
-         // Fetch the tile info for this particular image:
-         if ( m_tileInfoFilename.size() )
-         {
-            ossimQuickbirdTile tileFile;
-            if ( tileFile.open(m_tileInfoFilename) ) 
-            {
-               ossimQuickbirdTileInfo info;
-               bool infoStatus = tileFile.getInfo(info, theImageFile.file().upcase());
-               if ( !infoStatus )
-               {
-                  infoStatus = tileFile.getInfo(info, theImageFile.file().downcase());
-               }
-
-               if ( infoStatus )
-               {
-                  // Establish sub-image offset (shift) for this tile:
-                  ossimDpt shift(0,0);
-                  if ((info.theUlXOffset != OSSIM_INT_NAN) && (info.theUlYOffset != OSSIM_INT_NAN))
-                     shift = ossimIpt(info.theUlXOffset, info.theUlYOffset);
-                  
-                  if(traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_DEBUG)
-                        << "ossimQuickbirdTiffTileSource::open() DEBUG:"
-                        << "\nSub image offset  = " << shift << std::endl;
-                  }
-
-                  // Create the transform and set it in the geometry object:
-                  ossimRefPtr<ossim2dTo2dTransform> transform =
-                     new ossim2dTo2dShiftTransform(shift);
-
-                  theGeometry->setTransform(transform.get());
-   
-                  // Next is the projection part of the image geometry. This should be available
-                  // as an external RPC file or internal RPC's in the tiff file. Otherwise use
-                  // the map projection specified in the 
-                  // tiff file:
-                  theGeometry->setProjection(0);
-                  
-                  ossimRefPtr<ossimQuickbirdRpcModel> model = new ossimQuickbirdRpcModel;
-                  if (model->parseFile(theImageFile))
-                  {
-                     theGeometry->setProjection(model.get());
-                  }
-                  else
-                  {
-                     // Last resort to a projection factory:
-                     ossimRefPtr<ossimProjection> proj = 
-                        ossimProjectionFactoryRegistry::instance()->createProjection(this);
-                     if (proj.valid()) theGeometry->setProjection(proj.get());
-                  }
-               }
-
-               // Set image things the geometry object should know about.
-               initImageParameters( theGeometry.get() );
-            }
-         }
-      }
-   }
-
-   return theGeometry;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimRLevelFilter.cpp b/ossim/src/ossim/imaging/ossimRLevelFilter.cpp
deleted file mode 100644
index 7056895..0000000
--- a/ossim/src/ossim/imaging/ossimRLevelFilter.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRLevelFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimRLevelFilter.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossimTrace.h>
-
-static const char* CURRENT_RLEVEL_KW    = "current_rlevel";
-static const char* OVERRIDE_GEOMETRY_KW = "override_geometry";
-
-static ossimTrace traceDebug("ossimRLevelFilter:debug");
-
-RTTI_DEF1(ossimRLevelFilter, "ossimRLevelFilter", ossimImageSourceFilter);
-
-//**************************************************************************************************
-ossimRLevelFilter::ossimRLevelFilter()
-   : ossimImageSourceFilter(),
-     theCurrentRLevel(0),
-     theOverrideGeometryFlag(false)
-{
-}
-
-//**************************************************************************************************
-ossimRLevelFilter::~ossimRLevelFilter()
-{
-}
-
-//**************************************************************************************************
-void ossimRLevelFilter::getDecimationFactor(ossim_uint32 resLevel,
-                                            ossimDpt& result) const
-{
-   if(!theInputConnection)
-   {
-      result.makeNan();
-   }
-
-   theInputConnection->getDecimationFactor(resLevel,
-                                           result);
-}
-
-//**************************************************************************************************
-bool ossimRLevelFilter::getOverrideGeometryFlag() const
-{
-   return theOverrideGeometryFlag;
-}
-
-//**************************************************************************************************
-void ossimRLevelFilter::setOverrideGeometryFlag(bool override)
-{
-   theOverrideGeometryFlag = override;
-}
-
-//**************************************************************************************************
-void ossimRLevelFilter::setCurrentRLevel(ossim_uint32 rlevel)
-{
-   theCurrentRLevel = rlevel;
-   updateGeometry();
-}
-
-//**************************************************************************************************
-ossim_uint32 ossimRLevelFilter::getCurrentRLevel()const
-{
-   return theCurrentRLevel;
-}
-
-//**************************************************************************************************
-// Returns a pointer reference to the active image geometry at this filter. The input source
-// geometry is modified, so we need to maintain our own geometry object as a data member.
-//**************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimRLevelFilter::getImageGeometry()
-{
-   // Have we already defined our own geometry? Return it if so:
-   if (m_ScaledGeometry.valid()) return m_ScaledGeometry;
-
-   if (!theInputConnection) return ossimRefPtr<ossimImageGeometry>();
-
-   ossim_uint32 rlevel = getCurrentRLevel();
-   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
-
-   // If no scaling is happening, just return the input image geometry:
-   if ((!inputGeom) || (rlevel == 0) || (getEnableFlag() == false))
-      return inputGeom;
-
-   // Need to create a copy of the input geom and modify it as our own, then pass that:
-   m_ScaledGeometry = new ossimImageGeometry(*inputGeom);
-   updateGeometry();
-
-   // Return our version of the image geometry:
-   return m_ScaledGeometry;
-}
-
-//**************************************************************************************************
-//! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
-//! a scale change so that the geometry's projection is modified accordingly.
-//**************************************************************************************************
-void ossimRLevelFilter::updateGeometry()
-{
-   if (m_ScaledGeometry.valid())
-   {
-      // Modify the image geometry's projection with the scale factor before returning geom:
-      ossimProjection* proj = m_ScaledGeometry->getProjection();
-      ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);;
-      if(mapProj)
-      {
-         ossimDpt decimation;
-         getDecimationFactor(theCurrentRLevel, decimation);
-         decimation.x = 1.0/decimation.x;
-         decimation.y = 1.0/decimation.y;
-
-         // This will adjust both the scale and the tie point to account for decimation.
-         mapProj->applyScale(decimation, true);  // recenter tie point flag
-      }
-   }
-}
-
-//**************************************************************************************************
-void ossimRLevelFilter::getSummedDecimation(ossimDpt& result) const
-{
-   // Start with fresh values.
-   result.x = 0.0;
-   result.y = 0.0;
-
-   ossim_uint32 rlevel = getCurrentRLevel();
-
-   if (rlevel == 0)
-   {
-      return; // no decimation.
-   }
-
-   // Sum the decimations from rlevel one to the current rlevel.
-   for (ossim_uint32 i = 1; i <= rlevel; ++i)
-   {
-      ossimDpt dpt;
-      getDecimationFactor(i, dpt);
-      if (dpt.hasNans())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimRLevelFilter::getSummedDecimation WARNING:"
-            << "\nNans returned from getDecimationFactor!"
-            << std::endl;
-         result.makeNan();
-         return;
-      }
-      result.x += dpt.x;
-      result.y += dpt.y;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimRLevelFilter::getSummedDecimation result: " << result
-         << std::endl;
-   }
-}
-
-//**************************************************************************************************
-ossimIrect ossimRLevelFilter::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimIrect rect;
-   rect.makeNan();
-   if(!theInputConnection) return rect;
-
-   if (isSourceEnabled())
-   {
-      return theInputConnection->getBoundingRect(theCurrentRLevel);
-   }
-   return theInputConnection->getBoundingRect(resLevel);
-}
-
-//**************************************************************************************************
-ossimRefPtr<ossimImageData> ossimRLevelFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return 0;
-   }
-
-   if(!isSourceEnabled())
-   {
-      return theInputConnection->getTile(tileRect, resLevel);
-   }
-
-   // Ignoring resLevel as we're in charge of it here!
-   return theInputConnection->getTile(tileRect, theCurrentRLevel);
-}
-
-//**************************************************************************************************
-bool ossimRLevelFilter::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix)
-{
-   const char* current  = kwl.find(prefix, CURRENT_RLEVEL_KW);
-   const char* override = kwl.find(prefix, OVERRIDE_GEOMETRY_KW);
-
-   if(current)
-      theCurrentRLevel = ossimString(current).toULong();
-
-   if(override)
-      theOverrideGeometryFlag = ossimString(override).toBool();
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-
-   // An existing image geometry object here will need to be updated:
-   updateGeometry();
-}
-
-//**************************************************************************************************
-bool ossimRLevelFilter::saveState(ossimKeywordlist& kwl,
-                                  const char* prefix)const
-{
-   kwl.add(prefix,
-           CURRENT_RLEVEL_KW,
-           theCurrentRLevel,
-           true);
-
-   kwl.add(prefix,
-           OVERRIDE_GEOMETRY_KW,
-           (ossim_uint32)theOverrideGeometryFlag,
-           true);
-
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
diff --git a/ossim/src/ossim/imaging/ossimRangeDomeTileSource.cpp b/ossim/src/ossim/imaging/ossimRangeDomeTileSource.cpp
deleted file mode 100644
index ef48671..0000000
--- a/ossim/src/ossim/imaging/ossimRangeDomeTileSource.cpp
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * ossimRangeDomeTileSource.cpp
- *
- *  Created on: Aug 3, 2015
- *      Author: okramer
- */
-
-#include <ossim/imaging/ossimRangeDomeTileSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <iostream>
-
-using namespace std;
-
-RTTI_DEF1(ossimRangeDomeTileSource, "ossimRangeDomeTileSource", ossimImageHandler);
-
-const char* OSSIM_RANGE_DOME_SPEC_MAGIC_NUMBER = "OSSIM_RANGE_DOMES";
-
-ossimRangeDome::ossimRangeDome(vector<ossimString>& tokens)
-: valid (false),
-  id (0),
-  radiusMeters (0),
-  radiusPixelsSq (0),
-  classification (UNASSIGNED),
-  startAz (0),
-  endAz (0)
-{
-   if ((tokens.size() < 6) || (tokens[0].size() && (tokens[0].chars()[0] == '#')))
-      return;
-
-   ossim_uint32 i = 0;
-   id             = tokens[i++].toUInt32();
-   centerGpt.lat  = tokens[i++].toDouble();
-   centerGpt.lon  = tokens[i++].toDouble();
-   centerGpt.hgt  = tokens[i++].toDouble();
-   radiusMeters   = tokens[i++].toDouble();
-   classification = (Classification) tokens[i++].toInt32();
-   valid = true;
-
-   if (tokens.size() >= 8)
-   {
-      startAz = tokens[i++].toDouble();
-      endAz = tokens[i++].toDouble();
-      if (endAz == 360.0)
-         endAz = 0.0;
-   }
-
-   if ( tokens.size()-i )
-   {
-      description = tokens[i];
-      description.trim();
-   }
-}
-
-ossimGrect ossimRangeDome::boundingRect() const
-{
-   ossimDpt scale = centerGpt.metersPerDegree();
-   double dlat = radiusMeters/scale.y;
-   double dlon = radiusMeters/scale.x;
-   return ossimGrect(centerGpt.lat+dlat, centerGpt.lon-dlon,
-                     centerGpt.lat-dlat, centerGpt.lon+dlon);
-}
-
-ossimRangeDomeTileSource::ossimRangeDomeTileSource()
-:  m_gsd(1.0, 1.0) // default GSD
-{
-}
-
-
-ossimRangeDomeTileSource::~ossimRangeDomeTileSource()
-{
-   close();
-}
-
-
-bool ossimRangeDomeTileSource::open()
-{
-   if (!theImageFile.isReadable())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"ossimRangeDomeTileSource::open() -- Error. Coould not"
-            " open CSV file at <"<<theImageFile<<">" << endl;
-      return false;
-   }
-
-   ossimString dome_spec;
-   vector<ossimString> tokens;
-
-   // Open the CSV and check proper file type:
-   ifstream indata (theImageFile.chars());
-   getline(indata, dome_spec);
-   dome_spec.split(tokens, " ", false);
-   if ((tokens.size() < 2) || !tokens[0].contains(OSSIM_RANGE_DOME_SPEC_MAGIC_NUMBER))
-      return false;
-
-   // loop over each record/dome spec:
-   while (indata.good())
-   {
-      tokens.clear();
-      getline(indata, dome_spec);
-      dome_spec.split(tokens, ",", true);
-      ossimRangeDome dome (tokens);
-      if (dome.valid)
-         m_rangeDomes.push_back(dome);
-   }
-
-   // The GSD may be incorrect, but init anyway then redo whe GSD is set:
-   initialize();
-
-   return isOpen();
-}
-
-void ossimRangeDomeTileSource::initialize()
-{
-   if (!isOpen())
-      return;
-
-   // Establish bounding rect:
-   ossimGrect boundingRect;
-   boundingRect.makeNan();
-   vector<ossimRangeDome>::iterator dome = m_rangeDomes.begin();
-   while (dome != m_rangeDomes.end())
-   {
-      boundingRect.expandToInclude(dome->boundingRect());
-      ++dome;
-   }
-
-   // Set up the geometry:
-   ossimRefPtr<ossimMapProjection> mapProj = new ossimEquDistCylProjection();
-   mapProj->setOrigin(boundingRect.midPoint());
-   mapProj->setMetersPerPixel(m_gsd);
-   ossimDpt degPerPixel (mapProj->getDecimalDegreesPerPixel());
-   mapProj->setElevationLookupFlag(false);
-   mapProj->setUlTiePoints(boundingRect.ul());
-   ossimIpt image_size(boundingRect.width()/degPerPixel.x, boundingRect.height()/degPerPixel.y);
-   theGeometry = new ossimImageGeometry(0, mapProj.get());
-   theGeometry->setImageSize(image_size);
-
-   // Transform the domes to image space coordinates:
-   dome = m_rangeDomes.begin();
-   double r;
-   while (dome != m_rangeDomes.end())
-   {
-      theGeometry->worldToLocal(dome->centerGpt, dome->centerIpt);
-      r = dome->radiusMeters/m_gsd.x;
-      dome->radiusPixelsSq = r*r;
-      ++dome;
-   }
-}
-
-
-bool ossimRangeDomeTileSource::isOpen() const
-{
-   return (!m_rangeDomes.empty());
-}
-
-
-void ossimRangeDomeTileSource::close()
-{
-   m_rangeDomes.clear();
-   theGeometry = 0;
-}
-
-
-ossimRefPtr<ossimImageData> ossimRangeDomeTileSource::getTile(const ossimIrect& rect,
-                                                              ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> tile = ossimImageDataFactory::instance()->create(this, this);
-
-   tile->setImageRectangle(rect);
-   tile->initialize();
-
-   getTile(tile.get(), resLevel);
-
-   return tile;
-}
-
-
-bool ossimRangeDomeTileSource::getTile(ossimImageData* result, ossim_uint32 resLevel)
-{
-   if (!result || !theGeometry.valid())
-      return false;
-
-   // Start with null fill:
-   result->fill(getNullPixelValue());
-
-   // Verify intersection with dataset. Everything done in R0 space:
-   ossimIrect tile_rect (result->getImageRectangle());
-   ossim_uint32 coord_scale = resLevel + 1;
-   ossimIrect tile_rect_r0 (coord_scale*tile_rect);
-   ossimIrect boundingImgRect;
-   theGeometry->getBoundingRect(boundingImgRect);
-
-   if (!tile_rect_r0.intersects(boundingImgRect))
-   {
-      result->setDataObjectStatus(OSSIM_EMPTY);
-      return true;
-   }
-
-   vector<ossimRangeDome>::iterator dome;
-   double d2, x0, y0, dx, dy, az;
-
-   // Nested loop over all pixels in tile:
-   for (ossim_int32 yn=tile_rect.ul().y; yn<=tile_rect.lr().y; ++yn)
-   {
-      y0 = yn * coord_scale;
-
-      for (ossim_int32 xn=tile_rect.ul().x; xn<=tile_rect.lr().x; ++xn)
-      {
-         x0 = xn * coord_scale;
-
-         // Loop over each dome in the list to see if this pixel is affected:
-         dome = m_rangeDomes.begin();
-         while (dome != m_rangeDomes.end())
-         {
-            // Check distance to center:
-            dx = x0 - dome->centerIpt.x;
-            dy = y0 - dome->centerIpt.y;
-            d2 = dx*dx + dy*dy;
-
-            if (d2 > dome->radiusPixelsSq)
-            {
-               ++dome;
-               continue;
-            }
-
-            // Passed range test, do azimuth test. First check for simple 360 dome:
-            if (dome->startAz == dome->endAz)
-            {
-               result->setValue(xn, yn, (ossim_uint8) dome->classification);
-               ++dome;
-               continue;
-            }
-
-            // Need full azimuth test:
-            az = ossim::atan2d(dx, -dy);
-            if (az < 0)
-               az += 360;
-            if (((dome->startAz < dome->endAz) && (az >= dome->startAz) && (az <= dome->endAz)) ||
-                ((dome->startAz > dome->endAz) && (
-                     ((az >= dome->startAz) && (az > dome->endAz)) ||
-                     ((az < dome->startAz) && (az <= dome->endAz)))))
-            {
-               result->setValue(xn, yn, (ossim_uint8) dome->classification);
-            }
-            ++dome;
-         }
-      }
-   }
-
-   result->validate();
-   return true;
-}
-
-
-ossim_uint32 ossimRangeDomeTileSource::getNumberOfInputBands() const
-{
-   return 1;
-}
-
-
-ossim_uint32 ossimRangeDomeTileSource::getNumberOfLines(ossim_uint32 resLevel) const
-{
-   if (theGeometry.valid())
-      return ( theGeometry->getImageSize().y / (resLevel+1) );
-   return 0;
-}
-
-
-ossim_uint32 ossimRangeDomeTileSource::getNumberOfSamples(ossim_uint32 resLevel) const
-{
-   if (theGeometry.valid())
-      return ( theGeometry->getImageSize().x / (resLevel+1) );
-   return 0;
-}
-
-
-bool ossimRangeDomeTileSource::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   static const char MODULE[] = "ossimRangeDomeTileSource::saveState()";
-
-   ossimImageHandler::saveState(kwl, prefix);
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << MODULE
-            << " ERROR detected in keyword list!  State not saved." << std::endl;
-      return false;
-   }
-
-   kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW, m_gsd.x, true);
-
-   return true;
-}
-
-
-bool ossimRangeDomeTileSource::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   static const char MODULE[] = "ossimRangeDomeTileSource::loadState()";
-   theDecimationFactors.clear();
-
-   ossimImageHandler::loadState(kwl, prefix);
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<< MODULE
-            << "WARNING: error detected in keyword list!  State not load." << std::endl;
-      return false;
-   }
-
-   ossimDpt gsd;
-   ossimString value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW);
-   if (!value.empty())
-      gsd.x = value.toDouble();
-
-   value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW);
-   if (!value.empty())
-      setGSD(value.toDouble());
-
-   // The rest of the state is established by opening the file:
-   bool good_open = open();
-   return good_open;
-}
-
-
-void ossimRangeDomeTileSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if (!property.valid())
-      return;
-
-   ossimString s;
-   property->valueToString(s);
-   if (s.empty())
-      return;
-
-   // The user should select either explicit GSD or relative GSD factor, never both:
-   if ( property->getName() == ossimKeywordNames::METERS_PER_PIXEL_KW )
-   {
-      ossim_float64 gsd = s.toFloat64();
-      if (!ossim::isnan(gsd))
-         setGSD(gsd);
-   }
-   else
-   {
-      ossimImageHandler::setProperty(property);
-   }
-}
-
-
-ossimRefPtr<ossimProperty> ossimRangeDomeTileSource::getProperty(const ossimString& name) const
-{
-   ossimRefPtr<ossimProperty> prop = 0;
-   if ( name == ossimKeywordNames::METERS_PER_PIXEL_KW )
-   {
-      ossimString value = ossimString::toString(m_gsd.x);
-      prop = new ossimStringProperty(name, value);
-   }
-   else
-   {
-      prop = ossimImageHandler::getProperty(name);
-   }
-   return prop;
-}
-
-
-
-void ossimRangeDomeTileSource::getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const
-{
-   gsd.x =(1.0/(resLevel+1)) * m_gsd.x;
-   gsd.y =(1.0/(resLevel+1)) * m_gsd.y;
-}
-
-
-void ossimRangeDomeTileSource::setGSD( const ossim_float64& gsd )
-{
-   if (gsd == m_gsd.x)
-      return;
-
-   m_gsd.x = gsd;
-   m_gsd.y = gsd;
-
-   initialize();
-}
-
-
-
diff --git a/ossim/src/ossim/imaging/ossimReadmeFileWriter.cpp b/ossim/src/ossim/imaging/ossimReadmeFileWriter.cpp
deleted file mode 100644
index 4172cef..0000000
--- a/ossim/src/ossim/imaging/ossimReadmeFileWriter.cpp
+++ /dev/null
@@ -1,455 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2003 Storage Area Networks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Kenneth Melero (kmelero at sanz.com)
-//
-//*******************************************************************
-//  $Id: ossimReadmeFileWriter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimReadmeFileWriter.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <iostream>
-using namespace std;
-
-RTTI_DEF1(ossimReadmeFileWriter,
-          "ossimReadmeFileWriter",
-          ossimMetadataFileWriter)
-
-static const char DEFAULT_FILE_NAME[] = "output_readme.txt";
-static ossimTrace traceDebug("ossimReadmeFileWriter:debug");
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
-ossimReadmeFileWriter::ossimReadmeFileWriter()
-:
-ossimMetadataFileWriter()
-{
-}
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
-ossimReadmeFileWriter::~ossimReadmeFileWriter()
-{
-}
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
-bool ossimReadmeFileWriter::writeFile()
-{
-   static const char MODULE[] = "ossimReadmeFileWriter::writeFile";
-
-   if(!theInputConnection)
-   {
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nNo input connection!  Returning..."
-              << endl;
-      }
-
-      return false;
-   }
-
-   std::ofstream out(theFilename.c_str(), ios_base::out);
-   if (!out)
-      return false;
-
-   // Fetch the map projection of the input image if it exists:
-   const ossimMapProjection* mapProj = 0;
-   ossimRefPtr<ossimImageGeometry> imgGeom = theInputConnection->getImageGeometry();
-   if ( imgGeom.valid() )
-   {
-      const ossimProjection* proj = imgGeom->getProjection();
-      mapProj = PTR_CAST(ossimMapProjection, proj);
-   }
-   if (!mapProj)
-   {
-      out.close();
-      return false;
-   }
-
-   ossimMapProjectionInfo* projectionInfo = new ossimMapProjectionInfo(mapProj, theAreaOfInterest);
-   if(projectionInfo)
-   {
-      out << setiosflags(ios::fixed)
-          << setiosflags(ios::left)
-          << setw(16) << "Image: "
-          << projectionInfo->getImageInfoString();
-      
-      out << setw(17) << "\nLines:"
-          << projectionInfo->linesPerImage()
-          << setw(17) << "\nSamples:"
-          << projectionInfo->pixelsPerLine()
-          << setw(17) << "\nPixel Size x:"
-          << setprecision(8) 
-          << projectionInfo->getMetersPerPixel().x 
-          << " meters";
-      
-      out << ", " 
-          << setprecision(8) 
-          << projectionInfo->getUsSurveyFeetPerPixel().x
-          << " U.S. feet";
-      
-      out << setw(17) << "\nPixel Size y:"
-          << setprecision(8) 
-          << projectionInfo->getMetersPerPixel().y 
-          << " meters";
-      
-      out << ", " 
-          << setprecision(8) 
-          << projectionInfo->getUsSurveyFeetPerPixel().y
-          << " U.S. feet";
-      
-      const ossimString type  = TYPE_NAME(mapProj);
-      const ossimString datum = mapProj->getDatum()->code();
-      const ossimString ellipsoid = mapProj->getEllipsoid().code();
-
-      if(type)
-         out << setw(17) << "\nProjection:" << type;
-
-      const ossimUtmProjection* utmProj = PTR_CAST(ossimUtmProjection, mapProj);
-      if (utmProj)
-         out << setw(17) << "\nUTM map zone:" << utmProj->getZone();
-      
-      if(datum && ellipsoid)
-         out << setw(17) << "\nDatum:"      << datum
-             << setw(17) << "\nEllipsoid:"
-             << ellipsoid;
-      
-      out << resetiosflags(ios::left) << endl;
-      
-      const ossimString NORTH = "N";
-      const ossimString SOUTH = "S";
-      const ossimString EAST  = "E";
-      const ossimString WEST  = "W";
-      
-      ossimString tmpString;
-      double tmpDouble;
-      
-      // HACK: Easiest way to get projection info for optional params is via the old keywordlist:
-      ossimKeywordlist kwl;
-      mapProj->saveState(kwl);
-      const char* parallel1   = kwl.find(ossimKeywordNames::STD_PARALLEL_1_KW);
-      const char* parallel2   = kwl.find(ossimKeywordNames::STD_PARALLEL_2_KW);
-      const char* scaleFactor = kwl.find(ossimKeywordNames::SCALE_FACTOR_KW);
-      
-      
-      ossimString proj_name = mapProj->getClassName();
-      if ( ( proj_name.contains("Lambert")           ) ||
-           ( proj_name.contains("Albers")            ) ||
-           ( proj_name.contains("TransverseMercator" ) ) )
-      {
-         double falseEasting  =  mapProj->getFalseEasting();
-         double falseNorthing =  mapProj->getFalseNorthing();
- 
-         double origin_lat = mapProj->origin().latd();
-         tmpDouble = fabs(origin_lat);
-         tmpString = (origin_lat < 0.0) ? SOUTH : NORTH;
-         out << setiosflags(ios::left)
-             << "\n"
-             << setw(18) << "Origin Latitude:"
-             << resetiosflags(ios::left)
-             << setw(21) << setprecision(12) << tmpDouble 
-             << tmpString << endl;
-         
-         double origin_lon = mapProj->origin().lond();
-         tmpDouble = fabs(origin_lon);
-         tmpString = (origin_lon < 0.0) ? WEST : EAST;
-         out << setiosflags(ios::left)
-             << setw(18) << "Origin Longitude:"
-             << resetiosflags(ios::left)
-             << setw(21) << tmpDouble << tmpString
-             << setiosflags(ios::left)
-             << "\n"
-             << setw(23) << "False Easting:"
-             << resetiosflags(ios::left)
-             << setw(17) << setprecision(4) 
-             << falseEasting;
-         
-         out << " meters, " << setprecision(4)
-             << ossim::mtrs2usft(falseEasting) 
-             << " U.S. feet";
-         
-         out << endl;
-	 
-         out << setiosflags(ios::left)
-             << setw(23) << "False Northing:"
-             << resetiosflags(ios::left)
-             << setw(17) << setprecision(4) 
-             << falseNorthing;
-         
-         out << " meters, " << setprecision(4)
-             << ossim::mtrs2usft(falseNorthing) 
-             << " U.S. feet";
-         
-         out << endl;
-	 
-      } // End of if "Alber Lambert or TM.
-      
-      if (proj_name.contains("TransverseMercator"))
-      {
-
-         out << setiosflags(ios::left)
-             << "\n"
-             << setw(18) << "Scale Factor:"
-             << resetiosflags(ios::left)
-             << setw(21) << setprecision(10) 
-             << ossimString(scaleFactor).toDouble()
-             << "\n" << endl;
-      }
-      
-      if ( (proj_name.contains("Lambert") ) ||
-           (proj_name.contains("Albers")  ) )
-      {
-         double stdpar1 = ossimString(parallel1).toDouble();
-         tmpDouble = fabs(stdpar1);
-         tmpString = (stdpar1 < 0.0) ? SOUTH : NORTH;
-         out << setiosflags(ios::left) 
-             << setw(23) << "Standard Parallel #1:"
-             << resetiosflags(ios::left)
-             << setw(16) << setprecision(12) << tmpDouble
-             << tmpString << endl;
-         
-         double stdpar2 = ossimString(parallel2).toDouble();
-         tmpDouble = fabs(stdpar2);
-         tmpString = (stdpar2 < 0.0) ? SOUTH : NORTH;
-         out << setiosflags(ios::left)
-             << setw(23) << "Standard Parallel #2:"
-             << resetiosflags(ios::left)
-             << setw(16) << setprecision(12) 
-             << tmpDouble << tmpString
-             << "\n" << endl;
-      }
-      
-      ossimString cornerString[4] = { "Upper Left",
-                                      "Upper Right",
-                                      "Lower Right",
-                                      "Lower Left" };
-	
-      //---
-      // Add a note to the readme file stating what the corner coordinates
-      // are relative to.
-      //---
-      if (projectionInfo->getPixelType() == OSSIM_PIXEL_IS_AREA)
-      {
-         out 
-            << "\nCorner coordinates relative to outer edge of pixel.\n\n";
-      }
-      else
-      {
-         out
-            << "\nCorner coordinates relative to center of pixel.\n\n";
-      }
-      
-      out << "Corner Coordinates:\n\n";
-      
-      //---
-      // Upper Left Corner Points
-      //---
-      tmpDouble = fabs(projectionInfo->ulGroundPt().latd());
-      tmpString = (projectionInfo->ulGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
-      out << cornerString[0]  << endl;
-      out << setw(14) << "Latitude:  "
-          << setw(16) << setprecision(12) << tmpDouble 
-          << tmpString << endl;
-      tmpDouble = fabs(projectionInfo->ulGroundPt().lond());
-      tmpString = (projectionInfo->ulGroundPt().lond() < 0.0) ? WEST : EAST;
-      out << setw(14) << "Longitude:  "
-          << setw(16) << tmpDouble << tmpString << endl;
-      
-      out << setw(14) << "Easting:  "
-          << setw(17) << setprecision(4) 
-          << projectionInfo->ulEastingNorthingPt().x;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().x)
-          << " U.S. feet";
-      
-      out << endl
-          << setw(14) << "Northing:  "
-          << setw(17) << projectionInfo->ulEastingNorthingPt().y;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().y)
-          << " U.S. feet";
-      
-      out << endl << endl;
-      
-      //---
-      // Upper Right Corner Points
-      //---
-      tmpDouble = fabs(projectionInfo->urGroundPt().latd());
-      tmpString = (projectionInfo->urGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
-      out << cornerString[1]  << endl;
-      out << setw(14) << "Latitude:  "
-          << setw(16) << setprecision(12) << tmpDouble
-          << tmpString << endl;
-      tmpDouble = fabs(projectionInfo->urGroundPt().lond());
-      tmpString = (projectionInfo->urGroundPt().lond() < 0.0) ? WEST : EAST;
-      out << setw(14) << "Longitude:  "
-          << setw(16) << tmpDouble << tmpString << endl;
-      
-      out << setw(14) << "Easting:  "
-          << setw(17) << setprecision(4)
-          << projectionInfo->urEastingNorthingPt().x;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->urEastingNorthingPt().x)
-          << " U.S. feet";
-      
-      out << endl
-          << setw(14) << "Northing:  "
-          << setw(17) << projectionInfo->urEastingNorthingPt().y;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->urEastingNorthingPt().y)
-          << " U.S. feet";
-      
-      out << endl << endl;
-      
-      //---
-      // Lower Right Corner Points
-      //---
-      tmpDouble = fabs(projectionInfo->lrGroundPt().latd());
-      tmpString = (projectionInfo->lrGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
-      out << cornerString[2]  << endl;
-      out << setw(14) << "Latitude:  "
-          << setw(16) << setprecision(12) << tmpDouble 
-          << tmpString << endl;
-      tmpDouble = fabs(projectionInfo->lrGroundPt().lond());
-      tmpString = (projectionInfo->lrGroundPt().lond() < 0.0) ? WEST : EAST;
-      out << setw(14) << "Longitude:  "
-          << setw(16) << tmpDouble << tmpString << endl;
-      
-      out << setw(14) << "Easting:  "
-          << setw(17) << setprecision(4) 
-          << projectionInfo->lrEastingNorthingPt().x;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->lrEastingNorthingPt().x)
-          << " U.S. feet";
-      
-      out << endl
-          << setw(14) << "Northing:  "
-          << setw(17) << projectionInfo->lrEastingNorthingPt().y;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->lrEastingNorthingPt().y)
-          << " U.S. feet";
-      
-      out << endl << endl;
-      
-      //---
-      // Lower Left Corner Points
-      //---
-      tmpDouble = fabs(projectionInfo->llGroundPt().latd());
-      tmpString = (projectionInfo->llGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
-      out << cornerString[3]  << endl;
-      out << setw(14) << "Latitude:  "
-          << setw(16) << setprecision(12) << tmpDouble
-          << tmpString << endl;
-      tmpDouble = fabs(projectionInfo->llGroundPt().lond());
-      tmpString = (projectionInfo->llGroundPt().lond() < 0.0) ? WEST : EAST;
-      out << setw(14) << "Longitude:  "
-          << setw(16) << tmpDouble << tmpString << endl;
-      
-      out << setw(14) << "Easting:  "
-          << setw(17) << setprecision(4)
-          <<  projectionInfo->llEastingNorthingPt().x;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->llEastingNorthingPt().x)
-          << " U.S. feet";
-      
-      out << endl
-          << setw(14) << "Northing:  "
-          << setw(17) << projectionInfo->llEastingNorthingPt().y;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->llEastingNorthingPt().y)
-          << " U.S. feet";
-      
-      out << endl << endl;
-      
-      out << "Center Coordinates:\n\n";
-      
-      tmpDouble = fabs(projectionInfo->centerGroundPt().latd());
-      
-      tmpString = (projectionInfo->centerGroundPt().latd() < 0.0) ? SOUTH : NORTH;
-      
-      out << setw(14) << "Latitude:  "
-          << setw(16) << setprecision(12) << tmpDouble
-          << tmpString << endl;
-      
-      tmpDouble = fabs(projectionInfo->centerGroundPt().lond());
-      
-      tmpString = (projectionInfo->centerGroundPt().lond() < 0.0) ? WEST : EAST;
-      
-      out << setw(14) << "Longitude:  "
-          << setw(16) << tmpDouble << tmpString << endl;
-      
-      out << setw(14) << "Easting:  "
-          << setw(17) << setprecision(4)
-          << projectionInfo->centerEastingNorthingPt().x;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->centerEastingNorthingPt().x)
-          << " U.S. feet";
-      
-      out << endl
-          << setw(14) << "Northing:  "
-          << setw(17) << projectionInfo->centerEastingNorthingPt().y;
-      
-      out << " meters, " << setprecision(4)
-          << ossim::mtrs2usft(projectionInfo->centerEastingNorthingPt().y)
-          << " U.S. feet";
-      
-      out << endl << endl;
-      
-      out 
-         << "\nNOTE:  Lat/Lon values are in decimal degrees.";
-      
-      out 
-         << "\n       Eastings/Northings are in meters.";
-      
-      out << endl;
-      
-      delete projectionInfo;
-   }
-   
-   out.close();
-   return true;
-}
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
-void ossimReadmeFileWriter::getMetadatatypeList(std::vector<ossimString>& metadatatypeList) const
-{
-   metadatatypeList.push_back(ossimString("ossim_readme")); 
-}
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
-bool ossimReadmeFileWriter::hasMetadataType(const ossimString& metadataType) const
-{
-   return (metadataType == "ossim_readme");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimRectangleCutFilter.cpp b/ossim/src/ossim/imaging/ossimRectangleCutFilter.cpp
deleted file mode 100644
index 64bb82a..0000000
--- a/ossim/src/ossim/imaging/ossimRectangleCutFilter.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRectangleCutFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimRectangleCutFilter.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-
-static ossimTrace traceDebug("ossimRectangleCutFilter:debug");
-
-RTTI_DEF1(ossimRectangleCutFilter,
-          "ossimRectangleCutFilter",
-          ossimImageSourceFilter);
-
-ossimRectangleCutFilter::ossimRectangleCutFilter(ossimObject* owner,
-                                     ossimImageSource* inputSource)
-   :ossimImageSourceFilter(owner, inputSource),
-    theCutType(OSSIM_RECTANGLE_NULL_OUTSIDE)
-{
-   theRectangle.makeNan();
-}
-
-ossimRectangleCutFilter::ossimRectangleCutFilter(ossimImageSource* inputSource)
-   :ossimImageSourceFilter(NULL, inputSource),
-    theCutType(OSSIM_RECTANGLE_NULL_OUTSIDE)
-{
-   theRectangle.makeNan();
-}
-
-
-ossimRefPtr<ossimImageData> ossimRectangleCutFilter::getTile(
-   const ossimIrect& rect,
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> tile = 0;
-
-   if ( theInputConnection && isSourceEnabled() && ( theRectangle.hasNans() == false ) )
-   {
-      ossim_int32 decimationIndex = min((ossim_int32)resLevel,
-                                        (ossim_int32)theDecimationList.size()-1);
-
-      // Compute cut rect for resLevel:
-      ossimIrect cutRect = theRectangle*theDecimationList[decimationIndex];
-
-      // Check intersection of our cut rect:
-      bool requestIntersects = rect.intersects( cutRect );
-      bool requestCompletelyWithin = rect.completely_within(cutRect);
-      
-      if ( ( ( theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE ) && requestIntersects ) ||
-           ( ( theCutType == OSSIM_RECTANGLE_NULL_INSIDE ) && !requestCompletelyWithin ) )
-      {
-         // Grab tile from the input.
-         tile = theInputConnection->getTile(rect, resLevel);
-
-         if ( tile.valid() )
-         {
-            if ( tile->getDataObjectStatus() != OSSIM_NULL &&
-                 tile->getDataObjectStatus() != OSSIM_EMPTY )
-            {
-               ossimIrect inputRectangle = tile->getImageRectangle();
-               
-               if( theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE ) // Typical case...
-               {
-                  if ( !requestCompletelyWithin )
-                  {
-                     // Clip the tile:
-                     ossim_int32 ulx = inputRectangle.ul().x;
-                     ossim_int32 uly = inputRectangle.ul().y;
-                     ossim_int32 w   = tile->getWidth();
-                     ossim_int32 h   = tile->getHeight();
-                     ossim_int32 offset = 0;
-                     ossimIpt tempPoint(ulx, uly);
-                     
-                     for(ossim_int32 y = 0;  y < h; ++tempPoint.y,++y)
-                     {
-                        tempPoint.x = ulx;
-                        for(ossim_int32 x = 0; x < w; ++tempPoint.x,++x)
-                        {
-                           if(!cutRect.pointWithin(tempPoint))
-                           {
-                              tile->setNull(offset);
-                           }
-                           ++offset;
-                        }
-                     }
-                     tile->validate();
-                  }
-               }
-               else // Null inside...
-               {
-                  // Note if complete within requested rect this block was bypassed entirely.
-                  ossim_int32 ulx = inputRectangle.ul().x;
-                  ossim_int32 uly = inputRectangle.ul().y;
-                  ossim_int32 w   = tile->getWidth();
-                  ossim_int32 h   = tile->getHeight();
-                  ossim_int32 offset = 0;
-                  ossimIpt tempPoint(ulx, uly);
-                  
-                  for(ossim_int32 y = 0;  y < h; ++tempPoint.y,++y)
-                  {
-                     tempPoint.x = ulx;
-                     for(ossim_int32 x = 0; x < w; ++tempPoint.x,++x)
-                     {
-                        if(cutRect.pointWithin(tempPoint))
-                        {
-                           tile->setNull(offset);
-                        }
-                        ++offset;
-                     }
-                  }
-                  tile->validate();
-               }
-               
-            } // Matches: if ( tile->getDataObjectStatus() ... 
-            
-         } // Matches: if ( tile.valid() )
-         
-      } // Matches: if ( ( ( theCutType == OSSI ...
-      
-   } // Matches: if ( theInputConnection && enabled && ... 
-
-   return tile;
-} // End: ossimRectangleCutFilter::getTile( ... )
-
-void ossimRectangleCutFilter::setRectangle(const ossimIrect& rect)
-{
-   theRectangle = rect;
-
-   if(theRectangle.hasNans())
-   {
-      if(theInputConnection)
-      {
-         theRectangle = theInputConnection->getBoundingRect();
-      }
-   }
-}
-
-void ossimRectangleCutFilter::getValidImageVertices(
-   vector<ossimIpt>& validVertices,
-   ossimVertexOrdering ordering,
-   ossim_uint32 /* resLevel */)const
-{
-   ossimIrect rect = getBoundingRect();
-
-   if(ordering == OSSIM_CLOCKWISE_ORDER)
-   {
-      validVertices.push_back(rect.ul());
-      validVertices.push_back(rect.ur());
-      validVertices.push_back(rect.lr());
-      validVertices.push_back(rect.ll());
-   }
-   else
-   {
-      validVertices.push_back(rect.ul());
-      validVertices.push_back(rect.ll());
-      validVertices.push_back(rect.lr());
-      validVertices.push_back(rect.ur());
-   }
-}
-
-ossimIrect ossimRectangleCutFilter::getBoundingRect(ossim_uint32 resLevel)const
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRectangleCutFilter::getBoundingRect DEBUG: entered..." << std::endl;
-   }
-   ossimIrect result;
-
-   result.makeNan();
-   if(!theInputConnection)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRectangleCutFilter::getBoundingRect DEBUG: Input connection was not valid so leaving" << std::endl;
-      }
-      return result;
-   }
-
-   result = theInputConnection->getBoundingRect(resLevel);
-   if(isSourceEnabled())
-   {
-      if(theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE)
-      {
-         ossimDpt decimation;
-         getDecimationFactor(resLevel, decimation);
-         ossimIrect cutRect = theRectangle;
-         if(!decimation.hasNans())
-         {
-            cutRect = theRectangle*decimation;
-         }
-         result = cutRect;
-      }
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRectangleCutFilter::getBoundingRect DEBUG: cut rect = " << result  << std::endl;
-   }
-   return result;
-}
-
-void ossimRectangleCutFilter::initialize()
-{
-   theDecimationList.clear();
-   if(theInputConnection)
-   {
-      getDecimationFactors(theDecimationList);
-   }
-   if(theDecimationList.empty())
-   {
-      theDecimationList.push_back(ossimDpt(1,1));
-   }
-   if(theRectangle.hasNans())
-   {
-      setRectangle(theRectangle);
-   }
-}
-
-bool ossimRectangleCutFilter::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)const
-{
-   ossimString newPrefix = prefix;
-   newPrefix+="clip_rect.";
-   
-   theRectangle.saveState(kwl, newPrefix);
-
-   if(theCutType == OSSIM_RECTANGLE_NULL_INSIDE)
-   {
-      kwl.add(prefix,
-              "cut_type",
-              "null_inside",
-              true);
-   }
-   else if(theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE)
-   {
-      kwl.add(prefix,
-              "cut_type",
-              "null_outside",
-              true);      
-   }
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimRectangleCutFilter::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   ossimString newPrefix = prefix;
-   
-   ossimString rect = kwl.find(prefix, "rect");
-   if(!rect.empty())
-   {
-      theRectangle.toRect(rect);
-   }
-   else 
-   {
-      newPrefix+="clip_rect.";
-      
-      theRectangle.loadState(kwl, newPrefix.c_str());
-   }
-
-   const char* cutType = kwl.find(prefix, "cut_type");
-   if(cutType)
-   {
-      ossimString c = cutType;
-      if(c == "null_inside")
-      {
-         theCutType = OSSIM_RECTANGLE_NULL_INSIDE;
-      }
-      else if(c == "null_outside")
-      {
-         theCutType = OSSIM_RECTANGLE_NULL_OUTSIDE;         
-      }
-      else
-      {
-         theCutType = static_cast<ossimRectangleCutType>(ossimString(cutType).toLong());
-      }
-   }
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-const ossimIrect& ossimRectangleCutFilter::getRectangle()const
-{
-   return theRectangle;
-}
-
-ossimRectangleCutFilter::ossimRectangleCutType ossimRectangleCutFilter::getCutType()const
-{
-   return theCutType;
-}
-
-void ossimRectangleCutFilter::setCutType(ossimRectangleCutType cutType)
-{
-   theCutType = cutType;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimResampler.cpp b/ossim/src/ossim/imaging/ossimResampler.cpp
deleted file mode 100644
index df7a111..0000000
--- a/ossim/src/ossim/imaging/ossimResampler.cpp
+++ /dev/null
@@ -1,1251 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//
-// Description:
-//
-// Contains class definition for ossimResampler.
-// 
-//*******************************************************************
-//  $Id: ossimResampler.cpp 20204 2011-11-04 15:12:28Z dburken $
-
-
-#include <iostream>
-using namespace std;
-#include <ossim/imaging/ossimResampler.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimFilter.h>
-#include <ossim/imaging/ossimTilePatch.h>
-#include <ossim/imaging/ossimImageHandler.h>
-
-RTTI_DEF1(ossimResampler, "ossimResampler", ossimConnectableObject)
-
-
-static const char* RESAMPLER_CONVOLUTION_TYPE_KW = "convolution_type";
-static const char* RESAMPLER_SCALE_X_KW          = "scale_x";
-static const char* RESAMPLER_SCALE_Y_KW          = "scale_y";
-static const char* RESAMPLER_CUBIC_PARAMETER_KW  = "cubic_parameter";
-
-ossimResampler::ossimResampler()
-   :ossimConnectableObject(NULL,0,0,true, false),
-    theOutputToInputRatio(1,1),
-    theResamplerType(ossimResampler_NONE),
-    theTableWidthX(0),
-    theTableWidthY(0),
-    theTableHeight(0),
-    theKernelWidth(0),
-    theKernelHeight(0),
-    theWeightTableX(NULL),
-    theWeightTableY(NULL),
-    theCubicAdjustableParameter(-.5)
-{
-}
-
-ossimResampler::~ossimResampler()
-{
-   deleteWeightTable();
-}
-
-void ossimResampler::resample(ossimImageData* input,
-                              ossimImageData* output)
-{
-   if(!input||
-      !output ||
-      !input->getBuf() ||
-      !output->getBuf())
-   {
-      return;
-   }
-
-   if(theWeightTableX&&theWeightTableY)
-   {
-      ossimScalarType scalarType = input->getScalarType();
-      switch(scalarType)
-      {
-         case OSSIM_UINT8:
-         {
-            resampleTile(ossim_uint8(0), // dummy template variable
-                         input,
-                         output);
-            break;
-         }
-         case OSSIM_UINT16:
-         case OSSIM_USHORT11:
-         {
-            resampleTile(ossim_uint16(0), // dummy template variable
-                         input,
-                         output);
-            break;
-         }
-         case OSSIM_SSHORT16:
-         {
-            resampleTile(ossim_sint16(0), // dummy template variable
-                         input,
-                         output);
-            break;
-         }      
-         case OSSIM_UINT32:
-         {
-            resampleTile(ossim_uint32(0), // dummy template variable
-                         input,
-                         output);
-            break;
-         }      
-         case OSSIM_FLOAT32:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            resampleTile(ossim_float32(0.0), // dummy template variable
-                         input,
-                         output);
-            break;
-         }
-         case OSSIM_FLOAT64:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            resampleTile(ossim_float64(0.0), // dummy template variable
-                         input,
-                         output);
-            break;
-         }
-         default:
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimResampler::resample error: unknown scalar type:  "
-               << scalarType
-               << endl;
-            
-         }
-      }
-   }      
-   // convolve the input and copy to output.
-}
-
-void ossimResampler::resample(ossimImageData* input,
-                              ossimImageData* output,
-                              const ossimDpt& ul,
-                              const ossimDpt& ur,
-                              const ossimDpt& deltaUl,
-                              const ossimDpt& deltaUr,
-                              const ossimDpt& length)
-{
-   resample(input,
-            output,
-            output->getImageRectangle(),
-            ul,
-            ur,
-            deltaUl,
-            deltaUr,
-            length);
-}
-
-void ossimResampler::resample(ossimImageData* input,
-                              ossimImageData* output,
-                              const ossimIrect& outputSubRect,
-                              const ossimDpt& ul,
-                              const ossimDpt& ur,
-                              const ossimDpt& deltaUl,
-                              const ossimDpt& deltaUr,
-                              const ossimDpt& length)
-{
-   if(!input||
-      !output ||
-      !input->getBuf() ||
-      !output->getBuf())
-   {
-      return;
-   }
-   
-   if(theWeightTableX&&theWeightTableY)
-   {
-      ossimScalarType scalarType = input->getScalarType();
-      switch(scalarType)
-      {
-         case OSSIM_UINT8:
-         {
-            resampleTile(ossim_uint8(0), // dummy template variable
-                         input,
-                         output,
-                         outputSubRect,
-                         ul,
-                         ur,
-                         deltaUl,
-                         deltaUr,
-                         length);
-            break;
-         }
-         case OSSIM_UINT16:
-         case OSSIM_USHORT11:
-         {
-            resampleTile(ossim_uint16(0), // dummy template variable
-                         input,
-                         output,
-                         outputSubRect,
-                         ul,
-                         ur,
-                         deltaUl,
-                         deltaUr,
-                         length);
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            resampleTile(ossim_sint16(0), // dummy template variable
-                         input,
-                         output,
-                         outputSubRect,
-                         ul,
-                         ur,
-                         deltaUl,
-                         deltaUr,
-                         length);
-            break;
-         }      
-         case OSSIM_UINT32:
-         {
-            resampleTile(ossim_uint32(0), // dummy template variable
-                         input,
-                         output,
-                         outputSubRect,
-                         ul,
-                         ur,
-                         deltaUl,
-                         deltaUr,
-                         length);
-            break;
-         }      
-         case OSSIM_FLOAT32:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            resampleTile(ossim_float32(0.0), // dummy template variable
-                         input,
-                         output,
-                         outputSubRect,
-                         ul,
-                         ur,
-                         deltaUl,
-                         deltaUr,
-                         length);
-            break;
-         }
-         case OSSIM_FLOAT64:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            resampleTile(ossim_float64(0.0), // dummy template variable
-                         input,
-                         output,
-                         outputSubRect,
-                         ul,
-                         ur,
-                         deltaUl,
-                         deltaUr,
-                         length);
-            break;
-         }
-         default:
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimResampler::resample error: unknown scalar type:  "
-               << scalarType
-               << endl;
-         }
-      }
-   }
-   
-}
-
-void ossimResampler::resampleNearestNeighbor(ossimImageData* input,
-                                             ossimImageData* output,
-                                             const ossimIrect& outputSubRect,
-                                             const ossimDpt& ul,
-                                             const ossimDpt& ur,
-                                             const ossimDpt& deltaUl,
-                                             const ossimDpt& deltaUr,
-                                             const ossimDpt& length)
-{
-   if(!input||
-      !output ||
-      !input->getBuf() ||
-      !output->getBuf())
-   {
-      return;
-   }
-   
-   ossimScalarType scalarType = input->getScalarType();
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         resampleTileNearestNeighbor(ossim_uint8(0),// dummy template variable
-                                     input,
-                                     output,
-                                     outputSubRect,
-                                     ul,
-                                     ur,
-                                     deltaUl,
-                                     deltaUr,
-                                     length);
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         resampleTileNearestNeighbor(ossim_uint16(0),// dummy template variable
-                                     input,
-                                     output,
-                                     outputSubRect,
-                                     ul,
-                                     ur,
-                                     deltaUl,
-                                     deltaUr,
-                                     length);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         resampleTileNearestNeighbor(ossim_sint16(0),// dummy template variable
-                                     input,
-                                     output,
-                                     outputSubRect,
-                                     ul,
-                                     ur,
-                                     deltaUl,
-                                     deltaUr,
-                                     length);
-         break;
-      }      
-      case OSSIM_UINT32:
-      {
-         resampleTileNearestNeighbor(ossim_uint32(0),// dummy template variable
-                                     input,
-                                     output,
-                                     outputSubRect,
-                                     ul,
-                                     ur,
-                                     deltaUl,
-                                     deltaUr,
-                                     length);
-         break;
-      }      
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         resampleTileNearestNeighbor(ossim_float32(0.0),
-                                     input,
-                                     output,
-                                     outputSubRect,
-                                     ul,
-                                     ur,
-                                     deltaUl,
-                                     deltaUr,
-                                     length);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         resampleTileNearestNeighbor(ossim_float64(0.0),
-                                     input,
-                                     output,
-                                     outputSubRect,
-                                     ul,
-                                     ur,
-                                     deltaUl,
-                                     deltaUr,
-                                     length);
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimResampler::resample error: unknown scalar type:  "
-            << scalarType
-            << endl;
-      }
-   }   
-}
-
-void ossimResampler::resampleNearestNeighbor(ossimImageData* input,
-                                             ossimImageData* output,
-                                             const ossimDpt& ul,
-                                             const ossimDpt& ur,
-                                             const ossimDpt& deltaUl,
-                                             const ossimDpt& deltaUr,
-                                             const ossimDpt& length)
-{
-   resampleNearestNeighbor(input,
-                           output,
-                           output->getImageRectangle(),
-                           ul,
-                           ur,
-                           deltaUl,
-                           deltaUr,
-                           length);
-}
-
-
-template <class T>
-void ossimResampler::resampleTile(T,// not used
-                                  ossimImageData* input,
-                                  ossimImageData* output)
-{
-   switch(input->getDataObjectStatus())
-   {
-      case OSSIM_FULL:
-      {
-         resampleFullTile((T)0, input, output);
-         break;
-      }
-      case OSSIM_PARTIAL:
-      {      
-         resamplePartialTile((T)0, input, output);
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-}
-
-template <class T>
-void ossimResampler::resamplePartialTile(T,// not used
-                                         ossimImageData* input,
-                                         ossimImageData* output)
-{   
-   ossim_int32 maxInputSize  = std::max(input->getWidth(),  input->getHeight());
-   ossim_int32 maxOutputSize = std::max(output->getWidth(), output->getHeight());
-   ossim_int32 k;
-   double *h  = new double[maxInputSize];
-   int    *Lx = new int[maxOutputSize];
-   int    *Ly = new int[maxOutputSize];
-   ossim_int32 out_height = output->getHeight();
-   ossim_int32 out_width  = output->getWidth();
-   ossim_int32 in_width   = input->getWidth();
-   ossim_int32 in_height  = input->getHeight();
-   ossim_int32 j;
-   ossim_int32 l;
-
-   ossimIpt origin=output->getOrigin();
-   ossimIpt scaledOriginShift(input->getOrigin()*-1);
-
-   ossim_int32 evenKernelW = (ossim_int32)(!(theKernelWidth%2));
-   ossim_int32 evenKernelH = (ossim_int32)(!(theKernelHeight%2));
-   ossim_int32 kernelHorizontalShift = (ossim_int32)(-theKernelWidth/2.0+evenKernelW);
-   ossim_int32 kernelVerticalShift   = (ossim_int32)(-theKernelHeight/2.0+evenKernelH);
-   
-   for (k = 0; k < maxOutputSize; k++)
-   {
-      Lx[k] = (ossim_int32)(scaledOriginShift.x+((k+origin.x)/
-                                           theOutputToInputRatio.x));
-   }
-   for (k = 0; k < maxOutputSize; k++)
-   {
-      Ly[k] = (ossim_int32)(scaledOriginShift.y+((k+origin.y)/
-                                           theOutputToInputRatio.y));
-   }
-   for(ossim_int32 band = 0; band < (ossim_int32)input->getNumberOfBands();++band)
-   {
-      const T* inputBuf  = static_cast<T*>(input->getBuf(band));
-      T*       outputBuf = static_cast<T*>(output->getBuf(band));
-      T        minPix    = static_cast<T>(input->getMinPix(band));
-      T        maxPix    = static_cast<T>(input->getMaxPix(band));
-      T        np        = static_cast<T>(input->getNullPix(band));
-      
-      for (k = 0; k < out_height; k++)
-      {
-         ossim_int32 indexMod = (ossim_int32)fmod((k+origin.y), theOutputToInputRatio.y);
-         if(indexMod >= theTableWidthY) indexMod = theTableWidthY - 1;
-         if(indexMod <0) indexMod = 0;
-         for (j = 0; j < in_width; j++)
-         {
-            h[j] = 0.0;
-            ossim_int32 count = 0;
-            double lastValue = ossim::nan();
-            for (l = 0; l < theKernelHeight; l++)
-            {
-               ossim_int32 index = Ly[k] + l + kernelVerticalShift;
-               if ((index >= 0) && (index < in_height))
-               {
-                  ossim_int32 offset = index*in_width +j;
-                  if(!input->isNull(offset))
-                  {
-                     lastValue = (double)inputBuf[offset];
-                     h[j] += lastValue *
-                             theWeightTableY[theKernelHeight - l-1][indexMod];
-                     ++count;
-                  }
-                  // I think instead of skipping to next value I'll just assume 0
-                  
-                  // this was code to skip to next non-null value and use it
-                  // 
-//                   else
-//                   {
-//                      for(ossim_int32 templ = l; templ < theKernelHeight; ++templ)
-//                      {
-//                         index = Ly[k] + templ + kernelVerticalShift;
-//                         offset = index*in_width +j;
-//                         if(!input->isNull(offset))
-//                         {
-//                            lastValue = (double)inputBuf[offset];
-//                            break;
-//                         }
-//                      }
-//                      if(ossim::isnan(lastValue) == false)
-//                      {
-//                         h[j] += lastValue *
-//                                 theWeightTableY[theKernelHeight - l-1][indexMod];
-                        
-//                         ++count;
-//                      }
-//                      else
-//                      {
-//                         break;
-//                      }
-//                   }
-               }
-            }
-            if(!count)
-            {
-               h[j] = ossim::nan();
-            }
-         }
-         for (ossim_int32 m = 0; m < out_width; m++)
-         {
-            double x = 0.0;
-            ossim_int32 indexMod = (ossim_int32)fmod((m+origin.x), theOutputToInputRatio.x);
-            if(indexMod >= theTableWidthX) indexMod = theTableWidthX-1;
-            if(indexMod <0) indexMod = 0;
-            
-            if(input->isNull(ossimIpt(Lx[m]-scaledOriginShift.x, Ly[k]-scaledOriginShift.y)))
-            {
-               outputBuf[k*out_width +m] = np;
-            }
-            else
-            {
-               for (l = 0; l < theKernelWidth; l++)
-               {
-                  ossim_int32 index = Lx[m] + l + kernelHorizontalShift;
-                  if ((index >= 0) && (index < in_width))
-                  {
-                     if(ossim::isnan(h[index]) == false)
-                     {
-                        x += h[index] * theWeightTableX[theKernelWidth - l-1][indexMod];
-                     }
-
-                     // I am commenting out the code that searches for the next
-                     // non null value with the kernel range.  This will have the
-                     // same effect as multiplying by 0.0 for the NULL value.
-                     //
-//                      else
-//                      {
-//                         for(ossim_int32 templ = l; templ < l; ++templ)
-//                         {
-//                            ossim_int32 index = Lx[m] + templ + kernelHorizontalShift;
-//                            if(ossim::isnan(h[index]) == false))
-//                            {
-//                               lastValue = h[index];
-//                               break;
-//                            }
-//                         }
-//                         if(ossim::isnan(lastValue) == false)
-//                         {
-//                            x += lastValue * theWeightTableX[theKernelWidth - l-1][indexMod];
-//                         }
-//                      }
-                  }
-               }
-               if (x < minPix)
-               {
-                  outputBuf[k*out_width +m] = static_cast<T>(minPix);
-               }
-               else if (x > maxPix)
-               {
-                  outputBuf[k*out_width +m] = static_cast<T>(maxPix);
-               }
-               else
-               {
-                  outputBuf[k*out_width +m] = static_cast<T>(x);
-               }
-            }
-         }
-      }
-   }
-   
-   delete [] h;
-   delete [] Lx;   
-   delete [] Ly;
-}
-
-template <class T>
-void ossimResampler::resampleFullTile(T,// not used
-                                      ossimImageData* input,
-                                      ossimImageData* output)
-{
-   ossim_int32 maxInputSize  = std::max(input->getWidth(),  input->getHeight());
-   ossim_int32 maxOutputSize = std::max(output->getWidth(), output->getHeight());
-   ossim_int32 k;
-   double *h     = new double[maxInputSize];
-   ossim_int32 *Lx        = new ossim_int32[maxOutputSize];
-   ossim_int32 *Ly        = new ossim_int32[maxOutputSize];
-   ossim_int32 out_height = output->getHeight();
-   ossim_int32 out_width  = output->getWidth();
-   ossim_int32 in_width   = input->getWidth();
-   ossim_int32 in_height  = input->getHeight();
-   ossim_int32 j;
-   ossim_int32 l;
-   
-   ossimIpt origin=output->getOrigin();
-   ossimIpt scaledOriginShift(input->getOrigin()*-1);
-
-   ossim_int32 evenKernelW = (ossim_int32)(!(theKernelWidth%2));
-   ossim_int32 evenKernelH = (ossim_int32)(!(theKernelHeight%2));
-   ossim_int32 kernelHorizontalShift = (ossim_int32)(-theKernelWidth/2.0+evenKernelW);
-   ossim_int32 kernelVerticalShift   = (ossim_int32)(-theKernelHeight/2.0+evenKernelH);
-   
-   for (k = 0; k < maxOutputSize; k++)
-   {
-      Lx[k] = (ossim_int32)(scaledOriginShift.x+((k+origin.x)/
-                                           theOutputToInputRatio.x));
-   }
-   for (k = 0; k < maxOutputSize; k++)
-   {
-      Ly[k] = (ossim_int32)(scaledOriginShift.y+((k+origin.y)/
-                                           theOutputToInputRatio.y));
-   }
-   for(ossim_int32 band = 0; band < (ossim_int32)input->getNumberOfBands();++band)
-   {
-      const T* inputBuf  = (const T*)(input->getBuf(band));
-      T*       outputBuf = (T*)(output->getBuf(band));
-      double  minPix    = static_cast<T>(input->getMinPix()[band]);
-      double  maxPix    = static_cast<T>(input->getMaxPix()[band]);
-      
-      for (k = 0; k < out_height; k++)
-      {
-         int indexMod = (int)fmod((k+origin.y), theOutputToInputRatio.y);
-         if(indexMod >= theTableWidthY) indexMod = theTableWidthY - 1;
-         if(indexMod <0) indexMod = 0;
-         for (j = 0; j < in_width; j++)
-         {
-            h[j] = 0.0;
-            for (l = 0; l < theKernelHeight; l++)
-            {
-               ossim_int32 index = Ly[k] + l + kernelVerticalShift;
-               if ((index >= 0) && (index < in_height))
-               {
-                  h[j] += ((double)inputBuf[index*in_width +j]) *
-                          theWeightTableY[theKernelHeight - l-1][indexMod];
-               }
-            }
-         }
-         for (ossim_int32 m = 0; m < out_width; m++)
-         {
-            double x = 0.0;
-            int indexMod = (int)fmod((m+origin.x), theOutputToInputRatio.x);
-            if(indexMod >= theTableWidthX) indexMod = theTableWidthX-1;
-            if(indexMod <0) indexMod = 0;
-            
-            for (l = 0; l < theKernelWidth; l++)
-            {
-               ossim_int32 index = Lx[m] + l + kernelHorizontalShift;
-               if ((index >= 0) && (index < in_width))
-               {
-         
-                  x += h[index] * theWeightTableX[theKernelWidth - l-1][indexMod];
-               }
-            }
-            if (x < minPix)
-            {
-               outputBuf[k*out_width +m] = static_cast<T>(minPix);
-            }
-            else if (x > maxPix)
-            {
-               outputBuf[k*out_width +m] = static_cast<T>(maxPix);
-            }
-            else
-            {
-               outputBuf[k*out_width +m] = static_cast<T>(x);
-            }
-         }
-      }
-   }
-   
-   delete [] h;
-   delete [] Lx;   
-   delete [] Ly;
-}
-
-
-
-template <class T>
-void ossimResampler::resampleTile(T,// not used
-                                  ossimImageData* input,
-                                  ossimImageData* output,
-                                  const ossimIrect& outputSubRect,
-                                  const ossimDpt& inputUl,
-                                  const ossimDpt& inputUr,
-                                  const ossimDpt& deltaUl,
-                                  const ossimDpt& deltaUr,
-                                  const ossimDpt& outLength)
-{
-   ossimRefPtr<ossimImageData> dupIn = input;
-   ossimDpt origin = input->getOrigin();
-   ossimDpt newInputUl = inputUl;
-   ossimDpt newInputUr = inputUr;
-   ossimDpt newDeltaUl = deltaUl;
-   ossimDpt newDeltaUr = deltaUr;
-
-   if(theResamplerType != ossimResampler_NEAREST_NEIGHBOR)
-   {
-      newInputUl = ossimDpt(inputUl.x * theOutputToInputRatio.x,
-                            inputUl.y * theOutputToInputRatio.y);
-      newInputUr = ossimDpt(inputUr.x * theOutputToInputRatio.x,
-                            inputUr.y * theOutputToInputRatio.y);
-      newDeltaUl = ossimDpt(deltaUl.x * theOutputToInputRatio.x,
-                            deltaUl.y * theOutputToInputRatio.y);
-      newDeltaUr = ossimDpt(deltaUr.x * theOutputToInputRatio.x,
-                            deltaUr.y * theOutputToInputRatio.y);
-
-      ossimDpt newLl = newInputUl + newDeltaUl*outLength.y;
-      ossimDpt newLr = newInputUr + newDeltaUr*outLength.y;
-      
-      ossimDrect newBoundingRect(newInputUl,
-                                 newInputUr,
-                                 newLl,
-                                 newLr);
-      
-
-      newBoundingRect = ossimDrect(newBoundingRect.ul() - ossimDpt(theKernelWidth, theKernelHeight),
-                                   newBoundingRect.lr() + ossimDpt(theKernelWidth, theKernelHeight));
-      ossimIrect roundedRect = newBoundingRect;
-      origin = roundedRect.ul();
-
-      dupIn = new ossimImageData(NULL,
-                                 input->getScalarType(),
-                                 input->getNumberOfBands(),
-                                 roundedRect.width(),
-                                 roundedRect.height());
-      dupIn->setOrigin(roundedRect.ul());
-      dupIn->initialize();
-      resampleTile(static_cast<T>(0), input, dupIn.get());
-   }
-   long    inWidth        = dupIn->getWidth();
-   long    inHeight       = dupIn->getHeight();
-   double  stepSizeWidth  = 1.0/outLength.x;
-   double  stepSizeHeight = 1.0/outLength.y;   
-   ossimIrect rect = dupIn->getImageRectangle();
-   
-   ossimDpt startSave(newInputUl.x - rect.ul().x,
-                      newInputUl.y - rect.ul().y );
-   ossimDpt endSave(newInputUr.x - rect.ul().x,
-                    newInputUr.y - rect.ul().y);
-
-   ossimIrect outputRect = output->getImageRectangle();
-   ossimIpt subRectUl = outputSubRect.ul();
-   long     subRectH  = outputSubRect.height();
-   long     subRectW  = outputSubRect.width();
-   
-   ossimIpt outputRectUl    = outputRect.ul();
-   long outputRectW         = outputRect.width();
-   long resultOffset = (subRectUl.y - outputRectUl.y)*outputRectW + (subRectUl.x - outputRectUl.x);
-
-   for(ossim_uint32 band = 0; band < input->getNumberOfBands(); band++)
-   {
-      T* resultBuf       = static_cast<T*>(output->getBuf(band))+resultOffset;
-      const T *sourceBuf = static_cast<T*>(dupIn->getBuf(band));
-      ossimDpt start = startSave;
-      ossimDpt end   = endSave;
-      T np = (T)output->getNullPix(band);
-                        
-      for(long y = 0; y < subRectH; y++)
-      {
-         double deltaX = (end.x - start.x)*stepSizeWidth;
-         double deltaY = (end.y - start.y)*stepSizeHeight;
-         ossimDpt pointXY = start;
-         
-         for(long x = 0; x < subRectW; x++)
-         {
-            int xPixel = pointXY.x<0?(int)floor(pointXY.x):(int)pointXY.x;
-            int yPixel = pointXY.y<0?(int)floor(pointXY.y):(int)pointXY.y;
-
-            
-            if( (xPixel >=0) && (xPixel < inWidth) &&
-                (yPixel >=0) && (yPixel < inHeight))
-            {
-               resultBuf[x] = sourceBuf[yPixel*inWidth + xPixel];
-            }
-            else
-            {
-               resultBuf[x] = np;
-            }
-            
-            pointXY.y += deltaY;
-            pointXY.x += deltaX;
-         }
-         resultBuf += outputRectW;
-         
-         start.x += newDeltaUl.x;
-         start.y += newDeltaUl.y;
-         end.x   += newDeltaUr.x;
-         end.y   += newDeltaUr.y;
-      }
-   }
-   dupIn = 0;
-}
-
-template <class T>
-void ossimResampler::resampleTileNearestNeighbor(T, // dummy template variable
-                                                 ossimImageData* input,
-                                                 ossimImageData* output,
-                                                 const ossimDpt& ul,
-                                                 const ossimDpt& ur,
-                                                 const ossimDpt& deltaUl,
-                                                 const ossimDpt& deltaUr,
-                                                 const ossimDpt& length)
-{
-   resampleTileNearestNeighbor((T)0,
-                               input,
-                               output,
-                               output->getImageRectangle(),
-                               ul,
-                               ur,
-                               deltaUl,
-                               deltaUr,
-                               length);
-}
-
-template <class T>
-void ossimResampler::resampleTileNearestNeighbor(T, // dummy template variable
-                                                 ossimImageData* input,
-                                                 ossimImageData* output,
-                                                 const ossimIrect& outputSubRect,
-                                                 const ossimDpt& ul,
-                                                 const ossimDpt& ur,
-                                                 const ossimDpt& deltaUl,
-                                                 const ossimDpt& deltaUr,
-                                                 const ossimDpt& length)
-{   
-   long    inWidth        = input->getWidth();
-   long    inHeight       = input->getHeight();
-   double  stepSizeWidth  = 1.0/length.x;
-   double  stepSizeHeight = 1.0/length.y;
-   ossimIrect rect        = input->getImageRectangle();
-   
-   ossimDpt startSave(ul.x - rect.ul().x,
-                      ul.y - rect.ul().y );
-   
-   ossimDpt endSave(ur.x - rect.ul().x,
-                    ur.y - rect.ul().y);
-
-   ossimIrect outputRect = output->getImageRectangle();
-   ossimIpt subRectUl = outputSubRect.ul();
-//   ossimIpt subRectUl((int)outputSubRect.ul().x,
-//                      (int)outputSubRect.ul().y);
-   long     subRectH  = outputSubRect.height();
-   long     subRectW  = outputSubRect.width();
-   
-   ossimIpt outputRectUl    = outputRect.ul();
-   long outputRectW         = outputRect.width();
-
-   long resultOffset = (subRectUl.y - outputRectUl.y)*outputRectW + (subRectUl.x - outputRectUl.x);
-   for(ossim_uint32 band = 0; band < input->getNumberOfBands(); band++)
-   {
-      T* resultBuf       = static_cast<T*>(output->getBuf(band))+resultOffset;
-      const T *sourceBuf = static_cast<T*>(input->getBuf(band));
-      ossimDpt start = startSave;
-      ossimDpt end   = endSave;
-      T inNp  = (T)input->getNullPix(band);
-      T outNp = (T)output->getNullPix(band);
-                        
-      for(long y = 0; y < subRectH; y++)
-      {
-         double deltaX = (end.x - start.x)*stepSizeWidth;
-         double deltaY = (end.y - start.y)*stepSizeHeight;
-         ossimDpt pointXY = start;
-         
-         for(long x = 0; x < subRectW; x++)
-         {
-            int xPixel = pointXY.x<0?(int)floor(pointXY.x):(int)pointXY.x;
-            int yPixel = pointXY.y<0?(int)floor(pointXY.y):(int)pointXY.y;
-
-            
-             if( (xPixel >=0) && (xPixel < inWidth) &&
-                 (yPixel >=0) && (yPixel < inHeight))
-             {
-                T value = sourceBuf[yPixel*inWidth + xPixel];
-
-                if(value != inNp)
-                {
-                   resultBuf[x] = value;
-                }
-                else
-                {
-                   resultBuf[x] = outNp;
-                }
-            }
-            else
-            {
-               resultBuf[x] = outNp;
-            }
-            
-            pointXY.y += deltaY;
-            pointXY.x += deltaX;
-         }
-         resultBuf += outputRectW;
-         
-         start.x += deltaUl.x;
-         start.y += deltaUl.y;
-         end.x   += deltaUr.x;
-         end.y   += deltaUr.y;
-      }
-   }
-}
-
-ossim_int32 ossimResampler::getKernelWidth()const
-{
-   return theKernelWidth;
-}
-
-ossim_int32 ossimResampler::getKernelHeight()const
-{
-   return theKernelHeight;
-}
-
-void ossimResampler::deleteWeightTable()
-{
-   if(theWeightTableX)
-   {
-      for(ossim_int32 index = 0; index < theTableHeight; ++index)
-      {
-         delete [] theWeightTableX[index];
-      }
-      delete [] theWeightTableX;
-
-      theWeightTableX = NULL;
-   }
-   if(theWeightTableY)
-   {
-      for(ossim_int32 index = 0; index < theTableHeight; ++index)
-      {
-         delete [] theWeightTableY[index];
-      }
-      delete [] theWeightTableY;
-
-      theWeightTableY = NULL;
-   }
-}
-
-void ossimResampler::allocateWeightTable()//uint32 outWidth)
-{
-   if(theWeightTableX||
-      theWeightTableY)
-   {
-      deleteWeightTable();
-   }
-   
-   switch(theResamplerType)
-   {
-   case ossimResampler_BICUBIC:
-   {
-      theTableHeight = 4;
-      break;
-   }
-   case ossimResampler_BILINEAR:
-   {
-      theTableHeight = 2;
-      break;
-   }
-   case ossimResampler_NEAREST_NEIGHBOR:
-   {
-      theTableHeight = 1;
-      break;
-   }
-   case ossimResampler_NONE:
-     {
-       theResamplerType = ossimResampler_NEAREST_NEIGHBOR;
-      theTableHeight = 1;
-      break;
-     }
-   }
-   theTableWidthX = (ossim_int32)ossim::round<int>(theOutputToInputRatio.x);
-   theTableWidthY = (ossim_int32)ossim::round<int>(theOutputToInputRatio.y);
-   if(theTableWidthX&&theTableHeight)
-   {
-      theWeightTableX = new double*[theTableHeight];
-      
-      for(ossim_int32 index = 0; index < theTableHeight; ++index)
-      {
-         theWeightTableX[index] = new double[theTableWidthX];
-      }
-   }
-   if(theTableWidthY&&theTableHeight)
-   {
-      theWeightTableY = new double*[theTableHeight];
-      
-      for(ossim_int32 index = 0; index < theTableHeight; ++index)
-      {
-         theWeightTableY[index] = new double[theTableWidthY];
-      }
-   }
-}
-
-void ossimResampler::generateWeightTable()
-{
-   if(theWeightTableX&&
-      theWeightTableY)
-   {
-//      ossim_int32 d = theOutputToInputRatio.theDen;
-//      ossim_int32 n = theOutputToInputRatio.theNum;
-      ossim_int32 i = 0;
-      
-      double x = 0.0;
-      
-      switch(theResamplerType)
-      {
-   case ossimResampler_NONE:
-     {
-       theResamplerType = ossimResampler_NEAREST_NEIGHBOR;
-       for (i = 0; i < theTableWidthY; i++)
-         {
-	   theWeightTableY[0][i] = 1;
-         }
-       for (i = 0; i < theTableWidthX; i++)
-         {
-	   theWeightTableX[0][i] = 1;
-         }
-      break;
-     }
-      case ossimResampler_NEAREST_NEIGHBOR:
-      {         
-         for (i = 0; i < theTableWidthY; i++)
-         {
-            theWeightTableY[0][i] = 1;
-         }
-         for (i = 0; i < theTableWidthX; i++)
-         {
-            theWeightTableX[0][i] = 1;
-         }
-         break;
-      }
-      case ossimResampler_BILINEAR:
-      {
-         for (i = 0; i < theTableWidthX; i++)
-         {
-            x = (double)i/(double)(theTableWidthX);
-            theWeightTableX[0][i] = x;
-            theWeightTableX[1][i] = 1-x;
-         }
-         for (i = 0; i < theTableWidthY; i++)
-         {
-            x = (double)i/(double)(theTableWidthY);
-            theWeightTableY[0][i] = x;
-            theWeightTableY[1][i] = 1-x;
-         }
-         break;
-      }
-      case ossimResampler_BICUBIC:
-      {         
-         for (i = 0; i < theTableWidthX; i++)
-         {
-            x = (double)i/(double)(theTableWidthX);
-            theWeightTableX[0][i] = getCubicC0(x);
-            theWeightTableX[1][i] = getCubicC1(x);
-            theWeightTableX[2][i] = getCubicC2(x);
-            theWeightTableX[3][i] = getCubicC3(x);               
-         }
-         for (i = 0; i < theTableWidthY; i++)
-         {
-            x = (double)i/(double)(theTableWidthY);
-            theWeightTableY[0][i] = getCubicC0(x);
-            theWeightTableY[1][i] = getCubicC1(x);
-            theWeightTableY[2][i] = getCubicC2(x);
-            theWeightTableY[3][i] = getCubicC3(x);               
-         }
-         break;
-      }
-      }
-   }
-}
-
-void ossimResampler::setResamplerType(ossimResLevelResamplerType type)
-{
-   if(theResamplerType != type)
-   {
-      theResamplerType = type;
-      
-      switch(theResamplerType)
-      {
-      case ossimResampler_NONE:
-      {
-	theResamplerType = ossimResampler_NEAREST_NEIGHBOR;
-         theKernelWidth  = 1;
-         theKernelHeight = 1;
-
-         break;
-      }
-      case ossimResampler_NEAREST_NEIGHBOR:
-      {
-         theKernelWidth  = 1;
-         theKernelHeight = 1;
-
-         break;
-      }
-      case ossimResampler_BILINEAR:
-      {
-         theKernelWidth  = 2;
-         theKernelHeight = 2;
-
-         break;
-      }
-      case ossimResampler_BICUBIC:
-      {
-         theKernelWidth  = 4;
-         theKernelHeight = 4;
-         
-         break;
-      }
-      }
-      
-      allocateWeightTable();
-      generateWeightTable();
-   }
-}
-
-void ossimResampler::setRatio(double outputToInputRatio)
-{
-   // make it square
-   setRatio(ossimDpt(outputToInputRatio, outputToInputRatio));
-}
-
-void ossimResampler::setRatio(const ossimDpt& outputToInputRatio)
-{
-   // make it square
-   theOutputToInputRatio.x = (outputToInputRatio.x);
-   theOutputToInputRatio.y = (outputToInputRatio.y);
-
-   if((theTableWidthX != ossim::round<int>(outputToInputRatio.x))||
-      (theTableWidthY != ossim::round<int>(outputToInputRatio.y)))
-   {
-      allocateWeightTable();
-      generateWeightTable();
-   }
-}
-
-double ossimResampler::getCubicC0(double t)const
-{
-   return ((-theCubicAdjustableParameter * t * t * t) +
-           (theCubicAdjustableParameter * t * t));
-}
-
-double ossimResampler::getCubicC1(double t)const
-{
-   return (-(theCubicAdjustableParameter + 2.0) * t * t * t +
-           (2.0 * theCubicAdjustableParameter + 3.0) * t * t -
-           theCubicAdjustableParameter * t);
-}
-
-double ossimResampler::getCubicC2(double t)const
-{
-   return ((theCubicAdjustableParameter + 2.0) * t * t * t -
-           (theCubicAdjustableParameter + 3.0) * t * t + 1.0);
-}
-
-double ossimResampler::getCubicC3(double t)const
-{
-   return ((theCubicAdjustableParameter * t * t * t) -
-           (2.0f * theCubicAdjustableParameter * t * t) +
-           (theCubicAdjustableParameter * t));
-}
-
-bool ossimResampler::loadState(const ossimKeywordlist& kwl,
-                               const char* prefix)
-{   
-   const char* resamplerType = kwl.find(prefix, RESAMPLER_CONVOLUTION_TYPE_KW);
-   const char* scaleX        = kwl.find(prefix, RESAMPLER_SCALE_X_KW);
-   const char* scaleY        = kwl.find(prefix, RESAMPLER_SCALE_Y_KW);
-   const char* cubicParameter= kwl.find(prefix, RESAMPLER_CUBIC_PARAMETER_KW);
-   
-   if(cubicParameter)
-   {
-      theCubicAdjustableParameter = ossimString(cubicParameter).toDouble();
-      if(theCubicAdjustableParameter < -1) theCubicAdjustableParameter = -1;
-      if(theCubicAdjustableParameter > 0)  theCubicAdjustableParameter = 0;
-   }
-   else
-   {
-      theCubicAdjustableParameter = -.5;
-   }
-   if(resamplerType)
-   {
-      ossimString test =ossimString(resamplerType).upcase().trim();
-      
-      if( test == "BICUBIC")
-      {
-         setResamplerType(ossimResampler::ossimResampler_BICUBIC);
-      }
-      else if( test == "BILINEAR")
-      {
-         setResamplerType(ossimResampler::ossimResampler_BILINEAR);
-      }
-      else
-      {
-         setResamplerType(ossimResampler::ossimResampler_NEAREST_NEIGHBOR);
-      }
-   }
-   if(scaleX&&scaleY)
-   {
-      setRatio(ossimDpt(ossimString(scaleX).toDouble(),
-                        ossimString(scaleY).toDouble()));
-   }
-   allocateWeightTable();
-   generateWeightTable();
-   
-   return ossimConnectableObject::loadState(kwl, prefix);
-}
-
-bool ossimResampler::saveState(ossimKeywordlist& kwl,
-                               const char* prefix)const
-{
-   ossimString resamplerType;
-   if(getResamplerType() == ossimResampler_BICUBIC)
-   {
-      resamplerType = "BICUBIC";
-   }
-   else if(getResamplerType() == ossimResampler_BILINEAR)
-   {
-      resamplerType = "BILINEAR";
-   }
-   else 
-   {
-      resamplerType = "NEAREST_NEIGHBOR";
-   }
-   kwl.add(prefix,
-           RESAMPLER_CONVOLUTION_TYPE_KW,
-           resamplerType.c_str(),
-           true);
-
-   kwl.add(prefix,
-           RESAMPLER_SCALE_X_KW,
-           theOutputToInputRatio.x,
-           true);
-
-   kwl.add(prefix,
-           RESAMPLER_SCALE_Y_KW,
-           theOutputToInputRatio.y,
-           true);
-
-   kwl.add(prefix,
-           RESAMPLER_CUBIC_PARAMETER_KW,
-           theCubicAdjustableParameter,
-           true);
-   
-   return ossimConnectableObject::saveState(kwl, prefix);
-}
diff --git a/ossim/src/ossim/imaging/ossimRgbGridRemapEngine.cpp b/ossim/src/ossim/imaging/ossimRgbGridRemapEngine.cpp
deleted file mode 100644
index 53086fb..0000000
--- a/ossim/src/ossim/imaging/ossimRgbGridRemapEngine.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-//*****************************************************************************
-// FILE: ossimRgbGridRemapEngine.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class 
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimRgbGridRemapEngine.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimRgbGridRemapEngine.h>
-
-RTTI_DEF1(ossimRgbGridRemapEngine, "ossimRgbGridRemapEngine",
-          ossimGridRemapEngine);
-
-#include <ossim/imaging/ossimGridRemapSource.h>
-#include <ossim/imaging/ossimAtbPointSource.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDblGrid.h>
-#include <ossim/imaging/ossimImageData.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimRgbGridRemapEngine:exec");
-static ossimTrace traceDebug ("ossimRgbGridRemapEngine:debug");
-
-//*****************************************************************************
-//  METHOD: ossimRgbGridRemapEngine::dup
-//  
-//*****************************************************************************
-ossimObject* ossimRgbGridRemapEngine::dup() const
-{
-   return new ossimRgbGridRemapEngine;
-}
-
-//*****************************************************************************
-//  METHOD: ossimRgbGridRemapEngine::remapTile
-//  
-//*****************************************************************************
-void ossimRgbGridRemapEngine::remapTile(const ossimDpt&       origin,
-                                        ossimGridRemapSource* remapper,
-                                        ossimRefPtr<ossimImageData>& tile)
-{
-   static const char MODULE[] = "ossimRgbGridRemapEngine::remapTile";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // Fetch tile size and NULL pixel value:
-   //***
-   int    width         = tile->getWidth();
-   int    height        = tile->getHeight();
-   int    offset        = 0;
-   double null[3];
-
-   //***
-   // Determine null pixel values so that we can recognize a null coming in and
-   // not remap it:
-   //***
-   null[0] = tile->getNullPix(0);
-   null[1] = tile->getNullPix(1);
-   null[2] = tile->getNullPix(2);
-   
-   ossimDblGrid& gridR = *(remapper->getGrid(0));
-   ossimDblGrid& gridG = *(remapper->getGrid(1));
-   ossimDblGrid& gridB = *(remapper->getGrid(2));
-      
-   //***
-   // Remap according to pixel type:
-   //***
-   switch(tile->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      ossim_uint8* red_buf  = (ossim_uint8*)tile->getBuf(0);
-      ossim_uint8* grn_buf  = (ossim_uint8*)tile->getBuf(1);
-      ossim_uint8* blu_buf  = (ossim_uint8*)tile->getBuf(2);
-      short  pixel_buffer[3];
-      
-      for (double line=origin.line; line<origin.line+height; line+=1.0)
-      {
-         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
-         {
-            //***
-            // Scan for null pixel before adding remap delta:
-            //***
-            if ((red_buf[offset] != (ossim_uint8) null[0]) &&
-                (grn_buf[offset] != (ossim_uint8) null[1]) &&
-                (blu_buf[offset] != (ossim_uint8) null[2]))
-            {
-               //***
-               // Remap RGB pixel with spatially variant bias value:
-               //***
-               pixel_buffer[0] = red_buf[offset] + (short) gridR(samp,line);
-               pixel_buffer[1] = grn_buf[offset] + (short) gridG(samp,line);
-               pixel_buffer[2] = blu_buf[offset] + (short) gridB(samp,line);
-
-               //***
-               // Clamp:
-               //***
-               if      (pixel_buffer[0]<0)   red_buf[offset] = 0;
-               else if (pixel_buffer[0]>255) red_buf[offset] = 255;
-               else                          red_buf[offset] = pixel_buffer[0];
-               
-
-               if      (pixel_buffer[1]<0)   grn_buf[offset] = 0;
-               else if (pixel_buffer[1]>255) grn_buf[offset] = 255;
-               else                          grn_buf[offset] = pixel_buffer[1];
-               
-
-               if      (pixel_buffer[2]<0)   blu_buf[offset] = 0;
-               else if (pixel_buffer[2]>255) blu_buf[offset] = 255;
-               else                          blu_buf[offset] = pixel_buffer[2];
-               
-               //***
-               // Avoid NULLS:
-               //***
-               if (red_buf[offset] == (ossim_uint8) null[0]) red_buf[offset]++;
-               if (grn_buf[offset] == (ossim_uint8) null[1]) grn_buf[offset]++;
-               if (blu_buf[offset] == (ossim_uint8) null[2]) blu_buf[offset]++;
-            }
-            
-            offset++;
-         }
-      }
-      break;
-   }
-   
-   default:
-   {
-	   ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimRgbGridRemapEngine::remapTile: Scalar type not handled" << std::endl;
-	   break;
-   }
-
-   }   // end switch statement
-
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-};
-
-//*****************************************************************************
-//  METHOD: ossimRgbGridRemapEngine::assignRemapValues
-//
-//  This engine defines the target value as an RGB vector of doubles, computed
-//  as the mean of all contributor RGB values.
-//  
-//*****************************************************************************
-void ossimRgbGridRemapEngine::assignRemapValues (
-   vector<ossimAtbPointSource*>& sources_list)
-{
-   static const char MODULE[] = "ossimRgbGridRemapEngine::assignRemapValues";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   int i; // index to individual sources
-
-   //***
-   // Declare a 2D array that will contain all of the contributing sources'
-   // RGB mean values. Also declare the accumulator target vector.
-   //***
-   int num_contributors =  (int)sources_list.size();
-   double** contributor_pixel = new double* [num_contributors];
-   for (i=0; i<num_contributors; i++)
-      contributor_pixel[i] = new double[3];
-   double target_pixel[3] = {0.0, 0.0, 0.0};
-
-   //***
-   // Now loop over each remaining contributor and sum in its contribution:
-   //***
-   vector<ossimAtbPointSource*>::iterator source;
-   i = 0;
-   for(source=sources_list.begin();
-       source!=sources_list.end();
-       source++)
-   {
-      (*source)->getSourceValue(contributor_pixel[i]);
-
-      target_pixel[0] += contributor_pixel[i][0]/(double)num_contributors;
-      target_pixel[1] += contributor_pixel[i][1]/(double)num_contributors;
-      target_pixel[2] += contributor_pixel[i][2]/(double)num_contributors;
-
-      i++;
-   }
-
-   //***
-   // The target pixel has been established. Now need to compute the actual
-   // remap quantities that will be written to the appropriate remap grids:
-   //***
-   i = 0;
-   for(source=sources_list.begin();
-       source!=sources_list.end();
-       source++)
-   {
-      computeRemapNode(*source, contributor_pixel[i], target_pixel);
-      i++;
-   }
-
-   //***
-   // Delete locally allocated memory:
-   //***
-   for (i=0; i<num_contributors; i++)
-      delete [] contributor_pixel[i];
-   delete [] contributor_pixel;
-   
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimRgbGridRemapEngine::computeSourceValue
-//  
-//*****************************************************************************
-void ossimRgbGridRemapEngine::computeSourceValue(
-   ossimRefPtr<ossimImageData>& source, void* result)
-{
-   static const char MODULE[]="ossimRgbGridRemapEngine::computeSourceValue";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // This engine defines "value" as the RGB vector corresponding to the mean
-   // RGB pixel value of the source data:
-   //***
-   ((double*)result)[0] = source->computeAverageBandValue(0);
-   ((double*)result)[1] = source->computeAverageBandValue(1);
-   ((double*)result)[2] = source->computeAverageBandValue(2);
-   
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimRgbGridRemapEngine::computeRemapNode
-//
-//  This engine defines the remap value as the difference between the target
-//  RGB vector and the individual point source's value vector.
-//
-//*****************************************************************************
-void ossimRgbGridRemapEngine::computeRemapNode(ossimAtbPointSource* ps,
-                                              void* source_value,
-                                              void* target_value)
-{
-   static const char MODULE[] = "ossimRgbGridRemapEngine::computeRemapNode";
-   if (traceExec())  CLOG << "entering..." << endl;
-
-   //***
-   // Compute the remap grid node value specific to this RGB implementation:
-   //***
-   double node[3];
-   node[0] = ((double*)target_value)[0] - ((double*)source_value)[0];
-   node[1] = ((double*)target_value)[1] - ((double*)source_value)[1];
-   node[2] = ((double*)target_value)[2] - ((double*)source_value)[2];
-
-   //***
-   // Fetch a pointer to the remapper feeding this point source in order to
-   // pass it the node value:
-   //***
-   ossimGridRemapSource* remapper = ps->getRemapSource();
-   remapper->setGridNode(ps->getViewPoint(), node);
-
-   if (traceExec())  CLOG << "returning..." << endl;
-   return;
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimRgbToGreyFilter.cpp b/ossim/src/ossim/imaging/ossimRgbToGreyFilter.cpp
deleted file mode 100644
index bfb105c..0000000
--- a/ossim/src/ossim/imaging/ossimRgbToGreyFilter.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToGreyFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimRgbToGreyFilter.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-RTTI_DEF1(ossimRgbToGreyFilter, "ossimRgbToGreyFilter", ossimImageSourceFilter)
-
-ossimRgbToGreyFilter::ossimRgbToGreyFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theBlankTile(NULL),
-    theTile(NULL),
-    theC1(1.0/3.0),
-    theC2(1.0/3.0),
-    theC3(1.0/3.0)
-{
-}
-
-ossimRgbToGreyFilter::ossimRgbToGreyFilter(ossimImageSource* inputSource,
-                                           double c1,
-                                           double c2,
-                                           double c3)
-   : ossimImageSourceFilter(NULL, inputSource),
-     theBlankTile(NULL),
-     theTile(NULL),
-     theC1(c1),
-     theC2(c2),
-     theC3(c3)
-{
-}
-
-ossimRgbToGreyFilter::ossimRgbToGreyFilter(ossimObject* owner,
-                                           ossimImageSource* inputSource,
-                                           double c1,
-                                           double c2,
-                                           double c3)
-   : ossimImageSourceFilter(owner, inputSource),
-     theBlankTile(NULL),
-     theTile(NULL),
-     theC1(c1),
-     theC2(c2),
-     theC3(c3)
-{
-}
-ossimRgbToGreyFilter::~ossimRgbToGreyFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimRgbToGreyFilter::getTile(const ossimIrect& tileRect,
-                                              ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return NULL;  // This filter requires an input.
-   }
-
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
-                                                           resLevel);   
-   if(!isSourceEnabled() || !inputTile.valid())
-   {
-      return inputTile;
-   }
-
-   if(!theTile)
-   {
-      allocate(); // First time through...
-   }
-
-   // if (!theTile) // throw exeption...
-
-   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
-       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
-   {
-      theBlankTile->setImageRectangle(tileRect);
-      return theBlankTile;
-   }
-
-   // Set the origin, resize if needed of the output tile.
-   theTile->setImageRectangle(tileRect);
-
-   // Filter the tile.
-   runUcharTransformation(inputTile);
-
-   // Always validate to set the status.
-   theTile->validate();
-   
-   return theTile;
-}
-
-
-void ossimRgbToGreyFilter::initialize()
-{
-   // Base class will recapture "theInputConnection".
-   ossimImageSourceFilter::initialize();
-}
-
-void ossimRgbToGreyFilter::allocate()
-{
-   if(theInputConnection)
-   {
-      theTile      = NULL;
-      theBlankTile = NULL;
-
-      if(isSourceEnabled())
-      {
-         theBlankTile = new ossimU8ImageData(this,
-                                             1,
-                                             theInputConnection->getTileWidth(),
-                                             theInputConnection->getTileHeight());  
-         
-         
-         theTile = (ossimImageData*)theBlankTile->dup();
-         theTile->initialize();
-      }
-   }
-}
-
-ossim_uint32 ossimRgbToGreyFilter::getNumberOfOutputBands() const
-{
-   if(isSourceEnabled())
-   {
-      return 1;
-   }
-
-   return ossimImageSourceFilter::getNumberOfOutputBands();
-}
-
-bool ossimRgbToGreyFilter::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix)const
-{
-   ossimImageSourceFilter::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           "c1",
-           theC1,
-           true);
-   kwl.add(prefix,
-           "c2",
-           theC2,
-           true);
-   kwl.add(prefix,
-           "c3",
-           theC2,
-           true);
-   
-   return true;
-}
-
-bool ossimRgbToGreyFilter::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   ossimImageSourceFilter::loadState(kwl, prefix);
-
-   const char* lookup = kwl.find(prefix, "c1");
-   if(lookup)
-   {
-      theC1 = ossimString(lookup).toDouble();
-   }
-   lookup = kwl.find(prefix, "c2");
-   if(lookup)
-   {
-      theC2 = ossimString(lookup).toDouble();
-   }
-   lookup = kwl.find(prefix, "c3");
-   if(lookup)
-   {
-      theC3 = ossimString(lookup).toDouble();
-   }
-   return true;
-}
-
-void ossimRgbToGreyFilter::runUcharTransformation(ossimRefPtr<ossimImageData>& tile)
-{   
-   unsigned char** bandSrc = new unsigned char*[tile->getNumberOfBands()];
-   unsigned char* bandDest;
-   
-   if(tile->getNumberOfBands() == 1)
-   {
-      bandSrc[0]  = static_cast<unsigned char*>(tile->getBuf(0));
-      bandSrc[1]  = static_cast<unsigned char*>(tile->getBuf(0));
-      bandSrc[2]  = static_cast<unsigned char*>(tile->getBuf(0));
-   }
-   else if(tile->getNumberOfBands() == 2)
-   {
-      bandSrc[0]  = static_cast<unsigned char*>(tile->getBuf(0));
-      bandSrc[1]  = static_cast<unsigned char*>(tile->getBuf(1));
-      bandSrc[2]  = static_cast<unsigned char*>(tile->getBuf(1));      
-   }
-   else if(tile->getNumberOfBands() >= 3)
-   {
-      bandSrc[0]  = static_cast<unsigned char*>(tile->getBuf(0));
-      bandSrc[1]  = static_cast<unsigned char*>(tile->getBuf(1));
-      bandSrc[2]  = static_cast<unsigned char*>(tile->getBuf(2));      
-   }
-   bandDest = static_cast<unsigned char*>(theTile->getBuf());
-   
-   ossim_int32 offset;
-
-   ossim_int32 upperBound = tile->getWidth()*tile->getHeight();
-   for(offset = 0; offset < upperBound; ++offset)
-   {
-      ossim_int32 value;
-      
-      value = ossim::round<int>(theC1*(bandSrc[0][offset]) +
-                    theC2*(bandSrc[1][offset]) +
-                    theC3*(bandSrc[2][offset]));
-      
-      value = value<255?value:255;
-      value = value>0?value:0;
-
-      bandDest[offset] = value;
-   }
-
-   delete [] bandSrc;
-}
-
-ossimString ossimRgbToGreyFilter::getShortName()const
-{
-   return ossimString("grey");
-}
-
-ossimString ossimRgbToGreyFilter::getLongName()const
-{
-   return ossimString("rgb to grey scale filter");
-}
-
-ossimScalarType ossimRgbToGreyFilter::getOutputScalarType() const
-{
-   if(isSourceEnabled())
-   {
-      return OSSIM_UCHAR;
-   }
-   
-   return ossimImageSourceFilter::getOutputScalarType();
-}
-
diff --git a/ossim/src/ossim/imaging/ossimRgbToHsiSource.cpp b/ossim/src/ossim/imaging/ossimRgbToHsiSource.cpp
deleted file mode 100644
index dd223f1..0000000
--- a/ossim/src/ossim/imaging/ossimRgbToHsiSource.cpp
+++ /dev/null
@@ -1,163 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToHsiSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimRgbToHsiSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimHsiVector.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimRgbToHsiSource, "ossimRgbToHsiSource", ossimImageSourceFilter)
-
-ossimRgbToHsiSource::ossimRgbToHsiSource()
-   :ossimImageSourceFilter(),
-    theBlankTile(NULL),
-    theTile(NULL)
-{
-}
-
-ossimRgbToHsiSource::ossimRgbToHsiSource(ossimImageSource* inputSource)
-   : ossimImageSourceFilter(inputSource),
-     theBlankTile(NULL),
-     theTile(NULL)
-{
-}
-
-ossimRgbToHsiSource::~ossimRgbToHsiSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimRgbToHsiSource::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();  // This filter requires an input.
-   }
-   
-   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
-                                                                       resLevel);   
-   if(!isSourceEnabled() || !inputTile.valid())
-   {
-      return inputTile;
-   }
-
-   if(!theTile)
-   {
-      allocate(); // First time through...
-   }
-
-   if (!theTile.valid())
-   {
-      return inputTile;
-   }
-   
-   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
-       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
-   {
-      theBlankTile->setImageRectangle(tileRect);
-      return theBlankTile;
-   }
-   
-   if((inputTile->getNumberOfBands()==3)&&
-      (inputTile->getScalarType()==OSSIM_UCHAR)&&
-      (inputTile->getDataObjectStatus()!=OSSIM_NULL))
-   {
-      // Set the origin, resize if needed of the output tile.
-      theTile->setImageRectangle(tileRect);
-
-      float* outputBands[3];
-      ossim_uint8* inputBands[3];
-      outputBands[0] = static_cast<float*>(theTile->getBuf(0));
-      outputBands[1] = static_cast<float*>(theTile->getBuf(1));
-      outputBands[2] = static_cast<float*>(theTile->getBuf(2));
-      inputBands[0]  = static_cast<ossim_uint8*>(inputTile->getBuf(0));
-      inputBands[1]  = static_cast<ossim_uint8*>(inputTile->getBuf(1));
-      inputBands[2]  = static_cast<ossim_uint8*>(inputTile->getBuf(2));
-      
-      long height = inputTile->getHeight();
-      long width  = inputTile->getWidth();
-      long offset = 0;
-      for(long row = 0; row < height; ++row)
-      {
-         for(long col = 0; col < width; ++col)
-         {
-            ossimRgbVector rgb(inputBands[0][offset],
-                               inputBands[1][offset],
-                               inputBands[2][offset]);
-            
-            ossimHsiVector hsi(rgb);
-            
-            
-            outputBands[0][offset] = hsi.getH();
-            outputBands[1][offset] = hsi.getS();
-            outputBands[2][offset] = hsi.getI();
-            
-            ++offset;
-         }
-      }
-   }
-   else // Input tile not of correct type to process...
-   {
-      return inputTile;
-   }
-
-   theTile->validate();
-   return theTile;
-}
-
-ossimScalarType ossimRgbToHsiSource::getOutputScalarType() const
-{
-   return OSSIM_NORMALIZED_FLOAT;
-}
-
-void ossimRgbToHsiSource::initialize()
-{
-   // Base class will recapture "theInputConnection".
-   ossimImageSourceFilter::initialize();   
-}
-
-void ossimRgbToHsiSource::allocate()
-{
-   theBlankTile = NULL;
-   theTile = NULL;
-
-   if(!theInputConnection) return;
-   
-   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile      = (ossimImageData*)theBlankTile->dup();
-   theTile->initialize();
-}
-
-ossim_uint32 ossimRgbToHsiSource::getNumberOfOutputBands()const
-{
-   return 3;
-}
-
-double ossimRgbToHsiSource::getNullPixelValue()const
-{
-   return ossim::nan();
-}
-
-double ossimRgbToHsiSource::getMinPixelValue(ossim_uint32 /* band */)const
-{
-   return 0.0;
-}
-
-double ossimRgbToHsiSource::getMaxPixelValue(ossim_uint32 /* band */)const
-{
-   return 1.0;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimRgbToHsvSource.cpp b/ossim/src/ossim/imaging/ossimRgbToHsvSource.cpp
deleted file mode 100644
index f97c196..0000000
--- a/ossim/src/ossim/imaging/ossimRgbToHsvSource.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToHsvSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimRgbToHsvSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimHsvVector.h>
-#include <ossim/base/ossimRgbVector.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimRgbToHsvSource, "ossimRgbToHsvSource", ossimImageSourceFilter)
-
-ossimRgbToHsvSource::ossimRgbToHsvSource()
-   :ossimImageSourceFilter(),
-    theBlankTile(NULL),
-    theTile(NULL)
-{
-}
-
-
-ossimRgbToHsvSource::ossimRgbToHsvSource(ossimImageSource* inputSource)
-   : ossimImageSourceFilter(inputSource),
-    theBlankTile(NULL),
-    theTile(NULL)
-{
-}
-
-ossimRgbToHsvSource::~ossimRgbToHsvSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimRgbToHsvSource::getTile(
-   const  ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();  // This filter requires an input.
-   }
-
-   ossimRefPtr<ossimImageData> inputTile =
-      theInputConnection->getTile(tileRect, resLevel);   
-   if(!isSourceEnabled() || !inputTile.valid())
-   {
-      return inputTile;
-   }
-
-   if(!theTile.valid())
-   {
-      allocate(); // First time through...
-   }
-   
-   if (!theTile.valid()) // throw exeption...
-   {
-      return inputTile;
-   }
-   
-   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
-       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
-   {
-      theBlankTile->setImageRectangle(tileRect);
-      return theBlankTile;
-   }
-
-   if((inputTile->getNumberOfBands()==3)&&
-      (inputTile->getScalarType()==OSSIM_UCHAR)&&
-      (inputTile->getDataObjectStatus()!=OSSIM_NULL))
-   {
-      // Set the origin, resize if needed of the output tile.
-      theTile->setImageRectangle(tileRect);
-
-      float* outputBands[3];
-      ossim_uint8* inputBands[3];
-      outputBands[0] = static_cast<float*>(theTile->getBuf(0));
-      outputBands[1] = static_cast<float*>(theTile->getBuf(1));
-      outputBands[2] = static_cast<float*>(theTile->getBuf(2));
-      inputBands[0] = static_cast<ossim_uint8*>(inputTile->getBuf(0));
-      inputBands[1] = static_cast<ossim_uint8*>(inputTile->getBuf(1));
-      inputBands[2] = static_cast<ossim_uint8*>(inputTile->getBuf(2));
-      
-      long height = inputTile->getHeight();
-      long width  = inputTile->getWidth();
-      long offset = 0;
-      for(long row = 0; row < height; ++row)
-      {
-         for(long col = 0; col < width; ++col)
-         {
-            ossimRgbVector rgb(inputBands[0][offset],
-                               inputBands[1][offset],
-                               inputBands[2][offset]);
-            
-            ossimHsvVector hsv(rgb);
-            
-            outputBands[0][offset] = hsv.getH();
-            outputBands[1][offset] = hsv.getS();
-            outputBands[2][offset] = hsv.getV();
-            
-            ++offset;
-         }
-      }
-   }
-   else // Input tile not of correct type to process...
-   {
-      return inputTile;
-   }
-   theTile->validate();
-   return theTile;
-}
-
-void ossimRgbToHsvSource::initialize()
-{
-   // Base class will recapture "theInputConnection".
-   ossimImageSourceFilter::initialize();
-}
-
-void ossimRgbToHsvSource::allocate()
-{
-   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
-   theTile      = (ossimImageData*)theBlankTile->dup();
-   theTile->initialize();
-}
-
-ossimScalarType ossimRgbToHsvSource::getOutputScalarType() const
-{
-   return OSSIM_NORMALIZED_FLOAT;
-}
-
-ossim_uint32 ossimRgbToHsvSource::getNumberOfOutputBands()const
-{
-   return 3;
-}
-
-double ossimRgbToHsvSource::getNullPixelValue()const
-{
-   return ossim::nan();
-}
-
-double ossimRgbToHsvSource::getMinPixelValue(ossim_uint32 /* band */)const
-{
-   return 0.0;
-}
-
-double ossimRgbToHsvSource::getMaxPixelValue(ossim_uint32 /* band */)const
-{
-   return 1.0;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimRgbToIndexFilter.cpp b/ossim/src/ossim/imaging/ossimRgbToIndexFilter.cpp
deleted file mode 100644
index cc53621..0000000
--- a/ossim/src/ossim/imaging/ossimRgbToIndexFilter.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToIndexFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimRgbToIndexFilter.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-
-RTTI_DEF1(ossimRgbToIndexFilter,
-          "ossimRgbToIndexFilter",
-          ossimImageSourceFilter);
-
-ossimRgbToIndexFilter::ossimRgbToIndexFilter()
-   :ossimImageSourceFilter(),
-    theLut(new ossimRgbLutDataObject()),
-    theTile(NULL)
-{
-}
-
-ossimRgbToIndexFilter::ossimRgbToIndexFilter(ossimImageSource* inputSource,
-                                             const ossimRgbLutDataObject& rgbLut)
-   :ossimImageSourceFilter(inputSource),
-    theLut((ossimRgbLutDataObject*)rgbLut.dup()),
-    theTile(NULL)
-{
-}
-
-ossimRgbToIndexFilter::~ossimRgbToIndexFilter()
-{
-   theLut = 0;
-}
-
-void ossimRgbToIndexFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   // Force allocate on next getTile.
-   theTile      = NULL;
-}
-
-void ossimRgbToIndexFilter::allocate()
-{
-   theTile      = NULL;
-   
-   if(isSourceEnabled())
-   {
-      theTile      = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-   }
-}
-
-void ossimRgbToIndexFilter::disableSource()
-{
-   ossimImageSourceFilter::disableSource();
-   theTile = NULL;
-}
-
-ossimRefPtr<ossimImageData> ossimRgbToIndexFilter::getTile(
-   const ossimIrect& origin,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   if(!theTile.valid())
-   {
-      allocate();
-   }
-   
-   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(origin,
-                                                                   resLevel);
-
-   if(!theTile.valid() || !input.valid())
-   {
-      return input;
-   }
-
-   theTile->setImageRectangle(origin);
-
-   if(input->getScalarType() == OSSIM_UCHAR)
-   {
-      theTile->setDataObjectStatus(OSSIM_FULL);
-      return convertInputTile(input);
-   }
-   else
-   {
-      theTile->makeBlank();
-   }
-
-   theTile->setDataObjectStatus(OSSIM_FULL);
-   
-   return theTile;
-}
-
-ossimRefPtr<ossimImageData> ossimRgbToIndexFilter::convertInputTile(ossimRefPtr<ossimImageData>& tile)
-{
-   if (!tile)
-   {
-      return theTile;
-   }
-   
-   const ossim_uint32 BANDS = tile->getNumberOfBands();
-
-   if (!BANDS)
-   {
-      return theTile;
-   }
-   
-   ossim_uint8* band[3];
-   ossim_uint8* outBand = (ossim_uint8*)theTile->getBuf();
-
-   if(BANDS >= 3)
-   {
-      band[0] = (ossim_uint8*)(tile->getBuf(0));
-      band[1] = (ossim_uint8*)(tile->getBuf(1));
-      band[2] = (ossim_uint8*)(tile->getBuf(2));
-   }
-   else
-   {
-      band[0] = (ossim_uint8*)(tile->getBuf(0));
-      band[1] = (ossim_uint8*)(tile->getBuf(0));
-      band[2] = (ossim_uint8*)(tile->getBuf(0));
-   }
-
-   if(band[0])
-   {
-      ossim_uint32 upper = tile->getWidth()*tile->getHeight();
-
-      for(ossim_uint32 offset = 0; offset < upper; ++offset)
-      {
-         *outBand = theLut->findIndex(*band[0], *band[1], *band[2]);
-         
-         ++outBand;
-         ++band[0];
-         ++band[1];
-         ++band[2];
-      }
-   }
-   
-   return theTile;
-}
-
-bool ossimRgbToIndexFilter::saveState(ossimKeywordlist& kwl,
-                                      const char* prefix)const
-{
-   ossimString newPrefix = prefix;
-   newPrefix = newPrefix + "lut.";
-
-   theLut->saveState(kwl, newPrefix.c_str());
-
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimRgbToIndexFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   ossimString newPrefix = prefix;
-   newPrefix = newPrefix + "lut.";
-
-   theLut->loadState(kwl, newPrefix.c_str());
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-ossim_uint32 ossimRgbToIndexFilter::getNumberOfOutputBands() const
-{
-   if(isSourceEnabled())
-   {
-      return 1;
-   }
-   
-   return ossimImageSourceFilter::getNumberOfOutputBands();
-}
-   
-ossimScalarType ossimRgbToIndexFilter::getOutputScalarType() const
-{
-   if(isSourceEnabled())
-   {
-      return OSSIM_UCHAR;
-   }
-   
-   return ossimImageSourceFilter::getOutputScalarType();
-}
-
-void ossimRgbToIndexFilter::setLut(ossimRgbLutDataObject& lut)
-{
-   theLut = (ossimRgbLutDataObject*) lut.dup();
-}
-
-double ossimRgbToIndexFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   if(isSourceEnabled())
-   {
-      return 0.0;
-   }
-   
-   return ossimImageSourceFilter::getNullPixelValue(band);
-}
-
-double ossimRgbToIndexFilter::getMinPixelValue(ossim_uint32 /* band */)const
-{
-   if(isSourceEnabled())
-   {
-      return 1.0;
-   }
-   
-   return ossimImageSourceFilter::getMinPixelValue();
-}
-
-double ossimRgbToIndexFilter::getMaxPixelValue(ossim_uint32 /* band */)const
-{
-   if(isSourceEnabled())
-   {
-      return 255.0;
-   }
-   
-   return ossimImageSourceFilter::getMaxPixelValue();
-}
-
diff --git a/ossim/src/ossim/imaging/ossimRgbToJpegYCbCrSource.cpp b/ossim/src/ossim/imaging/ossimRgbToJpegYCbCrSource.cpp
deleted file mode 100644
index 6a61e09..0000000
--- a/ossim/src/ossim/imaging/ossimRgbToJpegYCbCrSource.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRgbToJpegYCbCrSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimRgbToJpegYCbCrSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimJpegYCbCrVector.h>
-#include <ossim/base/ossimRgbVector.h>
-
-RTTI_DEF1(ossimRgbToJpegYCbCrSource,
-          "ossimRgbToJpegYCbCrSource",
-          ossimImageSourceFilter)
-
-ossimRgbToJpegYCbCrSource::ossimRgbToJpegYCbCrSource()
-   :ossimImageSourceFilter()
-{
-   theBlankTile = new ossimImageData(this,
-                                     OSSIM_UCHAR,
-                                     3);
-}
-
-ossimRgbToJpegYCbCrSource::ossimRgbToJpegYCbCrSource(ossimImageSource* inputSource)
-   : ossimImageSourceFilter(inputSource)
-{
-}
-
-ossimRgbToJpegYCbCrSource::~ossimRgbToJpegYCbCrSource()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimRgbToJpegYCbCrSource::getTile(const  ossimIrect& tileRect,
-                                                   ossim_uint32 resLevel)
-{
-   theBlankTile->setOrigin(tileRect.ul());
-   theBlankTile->setWidthHeight(tileRect.width(), tileRect.height());
-   
-   if(theInputConnection)
-   {
-      ossimRefPtr<ossimImageData> imageData = theInputConnection->getTile(tileRect,
-                                                              resLevel);
-      if(!imageData.valid())
-      {
-         return theBlankTile;
-      }
-      if((isSourceEnabled())&&
-         (imageData->getNumberOfBands()==3)&&
-         (imageData->getScalarType()==OSSIM_UCHAR)&&
-         (imageData->getDataObjectStatus()!=OSSIM_NULL)&&
-         (imageData->getDataObjectStatus()!=OSSIM_EMPTY))
-      {
-         ossim_uint8* bands[3];
-         
-         bands[0] = static_cast<ossim_uint8*>(imageData->getBuf(0));
-         bands[1] = static_cast<ossim_uint8*>(imageData->getBuf(1));
-         bands[2] = static_cast<ossim_uint8*>(imageData->getBuf(2));
-         
-         long height = imageData->getHeight();
-         long width  = imageData->getWidth();
-         long offset = 0;
-         
-         for(long row = 0; row < height; ++row)
-         {
-            for(long col = 0; col < width; ++col)
-            {
-               ossimRgbVector rgb(bands[0][offset],
-                                  bands[1][offset],
-                                  bands[2][offset]);
-               
-               ossimJpegYCbCrVector ycbcr(rgb);
-               
-               
-               bands[0][offset] = ycbcr.getY();
-               bands[1][offset] = ycbcr.getCb();
-               bands[2][offset] = ycbcr.getCr();
-               ++offset;
-            }
-         }
-         imageData->validate();
-      }
-      return imageData;
-   }
-   
-   return theBlankTile;
-}  
-
diff --git a/ossim/src/ossim/imaging/ossimRpfCacheTileSource.cpp b/ossim/src/ossim/imaging/ossimRpfCacheTileSource.cpp
deleted file mode 100644
index 1a8247b..0000000
--- a/ossim/src/ossim/imaging/ossimRpfCacheTileSource.cpp
+++ /dev/null
@@ -1,1315 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//********************************************************************
-// $Id: ossimRpfCacheTileSource.cpp 1361 2010-08-26 00:24:22Z david.burken $
-#include <algorithm>
-using namespace std;
-
-#include <ossim/imaging/ossimRpfCacheTileSource.h>
-
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimNBandLutDataObject.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/support_data/ossimRpfFrame.h>
-#include <ossim/support_data/ossimRpfToc.h>
-#include <ossim/support_data/ossimRpfTocEntry.h>
-#include <ossim/support_data/ossimRpfCompressionSection.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimCylEquAreaProjection.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimPolygon.h>
-
-static ossimTrace traceDebug = ossimTrace("ossimRpfCacheTileSource:debug");
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimRpfCacheTileSource.cpp 1361 2010-08-26 00:24:22Z david.burken $";
-#endif
-
-RTTI_DEF1(ossimRpfCacheTileSource, "ossimRpfCacheTileSource", ossimImageHandler)
-
-const ossim_uint32 ossimRpfCacheTileSource::CIBCADRG_FRAME_WIDTH  = 1536;
-const ossim_uint32 ossimRpfCacheTileSource::CIBCADRG_FRAME_HEIGHT = 1536;
-
-ossimRpfCacheTileSource::ossimRpfCacheTileSource()
-   :
-   ossimImageHandler(),
-
-   // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
-   // convert to bytes   
-   m_compressedBuffer(new ossim_uint8[(64*64*12)/8]),
-
-   // whether CIB or CADRG we will alocate the buffer
-   // to the larger of the 2 (CADRG is 3 bands) 
-   m_uncompressedBuffer(new ossim_uint8[256*256*3]),
-   
-   m_numberOfLines(0),
-   m_numberOfSamples(0),
-   m_tile(0),
-   m_fileNames(),
-   m_tileSize(128, 128),
-   m_productType(OSSIM_PRODUCT_TYPE_UNKNOWN),
-   m_workFrame(new ossimRpfFrame),
-   m_bBox_LL_Lon(0.0),
-   m_bBox_LL_Lat(0.0),
-   m_bBox_UR_Lon(0.0),
-   m_bBox_UR_Lat(0.0),
-   m_numOfFramesVertical(0),
-   m_numOfFramesHorizontal(0),
-   m_frameEntryArray()
-{
-  if (traceDebug())
-  {
-    ossimNotify(ossimNotifyLevel_DEBUG)
-      << "ossimRpfCacheTileSource::ossimRpfCacheTileSource entered...\n";
-#ifdef OSSIM_ID_ENABLED
-    ossimNotify(ossimNotifyLevel_DEBUG)
-      << "OSSIM_ID:  " << OSSIM_ID << "\n";
-#endif      
-  }
-
-  m_actualImageRect.makeNan();
-
-}
-
-ossimRpfCacheTileSource::~ossimRpfCacheTileSource()
-{
-  if(m_compressedBuffer)
-  {
-    delete [] m_compressedBuffer;
-    m_compressedBuffer = 0;
-  }
-  if(m_uncompressedBuffer)
-  {
-    delete [] m_uncompressedBuffer;
-    m_uncompressedBuffer = 0;
-  }
-  if(m_workFrame)
-  {
-    delete m_workFrame;
-    m_workFrame = 0;
-  }
-  close();
-}
-
-ossimString ossimRpfCacheTileSource::getShortName()const
-{
-  return ossimString("RpfCache");
-}
-
-ossimString ossimRpfCacheTileSource::getLongName()const
-{
-  return ossimString("RpfCache reader");
-}
-
-
-void ossimRpfCacheTileSource::close()
-{
-  deleteAll();
-}
-
-bool ossimRpfCacheTileSource::isOpen()const
-{
-  //return (theTableOfContents!=0);
-  ossimString ext = theImageFile.ext().downcase();
-
-  if(ext == "rpf")
-  {
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-bool ossimRpfCacheTileSource::open()
-{
-  if(traceDebug())
-  {
-    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfCacheTileSource::open(): Entered....." << std::endl;
-  }
-
-  ossimFilename imageFile = theImageFile;
-  bool result = true;
-
-  if(isOpen() == false)
-  {
-    close();
-    result = false;
-  }
-
-  if(result)
-  {
-    if (m_fileNames.size() == 0 && m_frameEntryArray.size() == 0)
-    {
-      if (buildFrameEntryArray(imageFile) == false)
-      {
-        return false;
-      }
-    }
-    
-    setCurrentEntry(0);
-    //---
-    // Adjust image rect so not to go over the -180 to 180 and -90 to 90
-    // bounds.
-    //---
-    setActualImageRect();
-
-    // Set the base class image file name.
-    theImageFile = imageFile;
-    m_tile = ossimImageDataFactory::instance()->create(this, this);
-    m_tile->initialize();
-  }
-
-  if(traceDebug())
-  {
-    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfCacheTileSource::open(): Leaving at line" << __LINE__ << std::endl;
-  }
-
-  return result;
-}
-
-bool ossimRpfCacheTileSource::buildFrameEntryArray(ossimFilename imageFile)
-{
-   static const char MODULE[] = "ossimRpfCacheTileSource::buildFrameEntryArray";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
-   }
-
-   std::ifstream in((imageFile).c_str() );
-   
-   std::string line;
-   ossim_uint32 index = 0; // used throughout
-   while( in.good() )
-   {
-      // Read in a line.
-      std::getline(in, line);
-
-      ossimString tmpStr = ossimString(line);
-      if (!tmpStr.empty())
-      {
-         if (index == 0)
-         {
-            std::vector<ossimString> box_lat_lon;
-            tmpStr.split(box_lat_lon, "|");
-            
-            if (box_lat_lon.size() > 2)
-            {
-               std::vector<ossimString> ll;
-               std::vector<ossimString> ur;
-               
-               box_lat_lon[0].split(ll, ",");
-               box_lat_lon[1].split(ur, ",");
-               ossimString bandStr = box_lat_lon[2];
-               
-               m_bBox_LL_Lon = ll[0].toFloat64();
-               m_bBox_LL_Lat = ll[1].toFloat64();
-               m_bBox_UR_Lon = ur[0].toFloat64();
-               m_bBox_UR_Lat = ur[1].toFloat64();
-               
-               checkLongitude(m_bBox_LL_Lon, m_bBox_UR_Lon);
-               
-               ossim_int32 bands = ossimString(bandStr).toInt32();
-               if (bands == 1)
-               {
-                  m_productType = OSSIM_PRODUCT_TYPE_CIB;
-               }
-               else if (bands == 3)
-               {
-                  m_productType = OSSIM_PRODUCT_TYPE_CADRG;
-               }
-            }
-            else
-            {
-               return false;
-            }
-         }
-         else if (index == 1)
-         {
-            m_fileNames.push_back(tmpStr);
-            std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
-            if (frame_lat_lon.size() > 2)
-            {
-               ossimString ll_lon_lat = frame_lat_lon[1];
-               ossimString ur_lon_lat = frame_lat_lon[2];
-               ossim_float64 ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
-               ossim_float64 ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
-               ossim_float64 ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
-               ossim_float64 ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
-
-               checkLongitude(ll_lon, ur_lon);
-               
-               ossim_float64 bBox_lat_diff = std::fabs(m_bBox_UR_Lat - m_bBox_LL_Lat);
-               ossim_float64 bBox_lon_diff = std::fabs(m_bBox_UR_Lon - m_bBox_LL_Lon);
-               
-               ossim_float64 lat_diff = std::fabs(ur_lat - ll_lat);
-               ossim_float64 lon_diff = std::fabs(ur_lon - ll_lon);
-               
-               m_numOfFramesVertical   = static_cast<ossim_uint32>(bBox_lat_diff/lat_diff + 0.5);
-               m_numOfFramesHorizontal = static_cast<ossim_uint32>(bBox_lon_diff/lon_diff + 0.5);
-               
-               m_numberOfLines   = m_numOfFramesVertical*CIBCADRG_FRAME_HEIGHT;
-               m_numberOfSamples = m_numOfFramesHorizontal*CIBCADRG_FRAME_WIDTH;
-
-               if ( traceDebug() )
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << "\nscene height in degrees: " << bBox_lat_diff
-                     << "\nscene width in degrees:  " << bBox_lon_diff
-                     << "\nframe height in degrees: " << lat_diff
-                     << "\nframe width in degrees:  " << lon_diff
-                     << "\nframes vertical:         " << m_numOfFramesVertical
-                     << "\nframes horizontal:       " << m_numOfFramesHorizontal
-                     << "\nlines:                   " << m_numberOfLines
-                     << "\nsamples:                 " << m_numberOfSamples << "\n";
-               }
-            }
-            else
-            {
-               return false;
-            }
-         }
-         else
-         {
-            m_fileNames.push_back(tmpStr);
-         }
-         
-      } // matches: if (!tmpStr.empty())
-      
-      ++index;
-      
-   } // matches: while( in.good() )
-   in.close();
-
-   m_frameEntryArray.resize(m_numOfFramesVertical);
-   for(index = 0; index < m_frameEntryArray.size(); ++index)
-   {
-      m_frameEntryArray[index].resize(m_numOfFramesHorizontal);
-   }
-
-   for(index = 0; index < m_fileNames.size(); ++index)
-   {
-      ossimString tmpStr = m_fileNames[index];
-      std::vector<ossimString> frameInfos = tmpStr.split("|");
-      if (frameInfos.size() > 1)
-      {
-         ossimString fileName = frameInfos[0];
-         ossimString ll_lon_lat = frameInfos[1];
-         ossimString ur_lon_lat = frameInfos[2];
-         double ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
-         double ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
-         double ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
-         double ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
-         
-         checkLongitude(ll_lon, ur_lon);
-         
-         ossim_float64 tmpColPostion = std::fabs(ll_lon - m_bBox_LL_Lon);
-         ossim_float64 tmpFrameLon = std::fabs(ur_lon - ll_lon);
-         
-         ossim_float64 tmpRowPostion = std::fabs(m_bBox_UR_Lat - ur_lat);
-         ossim_float64 tmpFrameLat = std::fabs(ur_lat - ll_lat);
-         
-         ossim_uint32 colNum = static_cast<ossim_uint32>(tmpColPostion/tmpFrameLon + 0.5);
-         ossim_uint32 rowNum = static_cast<ossim_uint32>(tmpRowPostion/tmpFrameLat + 0.5);
-         
-         if (colNum >= m_numOfFramesHorizontal)
-         {
-            colNum = m_numOfFramesHorizontal-1; // Clamp to last column.
-         }
-         
-         if (rowNum >= m_numOfFramesVertical)
-         {
-            rowNum = m_numOfFramesVertical-1; // Clamp to last row.
-         }
-         
-         ossimRpfFrameEntry tempEntry;
-         tempEntry.setEntry(ossimFilename(""), fileName);
-         m_frameEntryArray[rowNum][colNum] = tempEntry;
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-   return true;
-}
-
-void ossimRpfCacheTileSource::checkLongitude(ossim_float64& leftLon,
-                                             const ossim_float64& rightLon) const
-{
-   //---
-   // Test for scene coordinates being 180 to 180 and adjust leftLon to -180
-   // if so.
-   //
-   // NOTE:
-   // Setting tolerance to 1/7200 about 15 meters.
-   // Not sure if this is too loose or not. (drb)
-   //---
-   const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
-
-   if ( ossim::almostEqual(leftLon, 180.0, TOLERANCE) )
-   {
-      if ( ossim::almostEqual(rightLon, 180.0, TOLERANCE) )
-      {
-         leftLon = -180.0;
-      }
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimRpfCacheTileSource::getTile(
-  const  ossimIrect& rect, ossim_uint32 resLevel)
-{
-  if (m_tile.valid())
-  {
-    // Image rectangle must be set prior to calling getTile.
-    m_tile->setImageRectangle(rect);
-
-    if ( getTile( m_tile.get(), resLevel ) == false )
-    {
-      if (m_tile->getDataObjectStatus() != OSSIM_NULL)
-      {
-        m_tile->makeBlank();
-      }
-    }
-  }
-
-  return m_tile;
-}
-
-bool ossimRpfCacheTileSource::getTile(ossimImageData* result,
-                                      ossim_uint32 resLevel)
-{
-   bool status = false;
-   
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) &&
-       (m_productType != OSSIM_PRODUCT_TYPE_UNKNOWN) )
-   {
-      if ( resLevel > 0 )
-      {
-         //---
-         // Check for overview tile.  Some overviews can contain r0 so always
-         // call even if resLevel is 0 (if overview is not virtual).  Method 
-         // returns true on success, false on error.
-         //---
-         status = getOverviewTile(resLevel, result);
-      }
-      
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-         
-         ossimIrect rect = result->getImageRectangle();
-         
-         ossimIrect imageRect = getImageRectangle();
-         
-         if ( rect.intersects(imageRect) )
-         {
-            //---
-            // Start with a blank tile in case there is not total coverage
-            // for rect.
-            //---
-            result->makeBlank();
-            
-            vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
-            if(frames.size() > 0)
-            {
-               //---
-               // Now lets render each frame.  Note we will have to find
-               // subframes
-               // that intersect the rectangle of interest for each frame.
-               //---
-               fillTile(rect, frames, result);
-               
-               // Revalidate tile status.
-               result->validate();
-            }
-         }
-         else
-         {
-            result->makeBlank();
-         }
-      }
-   }
-   
-   return status;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getNumberOfInputBands()const
-{
-  switch(m_productType)
-  {
-  case  OSSIM_PRODUCT_TYPE_UNKNOWN:
-    {
-      return 0;
-    }
-  case OSSIM_PRODUCT_TYPE_CIB:
-    {
-      return 1;
-    }
-  case OSSIM_PRODUCT_TYPE_CADRG:
-    {
-      return 3;
-    }
-  }
-
-  return 0;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getNumberOfOutputBands()const
-{
-  switch(m_productType)
-  {
-  case  OSSIM_PRODUCT_TYPE_UNKNOWN:
-    {
-      return 0;
-    }
-  case OSSIM_PRODUCT_TYPE_CIB:
-    {
-      return 1;
-    }
-  case OSSIM_PRODUCT_TYPE_CADRG:
-    {
-      return 3;
-    }
-  }
-
-  return 0;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return m_numberOfLines;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfLines(reduced_res_level);
-   }
-   
-   return 0;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return m_numberOfSamples;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfSamples(reduced_res_level);
-   }
-   
-   return 0;
-}
-
-void ossimRpfCacheTileSource::setActualImageRect()
-{
-   m_actualImageRect = ossimIrect(0,0,m_numberOfLines, m_numberOfSamples);
-}
-
-ossimIrect ossimRpfCacheTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   return ossimIrect(0,                         // upper left x
-                     0,                         // upper left y
-                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
-                     getNumberOfLines(reduced_res_level)   - 1); // lower right y                     
-}
-
-ossimRefPtr<ossimImageGeometry> ossimRpfCacheTileSource::getImageGeometry()
-{
-   if (theGeometry.valid()) return theGeometry;
-   
-   // datum
-   // WGS 84
-   ossimKeywordlist kwl;
-   const char* prefix = 0; // legacy
-   kwl.add(prefix,
-           ossimKeywordNames::DATUM_KW,
-           "WGE",
-           true);   
-   
-   ossimGpt ul(m_bBox_UR_Lat,m_bBox_LL_Lon);
-   ossimGpt ll(m_bBox_LL_Lat,m_bBox_LL_Lon);
-   ossimGpt ur(m_bBox_UR_Lat,m_bBox_UR_Lon);
-   ossimGpt lr(m_bBox_LL_Lat,m_bBox_UR_Lon);
-
-   double latInterval = fabs(ul.latd() - lr.latd())/ getNumberOfLines();
-   double lonInterval = fabs(ul.lond() - ur.lond())/ getNumberOfSamples();
-
-   kwl.add(prefix,
-           ossimKeywordNames::UL_LAT_KW,
-           ul.latd(),//-(latInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::UL_LON_KW,
-           ul.lond(),//+(lonInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::LL_LAT_KW,
-           ll.latd(),//+(latInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::LL_LON_KW,
-           ll.lond(),//+(lonInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::LR_LAT_KW,
-           lr.latd(),//+(latInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::LR_LON_KW,
-           lr.lond(),//-(lonInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::UR_LAT_KW,
-           ur.latd(),//-(latInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::UR_LON_KW,
-           ur.lond(),//-(latInterval/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_INPUT_BANDS_KW,
-           getNumberOfInputBands(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
-           getNumberOfOutputBands(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_LINES_KW,
-           getNumberOfLines(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_SAMPLES_KW,
-           getNumberOfSamples(),
-           true);
-
-
-   //---
-   // Make a projection to get the easting / northing of the tie point and
-   // the scale in meters.  This will only be used by the CIB.
-   //---
-   kwl.add(prefix,
-           ossimKeywordNames::DATUM_KW,
-           "WGE",
-           true);
-
-   ossimGpt origin((ul.latd()+lr.latd())*.5,
-                   (ul.lond()+lr.lond())*.5,
-                   0.0);
-
-   double deltaLatPerPixel = latInterval;
-   double deltaLonPerPixel = lonInterval;
-
-   ossimDpt tie;
-
-   tie.lat = ul.latd() - deltaLatPerPixel/2.0;
-   tie.lon = ul.lond() + deltaLonPerPixel/2.0;
-
-   kwl.add(prefix, 
-           ossimKeywordNames::TIE_POINT_XY_KW,
-           tie.toString(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-           deltaLatPerPixel,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-           deltaLonPerPixel,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::ORIGIN_LATITUDE_KW,
-           origin.latd(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CENTRAL_MERIDIAN_KW,
-           origin.lond(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LAT_KW,
-           ul.latd()-(deltaLatPerPixel/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LON_KW,
-           ul.lond()+(deltaLonPerPixel/2.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           "ossimEquDistCylProjection",
-           true);
-  
-   // Capture this for next time.
-   theGeometry = new ossimImageGeometry;
-   theGeometry->loadState(kwl, prefix);
-
-   // Set image things the geometry object should know about.
-   initImageParameters( theGeometry.get() ); 
-
-   return theGeometry;
-}
-
-ossimScalarType ossimRpfCacheTileSource::getOutputScalarType() const
-{
-   return OSSIM_UCHAR;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getTileWidth() const
-{
-   return m_tileSize.x;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getTileHeight() const
-{
-   return m_tileSize.y;
-}
-
-bool ossimRpfCacheTileSource::setCurrentEntry(ossim_uint32 entryIdx)
-{
-   // Clear the geometry.
-   theGeometry = 0;
-
-   // Must clear or openOverview will use last entries.
-   theOverviewFile.clear();
-
-   if(!setEntryToRender(entryIdx))
-   {
-      return false;
-   }
-   completeOpen();
-
-   return true;
-}
-
-void ossimRpfCacheTileSource::getEntryList(std::vector<ossim_uint32>& entryList)const
-{
-   entryList.push_back(0);
-}
-
-bool ossimRpfCacheTileSource::setEntryToRender(ossim_uint32 /* index */)
-{
-   if(isOpen())
-   { 
-      populateLut();
-      return true;
-   }
-
-   return false;
-}
-
-bool ossimRpfCacheTileSource::isValidRLevel(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      return true;
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->isValidRLevel(reduced_res_level);
-   }
-   else
-   {
-      return false;
-   }
-}
-
-vector<ossimRpfCacheTileSource::ossimFrameEntryData> ossimRpfCacheTileSource::getIntersectingEntries(const ossimIrect& rect)
-{
-   vector<ossimFrameEntryData> result;
-
-   // make sure we have the Toc entry to render
-   if(!isOpen()) return result;
-
-   ossimIrect imageRect = getImageRectangle();
-   if(rect.intersects(imageRect))
-   {
-      ossimIrect clipRect  = rect.clipToRect(imageRect);
-      ossimIrect frameRect(clipRect.ul().x/CIBCADRG_FRAME_WIDTH,
-                           clipRect.ul().y/CIBCADRG_FRAME_HEIGHT,
-                           clipRect.lr().x/CIBCADRG_FRAME_WIDTH,
-                           clipRect.lr().y/CIBCADRG_FRAME_HEIGHT);
-
-      for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
-      {
-         for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
-         {
-            ossimRpfFrameEntry tempEntry = m_frameEntryArray[row][col];
-            if(tempEntry.exists())
-            {
-               result.push_back(ossimFrameEntryData(row,
-                                                    col,
-                                                    row*CIBCADRG_FRAME_HEIGHT,
-                                                    col*CIBCADRG_FRAME_WIDTH,
-                                                    tempEntry));
-            }
-         }
-      }
-   }
-
-   return result;
-}
-
-void ossimRpfCacheTileSource::fillTile(
-   const ossimIrect& tileRect,
-   const vector<ossimFrameEntryData>& framesInvolved,
-   ossimImageData* tile)
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0;
-       idx < framesInvolved.size();
-       ++idx)
-   {
-
-      if(m_workFrame->parseFile(framesInvolved[idx].theFrameEntry.getFullPath())
-         == ossimErrorCodes::OSSIM_OK)
-      {
-         // we will fill a subtile.  We pass in which frame it is and the position of the frame.
-         // the actual pixel will be 1536*row and 1536 *col.
-         if(m_productType == OSSIM_PRODUCT_TYPE_CIB)
-         {
-            fillSubTileCib(*m_workFrame,
-                           tileRect,
-                           framesInvolved[idx],
-                           tile);
-         }
-         else
-         {
-            fillSubTileCadrg(*m_workFrame,
-                             tileRect,
-                             framesInvolved[idx],
-                             tile);
-         }
-      }
-   }
-}
-
-void ossimRpfCacheTileSource::fillSubTileCadrg(
-   const ossimRpfFrame&  aFrame,
-   const ossimIrect& tileRect,
-   const ossimFrameEntryData& frameEntryData,
-   ossimImageData* tile)
-{;
-// first let's grab the absolute position of the frame rectangle in pixel space
-   ossimIrect frameRect(frameEntryData.thePixelCol,
-                        frameEntryData.thePixelRow,
-                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
-                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
-
-
-// now clip it to the tile
-   ossimIrect clipRect = tileRect.clipToRect(frameRect);
-
-   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
-
-   if(!compressionSection)
-   {
-      return;
-   }
-
-   const vector<ossimRpfColorGrayscaleTable>& colorTable =
-      aFrame.getColorGrayscaleTable();
-
-// ESH 03/2009 -- Partial fix for ticket #646.
-// Crash fix on reading RPFs: Make sure the colorTable vector 
-// has entries before trying to make use of them. 
-   int numTables = (int)colorTable.size();
-   if ( numTables <= 0 )
-   {
-      return;
-   }
-
-   ossim_uint8 *tempRows[3];
-
-   tempRows[0] = m_uncompressedBuffer;
-   tempRows[1] = (m_uncompressedBuffer + 256*256);
-   tempRows[2] = (tempRows[1] + 256*256);
-
-// find the shift to 0,0
-   ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
-                      clipRect.ul().y - frameEntryData.thePixelRow);
-
-
-// In order to compute the subframe we will need the corner offsets of
-// the upper left of the frame and the upper left of the clip rect.  The
-// clip rect should be completely within the frame.  This just translates the value
-// to make the upper left of the frame be 0,0.
-//
-   ossimIrect offsetRect(tempDelta.x,
-                         tempDelta.y,
-                         tempDelta.x + clipRect.width()-1,
-                         tempDelta.y + clipRect.height()-1);
-
-// each subframe is 64x64.  We will actually use 256x256 since
-// we will be uncompressing them.  Note CADRG is a 256x256 tile
-// compressed to 64x64x12 bit data
-//
-   ossimIrect subFrameRect(offsetRect.ul().x/256,
-                           offsetRect.ul().y/256,
-                           (offsetRect.lr().x)/256,
-                           (offsetRect.lr().y)/256);
-
-   ossim_uint32 readPtr  = 0;
-
-   ossim_int32 row = 0;
-   ossim_int32 col = 0;
-   ossim_uint32 i = 0;
-   ossim_uint32 j = 0;
-   ossim_int32 upperY = subFrameRect.lr().y;
-   ossim_int32 upperX = subFrameRect.lr().x;
-   ossim_int32 lowerY = subFrameRect.ul().y;
-   ossim_int32 lowerX = subFrameRect.ul().x; 
-   for(row = lowerY; row <= upperY; ++row)
-   {
-      for(col = lowerX; col <= upperX; ++col)
-      {
-         readPtr = 0;
-         if(aFrame.fillSubFrameBuffer(m_compressedBuffer, 0, row, col))
-         {
-            for (i = 0; i < 256; i += 4)
-            {
-               for (j = 0; j < 256; j += 8)
-               {
-                  ossim_uint16 firstByte  = m_compressedBuffer[readPtr++] & 0xff;
-                  ossim_uint16 secondByte = m_compressedBuffer[readPtr++] & 0xff;
-                  ossim_uint16 thirdByte  = m_compressedBuffer[readPtr++] & 0xff;
-
-                  //because dealing with half-bytes is hard, we
-                  //uncompress two 4x4 tiles at the same time. (a
-                  //4x4 tile compressed is 12 bits )
-                  // this little code was grabbed from openmap software.
-
-                  /* Get first 12-bit value as index into VQ table */
-                  // I think we need to swap
-                  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
-
-                  /* Get second 12-bit value as index into VQ table*/
-                  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
-
-                  for (ossim_uint32 t = 0; t < 4; ++t)
-                  {
-                     for (ossim_uint32 e = 0; e < 4; ++e)
-                     {
-                        ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
-                        ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
-
-                        ossim_uint32 pixindex = ((i+t)*256) +
-                           (j + e);
-                        const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
-                        const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
-
-
-                        tempRows[0][pixindex] = color1[0];
-                        tempRows[1][pixindex] = color1[1];
-                        tempRows[2][pixindex] = color1[2];
-
-                        tempRows[0][pixindex+4] = color2[0];
-                        tempRows[1][pixindex+4] = color2[1];
-                        tempRows[2][pixindex+4] = color2[2];
-                     } //for e
-                  } //for t
-               }  /* for j */
-            } //for i
-         }
-         else
-         {
-            memset(m_uncompressedBuffer, 0, 256*256*3);
-         }
-         ossim_int32 tempCol = col*256;
-         ossim_int32 tempRow = row*256;
-         ossimIrect subRectToFill(frameRect.ul().x + tempCol,
-                                  frameRect.ul().y + tempRow,
-                                  frameRect.ul().x + tempCol + 255,
-                                  frameRect.ul().y + tempRow + 255);
-         tile->loadTile(m_uncompressedBuffer,
-                        subRectToFill,
-                        OSSIM_BSQ);
-      }
-   }
-}
-
-void ossimRpfCacheTileSource::fillSubTileCib(
-   const ossimRpfFrame&  aFrame,
-   const ossimIrect& tileRect,
-   const ossimFrameEntryData& frameEntryData,
-   ossimImageData* tile)
-{
-   // first let's grab the absolute position of the frame rectangle in pixel
-   // space
-   ossimIrect frameRect(frameEntryData.thePixelCol,
-                        frameEntryData.thePixelRow,
-                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
-                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
-
-
-   // now clip it to the tile
-   ossimIrect clipRect = tileRect.clipToRect(frameRect);
-
-   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
-
-   if(!compressionSection)
-   {
-      return;
-   }
-
-   const vector<ossimRpfColorGrayscaleTable>& colorTable =
-      aFrame.getColorGrayscaleTable();
-
-   // ESH 03/2009 -- Partial fix for ticket #646.
-   // Crash fix on reading RPFs: Make sure the colorTable vector 
-   // has entries before trying to make use of them. 
-   int numTables = (int)colorTable.size();
-   if ( numTables <= 0 )
-   {
-      return;
-   }
-
-   // check to see if it does overlap.  If it doesn't then the width and height
-   // will be a single point
-   {
-      ossim_uint8 *tempRow;
-
-      tempRow = m_uncompressedBuffer;
-
-      // find the shift to 0,0
-      ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
-                         clipRect.ul().y - frameEntryData.thePixelRow);
-
-      // In order to compute the subframe we will need the corner offsets of
-      // the upper left of the frame and the upper left of the clip rect.  The
-      // clip rect should be completely within the frame.  This just translates the value
-      // to make the upper left of the frame be 0,0.
-      //
-      ossimIrect offsetRect(tempDelta.x,
-                            tempDelta.y,
-                            tempDelta.x + clipRect.width()-1,
-                            tempDelta.y + clipRect.height()-1);
-
-      // each subframe is 64x64.  We will actually use 256x256 since
-      // we will be uncompressing them.  Note CADRG is a 256x256 tile
-      // compressed to 64x64x12 bit data
-      //
-      ossimIrect subFrameRect(offsetRect.ul().x/256,
-                              offsetRect.ul().y/256,
-                              (offsetRect.lr().x)/256,
-                              (offsetRect.lr().y)/256);
-
-      ossim_int32 row = 0;
-      ossim_int32 col = 0;
-      ossim_uint32 i = 0;
-      ossim_uint32 j = 0;
-      ossim_uint32 readPtr = 0;
-      for(row = subFrameRect.ul().y; row <= subFrameRect.lr().y; ++row)
-      {
-         for(col = subFrameRect.ul().x; col <= subFrameRect.lr().x; ++col)
-         {
-            readPtr = 0;
-            if(aFrame.fillSubFrameBuffer(m_compressedBuffer, 0, row, col))
-            {
-               for (i = 0; i < 256; i += 4)
-               {
-                  for (j = 0; j < 256; j += 8)
-                  {
-                     ossim_uint16 firstByte  = m_compressedBuffer[readPtr++] & 0xff;
-                     ossim_uint16 secondByte = m_compressedBuffer[readPtr++] & 0xff;
-                     ossim_uint16 thirdByte  = m_compressedBuffer[readPtr++] & 0xff;
-
-                     //because dealing with half-bytes is hard, we
-                     //uncompress two 4x4 tiles at the same time. (a
-                     //4x4 tile compressed is 12 bits )
-                     // this little code was grabbed from openmap software.
-
-                     /* Get first 12-bit value as index into VQ table */
-                     // I think we need to swap
-                     ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
-
-                     /* Get second 12-bit value as index into VQ table*/
-                     ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
-
-                     for (ossim_uint32 t = 0; t < 4; ++t)
-                     {
-                        for (ossim_uint32 e = 0; e < 4; ++e)
-                        {
-                           ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
-                           ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
-
-                           ossim_uint32 pixindex = ((i+t)*256) + (j + e);
-                           const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
-                           const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
-
-
-                           tempRow[pixindex]      = color1[0];
-                           tempRow[pixindex + 4]  = color2[0];
-                        } //for e
-                     } //for t
-                  }  /* for j */
-               } //for i
-            }
-            else
-            {
-               memset(m_uncompressedBuffer, 0, 256*256);
-            }
-            ossim_int32 tCol = col*256;
-            ossim_int32 tRow = row*256;
-            ossimIrect subRectToFill(frameRect.ul().x + tCol,
-                                     frameRect.ul().y + tRow,
-                                     frameRect.ul().x + tCol + 255,
-                                     frameRect.ul().y + tRow + 255);
-            tile->loadTile(m_uncompressedBuffer,
-                           subRectToFill,
-                           OSSIM_BSQ);
-         }
-      }
-   }  
-}
-
-void ossimRpfCacheTileSource::allocateForProduct()
-{
-   if(m_productType ==  OSSIM_PRODUCT_TYPE_UNKNOWN)
-   {
-      return;
-   }
-   if(m_uncompressedBuffer)
-   {
-      delete [] m_uncompressedBuffer;
-      m_uncompressedBuffer = 0;
-   }
-   if(m_compressedBuffer)
-   {
-      delete [] m_compressedBuffer;
-      m_compressedBuffer = 0;
-   }
-
-   // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
-   // convert to bytes
-   m_compressedBuffer   = new ossim_uint8[(64*64*12)/8];
-   if(m_productType == OSSIM_PRODUCT_TYPE_CIB)
-   {
-      m_uncompressedBuffer = new ossim_uint8[256*256];
-   }
-   else
-   {
-      m_uncompressedBuffer = new ossim_uint8[256*256*3];
-   }
-
-   m_tile = ossimImageDataFactory::instance()->create(this, this);
-   m_tile->initialize();
-}
-
-void ossimRpfCacheTileSource::deleteAll()
-{
-   theOverview = 0;
-}
-
-bool ossimRpfCacheTileSource::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)const
-{
-   bool result = ossimImageHandler::saveState(kwl, prefix);
-
-   return result;
-}
-
-bool ossimRpfCacheTileSource::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   const char* MODULE = "ossimRpfCacheTileSource::loadState";
-
-   if(traceDebug())
-   {
-      CLOG << "Entering..." << endl;
-   }
-   bool result = ossimImageHandler::loadState(kwl, prefix);
-
-   if(!result)
-   {
-      if(traceDebug())
-      {
-         CLOG << "Leaving..." << endl;
-      }
-      return false;
-   }
-   const char* lookup = 0;
-   lookup = kwl.find(ossimString(prefix), "entry");
-   ossim_int32 entry = ossimString(lookup).toInt32();
-
-   // if an entry is specified then
-   // call the open with an entry number
-   if(lookup)
-   {
-      if(traceDebug())
-      {
-         CLOG << "Leaving..." << endl;
-      }
-      result = ossimImageHandler::open(theImageFile);
-      setCurrentEntry(entry);
-      return result;
-   }
-
-   result = ossimImageHandler::open(theImageFile);
-
-   return result;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getImageTileWidth() const
-{
-   return 256;
-}
-
-ossim_uint32 ossimRpfCacheTileSource::getImageTileHeight() const
-{
-   return 256;
-}
-
-bool ossimRpfCacheTileSource::isCib() const
-{
-   return (m_productType==OSSIM_PRODUCT_TYPE_CIB);
-}
-
-bool ossimRpfCacheTileSource::isCadrg() const
-{
-   return (m_productType==OSSIM_PRODUCT_TYPE_CADRG);
-}
-
-ossimRefPtr<ossimProperty> ossimRpfCacheTileSource::getProperty(const ossimString& name)const
-{
-   if(name == "file_type")
-   {
-      if(m_productType == OSSIM_PRODUCT_TYPE_CIB)
-      {
-         return new ossimStringProperty("file_type", "CIB");
-      }
-      else if(m_productType == OSSIM_PRODUCT_TYPE_CADRG)
-      {
-         return new ossimStringProperty("file_type", "CADRG");
-      }
-      return 0;
-   }
-   return ossimImageHandler::getProperty(name);
-}
-
-void ossimRpfCacheTileSource::populateLut()
-{
-   theLut = 0;
-   if(m_fileNames.size() > 0)
-   {
-      // bool found = false;
-      ossimRpfFrameEntry tempEntry;
-      ossimRpfFrame aFrame;
-      ossimFilename fileName = m_fileNames[0].split("|")[0];
-      // if (fileName.exists())
-      // {
-      //    found = true;
-      // }
-
-      if(aFrame.parseFile(fileName)
-         == ossimErrorCodes::OSSIM_OK)
-      {
-         const vector<ossimRpfColorGrayscaleTable>& colorTable =
-            aFrame.getColorGrayscaleTable();
-
-         // ESH 03/2009 -- Partial fix for ticket #646.
-         // Crash fix on reading RPFs: Make sure the colorTable vector 
-         // has entries before trying to make use of them. 
-         int numTables = (int)colorTable.size();
-
-         ossim_uint32 numElements = (numTables > 0) ? colorTable[0].getNumberOfElements() : 0;
-         if(numElements > 0)
-         {
-            if((m_productType == OSSIM_PRODUCT_TYPE_CIB)||
-               (m_productType == OSSIM_PRODUCT_TYPE_CADRG))
-            {
-               theLut = new ossimNBandLutDataObject(numElements,
-                                                    3,
-                                                    OSSIM_UINT8);
-            }
-            else
-            {
-               theLut = 0;
-               return;
-            }
-            ossim_uint32 idx = 0;
-
-            for(idx = 0; idx < numElements;++idx)
-            {
-               const ossim_uint8* startOfData = colorTable[0].getStartOfData(idx);
-               switch(m_productType)
-               {
-                  case OSSIM_PRODUCT_TYPE_CIB:
-                  {
-                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     break;
-                  }
-                  case OSSIM_PRODUCT_TYPE_CADRG:
-                  {
-                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
-                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[1]);
-                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[2]);
-                     break;
-                  }
-                  default:
-                  {
-                     break;
-                  }
-               }
-            }
-         }
-      }
-   }
-}
-
-void ossimRpfCacheTileSource::establishDecimationFactors()
-{
-   theDecimationFactors.clear();
-   
-   // Just needed to set the first R level here, the base class can do the rest:
-   ossimImageHandler::establishDecimationFactors();
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimScalarRemapper.cpp b/ossim/src/ossim/imaging/ossimScalarRemapper.cpp
deleted file mode 100644
index 4ea5be7..0000000
--- a/ossim/src/ossim/imaging/ossimScalarRemapper.cpp
+++ /dev/null
@@ -1,582 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2001 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimScalarRemapper.
-// This class is used to remap image data from one scalar type to another.
-//
-//*******************************************************************
-//  $Id: ossimScalarRemapper.cpp 22135 2013-02-02 16:27:24Z dburken $
-
-#include <iostream>
-
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimPropertyEvent.h>
-#include <ossim/base/ossimRefreshEvent.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimStringProperty.h>
-
-RTTI_DEF1(ossimScalarRemapper,
-          "ossimScalarRemapper",
-          ossimImageSourceFilter)
-
-static const ossimTrace traceDebug("ossimScalarRemapper:debug");
-   
-ossimScalarRemapper::ossimScalarRemapper()
-   :
-      ossimImageSourceFilter(),
-      theNormBuf(NULL),
-      theTile(NULL),
-      theOutputScalarType(OSSIM_UINT8),
-      theByPassFlag(false)
-{
-}
-
-ossimScalarRemapper::ossimScalarRemapper(ossimImageSource* inputSource,
-                                         ossimScalarType outputScalarType)
-   :
-      ossimImageSourceFilter(inputSource),
-      theNormBuf(NULL),
-      theTile(NULL),
-      theOutputScalarType(outputScalarType),
-      theByPassFlag(false)
-{
-   if(inputSource)
-   {
-      if (inputSource->getOutputScalarType() == outputScalarType)
-      {
-         // Disable this filter simply return the inputSource's data.
-         theByPassFlag = true;
-         
-         // Nothing else to do.
-      }
-      else
-      {
-         theByPassFlag = false;
-      }
-   }
-   else
-   {
-      theByPassFlag = true;
-   }
-}
-
-ossimScalarRemapper::~ossimScalarRemapper()
-{
-   destroy();
-}
-
-void ossimScalarRemapper::destroy()
-{
-   if (theNormBuf)
-   {
-      delete [] theNormBuf;
-      theNormBuf = NULL;
-   }
-   theTile      = NULL;
-}
-
-ossimRefPtr<ossimImageData> ossimScalarRemapper::getTile(
-   const ossimIrect& tileRect, ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   // Fetch tile from pointer from the input source.
-   ossimRefPtr<ossimImageData> inputTile =
-      theInputConnection->getTile(tileRect, resLevel);
-
-   // Check for remap bypass:
-   if ( !isSourceEnabled()||theByPassFlag )
-   {
-      return inputTile;
-   }
-
-   // Check for first time through.
-   if ( !theTile.valid() )
-   {
-      allocate();
-      
-      if ( !theTile.valid() )
-      {
-         // This can happen if input/output scalars are the same.
-         return inputTile;
-      }
-   }
-
-   // Capture the size prior to a possible resize.
-   ossim_uint32 oldSize = theTile->getSize();
-
-   // Set the origin,bands of the output tile.
-   theTile->setImageRectangle(tileRect);
-
-   ossim_uint32 newSize = theTile->getSize();
-
-   // Check for size change before possible return.
-   if(newSize != oldSize)
-   {
-      if(theNormBuf)
-      {
-         //---
-         // Delete the current buffer since it is the wrong size.
-         // 
-         // NOTE:
-         // We won't reallocate it yet since we could return without using it.
-         // It will be checked prior to using later.
-         //---
-         delete [] theNormBuf;
-         theNormBuf = NULL;
-      }
-   }
-   
-   if ( !inputTile.valid() ||
-        (inputTile->getDataObjectStatus() == OSSIM_NULL) ||
-        (inputTile->getDataObjectStatus() == OSSIM_EMPTY) )
-   {
-      //---
-      // Since the filter is enabled, return theTile which is of the
-      // correct scalar type.
-      //---
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   if (!theNormBuf) // First time through or size changed and was deleted...
-   {
-      theNormBuf = new double[newSize];
-      memset(theNormBuf, '\0', newSize);
-   }
-
-   if (inputTile->getScalarType() == theOutputScalarType)
-   {
-      // Scalar types already the same.  Nothing to do...
-      return inputTile;
-   }
-   
-   switch(inputTile->getScalarType())
-   {
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         // Un-normalize and copy the buffer to the destination tile.
-         theTile->copyNormalizedBufferToTile(
-            static_cast<double*>( inputTile->getBuf() ) );
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         // Un-normalize and copy the buffer to the destination tile.
-         theTile->copyNormalizedBufferToTile(
-            static_cast<float*>( inputTile->getBuf() ) );
-         break;
-      }
-      default:
-      {
-         //---
-         // NOTE: stretchMinMax commented out as it was incorrectly not resetting
-         // the tile's min/max data members; hence, messing up the downstream copy
-         // to normalized buffer. (drb 02 Feb. 2013)
-         // Special case.  Stretch assuming caller want to view this data.
-         //---
-         // inputTile->stretchMinMax();
-
-         // Normalize and copy the source tile to a buffer.
-         inputTile->copyTileToNormalizedBuffer(theNormBuf);
-         
-         // Un-normalize and copy the buffer to the destination tile.
-         theTile->copyNormalizedBufferToTile(theNormBuf);
-
-         break;
-      }
-   }
-   
-   theTile->validate();
-   
-   return theTile;
-}
-
-ossimScalarType ossimScalarRemapper::getOutputScalarType() const
-{
-   if(isSourceEnabled()&&!theByPassFlag)
-   {
-      return theOutputScalarType;
-   }
-
-   return ossimImageSourceFilter::getOutputScalarType();
-}
-
-void ossimScalarRemapper::setOutputScalarType(ossimScalarType scalarType)
-{
-   if (scalarType == OSSIM_SCALAR_UNKNOWN)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimScalarRemapper::setOutputScalarType WARN:\n"
-         << "OSSIM_SCALAR_UNKNOWN passed to method.  No action taken..."
-         << std::endl;
-      }
-      return;
-   }
-   
-   if (theInputConnection)
-   {
-      if ( scalarType == theInputConnection->getOutputScalarType() )
-      {
-         // Input same as output, nothing for us to do...
-         theByPassFlag = true;
-      }
-      else // Types not equal...
-      {
-         theByPassFlag = false;
-         destroy();
-      }
-   }
-   else // No input source, disable.
-   {
-      theByPassFlag = true;
-   }
-
-   theOutputScalarType = scalarType;
-}
-
-void ossimScalarRemapper::setOutputScalarType(ossimString scalarType)
-{
-   int scalar =
-      ossimScalarTypeLut::instance()->getEntryNumber(scalarType.c_str());
-   
-   if (scalar != ossimLookUpTable::NOT_FOUND)
-   {
-      setOutputScalarType(static_cast<ossimScalarType>(scalar));
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimScalarRemapper ERROR:"
-         << "\nUnknown scalar type:  " << scalarType.c_str() << std::endl;
-      }
-   }
-}
-
-void ossimScalarRemapper::initialize()
-{
-   //---
-   // Call the base class initialize.
-   // Note:  This will reset "theInputConnection" if it changed...
-   //---
-   ossimImageSourceFilter::initialize();
-
-   if (theInputConnection)
-   {
-      // Set the bypass flag accordingly...
-      if ( theInputConnection->getOutputScalarType() == 
-           theOutputScalarType )
-      {
-         theByPassFlag = true;
-      }
-      else
-      {
-         theByPassFlag = false;
-      }
-      
-      if (theTile.valid())
-      {
-         //---
-         // Check for:
-         // - bypass
-         // - disabled(!enabled)
-         // - scalar change
-         // - band count change
-         //---
-         if ( theByPassFlag ||
-              !theEnableFlag ||
-              ( theInputConnection->getOutputScalarType() !=
-                theOutputScalarType ) ||
-              ( theInputConnection->getNumberOfOutputBands() !=
-                theTile->getNumberOfBands() ) )
-         {
-            destroy();  // Reallocated first unbypassed getTile.
-         }
-      }
-   }
-}
-
-void ossimScalarRemapper::allocate()
-{
-   destroy();
-
-   if(!theInputConnection) // Nothing to do here.
-   {
-      setInitializedFlag(false);
-      theByPassFlag = true;
-      return;
-   }
-   
-   if (theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
-   {
-      // default to OSSIM_UINT8
-      theOutputScalarType = OSSIM_UINT8;
-   }
-   
-   if(theInputConnection &&
-      (getOutputScalarType() != theInputConnection->getOutputScalarType())&&
-      (theInputConnection->getOutputScalarType() != OSSIM_SCALAR_UNKNOWN)&&
-      (getOutputScalarType() != OSSIM_SCALAR_UNKNOWN))
-   {
-      theByPassFlag = false;
-      
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-
-      // Initialize the tile.
-      theTile->initialize();
-      
-      // Set the base class flags to be initialized and enabled.
-      setInitializedFlag(true);
-      
-   } // End of "if(theInputConnection->isConnected()..."
-   else
-   {
-      // Set to not initialized and disabled.
-      setInitializedFlag(false);
-      theByPassFlag = true;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimScalarRemapper::allocate() DEBUG"
-         << "\ninput scalar:  " << theInputConnection->getOutputScalarType()
-         << "\noutput scalar: " << getOutputScalarType()
-         << "\nenabled:  " << (isSourceEnabled()?"true":"false")
-         << std::endl;
-   }
-}
-
-void ossimScalarRemapper::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property) return;
-
-   if(property->getName() == "Output scalar type")
-   {
-      theOutputScalarType = ossimScalarTypeLut::instance()->
-         getScalarTypeFromString(property->valueToString());
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimScalarRemapper::getProperty(const ossimString& name)const
-{
-   if(name == "Output scalar type")
-   {
-      std::vector<ossimString> scalarNames;
-
-      ossim_int32 tableSize = (ossim_int32)ossimScalarTypeLut::instance()->
-         getTableSize();
-      ossim_int32 idx;
-
-      for(idx = 0; idx < tableSize; ++idx)
-      {
-         scalarNames.push_back(ossimScalarTypeLut::instance()->
-                               getEntryString(idx));
-      }
-      ossimStringProperty* stringProp =
-         new ossimStringProperty("Output scalar type",
-                                 ossimScalarTypeLut::instance()->getEntryString((ossim_int32)theOutputScalarType),
-                                 false,
-                                 scalarNames);
-      stringProp->clearChangeType();
-      stringProp->setReadOnlyFlag(false);
-      stringProp->setCacheRefreshBit();
-      
-      return stringProp;
-   }
-
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimScalarRemapper::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-   propertyNames.push_back("Output scalar type");
-}
-
-bool ossimScalarRemapper::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix) const
-{
-   ossimImageSourceFilter::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           ossimKeywordNames::SCALAR_TYPE_KW,
-           ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType),
-           true);
-
-   return true;
-}
-
-bool ossimScalarRemapper::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   ossimImageSourceFilter::loadState(kwl, prefix);
-
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimScalarRemapper::loadState\n"
-            << " ERROR detected in keyword list!  State not loaded."
-            << std::endl;
-      }
-      return false;
-   }
-
-   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
-
-   if (scalar != ossimLookUpTable::NOT_FOUND)
-   {
-      setOutputScalarType(static_cast<ossimScalarType>(scalar));
-   }
-
-   return true;
-}
-
-ossimString ossimScalarRemapper::getOutputScalarTypeString() const
-{
-   return ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType);
-}
-
-void ossimScalarRemapper::propertyEvent(ossimPropertyEvent& event)
-{
-   // if my properties have changed then just initialize
-   //
-   if(event.getObject() == this)
-   {
-      initialize();
-   }
-   else // if an input property has changed just check to see if the number
-   {    // of bands has changed
-      
-      if(!theTile)
-      {
-         initialize();
-      }
-      else
-      {
-         int b = theInputConnection->getNumberOfOutputBands();
-         if((int)theTile->getNumberOfBands() != b)
-         {
-            initialize();
-         }
-      }
-   }
-}
-
-void ossimScalarRemapper::refreshEvent(ossimRefreshEvent& event)
-{
-   // if my properties have changed then just initialize
-   if(event.getObject() == this)
-   {
-      initialize();
-   }
-   else // if an input property has changed just check to see if the number
-   {    // of bands has changed
-      
-      if(!theTile)
-      {
-         initialize();
-      }
-      else
-      {
-         int b = theInputConnection->getNumberOfOutputBands();
-         if((int)theTile->getNumberOfBands() != b)
-         {
-            initialize();
-         }
-      }
-   }
-}
-
-double ossimScalarRemapper::getNullPixelValue(ossim_uint32 band) const
-{
-   if(!isSourceEnabled()||theByPassFlag)
-   {
-      if(theInputConnection)
-      {
-         return theInputConnection->getNullPixelValue(band);
-      }
-   }
-   else if(theTile.valid())
-   {
-      if (band < theTile->getNumberOfBands())
-      {
-         return theTile->getNullPix(band);
-      }
-   }
-   
-   return ossim::defaultNull(theOutputScalarType);
-}
-
-double ossimScalarRemapper::getMinPixelValue(ossim_uint32 band) const
-{
-   if(!isSourceEnabled()||theByPassFlag)
-   {
-      if(theInputConnection)
-      {
-         return theInputConnection->getMinPixelValue(band);
-      }
-   }
-   else if(theTile.valid())
-   {
-      if (band < theTile->getNumberOfBands())
-      {
-         return theTile->getMinPix(band);
-      }
-   }
-   
-   return ossim::defaultMin(theOutputScalarType);
-}
-
-double ossimScalarRemapper::getMaxPixelValue(ossim_uint32 band) const
-{
-   if(!isSourceEnabled()||theByPassFlag)
-   {
-      if(theInputConnection)
-      {
-         return theInputConnection->getMaxPixelValue(band);
-      }
-   }
-   else if(theTile.valid())
-   {
-      if (band < theTile->getNumberOfBands())
-      {
-         return theTile->getMaxPix(band);
-      }
-   }
-   
-   return ossim::defaultMax(theOutputScalarType);
-}
-
-ossimString ossimScalarRemapper::getLongName()const
-{
-   return ossimString("Scalar Remapper, filters between different scalar types.");
-}
-
-ossimString ossimScalarRemapper::getShortName()const
-{
-   return ossimString("Scalar Remapper");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimScaleFilter.cpp b/ossim/src/ossim/imaging/ossimScaleFilter.cpp
deleted file mode 100644
index 672243f..0000000
--- a/ossim/src/ossim/imaging/ossimScaleFilter.cpp
+++ /dev/null
@@ -1,960 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimScaleFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimScaleFilter.h>
-#include <ossim/imaging/ossimFilter.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimDiscreteConvolutionKernel.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimScaleFilter, "ossimScaleFilter", ossimImageSourceFilter);
-
-//**************************************************************************************************
-ossimScaleFilter::ossimScaleFilter()
-   :ossimImageSourceFilter(),
-    m_BlankTile(NULL),
-    m_Tile(NULL),
-    m_MinifyFilter(NULL),
-    m_MagnifyFilter(NULL),
-    m_MinifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
-    m_MagnifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
-    m_ScaleFactor(1.0, 1.0),
-    m_InverseScaleFactor(1.0, 1.0),
-    m_TileSize(64, 64),
-    m_BlurFactor(1.0)
-{
-   m_InputRect.makeNan();
-   m_MinifyFilter  = new ossimNearestNeighborFilter();
-   m_MagnifyFilter = new ossimNearestNeighborFilter();
-}
-
-//**************************************************************************************************
-ossimScaleFilter::ossimScaleFilter(ossimImageSource* inputSource,
-                                   const ossimDpt& scaleFactor)
-   :ossimImageSourceFilter(inputSource),
-    m_BlankTile(NULL),
-    m_Tile(NULL),
-    m_MinifyFilter(NULL),
-    m_MagnifyFilter(NULL),
-    m_MinifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
-    m_MagnifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
-    m_ScaleFactor(scaleFactor),
-    m_TileSize(64, 64),
-    m_BlurFactor(1.0)
-{
-   m_InputRect.makeNan();
-   m_MinifyFilter  = new ossimNearestNeighborFilter();
-   m_MagnifyFilter = new ossimNearestNeighborFilter();
-}
-
-//**************************************************************************************************
-ossimScaleFilter::~ossimScaleFilter()
-{
-   if(m_MinifyFilter)
-   {
-      delete m_MinifyFilter;
-      m_MinifyFilter = NULL;
-   }
-   
-   if(m_MagnifyFilter)
-   {
-      delete m_MagnifyFilter;
-      m_MagnifyFilter = NULL;
-   }
-}
-
-//**************************************************************************************************
-ossimRefPtr<ossimImageData> ossimScaleFilter::getTile(
-   const ossimIrect& tileRect, ossim_uint32 resLevel)
-{
-   
-   if((!isSourceEnabled())||
-      (!theInputConnection)||
-      ((m_ScaleFactor.x == 1.0)&&
-       (m_ScaleFactor.y == 1.0)&&
-       (m_BlurFactor == 1.0)))
-   {
-      return ossimImageSourceFilter::getTile(tileRect, resLevel);
-   }
-   if(!m_Tile.valid())
-   {
-      allocate();
-   }
-
-   if(!m_Tile)
-   {
-      return ossimImageSourceFilter::getTile(tileRect, resLevel);
-   }
-
-   m_Tile->makeBlank();
-
-                       
-   ossimIrect imageRect = tileRect*m_InverseScaleFactor;
-
-   m_Tile->setImageRectangle(tileRect);
-   m_BlankTile->setImageRectangle(tileRect);
-
-
-   double xSupport;
-   double ySupport;
-
-   getSupport(xSupport, ySupport);
-   
-   ossimIpt deltaPt;
-   deltaPt.x = (ossim_int32)ceil(xSupport);
-   deltaPt.y = (ossim_int32)ceil(ySupport);
-
-   imageRect = ossimIrect(imageRect.ul().x - (deltaPt.x),
-                          imageRect.ul().y - (deltaPt.y),
-                          imageRect.lr().x + (deltaPt.x),
-                          imageRect.lr().y + (deltaPt.y));
-
-   
-   runFilter(imageRect, tileRect);
-   
-   m_Tile->validate();
-   
-   return m_Tile;
-}
-
-//**************************************************************************************************
-void ossimScaleFilter::runFilter(const ossimIrect& imageRect,
-                                 const ossimIrect& viewRect)
-{
-   switch(m_Tile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         runFilterTemplate((ossim_uint8)0,
-                           imageRect,
-                           viewRect);
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         runFilterTemplate((ossim_uint16)0,
-                           imageRect,
-                           viewRect);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         runFilterTemplate((ossim_sint16)0,
-                           imageRect,
-                           viewRect);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         runFilterTemplate((ossim_uint32)0,
-                           imageRect,
-                           viewRect);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         runFilterTemplate((ossim_float64)0,
-                           imageRect,
-                           viewRect);
-         break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         runFilterTemplate((ossim_float32)0,
-                           imageRect,
-                           viewRect);
-         break;
-      }
-      default:
-         break;
-   }
-}
-
-//**************************************************************************************************
-template <class T>
-void ossimScaleFilter::runFilterTemplate(T dummy,
-                                         const ossimIrect& imageRect,
-                                         const ossimIrect& viewRect)
-{
-   ossimRefPtr<ossimImageData> inputData =
-      theInputConnection->getTile(imageRect);
-
-   if(!inputData.valid()   ||
-      !inputData->getBuf() ||
-      (inputData->getDataObjectStatus() == OSSIM_EMPTY))
-   {
-      return;
-   }
-
-   ossim_int32 h = imageRect.height();
-   ossimRefPtr<ossimImageData> tempData =
-      ossimImageDataFactory::instance()->create(NULL,
-                                                inputData->getScalarType(),
-                                                inputData->getNumberOfBands(),
-                                                viewRect.width(),
-                                                h);
-   tempData->setOrigin(ossimIpt(viewRect.ul().x,
-                                imageRect.ul().y));
-   
-   tempData->initialize();
-   
-   if((m_ScaleFactor.x != 1.0)||
-      (m_BlurFactor != 1.0))
-   {
-      runHorizontalFilterTemplate(dummy,
-                                  inputData,
-                                  tempData);
-      tempData->validate();
-   }
-   else
-   {
-      tempData->loadTile(inputData.get());
-   }
-   
-   if((m_ScaleFactor.y != 1.0)||
-      (m_BlurFactor != 1.0))
-   {
-      runVerticalFilterTemplate(dummy,
-                                tempData,
-                                m_Tile);
-   }
-   else
-   {
-      m_Tile->loadTile(tempData.get());
-   }
-   
-   m_Tile->validate();
-}
-
-//**************************************************************************************************
-ossimIrect ossimScaleFilter::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimIrect result = ossimImageSourceFilter::getBoundingRect(resLevel);
-
-   if(!result.hasNans())
-   {
-      result = ossimIrect(result.ul().x,
-                          result.ul().y,
-                          result.lr().x+1,
-                          result.lr().y+1);
-      result *= m_ScaleFactor;
-   }
-   
-   return result;
-}
-
-//**************************************************************************************************
-void ossimScaleFilter::setFilterType(ossimScaleFilterType filterType)
-{
-   setFilterType(filterType, filterType);
-}
-
-
-//**************************************************************************************************
-void ossimScaleFilter::setFilterType(ossimScaleFilterType minifyFilterType,
-                                     ossimScaleFilterType magnifyFilterType)
-{
-   if(m_MinifyFilter)
-   {
-      delete m_MinifyFilter;
-      m_MinifyFilter = NULL;
-   }
-   if(m_MagnifyFilter)
-   {
-      delete m_MagnifyFilter;
-      m_MagnifyFilter = NULL;
-   }
-   
-   m_MinifyFilterType  = minifyFilterType;
-   m_MagnifyFilterType = magnifyFilterType;
-   
-   m_MinifyFilter  = createNewFilter(minifyFilterType, m_MinifyFilterType);
-   m_MagnifyFilter = createNewFilter(magnifyFilterType, m_MagnifyFilterType);
-}
-
-//**************************************************************************************************
-ossimFilter* ossimScaleFilter::createNewFilter(ossimScaleFilterType filterType,
-                                               ossimScaleFilterType& result)
-{
-   switch(filterType)
-   {
-   case ossimScaleFilter_NEAREST_NEIGHBOR:
-   {
-      return new ossimNearestNeighborFilter();
-   }
-   case ossimScaleFilter_BOX:
-   {
-      return new ossimBoxFilter();
-   }
-   case ossimScaleFilter_GAUSSIAN:
-   {
-      return new ossimGaussianFilter();
-   }
-   case ossimScaleFilter_CUBIC:
-   {
-      return new ossimCubicFilter();
-   }
-   case ossimScaleFilter_HANNING:
-   {
-      return new ossimHanningFilter();
-   }
-   case ossimScaleFilter_HAMMING:
-   {
-      return new ossimHammingFilter();
-   }
-   case ossimScaleFilter_LANCZOS:
-   {
-      return new ossimLanczosFilter();
-   }
-   case ossimScaleFilter_CATROM:
-   {
-      return new ossimCatromFilter();
-   }
-   case ossimScaleFilter_MITCHELL:
-   {
-      return new ossimMitchellFilter();
-   }
-   case ossimScaleFilter_BLACKMAN:
-   {
-      return new ossimBlackmanFilter();
-   }
-   case ossimScaleFilter_BLACKMAN_SINC:
-   {
-      return new ossimBlackmanSincFilter();
-   }
-   case ossimScaleFilter_BLACKMAN_BESSEL:
-   {
-      return new ossimBlackmanBesselFilter();
-   }
-   case ossimScaleFilter_QUADRATIC:
-   {
-      return new ossimQuadraticFilter();
-   }
-   case ossimScaleFilter_TRIANGLE:
-   {
-      return new ossimTriangleFilter();
-   }
-   case ossimScaleFilter_HERMITE:
-   {
-      return new ossimHermiteFilter();
-   }
-   
-   }
-
-   result = ossimScaleFilter_NEAREST_NEIGHBOR;
-   return new ossimNearestNeighborFilter();
-}
-
-//**************************************************************************************************
-void ossimScaleFilter::setScaleFactor(const ossimDpt& scale)
-{
-   m_ScaleFactor = scale;
-   if(fabs(m_ScaleFactor.x) <= FLT_EPSILON)
-   {
-      m_ScaleFactor.x = 1.0;
-   }
-   if(fabs(m_ScaleFactor.y) <= FLT_EPSILON)
-   {
-      m_ScaleFactor.y = 1.0;
-   }
-
-   m_InverseScaleFactor.x = 1.0/m_ScaleFactor.x;
-   m_InverseScaleFactor.y = 1.0/m_ScaleFactor.y;
-
-   // A change in the scale factor implies a change to the image geometry. If one has been created
-   // it needs to be modified:
-   updateGeometry();
-}
-
-
-//**************************************************************************************************
-template <class T> void ossimScaleFilter::runHorizontalFilterTemplate(
-   T /* dummy */,
-   const ossimRefPtr<ossimImageData>& input,
-   ossimRefPtr<ossimImageData>& output)
-{
-   ossimIrect viewRect  = output->getImageRectangle();
-   ossimIrect imageRect = input->getImageRectangle();
-   ossim_int32 vw = viewRect.width();
-   ossim_int32 vh = viewRect.height();
-   ossim_int32 iw = imageRect.width();
-   ossimIpt origin(viewRect.ul());
-   ossimIpt imageOrigin(imageRect.ul());
-   ossimIpt inputUl = m_InputRect.ul();
-   ossimIpt inputLr = m_InputRect.lr();
-   
-   double scale = 0.0;
-   double support = 0.0;
-   ossim_int32 x = 0;
-   ossim_int32 y = 0;
-   ossim_int32 start = 0;
-   ossim_int32 stop  = 0;
-   ossim_int32 kernelIdx = 0;
-   const ossimFilter* filter = getHorizontalFilter();
-   ossim_float64 center = 0.0;
-   ossim_int32 bandIdx = 0;
-   ossim_int32 numberOfBands = m_Tile->getNumberOfBands();
-   
-   scale = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.x, 1.0);
-   
-   support=scale*filter->getSupport();
-   if (support <= 0.5)
-   {
-      support = 0.5 + FLT_EPSILON;
-      scale = 1.0;
-   }
-   scale=1.0/scale;
-   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-   {
-      T* imageBuf = (T*)input->getBuf(bandIdx);
-      T* viewBuf  = (T*)output->getBuf(bandIdx);
-      T np        = (T)input->getNullPix(bandIdx);
-      T outNp     = (T)output->getNullPix(bandIdx);
-      T outMinPix = (T)output->getMinPix(bandIdx);
-      T outMaxPix = (T)output->getMaxPix(bandIdx);
-      
-      for(x = 0; x < vw; ++x)
-      {
-         center=(origin.x + x+ .5)/m_ScaleFactor.x;
-         start=ossim::max((ossim_int32)ossim::round<int>(center-support), (ossim_int32)inputUl.x);
-         stop=ossim::min((ossim_int32)ossim::round<int>(center+support), (ossim_int32)inputLr.x);
-         ossim_int32 delta = stop-start;
-         if (delta <= 0)
-         {
-            break;
-         }
-         vector<double> kernel(delta);
-         double density=0.0;
-         
-         for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
-         {
-            double t = scale*(start + kernelIdx -
-                              center + .5);
-            kernel[kernelIdx] = filter->filter(t,
-                                               filter->getSupport());
-            density += kernel[kernelIdx];
-         }
-         if ((density != 0.0) && (density != 1.0))
-         {
-            /*
-              Normalize.
-            */
-            density=1.0/density;
-            for (kernelIdx=0; kernelIdx < delta; kernelIdx++)
-               kernel[kernelIdx]*=density;
-         }
-         ossim_int32 offset       = start  - imageOrigin.x;
-         
-         T* xptr         = imageBuf + offset;
-         T* xCenterptr   = imageBuf + offset;
-         T* outptr       = viewBuf  + x;
-         
-         for(y = 0; y < vh; ++y)
-         {
-            double result = 0.0;
-            density = 0.0;
-            if((*xCenterptr) == np)
-            {
-               *outptr = outNp;
-            }
-            else
-            {
-               for(kernelIdx = 0; kernelIdx < (int)kernel.size(); ++kernelIdx)
-               {
-                  if((*xptr != np)&&
-                     (kernel[kernelIdx] != 0.0))
-                  {
-                     result  += ((double)(*(xptr+kernelIdx))*kernel[kernelIdx]);
-                     density += kernel[kernelIdx];
-                  }
-               }
-               if(density != 0.0)
-               {
-                  result /= density;
-                  
-                  if(result < outMinPix) result = outMinPix;
-                  if(result > outMaxPix) result = outMaxPix;
-                  
-                  *outptr = (T)result;
-               }
-               else
-               {
-                  *outptr = outNp;
-               }
-            }
-            xCenterptr += iw;
-            xptr   += iw;
-            outptr += vw;
-         }
-      }
-   }
-}
-
-//**************************************************************************************************
-template <class T> void ossimScaleFilter::runVerticalFilterTemplate(
-   T /* dummy */,
-   const ossimRefPtr<ossimImageData>& input,
-   ossimRefPtr<ossimImageData>& output)
-{
-   ossimIrect viewRect  = output->getImageRectangle();
-   ossimIrect imageRect = input->getImageRectangle();
-   ossim_int32 vw = viewRect.width();
-   ossim_int32 vh = viewRect.height();
-   ossim_int32 iw = imageRect.width();
-   ossimIpt origin(viewRect.ul());
-   ossimIpt imageOrigin(imageRect.ul());
-   ossimIpt inputUl = m_InputRect.ul();
-   ossimIpt inputLr = m_InputRect.lr();
-   double scale = 0.0;
-   double support = 0.0;
-   ossim_int32 x = 0;
-   ossim_int32 y = 0;
-   ossim_int32 start = 0;
-   ossim_int32 stop  = 0;
-   ossim_int32 kernelIdx = 0;
-   const ossimFilter* filter = getVerticalFilter();
-   ossim_float64 center = 0.0;
-   ossim_int32 bandIdx = 0;
-   ossim_int32 numberOfBands = m_Tile->getNumberOfBands();
-   
-   scale = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.y, 1.0);
-   
-   support=scale*filter->getSupport();
-   if (support <= 0.5)
-   {
-      support = .5 + FLT_EPSILON;
-      scale = 1.0;
-   }
-   scale=1.0/scale;
-
-   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
-   {
-      T* imageBuf = (T*)input->getBuf(bandIdx);
-      T* viewBuf  = (T*)output->getBuf(bandIdx);
-      T np        = (T)input->getNullPix(bandIdx);
-      T outNp     = (T)output->getNullPix(bandIdx);
-      T outMinPix = (T)output->getMinPix(bandIdx);
-      T outMaxPix = (T)output->getMaxPix(bandIdx);
-     
-      for(y = 0; y < vh; ++y)
-      {
-         center=(double) ((y + origin.y+0.5)/m_ScaleFactor.y);
-         start=ossim::max((ossim_int32)ossim::round<int>(center-support), (ossim_int32)inputUl.y);
-         stop=ossim::min((ossim_int32)ossim::round<int>(center+support), (ossim_int32)inputLr.y);
-         ossim_int32 delta = stop-start;
-         if (delta <= 0)
-         {
-            break;
-         }
-         vector<double> kernel(delta);
-         double density = 0.0;
-         for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
-         {
-            kernel[kernelIdx] = filter->filter(scale*(start + kernelIdx - center + .5),
-                                               filter->getSupport());
-            density += kernel[kernelIdx];
-         }
-         if ((density != 0.0) && (density != 1.0))
-         {
-            /*
-              Normalize.
-            */
-            density=1.0/density;
-            for (kernelIdx=0; kernelIdx < delta; kernelIdx++)
-               kernel[kernelIdx]*=density;
-         }
-
-         ossim_int32 offset       = ((start  - imageOrigin.y)*iw);
-         ossim_int32 offsetCenter = ((((ossim_int32)center) - imageOrigin.y)*iw);
-        
-         for(x = 0; x < vw; ++x)
-         {
-            T* yptr         = imageBuf + offset       + x;
-            T* yCenterptr   = imageBuf + offsetCenter + x;
-            double result = 0.0;
-            density = 0.0;
-
-            if((*yCenterptr) == np)
-            {
-               *viewBuf = outNp;
-            }
-            else
-            {
-               for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
-               {
-                  if((*yptr != np)&&
-                     (kernel[kernelIdx] != 0.0))
-                  {
-                     result  += ((*yptr)*kernel[kernelIdx]);
-                     density += kernel[kernelIdx];
-                  }
-                  yptr += iw;
-               }
-               if(density != 0.0)
-               {
-                  result /= density;
-                 
-                  if(result < outMinPix) result = outMinPix;
-                  if(result > outMaxPix) result = outMaxPix;
-                 
-                  *viewBuf = (T)result;
-               }
-               else
-               {
-                  *viewBuf = outNp;
-               }
-            }
-            ++viewBuf;
-         }
-      }
-   }
-}
-
-//**************************************************************************************************
-void ossimScaleFilter::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   // Force an allocate next getTile.
-   m_Tile = NULL;
-   m_BlankTile = NULL;
-   m_InputRect.makeNan();
-}
-
-//**************************************************************************************************
-void ossimScaleFilter::allocate()
-{
-   m_Tile      = NULL;
-   m_BlankTile = NULL;
-   m_InputRect.makeNan();
-
-   if(theInputConnection&&isSourceEnabled())
-   {
-      m_Tile      = ossimImageDataFactory::instance()->create(this, this);
-      m_BlankTile = ossimImageDataFactory::instance()->create(this, this);
-      
-      m_Tile->initialize();
-
-      m_InputRect = theInputConnection->getBoundingRect();
-   }
-}
-
-//**************************************************************************************************
-// Returns a pointer reference to the active image geometry at this filter. The input source
-// geometry is modified, so we need to maintain our own geometry object as a data member.
-//**************************************************************************************************
-ossimRefPtr<ossimImageGeometry> ossimScaleFilter::getImageGeometry()
-{
-   // Have we already defined our own geometry? Return it if so:
-   if (m_ScaledGeometry.valid()) return m_ScaledGeometry;
-
-   // Otherwise we'll need to establish a geometry based on the input connection:
-   if(theInputConnection)
-   {
-      // Fetch the map projection of the input image if it exists:
-      ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
-
-      // If trivial case of identity scale, just pass along the input connection's geometry:
-      if ((m_ScaleFactor.x == 1.0) && (m_ScaleFactor.y == 1.0))
-         return inputGeom;
-
-      // Need to create a copy of the input geom and modify it as our own, then pass that:
-      if ( inputGeom.valid() )
-      {
-         m_ScaledGeometry = new ossimImageGeometry(*inputGeom);
-         updateGeometry();
-
-         // Return the modified geometry:
-         return m_ScaledGeometry;
-      }
-   }
-
-   // No geometry defined, return NULL pointer:
-   return ossimRefPtr<ossimImageGeometry>();
-}
-
-//**************************************************************************************************
-ossimIrect ossimScaleFilter::scaleRect(const ossimIrect input,
-                                       const ossimDpt& scaleFactor)const
-{
-   ossimIpt origin(ossim::round<int>(input.ul().x*scaleFactor.x),
-                   ossim::round<int>(input.ul().y*scaleFactor.y));
-   ossim_int32 w = ossim::round<int>(input.width()*scaleFactor.x);
-   ossim_int32 h = ossim::round<int>(input.height()*scaleFactor.y);
-
-   if(w < 1) w = 1;
-   if(h < 1) h = 1;
-   
-   return ossimIrect(origin.x,
-                     origin.y,
-                     origin.x + (w-1),
-                     origin.y + (h-1));
-}
-
-//**************************************************************************************************
-ossimString ossimScaleFilter::getFilterTypeAsString(ossimScaleFilterType type)const
-{
-   switch(type)
-   {
-   case ossimScaleFilter_NEAREST_NEIGHBOR:
-   {
-      return "nearest_neighbor";
-   }
-   case ossimScaleFilter_BOX:
-   {
-      return "box";
-   }
-   case ossimScaleFilter_GAUSSIAN:
-   {
-      return "gaussian";
-   }
-   case ossimScaleFilter_CUBIC:
-   {
-      return "cubic";
-   }
-   case ossimScaleFilter_HANNING:
-   {
-      return "hanning";
-   }
-   case ossimScaleFilter_HAMMING:
-   {
-      return "hamming";
-   }
-   case ossimScaleFilter_LANCZOS:
-   {
-      return "lanczos";
-   }
-   case ossimScaleFilter_MITCHELL:
-   {
-      return "mitchell";
-   }
-   case ossimScaleFilter_CATROM:
-   {
-      return "catrom";
-   }
-   case ossimScaleFilter_BLACKMAN:
-   {
-      return "blackman";
-   }
-   case ossimScaleFilter_BLACKMAN_SINC:
-   {
-      return "blackman_sinc";
-   }
-   case ossimScaleFilter_BLACKMAN_BESSEL:
-   {
-      return "blackman_bessel";
-   }
-   case ossimScaleFilter_QUADRATIC:
-   {
-      return "quadratic";
-   }
-   case ossimScaleFilter_TRIANGLE:
-   {
-      return "triangle";
-   }
-   case ossimScaleFilter_HERMITE:
-   {
-      return "hermite";
-   }
-   }
-
-   return "nearest_neighbor";
-}
-
-//**************************************************************************************************
-ossimScaleFilter::ossimScaleFilterType ossimScaleFilter::getFilterType(const ossimString& type)const
-{
-   ossimString typeUpper = type;
-   typeUpper = typeUpper.upcase();
-
-   if(typeUpper.contains("BOX"))
-   {
-      return ossimScaleFilter_BOX;
-   }
-   else if(typeUpper.contains("NEAREST_NEIGHBOR"))
-   {
-      return ossimScaleFilter_NEAREST_NEIGHBOR;
-   }
-   else if(typeUpper.contains("GAUSSIAN"))
-   {
-      return ossimScaleFilter_GAUSSIAN;
-   }
-   else if(typeUpper.contains("HANNING"))
-   {
-      return ossimScaleFilter_HANNING;
-   }
-   else if(typeUpper.contains("HAMMING"))
-   {
-      return ossimScaleFilter_HAMMING;
-   }
-   else if(typeUpper.contains("LANCZOS"))
-   {
-      return ossimScaleFilter_LANCZOS;
-   }
-   else if(typeUpper.contains("MITCHELL"))
-   {
-      return ossimScaleFilter_MITCHELL;
-   }
-   else if(typeUpper.contains("CATROM"))
-   {
-      return ossimScaleFilter_CATROM;
-   }
-   else if(typeUpper.contains("CUBIC"))
-   {
-      return ossimScaleFilter_CUBIC;
-   }
-   else if(typeUpper.contains("BLACKMAN_BESSEL"))
-   {
-      return ossimScaleFilter_BLACKMAN_BESSEL;
-   }
-   else if(typeUpper.contains("BLACKMAN_SINC"))
-   {
-      return ossimScaleFilter_BLACKMAN_SINC;
-   }
-   else if(typeUpper.contains("BLACKMAN"))
-   {
-      return ossimScaleFilter_BLACKMAN;
-   }
-   else if(typeUpper.contains("QUADRATIC"))
-   {
-      return ossimScaleFilter_QUADRATIC;
-   }
-   else if(typeUpper.contains("TRIANGLE"))
-   {
-      return ossimScaleFilter_TRIANGLE;
-   }
-   else if(typeUpper.contains("HERMITE"))
-   {
-      return ossimScaleFilter_HERMITE;
-   }
-   
-   return ossimScaleFilter_NEAREST_NEIGHBOR;
-}
-
-//**************************************************************************************************
-void ossimScaleFilter::getSupport(double& x, double& y)
-{
-   const ossimFilter* horizontalFilter = getHorizontalFilter();
-   const ossimFilter* verticalFilter   = getVerticalFilter();
-   
-   x = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.x, 1.0)*
-       horizontalFilter->getSupport();
-   y = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.y, 1.0)*
-       verticalFilter->getSupport();
-}
-
-//**************************************************************************************************
-const ossimFilter* ossimScaleFilter::getHorizontalFilter()const
-{
-   if(m_ScaleFactor.x < 1)
-   {
-      return m_MinifyFilter;
-   }
-
-   return m_MagnifyFilter;
-}
-
-//**************************************************************************************************
-const ossimFilter* ossimScaleFilter::getVerticalFilter()const
-{
-   if(m_ScaleFactor.y < 1)
-   {
-      return m_MinifyFilter;
-   }
-
-   return m_MagnifyFilter;
-}
-
-
-
-//**************************************************************************************************
-bool ossimScaleFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_X_KW,
-           m_ScaleFactor.x,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_Y_KW,
-           m_ScaleFactor.y,
-           true);
-   kwl.add(prefix,
-           "minify_type",
-           getFilterTypeAsString(m_MinifyFilterType),
-           true);
-   kwl.add(prefix,
-           "magnify_type",
-           getFilterTypeAsString(m_MagnifyFilterType),
-           true);
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-//**************************************************************************************************
-bool ossimScaleFilter::loadState(const ossimKeywordlist& kwl,
-                                 const char* prefix)
-{
-   ossimString scalex  = kwl.find(prefix,
-                                 ossimKeywordNames::SCALE_X_KW);
-   ossimString scaley  = kwl.find(prefix,
-                                  ossimKeywordNames::SCALE_Y_KW);
-   ossimString minify  = kwl.find(prefix,
-                                  "minify_type");
-   ossimString magnify = kwl.find(prefix,
-                                  "magnify_type");
-   
-   m_ScaleFactor.x = scalex.toDouble();
-   m_ScaleFactor.y = scaley.toDouble();
-
-   if(fabs(m_ScaleFactor.x) <= FLT_EPSILON)
-   {
-      m_ScaleFactor.x = 1.0;
-   }
-   if(fabs(m_ScaleFactor.y) <= FLT_EPSILON)
-   {
-      m_ScaleFactor.y = 1.0;
-   }
-
-   m_InverseScaleFactor.x = 1.0/m_ScaleFactor.x;
-   m_InverseScaleFactor.y = 1.0/m_ScaleFactor.y;
-   
-   setFilterType(getFilterType(minify),
-                 getFilterType(magnify));
-   
-   // A change in the scale factor implies a change to the image geometry. If one has been created
-   // it needs to be modified:
-   updateGeometry();
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-//**************************************************************************************************
-//! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
-//! a scale change so that the geometry's projection is modified accordingly.
-//**************************************************************************************************
-void ossimScaleFilter::updateGeometry()
-{
-   if (m_ScaledGeometry.valid())
-   {
-      // Modify the image geometry's projection with the scale factor before returning geom:
-      ossimProjection* proj = m_ScaledGeometry->getProjection();
-      ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);
-      if(mapProj)
-         mapProj->applyScale(m_InverseScaleFactor, true);
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimShiftFilter.cpp b/ossim/src/ossim/imaging/ossimShiftFilter.cpp
deleted file mode 100644
index dbd4736..0000000
--- a/ossim/src/ossim/imaging/ossimShiftFilter.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-//----------------------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Filter for shifting input to an output range.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/imaging/ossimShiftFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-
-RTTI_DEF1(ossimShiftFilter, "ossimShiftFilter", ossimImageSourceFilter)
-
-static ossimTrace traceDebug("ossimShiftFilter:debug");
-
-ossimShiftFilter::ossimShiftFilter()
-   :
-   ossimImageSourceFilter(),  // base class
-   m_tile(0),
-   m_min(ossim::nan()),
-   m_max(ossim::nan()),
-   m_null(ossim::nan())
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimShiftFilter::ossimShiftFilter entered...\n";
-   }
-}
-
-ossimShiftFilter::~ossimShiftFilter()
-{
-}
-
-void ossimShiftFilter::initialize()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimShiftFilter::initialize entered..." << endl;
-   }
-
-   //---
-   // Call the base class initialize.
-   // Note:  This will reset "theInputConnection" if it changed...
-   //---
-   ossimImageSourceFilter::initialize();
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimShiftFilter::initialize exited..." << endl;
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimShiftFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> result = 0;
-   
-   if ( theInputConnection )
-   {
-      ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile( tileRect, resLevel );
-      
-      if ( inputTile.get() && isSourceEnabled() &&
-           !ossim::isnan(m_null) && !ossim::isnan(m_min) && !ossim::isnan(m_max) )
-      {
-         // Get its status of the input tile.
-         ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
-         
-         if ( tile_status != OSSIM_NULL )
-         {
-            if ( !m_tile )
-            {
-               allocate(); // First time through.
-            }
-            
-            if ( tile_status != OSSIM_EMPTY )
-            {
-               // Set the origin,bands of the output tile.
-               m_tile->setImageRectangle(tileRect);
-
-               switch(inputTile->getScalarType())
-               {
-                  case OSSIM_UINT8:
-                  {
-                     fillTile( ossim_uint8(0), inputTile.get(), m_tile.get() );
-                     break;
-                  }
-                  case OSSIM_SINT8:
-                  {
-                     fillTile( ossim_sint8(0), inputTile.get(), m_tile.get() );
-                     break;
-                  }
-                  case OSSIM_UINT16:
-                  case OSSIM_USHORT11:
-                  {
-                     fillTile( ossim_uint16(0), inputTile.get(), m_tile.get() );
-                     break;
-                  }
-                  case OSSIM_SINT16:
-                  {
-                     fillTile( ossim_sint16(0), inputTile.get(), m_tile.get() ); 
-                     break;
-                  }
-                  case OSSIM_SINT32:
-                  {
-                     fillTile( ossim_sint32(0), inputTile.get(), m_tile.get() );
-                     break;
-                  }
-                  case OSSIM_UINT32:
-                  {
-                     fillTile( ossim_uint32(0), inputTile.get(), m_tile.get() );
-                     break;
-                  }
-                  case OSSIM_FLOAT32: 
-                  case OSSIM_NORMALIZED_FLOAT:
-                  {
-                     fillTile( ossim_float32(0), inputTile.get(), m_tile.get() );
-                     break;
-                  }
-                  case OSSIM_FLOAT64:
-                  case OSSIM_NORMALIZED_DOUBLE:
-                  {
-                     fillTile( ossim_float64(0), inputTile.get(), m_tile.get() );
-                     break;
-                  }
-                  case OSSIM_SCALAR_UNKNOWN:
-                  default:
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << "ossimShiftFilter::getTile ERROR Unhandled scalar!" << endl;
-                        break;
-                  }
-            
-               } // Matches: switch(inputTile->getScalarType())
-
-               m_tile->validate();
-            }
-            else
-            {
-               m_tile->makeBlank();
-            }
-
-            result = m_tile;
-            
-         } // Matches: if ( tile_status != OSSIM_NULL )
-            
-      } // Matches: if ( inputTile.get() ... )
-
-      if ( !result && inputTile.get() )
-      {
-         result = inputTile;
-      }
-           
-   } // Matches: if ( theInputConnection ) 
-   
-   return result;
-}
-
-template <class T> void ossimShiftFilter::fillTile(T /* dummy */,
-                                                   const ossimImageData* inputTile,
-                                                   ossimImageData* outputTile) const
-{
-   const double BANDS = inputTile->getNumberOfBands();
-   const ossim_uint32 SPB = inputTile->getSizePerBand();
-   std::vector<double> inNull(BANDS);
-   std::vector<double> inMin(BANDS);
-   std::vector<double> inMax(BANDS);
-   std::vector<double> coef(BANDS);
-   ossim_uint32 band = 0;
-
-   for( ; band < BANDS; ++band )
-   {
-      inNull[band] = inputTile->getNullPix(band);
-      inMin[band]  = inputTile->getMinPix(band);
-      inMax[band]  = inputTile->getMaxPix(band);
-      coef[band]   = (m_max-m_min)/(inMax[band]-inMin[band]);
-   }
-   
-   double pix = 0;
-   for( band = 0; band < BANDS; ++band )
-   {
-      const T* inBuf = static_cast<const T*>(inputTile->getBuf(band));
-      T* outBuf = static_cast<T*>(outputTile->getBuf(band));
-      
-      for ( ossim_uint32 i = 0; i < SPB; ++i )
-      {
-         pix = inBuf[i];
-         if (  pix == inNull[band] )
-         {
-            pix = m_null;
-         }
-         else
-         {
-            // Shift and multiply:
-            pix = m_min + (pix - inMin[band]) * coef[band];
-            
-            // Range check:
-            pix = pix <= m_max ? (pix >= m_min ? pix : m_min) : m_max;
-         }
-         
-         outBuf[i] = static_cast<T>(pix);
-      }
-   }
-
-   outputTile->validate();
-}
-
-ossimString ossimShiftFilter::getClassName() const
-{
-   return ossimString("ossimShiftFilter");
-}
-
-ossimString ossimShiftFilter::getLongName()const
-{
-   return ossimString("OSSIM shift filter");
-}
-
-ossimString ossimShiftFilter::getShortName()const
-{
-   return ossimString("shift filter");
-}
-
-double ossimShiftFilter::getNullPixelValue(ossim_uint32 band )const
-{
-   double result = 0;;
-   if ( theEnableFlag && !ossim::isnan(m_null) )
-   {
-      result = m_null;
-   }
-   else
-   {
-      result = ossimImageSourceFilter::getNullPixelValue( band );
-   }
-   return result;
-}
-
-double ossimShiftFilter::getMinPixelValue(ossim_uint32 band )const
-{
-   double result = 0;;
-   if ( theEnableFlag && !ossim::isnan(m_min) )
-   {
-      result = m_min;
-   }
-   else
-   {
-      result = ossimImageSourceFilter::getMinPixelValue( band );
-   }
-   return result;
-}
-
-double ossimShiftFilter::getMaxPixelValue(ossim_uint32 band )const
-{
-   double result = 0;;
-   if ( theEnableFlag && !ossim::isnan(m_max) )
-   {
-      result = m_max;
-   }
-   else
-   {
-      result = ossimImageSourceFilter::getMaxPixelValue( band );
-   }
-   return result;
-}
-
-void ossimShiftFilter::setNullPixelValue(double null)
-{
-   m_null = null;
-}
-
-void ossimShiftFilter::setMinPixelValue(double min)
-{
-   m_min = min;
-}
-
-void ossimShiftFilter::setMaxPixelValue(double max)
-{
-   m_max = max;
-}
-
-void ossimShiftFilter::allocate()
-{
-   m_tile = ossimImageDataFactory::instance()->create(this,this);
-   m_tile->initialize();
-}
-
-// Private to disallow use...
-ossimShiftFilter::ossimShiftFilter(const ossimShiftFilter&)
-{
-}
-
-// Private to disallow use...
-ossimShiftFilter& ossimShiftFilter::operator=(const ossimShiftFilter&)
-{
-   return *this;
-}
-
-
-
diff --git a/ossim/src/ossim/imaging/ossimSingleImageChain.cpp b/ossim/src/ossim/imaging/ossimSingleImageChain.cpp
deleted file mode 100644
index 6c58695..0000000
--- a/ossim/src/ossim/imaging/ossimSingleImageChain.cpp
+++ /dev/null
@@ -1,953 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Utility class definition for a single image chain.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/imaging/ossimSingleImageChain.h>
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGeoPolygon.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/support_data/ossimSrcRecord.h>
-
-ossimSingleImageChain::ossimSingleImageChain()
-   :
-   ossimImageChain(),
-   m_handler(0),
-   m_bandSelector(0),
-   m_histogramRemapper(0),
-   m_brightnessContrast(0),
-   m_sharpen(0),
-   m_scalarRemapper(0),
-   m_resamplerCache(0),
-   m_resampler(0),
-   m_chainCache(0),
-   m_addHistogramFlag(false),
-   m_addResamplerCacheFlag(false),
-   m_addChainCacheFlag(false),
-   m_remapToEightBitFlag(false),
-   m_threeBandFlag(false),
-   m_threeBandReverseFlag(false),
-   m_brightnessContrastFlag(false),
-   m_sharpenFlag(false),
-   m_geoPolyCutterFlag(false)
-{
-}
-
-ossimSingleImageChain::ossimSingleImageChain(bool addHistogramFlag,
-                                             bool addResamplerCacheFlag,
-                                             bool addChainCacheFlag,
-                                             bool remapToEightBitFlag,
-                                             bool threeBandFlag,
-                                             bool threeBandReverseFlag,
-                                             bool brightnessContrastFlag,
-                                             bool sharpenFlag,
-                                             bool geoPolyCutterFlag)
-   :
-   ossimImageChain(),
-   m_handler(0),
-   m_bandSelector(0),
-   m_histogramRemapper(0),
-   m_brightnessContrast(0),
-   m_sharpen(0),
-   m_scalarRemapper(0),
-   m_resamplerCache(0),
-   m_resampler(0),
-   m_chainCache(0),
-   m_addHistogramFlag(addHistogramFlag),
-   m_addResamplerCacheFlag(addResamplerCacheFlag),
-   m_addChainCacheFlag(addChainCacheFlag),
-   m_remapToEightBitFlag(remapToEightBitFlag),
-   m_threeBandFlag(threeBandFlag),
-   m_threeBandReverseFlag(threeBandReverseFlag),
-   m_brightnessContrastFlag(brightnessContrastFlag),
-   m_sharpenFlag(sharpenFlag),
-   m_geoPolyCutterFlag(geoPolyCutterFlag)
-{
-}
-
-ossimSingleImageChain::~ossimSingleImageChain()
-{
-   m_handler            = 0;
-   m_bandSelector       = 0;
-   m_histogramRemapper  = 0;
-   m_brightnessContrast = 0;
-   m_sharpen            = 0;
-   m_scalarRemapper     = 0;
-   m_resamplerCache     = 0;
-   m_resampler          = 0;
-   m_chainCache         = 0;
-   m_geoPolyCutter      = 0;
-
-}
-
-void ossimSingleImageChain::reset()
-{
-   bool result = true;
-   do
-   {
-      result = deleteLast();
-   } while (result);
-
-   m_handler                = 0;
-   m_bandSelector           = 0;
-   m_histogramRemapper      = 0;
-   m_brightnessContrast     = 0;
-   m_sharpen                = 0;
-   m_scalarRemapper         = 0;
-   m_resamplerCache         = 0;
-   m_resampler              = 0;
-   m_geoPolyCutter          = 0;
-   m_chainCache             = 0;
-
-   m_addHistogramFlag       = false;
-   m_addResamplerCacheFlag  = false;
-   m_addChainCacheFlag      = false;
-   m_remapToEightBitFlag    = false;
-   m_threeBandFlag          = false;
-   m_threeBandReverseFlag   = false;
-   m_brightnessContrastFlag = false;
-   m_sharpenFlag            = false;
-   m_geoPolyCutterFlag      = false;
-}
-
-void ossimSingleImageChain::close()
-{
-   if ( m_handler.valid() )
-   {
-      if ( removeChild(m_handler.get()) )
-      {
-         m_handler = 0;
-      }
-   }
-}
-
-ossimFilename ossimSingleImageChain::getFilename() const
-{
-   ossimFilename result;
-   if ( m_handler.valid() )
-   {
-      result = m_handler->getFilename();
-   }
-   return result;
-}
-
-bool ossimSingleImageChain::open(const ossimFilename& file, bool openOverview)
-{
-   return addImageHandler(file, openOverview);
-}
-
-bool ossimSingleImageChain::isOpen() const
-{
-   return m_handler.valid();
-}
-
-bool ossimSingleImageChain::open(const ossimSrcRecord& src)
-{
-   return addImageHandler(src);
-}
-
-void ossimSingleImageChain::createRenderedChain()
-{
-   // Band selector after image handler only if needed.
-   if ( m_handler.valid() )
-   {
-      // Only add if multiple bands.
-      if ( m_handler->getNumberOfOutputBands() != 1 )
-      {
-         addBandSelector();
-         if ( m_threeBandReverseFlag )
-         {
-            setToThreeBandsReverse();
-         }
-      }
-   }
-   else // No image handler so just add it.
-   {
-      addBandSelector();
-   }
-   
-   // histogram:
-   if ( m_addHistogramFlag )
-   {
-      addHistogramRemapper();
-   }
-
-   // brightness contrast:
-   if ( m_brightnessContrastFlag )
-   {
-      addBrightnessContrast();
-   }
-
-   // sharpen filter:
-   if ( m_sharpenFlag )
-   {
-      addSharpen();
-   }
-
-   // scalar remapper
-   if ( m_remapToEightBitFlag )
-   {
-      if ( m_handler.valid() )
-      {
-         // See if it's eight bit.
-         if (m_handler->getOutputScalarType() != OSSIM_UINT8)
-         {
-            addScalarRemapper();
-         }
-      }
-      else
-      {
-         // Just add...
-         addScalarRemapper(); 
-      }
-   }
-
-   // resampler cache
-   if ( m_addResamplerCacheFlag )
-   {
-      m_resamplerCache = addCache();
-   }
-   
-   // resampler
-   addResampler();
-
-   //---
-   // Do this here so that if a band selector is added to the end of the
-   // chain it will go in before the end of chain cache.
-   //---
-   if (m_threeBandFlag)
-   {
-      if (!m_bandSelector)
-      {
-         addBandSelector();
-      }
-      setToThreeBands();
-   }
-
-   //---
-   // Ditto...
-   //---
-   if ( m_threeBandReverseFlag && !m_bandSelector )
-   {
-      addBandSelector();
-      setToThreeBandsReverse();
-   }
-
-   // Put the geo cutter just before the cache.
-   if(m_geoPolyCutterFlag)
-   {
-      addGeoPolyCutter();
-   }
-
-   // End of chain cache.
-   if ( m_addChainCacheFlag )
-   {
-      m_chainCache = addCache();
-   }
-
-   initialize();
-
-}
-
-void ossimSingleImageChain::createRenderedChain(const ossimSrcRecord& src)
-{
-   // Band selector after image handler only if needed.
-   if ( m_handler.valid() )
-   {
-      // Only add if needed.
-      if ( ( m_handler->getNumberOfOutputBands() != 1 ) || src.getBands().size() )
-      {
-         addBandSelector(src);
-         if ( m_threeBandReverseFlag )
-         {
-            setToThreeBandsReverse();
-         }
-      }
-   }
-   else // No image handler so just add it.
-   {
-      addBandSelector(src);
-   }
-   
-   // histogram
-   if ( m_addHistogramFlag || src.getHistogramOp().size() )
-   {
-      addHistogramRemapper(src);
-   }
-
-   // brightness contrast:
-   if ( m_brightnessContrastFlag )
-   {
-      addBrightnessContrast();
-   }
-
-   // sharpen filter:
-   if ( m_sharpenFlag )
-   {
-      addSharpen();
-   }
-
-   // scalar remapper
-   if ( m_remapToEightBitFlag )
-   {
-      if ( m_handler.valid() )
-      {
-         // See if it's eight bit.
-         if (m_handler->getOutputScalarType() != OSSIM_UINT8)
-         {
-            addScalarRemapper();
-         }
-      }
-      else
-      {
-         // Just add...
-         addScalarRemapper(); 
-      }
-   }
-
-   // resampler cache
-   if ( m_addResamplerCacheFlag )
-   {
-      m_resamplerCache = addCache();
-   }
-   
-   // resampler
-   addResampler();
-
-   //---
-   // Do this here so that if a band selector is added to the end of the
-   // chain it will go in before the end of chain cache.
-   //---
-   if (m_threeBandFlag)
-   {
-      if (!m_bandSelector) // Input must be one band.
-      {
-         addBandSelector(src);
-      }
-      setToThreeBands();
-   }
-
-   //---
-   // Ditto...
-   //---
-   if ( m_threeBandReverseFlag && !m_bandSelector )
-   {
-      addBandSelector();
-      setToThreeBandsReverse();
-   }
-
-   // End of chain cache.
-   if ( m_addChainCacheFlag )
-   {
-      m_chainCache = addCache();
-   }
-
-   initialize();
-
-}
-
-bool ossimSingleImageChain::addImageHandler(const ossimFilename& file, bool openOverview)
-{
-   bool result = false;
-
-   close();
-   
-   m_handler = ossimImageHandlerRegistry::instance()->open(file, true, openOverview);
-   
-   if ( m_handler.valid() )
-   {
-      // Add to the chain.  Note: last is really first.
-      addLast( m_handler.get() );
-      
-      result = true;
-   }
-
-   return result;
-}
-
-bool ossimSingleImageChain::addImageHandler(const ossimSrcRecord& src)
-{
-   bool result = addImageHandler( src.getFilename() );
-   if (result)
-   {
-      //---
-      // When loading from ossimSrcRecord typically the overview/histograms are
-      // not in the same directory and the "support" keyword is not set.  For
-      // the ossimImageHandler::getFilenameWithThisExtension to work correctly
-      // the ossimImageHandler::theSupplementaryDirectory must be set.
-      // So if the ossimSrcRecord::getSupportDir() is empty and the overview
-      // or histogram is not co-located with the image we will set it here.
-      //---
-      ossimFilename supportDir = src.getSupportDir();
-      if ( supportDir.empty() )
-      {
-         if ( src.getOverviewPath().size() )
-         {
-            if ( src.getOverviewPath().isDir() )
-            {
-               supportDir = src.getOverviewPath();
-            }
-            else
-            {
-               supportDir = src.getOverviewPath().path();
-            }
-         }
-         else if ( src.getHistogramPath().size() )
-         {
-            if ( src.getHistogramPath().isDir() )
-            {
-               supportDir = src.getHistogramPath();
-            }
-            else
-            {
-               supportDir = src.getHistogramPath().path();
-            }
-         }
-         else if ( src.getMaskPath().size() )
-         {
-            if ( src.getMaskPath().isDir() )
-            {
-               supportDir = src.getMaskPath();
-            }
-            else
-            {
-               supportDir = src.getMaskPath().path();
-            }
-         }
-      }
-      if ( supportDir.size() && (src.getFilename().path() != supportDir) )
-      {
-         m_handler->setSupplementaryDirectory( supportDir );
-      }
-      if ( src.getEntryIndex() > 0 ) // defaulted to -1.
-      {
-         m_handler->setCurrentEntry( static_cast<ossim_uint32>( src.getEntryIndex() ) );
-      }
-      if ( m_handler->getOverview() == 0 )
-      {
-         if ( src.getOverviewPath().size() )
-         {
-            m_handler->openOverview( src.getOverviewPath() );
-         }
-         else
-         {
-            ossimFilename ovrFile = m_handler->getFilenameWithThisExtension(ossimString(".ovr"));
-            m_handler->openOverview( ovrFile ); 
-         }
-      }
-   }
-   return result;
-}
-
-void ossimSingleImageChain::addBandSelector()
-{
-   if (!m_bandSelector)
-   {
-      m_bandSelector = new ossimBandSelector();
-
-      // Add to the end of the chain.
-      addFirst(m_bandSelector.get());
-   }
-}
-
-void ossimSingleImageChain::addBandSelector(const ossimSrcRecord& src)
-{
-   if (!m_bandSelector)
-   {
-      m_bandSelector = new ossimBandSelector();
-      
-      // Add to the end of the chain.
-      addFirst(m_bandSelector.get());
-   }
-   if ( src.getBands().size() )
-   {
-      m_bandSelector->setOutputBandList( src.getBands() );
-   }
-}
-
-void ossimSingleImageChain::addHistogramRemapper()
-{
-   if (!m_histogramRemapper)
-   {
-      m_histogramRemapper = new ossimHistogramRemapper();
-      
-      m_histogramRemapper->setEnableFlag(false);
-
-      // Add to the end of the chain.
-      addFirst(m_histogramRemapper.get());
-   } 
-}
-
-void ossimSingleImageChain::addHistogramRemapper(const ossimSrcRecord& src)
-{
-   static const char MODULE[] =
-      "ossimSingleImageChain::addHistogramRemapper(const ossimSrcRecord&)";
-   
-   if (!m_histogramRemapper)
-   {
-      m_histogramRemapper = new ossimHistogramRemapper();
-      
-      m_histogramRemapper->setEnableFlag(false);
-
-      // Add to the end of the chain.
-      addFirst(m_histogramRemapper.get());
-   }
-
-   if ( src.getHistogramOp().size() && m_handler.valid() )
-   {
-      // Create histogram code here???
-      
-      // Open the histogram if needed.
-      if ( m_histogramRemapper->getHistogramFile() == ossimFilename::NIL )
-      {
-         ossimFilename f;
-         if ( src.getSupportDir().size() )
-         {
-            f = src.getSupportDir();
-            f.dirCat( m_handler->getFilename().fileNoExtension() );
-            f.setExtension(".his");
-         }
-         else
-         {
-            f = m_handler->getFilenameWithThisExtension( ossimString("his") );
-         }
-         if ( m_histogramRemapper->openHistogram( f ) == false )
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << "\nCould not open:  " << f << "\n";
-         }
-      }
-
-      // Set the histogram strech mode.
-      if ( src.getHistogramOp().size() )
-      {
-         // Enable.
-         m_histogramRemapper->setEnableFlag(true);
-         
-         // Set the histo mode:
-         ossimString op = src.getHistogramOp();
-         op.downcase();
-         if ( op == "auto-minmax" )
-         {
-            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX );
-         }
-         else if ( (op == "std-stretch-1") || (op == "std-stretch 1") )
-         {
-            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN );
-         } 
-         else if ( (op == "std-stretch-2") || (op == "std-stretch 2") )
-         {
-            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN );
-         } 
-         else if ( (op == "std-stretch-3") || (op == "std-stretch 3") )
-         {
-            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN );
-         }
-         else
-         {
-            m_histogramRemapper->setEnableFlag(false);
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << "\nUnhandled operation: " << op << "\n";
-         }
-      }
-      
-   } // End: if ( src.setHistogramOp().size() && m_handler.valid() )
-}
-
-ossimRefPtr<ossimCacheTileSource> ossimSingleImageChain::addCache()
-{
-   ossimRefPtr<ossimCacheTileSource> cache = new ossimCacheTileSource();
-
-   // Add to the end of the chain.
-   addFirst(cache.get());
-
-   return cache;
-}
-
-void ossimSingleImageChain::addResampler()
-{
-   if ( !m_resampler )
-   {
-      m_resampler = new ossimImageRenderer();
-
-      // Add to the end of the chain.
-      addFirst(m_resampler.get());
-   }
-}
-
-void ossimSingleImageChain::addScalarRemapper()
-{
-   if ( !m_scalarRemapper )
-   {
-      m_scalarRemapper = new ossimScalarRemapper();
-
-      if ( m_resamplerCache.valid() )
-      {
-         // Add to the left of the resampler cache.
-         insertLeft(m_scalarRemapper.get(), m_resamplerCache.get());
-      }
-      else
-      {
-         // Add to the end of the chain.
-         addFirst(m_scalarRemapper.get());
-      }
-   }
-}
-
-void ossimSingleImageChain::addBrightnessContrast()
-{
-   if ( !m_brightnessContrast )
-   {
-      m_brightnessContrast = new ossimBrightnessContrastSource();
-
-      // Add to the end of the chain.
-      addFirst( m_brightnessContrast.get() );
-   }
-}
-
-void ossimSingleImageChain::addSharpen()
-{
-   if ( !m_sharpen )
-   {
-      m_sharpen = new ossimImageSharpenFilter();
-
-      // Add to the end of the chain.
-      addFirst( m_sharpen.get() );
-   }
-}
-
-void ossimSingleImageChain::addGeoPolyCutter()
-{
-   if(!m_geoPolyCutter.valid())
-   {
-      m_geoPolyCutter = new ossimGeoPolyCutter();
-
-      //---
-      // ossimGeoPolyCutter requires a view geometry to transform the points.
-      // So set prior to adding to end of chain if valid.  If not, user is
-      // responsible for setting.
-      //---
-      ossimRefPtr<ossimImageGeometry> geom = getImageGeometry();
-      if ( geom.valid() )
-      {
-         m_geoPolyCutter->setView( geom.get() );
-      }
-      
-      addFirst( m_geoPolyCutter.get() );
-   }
-}
-
-void ossimSingleImageChain::addGeoPolyCutterPolygon(const vector<ossimGpt>& polygon)
-{
-   if(!m_geoPolyCutter.valid())
-   {
-      addGeoPolyCutter();
-   }
-   
-   // sanity check to verify that the add did not fail
-   if(m_geoPolyCutter.valid())
-   {
-      m_geoPolyCutter->addPolygon(polygon);   
-   }
-}
-
-void ossimSingleImageChain::addGeoPolyCutterPolygon(const ossimGeoPolygon& polygon)
-{
-   if(!m_geoPolyCutter.valid())
-   {
-      addGeoPolyCutter();
-   }
-   
-   // sanity check to verify that the add did not fail
-   if(m_geoPolyCutter.valid())
-   {
-      m_geoPolyCutter->addPolygon(polygon);
-   }
-}
-
-ossimRefPtr<const ossimImageHandler> ossimSingleImageChain::getImageHandler() const
-{
-   return ossimRefPtr<const ossimImageHandler>( m_handler.get() );
-}
-
-ossimRefPtr<ossimImageHandler> ossimSingleImageChain::getImageHandler()
-{
-   return m_handler;
-}
-
-ossimRefPtr<const ossimBandSelector> ossimSingleImageChain::getBandSelector() const
-{
-   return ossimRefPtr<const ossimBandSelector>( m_bandSelector.get() );
-}
-
-ossimRefPtr<ossimBandSelector> ossimSingleImageChain::getBandSelector()
-{
-   return m_bandSelector;
-}
-
-ossimRefPtr<const ossimHistogramRemapper> ossimSingleImageChain::getHistogramRemapper() const
-{
-   return ossimRefPtr<const ossimHistogramRemapper>( m_histogramRemapper.get() );
-}
-
-ossimRefPtr<ossimHistogramRemapper> ossimSingleImageChain::getHistogramRemapper()
-{
-   return m_histogramRemapper;
-}
-
-ossimRefPtr<const ossimCacheTileSource> ossimSingleImageChain::getResamplerCache() const
-{
-   return ossimRefPtr<const ossimCacheTileSource>( m_resamplerCache.get() );
-}
-
-ossimRefPtr<ossimCacheTileSource> ossimSingleImageChain::getResamplerCache()
-{
-   return m_resamplerCache;
-}
-
-ossimRefPtr<const ossimImageRenderer> ossimSingleImageChain::getImageRenderer() const
-{
-   return ossimRefPtr<const ossimImageRenderer>( m_resampler.get() );
-}
-
-ossimRefPtr<ossimImageRenderer> ossimSingleImageChain::getImageRenderer()
-{
-   return m_resampler;
-}
-
-ossimRefPtr<const ossimScalarRemapper> ossimSingleImageChain::getScalarRemapper() const
-{
-   return ossimRefPtr<const ossimScalarRemapper>( m_scalarRemapper.get() );
-}
-
-ossimRefPtr<ossimScalarRemapper> ossimSingleImageChain::getScalarRemapper()
-{
-   return m_scalarRemapper;
-}
-
-ossimRefPtr<const ossimBrightnessContrastSource>
-ossimSingleImageChain::getBrightnessContrast() const
-{
-   return ossimRefPtr<const ossimBrightnessContrastSource>( m_brightnessContrast.get() );
-}
-
-ossimRefPtr<ossimBrightnessContrastSource> ossimSingleImageChain::getBrightnessContrast()
-{
-   return m_brightnessContrast;
-}
-
-ossimRefPtr<const ossimImageSharpenFilter>
-ossimSingleImageChain::getSharpenFilter() const
-{
-   return ossimRefPtr<const ossimImageSharpenFilter>( m_sharpen.get() );
-}
-
-ossimRefPtr<ossimImageSharpenFilter> ossimSingleImageChain::getSharpenFilter()
-{
-   return m_sharpen;
-}
-
-ossimRefPtr<const ossimCacheTileSource> ossimSingleImageChain::getChainCache() const
-{
-   return ossimRefPtr<const ossimCacheTileSource>( m_chainCache.get() );
-}
-
-ossimRefPtr<ossimCacheTileSource> ossimSingleImageChain::getChainCache()
-{
-   return m_chainCache;
-}
-
-void ossimSingleImageChain::setAddHistogramFlag(bool flag)
-{
-   m_addHistogramFlag = flag;
-}
-
-bool ossimSingleImageChain::getAddHistogramFlag() const
-{
-   return m_addHistogramFlag;
-}
-
-void ossimSingleImageChain::setAddResamplerCacheFlag(bool flag)
-{
-   m_addResamplerCacheFlag = flag;
-}
-
-bool ossimSingleImageChain::getAddResamplerCacheFlag() const
-{
-   return m_addResamplerCacheFlag;
-}
-
-void ossimSingleImageChain::setAddChainCacheFlag(bool flag)
-{
-   m_addChainCacheFlag = flag;
-}
-
-bool ossimSingleImageChain::getAddChainCacheFlag() const
-{
-   return m_addChainCacheFlag;
-}
-
-void ossimSingleImageChain::setRemapToEightBitFlag(bool flag)
-{
-   m_remapToEightBitFlag = flag;
-}
-
-bool ossimSingleImageChain::getRemapToEightBitFlag() const
-{
-   return m_remapToEightBitFlag;
-}
-
-void ossimSingleImageChain::setThreeBandFlag(bool flag)
-{
-   m_threeBandFlag = flag;
-}
-
-bool ossimSingleImageChain::getThreeBandFlag() const
-{
-   return m_threeBandFlag;
-}
-   
-void ossimSingleImageChain::setThreeBandReverseFlag(bool flag)
-{
-   m_threeBandReverseFlag = flag;
-}
-
-bool ossimSingleImageChain::getThreeBandReverseFlag() const
-{
-   return m_threeBandReverseFlag;
-}
-
-void ossimSingleImageChain::setBrightnessContrastFlag(bool flag)
-{
-   m_brightnessContrastFlag = flag;
-}
-
-bool ossimSingleImageChain::getBrightnessContrastFlag() const
-{
-   return m_brightnessContrastFlag;
-}
-
-void ossimSingleImageChain::setSharpenFlag(bool flag)
-{
-   m_sharpenFlag = flag;
-}
-
-bool ossimSingleImageChain::getSharpenFlag() const
-{
-   return m_sharpenFlag;
-}
-
-void ossimSingleImageChain::setToThreeBands()
-{
-   if ( m_handler.valid() )
-   {
-      // Only do if not three bands already so the band list order is not wiped out.
-      if ( !m_bandSelector.valid() ||
-           ( m_bandSelector.valid() &&
-             ( m_bandSelector->getNumberOfOutputBands() != 3 ) ) )
-      {
-         std::vector<ossim_uint32> bandList(3);
-
-         if ( m_handler->getRgbBandList( bandList ) == false )
-         {
-            const ossim_uint32 BANDS = m_handler->getNumberOfInputBands();
-            if(BANDS >= 3)
-            {
-               bandList[0] = 0;
-               bandList[1] = 1;
-               bandList[2] = 2;
-            }
-            else
-            {
-               bandList[0] = 0;
-               bandList[1] = 0;
-               bandList[2] = 0;
-            }
-         }
-         setBandSelection(bandList);
-      }
-   }
-}
-
-void ossimSingleImageChain::setToThreeBandsReverse()
-{
-   if ( m_handler.valid() )
-   {
-      std::vector<ossim_uint32> bandList(3);
-      const ossim_uint32 BANDS = m_handler->getNumberOfInputBands();
-      if(BANDS >= 3)
-      {
-         bandList[0] = 2;
-         bandList[1] = 1;
-         bandList[2] = 0;
-      }
-      else
-      {
-         bandList[0] = 0;
-         bandList[1] = 0;
-         bandList[2] = 0;
-      }
-      setBandSelection(bandList);
-   }
-}
-
-void ossimSingleImageChain::setBandSelection(
-   const std::vector<ossim_uint32>& bandList)
-{
-   if (!m_bandSelector)
-   {
-      addBandSelector();
-   }
-   m_bandSelector->setEnableFlag(true);
-   m_bandSelector->setOutputBandList(bandList);
-   if ( m_histogramRemapper.valid() )
-   {
-      m_histogramRemapper->initialize();
-   }
-}
-ossimScalarType ossimSingleImageChain::getImageHandlerScalarType() const
-{
-   ossimScalarType result = OSSIM_SCALAR_UNKNOWN;
-   if ( m_handler.valid() )
-   {
-      result = m_handler->getOutputScalarType();
-   }
-   return result;
-}
-
-bool ossimSingleImageChain::openHistogram( ossimHistogramRemapper::StretchMode mode )
-{
-   bool result = false;
-   ossimRefPtr<ossimImageHandler> ih = getImageHandler();
-   if ( ih.valid() )
-   {
-      ossimRefPtr<ossimHistogramRemapper> hr = getHistogramRemapper();
-      if ( hr.valid() )
-      {
-         ossimFilename f = ih->getFilenameWithThisExtension( ossimString("his") );
-         if ( hr->openHistogram( f ) == true )
-         {
-            // Enable:
-            hr->setEnableFlag(true);
-
-            // Set the mode:
-            hr->setStretchMode( mode );
-
-            result = true;
-         }
-      }
-   }
-   return result;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimSubImageTileSource.cpp b/ossim/src/ossim/imaging/ossimSubImageTileSource.cpp
deleted file mode 100644
index 811e109..0000000
--- a/ossim/src/ossim/imaging/ossimSubImageTileSource.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-//*****************************************************************************
-// FILE: ossimSubImageTileSource.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class ossimSubImageTileSource.
-//   This tile source permits specifying an offset that is to be applied to the
-//   tile origin for all getTile() requests. It is intended for converting
-//   a full-image space coordinate to a sub-image coordinate.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimSubImageTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimSubImageTileSource.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimImageData.h>
-
-RTTI_DEF1(ossimSubImageTileSource,
-          "ossimSubImageTileSource",
-          ossimImageSourceFilter);
-
-static const char* SUBIMAGE_OFFSET_X = "offset_x";
-static const char* SUBIMAGE_OFFSET_Y = "offset_y";
-
-ossimSubImageTileSource::ossimSubImageTileSource()
-   : ossimImageSourceFilter(),
-     theSubImageOffset(0, 0),
-     theTile(0)
-{
-}
-
-ossimSubImageTileSource::ossimSubImageTileSource(ossimImageSource* inputSource)
-   : ossimImageSourceFilter(inputSource), theSubImageOffset(0, 0),
-     theTile(0)
-{
-}
-
-ossimSubImageTileSource::ossimSubImageTileSource(ossimImageSource* inputSource,
-                                                 const ossimIpt&   offset)
-   : ossimImageSourceFilter(inputSource), theSubImageOffset(offset),
-     theTile(0)
-{
-}
-
-ossimSubImageTileSource::~ossimSubImageTileSource()
-{
-}
-
-//*****************************************************************************
-//  METHOD: ossimSubImageTileSource::getTile()
-//  
-//*****************************************************************************
-ossimRefPtr<ossimImageData> ossimSubImageTileSource::getTile(
-   const ossimIrect& rect,
-   ossim_uint32  res_level)
-{
-   ossimIpt offset = theSubImageOffset;
-
-   if(res_level)
-   {
-      //***
-      // Determine the offset for the particular rr level requested:
-      //***
-      ossimDpt decimation_factor;
-      theInputConnection->getDecimationFactor(res_level, decimation_factor);
-      
-      if(!decimation_factor.hasNans())
-      {
-         offset = ossimIpt((int)(theSubImageOffset.x*decimation_factor.x + 0.5),
-                           (int)(theSubImageOffset.y*decimation_factor.y + 0.5));
-      }
-      else
-      {
-         offset = theSubImageOffset;
-      }
-   }
-   //
-   // Apply the offset to the requested rect and fetch tile. The tile's origin
-   // needs to be adjusted to reflect the requested origin:
-   //
-   ossimIrect rect_prime (rect - offset);
-
-   ossimRefPtr<ossimImageData> tile =
-      ossimImageSourceFilter::getTile(rect_prime, res_level);
-   
-   if(theTile.valid())
-   {
-      theTile->setImageRectangle(rect_prime);
-
-      if(tile.valid())
-      {
-         theTile->loadTile(tile.get());
-      }
-      else
-      {
-         theTile->makeBlank();
-      }
-   }
-   else
-   {
-      if(tile.valid())
-      {
-         theTile = (ossimImageData*)tile->dup();
-      }
-   }
-   if(theTile.valid())
-   {
-      theTile->setOrigin(rect.ul());
-      theTile->validate();
-   }
-   
-   return theTile;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSubImageTileSource::getBoundingRect()
-//  
-//*****************************************************************************
-ossimIrect ossimSubImageTileSource::getBoundingRect(ossim_uint32 resLevel) const
-{
-   ossimDrect result;
-
-   result.makeNan();
-   if(!theInputConnection)
-      return result;
-   ossimDpt offset = theSubImageOffset;
-   
-   ossimDrect rect (theInputConnection->getBoundingRect(resLevel));
-   if(resLevel)
-   {
-      ossimDpt decimation_factor;
-      theInputConnection->getDecimationFactor(resLevel, decimation_factor);
-
-      if(!decimation_factor.hasNans())
-      {
-         rect*=decimation_factor;
-         offset= ossimDpt(theSubImageOffset.x*decimation_factor.x,
-                          theSubImageOffset.y*decimation_factor.y);
-      }
-   }
-   ossimDrect rect_prime (rect + offset);
-   
-   return rect_prime;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSubImageTileSource::getValidImageVertices()
-//  
-//*****************************************************************************
-void ossimSubImageTileSource::getValidImageVertices(vector<ossimIpt>& vertices,
-                                                    ossimVertexOrdering ordering,
-                                                    ossim_uint32 /* resLevel */) const
-{
-   if(!theInputConnection)
-   {
-      vertices.clear();
-      return;
-   }
-
-   ossimDpt offset (theSubImageOffset);
-
-   theInputConnection->getValidImageVertices(vertices, ordering);
-   vector<ossimIpt>::iterator vertex = vertices.begin();
-
-   while (vertex != vertices.end())
-   {
-      (*vertex) += offset;
-      vertex++;
-   }
-   
-   return;
-}
-
-void ossimSubImageTileSource::initialize()
-{
-   ossimImageSourceFilter::initialize();
-
-   theTile = NULL;
-}
-
-bool ossimSubImageTileSource::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   const char* offset_x = kwl.find(prefix, SUBIMAGE_OFFSET_X);
-   const char* offset_y = kwl.find(prefix, SUBIMAGE_OFFSET_Y);
-
-   if(offset_x)
-   {
-      theSubImageOffset.x = ossimString(offset_x).toLong();
-      
-   }
-   if(offset_y)
-   {
-      theSubImageOffset.y = ossimString(offset_y).toLong();      
-   }
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-bool ossimSubImageTileSource::saveState(ossimKeywordlist& kwl,
-                                        const char* prefix)const
-{
-   bool result = ossimImageSourceFilter::saveState(kwl, prefix);
-   
-   kwl.add(prefix,
-           SUBIMAGE_OFFSET_X,
-           theSubImageOffset.x,
-           true);
-
-   kwl.add(prefix,
-           SUBIMAGE_OFFSET_Y,
-           theSubImageOffset.y,
-           true);
-   
-   return result;        
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTableRemapper.cpp b/ossim/src/ossim/imaging/ossimTableRemapper.cpp
deleted file mode 100644
index f1fd409..0000000
--- a/ossim/src/ossim/imaging/ossimTableRemapper.cpp
+++ /dev/null
@@ -1,577 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Table remapper class definition.
-//
-// Takes input tile, remaps it through a table, then output tile in the desired
-// scalar type.
-//
-// Two modes one that works on native remap tables, that being of the same
-// scalar type (like ossim_uint8) of the input connection, and another that
-// uses a normalized remap table (more scalar independent).
-//
-//*************************************************************************
-// $Id: ossimTableRemapper.cpp 22745 2014-04-22 16:57:22Z dburken $
-
-#include <ossim/imaging/ossimTableRemapper.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimTableRemapper, "ossimTableRemapper", ossimImageSourceFilter)
-
-static ossimTrace traceDebug("ossimTableRemapper:debug");
-
-static const char* TABLE_TYPE[] = { "UNKNOWN", "NATIVE", "NORMALIZED" };
-
-ossimTableRemapper::ossimTableRemapper()
-   :
-      ossimImageSourceFilter(),  // base class
-      theTile(0),
-      theTmpTile(0),
-      theNormBuf(0),
-      theTableBinCount(0),
-      theTableBandCount(0),
-      theTableType(ossimTableRemapper::UKNOWN),
-      theInputScalarType(OSSIM_SCALAR_UNKNOWN),
-      theOutputScalarType(OSSIM_SCALAR_UNKNOWN)
-{
-   //***
-   // Set the base class "theEnableFlag" to off since no adjustments have been
-   // made yet.
-   //***
-   //disableSource();
-}
-
-ossimTableRemapper::~ossimTableRemapper()
-{
-   destroy();
-}
-
-void ossimTableRemapper::destroy()
-{
-   if (theNormBuf)
-   {
-      delete [] theNormBuf;
-      theNormBuf = 0;
-   }
-   theTmpTile = 0;
-   theTile    = 0;
-}
-
-void ossimTableRemapper::initialize()
-{
-   //---
-   // Call the base class initialize.
-   // Note:  This will reset "theInputConnection" if it changed...
-   //---
-   ossimImageSourceFilter::initialize();
-   destroy();
-   if (theInputConnection)
-   {
-      theInputScalarType = theInputConnection->getOutputScalarType();
-      
-      // Since we override "getOutputScalarType" make sure something's set.
-      if (theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
-      {
-         theOutputScalarType = theInputConnection->getOutputScalarType();
-      }
-
-      if (theTile.valid())
-      {
-         //if ( theTile->getNumberOfBands() !=
-         //     theInputConnection->getNumberOfOutputBands() )
-        // {
-            // Wipe everything slick. The next getTile will call allocate.
-        //    destroy();
-        // }
-      }
-   }
-
-   // Nothing else to do for this...
-}
-
-void ossimTableRemapper::allocate(const ossimIrect& rect)
-{
-   //---
-   // It's either first getTile or we've had either a resize, so allocate
-   // needed stuff...
-   //---
-   destroy();
-
-   if (theInputConnection)
-   {
-      ossim_uint32 width  = rect.width();
-      ossim_uint32 height = rect.height();
-    
-      theTile =  ossimImageDataFactory::instance()->create(this,this);
-      theTile->setImageRectangle(rect); 
-     // theTile =
-     //    ossimImageDataFactory::instance()->create(this,
-     //                                              getOutputScalarType(),
-     //                                              getNumberOfOutputBands(),
-     //                                              width,x
-     //                                              height);
-      theTile->initialize();
-
-
-      if (theInputScalarType !=  getOutputScalarType() &&
-          theTableType == ossimTableRemapper::NATIVE)
-      {
-         //---
-         // We need a temp tile so we can do two remaps
-         // inputTile->remapTable->tmpTile then
-         // tmpTile->normalize->theTile(unnormalize to new scalar)...
-         //---
-         theTmpTile 
-         = ossimImageDataFactory::instance()->create(this,
-                                                     theInputScalarType,
-                                                     getNumberOfOutputBands(),
-                                                     width,
-                                                     height);
-         theTmpTile->setMinPix(theTile->getMinPix(), theTile->getNumberOfBands());
-         theTmpTile->initialize();
-
-      }
-
-      if (theTableType == ossimTableRemapper::NORMALIZED ||
-          theInputScalarType != theOutputScalarType)
-      {
-         theNormBuf = new ossim_float64[theTile->getSize()];
-      }
-   }
-}
-
-ossimRefPtr<ossimImageData> ossimTableRemapper::getTile(
-   const ossimIrect& tile_rect, ossim_uint32 resLevel)
-{
-   ossimRefPtr<ossimImageData> result = 0;
-   
-   if(theInputConnection)
-   {
-      // Fetch tile from pointer from the input source.
-      result = theInputConnection->getTile(tile_rect, resLevel);
-      if (theEnableFlag&&result.valid())
-      {  
-         // Get its status of the input tile.
-         ossimDataObjectStatus tile_status = result->getDataObjectStatus();
-         
-         // Check for remap bypass:
-         if ( (tile_status != OSSIM_NULL) &&
-              (tile_status != OSSIM_EMPTY) && theTable.size() )
-         {
-
-            // OK we have an input tile... and it's not null or empty.
-            if(!theTile)
-            {
-               allocate(tile_rect);
-            }
-            if (theTile.valid())
-            {
-               theTile->setImageRectangle(tile_rect);
-               if(theTmpTile.valid()) // not mandatory for all modes.
-               {
-                  theTmpTile->setImageRectangle(tile_rect);
-               }   
-               // Think things are good.  Do the real work...
-               if (theTableType == ossimTableRemapper::NATIVE)
-               {
-                  // Most efficient case...
-                  remapFromNativeTable(result);
-               }
-               else
-               {
-                  remapFromNormalizedTable(result);
-               }
-              
-               theTile->validate();
-               result = theTile;
-            }
-         }
-      }
-   }
-   return result;
-}
-
-void ossimTableRemapper::remapFromNativeTable(
-   ossimRefPtr<ossimImageData>& inputTile)
-{
-   switch (theOutputScalarType)
-   {
-      case OSSIM_UINT8:
-      {
-         remapFromNativeTable(ossim_uint8(0), inputTile);
-         break;
-      }
-      
-      case OSSIM_USHORT11:
-      case OSSIM_USHORT16:
-      {
-         remapFromNativeTable(ossim_uint16(0), inputTile);
-         break;
-      }
-      
-      case OSSIM_SSHORT16:
-      {
-         remapFromNativeTable(ossim_sint16(0), inputTile);
-         break;
-      }
-      
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT:
-      {
-         remapFromNativeTable(ossim_float32(0), inputTile);
-         break;
-      }
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_DOUBLE:
-      {
-         remapFromNativeTable(ossim_float64(0), inputTile);
-         break;
-      }
-      
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-         // Shouldn't hit this.
-            ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimTableRemapper::remapFromNativeTable"
-            << "\nOutput scalar type is OSSIM_SCALAR_UNKNOWN!\n";
-         }
-         break;
-      }
-
-   } // End of "switch (theTableType)"
-}
-
-template <class T> void ossimTableRemapper::remapFromNativeTable(
-   T /* dummy */,
-   ossimRefPtr<ossimImageData>& inputTile)
-{
-   
-   const ossim_uint32 BANDS = theTile->getNumberOfBands();
-   const ossim_uint32 PPB   = theTile->getSizePerBand(); // pixels per band
-   //---
-   // NOTE:
-   // If (theTableBandCount == one) that means we only have one band; or,
-   // the user wanted to remap all bands using the same table...
-   //---
-   const ossim_uint32 BAND_OFFSET =
-      (theTableBandCount != 1) ? theTableBinCount: 0;
-
-
-
-   const T* rt = reinterpret_cast<T*>(&theTable.front()); // remap table (rt)
-   ossimRefPtr<ossimImageData> id;
-   if (theInputScalarType == theOutputScalarType)
-   {
-      id = theTile;
-   }
-   else
-   {
-      id = theTmpTile;
-   }
-   if(theTable.size() >= (BANDS*BAND_OFFSET))
-   {
-      for (ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         const T NULL_PIX = static_cast<T>(id->getNullPix(band));
-         //const T MIN_PIX  = static_cast<T>(id->getMinPix(band));
-
-         const T* s = static_cast<T*>(inputTile->getBuf(band)); // source (s)
-         T*       d = static_cast<T*>(id->getBuf(band));   // destination (d)
-
-         if(s&&d)
-         {
-            for (ossim_uint32 pixel = 0; pixel < PPB; ++pixel)
-            {
-               //---
-               // Get the source pixel and use it as an index to the table.
-               // Note Null is always the "0" index, min always the "1".
-               //---
-               T p = s[pixel];
-               if (p == NULL_PIX)  // Null is not always zero (dted).
-               {
-                  d[pixel] = NULL_PIX;
-                 // p = 0;
-               }
-               else
-               {
-      //         else
-      //         {
-      //            p = (p+1-MIN_PIX);  // If min == 1 we want that to map to index 1.
-      //         }
-
-                  ossim_uint32 table_index = static_cast<ossim_uint32>(p);
-                  
-                  //---
-                  // If within range use to index the remap table; else, null.
-                  // Note:
-                  // There is no min, max range checking on value retrieved from table.
-                  // Range checking should be performed when the table is built.
-                  //---
-                  if(table_index < theTableBinCount)
-                  {
-                     d[pixel] = rt[table_index];
-                  }
-      //            else if(table_index < 0)
-      //            {
-      //               if(theTableBinCount > 1)
-      //               {
-      //                  d[pixel] = rt[1];
-      //               }
-      //               else
-      //               {
-      //                  d[pixel] = table_index;
-       //              }
-       //           }
-                  else
-                  {
-                     if(theTableBinCount>0)
-                     {
-                        d[pixel] = rt[theTableBinCount-1];
-                     }
-                     else
-                     {
-                        d[pixel] = p;
-                    }
-                  }
-               }
-            }
-
-         }
-
-         rt += BAND_OFFSET; // Go to next band in the table.
-      }
-
-   }
-
-   if (theInputScalarType != theOutputScalarType)
-   {
-      // Normalize and copy the temp tile to a buffer.
-      id->copyTileToNormalizedBuffer(theNormBuf);
-
-      // Un-normalize and copy the buffer to the destination tile.
-      theTile->copyNormalizedBufferToTile(theNormBuf);
-   }
-}
-
-void ossimTableRemapper::remapFromNormalizedTable(
-   ossimRefPtr<ossimImageData>& inputTile)
-{
-   if (!theNormBuf) // First time...
-   {
-      theNormBuf = new ossim_float64[theTile->getSize()];
-   }
-   
-   // Normalize and copy the source tile to a buffer.
-   inputTile->copyTileToNormalizedBuffer(theNormBuf);
-
-   const ossim_uint32 BANDS = theTile->getNumberOfBands();
-   const ossim_uint32 PPB   = theTile->getSizePerBand(); // pixels per band
-
-   //---
-   // NOTE:
-   // If (theTableBandCount == one) that means we only have one band; or,
-   // the user wanted to remap all bands using the same table...
-   //---
-   const ossim_uint32 BAND_OFFSET = (theTableBandCount == 1) ? 0 : PPB;
-
-   // remap table (rt)
-   ossim_float64* rt = reinterpret_cast<ossim_float64*>(&theTable.front()); 
-
-   ossim_float64* buf = theNormBuf;
-   ossim_float64 p = 0.0;
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      for (ossim_uint32 pixel = 0; pixel < PPB; ++pixel)
-      {
-         // Get the source pixel...
-         ossim_uint32 idx
-            = static_cast<ossim_uint32>(buf[pixel]*theTableBinCount+0.5);
-
-         if((idx < theTableBinCount))
-         {
-            // If within range use to index the remap table; else, null.
-            p = (idx < theTableBinCount) ? rt[idx] : 0.0;
-         }
-//         else if(idx < 0)
-//         {
-//            p = 0.0;
-//         }
-         else 
-         {
-            p = 1.0;
-         }
-         // Range check (in case table bad) and assign to destination pixel.
-         buf[pixel] = (p >= 0.0) ? ( (p <=1.0) ? p : 1) : 0.0;
-      }
-
-      // Go to next band.
-      rt += BAND_OFFSET;
-      buf += PPB;
-   }
-   
-   // Un-normalize and copy the buffer to the destination tile.
-   theTile->copyNormalizedBufferToTile(theNormBuf);
-}
-
-ossimScalarType ossimTableRemapper::getOutputScalarType() const
-{
-   if (theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
-   {
-      return theOutputScalarType;
-   }
-
-   return ossimImageSourceFilter::getOutputScalarType();
-}
-
-bool ossimTableRemapper::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   // Look for scalar type keyword.
-   ossim_int32 st = ossimScalarTypeLut::instance()->
-      getEntryNumber(kwl, prefix, true);
-
-   // Lookup table returns -1 if not found so check return...
-   if ( (st != -1) && (st != OSSIM_SCALAR_UNKNOWN) )
-   {
-      theOutputScalarType = static_cast<ossimScalarType>(st);
-   }
-
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-bool ossimTableRemapper::saveState(ossimKeywordlist& kwl,
-                                   const char* prefix) const
-{
-   // Save the output scalar type.
-   kwl.add(prefix,
-           ossimKeywordNames::SCALAR_TYPE_KW,
-           ossimScalarTypeLut::instance()->
-           getEntryString(theOutputScalarType).c_str(),
-           true);
-   
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-ostream& ossimTableRemapper::print(ostream& os) const
-{
-   ossimScalarTypeLut* sl = ossimScalarTypeLut::instance();
-
-   os << "\nossimTableRemapper::print:"
-      << "\ntheTableBinCount:    " << theTableBinCount
-      << "\ntheTableBandCount:   " << theTableBandCount
-      << "\ntheTableType:        " << TABLE_TYPE[theTableType]
-      << "\ntheInputScalarType:  " << (*sl)[theInputScalarType]
-      << "\ntheOutputScalarType: " << (*sl)[theOutputScalarType]
-      << endl;
-   
-   if (theTile.valid())
-   {
-      os << "theTile:\n" << *theTile << endl;
-   }
-   if (theTmpTile.valid())
-   {
-      os << "theTmpTile:\n" << *theTmpTile << endl;
-   }
-
-   switch (theOutputScalarType)
-   {
-      case OSSIM_UCHAR:
-      {
-         dumpTable(ossim_uint8(0), os);
-         break;
-      }
-      
-      case OSSIM_USHORT11:
-      case OSSIM_USHORT16:
-      {
-         dumpTable(ossim_uint16(0), os);
-         break;
-      }
-      
-      case OSSIM_SSHORT16:
-      {
-         dumpTable(ossim_sint16(0), os);
-         break;
-      }
-      
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_FLOAT:
-      {
-         dumpTable(ossim_float32(0), os);
-         break;
-      }
-      
-      case OSSIM_NORMALIZED_DOUBLE:
-      case OSSIM_DOUBLE:
-      {
-         dumpTable(ossim_float64(0), os);
-         break;
-      }
-      
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         if(traceDebug())
-         {
-         // Shouldn't hit this.
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimTableRemapper::print OSSIM_SCALAR_UNKNOWN!\n";
-         }
-         break;
-      }
-
-   } // End of "switch (theTableType)"
-
-   return os;
-}
-
-template <class T> void ossimTableRemapper::dumpTable(T /*dummy*/,
-                                                      ostream& os) const
-{
-   if (theTable.empty() || !theTableBinCount || !theTableBandCount)
-   {
-      return;
-   }
-
-   const T* table = reinterpret_cast<const T*>(&theTable.front());
-
-   ossim_uint32 table_index = 0;
-   for (ossim_uint32 band = 0; band < theTableBandCount; ++band)
-   {
-      for (ossim_uint32 index = 0; index < theTableBinCount; ++index)
-      {
-         os << "tabel[" << band << "][" << index << "]:  "
-            << static_cast<int>(table[table_index]) << endl;
-         ++table_index;
-      }
-   }
-}
-
-
-ostream& operator<<(ostream& os, const ossimTableRemapper& tr)
-{
-   return tr.print(os);
-}
-
-// Private to disallow use...
-ossimTableRemapper::ossimTableRemapper(const ossimTableRemapper&)
-{
-}
-
-// Private to disallow use...
-ossimTableRemapper& ossimTableRemapper::operator=(const ossimTableRemapper&)
-{
-   return *this;
-}
diff --git a/ossim/src/ossim/imaging/ossimTiffOverviewBuilder.cpp b/ossim/src/ossim/imaging/ossimTiffOverviewBuilder.cpp
deleted file mode 100644
index 31ec7b7..0000000
--- a/ossim/src/ossim/imaging/ossimTiffOverviewBuilder.cpp
+++ /dev/null
@@ -1,1439 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for TiffOverviewBuilder
-// 
-//*******************************************************************
-//  $Id: ossimTiffOverviewBuilder.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimTiffOverviewBuilder.h>
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/parallel/ossimMpiMasterOverviewSequencer.h>
-#include <ossim/parallel/ossimMpiSlaveOverviewSequencer.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimBitMaskTileSource.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/support_data/ossimGeoTiff.h>
-
-#include <xtiffio.h>
-#include <algorithm> /* for std::fill */
-#include <sstream>
-using namespace std;
-
-RTTI_DEF1(ossimTiffOverviewBuilder,
-          "ossimTiffOverviewBuilder",
-          ossimOverviewBuilderBase)
-
-static ossimTrace traceDebug("ossimTiffOverviewBuilder:degug");
-
-// Property keywords.
-static const char COPY_ALL_KW[]           = "copy_all_flag";
-static const char INTERNAL_OVERVIEWS_KW[] = "internal_overviews_flag";
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimTiffOverviewBuilder.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimTiffOverviewBuilder::ossimTiffOverviewBuilder()
-   :
-      ossimOverviewBuilderBase(),
-      m_nullDataBuffer(0),
-      m_bytesPerPixel(1),
-      m_bitsPerSample(8),
-      m_tileWidth(0),
-      m_tileHeight(0),
-      m_tileSizeInBytes(0),
-      m_sampleFormat(0),
-      m_currentTiffDir(0),
-      m_tiffCompressType(COMPRESSION_NONE),
-      m_jpegCompressQuality(DEFAULT_COMPRESS_QUALITY),
-      m_resampleType(ossimFilterResampler::ossimFilterResampler_BOX),
-      m_nullPixelValues(),
-      m_copyAllFlag(false),
-      m_outputTileSizeSetFlag(false),
-      m_internalOverviewsFlag(false)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffOverviewBuilder::ossimTiffOverviewBuilder DEBUG:\n";
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  "
-         << OSSIM_ID
-         << "\n";
-#endif
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "overview stop dimension: " << m_overviewStopDimension
-         << std::endl;
-   }
-}
-
-ossimTiffOverviewBuilder::~ossimTiffOverviewBuilder()
-{
-}
-
-void ossimTiffOverviewBuilder::setResampleType(
-   ossimFilterResampler::ossimFilterResamplerType resampleType)
-{
-   m_resampleType = resampleType;
-}
-
-bool ossimTiffOverviewBuilder::buildOverview(const ossimFilename& overview_file, bool copy_all)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffOverviewBuilder::buildOverview DEBUG:"
-         << "\noverview file: " << overview_file.c_str()
-         << "\ncopy_all flag: " << (copy_all?"true":"false")
-         << std::endl;
-   }
-
-
-   m_outputFile  = overview_file;
-   m_copyAllFlag = copy_all;
-
-   return execute();
-}
-
-
-bool ossimTiffOverviewBuilder::execute()
-{
-   static const char MODULE[] = "ossimTiffOverviewBuilder::execute";
-   
-   if (theErrorStatus == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nError status has been previously set!  Returning..."
-         << std::endl;
-      return false;
-   }
-
-   if ( !m_imageHandler || m_imageHandler->hasError() )
-   {
-      setErrorStatus();
-      return false;
-   }
-
-   m_outputFile = getOutputFile();
-   if (m_outputFile == ossimFilename::NIL)
-   {
-      return false;
-   }
-
-   // Check the file.  Disallow same file overview building.
-   if ( !buildInternalOverviews() && (m_imageHandler->getFilename() == m_outputFile) )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "Source image file and overview file cannot be the same!"
-         << std::endl;
-      return false;
-   }
-
-   ossimFilename outputFileTemp = m_outputFile;
-   
-   if ( !buildInternalOverviews() )
-   {
-      // Add .tmp in case process gets aborted to avoid leaving bad .ovr file.
-      outputFileTemp += ".tmp";
-   }
-
-   // Required number of levels needed including r0.
-   ossim_uint32 requiedResLevels = getRequiredResLevels(m_imageHandler.get());
-
-   // Zero based starting resLevel.
-   ossim_uint32 startingResLevel  = 0;
-   if ( !copyR0() )
-   {
-      startingResLevel = m_imageHandler->getNumberOfDecimationLevels();
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE
-         << "\nCurrent number of reduced res sets: "
-         << m_imageHandler->getNumberOfDecimationLevels()
-         << "\nNumber of required reduced res sets:  " << requiedResLevels
-         << "\nStarting reduced res set:    " << startingResLevel
-         << "\nResampling type:  " << getOverviewType().c_str()
-         << std::endl;
-   }
-
-   if ( startingResLevel >= requiedResLevels )
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << MODULE << " NOTICE:"
-         << "\nImage has required reduced resolution data sets.\nReturning..."
-         << std::endl;
-      return true;
-   }
-
-   //---
-   // If image handler is band selector, start with all bands.
-   // Some sources, e.g. ossimEnviTileSource can pick up default
-   // bands and filter out all other bands.
-   //---
-   m_imageHandler->setOutputToInputBandList();  
-   
-   //---
-   // If alpha bit mask generation was requested, then need to instantiate the mask writer object.
-   // This is simply a "transparent" tile source placed after to the right of the image handler
-   // that scans the pixels being pulled and accumulates alpha bit mask for writing at the end.
-   //---
-   if (m_bitMaskSpec.getSize() > 0)
-   {
-      m_maskWriter = new ossimBitMaskWriter();
-      m_maskWriter->loadState(m_bitMaskSpec);
-      m_maskWriter->setStartingResLevel(1);
-      ossimRefPtr<ossimBitMaskTileSource> bmts = new ossimBitMaskTileSource;
-      bmts->setAssociatedMaskWriter(m_maskWriter.get());
-      m_maskFilter = new ossimMaskFilter();
-      m_maskFilter->connectMyInputTo(m_imageHandler.get());
-      m_maskFilter->setMaskSource((ossimImageSource*)bmts.get());
-   }
-
-   ossimStdOutProgress* progressListener = 0; // Only used on master.
-   TIFF* tif = 0;                             // Only used on master.
-
-   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
-   setPercentComplete(0.0);
-
-   if (ossimMpi::instance()->getRank() == 0 )
-   {
-      //---
-      // See if the file can be opened for writing.
-      // Note:  If this file existed previously it will be overwritten.
-      //---
-      tif = openTiff(outputFileTemp);
-      if (!tif)
-      {
-         // Set the error...
-         setErrorStatus();
-         ossimNotify(ossimNotifyLevel_WARN)
-            << __FILE__ << " " << __LINE__ << " " << MODULE
-            << "\nCannot open file: " << outputFileTemp << std::endl;
-         return false;
-      } 
-
-      //---
-      // Check for a listeners.  If the list is empty, add a standard out
-      // listener so that command line apps like img2rr will get some progress.
-      //---
-      ossimStdOutProgress* progressListener = 0;
-      if (theListenerList.empty())
-      {
-         progressListener = new ossimStdOutProgress(0, true);
-         addListener(progressListener);
-      }
-
-      if (startingResLevel == 0)
-      {       
-         if (!writeR0(tif))
-         {
-            // Set the error...
-            setErrorStatus();
-            ossimNotify(ossimNotifyLevel_WARN)
-               << __FILE__ << " " << __LINE__
-               << "\nError copying image!" << std::endl;
-
-            closeTiff(tif);
-            if (progressListener)
-            {
-               removeListener(progressListener);
-               delete progressListener;
-               progressListener = 0;
-            }
-            
-            if ( outputFileTemp.exists() && !buildInternalOverviews() )
-            {
-               ossimFilename::remove( outputFileTemp );
-            }
-            return false;
-         }
-
-         ++startingResLevel; // Go to r1.
-      }
-
-      if (needsAborting())
-      {
-         closeTiff(tif);
-         if (progressListener)
-         {
-            removeListener(progressListener);
-            delete progressListener;
-            progressListener = 0;
-         }
-         return false;
-      }
-      
-      TIFFFlush(tif);
-      
-   } // End of master only write of r0.
-        
-   for (ossim_uint32 i = startingResLevel; i < requiedResLevels; ++i)
-   {
-      if (ossimMpi::instance()->getRank() == 0 )
-      {
-         TIFFFlush(tif);
-      }
-
-      // Sync all processes...
-      ossimMpi::instance()->barrier();
-      
-      ossimRefPtr<ossimImageHandler> ih = 0;
-
-      //---
-      // If we copied r0 to the overview file use it instead of the
-      // original image handler as it is probably faster.
-      //---
-      if ( !copyR0() && (i <= m_imageHandler->getNumberOfDecimationLevels()) ) 
-      {
-         ih = m_imageHandler;
-      }
-      else
-      {
-         // We know we're a tiff so don't use the factory.
-         ih = new ossimTiffTileSource;
-         if ( ih->open(outputFileTemp) == false )
-         {
-            ih = 0;
-            
-            // Set the error...
-            setErrorStatus();
-            ossimNotify(ossimNotifyLevel_WARN)
-               << __FILE__ << " " << __LINE__ << " " << MODULE
-               << "\nCannot open file: " << outputFileTemp << std::endl;
-            
-            return false;
-         }
-
-         //---
-         // Since the overview file is being opened here, need to set its handler's starting res
-         // level where the original image file left off. This is usually R1 since the original
-         // file only has R0, but the original file may have more than R0:
-         //---
-         if ( !copyR0() &&  !buildInternalOverviews() )
-         {
-            ih->setStartingResLevel( m_imageHandler->getNumberOfDecimationLevels());
-         }
-      }
-      
-      // If mask is to be generated, need to notify both the writer and the reader of new 
-      // input source:
-      if (m_bitMaskSpec.getSize() > 0)
-      {
-         m_maskFilter->connectMyInputTo(0, ih.get());
-         m_maskWriter->connectMyInputTo(ih.get());
-      }
-
-      if ( !writeRn( ih.get(), tif, i, (i==startingResLevel) && !copyR0() ) )
-      {
-         // Set the error...
-         setErrorStatus();
-         ossimNotify(ossimNotifyLevel_WARN)
-            << __FILE__ << " " << __LINE__ << " " << MODULE
-            << "\nError creating reduced res set: " << i << std::endl;
-
-         ih->disconnect();
-         ih = 0;
-         if (tif)
-         {
-            closeTiff(tif);
-            tif = 0;
-         }
-
-         if (progressListener)
-         {
-            removeListener(progressListener);
-            delete progressListener;
-            progressListener = 0;
-         }
-
-         if ( outputFileTemp.exists() && !buildInternalOverviews() )
-         {
-            ossimFilename::remove( outputFileTemp );
-         }
-
-         return false;
-      }
-      
-      if (needsAborting())
-      {
-         ih->disconnect();
-         ih = 0;
-         if (tif)
-         {
-            closeTiff(tif);
-            tif = 0;
-         }
-         if (progressListener)
-         {
-            removeListener(progressListener);
-            delete progressListener;
-            progressListener = 0;
-         }
-         return false;
-      }
-      
-      if (m_bitMaskSpec.getSize() > 0)
-      {
-         m_maskFilter->disconnectMyInput(0);
-         m_maskWriter->disconnectAllInputs();
-      }
-      ih = 0;
-   }
-
-   if (ossimMpi::instance()->getRank() == 0 )
-   {
-      if (tif)
-      {
-         closeTiff(tif);
-         tif = 0;
-      }
-
-      // Write out the alpha bit mask if one was enabled:
-      if (m_maskWriter.valid())
-      {
-         ossimNotify(ossimNotifyLevel_INFO) << "Writing alpha bit mask file..." << std::endl;
-         m_maskWriter->close();
-      }
-
-      // Remove the listener if we had one.
-      if (progressListener)
-      {
-         removeListener(progressListener);
-         delete progressListener;
-         progressListener = 0;
-      }
-
-      if ( !buildInternalOverviews() )
-      {
-         outputFileTemp.rename(m_outputFile);
-      }
-      
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_INFO)
-            << "Wrote file:  " << m_outputFile.c_str() << std::endl;
-      }
-     
-      setCurrentMessage(ossimString("Finished..."));
-   }
-   
-   finalize();  // Reset band list if a band selector.
-
-   return true;
-}
-
-bool ossimTiffOverviewBuilder::writeR0(TIFF* tif)
-{
-   static const char MODULE[] = "ossimTiffOverviewBuilder::writeR0";
-
-   ossimIrect rect = m_imageHandler->getImageRectangle();
-
-   if (!setTags(tif, rect, 0))
-   {
-      closeTiff(tif);
-      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " Error writing tags!" << std::endl;
-      return false;
-   }
-   
-   // Set the geotiff tags.
-   if ( setGeotiffTags(m_imageHandler->getImageGeometry().get(),
-                       m_imageHandler->getBoundingRect(),
-                       0,
-                       tif) == false )
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << MODULE << " NOTICE: geotiff tags not set." << std::endl;
-      } 
-   }
-   
-   ossim_int32 samples         = m_imageHandler->getNumberOfSamples();
-   ossim_int32 lines           = m_imageHandler->getNumberOfLines();
-   ossim_int32 tilesWide       = samples % m_tileWidth ?
-                           samples / m_tileWidth + 1 : samples / m_tileWidth;
-   ossim_int32 tilesHigh       = lines % m_tileHeight ?
-                           lines / m_tileHeight + 1 : lines / m_tileHeight;
-   ossim_int32 numberOfTiles   = tilesWide * tilesHigh;
-
-   int tileNumber = 0;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffOverviewBuilder::writeR0 DEBUG:"
-         << "\nsamples:        " << samples
-         << "\nlines:          " << lines
-         << "\ntilesWide:      " << tilesWide
-         << "\ntilesHigh:      " << tilesHigh
-         << "\nnumberOfTiles:  " << numberOfTiles
-         << std::endl;
-   }
-
-   setCurrentMessage(ossimString("Copying r0..."));
-   
-   //***
-   // Tile loop in the line direction.
-   //***
-   for(int i = 0; i < tilesHigh; ++i)
-   {
-      ossimIpt origin(0, 0);
-      origin.y = i * m_tileHeight;
-      
-      //***
-      // Tile loop in the sample (width) direction.
-      //***
-      for(int j = 0; j < tilesWide; ++j)
-      {
-         origin.x = j * m_tileWidth;
-
-         ossimRefPtr<ossimImageData> t =
-            m_imageHandler->getTile(ossimIrect(origin.x,
-                                                origin.y,
-                                                origin.x +(m_tileWidth-1),
-                                                origin.y +(m_tileHeight-1)));
-
-         // Check for errors reading tile:
-         if ( m_imageHandler->hasError() )
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR: reading tile:  " << i << std::endl;
-            return false;
-         }
-
-         // If masking was enabled, pass the tile onto that object for processing:
-         if (m_maskWriter.valid())
-            m_maskWriter->generateMask(t, 0);
-
-         //***
-         // Band loop.
-         //***
-         for (uint32 band=0;
-              band < m_imageHandler->getNumberOfOutputBands();
-              ++band)
-         {
-            tdata_t data;
-            
-            if ( t.valid() && (t->getDataObjectStatus() != OSSIM_NULL) )
-            {
-               // Grab a pointer to the tile for the band.
-               data = static_cast<tdata_t>(t->getBuf(band));
-            }
-            else
-            {
-               data = static_cast<tdata_t>(&(m_nullDataBuffer.front()));
-            }
-
-            // Write the tile.
-            int bytesWritten = 0;
-            bytesWritten = TIFFWriteTile(tif,
-                                         data,
-                                         origin.x,
-                                         origin.y,
-                                         0,        // z
-                                         band);    // sample
-
-            if (bytesWritten != m_tileSizeInBytes)
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " ERROR:"
-                  << "Error returned writing tiff tile:  " << i
-                  << "\nExpected bytes written:  " << m_tileSizeInBytes
-                  << "\nBytes written:  " << bytesWritten
-                  << std::endl;
-               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-               return false;
-            }
-
-         } // End of band loop.  
-        
-         ++tileNumber;
-
-      } // End of tile loop in the sample (width) direction.
-
-      if (needsAborting())
-      {
-         setPercentComplete(100.0);
-         break;
-      }
-      else
-      {
-         double tile = tileNumber;
-         double numTiles = numberOfTiles;
-         setPercentComplete(tile / numTiles * 100.0);
-      }
-
-   } // End of tile loop in the line (height) direction.
-
-   //***
-   // Write the current dirctory.
-   //***
-   if (!TIFFWriteDirectory(tif))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error writing directory!" << std::endl;
-      return false;
-   }
-
-   ++m_currentTiffDir;
-
-   return true;
-}
-
-bool ossimTiffOverviewBuilder::writeRn( ossimImageHandler* imageHandler,
-                                        TIFF* tif,
-                                        ossim_uint32 resLevel,
-                                        bool firstResLevel )
-{
-   if ( tif ) //  && buildInternalOverviews() )
-   {
-      // Create an empty directory to start with.
-      TIFFCreateDirectory( tif );
-   }
-   else
-   {
-      return false;
-   }
-   
-   //---
-   // Set up the sequencer.  This will be one of three depending on if we're
-   // running mpi and if we are a master process or a slave process.
-   //---
-   ossimRefPtr<ossimOverviewSequencer> sequencer;
-   
-   if(ossimMpi::instance()->getNumberOfProcessors() > 1)
-   {
-      if ( ossimMpi::instance()->getRank() == 0 )
-      {
-         sequencer = new ossimMpiMasterOverviewSequencer();
-      }
-      else
-      {
-         sequencer = new ossimMpiSlaveOverviewSequencer();
-      }
-   }
-   else
-   {
-      sequencer = new ossimOverviewSequencer();
-   }
-   
-   sequencer->setImageHandler(imageHandler);
-
-   if (m_maskWriter.valid() && m_maskFilter.valid())
-   {
-      sequencer->setBitMaskObjects(m_maskWriter.get(), m_maskFilter.get());
-   }
-
-   // sourceResLevel: This is the res level to pull data from:
-   ossim_uint32 sourceResLevel = imageHandler->getNumberOfDecimationLevels() +
-      imageHandler->getStartingResLevel() - 1;
-
-   sequencer->setSourceLevel(sourceResLevel);
-   sequencer->setResampleType(m_resampleType);
-   sequencer->setTileSize( ossimIpt(m_tileWidth, m_tileHeight) );
-   
-   if ( firstResLevel )
-   {
-      // Set up things that are only performed on first scan through tiles.
-      
-      if ( getHistogramMode() != OSSIM_HISTO_MODE_UNKNOWN )
-      {
-         // Accumulate a histogram.  Can't do with mpi/multi-process.
-         if(ossimMpi::instance()->getNumberOfProcessors() == 1)
-         {
-            sequencer->setHistogramMode(getHistogramMode());
-         }
-         //---
-         // else{} Not sure if we want an error thrown here.  For now will handle at the
-         // application level.
-         //---
-      }
-      if ( getScanForMinMaxNull() == true )
-      {
-         sequencer->setScanForMinMaxNull(true);
-      }
-      else if ( getScanForMinMax() == true )
-      {
-         sequencer->setScanForMinMax(true);
-      }
-   }
-
-   // Note sequence setup must be performed before intialize. 
-   sequencer->initialize();
-
-   // If we are a slave process start the resampling of tiles.
-   if (ossimMpi::instance()->getRank() != 0 )
-   {
-      sequencer->slaveProcessTiles();
-      return true;
-   }
-
-   //---
-   // The rest of the method on master node only.
-   //---
-   static const char MODULE[] = "ossimTiffOverviewBuilder::writeRn";
-
-   ostringstream os;
-   os << "creating r" << resLevel << "...";
-   setCurrentMessage(os.str());
-
-   if (resLevel == 0)
-   {
-      return false;
-   }
-
-   ossimIrect rect;
-   sequencer->getOutputImageRectangle(rect);
-
-   if (!setTags(tif, rect, resLevel))
-   {
-      setErrorStatus();
-      closeTiff(tif);
-      tif = 0;
-      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " Error writing tags!" << std::endl;
-      return false;
-   }
-
-   if ( !buildInternalOverviews() && !copyR0() && (resLevel == 1) )
-   {
-      //---
-      // Set the geotif tags for the first layer.
-      // Note this is done in writeR0 method if m_copyAllFlag is set.
-      //---
-      if ( setGeotiffTags(m_imageHandler->getImageGeometry().get(),
-                          ossimDrect(rect),
-                          resLevel,
-                          tif) == false )
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << MODULE << " NOTICE: geotiff tags not set." << std::endl;
-         } 
-      }
-   }
-
-   ossim_uint32 outputTilesWide = sequencer->getNumberOfTilesHorizontal();
-   ossim_uint32 outputTilesHigh = sequencer->getNumberOfTilesVertical();
-   ossim_uint32 numberOfTiles   = sequencer->getNumberOfTiles();
-   ossim_uint32 tileNumber      = 0;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffOverviewBuilder::writeRn DEBUG:"
-         << "\noutputTilesWide:  " << outputTilesWide
-         << "\noutputTilesHigh:  " << outputTilesHigh
-         << "\nnumberOfTiles:    " << numberOfTiles
-         << std::endl;
-   }
- 
-   // Tile loop in the line direction.
-   ossim_uint32 y = 0;
-
-   for(ossim_uint32 i = 0; i < outputTilesHigh; ++i)
-   {
-      // Tile loop in the sample (width) direction.
-      ossim_uint32 x = 0;
-      for(ossim_uint32 j = 0; j < outputTilesWide; ++j)
-      {
-         // Grab the resampled tile.
-         ossimRefPtr<ossimImageData> t = sequencer->getNextTile();
-
-         // Check for errors reading tile:
-         if ( sequencer->hasError() )
-         {
-            setErrorStatus();
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR: reading tile:  " << i << std::endl;
-            return false;
-         }
-         
-         if ( t.valid() && ( t->getDataObjectStatus() != OSSIM_NULL ) )
-         {
-            // Write it to the tiff.
-            for (ossim_uint32 band = 0; band < t->getNumberOfBands(); ++band)
-            {
-               // Write the tile.
-               int bytesWritten = 0;
-               bytesWritten = TIFFWriteTile(tif,
-                                            t->getBuf(band),
-                                            x,
-                                            y,
-                                            0,        // z
-                                            band);    // sample
-               
-               if (bytesWritten != m_tileSizeInBytes)
-               {
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << MODULE << " ERROR:"
-                     << "Error returned writing tiff tile:  " << i
-                     << "\nExpected bytes written:  " << m_tileSizeInBytes
-                     << "\nBytes written:  " << bytesWritten
-                     << std::endl;
-                  theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-                  
-                  return false;
-               }
-            }
-         }
-         x += m_tileWidth; // Increment x for next TIFFWriteTile.
-         ++tileNumber;      // Increment tile number for percent complete.
-
-      } // End of tile loop in the sample (width) direction.
-
-      if (needsAborting())
-      {
-         setPercentComplete(100.0);
-         break;
-      }
-      else
-      {
-         double tile = tileNumber;
-         double numTiles = numberOfTiles;
-         setPercentComplete(tile / numTiles * 100.0);
-      }
-
-      y += m_tileHeight; // Increment y for next TIFFWriteTile.
-
-   } // End of tile loop in the line (height) direction.
-
-   //---
-   // Write the current dirctory.
-   //---
-   if (!TIFFFlush(tif))
-   {
-      setErrorStatus();
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error writing to TIF file!" << std::endl;
-      return false;
-   }
-
-   if ( firstResLevel )
-   {
-      if ( ossimMpi::instance()->getNumberOfProcessors() == 1 )
-      {
-         if ( getHistogramMode() != OSSIM_HISTO_MODE_UNKNOWN )
-         {
-            // Write the histogram.
-            ossimFilename histoFilename = getOutputFile();
-            histoFilename.setExtension("his");
-            sequencer->writeHistogram(histoFilename);
-         }
-
-         if ( ( getScanForMinMaxNull() == true ) || ( getScanForMinMax() == true ) )
-         {
-            // Write the omd file:
-            ossimFilename file = getOutputFile();
-            file = file.setExtension("omd");
-            sequencer->writeOmdFile(file);
-         }
-      }
-   }
-
-   ++m_currentTiffDir;
-
-   return true;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimTiffOverviewBuilder::setTags(TIFF* tif,
-                                       const ossimIrect& outputRect,
-                                       ossim_int32 resLevel) const
-{
-   if (outputRect.hasNans())
-   {
-      return false;
-   }
-   
-   ossim_int32   imageWidth      = outputRect.width();
-   ossim_int32   imageHeight     = outputRect.height();
-   int16         samplesPerPixel = m_imageHandler->getNumberOfOutputBands();
-   ossim_float64 minSampleValue  = m_imageHandler->getMinPixelValue();
-   ossim_float64 maxSampleValue  = m_imageHandler->getMaxPixelValue();
-
-   if (resLevel)
-   {
-      TIFFSetField( tif, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE );
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffOverviewBuilder::setTags DEBUG:"
-         << "\nrrds_level:      " << resLevel
-         << "\nimageWidth:      " << imageWidth
-         << "\nimageHeight:     " << imageHeight
-         << "\nminSampleValue:  " << minSampleValue
-         << "\nmaxSampleValue:  " << maxSampleValue
-         << std::endl;
-   }
-   TIFFSetField( tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_SEPARATE );
-   TIFFSetField( tif, TIFFTAG_IMAGEWIDTH, imageWidth);
-   TIFFSetField( tif, TIFFTAG_IMAGELENGTH, imageHeight);
-   TIFFSetField( tif, TIFFTAG_BITSPERSAMPLE, m_bitsPerSample );
-   TIFFSetField( tif, TIFFTAG_SAMPLEFORMAT, m_sampleFormat );
-   TIFFSetField( tif, TIFFTAG_SAMPLESPERPIXEL, samplesPerPixel );
-
-   if( m_imageHandler->getNumberOfInputBands() == 3 )
-      TIFFSetField( tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB );
-   else
-      TIFFSetField( tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK );
-   
-   TIFFSetField( tif, TIFFTAG_TILEWIDTH,  m_tileWidth  );
-   TIFFSetField( tif, TIFFTAG_TILELENGTH, m_tileHeight );
-
-   //---
-   // Only turn on compression for 8 bit, one or three band data.  Not sure what compression
-   // types can handle what but this was crashing ossim-prepoc on a directory walk with jpeg
-   // compression.
-   //---
-   if ( ( m_imageHandler->getOutputScalarType() == OSSIM_UINT8 ) &&
-        ( ( m_imageHandler->getNumberOfInputBands() == 3 ) ||
-          ( m_imageHandler->getNumberOfInputBands() == 1 ) ) )
-   {
-      // Set the compression related tags...
-      TIFFSetField( tif, TIFFTAG_COMPRESSION, m_tiffCompressType );
-      if (m_tiffCompressType == COMPRESSION_JPEG)
-      {
-         TIFFSetField( tif, TIFFTAG_JPEGQUALITY,  m_jpegCompressQuality);
-      }
-   }
-   else
-   {
-      if ( traceDebug() && (m_tiffCompressType != COMPRESSION_NONE ) )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimTiffOverviewBuilder::setTags WARNING:\n"
-            << "Compression not set for this data type:\n"
-            << "scalar type: "
-            << ossimScalarTypeLut::instance()->getEntryString(
-               m_imageHandler->getOutputScalarType())
-            << "\nband count: " << m_imageHandler->getNumberOfInputBands()
-            << std::endl;
-      }
-      TIFFSetField( tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE );
-   }
-   
-   // Set the min/max values.
-   switch( m_imageHandler->getOutputScalarType() )
-   {
-      case OSSIM_SINT16:
-      case OSSIM_FLOAT32:
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-         TIFFSetField( tif, TIFFTAG_SMINSAMPLEVALUE, minSampleValue );
-         TIFFSetField( tif, TIFFTAG_SMAXSAMPLEVALUE, maxSampleValue );
-         break;
-
-      case OSSIM_UINT8:
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      case OSSIM_UINT32:
-      default:
-         TIFFSetField( tif, TIFFTAG_MINSAMPLEVALUE,
-                       static_cast<int>(minSampleValue) );
-         TIFFSetField( tif, TIFFTAG_MAXSAMPLEVALUE,
-                       static_cast<int>(maxSampleValue) );
-         break;
-   }
-   
-    return true;
-}
-
-bool ossimTiffOverviewBuilder::setGeotiffTags(const ossimImageGeometry* geom,
-                                              const ossimDrect& boundingRect,
-                                              ossim_uint32 resLevel,
-                                              TIFF* tif)
-{
-   bool result = false;
-
-   if ( geom && tif )
-   {
-      const ossimProjection* proj = geom->getProjection();
-      if (proj)
-      {
-         // Must duplicate if changing scale.
-         ossimObject* obj = proj->dup();
-         ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, obj);
-         if ( mapProj )
-         {
-            if ( mapProj->hasModelTransform() == false )
-            {
-               if (resLevel)
-               {
-                  ossim_float64 factor = (ossim_float64)(1 << resLevel);
-                  mapProj->applyScale(ossimDpt(factor, factor), true);
-               }
-               ossimRefPtr<ossimMapProjectionInfo> projInfo =
-                  new ossimMapProjectionInfo(mapProj, boundingRect);
-               result = ossimGeoTiff::writeTags(tif, projInfo);
-            }
-         }
-         delete obj; // Cleanup from dup.
-         obj = 0;
-      }
-   }
-   
-   return result;
-}
-
-TIFF* ossimTiffOverviewBuilder::openTiff(const ossimString& filename) const
-{
-   ossimString openMode;
-   if ( !buildInternalOverviews() )
-   {
-      openMode = "w";
-
-      ossim_uint64 fourGigs = (static_cast<ossim_uint64>(1024)*
-                               static_cast<ossim_uint64>(1024)*
-                               static_cast<ossim_uint64>(1024)*
-                               static_cast<ossim_uint64>(4));
-      ossimIrect bounds = m_imageHandler->getBoundingRect();
-      ossim_uint64 byteCheck =
-         (static_cast<ossim_uint64>(bounds.width())*
-          static_cast<ossim_uint64>(bounds.height())*
-          static_cast<ossim_uint64>(m_imageHandler->getNumberOfOutputBands())*
-          static_cast<ossim_uint64>(ossim::scalarSizeInBytes(m_imageHandler->
-                                                             getOutputScalarType())));
-         
-      if((byteCheck*static_cast<ossim_uint64>(2))>fourGigs)
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << " Big tiff activated\n";
-         }
-         openMode += "8";
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << " No big tiff activated\n";
-         }
-      }
-   }
-   else
-   {
-      openMode = "r+"; // Append to existing file...
-   }
-
-   // Open:
-   return XTIFFOpen( filename.c_str(), openMode.c_str() );
-}
-
-void ossimTiffOverviewBuilder::closeTiff(TIFF* tif)
-{
-   XTIFFClose( tif );
-}
-
-void ossimTiffOverviewBuilder::setCompressionType(ossim_uint16 compression_type)
-{
-   switch (compression_type)
-   {
-   case COMPRESSION_JPEG:
-   case COMPRESSION_LZW:
-   case COMPRESSION_DEFLATE:
-   case COMPRESSION_PACKBITS:
-      m_tiffCompressType = compression_type;
-      break;
-   default:
-      m_tiffCompressType = COMPRESSION_NONE;
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << __FILE__ << " " << __LINE__
-            << "\nossimTiffOverviewBuilder::setCompressionType Unsupported compression type: "
-            << compression_type << "\nDefaulting to none."
-            << std::endl;
-      }
-      break;
-   }
-}
-
-void ossimTiffOverviewBuilder::setJpegCompressionQuality(ossim_int32 quality)
-{
-   if (quality > 1 && quality < 101)
-   {
-      m_jpegCompressQuality = quality;
-   }
-   else
-   {
-      m_jpegCompressQuality = DEFAULT_COMPRESS_QUALITY;
-
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTiffOverviewBuilder::setJpegCompressionQuality\n"
-         << "\nCompression quality of " << quality << " is out of range!"
-         << "\nRange is 100 to 1.  Current quality set to default of 75."
-         << std::endl;
-   }
-}
-
-bool ossimTiffOverviewBuilder::getCopyAllFlag() const
-{
-   return m_copyAllFlag;
-}
-
-void ossimTiffOverviewBuilder::setCopyAllFlag(bool flag)
-{
-   m_copyAllFlag = flag;
-}
-
-void ossimTiffOverviewBuilder::setInternalOverviewsFlag( bool flag )
-{
-   m_internalOverviewsFlag = flag;
-}
-
-bool ossimTiffOverviewBuilder::getInternalOverviewsFlag() const
-{
-   return m_internalOverviewsFlag;
-}
-
-ossimObject* ossimTiffOverviewBuilder::getObject()
-{
-   return this;
-}
-
-const ossimObject* ossimTiffOverviewBuilder::getObject() const
-{
-   return this;
-}
-
-void ossimTiffOverviewBuilder::setOutputFile(const ossimFilename& file)
-{
-   m_outputFile = file;
-}
-
-ossimFilename ossimTiffOverviewBuilder::getOutputFile() const
-{
-   ossimFilename result;
-
-   if ( buildInternalOverviews() )
-   {
-      // m_imageHandler pointer good if buildInternalOverviews() returns true.
-      result = m_imageHandler->getFilename();
-   }
-   else
-   {
-      result = m_outputFile;
-   }
-
-   if (m_outputFile == ossimFilename::NIL)
-   {
-      if ( m_imageHandler.valid() )
-      {
-         bool usePrefix = (m_imageHandler->getNumberOfEntries()>1?true:false);
-         result = m_imageHandler->
-            getFilenameWithThisExtension(ossimString("ovr"), usePrefix);
-      }
-   }
-   
-   return result;
-}
-
-void ossimTiffOverviewBuilder::setOutputTileSize(const ossimIpt& tileSize)
-{
-   m_tileWidth  = tileSize.x;
-   m_tileHeight = tileSize.y;
-   m_outputTileSizeSetFlag = true;
-}
-
-bool ossimTiffOverviewBuilder::setInputSource(ossimImageHandler* imageSource)
-{
-   static const char MODULE[] = "ossimTiffOverviewBuilder::initializeFromHandler";
-
-   bool result = ossimOverviewBuilderBase::setInputSource( imageSource );
-   
-   if ( result )
-   {
-      if(!m_outputTileSizeSetFlag)
-      {
-         ossimIpt tileSize;
-         ossim::defaultTileSize(tileSize);
-         m_tileWidth  = tileSize.x;
-         m_tileHeight = tileSize.y;
-      }
-      
-      if (traceDebug())
-      {
-         CLOG << "DEBUG:"
-              << "\nm_tileWidth:   " << m_tileWidth
-              << "\nm_tileHeight:  " << m_tileHeight
-              << "\nSource image is tiled:  "
-              << (m_imageHandler->isImageTiled()?"true":"false")
-              << "\nm_imageHandler->getTileWidth():  "
-              << m_imageHandler->getTileWidth()
-              << "\nm_imageHandler->getTileHeight():  "
-              << m_imageHandler->getTileHeight()
-              << "\nm_imageHandler->getImageTileWidth():  "
-              << m_imageHandler->getImageTileWidth()
-              << "\nm_imageHandler->getImageTileHeight():  "
-              << m_imageHandler->getImageTileHeight()
-              << std::endl;
-      }
-
-      switch(m_imageHandler->getOutputScalarType())
-      {
-         case OSSIM_UINT8:
-            m_bitsPerSample = 8;
-            m_bytesPerPixel = 1;
-            m_sampleFormat  = SAMPLEFORMAT_UINT;
-            break;
-            
-         case OSSIM_USHORT11:
-         case OSSIM_UINT16:
-            m_bitsPerSample = 16;
-            m_bytesPerPixel = 2;
-            m_sampleFormat  = SAMPLEFORMAT_UINT;
-            break;
-            
-         case OSSIM_SINT16:
-            m_bitsPerSample = 16;
-            m_bytesPerPixel = 2;
-            m_sampleFormat  = SAMPLEFORMAT_INT;
-            break;
-            
-         case OSSIM_SINT32:
-            m_bitsPerSample = 32;
-            m_bytesPerPixel = 4;
-            m_sampleFormat  = SAMPLEFORMAT_INT;
-            break;
-            
-         case OSSIM_UINT32:
-            m_bitsPerSample = 32;
-            m_bytesPerPixel = 4;
-            m_sampleFormat  = SAMPLEFORMAT_UINT;
-            break;
-            
-         case OSSIM_FLOAT32:
-            m_bitsPerSample = 32;
-            m_bytesPerPixel = 4;
-            m_sampleFormat  = SAMPLEFORMAT_IEEEFP;
-            break;
-            
-         case OSSIM_NORMALIZED_DOUBLE:
-         case OSSIM_FLOAT64:
-            m_bitsPerSample = 64;
-            m_bytesPerPixel = 8;
-            m_sampleFormat  = SAMPLEFORMAT_IEEEFP;
-            break;
-            
-         default:
-            // Set the error...
-            setErrorStatus();
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "\nUnknow pixel type:  "
-               << (ossimScalarTypeLut::instance()->
-                   getEntryString(m_imageHandler->getOutputScalarType()))
-               << std::endl;
-            result = false;
-      }
-
-      if ( result )
-      {
-         m_tileSizeInBytes = m_tileWidth * m_tileHeight * m_bytesPerPixel;
-         
-         //---
-         // Make a buffer to pass to pass to the write tile methods when an image
-         // handler returns a null tile.
-         //---
-         m_nullDataBuffer.resize(m_tileSizeInBytes);
-      
-         // Fill it with zeroes.
-         std::fill(m_nullDataBuffer.begin(), m_nullDataBuffer.end(), 0);
-      }
-   }
-   else
-   {
-      // Set the error...
-      setErrorStatus();
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " ERROR:"
-         << "\nSetting image handler as input failed!"
-         << std::endl;
-   }
-
-   return result;
-
-} // End: ossimTiffOverviewBuilder::setInputSource(ossimImageHandler* imageSource)
-
-bool ossimTiffOverviewBuilder::setOverviewType(const ossimString& type)
-{
-   bool result = true;
-   if (type == "ossim_tiff_nearest")
-   {
-      m_resampleType =
-         ossimFilterResampler::ossimFilterResampler_NEAREST_NEIGHBOR;
-   }
-   else if (type == "ossim_tiff_box")
-   {
-      m_resampleType = ossimFilterResampler::ossimFilterResampler_BOX;
-   }
-   else
-   {
-      result = false;
-   }
-   return result;
-}
-
-ossimString ossimTiffOverviewBuilder::getOverviewType() const
-{
-   ossimString type;
-   if (m_resampleType == ossimFilterResampler::ossimFilterResampler_NEAREST_NEIGHBOR)
-   {
-      type = "ossim_tiff_nearest";
-   }
-   else
-   {
-      type = "ossim_tiff_box"; // This is default...
-   }
-   return type;
-}
-
-void ossimTiffOverviewBuilder::getTypeNameList(
-   std::vector<ossimString>& typeList)const
-{
-   typeList.push_back(ossimString("ossim_tiff_box"));
-   typeList.push_back(ossimString("ossim_tiff_nearest"));
-}
-
-void ossimTiffOverviewBuilder::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if ( property.valid() )
-   {
-      if(property->getName() == ossimKeywordNames::COMPRESSION_QUALITY_KW)
-      {
-         m_jpegCompressQuality = property->valueToString().toInt32();
-      }
-      else if(property->getName() == ossimKeywordNames::COMPRESSION_TYPE_KW)
-      {
-         ossimString value = property->valueToString();
-         value = value.downcase();
-         if(value == "jpeg")
-         {
-            m_tiffCompressType =  COMPRESSION_JPEG;
-         }
-         else if(value == "lzw")
-         {
-            m_tiffCompressType =  COMPRESSION_LZW;
-            
-         }
-         else if(value == "deflate")
-         {
-            m_tiffCompressType =  COMPRESSION_DEFLATE;
-         }
-         else if(value == "packbits")
-         {
-            m_tiffCompressType =  COMPRESSION_PACKBITS;
-         }
-         else
-         {
-            m_tiffCompressType = COMPRESSION_NONE;
-         }
-      }
-      else if(property->getName() == COPY_ALL_KW)
-      {
-         m_copyAllFlag = property->valueToString().toBool();
-      }
-      else if( property->getName() == INTERNAL_OVERVIEWS_KW )
-      {
-         m_internalOverviewsFlag = property->valueToString().toBool();
-      }
-      else if(property->getName() == ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW)
-      {
-         m_overviewStopDimension = property->valueToString().toUInt32();
-      }
-      else if(property->getName() == ossimKeywordNames::OUTPUT_TILE_SIZE_KW)
-      {
-         ossimIpt ipt;
-         
-         ipt.toPoint(property->valueToString());
-         
-         setOutputTileSize(ipt);
-      }
-   }
-}
-
-void ossimTiffOverviewBuilder::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(ossimKeywordNames::COMPRESSION_QUALITY_KW);
-   propertyNames.push_back(ossimKeywordNames::COMPRESSION_TYPE_KW);
-   propertyNames.push_back(COPY_ALL_KW);
-   propertyNames.push_back(INTERNAL_OVERVIEWS_KW);
-   propertyNames.push_back(ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW);
-}
-
-bool ossimTiffOverviewBuilder::canConnectMyInputTo(
-   ossim_int32 index,
-   const ossimConnectableObject* obj) const
-{
-   if ( (index == 0) &&
-        PTR_CAST(ossimImageHandler, obj) )
-   {
-      return true;
-   }
-
-   return false;
-}
-
-bool ossimTiffOverviewBuilder::buildInternalOverviews() const
-{
-   bool result = false;
-   if ( m_internalOverviewsFlag &&  m_imageHandler.valid() )
-   {
-      if ( m_imageHandler->getClassName() == "ossimTiffTileSource" )
-      {
-         result = true;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "Internal overviews opton not supported for class: "
-            << m_imageHandler->getClassName()
-            << std::endl;
-      }
-   }
-   return result;
-}
-
-bool ossimTiffOverviewBuilder::copyR0() const
-{
-   return ( m_copyAllFlag && !buildInternalOverviews());
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTiffTileSource.cpp b/ossim/src/ossim/imaging/ossimTiffTileSource.cpp
deleted file mode 100644
index 8293a5c..0000000
--- a/ossim/src/ossim/imaging/ossimTiffTileSource.cpp
+++ /dev/null
@@ -1,2721 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//          Frank Warmerdam (warmerdam at pobox.com)
-//
-// Description:
-//
-// Contains class definition for TiffTileSource.
-//
-//*******************************************************************
-//  $Id: ossimTiffTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/support_data/ossimGeoTiff.h>
-#include <ossim/support_data/ossimTiffInfo.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIoStream.h> /* for ossimIOMemoryStream */
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <xtiffio.h>
-#include <geo_normalize.h>
-#include <cstdlib> /* for abs(int) */
-
-RTTI_DEF1(ossimTiffTileSource, "ossimTiffTileSource", ossimImageHandler)
-
-static ossimTrace traceDebug("ossimTiffTileSource:debug");
-
-#define OSSIM_TIFF_UNPACK_R4(value) ( (value)&0x000000FF)
-#define OSSIM_TIFF_UNPACK_G4(value) ( ((value)>>8)&0x000000FF)
-#define OSSIM_TIFF_UNPACK_B4(value) ( ((value)>>16)&0x000000FF)
-#define OSSIM_TIFF_UNPACK_A4(value) ( ((value)>>24)&0x000000FF)
-
-//---
-// OSSIM_BUFFER_SCAN_LINE_READS:
-// If set to 1 ossimTiffTileSource::loadFromScanLine method will buffer image
-// width by tile height.  If set to 0 one line will be read at a time which
-// conserves memory on wide images or tall tiles.
-//
-// Buffered read is faster but uses more memory. Non-buffered slower less
-// memory.
-//
-// Only affects reading strip tiffs.
-//---
-#define OSSIM_BUFFER_SCAN_LINE_READS 1
-
-//*******************************************************************
-// Public Constructor:
-//*******************************************************************
-ossimTiffTileSource::ossimTiffTileSource()
-   :
-      ossimImageHandler(),
-      theTiffPtr(0),
-      theTile(0),
-      theBuffer(0),
-      theBufferSize(0),
-      theBufferRect(0, 0, 0, 0),
-      theBufferRLevel(0),
-      theCurrentTileWidth(0),
-      theCurrentTileHeight(0),
-      theSamplesPerPixel(0),
-      theBitsPerSample(0),
-      theSampleFormatUnit(0),
-      theMaxSampleValue(ossim::nan()),
-      theMinSampleValue(ossim::nan()),
-      theNullSampleValue(ossim::nan()),
-      theNumberOfDirectories(0),
-      theCurrentDirectory(0),
-      theR0isFullRes(false),
-      theBytesPerPixel(0),
-      theScalarType(OSSIM_SCALAR_UNKNOWN),
-      theApplyColorPaletteFlag(true),
-      theImageWidth(0),
-      theImageLength(0),
-      theReadMethod(0),
-      thePlanarConfig(0),
-      thePhotometric(0),
-      theRowsPerStrip(0),
-      theImageTileWidth(0),
-      theImageTileLength(0),
-      theImageDirectoryList(0),
-      theCurrentTiffRlevel(0),
-      theCompressionType(0),
-      theOutputBandList(0)
-{}
-
-ossimTiffTileSource::~ossimTiffTileSource()
-{
-   close();
-}
-
-ossimRefPtr<ossimImageData> ossimTiffTileSource::getTile(
-   const ossimIrect& tile_rect, ossim_uint32 resLevel )
-{
-   if ( theTile.valid() == false )
-   {
-      allocateTile(); // First time through...
-   }
-   
-   if ( theTile.valid() )
-   {
-      // Image rectangle must be set prior to calling getTile.
-      theTile->setImageRectangle(tile_rect);
-
-      if ( getTile( theTile.get(), resLevel ) == false )
-      {
-         if (theTile->getDataObjectStatus() != OSSIM_NULL)
-         {
-            theTile->makeBlank();
-         }
-      }
-   }
-
-   return theTile;
-}
-
-bool ossimTiffTileSource::getTile(ossimImageData* result,
-                                  ossim_uint32 resLevel)
-{
-   static const char MODULE[] = "ossimTiffTileSource::getTile(ossimImageData*, resLevel)";
-
-   bool status = false;
-   
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
-   {
-      result->ref(); // Increment ref count.
-      
-      //---
-      // Check for overview tile.  Some overviews can contain r0 so always
-      // call even if resLevel is 0.  Method returns true on success, false
-      // on error.
-      //---
-      status = getOverviewTile(resLevel, result);
-
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-         
-         ossim_uint32 level = resLevel;
-
-         //---
-         // If we have r0 our reslevels are the same as the callers so
-         // no adjustment necessary.
-         //---
-         if (theStartingResLevel && !theR0isFullRes) // Used as overview.
-         {
-            //---
-            // If we have r0 our reslevels are the same as the callers so
-            // no adjustment necessary.
-            //---
-            if (level >= theStartingResLevel)
-            {
-               //---
-               // Adjust the level to be relative to the reader using this
-               // as overview.
-               //---
-               level -= theStartingResLevel; 
-            }
-         }
-
-         ossimIrect tile_rect = result->getImageRectangle();
-
-         //---
-         // This should be the zero base image rectangle for this res level.
-         // Note passed the non adjusted resLevel by design.
-         //---
-         ossimIrect image_rect = getImageRectangle(resLevel);
-
-         // See if any point of the requested tile is in the image.
-         if ( tile_rect.intersects(image_rect) )
-         {
-            // Initialize the tile if needed as we're going to stuff it.
-            if (result->getDataObjectStatus() == OSSIM_NULL)
-            {
-               result->initialize();
-            }
-
-            bool reallocateBuffer = false;   
-            if ( (tile_rect.width()  != theCurrentTileWidth) ||
-                 (tile_rect.height() != theCurrentTileHeight) )
-            {
-               // Current tile size must be set prior to allocatBuffer call.
-               theCurrentTileWidth = tile_rect.width();
-               theCurrentTileHeight = tile_rect.height();
-               
-               reallocateBuffer = true;
-            }
-            
-            if (getCurrentTiffRLevel() != theImageDirectoryList[level])
-            {
-               status = setTiffDirectory(theImageDirectoryList[level]);
-               if (status)
-               {
-                  reallocateBuffer = true;
-               }
-            }
-
-            if (status)
-            {
-               if (reallocateBuffer)
-               {
-                  // NOTE: Using this buffer will be a thread issue. (drb) 
-                  status = allocateBuffer();
-               }
-            }
-
-            if ( status )
-            {  
-               ossimIrect clip_rect = tile_rect.clipToRect( image_rect );
-               
-               if ( !tile_rect.completely_within( clip_rect ) )
-               {
-                  //---
-                  // We're not going to fill the whole tile so start with a
-                  // blank tile.
-                  //---
-                  result->makeBlank();
-               }
-               
-               // Load the tile buffer with data from the tif.
-               if ( loadTile( tile_rect, clip_rect, result ) )
-               {
-                  result->validate();
-                  status = true;
-               }
-               else
-               {
-                  // Would like to change this to throw ossimException.(drb)
-                  status = false;
-                  if(traceDebug())
-                  {
-                     // Error in filling buffer.
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << MODULE
-                        << " Error filling buffer. Return status = false..."
-                        << std::endl;
-                  }
-               }
-
-            } // matches: if (status)
-               
-         } // matches:  if ( zeroBasedTileRect.intersects(image_rect) )
-         else 
-         {
-            // No part of requested tile within the image rectangle.
-            status = true; // Not an error.
-            result->makeBlank();
-         }
-         
-      } // matches: if (!status)
-      
-      result->unref(); // Decrement ref count.
-      
-   } // matches: if( isOpen() && isSourceEnabled() && isValidRLevel(level) )
-
-   return status;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimTiffTileSource::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix) const
-{
-   bool result = ossimImageHandler::saveState(kwl, prefix);
-   
-   if ( result )
-   {
-      if ( isBandSelector() && theOutputBandList.size() )
-      {
-         if ( isIdentityBandList( theOutputBandList ) == false )
-         {
-            // If we're not identity output the bands.
-            ossimString bandsString;
-            ossim::toSimpleStringList(bandsString, theOutputBandList);
-            kwl.add(prefix,
-                    ossimKeywordNames::BANDS_KW,
-                    bandsString,
-                    true);
-         }
-      }
-      
-      kwl.add(prefix,
-              "apply_color_palette_flag",
-              theApplyColorPaletteFlag,
-              true);
-   }
-   
-   return result;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-bool ossimTiffTileSource::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   bool result = false;
-   theOutputBandList.clear();
-
-   if (ossimImageHandler::loadState(kwl, prefix))
-   {
-      std::string pfx = ( prefix ? prefix : "" );
-      std::string key = "apply_color_palette_flag";
-      ossimString value;
-      
-      value.string() = kwl.findKey( pfx, key );
-      if ( value.size() )
-      {
-         theApplyColorPaletteFlag = value.toBool();
-      }
-      else
-      {
-         theApplyColorPaletteFlag = true;
-      }
-
-      key = ossimKeywordNames::BANDS_KW;
-      value.string() = kwl.findKey( pfx, key );
-      if ( value.size() )
-      {
-         ossim::toSimpleVector( theOutputBandList, value );
-      }
-      
-      if ( open() ) 
-      {
-         // Set the band list after open so that the overview also gets set.
-         result = true;
-      }
-   }
-   return result;
-}
-
-bool ossimTiffTileSource::open(const ossimFilename& image_file)
-{
-   if (theTiffPtr)
-   {
-     close();
-   }
-   theImageFile = image_file;
-   return open();
-}
-
-void ossimTiffTileSource::close()
-{
-   if(theTiffPtr)
-   {
-      XTIFFClose(theTiffPtr);
-      theTiffPtr = 0;
-   }
-   theImageWidth.clear();
-   theImageLength.clear();
-   theReadMethod.clear();
-   thePlanarConfig.clear();
-   thePhotometric.clear();
-   theRowsPerStrip.clear();
-   theImageTileWidth.clear();
-   theImageTileLength.clear();
-   if (theBuffer)
-   {
-      delete [] theBuffer;
-      theBuffer = 0;
-      theBufferSize = 0;
-   }
-   ossimImageHandler::close();
-}
-
-bool ossimTiffTileSource::open()
-{
-   static const char MODULE[] = "ossimTiffTileSource::open";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " Entered..."
-         << "\nFile:  " << theImageFile.c_str() << std::endl;
-   }
-
-   if(isOpen())
-   {
-     close();
-   }
-
-   // Check for empty file name.
-   if (theImageFile.empty())
-   {
-      return false;
-   }
-#if 0  
-   // First we do a quick test to see if the file looks like a tiff file.
-   FILE		*fp;
-   unsigned char header[2];
-
-   fp = fopen( theImageFile.c_str(), "rb" );
-   if( fp == NULL )
-       return false;
-
-   fread( header, 2, 1, fp );
-   fclose( fp );
-
-   if( (header[0] != 'M' || header[1] != 'M')
-       && (header[0] != 'I' || header[1] != 'I') )
-       return false;
-#endif
-   
-   theImageDirectoryList.clear();
-
-   //---
-   // Note:  The 'm' in "rm" is to tell TIFFOpen to not memory map the file.
-   //---
-   theTiffPtr = XTIFFOpen(theImageFile.c_str(), "rm");
-   if (!theTiffPtr)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:\n"
-            << "libtiff could not open..." << std::endl;
-      }
-      return false;
-   }
-
-   theCompressionType = COMPRESSION_NONE;
-   //***
-   // Get the general tiff info.
-   //***
-   if(!TIFFGetField(theTiffPtr, TIFFTAG_COMPRESSION, &theCompressionType))
-   {
-      theCompressionType = COMPRESSION_NONE;
-   }
-
-   //***
-   // See if the first directory is of FILETYPE_REDUCEDIMAGE; if not,
-   // the first level is considered to be full resolution data.
-   // Note:  If the tag is not present, consider the first level full
-   // resolution.
-   //***
-   theImageDirectoryList.push_back(0);
-   ossim_uint32 sub_file_type;
-   if ( !TIFFGetField( theTiffPtr,
-                       TIFFTAG_SUBFILETYPE ,
-                       &sub_file_type ) )
-   {
-      sub_file_type = 0;
-   }
-
-   if (sub_file_type == FILETYPE_REDUCEDIMAGE)
-   {
-      theR0isFullRes = false;
-   }
-   else
-   {
-      theR0isFullRes = true;
-   }
-   
-   if( !TIFFGetField(theTiffPtr, TIFFTAG_BITSPERSAMPLE, &(theBitsPerSample)) )
-   {
-      theBitsPerSample = 8;
-   }
-
-   if( !TIFFGetField(theTiffPtr,
-                     TIFFTAG_SAMPLESPERPIXEL,
-                     &theSamplesPerPixel ) )
-   {
-      theSamplesPerPixel = 1;
-   }
-   
-   if ( !TIFFGetField( theTiffPtr,
-                       TIFFTAG_SAMPLEFORMAT,
-                       &theSampleFormatUnit ) )
-   {
-      theSampleFormatUnit = 0;
-   }
-
-   if ( theSampleFormatUnit == SAMPLEFORMAT_COMPLEXINT )
-   {
-      //---
-      // Override the samples per pixel set above as sample data has set to
-      // one.
-      //---
-      theSamplesPerPixel = 2;
-   }
-
-   if ( !TIFFGetField( theTiffPtr,
-                       TIFFTAG_SMAXSAMPLEVALUE,
-                       &theMaxSampleValue ) )
-   {
-      uint16 maxValue = 0;
-      if(!TIFFGetField( theTiffPtr,
-                        TIFFTAG_MAXSAMPLEVALUE,
-                        &maxValue))
-      {
-         //---
-         // This will be reset in validateMinMax method.  Can't set right now because we
-         // don't know the scalar type yet.
-         //---
-         theMaxSampleValue = ossim::nan();
-      }
-      else
-      {
-         theMaxSampleValue = maxValue;
-      }
-   }
-
-   if ( !TIFFGetField( theTiffPtr,
-                       TIFFTAG_SMINSAMPLEVALUE,
-                       &theMinSampleValue ) )
-   {
-      uint16 minValue = 0;
-      if(!TIFFGetField( theTiffPtr,
-                        TIFFTAG_MINSAMPLEVALUE,
-                        &minValue))
-      {
-         //---
-         // This will be reset in validateMinMax method.  Can't set right now because we
-         // don't know the scalar type yet.
-         //--- 
-         theMinSampleValue = ossim::nan();
-      }
-      else
-      {
-         theMinSampleValue = minValue;
-      }
-   }
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\ntheMinSampleValue:  " << theMinSampleValue
-           << "\ntheMaxSampleValue:  " << theMaxSampleValue
-           << endl;
-   }
-
-   // Get the number of directories.
-   theNumberOfDirectories = TIFFNumberOfDirectories(theTiffPtr);
-
-   // Current dir.
-   theCurrentDirectory = TIFFCurrentDirectory(theTiffPtr);
-
-   theImageWidth.resize(theNumberOfDirectories);
-   theImageLength.resize(theNumberOfDirectories);
-   theReadMethod.resize(theNumberOfDirectories);
-   thePlanarConfig.resize(theNumberOfDirectories);
-   thePhotometric.resize(theNumberOfDirectories);
-   theRowsPerStrip.resize(theNumberOfDirectories);
-   theImageTileWidth.resize(theNumberOfDirectories);
-   theImageTileLength.resize(theNumberOfDirectories);
-
-   for (ossim_uint32 dir=0; dir<theNumberOfDirectories; ++dir)
-   {
-      if (setTiffDirectory(dir) == false)
-      {
-         return false;
-      }
-
-      // Note: Need lines, samples before acceptAsRrdsLayer check.
-      
-      // lines:
-      if ( !TIFFGetField( theTiffPtr,
-                          TIFFTAG_IMAGELENGTH,
-                          &theImageLength[dir] ) )
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Cannot determine image length."
-            << endl;
-      }
-
-      // samples:
-      if ( !TIFFGetField( theTiffPtr,
-                          TIFFTAG_IMAGEWIDTH,
-                          &theImageWidth[dir] ) )
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Cannot determine image width."
-            << endl;
-      }
-      
-      if ( !TIFFGetField( theTiffPtr,
-                         TIFFTAG_SUBFILETYPE ,
-                         &sub_file_type ) )
-      {
-         sub_file_type = 0;
-      }
-
-      if (sub_file_type == FILETYPE_REDUCEDIMAGE)
-      {
-         //---
-         // Check for a thumbnail image.  If present don't use as it will mess with
-         // overviews.  Currently only checking if it's a two directory image, i.e. a full
-         // res and a thumbnail.
-         // 
-         // Note this shuts off the thumbnail which someone may want to see.  We could make
-         // this a reader prop if it becomes an issue. drb - 09 Jan. 2012.
-         //---
-         if ( dir!=0 )
-         {
-            bool acceptAsRrdsLayer = true;
-            if ( ( theNumberOfDirectories == 2 ) && ( dir == 1 ) )
-            {
-               acceptAsRrdsLayer = isPowerOfTwoDecimation(dir);
-            }
-
-            if ( acceptAsRrdsLayer )
-            {
-               theImageDirectoryList.push_back(dir);
-            }
-         }
-      }
-      
-      if( !TIFFGetField( theTiffPtr, TIFFTAG_PLANARCONFIG,
-                         &(thePlanarConfig[dir]) ) )
-      {
-         thePlanarConfig[dir] = PLANARCONFIG_CONTIG;
-      }
-      
-      if( !TIFFGetField( theTiffPtr, TIFFTAG_PHOTOMETRIC,
-                         &(thePhotometric[dir]) ) )
-      {
-         thePhotometric[dir] = PHOTOMETRIC_MINISBLACK;
-      }
-      theLut = 0;
-      // Check for palette.
-      uint16* red;
-      uint16* green;
-      uint16* blue;
-      if(TIFFGetField(theTiffPtr, TIFFTAG_COLORMAP, &red, &green, &blue))
-      {
-         if(theApplyColorPaletteFlag)
-         {
-            thePhotometric[dir] = PHOTOMETRIC_PALETTE;
-            theSamplesPerPixel = 3;
-         }
-         populateLut();
-      }
-
-      if( TIFFIsTiled(theTiffPtr))
-      {
-         theRowsPerStrip[dir] = 0;
-         if ( !TIFFGetField( theTiffPtr,
-                             TIFFTAG_TILEWIDTH,
-                             &theImageTileWidth[dir] ) )
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimTiffTileSource::getTiffTileWidth ERROR:"
-               << "\nCannot determine tile width." << endl;
-            theImageTileWidth[dir] = 0;
-         }
-         if ( !TIFFGetField( theTiffPtr,
-                             TIFFTAG_TILELENGTH,
-                             &theImageTileLength[dir] ) )
-         {
-            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;   
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimTiffTileSource::getTiffTileLength ERROR:"
-               << "\nCannot determine tile length." << endl;
-             theImageTileLength[dir] = 0;
-         }
-      }
-      else
-      {
-         // Strip tiff:
-         theImageTileWidth[dir]  = 0;
-         theImageTileLength[dir] = 0;
-         if( !TIFFGetField( theTiffPtr, TIFFTAG_ROWSPERSTRIP,
-                            &(theRowsPerStrip[dir]) ) )
-         {
-            theRowsPerStrip[dir] = 1;
-         }
-         
-         theImageTileWidth[dir]  = theImageWidth[dir];
-         theImageTileLength[dir] = theRowsPerStrip[dir];
-
-         //---
-         // Let's default the tile size to something efficient.
-         //
-         // NOTE:
-         //
-         // This is not used by the strip reader method.  Only by the getImageTileHeight
-         // and getImageTileHeight methods.
-         //---
-         if ( theImageTileWidth[dir] > 256 )
-         {
-            theImageTileWidth[dir] = 256;
-         }
-         else if( theImageTileWidth[dir] < 64 )
-         {
-            theImageTileWidth[dir]  = 64;
-         }
-         if( theImageTileLength[dir] > 256 )
-         {
-            theImageTileLength[dir] = 256;
-         }
-         else if(theImageTileLength[dir] < 64)
-         {
-            theImageTileLength[dir] = 64;
-         }
-      }
-      
-   } // End of "for (ossim_uint32 dir=0; dir<theNumberOfDirectories; dir++)"
-   
-   // Reset the directory back to "0".
-   if (setTiffDirectory(0) == false)
-   {
-      return false;
-   }
-
-   //---
-   // Get the scalar type.
-   //---
-   theScalarType = OSSIM_SCALAR_UNKNOWN;
-   if (theBitsPerSample == 16)
-   {
-      theBytesPerPixel = 2;
-
-      if (theSampleFormatUnit == SAMPLEFORMAT_INT)
-      {
-         // this is currently causing pixel problems.  I am going to comment this out until we figure out a better solution
-         //
-#if 0         
-         if (theMinSampleValue == 0) //  && (theMaxSampleValue > 36535) )
-         {
-            //---
-            // This is a hack for RadarSat data which is has tag 339 set to
-            // signed sixteen bit data with a min sample value of 0 and
-            // sometimes a max sample value greater than 36535.
-            //---
-            theScalarType = OSSIM_UINT16;
-         }
-         else
-         {
-            theScalarType = OSSIM_SINT16;
-         }
-#else
-         theScalarType = OSSIM_SINT16;
-#endif
-
-      }
-      else if (theSampleFormatUnit == SAMPLEFORMAT_UINT)
-      {
-         // ESH 03/2009 -- Changed "== 2047" to "<= 2047"
-         if (theMaxSampleValue <= 2047) // 2^11-1
-         {
-            // 11 bit EO, i.e. Ikonos, QuickBird, WorldView, GeoEye.
-            theScalarType = OSSIM_USHORT11; // IKONOS probably...
-         }
-         else
-         {
-            theScalarType = OSSIM_UINT16; 
-         }
-      }
-      else
-      {
-         if (theMaxSampleValue <= 2047) // 2^11-1
-         {
-            // 11 bit EO, i.e. Ikonos, QuickBird, WorldView, GeoEye.
-            theScalarType = OSSIM_USHORT11; // IKONOS probably...
-         }
-         else
-            theScalarType = OSSIM_UINT16; // Default to unsigned...
-      }
-   }
-   else if ( (theBitsPerSample == 32) &&
-             (theSampleFormatUnit == SAMPLEFORMAT_UINT) )
-   {
-      theBytesPerPixel = 4;
-      theScalarType = OSSIM_UINT32;
-   }
-   else if ( (theBitsPerSample == 32) &&
-             (theSampleFormatUnit == SAMPLEFORMAT_INT) )
-   {
-      theBytesPerPixel = 4;
-      theScalarType = OSSIM_SINT32;
-   }
-   else if ( (theBitsPerSample == 32) &&
-             (theSampleFormatUnit == SAMPLEFORMAT_IEEEFP) )
-   {
-      theBytesPerPixel = 4;
-      theScalarType = OSSIM_FLOAT32;
-   }
-   else if ( (theBitsPerSample == 32) &&
-             (theSampleFormatUnit == SAMPLEFORMAT_COMPLEXINT) )
-   {
-      theBytesPerPixel = 2;
-      theScalarType = OSSIM_SINT16;
-   }
-   else if(theBitsPerSample == 64 &&
-	   theSampleFormatUnit == SAMPLEFORMAT_IEEEFP)
-   {
-      theBytesPerPixel = 8;
-      theScalarType = OSSIM_FLOAT64;
-   }
-   else if (theBitsPerSample <= 8)
-   {
-      theBytesPerPixel = 1;
-      theScalarType = OSSIM_UINT8;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error:\nCannot determine scalar type.\n"
-         << "Trace dump follows:\n";
-      print(ossimNotify(ossimNotifyLevel_WARN));
-      
-      return false;
-   }
-   
-   // Sanity check for min, max and null values.
-   validateMinMaxNull();
-   
-   setReadMethod();
-   
-   // Establish raster pixel alignment type:
-   GTIF* gtif = GTIFNew(theTiffPtr);
-   ossim_uint16 raster_type;
-   if (GTIFKeyGet(gtif, GTRasterTypeGeoKey, &raster_type, 0, 1) && (raster_type == 1))
-   {
-      thePixelType = OSSIM_PIXEL_IS_AREA;
-   }
-   else
-   {
-      thePixelType = OSSIM_PIXEL_IS_POINT;
-   }
-   GTIFFree(gtif);
-
-   // Let base-class finish the rest:
-   completeOpen();
-
-   if ( isBandSelector() && theOutputBandList.size() && ( isIdentityBandList( theOutputBandList ) == false ) )
-   {
-      // This does range checking and will pass to overview if open.
-      setOutputBandList( theOutputBandList );
-   }
-   
-   //---
-   // Note: Logic changed to leave theTile and theBuffer uninitialized until first getTile(...)
-   // request. (drb)
-   //---
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " Debug:";
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-   
-   // Finished...
-   return true;
-}
-   
-ossim_uint32 ossimTiffTileSource::getNumberOfLines( ossim_uint32 resLevel ) const
-{
-   ossim_uint32 result = 0;
-   if ( theImageDirectoryList.size() && theTiffPtr && isValidRLevel(resLevel) )
-   {
-      //---
-      // If we have r0 our reslevels are the same as the callers so
-      // no adjustment necessary.
-      //---
-      if (!theStartingResLevel || theR0isFullRes) // not an overview or has r0.
-      {
-         //---
-         // If we have r0 our reslevels are the same as the callers so
-         // no adjustment necessary.
-         //---
-         if (resLevel < theImageDirectoryList.size())
-         {
-            result = theImageLength[theImageDirectoryList[resLevel]];
-         }
-         else if (theOverview.valid())
-         {
-            result = theOverview->getNumberOfLines(resLevel);
-         }
-      }
-      else // this is an overview without r0
-      {
-         if (resLevel >= theStartingResLevel)
-         {
-            //---
-            // Adjust the level to be relative to the reader using this as
-            // overview.
-            //---
-            ossim_uint32 level = resLevel - theStartingResLevel;
-            if (level < theImageDirectoryList.size())
-            {
-               result = theImageLength[theImageDirectoryList[level]];
-            }
-         }
-      }
-   }
-   return result;
-}
-
-ossim_uint32 ossimTiffTileSource::getNumberOfSamples( ossim_uint32 resLevel ) const
-{
-   ossim_uint32 result = 0;
-   if ( theImageDirectoryList.size() && theTiffPtr && isValidRLevel(resLevel) )
-   {
-      //---
-      // If we have r0 our reslevels are the same as the callers so
-      // no adjustment necessary.
-      //---
-      if (!theStartingResLevel||theR0isFullRes) // not an overview or has r0.
-      {
-         if (resLevel < theImageDirectoryList.size())
-         {
-            result = theImageWidth[theImageDirectoryList[resLevel]];
-         }
-         else if (theOverview.valid())
-         {
-            result = theOverview->getNumberOfSamples(resLevel);
-         }
-      }
-      else // this is an overview.
-      {
-         if (resLevel >= theStartingResLevel)
-         {
-            //---
-            // Adjust the level to be relative to the reader using this as
-            // overview.
-            //---
-            ossim_uint32 level = resLevel - theStartingResLevel;
-            if (level < theImageDirectoryList.size())
-            {
-               result = theImageWidth[theImageDirectoryList[level]];
-            }
-         }
-      }
-   }
-   return result;
-}
-
-ossim_uint32 ossimTiffTileSource::getNumberOfDecimationLevels() const
-{
-   ossim_uint32 result = theImageDirectoryList.size();
-   
-   // If starting res level is not 0 then this is an overview.
-   if (theStartingResLevel&&theR0isFullRes)
-   {
-      // Don't count r0.
-      --result;
-   }
-   else if (theOverview.valid())
-   {
-      result += theOverview->getNumberOfDecimationLevels();
-   }
-
-   return result;
-}
-
-//*******************************************************************
-// Public method:
-//*******************************************************************
-ossimScalarType ossimTiffTileSource::getOutputScalarType() const
-{
-   return theScalarType;
-}
-
-bool ossimTiffTileSource::loadTile(const ossimIrect& tile_rect,
-                                   const ossimIrect& clip_rect,
-                                   ossimImageData* result)
-{
-   static const char MODULE[] = "ossimTiffTileSource::loadTile";
-
-   bool status = true;
-
-   if ( !theBuffer )
-   {
-      status = allocateBuffer();
-   }
-
-   if ( status )
-   {
-      switch(theReadMethod[theCurrentDirectory])
-      {
-         case READ_TILE:
-            status = loadFromTile(clip_rect, result);
-            break;
-            
-         case READ_SCAN_LINE:
-            status = loadFromScanLine(clip_rect, result);
-            break;
-            
-         case READ_RGBA_U8_TILE:
-            status = loadFromRgbaU8Tile(tile_rect, clip_rect, result);
-            break;
-            
-         case READ_RGBA_U8_STRIP:
-            status = loadFromRgbaU8Strip(tile_rect, clip_rect, result);
-            break;
-            
-         case READ_RGBA_U8A_STRIP:
-            status = loadFromRgbaU8aStrip(tile_rect, clip_rect, result);
-            break;
-
-         case READ_U16_STRIP:
-            status = loadFromU16Strip(clip_rect, result);
-            break;
-            
-         default:
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " Unsupported tiff type!" << endl;
-            status = false;
-            break;
-      }
-   }
-   
-   return status;
-}
-
-bool ossimTiffTileSource::loadFromScanLine(const ossimIrect& clip_rect,
-                                           ossimImageData* result)
-{
-#if OSSIM_BUFFER_SCAN_LINE_READS
-   ossimInterleaveType type =
-      (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG) ?
-       OSSIM_BIP : OSSIM_BIL;
-
-   if ( theBufferRLevel != getCurrentTiffRLevel() ||
-        !clip_rect.completely_within(theBufferRect) )
-   {
-      //***
-      // Must reload the buffer.  Grab enough lines to fill the depth of the
-      // clip rectangle.
-      //***
-      theBufferRLevel = getCurrentTiffRLevel();
-      theBufferRect   = getImageRectangle(theBufferRLevel);
-      theBufferRect.set_uly(clip_rect.ul().y);
-      theBufferRect.set_lry(clip_rect.lr().y);
-      ossim_uint32 startLine = clip_rect.ul().y;
-      ossim_uint32 stopLine  = clip_rect.lr().y;
-      ossim_uint8* buf = theBuffer;
-
-      if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
-      {
-         ossim_uint32 lineSizeInBytes = getNumberOfSamples(theBufferRLevel) *
-                                  theBytesPerPixel * theSamplesPerPixel;
-
-         for (ossim_uint32 line = startLine; line <= stopLine; ++line)
-         {
-            TIFFReadScanline(theTiffPtr, (void*)buf, line, 0);
-            buf += lineSizeInBytes;
-         }
-      }
-      else
-      {
-         ossim_uint32 lineSizeInBytes = getNumberOfSamples(theBufferRLevel) *
-                                  theBytesPerPixel;
-
-         for (ossim_uint32 line = startLine; line <= stopLine; ++line)
-         {
-            for (ossim_uint32 band = 0; band < theSamplesPerPixel; ++band)
-            {
-               TIFFReadScanline(theTiffPtr, (void*)buf, line, band);
-               buf += lineSizeInBytes;
-            }
-         }
-      }
-   }
-
-   //---
-   // Since theTile's internal rectangle is relative to any sub image offset
-   // we must adjust both the zero based "theBufferRect" and the zero base
-   // "clip_rect" before passing to
-   // theTile->loadTile method.
-   //---
-   result->loadTile(theBuffer, theBufferRect, clip_rect, type);
-   return true;
-
-#else
-   ossimInterleaveType type =
-      (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG) ? OSSIM_BIP : OSSIM_BIL;
-
-   ossim_int32 startLine = clip_rect.ul().y;
-   ossim_int32 stopLine  = clip_rect.lr().y;
-   ossim_int32 stopSamp  = static_cast<ossim_int32>(getNumberOfSamples(theBufferRLevel)-1);
-   
-   if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
-   {
-      for (ossim_int32 line = startLine; line <= stopLine; ++line)
-      {
-         TIFFReadScanline(theTiffPtr, (void*)theBuffer, line, 0);
-         result->copyLine((void*)theBuffer, line, 0, stopSamp, type);
-      }
-   }
-   else
-   {
-      ossim_uint32 lineSizeInBytes = getNumberOfSamples(theBufferRLevel) * theBytesPerPixel;
-      for (ossim_int32 line = startLine; line <= stopLine; ++line)
-      {
-         ossim_uint8* buf = theBuffer;
-         for (ossim_uint32 band = 0; band < theSamplesPerPixel; ++band)
-         {
-            TIFFReadScanline(theTiffPtr, (void*)buf, line, band);
-            buf += lineSizeInBytes;
-         }
-         result->copyLine((void*)theBuffer, line, 0, stopSamp, type);
-      }
-   }
-   return true;
-#endif /* #if OSSIM_BUFFER_SCAN_LINE_READS #else - Non buffered scan line reads. */
-}
-
-bool ossimTiffTileSource::loadFromTile(const ossimIrect& clip_rect,
-                                       ossimImageData* result)
-{
-   static const char MODULE[] = "ossimTiffTileSource::loadFromTile";
-   
-   ossim_int32 tileSizeRead = 0;
-   
-   //---
-   // Shift the upper left corner of the "clip_rect" to the an even tile
-   // boundary.  Note this will shift in the upper left direction.
-   //---
-   ossimIpt tileOrigin = clip_rect.ul();
-   adjustToStartOfTile(tileOrigin);
-   ossimIpt ulTilePt       = tileOrigin;
-//   ossimIpt subImageOffset = getSubImageOffset(getCurrentTiffRLevel()+theStartingResLevel);
-
-   //---
-   // Calculate the number of tiles needed in the line/sample directions.
-   //---
-   ossim_uint32 tiles_in_v_dir = (clip_rect.lr().x-tileOrigin.x+1) /
-      theImageTileWidth[theCurrentDirectory];
-   ossim_uint32 tiles_in_u_dir = (clip_rect.lr().y-tileOrigin.y+1) /
-      theImageTileLength[theCurrentDirectory];
-
-   if ( (clip_rect.lr().x-tileOrigin.x+1) %
-        theImageTileWidth[theCurrentDirectory]  ) ++tiles_in_v_dir;
-   if ( (clip_rect.lr().y-tileOrigin.y+1) %
-        theImageTileLength[theCurrentDirectory] ) ++tiles_in_u_dir;
-
-
-   // Tile loop in line direction.
-   for (ossim_uint32 u=0; u<tiles_in_u_dir; ++u)
-   {
-      ulTilePt.x = tileOrigin.x;
-
-      // Tile loop in sample direction.
-      for (ossim_uint32 v=0; v<tiles_in_v_dir; ++v)
-      {
-         ossimIrect tiff_tile_rect(ulTilePt.x,
-                                   ulTilePt.y,
-                                   ulTilePt.x +
-                                   theImageTileWidth[theCurrentDirectory]  - 1,
-                                   ulTilePt.y +
-                                   theImageTileLength[theCurrentDirectory] - 1);
-         
-         if (tiff_tile_rect.intersects(clip_rect))
-         {
-            ossimIrect tiff_tile_clip_rect
-               = tiff_tile_rect.clipToRect(clip_rect);
-
-            //---
-            // Since theTile's internal rectangle is relative to any sub
-            // image offset we must adjust both the zero based
-            // "theBufferRect" and the zero based "clip_rect" before
-            // passing to theTile->loadTile method.
-            //---
-            ossimIrect bufRectWithOffset = tiff_tile_rect;// + subImageOffset;
-            ossimIrect clipRectWithOffset = tiff_tile_clip_rect;// + subImageOffset;
-            
-            if  (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
-            {
-               tileSizeRead = TIFFReadTile(theTiffPtr,
-                                           theBuffer,
-                                           ulTilePt.x,
-                                           ulTilePt.y,
-                                           0,
-                                           0);
-               if (tileSizeRead > 0)
-               {
-                  result->loadTile(theBuffer,
-                                  bufRectWithOffset,
-                                  clipRectWithOffset,
-                                  OSSIM_BIP);
-               }
-               else if(tileSizeRead < 0)
-               {
-                  if(traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << MODULE << " Read Error!"
-                        << "\nReturning error...  " << endl;
-                  }
-                  theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-                  return false;
-               }
-            }
-            else
-            {
-               if ( theOutputBandList.empty() )
-               {
-                  // This will set to identity.
-                  ossimImageSource::getOutputBandList( theOutputBandList );
-               }
-               
-               // band separate tiles...
-               std::vector<ossim_uint32>::const_iterator bandIter = theOutputBandList.begin();
-               ossim_uint32 destinationBand = 0;
-               while ( bandIter != theOutputBandList.end() )
-               {
-                  tileSizeRead = TIFFReadTile( theTiffPtr,
-                                               theBuffer,
-                                               ulTilePt.x,
-                                               ulTilePt.y,
-                                               0,
-                                               (*bandIter) );
-                  if(tileSizeRead > 0)
-                  {
-                     result->loadBand( theBuffer,
-                                       bufRectWithOffset,
-                                       clipRectWithOffset,
-                                       destinationBand );
-                  }
-                  else if (tileSizeRead < 0)
-                  {
-                     if(traceDebug())
-                     {
-                        ossimNotify(ossimNotifyLevel_WARN)
-                           << MODULE << " Read Error!"
-                           << "\nReturning error...  " << endl;
-                     }
-                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-                     return false;
-                  }
-                  ++bandIter; // Next band...
-                  ++destinationBand;
-               }
-            }
-
-         } // End of if (tiff_tile_rect.intersects(clip_rect))
-         
-         ulTilePt.x += theImageTileWidth[theCurrentDirectory];
-         
-      }  // End of tile loop in the sample direction.
-
-      ulTilePt.y += theImageTileLength[theCurrentDirectory];
-      
-   }  // End of tile loop in the line direction.
-
-   return true;
-}
-
-bool ossimTiffTileSource::loadFromRgbaU8Tile(const ossimIrect& tile_rect,
-                                             const ossimIrect& clip_rect,
-                                             ossimImageData* result)
-{
-   static const char MODULE[] = "ossimTiffTileSource::loadFromRgbaTile";
-
-   if (theSamplesPerPixel != 3 || theBytesPerPixel!=1)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error:"
-         << "\nInvalid number of bands or bytes per pixel!" << endl;
-   }
-   
-   //***
-   // Shift the upper left corner of the "clip_rect" to the an even tile
-   // boundary.  Note this will shift in the upper left direction.
-   //***
-   ossimIpt tileOrigin = clip_rect.ul();
-   adjustToStartOfTile(tileOrigin);
-
-   //---
-   // Calculate the number of tiles needed in the line/sample directions
-   // to fill the tile.
-   //---
-   ossim_uint32 tiles_in_v_dir = (clip_rect.lr().x-tileOrigin.x+1) /
-      theImageTileWidth[theCurrentDirectory];
-   ossim_uint32 tiles_in_u_dir = (clip_rect.lr().y-tileOrigin.y+1) /
-      theImageTileLength[theCurrentDirectory];
-
-   if ( (clip_rect.lr().x-tileOrigin.x+1) %
-        theImageTileWidth[theCurrentDirectory]  ) ++tiles_in_v_dir;
-   if ( (clip_rect.lr().y-tileOrigin.y+1) %
-        theImageTileLength[theCurrentDirectory] ) ++tiles_in_u_dir;
-   
-   ossimIpt ulTilePt = tileOrigin;
-
-#if 0
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\ntile_rect:  " << tile_rect
-           << "\nclip_rect:  " << clip_rect
-           << "\ntiles_in_v_dir:  " << tiles_in_v_dir
-           << "\ntiles_in_u_dir:  " << tiles_in_u_dir
-           << endl;
-   }
-#endif
-   
-   
-   // Tile loop in line direction.
-   for (ossim_uint32 u=0; u<tiles_in_u_dir; u++)
-   {
-      ulTilePt.x = tileOrigin.x;
-
-      // Tile loop in sample direction.
-      for (ossim_uint32 v=0; v<tiles_in_v_dir; v++)
-      {
-         ossimIrect tiff_tile_rect
-            = ossimIrect(ulTilePt.x,
-                         ulTilePt.y,
-                         ulTilePt.x +
-                         theImageTileWidth[theCurrentDirectory]  - 1,
-                         ulTilePt.y +
-                         theImageTileLength[theCurrentDirectory] - 1);
-
-         if ( getCurrentTiffRLevel() != theBufferRLevel ||
-              tiff_tile_rect != theBufferRect)
-         {
-            // Need to grab a new tile.
-            // Read a tile into the buffer.
-            if ( !TIFFReadRGBATile(theTiffPtr,
-                                   ulTilePt.x,
-                                   ulTilePt.y,
-                                   (uint32*)theBuffer) ) // use tiff typedef
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " Read Error!"
-                  << "\nReturning error..." << endl;
-               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-               return false;
-            }
-
-            // Capture the rectangle.
-            theBufferRect   = tiff_tile_rect;
-            theBufferRLevel = getCurrentTiffRLevel();
-         }
-
-         ossimIrect tile_clip_rect = clip_rect.clipToRect(theBufferRect);
-         
-         //***
-         // Get the offset to the first valid pixel.
-         // 
-         // Note: The data in the tile buffer is organized bottom up.  So the
-         //       coordinate must be negated in the line direction since
-         //       the met assumes an origin of upper left.
-         //***
-         ossim_uint32 in_buf_offset =
-              (tiff_tile_rect.lr().y-tile_clip_rect.ul().y)*
-              theImageTileWidth[theCurrentDirectory]*4 +
-              ((tile_clip_rect.ul().x - ulTilePt.x)*4);
-         
-         ossim_uint32 out_buf_offset =
-            (tile_clip_rect.ul().y - tile_rect.ul().y) *
-            ((ossim_int32)result->getWidth()) +
-            tile_clip_rect.ul().x - tile_rect.ul().x;
-         
-         //
-         // Get a pointer positioned at the first valid pixel in buffers.
-         //
-         ossim_uint32* s = (ossim_uint32*)(theBuffer + in_buf_offset);  // s for source...
-//         ossim_uint8* s = theBuffer + in_buf_offset;  // s for source...
-         ossim_uint8* r = static_cast<ossim_uint8*>(result->getBuf(0))+
-            out_buf_offset;
-         ossim_uint8* g = static_cast<ossim_uint8*>(result->getBuf(1))+
-            out_buf_offset;
-         ossim_uint8* b = static_cast<ossim_uint8*>(result->getBuf(2))+
-            out_buf_offset;
-         
-         ossim_uint32 lines2copy = tile_clip_rect.lr().y-tile_clip_rect.ul().y+1;
-         ossim_uint32 samps2copy = tile_clip_rect.lr().x-tile_clip_rect.ul().x+1;
-         
-         // Line loop through valid portion of the tiff tile.         
-         for (ossim_uint32 line = 0; line < lines2copy; line++)
-         {
-            // Sample loop through the tiff tile.
-            ossim_uint32 i=0;
-            ossim_uint32 j=0;
-            
-            // note the bands from the TIFF READ are stored in a, b, g, r ordering.
-            // we must reverse the bands and skip the first byte.
-            for (ossim_uint32 sample = 0; sample < samps2copy; sample++)
-            {
-               r[i] = (ossim_uint8)OSSIM_TIFF_UNPACK_R4(s[j]);
-               g[i] = (ossim_uint8)OSSIM_TIFF_UNPACK_G4(s[j]);
-               b[i] = (ossim_uint8)OSSIM_TIFF_UNPACK_B4(s[j]);
-               i++;
-               ++j;
-            }
-            
-            // Increment the pointers by one line.
-            const ossim_uint32 OUTPUT_TILE_WIDTH = result->getWidth();
-            r += OUTPUT_TILE_WIDTH;
-            g += OUTPUT_TILE_WIDTH;
-            b += OUTPUT_TILE_WIDTH;
-            s -= theImageTileWidth[theCurrentDirectory];
-         }
-      
-         ulTilePt.x += theImageTileWidth[theCurrentDirectory];
-      
-      }  // End of tile loop in the sample direction.
-      
-      ulTilePt.y += theImageTileLength[theCurrentDirectory];
-      
-   }  // End of tile loop in the line direction.
-   
-   return true;
-}
-
-bool ossimTiffTileSource::loadFromRgbaU8Strip(const ossimIrect& tile_rect,
-                                              const ossimIrect& clip_rect,
-                                              ossimImageData* result)
-{
-   static const char MODULE[] = "ossimTiffTileSource::loadFromRgbaU8Strip";
-
-   if (theSamplesPerPixel > 4 || theBytesPerPixel != 1)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error:"
-         << "\nInvalid number of bands or bytes per pixel!" << endl;
-   }
-   
-   //***
-   // Calculate the number of strips to read.
-   //***
-   const ossim_uint32 OUTPUT_TILE_WIDTH = result->getWidth();
-
-   ossim_uint32 starting_strip = clip_rect.ul().y /
-      theRowsPerStrip[theCurrentDirectory];
-   ossim_uint32 ending_strip   = clip_rect.lr().y /
-      theRowsPerStrip[theCurrentDirectory];
-   ossim_uint32 strip_width    = theImageWidth[theCurrentDirectory]*4;   
-   ossim_uint32 output_tile_offset = (clip_rect.ul().y - tile_rect.ul().y) *
-                                OUTPUT_TILE_WIDTH + clip_rect.ul().x -
-                                tile_rect.ul().x;
-
-#if 0 /* Please keep for debug: */
-   CLOG << "DEBUG:"
-        << "\nsamples:         " << theSamplesPerPixel
-        << "\ntile_rect:       " << tile_rect
-        << "\nclip_rect:       " << clip_rect
-        << "\nstarting_strip:  " << starting_strip
-        << "\nending_strip:    " << ending_strip
-        << "\nstrip_width:     " << strip_width
-        << "\noutput_tile_offset:  " << output_tile_offset
-        << endl;
-#endif
-   
-   //***
-   // Get the pointers positioned at the first valid pixel in the buffers.
-   // s = source
-   // d = destination
-   //***
-   ossim_uint32 band;
-
-   ossim_uint8** d = new ossim_uint8*[theSamplesPerPixel];
-   for (band = 0; band < theSamplesPerPixel; band++)
-   {
-      d[band] = static_cast<ossim_uint8*>(result->getBuf(band))+output_tile_offset;
-   }
-
-   // Loop through strips...
-   for (ossim_uint32 strip=starting_strip; strip<=ending_strip; strip++)
-   {
-      if ( (theBufferRLevel != theCurrentDirectory) ||
-           ( clip_rect.completely_within( theBufferRect ) == false ) )
-      {
-         if (TIFFReadRGBAStrip(theTiffPtr,
-                               (strip*theRowsPerStrip[theCurrentDirectory]),
-                               (uint32*)theBuffer) == 0) // use tiff typedef
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " Error reading strip!" <<endl;
-            delete [] d;
-            return false;
-         }
-
-         // Capture rect and rlevel of buffer:
-         theBufferRLevel = theCurrentDirectory;
-         theBufferRect = ossimIrect(
-            0,
-            starting_strip,
-            theImageWidth[theCurrentDirectory]-1,
-            (ending_strip-starting_strip) ? (ending_strip-starting_strip) *
-            theRowsPerStrip[theCurrentDirectory] - 1 :
-            theRowsPerStrip[theCurrentDirectory] - 1 );
-      }
-      
-      //***
-      // If the last strip is a partial strip then the first line of the
-      // strip will be the last line of the image.
-      //***
-      ossim_uint32 last_line = theImageLength[theCurrentDirectory] - 1;
-
-      ossim_uint32 strip_offset
-         = ((strip * theRowsPerStrip[theCurrentDirectory]) +
-            theRowsPerStrip[theCurrentDirectory] - 1) <
-         last_line ?  0 :
-         ((strip * theRowsPerStrip[theCurrentDirectory]) +
-          theRowsPerStrip[theCurrentDirectory] - 1) - last_line;
-
-      ossim_uint32 total_rows = theRowsPerStrip[theCurrentDirectory] -
-         strip_offset;
-      
-      for (ossim_uint32 row=0; row<total_rows; row++)
-      {
-         // Write the line if it's in the clip rectangle.
-         ossim_int32 current_line = strip * theRowsPerStrip[theCurrentDirectory]
-            + row;
-         if  (current_line >= clip_rect.ul().y &&
-              current_line <= clip_rect.lr().y)
-         {
-            //
-            // Position the stip pointer to the correct spot.
-            // 
-            // Note:
-            // A strip is organized from bottom to top and the raster buffer is
-            // orgainized from top to bottom so the lineBuf must be offset
-            // accordingly.
-            //
-            ossim_uint32* s = (ossim_uint32*)(theBuffer+ ((theRowsPerStrip[theCurrentDirectory] - row -
-                                                           strip_offset - 1) * strip_width + clip_rect.ul().x * 4));
-            
-            // Copy the data to the output buffer.
-            ossim_uint32 i=0;
-                                                 
-            for (int32 sample=clip_rect.ul().x;
-                 sample<=clip_rect.lr().x;
-                 sample++)
-            {
-               d[0][i] = OSSIM_TIFF_UNPACK_R4(*s);
-               d[1][i] = OSSIM_TIFF_UNPACK_G4(*s);
-               d[2][i] = OSSIM_TIFF_UNPACK_B4(*s);
-               ++i;
-               ++s;
-            }
-
-            for (band = 0; band < theSamplesPerPixel; band++)
-            {
-               d[band] += OUTPUT_TILE_WIDTH;
-            }
-         }
-      }  // End of loop through rows in a strip.
-
-   }  // End of loop through strips.
-
-   delete [] d;
-               
-   return true;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-bool ossimTiffTileSource::loadFromRgbaU8aStrip(const ossimIrect& tile_rect,
-                                               const ossimIrect& clip_rect,
-                                               ossimImageData* result)
-{
-   static const char MODULE[] = "ossimTiffTileSource::loadFromRgbaU8aStrip";
-
-   //***
-   // Specialized for one bit data to handle null values.
-   //***
-   const ossim_uint32 OUTPUT_TILE_WIDTH = result->getWidth();
-   const ossim_uint8 NULL_PIX = static_cast<ossim_uint8>(result->getNullPix(0));
-   const ossim_uint8 MIN_PIX  = static_cast<ossim_uint8>(result->getMinPix(0));
-
-   if (theSamplesPerPixel > 4 || theBytesPerPixel!= 1)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " Error:"
-         << "\nInvalid number of bands or bytes per pixel!" << endl;
-   }
-   
-   //***
-   // Calculate the number of strips to read.
-   //***
-   ossim_uint32 starting_strip = clip_rect.ul().y /
-        theRowsPerStrip[theCurrentDirectory];
-   ossim_uint32 ending_strip   = clip_rect.lr().y /
-      theRowsPerStrip[theCurrentDirectory];
-   ossim_uint32 output_tile_offset = (clip_rect.ul().y - tile_rect.ul().y) *
-                                OUTPUT_TILE_WIDTH + clip_rect.ul().x -
-                                tile_rect.ul().x;
-
-#if 0
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\ntile_rect:       " << tile_rect
-           << "\nclip_rect:       " << clip_rect
-           << "\nstarting_strip:  " << starting_strip
-           << "\nending_strip:    " << ending_strip
-           << "\nstrip_width:     " << strip_width
-           << "\noutput_tile_offset:     " << output_tile_offset
-           << "\nsamples:         " << theSamplesPerPixel
-           << endl;
-   }
-#endif
-   
-   //***
-   // Get the pointers positioned at the first valid pixel in the buffers.
-   // s = source
-   // d = destination
-   //***
-   ossim_uint32 band;
-
-   ossim_uint8** d = new ossim_uint8*[theSamplesPerPixel];
-   for (band = 0; band < theSamplesPerPixel; band++)
-   {
-      d[band] = static_cast<ossim_uint8*>(result->getBuf(band))+output_tile_offset;
-   }
-
-   // Loop through strips...
-   for (ossim_uint32 strip=starting_strip; strip<=ending_strip; strip++)
-   {
-      if (TIFFReadRGBAStrip(theTiffPtr,
-                            (strip*theRowsPerStrip[theCurrentDirectory]),
-                            (uint32*)theBuffer) == 0) // use tiff typedef
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " Error reading strip!" <<endl;
-         delete [] d;
-         return false;
-      }
-
-      //***
-      // If the last strip is a partial strip then the first line of the
-      // strip will be the last line of the image.
-      //***
-      ossim_uint32 last_line = theImageLength[theCurrentDirectory] - 1;
-
-      ossim_uint32 strip_offset
-         = ((strip * theRowsPerStrip[theCurrentDirectory]) +
-            theRowsPerStrip[theCurrentDirectory] - 1) < last_line ?  0 :
-         ((strip * theRowsPerStrip[theCurrentDirectory]) +
-          theRowsPerStrip[theCurrentDirectory] - 1) - last_line;
-
-      ossim_uint32 total_rows = theRowsPerStrip[theCurrentDirectory] -
-         strip_offset;
-      
-      for (ossim_uint32 row=0; row<total_rows; row++)
-      {
-         // Write the line if it's in the clip rectangle.
-         ossim_int32 current_line = strip * theRowsPerStrip[theCurrentDirectory]
-            + row;
-         if  (current_line >= clip_rect.ul().y &&
-              current_line <= clip_rect.lr().y)
-         {
-            //***
-            // Position the stip pointer to the correct spot.
-            // 
-            // Note:
-            // A strip is organized from bottom to top and the raster buffer is
-            // orgainized from top to bottom so the lineBuf must be offset
-            // accordingly.
-            //***
-            ossim_uint8* s = theBuffer;
-            s += (theRowsPerStrip[theCurrentDirectory] - row -
-                  strip_offset - 1) *
-                 theImageWidth[theCurrentDirectory] * 4 +
-                 clip_rect.ul().x * 4;
-            
-            // Copy the data to the output buffer.
-            ossim_uint32 i=0;
-            ossim_uint32 j=0;
-            for (int32 sample=clip_rect.ul().x;
-                 sample<=clip_rect.lr().x;
-                 sample++)
-            {
-               for (band = 0; band < theSamplesPerPixel; band++)
-               {
-                  ossim_uint8 pix = s[j + band];
-                  d[band][i] = pix != NULL_PIX ? pix : MIN_PIX;
-               }
-               ++i;
-               j += 4;
-            }
-
-            for (band = 0; band < theSamplesPerPixel; band++)
-            {
-               d[band] += OUTPUT_TILE_WIDTH;
-            }
-         }
-      }  // End of loop through rows in a strip.
-
-   }  // End of loop through strips.
-
-   delete [] d;
-               
-   return true;
-   
-} // End: ossimTiffTileSource::loadFromRgbaU8aStrip( ... )
-
-bool ossimTiffTileSource::loadFromU16Strip( const ossimIrect& clip_rect, ossimImageData* result )
-{
-   bool status = true;
-   
-   // Calculate the strips to read.
-   ossim_uint32 starting_strip = clip_rect.ul().y / theRowsPerStrip[theCurrentDirectory];
-   ossim_uint32 ending_strip   = clip_rect.lr().y / theRowsPerStrip[theCurrentDirectory];
-
-   ossim_uint32 stripsPerBand = theImageLength[theCurrentDirectory] /
-      theRowsPerStrip[theCurrentDirectory];
-   if ( theImageLength[theCurrentDirectory] % theRowsPerStrip[theCurrentDirectory] )
-   {
-      ++stripsPerBand;
-   }
-   
-   // Loop through strips....
-   for ( ossim_uint32 strip = starting_strip; strip <= ending_strip; ++strip )
-   {
-      if ( (theBufferRLevel != theCurrentDirectory) ||
-           !clip_rect.completely_within(theBufferRect) )
-      {
-         // Fill buffer block:
-         
-         ossim_uint32 linesInStrip = theRowsPerStrip[theCurrentDirectory];
-         
-         // If last strip and not filling entirely memset it.
-         if ( strip == ( stripsPerBand - 1 ) )
-         {
-            // Last strip of image. Strip may be clipped to end of image.
-            linesInStrip = theImageLength[theCurrentDirectory] %
-               theRowsPerStrip[theCurrentDirectory];
-         }
-
-         ossim_uint32 bytesPerStrip = linesInStrip * theImageWidth[theCurrentDirectory] * 2;
-                  
-         // TIFFReadEncodedStrip takes signed int32 arg.
-         ossim_int32 bytesToRead = (ossim_int32)bytesPerStrip;
-         
-         ossim_uint32 startY = strip * theRowsPerStrip[theCurrentDirectory];
-         
-         // Need to read in the strip data:
-         ossim_uint32 bufferOffsetInBytes = 0;
-         
-         for (ossim_uint32 band = 0; band < theSamplesPerPixel; ++band)
-         {
-            ossim_uint32 bandStrip = strip + band * stripsPerBand;
-            
-            //---
-            // TIFFReadEncodedStrip does byte swapping for us.
-            // -1 says to read entire strip.
-            // Return of -1 is error.
-            //---
-            ossim_int32 bytesRead = TIFFReadEncodedStrip( theTiffPtr,
-                                                          bandStrip,
-                                                          theBuffer+bufferOffsetInBytes,
-                                                          bytesToRead );
-           if ( bytesRead != bytesToRead )
-            {
-               if(traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << "ossimTiffTileSource::loadFromU16Strip Read Error!"
-                     << "\nReturning error...  " << endl;
-               }
-               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-               status = false;
-               result->makeBlank();
-               break;
-            }
-            bufferOffsetInBytes += bytesPerStrip;
-         }
-         
-         if ( status )
-         {
-            // Capture rect and rlevel of buffer:
-            theBufferRLevel = theCurrentDirectory;
-            theBufferRect = ossimIrect( 0,
-                                        startY,
-                                        theImageWidth[theCurrentDirectory] - 1,
-                                        startY + linesInStrip - 1);
-         }
-         
-      } // End: Fill buffer block.
-      
-      if ( status )
-      {
-         result->loadTile(theBuffer, theBufferRect, OSSIM_BSQ);
-      }
-      
-   } // End of strip loop.
-   
-   return status;
-   
-} // End: ossimTiffTileSource::loadFromU16Strip( ... )
-
-void ossimTiffTileSource::adjustToStartOfTile(ossimIpt& pt) const
-{
-   //***
-   // Notes:
-   // - Assumes an origin of (0,0)
-   // - Shifts in to the upper left direction.
-   //***
-   ossim_int32 tw =
-      static_cast<ossim_int32>(theImageTileWidth[theCurrentDirectory]);
-   ossim_int32 th =
-      static_cast<ossim_int32>(theImageTileLength[theCurrentDirectory]);
-   
-   if (pt.x > 0)
-   {
-      pt.x = (pt.x/tw) * tw;
-   }
-   else if (pt.x < 0)
-   {
-      pt.x = std::abs(pt.x) < tw ? -tw : (pt.x/tw)*tw;
-   }
-
-   if (pt.y > 0)
-   {
-      pt.y = (pt.y/th) * th;
-   }
-   else if (pt.y < 0)
-   {
-      pt.y = std::abs(pt.y) < th ? -th : (pt.y/th)*th;
-   }
-}
-
-bool ossimTiffTileSource::isValidRLevel(ossim_uint32 resLevel) const
-{
-   bool result = false;
-   
-   const ossim_uint32 LEVELS = getNumberOfDecimationLevels();
-
-   //---
-   // If we have r0 our reslevels are the same as the callers so
-   // no adjustment necessary.
-   //---
-   if ( !theStartingResLevel || theR0isFullRes) // Not an overview or has r0.
-   {
-      result = (resLevel < LEVELS);
-   }
-   else if (resLevel >= theStartingResLevel) // Used as overview.
-   {
-      result = ( (resLevel - theStartingResLevel) < LEVELS);
-   }
-   
-   return result;
-}
-
-ossim_uint32 ossimTiffTileSource::getCurrentTiffRLevel() const
-{
-   return theCurrentTiffRlevel;
-//   return theCurrentDirectory;
-}
-
-ossimString ossimTiffTileSource::getReadMethod(ossim_uint32 directory) const
-{
-   ossimString result = "UNKNOWN";
-   if ( directory < theReadMethod.size() )
-   {
-      switch (theReadMethod[directory])
-      {
-         case READ_RGBA_U8_TILE:
-            result = "READ_RGBA_U8_TILE";
-            break;
-         case READ_RGBA_U8_STRIP:
-            result = "READ_RGBA_U8_STRIP";
-            break;
-         case READ_RGBA_U8A_STRIP:
-            result = "READ_RGBA_U8A_STRIP";
-            break;
-         case READ_SCAN_LINE:
-            result = "READ_SCAN_LINE";
-            break;
-         case READ_TILE:
-            result = "READ_TILE";
-            break;
-         case UNKNOWN:
-         default:
-            break;
-      }
-   }
-   return result;
-}      
-
-ossim_uint32 ossimTiffTileSource::getNumberOfDirectories() const
-{
-   return theNumberOfDirectories;
-}
-
-ossim_uint32 ossimTiffTileSource::getImageTileWidth() const
-{
-   ossim_uint32 result = 0;
-   if(isOpen())
-   {
-      if(theCurrentDirectory < theImageTileWidth.size())
-      {
-         result = theImageTileWidth[theCurrentDirectory];
-      }
-   }   
-   return result;
-}
-
-ossim_uint32 ossimTiffTileSource::getImageTileHeight() const
-{
-   ossim_uint32 result = 0;
-   if(isOpen())
-   {
-      if(theCurrentDirectory < theImageTileLength.size())
-      {
-         result = theImageTileLength[theCurrentDirectory];
-      }
-   }
-   return result;
-}
-
-ossim_uint32 ossimTiffTileSource::getTileWidth() const
-{
-   ossim_uint32 result = getImageTileWidth();
-   if (!result)
-   {
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-      result = tileSize.x;
-   }
-   return result;
-}
-
-ossim_uint32 ossimTiffTileSource::getTileHeight() const
-{
-   ossim_uint32 result = getImageTileHeight();
-   if (!result)
-   {
-      ossimIpt tileSize;
-      ossim::defaultTileSize(tileSize);
-      result = tileSize.y;
-   }
-   return result;
-}
-
-void ossimTiffTileSource::setApplyColorPaletteFlag(bool flag)
-{
-   theApplyColorPaletteFlag = flag;
-   
-   if(isColorMapped())
-   {
-      if(theApplyColorPaletteFlag)
-      {
-         thePhotometric[0] = PHOTOMETRIC_PALETTE;
-         theSamplesPerPixel = 3;
-      }
-      else
-      {
-         thePhotometric[0] = PHOTOMETRIC_MINISBLACK;
-         theSamplesPerPixel = 1; 
-      }
-      
-      setReadMethod();
-
-      theTile = 0;
-      if (theBuffer)
-      {
-         delete [] theBuffer;
-         theBuffer = 0;
-      }
-   }
-}
-
-bool ossimTiffTileSource::getApplyColorPaletteFlag()const
-{
-   return theApplyColorPaletteFlag;
-}
-
-ossimString ossimTiffTileSource::getLongName()const
-{
-   return ossimString("TIFF Image Handler");
-}
-
-ossimString ossimTiffTileSource::getShortName()const
-{
-   return ossimString("ossim_tiff");
-}
-
-std::ostream& ossimTiffTileSource::print(std::ostream& os) const
-{
-   //***
-   // Use a keyword format.
-   //***
-   os << "image_file:                    " << theImageFile
-      << "\nsamples_per_pixel:           " << theSamplesPerPixel
-      << "\nbits_per_sample:             " << theBitsPerSample
-      << "\nsample_format_unit:          " << theSampleFormatUnit
-      << "\nmin_sample_value:            " << theMinSampleValue
-      << "\nmax_sample_value:            " << theMaxSampleValue
-      << "\nnull_sample_value:           " << theNullSampleValue
-      << "\ntheNumberOfDirectories:      " << theNumberOfDirectories
-      << "\nr0_is_full_res:              " << theR0isFullRes;
-
-   
-   for (ossim_uint32 i=0; i<theNumberOfDirectories; ++i)
-   {
-      os << "\ndirectory[" << i << "]"
-         << "\nimage width:     " << theImageWidth[i]
-         << "\nimage_length:    " << theImageLength[i]
-         << "\nread method:     " << getReadMethod(i).c_str()
-         << "\nplanar:          " << thePlanarConfig[i]
-         << "\nphotometric:     " << thePhotometric[i];
-      if (theRowsPerStrip[i])
-      {
-         os << "\nrows per strip:  " << theRowsPerStrip[i];
-      }
-      if (theImageTileWidth[i])
-      {
-         os << "\ntile_width:      " << theImageTileWidth[i];
-      }
-      if (theImageTileLength[i])
-      {
-         os << "\ntile_length:     " << theImageTileLength[i];
-      }
-      os << endl;
-   }
-
-   if (theTile.valid())
-   {
-      os << "\nOutput tile dump:\n" << *theTile << endl;
-   }
-
-   if (theOverview.valid())
-   {
-      os << "\nOverview file:\n";
-      theOverview->print(os);
-   }
-
-   os << endl;
-   
-   return ossimSource::print(os);
-}
-
-ossim_uint32 ossimTiffTileSource::getNumberOfInputBands() const
-{
-   return theSamplesPerPixel;
-}
-
-ossim_uint32 ossimTiffTileSource::getNumberOfOutputBands () const
-{
-   ossim_uint32 bands = theOutputBandList.size();
-   if ( !bands )
-   {
-      bands = getNumberOfInputBands();
-   }
-   return bands;
-}
-
-bool ossimTiffTileSource::isBandSelector() const
-{
-   bool result = false;
-   if ( isOpen() && theReadMethod.size() && ( theReadMethod.size() == thePlanarConfig.size() ) )
-   {
-      // Tiled band separate currently is only coded to be band selector.
-      result = true;
-      for ( ossim_uint32 i = 0; i < theReadMethod.size(); ++i )
-      {
-         if ( ( theReadMethod[i] != READ_TILE ) ||
-              ( thePlanarConfig[i] == PLANARCONFIG_CONTIG ) )
-         {
-            result = false;
-            break;
-         }
-      }
-      if ( result && theOverview.valid() )
-      {
-         result = theOverview->isBandSelector();
-      }
-   }
-   return result;
-}
-
-bool ossimTiffTileSource::setOutputBandList(const std::vector<ossim_uint32>& band_list)
-{
-   bool result = false;
-   if ( isBandSelector() )
-   {
-      // Making a copy as passed in list could be our m_outputBandList.
-      std::vector<ossim_uint32> inputList = band_list;
-      result = ossimImageHandler::setOutputBandList( inputList, theOutputBandList );
-      if ( result && theTile.valid() )
-      {
-         if ( theTile->getNumberOfBands() != theOutputBandList.size() )
-         {
-            theTile = 0; // Force a reinitialize on next getTile.
-         }
-      }
-   }
-   return result;
-}
-
-void ossimTiffTileSource::getOutputBandList(std::vector<ossim_uint32>& bandList) const
-{
-   if ( theOutputBandList.size() )
-   {
-      bandList = theOutputBandList;
-   }
-   else
-   {
-      ossimImageSource::getOutputBandList( bandList );
-   }
-}
-
-bool ossimTiffTileSource::isOpen()const
-{
-   return (theTiffPtr!=NULL);
-}
-
-bool ossimTiffTileSource::hasR0() const
-{
-   return theR0isFullRes;
-}
-
-ossim_float64 ossimTiffTileSource::getMinPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return ossimImageHandler::getMinPixelValue(band);
-   }
-   return theMinSampleValue;
-}
-
-ossim_float64 ossimTiffTileSource::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return ossimImageHandler::getMaxPixelValue(band);
-   }
-   return theMaxSampleValue;
-}
-
-ossim_float64 ossimTiffTileSource::getNullPixelValue(ossim_uint32 band)const
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return ossimImageHandler::getNullPixelValue(band);
-   }
-   return theNullSampleValue;
-}
-
-bool ossimTiffTileSource::isColorMapped() const
-{
-   bool result = false;
-   if ( isOpen() )
-   {
-      uint16* red;
-      uint16* green;
-      uint16* blue;
-      
-      result = static_cast<bool>(TIFFGetField(theTiffPtr,
-                                              TIFFTAG_COLORMAP,
-                                              &red, &green, &blue));
-   }
-   return result;
-}
-
-void ossimTiffTileSource::setReadMethod()
-{
-   for (ossim_uint32 dir=0; dir<theNumberOfDirectories; ++dir)
-   {
-      if (setTiffDirectory(dir) == false)
-      {
-         return;
-      }
-      
-      //---
-      // Establish how this tiff directory will be read.
-      //---
-      if (TIFFIsTiled(theTiffPtr)) 
-      {
-         if ( ( thePhotometric[dir] == PHOTOMETRIC_YCBCR ||
-                thePhotometric[dir] == PHOTOMETRIC_PALETTE ) &&
-              (theSamplesPerPixel <= 3) &&
-              (theBitsPerSample   <= 8 ))
-         {
-            theReadMethod[dir] = READ_RGBA_U8_TILE;
-         }
-         else
-         {
-            theReadMethod[dir] = READ_TILE;
-         }
-      }
-      else // Not tiled...
-      {
-         if ( (thePhotometric[dir] == PHOTOMETRIC_PALETTE ||
-               thePhotometric[dir] == PHOTOMETRIC_YCBCR ) &&
-              theSamplesPerPixel <= 3 &&
-              theBitsPerSample   <= 8 )
-         {
-            theReadMethod[dir] = READ_RGBA_U8_STRIP;
-         }
-         else if (( theBitsPerSample == 16 ) &&
-                  ( theRowsPerStrip[dir] > 1 ) &&
-                  (( thePlanarConfig[dir] == PLANARCONFIG_SEPARATE ) ||
-                    ((thePlanarConfig[dir] == PLANARCONFIG_CONTIG) && (theSamplesPerPixel==1))))
-         {
-            // Buffer a strip of bands.
-            theReadMethod[dir] = READ_U16_STRIP;
-         }
-         else if (theSamplesPerPixel <= 3 && theBitsPerSample == 1)
-         {
-            //---
-            // Note:  One bit data expands to zeroes and 255's so run it through
-            //        a specialized method to flip zeroes to one's since zeroes
-            //        are usually reserved for null value.
-            //---
-            theReadMethod[dir] = READ_RGBA_U8A_STRIP;
-         }
-         else if((theCompressionType == COMPRESSION_NONE)||
-                 (theRowsPerStrip[dir]==1))
-         {
-            theReadMethod[dir] = READ_SCAN_LINE;
-         }
-         else if((theCompressionType!=COMPRESSION_NONE)&&
-                 (theSamplesPerPixel <= 4) &&
-                 (theBitsPerSample   <= 8) )
-         {
-            theReadMethod[dir] = READ_RGBA_U8_STRIP;
-         }
-         else
-         {
-            theReadMethod[dir] = UNKNOWN;
-         }
-      }
-      
-   } // End of loop through directories.
-
-   // Reset the directory back to "0".
-   setTiffDirectory(0);
-}
-
-void ossimTiffTileSource::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid())
-   {
-      return;
-   }
-   if(property->getName() == "apply_color_palette_flag")
-   {
-      // Assuming first directory...
-      setApplyColorPaletteFlag(property->valueToString().toBool());
-   }
-   else
-   {
-      ossimImageHandler::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimTiffTileSource::getProperty(const ossimString& name)const
-{
-   if(name == "apply_color_palette_flag")
-   {
-      ossimBooleanProperty* property = new ossimBooleanProperty("apply_color_palette_flag",
-                                                                theApplyColorPaletteFlag);
-      property->clearChangeType();
-      property->setFullRefreshBit();
-      return property;
-   }
-   else if(name == "file_type")
-	{
-		return new ossimStringProperty(name, "TIFF");
-	}
-	
-   return ossimImageHandler::getProperty(name);
-}
-
-void ossimTiffTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimImageHandler::getPropertyNames(propertyNames);
-   propertyNames.push_back("file_type");
-   propertyNames.push_back("apply_color_palette_flag");
-}
-
-bool ossimTiffTileSource::setTiffDirectory(ossim_uint16 directory)
-{
-   bool status = true;
-   theCurrentTiffRlevel = 0;
-   if (theCurrentDirectory != directory)
-   {
-      status = TIFFSetDirectory(theTiffPtr, directory);
-      if (status == true)
-      {
-         theCurrentDirectory = directory;
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimTiffTileSource::setTiffDirectory ERROR setting directory "
-               << directory << "!" << endl;
-         }
-      }
-   }
-   
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx<theImageDirectoryList.size();++idx)
-   {
-      if(theImageDirectoryList[idx] == directory)
-      {
-         theCurrentTiffRlevel = idx;
-         break;
-      }
-   }
-   return status;
-}
-
-void ossimTiffTileSource::populateLut()
-{
-   ossim_uint16* r;
-   ossim_uint16* g;
-   ossim_uint16* b;
-   if(TIFFGetField(theTiffPtr, TIFFTAG_COLORMAP, &r, &g, &b))
-   {
-      ossim_uint32 numEntries = 256;
-      ossimScalarType scalarType = OSSIM_UINT8;
-      if(theBitsPerSample == 16)
-      {
-         numEntries = 65536;
-         scalarType = OSSIM_UINT16;
-      }
-      theLut = new ossimNBandLutDataObject(numEntries,
-                                           3,
-                                           scalarType,
-                                           0);
-      ossim_uint32 entryIdx = 0;
-      for(entryIdx = 0; entryIdx < numEntries; ++entryIdx)
-      {
-         if(scalarType == OSSIM_UINT8)
-         {
-            (*theLut)[entryIdx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(((*r)/65535.0)*255.0);
-            (*theLut)[entryIdx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(((*g)/65535.0)*255.0);
-            (*theLut)[entryIdx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(((*b)/65535.0)*255.0);
-         }
-         else
-         {
-            (*theLut)[entryIdx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(*r);
-            (*theLut)[entryIdx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(*g);
-            (*theLut)[entryIdx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(*b);
-         }
-         ++r;++g;++b;
-      }
-   }
-}
-
-void ossimTiffTileSource::validateMinMaxNull()
-{
-   ossim_float64 tempNull = ossim::defaultNull(theScalarType);
-   ossim_float64 tempMax  = ossim::defaultMax(theScalarType);
-   ossim_float64 tempMin  = ossim::defaultMin(theScalarType);
-   
-   if( (theMinSampleValue == tempNull) || ossim::isnan(theMinSampleValue) ) 
-   {
-      theMinSampleValue = tempMin;
-   }
-   if( (theMaxSampleValue == tempNull) || ossim::isnan(theMaxSampleValue) )
-   {
-      theMaxSampleValue = tempMax;
-   }
-   if ( ossim::isnan(theNullSampleValue) )
-   {
-      theNullSampleValue = tempNull;
-   }
-
-   if (theScalarType == OSSIM_FLOAT32)
-   {
-      std::ifstream inStr(theImageFile.c_str(), std::ios::in|std::ios::binary);
-      if ( inStr.good() )
-      {   
-         // Do a print to a memory stream in key:value format.
-         ossimTiffInfo ti;
-         ossimIOMemoryStream memStr;
-         ti.print(inStr, memStr);
-
-         // Make keywordlist with all the tags.
-         ossimKeywordlist gtiffKwl;
-         if ( gtiffKwl.parseStream(memStr) )
-         {
-#if 0 /* Please keep for debug. (drb) */
-            if ( traceDebug() )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimTiffTileSource::validateMinMaxNull kwl:\n" << gtiffKwl
-                  << endl;
-            }
-#endif
-            const char* lookup;
-
-            lookup = gtiffKwl.find("tiff.image0.gdal_nodata");
-            bool nullFound = false;
-            if ( lookup )
-            {
-               ossimString os = lookup;
-               theNullSampleValue = os.toFloat32();
-               nullFound = true;
-            }
-            lookup = gtiffKwl.find("tiff.image0.vertical_citation");
-            if ( lookup )
-            {     
-               //---
-               // Format of string this handles:
-               // "Null: -9999.000000, Non-Null Min: 12.428605, 
-               // Non-Null Avg: 88.944082, Non-Null Max: 165.459558|"
-               ossimString citation = lookup;
-               std::vector<ossimString> array;
-               citation.split( array, ossimString(",") );
-               if ( array.size() == 4 )
-               {
-                  std::vector<ossimString> array2;
-
-                  if ( !nullFound )
-                  {
-                     // null
-                     array[0].split( array2, ossimString(":") );
-                     if ( array2.size() == 2 )
-                     {
-                        ossimString os = array2[0].downcase();
-                        if ( os.contains( ossimString("null") ) )
-                        {
-                           if ( array2[1].size() )
-                           {
-                              theNullSampleValue = array2[1].toFloat64(); 
-                              nullFound = true;
-                           }
-                        }
-                     }
-                  }
-
-                  // min
-                  array2.clear();
-                  array[1].split( array2, ossimString(":") );
-                  if ( array2.size() == 2 )
-                  {  
-                     ossimString os = array2[0].downcase();
-                     if ( os.contains( ossimString("min") ) )
-                     {
-                        if ( array2[1].size() )
-                        {
-                           theMinSampleValue = array2[1].toFloat64();
-                        }
-                     }
-                  }
-
-                  // Skipping average.
-
-                  // max
-                  array2.clear();
-                  array[3].split( array2, ossimString(":") );
-                  if ( array2.size() == 2 )
-                  {
-                     ossimString os = array2[0].downcase();
-                     if ( os.contains( ossimString("max") ) )
-                     {
-                        if ( array2[1].size() )
-                        {
-                           array2[1].trim( ossimString("|") );
-                           theMaxSampleValue = array2[1].toFloat64();   
-                        }
-                     }
-                  }
-               }
-            }
-         }
-      }
-   }
-}
-
-#if 0
-ossimImageGeometry* ossimTiffTileSource::getImageGeometry()
-{
-   //---
-   // Call base class getImageGeometry which will check for external geometry
-   // or an already set geometry.
-   //---
-   ossimImageGeometry* result = ossimImageHandler::getImageGeometry();
-
-   if (result)
-   {
-      //---
-      // TODO: Add transform from tags.
-      //---
-
-      
-      // if ( !result->getTransform() )
-      // {
-      //    if ( transform.valid() )
-      //    {
-      //       result->setTransform( transform.get() );
-      //    }
-      // }
-      //else
-      //{
-      //   ossimImageGeometryRegistry::instance()->createTransform(this);
-      //}
-      
-      if ( !result->getProjection() )
-      {
-         // Get the projection from the tags.
-         
-         ossimRefPtr<ossimProjection> proj = 0;
-
-         if (theTiffPtr)
-         {
-            ossimGeoTiff geotiff;
-
-            //---
-            // Note: must pass false to readTags so it doesn't close our
-            // tiff pointer.
-            //---
-            geotiff.readTags(theTiffPtr, getCurrentEntry(), false);
-            ossimKeywordlist kwl;
-            if(geotiff.addImageGeometry(kwl))
-            {
-               proj = ossimProjectionFactoryRegistry::instance()->
-                  createProjection(kwl);
-            }
-            
-            if ( proj.valid() )
-            {
-               result->setProjection( proj.get() );
-            }
-            //else
-            //{
-            // ossimImageGeometryRegistry::instance()->createProjection(this);
-            //}
-         }
-      }
-      
-   } // matches: if (result)
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffTileSource::createImageGeometry DEBUG:\n";
-
-      if (result)
-      {
-         result->print(ossimNotify(ossimNotifyLevel_DEBUG)) << "\n";
-      }
-   }
-
-   return result;
-}
-#endif
-
-bool ossimTiffTileSource::isPowerOfTwoDecimation(ossim_uint32 level) const
-{
-   // Check size of this level against last level to see if it's half the previous.
-   bool result = false;
-   if ( (level > 0) && ( theImageWidth.size() > level ) && ( theImageLength.size() > level ) )
-   {
-      ossim_uint32 i = level-1; // previous level
-      
-      if ( ( ( theImageWidth[i]/2 == theImageWidth[level] ) ||
-             ( (theImageWidth[i]+1)/2 == theImageWidth[level] ) ) &&
-           ( ( theImageLength[i]/2 == theImageLength[level] ) ||
-             ( (theImageLength[i]+1)/2 == theImageLength[level] ) ) )
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-void ossimTiffTileSource::allocateTile()
-{
-   theTile = 0;
-   ossim_uint32 bands = 0;
-   if ( theOutputBandList.empty() )
-   {
-      bands = getNumberOfOutputBands();
-   }
-   else
-   {
-      bands = theOutputBandList.size();
-   }
-
-   if ( bands )
-   {
-      theTile = ossimImageDataFactory::instance()->create( this, getOutputScalarType(), bands );
-      if ( theTile.valid() )
-      {
-         theTile->initialize();
-         
-         // The width and height mus be set prior to call to allocateBuffer.
-         theCurrentTileWidth  = theTile->getWidth();
-         theCurrentTileHeight = theTile->getHeight();
-      }
-   }
-}
-
-bool ossimTiffTileSource::allocateBuffer()
-{
-   bool bSuccess = true;
-   // Allocate memory for a buffer to hold data grabbed from the tiff file.
-   ossim_uint32 buffer_size=0;
-   switch (theReadMethod[theCurrentDirectory])
-   {
-      case READ_RGBA_U8_TILE:
-      {
-         buffer_size = theImageTileWidth[theCurrentDirectory]*
-            theImageTileWidth[theCurrentDirectory]*theBytesPerPixel*4;
-         break;
-      }  
-      case READ_TILE:
-      {
-         if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
-         {
-            buffer_size = theImageTileWidth[theCurrentDirectory] *
-               theImageTileLength[theCurrentDirectory] *
-               theBytesPerPixel * theSamplesPerPixel;
-         }
-         else
-         {
-            buffer_size = theImageTileWidth[theCurrentDirectory] *
-               theImageTileLength[theCurrentDirectory] *
-               theBytesPerPixel;
-         }
-         break;
-      }  
-      case READ_RGBA_U8_STRIP:
-      case READ_RGBA_U8A_STRIP:
-      {
-         buffer_size = theImageWidth[0]*theRowsPerStrip[theCurrentDirectory]*
-            theBytesPerPixel*4;
-         break;
-      } 
-      case READ_U16_STRIP:
-      {
-//         std::cout << "DOING READ_U16_STRIP\n";
-         // Encountered case where it was multiple rows per strip, yet PLANARCONFIG_CONTIG. The
-         // case was in fact single band so planar config is irrelevant. (OLK July 2015)
-         
-         // I put the multiplication back in for the theSamplesPerPixel.  In the read method that is used for this
-         // it populates this buffer with all bands and then uses the load method on the image data object.
-         // so all bands has to be populated for the buffer. (GCP Sept 2015)
-         buffer_size = theImageWidth[0]*theRowsPerStrip[theCurrentDirectory]*theBytesPerPixel*
-                       theSamplesPerPixel;
-//         std::cout << "ROWS PER STRIP: " << theRowsPerStrip[theCurrentDirectory] << "\n"
-//                   << "ImageWidth:     " << theImageWidth[0] << "\n"
-//                   << "BytesPerPixel:  " << theBytesPerPixel << "\n";
-//         std::cout << thePlanarConfig[theCurrentDirectory] << " ==== " << PLANARCONFIG_CONTIG << "\n";
-
-         // I commented this out for this is core dumping for one of the tiff images. (GCP Sept 2015)
-        // if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
-          //  buffer_size *= theSamplesPerPixel;
-         break;
-      }
-      case READ_SCAN_LINE:
-      {
-#if OSSIM_BUFFER_SCAN_LINE_READS
-         // Buffer a image width by tile height.
-         buffer_size = theImageWidth[0] * theBytesPerPixel *
-            theSamplesPerPixel * theCurrentTileHeight;
-#else
-         buffer_size = theImageWidth[0] * theBytesPerPixel * theSamplesPerPixel;
-#endif
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Unknown read method!" << endl;
-         print(ossimNotify(ossimNotifyLevel_WARN));
-         bSuccess = false;
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiffTileSource::allocateBuffer DEBUG:"
-         << "\nbuffer_size:  " << buffer_size
-         << endl;
-   }
-
-   theBufferRect.makeNan();
-   theBufferRLevel = theCurrentDirectory;
-
-   if ( bSuccess && ( buffer_size != theBufferSize ) )
-   {
-      theBufferSize = buffer_size;
-      if (theBuffer)
-      {
-         delete [] theBuffer;
-      }
-
-      // ESH 05/2009 -- Fix for ticket #738:  
-      // image_info crashing on aerial_ortho image during ingest
-      try
-      {
-         theBuffer = new ossim_uint8[buffer_size];
-      }
-      catch(...)
-      {
-         theBuffer = 0;
-         bSuccess = false;
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimTiffTileSource::allocateBuffer WARN:"
-               << "\nNot enough memory: buffer_size:  " << buffer_size
-               << endl;
-         }
-      }
-   }
-
-   return bSuccess;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTiffWriter.cpp b/ossim/src/ossim/imaging/ossimTiffWriter.cpp
deleted file mode 100644
index da321c0..0000000
--- a/ossim/src/ossim/imaging/ossimTiffWriter.cpp
+++ /dev/null
@@ -1,1741 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Frank Warmerdam (warmerda at home.com)
-//
-//*******************************************************************
-//  $Id: ossimTiffWriter.cpp 22942 2014-11-02 20:39:27Z gpotts $
-
-#include <ossim/ossimConfig.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimBooleanProperty.h>
-#include <ossim/base/ossimFilenameProperty.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimMapProjectionInfo.h>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimEpsgProjectionDatabase.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimStatePlaneProjectionInfo.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimFilenameProperty.h>
-#include <ossim/support_data/ossimGeoTiff.h>
-#include <ossim/imaging/ossimMemoryImageSource.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-
-#include <tiffio.h>
-#ifdef OSSIM_HAS_GEOTIFF
-#  if OSSIM_HAS_GEOTIFF
-#    include <xtiffio.h>
-#    include <geotiff.h>
-#    include <geo_normalize.h>
-#    include <geovalues.h>
-#  endif
-#endif
-
-#include <algorithm>
-#include <sstream>
-
-static ossimTrace traceDebug("ossimTiffWriter:debug");
-static const char* TIFF_WRITER_OUTPUT_TILE_SIZE_X_KW = "output_tile_size_x";
-static const char* TIFF_WRITER_OUTPUT_TILE_SIZE_Y_KW = "output_tile_size_y";
-static const int   PCS_BRITISH_NATIONAL_GRID = 27700;
-static const long  DEFAULT_JPEG_QUALITY = 75;
-
-RTTI_DEF1(ossimTiffWriter, "ossimTiffWriter", ossimImageFileWriter);
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimTiffWriter.cpp 22942 2014-11-02 20:39:27Z gpotts $";
-#endif
-
-ossimTiffWriter::ossimTiffWriter()
-   :
-      ossimImageFileWriter(),
-      theTif(NULL),
-      theCompressionType("none"),
-      theJpegQuality(DEFAULT_JPEG_QUALITY),
-      theOutputGeotiffTagsFlag(true),
-      theColorLutFlag(false),
-      theProjectionInfo(NULL),
-      theOutputTileSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT),
-      theForceBigTiffFlag(false),
-      theBigTiffFlag(false)
-{
-   theColorLut = new ossimNBandLutDataObject();
-   ossim::defaultTileSize(theOutputTileSize);
-   theOutputImageType = "tiff_tiled_band_separate";
-
-   
-#ifdef OSSIM_ID_ENABLED /* to quell unused variable warning. */
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
-   }
-#endif
-}
-
-ossimTiffWriter::~ossimTiffWriter()
-{
-   if(isOpen())
-   {
-      closeTiff();
-   }
-}
-
-bool ossimTiffWriter::openTiff()
-{
-   static const char* MODULE = "ossimTiffWriter::openTiff()";
-
-   bool status = false;
-   
-   // Close the existing file pointer.
-   closeTiff();
-
-   // Check for empty file name.
-   if ( theFilename.size() )
-   {
-      //---
-      // On windows libtiff can treat class tiff offsets as signed(2GB limit) or
-      // unsigned(4GB) so if even close to 2GB (2.1.47 GB) limit make a big tiff.
-      //---
-      const ossim_uint64 BIGTIFF_THRESHOLD = 2000000000;
-      ossimIrect bounds = theInputConnection->getBoundingRect();
-      ossim_uint64 byteCheck =
-         (static_cast<ossim_uint64>(bounds.width())*
-          static_cast<ossim_uint64>(bounds.height())*
-          static_cast<ossim_uint64>(theInputConnection->getNumberOfOutputBands())*
-          static_cast<ossim_uint64>(ossim::scalarSizeInBytes(theInputConnection->getOutputScalarType())));
-      
-      if( byteCheck > BIGTIFF_THRESHOLD )
-      {
-         theBigTiffFlag = true;
-      }
-      
-      ossimString openMode = "w";
-      if(theBigTiffFlag||theForceBigTiffFlag)
-      {
-         openMode += "8";
-      }
-      
-      // Open the new file.
-      theTif = XTIFFOpen( theFilename.c_str(), openMode.c_str() );
-      if ( theTif )
-      {
-         status = true;
-      }
-      else
-      {
-         setErrorStatus(); // base class
-         ossimSetError(getClassName().c_str(),
-                       ossimErrorCodes::OSSIM_ERROR,
-                       "File %s line %d Module %s Error:\n\
-Error opening file:  %s\n",
-                       __FILE__,
-                       __LINE__,
-                       MODULE,
-                       theFilename.c_str());
-      }
-   }
-   return status;
-}
-
-bool ossimTiffWriter::closeTiff()
-{
-   if (theTif)
-   {
-      XTIFFClose( (TIFF*)theTif );
-      theTif = NULL;
-   }
-   return true;
-}
-
-bool ossimTiffWriter::writeTiffTags()
-{
-   static const char MODULE[] = "ossimTiffWriter::writeTiffTags";
-   TIFF* tiffPtr = (TIFF*)theTif;
-   if (!tiffPtr)
-   {
-      setErrorStatus(); // base class
-      ossimSetError(getClassName().c_str(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "File %s line %d %s\nError:  Tiff pointer is null!\n\
-Call setFilename method.\n",
-                    __FILE__,
-                    __LINE__,
-                    MODULE);
-      return false;
-   }
-
-   //---
-   // NOTE:
-   // Since the tiff library uses the variable argument list function "va_arg"
-   // it is important to use the correct data type.  If in doubt see the
-   // code for libtiff's _TIFFVSetField in "tif_dir.c" in the libtiff package.
-   //---
-
-   int bitsPerSample  = 0;
-   int sampleFormat   = 0;
-   switch( theInputConnection->getOutputScalarType() )
-   {
-   case OSSIM_UINT8:
-      bitsPerSample = 8;
-      sampleFormat = SAMPLEFORMAT_UINT;
-      break;
-
-   case OSSIM_UINT16:
-   case OSSIM_USHORT11:
-      bitsPerSample = 16;
-      sampleFormat = SAMPLEFORMAT_UINT;
-      break;
-
-   case OSSIM_SINT16:
-      bitsPerSample = 16;
-      sampleFormat = SAMPLEFORMAT_INT;
-      break;
-
-   case OSSIM_FLOAT32:
-   case OSSIM_NORMALIZED_FLOAT:
-      bitsPerSample = 32;
-      sampleFormat = SAMPLEFORMAT_IEEEFP;
-      break;
-
-   case OSSIM_NORMALIZED_DOUBLE:
-   case OSSIM_FLOAT64:
-      bitsPerSample = 64;
-      sampleFormat = SAMPLEFORMAT_IEEEFP;
-      break;
-
-   default:
-      return false;
-   }
-
-   // Set the pixel type.
-   TIFFSetField( (TIFF*)tiffPtr, TIFFTAG_BITSPERSAMPLE, bitsPerSample );
-   TIFFSetField( (TIFF*)tiffPtr, TIFFTAG_SAMPLEFORMAT, sampleFormat );
-
-   // Set the image dimensions.
-   ossim_uint32  width  = theAreaOfInterest.width();
-   ossim_uint32  height = theAreaOfInterest.height();
-   TIFFSetField( tiffPtr, TIFFTAG_IMAGEWIDTH, width);
-   TIFFSetField( tiffPtr, TIFFTAG_IMAGELENGTH, height);
-   if (isTiled())
-   {
-      ossim_uint32 tileXSize = theOutputTileSize.x;
-      ossim_uint32 tileYSize = theOutputTileSize.y;
-      TIFFSetField(tiffPtr, TIFFTAG_TILEWIDTH,  tileXSize);
-      TIFFSetField(tiffPtr, TIFFTAG_TILELENGTH, tileYSize);
-   }
-   else
-   {
-      TIFFSetField(tiffPtr, TIFFTAG_ROWSPERSTRIP, ossim_uint32(1));
-   }
-
-   ossim_uint32 numberOfBands = theInputConnection->getNumberOfOutputBands();
-
-   // Set the min/max values.
-   std::vector<ossim_float64> minBand(numberOfBands);
-   std::vector<ossim_float64> maxBand(numberOfBands);
-   for(ossim_uint32 idx = 0; idx < numberOfBands; ++idx)
-   {
-      maxBand[idx] = theInputConnection->getMaxPixelValue(idx);
-      minBand[idx] = theInputConnection->getMinPixelValue(idx);
-   }
-   
-   writeMinMaxTags(minBand, maxBand);
-   
-   // Set the planar configuration.
-   if ( (theOutputImageType == "tiff_strip") ||
-        (theOutputImageType == "tiff_tiled") ||
-        (theOutputImageType == "image/tiff") ||
-        (theOutputImageType == "image/tif") ||
-        (theOutputImageType == "image/gtif") ||
-        (theOutputImageType == "image/gtiff") )
-   {
-      TIFFSetField( tiffPtr, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-   }
-   else
-   {
-      TIFFSetField( tiffPtr, TIFFTAG_PLANARCONFIG, PLANARCONFIG_SEPARATE);
-   }
-
-   // Set the compression type:
-   uint16 tiffCompressType = COMPRESSION_NONE;
-   theCompressionType.downcase();
-   if( theCompressionType == "jpeg")
-   {
-      tiffCompressType  = COMPRESSION_JPEG;
-      // Set the jpeg quality.
-      // note the compression type must be set before the quality or you will get an error
-    TIFFSetField( tiffPtr, TIFFTAG_COMPRESSION, tiffCompressType);
-    TIFFSetField( tiffPtr, TIFFTAG_JPEGQUALITY,  theJpegQuality);
-   }
-   else if(theCompressionType == "packbits")
-   {
-      tiffCompressType = COMPRESSION_PACKBITS;
-      TIFFSetField( tiffPtr, TIFFTAG_COMPRESSION, tiffCompressType);
-   }
-   else if((theCompressionType == "deflate") ||
-           (theCompressionType == "zip"))
-   {
-      tiffCompressType  = COMPRESSION_DEFLATE;
-      TIFFSetField( tiffPtr, TIFFTAG_COMPRESSION, tiffCompressType);
-   }
-   TIFFSetField(tiffPtr, TIFFTAG_SAMPLESPERPIXEL, (int)theInputConnection->getNumberOfOutputBands());
-
-   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
-   bool lutEnabled = (theColorLutFlag&&
-                      ((scalarType == OSSIM_UINT8)||
-                       (scalarType == OSSIM_UINT16)||
-                       (scalarType == OSSIM_USHORT11))&&
-                      (theColorLut->getNumberOfEntries() > 0)&&
-                      (theInputConnection->getNumberOfOutputBands() == 1));
-   if(lutEnabled)
-   {
-      TIFFSetField( tiffPtr, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE );
-      TIFFSetField( tiffPtr, TIFFTAG_INDEXED, (ossim_uint16)1);
-
-      if(scalarType == OSSIM_UINT8)
-      {
-         ossim_uint16 r[256], g[256], b[256];
-         
-         memset(r, '\0', sizeof(ossim_uint16)*256);
-         memset(g, '\0', sizeof(ossim_uint16)*256);
-         memset(b, '\0', sizeof(ossim_uint16)*256);
-         
-         for(ossim_uint32 i = 0; i < theColorLut->getNumberOfEntries(); i++)
-         {
-            r[i] = (ossim_uint16) (((*theColorLut)[i][0]/255.0)*65535);
-            g[i] = (ossim_uint16) (((*theColorLut)[i][1]/255.0)*65535);
-            b[i] = (ossim_uint16) (((*theColorLut)[i][2]/255.0)*65535);
-         }
-         TIFFSetField(tiffPtr, TIFFTAG_COLORMAP, r, g ,b);
-      }
-      else
-      {
-         ossim_uint16 r[65536], g[65536], b[65536];
-         memset(r, '\0', sizeof(ossim_uint16)*65536);
-         memset(g, '\0', sizeof(ossim_uint16)*65536);
-         memset(b, '\0', sizeof(ossim_uint16)*65536);
-         
-         for(ossim_uint32 i = 0; i < theColorLut->getNumberOfEntries(); i++)
-         {
-            r[i] = (ossim_uint16) ((*theColorLut)[i][0]);
-            g[i] = (ossim_uint16) ((*theColorLut)[i][1]);
-            b[i] = (ossim_uint16) ((*theColorLut)[i][2]);
-         }
-         TIFFSetField(tiffPtr, TIFFTAG_COLORMAP, r, g ,b);
-      }
-   }
-   else if( (theInputConnection->getNumberOfOutputBands() == 3 ||
-             theInputConnection->getNumberOfOutputBands() == 4 ||
-             (thePhotoMetric == "rgb"))&&
-            (scalarType == OSSIM_UCHAR))
-   {
-      TIFFSetField( tiffPtr, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB );
-   }
-   else
-   {
-      TIFFSetField( tiffPtr, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK );
-   }
-
-   return true;
-}
-
-bool ossimTiffWriter::writeGeotiffTags(ossimRefPtr<ossimMapProjectionInfo> projectionInfo)
-{
-   TIFF* tiffPtr = (TIFF*)theTif;
-   bool result = false;
-   if ( tiffPtr )
-   {
-      if ( projectionInfo.valid() )
-      {
-         result = ossimGeoTiff::writeTags(tiffPtr, projectionInfo);
-      }
-   }
-   return result;
-}
-
-void ossimTiffWriter::checkColorLut()
-{
-   
-   // this code appears to be wrong.  We can only do an outo lut if the immediate input to the sequencer is 
-   // a handler with a lut or some kind of lut source.
-   // 
-   // I think that we should add a flag to enable auto setting of the lut instead of just doing it. This code causes core
-   // dumps if one is to replicate bands with a band selector where a lut is a single band output like a CIB
-   //
-   // I currenlty have to disable
-   //
-   
-   
-#if 0
-   bool needColorLut = false;
-   bool needLoop = true;
-   ossimRefPtr<ossimNBandLutDataObject> colorLut = 0;
-   ossimConnectableObject::ConnectableObjectList imageInputs = theInputConnection->getInputList();
-   if (imageInputs.size() > 0)
-   {
-      for (ossim_uint32 i = 0; i < imageInputs.size(); i++)
-      {
-         if (needLoop == false)
-         {
-            break;
-         }
-         ossimImageChain* source = PTR_CAST(ossimImageChain, imageInputs[i].get());
-         if (source)
-         {
-            ossimConnectableObject::ConnectableObjectList imageChains = source->getInputList();
-            for (ossim_uint32 j = 0; j < imageChains.size(); j++)
-            {
-               if (needLoop == false)
-               {
-                  break;
-               }
-               ossimImageChain* imageChain = PTR_CAST(ossimImageChain, imageChains[j].get());
-               if (imageChain)
-               {
-                  ossimConnectableObject::ConnectableObjectList imageHandlers =
-                     imageChain->findAllObjectsOfType(STATIC_TYPE_INFO(ossimImageHandler), false);
-                  
-                  for (ossim_uint32 h= 0; h < imageHandlers.size(); h++)
-                  {
-                     ossimImageHandler* handler =
-                        PTR_CAST(ossimImageHandler, imageHandlers[h].get());
-                     if (handler)
-                     {
-                        if (handler->getLut() != 0) //
-                        {
-                           colorLut = handler->getLut();
-                           needColorLut = true;
-                        }
-                        else //if not all handlers have color luts, ignore the color lut.
-                        {
-                           needColorLut = false;
-                           needLoop = false;
-                           break;
-                        }
-                     }
-                  }
-               }
-            }
-         }
-      }
-   }
-   
-   if (needColorLut && colorLut != 0)
-   {
-      setLut(*colorLut.get());
-   }
-#endif
-}
-
-bool ossimTiffWriter::writeFile()
-
-{
-   static const char MODULE[] = "ossimTiffWriter::writeFile";
-
-   if (traceDebug()) CLOG << "Entered..." << std::endl;
-
-   //checkColorLut();
-
-   if(isLutEnabled())
-   {
-      theNBandToIndexFilter = new ossimNBandToIndexFilter;
-      theNBandToIndexFilter->connectMyInputTo(0, theInputConnection->getInput());
-      theNBandToIndexFilter->setLut(*theColorLut.get());
-      theNBandToIndexFilter->initialize();
-      theInputConnection->disconnect();
-      theInputConnection->connectMyInputTo(0, theNBandToIndexFilter.get());
-      theInputConnection->initialize();
-   }
-   else
-   {
-      theNBandToIndexFilter = 0;
-   }
-   
-   if (traceDebug() && theInputConnection.get())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << "DEBUG:"
-         << "\nnull:  " << theInputConnection->getNullPixelValue()
-         << "\nmin:   " << theInputConnection->getMinPixelValue()
-         << "\nmax:   " << theInputConnection->getMaxPixelValue()
-         << std::endl;
-   }
-   
-   if (isTiled())
-   {
-      if ( (theInputConnection->getTileWidth()  !=
-            static_cast<ossim_uint32>(theOutputTileSize.x)) ||
-           (theInputConnection->getTileHeight() !=
-            static_cast<ossim_uint32>(theOutputTileSize.y)) )
-      {
-         theInputConnection->setTileSize(theOutputTileSize);
-      }
-   }
-   
-   if(!theInputConnection->isMaster())
-   {
-      theInputConnection->slaveProcessTiles();
-
-      if(theNBandToIndexFilter.valid())
-      {
-         theInputConnection->connectMyInputTo(0, theNBandToIndexFilter->getInput());
-         theNBandToIndexFilter = 0;
-      }
-      
-      return true;
-   }
-
-   open();
-
-   if (!isOpen())
-   {
-      if (traceDebug())
-      {
-         CLOG << " ERROR:  Could not open!  Returning..." << std::endl;
-      }
-
-      return false;
-   }
-
-   if(!theInputConnection)
-   {
-      if (traceDebug())
-      {
-         CLOG << " ERROR:  No input connection!  Returning..." << std::endl;
-      }
-
-      return false;
-   }
-
-   // First write the tiff tags.
-   if (writeTiffTags() == false)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " ERROR:"
-            << "\nError detected writing tiff tags.  Returning..." << std::endl;
-         return false;
-      }
-   }
-
-   // Write the geotiff tags.
-   if (theOutputGeotiffTagsFlag)
-   {
-      if(theViewController.get()) // let this override
-      {                     // found in ossimImageWriter base
-         ossimMapProjection* proj = PTR_CAST(ossimMapProjection,
-                                             theViewController->getView());
-         if(proj)
-         {
-            ossimRefPtr<ossimMapProjectionInfo> projectionInfo
-               = new ossimMapProjectionInfo(proj, theAreaOfInterest);
-            projectionInfo->setPixelType(thePixelType);
-
-            if (writeGeotiffTags(projectionInfo) == false)
-            {
-               if(traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << MODULE << " ERROR:"
-                     << "\nError detected writing geotiff tags.  Returning..."
-                     << std::endl;
-               }
-               return false;
-            }
-         }
-      }
-      else if(theProjectionInfo.valid())
-      {
-         theProjectionInfo->setPixelType(thePixelType);
-         if (writeGeotiffTags(theProjectionInfo) == false)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << MODULE << " ERROR:"
-                  << "\nError detected writing geotiff tags.  Returning..."
-                  << std::endl;
-            }
-            return false;
-         }
-      }
-      else
-      {
-         // Fetch the map projection of the input image if it exists:
-         ossimMapProjection* mapProj = 0;
-         ossimRefPtr<ossimImageGeometry> imgGeom = theInputConnection->getImageGeometry();
-         if ( imgGeom.valid() )
-         {
-            const ossimProjection* proj = imgGeom->getProjection();
-            mapProj = PTR_CAST(ossimMapProjection, proj);
-         }
-         if(mapProj)
-         {
-            ossimRefPtr<ossimMapProjectionInfo> projectionInfo
-               = new ossimMapProjectionInfo(mapProj, theAreaOfInterest);
-
-            projectionInfo->setPixelType(thePixelType);
-            if (writeGeotiffTags(projectionInfo) == false)
-            {
-               if(traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << MODULE << " ERROR:"
-                     << "\nError detected writing geotiff tags.  Returning..."
-                     << std::endl;
-               }
-               return false;
-            }
-         }
-      }
-
-   } // End of "if (theOutputGeotiffTagsFlag)"
-
-   // Write the file with the image data.
-   bool status = false;
-   if(theOutputImageType == "tiff_strip")
-   {
-      status = writeToStrips();
-   }
-   else if(theOutputImageType == "tiff_strip_band_separate")
-   {
-      status = writeToStripsBandSep();
-   }
-   else if((theOutputImageType == "tiff_tiled")||
-           (ossimString::downcase(theOutputImageType) == "image/tiff")||
-           (ossimString::downcase(theOutputImageType) == "image/tif")||
-           (ossimString::downcase(theOutputImageType) == "image/gtif")||
-           (ossimString::downcase(theOutputImageType) == "image/gtiff"))
-   {
-      status = writeToTiles();
-   }
-   else if(theOutputImageType == "tiff_tiled_band_separate")
-   {
-      status = writeToTilesBandSep();
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " ERROR:"
-            << "\nUnsupported output type:  " << theOutputImageType
-            << std::endl;
-      }
-   }
-
-   close();
-
-   if (traceDebug()) CLOG << " Exited..." << std::endl;
-
-   if(theNBandToIndexFilter.valid())
-   {
-      theInputConnection->connectMyInputTo(0, theNBandToIndexFilter->getInput());
-      theNBandToIndexFilter = 0;
-   }
-   
-   return status;
-}
-
-void ossimTiffWriter::setLut(const ossimNBandLutDataObject& lut)
-{
-   theColorLutFlag = true;
-   theColorLut = (ossimNBandLutDataObject*)lut.dup();
-}
-
-bool ossimTiffWriter::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   kwl.add(prefix,
-           "output_geotiff_flag",
-           (int)theOutputGeotiffTagsFlag,
-           true);
-
-   kwl.add(prefix,
-           TIFF_WRITER_OUTPUT_TILE_SIZE_X_KW,
-           theOutputTileSize.x,
-           true);
-
-   kwl.add(prefix,
-           TIFF_WRITER_OUTPUT_TILE_SIZE_Y_KW,
-           theOutputTileSize.y,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::COMPRESSION_QUALITY_KW,
-           theJpegQuality,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::COMPRESSION_TYPE_KW,
-           theCompressionType,
-           true);
-
-   kwl.add(prefix,
-           "color_lut_flag",
-           (ossim_uint32)theColorLutFlag,
-           true);
-
-   if(theColorLutFlag)
-   {
-      if(theLutFilename != "")
-      {
-         kwl.add(prefix,
-                 "lut_filename",
-                 theLutFilename.c_str(),
-                 true);
-      }
-      else
-      {
-         ossimString newPrefix = ossimString(prefix) + "lut.";
-         theColorLut->saveState(kwl, newPrefix.c_str());
-      }
-   }
-
-
-   return ossimImageFileWriter::saveState(kwl,
-                                          prefix);
-}
-
-bool ossimTiffWriter::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   const char *value;
-
-   ossimIpt defaultTileSize;
-   ossim::defaultTileSize(defaultTileSize);
-
-   value = kwl.find(prefix,
-                    TIFF_WRITER_OUTPUT_TILE_SIZE_X_KW);
-   if(value)
-   {
-      theOutputTileSize.x = ossimString(value).toLong();
-      if(theOutputTileSize.x<1)
-      {
-         theOutputTileSize.x = defaultTileSize.x;
-      }
-   }
-
-   value = kwl.find(prefix,
-                    TIFF_WRITER_OUTPUT_TILE_SIZE_Y_KW);
-   if(value)
-   {
-      theOutputTileSize.y = ossimString(value).toLong();
-      if(theOutputTileSize.y<1)
-      {
-         theOutputTileSize.y = defaultTileSize.y;
-      }
-   }
-
-
-   value = kwl.find(prefix, ossimKeywordNames::COMPRESSION_TYPE_KW);
-   if(value)
-   {
-      theCompressionType = ossimString(value).downcase();
-   }
-   else
-   {
-      theCompressionType = "none";
-   }
-
-   value = kwl.find(prefix, ossimKeywordNames::COMPRESSION_QUALITY_KW);
-   if(value)
-   {
-      setJpegQuality(ossimString(value).toLong());
-   }
-
-   value = kwl.find(prefix, ossimKeywordNames::PHOTOMETRIC_KW);
-   if(value)
-   {
-      thePhotoMetric = ossimString(value).downcase();
-   }
-
-   value = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   if(value)
-   {
-      setFilename(ossimFilename(value));
-   }
-
-   const char* flag = kwl.find(prefix, "output_geotiff_flag");
-   if(flag)
-   {
-      theOutputGeotiffTagsFlag = ossimString(flag).toBool();
-   }
-
-   ossimString newPrefix = ossimString(prefix) + "lut.";
-
-   const char* colorLutFlag = kwl.find(prefix, "color_lut_flag");
-   if(colorLutFlag)
-   {
-      theColorLutFlag = ossimString(colorLutFlag).toBool();
-   }
-   else
-   {
-      theColorLutFlag = false;
-   }
-   theLutFilename = ossimFilename(kwl.find(prefix, "lut_filename"));
-
-   theLutFilename = ossimFilename(theLutFilename.trim());
-   if(theLutFilename != "")
-   {
-      theColorLut->open(theLutFilename);
-   }
-   else
-   {
-      theColorLut->loadState(kwl, newPrefix.c_str());
-   }
-
-   if(ossimImageFileWriter::loadState(kwl,
-                                      prefix))
-   {
-      if((theOutputImageType!="tiff_tiled") &&
-         (theOutputImageType!="tiff_tiled_band_separate") &&
-         (theOutputImageType!="tiff_strip") &&
-         (theOutputImageType!="tiff_strip_band_separate")&&
-         (theOutputImageType!="image/tiff")&&
-         (theOutputImageType!="image/tif")&&
-         (theOutputImageType!="image/gtif")&&
-         (theOutputImageType!="image/gtiff"))
-      {
-
-         theOutputImageType = "tiff_tiled_band_separate";;
-      }
-   }
-   else
-   {
-      return false;
-   }
-
-   return true;
-}
-
-bool ossimTiffWriter::isTiled() const
-{
-   return ( theOutputImageType == "tiff_tiled" ||
-            theOutputImageType == "image/tiff" ||
-            theOutputImageType == "image/tif" ||
-            theOutputImageType == "image/gtif" ||
-            theOutputImageType == "image/gtiff" ||
-            theOutputImageType == "tiff_tiled_band_separate" );
-}
-
-bool ossimTiffWriter::writeToTiles()
-{
-   static const char* const MODULE = "ossimTiffWriter::writeToTiles";
-   TIFF* tiffPtr = (TIFF*)theTif;
-
-   if (traceDebug()) CLOG << " Entered." << std::endl;
-
-   // Start the sequence at the first tile.
-   theInputConnection->setToStartOfSequence();
-
-   ossimRefPtr<ossimImageData> tempTile = 0;
-
-   if(theColorLutFlag)
-   {
-      tempTile = ossimImageDataFactory::instance()->create(this, 1, theInputConnection.get());
-   }
-   else
-   {
-      tempTile = ossimImageDataFactory::instance()->create(this, theInputConnection.get());
-   }
-   if(tempTile.valid())
-   {
-      tempTile->initialize();
-   }
-   ossim_uint32 tilesWide       = theInputConnection->getNumberOfTilesHorizontal();
-   ossim_uint32 tilesHigh       = theInputConnection->getNumberOfTilesVertical();
-   ossim_uint32 tileWidth       = theInputConnection->getTileWidth();
-   ossim_uint32 tileHeight      = theInputConnection->getTileHeight();
-   ossim_uint32 numberOfTiles   = theInputConnection->getNumberOfTiles();
-
-   // Tile loop in the height direction.
-   ossim_uint32 tileNumber = 0;
-   vector<ossim_float64> minBands;
-   vector<ossim_float64> maxBands;
-   for(ossim_uint32 i = 0; ((i < tilesHigh)&&!needsAborting()); i++)
-   {
-      ossimIpt origin(0,0);
-      origin.y = i * tileHeight;
-
-      // Tile loop in the sample (width) direction.
-      for(ossim_uint32 j = 0; ((j < tilesWide)&&!needsAborting()); j++)
-      {
-         origin.x = j * tileWidth;
-
-         // Grab the tile.
-         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
-         if (!id)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "Error returned writing tiff tile:  " << tileNumber
-               << "\nNULL Tile encountered"
-               << std::endl;
-            return false;
-         }
-
-         ossimDataObjectStatus  tileStatus      = id->getDataObjectStatus();
-         ossim_uint32           tileSizeInBytes = id->getSizeInBytes();
-         if (tileStatus != OSSIM_FULL)
-         {
-            // Clear out the buffer since it won't be filled all the way.
-            tempTile->setImageRectangle(id->getImageRectangle());
-            tempTile->makeBlank();
-         }
-
-         if ((tileStatus == OSSIM_PARTIAL || tileStatus == OSSIM_FULL))
-         {
-            // Stuff the tile into the tileBuffer.
-            id->unloadTile(tempTile->getBuf(),
-                           id->getImageRectangle(),
-                           OSSIM_BIP);
-            tempTile->setDataObjectStatus(id->getDataObjectStatus());
-            if(!theColorLutFlag&&!needsAborting())
-            {
-               id->computeMinMaxPix(minBands, maxBands);
-            }
-         }
-
-         //---
-         // Write the tile to disk.
-         //---
-         ossim_uint32 bytesWritten = 0;
-         bytesWritten = TIFFWriteTile(tiffPtr,
-                                      tempTile->getBuf(),
-                                      origin.x,
-                                      origin.y,
-                                      0,            // z
-                                      0);           // s
-
-         if (bytesWritten != tileSizeInBytes)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << MODULE << " ERROR:"
-                  << "Error returned writing tiff tile:  " << i
-                  << "\nExpected bytes written:  " << tileSizeInBytes
-                  << "\nBytes written:  " << bytesWritten
-                  << std::endl;
-            }
-            setErrorStatus();
-            return false;
-         }
-
-         ++tileNumber;
-
-      } // End of tile loop in the sample (width) direction.
-
-      double tile = tileNumber;
-      double numTiles = numberOfTiles;
-      setPercentComplete(tile / numTiles * 100);
-
-   } // End of tile loop in the line (height) direction.
-
-   if(!theColorLutFlag&&!needsAborting())
-   {
-      writeMinMaxTags(minBands, maxBands);
-   }
-
-   if (traceDebug()) CLOG << " Exited." << std::endl;
-
-   return true;
-}
-
-bool ossimTiffWriter::writeToTilesBandSep()
-{
-   static const char* const MODULE = "ossimTiffWriter::writeToTilesBandSep";
-   TIFF* tiffPtr = (TIFF*)theTif;
-   if (traceDebug()) CLOG << " Entered." << std::endl;
-
-   // Start the sequence at the first tile.
-   theInputConnection->setToStartOfSequence();
-
-   ossim_uint32 bands     = theInputConnection->getNumberOfOutputBands();
-   ossim_uint32 tilesWide = theInputConnection->getNumberOfTilesHorizontal();
-   ossim_uint32 tilesHigh = theInputConnection->getNumberOfTilesVertical();
-   ossim_uint32 tileWidth     = theInputConnection->getTileWidth();
-   ossim_uint32 tileHeight    = theInputConnection->getTileHeight();
-   ossim_uint32 numberOfTiles = theInputConnection->getNumberOfTiles();
-
-#if 0
-   if(traceDebug())
-   {
-      ossimIrect   boundingRect  = theInputConnection->getBoundingRect();
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "Bounding rect = " << boundingRect
-         << "\nBands         = " << bands
-         << "\ntilesWide     = " << tilesWide
-         << "\ntilesHigh     = " << tilesHigh
-         << "\ntileWidth     = " << tileWidth
-         << "\ntileHeight    = " << tileHeight << std::endl;
-   }
-#endif
-
-   ossim_uint32 tileNumber = 0;
-   vector<ossim_float64> minBands;
-   vector<ossim_float64> maxBands;
-   for(ossim_uint32 i = 0; ((i < tilesHigh)&&!needsAborting()); ++i)
-   {
-      ossimIpt origin;
-      origin.y = i * tileHeight;
-
-      //---
-      // Tile loop in the sample (width) direction.
-      //---
-      for(ossim_uint32 j = 0; ((j < tilesWide)&&!needsAborting()); ++j)
-      {
-         origin.x = j * tileWidth;
-
-         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
-	 if(!id)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "Error returned writing tiff tile:  " << i
-               << "\nNULL Tile encountered"
-               << std::endl;
-            return false;
-         }
-	 ossim_int32 tileSizeInBytes = id->getSizePerBandInBytes();
-
-         if(!theColorLutFlag)
-         {
-            id->computeMinMaxPix(minBands, maxBands);
-         }
-
-         //---
-         // Band loop.
-         //---
-         for (ossim_uint32 band=0; ((band<bands)&&(!needsAborting())); ++band)
-         {
-            // Grab a pointer to the tile for the band.
-            tdata_t* data = (tdata_t*)id->getBuf(band);
-            // Write the tile.
-            tsize_t bytesWritten = 0;
-            if(data)
-            {
-               bytesWritten = TIFFWriteTile(tiffPtr,
-                                            data,
-                                            (ossim_uint32)origin.x,
-                                            (ossim_uint32)origin.y,
-                                            (ossim_uint32)0,        // z
-                                            (tsample_t)band);    // sample
-            }
-            if ( ( bytesWritten != tileSizeInBytes ) && !needsAborting() )
-            {
-               if(traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << MODULE << " ERROR:"
-                     << "Error returned writing tiff tile:  " << i
-                     << "\nExpected bytes written:  " << tileSizeInBytes
-                     << "\nBytes written:  " << bytesWritten
-                     << std::endl;
-               }
-               setErrorStatus();
-               return false;
-            }
-            
-         } // End of band loop.
-
-         ++tileNumber;
-
-      } // End of tile loop in the sample (width) direction.
-
-      double tile = tileNumber;
-      double numTiles = numberOfTiles;
-      setPercentComplete(tile / numTiles * 100);
-      if(needsAborting())
-      {
-         setPercentComplete(100);
-      }
-
-   } // End of tile loop in the line (height) direction.
-
-   if(!theColorLutFlag&&!needsAborting())
-   {
-      writeMinMaxTags(minBands, maxBands);
-   }
-    
-   if (traceDebug()) CLOG << " Exited." << std::endl;
-
-   return true;
-}
-
-bool ossimTiffWriter::writeToStrips()
-{
-   static const char* const MODULE = "ossimTiffWriter::writeToStrips";
-   TIFF* tiffPtr = (TIFF*)theTif;
-
-   if (traceDebug()) CLOG << " Entered." << std::endl;
-
-   // Start the sequence at the first tile.
-   theInputConnection->setToStartOfSequence();
-
-   ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
-   ossim_uint32 tilesWide = theInputConnection->getNumberOfTilesHorizontal();
-   ossim_uint32 tilesHigh = theInputConnection->getNumberOfTilesVertical();
-   ossim_uint32 tileHeight = theInputConnection->getTileHeight();
-   ossim_uint32 numberOfTiles = theInputConnection->getNumberOfTiles();
-   ossim_uint32 width = theAreaOfInterest.width();
-   ossim_uint32 bytesInLine =
-      ossim::scalarSizeInBytes(theInputConnection->getOutputScalarType()) *
-      width * bands;
-
-   //---
-   // Buffer to hold one line x tileHeight
-   //---
-   ossim_uint32 bufferSizeInBytes = bytesInLine * tileHeight;
-   unsigned char* buffer = new unsigned char[bufferSizeInBytes];
-
-   int tileNumber = 0;
-   vector<ossim_float64> minBands;
-   vector<ossim_float64> maxBands;
-   for(ossim_uint32 i = 0; ((i < tilesHigh)&&(!needsAborting())); ++i)
-   {
-      // Clear the buffer.
-      memset(buffer, 0, bufferSizeInBytes);
-
-      // Set the buffer rectangle.
-      ossimIrect bufferRect(theAreaOfInterest.ul().x,
-                            theAreaOfInterest.ul().y + i * tileHeight,
-                            theAreaOfInterest.ul().x + width - 1,
-                            theAreaOfInterest.ul().y + i * tileHeight +
-                            tileHeight - 1);
-
-      // Tile loop in the sample (width) direction.
-      for(ossim_uint32 j = 0; ((j < tilesWide)&&(!needsAborting())); ++j)
-      {
-         // Get the tile and copy it to the buffer.
-         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
-         if (!id)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "Error returned writing tiff tile:  " << tileNumber
-               << "\nNULL Tile encountered"
-               << std::endl;
-            delete [] buffer;
-            return false;
-         }
-         id->unloadTile(buffer, bufferRect, OSSIM_BIP);
-         if(!theColorLutFlag&&!needsAborting())
-         {
-            id->computeMinMaxPix(minBands, maxBands);
-         }
-         ++tileNumber;
-      }
-
-      // Get the number of lines to write from the buffer.
-      ossim_uint32 linesToWrite = min(tileHeight, static_cast<ossim_uint32>(theAreaOfInterest.lr().y - bufferRect.ul().y + 1));
-
-      // Write the buffer out to disk.
-      ossim_uint32 row = static_cast<ossim_uint32>(bufferRect.ul().y -
-                                                   theAreaOfInterest.ul().y);
-      ossim_uint8* buf = buffer;
-      for (ossim_uint32 ii=0; ((ii<linesToWrite)&&(!needsAborting())); ++ii)
-      {
-         ossim_int32 status = TIFFWriteScanline(tiffPtr,
-                                                buf,
-                                                row,
-                                                0);
-         if (status == -1)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "Error returned writing tiff scanline:  " << row
-               << std::endl;
-            setErrorStatus();
-            delete [] buffer;
-            return false;
-         }
-
-         ++row;  // Increment the line number.
-         buf += bytesInLine;
-
-      } // End of loop to write lines from buffer to tiff file.
-
-      double tile = tileNumber;
-      double numTiles = numberOfTiles;
-      setPercentComplete(tile / numTiles * 100);
-      if(needsAborting())
-      {
-         setPercentComplete(100);
-      }
-
-   } // End of loop in the line (height) direction.
-
-   if(!theColorLutFlag)
-   {
-      writeMinMaxTags(minBands, maxBands);
-   }
-   
-   // Free the memory.
-   delete [] buffer;
-
-   if (traceDebug()) CLOG << " Exited." << std::endl;
-
-   return true;
-}
-
-bool ossimTiffWriter::writeToStripsBandSep()
-{
-   static const char* const MODULE = "ossimTiffWriter::writeToStripsBandSep";
-   TIFF* tiffPtr = (TIFF*)theTif;
-
-   if (traceDebug()) CLOG << " Entered." << std::endl;
-
-   // Start the sequence at the first tile.
-   theInputConnection->setToStartOfSequence();
-
-   ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
-   ossim_uint32 tilesWide = theInputConnection->getNumberOfTilesHorizontal();
-   ossim_uint32 tilesHigh = theInputConnection->getNumberOfTilesVertical();
-   ossim_uint32 tileHeight      = theInputConnection->getTileHeight();
-   ossim_uint32 numberOfTiles   = theInputConnection->getNumberOfTiles();
-   ossim_uint32 width           = theAreaOfInterest.width();
-   ossim_uint32 bytesInLine     =
-      ossim::scalarSizeInBytes(theInputConnection->getOutputScalarType()) *
-      width;
-
-   //---
-   // Buffer to hold one line x tileHeight
-   //---
-   ossim_uint32 bufferSizeInBytes = bytesInLine * tileHeight * bands;
-
-   unsigned char* buffer = new unsigned char[bufferSizeInBytes];
-
-   // Tile loop in height direction.
-   ossim_uint32 tileNumber = 0;
-   vector<ossim_float64> minBands;
-   vector<ossim_float64> maxBands;
-   for(ossim_uint32 i = 0; ((i < tilesHigh)&&(!needsAborting())); ++i)
-   {
-      // Clear the buffer.
-      memset(buffer, 0, bufferSizeInBytes);
-
-      // Set the buffer rectangle.
-      ossimIrect bufferRect(theAreaOfInterest.ul().x,
-                            theAreaOfInterest.ul().y + i * tileHeight,
-                            theAreaOfInterest.ul().x + width - 1,
-                            theAreaOfInterest.ul().y + i * tileHeight +
-                            tileHeight - 1);
-
-      // Tile loop in the sample (width) direction.
-      for(ossim_uint32 j = 0; ((j < tilesWide)&&(!needsAborting())); ++j)
-      {
-         // Get the tile and copy it to the buffer.
-         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
-         if (!id)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " ERROR:"
-               << "Error returned writing tiff tile:  " << tileNumber
-               << "\nNULL Tile encountered"
-               << std::endl;
-            delete [] buffer;
-            return false;
-         }
-         id->unloadTile(buffer, bufferRect, OSSIM_BIL);
-         if(!theColorLutFlag)
-         {
-            id->computeMinMaxPix(minBands, maxBands);
-         }
-         ++tileNumber;
-      }
-
-      // Get the number of lines to write from the buffer.
-      ossim_uint32 linesToWrite = min(tileHeight, static_cast<ossim_uint32>(theAreaOfInterest.lr().y - bufferRect.ul().y + 1));
-
-      // Write the buffer out to disk.
-      ossim_uint32 row = static_cast<ossim_uint32>(bufferRect.ul().y -
-                                       theAreaOfInterest.ul().y);
-      ossim_uint8* buf = buffer;
-      for (ossim_uint32 ii=0; ((ii<linesToWrite)&&(!needsAborting())); ++ii)
-      {
-         for (ossim_uint32 band =0; ((band<bands)&&(!needsAborting())); ++band)
-         {
-            ossim_int32 status = TIFFWriteScanline(tiffPtr,
-                                                   buf,
-                                                   row,
-                                                   band);
-            if (status == -1)
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " ERROR:"
-                  << "Error returned writing tiff scanline:  " << row
-                  << std::endl;
-               delete [] buffer;
-               return false;
-            }
-            buf += bytesInLine;
-         }
-
-         ++row;  // Increment the line number.
-
-      } // End of loop to write lines from buffer to tiff file.
-
-      double tile = tileNumber;
-      double numTiles = numberOfTiles;
-      setPercentComplete(tile / numTiles * 100);
-      if(needsAborting())
-      {
-         setPercentComplete(100);
-      }
-   } // End of loop in the line (height) direction.
-
-   if(!theColorLutFlag)
-   {
-      writeMinMaxTags(minBands, maxBands);
-   }
-
-   // Free the memory.
-   delete [] buffer;
-
-   if (traceDebug()) CLOG << " Exited." << std::endl;
-
-   return true;
-}
-
-void ossimTiffWriter::setTileSize(const ossimIpt& tileSize)
-{
-   if ( (tileSize.x % 16) || (tileSize.y % 16) )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimTiffWriter::changeTileSize ERROR:"
-            << "\nTile size must be a multiple of 32!"
-            << "\nSize remains:  " << theOutputTileSize
-            << std::endl;
-      }
-      return;
-   }
-
-   theOutputTileSize = tileSize;
-}
-
-void ossimTiffWriter::writeMinMaxTags(const vector<ossim_float64>& minBand,
-                                      const vector<ossim_float64>& maxBand)
-{
-   TIFF* tiffPtr = (TIFF*)theTif;
-   if(minBand.size() && maxBand.size())
-   {
-      ossim_float64 minValue =
-         *std::min_element(minBand.begin(), minBand.end());
-      ossim_float64 maxValue =
-         *std::max_element(maxBand.begin(), maxBand.end());
-
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimTiffWriter::writeMinMaxTags DEBUG:"
-            << "\nminValue:  " << minValue
-            << "\nmaxValue:  " << maxValue
-            << std::endl;
-      }
-
-      switch( theInputConnection->getOutputScalarType() )
-      {
-         case OSSIM_USHORT11:
-         {
-            TIFFSetField( tiffPtr, TIFFTAG_MINSAMPLEVALUE,
-                          static_cast<ossim_sint16>(0) );
-            TIFFSetField( tiffPtr, TIFFTAG_MAXSAMPLEVALUE,
-                          static_cast<ossim_sint16>(2047) );
-            break;
-         }
-         case OSSIM_UINT8:
-         case OSSIM_UINT16:
-         {
-            TIFFSetField( tiffPtr, TIFFTAG_MINSAMPLEVALUE,
-                          static_cast<ossim_sint16>(minValue) );
-            TIFFSetField( tiffPtr, TIFFTAG_MAXSAMPLEVALUE,
-                          static_cast<ossim_sint16>(maxValue) );
-            break;
-         }
-         
-         case OSSIM_SINT16: 
-         case OSSIM_UINT32:
-         case OSSIM_FLOAT32:
-         case OSSIM_FLOAT64:
-         case OSSIM_NORMALIZED_FLOAT:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            TIFFSetField( tiffPtr, TIFFTAG_SMINSAMPLEVALUE,
-                          static_cast<ossim_float32>(minValue) );
-            TIFFSetField( tiffPtr, TIFFTAG_SMAXSAMPLEVALUE,
-                          static_cast<ossim_float32>(maxValue) );
-            break;
-         }
-         default:
-         {
-            break;
-         }
-      }
-   }
-}
-
-void ossimTiffWriter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property)
-   {
-      return;
-   }
-
-   if(property->getName() == ossimKeywordNames::COMPRESSION_QUALITY_KW)
-   {
-//       ossimNumericProperty* numericProperty = PTR_CAST(ossimNumericProperty,
-//                                                        property.get());
-//       if (numericProperty)
-//       {
-      setJpegQuality( property->valueToString().toInt32() );
-//       }
-   }
-   else if (property->getName() == ossimKeywordNames::COMPRESSION_TYPE_KW)
-   {
-      ossimStringProperty* stringProperty = PTR_CAST(ossimStringProperty,
-                                                     property.get());
-      if (stringProperty)
-      {
-         ossimString s;
-         stringProperty->valueToString(s);
-         setCompressionType(s);
-      } 
-   }
-   else if(property->getName() == "lut_file")
-   {
-      theLutFilename = ossimFilename(property->valueToString());
-      theColorLut->open(theLutFilename);
-   }
-   else if(property->getName() == "color_lut_flag")
-   {
-      theColorLutFlag = property->valueToString().toBool();
-   }
-   else if(property->getName() == "big_tiff_flag")
-   {
-      theForceBigTiffFlag = property->valueToString().toBool();
-   }
-   else if(property->getName() == ossimKeywordNames::OUTPUT_TILE_SIZE_KW)
-   {
-      theOutputTileSize.x = property->valueToString().toInt32();
-      theOutputTileSize.y =  theOutputTileSize.x;
-   }
-   else
-   {
-      ossimImageFileWriter::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimTiffWriter::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> prop = 0;
-   
-   if (name == "Filename")
-   {
-      prop = ossimImageFileWriter::getProperty(name);
-      if ( prop.valid() )
-      {
-         ossimRefPtr<ossimFilenameProperty> filenameProp = PTR_CAST(ossimFilenameProperty,
-                                                                    prop.get());
-         if ( filenameProp.valid() )
-         {
-            filenameProp->addFilter("*.tif");
-         }
-         prop = filenameProp.get();
-      }
-   }
-   else if (name == ossimKeywordNames::COMPRESSION_QUALITY_KW)
-   {
-      ossimRefPtr<ossimNumericProperty> numericProp =
-         new ossimNumericProperty(name,
-                                  ossimString::toString(theJpegQuality),
-                                  1.0,
-                                  100.0);
-      numericProp->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT);
-      prop = numericProp.get();
-   }
-   else if (name == ossimKeywordNames::COMPRESSION_TYPE_KW)
-   {
-      ossimRefPtr<ossimStringProperty> stringProp =
-         new ossimStringProperty(name,
-                                 getCompressionType(),
-                                 false); // editable flag
-      stringProp->addConstraint(ossimString("none"));
-      stringProp->addConstraint(ossimString("jpeg"));
-      stringProp->addConstraint(ossimString("packbits"));
-      stringProp->addConstraint(ossimString("deflate"));
-      stringProp->addConstraint(ossimString("zip"));      
-      prop = stringProp.get();
-   }
-   else if (name == "lut_file")
-   {
-      ossimRefPtr<ossimFilenameProperty> property =
-         new ossimFilenameProperty(name, theLutFilename);
-      property->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      
-      prop = property.get();
-   }
-   else if (name == "color_lut_flag")
-   {
-      prop = new ossimBooleanProperty(name, theColorLutFlag);
-   }
-   else if(name == "big_tiff_flag")
-   {
-       prop = new ossimBooleanProperty(name, theForceBigTiffFlag);
-   }
-   else if( name == ossimKeywordNames::OUTPUT_TILE_SIZE_KW )
-   {
-      ossimRefPtr<ossimStringProperty> stringProp =
-         new ossimStringProperty(name,
-                                 ossimString::toString(theOutputTileSize.x),
-                                 false); // editable flag
-      stringProp->addConstraint(ossimString("16"));
-      stringProp->addConstraint(ossimString("32"));
-      stringProp->addConstraint(ossimString("64"));
-      stringProp->addConstraint(ossimString("128"));
-      stringProp->addConstraint(ossimString("256"));      
-      stringProp->addConstraint(ossimString("512"));      
-      stringProp->addConstraint(ossimString("1024"));      
-      stringProp->addConstraint(ossimString("2048"));
-      prop = stringProp.get();
-   }
-   else
-   {
-      prop = ossimImageFileWriter::getProperty(name);
-   }
-   return prop;
-}
-
-void ossimTiffWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(ossimString(
-                              ossimKeywordNames::COMPRESSION_QUALITY_KW));
-   propertyNames.push_back(ossimString(
-                              ossimKeywordNames::COMPRESSION_TYPE_KW));
-   propertyNames.push_back(ossimString("lut_file"));
-   propertyNames.push_back(ossimString("color_lut_flag"));
-   propertyNames.push_back(ossimString("big_tiff_flag"));
-   propertyNames.push_back(ossimString(ossimKeywordNames::OUTPUT_TILE_SIZE_KW));
-  
-   ossimImageFileWriter::getPropertyNames(propertyNames);
-}
-
-bool ossimTiffWriter::isOpen()const
-{
-   return (theTif!=NULL);
-}
-
-bool ossimTiffWriter::open()
-{
-   if(theTif)
-   {
-      closeTiff();
-   }
-   return openTiff();
-}
-
-void ossimTiffWriter::close()
-{
-   closeTiff();
-}
-
-void ossimTiffWriter::setJpegQuality(ossim_int32 quality)
-{
-   // Range 1 to 100 with 100 being best.
-   if (quality > 0 && quality < 101)
-   {
-      theJpegQuality = quality;
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimTiffWriter::setJpegQuality DEBUG:"
-            << "\nquality out of range:  " << quality
-            << "\nquality has been set to default:  " 
-            << DEFAULT_JPEG_QUALITY
-            << "\nvalid range:  1 to 100 with 100 being best."
-            << std::endl;
-      }
-      
-      theJpegQuality = DEFAULT_JPEG_QUALITY;
-   }
-}
-
-ossim_int32 ossimTiffWriter::getJpegQuality()const
-{
-   
-   return theJpegQuality;
-}
-
-void ossimTiffWriter::setCompressionType(const ossimString& type)
-{
-   theCompressionType = type;
-}
-
-ossimString ossimTiffWriter::getCompressionType()const
-{
-   return theCompressionType;
-}
-
-bool ossimTiffWriter::getGeotiffFlag()const
-{
-   return theOutputGeotiffTagsFlag;
-}
-
-void ossimTiffWriter::setGeotiffFlag(bool flag)
-{
-   theOutputGeotiffTagsFlag = flag;
-}
-
-ossimIpt ossimTiffWriter::getOutputTileSize()const
-{
-   return theOutputTileSize;
-}
-
-ossim_int32 ossimTiffWriter::setProjectionInfo(const ossimMapProjectionInfo& proj)
-{
-   theProjectionInfo = new ossimMapProjectionInfo(proj);
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-
-void ossimTiffWriter::getImageTypeList(std::vector<ossimString>& imageTypeList)const
-{
-   imageTypeList.push_back(ossimString("tiff_strip"));
-   imageTypeList.push_back(ossimString("tiff_strip_band_separate"));
-   imageTypeList.push_back(ossimString("tiff_tiled"));
-   imageTypeList.push_back(ossimString("tiff_tiled_band_separate"));
-}
-
-ossimString ossimTiffWriter::getExtension() const
-{
-   return ossimString("tif");
-}
-
-bool ossimTiffWriter::hasImageType(const ossimString& imageType) const
-{
-   // check for non image type list types
-   // We will support mime type
-   //
-   if((imageType == "image/tiff")||
-      (imageType == "image/gtiff")||
-      (imageType == "image/tif")||
-      (imageType == "image/gtif"))
-   {
-      return true;
-   }
-
-   return ossimImageFileWriter::hasImageType(imageType);
-}
-
-bool ossimTiffWriter::isLutEnabled()const
-{
-   return (theColorLutFlag);
-}
-
-ossimTiffWriter::UnitType ossimTiffWriter::getUnitType(
-   ossim_int32 pcsCode,
-   const ossimString& projName) const
-{
-
-
-   if ( ( projName == "ossimCylEquAreaProjection" ) ||
-        ( projName == "ossimEquDistCylProjection" ) ||
-        ( projName == "ossimLlxyProjection" ) )
-   {
-      return ANGULAR_DEGREES;
-   } 
-
-   UnitType pcsUnits = getPcsUnitType(pcsCode);
-
-   UnitType type = UNDEFINED;
-   
-   switch (theLinearUnits)
-   {
-      case OSSIM_METERS:
-      {
-         type = LINEAR_METER;
-         break;
-      }
-      
-      case OSSIM_FEET:
-      {
-         type = LINEAR_FOOT;
-         break;
-      }
-      
-      case OSSIM_US_SURVEY_FEET:
-      {
-         type = LINEAR_FOOT_US_SURVEY;
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-   if (type == UNDEFINED)
-   {
-      return pcsUnits;
-   }
-   return type;
-}
-
-ossimTiffWriter::UnitType ossimTiffWriter::getPcsUnitType(ossim_int32 pcsCode) const
-{
-   UnitType pcsUnits = UNDEFINED;
-   
-   ossimRefPtr<ossimMapProjection> proj = PTR_CAST(ossimMapProjection, 
-      ossimEpsgProjectionDatabase::instance()->findProjection((ossim_uint32) pcsCode));
-   
-   if (proj.valid())
-   {
-      ossimUnitType type = proj->getProjectionUnits();
-      if (type == OSSIM_METERS)
-      {
-         pcsUnits = LINEAR_METER;
-      }
-      else
-      {
-         pcsUnits = LINEAR_FOOT_US_SURVEY;
-      }
-   }
-   return pcsUnits;
-}
-
-//*************************************************************************************************
-// Will take an ossimIMageData tile and write it to disk as a general raster file.
-//*************************************************************************************************
-void ossimTiffWriter::dumpTileToFile(ossimRefPtr<ossimImageData> t,  const ossimFilename& f)
-{
-   ossimRefPtr<ossimMemoryImageSource> tile = new ossimMemoryImageSource;
-   tile->setImage(t);
-   ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper(tile.get(), OSSIM_UINT8);
-   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
-   writer->connectMyInputTo(0, remapper.get());
-   writer->setFilename(f);
-   writer->setGeotiffFlag(false);
-   writer->execute();
-   writer=0;
-   tile=0;
-}
diff --git a/ossim/src/ossim/imaging/ossimTilePatch.cpp b/ossim/src/ossim/imaging/ossimTilePatch.cpp
deleted file mode 100644
index b1f2db9..0000000
--- a/ossim/src/ossim/imaging/ossimTilePatch.cpp
+++ /dev/null
@@ -1,519 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimTilePatch.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <vector>
-using namespace std;
-
-#include <ossim/imaging/ossimTilePatch.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/base/ossimErrorCodes.h>
-ossimDiscreteNearestNeighbor ossimTilePatch::nearestNeighborKernel;
-
-ossimTilePatch::ossimTilePatch(ossimImageSource* input)
-{
-   thePatchData = ossimImageDataFactory::instance()->create(NULL, input);
-   thePatchData->initialize();
-}
-
-ossimTilePatch::ossimTilePatch(ossimScalarType scalarType,
-                               long numberOfComponents,
-                               long width,
-                               long height)
-   :thePatchData(NULL)
-{
-   thePatchData = ossimImageDataFactory::instance()->create(NULL,
-                                                            scalarType,
-                                                            numberOfComponents,
-                                                            width,
-                                                            height);
-
-   thePatchData->initialize();
-}
-
-ossimTilePatch::~ossimTilePatch()
-{
-}
-
-ossimIrect ossimTilePatch::getRect()const
-{
-   return thePatchData->getImageRectangle();
-}
-
-ossimDrect ossimTilePatch::findBoundingRect(const ossimDpt &p1,
-                                            const ossimDpt &p2,
-                                            const ossimDpt &p3,
-                                            const ossimDpt &p4)
-{
-   vector<ossimDpt> points(4);
-   
-   points[0] = p1;
-   points[1] = p2;
-   points[2] = p3;
-   points[3] = p4;
-
-   return ossimDrect(points);
-}
-
-void ossimTilePatch::fillPatch(ossimImageSource* tileSource,
-                               long resLevel)
-{
-   // long w = tileSource->getTileWidth();
-   // long h = tileSource->getTileHeight();
-   
-   if(thePatchData.valid())
-   {
-      ossimIrect rect   = thePatchData->getImageRectangle();
-      thePatchData->makeBlank();
-      // ossimIpt origin(rect.ul());
-      ossimRefPtr<ossimImageData> aTile = tileSource->getTile(rect, resLevel);
-      thePatchData->loadTile(aTile.get());
-   }
-}
-
-void ossimTilePatch::setData(ossimRefPtr<ossimImageData>& patchData)
-{
-   thePatchData = patchData;
-}
-
-void ossimTilePatch::convolve(ossimDiscreteConvolutionKernel* kernel)
-{
-   if(!kernel) return;
-
-   long w = thePatchData->getWidth();
-   long h = thePatchData->getHeight();
-
-   long kW = kernel->getWidth();
-   long kH = kernel->getHeight();
-   ossimIpt origin = thePatchData->getOrigin();
-   
-   if( (w < kW) || (h < kH))
-   {
-      cerr << " Error ossimTilePatch::convolve(kernel): patch is smaller than kernel size" << endl;
-      return;
-   }
-   ossimRefPtr<ossimImageData> kernelBuffer =(ossimImageData*) thePatchData->dup();
-
-   // now let's make the buffer just fit the convolution filter
-   //
-   kernelBuffer->setWidth(w - kW);
-   kernelBuffer->setHeight(h - kH);
-   kernelBuffer->setOrigin(ossimDpt(origin.x + kW/2.0,
-                                    origin.y + kH/2.0));
-   kernelBuffer->initialize();
-
-   fillTile(kernelBuffer, kernel);
-
-   kernelBuffer->validate();
-   // now copy the data back to the buffer
-   //
-   thePatchData->loadTile(kernelBuffer.get());
-
-   // now make sure we validate the buffer.
-   thePatchData->validate();
-}
-
-void ossimTilePatch::fillTile(ossimRefPtr<ossimImageData>& aTile)const
-{
-   if(aTile.valid() &&
-      (aTile->getNumberOfBands()==thePatchData->getNumberOfBands())&&
-      (aTile->getBuf())&&
-      (thePatchData->getBuf())&&
-      (thePatchData->getScalarType()==aTile->getScalarType()))
-   {
-      aTile->loadTile(thePatchData.get());
-   }
-}
-
-void ossimTilePatch::fillTile(ossimRefPtr<ossimImageData>& result,
-                              ossimDiscreteConvolutionKernel* kernel)const
-{
-   if(!kernel)
-   {
-      cerr << "Error: Kernel is NULL in  ossimTilePatch::fillTile(tile, kernel)!!" << endl;
-   }
-   if(thePatchData->getScalarType() != result->getScalarType())
-   {
-      //ERROR
-      return;
-   }
-   else
-   {
-      switch(thePatchData->getScalarType())
-      {
-      case OSSIM_UCHAR:
-      {
-         fillTileTemplate(static_cast<ossim_uint8>(0),
-                          result,
-                          kernel);
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         fillTileTemplate(static_cast<ossim_uint16>(0),
-                          result,
-                          kernel);
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         fillTileTemplate(static_cast<ossim_sint16>(0),
-                          result,
-                          kernel);
-         break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         fillTileTemplate(static_cast<float>(0),
-                          result,
-                          kernel);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         fillTileTemplate(static_cast<double>(0),
-                          result,
-                          kernel);
-         break;
-      }
-      default:
-	{
-	  ossimSetError("ossimTilePatch",
-			ossimErrorCodes::OSSIM_ERROR,
-			"unhandled scalar type %d",
-			(int)thePatchData->getScalarType());
-	  break;
-	}
-      }
-   }
-}
-
-
-
-void ossimTilePatch::fillTile(ossimRefPtr<ossimImageData>& result,
-                              const ossimDpt   &ul,
-                              const ossimDpt   &ur,
-                              const ossimDpt   &deltaUl,
-                              const ossimDpt   &deltaUr,
-                              const ossimDpt   &length)const
-{   
-   result->setNullPix(thePatchData->getNullPix(), thePatchData->getNumberOfBands());
-   result->setMinPix(thePatchData->getMinPix(), thePatchData->getNumberOfBands());
-   result->setMaxPix(thePatchData->getMaxPix(), thePatchData->getNumberOfBands());
-   result->makeBlank();
-   if(thePatchData->getScalarType() != result->getScalarType())
-   {
-      //ERROR
-      return;
-   }
-   else
-   {
-      switch(thePatchData->getScalarType())
-      {
-      case OSSIM_UCHAR:
-      {
-         fillTileTemplate(static_cast<ossim_uint8>(0),
-                          result,
-                          ul,
-                          ur,
-                          deltaUl,
-                          deltaUr,
-                          length);
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         fillTileTemplate(static_cast<ossim_uint16>(0),
-                          result,
-                          ul,
-                          ur,
-                          deltaUl,
-                          deltaUr,
-                          length);
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         fillTileTemplate(static_cast<ossim_sint16>(0),
-                          result,
-                          ul,
-                          ur,
-                          deltaUl,
-                          deltaUr,
-                          length);
-         break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         fillTileTemplate(static_cast<float>(0),
-                          result,
-                          ul,
-                          ur,
-                          deltaUl,
-                          deltaUr,
-                          length);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         fillTileTemplate(static_cast<double>(0),
-                          result,
-                          ul,
-                          ur,
-                          deltaUl,
-                          deltaUr,
-                          length);
-         break;
-      }
-      default:
-	{
-	  ossimSetError("ossimTilePatch",
-			ossimErrorCodes::OSSIM_ERROR,
-			"unhandled scalar type %d",
-			(int)thePatchData->getScalarType());
-	  break;
-	}
-      }
-   }
-
-}
-
-
-template<class T>
-void ossimTilePatch::fillTileTemplate(T /* dummyVariable */,
-                                      ossimRefPtr<ossimImageData>& result,
-                                      ossimDiscreteConvolutionKernel* kernel)const
-{
-   // get the origin.  The convolution could be
-   // an offset into the patch.
-   //
-   ossimIpt startOrigin   = result->getOrigin();
-
-   // Make sure that the patch is not empty or NULL
-   //
-   ossimDataObjectStatus status = thePatchData->getDataObjectStatus();
-   if((status==OSSIM_EMPTY)||
-      (status == OSSIM_NULL))
-   {
-      return;
-   }
-   ossimDpt startDelta(fabs((double)startOrigin.x - thePatchData->getOrigin().x),
-                       fabs((double)startOrigin.y - thePatchData->getOrigin().y));
-   
-   // let's setup some variables that we will need to do the
-   // convolution algorithm.
-   //
-   ossimIrect patchRect   = thePatchData->getImageRectangle();
-   long tileHeight        = result->getHeight();
-   long tileWidth         = result->getWidth();
-   long outputBands       = result->getNumberOfBands();
-   long convolutionWidth  = kernel->getWidth();
-   long convolutionHeight = kernel->getHeight();
-   long convolutionOffsetX= convolutionWidth/2;
-   long convolutionOffsetY= convolutionHeight/2;
-   long patchWidth        = patchRect.width();
-   long patchCenterOffset = (long)(patchWidth*startDelta.y + startDelta.x);
-   long patchConvolutionOffsetDelta = patchWidth*convolutionOffsetY + convolutionOffsetX;
-   long patchLineStartOffset        = patchCenterOffset  - patchConvolutionOffsetDelta;
-   long outputOffset                = 0;
-   double min = 1.0;
-   double max = 255.0;
-   if(status == OSSIM_PARTIAL) // must check for NULLS
-   {
-      for(long y = 0; y <tileHeight; y++)
-      {
-         patchCenterOffset = patchLineStartOffset;
-         
-         for(long x =0; x < tileWidth; x++)
-         {  
-            if(!thePatchData->isNull(patchCenterOffset))
-            {
-               double convolveResult = 0;
-               for(long b = 0; b < outputBands; ++b)
-               {                  
-                  min=result->getMinPix(b);
-                  max=result->getMaxPix(b);
-                  T* buf    = (T*)(thePatchData->getBuf(b)) + patchCenterOffset;
-                  T* outBuf = (T*)(result->getBuf(b));
-
-                  kernel->convolveSubImage(buf,
-                                           patchWidth,
-                                           convolveResult);
-                  convolveResult = convolveResult < min?min:convolveResult;
-                  convolveResult = convolveResult > max?max:convolveResult;
-                  outBuf[outputOffset] = (ossim_uint8)convolveResult;
-               }
-            }
-            else
-            {
-               result->setNull(outputOffset);
-            }
-            ++outputOffset;
-            ++patchCenterOffset;
-         }
-         patchLineStartOffset += patchWidth;
-      }
-    }
-    else
-    {
-       for(long b = 0; b < outputBands; ++b)
-       {                  
-          double convolveResult = 0;
-          const T* buf    = (const T*)thePatchData->getBuf(b);
-          T* outBuf = (T*)(result->getBuf(b));
-          outputOffset = 0;
-          patchCenterOffset = (long)(patchWidth*startDelta.y + startDelta.x);
-          patchLineStartOffset  = patchCenterOffset - patchConvolutionOffsetDelta;
-          min=result->getMinPix(b);
-          max=result->getMaxPix(b);
-          
-          for(long y = 0; y <tileHeight; y++)
-          {
-             patchCenterOffset = patchLineStartOffset;
-             
-             for(long x =0; x < tileWidth; x++)
-             {
-                kernel->convolveSubImage(&buf[patchCenterOffset],
-                                         patchWidth,
-                                         convolveResult);
-                convolveResult = convolveResult < min? min:convolveResult;
-                convolveResult = convolveResult > max?max:convolveResult;
-                outBuf[outputOffset] = (T)convolveResult;
-                ++outputOffset;
-                ++patchCenterOffset;
-             }
-             patchLineStartOffset += patchWidth;
-          }
-       }
-    }
-}
-
-
-template <class T>
-void ossimTilePatch::fillTileTemplate(T /* dummyVariable */,
-                              ossimRefPtr<ossimImageData>& result,
-                              const ossimDpt   &ul,
-                              const ossimDpt   &ur,
-                              const ossimDpt   &deltaUl,
-                              const ossimDpt   &deltaUr,
-                              const ossimDpt   &length)const
-{
-   double stepSizeWidth  = 1.0/length.x;
-   double stepSizeHeight = 1.0/length.y;
-   long patchWidth = thePatchData->getWidth();
-   long patchHeight = thePatchData->getHeight();
-
-   
-   ossimIrect rect = thePatchData->getImageRectangle();
-   
-   ossimDpt startSave(ul.x - rect.ul().x,
-                      ul.y - rect.ul().y );
-   ossimDpt endSave(ur.x - rect.ul().x,
-                    ur.y - rect.ul().y);
-   for(ossim_uint32 band = 0; band < thePatchData->getNumberOfBands(); ++band)
-   {
-      T *resultBuf = (T*)result->getBuf(band);
-      const T *sourceBuf = (T*)thePatchData->getBuf(band);
-      ossimDpt start = startSave;
-      ossimDpt end   = endSave;
-      T nullPix = static_cast<T>(result->getNullPix(band));
-      for(long y = 0; y < length.y; y++)
-      {
-         double deltaX = (end.x - start.x)*stepSizeWidth;
-         double deltaY = (end.y - start.y)*stepSizeHeight;
-         ossimDpt pointXY = start;
-         for(long x = 0; x < length.x; x++)
-         {
-            int xPixel = pointXY.x<0?(int)floor(pointXY.x):(int)pointXY.x;
-            int yPixel = pointXY.y<0?(int)floor(pointXY.y):(int)pointXY.y;
-            if( (xPixel >=0) && (xPixel < patchWidth) &&
-                (yPixel >=0) && (yPixel < patchHeight))
-            {              
-               *resultBuf = sourceBuf[yPixel*patchWidth + xPixel];
-            }
-            else
-            {
-               *resultBuf = nullPix;
-            }
-            
-            resultBuf++;
-            pointXY.y += deltaY;
-            pointXY.x += deltaX;
-         }
-         
-         start.x += deltaUl.x;
-         start.y += deltaUl.y;
-         end.x   += deltaUr.x;
-         end.y   += deltaUr.y;
-      }
-   }
-}
-
-
-void ossimTilePatch::setRect(const ossimDpt &p1,
-                             const ossimDpt &p2,
-                             const ossimDpt &p3,
-                             const ossimDpt &p4,
-                             const ossimDpt &tile_size,
-                             const ossimDpt &padding)
-{
-   setRect(findBoundingRect(p1, p2, p3, p4),
-           tile_size,
-           padding);
-}
-
-void ossimTilePatch::setRect(const ossimDpt &center,
-                             const ossimDpt &rect_size,
-                             const ossimDpt &tile_size,
-                             const ossimDpt &padding)
-{
-   ossimDpt ul (center - rect_size/2.0);
-   ossimDpt lr (center + rect_size/2.0);
-   ossimDrect rect (ul, lr);
-   setRect(rect, tile_size, padding);
-}
-
-void ossimTilePatch::setRect(const ossimDrect& aRect,
-                             const ossimDpt& /* tile_size*/,
-                             const ossimDpt& padding)
-{
-   ossimDpt   ul(aRect.ul().x - padding.x,
-                 aRect.ul().y - padding.y);
-   ossimDpt   lr(aRect.lr().x + padding.x,
-                 aRect.lr().y + padding.y);
-
-   ossimDrect rect(ul, lr);
-   rect.stretchOut();
-   
-//   rect   = alignRectToBoundary(rect, tile_size);
-
-   if(thePatchData.valid())
-   {
-      if(  ((long)thePatchData->getWidth()  != (long)rect.width()) ||
-           ((long)thePatchData->getHeight() != (long)rect.height()))
-      {
-         thePatchData->setWidth((long)rect.width());
-         thePatchData->setHeight((long)rect.height());
-      }
-      thePatchData->setOrigin(rect.ul());
-      thePatchData->initialize();
-   }
-}
-
-
diff --git a/ossim/src/ossim/imaging/ossimTiledImageHandler.cpp b/ossim/src/ossim/imaging/ossimTiledImageHandler.cpp
deleted file mode 100644
index 6743fbf..0000000
--- a/ossim/src/ossim/imaging/ossimTiledImageHandler.cpp
+++ /dev/null
@@ -1,565 +0,0 @@
-//*************************************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description:
-// 
-// Image handler used for tile-files when the full image is distributed across multiple files,
-// as is the case for tiled Quickbird imagery. This is not for use with band-separate formats,
-// but only "spatially-separate" schemes.
-//
-//*************************************************************************************************
-//  $Id: ossimTiledImageHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#include <algorithm>
-
-#include <ossim/imaging/ossimTiledImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimTiffOverviewBuilder.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-
-RTTI_DEF1(ossimTiledImageHandler, "ossimTiledImageHandler", ossimImageHandler)
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimTiledImageHandler:debug");
-
-//*************************************************************************************************
-//!  Constructor (default):
-//*************************************************************************************************
-ossimTiledImageHandler::ossimTiledImageHandler()
-   : m_tileFiles(0),
-     m_tile(0),
-     m_fullImgRect(),
-#if USING_SUB_OVRS
-     m_startOvrResLevel(-1),
-     m_lockSubOvrs(false)
-#else
-     m_startOvrResLevel(1)
-#endif
-{
-}
-
-//*************************************************************************************************
-//! Destructor:
-//*************************************************************************************************
-ossimTiledImageHandler::~ossimTiledImageHandler()
-{
-   close();
-}
-
-//*************************************************************************************************
-//! Deletes the overview and clears the valid image vertices.  Derived
-//! classes should implement.
-//*************************************************************************************************
-void ossimTiledImageHandler::close()
-{
-   vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
-   while (iter != m_tileFiles.end())
-   {
-      (*iter).imageHandler->close();
-      ++iter;
-   }
-   m_tileFiles.clear();
-}
-
-//*************************************************************************************************
-//! Derived classes must implement this method to be concrete.
-//! @return true if open, false if not.
-//*************************************************************************************************
-bool ossimTiledImageHandler::isOpen()const
-{
-   if (m_tileFiles.size() > 0)
-      return true;
-
-   return false;
-}
-
-//*************************************************************************************************
-//! Initialize tile buffer to natch image datatype
-//*************************************************************************************************
-void ossimTiledImageHandler::allocate()
-{
-   m_tile = 0;
-   if ((m_tileFiles.size() == 0))
-      return;
-
-   // Just copy the image data tile of the first tile-file:
-   ossimRefPtr<ossimImageHandler> h0 = m_tileFiles[0].imageHandler;
-   ossimIrect rect (h0->getBoundingRect());
-   rect.set_lr(rect.ul() + ossimIpt(h0->getTileWidth()-1, h0->getTileHeight()-1));
-   ossimRefPtr<ossimImageData> source_tile = m_tileFiles[0].imageHandler->getTile(rect);
-   if (!source_tile.valid())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "ossimTiledImageHandler::allocate() -- Could not"
-         "determine file-tile image data for allocating image tile. Aborting."<<endl;
-      return;
-   }
-
-   m_tile = (ossimImageData*) source_tile->dup();
-}
-
-//*************************************************************************************************
-//! Fills the requested tile by pulling pixels from multiple file tiles as needed.
-//*************************************************************************************************
-ossimRefPtr<ossimImageData> ossimTiledImageHandler::getTile(const ossimIrect& tile_rect, 
-                                                             ossim_uint32 resLevel)
-{
-   // First verify that there are file-tiles available:
-   if (m_tileFiles.size() == 0)
-      return ossimRefPtr<ossimImageData>();
-
-   // Allocate data tile if needed:
-   if(!m_tile.valid())
-   {
-      allocate();
-      if(!m_tile.valid())
-         return ossimRefPtr<ossimImageData>();
-   }
-
-   // Check if res level represents data inside the overall scene overview:
-   if (theOverview.valid() && (resLevel >= m_startOvrResLevel))
-      return theOverview->getTile(tile_rect, resLevel);
-
-   // Loop over all tile-files to find which intersect the requested image rect. This necessarily
-   // needs to be done at full res coordinates, so need to adjust by res level requested:
-   ossimDpt decimation_factor;
-   const ossim_uint32 BANDS = m_tile->getNumberOfBands();
-   // const ossim_uint32 PPB   = m_tile->getSizePerBand(); // pixels per band
-   // bool none_found = true;
-
-   m_tile->setImageRectangle(tile_rect);
-   ossim_uint32 wd, hd, ws, hs;
-   m_tile->getWidthHeight(wd, hd);
-
-   // Always start with blank tile.
-   m_tile->makeBlank();
-   
-   // See if any point of the requested tile is in the image.
-   if ( tile_rect.intersects( m_fullImgRect ) )
-   {
-      vector<ossimTileFile>::iterator tf_iter = m_tileFiles.begin();
-      ossimRefPtr<ossimImageData> source_tile = 0;
-      while (tf_iter != m_tileFiles.end())
-      {
-         if (( (*tf_iter).subImageRects.size() > resLevel) &&
-             tile_rect.intersects((*tf_iter).subImageRects[resLevel]))
-         {
-            // Current image handler lies within requested rect, need to adjust this rect to be 
-            // relative to this subimage offset before fetching the tile:
-            ossimIrect relative_rect (tile_rect - (*tf_iter).subImageRects[resLevel].ul());
-            source_tile = (*tf_iter).imageHandler->getTile(relative_rect, resLevel);
-            
-            // Quick check to see if a full tile was returned, in which case we can just return that
-            // tile instead of looping below:
-            //if (source_tile->getDataObjectStatus() == OSSIM_FULL)
-            //{
-            //   source_tile->setImageRectangle(tile_rect);
-            //   return source_tile;
-            //}
-
-            // Set the tile's rect back to full image space before saving to the list:
-            source_tile->getWidthHeight(ws, hs);
-            for (ossim_uint32 band = 0; band < BANDS; ++band)
-            {
-               const ossim_uint16 null_pixel = (ossim_uint16) m_tile->getNullPix(band);
-               const ossim_uint16* s = (const ossim_uint16*) source_tile->getBuf(band);
-               ossim_uint16* d = (ossim_uint16*) m_tile->getBuf(band);
-               ossim_uint32 is = 0; 
-               ossim_uint32 id = 0; 
-               for (ossim_uint32 y=0; (y<hd)&&(y<hs); y++)
-               {
-                  for (ossim_uint32 x=0; x<wd; x++)
-                  {
-                     if (x < ws)
-                     {
-                        if (s[is] != null_pixel)
-                           d[id] = s[is];
-                        ++is;
-                     }
-                     ++id;
-                  }
-               }
-            }
-         }
-         ++tf_iter;
-      }
-      
-      m_tile->validate();
-      
-   } // Matches: if ( tile_rect.intersects( m_fullImgRect ) )
-
-   return m_tile;
-}
-
-//*************************************************************************************************
-//! @param resLevel Reduced resolution level to return lines of.
-//! Default = 0
-//! @return The number of lines for specified reduced resolution level.
-//*************************************************************************************************
-ossim_uint32 ossimTiledImageHandler::getNumberOfLines(ossim_uint32 resLevel) const
-{
-   if (m_fullImgRect.hasNans())
-      return 0;
-
-   // Using simple decimation by powers of 2:
-   ossim_uint32 numlines = m_fullImgRect.height() >> resLevel;
-   return numlines;
-}
-
-//*************************************************************************************************
-//! @param resLevel Reduced resolution level to return samples of.
-//! Default = 0
-//! @return The number of samples for specified reduced resolution level.
-//*************************************************************************************************
-ossim_uint32 ossimTiledImageHandler::getNumberOfSamples(ossim_uint32 resLevel) const
-{
-   if (m_fullImgRect.hasNans())
-      return 0;
-
-   // Using simple decimation by powers of 2:
-   ossim_uint32 numsamps = m_fullImgRect.width() >> resLevel;
-   return numsamps;
-}
-
-//*************************************************************************************************
-//! Method to save the state of an object to a keyword list.
-//! Return true if ok or false on error.
-//*************************************************************************************************
-bool ossimTiledImageHandler::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-  return ossimImageHandler::saveState(kwl, prefix);
-}
-
-//*************************************************************************************************
-//! Method to the load (recreate) the state of an object from a keyword
-//! list.  Return true if ok or false on error.
-//*************************************************************************************************
-bool ossimTiledImageHandler::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if (!ossimImageHandler::loadState(kwl, prefix))
-      return false;
-
-   return open();
-}
-
-//*************************************************************************************************
-//! Indicates whether or not the image is tiled internally.
-//! This implementation returns true if (getImageTileWidth() &&
-//! getImageTileHeight()) are both non zero.
-//! Override in the image handler if something else is desired.
-//! Returns true if tiled, false if not.
-//*************************************************************************************************
-bool ossimTiledImageHandler::isImageTiled() const
-{
-   return true;
-}
-
-//*************************************************************************************************
-// Returns the number of bands of the first tile since all tiles need to have the same pixel type.
-//*************************************************************************************************
-ossim_uint32 ossimTiledImageHandler::getNumberOfInputBands() const
-{
-   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
-      return 0;
-
-   return m_tileFiles[0].imageHandler->getNumberOfInputBands();
-}
-
-//*************************************************************************************************
-//! Returns the tile width of the image or 0 if the image is not tiled.
-//! Note: this is not the same as the ossimImageSource::getTileWidth which
-//! returns the output tile width which can be different than the internal
-//! image tile width on disk.
-//*************************************************************************************************
-ossim_uint32 ossimTiledImageHandler::getImageTileWidth() const
-{
-   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
-      return 0;
-
-  if (m_tileFiles[0].imageHandler->isImageTiled())
-     return m_tileFiles[0].imageHandler->getImageTileWidth();
-
-  return m_tileFiles[0].imageHandler->getNumberOfSamples();
-}
-
-//*************************************************************************************************
-//! Returns the tile height of the image or 0 if the image is not tiled.
-//! Note: this is not the same as the ossimImageSource::getTileHeight which
-//! returns the output tile height which can be different than the internal
-//! image tile height on disk.
-//*************************************************************************************************
-ossim_uint32 ossimTiledImageHandler::getImageTileHeight() const
-{
-   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
-      return 0;
-
-   if (m_tileFiles[0].imageHandler->isImageTiled())
-      return m_tileFiles[0].imageHandler->getImageTileHeight();
-
-   return m_tileFiles[0].imageHandler->getNumberOfLines();
-}
-
-//*************************************************************************************************
-//! Returns scalar type of first tile (should be the same for all tiles)
-//*************************************************************************************************
-ossimScalarType ossimTiledImageHandler::getOutputScalarType() const
-{
-   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
-      return OSSIM_SCALAR_UNKNOWN;
-
-   return m_tileFiles[0].imageHandler->getOutputScalarType();
-}
-
-//*************************************************************************************************
-//! Returns overall bounding rect in image space.
-//*************************************************************************************************
-ossimIrect ossimTiledImageHandler::getImageRectangle(ossim_uint32 resLevel) const
-{
-   if (resLevel == 0)
-      return m_fullImgRect;
-
-   ossimDpt decimation;
-   getDecimationFactor(resLevel, decimation);
-
-   return m_fullImgRect*decimation;
-}
-
-
-#if USING_SUB_OVRS
-//*************************************************************************************************
-// Overrides base class
-//*************************************************************************************************
-void ossimTiledImageHandler::completeOpen()
-{
-   openOverview();
-   openValidVertices();
-}
-
-//*************************************************************************************************
-//! Will build over files, one for each tile file.
-//! @param includeFullResFlag if true the full resolution layer will also
-//! be put in the overview format.  This is handy for inefficient formats.
-//*************************************************************************************************
-bool ossimTiledImageHandler::buildOverview(ossimImageHandlerOverviewCompressionType ctype, 
-                                            ossim_uint32 qual,
-                                            ossimFilterResampler::ossimFilterResamplerType rtype,
-                                            bool ifr_flag)
-{
-   if (m_tileFiles.size() == 0)
-      return false;
-
-   bool all_ok = true;
-   vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
-   while ((iter != m_tileFiles.end()) && all_ok)
-   {
-      if (!(*iter).imageHandler->hasOverviews())
-      {
-         ossimNotify(ossimNotifyLevel_INFO)<<"\nBuilding overview for <"
-            <<(*iter).imageHandler->getFilename()<<">"<<std::endl;
-
-         all_ok = (*iter).imageHandler->buildOverview(ctype, qual, rtype, ifr_flag);
-      }
-      ++iter;
-   }
-
-   // Overviews for subimage tile-files have been processed. However, we need to check the
-   // preferences for the overview stop dimension to see if we need additional decimation of the
-   // overall scene to achieve the final desired dimension.
-   ossimString stop_dim_str = 
-      ossimPreferences::instance()->findPreference(ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW);
-   if (!stop_dim_str.empty())
-   {
-      ossim_uint32 stop_dim = stop_dim_str.toUInt32();
-      ossimDpt decimation = theDecimationFactors.back();
-      ossim_uint32 nlines = decimation.y * m_fullImgRect.height();
-      ossim_uint32 nsamps = decimation.x * m_fullImgRect.width();
-      if ((nlines > stop_dim) || (nsamps > stop_dim))
-      {
-         // Need to continue decimating. These decimations are stored in an overall scene file.
-         // Need subimage OVRs open for this next operation:
-         openOverview();
-
-         ossimTiffOverviewBuilder tob;
-         tob.setInputSource(this);
-         theOverviewFile = getFilenameWithThisExtension("ovr");
-
-         // This magically takes over where we left off in decimating:
-         if (tob.buildOverview(theOverviewFile))
-         {
-            // Overview was successfully written, now open it:
-            theOverview = new ossimTiffTileSource;
-            all_ok = openOverview();
-         }
-      }
-   }
-
-   return all_ok;
-}
-
-//*************************************************************************************************
-// Will open overview files for all tile files. Actually, the tile-files will already have opened
-// their individual overviews, so this method only verifies the fact and initializes the 
-// associated subimage rects at all decimation levels.
-//*************************************************************************************************
-bool ossimTiledImageHandler::openOverview()
-{
-   if (m_tileFiles.size() == 0)
-      return false;
-
-   theDecimationFactors.clear();
-   bool all_ok = true;
-   ossimRefPtr<ossimImageHandler> handler = 0;
-   vector<ossimDpt> factors;
-   ossim_uint32 min_num_rlevels = 999;
-
-   // Loop over all tile-files to verify their OVR was opened and to calculate the associated 
-   // subimage rects at each res level:
-   vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
-   while ((iter != m_tileFiles.end()) && all_ok)
-   {
-      handler = (*iter).imageHandler;
-      if (!handler.valid())
-      {
-         ++iter;
-         continue;
-      }
-
-      if ((*iter).subImageRects.size() == 0)
-      {
-         ossimNotify(ossimNotifyLevel_INFO)<<"\nBounding image rectangle not defined for <"
-            <<(*iter).imageHandler->getFilename()<<">! Cannot proceed with overviews."<<std::endl;
-         all_ok = false;
-      }
-
-      else if (handler->getOverview())
-      {
-         // Only verified that overview for tile-file was opened. Check number of decimation levels
-         // to latch minimum:
-         (*iter).overviewIsOpen = true;
-         handler->getDecimationFactors(factors);
-
-         if (factors.size() < min_num_rlevels)
-            min_num_rlevels = (ossim_uint32) factors.size();
-
-         // Need to determine the sub image rects at each decimation level:
-         ossimIrect subRectR0 ((*iter).subImageRects[0]);
-         for (ossim_uint32 i=1; i<(ossim_uint32)factors.size(); i++)
-         {
-            ossimIrect r (factors[i].x * subRectR0.ul().x, factors[i].y * subRectR0.ul().y,
-               factors[i].x * subRectR0.lr().x, factors[i].y * subRectR0.lr().y);
-            (*iter).subImageRects.push_back(r);
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_INFO)<<"\nNo overview available for <"
-            <<(*iter).imageHandler->getFilename()<<">"<<std::endl;
-         all_ok = false;
-      }
-      ++iter;
-   }
-
-   // Assuming here that the first tile will always provide a good representation of the decimations
-   // for all res levels in all tile-files. This may not be true.
-   if (m_tileFiles.size() && m_tileFiles[0].imageHandler.valid())
-   {
-      m_tileFiles[0].imageHandler->getDecimationFactors(theDecimationFactors);
-      theDecimationFactors.resize(min_num_rlevels);
-   }
-
-   // Check for overall scene overview file, that takes over where the individual tile-file
-   // overviews leave off:
-   theOverviewFile = getFilenameWithThisExtension("ovr");
-   if (!theOverviewFile.exists())
-      theOverviewFile.setExtension("OVR");
-   if (theOverviewFile.exists())
-   {
-      m_lockSubOvrs = true; // prevent closing and reopening of subimage ovrs
-      ossimImageHandler::openOverview(theOverviewFile);
-      m_lockSubOvrs = false; // reset
-      if (theOverview.valid())
-      {
-         vector<ossimDpt> extra_decimations;
-         theOverview->getDecimationFactors(extra_decimations);
-         if (extra_decimations.size())
-         {
-            // Obtain the decimations and add it to our decimation list:
-            m_startOvrResLevel = (ossim_uint32) theDecimationFactors.size();
-            ossimDpt start_decimation (theDecimationFactors.back() * 0.5);
-            ossimDpt decimation;
-            for (ossim_uint32 i=0; i<extra_decimations.size(); i++)
-            {
-               decimation.x = start_decimation.x*extra_decimations[i].x;
-               decimation.y = start_decimation.y*extra_decimations[i].y;
-               theDecimationFactors.push_back(decimation);
-            }
-         }
-      }
-   }
-
-   return all_ok;
-}
-
-//*************************************************************************************************
-//! Will close all tile files' overviews.
-//*************************************************************************************************
-void ossimTiledImageHandler::closeOverview()
-{
-   if (theOverview.valid())
-      theOverview = 0;
-
-   if (m_lockSubOvrs == false)
-   {
-      vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
-      while ((iter != m_tileFiles.end()))
-      {
-         if ((*iter).imageHandler.valid())
-            (*iter).imageHandler->closeOverview();
-
-         ++iter;
-      }
-   }
-}
-
-//*************************************************************************************************
-//! Will return TRUE if all tile files have overviews.
-//*************************************************************************************************
-bool ossimTiledImageHandler::hasOverviews() const
-{
-   bool all_have_ovrs = true;
-   vector<ossimTileFile>::const_iterator iter = m_tileFiles.begin();
-   while ((iter != m_tileFiles.end()) && all_have_ovrs)
-   {
-      if (((*iter).imageHandler.valid()) && !((*iter).imageHandler->hasOverviews()))
-         all_have_ovrs = false;
-      ++iter;
-   }
-   return all_have_ovrs;
-}
-
-//*************************************************************************************************
-//! Returns the number of decimation (resolution) levels. This is the minimum number
-//! among all sub-image tile-files.
-//*************************************************************************************************
-ossim_uint32 ossimTiledImageHandler::getNumberOfDecimationLevels() const
-{
-   return (ossim_uint32) theDecimationFactors.size();
-}
-
-#endif /* #if USING_SUB_OVRS */
-
-
diff --git a/ossim/src/ossim/imaging/ossimTiling.cpp b/ossim/src/ossim/imaging/ossimTiling.cpp
deleted file mode 100644
index db2ef27..0000000
--- a/ossim/src/ossim/imaging/ossimTiling.cpp
+++ /dev/null
@@ -1,988 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: implementation for image generator
-//
-//*************************************************************************
-// $Id: ossimTiling.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <sstream>
-#include <iomanip>
-#include <ossim/imaging/ossimTiling.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug("ossimTiling:debug");
-
-RTTI_DEF1(ossimTiling, "ossimTiling", ossimObject);
-
-ossimTiling::ossimTiling()
-      :theTilingDistance(0,0),
-       theTilingDistanceUnitType(OSSIM_UNIT_UNKNOWN),
-       theDelta(0,0),
-       theDeltaType(ossimTilingDeltaType_TOTAL_PIXELS),
-       theOutputSizeInBytes(0),
-       theNumberOfBands(1),
-       theNumberOfBytesPerPixelPerBand(1),
-       thePaddingSizeInPixels(0.0, 0.0),
-       theMapProjection(),
-       theImageRect(),
-       theTilingRect(),
-       theTileId(-1),
-       theTotalHorizontalTiles(0),
-       theTotalVerticalTiles(0),
-       theTotalTiles(0),
-       theTileNameMask(),
-       theEdgeToEdgeFlag(false)
-{
-}
-
-bool ossimTiling::initialize(const ossimMapProjection& proj,
-                             const ossimIrect& boundingRect)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTiling::initialize DEBUG: Entered..."
-         << "\nBounding rect === " << boundingRect
-         << std::endl;
-   }
-   
-   bool result = true;
-   theMapProjection = (ossimMapProjection*)proj.dup();
-   theImageRect     = boundingRect;
-
-   result = validate();
-
-   ossimDpt convertedTilingDistance = theTilingDistance;
-
-   if(result)
-   {
-      // Let's setup the bounding tile rect.
-      if(theTilingDistanceUnitType != OSSIM_PIXEL)
-      {
-         getConvertedTilingDistance(convertedTilingDistance);
-         
-         if(theMapProjection->isGeographic())
-         {
-            ossimGpt ul;
-            ossimGpt ur;
-            ossimGpt lr;
-            ossimGpt ll;
-
-            theMapProjection->lineSampleToWorld(theImageRect.ul(),
-                                                ul);
-            theMapProjection->lineSampleToWorld(theImageRect.ur(),
-                                                ur);
-            theMapProjection->lineSampleToWorld(theImageRect.lr(),
-                                                lr);
-            theMapProjection->lineSampleToWorld(theImageRect.ll(),
-                                                ll);
-
-            theTilingRect = ossimDrect(ossimDpt(ul),
-                                       ossimDpt(ur),
-                                       ossimDpt(lr),
-                                       ossimDpt(ll),
-                                       OSSIM_RIGHT_HANDED);
-
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG: Geographic input bounds =  "
-                  << theTilingRect
-                  << std::endl;
-            }
-            
-            theTilingRect.stretchToTileBoundary(convertedTilingDistance);
-            
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG: Geographic input bounds stretched =  "
-                  << theTilingRect << std::endl;
-            }
-            
-            clampGeographic(theTilingRect);
-
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG: Geographic input bounds clamped =  "
-                  << theTilingRect << std::endl;
-            }
-
-         }  // End "if(theMapProjection->isGeographic())"
-         
-         else // meters
-         {
-            ossimDpt ul;
-            ossimDpt ur;
-            ossimDpt lr;
-            ossimDpt ll;
-            
-            theMapProjection->lineSampleToEastingNorthing(theImageRect.ul(),
-                                                          ul);
-            theMapProjection->lineSampleToEastingNorthing(theImageRect.ur(),
-                                                          ur);
-            theMapProjection->lineSampleToEastingNorthing(theImageRect.lr(),
-                                                          lr);
-            theMapProjection->lineSampleToEastingNorthing(theImageRect.ll(),
-                                                          ll);
-            theTilingRect = ossimDrect(ul,
-                                       ur,
-                                       lr,
-                                       ll,
-                                       OSSIM_RIGHT_HANDED);
-            
-            theTilingRect.stretchToTileBoundary(convertedTilingDistance);
-         }
-      }
-      else
-      {
-         ossim_int32 remainderX = (ossim_int32)((theImageRect.width()%((ossim_int32)theDelta.x)) != 0);
-         ossim_int32 remainderY = (ossim_int32)((theImageRect.height()%((ossim_int32)theDelta.y)) != 0);
-         
-         ossim_int32 w = (ossim_int32)((theImageRect.width()/(ossim_int32)theDelta.x)*theDelta.x +
-                                       (remainderX*theDelta.x));
-         ossim_int32 h = (ossim_int32)((theImageRect.height()/(ossim_int32)theDelta.y)*theDelta.y +
-                                       (remainderY*theDelta.y));
-         theTilingRect = ossimDrect(theImageRect.ul().x,
-                                    theImageRect.ul().y,
-                                    theImageRect.ul().x + (w-1),
-                                    theImageRect.ul().y + (h-1));
-
-         // since we are pixel space we force delta to be 1 pixel unit
-         //
-         theDelta.x   = 1.0;
-         theDelta.y   = 1.0;
-         theDeltaType = ossimTilingDeltaType_PER_PIXEL;
-      }
-   }
-   
-   theTotalHorizontalTiles = ossim::round<int>(fabs(theTilingRect.ur().x - theTilingRect.ul().x)/convertedTilingDistance.x);
-   theTotalVerticalTiles   = ossim::round<int>(fabs(theTilingRect.ur().y - theTilingRect.lr().y)/convertedTilingDistance.y);
-   theTotalTiles           = theTotalHorizontalTiles*theTotalVerticalTiles;
-
-   // reset the tile id to the beginning
-   //
-   reset();
-   
-   if(traceDebug())
-   {
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-      
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nossimTiling::initialize DEBUG: Leaving..." << std::endl;
-   }
-   return result;
-}
-
-bool ossimTiling::next(ossimRefPtr<ossimMapProjection>& resultProjection,
-                       ossimIrect& resultingBounds,
-                       ossimString& resultingName)const
-{
-   bool result = true;
-   
-   if(theTileId < theTotalTiles)
-   {
-      ossimDpt origin;
-      ossim_int64 row=0;
-      ossim_int64 col=0;
-
-      getRowCol(row, col, theTileId);
-
-      getTileName(resultingName,
-                  row, col, theTileId);
-      
-      getOrigin(origin, row, col);
-
-      if(theTilingDistanceUnitType == OSSIM_PIXEL)
-      {
-         ossimIpt ul = origin;
-
-         resultingBounds =
-            ossimIrect(ul.x - (ossim_int32)thePaddingSizeInPixels.x,
-                       ul.y - (ossim_int32)thePaddingSizeInPixels.y,
-                       ul.x + ((ossim_int32)theTilingDistance.x-1) +
-                       (ossim_int32)thePaddingSizeInPixels.x,
-                       ul.y + ((ossim_int32)theTilingDistance.y-1) +
-                       (ossim_int32)thePaddingSizeInPixels.y);
-      }
-      else
-      {
-         
-         ossimDpt deltaPerPixel = getDeltaPerPixel();
-         ossimIpt pixels;
-
-         if(theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS)
-         {
-            pixels =   theDelta;
-         }
-         else
-         {
-            pixels =   ossimDpt(theTilingDistance.x/theDelta.x,
-                                theTilingDistance.y/theDelta.y);
-         }
-
-         if(theMapProjection->isGeographic())
-         {
-            if ( theEdgeToEdgeFlag )
-            {
-               theMapProjection->setUlTiePoints(
-                  ossimGpt( origin.lat - (deltaPerPixel.y/2.0),
-                            origin.lon + (deltaPerPixel.x/2.0),
-                            0.0,
-                            theMapProjection->origin().datum()) );
-            }
-            else
-            {
-               theMapProjection->setUlTiePoints(
-                  ossimGpt(origin.lat,
-                           origin.lon,
-                           0.0,
-                           theMapProjection->origin().datum()));
-               
-            }
-            theMapProjection->setDecimalDegreesPerPixel(deltaPerPixel);
-         }
-         else
-         {
-            if ( theEdgeToEdgeFlag )
-            {
-               theMapProjection->setUlTiePoints(
-                  ossimDpt( origin.x + (deltaPerPixel.x/2.0),
-                            origin.y - (deltaPerPixel.y/2.0) ) );
-            }
-            else
-            {
-               theMapProjection->setUlTiePoints(ossimDpt(origin.x, origin.y));
-            }
-            theMapProjection->setMetersPerPixel(deltaPerPixel);
-         }
-         resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
-                                      -(ossim_int32)thePaddingSizeInPixels.y,
-                                      (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-                                      (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-      }
-      resultProjection = theMapProjection;
-
-      ++theTileId;
-      if(traceDebug()&&resultProjection.valid())
-      {
-         ossimKeywordlist projKwl;
-         
-         resultProjection->saveState(projKwl);
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimTiling::next DEBUG: rect = " << resultingBounds
-            << "\nproj                          = " << projKwl
-            << "\ntileName                      = " << resultingName
-            << "\norigin                        = " << origin << std::endl;
-      }
-   }
-   else
-   {
-      result = false;
-   }
-
-   
-   return result;
-}
-
-
-void ossimTiling::reset()
-{
-   theTileId = 0;
-}
-
-void ossimTiling::setTilingDistance(const ossimDpt& tilingDistance,
-                                    ossimUnitType unitType)
-{
-   theTilingDistance         = tilingDistance;
-   theTilingDistanceUnitType = unitType;
-}
-
-void ossimTiling::setDelta(const ossimDpt& delta,
-                           ossimTilingDeltaType deltaType)
-{
-   theDelta     = delta;
-   theDeltaType = deltaType;
-}
-
-bool ossimTiling::validate()const
-{
-   bool result = true;
-
-   if(theMapProjection.valid())
-   {
-      if(theMapProjection->isGeographic())
-      {
-         switch(theTilingDistanceUnitType)
-         {
-            case OSSIM_DEGREES:
-            case OSSIM_RADIANS:
-            case OSSIM_SECONDS:
-            case OSSIM_MINUTES:
-            case OSSIM_PIXEL:
-            {
-               break;
-            }
-            default:
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimTiling::validate()\n"
-                  << "Map projeciton requires tiling in angular units but the"
-                  << "\nspacing is in non angular" << std::endl;
-               result = false;
-            }
-         }
-      }
-      else
-      {
-         switch(theTilingDistanceUnitType)
-         {
-            case OSSIM_METERS:
-            case OSSIM_FEET:
-            case OSSIM_US_SURVEY_FEET:
-            case OSSIM_NAUTICAL_MILES:
-            case OSSIM_PIXEL:
-            case OSSIM_MILES:
-            case OSSIM_MILLIMETERS:
-            {
-               break;
-            }
-            default:
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimTiling::validate()"
-                  << "\nMap projeciton requires tiling using linear spacing"
-                  << " but the spacing is in non linear" << std::endl;
-               result = false;
-            }
-         }
-      }
-   }
-   else
-   {
-      result = false;
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTiling::validate()"
-         << "\nthe image projection is null and so not valid"
-         << std::endl;
-   }
-   if((theDelta.x <= FLT_EPSILON) ||
-      (theDelta.y <= FLT_EPSILON))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTiling::validate() the delta is too small or is negative"
-         << "value = " << theDelta << std::endl;
-      result = false;
-   }
-   if((theTilingDistance.x <= FLT_EPSILON)||
-      (theTilingDistance.y <= FLT_EPSILON))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTiling::validate()"
-         << "\nthe tiling distance is too small or is negative"
-         << "Value = " << theTilingDistance << std::endl;
-   }
-   
-   if(theImageRect.hasNans())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTiling::validate() the image rect has nans"
-         << std::endl;
-      result = false;
-   }
-   
-   return result;
-}
-
-bool ossimTiling::isAngularUnit(ossimUnitType unitType)const
-{
-   bool result = false;
-   
-   switch(unitType)
-   {
-      case OSSIM_DEGREES:
-      case OSSIM_RADIANS:
-      case OSSIM_SECONDS:
-      case OSSIM_MINUTES:
-      {
-         result = true;
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-   return result;
-}
-
-bool ossimTiling::isLinearUnit(ossimUnitType unitType)const
-{
-   bool result = false;
-   
-   switch(unitType)
-   {
-      case OSSIM_METERS:
-      case OSSIM_FEET:
-      case OSSIM_US_SURVEY_FEET:
-      case OSSIM_NAUTICAL_MILES:
-      case OSSIM_MILES:
-      case OSSIM_MILLIMETERS:
-      {
-         result = true;
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-   return result;
-   
-}
-
-void ossimTiling::setTileNameMask(const ossimString& mask)
-{
-   if(theTileNameMask == "")
-   {
-      theTileNameMask = "tile%i%";
-   }
-   if(mask.contains("%i%")||
-      mask.contains("%oc%")||
-      mask.contains("%or%")||
-      mask.contains("%r%")||
-      mask.contains("%c%")||
-      mask.contains("%SRTM%"))
-   {
-      theTileNameMask = mask;
-   }
-   else
-   {
-      theTileNameMask += "%i%";
-   }
-}
-
-ossimString ossimTiling::getTileNameMask()const
-{
-   return theTileNameMask;
-}
-
-bool ossimTiling::getRowCol(ossim_int64& row,
-                            ossim_int64& col,
-                            ossim_int64 tileId)const
-{
-   bool result = true;
-   
-   if((theTotalHorizontalTiles > 0)&&
-      (tileId < theTotalTiles))
-   {
-      row = tileId/static_cast<ossim_int64>(theTotalHorizontalTiles);
-      col = tileId%static_cast<ossim_int64>(theTotalHorizontalTiles);
-      if((col >= static_cast<ossim_int32>(theTotalHorizontalTiles)) &&
-         (row >= static_cast<ossim_int32>(theTotalVerticalTiles)))
-      {           
-         result = false;
-      }
-   }
-   return result;
-}
-
-bool ossimTiling::getOrigin(ossimDpt& origin,
-                            ossim_int64 tileId)const
-{
-   ossim_int64 row=0;
-   ossim_int64 col=0;
-   
-   bool result = getRowCol(row, col, tileId);
-   if(result)
-   {
-      result = getOrigin(origin, row, col);
-   }
-
-   return result;
-}
-
-bool ossimTiling::getOrigin(ossimDpt& origin,
-                            ossim_int64 row,
-                            ossim_int64 col)const
-{
-   bool result = false;
-
-   if((col < static_cast<ossim_int64>(theTotalHorizontalTiles)) &&
-      (row < static_cast<ossim_int64>(theTotalVerticalTiles)))
-   {
-      ossimDpt convertedTilingDistance;
-      getConvertedTilingDistance(convertedTilingDistance);
-
-      result = true;
-      if(theTilingRect.orientMode() == OSSIM_RIGHT_HANDED)
-      {
-         origin.x = theTilingRect.ul().x + col*convertedTilingDistance.x;
-         origin.y = theTilingRect.ul().y - row*convertedTilingDistance.y;
-      }
-      else
-      {
-         origin.x = theTilingRect.ul().x + col*convertedTilingDistance.x;
-         origin.y = theTilingRect.ul().y + row*convertedTilingDistance.y;
-      }
-   }
-
-   return result;
-}
-
-ossimDpt ossimTiling::getDeltaPerPixel()const
-{
-   
-   ossimDpt result = theDelta;
-
-   if (!theMapProjection)
-   {
-      return result;
-   }
-
-   if(theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS)
-   {
-      result = ossimDpt(theTilingDistance.x/theDelta.x,
-                        theTilingDistance.y/theDelta.y);
-   }
-
-   ossimUnitConversionTool unitConverter(theMapProjection->origin(),
-                                         1.0,
-                                         theTilingDistanceUnitType);
-   if(theMapProjection->isGeographic())
-   {
-      unitConverter.setValue(result.x, theTilingDistanceUnitType);
-      result.x = unitConverter.getValue(OSSIM_DEGREES);
-      
-      unitConverter.setValue(result.y,
-                             theTilingDistanceUnitType);
-      result.y = unitConverter.getValue(OSSIM_DEGREES);
-   }
-   else
-   {
-      unitConverter.setValue(result.x,
-                             theTilingDistanceUnitType);
-      result.x = unitConverter.getValue(OSSIM_METERS);
-      
-      unitConverter.setValue(result.y,
-                             theTilingDistanceUnitType);
-      result.y = unitConverter.getValue(OSSIM_METERS);
-   }
-
-   return result;
-}
-
-void ossimTiling::getTileName(ossimString& resultingName,
-                              ossim_int64 row,
-                              ossim_int64 col,
-                              ossim_int64 id)const
-{
-   if(theTileNameMask == "")
-   {
-      ostringstream idString;
-      idString << id;
-      resultingName = ossimString("tile") + idString.str().c_str();
-   }
-   else if(theTileNameMask.contains("%SRTM%"))
-   {
-      // must be a 1x1 degree tiling distance
-      //
-      if((theTilingDistanceUnitType == OSSIM_DEGREES)&&
-         (theTilingDistance.x == 1.0)&&
-         (theTilingDistance.x == 1.0))
-      {
-         ostringstream latString;
-         ostringstream lonString;
-         
-         resultingName = "";
-         ossimDpt origin;
-         getOrigin(origin, row, col);
-         // the name is lower left and not upper left 
-         // subtract one degree
-         //
-         origin.lat -=1;
-         latString << setfill('0') << setw(2) << fabs(origin.lat);
-         lonString << setfill('0') << setw(3) << fabs(origin.lon);
-         
-         if(origin.lat < 0.0)
-         {
-            resultingName += "S";
-         }
-         else 
-         {
-            resultingName += "N";
-         }
-         resultingName += latString.str().c_str();
-         if(origin.lon < 0.0)
-         {
-            resultingName += "W";
-         }
-         else
-         {
-            resultingName += "E";
-         }
-         resultingName += lonString.str().c_str();
-         resultingName += ".hgt";
-      }
-   }
-   else
-   {
-      ostringstream rowString;
-      ostringstream colString;
-      ostringstream idString;
-      ostringstream oRowString;
-      ostringstream oColString;
-      ossimDpt      origin;
-      getOrigin(origin, row, col);
-      
-      rowString << row;
-      colString << col;
-      idString  << id;
-      oRowString << row;
-      oColString << col;
-      
-      resultingName = theTileNameMask;
-      resultingName = resultingName.substitute("%r%",
-                                               rowString.str().c_str());
-      resultingName = resultingName.substitute("%c%",
-                                               colString.str().c_str());
-      resultingName = resultingName.substitute("%i%",
-                                               idString.str().c_str());
-      resultingName = resultingName.substitute("%oc",
-                                               oColString.str().c_str());
-      resultingName = resultingName.substitute("%or",
-                                               oRowString.str().c_str());
-   }
-}
-
-void ossimTiling::clampGeographic(ossimDrect& rect)const
-{
-   ossimDpt ul = rect.ul();
-   ossimDpt lr = rect.lr();
-
-   if(ul.lat > 90) ul.lat = 90.0;
-   if(lr.lat < -90.0) lr.lat = -90.0;
-
-   if(ul.lon < -180) ul.lon = -180;
-   if(lr.lon > 180)  lr.lon = 180;
-
-   rect = ossimDrect(ul, lr, rect.orientMode());
-}
-
-bool ossimTiling::saveState(ossimKeywordlist& kwl,
-                            const char* prefix)const
-{
-   std::stringstream tilingDistance;
-
-   tilingDistance << theTilingDistance.x << " " << theTilingDistance.y << std::endl;
-   
-   kwl.add(prefix,
-           "tiling_distance",
-           tilingDistance.str().c_str(),
-           true);
-
-   
-   kwl.add(prefix,
-           "tiling_distance_type",
-           ossimUnitTypeLut::instance()->
-           getTableIndexString(theTilingDistanceUnitType),
-           true);
-   std::ostringstream delta;
-   delta << theDelta.x << " " << theDelta.y;
-   kwl.add(prefix,
-           "delta",
-           delta.str().c_str(),
-           true);
-   
-   if(theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS)
-   {
-      kwl.add(prefix,
-              "delta_type",
-              "total_pixels",
-              true);
-   }
-   else
-   {
-      kwl.add(prefix,
-              "delta_type",
-              "delta_per_pixels",
-              true);
-   }
-   std::ostringstream padding;
-
-   padding << thePaddingSizeInPixels.x << " " << thePaddingSizeInPixels.y;
-   kwl.add(prefix,
-           "padding_size_in_pixels",
-           padding.str().c_str(),
-           true);
-
-   kwl.add(prefix,
-           "tile_name_mask",
-           theTileNameMask.c_str(),
-           true);
-
-   if (theOutputSizeInBytes)
-   {
-      kwl.add(prefix,
-              "output_size_in_bytes",
-              ossimString::toString(theOutputSizeInBytes).c_str(),
-              true);
-      kwl.add(prefix,
-              "output_bands",
-              theNumberOfBands,
-              true);
-      kwl.add(prefix,
-              "output_bytes_per_pixel_per_band",
-              theNumberOfBytesPerPixelPerBand,
-              true);
-   }
-
-   kwl.add(prefix,
-           "edge_to_edge",
-           ossimString::toString(theEdgeToEdgeFlag),
-           true);
-   
-   
-   return true;
-}
-
-bool ossimTiling::loadState(const ossimKeywordlist& kwl,
-                            const char* prefix)
-{
-   bool result = false;
-   
-   // Get the mask if any.
-   theTileNameMask = kwl.find(prefix, "tile_name_mask");
-   setTileNameMask(theTileNameMask);
-
-   const char* paddingSizeInPixels = kwl.find(prefix,
-                                              "padding_size_in_pixels");
-   if (paddingSizeInPixels)
-   {
-      ossimString x,y;
-      std::istringstream padding(ossimString(paddingSizeInPixels).c_str());
-      padding >> x >> y;
-      thePaddingSizeInPixels.x = x.toFloat64();
-      thePaddingSizeInPixels.y = y.toFloat64();
-   }
-   
-   // Check to tile by size in bytes.
-   const char* lookup;
-   if (kwl.numberOf(prefix, "output_size_in_"))
-   {
-      lookup = kwl.find(prefix, "output_size_in_bytes");
-      if (lookup)
-      {
-         theOutputSizeInBytes = ossimString(lookup).toInt64();
-      }
-      lookup = kwl.find(prefix, "output_size_in_kilo_bytes");
-      if (lookup)
-      {
-         theOutputSizeInBytes = ossimString(lookup).toInt64() * 1024;
-      }
-      lookup = kwl.find(prefix, "output_size_in_mega_bytes");
-      if (lookup)
-      {
-         theOutputSizeInBytes = ossimString(lookup).toInt64() * 1024 * 1024;
-      }
-   }
-
-   if (theOutputSizeInBytes)
-   {
-      
-      lookup = kwl.find(prefix, "output_bands");
-      if (lookup)
-      {
-         theNumberOfBands = ossimString(lookup).toInt32();
-      }
-      lookup = kwl.find(prefix, "output_bytes_per_pixel_per_band");
-      if (lookup)
-      {
-         theNumberOfBytesPerPixelPerBand = ossimString(lookup).toInt32();
-      }
-      
-      ossim_int64 pixelsPerBand = theOutputSizeInBytes /
-         (theNumberOfBands * theNumberOfBytesPerPixelPerBand);
-      
-      ossim_int32 oneDimension =
-         static_cast<ossim_int32>(floor(sqrt((double)pixelsPerBand)));
-
-      //---
-      // TODO: Clamp to power of two option. (drb)
-      //---
-      // theDelta.x = oneDimension;
-      // theDelta.y = oneDimension;
-      // theTilingDistance.x = 1;
-      // theTilingDistance.y = 1;
-      
-      theDelta.x = 1;
-      theDelta.y = 1;
-      theTilingDistance.x = oneDimension;
-      theTilingDistance.y = oneDimension;
-      theDeltaType = ossimTilingDeltaType_TOTAL_PIXELS;
-      theTilingDistanceUnitType = OSSIM_PIXEL;
-      result = true;
-   }
-   else
-   {
-      const char* tilingDistance = kwl.find(prefix,
-                                            "tiling_distance");
-      const char* tilingDistanceType = kwl.find(prefix,
-                                                "tiling_distance_type");
-      const char* delta = kwl.find(prefix,
-                                   "delta");
-      
-      const char* deltaType = kwl.find(prefix,
-                                       "delta_type");
-      
-      result = tilingDistance&&tilingDistanceType&&delta&&deltaType&&paddingSizeInPixels;
-      ossimString x,y;
-      std::istringstream distance(ossimString(tilingDistance).c_str());
-      distance >> x >> y;
-      theTilingDistance.x = x.toFloat64();
-      theTilingDistance.y = y.toFloat64();
-      if(theTilingDistance.x <= 0.0)
-      {
-         theTilingDistance.x = 1.0;
-      }
-      if(theTilingDistance.y<=0.0)
-      {
-         theTilingDistance.y = theTilingDistance.x;
-      }
-      
-      // unitLut.getTableIndexString(theTilingDistanceUnitType), ?????
-      
-      theTilingDistanceUnitType = (ossimUnitType)
-         ossimUnitTypeLut::instance()->getEntryNumber(
-            ossimString(tilingDistanceType).c_str());
-      
-      theDelta = ossimDpt(0,0);
-      x="";
-      y="";
-      std::istringstream deltaValues(ossimString(delta).c_str());
-      deltaValues >> x >> y;
-      theDelta.x = x.toFloat64();
-      theDelta.y = y.toFloat64();
-      
-      if(theDelta.x <= 0.0)
-      {
-         theDelta.x = 1.0;
-      }
-      
-      if(theDelta.y <= 0.0)
-      {
-         theDelta.y = theDelta.x;
-      }
-      
-      if(ossimString(deltaType).downcase().contains("total"))
-      {
-         theDeltaType = ossimTilingDeltaType_TOTAL_PIXELS;
-      }
-      else
-      {
-         theDeltaType = ossimTilingDeltaType_PER_PIXEL;
-      }
-   }
-   
-   lookup = kwl.find(prefix, "edge_to_edge");
-   if ( lookup )
-   {
-      theEdgeToEdgeFlag = ossimString::toBool(lookup);
-   }
-      
-   if (traceDebug())
-   {
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-
-   return result;
-}
-
-std::ostream& ossimTiling::print(std::ostream& out) const
-{
-   out << "theTilingDistance:                 " << theTilingDistance
-       << "\ntheTilingDistanceUnitType:       " << theTilingDistanceUnitType
-       << "\ntheDelta:                        " << theDelta
-       << "\ntheDeltaType:                    " << theDeltaType
-       << "\nthePaddingSizeInPixels:          " << thePaddingSizeInPixels
-       << "\ntheImageRect:                    " << theImageRect
-       << "\ntheTilingRect:                   " << theTilingRect
-       << "\ntheTileId:                       " << theTileId
-       << "\ntheTotalHorizontalTiles:         " << theTotalHorizontalTiles
-       << "\ntheTotalVerticalTiles:           " << theTotalVerticalTiles
-       << "\ntheTotalTiles:                   " << theTotalTiles
-       << "\ntheTileNameMask:                 " << theTileNameMask
-       << "\ntheOutputSizeInBytes:            " << theOutputSizeInBytes
-       << "\ntheNumberOfBands:                " << theNumberOfBands
-       << "\ntheNumberOfBytesPerPixelPerBand: " <<
-      theNumberOfBytesPerPixelPerBand
-       << "\ntheEdgeToEdgeFlag:               " << theEdgeToEdgeFlag
-       << "\n";
-
-   if (theMapProjection.valid())
-   {
-      out << "\ntheMapProjection:\n";
-      theMapProjection->print(out);
-   }
-   else
-   {
-      out << "theMapProjection is not set.";
-   }
-   out << endl;
-
-   return out;
-}
-
-void ossimTiling::getConvertedTilingDistance(ossimDpt& pt) const
-{
-   if(theTilingDistanceUnitType == OSSIM_PIXEL)
-   {
-      pt = theTilingDistance;
-      return;
-   }
-   if (!theMapProjection)
-   {
-      // This should not happen...
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTiling::getConvertedTilingDistance WARNING"
-         << " projection not set!" << endl;
-      pt = theTilingDistance;
-      return;
-   }
-   ossimUnitConversionTool unitConverter(theMapProjection->origin(),
-                                         1.0,
-                                         theTilingDistanceUnitType);
-
-   if(theMapProjection->isGeographic())
-   {
-      unitConverter.setValue(theTilingDistance.x,
-                             theTilingDistanceUnitType);
-      pt.x = unitConverter.getValue(OSSIM_DEGREES);
-      
-      unitConverter.setValue(theTilingDistance.y,
-                             theTilingDistanceUnitType);
-      pt.y = unitConverter.getValue(OSSIM_DEGREES);
-   }
-   else
-   {
-      unitConverter.setValue(theTilingDistance.x,
-                             theTilingDistanceUnitType);
-      pt.x = unitConverter.getValue(OSSIM_METERS);
-      
-      unitConverter.setValue(theTilingDistance.y,
-                             theTilingDistanceUnitType);
-      pt.y = unitConverter.getValue(OSSIM_METERS);
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTilingPoly.cpp b/ossim/src/ossim/imaging/ossimTilingPoly.cpp
deleted file mode 100644
index 52a0ce8..0000000
--- a/ossim/src/ossim/imaging/ossimTilingPoly.cpp
+++ /dev/null
@@ -1,370 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Mingjie Su
-// 
-// Description: implementation for image generator
-//
-//*************************************************************************
-// $Id: ossimTilingPoly.cpp 2725 2011-06-15 18:13:07Z david.burken $
-
-#include <sstream>
-#include <iomanip>
-#include <ossim/imaging/ossimTilingPoly.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimEsriShapeFileInterface.h>
-
-static ossimTrace traceDebug("ossimTilingPoly:debug");
-
-RTTI_DEF1(ossimTilingPoly, "ossimTilingPoly", ossimTilingRect);
-
-ossimTilingPoly::ossimTilingPoly()
-      : ossimTilingRect(),
-      m_shpFilename(""),
-      m_useMbr(true),
-      m_bufferDistance(0.0),
-      m_exteriorCut(0),
-      m_interiorCut(0),
-      m_featureBoundingIntersect(true)
-{
-}
-
-ossimTilingPoly::~ossimTilingPoly()
-{
-   m_exteriorCut = 0; // Ref ptr, not a leak.
-   m_interiorCut = 0; // ditto...
-   m_features.clear();
-}
-
-bool ossimTilingPoly::initialize(const ossimMapProjection& proj,
-                             const ossimIrect& boundingRect)
-{
-   bool result = false;
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTilingPoly::initialize DEBUG: Entered..."
-         << "\nBounding rect === " << boundingRect
-         << std::endl;
-   }
-
-   ossimDpt convertedTilingDistance = theTilingDistance;
-   result = initializeBase(proj, boundingRect, convertedTilingDistance);
-   if (result)
-   {
-      return parseShpFile();
-   }
-   return result;
-}
-
-bool ossimTilingPoly::next(ossimRefPtr<ossimMapProjection>& resultProjection,
-                           ossimIrect& resultingBounds,
-                           ossimString& resultingName)
-{
-   bool result = true;
-   
-   if(theTileId < theTotalTiles)
-   {
-      ostringstream idString;
-      ossim_int64 tileId = theTileId + 1;
-      if (tileId < static_cast<ossim_int64>(m_features.size()))
-      {
-         idString  << m_features[tileId].m_fid;
-         resultingName = theTileNameMask;
-         resultingName = resultingName.substitute("%f%", idString.str().c_str());
-      }
-      result = nextFeature();
-      resultingBounds = m_exteriorCut->getRectangle();
-
-      resultProjection = theMapProjection;
-
-      ++theTileId; 
-   }
-   else
-   {
-      result = false;
-   }
-
-   return result;
-}
-
-bool ossimTilingPoly::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   kwl.add(prefix,
-           "tile_source",
-           m_shpFilename.c_str(),
-           true);
-
-   kwl.add(prefix,
-      "paddding_use_mbr",
-      m_useMbr,
-      true);
-
-   return  ossimTilingRect::saveState(kwl, prefix);;
-}
-
-bool ossimTilingPoly::loadState(const ossimKeywordlist& kwl,
-                            const char* prefix)
-{
-   bool result = ossimTilingRect::loadState(kwl, prefix);
-   
-   //Get the shp file if any
-   m_shpFilename = kwl.find(prefix, "tile_source");
-
-   // Get the mask if any.
-   if (!m_shpFilename.empty())
-   {
-      if (theTileNameMask.contains("%r%_%c%"))
-      {
-         theTileNameMask = theTileNameMask.substitute("%r%_%c%", "%f%", true);
-      }
-      result = true;
-   }
- 
-   const char* useMbr = kwl.find(prefix, "padding_use_mbr");
-   if (useMbr)
-   {
-      if (!ossimString(useMbr).toBool())
-      {
-         m_useMbr = false;
-         m_bufferDistance = thePaddingSizeInPixels.x;
-      }
-   }
-
-   return result;
-}
-
-bool ossimTilingPoly::nextFeature()
-{
-   if (m_exteriorCut == 0)
-   {
-      m_exteriorCut = new ossimGeoPolyCutter;
-      m_exteriorCut->setView(theMapProjection.get());
-   }
-   
-   bool result = false;
-   ossim_int64 tileId = theTileId + 1;//use (theTileId+1) because theTileId is intialized as -1
-   if (tileId < static_cast<ossim_int64>(m_features.size())) 
-   {
-      if (m_features[tileId].m_polygon.size() > 0)
-      {
-         if (m_features[tileId].m_polyType == ossimGeoAnnotationPolyObject::OSSIM_POLY_INTERIOR_RING)
-         {
-            if (m_interiorCut == 0)
-            {
-               m_interiorCut = new ossimGeoPolyCutter;
-               m_interiorCut->setView(theMapProjection.get());
-               m_interiorCut->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
-            }
-            m_interiorCut->setPolygon(m_features[tileId].m_polygon);
-         }
-         else
-         {
-            // std::vector<ossimGpt> points = m_features[tileId].m_polygon;
-            // for (ossim_uint32 i = 0; i < points.size(); i++)
-            // {
-            //    ossimGpt point = points[i];
-            // }
-            m_exteriorCut->setPolygon(m_features[tileId].m_polygon);
-            setRect();
-         }
-         result = true;
-      }
-      else if (m_features[tileId].m_multiPolys.size() > 0)
-      {
-         for (ossim_uint32 i = 0; i < m_features[tileId].m_multiPolys.size(); i++)
-         {
-            ossimGeoPolygon geoPoly = m_features[tileId].m_multiPolys[i];
-            std::vector<ossimGeoPolygon> holePolys = geoPoly.getHoleList();
-            if (holePolys.size() > 0)
-            {
-               if (m_interiorCut == 0)
-               {
-                  m_interiorCut = new ossimGeoPolyCutter;
-                  m_interiorCut->setView(theMapProjection.get());
-                  m_interiorCut->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
-               }
-               m_interiorCut->clear();
-               for (ossim_uint32 j = 0; j < holePolys.size(); j++)
-               {
-                  m_interiorCut->addPolygon(holePolys[j]);
-               }
-            }
-            m_exteriorCut->setPolygon(m_features[tileId].m_multiPolys[i]);
-            setRect();
-         }
-         result = true;
-      }
-   }
-   else
-   {
-      result = false;
-   }
-   return result;
-}
-
- void ossimTilingPoly::setRect()
- {
-    ossimIrect rect = m_exteriorCut->getRectangle();
-    if (rect.intersects(theImageRect))
-    {
-       m_featureBoundingIntersect = true;
-       if (!rect.completely_within(theImageRect))
-       {
-          ossimIrect clipRect = rect.clipToRect(theImageRect);
-          m_exteriorCut->setRectangle(clipRect);
-          rect = clipRect;
-       }
-    }
-    else
-    {
-       m_featureBoundingIntersect = false;
-    }
-    if (m_useMbr)
-    {
-       if (thePaddingSizeInPixels.x > 0 && thePaddingSizeInPixels.y > 0)
-       {
-          ossimIrect newRect = ossimIrect(rect.ul().x-(ossim_int32)thePaddingSizeInPixels.x,
-             rect.ul().y-(ossim_int32)thePaddingSizeInPixels.y,
-             rect.lr().x + (ossim_int32)thePaddingSizeInPixels.x,
-             rect.lr().y + (ossim_int32)thePaddingSizeInPixels.y);
-          ossimIrect clipRect = newRect.clipToRect(theImageRect);//in case the bounding is larger than input image after adding buffer
-          m_exteriorCut->setRectangle(clipRect);
-       }
-    }
- }
-
-bool ossimTilingPoly::parseShpFile()
-{
-   m_features.clear();
-
-   ossimString query = "";
-   bool result = false;
-   if (m_shpFilename.contains("|"))
-   {
-      ossimString fileName = m_shpFilename;
-      std::vector<ossimString> fileList = fileName.split("|");
-      if (fileList.size() > 1)
-      {
-         m_shpFilename = fileList[0];
-         query = fileList[1];
-      }
-   }
-
-   ossimRefPtr<ossimImageHandler> shpHandler = ossimImageHandlerRegistry::instance()->open(m_shpFilename);
-   ossimEsriShapeFileInterface* shpInterface = PTR_CAST(ossimEsriShapeFileInterface, shpHandler.get());
-   if (shpInterface != 0)
-   {
-      if (!query.empty())
-      {
-         shpInterface->setQuery(query);
-      }
-      if (m_useMbr == false)
-      {
-         ossimProjection* proj = shpHandler->getImageGeometry()->getProjection();
-         ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);
-         if (mapProj)
-         {
-            if (mapProj->isGeographic())
-            {
-               m_bufferDistance = thePaddingSizeInPixels.x * theMapProjection->getDecimalDegreesPerPixel().x;
-               shpInterface->setGeometryBuffer(m_bufferDistance, OSSIM_DEGREES);
-            }
-            else
-            {
-               m_bufferDistance = thePaddingSizeInPixels.x * theMapProjection->getMetersPerPixel().x;
-               shpInterface->setGeometryBuffer(m_bufferDistance, OSSIM_METERS);
-            }
-         }
-      }
-      std::multimap<long, ossimAnnotationObject*> features = shpInterface->getFeatureTable();
-      if (features.size() > 0)
-      {
-         std::multimap<long, ossimAnnotationObject*>::iterator it = features.begin();
-         while (it != features.end())
-         {
-            ossimAnnotationObject* anno = it->second;
-            if (anno != 0)
-            {
-               ossimGeoAnnotationPolyObject* annoPoly = PTR_CAST(ossimGeoAnnotationPolyObject, anno);
-               ossimGeoAnnotationMultiPolyObject* annoMultiPoly = 0;
-               if (annoPoly == 0)
-               {
-                  annoMultiPoly = PTR_CAST(ossimGeoAnnotationMultiPolyObject, anno);
-               }
-               if (annoPoly != 0)
-               {
-                  result = true;
-                  std::vector<ossimGpt> polygon;
-
-                  //get the points of a polygon
-                  std::vector<ossimGpt> points = annoPoly->getPoints();
-                  for (ossim_uint32 i = 0; i < points.size(); i++)
-                  {
-                     polygon.push_back(points[i]);
-                  }
-
-                  //get polygon type, if it is an internal polygon, initialize the internal cutter
-                  ossimGeoAnnotationPolyObject::ossimPolyType polyType = annoPoly->getPolyType();
-                  ossimShpFeature feature(it->first, polyType, polygon, std::vector<ossimGeoPolygon>()); 
-                  m_features.push_back(feature);
-               }
-               else if (annoMultiPoly != 0)
-               {
-                  std::vector<ossimGeoPolygon> multiPolys = annoMultiPoly->getMultiPolygon();
-                  ossimShpFeature feature(it->first, 0, std::vector<ossimGpt>(), multiPolys); 
-               }
-            }
-            it++;
-         }
-      }
-   }
-   if (m_features.size() > 0)
-   {
-      theTotalTiles = m_features.size();
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTilingPoly::useMbr() const
-{
-   //if the use_mbr is set to true, no matter if the padding is set to 0 or greater than 0,
-   //always clip the MBR of each feature
-   return m_useMbr;
-}
-
-bool ossimTilingPoly::hasExteriorCut() const
-{
-   return m_exteriorCut.valid();
-}
-
-bool ossimTilingPoly::hasInteriorCut() const
-{
-   return m_interiorCut.valid();
-}
-
-ossimRefPtr<ossimGeoPolyCutter>& ossimTilingPoly::getExteriorCut()
-{
-   return m_exteriorCut;
-}
-
-ossimRefPtr<ossimGeoPolyCutter>& ossimTilingPoly::getInteriorCut()
-{
-   return m_interiorCut;
-}
-
-bool ossimTilingPoly::isFeatureBoundingIntersect() const
-{
-   return m_featureBoundingIntersect;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTilingRect.cpp b/ossim/src/ossim/imaging/ossimTilingRect.cpp
deleted file mode 100644
index e53e301..0000000
--- a/ossim/src/ossim/imaging/ossimTilingRect.cpp
+++ /dev/null
@@ -1,887 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Mingjie Su
-// 
-// Description: implementation for image generator
-//
-//*************************************************************************
-// $Id: ossimTilingRect.cpp 2725 2011-06-15 18:13:07Z david.burken $
-
-#include <sstream>
-#include <iomanip>
-#include <ossim/imaging/ossimTilingRect.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimEsriShapeFileInterface.h>
-
-static ossimTrace traceDebug("ossimTilingRect:debug");
-
-RTTI_DEF1(ossimTilingRect, "ossimTilingRect", ossimTiling);
-
-ossimTilingRect::ossimTilingRect()
-      : ossimTiling(),
-      m_clipToAoi(true),
-      m_lastWidth(0),
-      m_lastHeight(0),
-      m_useOffset(false),
-      m_offsetInPixels(0,0),
-      m_tilingDistanceInPixels(0,0),
-      m_tilinResolutionDistance(ossim::nan(),ossim::nan()),
-      m_tilingResolutionUnitType(OSSIM_UNIT_UNKNOWN),
-      m_fractionalPixelMisalignment(ossim::nan(),ossim::nan())
-{
-}
-
-ossimTilingRect::~ossimTilingRect()
-{
-}
-
-bool ossimTilingRect::initializeBase(const ossimMapProjection& proj,
-   const ossimIrect& boundingRect,
-   ossimDpt& convertedTilingDistance)
-{
-   theMapProjection = (ossimMapProjection*)proj.dup();
-   theImageRect     = boundingRect;
-
-   ossimDpt gsd = theMapProjection->getMetersPerPixel();
-   // Find image center and GSD at that point:
-   if (theMapProjection->isGeographic() && theTilingDistanceUnitType != OSSIM_DEGREES)
-   {
-      ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry (0, theMapProjection.get());
-      geom->setImageSize(ossimIpt(theImageRect.width(), theImageRect.height()));
-      gsd = geom->getMetersPerPixel();
-   }
-
-   m_tilingDistanceInPixels = theTilingDistance;
-
-   //if resolution and resolution type are defined, need to reset degree/meter per pixel and the image rect. do calculation below
-   ossim_float64 latDiff = 0.0;
-   ossim_float64 lonDiff = 0.0;
-   ossim_uint32 imageWidth = 0;
-   ossim_uint32 imageHeight = 0;
-   if (!m_tilinResolutionDistance.hasNans())
-   {
-      ossimDpt result(0,0);
-      if (m_tilingResolutionUnitType == OSSIM_DEGREES)
-      {
-         ossimGpt ulg;
-         ossimGpt llg;
-         ossimGpt lrg;
-         ossimGpt urg;
-
-         theMapProjection->lineSampleToWorld(theImageRect.ul(), ulg);
-         theMapProjection->lineSampleToWorld(theImageRect.ll(), llg);
-         theMapProjection->lineSampleToWorld(theImageRect.lr(), lrg);
-         theMapProjection->lineSampleToWorld(theImageRect.ur(), urg);
-
-         latDiff = fabs(ulg.lat - llg.lat);
-         lonDiff = fabs(urg.lon - llg.lon);
-
-         if (!theMapProjection->isGeographic())
-         {
-            ossim_float64 tileHorizatalNum = lonDiff/m_tilinResolutionDistance.x;
-            ossim_float64 tileVerticalNum = latDiff/m_tilinResolutionDistance.y;
-
-            if (theTilingDistanceUnitType != OSSIM_PIXEL) //convert tiling distance to pixel if unit type is not pixel
-            {
-               ossimDpt convertedDis = m_tilingDistanceInPixels;
-               getConvertedDistance(convertedDis, m_tilingDistanceInPixels);
-               imageWidth = (ossim_uint32)convertedDis.x/gsd.x*tileHorizatalNum;
-               imageHeight = (ossim_uint32)convertedDis.y/gsd.y*tileVerticalNum;
-            }
-            else
-            {
-               imageWidth = (ossim_uint32)m_tilingDistanceInPixels.x*tileHorizatalNum;
-               imageHeight = (ossim_uint32)m_tilingDistanceInPixels.y*tileVerticalNum;
-            }
-            result = ossimDpt(theImageRect.width()*gsd.x/imageWidth, theImageRect.height()*gsd.y/imageHeight);
-            gsd = result;
-
-            theMapProjection->setMetersPerPixel(result);
-         }
-         else
-         {
-            result = ossimDpt(m_tilinResolutionDistance.x/m_tilingDistanceInPixels.x,
-               m_tilinResolutionDistance.y/m_tilingDistanceInPixels.y);
-
-            theMapProjection->setDecimalDegreesPerPixel(result);
-         }
-      }
-      else //only handle degree type for resolution
-      {
-         return false;
-      }
-   }
-
-   if (theTilingDistanceUnitType != OSSIM_PIXEL)
-   {
-      ossimDpt paddingSize = getPaddingSize();//convert padding size to meters or degree
-      getConvertedDistance(convertedTilingDistance, theTilingDistance);
-
-      ossimDpt convertedOffset = m_offsetInPixels;
-      if (m_useOffset)
-      {
-         getConvertedDistance(convertedOffset, m_offsetInPixels);
-      }
-
-      if (theMapProjection->isGeographic() && theTilingDistanceUnitType == OSSIM_DEGREES)
-      {
-         thePaddingSizeInPixels.x = ossim::round<int>(paddingSize.x / theMapProjection->getDecimalDegreesPerPixel().x);
-         thePaddingSizeInPixels.y = ossim::round<int>(paddingSize.y / theMapProjection->getDecimalDegreesPerPixel().y);
-
-         double intpart;
-         m_fractionalPixelMisalignment.x = modf(convertedTilingDistance.x / theMapProjection->getDecimalDegreesPerPixel().x, &intpart);
-         m_fractionalPixelMisalignment.y = modf(convertedTilingDistance.y / theMapProjection->getDecimalDegreesPerPixel().y, &intpart);
-
-         m_tilingDistanceInPixels.x = ossim::round<int>(convertedTilingDistance.x / theMapProjection->getDecimalDegreesPerPixel().x);
-         m_tilingDistanceInPixels.y = ossim::round<int>(convertedTilingDistance.y / theMapProjection->getDecimalDegreesPerPixel().y);
-
-         if (m_useOffset)
-         {
-            m_offsetInPixels.x = ossim::round<int>(convertedOffset.x / theMapProjection->getDecimalDegreesPerPixel().x);
-            m_offsetInPixels.y = ossim::round<int>(convertedOffset.y / theMapProjection->getDecimalDegreesPerPixel().y);
-         }
-      }
-      else
-      {
-         thePaddingSizeInPixels.x = ossim::round<int>(paddingSize.x / gsd.x);
-         thePaddingSizeInPixels.y = ossim::round<int>(paddingSize.y / gsd.y);
-
-         double intpart;
-         m_fractionalPixelMisalignment.x = modf(convertedTilingDistance.x / gsd.x, &intpart);
-         m_fractionalPixelMisalignment.y = modf(convertedTilingDistance.y / gsd.y, &intpart);
-
-         m_tilingDistanceInPixels.x = ossim::round<int>(convertedTilingDistance.x / gsd.x);
-         m_tilingDistanceInPixels.y = ossim::round<int>(convertedTilingDistance.y / gsd.y);
-
-         if (m_useOffset)
-         {
-            m_offsetInPixels.x = ossim::round<int>(convertedOffset.x / gsd.x);
-            m_offsetInPixels.y = ossim::round<int>(convertedOffset.y / gsd.y);
-         }
-      }
-   }
-   else
-   {
-      if (theMapProjection->isGeographic())
-      {
-         theTilingDistance.x = theTilingDistance.x * theMapProjection->getDecimalDegreesPerPixel().x;
-         theTilingDistance.y = theTilingDistance.y * theMapProjection->getDecimalDegreesPerPixel().y;
-      }
-      else
-      {
-         theTilingDistance.x = theTilingDistance.x * gsd.x;
-         theTilingDistance.y = theTilingDistance.y * gsd.y;
-      }
-   }
-
-   //re-calculation the image rect if resolution and resolution type defined
-   if (!m_tilinResolutionDistance.hasNans())
-   {
-      if (theMapProjection->isGeographic())
-      {
-         imageWidth = (ossim_uint32)m_tilingDistanceInPixels.x * lonDiff;
-         imageHeight = (ossim_uint32)m_tilingDistanceInPixels.y * latDiff;
-      }
-
-      //avoid very small pixel offset by calculation if tiling distance unit type is pixel
-      if (theTilingDistanceUnitType == OSSIM_PIXEL)
-      {
-         if (imageWidth % (ossim_int32)m_tilingDistanceInPixels.x != 0)
-         {
-            ossim_int32 numX =  ossim::round<int>((double)imageWidth/m_tilingDistanceInPixels.x);
-            imageWidth = m_tilingDistanceInPixels.x * numX;
-         }
-         if (imageHeight % (ossim_int32)m_tilingDistanceInPixels.y != 0)
-         {
-            ossim_int32 numY =  ossim::round<int>((double)imageHeight/m_tilingDistanceInPixels.y);
-            imageHeight = m_tilingDistanceInPixels.y * numY;
-         }
-      }
-    
-      theImageRect = ossimIrect(boundingRect.ul(),
-         ossimIpt((boundingRect.ul().x + imageWidth), boundingRect.ul().y),
-         ossimIpt((boundingRect.ul().x + imageWidth), (imageHeight - boundingRect.ul().y)),
-         ossimIpt(boundingRect.ul().x , (imageHeight - boundingRect.ul().y)));
-   }
-   return true;
-}
-
-bool ossimTilingRect::initialize(const ossimMapProjection& proj,
-   const ossimIrect& boundingRect)
-{
-   bool result = false;
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimTilingRect::initialize DEBUG: Entered..."
-         << "\nBounding rect === " << boundingRect
-         << std::endl;
-   }
-
-   ossimDpt convertedTilingDistance = theTilingDistance;
-   result = initializeBase(proj, boundingRect, convertedTilingDistance);
-   ossimDrect tilingRectInPixels = theImageRect;
-
-   // Let's setup the bounding tile rect.
-   if(theMapProjection->isGeographic())
-   {
-      ossimGpt ul;
-      ossimGpt ur;
-      ossimGpt lr;
-      ossimGpt ll;
-
-      theMapProjection->lineSampleToWorld(theImageRect.ul(), ul);
-      theMapProjection->lineSampleToWorld(theImageRect.ur(), ur);
-      theMapProjection->lineSampleToWorld(theImageRect.lr(), lr);
-      theMapProjection->lineSampleToWorld(theImageRect.ll(), ll);
-
-      theTilingRect = ossimDrect(ossimDpt(ul), ossimDpt(ur), ossimDpt(lr), ossimDpt(ll),
-         OSSIM_RIGHT_HANDED);
-
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: Geographic input bounds =  "
-            << theTilingRect
-            << std::endl;
-      }
-
-      if (!m_clipToAoi)
-      {
-         theTilingRect.stretchToTileBoundary(convertedTilingDistance);
-      }
-
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: Geographic input bounds stretched =  "
-            << theTilingRect << std::endl;
-      }
-
-      clampGeographic(theTilingRect);
-
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: Geographic input bounds clamped =  "
-            << theTilingRect << std::endl;
-      }
-
-   }  // End "if(theMapProjection->isGeographic())"
-   else // meters
-   {
-      ossimDpt ul;
-      ossimDpt ur;
-      ossimDpt lr;
-      ossimDpt ll;
-
-      theMapProjection->lineSampleToEastingNorthing(theImageRect.ul(), ul);
-      theMapProjection->lineSampleToEastingNorthing(theImageRect.ur(), ur);
-      theMapProjection->lineSampleToEastingNorthing(theImageRect.lr(), lr);
-      theMapProjection->lineSampleToEastingNorthing(theImageRect.ll(), ll);
-      theTilingRect = ossimDrect(ul, ur, lr, ll, OSSIM_RIGHT_HANDED);
-
-      if (!m_clipToAoi)
-      {
-         theTilingRect.stretchToTileBoundary(convertedTilingDistance);
-      }
-   }
-
-   theTotalHorizontalTiles = ossim::round<int>(fabs(tilingRectInPixels.ur().x - tilingRectInPixels.ul().x)/m_tilingDistanceInPixels.x);
-   theTotalVerticalTiles   = ossim::round<int>(fabs(tilingRectInPixels.ur().y - tilingRectInPixels.lr().y)/m_tilingDistanceInPixels.y);
-
-   if (m_clipToAoi)
-   {
-      if (m_useOffset)
-      {
-         ossim_float32 totalHorizontalTilesAfterOffset = 
-            ((fabs(tilingRectInPixels.ur().x - tilingRectInPixels.ul().x))-m_tilingDistanceInPixels.x)/(m_tilingDistanceInPixels.x - m_offsetInPixels.x) + 1;
-         ossim_float32 totalVerticalTilesAfterOffset = 
-            ((fabs(tilingRectInPixels.ur().y - tilingRectInPixels.lr().y))-m_tilingDistanceInPixels.y)/(m_tilingDistanceInPixels.y - m_offsetInPixels.y) + 1;
-
-         ossim_float32 lastHorizontal = totalHorizontalTilesAfterOffset - (ossim_int32)totalHorizontalTilesAfterOffset;
-         ossim_float32 lastVertical = totalVerticalTilesAfterOffset - (ossim_int32)totalVerticalTilesAfterOffset;
-
-         m_lastWidth = ossim::round<int>(fabs(lastHorizontal* (m_tilingDistanceInPixels.x - m_offsetInPixels.x) + m_offsetInPixels.x));
-         m_lastHeight = ossim::round<int>(fabs(lastVertical* (m_tilingDistanceInPixels.y - m_offsetInPixels.y) + m_offsetInPixels.y));
-
-         theTotalHorizontalTiles = ossim::round<int>(totalHorizontalTilesAfterOffset);
-         theTotalVerticalTiles = ossim::round<int>(totalVerticalTilesAfterOffset);
-
-         if (m_lastWidth > 0 && (lastHorizontal < 0.5))//if lastHorizontal is less than 0.5, the last tile will not add to total tiles after rounding, do here
-         {
-            theTotalHorizontalTiles = theTotalHorizontalTiles + 1;
-         }
-         if (m_lastHeight > 0 && (lastVertical < 0.5))
-         {
-            theTotalVerticalTiles = theTotalVerticalTiles + 1;
-         }
-      }
-      else
-      {
-         ossim_int32 tmpX = (ossim_int32)(fabs(tilingRectInPixels.ur().x - tilingRectInPixels.ul().x)) + 1;
-         ossim_int32 tmpY = (ossim_int32)(fabs(tilingRectInPixels.ur().y - tilingRectInPixels.lr().y)) + 1;
-
-         ossim_int32 modValueX = tmpX % (ossim_int32)m_tilingDistanceInPixels.x;
-         ossim_int32 modValueY = tmpY % (ossim_int32)m_tilingDistanceInPixels.y;
-         if (modValueX >= 1)
-         {
-            m_lastWidth = modValueX;
-         }
-         else
-         {
-            m_lastWidth = m_tilingDistanceInPixels.x;
-         }
-         if (modValueY >= 1)
-         {
-            m_lastHeight = modValueY;
-         }
-         else
-         {
-            m_lastHeight = m_tilingDistanceInPixels.y;
-         }
-
-         if (m_lastWidth > 0)
-         {  
-            if (m_lastWidth < m_tilingDistanceInPixels.x/2)
-            {
-               theTotalHorizontalTiles = theTotalHorizontalTiles + 1;
-            }
-         }
-         if (m_lastHeight > 0)
-         {
-            if (m_lastHeight < m_tilingDistanceInPixels.y/2)
-            {
-               theTotalVerticalTiles = theTotalVerticalTiles + 1;
-            }
-         }
-      }
-   }
-
-   theTotalTiles = theTotalHorizontalTiles*theTotalVerticalTiles;
-
-   // reset the tile id to the beginning
-   reset();
-
-   if(traceDebug())
-   {
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nossimTiling::initialize DEBUG: Leaving..." << std::endl;
-   }
-
-   return result;
-}
-
-bool ossimTilingRect::next(ossimRefPtr<ossimMapProjection>& resultProjection,
-   ossimIrect& resultingBounds,
-   ossimString& resultingName)
-{
-   bool result = true;
-
-   if(theTileId < theTotalTiles)
-   {
-      ossimDpt origin;
-      ossim_int64 row=0;
-      ossim_int64 col=0;
-
-      getRowCol(row, col, theTileId);
-
-      getTileName(resultingName,
-         (row+1), (col+1), theTileId);
-
-      getOrigin(origin, row, col);
-
-      if (!m_fractionalPixelMisalignment.isNan())
-      {
-         if (row == 0 && col != 0)
-         {
-            if (m_fractionalPixelMisalignment.x >= 0.5)
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getDecimalDegreesPerPixel().x * col;
-               }
-               else
-               {
-                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getMetersPerPixel().x * col;
-               }
-            }  
-            else
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getDecimalDegreesPerPixel().x * col;
-               }
-               else
-               {
-                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getMetersPerPixel().x * col;
-               }
-            }
-         }
-         else if (col == 0 && row != 0)
-         {
-            if (m_fractionalPixelMisalignment.y >= 0.5)
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getDecimalDegreesPerPixel().y * row;
-               }
-               else
-               {
-                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getMetersPerPixel().y * row;
-               }
-            }
-            else
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getDecimalDegreesPerPixel().y * row;
-               }
-               else
-               {
-                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getMetersPerPixel().y * row;
-               }  
-            }
-         }
-         else if (col != 0 && row != 0)
-         {
-            if (m_fractionalPixelMisalignment.x >= 0.5)
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getDecimalDegreesPerPixel().x * col;
-               }
-               else
-               {
-                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getMetersPerPixel().x * col;
-               }
-            }  
-            else
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getDecimalDegreesPerPixel().x * col;
-               }
-               else
-               {
-                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getMetersPerPixel().x * col;
-               }
-            }
-
-            if (m_fractionalPixelMisalignment.y >= 0.5)
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getDecimalDegreesPerPixel().y * row;
-               }
-               else
-               {
-                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getMetersPerPixel().y * row;
-               }
-            }
-            else
-            {
-               if (theMapProjection->isGeographic())
-               {
-                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getDecimalDegreesPerPixel().y * row;
-               }
-               else
-               {
-                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getMetersPerPixel().y * row;
-               }  
-            }
-         }
-      }
-
-      ossimIpt pixels = ossimDpt(m_tilingDistanceInPixels.x, m_tilingDistanceInPixels.y);
-
-      if(theMapProjection->isGeographic())
-      {
-         theMapProjection->setUlTiePoints(
-            ossimGpt(origin.lat,
-            origin.lon,
-            0.0,
-            theMapProjection->origin().datum()));
-      }
-      else
-      {
-         theMapProjection->setUlTiePoints(ossimDpt(origin.x, origin.y));
-      }
-
-      if (m_clipToAoi || m_useOffset)
-      {
-         if (row == 0 && col == 0)
-         {
-            resultingBounds = ossimIrect(0, 0,
-               (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-               (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-         }
-         else if (row == 0 && col != 0)
-         {
-            if (col == (theTotalHorizontalTiles-1))
-            {
-               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x, 0,
-                  (m_lastWidth-1),
-                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-
-               if (m_useOffset)
-               {
-                  ossim_int32 lr_x = -((ossim_int32)m_offsetInPixels.x*col)- resultingBounds.width();
-                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 0,
-                     lr_x, (resultingBounds.height()-1));
-               }
-            }
-            else
-            {
-               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x, 0,
-                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-
-               if (m_useOffset)
-               {
-                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 0,
-                     (resultingBounds.width()-1)-((ossim_int32)m_offsetInPixels.x*col), 
-                     (resultingBounds.height()-1));
-               }
-            }
-         }
-         else if (row != 0 && col == 0)
-         {
-            if (row == (theTotalVerticalTiles-1))
-            {
-               resultingBounds = ossimIrect(0, -(ossim_int32)thePaddingSizeInPixels.y,
-                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-                  (m_lastHeight-1));
-
-               if (m_useOffset)
-               {
-                  ossim_int32 lr_y = -((ossim_int32)m_offsetInPixels.y*row)-resultingBounds.height();
-                  resultingBounds = ossimIrect(0, -((ossim_int32)m_offsetInPixels.y*row),
-                     (resultingBounds.width()-1), lr_y);
-               }
-            }
-            else
-            {
-               resultingBounds = ossimIrect(0,
-                  -(ossim_int32)thePaddingSizeInPixels.y,
-                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-
-               if (m_useOffset)
-               {
-                  resultingBounds = ossimIrect(0, -((ossim_int32)m_offsetInPixels.y*row),
-                     (resultingBounds.width()-1), 
-                     (resultingBounds.height()-1)-((ossim_int32)m_offsetInPixels.y*row));
-               }
-            }
-         }
-         else if (row != 0 && col != 0)
-         {
-            if (row == (theTotalVerticalTiles-1) && col == (theTotalHorizontalTiles-1))
-            {
-               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
-                  -(ossim_int32)thePaddingSizeInPixels.y,
-                  (m_lastWidth-1),
-                  (m_lastHeight-1));
-
-               if (m_useOffset)
-               {
-                  ossim_int32 lr_x = -((ossim_int32)m_offsetInPixels.x*col)-resultingBounds.width();
-                  ossim_int32 lr_y = -((ossim_int32)m_offsetInPixels.y*row)-resultingBounds.height();
-                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
-                     -((ossim_int32)m_offsetInPixels.y*row),
-                     lr_x, lr_y);
-               }
-            }
-            else if (row != (theTotalVerticalTiles-1) && col == (theTotalHorizontalTiles-1))
-            {
-               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
-                  -(ossim_int32)thePaddingSizeInPixels.y,
-                  (m_lastWidth-1),
-                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-
-               if (m_useOffset)
-               {
-                  ossim_int32 lr_x = -((ossim_int32)m_offsetInPixels.x*col)-resultingBounds.width();
-                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
-                     -((ossim_int32)m_offsetInPixels.y*row),
-                     lr_x, (resultingBounds.height()-1)-((ossim_int32)m_offsetInPixels.y*row));
-               }
-            }
-            else if (row == (theTotalVerticalTiles-1) && col != (theTotalHorizontalTiles-1))
-            {
-               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
-                  -(ossim_int32)thePaddingSizeInPixels.y,
-                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-                  (m_lastHeight-1));
-
-               if (m_useOffset)
-               {
-                  ossim_int32 lr_y = -((ossim_int32)m_offsetInPixels.y*row)-resultingBounds.height();
-                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
-                     -((ossim_int32)m_offsetInPixels.y*row),
-                     (resultingBounds.width()-1)-((ossim_int32)m_offsetInPixels.x*col), 
-                     lr_y);
-               }
-            }
-            else
-            {
-               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
-                  -(ossim_int32)thePaddingSizeInPixels.y,
-                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-
-               if (m_useOffset)
-               {
-                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
-                     -((ossim_int32)m_offsetInPixels.y*row),
-                     (resultingBounds.width()-1)-((ossim_int32)m_offsetInPixels.x*col), 
-                     (resultingBounds.height()-1)-((ossim_int32)m_offsetInPixels.y*row));
-               }
-            }
-         }
-      }
-      else
-      {
-         resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
-            -(ossim_int32)thePaddingSizeInPixels.y,
-            (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
-            (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
-
-         if (m_useOffset)
-         {
-            resultingBounds = ossimIrect(-(ossim_int32)m_offsetInPixels.x, 
-               -(ossim_int32)m_offsetInPixels.y,
-               (resultingBounds.width()-1), (resultingBounds.height()-1));
-         }
-      }
-
-      if(traceDebug()&&resultProjection.valid())
-      {
-         ossimKeywordlist projKwl;
-
-         resultProjection->saveState(projKwl);
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimTilingRect::next DEBUG: rect = " << resultingBounds
-            << "\nproj                          = " << projKwl
-            << "\ntileName                      = " << resultingName
-            << "\norigin                        = " << origin << std::endl;
-      }
-
-      resultProjection = theMapProjection;
-
-      ++theTileId; 
-   }
-   else
-   {
-      result = false;
-   }
-
-   return result;
-}
-
-bool ossimTilingRect::saveState(ossimKeywordlist& kwl,
-                            const char* prefix)const
-{
-   std::stringstream tilingDistance;
-
-   tilingDistance << theTilingDistance.x << " " << theTilingDistance.y << std::endl;
-   
-   kwl.add(prefix,
-           "tile_size",
-           tilingDistance.str().c_str(),
-           true);
-
-   kwl.add(prefix,
-           "units",
-           ossimUnitTypeLut::instance()->
-           getTableIndexString(theTilingDistanceUnitType),
-           true);
-   
-   std::ostringstream padding;
-
-   padding << thePaddingSizeInPixels.x << " " << thePaddingSizeInPixels.y;
-   kwl.add(prefix,
-           "padding",
-           padding.str().c_str(),
-           true);
-
-   kwl.add(prefix,
-      "output_file_name",
-      theTileNameMask.c_str(),
-      true);
-
-   kwl.add(prefix,
-      "clip_to_aoi",
-      m_clipToAoi,
-      true);
-
-   return true;
-}
-
-bool ossimTilingRect::loadState(const ossimKeywordlist& kwl,
-                            const char* prefix)
-{
-   bool result = false;
-   
-   // Get the mask if any.
-   theTileNameMask = kwl.find(prefix, "output_file_name");
-   if (!theTileNameMask.contains("%f%")) //%f% format is used for feature id in a shape file
-   {
-      setTileNameMask(theTileNameMask);
-   }
-  
-   const char* paddingSizeInPixels = kwl.find(prefix, "padding");
-
-   if (paddingSizeInPixels)
-   {
-      ossimString x,y;
-      std::istringstream padding(ossimString(paddingSizeInPixels).c_str());
-      padding >> x >> y;
-      thePaddingSizeInPixels.x = x.toFloat64();
-      thePaddingSizeInPixels.y = y.toFloat64();
-   }
-  
-   const char* tilingDistance = kwl.find(prefix, "tile_size");
-
-   const char* tilingDistanceType = kwl.find(prefix, "units");
-   
-   result = tilingDistance&&tilingDistanceType&&paddingSizeInPixels;
-   
-   ossimString x,y;
-   std::istringstream distance(ossimString(tilingDistance).c_str());
-   distance >> x >> y;
-   theTilingDistance.x = x.toFloat64();
-   theTilingDistance.y = y.toFloat64();
-   if(theTilingDistance.x <= 0.0)
-   {
-      theTilingDistance.x = 1.0;
-   }
-   if(theTilingDistance.y<=0.0)
-   {
-      theTilingDistance.y = theTilingDistance.x;
-   }
-
-   theTilingDistanceUnitType = (ossimUnitType)
-      ossimUnitTypeLut::instance()->getEntryNumber(
-      ossimString(tilingDistanceType).c_str());
-
-   const char* clipToAoi = kwl.find(prefix, "clip_to_aoi");
-   if (clipToAoi)
-   {
-      if (!ossimString(clipToAoi).toBool())
-      {
-         m_clipToAoi = false;
-      }
-   }
-
-   const char* offset = kwl.find(prefix, "use_offset");
-   if (offset)
-   {
-      ossimString width, height;
-      std::istringstream distanceOffset(ossimString(offset).c_str());
-      distanceOffset >> width >> height;
-      m_offsetInPixels.x = width.toFloat64();
-      m_offsetInPixels.y = height.toFloat64();
-      if (m_offsetInPixels.x > 0 || m_offsetInPixels.y > 0.0)
-      {
-         m_useOffset = true;
-         result = true;
-      }
-   }
-
-   const char* tileRes = kwl.find(prefix, "resolution");
-   if (tileRes)
-   {
-      theDelta = ossimDpt(0,0);
-      x="";
-      y="";
-      std::istringstream tileResValues(ossimString(tileRes).c_str());
-      tileResValues >> x >> y;
-
-      m_tilinResolutionDistance.x = x.toFloat64();
-      m_tilinResolutionDistance.y = y.toFloat64();
-   }
- 
-   const char* tilingResType = kwl.find(prefix, "resolution_units");
-   if (tilingResType)
-   {
-      m_tilingResolutionUnitType = (ossimUnitType)
-         ossimUnitTypeLut::instance()->getEntryNumber(
-         ossimString(tilingResType).c_str());
-   }
-
-   if (traceDebug())
-   {
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-   return result;
-}
-
-ossimDpt ossimTilingRect::getPaddingSize()const
-{
-   ossimDpt result = thePaddingSizeInPixels;
-
-   if (!theMapProjection.valid())
-      return result;
-
-   if(theMapProjection->isGeographic() && theTilingDistanceUnitType == OSSIM_DEGREES)
-   {
-      return result;
-   }
-   else
-   {
-      ossimUnitConversionTool unitConverter(1.0, theTilingDistanceUnitType);
-      unitConverter.setValue(result.x, theTilingDistanceUnitType);
-      result.x = unitConverter.getValue(OSSIM_METERS);
-
-      unitConverter.setValue(result.y, theTilingDistanceUnitType);
-      result.y = unitConverter.getValue(OSSIM_METERS);
-   }
-
-   return result;
-}
-
-void ossimTilingRect::getConvertedDistance(ossimDpt& pt, ossimDpt inputDistance) const
-{
-   if (!theMapProjection)
-   {
-      // This should not happen...
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTiling::getConvertedDistance WARNING"
-         << " projection not set!" << endl;
-      pt = inputDistance;
-      return;
-   }
-
-   if(theMapProjection->isGeographic() && theTilingDistanceUnitType == OSSIM_DEGREES)
-   {
-      pt = inputDistance;
-   }
-   else
-   {
-      ossimUnitConversionTool unitConverter(theMapProjection->origin(),
-         1.0,
-         theTilingDistanceUnitType);
-
-      unitConverter.setValue(inputDistance.x,
-         theTilingDistanceUnitType);
-      pt.x = unitConverter.getValue(OSSIM_METERS);
-
-      unitConverter.setValue(inputDistance.y,
-         theTilingDistanceUnitType);
-      pt.y = unitConverter.getValue(OSSIM_METERS);
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTopographicCorrectionFilter.cpp b/ossim/src/ossim/imaging/ossimTopographicCorrectionFilter.cpp
deleted file mode 100644
index c598c82..0000000
--- a/ossim/src/ossim/imaging/ossimTopographicCorrectionFilter.cpp
+++ /dev/null
@@ -1,1298 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimTopographicCorrectionFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <algorithm>
-#include <sstream>
-#include <ossim/imaging/ossimTopographicCorrectionFilter.h>
-#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/matrix/newmat.h>
-#include <ossim/base/ossimMatrix3x3.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-static const char* CORRECTION_TYPE_KW        = "correction_type";
-static const char* C_COMPUTED_FLAG_KW        = "c_computed_flag";
-static const char* NDVI_RANGE_KW             = "ndvi_range";
-
-RTTI_DEF1(ossimTopographicCorrectionFilter, "ossimTopographicCorrectionFilter", ossimImageCombiner);
-ossimTopographicCorrectionFilter::ossimTopographicCorrectionFilter()
-   :ossimImageCombiner(NULL, 2, 0, true, false),
-    theTile(NULL),
-//    theScalarRemapper(NULL),
-    theLightSourceElevationAngle(45.0),
-    theLightSourceAzimuthAngle(45.0),
-    theJulianDay(0),
-    theCComputedFlag(false),
-    theTopoCorrectionType(TOPO_CORRECTION_COSINE),
-//    theTopoCorrectionType(TOPO_CORRECTION_MINNAERT),
-    theNdviLowTest(-0.1),
-    theNdviHighTest(0.1)
-{
-//    theScalarRemapper = new ossimScalarRemapper();
-//    theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
-//    theScalarRemapper->initialize();
-}
-
-ossimTopographicCorrectionFilter::ossimTopographicCorrectionFilter(ossimImageSource* colorSource,
-                                                                   ossimImageSource* elevSource)
-   :ossimImageCombiner(NULL, 2, 0, true, false),
-    theTile(NULL),
-    theLightSourceElevationAngle(45.0),
-    theLightSourceAzimuthAngle(45.0),
-    theJulianDay(0),
-    theCComputedFlag(false),
-    theTopoCorrectionType(TOPO_CORRECTION_COSINE),
-    theNdviLowTest(-0.1),
-    theNdviHighTest(0.1)
-{
-   connectMyInputTo(colorSource);
-   connectMyInputTo(elevSource);
-}
-
-ossimTopographicCorrectionFilter::~ossimTopographicCorrectionFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimTopographicCorrectionFilter::getTile(
-   const  ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource,
-                                                     getInput(0));
-   ossimImageSource* normalSource  = PTR_CAST(ossimImageSource,
-                                                       getInput(1));
-
-   if(!isSourceEnabled()||!normalSource||!colorSource)
-   {
-      if(colorSource)
-      {
-         return colorSource->getTile(tileRect, resLevel);
-      }
-   }
-
-   if(!theTile.valid())
-   {
-      allocate();
-   }
-
-   if(!theTile)
-   {
-      return ossimRefPtr<ossimImageData>();
-   }
-
-   long w = tileRect.width();
-   long h = tileRect.height();
-   ossimIpt origin = tileRect.ul();
-
-   theTile->setOrigin(origin);
-   long tileW = theTile->getWidth();
-   long tileH = theTile->getHeight();
-   if((w != tileW)||
-      (h != tileH))
-   {
-      theTile->setWidth(w);
-      theTile->setHeight(h);
-      if((w*h)!=(tileW*tileH))
-      {
-         theTile->initialize();
-      }
-      else
-      {
-         theTile->makeBlank();
-      }
-   }
-   else
-   {
-      theTile->makeBlank();
-   }
-
-   // ossimImageData* inputTile = NULL;
-
-   ossimRefPtr<ossimImageData> normalData = normalSource->getTile(tileRect,
-                                                                  resLevel);
-
-   ossimRefPtr<ossimImageData> colorData  = colorSource->getTile(tileRect,
-                                                                 resLevel);
-
-   if(!colorData.valid() || !normalData.valid())
-   {
-      return theTile;
-   }
-
-   if((normalData->getNumberOfBands() != 3)||
-      (normalData->getScalarType() != OSSIM_DOUBLE)||
-      !normalData->getBuf()||
-      !colorData->getBuf()||
-      (colorData->getDataObjectStatus() == OSSIM_EMPTY)||
-      (normalData->getDataObjectStatus()==OSSIM_EMPTY))
-   {
-      return colorData;
-   }
-
-   executeTopographicCorrection(theTile,
-                                colorData,
-                                normalData);
-   theTile->validate();
-   return theTile;
-}
-
-void ossimTopographicCorrectionFilter::initialize()
-{
-   ossimImageCombiner::initialize();
-
-   // Force an "allocate()" on the first getTile.
-   theTile      = NULL;
-}
-
-void ossimTopographicCorrectionFilter::allocate()
-{
-   if(!getInput(0) || !getInput(1)) return;
-   theBandMapping.clear();
-   if(isSourceEnabled())
-   {
-      // ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-
-      int arraySize = theTile->getNumberOfBands();
-      if(theGain.size() > 0)
-      {
-         arraySize = (int)theGain.size();
-      }
-      // we will do a non destructive resize onf the arrays
-      //
-      resizeArrays(arraySize);
-
-      ossimImageSource* input1 = PTR_CAST(ossimImageSource,
-                                                   getInput(0));
-      if(input1)
-      {
-         input1->getOutputBandList(theBandMapping);
-         for(ossim_uint32 idx = 0; idx < theBandMapping.size(); ++idx)
-         {
-            if(theBias.size())
-            {
-               if(theBandMapping[idx] >= theBias.size())
-               {
-                  theBandMapping[idx] = (unsigned int)theBias.size()-1;
-               }
-            }
-            else
-            {
-               theBandMapping[idx] = 0;
-            }
-         }
-      }
-   }
-
-   computeLightDirection();
-}
-
-void ossimTopographicCorrectionFilter::computeLightDirection()
-{
-   NEWMAT::Matrix m = ossimMatrix3x3::createRotationMatrix(theLightSourceElevationAngle,
-                                                           0.0,
-                                                           theLightSourceAzimuthAngle);
-   NEWMAT::ColumnVector v(3);
-   v[0] = 0;
-   v[1] = 1;
-   v[2] = 0;
-   v = m*v;
-   // reflect Z.  We need the Z pointing up from the surface and not into it.
-   //
-   ossimColumnVector3d d(v[0], v[1], -v[2]);
-   d = d.unit();
-   theLightDirection[0] = d[0];
-   theLightDirection[1] = d[1];
-   theLightDirection[2] = d[2];
-}
-
-void ossimTopographicCorrectionFilter::executeTopographicCorrection(
-   ossimRefPtr<ossimImageData>& outputData,
-   ossimRefPtr<ossimImageData>& colorData,
-   ossimRefPtr<ossimImageData>& normalData)
-{
-   switch(colorData->getScalarType())
-   {
-   case OSSIM_UCHAR:
-   {
-      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
-      {
-         executeTopographicCorrectionTemplate((ossim_uint8)0,
-                                              outputData,
-                                              colorData,
-                                              normalData);
-      }
-      else
-      {
-         executeTopographicCorrectionMinnaertTemplate((ossim_uint8)0,
-                                                      outputData,
-                                                      colorData,
-                                                      normalData);
-      }
-      break;
-   }
-   case OSSIM_USHORT11:
-   case OSSIM_USHORT16:
-   {
-      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
-      {
-         executeTopographicCorrectionTemplate((ossim_uint16)0,
-                                              outputData,
-                                              colorData,
-                                              normalData);
-      }
-      else
-      {
-         executeTopographicCorrectionMinnaertTemplate((ossim_uint16)0,
-                                                      outputData,
-                                                      colorData,
-                                                      normalData);
-      }
-      break;
-   }
-   case OSSIM_SSHORT16:
-   {
-      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
-      {
-         executeTopographicCorrectionTemplate((ossim_sint16)0,
-                                              outputData,
-                                              colorData,
-                                              normalData);
-      }
-      else
-      {
-         executeTopographicCorrectionMinnaertTemplate((ossim_sint16)0,
-                                                      outputData,
-                                                      colorData,
-                                                      normalData);
-      }
-      break;
-   }
-   case OSSIM_DOUBLE:
-   case OSSIM_NORMALIZED_DOUBLE:
-   {
-      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
-      {
-         executeTopographicCorrectionTemplate((ossim_float64)0,
-                                              outputData,
-                                              colorData,
-                                              normalData);
-      }
-      else
-      {
-         executeTopographicCorrectionMinnaertTemplate((ossim_float64)0,
-                                                      outputData,
-                                                      colorData,
-                                                      normalData);
-      }
-      break;
-   }
-   case OSSIM_FLOAT:
-   case OSSIM_NORMALIZED_FLOAT:
-   {
-      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
-      {
-         executeTopographicCorrectionTemplate((ossim_float32)0,
-                                              outputData,
-                                              colorData,
-                                              normalData);
-      }
-      else
-      {
-         executeTopographicCorrectionMinnaertTemplate((ossim_float32)0,
-                                                      outputData,
-                                                      colorData,
-                                                      normalData);
-      }
-      break;
-   }
-   default:
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimTopographicCorrectionFilter::executeTopographicCorrection WARN: Not handling scalar type"
-         << endl;
-   }
-   }
-}
-
-template <class T>
-void ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(
-   T /* dummy */,
-   ossimRefPtr<ossimImageData>& outputData,
-   ossimRefPtr<ossimImageData>& colorData,
-   ossimRefPtr<ossimImageData>& normalData)
-{
-   ossim_int32 y = 0;
-   ossim_int32 x = 0;
-   ossim_int32 colorW = colorData->getWidth();
-   ossim_int32 colorH = colorData->getHeight();
-
-   T* colorDataBand = 0;
-   T* outputDataBand = 0;
-   ossim_float64 colorNp = 0;
-   ossim_float64 colorMin = 0;
-   ossim_float64 colorMax = 0;
-   // ossim_float64 outputDelta = 0;;
-   // ossim_float64 outputMin = 0;
-   // ossim_float64 outputMax = 0;
-   ossim_float64 outputNp;
-   double  normalNp = normalData->getNullPix(0);
-   double  LPrime = 0.0;
-   double  LNew   = 0.0;
-   double  dn     = 0.0;
-   double cosineZenith = ossim::cosd(90 - theLightSourceElevationAngle);
-
-   if(!colorData->getBuf()||
-      !normalData->getBuf()||
-      (colorData->getDataObjectStatus() == OSSIM_EMPTY))
-   {
-      return;
-   }
-   for(ossim_uint32 b = 0; b < outputData->getNumberOfBands();++b)
-   {
-      int mappedBand = theBandMapping[b];
-      double* normalX  = (double*)normalData->getBuf(0);
-      double* normalY  = (double*)normalData->getBuf(1);
-      double* normalZ  = (double*)normalData->getBuf(2);
-      double numerator = cosineZenith + theC[mappedBand];
-      outputNp  = (ossim_float64)outputData->getNullPix(b);
-      // outputMin = (ossim_float64)outputData->getMinPix(b);
-      // outputMax = (ossim_float64)outputData->getMaxPix(b);
-      // outputDelta = outputMax - outputMin;
-      colorDataBand    = (T*)(colorData->getBuf(b));
-      colorNp          = (ossim_float64)(colorData->getNullPix(b));
-      colorMin         = (ossim_float64)(colorData->getMinPix(b));
-      colorMax         = (ossim_float64)(colorData->getMaxPix(b));
-      outputDataBand   = (T*)(outputData->getBuf(b));
-      bool theValuesAreGood = b < theC.size();
-      double c = theC[mappedBand];
-      if(theTopoCorrectionType != TOPO_CORRECTION_COSINE_C)
-      {
-         c = 0;
-      }
-      for(y = 0; y < colorH; ++y)
-      {
-         for(x = 0; x < colorW; ++x)
-         {
-            if((*colorDataBand) != colorNp)
-            {
-               if((*normalX != normalNp)&&
-                  (*normalY != normalNp)&&
-                  (*normalZ != normalNp)&&
-                  theValuesAreGood)
-               {
-
-                  double cosineNewI = ((*normalX)*theLightDirection[0] +
-                                       (*normalY)*theLightDirection[1] +
-                                       (*normalZ)*theLightDirection[2]);
-                  double cosineRatioDenom = (cosineNewI + c);
-                  if((fabs(cosineRatioDenom) > FLT_EPSILON)&&(cosineNewI >= 0.0))
-                  {
-                     double cosineRatio = numerator/cosineRatioDenom;
-
-                     LPrime = theGain[mappedBand]*((ossim_float64)(*colorDataBand)) + theBias[mappedBand];
-
-                     LNew = LPrime*cosineRatio;
-
-                     dn = ((LNew-theBias[mappedBand])/theGain[mappedBand]);
-
-                     if(dn < colorMin) dn = colorMin;
-                     if(dn > colorMax) dn = colorMax;
-
-                     *outputDataBand = (T)(dn);
-                  }
-                  else
-                  {
-                     *outputDataBand = (T)(*colorDataBand);
-                  }
-               }
-               else
-               {
-                  *outputDataBand = (T)(*colorDataBand);
-               }
-            }
-            else
-            {
-               *outputDataBand = (T)outputNp;
-            }
-
-            ++outputDataBand;
-            ++colorDataBand;
-            ++normalX;
-            ++normalY;
-            ++normalZ;
-         }
-      }
-   }
-}
-
-template <class T>
-void ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(
-   T /* dummy */,
-   ossimRefPtr<ossimImageData>& outputData,
-   ossimRefPtr<ossimImageData>& colorData,
-   ossimRefPtr<ossimImageData>& normalData)
-{
-
-   ossim_int32 y = 0;
-   ossim_int32 x = 0;
-   ossim_int32 colorW = colorData->getWidth();
-   ossim_int32 colorH = colorData->getHeight();
-
-   T* colorDataBand = 0;
-   T* outputDataBand = 0;
-   ossim_float64 colorNp = 0;
-   ossim_float64 colorMin = 0;
-   ossim_float64 colorMax = 0;
-   // ossim_float64 outputDelta = 0;;
-   // ossim_float64 outputMin = 0;
-   // ossim_float64 outputMax = 0;
-   ossim_float64 outputNp;
-   double  normalNp = normalData->getNullPix(0);
-   double  LPrime = 0.0;
-   double  LNew   = 0.0;
-   double  dn     = 0.0;
-
-   if(!colorData->getBuf()||
-      !normalData->getBuf()||
-      (colorData->getDataObjectStatus() == OSSIM_EMPTY))
-   {
-      return;
-   }
-   int maxBands = ossim::min((int)theK.size(), (int)outputData->getNumberOfBands());
-   for(int b = 0; b < maxBands;++b)
-   {
-      int mappedBand = theBandMapping[b];
-      double* normalX  = (double*)normalData->getBuf(0);
-      double* normalY  = (double*)normalData->getBuf(1);
-      double* normalZ  = (double*)normalData->getBuf(2);
-      outputNp  = (ossim_float64)outputData->getNullPix(b);
-      // outputMin = (ossim_float64)outputData->getMinPix(b);
-      // outputMax = (ossim_float64)outputData->getMaxPix(b);
-      // outputDelta = outputMax - outputMin;
-      colorDataBand    = (T*)(colorData->getBuf(b));
-      colorNp          = (ossim_float64)(colorData->getNullPix(b));
-      colorMin         = (ossim_float64)(colorData->getMinPix(b));
-      colorMax         = (ossim_float64)(colorData->getMaxPix(b));
-      outputDataBand   = (T*)(outputData->getBuf(b));
-      for(y = 0; y < colorH; ++y)
-      {
-         for(x = 0; x < colorW; ++x)
-         {
-            if((*colorDataBand) != colorNp)
-            {
-               if((*normalX != normalNp)&&
-                  (*normalY != normalNp)&&
-                  (*normalZ != normalNp))
-               {
-
-//                   if(fabs(*normalZ) < FLT_EPSILON)
-//                   {
-//                      *normalZ = 0.0;
-//                   }
-                  double cosineNewI = (((*normalX)*theLightDirection[0] +
-                                        (*normalY)*theLightDirection[1] +
-                                        (*normalZ)*theLightDirection[2]));
-                  double slopeAngle = acos(*normalZ);
-                  double cosineSlope = cos(slopeAngle);
-                  double k  = theK[mappedBand];
-                  double cosineSlopeKPower = pow(cosineSlope, k);
-                  double denom = pow((double)cosineNewI, k)*cosineSlopeKPower;
-                  double numerator = cosineSlope;
-
-//                  double slopeAngle = asin(*normalZ);
-//                  double tempK = theK[mappedBand]*cosineNewI;
-//                double denom = pow((double)cosineNewI*cosineSlope, theK[mappedBand]);
-//                  double numerator = pow((double)cosineSlope, 1-tempK);
-//                  if((fabs(denom) > .0001)&&(cosineNewI >= 0.0))
-//                  if((cosineNewI >= 0.0) &&fabs(denom) > .000001)
-                  if(fabs(denom) > .00000001)
-                  {
-//                     double cosineRatio = cosineSlope/denom;
-                     double cosineRatio = numerator/denom;
-
-                     LPrime = theGain[mappedBand]*((ossim_float64)(*colorDataBand)) + theBias[mappedBand];
-
-                     LNew = LPrime*cosineRatio;
-
-                     dn = ((LNew-theBias[mappedBand])/theGain[mappedBand]);
-
-                     if(dn < colorMin) dn = colorMin;
-                     if(dn > colorMax) dn = colorMax;
-
-                     *outputDataBand = (T)(dn);
-                  }
-                  else
-                  {
-                     *outputDataBand = (T)(*colorDataBand);
-                  }
-               }
-               else
-               {
-                  *outputDataBand = (T)(*colorDataBand);
-               }
-            }
-            else
-            {
-               *outputDataBand = (T)outputNp;
-            }
-
-            ++outputDataBand;
-            ++colorDataBand;
-            ++normalX;
-            ++normalY;
-            ++normalZ;
-         }
-      }
-   }
-}
-
-
-#if 0
-void ossimTopographicCorrectionFilter::computeC()
-{
-   theCComputedFlag = false;
-   int b = 0;
-   int tileCount = 0;
-   bool done = false;
-   if(theC.size()<1) return;
-
-   for(b = 0; b < (int) theC.size(); ++b)
-   {
-      theC[b] = 0.0;
-   }
-
-
-   theNdviLowTest  = 0.1;
-   theNdviHighTest = 1;
-
-   ossimImageSource* colorSource  = PTR_CAST(ossimImageSource, getInput(0));
-   ossimImageSource* normalSource = PTR_CAST(ossimImageSource, getInput(1));
-
-   if(!colorSource || !normalSource)
-   {
-      return;
-   }
-   std::vector<ossim2dLinearRegression> linearRegression(theC.size());
-   ossimIrect normalRect = normalSource->getBoundingRect();
-   ossimIrect colorRect  = colorSource->getBoundingRect();
-   ossimIrect clipRect   = normalRect.clipToRect(colorRect);
-   ossimIpt ul = clipRect.ul();
-   ossimIpt lr = clipRect.lr();
-   ossimIpt tileSize(128,128);
-   ossim_int32 tilesHoriz = clipRect.width()/tileSize.x;
-   ossim_int32 tilesVert  = clipRect.height()/tileSize.y;
-
-
-   if(!normalRect.intersects(colorRect))
-   {
-      return;
-   }
-   ossim_int32 maxSize = tilesHoriz*tilesVert;//ossim::min(200, );
-
-   int idx = 0;
-
-   idx = 0;
-   std::vector<int> cosineIBucketCount(10);
-   std::fill(cosineIBucketCount.begin(), cosineIBucketCount.end(), 0);
-   const int maxBucketCount = 1000;
-   bool goodCoefficients = false;
-   long numberOfRuns = 0;
-   while((!goodCoefficients)&&(numberOfRuns < 2))
-   {
-      while((idx < maxSize)&&
-            (!done))
-      {
-         ossim_int32 ty = idx/tilesHoriz;
-         ossim_int32 tx = idx%tilesHoriz;
-
-
-         ossim_int32 x = (ul.x + tx*tileSize.x);
-         ossim_int32 y = (ul.y + ty*tileSize.y);
-
-         ossimIrect requestRect(x,
-                                y,
-                                x+tileSize.x-1,
-                                y+tileSize.y-1);
-
-         ossimRefPtr<ossimImageData> colorData  = colorSource->getTile(requestRect);
-         ossimRefPtr<ossimImageData> normalData = normalSource->getTile(requestRect);
-
-         switch(colorData->getScalarType())
-         {
-         case OSSIM_UCHAR:
-         {
-            addRegressionPointsTemplate((ossim_uint8)0,
-                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
-            break;
-         }
-         case OSSIM_USHORT11:
-         case OSSIM_USHORT16:
-         {
-            addRegressionPointsTemplate((ossim_uint16)0,
-                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
-            break;
-         }
-         case OSSIM_SSHORT16:
-         {
-            addRegressionPointsTemplate((ossim_sint16)0,
-                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
-            break;
-         }
-         case OSSIM_FLOAT:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            addRegressionPointsTemplate((ossim_float32)0,
-                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
-            break;
-         }
-         case OSSIM_DOUBLE:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            addRegressionPointsTemplate((ossim_float64)0,
-                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
-            break;
-         }
-         }
-         if(((double)linearRegression[0].getNumberOfPoints()/(double)(maxBucketCount*10.0))>=.7)
-         {
-            done = true;
-         }
-         ++idx;
-      }
-
-      double intercept, m;
-      long numberOfPositiveSlopes=0;
-      for(b=0;b<theC.size();++b)
-      {
-         if(linearRegression[b].getNumberOfPoints()>2)
-         {
-            linearRegression[b].solve();
-            linearRegression[b].getEquation(m, intercept);
-            theC[b] = intercept/m;
-
-            ossimNotify(ossimNotifyLevel_INFO) << "equation for b = " << b <<" is y = " << m << "*x + " << intercept << endl
-                                               << "with c =         " << theC[b] << endl;
-            if(m >=0.0)
-            {
-               numberOfPositiveSlopes++;
-            }
-         }
-      }
-      for(idx = 0; idx < cosineIBucketCount.size(); ++idx)
-      {
-         ossimNotify(ossimNotifyLevel_INFO) << "bucket " << idx << " = " << cosineIBucketCount[idx] << endl;
-      }
-      if(numberOfPositiveSlopes > .5*theC.size())
-      {
-         goodCoefficients = true;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimTopographicCorrectionFilter::computeC() WARN: not enough positive slopes" << endl
-                                             << "changing test to look for dirt areas" << endl;
-         theNdviLowTest = -1.0;
-         theNdviHighTest = .1;
-         for(b=0;b<theC.size();++b)
-         {
-            linearRegression[b].clear();
-         }
-      }
-      ++numberOfRuns;
-   }
-   theCComputedFlag = true;
-}
-
-template<class T>
-void ossimTopographicCorrectionFilter::addRegressionPointsTemplate(
-   T, //dummy
-   std::vector<ossim2dLinearRegression>& regressionPoints,
-   std::vector<int>& cosineIBucketCount,
-   ossim_int32 maxCountPerBucket,
-   ossimRefPtr<ossimImageData>& colorData,
-   ossimRefPtr<ossimImageData>& normalData)
-{
-   if(!colorData||!normalData)
-   {
-      return;
-   }
-   if((colorData->getDataObjectStatus() == OSSIM_EMPTY)||
-      (!colorData->getBuf())||
-      (!normalData->getBuf())||
-      (normalData->getDataObjectStatus()==OSSIM_EMPTY))
-   {
-      return;
-   }
-
-   ossim_float64* normalBands[3];
-   ossim_float64 normalBandsNp[3];
-   ossim_uint32 count=0;
-   ossim_uint32 b = 0;
-   std::vector<T*> colorBands(colorData->getNumberOfBands());
-   std::vector<T> colorBandsNp(colorData->getNumberOfBands());
-
-   normalBands[0]   = (ossim_float64*)normalData->getBuf(0);
-   normalBands[1]   = (ossim_float64*)normalData->getBuf(1);
-   normalBands[2]   = (ossim_float64*)normalData->getBuf(2);
-   normalBandsNp[0] = normalData->getNullPix(0);
-   normalBandsNp[1] = normalData->getNullPix(1);
-   normalBandsNp[2] = normalData->getNullPix(2);
-
-   for(b=0;b<colorData->getNumberOfBands();++b)
-   {
-      colorBands[b]   = (T*)colorData->getBuf(b);
-      colorBandsNp[b] = (T)colorData->getNullPix(b);
-   }
-
-   ossim_uint32 maxOffset = colorData->getWidth()*colorData->getHeight();
-   ossim_uint32 offset=0;
-   ossim_float64 ndviTest=0.0;
-   ossim_uint32 numberOfTests = 0;
-   if(maxOffset)
-   {
-      maxOffset-=1;
-   }
-
-   ossim_int32 percent = (ossim_int32)(colorData->getWidth()*colorData->getHeight()*.2);
-   offset = 0;
-   ossim_uint32 countPixels = 0;
-   while(offset < maxOffset)
-   {
-      bool nullBandsExist = false;
-      for(b = 0; ((b < colorData->getNumberOfBands())&&(!nullBandsExist));++b)
-      {
-         if(*colorBands[b] == colorBandsNp[b])
-         {
-            nullBandsExist = true;
-         }
-      }
-
-      if((!nullBandsExist)&&
-         (*normalBands[0] != normalBandsNp[0])&&
-         (*normalBands[1] != normalBandsNp[1])&&
-         (*normalBands[2] != normalBandsNp[2]))
-      {
-         if(computeNdvi((T)0,
-                        ndviTest,
-                        offset,
-                        colorBands))
-         {
-            if((ndviTest >= theNdviLowTest) && (ndviTest <= theNdviHighTest))
-            {
-               double cosineI = ((*(normalBands[0]+offset))*theLightDirection[0] +
-                                 (*(normalBands[1]+offset))*theLightDirection[1] +
-                                 (*(normalBands[2]+offset))*theLightDirection[2]);
-               if(cosineI >= 0.0)
-               {
-                  long bucketIdx = (long)(cosineI*cosineIBucketCount.size());
-
-                  // we will try to disperse the normals out and so we don't clump everything
-                  // in one place
-                  //
-                  if(cosineIBucketCount[bucketIdx] < maxCountPerBucket)
-                  {
-                     for(b = 0; b < colorData->getNumberOfBands();++b)
-                     {
-                        regressionPoints[b].addPoint(ossimDpt(cosineI, *(colorBands[b]+offset)));
-                     }
-                     ++cosineIBucketCount[bucketIdx];
-                     ++count;
-                  }
-               }
-            }
-         }
-      }
-      ++offset;
-   }
-}
-#endif
-
-template <class T> bool ossimTopographicCorrectionFilter::computeNdvi(
-   T,
-   ossim_float64& result,
-   ossim_uint32 offset,
-   const std::vector<T*>& bands)const
-{
-   if(bands.size() > 3)
-   {
-      result = (((double)*(bands[3]+offset) - (double)*(bands[2]+offset))/
-                ((double)*(bands[3]+offset) + (double)*(bands[2]+offset)));
-      return true;
-   }
-
-   return false;
-}
-
-void ossimTopographicCorrectionFilter::resizeArrays(ossim_uint32 newSize)
-{
-  if(!getInput(0) || !getInput(1)) return;
-
-
-   vector<double> tempC    = theC;
-   vector<double> tempK    = theK;
-   vector<double> tempBias = theBias;
-   vector<double> tempGain = theGain;
-
-   theC.resize(newSize);
-   theK.resize(newSize);
-   theBias.resize(newSize);
-   theGain.resize(newSize);
-   ossim_uint32 tempIdx = 0;
-   if(tempC.size() > 0 && (theC.size() > 0))
-   {
-      int numberOfElements = ossim::min((int)tempC.size(),(int)theC.size());
-
-      std::copy(tempC.begin(), tempC.begin()+numberOfElements,
-                theC.begin());
-      std::copy(tempK.begin(), tempK.begin()+numberOfElements,
-                theK.begin());
-      std::copy(tempBias.begin(), tempBias.begin()+numberOfElements,
-                theBias.begin());
-      std::copy(tempGain.begin(), tempGain.begin()+numberOfElements,
-                theGain.begin());
-
-      if(theC.size() > tempC.size())
-      {
-         std::fill(theC.begin()+numberOfElements, theC.end(), (double)0.0);
-         std::fill(theBias.begin()+numberOfElements, theBias.end(), (double)0.0);
-         std::fill(theGain.begin()+numberOfElements, theGain.end(), (double)1.0);
-         for(tempIdx = numberOfElements; tempIdx < theK.size(); ++tempIdx)
-         {
-            theK[tempIdx] = 0.3 + .4*(tempIdx/(double)(theK.size()));
-         }
-      }
-   }
-   else
-   {
-      std::fill(theC.begin(), theC.end(), (double)0.0);
-      std::fill(theBias.begin(), theBias.end(), (double)0.0);
-      std::fill(theGain.begin(), theGain.end(), (double)1.0);
-      for(tempIdx = 0; tempIdx < theK.size(); ++tempIdx)
-      {
-         theK[tempIdx] = 0.3 + .4*(tempIdx/(double)(theK.size()));
-      }
-   }
-}
-
-bool ossimTopographicCorrectionFilter::loadState(const ossimKeywordlist& kwl,
-                                                 const char* prefix)
-{
-
-   ossimString elevAngle      = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
-   ossimString azimuthAngle   = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
-   ossimString bands          = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
-   ossimString correctionType = kwl.find(prefix, CORRECTION_TYPE_KW);
-   ossimString julianDay      = kwl.find(prefix, ossimKeywordNames::JULIAN_DAY_KW);
-   ossimString cComputedFlag  = kwl.find(prefix, C_COMPUTED_FLAG_KW);
-   ossimString ndviRange      = kwl.find(prefix, NDVI_RANGE_KW);
-
-   theCComputedFlag = cComputedFlag.toBool();
-   correctionType = correctionType.downcase();
-   int numberOfBands = bands.toInt();
-   theLightSourceElevationAngle = elevAngle.toDouble();
-   theLightSourceAzimuthAngle   = azimuthAngle.toDouble();
-   theJulianDay = julianDay.toDouble();
-
-   if(ndviRange != "")
-   {
-      std::istringstream input(ndviRange.c_str());
-
-      input >> theNdviLowTest >> theNdviHighTest;
-   }
-   if(numberOfBands>0)
-   {
-     theGain.resize(numberOfBands);
-     theBias.resize(numberOfBands);
-     theC.resize(numberOfBands);
-     theK.resize(numberOfBands);
-      for(int b = 0; b < numberOfBands; ++b)
-      {
-         ossimString k    = "k"+ossimString::toString(b);
-         ossimString c    = "c"+ossimString::toString(b);
-         ossimString bias = "bias"+ossimString::toString(b);
-         ossimString gain = "gain"+ossimString::toString(b);
-
-         const char* kValue    = kwl.find(prefix, k);
-         const char* cValue    = kwl.find(prefix, c);
-         const char* biasValue = kwl.find(prefix, bias);
-         const char* gainValue = kwl.find(prefix, gain);
-	 if(kValue)
-	   {
-	     theK[b] = ossimString(kValue).toDouble();
-	   }
-	 else
-	   {
-	     theK[b] = 1.0;
-	   }
-         if(cValue)
-         {
-            theC[b] = ossimString(cValue).toDouble();
-         }
-         else
-         {
-            theC[b] = 0.0;;
-         }
-         if(biasValue)
-         {
-            theBias[b] = ossimString(biasValue).toDouble();
-         }
-         else
-         {
-            theBias[b] = 0.0;
-         }
-         if(gainValue)
-         {
-            theGain[b] = ossimString(gainValue).toDouble();
-         }
-         else
-         {
-            theGain[b] = 1.0;
-         }
-      }
-   }
-
-   if(correctionType.contains("cosine_c"))
-   {
-      theTopoCorrectionType = TOPO_CORRECTION_COSINE_C;
-   }
-   else if(correctionType.contains("minnaert"))
-   {
-      theTopoCorrectionType = TOPO_CORRECTION_MINNAERT;
-   }
-   else
-   {
-      theTopoCorrectionType = TOPO_CORRECTION_COSINE;
-   }
-
-
-   bool result =  ossimImageCombiner::loadState(kwl, prefix);
-
-   computeLightDirection();
-
-   return result;
-}
-
-bool ossimTopographicCorrectionFilter::saveState(ossimKeywordlist& kwl,
-                                                 const char* prefix)const
-{
-   // we can use any of the arrays theC, theBias, or theGain since
-   // they mirror the number of input bands
-   //
-   int numberOfBands = (int)theC.size();
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_BANDS_KW,
-           numberOfBands,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::ELEVATION_ANGLE_KW,
-           theLightSourceElevationAngle,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::AZIMUTH_ANGLE_KW,
-           theLightSourceAzimuthAngle,
-           true);
-
-   kwl.add(prefix,
-           C_COMPUTED_FLAG_KW,
-           (ossim_uint32)theCComputedFlag,
-           true);
-   kwl.add(prefix,
-           NDVI_RANGE_KW,
-           ossimString::toString(theNdviLowTest) +
-           " " + ossimString::toString(theNdviHighTest),
-           true);
-
-   if(theTopoCorrectionType == TOPO_CORRECTION_COSINE_C)
-   {
-      kwl.add(prefix,
-              CORRECTION_TYPE_KW,
-              "cosine_c",
-              true);
-   }
-   else if(theTopoCorrectionType == TOPO_CORRECTION_MINNAERT)
-   {
-      kwl.add(prefix,
-              CORRECTION_TYPE_KW,
-              "minnaert",
-              true);
-   }
-   else
-   {
-      kwl.add(prefix,
-              CORRECTION_TYPE_KW,
-              "cosine",
-              true);
-   }
-
-   for(int b = 0; b < numberOfBands; ++b)
-   {
-      ossimString k    = "k"+ossimString::toString(b);
-      ossimString c    = "c"+ossimString::toString(b);
-      ossimString bias = "bias"+ossimString::toString(b);
-      ossimString gain = "gain"+ossimString::toString(b);
-      kwl.add(prefix,
-              k,
-              theK[b],
-              true);
-      kwl.add(prefix,
-              c,
-              theC[b],
-              true);
-      kwl.add(prefix,
-              bias,
-              theBias[b],
-              true);
-      kwl.add(prefix,
-              gain,
-              theGain[b],
-              true);
-   }
-
-   return ossimImageCombiner::saveState(kwl, prefix);
-}
-
-ossim_uint32 ossimTopographicCorrectionFilter::getNumberOfOutputBands() const
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(colorSource)
-   {
-      return colorSource->getNumberOfOutputBands();
-   }
-   return ossimImageCombiner::getNumberOfOutputBands();
-}
-
-ossimScalarType ossimTopographicCorrectionFilter::getOutputScalarType() const
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(colorSource)
-   {
-      return colorSource->getOutputScalarType();
-   }
-   return ossimImageCombiner::getOutputScalarType();
-}
-
-double ossimTopographicCorrectionFilter::getNullPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(colorSource)
-   {
-      return colorSource->getNullPixelValue(band);
-   }
-   return ossimImageCombiner::getNullPixelValue(band);
-}
-
-double ossimTopographicCorrectionFilter::getMinPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(colorSource)
-   {
-      return colorSource->getMinPixelValue(band);
-   }
-   return ossimImageCombiner::getMinPixelValue(band);
-}
-
-double ossimTopographicCorrectionFilter::getMaxPixelValue(ossim_uint32 band)const
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(colorSource)
-   {
-      return colorSource->getMaxPixelValue(band);
-   }
-   return ossimImageCombiner::getMaxPixelValue(band);
-}
-
-ossimIrect ossimTopographicCorrectionFilter::getBoundingRect(ossim_uint32 resLevel)const
-{
-   ossimIrect result;
-   result.makeNan();
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-
-   if(colorSource)
-   {
-      result = colorSource->getBoundingRect(resLevel);
-   }
-
-   return result;
-}
-
-void ossimTopographicCorrectionFilter::getDecimationFactor(ossim_uint32 resLevel,
-                                                           ossimDpt& result) const
-{
-   result.makeNan();
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-
-   if(colorSource)
-   {
-      colorSource->getDecimationFactor(resLevel,
-                                       result);
-   }
-}
-
-void ossimTopographicCorrectionFilter::getDecimationFactors(vector<ossimDpt>& decimations) const
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(colorSource)
-   {
-      colorSource->getDecimationFactors(decimations);
-   }
-}
-
-ossim_uint32 ossimTopographicCorrectionFilter::getNumberOfDecimationLevels()const
-{
-   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
-   if(colorSource)
-   {
-      return colorSource->getNumberOfDecimationLevels();
-   }
-   return 0;
-}
-
-double ossimTopographicCorrectionFilter::getAzimuthAngle()const
-{
-   return theLightSourceAzimuthAngle;
-}
-
-double ossimTopographicCorrectionFilter::getElevationAngle()const
-{
-   return theLightSourceElevationAngle;
-}
-
-void ossimTopographicCorrectionFilter::setAzimuthAngle(double angle)
-{
-   theLightSourceAzimuthAngle = angle;
-}
-
-void ossimTopographicCorrectionFilter::setElevationAngle(double angle)
-{
-   theLightSourceElevationAngle = angle;
-}
-bool ossimTopographicCorrectionFilter::canConnectMyInputTo(ossim_int32 inputIndex,
-                                                           const ossimConnectableObject* object)const
-{
-   return (object&&
-           ( (inputIndex>=0) && inputIndex < 2)&&
-           PTR_CAST(ossimImageSource, object));
-
-}
-
-void ossimTopographicCorrectionFilter::connectInputEvent(ossimConnectionEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimTopographicCorrectionFilter::disconnectInputEvent(ossimConnectionEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimTopographicCorrectionFilter::propertyEvent(ossimPropertyEvent& /* event */)
-{
-   initialize();
-}
-
-void ossimTopographicCorrectionFilter::refreshEvent(ossimRefreshEvent& /* event */)
-{
-   initialize();
-}
-
-ossimTopographicCorrectionFilter::ossimTopoCorrectionType ossimTopographicCorrectionFilter::getTopoCorrectionType()const
-{
-   return theTopoCorrectionType;
-}
-
-void ossimTopographicCorrectionFilter::setTopoCorrectionType(ossimTopoCorrectionType topoType)
-{
-   theTopoCorrectionType = topoType;
-}
-
-const std::vector<double>& ossimTopographicCorrectionFilter::getGainValues()const
-{
-   return theGain;
-}
-
-void ossimTopographicCorrectionFilter::setGainValues(const std::vector<double>& gainValues)
-{
-   theGain = gainValues;
-}
-
-const vector<double>& ossimTopographicCorrectionFilter::getBiasValues()const
-{
-   return theBias;
-}
-
-void ossimTopographicCorrectionFilter::setBiasValues(const std::vector<double>& biasValues)
-{
-   theBias = biasValues;
-}
-
-const vector<double>& ossimTopographicCorrectionFilter::getKValues()const
-{
-   return theK;
-}
-
-double ossimTopographicCorrectionFilter::getK(int idx)const
-{
-   if(idx < (int)theK.size())
-   {
-      return theK[idx];
-   }
-   else
-   {
-      return 1.0;
-   }
-}
-
-void ossimTopographicCorrectionFilter::setK(int idx, double value)
-{
-   if(idx < (int)theK.size())
-   {
-      theK[idx] = value;
-   }
-}
-
-void ossimTopographicCorrectionFilter::setKValues(const vector<double>& kValues)
-{
-   theK = kValues;
-}
-
-double ossimTopographicCorrectionFilter::getC(int idx)const
-{
-   if(idx < (int)theC.size())
-   {
-      return theC[idx];
-   }
-   else
-   {
-      return 0.0;
-   }
-}
-
-void ossimTopographicCorrectionFilter::setC(int idx, double value)
-{
-   if(idx < (int)theC.size())
-   {
-      theC[idx] = value;
-   }
-}
-
-void ossimTopographicCorrectionFilter::setCValues(const vector<double>& cValues)
-{
-   theC = cValues;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTrimFilter.cpp b/ossim/src/ossim/imaging/ossimTrimFilter.cpp
deleted file mode 100644
index 3aa35b1..0000000
--- a/ossim/src/ossim/imaging/ossimTrimFilter.cpp
+++ /dev/null
@@ -1,358 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimTrimFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimTrimFilter.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimDpt.h>
-
-static ossimTrace traceDebug("ossimTrimFilter:debug");
-
-RTTI_DEF1(ossimTrimFilter,
-          "ossimTrimFilter",
-          ossimImageSourceFilter);
-
-ossimTrimFilter::ossimTrimFilter()
-   :ossimImageSourceFilter(),
-    theLeftPercent(0.0),
-    theRightPercent(0.0),
-    theTopPercent(0.0),
-    theBottomPercent(0.0)
-{
-   theCutter = new ossimPolyCutter;
-}
-
-ossimTrimFilter::~ossimTrimFilter()
-{
-   theCutter = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimTrimFilter::getTile(
-   const ossimIrect& rect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return NULL;
-   }
-
-   if(!theValidVertices.size())
-   {
-      return ossimImageSourceFilter::getTile(rect, resLevel);
-   }
-   
-   ossimRefPtr<ossimImageData> tile =
-      theCutter->getTile(rect, resLevel);
-
-   if(!isSourceEnabled()||!tile.valid())
-   {
-      return tile;
-   }
-   if(tile->getDataObjectStatus() == OSSIM_NULL ||
-      tile->getDataObjectStatus() == OSSIM_EMPTY)
-   {
-      return tile;
-   }
-
-   return theCutter->getTile(rect, resLevel);
-//    theTile->setImageRectangle(rect);
-//    theTile->setDataObjectStatus(OSSIM_FULL);
-
-//    theTile->makeBlank();
-//    ossimIrect boundingRect = getBoundingRect(resLevel);
-//    ossimIrect tileRect     = tile->getImageRectangle();
-//    ossimIrect clipRect     = boundingRect.clipToRect(tileRect);
-
-//    theTile->loadTile(tile->getBuf(),
-//                      tile->getImageRectangle(),
-//                      clipRect,
-//                      OSSIM_BSQ);
-   
-//    theTile->validate();
-   
-}
-
-void ossimTrimFilter::getValidImageVertices(
-   vector<ossimIpt>& validVertices,
-   ossimVertexOrdering ordering,
-   ossim_uint32 resLevel)const
-{
-   ossimImageSource::getValidImageVertices(validVertices,
-                                           ordering,
-                                           resLevel);
-   if(validVertices.size()==4)
-   {
-      ossimDpt averagePt((ossimDpt(validVertices[0])+
-                          ossimDpt(validVertices[1])+
-                          ossimDpt(validVertices[2])+
-                          ossimDpt(validVertices[3]))*.25);
-      ossimDpt averageTop( ( ossimDpt(validVertices[0]+
-                                      validVertices[1])*.5) );
-      ossimDpt averageBottom( ( ossimDpt(validVertices[2]+
-                                         validVertices[3])*.5 ) );
-      ossimDpt averageLeft( (ossimDpt(validVertices[0]+
-                                      validVertices[3])*.5) );
-      ossimDpt averageRight( (ossimDpt(validVertices[1]+
-                                       validVertices[2])*.5) );
-
-      ossimDpt topAxis    = (averageTop-averagePt);
-      ossimDpt rightAxis = (averageRight-averagePt);
-      ossimDpt leftAxis  = (averageLeft-averagePt);
-      ossimDpt bottomAxis = (averageBottom-averagePt);
-
-      double topLen    = topAxis.length();
-      double bottomLen = bottomAxis.length();
-      double rightLen  = rightAxis.length();
-      double leftLen   = leftAxis.length();
-
-      if((topLen > FLT_EPSILON)&&
-         (bottomLen > FLT_EPSILON)&&
-         (leftLen > FLT_EPSILON)&&
-         (rightLen > FLT_EPSILON))
-      {
-         topAxis    = topAxis*(1.0/topLen);
-         bottomAxis = bottomAxis*(1.0/bottomLen);
-         leftAxis   = leftAxis*(1.0/leftLen);
-         rightAxis  = rightAxis*(1.0/rightLen);
-
-         ossim_uint32 idx = 0;
-         ossim_uint32 count = 0;
-         for(idx = 0; idx < validVertices.size(); ++idx)
-         {
-            ossimDpt axis[2];
-            double   axisLen[2];
-            ossimDpt diff  = validVertices[idx]-averagePt;
-            double testLen = (topAxis.x*diff.x+
-                              topAxis.y*diff.y);
-            count = 0;
-            if(testLen >= -FLT_EPSILON)
-            {
-               axis[count]    = topAxis;
-               axisLen[count] = testLen*(1.0-theTopPercent);
-               ++count;
-            }
-
-            if(count < 2)
-            {
-               testLen = (bottomAxis.x*diff.x+
-                          bottomAxis.y*diff.y);
-               if(testLen >= -FLT_EPSILON)
-               {
-                  axis[count]    = bottomAxis;
-                  axisLen[count] = testLen*(1.0-theBottomPercent);
-                  ++count;
-               }
-            }
-            if(count < 2)
-            {
-               testLen = (leftAxis.x*diff.x+
-                          leftAxis.y*diff.y);
-               if(testLen >= -FLT_EPSILON)
-               {
-                  axis[count]    = leftAxis;
-                  axisLen[count] = testLen*(1.0-theLeftPercent);
-                  ++count;
-               }
-            }
-            if(count < 2)
-            {
-               testLen = (rightAxis.x*diff.x+
-                          rightAxis.y*diff.y);
-               if(testLen >= -FLT_EPSILON)
-               {
-                  axis[count]    = rightAxis;
-                  axisLen[count] = testLen*(1.0-theRightPercent);
-                  ++count;
-               }
-            }
-            if(count == 2)
-            {
-               validVertices[idx] = (averagePt + (axis[0]*axisLen[0] +
-                                                  axis[1]*axisLen[1]));
-            }
-         }
-      }
-   }
-//    ossimIrect rect = getBoundingRect();
-
-//    if(ordering == OSSIM_CLOCKWISE_ORDER)
-//    {
-//       validVertices.push_back(rect.ul());
-//       validVertices.push_back(rect.ur());
-//       validVertices.push_back(rect.lr());
-//       validVertices.push_back(rect.ll());
-//    }
-//    else
-//    {
-//       validVertices.push_back(rect.ul());
-//       validVertices.push_back(rect.ll());
-//       validVertices.push_back(rect.lr());
-//       validVertices.push_back(rect.ur());
-//    }
-}
-
-ossimIrect ossimTrimFilter::getBoundingRect(ossim_uint32 resLevel)const
-{
-
-   vector<ossimIpt> validVertices;
-   ossimIrect result;
-   result.makeNan();
-   getValidImageVertices(validVertices, OSSIM_CLOCKWISE_ORDER, resLevel);
-   
-   if(validVertices.size())
-   {
-      result = ossimIrect(validVertices);
-   }
-
-   return result;
-}
-
-void ossimTrimFilter::initialize()
-{
-   if(theInputConnection)
-   {
-      theCutter->disconnectMyInput(0, false, false);
-      if(getInput())
-      {
-         theCutter->connectMyInputTo(0, getInput());
-      }
-      theCutter->initialize();
-      getValidImageVertices(theValidVertices);
-      theCutter->setNumberOfPolygons(1);
-      theCutter->setPolygon(theValidVertices);
-   }
-}
-
-bool ossimTrimFilter::saveState(ossimKeywordlist& kwl,
-                                const char* prefix)const
-{
-   kwl.add(prefix,
-           "left_percent",
-           theLeftPercent,
-           true);
-   kwl.add(prefix,
-           "right_percent",
-           theRightPercent,
-           true);
-   kwl.add(prefix,
-           "top_percent",
-           theTopPercent,
-           true);
-   kwl.add(prefix,
-           "bottom_percent",
-           theBottomPercent,
-           true);
-
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimTrimFilter::loadState(const ossimKeywordlist& kwl,
-                                const char* prefix)
-{
-   const char* leftPerc   = kwl.find(prefix, "left_percent");
-   const char* rightPerc  = kwl.find(prefix, "right_percent");
-   const char* topPerc    = kwl.find(prefix, "top_percent");
-   const char* bottomPerc = kwl.find(prefix, "bottom_percent");
-
-   if(leftPerc)
-   {
-      theLeftPercent = ossimString(leftPerc).toDouble();
-   }
-   if(rightPerc)
-   {
-      theRightPercent = ossimString(rightPerc).toDouble();
-   }
-   if(topPerc)
-   {
-      theTopPercent = ossimString(topPerc).toDouble();
-   }
-   if(bottomPerc)
-   {
-      theBottomPercent = ossimString(bottomPerc).toDouble();
-   }
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-ossimRefPtr<ossimProperty> ossimTrimFilter::getProperty(const ossimString& name)const
-{
-   ossimProperty* prop = 0;
-   if(name == "left_percent")
-   {
-      prop = new ossimNumericProperty(name,
-                                      ossimString::toString(theLeftPercent),
-                                      0.0, 1.0);
-      prop->setFullRefreshBit();
-   }
-   else if(name == "right_percent")
-   {
-      prop = new ossimNumericProperty(name,
-                                      ossimString::toString(theRightPercent),
-                                      0.0, 1.0);
-      prop->setFullRefreshBit();
-   }
-   else if(name == "top_percent")
-   {
-      prop = new ossimNumericProperty(name,
-                                      ossimString::toString(theTopPercent),
-                                      0.0, 1.0);
-      prop->setFullRefreshBit();
-   }
-   else if(name == "bottom_percent")
-   {
-      prop = new ossimNumericProperty(name,
-                                      ossimString::toString(theBottomPercent),
-                                      0.0, 1.0);
-      prop->setFullRefreshBit();
-   }
-
-   if(prop) return prop;
-   
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimTrimFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid())return;
-   ossimString name = property->getName();
-   
-   if(name == "left_percent")
-   {
-      theLeftPercent = property->valueToString().toDouble();
-   }
-   else if(name == "right_percent")
-   {
-      theRightPercent = property->valueToString().toDouble();
-   }
-   else if(name == "top_percent")
-   {
-      theTopPercent = property->valueToString().toDouble();
-   }
-   else if(name == "bottom_percent")
-   {
-      theBottomPercent = property->valueToString().toDouble();
-   }
-   else
-   {
-      return ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-void ossimTrimFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back("left_percent");
-   propertyNames.push_back("right_percent");
-   propertyNames.push_back("top_percent");
-   propertyNames.push_back("bottom_percent");
-}
-
diff --git a/ossim/src/ossim/imaging/ossimTwoColorView.cpp b/ossim/src/ossim/imaging/ossimTwoColorView.cpp
deleted file mode 100644
index 5b1b7db..0000000
--- a/ossim/src/ossim/imaging/ossimTwoColorView.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-//-------------------------------------------------------------------
-// License: MIT
-//
-// Author:  Garrett Potts
-//
-//-------------------------------------------------------------------
-//  $Id$
-
-#include <ossim/imaging/ossimTwoColorView.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimTwoColorView,
-          "ossimTwoColorView" ,
-          ossimImageCombiner);
-
-ossimTwoColorView::ossimTwoColorView()
-   :
-   ossimImageCombiner(0, 2, 0, true, false) ,
-   m_byPassFlag(true),
-   m_nativeFlag(false),
-   m_newInput(0),
-   m_oldInput(0),
-   m_newInputBandIndex(0),
-   m_oldInputBandIndex(0),
-   m_redSource(ossimTwoColorView::OLD),
-   m_grnSource(ossimTwoColorView::NEW),
-   m_bluSource(ossimTwoColorView::NEW)
-{
-}
-
-ossim_uint32 ossimTwoColorView::getNumberOfOutputBands() const
-{
-   if(m_byPassFlag||!isSourceEnabled())
-   {
-      return ossimImageCombiner::getNumberOfOutputBands();
-   }
-   return 3;
-}
-
-ossimScalarType ossimTwoColorView::getOutputScalarType() const
-{
-   if(m_byPassFlag||!isSourceEnabled())
-   {
-      return ossimImageCombiner::getOutputScalarType();
-   }
-   return OSSIM_UINT8;
-}
-
-void ossimTwoColorView::setBandIndexMapping(
-   ossim_uint32 oldInputBandIndex,
-   ossim_uint32 newInputBandIndex,
-   ossimTwoColorMultiViewOutputSource redOutputSource,
-   ossimTwoColorMultiViewOutputSource grnOutputSource,
-   ossimTwoColorMultiViewOutputSource bluOutputSource)
-{
-   m_oldInputBandIndex = oldInputBandIndex;
-   m_newInputBandIndex = newInputBandIndex;
-   m_redSource = redOutputSource;
-   m_grnSource = grnOutputSource;
-   m_bluSource = bluOutputSource;
-}
-
-double ossimTwoColorView::getNullPixelValue(ossim_uint32 band)const
-{
-   if(m_byPassFlag||!isSourceEnabled())
-   {
-      return ossimImageCombiner::getNullPixelValue(band);
-   }
-   return 0;
-}
-
-double ossimTwoColorView::getMinPixelValue(ossim_uint32 band)const
-{
-   if(m_byPassFlag||!isSourceEnabled())
-   {
-      return ossimImageCombiner::getMinPixelValue(band);
-   }
-   return 1;
-}
-
-double ossimTwoColorView::getMaxPixelValue(ossim_uint32 band)const
-{
-   if(m_byPassFlag||!isSourceEnabled())
-   {
-      return ossimImageCombiner::getMaxPixelValue(band);
-   }
-   return 256;
-}
-
-ossimRefPtr<ossimImageData> ossimTwoColorView::getTile(const ossimIrect& rect,
-                                                       ossim_uint32 resLevel)
-{
-   ossim_uint32 tileIdx = 0;
-   if(m_byPassFlag||!isSourceEnabled())
-   {
-      return getNextTile(tileIdx, 0, rect, resLevel);
-   }
-   if(!m_twoColorTile.valid())
-   {
-      allocate();
-   }
-   if(!m_twoColorTile.valid())
-   {
-      return m_twoColorTile;
-   }
-   m_twoColorTile->setImageRectangle(rect);
-   m_twoColorTile->makeBlank();
-   
-   ossimRefPtr<ossimImageData> newData = m_newInput->getTile(rect, resLevel);
-   ossimRefPtr<ossimImageData> oldData = m_oldInput->getTile(rect, resLevel);
-
-   runAlgorithm(newData.get(), oldData.get());
-
-   m_twoColorTile->validate();
-
-   return m_twoColorTile;
-}
-void ossimTwoColorView::runAlgorithm(ossimImageData* newData, ossimImageData* oldData)
-{
-   if(m_nativeFlag)
-   {
-      runNative8(newData, oldData);
-   }
-   else 
-   {
-      runNorm(newData, oldData);
-   }
-}
-
-void ossimTwoColorView::runNative8(ossimImageData* newData, ossimImageData* oldData)
-{
-   if ( newData && oldData && m_twoColorTile.valid() &&
-        ( m_twoColorTile->getNumberOfBands() == 3 ) )
-   {
-      // old, new, red, green, blue buffers...
-      ossim_uint8* o = static_cast<ossim_uint8*>( oldData->getBuf(m_oldInputBandIndex) );
-      ossim_uint8* n = static_cast<ossim_uint8*>( newData->getBuf(m_newInputBandIndex) );
-      ossim_uint8* r = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(0) );
-      ossim_uint8* g = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(1) );
-      ossim_uint8* b = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(2) );
-
-      if ( o && n && r && g && b )
-      {
-         // Assuming null pix of 0 for 8 bit.
-         const ossim_uint8 MP = 1;
-         const ossim_uint8 NP = 0;
-
-         ossim_uint8 newPix = 0;
-         ossim_uint8 oldPix = 0;
-         
-         const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
-         
-         for(ossim_uint32 idx = 0; idx < MAX_IDX; ++idx)
-         {
-            if( ( *n == NP ) && ( *o == NP ) )
-            {
-               // Both inputs null, set all outputs null.
-               *r = NP;
-               *b = NP;
-               *g = NP;
-            }
-            else 
-            {
-               // At least one input is not null.
-               newPix = (*n != NP) ? *n : MP;
-               oldPix = (*o != NP) ? *o : MP;
-
-               // Set red, OLD is default so check first:
-               if ( m_redSource == ossimTwoColorView::OLD )
-               {
-                  *r = oldPix;
-               }
-               else if ( m_redSource == ossimTwoColorView::NEW )
-               {
-                  *r = newPix;
-               }
-               else
-               {
-                  *r = MP;
-               }
-
-               // Set green, NEW is default so check first:
-               if ( m_grnSource == ossimTwoColorView::NEW )
-               {
-                  *g = newPix;
-               }
-               else if ( m_grnSource == ossimTwoColorView::OLD )
-               {
-                  *g = oldPix;
-               }
-               else
-               {
-                  *g = MP;
-               }
-
-               // Set blue, NEW is default so check first:
-               if ( m_grnSource == ossimTwoColorView::NEW )
-               {
-                  *b = newPix;
-               }
-               else if ( m_grnSource == ossimTwoColorView::OLD )
-               {
-                  *b = oldPix;
-               }
-               else
-               {
-                  *b = MP;
-               }
-            }
-
-            // Next pixel:
-            ++n;
-            ++o;
-            ++r;
-            ++g;
-            ++b;
-         }
-      }
-   }
-}
-
-void ossimTwoColorView::runNorm(ossimImageData* newData, ossimImageData* oldData)
-{
-   if ( newData && oldData && m_twoColorTile.valid() &&
-        ( m_twoColorTile->getNumberOfBands() == 3 ) )
-   {
-      const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
-      
-      // Buffers for normalized oldData and newData tiles.
-      std::vector<ossim_float32> oldDataBuffer(MAX_IDX);
-      std::vector<ossim_float32> newDataBuffer(MAX_IDX);
-
-      // old and new input buffers.
-      ossim_float32* o = &oldDataBuffer.front();      
-      ossim_float32* n = &newDataBuffer.front();
-
-      // Normalize/copy to buffers.
-      newData->copyTileBandToNormalizedBuffer(m_newInputBandIndex, n);
-      oldData->copyTileBandToNormalizedBuffer(m_oldInputBandIndex, o);
-      
-      // Get the output buffers.
-      ossim_uint8* r = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(0) );
-      ossim_uint8* g = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(1) );
-      ossim_uint8* b = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(2) );
-
-      if ( o && n && r && g && b )
-      {
-         // Assuming null pix of 0 for 8 bit.
-         const ossim_uint8 MP = 1;
-         const ossim_uint8 NP = 0;
-
-         ossim_uint8   newPix = 0;
-         ossim_uint8   oldPix = 0;
-         ossim_float32 tmpPix = 0.0;
-         
-         const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
-         
-         for(ossim_uint32 idx = 0; idx < MAX_IDX; ++idx)
-         {
-            if( ( *n == NP ) && ( *o == NP ) )
-            {
-               // Both inputs null, set all outputs null.
-               *r = NP;
-               *b = NP;
-               *g = NP;
-            }
-            else 
-            {
-               // At least one input is not null.
-               
-               // Set the newPix:
-               if ( *n != NP )
-               {
-                  // Un-normalize:
-                  tmpPix = (*n) * 255.0;
-
-                  // Clamp to min/max.
-                  tmpPix = (tmpPix <= 255.0) ? ( (tmpPix >= 1.0) ? tmpPix : 1.0) : 255.0;
-
-                  // Copy
-                  newPix = static_cast<ossim_uint8>( tmpPix );
-               }
-               else
-               {
-                  newPix = MP;
-               }
-
-               // Set the oldPix:
-               if ( *o != NP )
-               {
-                  // Un-normalize:
-                  tmpPix = (*o) * 255.0;
-
-                  // Clamp to min/max.
-                  tmpPix = (tmpPix <= 255.0) ? ( (tmpPix >= 1.0) ? tmpPix : 1.0) : 255.0;
-
-                  // Copy
-                  oldPix = static_cast<ossim_uint8>( tmpPix );
-               }
-               else
-               {
-                  oldPix = MP;
-               }
-
-               // Set red, OLD is default so check first:
-               if ( m_redSource == ossimTwoColorView::OLD )
-               {
-                  *r = oldPix;
-               }
-               else if ( m_redSource == ossimTwoColorView::NEW )
-               {
-                  *r = newPix;
-               }
-               else
-               {
-                  *r = MP;
-               }
-
-               // Set green, NEW is default so check first:
-               if ( m_grnSource == ossimTwoColorView::NEW )
-               {
-                  *g = newPix;
-               }
-               else if ( m_grnSource == ossimTwoColorView::OLD )
-               {
-                  *g = oldPix;
-               }
-               else
-               {
-                  *g = MP;
-               }
-
-               // Set blue, NEW is default so check first:
-               if ( m_grnSource == ossimTwoColorView::NEW )
-               {
-                  *b = newPix;
-               }
-               else if ( m_grnSource == ossimTwoColorView::OLD )
-               {
-                  *b = oldPix;
-               }
-               else
-               {
-                  *b = MP;
-               }
-            }
-
-            // Next pixel:
-            ++n;
-            ++o;
-            ++r;
-            ++g;
-            ++b;
-         }
-      }
-   }
-}
-
-void ossimTwoColorView::allocate()
-{
-   m_twoColorTile = ossimImageDataFactory::instance()->create(this, this);
-   if(m_twoColorTile.valid())
-   {
-      m_twoColorTile->initialize();
-   }
-}
-
-
-void ossimTwoColorView::initialize()
-{
-   ossimImageCombiner::initialize();
-   m_newInput = 0;
-   m_oldInput = 0;
-   m_twoColorTile = 0;
-   m_nativeFlag = false;
-   m_byPassFlag = false;
-
-   if(getNumberOfInputs() < 2)
-   {
-      m_byPassFlag = true;
-   }
-   else 
-   {
-      m_oldInput = dynamic_cast<ossimImageSource*>( getInput(0) );
-      m_newInput = dynamic_cast<ossimImageSource*>( getInput(1) );
-
-      //---
-      // Range check band selection. This can be set from setBandIndexMapping method which
-      // does no error checking because inputs may not be set.
-      //----
-      if ( m_oldInput.valid() )
-      {
-         if ( m_oldInputBandIndex >= m_oldInput->getNumberOfOutputBands() )
-         {
-            m_oldInputBandIndex = 0;
-         }
-      }
-      
-      if ( m_newInput.valid() )
-      {
-         if ( m_newInputBandIndex >= m_newInput->getNumberOfOutputBands() )
-         {
-            m_newInputBandIndex = 0;
-         }
-      }
-         
-      if(!m_newInput||!m_oldInput)
-      {
-         m_byPassFlag = true;
-      }
-      else
-      {
-         if((m_newInput->getOutputScalarType() == OSSIM_UINT8)&&
-            (m_oldInput->getOutputScalarType() == OSSIM_UINT8))
-         {
-            m_nativeFlag = true;
-         }
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/imaging/ossimUsgsDemTileSource.cpp b/ossim/src/ossim/imaging/ossimUsgsDemTileSource.cpp
deleted file mode 100644
index b7b6235..0000000
--- a/ossim/src/ossim/imaging/ossimUsgsDemTileSource.cpp
+++ /dev/null
@@ -1,575 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Contains class declaration for ossimUsgsDemTileSource.
-//
-//********************************************************************
-// $Id: ossimUsgsDemTileSource.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <fstream>
-#include <ossim/imaging/ossimUsgsDemTileSource.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/support_data/ossimDemHeader.h>
-#include <ossim/support_data/ossimDemProfile.h>
-#include <ossim/support_data/ossimDemGrid.h>
-#include <ossim/support_data/ossimDemUtil.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/imaging/ossimImageGeometryRegistry.h>
-
-RTTI_DEF1(ossimUsgsDemTileSource, "ossimUsgsDemTileSource", ossimImageHandler)
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimUsgsDemTileSource:debug");
-
-static const char DEM_TYPE_KW[] = "dem_type";
-static const char USGS_DEM_KW[] = "usgs_dem";
-
-
-ossimUsgsDemTileSource::ossimUsgsDemTileSource()
-   :
-      ossimImageHandler(),
-      theDem(0),
-      theTile(0),
-      theNullValue(0.0),
-      theMinHeight(0.0),
-      theMaxHeight(0.0),
-      theFeetFlag(false),
-      theIsDemFlag(false),
-      theScalarType(OSSIM_SINT16)
-{
-   // Construction not complete.  Users should call "open" method.
-}
-
-ossimUsgsDemTileSource::~ossimUsgsDemTileSource()
-{
-   if (theDem)
-   {
-      delete theDem;
-      theDem = 0;
-   }
-   theTile = 0;
-}
-
-ossimRefPtr<ossimImageData> ossimUsgsDemTileSource::getTile(
-   const  ossimIrect& tile_rect, ossim_uint32 resLevel)
-{
-   if (theTile.valid())
-   {
-      // Image rectangle must be set prior to calling getTile.
-      theTile->setImageRectangle(tile_rect);
-      
-      if ( getTile( theTile.get(), resLevel ) == false )
-      {
-         if (theTile->getDataObjectStatus() != OSSIM_NULL)
-         {
-            theTile->makeBlank();
-         }
-      }
-   }
-   
-   return theTile;
-}
-
-bool ossimUsgsDemTileSource::getTile(ossimImageData* result,
-                                     ossim_uint32 resLevel)
-{
-   bool status = false;
-
-   //---
-   // Not open, this tile source bypassed, or invalid res level,
-   // return a blank tile.
-   //---
-   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
-       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
-   {
-      result->ref(); // Increment ref count.
-
-      //---
-      // Check for overview tile.  Some overviews can contain r0 so always
-      // call even if resLevel is 0.  Method returns true on success, false
-      // on error.
-      //---
-      status = getOverviewTile(resLevel, result);
-      
-      if (status) // From old code.  Not sure if still needed.
-      {
-         result->setMinPix(theTile->getMinPix(), theTile->getNumberOfBands());
-         result->setMaxPix(theTile->getMaxPix(), theTile->getNumberOfBands());
-         result->setNullPix(theTile->getNullPix(), theTile->getNumberOfBands());
-      }
-      
-      if (!status) // Did not get an overview tile.
-      {
-         status = true;
-         
-         ossimIrect tile_rect = result->getImageRectangle();
-         
-         ossimIrect image_rect = getImageRectangle(resLevel);
-         
-         //---
-         // See if any point of the requested tile is in the image.
-         //---
-         if ( tile_rect.intersects(image_rect) )
-         {
-            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
-            
-            if ( !tile_rect.completely_within(clip_rect) )
-            {
-               // Start with a blank tile.
-               result->makeBlank();
-            }
-            
-            // Load the tile buffer with data from the dem cell.
-            if (theScalarType == OSSIM_FLOAT32)
-            {
-               status = fillBuffer(ossim_float32(0.0),
-                                   tile_rect,
-                                   clip_rect,
-                                   result);
-            }
-            else
-            {
-               status = fillBuffer(ossim_sint16(0),
-                                   tile_rect,
-                                   clip_rect,
-                                   result);
-            }
-            if (status == true)
-            {
-               result->validate();
-            }
-         }    
-         else // No intersection:  if ( tile_rect.intersects(image_rect) )
-         {
-            result->makeBlank();
-         }
-      }
-
-      result->unref(); // Decrement ref count.
-   }
-
-   return status;
-}
-
-//*******************************************************************
-// Private Method:
-//*******************************************************************
-template <class T>
-bool ossimUsgsDemTileSource::fillBuffer(T,
-                                        const ossimIrect& tile_rect,
-                                        const ossimIrect& clip_rect,
-                                        ossimImageData* tile)
-{
-   const uint32 TILE_WIDTH = tile->getWidth();
-
-   T* d = static_cast<T*>(tile->getBuf());
-   
-   ossim_float32 spatialResZ = theDem->getHeader().getSpatialResZ();
-   if (spatialResZ == 0.0) spatialResZ = 1.0;
-
-   // Compute the starting offset.
-   uint32 offset = (clip_rect.ul().y - tile_rect.ul().y) * TILE_WIDTH +
-                   clip_rect.ul().x - tile_rect.ul().x;
-
-   for (int32 line = clip_rect.ul().y; line <= clip_rect.lr().y; ++line)
-   {
-      // Loop in the longitude or sample direction.
-      int samp_offset = 0;
-      for (int32 samp = clip_rect.ul().x; samp <= clip_rect.lr().x; ++samp)
-      {
-         ossim_float32 p = theDem->getElevation(samp, line);
-         if (p != theNullValue)
-         {
-            p *= spatialResZ;
-            if (theFeetFlag) p = p * MTRS_PER_FT;
-         }
-         d[offset + samp_offset] = static_cast<T>(p);
-         ++samp_offset;
-      }
-      offset += TILE_WIDTH;
-   }
-
-   return true;
-}
-
-ossimIrect
-ossimUsgsDemTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
-{
-   return ossimIrect(0,
-                     0,
-                     getNumberOfSamples(reduced_res_level) - 1,
-                     getNumberOfLines(reduced_res_level)   - 1);
-}
-
-bool ossimUsgsDemTileSource::open()
-{
-   static const char MODULE[] = "ossimUsgsDemTileSource::open";
-
-   if (traceDebug())
-   {
-      CLOG << "DEBUG:"
-           << "\nAttempting to parse file:  " << theImageFile.c_str()
-           << std::endl;
-   }
-
-   theIsDemFlag = ossimDemUtil::isUsgsDem(theImageFile);
-
-   if (theIsDemFlag)
-   {
-      // Open up the file for reading.
-      std::ifstream is(theImageFile.c_str(),
-                       std::ios_base::in | std::ios_base::binary);
-      if (is.good())
-      {
-         // Start out with a fresh dem.
-         if (theDem) delete theDem;
-         
-         //---
-         // Set the null to -32768.  This will also be the missing data values.
-         //---
-         theNullValue = OSSIM_DEFAULT_NULL_PIX_SINT16;
-         
-         //---
-         // Read the dem.
-         // 
-         // NOTE:  This defines the missing data value.  It should be the
-         // same as null for mosaicing and min/max calculations.
-         //---
-         theDem = new ossimDemGrid(theNullValue);
-         theDem->read(is);
-         
-         is.close();
-      }
-      else
-      {
-         theIsDemFlag = false;
-      }
-   }
-   
-   if (theIsDemFlag)
-   {
-      theFeetFlag  = (theDem->getHeader().getElevationUnits() == 1) ?
-         true : false;
-      
-      theMinHeight = theFeetFlag ? theDem->getHeader().getMinimumElev() *
-         MTRS_PER_FT : theDem->getHeader().getMinimumElev();
-      theMaxHeight = theFeetFlag ? theDem->getHeader().getMaximumElev() *
-         MTRS_PER_FT : theDem->getHeader().getMaximumElev();
-      
-      completeOpen();
-      
-      //---
-      // Set up the tiles.  Note the blank tile will not get initialized to
-      // save memory.  This includes setting the min and max pixel value
-      // gathered from the statistics.
-      //---
-      theTile = ossimImageDataFactory::instance()->create(this, this);
-      theTile->initialize();
-      
-      if (traceDebug())
-      {
-         CLOG << setiosflags(ios::fixed) << setprecision(5) << "DEBUG:"
-              << "\nNull pix:  " << (theTile->getNullPix(0))
-              << "\nMin  pix:  " << (theTile->getMinPix(0))
-              << "\nMax  pix:  " << (theTile->getMaxPix(0))
-              << "\nlines:     " << theDem->getHeight()
-              << "\nsamples:   " << theDem->getWidth()
-              << std::endl;
-      }
-   }
-
-   return theIsDemFlag;
-}
-
-bool ossimUsgsDemTileSource::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix) const
-{
-   // Save of the dem type keyword.
-   kwl.add(prefix, DEM_TYPE_KW, USGS_DEM_KW, true);
-
-   // Save the scalar type.
-   kwl.add(prefix,
-           ossimKeywordNames::SCALAR_TYPE_KW,
-           ossimScalarTypeLut::instance()->getEntryString(theScalarType));
-   
-   return ossimImageHandler::saveState(kwl, prefix);
-}
-
-bool ossimUsgsDemTileSource::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   if (ossimImageHandler::loadState(kwl, prefix))
-   {
-      //***
-      // Look for "dem_type: usgs_dem" key value pair.
-      // Note:  If not in the keyword list the "open" will look for it on
-      //        disk.
-      //***
-      const char* lookup = kwl.find(prefix, DEM_TYPE_KW);
-      if (lookup)
-      {
-         ossimString s = lookup;
-         s.downcase();
-         if (s == USGS_DEM_KW) theIsDemFlag = true;
-      }
-
-      //---
-      // Look for scalar type override.
-      //
-      // Note: We only allow float or signed 16 bit.
-      //---
-      lookup = kwl.find(prefix, ossimKeywordNames::SCALAR_TYPE_KW);
-      if (lookup)
-      {
-         ossimScalarType st =
-            static_cast<ossimScalarType>(ossimScalarTypeLut::instance()->
-                                         getEntryNumber(lookup));
-         if ( (st == OSSIM_FLOAT32) || (st == OSSIM_SINT16))
-         {
-            theScalarType = st;
-         }
-         else
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimUsgsDemTileSource::loadState WARNING:"
-                  << "\nInvalid scalar type: "
-                  << ossimScalarTypeLut::instance()->
-                  getEntryString(st)
-                  << std::endl;
-            }
-         }
-      }
-
-      if (open())
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimUsgsDemTileSource::getImageGeometry()
-{
-   if ( !theGeometry )
-   {
-      // Check for external geom:
-      theGeometry = getExternalImageGeometry();
-
-      if ( !theGeometry )
-      {
-         // Check the internal geometry first to avoid a factory call.
-         theGeometry = getInternalImageGeometry();
-
-         // At this point it is assured theGeometry is set.
-
-         //---
-         // WARNING:
-         // Must create/set theGeometry at this point or the next call to
-         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
-         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
-         //---         
-
-         // Check for set projection.
-         if ( !theGeometry->getProjection() )
-         {
-            // Try factories for projection.
-            ossimImageGeometryRegistry::instance()->extendGeometry(this);
-         }
-      }
-
-      // Set image things the geometry object should know about.
-      initImageParameters( theGeometry.get() );
-   }
-
-   return theGeometry;
-}
-
-
-ossimRefPtr<ossimImageGeometry> ossimUsgsDemTileSource::getInternalImageGeometry() const
-{
-   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
-   
-   if (theDem)
-   {
-      const ossimDemHeader HDR = theDem->getHeader();
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:"
-            << "\nDEM Header:"
-            << std::endl;
-         HDR.print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-      
-      // The DEM's image geometry is a map projection, obtained here via KWL:
-      ossimKeywordlist proj_kwl;
-      if ( HDR.getImageGeometry(proj_kwl) ) 
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:"
-               << "keyword list:\n" << proj_kwl
-               << std::endl;
-         }
-         
-         // Capture for next time.
-         ossimRefPtr<ossimProjection> proj =
-            ossimProjectionFactoryRegistry::instance()->
-            createProjection(proj_kwl);
-         if ( proj.valid() )
-         {
-            geom->setProjection(proj.get());
-         }
-      }
-   }
-   
-   return geom;
-}
-
-ossimScalarType ossimUsgsDemTileSource::getOutputScalarType() const
-{
-   return theScalarType;
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getTileWidth() const
-{
-   return ( theTile.valid() ? theTile->getWidth() : 0 );
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getTileHeight() const
-{
-   return ( theTile.valid() ? theTile->getHeight() : 0 );
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      if (theDem)
-      {
-         return theDem->getHeight();
-      }
-      else
-      {
-         cerr << "ossimUsgsDemTileSource::getNumberOfLines ERROR:"
-              << "\nNot initialized!" << std::endl;
-         return 0;
-      }
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfLines(reduced_res_level);
-   }
-
-   return 0;
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
-{
-   if (reduced_res_level == 0)
-   {
-      if (theDem)
-      {
-         return theDem->getWidth();
-      }
-      else
-      {
-         cerr << "ossimUsgsDemTileSource::getNumberOfSamples ERROR:"
-              << "\nNot initialized!" << std::endl;
-         return 0;
-      }
-   }
-   else if (theOverview.valid())
-   {
-      return theOverview->getNumberOfSamples(reduced_res_level);
-   }
-
-   return 0;
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getImageTileWidth() const
-{
-   return 0;
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getImageTileHeight() const
-{
-   return 0;
-}
-
-ossimString ossimUsgsDemTileSource::getShortName() const
-{
-   return ossimString("usgs dem");
-}
-
-ossimString ossimUsgsDemTileSource::getLongName() const
-{
-   return ossimString("usgs dem reader");
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getNumberOfInputBands() const
-{
-   return 1;
-}
-
-ossim_uint32 ossimUsgsDemTileSource::getNumberOfOutputBands()const
-{
-   return 1;
-}
-
-double ossimUsgsDemTileSource::getNullPixelValue(ossim_uint32 /* band */)const 
-{
-   return theNullValue;
-}
-
-double ossimUsgsDemTileSource::getMinPixelValue(ossim_uint32 band)const 
-{
-   if(band < theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getMinPix(band);
-   }
-   return theMinHeight; 
-}
-
-double ossimUsgsDemTileSource::getMaxPixelValue(ossim_uint32 band)const 
-{
-   if(theMetaData.getNumberOfBands())
-   {
-      return theMetaData.getMaxPix(band);
-   }
-   return theMaxHeight; 
-}
-
-bool ossimUsgsDemTileSource::isOpen()const
-{
-   return (theDem ? true : false );
-}
-
-const ossimUsgsDemTileSource& ossimUsgsDemTileSource::operator=(const  ossimUsgsDemTileSource& rhs)
-{
-   return rhs;
-} 
-
-ossimUsgsDemTileSource::ossimUsgsDemTileSource(const ossimUsgsDemTileSource&)
-{
-}
-
diff --git a/ossim/src/ossim/imaging/ossimValueAssignImageSourceFilter.cpp b/ossim/src/ossim/imaging/ossimValueAssignImageSourceFilter.cpp
deleted file mode 100644
index 7f0c6e8..0000000
--- a/ossim/src/ossim/imaging/ossimValueAssignImageSourceFilter.cpp
+++ /dev/null
@@ -1,378 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimValueAssignImageSourceFilter.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/imaging/ossimValueAssignImageSourceFilter.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-RTTI_DEF1(ossimValueAssignImageSourceFilter,
-          "ossimValueAssignImageSourceFilter",
-          ossimImageSourceFilter);
-
-ossimValueAssignImageSourceFilter::ossimValueAssignImageSourceFilter(ossimObject* owner)
-   :ossimImageSourceFilter(owner),
-    theAssignType(ossimValueAssignType_GROUP),
-    theTile(NULL)
-{
-}
-
-ossimValueAssignImageSourceFilter::~ossimValueAssignImageSourceFilter()
-{
-}
-
-ossimRefPtr<ossimImageData> ossimValueAssignImageSourceFilter::getTile(
-   const ossimIrect& tileRect,
-   ossim_uint32 resLevel)
-{
-   if(!theInputConnection)
-   {
-      return NULL;  // This filter requires an input.
-   }
-   
-   ossimRefPtr<ossimImageData> inputTile =
-      theInputConnection->getTile(tileRect, resLevel);
-   
-   if(!isSourceEnabled() || !inputTile.valid())
-   {
-      return inputTile;
-   }
-
-   if(!theTile.valid())
-   {
-      allocate(); // First time through...
-   }
-   
-   if (!theTile.valid()) // throw exeption...
-   {
-      return inputTile;
-   }
-
-   // Set the origin, resize if needed of the output tile.
-   theTile->setImageRectangle(tileRect);
-
-   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
-       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
-   {
-      theTile->makeBlank();
-      return theTile;
-   }
-
-   if(!inputTile->getBuf())
-   {
-      theTile->makeBlank();
-   }
-   else
-   {
-      theTile->loadTile(inputTile.get());
-   }
-
-   switch(inputTile->getScalarType())
-   {
-      case OSSIM_UCHAR:
-      {
-         executeAssign(static_cast<ossim_uint8>(0),
-                       theTile);
-         break;
-      }
-      case OSSIM_FLOAT: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         executeAssign(static_cast<float>(0),
-                       theTile);
-         break;
-      }
-      case OSSIM_USHORT16:
-      case OSSIM_USHORT11:
-      {
-         executeAssign(static_cast<ossim_uint16>(0),
-                       theTile);
-         break;
-      }
-      case OSSIM_SSHORT16:
-      {
-         executeAssign(static_cast<ossim_sint16>(0),
-                       theTile);
-         break;
-      }
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         executeAssign(static_cast<double>(0),
-                       theTile);
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimValueAssignImageSourceFilter::getTile WARN: Scalar type = " << theTile->getScalarType()
-                                            << " Not supported!" << std::endl;
-         break;
-      }
-   }
-
-   theTile->validate();
-   
-   return theTile;
-}
-
-void ossimValueAssignImageSourceFilter::setInputOutputValues(const vector<double>& inputValues,
-                                                             const vector<double>& outputValues)
-{
-   theInputValueArray  = inputValues;
-   theOutputValueArray = outputValues;
-
-   validateArrays();
-}
-
-void ossimValueAssignImageSourceFilter::validateArrays()
-{
-   if(theOutputValueArray.size() != theInputValueArray.size())
-   {
-      ossim_uint32 index = std::min((ossim_uint32)theOutputValueArray.size(),
-                                    (ossim_uint32)theInputValueArray.size());
-      
-      vector<double> copyVector(theOutputValueArray.begin(),
-                                theOutputValueArray.begin() + index);
-
-      theOutputValueArray = copyVector;
-
-      for(ossim_uint32 index2 = index; index < theInputValueArray.size(); ++index)
-      {
-         theOutputValueArray.push_back(theInputValueArray[index2]);
-      }
-   }
-}
-
-template <class T> void ossimValueAssignImageSourceFilter::executeAssign(
-   T,
-   ossimRefPtr<ossimImageData>& data)
-{
-   if(!theInputValueArray.size()) return;
-   
-   if(theAssignType == ossimValueAssignType_SEPARATE)
-   {
-      executeAssignSeparate(static_cast<T>(0), data);
-   }
-   else
-   {
-      executeAssignGroup(static_cast<T>(0), data);      
-   }
-}
-
-template <class T> void ossimValueAssignImageSourceFilter::executeAssignSeparate(
-   T,
-   ossimRefPtr<ossimImageData>& data)
-{
-   ossim_uint32 numberOfBands = std::min((ossim_uint32)data->getNumberOfBands(),
-                                         (ossim_uint32)theInputValueArray.size());
-   ossim_uint32 maxOffset     = data->getWidth()*data->getHeight();
-   
-   for(ossim_uint32 band = 0; band<numberOfBands; ++band)
-   {
-      T* buf      = static_cast<T*>(data->getBuf(band));
-      T  inValue  = static_cast<T>(theInputValueArray[band]);
-      T  outValue = static_cast<T>(theOutputValueArray[band]);
-      for(ossim_uint32 count = 0; count < maxOffset; ++count)
-      {
-         if(*buf == inValue)
-         {
-            *buf = outValue;
-         }
-         ++buf;
-      }
-   }
-}
-
-template <class T> void ossimValueAssignImageSourceFilter::executeAssignGroup(
-   T,
-   ossimRefPtr<ossimImageData>& data)
-{
-   ossim_uint32 numberOfBands = std::min((ossim_uint32)data->getNumberOfBands(),
-                                         (ossim_uint32)theInputValueArray.size());
-   ossim_uint32 maxOffset     = data->getWidth()*data->getHeight();
-   ossim_uint32 band = 0;
-   bool equalFlag = false;
-
-   T** bufArray = new T*[data->getNumberOfBands()];
-   for(band = 0; band < data->getNumberOfBands(); ++band)
-   {
-      bufArray[band] = static_cast<T*>(data->getBuf(band));
-   }
-   
-   for(ossim_uint32 offset = 0; offset < maxOffset; ++offset)
-   {
-      equalFlag = true;
-      
-      for(band = 0; band<numberOfBands; ++band)
-      {
-         if(bufArray[band][offset] != theInputValueArray[band])
-         {
-            equalFlag = false;
-         }
-      }
-      if(equalFlag)
-      {
-         for(band = 0; band<numberOfBands; ++band)
-         {
-            bufArray[band][offset] = static_cast<T>(theOutputValueArray[band]);
-         }
-      }
-   }
-
-   delete [] bufArray;
-}
-
-void ossimValueAssignImageSourceFilter::initialize()
-{
-   // Base class will recapture "theInputConnection".
-   ossimImageSourceFilter::initialize();
-}
-
-void ossimValueAssignImageSourceFilter::allocate()
-{   
-   theTile = NULL;
-
-   if(theInputConnection)
-   {
-      ossimImageDataFactory* idf = ossimImageDataFactory::instance();
-      
-      theTile = idf->create(this,
-                            this);
-      
-      theTile->initialize();
-   }
-}
-
-bool ossimValueAssignImageSourceFilter::saveState(ossimKeywordlist& kwl,
-                                                  const char* prefix)const
-{
-   ossim_uint32 index = 0;
-   for(index =0; index < theInputValueArray.size(); ++index)
-   {
-      ossimString in  = ("input_band" + ossimString::toString(index));
-      ossimString out = ("output_band" + ossimString::toString(index));
-
-      kwl.add(prefix,
-              in.c_str(),
-              theInputValueArray[index],
-              true);
-      kwl.add(prefix,
-              out.c_str(),
-              theOutputValueArray[index],
-              true);
-   }
-   if(theAssignType ==  ossimValueAssignType_SEPARATE)
-   {
-      kwl.add(prefix,
-              "assign_type",
-              "separate",
-              true);
-   }
-   else
-   {
-      kwl.add(prefix,
-              "assign_type",
-              "group",
-              true);
-   }
-           
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-/*!
- * Method to the load (recreate) the state of an object from a keyword
- * list.  Return true if ok or false on error.
- */
-bool ossimValueAssignImageSourceFilter::loadState(const ossimKeywordlist& kwl,
-                                                  const char* prefix)
-{
-   
-   ossimString inRegExpression =  ossimString("^(") +
-                                  ossimString(prefix) +
-                                  "input_band[0-9]+)";
-   ossimString outRegExpression =  ossimString("^(") +
-                                   ossimString(prefix) +
-                                   "output_band[0-9]+)";
-   ossim_uint32 numberOfInputs  = kwl.getNumberOfSubstringKeys(inRegExpression);
-   ossim_uint32 numberOfOutputs = kwl.getNumberOfSubstringKeys(outRegExpression);
-   ossim_uint32 index = 0;
-   ossim_uint32 currentIndex = 0;
-   
-   theInputValueArray.clear();
-   theOutputValueArray.clear();
-
-   while(index < numberOfInputs)
-   {
-      const char* value = kwl.find(prefix,
-                                   (ossimString("input_band") +
-                                    ossimString::toString(currentIndex)).c_str()
-                                   );
-      if(value)
-      {
-         theInputValueArray.push_back(ossimString(value).toDouble());
-         ++index;
-      }
-      ++currentIndex;
-   }
-   index = 0;
-   currentIndex = 0;
-   while(index < numberOfOutputs)
-   {
-      const char* value = kwl.find(prefix,
-                                   (ossimString("output_band") +
-                                    ossimString::toString(currentIndex)).c_str()
-                                   );
-      if(value)
-      {
-         theOutputValueArray.push_back(ossimString(value).toDouble());
-         ++index;
-      }
-      ++currentIndex;
-   }
-   validateArrays();
-   
-   const char* assignType = kwl.find(prefix, "assign_type");
-   if(assignType)
-   {
-      if(ossimString(assignType).trim().downcase() == "separate")
-      {
-         theAssignType = ossimValueAssignType_SEPARATE;
-      }
-      else
-      {
-         theAssignType = ossimValueAssignType_GROUP;
-      }
-   }
-   else
-   {
-      theAssignType = ossimValueAssignType_GROUP;
-   }
-   
-   return ossimImageSourceFilter::loadState(kwl, prefix);
-}
-
-const vector<double>& ossimValueAssignImageSourceFilter::getInputValues()const
-{
-   return theInputValueArray;
-}
-const vector<double>& ossimValueAssignImageSourceFilter::getOutputValues()const
-{
-   return theOutputValueArray;
-}
-
-ossimValueAssignImageSourceFilter::ossimValueAssignType ossimValueAssignImageSourceFilter::getValueAssignType()const
-{
-   return theAssignType;
-}
-void ossimValueAssignImageSourceFilter::setValueAssignType(ossimValueAssignType type)
-{
-   theAssignType = type;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimVpfAnnotationCoverageInfo.cpp b/ossim/src/ossim/imaging/ossimVpfAnnotationCoverageInfo.cpp
deleted file mode 100644
index 7036ea8..0000000
--- a/ossim/src/ossim/imaging/ossimVpfAnnotationCoverageInfo.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-//*************************************************************************
-// Copyright (C) 2004 Intelligence Data Systems, Inc.  All rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//**************************************************************************
-// $Id: ossimVpfAnnotationCoverageInfo.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <vector>
-#include <algorithm>
-#include <ossim/imaging/ossimVpfAnnotationCoverageInfo.h>
-#include <ossim/vec/ossimVpfLibrary.h>
-#include <ossim/vec/ossimVpfFeatureClassSchema.h>
-
-bool ossimVpfAnnotationCoverageInfo::hasRenderableFeature()const
-{
-  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
-  {
-     if(theFeatureInfoArray[idx]->getEnabledFlag())
-     {
-        return true;
-     }
-  }
-
-  return false;
-}
-
-void ossimVpfAnnotationCoverageInfo::getEnabledFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result)
-{
-  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
-    {
-      if(theFeatureInfoArray[idx]->getEnabledFlag())
-	{
-	  result.push_back(theFeatureInfoArray[idx]);
-	}
-    }
-}
-
-void ossimVpfAnnotationCoverageInfo::getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result)
-{
-  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
-  {
-     result.push_back(theFeatureInfoArray[idx]);
-  }
-}
-
-ossimIrect ossimVpfAnnotationCoverageInfo::getBoundingProjectedRect()const
-{
-  ossimIrect result;
-  result.makeNan();
-
-  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
-    {
-      ossimIrect tempRect = theFeatureInfoArray[idx]->getBoundingProjectedRect();
-      if(!tempRect.hasNans())
-	{
-	  if(result.hasNans())
-	    {
-	      result = tempRect;
-	    }
-	  else
-	    {
-	      result = result.combine(tempRect);
-	    }
-	}
-    }
-
-  return result;
-}
-
-
-void ossimVpfAnnotationCoverageInfo::transform(ossimImageGeometry* geom)
-{
-  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
-  {
-     theFeatureInfoArray[idx]->transform(geom);
-  }
-}
-
-void ossimVpfAnnotationCoverageInfo::buildCoverage()
-{
-   buildCoverage( "" );
-}
-
-void ossimVpfAnnotationCoverageInfo::buildCoverage(const ossimString& feature)
-{
-   deleteAllFeatures();
-   if(theLibrary)
-   {
-      ossimVpfCoverage coverage;
-      
-      if(theLibrary->getCoverage(theName, coverage))
-      {
-         ossimVpfFeatureClassSchema schema;
-         if(coverage.openFeatureClassSchema(schema))
-         {
-            std::vector<ossimString> featureClassArray;
-            schema.getFeatureClasses(featureClassArray);
-            schema.closeTable();
-            for(ossim_uint32  idx = 0; idx < featureClassArray.size(); ++idx)
-            {
-               ossimString s1 = feature;
-               ossimString s2 = featureClassArray[idx];
-               s1.downcase();
-               s2.downcase();
-               if (! feature.length() || (s1 == s2) )
-               {
-                  ossimVpfAnnotationFeatureInfo* featureInfo =
-                     new ossimVpfAnnotationFeatureInfo;
-                  featureInfo->setName(featureClassArray[idx]);
-                  featureInfo->setCoverage(coverage);
-                  theFeatureInfoArray.push_back(featureInfo);
-                  featureInfo->buildFeature();
-               }
-            }
-         }
-      }
-   }
-}
-
-void ossimVpfAnnotationCoverageInfo::drawAnnotations(ossimRgbImage* tile)
-{
-   for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
-   {
-      if(theFeatureInfoArray[idx]->getEnabledFlag())
-      {
-         theFeatureInfoArray[idx]->drawAnnotations(tile);
-      }
-   }
-}
-
-void ossimVpfAnnotationCoverageInfo::deleteAllFeatures()
-{
-   for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
-   {
-      theFeatureInfoArray[idx];
-   }
-   
-   theFeatureInfoArray.clear();
-}
-
-
-
-bool ossimVpfAnnotationCoverageInfo::saveState(ossimKeywordlist& kwl,
-					       const char* prefix)const
-{
-   kwl.add(prefix,
-           "name",
-           theName,
-           true);
-   
-   for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size(); ++idx)
-   {
-      theFeatureInfoArray[idx]->saveState(kwl,
-					  (ossimString(prefix) + "feature" +
-					   ossimString::toString(idx) + ".").c_str());
-   }
-   
-   return true;
-}
-
-bool ossimVpfAnnotationCoverageInfo::loadState(const ossimKeywordlist& kwl,
-					       const char* prefix)
-{
-  deleteAllFeatures();
-
-  if(!theLibrary)
-    {
-      return false;
-    }
-
-  theName = kwl.find(prefix, "name");
-  ossimVpfCoverage coverage;
-
-  if(theLibrary->getCoverage(theName, coverage))
-    {
-      ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "feature[0-9]+.)";
-      vector<ossimString> keys =
-	kwl.getSubstringKeyList( regExpression );
-      std::vector<int> theNumberList(keys.size());
-      int offset = (int)(ossimString(prefix)+"feature").size();
-      int idx = 0;
-      for(idx = 0; idx < (int)theNumberList.size();++idx)
-	{
-	  ossimString numberStr(keys[idx].begin() + offset,
-				keys[idx].end());
-	  theNumberList[idx] = numberStr.toInt();
-	}
-      std::sort(theNumberList.begin(), theNumberList.end());
-      
-      for(idx=0;idx < (int)keys.size();++idx)
-	{
-	  ossimString newPrefix = ossimString(prefix);
-	  newPrefix += ossimString("feature");
-	  newPrefix += ossimString::toString(theNumberList[idx]);
-	  newPrefix += ossimString(".");
-	  ossimVpfAnnotationFeatureInfo* featureInfo = new ossimVpfAnnotationFeatureInfo;
-	  featureInfo->setCoverage(coverage);
-	  theFeatureInfoArray.push_back(featureInfo);
-	  if(!featureInfo->loadState(kwl,
-				     newPrefix))
-	    {
-	      return false;
-	    }
-	}
-    }
-  else
-    {
-      return false;
-    }
-
-  return true;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimVpfAnnotationLibraryInfo.cpp b/ossim/src/ossim/imaging/ossimVpfAnnotationLibraryInfo.cpp
deleted file mode 100644
index 930fff5..0000000
--- a/ossim/src/ossim/imaging/ossimVpfAnnotationLibraryInfo.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-//*************************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-//**************************************************************************
-// $Id: ossimVpfAnnotationLibraryInfo.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <algorithm>
-
-#include <ossim/imaging/ossimVpfAnnotationLibraryInfo.h>
-#include <ossim/imaging/ossimVpfAnnotationFeatureInfo.h>
-#include <ossim/vec/ossimVpfLibrary.h>
-#include <ossim/vec/ossimVpfDatabase.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug("ossimVpfAnnotationLibraryInfo:debug");
-
-
-ossimVpfAnnotationLibraryInfo::ossimVpfAnnotationLibraryInfo(const ossimString& libraryName, bool enabledFlag)
-   :
-      theName(libraryName),
-      theEnabledFlag(enabledFlag),
-      theDatabase(NULL)
-{
-}
-
-ossimVpfAnnotationLibraryInfo::~ossimVpfAnnotationLibraryInfo()
-{
-   deleteAllCoverage();
-}
-
-bool ossimVpfAnnotationLibraryInfo::getEnabledFlag()const
-{
-   return theEnabledFlag;
-}
-
-void ossimVpfAnnotationLibraryInfo::setEnabledFlag(bool flag)
-{
-   theEnabledFlag = flag;
-}
-
-const ossimString& ossimVpfAnnotationLibraryInfo::getName()const
-{
-   return theName;
-}
-
-void ossimVpfAnnotationLibraryInfo::setName(const ossimString& libraryName)
-{
-   theName = libraryName;
-}
-
-void ossimVpfAnnotationLibraryInfo::setDatabase(ossimVpfDatabase* database)
-{
-   theDatabase = database;
-}
-
-ossimVpfDatabase* ossimVpfAnnotationLibraryInfo::getDatabase()
-{
-   return theDatabase;
-}
-
-ossimIrect ossimVpfAnnotationLibraryInfo::getBoundingProjectedRect()const
-{
-   ossimIrect result;
-   result.makeNan();
-   
-   for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
-   {
-      ossimIrect tempRect = theCoverageLayerList[idx]->getBoundingProjectedRect();
-      if(!tempRect.hasNans())
-      {
-         if(result.hasNans())
-         {
-            result = tempRect;
-         }
-         else
-         {
-            result = result.combine(tempRect);
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimVpfAnnotationLibraryInfo::getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& features)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::getAllFeatures DEBUG: entered..." << std::endl;
-   }
-   
-   for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
-   {
-      theCoverageLayerList[idx]->getAllFeatures(features);
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::getAllFeatures DEBUG: leaving..." << std::endl;
-   }
-}
-
-void ossimVpfAnnotationLibraryInfo::transform(ossimImageGeometry* geom)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::transform DEBUG: entered..." << std::endl;
-   }
-   
-   
-   for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "transforming coverage = " << theCoverageLayerList[idx]->getName() << std::endl;
-      }
-      
-      theCoverageLayerList[idx]->transform(geom);
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::transform DEBUG: leaving..." << std::endl;
-   }
-}
-
-void ossimVpfAnnotationLibraryInfo::buildLibrary()
-{
-   buildLibrary( "", "");
-}
-
-void ossimVpfAnnotationLibraryInfo::buildLibrary(const ossimString& coverageName, const ossimString& feature)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::buildLibrary DEBUG: entered..." << std::endl;
-   }
-   deleteAllCoverage();
-   if(!theDatabase)
-   {
-      return;
-   }
-   
-   ossimVpfLibrary* library = theDatabase->getLibrary(theName);
-   if(library)
-   {
-      std::vector<ossimString> coverageNames;
-      library->getCoverageNames(coverageNames);
-      for(ossim_uint32 idx = 0; idx < coverageNames.size(); ++idx)
-      {
-         ossimString s1 = coverageName;
-         ossimString s2 = coverageNames[idx];
-         s1.downcase();
-         s2.downcase();
-         if ( ! coverageName.length() || (s1 == s2) )
-         {
-            ossimVpfAnnotationCoverageInfo* coverageInfo =
-               new ossimVpfAnnotationCoverageInfo;
-            coverageInfo->setName(coverageNames[idx]);
-            coverageInfo->setLibrary(library);
-            theCoverageLayerList.push_back(coverageInfo);
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG) << "coverage name = " << coverageNames[idx] << std::endl;
-            }
-            coverageInfo->buildCoverage(feature);
-         }
-      }
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::buildLibrary DEBUG: leaving..." << std::endl;
-   }
-}
-
-
-void ossimVpfAnnotationLibraryInfo::drawAnnotations(ossimRgbImage* tile)
-{
-  for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
-    {
-      theCoverageLayerList[idx]->drawAnnotations(tile);
-    }
-}
-
-void ossimVpfAnnotationLibraryInfo::deleteAllCoverage()
-{
-  for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
-    {
-      delete theCoverageLayerList[idx];
-    }
-
-  theCoverageLayerList.clear();
-}
-
-bool ossimVpfAnnotationLibraryInfo::saveState(ossimKeywordlist& kwl,
-					      const char* prefix)const
-{
-   ossim_uint32 idx;
-   
-   kwl.add(prefix,
-           "name",
-           theName,
-           true);
-   
-   for(idx = 0; idx < theCoverageLayerList.size(); ++idx)
-   {
-      theCoverageLayerList[idx]->saveState(kwl,
-					   (ossimString(prefix) + "coverage" + ossimString::toString(idx) + ".").c_str());
-   }
-   
-   return true;
-}
-
-bool ossimVpfAnnotationLibraryInfo::loadState(const ossimKeywordlist& kwl,
-					      const char* prefix)
-{
-  deleteAllCoverage();
-  theName = kwl.find(prefix, "name");
-  
-  ossimVpfLibrary* library = theDatabase->getLibrary(theName);
-
-  if(!library)
-    {
-      return false;
-    }
-  ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "coverage[0-9]+.)";
-  vector<ossimString> keys =
-    kwl.getSubstringKeyList( regExpression );
-  std::vector<int> theNumberList(keys.size());
-  int offset = (int)(ossimString(prefix)+"coverage").size();
-  int idx = 0;
-  for(idx = 0; idx < (int)theNumberList.size();++idx)
-    {
-      ossimString numberStr(keys[idx].begin() + offset,
-			    keys[idx].end());
-      theNumberList[idx] = numberStr.toInt();
-    }
-  std::sort(theNumberList.begin(), theNumberList.end());
-  
-  for(idx = 0; idx < (int)keys.size(); ++idx)
-    {
-      ossimString newPrefix = ossimString(prefix);
-      newPrefix += ossimString("coverage");
-      newPrefix += ossimString::toString(theNumberList[idx]);
-      newPrefix += ossimString(".");
-      ossimVpfAnnotationCoverageInfo* coverageInfo = new ossimVpfAnnotationCoverageInfo;
-      coverageInfo->setLibrary(library);
-      theCoverageLayerList.push_back(coverageInfo);
-      coverageInfo->loadState(kwl,
-			      newPrefix);
-    }
-  
-  return true;
-}
-
diff --git a/ossim/src/ossim/imaging/ossimWatermarkFilter.cpp b/ossim/src/ossim/imaging/ossimWatermarkFilter.cpp
deleted file mode 100644
index 1b0ae1a..0000000
--- a/ossim/src/ossim/imaging/ossimWatermarkFilter.cpp
+++ /dev/null
@@ -1,1159 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, David Burken, all rights reserved.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description: Class definition of ossimWatermarkFilter.
-// Applies an image or watermark to image.  Positioning is based on mode.
-// Density is base on alpha weight.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimWatermarkFilter.cpp 15766 2009-10-20 12:37:09Z gpotts $
-
-#include <vector>
-
-#include <ossim/imaging/ossimWatermarkFilter.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimFilenameProperty.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-
-#include <ossim/imaging/ossimScalarRemapper.h>
-
-
-RTTI_DEF1(ossimWatermarkFilter, "ossimWatermarkFilter", ossimImageSourceFilter)
-
-static ossimTrace traceDebug(ossimString("ossimWatermarkFilter:debug"));
-
-// Keywords:
-static const char WATERMARK_MODE_KW[] = "watermark_mode";
-static const char WEIGHT_KW[]         = "weight";
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimWatermarkFilter.cpp 15766 2009-10-20 12:37:09Z gpotts $";
-#endif
-
-const ossim_float64 DEFAULT_WEIGHT = 0.20;
-
-ossimWatermarkFilter::ossimWatermarkFilter()
-   :
-   theFilename(ossimFilename::NIL),
-   theWatermarkWeight(DEFAULT_WEIGHT),
-   theTile(NULL),
-   theWatermark(NULL),
-   theMode(ossimWatermarkFilter::UPPER_LEFT),
-   theInputBoundingRect(),
-   theDirtyFlag(true)
-{
-   theEnableFlag = true;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPixelFlipper::ossimPixelFlipper" << std::endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << std::endl;
-#endif      
-   }
-}
-
-ossimWatermarkFilter::~ossimWatermarkFilter()
-{
-   // Dereference tiles and force a delete if last reference.
-   theWatermark = NULL;
-   theTile      = NULL;
-}
-
-ossimString ossimWatermarkFilter::getShortName() const
-{
-   return ossimString("Watermark Filter");
-}
-
-ossimString ossimWatermarkFilter::getLongName() const
-{
-   return ossimString("Watermark Filter - Applies watermark image onto getTile Request.");
-}
-
-ossimString ossimWatermarkFilter::getDescription() const
-{
-   ossimString description;
-   description = getLongName();
-   description += "\n";
-   description += "Valid modes:\n";
-
-   vector<ossimString> list;
-   getModeList(list);
-
-   vector<ossimString>::const_iterator i = list.begin();
-   while (i != list.end())
-   {
-      description +=(*i);
-      description += "\n";
-      ++i;
-   }
-
-   return description;
-}
-
-ossimRefPtr<ossimImageData> ossimWatermarkFilter::getTile(
-   const ossimIrect& tile_rect, ossim_uint32 resLevel)
-{
-   // Lock for the length of this method.
-   // Check for input.
-   if (!theInputConnection)
-   {
-      if (theTile.valid())
-      {
-         theTile->setImageRectangle(tile_rect);
-         theTile->makeBlank();
-      }
-      return theTile;
-   }
-
-   // Fetch a tile from from the input source.
-   ossimRefPtr<ossimImageData> inputTile =
-      theInputConnection->getTile(tile_rect, resLevel);
-
-   // Check for bypass.
-   if (theEnableFlag == false) return inputTile;
-
-   // Check for weight being 0.0.
-   if (theWatermarkWeight == 0.0) return inputTile;
-
-   //---
-   // Check for dirty state.
-   // Note: This is set in initialize if something changes.
-   //---
-   if (theDirtyFlag == true)
-   {
-      if (allocate() == false) // Something not right if false.
-      {
-         return inputTile;
-      }
-   }   
-   
-   // We will only watermark (process) within the input bounding rectangle.
-   if (tile_rect.intersects(theInputBoundingRect) == false)
-   {
-      return inputTile;
-   }
-
-   // Capture the rectangle and blank out theTile.
-   theTile->setImageRectangle(tile_rect);
-
-   if (inputTile.valid() &&
-       (inputTile->getDataObjectStatus() != OSSIM_NULL))
-   {
-      // Copy the inputTile to theTile.
-      theTile->loadTile(inputTile.get());
-   }
-   else 
-   {
-      theTile->makeBlank();
-   }
-
-   // Write the watermarks...
-   switch(theTile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         fill(ossim_uint8(0));
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         fill(ossim_sint8(0));
-         break;
-      }
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      {
-         fill(ossim_uint16(0));
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         fill(ossim_sint16(0));
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         fill(ossim_uint32(0));
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         fill(ossim_sint32(0));
-         break;
-      }
-      case OSSIM_FLOAT32: 
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         fill(ossim_float32(0));
-         break;
-      }
-      case OSSIM_FLOAT64: 
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         fill(ossim_float32(0));
-         break;
-      }
-      case OSSIM_SCALAR_UNKNOWN:
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Scalar type = " << theTile->getScalarType()
-            << " Not supported by ossimWatermarkFilter" << std::endl;
-         return inputTile;
-      }
-   }
-
-   return theTile;
-}
-
-template <class T> void ossimWatermarkFilter::fill(T /* dummy */)
-{
-   const ossimIrect TILE_RECT = theTile->getImageRectangle();
-
-   // We will only fill data within the input bounding rect.
-   const ossimIrect CLIPPED_TILE_RECT =
-      TILE_RECT.clipToRect(theInputBoundingRect);
-
-   // Get the bounding rectangles.
-   vector<ossimIrect> rects(0);
-   getIntersectingRects(rects);
-
-   if (rects.size() == 0)
-   {
-      return;
-   }
-
-   //---
-   // Have watermark rectangles that intersect this tile so we need to process.
-   //---
-   ossim_uint32 band = 0;
-   ossim_float64 inputPixWeight = 1.0 - theWatermarkWeight;
-
-   // Get a pointers to the watermark buffers (wmBuf) and nulls wn.
-   T** wmBuf = new T*[theWatermarkNumberOfBands];
-   for (band = 0; band < theWatermarkNumberOfBands; ++band)
-   {
-      wmBuf[band] = static_cast<T*>(theWatermark->getBuf(band));
-   }
-   
-   // Get a pointers to the output tile buffers and nulls in.
-   T** otBuf = new T*[theInputNumberOfBands];
-   for (band = 0; band < theInputNumberOfBands; ++band)
-   {
-      otBuf[band] = static_cast<T*>(theTile->getBuf(band));
-   }
-
-   // Get the width of the buffers for indexing.
-   ossim_int32 wmWidth = static_cast<ossim_int32>(theWatermark->getWidth());
-   ossim_int32 otWidth = static_cast<ossim_int32>(theTile->getWidth());
-
-   const ossim_float64* wmNull = theWatermark->getNullPix();
-   const ossim_float64* otMin  = theTile->getMinPix();
-   const ossim_float64* otMax  = theTile->getMaxPix();
-   const ossim_float64* otNull = theTile->getNullPix();
-   
-      
-   // Control loop through intersecting rectangles.
-   vector<ossimIrect>::const_iterator i = rects.begin();
-   while (i != rects.end())
-   {
-      if ( (*i).intersects(CLIPPED_TILE_RECT) )
-      {
-         //---
-         // This is the rectangle we want to fill relative to requesting
-         // image space.
-         //---
-         const ossimIrect CLIPPED_WATERMARRK_RECT =
-            (*i).clipToRect(CLIPPED_TILE_RECT);
-
-         ossim_int32 clipHeight = CLIPPED_WATERMARRK_RECT.height();
-         ossim_int32 clipWidth  = CLIPPED_WATERMARRK_RECT.width();
-
-         // Compute the starting offset into the wmBuf and otBuf.
-         ossim_int32 wmOffset =
-            (CLIPPED_WATERMARRK_RECT.ul().y - (*i).ul().y) * wmWidth +
-            CLIPPED_WATERMARRK_RECT.ul().x  - (*i).ul().x;
-         ossim_int32 otOffset =
-            (CLIPPED_WATERMARRK_RECT.ul().y - TILE_RECT.ul().y)* otWidth +
-             CLIPPED_WATERMARRK_RECT.ul().x - TILE_RECT.ul().x;
-         
-         // Line loop...
-         for (ossim_int32 line = 0; line < clipHeight; ++line)
-         {
-            // Sample loop...
-            for (ossim_int32 sample = 0; sample < clipWidth; ++sample)
-            {
-               // Output band control loop until all output bands are filled.
-               ossim_uint32 otBand = 0;
-               while (otBand < theInputNumberOfBands)
-               {
-                  // Band loop through the watermark.
-                  for (ossim_uint32 wmBand = 0;
-                       wmBand < theWatermarkNumberOfBands;
-                       ++wmBand)
-                  {
-                     if (wmBuf[wmBand][wmOffset+sample] != wmNull[wmBand])
-                     {
-                        // Apply the weight to the input pixel.
-                        ossim_float64 p1 =
-                           (otBuf[otBand][otOffset+sample] != otNull[otBand]) ?
-                           otBuf[otBand][otOffset+sample] * inputPixWeight :
-                           0.0;
-
-                        // Apply the Weight to the watermark pixel.
-                        ossim_float64 p2 =
-                           wmBuf[wmBand][wmOffset+sample]*theWatermarkWeight;
-
-                        // Add them up.
-                        ossim_float64 p3 = p1 + p2;
-
-                        // Cast to output type with range checking.
-                        otBuf[otBand][otOffset+sample] = static_cast<T>(
-                           ( (p3 >= otMin[otBand]) ?
-                             (p3 < otMax[otBand] ? p3 : otMax[otBand]) :
-                             otNull[otBand]) );
-                     }
-                     ++otBand;
-                     
-                     // We stop when we reach here.  All output bands filled.
-                     if (otBand == theInputNumberOfBands)
-                     {
-                        break;
-                     }
-                     
-                  } // End of band through watermark.
-                  
-               } // End of outer band loop.
-               
-            } // End of sample loop.
-
-            wmOffset += wmWidth;
-            otOffset += otWidth;
-            
-         } // End of line loop.
-
-      } // End "if ( (*i).intersects(TILE_RECT) )"
-      
-      ++i; // Go to next rectangle to fill if any.
-      
-   } // End of "while (i != rects.end())"
-
-   // Clean up.
-   delete [] wmBuf;
-   delete [] otBuf;
-   
-   theTile->validate();
-}
-
-void ossimWatermarkFilter::getIntersectingRects(vector<ossimIrect>& rects)
-{
-   switch(theMode)
-   {
-      case UPPER_LEFT:
-         getUpperLeftRect(rects);
-         break;
-      case UPPER_CENTER:
-         getUpperCenterRect(rects);
-         break;
-      case UPPER_RIGHT:
-         getUpperRightRect(rects);
-         break;
-      case CENTER:
-         getCenterRect(rects);
-         break;
-      case LOWER_LEFT:
-         getLowerLeftRect(rects);
-         break;
-      case LOWER_CENTER:
-         getLowerCenterRect(rects);
-         break;
-      case LOWER_RIGHT:
-         getLowerRightRect(rects);
-         break;
-      case UNIFORM_DENSE:
-         getUniformDenseRects(rects);
-         break;
-      case UNIFORM_SPARSE:
-         getUniformSparceRects(rects);
-         break;
-      default:
-         break;
-   }
-}
-
-void ossimWatermarkFilter::getUpperLeftRect(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   theWatermark->setOrigin(theInputBoundingRect.ul());
-   ossimIrect r = theWatermark->getImageRectangle();
-   if (r.intersects(CLIP_RECT))
-   {
-      rects.push_back(r);
-   }
-}
-
-void ossimWatermarkFilter::getUpperCenterRect(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
-   ossim_uint32 inputWidth = theInputBoundingRect.width();
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   // Input wider than watermark so center.
-   if (inputWidth > watermarkWidth)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>((inputWidth - watermarkWidth) / 2);
-      origin.x = origin.x + offset;
-   }
-   
-   theWatermark->setOrigin(origin);
-   
-   ossimIrect r = theWatermark->getImageRectangle();
-   if (r.intersects(CLIP_RECT))
-   {
-      rects.push_back(r);
-   }
-}  
-
-void ossimWatermarkFilter::getUpperRightRect(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkWidth =
-      theWatermark->getImageRectangle().width();
-   ossim_uint32 inputWidth = theInputBoundingRect.width();
-   
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   // Input wider than watermark so center.
-   if (inputWidth > watermarkWidth)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>(inputWidth - watermarkWidth);
-      origin.x = origin.x + offset;
-   }
-   
-   theWatermark->setOrigin(origin);
-   
-   ossimIrect r = theWatermark->getImageRectangle();
-   if (r.intersects(CLIP_RECT))
-   {
-      rects.push_back(r);
-   }
-}  
-
-void ossimWatermarkFilter::getCenterRect(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
-   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
-   ossim_uint32 inputWidth = theInputBoundingRect.width();
-   ossim_uint32 inputHeight = theInputBoundingRect.height();
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   // Input wider than watermark so center.
-   if (inputWidth > watermarkWidth)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>((inputWidth - watermarkWidth) / 2);
-      origin.x = origin.x + offset;
-   }
-   // Input higher than watermark so center.
-   if (inputHeight > watermarkHeight)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>((inputHeight - watermarkHeight) / 2);
-      origin.y = origin.y + offset;
-   }
-   
-   theWatermark->setOrigin(origin);
-   
-   ossimIrect r = theWatermark->getImageRectangle();
-   if (r.intersects(CLIP_RECT))
-   {
-      rects.push_back(r);
-   }
-}
-
-void ossimWatermarkFilter::getLowerLeftRect(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
-   ossim_uint32 inputHeight = theInputBoundingRect.height();
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   // Input higher than watermark so apply offset.
-   if (inputHeight > watermarkHeight)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>(inputHeight - watermarkHeight);
-      origin.y = origin.y + offset;
-   }
-   
-   theWatermark->setOrigin(origin);
-   
-   ossimIrect r = theWatermark->getImageRectangle();
-   if (r.intersects(CLIP_RECT))
-   {
-      rects.push_back(r);
-   }
-}
-
-void ossimWatermarkFilter::getLowerCenterRect(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
-   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
-   ossim_uint32 inputWidth = theInputBoundingRect.width();
-   ossim_uint32 inputHeight = theInputBoundingRect.height();
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   // Input wider than watermark so center.
-   if (inputWidth > watermarkWidth)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>((inputWidth - watermarkWidth) / 2);
-      origin.x = origin.x + offset;
-   }
-   // Input higher than watermark so apply offset.
-   if (inputHeight > watermarkHeight)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>(inputHeight - watermarkHeight);
-      origin.y = origin.y + offset;
-   }
-   
-   theWatermark->setOrigin(origin);
-   ossimIrect r = theWatermark->getImageRectangle();
-   if (r.intersects(CLIP_RECT))
-   {
-      rects.push_back(r);
-   }
-}
-
-void ossimWatermarkFilter::getLowerRightRect(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
-   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
-   ossim_uint32 inputWidth = theInputBoundingRect.width();
-   ossim_uint32 inputHeight = theInputBoundingRect.height();
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   // Input wider than watermark so center.
-   if (inputWidth > watermarkWidth)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>(inputWidth - watermarkWidth);
-      origin.x = origin.x + offset;
-   }
-   // Input higher than watermark so apply offset.
-   if (inputHeight > watermarkHeight)
-   {
-      ossim_int32 offset =
-         static_cast<ossim_int32>(inputHeight - watermarkHeight);
-      origin.y = origin.y + offset;
-   }
-   
-   theWatermark->setOrigin(origin);
-   ossimIrect r = theWatermark->getImageRectangle();
-   if (r.intersects(CLIP_RECT))
-   {
-      rects.push_back(r);
-   }
-   
-}
-
-void ossimWatermarkFilter::getUniformDenseRects(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
-   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
-   ossim_uint32 inputWidth = theInputBoundingRect.width();
-   ossim_uint32 inputHeight = theInputBoundingRect.height();
-
-   ossim_uint32 watermarksHigh = inputHeight / watermarkHeight;
-   if (inputHeight % watermarkHeight) ++watermarksHigh;
-   
-   ossim_uint32 watermarksWide = inputWidth / watermarkWidth;
-   if (inputWidth % watermarkWidth) ++watermarksWide;
-
-   ossim_int32 xOffset = static_cast<ossim_int32>(watermarkWidth);
-   ossim_int32 yOffset = static_cast<ossim_int32>(watermarkHeight);
-   
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   for (ossim_uint32 y = 0; y < watermarksHigh; ++y)
-   {
-      for (ossim_uint32 x = 0; x < watermarksWide; ++x)
-      {
-         theWatermark->setOrigin(origin);
-         ossimIrect r = theWatermark->getImageRectangle();
-         if (r.intersects(CLIP_RECT))
-         {
-            rects.push_back(r);
-         }
-         origin.x = origin.x + xOffset;
-      }
-      origin.y = origin.y + yOffset;
-      origin.x = theInputBoundingRect.ul().x;
-   }
-}
-
-void ossimWatermarkFilter::getUniformSparceRects(vector<ossimIrect>& rects)
-{
-   // First clip the rect to the bounding image rectangle.
-   const ossimIrect CLIP_RECT =
-      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
-   ossim_uint32 watermarkWidth  = theWatermark->getImageRectangle().width();
-   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
-   ossim_uint32 inputWidth      = theInputBoundingRect.width();
-   ossim_uint32 inputHeight     = theInputBoundingRect.height();
-   ossim_uint32 gapWidth   = watermarkWidth/2;
-   ossim_uint32 gapHeight  = watermarkHeight/2;
-
-   ossim_uint32 watermarksHigh = inputHeight/(watermarkHeight+gapHeight);
-   if (inputHeight % watermarkHeight) ++watermarksHigh;
-   
-   ossim_uint32 watermarksWide = inputWidth/(watermarkWidth+gapWidth);
-   if (inputWidth % watermarkWidth) ++watermarksWide;
-
-   ossim_int32 xOffset = static_cast<ossim_int32>(watermarkWidth  + gapWidth);
-   ossim_int32 yOffset = static_cast<ossim_int32>(watermarkHeight + gapHeight);
-
-   ossimIpt origin = theInputBoundingRect.ul();
-   
-   for (ossim_uint32 y = 0; y < watermarksHigh; ++y)
-   {
-      for (ossim_uint32 x = 0; x < watermarksWide; ++x)
-      {
-         theWatermark->setOrigin(origin);
-         ossimIrect r = theWatermark->getImageRectangle();
-         if (r.intersects(CLIP_RECT))
-         {
-            rects.push_back(r);
-         }
-         origin.x = origin.x + xOffset;
-      }
-      origin.y = origin.y + yOffset;
-      origin.x = theInputBoundingRect.ul().x;
-   }
-}
-
-void ossimWatermarkFilter::initialize()
-{
-   //---
-   // If state is not already dirty and there is an input connection
-   // check for:
-   // 
-   // 1) Scalar change
-   // 2) band number change
-   // 3) bounding box change
-   //
-   // Set state to dirty on a change.
-   //
-   // NOTE:  This method intentionally only sets the dirty state and doesn't do
-   // anything else as it is called repetitively during chain setup or chain
-   // state changes.
-   //
-   // The first getTile call will do the real work, call allocate(),
-   // if the state is dirty.
-   //---
-
-   // Lock for the length of this method.
-   // Set the input connection.
-   ossimImageSourceFilter::initialize();
-
-   // Once dirty flag is set no need to do it again.
-   if (theDirtyFlag == false)
-   {
-      if (theInputConnection)
-      {
-         // Check for scalar type change.
-         if (theInputScalarType != theInputConnection->getOutputScalarType())
-         {
-            theDirtyFlag = true;
-            return;
-         }
-
-         // Check for band change.
-         if (theInputNumberOfBands !=
-             theInputConnection->getNumberOfOutputBands())
-         {
-            theDirtyFlag = true;
-            return;
-         }
-
-         // Check for bounding rectangle change.
-         if ( theInputBoundingRect != theInputConnection->getBoundingRect() )
-         {
-            theDirtyFlag = true;
-            return;
-         }
-      }
-   }
-}
-
-bool ossimWatermarkFilter::allocate()
-{
-   // Capture the bounding rect:
-   theInputBoundingRect = theInputConnection->getBoundingRect();
-
-   // Capture the scalar type:
-   theInputScalarType = theInputConnection->getOutputScalarType();
-
-   // Capture the number of bands:
-   theInputNumberOfBands = theInputConnection->getNumberOfOutputBands();
-
-   //---
-   // Check the watermark scalar type.
-   //---
-   if (theWatermark.valid())
-   {
-      if (theWatermark->getScalarType() != theInputScalarType)
-      {
-         //---
-         // We'll need to make a new one with a scalar remapper after it.
-         //---
-         theWatermark = NULL; // We'll need to make a new one.
-      }
-   }
-
-   //---
-   // Make a new watermark tile.  This will do a scalar remap if needed.
-   // If we don't have a watermark no point in going on...
-   //---
-   if (!theWatermark)
-   {
-      if (openWatermarkFile() == false)
-      {
-         return false;
-      }
-   }
-
-   if (theTile.valid())
-   {
-      if ( (theTile->getScalarType()    != theInputScalarType) ||
-           (theTile->getNumberOfBands() != theInputNumberOfBands) )
-      {
-         theTile = NULL;  // We'll need to make a new one.
-      }
-   }
-
-   // Make a new output tile if we need to.
-   if (!theTile)
-   {
-      theTile = ossimImageDataFactory::instance()->create(this,
-                                                          theInputConnection);
-      if (theTile.valid())
-      {
-         theTile->initialize();
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-   //---
-   // If we get here things are good so clear the dirty flag so we don't
-   // get called again needlessly.
-   //---
-   theDirtyFlag = false;
-   
-   return true;
-}
-
-bool ossimWatermarkFilter::openWatermarkFile()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimWatermarkFilter::openWatermarkFile DEBUG: entered..."
-         << std::endl;
-   }
-
-   if (!theInputConnection || (theFilename == ossimFilename::NIL))
-   {
-      return false;
-   }
-
-   theWatermark = NULL; // This will destroy any previous tiles.
-
-   // Open the watermark image.
-   ossimRefPtr<ossimImageHandler> ih =
-      ossimImageHandlerRegistry::instance()->open(theFilename);
-   if (!ih)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimWatermarkFilter::openWatermarkFile"
-            << "\nCould not open: " << theFilename 
-            << std::endl;
-      }
-      
-      return false;
-   }
-   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimWatermarkFilter::openWatermarkFile"
-            << "\nError reading image:  " << theFilename
-            << std::endl; 
-         return false;
-      }
-   }
-
-   ih->initialize();
-   ossimRefPtr<ossimImageSource> imageSource = ih.get();
-   ossimRefPtr<ossimScalarRemapper> remapper;
-   
-   if (ih->getOutputScalarType() != theInputConnection->getOutputScalarType())
-   {
-      // Remap the watemark to the same scalar type as the input.
-      remapper = new ossimScalarRemapper(imageSource.get(),
-                                         theInputConnection->
-                                         getOutputScalarType());
-      remapper->initialize();
-      imageSource = remapper.get();
-   }
-   
-   // Get the full image rectangle.
-   theWatermark = imageSource->getTile(ih->getImageRectangle(), 0);
-
-   // Cleanup...
-   if (remapper.valid())
-   {
-      remapper->disconnect();
-      remapper = NULL;
-   }
-   if(ih.valid())
-   {
-      ih->disconnect();
-      ih = 0;
-   }
-   imageSource = 0;
-   
-   if (theWatermark.valid() == false)
-   {
-      return false;
-   }
-
-   // Capture the bands as we will need this repetitively.
-   theWatermarkNumberOfBands = theWatermark->getNumberOfBands();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimWatermarkFilter::openWatermarkFile DEBUG:"
-         << *(theWatermark.get())
-         << endl;
-   }
-
-   return true;
-}
-
-bool ossimWatermarkFilter::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::FILENAME_KW,
-           theFilename.c_str());
-   kwl.add(prefix,
-           WATERMARK_MODE_KW,
-           getModeString().c_str());
-   kwl.add(prefix,
-           WEIGHT_KW,
-           theWatermarkWeight);
-
-   return ossimImageSourceFilter::saveState(kwl, prefix);
-}
-
-bool ossimWatermarkFilter::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   // Do this first so connections get set up.
-   if (ossimImageSourceFilter::loadState(kwl, prefix) == false)
-   {
-      return false;
-   }
-
-   const char* lookupReturn;
-
-   lookupReturn = kwl.find(prefix, WEIGHT_KW);
-   if(lookupReturn)
-   {
-      setWeight(ossimString(lookupReturn).toDouble());
-   }
-
-   lookupReturn = kwl.find(prefix, WATERMARK_MODE_KW);
-   if(lookupReturn)
-   {
-      setMode(ossimString(lookupReturn));
-   }
-
-   lookupReturn = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   if(lookupReturn)
-   {
-      setFilename(lookupReturn);
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimWatermarkFilter::loadState DEBUG:"
-         << std::endl;
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-
-   return true;
-}
-
-ossimRefPtr<ossimProperty> ossimWatermarkFilter::getProperty(
-   const ossimString& name) const
-{
-   // Lock for the length of this method.
-   if (name == ossimKeywordNames::FILENAME_KW)
-   {
-      ossimFilenameProperty* ofp =
-         new ossimFilenameProperty(name, theFilename);
-      ofp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
-      ofp->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>((ossimProperty*)ofp);
-   }
-   else if (name == WATERMARK_MODE_KW)
-   {
-      vector<ossimString> constraintList;
-      getModeList(constraintList);
-
-      ossimStringProperty* p =
-         new ossimStringProperty(name,
-                                 getModeString(),
-                                 false,
-                                 constraintList);
-       p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-   else if (name == WEIGHT_KW)
-   {
-      ossimProperty* p =
-         new ossimNumericProperty(name,
-                                  ossimString::toString(theWatermarkWeight));
-      p->setCacheRefreshBit();
-      return ossimRefPtr<ossimProperty>(p);
-   }
-
-   return ossimImageSourceFilter::getProperty(name);
-}
-
-void ossimWatermarkFilter::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if (!property) return;
-
-   ossimString os = property->valueToString();
-   
-   ossimString name = property->getName();
-   if (name == ossimKeywordNames::FILENAME_KW)
-   {
-      setFilename(os);
-   }
-   else if  (name == WATERMARK_MODE_KW)
-   {
-      setMode(os);
-   }
-   else if  (name == WEIGHT_KW)
-   {
-      setWeight(os.toDouble());
-   }
-   else
-   {
-      ossimImageSourceFilter::setProperty(property);
-   }
-}
-
-void ossimWatermarkFilter::getPropertyNames(
-   std::vector<ossimString>& propertyNames) const
-{
-   propertyNames.push_back(ossimKeywordNames::FILENAME_KW);
-   propertyNames.push_back(WATERMARK_MODE_KW);
-   propertyNames.push_back(WEIGHT_KW);
-   ossimImageSourceFilter::getPropertyNames(propertyNames);
-}
-
-void ossimWatermarkFilter::getModeList(vector<ossimString>& list) const
-{
-   list.clear();
-   list.resize(ossimWatermarkFilter::END);
-   list[0] = ossimString("upper_left");
-   list[1] = ossimString("upper_center");
-   list[2] = ossimString("upper_right");
-   list[3] = ossimString("center");
-   list[4] = ossimString("lower_left");
-   list[5] = ossimString("lower_center");
-   list[6] = ossimString("lower_right");
-   list[7] = ossimString("uniform_dense");
-   list[8] = ossimString("uniform_sparse");
-}
-
-ossimWatermarkFilter::WatermarkMode ossimWatermarkFilter::getMode() const
-{
-   return theMode;
-}
-
-ossimString ossimWatermarkFilter::getModeString() const
-{
-   switch(theMode)
-   {
-      case UPPER_LEFT:
-         return ossimString("upper_left");
-      case UPPER_CENTER:
-         return ossimString("upper_center");
-      case UPPER_RIGHT:
-         return ossimString("upper_right");
-      case CENTER:
-         return ossimString("center");
-      case LOWER_LEFT:
-         return ossimString("lower_left");
-      case LOWER_CENTER:
-         return ossimString("lower_center");
-      case LOWER_RIGHT:
-         return ossimString("lower_right");
-      case UNIFORM_DENSE:
-         return ossimString("uniform_dense");
-      case UNIFORM_SPARSE:
-         return ossimString("uniform_sparse");
-      default:
-         break;
-   }
-
-   return ossimString("UNKNOWN_MODE");
-}
-
-void ossimWatermarkFilter::setFilename(const ossimFilename& file)
-{
-   if (file != theFilename)
-   {
-      theFilename = file;
-      theWatermark = NULL; // Will be reallocated next getTile.
-      theDirtyFlag = true;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimWatermarkFilter::setFilename DEBUG:" << std::endl;
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-}
-
-void ossimWatermarkFilter::setMode(const ossimString& mode)
-{
-   ossimString os = mode;
-   os.downcase();
-   
-   if (os == "upper_left")
-   {
-      theMode = UPPER_LEFT;
-   }
-   else if (os == "upper_center")
-   {
-      theMode = UPPER_CENTER;
-   }
-   else if (os == "upper_right")
-   {
-      theMode = UPPER_RIGHT;
-   }
-   else if (os == "center")
-   {
-      theMode = CENTER;
-   }
-   else if (os == "lower_left")
-   {
-      theMode = LOWER_LEFT;
-   }
-   else if (os == "lower_center")
-   {
-      theMode = LOWER_CENTER;
-   }
-   else if (os == "lower_right")
-   {
-      theMode = LOWER_RIGHT;
-   }
-   else if (os == "uniform_dense")
-   {
-      theMode = UNIFORM_DENSE;
-   }
-   else if (os == "uniform_sparse")
-   {
-      theMode = UNIFORM_SPARSE;
-   }
-   else
-   {
-      // Invalid mode...
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimWatermarkFilter::setMode DEBUG:"
-            << "\nInvalid mode!  " << mode
-            << std::endl;
-      }
-   }
-}
-
-void ossimWatermarkFilter::setWeight(ossim_float64 weight)
-{
-   if ( (weight >= 0.0) && (weight <= 1.0) )
-   {
-      theWatermarkWeight = weight;
-   }
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimWatermarkFilter::setWeight DEBUG:" << std::endl;
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-   
-}
-
-std::ostream& ossimWatermarkFilter::print(std::ostream& out) const
-{
-   out << "ossimWatermarkFilter::print"
-       << "\ntheFilename:        " << theFilename
-       << "\ntheWatermarkWeight: " << theWatermarkWeight
-       << "\ntheMode:            " << getModeString()
-       << std::endl;
-   return ossimImageSourceFilter::print(out);
-}
-
diff --git a/ossim/src/ossim/init/makefile.vc b/ossim/src/ossim/init/makefile.vc
deleted file mode 100644
index f82cdc8..0000000
--- a/ossim/src/ossim/init/makefile.vc
+++ /dev/null
@@ -1,15 +0,0 @@
-###
-# $Id: makefile.vc 16741 2010-02-28 16:02:10Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimInit.obj
-
-default:	clean $(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/init/ossimInit.cpp b/ossim/src/ossim/init/ossimInit.cpp
deleted file mode 100644
index 70bb194..0000000
--- a/ossim/src/ossim/init/ossimInit.cpp
+++ /dev/null
@@ -1,713 +0,0 @@
-//*****************************************************************************
-// FILE: ossimInit.cpp
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimInit. This object handles all
-//   aspects of initialization for OSSIM applications. These tasks include:
-//
-//      1. Parsing the command line.
-//      2. Instantiating all class factories.
-//      3. Initializing the "trace" code execution tracing functionality.
-//      4. Scanning the preferences file for relevant values.
-//
-// SOFTWARE HISTORY:
-//   24Apr2001  Oscar Kramer
-//              Initial coding.
-//*****************************************************************************
-// $Id: ossimInit.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/ossimVersion.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimTraceManager.h>
-#include <algorithm>
-#include <ossim/base/ossimEnvironmentUtility.h>
-#include <ossim/base/ossimGeoidEgm96.h>
-#include <ossim/imaging/ossimCodecFactoryRegistry.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-
-// include the image file formats
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossim2dTo2dTransformRegistry.h>
-#include <ossim/imaging/ossimImageGeometryRegistry.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
-#include <ossim/imaging/ossimOverviewBuilderFactory.h>
-
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimImageMetaDataWriterRegistry.h>
-#include <ossim/projection/ossimProjectionViewControllerFactory.h>
-#include <ossim/base/ossimDatumFactoryRegistry.h>
-#include <ossim/base/ossimBaseObjectFactory.h>
-#include <ossim/base/ossimCustomEditorWindowRegistry.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/plugin/ossimSharedPluginRegistry.h>
-#include <ossim/plugin/ossimDynamicLibrary.h>
-#include <ossim/font/ossimFontFactoryRegistry.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-
-static ossimTrace traceExec = ossimTrace("ossimInit:exec");
-static ossimTrace traceDebug = ossimTrace("ossimInit:debug");
-
-ossimInit* ossimInit::theInstance = 0;
-
-ossimInit::~ossimInit()
-{
-   theInstance = 0;
-}
-
-ossimInit::ossimInit()
-    :
-       theInitializedFlag(false),
-       theAppName(),
-       thePreferences(ossimPreferences::instance()),
-       theElevEnabledFlag(true),
-       thePluginLoaderEnabledFlag(true)
-{
-}
-
-ossimInit* ossimInit::instance()
-{
-   static OpenThreads::Mutex m;
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
-   if (!theInstance)
-   {
-      theInstance = new ossimInit();
-   }
-   return theInstance;
-}
-
-void ossimInit::addOptions(ossimArgumentParser& parser)
-{
-   parser.getApplicationUsage()->addCommandLineOption("-P", "specify a preference file to load");
-   parser.getApplicationUsage()->addCommandLineOption("-K", "specify individual keywords to add to the preferences keyword list: name=value");
-   parser.getApplicationUsage()->addCommandLineOption("-T", "specify the classes to trace, ex: ossimInit|ossimImage.* \nwill trace ossimInit and all ossimImage classes");
-   parser.getApplicationUsage()->addCommandLineOption("--disable-elev", "Will disable the elevation");
-   parser.getApplicationUsage()->addCommandLineOption("--disable-plugin", "Will disable the plugin loader");
-   
-   parser.getApplicationUsage()->addCommandLineOption("--ossim-logfile", "takes a logfile as an argument.  All output messages are redirected to the specified log file.  By default there is no log file and all messages are enabled.");
-   parser.getApplicationUsage()->addCommandLineOption("--disable-notify", "Takes an argument. Arguments are ALL, WARN, NOTICE, INFO, FATAL, DEBUG.  If you want multiple disables then just do multiple --disable-notify on the command line.  All argument are case insensitive.  Default is all are enabled.");
-}
-
-/*!****************************************************************************
- * METHOD: ossimInit::initialize()
- *  
- *  Method called from the OSSIM application main.
- *  
- *****************************************************************************/
-void ossimInit::initialize(int& argc, char** argv)
-{
-    static OpenThreads::Mutex m;
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
-  if( !theInitializedFlag )
-   {
-      ossimArgumentParser argumentParser(&argc, argv);
-      theInstance->initialize(argumentParser);
-   }
-}
-
-void ossimInit::initialize(ossimArgumentParser& parser)
-{
-   static OpenThreads::Mutex m;
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
-   if(theInitializedFlag)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimInit::initialize(parser):"
-            << " Already initialized, returning......"
-            << std::endl;
-      }
-      return;
-   }
-
-   theInstance->theAppName  = parser.getApplicationUsage()->getApplicationName();
-   theInstance->parseNotifyOption(parser);
-   theInstance->thePreferences = ossimPreferences::instance();
-      
-   //Parse the command line:
-   theInstance->parseOptions(parser);
-
-   theInstance->initializeDefaultFactories();
-   
-   if ( theElevEnabledFlag )
-   {
-      theInstance->initializeElevation();
-   }
-
-   theInstance->initializeLogFile();
-   
-   if(thePluginLoaderEnabledFlag)
-   {
-      theInstance->initializePlugins();
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossim preferences file: "
-         << theInstance->thePreferences->getPreferencesFilename()
-         << "\nVersion: " << version()
-         << "\nossimInit::initialize(parser): leaving..." << std::endl;
-   }
-   
-   theInitializedFlag = true;
-}
-
-void ossimInit::initialize()
-{
-    static OpenThreads::Mutex m;
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
-   if(theInitializedFlag)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimInit::initialize(): Already initialized, returning......" << std::endl;
-      }
-      return;
-   }
-
-   theInstance->theAppName  = "";
-   theInstance->thePreferences = ossimPreferences::instance();
-   theInstance->initializeDefaultFactories();
-   
-   if ( theElevEnabledFlag )
-   {
-      theInstance->initializeElevation();
-   }
-
-   theInstance->initializeLogFile();
-
-   //---
-   // To do:
-   // We need a mechanism to register factories to the "front" or the
-   // "back" of factory list so that plugins can override things.  For
-   // now we will initialize the plugins last...
-   //---
-   if(thePluginLoaderEnabledFlag)
-   {
-      theInstance->initializePlugins();
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossim preferences file: "
-         << theInstance->thePreferences->getPreferencesFilename()
-         << "\nVersion: " << version()
-         << "\nossimInit::initialize() leaving..."
-         << std::endl;
-   } 
-   
-   theInitializedFlag = true;
-}
-
-void ossimInit::finalize()
-{
-   
-}
-/*!****************************************************************************
- *  Prints to stdout the list of command line options that this object parses.
- *****************************************************************************/
-void ossimInit::usage()
-{
-   ossimNotify(ossimNotifyLevel_INFO)
-      << "INFORMATION ossimInit::usage():\n"
-      << "Additional command-line options available are as follows: "
-      << "\n"
-      << "\n  -P<pref_filename> -- Allows the user to override the loading "
-      << "\n    of the default preferences with their own pref file."
-      << "\n"
-      << "\n  -K<keyword>[=<value>] -- Allows the user to specify additional"
-      << "\n    keyword/value pairs that are added onto the preferences "
-      << "\n    previously loaded. Keywords specified here override those in"
-      << "\n    the preferences file."
-      << "\n"
-      << "\n  -T<trace_tag> -- Lets user turn on specific trace flags."
-      << "\n"
-      << "\n  -S<session_filename> -- Allows user to specify a session file"
-      << "\n    to load."
-      << std::endl;
-   return;
-}
-
-bool ossimInit::getElevEnabledFlag() const
-{
-   return theElevEnabledFlag;
-}
-
-void ossimInit::setElevEnabledFlag(bool flag)
-{
-   theElevEnabledFlag = flag; 
-}
-
-void ossimInit::setPluginLoaderEnabledFlag(bool flag)
-{
-   thePluginLoaderEnabledFlag = flag;  
-}
-
-void ossimInit::loadPlugins(const ossimFilename& plugin, const char* options)
-{
-   if(!thePluginLoaderEnabledFlag) return;
-
-   if(plugin.exists())
-   {
-      if(plugin.isDir())
-      {
-         ossimDirectory dir;
-         if(dir.open(plugin))
-         {
-            ossimFilename file;
-            
-            if(dir.getFirst(file,
-                            ossimDirectory::OSSIM_DIR_FILES))
-            {
-               do
-               { 
-                  ossimSharedPluginRegistry::instance()->registerPlugin(file, options);
-               }
-               while(dir.getNext(file));
-            }
-         }
-      }
-      else
-      {
-         ossimSharedPluginRegistry::instance()->registerPlugin(plugin, options);
-      }
-   }
-}
-
-void ossimInit::parseOptions(ossimArgumentParser& parser)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimInit::parseOptions: entering..." << std::endl;
-   
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParameter(tempString);
-   while(parser.read("-P", stringParameter));
-
-   if(tempString != "")
-   {
-      thePreferences->loadPreferences(ossimFilename(tempString));
-   }
-   while(parser.read("-K", stringParameter))
-   {
-      ossimString option = tempString;
-      if (option.contains("=") )
-      {
-         ossimString delimiter = "=";
-         ossimString key (option.before(delimiter));
-         ossimString value = option.after(delimiter);
-         thePreferences->addPreference(key.c_str(), value.c_str());
-      }
-      else
-      {
-         ossimString key (option);
-         thePreferences->addPreference(key, "");
-      }
-   }
-
-   while(parser.read("-T", stringParameter))
-   {
-      ossimTraceManager::instance()->setTracePattern(ossimString(tempString));
-   }
-
-   while(parser.read("--ossim-logfile", stringParameter))
-   {
-      ossimSetLogFilename(ossimFilename(tempString));
-   }
-   while(parser.read("--disable-notify", stringParameter))
-   {
-      ossimString tempDownCase = tempString;
-      tempDownCase = tempDownCase.downcase();
-
-      if(tempDownCase == "warn")
-      {
-         ossimDisableNotify(ossimNotifyFlags_WARN);
-      }
-      else if(tempDownCase == "fatal")
-      {
-         ossimDisableNotify(ossimNotifyFlags_FATAL);
-      }
-      else if(tempDownCase == "debug")
-      {
-         ossimDisableNotify(ossimNotifyFlags_DEBUG);
-      }
-      else if(tempDownCase == "info")
-      {
-         ossimDisableNotify(ossimNotifyFlags_INFO);
-      }
-      else if(tempDownCase == "notice")
-      {
-         ossimDisableNotify(ossimNotifyFlags_NOTICE);
-      }
-      else if(tempDownCase == "all")
-      {
-         ossimDisableNotify(ossimNotifyFlags_ALL);
-      }
-   }
-   if(parser.read("--disable-elev"))
-   {
-      theElevEnabledFlag = false;
-   }
-   if(parser.read("--disable-plugin"))
-   {
-      thePluginLoaderEnabledFlag = false;
-   }
-}
-
-void ossimInit::parseNotifyOption(ossimArgumentParser& parser)
-{
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParameter(tempString);
-   while(parser.read("--disable-notify", stringParameter))
-   {
-      ossimString tempDownCase = tempString;
-      tempDownCase = tempDownCase.downcase();
-
-      if(tempDownCase == "warn")
-      {
-         ossimDisableNotify(ossimNotifyFlags_WARN);
-      }
-      else if(tempDownCase == "fatal")
-      {
-         ossimDisableNotify(ossimNotifyFlags_FATAL);
-      }
-      else if(tempDownCase == "debug")
-      {
-         ossimDisableNotify(ossimNotifyFlags_DEBUG);
-      }
-      else if(tempDownCase == "info")
-      {
-         ossimDisableNotify(ossimNotifyFlags_INFO);
-      }
-      else if(tempDownCase == "notice")
-      {
-         ossimDisableNotify(ossimNotifyFlags_NOTICE);
-      }
-      else if(tempDownCase == "all")
-      {
-         ossimDisableNotify(ossimNotifyFlags_ALL);
-      }
-   }
-}
-
-/*!****************************************************************************
- * METHOD: ossimInit::removeOption()
- *  
- * Removes all characters associated with the indicated option from the
- * command line string.
- *  
- *****************************************************************************/
-void ossimInit::removeOption(int& argc,
-                             char** argv,
-                             int argToRemove)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimInit::removeOption(argc, argv, argToRemove): entering..."
-      << std::endl;
-   
-   // Shift the args up by one position, overwriting the arg being removed:
-   for (int i=argToRemove+1; i<argc;  i++)
-   {
-      argv[i - 1] = argv[i];
-   }
-   
-   argc--;
-   argv[argc] = 0;
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimInit::removeOption(argc, argv, argToRemove): leaving..."
-      << std::endl;
-   return;
-}
-
-void ossimInit::initializeDefaultFactories()
-{
-   ossimObjectFactoryRegistry::instance()->registerFactory(ossimImageSourceFactoryRegistry::instance());
-
-   //---
-   // Because of how the imagehandlers work off a magic number make sure
-   // we place the writer first if we don't then the imagehandler will
-   // be false and will then try to open the filename and go through a
-   // magic number and if the file already
-   // existed it will open and create a handler instead of a writer.
-   //---
-   ossimCodecFactoryRegistry::instance();
-   ossimImageWriterFactoryRegistry::instance();
-   ossimDatumFactoryRegistry::instance();
-   ossimImageMetaDataWriterRegistry::instance();
-   ossimImageHandlerRegistry::instance();
-   ossim2dTo2dTransformRegistry::instance();
-   ossimImageGeometryRegistry::instance();
-   // Initialize the overview factories.
-   ossimOverviewBuilderFactoryRegistry::instance()->
-      registerFactory(ossimOverviewBuilderFactory::instance(), true);
-   
-   ossimObjectFactoryRegistry::instance()->addFactory(ossimBaseObjectFactory::instance());
-   
-   // initialize. projection factory.
-   ossimProjectionFactoryRegistry::instance();
-
-   // add the view controllers
-   ossimObjectFactoryRegistry::instance()->registerFactory(ossimProjectionViewControllerFactory::instance());
-
-   ossimFontFactoryRegistry::instance();
-}
-
-void ossimInit::initializePlugins()
-{      
-   ossimString regExpressionDir =  ossimString("^(") + "plugin.dir[0-9]+)";
-   ossimString regExpressionFile =  ossimString("^(") + "plugin.file[0-9]+)";
-
-   const ossimKeywordlist& kwl = thePreferences->preferencesKWL();
-
-   vector<ossimString> keys = kwl.getSubstringKeyList( regExpressionDir );
-
-   ossim_uint32 numberOfDirs = (ossim_uint32)keys.size();
-   ossim_uint32 offset = (ossim_uint32)ossimString("plugin.dir").size();
-   int idx = 0;
-   
-   std::vector<int> numberList(numberOfDirs);
-   
-   // register user plugins first
-   ossimFilename userPluginDir = ossimEnvironmentUtility::instance()->getUserOssimPluginDir();
-   loadPlugins(userPluginDir);
-
-   if(numberList.size()>0)
-   {
-      for(idx = 0; idx < (int)numberList.size();++idx)
-      {
-         ossimString numberStr(keys[idx].begin() + offset,
-                               keys[idx].end());
-         numberList[idx] = numberStr.toInt();
-      }
-      
-      std::sort(numberList.begin(), numberList.end());
-      for(idx=0;idx < (int)numberList.size();++idx)
-      {
-         ossimString newPrefix = "plugin.dir";
-         newPrefix += ossimString::toString(numberList[idx]);
-         const char* directory = kwl.find(newPrefix.c_str());
-         
-         if(directory)
-         {
-            loadPlugins(ossimFilename(directory));
-         }
-      }
-   }
-   keys = kwl.getSubstringKeyList( regExpressionFile );
-   
-   ossim_uint32 numberOfFiles = (ossim_uint32)keys.size();
-   offset = (ossim_uint32)ossimString("plugin.file").size();
-   numberList.resize(numberOfFiles);
-   if(numberList.size()>0)
-   {
-      for(idx = 0; idx < (int)numberList.size();++idx)
-      {
-         ossimString numberStr(keys[idx].begin() + offset,
-                               keys[idx].end());
-         numberList[idx] = numberStr.toInt();
-      }
-      
-      std::sort(numberList.begin(), numberList.end());   
-      for(idx=0;idx < (int)numberList.size();++idx)
-      {
-         ossimString newPrefix="plugin.file";
-         newPrefix += ossimString::toString(numberList[idx]);
-         const char* file = kwl.find(newPrefix.c_str());
-         
-         if(file&&ossimFilename(file).exists())
-         {
-            loadPlugins(file);
-//             ossimSharedPluginRegistry::instance()->registerPlugin(file);
-         }
-      }
-   }
-   
-   // now check new plugin loading that supports passing options to the plugins
-   // 
-   regExpressionFile =  ossimString("^(") + "plugin[0-9]+\\.file)";
-   keys = kwl.getSubstringKeyList( regExpressionFile );
-   
-   numberOfFiles = (ossim_uint32)keys.size();
-   offset = (ossim_uint32)ossimString("plugin").size();
-   numberList.resize(numberOfFiles);
-   
-   if(numberList.size()>0)
-   {
-      for(idx = 0; idx < (int)numberList.size();++idx)
-      {
-         std::vector<ossimString> splitArray;
-         keys[idx].split(splitArray, ".");
-         if(splitArray.size())
-         {
-            keys[idx] = ossimString(splitArray[0].begin(), splitArray[0].begin()+offset);
-         }
-         ossimString numberStr(splitArray[0].begin() + offset,
-                               splitArray[0].end());
-         numberList[idx] = numberStr.toInt();
-      }
-      
-      std::sort(numberList.begin(), numberList.end());   
-      for(idx=0;idx < (int)numberList.size();++idx)
-      {
-         ossimString newPrefix = ossimString("plugin")+ossimString::toString(numberList[idx]) + ".";
-         const char* file    = kwl.find((newPrefix+"file").c_str());
-         const char* options = kwl.find((newPrefix+"options").c_str());
-         if(file&&ossimFilename(file).exists())
-         {
-            loadPlugins(file, options);
-         }
-      }
-   }
-
-   ossimString auto_load_plugins(ossimPreferences::instance()->findPreference("ossim_init.auto_load_plugins"));
-   
-   if(auto_load_plugins.empty()) auto_load_plugins = "true";
-   // now load any plugins not found in the keywordlist
-   //
-   // check for plugins in the current directory
-   // and load them
-   if(auto_load_plugins.toBool())
-   {
-      ossimFilename ossimpluginsDir = ossimFilename(theAppName).dirCat("ossimplugins");
-      ossimDirectory currentDir(theAppName.path());
-
-      if(ossimpluginsDir.exists())
-      {
-         currentDir = ossimpluginsDir;
-      }
-      std::vector<ossimFilename> result;
-      currentDir.findAllFilesThatMatch(result, "ossim.*plugin.*", ossimDirectory::OSSIM_DIR_FILES);
-      
-      if(result.size())
-      {
-         ossim_uint32 idx = 0;
-         for(idx = 0; idx < result.size(); ++idx)
-         {
-            ossimSharedPluginRegistry::instance()->registerPlugin(result[idx]);
-         }
-      }
-   }
-}
-
-void ossimInit::initializeElevation()
-{
-   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimInit::initializeElevation(): Entered..." << std::endl;
-   
-   const ossimKeywordlist& KWL = thePreferences->preferencesKWL();
-
-   ossimFilename appPath = theAppName.path();
-   // look for bundled elevation and geoids
-   {
-	   ossimFilename geoid = appPath.dirCat("geoids");
-	   geoid = geoid.dirCat("geoid1996");
-	   geoid = geoid.dirCat("egm96.grd");
-	   if(geoid.exists())
-	   {
-         ossimGeoid* geoidPtr = new ossimGeoidEgm96(geoid);
-
-         if (geoidPtr->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-         {
-		    ossimGeoidManager::instance()->addGeoid(geoidPtr);
-		 }
-	   }
-   }
-   ossimGeoidManager::instance()->loadState(KWL);
-   
-   ossimFilename elevation = appPath.dirCat("elevation");
-   if(elevation.exists())
-   {
-      ossimElevManager::instance()->loadElevationPath(elevation);
-   }
-   // lets do backward compatability here
-   //
-   ossimString regExpression =  ossimString("^(") + "elevation_source[0-9]+.)";
-   vector<ossimString> keys =
-   KWL.getSubstringKeyList( regExpression );
-   if(!keys.empty())
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "Please specify elevation_source keywords with the new prefix\n"
-                                         << "of elevation_manager.elevation_source....\n";
-      thePreferences->preferencesKWL().addPrefixToKeysThatMatch("elevation_manager.", regExpression);
-   }
-   ossimElevManager::instance()->loadState(KWL, "elevation_manager.");
-   
-   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimInit::initializeElevation(): leaving..." << std::endl;
-}
-
-void ossimInit::initializeLogFile()
-{
-   //---
-   // Do not set if already as --ossim-logfile take precidence over preferences
-   // file.
-   //---
-   ossimFilename logFile;
-   ossimGetLogFilename(logFile);
-
-   if ( (logFile.size() == 0) && thePreferences )
-   {
-      const char* lookup =
-         thePreferences->preferencesKWL().find("ossim.log.file");
-      if (lookup)
-      {
-         logFile = lookup;
-         ossimSetLogFilename(logFile);
-      }
-   }
-}
-
-ossimString ossimInit::version() const
-{
-   ossimString versionString;
-#ifdef OSSIM_VERSION
-   versionString += OSSIM_VERSION;
-#else
-   versionString += "Version ?.?.?";
-#endif
-   
-   versionString += " ";
-
-#ifdef OSSIM_BUILD_DATE
-   versionString += OSSIM_BUILD_DATE;
-#else
-   versionString += "(yyyymmdd)";
-#endif
-
-   return versionString;
-}
-
-ossimFilename ossimInit::appName()const
-{
-   return theAppName;
-}
-
-ossimInit::ossimInit(const ossimInit& /* obj */ )
-{}       
-
-void ossimInit::operator=(const ossimInit& /* rhs */) const
-{}
-
diff --git a/ossim/src/ossim/makefile.vc b/ossim/src/ossim/makefile.vc
deleted file mode 100644
index f4ca628..0000000
--- a/ossim/src/ossim/makefile.vc
+++ /dev/null
@@ -1,157 +0,0 @@
-###
-# $Id: makefile.vc 16741 2010-02-28 16:02:10Z dburken $
-#
-# Windows nmake make file.
-#
-###
-OSSIM_ROOT	=	..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-###
-# Note: EMBED_MANIFEST variable is set in nmake.opt so make sure it is included
-# before this test.
-###
-!if "$(EMBED_MANIFEST)" == "1"
-!include ..\makefile.inc
-OSSIM_VC_MANIFEST_EMBED_DLL=$(_VC_MANIFEST_EMBED_DLL)
-OSSIM_VC_MANIFEST_CLEAN=$(_VC_MANIFEST_CLEAN)
-!else
-OSSIM_VC_MANIFEST_EMBED_DLL=
-OSSIM_VC_MANIFEST_CLEAN=
-!endif
-
-# Path to ossimVersion.h
-VERSION_FILE=$(OSSIM_ROOT)\include\ossim\ossimVersion.h
-
-OBJ 	= 	dll_main\ossimDllMain.obj \
-		$(LIB_BASE_DIR)\*.obj \
-		$(LIB_ELEVATION_DIR)\*.obj \
-		$(LIB_FONT_DIR)\*.obj \
-		$(LIB_IMAGING_DIR)\*.obj \
-		$(LIB_INIT_DIR)\*.obj \
-		$(LIB_KBOOL_DIR)\*.obj \
-		$(LIB_MATRIX_DIR)\*.obj \
-		$(LIB_PARALLEL_DIR)\*.obj \
-		$(LIB_PLUGIN_DIR)\*.obj \
-		$(LIB_PROJECTION_DIR)\*.obj \
-		$(LIB_SUPPORT_DATA_DIR)\*.obj \
-		$(LIB_VEC_DIR)\*.obj \
-		$(LIB_VPF_DIR)\*.obj
-
-default:	version-config.exe base elevation font imaging init kbool\
-                matrix parallel plugin projection support_data vec vpfutil
-	.\version-config.exe $(VERSION_FILE) $(VERSION_STRING)
-	cd dll_main
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd base
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd elevation
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd font
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd imaging
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd init
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd kbool
-	$(MAKE) /f makefile.vc
-	cd ..	
-	cd matrix
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd parallel
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd plugin
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd projection
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd support_data
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd vec
-	$(MAKE) /f makefile.vc
-	cd ..
-	cd vpfutil
-	$(MAKE) /f makefile.vc
-	cd ..
-	link /NOLOGO /VERSION:$(VERSION_STRING) /NODEFAULTLIB:libcmtd /RELEASE  /DLL /OUT:"$(LIB_DIR)\ossim.dll" /IMPLIB:"$(LIB_DIR)\ossim.lib" $(OBJ) $(OSSIM_LIB_LINK)
-	$(OSSIM_VC_MANIFEST_EMBED_DLL)
-
-
-# 	link /NOLOGO /VERSION:$(VERSION_STRING) /RELEASE /DLL /NODEFAULTLIB:libc /NODEFAULTLIB:libcd /OUT:"$(LIB_DIR)\ossim.dll" /IMPLIB:"$(LIB_DIR)\ossim.lib" $(OBJ) $(OSSIM_LIB_LINK)
-
-# This assumes all the objects are built so use with caution.
-dll:
-	link /NOLOGO /VERSION:$(VERSION_STRING) /RELEASE /DLL /OUT:"$(LIB_DIR)\ossim.dll" /IMPLIB:"$(LIB_DIR)\ossim.lib" $(OBJ) $(OSSIM_LIB_LINK)
-	$(OSSIM_VC_MANIFEST_EMBED_DLL)
-
-version-config.exe:
-	$(RM) version-config.exe
-	$(RM) version-config.obj
-	$(CP) $(OSSIM_ROOT)\include\ossim\ossimConfig.h.vc $(OSSIM_ROOT)\include\ossim\ossimConfig.h
-	$(CC) /MD /EHsc -I$(OSSIM_ROOT)\include version-config.cpp
-
-
-# 	link /NOLOGO /VERSION:$(VERSION_STRING) /RELEASE /DLL /NODEFAULTLIB:libc /NODEFAULTLIB:libcd /OUT:"$(LIB_DIR)\ossim.dll" /IMPLIB:"$(LIB_DIR)\ossim.lib" $(OBJ) $(OSSIM_LIB_LINK)
-
-clean:
-	$(RM) version-config.exe
-	$(RM) version-config.obj
-	cd dll_main
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd base
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd elevation
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd font
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd imaging
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd init
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd kbool
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd matrix
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd parallel
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd plugin
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd projection
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd support_data
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd vec
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	cd vpfutil
-	$(MAKE) /f makefile.vc clean
-	cd ..
-	$(RM) $(LIB_DIR)\ossim.*
-	$(OSSIM_VC_MANIFEST_CLEAN)
-
-
-!if "$(EMBED_MANIFEST)" == "1"
-!include ..\makefile.targ.inc
-!endif
diff --git a/ossim/src/ossim/matrix/makefile.vc b/ossim/src/ossim/matrix/makefile.vc
deleted file mode 100644
index 7331365..0000000
--- a/ossim/src/ossim/matrix/makefile.vc
+++ /dev/null
@@ -1,38 +0,0 @@
-###
-# $Id: makefile.vc 9232 2006-07-05 21:42:47Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-bandmat.obj \
-cholesky.obj \
-evalue.obj \
-fft.obj \
-hholder.obj \
-jacobi.obj \
-myexcept.obj \
-newfft.obj \
-newmat1.obj \
-newmat2.obj \
-newmat3.obj \
-newmat4.obj \
-newmat5.obj \
-newmat6.obj \
-newmat7.obj \
-newmat8.obj \
-newmat9.obj \
-newmatex.obj \
-newmatnl.obj \
-newmatrm.obj \
-solution.obj \
-sort.obj \
-submat.obj \
-svd.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/ossimConfig.h.in b/ossim/src/ossim/ossimConfig.h.in
deleted file mode 100644
index d8f7a9d..0000000
--- a/ossim/src/ossim/ossimConfig.h.in
+++ /dev/null
@@ -1,20 +0,0 @@
-/*  $Id: ossimConfig.h.in 13607 2008-09-25 19:39:45Z gpotts $ */
-#ifndef ossimConfig_HEADER
-#define ossimConfig_HEADER
-
-/* Define to "1" if you have libz installed, "0" if not. */
-#define OSSIM_HAS_LIBZ @OSSIM_HAS_LIBZ@
-
-/* Define to "1" if you have MPI(lam/mpi), "0" if not. */
-#define OSSIM_HAS_MPI @OSSIM_HAS_MPI@
-
-/* Define to "1" if you have FREETYPE, "0" if not. */
-#define OSSIM_HAS_FREETYPE @OSSIM_HAS_FREETYPE@
-
-/* Define to "1" if you have GEOTIFF, "0" if not. */
-#define OSSIM_HAS_GEOTIFF @OSSIM_HAS_GEOTIFF@
-
-/* Enable cvs id strings for use with "ident" application. */
-#define OSSIM_ID_ENABLED @OSSIM_ID_ENABLED@
-
-#endif /* End of "#ifndef ossimConfig_HEADER" */
diff --git a/ossim/src/ossim/ossimVersion.h.in b/ossim/src/ossim/ossimVersion.h.in
deleted file mode 100644
index 48eef8c..0000000
--- a/ossim/src/ossim/ossimVersion.h.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef ossimVersion_HEADER
-#define ossimVersion_HEADER 1
-
-#define OSSIM_VERSION @OSSIM_VERSION_NUMBER@
-#define OSSIM_MAJOR_VERSION_NUMBER @OSSIM_MAJOR_VERSION_NUMBER@
-#define OSSIM_MINOR_VERSION_NUMBER @OSSIM_MINOR_VERSION_NUMBER@
-#define OSSIM_PATCH_VERSION_NUMBER @OSSIM_PATCH_VERSION_NUMBER@  
-#define OSSIM_RELEASE_NUMBER @OSSIM_RELEASE_NUMBER@  
-#define OSSIM_REVISION_NUMBER @OSSIM_REVISION_NUMBER@  
-
-// date format = (yyyymmdd)
-#define OSSIM_BUILD_DATE @OSSIM_BUILD_DATE@
-
-#endif /* End of #ifndef ossimVersion_HEADER */
diff --git a/ossim/src/ossim/parallel/makefile.vc b/ossim/src/ossim/parallel/makefile.vc
deleted file mode 100644
index 9393445..0000000
--- a/ossim/src/ossim/parallel/makefile.vc
+++ /dev/null
@@ -1,21 +0,0 @@
-###
-# $Id: makefile.vc 10188 2007-01-04 16:02:37Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimIgen.obj \
-ossimImageMpiMWriterSequenceConnection.obj \
-ossimImageMpiSWriterSequenceConnection.obj \
-ossimMpi.obj \
-ossimMpiMasterOverviewSequencer.obj \
-ossimMpiSlaveOverviewSequencer.obj \
-ossimOrthoIgen.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/parallel/ossimImageChainMtAdaptor.cpp b/ossim/src/ossim/parallel/ossimImageChainMtAdaptor.cpp
deleted file mode 100644
index e1e3139..0000000
--- a/ossim/src/ossim/parallel/ossimImageChainMtAdaptor.cpp
+++ /dev/null
@@ -1,459 +0,0 @@
-//*************************************************************************************************
-//                                            OSSIM
-//
-// License: MIT
-//
-// Author: Oscar Kramer
-//
-// This class supports multi-threading of image chain getTile() requests and associated chain
-// updating. It accepts an original ossimImageChain object which is then cloned (replicated). 
-// One replicant per thread is created (counting the original as replicant[0]), with all replicants
-// sharing a common input handler (if directed) so that disk access is serialized and thread-safe.
-//
-//*************************************************************************************************
-// $Id$
-
-#include <ossim/parallel/ossimImageChainMtAdaptor.h>
-#include <ossim/parallel/ossimMtDebug.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <iterator>
-
-static const char* NUM_THREADS_KW         = "ossimImageChainMtAdaptor.num_threads";
-static const char* ORIGINAL_SOURCE_ID_KW  = "ossimImageChainMtAdaptor.original_source_id";
-
-//*************************************************************************************************
-// Constructor.
-//*************************************************************************************************
-ossimImageChainMtAdaptor::ossimImageChainMtAdaptor()
-:  m_numThreads (0),
-   d_useSharedHandlers(false),
-   d_debugEnabled(false)
-{
-   //###### DEBUG ############
-   ossimMtDebug* mt_debug = ossimMtDebug::instance();
-   d_useSharedHandlers = mt_debug->chainSharedHandlers;
-   d_debugEnabled = mt_debug->chainDebugEnabled;
-   //###### END DEBUG ############
-}
-
-//*************************************************************************************************
-// Constructor with original image chain provided. This source becomes the first clone in the list.
-//*************************************************************************************************
-ossimImageChainMtAdaptor::ossimImageChainMtAdaptor(ossimImageChain* original,
-                                                   ossim_uint32 num_threads_req)
-:  m_numThreads (0),
-   d_useSharedHandlers(true),
-   d_debugEnabled(false)
-{
-   //###### DEBUG ############
-   ossimMtDebug* mt_debug = ossimMtDebug::instance();
-   d_useSharedHandlers = mt_debug->chainSharedHandlers;
-   d_debugEnabled = mt_debug->chainDebugEnabled;
-   //###### END DEBUG ############
-
-   setNumberOfThreads(num_threads_req); 
-   setOriginalChain(original); 
-}
-
-//*************************************************************************************************
-// Destructor.
-//*************************************************************************************************
-ossimImageChainMtAdaptor::~ossimImageChainMtAdaptor()
-{
-   removeListener((ossimConnectableObjectListener*)this);
-   m_clones.clear();
-   m_chainContainers.clear();
-}
-
-//*************************************************************************************************
-//! Alternate way of specifying number of threads to support. This is the same as the number of 
-//! clones that will be available after replicating the original chain.
-//*************************************************************************************************
-void ossimImageChainMtAdaptor::setNumberOfThreads(ossim_uint32 num_threads)
-{
-   if (m_numThreads == num_threads)
-      return;
-
-   // Determine number of cores/threads to set up:
-   if (num_threads > 0)
-   {
-      m_numThreads = num_threads;
-   }
-   else
-   {
-      // Look in ossim preferences if arg is provided above.
-      ossimString value = ossimPreferences::instance()->findPreference("ossim_threads");
-      if ( !value.empty() )
-         m_numThreads = value.toUInt32();
-   }
-
-   // If there is a valid original chain, we can perform the replication:
-   if (!m_chainContainers.empty())
-      replicate();
-}
-
-//*************************************************************************************************
-//! Alternate way of specifying the original chain being adapted for multi-threading.
-//*************************************************************************************************
-void ossimImageChainMtAdaptor::setOriginalChain(ossimImageChain* original)
-{
-   if (original == NULL)
-      return;
-
-   ossimImageSource* first_source = original->getFirstSource();
-   if (first_source == NULL)
-      return;
-
-   // Assign the adaptee and put it in the first position of the clones list:
-   m_adaptedChain = original;
-   m_clones.clear();
-   m_clones.push_back(first_source);
-
-   m_chainContainers.clear();
-   m_chainContainers.push_back(new ossimConnectableContainer);
-   m_adaptedChain->fillContainer(*m_chainContainers[0].get());
-
-   // If we know the number of threads, we can begin replicating:
-   if (m_numThreads > 1)
-      replicate();
-}
-
-//*************************************************************************************************
-// Creates clones of the original and pushes them onto the clone list.
-//
-// Need to consider the possibility that the original chain is a combiner with multiple image 
-// handler inputs, and also the possibility that one handler is wired to multiple input chains
-// before the combiner. In order to handle this, we will save the connection information for each 
-// input handler encountered so that we can later reproduce it using a shared handler (if requested)
-//*************************************************************************************************
-bool ossimImageChainMtAdaptor::replicate()
-{
-   if ((m_clones.empty()) || (m_numThreads == 0))
-      return false;
-
-   // Don't need to replicate if only one thread is being requested. This is not an error though:
-   if (m_numThreads == 1)
-      return true;
-
-   // If the handlers are to be shared, need to isolate them from the original chain and replace
-   // them with a "hollow adaptor" (i.e., a handler adaptor without the adaptee set yet:
-   m_sharedHandlers.clear();
-   if (d_useSharedHandlers)
-   {
-      if (m_chainContainers.empty())
-         return false;
-
-      // Collect all image handlers in original chain for possible sharing with all clones:
-      ossimTypeNameVisitor visitor (ossimString("ossimImageHandler"));
-      m_chainContainers[0]->accept(visitor);
-      ossimRefPtr<ossimImageHandler> handler = 0;
-      ossimRefPtr<ossimImageHandlerMtAdaptor> handler_adaptor = 0;
-      ossimRefPtr<ossimConnectableObject> output_connection = 0;
-      ossim_uint32 handler_idx = 0;
-
-      // Loop over all image handlers found in the original chain. Each handler's connection info
-      // is stored and the handler is removed temporarily from the original chain.
-      while (1) 
-      {
-         // Fetch a handler from the chain and wrap it with a handler adaptor:
-         handler = visitor.getObjectAs<ossimImageHandler>(handler_idx++);
-         if (handler == NULL)
-            break; // Only exit point of while loop
-         
-         handler_adaptor = new ossimImageHandlerMtAdaptor(handler.get());
-         m_sharedHandlers.push_back(handler_adaptor);
-
-         // Change ownership:
-         m_chainContainers[0]->removeChild(handler.get());
-         handler->changeOwner(this);
-      } 
-
-      // If no handler was found, we can't continue.
-      if (m_sharedHandlers.empty())
-         return false;
-   }
-
-   // Fetch the state of this and the original chain. This KWL will be used for creating replicas
-   // via the loadState. The saveState essentially bootstraps the replication task:
-   ossimKeywordlist kwl;
-   bool succeeded = saveState(kwl);
-
-   // The original chain may have had the handlers temporarily removed for the saveState in support
-   // of shared handlers. If so, need to restore them now:
-   if (d_useSharedHandlers)
-      succeeded = connectSharedHandlers(0);
-
-   // Finally, initialize THIS chain with the original chain's state. This call will also create
-   // the clones:
-   if (succeeded)
-      succeeded = loadState(kwl);
-
-   return succeeded;
-}
-
-//*************************************************************************************************
-// Deletes instances of all replicas from the clone list and leaves only the original.
-//*************************************************************************************************
-void ossimImageChainMtAdaptor::deleteReplicas()
-{
-   if (m_clones.size() > 1)
-   {
-      std::vector< ossimRefPtr<ossimImageSource> >::iterator first_copy = m_clones.begin();
-      first_copy++;
-      m_clones.erase(first_copy, m_clones.end());
-   }
-   m_numThreads = 1;
-}
-
-//*************************************************************************************************
-// Saves the state of the original chain along with number of clones present.
-//*************************************************************************************************
-bool ossimImageChainMtAdaptor::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   if (m_chainContainers.empty())
-      return false;
-
-   kwl.add(prefix, NUM_THREADS_KW, m_numThreads);
-   kwl.add(prefix, ORIGINAL_SOURCE_ID_KW, m_clones[0]->getId().getId());
-   
-   bool rtn_state = m_chainContainers[0]->saveState(kwl, prefix);
-
-   if (d_debugEnabled)
-      kwl.write("ossimImageChainMtAdaptor.kwl");
-
-   return rtn_state;
-}
-
-//*************************************************************************************************
-// Fetches the state of the original chain and regenerates the clones. Special handling is required
-// when the image handlers are to be shared among all clones.
-//*************************************************************************************************
-bool ossimImageChainMtAdaptor::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   bool succeeded;
-
-   // Reset this object:
-   deleteReplicas();
-
-   // Fetch this object's data members before moving onto original chain:
-   ossimString value = kwl.find(prefix, NUM_THREADS_KW);
-   if (value.empty())
-      return false;
-   m_numThreads = value.toUInt32();
-   if (m_numThreads == 0)
-      return false;
-
-   // The chain ID needs to be read from KWL:
-   ossimId orig_source_id (ossimId::INVALID_ID);
-   value = kwl.find(prefix, ORIGINAL_SOURCE_ID_KW);
-   if (value.empty())
-      return false;
-   orig_source_id.setId(value.toInt64());
-
-   // This loadState may be called for the purpose of replicating the existing original, or it can
-   // be intended as an adapter to a yet-to-be-instantiated original chain. Check if we already
-   // have a valid original chain:
-   ossimConnectableObject* candidate = 0;
-   ossimImageSource* original_source = 0;
-   if (!m_adaptedChain.valid() || m_chainContainers.empty())
-   {
-      m_chainContainers.clear();
-      m_chainContainers.push_back(new ossimConnectableContainer);
-      m_chainContainers[0]->loadState(kwl, prefix);
-
-      // Need to instantiate a new original. This is a bootstrap for a full initialization of this
-      // object. We'll need to replicate the clones afterwards:
-      ossimIdVisitor visitor (orig_source_id);
-      m_chainContainers[0]->accept(visitor);
-      candidate = visitor.getObject();
-      original_source = dynamic_cast<ossimImageSource*>(candidate);
-      if (original_source == NULL)
-         return false;
-      m_clones.push_back(original_source); // original is always in first position of clones list
-
-      // The original "chain" is morphed into a chain with a single child (original first source).
-      // This source is the one maintaining the connection to the rest of the sources in the real
-      // processing chain:
-      m_adaptedChain = new ossimImageChain;
-      m_adaptedChain->add(original_source);
-
-      // Now that we have an original chain, Recursive code to replicate clones:
-      succeeded = replicate();
-      if (!succeeded)
-         return false;
-   }
-
-   // We may be done:
-   if (m_numThreads == 1)
-      return true;
-
-   // In preparation for multi-threading jobs, loop to instantiate all clone chains. The container
-   // class is used to perform a deep copy of the original chain with all connections established.
-   // It would have been cleaner to just use the ossimImageChain::dup() but that method was not
-   // traversing the full chain, resulting in missing input sources:
-   succeeded = true;
-   for (ossim_uint32 i=1; (i<m_numThreads) && succeeded; ++i)
-   {
-      // Use original container's kwl to dup clone container, and pull out our chain of interest:
-      m_chainContainers.push_back(new ossimConnectableContainer);
-      m_chainContainers[i]->loadState(kwl, prefix);
-      
-      // Special handling required if the handlers are being shared. In this case, the handler had
-      // been removed from the original chain, so connections need to be identified and made:
-      if (d_useSharedHandlers)
-      {
-         succeeded = connectSharedHandlers(i);
-         if (!succeeded)
-            return false;
-      }
-
-      // Find the first (right-most) source in the chain and store it in the clone list. Need to
-      // Modify all IDs
-      ossimIdVisitor visitor (orig_source_id);
-      m_chainContainers[i]->accept(visitor);
-      candidate = visitor.getObject();
-      m_chainContainers[i]->makeUniqueIds();
-      ossimRefPtr<ossimImageSource> clone_source = dynamic_cast<ossimImageSource*>(candidate);
-      if (clone_source == NULL)
-         return false;
-      m_clones.push_back(clone_source);
-   }
-
-   return succeeded;
-}
-
-//*************************************************************************************************
-//! Adapts call to original chain so that all clones are initialized.
-//*************************************************************************************************
-void ossimImageChainMtAdaptor::initialize()
-{
-   for (size_t i=0; i<m_clones.size(); ++i)
-      m_clones[i]->initialize();
-}
-
-//*************************************************************************************************
-// Intercept this getTile because it should never be called directly. The tile request must go
-// to the specific chain clone.
-//*************************************************************************************************
-ossimRefPtr<ossimImageData> ossimImageChainMtAdaptor::getTile(const ossimIrect& tileRect,
-                                                                       ossim_uint32 resLevel)
-{
-   ossimNotify(ossimNotifyLevel_WARN)<<"ossimImageChainMtAdaptor::getTile() -- This method "
-      "Should never be called directly. The tile request must go to the specific chain clone. "
-      "Returning a tile using the original chain's getTile (not threaded)..."<<endl;
-   
-   if (!m_adaptedChain.valid())
-      return ossimRefPtr<ossimImageData>(0);
-      
-   return m_adaptedChain->getTile(tileRect, resLevel);
-}
-
-//*************************************************************************************************
-// Manages reconnecting shared image handlers to an image chain after its creation.
-// This is in support of shared image handlers. Returns TRUE if successful.
-//*************************************************************************************************
-bool ossimImageChainMtAdaptor::connectSharedHandlers(ossim_uint32 chain_index)
-{
-   if ((size_t)chain_index >= m_chainContainers.size())
-      return false;
-
-   // Loop over each adapted handler in our shared handler list:
-   SharedHandlerList::iterator handler = m_sharedHandlers.begin();
-   while (handler != m_sharedHandlers.end())
-   {
-      // Fetch all objects connected to this adapted handler. The list will point to objects in
-      // m_chainContainers[0], the original chain. The new chain's objects share the same ID's as
-      // the original chain for the moment. So we can search for the output connection 
-      // in the new chain using the ID of the corresponding object in the original chain:
-      ConnectableObjectList handler_connections = (*handler)->getOutputList();
-      ConnectableObjectList::iterator output_connection = handler_connections.begin();
-      while (output_connection != handler_connections.end())
-      {
-         ossimId obj_id = (*output_connection)->getId();
-         ossimIdVisitor visitor (obj_id);
-         m_chainContainers[chain_index]->accept(visitor);
-
-         // Get the pointer to the actual output object that needs to be connected to the shared
-         // handler:
-         ossimConnectableObject* output_obj = visitor.getObject();
-         if (output_obj == NULL)
-            return false; // Should never happen
-         output_obj->connectMyInputTo((*handler).get(), true, true);
-
-         output_connection++;
-      }
-      handler++;
-   }
-   return true;
-}
-
-
-//*************************************************************************************************
-// Adapts base class method for accessing connectables in the original chain.
-//*************************************************************************************************
-ossimConnectableObject::ConnectableObjectList& ossimImageChainMtAdaptor::imageChainList()
-{
-   // If there is no original chain defined, then just return our own blank list:
-   if (!m_adaptedChain.valid())
-      return theImageChainList;
-
-   return m_adaptedChain->imageChainList();
-}
-
-//*************************************************************************************************
-// Adapts base class method for accessing connectables in the original chain.
-//*************************************************************************************************
-const ossimConnectableObject::ConnectableObjectList& 
-   ossimImageChainMtAdaptor::imageChainList()const
-{
-   // If there is no original chain defined, then just return our own blank list:
-   if (!m_adaptedChain.valid())
-      return theImageChainList;
-
-   return m_adaptedChain->imageChainList();
-}
-
-//*************************************************************************************************
-//! Adapts the image chain event handler. If the event involves a change to the original image 
-//! chain, then the clones will need to be regenerated here.
-//*************************************************************************************************
-void ossimImageChainMtAdaptor::processEvent(ossimEvent& /* event */)
-{
-   ossimNotify(ossimNotifyLevel_WARN)<<"ossimImageChainMtAdaptor::processEvent() -- "
-      "NOT YET IMPLEMENTED"<<endl;
-}
-
-//*************************************************************************************************
-ossimImageSource* ossimImageChainMtAdaptor::getClone(ossim_uint32 index)
-{
-   if (index < (ossim_uint32) m_clones.size())
-      return m_clones[index].get();
-   
-   return 0;
-}
-
-//*************************************************************************************************
-//! Overrides base class implementation in order to make the connection to each clone. This 
-//! connection is typically to the multi-thread sequencer object.
-//*************************************************************************************************
-ossim_int32 ossimImageChainMtAdaptor::connectMyOutputTo(ossimConnectableObject* outputObject,
-                                                        bool makeInputConnection,
-                                                        bool createEventFlag)
-{
-   // Make output connection for each clone source:
-   std::vector< ossimRefPtr<ossimImageSource> >::iterator clone_source = m_clones.begin();
-   while (clone_source != m_clones.end())
-   {
-      (*clone_source)->connectMyOutputTo(outputObject, false, false);
-      clone_source++;
-   }
-
-   // Now make master connection including making input connection on outputObject and firing event:
-   return ossimConnectableObject::connectMyOutputTo(outputObject, 
-                                                    makeInputConnection, 
-                                                    createEventFlag);
-}
-
diff --git a/ossim/src/ossim/parallel/ossimImageHandlerMtAdaptor.cpp b/ossim/src/ossim/parallel/ossimImageHandlerMtAdaptor.cpp
deleted file mode 100644
index 929a45b..0000000
--- a/ossim/src/ossim/parallel/ossimImageHandlerMtAdaptor.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-//**************************************************************************************************
-//                          OSSIM -- Open Source Software Image Map
-//
-// LICENSE: See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-//! Intended mainly to provide a mechanism for mutex-locking access to a shared resource during
-//! a getTile operation on an ossimImageHandler. This is needed for multi-threaded implementation.
-// 
-//**************************************************************************************************
-//  $Id$
-#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/parallel/ossimMtDebug.h>
-#include <ossim/base/ossimTimer.h>
-
-RTTI_DEF1(ossimImageHandlerMtAdaptor, "ossimImageHandlerMtAdaptor", ossimImageHandler);
-
-const char* ossimImageHandlerMtAdaptor::ADAPTEE_ID_KW = "adaptee_id";
-
-//**************************************************************************************************
-// Constructor
-//**************************************************************************************************
-ossimImageHandlerMtAdaptor::ossimImageHandlerMtAdaptor(ossimImageHandler* adaptee)
-   :  d_getTileT (0),
-      m_adaptedHandler (0),
-      m_cache (0),
-      d_useCache (false),
-      d_useFauxTile (false)
-{
-   //###### DEBUG ############
-   ossimMtDebug* mt_debug = ossimMtDebug::instance();
-   d_useCache = mt_debug->handlerCacheEnabled;
-   d_useFauxTile = mt_debug->handlerUseFauxTile;
-   //###### END DEBUG ############
-
-   setAdaptee(adaptee);
-}
-
-//**************************************************************************************************
-// Destructor
-//**************************************************************************************************
-ossimImageHandlerMtAdaptor::~ossimImageHandlerMtAdaptor()
-{
-   m_adaptedHandler = 0;
-   m_cache = 0;
-}
-
-//**************************************************************************************************
-//! Sets the handler being adapted.
-//**************************************************************************************************
-void ossimImageHandlerMtAdaptor::setAdaptee(ossimImageHandler* handler)
-{
-   m_adaptedHandler = handler;
-   if (handler == NULL)
-      return;
-
-   // Fetch the adaptee's output list and make it our own:
-   ConnectableObjectList output_list = handler->getOutputList();
-
-   if (d_useCache)
-   {
-      // Create the cache and connect this adaptor as its output:
-      m_cache = new ossimCacheTileSource;
-      m_cache->connectMyOutputTo(this, true, false);
-      m_cache->changeOwner(this);
-      m_cache->connectMyOutputTo(this, true, false);
-      handler->disconnectMyOutputs(output_list, true, false);
-      handler->connectMyOutputTo(m_cache.get(), true, true);
-   }
-   else
-   {
-      handler->disconnectMyOutputs(output_list, true, false);
-      handler->connectMyOutputTo(this, true, false);
-   }
-
-   // Finally connect the adaptee's outputs to this and fire connection events:
-   connectMyOutputTo(output_list, true, true);
-   handler->changeOwner(this);
-
-   if (d_useFauxTile)
-   {
-      d_fauxTile = (ossimImageData*) handler->getTile(ossimIpt(0,0), 0)->dup();
-      //d_fauxTile = new ossimImageData(this, 
-      //                                handler->getOutputScalarType(), 
-      //                                handler->getNumberOfOutputBands(),
-      //                                handler->getTileWidth(),
-      //                                handler->getTileHeight());
-      //d_fauxTile->fill(128.0);
-   }
-}
-
-//**************************************************************************************************
-//! Only an ossimImageHandler is allowed as input here.
-//**************************************************************************************************
-bool ossimImageHandlerMtAdaptor::canConnectMyInputTo(ossim_int32 inputIndex,
-                                                     const ossimConnectableObject* obj) const
-{
-   const ossimImageHandler* h = dynamic_cast<const ossimImageHandler*>(obj);
-   if ((inputIndex == 0) && (h != NULL))
-      return true;
-   return false;
-}
-
-
-//**************************************************************************************************
-//! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
-//! adaptee's getTile call.
-//**************************************************************************************************
-ossimRefPtr<ossimImageData> 
-   ossimImageHandlerMtAdaptor::getTile(const ossimIpt& origin, ossim_uint32 rLevel)
-{
-   if (!m_adaptedHandler.valid())
-      return NULL;
-
-   // Establish tile rect to call overloaded getTile(tile_rect):
-   ossim_uint32 h = m_adaptedHandler->getTileHeight();
-   ossim_uint32 w = m_adaptedHandler->getTileWidth();
-   ossimIpt lr (origin.x + w - 1, origin.y + h - 1);
-   ossimIrect tile_rect (origin, lr);
-
-   // Need to unlock to prevent freezing in the called getTile():
-   return getTile(tile_rect, rLevel);
-}
-
-//**************************************************************************************************
-//! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
-//! adaptee's getTile call.
-//**************************************************************************************************
-ossimRefPtr<ossimImageData>  
-   ossimImageHandlerMtAdaptor::getTile(const ossimIrect& tile_rect, ossim_uint32 rLevel)
-{
-   if (d_useFauxTile)
-   {
-      ossimRefPtr<ossimImageData> ftile = new ossimImageData(*(d_fauxTile.get()));
-      ftile->setOrigin(tile_rect.ul());
-      return ftile;
-   }
-
-   if (!m_adaptedHandler.valid())
-      return NULL;
-
-   // The sole purpose of the adapter is this mutex lock around the actual handler getTile:
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
-
-   ossimRefPtr<ossimImageData> tile = new ossimImageData();
-   ossimRefPtr<ossimImageData> temp_tile = 0;
-   double dt = ossimTimer::instance()->time_s();
-   if (d_useCache)
-      temp_tile = m_cache->getTile(tile_rect, rLevel);
-   else
-      temp_tile = m_adaptedHandler->getTile(tile_rect, rLevel);
-   d_getTileT += ossimTimer::instance()->time_s() - dt;
-
-   // We make our own instance of a tile and copy the adaptee's returned tile to it. This avoids
-   // the product tile from changing while being processed up the chain. The adaptee's tile can
-   // change as soon as the mutex lock is released:
-   
-   if (temp_tile.valid())
-      *tile = *(temp_tile.get());
-   else
-      tile = NULL;
-   return tile;
-}
-
-//**************************************************************************************************
-//! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
-//! adaptee's getTile call.
-//**************************************************************************************************
-bool ossimImageHandlerMtAdaptor::getTile(ossimImageData* tile, ossim_uint32 rLevel)
-{
-   if ((!m_adaptedHandler.valid()) || (tile == NULL))
-      return false;
-
-   // The sole purpose of the adapter is this mutex lock around the actual handler getTile:
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
-
-   // This is effectively a copy of ossimImageSource::getTile(ossimImageData*). It is reimplemented 
-   // here to save two additional function calls:
-   tile->ref();
-   bool status = true;
-   ossimIrect tile_rect = tile->getImageRectangle();
-
-   ossimRefPtr<ossimImageData> temp_tile = 0;
-   if (d_useCache)
-      temp_tile = m_cache->getTile(tile_rect, rLevel);
-   else
-      temp_tile = m_adaptedHandler->getTile(tile_rect, rLevel);
-   
-   if (temp_tile.valid())
-      *tile = *(temp_tile.get());
-   else
-      status = false;
-   tile->unref();
-   
-   return status;
-}
-
-//**************************************************************************************************
-//! Method to save the state of an object to a keyword list.
-//! Return true if ok or false on error.
-//**************************************************************************************************
-bool ossimImageHandlerMtAdaptor::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   if (!m_adaptedHandler.valid())
-      return false;
-   
-   // Skip the ossimImageHandler::saveState() since it is not necessary here:
-   ossimImageSource::saveState(kwl, prefix);
-
-   kwl.add(prefix, ADAPTEE_ID_KW, m_adaptedHandler->getId().getId());
-
-   return true;
-}
-
-//**************************************************************************************************
-//! Method to the load (recreate) the state of an object from a keyword
-//! list.  Return true if ok or false on error.
-//**************************************************************************************************
-bool ossimImageHandlerMtAdaptor::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   m_adaptedHandler = 0;
-
-   // Skip the ossimImageHandler::loadState() since it is not necessary here:
-   if (!ossimImageSource::loadState(kwl, prefix))
-      return false;
-
-   // The adaptee's ID at least will be in the KWL:
-   ossimString value = kwl.find(prefix, ADAPTEE_ID_KW);
-   if (value.empty())
-      return false;
-   
-   return true;
-}
-
-//**************************************************************************************************
-// The following are virtuals in the base class. Implemented here as pass-through to adaptee
-//**************************************************************************************************
-ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfInputBands() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getNumberOfInputBands();
-   return 0;
-}
-
-bool ossimImageHandlerMtAdaptor::isOpen() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->isOpen();
-   return false;
-}
-
-bool ossimImageHandlerMtAdaptor::open()
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->open();
-   return false;
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfLines(ossim_uint32 resLevel) const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getNumberOfLines(resLevel);
-   return 0;
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfSamples(ossim_uint32 resLevel) const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getNumberOfSamples(resLevel);
-   return 0;
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getImageTileWidth() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getImageTileWidth();
-   return 0;
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getImageTileHeight() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getImageTileHeight();
-   return 0;
-}
-
-ossimString ossimImageHandlerMtAdaptor::getLongName() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getLongName();
-   return ossimString();
-}
-
-ossimString ossimImageHandlerMtAdaptor::getShortName() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getShortName();
-   return ossimString();
-}
-
-void ossimImageHandlerMtAdaptor::close()
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->close();
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfOutputBands() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getNumberOfOutputBands();
-   return 0;
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfDecimationLevels() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getNumberOfDecimationLevels();
-   return 0;
-}
-
-ossimScalarType ossimImageHandlerMtAdaptor::getOutputScalarType() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getOutputScalarType();
-   return OSSIM_SCALAR_UNKNOWN;
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getTileWidth() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getTileWidth();
-   return 0;
-}
-
-ossim_uint32 ossimImageHandlerMtAdaptor::getTileHeight() const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getTileHeight();
-   return 0;
-}
-
-ossim_float64 ossimImageHandlerMtAdaptor::getMinPixelValue(ossim_uint32 band) const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getMinPixelValue(band);
-   return 0.0;
-}
-
-ossim_float64 ossimImageHandlerMtAdaptor::getMaxPixelValue(ossim_uint32 band) const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getMaxPixelValue(band);
-   return 0.0;
-}
-
-ossim_float64 ossimImageHandlerMtAdaptor::getNullPixelValue(ossim_uint32 band) const
-{
-   if (m_adaptedHandler.valid())
-      return m_adaptedHandler->getNullPixelValue(band);
-   return 0.0;
-}
-
diff --git a/ossim/src/ossim/parallel/ossimImageMpiMWriterSequenceConnection.cpp b/ossim/src/ossim/parallel/ossimImageMpiMWriterSequenceConnection.cpp
deleted file mode 100644
index f53aba2..0000000
--- a/ossim/src/ossim/parallel/ossimImageMpiMWriterSequenceConnection.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// This class is specific to the Master connection and is optimized
-// for the writer sequence and batch processing chain.  For the Slave
-// implementation look for the ossimImageMpiSWriterSequenceConnection.cc and .h
-// files.  The Master connection is currently implemented to allways do
-// a recieve and does no processing itself.  The slave connection does
-// all the actual work and processing.
-//
-//*******************************************************************
-//  $Id: ossimImageMpiMWriterSequenceConnection.cpp 12099 2007-12-01 16:09:36Z dburken $
-
-
-#include <ossim/ossimConfig.h> /* To pick up OSSIM_HAS_MPI. */
-
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI
-#    include <mpi.h>
-#  endif
-#endif
-
-#include <ossim/parallel/ossimImageMpiMWriterSequenceConnection.h>
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimEndian.h>
-
-static ossimTrace traceDebug = ossimTrace("ossimImageMpiMWriterSequenceConnection:debug");
-
-RTTI_DEF1(ossimImageMpiMWriterSequenceConnection, "ossimImageMpiMWriterSequenceConnection", ossimImageSourceSequencer)
-
-
-ossimImageMpiMWriterSequenceConnection::ossimImageMpiMWriterSequenceConnection(
-   ossimImageSource* inputSource,
-   ossimObject* owner)
-   :ossimImageSourceSequencer(inputSource, owner),
-    theOutputTile(NULL)
-{
-   theRank = 0;
-   theNumberOfProcessors = 1;
-
-#ifdef OSSIM_HAS_MPI   
-#  if OSSIM_HAS_MPI
-   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
-   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
-#  endif
-#endif   
-
-   if(theRank!=0)
-   {
-      theCurrentTileNumber = theRank -1;
-   }
-   else
-   {
-      theCurrentTileNumber = 0;
-   }
-   theNeedToSendRequest = true;
-}
-
-ossimImageMpiMWriterSequenceConnection::ossimImageMpiMWriterSequenceConnection(ossimObject* owner)
-   :ossimImageSourceSequencer(NULL, owner),
-    theOutputTile(NULL)
-{
-   theRank = 0;
-   theNumberOfProcessors = 1;
-   
-#ifdef OSSIM_HAS_MPI     
-#  if OSSIM_HAS_MPI
-   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
-   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
-#  endif
-#endif
-   
-   if(theRank!=0)
-   {
-      theCurrentTileNumber = theRank -1;
-   }
-   else
-   {
-      theCurrentTileNumber = 0;
-   }
-   theNeedToSendRequest = true;
-}
-
-ossimImageMpiMWriterSequenceConnection::~ossimImageMpiMWriterSequenceConnection()
-{
-}
-
-void ossimImageMpiMWriterSequenceConnection::initialize()
-{
-  ossimImageSourceSequencer::initialize();
-
-  theCurrentTileNumber = theRank;//-1;
-  theOutputTile = NULL;
-  
-  if(theInputConnection)
-  {
-     theOutputTile = ossimImageDataFactory::instance()->create(this, this);
-     theOutputTile->initialize();
-  }
-}
-
-void ossimImageMpiMWriterSequenceConnection::setToStartOfSequence()
-{
-   ossimImageSourceSequencer::setToStartOfSequence();
-   if(theRank != 0)
-   {
-      // we will subtract one since the masters job is just
-      // writting and not issue getTiles.
-      theCurrentTileNumber = theRank-1;
-
-   }
-   else
-   {
-      // the master will start at 0
-      theCurrentTileNumber = 0;
-   }
-}
-
-/*!
- * Will allow you to get the next tile in the sequence.
- */
-ossimRefPtr<ossimImageData> ossimImageMpiMWriterSequenceConnection::getNextTile(ossim_uint32 resLevel)
-{
-#if OSSIM_HAS_MPI
-   ossimEndian endian;
-   if(!theOutputTile)
-   {
-      initialize();
-      if (!theOutputTile)
-      {
-         return theOutputTile;
-      }
-   }
-   
-   void* buf = theOutputTile->getBuf();
-
-   ossim_uint32 numberOfTiles = getNumberOfTiles();
-   int errorValue = 0;
-   
-   if(theCurrentTileNumber >= numberOfTiles)
-   {
-      return NULL;
-   }
-   errorValue = MPI_Recv(buf,
-                         theOutputTile->getSizeInBytes(),
-                         MPI_UNSIGNED_CHAR,
-                         theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                         0,
-                         MPI_COMM_WORLD,
-                         MPI_STATUS_IGNORE);
-   if((endian.getSystemEndianType()!=OSSIM_BIG_ENDIAN)&&
-      (theOutputTile->getScalarType()!=OSSIM_UINT8))
-   {
-      endian.swap(theOutputTile->getScalarType(),
-                  buf,
-                  theOutputTile->getSize());
-   }
-   
-#if 0
-   // Since MPI can run on different platforms
-   // I am not sure if MPI has built in byte
-   // swap.  If so I will name each datatype
-   // so it can handle byte swap.  Does anyone
-   // know if MPI does byte swapping.
-   switch(theOutputTile->getScalarType())
-   {
-      case OSSIM_UINT8:
-      {
-         // we add 1 to the rank so we don't wait on a message
-         // to ourself (rank = 0).
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_UNSIGNED_CHAR,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      case OSSIM_SINT8:
-      {
-         // we add 1 to the rank so we don't wait on a message
-         // to ourself (rank = 0).
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_CHAR,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      case OSSIM_UINT16:
-      case OSSIM_USHORT11:
-      {
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_UNSIGNED_SHORT,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_SHORT,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_LONG,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_UNSIGNED_LONG,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      case OSSIM_FLOAT32:
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_FLOAT,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      case OSSIM_FLOAT64:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         errorValue = MPI_Recv(buf,
-                               theOutputTile->getSize(),
-                               MPI_DOUBLE,
-                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
-                               0,
-                               MPI_COMM_WORLD,
-                               MPI_STATUS_IGNORE);
-         break;
-      }
-      default:
-      {
-         break;
-      }
-   }
-#endif
-   ossimIpt origin;
-   getTileOrigin(theCurrentTileNumber,
-                 origin);
-   theOutputTile->setOrigin(origin);
-   theOutputTile->validate();
-   ++theCurrentTileNumber;
-   return theOutputTile;
-#else
-   return ossimImageSourceSequencer::getNextTile(resLevel);
-#endif
-   
-}
diff --git a/ossim/src/ossim/parallel/ossimImageMpiSWriterSequenceConnection.cpp b/ossim/src/ossim/parallel/ossimImageMpiSWriterSequenceConnection.cpp
deleted file mode 100644
index 24cedc4..0000000
--- a/ossim/src/ossim/parallel/ossimImageMpiSWriterSequenceConnection.cpp
+++ /dev/null
@@ -1,350 +0,0 @@
-//----------------------------------------------------------------------------
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// $Id: ossimImageMpiSWriterSequenceConnection.cpp 17206 2010-04-25 23:20:40Z dburken $
-//----------------------------------------------------------------------------
-
-#include <ossim/ossimConfig.h> /* To pick up OSSIM_HAS_MPI. */
-
-#ifdef OSSIM_HAS_MPI
-#  if OSSIM_HAS_MPI
-#    include <mpi.h>
-#  endif
-#endif
-
-#include <ossim/parallel/ossimImageMpiSWriterSequenceConnection.h>
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-static ossimTrace traceDebug = ossimTrace("ossimImageMpiSWriterSequenceConnection:debug");
-
-RTTI_DEF1(ossimImageMpiSWriterSequenceConnection, "ossimImageMpiSWriterSequenceConnection", ossimImageSourceSequencer)
-
-ossimImageMpiSWriterSequenceConnection::ossimImageMpiSWriterSequenceConnection(ossimObject* owner,
-                                                                               long numberOfTilesToBuffer)
-   :ossimImageSourceSequencer(NULL,
-                              owner),
-    theNumberOfTilesToBuffer(numberOfTilesToBuffer),
-    theOutputTile(NULL)
-{
-   theRank = 0;
-   theNumberOfProcessors = 1;
-   theNumberOfTilesToBuffer = ((theNumberOfTilesToBuffer>0)?theNumberOfTilesToBuffer:2);
-
-#ifdef OSSIM_HAS_MPI   
-#  if OSSIM_HAS_MPI
-   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
-   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
-#  endif
-#endif
-   
-   if(theRank!=0)
-   {
-      theCurrentTileNumber = theRank -1;
-   }
-   else
-   {
-      theCurrentTileNumber = 0;
-   }
-}
-
-ossimImageMpiSWriterSequenceConnection::ossimImageMpiSWriterSequenceConnection(ossimImageSource* inputSource,
-                                                                               ossimObject* owner,
-                                                                               long numberOfTilesToBuffer)
-   :ossimImageSourceSequencer(inputSource,
-                                 owner),
-    theNumberOfTilesToBuffer(numberOfTilesToBuffer),
-    theOutputTile(NULL)
-{
-   theRank = 0;
-   theNumberOfProcessors = 1;
-   theNumberOfTilesToBuffer = ((theNumberOfTilesToBuffer>0)?theNumberOfTilesToBuffer:2);
-#if OSSIM_HAS_MPI
-   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
-   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
-#endif
-   if(theRank!=0)
-   {
-      theCurrentTileNumber = theRank -1;
-   }
-   else
-   {
-      theCurrentTileNumber = 0;
-   }   
-}
-
-ossimImageMpiSWriterSequenceConnection::~ossimImageMpiSWriterSequenceConnection()
-{   
-   deleteOutputTiles();
-}
-
-void ossimImageMpiSWriterSequenceConnection::deleteOutputTiles()
-{
-   if(theOutputTile)
-   {
-      delete [] theOutputTile;
-      theOutputTile = NULL;
-   }
-}
-
-void ossimImageMpiSWriterSequenceConnection::initialize()
-{
-  ossimImageSourceSequencer::initialize();
-
-  theCurrentTileNumber = theRank-1;
-  if(theOutputTile)
-  {
-     deleteOutputTiles();
-  }
-  
-  if(theInputConnection)
-  {
-     theOutputTile = new ossimRefPtr<ossimImageData>[theNumberOfTilesToBuffer];
-     
-     for(long index = 0; index < theNumberOfTilesToBuffer; ++index)
-     {
-        theOutputTile[index] = ossimImageDataFactory::instance()->create(this,
-                                                                         this);
-        theOutputTile[index]->initialize();
-     }
-  }
-}
-
-void ossimImageMpiSWriterSequenceConnection::setToStartOfSequence()
-{
-   ossimImageSourceSequencer::setToStartOfSequence();
-   if(theRank != 0)
-   {
-      // we will subtract one since the masters job is just
-      // writting and not issue getTiles.
-      theCurrentTileNumber = theRank-1;
-
-   }
-   else
-   {
-      // the master will start at 0
-      theCurrentTileNumber = 0;
-   }
-}
-
-void ossimImageMpiSWriterSequenceConnection::slaveProcessTiles()
-{
-#ifdef OSSIM_HAS_MPI 
-#  if OSSIM_HAS_MPI
-   ossimEndian endian;
-   ossim_uint32 numberOfTiles    = getNumberOfTiles();
-   long currentSendRequest = 0;
-   long numberOfTilesSent  = 0;
-   int errorValue= 0;
-   MPI_Request *requests   = new MPI_Request[theNumberOfTilesToBuffer];
-   for (int i = 0; i < theNumberOfTilesToBuffer; ++i)
-   {
-      requests[i] = MPI_REQUEST_NULL;
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): entering slave and will look at " << numberOfTiles << " tiles" << std::endl;
-   }
-   while(theCurrentTileNumber < numberOfTiles)
-   {
-      ossimRefPtr<ossimImageData> data = ossimImageSourceSequencer::getTile(theCurrentTileNumber);
-
-      // if the current send requests have looped around
-      // make sure we wait to see if it was sent
-      //
-      errorValue = MPI_Wait(&requests[currentSendRequest], MPI_STATUS_IGNORE);
-      requests[currentSendRequest] = MPI_REQUEST_NULL;
-      if(data.valid() &&
-         (data->getDataObjectStatus()!=OSSIM_NULL)&&
-         (data->getDataObjectStatus()!=OSSIM_EMPTY))
-      {
-         theOutputTile[currentSendRequest]->setImageRectangle(data->getImageRectangle());
-         theOutputTile[currentSendRequest]->initialize();
-         
-         theOutputTile[currentSendRequest]->loadTile(data.get());
-         theOutputTile[currentSendRequest]->setDataObjectStatus(data->getDataObjectStatus());
-
-         if(traceDebug())
-         {
-            if(data->getDataObjectStatus() == OSSIM_EMPTY)
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In salve = "
-                  << theRank << " tile is empty" << std::endl;
-            }
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            if(!data)
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In slave = "
-                  << theRank << " ptr is null " << std::endl;
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In slave = " << theRank << " tile is empty" << std::endl;
-            }
-         }
-         theOutputTile[currentSendRequest]->makeBlank();
-      }
-
-      void* buf = theOutputTile[currentSendRequest]->getBuf();
-      if((endian.getSystemEndianType()!=OSSIM_BIG_ENDIAN)&&
-         (theOutputTile[currentSendRequest]->getScalarType()!=OSSIM_UINT8))
-      {
-         endian.swap(theOutputTile[currentSendRequest]->getScalarType(),
-                     buf,
-                     theOutputTile[currentSendRequest]->getSize());
-      }
-      errorValue = MPI_Isend(buf,
-                             theOutputTile[currentSendRequest]->getSizeInBytes(),
-                             MPI_UNSIGNED_CHAR,
-                             0,
-                             0,
-                             MPI_COMM_WORLD,
-                             &requests[currentSendRequest]);
-#if 0      
-      switch(theOutputTile[currentSendRequest]->getScalarType())
-      {
-         case OSSIM_UINT8:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_UNSIGNED_CHAR,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         case OSSIM_SINT8:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_CHAR,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         case OSSIM_UINT16:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_UNSIGNED_SHORT,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         case OSSIM_SINT16:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_SHORT,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         case OSSIM_UINT32:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_UNSIGNED_LONG,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         case OSSIM_SINT32:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_LONG,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         case OSSIM_FLOAT32:
-         case OSSIM_NORMALIZED_FLOAT:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_FLOAT,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         case OSSIM_FLOAT64:
-         case OSSIM_NORMALIZED_DOUBLE:
-         {
-            errorValue = MPI_Isend(buf,
-                                    theOutputTile[currentSendRequest]->getSize(),
-                                    MPI_DOUBLE,
-                                    0,
-                                    0,
-                                    MPI_COMM_WORLD,
-                                    &requests[currentSendRequest]);
-            break;
-         }
-         default:
-            break;
-      }
-#endif
-      theCurrentTileNumber += (theNumberOfProcessors-1);
-      numberOfTilesSent++;
-      currentSendRequest++;
-      currentSendRequest %= theNumberOfTilesToBuffer;
-   }
-   ossim_int32 tempCount = 0;
-   // must wait in the correct order
-   //
-   while(tempCount < theNumberOfTilesToBuffer)
-   {
-      currentSendRequest++;
-      currentSendRequest %= theNumberOfTilesToBuffer;
-      
-      errorValue = MPI_Wait(&requests[currentSendRequest], MPI_STATUS_IGNORE);
-      ++tempCount;
-   }
-   
-//   MPI_Waitall(theNumberOfTilesToBuffer,
-//               requests,
-//               MPI_STATUS_IGNORE);
-   
-   delete [] requests;
-#  endif
-#endif
-}
-
-
-ossimRefPtr<ossimImageData> ossimImageMpiSWriterSequenceConnection::getNextTile(
-   ossim_uint32 /* resLevel */)
-{
-   ossimNotify(ossimNotifyLevel_FATAL)
-      << "FATAL ossimImageMpiSWriterSequenceConnection::getNextTile(): "
-      << "should not be called" << std::endl;
-   return ossimRefPtr<ossimImageData>();
-}
-
diff --git a/ossim/src/ossim/parallel/ossimJobThreadQueue.cpp b/ossim/src/ossim/parallel/ossimJobThreadQueue.cpp
deleted file mode 100644
index c1f4828..0000000
--- a/ossim/src/ossim/parallel/ossimJobThreadQueue.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-#include<ossim/parallel/ossimJobThreadQueue.h>
-
-ossimJobThreadQueue::ossimJobThreadQueue(ossimJobQueue* jqueue)
-:m_doneFlag(false)
-{
-   setJobQueue(jqueue);    
-}
-void ossimJobThreadQueue::setJobQueue(ossimJobQueue* jqueue)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   
-   if (m_jobQueue == jqueue) return;
-   
-   if(isRunning())
-   {
-      ossimRefPtr<ossimJobQueue> jobQueueTemp = m_jobQueue;
-      m_jobQueue = jqueue;
-      if(jobQueueTemp.valid())
-      {
-         jobQueueTemp->releaseBlock();
-      }
-   }
-   else 
-   {
-      m_jobQueue = jqueue;
-   }
-   
-   startThreadForQueue();
-}
-
-ossimJobQueue* ossimJobThreadQueue::getJobQueue() 
-{ 
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   return m_jobQueue.get(); 
-}
-
-const ossimJobQueue* ossimJobThreadQueue::getJobQueue() const 
-{ 
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   return m_jobQueue.get(); 
-}
-
-ossimRefPtr<ossimJob> ossimJobThreadQueue::currentJob() 
-{ 
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   return m_currentJob; 
-}
-
-void ossimJobThreadQueue::cancelCurrentJob()
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   if(m_currentJob.valid())
-   {
-      m_currentJob->cancel();
-   }
-}
-bool ossimJobThreadQueue::isValidQueue()const
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   return m_jobQueue.valid();
-}
-
-void ossimJobThreadQueue::run()
-{
-   bool firstTime = true;
-   bool validQueue = true;
-   ossimRefPtr<ossimJob> job;
-   do
-   {
-      // osg::notify(osg::NOTICE)<<"In thread loop "<<this<<std::endl;
-      validQueue = isValidQueue();
-      job = nextJob();
-      if (job.valid()&&!m_doneFlag)
-      {
-         {
-            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-            m_currentJob = job;
-         }
-         
-         // if the job is ready to execute
-         if(job->isReady())
-         {
-            job->resetState(ossimJob::ossimJob_RUNNING);
-            job->start();
-         }
-         {            
-            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-            m_currentJob = 0;
-         }
-         job->setState(ossimJob::ossimJob_FINISHED);
-         job = 0;
-      }
-      
-      if (firstTime)
-      {
-         // do a yield to get round a peculiar thread hang when testCancel() is called 
-         // in certain cirumstances - of which there is no particular pattern.
-         YieldCurrentThread();
-         firstTime = false;
-      }
-   } while (!m_doneFlag&&validQueue);
-   
-   if(job.valid()&&m_doneFlag&&job->isReady())
-   {
-      {            
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-         m_currentJob = 0;
-      }
-      job->cancel();
-   }
-   {            
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-      m_currentJob = 0;
-   }
-   job = 0;
-}
-
-void ossimJobThreadQueue::setDone(bool done)
-{
-   m_threadMutex.lock();
-   if (m_doneFlag==done)
-   {
-      m_threadMutex.unlock();
-      return;
-   }
-   m_doneFlag = done;
-   m_threadMutex.unlock();
-   if(done)
-   {
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-         if (m_currentJob.valid())
-            m_currentJob->release();
-      }
-      
-      if (m_jobQueue.valid())
-         m_jobQueue->releaseBlock();
-   }
-}
-
-bool ossimJobThreadQueue::isDone() const 
-{ 
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   return m_doneFlag; 
-}
-
-bool ossimJobThreadQueue::isProcessingJob()const
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   return m_currentJob.valid();
-}
-
-int ossimJobThreadQueue::cancel()
-{
-   
-   if( isRunning() )
-   {
-      {
-         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-         m_doneFlag = true;
-         if (m_currentJob.valid())
-         {
-            m_currentJob->cancel();
-         }
-         
-         if (m_jobQueue.valid()) 
-         {
-            m_jobQueue->releaseBlock();
-         }
-      }
-      
-      // then wait for the the thread to stop running.
-      while(isRunning())
-      {
-#if 1
-         {
-            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-            
-            if (m_jobQueue.valid()) 
-            {
-               m_jobQueue->releaseBlock();
-            }
-         }
-#endif
-         OpenThreads::Thread::YieldCurrentThread();
-      }
-   }
-   return OpenThreads::Thread::cancel();
-}
-
-bool ossimJobThreadQueue::isEmpty()const
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-   return m_jobQueue->isEmpty();
-}
-
-ossimJobThreadQueue::~ossimJobThreadQueue()
-{
-   cancel();
-}
-
-void ossimJobThreadQueue::startThreadForQueue()
-{
-   if(m_jobQueue.valid())
-   {
-      if(!isRunning())
-      {
-         start();
-         while(!isRunning()) // wait for the thread to start running
-         {
-            OpenThreads::Thread::YieldCurrentThread();
-         }
-      }
-   }
-}
-
-bool ossimJobThreadQueue::hasJobsToProcess()const
-{
-   bool result = false;
-   {
-      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
-      result = !m_jobQueue->isEmpty()||m_currentJob.valid();
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimJob> ossimJobThreadQueue::nextJob()
-{
-   ossimRefPtr<ossimJob> job;
-   m_threadMutex.lock();
-   ossimRefPtr<ossimJobQueue> jobQueue = m_jobQueue;
-   bool checkIfValid = !m_doneFlag&&jobQueue.valid();
-   m_threadMutex.unlock();
-   if(checkIfValid)
-   {
-      return jobQueue->nextJob(true);
-   }
-   return 0;
-}
diff --git a/ossim/src/ossim/parallel/ossimMpi.cpp b/ossim/src/ossim/parallel/ossimMpi.cpp
deleted file mode 100644
index 2271485..0000000
--- a/ossim/src/ossim/parallel/ossimMpi.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimMpi.cpp 23002 2014-11-24 17:11:17Z dburken $
-
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <time.h>
-#if OSSIM_HAS_MPI
-#  include <mpi.h>
-#endif
-
-#if OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimMpi.cpp 23002 2014-11-24 17:11:17Z dburken $";
-#endif
-
-static ossimTrace traceDebug = ossimTrace("ossimMpi:debug");
-
-ossimMpi* ossimMpi::theInstance=0;
-
-ossimMpi* ossimMpi::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimMpi;
-   }
-   
-   return theInstance;
-}
-
-bool ossimMpi::isEnabled()const
-{
-   return theEnabledFlag;
-}
-
-void ossimMpi::barrier()
-{
-#if OSSIM_HAS_MPI
-   if(theEnabledFlag)
-   {
-      // Blocks until all processes have reached this routine.
-      MPI_Barrier( MPI_COMM_WORLD );
-   }
-#endif
-}
-
-ossim_float64 ossimMpi::getTime()const
-{
-#if OSSIM_HAS_MPI
-   if(theEnabledFlag)
-   {
-      return MPI_Wtime();
-   }
-   else
-   {
-      return time(0);
-   }
-#else
-   return time(0);
-#endif
-}
-
-#if OSSIM_HAS_MPI
-void ossimMpi::initialize(int* argc, char*** argv)
-{
-   int success=0;
-   success = MPI_Init(argc, argv);
-   if(success == MPI_SUCCESS)
-   {
-      theEnabledFlag = true;
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimMpi::initialize\n"
-            << "MPI is initialized and running with "
-            << getNumberOfProcessors()
-            << " processors..."
-            << std::endl;
-      }
-   }
-   else
-   {
-      theEnabledFlag = false;
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimMpi::initialize:  MPI is not initialized."
-            << std::endl;
-      }
-   }
-}
-#else
-void ossimMpi::initialize(int* argc, char*** /* argv */)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimMpi::initialize: Not compiled with mpi!"
-         << std::endl;
-   }
-}
-#endif
-
-void ossimMpi::setEnabledFlag(bool flag)
-{
-   theEnabledFlag = flag;
-}
-
-void ossimMpi::finalize()
-{
-#if OSSIM_HAS_MPI
-   if(theEnabledFlag)
-   {
-      int success;
-      success = MPI_Finalize();
-      if(traceDebug())
-      {
-         if(success == MPI_SUCCESS)
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "DEBUG ossimMpi::finalize(): mpi is finalized" << std::endl;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "DEBUG ossimMpi::finalize(): "
-               << "mpi is not finalized successfully" << std::endl;
-         }
-      }
-   }
-#endif
-}
-
-int ossimMpi::getRank()const
-{
-   int result = 0;
-
-#if OSSIM_HAS_MPI
-   if(theEnabledFlag)
-   {
-      MPI_Comm_rank(MPI_COMM_WORLD, &result);
-   }
-#endif
-   
-   return result;
-}
-
-int ossimMpi::getNumberOfProcessors()const
-{
-   int result = 1;
-
-#if OSSIM_HAS_MPI
-   if(theEnabledFlag)
-   {
-      MPI_Comm_size(MPI_COMM_WORLD, &result);
-   }
-#endif
-
-   return result;
-}
-
-ossimMpi::ossimMpi()
-   : theEnabledFlag(false)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimMpi::ossimMpi entered..."
-         << std::endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID = " << OSSIM_ID << std::endl;
-#endif
-   }
-}
-
-ossimMpi::ossimMpi(const ossimMpi& obj)
-   : theEnabledFlag(obj.theEnabledFlag)
-{}
-
-void ossimMpi::operator=(const ossimMpi& rhs)
-{
-   theEnabledFlag = rhs.theEnabledFlag; 
-}
diff --git a/ossim/src/ossim/parallel/ossimMultiThreadSequencer.cpp b/ossim/src/ossim/parallel/ossimMultiThreadSequencer.cpp
deleted file mode 100644
index 56edd13..0000000
--- a/ossim/src/ossim/parallel/ossimMultiThreadSequencer.cpp
+++ /dev/null
@@ -1,441 +0,0 @@
-//**************************************************************************************************
-//                          OSSIM -- Open Source Software Image Map
-//
-// LICENSE: See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-//! This class manages the sequencing of tile requests across multiple threads. Note that multi-
-//! threading can only be achieved through the use of getNextTile() method for sequencing. 
-//! Conventional getTiles will not be multi-threaded.
-// 
-//**************************************************************************************************
-//  $Id$
-
-#include <ossim/parallel/ossimMultiThreadSequencer.h>
-#include <ossim/parallel/ossimMtDebug.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimTimer.h>
-
-static const ossim_uint32 DEFAULT_MAX_TILE_CACHE_FACTOR = 8; // Must be > 1
-
-ossimMtDebug* ossimMtDebug::m_instance = NULL;
-
-//*************************************************************************************************
-// Job's start method performs actual getTile in a thread on cloned chain and saves the result
-// in the sequencer's results cache.
-//*************************************************************************************************
-void ossimMultiThreadSequencer::ossimGetTileJob::start()
-{
-   running();
-   if (m_sequencer.d_debugEnabled)
-   {
-      ostringstream s1;
-      s1<<"THREAD #"<<m_chainID<<" -- Starting tile/job #"<<m_tileID;
-      m_sequencer.print(s1);
-   }
-
-   // Figure out the rect for this tile. Only process if rect is valid:
-   ossimIrect tileRect;
-   if (m_sequencer.getTileRect(m_tileID, tileRect))
-   {
-      // Perform the getTile and save the result:
-      ossimRefPtr<ossimImageData> tile = 0;
-      ossimImageSource* source = m_sequencer.m_inputChain->getClone(m_chainID);
-      double dt = ossimTimer::instance()->time_s(); //###
-
-      if (source != NULL)
-         tile = source->getTile(tileRect);
-      if (!tile.valid())
-      {
-         tile = m_sequencer.theBlankTile;
-         tile->setImageRectangle(tileRect);
-      }
-      dt = ossimTimer::instance()->time_s() - dt; //###
-
-      // Give the sequencer the tile. Execution may pause here while waiting for space to free up
-      // if the cache is full.
-      m_sequencer.setTileInCache(m_tileID, (ossimImageData*)tile->dup(), m_chainID, dt);
-   }
-
-   // Unblock the main thread which might be blocked waiting for jobs to finish:
-   m_sequencer.m_getTileBlock.release();
-
-   // Queue the next job using this job's freed-up image chain:
-   if (t_launchNewJob)
-      m_sequencer.nextJob(m_chainID);
-
-   finished();
-   
-   if (m_sequencer.d_debugEnabled)
-   {
-      ostringstream s2;
-      s2<<"THREAD #"<<m_chainID<<" -- Finished tile/job #"<<m_tileID;
-      m_sequencer.print(s2);
-   }
-}
-
-//*************************************************************************************************
-// Constructor
-//*************************************************************************************************
-ossimMultiThreadSequencer::ossimMultiThreadSequencer(ossimImageSource* input, 
-                                                     ossim_uint32 num_threads,
-                                                     ossimObject* owner)
-   : ossimImageSourceSequencer(input, owner),
-   d_maxCacheUsed(0),
-   d_cacheEmptyCount(0), 
-   d_idleTime1(0.0),     
-   d_idleTime2(0.0),     
-   d_idleTime3(0.0),     
-   d_idleTime4(0.0),     
-   d_idleTime5(0.0),     
-   d_idleTime6(0.0),
-   d_jobGetTileT(0.0),
-   m_inputChain(0),
-   m_jobMtQueue(0),
-   m_numThreads (num_threads),
-   m_callback(new ossimGetTileCallback()),
-   m_nextTileID (0),
-   m_tileCache(),                       
-   m_maxCacheSize (DEFAULT_MAX_TILE_CACHE_FACTOR * num_threads),
-   m_maxTileCacheFactor (DEFAULT_MAX_TILE_CACHE_FACTOR),
-   m_cacheMutex(),
-   m_jobMutex(),
-   m_totalNumberOfTiles(0),
-   m_getTileBlock(),
-   m_nextJobBlock(),
-   d_printMutex(),
-   d_timerMutex(),                                 
-   d_debugEnabled(false),
-   d_timedBlocksDt(0),
-   d_timeMetricsEnabled(false),
-   d_t1(0.0)                              
-{
-   //###### DEBUG ############
-   ossimMtDebug* mt_debug = ossimMtDebug::instance();
-   if (mt_debug->maxTileCacheSize != 0)
-      m_maxCacheSize =  mt_debug->maxTileCacheSize;
-   d_debugEnabled = mt_debug->seqDebugEnabled;
-   d_timedBlocksDt = mt_debug->seqTimedBlocksDt;
-   d_timeMetricsEnabled = mt_debug->seqMetricsEnabled;
-   //###### END DEBUG ############
-
-   // The base-class' initialize() method should have been called by the base class constructor
-   // unless somebody moved it!
-   OpenThreads::Thread::Init();
-   m_nextJobBlock.release();
-   m_getTileBlock.release();
-   ossimTimer::instance()->setStartTick();
-}
-
-//*************************************************************************************************
-// Destructor
-//*************************************************************************************************
-ossimMultiThreadSequencer::~ossimMultiThreadSequencer()
-{
-}
-
-//*************************************************************************************************
-//! Overrides base class in order to implement multi-threaded tile requests. 
-//*************************************************************************************************
-void ossimMultiThreadSequencer::setToStartOfSequence()
-{
-   // Reset important indices:
-   theCurrentTileNumber = 0;
-   m_nextTileID = 0;
-   m_totalNumberOfTiles = theNumberOfTilesHorizontal * theNumberOfTilesVertical;
-
-   //! The base class should have successfully assigned its input:
-   if (theInputConnection ==  NULL)
-      return;
-
-   // Check if this param was already set externally. Query the system capability if not:
-   if (m_numThreads == 0)
-   {
-      m_numThreads = 2 * ossim::getNumberOfThreads();
-      m_maxCacheSize = m_maxTileCacheFactor * m_numThreads;
-   }
-
-   // Adapt the input source to be an ossimImageChainMtAdaptor since we can only work
-   // with this type:
-   m_inputChain = dynamic_cast<ossimImageChainMtAdaptor*>(theInputConnection);
-   if (m_inputChain.valid())
-   {
-      m_inputChain->setNumberOfThreads(m_numThreads);
-   }
-   else
-   {
-      // Need to adapt input. First, is it a chain?
-      ossimImageChain* chain = dynamic_cast<ossimImageChain*>(theInputConnection);
-      if (chain == NULL)
-      {
-         // The input is just a common image source. Make it a chain:
-         chain = new ossimImageChain;
-         chain->add(theInputConnection);
-      }
-
-      // This instantiation creates a set of cloned image chains, one per thread, that will be
-      // accessed in parallel for the getTile() operation:
-      m_inputChain = new ossimImageChainMtAdaptor(chain, m_numThreads);
-   }
-
-   // Set the output of the chain to be this sequencer:
-   m_inputChain->disconnectAllOutputs();
-   //connectMyInputTo(m_inputChain.get());
-   //setAreaOfInterest(m_inputChain->getBoundingRect());
-
-   //// EXPERIMENTAL -- Fetch the first N tiles sequentially:
-   for (ossim_uint32 i=0; i<m_numThreads; ++i)
-   {
-      ossimGetTileJob* job = new ossimGetTileJob(m_nextTileID++, i, *this);
-      job->setCallback(m_callback.get());
-      job->t_launchNewJob = false;
-      job->start();
-   }
-
-   // Set up the job queue and fill it with first N jobs:
-   ossim_uint32 num_jobs_to_launch =  min<ossim_uint32>(m_numThreads, m_totalNumberOfTiles);
-   ossimRefPtr<ossimJobQueue> jobQueue = new ossimJobQueue();
-   for (ossim_uint32 chain_id=0; chain_id<num_jobs_to_launch; ++chain_id)
-   {
-      if (d_debugEnabled)
-      {
-         ostringstream s;
-         s<<"setToStartOfSequence() -- Creating tile/job #"<<m_nextTileID;
-         print(s);
-      }
-
-      ossimGetTileJob* job = new ossimGetTileJob(m_nextTileID++, chain_id, *this);
-      job->setCallback(m_callback.get());
-      jobQueue->add(job, false);
-   }
-
-   // Initialize the multi-thread queue. Note the setQueue is done after construction as it was 
-   // crashing do to jobs being launched during init:
-   m_jobMtQueue = new ossimJobMultiThreadQueue(0, num_jobs_to_launch);
-   m_jobMtQueue->setQueue(jobQueue.get());
-}
-
-
-//*************************************************************************************************
-//! Overrides base class in order to implement multi-threaded tile requests. The output tile 
-//! should be available in the tile cache, otherwise, method waits until it becomes available.
-//*************************************************************************************************
-ossimRefPtr<ossimImageData> ossimMultiThreadSequencer::getNextTile(ossim_uint32 /*resLevel*/)
-{
-   if (!m_inputChain.valid())
-      return NULL;
-
-   // May need to initiate the threaded sequencing if not already done:
-   if (m_nextTileID == 0)
-      setToStartOfSequence();
-
-   // Terminate with null return if done:
-   ossimRefPtr<ossimImageData> tile = 0;
-   if (theCurrentTileNumber >= m_totalNumberOfTiles)
-   {
-      return tile;
-   }
-
-   // May need to wait until the corresponding job is finished if the tile is not in the cache:
-   TileCache::iterator tile_iter = m_tileCache.begin();
-   while (!tile.valid()) 
-   {
-      // If the tile is not yet copied into the cache, it means the job is still running. Let's 
-      // block this thread and let the getTile jobs unlock as they finish. We'll exit this loop
-      // when the job of interest finishes.
-      if (d_timeMetricsEnabled)
-         d_t1 = ossimTimer::instance()->time_s(); 
-      m_cacheMutex.lock();
-      if (d_timeMetricsEnabled)
-         d_idleTime1 += ossimTimer::instance()->time_s() - d_t1; 
-
-      tile_iter = m_tileCache.find(theCurrentTileNumber);
-      m_cacheMutex.unlock();
-
-      if (tile_iter == m_tileCache.end())
-      {
-         if (d_debugEnabled)
-         {
-            ostringstream s1;
-            s1<<"getNextTile() -- Waiting on tile #"<<theCurrentTileNumber;
-            m_cacheMutex.lock();
-            s1<<"\n   cache size = "<<m_tileCache.size();
-            TileCache::iterator iter = m_tileCache.begin();
-            while(iter != m_tileCache.end())
-            {
-               s1<<"\n   cache.tile_id = "<<iter->first;
-               iter++;
-            }
-            m_cacheMutex.unlock();
-            print(s1);
-         }
-
-         if (d_timedBlocksDt > 0)
-            m_getTileBlock.block(d_timedBlocksDt); 
-         else
-         {
-            m_getTileBlock.reset();
-            if (d_timeMetricsEnabled)
-               d_t1 = ossimTimer::instance()->time_s(); 
-            m_getTileBlock.block();
-            if (d_timeMetricsEnabled)
-               d_idleTime2 += ossimTimer::instance()->time_s() - d_t1; 
-         }
-      }
-      else
-      {
-         // A valid tile was found. Need to assign the output tile and free up the reference in the
-         // cache:
-         if (d_debugEnabled)
-         {
-            ostringstream s2;
-            s2<<"getNextTile() -- Copying tile #"<<theCurrentTileNumber<<".  Cache size: "<<m_tileCache.size();
-            print(s2);
-         }
-         tile = tile_iter->second;
-         
-         if (d_timeMetricsEnabled)
-            d_t1 = ossimTimer::instance()->time_s(); 
-         m_cacheMutex.lock();
-         m_tileCache.erase(tile_iter);
-         m_cacheMutex.unlock();
-         if (d_timeMetricsEnabled)
-            d_idleTime3 += ossimTimer::instance()->time_s() - d_t1; 
-
-         if (m_tileCache.empty()) 
-            ++d_cacheEmptyCount; 
-         m_nextJobBlock.release(); // nextJob() may be blocked until cache space is freed
-      }
-   }
-
-   // Advance the caller-requested tile ID. This is different from the last threaded getTile()'s
-   // tile index maintained in m_nextTileID and advanced in initNextJob():
-   ++theCurrentTileNumber;
-   return tile;
-}
-
-//*************************************************************************************************
-// Specifies number of thread to support. Default behavior (if this method is never called) is
-// query the system for number of cores available.
-//*************************************************************************************************
-void ossimMultiThreadSequencer::setNumberOfThreads(ossim_uint32 num_threads)
-{
-   m_numThreads = num_threads;
-   m_maxCacheSize = m_maxTileCacheFactor * m_numThreads;
-
-   if (m_inputChain.valid())
-      m_inputChain->setNumberOfThreads(num_threads);
-
-   if (m_jobMtQueue.valid() && m_jobMtQueue->hasJobsToProcess())
-      m_jobMtQueue->getJobQueue()->clear();
-
-   m_nextTileID = 0; // effectively resets this sequencer
-}
-
-//*************************************************************************************************
-//! Access method to tile cache with scope lock to avoid multiple threads writing to
-//! the cache simultaneously.
-//*************************************************************************************************
-void ossimMultiThreadSequencer::setTileInCache(ossim_uint32 tile_id, 
-                                               ossimImageData* tile, 
-                                               ossim_uint32 chain_id,
-                                               double dt)
-{
-   if (d_timeMetricsEnabled)
-      d_t1 = ossimTimer::instance()->time_s(); 
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMutex);
-   if (d_timeMetricsEnabled)
-      d_idleTime4 += ossimTimer::instance()->time_s() - d_t1; 
-
-   d_jobGetTileT += dt;
-
-   m_tileCache[tile_id] = tile;
-   if (d_debugEnabled)
-   {
-      ostringstream s2;
-      s2<<"THREAD #"<<chain_id<<" -- setTileInCache() Wrote tile #"<<tile_id;
-      print(s2);
-   }
-   if (d_maxCacheUsed < m_tileCache.size())
-      d_maxCacheUsed = (ossim_uint32) m_tileCache.size();
-}
-
-//*************************************************************************************************
-// Queues up the next getTile job if cache is not full. This is called as soon as the job
-// handling the corresponding chain ID is finished.
-//*************************************************************************************************
-void ossimMultiThreadSequencer::nextJob(ossim_uint32 chain_id)
-{
-   // Check for end of sequence:
-   if (m_nextTileID >= m_totalNumberOfTiles)
-      return;
-
-   while (((ossim_uint32) m_tileCache.size()) >= m_maxCacheSize)
-   {
-      if (d_debugEnabled)
-      {
-         m_cacheMutex.lock();
-         TileCache::const_iterator iter = m_tileCache.begin();
-         ostringstream s1;
-         s1<<"THREAD #"<<chain_id<<" -- nextJob() Waiting on cache before queuing tile/job #"
-            <<m_nextTileID<<"using chain #"<<chain_id<<". Cache size: "<<m_tileCache.size();
-         while(iter != m_tileCache.end())
-         {
-            s1<<"\n   cache.tile_id = "<<iter->first;
-            iter++;
-         }
-         m_cacheMutex.unlock();
-         print(s1);
-      }
-
-      if (d_timedBlocksDt > 0)
-         m_nextJobBlock.block(d_timedBlocksDt);
-      else
-      {
-         m_nextJobBlock.reset();
-         if (d_timeMetricsEnabled)
-            d_t1 = ossimTimer::instance()->time_s(); 
-         m_nextJobBlock.block();
-         if (d_timeMetricsEnabled)
-         d_idleTime5 += ossimTimer::instance()->time_s() - d_t1; 
-      }
-   }
-
-   if (d_debugEnabled)
-   {
-      ostringstream s2;
-      s2<<"THREAD #"<<chain_id<<" -- nextJob() Queuing tile/job #"<<m_nextTileID;
-      print(s2);
-   }
-
-   // Job queue will receive pointer into ossimRefPtr so no leak here:
-   if (d_timeMetricsEnabled)
-      d_t1 = ossimTimer::instance()->time_s(); 
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
-   if (d_timeMetricsEnabled)
-      d_idleTime6 += ossimTimer::instance()->time_s() - d_t1; 
-
-   ossimGetTileJob* job = new ossimGetTileJob(m_nextTileID++, chain_id, *this);
-   job->setCallback(m_callback.get());
-   m_jobMtQueue->getJobQueue()->add(job);
-}
-
-//*************************************************************************************************
-// For Debugging
-//*************************************************************************************************
-void ossimMultiThreadSequencer::print(ostringstream& msg) const
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(d_printMutex);
-   cerr << msg.str() << endl;
-}
-double ossimMultiThreadSequencer::handlerGetTileT() 
-{
-   if (m_inputChain->m_sharedHandlers.empty())
-      return -1.0;
-   ossimRefPtr<ossimImageHandlerMtAdaptor> ha = m_inputChain->m_sharedHandlers[0].get();
-   if (ha.valid())
-      return ha->d_getTileT;
-   return -1;
-}
-
diff --git a/ossim/src/ossim/parallel/ossimOrthoIgen.cpp b/ossim/src/ossim/parallel/ossimOrthoIgen.cpp
deleted file mode 100644
index c3223be..0000000
--- a/ossim/src/ossim/parallel/ossimOrthoIgen.cpp
+++ /dev/null
@@ -1,3043 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimOrthoIgen.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <ossim/parallel/ossimOrthoIgen.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/imaging/ossimBandSelector.h>
-#include <ossim/imaging/ossimCacheTileSource.h>
-#include <ossim/imaging/ossimGeoAnnotationSource.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimHistogramRemapper.h>
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/imaging/ossimBlendMosaic.h>
-#include <ossim/imaging/ossimBandMergeSource.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimOrthoImageMosaic.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimMaskFilter.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/imaging/ossimEsriShapeFileInterface.h>
-#include <ossim/imaging/ossimTilingRect.h>
-#include <ossim/imaging/ossimTilingPoly.h>
-#include <ossim/imaging/ossimGeoPolyCutter.h>
-#include <ossim/imaging/ossimEastingNorthingCutter.h>
-#include <ossim/imaging/ossimHistogramEqualization.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimGeoAnnotationPolyObject.h>
-#include <ossim/imaging/ossimGeoAnnotationMultiPolyObject.h>
-#include <ossim/imaging/ossimPixelFlipper.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/parallel/ossimIgen.h>
-#include <ossim/parallel/ossimMpi.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-
-#include <sstream>
-
-// In Windows, standard output is ASCII by default. 
-// Let's include the following in case we have
-// to change it over to binary mode.
-#if defined(_WIN32)
-#  include <io.h>
-#  include <fcntl.h>
-#endif
-
-
-static ossimTrace traceDebug("ossimOrthoIgen:debug");
-static ossimTrace traceLog("ossimOrthoIgen:log");
-
-static const char* AUTOGENERATE_HISTOGRAM_KW = "autogenerate_histogram";
-
-using namespace ossim;
-
-//*************************************************************************************************
-// Parses the file info as specified in the command line or src file. The file info is a '|'-
-// delimited string with filename and additional attributes such as entry and band numbers.
-//*************************************************************************************************
-bool ossimOrthoIgen::parseFilename(const ossimString& file_spec, bool decodeEntry)
-{
-   ossimSrcRecord src_record;
-
-   std::vector<ossimString> fileInfos = file_spec.split("|");
-   unsigned int num_fields = (unsigned int) fileInfos.size();
-   unsigned int field_idx = 0;
-
-   if (num_fields == 0)
-      return false;
-
-   // First field is the actual filename:
-   src_record.setFilename(fileInfos[field_idx]);
-   ++field_idx;
-
-   // Next field depends on whether an entry is being decoded:
-   if ((field_idx < num_fields) && decodeEntry)
-   {
-      src_record.setEntryIndex(fileInfos[field_idx].trim().toInt32());
-      ++field_idx;
-   }
-
-   // The rest of the fields can appear in any order:
-   while (field_idx < num_fields)
-   {
-      ossimString active_field (fileInfos[field_idx].trim());
-      ossimString downcased_field (active_field);
-      downcased_field.downcase();
-      ++field_idx;
-
-      // Check for overview file spec:
-      ossimFilename filename (active_field);
-      if (filename.contains(".ovr") || filename.isDir())
-      {
-         src_record.setSupportDir(filename.path());
-      }
-      else if (filename.contains(".mask") || filename.isDir())
-      {
-         src_record.setSupportDir(filename.path());
-      }
-
-      // else check for auto-minmax histogram stretch:
-      else if ((downcased_field == "auto-minmax") || downcased_field.contains("std-stretch"))
-      {
-         src_record.setHistogramOp(downcased_field);
-      }
-
-      // Otherwise, this must be a band specification. Band numbers begin with 1:
-      else
-      {
-         // multiple bands delimited by comma:
-         std::vector<ossimString> bandsStr = active_field.split(",");
-         std::vector<ossim_uint32> bands;
-         for (unsigned int i = 0; i < bandsStr.size(); i++)
-         {
-            int band = bandsStr[i].toInt32() - 1;
-            if (band >= 0)
-               bands.push_back((ossim_uint32)band);
-         }
-         src_record.setBands(bands);
-      }
-
-   } // end of while loop parsing fileInfos spec
-
-   theSrcRecords.push_back(src_record);
-   return true;
-}
-
-//*************************************************************************************************
-// Constructor
-//*************************************************************************************************
-ossimOrthoIgen::ossimOrthoIgen()
-   :
-   ossimIgen(),
-   theDeltaPerPixelUnit(OSSIM_UNIT_UNKNOWN),
-   theDeltaPerPixelOverride(ossim::nan(), ossim::nan()),
-   theProjectionType(OSSIM_UNKNOWN_PROJECTION),
-   theProjectionName(""),
-   theGeoScalingLatitude(ossim::nan()),
-   theCombinerType("ossimImageMosaic"),
-   theResamplerType("nearest neighbor"),
-   theWriterType(""),
-   theTemplateView(""),
-   theTilingTemplate(""),
-   theTilingFilename(""),
-   theChainTemplate(""),
-   theCombinerTemplate(""),
-   theAnnotationTemplate(""),
-   theWriterTemplate(""),
-   theSupplementaryDirectory(""),
-   theSlaveBuffers("2"),
-   theCutOriginType(ossimOrthoIgen::OSSIM_CENTER_ORIGIN),
-   theCutOrigin(ossim::nan(), ossim::nan()),
-   theCutDxDy(ossim::nan(), ossim::nan()),
-   theCutOriginUnit(OSSIM_UNIT_UNKNOWN),
-   theCutDxDyUnit(OSSIM_UNIT_UNKNOWN),
-   theLowPercentClip(ossim::nan()),
-   theHighPercentClip(ossim::nan()),
-   theStdDevClip(-1),
-   theUseAutoMinMaxFlag(false),
-   theClipToValidRectFlag(false),   
-   theReaderProperties(),
-   theWriterProperties(),   
-   theTargetHistoFileName(),
-   theProductFilename(),
-   theReferenceProj(0),
-   theMaskShpFile(""),
-   theCacheExcludedFlag(false),
-   theOutputRadiometry(""),
-   thePixelAlignment(OSSIM_PIXEL_IS_AREA) // will revert to "point" upon first occurrence in source list
-{
-   // Determine default behavior of clip from preferences:
-   ossimString flag = ossimPreferences::instance()->findPreference("orthoigen.clip_to_valid_rect");
-   if (!flag.empty())
-      theClipToValidRectFlag = flag.toBool();
-
-   thePixelReplacementMode = ossimPreferences::instance()->findPreference("orthoigen.flip_null_pixels"); 
-   return;
-}
-
-//*************************************************************************************************
-// Initializes the argument parser
-//*************************************************************************************************
-void ossimOrthoIgen::addArguments(ossimArgumentParser& argumentParser)
-{
-   // These are in ALPHABETIC ORDER. Please keep it that way.
-
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--annotate", "annotation keyword list");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--chain-template","Specify an external file that contains chain information");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--clamp-pixels <min> <max>","Specify the min and max allowed pixel values. All values "
-      "outside of this get mapped to their corresponding clamp value.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--clip-pixels <min> <max>","Causes all pixel values between min and max (inclusive)"
-      " to be mapped to the null pixel value. Min and max can be equal for mapping a single value."
-      " See also related option \"--replacement-mode\" for additional explanation.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--clip-to-valid-rect <true|false>","When true, any requested cut rect is clipped by the "
-      "valid image bounding rect to minimize null border pixels. If false, the output will "
-      "correspond to the cut rect as close as possible given the product projection. This option "
-      "overrides the ossim_preferences setting. If no cut options are supplied, this option is "
-      "ignored.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--combiner-template","Specify an external file that contains combiner information");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--combiner-type","Specify what mosaic to use, ossimImageMosiac or ossimFeatherMosaic or "
-      "osimBlendMosaic ... etc");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--cut-bbox-en","Specify the min easting, min northing, max easting, max northing");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--cut-bbox-ll","Specify the min lat and min lon and max lat and maxlon <minLat> <minLon> "
-      "<maxLat> <maxLon>");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--cut-center-ll","Specify the center cut in lat lon space.  Takes two argument <lat> <lon>");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--cut-pixel-width-height","Specify cut box's width and height in pixels");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--cut-radius-meters","Specify the cut distance in meters.  A bounding box for the cut will "
-      "be produced");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--degrees","Specifies an override for degrees per pixel. Takes either a single value "
-      "applied equally to x and y directions, or two values applied correspondingly to x then y.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--geo","Defaults to a geographic image chain with GSD = to the input.  Origin of latitude is"
-      "on the equator.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--geo-auto-scaled","Computes the mosaic center latitude  for purpose of scaling in the "
-      "longitude direction so that the pixels will appear nearly square in ground space at "
-      "specified latitude. Implies a geographic projection.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--geo-scaled","Takes latitude as an argument for purpose of scaling in the "
-      "longitude direction so that the pixels will appear nearly square in ground space at "
-      "specified latitude. Implies a geographic projection.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--hist-auto-minmax","uses the automatic search for the best min and max clip values."
-      " Incompatible with other histogram options.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--hist-match","Takes one image filename argument for target histogram to match."
-      " Incompatible with other histogram options.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--hist-std-stretch","Specify histogram stretch as a standard deviation from the mean as"
-      " <int>, where <int> is 1, 2, or 3."
-      " Incompatible with other histogram options.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--hist-stretch","Specify in normalized percent the low clip and then the high clip value"
-      " as <low.dd> <hi.dd>."
-      " Incompatible with other histogram options.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--input-proj","Makes the view equal to the input.  If more than one file then the first is "
-      "taken");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--mask","Specify the ESRI shape file with polygons to clip the image");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--meters","Specifies an override for the meters per pixel. Takes either a single value "
-      "applied equally to x and y directions, or two values applied correspondingly to x then y.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--no-cache","Excludes the cache from the input image chain(s). Necessary as a workaround "
-      " for inconsistent cache behavior for certain image types.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--output-radiometry","Specifies the desired product's pixel radiometry type. Possible "
-      "values are: U8, U11, U16, S16, F32. Note this overrides the deprecated option \"scale-to"
-      "-8-bit\".");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--reader-prop","Passes a name=value pair to the reader(s) for setting it's property.  Any "
-      "number of these can appear on the line.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--replacement-mode <mode>","Specify how to treat multi-band imagery when providing "
-      "clip-pixels and/or clamp-pixels settings. Possible values are: REPLACE_BAND_IF_TARGET | "
-      "REPLACE_BAND_IF_PARTIAL_TARGET | REPLACE_ALL_BANDS_IF_ANY_TARGET | "
-      "REPLACE_ONLY_FULL_TARGETS.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--resample-type","Specify what resampler to use, nearest neighbor, bilinear, cubic");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--scale-to-8-bit","Scales the output to unsigned eight bits per band. This option has been"
-      " deprecated by the newer \"--output-radiometry\" option.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--slave-buffers","number of slave tile buffers for mpi processing (default = 2)");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--srs","specify an output reference frame/projection. Example: --srs EPSG:4326");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--stdout","Output the image to standard out.  This will return an error if writer does not "
-      "support writing to standard out.  Callers should combine this with the --ossim-logfile "
-      "option to ensure output image stream does not get corrupted.  You must still pass an output "
-      "file so the writer type can be determined like \"dummy.png\".");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--supplementary-directory or --support","Specify the supplementary directory path where "
-      "overviews, histograms and external geometries are located");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "-t or --thumbnail", "thumbnail size");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--tiling-template","Specify an external file that contains tiling information");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--threads [n]","Indicates multi-threaded process using optionally-specified number of threads");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--utm","Defaults to a utm image chain with GSD = to the input");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--view-template","Specify an external file that contains view information");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "-w or --writer","Specifies the output writer.  Default uses output file extension to "
-      "determine writer.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--wkt","specify an output reference frame/projection that is in a wkt format.  Must have the"
-      " ossimgdal_plugin compiled");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--writer-prop","Passes a name=value pair to the writer for setting it's property.  Any "
-      "number of these can appear on the line.");
-   argumentParser.getApplicationUsage()->addCommandLineOption(
-      "--writer-template","Specify an external file that contains tiling information"); 
-}
-
-//*************************************************************************************************
-// Initializes this objects data members given the command line args
-//*************************************************************************************************
-void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
-{
-   if(traceDebug())
-   {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimOrthoIgen::initialize DEBUG:"
-            << "Entered..... " 
-            << std::endl;
-   }
-   double tempDouble;
-   double tempDouble2;
-   double tempDouble3;
-   double tempDouble4;
-   ossimString tempString;
-   unsigned int tempUint;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   ossimArgumentParser::ossimParameter doubleParam(tempDouble);
-   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
-   ossimArgumentParser::ossimParameter doubleParam3(tempDouble3);
-   ossimArgumentParser::ossimParameter doubleParam4(tempDouble4);
-   ossimArgumentParser::ossimParameter uintParam(tempUint);
-   theCutOriginType = ossimOrthoIgen::OSSIM_CENTER_ORIGIN;
-   theCutOrigin.makeNan();
-   theCutDxDy.makeNan();
-   theCutOriginUnit   = OSSIM_UNIT_UNKNOWN;
-   theCutDxDyUnit     = OSSIM_UNIT_UNKNOWN;
-   theLowPercentClip  = ossim::nan();
-   theHighPercentClip = ossim::nan();
-   double minX=ossim::nan(), minY=ossim::nan(), maxX=ossim::nan(), maxY=ossim::nan();
-   theUseAutoMinMaxFlag = false;
-   theDeltaPerPixelOverride.makeNan();
-   theDeltaPerPixelUnit = OSSIM_UNIT_UNKNOWN;
-   theCacheExcludedFlag = false;
-   theClampPixelMin = ossim::nan();
-   theClampPixelMax = ossim::nan();
-   theClipPixelMin = ossim::nan();
-   theClipPixelMax = ossim::nan();
-   
-   if(argumentParser.read("--annotate", stringParam))
-   {
-      theAnnotationTemplate = ossimFilename(tempString);
-   }
-   if(argumentParser.read("-t", stringParam)   ||
-      argumentParser.read("--thumbnail", stringParam))
-   {
-      ossimString comma (",");
-      if (tempString.contains(comma))
-      {
-         theThumbnailSize.x = tempString.before(comma).toInt();
-         theThumbnailSize.y = tempString.after(comma).toInt();
-      }
-      else
-      {
-         theThumbnailSize.x = tempString.toInt();
-         theThumbnailSize.y = 0;
-      }
-      theBuildThumbnailFlag = true;
-   }
-
-   theReaderProperties.clear();
-   while(argumentParser.read("--reader-prop", stringParam))
-   {
-      std::vector<ossimString> splitArray;
-      tempString.split(splitArray, "=");
-      if(splitArray.size() == 2)
-      {
-         theReaderProperties.insert(std::make_pair(splitArray[0], splitArray[1]));
-      }
-   }
-
-   if(argumentParser.read("-w", stringParam)   ||
-      argumentParser.read("--writer", stringParam))
-   {
-      theWriterType = tempString;
-   }
-
-   theWriterProperties.clear();
-   
-   while(argumentParser.read("--writer-prop", stringParam))
-   {
-      std::vector<ossimString> splitArray;
-      tempString.split(splitArray, "=");
-      if(splitArray.size() == 2)
-      {
-         theWriterProperties.insert(std::make_pair(splitArray[0], splitArray[1]));
-      }
-   }
-         
-   if(argumentParser.read("--slave-buffers", stringParam))
-   {
-      theSlaveBuffers = tempString;
-   }
-   if(argumentParser.read("--cut-center-ll", doubleParam, doubleParam2))
-   {
-      theCutOrigin.lat = tempDouble;
-      theCutOrigin.lon = tempDouble2;
-      theCutOriginUnit = OSSIM_DEGREES;
-      theCutOriginType = ossimOrthoIgen::OSSIM_CENTER_ORIGIN;
-   }
-   if(argumentParser.read("--cut-radius-meters", doubleParam))
-   {
-      theCutDxDy.x = tempDouble;
-      theCutDxDy.y = tempDouble;
-      theCutDxDyUnit = OSSIM_METERS;
-   }
-   if(argumentParser.read("--cut-bbox-ll", doubleParam, doubleParam2, doubleParam3, doubleParam4))
-   {
-      minY = tempDouble;
-      minX = tempDouble2;
-      maxY = tempDouble3;
-      maxX = tempDouble4;
-      theCutOriginUnit = OSSIM_DEGREES;
-      theCutOriginType = ossimOrthoIgen::OSSIM_UPPER_LEFT_ORIGIN;
-      theCutOrigin.lat = maxY;
-      theCutOrigin.lon = minX;
-      theCutDxDy.lat   = (maxY-minY);
-      if ( (maxX < 0.0) && (minX >= 0.0) )
-      {
-         //---
-         // Min is eastern hemisphere, max is western. Crossed the international date line.
-         // Add 360 to make it positive.
-         //
-         // Note no check for just max < min here???  Perhaps throw exception.(drb)
-         //---
-         maxX += 360.0;
-      }      
-      theCutDxDy.lon   = (maxX-minX);
-      theCutDxDyUnit   = OSSIM_DEGREES;
-   }
-   if(argumentParser.read("--cut-bbox-en", doubleParam, doubleParam2, doubleParam3, doubleParam4))
-   {
-      minX = tempDouble;
-      minY = tempDouble2;
-      maxX = tempDouble3;
-      maxY = tempDouble4;
-      theCutOriginUnit = OSSIM_METERS;
-      theCutOriginType = ossimOrthoIgen::OSSIM_UPPER_LEFT_ORIGIN;
-      theCutOrigin.x = minX;
-      theCutOrigin.y = maxY;
-      theCutDxDy.x   = (maxX-minX);
-      theCutDxDy.y   = (maxY-minY);
-      theCutDxDyUnit   = OSSIM_METERS;
-   }
-   if(argumentParser.read("--cut-pixel-width-height", doubleParam, doubleParam2))
-   {
-      if((ossim::isnan(minX) == false)&&
-         (ossim::isnan(minY) == false)&&
-         (ossim::isnan(maxX) == false)&&
-         (ossim::isnan(maxY) == false))
-      {
-         theDeltaPerPixelOverride = ossimDpt(theCutDxDy.x/(tempDouble-1),
-                                             theCutDxDy.y/(tempDouble2-1));
-         theDeltaPerPixelUnit     = theCutDxDyUnit;
-      }
-      else
-      {
-         theCutOrigin.makeNan();
-         ossimNotify(ossimNotifyLevel_WARN) << "Can't have option --cut-pixel-width-height without --cut-bbox-ll" << std::endl;
-      }
-   }
-   
-   int num_params = argumentParser.numberOfParams("--degrees", doubleParam);
-   if (num_params == 1)
-   {
-      argumentParser.read("--degrees", doubleParam);
-      theDeltaPerPixelUnit = OSSIM_DEGREES;
-      theDeltaPerPixelOverride.x = tempDouble;
-      theDeltaPerPixelOverride.y = tempDouble;
-   }
-   else if (num_params == 2)
-   {
-      argumentParser.read("--degrees", doubleParam, doubleParam2);
-      theDeltaPerPixelUnit = OSSIM_DEGREES;
-      theDeltaPerPixelOverride.x = tempDouble;
-      theDeltaPerPixelOverride.y = tempDouble2;
-   }
-
-   // The three histogram options are mutually exclusive:
-   bool histo_op_selected = false;
-   if(argumentParser.read("--hist-match", stringParam))
-   {
-      ossimFilename target_image (tempString);
-      histo_op_selected = true;
-      
-      // Check for histogram matching request and initialize for that:
-      if (target_image.isReadable())
-      {
-         // Establish target histogram file:
-         theTargetHistoFileName = target_image;
-         theTargetHistoFileName.setExtension("his");
-         if (!theTargetHistoFileName.isReadable())
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)<<"Target histogram file <" << theTargetHistoFileName 
-               << "> not found. Cannot perform histogram matching." << std::endl;
-            theTargetHistoFileName.clear();
-         }
-      }
-   }
-   if(argumentParser.read("--hist-stretch", doubleParam, doubleParam2))
-   {
-      if (histo_op_selected)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "Cannot specify nore than one histogram operation. "
-            " Ignoring --hist-stretch option." << std::endl;
-      }
-      else
-      {
-         theLowPercentClip = tempDouble;
-         theHighPercentClip = tempDouble2;
-         histo_op_selected = true;
-      }
-   }
-   if(argumentParser.read("--hist-std-stretch", stringParam))
-   {
-      if (histo_op_selected)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "Cannot specify nore than one histogram operation. "
-            " Ignoring --hist-stretch option." << std::endl;
-      }
-      else
-      {
-         theStdDevClip = tempString.toInt32();
-         histo_op_selected = true;
-         if ((theStdDevClip < 1) || (theStdDevClip > 3))
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "Invalid standard deviation value provided with"
-               " --hist-std-stretch option. Only 1,2, or 3 allowed. Ignoring option."<< std::endl;
-         }
-      }
-   }
-   if(argumentParser.read("--hist-auto-minmax"))
-   {
-      if (histo_op_selected)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "Cannot specify nore than one histogram operation. "
-            " Ignoring --hist-auto-minmax option." << std::endl;
-      }
-      else
-         theUseAutoMinMaxFlag = true;
-   }
-
-   num_params = argumentParser.numberOfParams("--meters", doubleParam);
-   if (num_params == 1)
-   {
-      argumentParser.read("--meters", doubleParam);
-      theDeltaPerPixelUnit = OSSIM_METERS;
-      theDeltaPerPixelOverride.x = tempDouble;
-      theDeltaPerPixelOverride.y = tempDouble;
-   }
-   else if (num_params == 2)
-   {
-      argumentParser.read("--meters", doubleParam, doubleParam2);
-      theDeltaPerPixelUnit = OSSIM_METERS;
-      theDeltaPerPixelOverride.x = tempDouble;
-      theDeltaPerPixelOverride.y = tempDouble2;
-   }
-
-   if(argumentParser.read("--no-cache"))
-   {
-      theCacheExcludedFlag = true;
-   }
-
-   if(argumentParser.read("--output-radiometry", stringParam))
-   {
-      theOutputRadiometry = tempString;
-   }
-
-   if(argumentParser.read("--scale-to-8-bit"))
-   {
-      if (theOutputRadiometry.empty())
-         theOutputRadiometry = "U8";
-   }
-
-   if (argumentParser.read("--stdout"))
-   {
-#if defined(_WIN32)
-      // In Windows, cout is ASCII by default. 
-      // Let's change it over to binary mode.
-      int result = _setmode( _fileno(stdout), _O_BINARY );
-      if( result == -1 )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimOrthoIgen::initialize WARNING:"
-            << "\nCannot set standard output mode to binary."
-            << std::endl;
-         return;
-      }
-#endif
-
-      theStdoutFlag = true;
-   }
-   
-   if(argumentParser.read("--writer-template", stringParam))
-   {
-      theWriterTemplate = tempString;
-   }
-   if(argumentParser.read("--tiling-template", stringParam))
-   {
-      theTilingTemplate = ossimFilename(tempString);
-   }
-   if(argumentParser.read("--chain-template", stringParam))
-   {
-      theChainTemplate = ossimFilename(tempString);
-   }
-   if(argumentParser.read("--combiner-template", stringParam))
-   {
-      theCombinerTemplate = ossimFilename(tempString);
-   }
-   
-   theGeoScalingLatitude = ossim::nan();
-
-   if (argumentParser.read("--utm"))
-   {
-      theProjectionType = OSSIM_UTM_PROJECTION;
-      theProjectionName = "ossimUtmProjection";
-   }
-   else if(argumentParser.read("--geo"))
-   {
-      theProjectionType = OSSIM_GEO_PROJECTION;
-      theProjectionName = "ossimEquDistCylProjection";
-      theGeoScalingLatitude = 0.0;
-   }
-   else if(argumentParser.read("--input-proj"))
-   {
-      theProjectionType = OSSIM_INPUT_PROJECTION;
-   }
-   else if (argumentParser.read("--srs", stringParam))
-   {
-      theCrsString=tempString;
-      theProjectionType = OSSIM_SRS_PROJECTION;
-   }
-
-   if(argumentParser.read("--view-template", stringParam))
-   {
-      theTemplateView = ossimFilename(tempString);
-      theProjectionType = OSSIM_EXTERNAL_PROJECTION;
-   }
-
-   if(argumentParser.read("--geo-scaled", doubleParam))
-   {
-      theProjectionType = OSSIM_GEO_PROJECTION;
-      theProjectionName = "ossimEquDistCylProjection";
-      if ( (tempDouble < 90.0) && (tempDouble > -90.0) )
-      {
-         theGeoScalingLatitude = tempDouble;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimOrthoIgen::initialize WARNING:"
-            << "\nLatitude out  of range!  Must be between -90 and 90."
-            << std::endl;
-      }
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimOrthoIgen::initialize DEBUG:"
-            << "\ngeographicOriginOfLatitude:  " << theGeoScalingLatitude
-            << std::endl;
-      }
-   }
-
-   if(argumentParser.read("--geo-auto-scaled"))
-   {
-      theProjectionType = OSSIM_GEO_PROJECTION;
-      theProjectionName = "ossimEquDistCylProjection";
-      theGeoScalingLatitude = 999.0; // Flags computation of center lat for scaling
-   }
-
-   if(argumentParser.read("--combiner-type", stringParam))
-      theCombinerType = tempString;
-
-   if(argumentParser.read("--resample-type", stringParam))
-   {
-      theResamplerType = tempString;
-   }
-   if(argumentParser.read("--supplementary-directory", stringParam) ||
-      argumentParser.read("--support", stringParam))
-   {
-      theSupplementaryDirectory = ossimFilename(tempString);
-   }
-
-   if (argumentParser.read("--clip-to-valid-rect", stringParam))
-   {
-      theClipToValidRectFlag = tempString.toBool();
-   }
-
-   if(argumentParser.read("--mask", stringParam))
-   {
-     theMaskShpFile = tempString;
-   }
-
-   // Pixel flipper control options:
-   if (argumentParser.read("--clip-pixels", doubleParam, doubleParam2))
-   {
-      theClipPixelMin = tempDouble;
-      theClipPixelMax = tempDouble2;
-   }
-   if (argumentParser.read("--clamp-pixels", doubleParam, doubleParam2))
-   { 
-      theClampPixelMin = tempDouble;
-      theClampPixelMax = tempDouble2;
-   }
-   if (argumentParser.read("--replacement-mode", stringParam))
-   { 
-      thePixelReplacementMode = tempString;
-   }
-
-   // Threading:
-   num_params = argumentParser.numberOfParams("--threads", uintParam);
-   if (num_params == 0)   // No param means system decides optimal thread count
-   {
-      argumentParser.read("--threads");
-      theThreadCount = 0; // Flags system-resolved
-   }
-   else if (num_params == 1)
-   {
-      argumentParser.read("--threads", uintParam);
-      theThreadCount = (ossim_uint32) tempUint; 
-   }
-
-   if(traceDebug())
-   {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimOrthoIgen::initialize DEBUG:"
-            << "Leaving..... " 
-            << std::endl;
-   }
-}
-
-//*************************************************************************************************
-// Adds any file specifications to the files list
-//*************************************************************************************************
-void ossimOrthoIgen::addFiles(ossimArgumentParser& argumentParser,
-                              bool withDecoding,
-                              ossim_uint32 startIdx)
-{
-   ossim_uint32 idx = startIdx;
-   ossim_uint32 last_idx = argumentParser.argc()-1;
-   while(argumentParser.argv()[idx] && (idx < last_idx))
-   {
-     ossimString file_spec = argumentParser.argv()[idx];
-     if (file_spec.contains(".src"))
-     {
-        // input file spec provided via src file. Need to parse it:
-        addSrcFile(ossimFilename(file_spec));
-     }
-     else
-     {
-        // Filename with optional switches explicitly provided on command line:
-        parseFilename(file_spec, withDecoding);
-     }
-     ++idx;
-   }
-
-   // The last filename left on the command line should be the product filename:
-   theProductFilename = argumentParser.argv()[last_idx];
-}
-
-//*************************************************************************************************
-// Performs the top-level management of image generation
-//*************************************************************************************************
-bool ossimOrthoIgen::execute()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimOrthoIgen::execute DEBUG: Entered ..."
-         << std::endl;
-   }
-//   double start=0, stop=0;
-
-   if(theSrcRecords.size() < 1)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimOrthoIgen::execute WARNING: No filenames to process"
-         << std::endl;
-      return false;
-   }
-
-   if (!theCrsString.empty() && !theProductFilename.empty())
-   {
-     if ((theProductFilename.ext().upcase() == "KMZ" || theProductFilename.ext().upcase() == "KML") 
-       && theCrsString.upcase() != "EPSG:4326")
-     {
-       ossimNotify(ossimNotifyLevel_FATAL)
-         << "ossimOrthoIgen::execute ERROR: Unsupported projection for kmz or kml"
-         << std::endl;
-       return false;
-     }
-   }
-
-   if(ossimMpi::instance()->getRank() == 0)
-   {
-      try
-      {
-         setupIgenChain();
-      }
-      catch (const ossimException& e)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << e.what() << std::endl;
-         }
-         throw; // re-throw exception
-      }
-
-      if (traceLog())
-      {
-         generateLog();
-      }
-   }
-
-   try
-   {
-      // theProductProjection->print(cout) << endl;
-      outputProduct();
-   }
-   catch(const ossimException& e)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << e.what() << std::endl;
-      }
-      throw; // re-throw
-   }
-   
-   return true;
-}
-
-//*************************************************************************************************
-// METHOD
-//*************************************************************************************************
-void ossimOrthoIgen::clearFilenameList()
-{
-   theSrcRecords.clear();
-}
-
-//*************************************************************************************************
-// Parses the .src file specified in the command line. These contain an alternate specification
-// of input file and associated attributes as a KWL.
-//*************************************************************************************************
-void ossimOrthoIgen::addSrcFile(const ossimFilename& src_file)
-{
-   if (!src_file.isReadable())
-      return;
-
-   ossimKeywordlist src_kwl;
-   src_kwl.setExpandEnvVarsFlag(true);
-   if ( src_kwl.addFile(src_file) == false ) return;
-
-   unsigned int image_idx = 0;
-   // int entry = -1;
-
-   // Loop to read all image file entries:
-   double sum_weights = 0;
-   while (true)
-   {
-      ossimSrcRecord src_record(src_kwl, image_idx++);
-      if (!src_record.valid()) 
-         break;
-
-      // Check for the presence of separate RGB file specs in this SRC record. This indicates 
-      // special processing. (comment added OLK 01/11)
-      if (src_record.isRgbData())
-      {
-         for (ossim_uint32 rgb_index = 0; rgb_index < 3; rgb_index++)
-         {
-            // This call creates another band-specific ossimSrcRecord that is pushed onto 
-            // theSrcRecords vector data member. (comment added OLK 01/11)
-            if (parseFilename(src_record.getRgbFilename(rgb_index), true))
-            {
-               // The parseFilename call pushes the R, G, or B band onto the back of theSrcRecords 
-               // vector. Set some additional attributes on this last entry. (OLK 01/11)
-               theSrcRecords.back().setRgbDataBool(true);
-               theSrcRecords.back().setHistogramOp(src_record.getRgbHistogramOp(rgb_index));
-               theSrcRecords.back().setHistogram(src_record.getRgbHistogramPath(rgb_index));
-               theSrcRecords.back().setOverview(src_record.getRgbOverviewPath(rgb_index));
-            }
-         }
-      }
-      else
-      {
-         // Not RGB data, so treat as conventional image: (comment added OLK 01/11)
-         theSrcRecords.push_back(src_record);
-         sum_weights += src_record.getWeight();
-
-         //if the vector file exists, set the mosaic combiner type to ossimBlendMosaic
-         if (src_record.isVectorData())
-            theCombinerType = "ossimBlendMosaic";
-      }
-   }
-
-   double max_weight = (sum_weights > 100.0 ? sum_weights : 100.0);
-   double num_entries = (double)theSrcRecords.size();
-   double weight; 
-   vector<ossimSrcRecord>::iterator iter = theSrcRecords.begin();
-   while (iter != theSrcRecords.end())
-   {
-      if (sum_weights > 0.0)
-      {
-         // Somebody declared opacity, so need to share the remaining contributions among
-         // other images:
-         theCombinerType = "ossimBlendMosaic";
-         if (iter->getWeight() == 0.0)
-         {
-            // No weight has been assigned for this image, so use default remaining partial
-            if (num_entries == 1.0)
-               weight = 1.0; // This is the only image, so full weight
-            else
-            {
-               // share remaining contributions:
-               weight = (1.0 - sum_weights/max_weight)/(num_entries - 1); 
-               if (weight < 0.01)
-                  weight = 0.01;
-            }
-         }
-         else
-         {
-            // An opacity value was specified for this
-            weight = iter->getWeight()/max_weight;
-         }
-      }
-      else
-      {
-         // No opacity values were specified, so simply use the default equal share. Note that the
-         // mosaic may not even be of type ossimBlendMosaic:
-         weight = 100.0/num_entries; // default if no opacity specified
-      }
-
-      iter->setWeight(weight);
-      iter++;
-   }
-}
-
-//*************************************************************************************************
-// METHOD
-//*************************************************************************************************
-void ossimOrthoIgen::setDefaultValues()
-{
-   theBuildThumbnailFlag = false;
-   theDeltaPerPixelUnit = OSSIM_UNIT_UNKNOWN;
-   theDeltaPerPixelOverride.makeNan();
-   theTemplateView = "";
-   theProjectionType = OSSIM_UNKNOWN_PROJECTION;
-   theGeoScalingLatitude = ossim::nan();
-   theCombinerType = "ossimImageMosaic";
-   theResamplerType = "nearest neighbor";
-   theTilingTemplate = "";
-   theTilingFilename = "";
-   theSupplementaryDirectory = "";
-   theSlaveBuffers = "2";
-   clearFilenameList();
-   theLowPercentClip = ossim::nan();
-   theHighPercentClip = ossim::nan();
-   theCutOrigin.makeNan();
-   theCutDxDy.makeNan();
-   theCutOriginUnit   = OSSIM_UNIT_UNKNOWN;
-   theCutDxDyUnit     = OSSIM_UNIT_UNKNOWN;
-
-   // PIXEL_IS_AREA HACK -- Set the assumed pixel alignment type to "area". Upon the first occurrence
-   // of a pixel-is-point entry, this property will revert to point. THIS NEEDS TO BE
-   // REMOVED WHEN THE EW GUI PROVIDES FOR THE USER TO SET THIS PROPERTY (OLK 09/11):
-   thePixelAlignment = OSSIM_PIXEL_IS_AREA; // not a default, but necessary for later logic
-}
-
-//*************************************************************************************************
-// Initializes the processing chain from the information on the command line
-//*************************************************************************************************
-void ossimOrthoIgen::setupIgenChain()
-{
-   if (traceDebug())
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "ossimOrthoIgen::setupIgenChain DEBUG: Entered ..."<< std::endl;
-
-   setupTiling();
-
-   if (theSlaveBuffers == "")
-      theNumberOfTilesToBuffer = 2;
-   else
-      theNumberOfTilesToBuffer = theSlaveBuffers.toLong();
-
-   if(theProductFilename.empty())
-      throw(ossimException(std::string("Must supply an output file.")));
-
-   // Create the output mosaic object, to be connected to its inputs later:
-   ossimKeywordlist templateKwl;
-   templateKwl.clear();
-   ossimRefPtr<ossimImageCombiner> mosaicObject = 0;
-   ossimRefPtr<ossimImageCombiner> bandMergeObject = 0;
-   if(theCombinerTemplate.exists())
-   {
-      templateKwl.addFile(theCombinerTemplate);
-      mosaicObject = PTR_CAST(ossimImageCombiner, 
-                              ossimObjectFactoryRegistry::instance()->createObject(templateKwl));
-   }
-   if (!mosaicObject.valid())
-   {
-      mosaicObject = PTR_CAST(ossimImageCombiner, 
-         ossimObjectFactoryRegistry::instance()->createObject(theCombinerType));
-      if(!mosaicObject.valid())
-      {
-         mosaicObject = PTR_CAST(ossimImageMosaic, ossimObjectFactoryRegistry::instance()->
-            createObject(ossimString("ossimImageMosaic")));
-      }
-   }
-   
-   // Keep this pointer around for special processing if blend mosaic:
-   ossimBlendMosaic* obm = PTR_CAST(ossimBlendMosaic, mosaicObject.get());
-
-   // An orthomosaic implies that all input images are already orthorectified to a common projection
-   // so the input chains do not require a renderer:
-   bool orthoMosaic = (PTR_CAST(ossimOrthoImageMosaic, mosaicObject.get()) != 0);
-
-   // Establish default individual input chain from template, if any:
-   templateKwl.clear();
-   ossimRefPtr<ossimImageChain> default_single_image_chain = 0;
-   if(theChainTemplate.exists())
-   {
-      templateKwl.addFile(theChainTemplate);
-      ossimObject* obj = 0;
-      if(templateKwl.find("type"))
-         obj = ossimObjectFactoryRegistry::instance()->createObject(templateKwl);
-      else if(templateKwl.find("object1.type"))
-         obj = ossimObjectFactoryRegistry::instance()->createObject(templateKwl, "object1.");  
-      default_single_image_chain = PTR_CAST(ossimImageChain, obj);
-   }
-   if(!default_single_image_chain.valid())  // then create a default rendering chain
-   {
-      default_single_image_chain = new ossimImageChain;
-      {
-         // Only need a renderer if an output projection or an explicit GSD was specified.
-         if(!orthoMosaic)
-         {
-            ossimImageRenderer* renderer   = new ossimImageRenderer;
-            if (renderer->getResampler())
-               renderer->getResampler()->setFilterType(theResamplerType);
-            default_single_image_chain->addChild(renderer);
-         }
-      }
-   }
-
-   ossim_uint32 num_inputs = (ossim_uint32)theSrcRecords.size();
-   ossim_uint32 idx;
-   ossimString prefix ("object1.object");
-   theReferenceProj = 0;
-
-   // Loop over each input image file to establish a single image chain that will be added to the
-   // output mosaic:
-   ossimImageSource* current_source = 0;
-   for(idx = 0; idx < num_inputs; ++idx)
-   {
-      // first lets add an input handler to the chain:
-      ossimFilename input  = theSrcRecords[idx].getFilename();
-      ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(input);
-      if(!handler.valid())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "Could not open input file <" << input << ">. "
-            << "Skipping this entry." << std::endl;
-         continue;
-      }
-
-      // Pass on any reader properties if there are any.
-      ossimPropertyInterface* propInterface = (ossimPropertyInterface*)handler.get();
-      PropertyMap::iterator iter = theReaderProperties.begin();
-      while(iter != theReaderProperties.end())
-      {
-         propInterface->setProperty(iter->first, iter->second);
-         ++iter;
-      }
-
-      // Presently, handler->loadState() is called only on vector data, though in the future we
-      // should stuff many of the members in ossimSrcRecord in a KWL (similar to what is currently
-      // done with vector properties) so that the handler is initialized via loadState() instead of 
-      // individual calls to set methods.  OLK 10/10
-      if (theSrcRecords[idx].isVectorData())
-         handler->loadState(theSrcRecords[idx].getAttributesKwl());
-
-      std::vector<ossim_uint32> entryList;
-      if(theSrcRecords[idx].getEntryIndex() > -1 )
-         entryList.push_back(theSrcRecords[idx].getEntryIndex());
-      else
-         handler->getEntryList(entryList);
-
-      // Input image file may have multiple entries. Loop over each and establish single image
-      // chains for each:
-      ossim_uint32 entryIdx = 0;
-      for(entryIdx = 0; entryIdx < entryList.size(); ++entryIdx)
-      {
-         // Instantiate the chain for one input image source. Copy existing default chain
-         // which may already possess a renderer (so don't do any addFirst()!):
-         ossimImageChain* singleImageChain = (ossimImageChain*) default_single_image_chain->dup();
-
-         // Establish the image handler for this particular frame. This may be just
-         // the handler already opened in the case of single image per file:
-          ossimImageHandler* img_handler = 0;
-         if (entryList.size() == 1)
-            img_handler = handler.get();
-         else
-            img_handler = (ossimImageHandler*)handler->dup();
-
-         // The user can specify an external "support" (a.k.a. supplementary directory) several ways
-         if ( theSupplementaryDirectory.empty() == false )
-         {
-            img_handler->setSupplementaryDirectory( theSupplementaryDirectory );
-         }
-         else if (theSrcRecords[idx].getSupportDir().empty() == false)
-         {
-            img_handler->setSupplementaryDirectory(theSrcRecords[idx].getSupportDir());
-         }
-         else if (theSrcRecords[idx].getOverviewPath().empty() == false)
-         {
-            if (theSrcRecords[idx].getOverviewPath().isDir())
-               img_handler->setSupplementaryDirectory(theSrcRecords[idx].getOverviewPath());
-            else
-               img_handler->setSupplementaryDirectory(theSrcRecords[idx].getOverviewPath().path());
-         }
-         img_handler->setCurrentEntry(entryList[entryIdx]);
-         if ( img_handler->hasOverviews() )
-         {
-            img_handler->openOverview();
-         }
-         if (theSrcRecords[idx].isRgbData() && theSrcRecords[idx].getBands().size() > 0 && 
-            theSrcRecords[idx].getOverviewPath().empty())
-         {
-            img_handler->setOutputBandList(theSrcRecords[idx].getBands());
-         }
-
-         // Image handler is ready to insert on the input side of the chain:
-         singleImageChain->addLast(img_handler);
-         current_source = img_handler;
-
-         // PIXEL_IS_AREA HACK -- Scan the pixel alignment to see if all inputs are "area",
-         // in which case we override the command-line writer property setting. THIS NEEDS TO BE
-         // REMOVED WHEN THE EW GUI PROVIDES FOR THE USER TO SET THIS PROPERTY (OLK 09/11):
-         if (img_handler->getPixelType() == OSSIM_PIXEL_IS_POINT)
-            thePixelAlignment = OSSIM_PIXEL_IS_POINT;
-
-         // This call will check for the presence of a raster mask file alongside the image,
-         // and insert the mask filter in the chain if present:
-         current_source = setupRasterMask(singleImageChain, theSrcRecords[idx]);
-
-         // If this is the first input chain, use it as the reference projection to help with
-         // the instantiation of the product projection (the view):
-         if (!theReferenceProj.valid())
-         {
-            ossimRefPtr<ossimImageGeometry> geom = img_handler->getImageGeometry();
-            if ( geom.valid() ) 
-               theReferenceProj = geom->getProjection();
-         }
-
-         // Insert a partial-pixel flipper to remap null-valued pixels to min.  
-         // This is set via preference keyword "orthoigen.flip_null_pixels"  
-         current_source = setupPixelFlipper(singleImageChain, theSrcRecords[idx]);
-
-         // Install a band selector if needed:
-         if (theSrcRecords[idx].getBands().size() && (img_handler->getNumberOfOutputBands() > 1))
-         {
-            ossim_uint32 bands = img_handler->getNumberOfOutputBands();
-            bool validBand = true;
-            for (ossim_uint32 i = 0; i < theSrcRecords[idx].getBands().size(); ++i)
-            {
-               if (theSrcRecords[idx].getBands()[i] >= bands)
-               {
-                  validBand = false;
-                  ossimNotify(ossimNotifyLevel_FATAL) << " ERROR:" << "\nBand list range error!"
-                     << "\nHighest available band:  " << bands << std::endl;
-               }
-            }
-            if (validBand)
-            {
-               ossimRefPtr<ossimBandSelector> bs = new ossimBandSelector();
-               singleImageChain->insertRight(bs.get(), current_source);
-               bs->setOutputBandList(theSrcRecords[idx].getBands());
-               current_source = bs.get();
-            }
-         }
-
-         // Install a histogram object if needed. This inserts just to the left of the resampler.
-         setupHistogram(singleImageChain, theSrcRecords[idx]);
-
-         // Add a cache just to the left of the resampler.
-         if (!theCacheExcludedFlag)
-            addChainCache(singleImageChain);
-
-         // Add the single image chain to the mosaic and save it to the product spec file:
-         singleImageChain->makeUniqueIds();
-
-         if (theSrcRecords[idx].isRgbData())
-         {
-            if (bandMergeObject == 0)
-            {
-               bandMergeObject = new ossimBandMergeSource();
-            }
-            bandMergeObject->connectMyInputTo(singleImageChain);
-            singleImageChain->changeOwner(bandMergeObject.get());
-         }
-         else
-         {
-            mosaicObject->connectMyInputTo(singleImageChain);
-            singleImageChain->changeOwner(mosaicObject.get());
-         }
-         //theContainer->addChild(singleImageChain);
-
-         // Set the weight for this image when doing a blend mosaic:
-         if (obm)
-            obm->setWeight(idx, theSrcRecords[idx].getWeight());
-      }
-   }
-
-   // Finished initializing the inputs to the mosaic. Add the mosaic to the product chain.
-   theProductChain = new ossimImageChain;
-   if (bandMergeObject != 0)
-   {
-      theProductChain->addFirst(bandMergeObject.get());
-   }
-   theProductChain->addFirst(mosaicObject.get());
-   
-   // Now need to pass the product chain through the histogram setup for possible remapper given 
-   // target histogram (used when histo-matching selected):
-   setupHistogram();
-
-   // When mosaicking common input projections without rendering each, need to add a renderer to the
-   // mosaic for reprojecting to output projection:
-   if(orthoMosaic)
-   {
-      ossimImageRenderer* renderer   = new ossimImageRenderer;
-      renderer->getResampler()->setFilterType(theResamplerType);
-      theProductChain->addFirst(current_source);
-   }
-
-   //---
-   // Now that "theProductChain" is initialized we must initialize elevation if needed as it can
-   // affect the tie point of the output projection.
-   //---
-   if ( isAffectedByElevation() )
-   {
-      ossimInit::instance()->initializeElevation();
-
-      // Chain gsd's affected by elevation so recompute.
-      reComputeChainGsds();
-   }
-
-   // Set up the output product's projection:
-   setupProjection();
-
-   // Annotation setup...
-   setupAnnotation();
-
-   // Output rect cutter:
-   setupCutter();
-
-   // Output radiometry filter:
-   setupOutputRadiometry();
-
-   // After all the connections have been established, add the product chain to the overall 
-   // product container. This container will also hold the writer object.
-   theContainer->addChild(theProductChain.get());
-
-   // Lastly, set up the write object (object2):
-   setupWriter();
-
-}
-
-//*************************************************************************************************
-// Initializes the Cut Rect filter to crop the mosaic to specified rectangle.
-// This method assumes that the view (theProductProjection) has already been propagated to all 
-// the renderers (via call to setView()). This was done by prior call to setupProjection().
-//*************************************************************************************************
-void ossimOrthoIgen::setupCutter()
-{
-   // The command line accepts cut rect specification in several formats. Consolidate them to
-   // a common form (UL tiepoint <theCutOrigin> and distance to LR pixel center <theCutDxDy>. This
-   // method also updates the product projection with new bounds:
-   consolidateCutRectSpec();
-
-   ossimImageSource* input_source = theProductChain->getFirstSource();
-   if((theCutDxDy.hasNans()&&theMaskShpFile.empty())||!theProductProjection.valid()||!input_source)
-      return;
-
-   //user may pass the shape filename with an query (e.g C:/myshp.shp|select * from myshp),
-   //parse the name of mask shape file here
-   ossimString query = "";
-   if (!theMaskShpFile.empty())
-   {
-     if (theMaskShpFile.contains("|"))
-     {
-       ossimString fileName = theMaskShpFile;
-       std::vector<ossimString> fileList = fileName.split("|");
-       if (fileList.size() > 1)
-       {
-         theMaskShpFile = fileList[0];
-         query = fileList[1];
-       }
-     }
-   }
-
-   if (!theMaskShpFile.exists())
-   {
-     if (theCutOriginUnit == OSSIM_METERS)  // projection in meters...
-     {
-       ossimEastingNorthingCutter* cutter = new ossimEastingNorthingCutter;
-       ossimDpt mpp (theProductProjection->getMetersPerPixel());
-       ossimDpt lr (theCutOrigin.x + theCutDxDy.x - mpp.x, theCutOrigin.y - theCutDxDy.y + mpp.y);
-       cutter->setView(theProductProjection.get());
-       cutter->setEastingNorthingRectangle(theCutOrigin, lr);
-       theProductChain->addFirst(cutter);
-     }
-     else // geographic projection, units = decimal degrees.
-     {
-       ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
-       std::vector<ossimGpt> polygon;
-
-       ossimDpt dpp (theProductProjection->getDecimalDegreesPerPixel());
-       ossimGpt ul(theCutOrigin.lat,                        theCutOrigin.lon               );
-       ossimGpt ur(theCutOrigin.lat,                        theCutOrigin.lon + theCutDxDy.x - dpp.x);
-       ossimGpt lr(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon + theCutDxDy.x - dpp.x);
-       ossimGpt ll(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon               );
-
-       polygon.push_back(ul);
-       polygon.push_back(ur);
-       polygon.push_back(lr);
-       polygon.push_back(ll);
-
-       cutter->setView(theProductProjection.get());
-       cutter->setNumberOfPolygons(1);
-       cutter->setPolygon(polygon);
-       theProductChain->addFirst(cutter);
-     }
-   }
-   else
-   {
-     ossimIrect inputRect = input_source->getBoundingRect();
-
-     ossimGeoPolyCutter* exteriorCutter = new ossimGeoPolyCutter;
-     exteriorCutter->setView(theProductProjection.get());
-
-     ossimGeoPolyCutter* interiorCutter = NULL;
-
-     ossimRefPtr<ossimImageHandler> shpHandler = ossimImageHandlerRegistry::instance()->open(theMaskShpFile);
-     ossimEsriShapeFileInterface* shpInterface = PTR_CAST(ossimEsriShapeFileInterface, shpHandler.get());
-     if (shpInterface != NULL)
-     {
-       if (!query.empty())
-       {
-         shpInterface->setQuery(query);
-       }
-       std::multimap<long, ossimAnnotationObject*> features = shpInterface->getFeatureTable();
-       if (features.size() > 0)
-       {
-         std::multimap<long, ossimAnnotationObject*>::iterator it = features.begin();
-         while (it != features.end())
-         {
-           ossimAnnotationObject* anno = it->second;
-           if (anno != NULL)
-           {
-             ossimGeoAnnotationPolyObject* annoPoly = PTR_CAST(ossimGeoAnnotationPolyObject, anno);
-             ossimGeoAnnotationMultiPolyObject* annoMultiPoly = NULL;
-             if (annoPoly == NULL)
-             {
-                annoMultiPoly = PTR_CAST(ossimGeoAnnotationMultiPolyObject, anno);
-             }
-             if (annoPoly != NULL)
-             {
-               std::vector<ossimGpt> polygon;
-
-               //get the points of a polygon
-               std::vector<ossimGpt> points = annoPoly->getPoints();
-               for (ossim_uint32 i = 0; i < points.size(); i++)
-               {
-                 polygon.push_back(points[i]);
-               }
-
-               //get polygon type, if it is an internal polygon, initialize the internal cutter
-               ossimGeoAnnotationPolyObject::ossimPolyType polyType = annoPoly->getPolyType();
-               if (polyType == ossimGeoAnnotationPolyObject::OSSIM_POLY_INTERIOR_RING)
-               {
-                 if (interiorCutter == NULL)
-                 {
-                   interiorCutter = new ossimGeoPolyCutter;
-                   interiorCutter->setView(theProductProjection.get());
-                   interiorCutter->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
-                 }
-                 interiorCutter->addPolygon(polygon);
-               }
-               else
-               {
-                 exteriorCutter->addPolygon(polygon);
-               }
-             }
-             else if (annoMultiPoly != NULL)
-             {
-               std::vector<ossimGeoPolygon> multiPolys = annoMultiPoly->getMultiPolygon();
-               for (ossim_uint32 i = 0; i < multiPolys.size(); i++)
-               {
-                 ossimGeoPolygon geoPoly = multiPolys[i];
-                 std::vector<ossimGeoPolygon> holePolys = geoPoly.getHoleList();
-                 if (holePolys.size() > 0)
-                 {
-                   if (interiorCutter == NULL)
-                   {
-                     interiorCutter = new ossimGeoPolyCutter;
-                     interiorCutter->setView(theProductProjection.get());
-                     interiorCutter->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
-                   }
-                   for (ossim_uint32 j = 0; j < holePolys.size(); j++)
-                   {
-                      interiorCutter->addPolygon(holePolys[j]);
-                   }
-                 }
-                 exteriorCutter->addPolygon(multiPolys[i]);
-               }
-             }
-             else
-             {
-                throw(ossimException(std::string("The geometry type of the mask shape file is not polygon.")));
-             }
-           }
-           it++;
-         }
-       }
-     }
-
-     //if user define the cut box, add it to the image chain
-     ossimGeoPolyCutter* boundCutter = NULL;
-     if (!theCutDxDy.hasNans() && !theCutOrigin.hasNans())
-     {
-       std::vector<ossimGpt> bound;
-       if (theCutOriginUnit == OSSIM_METERS)
-       {
-          ossimDpt mpp (theProductProjection->getMetersPerPixel());
-         ossimGpt ul = theProductProjection->inverse(ossimDpt(theCutOrigin.x, theCutOrigin.y));
-         ossimGpt ur = theProductProjection->inverse(ossimDpt(theCutOrigin.x + theCutDxDy.x - mpp.x, theCutOrigin.y));
-         ossimGpt lr = theProductProjection->inverse(ossimDpt(theCutOrigin.x + theCutDxDy.x - mpp.x, theCutOrigin.y - theCutDxDy.y + mpp.y));
-         ossimGpt ll = theProductProjection->inverse(ossimDpt(theCutOrigin.x, theCutOrigin.y - theCutDxDy.y + mpp.y));
-
-         bound.push_back(ul);
-         bound.push_back(ur);
-         bound.push_back(lr);
-         bound.push_back(ll);
-       }
-       else
-       {
-          ossimDpt dpp (theProductProjection->getDecimalDegreesPerPixel());
-          ossimGpt ul(theCutOrigin.lat,                        theCutOrigin.lon               );
-          ossimGpt ur(theCutOrigin.lat,                        theCutOrigin.lon + theCutDxDy.x - dpp.x);
-          ossimGpt lr(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon + theCutDxDy.x - dpp.x);
-          ossimGpt ll(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon               );
-
-         bound.push_back(ul);
-         bound.push_back(ur);
-         bound.push_back(lr);
-         bound.push_back(ll);
-       }
-       boundCutter = new ossimGeoPolyCutter;
-
-       boundCutter->setView(theProductProjection.get());
-       boundCutter->setNumberOfPolygons(1);
-       boundCutter->setPolygon(bound);
-     }
-
-     if (boundCutter == NULL)
-     {
-        ossimIrect shpRect = shpHandler->getBoundingRect();
-        if (shpRect.width() > inputRect.width() && shpRect.height() > inputRect.height())
-        {
-           exteriorCutter->setRectangle(inputRect);
-        }
-     }
-     
-     theProductChain->addFirst(exteriorCutter);
-
-     if (interiorCutter != NULL)
-     {
-       theProductChain->addFirst(interiorCutter);
-     }
-
-     if (boundCutter != NULL)
-     {
-        theProductChain->addFirst(boundCutter);
-     }
-   }
-}
-
-//*************************************************************************************************
-// METHOD 
-//*************************************************************************************************
-void ossimOrthoIgen::setupWriter()
-{
-   if (!theProductChain.valid())
-      return;
-
-   ossimRefPtr<ossimImageFileWriter> writer = 0;
-   
-   if (theWriterType.size())
-   {
-       // User selected writer with -w or --writer option.
-      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(theWriterType);
-   }
-   else if ( theWriterTemplate.size() && theWriterTemplate.exists() )
-   {
-      // User sent us a writer template.
-      ossimKeywordlist kwlTemplate;
-      kwlTemplate.addFile(theWriterTemplate);
-
-      // Try first with no prefix.
-      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwlTemplate);
-      if ( !writer.valid() )
-         writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwlTemplate, "object2.");
-   }
-   else if ( theTilingFilename == "%SRTM%")
-   {
-      ossimKeywordlist kwlWriter;
-      kwlWriter.add("type", "ossimGeneralRasterWriter", true);
-      kwlWriter.add("byte_order", "big_endian");
-      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwlWriter);
-      theProductFilename = theProductFilename.path();
-   }
-   else if (!theTilingFilename.empty())
-   {
-      if (theProductFilename.isDir())
-      {
-         theProductFilename = theProductFilename + "/" + theTilingFilename;
-      }
-   }
-
-   try
-   {
-      //---
-      // Set the output file name if not already set.
-      // NOTE: Could be outputing to stdout in which case outputFilename does not
-      // make sense.  Leaving here though to not break code downstream. (drb)
-      //---
-      if ( theProductFilename == ossimFilename::NIL )
-      {
-         throw(ossimException(std::string("Writer output filename not set.")));
-      }
-
-      //---
-      // Final check for writer.
-      //---
-      if ( !writer.valid() )
-      {
-         // Derive writer from the extension.
-         ossimFilename ext = theProductFilename.ext();
-         if ( ext.size() )
-            writer = ossimImageWriterFactoryRegistry::instance()->createWriterFromExtension(ext);
-
-         //---
-         // Lastly default to tiff.  Perhaps throw exception here instead. (drb)
-         //---
-         if( !writer.valid() )
-         {
-            writer = new ossimTiffWriter;
-            theProductFilename.setExtension("tif");
-         }
-      }
-
-      // PIXEL_IS_AREA HACK: Temporary patch to override command line alignment type with source
-      // image's alignment type. TO BE REMOVED ONCE EW GUI PROVIDES FOR USER-SETTING OF THIS 
-      // PROPERTY (OLK 09/11):
-      if (thePixelAlignment == OSSIM_PIXEL_IS_AREA)
-      {
-          ossimString pixelType ("pixel_type");
-          theWriterProperties.erase(pixelType);
-          theWriterProperties.insert(std::make_pair(pixelType, ossimString("area")));
-      }
-
-      //---
-      // Set writer filename, connect and add to writer to keyword list.
-      //---
-      if ( writer.valid() )
-      {
-         writer->setFilename(theProductFilename);
-         writer->connectMyInputTo(0, theProductChain.get());
-
-         ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
-         PropertyMap::iterator iter = theWriterProperties.begin();
-         while(iter != theWriterProperties.end())
-         {
-            propInterface->setProperty(iter->first, iter->second);
-            ++iter;
-         }
-         theContainer->addChild(writer.get());
-      }
-      else
-      {
-         throw(ossimException(std::string("Unable to create writer.")));
-      }
-   }
-   catch (const ossimException& e)
-   {
-      if (traceDebug())
-         ossimNotify(ossimNotifyLevel_DEBUG) << e.what() << std::endl;
-      throw; // re-throw exception
-   }
-}
-
-
-//*************************************************************************************************
-// This method establishes the output (view) projection of the product.
-// NOTE: Completely rewritten to simplify and reduce redundancy. OLK 3/10
-//*************************************************************************************************
-void ossimOrthoIgen::setupProjection()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"Entering ossimOrthoIgen::setupProjection():"<<std::endl;
-   }
-
-   theProductProjection = 0;
-
-   // Throw exception if no valid input image projection was established:
-   if(!theReferenceProj.valid())
-   {
-      std::string errMsg = "ossimOrthoIgen::setupProjection() -- Could not establish input image's "
-         "projection. Cannot setup output view.";
-      throw(ossimException(errMsg));
-   }
-
-   // Fetch the reference input projection first. Settings may be copied to the product projection:
-   ossimMapProjection* ref_map = PTR_CAST(ossimMapProjection, theReferenceProj.get());
-
-   // Now focus on establishing the output product projection.
-   // Consider externally specified geometry first:
-   if (theProjectionType == OSSIM_EXTERNAL_PROJECTION)
-   {
-      if (!theTemplateView.isReadable())
-      {
-         ossimString errMsg = "ossimOrthoIgen::setupProjection() -- Could not read the product "
-            "projection template file at <";
-         errMsg += theTemplateView;
-         errMsg += ">. Cannot establish output projection.";
-         throw(ossimException(errMsg));
-      }
-
-      // Default template format is no prefix, but consider alternate with prefix if first attempt 
-      // fails:
-      ossimKeywordlist templateKwl (theTemplateView);
-      ossimObjectFactoryRegistry* ofr = ossimObjectFactoryRegistry::instance();
-      ossimRefPtr<ossimObject> productObj = ofr->createObject(templateKwl, "product.projection.");
-      if(!productObj.valid())
-         productObj = ofr->createObject(templateKwl);
-      theProductProjection = PTR_CAST(ossimMapProjection, productObj.get());
-   }
-
-   // Geographic? (Assuming WGS 84 for now.)
-   else if (theProjectionType == OSSIM_GEO_PROJECTION)
-   {
-      theProductProjection = new ossimEquDistCylProjection();
-      ossimGpt gpt(0.0, 0.0);
-      if (theGeoScalingLatitude == 999.0) // flags that lat is to be computed
-      {
-        computeGeoScalingLatitude();
-        gpt = ossimGpt(theGeoScalingLatitude, 0.0);
-      }
-      else if (!ossim::isnan(theGeoScalingLatitude))
-        gpt = ossimGpt(theGeoScalingLatitude, 0.0);
-      theProductProjection->setOrigin(gpt);
-   }
-
-   // CRS code specified on the command line
-   else if (theProjectionType == OSSIM_SRS_PROJECTION)
-   {
-      ossimProjection* base_proj = 
-        ossimEpsgProjectionFactory::instance()->createProjection(theCrsString);
-
-      theProductProjection = PTR_CAST(ossimMapProjection, base_proj);
-      if(theProductProjection.valid())
-      {
-         // Reassign the type for geographic. Now we know
-         if (theProductProjection->isGeographic())
-         {
-            theProjectionType = OSSIM_GEO_PROJECTION;
-            ossimGpt gpt(0.0, 0.0);
-            if (!ossim::isnan(theGeoScalingLatitude))
-              gpt = ossimGpt(theGeoScalingLatitude, 0.0);
-            theProductProjection->setOrigin(gpt);
-         }
-      }
-      else
-      {
-         theProjectionType = OSSIM_UNKNOWN_PROJECTION;
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimOrthoIgen::setupProjection() WARNING:" << " Unsupported spatial reference system."
-            << " Will default to the projection from the input image."
-            << std::endl;
-      }
-   }
-
-   // UTM?
-   else if (theProjectionType == OSSIM_UTM_PROJECTION)
-   {
-      ossimUtmProjection* utm = new ossimUtmProjection;
-      ossimGpt refGpt;
-      theReferenceProj->lineSampleToWorld(ossimDpt(0,0), refGpt);
-
-      utm->setZone(refGpt);
-      utm->setHemisphere(refGpt);
-      theProductProjection = utm;
-   }
-
-   // None of the above?
-   else
-   {
-      // Either OSSIM_INPUT_PROJECTION or OSSIM_UNKNOWN_PROJECTION. In both cases
-      // just use the first image's input projection for the output. Need to make 
-      // sure the input_proj is a map projection though:
-      if (ref_map)
-      {
-         theProductProjection = PTR_CAST(ossimMapProjection, ref_map->dup());
-         theProjectionType = OSSIM_INPUT_PROJECTION; // just in case it was unknown before
-      }
-      else
-      {  
-         theProjectionType = OSSIM_GEO_PROJECTION;
-         theProductProjection = new ossimEquDistCylProjection();
-
-         ossimGpt gpt(0.0, 0.0);
-         if (!ossim::isnan(theGeoScalingLatitude))
-            gpt = ossimGpt(theGeoScalingLatitude, 0.0);
-         theProductProjection->setOrigin(gpt);
-      }  
-   }
-
-   // At this point there should be a valid output projection defined:
-   if (!theProductProjection.valid())
-   {
-      std::string errMsg = "ossimOrthoIgen::setupProjection() -- Could not establish valid output "
-         "projection";
-      throw(ossimException(errMsg));
-   }
-
-   // HACK (OLK 06/10): The projection may not have had the PCS code initialized even though it
-   // is an EPSG projection, so take this opportunity to identify a PCS for output:
-   ossim_uint32 pcs_code = theProductProjection->getPcsCode();
-   if (pcs_code == 0)
-   {
-      pcs_code = ossimEpsgProjectionDatabase::instance()->
-         findProjectionCode(*(theProductProjection.get()));
-      theProductProjection->setPcsCode(pcs_code);
-   }
-
-   // Bootstrap the process of establishing the mosaic tiepoint by setting it to the reference proj.
-   if (ref_map)
-      theProductProjection->setUlGpt(ref_map->getUlGpt());
-
-   // cout << "ref_map->getUlGpt(): " << ref_map->getUlGpt() << endl;
-
-   // Base class makes sure the product view projection is properly wired into the chain. 
-   setView();
-
-   // Set the desired image GSD. This is nontrivial due to the many ways GSD can be implied and/or
-   // explicitly provided. This method also does a setView before returning:
-   setProductGsd();
-
-   theProjectionName = theProductProjection->getProjectionName();
-
-   // At this point, the product projection will not have a tiepoint (UL corner coordinates)
-   // defined unless it is the same projection as the input reference. Need to set it now. Note that
-   // if a cut-rect is specified, the tie-point will be modified later in setupCutter()
-   establishMosaicTiePoint();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimOrthoIgen::setupProjection DEBUG:"
-         << "Leaving...." << __LINE__
-         << std::endl;
-   }
-}
-
-//*************************************************************************************************
-// METHOD
-//*************************************************************************************************
-void ossimOrthoIgen::setupAnnotation()
-{
-   ossimImageSource* input_source = theProductChain->getFirstSource();
-   if (!input_source)
-      return;
-
-   if(theAnnotationTemplate.exists() == false)
-      return;
-   
-   ossimKeywordlist templateKwl;
-   if (templateKwl.addFile(theAnnotationTemplate) == false)
-      return;
-   
-   ossimRefPtr<ossimObject> obj = ossimObjectFactoryRegistry::instance()->
-      createObject(templateKwl, "object1.");
-   if (obj.valid())
-   {
-      ossimGeoAnnotationSource* oga = PTR_CAST(ossimGeoAnnotationSource, obj.get());
-      if (oga)
-      {
-         if (theProductProjection.valid())
-            oga->setGeometry(new ossimImageGeometry(0, theProductProjection.get())); 
-         theProductChain->addFirst(oga);
-      }
-   }
-   return;
-}
-
-//*************************************************************************************************
-// Set up multi-file tiling if indicated on the command line.
-//*************************************************************************************************
-bool ossimOrthoIgen::setupTiling()
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimOrthoIgen::setupTiling: Entered......" << std::endl;
-   }
-   ossimKeywordlist templateKwl;
-   ossimFilename outputFilename = theProductFilename;
-   theTilingEnabled = false;
-
-   if ((theTilingTemplate == "")||(!templateKwl.addFile(theTilingTemplate)))
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimOrthoIgen::setupTiling: Leaving......" << __LINE__ << std::endl;
-      }
-      return false;
-   }
-
-   ossimString prefix ("igen.tiling.");
-   while (1)
-   {
-      if(outputFilename.isDir())
-      {
-         if(templateKwl.find(prefix.chars(), "type"))
-         {
-            theTilingFilename = templateKwl.find(prefix.chars(),"tile_name_mask");
-            theTilingEnabled = true;
-            break;
-         }
-         else if (templateKwl.find(prefix.chars(), "tile_size") || templateKwl.find(prefix.chars(), "tile_source"))
-         {
-            theTilingFilename = templateKwl.find(prefix.chars(),"output_file_name");
-            theTilingEnabled = true;
-            break;
-         }
-      }
-      else
-      {
-         theTilingFilename = outputFilename.file();
-         if (!theTilingFilename.contains("%"))
-         {
-            ossimString fileNoExt = theTilingFilename.fileNoExtension();
-            ossimString ext = theTilingFilename.ext();
-            theTilingFilename = fileNoExt + "_%r%_%c%." + ext;
-         }
-         if(templateKwl.find(prefix.chars(), "type"))
-         {
-            templateKwl.add(prefix.chars(), "tile_name_mask", theTilingFilename.c_str(), true);
-            ossimFilename path (outputFilename.path());
-            theProductFilename = path;
-            theTilingEnabled = true;
-            break;
-         }
-         else if (templateKwl.find(prefix.chars(), "tile_size") || templateKwl.find(prefix.chars(), "tile_source"))
-         {
-            templateKwl.add(prefix.chars(), "output_file_name", theTilingFilename.c_str(), true);
-            ossimFilename path (outputFilename.path());
-            theProductFilename = path;
-            theTilingEnabled = true;
-            break;
-         }
-      }
-
-      // If we got here, then no matches were found in the template. Try again but without a prefix:
-      if (prefix.empty())
-         break;
-      prefix.clear();
-   }
-
-   // Initialize the tiling object if enabled:
-   if (templateKwl.find(prefix.chars(), "tile_size"))
-   {
-      theTiling = 0;
-      theTiling = new ossimTilingRect;
-   }
-
-   if (templateKwl.find(prefix.chars(), "tile_source"))
-   {
-      theTiling = 0;
-      theTiling = new ossimTilingPoly;
-   }
-
-   if (theTilingEnabled && !theTiling->loadState(templateKwl, prefix))
-      theTilingEnabled = false;
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimOrthoIgen::setupTiling: templateKwl = \n" << templateKwl << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimOrthoIgen::setupTiling: Leaving......" << __LINE__ << std::endl;
-   }
-   
-   return true;
-}
-
-//*************************************************************************************************
-// Consolidates specification of bounding rect given various ways of specifying on the command
-// line. This avoids multiple, redundant checks scattered throughout the code. On exit:
-// 
-//   1. theCutOriginType is converted to OSSIM_UPPER_LEFT_ORIGIN
-//   2. theCutOrigin is converted to the proper coordinates (lat/lon or easting/northing) and
-//      associated theCutOriginUnits is assigned accordingly.
-//   3. theCutDxDy reflects the full size of the rect, in the units corresponding to the projection
-//      and associated theCutDxDyUnit is set to METERS for UTM, DEGREES for geographic
-//   4. The product projection's origin (image center) and tie point are updated to reflect the
-//      output rectangle.
-//
-//*************************************************************************************************
-void ossimOrthoIgen::consolidateCutRectSpec()
-{
-   if (!theProductProjection.valid() || theCutDxDy.hasNans() || theCutOrigin.hasNans())
-      return; 
-
-   if ((theCutDxDyUnit != OSSIM_METERS) && 
-       (theCutDxDyUnit != OSSIM_DEGREES) &&
-       (theCutDxDyUnit != OSSIM_UNIT_UNKNOWN))
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimOrthoIgen::consolidateCutRectSpec: An unhandled"
-         " type of units was encountered. The cut rect needs to be specified in either meters or"
-         " degrees. The resulting cut rect and origin may be incorrect." << std::endl;
-      return;
-   }
-
-   ossimGpt originPLH;
-   ossimDpt resolution;
-
-   // Geographic Projection (lat/lon cut rect) requested?
-   if(theProductProjection->isGeographic()) 
-   {
-      // geographic projection; units need to be decimal degrees. First check for consistent origin:
-      if (theCutOriginUnit == OSSIM_METERS)
-      {
-         originPLH = theProductProjection->inverse(theCutOrigin);
-         theCutOrigin.x = originPLH.lon;
-         theCutOrigin.y = originPLH.lat;
-      }
-      else
-      {
-         originPLH.lat = theCutOrigin.y;
-         originPLH.lon = theCutOrigin.x;
-      }
-
-      // Check for consistent rect size:
-      if (theCutDxDyUnit == OSSIM_METERS)
-      {
-         ossimDpt mtrs_per_deg (originPLH.metersPerDegree());
-         theCutDxDy.x = theCutDxDy.x/mtrs_per_deg.x;
-         theCutDxDy.y = theCutDxDy.y/mtrs_per_deg.y;
-      }
-
-      // Set these to the correct units. May already be correct, but just in case...
-      theCutOriginUnit = OSSIM_DEGREES; 
-      theCutDxDyUnit = OSSIM_DEGREES; 
-
-      if (theClipToValidRectFlag)
-      {
-         // Now we need to clip the cut rect by the valid image footprint for the entire mosaic:
-         ossimDrect boundingRect = theProductChain->getBoundingRect(); // in view coordinates
-
-         // The bounding rect is in image space. Since pixel-is-point, the actual valid area on the
-         // ground will extend 1/2 pixel beyond the centers, so grow the bounding rect by 1/2 p:
-         boundingRect.expand(ossimDpt(0.5, 0.5));
-         ossimGpt mosaic_ul, mosaic_lr;
-         theProductProjection->lineSampleHeightToWorld(boundingRect.ul(), 0, mosaic_ul);
-         theProductProjection->lineSampleHeightToWorld(boundingRect.lr(), 0, mosaic_lr);
-
-         // Establish the LR bound defined by the cut-rect and clip the cut-rect if necessary:
-         ossimGpt cutrect_lr (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon + theCutDxDy.lon);
-         if (mosaic_ul.lat < theCutOrigin.lat)
-            theCutOrigin.lat = mosaic_ul.lat;
-         if (mosaic_lr.lat > cutrect_lr.lat)
-            theCutDxDy.lat = theCutOrigin.lat - mosaic_lr.lat;
-         if (mosaic_ul.lon > theCutOrigin.lon)
-            theCutOrigin.lon = mosaic_ul.lon;
-         if (mosaic_lr.lon < cutrect_lr.lon)
-            theCutDxDy.lon = mosaic_lr.lon - theCutOrigin.lon;
-      }
-
-      resolution = theProductProjection->getDecimalDegreesPerPixel();
-   }
-
-   // Map Projection (easting, northing cut rect) requested?
-   else 
-   {
-      // Special case code to account for origin and delta being specified in geographic, leading to
-      // offset error due to northing difference between UL and UR corners at constant lat:
-      if ((theCutOriginType == OSSIM_UPPER_LEFT_ORIGIN) &&
-          (theCutOriginUnit == OSSIM_DEGREES) && (theCutDxDyUnit == OSSIM_DEGREES))
-      {
-         ossimGpt ulgp (theCutOrigin.lat                 , theCutOrigin.lon                 , 0);
-         ossimGpt urgp (theCutOrigin.lat                 , theCutOrigin.lon + theCutDxDy.lon, 0);
-         ossimGpt llgp (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon                 , 0);
-         ossimGpt lrgp (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon + theCutDxDy.lon, 0);
-
-         ossimDpt ulen (theProductProjection->forward(ulgp));
-         ossimDpt uren (theProductProjection->forward(urgp));
-         ossimDpt llen (theProductProjection->forward(llgp));
-         ossimDpt lren (theProductProjection->forward(lrgp));
-         
-         double n_top    = (ulen.y > uren.y ? ulen.y : uren.y);
-         double n_bottom = (llen.y < lren.y ? llen.y : lren.y);
-         double e_left   = (ulen.x < llen.x ? ulen.x : llen.x);
-         double e_right  = (uren.x > lren.x ? uren.x : lren.x);
-
-         theCutOrigin.x = e_left;
-         theCutOrigin.y = n_top;
-
-         theCutDxDy.x = e_right - e_left;
-         theCutDxDy.y = n_top - n_bottom;
-
-         if (theClipToValidRectFlag)
-         {
-            // Now we need to clip the cut rect by the valid image footprint for the entire mosaic:
-            ossimDrect boundingRect = theProductChain->getBoundingRect(); // in view coordinates
-            boundingRect.expand(ossimDpt(0.5, 0.5));
-            ossimDpt mosaic_ul, mosaic_lr;
-            theProductProjection->lineSampleToEastingNorthing(boundingRect.ul(), mosaic_ul);
-            theProductProjection->lineSampleToEastingNorthing(boundingRect.lr(), mosaic_lr);
-
-            // Establish the LR bound defined by the cut-rect and clip the cut-rect if necessary:
-            ossimDpt cutrect_lr (theCutOrigin.x + theCutDxDy.x, theCutOrigin.y - theCutDxDy.y);
-            if (mosaic_ul.y < theCutOrigin.y)
-               theCutOrigin.y = mosaic_ul.y;
-            if (mosaic_lr.y > cutrect_lr.y)
-               theCutDxDy.y = theCutOrigin.y - mosaic_lr.y;
-            if (mosaic_ul.x > theCutOrigin.x)
-               theCutOrigin.x = mosaic_ul.x;
-            if (mosaic_lr.x < cutrect_lr.x)
-               theCutDxDy.x = mosaic_lr.x - theCutOrigin.x;
-         }
-      }
-      else
-      {
-         // Just map the geographic coordinates to easting/northing, without regard to corner
-         // mismatch:
-         if (theCutOriginUnit == OSSIM_DEGREES)
-         {
-            originPLH.lat = theCutOrigin.y;
-            originPLH.lon = theCutOrigin.x;
-            theCutOrigin = theProductProjection->forward(originPLH);
-         }
-         else
-         {
-            // Determine the geographic position that might be needed for scaling below:
-            originPLH = theProductProjection->inverse(theCutOrigin);
-         }
-
-         // Check for consistent rect size:
-         if (theCutDxDyUnit == OSSIM_DEGREES)
-         {
-            // POTENTIAL BUG: conversion from degrees longitude to meters should be a function 
-            //                of latitude here. Implemented here but needs testing:
-            ossimDpt mtrs_per_deg (originPLH.metersPerDegree());
-            theCutDxDy.x = theCutDxDy.x * mtrs_per_deg.x;
-            theCutDxDy.y = theCutDxDy.y * mtrs_per_deg.y;
-         }
-      }
-
-      // Set these to the correct units. May already be correct, but just in case...
-      theCutOriginUnit = OSSIM_METERS; 
-      theCutDxDyUnit = OSSIM_METERS; 
-
-      resolution = theProductProjection->getMetersPerPixel();
-   }
-
-   // The cut rect corresponds to the edges of the pixel ("edge-to-edge"), while OSSIM considers
-   // coordinates to correspond to the pixel centers. Need to shift the origin to the SE by 1/2p:
-   ossimDpt half_pixel = resolution * 0.5;
-   theCutOrigin.y -= half_pixel.y;
-   theCutOrigin.x += half_pixel.x;
-
-   // The size of the cutrect needs to be an integral number of pixels in output space:
-   theCutDxDy.x = (floor(theCutDxDy.x/resolution.x + 0.5))* resolution.x;
-   theCutDxDy.y = (floor(theCutDxDy.y/resolution.y + 0.5))* resolution.y;
-
-   // Adjust a center origin specification to be Upper Left corner:
-   if (theCutOriginType == OSSIM_CENTER_ORIGIN)
-   {
-      theCutOrigin.y += theCutDxDy.y;
-      theCutOrigin.x -= theCutDxDy.x;
-
-      // theCutDxDy in this case represented a radius. This needs to be converted to 
-      // OSSIM_UPPER_LEFT_ORIGIN form:
-      theCutDxDy.x *= 2.0;
-      theCutDxDy.y *= 2.0;
-      theCutOriginType = OSSIM_UPPER_LEFT_ORIGIN;
-   }
-
-   // Finally, update the product projection with new rectangle:
-   ossimDpt cutCenter (theCutOrigin.x + theCutDxDy.x/2.0, theCutOrigin.y - theCutDxDy.y/2.0);
-   ossimGpt gpt;
-   if (theCutDxDyUnit == OSSIM_METERS)
-   {
-      // Set the E/N values for the cut origin as the tie point:
-      theProductProjection->setUlTiePoints(theCutOrigin);
-   }
-   else
-   {
-      // Set the projection center (origin) latitude at the center of the cut rect:
-      gpt.lat = cutCenter.y;
-      gpt.lon = 0.0;
-      theProductProjection->setOrigin(gpt);
-
-      // Set the lat/lon values for the cut origin as the tie point:
-      gpt.lat = theCutOrigin.y;
-      gpt.lon = theCutOrigin.x;
-      theProductProjection->setUlTiePoints(gpt);
-   }
-
-   // cout << "\n**************** proj 2:\n";
-   // theProductProjection->print(cout);
-
-   // Propagates changes to the projection to the processing chain:
-   setView();
-}
-
-//*************************************************************************************************
-//! Sets up the histogram operation requested for the image chain passed in.
-//*************************************************************************************************
-void ossimOrthoIgen::setupHistogram(ossimImageChain* input_chain, const ossimSrcRecord& src_record)
-{
-   // Check if the source passed in is the output mosaic object, because the target
-   // histogram remapper needs to be connected to it (only valid when histo matching is requested):
-   if (input_chain == NULL)
-   {
-      if (!theTargetHistoFileName.isReadable())
-         return;
-
-      ossimHistogramRemapper* remapper = new ossimHistogramRemapper;
-      remapper->openHistogram(theTargetHistoFileName);
-      theProductChain->addFirst(remapper);
-      return;
-   }
-
-   // Check if any histo operation was requested on individual image:
-   if ((ossim::isnan(theHighPercentClip) || ossim::isnan(theLowPercentClip)) &&
-      !theUseAutoMinMaxFlag && (theStdDevClip < 0) && src_record.getHistogramOp().empty() &&
-      theTargetHistoFileName.empty())
-   {
-      return; // no histo op requested
-   }
-
-   // Remaining operations require a histogram on the input image source:
-   ossimImageHandler* handler = PTR_CAST(ossimImageHandler, input_chain->getLastSource());
-   if (handler == NULL)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)<<"Could not locate an image handler object in the image"
-         << "chain provided. This should not happen. Ignoring histogram request." << std::endl;
-      return;
-   }
-
-   // Establish the ideal filename for this histogram. The following do-block is all for testing
-   // different histogram file naming schemes since alternate directory and entry-indexing might be
-   // used:
-   ossimFilename histoFilename (src_record.getHistogramPath());
-   ossimFilename candidateHistoFilename;
-   ossimFilename defaultHistoFilename (handler->createDefaultHistogramFilename());
-   ossimFilename entryName (handler->getFilenameWithThisExtension(ossimString(".his"), true));
-
-   do
-   {
-      if (!histoFilename.empty())
-      {
-         // Try histogram filename based on specified name in the .src file:
-         if (histoFilename.isDir())
-            histoFilename = histoFilename.dirCat(defaultHistoFilename.file());
-         if (histoFilename.exists()) break;
-
-         // Try specified name with entry index:
-         if (src_record.getEntryIndex() >= 0)
-         {
-            histoFilename = histoFilename.path().dirCat(entryName.file());
-            if (histoFilename.exists()) break;
-         }
-
-         // Not found so set the candidate filename in case we need to generate it:
-         candidateHistoFilename = histoFilename;
-      }
-
-      // Next try looking for a histogram based on the default name:
-      histoFilename = defaultHistoFilename;
-      if (histoFilename.exists())  break;
-
-      //---
-      // Last possibility is the default name with entry index.  We will test
-      // even if there is only one entry, like "file_e0.his".
-      //---
-      histoFilename = entryName;
-      if (histoFilename.exists())  break;
-
-      // If not already set, set the candidate filename in case we need to generate it:
-      if (candidateHistoFilename.empty())
-         candidateHistoFilename = histoFilename;
-   }
-   while (false); // only pass through once
-
-
-   // If the histogram was still not located, look into creating one:
-   if (!histoFilename.exists())
-   {
-      // Check the preferences for histogram autogeneration:
-      ossimString lookup = ossimPreferences::instance()->findPreference(AUTOGENERATE_HISTOGRAM_KW);
-      if (lookup.toBool())
-      {
-         // No histogram available for this image, need to create one:
-         histoFilename = candidateHistoFilename;
-         ossimNotify(ossimNotifyLevel_WARN) <<"Histogram file <" <<  histoFilename
-            << "> not found. Creating one now..."  << std::endl;
-         bool success = createHistogram(input_chain, histoFilename);
-         if (!success)
-         {
-            ossimNotify(ossimNotifyLevel_WARN) <<"Error encountered creating histogram file <" 
-               << histoFilename << ">. Ignoring histogram request."  << std::endl;
-            return;
-         }
-      }
-   }
-
-   // Need to insert any histogram object to the left of the renderer in the chain. Search for a 
-   // renderer and save for later:
-   // ossimConnectableObject* renderer = PTR_CAST(ossimConnectableObject,
-   //    input_chain->findFirstObjectOfType(ossimString("ossimImageRenderer")));
-
-   ossimTypeNameVisitor visitor( ossimString("ossimImageRenderer"),
-                                 true, // firstofTypeFlag
-                                 (ossimVisitor::VISIT_INPUTS|
-                                  ossimVisitor::VISIT_CHILDREN) );
-   input_chain->accept( visitor );
-   ossimRefPtr<ossimImageRenderer> renderer = visitor.getObjectAs<ossimImageRenderer>(0);
-
-   // Histo Match?
-   if (theTargetHistoFileName.isReadable())
-   {
-      // A histogram match was requested. This involves applying a histo equalization to the input
-      // chain and then applying an inverted equalization using the target histogram:
-      ossimRefPtr<ossimHistogramEqualization> forwardEq = new ossimHistogramEqualization;
-      ossimRefPtr<ossimHistogramEqualization> inverseEq = new ossimHistogramEqualization;
-      
-      // Init equalizers with the source and target histogram files:
-      forwardEq->setInverseFlag(false);
-      forwardEq->setHistogram(histoFilename);
-      inverseEq->setInverseFlag(true);
-      inverseEq->setHistogram(theTargetHistoFileName);
-
-      // Need check that source and target histograms are compatible:
-      ossimRefPtr<ossimMultiResLevelHistogram> sourceHisto = forwardEq->getHistogram();
-      ossimRefPtr<ossimMultiResLevelHistogram> targetHisto = inverseEq->getHistogram();
-      bool are_incompatible = false;
-      if (!sourceHisto.valid() || !targetHisto.valid())
-      {
-         are_incompatible = true;
-      }
-      else
-      {
-         ossim_uint32 num_source_bands = sourceHisto->getNumberOfBands();
-         if (num_source_bands != targetHisto->getNumberOfBands())
-         {
-            are_incompatible = true;
-         }
-         else
-         {
-            for (ossim_uint32 band=0; band<num_source_bands; band++)
-            {
-               ossimRefPtr<ossimHistogram> sourceBandHisto = sourceHisto->getHistogram(band);
-               ossimRefPtr<ossimHistogram> targetBandHisto = targetHisto->getHistogram(band);
-               if (!sourceBandHisto.valid() || !targetBandHisto.valid() ||
-                   (sourceBandHisto->GetRes() != targetBandHisto->GetRes()))
-               {
-                  are_incompatible = true;
-                  break;
-               }
-            }
-         }
-      }
-      if (are_incompatible)
-      {
-         // Error was encountered establishing histograms for match operation:
-         ossimNotify(ossimNotifyLevel_WARN)<<"Error encountered setting up histogram match "
-            "operation. Check that source and target histograms are compatible. No histogram "
-            "operations will be performed on this image." << std::endl;
-         return;
-      }
-
-      // The source and target histos are compatible, insert to the left of renderer if one exists:
-      if ( renderer.valid() )
-         input_chain->insertLeft( forwardEq.get(), renderer.get() );
-      else
-         input_chain->addFirst(forwardEq.get());
-      input_chain->insertRight(inverseEq.get(), forwardEq.get());
-      
-      return;
-   }
-
-   // Remaining possibilities (clip or stretch) require a remapper.
-   // Insert to the left of renderer if one exists:
-   ossimRefPtr<ossimHistogramRemapper> remapper = new ossimHistogramRemapper;
-   if ( renderer.valid() )
-      input_chain->insertLeft( remapper.get(), renderer.get() );
-   else
-      input_chain->addFirst(remapper.get());
-
-   // Fetch the input histogram:
-   bool histo_read_ok = remapper->openHistogram(histoFilename);
-   if (!histo_read_ok)
-   {
-      // No histogram available for this image, need to create one (TODO):
-      ossimNotify(ossimNotifyLevel_WARN)<<"Error encountered loading histogram file <" 
-         << histoFilename << ">. No histogram operations will be performed on this image." 
-         << std::endl;
-      return;
-   }
-
-   // Set values to construct remap table:
-   if (!ossim::isnan(theHighPercentClip) && !ossim::isnan(theLowPercentClip))
-   {
-      // Hi/Lo clip requested
-      remapper->setHighNormalizedClipPoint(1.0-theHighPercentClip);
-      remapper->setLowNormalizedClipPoint(theLowPercentClip);
-   }
-
-   else
-   {
-      // Consider histogram stretch operations. These can be on a per-image basis or global for all
-      // input images. Give priority to the img_histo_op (per-image spec) over general flags below:
-      ossimHistogramRemapper::StretchMode mode = ossimHistogramRemapper::STRETCH_UNKNOWN;
-      ossimString img_histo_op (src_record.getHistogramOp());
-      if (img_histo_op=="auto-minmax")
-         mode = ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX;
-      else if (img_histo_op.contains("std-stretch"))
-      {
-         if (img_histo_op.contains("1"))
-            mode = ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN;
-         else if (img_histo_op.contains("2"))
-            mode = ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN;
-         else if (img_histo_op.contains("3"))
-            mode = ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN;
-      }
-      else if (theUseAutoMinMaxFlag)
-         mode = ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX;
-      else if (theStdDevClip > 0)
-         mode = (ossimHistogramRemapper::StretchMode) theStdDevClip;
-
-      // Finally init the remapper with proper stretch mode:
-      if (mode != ossimHistogramRemapper::STRETCH_UNKNOWN)
-         remapper->setStretchMode(mode, true);
-   }
-   
-   return;
-}
-
-
-//*************************************************************************************************
-//! Utility method for creating a histogram for an input image. Returns TRUE if successful.
-//*************************************************************************************************
-bool ossimOrthoIgen::createHistogram(ossimImageChain* chain, const ossimFilename& histo_filename)
-{
-   ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
-   ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
-
-   histoSource->connectMyInputTo(chain);
-   histoSource->enableSource();
-   histoSource->setComputationMode(OSSIM_HISTO_MODE_FAST);
-
-   writer->connectMyInputTo(histoSource.get());
-   writer->setFilename(histo_filename);
-   writer->addListener(&theStdOutProgress);
-   bool success = writer->execute();
-
-   writer=0;
-   histoSource=0;
-
-   if (success)
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)<<std::endl;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"Error encountered creating Histogram file <" 
-         << histo_filename << ">. No histogram operations will be performed on this image." 
-         << std::endl;
-   }
-
-   return success;
-}
-
-//*************************************************************************************************
-// METHOD
-//*************************************************************************************************
-void ossimOrthoIgen::addChainCache(ossimImageChain* chain) const
-{
-   if (chain)
-   {
-      //ossimConnectableObject* renderer =
-      //   PTR_CAST(ossimConnectableObject,
-      //             chain->findFirstObjectOfType(ossimString("ossimImageRenderer")));
-
-      ossimTypeNameVisitor visitor( ossimString("ossimImageRenderer"),
-                                    true, // firstofTypeFlag
-                                    (ossimVisitor::VISIT_INPUTS|
-                                     ossimVisitor::VISIT_CHILDREN) );
-      chain->accept( visitor );
-      ossimRefPtr<ossimImageRenderer> renderer = visitor.getObjectAs<ossimImageRenderer>(0);
-      if ( renderer.valid() )
-      {
-         ossimCacheTileSource* cache = new ossimCacheTileSource();
-         chain->insertLeft( cache, renderer.get() );
-      }
-   }
-}
-
-//*************************************************************************************************
-// Generates a log KWL file that could be fed directly to Igen. Used for verifying chain.
-//*************************************************************************************************
-void ossimOrthoIgen::generateLog()
-{
-   if (!theSrcRecords.size() || !theProductChain.valid() || theProductFilename.empty())
-      return;
-
-   // Establish output filename:
-   ossimFilename logFile = theProductFilename;
-   logFile.setExtension("log");
-
-   // Fill a KWL with all info:
-   ossimKeywordlist kwl; 
-   theContainer->saveState(kwl);
-
-   if (theProductProjection.valid())
-      theProductProjection->saveState(kwl, "product.projection.");
-
-   kwl.write(logFile.chars());
-}
-
-//*************************************************************************************************
-//! Determines the UL corner tiepoint of the product projection as the overall UL corner of the
-//! mosaic. This may not be the final tiepoint, since a cut origin may have been specified, and the
-//*************************************************************************************************
-void ossimOrthoIgen::establishMosaicTiePoint()
-{
-   if (!theProductChain.valid())
-      return;
-
-   // Need to find all image handlers to query for their UL ground point:
-#if 0
-   ossimConnectableObject::ConnectableObjectList clientList;
-   theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler), true, true);
-
-   if (clientList.size() == 0)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::establishMosaicTiePoint() WARNING -- "
-         "Expected to find image handler in the chain but none was identified."<<std::endl;
-      return;
-   }
-#endif
-
-   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
-                                 false, // firstofTypeFlag
-                                 (ossimVisitor::VISIT_INPUTS|
-                                  ossimVisitor::VISIT_CHILDREN) );
-   theProductChain->accept( visitor );
-
-   if ( visitor.getObjects().empty() )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::establishMosaicTiePoint() WARNING -- "
-         "Expected to find image handler in the chain but none was identified."<<std::endl;
-      return;
-   }
-
-   ossimGpt tie_gpt_i, tie_gpt;
-   ossimDpt tie_dpt_i, tie_dpt;
-   tie_gpt.makeNan();
-   tie_gpt.height(0.0);
-   tie_dpt.makeNan();
-
-   // Loop over all input handlers and latch the most NW tiepoint as the mosaic TP:
-   //   ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
-   // while (iter != clientList.end())
-   for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
-   {
-      // ossimImageHandler* handler = PTR_CAST(ossimImageHandler, (*iter).get());
-      // iter++;
-
-      ossimImageHandler* handler = visitor.getObjectAs<ossimImageHandler>( i );
-      if (!handler) break;
-
-      ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-      if (!geom.valid()) 
-         continue; // Skip over any non geometry inputs (e.g., masks)
-
-      if ( theProductProjection->isGeographic() )
-      {
-         geom->getTiePoint( tie_gpt_i, true ); // True to get edge of tie.
-         if ( tie_gpt_i.hasNans() == false )
-         {
-            if (tie_gpt.hasNans())
-               tie_gpt = tie_gpt_i;
-            else
-            {
-               if (tie_gpt_i.lat > tie_gpt.lat) 
-                  tie_gpt.lat = tie_gpt_i.lat;
-               if (tie_gpt_i.lon < tie_gpt.lon) 
-                  tie_gpt.lon = tie_gpt_i.lon;
-            }
-         }
-      }
-      else
-      {
-         geom->getTiePoint( tie_dpt_i, true ); // True to get edge of tie.
-         if ( tie_dpt_i.hasNans() == false )
-         {
-            if (tie_dpt.hasNans())
-               tie_dpt = tie_dpt_i;
-            else
-            {
-               if (tie_dpt_i.y > tie_dpt.y) 
-                  tie_dpt.y = tie_dpt_i.y;
-               if (tie_dpt_i.x < tie_dpt.x) 
-                  tie_dpt.x = tie_dpt_i.x;
-            }
-         }
-      }
-   }
-   
-#if 0
-      // Establish input image bounding rect, making sure to expand to include the FULL pixel since
-      // pixel is point -- i.e. the pixel coordinate corresponds to the center of the pixel area, 
-      // not the edge. Therefore shift the image point by 1/2 pixel to correspond to edges:
-      // (OLK 09/11)
-      ossimDrect boundingRect (handler->getBoundingRect());
-      vector<ossimDpt> img_vertices;
-      img_vertices.push_back(boundingRect.ul() + ossimDpt(-0.5, -0.5));
-      img_vertices.push_back(boundingRect.ur() + ossimDpt( 0.5, -0.5));
-      img_vertices.push_back(boundingRect.lr() + ossimDpt( 0.5,  0.5));
-      img_vertices.push_back(boundingRect.ll() + ossimDpt(-0.5,  0.5));
-      
-
-      // The tie point will be in easting/northing or lat/lon depending on the type of projection 
-      // used for the product. Need to consider all image corners since the orientation of the image
-      // is not known:
-      for (int j=0; j<4; j++)
-      {
-         geom->localToWorld(img_vertices[j], tie_gpt_i);
-         if (theProductProjection->isGeographic())
-         {
-            tie_gpt.height(0.0);
-            if (tie_gpt.hasNans())
-               tie_gpt = tie_gpt_i;
-            else
-            {
-               if (tie_gpt_i.lat > tie_gpt.lat) 
-                  tie_gpt.lat = tie_gpt_i.lat;
-               if (tie_gpt_i.lon < tie_gpt.lon) 
-                  tie_gpt.lon = tie_gpt_i.lon;
-            }
-         }
-         else
-         {
-            tie_dpt_i = theProductProjection->forward(tie_gpt_i);
-            if (tie_dpt.hasNans())
-               tie_dpt = tie_dpt_i;
-            else
-            {
-               if (tie_dpt_i.y > tie_dpt.y) 
-                  tie_dpt.y = tie_dpt_i.y;
-               if (tie_dpt_i.x < tie_dpt.x) 
-                  tie_dpt.x = tie_dpt_i.x;
-            }
-         }
-      }
-   }
-
-#endif
-
-   // The tie point coordinates currently reflect the UL edge of the UL pixel. We'll need to shift
-   // the tie point from the edge to the center. (OLK 09/11)
-   ossimDpt half_pixel_shift(0,0);
-   if (theProductProjection->isGeographic())
-   {
-      half_pixel_shift = theProductProjection->getDecimalDegreesPerPixel() * 0.5;
-      if (!tie_gpt.hasNans())
-      {
-         tie_gpt.lat -= half_pixel_shift.lat;
-         tie_gpt.lon += half_pixel_shift.lon;
-         theProductProjection->setUlTiePoints(tie_gpt);
-      }
-   }
-   else
-   {
-      half_pixel_shift = theProductProjection->getMetersPerPixel() * 0.5;
-      tie_dpt.y -= half_pixel_shift.y;
-      tie_dpt.x += half_pixel_shift.x;
-      theProductProjection->setUlTiePoints(tie_dpt);
-   }
-
-   // Propagates changes to the projection to the processing chain:
-   setView();
-}
-
-//*************************************************************************************************
-//! Computes the center latitude of the mosaic for use as the geographic scaling latitude
-//*************************************************************************************************
-void ossimOrthoIgen::computeGeoScalingLatitude()
-{
-   if (!theProductChain.valid())
-      return;
-
-   // Need to find all image handlers to query for their UL ground point:
-   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
-                                 false, // firstofTypeFlag
-                                 (ossimVisitor::VISIT_INPUTS|
-                                  ossimVisitor::VISIT_CHILDREN) );
-   theProductChain->accept( visitor );
-   if ( visitor.getObjects().empty() )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::establishMosaicTiePoint() WARNING -- "
-         "Expected to find image handler in the chain but none was identified."<<std::endl;
-      return;
-   }
-
-   ossimGpt ul_i, ur_i, lr_i, ll_i;
-   ossimGrect bbox;
-   bbox.makeNan();
-
-   // Loop over all input handlers and latch the extremes of the corner points:
-   for (ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i)
-   {
-      ossimImageHandler* handler = visitor.getObjectAs<ossimImageHandler>(i);
-      if (!handler)
-         break;
-
-      ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-      if (!geom.valid())
-         continue; // Skip over any non geometry inputs (e.g., masks)
-
-      geom->getCornerGpts(ul_i, ur_i, lr_i, ll_i);
-      ossimGrect bbox_i(ul_i, ur_i, lr_i, ll_i);
-      bbox = bbox.combine(bbox_i);
-   }
-
-   // Fetch midpoint and assign scaling latitude:
-   ossimGpt midPoint (bbox.midPoint());
-   if (!midPoint.isLatNan())
-      theGeoScalingLatitude = midPoint.lat;
-   else
-      theGeoScalingLatitude = 0.0;
-}
-
-//*************************************************************************************************
-// Initialize the pixel flipper in the source chain if one is called for
-//*************************************************************************************************
-ossimImageSource* ossimOrthoIgen::setupPixelFlipper(ossimImageChain* singleImageChain,
-                                                    const ossimSrcRecord& src_record)
-{
-   if (singleImageChain == NULL)
-      return NULL;
-
-   // Fetch the image handler that should be the last (left-most) source in the chain:
-   ossimImageSource* current_source = singleImageChain->getLastSource();
-   if (current_source == NULL)
-      return NULL;
-
-   // There are two possibilities for specifying pixel flipping -- either as a command line option
-   // that applies to all input imagery, or specified for a particular input via the .src file.
-   // The .src file takes precedence:
-   const ossimSrcRecord::PixelFlipParams& flipParams = src_record.getPixelFlipParams();
-
-   // The replacement can be specified globally in the preferences if none found in the src record:  
-   ossimString replaceModeStr = flipParams.replacementMode;
-   if (replaceModeStr.empty())
-      replaceModeStr = thePixelReplacementMode; 
-   
-   // First consider if a range of clipped pixels was specified:
-   ossim_float64 clip_min = flipParams.clipMin;
-   if (ossim::isnan(clip_min)) 
-      clip_min = theClipPixelMin;
-   ossim_float64 clip_max = flipParams.clipMax;
-   if (ossim::isnan(clip_max))
-      clip_max = theClipPixelMax;
-
-   ossimPixelFlipper* flipper = 0;
-   if (!ossim::isnan(clip_min) && !ossim::isnan(clip_max))
-   {
-      // A clip within a range of pixel values was requested. All pixels within the specified range
-      // are mapped to NULL. Create the remapper and insert it into the chain just after the handler
-      flipper = new ossimPixelFlipper();  
-      flipper->setTargetRange(clip_min, clip_max);  
-      flipper->setReplacementValue(current_source->getNullPixelValue());
-      flipper->setReplacementMode(replaceModeStr);
-      singleImageChain->insertRight(flipper, current_source);  
-      current_source = flipper;
-   }
-
-   // The user can also specify a clamping similar to the pixel clipping above. This would be a
-   // second flipper object in the chain:
-   ossim_float64 clamp_min = flipParams.clampMin;
-   if (ossim::isnan(clamp_min))
-      clamp_min = theClampPixelMin;
-   ossim_float64 clamp_max = flipParams.clampMax;
-   if (ossim::isnan(clamp_max))
-      clamp_max = theClampPixelMax;
-
-   flipper = 0; // no leak since chain assumes ownership of prior instance.
-   if (!ossim::isnan(clamp_min))
-   {
-      // A bottom clamping was requested. All pixels below this value are set to this value:
-      flipper = new ossimPixelFlipper();  
-      flipper->setClampValue(clamp_min, false); // false = clamp bottom
-   }
-   if (!ossim::isnan(clamp_max))
-   {
-      // A top clamping was requested. All pixels above this value are set to this value.
-      // The same flipper object can be used as the bottom clamp (if created):
-      if (!flipper)
-         flipper = new ossimPixelFlipper();  
-      flipper->setClampValue(clamp_max, true); // true = clamp top
-   }
-   if (flipper)
-   {
-      // Common code for top and bottom clamping:
-      flipper->setReplacementMode(replaceModeStr);
-      singleImageChain->insertRight(flipper, current_source);  
-      current_source = flipper;
-   }
-
-   return current_source;
-}
-
-//*************************************************************************************************
-// Checks for the presence of a raster mask file alongside the image, and inserts the mask 
-// filter in the chain if mask file exists. Returns pointer to the "current (last added) source 
-// in the single image chain. 
-//*************************************************************************************************
-ossimImageSource* ossimOrthoIgen::setupRasterMask(ossimImageChain* singleImageChain,
-                                                  const ossimSrcRecord& src_record)
-{
-   if (singleImageChain == NULL)
-      return NULL;
-
-   // Search for the image handler in the chain:
-   ossimImageHandler* img_handler = 
-      dynamic_cast<ossimImageHandler*>(singleImageChain->getLastSource());
-   if (img_handler == NULL) 
-      return NULL;
-
-   // See if a raster mask was specified in the SRC record:
-   ossimFilename mask_file = src_record.getMaskPath();
-   if (!mask_file.exists())
-      return img_handler;
-
-   // Open up the mask file and verify it is good:
-   ossimImageHandler* mask_handler =  ossimImageHandlerRegistry::instance()->open(mask_file);
-   if (mask_handler == NULL)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::setupRasterMask() -- Could not open "
-         "raster mask file <"<<mask_file<<">. Maske request will be ignored."<<endl;
-      return img_handler;
-   }
-
-   // Create the mask filter and give it the image and mask tile sources. Add it to the chain.
-   // IMPORTANT NOTE: the mask filter is an image combiner. It is being inserted into a single 
-   // image chain. Since it owns its two inputs (the image handler and the mask), it must
-   // replace the handler in the chain. Also, see note in ossimMaskFilter::setInputSources().
-   //singleImageChain->deleteLast(); // Remove the handler
-   // ossimImageSource* nextInChain = singleImageChain->getLastSource();
-   ossimRefPtr<ossimMaskFilter> mask_filter = new ossimMaskFilter;
-   singleImageChain->insertRight(mask_filter.get(), img_handler); 
-   mask_filter->setMaskSource(mask_handler);  // assumes ownership of object
-
-   //---
-   // Set the mode to SELECT_CLAMP_MIN.  This clamps data to min pixel value in the valid image
-   // area if the input pixel is null(essentially a pixel flip).
-   //---
-   mask_filter->setMaskType(ossimMaskFilter::OSSIM_MASK_TYPE_SELECT_CLAMP_MIN);
-   
-   return mask_filter.get();
-}
-
-//*************************************************************************************************
-// Adds a scalar remapper to the extreme right of the chain is specified by the 
-// --output-radiometry option.
-//*************************************************************************************************
-void ossimOrthoIgen::setupOutputRadiometry()
-{
-   if (theOutputRadiometry.empty())
-      return;
-
-   // Map the specified radiometry to a valid type:
-   ossimScalarType scalar_type = 
-      ossimScalarTypeLut::instance()->getScalarTypeFromString(theOutputRadiometry);
-   if (scalar_type == OSSIM_SCALAR_UNKNOWN)
-      return;
-
-   // Add a scalar remapper to the product chain:
-   if(theProductChain->getOutputScalarType() != scalar_type)
-   {
-      ossimScalarRemapper* remapper = new ossimScalarRemapper;
-      remapper->setOutputScalarType(scalar_type);
-      theProductChain->addFirst(remapper);
-   }
-}
-
-//*************************************************************************************************
-// Private method to see if any image chain input projections are affected by elevation.
-//*************************************************************************************************
-bool ossimOrthoIgen::isAffectedByElevation()
-{
-   bool result = false;
-   
-   // Get a list of all the image handlers.
-   // ossimConnectableObject::ConnectableObjectList clientList;
-   // theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler),
-   //                                      true, true);
-
-   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
-                                 false, // firstofTypeFlag
-                                 (ossimVisitor::VISIT_INPUTS|
-                                  ossimVisitor::VISIT_CHILDREN) );
-   theProductChain->accept( visitor );
-   
-   // Loop over all input handlers and see if affected by elevation.
-   // ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
-   // while (iter != clientList.end())
-   for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
-   {
-      // ossimRefPtr<ossimImageHandler> handler = PTR_CAST(ossimImageHandler, (*iter).get());
-      ossimRefPtr<ossimImageHandler> handler =  visitor.getObjectAs<ossimImageHandler>( i );
-      if ( handler.valid() )
-      {
-         ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-         if (geom.valid())
-         {
-            ossimRefPtr<const ossimProjection> proj = geom->getProjection();
-            if ( proj.valid() )
-            {
-               if ( proj->isAffectedByElevation() )
-               {
-                  result = true;
-                  break;
-               }
-            }
-         }
-      }
-      // ++iter;
-   }
-   return result;
-}
-
-//*************************************************************************************************
-// Private method to recompute the gsd on all image handlers that have projections affected by
-// elevation.
-//*************************************************************************************************
-void ossimOrthoIgen::reComputeChainGsds()
-{
-   // Get a list of all the image handlers.
-   // ossimConnectableObject::ConnectableObjectList clientList;
-   // theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler),
-   //                                      true, true);
-   
-   // Loop over all input handlers and see if affected by elevation.
-   // ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
-   // while (iter != clientList.end())
-
-   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
-                                 false, // firstofTypeFlag
-                                 (ossimVisitor::VISIT_INPUTS|
-                                  ossimVisitor::VISIT_CHILDREN) );
-   theProductChain->accept( visitor );
-
-   for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
-   {
-      // ossimRefPtr<ossimImageHandler> handler = PTR_CAST(ossimImageHandler, (*iter).get());
-
-      ossimRefPtr<ossimImageHandler> handler =  visitor.getObjectAs<ossimImageHandler>( i );
-      if ( handler.valid() )
-      {
-         ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-         if (geom.valid())
-         {
-            ossimRefPtr<ossimProjection> proj = geom->getProjection();
-            if ( proj.valid() )
-            {
-               if ( proj->isAffectedByElevation() )
-                  proj->getMetersPerPixel();
-            }
-         }
-      }
-      // ++iter;
-   }
-}
-
-//*************************************************************************************************
-// GSD Determination is nontrivial since there are various command-line options that control
-// this quantity. This method considers all information before setting the product's GSD.
-//*************************************************************************************************
-void ossimOrthoIgen::setProductGsd()
-{
-   if (!theProductChain.valid())
-      return;
-
-   // Fetch the reference input projection first. Settings may be copied to the product projection:
-   ossimMapProjection* ref_map = PTR_CAST(ossimMapProjection, theReferenceProj.get());
-   ossimGpt origin;
-
-   // The geo-scaling latitude effectively specifies the map projection's origin latitude, which
-   // may affect the scaling of GSD in x-direction. This is only relevant for geographic projections
-   if (theProductProjection->isGeographic())
-   {
-      ossimGpt origin (0.0, theProductProjection->getOrigin().lon, 0.0);
-      if (ossim::isnan(theGeoScalingLatitude))
-      {
-         // Loop over all input handlers and accumulate the geographic centers. This will allow 
-         // computing mosaic center point (approximate) for purposes of establishing reference 
-         // latitude for scale:
-         origin.lat = 0.0;
-         origin.lon = theProductProjection->getOrigin().lon;
-
-         // ossimConnectableObject::ConnectableObjectList clientList;
-         // theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler), 1, 1);
-         // ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
-
-         ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
-                                       false, // firstofTypeFlag
-                                       (ossimVisitor::VISIT_INPUTS|
-                                        ossimVisitor::VISIT_CHILDREN) );
-         theProductChain->accept( visitor );
-         
-         ossimDpt center_pt;
-         ossimGpt geocenter;
-         int num_contributors = 0;
-         // while (iter != clientList.end())
-
-         for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
-         {
-            // ossimImageHandler* handler = PTR_CAST(ossimImageHandler, (*iter).get());
-            ossimRefPtr<ossimImageHandler> handler =  visitor.getObjectAs<ossimImageHandler>( i );
-            if ( handler.valid() )
-            {
-               // iter++;
-               ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
-               if (!geom.valid()) 
-                  continue; // Skip over any non geometry inputs (e.g., masks)
-               
-               handler->getBoundingRect().getCenter(center_pt);
-               if (!geom->localToWorld(center_pt, geocenter))  
-                  continue;
-               if (num_contributors == 0)
-                  origin.lat = geocenter.lat;
-               else
-                  origin.lat += geocenter.lat;
-               ++num_contributors;
-            }
-            else
-            {
-               break;
-            }
-         }
-
-         // Compute average latitude among all contributors:
-         if (num_contributors)
-            origin.lat /= (double)num_contributors;
-      }
-      else
-      {
-         // A geo-scaling reference latitude was provided on the command line:
-         origin.lat = theGeoScalingLatitude;
-      }
-
-      // Set the latitude of origin to the reference latitude (either specified on command line or
-      // computed as scene center):
-      theProductProjection->setOrigin(origin); // proj now can handle meters and degrees correctly
-   }
-
-   // Establish the resolution based on either command line option or reference proj if no values
-   // provided on command line (--degrees or --meters):
-   ossimDpt resolution (theDeltaPerPixelOverride);
-   ossimUnitType resUnits = theDeltaPerPixelUnit;
-   if (resolution.hasNans())
-   {
-      //  No GSD specified, so copy it from the input projection:
-      if (ref_map && ref_map->isGeographic())
-      {
-         resolution = ref_map->getDecimalDegreesPerPixel();
-         resUnits = OSSIM_DEGREES;
-      }
-      else
-      {
-         resolution = theReferenceProj->getMetersPerPixel();
-         resUnits = OSSIM_METERS;
-      }
-   }
-
-   // Set the desired image GSD, accounting for possible mixing of units:
-   if (resUnits == OSSIM_DEGREES)
-   {
-      // Need to adjust the resolution in the longitude direction if the user requested geo-scaling:
-      if (!ossim::isnan(theGeoScalingLatitude))
-         resolution.lon = resolution.lat/ossim::cosd(theGeoScalingLatitude);
-      theProductProjection->setDecimalDegreesPerPixel(resolution);
-   }
-   else 
-      theProductProjection->setMetersPerPixel(resolution);
-
-   // Propagates changes to the projection to the processing chain:
-   setView();
-}
-
diff --git a/ossim/src/ossim/plugin/makefile.vc b/ossim/src/ossim/plugin/makefile.vc
deleted file mode 100644
index 9b4cb3f..0000000
--- a/ossim/src/ossim/plugin/makefile.vc
+++ /dev/null
@@ -1,18 +0,0 @@
-###
-# $Id: makefile.vc 9232 2006-07-05 21:42:47Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimDynamicLibrary.obj \
-ossimPluginLibrary.obj \
-ossimSharedObjectBridge.obj \
-ossimSharedPluginRegistry.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/plugin/ossimDynamicLibrary.cpp b/ossim/src/ossim/plugin/ossimDynamicLibrary.cpp
deleted file mode 100644
index b0d132d..0000000
--- a/ossim/src/ossim/plugin/ossimDynamicLibrary.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//*********************************************************************
-// $Id: ossimDynamicLibrary.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <ossim/plugin/ossimDynamicLibrary.h>
-#include <ossim/plugin/ossimSharedObjectBridge.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-// Static trace for debugging.
-static ossimTrace traceDebug(ossimString("ossimDynamicLibrary:debug"));
-
-ossimDynamicLibrary::ossimDynamicLibrary()
-   :theLibrary(0)
-{
-}
-
-ossimDynamicLibrary::ossimDynamicLibrary(const ossimString& name)
-{
-   load(name);
-}
-
-ossimDynamicLibrary::~ossimDynamicLibrary()
-{
-   unload();
-}
-
-bool ossimDynamicLibrary::load()
-{
-   return load(theLibraryName);
-}
-
-bool ossimDynamicLibrary::load(const ossimString& name)
-{
-   ossimFilename libraryName = name.trim();
-   if(libraryName.empty()||!libraryName.isFile()) return false;
-   
-#  if defined(__WIN32__) || defined(_WIN32)
-   theLibrary = LoadLibrary(libraryName.c_str());
-#  else 
-   theLibrary = dlopen(libraryName.c_str(), RTLD_LAZY);
-#endif
-
-   if (isLoaded())
-   {
-      theLibraryName = libraryName;
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimDynamicLibrary::load DEBUG:" << std::endl;
-      
-      if (isLoaded())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Loaded library:  " << name << std::endl;
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimDynamicLibrary::load DEBUG:"
-            << "\nFailed to load library:  " << name
-            << std::endl;
-#  if !defined(__WIN32__) && !defined(_WIN32)
-         ossimNotify(ossimNotifyLevel_DEBUG) << dlerror() << std::endl;
-#endif
-      }
-      
-   }
-   
-   return isLoaded();
-}
-
-void ossimDynamicLibrary::unload()
-{
-   if(isLoaded())
-   {
-#if defined(__WIN32__) || defined(_WIN32)
-      FreeLibrary(theLibrary);
-// #else HAVE_DLFCN_H
-#else
-      dlclose(theLibrary);
-#endif
-      theLibrary = 0;
-   }
-}
-
-void *ossimDynamicLibrary::getSymbol(const ossimString& name) const
-{
-   if(isLoaded())
-   {
-#if defined(__WIN32__) || defined(_WIN32)
-      return (void*)GetProcAddress( (HINSTANCE)theLibrary, name.c_str());
-#else
-      return dlsym(theLibrary, name.c_str());
-#endif
-   }
-
-   return (void*)0;
-}
diff --git a/ossim/src/ossim/plugin/ossimPluginLibrary.cpp b/ossim/src/ossim/plugin/ossimPluginLibrary.cpp
deleted file mode 100644
index a19f49d..0000000
--- a/ossim/src/ossim/plugin/ossimPluginLibrary.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-//*******************************************************************
-///
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimPluginLibrary.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/plugin/ossimPluginLibrary.h>
-#include <iostream>
-
-ossimPluginLibrary::ossimPluginLibrary()
-   :ossimDynamicLibrary(),
-    m_info(0)
-{
-}
-
-ossimPluginLibrary::ossimPluginLibrary(const ossimString& name, const ossimString& options)
-   :ossimDynamicLibrary(name),
-    m_options(options),
-    m_info(0)
-{
-   initialize();
-}
-
-ossimPluginLibrary::~ossimPluginLibrary()
-{
-   finalize();
-}
-
-void ossimPluginLibrary::initialize()
-{
-   if(!isLoaded())
-   {
-      load();
-   }
-   
-   ossimSharedLibraryInitializePtr init = (ossimSharedLibraryInitializePtr)getSymbol("ossimSharedLibraryInitialize");
-   if(init)
-   {
-      init(&m_info, m_options.c_str());
-   }
-}
-
-void ossimPluginLibrary::finalize()
-{
-   ossimSharedLibraryFinalizePtr finalizeLib = (ossimSharedLibraryFinalizePtr)getSymbol("ossimSharedLibraryFinalize");
-   if(finalizeLib)
-   {         
-      finalizeLib();
-   }
-   
-   unload();
-}
-
-ossimString ossimPluginLibrary::getDescription()const
-{
-   ossimString result;
-
-   if(m_info&&isLoaded()&&m_info->getDescription)
-   {
-      result = m_info->getDescription();
-   }
-
-   return result;
-}
-
-void ossimPluginLibrary::getClassNames(std::vector<ossimString>& classNames)const
-{
-   if(m_info&&m_info->getNumberOfClassNames&&m_info->getClassName)
-   {
-      ossim_int32 idx        = 0;
-      ossim_int32 numObjects = 0;
-
-      numObjects = m_info->getNumberOfClassNames();
-      for(idx = 0; idx < numObjects; ++idx)
-      {
-         classNames.push_back(m_info->getClassName(idx));
-      }
-   }
-}
-
-void ossimPluginLibrary::setOptions(const ossimString& options)
-{
-   m_options = options;
-   
-}
-
diff --git a/ossim/src/ossim/point_cloud/ossimGenericPointCloudHandler.cpp b/ossim/src/ossim/point_cloud/ossimGenericPointCloudHandler.cpp
deleted file mode 100644
index 49b09cf..0000000
--- a/ossim/src/ossim/point_cloud/ossimGenericPointCloudHandler.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#include <ossim/point_cloud/ossimGenericPointCloudHandler.h>
-
-ossimGenericPointCloudHandler::ossimGenericPointCloudHandler(vector<ossimEcefPoint>& ecef_points)
-{
-   // Fill the point storage in any order.
-   // Loop to add your points (assume your points are passed in a vector ecef_points[])
-   for (ossim_uint32 i=0; i<ecef_points.size(); ++i)
-   {
-      ossimPointRecord* point = new ossimPointRecord(ossimGpt(ecef_points[i]));
-      m_pointBlock.addPoint(point);
-   }
-   ossimGrect bounds;
-   m_pointBlock.getBounds(bounds);
-   m_minRecord = new ossimPointRecord(bounds.ll());
-   m_maxRecord = new ossimPointRecord(bounds.ur());
-}
-
-ossimGenericPointCloudHandler::ossimGenericPointCloudHandler(vector<ossimGpt>& ground_points)
-{
-   // Fill the point storage in any order.
-   // Loop to add your points (assume your points are passed in a vector ecef_points[])
-   for (ossim_uint32 i=0; i<ground_points.size(); ++i)
-   {
-      ossimPointRecord* point = new ossimPointRecord(ground_points[i]);
-      m_pointBlock.addPoint(point);
-   }
-   ossimGrect bounds;
-   m_pointBlock.getBounds(bounds);
-   m_minRecord = new ossimPointRecord(bounds.ll());
-   m_maxRecord = new ossimPointRecord(bounds.ur());
-}
-
-ossimGenericPointCloudHandler::~ossimGenericPointCloudHandler() 
-{ 
-   m_pointBlock.clear(); 
-}
-
-ossim_uint32 ossimGenericPointCloudHandler::getNumPoints() const 
-{ 
-   return m_pointBlock.size(); 
-}
-
-void ossimGenericPointCloudHandler::getFileBlock(ossim_uint32 offset,
-                          ossimPointBlock& block,
-                          ossim_uint32 maxNumPoints) const
-{
-   block.clear();
-   if (offset >= m_pointBlock.size())
-      return;
-
-   for (ossim_uint32 i=offset; i<m_pointBlock.size(); ++i)
-      block.addPoint(new ossimPointRecord(*(m_pointBlock[i])));
-
-   m_currentPID = block.size();
-}
-
-ossim_uint32 ossimGenericPointCloudHandler::getFieldCode() const 
-{ 
-  return 0; 
-}
-
-bool ossimGenericPointCloudHandler::open(const ossimFilename& pointsFile)
-{ 
-   return false; 
-}
- 
-void ossimGenericPointCloudHandler::close() 
-{  
-}
diff --git a/ossim/src/ossim/point_cloud/ossimPointBlock.cpp b/ossim/src/ossim/point_cloud/ossimPointBlock.cpp
deleted file mode 100644
index dfd2285..0000000
--- a/ossim/src/ossim/point_cloud/ossimPointBlock.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-#include <ossim/point_cloud/ossimPointBlock.h>
-
-RTTI_DEF1(ossimPointBlock, "ossimPointBlock", ossimDataObject)
-
-ossimPointBlock::ossimPointBlock(ossimSource* owner, ossim_uint32 fields)
-:  ossimDataObject(owner),
-   m_nullPCR(fields),
-   m_fieldCode(0),
-   m_minMaxValid(false),
-   m_isNormalized(false)
-{
-}
-
-ossimPointBlock::~ossimPointBlock()
-{
-
-}
-
-void ossimPointBlock::getFieldMin(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const
-{
-   if (empty())
-      value = ossim::nan();
-   else if (!m_minMaxValid)
-      scanForMinMax();
-
-   value = m_minRecord.getField(field);
-}
-
-void ossimPointBlock::getFieldMax(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const
-{
-   if (empty())
-      value = ossim::nan();
-   else if (!m_minMaxValid)
-      scanForMinMax();
-
-   value = m_maxRecord.getField(field);
-}
-
-
-void ossimPointBlock::getBounds(ossimGrect& block_bounds) const
-{
-   if (!m_minMaxValid)
-      scanForMinMax();
-
-   block_bounds = ossimGrect(m_minRecord.getPosition(), m_maxRecord.getPosition());
-}
-
-const ossimPointRecord* ossimPointBlock::getPoint(ossim_uint32 point_offset) const
-{
-   if (point_offset < m_pointList.size())
-      return m_pointList[point_offset].get();
-   return 0;
-}
-
-ossimPointRecord* ossimPointBlock::getPoint(ossim_uint32 point_offset)
-{
-   if (point_offset < m_pointList.size())
-      return m_pointList[point_offset].get();
-   return 0;
-}
-
-const ossimPointBlock& ossimPointBlock::operator=(const ossimPointBlock& block )
-{
-   ossim_uint32 numPoints = block.size();
-   if (numPoints == 0)
-      return *this;
-
-   for (ossim_uint32 i=0; i<numPoints; ++i)
-      m_pointList.push_back(new ossimPointRecord(*(block[i])));
-
-   m_nullPCR = block.m_nullPCR;
-   m_minRecord = block.m_minRecord;
-   m_maxRecord = block.m_maxRecord;
-   m_minMaxValid = block.m_minMaxValid;
-   m_fieldCode = block.m_fieldCode;
-   m_isNormalized = block.m_isNormalized;
-
-   return *this;
-}
-
-ossimObject* ossimPointBlock::dup() const
-{
-   ossimPointBlock* copy = new ossimPointBlock(0, m_fieldCode);
-   *copy = *this;
-   return copy;
-}
-
-ossim_uint32 ossimPointBlock::getFieldCode() const
-{
-   if (!m_pointList.empty())
-      m_fieldCode = m_pointList[0]->getFieldCode();
-
-   return m_fieldCode;
-}
-
-vector<ossimPointRecord::FIELD_CODES> ossimPointBlock::getFieldCodesAsList() const
-{
-   vector<ossimPointRecord::FIELD_CODES> code_list;
-   if (m_fieldCode & ossimPointRecord::Intensity)
-      code_list.push_back(ossimPointRecord::Intensity);
-   if (m_fieldCode & ossimPointRecord::ReturnNumber)
-      code_list.push_back(ossimPointRecord::ReturnNumber);
-   if (m_fieldCode & ossimPointRecord::NumberOfReturns)
-      code_list.push_back(ossimPointRecord::NumberOfReturns);
-   if (m_fieldCode & ossimPointRecord::Red)
-      code_list.push_back(ossimPointRecord::Red);
-   if (m_fieldCode & ossimPointRecord::Green)
-      code_list.push_back(ossimPointRecord::Green);
-   if (m_fieldCode & ossimPointRecord::Blue)
-      code_list.push_back(ossimPointRecord::Blue);
-   if (m_fieldCode & ossimPointRecord::GpsTime)
-      code_list.push_back(ossimPointRecord::GpsTime);
-   if (m_fieldCode & ossimPointRecord::Infrared)
-      code_list.push_back(ossimPointRecord::Infrared);
-  return code_list;
-}
-
-void ossimPointBlock::setFieldCode(ossim_uint32 code)
-{
-   if (getFieldCode() != code)
-      clear();
-
-   m_fieldCode = code;
-}
-
-void ossimPointBlock::addPoint(ossimPointRecord* opr)
-{
-   // First check that the fields match the expected. If not, sync up to this point:
-   if ((opr->getFieldCode() & m_fieldCode) != m_fieldCode)
-      m_fieldCode = opr->getFieldCode();
-
-   m_pointList.push_back(ossimRefPtr<ossimPointRecord>(opr));
-   m_minMaxValid = false;
-}
-
-void ossimPointBlock::scanForMinMax() const
-{
-   ossim_uint32 numPoints = size();
-   if (numPoints == 0)
-      return;
-
-   // Latch first point:
-   m_minRecord = *(m_pointList[0].get());
-   m_maxRecord = m_minRecord;
-   ossimGpt minPos (m_minRecord.getPosition());
-   ossimGpt maxPos (minPos);
-
-   // For shorthand later:
-   const ossimPointRecord::FIELD_CODES I = ossimPointRecord::Intensity;
-   const ossimPointRecord::FIELD_CODES R = ossimPointRecord::Red;
-   const ossimPointRecord::FIELD_CODES G = ossimPointRecord::Green;
-   const ossimPointRecord::FIELD_CODES B = ossimPointRecord::Blue;
-   const ossimPointRecord::FIELD_CODES S = ossimPointRecord::ReturnNumber;
-   const ossimPointRecord::FIELD_CODES N = ossimPointRecord::NumberOfReturns;
-
-   // If color available, latch the min for all bands as one to minimize color distortion:
-   bool hasRGB = false;
-   if (m_minRecord.hasFields(R|G|B))
-   {
-      hasRGB = true;
-      ossim_float32 r = m_pointList[0]->getField(R);
-      ossim_float32 g = m_pointList[0]->getField(G);
-      ossim_float32 b = m_pointList[0]->getField(B);
-      float minC = std::min(r, std::min(g, b));
-      float maxC = std::max(r, std::max(g, b));
-      m_minRecord.setField(R,   minC);
-      m_minRecord.setField(G, minC);
-      m_minRecord.setField(B,  minC);
-      m_maxRecord.setField(R,   maxC);
-      m_maxRecord.setField(G, maxC);
-      m_maxRecord.setField(B,  maxC);
-   }
-
-   // Now loop over all points in file to latch min/max:
-   for (ossim_uint32 i=0; i<numPoints; ++i)
-   {
-      if (m_pointList[i]->getPosition().lat < minPos.lat)
-         minPos.lat = m_pointList[i]->getPosition().lat;
-      if (m_pointList[i]->getPosition().lon < minPos.lon)
-         minPos.lon = m_pointList[i]->getPosition().lon;
-      if (m_pointList[i]->getPosition().hgt < minPos.hgt)
-         minPos.hgt = m_pointList[i]->getPosition().hgt;
-
-      if (m_pointList[i]->getPosition().lat > maxPos.lat)
-         maxPos.lat = m_pointList[i]->getPosition().lat;
-      if (m_pointList[i]->getPosition().lon > maxPos.lon)
-         maxPos.lon = m_pointList[i]->getPosition().lon;
-      if (m_pointList[i]->getPosition().hgt > maxPos.hgt)
-         maxPos.hgt = m_pointList[i]->getPosition().hgt;
-
-      if (m_minRecord.hasFields(I) &&  (m_minRecord.getField(I) > m_pointList[i]->getField(I)))
-         m_minRecord.setField(I, m_pointList[i]->getField(I));
-
-      if (m_minRecord.hasFields(S) &&  (m_minRecord.getField(S) > m_pointList[i]->getField(S)))
-         m_minRecord.setField(S, m_pointList[i]->getField(S));
-
-      if (m_minRecord.hasFields(N) &&  (m_minRecord.getField(N) > m_pointList[i]->getField(N)))
-         m_minRecord.setField(N, m_pointList[i]->getField(N));
-
-      if (hasRGB)
-      {
-         ossim_float32 r = m_pointList[i]->getField(R);
-         ossim_float32 g = m_pointList[i]->getField(G);
-         ossim_float32 b = m_pointList[i]->getField(B);
-
-         float minC = std::min(r, std::min(g, b));
-         if (m_minRecord.getField(R) > minC)
-         {
-            m_minRecord.setField(R, minC);
-            m_minRecord.setField(G, minC);
-            m_minRecord.setField(B, minC);
-         }
-
-         float maxC = std::max(r, std::max(g, b));
-         if (m_maxRecord.getField(R) < maxC)
-         {
-            m_maxRecord.setField(R, maxC);
-            m_maxRecord.setField(G, maxC);
-            m_maxRecord.setField(B, maxC);
-         }
-      }
-   } // end loop over all points
-
-   m_minRecord.setPosition(minPos);
-   m_maxRecord.setPosition(maxPos);
-   m_minMaxValid = true;
-}
-
-
-
-
-
diff --git a/ossim/src/ossim/point_cloud/ossimPointCloudGeometry.cpp b/ossim/src/ossim/point_cloud/ossimPointCloudGeometry.cpp
deleted file mode 100644
index c402863..0000000
--- a/ossim/src/ossim/point_cloud/ossimPointCloudGeometry.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#include <ossim/point_cloud/ossimPointCloudGeometry.h>
-#include <ossim/base/ossimEcefPoint.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/projection/ossimWktProjectionFactory.h>
-#include <ossim/projection/ossimMapProjection.h>
-
-RTTI_DEF1(ossimPointCloudGeometry, "ossimPointCloudGeometry" , ossimObject);
-
-ossimPointCloudGeometry::ossimPointCloudGeometry(const ossimString& wkt)
-      : m_format(GEOGRAPHIC),
-        m_projection(0),
-        m_datum(ossimDatumFactory::instance()->wgs84())
-{
-   // Establish projection from WKT:
-   m_projection = dynamic_cast<ossimMapProjection*>(
-         ossimWktProjectionFactory::instance()->createProjection(wkt));
-
-   if (m_projection.valid())
-   {
-      m_datum = m_projection->getDatum();
-      if (!m_projection->isGeographic())
-         m_format = MAP_PROJECTED;
-   }
-}
-
-bool ossimPointCloudGeometry::operator==(const ossimPointCloudGeometry& other) const
-{
-   if (m_format != other.m_format)
-      return false;
-
-   if (m_projection.valid() && other.m_projection.valid() && (*m_projection == *(other.m_projection)))
-      return true;
-
-   return false;
-}
-
-void ossimPointCloudGeometry::convertPos(const ossimDpt3d& oldPt, ossimGpt& converted_gpos) const
-{
-   converted_gpos.makeNan();
-
-   // If the data buffer has existing points, transform them into the new projection and datum:
-   if (m_format == GEOGRAPHIC)
-   {
-      ossimGpt gpt (oldPt.y, oldPt.x, oldPt.z, m_datum);
-      gpt.changeDatum(converted_gpos.datum());
-      converted_gpos = gpt;
-   }
-   else if ((m_format == MAP_PROJECTED) && m_projection.valid())
-   {
-      ossimUnitConversionTool uct (1.0, m_projection->getProjectionUnits());
-      double coord_scale = uct.getMeters();
-
-      //Need to convert map E, N to lat, lon
-      ossimDpt oldMapPt(oldPt.x*coord_scale, oldPt.y*coord_scale);
-      ossimGpt gpt(getProjection()->inverse(oldMapPt));
-      gpt.changeDatum(m_datum);
-      gpt.hgt = oldPt.z*coord_scale;
-      gpt.changeDatum(converted_gpos.datum());
-      converted_gpos = gpt;
-   }
-   else if (m_format == ECF_METERS)
-   {
-      ossimEcefPoint oldEcfPt(oldPt);
-      converted_gpos = ossimGpt (oldEcfPt, converted_gpos.datum());
-   }
-
-   return;
-}
-
-
diff --git a/ossim/src/ossim/point_cloud/ossimPointCloudHandler.cpp b/ossim/src/ossim/point_cloud/ossimPointCloudHandler.cpp
deleted file mode 100644
index d13eef7..0000000
--- a/ossim/src/ossim/point_cloud/ossimPointCloudHandler.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#include <ossim/point_cloud/ossimPointCloudHandler.h>
-
-RTTI_DEF1(ossimPointCloudHandler, "ossimPointCloudHandler" , ossimPointCloudSource);
-
-ossim_uint32 ossimPointCloudHandler::DEFAULT_BLOCK_SIZE = 0x400000;
-
-ossimPointCloudHandler::ossimPointCloudHandler()
-:  m_currentPID(0)
-{
-}
-
-ossimPointCloudHandler::ossimPointCloudHandler(ossimObject* owner)
-:  ossimPointCloudSource(owner),
-   m_currentPID(0)
-{
-
-}
-
-ossimPointCloudHandler::~ossimPointCloudHandler()
-{
-}
-
-void ossimPointCloudHandler::getNextFileBlock(ossimPointBlock& block, ossim_uint32 maxPts) const
-{
-   getFileBlock(m_currentPID, block, maxPts);
-   return;
-}
-
-void ossimPointCloudHandler::getBlock(const ossimGrect& bounds, ossimPointBlock& block) const
-{
-   block.clear();
-
-   // This default implementation simply reads the whole datafile in file-blocks, retaining
-   // only those points inside the bounds:
-   ossimPointBlock file_block;
-   rewind();
-   ossimGpt gpt;
-
-   do
-   {
-      file_block.clear();
-      getNextFileBlock(file_block, DEFAULT_BLOCK_SIZE);
-      ossimPointBlock::PointList& pointList = file_block.getPoints();
-      ossimPointBlock::PointList::iterator iter = pointList.begin();
-      while (iter != pointList.end())
-      {
-         gpt = (*iter)->getPosition();
-         if (bounds.pointWithin(gpt))
-         {
-            block.addPoint(iter->get());
-         }
-         ++iter;
-      }
-   } while (file_block.size() == DEFAULT_BLOCK_SIZE);
-}
-
-void ossimPointCloudHandler::getBounds(ossimGrect& bounds) const
-{
-   if (m_minRecord.valid() && m_maxRecord.valid())
-      bounds = ossimGrect(m_minRecord->getPosition(), m_maxRecord->getPosition());
-   else
-      bounds.makeNan();
-}
-
-void ossimPointCloudHandler::normalizeBlock(ossimPointBlock& block)
-{
-   if (!m_minRecord.valid() || !m_maxRecord.valid())
-      return;
-
-   ossim_uint32 numPoints = block.size();
-   float val, norm, min, max;
-   vector<ossimPointRecord::FIELD_CODES> field_codes = block.getFieldCodesAsList();
-   vector<ossimPointRecord::FIELD_CODES>::const_iterator iter;
-   ossimPointRecord::FIELD_CODES field_code;
-   for (ossim_uint32 i=0; i<numPoints; ++i)
-   {
-      ossimPointRecord* opr = block[i];
-      iter = field_codes.begin();
-      while (iter != field_codes.end())
-      {
-         field_code = *iter;
-         min = m_minRecord->getField(field_code);
-         max = m_maxRecord->getField(field_code);
-         val = opr->getField(field_code);
-         norm = (val - min) / (max - min);
-         opr->setField(field_code, norm);
-         ++iter;
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/point_cloud/ossimPointCloudHandlerRegistry.cpp b/ossim/src/ossim/point_cloud/ossimPointCloudHandlerRegistry.cpp
deleted file mode 100644
index fcf39c6..0000000
--- a/ossim/src/ossim/point_cloud/ossimPointCloudHandlerRegistry.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#include <ossim/point_cloud/ossimPointCloudHandlerRegistry.h>
-#include <ossim/point_cloud/ossimPointCloudHandler.h>
-#include <ossim/point_cloud/ossimPointCloudHandlerFactory.h>
-
-ossimPointCloudHandlerRegistry* ossimPointCloudHandlerRegistry::m_instance = 0;
-
-RTTI_DEF1(ossimPointCloudHandlerRegistry, "ossimPointCloudHandlerRegistry" , ossimObjectFactory);
-
-ossimPointCloudHandlerRegistry::ossimPointCloudHandlerRegistry()
-{
-   // TODO Auto-generated constructor stub
-}
-
-ossimPointCloudHandlerRegistry::~ossimPointCloudHandlerRegistry()
-{
-   // TODO Auto-generated destructor stub
-}
-
-ossimPointCloudHandlerRegistry* ossimPointCloudHandlerRegistry::instance()
-{
-   if (m_instance)
-      return m_instance;
-   m_instance = new ossimPointCloudHandlerRegistry;
-   return m_instance;
-}
-
-ossimPointCloudHandler* ossimPointCloudHandlerRegistry::open(const ossimFilename& fileName) const
-{
-   ossimPointCloudHandler*  result = NULL;
-   std::vector<ossimPointCloudHandlerFactory*>::const_iterator factory;
-
-   factory = m_factoryList.begin();
-   while((factory != m_factoryList.end()) && !result)
-   {
-      result = (*factory)->open(fileName);
-      ++factory;
-   }
-
-   return result;
-}
-
-ossimPointCloudHandler* ossimPointCloudHandlerRegistry::open(const ossimKeywordlist& kwl,
-                                                             const char* prefix) const
-{
-   ossimPointCloudHandler* result = NULL;
-   std::vector<ossimPointCloudHandlerFactory*>::const_iterator factory;
-
-   factory = m_factoryList.begin();
-   while((factory != m_factoryList.end()) && !result)
-   {
-      result = (*factory)->open(kwl, prefix);
-      ++factory;
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimPointCloudHandler> ossimPointCloudHandlerRegistry::open(std::istream* /*str*/,
-                                                 std::streamoff /*restartPosition*/,
-                                                 bool /*youOwnIt*/) const
-{
-   // TODO Auto-generated constructor stub
-   return 0;
-}
-
-ossimObject* ossimPointCloudHandlerRegistry::createObject(const ossimString& typeName) const
-{
-   return createObjectFromRegistry(typeName);
-}
-
-ossimObject* ossimPointCloudHandlerRegistry::createObject(const ossimKeywordlist& kwl,
-                                                          const char* prefix) const
-{
-   return createObjectFromRegistry(kwl, prefix);
-}
-
-const ossimPointCloudHandlerRegistry& ossimPointCloudHandlerRegistry::operator=(
-      const ossimPointCloudHandlerRegistry& /*rhs*/)
-{
-   return *this;
-}
-
-void ossimPointCloudHandlerRegistry::getTypeNameList(std::vector<ossimString>& typeList) const
-{
-   getAllTypeNamesFromRegistry(typeList);
-}
-
-
-
diff --git a/ossim/src/ossim/point_cloud/ossimPointCloudImageHandler.cpp b/ossim/src/ossim/point_cloud/ossimPointCloudImageHandler.cpp
deleted file mode 100644
index b6298ae..0000000
--- a/ossim/src/ossim/point_cloud/ossimPointCloudImageHandler.cpp
+++ /dev/null
@@ -1,832 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id$
-
-#include <ossim/point_cloud/ossimPointCloudImageHandler.h>
-#include <ossim/point_cloud/ossimPointCloudSource.h>
-#include <ossim/point_cloud/ossimPointCloudHandlerRegistry.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-
-RTTI_DEF1(ossimPointCloudImageHandler, "ossimPointCloudImageHandler", ossimImageHandler);
-
-static ossimTrace traceDebug("ossimPointCloudImageHandler:debug");
-static const char* GSD_FACTOR_KW = "gsd_factor";
-static const char* COMPONENT_KW = "component";
-
-// The member m_activeComponent should be one of the following strings. This is set either in a
-// state KWL or by a call to setProperty(<"active_component", <string> >)
-static const char* INTENSITY_KW = "INTENSITY";
-static const char* HIGHEST_KW = "HIGHEST";
-static const char* LOWEST_KW = "LOWEST";
-static const char* RETURNS_KW = "RETURNS";
-static const char* RGB_KW = "RGB";
-
-ossimPointCloudImageHandler::PcrBucket::PcrBucket(const ossim_float32* init_value,
-                                                  ossim_uint32 numBands)
-:  m_numSamples (1)
-{
-   m_bucket = new ossim_float32[numBands];
-   for (ossim_uint32 i=0; i<numBands; i++)
-      m_bucket[i] = init_value[i];
-}
-
-
-ossimPointCloudImageHandler::PcrBucket::PcrBucket(const ossim_float32& R,
-      const ossim_float32& G,
-      const ossim_float32& B)
-:  m_numSamples (1)
-{
-   m_bucket = new ossim_float32[3];
-   m_bucket[0] = R;
-   m_bucket[1] = G;
-   m_bucket[2] = B;
-
-}
-
-
-ossimPointCloudImageHandler::PcrBucket::PcrBucket(const ossim_float32& init_value)
-:  m_numSamples (1)
-{
-   m_bucket = new ossim_float32[1];
-   m_bucket[0] = init_value;
-}
-
-
-ossimPointCloudImageHandler::PcrBucket::~PcrBucket()
-{
-   delete [] m_bucket;
-}
-
-
-ossimPointCloudImageHandler::ossimPointCloudImageHandler()
-      : ossimImageHandler(),
-        m_maxPixel(1.0),
-        m_minPixel(0.0),
-        m_gsd(),
-        m_gsdFactor (1.0),
-        m_tile(0),
-        m_mutex(),
-        m_activeComponent(INTENSITY)
-{
-   //---
-   // Nan out as can be set in several places, i.e. setProperty,
-   // loadState and initProjection.
-   //---
-   m_gsd.makeNan();
-
-   m_componentNames.push_back(INTENSITY_KW);
-   m_componentNames.push_back(HIGHEST_KW);
-   m_componentNames.push_back(LOWEST_KW);
-   m_componentNames.push_back(RETURNS_KW);
-   m_componentNames.push_back(RGB_KW);
-}
-
-ossimPointCloudImageHandler::~ossimPointCloudImageHandler()
-{
-   close();
-}
-
-bool ossimPointCloudImageHandler::open()
-{
-   close();
-
-   // Need to utilize the Point Cloud handler registry to open the PC file:
-   m_pch = ossimPointCloudHandlerRegistry::instance()->open(theImageFile);
-   if (!m_pch.valid())
-      return false;
-
-   getImageGeometry();
-   ossimImageHandler::completeOpen();
-
-   // Needed here after open to make sure that min/max pixels are set for active component/entry
-   setCurrentEntry((ossim_uint32)m_activeComponent);
-
-   return true;
-}
-
-bool ossimPointCloudImageHandler::setPointCloudHandler(ossimPointCloudHandler* pch)
-{
-   close();
-
-   // Need to utilize the Point Cloud handler registry to open the PC file:
-   m_pch = pch;
-   if (!m_pch.valid())
-      return false;
-
-   getImageGeometry();
-   ossimImageHandler::completeOpen();
-
-   // Needed here after open to make sure that min/max pixels are set for active component/entry
-   setCurrentEntry((ossim_uint32)m_activeComponent);
-
-   return true;
-}
-
-void ossimPointCloudImageHandler::close()
-{
-   if (isOpen())
-   {
-      m_pch->close();
-      m_tile = 0;
-      ossimImageHandler::close();
-   }
-}
-
-ossimRefPtr<ossimImageGeometry> ossimPointCloudImageHandler::getImageGeometry()
-{
-   if (!isOpen())
-      return 0;
-
-   if (theGeometry.valid())
-      return theGeometry;
-
-   // Check for external geom (i.e., a *.geom file)
-   theGeometry = getExternalImageGeometry();
-   if (theGeometry.valid())
-      return theGeometry;
-
-   theGeometry = new ossimImageGeometry();
-   ossimString epsgCode ("EPSG:4326");
-   ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>(
-         ossimEpsgProjectionFactory::instance()->createProjection(epsgCode));
-   if (!proj)
-      return 0;
-   theGeometry->setProjection(proj);
-
-   // Need to establish image bounds and optimal GSD given ground rect. Use this switch to also
-   // initialize the UL tiepoint of image projection:
-   ossimGrect bounds;
-   m_pch->getBounds(bounds);
-   proj->setOrigin(bounds.ul());
-   proj->setUlTiePoints(bounds.ul());
-
-   // The GSD depends on the point density on the ground. count all final returns and
-   // assume they are evenly distributed over the bounding ground rect. Note that this can have
-   // up to a sqrt(2)X error if the collection was taken in a cardinal-diagonal direction.
-   // Also use this point loop to latch the ground quad vertices vertices.
-   ossim_uint32 numPulses = m_pch->getNumPoints(); // count of final returns
-   if (numPulses == 0)
-   {
-      // Not yet determined. Set GSD to NAN and expect it will be set later:
-      m_gsd.makeNan();
-   }
-   else if (m_gsd.hasNans())
-   {
-      ossimDpt delta (bounds.widthMeters(), bounds.heightMeters());
-      ossim_float64 gsd = sqrt(delta.x * delta.y / numPulses) * m_gsdFactor;
-      setGSD(gsd); // also recomputes the image size
-   }
-
-   return theGeometry;
-}
-
-ossimRefPtr<ossimImageData> ossimPointCloudImageHandler::getTile(const ossimIrect& tile_rect,
-                                                                 ossim_uint32 resLevel)
-{
-   if (!m_tile.valid())
-      initTile();
-
-   // Image rectangle must be set prior to calling getTile.
-   m_tile->setImageRectangle(tile_rect);
-   if (getTile(m_tile.get(), resLevel) == false)
-   {
-      if (m_tile->getDataObjectStatus() != OSSIM_NULL)
-         m_tile->makeBlank();
-   }
-
-   return m_tile;
-}
-
-bool ossimPointCloudImageHandler::getTile(ossimImageData* result, ossim_uint32 resLevel)
-{
-   // check for all systems go and valid args:
-   if (!m_pch.valid() || !result || (result->getScalarType() != OSSIM_FLOAT32)
-       || (result->getDataObjectStatus() == OSSIM_NULL) || m_gsd.hasNans())
-   {
-      return false;
-   }
-
-   // Overviews achieved with GSD setting. This may be too slow.
-   ossimDpt gsd (m_gsd);
-   if (resLevel > 0)
-      getGSD(gsd, resLevel);
-
-   // Establish the ground and image rects for this tile:
-   const ossimIrect img_tile_rect = result->getImageRectangle();
-   const ossimIpt tile_offset (img_tile_rect.ul());
-   const ossim_uint32 tile_width = img_tile_rect.width();
-   const ossim_uint32 tile_height = img_tile_rect.height();
-   const ossim_uint32 tile_size = img_tile_rect.area();
-
-   ossimGpt gnd_ul, gnd_lr;
-   ossimDpt dpt_ul (img_tile_rect.ul().x - 0.5, img_tile_rect.ul().y - 0.5);
-   ossimDpt dpt_lr (img_tile_rect.lr().x + 0.5, img_tile_rect.lr().y + 0.5);
-   theGeometry->rnToWorld(dpt_ul, resLevel, gnd_ul);
-   theGeometry->rnToWorld(dpt_lr, resLevel, gnd_lr);
-   const ossimGrect gnd_rect (gnd_ul, gnd_lr);
-
-   // Create array of buckets to store accumulated point data.
-   ossim_uint32 numBands = result->getNumberOfBands();
-   if (numBands > getNumberOfInputBands())
-   {
-      // This should never happen;
-      ossimNotify(ossimNotifyLevel_FATAL)
-            << "ossimPointCloudImageHandler::getTile() ERROR: \n"
-            << "More bands were requsted than was available from the point cloud source. Returning "
-            << "blank tile." << endl;
-      result->makeBlank();
-      return false;
-   }
-   std::map<ossim_int32, PcrBucket*> accumulator;
-
-   // initialize a point block with desired fields as requested in the reader properties
-   ossimPointBlock pointBlock (this);
-   pointBlock.setFieldCode(componentToFieldCode());
-   m_pch->rewind();
-
-   ossimDpt ipt;
-   ossimGpt pos;
-
-#define USE_GETBLOCK
-#ifdef USE_GETBLOCK
-   m_pch->getBlock(gnd_rect, pointBlock);
-   for (ossim_uint32 id=0; id<pointBlock.size(); ++id)
-   {
-      pos = pointBlock[id]->getPosition();
-      theGeometry->worldToRn(pos, resLevel, ipt);
-      ipt.x = ossim::round<double,double>(ipt.x) - tile_offset.x;
-      ipt.y = ossim::round<double,double>(ipt.y) - tile_offset.y;
-
-      ossim_int32 bucketIndex = ipt.y*tile_width + ipt.x;
-      if ((bucketIndex >= 0) && (bucketIndex < (ossim_int32)tile_size))
-         addSample(accumulator, bucketIndex, pointBlock[id]);
-   }
-
-#else // using getFileBlock
-   ossim_uint32 numPoints = m_pch->getNumPoints();
-   if (numPoints > ossimPointCloudHandler::DEFAULT_BLOCK_SIZE)
-      numPoints = ossimPointCloudHandler::DEFAULT_BLOCK_SIZE;
-
-   // Loop to read all point blocks:
-   do
-   {
-      pointBlock.clear();
-      m_pch->getNextFileBlock(pointBlock, numPoints);
-      //m_pch->normalizeBlock(pointBlock);
-
-      for (ossim_uint32 id=0; id<pointBlock.size(); ++id)
-      {
-         // Check that each point in read block is inside the ROI before accumulating it:
-         pos = pointBlock[id]->getPosition();
-         if (gnd_rect.pointWithin(pos))
-         {
-            theGeometry->worldToRn(pos, resLevel, ipt);
-            ipt.x = ossim::round<double,double>(ipt.x) - tile_offset.x;
-            ipt.y = ossim::round<double,double>(ipt.y) - tile_offset.y;
-
-            ossim_int32 bucketIndex = ipt.y*tile_width + ipt.x;
-            if ((bucketIndex >= 0) && (bucketIndex < (ossim_int32)tile_size))
-               addSample(accumulator, bucketIndex, pointBlock[id]);
-         }
-      }
-   } while (pointBlock.size() == numPoints);
-#endif
-
-   // Finished accumulating, need to normalize and fill the tile.
-   // We must always blank out the tile as we may not have a point for every pixel.
-   normalize(accumulator);
-   ossim_float32** buf = new ossim_float32*[numBands];
-   std::map<ossim_int32, PcrBucket*>::iterator accum_iter;
-   ossim_float32 null_pixel = OSSIM_DEFAULT_NULL_PIX_FLOAT;
-   result->setNullPix(null_pixel);
-   for (ossim_uint32 band = 0; band < numBands; band++)
-   {
-      ossim_uint32 index = 0;
-      buf[band] = result->getFloatBuf(band);
-      for (ossim_uint32 y = 0; y < tile_height; y++)
-      {
-         for (ossim_uint32 x = 0; x < tile_width; x++)
-         {
-            accum_iter = accumulator.find(index);
-            if (accum_iter != accumulator.end())
-               buf[band][index] = accum_iter->second->m_bucket[band];
-            else
-               buf[band][index] = null_pixel;
-            ++index;
-         }
-      }
-   }
-
-   delete [] buf;
-   buf = 0;
-
-   std::map<ossim_int32, PcrBucket*>::iterator pcr_iter = accumulator.begin();
-   while (pcr_iter != accumulator.end())
-   {
-      delete pcr_iter->second;
-      pcr_iter++;
-   }
-
-   result->validate();
-   return true;
-}
-
-void ossimPointCloudImageHandler::addSample(std::map<ossim_int32, PcrBucket*>& accumulator,
-                                            ossim_int32 index,
-                                            const ossimPointRecord* sample)
-{
-   if (sample == 0)
-      return;
-
-   //cout << "sample: "<<*sample<<endl;//TODO: REMOVE DEBUG
-
-   // Search map for exisiting point in that location:
-   std::map<ossim_int32, PcrBucket*>::iterator iter = accumulator.find(index);
-   if (iter == accumulator.end())
-   {
-      // First hit. Initialize location with current sample:
-      if (m_activeComponent == INTENSITY)
-      {
-         accumulator[index] = new PcrBucket(sample->getField(ossimPointRecord::Intensity));
-      }
-      else if (m_activeComponent == RGB)
-      {
-         ossim_float32 color[3];
-         color[0] = sample->getField(ossimPointRecord::Red);
-         color[1] = sample->getField(ossimPointRecord::Green);
-         color[2] = sample->getField(ossimPointRecord::Blue);
-         accumulator[index] = new PcrBucket(color, 3);
-      }
-      else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
-         accumulator[index] = new PcrBucket(sample->getPosition().hgt);
-      else if (m_activeComponent == RETURNS)
-         accumulator[index] = new PcrBucket(sample->getField(ossimPointRecord::NumberOfReturns));
-   }
-   else
-   {
-      // Not the first hit at this location, accumulate:
-      // First hit. Initialize location with current sample:
-      if (m_activeComponent == INTENSITY)
-      {
-         iter->second->m_bucket[0] += sample->getField(ossimPointRecord::Intensity);
-      }
-      else if (m_activeComponent == RGB)
-      {
-         iter->second->m_bucket[0] += sample->getField(ossimPointRecord::Red);
-         iter->second->m_bucket[1] += sample->getField(ossimPointRecord::Green);
-         iter->second->m_bucket[2] += sample->getField(ossimPointRecord::Blue);
-      }
-      else if ((m_activeComponent == HIGHEST) &&
-            (sample->getPosition().hgt > iter->second->m_bucket[0]))
-         iter->second->m_bucket[0] = sample->getPosition().hgt;
-      else if ((m_activeComponent == LOWEST) &&
-            (sample->getPosition().hgt < iter->second->m_bucket[0]))
-         iter->second->m_bucket[0] = sample->getPosition().hgt;
-      else if (m_activeComponent == RETURNS)
-         iter->second->m_bucket[0] += sample->getField(ossimPointRecord::NumberOfReturns);
-
-      iter->second->m_numSamples++;
-   }
-}
-
-void ossimPointCloudImageHandler::normalize(std::map<ossim_int32, PcrBucket*>& accumulator)
-{
-   // highest and lowest elevations latch extremes, no mean is computed but needs to be normalized
-   if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST) ||
-         (m_activeComponent == RETURNS))
-      return;
-
-   int numBands = 1;
-   if (m_activeComponent == RGB)
-      numBands = 3;
-
-   std::map<ossim_int32, PcrBucket*>::iterator iter = accumulator.begin();
-   ossim_float32 avg;
-   while (iter != accumulator.end())
-   {
-      for (int i=0; i<numBands; i++)
-      {
-         avg = iter->second->m_bucket[i] / iter->second->m_numSamples;
-         iter->second->m_bucket[i] = avg;
-      }
-      iter++;
-   }
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getNumberOfInputBands() const
-{
-   ossim_uint32 numBands = 0;
-   if (m_pch.valid())
-   {
-      if (m_activeComponent == INTENSITY)
-         numBands = 1;
-      else if (m_activeComponent == RGB)
-         numBands = 3;
-      else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
-         numBands = 1;
-      else if (m_activeComponent == RETURNS)
-         numBands = 1;
-   }
-   return numBands;
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getNumberOfLines(ossim_uint32 resLevel) const
-{
-   ossim_uint32 result = 0;
-   if (isOpen() && theGeometry.valid())
-   {
-      ossimIpt image_size(theGeometry->getImageSize());
-      result = image_size.line;
-      if (resLevel)
-         result = (result >> resLevel);
-   }
-   return result;
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getNumberOfSamples(ossim_uint32 resLevel) const
-{
-   ossim_uint32 result = 0;
-   if (isOpen() && theGeometry.valid())
-   {
-      ossimIpt image_size(theGeometry->getImageSize());
-      result = image_size.samp;
-      if (resLevel)
-         result = (result >> resLevel);
-   }
-   return result;
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getImageTileWidth() const
-{
-   return getTileWidth();
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getImageTileHeight() const
-{
-   return getTileHeight();
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getTileWidth() const
-{
-   ossimIpt ipt;
-   ossim::defaultTileSize(ipt);
-   return ipt.x;
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getTileHeight() const
-{
-   ossimIpt ipt;
-   ossim::defaultTileSize(ipt);
-   return ipt.y;
-}
-
-ossimScalarType ossimPointCloudImageHandler::getOutputScalarType() const
-{
-   return OSSIM_FLOAT32;
-}
-
-void ossimPointCloudImageHandler::getEntryList(std::vector<ossim_uint32>& entryList) const
-{
-   entryList.clear();
-   for (ossim_uint32 i = 0; i < m_componentNames.size(); i++)
-   {
-      entryList.push_back(i);
-   }
-}
-
-void ossimPointCloudImageHandler::getEntryNames(std::vector<ossimString>& entryNames) const
-{
-   entryNames = m_componentNames;
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getCurrentEntry() const
-{
-   return (ossim_uint32) m_activeComponent;
-}
-
-bool ossimPointCloudImageHandler::setCurrentEntry(ossim_uint32 entryIdx)
-{
-   if (entryIdx >= NUM_COMPONENTS)
-      return false;
-
-   m_activeComponent = (Components) entryIdx;
-   if (m_pch.valid() && m_pch->getMinPoint() && m_pch->getMaxPoint())
-   {
-      if (m_activeComponent == INTENSITY)
-      {
-         m_minPixel = m_pch->getMinPoint()->getField(ossimPointRecord::Intensity);
-         m_maxPixel = m_pch->getMaxPoint()->getField(ossimPointRecord::Intensity);
-      }
-      else if (m_activeComponent == RGB)
-      {
-         m_minPixel = m_pch->getMinPoint()->getField(ossimPointRecord::Red);
-         m_maxPixel = m_pch->getMaxPoint()->getField(ossimPointRecord::Red);
-      }
-      else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
-      {
-         m_minPixel = m_pch->getMinPoint()->getPosition().hgt;
-         m_maxPixel = m_pch->getMaxPoint()->getPosition().hgt;
-      }
-      else if (m_activeComponent == RETURNS)
-      {
-         m_minPixel = 0;
-         m_maxPixel = m_pch->getMaxPoint()->getField(ossimPointRecord::NumberOfReturns);
-      }
-   }
-
-   return true;
-}
-
-ossimString ossimPointCloudImageHandler::getShortName() const
-{
-   return ossimString("Point Cloud Image Handler");
-}
-
-ossimString ossimPointCloudImageHandler::getLongName() const
-{
-   return ossimString("ossim point cloud to image renderer");
-}
-
-double ossimPointCloudImageHandler::getMinPixelValue(ossim_uint32 /* band */) const
-{
-   return m_minPixel;
-}
-
-double ossimPointCloudImageHandler::getMaxPixelValue(ossim_uint32 /* band */) const
-{
-   return m_maxPixel;
-}
-
-double ossimPointCloudImageHandler::getNullPixelValue(ossim_uint32 /* band */) const
-{
-   return OSSIM_DEFAULT_NULL_PIX_FLOAT;
-}
-
-ossim_uint32 ossimPointCloudImageHandler::getNumberOfDecimationLevels() const
-{
-   // Can support any number of rlevels.
-   ossim_uint32 result = 1;
-   const ossim_uint32 STOP_DIMENSION = 16;
-   ossim_uint32 largestImageDimension =
-         getNumberOfSamples(0) > getNumberOfLines(0) ? getNumberOfSamples(0) : getNumberOfLines(0);
-   while (largestImageDimension > STOP_DIMENSION)
-   {
-      largestImageDimension /= 2;
-      ++result;
-   }
-   return result;
-}
-
-void ossimPointCloudImageHandler::initTile()
-{
-   const ossim_uint32 BANDS = getNumberOfOutputBands();
-
-   m_tile = new ossimImageData(this, getOutputScalarType(), BANDS, getTileWidth(), getTileHeight());
-
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      m_tile->setMinPix(getMinPixelValue(band), band);
-      m_tile->setMaxPix(getMaxPixelValue(band), band);
-      m_tile->setNullPix(getNullPixelValue(band), band);
-   }
-
-   m_tile->initialize();
-}
-
-void ossimPointCloudImageHandler::getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const
-{
-   // std::pow(2.0, 0) returns 1.
-   ossim_float64 d = std::pow(2.0, static_cast<double>(resLevel));
-   gsd.x = m_gsd.x * d;
-   gsd.y = m_gsd.y * d;
-}
-
-void ossimPointCloudImageHandler::setGSD(const ossim_float64& gsd)
-{
-   if (ossim::isnan(gsd) || (gsd<=0.0) || !theGeometry.valid())
-         return;
-
-   m_gsd = ossimDpt(gsd, gsd);
-   m_gsdFactor = 1.0; // resets after GSD adjusted
-
-   ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>(theGeometry->getProjection());
-   if (!proj)
-      return;
-
-   proj->setMetersPerPixel(m_gsd);
-
-   ossimGrect bounds;
-   m_pch->getBounds(bounds);
-
-   ossimDpt ipt_ul, ipt_lr;
-   theGeometry->worldToLocal(bounds.ul(), ipt_ul);
-   theGeometry->worldToLocal(bounds.lr(), ipt_lr);
-   ossimIpt image_size;
-   image_size.x = ossim::round<ossim_int32,double>(ipt_lr.x - ipt_ul.x) + 1;
-   image_size.y = ossim::round<ossim_int32,double>(ipt_lr.y - ipt_ul.y) + 1;
-
-   theGeometry->setImageSize(image_size);
-}
-
-bool ossimPointCloudImageHandler::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   static const char MODULE[] = "ossimPointCloudImageHandler::saveState()";
-
-   ossimImageHandler::saveState(kwl, prefix);
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << MODULE
-            << " ERROR detected in keyword list!  State not saved." << std::endl;
-      return false;
-   }
-
-   kwl.add(prefix, ossimKeywordNames::ENTRY_KW, (int) m_activeComponent, true);
-   kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW, m_gsd.x, true);
-
-   return true;
-}
-
-bool ossimPointCloudImageHandler::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   static const char MODULE[] = "ossimPointCloudImageHandler::loadState()";
-   theDecimationFactors.clear();
-   if(traceDebug())
-      ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " DEBUG: entered ..."<< std::endl;
-
-   ossimImageHandler::loadState(kwl, prefix);
-   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<< MODULE
-            << "WARNING: error detected in keyword list!  State not load." << std::endl;
-      return false;
-   }
-
-   m_activeComponent = INTENSITY;
-   ossimString value = kwl.find(prefix, ossimKeywordNames::ENTRY_KW);
-   if (!value.empty())
-   {
-      ossim_uint32 i = value.toUInt32();
-      if (i < NUM_COMPONENTS)
-         m_activeComponent = (Components) i;
-   }
-
-   value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW);
-   if (!value.empty())
-      setGSD(value.toDouble());
-
-   // The rest of the state is established by opening the file:
-   bool good_open = open();
-
-   return good_open;
-}
-
-void ossimPointCloudImageHandler::getValidImageVertices(std::vector<ossimIpt>& validVertices,
-                                   ossimVertexOrdering ordering,
-                                   ossim_uint32 resLevel) const
-{
-   validVertices.clear();
-   if (!m_pch.valid())
-      return;
-   int divisor = 1;
-   if (resLevel)
-      divisor = resLevel<<1;
-
-   // Transform the world coords for the four vertices into image vertices:
-   ossimDpt r0Pt;
-   ossimGrect bounds;
-   m_pch->getBounds(bounds);
-   theGeometry->worldToLocal(bounds.ul(), r0Pt);
-   validVertices.push_back(r0Pt);
-   theGeometry->worldToLocal(bounds.ur(), r0Pt);
-   validVertices.push_back(r0Pt);
-   theGeometry->worldToLocal(bounds.lr(), r0Pt);
-   validVertices.push_back(r0Pt);
-   theGeometry->worldToLocal(bounds.ll(), r0Pt);
-   validVertices.push_back(r0Pt);
-
-   if (ordering == OSSIM_COUNTERCLOCKWISE_ORDER)
-   {
-      for (int i=3; i>=0; i--)
-         validVertices.push_back(validVertices[i]/divisor);
-      validVertices.erase(validVertices.begin(), validVertices.begin()+4);
-   }
-}
-
-void ossimPointCloudImageHandler::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if (!property.valid())
-      return;
-
-   ossimString s;
-   property->valueToString(s);
-   if (s.empty())
-      return;
-
-   // The user should select either explicit GSD or relative GSD factor, never both:
-   if ( property->getName() == ossimKeywordNames::METERS_PER_PIXEL_KW )
-   {
-      ossim_float64 gsd = s.toFloat64();
-      if (!ossim::isnan(gsd))
-         setGSD(gsd);
-   }
-   else if ( property->getName() == GSD_FACTOR_KW )
-   {
-      m_gsdFactor = s.toDouble();
-      if (!ossim::isnan(m_gsdFactor))
-      {
-         if (!m_gsd.hasNans())
-            setGSD(m_gsd.x * m_gsdFactor);
-      }
-      else
-         m_gsdFactor = 1.0;
-   }
-   else if ( property->getName() == ossimKeywordNames::ENTRY_KW )
-   {
-      m_activeComponent = (Components) s.toUInt32();
-   }
-   else if ( property->getName() == COMPONENT_KW )
-   {
-      for (int i=0; i<NUM_COMPONENTS; i++)
-      {
-         if (s.upcase() == m_componentNames[i])
-         {
-            m_activeComponent = (Components) i;
-            break;
-         }
-      }
-   }
-   else
-   {
-      ossimImageHandler::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimPointCloudImageHandler::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> prop = 0;
-   if ( name == ossimKeywordNames::METERS_PER_PIXEL_KW )
-   {
-      ossimString value = ossimString::toString(m_gsd.x);
-      prop = new ossimStringProperty(name, value);
-   }
-   else if ( name == GSD_FACTOR_KW )
-   {
-      prop = new ossimNumericProperty(name, ossimString::toString(m_gsdFactor));
-   }
-   else if ( name == ossimKeywordNames::ENTRY_KW )
-   {
-      prop = new ossimNumericProperty(name, ossimString::toString((ossim_uint32) m_activeComponent));
-   }
-   else if ( name == COMPONENT_KW )
-   {
-      prop = new ossimStringProperty(name, m_componentNames[m_activeComponent]);
-   }
-   else
-   {
-      prop = ossimImageHandler::getProperty(name);
-   }
-   return prop;
-}
-
-ossim_uint32 ossimPointCloudImageHandler::componentToFieldCode() const
-{
-   ossim_uint32 field_code = 0;
-   switch (m_activeComponent)
-   {
-   case INTENSITY:
-      field_code = ossimPointRecord::Intensity;
-      break;
-   case RETURNS:
-      field_code = ossimPointRecord::NumberOfReturns;
-      break;
-   case RGB:
-      field_code = ossimPointRecord::Red | ossimPointRecord::Green | ossimPointRecord::Blue;
-      break;
-   default:
-      break;
-   }
-   return field_code;
-}
-
-
-
diff --git a/ossim/src/ossim/point_cloud/ossimPointCloudSource.cpp b/ossim/src/ossim/point_cloud/ossimPointCloudSource.cpp
deleted file mode 100644
index 5b52013..0000000
--- a/ossim/src/ossim/point_cloud/ossimPointCloudSource.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-
-#include <ossim/point_cloud/ossimPointCloudSource.h>
-#include <ossim/point_cloud/ossimPointCloudGeometry.h>
-#include <ossim/point_cloud/ossimPointRecord.h>
-
-RTTI_DEF1(ossimPointCloudSource, "ossimPointCloudSource" , ossimSource);
-
-
-ossimPointCloudSource::ossimPointCloudSource(ossimObject* owner)
-      : ossimSource(owner)
-{
-}
-
-ossimPointCloudSource::ossimPointCloudSource(const ossimPointCloudSource& rhs)
-      : ossimSource(rhs)
-{
-}
-
-ossimPointCloudSource::~ossimPointCloudSource()
-{
-}
-
-const ossimPointRecord*  ossimPointCloudSource::getMinPoint() const
-{
-   if (getInput(0) == 0)
-      return &m_nullPCR;
-
-   return ((ossimPointCloudSource*)getInput(0))->getMinPoint();
-}
-
-const ossimPointRecord*  ossimPointCloudSource::getMaxPoint() const
-{
-   if (getInput(0) == 0)
-      return &m_nullPCR;
-
-   return ((ossimPointCloudSource*)getInput(0))->getMaxPoint();
-}
-
-ossim_uint32  ossimPointCloudSource::getFieldCode() const
-{
-   if (getInput(0) == 0)
-      return 0;
-
-   return ((ossimPointCloudSource*)getInput(0))->getFieldCode();
-}
-
-void ossimPointCloudSource::setFieldCode(ossim_uint32 fc)
-{
-   if (getInput(0) != 0)
-      ((ossimPointCloudSource*) getInput(0))->setFieldCode(fc);
-}
-
-bool ossimPointCloudSource::canConnectMyInputTo(ossim_int32 i,const ossimConnectableObject* p) const
-{
-   if ( (i>0) || (p==0) )
-      return false;
-
-   return (p->canCastTo("ossimPointCloudSource"));
-}
-
diff --git a/ossim/src/ossim/point_cloud/ossimPointRecord.cpp b/ossim/src/ossim/point_cloud/ossimPointRecord.cpp
deleted file mode 100644
index db24b21..0000000
--- a/ossim/src/ossim/point_cloud/ossimPointRecord.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-//**************************************************************************************************
-//
-// OSSIM (http://trac.osgeo.org/ossim/)
-//
-// License: MIT
-//
-//**************************************************************************************************
-// $Id: ossimPointRecord.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/point_cloud/ossimPointRecord.h>
-
-ossimPointRecord::ossimPointRecord(ossim_uint32 field_code)
-      : m_pointId(0)
-{
-   if (field_code & Intensity)
-      m_fieldMap[Intensity] = ossim::nan();
-   if (field_code & ReturnNumber)
-      m_fieldMap[ReturnNumber] = ossim::nan();
-   if (field_code & NumberOfReturns)
-      m_fieldMap[NumberOfReturns] = ossim::nan();
-   if (field_code & Red)
-      m_fieldMap[Red] = ossim::nan();
-   if (field_code & Green)
-      m_fieldMap[Green] = ossim::nan();
-   if (field_code & Blue)
-      m_fieldMap[Blue] = ossim::nan();
-   if (field_code & GpsTime)
-      m_fieldMap[GpsTime] = ossim::nan();
-   if (field_code & Infrared)
-      m_fieldMap[Infrared] = ossim::nan();
-}
-
-ossimPointRecord::ossimPointRecord(const ossimPointRecord& pcr)
-      : m_pointId(pcr.m_pointId),
-        m_position(pcr.m_position),
-        m_fieldMap (pcr.m_fieldMap)
-{
-}
-
-ossimPointRecord::ossimPointRecord(const ossimGpt& pos)
-      : m_pointId(0),
-        m_position(pos)
-{
-}
-
-ossimPointRecord::~ossimPointRecord()
-{
-}
-
-inline bool ossimPointRecord::hasFields(ossim_uint32 field_code) const
-{
-   bool found = true;
-
-   if (field_code & Intensity)
-      found &= m_fieldMap.find(Intensity) != m_fieldMap.end();
-   if (found && (field_code & ReturnNumber))
-         found = m_fieldMap.find(ReturnNumber) != m_fieldMap.end();
-   if (found && (field_code & NumberOfReturns))
-         found = m_fieldMap.find(NumberOfReturns) != m_fieldMap.end();
-   if (found && (field_code & Red))
-         found = m_fieldMap.find(Red) != m_fieldMap.end();
-   if (found && (field_code & Green))
-         found = m_fieldMap.find(Green) != m_fieldMap.end();
-   if (found && (field_code & Blue))
-         found = m_fieldMap.find(Blue) != m_fieldMap.end();
-   if (found && (field_code & GpsTime))
-         found = m_fieldMap.find(GpsTime) != m_fieldMap.end();
-   if (found && (field_code & Infrared))
-         found = m_fieldMap.find(Infrared) != m_fieldMap.end();
-
-   return found;
-}
-
-inline ossim_uint32 ossimPointRecord::getFieldCode() const
-{
-   ossim_uint32 field_code = 0;
-
-   if (m_fieldMap.find(Intensity) != m_fieldMap.end())
-      field_code |= Intensity;
-   if (m_fieldMap.find(ReturnNumber) != m_fieldMap.end())
-      field_code |= ReturnNumber;
-   if (m_fieldMap.find(NumberOfReturns) != m_fieldMap.end())
-      field_code |= NumberOfReturns;
-   if (m_fieldMap.find(Red) != m_fieldMap.end())
-      field_code |= Red;
-   if (m_fieldMap.find(Green) != m_fieldMap.end())
-      field_code |= Green;
-   if (m_fieldMap.find(Blue) != m_fieldMap.end())
-      field_code |= Blue;
-   if (m_fieldMap.find(GpsTime) != m_fieldMap.end())
-      field_code |= GpsTime;
-   if (m_fieldMap.find(Infrared) != m_fieldMap.end())
-      field_code |= Infrared;
-
-   return field_code;
-}
-
-ossim_float32 ossimPointRecord::getField(FIELD_CODES fc) const
-{
-   std::map<FIELD_CODES, ossim_float32>::const_iterator v = m_fieldMap.find(fc);
-   if (v == m_fieldMap.end())
-      return ossim::nan();
-   return v->second;
-}
-
-void  ossimPointRecord::setField(FIELD_CODES fc, ossim_float32 value)
-{
-   m_fieldMap[fc] = value;
-}
-
-
-ossimPointRecord& ossimPointRecord::operator=(const ossimPointRecord& pcr)
-{
-   if (this == &pcr)
-      return *this;
-
-   m_pointId = pcr.m_pointId;
-   m_position = pcr.m_position;
-   m_fieldMap = pcr.m_fieldMap;
-
-   return *this;
-}
-
-std::ostream& operator << (std::ostream& out, const ossimPointRecord& p)
-{
-   out   << "ossimPointCloudRecord for pointId: " << p.m_pointId
-         << "\n   Position: " << p.m_position << ends;
-
-   std::map<ossimPointRecord::FIELD_CODES, ossim_float32>::const_iterator iter = p.m_fieldMap.begin();
-   while (iter != p.m_fieldMap.end())
-   {
-      switch (iter->first)
-      {
-      case ossimPointRecord::Intensity:
-         out << "\n   Intensity: ";
-         break;
-      case ossimPointRecord::ReturnNumber:
-         out << "\n   ReturnNumber: ";
-         break;
-      case ossimPointRecord::NumberOfReturns:
-         out << "\n   NumberOfReturns: ";
-         break;
-      case ossimPointRecord::Red:
-         out << "\n   Red: ";
-         break;
-      case ossimPointRecord::Green:
-         out << "\n   Green: ";
-         break;
-      case ossimPointRecord::Blue:
-         out << "\n   Blue: ";
-         break;
-      case ossimPointRecord::GpsTime:
-         out << "\n   GpsTime: ";
-         break;
-      case ossimPointRecord::Infrared:
-         out << "\n   Infrared: ";
-         break;
-      default:
-         out << "\n   Unidentified: ";
-      }
-      out << iter->second;
-      ++iter;
-   }
-   return out;
-}
-
-void ossimPointRecord::clear()
-{
-   m_pointId = 0;
-}
-
-bool ossimPointRecord::isValid() const
-{
-   if ((m_pointId == 0) || m_fieldMap.empty() || m_position.hasNans())
-      return false;
-   return true;
-}
-
-
-
diff --git a/ossim/src/ossim/projection/makefile.vc b/ossim/src/ossim/projection/makefile.vc
deleted file mode 100644
index b889748..0000000
--- a/ossim/src/ossim/projection/makefile.vc
+++ /dev/null
@@ -1,103 +0,0 @@
-###
-# $Id: makefile.vc 17687 2010-07-06 16:19:36Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimAdjMapModel.obj \
-ossimAffineProjection.obj \
-ossimAlbersProjection.obj \
-ossimApplanixEcefModel.obj \
-ossimApplanixUtmModel.obj \
-ossimAzimEquDistProjection.obj \
-ossimBilinearProjection.obj \
-ossimBngProjection.obj \
-ossimBonneProjection.obj \
-ossimBuckeyeSensor.obj \
-ossimCadrgProjection.obj \
-ossimCassiniProjection.obj \
-ossimCoarseGridModel.obj \
-ossimCylEquAreaProjection.obj \
-ossimEckert4Projection.obj \
-ossimEckert6Projection.obj \
-ossimEquDistCylProjection.obj \
-ossimFcsiModel.obj \
-ossimGcsCodeProjectionFactory.obj \
-ossimGnomonicProjection.obj \
-ossimIkonosRpcModel.obj \
-ossimImageProjectionModel.obj \
-ossimImageViewAffineTransform.obj \
-ossimImageViewProjectionTransform.obj \
-ossimImageViewTransform.obj \
-ossimImageViewTransformFactory.obj \
-ossimLambertConformalConicProjection.obj \
-ossimLandSatModel.obj \
-ossimLensDistortion.obj \
-ossimLlxyProjection.obj \
-ossimMapProjection.obj \
-ossimMapProjectionFactory.obj \
-ossimMapProjectionInfo.obj \
-ossimMapViewController.obj \
-ossimMeanRadialLensDistortion.obj \
-ossimMercatorProjection.obj \
-ossimMgrs.obj \
-ossimMillerProjection.obj \
-ossimMiscProjectionFactory.obj \
-ossimMollweidProjection.obj \
-ossimNewZealandMapGridProjection.obj \
-ossimNitfMapModel.obj \
-ossimNitfProjectionFactory.obj \
-ossimNitfRpcModel.obj \
-ossimObliqueMercatorProjection.obj \
-ossimOptimizableProjection.obj \
-ossimOrthoGraphicProjection.obj \
-ossimPcsCodeProjectionFactory.obj \
-ossimPolarStereoProjection.obj \
-ossimPolarst.obj \
-ossimPolyconicProjection.obj \
-ossimPolynomProjection.obj \
-ossimPositionQualityEvaluator.obj \
-ossimProjection.obj \
-ossimProjectionFactoryBase.obj \
-ossimProjectionFactoryRegistry.obj \
-ossimProjectionViewControllerFactory.obj \
-ossimQuadProjection.obj \
-ossimQuickbirdRpcModel.obj \
-ossimRadialDecentLensDistortion.obj \
-ossimRpcModel.obj \
-ossimRpcProjection.obj \
-ossimRpcSolver.obj \
-ossimSarModel.obj \
-ossimSensorModel.obj \
-ossimSensorModelFactory.obj \
-ossimSensorModelTuple.obj \
-ossimSinusoid.obj \
-ossimSinusoidalProjection.obj \
-ossimSmacCallibrationSystem.obj \
-ossimSonomaSensor.obj \
-ossimSpaceObliqueMercatorProjection.obj \
-ossimSpot5Model.obj \
-ossimSrsProjectionFactory.obj \
-ossimStatePlaneProjectionFactory.obj \
-ossimStatePlaneProjectionInfo.obj \
-ossimStereographicProjection.obj \
-ossimTiffProjectionFactory.obj \
-ossimTranmerc.obj \
-ossimTransCylEquAreaProjection.obj \
-ossimTransMercatorProjection.obj \
-ossimUps.obj \
-ossimUpsProjection.obj \
-ossimUpspt.obj \
-ossimUtm.obj \
-ossimUtmProjection.obj \
-ossimUtmpt.obj \
-ossimVanDerGrintenProjection.obj \
-ossimWarpProjection.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/projection/ossimAdjMapModel.cpp b/ossim/src/ossim/projection/ossimAdjMapModel.cpp
deleted file mode 100644
index 4576963..0000000
--- a/ossim/src/ossim/projection/ossimAdjMapModel.cpp
+++ /dev/null
@@ -1,418 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (c) 2005, Oscar Kramer, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-// Description:
-// 
-// Special "sensor model" that provides a conventional map projection but
-// with additional capability for adjusting the map x,y coordinates with
-// offset, scale, and rotation transform.  Funtions to control notifications,
-// information and error output.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimAdjMapModel.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib> /* for atof */
-#include <ossim/projection/ossimAdjMapModel.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/projection/ossimMapProjectionFactory.h>
-#include <ossim/elevation/ossimElevManager.h>
-
-// Geometry File Keywords:
-static const char* PARAMETER_KEYWORDS[] = {"map_offset_x",
-                                           "map_offset_y",
-                                           "map_rotation",
-                                           "map_scale_x",
-                                           "map_scale_y"};
-static const char* MAP_PROJ_FILE_KW    = "map_proj_filename";
-
-RTTI_DEF1(ossimAdjMapModel, "ossimAdjMapModel", ossimSensorModel);
-
-//----------------------------------------------------------------------------
-//! Constructs to uninitialized state (needed by factory).
-//----------------------------------------------------------------------------
-
-ossimAdjMapModel::ossimAdjMapModel()
-   :
-   ossimSensorModel(),
-   theAdjParams(NUM_ADJ_PARAMS),
-   theMapProjection(),
-   theCosTheta(0.0),
-   theSinTheta(0.0)
-{
-   theImageSize = ossimIpt(0,0);
-   initAdjustableParameters();
-   theErrorStatus++;
-}
-
-//----------------------------------------------------------------------------
-//! Constructs with map projection and image rectangle size.
-//----------------------------------------------------------------------------
-
-ossimAdjMapModel::ossimAdjMapModel(ossimMapProjection* map_proj,
-                                   const ossimIpt& image_size)
-   :
-   ossimSensorModel(),
-   theAdjParams(NUM_ADJ_PARAMS),
-   theMapProjection(map_proj),
-   theCosTheta(0.0),
-   theSinTheta(0.0)
-{
-   initializeFromMap();
-   theImageSize = image_size;
-   initAdjustableParameters();
-}
-
-//----------------------------------------------------------------------------
-//! Copy constructor
-//----------------------------------------------------------------------------
-
-ossimAdjMapModel::ossimAdjMapModel(const ossimAdjMapModel& copy_this)
-   :
-   ossimSensorModel(copy_this),
-   theAdjParams(NUM_ADJ_PARAMS),
-   theMapProjection(copy_this.theMapProjection),
-   theCosTheta(0.0),
-   theSinTheta(0.0)
-{
-   theAdjParams = copy_this.theAdjParams;
-}
-
-//----------------------------------------------------------------------------
-//! Constructs from Geom KWL
-//----------------------------------------------------------------------------
-ossimAdjMapModel::ossimAdjMapModel(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-   :
-   ossimSensorModel(kwl),
-   theAdjParams(NUM_ADJ_PARAMS),
-   theMapProjection(),
-   theCosTheta(0.0),
-   theSinTheta(0.0)      
-                
-{
-   initAdjustableParameters();
-   loadState(kwl, prefix);
-}
-
-//----------------------------------------------------------------------------
-//! Constructs from Geom KWL
-//----------------------------------------------------------------------------
-
-ossimAdjMapModel::ossimAdjMapModel(const ossimFilename& kwl_filename)
-   :
-   ossimSensorModel(),
-   theAdjParams(NUM_ADJ_PARAMS),
-   theMapProjection(),
-   theCosTheta(0.0),
-   theSinTheta(0.0)      
-{
-   initAdjustableParameters();
-   ossimKeywordlist kwl (kwl_filename);
-   loadState(kwl);
-}
-
-//----------------------------------------------------------------------------
-//! Initializes base class data members after map model established. Returns TRUE if all's well.
-//----------------------------------------------------------------------------
-bool ossimAdjMapModel::initializeFromMap()
-{
-   if (!theMapProjection)
-   {
-      theErrorStatus++;
-      return false;
-   }
-   theSensorID = "AdjMapModel";
-   theGSD = theMapProjection->getMetersPerPixel();
-   theMeanGSD = 0.5*(theGSD.x + theGSD.y);
-   theRefGndPt = theMapProjection->origin();
-
-   return true;
-}
-
-//----------------------------------------------------------------------------
-//! Destructor
-//----------------------------------------------------------------------------
-ossimAdjMapModel::~ossimAdjMapModel()
-{
-   theAdjParams.CleanUp();
-}
-
-//----------------------------------------------------------------------------
-//! Initializes adjustable parameters to their default values.
-//! Overrides ossimAdjustableParameterInterface virtual method.
-//----------------------------------------------------------------------------
-void ossimAdjMapModel::initAdjustableParameters()
-{
-   // Initialize this adjustment as the initial geometry "adjustment":
-   removeAllAdjustments();
-   newAdjustment(NUM_ADJ_PARAMS);
-   setAdjustmentDescription("Initial Geometry");
-
-   // Initialize each adjustable parameter for this initial:
-   setAdjustableParameter (OFFSET_X, 0.0, 1.0);
-   setParameterDescription(OFFSET_X, "map_offset_x");
-   setParameterCenter     (OFFSET_X, 0.0);
-
-   setAdjustableParameter (OFFSET_Y, 0.0, 1.0);
-   setParameterDescription(OFFSET_Y, "map_offset_y");
-   setParameterCenter     (OFFSET_Y, 0.0);
-
-   setAdjustableParameter (ROTATION, 0.0, 1.0);
-   setParameterDescription(ROTATION, "map_rotation");
-   setParameterCenter     (ROTATION, 0.0);
-
-   setAdjustableParameter (SCALE_X, 0.0, 1.0);
-   setParameterDescription(SCALE_X, "map_scale_x");
-   setParameterCenter     (SCALE_X, 1.0);
-
-   setAdjustableParameter (SCALE_Y, 0.0, 1.0);
-   setParameterDescription(SCALE_Y, "map_scale_y");
-   setParameterCenter     (SCALE_Y, 1.0);
-
-   updateModel();
-}
-
-//----------------------------------------------------------------------------
-//! Following a change to the adjustable parameter set, this virtual is called
-//! to permit instances to compute derived quantities after parameter change.
-//----------------------------------------------------------------------------
-void ossimAdjMapModel::updateModel()
-{
-   for (int i=0; i<NUM_ADJ_PARAMS; i++)
-      theAdjParams[i] = computeParameterOffset(i);
-
-   theCosTheta = ossim::cosd(theAdjParams[ROTATION]);
-   theSinTheta = ossim::sind(theAdjParams[ROTATION]);
-}
-
-//----------------------------------------------------------------------------
-//! Overrides base class pure virtual.
-//----------------------------------------------------------------------------
-void ossimAdjMapModel::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                     const double&   heightEllipsoid,
-                                     ossimGpt&       worldPoint) const
-{
-   // Just call other transform method 
-   // Check for bad map projection pointer:
-   if (!theMapProjection)
-   {
-      worldPoint = ossimGpt(ossim::nan(), ossim::nan(), ossim::nan());
-      return;
-   }
-
-   // Adjust image point by transform:
-   double x = theAdjParams[SCALE_X]*(image_point.x - theAdjParams[OFFSET_X]);
-   double y = theAdjParams[SCALE_Y]*(image_point.y - theAdjParams[OFFSET_Y]);
-   ossimDpt adjusted_point(x*theCosTheta + y*theSinTheta, 
-                           y*theCosTheta - x*theSinTheta);
-
-   // Obtain ground point given adjusted image point:
-   theMapProjection->lineSampleHeightToWorld(adjusted_point,
-                                             heightEllipsoid,
-                                             worldPoint);
-   worldPoint.height(heightEllipsoid);
-}
-
-//----------------------------------------------------------------------------
-//! Overrides base class virtual.
-//----------------------------------------------------------------------------
-void ossimAdjMapModel::lineSampleToWorld(const ossimDpt& image_point,
-                                         ossimGpt&       worldPoint) const
-{
-   lineSampleHeightToWorld(image_point, 0.0, worldPoint);
-   if (!worldPoint.hasNans())
-   {
-//      worldPoint.height(theElevation->getHeightAboveEllipsoid(worldPoint));
-   }
-}
-
-//----------------------------------------------------------------------------
-//! Rigorous inverse transform implented, overrides base-class' iterative
-//! solution.
-//----------------------------------------------------------------------------
-void ossimAdjMapModel::worldToLineSample(const ossimGpt& world_point,
-                                         ossimDpt&       image_point) const
-{
-   // Check for bad map projection pointer:
-   if (!theMapProjection)
-   {
-      image_point = ossimDpt(ossim::nan(), ossim::nan());
-      return;
-   }
-
-   // Obtain non-adjusted image point given ground point:
-   ossimDpt p1;
-   theMapProjection->worldToLineSample(world_point, p1);
-
-   // Adjust image point by transform:
-   ossimDpt p2 (p1.x*theCosTheta - p1.y*theSinTheta, 
-                p1.y*theCosTheta + p1.x*theSinTheta);
-   image_point.x = p2.x/theAdjParams[SCALE_X] + theAdjParams[OFFSET_X];
-   image_point.y = p2.y/theAdjParams[SCALE_Y] + theAdjParams[OFFSET_Y];
-}
-
-//----------------------------------------------------------------------------
-//! Fulfills ossimObject base-class pure virtuals. Saves geometry
-//! KWL files. Returns true if successful.
-//----------------------------------------------------------------------------
-bool ossimAdjMapModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimAdjMapModel");
-
-   // Hand off to base class for common stuff:
-   ossimSensorModel::saveState(kwl, prefix);
-
-   // Save off data members:
-   for (int i=0; i<NUM_ADJ_PARAMS; i++)
-      kwl.add(prefix, PARAMETER_KEYWORDS[i], theAdjParams[i]);
-
-   // Save off map projection info:
-   if (theMapProjection.valid())
-   {
-      theMapProjection->saveState(kwl, prefix);
-   }
-
-   return true;
-}
-
-//----------------------------------------------------------------------------
-//! Fulfills ossimObject base-class pure virtuals. Loads geometry
-//! KWL files. Returns true if successful.
-//----------------------------------------------------------------------------
-bool ossimAdjMapModel::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   static const ossimString MODULE ("ossimAdjMapModel::loadState() -- ");
-   bool success = true;
-   const char* value_str;
-   double value;
-   ossimString error_msg (MODULE+"Error encountered reading keyword: ");
-
-   try
-   {
-      // Verify correct model type:
-      value_str = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-      if ((!value_str) || (strcmp(value_str, TYPE_NAME(this))))
-      {
-         throw (error_msg + ossimKeywordNames::TYPE_KW);
-      }
-
-      //---
-      // Instantiate the map projection via the factory if one has not been
-      // initialized yet:
-      //---
-      if (!theMapProjection)
-      {
-         // should find the map projection filename in the KWL:
-         value_str = kwl.find(prefix, MAP_PROJ_FILE_KW);
-         if (!value_str)
-         {
-            throw (error_msg + MAP_PROJ_FILE_KW);
-         }
-         theMapProjection = PTR_CAST(ossimMapProjection,
-            ossimMapProjectionFactory::instance()->createProjection(ossimKeywordlist(value_str)));
-         if (!theMapProjection)
-         {
-            throw "Error encountered instantiating map ";
-         }
-      }
-
-      // Everything OK so far, just load in the adjustable parameters. This involves modifying the
-      // center value of the bsae class adjustable parameter:
-      for (int i=0; i<NUM_ADJ_PARAMS; i++)
-      {
-         value_str = kwl.find(prefix, PARAMETER_KEYWORDS[i]);
-         if (!value_str)
-         {
-            throw (error_msg + PARAMETER_KEYWORDS[i]).chars();
-         }
-         value = atof(value_str);
-         setParameterCenter(i, value);
-      }
-   }
-   catch (const char* /*message*/)
-   {
-      theErrorStatus++;
-      success = false;
-   }
-
-   //---
-   // updateModel() reads the base class adjustable parameters and initializes
-   // theAdjParams
-   // with the unnormalized, biased (to the "center" set above) quantities
-   // used in the projection:
-   //---
-   if (success)
-   {
-      initializeFromMap();
-      updateModel();
-   }
-
-   return success;
-}  
-
-//----------------------------------------------------------------------------
-//! Writes a template of geom keywords processed by loadState and saveState to
-//! output stream.
-//----------------------------------------------------------------------------
-void ossimAdjMapModel::writeGeomTemplate(ostream& os)
-{
-   os <<
-      "//*****************************************************************\n"
-      "// Template for Adjustable Map Model keywordlist\n"
-      "//*****************************************************************\n"
-      << ossimKeywordNames::TYPE_KW << ": " << "ossimFcsiModel" << endl;
-
-   ossimSensorModel::writeGeomTemplate(os);
-
-   os << "//***\n"
-      << "// Derived-class AdjMapModel Keywords:\n"
-      << "//***\n"
-      << PARAMETER_KEYWORDS[OFFSET_X] << ": <east offset meters>\n"
-      << PARAMETER_KEYWORDS[OFFSET_Y] << ": <north offset meters>\n"
-      << PARAMETER_KEYWORDS[ROTATION] << ": <degrees CW>\n"
-      << PARAMETER_KEYWORDS[SCALE_X]  << ": <ratio>\n"
-      << PARAMETER_KEYWORDS[SCALE_Y]  << ": <ratio>\n"
-      << endl;
-
-   return;
-}
-
-//----------------------------------------------------------------------------
-//! Extends base-class implementation. Dumps contents of object to ostream.
-//----------------------------------------------------------------------------
-std::ostream& ossimAdjMapModel::print(std::ostream& out) const
-{      
-   ossimSensorModel::print(out);
-   for (int i=0; i<NUM_ADJ_PARAMS; i++)
-      out << PARAMETER_KEYWORDS[i]  << ": " << theAdjParams[i] << endl;
-   out << endl;
-
-   return out;
-}
-
-//----------------------------------------------------------------------------
-//! Fetches the GSD from the internal map projection.
-//----------------------------------------------------------------------------
-ossimDpt ossimAdjMapModel::getMetersPerPixel () const
-{
-   if (theMapProjection.valid())
-   {
-      return theMapProjection->getMetersPerPixel();
-   }
-   
-   return ossimDpt(0,0);
-}
-
-ossimObject* ossimAdjMapModel::dup() const
-{
-   return new ossimAdjMapModel(*this);
-}
-
-
diff --git a/ossim/src/ossim/projection/ossimAlbersProjection.cpp b/ossim/src/ossim/projection/ossimAlbersProjection.cpp
deleted file mode 100644
index e7d9f02..0000000
--- a/ossim/src/ossim/projection/ossimAlbersProjection.cpp
+++ /dev/null
@@ -1,642 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Albers projection code.  
-//*******************************************************************
-//  $Id: ossimAlbersProjection.cpp 23002 2014-11-24 17:11:17Z dburken $
-
-#include <ossim/projection/ossimAlbersProjection.h>
-
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimAlbersProjection, "ossimAlbersProjection", ossimMapProjection)
-
-#ifdef PI_OVER_2
-#  undef PI_OVER_2
-#endif   
-
-#define ALBERS_NO_ERROR           0x0000
-#define ALBERS_LAT_ERROR          0x0001
-#define ALBERS_LON_ERROR          0x0002
-#define ALBERS_EASTING_ERROR      0x0004
-#define ALBERS_NORTHING_ERROR     0x0008
-#define ALBERS_ORIGIN_LAT_ERROR   0x0010
-#define ALBERS_CENT_MER_ERROR     0x0020
-#define ALBERS_A_ERROR            0x0040
-#define ALBERS_INV_F_ERROR        0x0080
-#define ALBERS_FIRST_STDP_ERROR   0x0100
-#define ALBERS_SECOND_STDP_ERROR  0x0200
-#define ALBERS_FIRST_SECOND_ERROR 0x0400
-#define ALBERS_HEMISPHERE_ERROR   0x0800
-
-#define PI_OVER_2  ( M_PI / 2.0)                 
-#define ES_SIN(sinlat)          (es * sinlat)
-#define ONE_MINUS_SQR(x)        (1.0 - x * x)
-#define ALBERS_M(clat,oneminussqressin)   (clat / sqrt(oneminussqressin))
-#define ALBERS_Q(slat,oneminussqressin,essin) (one_MINUS_es2)*(slat / (oneminussqressin)-    \
-											  (1 / (two_es)) *log((1 - essin) / (1 + essin)))
-
-
-ossimAlbersProjection::ossimAlbersProjection(const ossimEllipsoid& ellipsoid,
-                                             const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   Albers_Delta_Northing = 40000000.0;
-   Albers_Delta_Easting  = 40000000.0;
-   setDefaults();
-   update();
-}
-    
-ossimAlbersProjection::ossimAlbersProjection(const ossimEllipsoid& ellipsoid,
-                                             const ossimGpt& origin,
-                                             double stdParallel1,
-                                             double stdParallel2,
-                                             double falseEasting,
-                                             double falseNorthing)
-  :ossimMapProjection(ellipsoid, origin)
-{
-   Albers_Std_Parallel_1 = stdParallel1*RAD_PER_DEG;
-   Albers_Std_Parallel_2 = stdParallel2*RAD_PER_DEG;
-   Albers_Delta_Northing = 40000000.0;
-   Albers_Delta_Easting  = 40000000.0;
-   Albers_False_Easting  = falseEasting;
-   Albers_False_Northing = falseNorthing;
-   
-   update();
-   
-}
-
-ossimObject* ossimAlbersProjection::dup() const
-{
-   return new ossimAlbersProjection(*this);
-}
-
-ossimAlbersProjection::~ossimAlbersProjection()
-{
-}
-
-void ossimAlbersProjection::update()
-{
-   Set_Albers_Parameters(theEllipsoid.getA(),
-                         theEllipsoid.getFlattening(),
-                         theOrigin.latr(),
-                         theOrigin.lonr(),
-                         Albers_Std_Parallel_1,
-                         Albers_Std_Parallel_2,
-                         Albers_False_Easting,
-                         Albers_False_Northing);
-   
-   theFalseEastingNorthing.x = Albers_False_Easting;
-   theFalseEastingNorthing.y = Albers_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-
-ossimGpt ossimAlbersProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat, lon;
-   
-   
-   Convert_Albers_To_Geodetic(eastingNorthing.x,
-                              eastingNorthing.y,
-                              &lat,
-                              &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0, theDatum);
-}
-
-ossimDpt ossimAlbersProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-
-   Convert_Geodetic_To_Albers(gpt.latr(),
-                              gpt.lonr(),
-                              &easting,
-                              &northing);
-   
-   return ossimDpt(easting, northing);
-}
-
-void ossimAlbersProjection::setStandardParallel1(double degree)
-{
-   Albers_Std_Parallel_1 = degree*RAD_PER_DEG;
-   update();
-}
-
-void ossimAlbersProjection::setStandardParallel2(double degree)
-{
-   Albers_Std_Parallel_2 = degree*RAD_PER_DEG;
-   update();
-}
-
-void ossimAlbersProjection::setStandardParallels(double parallel1Degree,
-                                                 double parallel2Degree)
-{
-   Albers_Std_Parallel_1 = parallel1Degree*RAD_PER_DEG;
-   Albers_Std_Parallel_2 = parallel2Degree*RAD_PER_DEG;
-   update();
-   
-}
-
-void ossimAlbersProjection::setFalseEasting(double falseEasting)
-{
-   Albers_False_Easting = falseEasting;
-   update();
-}
-
-void ossimAlbersProjection::setFalseNorthing(double falseNorthing)
-{
-   Albers_False_Northing = falseNorthing;
-   update();
-}
-
-void ossimAlbersProjection::setFalseEastingNorthing(double falseEasting,
-                                                    double falseNorthing)
-{
-   Albers_False_Easting = falseEasting;
-   Albers_False_Northing = falseNorthing;  
-   update();
-}
-
-void ossimAlbersProjection::setParameters(double parallel1,
-                                          double parallel2,
-                                          double falseEasting,
-                                          double falseNorthing)
-{
-   Albers_False_Easting = falseEasting;
-   Albers_False_Northing = falseNorthing;  
-   Albers_Std_Parallel_1 = parallel1*RAD_PER_DEG;
-   Albers_Std_Parallel_2 = parallel2*RAD_PER_DEG;
-   update(); 
-}
-
-double ossimAlbersProjection::getStandardParallel1()const
-{
-   return  Albers_Std_Parallel_1/RAD_PER_DEG;
-}
-
-double ossimAlbersProjection::getStandardParallel2()const
-{
-   return  Albers_Std_Parallel_2/RAD_PER_DEG;
-}
-
-void ossimAlbersProjection::setDefaults()
-{
-   // initialize to some default
-   Albers_Std_Parallel_1 = 29.5*RAD_PER_DEG;
-   Albers_Std_Parallel_2 = 45.5*RAD_PER_DEG;
-   Albers_False_Easting  = 0.0;
-   Albers_False_Northing = 0.0;  
-}
-
-bool ossimAlbersProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::STD_PARALLEL_1_KW,
-           Albers_Std_Parallel_1*DEG_PER_RAD,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::STD_PARALLEL_2_KW,
-           Albers_Std_Parallel_2*DEG_PER_RAD,
-           true);
-   
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimAlbersProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   // Must do this first...
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-
-   const char* stdParallel1  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_1_KW);
-   const char* stdParallel2  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_2_KW);
-
-   
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimAlbersProjection))
-   {
-      Albers_False_Easting  = theFalseEastingNorthing.x;
-      Albers_False_Northing = theFalseEastingNorthing.y;
-
-      if(stdParallel1)
-      {
-         Albers_Std_Parallel_1 = ossimString(stdParallel1).toDouble()*RAD_PER_DEG;
-      }
-      else
-      {
-         Albers_Std_Parallel_1 = 29.5*RAD_PER_DEG;         
-      }
-      if(stdParallel2)
-      {
-         Albers_Std_Parallel_2 = ossimString(stdParallel2).toDouble()*RAD_PER_DEG;
-      }
-      else
-      {
-         Albers_Std_Parallel_2 = 45.5*RAD_PER_DEG;
-      }
-   }
-
-   update();
-   
-   return flag;
-}
-
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS
- */
-long ossimAlbersProjection::Set_Albers_Parameters(double a,
-                                                  double f,
-                                                  double Origin_Latitude,
-                                                  double Central_Meridian,
-                                                  double Std_Parallel_1,
-                                                  double Std_Parallel_2,
-                                                  double False_Easting,
-                                                  double False_Northing)
-
-{
-/*
- * The function Set_Albers_Parameters receives the ellipsoid parameters and
- * projection parameters as inputs, and sets the corresponding state
- * variables.  If any errors occur, the error code(s) are returned by the function, 
- * otherwise ALBERS_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid                   (input)
- *    Origin_Latitude   : Latitude in radians at which the          (input)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    Std_Parallel_1    : First standard parallel                   (input)
- *    Std_Parallel_2    : Second standard parallel                  (input)
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (input)
- */
-
-  double sin_lat, sin_lat_1, cos_lat;
-  double m1, m2, SQRm1;
-  double q0, q1, q2;
-  double es_sin, one_MINUS_SQRes_sin;
-  double nq0;
-  double inv_f = 1 / f;
-  long Error_Code = ALBERS_NO_ERROR;
-
-  if (a <= 0.0)
-  { /* Semi-major axis must be greater than zero */
-    Error_Code |= ALBERS_A_ERROR;
-  }
-  if ((inv_f < 250) || (inv_f > 350))
-  { /* Inverse flattening must be between 250 and 350 */
-    Error_Code |= ALBERS_INV_F_ERROR;
-  }
-  if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
-  { /* origin latitude out of range */
-    Error_Code |= ALBERS_ORIGIN_LAT_ERROR;
-  }
-  if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
-  { /* origin longitude out of range */
-    Error_Code |= ALBERS_CENT_MER_ERROR;
-  }
-  if ((Std_Parallel_1 < -PI_OVER_2) || (Std_Parallel_1 > PI_OVER_2))
-  { /* First Standard Parallel out of range */
-    Error_Code |= ALBERS_FIRST_STDP_ERROR;
-  }
-  if ((Std_Parallel_2 < -PI_OVER_2) || (Std_Parallel_2 > PI_OVER_2))
-  { /* Second Standard Parallel out of range */
-    Error_Code |= ALBERS_SECOND_STDP_ERROR;
-  }
-  if ((Std_Parallel_1 == 0.0) && (Std_Parallel_2 == 0.0))
-  { /* First & Second Standard Parallels equal 0 */
-    Error_Code |= ALBERS_FIRST_SECOND_ERROR;
-  }
-  if (Std_Parallel_1 == -Std_Parallel_2)
-  { /* Parallels are opposite latitudes */
-    Error_Code |= ALBERS_HEMISPHERE_ERROR;
-  }
-
-  if (!Error_Code)
-  { /* no errors */
-    Albers_a = a;
-    Albers_f = f;
-    Albers_Origin_Lat = Origin_Latitude;
-    Albers_Std_Parallel_1 = Std_Parallel_1;
-    Albers_Std_Parallel_2 = Std_Parallel_2;
-    if (Central_Meridian > M_PI)
-      Central_Meridian -= TWO_PI;
-    Albers_Origin_Long = Central_Meridian;
-    Albers_False_Easting = False_Easting;
-    Albers_False_Northing = False_Northing;
-
-    es2 = 2 * Albers_f - Albers_f * Albers_f;
-    es = sqrt(es2);
-    one_MINUS_es2 = 1 - es2;
-    two_es = 2 * es;
-
-    sin_lat = sin(Albers_Origin_Lat);
-    es_sin = ES_SIN(sin_lat);
-    one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
-    q0 = ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
-
-    sin_lat_1 = sin(Albers_Std_Parallel_1);
-    cos_lat = cos(Albers_Std_Parallel_1);
-    es_sin = ES_SIN(sin_lat_1);
-    one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
-    m1 = ALBERS_M(cos_lat, one_MINUS_SQRes_sin);
-    q1 = ALBERS_Q(sin_lat_1, one_MINUS_SQRes_sin, es_sin);
-
-    SQRm1 = m1 * m1;
-    if (fabs(Albers_Std_Parallel_1 - Albers_Std_Parallel_2) > 1.0e-10)
-    {
-      sin_lat = sin(Albers_Std_Parallel_2);
-      cos_lat = cos(Albers_Std_Parallel_2);
-      es_sin = ES_SIN(sin_lat);
-      one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
-      m2 = ALBERS_M(cos_lat, one_MINUS_SQRes_sin);
-      q2 = ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
-      n = (SQRm1 - m2 * m2) / (q2 - q1);
-    }
-    else
-      n = sin_lat_1;
-
-    C = SQRm1 + n * q1;
-    Albers_a_OVER_n = Albers_a / n;
-    nq0 = n * q0;
-    if (C < nq0)
-      rho0 = 0;
-    else
-      rho0 = Albers_a_OVER_n * sqrt(C - nq0);
-
-
-  } /* END OF if(!Error_Code) */
-  return (Error_Code);
-} /* END OF Set_Albers_Parameters */
-
-
-void ossimAlbersProjection::Get_Albers_Parameters(double *a,
-                                                  double *f,
-                                                  double *Origin_Latitude,
-                                                  double *Central_Meridian,
-                                                  double *Std_Parallel_1,
-                                                  double *Std_Parallel_2,
-                                                  double *False_Easting,
-                                                  double *False_Northing)const
-
-{ /* BEGIN Get_Albers_Parameters */
-/*
- * The function Get_Albers_Parameters returns the current ellipsoid
- * parameters, and Albers projection parameters.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid										(output)
- *    Origin_Latitude   : Latitude in radians at which the          (output)
- *                          point scale factor is 1.0
- *    Origin_Longitude  : Longitude in radians at the center of     (output)
- *                          the projection
- *    Std_Parallel_1    : First standard parallel                   (output)
- *    Std_Parallel_2    : Second standard parallel                  (output)
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (output)
- */
-
-  *a = Albers_a;
-  *f = Albers_f;
-  *Origin_Latitude = Albers_Origin_Lat;
-  *Std_Parallel_1 = Albers_Std_Parallel_1;
-  *Std_Parallel_2 = Albers_Std_Parallel_2;
-  *Central_Meridian = Albers_Origin_Long;
-  *False_Easting = Albers_False_Easting;
-  *False_Northing = Albers_False_Northing;
-  return;
-} /* END OF Get_Albers_Parameters */
-
-
-long ossimAlbersProjection::Convert_Geodetic_To_Albers (double Latitude,
-                                                        double Longitude,
-                                                        double *Easting,
-                                                        double *Northing)const
-
-{ /* BEGIN Convert_Geodetic_To_Albers */
-/*
- * The function Convert_Geodetic_To_Albers converts geodetic (latitude and
- * longitude) coordinates to Albers projection (easting and northing)
- * coordinates, according to the current ellipsoid and Albers projection
- * parameters.  If any errors occur, the error code(s) are returned by the
- * function, otherwise ALBERS_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double dlam;                      /* Longitude - Central Meridan */
-  double sin_lat;
-  // double cos_lat;
-  double es_sin, one_MINUS_SQRes_sin;
-  double q;
-  double rho;
-  double theta;
-  double nq;
-  long Error_Code = ALBERS_NO_ERROR;
-
-  if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-  {  /* Latitude out of range */
-    Error_Code |= ALBERS_LAT_ERROR;
-  }
-  if ((Longitude < -M_PI) || (Longitude > TWO_PI))
-  {  /* Longitude out of range */
-    Error_Code|= ALBERS_LON_ERROR;
-  }
-
-  if (!Error_Code)
-  { /* no errors */
-
-    dlam = Longitude - Albers_Origin_Long;
-    if (dlam > M_PI)
-    {
-      dlam -= TWO_PI;
-    }
-    if (dlam < -M_PI)
-    {
-      dlam += TWO_PI;
-    }
-    sin_lat = sin(Latitude);
-    // cos_lat = cos(Latitude);
-    es_sin = ES_SIN(sin_lat);
-    one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
-    q = ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
-    nq = n * q;
-    if (C < nq)
-      rho = 0;
-    else
-      rho = Albers_a_OVER_n * sqrt(C - nq);
-
-
-    theta = n * dlam;
-    *Easting = rho * sin(theta) + Albers_False_Easting;
-    *Northing = rho0 - rho * cos(theta) + Albers_False_Northing;
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Albers */
-
-
-long ossimAlbersProjection::Convert_Albers_To_Geodetic(double Easting,
-                                                       double Northing,
-                                                       double *Latitude,
-                                                       double *Longitude)const
-{ /* BEGIN Convert_Albers_To_Geodetic */
-/*
- * The function Convert_Albers_To_Geodetic converts Albers projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid and Albers projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise ALBERS_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double dy, dx;
-  double rho0_MINUS_dy;
-  double q, qconst, q_OVER_2;
-  double rho, rho_n;
-  double PHI, Delta_PHI = 1.0;
-  double sin_phi;
-  double es_sin, one_MINUS_SQRes_sin;
-  double theta = 0.0;
-  double tolerance = 4.85e-10;        /* approximately 1/1000th of
-                              an arc second or 1/10th meter */
-  long Error_Code = ALBERS_NO_ERROR; 
-
-  if ((Easting < (Albers_False_Easting - Albers_Delta_Easting)) 
-      || (Easting > Albers_False_Easting + Albers_Delta_Easting))
-  { /* Easting out of range  */
-    Error_Code |= ALBERS_EASTING_ERROR;
-  }
-  if ((Northing < (Albers_False_Northing - Albers_Delta_Northing)) 
-      || (Northing > Albers_False_Northing + Albers_Delta_Northing))
-  { /* Northing out of range */
-    Error_Code |= ALBERS_NORTHING_ERROR;
-  }
-
-  if (!Error_Code)
-  {
-    dy = Northing - Albers_False_Northing;
-    dx = Easting - Albers_False_Easting;
-    rho0_MINUS_dy = rho0 - dy;
-    rho = sqrt(dx * dx + rho0_MINUS_dy * rho0_MINUS_dy);
-
-    if (n < 0)
-    {
-      rho *= -1.0;
-      dy *= -1.0;
-      dx *= -1.0;
-      rho0_MINUS_dy *= -1.0;
-    }
-
-    if (rho != 0.0)
-      theta = atan2(dx, rho0_MINUS_dy);
-    rho_n = rho * n;
-    q = (C - (rho_n * rho_n) / (Albers_a * Albers_a)) / n;
-    qconst = 1 - ((one_MINUS_es2) / (two_es)) * log((1.0 - es) / (1.0 + es));
-    if (fabs(fabs(qconst) - fabs(q)) > 1.0e-6)
-    {
-      q_OVER_2 = q / 2.0;
-      if (q_OVER_2 > 1.0)
-        *Latitude = PI_OVER_2;
-      else if (q_OVER_2 < -1.0)
-        *Latitude = -PI_OVER_2;
-      else
-      {
-        PHI = asin(q_OVER_2);
-        if (es < 1.0e-10)
-          *Latitude = PHI;
-        else
-        {
-          while (fabs(Delta_PHI) > tolerance)
-          {
-            sin_phi = sin(PHI);
-            es_sin = ES_SIN(sin_phi);
-            one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
-            Delta_PHI = (one_MINUS_SQRes_sin * one_MINUS_SQRes_sin) / (2.0 * cos(PHI)) *
-                        (q / (one_MINUS_es2) - sin_phi / one_MINUS_SQRes_sin +
-                         (log((1.0 - es_sin) / (1.0 + es_sin)) / (two_es)));
-            PHI += Delta_PHI;
-          }
-          *Latitude = PHI;
-        }
-
-        if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-          *Latitude = PI_OVER_2;
-        else if (*Latitude < -PI_OVER_2)
-          *Latitude = -PI_OVER_2;
-
-      }
-    }
-    else
-    {
-      if (q >= 0.0)
-        *Latitude = PI_OVER_2;
-      else
-        *Latitude = -PI_OVER_2;
-    }
-    *Longitude = Albers_Origin_Long + theta / n;
-
-    if (*Longitude > M_PI)
-      *Longitude -= TWO_PI;
-    if (*Longitude < -M_PI)
-      *Longitude += TWO_PI;
-
-    if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
-      *Longitude = M_PI;
-    else if (*Longitude < -M_PI)
-      *Longitude = -M_PI;
-
-  }
-  return (Error_Code);
-} /* END OF Convert_Albers_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimAlbersProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj)) return false;
-
-   ossimAlbersProjection* p = PTR_CAST(ossimAlbersProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(Albers_Std_Parallel_1,p->Albers_Std_Parallel_1)) return false;
-   if (!ossim::almostEqual(Albers_Std_Parallel_2,p->Albers_Std_Parallel_2)) return false;
-   if (!ossim::almostEqual(Albers_Delta_Northing,p->Albers_Delta_Northing)) return false;
-   if (!ossim::almostEqual(Albers_Delta_Easting, p->Albers_Delta_Easting) ) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimApplanixEcefModel.cpp b/ossim/src/ossim/projection/ossimApplanixEcefModel.cpp
deleted file mode 100644
index 794cca2..0000000
--- a/ossim/src/ossim/projection/ossimApplanixEcefModel.cpp
+++ /dev/null
@@ -1,806 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimApplanixEcefModel.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <sstream>
-#include <ossim/projection/ossimApplanixEcefModel.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/base/ossimDatumFactory.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimLsrSpace.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/support_data/ossimApplanixEOFile.h>
-#include <ossim/base/ossimMatrix4x4.h>
-#include <ossim/elevation/ossimElevManager.h>
-static ossimTrace traceDebug("ossimApplanixEcefModel:debug");
-
-RTTI_DEF1(ossimApplanixEcefModel, "ossimApplanixEcefModel", ossimSensorModel);
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimApplanixEcefModel.cpp 23664 2015-12-14 14:17:27Z dburken $";
-#endif
-
-ossimApplanixEcefModel::ossimApplanixEcefModel()
-{
-   theCompositeMatrix          = ossimMatrix4x4::createIdentity();
-   theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
-   theRoll                     = 0.0;
-   thePitch                    = 0.0;
-   theHeading                  = 0.0;
-   theFocalLength              = 55.0;
-   thePixelSize = ossimDpt(.009, .009);
-   theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
-   theAdjEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
-   theGSD.x = 0.1524;
-   theGSD.y = 0.1524;
-   theMeanGSD = 0.1524;
-   theLensDistortion = new ossimMeanRadialLensDistortion;
-   initAdjustableParameters();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
-#endif
-   }
-}
-ossimApplanixEcefModel::ossimApplanixEcefModel(const ossimDrect& imageRect,
-                                               const ossimGpt& platformPosition,
-                                               double roll,
-                                               double pitch,
-                                               double heading,
-                                               const ossimDpt& /* principalPoint */, // in millimeters
-                                               double focalLength, // in millimeters
-                                               const ossimDpt& pixelSize) // in millimeters
-{
-   theImageClipRect = imageRect;
-   theRefImgPt      = theImageClipRect.midPoint();
-   theCompositeMatrix          = ossimMatrix4x4::createIdentity();
-   theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
-   theRoll                     = roll;
-   thePitch                    = pitch;
-   theHeading                  = heading;
-   theFocalLength              = focalLength;
-   thePixelSize                = pixelSize;
-   theEcefPlatformPosition     = platformPosition;
-   theAdjEcefPlatformPosition  = platformPosition;
-   theLensDistortion           = new ossimMeanRadialLensDistortion;
-   initAdjustableParameters();
-   updateModel();
-
-   try
-   {
-      // Method throws ossimException.
-      computeGsd();
-   }
-   catch (const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimApplanixEcefModel Constructor caught Exception:\n"
-         << e.what() << std::endl;
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
-#endif
-   }
-}
-
-ossimApplanixEcefModel::ossimApplanixEcefModel(const ossimApplanixEcefModel& src)
-   :ossimSensorModel(src)
-{
-   initAdjustableParameters();
-   
-   if(src.theLensDistortion.valid())
-   {
-      theLensDistortion = new ossimMeanRadialLensDistortion(*(src.theLensDistortion.get()));
-   }
-   else
-   {
-      theLensDistortion = new ossimMeanRadialLensDistortion();
-   }
-}
-
-ossimObject* ossimApplanixEcefModel::dup()const
-{
-   return new ossimApplanixEcefModel(*this);
-}
-
-void ossimApplanixEcefModel::imagingRay(const ossimDpt& image_point,
-                                    ossimEcefRay&   image_ray) const
-{
-//    if(traceDebug())
-//    {
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... entered" << std::endl;
-//    }
-    ossimDpt f1 ((image_point) - theRefImgPt);
-   f1.x *= thePixelSize.x;
-   f1.y *= -thePixelSize.y;
-   ossimDpt film (f1 - thePrincipalPoint);
-//    if(traceDebug())
-//    {
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size   = " << thePixelSize << std::endl;
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "film pt      = " << film << std::endl;
-//    }
-   if (theLensDistortion.valid())
-   {
-      ossimDpt filmOut;
-      theLensDistortion->undistort(film, filmOut);
-      film = filmOut;
-   }
-   
-   ossimColumnVector3d cam_ray_dir (film.x,
-                                    film.y,
-                                    -theFocalLength);
-   ossimEcefVector     ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
-   ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
-  
-   image_ray.setOrigin(theAdjEcefPlatformPosition);
-   image_ray.setDirection(ecf_ray_dir);
-
-//    if(traceDebug())
-//    {
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... leaving" << std::endl;
-//    }
-}
-
-void ossimApplanixEcefModel::lineSampleToWorld(const ossimDpt& image_point,
-                                               ossimGpt&       gpt) const
-{
-   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimApplanixEcefModel::lineSampleToWorld:entering..." << std::endl;
-   
-   if(image_point.hasNans())
-   {
-      gpt.makeNan();
-      return;
-   }
-   //***
-   // Extrapolate if image point is outside image:
-   //***
-//   if (!insideImage(image_point))
-//   {
-//      gpt.makeNan();
-//       gpt = extrapolate(image_point);
-//      return;
-//   }
-
-   //***
-   // Determine imaging ray and invoke elevation source object's services to
-   // intersect ray with terrain model:
-   //***
-   ossimEcefRay ray;
-   imagingRay(image_point, ray);
-   ossimElevManager::instance()->intersectRay(ray, gpt);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
-   }
-
-   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
-   return;
-}
-
-void ossimApplanixEcefModel::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                                 const double&   heightEllipsoid,
-                                                 ossimGpt&       worldPoint) const
-{
-//  if (!insideImage(image_point))
-//   {
-//      worldPoint.makeNan();
-//       worldPoint = extrapolate(image_point, heightEllipsoid);
-//   }
-//   else
-   {
-      //***
-      // First establish imaging ray from image point:
-      //***
-      ossimEcefRay ray;
-      imagingRay(image_point, ray);
-      ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
-      worldPoint = ossimGpt(Pecf);
-   }
-}
-
-void ossimApplanixEcefModel::worldToLineSample(const ossimGpt& world_point,
-                                           ossimDpt&       image_point) const
-{
-   #if 0
-   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
-      (!theBoundGndPolygon.hasNans()))
-   {
-      if (!(theBoundGndPolygon.pointWithin(world_point)))
-      {
-//         image_point.makeNan();
-//          image_point = extrapolate(world_point);
-//         return;
-      }         
-   }
-   #endif
-   ossimEcefPoint g_ecf(world_point);
-   ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
-   ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
-   
-      
-   double scale = -theFocalLength/camRayDir[2];
-   ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
-      
-   if (theLensDistortion.valid())
-   {
-      ossimDpt filmOut;
-      theLensDistortion->distort(film, filmOut);
-      film = filmOut;
-    }
-   
-     ossimDpt f1(film + thePrincipalPoint);
-    ossimDpt p1(f1.x/thePixelSize.x,
-                -f1.y/thePixelSize.y);
-
-    ossimDpt p0 (p1.x + theRefImgPt.x,
-                 p1.y + theRefImgPt.y);
-    
-    image_point = p0;
-}
-
-void ossimApplanixEcefModel::updateModel()
-{
-   ossimGpt gpt;
-   ossimGpt wgs84Pt;
-   double metersPerDegree = wgs84Pt.metersPerDegree().x;
-   double degreePerMeter = 1.0/metersPerDegree;
-   double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter;
-   double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;
-
-   gpt = theEcefPlatformPosition;
-   double height = gpt.height();
-   gpt.height(height + computeParameterOffset(5));
-   gpt.latd(gpt.latd() + latShift);
-   gpt.lond(gpt.lond() + lonShift);
-   theAdjEcefPlatformPosition = gpt;
-   ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4));
-
-   // make a left handed roational matrix;
-   ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
-   NEWMAT::Matrix orientation = (ossimMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), OSSIM_LEFT_HANDED)*
-                                 ossimMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), OSSIM_LEFT_HANDED));
-   theCompositeMatrix        = (lsrMatrix.getData()*orientation);
-   theCompositeMatrixInverse = theCompositeMatrix.i();
-
-   theBoundGndPolygon.resize(4);
-   // ossim_float64 w = theImageClipRect.width()*2.0;
-   // ossim_float64 h = theImageClipRect.height()*2.0;
-   theExtrapolateImageFlag = false;
-   theExtrapolateGroundFlag = false;
-
-   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
-   theBoundGndPolygon[0] = gpt;
-   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
-   theBoundGndPolygon[1] = gpt;
-   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
-   theBoundGndPolygon[2] = gpt;
-   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
-   theBoundGndPolygon[3] = gpt;
-}
-
-void ossimApplanixEcefModel::initAdjustableParameters()
-{
-   
-   resizeAdjustableParameterArray(6);
-   
-   setAdjustableParameter(0, 0.0);
-   setParameterDescription(0, "x_offset");
-   setParameterUnit(0, "pixels");
-
-   setAdjustableParameter(1, 0.0);
-   setParameterDescription(1, "y_offset");
-   setParameterUnit(1, "pixels");
-
-   setAdjustableParameter(2, 0.0);
-   setParameterDescription(2, "roll");
-   setParameterUnit(2, "degrees");
-
-   setAdjustableParameter(3, 0.0);
-   setParameterDescription(3, "pitch");
-   setParameterUnit(3, "degrees");
-
-   setAdjustableParameter(4, 0.0);
-   setParameterDescription(4, "heading");
-   setParameterUnit(4, "degrees");
-
-   setAdjustableParameter(5, 0.0);
-   setParameterDescription(5, "altitude");
-   setParameterUnit(5, "meters");
-   
-   
-   setParameterSigma(0, 20.0);
-   setParameterSigma(1, 20.0);
-   setParameterSigma(2, .1);
-   setParameterSigma(3, .1);
-   setParameterSigma(4, .1);
-   setParameterSigma(5, 50);
-}
-
-void ossimApplanixEcefModel::setPrincipalPoint(ossimDpt principalPoint)
-{
-   thePrincipalPoint = principalPoint;
-}
-
-void ossimApplanixEcefModel::setRollPitchHeading(double roll,
-                                                 double pitch,
-                                                 double heading)
-{
-   theRoll    = roll;
-   thePitch   = pitch;
-   theHeading = heading;
-   
-   updateModel();
-}
-
-void ossimApplanixEcefModel::setPixelSize(const ossimDpt& pixelSize)
-{
-   thePixelSize = pixelSize;
-}
-
-void ossimApplanixEcefModel::setImageRect(const ossimDrect& rect)
-{
-   theImageClipRect = rect;
-   theRefImgPt = rect.midPoint();
-}
-
-void ossimApplanixEcefModel::setFocalLength(double focalLength)
-{
-   theFocalLength = focalLength;
-}
-
-void ossimApplanixEcefModel::setPlatformPosition(const ossimGpt& gpt)
-{
-   theRefGndPt            = gpt;
-   theEcefPlatformPosition = gpt;
-   updateModel();
-   
-}
-
-bool ossimApplanixEcefModel::saveState(ossimKeywordlist& kwl,
-                                   const char* prefix) const
-{
-   ossimSensorModel::saveState(kwl, prefix);
-   
-   kwl.add(prefix, "type", "ossimApplanixEcefModel", true);
-
-   kwl.add(prefix, "roll", theRoll, true);
-   kwl.add(prefix, "pitch", thePitch, true);
-   kwl.add(prefix, "heading", theHeading, true);
-   kwl.add(prefix, "principal_point", ossimString::toString(thePrincipalPoint.x) + " " + ossimString::toString(thePrincipalPoint.y));
-   kwl.add(prefix, "pixel_size",      ossimString::toString(thePixelSize.x) + " " + ossimString::toString(thePixelSize.y));
-   kwl.add(prefix, "focal_length", theFocalLength);
-   kwl.add(prefix, "ecef_platform_position",
-           ossimString::toString(theEcefPlatformPosition.x()) + " " +
-           ossimString::toString(theEcefPlatformPosition.y()) + " " +
-           ossimString::toString(theEcefPlatformPosition.z()));
-
-   if(theLensDistortion.valid())
-   {
-      ossimString lensPrefix = ossimString(prefix)+"distortion.";
-      theLensDistortion->saveState(kwl,
-                                   lensPrefix.c_str());
-   }
-   
-   return true;
-}
-
-bool ossimApplanixEcefModel::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   if(traceDebug())
-   {
-      std::cout << "ossimApplanixEcefModel::loadState: ......... entered" << std::endl;
-   }
-
-   theImageClipRect = ossimDrect(0,0,4076,4091);
-   theRefImgPt      = ossimDpt(2046.0, 2038.5);
-
-   ossimSensorModel::loadState(kwl, prefix);
-   if(getNumberOfAdjustableParameters() < 1)
-   {
-      initAdjustableParameters();
-   }
-   theEcefPlatformPosition    = ossimGpt(0.0,0.0,1000.0);
-   theAdjEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
-   theRoll    = 0.0;
-   thePitch   = 0.0;
-   theHeading = 0.0;
-   // bool computeGsdFlag = false;
-   const char* roll              = kwl.find(prefix, "roll");
-   const char* pitch             = kwl.find(prefix, "pitch");
-   const char* heading           = kwl.find(prefix, "heading");
-   const char* principal_point   = kwl.find(prefix, "principal_point");
-   const char* pixel_size        = kwl.find(prefix, "pixel_size");
-   const char* focal_length      = kwl.find(prefix, "focal_length");
-   const char* ecef_platform_position = kwl.find(prefix, "ecef_platform_position");
-   const char* latlonh_platform_position = kwl.find(prefix, "latlonh_platform_position");
-   const char* compute_gsd_flag  = kwl.find(prefix, "compute_gsd_flag");
-   const char* eo_file           = kwl.find(prefix, "eo_file");
-   const char* camera_file       = kwl.find(prefix, "camera_file");
-   const char* eo_id             = kwl.find(prefix, "eo_id");
-   bool result = true;
-   if(eo_id)
-   {
-      theImageID = eo_id;
-   }
-   if(eo_file)
-   {
-      ossimApplanixEOFile eoFile;
-      if(eoFile.parseFile(ossimFilename(eo_file)))
-      {
-         ossimRefPtr<ossimApplanixEORecord> record = eoFile.getRecordGivenId(theImageID);
-         if(record.valid())
-         {
-            ossim_int32 rollIdx    = eoFile.getFieldIdx("ROLL");
-            ossim_int32 pitchIdx   = eoFile.getFieldIdx("PITCH");
-            ossim_int32 headingIdx = eoFile.getFieldIdx("HEADING");
-            ossim_int32 xIdx       = eoFile.getFieldIdx("X");
-            ossim_int32 yIdx       = eoFile.getFieldIdx("Y");
-            ossim_int32 zIdx       = eoFile.getFieldIdx("Z");
-
-            if((rollIdx >= 0)&&
-               (pitchIdx >= 0)&&
-               (headingIdx >= 0)&&
-               (xIdx >= 0)&&
-               (yIdx >= 0)&&
-               (zIdx >= 0))
-            {
-               theRoll    = (*record)[rollIdx].toDouble();
-               thePitch   = (*record)[pitchIdx].toDouble();
-               theHeading = (*record)[headingIdx].toDouble();
-               theEcefPlatformPosition = ossimEcefPoint((*record)[xIdx].toDouble(),
-                                                        (*record)[yIdx].toDouble(),
-                                                        (*record)[zIdx].toDouble());
-               theAdjEcefPlatformPosition = theEcefPlatformPosition;
-            }
-            else
-            {
-               return false;
-            }
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "ossimApplanixEcefModel::loadState()  Image id " << theImageID << " not found in eo file " << eo_file << std::endl;
-            
-            return false;
-         }
-      }
-      else
-      {
-         return false;
-      }
-      // computeGsdFlag = true;
-   }
-   else
-   {
-      if(roll)
-      {
-         theRoll = ossimString(roll).toDouble();
-      }
-      if(pitch)
-      {
-         thePitch = ossimString(pitch).toDouble();
-      }
-      if(heading)
-      {
-         theHeading = ossimString(heading).toDouble();
-      }
-      if(ecef_platform_position)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(ecef_platform_position);
-         tempString.split(splitString, ossimString(" "));
-         if(splitString.size() > 2)
-         {
-            theEcefPlatformPosition  = ossimEcefPoint(splitString[0].toDouble(),
-                                                      splitString[1].toDouble(),
-                                                      splitString[2].toDouble());
-         }
-      }
-      else if(latlonh_platform_position)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(latlonh_platform_position);
-         tempString.split(splitString, ossimString(" "));
-         std::string datumString;
-         double lat=0.0, lon=0.0, h=0.0;
-         if(splitString.size() > 2)
-         {
-            lat = splitString[0].toDouble();
-            lon = splitString[1].toDouble();
-            h = splitString[2].toDouble();
-         }
-         
-         theEcefPlatformPosition = ossimGpt(lat,lon,h);
-      }
-   }
-
-   if(camera_file)
-   {
-      ossimKeywordlist cameraKwl;
-      ossimKeywordlist lensKwl;
-      cameraKwl.add(camera_file);
-      const char* sensor = cameraKwl.find("sensor");
-      const char* image_size      = cameraKwl.find(prefix, "image_size");
-      principal_point = cameraKwl.find("principal_point");
-      focal_length    = cameraKwl.find("focal_length");
-      pixel_size      = cameraKwl.find(prefix, "pixel_size");
-      focal_length    = cameraKwl.find(prefix, "focal_length");
-      const char* distortion_units = cameraKwl.find(prefix, "distortion_units");
-      ossimUnitConversionTool tool;
-      ossimUnitType unitType = OSSIM_MILLIMETERS;
-
-      if(distortion_units)
-      {
-         unitType = (ossimUnitType)ossimUnitTypeLut::instance()->getEntryNumber(distortion_units);
-
-         if(unitType == OSSIM_UNIT_UNKNOWN)
-         {
-            unitType = OSSIM_MILLIMETERS;
-         }
-      }
-      if(image_size)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(image_size);
-         tempString.split(splitString, ossimString(" "));
-         double w=1, h=1;
-         if(splitString.size() == 2)
-         {
-            w = splitString[0].toDouble();
-            h = splitString[1].toDouble();
-         }
-         theImageClipRect = ossimDrect(0,0,w-1,h-1);
-         theRefImgPt      = ossimDpt(w/2.0, h/2.0);
-         theImageSize     = ossimDpt(w,h);
-      }
-      if(sensor)
-      {
-         theSensorID = sensor;
-      }
-      if(principal_point)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(principal_point);
-         tempString.split(splitString, ossimString(" "));
-         if(splitString.size() == 2)
-         {
-            thePrincipalPoint.x = splitString[0].toDouble();
-            thePrincipalPoint.y = splitString[1].toDouble();
-         }
-      }
-      if(pixel_size)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(pixel_size);
-         tempString.split(splitString, ossimString(" "));
-         if(splitString.size() == 1)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = thePixelSize.x;
-         }
-         else if(splitString.size() == 2)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = splitString[1].toDouble();
-         }
-      }
-      if(focal_length)
-      {
-         theFocalLength = ossimString(focal_length).toDouble();
-      }
-
-      cameraKwl.trimAllValues();
-      
-      
-      ossimString regExpression =  ossimString("^(") + "d[0-9]+)";
-      vector<ossimString> keys;
-      cameraKwl.getSubstringKeyList( keys, regExpression );
-      long numberOfDistortions = (long)keys.size();
-      int offset = (int)ossimString("d").size();
-      ossim_uint32 idx = 0;
-      std::vector<int> numberList(numberOfDistortions);
-      for(idx = 0; idx < numberList.size();++idx)
-      {
-         ossimString numberStr(keys[idx].begin() + offset,
-                               keys[idx].end());
-         numberList[idx] = numberStr.toInt();
-      }
-      std::sort(numberList.begin(), numberList.end());
-      double distance=0.0, distortion=0.0;
-
-      for(idx = 0; idx < numberList.size(); ++idx)
-      {
-         ossimString value = cameraKwl.find(ossimString("d")+ossimString::toString(numberList[idx]));
-
-         if(!value.empty())
-         {
-            std::istringstream inStr(value.c_str());
-            inStr >> distance;
-            ossim::skipws(inStr);
-            inStr >> distortion;
-#if 0
-            std::vector<ossimString> splitString;
-            ossimString tempString(value);
-            tempString = tempString.trim();
-            tempString.split(splitString, " ");
-            std::cout << splitString.size() << std::endl;
-            if(splitString.size() >= 2)
-            {
-               distance = splitString[0].toDouble();
-               distortion = splitString[1].toDouble();
-            }
-#endif
-            
-            tool.setValue(distortion, unitType);
-            lensKwl.add(ossimString("distance") + ossimString::toString(idx),
-                        distance,
-                        true);
-            lensKwl.add(ossimString("distortion") + ossimString::toString(idx),
-                        tool.getMillimeters(),
-                        true);
-         }
-         lensKwl.add("convergence_threshold",
-                     .00001,
-                     true);
-         if(pixel_size)
-         {
-            lensKwl.add("dxdy",
-                        ossimString(pixel_size) + " " + ossimString(pixel_size),
-                        true);
-         }
-         else
-         {
-            lensKwl.add("dxdy",
-                        ".009 .009",
-                        true);
-         }
-      }
-      if(theLensDistortion.valid())
-      {
-         theLensDistortion->loadState(lensKwl,"");
-      }
-   }
-   else
-   {
-      
-      if(principal_point)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(principal_point);
-         tempString.split(splitString, ossimString(" "));
-         if(splitString.size() == 2)
-         {
-            thePrincipalPoint.x = splitString[0].toDouble();
-            thePrincipalPoint.y = splitString[1].toDouble();
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "No principal_point found" << std::endl;
-            result = false;
-         }
-      }
-      if(pixel_size)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(pixel_size);
-         tempString.split(splitString, ossimString(" "));
-         if(splitString.size() == 1)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = thePixelSize.x;
-         }
-         else if(splitString.size() == 2)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = splitString[1].toDouble();
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "No pixel size found" << std::endl;
-            result = false;
-         }
-      }
-      if(focal_length)
-      {
-         theFocalLength = ossimString(focal_length).toDouble();
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "No focal length found" << std::endl;
-            result = false;
-         }
-      }
-      
-      if(theLensDistortion.valid())
-      {
-         ossimString lensPrefix = ossimString(prefix)+"distortion.";
-         if(!theLensDistortion->loadState(kwl,
-                                          lensPrefix.c_str()))
-         {
-            result = false;
-         }
-      }
-   }
-   theRefGndPt = theEcefPlatformPosition;
-   theRefGndPt.height(0.0);
-
-   updateModel();
-
-   if(compute_gsd_flag)
-   {
-      if(ossimString(compute_gsd_flag).toBool())
-      {
-         try
-         {
-            //---
-            // This will set theGSD and theMeanGSD. Method throws
-            // ossimException.
-            //---
-            computeGsd();
-         }
-         catch (const ossimException& e)
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimApplanixEcefModel::loadState Caught Exception:\n"
-               << e.what() << std::endl;
-         }
-      }
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << std::setprecision(15) << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "roll:     " << theRoll << std::endl
-                                          << "pitch:    " << thePitch << std::endl
-                                          << "heading:  " << theHeading << std::endl
-                                          << "platform: " << theEcefPlatformPosition << std::endl
-                                          << "latlon Platform: " << ossimGpt(theEcefPlatformPosition) << std::endl
-                                          << "focal len: " << theFocalLength << std::endl
-                                          << "principal: " << thePrincipalPoint << std::endl
-                                          << "Ground:    " << ossimGpt(theEcefPlatformPosition) << std::endl;
-   }
-
-   return result;
-}
-
-bool ossimApplanixEcefModel::setupOptimizer(const ossimString& init_file)
-{
-   ossimKeywordlist kwl;
-   kwl.addFile(init_file.c_str());
-
-   return loadState(kwl);
-}
-
diff --git a/ossim/src/ossim/projection/ossimApplanixUtmModel.cpp b/ossim/src/ossim/projection/ossimApplanixUtmModel.cpp
deleted file mode 100644
index e5116c2..0000000
--- a/ossim/src/ossim/projection/ossimApplanixUtmModel.cpp
+++ /dev/null
@@ -1,979 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// MIT
-// 
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimApplanixUtmModel.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <sstream>
-#include <ossim/projection/ossimApplanixUtmModel.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/base/ossimDatumFactory.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimLsrSpace.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/support_data/ossimApplanixEOFile.h>
-#include <ossim/base/ossimMatrix4x4.h>
-#include <ossim/elevation/ossimElevManager.h>
-static ossimTrace traceDebug("ossimApplanixUtmModel:debug");
-
-RTTI_DEF1(ossimApplanixUtmModel, "ossimApplanixUtmModel", ossimSensorModel);
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimApplanixUtmModel.cpp 23666 2015-12-14 20:01:22Z rashadkm $";
-#endif
-
-ossimApplanixUtmModel::ossimApplanixUtmModel()
-   :theOmega(0.0),
-    thePhi(0.0),
-    theKappa(0.0),
-    theBoreSightTx(0.0),
-    theBoreSightTy(0.0),
-    theBoreSightTz(0.0)
-{
-   theCompositeMatrix          = ossimMatrix4x4::createIdentity();
-   theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
-   theFocalLength              = 55.0;
-   thePixelSize = ossimDpt(.009, .009);
-   theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
-   theGSD.x = 0.1524;
-   theGSD.y = 0.1524;
-   theMeanGSD = 0.1524;
-   theLensDistortion = new ossimMeanRadialLensDistortion;
-   initAdjustableParameters();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimApplanixUtmModel::ossimApplanixUtmModel DEBUG:" << endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
-#endif
-   }
-}
-
-ossimApplanixUtmModel::ossimApplanixUtmModel(const ossimApplanixUtmModel& src)
-   :ossimSensorModel(src),
-    theCompositeMatrix(src.theCompositeMatrix),
-    theCompositeMatrixInverse(src.theCompositeMatrixInverse),
-    theOmega(src.theOmega),
-    thePhi(src.thePhi),
-    theKappa(src.theKappa),
-    theBoreSightTx(src.theBoreSightTx),
-    theBoreSightTy(src.theBoreSightTy),
-    theBoreSightTz(src.theBoreSightTz),
-    thePrincipalPoint(src.thePrincipalPoint),
-    thePixelSize(src.thePixelSize),
-    theFocalLength(src.theFocalLength),
-    theEcefPlatformPosition(src.theEcefPlatformPosition),
-    thePlatformPosition(src.thePlatformPosition),
-    theUtmZone(src.theUtmZone),
-    theUtmHemisphere(src.theUtmHemisphere),
-    theUtmPlatformPosition(src.theUtmPlatformPosition)
-{
-   if(src.theLensDistortion.valid())
-   {
-      theLensDistortion = new ossimMeanRadialLensDistortion(*(src.theLensDistortion.get()));
-   }
-   else
-   {
-      theLensDistortion = new ossimMeanRadialLensDistortion();
-   }
-}
-
-ossimObject* ossimApplanixUtmModel::dup()const
-{
-   return new ossimApplanixUtmModel(*this);
-}
-
-void ossimApplanixUtmModel::imagingRay(const ossimDpt& image_point,
-                                    ossimEcefRay&   image_ray) const
-{
-//    if(traceDebug())
-//    {
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixUtmModel::imagingRay: ..... entered" << std::endl;
-//    }
-    ossimDpt f1 ((image_point) - theRefImgPt);
-   f1.x *= thePixelSize.x;
-   f1.y *= -thePixelSize.y;
-   ossimDpt film (f1 - thePrincipalPoint);
-//    if(traceDebug())
-//    {
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size   = " << thePixelSize << std::endl;
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "film pt      = " << film << std::endl;
-//    }
-   if (theLensDistortion.valid())
-   {
-      ossimDpt filmOut;
-      theLensDistortion->undistort(film, filmOut);
-      film = filmOut;
-   }
-   
-   ossimColumnVector3d cam_ray_dir (film.x,
-                                    film.y,
-                                    -theFocalLength);
-   ossimEcefVector     ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
-   ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
-   
-   image_ray.setOrigin(theAdjEcefPlatformPosition);
-   image_ray.setDirection(ecf_ray_dir);
-   
-//    if(traceDebug())
-//    {
-//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixUtmModel::imagingRay: ..... leaving" << std::endl;
-//    }
-}
-
-void ossimApplanixUtmModel::lineSampleToWorld(const ossimDpt& image_point,
-                                               ossimGpt&       gpt) const
-{
-   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimApplanixEcefModel::lineSampleToWorld:entering..." << std::endl;
-   
-   if(image_point.hasNans())
-   {
-      gpt.makeNan();
-      return;
-   }
-   //***
-   // Extrapolate if image point is outside image:
-   //***
-  // if (!insideImage(image_point))
-  // {
-   //   gpt.makeNan();
-//       gpt = extrapolate(image_point);
-   //   return;
-   //}
-
-   //***
-   // Determine imaging ray and invoke elevation source object's services to
-   // intersect ray with terrain model:
-   //***
-   ossimEcefRay ray;
-   imagingRay(image_point, ray);
-   ossimElevManager::instance()->intersectRay(ray, gpt);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
-   }
-
-   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
-   return;
-}
-
-void ossimApplanixUtmModel::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                                 const double&   heightEllipsoid,
-                                                 ossimGpt&       worldPoint) const
-{
-//   if (!insideImage(image_point))
-//   {
-      //worldPoint.makeNan();
-//       worldPoint = extrapolate(image_point, heightEllipsoid);
-//   }
-//   else
-   {
-      //***
-      // First establish imaging ray from image point:
-      //***
-      ossimEcefRay ray;
-      imagingRay(image_point, ray);
-      ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
-      worldPoint = ossimGpt(Pecf);
-   }
-}
-
-void ossimApplanixUtmModel::worldToLineSample(const ossimGpt& world_point,
-                                           ossimDpt&       image_point) const
-{
-#if 0
-   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
-      (!theBoundGndPolygon.hasNans()))
-   {
-      if (!(theBoundGndPolygon.pointWithin(world_point)))
-      {
-         image_point.makeNan();
-//          image_point = extrapolate(world_point);
-         return;
-      }         
-   }
-#endif
-   ossimEcefPoint g_ecf(world_point);
-   ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
-   ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
-   
-      
-   double scale = -theFocalLength/camRayDir[2];
-   ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
-      
-   if (theLensDistortion.valid())
-   {
-      ossimDpt filmOut;
-      theLensDistortion->distort(film, filmOut);
-      film = filmOut;
-    }
-   
-     ossimDpt f1(film + thePrincipalPoint);
-    ossimDpt p1(f1.x/thePixelSize.x,
-                -f1.y/thePixelSize.y);
-
-    ossimDpt p0 (p1.x + theRefImgPt.x,
-                 p1.y + theRefImgPt.y);
-    
-    image_point = p0;
-}
-
-void ossimApplanixUtmModel::updateModel()
-{
-
-   ossimGpt wgs84Pt;
-   double metersPerDegree = wgs84Pt.metersPerDegree().x;
-   double degreePerMeter = 1.0/metersPerDegree;
-   double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter;
-   double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;
-
-   ossimGpt gpt = thePlatformPosition;
-//   gpt.height(0.0);
-   double height = gpt.height();
-   gpt.height(height + computeParameterOffset(5));
-   gpt.latd(gpt.latd() + latShift);
-   gpt.lond(gpt.lond() + lonShift);
-   
-   theAdjEcefPlatformPosition = gpt;
-   ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition);
-   // ORIENT TO A UTM AXIS
-   //
-    NEWMAT::ColumnVector v(3);
-   
-    v[0] = 0.0;
-    v[1] = 0.0;
-    v[2] = 1.0;
-    NEWMAT::ColumnVector v2 = lsrSpace.lsrToEcefRotMatrix()*v;
-    ossimEcefVector zVector(v2[0], v2[1], v2[2]);
-    zVector.normalize();
-   
-   // now lets create a UTM axis by creating a derivative at the center
-   // by shift over a few pixels and subtracting
-   //
-   ossimUtmProjection utmProj;
-   
-   utmProj.setZone(theUtmZone);
-   utmProj.setZone(theUtmHemisphere);
-   utmProj.setMetersPerPixel(ossimDpt(1.0,1.0));
-   ossimDpt midPt  = utmProj.forward(theAdjEcefPlatformPosition);
-   ossimDpt rPt    = midPt + ossimDpt(10, 0.0);
-   ossimDpt uPt    = midPt + ossimDpt(0.0, 10.0);
-   ossimGpt wMidPt = utmProj.inverse(midPt);
-   ossimGpt wRPt   = utmProj.inverse(rPt);
-   ossimGpt wUPt   = utmProj.inverse(uPt);
-   
-   ossimEcefPoint ecefMidPt = wMidPt;
-   ossimEcefPoint ecefRPt   = wRPt;
-   ossimEcefPoint ecefUPt   = wUPt;
-   
-   ossimEcefVector east  = ecefRPt-ecefMidPt;
-   ossimEcefVector north = ecefUPt-ecefMidPt;
-   east.normalize();
-   north.normalize();
-   
-   // now use the lsr space constructors to construct an orthogonal set of axes
-   //
-   lsrSpace = ossimLsrSpace(thePlatformPosition,
-                            0,
-                            north,
-                            east.cross(north));
-//   lsrSpace = ossimLsrSpace(thePlatformPosition);
-   // DONE ORIENT TO UTM AXIS
-   
-   NEWMAT::Matrix platformLsrMatrix = lsrSpace.lsrToEcefRotMatrix();
-   NEWMAT::Matrix orientationMatrix = (ossimMatrix3x3::createRotationXMatrix(theOmega+computeParameterOffset(2), OSSIM_LEFT_HANDED)*
-                                       ossimMatrix3x3::createRotationYMatrix(thePhi+computeParameterOffset(3), OSSIM_LEFT_HANDED)*
-                                       ossimMatrix3x3::createRotationZMatrix(theKappa+computeParameterOffset(4), OSSIM_LEFT_HANDED));
-   
-   theCompositeMatrix         = platformLsrMatrix*orientationMatrix;
-   theCompositeMatrixInverse  = theCompositeMatrix.i();
-
-//   theAdjEcefPlatformPosition = theEcefPlatformPosition; 
-
-   theBoundGndPolygon.resize(4);
-   // ossim_float64 w = theImageClipRect.width();//*2.0;
-   // ossim_float64 h = theImageClipRect.height();//*2.0;
-   
-   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
-   theBoundGndPolygon[0] = gpt;
-   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
-   theBoundGndPolygon[1] = gpt;
-   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
-   theBoundGndPolygon[2] = gpt;
-   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
-   theBoundGndPolygon[3] = gpt;
-}
-
-void ossimApplanixUtmModel::initAdjustableParameters()
-{
-   resizeAdjustableParameterArray(6);
-   
-   setAdjustableParameter(0, 0.0);
-   setParameterDescription(0, "x_offset");
-   setParameterUnit(0, "pixels");
-
-   setAdjustableParameter(1, 0.0);
-   setParameterDescription(1, "y_offset");
-   setParameterUnit(1, "pixels");
-
-   setAdjustableParameter(2, 0.0);
-   setParameterDescription(2, "orientation x");
-   setParameterUnit(2, "degrees");
-
-   setAdjustableParameter(3, 0.0);
-   setParameterDescription(3, "orientation y");
-   setParameterUnit(3, "degrees");
-
-   setAdjustableParameter(4, 0.0);
-   setParameterDescription(4, "orientation z");
-   setParameterUnit(4, "degrees");
-
-   setAdjustableParameter(5, 0.0);
-   setParameterDescription(5, "Altitude delta");
-   setParameterUnit(5, "meters");
-
-   
-   
-   setParameterSigma(0, 20.0);
-   setParameterSigma(1, 20.0);
-   setParameterSigma(2, .1);
-   setParameterSigma(3, .1);
-   setParameterSigma(4, .1);
-   setParameterSigma(5, 50);
-}
-
-void ossimApplanixUtmModel::setPrincipalPoint(ossimDpt principalPoint)
-{
-   thePrincipalPoint = principalPoint;
-}
-
-void ossimApplanixUtmModel::setPixelSize(const ossimDpt& pixelSize)
-{
-   thePixelSize = pixelSize;
-}
-
-void ossimApplanixUtmModel::setImageRect(const ossimDrect& rect)
-{
-   theImageClipRect = rect;
-   theRefImgPt = rect.midPoint();
-}
-
-void ossimApplanixUtmModel::setFocalLength(double focalLength)
-{
-   theFocalLength = focalLength;
-}
-
-void ossimApplanixUtmModel::setPlatformPosition(const ossimGpt& gpt)
-{
-   theRefGndPt             = gpt;
-   theEcefPlatformPosition = gpt;
-   updateModel();
-   
-}
-
-bool ossimApplanixUtmModel::saveState(ossimKeywordlist& kwl,
-                                   const char* prefix) const
-{
-   ossimSensorModel::saveState(kwl, prefix);
-   
-   kwl.add(prefix, "type", "ossimApplanixUtmModel", true);
-
-   kwl.add(prefix, "omega", theOmega, true);
-   kwl.add(prefix, "phi", thePhi, true);
-   kwl.add(prefix, "kappa", theKappa, true);
-   kwl.add(prefix, "bore_sight_tx", theBoreSightTx*60, true);
-   kwl.add(prefix, "bore_sight_ty", theBoreSightTy*60, true);
-   kwl.add(prefix, "bore_sight_tz", theBoreSightTz*60, true);
-   kwl.add(prefix, "principal_point", ossimString::toString(thePrincipalPoint.x) + " " + ossimString::toString(thePrincipalPoint.y));
-   kwl.add(prefix, "pixel_size",      ossimString::toString(thePixelSize.x) + " " + ossimString::toString(thePixelSize.y));
-   kwl.add(prefix, "focal_length", theFocalLength);
-   kwl.add(prefix, "ecef_platform_position",
-           ossimString::toString(theEcefPlatformPosition.x()) + " " +
-           ossimString::toString(theEcefPlatformPosition.y()) + " " +
-           ossimString::toString(theEcefPlatformPosition.z()));
-   kwl.add(prefix, "latlonh_platform_position",
-           ossimString::toString(thePlatformPosition.latd()) + " " +
-           ossimString::toString(thePlatformPosition.lond()) + " " +
-           ossimString::toString(thePlatformPosition.height()) + " " +
-           thePlatformPosition.datum()->code());
-   kwl.add(prefix,
-           "utm_platform_position",
-           ossimString::toString(theUtmPlatformPosition.x) + " " +
-           ossimString::toString(theUtmPlatformPosition.y) + " " +
-           ossimString::toString(theUtmPlatformPosition.z) + " " +
-           thePlatformPosition.datum()->code(),
-           true);
-   kwl.add(prefix,
-           "utm_zone",
-           theUtmZone,
-           true);
-   kwl.add(prefix,
-           "utm_hemisphere",
-           theUtmHemisphere,
-           true);
-   kwl.add(prefix,
-           "shift_values",
-           ossimString::toString(theShiftValues.x()) + " " + 
-           ossimString::toString(theShiftValues.y()) + " " +
-           ossimString::toString(theShiftValues.z()),
-           true);
-   if(theLensDistortion.valid())
-   {
-      ossimString lensPrefix = ossimString(prefix)+"distortion.";
-      theLensDistortion->saveState(kwl,
-                                   lensPrefix.c_str());
-   }
-   
-   return true;
-}
-
-bool ossimApplanixUtmModel::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   if(traceDebug())
-   {
-      std::cout << "ossimApplanixUtmModel::loadState: ......... entered" << std::endl;
-   }
-   theImageClipRect = ossimDrect(0,0,4076,4091);
-   theRefImgPt      = ossimDpt(2046.0, 2038.5);
-   
-   ossimSensorModel::loadState(kwl, prefix);
-
-   if(getNumberOfAdjustableParameters() < 1)
-   {
-      initAdjustableParameters();
-   }
-
-   const char* eo_file           = kwl.find(prefix, "eo_file");
-   const char* eo_id             = kwl.find(prefix, "eo_id");
-   const char* omega             = kwl.find(prefix, "omega");
-   const char* phi               = kwl.find(prefix, "phi");
-   const char* kappa             = kwl.find(prefix, "kappa");
-   const char* bore_sight_tx     = kwl.find(prefix, "bore_sight_tx");
-   const char* bore_sight_ty     = kwl.find(prefix, "bore_sight_ty");
-   const char* bore_sight_tz     = kwl.find(prefix, "bore_sight_tz");
-   
-   const char* principal_point   = kwl.find(prefix, "principal_point");
-   const char* pixel_size        = kwl.find(prefix, "pixel_size");
-   const char* focal_length      = kwl.find(prefix, "focal_length");
-   const char* latlonh_platform_position = kwl.find(prefix, "latlonh_platform_position");
-   const char* utm_platform_position = kwl.find(prefix, "utm_platform_position");
-   const char* compute_gsd_flag  = kwl.find(prefix, "compute_gsd_flag");
-   const char* utm_zone          = kwl.find(prefix, "utm_zone");
-   const char* utm_hemisphere    = kwl.find(prefix, "utm_hemisphere");
-   const char* camera_file       = kwl.find(prefix, "camera_file");
-   const char* shift_values      = kwl.find(prefix, "shift_values");
-   
-   theCompositeMatrix          = ossimMatrix3x3::createIdentity();
-   theCompositeMatrixInverse   = ossimMatrix3x3::createIdentity();
-   theOmega                    = 0.0;
-   thePhi                      = 0.0;
-   theKappa                    = 0.0;
-   theBoreSightTx              = 0.0;
-   theBoreSightTy              = 0.0;
-   theBoreSightTz              = 0.0;
-   theFocalLength              = 55.0;
-   thePixelSize = ossimDpt(.009, .009);
-   theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
-
-   bool loadedFromEoFile = false;
-
-   if(eo_id)
-   {
-      theImageID = eo_id;
-   }
-   // loading from standard eo file with given record id
-   //
-   if(eo_file)
-   {
-      ossimApplanixEOFile eoFile;
-      
-      if(eoFile.parseFile(ossimFilename(eo_file)))
-      {
-         ossimRefPtr<ossimApplanixEORecord> record = eoFile.getRecordGivenId(theImageID);
-
-         if(record.valid())
-         {
-            loadedFromEoFile = true;
-            theBoreSightTx = eoFile.getBoreSightTx()/60.0;
-            theBoreSightTy = eoFile.getBoreSightTy()/60.0;
-            theBoreSightTz = eoFile.getBoreSightTz()/60.0;
-            theShiftValues = ossimEcefVector(eoFile.getShiftValuesX(),
-                                             eoFile.getShiftValuesY(),
-                                             eoFile.getShiftValuesZ());
-            ossim_int32 easting  = eoFile.getFieldIdxLike("EASTING");
-            ossim_int32 northing = eoFile.getFieldIdxLike("NORTHING");
-            ossim_int32 height   = eoFile.getFieldIdxLike("HEIGHT");
-            ossim_int32 omega    = eoFile.getFieldIdxLike("OMEGA");
-            ossim_int32 phi      = eoFile.getFieldIdxLike("PHI");
-            ossim_int32 kappa    = eoFile.getFieldIdxLike("KAPPA");
-
-            if((omega>=0)&&
-               (phi>=0)&&
-               (kappa>=0)&&
-               (height>=0)&&
-               (easting>=0)&&
-               (northing>=0))
-            {
-               theOmega = (*record)[omega].toDouble();
-               thePhi   = (*record)[phi].toDouble();
-               theKappa = (*record)[kappa].toDouble();
-               double h = (*record)[height].toDouble();
-               ossimString heightType = kwl.find(prefix, "height_type");
-               if(eoFile.isUtmFrame())
-               {
-                  theUtmZone = eoFile.getUtmZone();
-                  theUtmHemisphere = eoFile.getUtmHemisphere()=="North"?'N':'S';
-                  ossimUtmProjection utmProj;
-                  utmProj.setZone(theUtmZone);
-                  utmProj.setHemisphere((char)theUtmHemisphere);
-                  theUtmPlatformPosition.x = (*record)[easting].toDouble();
-                  theUtmPlatformPosition.y = (*record)[northing].toDouble();
-                  theUtmPlatformPosition.z = h;
-                  thePlatformPosition = utmProj.inverse(ossimDpt(theUtmPlatformPosition.x,
-                                                                 theUtmPlatformPosition.y));
-                  thePlatformPosition.height(h);
-
-                  if(eoFile.isHeightAboveMSL())
-                  {
-                     double offset = ossimGeoidManager::instance()->offsetFromEllipsoid(thePlatformPosition);
-                     if(!ossim::isnan(offset))
-                     {
-                        thePlatformPosition.height(h + offset);
-                        theUtmPlatformPosition.z = h + offset;
-                     }
-                  }
-               }
-               else
-               {
-                  return false;
-               }
-            }
-            theEcefPlatformPosition = thePlatformPosition;
-         }
-         else
-         {
-            return false;
-         }
-      }
-   }
-   if(!loadedFromEoFile)
-   {
-      if(shift_values)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(shift_values);
-         tempString = tempString.trim();
-         tempString.split(splitString, " " );
-         if(splitString.size() == 3)
-         {
-            theShiftValues = ossimEcefVector(splitString[0].toDouble(),
-                                             splitString[1].toDouble(),
-                                             splitString[2].toDouble());
-         }
-      }
-      if(omega&&phi&&kappa)
-      {
-         theOmega = ossimString(omega).toDouble();
-         thePhi   = ossimString(phi).toDouble();
-         theKappa = ossimString(kappa).toDouble();
-      }
-      if(bore_sight_tx&&bore_sight_ty&&bore_sight_tz)
-      {
-         theBoreSightTx = ossimString(bore_sight_tx).toDouble()/60.0;
-         theBoreSightTy = ossimString(bore_sight_ty).toDouble()/60.0;
-         theBoreSightTz = ossimString(bore_sight_tz).toDouble()/60.0;
-      }
-      double lat=0.0, lon=0.0, h=0.0;
-      if(utm_zone)
-      {
-         theUtmZone = ossimString(utm_zone).toInt32();
-      }
-      if(utm_hemisphere)
-      {
-         ossimString hem = utm_hemisphere;
-         hem = hem.trim();
-         hem = hem.upcase();
-         theUtmHemisphere = *(hem.begin());
-      }
-      if(utm_platform_position)
-      {
-         ossimUtmProjection utmProj;
-         std::vector<ossimString> splitString;
-         ossimString tempString(utm_platform_position);
-         tempString = tempString.trim();
-         ossimString datumString;
-         utmProj.setZone(theUtmZone);
-         utmProj.setHemisphere((char)theUtmHemisphere);
-         tempString.split(splitString, " ");
-         if(splitString.size() > 2)
-         {
-            theUtmPlatformPosition.x = splitString[0].toDouble();
-            theUtmPlatformPosition.y = splitString[1].toDouble();
-            theUtmPlatformPosition.z = splitString[2].toDouble();
-         }
-         if(splitString.size() > 3)
-         {
-            datumString = splitString[3];
-         }
-         const ossimDatum* datum = ossimDatumFactory::instance()->create(datumString);
-         if(datum)
-         {
-            utmProj.setDatum(datum);
-         }
-         
-         thePlatformPosition = utmProj.inverse(ossimDpt(theUtmPlatformPosition.x,
-                                                        theUtmPlatformPosition.y));
-         thePlatformPosition.height(theUtmPlatformPosition.z);
-         
-         ossimString heightType = kwl.find(prefix, "height_type");
-         if(heightType == "msl")
-         {
-            double offset = ossimGeoidManager::instance()->offsetFromEllipsoid(thePlatformPosition);
-            if(ossim::isnan(offset) == false)
-            {
-               thePlatformPosition.height(thePlatformPosition.height() + offset);
-               theUtmPlatformPosition.z = thePlatformPosition.height();
-            }
-         }
-         theEcefPlatformPosition = thePlatformPosition;
-      }
-      else if(latlonh_platform_position)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(latlonh_platform_position);
-         std::string datumString;
-         tempString = tempString.trim();
-         tempString.split(splitString, " ");
-         if(splitString.size() > 2)
-         {
-            lat = splitString[0].toDouble();
-            lon = splitString[1].toDouble();
-            h = splitString[2].toDouble();
-         }
-         if(splitString.size() > 3)
-         {
-            datumString = splitString[3].string();
-         }
-         thePlatformPosition.latd(lat);
-         thePlatformPosition.lond(lon);
-         thePlatformPosition.height(h);
-         const ossimDatum* datum = ossimDatumFactory::instance()->create(datumString);
-         if(datum)
-         {
-            thePlatformPosition.datum(datum);
-         }
-         ossimString heightType = kwl.find(prefix, "height_type");
-         if(heightType == "msl")
-         {
-            double offset = ossimGeoidManager::instance()->offsetFromEllipsoid(thePlatformPosition);
-            if(ossim::isnan(offset) == false)
-            {
-               thePlatformPosition.height(thePlatformPosition.height() + offset);
-            }
-         }
-         theEcefPlatformPosition = thePlatformPosition;
-      }
-   }
-   if(principal_point)
-   {
-      std::vector<ossimString> splitString;
-      ossimString tempString(principal_point);
-      tempString = tempString.trim();
-      tempString.split(splitString, " ");
-      if(splitString.size() == 2)
-      {
-         thePrincipalPoint.x = splitString[0].toDouble();
-         thePrincipalPoint.y = splitString[1].toDouble();
-      }
-   }
-   if(pixel_size)
-   {
-      std::vector<ossimString> splitString;
-      ossimString tempString(principal_point);
-      tempString = tempString.trim();
-      tempString.split(splitString, " ");
-      if(splitString.size() == 2)
-      {
-         thePixelSize.x = splitString[0].toDouble();
-         thePixelSize.y = splitString[1].toDouble();
-      }
-   }
-   if(focal_length)
-   {
-      theFocalLength = ossimString(focal_length).toDouble();
-   }
-
-   if(camera_file)
-   {
-      ossimKeywordlist cameraKwl;
-      ossimKeywordlist lensKwl;
-      cameraKwl.add(camera_file);
-      const char* sensor = cameraKwl.find("sensor");
-      const char* image_size      = cameraKwl.find(prefix, "image_size");
-      principal_point = cameraKwl.find("principal_point");
-      focal_length    = cameraKwl.find("focal_length");
-      pixel_size      = cameraKwl.find(prefix, "pixel_size");
-      focal_length    = cameraKwl.find(prefix, "focal_length");
-      const char* distortion_units = cameraKwl.find(prefix, "distortion_units");
-      ossimUnitConversionTool tool;
-      ossimUnitType unitType = OSSIM_MILLIMETERS;
-
-      if(distortion_units)
-      {
-         unitType = (ossimUnitType)ossimUnitTypeLut::instance()->getEntryNumber(distortion_units);
-
-         if(unitType == OSSIM_UNIT_UNKNOWN)
-         {
-            unitType = OSSIM_MILLIMETERS;
-         }
-      }
-      if(image_size)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(image_size);
-         tempString = tempString.trim();
-         tempString.split(splitString, " ");
-         double w=1, h=1;
-         if(splitString.size() == 2)
-         {
-            w = splitString[0].toDouble();
-            h = splitString[1].toDouble();
-         }
-         theImageClipRect = ossimDrect(0,0,w-1,h-1);
-         theRefImgPt      = ossimDpt(w/2.0, h/2.0);
-         theImageSize     = ossimDpt(w, h);
-      }
-      if(sensor)
-      {
-         theSensorID = sensor;
-      }
-      if(principal_point)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(principal_point);
-         tempString = tempString.trim();
-         tempString.split(splitString, " ");
-         if(splitString.size() == 2)
-         {
-            thePrincipalPoint.x = splitString[0].toDouble();
-            thePrincipalPoint.y = splitString[1].toDouble();
-         }
-      }
-      if(pixel_size)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(pixel_size);
-         tempString = tempString.trim();
-         tempString.split(splitString, " ");
-         if(splitString.size() == 1)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = thePixelSize.x;
-         }
-         else if(splitString.size() == 2)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = splitString[1].toDouble();
-         }
-      }
-      if(focal_length)
-      {
-         theFocalLength = ossimString(focal_length).toDouble();
-      }
-
-      cameraKwl.trimAllValues();
-      
-      
-      ossimString regExpression =  ossimString("^(") + "d[0-9]+)";
-      vector<ossimString> keys;
-      cameraKwl.getSubstringKeyList( keys, regExpression );
-      long numberOfDistortions = (long)keys.size();
-      int offset = (int)ossimString("d").size();
-      ossim_uint32 idx = 0;
-      std::vector<int> numberList(numberOfDistortions);
-      for(idx = 0; idx < numberList.size();++idx)
-      {
-         ossimString numberStr(keys[idx].begin() + offset,
-                               keys[idx].end());
-         numberList[idx] = numberStr.toInt();
-      }
-      std::sort(numberList.begin(), numberList.end());
-      double distance=0.0, distortion=0.0;
-     
-      for(idx = 0; idx < numberList.size(); ++idx)
-      {
-         ossimString value = cameraKwl.find(ossimString("d")+ossimString::toString(numberList[idx]));
-         if(!value.empty())
-         {
-            std::istringstream inStr(value.c_str());
-            inStr >> distance;
-            ossim::skipws(inStr);
-            inStr >> distortion;
-#if 0
-            std::vector<ossimString> splitString;
-            ossimString tempString(value);
-            tempString = tempString.trim();
-            tempString.split(splitString, " ");
-            std::cout << splitString.size() << std::endl;
-            if(splitString.size() >= 2)
-            {
-               distance = splitString[0].toDouble();
-               distortion = splitString[1].toDouble();
-            }
-#endif
-            
-            tool.setValue(distortion, unitType);
-            lensKwl.add(ossimString("distance") + ossimString::toString(idx),
-                        distance,
-                        true);
-            lensKwl.add(ossimString("distortion") + ossimString::toString(idx),
-                        tool.getMillimeters(),
-                        true);
-         }
-         lensKwl.add("convergence_threshold",
-                     .00001,
-                     true);
-         if(pixel_size)
-         {
-            lensKwl.add("dxdy",
-                        ossimString::toString(thePixelSize.x) + " " +ossimString::toString(thePixelSize.y),
-                        true);
-         }
-         else
-         {
-            lensKwl.add("dxdy",
-                        ".009 .009",
-                        true);
-         }
-      }
-      if(theLensDistortion.valid())
-      {
-         theLensDistortion->loadState(lensKwl,"");
-      }
-   }
-   else
-   {
-      
-      if(principal_point)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(principal_point);
-         tempString = tempString.trim();
-         tempString.split(splitString, " ");
-         if(splitString.size() >= 2)
-         {
-            thePrincipalPoint.x = splitString[0].toDouble();
-            thePrincipalPoint.y = splitString[1].toDouble();
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "No principal_point found" << std::endl;
-            return false;
-         }
-      }
-      if(pixel_size)
-      {
-         std::vector<ossimString> splitString;
-         ossimString tempString(pixel_size);
-         tempString = tempString.trim();
-         tempString.split(splitString, " ");
-         if(splitString.size() == 1)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = thePixelSize.x;
-         }
-         else if(splitString.size() == 2)
-         {
-            thePixelSize.x = splitString[0].toDouble();
-            thePixelSize.y = splitString[1].toDouble();
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "No pixel size found" << std::endl;
-            return false;
-         }
-      }
-      if(focal_length)
-      {
-         theFocalLength = ossimString(focal_length).toDouble();
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "No focal length found" << std::endl;
-            return false;
-         }
-      }
-      
-      if(theLensDistortion.valid())
-      {
-         ossimString lensPrefix = ossimString(prefix)+"distortion.";
-         theLensDistortion->loadState(kwl,
-                                      lensPrefix.c_str());
-      }
-   }
-   theRefGndPt = thePlatformPosition;
-   
-   updateModel();
-
-   lineSampleToWorld(theRefImgPt, theRefGndPt);
-   if(compute_gsd_flag)
-   {
-      if(ossimString(compute_gsd_flag).toBool())
-      {
-         ossimGpt right;
-         ossimGpt top;
-         lineSampleToWorld(theRefImgPt + ossimDpt(1.0, 0.0),
-                           right);
-         lineSampleToWorld(theRefImgPt + ossimDpt(1.0, 0.0),
-                           top);
-
-         ossimEcefVector horizontal = ossimEcefPoint(theRefGndPt)-ossimEcefPoint(right);
-         ossimEcefVector vertical   = ossimEcefPoint(theRefGndPt)-ossimEcefPoint(top);
-
-         theGSD.x = horizontal.length();
-         theGSD.y = vertical.length();
-         theMeanGSD = (theGSD.x+theGSD.y)*.5;
-      }
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theOmega:              " << theOmega << std::endl
-                                          << "thePhi:                " << thePhi   << std::endl
-                                          << "theKappa:              " << theKappa << std::endl;
-      std::cout << "platform position:     " << thePlatformPosition << std::endl;
-      std::cout << "platform position ECF: " << theEcefPlatformPosition << std::endl;
-      std::cout << "ossimApplanixModel::loadState: ......... leaving" << std::endl;
-   }
-
-   return true;
-}
-
-bool ossimApplanixUtmModel::setupOptimizer(const ossimString& init_file)
-{
-   ossimKeywordlist kwl;
-   kwl.addFile(init_file.c_str());
-
-   return loadState(kwl);
-}
diff --git a/ossim/src/ossim/projection/ossimBonneProjection.cpp b/ossim/src/ossim/projection/ossimBonneProjection.cpp
deleted file mode 100644
index 6b29bed..0000000
--- a/ossim/src/ossim/projection/ossimBonneProjection.cpp
+++ /dev/null
@@ -1,535 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Bonne projection code.  
-//*******************************************************************
-//  $Id: ossimBonneProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-#include <ossim/projection/ossimBonneProjection.h>
-#include <ossim/projection/ossimSinusoid.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimBonneProjection, "ossimBonneProjection", ossimMapProjection)
-
-
-/***************************************************************************/
-/*
- *                               DEFINES
- */
-#define BONN_NO_ERROR           0x0000
-#define BONN_LAT_ERROR          0x0001
-#define BONN_LON_ERROR          0x0002
-#define BONN_EASTING_ERROR      0x0004
-#define BONN_NORTHING_ERROR     0x0008
-#define BONN_ORIGIN_LAT_ERROR   0x0010
-#define BONN_CENT_MER_ERROR     0x0020
-#define BONN_A_ERROR            0x0040
-#define BONN_B_ERROR            0x0080
-#define BONN_A_LESS_B_ERROR     0x0100
-
-#define PI_OVER_2  (M_PI / 2.0)                 
-#define BONN_m(coslat,sinlat)                   (coslat/sqrt(1.0 - es2*sinlat*sinlat))
-#define BONN_M(c0lat,c1s2lat,c2s4lat,c3s6lat)   (Bonn_a*(c0lat-c1s2lat+c2s4lat-c3s6lat))
-#define COEFF_TIMES_BONN_SIN(coeff,x,latit)	    (coeff*(sin(x * latit)))
-#define FLOAT_EQ(x,v,epsilon)   (((v - epsilon) < x) && (x < (v + epsilon)))
-
-ossimBonneProjection::ossimBonneProjection(const ossimEllipsoid& ellipsoid,
-                                           const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();   
-   update();
-}
-
-ossimBonneProjection::ossimBonneProjection(const ossimEllipsoid& ellipsoid,
-                                           const ossimGpt& origin,
-                                           const double falseEasting,
-                                           const double falseNorthing)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   Bonn_False_Easting  = falseEasting;
-   Bonn_False_Northing = falseNorthing;
-   Bonn_Delta_Northing = 25000000.0;
-
-   update();
-}
-
-void ossimBonneProjection::update()
-{
-   Set_Bonne_Parameters(theEllipsoid.getA(),
-                        theEllipsoid.getFlattening(),
-                        theOrigin.latr(),
-                        theOrigin.lonr(),
-                        Bonn_False_Easting,
-                        Bonn_False_Northing);
-
-   theFalseEastingNorthing.x = Bonn_False_Easting;
-   theFalseEastingNorthing.y = Bonn_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-void ossimBonneProjection::setFalseEasting(double falseEasting)
-{
-   Bonn_False_Easting = falseEasting;
-   update();
-}
-
-void ossimBonneProjection::setFalseNorthing(double falseNorthing)
-{
-   Bonn_False_Northing = falseNorthing;
-   update();
-}
-
-void ossimBonneProjection::setFalseEastingNorthing(double falseEasting,
-                                                   double falseNorthing)
-{
-   Bonn_False_Easting = falseEasting;
-   Bonn_False_Northing = falseNorthing;  
-   update();
-}
-
-void ossimBonneProjection::setDefaults()
-{
-
-   Bonn_False_Easting  = 0.0;
-   Bonn_False_Northing = 0.0;  
-   Bonn_Delta_Northing = 25000000.0;
-   if(theOrigin.latd() == 0.0)
-   {
-      // we can't have the origin of lat 0 for Bonne
-      // so bump it up an arc second.
-      //
-      theOrigin.latd(1.0/3600.0);
-   }
-}
-
-ossimGpt ossimBonneProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat, lon;
-
-   Convert_Bonne_To_Geodetic(eastingNorthing.x,
-                             eastingNorthing.y,
-                             &lat,
-                             &lon);
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0, theDatum);  
-}
-
-ossimDpt ossimBonneProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Bonne(gpt.latr(),
-                             gpt.lonr(),
-                             &easting,
-                             &northing);
-   return ossimDpt(easting, northing);
-}
-
-bool ossimBonneProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimBonneProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   // Must do this first.
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-   
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-
-   setDefaults();
-
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimBonneProjection))
-   {
-      Bonn_False_Easting  = theFalseEastingNorthing.x;
-      Bonn_False_Northing = theFalseEastingNorthing.y;
-   }
-   
-   update();
-   return flag;
-}
-
-
-/*
- * These state variables are for optimization purposes.  The only function
- * that should modify them is Set_Bonne_Parameters.
- */
-
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS     
- */
-
-
-long ossimBonneProjection::Set_Bonne_Parameters(double a,
-                                                double f,
-                                                double Origin_Latitude,
-                                                double Central_Meridian,
-                                                double False_Easting,
-                                                double False_Northing)
-{ /* Begin Set_Bonne_Parameters */
-/*
- * The function Set_Bonne_Parameters receives the ellipsoid parameters and
- * Bonne projection parameters as inputs, and sets the corresponding state
- * variables.  If any errors occur, the error code(s) are returned by the 
- * function, otherwise BONN_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid                   (input)
- *    Origin_Latitude   : Latitude in radians at which the          (input)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (input)
- */
-
-  double j, three_es4;
-  double x,e1,e2,e3,e4;
-  double clat; 
-  double sin2lat, sin4lat, sin6lat, lat;
-//  double inv_f = 1 / f;
-  long Error_Code = BONN_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= BONN_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-// 	 Error_Code |= BONN_INV_F_ERROR;
-//   } 
-//   if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
-//   { /* origin latitude out of range */
-//     Error_Code |= BONN_ORIGIN_LAT_ERROR;
-//   }
-//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= BONN_CENT_MER_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    Bonn_a = a;
-    Bonn_f = f;
-    Bonn_Origin_Lat = Origin_Latitude;
-//     if (Central_Meridian > PI)
-//       Central_Meridian -= TWO_PI;
-    Bonn_Origin_Long = Central_Meridian;
-    Bonn_False_Northing = False_Northing;
-    Bonn_False_Easting = False_Easting;
-    if (Bonn_Origin_Lat == 0.0)
-    {
-       if (Bonn_Origin_Long > 0)
-       {
-          Bonn_Max_Easting = 19926189.0;
-          Bonn_Min_Easting = -20037509.0;
-       }
-       else if (Bonn_Origin_Long < 0)
-       {
-          Bonn_Max_Easting = 20037509.0;
-          Bonn_Min_Easting = -19926189.0;
-       }
-       else
-       {
-          Bonn_Max_Easting = 20037509.0;
-          Bonn_Min_Easting = -20037509.0;
-       }
-       Bonn_Delta_Northing = 10001966.0;
-       Set_Sinusoidal_Parameters(Bonn_a, Bonn_f, Bonn_Origin_Long, Bonn_False_Easting, Bonn_False_Northing);
-    }
-    else
-    {
-       Sin_Bonn_Origin_Lat = sin(Bonn_Origin_Lat);
-       
-       es2 = 2 * Bonn_f - Bonn_f * Bonn_f;
-       es4 = es2 * es2;
-       es6 = es4 * es2;
-       j = 45.0 * es6 / 1024.0;
-       three_es4 = 3.0 * es4;
-       c0 = 1 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
-       c1 = 3.0 * es2 / 8.0 + three_es4 / 32.0 + j;
-       c2 = 15.0 * es4 / 256.0 + j;
-       c3 = 35.0 * es6 / 3072.0;
-       
-       clat = cos(Bonn_Origin_Lat);
-       m1 = BONN_m(clat, Sin_Bonn_Origin_Lat);
-       
-       lat = c0 * Bonn_Origin_Lat;
-       sin2lat = COEFF_TIMES_BONN_SIN(c1, 2.0, Bonn_Origin_Lat);
-       sin4lat = COEFF_TIMES_BONN_SIN(c2, 4.0, Bonn_Origin_Lat);
-       sin6lat = COEFF_TIMES_BONN_SIN(c3, 6.0, Bonn_Origin_Lat);
-       M1 = BONN_M(lat, sin2lat, sin4lat, sin6lat);
-       
-       x = sqrt (1.0 - es2);
-       e1 = (1.0 - x) / (1.0 + x);
-       e2 = e1 * e1;
-       e3 = e2 * e1;
-       e4 = e3 * e1;
-       a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
-       a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
-       a2 = 151.0 * e3 / 96.0;
-       a3 = 1097.0 * e4 / 512.0;
-       if (Sin_Bonn_Origin_Lat == 0.0)
-          Bonn_am1sin = 0.0;
-       else
-          Bonn_am1sin = Bonn_a * m1 / Sin_Bonn_Origin_Lat;
-       
-       Bonn_Max_Easting = 20027474.0;
-       Bonn_Min_Easting = -20027474.0;
-       Bonn_Delta_Northing = 20003932.0;
-       
-    }
-    
-  } /* End if(!Error_Code) */
-  return (Error_Code);
-} /* End Set_Bonne_Parameters */
-
-
-void ossimBonneProjection::Get_Bonne_Parameters(double *a,
-                                                double *f,
-                                                double *Origin_Latitude,
-                                                double *Central_Meridian,
-                                                double *False_Easting,
-                                                double *False_Northing)const
-{ /* Begin Get_Bonne_Parameters */
-/*
- * The function Get_Bonne_Parameters returns the current ellipsoid
- * parameters and Bonne projection parameters.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid                   (output)
- *    Origin_Latitude   : Latitude in radians at which the          (output)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (output)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (output)
- */
-
-  *a = Bonn_a;
-  *f = Bonn_f;
-  *Origin_Latitude = Bonn_Origin_Lat;
-  *Central_Meridian = Bonn_Origin_Long;
-  *False_Easting = Bonn_False_Easting;
-  *False_Northing = Bonn_False_Northing;
-  return;
-} /* End Get_Bonne_Parameters */
-
-
-long ossimBonneProjection::Convert_Geodetic_To_Bonne (double Latitude,
-                                                      double Longitude,
-                                                      double *Easting,
-                                                      double *Northing)const
-{ /* Begin Convert_Geodetic_To_Bonne */
-/*
- * The function Convert_Geodetic_To_Bonne converts geodetic (latitude and
- * longitude) coordinates to Bonne projection (easting and northing)
- * coordinates, according to the current ellipsoid and Bonne projection
- * parameters.  If any errors occur, the error code(s) are returned by the
- * function, otherwise BONN_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double dlam; /* Longitude - Central Meridan */
-  double mm;
-  double MM;
-  double rho;
-  double EE;
-  double clat = cos(Latitude);
-  double slat = sin(Latitude);
-  double lat, sin2lat, sin4lat, sin6lat;
-  long Error_Code = BONN_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   { /* Latitude out of range */
-//     Error_Code |= BONN_LAT_ERROR;
-//   }
-//   if ((Longitude < -PI) || (Longitude > TWO_PI))
-//   { /* Longitude out of range */
-//     Error_Code |= BONN_LON_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-     if (Bonn_Origin_Lat == 0.0)
-        Convert_Geodetic_To_Sinusoidal(Latitude, Longitude, Easting, Northing);
-     else
-     {
-        dlam = Longitude - Bonn_Origin_Long;
-        if (dlam > M_PI)
-        {
-           dlam -= TWO_PI;
-        }
-        if (dlam < -M_PI)
-        {
-           dlam += TWO_PI;
-        }
-        if ((Latitude - Bonn_Origin_Lat) == 0.0 && FLOAT_EQ(fabs(Latitude),PI_OVER_2,.00001))
-        {
-           *Easting = 0.0;
-           *Northing = 0.0;
-        }
-        else
-        {
-           mm = BONN_m(clat, slat);
-           
-           lat = c0 * Latitude;
-           sin2lat = COEFF_TIMES_BONN_SIN(c1, 2.0, Latitude);
-           sin4lat = COEFF_TIMES_BONN_SIN(c2, 4.0, Latitude);
-           sin6lat = COEFF_TIMES_BONN_SIN(c3, 6.0, Latitude);
-           MM = BONN_M(lat, sin2lat, sin4lat, sin6lat);         
-           
-           rho = Bonn_am1sin + M1 - MM;
-           if (rho == 0)
-              EE = 0;
-           else
-              EE = Bonn_a * mm * dlam / rho;
-           *Easting = rho * sin(EE) + Bonn_False_Easting;
-           *Northing = Bonn_am1sin - rho * cos(EE) + Bonn_False_Northing;
-        }
-     }
-  }
-  return (Error_Code);
-} /* End Convert_Geodetic_To_Bonne */
-
-
-long ossimBonneProjection::Convert_Bonne_To_Geodetic(double Easting,
-                                                     double Northing,
-                                                     double *Latitude,
-                                                     double *Longitude)const
-{ /* Begin Convert_Bonne_To_Geodetic */
-/*
- * The function Convert_Bonne_To_Geodetic converts Bonne projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid and Bonne projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise BONN_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
-  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
-  double mu;
-  double MM;
-  double mm;
-  double am1sin_dy;
-  double rho;
-  double sin2mu, sin4mu, sin6mu, sin8mu;
-  double clat, slat;
-  long Error_Code = BONN_NO_ERROR;
-
-//   if ((Easting < (Bonn_False_Easting + Bonn_Min_Easting))
-//       || (Easting > (Bonn_False_Easting + Bonn_Max_Easting)))
-//   { /* Easting out of range */
-//     Error_Code |= BONN_EASTING_ERROR;
-//   }
-//   if ((Northing < (Bonn_False_Northing - Bonn_Delta_Northing))
-//       || (Northing > (Bonn_False_Northing + Bonn_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= BONN_NORTHING_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-     if (Bonn_Origin_Lat == 0.0)
-        Convert_Sinusoidal_To_Geodetic(Easting, Northing, Latitude, Longitude);
-     else
-     {
-        dy = Northing - Bonn_False_Northing;
-        dx = Easting - Bonn_False_Easting;
-        am1sin_dy = Bonn_am1sin - dy;
-        rho = sqrt(dx * dx + am1sin_dy * am1sin_dy);
-        if (Bonn_Origin_Lat < 0.0)
-           rho = -rho;
-        MM = Bonn_am1sin + M1 - rho;
-        
-        mu = MM / (Bonn_a * c0); 
-        sin2mu = COEFF_TIMES_BONN_SIN(a0, 2.0, mu);
-        sin4mu = COEFF_TIMES_BONN_SIN(a1, 4.0, mu);
-        sin6mu = COEFF_TIMES_BONN_SIN(a2, 6.0, mu);
-        sin8mu = COEFF_TIMES_BONN_SIN(a3, 8.0, mu);
-        *Latitude = mu + sin2mu + sin4mu + sin6mu + sin8mu;
-        
-        if (FLOAT_EQ(fabs(*Latitude),PI_OVER_2,.00001))
-        {
-           *Longitude = Bonn_Origin_Long;
-        }
-        else
-        {
-           clat = cos(*Latitude);
-           slat = sin(*Latitude);
-           mm = BONN_m(clat, slat);
-           
-           if (Bonn_Origin_Lat < 0.0)
-           {
-              dx = -dx;
-              am1sin_dy = -am1sin_dy;
-           }
-           *Longitude = Bonn_Origin_Long + rho * (atan2(dx, am1sin_dy)) /
-                        (Bonn_a * mm);
-        }
-        
-        if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-           *Latitude = PI_OVER_2;
-        else if (*Latitude < -PI_OVER_2)
-           *Latitude = -PI_OVER_2;
-        
-//         if (*Longitude > PI)
-//            *Longitude -= TWO_PI;
-//         if (*Longitude < -PI)
-//            *Longitude += TWO_PI;
-        
-        if (*Longitude > M_PI)/* force distorted values to 180, -180 degrees */
-           *Longitude = M_PI;
-        else if (*Longitude < -M_PI)
-           *Longitude = -M_PI;
-     }
-  }
-  return (Error_Code);
-} /* End Convert_Bonne_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimBonneProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimBonneProjection* p = PTR_CAST(ossimBonneProjection, &proj);
-   if (!p)
-      return false;
-
-   if (!ossim::almostEqual(Bonn_False_Easting, p->Bonn_False_Easting) ) return false;
-   if (!ossim::almostEqual(Bonn_False_Northing,p->Bonn_False_Northing)) return false;
-   if (!ossim::almostEqual(Bonn_Delta_Northing,p->Bonn_Delta_Northing)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimBuckeyeSensor.cpp b/ossim/src/ossim/projection/ossimBuckeyeSensor.cpp
deleted file mode 100644
index 32ca867..0000000
--- a/ossim/src/ossim/projection/ossimBuckeyeSensor.cpp
+++ /dev/null
@@ -1,721 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//
-//*******************************************************************
-//  $Id: ossimBuckeyeSensor.cpp  $
-
-#include <ossim/projection/ossimBuckeyeSensor.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimLsrSpace.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimMatrix4x4.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimCsvFile.h>
-static ossimTrace traceDebug("ossimBuckeyeSensor:debug");
-
-RTTI_DEF1(ossimBuckeyeSensor, "ossimBuckeyeSensor", ossimSensorModel);
-
-ossimBuckeyeSensor::ossimBuckeyeSensor()
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(): entering..." << std::endl;
-
-	theCompositeMatrix			= ossimMatrix4x4::createIdentity();
-	theCompositeMatrixInverse	= ossimMatrix4x4::createIdentity();
-	theRoll						   = 0.0;
-	thePitch					      = 0.0;
-	theHeading					   = 0.0;
-	theFocalLength				   = 0.0;
-	thePixelSize				   = ossimDpt(0.0, 0.0);
-	thePrincipalPoint			   = ossimDpt(0.0, 0.0);
-	theEcefPlatformPosition		= ossimGpt(0.0, 0.0, 0.0);
-	theAdjEcefPlatformPosition	= ossimGpt(0.0, 0.0, 0.0);
-	theLensDistortion			   = new ossimSmacCallibrationSystem();
-
-	theGSD.makeNan();
-	initAdjustableParameters();
-
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(): returning..." << std::endl;
-}
-ossimBuckeyeSensor::ossimBuckeyeSensor(const ossimDrect& imageRect,
-	const ossimGpt& platformPosition,
-	double roll,
-	double pitch,
-	double heading,
-	const ossimDpt& /* principalPoint */, // in millimeters
-	double focalLength, // in millimeters
-	const ossimDpt& pixelSize) // in millimeters
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(imageRect,platformPosition,roll,pitch,heading,ossimDpt,focalLength,pixelSize): entering..." << std::endl;
-
-	theImageClipRect			    = imageRect;
-	theRefImgPt					    = theImageClipRect.midPoint();
-	theCompositeMatrix          = ossimMatrix4x4::createIdentity();
-	theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
-	theRoll                     = roll;
-	thePitch                    = pitch;
-	theHeading                  = heading;
-	theFocalLength              = focalLength;
-	thePixelSize                = pixelSize;
-	theEcefPlatformPosition     = platformPosition;
-	theAdjEcefPlatformPosition  = platformPosition;
-	theLensDistortion           = new ossimSmacCallibrationSystem();
-	theGSD.makeNan();
-
-	initAdjustableParameters();
-	updateModel();
-
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(imageRect,platformPosition,roll,pitch,heading,ossimDpt,focalLength,pixelSize): returning..." << std::endl;
-}
-
-ossimBuckeyeSensor::ossimBuckeyeSensor(const ossimBuckeyeSensor& src)
-	:ossimSensorModel(src)
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(src): entering..." << std::endl;
-
-	initAdjustableParameters();
-
-	if(src.theLensDistortion.valid())
-	{
-		theLensDistortion = new ossimSmacCallibrationSystem(*(src.theLensDistortion.get()));
-	}
-	else
-	{
-		theLensDistortion = new ossimSmacCallibrationSystem();
-	}
-	theGSD.makeNan();
-
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(src): returning..." << std::endl;
-}
-
-ossimObject* ossimBuckeyeSensor::dup()const
-{
-	return new ossimBuckeyeSensor(*this);
-}
-
-void ossimBuckeyeSensor::imagingRay(const ossimDpt& image_point,
-	ossimEcefRay&   image_ray) const
-{
-	if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimBuckeyeSensor::imagingRay: ..... entered" << std::endl;
-
-	ossimDpt f1 ((image_point) - theRefImgPt);
-	f1.x *= thePixelSize.x;
-	f1.y *= -thePixelSize.y;
-	ossimDpt film (f1 - thePrincipalPoint);
-
-	if(traceDebug())
-	{
-		ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size   = " << thePixelSize << std::endl;
-		ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
-		ossimNotify(ossimNotifyLevel_DEBUG) << "film pt      = " << film << std::endl;
-	}
-
-	if (theLensDistortion.valid())
-	{
-		ossimDpt filmOut;
-		theLensDistortion->undistort(film, filmOut);
-		film = filmOut;
-	}
-
-	ossimColumnVector3d cam_ray_dir (film.x,
-		film.y,
-		-theFocalLength);
-	ossimEcefVector     ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
-	ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
-
-	image_ray.setOrigin(theAdjEcefPlatformPosition);
-	image_ray.setDirection(ecf_ray_dir);
-
-	if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimBuckeyeSensor::imagingRay: ..... leaving" << std::endl;
-}
-
-void ossimBuckeyeSensor::lineSampleToWorld(const ossimDpt& image_point,
-	ossimGpt&       gpt) const
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleToWorld:entering..." << std::endl;
-
-	if(image_point.hasNans())
-	{
-		gpt.makeNan();
-		return;
-	}
-
-	//***
-	// Determine imaging ray and invoke elevation source object's services to
-	// intersect ray with terrain model:
-	//***
-
-	ossimEcefRay ray;
-	imagingRay(image_point, ray);
-	ossimElevManager::instance()->intersectRay(ray, gpt);
-
-	if (traceDebug())
-	{
-		ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
-		ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
-		ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
-	}
-
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleToWorld: returning..." << std::endl;
-	return;
-}
-
-void ossimBuckeyeSensor::lineSampleHeightToWorld(const ossimDpt& image_point,
-	const double&   heightEllipsoid,
-	ossimGpt&       worldPoint) const
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleHeightToWorld: entering..." << std::endl;
-	if (!insideImage(image_point))
-	{
-		worldPoint.makeNan();
-	}
-	else
-	{
-		//***
-		// First establish imaging ray from image point:
-		//***
-		ossimEcefRay ray;
-		imagingRay(image_point, ray);
-		ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
-		worldPoint = ossimGpt(Pecf);
-	}
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleHeightToWorld: returning..." << std::endl;
-}
-
-void ossimBuckeyeSensor::worldToLineSample(const ossimGpt& world_point,
-	ossimDpt&       image_point) const
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::worldToLineSample: entering..." << std::endl;
-	if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
-		(!theBoundGndPolygon.hasNans()))
-	{
-		if (!(theBoundGndPolygon.pointWithin(world_point)))
-		{
-			image_point.makeNan();
-			return;
-		}         
-	}
-	ossimEcefPoint g_ecf(world_point);
-	ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
-	ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
-
-
-	double scale = -theFocalLength/camRayDir[2];
-	ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
-
-	if (theLensDistortion.valid())
-	{
-		ossimDpt filmOut;
-		theLensDistortion->distort(film, filmOut);
-		film = filmOut;
-	}
-
-	ossimDpt f1(film + thePrincipalPoint);
-	ossimDpt p1(f1.x/thePixelSize.x,
-		-f1.y/thePixelSize.y);
-
-	ossimDpt p0 (p1.x + theRefImgPt.x,
-		p1.y + theRefImgPt.y);
-
-	image_point = p0;
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::worldToLineSample: returning..." << std::endl;
-}
-
-void ossimBuckeyeSensor::updateModel()
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: entering..." << std::endl;
-	ossimGpt gpt;
-	ossimGpt wgs84Pt;
-	double metersPerDegree = wgs84Pt.metersPerDegree().x;
-	double degreePerMeter = 1.0/metersPerDegree;
-	double latShift = -computeParameterOffset(1)*degreePerMeter;
-	double lonShift = computeParameterOffset(0)*degreePerMeter;
-
-	gpt = theEcefPlatformPosition;
-	double height = gpt.height();
-	gpt.height(height + computeParameterOffset(5));
-	gpt.latd(gpt.latd() + latShift);
-	gpt.lond(gpt.lond() + lonShift);
-	theAdjEcefPlatformPosition = gpt;
-	ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4));
-
-	// make a left handed rotational matrix;
-	ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
-	NEWMAT::Matrix orientation = (ossimMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), OSSIM_LEFT_HANDED)*
-		ossimMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), OSSIM_LEFT_HANDED));
-	theCompositeMatrix        = (lsrMatrix.getData()*orientation);
-	theCompositeMatrixInverse = theCompositeMatrix.i();
-
-	theBoundGndPolygon.resize(4);
-
-	theExtrapolateImageFlag = false;
-	theExtrapolateGroundFlag = false;
-
-   try
-   {
-      // Method throws ossimException.
-      computeGsd();
-   }
-   catch (const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimBuckeyeSensor Constructor caught Exception:\n"
-         << e.what() << std::endl;
-   }
-
-	lineSampleToWorld(theImageClipRect.ul(),gpt);
-	theBoundGndPolygon[0] = gpt;
-	lineSampleToWorld(theImageClipRect.ur(),gpt);
-	theBoundGndPolygon[1] = gpt;
-	lineSampleToWorld(theImageClipRect.lr(),gpt);
-	theBoundGndPolygon[2] = gpt;
-	lineSampleToWorld(theImageClipRect.ll(),gpt);
-	theBoundGndPolygon[3] = gpt;
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: returning..." << std::endl;
-}
-
-void ossimBuckeyeSensor::initAdjustableParameters()
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::initAdjustableParameters: entering..." << std::endl;
-	resizeAdjustableParameterArray(6);
-
-	setAdjustableParameter(0, 0.0);
-	setParameterDescription(0, "x_offset");
-	setParameterUnit(0, "pixels");
-
-	setAdjustableParameter(1, 0.0);
-	setParameterDescription(1, "y_offset");
-	setParameterUnit(1, "pixels");
-
-	setAdjustableParameter(2, 0.0);
-	setParameterDescription(2, "roll");
-	setParameterUnit(2, "degrees");
-
-	setAdjustableParameter(3, 0.0);
-	setParameterDescription(3, "pitch");
-	setParameterUnit(3, "degrees");
-
-	setAdjustableParameter(4, 0.0);
-	setParameterDescription(4, "heading");
-	setParameterUnit(4, "degrees");
-
-	setAdjustableParameter(5, 0.0);
-	setParameterDescription(5, "altitude");
-	setParameterUnit(5, "meters");
-
-	// TODO: default to correct default values, or just leave it up to the input file, since we have different offsets for the B100, 182, and Metroliner, also need a z offset
-	setParameterSigma(0, 1.0);
-	setParameterSigma(1, 1.0);
-	setParameterSigma(2, 0);
-	setParameterSigma(3, 0);
-	setParameterSigma(4, 0);
-	setParameterSigma(5, 1000);
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::initAdjustableParameters: returning..." << std::endl;
-}
-
-void ossimBuckeyeSensor::setLensDistortion(ossimSmacCallibrationSystem* lensDistortion)
-{
-	theLensDistortion = lensDistortion;
-	updateModel();
-}
-
-bool ossimBuckeyeSensor::saveState(ossimKeywordlist& kwl,
-	const char* prefix) const
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::saveState: entering..." << std::endl;
-	ossimSensorModel::saveState(kwl, prefix);
-
-	kwl.add(prefix, "type", "ossimBuckeyeSensor", true);
-
-	kwl.add(prefix, "roll", theRoll, true);
-	kwl.add(prefix, "pitch", thePitch, true);
-	kwl.add(prefix, "heading", theHeading, true);
-	kwl.add(prefix, "principal_point", "("+ossimString::toString(thePrincipalPoint.x) + "," + ossimString::toString(thePrincipalPoint.y)+")");
-	kwl.add(prefix, "pixel_size", "("+ossimString::toString(thePixelSize.x) + "," + ossimString::toString(thePixelSize.y)+")");
-	kwl.add(prefix, "focal_length", theFocalLength);
-	kwl.add(prefix, "ecef_platform_position",
-		ossimString::toString(theEcefPlatformPosition.x()) + " " +
-		ossimString::toString(theEcefPlatformPosition.y()) + " " +
-		ossimString::toString(theEcefPlatformPosition.z()));
-
-	if(theLensDistortion.valid())
-	{
-		ossimString lensPrefix = ossimString(prefix)+"distortion.";
-		theLensDistortion->saveState(kwl,
-			lensPrefix.c_str());
-	}
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::saveState: returning..." << std::endl;
-	return true;
-}
-
-bool ossimBuckeyeSensor::loadState(const ossimKeywordlist& kwl,
-	const char* prefix)
-{
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::loadState: entering..." << std::endl;
-
-	ossimSensorModel::loadState(kwl, prefix);
-
-   // If theRefImgPt remains unset by ossimSensorModel::loadState(), 
-   // set it to the image center.
-   if ( theRefImgPt == ossimDpt(0, 0) )
-   {
-      theRefImgPt = theImageClipRect.midPoint();
-   }
-
-	if(getNumberOfAdjustableParameters() < 1)
-	{
-		initAdjustableParameters();
-	}
-
-	ossimString framemeta_gsti = kwl.find(prefix, "framemeta_gsti");
-	ossimString framemeta = kwl.find(prefix,"framemeta");
-	ossimString frame_number = kwl.find(prefix, "frame_number");
-	ossimString pixel_size = kwl.find(prefix, "pixel_size");
-	ossimString principal_point = kwl.find(prefix, "principal_point");
-	ossimString focal_length = kwl.find(prefix, "focal_length");
-	ossimString smac_radial = kwl.find(prefix, "smac_radial");
-	ossimString smac_decent = kwl.find(prefix, "smac_decent");
-	ossimString roll;
-	ossimString pitch;
-	ossimString yaw;
-	ossimString platform_position;
-	ossimFilename file_to_load;
-
-	ossimString FRAME_STRING	= "Frame#";
-	ossimString ROLL_STRING		= "Roll(deg)";
-	ossimString PITCH_STRING	= "Pitch(deg)";
-	ossimString YAW_STRING		= "Yaw(deg)";
-	ossimString LAT_STRING		= "Lat(deg)";
-	ossimString LON_STRING		= "Lon(deg)";
-	ossimString HAE_STRING		= "HAE(m)";
-
-	// Deal with the fact that there are 3 different types of 'FrameMeta' file
-	if (framemeta_gsti.empty() && !framemeta.empty() && !frame_number.empty())
-	{
-		file_to_load.setFile(framemeta);
-		YAW_STRING	= "Azimuth(deg)";
-	}
-	else if (!framemeta_gsti.empty() && framemeta.empty() && !frame_number.empty())
-	{
-		file_to_load.setFile(framemeta_gsti);
-	}
-
-	if (file_to_load.exists() && !frame_number.empty())
-	{
-		ossimCsvFile csv(" \t"); // we will use tab or spaces as separator
-		if(csv.open(file_to_load))
-		{
-			if(csv.readHeader())
-			{
-				ossimCsvFile::StringListType heads = csv.fieldHeaderList();
-				// Try to see if you can find the first header item, if not, then you either have a file that doesn't work in this case, or it's uppercase
-				if (std::find(heads.begin(), heads.end(), FRAME_STRING) == heads.end())
-				{
-					FRAME_STRING	= FRAME_STRING.upcase();
-					ROLL_STRING		= ROLL_STRING.upcase();
-					PITCH_STRING	= PITCH_STRING.upcase();
-					YAW_STRING		= YAW_STRING.upcase();
-					LAT_STRING		= LAT_STRING.upcase();
-					LON_STRING		= LON_STRING.upcase();
-					HAE_STRING		= HAE_STRING.upcase();
-				}
-
-				ossimRefPtr<ossimCsvFile::Record> record;
-				bool foundFrameNumber = false;
-				while( ((record = csv.nextRecord()).valid()) && !foundFrameNumber)
-				{
-					if( (*record)[FRAME_STRING] == frame_number)
-					{
-						foundFrameNumber = true;
-						roll = (*record)[ROLL_STRING];
-						pitch = (*record)[PITCH_STRING];
-						yaw = (*record)[YAW_STRING];
-						platform_position = (*record)[LAT_STRING] + " " 
-							+ (*record)[LON_STRING]+ " "
-							+ (*record)[HAE_STRING] + " WGE";
-					}
-				}
-			}
-		}
-		csv.close();
-	}
-	else
-	{
-		roll = kwl.find(prefix, "roll"); 
-		pitch = kwl.find(prefix, "pitch"); 
-		yaw = kwl.find(prefix, "heading"); 
-		platform_position = kwl.find(prefix, "ecef_platform_position");
-	}
-
-	bool result = (!pixel_size.empty()&&
-		!principal_point.empty()&&
-		!focal_length.empty()&&
-		!platform_position.empty());
-
-	if(!focal_length.empty())
-	{
-		theFocalLength = focal_length.toDouble();
-	}
-	if(!pixel_size.empty())
-	{
-		thePixelSize.toPoint(pixel_size);
-	}
-	if(!roll.empty())
-	{
-		theRoll = roll.toDouble();
-	}
-	if(!pitch.empty())
-	{
-		thePitch = pitch.toDouble();
-	}
-	if(!yaw.empty())
-	{
-		theHeading   = yaw.toDouble();
-	}
-	if(!principal_point.empty())
-	{
-		thePrincipalPoint.toPoint(principal_point);
-	}
-	if(platform_position.contains("WGE"))
-	{
-		std::vector<ossimString> splitString;
-		ossimString tempString(platform_position);
-		tempString.split(splitString, ossimString(" "));
-		std::string datumString;
-		double lat=0.0, lon=0.0, h=0.0;
-		if(splitString.size() > 2)
-		{
-			lat = splitString[0].toDouble();
-			lon = splitString[1].toDouble();
-			h = splitString[2].toDouble();
-		}
-
-		theEcefPlatformPosition = ossimGpt(lat,lon,h);
-	} else {
-		std::vector<ossimString> splitString;
-		ossimString tempString(platform_position);
-		tempString.split(splitString, ossimString(" "));
-		std::string datumString;
-		double x=0.0, y=0.0, z=0.0;
-		if(splitString.size() > 2)
-		{
-			x = splitString[0].toDouble();
-			y = splitString[1].toDouble();
-			z = splitString[2].toDouble();
-		}
-		theEcefPlatformPosition = ossimEcefPoint(x, y, z);
-	}
-	theLensDistortion = 0;
-	if(!smac_radial.empty()&&
-		!smac_decent.empty())
-	{
-		std::vector<ossimString> radial;
-		std::vector<ossimString> decent;
-		smac_radial.split(radial, " ");
-		smac_decent.split(decent, " ");
-		if((radial.size() == 5)&&
-			(decent.size() == 4))
-		{
-			// Just for debugging really.. optimization will make this sleeker
-			double k0 = radial[0].toDouble();
-			double k1 = radial[1].toDouble();
-			double k2 = radial[2].toDouble();
-			double k3 = radial[3].toDouble();
-			double k4 = radial[4].toDouble();
-
-			double p0 = decent[0].toDouble();
-			double p1 = decent[1].toDouble();
-			double p2 = decent[2].toDouble();
-			double p3 = decent[3].toDouble();
-
-			theLensDistortion = new ossimSmacCallibrationSystem(k0,k1,k2,k3,k4,p0,p1,p2,p3);
-		}
-	}
-	theImageSize = ossimDpt(theImageClipRect.width(),
-		theImageClipRect.height());
-
-	updateModel();
-
-	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::loadState: returning..." << std::endl;
-	return result;
-}
-
-bool ossimBuckeyeSensor::setupOptimizer(const ossimString& init_file)
-{
-	ossimKeywordlist kwl;
-	kwl.addFile(init_file.c_str());
-
-	return loadState(kwl);
-}
-
-void ossimBuckeyeSensor::setPrincipalPoint(ossimDpt principalPoint)
-{
-	thePrincipalPoint = principalPoint;
-}
-
-void ossimBuckeyeSensor::setRollPitchHeading(double roll,
-	double pitch,
-	double heading)
-{
-	theRoll    = roll;
-	thePitch   = pitch;
-	theHeading = heading;
-
-	updateModel();
-}
-
-void ossimBuckeyeSensor::setPixelSize(const ossimDpt& pixelSize)
-{
-	thePixelSize = pixelSize;
-}
-
-void ossimBuckeyeSensor::setImageRect(const ossimDrect& rect)
-{
-	theImageClipRect = rect;
-	theRefImgPt = rect.midPoint();
-}
-
-void ossimBuckeyeSensor::setFocalLength(double focalLength)
-{
-	theFocalLength = focalLength;
-}
-
-void ossimBuckeyeSensor::setPlatformPosition(const ossimGpt& gpt)
-{
-	theRefGndPt             = gpt;
-	theEcefPlatformPosition = gpt;
-	updateModel();
-
-}
-
-bool ossimBuckeyeSensor::getImageGeometry( 
-    const ossimString& ref, const ossimString& value, 
-    ossimKeywordlist& geomKwl ) const
-{
-   if ( ref == ossimString( "parameters/fsmmgSensorImage/collectionTime" ) )
-   {
-      /* not currently used */
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/sensorType" ) )
-   {
-      /* not currently used */
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/focus/focalLength" ) )
-   {
-      geomKwl.add( "focal_length", value.toDouble() );
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/numberOfRowsInImage" ) )
-   {
-      /* Add check to value already set from limits/GridEnvelope/low,high: should be equal */
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/numberOfColumnsInImage" ) )
-   {
-      /* Add check to value already set from limits/GridEnvelope/low,high: should be equal */
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/rowSpacing" ) )
-   {
-      ossimDpt point = ossimDpt();
-      ossimString pixel_size = geomKwl.find( "pixel_size" );
-      if ( !pixel_size.empty() )
-      {
-         point.toPoint( pixel_size );
-      }
-      point.y = value.toDouble();
-      geomKwl.add( "pixel_size", point.toString().c_str() );
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/columnSpacing" ) )
-   {
-      ossimDpt point = ossimDpt();
-      ossimString pixel_size = geomKwl.find( "pixel_size" );
-      if ( !pixel_size.empty() )
-      {
-         point.toPoint( pixel_size );
-      }
-      point.x = value.toDouble();
-      geomKwl.add( "pixel_size", point.toString().c_str() );
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorImage/positionOrientationState/perspectiveCenter/geocentric-x-y-z" ) )
-   {
-      // first remove trailing spaces
-      size_t first_space = value.find_first_of( ' ', 0 );
-      ossimString truncatedValue = value.beforePos( first_space );
-      // change commas into spaces
-      ossimString platformPositionStr = truncatedValue.substitute( ossimString( "," ), ossimString( " " ), true );
-      // add to keywordlist
-      geomKwl.add( "ecef_platform_position", platformPositionStr );
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorImage/velocity/components/geocentric-x-y-z" ) )
-   {
-      /* not currently used */
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/principalPointOffset/components/imagePlaneCRS-x0-y0" ) )
-   {
-      ossimDpt principal_point_offset;
-      size_t first_comma = value.find_first_of( ',', 0 );
-      ossimString offsetxStr = value.beforePos( first_comma );
-      ossimString offsetyStr = value.afterPos( first_comma );
-      principal_point_offset.x = offsetxStr.toDouble();
-      principal_point_offset.y = offsetyStr.toDouble();
-      geomKwl.add( "principal_point", principal_point_offset.toString().c_str() );
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/radialDistortion/coefficients/k0-k1-k2-k3-k4" ) )
-   {
-      // first remove trailing spaces
-      size_t first_space = value.find_first_of( ' ', 0 );
-      ossimString truncatedValue = value.beforePos( first_space );
-      // change commas into spaces
-      ossimString radialDistortionStr = truncatedValue.substitute( ossimString( "," ), ossimString( " " ), true );
-      // add to keywordlist
-      geomKwl.add( "smac_radial", radialDistortionStr );
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgSensorSession/decenteringDistortion/coefficients/p0-p1-p2-p3" ) )
-   {
-      // first remove trailing spaces
-      size_t first_space = value.find_first_of( ' ', 0 );
-      ossimString truncatedValue = value.beforePos( first_space );
-      // change commas into spaces
-      ossimString decenteringDistortionStr = truncatedValue.substitute( ossimString( "," ), ossimString( " " ), true );
-      // add to keywordlist
-      geomKwl.add( "smac_decent", decenteringDistortionStr );
-   }
-   else
-   if ( ref == ossimString( "parameters/fsmmgPlatformImage/positionOrientationState/externalOrientation/platformCS-roll-pitch-yaw" ) )
-   {
-      size_t pos_comma = value.find_first_of( ',', 0 );
-      ossimString rollStr = value.beforePos( pos_comma );
-      ossimString remainderStr0 = value.afterPos( pos_comma );
-
-      pos_comma = remainderStr0.find_first_of( ',', 0 );
-      ossimString pitchStr = remainderStr0.beforePos( pos_comma );
-      ossimString remainderStr1 = remainderStr0.afterPos( pos_comma );
-
-      pos_comma = remainderStr1.find_first_of( ',', 0 );
-      ossimString yawStr = remainderStr1.beforePos( pos_comma );
-
-      geomKwl.add( "roll",    rollStr.toDouble() );
-      geomKwl.add( "pitch",   pitchStr.toDouble() );
-      geomKwl.add( "heading", yawStr.toDouble() );
-   }
-   else // need to add in all supported parameters from the primary SensorML document
-   {
-      /* Add debug message */
-      return false;
-   }
-
-   return true;
-}
-
diff --git a/ossim/src/ossim/projection/ossimCadrgProjection.cpp b/ossim/src/ossim/projection/ossimCadrgProjection.cpp
deleted file mode 100644
index b22e2e5..0000000
--- a/ossim/src/ossim/projection/ossimCadrgProjection.cpp
+++ /dev/null
@@ -1,424 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimCadrgProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-#include <ossim/projection/ossimCadrgProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimDatum.h>
-
-RTTI_DEF1(ossimCadrgProjection, "ossimCadrgProjection", ossimMapProjection)
-
-double ossimCadrgProjection::theOldZoneExtents[] = {0.0, 32.0, 48.0, 56.0, 64.0,
-                                                    68.0, 72.0, 76.0, 80.0, 90.0};
-double ossimCadrgProjection::theCadrgArcA[] = { 369664, 302592, 245760, 199168,
-					       163328, 137216, 110080, 82432 };
-
-double ossimCadrgProjection::theNorthLimit = 90.0*M_PI/180.0;
-double ossimCadrgProjection::theSouthLimit = -90.0*M_PI/180.0;
-
-ossimCadrgProjection::ossimCadrgProjection()
-   :ossimMapProjection(ossimEllipsoid(), ossimGpt()),
-    theCadrgZone(1),
-    theMapScale(5000000),
-    theWidth(0.0),
-    theHeight(0.0)
-{
-   computeParameters();
-}
-
-ossimCadrgProjection::~ossimCadrgProjection()
-{
-   
-}
-
-ossimObject *ossimCadrgProjection::dup()const
-{
-   return new ossimCadrgProjection(*this);
-}
-
-
-ossimDpt ossimCadrgProjection::worldToLineSample(const ossimGpt &worldPoint)    const
-{
-   ossimDpt lineSample;
-
-   worldToLineSample(worldPoint, lineSample);
-
-   return lineSample;
-}
-
-ossimGpt ossimCadrgProjection::inverse(const ossimDpt& /* eastingNorthing */)const
-{
-   double lat=0.0;
-   double lon=0.0;
-
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
-}
-
-ossimDpt ossimCadrgProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-   
-   return ossimDpt(easting, northing);
-}
-
-ossimGpt ossimCadrgProjection::lineSampleToWorld(const ossimDpt &projectedPoint)const
-{
-   ossimGpt worldPoint;
-
-   lineSampleToWorld(projectedPoint, worldPoint);
-
-   return worldPoint;
-}
-
-void ossimCadrgProjection::worldToLineSample(const ossimGpt &worldPoint,
-                                            ossimDpt&       lineSample)const
-{
-   double lat = worldPoint.latd();
-   double lon = worldPoint.lond();
-   double centerLat = theOrigin.latd();
-   double centerLon = theOrigin.lond()*DEG_PER_RAD;
-   
-   lineSample.y = (centerLat - lat)/90.0*thePixelConstant.y;
-   lineSample.x = (lon - centerLon)/360.0*thePixelConstant.x;
-
-   lineSample = lineSample - theUlLineSample;
-}
-
-void ossimCadrgProjection::lineSampleToWorld(const ossimDpt &projectedPoint,
-                                            ossimGpt& gpt)const
-{
-   gpt = theOrigin;
-
-
-   ossimDpt adjustedPixel(projectedPoint.x + theUlLineSample.x,
-                          projectedPoint.y + theUlLineSample.y);
-
-//   double lat = gpt.latd() - (90/thePixelConstant.y)*adjustedPixel.y;
-//   double lon = gpt.lond() + (360/thePixelConstant.x)*adjustedPixel.x;
-   double lat = gpt.latd() - (90/thePixelConstant.y)*adjustedPixel.y;
-   double lon = gpt.lond() + (360/thePixelConstant.x)*adjustedPixel.x;
-   
-   gpt.latd(lat);
-   gpt.lond(lon);
-
-   gpt.clampLat(-90, 90);
-   gpt.clampLon(-180, 180);
-}
-
-double ossimCadrgProjection::computeXPixConstant(double scale,
-                                                 long zone)const
-{
-   double adrgscale = 1000000/scale;
-   
-   // E-W pixel constant
-   double x_pix = (double) adrgscale*theCadrgArcA[zone-1] / 512.0;
-   
-   // Increase, if necessary, to the next highest integer value
-   x_pix = ceil(x_pix);
-   x_pix = x_pix * 1.33333;//(512*100)/(150*256);
-   
-   // Round the final result.
-   x_pix = ossim::round<int>(x_pix);
-   
-   return x_pix*256.0;
-   
-}
-
-double ossimCadrgProjection::computeYPixConstant(double scale)const
-{
-   double adrgscale = 1000000/scale;
-   const long CADRG_ARC_B = 400384;
-   
-   double y_pix = (double) adrgscale * CADRG_ARC_B / 512.0;
-   
-   // Increase, if necessary, to the next highest integer value
-   y_pix = ceil(y_pix);
-
-   y_pix = y_pix * 0.33333;//(512*100)/(4*150*256);
-   
-   // Round the final result.
-   y_pix = ossim::round<int>(y_pix);
-   
-   return y_pix*256.0;
-}
-
-void ossimCadrgProjection::computeParameters()
-{
-   theUlLineSample = ossimDpt(0,0);
-
-   thePixelConstant.y = computeYPixConstant(theMapScale);
-   thePixelConstant.x = computeXPixConstant(theMapScale,
-                                            theCadrgZone);
-   double height = theHeight;
-   double width  = theWidth;
-   
-   if(width > thePixelConstant.x)
-   {
-      width  = thePixelConstant.x;
-   }
-   
-   if(height > thePixelConstant.y)
-   {
-      height = thePixelConstant.y;
-   }
-
-
-   theUlLineSample.x = -width/2.0;
-   theUlLineSample.y = -height/2.0;
-}
-
-bool ossimCadrgProjection::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix)const
-{
-   bool result = ossimProjection::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           ossimKeywordNames::ZONE_KW,
-           theCadrgZone,
-           true);
-   
-   kwl.add(prefix,
-           "map_scale",
-           theMapScale,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_LINES_KW,
-           theHeight,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_SAMPLES_KW,
-           theWidth,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::UL_LAT_KW,
-           theUlGpt.latd(),
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::UL_LON_KW,
-           theUlGpt.lond(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::LL_LAT_KW,
-           theLlGpt.latd(),
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::LL_LON_KW,
-           theLlGpt.lond(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::LR_LAT_KW,
-           theLrGpt.latd(),
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::LR_LON_KW,
-           theLrGpt.lond(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::UR_LAT_KW,
-           theUrGpt.latd(),
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::UR_LON_KW,
-           theUrGpt.lond(),
-           true);
-
-  
-   
-   if(theDatum)
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::DATUM_KW,
-              theDatum->code(),
-              true);
-   }
-
-   return result;
-}
-
-
-bool ossimCadrgProjection::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   ossimProjection::loadState(kwl, prefix);
-
-   
-   const char* lookup = kwl.find(prefix, ossimKeywordNames::UL_LAT_KW);
-   if(lookup)
-   {
-      theUlGpt.latd(ossimString(lookup).toDouble());
-   }
-   else
-    {
-       theUlGpt.latd(90.0);
-    }
-
-    lookup = kwl.find(prefix, ossimKeywordNames::UL_LON_KW);
-    if(lookup)
-    {
-       theUlGpt.lond(ossimString(lookup).toDouble());
-    }
-    else
-    {
-       theUlGpt.lond(-180.0);
-    }
-
-    lookup = kwl.find(prefix, ossimKeywordNames::LL_LAT_KW);
-    if(lookup)
-    {
-       theLlGpt.latd(ossimString(lookup).toDouble());
-    }
-    else
-    {
-       theLlGpt.latd(0.0);
-    }
-
-    lookup = kwl.find(prefix, ossimKeywordNames::LL_LON_KW);
-    if(lookup)
-    {
-       theLlGpt.lond(ossimString(lookup).toDouble());
-    }
-   else
-   {
-      theLlGpt.lond(-180.0);
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::LR_LAT_KW);
-   if(lookup)
-   {
-      theLrGpt.latd(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      theLrGpt.latd(0.0);
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::LR_LON_KW);
-   if(lookup)
-   {
-      theLrGpt.lond(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      theLrGpt.lond(180.0);
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::LR_LAT_KW);
-   if(lookup)
-   {
-      theLrGpt.latd(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      theLrGpt.latd(0.0);
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::LR_LON_KW);
-   if(lookup)
-   {
-      theLrGpt.lond(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      theLrGpt.lond(180.0);
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::UR_LAT_KW);
-   if(lookup)
-   {
-      theUrGpt.latd(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      theUrGpt.latd(90.0);
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::UR_LON_KW);
-   if(lookup)
-   {
-      theUrGpt.lond(ossimString(lookup).toDouble());
-   }
-   else
-   {
-      theUrGpt.lond(180.0);
-   }
-
-   const char* zone = kwl.find(prefix,
-                               ossimKeywordNames::ZONE_KW);
-   if(zone)
-   {
-      theCadrgZone = ossimString(zone).toLong();
-   }
-   const char* mapScale = kwl.find(prefix,
-                                   "map_scale");
-   if(mapScale)
-   {
-      theMapScale = ossimString(mapScale).toDouble();
-   }
-   const char *height = kwl.find(prefix,
-                                 ossimKeywordNames::NUMBER_LINES_KW);
-   const char *width  = kwl.find(prefix,
-                                 ossimKeywordNames::NUMBER_SAMPLES_KW);
-   if(height)
-   {
-      theHeight = ossimString(height).toDouble();
-   }
-   
-   if(width)
-   {
-      theWidth  = ossimString(width).toDouble();
-   }
-
-   computeParameters();
-
-   return true;
-}
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimCadrgProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimCadrgProjection* p = PTR_CAST(ossimCadrgProjection, &proj);
-   if (!p) return false;
-
-   if (theUlGpt != p->theUlGpt) return false;
-   if (theLlGpt != p->theLlGpt) return false;
-   if (theLrGpt != p->theLrGpt) return false;
-   if (theUrGpt != p->theUrGpt) return false;
-   if (!ossim::almostEqual(theWidth,p->theWidth)) return false;
-   if (!ossim::almostEqual(theHeight,p->theHeight)) return false;
-   if (theCadrgZone != p->theCadrgZone) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimCoarseGridModel.cpp b/ossim/src/ossim/projection/ossimCoarseGridModel.cpp
deleted file mode 100644
index 1f37625..0000000
--- a/ossim/src/ossim/projection/ossimCoarseGridModel.cpp
+++ /dev/null
@@ -1,1049 +0,0 @@
-//*****************************************************************************
-// FILE: ossimCoarseGridModel.cc
-//
-// License:  See LICENSE.txt file in the top level directory.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimCoarseGridModel. This is an
-//   implementation of an interpolation sensor model. 
-//
-//   IMPORTANT: The lat/lon grid is for ground points on the ellipsoid.
-//   The dLat/dHgt and dLon/dHgt partials therefore are used against
-//   elevations relative to the ellipsoid.
-//
-//*****************************************************************************
-//  $Id: ossimCoarseGridModel.cpp 22825 2014-07-07 23:14:52Z dburken $
-
-#include <ossim/projection/ossimCoarseGridModel.h>
-
-RTTI_DEF1(ossimCoarseGridModel, "ossimCoarseGridModel", ossimSensorModel);
-
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimDatumFactory.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/support_data/ossimSupportFilesList.h>
-#include <cstdio>
-#include <fstream>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceExec  ("ossimCoarseGridModel:exec");
-static ossimTrace traceDebug ("ossimCoarseGridModel:debug");
-
-static const char* MODEL_TYPE = "ossimCoarseGridModel";
-static const char* GRID_FILE_NAME_KW = "grid_file_name";
-const ossimFilename DEFAULT_GEOM_FILE_EXT ("geom");
-const ossimFilename DEFAULT_GRID_FILE_EXT ("ocg");
-double ossimCoarseGridModel::theInterpolationError = .1;
-ossim_int32 ossimCoarseGridModel::theMinGridSpacing     = 100;
-
-//*****************************************************************************
-//  DEFAULT CONSTRUCTOR: ossimCoarseGridModel()
-//  
-//*****************************************************************************
-ossimCoarseGridModel::ossimCoarseGridModel()
-   :
-      ossimSensorModel(),
-      theDlatDparamGrid (0),
-      theDlonDparamGrid (0),
-      theHeightEnabledFlag(true)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel: entering..."
-      << std::endl;
-
-   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
-   theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
-   theLatGrid.enableExtrapolation();
-   theLonGrid.enableExtrapolation();
-
-   setErrorStatus();
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel: returning..."
-      << std::endl;
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: ossimCoarseGridModel(ossimCoarseGridModel)
-//  
-//*****************************************************************************
-ossimCoarseGridModel::ossimCoarseGridModel(const ossimCoarseGridModel& model)
-   :
-      ossimSensorModel  (model),
-      theGridFilename   (model.theGridFilename),
-      theLatGrid        (model.theLatGrid),
-      theLonGrid        (model.theLonGrid),
-      theDlatDhGrid     (model.theDlatDhGrid),
-      theDlonDhGrid     (model.theDlonDhGrid),
-      theDlatDparamGrid (0),
-      theDlonDparamGrid (0),
-      theHeightEnabledFlag(true)
-{
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(model): entering..."
-      << std::endl;
-
-   int numberOfParams = getNumberOfAdjustableParameters();
-   if(numberOfParams)
-   {
-      //***
-      // Allocate adjustable parameter partials grids then assign:
-      //***
-      theDlatDparamGrid = new ossimDblGrid [numberOfParams];
-      theDlonDparamGrid = new ossimDblGrid [numberOfParams];
-      
-      for (int i=0; i<numberOfParams; i++)
-      {
-         theDlatDparamGrid[i] = model.theDlatDparamGrid[i];
-         theDlonDparamGrid[i] = model.theDlonDparamGrid[i];
-      }
-   }
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel: returning..."
-      << std::endl;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimCoarseGridModel(filename)
-//  
-//  Constructs model from geometry file
-//  
-//*****************************************************************************
-ossimCoarseGridModel::ossimCoarseGridModel(const ossimFilename& geom_file)
-   :
-      ossimSensorModel(),
-      theDlatDparamGrid (0),
-      theDlonDparamGrid (0),
-      theHeightEnabledFlag(true)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(geom_file): entering..." << std::endl;
-   
-   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
-   theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
-   theLatGrid.enableExtrapolation();
-   theLonGrid.enableExtrapolation();
-
-   ossimKeywordlist kwl;
-   if(geom_file.exists()&&kwl.addFile(geom_file))
-   {
-      loadState(kwl);
-   }
-   else
-   {
-      ++theErrorStatus;
-   }
-
-   if (traceExec())   ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(geom_file): returning..." << std::endl;
-   return;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimCoarseGridModel(kwl)
-//  
-//  Constructs model from keywordlist geometry file
-//  
-//*****************************************************************************
-ossimCoarseGridModel::ossimCoarseGridModel(const ossimKeywordlist& geom_kwl)
-   :
-      ossimSensorModel(),
-      theDlatDparamGrid (0),
-      theDlonDparamGrid (0),
-      theHeightEnabledFlag(true)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(geom_kwl): entering..." << std::endl;
-
-   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
-   theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
-   theLatGrid.enableExtrapolation();
-   theLonGrid.enableExtrapolation();
-
-  // Parse keywordlist for geometry:
-   loadState(geom_kwl);
-}
-
-//*************************************************************************************************
-//! Assigns the grid data given a projection (typically a rigorous sensor model)
-//*************************************************************************************************
-void ossimCoarseGridModel::buildGrid(const ossimDrect& imageBounds,
-                                     ossimProjection* proj,
-                                     double heightDelta,
-                                     bool enableHeightFlag,
-                                     bool makeAdjustableFlag)
-{
-   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
-   geom->setProjection(proj);
-   buildGrid(imageBounds, geom.get(), heightDelta, enableHeightFlag, makeAdjustableFlag);
-}  
-
-
-//*************************************************************************************************
-//! Assigns the grid data given a geometry
-//*************************************************************************************************
-void ossimCoarseGridModel::buildGrid(const ossimDrect& imageBounds,
-                                     ossimImageGeometry* geom,
-                                     double heightDelta,
-                                     bool enableHeightFlag,
-                                     bool makeAdjustableFlag)
-{
-   theHeightEnabledFlag =  enableHeightFlag;
-   
-   if (!geom->getProjection() || imageBounds.hasNans())
-      return;
-
-   // don't let it get any smaller than 100, 100 pixels
-   // on the input projector
-   //
-   // may want this to be adjusted by outside
-   //
-   const ossimDatum* targetDatum = ossimDatumFactory::instance()->wgs84();
-   ossimIpt gridSize(2,2);
-   ossimDpt gridOrigin(0,0);
-   ossimGpt gpt;
-   ossimGpt gpt2;
-   ossimGpt bilinearGpt;
-   resizeAdjustableParameterArray(0);
-   double normSplit = 1.0;
-   ossimIpt imageSize = ossimIpt(imageBounds.width(), imageBounds.height());
-   double error = 0.0;
-
-   ossimIpt imageOrigin = imageBounds.ul();
-   ossimDpt spacing ((double)(imageBounds.width()-1)/(gridSize.x-1),
-      (double)(imageBounds.height()-1)/(gridSize.y-1));
-
-   if(theDlatDparamGrid)
-   {
-      delete [] theDlatDparamGrid;
-      theDlatDparamGrid = NULL;
-   }
-   if(theDlonDparamGrid)
-   {
-      delete [] theDlonDparamGrid;
-      theDlonDparamGrid = NULL;
-   }
-
-   geom->localToWorld(imageBounds.midPoint(), gpt);
-
-   do
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "Checking grid size " << gridSize << std::endl;
-      }
-
-      spacing = ossimDpt((double)(imageBounds.width()-1)/(gridSize.x-1),
-         (double)(imageBounds.height()-1)/(gridSize.y-1));
-
-      theLatGrid.setNullValue(ossim::nan());
-      theLonGrid.setNullValue(ossim::nan());
-      theDlatDhGrid.setNullValue(0.0);
-      theDlonDhGrid.setNullValue(0.0);
-      theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
-      theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
-      theLatGrid.initialize(gridSize, gridOrigin, spacing);
-      theLonGrid.initialize(gridSize, gridOrigin, spacing);
-      theDlatDhGrid.initialize(gridSize, gridOrigin, spacing);
-      theDlonDhGrid.initialize(gridSize, gridOrigin, spacing);
-      ossim_int32 x, y;
-
-      for(y = 0; y < gridSize.y; ++y)
-      {
-         for(x = 0; x < gridSize.x; ++x)
-         {
-            ossimDpt norm((double)x/(double)(gridSize.x-1),
-               (double)y/(double)(gridSize.y-1));
-
-            ossimDpt pt(imageOrigin.x + norm.x*(imageSize.x-1),
-               imageOrigin.y + norm.y*(imageSize.y-1));
-
-            geom->localToWorld(pt, gpt);
-            double h = gpt.height();
-            if(ossim::isnan(h))
-            {
-               h += heightDelta;
-            }
-            ossimDpt fullPt;
-            geom->rnToFull(pt, 0, fullPt);
-            geom->getProjection()->lineSampleHeightToWorld(fullPt, h, gpt2);
-            gpt.changeDatum(targetDatum);
-            gpt2.changeDatum(targetDatum);
-
-            theLatGrid.setNode(x, y, gpt.latd());
-            theLonGrid.setNode(x, y, gpt.lond());
-
-            theDlatDhGrid.setNode(x, y, (gpt2.latd() - gpt.latd())/heightDelta);
-            theDlonDhGrid.setNode(x, y, (gpt2.lond() - gpt.lond())/heightDelta);
-         }
-      }
-      ossim_int32 upperY = 2*gridSize.y;
-      ossim_int32 upperX = 2*gridSize.x;
-      error = 0.0;
-
-      // Set all base-class data members needed for subsequent calls to projection code:
-      initializeModelParams(imageBounds);
-
-      for(y = 0; ((y < upperY)&&(error < theInterpolationError)); ++y)
-      {
-         for(x = 0; ((x < upperX)&&(error<theInterpolationError)); ++x)
-         {
-            ossimDpt norm((double)x/(double)(upperX-1),
-               (double)y/(double)(upperY-1));
-
-            ossimDpt imagePoint(imageOrigin.x + norm.x*(imageSize.x-1),
-               imageOrigin.y + norm.y*(imageSize.y-1));
-            ossimDpt testIpt;
-
-            geom->localToWorld(imagePoint, gpt);
-            worldToLineSample(gpt, testIpt);
-            error = (testIpt-imagePoint).length();
-         }
-      }
-
-      gridSize.x *= 2;
-      gridSize.y *= 2;
-      normSplit *= .5;
-   } while((error > theInterpolationError) &&
-           ((imageSize.x*normSplit) > theMinGridSpacing) &&
-           ((imageSize.y*normSplit) > theMinGridSpacing));
-
-   gridSize = theLatGrid.size();
-
-   ossimAdjustableParameterInterface* adjustableParameters = 
-      PTR_CAST(ossimAdjustableParameterInterface, geom->getProjection());
-   removeAllAdjustments();
-   if(adjustableParameters&&makeAdjustableFlag)
-   {
-      if(adjustableParameters->getNumberOfAdjustableParameters() > 0)
-      {
-         newAdjustment(adjustableParameters->getNumberOfAdjustableParameters());
-
-         int numberOfParams = getNumberOfAdjustableParameters();
-         if(numberOfParams)
-         {
-            //***
-            // Allocate adjustable parameter partials grids then assign:
-            //***
-            theDlatDparamGrid = new ossimDblGrid [numberOfParams];
-            theDlonDparamGrid = new ossimDblGrid [numberOfParams];
-            for(int paramIdx = 0; paramIdx < numberOfParams; ++ paramIdx)
-            {
-               theDlonDparamGrid[paramIdx].setNullValue(0.0);
-               theDlatDparamGrid[paramIdx].setNullValue(0.0);
-               theDlatDparamGrid[paramIdx].initialize(gridSize, gridOrigin, spacing);
-               theDlonDparamGrid[paramIdx].initialize(gridSize, gridOrigin, spacing);
-               setAdjustableParameter(paramIdx, 0.0);
-               setParameterSigma(paramIdx, adjustableParameters->getParameterSigma(paramIdx));
-               setParameterUnit(paramIdx, adjustableParameters->getParameterUnit(paramIdx));
-               setParameterCenter(paramIdx, 0.0);
-               setParameterDescription(paramIdx,
-                  adjustableParameters->getParameterDescription(paramIdx));
-
-               double oldParameter = adjustableParameters->getAdjustableParameter(paramIdx);
-               adjustableParameters->setAdjustableParameter(paramIdx, 1.0, true);
-               double adjust = adjustableParameters->computeParameterOffset(paramIdx);
-               double deltaLat = 0;
-               double deltaLon = 0;
-               if(adjust != 0.0)
-               {
-                  for(int y = 0; y < gridSize.y; ++y)
-                  {
-                     for(int x = 0; x < gridSize.x; ++x)
-                     {
-                        ossimDpt norm((double)x/(double)(gridSize.x-1),
-                           (double)y/(double)(gridSize.y-1));
-
-                        ossimDpt pt(imageOrigin.x + norm.x*(imageSize.x-1),
-                           imageOrigin.y + norm.y*(imageSize.y-1));
-                        geom->localToWorld(pt, gpt);
-
-                        gpt.changeDatum(targetDatum);
-                        gpt2.latd(theLatGrid(pt));
-                        gpt2.lond(theLonGrid(pt));
-                        deltaLat = gpt.latd()-gpt2.latd();
-                        deltaLon = gpt.lond()-gpt2.lond();
-
-                        theDlatDparamGrid[paramIdx].setNode(x, y, deltaLat/adjust);
-                        theDlonDparamGrid[paramIdx].setNode(x, y, deltaLon/adjust);
-                     }
-                  }
-
-                  // The partials grids for this parameter are initialized, now initialize the
-                  // grid's extrapolator:
-                  theDlatDparamGrid[paramIdx].enableExtrapolation();
-                  theDlonDparamGrid[paramIdx].enableExtrapolation();
-               }
-               adjustableParameters->setAdjustableParameter(paramIdx, oldParameter, true);
-            }
-         }
-      }
-   }
-   getAdjustment(theInitialAdjustment);
-
-
-}
-
-void ossimCoarseGridModel::setInterpolationError(double error)
-{
-   theInterpolationError = error;
-}
-
-void ossimCoarseGridModel::setMinGridSpacing(ossim_int32 minSpacing)
-{
-   theMinGridSpacing = minSpacing;
-}
-
-//*************************************************************************************************
-//! Initializes base class data members after grids have been assigned.
-//! It is assumed that theImageSize and the origin image point were already set.
-//*************************************************************************************************
-void ossimCoarseGridModel::initializeModelParams(ossimIrect imageBounds)
-{
-   // NOTE: it is assumed that the grid size and spacing is the same for ALL grids:
-   ossimIpt gridSize (theLatGrid.size());
-   ossimDpt spacing  (theLatGrid.spacing());
-   ossimDpt v[4];
-   v[0].lat = theLatGrid.getNode(0,0);
-   v[0].lon = theLonGrid.getNode(0,0);
-   v[1].lat = theLatGrid.getNode(gridSize.x-1, 0);
-   v[1].lon = theLonGrid.getNode(gridSize.x-1, 0);
-   v[2].lat = theLatGrid.getNode(gridSize.x-1, gridSize.y-1);
-   v[2].lon = theLonGrid.getNode(gridSize.x-1, gridSize.y-1);
-   v[3].lat = theLatGrid.getNode(0, gridSize.y-1);
-   v[3].lon = theLonGrid.getNode(0, gridSize.y-1);
-
-   // Guaranty longitude values are -180 to 180
-   for (int i=0; i<4; i++)
-   {
-      if (v[i].lon > 180.0)
-         v[i].lon -= 360.0;
-   }
-
-   theBoundGndPolygon = ossimPolygon(4, v);
-   
-   theImageSize  = ossimDpt(imageBounds.width(), imageBounds.height());
-   theRefImgPt   = imageBounds.midPoint();
-   theRefGndPt.lat = theLatGrid(theRefImgPt);
-   theRefGndPt.lon = theLonGrid(theRefImgPt);
-   
-   ossimDpt ref_ip_dx (theRefImgPt.x+1.0, theRefImgPt.y    );
-   ossimDpt ref_ip_dy (theRefImgPt.x    , theRefImgPt.y+1.0);
-   ossimGpt ref_gp_dx (theLatGrid(ref_ip_dx), theLonGrid(ref_ip_dx));
-   ossimGpt ref_gp_dy (theLatGrid(ref_ip_dy), theLonGrid(ref_ip_dy));
-
-   theGSD.x   = theRefGndPt.distanceTo(ref_gp_dx);
-   theGSD.y   = theRefGndPt.distanceTo(ref_gp_dy);
-
-   theMeanGSD = (theGSD.line + theGSD.samp)/2.0;
-   theImageClipRect  = imageBounds;
-   theSubImageOffset = imageBounds.ul();
-}
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimCoarseGridModel()
-//  
-//*****************************************************************************
-ossimCoarseGridModel::~ossimCoarseGridModel()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimCoarseGridModel::~ossimCoarseGridModel: entering..."
-      << std::endl;
-
-   if(theDlatDparamGrid&&theDlonDparamGrid)
-   {
-      //***
-      // Deallocate memory:
-      //***
-      delete [] theDlatDparamGrid;
-      delete [] theDlonDparamGrid;
-      theDlatDparamGrid = NULL;
-      theDlonDparamGrid = NULL;
-   }
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimCoarseGridModel::~ossimCoarseGridModel: returning..."
-      << std::endl;
-}
-
-//*************************************************************************************************
-// METHOD
-//*************************************************************************************************
-void ossimCoarseGridModel::lineSampleToWorld(const ossimDpt& image_point,
-                                             ossimGpt&       gpt) const
-{
-   if(!theHeightEnabledFlag)
-   {
-      //
-      // Extrapolate if image point is outside image:
-      //
-      if (!insideImage(image_point))
-      {
-         gpt = extrapolate(image_point);
-         return;
-      }
-      
-      lineSampleHeightToWorld(image_point, 0.0, gpt);
-   }
-   else
-   {
-      ossimSensorModel::lineSampleToWorld(image_point, gpt);
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimCoarseGridModel::lineSampleHeightToWorld()
-//  
-//  Establishes the ground point corresponding to the input image_point and
-//  specified elevation above MSL
-//
-//*****************************************************************************
-void
-ossimCoarseGridModel::lineSampleHeightToWorld(const ossimDpt& lineSampPt,
-                                              const double&   arg_hgt_above_ellipsoid,
-                                              ossimGpt&       worldPt) const
-{
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::lineSampleHeightToWorld: entering..." << std::endl;
-   
-   if(theLatGrid.size().x < 1 ||
-      theLatGrid.size().y < 1)
-   {
-      worldPt.makeNan();
-      return;
-   }
-
-   double height = (ossim::isnan(arg_hgt_above_ellipsoid)) ? 0.0 : arg_hgt_above_ellipsoid;
-
-   // Note that there is no check for image point outside of valid image rect because this model
-   // uses the extrapolation inherent to the ossimDblGrid.
-
-   // The image point may correspond to an offset sub-image. Need to convert
-   // to full image space before anything:
-   ossimDpt ip = lineSampPt + theSubImageOffset;
-   
-   // Establish the interpolated values from the grids:
-   worldPt.lat = theLatGrid(ip);
-   worldPt.lon = theLonGrid(ip);
-   worldPt.hgt = height;
-
-   if(theHeightEnabledFlag)
-   {
-      // Adjust horizontally due to elevation:
-      worldPt.lat += theDlatDhGrid(ip)*height;
-      worldPt.lon += theDlonDhGrid(ip)*height;
-   }
-   int numberOfParams = getNumberOfAdjustableParameters();
- 
-   // Now add increments due to adjustable parameter deltas:
-   for (int p=0; p<numberOfParams; p++)
-   {
-       worldPt.lat += (theDlatDparamGrid[p](ip) * computeParameterOffset(p));
-       worldPt.lon += (theDlonDparamGrid[p](ip) * computeParameterOffset(p));
-   }
-
-   worldPt.limitLonTo180();
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::lineSampleHeightToWorld: returning..." << std::endl;
-}
-
-//*************************************************************************************************
-// METHOD
-//*************************************************************************************************
-void ossimCoarseGridModel::initAdjustableParameters()
-{
-   if(getNumberOfAdjustableParameters() < 1)
-   {
-      addAdjustment(theInitialAdjustment, true);
-   }
-   else
-   {
-      setAdjustment(theInitialAdjustment, true);
-   }
-}
-
-//*************************************************************************************************
-// METHOD
-//*************************************************************************************************
-void ossimCoarseGridModel::imagingRay(const ossimDpt& image_point,
-                                      ossimEcefRay&   image_ray) const
-{
-   ossimSensorModel::imagingRay(image_point, image_ray);
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimCoarseGridModel::print()
-//  
-//  Formatted dump of data members.
-//  
-//*****************************************************************************
-std::ostream& ossimCoarseGridModel::print(std::ostream& out) const 
-{
-   out << "\nDump of ossimCoarseGridModel object at: " << this << "\n"
-       << "\n           Grid File Name: " << theGridFilename 
-       << "\n                 Image ID: " << theImageID 
-       << "\n                   Sensor: " << theSensorID
-       << "\n  Image Size (rows, cols): " << theImageSize
-       << "\n      Ref Pt (samp, line): " << theRefImgPt 
-       << "\n   Ref Pt (lat, lon, hgt): " << theRefGndPt 
-       << "\n           GSD (row, col): " << theGSD 
-       << "\n  Bounding Ground Polygon: " << theBoundGndPolygon << endl;
-//      << "\n         Number of Params: " << theNumParams << "\n"<<endl;
-   
-   char buf[256];
-   ossimIpt size (theLatGrid.size());
-   ossimDpt spacing (theLatGrid.spacing());
-   int line, samp;
-   ossimIpt node;
-   
-   out << "[ line,  samp]        lat        lon         dLat/dH      dLon/dH\n"
-       << "-------------------------------------------------------------------"
-       <<endl;
-
-   for (node.y=0; node.y<size.y; node.y++)
-   {
-      line = (int) (node.y*spacing.y);
-      
-      for (node.x=0; node.x<size.x; node.x++)
-      {
-         samp = (int) (node.x*spacing.x);
-         
-         sprintf(buf, "[%5d, %5d]    %+9.5f  %+10.5f    %+11.4e  %+11.4e",
-                  line, samp,
-                  theLatGrid.getNode(node),
-                  theLonGrid.getNode(node),
-                  theDlatDhGrid.getNode(node),
-                  theDlonDhGrid.getNode(node));
-         out << buf << endl;
-      }
-      out <<"-----------------------------------------------------------------"
-          <<endl;
-   }
-
-   out << "\n\nDump of lat/lon Partials w.r.t. Adjustable Parameters:"<<endl;
-   out << "\nEnd Dump of ossimCoarseGridModel.\n" <<  endl;
-   return out;
-}
-
-//*****************************************************************************
-//  METHOD: ossimCoarseGridModel::saveState()
-//  
-//  Saves the model state to the KWL. This KWL also serves as a geometry file.
-//
-//  Returns true if successful.
-//  
-//*****************************************************************************
-bool ossimCoarseGridModel::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveState: entering..." << std::endl;
-
-   kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimCoarseGridModel");
-
-   //---
-   // Save just the file part so that the geometry stuff is relocatable.
-   // Code was added to ossimProjectionFactoryBase::createProjectionFromGeometryFile
-   // to handle this.
-   //---
-   kwl.add( prefix, GRID_FILE_NAME_KW, theGridFilename.file() );
-   
-   kwl.add(prefix, "height_enabled_flag", theHeightEnabledFlag, true);
-   ossimSensorModel::saveState(kwl, prefix);
-   ossimString initAdjPrefix = ossimString(prefix) + "init_adjustment.";
-   theInitialAdjustment.saveState(kwl, initAdjPrefix);
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveState: returning..." << std::endl;
-
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimCoarseGridModel::loadState()
-//  
-//  Restores the model's state from the KWL. This KWL also serves as a
-//  geometry file.
-//
-//  Returns true if successful.
-//  
-//*****************************************************************************
-bool ossimCoarseGridModel::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix) 
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: entering..." << std::endl;
-
-   clearErrorStatus();
-   const char* value;
-   bool success;
-   
-   //***
-   // Assure this keywordlist contains correct type info:
-   //***
-   value = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   if (!value || (strcmp(value, "ossimCoarseGridModel")))
-   {
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState:  returning..." << std::endl;
-      theErrorStatus++;
-      return false;
-   }
-   value = kwl.find(prefix, "height_enabled_flag");
-   if(value)
-   {
-      theHeightEnabledFlag = ossimString(value).toBool();
-   }
-
-   //***
-   // Pass on to the base-class for parsing first:
-   //***
-   success = ossimSensorModel::loadState(kwl, prefix);
-   if (!success)
-   {
-      theErrorStatus++;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: returning with error..." << std::endl;
-      return false;
-   }
-
-   //***
-   // Look for geom filename or explicit grid filename to establish path to grid:
-   //***
-   theGridFilename = kwl.find(prefix, GRID_FILE_NAME_KW);
-
-   if (!theGridFilename.isReadable())
-   {
-      //---
-      // This is set in ossimProjectionFactoryBase::createProjectionFromGeometryFile
-      // so we can derive the dot.ocg from it.
-      //---
-      ossimFilename alt_path_to_grid = kwl.find("kwl_source");
-      theGridFilename = alt_path_to_grid.setExtension(DEFAULT_GRID_FILE_EXT);
-      
-      if (!theGridFilename.isReadable())
-      {
-         ossimFilename alt_path_to_grid = kwl.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
-         theGridFilename = alt_path_to_grid.setExtension(DEFAULT_GRID_FILE_EXT);
-      }
-   }
-   
-   if (!theGridFilename.isReadable())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "ossimCoarseGridModel::loadState() -- Error "
-         "encountered opening coarse grid file at "<< "<" <<theGridFilename << ">." << std::endl;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: returning with error..." << std::endl;
-      theErrorStatus++;
-      return false;
-   }
-
-   // Load the coarse grid file specified in KWL. This method resets the
-   // theErrorStatus to OSSIM_OK if successful:
-   if (!loadCoarseGrid(theGridFilename))
-   {
-      theErrorStatus++;
-      return false;
-   }
-
-   // Add the coarse grid filename to list of support files being referenced for logging purposes:
-   ossimSupportFilesList::instance()->add(theGridFilename.expand());
-
-   ossimString initAdjPrefix = ossimString(prefix) + "init_adjustment.";
-   theInitialAdjustment.loadState(kwl, initAdjPrefix.c_str());
-
-   if((ossim::isnan(theRefGndPt.hgt)) ||
-      (theRefGndPt.hgt == 0))
-   {
-      theRefGndPt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(theRefGndPt);
-      if(theRefGndPt.hgt < 0)
-      {
-         theRefGndPt.hgt = fabs(theRefGndPt.hgt);
-      }
-   }
-      
-   if(theInitialAdjustment.getNumberOfAdjustableParameters() < 1)
-   {
-      getAdjustment(theInitialAdjustment);
-   }
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: returning..." << std::endl;
-   if (theErrorStatus)
-      return false;
-   
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimCoarseGridModel::saveCoarseGrid(cgFileName)
-//  
-//  Saves the coarse grid to disk file.
-//
-//  Returns true if successful.
-//  
-//*****************************************************************************
-bool ossimCoarseGridModel::saveCoarseGrid(const ossimFilename& fileName)const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: entering..." << std::endl;
-
-   // Create and open grid file as stream:
-   theGridFilename = fileName.expand();
-   theGridFilename.setExtension(DEFAULT_GRID_FILE_EXT);
-   ofstream outstream (theGridFilename.chars());
-   if (!outstream.is_open())
-   {
-      theErrorStatus++;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: Error "
-         "encountered creating coarse grid file <" << theGridFilename<< ">. Check that directory "
-         "exists and is writable." << std::endl;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: returning with error..." << std::endl;
-      return false;
-   }
-
-   // Let each grid object write itself to the output file:
-   theLatGrid.save(outstream, "Latitude Grid");
-   theLonGrid.save(outstream, "Longitude Grid");
-   theDlatDhGrid.save(outstream, "dLat/dH Grid");
-   theDlonDhGrid.save(outstream, "dLon_dH Grid");
-
-   ossimString descr;
-   int numberOfParams = getNumberOfAdjustableParameters();
-   for (int p=0; p<numberOfParams; p++)
-   {
-      descr = getParameterDescription(p) + " dLat_dParam Grid";
-      theDlatDparamGrid[p].save(outstream, descr.chars());
-      descr = getParameterDescription(p) + " dLon_dParam Grid";
-      theDlonDparamGrid[p].save(outstream, descr.chars());
-   }
-   
-   // Since the geom file is needed in the same path as the grid file, take this opportunity to 
-   // write the geom file out as well:
-   ossimFilename geom_file (theGridFilename);
-   geom_file.setExtension(DEFAULT_GEOM_FILE_EXT);
-   ossimKeywordlist kwl;
-   saveState(kwl);
-   kwl.write(geom_file);
-
-   // Add to the list of support files referenced (though technically it has not yet been 
-   // referenced, but will be next time this image is opened):
-   ossimSupportFilesList::instance()->add(geom_file);
-   ossimSupportFilesList::instance()->add(theGridFilename);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: returning..." << std::endl;
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimCoarseGridModel::loadCoarseGrid(cgFileName)
-//  
-//  Loads the coarse grid from disk file.
-//
-//  Returns true if successful.
-//  
-//*****************************************************************************
-bool ossimCoarseGridModel::loadCoarseGrid(const ossimFilename& cgFileName)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadCoarseGrid: entering..." << std::endl;
-
-   ossimDpt v[4];
-   ossimIpt grid_size;
-
-   //***
-   // Open existing grid file:
-   //***
-   ifstream instream (cgFileName.chars());
-   if (!instream.is_open())
-   {
-      theErrorStatus++;
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimCoarseGridModel::loadCoarseGrid: Error encountered opening coarse grid file <" << cgFileName
-         << ">. Check that the file exists and is readable." << std::endl;
-      }
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "CEBUG ossimCoarseGridModel::loadCoarseGrid: returning with error..." << std::endl;
-      return false;
-   }
-   theGridFilename = cgFileName;
-   if(theDlatDparamGrid)
-     {
-       delete [] theDlatDparamGrid;
-       theDlatDparamGrid = NULL;
-     }
-   if(theDlonDparamGrid)
-     {
-       delete [] theDlonDparamGrid;
-       theDlonDparamGrid = NULL;
-     }
-   //
-   // Reallocate memory:
-   //
-   int numberOfParams = getNumberOfAdjustableParameters();
-   if(numberOfParams)
-   {
-      theDlatDparamGrid = new ossimDblGrid [numberOfParams];
-      theDlonDparamGrid = new ossimDblGrid [numberOfParams];
-   }
-   //***
-   // Let each grid object read itself from the input file:
-   //***
-   if (!theLatGrid.load(instream))
-   {
-      ++theErrorStatus;
-      return false;
-   }
-   if (!theLonGrid.load(instream))
-   {
-      ++theErrorStatus;
-      return false;
-   }
-   if (!theDlatDhGrid.load(instream))
-   {
-      ++theErrorStatus;
-      return false;
-   }
-   if (!theDlonDhGrid.load(instream))
-   {
-      ++theErrorStatus;
-      return false;
-   }
-
-   for (int p=0; p<numberOfParams; p++)
-   {
-      if (!theDlatDparamGrid[p].load(instream))
-      {
-         ++theErrorStatus;
-         return false;
-      }
-      if (!theDlonDparamGrid[p].load(instream))
-      {
-         ++theErrorStatus;
-         return false;
-      }
-   }
-
-   //***
-   // Initialize the bounding ground rectangle:
-   //***
-   grid_size = theLatGrid.size();
-
-   v[0].lat = theLatGrid(0,0);
-   v[0].lon = theLonGrid(0,0);
-   v[1].lat = theLatGrid(theImageSize.x-1, 0);
-   v[1].lon = theLonGrid(theImageSize.x-1, 0);
-   v[2].lat = theLatGrid(theImageSize.x-1, theImageSize.y-1);
-   v[2].lon = theLonGrid(theImageSize.x-1, theImageSize.y-1);
-   v[3].lat = theLatGrid(0, theImageSize.y-1);
-   v[3].lon = theLonGrid(0, theImageSize.y-1);
-
-   theBoundGndPolygon = ossimPolygon(4, v);
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadCoarseGrid: returning..." << std::endl;
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimCoarseGridModel::reallocateGrid()
-//  
-//  Deletes existing grid arrays and allocates new ones.
-//  
-//*****************************************************************************
-void ossimCoarseGridModel::reallocateGrid(const ossimIpt& grid_size)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::reallocateGrid:entering..." << endl;
-
-
-   //***
-   // Deallocate memory:
-   //***
-   if(theDlatDparamGrid)
-     {
-       delete [] theDlatDparamGrid;
-       theDlatDparamGrid = NULL;
-     }
-   if(theDlonDparamGrid)
-     {
-       delete [] theDlonDparamGrid;
-       theDlonDparamGrid = NULL;
-     }
-   //***
-   // determine grid spacing given new info:
-   //***
-   ossimDpt spacing ((double)(theImageSize.x-1)/(double)(grid_size.x-1),
-                     (double)(theImageSize.y-1)/(double)(grid_size.y-1));
-
-   //***
-   // Allocate all:
-   //***
-   ossimDpt grid_origin(0.0, 0.0);
-   theLatGrid.setNullValue(ossim::nan());
-   theLonGrid.setNullValue(ossim::nan());
-   theDlatDhGrid.setNullValue(0.0);
-   theDlonDhGrid.setNullValue(0.0);
-   theLatGrid.initialize(grid_size, grid_origin, spacing);
-   theLonGrid.initialize(grid_size, grid_origin, spacing);
-   theDlatDhGrid.initialize(grid_size, grid_origin, spacing);
-   theDlonDhGrid.initialize(grid_size, grid_origin, spacing);
-   
-   int numberOfParams = getNumberOfAdjustableParameters();
-   if(numberOfParams)
-   {
-      
-      theDlatDparamGrid = new ossimDblGrid [numberOfParams];
-      theDlonDparamGrid = new ossimDblGrid [numberOfParams];
-   }
-   for (int p=0; p<numberOfParams; p++)
-   {
-      theDlonDparamGrid[p].setNullValue(0.0);
-      theDlatDparamGrid[p].setNullValue(0.0);
-      theDlatDparamGrid[p].initialize(grid_size, grid_origin, spacing);
-      theDlonDparamGrid[p].initialize(grid_size, grid_origin, spacing);
-   }
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::reallocateGrid: returning..." << std::endl;
-   return;
-}
-
-//*****************************************************************************
-// STATIC METHOD: ossimCoarseGridModel::writeGeomTemplate
-//  
-//  Writes a sample geometry KWL to the output stream.
-//  
-//*****************************************************************************
-void ossimCoarseGridModel::writeGeomTemplate(ostream& os)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::writeGeomTemplate: entering..." << std::endl;
-
-   os <<
-      "//**************************************************************\n"
-      "// Template for OCG model kewordlist\n"
-      "//**************************************************************\n"
-      << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
-
-   ossimSensorModel::writeGeomTemplate(os);
-   
-   os << "//\n"
-      << "// Derived-class ossimCoarseGridModel Keywords:\n"
-      << "//\n"
-      << GRID_FILE_NAME_KW << ": <string>\n" << endl;
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::writeGeomTemplate: returning..." << std::endl;
-   return;
-}
-   
-//*************************************************************************************************
-// Overrides base-class extrapolation code. Uses extrapolation inherent to ossimDbleGrid
-//*************************************************************************************************
-ossimGpt ossimCoarseGridModel::extrapolate(const ossimDpt& local_ip, const double& height) const
-{
-   ossimGpt gpt;
-   lineSampleHeightToWorld(local_ip, height, gpt);
-   return gpt;
-}
-
-bool ossimCoarseGridModel::isAffectedByElevation() const
-{
-   return theHeightEnabledFlag;
-}
diff --git a/ossim/src/ossim/projection/ossimEpsgProjectionDatabase.cpp b/ossim/src/ossim/projection/ossimEpsgProjectionDatabase.cpp
deleted file mode 100644
index 68bd0a6..0000000
--- a/ossim/src/ossim/projection/ossimEpsgProjectionDatabase.cpp
+++ /dev/null
@@ -1,913 +0,0 @@
-//*************************************************************************************************
-//                          OSSIM -- Open Source Software Image Map
-//
-// LICENSE:  See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Projection database for EPSG coded projections provided in database files
-//
-//*************************************************************************************************
-//  $Id: ossimEpsgProjectionDatabase.cpp 23177 2015-03-04 15:05:25Z gpotts $
-#include <ossim/projection/ossimEpsgProjectionDatabase.h>
-#include <ossim/projection/ossimStatePlaneProjectionInfo.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimTransMercatorProjection.h>
-#include <ossim/projection/ossimMercatorProjection.h>
-#include <ossim/projection/ossimOrthoGraphicProjection.h>
-#include <ossim/projection/ossimNewZealandMapGridProjection.h>
-#include <ossim/projection/ossimGoogleProjection.h>
-#include <ossim/projection/ossimLambertConformalConicProjection.h>
-#include <ossim/projection/ossimCassiniProjection.h>
-#include <ossim/projection/ossimAlbersProjection.h>
-#include <ossim/base/ossimEpsgDatumFactory.h>
-#include <ossim/base/ossimDatumFactory.h>
-#include <ossim/base/ossimDatumFactoryRegistry.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/projection/ossimMapProjectionFactory.h>
-#include <ossim/base/ossimException.h>
-#include <cmath>
-
-//ossimEpsgProjectionDatabase* ossimEpsgProjectionDatabase::m_instance = 0;
-
-// Indexes into the DB file fields using "SPADAC EPSG" format (format "A"). 
-// IF THE LINE FIELDS CHANGE ORDER, THIS LIST WILL NEED TO BE CHANGED TO REFLECT THE NEW ORDER!
-enum
-{
-   A_CODE = 0,  // This is the EPSG code
-   A_NAME,
-   A_PROJ_TYPE,
-   A_UNITS,
-   A_DATUM_CODE,
-   A_DATUM_NAME,
-   A_ELLIPSOID_NAME,
-   A_FALSE_EASTING,
-   A_NAT_ORG_LAT,
-   A_FALSE_NORTHING,
-   A_NAT_ORG_LON,
-   A_NAT_ORG_SCALE,
-   A_INIT_LINE_AZ,
-   A_PROJ_CTR_LAT,
-   A_PROJ_CTR_NORTHING,
-   A_RECT_TO_SKEW_ANGLE,
-   A_INIT_LINE_SCALE,
-   A_PROJ_CTR_EASTING,
-   A_PROJ_CTR_LON,
-   A_PSEUDO_STD_PARL_1,
-   A_PSEUDO_STD_PARL_1_SCALE,
-   A_ORG_LON,
-   A_STD_PARL_2_LAT,
-   A_FALSE_ORG_LAT,
-   A_FALSE_ORG_LON,
-   A_STD_PARL_1_LAT,
-   A_FALSE_ORG_NORTHING,
-   A_FALSE_ORG_EASTING,
-   A_STD_PARL_LAT,
-   A_TOPOCTR_HGT,
-   A_TOPOCTR_LAT,
-   A_TOPOCTR_Z,
-   A_TOPOCTR_Y,
-   A_TOPOCTR_X,
-   A_VIEWPOINT_H,
-   A_INIT_LON,
-   A_ZONE_WIDTH,
-   A_NUM_FIELDS   // Not an index, but a count
-};
-static const ossimString EPSG_DB_FORMAT_A ("EPSG_DB_FORMAT_A");
-
-// State Plane database CSV file field format (format "B")
-// NOTE: Eventually, all EPSG-coded projections, including State Plane/HARN should be specified
-// in the EPSG database format. Presently there is a disconnect between Geotrans params and EPSG-Db
-// params, particularly regarding datums, that makes a purely EPSG-Db solution too awkward to
-// implement, so provision is made here to continue reading the state plane CSV files.
-enum 
-{
-   B_NAME = 0,
-   B_CODE,   // This is the EPSG code
-   B_PROJ_TYPE,
-   B_PARAM1,
-   B_PARAM2,
-   B_PARAM3,
-   B_PARAM4,
-   B_FALSE_EASTING,
-   B_FALSE_NORTHING,
-   B_UNITS,
-   B_DATUM_CODE,
-   B_NUM_FIELDS   // Not an index, but a count
-};
-static const ossimString STATE_PLANE_FORMAT_B ("STATE_PLANE");
-
-// "Ming Special" database CSV file format (format "C")
-// State Plane Coordinate System (SPCS) coding is an alternate coding scheme that maps to EPSG.
-// http://www.pcigeomatics.com/cgi-bin/pcihlp/PROJ%7CSPCS+ZONES
-enum 
-{
-   C_NAME = 0,
-   C_CODE,
-   C_NUM_FIELDS   // Not an index, but a count
-};
-static const ossimString SPCS_EPSG_MAP_FORMAT_C ("SPCS_EPSG_MAP");
-
-//*************************************************************************************************
-//! Converts sexagesimal DMS to decimal degrees
-//*************************************************************************************************
-double decodeSexagesimalDms(const ossimString& sex_str)
-{
-   if (!sex_str.contains("."))
-      return sex_str.toDouble();
-
-   double sign = 1.0;
-   if (sex_str.chars()[0] == '-')
-      sign = -1.0;
-
-   double dsex, msex, ssex;
-   std::vector<ossimString> splitstr = sex_str.split(".");
-   dsex = splitstr[0].toDouble();
-   
-   if (splitstr.size() < 2)
-      return dsex;
-
-   const char* MMSSssstr = splitstr[1].chars();
-   unsigned int str_size = (unsigned int) splitstr[1].size();
-   char minstr[] = "00";
-   ossimString secstr ("00.");
-   minstr[0] = MMSSssstr[0];
-   if (str_size > 1)
-   {
-      minstr[1] = MMSSssstr[1];
-      if (str_size > 2)
-      {
-         secstr = &(MMSSssstr[2]);
-         if (str_size == 3)
-            secstr += ossimString("0.");
-         else if (str_size > 4)
-            secstr.insert(2, ".");
-      }
-   }
-   msex = ossimString(minstr).toDouble();
-   ssex = secstr.toDouble();
-   dsex += sign*(msex + ssex/60.0)/60.0;
-   return dsex;
-}
-
-//*************************************************************************************************
-//! Implements singleton pattern
-//*************************************************************************************************
-ossimEpsgProjectionDatabase* ossimEpsgProjectionDatabase::instance()
-{
-   static ossimEpsgProjectionDatabase inst;
-
-   return &inst;
-   //if(!m_instance)
-   //   m_instance = new ossimEpsgProjectionDatabase;
-   //return m_instance;
-}
-
-//*************************************************************************************************
-//! Destructor
-//*************************************************************************************************
-ossimEpsgProjectionDatabase::~ossimEpsgProjectionDatabase()
-{
-}
-
-//*************************************************************************************************
-//! Constructor loads all DB CSV files specified in the ossim prefs
-//*************************************************************************************************
-ossimEpsgProjectionDatabase::ossimEpsgProjectionDatabase()
-   :
-   m_projDatabase(),
-   m_mutex()
-{
-}
-
-//*************************************************************************************************
-//! Populates the database with contents of DB files as specified in ossim_preferences.
-//*************************************************************************************************
-void ossimEpsgProjectionDatabase::initialize() const
-{
-   // Fetch filenames of all projection DB files specified in ossim_preferences:
-   ossimString regEx =  ossimString("^epsg_database_file[0-9]+");
-   vector<ossimString> keys = 
-      ossimPreferences::instance()->preferencesKWL().getSubstringKeyList(regEx);
-   vector<ossimString>::const_iterator i = keys.begin();
-
-   // Create only once outside the loop:
-   ossimFilename db_name;
-   ossimString group_id;
-   ossimString format_id;
-   ossimString line;
-
-   // Loop over each file and read contents into memory:
-   while ( i != keys.end() )
-   {
-      db_name = ossimPreferences::instance()->preferencesKWL().find( (*i).c_str() );
-      ++i;
-      if (!db_name.isReadable())
-         continue;
-
-      // Open the DB file:
-      std::ifstream db_stream (db_name.chars());
-      bool good_file = false;
-      if (db_stream.good())
-      {
-         // Format specification implied in file's magic number:
-         std::getline(db_stream, format_id.string());
-         format_id.trim();
-         if ((format_id == EPSG_DB_FORMAT_A) || 
-             (format_id == STATE_PLANE_FORMAT_B) ||
-             (format_id == SPCS_EPSG_MAP_FORMAT_C))
-            good_file = true;
-      }
-      if (!good_file)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)<<"ossimEpsgProjectionDatabase::initialize() -- "
-            "Encountered bad database file <"<<db_name<<">. Skipping this file."<<endl;
-         db_stream.close();
-         continue;
-      }
-
-      // The file is good. Skip over the column descriptor line:
-      std::getline(db_stream, line.string());
-
-      // Loop to read all data records:
-      while (!db_stream.eof())
-      {
-         ossimRefPtr<ProjDbRecord> db_record = new ProjDbRecord;
-         std::getline(db_stream, line.string());
-         db_record->csvRecord = line.explode(","); // ONLY CSV FILES CONSIDERED HERE
-         if (db_record->csvRecord.size())
-         {
-            // Check if primary EPSG database format A:
-            if (format_id == EPSG_DB_FORMAT_A)
-            {
-               db_record->code = db_record->csvRecord[A_CODE].toUInt32();
-               db_record->name = db_record->csvRecord[A_NAME];
-               db_record->csvFormat = FORMAT_A;
-            }
-
-            // Check if State Plane (subset of EPSG but handled differently until projection 
-            // geotrans-EPSG disconnect is resolved. 
-            else if (format_id == STATE_PLANE_FORMAT_B)
-            {
-               db_record->code = db_record->csvRecord[B_CODE].toUInt32();
-               db_record->name = db_record->csvRecord[B_NAME];
-               db_record->csvFormat = FORMAT_B;
-            }
-
-            // This format is for Ming-special State Plane Coordinate System coded format.
-            // This format is simply a mapping from SPCS spec name (OSSIM-specific) to EPSG code.
-            // Note that no proj is instantiated and no KWL is populated. Only name and EPSG mapped
-            // code is saved.
-            else if (format_id == SPCS_EPSG_MAP_FORMAT_C)
-            {
-               db_record->code = db_record->csvRecord[C_CODE].toUInt32();
-               db_record->name = db_record->csvRecord[C_NAME];
-               db_record->csvFormat = FORMAT_C;
-            }
-
-            m_projDatabase.insert(make_pair(db_record->code, db_record));
-         }
-      }
-
-      db_stream.close();
-   } // end of while loop over all DB files
-}
-
-//*************************************************************************************************
-//! Returns a projection corresponding to the group (e.g., "EPSG") and PCS code provided, 
-//! or NULL if no entry found.
-//*************************************************************************************************
-ossimProjection* ossimEpsgProjectionDatabase::findProjection(ossim_uint32 epsg_code) const
-{
-   ossimMapProjection* proj = 0;
-
-   // Quick check for bogus EPSG:
-   if ((epsg_code == 0) || (epsg_code == 32767))
-      return 0;
-
-   // Check for Google projection:
-   else if ((epsg_code==3857)||(epsg_code == 900913))
-   {
-      proj = new ossimGoogleProjection();
-
-      // Set this for saveState:
-      proj->setPcsCode( 3857 );
-      /*
-      const ossimDatum* datum = ossimDatumFactory::instance()->create(ossimString("6055"));
-      ossimMercatorProjection* merc_proj = new ossimMercatorProjection();
-      ossimGpt origin(0.0,0.0,0.0, datum);
-      merc_proj->setFalseEasting(0.0);
-      merc_proj->setFalseNorthing(0.0);
-      merc_proj->setOrigin(origin); // Also sets the projections datum to the origin's datum
-      merc_proj->update();
-      merc_proj->setPcsCode(900913);
-      proj = merc_proj;
-      */
-   }
-
-   else
-   {
-      // Search database for entry:
-      m_mutex.lock();
-      if (m_projDatabase.empty())
-      {
-         initialize();
-      }
-      m_mutex.unlock();
-
-      std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = 
-         m_projDatabase.find(epsg_code);
-      if (db_iter != m_projDatabase.end())
-      {
-         // See if a projection has already been created for this entry:
-         m_mutex.lock();
-         ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
-         if ( db_record.valid() )
-         {
-            if (db_record->proj.valid())
-               proj = (ossimMapProjection*) db_record->proj->dup();
-            else
-            {
-               // Try decoding the EPSG code before accessing DB:
-               proj = createProjFromUtmCode(epsg_code);
-               if (proj)
-               {
-                  db_record->proj = proj;
-                  db_record->datumValid = true;
-               }
-               else if (db_iter->second->csvFormat == FORMAT_A)
-               {
-                  proj = createProjFromFormatARecord( db_record.get() );
-               }
-               else if (db_iter->second->csvFormat == FORMAT_B)
-               {
-                  proj = createProjFromFormatBRecord( db_record.get() );
-               }
-               
-               if (proj)
-               {
-                  // To save allocated memory, get rid of the original CSV entry since a real 
-                  // projection is now represented in the database:
-                  db_record->csvRecord.clear();
-                  db_record->csvFormat = NOT_ASSIGNED;
-               }
-            }
-
-         } // Matches: if  ( db_record.valid() )
-         m_mutex.unlock();
-      }
-   }
-
-   return proj;
-}
-
-//*************************************************************************************************
-//! Returns a projection corresponding to the group (e.g., "EPSG") and PCS code provided, 
-//! or NULL if no entry found.
-//*************************************************************************************************
-ossimProjection* ossimEpsgProjectionDatabase::findProjection(const ossimString& spec) const
-{
-   //std::cout << "ossimEpsgProjectionDatabase::findProjection: entered with spec " << spec << "\n";
-   ossimProjection* proj = 0;
-
-   // Use the CRS code to access the database. The spec should be <group>:<code> where <group> is 
-   // "EPSG" (the only group handled here):
-   ossim_uint32 spec_code;
-   ossimString spec_group ("epsg"); // default if only integer code provided
-   if (spec.contains(":"))
-   {
-      spec_group = spec.before(":");
-      spec_code = spec.after(":").toUInt32();
-      spec_group = spec_group.downcase();
-   }
-   else
-   {
-      spec_code = spec.toUInt32();
-   }
-
-   // Presently only EPSG database is handled:
-   if ((spec_code != 0) && (spec_group == "epsg"))
-      return findProjection(spec_code);
-
-   // The spec is probably a projection name. Need to search Db by the projection name. 
-   // Search database for entry. The spec may use different delimiters than
-   // the DB so need to split the strings and compare the words:
-   ossimString separators ("_ /()");
-   vector<ossimString> split_spec = spec.split(separators, true);
-   vector<ossimString> split_db_name;
-   ossimRefPtr<ossimMapProjection> map_proj = 0;
-   if (m_projDatabase.empty())
-      initialize();
-   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
-   while ((db_iter != m_projDatabase.end()) && !proj)
-   {
-      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
-      if ( db_record.valid() )
-      {
-         split_db_name.clear();
-         db_record->name.split(split_db_name, separators, true);
-         if (split_spec == split_db_name)
-         {
-            // We may already have instantiated this projection, in which case just return its copy.
-            // Otherwise, create the projection from the EPSG code that corresponds to the name:
-            if (db_record->proj.valid())
-               proj = (ossimMapProjection*) db_record->proj->dup();
-            else
-               proj = findProjection(db_record->code);
-            return proj;
-         }
-      }
-      ++db_iter;
-   }
-    
-   // No hit? Could be that just a datum was identified, in which case we need a simple 
-   // Platte Carree:
-   const ossimDatum* datum = ossimDatumFactoryRegistry::instance()->create(spec);
-   if (datum)
-   {
-      ossimEquDistCylProjection* proj = new ossimEquDistCylProjection(*(datum->ellipsoid()));
-      proj->setDatum(datum);
-      proj->setPcsCode(spec_code);
-      return proj;
-   }
-
-   return 0;
-}
-
-
-//*************************************************************************************************
-//! Given a projection name, assigns the group (e.g., "EPSG") and code of the projection. 
-//! Returns "<group>:<code>" if match was found or empty string if not found.
-//*************************************************************************************************
-ossim_uint32 ossimEpsgProjectionDatabase::findProjectionCode(const ossimString& proj_name) const
-{
-   if (m_projDatabase.empty())
-      initialize();
-   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
-   while (db_iter != m_projDatabase.end())
-   {
-      ossimRefPtr<ProjDbRecord> db_record = db_iter->second.get();
-      if ( db_record.valid() )
-      {
-         if (db_record->name == proj_name)
-            return (db_record->code);
-      }
-      ++db_iter;
-   }
-      
-   return 0;
-}
-
-//*************************************************************************************************
-//! Given a projection instance, this method determines the corresponding EPSG code. Obviously
-//! this is only needed if the projection does not have its PCS code assigned (it is NULL). This
-//! happens when the projection was constructed with full parameters instead of the EPSG code.
-//! Returns integer EPSG code if match was found or 0 if not found.
-//*************************************************************************************************
-ossim_uint32 
-ossimEpsgProjectionDatabase::findProjectionCode(const ossimMapProjection& lost_proj) const
-{
-   ossimString lost_type (lost_proj.getClassName());
-
-   // Shortcut for EPSG:4326 (WGS-85 geographic rectangular -- very common):
-   if ((lost_type == "ossimEquDistCylProjection") && (lost_proj.getDatum()->epsgCode() == 6326))
-      return 4326;
-
-   ossim_uint32 found_code = 0;
-   if (lost_type == "ossimUtmProjection")
-   {
-      found_code = getCodeFromUtmProj(dynamic_cast<const ossimUtmProjection*>(&lost_proj));
-      if (found_code)
-         return found_code;
-   }
-
-   if (m_projDatabase.empty())
-      initialize();
-   ossimString lookup;
-   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter =
-      m_projDatabase.begin();
-   while ((db_iter != m_projDatabase.end()) && (found_code == 0))
-   {
-      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
-      if ( db_record.valid() )
-      {
-         // Has a projection already been created for this db iter?
-         if (!db_record->proj.valid())
-         {
-            // No projection has been created yet for this DB entry. 
-            // NOTE: THIS IS VERY SLOW BECAUSE WE ARE INSTANTIATING EVERY PROJECTION IN THE DB!!!
-            db_record->proj = dynamic_cast<ossimMapProjection*>(findProjection(db_record->code));
-         }
-         if (db_record->proj.valid() && (*(db_record->proj.get()) == lost_proj))
-         {
-            found_code = db_record->code;
-            
-            // Hack to remap projection code 4087 to 4326 (which is not really a projection 
-            // code but other packages like to see 4326 for geographic projections.
-            // Hacked under protest (OLK, 08/2010)
-            if (found_code == 4087)
-               found_code = 4326;
-         }
-      }
-      ++db_iter;
-   }
-   return found_code;
-}
-
-//*************************************************************************************************
-//! This method provides acess to the projection name given the EPSG code. The name provides 
-//! enough info for recognizing a non-meters HARN-based projection. 
-//*************************************************************************************************
-ossimString ossimEpsgProjectionDatabase::findProjectionName(ossim_uint32 epsg_code) const
-{
-   if (m_projDatabase.empty())
-      initialize();
-
-   ossimString name ("");
-   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = 
-       m_projDatabase.find(epsg_code);
-   
-   if (db_iter != m_projDatabase.end())
-      name = db_iter->second->name;
-   
-   return name;
-}
-
-//*************************************************************************************************
-//! Populates caller's list with all projections currently represented in the database.
-//! The format is: 
-//!    EPSG:<code>  "<Name as appears in Db>"
-//! There may be duplicate entries if the projection is duplicated in the various Db files.
-//*************************************************************************************************
-void ossimEpsgProjectionDatabase::getProjectionsList(std::vector<ossimString>& list) const
-{
-   if (m_projDatabase.empty())
-      initialize();
-
-   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
-   while (db_iter != m_projDatabase.end())
-   {
-      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
-      if ( db_record.valid() )
-      {
-         ossimString record ("EPSG:");
-         record += ossimString::toString(db_record->code);
-         record += "  \"";
-         record += db_record->name;
-         record += "\"";
-         list.push_back(record);
-      }
-      ++db_iter;
-   }
-   return;
-}
-
-//*************************************************************************************************
-//! This method is invoked to parse the Db record and produce a projection (or NULL if spec invalid)
-//
-// LIMITATION: Currently not parsing the datum info from the EPSG database file due to disconnect
-// with current ossimDatumFactory. Setting to default WGS84 with warning message.
-//*************************************************************************************************
-ossimMapProjection* 
-ossimEpsgProjectionDatabase::createProjFromFormatARecord(ProjDbRecord* record) const
-{
-   // Establish EPSG code and test for UTM (full projection is implied in the code itself -- no 
-   // accessing the database). Until the database is solidified, it is probably better to do 
-   // it this way:
-   record->datumValid = true;
-   record->proj = 0;
-
-   // Establish the units in which the easting/northing is provided:
-   ossimUnitType mapProjUnits = OSSIM_METERS;
-   double mtrs_per_unit = 1.0;
-   if (record->csvRecord[A_UNITS] == "US survey foot")
-   {
-      mapProjUnits = OSSIM_US_SURVEY_FEET;
-      mtrs_per_unit = US_METERS_PER_FT;
-   }
-   else if (record->csvRecord[A_UNITS].contains("foot")) // THIS IS INTERNATIONAL FOOT, NOT EXACT FOR MANY INTERNATIONAL VARIETIES
-   {
-      mapProjUnits = OSSIM_FEET;
-      mtrs_per_unit = MTRS_PER_FT;
-   }
-   else if (record->csvRecord[A_UNITS].contains("kilometre"))
-   {
-      mapProjUnits = OSSIM_KILOMETERS;
-      mtrs_per_unit = 1000.0;
-   }
-   else if (!record->csvRecord[A_UNITS].contains("metre"))
-   {
-      // ### SKIP THIS MESSAGE BUT BE AWARE THAT THIS PROJECTION WON'T BE REPRESENTED IN DB ###
-      //ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<"EPSG:"<<pcs_code<<" units of <"
-      //   <<record->csvRecord[A_UNITS]<<"> not presently supported."<<endl;
-      return 0;
-   }
-
-   // First create a datum given the datum code in the record:
-   ossim_uint32 gcs_code = record->csvRecord[A_DATUM_CODE].toUInt32();
-   const ossimDatum* datum = ossimEpsgDatumFactory::instance()->create(gcs_code);
-   if (!datum)
-   {
-      // Default to WGS 84 -- this may throw an exception:
-      datum = ossimDatumFactory::instance()->create(ossimString("WGE"));
-      record->datumValid = false;
-   }
-   const ossimEllipsoid* ellipsoid = datum->ellipsoid();
-
-   ossimGpt origin(0,0,0,datum);
-   ossimString proj_type = record->csvRecord[A_PROJ_TYPE];
-   if (proj_type.contains("Transverse Mercator"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
-      double sf = record->csvRecord[A_NAT_ORG_SCALE].toDouble();
-      record->proj = new ossimTransMercatorProjection(*ellipsoid, origin, fe, fn, sf);
-   }
-   else if (proj_type.contains("Lambert Conic Conformal (1SP)"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
-      record->proj = new ossimLambertConformalConicProjection(*ellipsoid, origin, origin.lat, 
-         origin.lat, fe, fn);
-   }
-   else if (proj_type.contains("Lambert Conic Conformal (2SP)"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LON]);
-      double p1 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_1_LAT]);
-      double p2 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_2_LAT]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_NORTHING].toDouble();
-      record->proj = new ossimLambertConformalConicProjection(*ellipsoid, origin, p1, p2, fe, fn);
-   }
-   else if (proj_type.contains("Cassini"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
-      record->proj =  new ossimCassiniProjection(*ellipsoid, origin, fe, fn);
-   }
-   else if (proj_type.contains("Mercator (1SP)") || proj_type.contains("Pseudo-Mercator"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
-      double sf = record->csvRecord[A_NAT_ORG_SCALE].toDouble();
-      record->proj = new ossimMercatorProjection(*ellipsoid, origin, fe, fn, sf);
-   }
-   else if (proj_type.contains("Albers"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LON]);
-      double p1 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_1_LAT]);
-      double p2 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_2_LAT]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_NORTHING].toDouble();
-      record->proj = new ossimAlbersProjection(*ellipsoid, origin, p1, p2, fe, fn);
-   }
-   else if (proj_type.contains("Equidistant Cylindrical"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_1_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
-      record->proj = new ossimEquDistCylProjection(*ellipsoid, origin, fe, fn);
-   }
-   else if (proj_type.contains("New Zealand Map Grid"))
-   {
-      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
-      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
-      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
-      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
-      ossimNewZealandMapGridProjection* nz_proj = new ossimNewZealandMapGridProjection;
-      nz_proj->setOrigin(origin);
-      nz_proj->setFalseEastingNorthing(fe, fn);
-      record->proj = nz_proj;
-   }
-   else 
-   {
-      // Can't handle it now. 
-      //ossimNotify(ossimNotifyLevel_FATAL)<<MODULE<<"EPSG:"<<record->csvRecord[A_CODE]<<" \""<<proj_type<<"\" "
-      //   "not presently supported. Returning NULL projection..."<<endl;
-      return 0;
-   }
-  
-   record->proj->setDatum(datum);
-   record->proj->setPcsCode(record->code);
-   record->proj->setProjectionUnits(mapProjUnits);
-
-   return record->proj.get();
-}
-
-//*************************************************************************************************
-// ### HACK ###
-//! State Plane projections as specified in the EPSG are indistinguishable from regular TM. 
-//! Unfortunately OSSIM does make a distinction. For the time being, parse the code and 
-//! programmatically arrive at the UTM projection.
-//*************************************************************************************************
-ossimMapProjection* 
-ossimEpsgProjectionDatabase::createProjFromFormatBRecord(ProjDbRecord* db_record) const
-{
-   // Unfortunately, as of this writing, there is a disconnect between the Geotrans projection
-   // parameters and those provided by EPSG database. In the meantime, to maintain functionality,
-   // we intercept the EPSG code and programmatically arrive at the projection versus pulling
-   // all the parameters out of the Db record->
-   ossimStatePlaneProjectionInfo  info(db_record->name,
-                                       db_record->code,
-                                       db_record->csvRecord[B_PROJ_TYPE],
-                                       db_record->csvRecord[B_PARAM1],
-                                       db_record->csvRecord[B_PARAM2],
-                                       db_record->csvRecord[B_PARAM3],
-                                       db_record->csvRecord[B_PARAM4],
-                                       db_record->csvRecord[B_FALSE_EASTING].toDouble(),
-                                       db_record->csvRecord[B_FALSE_NORTHING].toDouble(),
-                                       db_record->csvRecord[B_UNITS],
-                                       db_record->csvRecord[B_DATUM_CODE]);
-   
-   // NOTE: In order to avoid infinite recursion with this object, we initialized the PCS code in 
-   // info to NULL to insure that the projection is instantiated directly (not via this class):
-   ossimKeywordlist kwl;
-   info.populateProjectionKeywords(kwl);
-   kwl.remove(ossimKeywordNames::PCS_CODE_KW);
-   db_record->proj = 
-      PTR_CAST(ossimMapProjection, ossimMapProjectionFactory::instance()->createProjection(kwl));
-   if (db_record->proj.valid())
-   {
-      db_record->proj->setPcsCode(db_record->csvRecord[B_CODE].toUInt32());
-      db_record->datumValid = true;
-   }
-
-   return db_record->proj.get();
-}
-
-//*************************************************************************************************
-// ### HACK ###
-//! UTM projections as specified in the EPSG are indistinguishable from regular TM. Unfortunately
-//! OSSIM does make a distinction. For the time being, parse the code and programmatically arrive 
-//! at the UTM projection.
-//*************************************************************************************************
-ossimMapProjection* ossimEpsgProjectionDatabase::createProjFromUtmCode(ossim_uint32 code) const
-{
-   // This code originally found in deprecated ossimPcsCodeProjectionFactory authored by
-   // David Burken.
-   int type = code/100;
-   int zone = code%100;
-   ossimUtmProjection* proj = NULL;
-   switch (type)
-   {
-   case 322:
-      // utm, WGS72 (WGD), northern hemisphere
-      if ( (zone > 0 ) && (zone < 61) )
-      {
-         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs72()->ellipsoid()));
-         proj->setDatum(ossimDatumFactory::instance()->wgs72());
-         proj->setZone(zone);
-         proj->setHemisphere('N');
-      }
-      break;
-
-   case 323:
-      // utm, WGS72 (WGD), southern hemisphere
-      if ( (zone > 0) && (zone < 61) )
-      {
-         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs72()->ellipsoid()));
-         proj->setDatum(ossimDatumFactory::instance()->wgs72());
-         proj->setZone(zone);
-         proj->setHemisphere('S');
-      }
-      break;
-
-   case 326:
-      // utm, WGS84 (WGE), northern hemisphere
-      if ( (zone > 0) && (zone < 61) )
-      {
-         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs84()->ellipsoid()));
-         proj->setDatum(ossimDatumFactory::instance()->wgs84());
-         proj->setZone(zone);
-         proj->setHemisphere('N');
-      }
-      break;
-
-   case 327:
-      // utm, WGS84 (WGE), southern hemisphere
-      if ( (zone > 0) && (zone < 61) )
-      {
-         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs84()->ellipsoid()));
-         proj->setDatum(ossimDatumFactory::instance()->wgs84());
-         proj->setZone(zone);
-         proj->setHemisphere('S');
-      }
-      break;
-
-   case 267:
-      // utm, "NAS-C", northern hemisphere
-      // Only UTM NAD27 North zones 3 to 22 are in the 267xx range...
-      // 26729 through 26803 handled by state plane factory.
-      //---
-      if ( (code > 26702) && (code < 26723) )
-      {
-         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->
-            create(ossimString("NAS-C"))->ellipsoid()));
-         proj->setDatum(ossimDatumFactory::instance()->create(ossimString("NAS-C")));
-         proj->setZone(zone);
-         proj->setHemisphere('N');
-      }
-      break;
-
-   case 269:
-      // utm, "NAR-C", northern hemisphere
-      // Only UTM NAD83 North zones 3 to 23 are in the 269xx range...
-      // 26929 through 26998 handled by state plane factory.
-      if ( (code > 26902) && (code < 26924) )
-      {
-         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->
-            create(ossimString("NAR-C"))->ellipsoid()));
-         proj->setDatum(ossimDatumFactory::instance()->create(ossimString("NAR-C")));
-         proj->setZone(zone);
-         proj->setHemisphere('N');
-      }
-      break;
-
-   case 248:
-      // Provisional S. American 1956, 24818 through 24880
-      if ( (code > 24817) && (code < 24881) )
-      {
-         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->
-            create(ossimString("PRP-M"))->ellipsoid()));
-         proj->setDatum(ossimDatumFactory::instance()->create(ossimString("PRP-M")));
-         if (zone > 60)
-         {
-            proj->setZone(zone - 60);
-            proj->setHemisphere('S');
-         }
-         else
-         {
-            proj->setZone(zone);
-            proj->setHemisphere('N');
-         }
-      }
-      break;
-
-   } // End of switch on code.
-
-   if (proj)
-      proj->setPcsCode(code);
-
-   return proj;
-}
-
-//*************************************************************************************************
-//! Given UTM projection, derives the associated EPSG code. This is faster than a Db lookup.
-//*************************************************************************************************
-ossim_uint32 ossimEpsgProjectionDatabase::getCodeFromUtmProj(const ossimUtmProjection* proj) const
-{
-   if (proj == NULL)
-      return 0;
-
-   char hemisphere = proj->getHemisphere();
-   ossim_uint32 zone = proj->getZone();
-   ossimString datum_code = proj->getDatum()->code();
-   
-   if ((zone < 1 ) || (zone > 60))
-      return 0;
-
-   ossim_uint32 epsg_code = zone;
-   if ((hemisphere == 'N') && (datum_code == "WGD"))
-      epsg_code += 32200;
-   
-   else if ((hemisphere == 'S') && (datum_code == "WGD"))
-      epsg_code += 32300;
-
-   else if ((hemisphere == 'N') && (datum_code == "WGE"))
-      epsg_code += 32600;
-
-   else if ((hemisphere == 'S') && (datum_code == "WGE"))
-      epsg_code += 32700;
-
-   else if ((hemisphere == 'N') && (datum_code == "NAS-C") && (zone > 2) && (zone < 23))
-      epsg_code += 26700;
-
-   else if ((hemisphere == 'N') && (datum_code == "NAR-C") && (zone > 2) && (zone < 24))
-      epsg_code += 26900;
-
-   else if ((hemisphere == 'N') && (datum_code == "PRP-M"))
-      epsg_code += 24800;
-
-   else if ((hemisphere == 'S') && (datum_code == "PRP-M"))
-      epsg_code += 24800 + 60;
-   
-   else
-      epsg_code = 0;
-
-   return epsg_code;
-}
-
diff --git a/ossim/src/ossim/projection/ossimEquDistCylProjection.cpp b/ossim/src/ossim/projection/ossimEquDistCylProjection.cpp
deleted file mode 100644
index a8363b3..0000000
--- a/ossim/src/ossim/projection/ossimEquDistCylProjection.cpp
+++ /dev/null
@@ -1,680 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Equidistant Cylinder projection code.  
-//*******************************************************************
-//  $Id: ossimEquDistCylProjection.cpp 23373 2015-06-13 17:16:38Z okramer $
-
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/elevation/ossimElevManager.h>
-
-static ossimTrace traceDebug("ossimEquDistCylProjection:debug");
-
-RTTI_DEF1(ossimEquDistCylProjection,
-          "ossimEquDistCylProjection",
-	  ossimMapProjection);
-	  //          ossimLlxyProjection)
-   
-/***************************************************************************/
-/*
- *                               DEFINES
- */
-
-#ifndef PI_OVER_2
-#  define PI_OVER_2  ( M_PI / 2.0)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI     (2.0 * M_PI)
-#endif
-#define ONE	   (1.0 * M_PI / 180.0)       /* 1 degree in radians*/
-
-#define EQCY_NO_ERROR           0x0000
-#define EQCY_LAT_ERROR          0x0001
-#define EQCY_LON_ERROR          0x0002
-#define EQCY_EASTING_ERROR      0x0004
-#define EQCY_NORTHING_ERROR     0x0008
-#define EQCY_ORIGIN_LAT_ERROR   0x0010
-#define EQCY_CENT_MER_ERROR     0x0020
-#define EQCY_A_ERROR            0x0040
-#define EQCY_B_ERROR            0x0080
-#define EQCY_A_LESS_B_ERROR     0x0100
-
-
-ossimEquDistCylProjection::ossimEquDistCylProjection(const ossimEllipsoid& ellipsoid,
-                                                     const ossimGpt& origin)
-//  :ossimLlxyProjection(ellipsoid, origin)
-  :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-
-ossimEquDistCylProjection::ossimEquDistCylProjection(const ossimEllipsoid& ellipsoid,
-                                                     const ossimGpt& origin,
-                                                     double falseEasting,
-                                                     double falseNorthing)
-//  :ossimLlxyProjection(ellipsoid, origin)
-  :ossimMapProjection(ellipsoid, origin)
-{
-   Eqcy_False_Easting  = falseEasting;
-   Eqcy_False_Northing = falseNorthing;
-
-   Eqcy_Delta_Northing = 10007555.0;
-   Eqcy_Max_Easting    = 20015110.0;
-   Eqcy_Min_Easting    = -20015110.0;
-   
-   update();
-}
-
-void ossimEquDistCylProjection::update()
-{
-   Set_Equidistant_Cyl_Parameters(theEllipsoid.getA(),
-                                  theEllipsoid.getFlattening(),
-                                  theOrigin.latr(),
-                                  theOrigin.lonr(),
-                                  Eqcy_False_Easting,
-                                  Eqcy_False_Northing);
-
-   theFalseEastingNorthing.x = Eqcy_False_Easting;
-   theFalseEastingNorthing.y = Eqcy_False_Northing;
-
-   theMetersPerPixel.makeNan(); // force recompute by base class
-
-   ossimMapProjection::update();
-
-   // For geographic projection, the PCS EPSG code can be derived from the datum in most cases:
-   if ((thePcsCode == 0) && (theDatum != NULL))
-   {
-      ossim_uint32 datum_code = theDatum->epsgCode();
-      if ((datum_code >= 6000) && (datum_code < 7000))
-         thePcsCode = datum_code - 2000;
-   }
-
-   // Workaround for bug
-}
-
-void ossimEquDistCylProjection::setOrigin(const ossimGpt& origin)
-{
-   ossimMapProjection::setOrigin(origin); // breaks the projection
-   setUlTiePoints(theUlGpt); // needed to reset easting northing
-}
-
-void ossimEquDistCylProjection::setFalseEasting(double falseEasting)
-{
-   Eqcy_False_Easting = falseEasting;
-   update();
-}
-
-void ossimEquDistCylProjection::setFalseNorthing(double falseNorthing)
-{
-   Eqcy_False_Northing = falseNorthing;
-   update();
-}
-
-void ossimEquDistCylProjection::setFalseEastingNorthing(double falseEasting,
-                                                        double falseNorthing)
-{
-   Eqcy_False_Easting  = falseEasting;
-   Eqcy_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimEquDistCylProjection::setDefaults()
-{
-   theProjectionUnits = OSSIM_DEGREES;
-   Eqcy_False_Easting  = 0.0;
-   Eqcy_False_Northing = 0.0;
-   Eqcy_Delta_Northing = 10007555.0;
-   Eqcy_Max_Easting    = 20015110.0;
-   Eqcy_Min_Easting    = -20015110.0;
-}
-
-void ossimEquDistCylProjection::lineSampleHeightToWorld(const ossimDpt &lineSample,
-                                                        const double&  hgtEllipsoid,
-                                                        ossimGpt&      gpt)const
-{
-   //
-   // make sure that the passed in lineSample is good and
-   // check to make sure our easting northing is good so
-   // we can compute the line sample.
-   //
-   //
-   if(lineSample.hasNans())
-   {
-      gpt.makeNan();
-      return;
-   }
-   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
-   {
-      ossimMapProjection::lineSampleHeightToWorld(lineSample, hgtEllipsoid, gpt);
-      return;
-   }
-   else
-   {
-      if(theUlEastingNorthing.hasNans())
-      {
-         gpt.makeNan();
-         return;
-      }
-      ossimDpt eastingNorthing;
-      
-      eastingNorthing = (theUlEastingNorthing);
-      
-      eastingNorthing.x += (lineSample.x*theMetersPerPixel.x);
-      
-      //
-      // Note:  the Northing is positive up.  In image space
-      // the positive axis is down so we must multiply by
-      // -1
-      //
-      eastingNorthing.y += (-lineSample.y*theMetersPerPixel.y);
-      
-      //
-      // now invert the meters into a ground point.
-      //
-      gpt = inverse(eastingNorthing);
-      gpt.datum(theDatum);
-      
-      if(gpt.isLatNan() && gpt.isLonNan())
-      {
-         gpt.makeNan();
-      }
-      else
-      {
-         // Finally assign the specified height:
-         gpt.hgt = hgtEllipsoid;
-      }
-   }
-   if(theElevationLookupFlag)
-   {
-      gpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
-   }
-}
-
-void ossimEquDistCylProjection::worldToLineSample(const ossimGpt &worldPoint,
-                                                  ossimDpt&       lineSample)const
-{
-   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
-   {
-      ossimMapProjection::worldToLineSample(worldPoint, lineSample);
-      return;
-   }
-   
-   // make sure our tie point is good and world point is good.
-   if(theUlEastingNorthing.isNan() || worldPoint.isLatNan() || worldPoint.isLonNan())
-   {
-      lineSample.makeNan();
-      return;
-   }
-
-   // see if we have a datum set and if so shift the world to our datum.  If not then
-   // find the easting northing value for the world point.
-   ossimDpt gptEastingNorthing;
-   if(theDatum)
-   {
-      ossimGpt gpt = worldPoint;
-      gpt.changeDatum(theDatum);
-      gptEastingNorthing = forward(gpt);
-   }
-   else
-   {
-      gptEastingNorthing = forward(worldPoint);
-   }
-
-   // check the final result to make sure there were no problems.
-   if(!gptEastingNorthing.isNan())
-   {
-      lineSample.x = ((gptEastingNorthing.x  - theUlEastingNorthing.x)/theMetersPerPixel.x);
-
-      // We must remember that the Northing is negative since the positive
-      // axis for an image is assumed to go down since it's image space.
-      lineSample.y = (-(gptEastingNorthing.y - theUlEastingNorthing.y)/theMetersPerPixel.y);
-   }
-}
-
-void ossimEquDistCylProjection::worldToLineSample( const ossimGpt& worldPoint,
-                                                   const ossimIpt& imageSize,
-                                                   ossimDpt&       lineSample ) const
-{
-   if( theModelTransformUnitType == OSSIM_UNIT_UNKNOWN )
-   {
-      // Make sure our points are good.
-      if( !theUlEastingNorthing.isNan() && !worldPoint.isLatNan() && !worldPoint.isLonNan() &&
-          !imageSize.isNan() )
-      {
-         ossimGpt gpt = worldPoint;
-
-         //---
-         // See if we have a datum set and if so shift the world to our datum.  If not then
-         // find the easting northing value for the world point.
-         if(theDatum)
-         {
-            gpt.changeDatum(theDatum);
-         }
-
-         // Convert to easting northing.
-         ossimDpt gptEastingNorthing = forward(gpt);
-
-         if( !gptEastingNorthing.isNan() )
-         {
-            if ( imageSize.x > 0.0 )
-            {
-               ossimGpt edge(gpt.lat, -180.0, 0.0);
-               ossimDpt leftProjectionEdge = forward(edge);
-               
-               edge.lon = 180;
-               ossimDpt rightProjectionEdge = forward(edge);
-
-               // Right edge Easting of image from tie.
-               ossim_float64 leftImageX = theUlEastingNorthing.x  - (0.5*theMetersPerPixel.x);
-               ossim_float64 rightImageX = leftImageX + (imageSize.x * theMetersPerPixel.x);
-
-               if ( rightImageX < rightProjectionEdge.x ) // Image edge left of date line.
-               {
-                  // Image does not cross the date line.
-                  lineSample.x =
-                     (gptEastingNorthing.x - theUlEastingNorthing.x) / theMetersPerPixel.x;
-               }
-               else // Crossed date line:
-               {
-                  // Normalize the right image point to account for wrap:
-                  ossim_float64 normRightX =
-                     rightImageX - rightProjectionEdge.x + leftProjectionEdge.x;
-
-                  if ( ( gptEastingNorthing.x >= leftImageX ) &&
-                       ( gptEastingNorthing.x <= rightProjectionEdge.x ) )
-                  {
-                     // Between tie and date line.
-                     lineSample.x =
-                        (gptEastingNorthing.x - theUlEastingNorthing.x)/theMetersPerPixel.x;
-                  }
-                  else if ( ( gptEastingNorthing.x >= leftProjectionEdge.x ) &&
-                            ( gptEastingNorthing.x <=  normRightX ) )
-                  {
-                     // Between date line and right image point.
-                     lineSample.x = ( rightProjectionEdge.x - theUlEastingNorthing.x +
-                                     gptEastingNorthing.x - leftProjectionEdge.x )/theMetersPerPixel.x;
-                  }
-                  else
-                  {
-                     // Point in between normalized right x and tie:
-                     ossim_float64 deltaToLeft  = theUlEastingNorthing.x - gptEastingNorthing.x;
-                     ossim_float64 deltaToRight = gptEastingNorthing.x - normRightX;
-                     
-                     // Make relative to the closest edge.
-                     if ( deltaToRight < deltaToLeft )
-                     {
-                        lineSample.x = (imageSize.x - 1) + deltaToRight/theMetersPerPixel.x;
-                     }
-                     else
-                     {
-                        lineSample.x = -(deltaToLeft/theMetersPerPixel.x );
-                     }
-                  }  
-               }
-              
-            } // Matches: if ( ( imageSize.x > 0.0 ) && ( imageSize.y > 0.0 ) )
-            else
-            {
-               lineSample.x = (gptEastingNorthing.x - theUlEastingNorthing.x)/theMetersPerPixel.x;
-            }
-            
-            // We must remember that the Northing is negative since the positive
-            // axis for an image is assumed to go down since it's image space.
-            lineSample.y = (theUlEastingNorthing.y - gptEastingNorthing.y) / theMetersPerPixel.y;
-            
-         } // Matches: if( !lineSample.isNan() )
-         
-      }
-      else // Some point we need has nans...
-      {
-         lineSample.makeNan();
-      }
-      
-   } // Matches: if( theModelTransformUnitType == OSSIM_UNIT_UNKNOWN )
-   else 
-   {
-      // Has transform:
-      ossimMapProjection::worldToLineSample(worldPoint, lineSample);
-   }
-
-} // End: ossimEquDistCylProjection::worldToLineSample(worldPoint, lineSample, imageSize)
-
-ossimGpt ossimEquDistCylProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-
-   Convert_Equidistant_Cyl_To_Geodetic(eastingNorthing.x,
-                                       eastingNorthing.y,
-                                       &lat,
-                                       &lon);
-
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
-}
-
-ossimDpt ossimEquDistCylProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Equidistant_Cyl(gpt.latr(),
-                                       gpt.lonr(),
-                                       &easting,
-                                       &northing);
-   
-   return ossimDpt(easting, northing);
-}
-
-
-
-bool ossimEquDistCylProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimEquDistCylProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimEquDistCylProjection::loadState: Input keyword list is \n" << kwl << endl;
-   }
-
-   //   ossimLlxyProjection::loadState(kwl, prefix);
-   ossimMapProjection::loadState(kwl, prefix);
-   theProjectionUnits = OSSIM_DEGREES;
-
-   // Make sure the origin.lat is defined since it is needed to relate degrees/meter:
-   if (ossim::isnan(theOrigin.lat))
-   {
-      theOrigin.lat = theUlGpt.lat;
-      if (ossim::isnan(theOrigin.lat))
-         theOrigin.lat = 0.0;
-   }
-
-   // Make sure degrees per pixel is defined:
-   if (theDegreesPerPixel.hasNans() && !theMetersPerPixel.hasNans())
-      computeDegreesPerPixel();
-
-   const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-
-   setDefaults();
-   // make sure we are of the same type.  If we are then the easting
-   // northing values will make since
-   //
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimEquDistCylProjection))
-   {
-      Eqcy_False_Easting  = theFalseEastingNorthing.x;
-      Eqcy_False_Northing = theFalseEastingNorthing.y;
-   }
-   else
-   {
-      theUlEastingNorthing.makeNan();
-   }
-   // finalize the initialization.
-   update();
-            
-   return true;
-}
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS
- */
-
-
-long ossimEquDistCylProjection::Set_Equidistant_Cyl_Parameters(double a,
-                                                               double f,
-                                                               double Std_Parallel,
-                                                               double Central_Meridian,
-                                                               double False_Easting,
-                                                               double False_Northing)
-{ /* Begin Set_Equidistant_Cyl_Parameters */
-/*
- * The function Set_Equidistant_Cyl_Parameters receives the ellipsoid parameters and
- * projection parameters as inputs, and sets the corresponding state
- * variables.  It also calculates the spherical radius of the sphere having 
- * the same area as the ellipsoid.  If any errors occur, the error code(s) 
- * are returned by the function, otherwise EQCY_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid						        (input)
- *    Std_Parallel      : Latitude in radians at which the          (input)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          standard parallel of the projection     (input)
- */
-
-  double temp;
-//  double inv_f = 1 / f;
-  long Error_Code = EQCY_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= EQCY_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= EQCY_INV_F_ERROR;
-//   }
-//   if ((Std_Parallel < -PI_OVER_2) || (Std_Parallel > PI_OVER_2))
-//   { /* standard parallel out of range */
-//     Error_Code |= EQCY_STDP_ERROR;
-//   }
-//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= EQCY_CENT_MER_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    Eqcy_a = a;
-    Eqcy_f = f;
-    es2 = 2 * Eqcy_f - Eqcy_f * Eqcy_f;
-    es4 = es2 * es2;
-    es6 = es4 * es2;
-    /* spherical radius */
-    Ra = Eqcy_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 /3024.0);
-    Eqcy_Std_Parallel = Std_Parallel;
-    Cos_Eqcy_Std_Parallel = cos(Eqcy_Std_Parallel);
-    Ra_Cos_Eqcy_Std_Parallel = Ra * Cos_Eqcy_Std_Parallel;
-//    if (Central_Meridian > M_PI)
-//      Central_Meridian -= TWO_PI;
-    Eqcy_Origin_Long = Central_Meridian;
-    Eqcy_False_Easting = False_Easting;
-    Eqcy_False_Northing = False_Northing;
-    if (Eqcy_Origin_Long > 0)
-    {
-      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long - M_PI - ONE, &Eqcy_Max_Easting, &temp);
-      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long - M_PI, &Eqcy_Min_Easting, &temp);
-    }
-    else if (Eqcy_Origin_Long < 0)
-    {
-      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long + M_PI, &Eqcy_Max_Easting, &temp);
-      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long + M_PI + ONE, &Eqcy_Min_Easting, &temp);
-    }
-    else
-    {
-      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, M_PI, &Eqcy_Max_Easting, &temp);
-      Eqcy_Min_Easting = -Eqcy_Max_Easting;
-    }
-  } /* End if(!Error_Code) */
-  return (Error_Code);
-} /* End Set_Equidistant_Cyl_Parameters */
-
-
-void ossimEquDistCylProjection::Get_Equidistant_Cyl_Parameters(double *a,
-                                                               double *f,
-                                                               double *Std_Parallel,
-                                                               double *Central_Meridian,
-                                                               double *False_Easting,
-                                                               double *False_Northing)const
-{ /* Begin Get_Equidistant_Cyl_Parameters */
-/*
- * The function Get_Equidistant_Cyl_Parameters returns the current ellipsoid
- * parameters and Equidistant Cylindrical projection parameters.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid						        (output)
- *    Std_Parallel      : Latitude in radians at which the          (output)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (output)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          standard parallel of the projection     (output)
- */
-
-  *a = Eqcy_a;
-  *f = Eqcy_f;
-  *Std_Parallel = Eqcy_Std_Parallel;
-  *Central_Meridian = Eqcy_Origin_Long;
-  *False_Easting = Eqcy_False_Easting;
-  *False_Northing = Eqcy_False_Northing;
-  return;
-} /* End Get_Equidistant_Cyl_Parameters */
-
-
-long ossimEquDistCylProjection::Convert_Geodetic_To_Equidistant_Cyl (double Latitude,
-                                                                     double Longitude,
-                                                                     double *Easting,
-                                                                     double *Northing)const
-   
-{ /* Begin Convert_Geodetic_To_Equidistant_Cyl */
-/*
- * The function Convert_Geodetic_To_Equidistant_Cyl converts geodetic (latitude and
- * longitude) coordinates to Equidistant Cylindrical projection (easting and northing)
- * coordinates, according to the current ellipsoid, spherical radiius
- * and Equidistant Cylindrical projection parameters.
- * If any errors occur, the error code(s) are returned by the
- * function, otherwise EQCY_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double dlam;     /* Longitude - Central Meridan */
-  long Error_Code = EQCY_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   {  /* Latitude out of range */
-//     Error_Code |= EQCY_LAT_ERROR;
-//   }
-//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
-//   {  /* Longitude out of range */
-//     Error_Code|= EQCY_LON_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-    dlam = Longitude - Eqcy_Origin_Long;
-    if (dlam >= TWO_PI)
-    {
-      dlam -= TWO_PI;
-    }
-    if (dlam <= -TWO_PI)
-    {
-      dlam += TWO_PI;
-    }
-
-    *Easting = Ra_Cos_Eqcy_Std_Parallel * dlam + Eqcy_False_Easting;
-    *Northing = Ra * Latitude + Eqcy_False_Northing;
-
-  }
-  return (Error_Code);
-
-} /* End Convert_Geodetic_To_Equidistant_Cyl */
-
-
-long ossimEquDistCylProjection::Convert_Equidistant_Cyl_To_Geodetic(double Easting,
-                                                                    double Northing,
-                                                                    double *Latitude,
-                                                                    double *Longitude)const
-{ /* Begin Convert_Equidistant_Cyl_To_Geodetic */
-/*
- * The function Convert_Equidistant_Cyl_To_Geodetic converts Equidistant Cylindrical projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid, spherical radius
- * and Equidistant Cylindrical projection coordinates.
- * If any errors occur, the error code(s) are returned by the
- * function, otherwise EQCY_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double dx, dy;
-  long Error_Code = EQCY_NO_ERROR;
-
-//   if ((Easting < (Eqcy_False_Easting + Eqcy_Min_Easting))
-//       || (Easting > (Eqcy_False_Easting + Eqcy_Max_Easting)))
-//   { /* Easting out of range */
-//     Error_Code |= EQCY_EASTING_ERROR;
-//   }
-//   if ((Northing < (Eqcy_False_Northing - Eqcy_Delta_Northing))
-//       || (Northing > (Eqcy_False_Northing + Eqcy_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= EQCY_NORTHING_ERROR;
-//   }
-
-  if (!Error_Code)
-  {
-    dy = Northing - Eqcy_False_Northing;
-    dx = Easting - Eqcy_False_Easting;
-    *Latitude = dy / Ra;
-
-    if (Ra_Cos_Eqcy_Std_Parallel == 0)
-      *Longitude = 0;
-    else
-      *Longitude = Eqcy_Origin_Long + dx / Ra_Cos_Eqcy_Std_Parallel;
-
-//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-//       *Latitude = PI_OVER_2;
-//     else if (*Latitude < -PI_OVER_2)
-//       *Latitude = -PI_OVER_2;
-
-//    if (*Longitude > PI)
-//      *Longitude -= TWO_PI;
-//    if (*Longitude < -PI)
-//      *Longitude += TWO_PI;
-
-//    if (*Longitude > PI)  /* force distorted values to 180, -180 degrees */
-//      *Longitude = PI;
-//    else if (*Longitude < -PI)
-//      *Longitude = -PI;
-
-  }
-  return (Error_Code);
-
-} /* End Convert_Equidistant_Cyl_To_Geodetic */
diff --git a/ossim/src/ossim/projection/ossimFcsiModel.cpp b/ossim/src/ossim/projection/ossimFcsiModel.cpp
deleted file mode 100644
index 6f6a96f..0000000
--- a/ossim/src/ossim/projection/ossimFcsiModel.cpp
+++ /dev/null
@@ -1,1064 +0,0 @@
-//*****************************************************************************
-// FILE: ossimFcsiModel.cc
-//
-// Copyright (C) 2001 ImageLinks, Inc.
-//
-// MIT
-//
-// AUTHOR: Oscar Kramer (okramer at imagelinks.com)
-//
-// DESCRIPTION: Contains sensor model implementation for "Frame Camera Scanned
-//   Image" (FCSI, pronounced "foxy"). 
-//   
-//   This model represents image data that was scanned from film exposed by a
-//   conventional aerial frame camera. The data members defined in this class
-//   represent the fundamental quantities needed for the transformation.
-//   Typically, a different set of parameters will be provided in the metadata.
-//   An interface (support data) class will need to be implemented to convert
-//   a particular system's format to the quantities needed by this model.
-// 
-//   Coordinate systems in use are described here:
-//
-//   Pixel    -- line/sample in the digital image. The origin of this system is
-//               the upper left corner of the image, and represents a LEFT-
-//               HANDED coordinate system with Y (line) positive down and X
-//               (sample) positive to the right.
-//
-//   Film     -- x, y related to pixel space by affine transform (which includes
-//               mirror reflection due to left-handed system above) represented
-//               by thePrincipalPoint and the theScanXformMatrix. The latter
-//               contains scale, skew, and rotation/reflection. The film
-//               coordinates are adjusted for radial and decentering distortion.
-//
-//   Camera/  -- 3D system containing film plane and optical (Z) axis. Given the
-//   Platform    focal length (Z) and the film point (X,Y), a 3D ray direction
-//               is established in this space. This space is also termed "LSR"
-//               in the code. If there is a rotation between the film/optical
-//               axes and the platform (interior orientation), then that
-//               transformation must be included as part of the LSR-to-ECF
-//               rotation by the metadata reader object.
-//
-//   ECF      -- Universal earth frame of reference. The imaging ray direction
-//               is transformed from Camera space to ECF by theAdjLsrToEcfRot.
-//
-//   There are two rotations to go from Camera to ECF. First is the initial
-//   camera orientation as derived from the metadata, combining the interior
-//   orientation (relation between camera and platform) and the exterior
-//   orientation dependent on the platform attitude w.r.t. the ECF system.
-//   The second rotation is a differential rotation due to the attitude
-//   adjustable params. These are arbitrarily taken as rotations about the ECF
-//   XYZ axes, not the platform attitude axes of roll/pitch/yaw. The
-//   combined rotation is stored in theAdjLsrToEcfRot, which is precomputed
-//   in updateModel() once with each adjustment.
-//
-//   When the time comes to incorporate least-squares parameter adjustment, care
-//   must be taken to propagate the a priori sigmas for position and attitude
-//   (including both internal and external orientation angles) into the ECF
-//   coordinates. This also applies to the affine transform parameters used in
-//   transforming pixels to film coordinates. The propagated uncertainties can
-//   then be used to assign the adjustable parameter sigmas array (and
-//   covariance when we get to that...)
-//
-// SOFTWARE HISTORY:
-//   16JAN2003  Oscar Kramer, ImageLinks
-//              Initial coding
-//
-//*****************************************************************************
-// $Id: ossimFcsiModel.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <cstdlib>
-#include <fstream>
-#include <sstream>
-
-#include <ossim/projection/ossimFcsiModel.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimEcefRay.h>
-
-RTTI_DEF1(ossimFcsiModel, "ossimFcsiModel", ossimSensorModel);
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimFcsiModel:exec");
-static ossimTrace traceDebug ("ossimFcsiModel:debug");
-
-//***
-// File-scope constants:
-//***
-static const int MODEL_VERSION_NUMBER  = 1;
-static const ossimString PARAM_NAMES[] ={"x_pos_offset",
-                                         "y_pos_offset",
-                                         "z_pos_offset",
-                                         "x_rot_corr",
-                                         "y_rot_corr",
-                                         "z_rot_corr",
-                                         "foc_len_offset",
-                                         "scan_skew_corr"};
-static const ossimString PARAM_UNITS[] ={"meters",
-                                         "meters",
-                                         "meters",
-                                         "degrees",
-                                         "degress",
-                                         "degress",
-                                         "millimeters",
-                                         "degrees"};
-
-//***
-// Public FCSI Keywords:
-//***
-const char* ossimFcsiModel::PRINCIPAL_POINT_X_KW   = "principal_point_x";
-const char* ossimFcsiModel::PRINCIPAL_POINT_Y_KW   = "principal_point_y";
-const char* ossimFcsiModel::SCAN_SCALE_MATRIX_00_KW = "scan_scale_matrix_00";
-const char* ossimFcsiModel::SCAN_SCALE_MATRIX_01_KW = "scan_scale_matrix_01";
-const char* ossimFcsiModel::SCAN_SCALE_MATRIX_10_KW = "scan_scale_matrix_10";
-const char* ossimFcsiModel::SCAN_SCALE_MATRIX_11_KW = "scan_scale_matrix_11";
-const char* ossimFcsiModel::SCAN_ROTATION_ANGLE_KW = "scan_rotation_angle";
-const char* ossimFcsiModel::SCAN_SKEW_ANGLE_KW     = "scan_skew_angle";
-const char* ossimFcsiModel::FOCAL_LENGTH_KW        = "focal_length";
-const char* ossimFcsiModel::PLATFORM_POSITION_X_KW = "platform_position_x";
-const char* ossimFcsiModel::PLATFORM_POSITION_Y_KW = "platform_position_y";
-const char* ossimFcsiModel::PLATFORM_POSITION_Z_KW = "platform_position_z";
-const char* ossimFcsiModel::CAMERA_ORIENTATION_MATRIX_ELEM_KW
-                               = "camera_orientation_matrix_elem_";
-
-//*****************************************************************************
-//  DEFAULT CONSTRUCTOR: ossimFcsiModel()
-//
-//  Note: Using this constructor results in an uninitialized model. It is
-//  expected that either a loadState with valid keywordlist is called, or that
-//  the individual set-methods (including the base-class' set methods are
-//  called. When set-methods are used, a final call to completeInitialization()
-//  (declared in ossimSensorModel) is required to give the model a chance to
-//  "digest" the values previously set.
-//  
-//*****************************************************************************
-ossimFcsiModel::ossimFcsiModel()
-   :
-   ossimSensorModel       (),
-   thePrincipalPoint      (0, 0),
-   theScanSkew            (0.0),  
-   theScanRotation        (0.0),
-   theOpticalDistortion   (0),
-   theLsrToEcfRot         (3, 3),
-   theEcfOffset           (0, 0, 0),
-   theXrotCorr            (0.0),
-   theYrotCorr            (0.0),
-   theZrotCorr            (0.0),
-   theFocalOffset         (0.0),
-   theScanSkewCorr        (0.0),
-   theAdjLsrToEcfRot      (3, 3),
-   theAdjEcfToLsrRot      (3, 3)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
-   theScanScaleMatrix[0] = 1.0;
-   theScanScaleMatrix[1] = 0.0;
-   theScanScaleMatrix[2] = 0.0;
-   theScanScaleMatrix[3] = 1.0;
-   theScanXformMatrix[0] = 1.0;
-   theScanXformMatrix[1] = 0.0;
-   theScanXformMatrix[2] = 0.0;
-   theScanXformMatrix[3] = 1.0;
-   initAdjustableParameters();
-   setErrorStatus(); // indicate uninitialized
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimFcsiModel(filename)
-//  
-//  Constructs model from a keywordlist filename
-//  
-//*****************************************************************************
-ossimFcsiModel::ossimFcsiModel(const ossimFilename& init_file)
-   :
-   ossimSensorModel       (),
-   thePrincipalPoint      (0, 0),
-   theScanSkew            (0.0),  
-   theScanRotation        (0.0),
-   theOpticalDistortion   (0),
-   theLsrToEcfRot         (3, 3),
-   theEcfOffset           (0, 0, 0),
-   theXrotCorr            (0.0),
-   theYrotCorr            (0.0),
-   theZrotCorr            (0.0),
-   theFocalOffset         (0.0),
-   theScanSkewCorr        (0.0),
-   theAdjLsrToEcfRot      (3, 3),
-   theAdjEcfToLsrRot      (3, 3)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
-
-   initAdjustableParameters();
-   ossimKeywordlist kwl (init_file);
-   loadState(kwl);
-
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: Exited..." << std::endl;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimFcsiModel(kwl)
-//  
-//  Constructs model from keywordlist geometry file
-//  
-//*****************************************************************************
-ossimFcsiModel::ossimFcsiModel(const ossimKeywordlist& geom_kwl)
-   :
-   ossimSensorModel       (),
-   thePrincipalPoint      (0, 0),
-   theScanSkew            (0.0),  
-   theScanRotation        (0.0),
-   theOpticalDistortion   (0),
-   theLsrToEcfRot         (3, 3),
-   theEcfOffset           (0, 0, 0),
-   theXrotCorr            (0.0),
-   theYrotCorr            (0.0),
-   theZrotCorr            (0.0),
-   theFocalOffset         (0.0),
-   theScanSkewCorr        (0.0),
-   theAdjLsrToEcfRot      (3, 3),
-   theAdjEcfToLsrRot      (3, 3)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
-
-   initAdjustableParameters();
-   loadState(geom_kwl);
-
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: Exited..." << std::endl;
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: 
-//*****************************************************************************
-ossimFcsiModel::ossimFcsiModel(const ossimFcsiModel& foxy)
-   :
-   ossimSensorModel     (foxy),
-   thePrincipalPoint    (foxy.thePrincipalPoint),
-   theScanSkew          (foxy.theScanSkew),  
-   theScanRotation      (foxy.theScanRotation),
-   theFocalLen          (foxy.theFocalLen),
-   thePlatformPos       (foxy.thePlatformPos),
-   theLsrToEcfRot       (foxy.theLsrToEcfRot),
-   theEcfOffset         (foxy.theEcfOffset),
-   theXrotCorr          (foxy.theXrotCorr),
-   theYrotCorr          (foxy.theYrotCorr),
-   theZrotCorr          (foxy.theZrotCorr),
-   theFocalOffset       (foxy.theFocalOffset),
-   theScanSkewCorr      (foxy.theScanSkewCorr)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
-
-   if(foxy.theOpticalDistortion)
-   {
-      //
-      // Finish the copy:
-      //
-      theOpticalDistortion =
-         new ossimRadialDecentLensDistortion (*(foxy.theOpticalDistortion));
-   }
-
-   for (int i=0; i<4; i++)
-      theScanScaleMatrix[i] = foxy.theScanScaleMatrix[i];
-
-   //***
-   // Compute quantities derived from adjustables:
-   //***
-   updateModel();
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  METHOD: ossimFcsiModel::lineSampleHeightToWorld()
-//  
-//  Performs the line/sample to groundpoint projection given an elevation.
-//
-//  1. Compute ECF Imaging ray (see imagingRay() method below)
-//  5. Intersect imaging ray with elevation surface.
-//
-//*****************************************************************************
-void ossimFcsiModel::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                             const double&   height,
-                                             ossimGpt&       gpt) const
-{
-   bool debug = false;  // setable via interactive debugger
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
-   
-   //***
-   // Extrapolate if point is outside image:
-   //***
-   if (!insideImage(image_point))
-   {
-      gpt = extrapolate(image_point, height);
-   }
-
-   else
-   {
-      //***
-      // First establish imaging ray from image point:
-      //***
-      ossimEcefRay imaging_ray;
-      imagingRay(image_point, imaging_ray);
-      ossimEcefPoint Pecf (imaging_ray.intersectAboveEarthEllipsoid(height));
-      gpt = ossimGpt(Pecf);
-
-      if (traceDebug() || debug)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "Pecf = " << Pecf << std::endl;
-         ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
-      }
-   }
-
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
-}
-   
-   
-//*****************************************************************************
-//  METHOD: ossimFcsiModel::imagingRay()
-//
-//  Establishes an origin (at the platform position) and direction of the
-//  imaging ray as follows:
-//
-//  1. Remove any pixel offset into the image (in the case where the digital
-//     image is a sub-image of a larger scan).
-//  2. Transform pixel coordinates to film point (with inherent lens distortion)
-//  3. Remove radial and decentering lens distortion to arrive at ideal film
-//     coordinates.
-//  4. Establish an internal imaging ray direction vector given the focal length
-//  5. Transform ray direction vector to ECF coordinates and assign origin.
-//
-//*****************************************************************************
-void ossimFcsiModel::imagingRay(const ossimDpt& image_point,
-                                ossimEcefRay&   image_ray) const
-{
-   bool debug = false;  // setable via interactive debugger: "set debug = true"
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: entering..." << std::endl;
-   
-   //***
-   // In case this is a sub-image of a full image scan, need to add the
-   // sub-image offset maintained in the base-class:
-   //***
-   ossimDpt p0 (image_point + theSubImageOffset);
-
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theSubImageOffset = " << theSubImageOffset << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "p0 = " << p0 << std::endl;
-   }
-   
-   //***
-   // Apply pixel to film coordinates affine transform:
-   //***
-   ossimDpt p1 (p0 - theRefImgPt);
-   ossimDpt f1 (theScanXformMatrix[0]*p1.x + theScanXformMatrix[1]*p1.y,
-                theScanXformMatrix[2]*p1.x + theScanXformMatrix[3]*p1.y);
-   ossimDpt film (f1 - thePrincipalPoint);
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theRefImgPt = " << theRefImgPt << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "p1 = " << p1 << std::endl;
-      for (int i=0; i<4; i++)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "theScanXformMatrix["<<i<<"] = "<<theScanXformMatrix[i] << std::endl;
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG) << "f1 = " << f1 << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "thePrincipalPoint = " << thePrincipalPoint << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "film (distorted) = " << film << std::endl;
-   }
-
-   //***
-   // Correct film point for optical (radial, decentering) distortion:
-   //***
-   if (theOpticalDistortion)
-      theOpticalDistortion->inverse(film);
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "film (undistorted) = " << film << std::endl;
-      if(theOpticalDistortion)
-      {
-         theOpticalDistortion->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-   }
-   
-   //***
-   // Establish image ray in  camera-space (LSR) coordinates, then rotate to the
-   // ECF. This rotation contains interior orientation, exterior orientation,
-   // and attitude correction:
-   //***
-   ossimColumnVector3d cam_ray_dir (film.x, film.y, -theAdjFocalLen);
-   ossimEcefVector ecf_ray_dir (theAdjLsrToEcfRot*cam_ray_dir);
-   ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjFocalLen = " << theAdjFocalLen << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "cam_ray_dir = " << cam_ray_dir << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjLsrToEcfRot = \n" << theAdjLsrToEcfRot << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ecf_ray_dir = " << ecf_ray_dir << std::endl;
-   }
-   
-   //***
-   // Establish ECF Ray object to represent imaging ray:
-   //***
-   image_ray.setOrigin(theAdjPlatformPos);
-   image_ray.setDirection(ecf_ray_dir);
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjPlatformPos = " << theAdjPlatformPos << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjPlatformPos (ossimGpt): " << ossimGpt(theAdjPlatformPos)
-                                          << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "image_ray = " << image_ray << std::endl;
-   }
-
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  METHOD ossimFcsiModel::worldToLineSample()
-//
-//  Rigorous inverse transform overrides base-class iterative solution. It
-//  implements the exact reverse transform as imagingRay() above.
-//  
-//*****************************************************************************
-void ossimFcsiModel::worldToLineSample(const ossimGpt& world_point,
-                                       ossimDpt&       image_point) const
-{
-   bool debug = false;  // setable via interactive debugger: "set debug = true"
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: entering..." << std::endl;
-
-   //***
-   // Establish ECF ray from platform to ground point and rotate to platform LSR
-   //***
-   ossimEcefPoint g_ecf (world_point);
-   ossimEcefVector ecf_ray_dir (g_ecf - theAdjPlatformPos);
-   ossimColumnVector3d cam_ray_dir (theAdjEcfToLsrRot*ecf_ray_dir.data());
-
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"world_point = " << world_point << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"g_ecf = " << g_ecf << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjPlatformPos = " << theAdjPlatformPos << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjPlatformPos (ossimGpt): "<<ossimGpt(theAdjPlatformPos)<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"ecf_ray_dir = " << ecf_ray_dir.unitVector() << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjEcfToLsrRot = \n" << theAdjEcfToLsrRot << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG)<<"cam_ray_dir = " << cam_ray_dir << endl;
-   }
-      
-   //***
-   // Scale the direction vector by the focal length to arrive at  film
-   // coordinates:
-   //***
-   double scale = -theAdjFocalLen/cam_ray_dir[2];
-   ossimDpt film (scale*cam_ray_dir[0], scale*cam_ray_dir[1]);
-
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjFocalLen = " << theAdjFocalLen << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "scale = " << scale << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "film (undistorted) = " << film << endl;
-   }
-      
-   //***
-   // Add distortion:
-   //***
-   if (theOpticalDistortion)
-      theOpticalDistortion->forward(film);
-   
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "film (distorted) = " << film << endl;
-   }
-      
-   //***
-   // Apply film to pixel coordinates affine transform:
-   //***
-   ossimDpt f1(film + thePrincipalPoint);
-   ossimDpt p1(theInvScanXformMatrix[0]*f1.x+theInvScanXformMatrix[1]*f1.y,
-               theInvScanXformMatrix[2]*f1.x+theInvScanXformMatrix[3]*f1.y);
-   ossimDpt p0 (p1 + theRefImgPt);
-
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "thePrincipalPoint = " << thePrincipalPoint << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "f1 = " << f1 << endl;
-      for (int i=0; i<4; i++)
-         ossimNotify(ossimNotifyLevel_DEBUG)<<"theInvScanXformMatrix["<<i<<"] = "<<theInvScanXformMatrix[i]
-             <<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "p1 = " << p1 << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theRefImgPt = " << theRefImgPt << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "p0 = " << p0 << endl;
-   }
-      
-   //***
-   // Finally, apply the sub-image offset to get to digital image coordinates:
-   //***
-   image_point = p0 - theSubImageOffset;
-   
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "theImageOffset = " << theSubImageOffset << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << endl;
-   }
-   
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: returning..." << std::endl;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimFcsiModel::print()
-//  
-//  Formatted dump of data members.
-//  
-//*****************************************************************************
-std::ostream& ossimFcsiModel::print(std::ostream& out) const
-{
-   out << "\nDump of ossimFcsiModel object at " << hex << this << ":\n"
-       << "\nossimFcsiModel data members: "
-       << "\n        thePrincipalPoint: " << thePrincipalPoint
-       << "\n        theScanScaleMatrix: " << theScanScaleMatrix[0] << "  "
-       << theScanScaleMatrix[1]
-       << "\n                            " << theScanScaleMatrix[2] << "  "
-       << theScanScaleMatrix[3]
-       << "\n          theScanSkew: " << theScanSkew
-       << "\n      theScanRotation: " << theScanRotation;
-
-   for (int i=0; i<4; ++i)
-   {
-      out << "\ntheScanXformMatrix["<<i<<"]: " << theScanXformMatrix[i];
-   }
-
-   out << "\n          theFocalLen: " << theFocalLen
-       << "\n       thePlatformPos: " << thePlatformPos
-       << "\n       theLsrToEcfRot: \n"  << theLsrToEcfRot
-       << "\n    theAdjLsrToEcfRot: \n" << theAdjLsrToEcfRot
-       << "\n         theEcfOffset: " << theEcfOffset
-       << "\n          theXrotCorr: " << theXrotCorr
-       << "\n          theYrotCorr: " << theYrotCorr
-       << "\n          theZrotCorr: " << theZrotCorr
-       << "\n       theFocalOffset: " << theFocalOffset
-       << "\n      theScanSkewCorr: " << theScanSkewCorr
-       << endl;
-   
-   if (theOpticalDistortion)
-   {
-      out << *theOpticalDistortion << endl;
-   }
-
-   return ossimSensorModel::print(out);
-}
-
-//*****************************************************************************
-//  METHOD: ossimFcsiModel::saveState()
-//  
-//  Saves the model state to the KWL. This KWL also serves as a geometry file.
-//  
-//*****************************************************************************
-bool ossimFcsiModel::saveState(ossimKeywordlist& kwl,
-                              const char* prefix) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: entering..." << std::endl;
-
-   kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimFcsiModel");
-
-   //***
-   // Hand off to base class for common stuff:
-   //***
-   ossimSensorModel::saveState(kwl, prefix);
-
-   //***
-   // Save off data members:
-   //***
-   kwl.add(prefix, PRINCIPAL_POINT_X_KW,    thePrincipalPoint.x);
-   kwl.add(prefix, PRINCIPAL_POINT_Y_KW,    thePrincipalPoint.y);
-   kwl.add(prefix, SCAN_SCALE_MATRIX_00_KW, theScanScaleMatrix[0]);
-   kwl.add(prefix, SCAN_SCALE_MATRIX_01_KW, theScanScaleMatrix[1]);
-   kwl.add(prefix, SCAN_SCALE_MATRIX_10_KW, theScanScaleMatrix[2]);
-   kwl.add(prefix, SCAN_SCALE_MATRIX_11_KW, theScanScaleMatrix[3]);
-   kwl.add(prefix, SCAN_SKEW_ANGLE_KW,      theScanSkew);
-   kwl.add(prefix, SCAN_ROTATION_ANGLE_KW,  theScanRotation);
-   kwl.add(prefix, FOCAL_LENGTH_KW,         theFocalLen);
-   kwl.add(prefix, PLATFORM_POSITION_X_KW,
-           thePlatformPos.x());
-   kwl.add(prefix, PLATFORM_POSITION_Y_KW,
-           thePlatformPos.y());
-   kwl.add(prefix, PLATFORM_POSITION_Z_KW,
-           thePlatformPos.z());
-
-   //***
-   // Camera orientation matrix:
-   // i is row and j is column
-   //***
-   for (int i=0; i<3; i++)
-   {
-      for (int j=0; j<3; j++)
-      {
-         ostringstream ostr;
-         ostr << CAMERA_ORIENTATION_MATRIX_ELEM_KW
-              << i << "_" << j << ends;
-         kwl.add(prefix, ostr.str().c_str(), theLsrToEcfRot[i][j]);
-      }
-   }
-   
-   //***
-   // Optical distortion coefficients:
-   //***
-   if (theOpticalDistortion)
-   {
-      ostringstream ostr;
-      ostr << prefix << "distortion." << ends;
-      theOpticalDistortion->saveState(kwl, ostr.str().c_str());
-   }
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: returning..." << std::endl;
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimFcsiModel::loadState()
-//  
-//  Restores the model's state from the KWL. This KWL also serves as a
-//  geometry file.
-//  
-//*****************************************************************************
-bool ossimFcsiModel::loadState(const ossimKeywordlist& kwl,
-                               const char* prefix) 
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::loadState: entering..." << std::endl;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:"
-                                          << "\nInput kwl:  " << kwl
-                                          << std::endl;
-   }
-
-   const char* value;
-   const char* keyword;
-   bool success;
-
-   //***
-   // Assure this keywordlist contains correct type info:
-   //***
-   keyword = ossimKeywordNames::TYPE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "Type name not found");
-      return false;
-      
-   }
-   if (strcmp(value, TYPE_NAME(this)))
-   {
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: returning..." << std::endl;
-      return false;
-   }
-      
-   //***
-   // Clear out any existing adjustable params:
-   //***
-   
-   //***
-   // Pass on to the base-class for parsing first:
-   //***
-   success = ossimSensorModel::loadState(kwl, prefix);
-   if (!success)
-   {
-      return false;
-   }
-   if(!getNumberOfAdjustableParameters())
-   {
-      initAdjustableParameters();
-   }
-
-   //***
-   // Now begin loading data members:
-   //***
-   keyword = PRINCIPAL_POINT_X_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "principle point x not given");
-      return false;
-   }
-   thePrincipalPoint.x = atof(value);
- 
-   keyword = PRINCIPAL_POINT_Y_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "principle point y not given");
-      return false;
-   }
-      
-   thePrincipalPoint.y = atof(value);
- 
-   keyword = SCAN_SCALE_MATRIX_00_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "scale matrix 0,0 not given");
-      return false;
-   }
-   theScanScaleMatrix[0] = atof(value);
- 
-   keyword = SCAN_SCALE_MATRIX_01_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "scale matrix 0,1 not given");
-      return false;
-   }
-   theScanScaleMatrix[1] = atof(value);
- 
-   keyword = SCAN_SCALE_MATRIX_10_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "scale matrix 1,0 not given");
-      return false;
-   }
-   theScanScaleMatrix[2] = atof(value);
- 
-   keyword = SCAN_SCALE_MATRIX_11_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "scale matrix 1,1 not given");
-      return false;
-   }
-   theScanScaleMatrix[3] = atof(value);
- 
-   keyword = SCAN_SKEW_ANGLE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-      theScanSkew = 0.0;
-   else
-      theScanSkew = atof(value);
-
-   keyword = SCAN_ROTATION_ANGLE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-      theScanRotation = 0.0;
-   else
-      theScanRotation = atof(value);
- 
-   keyword = FOCAL_LENGTH_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "Focal length not given");
-      return false;
-   }
-   theFocalLen = atof(value);
- 
-   keyword = PLATFORM_POSITION_X_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "Platform position X not given");
-      return false;
-   }
-   thePlatformPos.x() = atof(value);
- 
-   keyword = PLATFORM_POSITION_Y_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "Platform position Y not given");
-   }
-   thePlatformPos.y() = atof(value);
- 
-   keyword = PLATFORM_POSITION_Z_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimSetError(getClassName(),
-                    ossimErrorCodes::OSSIM_ERROR,
-                    "Platform position Z not given");
-   }
-   thePlatformPos.z() = atof(value);
-   
-   //***
-   // Platform orientation matrix:
-   //***
-   for (int i=0; i<3; i++)
-   {
-      for (int j=0; j<3; j++)
-      {
-         ostringstream ostr;
-         ostr << CAMERA_ORIENTATION_MATRIX_ELEM_KW
-              << i << "_" << j << ends;
-         ossimString s = ostr.str();
-         keyword = s.c_str();
-         value = kwl.find(prefix, keyword);
-         if (!value)
-         {
-            ossimSetError(getClassName(),
-                          ossimErrorCodes::OSSIM_ERROR,
-                          "Camera orientation matrix not given");
-         }
-         theLsrToEcfRot[i][j] = ossimString(value).toDouble();
-      }
-   }
-   
-   //***
-   // Reading of optical distortion coefficients is left to the service object:
-   //***
-   if (theOpticalDistortion)
-      delete theOpticalDistortion;
-   theOpticalDistortion = new ossimRadialDecentLensDistortion(kwl, prefix);
-
-   //***
-   // Initialize given parameters read:
-   //***
-   clearErrorStatus();
-   updateModel();
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::loadState: returning..." << std::endl;
-   return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimFcsiModel::updateModel()
-//
-// Following a parameter adjustment, this method is called to recompute all
-// dependent quantities that are used by the projection methods.
-// 
-//*****************************************************************************
-void  ossimFcsiModel::updateModel()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::updateModel: entering..." << std::endl;
-   
-   //***
-   // Update the geometry...
-   // Adjusted = Initial + adj_parm[i]*adj_sigma[i]
-   // Some parameters have a zero initial value and that term is not included.
-   //***
-   theEcfOffset.x() = getAdjustableParameter(X_POS) *
-                      getParameterSigma(X_POS);
-   theEcfOffset.y() = getAdjustableParameter(Y_POS) *
-                      getParameterSigma(Y_POS);
-   theEcfOffset.z() = getAdjustableParameter(Z_POS) *
-                      getParameterSigma(Z_POS);
-   theXrotCorr      = getAdjustableParameter(X_ROT) *
-                      getParameterSigma(X_ROT);
-   theYrotCorr      = getAdjustableParameter(Y_ROT) *
-                      getParameterSigma(Y_ROT);
-   theZrotCorr      = getAdjustableParameter(Z_ROT) *
-                      getParameterSigma(Z_ROT);
-   theFocalOffset   = getAdjustableParameter(FOCAL_LEN) *
-                      getParameterSigma(FOCAL_LEN);
-   theScanSkewCorr  = getAdjustableParameter(SCAN_SKEW) *
-                      getParameterSigma(SCAN_SKEW);
-
-   //***
-   // Compute adjusted quatities used in projection code:
-   //***
-   theAdjFocalLen    = theFocalLen    + theFocalOffset;
-   theAdjPlatformPos = thePlatformPos + theEcfOffset;
-   
-   //***
-   // Establish the Scanner to film transform matrix.
-   //
-   // NOTE FOR IMPLEMENTING PARAMETER ADJUSTMENT: while the scan skew
-   // angle is an adjustable parameter, the pixel scaling is not since this
-   // error can be absorbed by the focal length adjustment, though the sigma
-   // for the focal length must be inflated to account for the additional error
-   // source. A similar situation occurrs with the scan rotation which manifests
-   // as an attitude adjustment.
-   //***
-   double cos_rot  = ossim::cosd(theScanRotation);
-   double sin_rot  = ossim::sind(theScanRotation);
-   double tan_skew = ossim::tand(theScanSkew + theScanSkewCorr);
-
-   double a =  theScanScaleMatrix[0]*(sin_rot*tan_skew + cos_rot) +
-               theScanScaleMatrix[1]*(cos_rot*tan_skew - sin_rot);
-   double b =  theScanScaleMatrix[0]*sin_rot + theScanScaleMatrix[1]*cos_rot;
-   double c =  theScanScaleMatrix[2]*(sin_rot*tan_skew + cos_rot) +
-               theScanScaleMatrix[3]*(cos_rot*tan_skew - sin_rot);
-   double d =  theScanScaleMatrix[2]*sin_rot + theScanScaleMatrix[3]*cos_rot;
-
-   theScanXformMatrix[0] = a;
-   theScanXformMatrix[1] = b;
-   theScanXformMatrix[2] = c;
-   theScanXformMatrix[3] = d;
-
-   //***
-   // The inverse of the scanner-to-film transform must be computed since it is
-   // not an orthogonal matrix (inverse != transpose):
-   //***
-   theInvScanXformMatrix[0] =  d/(d*a - b*c);
-   theInvScanXformMatrix[1] = -b/(d*a - b*c);
-   theInvScanXformMatrix[2] =  c/(b*c - a*d);
-   theInvScanXformMatrix[3] = -a/(b*c - a*d);
-
-   //***
-   // Establish the differential rotation matrix due to attitude correction:
-   //***
-   double cw = ossim::cosd(theXrotCorr);
-   double sw = ossim::sind(theXrotCorr);
-   double cp = ossim::cosd(theYrotCorr);
-   double sp = ossim::sind(theYrotCorr);
-   double ck = ossim::cosd(theZrotCorr);
-   double sk = ossim::sind(theZrotCorr);
-
-   NEWMAT::Matrix attitudeCorrection(3, 3);
-   attitudeCorrection(1,1) =  ck*cw - sk*sp*sw;
-   attitudeCorrection(1,2) =  sk*cp;
-   attitudeCorrection(1,3) =  ck*sw + sk*sp*cw;
-   attitudeCorrection(2,1) = -sk*cw - ck*sp*sw;
-   attitudeCorrection(2,2) =  cp*ck;
-   attitudeCorrection(2,3) = -sk*sw + ck*sp*cw;
-   attitudeCorrection(3,1) = -cp*sw;
-   attitudeCorrection(3,2) = -sp;
-   attitudeCorrection(3,3) =  cp*cw;
-
-   //***
-   // Now compute the final LSR to ECF rotation:
-   //***
-   theAdjLsrToEcfRot = attitudeCorrection * theLsrToEcfRot;
-   theAdjEcfToLsrRot = theAdjLsrToEcfRot.t();
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::updateModel: returning..." << std::endl;
-}
-
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimFcsiModel::initAdjustableParameters()
-//  
-//  This method initializes the base class adjustable parameter and associated
-//  sigmas arrays with quantities specific to this model. These are default
-//  values only. A functional implementation would assign the sigmas via a
-//  keywordlist or camera specific derived class.
-//  
-//*****************************************************************************
-void ossimFcsiModel::initAdjustableParameters()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::initAdjustableParameters: entering..." << std::endl;
-
-   int numParams = NUM_ADJUSTABLE_PARAMS;
-   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
-   
-//   if(!getNumberOfAdjustableParameters())
-///   {
-   //***
-   // Allocate storage for adjustables and assign their names and units strings
-   //***
-//      newAdjustment(NUM_ADJUSTABLE_PARAMS);
-//   }
-   //***
-   // Initialize base-class adjustable parameter array:
-   //***
-   for (int i=0; i<numParams; i++)
-   {
-      setAdjustableParameter(i, 0.0);
-      setParameterDescription(i, PARAM_NAMES[i]);
-      setParameterUnit(i, PARAM_UNITS[i]);
-   }
-   
-   //***
-   // Initialize base-class parameter sigma array:
-   //***
-   setParameterSigma(X_POS, 50.0);
-   setParameterSigma(Y_POS, 50.0);
-   setParameterSigma(Z_POS, 50.0);  
-   setParameterSigma(X_ROT, 0.01);
-   setParameterSigma(Y_ROT, 0.01);
-   setParameterSigma(Z_ROT, 0.01);
-   setParameterSigma(FOCAL_LEN,0.005);  
-   setParameterSigma(SCAN_SKEW, 0.001);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::initAdjustableParameters: returning..." << std::endl;
-}
-
-//*****************************************************************************
-// STATIC METHOD: ossimFcsiModel::writeGeomTemplate
-//  
-//  Writes a sample kwl to output stream. Please update this method with any
-//  format and/or keyword changes. It will make life a lot easier for everyone.
-//  
-//*****************************************************************************
-void ossimFcsiModel::writeGeomTemplate(ostream& os)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::writeGeomTemplate: entering..." << std::endl;
-
-   os <<
-      "//*****************************************************************\n"
-      "// Template for Frame Camera Scanned Image (FCSI) model keywordlist\n"
-      "//*****************************************************************\n"
-      << ossimKeywordNames::TYPE_KW << ": " << "ossimFcsiModel" << endl;
-
-   ossimSensorModel::writeGeomTemplate(os);
-   
-   os << "//***\n"
-      << "// Derived-class FCSI Keywords:\n"
-      << "//***\n"
-      << PRINCIPAL_POINT_X_KW << ": <pixels>\n"
-      << PRINCIPAL_POINT_Y_KW << ": <pixels>\n"
-      << SCAN_SCALE_MATRIX_00_KW << ": <mm/pixel>\n"
-      << SCAN_SCALE_MATRIX_01_KW << ": <mm/pixel>\n"
-      << SCAN_SCALE_MATRIX_10_KW << ": <mm/pixel>\n"
-      << SCAN_SCALE_MATRIX_11_KW << ": <mm/pixel>\n"
-      << SCAN_SKEW_ANGLE_KW << ": <degrees> [OPTIONAL]\n"
-      << SCAN_ROTATION_ANGLE_KW << ": <degrees> [OPTIONAL]\n"
-      << FOCAL_LENGTH_KW << ": <millimeters>\n"
-      << PLATFORM_POSITION_X_KW << ": <meters (ECF)>\n"
-      << PLATFORM_POSITION_Y_KW << ": <meters (ECF)>\n"
-      << PLATFORM_POSITION_Z_KW << ": <meters (ECF)>\n"
-      << "\n"
-      << "//***\n"
-      << "// Camera (LSR) to ECF orientation matrix:\n"
-      << "//***\n";
-   
-   for (int i=0; i<3; i++)
-   {
-      for (int j=0; j<3; j++)
-      {
-         ostringstream ostr;
-         ostr << CAMERA_ORIENTATION_MATRIX_ELEM_KW
-              << i << "_" << j << ends;
-         os << ostr.str() << ": <Euler rot matrix element>\n";
-      }
-   }
-
-   os << "\n"
-      << "//***\n"
-      << "// Optical distortion coefficients [OPTIONAL]:\n"
-      << "//***\n"
-      << "distortion."
-      << ossimRadialDecentLensDistortion::RADIAL_DISTORTION_COEFF_KW
-      << "N: <coeff N> (for N <= 5)\n"
-      << "distortion."
-      << ossimRadialDecentLensDistortion::DECENT_DISTORTION_COEFF_KW
-      << "N: <coeff N> (for N <= 4)\n"
-      << endl;
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::writeGeomTemplate: returning..." << std::endl;
-   
-   return;
-}
-
-
diff --git a/ossim/src/ossim/projection/ossimGoogleProjection.cpp b/ossim/src/ossim/projection/ossimGoogleProjection.cpp
deleted file mode 100644
index f4ac61e..0000000
--- a/ossim/src/ossim/projection/ossimGoogleProjection.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//
-//*******************************************************************
-#include <ossim/projection/ossimGoogleProjection.h>
-
-RTTI_DEF1(ossimGoogleProjection, "ossimGoogleProjection", ossimMapProjection)
-
-
-//***************** THIS CODE WAS PULLED FROM THE INTERNET FOR GLOBAL MERCATOR ******
-// I will leave as is without modifications
-//
-#define deg2rad(d) (((d)*M_PI)/180)
-#define rad2deg(d) (((d)*180)/M_PI)
-#define earth_radius 6378137
- 
-/* The following functions take or return there results in degrees */
- 
-double y2lat_d(double y) { return rad2deg(2 * atan(exp(  deg2rad(y) ) ) - M_PI/2); }
-double x2lon_d(double x) { return x; }
-double lat2y_d(double lat) { return rad2deg(log(tan(M_PI/4+ deg2rad(lat)/2))); }
-double lon2x_d(double lon) { return lon; }
- 
-/* The following functions take or return there results in something close to meters, along the equator */
- 
-double y2lat_m(double y) { return rad2deg(2 * atan(exp( (y / earth_radius ) )) - M_PI/2); }
-double x2lon_m(double x) { return rad2deg(x / earth_radius); }
-double lat2y_m(double lat) { return earth_radius * log(tan(M_PI/4+ deg2rad(lat)/2)); }
-double lon2x_m(double lon) { return deg2rad(lon) * earth_radius; }
-
-//******************** END GLOBAL MERCATOR CODE ***********************
-
-ossimGoogleProjection::ossimGoogleProjection(const ossimEllipsoid& ellipsoid,
-                                           const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   thePcsCode = 3857;
-   update();
-}
-ossimGoogleProjection::ossimGoogleProjection(const ossimGoogleProjection& src)
-   :ossimMapProjection(src)
-{
-   thePcsCode = 3857;
-   update();
-}
-   
-ossimGoogleProjection::~ossimGoogleProjection()
-{
-
-}
-
-void ossimGoogleProjection::update()
-{
-   ossimMapProjection::update();
-}
-
-ossimGpt ossimGoogleProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   /*
-	double lon = (eastingNorthing.x / 20037508.34) * 180.0;
-	double lat = (eastingNorthing.y / 20037508.34) * 180.0;
-
-  	lat = 180.0/M_PI * (2.0 * atan(exp(lat * M_PI / 180)) - M_PI / 2.0);
-
-   return ossimGpt(lat, lon, 0, theDatum);  
-   */
-   //return ossimGpt(merc_lat(eastingNorthing.y), merc_lon(eastingNorthing.x), 0, theDatum);
-   return ossimGpt(y2lat_m(eastingNorthing.y), x2lon_m(eastingNorthing.x), 0, theDatum);
-}
-
-ossimDpt ossimGoogleProjection::forward(const ossimGpt &latLon)const
-{
-   /*
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-   //double y = Math.Log(Math.Tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
-   easting = gpt.lond()*20037508.34/180.0;
-   northing = log(tan((90.0 + gpt.latd())*M_PI/360.0))/(M_PI/180.0);
-   northing *=20037508.34/180.0;
-
-   return ossimDpt(easting, northing);
-   */
-
-   return ossimDpt(lon2x_m(latLon.lond()), lat2y_m(latLon.latd()));
-}
-
-bool ossimGoogleProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimGoogleProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   thePcsCode = 3857;
-   // Must do this first.
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-   
-   update();
-   return flag;
-}
-
-bool ossimGoogleProjection::operator==(const ossimProjection& projection) const
-{
-   if (!ossimMapProjection::operator==(projection))
-      return false;
-
-   const ossimGoogleProjection* p = dynamic_cast<const ossimGoogleProjection*>(&projection);
-
-   return (p != 0);
-}
-
-
diff --git a/ossim/src/ossim/projection/ossimIkonosRpcModel.cpp b/ossim/src/ossim/projection/ossimIkonosRpcModel.cpp
deleted file mode 100644
index 52d04b5..0000000
--- a/ossim/src/ossim/projection/ossimIkonosRpcModel.cpp
+++ /dev/null
@@ -1,985 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class ossimIkonosRpcModel. This 
-//    derived class implements the capability of reading Ikonos RPC support
-//    data.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimIkonosRpcModel.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <ossim/projection/ossimIkonosRpcModel.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/base/ossimTrace.h>
-
-
-RTTI_DEF1(ossimIkonosRpcModel, "ossimIkonosRpcModel", ossimRpcModel);
-
-//***
-// Define Trace flags for use within this file:
-//***
-static ossimTrace traceExec  ("ossimIkonosRpcModel:exec");
-static ossimTrace traceDebug ("ossimIkonosRpcModel:debug");
-
-const ossimFilename INIT_RPC_GEOM_FILENAME ("rpc_init.geom");
-
-static const char* MODEL_TYPE        = "ossimIkonosRpcModel";
-static const char* META_DATA_FILE    = "meta_data_file";
-static const char* RPC_DATA_FILE     = "rpc_data_file";
-static const char* LINE_OFF_KW       = "LINE_OFF";
-static const char* SAMP_OFF_KW       = "SAMP_OFF";
-static const char* LAT_OFF_KW        = "LAT_OFF";
-static const char* LONG_OFF_KW       = "LONG_OFF";
-static const char* HEIGHT_OFF_KW     = "HEIGHT_OFF";
-static const char* LINE_SCALE_KW     = "LINE_SCALE";
-static const char* SAMP_SCALE_KW     = "SAMP_SCALE";
-static const char* LAT_SCALE_KW      = "LAT_SCALE";
-static const char* LONG_SCALE_KW     = "LONG_SCALE";
-static const char* HEIGHT_SCALE_KW   = "HEIGHT_SCALE";
-static const char* LINE_NUM_COEFF_KW = "LINE_NUM_COEFF_";
-static const char* LINE_DEN_COEFF_KW = "LINE_DEN_COEFF_";
-static const char* SAMP_NUM_COEFF_KW = "SAMP_NUM_COEFF_";
-static const char* SAMP_DEN_COEFF_KW = "SAMP_DEN_COEFF_";
-
-
-ossimIkonosRpcModel::ossimIkonosRpcModel()
-   :ossimRpcModel(),
-    theSupportData(new ossimIkonosMetaData())
-{
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimIkonosRpcModel
-//  
-//  Constructs given a geometry file that specifies the filenames for the
-//  metadata and RPC data files.
-//  
-//*****************************************************************************
-ossimIkonosRpcModel::ossimIkonosRpcModel(const ossimFilename& geom_file)
-   :  ossimRpcModel(),
-      theSupportData(new ossimIkonosMetaData())
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel Constructor #1: entering..."
-         << std::endl;
-   }
-
-   ossimKeywordlist kwl(geom_file);
-   const char* value;
-   
-   //***
-   // Assure this keywordlist contains correct type info:
-   //***
-   value = kwl.find(ossimKeywordNames::TYPE_KW);
-   if (!value || (strcmp(value, "ossimIkonosRpcModel")))
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG  ossimIkonosRpcModel Constructor #1:"
-            << "\nFailed attempt to construct. sensor type \""<<value
-            << "\" does not match \"ossimIkonosRpcModel\"." << std::endl;
-      }
-
-      theErrorStatus++;
-      if (traceExec())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG  ossimIkonosRpcModel Constructor #1: returning..."
-            << std::endl;
-      }
-      return;
-   }
-
-   //***
-   // Read meta data filename from geom file:
-   //***
-   value = kwl.find(META_DATA_FILE);
-   if (!value)
-   {
-      theErrorStatus++;
-      if (traceExec())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimIkonosRpcModel Constructor #1: returning..."
-            << std::endl;
-      }
-      return;
-   }
-
-   ossimFilename metadata (value);
-
-   //***
-   // Read RPC data filename from geom file:
-   //***
-   value = kwl.find(RPC_DATA_FILE);
-   if (!value)
-   {
-      theErrorStatus++;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG  ossimIkonosRpcModel Constructor #1: returning..." << std::endl;
-      return;
-   }
-   ossimFilename rpcdata (value);
-
-   parseMetaData(metadata);
-   parseRpcData (rpcdata);
-   finishConstruction();
-
-   ossimString drivePart;
-   ossimString pathPart;
-   ossimString filePart;
-   ossimString extPart;
-   geom_file.split(drivePart,
-                   pathPart,
-                   filePart,
-                   extPart);
-
-   
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG returning..." << std::endl;
-   
-   return;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimIkonosRpcModel
-//  
-//  Constructs given filenames for metadata and RPC data.
-//  
-//*****************************************************************************
-ossimIkonosRpcModel::ossimIkonosRpcModel(const ossimFilename& metadata,
-                                         const ossimFilename& rpcdata)
-   :
-   ossimRpcModel(),
-   theSupportData(new ossimIkonosMetaData())
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #2: entering..." << std::endl;
-
-   parseMetaData(metadata);
-   parseRpcData (rpcdata);
-   finishConstruction();
-
-   //***
-   // Save current state in RPC model format:
-   //***
-   ossimString drivePart;
-   ossimString pathPart;
-   ossimString filePart;
-   ossimString extPart;
-   metadata.split(drivePart,
-                  pathPart,
-                  filePart,
-                  extPart);
-   
-   ossimFilename init_rpc_geom;
-   init_rpc_geom.merge(drivePart,
-                       pathPart,
-                       INIT_RPC_GEOM_FILENAME,
-                       "");
-//      (metadata.path().dirCat(ossimRpcModel::INIT_RPC_GEOM_FILENAME));
-   ossimKeywordlist kwl (init_rpc_geom);
-   saveState(kwl);
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #2: returning..." << std::endl;
-}
-
-ossimIkonosRpcModel::~ossimIkonosRpcModel()
-{
-   theSupportData = 0;
-}
-
-//*****************************************************************************
-//  METHOD: ossimIkonosRpcModel::finishConstruction()
-//  
-//*****************************************************************************
-void ossimIkonosRpcModel::finishConstruction()
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel finishConstruction(): entering..."
-         << std::endl;
-   }
-
-   //***
-   // Assign other data members:
-   //***
-   thePolyType      = B; // This may not be true for early RPC imagery
-   theRefImgPt.line = theLineOffset;
-   theRefImgPt.samp = theSampOffset;
-   theRefGndPt.lat  = theLatOffset;
-   theRefGndPt.lon  = theLonOffset;
-   theRefGndPt.hgt  = theHgtOffset;
-
-   //***
-   // Assign the bounding image space rectangle:
-   //***
-   theImageClipRect = ossimDrect(0.0, 0.0,
-                                 theImageSize.samp-1, theImageSize.line-1);
-
-   //---
-   // NOTE:  We must call "updateModel()" to set parameter used by base
-   // ossimRpcModel prior to calling lineSampleHeightToWorld or all
-   // the world points will be same.
-   //---
-   updateModel();   
-
-   //***
-   // Assign the bounding ground polygon:
-   //***
-   ossimGpt v0, v1, v2, v3;
-   ossimDpt ip0 (0.0, 0.0);
-   lineSampleHeightToWorld(ip0, 0.0, v0);
-   ossimDpt ip1 (theImageSize.samp-1.0, 0.0);
-   lineSampleHeightToWorld(ip1, 0.0, v1);
-   ossimDpt ip2 (theImageSize.samp-1.0, theImageSize.line-1.0);
-   lineSampleHeightToWorld(ip2, 0.0, v2);
-   ossimDpt ip3 (0.0, theImageSize.line-1.0);
-   lineSampleHeightToWorld(ip3, 0.0, v3);
-   theBoundGndPolygon
-      = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
-
-   //---
-   // Call compute gsd:
-   // 
-   // This will set theGSD and theMeanGSD using lineSampleHeightToWorld on
-   // three image points.  Previously this was pulled from metadata.  Some of
-   // which was in US Survey feet and not converted to meters.  This method
-   // is more accurate as it uses the sensor model to compute.
-   //---
-   try
-   {
-      // Method throws ossimException.
-      computeGsd();
-   }
-   catch (const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimIkonosRpcModel finishConstruction Caught Exception:\n"
-         << e.what() << std::endl;
-   }
-   
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel finishConstruction(): returning..."
-         << std::endl;
-   }
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimIkonosRpcModel::parseMetaData()
-//  
-//  Parses the Ikonos metadata file.
-//  
-//*****************************************************************************
-void ossimIkonosRpcModel::parseMetaData(const ossimFilename& data_file)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): entering..."
-         << std::endl;
-   }
-
-   FILE* fptr = fopen (data_file, "r");
-   if (!fptr)
-   {
-      ++theErrorStatus;
-      if (traceExec())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimIkonosRpcModel::parseMetaData(data_file) DEBUG:"
-            << "\nCould not open Meta data file:  " << data_file
-            << "\nreturning with error..." << std::endl;
-      }
-      return;
-   }
-
-   char* strptr;
-   // char linebuf[80];
-   char dummy[80], name[80];
-
-   //***
-   // Read the file into a buffer:
-   //***
-   char filebuf[5000];
-   fread(filebuf, 1, 5000, fptr);
-   
-   //***
-   // Image ID:
-   //***
-   strptr = strstr(filebuf, "\nSource Image ID:");
-   if (!strptr)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << endl;
-      }
-
-      fclose( fptr );
-      fptr = 0;
-      return;
-   }
-      
-   sscanf(strptr, "%17c %s", dummy, name);
-   theImageID = name;
-
-   //***
-   // Sensor Type:
-   //***
-   strptr = strstr(strptr, "\nSensor:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << endl;
-      }
-      fclose(fptr);
-      fptr = 0;
-      return;
-   }
-   sscanf(strptr, "%8c %s", dummy, name);
-   theSensorID = name;
-
-   //***
-   // GSD:  NOTE - this will be recomputed by computeGsd method later.
-   //***
-   strptr = strstr(strptr, "\nPixel Size X:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << endl;
-         
-      }
-      fclose(fptr);
-      fptr = 0;
-      return;
-   }
-   
-   sscanf(strptr, "%14c %lf", dummy, &theGSD.samp);
-   strptr = strstr(strptr, "\nPixel Size Y:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << endl;
-         
-      }
-      fclose(fptr);
-      fptr = 0;
-      return;
-   }
-   sscanf(strptr, "%14c %lf", dummy, &theGSD.line);
-
-   //***
-   // Image size:
-   //***
-   strptr = strstr(strptr, "\nColumns:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << endl;
-      }
-         
-      fclose(fptr);
-      fptr = 0;
-      return;
-   }
-   sscanf(strptr, "%s %d", dummy, &theImageSize.samp);
-   strptr = strstr(strptr, "\nRows:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << endl;
-      }
-
-      fclose(fptr);
-      fptr = 0;
-      return;
-  }
-   sscanf(strptr, "%s %d", dummy, &theImageSize.line);
-           
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): returning..."
-         << std::endl;
-   }
-   fclose(fptr);
-   fptr = 0;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimIkonosRpcModel::parseHdrData()
-//  
-//  Parses the Ikonos hdr file.
-//  
-//*****************************************************************************
-bool ossimIkonosRpcModel::parseHdrData(const ossimFilename& data_file)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): entering..."
-         << std::endl;
-   }
-   
-   if( !data_file.exists() )
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
-            << "\nrpc data file <" << data_file << ">. "<< "doesn't exist..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   FILE* fptr = fopen (data_file, "r");
-   if (!fptr)
-   {
-      ++theErrorStatus;
-      
-      if (traceDebug())
-      { 
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
-            << "\nCould not open hdr data file <" << data_file << ">. "
-            << "returning with error..." << std::endl;
-      }
-      return false;
-   }
-
-   char* strptr = 0;
-   // char linebuf[80];
-   char dummy[80];
-   // , name[80];
-
-   //***
-   // Read the file into a buffer:
-   //***
-   char filebuf[5000];
-   fread(filebuf, 1, 5000, fptr);
-
-   //***
-   // GSD:  NOTE - this will be recomputed by computeGsd method later.
-   //***
-   strptr = strstr(filebuf, "\nPixel Size X:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file):"
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed hdr file." << endl;
-      }
-      
-      fclose( fptr ); // cleanup
-      fptr = 0;
-      return false;
-   }
-      
-   sscanf(strptr, "%14c %lf", dummy, &theGSD.samp);
-   strptr = strstr(strptr, "\nPixel Size Y:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed hdr file." << endl;
-      }
-         
-      fclose( fptr ); // cleanup
-      fptr = 0;
-      return false;
-   }
-
-   sscanf(strptr, "%14c %lf", dummy, &theGSD.line);
-
-   //***
-   // Image size:
-   //***
-   strptr = strstr(strptr, "\nColumns:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed hdr file." << endl;
-      }
-         
-      fclose( fptr ); // cleanup
-      fptr = 0;
-      return false;
-   }
-   sscanf(strptr, "%s %d", dummy, &theImageSize.samp);
-   strptr = strstr(strptr, "\nRows:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed hdr file." << endl;
-      }
-      fclose( fptr ); // cleanup
-      fptr = 0;
-      
-      return false;
-   }
-   sscanf(strptr, "%s %d", dummy, &theImageSize.line);
-   
-   fclose( fptr ); // cleanup
-   fptr = 0;
-           
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): returning..."
-         << std::endl;
-   }
-   return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimIkonosRpcModel::parseRpcData()
-//  
-//  Parses the Ikonos RPC data file.
-//  
-//*****************************************************************************
-void ossimIkonosRpcModel::parseRpcData(const ossimFilename& data_file)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): entering..."
-         << std::endl;
-   }
-      
-   if( !data_file.exists() )
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseRpcData(data_file) WARN:"
-            << "\nrpc data file <" << data_file << ">. "<< "doesn't exist..."
-            << std::endl;
-      }
-      ++theErrorStatus;
-      return;
-   }
-   
-   //***
-   // The Ikonos RPC data file is conveniently formatted as KWL file:
-   //***
-   ossimKeywordlist kwl (data_file);
-   if (kwl.getErrorStatus())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "ERROR ossimIkonosRpcModel::parseRpcData(data_file): Could not open RPC data file <" << data_file << ">. " << "Aborting..." << std::endl;
-      ++theErrorStatus;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-         << "returning with error..." << std::endl;
-      return;
-   }
-
-   const char* buf;
-   const char* keyword;
-   
-   //***
-   // Parse data from KWL:
-   //***
-   keyword = LINE_OFF_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-   theLineOffset = atof(buf);
-      
-   keyword = SAMP_OFF_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-   theSampOffset = atof(buf);
-
-   keyword = LAT_OFF_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-      
-   theLatOffset = atof(buf);
-   
-   keyword = LONG_OFF_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-   theLonOffset = atof(buf);
-
-   keyword = HEIGHT_OFF_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-      
-   theHgtOffset = atof(buf);
-
-   keyword = LINE_SCALE_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-   theLineScale = atof(buf);
-   
-   keyword = SAMP_SCALE_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-   theSampScale = atof(buf);
-   
-   keyword = LAT_SCALE_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-   else
-     {
-       // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
-       theSensorID = theSupportData->getSensorID();
-     }
-   
-
-   theLatScale = atof(buf);
-   
-   keyword = LONG_SCALE_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-   theLonScale = atof(buf);
-   
-   keyword = HEIGHT_SCALE_KW;
-   buf = kwl.find(keyword);
-   if (!buf)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                          << "\nAborting construction. Error looking up keyword: "
-                                          << keyword << std::endl;
-      return;
-   }
-      
-   theHgtScale = atof(buf);
-   
-   char kwbuf[32];
-   keyword = kwbuf;
-   for(int i=1; i<=20; i++)
-   {
-      sprintf(kwbuf, "%s%d", LINE_NUM_COEFF_KW, i);
-      buf = kwl.find(keyword);
-      if (!buf)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                             << "\nAborting construction. Error looking up keyword: "
-                                             << keyword << std::endl;
-         return;
-      }
-      
-      theLineNumCoef[i-1] = atof(buf);
-      
-      sprintf(kwbuf, "%s%d", LINE_DEN_COEFF_KW, i);
-      buf = kwl.find(keyword);
-      if (!buf)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                             << "\nAborting construction. Error looking up keyword: "
-                                             << keyword << std::endl;
-         return;
-      }
-      theLineDenCoef[i-1] = atof(buf);
-      
-      sprintf(kwbuf, "%s%d", SAMP_NUM_COEFF_KW, i);
-      buf = kwl.find(keyword);
-      if (!buf)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                             << "\nAborting construction. Error looking up keyword: "
-                                             << keyword << std::endl;
-         return;
-      }
-      theSampNumCoef[i-1] = atof(buf);
-      
-      sprintf(kwbuf, "%s%d", SAMP_DEN_COEFF_KW, i);
-      buf = kwl.find(keyword);
-      if (!buf)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
-                                             << "\nAborting construction. Error looking up keyword: "
-                                             << keyword << std::endl;
-         return;
-      }
-      theSampDenCoef[i-1] = atof(buf);
-   }
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): returning..." << std::endl;
-   return;
-
-   theErrorStatus++;
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): returning with error..." << std::endl;
-   
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimIkonosRpcModel::writeGeomTemplate()
-//  
-//   Writes a template of an ossimIkonosRpcModel geometry file.
-//  
-//*****************************************************************************
-void ossimIkonosRpcModel::writeGeomTemplate(ostream& os)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(os): entering..." << std::endl;
-
-   os <<
-      "//**************************************************************\n"
-      "// Template for Ikonos RPC geometry keywordlist\n"
-      "//\n"
-      "// NOTE: It is preferable to select the full RPC geometry KWL \n"
-      "//       that should have been created with the first use of the\n"
-      "//       derived model type ossimIkonosRpcModel. Using this KWL \n"
-      "//       implies that an initial geometry is being constructed \n"
-      "//       with all adjustable parameters initialized to 0. \n"
-      "//**************************************************************\n"
-      << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
-   os << META_DATA_FILE << ": <string>\n"
-      << RPC_DATA_FILE  << ": <string>\n" << endl;
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(os): returning..." << std::endl;
-   return;
-}
-
-bool ossimIkonosRpcModel::saveState(ossimKeywordlist& kwl,
-				    const char* prefix)const
-{
-   if(theSupportData.valid())
-   {
-      ossimString supportPrefix = ossimString(prefix) + "support_data.";
-      // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
-      theSupportData->saveState(kwl, supportPrefix);
-   }
-
-   ossimRpcModel::saveState(kwl, prefix);
-
-  // this model just sets the base class values so
-  // we do not need to re-construct this model so 
-  // specify the type as the base class type
-  //
-//   kwl.add(prefix,
-// 	  ossimKeywordNames::TYPE_KW,
-// 	  STATIC_TYPE_NAME(ossimRpcModel),
-// 	  true);
-
-  // cout << "kwl:\n" << kwl << std::endl;
-
-  return true;
-}
-
-bool ossimIkonosRpcModel::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   if(theSupportData.valid())
-   {
-      ossimString supportPrefix = ossimString(prefix) + "support_data.";
-      theSupportData->loadState(kwl, supportPrefix);
-   }
-
-   return ossimRpcModel::loadState(kwl, prefix);
-}
-
-bool ossimIkonosRpcModel::parseFile(const ossimFilename& file)
-{
-      return parseTiffFile(file);
-}
-
-bool ossimIkonosRpcModel::parseTiffFile(const ossimFilename& filename)
-{
-   bool result = false;
-   
-   ossimRefPtr<ossimTiffTileSource> tiff = new ossimTiffTileSource();
-
-   if ( tiff->open(filename) )
-   {
-      if ( !theSupportData )
-      {
-         theSupportData = new ossimIkonosMetaData();
-      }
-
-      if ( theSupportData->open(filename) == false )
-      {
-         if(traceDebug())
-         {
-            // Currently not required by model so we will not error out here.
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "WARNING: ossimIkonosMetaData::open returned false.\n"
-               << std::endl;
-         }
-      }
-      else
-      {
-         // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
-         theSensorID = theSupportData->getSensorID();
-      }
-
-      //convert file to rpc filename and hdr filename so we can get some info
-      ossimFilename rpcfile = filename.noExtension();
-      rpcfile += "_rpc.txt";
-      
-      ossimFilename hdrfile = filename;
-      hdrfile.setExtension(ossimString("hdr"));
-      
-      if( parseHdrData(hdrfile) )
-      {
-         // parseRpcData sets the error status on error.
-         parseRpcData (rpcfile);
-         if ( !getErrorStatus() ) //check for errors in parsing rpc data
-         {
-            finishConstruction();
-            
-            //---
-            // Save current state in RPC model format:
-            //---
-            ossimString drivePart;
-            ossimString pathPart;
-            ossimString filePart;
-            ossimString extPart;
-            filename.split(drivePart,
-                           pathPart,
-                           filePart,
-                           extPart);
-            
-            ossimFilename init_rpc_geom;
-            init_rpc_geom.merge(drivePart,
-                                pathPart,
-                                INIT_RPC_GEOM_FILENAME,
-                                "");
-
-            ossimKeywordlist kwl (init_rpc_geom);
-            saveState(kwl);
-
-            // If we get here set the return status to true.
-            result = true;
-
-         } // matches: if ( !getErrorStatus() )
-   
-      } // matches: if( parseHdrData(hdrfile) )
-
-   } // matches:  if ( tiff->open(filename) )
-   
-   if ( traceExec() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "return status: " << (result?"true\n":"false\n")
-         << "DEBUG ossimIkonosRpcModel parseTiffFile: returning..."
-         << std::endl;
-   }
-
-   return result;
-}
-
-bool ossimIkonosRpcModel::isNitf(const ossimFilename& filename)
-{
-   std::ifstream in(filename.c_str(), ios::in|ios::binary);
-   
-   if(in)
-   {
-      char nitfFile[4];
-      in.read((char*)nitfFile, 4);
-
-      return (ossimString(nitfFile,
-                          nitfFile+4) == "NITF");
-   }
-
-   return false;
-}
-
diff --git a/ossim/src/ossim/projection/ossimImageProjectionModel.cpp b/ossim/src/ossim/projection/ossimImageProjectionModel.cpp
deleted file mode 100644
index b09769d..0000000
--- a/ossim/src/ossim/projection/ossimImageProjectionModel.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//-----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class definition of ossimImageProjectionModel.
-//
-//-----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/projection/ossimImageProjectionModel.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/projection/ossimProjection.h>
-#include <string>
-
-RTTI_DEF1(ossimImageProjectionModel,
-          "ossimImageProjectionModel",
-          ossimImageModel)
-
-ossimImageProjectionModel::ossimImageProjectionModel()
-   : ossimImageModel(),
-     theProjection(0)
-{
-}
-
-ossimImageProjectionModel::~ossimImageProjectionModel()
-{
-   theProjection = 0;
-}
-
-void ossimImageProjectionModel::initialize(const ossimImageHandler& ih)
-{
-   // Initialize base.
-   ossimImageModel::initialize(ih);
-   
-   theProjection = 0;
-
-   // Fetch the handler's image geometry and see if it has a projection:
-   ossimImageHandler* iih = const_cast<ossimImageHandler*>(&ih); // cast away constness
-   ossimRefPtr<ossimImageGeometry> image_geom = iih->getImageGeometry();
-   if ( image_geom.valid() )
-   {
-      theProjection = image_geom->getProjection();
-   }
-}
-
-const ossimProjection* ossimImageProjectionModel::getProjection() const
-{
-   return theProjection;
-}
-
diff --git a/ossim/src/ossim/projection/ossimImageViewAffineTransform.cpp b/ossim/src/ossim/projection/ossimImageViewAffineTransform.cpp
deleted file mode 100644
index 18af2e2..0000000
--- a/ossim/src/ossim/projection/ossimImageViewAffineTransform.cpp
+++ /dev/null
@@ -1,339 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimImageViewAffineTransform.cpp 23423 2015-07-13 19:07:38Z dburken $
-
-#include <ossim/projection/ossimImageViewAffineTransform.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimMatrix3x3.h>
-#include <ossim/base/ossimString.h>
-
-RTTI_DEF1(ossimImageViewAffineTransform, "ossimImageViewAffineTransform", ossimImageViewTransform)
-
-ossimImageViewAffineTransform::ossimImageViewAffineTransform(double rotateDegrees,
-                                                             double imageScaleX,
-                                                             double imageScaleY,
-                                                             double scaleXValue,
-                                                             double scaleYValue,
-                                                             double translateXValue,
-                                                             double translateYValue,
-                                                             double pivotXValue,
-                                                             double pivotYValue)
-   :m_transform(3,3),
-    m_inverseTransform(3,3),
-    m_rotation(rotateDegrees),
-    m_imageSpaceScale(imageScaleX,imageScaleY),
-    m_scale(scaleXValue, scaleYValue),
-    m_translate(translateXValue, translateYValue),
-    m_pivot(pivotXValue, pivotYValue)
-{
-   m_transform << 1 << 0 << 0
-                << 0 << 1 << 0
-                << 0 << 0 << 1;
-   
-   m_inverseTransform << 1 << 0 << 0
-                       << 0 << 1 << 0
-                       << 0 << 0 << 1;
-
-   
-   rotate(rotateDegrees);
-   scale(scaleXValue, scaleYValue);
-   translate(translateXValue, translateYValue);
-   pivot(m_pivot.x, m_pivot.y);
-}
-
-ossimImageViewAffineTransform::~ossimImageViewAffineTransform()
-{
-}
-
-void ossimImageViewAffineTransform::imageToView(const ossimDpt& imagePoint,
-                                                ossimDpt&       viewPoint)const
-{
-   
-    viewPoint.x = m_transform[0][0]*imagePoint.x + m_transform[0][1]*imagePoint.y + m_transform[0][2];
-    viewPoint.y = m_transform[1][0]*imagePoint.x + m_transform[1][1]*imagePoint.y + m_transform[1][2];
-}
-
-void ossimImageViewAffineTransform::viewToImage(const ossimDpt& viewPoint,
-                                                ossimDpt&       imagePoint)const
-{
-   imagePoint.x = m_inverseTransform[0][0]*viewPoint.x + m_inverseTransform[0][1]*viewPoint.y + m_inverseTransform[0][2];
-   imagePoint.y = m_inverseTransform[1][0]*viewPoint.x + m_inverseTransform[1][1]*viewPoint.y + m_inverseTransform[1][2];
-}
-
-void ossimImageViewAffineTransform::setMatrix(NEWMAT::Matrix& matrix)
-{
-   m_transform        = matrix;
-   m_inverseTransform = m_transform.i();
-}
-
-const NEWMAT::Matrix& ossimImageViewAffineTransform::getMatrix()const
-{
-   return m_transform;
-}
-
-void ossimImageViewAffineTransform::translate(double deltaX,
-                                              double deltaY)
-{
-   m_translate = ossimDpt(deltaX, deltaY);
-   buildCompositeTransform();
-//    NEWMAT::Matrix m(3,3);
-
-//    m << 1 << 0 << deltaX
-//      << 0 << 1 << deltaY
-//      << 0 << 0 << 1;
-   
-   
-//    m_transform = m*m_transform;
-//    m_inverseTransform = m_transform.i();
-}
-
-void ossimImageViewAffineTransform::translateX(double deltaX)
-{
-   translate(deltaX, m_translate.y);
-}
-
-void ossimImageViewAffineTransform::translateY(double deltaY)
-{
-   translate(m_translate.x, deltaY);
-}
-
-void ossimImageViewAffineTransform::imageSpaceScale(double x, double y)
-{
-   m_imageSpaceScale = ossimDpt(x,y);
-   buildCompositeTransform();
-}
-
-void ossimImageViewAffineTransform::imageSpaceScaleX(double x)
-{
-   imageSpaceScale(x, m_imageSpaceScale.y);
-}
-
-void ossimImageViewAffineTransform::imageSpaceScaleY(double y)
-{
-   imageSpaceScale(m_imageSpaceScale.x, y);
-}
-
-void ossimImageViewAffineTransform::scale(double x, double y)
-{
-//    NEWMAT::Matrix m(3, 3);
-
-//    m << x << 0 << 0
-//      << 0 << y << 0
-//      << 0 << 0 << 1;
-
-   
-//   m_transform = (m*m_transform);
-
-//   m_inverseTransform = m_transform.i();
-
-   m_scale = ossimDpt(x,y);
-   buildCompositeTransform();
-}
-
-void ossimImageViewAffineTransform::scaleX(double x)
-{
-   scale(x, m_scale.y);
-}
-
-void ossimImageViewAffineTransform::scaleY(double y)
-{
-   scale(m_scale.x, y);
-}
-
-void ossimImageViewAffineTransform::pivot(double originX, double originY)
-{
-   m_pivot.x = originX;
-   m_pivot.y = originY;
-   buildCompositeTransform();
-}
-
-void ossimImageViewAffineTransform::pivotX(double originX)
-{
-   pivot(originX,m_pivot.y);
-}
-
-void ossimImageViewAffineTransform::pivotY(double originY)
-{
-   pivot(m_pivot.x, originY);
-}
-
-void ossimImageViewAffineTransform::rotate(double degrees)
-{
-   m_rotation = degrees;
-   buildCompositeTransform();
-//   m_transform = (m_transform * ossimMatrix3x3::createRotationZMatrix(degrees));
-//    m_transform = ossimMatrix3x3::createRotationZMatrix(degrees) * m_transform;
-
-//    m_inverseTransform = m_transform.i();
-}
-
-void ossimImageViewAffineTransform::buildCompositeTransform()
-{
-   NEWMAT::Matrix imageSpaceScaleM(3,3);
-   NEWMAT::Matrix scaleM(3, 3);
-   NEWMAT::Matrix rotzM = ossimMatrix3x3::createRotationZMatrix(m_rotation);
-   NEWMAT::Matrix transM(3,3);
-   NEWMAT::Matrix transOriginM(3,3);
-   NEWMAT::Matrix transOriginNegatedM(3,3);
-
-   transM << 1 << 0 << m_translate.x
-          << 0 << 1 << m_translate.y
-          << 0 << 0 << 1;
-   
-   transOriginM << 1 << 0 << m_pivot.x
-                << 0 << 1 << m_pivot.y
-                << 0 << 0 << 1;
-   
-   transOriginNegatedM << 1 << 0 << -m_pivot.x
-                       << 0 << 1 << -m_pivot.y
-                       << 0 << 0 << 1;
-   
-   scaleM << m_scale.x << 0 << 0
-          << 0 << m_scale.y << 0
-          << 0 << 0 << 1;
-   
-   imageSpaceScaleM << m_imageSpaceScale.x << 0 << 0
-          << 0 << m_imageSpaceScale.y << 0
-          << 0 << 0 << 1;
-
-//   m_transform        = transOriginM*transM*scaleM*rotzM*transOriginNegatedM;
-   // pivot should just be around the rotation
-   m_transform        = transM*scaleM*transOriginM*rotzM*imageSpaceScaleM*transOriginNegatedM;
-   m_inverseTransform = m_transform.i();
-   
-}
-
-
-bool ossimImageViewAffineTransform::loadState(const ossimKeywordlist& kwl,
-                                              const char* prefix)
-{
-   ossimString imageScaleString(kwl.find(prefix,"image_scale"));
-   ossimString scaleString(kwl.find(prefix,"scale"));
-   ossimString pivotString(kwl.find(prefix,"pivot"));
-   ossimString translateString(kwl.find(prefix,"translate"));
-   ossimString rotateString(kwl.find(prefix,"rotate"));
-   
-   if(!imageScaleString.empty())
-   {
-      m_imageSpaceScale.toPoint(imageScaleString);
-   }
-   if(!scaleString.empty())
-   {
-      m_scale.toPoint(scaleString);
-   }
-   if(!pivotString.empty())
-   {
-      m_pivot.toPoint(pivotString);
-   }
-   if(!translateString.empty())
-   {
-      m_translate.toPoint(translateString);
-   }
-   if(!rotateString.empty())
-   {
-      m_rotation = rotateString.toDouble();
-   }
-   buildCompositeTransform();
-   ossimImageViewTransform::loadState(kwl, prefix);
-   return true;
-}
-
-bool ossimImageViewAffineTransform::saveState(ossimKeywordlist& kwl,
-                                              const char* prefix)const
-{
-   kwl.add(prefix,
-           "image_scale",
-           m_imageSpaceScale.toString(),
-           true);
-   kwl.add(prefix,
-           "rotation",
-           m_rotation,
-           true);
-   kwl.add(prefix,
-           "pivot",
-           m_pivot.toString(),
-           true);
-   kwl.add(prefix,
-           "scale",
-           m_scale.toString(),
-           true);
-   kwl.add(prefix,
-           "translate",
-           m_translate.toString(),
-           true);
-           
-   return ossimImageViewTransform::saveState(kwl,prefix);
-}
-
-bool ossimImageViewAffineTransform::isValid()const
-{
-   return true;
-}
-
-bool ossimImageViewAffineTransform::setView(ossimObject* obj)
-{
-   ossimImageViewAffineTransform* view = dynamic_cast<ossimImageViewAffineTransform*> (obj);
-   if(view)
-   {  
-      m_transform = view->m_transform;
-      m_inverseTransform = view->m_inverseTransform;
-      m_rotation = view->m_rotation;
-      m_imageSpaceScale = view->m_imageSpaceScale;
-      m_scale = view->m_scale;
-      m_translate = view->m_translate;
-      m_pivot = view->m_pivot;
-   }
-   return (view!=0);
-}
-
-ossimObject* ossimImageViewAffineTransform::getView()
-{
-   return this;
-}
-
-const ossimObject* ossimImageViewAffineTransform::getView()const
-{
-   return this;
-}
-
-ossimDpt ossimImageViewAffineTransform::getInputMetersPerPixel()const
-{
-   return ossimDpt(1,1);
-}
-
-ossimDpt ossimImageViewAffineTransform::getOutputMetersPerPixel()const
-{
-   ossimDpt result;
-   
-   result.makeNan();
-   
-   return result;
-}
-
-bool ossimImageViewAffineTransform::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
-{
-   bool result = ossimImageViewTransform::isEqualTo(obj,compareType);
-   
-   if(result)
-   {
-      result = false;
-      const ossimImageViewAffineTransform* rhs = dynamic_cast<const ossimImageViewAffineTransform*> (&obj);
-      if(rhs)
-      {
-         result = (ossim::almostEqual(m_rotation, rhs->m_rotation)&&
-                   (m_imageSpaceScale.isEqualTo(rhs->m_imageSpaceScale))&&
-                   (m_scale.isEqualTo(rhs->m_scale))&&                   
-                   (m_translate.isEqualTo(rhs->m_translate))&&
-                   (m_pivot.isEqualTo(rhs->m_pivot))
-                   );  
-      }
-   }
-   
-   return result;
-}
diff --git a/ossim/src/ossim/projection/ossimImageViewProjectionTransform.cpp b/ossim/src/ossim/projection/ossimImageViewProjectionTransform.cpp
deleted file mode 100644
index 8747e33..0000000
--- a/ossim/src/ossim/projection/ossimImageViewProjectionTransform.cpp
+++ /dev/null
@@ -1,508 +0,0 @@
-//*****************************************************************************
-// FILE: ossimImageViewProjectionTransform.cc
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Garrett Potts
-//         Oscar Kramer (oscar at krameranalytic.com)
-//
-// DESCRIPTION: Contains declaration of ossimImageViewProjectionTransform.
-//    This class provides an image to view transform that utilizes two
-//    independent 2D-to-3D projections. Intended for transforming view to
-//    geographic "world" space to input image space.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimImageViewProjectionTransform.cpp 23664 2015-12-14 14:17:27Z dburken $
-//
-#include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimGeoPolygon.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimPolyArea2d.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <cmath>
-
-RTTI_DEF1(ossimImageViewProjectionTransform,
-          "ossimImageViewProjectionTransform",
-          ossimImageViewTransform);
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimImageViewProjectionTransform
-//*****************************************************************************
-ossimImageViewProjectionTransform::ossimImageViewProjectionTransform
-(  ossimImageGeometry* imageGeometry, ossimImageGeometry* viewGeometry)
-:  m_imageGeometry(imageGeometry),
-   m_viewGeometry(viewGeometry)
-{
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimImageViewProjectionTransform
-//*****************************************************************************
-ossimImageViewProjectionTransform::
-ossimImageViewProjectionTransform(const ossimImageViewProjectionTransform& src)
-: ossimImageViewTransform(src),
-  m_imageGeometry(src.m_imageGeometry),
-  m_viewGeometry(src.m_viewGeometry)
-{
-}
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimImageViewProjectionTransform
-//*****************************************************************************
-ossimImageViewProjectionTransform::~ossimImageViewProjectionTransform()
-{
-}
-
-//*****************************************************************************
-//  Workhorse of the object. Converts image-space to view-space.
-//*****************************************************************************
-void ossimImageViewProjectionTransform::imageToView(const ossimDpt& ip, ossimDpt& vp) const
-{
-   // Check for same geometries on input and output (this includes NULL geoms):
-   if (m_imageGeometry == m_viewGeometry)
-   {
-      vp = ip;
-      return;
-   }
-   
-   // Otherwise we need access to good geoms. Check for a bad geometry object:
-   if (!m_imageGeometry || !m_viewGeometry)
-   {
-      vp.makeNan();
-      return;
-   }
-   
-   // Check for same projection on input and output sides to save projection to ground:
-   if (m_imageGeometry->getProjection() == m_viewGeometry->getProjection())
-   {
-      // Check for possible same 2D transforms as well:
-      if ( (m_imageGeometry->getTransform() == m_viewGeometry->getTransform()) &&
-           (m_imageGeometry->decimationFactor(0) == m_viewGeometry->decimationFactor(0)) )
-      {
-         vp = ip;
-         return;
-      }
-      
-      // Not the same 2D transform, so just perform local-image -> full-image -> local-view:
-      ossimDpt fp;
-      m_imageGeometry->rnToFull(ip, 0, fp);
-      m_viewGeometry->fullToRn(fp, 0, vp);
-      return;
-   }
-   
-   //---
-   // Completely different left and right side geoms (typical situation).
-   // Need to project to ground.
-   //---
-   ossimGpt gp;
-   m_imageGeometry->localToWorld(ip, gp);
-   m_viewGeometry->worldToLocal(gp, vp);
-
-#if 0 /* Please leave for debug. */
-   cout <<"DEBUG ossimImageViewProjectionTransform::imageToView:"
-        <<"\n    ip: "<<ip
-        <<"\n    gp: "<<gp
-        <<"\n    vp: "<<vp<<std::endl;
-#endif
-}
-
-//*****************************************************************************
-//  Other workhorse of the object. Converts view-space to image-space.
-//*****************************************************************************
-void ossimImageViewProjectionTransform::viewToImage(const ossimDpt& vp, ossimDpt& ip) const
-{
-   // Check for same geometries on input and output (this includes NULL geoms):
-   if (m_imageGeometry == m_viewGeometry)
-   {
-      ip = vp;
-      return;
-   }
-   
-   // Otherwise we need access to good geoms. Check for a bad geometry object:
-   if (!m_imageGeometry || !m_viewGeometry)
-   {
-      ip.makeNan();
-      return;
-   }
-   
-   // Check for same projection on input and output sides to save projection to ground:
-   const ossimProjection* iproj = m_imageGeometry->getProjection();
-   const ossimProjection* vproj = m_viewGeometry->getProjection();
-   if ((iproj && vproj && iproj->isEqualTo(*vproj)) || (iproj == vproj))
-   {
-      // Check for possible same 2D transforms as well:
-      const ossim2dTo2dTransform* ixform = m_imageGeometry->getTransform();
-      const ossim2dTo2dTransform* vxform = m_viewGeometry->getTransform();
-      if (((ixform && vxform && ixform->isEqualTo(*vxform)) || (ixform == vxform)) &&
-          (m_imageGeometry->decimationFactor(0) == m_viewGeometry->decimationFactor(0)))
-      {
-         ip = vp;
-         return;
-      }
-      
-      // Not the same 2D transform, so just perform local-image -> full-image -> local-view:
-      ossimDpt fp;
-      m_viewGeometry->rnToFull(vp, 0, fp);
-      m_imageGeometry->fullToRn(fp, 0, ip);
-      return;
-   }
-   
-   //---
-   // Completely different left and right side geoms (typical situation).
-   // Need to project to ground.
-   //---
-   ossimGpt gp;
-   m_viewGeometry->localToWorld(vp, gp);
-   m_imageGeometry->worldToLocal(gp, ip);
-
-#if 0 /* Please leave for debug. */
-   cout <<"DEBUG ossimImageViewProjectionTransform::viewToImage:"
-        <<"\n    vp: "<<vp
-        <<"\n    gp: "<<gp
-        <<"\n    ip: "<<ip
-        <<std::endl;
-#endif
-}
-
-//*****************************************************************************
-//! OLK: Not sure where this is used, but needed to satisfy ossimViewInterface base class.
-//*****************************************************************************
-bool ossimImageViewProjectionTransform::setView(ossimObject* baseObject)
-{
-   ossimImageGeometry* g = dynamic_cast<ossimImageGeometry*>(baseObject);
-   bool new_view_set = false;
-   if (g)
-   {
-      m_viewGeometry = g;
-      new_view_set = true;
-   }
-   else
-   {
-      ossimProjection* proj = dynamic_cast<ossimProjection*>(baseObject);
-      if(proj)
-      {
-         if(m_viewGeometry.valid())
-         {
-            m_viewGeometry->setProjection(proj);
-         }
-         else
-         {
-            m_viewGeometry = new ossimImageGeometry(0, proj);
-         }
-
-         new_view_set = true;
-      }
-   }
-
-   if ( m_viewGeometry.valid() && m_viewGeometry->getImageSize().hasNans() )
-   {
-      // Sets the view image size from the image geometry if present.
-      initializeViewSize();
-   } 
-
-   return new_view_set;
-}
-
-//*****************************************************************************
-//  Dumps contents to stream
-//*****************************************************************************
-std::ostream& ossimImageViewProjectionTransform::print(std::ostream& out)const
-{
-    out << "ossimImageViewProjectionTransform::print: ..... entered " <<endl;
-
-    if(m_imageGeometry.valid())
-    {
-        out << "  Input Image (LEFT) Geometry: " << endl;
-        m_imageGeometry->print(out);
-    }
-    else
-    {
-        out << "  None defined." << endl;
-    }
-    if(m_viewGeometry.valid())
-    {
-        out << "Output View (RIGHT) Geometry: " << endl;
-        m_viewGeometry->print(out);
-    }
-    else
-    {
-        out << "  None defined." << endl;
-    }
-    return out;
-}
-
-//**************************************************************************************************
-// Converts the local image space rect into bounding view-space rect
-//**************************************************************************************************
-ossimDrect ossimImageViewProjectionTransform::getImageToViewBounds(const ossimDrect& imageRect)const
-{
-    // Let base class try:
-   ossimDrect result = ossimImageViewTransform::getImageToViewBounds(imageRect);
-
-   // If not successful, compute using input and output geometries:
-   if (result.hasNans() && m_imageGeometry.valid() && m_viewGeometry.valid() &&
-       m_imageGeometry->hasProjection() && m_viewGeometry->hasProjection())
-   {
-      ossimGeoPolygon viewClip;
-      m_viewGeometry->getProjection()->getGroundClipPoints(viewClip);
-      if(viewClip.size())
-      {
-         std::vector<ossimGpt> imageGpts(4);
-         m_imageGeometry->localToWorld(imageRect.ul(), imageGpts[0]);
-         m_imageGeometry->localToWorld(imageRect.ur(), imageGpts[1]);
-         m_imageGeometry->localToWorld(imageRect.lr(), imageGpts[2]);
-         m_imageGeometry->localToWorld(imageRect.ll(), imageGpts[3]);
-
-         const ossimDatum* viewDatum = m_viewGeometry->getProjection()->origin().datum();
-         imageGpts[0].changeDatum(viewDatum);
-         imageGpts[1].changeDatum(viewDatum);
-         imageGpts[2].changeDatum(viewDatum);
-         imageGpts[3].changeDatum(viewDatum);
-         
-         ossimPolyArea2d viewPolyArea(viewClip.getVertexList());
-         ossimPolyArea2d imagePolyArea(imageGpts);
-         viewPolyArea &= imagePolyArea;
-         std::vector<ossimPolygon> visiblePolygons;
-         viewPolyArea.getVisiblePolygons(visiblePolygons);
-         if(visiblePolygons.size())
-         {
-            std::vector<ossimDpt> vpts;
-            ossim_uint32 idx = 0;
-            for(idx=0; idx<visiblePolygons[0].getNumberOfVertices();++idx)
-            {
-               ossimDpt tempPt;
-               ossimGpt gpt(visiblePolygons[0][idx].lat, visiblePolygons[0][idx].lon, 0.0,  viewDatum);
-               m_viewGeometry->worldToLocal(gpt, tempPt);
-               vpts.push_back(tempPt);
-            }
-            result = ossimDrect(vpts);
-         }
-      }
-   }
-   return result;
-}
-
-//*****************************************************************************
-//  METHOD: ossimImageViewProjectionTransform::loadState
-//*****************************************************************************
-bool ossimImageViewProjectionTransform::loadState(const ossimKeywordlist& kwl,
-                                                  const char* prefix)
-{
-   bool result = ossimImageViewTransform::loadState(kwl, prefix);
-   if(result)
-   {
-      ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
-      ossimString viewPrefix  = ossimString(prefix)+"view_geometry.";
-      if(kwl.numberOf(imagePrefix.c_str())>0)
-      {
-         m_imageGeometry = new ossimImageGeometry();
-         m_imageGeometry->loadState(kwl, imagePrefix.c_str());
-      }
-      if(kwl.numberOf(viewPrefix.c_str())>0)
-      {
-         m_viewGeometry = new ossimImageGeometry();
-         m_viewGeometry->loadState(kwl, viewPrefix.c_str());
-      }
-      
-   }
-   
-   return result;
-}
-
-//**************************************************************************************************
-// 
-//**************************************************************************************************
-bool ossimImageViewProjectionTransform::saveState(ossimKeywordlist& kwl,
-                                                  const char* prefix)const
-{
-   ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
-   ossimString viewPrefix  = ossimString(prefix)+"view_geometry.";
-   
-   if(m_imageGeometry.valid())
-   {
-      m_imageGeometry->saveState(kwl, imagePrefix.c_str());
-   }
-   if(m_viewGeometry.valid())
-   {
-      m_viewGeometry->saveState(kwl, viewPrefix.c_str());
-   }
-   return ossimImageViewTransform::saveState(kwl, prefix);
-}
-
-//**************************************************************************************************
-// Returns the GSD of input image.
-//**************************************************************************************************
-ossimDpt ossimImageViewProjectionTransform::getInputMetersPerPixel() const
-{
-    ossimDpt result;
-
-    if (m_imageGeometry.valid() && m_imageGeometry->hasProjection())
-        result = m_imageGeometry->getProjection()->getMetersPerPixel();
-    else
-        result.makeNan();
-
-    return result;
-}
-
-//**************************************************************************************************
-// Returns the GSD of the output view.
-//**************************************************************************************************
-ossimDpt ossimImageViewProjectionTransform::getOutputMetersPerPixel() const
-{
-    ossimDpt result;
-
-    if(m_viewGeometry.valid() && m_viewGeometry->hasProjection())
-        result = m_viewGeometry->getProjection()->getMetersPerPixel();
-    else
-        result.makeNan();
-
-    return result;
-}
-
-// Initialize view geometry image size from image geometry.
-bool ossimImageViewProjectionTransform::initializeViewSize()
-{
-   bool result = false;
-
-   if ( m_imageGeometry.valid() )
-   {
-      ossimIrect imageRect( 0, 0,
-                            m_imageGeometry->getImageSize().x - 1,
-                            m_imageGeometry->getImageSize().y - 1);
-      
-      if ( (imageRect.hasNans() == false) && m_viewGeometry.valid() )
-      {
-         ossimRefPtr<ossimProjection> viewProj = m_viewGeometry->getProjection();
-         if ( viewProj.valid() )
-         {
-            ossimIpt size;
-            size.makeNan();
-            
-            const ossimEquDistCylProjection* eqProj =
-               dynamic_cast<const ossimEquDistCylProjection*>( viewProj.get() );
-            if ( eqProj )
-            {
-               // Specialized to take into consideration a date line crossing.
-               
-               // Get the ground points we need:
-               ossimDpt iRight(imageRect.ul().x+1, imageRect.ul().y);
-               ossimDpt iDown(imageRect.ul().x, imageRect.ul().y+1);
-               ossimGpt gul;
-               ossimGpt gur; 
-               ossimGpt glr;
-               ossimGpt gll;
-               ossimGpt gRight;
-               ossimGpt gDown;
-               ossim_float64 hdd; // height decimal degrees
-               ossim_float64 wdd; // width decimal degrees
-               ossim_float64 leftLon;
-               ossim_float64 rightLon;
-               
-               m_imageGeometry->localToWorld( imageRect.ul(), gul );
-               m_imageGeometry->localToWorld( imageRect.ur(), gur );
-               m_imageGeometry->localToWorld( imageRect.lr(), glr );
-               m_imageGeometry->localToWorld( imageRect.ll(), gll );
-               m_imageGeometry->localToWorld( iRight, gRight );
-               m_imageGeometry->localToWorld( iDown, gDown );
-               
-               //---
-               // Determine the direction of the image and get the geographic bounding box.
-               // For the longitude consider a date line crossing.
-               //---
-               if ( gul.lat > gDown.lat ) // oriented north up
-               {
-                  if ( gul.lat >= gRight.lat ) // straight up or leaning right
-                  {
-                     hdd      = gul.lat - glr.lat;
-                     leftLon  = gll.lon;
-                     rightLon = gur.lon;
-                  }
-                  else // leaning left
-                  {
-                     hdd      = gur.lat - gll.lat;
-                     leftLon  = gul.lon;
-                     rightLon = glr.lon;
-                  }
-               }
-               else // south or on side
-               {
-                  if ( gRight.lat >= gul.lat ) // straight down or leaning right
-                  {
-                     hdd      = glr.lat - gul.lat;
-                     leftLon  = gur.lon;
-                     rightLon = gll.lon;
-                  }
-                  else // leaning left
-                  {
-                     hdd      = gll.lat - gur.lat;
-                     leftLon  = glr.lon;
-                     rightLon = gul.lon;
-                  }
-               }
-               
-               if ( rightLon > leftLon )
-               {
-                  wdd = rightLon - leftLon;
-               }
-               else // Date line cross:
-               {
-                  wdd = rightLon + 360.0 - leftLon;
-               }
-
-               //---
-               // Add one pixel width/height to the point to point size to make it edge to edge
-               // before dividing by gsd to get the size.  The view projection gsd is used here
-               // since the view could be a different resolution than the input projection.
-               //---
-               size.x = ossim::round<ossim_int32>(
-                  ( wdd + eqProj->getDecimalDegreesPerPixel().x ) /
-                  eqProj->getDecimalDegreesPerPixel().x );
-               size.y = ossim::round<ossim_int32>(
-                  ( hdd + eqProj->getDecimalDegreesPerPixel().y ) /
-                  eqProj->getDecimalDegreesPerPixel().y );
-               
-#if 0 /* Please leave for debug: */
-               cout << "\nwdd: " << wdd
-                    << "\nhdd: " << hdd
-                    << "\ngul: " << gul
-                    << "\ngur: " << gur
-                    << "\nglr: " << glr
-                    << "\ngll: " << gll
-                    << endl;
-#endif
-            }
-            else // Not an ossimEquDistCylProjection:
-            {
-               ossimDrect rect = getImageToViewBounds( imageRect );
-               size.x = ossim::round<ossim_int32>( rect.width()  );
-               size.y = ossim::round<ossim_int32>( rect.height() );
-            }
-
-#if 0 /* Please leave for debug: */
-            cout << "m_imageGeometry:\n" << *(m_imageGeometry.get())
-                 << "\n\nm_viewGeometry:\n" << *(m_imageGeometry.get())
-                 << "\n\ncomputed view size: " << size << endl;
-#endif
-            
-            if ( size.hasNans() == false )
-            {
-               m_viewGeometry->setImageSize( size );
-               result = true;
-            }
-            
-         } // Matches: if ( viewProj.valid() )
-
-      } // Matches: if ( (imageRect.hasNans() == false) ... 
-      
-   } // Matches: if ( m_imageGeometry.valid() && ...
-
-   return result;
-   
-} // End:  bool ossimImageViewProjectionTransform::initializeViewSize()
-
diff --git a/ossim/src/ossim/projection/ossimLambertConformalConicProjection.cpp b/ossim/src/ossim/projection/ossimLambertConformalConicProjection.cpp
deleted file mode 100644
index 677b55a..0000000
--- a/ossim/src/ossim/projection/ossimLambertConformalConicProjection.cpp
+++ /dev/null
@@ -1,647 +0,0 @@
-//*******************************************************************
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Lamberts Conformal Conic projection code.  
-//*******************************************************************
-//  $Id: ossimLambertConformalConicProjection.cpp 19640 2011-05-25 15:58:00Z oscarkramer $
-
-#include <iostream>
-#include <iomanip>
-#include <ossim/projection/ossimLambertConformalConicProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimLambertConformalConicProjection, "ossimLambertConformalConicProjection", ossimMapProjection)
-
-/***************************************************************************/
-/*                               DEFINES
- *
- */
-#ifndef PI_OVER_2
-#  define PI_OVER_2  ( M_PI / 2.0)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI     (2.0 * M_PI)
-#endif
-#define MAX_LAT    (( M_PI *  89.99972222222222) / 180.0)  /* 89 59 59.0 degrees in radians */
-#define LAMBERT_m(clat,essin)                  (clat / sqrt(1.0 - essin * essin))
-#define LAMBERT_t(lat,essin)                   tan(PI_OVER_4 - lat / 2) /				\
-										            pow((1.0 - essin) / (1.0 + essin), es_OVER_2)
-#define ES_SIN(sinlat)                         (es * sinlat)
-/**************************************************************************/
-/*                               GLOBAL DECLARATIONS
- *
- */
-
-const double PI_OVER_4 = (M_PI / 4.0);
-
-#define LAMBERT_NO_ERROR           0x0000
-#define LAMBERT_LAT_ERROR          0x0001
-#define LAMBERT_LON_ERROR          0x0002
-#define LAMBERT_EASTING_ERROR      0x0004
-#define LAMBERT_NORTHING_ERROR     0x0008
-#define LAMBERT_FIRST_STDP_ERROR   0x0010
-#define LAMBERT_SECOND_STDP_ERROR  0x0020
-#define LAMBERT_ORIGIN_LAT_ERROR   0x0040
-#define LAMBERT_CENT_MER_ERROR     0x0080
-#define LAMBERT_A_ERROR            0x0100
-#define LAMBERT_B_ERROR            0x0200
-#define LAMBERT_A_LESS_B_ERROR     0x0400
-#define LAMBERT_HEMISPHERE_ERROR   0x0800
-#define LAMBERT_FIRST_SECOND_ERROR 0x1000
-
-ossimLambertConformalConicProjection::ossimLambertConformalConicProjection(const ossimEllipsoid& ellipsoid,
-                                                                           const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-    
-ossimLambertConformalConicProjection::ossimLambertConformalConicProjection(const ossimEllipsoid& ellipsoid,
-                                                                           const ossimGpt& origin,
-                                                                           double stdParallel1,
-                                                                           double stdParallel2,
-                                                                           double falseEasting,
-                                                                           double falseNorthing)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   Lambert_Std_Parallel_1 = stdParallel1*RAD_PER_DEG;
-   Lambert_Std_Parallel_2 = stdParallel2*RAD_PER_DEG;
-   Lambert_False_Easting  = falseEasting;
-   Lambert_False_Northing = falseNorthing;
-   
-   update();
-}
-
-ossimLambertConformalConicProjection::~ossimLambertConformalConicProjection()
-{
-}
-
-ossimObject* ossimLambertConformalConicProjection::dup()const
-{
-   return new ossimLambertConformalConicProjection(*this);
-}
-
-void ossimLambertConformalConicProjection::update()
-{   
-   Set_Lambert_Parameters(theEllipsoid.getA(),
-                          theEllipsoid.getFlattening(),
-                          theOrigin.latr(),
-                          theOrigin.lonr(),
-                          Lambert_Std_Parallel_1,
-                          Lambert_Std_Parallel_2,
-                          Lambert_False_Easting,
-                          Lambert_False_Northing);
-
-   theFalseEastingNorthing.x = Lambert_False_Easting;
-   theFalseEastingNorthing.y = Lambert_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-void ossimLambertConformalConicProjection::setStandardParallel1(double degree)
-{
-   Lambert_Std_Parallel_1 = degree*RAD_PER_DEG;
-   update();
-}
-
-void ossimLambertConformalConicProjection::setStandardParallel2(double degree)
-{
-   Lambert_Std_Parallel_2 = degree*RAD_PER_DEG;
-   update();
-}
-
-void ossimLambertConformalConicProjection::setStandardParallels(double parallel1Degree,
-                                                                double parallel2Degree)
-{
-   Lambert_Std_Parallel_1 = parallel1Degree*RAD_PER_DEG;
-   Lambert_Std_Parallel_2 = parallel2Degree*RAD_PER_DEG;
-   update();
-   
-}
-
-void ossimLambertConformalConicProjection::setFalseEasting(double falseEasting)
-{
-   Lambert_False_Easting = falseEasting;
-   update();
-}
-
-void ossimLambertConformalConicProjection::setFalseNorthing(double falseNorthing)
-{
-   Lambert_False_Northing = falseNorthing;
-   update();
-}
-
-void ossimLambertConformalConicProjection::setFalseEastingNorthing(double falseEasting,
-                                                                   double falseNorthing)
-{
-   Lambert_False_Easting = falseEasting;
-   Lambert_False_Northing = falseNorthing;  
-   update();
-}
-
-void ossimLambertConformalConicProjection::setParameters(double parallel1,
-                                                         double parallel2,
-                                                         double falseEasting,
-                                                         double falseNorthing)
-{
-   Lambert_False_Easting = falseEasting;
-   Lambert_False_Northing = falseNorthing;  
-   Lambert_Std_Parallel_1 = parallel1*RAD_PER_DEG;
-   Lambert_Std_Parallel_2 = parallel2*RAD_PER_DEG;
-   update(); 
-}
-
-
-void ossimLambertConformalConicProjection::setDefaults()
-{
-   Lambert_Std_Parallel_1 = 40*RAD_PER_DEG;
-   Lambert_Std_Parallel_2 = 50*RAD_PER_DEG;
-   Lambert_False_Northing = 0.0;
-   Lambert_False_Easting  = 0.0;
-}
-
-ossimGpt ossimLambertConformalConicProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-  
-   Convert_Lambert_To_Geodetic(eastingNorthing.x,
-                               eastingNorthing.y,
-                               &lat,
-                               &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
-}
-
-ossimDpt ossimLambertConformalConicProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Lambert(gpt.latr(),
-                               gpt.lonr(),
-                               &easting,
-                               &northing);
-
-   return ossimDpt(easting, northing);
-}
-
-bool ossimLambertConformalConicProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::STD_PARALLEL_1_KW,
-           Lambert_Std_Parallel_1*DEG_PER_RAD,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::STD_PARALLEL_2_KW,
-           Lambert_Std_Parallel_2*DEG_PER_RAD,
-           true);
-   
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimLambertConformalConicProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   const char* stdParallel1  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_1_KW);
-   const char* stdParallel2  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_2_KW);
-
-   setDefaults();
-   
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimLambertConformalConicProjection))
-   {
-      Lambert_False_Easting  = theFalseEastingNorthing.x;
-      Lambert_False_Northing = theFalseEastingNorthing.y;
-
-      if(stdParallel1)
-      {
-         Lambert_Std_Parallel_1 = ossimString(stdParallel1).toDouble()*RAD_PER_DEG;
-      }
-      if(stdParallel2)
-      {
-         Lambert_Std_Parallel_2 = ossimString(stdParallel2).toDouble()*RAD_PER_DEG;
-      }
-   }
-   update();
-   return flag;
-}
-
-std::ostream& ossimLambertConformalConicProjection::print(
-   std::ostream& out) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   out << setiosflags(ios::fixed) << setprecision(15);
-
-   out << "// ossimLambertConformalConicProjection::print\n"
-       << ossimKeywordNames::STD_PARALLEL_1_KW << ": "
-       << Lambert_Std_Parallel_1*DEG_PER_RAD << "\n"
-       << ossimKeywordNames::STD_PARALLEL_2_KW << ": "
-      << Lambert_Std_Parallel_2*DEG_PER_RAD << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-   
-   return ossimMapProjection::print(out);
-}
-
-/************************************************************************/
-/*                              FUNCTIONS
- *
- */
-
-long ossimLambertConformalConicProjection::Set_Lambert_Parameters(double a,
-                                                                  double f,
-                                                                  double Origin_Latitude,
-                                                                  double Central_Meridian,
-                                                                  double Std_Parallel_1,
-                                                                  double Std_Parallel_2,
-                                                                  double False_Easting,
-                                                                  double False_Northing)
-
-{ /* BEGIN Set_Lambert_Parameters */
-/*
- * The function Set_Lambert_Parameters receives the ellipsoid parameters and
- * Lambert Conformal Conic projection parameters as inputs, and sets the
- * corresponding state variables.  If any errors occur, the error code(s)
- * are returned by the function, otherwise LAMBERT_NO_ERROR is returned.
- *
- *   a                   : Semi-major axis of ellipsoid, in meters   (input)
- *   f                   : Flattening of ellipsoid						       (input)
- *   Origin_Latitude     : Latitude of origin, in radians            (input)
- *   Central_Meridian    : Longitude of origin, in radians           (input)
- *   Std_Parallel_1      : First standard parallel, in radians       (input)
- *   Std_Parallel_2      : Second standard parallel, in radians      (input)
- *   False_Easting       : False easting, in meters                  (input)
- *   False_Northing      : False northing, in meters                 (input)
- */
-
-  double slat, slat1, clat;
-  double es_sin;
-  double t0, t1, t2;
-  double m1, m2;
-//  double inv_f = 1 / f;
-  long Error_Code = LAMBERT_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= LAMBERT_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= LAMBERT_INV_F_ERROR;
-//   }
-//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
-//   { /* Origin Latitude out of range */
-//     Error_Code |= LAMBERT_ORIGIN_LAT_ERROR;
-//   }
-//   if ((Std_Parallel_1 < -MAX_LAT) || (Std_Parallel_1 > MAX_LAT))
-//   { /* First Standard Parallel out of range */
-//     Error_Code |= LAMBERT_FIRST_STDP_ERROR;
-//   }
-//   if ((Std_Parallel_2 < -MAX_LAT) || (Std_Parallel_2 > MAX_LAT))
-//   { /* Second Standard Parallel out of range */
-//     Error_Code |= LAMBERT_SECOND_STDP_ERROR;
-//   }
-//   if ((Std_Parallel_1 == 0) && (Std_Parallel_2 == 0))
-//   { /* First & Second Standard Parallels are both 0 */
-//     Error_Code |= LAMBERT_FIRST_SECOND_ERROR;
-//   }
-//   if (Std_Parallel_1 == -Std_Parallel_2)
-//   { /* Parallels are the negation of each other */
-//     Error_Code |= LAMBERT_HEMISPHERE_ERROR;
-//   }
-//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
-//   { /* Origin Longitude out of range */
-//     Error_Code |= LAMBERT_CENT_MER_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-
-    Lambert_a = a;
-    Lambert_f = f;
-    Lambert_Origin_Lat = Origin_Latitude;
-    Lambert_Std_Parallel_1 = Std_Parallel_1;
-    Lambert_Std_Parallel_2 = Std_Parallel_2;
-//     if (Central_Meridian > PI)
-//       Central_Meridian -= TWO_PI;
-    Lambert_Origin_Long = Central_Meridian;
-    Lambert_False_Easting = False_Easting;
-    Lambert_False_Northing = False_Northing;
-
-    es2 = 2 * Lambert_f - Lambert_f * Lambert_f;
-    es = sqrt(es2);
-    es_OVER_2 = es / 2.0;
-
-    slat = sin(Lambert_Origin_Lat);
-    es_sin = ES_SIN(slat);
-    t0 = LAMBERT_t(Lambert_Origin_Lat, es_sin);
-
-    slat1 = sin(Lambert_Std_Parallel_1);
-    clat = cos(Lambert_Std_Parallel_1);
-    es_sin = ES_SIN(slat1);
-    m1 = LAMBERT_m(clat, es_sin);
-    t1 = LAMBERT_t(Lambert_Std_Parallel_1, es_sin);
-
-
-    if (fabs(Lambert_Std_Parallel_1 - Lambert_Std_Parallel_2) > 1.0e-10)
-    {
-      slat = sin(Lambert_Std_Parallel_2);
-      clat = cos(Lambert_Std_Parallel_2);
-      es_sin = ES_SIN(slat);
-      m2 = LAMBERT_m(clat, es_sin);
-      t2 = LAMBERT_t(Lambert_Std_Parallel_2, es_sin);
-      n = log(m1 / m2) / log(t1 / t2);
-    }
-    else
-      n = slat1;
-    F = m1 / (n * pow(t1, n));
-    Lambert_aF = Lambert_a * F;
-    if ((t0 == 0) && (n < 0))
-      rho0 = 0.0;
-    else
-      rho0 = Lambert_aF * pow(t0, n);
-
-  }
-  return (Error_Code);
-} /* END OF Set_Lambert_Parameters */
-
-
-void ossimLambertConformalConicProjection::Get_Lambert_Parameters(double *a,
-                                                                  double *f,
-                                                                  double *Origin_Latitude,
-                                                                  double *Central_Meridian,
-                                                                  double *Std_Parallel_1,
-                                                                  double *Std_Parallel_2,
-                                                                  double *False_Easting,
-                                                                  double *False_Northing)const
-
-{ /* BEGIN Get_Lambert_Parameters */
-/*                         
- * The function Get_Lambert_Parameters returns the current ellipsoid
- * parameters and Lambert Conformal Conic projection parameters.
- *
- *   a                   : Semi-major axis of ellipsoid, in meters   (output)
- *   f                   : Flattening of ellipsoid					         (output)
- *   Origin_Latitude     : Latitude of origin, in radians            (output)
- *   Central_Meridian    : Longitude of origin, in radians           (output)
- *   Std_Parallel_1      : First standard parallel, in radians       (output)
- *   Std_Parallel_2      : Second standard parallel, in radians      (output)
- *   False_Easting       : False easting, in meters                  (output)
- *   False_Northing      : False northing, in meters                 (output)
- */
-
-
-  *a = Lambert_a;
-  *f = Lambert_f;
-  *Std_Parallel_1 = Lambert_Std_Parallel_1;
-  *Std_Parallel_2 = Lambert_Std_Parallel_2;
-  *Origin_Latitude = Lambert_Origin_Lat;
-  *Central_Meridian = Lambert_Origin_Long;
-  *False_Easting = Lambert_False_Easting;
-  *False_Northing = Lambert_False_Northing;
-  
-  return;
-} /* END OF Get_Lambert_Parameters */
-
-
-long ossimLambertConformalConicProjection::Convert_Geodetic_To_Lambert (double Latitude,
-                                                                        double Longitude,
-                                                                        double *Easting,
-                                                                        double *Northing)const
-   
-{ /* BEGIN Convert_Geodetic_To_Lambert */
-/*
- * The function Convert_Geodetic_To_Lambert converts Geodetic (latitude and
- * longitude) coordinates to Lambert Conformal Conic projection (easting
- * and northing) coordinates, according to the current ellipsoid and
- * Lambert Conformal Conic projection parameters.  If any errors occur, the
- * error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR is
- * returned.
- *
- *    Latitude         : Latitude, in radians                         (input)
- *    Longitude        : Longitude, in radians                        (input)
- *    Easting          : Easting (X), in meters                       (output)
- *    Northing         : Northing (Y), in meters                      (output)
- */
-
-  double slat;
-  double es_sin;
-  double t;
-  double rho;
-  double dlam;
-  double theta;
-  long  Error_Code = LAMBERT_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   {  /* Latitude out of range */
-//     Error_Code|= LAMBERT_LAT_ERROR;
-//   }
-//   if ((Longitude < -PI) || (Longitude > TWO_PI))
-//   {  /* Longitude out of range */
-//     Error_Code|= LAMBERT_LON_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-
-    if (fabs(fabs(Latitude) - PI_OVER_2) > 1.0e-10)
-    {
-      slat = sin(Latitude);
-      es_sin = ES_SIN(slat);
-      t = LAMBERT_t(Latitude, es_sin);
-      rho = Lambert_aF * pow(t, n);
-    }
-    else
-    {
-      if ((Latitude * n) <= 0)
-      { /* Point can not be projected */
-        Error_Code |= LAMBERT_LAT_ERROR;
-        return (Error_Code);
-      }
-      rho = 0.0;
-    }
-
-    dlam = Longitude - Lambert_Origin_Long;
-
-//     if (dlam > PI)
-//     {
-//       dlam -= TWO_PI;
-//     }
-//     if (dlam < -PI)
-//     {
-//       dlam += TWO_PI;
-//     }
-
-    theta = n * dlam;
-
-    *Easting = rho * sin(theta) + Lambert_False_Easting;
-    *Northing = rho0 - rho * cos(theta) + Lambert_False_Northing;
-
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Lambert */
-
-
-
-long ossimLambertConformalConicProjection::Convert_Lambert_To_Geodetic (double Easting,
-                                                                        double Northing,
-                                                                        double *Latitude,
-                                                                        double *Longitude)const
-
-{ /* BEGIN Convert_Lambert_To_Geodetic */
-/*
- * The function Convert_Lambert_To_Geodetic converts Lambert Conformal
- * Conic projection (easting and northing) coordinates to Geodetic
- * (latitude and longitude) coordinates, according to the current ellipsoid
- * and Lambert Conformal Conic projection parameters.  If any errors occur,
- * the error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR
- * is returned.
- *
- *    Easting          : Easting (X), in meters                       (input)
- *    Northing         : Northing (Y), in meters                      (input)
- *    Latitude         : Latitude, in radians                         (output)
- *    Longitude        : Longitude, in radians                        (output)
- */
-
-
-  double dy, dx;
-  double rho, rho0_MINUS_dy;
-  double t;
-  double PHI;
-  double tempPHI = 0.0;
-  double sin_PHI;
-  double es_sin;
-  double theta = 0.0;
-  double tolerance = 4.85e-10;
-  long Error_Code = LAMBERT_NO_ERROR;
-
-//   if ((Easting < (Lambert_False_Easting - Lambert_Delta_Easting))
-//       ||(Easting > (Lambert_False_Easting + Lambert_Delta_Easting)))
-//   { /* Easting out of range  */
-//     Error_Code |= LAMBERT_EASTING_ERROR;
-//   }
-//   if ((Northing < (Lambert_False_Northing - Lambert_Delta_Northing))
-//       || (Northing > (Lambert_False_Northing + Lambert_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= LAMBERT_NORTHING_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-
-    dy = Northing - Lambert_False_Northing;
-    dx = Easting - Lambert_False_Easting;
-    rho0_MINUS_dy = rho0 - dy;
-    rho = sqrt(dx * dx + (rho0_MINUS_dy) * (rho0_MINUS_dy));
-
-    if (n < 0.0)
-    {
-      rho *= -1.0;
-      dy *= -1.0;
-      dx *= -1.0;
-      rho0_MINUS_dy *= -1.0;
-    }
-
-    if (rho != 0.0)
-    {
-      theta = atan2(dx, rho0_MINUS_dy);
-      t = pow(rho / (Lambert_aF) , 1.0 / n);
-      PHI = PI_OVER_2 - 2.0 * atan(t);
-      while (fabs(PHI - tempPHI) > tolerance)
-      {
-        tempPHI = PHI;
-        sin_PHI = sin(PHI);
-        es_sin = ES_SIN(sin_PHI);
-        PHI = PI_OVER_2 - 2.0 * atan(t * pow((1.0 - es_sin) / (1.0 + es_sin), es_OVER_2));
-      }
-      *Latitude = PHI;
-      *Longitude = theta / n + Lambert_Origin_Long;
-
-      if (fabs(*Latitude) < 2.0e-7)  /* force lat to 0 to avoid -0 degrees */
-        *Latitude = 0.0;
-      if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-        *Latitude = PI_OVER_2;
-      else if (*Latitude < -PI_OVER_2)
-        *Latitude = -PI_OVER_2;
-
-      if (*Longitude > M_PI)
-      {
-        if (*Longitude - M_PI < 3.5e-6) 
-          *Longitude = M_PI;
-//         else
-//           *Longitude -= TWO_PI;
-      }
-      if (*Longitude < -M_PI)
-      {
-        if (fabs(*Longitude + M_PI) < 3.5e-6)
-          *Longitude = -M_PI;
-//         else
-//           *Longitude += TWO_PI;
-      }
-
-      if (fabs(*Longitude) < 2.0e-7)  /* force lon to 0 to avoid -0 degrees */
-        *Longitude = 0.0;
-      if (*Longitude > M_PI)  /* force distorted values to 180, -180 degrees */
-        *Longitude = M_PI;
-      else if (*Longitude < -M_PI)
-        *Longitude = -M_PI;
-    }
-    else
-    {
-      if (n > 0.0)
-        *Latitude = PI_OVER_2;
-      else
-        *Latitude = -PI_OVER_2;
-      *Longitude = Lambert_Origin_Long;
-    }
-  }
-  return (Error_Code);
-} /* END OF Convert_Lambert_To_Geodetic */
-
-double ossimLambertConformalConicProjection::getStandardParallel1()const
-{
-   return  Lambert_Std_Parallel_1/RAD_PER_DEG;
-}
-
-double ossimLambertConformalConicProjection::getStandardParallel2()const
-{
-   return  Lambert_Std_Parallel_2/RAD_PER_DEG;
-}
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimLambertConformalConicProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj)) 
-      return false;
-
-   ossimLambertConformalConicProjection* p = PTR_CAST(ossimLambertConformalConicProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(Lambert_Std_Parallel_1,p->Lambert_Std_Parallel_1)) return false;
-   if (!ossim::almostEqual(Lambert_Std_Parallel_2,p->Lambert_Std_Parallel_2)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimLandSatModel.cpp b/ossim/src/ossim/projection/ossimLandSatModel.cpp
deleted file mode 100644
index 9be9d5c..0000000
--- a/ossim/src/ossim/projection/ossimLandSatModel.cpp
+++ /dev/null
@@ -1,1205 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// AUTHOR: Oscar Kramer (okramer at imagelinks.com)
-//
-// DESCRIPTION: 
-//
-// SOFTWARE HISTORY:
-//   01AUG2002  O. Kramer, ImageLinks
-//              Initial coding.
-//   21NOV2002  O. Kramer, ImageLinks
-//              Fixed use of map projection to use forward/inverse instead of
-//              worldTLinesample/lineSampleToWorld methods.
-//
-//*****************************************************************************
-
-#include <cstdlib>
-#include <ossim/projection/ossimLandSatModel.h>
-
-RTTI_DEF1(ossimLandSatModel, "ossimLandSatModel", ossimSensorModel);
-
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/support_data/ossimFfL7.h>
-#include <ossim/support_data/ossimFfL5.h>
-#include <ossim/projection/ossimSpaceObliqueMercatorProjection.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/base/ossimLsrPoint.h>
-#include <ossim/base/ossimLsrRay.h>
-#include <ossim/base/ossimLsrSpace.h>
-#include <stdio.h>
-#include <fstream>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimLandSatModel:exec");
-static ossimTrace traceDebug ("ossimLandSatModel:debug");
-
-static const int    MODEL_VERSION_NUMBER   = 2;
-static const char*  PROJECTION_TYPE_KW     = "theProjectionType";
-static const char*  MAP_ZONE_KW            = "theMapZone";
-static const char*  MAP_OFFSET_X_KW        = "theMapOffset.x";
-static const char*  MAP_OFFSET_Y_KW        = "theMapOffset.y";
-static const char*  WRS_PATH_NUMBER_KW     = "theWrsPathNumber";
-static const char*  ROW_NUMBER_KW          = "theWrsRowNumber";
-static const char*  ILLUM_AZIMUTH_KW       = "theIllumAzimuth";
-static const char*  ILLUM_ELEVATION_KW     = "theIllumElevation";
-static const char*  MERIDIANAL_ANGLE_KW    = "theMeridianalAngle";
-static const char*  ORBIT_ALTITUDE_KW      = "theOrbitAltitude";
-static const char*  ORBIT_INCLINATION_KW   = "theOrbitInclination";
-static const char*  MAP_AZIM_ANGLE_KW      = "theMapAzimAngle";
-static const char*  MAP_2Ic_ROT_ANGLE_KW   = "theMap2IcRotAngle";
-static const char*  INTRACK_OFFSET_KW      = "theIntrackOffset";
-static const char*  CRTRACK_OFFSET_KW      = "theCrtrackOffset";
-static const char*  LINE_GSD_CORR_KW       = "theLineGsdCorr";
-static const char*  SAMP_GSD_CORR_KW       = "theSampGsdCorr";
-static const char*  ROLL_OFFSET_KW         = "theRollOffset";
-static const char*  YAW_OFFSET_KW          = "theYawOffset";
-static const char*  YAW_RATE_KW            = "theYawRate";
-static const char*  MAP_ROTATION_KW        = "theMapRotation";
-
-
-static const double   GEODETIC_2_GEOCENTRIC_FACTOR  = 1.00674;
-static const double   L7_ORBIT_ALTITUDE  = 705300.0;
-static const double   L7_ORBIT_INCLINATION  = 98.22;
-static const double   L7_NOMINAL_POS_ERROR  = 200.0;
-
-static const double   L5_ORBIT_ALTITUDE  = 705300.0;
-static const double   L5_ORBIT_INCLINATION  = 98.22;
-static const double   L5_NOMINAL_POS_ERROR  = 12000.0; //arbitrary : to be fixed
-
-
-static const char* PARAM_NAMES[] ={"intrack_offset",
-                                         "crtrack_offset",
-                                         "line_gsd_corr",
-                                         "samp_gsd_corr",
-                                         "roll_offset",
-                                         "yaw_offset",
-                                         "yaw_rate",
-                                         "map_rotation"};
-
-static const char* PARAM_UNITS[] ={"meters",
-                                         "meters",
-                                         "meters",
-                                         "meters",
-                                         "degrees",
-                                         "degrees",
-                                         "seconds",
-                                         "degrees"};
-
-static const char* PROJ_TYPE[] = { "UNKNOWN_PROJECTION",
-                                         "UTM_MAP",
-                                         "UTM_ORBIT",
-                                         "SOM_MAP",
-                                         "SOM_ORBIT" };
-
-//*****************************************************************************
-//  DEFAULT CONSTRUCTOR: ossimLandSatModel()
-//  
-//*****************************************************************************
-ossimLandSatModel::ossimLandSatModel()
-   :
-   ossimSensorModel(),
-   theIntrackOffset     (0.0),
-   theCrtrackOffset     (0.0),
-   theLineGsdCorr       (0.0),   
-   theSampGsdCorr       (0.0),
-   theRollOffset        (0.0),
-   theYawOffset         (0.0),
-   theYawRate           (0.0),
-   theMapRotation       (0.0)
-
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel: entering..." << std::endl;
-
-   initAdjustableParameters();
-   
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: ossimLandSatModel(ossimLandSatModel)
-//  
-//*****************************************************************************
-ossimLandSatModel::ossimLandSatModel(const ossimFfL7& head)
-   :
-   ossimSensorModel(),
-   theIntrackOffset     (0.0),
-   theCrtrackOffset     (0.0),
-   theLineGsdCorr       (0.0),   
-   theSampGsdCorr       (0.0),
-   theRollOffset        (0.0),
-   theYawOffset         (0.0),
-   theYawRate           (0.0),
-   theMapRotation       (0.0)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(head): entering..." << std::endl;   
-
-   initFromHeader(head);
-
-   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(head): Exited..." << std::endl;
-}
-
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimLandSatModel(filename)
-//  
-//  Constructs model from a filename. The file can be either a FF header file
-//  or a KWL file.
-//  
-//*****************************************************************************
-ossimLandSatModel::ossimLandSatModel(const ossimFilename& init_file)
- 
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(init_file): entering..." << std::endl;
-
-   setupOptimizer(init_file);
-
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(init_file): Exited..." << std::endl;
-}
-
-
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimLandSatModel(kwl)
-//  
-//  Constructs model from keywordlist geometry file
-//  
-//*****************************************************************************
-ossimLandSatModel::ossimLandSatModel(const ossimKeywordlist& geom_kwl)
-   :
-   ossimSensorModel(),
-   theIntrackOffset     (0.0),
-   theCrtrackOffset     (0.0),
-   theLineGsdCorr       (0.0),   
-   theSampGsdCorr       (0.0),
-   theRollOffset        (0.0),
-   theYawOffset         (0.0),
-   theYawRate           (0.0),
-   theMapRotation       (0.0)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(geom_kwl): entering..." << std::endl;
-
-   initAdjustableParameters();
-
-   //***
-   // Parse keywordlist for geometry:
-   //***
-   loadState(geom_kwl);
-
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(geom_kwl): Exited..." << std::endl;
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: 
-//*****************************************************************************
-ossimLandSatModel::ossimLandSatModel(const ossimLandSatModel& rhs)
-   :
-   ossimSensorModel   (rhs),
-   theIllumAzimuth    (rhs.theIllumAzimuth),
-   theIllumElevation  (rhs.theIllumElevation),
-   theOrbitAltitude   (rhs.theOrbitAltitude),
-   theOrbitInclination(rhs.theOrbitInclination),
-   theMapZone         (rhs.theMapZone),
-   theMapOffset       (rhs.theMapOffset),
-   theWrsPathNumber   (rhs.theWrsPathNumber),
-   theWrsRowNumber    (rhs.theWrsRowNumber),
-   theMeridianalAngle (rhs.theMeridianalAngle),
-   thePositionError   (rhs.thePositionError),
-   theProjectionType  (rhs.theProjectionType),
-   theMapProjection   (rhs.theMapProjection.valid()?
-                       (ossimMapProjection*)rhs.theMapProjection->dup():
-                       (ossimMapProjection*)0),
-   theMapAzimAngle    (rhs.theMapAzimAngle),
-   theMapAzimCos      (rhs.theMapAzimCos),
-   theMapAzimSin      (rhs.theMapAzimSin),
-   theMap2IcRotAngle  (rhs.theMap2IcRotAngle),
-   theMap2IcRotCos    (rhs.theMap2IcRotCos),
-   theMap2IcRotSin    (rhs.theMap2IcRotSin),
-   theIntrackOffset   (rhs.theIntrackOffset),
-   theCrtrackOffset   (rhs.theCrtrackOffset),
-   theLineGsdCorr     (rhs.theLineGsdCorr),
-   theSampGsdCorr     (rhs.theSampGsdCorr),
-   theRollOffset      (rhs.theRollOffset),
-   theYawOffset       (rhs.theYawOffset),
-   theYawRate         (rhs.theYawRate),
-   theMapRotation     (rhs.theMapRotation),
-   theRollRotMat      (rhs.theRollRotMat)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(rhs): entering..." << std::endl;
-   
-   initAdjustableParameters();
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(rhs): returning..." << std::endl;
-}
-ossimObject* ossimLandSatModel::dup()const
-{
-   return new ossimLandSatModel(*this);
-}
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimLandSatModel()
-//  
-//*****************************************************************************
-ossimLandSatModel::~ossimLandSatModel()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::~ossimLandSatModel: entering..." << std::endl;
-
-   theMapProjection = 0;
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::~ossimLandSatModel: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  METHOD: ossimLandSatModel::initFromHeader()
-//  
-//*****************************************************************************
-void ossimLandSatModel::initFromHeader(const ossimFfL7& head)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initFromHeader: entering..." << std::endl;
-   
-   //***
-   // Initialize base-class data members:
-   //***
-   theRefGndPt         = head.theCenterGP;
-   theRefImgPt         = head.theCenterImagePoint;
-   theImageSize.x      = head.thePixelsPerLine;
-   theImageSize.y      = head.theLinesPerBand;
-   theImageID          = head.theRequestNumber;
-   theImageClipRect    = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1);
-   theGSD.samp         = head.theGsd;
-   theGSD.line         = head.theGsd;
-   theIllumAzimuth     = head.theSunAzimuth;
-   theIllumElevation   = head.theSunElevation;
-   theMapZone          = head.theUsgsMapZone;
-   theWrsPathNumber    = head.thePathNumber;
-   theWrsRowNumber     = head.theRowNumber;
-   theRollOffset       = head.theOffNadirAngle;
-   theMeanGSD          = head.theGsd;
-   
-   //satellite orbit and accuracy
-   ossimString satname(head.theSatName);
-   if (satname.contains("7"))
-   {
-      theOrbitAltitude    = L7_ORBIT_ALTITUDE;
-      theOrbitInclination = L7_ORBIT_INCLINATION;
-      theNominalPosError  = L7_NOMINAL_POS_ERROR;
-   } else if (satname.contains("5"))
-   {
-      theOrbitAltitude    = L5_ORBIT_ALTITUDE;
-      theOrbitInclination = L5_ORBIT_INCLINATION;
-      theNominalPosError  = L5_NOMINAL_POS_ERROR;
-   } else {
-      theErrorStatus = 1; //MODEL_ERROR
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimLandSatModel::initFromHeader: " << "Unknown satellite name : " << satname << std::endl;
-      }
-   }   
-   
-   
-   //***
-   // Assign the meridianal angle. The Meridianal angle is
-   // the angle between true north and the vehicles ground track. The
-   // orientation angle is the rotation of the raster image from north (this
-   // will be 0 for map-oriented imagery).
-   //
-   // Compute meridianal angle between the along-track direction
-   // and the meridian going through the scene center excluding earth rotation
-   // effects. The spherical triangle equation is Napier's rule for right-angle
-   // spherical triangles.  This angle is a negative number from -8.2 to -90
-   // depending on scene latitude:
-   //***
-   double phi_c = ossim::atand(ossim::tand(theRefGndPt.lat)/
-                               GEODETIC_2_GEOCENTRIC_FACTOR);
-   double cos_phi_c   = ossim::cosd(phi_c);
-   theMeridianalAngle = -ossim::asind(ossim::cosd(theOrbitInclination) / cos_phi_c);
-   theMapAzimAngle = head.theOrientationAngle;
-
-   //***
-   // Fetch the corner points from the header:
-   //***
-   ossimDpt v[4]; // temporarily holds vertices for ground polygon
-   v[0] = head.theUL_Corner;
-   v[1] = head.theUR_Corner;
-   v[2] = head.theLR_Corner;
-   v[3] = head.theLL_Corner;
-   theBoundGndPolygon = ossimPolygon(4, v);
-
-   //***
-   // Initialize map projection parameters:
-   // Determine the projection/orientation type:
-   //***
-   ossimString orient_type = head.theProductType;
-   ossimString proj_type   = head.theMapProjectionName;
-   if (proj_type.contains("SOM"))
-   {
-      //***
-      // Inverse the line direction GSD for SOM, since projection "intrack"
-      // axis (x) is descending:
-      //***
-      if (orient_type.contains("ORBIT"))
-         theProjectionType  = SOM_ORBIT;
-      else
-         theProjectionType = SOM_MAP;
-
-      // this is a hack.  After testing two it is consistently off
-      // by 90 degrees.
-      //
-      theMapAzimAngle -= 90.0;
-   }
-   else if (proj_type.contains("UTM"))
-   {
-      if (orient_type.contains("ORBIT"))
-         theProjectionType  = UTM_ORBIT;
-      else
-         theProjectionType = UTM_MAP;
-   }
-   else
-   {
-      theErrorStatus = 1; //MODEL_ERROR
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimLandSatModel::initFromHeader: "
-                                             << "Unknown projection/orientation type." << std::endl;
-      }
-      return;
-   }
-
-   //***
-   // Establish the map projection:
-   //***
-   initMapProjection();
-
-      
-   theMapOffset = theMapProjection->forward(head.theUL_Corner);
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimLandSatModel::initFromHeader:"
-         << "\ntheMapProjection:\n";
-
-      theMapProjection->print(ossimNotify(ossimNotifyLevel_DEBUG));
-
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nHeader upper left ground point:  " << head.theUL_Corner
-         << std::endl;
-   }
-
-   //*** 
-   // initialize remaining data members:
-   //***
-   initAdjustableParameters();
-   updateModel();
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initFromHeader: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  METHOD: ossimLandSatModel::lineSampleHeightToWorld()
-//  
-//  Performs the line/sample to groundpoint projection given an elevation.
-//  
-//  5. Intersect imaging ray with elevation surface.
-//
-//*****************************************************************************
-void ossimLandSatModel::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                                const double&   height,
-                                                ossimGpt&       gpt) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::lineSampleHeightToWorld: entering..." << std::endl;
-
-#if 0
-   //***
-   // Extrapolate if point is outside image:
-   //***
-   if (!insideImage(image_point))
-   {
-      gpt = extrapolate(image_point, height);
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::lineSampleHeightToWorld: returning..." << std::endl;
-      return;
-   }
-#endif
-   
-   //***
-   // First establish imaging ray from image point:
-   //***
-   ossimEcefRay imaging_ray;
-   imagingRay(image_point, imaging_ray);
-   ossimEcefPoint Pecf (imaging_ray.intersectAboveEarthEllipsoid(height));
-   gpt = ossimGpt(Pecf);
-}
-   
-   
-//*****************************************************************************
-//  METHOD: ossimLandSatModel::imagingRay()
-//  
-//  This model implements an affine transform with scaling to arrive at an
-//  ECF ray given an image point. This ray is intersected with a constant
-//  elevation surface to arrive at a ground point. The transform to arrive at a
-//  point on the ground [p,l,0] is implemented briefly as follows:
-//
-//  0. Establish the lat/lon map point given input point.
-//
-//  1. Determine intrack/crosstrack coordinates of image map point by rotating
-//     the input coordinates by meridianal angle.
-//
-//  2. Given intrack line number, compute vehicle position at time of imaging.
-//
-//  3. Establish imaging ray given input point ground coordinates and vehicle
-//     position.
-//
-//  4. Perturb imaging ray by adjustable parameters for platform attitude and
-//     position error.
-//
-//*****************************************************************************
-void ossimLandSatModel::imagingRay(const ossimDpt& inImgPt,
-                                   ossimEcefRay&   image_ray) const
-{
-#if 0
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimLandSatModel::imagingRay: entering..." << std::endl;
-
-   bool debug_flag = false; // setable by interactive debugger
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "inImgPt = " << inImgPt << std::endl;
-   }
-#endif
-   
-   //***
-   // Get ground point for given map image point:
-   //***
-   ossimDpt rot_img_pt(-inImgPt.line*theMapAzimSin+inImgPt.samp*theMapAzimCos,
-                        inImgPt.line*theMapAzimCos+inImgPt.samp*theMapAzimSin);
-   ossimDpt map_point 
-      (theMapOffset.x + rot_img_pt.samp*(theGSD.samp+theSampGsdCorr), 
-       theMapOffset.y - rot_img_pt.line*(theGSD.line+theLineGsdCorr));
-
-   ossimGpt inGndPt (theMapProjection->inverse(map_point));
-
-#if 0
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t theMapOffset="<<theMapOffset<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t rot_img_pt="<<rot_img_pt<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t image point map_point="<<map_point<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t inGndPt="<<inGndPt<<endl;
-   }
-#endif
-   //***
-   // Rotate the image map coordinates by the map-to-IC rotation
-   // to arrive at intrack/crosstrack coordinate:
-   //***
-   ossimDpt offInMapPt (inImgPt - theRefImgPt);
-   ossimDpt icInPt
-      (offInMapPt.line*theMap2IcRotSin + offInMapPt.samp*theMap2IcRotCos,
-       offInMapPt.line*theMap2IcRotCos - offInMapPt.samp*theMap2IcRotSin);
-
-#if 0
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t offInMapPt="<<offInMapPt<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t icInPt="<<icInPt<<endl;
-   }
-#endif
-   
-   //***
-   // Establish an image map point at vehicle NADIR corresponding to imaging
-   // line:
-   //***
-   ossimDpt icNdrPt (0.0, icInPt.line);
-   ossimDpt offNdrMapPt
-      (-icNdrPt.line*theMap2IcRotSin + icNdrPt.samp*theMap2IcRotCos,
-        icNdrPt.line*theMap2IcRotCos + icNdrPt.samp*theMap2IcRotSin);
-   ossimDpt ndrMapPt(offNdrMapPt + theRefImgPt);
-   ossimDpt rotNdrMapPt
-      (-ndrMapPt.line*theMapAzimSin + ndrMapPt.samp*theMapAzimCos,
-       ndrMapPt.line*theMapAzimCos + ndrMapPt.samp*theMapAzimSin);
-
-#if 0
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t icNdrPt="<<icNdrPt<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t offNdrMapPt="<<offNdrMapPt<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t ndrMapPt="<<ndrMapPt<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t rotNdrMapPt="<<rotNdrMapPt<<endl;
-   }
-#endif
-
-   //***
-   // Establish the vehicle position at time of line imaging:
-   //***
-   map_point.y =theMapOffset.y+rotNdrMapPt.x*(theGSD.x+theSampGsdCorr);
-   if ((theProjectionType == SOM_ORBIT) || (theProjectionType == SOM_MAP))
-      map_point.x = theMapOffset.x+rotNdrMapPt.y*(theGSD.y+theLineGsdCorr);
-   else
-      map_point.x = theMapOffset.x-rotNdrMapPt.y*(theGSD.y+theLineGsdCorr);
-      
-   ossimGpt vehiclePlhPos(theMapProjection->inverse(map_point));
-   vehiclePlhPos.hgt = theOrbitAltitude;
-
-#if 0
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t map_point="<<map_point<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t vehiclePlhPos="<<vehiclePlhPos<<endl;
-   }
-#endif
-   
-   //***
-   // Establish an LSR space at the vehicle with X along the intrack direction:
-   //***
-   ossimLsrSpace icrSpace (vehiclePlhPos, theMeridianalAngle-90.0);
-
-#if 0
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t icrSpace="<<icrSpace<<endl;
-   }
-#endif
-
-   //***
-   // Now establish a ray pointing to the imaged ground point from the vehicle
-   // in ICR space:
-   //***
-   ossimLsrPoint lsrInPt (inGndPt, icrSpace);
-   ossimLsrPoint vehicleLsrPos (0.0, 0.0, 0.0, icrSpace);
-   ossimLsrRay   initLsrImgRay (vehicleLsrPos, lsrInPt);
-
-#if 0
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t initLsrImgRay="<<initLsrImgRay<<endl;
-   }
-#endif
-
-   //***
-   // Establish the attitude rotation matrix considering the attitude biases
-   // and rates:
-   //***
-   double cos, sin;
-   double norm_line = inImgPt.line/theImageSize.line;
-   double yaw = theYawOffset + theYawRate*norm_line;
-   cos = ossim::cosd(yaw);
-   sin = ossim::sind(yaw);
-   NEWMAT::Matrix T_yaw = ossimMatrix3x3::create( cos,-sin, 0.0,
-                                                  sin, cos, 0.0,
-                                                  0.0, 0.0, 1.0);
-   NEWMAT::Matrix attRotMat = T_yaw * theRollRotMat;
-
-   //***
-   // Now apply the perturbation to the ray due to the adjustable parameters,
-   // and arrive at the ECF adjusted imaging ray:
-   //***
-   ossimLsrVector adjLsrImgRayDir (attRotMat*initLsrImgRay.direction().data(),
-                                   icrSpace);
-   ossimLsrPoint  adjLsrImgRayOrg (theIntrackOffset,
-                                   theCrtrackOffset,
-                                   0.0,  // no radial adjustment of position
-                                   icrSpace);
-   ossimLsrRay adjLsrImgRay (adjLsrImgRayOrg, adjLsrImgRayDir);
-   image_ray = ossimEcefRay(adjLsrImgRay);
-
-#if 0
-   if (traceDebug() || debug_flag)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t adjLsrImgRay="<<adjLsrImgRay<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\t image_ray="<<image_ray<<endl;
-   }
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::imagingRay: Returning..." << std::endl;
-   }
-#endif
-}
-
-//*****************************************************************************
-//  METHOD: ossimLandSatModel::print()
-//  
-//  Formatted dump of data members.
-//  
-//*****************************************************************************
-std::ostream& ossimLandSatModel::print(std::ostream& os) const
-{
-   os << "\nDump of ossimLandSatModel object at "
-      << hex << this << ":\n"
-      << "\nLandSatModel -- Dump of all data members: "
-      << "\n         theImageID: " << theImageID.chars()
-      << "\n       theImageSize: " << theImageSize
-      << "\n        theRefImgPt: " << theRefImgPt
-      << "\n        theRefGndPt: " << theRefGndPt
-      << "\n        theGSD.line: " << theGSD.line
-      << "\n        theGSD.samp: " << theGSD.samp
-      << "\n  theProjectionType: " << PROJ_TYPE[theProjectionType]
-      << "\n         theMapZone: " << theMapZone
-      << "\n       theMapOffset: " << theMapOffset
-      << "\n   theWrsPathNumber: " << theWrsPathNumber
-      << "\n    theWrsRowNumber: " << theWrsRowNumber
-      << "\n    theIllumAzimuth: " << theIllumAzimuth
-      << "\n  theIllumElevation: " << theIllumElevation
-      << "\n   thePositionError: " << thePositionError
-      << "\n theMeridianalAngle: " << theMeridianalAngle
-      << "\n   theOrbitAltitude: " << theOrbitAltitude
-      << "\ntheOrbitInclination: " << theOrbitInclination
-      << "\n    theMapAzimAngle: " << theMapAzimAngle
-      << "\n  theMap2IcRotAngle: " << theMap2IcRotAngle
-      << "\n   theIntrackOffset: " << theIntrackOffset
-      << "\n   theCrtrackOffset: " << theCrtrackOffset
-      << "\n     theLineGsdCorr: " << theLineGsdCorr
-      << "\n     theSampGsdCorr: " << theSampGsdCorr
-      << "\n      theRollOffset: " << theRollOffset
-      << "\n       theYawOffset: " << theYawOffset
-      << "\n         theYawRate: " << theYawRate
-      << "\n     theMapRotation: " << theMapRotation
-      << endl;
-
-   return ossimSensorModel::print(os);
-}
-
-//*****************************************************************************
-//  METHOD: ossimLandSatModel::saveState()
-//  
-//  Saves the model state to the KWL. This KWL also serves as a geometry file.
-//  
-//*****************************************************************************
-bool ossimLandSatModel::saveState(ossimKeywordlist& kwl,
-                              const char* prefix) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::saveState: entering..." << std::endl;
-
-   kwl.add(prefix, ossimKeywordNames::TYPE_KW, TYPE_NAME(this));
-
-   //***
-   // Hand off to base class for common stuff:
-   //***
-   ossimSensorModel::saveState(kwl, prefix);
-
-   //***
-   // Save off data members:
-   //***
-   kwl.add(prefix, PROJECTION_TYPE_KW,   theProjectionType, true);
-   kwl.add(prefix, MAP_ZONE_KW,          theMapZone, true);
-   kwl.add(prefix, MAP_OFFSET_X_KW,      theMapOffset.x, true);
-   kwl.add(prefix, MAP_OFFSET_Y_KW,      theMapOffset.y, true);
-   kwl.add(prefix, WRS_PATH_NUMBER_KW,   theWrsPathNumber, true);
-   kwl.add(prefix, ROW_NUMBER_KW,        theWrsRowNumber, true);
-   kwl.add(prefix, ILLUM_AZIMUTH_KW,     theIllumAzimuth, true);
-   kwl.add(prefix, ILLUM_ELEVATION_KW,   theIllumElevation, true);
-   kwl.add(prefix, MERIDIANAL_ANGLE_KW,  theMeridianalAngle, true);
-   kwl.add(prefix, ORBIT_ALTITUDE_KW,    theOrbitAltitude, true);
-   kwl.add(prefix, ORBIT_INCLINATION_KW, theOrbitInclination, true);
-   kwl.add(prefix, MAP_AZIM_ANGLE_KW,    theMapAzimAngle, true);
-   kwl.add(prefix, MAP_2Ic_ROT_ANGLE_KW, theMap2IcRotAngle, true);
-
-//    kwl.add(prefix, INTRACK_OFFSET_KW ,   theIntrackOffset, true);
-//    kwl.add(prefix, CRTRACK_OFFSET_KW,    theCrtrackOffset, true);
-//    kwl.add(prefix, LINE_GSD_CORR_KW,     theLineGsdCorr, true);
-//    kwl.add(prefix, SAMP_GSD_CORR_KW,     theSampGsdCorr, true);
-//    kwl.add(prefix, ROLL_OFFSET_KW,       theRollOffset, true);
-//    kwl.add(prefix, YAW_OFFSET_KW,        theYawOffset, true);
-//    kwl.add(prefix, YAW_RATE_KW,          theYawRate, true);
-//    kwl.add(prefix, MAP_ROTATION_KW,      theMapRotation, true);
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::saveState: returning..." << std::endl;
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimLandSatModel::loadState()
-//  
-//  Restores the model's state from the KWL. This KWL also serves as a
-//  geometry file.
-//  
-//*****************************************************************************
-bool ossimLandSatModel::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix) 
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState: entering..." << std::endl;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState:"
-                                          << "\nInput kwl:  " << kwl
-                                          << std::endl;
-   }
-
-   const char* value = NULL;
-   const char* keyword =NULL;
-   bool success;
-
-   //***
-   // Assure this keywordlist contains correct type info:
-   //***
-   value = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   if (!value || (strcmp(value, TYPE_NAME(this)))) 
-     {
-       theErrorStatus = 1;
-       return false;
-     }
-
-   //
-   // Clear out any existing adjustable params:
-   //
-   if(getNumberOfAdjustableParameters() != NUM_ADJUSTABLE_PARAMS)
-     {
-       initAdjustableParameters();
-     }
-   
-   //***
-   // Pass on to the base-class for parsing first:
-   //***
-   success = ossimSensorModel::loadState(kwl, prefix);
-   if (!success) 
-     {
-       theErrorStatus++;
-       return false;
-     }
- 
-   keyword = PROJECTION_TYPE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-
-   theProjectionType = (ProjectionType) atoi(value);
- 
-   keyword = MAP_ZONE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theMapZone = atoi(value);
- 
-   keyword = MAP_OFFSET_X_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theMapOffset.x = atof(value);
- 
-   keyword = MAP_OFFSET_Y_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theMapOffset.y = atof(value);
- 
-   keyword = WRS_PATH_NUMBER_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theWrsPathNumber = atoi(value);
-
-   keyword = ROW_NUMBER_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theWrsRowNumber = atoi(value);
- 
-   keyword = ILLUM_AZIMUTH_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theIllumAzimuth = atof(value);
- 
-   keyword = ILLUM_ELEVATION_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theIllumElevation = atof(value);
- 
-   keyword = MERIDIANAL_ANGLE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theMeridianalAngle = atof(value);
- 
-   keyword = ORBIT_ALTITUDE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theOrbitAltitude = atof(value);
-   
-   keyword = ORBIT_INCLINATION_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theOrbitInclination = atof(value);
-   
-   keyword = MAP_AZIM_ANGLE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theMapAzimAngle = atof(value);
- 
-   keyword = MAP_2Ic_ROT_ANGLE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-     {
-       theErrorStatus++;
-       return false;
-     }
-   theMap2IcRotAngle = atof(value);
-
-   theIntrackOffset = 0.0;
-   theCrtrackOffset = 0.0;
-   theLineGsdCorr   = 0.0;
-   theSampGsdCorr   = 0.0;
-   theRollOffset    = 0.0;
-   theYawOffset     = 0.0;
-   theYawRate       = 0.0;
-   theMapRotation   = 0.0;
-
-   //***
-   // Adjustable parameters are optional keywords:
-   //***
-//    keyword = INTRACK_OFFSET_KW;
-//    value = kwl.find(prefix, keyword);
-//    if(value)
-//       theIntrackOffset = ossimString(value).toDouble();
-//    else
-//     theIntrackOffset = 0.0;
-   
-//    keyword = CRTRACK_OFFSET_KW;
-//    value = kwl.find(prefix, keyword);
-//    if(value)
-//       theCrtrackOffset = ossimString(value).toDouble();
-//    else
-//      theCrtrackOffset = 0.0;
-
-//    keyword = LINE_GSD_CORR_KW;
-//    value = kwl.find(prefix, keyword);
-//    if(value)
-//       theLineGsdCorr = ossimString(value).toDouble();
-//    else
-//       theLineGsdCorr = 0.0;
-
-//    keyword = SAMP_GSD_CORR_KW;
-//    value = kwl.find(prefix, keyword);
-//    if(value)
-//       theSampGsdCorr = ossimString(value).toDouble();
-//    else
-//       theSampGsdCorr = 0.0;
-   
-//    keyword = ROLL_OFFSET_KW;
-//    value = kwl.find(prefix, keyword);
-//    if(value)
-//       theRollOffset = ossimString(value).toDouble();
-//    else
-//       theRollOffset = 0.0;
-   
-//    keyword = YAW_OFFSET_KW;
-//    value = kwl.find(prefix, keyword);
-//    if(value)
-//       theYawOffset = ossimString(value).toDouble();
-//    else
-//      theYawOffset = 0.0;
-   
-//    keyword = YAW_RATE_KW;
-//    value = kwl.find(prefix, keyword);
-//    if(value)
-//       theYawRate = ossimString(value).toDouble();
-//    else
-//       theYawRate = 0.0;
-
-//    keyword = MAP_ROTATION_KW;
-//    value = kwl.find(prefix,  keyword);
-//    if(value)
-//       theMapRotation = ossimString(value).toDouble();
-//    else
-//       theMapRotation = 0.0;
-
-   //***
-   // Initialize given parameters read:
-   //***
-   initMapProjection();
-   updateModel();
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState: returning..." << std::endl;
-   return true;
-}
-
-//*****************************************************************************
-// STATIC METHOD: ossimLandSatModel::writeGeomTemplate
-//  
-//  Writes a sample kwl to output stream.
-//  
-//*****************************************************************************
-void ossimLandSatModel::writeGeomTemplate(ostream& os)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: entering..." << std::endl;
-
-   os <<
-      "//**************************************************************\n"
-      "// Template for LandSat model keywordlist\n"
-      "//**************************************************************\n"
-      << ossimKeywordNames::TYPE_KW << ": " << "ossimLandSatModel" << endl;
-
-   ossimSensorModel::writeGeomTemplate(os);
-   
-   os << "//\n"
-      << "// Derived-class ossimLandSatModel Keywords:\n"
-      << "//\n"
-      << PROJECTION_TYPE_KW     << ": <float>\n"
-      << MAP_ZONE_KW            << ": <float>\n"
-      << MAP_OFFSET_X_KW        << ": <float>\n"
-      << MAP_OFFSET_Y_KW        << ": <float>\n"
-      << WRS_PATH_NUMBER_KW     << ": <float>\n"
-      << ROW_NUMBER_KW          << ": <float>\n"
-      << ILLUM_AZIMUTH_KW       << ": <float>\n"
-      << ILLUM_ELEVATION_KW     << ": <float>\n"
-      << MERIDIANAL_ANGLE_KW    << ": <float>\n"
-      << ORBIT_ALTITUDE_KW      << ": <float>\n"
-      << ORBIT_INCLINATION_KW   << ": <float>\n"
-      << MAP_AZIM_ANGLE_KW      << ": <float>\n"
-      << MAP_2Ic_ROT_ANGLE_KW   << ": <float>\n"
-      << INTRACK_OFFSET_KW      << ": <float> [optional]\n"
-      << CRTRACK_OFFSET_KW      << ": <float> [optional]\n"
-      << LINE_GSD_CORR_KW       << ": <float> [optional]\n"
-      << SAMP_GSD_CORR_KW       << ": <float> [optional]\n"
-      << ROLL_OFFSET_KW         << ": <float> [optional]\n"
-      << YAW_OFFSET_KW          << ": <float> [optional]\n"
-      << YAW_RATE_KW            << ": <float> [optional]\n"
-      << MAP_ROTATION_KW        << ": <float> [optional]\n"
-      << endl;
-   os << "\n" <<endl;
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: returning..." << std::endl;
-   return;
-}
-
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimLandSatModel::initMapProjection()
-//  
-//*****************************************************************************
-void ossimLandSatModel::initMapProjection()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimLandSatModel::writeGeomTemplate: entering... " << std::endl;
-
-   theMapProjection = 0;   
-   //*** 
-   // Instantiate the proper map projection:
-   //***
-   if ((theProjectionType == SOM_ORBIT) || (theProjectionType == SOM_MAP))
-   {
-      theMapProjection = new ossimSpaceObliqueMercatorProjection(
-         ossimSpaceObliqueMercatorProjection::SOM_TYPE_LANDSAT_7,
-         (double)theWrsPathNumber);
-   }
-   else 
-   {
-      ossimUtmProjection* utm   = new ossimUtmProjection(theMapZone);
-      theMapProjection = utm;
-      if(theRefGndPt.latd() < 0.0)
-      {
-         utm->setHemisphere('S');
-      }
-      else
-      {
-         utm->setHemisphere('N');
-      }
-   }
-
-   //***
-   // Initialize angle sines/cosines used in phiLambda projection:
-   //***
-   theMap2IcRotAngle = theMeridianalAngle + theMapAzimAngle;
-   theMap2IcRotCos   = ossim::cosd(theMap2IcRotAngle);
-   theMap2IcRotSin   = ossim::sind(theMap2IcRotAngle);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimLandSatModel::writeGeomTemplate: returning... " << std::endl;
-   return;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD:
-//*****************************************************************************
-void  ossimLandSatModel::updateModel()
-{
-   //***
-   // Update the geometry...
-   // Adjusted = Initial + adj_parm[i]*adj_sigma[i]
-   // Some parameters have a zero initial value and that term is not included.
-   //***
-  theIntrackOffset = computeParameterOffset(INTRACK_OFFSET);
-  theCrtrackOffset = computeParameterOffset(CRTRACK_OFFSET);
-  theLineGsdCorr   = computeParameterOffset(LINE_GSD_CORR);
-  theSampGsdCorr   = computeParameterOffset(SAMP_GSD_CORR);
-  theRollOffset    = computeParameterOffset(ROLL_OFFSET);
-  theYawOffset     = computeParameterOffset(YAW_OFFSET);
-  theYawRate       = computeParameterOffset(YAW_RATE);
-  theMapRotation   = computeParameterOffset(MAP_ROTATION);
-
-//   int numParams = getNumberOfAdjustableParameters();
-   //***
-   // Now the initial values have been updated, zero out the adjustment:
-   //***
-//    for (int i=0; i<numParams; i++)
-//       setAdjustableParameter(i, 0.0);
-
-   //***
-   // Compute image-common values dependent on adjustable parameters:
-   //***
-   if (theProjectionType == UTM_ORBIT)
-   {
-      theMapAzimCos = ossim::cosd(-theMapAzimAngle + theMapRotation);
-      theMapAzimSin = ossim::sind(-theMapAzimAngle + theMapRotation);
-   }
-   else
-   {
-      theMapAzimCos = ossim::cosd(theMapAzimAngle + theMapRotation);
-      theMapAzimSin = ossim::sind(theMapAzimAngle + theMapRotation);
-   }
-
-   double cos = ossim::cosd(theRollOffset);
-   double sin = ossim::sind(theRollOffset);
-   theRollRotMat = ossimMatrix3x3::create( 1.0, 0.0, 0.0,
-                                           0.0, cos,-sin,
-                                           0.0, sin, cos);
-   
-   
-}
-//*****************************************************************************
-// PRIVATE METHOD: ossimLandSatModel::initAdjustableParameters()
-//  
-//  This method initializes the base class adjustable parameter and associated
-//  sigmas arrays with quantities specific to this model.
-//
-//  
-//*****************************************************************************
-void ossimLandSatModel::initAdjustableParameters()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initAdjustableParameters: entering..." << std::endl;
-
-   //
-   // Allocate storage for adjustables and assign their names and units strings
-   //
-   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
-   int numParams = getNumberOfAdjustableParameters();
-   //***
-   // Initialize base-class adjustable parameter array:
-   //***
-   for (int i=0; i<numParams; i++)
-   {
-      setAdjustableParameter(i, 0.0);
-      setParameterDescription(i, PARAM_NAMES[i]);
-      setParameterUnit(i,PARAM_UNITS[i]);
-   }
-   //***
-   // Initialize base-class parameter sigma array:
-   //***
-   setParameterSigma(INTRACK_OFFSET, 500.0); //change for Landsat 5
-   setParameterSigma(CRTRACK_OFFSET, 500.0); //change for Landsat 5
-   setParameterSigma(LINE_GSD_CORR, 0.005);  
-   setParameterSigma(SAMP_GSD_CORR, 0.005);  
-   setParameterSigma(ROLL_OFFSET, 0.01);  
-   setParameterSigma(YAW_OFFSET, 0.01);  
-   setParameterSigma(YAW_RATE, 0.05);  
-   setParameterSigma(MAP_ROTATION, 0.1);
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initAdjustableParameters: returning..." << std::endl;
-}
-
-bool
-ossimLandSatModel::setupOptimizer(const ossimString& init_file)
-{
-   //init model using file path
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::setupOptimizer(init_file): entering..." << std::endl;
-
-   theMapProjection = 0;
-   theIntrackOffset = 0.0;
-   theCrtrackOffset = 0.0;
-   theLineGsdCorr   = 0.0;   
-   theSampGsdCorr   = 0.0;
-   theRollOffset    = 0.0;
-   theYawOffset     = 0.0;
-   theYawRate       = 0.0;
-   theMapRotation   = 0.0;
-
-   ossimRefPtr<ossimFfL7> ff_headerp;
-   if (ossimString::downcase(init_file).contains("header.dat"))
-   {
-      ossimRefPtr<ossimFfL5> h = new ossimFfL5(init_file); 
-      ff_headerp = h.get();
-      
-      if (!ff_headerp->getErrorStatus())
-      {
-         double d = fabs(h->revb()->theUlEasting - h->revb()->theCenterEasting)/h->theGsd;
-         h->theCenterImagePoint.x = static_cast<ossim_int32>(d); // d + 0.5 ???
-         
-         d = fabs(h->revb()->theUlNorthing - h->revb()->theCenterNorthing)/h->theGsd;
-         h->theCenterImagePoint.y = static_cast<ossim_int32>(d); // d + 0.5 ???
-         initFromHeader(*ff_headerp);
-         
-         theMapOffset.x = h->revb()->theUlEasting;
-         theMapOffset.y = h->revb()->theUlNorthing;
-         
-      }
-      else
-      {
-         ff_headerp = 0;
-      }
-   }
-   else
-   {
-      ff_headerp=new ossimFfL7(init_file);
-      if (!ff_headerp->getErrorStatus())
-      {
-         initFromHeader(*ff_headerp);
-      }
-      else
-      {
-         ff_headerp = 0;
-      }
-   }
-   if(!ff_headerp.valid())
-   {
-      //
-      // If not header, then check for possible KWL file. The loadState sets the
-      // error status:
-      //
-      ossimFilename init_filename(init_file);
-      ossimKeywordlist kwl(init_filename);
-      loadState(kwl);
-   }
-
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::setupOptimizer(init_file): Exited..." << std::endl;
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimLensDistortion.cpp b/ossim/src/ossim/projection/ossimLensDistortion.cpp
deleted file mode 100644
index e1cfd21..0000000
--- a/ossim/src/ossim/projection/ossimLensDistortion.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2005 Garrett Potts
-//
-// MIT
-// 
-// Author:  Garrett Potts
-//
-// Description:
-//
-// ossimLensDistortion
-//*******************************************************************
-//  $Id: ossimLensDistortion.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <sstream>
-#include <ossim/projection/ossimLensDistortion.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimString.h>
-
-RTTI_DEF1(ossimLensDistortion, "ossimLensDistortion", ossim2dTo2dTransform);
-
-bool ossimLensDistortion::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix)const
-{
-   ossim2dTo2dTransform::saveState(kwl, prefix);
-   
-   kwl.add(prefix,
-           "center",
-           ossimString::toString(theCenter.x) + " " + ossimString::toString(theCenter.y),
-           true);
-
-   return true;
-}
-
-bool ossimLensDistortion::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   const char* center = kwl.find(prefix, "center");
-   theCenter.x = 0.0;
-   theCenter.y = 0.0;
-   
-   if(center)
-   {
-      std::vector<ossimString> splitString;
-      ossimString tempString(center);
-      tempString = tempString.trim();
-      tempString.split(splitString, " ");
-      if(splitString.size() == 2)
-      {
-         theCenter.x = splitString[0].toDouble();
-         theCenter.y = splitString[1].toDouble();
-      }
-   }
-
-   return ossim2dTo2dTransform::loadState(kwl, prefix);
-
-}
-
-void ossimLensDistortion::distort(const ossimDpt& input, ossimDpt& output)const
-{
-   int iters = 0;
-   
-   //***
-   // Begin with guess. Forward transform is defined as trasforming left to
-   // right. We are therefore solving for left:
-   //***
-   ossimDpt left (input);
-   ossimDpt left_dx;
-   ossimDpt left_dy;
-   ossimDpt right;
-   ossimDpt right_dx;
-   ossimDpt right_dy;
-   ossimDpt dr_dx;
-   ossimDpt dr_dy;
-   ossimDpt r_diff;
-   ossimDpt l_diff;
-   double inverse_norm;
-   
-   //***
-   // Begin iterations:
-   //***
-   do
-   {
-      //***
-      // establish perturbed image points about the guessed point:
-      //***
-      left_dx.x = left.x + 1.0;
-      left_dx.y = left.y;
-      left_dy.x = left.x;
-      left_dy.y = left.y + 1.0;
-      
-      //***
-      // Compute numerical partials at current guessed point:
-      //***
-      undistort(left,    right);
-      undistort(left_dx, right_dx);
-      undistort(left_dy, right_dy);
-      
-      dr_dx.x = (right_dx.x - right.x); //e
-      dr_dx.y = (right_dx.y - right.y); //g
-      dr_dy.x = (right_dy.x - right.x); //f
-      dr_dy.y = (right_dy.y - right.y); //h
-      
-      //***
-      // Test for convergence:
-      //***
-      r_diff = input - right;
-      
-      //***
-      // Compute linearized estimate of image point given gp delta:
-      //***
-      inverse_norm = dr_dy.u*dr_dx.v - dr_dx.u*dr_dy.v; // fg-eh
-      if (inverse_norm != 0)
-      {
-         l_diff.u = (-dr_dy.v*r_diff.u + dr_dy.u*r_diff.v)/inverse_norm;
-         l_diff.v = ( dr_dx.v*r_diff.u - dr_dx.u*r_diff.v)/inverse_norm;
-         left += l_diff;
-      }
-      else
-      {
-         l_diff.u = 0;
-         l_diff.v = 0;
-      }
-      
-      iters++;
-      
-   } while (((fabs(l_diff.u) > theConvergenceThreshold) ||
-             (fabs(l_diff.v) > theConvergenceThreshold)) &&
-            (iters < theMaxIterations));
-   
-   
-   output = left;
-}
-
diff --git a/ossim/src/ossim/projection/ossimLlxyProjection.cpp b/ossim/src/ossim/projection/ossimLlxyProjection.cpp
deleted file mode 100644
index 056cae4..0000000
--- a/ossim/src/ossim/projection/ossimLlxyProjection.cpp
+++ /dev/null
@@ -1,322 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2002 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for ossimLlxy.  This is a simple "latitude /
-// longitude to x / y" projection.
-// 
-//*******************************************************************
-//  $Id: ossimLlxyProjection.cpp 20060 2011-09-07 12:33:46Z gpotts $
-
-#include <ossim/projection/ossimLlxyProjection.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDatum.h>
-
-// RTTI information for the ossimMapProjection
-RTTI_DEF1(ossimLlxyProjection, "ossimLlxyProjection" , ossimMapProjection);
-
-// About 1 meter.
-static const ossim_float64 DEFAULT_DEGREES_PER_PIXEL = 8.9831528412e-006;
-
-ossimLlxyProjection::ossimLlxyProjection()
-{
-  // set to about 1 meter per pixel
-   theDegreesPerPixel.y = DEFAULT_DEGREES_PER_PIXEL;
-   theDegreesPerPixel.x = DEFAULT_DEGREES_PER_PIXEL;
-   theUlEastingNorthing.y = ossim::nan();
-   theUlEastingNorthing.x = ossim::nan();
-   computeMetersPerPixel(theOrigin, 
-			 theDegreesPerPixel.y,
-			 theDegreesPerPixel.x,
-			 theMetersPerPixel);
-}
-
-ossimLlxyProjection::ossimLlxyProjection(const ossimLlxyProjection& rhs)
-   :
-      ossimMapProjection(rhs)
-{
-   theOrigin              = rhs.theOrigin;
-   theUlGpt               = rhs.theUlGpt;
-   theUlEastingNorthing.y = ossim::nan();
-   theUlEastingNorthing.x = ossim::nan();
-   theDatum               = theOrigin.datum();
-   theEllipsoid           = *(theDatum->ellipsoid());
-   theDegreesPerPixel.y    = rhs.theDegreesPerPixel.y;
-   theDegreesPerPixel.x    = rhs.theDegreesPerPixel.x;
-   computeMetersPerPixel(theOrigin, 
-			 theDegreesPerPixel.y,
-			 theDegreesPerPixel.x,
-			 theMetersPerPixel);
-}
-
-ossimLlxyProjection::ossimLlxyProjection(const ossimGpt& origin,
-                                         double latSpacing,
-                                         double lonSpacing)
-   :
-      ossimMapProjection()
-{
-   theOrigin              = origin;
-   theUlGpt               = origin;
-   theUlEastingNorthing.y = 0.0;
-   theUlEastingNorthing.x = 0.0;
-   theDatum               = theOrigin.datum();
-   theEllipsoid           = *(theDatum->ellipsoid());
-   theDegreesPerPixel.y    = latSpacing;
-   theDegreesPerPixel.x    = lonSpacing;
-   computeMetersPerPixel(theOrigin, 
-			 theDegreesPerPixel.y,
-			 theDegreesPerPixel.x,
-			 theMetersPerPixel);
-}
-
-ossimLlxyProjection::ossimLlxyProjection(const ossimEllipsoid& ellipsoid,
-					 const ossimGpt& origin)
-  :ossimMapProjection(ellipsoid, origin)
-{
-   theDegreesPerPixel.y = 1.0;
-   theDegreesPerPixel.x = 1.0;
-   theUlEastingNorthing.y = ossim::nan();
-   theUlEastingNorthing.x = ossim::nan();
-   computeMetersPerPixel(theOrigin, 
-			 theDegreesPerPixel.y,
-			 theDegreesPerPixel.x,
-			 theMetersPerPixel);
-}
-
-ossimLlxyProjection::~ossimLlxyProjection()
-{
-}
-
-ossimObject* ossimLlxyProjection::dup()const
-{
-   return new ossimLlxyProjection(*this);
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::computeDegreesPerPixel
-//  
-//*****************************************************************************
-void ossimLlxyProjection::computeDegreesPerPixel(const ossimGpt& ground,
-                                                const ossimDpt& metersPerPixel,
-                                                double &deltaLat,
-                                                double &deltaLon)
-{
-   ossimDpt mpd = ground.metersPerDegree();
-   ossimDpt dpm(1.0/mpd.x,
-                1.0/mpd.y);
-   deltaLat = metersPerPixel.y*dpm.y;
-   deltaLon = metersPerPixel.x*dpm.x;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::computeMetersPerPixel
-//  
-//*****************************************************************************
-void ossimLlxyProjection::computeMetersPerPixel(const ossimGpt& center,
-						  double deltaDegreesPerPixelLat,
-						  double deltaDegreesPerPixelLon,
-						  ossimDpt &metersPerPixel)
-{
-  metersPerPixel = center.metersPerDegree();
-  metersPerPixel.x *= deltaDegreesPerPixelLon;
-  metersPerPixel.y *= deltaDegreesPerPixelLat;
-}
-
-void ossimLlxyProjection::worldToLineSample(const ossimGpt& worldPoint,
-                                            ossimDpt&       lineSampPt) const
-{
-   ossimGpt gpt = worldPoint;
-   
-   if (*theOrigin.datum() != *gpt.datum())
-   {
-      // Apply datum shift if it's not the same.
-      gpt.changeDatum(theOrigin.datum());
-   }
-
-   lineSampPt.line = (theUlGpt.latd() - gpt.latd()) / theDegreesPerPixel.y;
-   lineSampPt.samp = (gpt.lond() - theUlGpt.lond()) / theDegreesPerPixel.x;
-}
-
-void ossimLlxyProjection::lineSampleToWorld(const ossimDpt& lineSampPt,
-                                            ossimGpt&       worldPt) const
-{
-   worldPt.makeNan();
-   // Start with the origin.  This will keep the origin's datum.
-   worldPt.datum(theOrigin.datum());
-   
-   double lat = theUlGpt.latd() - (lineSampPt.line * theDegreesPerPixel.y);
-   double lon = theUlGpt.lond() + (lineSampPt.samp * theDegreesPerPixel.x);
-
-   //---
-   // Assuming the origin had a lon between -180 and 180 and lat between -90
-   // and 90.
-   //---
-//    if (lon > 180.0)
-//    {
-//       lon -= 360.0;
-//    }
-//    else if (lon < -180.0)
-//    {
-//       lon += 360.0;
-//    }
-//    if (lat > 90.0)
-//    {
-//       lat -= 90.0;
-//    }
-//    else if (lat < -90.0)
-//    {
-//       lat = -180.0 - lat;
-//    }
-
-   worldPt.latd(lat);
-   worldPt.lond(lon);
-   if(theElevationLookupFlag)
-   {
-      worldPt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(worldPt);
-   }
-}
-
-std::ostream& ossimLlxyProjection::print(std::ostream& out) const
-{
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << "ossimLlxyProjection dump:"
-       << "\norigin:  " << theOrigin
-       << "\nlatitude spacing in decimal degrees:   " << theDegreesPerPixel.y
-       << "\nlongitude spacing in decimal degrees:  " << theDegreesPerPixel.x
-       << "\n\nossimMapProjection dump:\n" << endl;
-
-   return ossimMapProjection::print(out);
-}
-
-void ossimLlxyProjection::setMetersPerPixel(const ossimDpt& pt)
-{
-  ossimMapProjection::setMetersPerPixel(pt);
-  computeDegreesPerPixel(theOrigin,
-			 theMetersPerPixel,
-			 theDegreesPerPixel.y,
-			 theDegreesPerPixel.x);
-}
-
-bool ossimLlxyProjection::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix) const
-{
-   // Base class...
-   ossimMapProjection::saveState(kwl, prefix);
-
-   return true;
-}
-
-bool ossimLlxyProjection::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   // Base class...
-   ossimMapProjection::loadState(kwl, prefix);
-
-   if (theOrigin.hasNans() == false)
-   {
-      if ( (theDegreesPerPixel.hasNans() == false) &&
-           theMetersPerPixel.hasNans() )
-      {
-         // Compute meters per pixel from origin and decimal degrees.
-         computeMetersPerPixel(theOrigin, 
-                               theDegreesPerPixel.y,
-                               theDegreesPerPixel.x,
-                               theMetersPerPixel);
-      }
-      else if( (theMetersPerPixel.hasNans() == false) &&
-               theDegreesPerPixel.hasNans() )
-      {
-         // Compute decimal degrees per pixel from origin and meters.
-         computeDegreesPerPixel(theOrigin, 
-                                theMetersPerPixel,
-                                theDegreesPerPixel.y,
-                                theDegreesPerPixel.x);
-      }
-      else
-      {
-         // Assign some value.
-         theDegreesPerPixel.y = DEFAULT_DEGREES_PER_PIXEL;
-         theDegreesPerPixel.x = DEFAULT_DEGREES_PER_PIXEL;
-         computeMetersPerPixel(theOrigin,
-                               theDegreesPerPixel.y,
-                               theDegreesPerPixel.x,
-                               theMetersPerPixel);
-      }
-   }
-    
-   return true;
-}
-
-bool ossimLlxyProjection::operator==(const ossimProjection& projection) const
-{
-   const ossimLlxyProjection* proj
-      = PTR_CAST(ossimLlxyProjection, &projection);
-
-   if(!proj)
-   {
-      return false;
-   }
-
-   return ( // (theOrigin     == proj->theOrigin)     &&  // tmp... fix gpt!
-            (theDegreesPerPixel.y == proj->theDegreesPerPixel.y) &&
-            (theDegreesPerPixel.x == proj->theDegreesPerPixel.x) );
-}
-
-
-ossimDpt ossimLlxyProjection::forward(const ossimGpt &worldPoint) const
-{
-   ossimDpt result;
-
-   worldToLineSample(worldPoint, result);
-
-   return result;
-}
-
-ossimGpt ossimLlxyProjection::inverse(const ossimDpt &projectedPoint) const
-{
-   ossimGpt result;
-   
-   lineSampleToWorld(projectedPoint, result);
-   
-   return result;
-}
-
-void ossimLlxyProjection::setLatSpacing(double spacing)
-{
-   theDegreesPerPixel.y = spacing;
-
-   // Update the meters per pixel.
-   ossimDpt pt = ossimGpt(0.0, 0.0).metersPerDegree();
-   theMetersPerPixel.y = pt.y * theDegreesPerPixel.y;
-}
-
-void ossimLlxyProjection::setLonSpacing(double spacing)
-{
-   theDegreesPerPixel.x = spacing;
-
-   // Update the meters per pixel.
-   ossimDpt pt = ossimGpt(0.0, 0.0).metersPerDegree();
-   theMetersPerPixel.x = pt.x * theDegreesPerPixel.x;
-}
-
-bool ossimLlxyProjection::isGeographic() const
-{
-   return true;
-}
-
-double ossimLlxyProjection::getLatSpacing() const
-{
-   return theDegreesPerPixel.y;
-}
-
-double ossimLlxyProjection::getLonSpacing() const
-{
-   return theDegreesPerPixel.x;
-}
diff --git a/ossim/src/ossim/projection/ossimMapProjection.cpp b/ossim/src/ossim/projection/ossimMapProjection.cpp
deleted file mode 100644
index 69ad40e..0000000
--- a/ossim/src/ossim/projection/ossimMapProjection.cpp
+++ /dev/null
@@ -1,1699 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Base class for all map projections.
-// 
-//*******************************************************************
-//  $Id: ossimMapProjection.cpp 23418 2015-07-09 18:46:41Z gpotts $
-
-#include <iostream>
-#include <cstdlib>
-#include <iomanip>
-#include <sstream>
-
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDatumFactoryRegistry.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimMatrix3x3.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <ossim/base/ossimTrace.h>
-
-static ossimTrace traceDebug("ossimMapProjection:debug");
-
-// RTTI information for the ossimMapProjection
-RTTI_DEF1(ossimMapProjection, "ossimMapProjection" , ossimProjection);
-
-ossimMapProjection::ossimMapProjection(const ossimEllipsoid& ellipsoid,
-                                       const ossimGpt& origin)
-   :theEllipsoid(ellipsoid),
-    theOrigin(origin),
-    theDatum(origin.datum()), // force no shifting
-    theUlGpt(0, 0),
-    theUlEastingNorthing(0, 0),
-    theFalseEastingNorthing(0, 0),
-    thePcsCode(0),
-    theElevationLookupFlag(false),
-    theModelTransform(),
-    theInverseModelTransform(),
-    theModelTransformUnitType(OSSIM_UNIT_UNKNOWN),
-    theProjectionUnits(OSSIM_METERS) 
-{
-   theUlGpt = theOrigin;
-   theUlEastingNorthing.makeNan();
-   theMetersPerPixel.makeNan();
-   theDegreesPerPixel.makeNan();
-}
-
-ossimMapProjection::ossimMapProjection(const ossimMapProjection& src)
-      : ossimProjection(src),
-        theEllipsoid(src.theEllipsoid),
-        theOrigin(src.theOrigin),
-        theDatum(src.theDatum),
-        theMetersPerPixel(src.theMetersPerPixel),
-        theDegreesPerPixel(src.theDegreesPerPixel),
-        theUlGpt(src.theUlGpt),
-        theUlEastingNorthing(src.theUlEastingNorthing),
-        theFalseEastingNorthing(src.theFalseEastingNorthing),
-        thePcsCode(src.thePcsCode),
-        theElevationLookupFlag(false),
-        theModelTransform(src.theModelTransform),
-        theInverseModelTransform(src.theInverseModelTransform),
-        theModelTransformUnitType(src.theModelTransformUnitType),
-        theProjectionUnits(src.theProjectionUnits)
-{
-}
-
-ossimMapProjection::~ossimMapProjection()
-{
-}
-
-ossimGpt ossimMapProjection::origin()const
-{
-   return theOrigin;
-}
-
-void ossimMapProjection::setPcsCode(ossim_uint32 pcsCode)
-{
-   thePcsCode = pcsCode;
-}
-
-ossim_uint32 ossimMapProjection::getPcsCode() const
-{
-   // The PCS code is not always set when the projection is instantiated with explicit parameters,
-   // since the code is only necessary when looking up those parameters in a database. However, it
-   // is still necessary to recognize when an explicit projection coincides with an EPSG-specified
-   // projection, and assign our PCS code to match it. So let's take this opportunity now to make 
-   // sure the PCS code is properly initialized.
-   if (thePcsCode == 0)
-   {
-      thePcsCode = ossimEpsgProjectionDatabase::instance()->findProjectionCode(*this);
-      if (thePcsCode == 0)
-         thePcsCode = 32767; // user-defined (non-EPSG) projection
-   }
-  
-   if (thePcsCode == 32767)
-      return 0; // 32767 only used internally. To the rest of OSSIM, the PCS=0 is undefined
-   
-   return thePcsCode;
-}
-
-ossimString ossimMapProjection::getProjectionName() const
-{
-   return getClassName();
-}
-
-double ossimMapProjection::getA() const
-{
-   return theEllipsoid.getA();
-}
-
-double ossimMapProjection::getB() const
-{
-   return theEllipsoid.getB();
-}
-
-double ossimMapProjection::getF() const
-{
-   return theEllipsoid.getFlattening();
-}
-
-ossimDpt ossimMapProjection::getMetersPerPixel() const
-{
-   return theMetersPerPixel;
-}
-
-const ossimDpt& ossimMapProjection::getDecimalDegreesPerPixel() const
-{
-   return theDegreesPerPixel;
-}
-
-const ossimDpt& ossimMapProjection::getUlEastingNorthing() const
-{
-   return theUlEastingNorthing;
-}
-
-const ossimGpt&   ossimMapProjection::getUlGpt() const
-{
-   return theUlGpt;
-}
-
-const ossimGpt& ossimMapProjection::getOrigin() const
-{
-  return theOrigin;
-}
-
-const ossimDatum* ossimMapProjection::getDatum() const
-{
-   return theDatum;
-}
-
-bool ossimMapProjection::isGeographic()const
-{
-   return false;
-}
-
-void ossimMapProjection::setEllipsoid(const ossimEllipsoid& ellipsoid)
-{
-   theEllipsoid = ellipsoid; update();
-}
-
-void ossimMapProjection::setAB(double a, double b)
-{
-   theEllipsoid.setA(a); theEllipsoid.setB(b); update();
-}
-
-void ossimMapProjection::setDatum(const ossimDatum* datum)
-{
-
-   if (!datum || (*theDatum == *datum))
-      return;
-
-   theDatum = datum; 
-   theEllipsoid = *(theDatum->ellipsoid());
-
-   // Change the datum of the ossimGpt data members:
-   theOrigin.changeDatum(theDatum);
-   theUlGpt.changeDatum(theDatum);
-
-   update();
-
-   // A change of datum usually implies a change of EPSG codes. Reset the PCS code. It will be
-   // reestablished as needed in the getPcsCode() method:
-   thePcsCode = 0;
-}
-
-void ossimMapProjection::setOrigin(const ossimGpt& origin)
-{
-   // Set the origin and since the origin has a datum which in turn has
-   // an ellipsoid, sync them up.
-   // NOTE: Or perhaps we need to change the datum of the input origin to that of theDatum? (OLK 05/11)
-   theOrigin    = origin;
-   theOrigin.changeDatum(theDatum);
-      
-   update();
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::assign
-//
-//*****************************************************************************
-void ossimMapProjection::assign(const ossimProjection &aProjection)
-{
-   if(&aProjection!=this)
-   {
-      ossimKeywordlist kwl;
-
-      aProjection.saveState(kwl);
-      loadState(kwl);
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::update
-//
-//*****************************************************************************
-void ossimMapProjection::update()
-{
-   // if the delta lat and lon per pixel is set then
-   // check to see if the meters were set.
-   //
-   if( hasModelTransform() )
-   {
-      updateFromTransform();
-   }
-   else if( theDegreesPerPixel.hasNans() == false )
-   {
-      if(theMetersPerPixel.hasNans())
-      {
-         computeMetersPerPixel();
-      }
-   }
-   else if(!theMetersPerPixel.hasNans())
-   {
-      computeDegreesPerPixel();
-   }
-   // compute the tie points if not already computed
-   //
-   // The tiepoint was specified either as easting/northing or lat/lon. Need to initialize the one
-   // that has not been assigned yet:
-   if (theUlEastingNorthing.hasNans() && !theUlGpt.hasNans())
-      theUlEastingNorthing = forward(theUlGpt);
-   else if (theUlGpt.hasNans() && !theUlEastingNorthing.hasNans())
-      theUlGpt = inverse(theUlEastingNorthing);
-   else if (theUlGpt.hasNans() && theUlEastingNorthing.hasNans())
-   {
-      theUlGpt = theOrigin;
-      theUlEastingNorthing = forward(theUlGpt);
-   }
-   if(theMetersPerPixel.hasNans() &&
-      theDegreesPerPixel.hasNans())
-   {
-      ossimDpt mpd = ossimGpt().metersPerDegree();
-      if(isGeographic())
-      {
-         theDegreesPerPixel.lat = 1.0/mpd.y;
-         theDegreesPerPixel.lon = 1.0/mpd.x;
-         computeMetersPerPixel();
-      }
-      else
-      {
-         theMetersPerPixel.x = 1.0;
-         theMetersPerPixel.y = 1.0;
-         computeDegreesPerPixel();
-     }
-   }
-}
-
-void ossimMapProjection::updateFromTransform()
-{
-   if ( hasModelTransform() )
-   {
-      const NEWMAT::Matrix& m = theModelTransform.getData();
-      ossimDpt ls1(0, 0);
-      ossimDpt ls2(1, 0);
-      ossimDpt ls3(0, 1);
-      ossimGpt wpt1;
-      ossimGpt wpt2;
-      lineSampleToWorld(ls1, wpt1);
-      ossimDpt mpt1(m[0][0]*ls1.x + m[0][1]*ls1.y + m[0][3],
-                    m[1][0]*ls1.x + m[1][1]*ls1.y + m[1][3]);
-      ossimDpt mpt2(m[0][0]*ls2.x + m[0][1]*ls2.y + m[0][3],
-                    m[1][0]*ls2.x + m[1][1]*ls2.y + m[1][3]);
-      ossimDpt mpt3(m[0][0]*ls3.x + m[0][1]*ls3.y + m[0][3],
-                    m[1][0]*ls3.x + m[1][1]*ls3.y + m[1][3]);
-      
-      double len = 1.0;
-      double len2 = 1.0;
-      switch(theModelTransformUnitType)
-      {
-         case OSSIM_DEGREES:
-         case OSSIM_MINUTES:
-         case OSSIM_SECONDS:
-         case OSSIM_RADIANS:
-         {
-            ossimUnitConversionTool ut;
-            len  = (mpt1-mpt2).length();
-            len2  = (mpt1-mpt3).length();
-            ut.setValue((len+len2)*.5, theModelTransformUnitType);
-            len = ut.getValue(OSSIM_DEGREES);
-            theDegreesPerPixel = ossimDpt(len, len);
-            theUlGpt = wpt1;
-            computeMetersPerPixel();
-            break;
-         }
-         default:
-         {
-            ossimUnitConversionTool ut;
-            len  = (mpt1-mpt2).length();
-            len2  = (mpt1-mpt3).length();
-            ut.setValue(mpt1.x, theModelTransformUnitType);
-            mpt1.x = ut.getValue(OSSIM_METERS);
-            ut.setValue(mpt1.y, theModelTransformUnitType);
-            mpt1.y = ut.getValue(OSSIM_METERS);
-            ut.setValue((len+len2)*.5, theModelTransformUnitType);
-            len = ut.getValue(OSSIM_METERS);
-            theMetersPerPixel = ossimDpt(len, len);
-            theUlEastingNorthing = mpt1;
-            computeDegreesPerPixel();
-            break;
-         }
-      }
-      theUlGpt = wpt1;
-   }
-
-}
-
-void ossimMapProjection::applyScale(const ossimDpt& scale,
-                                    bool recenterTiePoint)
-{
-   ossimDpt mapTieDpt;
-   ossimGpt mapTieGpt;
-   if (recenterTiePoint)
-   {
-      if (isGeographic())
-      {
-         mapTieGpt = getUlGpt();
-         mapTieGpt.lat += theDegreesPerPixel.lat/2.0;
-         mapTieGpt.lon -= theDegreesPerPixel.lon/2.0;
-      }
-      else
-      {
-         mapTieDpt = getUlEastingNorthing();
-         mapTieDpt.x -= theMetersPerPixel.x/2.0;
-         mapTieDpt.y += theMetersPerPixel.y/2.0;
-      }
-   }
-
-   theDegreesPerPixel.x *= scale.x;
-   theDegreesPerPixel.y *= scale.y;
-   theMetersPerPixel.x  *= scale.x;
-   theMetersPerPixel.y  *= scale.y;
-
-   if ( recenterTiePoint )
-   {
-      if (isGeographic())
-      {
-         mapTieGpt.lat -= theDegreesPerPixel.lat/2.0;
-         mapTieGpt.lon += theDegreesPerPixel.lon/2.0;
-         setUlTiePoints(mapTieGpt);
-      }
-      else
-      {
-         mapTieDpt.x += theMetersPerPixel.x/2.0;
-         mapTieDpt.y -= theMetersPerPixel.y/2.0;
-         setUlTiePoints(mapTieDpt);
-      }
-   }
-
-   if (theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
-   {
-      theModelTransform.getData()[0][0] = theModelTransform.getData()[0][0]*scale.x;
-      theModelTransform.getData()[1][1] = theModelTransform.getData()[1][1]*scale.y;
-
-      theInverseModelTransform = theModelTransform;
-      theInverseModelTransform.i();
-
-      updateFromTransform();
-   }
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::worldToLineSample
-//
-//*****************************************************************************
-ossimDpt ossimMapProjection::worldToLineSample(const ossimGpt &worldPoint)const
-{
-   ossimDpt result;
-
-   worldToLineSample(worldPoint, result);
-
-   return result;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::lineSampleToWorld
-//
-//*****************************************************************************
-ossimGpt ossimMapProjection::lineSampleToWorld(const ossimDpt &lineSample)const
-{
-   ossimGpt result;
-
-   lineSampleToWorld(lineSample, result);
-
-   return result;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::worldToLineSample
-//
-//*****************************************************************************
-void ossimMapProjection::worldToLineSample(const ossimGpt &worldPoint,
-                                           ossimDpt&       lineSample)const
-{
-
-   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
-   {
-      ossimGpt gpt = worldPoint;
-      if(theDatum)
-      {
-         gpt.changeDatum(theDatum);
-      }
-      switch(theModelTransformUnitType)
-      {
-         case OSSIM_METERS:
-         case OSSIM_FEET:
-         case OSSIM_US_SURVEY_FEET:
-         {
-            ossimDpt modelPoint = forward(gpt);
-            ossimUnitConversionTool ut;
-            ut.setValue(modelPoint.x, OSSIM_METERS);
-            modelPoint.x = ut.getValue(theModelTransformUnitType);
-            ut.setValue(modelPoint.y, OSSIM_METERS);
-            modelPoint.y = ut.getValue(theModelTransformUnitType);
-            const NEWMAT::Matrix& m = theInverseModelTransform.getData();
-            
-            lineSample.x = m[0][0]*modelPoint.x + m[0][1]*modelPoint.y + m[0][3];
-            lineSample.y = m[1][0]*modelPoint.x + m[1][1]*modelPoint.y + m[1][3];
-            
-            return;
-         }
-         case OSSIM_DEGREES:
-         case OSSIM_RADIANS:
-         case OSSIM_MINUTES:
-         case OSSIM_SECONDS:
-         {
-            ossimUnitConversionTool ut;
-            ossimDpt modelPoint;
-            modelPoint.lat = gpt.latd();
-            modelPoint.lon = gpt.lond();
-            ut.setValue(modelPoint.lat, OSSIM_DEGREES);
-            modelPoint.lat = ut.getValue(theModelTransformUnitType);
-            ut.setValue(modelPoint.lon, OSSIM_DEGREES);
-            modelPoint.lon = ut.getValue(theModelTransformUnitType);
-            const NEWMAT::Matrix& m = theInverseModelTransform.getData();
-            
-            lineSample.x = m[0][0]*modelPoint.x + m[0][1]*modelPoint.y + m[0][3];
-            lineSample.y = m[1][0]*modelPoint.x + m[1][1]*modelPoint.y + m[1][3];
-            return;
-         }
-         default:
-         {
-            lineSample.makeNan();
-            return;
-         }
-      }
-   }
-   else if(isGeographic())
-   {
-      ossimGpt gpt = worldPoint;
-      
-      if (theOrigin.datum() != gpt.datum())
-      {
-         // Apply datum shift if it's not the same.
-         gpt.changeDatum(theOrigin.datum());
-      }
-      
-      lineSample.line = (theUlGpt.latd() - gpt.latd()) / theDegreesPerPixel.y;
-      lineSample.samp = (gpt.lond() - theUlGpt.lond()) / theDegreesPerPixel.x;
-   }
-   else
-   {
-      // make sure our tie point is good and world point
-      // is good.
-      //
-      if(theUlEastingNorthing.isNan()||
-         worldPoint.isLatNan() || worldPoint.isLonNan())
-      {
-         lineSample.makeNan();
-         return;
-      }
-      // initialize line sample
-      //   lineSample = ossimDpt(0,0);
-      
-      // I am commenting this code out because I am going to
-      // move it to the ossimImageViewProjectionTransform.
-      //
-      // see if we have a datum set and if so
-      // shift the world to our datum.  If not then
-      // find the easting northing value for the world
-      // point.
-      if(theDatum)
-      {
-         ossimGpt gpt = worldPoint;
-         
-         gpt.changeDatum(theDatum);
-         
-         // lineSample is currently in easting northing
-         // and will need to be converted to line sample.
-         lineSample = forward(gpt);
-      }
-      else
-      {
-         // lineSample is currently in easting northing
-         // and will need to be converted to line sample.
-         lineSample = forward(worldPoint);
-      }
-      
-      // check the final result to make sure there were no
-      // problems.
-      //
-      if(!lineSample.isNan())
-      {
-//       if(!isIdentityMatrix())
-//       {
-//          ossimDpt temp = lineSample;
-         
-//          lineSample.x = theInverseTrans[0][0]*temp.x+
-//                         theInverseTrans[0][1]*temp.y+
-//                         theInverseTrans[0][2];
-         
-//          lineSample.y = theInverseTrans[1][0]*temp.x+
-//                         theInverseTrans[1][1]*temp.y+
-//                         theInverseTrans[1][2];
-//       }
-//       else
-         {
-            lineSample.x = ((lineSample.x  - theUlEastingNorthing.x)/theMetersPerPixel.x);
-            
-            // We must remember that the Northing is negative since the positive
-            // axis for an image is assumed to go down since it's image space.
-            lineSample.y = (-(lineSample.y - theUlEastingNorthing.y)/theMetersPerPixel.y);
-         }
-      }
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::lineSampleHeightToWorld
-//
-//*****************************************************************************
-void ossimMapProjection::lineSampleHeightToWorld(const ossimDpt &lineSample,
-                                                 const double&  hgtEllipsoid,
-                                                 ossimGpt&      gpt)const
-{
-   // make sure that the passed in lineSample is good and
-   // check to make sure our easting northing is good so
-   // we can compute the line sample.
-   if(lineSample.hasNans())
-   {
-      gpt.makeNan();
-      return;
-   }
-   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
-   {
-      const NEWMAT::Matrix& m = theModelTransform.getData();
-      // map transforms can only be 2-D for now so we will look at
-      // the first 2 rows only
-      ossimDpt modelPoint(m[0][0]*lineSample.x + m[0][1]*lineSample.y + m[0][3],
-                          m[1][0]*lineSample.x + m[1][1]*lineSample.y + m[1][3]);
-      switch(theModelTransformUnitType)
-      {
-         case OSSIM_DEGREES:
-         {
-            gpt.latd(modelPoint.lat);
-            gpt.lond(modelPoint.lon);
-            gpt.datum(theDatum);
-            return;
-         }
-         case OSSIM_MINUTES:
-         case OSSIM_SECONDS:
-         case OSSIM_RADIANS:
-         {
-            ossimUnitConversionTool ut;
-            ut.setValue(modelPoint.x, theModelTransformUnitType);
-            modelPoint.x = ut.getValue(OSSIM_DEGREES);
-            ut.setValue(modelPoint.y, theModelTransformUnitType);
-            modelPoint.y = ut.getValue(OSSIM_DEGREES);
-            gpt.latd(modelPoint.lat);
-            gpt.lond(modelPoint.lon);
-            gpt.datum(theDatum);
-            return;
-         }
-         default:
-         {
-            ossimUnitConversionTool ut;
-            ut.setValue(modelPoint.x, theModelTransformUnitType);
-            modelPoint.x = ut.getValue(OSSIM_METERS);
-            ut.setValue(modelPoint.y, theModelTransformUnitType);
-            modelPoint.y = ut.getValue(OSSIM_METERS);
-            gpt = inverse(modelPoint);
-            break;
-         }
-      }
-      gpt.datum(theDatum);
-   }
-   else if(isGeographic())
-   {
-      double lat = theUlGpt.latd() - (lineSample.line * theDegreesPerPixel.y);
-      double lon = theUlGpt.lond() + (lineSample.samp * theDegreesPerPixel.x);
-      
-      gpt.latd(lat);
-      gpt.lond(lon);
-      gpt.hgt = hgtEllipsoid;
-   }
-   else
-   {
-      if(theUlEastingNorthing.hasNans())
-      {
-         gpt.makeNan();
-         return;
-      }
-      ossimDpt eastingNorthing;
-      
-      eastingNorthing = (theUlEastingNorthing);
-      
-      eastingNorthing.x += (lineSample.x*theMetersPerPixel.x);
-      
-      //
-      // Note:  the Northing is positive up.  In image space
-      // the positive axis is down so we must multiply by
-      // -1
-      //
-      eastingNorthing.y += (-lineSample.y*theMetersPerPixel.y);
-      
-      
-      //
-      // now invert the meters into a ground point.
-      //
-      gpt = inverse(eastingNorthing);
-      gpt.datum(theDatum);
-      
-      if(gpt.isLatNan() && gpt.isLonNan())
-      {
-         gpt.makeNan();
-      }
-      else
-      {
-         gpt.clampLat(-90, 90);
-         gpt.clampLon(-180, 180);
-         
-         // Finally assign the specified height:
-         gpt.hgt = hgtEllipsoid;
-      }
-   }
-   if(theElevationLookupFlag)
-   {
-      gpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::lineSampleToWorld
-//
-//  Implements the base class pure virtual. Simply calls lineSampleToWorld()
-//  and assigns argument height to the resultant groundpoint.
-//
-//*****************************************************************************
-void ossimMapProjection::lineSampleToWorld (const ossimDpt& lineSampPt,
-                                            ossimGpt&       worldPt) const
-{
-   double elev = ossim::nan();
-
-//    if(theElevationLookupFlag)
-//    {
-//       elev =  ossimElevManager::instance()->getHeightAboveEllipsoid(worldPt);
-//    }
-
-   lineSampleHeightToWorld(lineSampPt, elev, worldPt);
-
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::lineSampleToEastingNorthing
-//
-//*****************************************************************************
-void ossimMapProjection::lineSampleToEastingNorthing(const ossimDpt& lineSample,
-                                                     ossimDpt&       eastingNorthing)const
-{
-   // make sure that the passed in lineSample is good and
-   // check to make sure our easting northing is good so
-   // we can compute the line sample.
-   //
-   if(lineSample.hasNans()||theUlEastingNorthing.hasNans())
-   {
-      eastingNorthing.makeNan();
-      return;
-   }
-   ossimDpt deltaPoint = lineSample;
-
-   eastingNorthing.x = theUlEastingNorthing.x + deltaPoint.x*theMetersPerPixel.x;
-   eastingNorthing.y = theUlEastingNorthing.y + (-deltaPoint.y)*theMetersPerPixel.y ;
-
-   //   eastingNorthing.x += (lineSample.x*theMetersPerPixel.x);
-
-   // Note:  the Northing is positive up.  In image space
-   // the positive axis is down so we must multiply by
-   // -1
-   //   eastingNorthing.y += (-lineSample.y*theMetersPerPixel.y);
-}
-
-
-void ossimMapProjection::setMetersPerPixel(const ossimDpt& resolution)
-{
-   theMetersPerPixel = resolution;
-   computeDegreesPerPixel();
-}
-
-void ossimMapProjection::setDecimalDegreesPerPixel(const ossimDpt& resolution)
-{
-   theDegreesPerPixel = resolution;
-   computeMetersPerPixel();
-}
-
-void ossimMapProjection::eastingNorthingToWorld(const ossimDpt& eastingNorthing,
-                                                ossimGpt&       worldPt)const
-{
-   ossimDpt lineSample;
-   eastingNorthingToLineSample(eastingNorthing, lineSample);
-   lineSampleToWorld(lineSample, worldPt);
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::eastingNorthingToLineSample
-//
-//*****************************************************************************
-void ossimMapProjection::eastingNorthingToLineSample(const ossimDpt& eastingNorthing,
-                                                     ossimDpt&       lineSample)const
-{
-   if(eastingNorthing.hasNans())
-   {
-      lineSample.makeNan();
-      return;
-   }
-   // check the final result to make sure there were no
-   // problems.
-   //
-   if(!eastingNorthing.isNan())
-   {
-     lineSample.x = (eastingNorthing.x - theUlEastingNorthing.x)/theMetersPerPixel.x;
-
-     // We must remember that the Northing is negative since the positive
-     // axis for an image is assumed to go down since it's image space.
-     lineSample.y = (-(eastingNorthing.y-theUlEastingNorthing.y))/theMetersPerPixel.y;
-   }
-}
-
-void ossimMapProjection::setUlTiePoints(const ossimGpt& gpt)
-{
-   setUlGpt(gpt);
-   setUlEastingNorthing(forward(gpt));
-}
-
-void ossimMapProjection::setUlTiePoints(const ossimDpt& eastingNorthing)
-{
-   setUlEastingNorthing(eastingNorthing);
-   setUlGpt(inverse(eastingNorthing));
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::setUlEastingNorthing
-//
-//*****************************************************************************
-void ossimMapProjection::setUlEastingNorthing(const ossimDpt& ulEastingNorthing)
-{
-   theUlEastingNorthing = ulEastingNorthing;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::setUlGpt
-//
-//*****************************************************************************
-void ossimMapProjection::setUlGpt(const ossimGpt& ulGpt)
-{
-   theUlGpt = ulGpt;
-
-   // The ossimGpt data members need to use the same datum as this projection:
-   if (*theDatum != *(ulGpt.datum()))
-      theUlGpt.changeDatum(theDatum);
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::saveState
-//
-//*****************************************************************************
-bool ossimMapProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   ossimProjection::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           ossimKeywordNames::ORIGIN_LATITUDE_KW,
-           theOrigin.latd(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CENTRAL_MERIDIAN_KW,
-           theOrigin.lond(),
-           true);
-
-   theEllipsoid.saveState(kwl, prefix);
-
-   if(theDatum)
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::DATUM_KW,
-              theDatum->code(),
-              true);
-   }
-
-   // Calling access method to give it an opportunity to update the code in case of param change:
-   ossim_uint32 code = getPcsCode();
-   if (code)
-   {
-      ossimString epsg_spec = ossimString("EPSG:") + ossimString::toString(code);
-      kwl.add(prefix, ossimKeywordNames::SRS_NAME_KW, epsg_spec, true);
-   }
-   
-   if(isGeographic())
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_XY_KW,
-              ossimDpt(theUlGpt).toString().c_str(),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_UNITS_KW,
-              ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::PIXEL_SCALE_XY_KW,
-              theDegreesPerPixel.toString().c_str(),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
-              ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
-              true);
-   }
-   else
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_XY_KW,
-              theUlEastingNorthing.toString().c_str(),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_UNITS_KW,
-              ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::PIXEL_SCALE_XY_KW,
-              theMetersPerPixel.toString().c_str(),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
-              ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS),
-              true);  
-      kwl.add(prefix,
-              ossimKeywordNames::ORIGINAL_MAP_UNITS_KW,
-              ossimUnitTypeLut::instance()->getEntryString(theProjectionUnits),
-              true);
-   }
-
-   kwl.add(prefix, ossimKeywordNames::PCS_CODE_KW, code, true);
-   kwl.add(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_KW,
-           theFalseEastingNorthing.toString().c_str(), true);
-   kwl.add(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW,
-           ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS), true);
-   kwl.add(prefix, ossimKeywordNames::ELEVATION_LOOKUP_FLAG_KW,
-           ossimString::toString(theElevationLookupFlag), true);
-
-   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
-   {
-      const NEWMAT::Matrix& m = theModelTransform.getData();
-      ostringstream out;
-      ossim_uint32 row, col;
-      for(row = 0; row < 4; ++row)
-      {
-         for(col = 0; col < 4; ++col)
-         {
-            out << std::setprecision(20) << m[row][col] << " ";
-         }
-      }
-      kwl.add(prefix,
-              ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW,
-              out.str().c_str(),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW,
-              ossimUnitTypeLut::instance()->getEntryString(theModelTransformUnitType),
-              true);
-   }
-
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::loadState
-//
-//*****************************************************************************
-bool ossimMapProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   ossimProjection::loadState(kwl, prefix);
-
-   const char* elevLookupFlag = kwl.find(prefix, ossimKeywordNames::ELEVATION_LOOKUP_FLAG_KW);
-   if(elevLookupFlag)
-   {
-      theElevationLookupFlag = ossimString(elevLookupFlag).toBool();
-   }
-   // Get the ellipsoid.
-   theEllipsoid.loadState(kwl, prefix);
-
-   const char *lookup;
-
-   // Get the Projection Coordinate System (assumed from EPSG database). 
-   // NOTE: the code is read here for saving in this object only. 
-   // The code is not verified until a call to getPcs() is called. If ONLY this code
-   // had been provided, then the EPSG projection factory would populate a new instance of the 
-   // corresponding map projection and have it saveState for constructing again later in the 
-   // conventional fashion here
-   thePcsCode = 0; 
-   lookup = kwl.find(prefix, ossimKeywordNames::PCS_CODE_KW);
-   if(lookup)
-      thePcsCode = ossimString(lookup).toUInt32(); // EPSG PROJECTION CODE
-
-   // The datum can be specified in 2 ways: either via OSSIM/geotrans alpha-codes or EPSG code.
-   // Last resort use WGS 84 (consider throwing an exception to catch any bad datums): 
-   theDatum = ossimDatumFactoryRegistry::instance()->create(kwl, prefix);
-   if (theDatum == NULL)
-   {
-      theDatum = ossimDatumFactory::instance()->wgs84();
-   }
-
-   // Set all ossimGpt-type members to use this datum:
-   theOrigin.datum(theDatum);
-   theUlGpt.datum(theDatum);
-
-   // Fetch the ellipsoid from the datum:
-   const ossimEllipsoid* ellipse = theDatum->ellipsoid();
-   if(ellipse)
-      theEllipsoid = *ellipse;
-   
-   // Get the latitude of the origin.
-   lookup = kwl.find(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW);
-   if (lookup)
-   {
-      theOrigin.latd(ossimString(lookup).toFloat64());
-   }
-   // else ???
-
-   // Get the central meridian.
-   lookup = kwl.find(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW);
-   if (lookup)
-   {
-      theOrigin.lond(ossimString(lookup).toFloat64());
-   }
-   // else ???
-
-
-   // Get the pixel scale.
-   theMetersPerPixel.makeNan();
-   theDegreesPerPixel.makeNan();
-   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW);
-   if (lookup)
-   {
-      ossimUnitType units =
-         static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
-                                    getEntryNumber(lookup));
-      
-      lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW);
-      if (lookup)
-      {
-         ossimDpt scale;
-         scale.toPoint(std::string(lookup));
-
-         switch (units)
-         {
-            case OSSIM_METERS:
-            {
-               theMetersPerPixel = scale;
-               break;
-            }
-            case OSSIM_DEGREES:
-            {
-               theDegreesPerPixel.x = scale.x;
-               theDegreesPerPixel.y = scale.y;
-               break;
-            }
-            case OSSIM_FEET:
-            case OSSIM_US_SURVEY_FEET:
-            {
-               ossimUnitConversionTool ut;
-               ut.setValue(scale.x, units);
-               theMetersPerPixel.x = ut.getValue(OSSIM_METERS);
-               ut.setValue(scale.y, units);
-               theMetersPerPixel.y = ut.getValue(OSSIM_METERS);
-               break;
-            }
-            default:
-            {
-               if(traceDebug())
-               {
-                  // Unhandled unit type!
-                  ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimMapProjection::loadState WARNING!"
-                  << "Unhandled unit type for "
-                  << ossimKeywordNames::PIXEL_SCALE_UNITS_KW << ":  "
-                  << ( ossimUnitTypeLut::instance()->
-                      getEntryString(units).c_str() )
-                  << endl;
-               }
-               break;
-            }
-         } // End of switch (units)
-         
-      }  // End of if (PIXEL_SCALE_XY)
-
-   } // End of if (PIXEL_SCALE_UNITS)
-   else
-   {
-      // BACKWARDS COMPATIBILITY LOOKUPS...
-      lookup =  kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_X_KW);
-      if(lookup)
-      {
-         theMetersPerPixel.x = fabs(ossimString(lookup).toFloat64());
-      }
-      
-      lookup =  kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW);
-      if(lookup)
-      {
-         theMetersPerPixel.y = fabs(ossimString(lookup).toFloat64());
-      }
-      
-      lookup = kwl.find(prefix,
-                        ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT);
-      if(lookup)
-      {
-         theDegreesPerPixel.y = fabs(ossimString(lookup).toFloat64());
-      }
-      
-      lookup = kwl.find(prefix,
-                        ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON);
-      if(lookup)
-      {
-         theDegreesPerPixel.x = fabs(ossimString(lookup).toFloat64());
-      }
-   }            
-
-   // Get the tie point.
-   theUlGpt.makeNan();
-
-    // Since this won't be picked up from keywords set to 0 to keep nan out.
-   theUlGpt.hgt = 0.0;
-   
-   theUlEastingNorthing.makeNan();
-   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW);
-   if (lookup)
-   {
-      ossimUnitType units = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
-                                                       getEntryNumber(lookup));
-      
-      lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_XY_KW);
-      if (lookup)
-      {
-         ossimDpt tie;
-         tie.toPoint(std::string(lookup));
-
-         switch (units)
-         {
-            case OSSIM_METERS:
-            {
-               theUlEastingNorthing = tie;
-               break;
-            }
-            case OSSIM_DEGREES:
-            {
-               theUlGpt.lond(tie.x);
-               theUlGpt.latd(tie.y);
-               break;
-            }
-            case OSSIM_FEET:
-            case OSSIM_US_SURVEY_FEET:
-            {
-               ossimUnitConversionTool ut;
-               ut.setValue(tie.x, units);
-               theUlEastingNorthing.x = ut.getValue(OSSIM_METERS);
-               ut.setValue(tie.y, units);
-               theUlEastingNorthing.y = ut.getValue(OSSIM_METERS);
-               break;
-            }
-            default:
-            {
-               if(traceDebug())
-               {
-                  // Unhandled unit type!
-                  ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimMapProjection::loadState WARNING!"
-                  << "Unhandled unit type for "
-                  << ossimKeywordNames::TIE_POINT_UNITS_KW << ": " 
-                  << ( ossimUnitTypeLut::instance()->
-                      getEntryString(units).c_str() )
-                  << endl;
-               }
-               break;
-            }
-         } // End of switch (units)
-         
-      }  // End of if (TIE_POINT_XY)
-
-   } // End of if (TIE_POINT_UNITS)
-   else
-   {
-      // BACKWARDS COMPATIBILITY LOOKUPS...
-      lookup =  kwl.find(prefix, ossimKeywordNames::TIE_POINT_EASTING_KW);
-      if(lookup)
-      {
-         theUlEastingNorthing.x = (ossimString(lookup).toFloat64());
-      }
-
-      lookup =  kwl.find(prefix, ossimKeywordNames::TIE_POINT_NORTHING_KW);
-      if(lookup)
-      {
-         theUlEastingNorthing.y = (ossimString(lookup).toFloat64());
-      }
-
-      lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LAT_KW);
-      if (lookup)
-      {
-         theUlGpt.latd(ossimString(lookup).toFloat64());
-      }
-
-      lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LON_KW);
-      if (lookup)
-      {
-         theUlGpt.lond(ossimString(lookup).toFloat64());
-      }
-   }
-   
-   // Get the false easting northing.
-   theFalseEastingNorthing.x = 0.0;
-   theFalseEastingNorthing.y = 0.0;
-   ossimUnitType en_units = OSSIM_METERS;
-   lookup = kwl.find(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW);
-   if (lookup)
-   {
-      en_units = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->getEntryNumber(lookup));
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_KW);
-   if (lookup)
-   {
-      ossimDpt eastingNorthing;
-      eastingNorthing.toPoint(std::string(lookup));
-
-      switch (en_units)
-      {
-         case OSSIM_METERS:
-         {
-            theFalseEastingNorthing = eastingNorthing;
-            break;
-         }
-         case OSSIM_FEET:
-         case OSSIM_US_SURVEY_FEET:
-         {
-            ossimUnitConversionTool ut;
-            ut.setValue(eastingNorthing.x, en_units);
-            theFalseEastingNorthing.x = ut.getValue(OSSIM_METERS);
-            ut.setValue(eastingNorthing.y, en_units);
-            theFalseEastingNorthing.y = ut.getValue(OSSIM_METERS);
-            break;
-         }
-         default:
-         {
-            if(traceDebug())
-            {
-               // Unhandled unit type!
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimMapProjection::loadState WARNING! Unhandled unit type for "
-                  << ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW << ":  " 
-                  << (ossimUnitTypeLut::instance()->getEntryString(en_units).c_str())
-                  << endl;
-            }
-            break;
-         }
-      } // End of switch (units)
-   }  // End of if (FALSE_EASTING_NORTHING_KW)
-   else
-   {
-      // BACKWARDS COMPATIBILITY LOOKUPS...
-      lookup =  kwl.find(prefix, ossimKeywordNames::FALSE_EASTING_KW);
-      if(lookup)
-      {
-         theFalseEastingNorthing.x = (ossimString(lookup).toFloat64());
-      }
-      
-      lookup =  kwl.find(prefix, ossimKeywordNames::FALSE_NORTHING_KW);
-      if(lookup)
-      {
-         theFalseEastingNorthing.y = (ossimString(lookup).toFloat64());
-      }
-   }            
-
-//    if((theDegreesPerPixel.x!=OSSIM_DBL_NAN)&&
-//       (theDegreesPerPixel.y!=OSSIM_DBL_NAN)&&
-//       theMetersPerPixel.hasNans())
-//    {
-//       theMetersPerPixel    = theOrigin.metersPerDegree();
-//       theMetersPerPixel.x *= theDegreesPerPixel.x;
-//       theMetersPerPixel.y *= theDegreesPerPixel.y;
-//    }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
-   if (lookup)
-   {
-      ossimString pixelType = lookup;
-      pixelType=pixelType.trim();
-      if(pixelType!="")
-      {
-         pixelType.downcase();
-         if(pixelType.contains("area"))
-         {
-            if( theMetersPerPixel.hasNans() == false)
-            {
-               if(!theUlEastingNorthing.hasNans())
-               {
-                  theUlEastingNorthing.x += (theMetersPerPixel.x*0.5);
-                  theUlEastingNorthing.y -= (theMetersPerPixel.y*0.5);
-               }
-            }
-            if(theDegreesPerPixel.hasNans() == false)
-            {
-               theUlGpt.latd( theUlGpt.latd() - (theDegreesPerPixel.y*0.5) );
-               theUlGpt.lond( theUlGpt.lond() + (theDegreesPerPixel.x*0.5) );
-            }
-         }
-      }
-   }
-   
-   // We preserve the units of the originally created projection (typically from EPSG proj factory)
-   // in case user needs map coordinates in those units (versus default meters)
-   lookup = kwl.find(prefix, ossimKeywordNames::ORIGINAL_MAP_UNITS_KW);
-   if (lookup)
-   {
-      theProjectionUnits = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
-                                                      getEntryNumber(lookup));
-   }
-
-   theModelTransformUnitType = OSSIM_UNIT_UNKNOWN;
-   const char* modelTransform = kwl.find(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW);
-   const char* modelTransformUnit = kwl.find(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW);
-   if(modelTransform&&modelTransformUnit) // row ordered 4x4 matrix.  Should be 16 values
-   {
-      
-      NEWMAT::Matrix& m = theModelTransform.getData();
-      istringstream in(modelTransform);
-      ossim_uint32 row, col;
-      ossimString value;
-      for(row = 0; row < 4; ++row)
-      {
-         for(col = 0; col < 4; ++col)
-         {
-            in >> value;
-            m[row][col] = value.toDouble();
-         }
-      }
-      // make sure these have the identity and all unused are 0.0
-      m[2][2] = 1.0;
-      m[2][0] = 0.0;
-      m[2][1] = 0.0;
-      m[2][3] = 0.0;
-      m[3][3] = 1.0;
-      m[3][2] = 0.0;
-      m[3][1] = 0.0;
-      m[3][0] = 0.0;
-      
-      if(!in.fail())
-      {
-         try
-         {
-            theInverseModelTransform = theModelTransform;
-            theInverseModelTransform.i();
-            theModelTransformUnitType = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
-                                                                   getEntryNumber(modelTransformUnit));
-         }
-         catch(...)
-         {
-            theModelTransformUnitType = OSSIM_UNIT_UNKNOWN;   
-         }
-      }
-   }
-
-   //---
-   // Set the datum of the origin and tie point.
-   // Use method that does NOT perform a shift.
-   //---
-   if(theDatum)
-   {
-      theOrigin.datum(theDatum);
-      theUlGpt.datum(theDatum);
-   }
-
-   if(theMetersPerPixel.hasNans() &&
-      theDegreesPerPixel.hasNans())
-   {
-      ossimDpt mpd = ossimGpt().metersPerDegree();
-      if(isGeographic())
-      {
-         theDegreesPerPixel.lat = 1.0/mpd.y;
-         theDegreesPerPixel.lon = 1.0/mpd.y;
-      }
-      else
-      {
-         theMetersPerPixel.x = 1.0;
-         theMetersPerPixel.y = 1.0;
-      }
-   }
-
-   //---
-   // Final sanity check:
-   //---
-   if ( theOrigin.hasNans() )
-   {
-      if ( theModelTransformUnitType == OSSIM_DEGREES )
-      {
-         const NEWMAT::Matrix& m = theModelTransform.getData();
-         theOrigin.lon = m[0][3];
-         theOrigin.lat = m[1][3];
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << __FILE__ << ": " << __LINE__
-            << "\nossimMapProjection::loadState ERROR: Origin is not set!"
-            << std::endl;
-      }
-   }
-
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::print
-//*****************************************************************************
-std::ostream& ossimMapProjection::print(std::ostream& out) const
-{
-   const char MODULE[] = "ossimMapProjection::print";
-
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << "\n// " << MODULE
-       << "\n" << ossimKeywordNames::TYPE_KW               << ":  "
-       << getClassName()
-       << "\n" << ossimKeywordNames::MAJOR_AXIS_KW         << ":  "
-       << theEllipsoid.getA()
-       << "\n" << ossimKeywordNames::MINOR_AXIS_KW         << ":  "
-       << theEllipsoid.getB()
-       << "\n" << ossimKeywordNames::ORIGIN_LATITUDE_KW    << ":  "
-       << theOrigin.latd()
-       << "\n" << ossimKeywordNames::CENTRAL_MERIDIAN_KW   << ":  "
-       << theOrigin.lond()
-       << "\norigin: " << theOrigin
-       << "\n" << ossimKeywordNames::DATUM_KW              << ":  "
-       << (theDatum?theDatum->code().c_str():"unknown")
-       << "\n" << ossimKeywordNames::METERS_PER_PIXEL_X_KW << ":  "
-       << ((ossim::isnan(theMetersPerPixel.x))?ossimString("nan"):ossimString::toString(theMetersPerPixel.x, 15))
-       << "\n" << ossimKeywordNames::METERS_PER_PIXEL_Y_KW << ":  "
-       << ((ossim::isnan(theMetersPerPixel.y))?ossimString("nan"):ossimString::toString(theMetersPerPixel.y, 15))
-       << "\n" << ossimKeywordNames::FALSE_EASTING_NORTHING_KW << ": "
-       << theFalseEastingNorthing.toString().c_str()
-       << "\n" << ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW << ": "
-       << ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS)
-       << "\n" << ossimKeywordNames::PCS_CODE_KW << ": " << thePcsCode;
-
-   if(isGeographic())
-   {
-      out << "\n" << ossimKeywordNames::TIE_POINT_XY_KW << ": " 
-          << ossimDpt(theUlGpt).toString().c_str()
-          << "\n" << ossimKeywordNames::TIE_POINT_UNITS_KW << ": " 
-          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES)
-          << "\n" << ossimKeywordNames::PIXEL_SCALE_XY_KW << ": "
-          << theDegreesPerPixel.toString().c_str()
-          << "\n" << ossimKeywordNames::PIXEL_SCALE_UNITS_KW << ": "
-          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES)
-          << std::endl;
-   }
-   else
-   {
-      out << "\n" << ossimKeywordNames::TIE_POINT_XY_KW << ": " 
-          << theUlEastingNorthing.toString().c_str()
-          << "\n" << ossimKeywordNames::TIE_POINT_UNITS_KW << ": " 
-          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS)
-          << "\n" << ossimKeywordNames::PIXEL_SCALE_XY_KW << ": "
-          << theMetersPerPixel.toString().c_str()
-          << "\n" << ossimKeywordNames::PIXEL_SCALE_UNITS_KW << ": "
-          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS)
-          << std::endl;
-   }
-   
-   return ossimProjection::print(out);
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::computeDegreesPerPixel
-//
-//*****************************************************************************
-void ossimMapProjection::computeDegreesPerPixel()
-{
-   ossimDpt eastNorthGround = forward(theOrigin);
-   ossimDpt rightEastNorth  =  eastNorthGround;
-   ossimDpt downEastNorth   =  eastNorthGround;
-   rightEastNorth.x += theMetersPerPixel.x;
-   downEastNorth.y  -= theMetersPerPixel.y;
-
-   ossimGpt rightGpt = inverse(rightEastNorth);
-   ossimGpt downGpt  = inverse(downEastNorth);
-
-   // use euclidean distance to get length along the horizontal (lon)
-   // and vertical (lat) directions
-   //
-   double tempDeltaLat = rightGpt.latd() - theOrigin.latd();
-   double tempDeltaLon = rightGpt.lond() - theOrigin.lond();
-   theDegreesPerPixel.lon = sqrt(tempDeltaLat*tempDeltaLat + tempDeltaLon*tempDeltaLon);
-
-   tempDeltaLat = downGpt.latd() - theOrigin.latd();
-   tempDeltaLon = downGpt.lond() - theOrigin.lond();
-   theDegreesPerPixel.lat = sqrt(tempDeltaLat*tempDeltaLat + tempDeltaLon*tempDeltaLon);
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjection::computeMetersPerPixel
-//
-//*****************************************************************************
-void ossimMapProjection::computeMetersPerPixel()
-{
-//#define USE_OSSIMGPT_METERS_PER_DEGREE
-#ifdef USE_OSSIMGPT_METERS_PER_DEGREE
-   ossimDpt metersPerDegree (theOrigin.metersPerDegree());
-   theMetersPerPixel.x = metersPerDegree.x * theDegreesPerPixel.lon;
-   theMetersPerPixel.y = metersPerDegree.y * theDegreesPerPixel.lat;
-#else
-   ossimGpt right=theOrigin;
-   ossimGpt down=theOrigin;
-
-   down.latd(theOrigin.latd()  + theDegreesPerPixel.lat);
-   right.lond(theOrigin.lond() + theDegreesPerPixel.lon);
-
-   ossimDpt centerMeters = forward(theOrigin);
-   ossimDpt rightMeters = forward(right);
-   ossimDpt downMeters  = forward(down);
-
-   theMetersPerPixel.x = (rightMeters - centerMeters).length();
-   theMetersPerPixel.y = (downMeters  - centerMeters).length();
-#endif
-}
-
-//**************************************************************************************************
-//  METHOD: ossimMapProjection::operator==
-//! Compares this to arg projection and returns TRUE if the same. 
-//! NOTE: As currently implemented in OSSIM, map projections also contain image geometry 
-//! information like tiepoint and scale. This operator is only concerned with the map 
-//! specification and ignores image geometry differences.
-//**************************************************************************************************
-bool ossimMapProjection::operator==(const ossimProjection& projection) const
-{
-   // Verify that derived types match:
-   if (getClassName() != projection.getClassName())
-      return false;
-
-   // If both PCS codes are non-zero, that's all we need to check:
-   const ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, &projection);
-   if (thePcsCode && mapProj->thePcsCode && (thePcsCode != 32767) && 
-       (thePcsCode == mapProj->thePcsCode) )
-   {
-      return true;
-   }
-
-   if ( *theDatum != *(mapProj->theDatum) )
-      return false;
-   
-   if (theOrigin != mapProj->theOrigin)
-      return false;
-
-   if (theFalseEastingNorthing != mapProj->theFalseEastingNorthing)
-      return false;
-
-#if 0
-   THIS SECTION IGNORED SINCE IT DEALS WITH IMAGE GEOMETRY, NOT MAP PROJECTION
-   if (isGeographic())
-   {
-      if ((theDegreesPerPixel != mapProj->theDegreesPerPixel) ||
-          (theUlGpt != mapProj->theUlGpt))
-         return false;
-   }
-   else
-   {
-      if ((theMetersPerPixel != mapProj->theMetersPerPixel) ||
-         (theUlEastingNorthing != mapProj->theUlEastingNorthing))
-         return false;
-   }
-#endif
-
-   // Units must match:
-   if ((theProjectionUnits != OSSIM_UNIT_UNKNOWN) && 
-       (mapProj->theProjectionUnits != OSSIM_UNIT_UNKNOWN) &&
-       (theProjectionUnits != mapProj->theProjectionUnits))
-       return false;
-
-   // Check transform if present and compare it also:
-   if (hasModelTransform() && mapProj->hasModelTransform() &&
-      (theModelTransform.getData() != mapProj->theModelTransform.getData()))
-      return false;
-
-   return true;
-}
-
-bool ossimMapProjection::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
-{
-   const ossimMapProjection* mapProj = dynamic_cast<const ossimMapProjection*>(&obj);
-   bool result = mapProj&&ossimProjection::isEqualTo(obj, compareType);
-   
-   if(result)
-   {
-      result = (theEllipsoid.isEqualTo(mapProj->theEllipsoid, compareType)&&
-                theOrigin.isEqualTo(mapProj->theOrigin, compareType)&&
-                theMetersPerPixel.isEqualTo(mapProj->theMetersPerPixel, compareType)&&             
-                theDegreesPerPixel.isEqualTo(mapProj->theDegreesPerPixel, compareType)&&             
-                theUlGpt.isEqualTo(mapProj->theUlGpt, compareType)&&             
-                theUlEastingNorthing.isEqualTo(mapProj->theUlEastingNorthing, compareType)&&             
-                theFalseEastingNorthing.isEqualTo(mapProj->theFalseEastingNorthing, compareType)&&             
-                (thePcsCode == mapProj->thePcsCode)&&
-                (theElevationLookupFlag == mapProj->theElevationLookupFlag)&&
-                (theElevationLookupFlag == mapProj->theElevationLookupFlag)&&
-                (theModelTransform.isEqualTo(mapProj->theModelTransform))&&
-                (theInverseModelTransform.isEqualTo(mapProj->theInverseModelTransform))&&
-                (theModelTransformUnitType == mapProj->theModelTransformUnitType)&&
-                (theProjectionUnits == mapProj->theProjectionUnits));
-      
-      if(result)
-      {
-         if(compareType == OSSIM_COMPARE_FULL)
-         {
-            if(theDatum&&mapProj->theDatum)
-            {
-               result = theDatum->isEqualTo(*mapProj->theDatum, compareType);
-            }
-         }
-         else 
-         {
-            result = (theDatum==mapProj->theDatum);
-         }
-      }
-   }
-   return result;
-}
-
-double ossimMapProjection::getFalseEasting() const
-{
-   return theFalseEastingNorthing.x;
-}
-
-double ossimMapProjection::getFalseNorthing() const
-{
-   return theFalseEastingNorthing.y;
-}
-
-double ossimMapProjection::getStandardParallel1() const
-{
-   return 0.0;
-}
-
-double ossimMapProjection::getStandardParallel2() const
-{
-   return 0.0;
-}
-
-void ossimMapProjection::snapTiePointTo(ossim_float64 multiple,
-                                        ossimUnitType unitType)
-{
-   ossim_float64 convertedMultiple = multiple;
-   
-   if (isGeographic() && (unitType != OSSIM_DEGREES) )
-   {
-      // Convert to degrees.
-      ossimUnitConversionTool convertor;
-      convertor.setOrigin(theOrigin);
-      convertor.setValue(multiple, unitType);
-      convertedMultiple = convertor.getDegrees();
-   }
-   else if ( !isGeographic() && (unitType != OSSIM_METERS) )
-   {
-      // Convert to meters.
-      ossimUnitConversionTool convertor;
-      convertor.setOrigin(theOrigin);
-      convertor.setValue(multiple, unitType);
-      convertedMultiple = convertor.getMeters();
-   }
-
-   // Convert the tie point.
-   if (isGeographic())
-   {
-      // Snap the latitude.
-      ossim_float64 d = theUlGpt.latd();
-      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
-      theUlGpt.latd(d);
-
-      // Snap the longitude.
-      d = theUlGpt.lond();
-      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
-      theUlGpt.lond(d);
-
-      // Adjust the stored easting / northing.
-      theUlEastingNorthing = forward(theUlGpt);
-   }
-   else
-   {
-      // Snap the easting.
-      ossim_float64 d = theUlEastingNorthing.x - getFalseEasting();
-      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
-      theUlEastingNorthing.x = d + getFalseEasting();
-
-      // Snap the northing.
-      d = theUlEastingNorthing.y - getFalseNorthing();
-      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
-      theUlEastingNorthing.y = d + getFalseNorthing();
-
-      // Adjust the stored upper left ground point.
-      theUlGpt = inverse(theUlEastingNorthing);
-   }
-}
-
-void ossimMapProjection::snapTiePointToOrigin()
-{
-   // Convert the tie point.
-   if (isGeographic())
-   {
-      // Note the origin may not be 0.0, 0.0:
-      
-      // Snap the latitude.
-      ossim_float64 d = theUlGpt.latd() - origin().latd();
-      d = ossim::round<int>(d / theDegreesPerPixel.y) * theDegreesPerPixel.y;
-      theUlGpt.latd(d + origin().latd());
-
-      // Snap the longitude.
-      d = theUlGpt.lond() - origin().lond();
-      d = ossim::round<int>(d / theDegreesPerPixel.x) * theDegreesPerPixel.x;
-      theUlGpt.lond(d + origin().lond());
-
-      // Adjust the stored easting / northing.
-      theUlEastingNorthing = forward(theUlGpt);
-   }
-   else
-   {
-      // Snap the easting.
-      ossim_float64 d = theUlEastingNorthing.x - getFalseEasting();
-      d = ossim::round<int>(d / theMetersPerPixel.x) * theMetersPerPixel.x;
-      theUlEastingNorthing.x = d + getFalseEasting();
-
-      // Snap the northing.
-      d = theUlEastingNorthing.y - getFalseNorthing();
-      d = ossim::round<int>(d / theMetersPerPixel.y) * theMetersPerPixel.y;
-      theUlEastingNorthing.y = d + getFalseNorthing();
-
-      // Adjust the stored upper left ground point.
-      theUlGpt = inverse(theUlEastingNorthing);
-   }
-}
-
-void ossimMapProjection::setElevationLookupFlag(bool flag)
-{
-   theElevationLookupFlag = flag;
-}
-
-bool ossimMapProjection::getElevationLookupFlag()const
-{
-   return theElevationLookupFlag;
-}
-   
-
diff --git a/ossim/src/ossim/projection/ossimMapProjectionFactory.cpp b/ossim/src/ossim/projection/ossimMapProjectionFactory.cpp
deleted file mode 100644
index 4ec9692..0000000
--- a/ossim/src/ossim/projection/ossimMapProjectionFactory.cpp
+++ /dev/null
@@ -1,290 +0,0 @@
-//*****************************************************************************
-// FILE: ossimMapProjectionFactory.cc
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimMapProjectionFactory
-//
-// SOFTWARE HISTORY:
-//>
-//   15Jun2001  Garrett Potts
-//              Initial coding.
-//<
-//*****************************************************************************
-//  $Id: ossimMapProjectionFactory.cpp 22602 2014-01-31 18:39:11Z gpotts $
-
-#include <ossim/projection/ossimMapProjectionFactory.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimFilename.h>
-
-//***
-// Note to programmer: To add a new projection, search this file for
-// "ADD_PROJECTION" to locate places requiring editing. Functional example
-// below...
-//
-// ADD_PROJECTION: Include all map projection headers here:
-//***
-
-#include <ossim/projection/ossimAlbersProjection.h>
-#include <ossim/projection/ossimAzimEquDistProjection.h>
-#include <ossim/projection/ossimBonneProjection.h>
-#include <ossim/projection/ossimBngProjection.h>
-#include <ossim/projection/ossimCassiniProjection.h>
-#include <ossim/projection/ossimCylEquAreaProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimEckert4Projection.h>
-#include <ossim/projection/ossimEckert6Projection.h>
-#include <ossim/projection/ossimGnomonicProjection.h>
-#include <ossim/projection/ossimLambertConformalConicProjection.h>
-#include <ossim/projection/ossimLlxyProjection.h>
-#include <ossim/projection/ossimMercatorProjection.h>
-#include <ossim/projection/ossimMillerProjection.h>
-#include <ossim/projection/ossimMollweidProjection.h>
-#include <ossim/projection/ossimNewZealandMapGridProjection.h>
-#include <ossim/projection/ossimObliqueMercatorProjection.h>
-#include <ossim/projection/ossimOrthoGraphicProjection.h>
-#include <ossim/projection/ossimPolarStereoProjection.h>
-#include <ossim/projection/ossimPolyconicProjection.h>
-#include <ossim/projection/ossimSinusoidalProjection.h>
-#include <ossim/projection/ossimStereographicProjection.h>
-#include <ossim/projection/ossimTransCylEquAreaProjection.h>
-#include <ossim/projection/ossimTransMercatorProjection.h>
-#include <ossim/projection/ossimUpsProjection.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimVanDerGrintenProjection.h>
-#include <ossim/projection/ossimSpaceObliqueMercatorProjection.h>
-#include <ossim/projection/ossimGoogleProjection.h>
-#include <ossim/support_data/ossimSpaceImagingGeom.h>
-//***
-// ADD_PROJECTION: List names of all map projections produced by this factory:
-//***
-
-ossimMapProjectionFactory* ossimMapProjectionFactory::theInstance = 0;
-
-//*****************************************************************************
-//  STATIC METHOD: ossimMapProjectionFactory::instance()
-//  
-//*****************************************************************************
-ossimMapProjectionFactory* ossimMapProjectionFactory::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimMapProjectionFactory;
-   }
-
-   return (ossimMapProjectionFactory*) theInstance;
-}
-
-ossimProjection*
-ossimMapProjectionFactory::createProjection(const ossimFilename& filename,
-                                            ossim_uint32 entryIdx)const
-{
-   if(!filename.exists())
-   {
-      return NULL;
-   }
-
-   // Check for external geometry file.
-   ossimProjection* proj = createProjectionFromGeometryFile(filename,
-                                                            entryIdx);
-   if (proj)
-   {
-      return proj;
-   }
-
-   ossimFilename geomFile = filename;
-   geomFile = geomFile.setExtension("geom");
-   if(!geomFile.exists())
-   {
-      return NULL;
-   }
-   ossimKeywordlist kwl;
-   if(kwl.addFile(geomFile))
-   {
-      return createProjection(kwl);
-   }
-
-   return NULL;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjectionFactory::create(kwl, prefix)
-//  
-//*****************************************************************************
-ossimProjection* ossimMapProjectionFactory::createProjection(const ossimKeywordlist &keywordList,
-															 const char *prefix) const
-{
-   ossimProjection *result=NULL;
-	
-   const char *lookup = keywordList.find(prefix, ossimKeywordNames::TYPE_KW);
-   const char *lookupSpaceImaging = keywordList.find(prefix, ossimSpaceImagingGeom::SIG_PRODUCER_KW);
-   if(lookup)
-   {
-      result = createProjection(ossimString(lookup).trim());
-      if(result)
-      {
-         result->loadState(keywordList, prefix);
-      }
-   }
-   else
-   {
-      if(lookupSpaceImaging)
-      {
-		  ossimKeywordlist kwl;
-		  ossimKeywordlist kwl2;
-		  kwl.add(keywordList,
-				  prefix,
-				  true);
-         
-         ossimSpaceImagingGeom spaceImaging;
-         
-         spaceImaging.setGeometry(kwl);
-
-         spaceImaging.exportToOssim(kwl2);
-
-         result = ossimProjectionFactoryRegistry::instance()->createProjection(kwl2);
-         if(result)
-         {
-            return result;
-         }
-      }
-      // look for the geom_file keyword.
-      //
-      lookup = keywordList.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
-      if(lookup)
-      {
-         ossimKeywordlist kwl;
-
-         kwl.addFile(lookup);
-
-         result = createProjection(kwl);
-         
-         if(!result)
-         {
-         // maybe they prepend projection. in the geom
-         // file.
-            result = createProjection(kwl, "projection.");
-         }
-
-      }      
-   }
-   return result;
-}
-
-//*****************************************************************************
-//  METHOD: ossimMapProjectionFactory::create(projection_name)
-//*****************************************************************************
-ossimProjection* ossimMapProjectionFactory::createProjection(const ossimString &name) const
-{
-   //***
-   // ADD_PROJECTION: Test for each map projection here:
-   //***
-   if(name ==  STATIC_TYPE_NAME(ossimAlbersProjection))
-      return new ossimAlbersProjection;
-   if(name ==  STATIC_TYPE_NAME(ossimAzimEquDistProjection))
-      return new ossimAzimEquDistProjection;
-   if( name == STATIC_TYPE_NAME(ossimBonneProjection))
-      return new ossimBonneProjection;
-   if( name == STATIC_TYPE_NAME(ossimBngProjection))
-      return new ossimBngProjection;
-   if(name ==  STATIC_TYPE_NAME(ossimCassiniProjection))
-      return new ossimCassiniProjection;
-   if(name ==  STATIC_TYPE_NAME(ossimCylEquAreaProjection))
-      return new ossimCylEquAreaProjection;
-   if(name ==  STATIC_TYPE_NAME(ossimEquDistCylProjection))
-      return new ossimEquDistCylProjection;
-   if(name ==  STATIC_TYPE_NAME(ossimEckert4Projection))
-      return new ossimEckert4Projection;
-   if(name ==  STATIC_TYPE_NAME(ossimEckert6Projection))
-      return new ossimEckert6Projection;
-   if(name == STATIC_TYPE_NAME(ossimGnomonicProjection))
-      return new ossimGnomonicProjection;
-   if(name ==  STATIC_TYPE_NAME(ossimLambertConformalConicProjection))
-      return new ossimLambertConformalConicProjection;
-   if(name ==  STATIC_TYPE_NAME(ossimLlxyProjection))
-      return new ossimLlxyProjection;
-   if(name == STATIC_TYPE_NAME(ossimMercatorProjection))
-      return new ossimMercatorProjection;
-   if(name == STATIC_TYPE_NAME(ossimMillerProjection))
-      return new ossimMillerProjection;
-   if(name == STATIC_TYPE_NAME(ossimMollweidProjection))
-      return new ossimMollweidProjection;
-   if(name == STATIC_TYPE_NAME(ossimNewZealandMapGridProjection))
-      return new ossimNewZealandMapGridProjection;
-   if(name == STATIC_TYPE_NAME(ossimObliqueMercatorProjection))
-      return new ossimObliqueMercatorProjection;
-   if(name == STATIC_TYPE_NAME(ossimOrthoGraphicProjection))
-      return new ossimOrthoGraphicProjection;
-   if(name == STATIC_TYPE_NAME(ossimPolarStereoProjection))
-      return new ossimPolarStereoProjection;
-   if(name == STATIC_TYPE_NAME(ossimPolyconicProjection))
-      return new ossimPolyconicProjection;
-   if(name == STATIC_TYPE_NAME(ossimSinusoidalProjection))
-      return new ossimSinusoidalProjection;
-   if(name == STATIC_TYPE_NAME(ossimStereographicProjection))
-      return new ossimStereographicProjection;
-   if(name == STATIC_TYPE_NAME(ossimTransCylEquAreaProjection))
-      return new ossimTransCylEquAreaProjection;
-   if(name == STATIC_TYPE_NAME(ossimTransMercatorProjection))
-      return new ossimTransMercatorProjection;
-   if(name == STATIC_TYPE_NAME(ossimUpsProjection))
-      return new ossimUpsProjection;
-   if(name == STATIC_TYPE_NAME(ossimUtmProjection))
-      return new ossimUtmProjection;
-   if(name == STATIC_TYPE_NAME(ossimVanDerGrintenProjection))
-      return new ossimVanDerGrintenProjection;
-   if(name == STATIC_TYPE_NAME(ossimSpaceObliqueMercatorProjection))
-      return new ossimSpaceObliqueMercatorProjection;
-    if(name == STATIC_TYPE_NAME(ossimGoogleProjection))
-      return new ossimGoogleProjection;
-  return NULL;
-}
-
-ossimObject* ossimMapProjectionFactory::createObject(const ossimString& typeName)const
-{
-   return createProjection(typeName);
-}
-
-ossimObject* ossimMapProjectionFactory::createObject(const ossimKeywordlist& kwl,
-                                                     const char* prefix)const
-{
-   return createProjection(kwl, prefix);
-}
-
-void ossimMapProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList)const
-{
-   
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimAlbersProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimAzimEquDistProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimBonneProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimBngProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimCassiniProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimCylEquAreaProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimEquDistCylProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimEckert4Projection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimEckert6Projection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimGnomonicProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimLambertConformalConicProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimLlxyProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimMercatorProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimMillerProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimMollweidProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimNewZealandMapGridProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimObliqueMercatorProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimOrthoGraphicProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimPolarStereoProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimPolyconicProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimSinusoidalProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimStereographicProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimTransCylEquAreaProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimTransMercatorProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimUpsProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimUtmProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimVanDerGrintenProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimSpaceObliqueMercatorProjection)));
-   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimGoogleProjection)));
-
-}
diff --git a/ossim/src/ossim/projection/ossimMercatorProjection.cpp b/ossim/src/ossim/projection/ossimMercatorProjection.cpp
deleted file mode 100644
index 32c6eff..0000000
--- a/ossim/src/ossim/projection/ossimMercatorProjection.cpp
+++ /dev/null
@@ -1,492 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Mercator projection code.  
-//*******************************************************************
-//  $Id: ossimMercatorProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-
-#include <math.h>
-#include <ossim/projection/ossimMercatorProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimMercatorProjection, "ossimMercatorProjection", ossimMapProjection)
-/***************************************************************************/
-/*
- *                               DEFINES
- */
-
-#define PI         3.14159265358979323e0  /* PI                            */
-#define PI_OVER_2  ( PI / 2.0e0)  
-#define MAX_LAT    ( (PI * 89.5) / 180.0 )  /* 89.5 degrees in radians         */
-
-#define MERC_NO_ERROR           0x0000
-#define MERC_LAT_ERROR          0x0001
-#define MERC_LON_ERROR          0x0002
-#define MERC_EASTING_ERROR      0x0004
-#define MERC_NORTHING_ERROR     0x0008
-#define MERC_ORIGIN_LAT_ERROR   0x0010
-#define MERC_CENT_MER_ERROR     0x0020
-#define MERC_A_ERROR            0x0040
-#define MERC_B_ERROR            0x0080
-#define MERC_A_LESS_B_ERROR     0x0100
-
-ossimMercatorProjection::ossimMercatorProjection(const ossimEllipsoid& ellipsoid,
-                                                 const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-
-ossimMercatorProjection::ossimMercatorProjection(const ossimEllipsoid& ellipsoid,
-                                                 const ossimGpt& origin,
-                                                 double falseEasting,
-                                                 double falseNorthing,
-                                                 double scaleFactor)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   Merc_False_Easting  = falseEasting;
-   Merc_False_Northing = falseNorthing;
-   Merc_Scale_Factor   = scaleFactor;
-
-   update();
-}
-
-void ossimMercatorProjection::update()
-{
-   
-   Set_Mercator_Parameters(theEllipsoid.getA(),
-                           theEllipsoid.getFlattening(),
-                           theOrigin.latr(),
-                           theOrigin.lonr(),
-                           Merc_False_Easting,
-                           Merc_False_Northing,
-                           &Merc_Scale_Factor);
-
-   theFalseEastingNorthing.x = Merc_False_Easting;
-   theFalseEastingNorthing.y = Merc_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-void ossimMercatorProjection::setFalseEasting(double falseEasting)
-{
-   Merc_False_Easting = falseEasting;
-   update();
-}
-
-void ossimMercatorProjection::setFalseNorthing(double falseNorthing)
-{
-   Merc_False_Northing = falseNorthing;
-   update();
-}
-
-void ossimMercatorProjection::setScaleFactor(double scaleFactor)
-{
-   Merc_Scale_Factor = scaleFactor;
-   update();
-}
-
-void ossimMercatorProjection::setFalseEastingNorthing(double falseEasting,
-                                                      double falseNorthing)
-{
-   Merc_False_Easting = falseEasting;
-   Merc_False_Northing = falseNorthing;
-   update();
-}
-
-void ossimMercatorProjection::setParameters(double falseEasting,
-                                            double falseNorthing,
-                                            double scaleFactor)
-{
-   Merc_False_Easting  = falseEasting;
-   Merc_False_Northing = falseNorthing;
-   Merc_Scale_Factor   = scaleFactor;
-   
-   update(); 
-}
-
-void ossimMercatorProjection::setDefaults()
-{
-   Merc_False_Easting  = 0.0;
-   Merc_False_Northing = 0.0;
-   Merc_Delta_Easting  = 20237883.0;
-   Merc_Delta_Northing = 23421740.0;
-   Merc_Scale_Factor   = 1.0;
-}
-
-ossimGpt ossimMercatorProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-
-   if(theSphericalFlag)
-   {
-      double shift = M_PI * 6378137.0;
-      lon = (eastingNorthing.x / shift) * 180.0;
-      lat = (eastingNorthing.y / shift) * 180.0;
-      
-      lat = 180 / M_PI * (2 * atan( exp( lat * M_PI / 180.0)) - M_PI / 2.0);   
-   }
-   else 
-   {
-      Convert_Mercator_To_Geodetic(eastingNorthing.x,
-                                   eastingNorthing.y,
-                                   &lat,
-                                   &lon);
-      lat = ossim::radiansToDegrees(lat);
-      lon = ossim::radiansToDegrees(lon);
-   }
-
-   
-   
-   return ossimGpt(lat, lon, 0.0, theDatum);  
-}
-
-ossimDpt ossimMercatorProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-   if(theSphericalFlag)
-   {
-      double lat = latLon.latd();
-      double lon = latLon.lond();
-      double shift = M_PI * Merc_a;
-      easting = lon * shift / 180.0;
-      northing = log( tan((90 + lat) * M_PI / 360.0 )) / (M_PI / 180.0);
-      
-      northing = northing * shift / 180.0;
-   }
-   else 
-   {
-      Convert_Geodetic_To_Mercator(gpt.latr(),
-                                   gpt.lonr(),
-                                   &easting,
-                                   &northing);
-   }      
-
-   
-   return ossimDpt(easting, northing);
-}
-
-
-bool ossimMercatorProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_FACTOR_KW,
-           Merc_Scale_Factor,
-           true);
-
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimMercatorProjection::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   const char* scaleFactor   = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
-   
-   setDefaults();
-
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimMercatorProjection))
-   {
-      Merc_False_Easting  = theFalseEastingNorthing.x;
-      Merc_False_Northing = theFalseEastingNorthing.y;
-
-      if(scaleFactor)
-      {
-         Merc_Scale_Factor = ossimString(scaleFactor).toDouble();
-      }
-   }
-   update();
-   
-   return flag;
-}
-
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS     
- */
-
-
-long ossimMercatorProjection::Set_Mercator_Parameters(double a,      
-                                                      double f,
-                                                      double Origin_Latitude,
-                                                      double Central_Meridian,
-                                                      double False_Easting,
-                                                      double False_Northing,
-                                                      double *Scale_Factor)
-{ /* BEGIN Set_Mercator_Parameters */
-/*
- * The function Set_Mercator_Parameters receives the ellipsoid parameters and
- * Mercator projection parameters as inputs, and sets the corresponding state 
- * variables.  It calculates and returns the scale factor.  If any errors
- * occur, the error code(s) are returned by the function, otherwise Merc_NO_ERROR
- * is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid						        (input)
- *    Origin_Latitude   : Latitude in radians at which the          (input)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (input)
- *    Scale_Factor      : Multiplier which reduces distances in the 
- *                          projection to the actual distance on the
- *                          ellipsoid                               (output)
- */
-
-  double es2;   /* Eccentricity squared of ellipsoid to the second power    */
-  double es3;   /* Eccentricity squared of ellipsoid to the third power     */
-  double es4;   /* Eccentricity squared of ellipsoid to the fourth power    */
-  double sin_olat; /* sin(Origin_Latitude), temp variable */
-//  double inv_f = 1 / f;
-  long Error_Code = MERC_NO_ERROR;
-
-   theSphericalFlag = ossim::almostEqual(f, 0.0);
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= MERC_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= MERC_INV_F_ERROR;
-//   }
-//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
-//   { /* origin latitude out of range */
-//     Error_Code |= MERC_ORIGIN_LAT_ERROR;
-//   }
-//   if ((Central_Meridian < -PI) || (Central_Meridian > (2*PI)))
-//   { /* origin longitude out of range */
-//     Error_Code |= MERC_CENT_MER_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    Merc_a = a;
-    Merc_f = f;
-    Merc_Origin_Lat = Origin_Latitude;
-//     if (Central_Meridian > PI)
-//       Central_Meridian -= (2*PI);
-    Merc_Origin_Long = Central_Meridian;
-    Merc_False_Northing = False_Northing;
-    Merc_False_Easting = False_Easting;
-    Merc_es = 2 * Merc_f - Merc_f * Merc_f;
-    Merc_e = sqrt(Merc_es);
-    sin_olat = sin(Origin_Latitude);
-    Merc_Scale_Factor = 1.0 / ( sqrt(1.e0 - Merc_es * sin_olat * sin_olat) 
-                                / cos(Origin_Latitude) );
-    es2 = Merc_es * Merc_es;
-    es3 = es2 * Merc_es;
-    es4 = es3 * Merc_es;
-    Merc_ab = Merc_es / 2.e0 + 5.e0 * es2 / 24.e0 + es3 / 12.e0
-              + 13.e0 * es4 / 360.e0;
-    Merc_bb = 7.e0 * es2 / 48.e0 + 29.e0 * es3 / 240.e0 
-              + 811.e0 * es4 / 11520.e0;
-    Merc_cb = 7.e0 * es3 / 120.e0 + 81.e0 * es4 / 1120.e0;
-    Merc_db = 4279.e0 * es4 / 161280.e0;
-    *Scale_Factor = Merc_Scale_Factor;
-    Convert_Geodetic_To_Mercator( MAX_LAT, (Merc_Origin_Long + PI),                                           
-                                  &Merc_Delta_Easting, &Merc_Delta_Northing);
-    if (Merc_Delta_Easting < 0)
-      Merc_Delta_Easting = -Merc_Delta_Easting;
-    Merc_Delta_Easting *= 1.01;
-    Merc_Delta_Easting -= Merc_False_Easting;
-    Merc_Delta_Northing *= 1.01;
-    Merc_Delta_Northing -= Merc_False_Northing;
-  } /* END OF if(!Error_Code) */
-  return (Error_Code);
-} /* END OF Set_Mercator_Parameters */
-
-
-void ossimMercatorProjection::Get_Mercator_Parameters(double *a,
-                                                      double *f,
-                                                      double *Origin_Latitude,
-                                                      double *Central_Meridian,
-                                                      double *False_Easting,
-                                                      double *False_Northing,
-                                                      double *Scale_Factor)const
-{ /* BEGIN Get_Mercator_Parameters */
-/*
- * The function Get_Mercator_Parameters returns the current ellipsoid
- * parameters, Mercator projection parameters, and scale factor.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid						        (output)
- *    Origin_Latitude   : Latitude in radians at which the          (output)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (output)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (output)
- *    Scale_Factor      : Multiplier which reduces distances in the 
- *                          projection to the actual distance on the
- *                          ellipsoid                               (output)
- */
-
-  *a = Merc_a;
-  *f = Merc_f;
-  *Origin_Latitude = Merc_Origin_Lat;
-  *Central_Meridian = Merc_Origin_Long;
-  *False_Easting = Merc_False_Easting;
-  *False_Northing = Merc_False_Northing;
-  *Scale_Factor = Merc_Scale_Factor;
-  
-  return;
-} /* END OF Get_Mercator_Parameters */
-
-
-long ossimMercatorProjection::Convert_Geodetic_To_Mercator (double Latitude,
-                                                            double Longitude,
-                                                            double *Easting,
-                                                            double *Northing)const
-{ /* BEGIN Convert_Geodetic_To_Mercator */
-   long Error_Code = MERC_NO_ERROR;
-/*
- * The function Convert_Geodetic_To_Mercator converts geodetic (latitude and
- * longitude) coordinates to Mercator projection (easting and northing)
- * coordinates, according to the current ellipsoid and Mercator projection
- * parameters.  If any errors occur, the error code(s) are returned by the
- * function, otherwise MERC_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double ctanz2;        /* Cotangent of z/2 - z - Isometric colatitude     */
-  double e_x_sinlat;    /* e * sin(Latitude)                               */
-  double Delta_Long;    /* Difference in origin longitude and longitude    */
-  double tan_temp;
-  double pow_temp;
-
-
-//   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
-//   { /* Latitude out of range */
-//     Error_Code |= MERC_LAT_ERROR;
-//   }
-//   if ((Longitude < -PI) || (Longitude > (2*PI)))
-//   { /* Longitude out of range */
-//     Error_Code |= MERC_LON_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    if (Longitude > PI)
-      Longitude -= (2*PI);
-    e_x_sinlat = Merc_e * sin(Latitude);
-    tan_temp = tan(PI / 4.e0 + Latitude / 2.e0);
-    pow_temp = pow( ((1.e0 - e_x_sinlat) / (1.e0 + e_x_sinlat)),
-                    (Merc_e / 2.e0) );
-    ctanz2 = tan_temp * pow_temp;
-    *Northing = Merc_Scale_Factor * Merc_a * log(ctanz2) + Merc_False_Northing;
-    Delta_Long = Longitude - Merc_Origin_Long;
-//     if (Delta_Long > PI)
-//       Delta_Long -= (2 * PI);
-//     if (Delta_Long < -PI)
-//       Delta_Long += (2 * PI);
-    *Easting = Merc_Scale_Factor * Merc_a * Delta_Long
-               + Merc_False_Easting;
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Mercator */
-
-
-long ossimMercatorProjection::Convert_Mercator_To_Geodetic(double Easting,
-                                                           double Northing,
-                                                           double *Latitude,
-                                                           double *Longitude)const
-{ /* BEGIN Convert_Mercator_To_Geodetic */
-/*
- * The function Convert_Mercator_To_Geodetic converts Mercator projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid and Mercator projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise MERC_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
-  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
-  double xphi;   /* Isometric latitude                                      */
-   long Error_Code = MERC_NO_ERROR;
-
-#if 0
-   if(theSphericalFlag)
-   {
-      *Latitude = M_PI*.5 - 2.0 * atan(exp(-Easting / Merc_a));
-      *Longitude = Easting/Merc_a;
-      
-      return Error_Code;
-   }
-#endif
-//   if ((Easting < (Merc_False_Easting - Merc_Delta_Easting))
-//       || (Easting > (Merc_False_Easting + Merc_Delta_Easting)))
-//   { /* Easting out of range */
-//     Error_Code |= MERC_EASTING_ERROR;
-//   }
-//   if ((Northing < (Merc_False_Northing - Merc_Delta_Northing))
-//       || (Northing > (Merc_False_Northing + Merc_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= MERC_NORTHING_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    dy = Northing - Merc_False_Northing;
-    dx = Easting - Merc_False_Easting;
-    *Longitude = Merc_Origin_Long + dx / (Merc_Scale_Factor * Merc_a);
-    xphi = PI / 2.e0 
-           - 2.e0 * atan(1.e0 / exp(dy / (Merc_Scale_Factor * Merc_a)));
-    *Latitude = xphi + Merc_ab * sin(2.e0 * xphi) + Merc_bb * sin(4.e0 * xphi)
-                + Merc_cb * sin(6.e0 * xphi) + Merc_db * sin(8.e0 * xphi);
-//     if (*Longitude > PI)
-//       *Longitude -= (2 * PI);
-//     if (*Longitude < -PI)
-//       *Longitude += (2 * PI);
-  }
-  return (Error_Code);
-} /* END OF Convert_Mercator_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimMercatorProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimMercatorProjection* p = PTR_CAST(ossimMercatorProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(Merc_Scale_Factor,p->Merc_Scale_Factor)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimMollweidProjection.cpp b/ossim/src/ossim/projection/ossimMollweidProjection.cpp
deleted file mode 100644
index d8a65dd..0000000
--- a/ossim/src/ossim/projection/ossimMollweidProjection.cpp
+++ /dev/null
@@ -1,448 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Mollweid projection code.  
-//*******************************************************************
-//  $Id: ossimMollweidProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-#include <math.h>
-#include <ossim/projection/ossimMollweidProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimMollweidProjection, "ossimMollweidProjection", ossimMapProjection)
-
-/***************************************************************************/
-/*
- *                              DEFINES
- */
-#ifndef PI_OVER_2
-#  define PI_OVER_2  ( M_PI / 2.0)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI     (2.0 * M_PI)
-#endif
-#define MAX_LAT    ( (M_PI * 90.0) / 180.0 ) /* 90 degrees in radians    */
-
-#define MOLL_NO_ERROR           0x0000
-#define MOLL_LAT_ERROR          0x0001
-#define MOLL_LON_ERROR          0x0002
-#define MOLL_EASTING_ERROR      0x0004
-#define MOLL_NORTHING_ERROR     0x0008
-#define MOLL_CENT_MER_ERROR     0x0020
-#define MOLL_A_ERROR            0x0040
-#define MOLL_B_ERROR            0x0080
-#define MOLL_A_LESS_B_ERROR     0x0100
-
-ossimMollweidProjection::ossimMollweidProjection(const ossimEllipsoid& ellipsoid,
-                                                 const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-
-ossimMollweidProjection::ossimMollweidProjection(const ossimEllipsoid& ellipsoid,
-                                                 const ossimGpt& origin,
-                                                 double falseEasting,
-                                                 double falseNorthing)
-   :ossimMapProjection(ellipsoid, origin)
-{
-
-   Moll_False_Easting  = falseEasting;
-   Moll_False_Northing = falseNorthing;
-   Moll_Delta_Northing = 9009965.0;
-   Moll_Max_Easting    = 18019930.0;
-   Moll_Min_Easting    = -18019930.0;
-
-   update();
-}
-
-void ossimMollweidProjection::update()
-{   
-
-   Set_Mollweide_Parameters(theEllipsoid.getA(),
-                            theEllipsoid.getFlattening(),
-                            theOrigin.lonr(),
-                            Moll_False_Easting,
-                            Moll_False_Northing);
-
-   theFalseEastingNorthing.x = Moll_False_Easting;
-   theFalseEastingNorthing.y = Moll_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-void ossimMollweidProjection::setFalseEasting(double falseEasting)
-{
-   Moll_False_Easting = falseEasting;
-   update();
-}
-
-void ossimMollweidProjection::setFalseNorthing(double falseNorthing)
-{
-   Moll_False_Northing = falseNorthing;
-   update();
-}
-
-void ossimMollweidProjection::setDefaults()
-{
-   Moll_False_Easting  = 0.0;
-   Moll_False_Northing = 0.0;
-   Moll_Delta_Northing = 9009965.0;
-   Moll_Max_Easting    = 18019930.0;
-   Moll_Min_Easting    = -18019930.0;
-}
-
-void ossimMollweidProjection::setFalseEastingNorthing(double falseEasting,
-                                                      double falseNorthing)
-{
-   Moll_False_Easting  = falseEasting;
-   Moll_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimMollweidProjection::setCentralMeridian(double centralMeridian)
-{
-  Moll_Origin_Long = centralMeridian;
-  update();
-}
-
-ossimGpt ossimMollweidProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_Mollweide_To_Geodetic(eastingNorthing.x,
-                                 eastingNorthing.y,
-                                 &lat,
-                                 &lon);
-
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
-}
-
-ossimDpt ossimMollweidProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Mollweide(gpt.latr(),
-                                 gpt.lonr(),
-                                 &easting,
-                                 &northing);
-   
-   return ossimDpt(easting, northing);
-}
-
-bool ossimMollweidProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimMollweidProjection::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-
-   setDefaults();
-
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimMollweidProjection))
-   {
-      Moll_False_Easting  = theFalseEastingNorthing.x;
-      Moll_False_Northing = theFalseEastingNorthing.y;
-   }
-   update();
-
-   return flag;   
-}
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS
- */
-
-
-long ossimMollweidProjection::Set_Mollweide_Parameters(double a,
-                                                       double f,
-                                                       double Central_Meridian,
-                                                       double False_Easting,
-                                                       double False_Northing)
-{ /* Begin Set_Mollweide_Parameters */
-/*
- * The function Set_Mollweide_Parameters receives the ellipsoid parameters and
- * Mollweide projcetion parameters as inputs, and sets the corresponding state
- * variables.  If any errors occur, the error code(s) are returned by the 
- * function, otherwise MOLL_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid						        (input)
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (input)
- */
-
-  double Ra;                       /* Spherical Radius */
-//  double inv_f = 1 / f;
-  long Error_Code = MOLL_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= MOLL_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= MOLL_INV_F_ERROR;
-//   }
-//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= MOLL_CENT_MER_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    Moll_a = a;
-    Moll_f = f;
-    es2 = 2 * Moll_f - Moll_f * Moll_f;
-    es4 = es2 * es2;
-    es6 = es4 * es2;
-    /* spherical radius */
-    Ra = Moll_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 / 3024.0);
-    Sqrt2_Ra = sqrt(2.0) * Ra;
-    Sqrt8_Ra = sqrt(8.0) * Ra;
-//     if (Central_Meridian > PI)
-//       Central_Meridian -= TWO_PI;
-    Moll_Origin_Long = Central_Meridian;
-    Moll_False_Easting = False_Easting;
-    Moll_False_Northing = False_Northing;
-
-    if (Moll_Origin_Long > 0)
-    {
-      Moll_Max_Easting = 17919819.0;
-      Moll_Min_Easting = -18019930.0;
-    }
-    else if (Moll_Origin_Long < 0)
-    {
-      Moll_Max_Easting = 18019930.0;
-      Moll_Min_Easting = -17919819.0;
-    }
-    else
-    {
-      Moll_Max_Easting = 18019930.0;
-      Moll_Min_Easting = -18019930.0;
-    }
-
-  } /* End if(!Error_Code) */
-  return (Error_Code);
-} /* End Set_Mollweide_Parameters */
-
-
-void ossimMollweidProjection::Get_Mollweide_Parameters(double *a,
-                                                       double *f,
-                                                       double *Central_Meridian,
-                                                       double *False_Easting,
-                                                       double *False_Northing)const
-{ /* Begin Get_Mollweide_Parameters */
-/*
- * The function Get_Mollweide_Parameters returns the current ellipsoid
- * parameters and Mollweide projection parameters.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid						        (output)
- *    Central_Meridian  : Longitude in radians at the center of     (output)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (output)
- */
-
-  *a = Moll_a;
-  *f = Moll_f;
-  *Central_Meridian = Moll_Origin_Long;
-  *False_Easting = Moll_False_Easting;
-  *False_Northing = Moll_False_Northing;
-  
-  return;
-} /* End Get_Mollweide_Parameters */
-
-
-long ossimMollweidProjection::Convert_Geodetic_To_Mollweide (double Latitude,
-                                                             double Longitude,
-                                                             double *Easting,
-                                                             double *Northing)const
-
-{ /* Begin Convert_Geodetic_To_Mollweide */
-/*
- * The function Convert_Geodetic_To_Mollweide converts geodetic (latitude and
- * longitude) coordinates to Mollweide projection (easting and northing)
- * coordinates, according to the current ellipsoid and Mollweide projection
- * parameters.  If any errors occur, the error code(s) are returned by the
- * function, otherwise MOLL_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double PI_Sin_Latitude = M_PI * sin(Latitude);
-  double dlam;                                  /* Longitude - Central Meridan */
-  double theta;
-  double theta_primed = Latitude;
-  double delta_theta_primed = 0.1745329;        /* arbitrarily initialized to 10 deg */
-  double dtp_tolerance = 4.85e-10;              /* approximately 1/1000th of
-                                                 an arc second or 1/10th meter */
-  long   Error_Code = MOLL_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   {  /* Latitude out of range */
-//     Error_Code |= MOLL_LAT_ERROR;
-//   }
-//   if ((Longitude < -PI) || (Longitude > TWO_PI))
-//   {  /* Longitude out of range */
-//     Error_Code|= MOLL_LON_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-    dlam = Longitude - Moll_Origin_Long;
-//     if (dlam > PI)
-//     {
-//       dlam -= TWO_PI;
-//     }
-//     if (dlam < -PI)
-//     {
-//       dlam += TWO_PI;
-//     }
-    while (fabs(delta_theta_primed) > dtp_tolerance)
-    {
-      delta_theta_primed = -(theta_primed + sin(theta_primed) -
-                             PI_Sin_Latitude) / (1.0 + cos(theta_primed));
-      theta_primed += delta_theta_primed;
-    }
-    theta = theta_primed / 2.0;
-    *Easting = (Sqrt8_Ra / M_PI ) * dlam * cos(theta) +
-               Moll_False_Easting;
-    *Northing = Sqrt2_Ra * sin(theta) + Moll_False_Northing;
-
-  }
-  return (Error_Code);
-
-} /* End Convert_Geodetic_To_Mollweide */
-
-
-long ossimMollweidProjection::Convert_Mollweide_To_Geodetic(double Easting,
-                                                            double Northing,
-                                                            double *Latitude,
-                                                            double *Longitude)const
-{ /* Begin Convert_Mollweide_To_Geodetic */
-/*
- * The function Convert_Mollweide_To_Geodetic converts Mollweide projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid and Mollweide projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise MOLL_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double dx, dy;
-  double theta = 0.0;
-  double two_theta;
-  double i;
-
-  long Error_Code = MOLL_NO_ERROR;
-
-//   if ((Easting < (Moll_False_Easting + Moll_Min_Easting))
-//       || (Easting > (Moll_False_Easting + Moll_Max_Easting)))
-//   { /* Easting out of range  */
-//     Error_Code |= MOLL_EASTING_ERROR;
-//   }
-//   if ((Northing < (Moll_False_Northing - Moll_Delta_Northing)) || 
-//       (Northing >(Moll_False_Northing + Moll_Delta_Northing) ))
-//   { /* Northing out of range */
-//     Error_Code |= MOLL_NORTHING_ERROR;
-//   }
-
-  if (!Error_Code)
-  {
-    dy = Northing - Moll_False_Northing;
-    dx = Easting - Moll_False_Easting;
-    i = dy / Sqrt2_Ra;
-    if (fabs(i) > 1.0)
-    {
-      *Latitude = MAX_LAT;
-      if (Northing < 0.0)
-        *Latitude *= -1.0;
-    }
-
-    else
-    {
-      theta = asin(i);
-      two_theta = 2.0 * theta;
-      *Latitude = asin((two_theta + sin(two_theta)) / M_PI);
-
-      if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-        *Latitude = PI_OVER_2;
-      else if (*Latitude < -PI_OVER_2)
-        *Latitude = -PI_OVER_2;
-
-    }
-    if (fabs(fabs(*Latitude) - MAX_LAT) < 1.0e-10)
-      *Longitude = Moll_Origin_Long;
-    else
-      *Longitude = Moll_Origin_Long + M_PI * dx /
-                   (Sqrt8_Ra * cos(theta));
-
-//     if (*Longitude > PI)
-//       *Longitude -= TWO_PI;
-//     if (*Longitude < -PI)
-//       *Longitude += TWO_PI;
-
-//     if (*Longitude > PI)  /* force distorted values to 180, -180 degrees */
-//       *Longitude = PI;
-//     else if (*Longitude < -PI)
-//       *Longitude = -PI;
-
-
-  }
-  return (Error_Code);
-
-} /* End Convert_Mollweide_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimMollweidProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimMollweidProjection* p = PTR_CAST(ossimMollweidProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(Moll_Origin_Long,p->Moll_Origin_Long)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimNgaProjectionFactory.cpp b/ossim/src/ossim/projection/ossimNgaProjectionFactory.cpp
deleted file mode 100644
index a582993..0000000
--- a/ossim/src/ossim/projection/ossimNgaProjectionFactory.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2014 RadiantBlue, Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//*******************************************************************
-//  $Id$
-
-#include <ossim/projection/ossimNgaProjectionFactory.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/projection/ossimMercatorProjection.h>
-
-// Define Trace flags for use within this file:
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceDebug = ossimTrace("ossimNgaProjectionFactory:debug");
-
-RTTI_DEF1(ossimNgaProjectionFactory, "ossimNgaProjectionFactory",
-      ossimProjectionFactoryBase);
-
-//*************************************************************************************************
-//! Implements singleton pattern
-//*************************************************************************************************
-ossimNgaProjectionFactory* ossimNgaProjectionFactory::instance()
-{
-   static ossimNgaProjectionFactory inst;
-
-   return &inst;
-}
-
-ossimProjection* ossimNgaProjectionFactory::createProjection(const ossimFilename& filename,
-      ossim_uint32 entryIdx) const
-      {
-   // Check for external geometry file.
-   return createProjectionFromGeometryFile(filename, entryIdx);
-}
-
-//**************************************************************************************************
-// This is the principal factory method. It accepts a string in format:
-//
-//   <group>:<code>, for example "NGA:235" (Currently only code supported, used in GeoPackage)
-//
-// IMPORTANT NOTE: Image tie-points cannot be conveyed by a projection code. The projection
-// created here will not be fully initialized for use in rendering imagery.
-//**************************************************************************************************
-ossimProjection* ossimNgaProjectionFactory::createProjection(const ossimString& spec) const
-
-{
-   ossimProjection* proj = 0;
-   if ((!ossimString(spec).downcase().contains("nga")) && (spec.after(":").toInt() == 235))
-   {
-      const ossimEllipsoid* e = ossimEllipsoidFactory::instance()->create("WE");
-      proj = new ossimMercatorProjection(*e, ossimGpt(0,0), 0, 0, 0.857385503731176);
-   }
-
-   return proj;
-}
-
-/**
- * Take a keywordlist.
- */
-ossimProjection* ossimNgaProjectionFactory::createProjection(
-   const ossimKeywordlist& /* kwl */, const char* /* prefix */) const
-{
-   return 0;
-}
-
-ossimObject* ossimNgaProjectionFactory::createObject(
-      const ossimString& typeName) const
-{
-   return createProjection(typeName);
-}
-
-ossimObject* ossimNgaProjectionFactory::createObject(const ossimKeywordlist& kwl,
-      const char* prefix) const
-{
-   return createProjection(kwl, prefix);
-}
-
-void ossimNgaProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList) const
-{
-    typeList.push_back(ossimString("NGA:235 \"Scaled World Mercator\""));
-}
-
diff --git a/ossim/src/ossim/projection/ossimNitfProjectionFactory.cpp b/ossim/src/ossim/projection/ossimNitfProjectionFactory.cpp
deleted file mode 100644
index 1de7e75..0000000
--- a/ossim/src/ossim/projection/ossimNitfProjectionFactory.cpp
+++ /dev/null
@@ -1,992 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Description:
-//
-// Contains class definition for ossimNitfProjectionFactory.
-//
-// $Id: ossimNitfProjectionFactory.cpp 23672 2015-12-19 01:11:21Z gpotts $
-//----------------------------------------------------------------------------
-
-#include <ossim/projection/ossimNitfProjectionFactory.h>
-#include <ossim/base/ossimDms.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/imaging/ossimNitfTileSource.h>
-#include <ossim/projection/ossimBilinearProjection.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimMgrs.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/support_data/ossimNitfBlockaTag.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <fstream>
-#include <cmath>
-
-// Define Trace flags for use within this file:
-static ossimTrace traceDebug(ossimString("ossimNitfProjectionFactory:debug"));
-
-ossimNitfProjectionFactory* ossimNitfProjectionFactory::theInstance = 0;
-
-ossimNitfProjectionFactory::ossimNitfProjectionFactory()
-{
-}
-
-ossimNitfProjectionFactory::~ossimNitfProjectionFactory()
-{
-}
-
-ossimNitfProjectionFactory* ossimNitfProjectionFactory::instance()
-{
-   if(!theInstance)
-   {
-      theInstance = new ossimNitfProjectionFactory();
-   }
-
-   return theInstance;
-}
-
-ossimProjection*
-ossimNitfProjectionFactory::createProjection(const ossimFilename& filename,
-                                             ossim_uint32 entryIdx)const
-{
-   static const char MODULE[]="ossimNitfProjectionFactory::createProjection";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG:"
-         << "\nfilename:  " << filename
-         << "\nentryIdx:  " << entryIdx
-         << std::endl;
-   }
-
-   // See if there is an external geomtry.
-   ossimProjection* result = createProjectionFromGeometryFile(filename, entryIdx);
-   if (result)
-   {
-      return result;
-   }
-
-   if(!isNitf(filename))
-   {
-      return result; // result is NULL
-   }
-
-   ossimRefPtr<ossimNitfFile> nitf = new ossimNitfFile();
-   if (!nitf->parseFile(filename))
-   {
-      return result; // result is NULL
-   }
-
-   long imageIndex = static_cast<long>(entryIdx);
-   if ( imageIndex > (nitf->getHeader()->getNumberOfImages()-1) )
-   {
-      return result;
-   }
-
-   ossimRefPtr<ossimNitfImageHeader> imageHeader = nitf->getNewImageHeader(imageIndex);
-   {
-      if (!imageHeader)
-      {
-         return result;
-      }
-   }
-
-   result = createProjectionFromHeaders(nitf->getHeader(),
-                                        imageHeader.get());
-   if (traceDebug())
-   {
-      ossimString coordinateSystem   = imageHeader->getCoordinateSystem();
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG:"
-         << "\ncoordinateSysetm:       " << coordinateSystem
-         << std::endl;
-   }
-
-   return result;
-}
-
-
-ossimProjection*
-ossimNitfProjectionFactory::createProjection(const ossimKeywordlist& /* kwl */,
-                                             const char* /* prefix */) const
-{
-   return 0;
-}
-
-ossimProjection*
-ossimNitfProjectionFactory::createProjection(const ossimString& /* name */) const
-{
-   return 0;
-}
-
-ossimObject*
-ossimNitfProjectionFactory::createObject(const ossimString& typeName)const
-{
-   return (ossimObject*)createProjection(typeName);
-}
-
-ossimObject*
-ossimNitfProjectionFactory::createObject(const ossimKeywordlist& kwl,
-                                         const char* prefix)const
-{
-   return createProjection(kwl, prefix);
-}
-
-void ossimNitfProjectionFactory::getTypeNameList(std::vector<ossimString>& /* typeList */)const
-{
-   
-}
-
-ossimProjection* ossimNitfProjectionFactory::createProjection(ossimImageHandler* handler)const
-{
-   ossimNitfTileSource* nitfTileSource = dynamic_cast<ossimNitfTileSource*> (handler);
-   ossimProjection* result = 0;
-   if(nitfTileSource)
-   {
-      if(!result)
-      {
-         ossimNitfImageHeader* imageHeader = nitfTileSource->getCurrentImageHeader();
-         if(imageHeader)
-         {
-            result = createProjectionFromHeaders(nitfTileSource->getFileHeader(),imageHeader);
-         }
-      }
-   }
-   else if(isNitf(handler->getFilename()))
-   {
-      result =  createProjection(handler->getFilename(), handler->getCurrentEntry());
-   }
-   return result;
-}
-
-bool ossimNitfProjectionFactory::isNitf(const ossimFilename& filename)const
-{
-   std::ifstream in(filename.c_str(), ios::in|ios::binary);
-   
-   if(in)
-   {
-      char nitfFile[4];
-      in.read((char*)nitfFile, 4);
-      ossimString s(nitfFile, nitfFile+4);
-      if ( (s == "NITF") || (s == "NSIF") )
-      {
-         return true;
-      }
-   }
-
-   return false;
-}
-
-ossimProjection* ossimNitfProjectionFactory::createProjectionFromHeaders(
-   ossimNitfFileHeader* fileHeader, ossimNitfImageHeader* imageHeader)const
-{
-   ossimProjection* result = 0;
-   ossimString version = fileHeader->getVersion();
-   ossimString coordinateSystem = imageHeader->getCoordinateSystem();
-
-   // Note in version 2.0 ICORDS with 'N' == NONE.  In 2.1 it is UTM North:
-   if (coordinateSystem == "G" || coordinateSystem == "D")
-   {
-      result = makeGeographic(imageHeader, coordinateSystem);
-   }
-   else if( (coordinateSystem == "S") || (coordinateSystem == "U") || 
-            ( version != "02.00" && (coordinateSystem == "N") ) )
-   {
-      result = makeUtm(imageHeader, coordinateSystem);
-   }
-   return result;
-}
-
-ossimProjection* ossimNitfProjectionFactory::makeGeographic(
-   const ossimNitfImageHeader* hdr,
-   const ossimString& coordinateSysetm) const
-{
-   ossimProjection* proj = 0;
-
-   if (hdr)
-   {
-      // To hold corner points.
-      std::vector<ossimGpt> gpts;
-      
-      //---
-      // Get the corner points.
-      // 
-      // Look for points from the BLOCKA tag.  This may or may not be present.
-      // If present since it has six digit precision use it for the points.
-      //---
-      if ( getBlockaPoints(hdr, gpts) == false )
-      {
-         ossimString geographicLocation = hdr->getGeographicLocation();
-
-         if ( geographicLocation.size() )
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimNitfProjectionFactory::makeGeographic DEBUG:"
-                  << "\ngeographicLocation: " << geographicLocation
-                  << std::endl;
-            }
-            
-            if (coordinateSysetm == "G")
-            {
-               //---
-               // If coord system is G then format is:
-               // Lat = ddmmssX
-               //       where d is degrees and m is minutes
-               //       and s is seconds and X is either N (North) or S (South).
-               // Lon = dddmmssX
-               //       where d is degrees and m is minutes
-               //       and s is seconds and X is either N (North) or S (South).
-               //---
-               parseGeographicString(geographicLocation, gpts);
-            }
-            else if (coordinateSysetm == "D")
-            {
-               //---
-               // If coor system is D then format is:
-               // +-dd.ddd +-dd.ddd four times where + is northern hemispher and
-               // - is souther hemisphere for lat and longitude
-               // + is easting and - is westing.
-               //---
-               parseDecimalDegreesString(geographicLocation, gpts);
-            }
-            
-         } // matches: if ( geographicLocation.size() )
-         
-      } // matches: if ( getBlockaPoints(hdr, gpts) == false )
-         
-      if (gpts.size() == 4)
-      {   
-         ossimDpt scaleTest;
-         computeScaleInDecimalDegrees(hdr, gpts, scaleTest);
-
-         if (!isSkewed(gpts)&&(ossim::abs(scaleTest.y/scaleTest.x) <= 1.0))
-         {
-            proj = makeEuiDistant(hdr, gpts);
-         }
-         else
-         {
-            // Image is rotated.  Make a Bilinear.
-            proj = makeBilinear(hdr, gpts);
-         }
-      }
-
-      if (traceDebug() && proj)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfProjectionFactory::makeGeographic DEBUG:"
-            << "\nUpper left corner:   " << gpts[0]
-            << "\nUpper right corner:  " << gpts[1]
-            << "\nLower right corner:  " << gpts[2]
-            << "\nLower left corner:   " << gpts[3] << "\n";
-         proj->print( ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-      
-   } // matches: if (hdr)
-
-   return proj;
-}
-
-ossimProjection* ossimNitfProjectionFactory::makeUtm(
-   const ossimNitfImageHeader* hdr,
-   const ossimString& coordinateSystem) const
-{
-   ossimProjection* proj = 0;
-   bool isBilinear = false;
-   if (hdr)
-   {
-      ossimString geographicLocation = hdr->getGeographicLocation();
-
-      if ( geographicLocation.size() )
-      {
-         std::vector<ossimDpt> utmPoints;
-         ossim_uint32 zone;
-         ossimDpt scale;
-         char hemisphere = 'N';
-         
-         bool status = true;
-         if ( coordinateSystem == "U")
-         {
-            // Sets zone, hemisphere and utmPoints. Returns true on success.
-            status = parseMgrsString(geographicLocation, zone, hemisphere, utmPoints);
-         }
-         else
-         {
-            // Sets zone and utmPoints.  Void return...
-            parseUtmString(geographicLocation, zone, utmPoints);
-            if(coordinateSystem == "S")
-            {
-               hemisphere = 'S';
-            }
-         }
-         
-         if ( status )
-         {
-            if ( traceDebug() )
-            {
-               std::string s;
-               s.push_back(hemisphere);
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimNitfProjectionFactory::makeUtm DEBUG"
-                  << "\ngeo string: " << geographicLocation
-                  << "\nutm zone:   " << zone
-                  << "\nhemisphere: " << hemisphere
-                  << std::endl;
-               for (ossim_uint32 i=0; i<utmPoints.size(); ++i)
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << "utmPoints[" << utmPoints[i] << std::endl;
-               }
-            }
-            
-            ossimRefPtr<ossimUtmProjection> uproj = new ossimUtmProjection;
-            uproj->setHemisphere(hemisphere);
-            uproj->setZone(zone);
-            
-            if(isSkewed(utmPoints))
-            {
-               std::vector<ossimGpt> gpts;
-               
-               // Try blocka points first as they are more accurate.
-               if ( getBlockaPoints(hdr, gpts) == false )
-               {
-                  ossimGpt ul = uproj->inverse(utmPoints[0]);
-                  ossimGpt ur = uproj->inverse(utmPoints[1]);
-                  ossimGpt lr = uproj->inverse(utmPoints[2]);
-                  ossimGpt ll = uproj->inverse(utmPoints[3]);
-                  gpts.push_back(ul);
-                  gpts.push_back(ur);
-                  gpts.push_back(lr);
-                  gpts.push_back(ll);
-               }
-
-               //---
-               // Make a bilinear either from our skewed utm points or the points from the blocka
-               // tag.
-               //---
-               proj = makeBilinear(hdr, gpts);
-               if(proj) scale = proj->getMetersPerPixel();
-               isBilinear = true;
-               uproj = 0; // Done with utm projeciton
-               
-            }
-            else
-            {
-               computeScaleInMeters(hdr, utmPoints, scale);
-               
-               //---
-               // Assign our projection to the return "proj".
-               // Use ossimRefPtr::release the so we don't delete proj when uproj
-               // goes out of scope.
-               //---
-               proj = uproj.release(); 
-            }
-            
-            if( (scale.hasNans() == false)&&(!isBilinear) )
-            {
-               //---
-               // Get the tie point.
-               // 
-               // Look for the the BLOCKA tag which may or may not be present.
-               // This has six digit precision in decimal degrees which equates to
-               // about 0.11 meters (at equator) as compared to 1.0 accuaracy of the
-               // IGEOLO field.
-               //---
-               ossimDpt tie;
-               std::vector<ossimGpt> gpts;
-               if ( getBlockaPoints(hdr, gpts) )
-               {
-                  if (traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_DEBUG)
-                        << "ossimNitfProjectionFactory::makeUtm DEBUG:"
-                        << "\nTie point from blocka: " << gpts[0]
-                        << endl;
-                  }
-                  
-                  tie = proj->forward(gpts[0]);
-                  tie.x += scale.x/2.0;
-                  tie.y -= scale.y/2.0;
-               }
-               else
-               {
-                  tie.x = utmPoints[0].x + scale.x/2.0;
-                  tie.y = utmPoints[0].y - scale.y/2.0;
-               }
-               
-               if (traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << "ossimNitfProjectionFactory::makeUtm DEBUG:"
-                     << "\nTie point: " << tie
-                     << "\nScale:     " << scale
-                     << endl;
-               }
-               
-               // Set the tie and scale.
-               ossimMapProjection* mproj = dynamic_cast<ossimMapProjection*>(proj);
-               if ( mproj )
-               {
-                  mproj->setUlEastingNorthing(tie);
-                  mproj->setMetersPerPixel(scale);
-               }
-               else // cannot cast
-               {
-                  if ( proj )
-                  {
-                     delete proj;
-                     proj = 0;
-                  }
-               }
-            }
-            else if(isBilinear)
-            {
-               // blank
-            }
-            else // Scale has nans
-            {
-               if ( proj )
-               {
-                  delete proj;
-                  proj = 0;
-               }
-            }
-            
-         } // matches: if (status)
-
-      } // matches:  if ( geographicLocation.size() )
-         
-   } // matches: if (hdr)
-   
-   return proj;
-}
-
-bool ossimNitfProjectionFactory::parseMgrsString(const ossimString& mgrsLocationString,
-                                                 ossim_uint32& zone,
-                                                 char& hemisphere,
-                                                 std::vector<ossimDpt>& utmPoints)const
-{
-   bool result = false; // Start false.
-   
-   //---
-   // From spec:
-   // UTM expressed in MGRS use the format zzBJKeeeeennnnn (15 characters).
-   // Assumption Zone and hemisphere same for all corners.
-   //---
-   if ( mgrsLocationString.size() >= 60 )
-   {
-      // Split the location string into four separate ones.
-      std::vector<std::string> mgrsStr(4); // Corner strings.
-      mgrsStr[0] = mgrsLocationString.substr(0, 15);
-      mgrsStr[1] = mgrsLocationString.substr(15, 15);
-      mgrsStr[2] = mgrsLocationString.substr(30, 15);
-      mgrsStr[3] = mgrsLocationString.substr(45, 15);
-      
-      utmPoints.resize(4);
-      long z = 0;
-      ossim_float64 e=0.0;
-      ossim_float64 n=0.0;
-      
-      result = true; // Set to true.
-
-
-      //---
-      // Convert each string to Easting Northing.  This also sets zone hemisphere.
-      // Method takes long for zone.
-      //---
-      for (ossim_uint32 i = 0; i < 4; ++i)
-      {
-         if ( Convert_OSSIM_MGRS_To_UTM(mgrsStr[i].c_str(), &z, &hemisphere, &e, &n) == 0 )
-         {
-            utmPoints[i].x = e;
-            utmPoints[i].y = n;
-         }
-         else
-         {
-            result = false; // Geotrans code errored on string.
-            break;
-         }
-      }
-      if (result) zone = static_cast<ossim_uint32>(z); // Set the zone.
-   }
-
-   return result;
-}
-
-ossimProjection* ossimNitfProjectionFactory::makeEuiDistant(
-   const ossimNitfImageHeader* hdr,
-   const std::vector<ossimGpt>& gpts) const
-{
-   ossimEquDistCylProjection* proj = 0;
-
-   // Get the scale.
-   ossimDpt scale;
-   computeScaleInDecimalDegrees(hdr, gpts, scale);
-
-   if (scale.hasNans())
-   {
-      return proj;
-   }
-   // Make the projection.
-   proj = new ossimEquDistCylProjection();
-
-   if ( scale.x )
-   {
-      ossimGpt origin = proj->getOrigin();
-
-      //---
-      // ossimEquDistCylProjection uses the origin_latitude for meters per pixel (gsd)
-      // computation.  So is not set in tiff tags, compute to achieve the proper
-      // horizontal scaling.
-      //---
-      origin.lat = ossim::acosd(scale.y/scale.x);
-
-      proj->setOrigin(origin);
-   }
-
-   // Shift the tie to the center of the pixel.
-   ossimGpt tiePoint;
-   tiePoint.latd(gpts[0].latd() - (scale.y/2.0));
-   tiePoint.lond(gpts[0].lond() + (scale.x/2.0));
-
-   // Set the tie points.
-   proj->setUlTiePoints(tiePoint);
-
-   // Set the scale.
-   proj->setDecimalDegreesPerPixel(scale);
-
-   return proj;
-}
-
-ossimProjection* ossimNitfProjectionFactory::makeBilinear(
-   const ossimNitfImageHeader* hdr,
-   const std::vector<ossimGpt>& gpts) const
-{
-   double rows = hdr->getNumberOfRows();
-   double cols = hdr->getNumberOfCols();
-   
-   ossimDpt ul(0.0, 0.0);
-   ossimDpt ur(cols-1.0, 0.0);   
-   ossimDpt lr(cols-1.0, rows-1.0);
-   ossimDpt ll(0.0, rows-1.0);
-
-   ossimRefPtr<ossimBilinearProjection> proj;
-   try
-   {
-     proj = new ossimBilinearProjection(ul,
-                                      ur,
-                                      lr,
-                                      ll,
-                                      gpts[0],
-                                      gpts[1],
-                                      gpts[2],
-                                      gpts[3]);
-   }
-   catch(...)
-   {
-      proj = 0;
-   }
-   
-   return proj.release();
-}
-
-bool ossimNitfProjectionFactory::isSkewed(
-   const std::vector<ossimGpt>& gpts) const
-{
-
-   return !( (gpts[0].latd() == gpts[1].latd()) &&
-             (gpts[2].latd() == gpts[3].latd()) &&
-             (gpts[0].lond() == gpts[3].lond()) &&
-             (gpts[1].lond() == gpts[2].lond()) );
-   
-}
-
-bool ossimNitfProjectionFactory::isSkewed(
-   const std::vector<ossimDpt>& dpts) const
-{
-   return !( (dpts[0].y == dpts[1].y) &&
-             (dpts[2].y == dpts[3].y) &&
-             (dpts[0].x == dpts[3].x) &&
-             (dpts[1].x == dpts[2].x) );
-   
-}
-
-bool ossimNitfProjectionFactory::getBlockaPoints(
-   const ossimNitfImageHeader* hdr,
-   std::vector<ossimGpt>& gpts) const
-{
-   if (!hdr)
-   {
-      return false;
-   }
-
-   ossimRefPtr<ossimNitfRegisteredTag> tag =
-      hdr->getTagData(ossimString("BLOCKA"));
-
-   if (!tag)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfProjectionFactory::getBlockaPoints DEBUG:"
-            << "\nBLOCKA tag not found."
-            << std::endl;
-      }
-      return false;
-   }
-
-   if (gpts.size())
-   {
-      gpts.clear();
-   }
-
-   ossimNitfBlockaTag* blockaTag = PTR_CAST(ossimNitfBlockaTag, tag.get());
-   if (!blockaTag)
-   {
-      return false;
-   }
-
-   ossimDpt dpt;
-   ossimGpt gpt;
-
-   // Get the upper left or first row first column.
-   blockaTag->getFrfcLoc(dpt);
-   gpt.latd(dpt.y);
-   gpt.lond(dpt.x);
-   gpts.push_back(gpt);
-
-   // Get the upper right or first row last column.
-   blockaTag->getFrlcLoc(dpt);
-   gpt.latd(dpt.y);
-   gpt.lond(dpt.x);
-   gpts.push_back(gpt);
-
-   // Get the lower right or last row last column.
-   blockaTag->getLrlcLoc(dpt);
-   gpt.latd(dpt.y);
-   gpt.lond(dpt.x);
-   gpts.push_back(gpt);
-
-   // Get the lower left or last row first column.
-   blockaTag->getLrfcLoc(dpt);
-   gpt.latd(dpt.y);
-   gpt.lond(dpt.x);
-   gpts.push_back(gpt);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfProjectionFactory::getBlockaPoints DEBUG:"
-         << std::endl;
-      for (int i=0; i<4; ++i)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "gpt[" << i << "] " << gpts[i] << std::endl;
-      }
-   }
-   
-   return true;
-}
-
-void ossimNitfProjectionFactory::computeScaleInDecimalDegrees(
-   const ossimNitfImageHeader* hdr,
-   const std::vector<ossimGpt>& gpts,
-   ossimDpt& scale) const
-{
-   if ( !hdr || isSkewed(gpts))
-   {
-      scale.makeNan();
-      return;
-   }
-   ossimIrect imageRect = hdr->getImageRect();
-
-   //---
-   // Calculate the scale.  This assumes that the corner points are for the
-   // edge of the corner pixels, not the center of the corner pixels.
-   //---
-   double longitudeSize  = 0.0;
-   double latitudeSize = 0.0;
-   if ( (gpts[1].lond() < 0.0) && (gpts[0].lond() >= 0) )
-   {
-      //---
-      // Upper right negative(Western), upper left positive (Eastern).
-      // Crossing date line maybe???
-      //---
-      longitudeSize = (gpts[1].lond() + 360.0) - gpts[0].lond();
-   }
-   else
-   {
-      longitudeSize = gpts[1].lond() - gpts[0].lond();
-   }
-
-   latitudeSize = gpts[0].latd() - gpts[2].latd();
-
-   double rows = imageRect.height();
-   double cols = imageRect.width();
-//   double rows = hdr->getNumberOfRows();
-//   double cols = hdr->getNumberOfCols();
-       
-   if (!rows || !cols)
-   {
-      scale.makeNan();
-      return;
-   }
-   scale.y = latitudeSize  / rows;
-   scale.x = longitudeSize / cols;
-}
-
-void ossimNitfProjectionFactory::computeScaleInMeters(
-   const ossimNitfImageHeader* hdr,
-   const std::vector<ossimDpt>& dpts,
-   ossimDpt& scale) const
-{
-   if ( !hdr || isSkewed(dpts))
-   {
-      scale.makeNan();
-      return;
-   }
-   ossimIrect imageRect = hdr->getImageRect();
-
-   //---
-   // Calculate the scale.  This assumes that the corner points are for the
-   // edge of the corner pixels, not the center of the corner pixels.
-   //---
-   double eastingSize  = 0.0;
-   double northingSize = 0.0;
-   
-   eastingSize  = fabs(dpts[1].x - dpts[0].x);
-   northingSize = fabs(dpts[0].y - dpts[3].y);
-
-   double rows = imageRect.height();//hdr->getNumberOfRows();
-   double cols = imageRect.width();//hdr->getNumberOfCols();
-
-   if (!rows || !cols)
-   {
-      scale.makeNan();
-      return;
-   }
-   scale.y = northingSize / rows;
-   scale.x = eastingSize  / cols;
-}
-
-void ossimNitfProjectionFactory::parseUtmString(const ossimString& utmLocation,
-                                                ossim_uint32& zone,
-                                                std::vector<ossimDpt>& utmPoints)const
-{
-   ossim_uint32 idx = 0;
-   ossimString z;
-   ossimString east;
-   ossimString north;
-
-   
-   z    = ossimString(utmLocation.begin() + idx,
-                   utmLocation.begin() + idx + 2);
-   idx += 2;
-   east = ossimString(utmLocation.begin() + idx,
-                      utmLocation.begin() + idx + 6);
-   idx += 6;
-   north = ossimString(utmLocation.begin() + idx,
-                       utmLocation.begin() + idx + 7);
-   idx += 7;
-
-   utmPoints.push_back(ossimDpt(east.toDouble(),
-                                north.toDouble()));
-   
-   z    = ossimString(utmLocation.begin() + idx,
-                   utmLocation.begin() + idx + 2);
-   idx += 2;
-   east = ossimString(utmLocation.begin() + idx,
-                      utmLocation.begin() + idx + 6);
-   idx += 6;
-   north = ossimString(utmLocation.begin() + idx,
-                       utmLocation.begin() + idx + 7);
-   idx += 7;
-   utmPoints.push_back(ossimDpt(east.toDouble(),
-                                north.toDouble()));
-
-   z    = ossimString(utmLocation.begin() + idx,
-                   utmLocation.begin() + idx + 2);
-   idx += 2;
-   east = ossimString(utmLocation.begin() + idx,
-                      utmLocation.begin() + idx + 6);
-   idx += 6;
-   north = ossimString(utmLocation.begin() + idx,
-                       utmLocation.begin() + idx + 7);
-   idx += 7;
-   utmPoints.push_back(ossimDpt(east.toDouble(),
-                                north.toDouble()));
-
-   z    = ossimString(utmLocation.begin() + idx,
-                   utmLocation.begin() + idx + 2);
-   idx += 2;
-   east = ossimString(utmLocation.begin() + idx,
-                      utmLocation.begin() + idx + 6);
-   idx += 6;
-   north = ossimString(utmLocation.begin() + idx,
-                       utmLocation.begin() + idx + 7);
-   idx += 7;
-   utmPoints.push_back(ossimDpt(east.toDouble(),
-                                north.toDouble()));
-
-   zone = z.toUInt32();
-}
-
-
-void ossimNitfProjectionFactory::parseGeographicString(
-   const ossimString& geographicLocation, std::vector<ossimGpt>& gpts) const
-{
-   gpts.clear();
-   
-   if (geographicLocation.size() != 60)
-   {
-      return;
-   }
-
-   std::string::size_type geo_index = 0;
-   for (int i=0; i<4; ++i)
-   {
-      //---
-      // We have to split up the geographicLocation string for the dms class.
-      // 
-      // geographicLocation = ddmmssXdddmmssX (four times).
-      // "dd mm ss X" has a string length of 10
-      // "ddd mm ss X" has a string length of 11
-      //---
-      std::string::size_type lat_index = 0;
-      std::string::size_type lon_index = 0;
-      const char SPACE = ' ';
-      ossimString latString(10, SPACE);
-      ossimString lonString(11, SPACE);
-
-      // degrees latitude
-      latString[lat_index++] = geographicLocation[geo_index++];
-      latString[lat_index++] = geographicLocation[geo_index++];
-      ++lat_index;
-
-      // minutes latitude
-      latString[lat_index++] = geographicLocation[geo_index++];
-      latString[lat_index++] = geographicLocation[geo_index++];
-      ++lat_index;
-      
-      // seconds latitude
-      latString[lat_index++] = geographicLocation[geo_index++];
-      latString[lat_index++] = geographicLocation[geo_index++];
-      ++lat_index;
-
-      // hemisphere
-      latString[lat_index++] = geographicLocation[geo_index++];
- 
-      // degrees longitude
-      lonString[lon_index++] = geographicLocation[geo_index++];
-      lonString[lon_index++] = geographicLocation[geo_index++];
-      lonString[lon_index++] = geographicLocation[geo_index++];
-      ++lon_index;
-
-      // minutes longitude
-      lonString[lon_index++] = geographicLocation[geo_index++];
-      lonString[lon_index++] = geographicLocation[geo_index++];
-      ++lon_index;
-
-      // seconds longitude
-      lonString[lon_index++] = geographicLocation[geo_index++];
-      lonString[lon_index++] = geographicLocation[geo_index++];
-      ++lon_index;
-
-      // hemisphere
-      lonString[lon_index++] = geographicLocation[geo_index++];
-
-      // Convert to decimal degrees using the dms class.
-      ossimGpt gpt;
-      ossimDms dms(0.0);
-      dms.setLatFlag(true);
-      if ( ! dms.setDegrees(latString.c_str()) )
-      {
-         gpts.clear();
-         return;
-      }
-      gpt.latd(dms.getDegrees());
-
-      dms.setLatFlag(false);
-      if ( ! dms.setDegrees(lonString.c_str()) )
-      {
-         gpts.clear();
-         return;
-      }
-      gpt.lond(dms.getDegrees());
-
-      gpts.push_back(gpt);
-
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfProjectionFactory::parseGeographicString DEBUG:"
-            << "\nground point[" << i << "]:  " << gpt
-            << std::endl;
-      }
-   }
-}
-
-void ossimNitfProjectionFactory::parseDecimalDegreesString(const ossimString& geographicLocation,
-                                                           std::vector<ossimGpt>& gpts) const
-{
-   const char* bufPtr = geographicLocation.c_str();
-
-   
-   ossimString ulLat(bufPtr,
-                     bufPtr + 7);
-   bufPtr+=7;
-   ossimString ulLon(bufPtr,
-                     bufPtr+8);
-   bufPtr+=8;
-   ossimString urLat(bufPtr,
-                     bufPtr + 7);
-   bufPtr+=7;
-   ossimString urLon(bufPtr,
-                     bufPtr+8);
-   bufPtr+=8;
-   ossimString lrLat(bufPtr,
-                     bufPtr + 7);
-   bufPtr+=7;
-   ossimString lrLon(bufPtr,
-                     bufPtr+8);
-   bufPtr+=8;
-   ossimString llLat(bufPtr,
-                     bufPtr + 7);
-   bufPtr+=7;
-   ossimString llLon(bufPtr,
-                     bufPtr+8);
-
-   gpts.push_back(ossimGpt(ulLat.toDouble(), ulLon.toDouble()));
-   gpts.push_back(ossimGpt(urLat.toDouble(), urLon.toDouble()));
-   gpts.push_back(ossimGpt(lrLat.toDouble(), lrLon.toDouble()));
-   gpts.push_back(ossimGpt(llLat.toDouble(), llLon.toDouble()));
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfProjectionFactory::parseDecimalDegreesString DEBUG:"
-         << "\nground point[" << 0 << "]:  " << gpts[0]
-         << "\nground point[" << 1 << "]:  " << gpts[1]
-         << "\nground point[" << 2 << "]:  " << gpts[2]
-         << "\nground point[" << 3 << "]:  " << gpts[3]
-         << std::endl;
-   }
-}
-
-ossimNitfProjectionFactory::ossimNitfProjectionFactory(const ossimNitfProjectionFactory&)
-{
-}
-
-ossimNitfProjectionFactory& ossimNitfProjectionFactory::operator=(const ossimNitfProjectionFactory&)
-{
-   return *this;
-}
diff --git a/ossim/src/ossim/projection/ossimNitfRpcModel.cpp b/ossim/src/ossim/projection/ossimNitfRpcModel.cpp
deleted file mode 100644
index 24e79d7..0000000
--- a/ossim/src/ossim/projection/ossimNitfRpcModel.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-//*****************************************************************************
-// FILE: ossimNitfRpcModel.cc
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class ossimNitfRpcModel. This 
-//    derived class implements the capability of reading Nitf RPC support
-//    data.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimNitfRpcModel.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/projection/ossimNitfRpcModel.h>
-
-RTTI_DEF1(ossimNitfRpcModel, "ossimNitfRpcModel", ossimRpcModel);
-
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/support_data/ossimNitfUse00aTag.h>
-#include <ossim/support_data/ossimNitfPiaimcTag.h>
-#include <ossim/support_data/ossimNitfStdidcTag.h>
-#include <ossim/support_data/ossimNitfRpcBase.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimNitfRpcModel:exec");
-static ossimTrace traceDebug ("ossimNitfRpcModel:debug");
-
-static const char* RPC00A_TAG = "RPC00A";
-static const char* RPC00B_TAG = "RPC00B";
-static const char* PIAIMC_TAG = "PIAIMC";
-static const char* STDIDC_TAG = "STDIDC";
-static const char* USE00A_TAG = "USE00A";
-
-ossimNitfRpcModel::ossimNitfRpcModel()
-   :
-   ossimRpcModel(),
-   theDecimation(1.0)
-{
-}
-
-ossimNitfRpcModel::ossimNitfRpcModel(const ossimNitfRpcModel& rhs)
-  :
-   ossimRpcModel(rhs),
-   theDecimation(1.0)
-{
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimNitfRpcModel
-//  
-//  Constructs given filename for NITF file
-//  
-//*****************************************************************************
-ossimNitfRpcModel::ossimNitfRpcModel(const ossimFilename& nitfFile)
-   :
-   ossimRpcModel(),
-   theDecimation(1.0)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): entering..."
-         << std::endl;
-   }
-   if(!parseFile(nitfFile))
-   {
-      if (traceExec())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): Unable to parse file " << nitfFile
-            << std::endl;
-      }
-      ++theErrorStatus;
-   }
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): returning..."
-         << std::endl;
-   }
-}
-
-ossimObject* ossimNitfRpcModel::dup() const
-{
-   return new ossimNitfRpcModel(*this);
-}
-
-bool ossimNitfRpcModel::parseFile(const ossimFilename& nitfFile,
-                                  ossim_uint32 entryIndex)
-{
-   ossimRefPtr<ossimNitfFile> file = new ossimNitfFile;
-
-   if(!file->parseFile(nitfFile))
-   {
-      setErrorStatus();
-      return false;
-   }
-   
-   ossimRefPtr<ossimNitfImageHeader> ih = file->getNewImageHeader(entryIndex);
-   if(!ih)
-   {
-      setErrorStatus();
-      return false;
-   }
-
-   return parseImageHeader(ih.get());
-   
-}
-
-bool ossimNitfRpcModel::parseImageHeader(const ossimNitfImageHeader* ih)
-{
-   // Do this first so we don't waste time if not rpc image.
-   if (getRpcData(ih) == false)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfRpcModel::parseFile DEBUG:"
-         << "\nError parsing rpc tags.  Aborting with error."
-         << std::endl;
-      }
-      setErrorStatus();
-      return false;
-   }
-   
-   
-   //---
-   // Get the decimation if any from the header "IMAG" field.
-   // 
-   // Look for string like:
-   // "/2" = 1/2
-   // "/4  = 1/4
-   // ...
-   // "/16 = 1/16
-   // If it is full resolution it should be "1.0"
-   //---
-   ossimString os = ih->getImageMagnification();
-   if ( os.contains("/") )
-   {
-      os = os.after("/");
-      ossim_float64 d = os.toFloat64();
-      if (d)
-      {
-         theDecimation = 1.0 / d;
-      }
-   }
-   
-   //***
-   // Fetch Image ID:
-   //***
-   theImageID = ih->getImageId();
-   
-   ossimIrect imageRect = ih->getImageRect();
-   
-   //---
-   // Fetch Image Size:
-   //---
-   theImageSize.line =
-   static_cast<ossim_int32>(imageRect.height() / theDecimation);
-   theImageSize.samp =
-   static_cast<ossim_int32>(imageRect.width() / theDecimation);
-   
-   // Search for the STDID Tag to fetch mission (satellite) name:
-   getSensorID(ih);
-   
-   //***
-   // Assign other data members:
-   //***
-   theRefImgPt.line = theImageSize.line/2.0;
-   theRefImgPt.samp = theImageSize.samp/2.0;
-   theRefGndPt.lat  = theLatOffset;
-   theRefGndPt.lon  = theLonOffset;
-   theRefGndPt.hgt  = theHgtOffset;
-   
-   //***
-   // Assign the bounding image space rectangle:
-   //***
-   theImageClipRect = ossimDrect(0.0, 0.0,
-                                 theImageSize.samp-1, theImageSize.line-1);
-   
-   //---
-   // Assign the bounding ground polygon:
-   //
-   // NOTE:  We will use the base ossimRpcModel for transformation since all
-   // of our calls are in full image space (not decimated).
-   //---
-   ossimGpt v0, v1, v2, v3;
-   ossimDpt ip0 (0.0, 0.0);
-   ossimRpcModel::lineSampleHeightToWorld(ip0, theHgtOffset, v0);
-   ossimDpt ip1 (theImageSize.samp-1.0, 0.0);
-   ossimRpcModel::lineSampleHeightToWorld(ip1, theHgtOffset, v1);
-   ossimDpt ip2 (theImageSize.samp-1.0, theImageSize.line-1.0);
-   ossimRpcModel::lineSampleHeightToWorld(ip2, theHgtOffset, v2);
-   ossimDpt ip3 (0.0, theImageSize.line-1.0);
-   ossimRpcModel::lineSampleHeightToWorld(ip3, theHgtOffset, v3);
-   
-   theBoundGndPolygon
-   = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
-   
-   updateModel();
-   
-   // Set the ground reference point.
-   ossimRpcModel::lineSampleHeightToWorld(theRefImgPt,
-                                          theHgtOffset,
-                                          theRefGndPt);
-   if ( theRefGndPt.isLatNan() || theRefGndPt.isLonNan() )
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:"
-         << "\nGround Reference Point not valid." 
-         << " Aborting with error..."
-         << std::endl;
-      }
-      setErrorStatus();
-      return false;
-   }
-   
-   //---
-   // This will set theGSD and theMeanGSD.  This model doesn't need these but
-   // others do.
-   //---
-   try
-   {
-      computeGsd();
-   }
-   catch (const ossimException& e)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:\n"
-         << e.what() << std::endl;
-      }
-   }
-   
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG ossimNitfRpcModel::parseFile: returning..."
-      << std::endl;
-   }
-   
-   return true;
-}
-
-void ossimNitfRpcModel::worldToLineSample(const ossimGpt& world_point,
-                                          ossimDpt&       image_point) const
-{
-   // Get the full res (not decimated) point.
-   ossimRpcModel::worldToLineSample(world_point, image_point);
-
-   // Apply decimation.
-   image_point.x = image_point.x * theDecimation;
-   image_point.y = image_point.y * theDecimation;
-}
-
-void ossimNitfRpcModel::lineSampleHeightToWorld(
-   const ossimDpt& image_point,
-   const double&   heightEllipsoid,
-   ossimGpt&       worldPoint) const
-{
-   // Convert image point to full res (not decimated) point.
-   ossimDpt pt;
-   pt.x = image_point.x / theDecimation;
-   pt.y = image_point.y / theDecimation;
-
-   // Call base...
-   ossimRpcModel::lineSampleHeightToWorld(pt, heightEllipsoid, worldPoint);
-}
-
-bool ossimNitfRpcModel::saveState(ossimKeywordlist& kwl,
-                                  const char* prefix) const
-{
-   // Save the decimation.
-   kwl.add(prefix, "decimation", theDecimation);
-
-   // Call base.
-   return ossimRpcModel::saveState(kwl, prefix);
-}
-
-bool ossimNitfRpcModel::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix)
-{
-   // Lookup decimation.
-   const char* value = kwl.find(prefix, "decimation");
-   if (value)
-   {
-      theDecimation = ossimString(value).toFloat64();
-      if (theDecimation <= 0.0)
-      {
-         // Do not allow negative or "0.0"(divide by zero).
-         theDecimation = 1.0;
-      }
-   }
-
-   // Call base.
-   return ossimRpcModel::loadState(kwl, prefix);
-}
-
-void ossimNitfRpcModel::getGsd(const ossimNitfImageHeader* ih)
-{
-   theGSD.line = ossim::nan();
-   theGSD.samp = ossim::nan();
-
-   if (!ih)
-   {
-      return;
-   }
-   
-   ossimRefPtr<ossimNitfRegisteredTag> tag;
-   tag = ih->getTagData(PIAIMC_TAG);
-   if (tag.valid())
-   {
-      ossimNitfPiaimcTag* p = PTR_CAST(ossimNitfPiaimcTag, tag.get());
-      if (p)
-      {
-         theGSD.line = p->getMeanGsdInMeters();
-         theGSD.samp = theGSD.line;
-         return;
-      }
-   }
-
-   tag = ih->getTagData(USE00A_TAG);
-   if (tag.valid())
-   {
-      ossimNitfUse00aTag* p = PTR_CAST(ossimNitfUse00aTag, tag.get());
-      if (p)
-      {
-         theGSD.line = p->getMeanGsdInMeters();
-         theGSD.samp = theGSD.line;
-      }
-   }
-}
-
-void ossimNitfRpcModel::getSensorID(const ossimNitfImageHeader* ih)
-{
-   theSensorID = "UNKNOWN";
-
-   if (!ih)
-   {
-      return;
-   }
-   
-   ossimRefPtr<ossimNitfRegisteredTag> tag;
-   tag = ih->getTagData(STDIDC_TAG);
-   if (tag.valid())
-   {
-      ossimNitfStdidcTag* p = PTR_CAST(ossimNitfStdidcTag, tag.get());
-      if (p)
-      {
-         theSensorID = p->getMission();
-         return;
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcModel::getSensorID DEBUG:"
-            << "\ntheSensorID set to: " << theSensorID << endl;
-   }
-}
-
-bool ossimNitfRpcModel::getRpcData(const ossimNitfImageHeader* ih)
-{
-   if (!ih)
-   {
-      return false;
-   }
-
-   // Get the the RPC tag:
-   ossimNitfRpcBase* rpcTag = 0;
-
-   // Look for the RPC00B tag first.
-   ossimRefPtr<ossimNitfRegisteredTag> tag = ih->getTagData(RPC00B_TAG);
-   if (tag.valid())
-   {
-      rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
-   }
-
-   if (!rpcTag)
-   {
-      // Look for RPC00A tag.
-      tag = ih->getTagData(RPC00A_TAG);
-      if (tag.valid())
-      {
-         rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
-      }
-   }
-
-   if (!rpcTag)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcModel::getRpcData DEBUG:"
-            << "\nCould not find neither RPC tags <" << RPC00A_TAG
-            << "> nor <" << RPC00B_TAG
-            << "\nAborting with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   if ( rpcTag->getSuccess() == false )
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcModel::getRpcData DEBUG:"
-            << "\nSuccess flag set to false."
-            << "\nAborting with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Set the polynomial type.
-   if (rpcTag->getRegisterTagName() == "RPC00B")
-   {
-      thePolyType = B;
-   }
-   else
-   {
-      thePolyType = A;
-   }
-   
-   // Now parse the tag block for pertinent data:
-   theBiasError  = rpcTag->getErrorBias().toFloat64();
-   theRandError  = rpcTag->getErrorRand().toFloat64();
-   theLineOffset = rpcTag->getLineOffset().toFloat64();
-   theSampOffset = rpcTag->getSampleOffset().toFloat64();
-   theLatOffset  = rpcTag->getGeodeticLatOffset().toFloat64();
-   theLonOffset  = rpcTag->getGeodeticLonOffset().toFloat64();
-   theHgtOffset  = rpcTag->getGeodeticHeightOffset().toFloat64();
-   theLineScale  = rpcTag->getLineScale().toFloat64();
-   theSampScale  = rpcTag->getSampleScale().toFloat64();
-   theLatScale   = rpcTag->getGeodeticLatScale().toFloat64();
-   theLonScale   = rpcTag->getGeodeticLonScale().toFloat64();
-   theHgtScale   = rpcTag->getGeodeticHeightScale().toFloat64();
-
-   // Parse coefficients:
-   ossim_uint32 i;
-   
-   for (i=0; i<20; ++i)
-   {
-      theLineNumCoef[i] = rpcTag->getLineNumeratorCoeff(i).toFloat64();
-      theLineDenCoef[i] = rpcTag->getLineDenominatorCoeff(i).toFloat64();
-      theSampNumCoef[i] = rpcTag->getSampleNumeratorCoeff(i).toFloat64();
-      theSampDenCoef[i] = rpcTag->getSampleDenominatorCoeff(i).toFloat64();
-   }
-   
-   // Assign other data members to default values:
-   theNominalPosError = sqrt(theBiasError*theBiasError +
-                             theRandError*theRandError); // meters
-
-   return true;
-}
-
diff --git a/ossim/src/ossim/projection/ossimNitfRsmModel.cpp b/ossim/src/ossim/projection/ossimNitfRsmModel.cpp
deleted file mode 100644
index 9d70287..0000000
--- a/ossim/src/ossim/projection/ossimNitfRsmModel.cpp
+++ /dev/null
@@ -1,491 +0,0 @@
- //---
-// File: ossimNitfRsmModel.cpp
-//
-//  RP 
-//  LIMITATIONS - This is supporting only the RSM features that have been
-//  observed in current data samples and does not attempt to support the entire
-//  RSM specification.
-//  Examples of currently unsupported items include ->
-//  1.  multiple RSMPC tags for different polynomials for separate image sections 
-//  2.  Error Covariance (this may gain priority as we have access to RSMECA data)
-//  3.  Illumination model
-//  4.  Rectangular coodinate system conversion (RSDIDA GRNDD = "R")
-//---
-
-#include <ossim/projection/ossimNitfRsmModel.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/support_data/ossimNitfRsmecaTag.h>
-#include <ossim/support_data/ossimNitfRsmidaTag.h>
-#include <ossim/support_data/ossimNitfRsmpcaTag.h>
-#include <ossim/support_data/ossimNitfRsmpiaTag.h>
-
-
-RTTI_DEF1(ossimNitfRsmModel, "ossimNitfRsmModel", ossimRsmModel);
-
-//---
-// Define Trace flags for use within this file:
-//---
-
-static ossimTrace traceExec  ("ossimNitfRsmModel:exec");
-static ossimTrace traceDebug ("ossimNitfRsmModel:debug");
-
-
-
-ossimNitfRsmModel::ossimNitfRsmModel()
-   :  ossimRsmModel()
-{
-}
-
-ossimNitfRsmModel::ossimNitfRsmModel( const ossimNitfRsmModel& obj )
-   : ossimRsmModel(obj)
-{
-}
-
-const ossimNitfRsmModel& ossimNitfRsmModel::operator=( const ossimNitfRsmModel& rhs )
-{
-   if (this != &rhs)
-   {
-      ossimRsmModel::operator=(rhs);
-   }
-   return *this;
-}
-
-ossimNitfRsmModel::~ossimNitfRsmModel()
-{
-}
-
-bool ossimNitfRsmModel::parseFile( const ossimFilename& nitfFile,
-                                   ossim_uint32 entryIndex )
-{
-   ossimRefPtr<ossimNitfFile> file = new ossimNitfFile;
-   
-   if(!file->parseFile(nitfFile))
-   {
-      setErrorStatus();
-      return false;
-   }
-   
-   ossimRefPtr<ossimNitfImageHeader> ih = file->getNewImageHeader(entryIndex);
-   if(!ih)
-   {
-      setErrorStatus();
-      return false;
-   }
-   
-   return parseImageHeader(ih.get());
-
-}
-
-bool ossimNitfRsmModel::parseImageHeader(const ossimNitfImageHeader* ih)
-{
-   static const char MODULE[] = "ossimNitfRsmModel::getRsmData";
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering..." << std::endl;
-   }
-
-   bool status = false;
-
-   if ( getRsmData(ih) )
-   {
-      theImageID = m_iid.trim();
-      
-      ossimIrect imageRect = ih->getImageRect();
-      
-      // Fetch Image Size:
-      theImageSize.line = static_cast<ossim_int32>(imageRect.height());
-      theImageSize.samp = static_cast<ossim_int32>(imageRect.width());
-      
-      // Assign other data members:
-      theRefImgPt.line = theImageSize.line/2.0;
-      theRefImgPt.samp = theImageSize.samp/2.0;
-      
-      // Assign the bounding image space rectangle:
-      theImageClipRect = ossimDrect(0.0, 0.0, theImageSize.samp-1, theImageSize.line-1);
-      
-      ossimGpt v0, v1, v2, v3;
-      ossimDpt ip0 (0.0, 0.0);
-      lineSampleHeightToWorld(ip0, m_znrmo, v0);
-      ossimDpt ip1 (theImageSize.samp-1.0, 0.0);
-      lineSampleHeightToWorld(ip1, m_znrmo, v1);
-      ossimDpt ip2 (theImageSize.samp-1.0, theImageSize.line-1.0);
-      lineSampleHeightToWorld(ip2, m_znrmo, v2);
-      ossimDpt ip3 (0.0, theImageSize.line-1.0);
-      lineSampleHeightToWorld(ip3, m_znrmo, v3);
-      
-      theBoundGndPolygon = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
-      
-      updateModel();
-      
-      // Set the ground reference point.
-      lineSampleHeightToWorld(theRefImgPt, m_znrmo, theRefGndPt);
-
-      // Height could have nan if elevation is not set so check lat, lon individually.
-      if ( ( theRefGndPt.isLatNan() == false ) && ( theRefGndPt.isLonNan() == false ) )
-      {
-         //---
-         // This will set theGSD and theMeanGSD.  This model doesn't need these but
-         // others do.
-         //---
-         try
-         {
-            computeGsd();
-
-            // Set return status.
-            status = true;
-         }
-         catch (const ossimException& e)
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:\n"
-                  << e.what() << std::endl;
-            }
-            setErrorStatus();
-         }
-      }
-      else
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:"
-               << "\nGround Reference Point not valid(has nans)."
-               << " Aborting with error..."
-               << std::endl;
-         }
-         setErrorStatus();
-      }
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcModel::parseFile DEBUG:"
-            << "\nError parsing rsm tags.  Aborting with error."
-            << std::endl;
-      }
-      setErrorStatus();
-   }
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exit status: " << ( status ? "true" : "false" ) << "\n";
-   }
-
-   return status;
-   
-} // End: ossimNitfRsmModel::parseImageHeader(const ossimNitfImageHeader* ih)
-
-bool ossimNitfRsmModel::getRsmData(const ossimNitfImageHeader* ih)
-{
-   static const char MODULE[] = "ossimNitfRsmModel::getRsmData";
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering..." << std::endl;
-   }
-   
-   bool status = false;
-   
-   if ( ih )
-   {
-      ossimRefPtr<ossimNitfRegisteredTag> tag = 0;
-
-      // RSMECA:
-      const ossimString RSMECA_TAG = "RSMECA";
-      tag = ih->getTagData(RSMECA_TAG);
-      if (tag.valid())
-      {
-         ossimRefPtr<ossimNitfRsmecaTag> rsmecaTag =
-            dynamic_cast<ossimNitfRsmecaTag*>(tag.get());
-         if ( rsmecaTag.valid() )
-         {
-            if ( initializeModel( rsmecaTag.get() ) )
-            {
-               // RSMIDA:
-               ossimString RSMIDA_TAG = "RSMIDA";
-               tag = ih->getTagData(RSMIDA_TAG);
-               if (tag.valid())
-               {
-                  ossimRefPtr<ossimNitfRsmidaTag> rsmidaTag =
-                     dynamic_cast<ossimNitfRsmidaTag*>( tag.get() );
-                  if ( rsmidaTag.valid() )
-                  {
-                     if ( initializeModel( rsmidaTag.get() ) )
-                     {
-                        // RSMPCA:
-                        const ossimString RSMPCA_TAG = "RSMPCA";                        
-                        tag = ih->getTagData(RSMPCA_TAG);
-                        if (tag.valid())
-                        {
-                           ossimRefPtr<ossimNitfRsmpcaTag> rsmpcaTag =
-                              dynamic_cast<ossimNitfRsmpcaTag*>( tag.get() );
-                           if ( rsmpcaTag.valid() )
-                           {
-                              if ( initializeModel( rsmpcaTag.get() ) )
-                              {
-                                 // RSMPIA:
-                                 const ossimString RSMPIA_TAG = "RSMPIA";
-                                 tag = ih->getTagData(RSMPIA_TAG);
-                                 if (tag.valid())
-                                 {
-                                    ossimRefPtr<ossimNitfRsmpiaTag> rsmpiaTag =
-                                       dynamic_cast<ossimNitfRsmpiaTag*>( tag.get() );
-                                    if ( rsmpiaTag.valid() )
-                                    {
-                                       // Last tag, assign status.
-                                       status = initializeModel( rsmpiaTag.get() );
-                                    }
-                                 }
-                                 else if (traceDebug())
-                                 {
-                                    ossimNotify(ossimNotifyLevel_WARN)
-                                       << "ossimNitfRsmModel::getRsmData WARNING!"
-                                       << "\nCould not find RSM tag: " << RSMPIA_TAG
-                                       << "\nAborting with error..."
-                                       << std::endl;
-                                 }
-                              }
-                           }
-                        }
-                        else if (traceDebug())
-                        {
-                           ossimNotify(ossimNotifyLevel_WARN)
-                              << "ossimNitfRsmModel::getRsmData WARNING!"
-                              << "\nCould not find RSM tag: " << RSMPCA_TAG
-                              << "\nAborting with error..."
-                              << std::endl;
-                        }
-                     }
-                  }
-               }
-               else if (traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_WARN)
-                     << "ossimNitfRsmModel::getRsmData WARNING!"
-                     << "\nCould not find RSM tag: " << RSMIDA_TAG
-                     << "\nAborting with error..." << std::endl;
-               }
-            }
-         }
-      }
-      else if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimNitfRsmModel::getRsmData WARNING!"
-            << "\nCould not find RSM tag: " << RSMECA_TAG
-            << "\nAborting with error..." << std::endl;
-      }
-   }
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exit status: " << ( status ? "true" : "false" ) << "\n";
-   }
-
-   return status;
-   
-} // End: ossimNitfRsmModel::getRsmData(const ossimNitfImageHeader* ih)
-
-
-bool ossimNitfRsmModel::initializeModel( const ossimNitfRsmecaTag* rsmecaTag )
-{
-   bool status = false;
-
-   if ( rsmecaTag )
-   {
-      // TODO:
-      status = true;
-   }
-
-   return status;
-   
-} // End: ossimNitfRsmModel::initializeModel( rsmecaTag )
-
-bool ossimNitfRsmModel::initializeModel( const ossimNitfRsmidaTag* rsmidaTag )
-{
-   bool status = false;
-
-   if ( rsmidaTag )
-   {
-      // TODO:
-      status = true;
-   }
-
-   return status;
-   
-} // End: ossimNitfRsmModel::initializeModel( rsmidaTag )
-
-bool ossimNitfRsmModel::initializeModel( const ossimNitfRsmpcaTag* rsmpcaTag )
-{
-   bool status = false;
-
-   if ( rsmpcaTag )
-   {
-      m_iid = rsmpcaTag->getIid();
-      m_edition = rsmpcaTag->getEdition();
-      m_rsn = rsmpcaTag->getRsn().toUInt32();
-      m_csn = rsmpcaTag->getCsn().toUInt32();
-      
-      // Supporting only the single polynomial set case right now, so fail otherwise
-      if (m_rsn == 1 && m_csn == 1)
-      {
-         m_rfep = rsmpcaTag->getRfep().toFloat64();
-         m_cfep = rsmpcaTag->getCfep().toFloat64();
-         m_rnrmo = rsmpcaTag->getRnrmo().toFloat64();
-         m_cnrmo = rsmpcaTag->getCnrmo().toFloat64();
-         m_xnrmo = rsmpcaTag->getXnrmo().toFloat64();
-         m_ynrmo = rsmpcaTag->getYnrmo().toFloat64();
-         m_znrmo = rsmpcaTag->getZnrmo().toFloat64();
-         m_rnrmsf = rsmpcaTag->getRnrmsf().toFloat64();
-         m_cnrmsf = rsmpcaTag->getCnrmsf().toFloat64();
-         m_xnrmsf = rsmpcaTag->getXnrmsf().toFloat64();
-         m_ynrmsf = rsmpcaTag->getYnrmsf().toFloat64();
-         m_znrmsf = rsmpcaTag->getZnrmsf().toFloat64();
-         
-         m_rnpwrx = rsmpcaTag->getRnpwrx().toUInt32();
-         m_rnpwry = rsmpcaTag->getRnpwry().toUInt32();
-         m_rnpwrz = rsmpcaTag->getRnpwrz().toUInt32();
-         m_rntrms = rsmpcaTag->getRntrms().toUInt32();
-         m_rnpcf.resize(m_rntrms);
-         for (ossim_uint32 i = 0; i < m_rntrms; ++i)
-         {
-            m_rnpcf[i] = rsmpcaTag->getRnpcf(i).toFloat64();
-         }
-         
-         m_rdpwrx = rsmpcaTag->getRdpwrx().toUInt32();
-         m_rdpwry = rsmpcaTag->getRdpwry().toUInt32();
-         m_rdpwrz = rsmpcaTag->getRdpwrz().toUInt32();
-         m_rdtrms = rsmpcaTag->getRdtrms().toUInt32();
-         m_rdpcf.resize(m_rdtrms);
-         for (ossim_uint32 i = 0; i < m_rdtrms; ++i)
-         {
-            m_rdpcf[i] = rsmpcaTag->getRdpcf(i).toFloat64();
-         }
-         
-         m_cnpwrx = rsmpcaTag->getCnpwrx().toUInt32();
-         m_cnpwry = rsmpcaTag->getCnpwry().toUInt32();
-         m_cnpwrz = rsmpcaTag->getCnpwrz().toUInt32();
-         m_cntrms = rsmpcaTag->getCntrms().toUInt32();
-         m_cnpcf.resize(m_cntrms);
-         for (ossim_uint32 i = 0; i < m_cntrms; ++i)
-         {
-            m_cnpcf[i] = rsmpcaTag->getCnpcf(i).toFloat64();
-         }
-         
-         m_cdpwrx = rsmpcaTag->getCdpwrx().toUInt32();
-         m_cdpwry = rsmpcaTag->getCdpwry().toUInt32();
-         m_cdpwrz = rsmpcaTag->getCdpwrz().toUInt32();
-         m_cdtrms = rsmpcaTag->getCdtrms().toUInt32();
-         m_cdpcf.resize(m_cdtrms);
-         for (ossim_uint32 i = 0; i < m_cdtrms; ++i)
-         {
-            m_cdpcf[i] = rsmpcaTag->getCdpcf(i).toFloat64();
-         }
-         
-         status = true;
-      }
-      else if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRsmModel::getRsmData DEBUG:"
-            << "\nRow or Column Section Number not equal to 1: CSN is "
-            << ossimString::toString(m_csn) << ", RSN is " << ossimString::toString(m_rsn)
-            << "\nAborting with error..."
-            << std::endl;
-      }
-   }
-   
-   return status;
-   
-} // End: ossimNitfRsmModel::initializeModel( rsmpcaTag )
-
-bool ossimNitfRsmModel::initializeModel( const ossimNitfRsmpiaTag* rsmpiaTag )
-{
-   bool status = false;
-
-   if ( rsmpiaTag )
-   {
-      // TODO:
-      status = true;
-   }
-
-   return status;
-   
-} // End: ossimNitfRsmModel::initializeModel( rsmpiaTag )
-
-ossimObject* ossimNitfRsmModel::dup() const
-{
-   return new ossimNitfRsmModel(*this);
-}
-
-//---**************************************************************************
-//  METHOD: ossimNitfRsmModel::saveState()
-//  
-//  Saves the model state to the KWL. This KWL also serves as a geometry file.
-//  
-//---**************************************************************************
-bool ossimNitfRsmModel::saveState(ossimKeywordlist& kwl,
-                                  const char* prefix) const
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfRsmModel::saveState(): entering..." << std::endl;
-   }
-
-   //---
-   // Hand off to base class for common stuff:
-   //
-   // Note: Class type "ossimKeywordNames::TYPE_KW" is saved in
-   // ossimOject::saveState.
-   //---
-   bool status = ossimRsmModel::saveState(kwl, prefix);
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfRsmModel::saveState(): returning..." << std::endl;
-   }
-
-   return status;
-}
-
-bool ossimNitfRsmModel::loadState( const ossimKeywordlist& kwl,
-                                   const char* prefix ) 
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfRsmModel::loadState(): entering..." << std::endl;
-   }
-
-   bool status = false;
-
-   // Check for type match before preceeding:
-   std::string myPrefix = ( prefix ? prefix : "" );
-   std::string type = kwl.findKey( myPrefix, std::string(ossimKeywordNames::TYPE_KW) );
-
-   if ( type == "ossimNitfRsmModel" )
-   {
-      // Pass on to the base-class for parsing first:
-      status = ossimRsmModel::loadState(kwl, prefix);
-   }
-   
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfRsmModel::loadState(): exit status: "
-         << ( status ? "true" : "false" ) << std::endl;
-   }
-   
-   return status;
-}
diff --git a/ossim/src/ossim/projection/ossimObliqueMercatorProjection.cpp b/ossim/src/ossim/projection/ossimObliqueMercatorProjection.cpp
deleted file mode 100644
index 9de0a65..0000000
--- a/ossim/src/ossim/projection/ossimObliqueMercatorProjection.cpp
+++ /dev/null
@@ -1,724 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimObliqueMercatorProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-#include <ossim/projection/ossimObliqueMercatorProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-#define OMERC_NO_ERROR                0x0000
-#define OMERC_LAT_ERROR               0x0001
-#define OMERC_LON_ERROR               0x0002
-#define OMERC_ORIGIN_LAT_ERROR        0x0004
-#define OMERC_LAT1_ERROR              0x0008
-#define OMERC_LAT2_ERROR              0x0010
-#define OMERC_LON1_ERROR              0x0020
-#define OMERC_LON2_ERROR              0x0040
-#define OMERC_LAT1_LAT2_ERROR         0x0080
-#define OMERC_DIFF_HEMISPHERE_ERROR   0x0100
-#define OMERC_EASTING_ERROR           0x0200
-#define OMERC_NORTHING_ERROR          0x0400
-#define OMERC_A_ERROR                 0x0800
-#define OMERC_INV_F_ERROR             0x1000
-#define OMERC_SCALE_FACTOR_ERROR      0x2000
-#define OMERC_LON_WARNING             0x4000
-
-RTTI_DEF1(ossimObliqueMercatorProjection, "ossimObliqueMercatorProjection", ossimMapProjection)
-
-#ifndef PI_OVER_2
-#  define PI_OVER_2  ( M_PI / 2.0)
-#endif
-#ifndef PI_OVER_4
-#  define PI_OVER_4  ( M_PI / 4.0)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI     (2.0 * M_PI)
-#endif
-#define MIN_SCALE_FACTOR  0.3
-#define MAX_SCALE_FACTOR  3.0
-   
-#define OMERC_t(lat, e_sinlat, e_over_2)  (tan(PI_OVER_4 - lat / 2.0)) /         \
-                      (pow((1 - e_sinlat) / (1 + e_sinlat), e_over_2))
-
-
-ossimObliqueMercatorProjection::ossimObliqueMercatorProjection(const ossimEllipsoid& ellipsoid,
-                                                               const ossimGpt& origin)
-   : ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-
-ossimObliqueMercatorProjection::ossimObliqueMercatorProjection(const ossimEllipsoid& ellipsoid,
-                                                               const ossimGpt& origin,
-                                                               const ossimGpt& point1,
-                                                               const ossimGpt& point2,
-                                                               double falseEasting,
-                                                               double falseNorthing,
-                                                               double scaleFactor)
-   : ossimMapProjection(ellipsoid, origin)
-{
-   setParameters(point1, point2, falseEasting, falseNorthing, scaleFactor);
-}
-
-void ossimObliqueMercatorProjection::update()
-{
-   Set_Oblique_Mercator_Parameters(theEllipsoid.getA(),
-                                   theEllipsoid.getFlattening(),
-                                   theOrigin.latr(),
-                                   theCentralPoint1.latr(),
-                                   theCentralPoint1.lonr(),
-                                   theCentralPoint2.latr(),
-                                   theCentralPoint2.lonr(),
-                                   OMerc_False_Easting,
-                                   OMerc_False_Northing,
-                                   OMerc_Scale_Factor);
-
-   theFalseEastingNorthing.x = OMerc_False_Easting;
-   theFalseEastingNorthing.y = OMerc_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-void ossimObliqueMercatorProjection::setFalseEasting(double falseEasting)
-{
-   OMerc_False_Easting = falseEasting;
-   update();
-}
-
-void ossimObliqueMercatorProjection::setFalseNorthing(double falseNorthing)
-{
-   OMerc_False_Northing = falseNorthing;
-   update();  
-}
-
-void ossimObliqueMercatorProjection::setFalseEastingNorthing(double falseEasting, double falseNorthing)
-{
-   OMerc_False_Easting = falseEasting;
-   OMerc_False_Northing = falseNorthing;
-   update();  
-   
-}
-
-void ossimObliqueMercatorProjection::setCentralPoint1(const ossimGpt& point)
-{
-   theCentralPoint1 = point;
-
-   update();
-}
-
-void ossimObliqueMercatorProjection::setCentralPoint2(const ossimGpt& point)
-{
-   theCentralPoint2 = point;
-   update();
-}
-
-void ossimObliqueMercatorProjection::setScaleFactor(double scaleFactor)
-{
-   OMerc_Scale_Factor = scaleFactor;
-   update();
-}
-
-void ossimObliqueMercatorProjection::setParameters(const ossimGpt& point1,
-                                                   const ossimGpt& point2,
-                                                   double falseEasting,
-                                                   double falseNorthing,
-                                                   double scaleFactor)
-{
-   theCentralPoint1 = point1;
-   theCentralPoint2 = point2;
-   OMerc_False_Easting = falseEasting;
-   OMerc_False_Northing = falseNorthing;
-   OMerc_Scale_Factor = scaleFactor;
-
-   update();
-}
-
-void ossimObliqueMercatorProjection::setDefaults()
-{
-   // initialize the central points to be 5 degrees about the origin.
-   OMerc_Delta_Northing = 40000000.0;
-   OMerc_Delta_Easting  = 40000000.0;
-
-   theCentralPoint1.latd(theOrigin.latd() - 5.0);
-   theCentralPoint1.lond(theOrigin.lond() - 5.0);
-   theCentralPoint2.latd(theOrigin.latd() + 5.0);
-   theCentralPoint2.lond(theOrigin.lond() + 5.0);
-   
-   theCentralPoint1.clampLat(-90.0, 90.0);
-   theCentralPoint1.clampLon(-180.0, 180.0);
-   theCentralPoint2.clampLat(-90.0, 90.0);
-   theCentralPoint2.clampLon(-180.0, 180.0);
-   
-   OMerc_False_Easting  = 0.0;
-   OMerc_False_Northing = 0.0;
-
-   OMerc_Scale_Factor   = 1.0;
-}
-
-
-ossimGpt ossimObliqueMercatorProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_Oblique_Mercator_To_Geodetic(eastingNorthing.x,
-                                        eastingNorthing.y,
-                                        &lat,
-                                        &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
-}
-
-ossimDpt ossimObliqueMercatorProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Oblique_Mercator(gpt.latr(),
-                                        gpt.lonr(),
-                                        &easting,
-                                        &northing);
-   return ossimDpt(easting, northing);
-}
-
-bool ossimObliqueMercatorProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_FACTOR_KW,
-           OMerc_Scale_Factor,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CENTRAL_POINT1_LAT_KW,
-           theCentralPoint1.latd(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CENTRAL_POINT1_LON_KW,
-           theCentralPoint1.lond(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CENTRAL_POINT2_LAT_KW,
-           theCentralPoint2.latd(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CENTRAL_POINT2_LON_KW,
-           theCentralPoint2.lond(),
-           true);
-           
-   
-   return ossimMapProjection::saveState(kwl, prefix);   
-}
-
-bool ossimObliqueMercatorProjection::loadState(const ossimKeywordlist& kwl,
-                                             const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   const char* point1Lat     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT1_LAT_KW);
-   const char* point1Lon     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT1_LON_KW);
-   const char* point2Lat     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT2_LAT_KW);
-   const char* point2Lon     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT2_LON_KW);
-   const char* scale         = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
-   
-   setDefaults();
-
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimObliqueMercatorProjection))
-   {
-      OMerc_False_Easting  = theFalseEastingNorthing.x;
-      OMerc_False_Northing = theFalseEastingNorthing.y;
-
-      if(point1Lat&&point1Lon&&point2Lat&&point2Lon)
-      {
-         theCentralPoint1.latd(ossimString(point1Lat).toDouble());
-         theCentralPoint1.lond(ossimString(point1Lon).toDouble());
-         theCentralPoint2.latd(ossimString(point2Lat).toDouble());
-         theCentralPoint2.lond(ossimString(point2Lon).toDouble());
-      }
-      if(scale)
-      {
-         OMerc_Scale_Factor = ossimString(scale).toDouble();
-      }
-   }
-   
-   update();
-
-   return flag;
-
-}
-
-/*
- *                              FUNCTIONS     
- */
-
-long ossimObliqueMercatorProjection::Set_Oblique_Mercator_Parameters(double a,
-                                                                     double f,
-                                                                     double Origin_Latitude,
-                                                                     double Latitude_1,
-                                                                     double Longitude_1,
-                                                                     double Latitude_2,
-                                                                     double Longitude_2,
-                                                                     double False_Easting,
-                                                                     double False_Northing,
-                                                                     double Scale_Factor)
-{ /* BEGIN Set_Oblique_Mercator_Parameters */
-/*
- * The function Set_Oblique_Mercator_Parameters receives the ellipsoid parameters and
- * projection parameters as inputs, and sets the corresponding state
- * variables.  If any errors occur, the error code(s) are returned by the function, 
- * otherwise OMERC_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters  (input)
- *    f                 : Flattening of ellipsoid                  (input)
- *    Origin_Latitude   : Latitude, in radians, at which the       (input)
- *                          point scale factor is 1.0
- *    Latitude_1        : Latitude, in radians, of first point lying on
- *                          central line                           (input)
- *    Longitude_1       : Longitude, in radians, of first point lying on
- *                          central line                           (input)
- *    Latitude_2        : Latitude, in radians, of second point lying on
- *                          central line                           (input)
- *    Longitude_2       : Longitude, in radians, of second point lying on
- *                          central line                           (input)
- *    False_Easting     : A coordinate value, in meters, assigned to the
- *                          central meridian of the projection     (input)
- *    False_Northing    : A coordinate value, in meters, assigned to the
- *                          origin latitude of the projection      (input)
- *    Scale_Factor      : Multiplier which reduces distances in the
- *                          projection to the actual distance on the
- *                          ellipsoid                              (input)
- */
-
-//  double inv_f = 1 / f;
-  double es2, one_MINUS_es2;
-  double cos_olat, cos_olat2;
-  double sin_olat, sin_olat2, es2_sin_olat2;
-  double t0, t1, t2;
-  double D, D2, D2_MINUS_1, sqrt_D2_MINUS_1;
-  double H, L, LH;
-  double E2;
-  double F, G, J, P;
-  double dlon;
-  long Error_Code = OMERC_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= OMERC_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= OMERC_INV_F_ERROR;
-//   }
-//   if ((Origin_Latitude <= -PI_OVER_2) || (Origin_Latitude >= PI_OVER_2))
-//   { /* origin latitude out of range -  can not be at a pole */
-//     Error_Code |= OMERC_ORIGIN_LAT_ERROR;
-//   }
-//   if ((Latitude_1 <= -PI_OVER_2) || (Latitude_1 >= PI_OVER_2))
-//   { /* first latitude out of range -  can not be at a pole */
-//     Error_Code |= OMERC_LAT1_ERROR;
-//   }
-//   if ((Latitude_2 <= -PI_OVER_2) || (Latitude_2 >= PI_OVER_2))
-//   { /* second latitude out of range -  can not be at a pole */
-//     Error_Code |= OMERC_LAT2_ERROR;
-//   }
-//   if (Latitude_1 == 0.0)
-//   { /* first latitude can not be at the equator */
-//     Error_Code |= OMERC_LAT1_ERROR;
-//   }
-//   if (Latitude_1 == Latitude_2)
-//   { /* first and second latitudes can not be equal */
-//     Error_Code |= OMERC_LAT1_LAT2_ERROR;
-//   }
-//   if (((Latitude_1 < 0.0) && (Latitude_2 > 0.0)) ||
-//       ((Latitude_1 > 0.0) && (Latitude_2 < 0.0)))
-//   { /*first and second points can not be in different hemispheres */
-//     Error_Code |= OMERC_DIFF_HEMISPHERE_ERROR;
-//   }
-//   if ((Longitude_1 < -PI) || (Longitude_1 > TWO_PI))
-//   { /* first longitude out of range */
-//     Error_Code |= OMERC_LON1_ERROR;
-//   }
-//   if ((Longitude_2 < -PI) || (Longitude_2 > TWO_PI))
-//   { /* first longitude out of range */
-//     Error_Code |= OMERC_LON2_ERROR;
-//   }
-//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
-//   { /* scale factor out of range */
-//     Error_Code |= OMERC_SCALE_FACTOR_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-
-    OMerc_a = a;
-    OMerc_f = f;
-    OMerc_Origin_Lat = Origin_Latitude;
-    OMerc_Lat_1 = Latitude_1;
-    OMerc_Lat_2 = Latitude_2;
-    OMerc_Lon_1 = Longitude_1;
-    OMerc_Lon_2 = Longitude_2;
-    OMerc_Scale_Factor = Scale_Factor;
-    OMerc_False_Northing = False_Northing;
-    OMerc_False_Easting = False_Easting;
-
-    es2 = 2 * OMerc_f - OMerc_f * OMerc_f;
-    es = sqrt(es2);
-    one_MINUS_es2 = 1 - es2;
-    es_OVER_2 = es / 2.0;
-
-    cos_olat = cos(OMerc_Origin_Lat);
-    cos_olat2 = cos_olat * cos_olat;
-    sin_olat = sin(OMerc_Origin_Lat);
-    sin_olat2 = sin_olat * sin_olat;
-    es2_sin_olat2 = es2 * sin_olat2;
-
-    OMerc_B = sqrt(1 + (es2 * cos_olat2 * cos_olat2) / one_MINUS_es2);
-    OMerc_A = (OMerc_a * OMerc_B * OMerc_Scale_Factor * sqrt(one_MINUS_es2)) / (1.0 - es2_sin_olat2);  
-    A_over_B = OMerc_A / OMerc_B;
-    B_over_A = OMerc_B / OMerc_A;
-
-    t0 = OMERC_t(OMerc_Origin_Lat, es * sin_olat, es_OVER_2);
-    t1 = OMERC_t(OMerc_Lat_1, es * sin(OMerc_Lat_1), es_OVER_2);  
-    t2 = OMERC_t(OMerc_Lat_2, es * sin(OMerc_Lat_2), es_OVER_2);  
-
-    D = (OMerc_B * sqrt(one_MINUS_es2)) / (cos_olat * sqrt(1.0 - es2_sin_olat2)); 
-    D2 = D * D;
-    if (D2 < 1.0)
-      D2 = 1.0;
-    D2_MINUS_1 = D2 - 1.0;
-    sqrt_D2_MINUS_1 = sqrt(D2_MINUS_1);
-    if (D2_MINUS_1 > 1.0e-10)
-    {
-      if (OMerc_Origin_Lat >= 0.0)
-        OMerc_E = (D + sqrt_D2_MINUS_1) * pow(t0, OMerc_B);
-      else
-        OMerc_E = (D - sqrt_D2_MINUS_1) * pow(t0, OMerc_B);
-    }
-    else
-      OMerc_E = D * pow(t0, OMerc_B);
-    H = pow(t1, OMerc_B);
-    L = pow(t2, OMerc_B);
-    F = OMerc_E / H;
-    G = (F - 1.0 / F) / 2.0;
-    E2 = OMerc_E * OMerc_E;
-    LH = L * H;
-    J = (E2 - LH) / (E2 + LH);
-    P = (L - H) / (L + H);
-
-    dlon = OMerc_Lon_1 - OMerc_Lon_2;
-    if (dlon < -M_PI )
-      OMerc_Lon_2 -= TWO_PI;
-    if (dlon > M_PI)
-      OMerc_Lon_2 += TWO_PI;
-    dlon = OMerc_Lon_1 - OMerc_Lon_2;
-    OMerc_Origin_Long = (OMerc_Lon_1 + OMerc_Lon_2) / 2.0 - (atan(J * tan(OMerc_B * dlon / 2.0) / P)) / OMerc_B;
-
-    dlon = OMerc_Lon_1 - OMerc_Origin_Long;
-//     if (dlon < -M_PI )
-//       OMerc_Origin_Long -= TWO_PI;
-//     if (dlon > M_PI)
-//       OMerc_Origin_Long += TWO_PI;
-   
-    dlon = OMerc_Lon_1 - OMerc_Origin_Long;
-    OMerc_gamma = atan(sin(OMerc_B * dlon) / G);
-    cos_gamma = cos(OMerc_gamma);
-    sin_gamma = sin(OMerc_gamma);
-  
-    OMerc_azimuth = asin(D * sin_gamma);
-    cos_azimuth = cos(OMerc_azimuth);
-    sin_azimuth = sin(OMerc_azimuth);
-
-   if (OMerc_Origin_Lat >= 0)
-      OMerc_u =  A_over_B * atan(sqrt_D2_MINUS_1/cos_azimuth);
-   else
-      OMerc_u = -A_over_B * atan(sqrt_D2_MINUS_1/cos_azimuth);
-
-  } /* End if(!Error_Code) */
-  return (Error_Code);
-} /* End Set_Oblique_Mercator_Parameters */
-
-void ossimObliqueMercatorProjection::Get_Oblique_Mercator_Parameters(double *a,
-                                                                     double *f,
-                                                                     double *Origin_Latitude,
-                                                                     double *Latitude_1,
-                                                                     double *Longitude_1,
-                                                                     double *Latitude_2,
-                                                                     double *Longitude_2,
-                                                                     double *False_Easting,
-                                                                     double *False_Northing,
-                                                                     double *Scale_Factor)const
-{ /* Begin Get_Oblique_Mercator_Parameters */
-/*
- * The function Get_Oblique_Mercator_Parameters returns the current ellipsoid
- * parameters and Oblique Mercator projection parameters.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters  (output)
- *    f                 : Flattening of ellipsoid                  (output)
- *    Origin_Latitude   : Latitude, in radians, at which the       (output)
- *                          point scale factor is 1.0
- *    Latitude_1        : Latitude, in radians, of first point lying on
- *                          central line                           (output)
- *    Longitude_1       : Longitude, in radians, of first point lying on
- *                          central line                           (output)
- *    Latitude_2        : Latitude, in radians, of second point lying on
- *                          central line                           (output)
- *    Longitude_2       : Longitude, in radians, of second point lying on
- *                          central line                           (output)
- *    False_Easting     : A coordinate value, in meters, assigned to the
- *                          central meridian of the projection     (output)
- *    False_Northing    : A coordinate value, in meters, assigned to the
- *                          origin latitude of the projection      (output)
- *    Scale_Factor      : Multiplier which reduces distances in the
- *                          projection to the actual distance on the
- *                          ellipsoid                              (output)
- */
-
-  *a = OMerc_a;
-  *f = OMerc_f;
-  *Origin_Latitude = OMerc_Origin_Lat;
-  *Latitude_1 = OMerc_Lat_1;
-  *Longitude_1 = OMerc_Lon_1;
-  *Latitude_2 = OMerc_Lat_2;
-  *Longitude_2 = OMerc_Lon_2;
-  *Scale_Factor = OMerc_Scale_Factor;
-  *False_Easting = OMerc_False_Easting;
-  *False_Northing = OMerc_False_Northing;
-  
-  return;
-} /* End Get_Azimuthal_Equidistant_Parameters */
-
-long ossimObliqueMercatorProjection::Convert_Geodetic_To_Oblique_Mercator(double Latitude,
-                                                                          double Longitude,
-                                                                          double *Easting,
-                                                                          double *Northing)const
-{ /* BEGIN Convert_Geodetic_To_Oblique_Mercator */
-/*
- * The function Convert_Geodetic_To_Oblique_Mercator converts geodetic (latitude and
- * longitude) coordinates to Oblique Mercator projection (easting and
- * northing) coordinates, according to the current ellipsoid and Oblique Mercator 
- * projection parameters.  If any errors occur, the error code(s) are returned 
- * by the function, otherwise OMERC_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi), in radians           (input)
- *    Longitude         : Longitude (lambda), in radians       (input)
- *    Easting           : Easting (X), in meters               (output)
- *    Northing          : Northing (Y), in meters              (output)
- */
-
-  double dlam, B_dlam, cos_B_dlam;
-  double t, S, T, V, U;
-  double Q, Q_inv;
-  /* Coordinate axes defined with respect to the azimuth of the center line */
-  /* Natural origin*/
-  double v = 0;
-  double u = 0;
-  long Error_Code = OMERC_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   { /* Latitude out of range */
-//     Error_Code |= OMERC_LAT_ERROR;
-//   }
-//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
-//   { /* Longitude out of range */
-//     Error_Code |= OMERC_LON_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    dlam = Longitude - OMerc_Origin_Long;
-
-//     if (fabs(dlam) >= PI_OVER_2)
-//     { /* Distortion will result if Longitude is 90 degrees or more from the Central Meridian */
-//       Error_Code |= OMERC_LON_WARNING;
-//     }
-
-//     if (dlam > M_PI)
-//     {
-//       dlam -= TWO_PI;
-//     }
-//     if (dlam < -M_PI)
-//     {
-//       dlam += TWO_PI;
-//     }
-
-    if (fabs(fabs(Latitude) - PI_OVER_2) > 1.0e-10)
-    {
-      t = OMERC_t(Latitude, es * sin(Latitude), es_OVER_2);  
-      Q = OMerc_E / pow(t, OMerc_B);
-      Q_inv = 1.0 / Q;
-      S = (Q - Q_inv) / 2.0;
-      T = (Q + Q_inv) / 2.0;
-      B_dlam = OMerc_B * dlam;
-      V = sin(B_dlam);
-      U = ((-1.0 * V * cos_gamma) + (S * sin_gamma)) / T;
-      if (fabs(fabs(U) - 1.0) < 1.0e-10)
-      { /* Point projects into infinity */
-        Error_Code |= OMERC_LON_ERROR;
-      }
-      else
-      {
-        v = A_over_B * log((1.0 - U) / (1.0 + U)) / 2.0;
-        cos_B_dlam = cos(B_dlam);
-        if (fabs(cos_B_dlam) < 1.0e-10)
-          u = OMerc_A * B_dlam;
-        else
-          u = A_over_B * atan(((S * cos_gamma) + (V * sin_gamma)) / cos_B_dlam);
-      }
-    }
-    else
-    {
-      if (Latitude > 0.0)
-        v = A_over_B * log(tan(PI_OVER_4 - (OMerc_gamma / 2.0)));
-      else
-        v = A_over_B * log(tan(PI_OVER_4 + (OMerc_gamma / 2.0)));
-      u = A_over_B * Latitude;
-    }
-
-
-    u = u - OMerc_u;
-
-    *Easting  = OMerc_False_Easting + v * cos_azimuth + u * sin_azimuth;
-    *Northing = OMerc_False_Northing + u * cos_azimuth - v * sin_azimuth;
-
-  }
-  return (Error_Code);
-} /* End Convert_Geodetic_To_Oblique_Mercator */
-
-
-long ossimObliqueMercatorProjection::Convert_Oblique_Mercator_To_Geodetic(double Easting,
-                                                                          double Northing,
-                                                                          double *Latitude,
-                                                                          double *Longitude)const
-{ /* Begin Convert_Oblique_Mercator_To_Geodetic */
-/*
- * The function Convert_Oblique_Mercator_To_Geodetic converts Oblique Mercator projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid and Oblique Mercator projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise OMERC_NO_ERROR is returned.
- *
- *    Easting           : Easting (X), in meters                  (input)
- *    Northing          : Northing (Y), in meters                 (input)
- *    Latitude          : Latitude (phi), in radians              (output)
- *    Longitude         : Longitude (lambda), in radians          (output)
- */
-
-  double dx, dy;
-  /* Coordinate axes defined with respect to the azimuth of the center line */
-  /* Natural origin*/
-  double u, v;
-  double Q_prime, Q_prime_inv;
-  double S_prime, T_prime, V_prime, U_prime;
-  double t;
-  double es_sin;
-  double u_B_over_A;
-  double phi;
-  double temp_phi = 0.0;
-  long Error_Code = OMERC_NO_ERROR; 
-
-//   if ((Easting < (OMerc_False_Easting - OMerc_Delta_Easting)) 
-//       || (Easting > (OMerc_False_Easting + OMerc_Delta_Easting)))
-//   { /* Easting out of range  */
-//     Error_Code |= OMERC_EASTING_ERROR;
-//   }
-//   if ((Northing < (OMerc_False_Northing - OMerc_Delta_Northing)) 
-//       || (Northing > (OMerc_False_Northing + OMerc_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= OMERC_NORTHING_ERROR;
-//   }
-
-  if (!Error_Code)
-  {
-    dy = Northing - OMerc_False_Northing;
-    dx = Easting - OMerc_False_Easting;
-    v = dx * cos_azimuth - dy * sin_azimuth;
-    u = dy * cos_azimuth + dx * sin_azimuth;
-    u = u + OMerc_u;
-    Q_prime = exp(-1.0 * (v * B_over_A ));
-    Q_prime_inv = 1.0 / Q_prime;
-    S_prime = (Q_prime - Q_prime_inv) / 2.0;
-    T_prime = (Q_prime + Q_prime_inv) / 2.0;
-    u_B_over_A = u * B_over_A;
-    V_prime = sin(u_B_over_A);
-    U_prime = (V_prime * cos_gamma + S_prime * sin_gamma) / T_prime;
-    if (fabs(fabs(U_prime) - 1.0) < 1.0e-10)
-    {
-      if (U_prime > 0)
-        *Latitude = PI_OVER_2;
-      else
-        *Latitude = -PI_OVER_2;
-      *Longitude = OMerc_Origin_Long;
-    }
-    else
-    {
-      t = pow(OMerc_E / sqrt((1.0 + U_prime) / (1.0 - U_prime)), 1.0 / OMerc_B);
-      phi = PI_OVER_2 - 2.0 * atan(t);
-      while (fabs(phi - temp_phi) > 1.0e-10)
-      {
-        temp_phi = phi;
-        es_sin = es * sin(phi);
-        phi = PI_OVER_2 - 2.0 * atan(t * pow((1.0 - es_sin) / (1.0 + es_sin), es_OVER_2));
-      }
-      *Latitude = phi;
-      *Longitude = OMerc_Origin_Long - atan2((S_prime * cos_gamma - V_prime * sin_gamma), cos(u_B_over_A)) / OMerc_B;
-    }
-
-//     if (fabs(*Latitude) < 2.0e-7)  /* force lat to 0 to avoid -0 degrees */
-//       *Latitude = 0.0;
-//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-//       *Latitude = PI_OVER_2;
-//     else if (*Latitude < -PI_OVER_2)
-//       *Latitude = -PI_OVER_2;
-
-//     if (*Longitude > PI)
-//       *Longitude -= TWO_PI;
-//     if (*Longitude < -PI)
-//       *Longitude += TWO_PI;
-
-//     if (fabs(*Longitude) < 2.0e-7)  /* force lon to 0 to avoid -0 degrees */
-//       *Longitude = 0.0;
-//     if (*Longitude > PI)  /* force distorted values to 180, -180 degrees */
-//       *Longitude = PI;
-//     else if (*Longitude < -PI)
-//       *Longitude = -PI;
-
-//     if (fabs(*Longitude - OMerc_Origin_Long) >= PI_OVER_2)
-//     { /* Distortion will result if Longitude is 90 degrees or more from the Central Meridian */
-//       Error_Code |= OMERC_LON_WARNING;
-//     }
-
-  }
-  return (Error_Code);
-} /* End Convert_Oblique_Mercator_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimObliqueMercatorProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimObliqueMercatorProjection* p = PTR_CAST(ossimObliqueMercatorProjection, &proj);
-   if (!p) return false;
-
-   if (theCentralPoint1 != p->theCentralPoint1) return false;
-   if (theCentralPoint2 != p->theCentralPoint2) return false;
-   if (!ossim::almostEqual(OMerc_Scale_Factor,p->OMerc_Scale_Factor)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimPpjFrameSensor.cpp b/ossim/src/ossim/projection/ossimPpjFrameSensor.cpp
deleted file mode 100644
index a725059..0000000
--- a/ossim/src/ossim/projection/ossimPpjFrameSensor.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Dave Hicks
-//
-// Description:  PPJ Frame Model
-//
-//*******************************************************************
-//  $Id$
-#include <ossim/projection/ossimPpjFrameSensor.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimLsrRay.h>
-#include <ossim/base/ossimLsrSpace.h>
-#include <ossim/base/ossimMatrix4x4.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/matrix/newmatio.h>
-
-static ossimTrace traceExec ("ossimPpjFrameSensor:exec");
-static ossimTrace traceDebug("ossimPpjFrameSensor:debug");
-
-RTTI_DEF1(ossimPpjFrameSensor, "ossimPpjFrameSensor", ossimSensorModel);
-
-enum
-{
-   PARAM_ADJ_LON_OFFSET   = 0,
-   PARAM_ADJ_LAT_OFFSET = 1,
-   PARAM_ADJ_ALTITUDE_OFFSET =2, 
-   // PARAM_ADJ_ROLL_OFFSET,
-   // PARAM_ADJ_PITCH_OFFSET,
-   // PARAM_ADJ_YAW_OFFSET,
-   PARAM_ADJ_FOCAL_LENGTH_OFFSET=6,
-   PARAM_ADJ_COUNT = 7
-};
-
-ossimPpjFrameSensor::ossimPpjFrameSensor()
-   :
-   m_ecef2Cam(),
-   m_ecef2CamInverse(),
-   m_principalPoint(0.0, 0.0),
-   m_focalLengthX(0.0),
-   m_focalLengthY(0.0),
-   m_focalLength(0.0),
-   m_ecefCameraPosition(),
-   m_cameraPositionEllipsoid(),
-   m_radialK1(0.0),
-   m_radialK2(0.0),
-   m_radialP1(0.0),
-   m_radialP2(0.0),
-   m_adjustedCameraPosition(),
-   m_adjustedFocalLength(0.0),
-   m_averageProjectedHeight(0.0)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPpjFrameSensor::ossimPpjFrameSensor DEBUG:" << std::endl;
-   }
-   initAdjustableParameters();
-   theSensorID = "PpjFrame";
-   m_ecef2Cam.ReSize(3,3);
-   m_ecef2CamInverse.ReSize(3,3);
-
-   std::fill(m_ecef2Cam.Store(), m_ecef2Cam.Store()+9, 0.0);
-   std::fill(m_ecef2CamInverse.Store(), m_ecef2CamInverse.Store()+9, 0.0);
-   m_ecef2Cam[0][0] = 1.0;
-   m_ecef2Cam[1][1] = 1.0;
-   m_ecef2Cam[2][2] = 1.0;
-   m_ecef2CamInverse[0][0] = 1.0;
-   m_ecef2CamInverse[1][1] = 1.0;
-   m_ecef2CamInverse[2][2] = 1.0;
-}
-
-ossimPpjFrameSensor::ossimPpjFrameSensor(const ossimPpjFrameSensor& src)
-   :
-   ossimSensorModel(src),
-   m_ecef2Cam(src.m_ecef2Cam),
-   m_ecef2CamInverse(src.m_ecef2CamInverse),
-   m_principalPoint(src.m_principalPoint),
-   m_focalLengthX(src.m_focalLengthX),
-   m_focalLengthY(src.m_focalLengthY),
-   m_focalLength(src.m_focalLength),
-   m_ecefCameraPosition(src.m_ecefCameraPosition),
-   m_cameraPositionEllipsoid(src.m_cameraPositionEllipsoid),
-   m_radialK1(src.m_radialK1),
-   m_radialK2(src.m_radialK2),
-   m_radialP1(src.m_radialP1),
-   m_radialP2(src.m_radialP2),
-   m_adjustedCameraPosition(src.m_adjustedCameraPosition),
-   m_adjustedFocalLength(src.m_adjustedFocalLength),
-   m_averageProjectedHeight(src.m_averageProjectedHeight)
-{
-}
-
-ossimObject* ossimPpjFrameSensor::dup()const
-{
-   return new ossimPpjFrameSensor(*this);
-}
-   
-void ossimPpjFrameSensor::setFocalLength(double focX, double focY)
-{
-   m_focalLengthX = focX;
-   m_focalLengthY = focY;
-   m_focalLength  = m_focalLengthX;
-}
-
-void ossimPpjFrameSensor::setCameraPosition(const ossimGpt& value)
-{
-   m_cameraPositionEllipsoid = value;
-   m_ecefCameraPosition = value;
-}
-   
-void ossimPpjFrameSensor::setPrincipalPoint(const ossimDpt& value)
-{
-   m_principalPoint = value;
-}
-
-void ossimPpjFrameSensor::setecef2CamMatrix(const NEWMAT::Matrix& value)
-{
-   m_ecef2Cam = value;
-   m_ecef2CamInverse = m_ecef2Cam.t();
-}
-
-void ossimPpjFrameSensor::setAveragePrjectedHeight(double averageProjectedHeight)
-{
-   m_averageProjectedHeight = averageProjectedHeight;
-}
-
-void ossimPpjFrameSensor::imagingRay(const ossimDpt& imagePoint,
-                                     ossimEcefRay& imageRay) const
-{
-   // Form camera frame LOS vector
-   ossimColumnVector3d camLOS(imagePoint.x - m_principalPoint.x,
-                              imagePoint.y - m_principalPoint.y,
-                              m_adjustedFocalLength);   
-
-   // Rotate to ECF
-   ossimColumnVector3d ecfLOS = m_ecef2CamInverse * camLOS;
-   imageRay.setOrigin(m_adjustedCameraPosition);
-   ossimEcefVector ecfRayDir(ecfLOS);
-   imageRay.setDirection(ecfRayDir);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPpjFrameSensor::imagingRay DEBUG:\n"
-         << "  camLOS = " << camLOS << "\n"
-         << "  m_adjustedPlatformPosition = " << m_adjustedCameraPosition << "\n"
-         << "  imageRay = " << imageRay << "\n"
-         << std::endl;
-   }
-
-}
-
-void ossimPpjFrameSensor::lineSampleToWorld(const ossimDpt& imagePoint,
-                                                ossimGpt& worldPt) const
-{
-   ossimEcefRay ray;
-   imagingRay(imagePoint, ray);
-   ossimElevManager::instance()->intersectRay(ray, worldPt, m_averageProjectedHeight);
-}  
-
-void ossimPpjFrameSensor::lineSampleHeightToWorld(const ossimDpt& imagePoint,
-                                                  const double&   heightEllipsoid,
-                                                        ossimGpt& worldPt) const
-{
-   ossimEcefRay ray;
-   imagingRay(imagePoint, ray);
-   double h = (ossim::isnan(heightEllipsoid)||ossim::almostEqual(heightEllipsoid, 0.0))?m_averageProjectedHeight:heightEllipsoid;
-   ossimEcefPoint pecf(ray.intersectAboveEarthEllipsoid(h));
-   worldPt = ossimGpt(pecf);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimPpjFrameSensor::lineSampleHeightToWorld DEBUG:" << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "  imagePoint = " << imagePoint << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "  heightEllipsoid = " << heightEllipsoid << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "  ray = " << ray << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "  worldPt = " << worldPt << std::endl;
-   }
-}
-
-void ossimPpjFrameSensor::worldToLineSample(const ossimGpt& world_point,
-                                             ossimDpt&       image_point) const
-{   
-   ossimGpt wpt = world_point;
-   if(wpt.isHgtNan())
-   {
-      wpt.height(m_averageProjectedHeight);
-   }
-   ossimEcefPoint gnd_ecf(wpt);
-   ossimEcefPoint cam_ecf(m_adjustedCameraPosition);
-   ossimEcefVector ecfRay(gnd_ecf - cam_ecf);
-   ossimColumnVector3d camRay(m_ecef2Cam*ecfRay.data());   
-      
-   double x = m_principalPoint.x + m_adjustedFocalLength*camRay[0]/camRay[2];
-   double y = m_principalPoint.y + m_adjustedFocalLength*camRay[1]/camRay[2];
-
-   ossimDpt p(x, y);
-    
-   image_point = p;
-}
-
-void ossimPpjFrameSensor::updateModel()
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPpjFrameSensor::updateModel DEBUG:" << std::endl;
-   }
-
-   double deltap = computeParameterOffset(PARAM_ADJ_LAT_OFFSET)/
-      m_cameraPositionEllipsoid.metersPerDegree().y;
-   double deltal = computeParameterOffset(PARAM_ADJ_LON_OFFSET)/
-      m_cameraPositionEllipsoid.metersPerDegree().x;
-   
-   m_adjustedCameraPosition = ossimGpt(m_cameraPositionEllipsoid.latd()   + deltap,
-                                       m_cameraPositionEllipsoid.lond()   + deltal,
-                                       m_cameraPositionEllipsoid.height() + computeParameterOffset(PARAM_ADJ_ALTITUDE_OFFSET));
-
-   // TODO  Need to add correction matrix to accomodate orientation offsets.  It
-   //       shouldn't be done in ECF frame.
-   // double r = ossim::degreesToRadians(m_roll  + computeParameterOffset(PARAM_ADJ_ROLL_OFFSET));
-   // double p = ossim::degreesToRadians(m_pitch + computeParameterOffset(PARAM_ADJ_PITCH_OFFSET) );
-   // double y = ossim::degreesToRadians(m_yaw   + computeParameterOffset(PARAM_ADJ_YAW_OFFSET));
-   // NEWMAT::Matrix rollM   = ossimMatrix3x3::create(1, 0, 0,
-   //                                                 0, cos(r), sin(r),
-   //                                                 0, -sin(r), cos(r));
-   // NEWMAT::Matrix pitchM  = ossimMatrix3x3::create(cos(p), 0, -sin(p),
-   //                                                 0,      1, 0,
-   //                                                 sin(p), 0, cos(p));
-   // NEWMAT::Matrix yawM    = ossimMatrix3x3::create(cos(y), sin(y), 0,
-   //                                                 -sin(y), cos(y), 0,
-   //                                                 0,0,1); 
-   
-   m_adjustedFocalLength = m_focalLength + computeParameterOffset(PARAM_ADJ_FOCAL_LENGTH_OFFSET);
-   
-     
-   try
-   {
-      computeGsd();
-   }
-   catch(...)
-   {
-      
-   }
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPpjFrameSensor::updateModel complete..." << std::endl;
-   }
-   /*
-   ossimGpt gpt;
-   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
-   theBoundGndPolygon[0] = gpt;
-   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
-   theBoundGndPolygon[1] = gpt;
-   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
-   theBoundGndPolygon[2] = gpt;
-   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
-   theBoundGndPolygon[3] = gpt;
-   */
-}
-
-void ossimPpjFrameSensor::initAdjustableParameters()
-{
-   if (traceExec())
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimPpjFrameSensor::initAdjustableParameters: returning..." << std::endl;
-   resizeAdjustableParameterArray(PARAM_ADJ_COUNT);
-   
-   setAdjustableParameter(PARAM_ADJ_LON_OFFSET, 0.0);
-   setParameterDescription(PARAM_ADJ_LON_OFFSET, "lon_offset");
-   setParameterUnit(PARAM_ADJ_LON_OFFSET, "meters");
-   setParameterSigma(PARAM_ADJ_LON_OFFSET, 10);
-   
-   setAdjustableParameter(PARAM_ADJ_LAT_OFFSET, 0.0);
-   setParameterDescription(PARAM_ADJ_LAT_OFFSET, "lat_offset");
-   setParameterUnit(PARAM_ADJ_LAT_OFFSET, "meters");
-   setParameterSigma(PARAM_ADJ_LAT_OFFSET, 10);
-   
-   setAdjustableParameter(PARAM_ADJ_ALTITUDE_OFFSET, 0.0);
-   setParameterDescription(PARAM_ADJ_ALTITUDE_OFFSET, "altitude_offset");
-   setParameterUnit(PARAM_ADJ_ALTITUDE_OFFSET, "meters");
-   setParameterSigma(PARAM_ADJ_ALTITUDE_OFFSET, 10);
-   
-   // TODO  Add these back in when orientation angle offsets are fixed.
-   // setAdjustableParameter(PARAM_ADJ_ROLL_OFFSET, 0.0);
-   // setParameterDescription(PARAM_ADJ_ROLL_OFFSET, "roll_offset");
-   // setParameterUnit(PARAM_ADJ_ROLL_OFFSET, "degrees");
-   // setParameterSigma(PARAM_ADJ_ROLL_OFFSET, 10);
-   
-   // setAdjustableParameter(PARAM_ADJ_PITCH_OFFSET, 0.0);
-   // setParameterDescription(PARAM_ADJ_PITCH_OFFSET, "pitch_offset");
-   // setParameterUnit(PARAM_ADJ_PITCH_OFFSET, "degrees");
-   // setParameterSigma(PARAM_ADJ_PITCH_OFFSET, 10);
-   
-   // setAdjustableParameter(PARAM_ADJ_YAW_OFFSET, 0.0);
-   // setParameterDescription(PARAM_ADJ_YAW_OFFSET, "yaw_offset");
-   // setParameterUnit(PARAM_ADJ_YAW_OFFSET, "degrees");
-   // setParameterSigma(PARAM_ADJ_YAW_OFFSET, .04);
-   
-   setAdjustableParameter(PARAM_ADJ_FOCAL_LENGTH_OFFSET, 0.0);
-   setParameterDescription(PARAM_ADJ_FOCAL_LENGTH_OFFSET, "focal_length_offset");
-   setParameterUnit(PARAM_ADJ_FOCAL_LENGTH_OFFSET, "pixels");
-   setParameterSigma(PARAM_ADJ_FOCAL_LENGTH_OFFSET, 20.0);   
-}
-
-bool ossimPpjFrameSensor::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPpjFrameSensor::loadState DEBUG:" << std::endl;
-   }
-
-   theGSD.makeNan();
-   theRefImgPt.makeNan();
-   ossimSensorModel::loadState(kwl, prefix);
-   if(getNumberOfAdjustableParameters() < 1)
-   {
-      initAdjustableParameters();
-   }
-   ossimString principal_point = kwl.find(prefix, "principal_point");
-   ossimString focal_length_x = kwl.find(prefix, "focal_length_x");
-   ossimString focal_length_y = kwl.find(prefix, "focal_length_y");
-   ossimString number_samples = kwl.find(prefix, "number_samples");
-   ossimString number_lines = kwl.find(prefix, "number_lines");
-   ossimString ecf_to_cam_row1 = kwl.find(prefix, "ecf_to_cam_row1");
-   ossimString ecf_to_cam_row2 = kwl.find(prefix, "ecf_to_cam_row2");
-   ossimString ecf_to_cam_row3 = kwl.find(prefix, "ecf_to_cam_row3");
-   ossimString platform_position = kwl.find(prefix, "ecef_camera_position");
-   ossimString averageProjectedHeight = kwl.find(prefix, "average_projected_height");
-
-   // ossimString roll;
-   // ossimString pitch;
-   // ossimString yaw;
-   // m_roll    = 0;
-   // m_pitch   = 0;
-   // m_yaw     = 0;
-   // roll      = kwl.find(prefix, "roll"); 
-   // pitch     = kwl.find(prefix, "pitch"); 
-   // yaw       = kwl.find(prefix, "yaw"); 
-
-   bool result = (!principal_point.empty()&&
-                  !focal_length_x.empty()&&
-                  !platform_position.empty()&&
-                  !ecf_to_cam_row1.empty()&&
-                  !ecf_to_cam_row2.empty()&&
-                  !ecf_to_cam_row3.empty());
-   if(!averageProjectedHeight.empty())
-   {
-      m_averageProjectedHeight = averageProjectedHeight.toDouble();
-   }
-   if(!number_samples.empty())
-   {
-      theImageSize = ossimIpt(number_samples.toDouble(), number_lines.toDouble());
-      theRefImgPt = ossimDpt(theImageSize.x*.5, theImageSize.y*.5);
-      theImageClipRect = ossimDrect(0,0,theImageSize.x-1, theImageSize.y-1);
-   }
-   if(theImageClipRect.hasNans())
-   {
-      theImageClipRect = ossimDrect(0,0,theImageSize.x-1,theImageSize.y-1);
-   }
-   if(theRefImgPt.hasNans())
-   {
-      theRefImgPt = theImageClipRect.midPoint();
-   }
-   if(!focal_length_x.empty())
-   {
-      m_focalLengthX = focal_length_x.toDouble();
-      m_focalLength = m_focalLengthX;
-   }
-   if(!focal_length_y.empty())
-   {
-      m_focalLengthY = focal_length_y.toDouble();
-   }
-
-   std::vector<ossimString> row;
-   if(!ecf_to_cam_row1.empty())
-   {
-      row = ecf_to_cam_row1.explode(" ");
-      for (int i=0; i<3; ++i)
-         m_ecef2Cam[0][i] = row[i].toDouble();
-      row = ecf_to_cam_row2.explode(" ");
-      for (int i=0; i<3; ++i)
-         m_ecef2Cam[1][i] = row[i].toDouble();
-      row = ecf_to_cam_row3.explode(" ");
-      for (int i=0; i<3; ++i)
-         m_ecef2Cam[2][i] = row[i].toDouble();
-      m_ecef2CamInverse = m_ecef2Cam.t();
-   }
-
-   // if(!roll.empty())
-   // {
-   //    m_roll = roll.toDouble();
-   // }
-   // if(!pitch.empty())
-   // {
-   //    m_pitch = pitch.toDouble();
-   // }
-   // if(!yaw.empty())
-   // {
-   //    m_yaw   = yaw.toDouble();
-   // }
-
-   if(!principal_point.empty())
-   {
-      m_principalPoint.toPoint(principal_point);
-   }
-   if(!platform_position.empty())
-   {
-      m_ecefCameraPosition.toPoint(platform_position);
-      m_cameraPositionEllipsoid = ossimGpt(m_ecefCameraPosition);
-   }
-
-   
-   updateModel();
-   
-   if(theGSD.isNan())
-   {
-      try
-      {
-         computeGsd();
-      }
-      catch (const ossimException& e)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimPpjFrameSensor::loadState Caught Exception:\n"
-            << e.what() << std::endl;
-         }
-      }
-   }
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimPpjFrameSensor::loadState complete..." << std::endl;
-   }
-   
-   return result;
-}
-
-bool ossimPpjFrameSensor::saveState(ossimKeywordlist& kwl, const char* prefix)const
-{
-   ossimSensorModel::saveState(kwl, prefix);
-   // kwl.add(prefix, "roll", ossimString::toString(m_roll), true);
-   // kwl.add(prefix, "pitch", ossimString::toString(m_pitch), true);
-   // kwl.add(prefix, "yaw", ossimString::toString(m_yaw), true);
-   kwl.add(prefix, "gsd", theGSD.toString(), true);
-   kwl.add(prefix, "principal_point", m_principalPoint.toString(), true);
-   kwl.add(prefix, "ecef_camera_position",m_ecefCameraPosition.toString() ,true);
-   kwl.add(prefix, "focal_length_x", ossimString::toString(m_focalLengthX) ,true);
-   kwl.add(prefix, "focal_length_y", ossimString::toString(m_focalLengthY) ,true);
-   kwl.add(prefix, "image_size", theImageSize.toString() ,true);
-   kwl.add(prefix, "average_projected_height", m_averageProjectedHeight, true);
-   ossimString row1 = ossimString::toString(m_ecef2Cam[0][0]) + " " +
-                      ossimString::toString(m_ecef2Cam[0][1]) + " " +
-                      ossimString::toString(m_ecef2Cam[0][2]);
-   kwl.add(prefix, "ecf_to_cam_row1", row1, true);
-   ossimString row2 = ossimString::toString(m_ecef2Cam[1][0]) + " " +
-                      ossimString::toString(m_ecef2Cam[1][1]) + " " +
-                      ossimString::toString(m_ecef2Cam[1][2]);
-   kwl.add(prefix, "ecf_to_cam_row2", row2, true);
-   ossimString row3 = ossimString::toString(m_ecef2Cam[2][0]) + " " +
-                      ossimString::toString(m_ecef2Cam[2][1]) + " " +
-                      ossimString::toString(m_ecef2Cam[2][2]);
-   kwl.add(prefix, "ecf_to_cam_row3", row3, true);
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimProjectionFactoryBase.cpp b/ossim/src/ossim/projection/ossimProjectionFactoryBase.cpp
deleted file mode 100644
index 9fa7a39..0000000
--- a/ossim/src/ossim/projection/ossimProjectionFactoryBase.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//*******************************************************************
-//  $Id: ossimProjectionFactoryBase.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/projection/ossimProjectionFactoryBase.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/imaging/ossimImageHandler.h>
-//---
-// Define Trace flags for use within this file:
-//---
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceDebug = ossimTrace("ossimProjectionFactoryBase:debug");
-
-RTTI_DEF1(ossimProjectionFactoryBase, "ossimProjectionFactoryBase", ossimObjectFactory);
-
-ossimProjection* ossimProjectionFactoryBase::createProjectionFromGeometryFile(const ossimFilename& imageFile, ossim_uint32 entryIdx)const
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimProjectionFactoryBase::createProjectionFromGeometryFile "
-         << "DEBUG:"
-         << "\nimageFile:  " << imageFile
-         << "\nentryIdx:   " << entryIdx
-         << std::endl;
-   }
-
-   // Try to find a geometry file for imageFile.
-   
-   ossimFilename geomFile = imageFile;
-   if (entryIdx == 0)
-   {
-      geomFile.setExtension("geom");
-      if(geomFile.exists())
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "Found geometry file:  " << geomFile
-               << std::endl;
-         }
-
-         ossimKeywordlist kwl;
-         if(kwl.addFile(geomFile))
-         {
-            //---
-            // Add the geometry file to the keyword list.
-            // This was added for ossimCoarseGridModel so it can pick up the
-            // file.ocg with a relative path.
-            //
-            // NOTE: The can't be called "geometry_file" as it causes an infinite loop in the factory
-            // code. (drb - 20140211)
-            //---
-            kwl.addPair( std::string("kwl_source"),
-                         geomFile.expand().string(),
-                         false); // Don't overwrite if in there already.
-            
-            return ossimProjectionFactoryRegistry::instance()->
-               createProjection(kwl);
-         }
-      }
-   }
-
-   // Look for an indexed geometry file.
-   geomFile = imageFile.fileNoExtension();
-   geomFile += "_e";
-   geomFile += ossimString::toString(entryIdx);
-   geomFile.setExtension("geom");
-   if(geomFile.exists())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Found geometry file:  " << geomFile
-            << std::endl;
-      }
-      
-      ossimKeywordlist kwl;
-      if(kwl.addFile(geomFile))
-      {
-         return ossimProjectionFactoryRegistry::instance()->
-            createProjection(kwl);
-      }
-   }   
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG:  No geometry file found.  Returning NULL..."
-         << std::endl;
-   }
-
-   return NULL;
-}
-
-ossimProjection* ossimProjectionFactoryBase::createProjection(ossimImageHandler* handler)const
-{
-   if(!handler) return 0;
-   return createProjection(handler->getFilename(), handler->getCurrentEntry());
-}
-
-
diff --git a/ossim/src/ossim/projection/ossimProjectionFactoryRegistry.cpp b/ossim/src/ossim/projection/ossimProjectionFactoryRegistry.cpp
deleted file mode 100644
index 526cab9..0000000
--- a/ossim/src/ossim/projection/ossimProjectionFactoryRegistry.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-//*******************************************************************
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimProjectionFactoryRegistry.cpp 22898 2014-09-29 15:22:32Z okramer $
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimProjectionFactoryBase.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-#include <ossim/projection/ossimNgaProjectionFactory.h>
-#include <ossim/projection/ossimWktProjectionFactory.h>
-#include <ossim/projection/ossimMapProjectionFactory.h>
-#include <ossim/projection/ossimTiffProjectionFactory.h>
-#include <ossim/projection/ossimNitfProjectionFactory.h>
-#include <ossim/projection/ossimSensorModelFactory.h>
-#include <ossim/projection/ossimMiscProjectionFactory.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <algorithm>
-#include <vector>
-
-//ossimProjectionFactoryRegistry* ossimProjectionFactoryRegistry::m_instance = 0;
-
-
-ossimProjectionFactoryRegistry::ossimProjectionFactoryRegistry()
-{
-   initializeDefaults();
-   ossimObjectFactoryRegistry::instance()->registerFactory(this);
-}
-
-ossimProjectionFactoryRegistry::ossimProjectionFactoryRegistry(const ossimProjectionFactoryRegistry& rhs)
-:
-ossimObjectFactory(rhs)
-{}
-
-void ossimProjectionFactoryRegistry::operator=(const ossimProjectionFactoryRegistry&)
-{}
-
-ossimProjectionFactoryRegistry::~ossimProjectionFactoryRegistry()
-{
-}
-
-ossimProjectionFactoryRegistry* ossimProjectionFactoryRegistry::instance()
-{
-   static ossimProjectionFactoryRegistry inst;
-
-   return &inst;
-   //   if(!m_instance)
-//   {
-//      m_instance = new ossimProjectionFactoryRegistry();
-//   }
-   
-//   return m_instance;
-}
-
-ossimProjection*
-ossimProjectionFactoryRegistry::createProjection(const ossimFilename& name,
-                                                 ossim_uint32 entryIdx)const
-{
-   ossimProjection* result = 0;
-   ossim_uint32 idx = 0;
-   for(idx = 0; ((idx < m_factoryList.size())&&(!result)); ++idx)
-   {
-      result = m_factoryList[idx]->createProjection(name, entryIdx);
-   }
-   
-   return result;
-}
-
-ossimProjection* ossimProjectionFactoryRegistry::createProjection(ossimImageHandler* handler)const
-{
-   ossimProjection* result = 0;
-   ossim_uint32 idx = 0;
-   for(idx = 0; ((idx < m_factoryList.size())&&(!result)); ++idx)
-   {
-      result = m_factoryList[idx]->createProjection(handler);
-   }
-   
-   return result;
-}
-
-ossimProjection* ossimProjectionFactoryRegistry::createProjection(
-   const ossimKeywordlist& kwl, const char* prefix)const
-{
-   ossimProjection* result = 0;//createNativeObjectFromRegistry(kwl, prefix); 
-   ossim_uint32 idx = 0; 
-   for(idx = 0; ((idx < m_factoryList.size())&&!result);++idx) 
-   { 
-      result = m_factoryList[idx]->createProjection(kwl, prefix); 
-   } 
-   
-   if ( (result == 0) && (prefix == 0) )
-   {
-      //---
-      // Check for an embedded prefix like "image0."
-      //
-      // This is a workaround for people who use the "image_info" application
-      // to create a geometry file.
-      //
-      // If the image has an external geometry file and it has a prefix like
-      // "image0." and someone does:
-      //
-      // theInputConnection->getImageGeometry(kwl);
-      // ossimRefPtr<ossimProjection> proj =
-      // ossimProjectionFactoryRegistry::instance()->createProjection(kwl);
-      //
-      // It will fail because the factory doesn't know it has a prefix.
-      //
-      // ESH 01/2009: I've changed the following so that not just the first
-      // line is checked for "image" and ".".  If the image_info .geom file
-      // was created with the -m (metadata) option, the first lines of the
-      // file will not have the expected structure.
-      //---
-      bool bFoundImageLine = false;
-      ossimKeywordlist::KeywordMap::const_iterator i = kwl.getMap().begin();
-      while ( (i != kwl.getMap().end()) && (bFoundImageLine == false) )
-      {
-         ossimString s1 = (*i).first;
-         if ( s1.size() )
-         {
-            std::vector<ossimString> v;
-            s1.split(v, ossimString("."));
-            if ( v.size() )
-            {
-               if ( v[0].contains("image") )
-               {
-                  bFoundImageLine = true;
-                  ossimString s2 = v[0];
-                  s2 += ".";
-                  idx = 0;
-                  for(;((idx < m_factoryList.size())&&!result); ++idx)
-                  {
-                     result =  m_factoryList[idx]->createProjection(kwl, s2.c_str());
-                  }
-               }
-            }
-         }
-
-         // Go to the next line of the .geom file
-         ++i;
-      }
-   }
-
-   return result;
-}
-
-void ossimProjectionFactoryRegistry::initializeDefaults()
-{
-   registerFactory(ossimSensorModelFactory::instance());
-   registerFactory(ossimNitfProjectionFactory::instance());
-   registerFactory(ossimTiffProjectionFactory::instance());
-   registerFactory(ossimWktProjectionFactory::instance());
-   registerFactory(ossimMapProjectionFactory::instance());
-   registerFactory(ossimMiscProjectionFactory::instance());
-   registerFactory(ossimNgaProjectionFactory::instance());
-
-   // KEEP THIS LAST PLEASE!
-   // This factory constructs map projections from EPSG codes. An infinite loop will occur if this
-   // is placed before the explicit (non-coded) factories, since this factory will invoke the above
-   // factories via this registry after populating a KWL which includes a PCS code. If this factory
-   // sees that request before the others, it will be caught in a loop.
-   registerFactory(ossimEpsgProjectionFactory::instance()); 
-}
-
-extern "C"
-{
-  void* ossimProjectionFactoryRegistryGetInstance()
-  {
-    return ossimProjectionFactoryRegistry::instance();
-  }
-
-}
diff --git a/ossim/src/ossim/projection/ossimQuickbirdRpcModel.cpp b/ossim/src/ossim/projection/ossimQuickbirdRpcModel.cpp
deleted file mode 100644
index a4ffda4..0000000
--- a/ossim/src/ossim/projection/ossimQuickbirdRpcModel.cpp
+++ /dev/null
@@ -1,497 +0,0 @@
-//*****************************************************************************
-// FILE: ossimQuickbirdRpcModel.cpp
-//
-// License:  See top level LICENSE.txt file.
-//
-// DESCRIPTION: Contains declaration of class ossimQuickbirdRpcModel. This 
-//    derived class implements the capability of reading Quickbird RPC support
-//    data.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimQuickbirdRpcModel.cpp 23564 2015-10-02 14:12:25Z dburken $
-
-#include <ossim/projection/ossimQuickbirdRpcModel.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/support_data/ossimQuickbirdRpcHeader.h>
-#include <ossim/support_data/ossimQuickbirdTile.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/support_data/ossimNitfRpcBase.h>
-#include <ossim/support_data/ossimNitfUse00aTag.h>
-#include <ossim/support_data/ossimNitfPiaimcTag.h>
-#include <ossim/imaging/ossimTiffTileSource.h>
-#include <ossim/imaging/ossimQbTileFilesHandler.h>
-
-static const char* RPC00A_TAG = "RPC00A";
-static const char* RPC00B_TAG = "RPC00B";
-static const char* PIAIMC_TAG = "PIAIMC";
-static const char* USE00A_TAG = "USE00A";
-
-RTTI_DEF1(ossimQuickbirdRpcModel, "ossimQuickbirdRpcModel", ossimRpcModel);
-
-
-//*************************************************************************************************
-// Constructor
-//*************************************************************************************************
-ossimQuickbirdRpcModel::ossimQuickbirdRpcModel()
-   :ossimRpcModel(),
-    theSupportData(new ossimQuickbirdMetaData())
-{
-}
-
-//*************************************************************************************************
-// Constructor
-//*************************************************************************************************
-ossimQuickbirdRpcModel::ossimQuickbirdRpcModel(const ossimQuickbirdRpcModel& rhs)
-   : ossimRpcModel(rhs),
-     theSupportData(new ossimQuickbirdMetaData())
-{
-}
-
-//*************************************************************************************************
-//! Constructor for multiple tile-files sharing common RPC model initializes given pointer
-//! to multi-tile-files handler.
-//*************************************************************************************************
-ossimQuickbirdRpcModel::ossimQuickbirdRpcModel(const ossimQbTileFilesHandler* handler)
-:  ossimRpcModel(),
-   theSupportData(new ossimQuickbirdMetaData())
-{
-   setErrorStatus();
-   if (!handler)
-      return;
-
-   // Make the gsd nan so it gets computed.
-   theGSD.makeNan();
-
-   theImageClipRect = handler->getImageRectangle();
-
-   ossimFilename imageFile = handler->getFilename();
-   if (!parseRpcData(imageFile))
-      return;
-
-   finishConstruction();
-   clearErrorStatus();
-   return;
-}
-
-//*************************************************************************************************
-// Destructor
-//*************************************************************************************************
-ossimQuickbirdRpcModel::~ossimQuickbirdRpcModel()
-{
-   theSupportData = 0;
-}
-
-//*************************************************************************************************
-// Infamous DUP 
-//*************************************************************************************************
-ossimObject* ossimQuickbirdRpcModel::dup() const
-{
-   return new ossimQuickbirdRpcModel(*this);
-}
-
-//*************************************************************************************************
-//! Public method for parsing generic image file.
-//*************************************************************************************************
-bool ossimQuickbirdRpcModel::parseFile(const ossimFilename& file)
-{
-   if (!parseNitfFile(file))
-   {
-      return parseTiffFile(file);
-   }
-   return true;
-}
-
-//*************************************************************************************************
-//! Parses a NITF image file for RPC info. Returns TRUE if successful.
-//*************************************************************************************************
-bool ossimQuickbirdRpcModel::parseNitfFile(const ossimFilename& file)
-{
-   setErrorStatus();
-   ossimFilename nitfFile = file;
-   
-   ossimRefPtr<ossimNitfFile> nitfFilePtr = new ossimNitfFile;
-   
-   if(!nitfFilePtr->parseFile(nitfFile))
-   {
-      nitfFile = nitfFile.setExtension("NTF");
-      if(!nitfFilePtr->parseFile(nitfFile))
-      {
-         nitfFile = nitfFile.setExtension("ntf");
-         if(!nitfFilePtr->parseFile(nitfFile))
-            return false;
-      }
-   }
-   
-   ossimRefPtr<ossimNitfImageHeader> ih = nitfFilePtr->getNewImageHeader(0);
-   if (!ih)
-      return false;
-
-   theImageClipRect = ih->getImageRect();
- 
-   // Give preference to external RPC data file:
-   bool useInternalRpcTags = false;
-   if(!parseRpcData(file))
-      useInternalRpcTags = true;
-   if (!parseTileData(file))
-      return false;
- 
-   // Check for IMD (metadata) file:
-   parseMetaData(file);
-
-   // Get the gsd.
-   theGSD.line = ossim::nan();
-   theGSD.samp = ossim::nan();
-   
-   ossimRefPtr<ossimNitfRegisteredTag> tag;
-   tag = ih->getTagData(PIAIMC_TAG);
-   if (tag.valid())
-   {
-      ossimNitfPiaimcTag* p = PTR_CAST(ossimNitfPiaimcTag, tag.get());
-      if (p)
-      {
-         theGSD.line = p->getMeanGsdInMeters();
-         theGSD.samp = theGSD.line;
-      }
-   }
-   if (ossim::isnan(theGSD.line))
-   {
-      tag = ih->getTagData(USE00A_TAG);
-      if (tag.valid())
-      {
-         ossimNitfUse00aTag* p = PTR_CAST(ossimNitfUse00aTag, tag.get());
-         if (p)
-         {
-            theGSD.line = p->getMeanGsdInMeters();
-            theGSD.samp = theGSD.line;
-         }
-      }
-   }
-
-   // If external RPC data file was correctly parsed, then we can bypass this code block. Otherwise
-   // need to parse internal NITF tags for RPC data:
-   if (useInternalRpcTags)
-   {
-      // Get the the RPC tag:
-      ossimNitfRpcBase* rpcTag = NULL;
-      
-      // Look for the RPC00B tag first.
-      tag = ih->getTagData(RPC00B_TAG);
-      if (tag.valid())
-         rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
-      
-      if (!tag.valid())
-      {
-         // Look for RPC00A tag.
-         tag = ih->getTagData(RPC00A_TAG);
-         if (tag.valid())
-            rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
-      }
-      
-      if (!rpcTag)
-         return false;
-      
-      // Set the polynomial type.
-      if (rpcTag->getRegisterTagName() == "RPC00B")
-         thePolyType = B;
-      else
-         thePolyType = A;
-
-      // Parse coefficients:
-      for (ossim_uint32 i=0; i<20; ++i)
-      {
-         theLineNumCoef[i] = rpcTag->getLineNumeratorCoeff(i).toFloat64();
-         theLineDenCoef[i] = rpcTag->getLineDenominatorCoeff(i).toFloat64();
-         theSampNumCoef[i] = rpcTag->getSampleNumeratorCoeff(i).toFloat64();
-         theSampDenCoef[i] = rpcTag->getSampleDenominatorCoeff(i).toFloat64();
-      }
-
-      // Initialize other items in tags:
-      theLineScale  = rpcTag->getLineScale().toFloat64();
-      theSampScale  = rpcTag->getSampleScale().toFloat64();
-      theLatScale   = rpcTag->getGeodeticLatScale().toFloat64();
-      theLonScale   = rpcTag->getGeodeticLonScale().toFloat64();
-      theHgtScale   = rpcTag->getGeodeticHeightScale().toFloat64();
-      theLineOffset = rpcTag->getLineOffset().toFloat64();
-      theSampOffset = rpcTag->getSampleOffset().toFloat64();
-      theLatOffset  = rpcTag->getGeodeticLatOffset().toFloat64();
-      theLonOffset  = rpcTag->getGeodeticLonOffset().toFloat64();
-      theHgtOffset  = rpcTag->getGeodeticHeightOffset().toFloat64();
-      theImageID    = ih->getImageId();
-   }
-
-   finishConstruction();
-   clearErrorStatus();
-   return true;
-}
-
-//*************************************************************************************************
-//! Parses a tagged TIFF image file for RPC info. Returns TRUE if successful.
-//*************************************************************************************************
-bool ossimQuickbirdRpcModel::parseTiffFile(const ossimFilename& file)
-{
-   setErrorStatus();
-
-   // Make the gsd nan so it gets computed.
-   theGSD.makeNan();
-
-   ossimFilename tiffFile = file;
-   ossimRefPtr<ossimTiffTileSource> tiff = new ossimTiffTileSource();
-   if (!tiff->open(file))
-   {
-      return false;
-   }
-
-   theImageClipRect = tiff->getImageRectangle();
-
-   parseMetaData(file);
-
-   if (!parseRpcData(file))
-      return false;
-
-   if (!parseTileData(file))
-      return false;
-
-   finishConstruction();
-   clearErrorStatus();
-   return true;
-}
-
-//*************************************************************************************************
-//! Given some base name for the image data, parses the associated RPC data file. Returns TRUE
-//! if successful
-//*************************************************************************************************
-bool ossimQuickbirdRpcModel::parseRpcData(const ossimFilename& base_name)
-{
-   ossimFilename rpcFile (base_name);
-
-   // There are two possibilities for RPC data files: either each image file has its own RPC data
-   // file, or a single RPC file is provided for a multi-tile scene.
-   rpcFile.setExtension("RPB");
-   if (!findSupportFile(rpcFile))
-   {
-      rpcFile.setExtension("RPA");
-      if (!findSupportFile(rpcFile))
-         return false;
-   }
-
-   // An RPC file was located, open it:
-   ossimQuickbirdRpcHeader hdr;
-   if(!hdr.open(rpcFile))
-      return false;
-
-   if(hdr.isAPolynomial())
-      thePolyType = A;
-   else
-      thePolyType = B;
-
-   std::copy(hdr.theLineNumCoeff.begin(), hdr.theLineNumCoeff.end(), theLineNumCoef);
-   std::copy(hdr.theLineDenCoeff.begin(), hdr.theLineDenCoeff.end(), theLineDenCoef);
-   std::copy(hdr.theSampNumCoeff.begin(), hdr.theSampNumCoeff.end(), theSampNumCoef);
-   std::copy(hdr.theSampDenCoeff.begin(), hdr.theSampDenCoeff.end(), theSampDenCoef);
-
-   theLineScale  = hdr.theLineScale;
-   theSampScale  = hdr.theSampScale;
-   theLatScale   = hdr.theLatScale;
-   theLonScale   = hdr.theLonScale;
-   theHgtScale   = hdr.theHeightScale;
-   theLineOffset = hdr.theLineOffset;
-   theSampOffset = hdr.theSampOffset;
-   theLatOffset  = hdr.theLatOffset;
-   theLonOffset  = hdr.theLonOffset;
-   theHgtOffset  = hdr.theHeightOffset;
-   theImageID    = rpcFile.fileNoExtension();
-
-   return true;
-}
-
-
-//*************************************************************************************************
-//! Initializes the support data member with metadata file info. Returns TRUE if successful
-//*************************************************************************************************
-bool ossimQuickbirdRpcModel::parseMetaData(const ossimFilename& base_name)
-{
-
-   ossimFilename metadataFile (base_name);
-   metadataFile.setExtension("IMD");
-   if (!findSupportFile(metadataFile))
-      return false;
-
-   if ( !theSupportData.valid() )
-      theSupportData = new ossimQuickbirdMetaData();
-
-   if(!theSupportData->open(metadataFile))
-   {
-      theSupportData = 0; // ossimRefPtr
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimQuickbirdRpcModel::parseNitfFile WARNING:"
-         << "\nCould not open IMD file.  Sensor ID unknown." << std::endl;
-      return false;
-   }
-
-   theSensorID = theSupportData->getSatID();
-   return true;
-}
-
-//*************************************************************************************************
-//! Reads the TIL file for pertinent info. Returns TRUE if successful
-//*************************************************************************************************
-bool ossimQuickbirdRpcModel::parseTileData(const ossimFilename& image_file)
-{
-   ossimFilename tileFile (image_file);
-   tileFile.setExtension("TIL");
-  if (!findSupportFile(tileFile))
-      return false;
-   ossimQuickbirdTile tileHdr;
-   if(!tileHdr.open(tileFile))
-      return false;
-
-   ossimQuickbirdTileInfo info;
-   if(!tileHdr.getInfo(info, image_file.file()))
-      return false;
-   if((info.theUlXOffset != OSSIM_INT_NAN) && (info.theUlYOffset != OSSIM_INT_NAN) &&
-      (info.theLrXOffset != OSSIM_INT_NAN) && (info.theLrYOffset != OSSIM_INT_NAN) &&
-      (info.theLlXOffset != OSSIM_INT_NAN) && (info.theLlYOffset != OSSIM_INT_NAN) &&
-      (info.theUrXOffset != OSSIM_INT_NAN) && (info.theUrYOffset != OSSIM_INT_NAN))
-   {
-      theImageClipRect = ossimIrect(ossimIpt(info.theUlXOffset, info.theUlYOffset),
-                                    ossimIpt(info.theUrXOffset, info.theUrYOffset),
-                                    ossimIpt(info.theLrXOffset, info.theLrYOffset),
-                                    ossimIpt(info.theLlXOffset, info.theLlYOffset));
-   }
-   else if ((info.theUlXOffset != OSSIM_INT_NAN) && (info.theUlYOffset != OSSIM_INT_NAN) &&
-      (theImageClipRect.width() != OSSIM_INT_NAN) && (theImageClipRect.height() != OSSIM_INT_NAN))
-   {
-      theImageClipRect = ossimIrect(info.theUlXOffset, info.theUlYOffset,
-                                    info.theUlXOffset+theImageClipRect.width()-1, 
-                                    info.theUlYOffset+theImageClipRect.height()-1);
-   }
-
-   return true;
-}
-
-//*************************************************************************************************
-//! Collects common code among all parsers
-//*************************************************************************************************
-void ossimQuickbirdRpcModel::finishConstruction()
-{
-   theImageSize.line = theImageClipRect.height();
-   theImageSize.samp = theImageClipRect.width();
-   theRefImgPt.line = theImageClipRect.midPoint().y;
-   theRefImgPt.samp = theImageClipRect.midPoint().x;
-   theRefGndPt.lat = theLatOffset;
-   theRefGndPt.lon = theLonOffset;
-   theRefGndPt.hgt = theHgtOffset;
-
-   //---
-   // NOTE:  We must call "updateModel()" to set parameter used by base
-   // ossimRpcModel prior to calling lineSampleHeightToWorld or all
-   // the world points will be same.
-   //---
-   updateModel();
-
-   ossimGpt v0, v1, v2, v3;
-   lineSampleHeightToWorld(theImageClipRect.ul(), theHgtOffset, v0);
-   lineSampleHeightToWorld(theImageClipRect.ur(), theHgtOffset, v1);
-   lineSampleHeightToWorld(theImageClipRect.lr(), theHgtOffset, v2);
-   lineSampleHeightToWorld(theImageClipRect.ll(), theHgtOffset, v3);
-
-   theBoundGndPolygon = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
-
-   // Set the ground reference point using the model.
-   lineSampleHeightToWorld(theRefImgPt, theHgtOffset, theRefGndPt);
-
-   if( theGSD.hasNans() )
-   {
-      try
-      {
-         // This will set theGSD and theMeanGSD. Method throws ossimException.
-         computeGsd();
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimQuickbirdRpcModel::finishConstruction -- caught exception:\n"
-            << e.what() << std::endl;
-      }
-   }
-}
-
-bool ossimQuickbirdRpcModel::saveState(ossimKeywordlist& kwl,
-                                       const char* prefix) const
-{
-   // sanity check only.  This shoulc always be true
-   if(theSupportData.valid())
-   {
-      ossimString supportPrefix = ossimString(prefix) + "support_data.";
-      theSupportData->saveState(kwl, supportPrefix);
-   }
-
-   return ossimRpcModel::saveState(kwl, prefix);
-}
-
-bool ossimQuickbirdRpcModel::loadState(const ossimKeywordlist& kwl,
-                                       const char* prefix)
-{
-   // sanity check only.  This shoulc always be true
-   if(theSupportData.valid())
-   {
-      ossimString supportPrefix = ossimString(prefix) + "support_data.";
-      theSupportData->loadState(kwl, supportPrefix);
-   }
-   return ossimRpcModel::loadState(kwl, prefix);
-}
-
-//*************************************************************************************************
-// Given an initial filename with case-agnostic extension, this method searches first for an
-// image-specific instance of that file (i.e., with R*C* in the filename) before considering
-// the mosaic-global support file (R*C* removed). If a file is found, the argument is modified to
-// match the actual filename and TRUE is returned. Otherwise, argument filename is left unchanged
-// and FALSE is returned.
-//*************************************************************************************************
-bool ossimQuickbirdRpcModel::findSupportFile(ossimFilename& filename) const
-{
-   ossimFilename f (filename);
-   ossimString extension = f.ext();
-   if(f.exists())
-   {
-      filename = f;
-      return true;
-   }
-   // Search for support file with same basename as image:
-   extension.upcase();
-   f.setExtension(extension);
-   if(f.exists())
-   {
-      filename = f;
-      return true;
-   }
-   extension.downcase();
-   if(f.exists())
-   {
-      filename = f;
-      return true;
-   }
-
-   // None found so far, search for mosaic-global support file:
-   f = f.replaceAllThatMatch("_R[0-9]+C[0-9]+");
-   if(f.exists())
-   {
-      filename = f;
-      return true;
-   }
-  extension.upcase();
-   f.setExtension(extension);
-   if(f.exists())
-   {
-      filename = f;
-      return true;
-   }
-
-
-   // Modify argument to match good filename:
-   return false;
-}
diff --git a/ossim/src/ossim/projection/ossimRpcModel.cpp b/ossim/src/ossim/projection/ossimRpcModel.cpp
deleted file mode 100644
index b64bd51..0000000
--- a/ossim/src/ossim/projection/ossimRpcModel.cpp
+++ /dev/null
@@ -1,1399 +0,0 @@
-//*****************************************************************************
-// FILE: ossimRpcModel.cpp
-//
-// License:  See top level LICENSE.txt file.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION: Contains implementation of class ossimRpcModel.
-//   This is a replacement model utilizing the Rational Polynomial Coefficients
-//   (RPC), a.k.a. Rapid Positioning Capability, and Universal Sensor Model
-//   (USM).
-//
-// LIMITATIONS: Does not support parameter adjustment (YET)
-//
-//*****************************************************************************
-//  $Id: ossimRpcModel.cpp 23670 2015-12-18 22:33:12Z dburken $
-
-#include <ossim/projection/ossimRpcModel.h>
-#include <ossim/elevation/ossimElevManager.h>
-
-RTTI_DEF1(ossimRpcModel, "ossimRpcModel", ossimSensorModel);
-
-#include <ossim/elevation/ossimHgtRef.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <iostream>
-#include <algorithm>
-#include <iomanip>
-#include <sstream>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimRpcModel:exec");
-static ossimTrace traceDebug ("ossimRpcModel:debug");
-
-static const int    MODEL_VERSION_NUMBER  = 1;
-static const int    NUM_COEFFS        = 20;
-static const char*  MODEL_TYPE        = "ossimRpcModel";
-static const char*  POLY_TYPE_KW      = "polynomial_format";
-static const char*  LINE_SCALE_KW     = "line_scale";
-static const char*  SAMP_SCALE_KW     = "samp_scale";
-static const char*  LAT_SCALE_KW      = "lat_scale";
-static const char*  LON_SCALE_KW      = "long_scale";
-static const char*  HGT_SCALE_KW      = "height_scale";
-static const char*  LINE_OFFSET_KW    = "line_off";
-static const char*  SAMP_OFFSET_KW    = "samp_off";
-static const char*  LAT_OFFSET_KW     = "lat_off";
-static const char*  LON_OFFSET_KW     = "long_off";
-static const char*  HGT_OFFSET_KW     = "height_off";
-
-static const char*  BIAS_ERROR_KW     = "bias_error";
-static const char*  RAND_ERROR_KW     = "rand_error";
-
-static const char*  LINE_NUM_COEF_KW  = "line_num_coeff_";
-static const char*  LINE_DEN_COEF_KW  = "line_den_coeff_";
-static const char*  SAMP_NUM_COEF_KW  = "samp_num_coeff_";
-static const char*  SAMP_DEN_COEF_KW  = "samp_den_coeff_";
-
-static const ossimString PARAM_NAMES[] ={"intrack_offset",
-                                        "crtrack_offset",
-                                        "intrack_scale",
-                                        "crtrack_scale",
-                                        "map_rotation",
-                                        "yaw_offset"};
-static const ossimString PARAM_UNITS[] ={"pixel",
-                                        "pixel",
-                                        "scale",
-                                        "scale",
-                                        "degrees",
-                                        "degrees"};
-      
-//*****************************************************************************
-//  DEFAULT CONSTRUCTOR: ossimRpcModel()
-//  
-//*****************************************************************************
-ossimRpcModel::ossimRpcModel()
-   :  ossimSensorModel(),
-      thePolyType     (A),
-      theLineScale    (0.0),
-      theSampScale    (0.0),
-      theLatScale     (0.0),
-      theLonScale     (0.0),
-      theHgtScale     (0.0),
-      theLineOffset   (0.0),
-      theSampOffset   (0.0),
-      theLatOffset    (0.0),
-      theLonOffset    (0.0),
-      theHgtOffset    (0.0),
-      theIntrackOffset(0.0),
-      theCrtrackOffset(0.0),
-      theIntrackScale (0.0),
-      theCrtrackScale (0.0),
-      theCosMapRot    (0.0),
-      theSinMapRot    (0.0),
-      theBiasError    (0.0),
-      theRandError    (0.0)
-
-{
-   initAdjustableParameters();
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: ossimRpcModel(ossimRpcModel)
-//  
-//*****************************************************************************
-ossimRpcModel::ossimRpcModel(const ossimRpcModel& model)
-   :
-      ossimSensorModel(model),
-      thePolyType     (model.thePolyType),
-      theLineScale    (model.theLineScale),
-      theSampScale    (model.theSampScale),
-      theLatScale     (model.theLatScale),
-      theLonScale     (model.theLonScale),
-      theHgtScale     (model.theHgtScale),
-      theLineOffset   (model.theLineOffset),
-      theSampOffset   (model.theSampOffset),
-      theLatOffset    (model.theLatOffset),
-      theLonOffset    (model.theLonOffset),
-      theHgtOffset    (model.theHgtOffset),
-      theIntrackOffset(model.theIntrackOffset),
-      theCrtrackOffset(model.theCrtrackOffset),
-      theIntrackScale(model.theIntrackScale),
-      theCrtrackScale(model.theCrtrackScale),
-      theCosMapRot    (model.theCosMapRot),
-      theSinMapRot    (model.theSinMapRot),
-      theBiasError    (model.theBiasError),
-      theRandError    (model.theRandError)
-{
-   for (int i=0; i<20; ++i  )
-   {
-      theLineNumCoef[i] = model.theLineNumCoef[i];
-      theLineDenCoef[i] = model.theLineDenCoef[i];
-      theSampNumCoef[i] = model.theSampNumCoef[i];
-      theSampDenCoef[i] = model.theSampDenCoef[i];
-   }
-}
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimRpcModel()
-//  
-//*****************************************************************************
-ossimRpcModel::~ossimRpcModel()
-{
-}
-
-void ossimRpcModel::setAttributes(ossim_float64 sampleOffset,
-                                  ossim_float64 lineOffset,
-                                  ossim_float64 sampleScale,
-                                  ossim_float64 lineScale,
-                                  ossim_float64 latOffset,
-                                  ossim_float64 lonOffset,
-                                  ossim_float64 heightOffset,
-                                  ossim_float64 latScale,
-                                  ossim_float64 lonScale,
-                                  ossim_float64 heightScale,
-                                  const std::vector<double>& xNumeratorCoeffs,
-                                  const std::vector<double>& xDenominatorCoeffs,
-                                  const std::vector<double>& yNumeratorCoeffs,
-                                  const std::vector<double>& yDenominatorCoeffs,
-                                  PolynomialType polyType,
-                                  bool computeGsdFlag)
-{
-   thePolyType = polyType;
-   
-   theLineScale  = lineScale;
-   theSampScale  = sampleScale;
-   theLatScale   = latScale;
-   theLonScale   = lonScale;
-   theHgtScale   = heightScale;
-   theLineOffset = lineOffset;
-   theSampOffset = sampleOffset;
-   theLatOffset  = latOffset;
-   theLonOffset  = lonOffset;
-   theHgtOffset  = heightOffset;
-
-   if(xNumeratorCoeffs.size() == 20)
-   {
-      std::copy(xNumeratorCoeffs.begin(),
-                xNumeratorCoeffs.end(),
-                theSampNumCoef);
-   }
-   if(xDenominatorCoeffs.size() == 20)
-   {
-      std::copy(xDenominatorCoeffs.begin(),
-                xDenominatorCoeffs.end(),
-                theSampDenCoef);
-   }
-   if(yNumeratorCoeffs.size() == 20)
-   {
-      std::copy(yNumeratorCoeffs.begin(),
-                yNumeratorCoeffs.end(),
-                theLineNumCoef);
-   }
-   if(yDenominatorCoeffs.size() == 20)
-   {
-      std::copy(yDenominatorCoeffs.begin(),
-                yDenominatorCoeffs.end(),
-                theLineDenCoef);
-   }
-
-   if(computeGsdFlag)
-   {
-      try
-      {
-         // This will set theGSD and theMeanGSD. Method throws ossimException.
-         computeGsd();
-      }
-      catch (const ossimException& e)
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimRpcModel::setAttributes Caught Exception:\n"
-               << e.what() << std::endl;
-         }
-      }
-   }
-}
-
-void ossimRpcModel::setMetersPerPixel(const ossimDpt& metersPerPixel)
-{
-   theGSD = metersPerPixel;
-   theMeanGSD = (theGSD.x+theGSD.y)*.5;
-}
-
-void ossimRpcModel::setPositionError(const ossim_float64& biasError,
-                                     const ossim_float64& randomError,
-                                     bool initNominalPostionErrorFlag)
-{
-   theBiasError = biasError;
-   theRandError = randomError;
-   if (initNominalPostionErrorFlag)
-   {
-      theNominalPosError = sqrt(theBiasError*theBiasError +
-                                theRandError*theRandError); // meters
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcModel::worldToLineSample()
-//  
-//  Overrides base class implementation. Directly computes line-sample from
-//  the polynomials.
-//*****************************************************************************
-void ossimRpcModel::worldToLineSample(const ossimGpt& ground_point,
-                                      ossimDpt&       img_pt) const
-{
-   // if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::worldToLineSample(): entering..." << std::endl;
-
-   if(ground_point.isLatNan() || ground_point.isLonNan() )
-   {
-      img_pt.makeNan();
-      return;
-   }
-
-   //***
-   // First check if the world point is inside bounding rectangle:
-   //***
-   //ossimDpt wdp (ground_point);
-    //if (!(theBoundGndPolygon.pointWithin(ground_point)))
-   // {
-      //img_pt = extrapolate(ground_point);
-       //if (traceExec())  CLOG << "returning..." << endl;
-   //   img_pt.makeNan();
-   //    return;
-   // }
-         
-   //***
-   // Normalize the lat, lon, hgt:
-   //***
-   double nlat = (ground_point.lat - theLatOffset) / theLatScale;
-   double nlon = (ground_point.lon - theLonOffset) / theLonScale;
-   double nhgt;
-
-   if( ground_point.isHgtNan() )
-   {
-      // nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
-      nhgt = ( - theHgtOffset) / theHgtScale;
-   }
-   else
-   {
-      nhgt = (ground_point.hgt - theHgtOffset) / theHgtScale;
-   }
-
-   //***
-   // Compute the adjusted, normalized line (U) and sample (V):
-   //***
-   double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
-   double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
-   double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
-   double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
-   double U_rot  = Pu / Qu;
-   double V_rot  = Pv / Qv;
-
-   //***
-   // U, V are normalized quantities. Need now to establish the image file
-   // line and sample. First, back out the adjustable parameter effects
-   // starting with rotation:
-   //***
-   double U = U_rot*theCosMapRot + V_rot*theSinMapRot;
-   double V = V_rot*theCosMapRot - U_rot*theSinMapRot;
-
-   //***
-   // Now back out skew, scale, and offset adjustments:
-   //***
-   img_pt.line = U*(theLineScale+theIntrackScale) + theLineOffset + theIntrackOffset;
-   
-   img_pt.samp = V*(theSampScale+theCrtrackScale) + theSampOffset + theCrtrackOffset;
-
-   // if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::worldToLineSample(): returning..." << std::endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcModel::lineSampleToWorld()
-//  
-//  Overrides base class implementation. Performs DEM intersection.
-//*****************************************************************************
-void  ossimRpcModel::lineSampleToWorld(const ossimDpt& imagePoint,
-                                       ossimGpt&       worldPoint) const
-{
-
-//---
-// Under debate... (drb 20130610)
-// this seems to be more accurate for the round trip
-//---   
-#if 0
-   if(!imagePoint.hasNans())
-   {
-      
-      lineSampleHeightToWorld(imagePoint,
-                              worldPoint.height(),
-                              worldPoint);
-   }
-   else
-   {
-      worldPoint.makeNan();
-   }
-#else
-   if(!imagePoint.hasNans())
-   {
-      ossimEcefRay ray;
-      imagingRay(imagePoint, ray);
-      ossimElevManager::instance()->intersectRay(ray, worldPoint);
-   }
-   else
-   {
-      worldPoint.makeNan();
-   }
-#endif
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcModel::imagingRay()
-//  
-//  Constructs an RPC ray by intersecting 2 ellipsoid heights above and
-//  below the RPC height offset, and then forming a vector between the two.
-//
-//*****************************************************************************
-void ossimRpcModel::imagingRay(const ossimDpt& imagePoint,
-                               ossimEcefRay&   imageRay) const
-{
-   //---
-   // For "from point", "to point" we want the image ray to be from above the
-   // ellipsoid down to Earth.
-   // 
-   // It appears the ray "from point" must be above the ellipsiod for the
-   // ossimElevSource::intersectRay method; ultimately, the
-   // ossimEllipsoid::nearestIntersection method, else it goes off in the
-   // weeds...
-   //---
-
-// this one is messed up so keep as #if 0 untill tested more
-  #if 0 
-
-  ossimGpt gpt;
-
- lineSampleHeightToWorld(imagePoint, theHgtOffset, gpt);
-
- //lineSampleHeightToWorld(imagePoint, ossim::nan(), gpt);
-
-  ossimEcefVector v;
-  if(gpt.datum())
-  {
-    if(gpt.datum()->ellipsoid())
-    {
-      gpt.datum()->ellipsoid()->gradient(ossimEcefPoint(gpt), v);
-
-      v = v.unitVector();
-
-      ossimEcefPoint intECFto(gpt);
-      ossimEcefPoint intECFfrom = (intECFto + v*100000);
-
-      ossimEcefRay ray(intECFfrom, intECFto);
-
-      imageRay = ray;
-    }
-  }
-#else
-   double vectorLength = theHgtScale ? (theHgtScale * 2.0) : 1000.0;
-
-   ossimGpt gpt;
-   
-   // "from" point
-   double intHgt = theHgtOffset + vectorLength;
-   lineSampleHeightToWorld(imagePoint, intHgt, gpt);
-   ossimEcefPoint intECFfrom(gpt);
-   
-   // "to" point
-   lineSampleHeightToWorld(imagePoint, theHgtOffset, gpt);
-   ossimEcefPoint intECFto(gpt);
-   
-   // Construct ray
-   ossimEcefRay ray(intECFfrom, intECFto);
-   
-   imageRay = ray;
-
-   #endif
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimRpcModel::lineSampleHeightToWorld()
-//  
-//  Performs reverse projection of image line/sample to ground point.
-//  The imaging ray is intersected with a level plane at height = elev.
-//
-//  NOTE: U = line, V = sample -- this differs from the convention.
-//
-//*****************************************************************************
-void ossimRpcModel::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                            const double&   ellHeight,
-                                            ossimGpt&       gpt) const
-{
-   // if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
-   // << "DEBUG ossimRpcModel::lineSampleHeightToWorld: entering..." << std::endl;
-
-   //---
-   // Removed below "gpt.makeNan()" if outside of image.  This was put in
-   // troubleshooting dateline wrap issues.  Returned nans are also
-   // causing issues so commenting out.  drb - 17 Dec. 2015
-   //---
-
-   //***
-   // Extrapolate if point is outside image:
-   //***
-   // if (!insideImage(image_point))
-   // {
-   //    gpt = extrapolate(image_point, ellHeight);
-   //    if (traceExec())  CLOG << "returning..." << endl;
-   //    return;
-   // }
-
-   //***
-   // Constants for convergence tests:
-   //***
-   static const int    MAX_NUM_ITERATIONS  = 10;
-   static const double CONVERGENCE_EPSILON = 0.1;  // pixels
-   
-   //***
-   // The image point must be adjusted by the adjustable parameters as well
-   // as the scale and offsets given as part of the RPC param normalization.
-   //
-   //      NOTE: U = line, V = sample
-   //***
-   double U    = (image_point.y-theLineOffset - theIntrackOffset) / (theLineScale+theIntrackScale);
-   double V    = (image_point.x-theSampOffset - theCrtrackOffset) / (theSampScale+theCrtrackScale);
-
-   //***
-   // Rotate the normalized U, V by the map rotation error (adjustable param):
-   //***
-   double U_rot = theCosMapRot*U - theSinMapRot*V;
-   double V_rot = theSinMapRot*U + theCosMapRot*V;
-   U = U_rot; V = V_rot;
-
-
-   // now apply adjust intrack and cross track
-   //***
-   // Initialize quantities to be used in the iteration for ground point:
-   //***
-   double nlat      = 0.0;  // normalized latitude
-   double nlon      = 0.0;  // normalized longitude
-   
-   double nhgt;
-
-   if(ossim::isnan(ellHeight))
-   {
-     nhgt = (theHgtScale - theHgtOffset) / theHgtScale;  // norm height
-   }
-   else
-   {
-      nhgt = (ellHeight - theHgtOffset) / theHgtScale;  // norm height
-   }
-   
-   double epsilonU = CONVERGENCE_EPSILON/(theLineScale+theIntrackScale);
-   double epsilonV = CONVERGENCE_EPSILON/(theSampScale+theCrtrackScale);
-   int    iteration = 0;
-
-   //***
-   // Declare variables only once outside the loop. These include:
-   // * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
-   // * partial derivatives of polynomials wrt X, Y,
-   // * computed normalized image point: Uc, Vc,
-   // * residuals of normalized image point: deltaU, deltaV,
-   // * partial derivatives of Uc and Vc wrt X, Y,
-   // * corrections to normalized lat, lon: deltaLat, deltaLon.
-   //***
-   double Pu, Qu, Pv, Qv;
-   double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
-   double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
-   double Uc, Vc;
-   double deltaU, deltaV;
-   double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
-   double deltaLat, deltaLon;
-   
-   //***
-   // Now iterate until the computed Uc, Vc is within epsilon of the desired
-   // image point U, V:
-   //***
-   do
-   {
-      //***
-      // Calculate the normalized line and sample Uc, Vc as ratio of
-      // polynomials Pu, Qu and Pv, Qv:
-      //***
-      Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
-      Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
-      Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
-      Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
-      Uc = Pu/Qu;
-      Vc = Pv/Qv;
-      
-      //***
-      // Compute residuals between desired and computed line, sample:
-      //***
-      deltaU = U - Uc;
-      deltaV = V - Vc;
-      
-      //***
-      // Check for convergence and skip re-linearization if converged:
-      //***
-      if ((fabs(deltaU) > epsilonU) || (fabs(deltaV) > epsilonV))
-      {
-         //***
-         // Analytically compute the partials of each polynomial wrt lat, lon:
-         //***
-         dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
-         dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
-         dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
-         dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
-         dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
-         dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
-         dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
-         dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
-         
-         //***
-         // Analytically compute partials of quotients U and V wrt lat, lon: 
-         //***
-         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
-         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
-         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
-         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
-         
-         W = dU_dLon*dV_dLat - dU_dLat*dV_dLon;
-         
-         //***
-         // Now compute the corrections to normalized lat, lon:
-         //***
-         deltaLat = (dU_dLon*deltaV - dV_dLon*deltaU) / W;
-         deltaLon = (dV_dLat*deltaU - dU_dLat*deltaV) / W;
-         nlat += deltaLat;
-         nlon += deltaLon;
-      }
-      
-      //double h = ossimElevManager::instance()->getHeightAboveEllipsoid(ossimGpt(nlat, nlon));
-     // if(!ossim::isnan(h))
-     // {
-     //   nhgt = h;
-     // }
-
-      iteration++;
-      
-   } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
-            && (iteration < MAX_NUM_ITERATIONS));
-      
-   //***
-   // Test for exceeding allowed number of iterations. Flag error if so:
-   //***
-   if (iteration == MAX_NUM_ITERATIONS)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimRpcModel::lineSampleHeightToWorld: \nMax number of iterations reached in ground point "
-                                         << "solution. Results are inaccurate." << endl;
-   }
-
-   //***
-   // Now un-normalize the ground point lat, lon and establish return quantity:
-   //***
-   gpt.lat = nlat*theLatScale + theLatOffset;
-   gpt.lon = nlon*theLonScale + theLonOffset;
-   gpt.hgt = ellHeight;
-   
-}
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimRpcModel::polynomial
-//  
-//  Computes polynomial.
-//  
-//*****************************************************************************
-double ossimRpcModel::polynomial(const double& P, const double& L,
-                                 const double& H, const double* c) const
-{
-   double r;
-
-   if (thePolyType == A)
-   {
-      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
-          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*P*H +
-          c[ 8]*L*L   + c[ 9]*P*P   + c[10]*H*H   + c[11]*L*L*L +
-          c[12]*L*L*P + c[13]*L*L*H + c[14]*L*P*P + c[15]*P*P*P +
-          c[16]*P*P*H + c[17]*L*H*H + c[18]*P*H*H + c[19]*H*H*H;
-   }
-   else
-   {
-      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
-          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*L   +
-          c[ 8]*P*P   + c[ 9]*H*H   + c[10]*L*P*H + c[11]*L*L*L +
-          c[12]*L*P*P + c[13]*L*H*H + c[14]*L*L*P + c[15]*P*P*P +
-          c[16]*P*H*H + c[17]*L*L*H + c[18]*P*P*H + c[19]*H*H*H;
-   }
-   
-   return r;
-}
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimRpcModel::dPoly_dLat
-//  
-//  Computes derivative of polynomial wrt normalized Latitude P.
-//  
-//*****************************************************************************
-double ossimRpcModel::dPoly_dLat(const double& P, const double& L,
-                                 const double& H, const double* c) const
-{
-   double dr;
-
-   if (thePolyType == A)
-   {
-      dr = c[2] + c[4]*L + c[6]*H + c[7]*L*H + 2*c[9]*P + c[12]*L*L +
-           2*c[14]*L*P + 3*c[15]*P*P +2*c[16]*P*H + c[18]*H*H;
-   }
-   else
-   {
-      dr = c[2] + c[4]*L + c[6]*H + 2*c[8]*P + c[10]*L*H + 2*c[12]*L*P +
-           c[14]*L*L + 3*c[15]*P*P + c[16]*H*H + 2*c[18]*P*H;
-   }
-   
-   return dr;
-}
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimRpcModel::dPoly_dLon
-//  
-//  Computes derivative of polynomial wrt normalized Longitude L.
-//  
-//*****************************************************************************
-double ossimRpcModel::dPoly_dLon(const double& P, const double& L,
-                                 const double& H, const double* c) const
-{
-   double dr;
-
-   if (thePolyType == A)
-   {
-      dr = c[1] + c[4]*P + c[5]*H + c[7]*P*H + 2*c[8]*L + 3*c[11]*L*L +
-           2*c[12]*L*P + 2*c[13]*L*H + c[14]*P*P + c[17]*H*H;
-   }
-   else
-   {
-      dr = c[1] + c[4]*P + c[5]*H + 2*c[7]*L + c[10]*P*H + 3*c[11]*L*L +
-           c[12]*P*P + c[13]*H*H + 2*c[14]*P*L + 2*c[17]*L*H;
-   }
-   return dr;
-}
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimRpcModel::dPoly_dHgt
-//  
-//  Computes derivative of polynomial wrt normalized Height H.
-//  
-//*****************************************************************************
-double ossimRpcModel::dPoly_dHgt(const double& P, const double& L,
-                                 const double& H, const double* c) const
-{
-   double dr;
-
-   if (thePolyType == A)
-   {
-      dr = c[3] + c[5]*L + c[6]*P + c[7]*L*P + 2*c[10]*H + c[13]*L*L +
-           c[16]*P*P + 2*c[17]*L*H + 2*c[18]*P*H + 3*c[19]*H*H;
-   }
-   else
-   {
-      dr = c[3] + c[5]*L + c[6]*P + 2*c[9]*H + c[10]*L*P + 2*c[13]*L*H +
-           2*c[16]*P*H + c[17]*L*L + c[18]*P*P + 3*c[19]*H*H;
-   }
-   return dr;
-}
-
-void ossimRpcModel::updateModel()
-{
-   theIntrackOffset    = computeParameterOffset(INTRACK_OFFSET);
-   theCrtrackOffset    = computeParameterOffset(CRTRACK_OFFSET);
-   theIntrackScale     = computeParameterOffset(INTRACK_SCALE);
-   theCrtrackScale     = computeParameterOffset(CRTRACK_SCALE);
-   double mapRotation  = computeParameterOffset(MAP_ROTATION);
-   theCosMapRot        = ossim::cosd(mapRotation);
-   theSinMapRot        = ossim::sind(mapRotation);
-}
-
-void ossimRpcModel::initAdjustableParameters()
-{
-   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
-   int numParams = getNumberOfAdjustableParameters();
-   for (int i=0; i<numParams; i++)
-   {
-      setAdjustableParameter(i, 0.0);
-      setParameterDescription(i, PARAM_NAMES[i]);
-      setParameterUnit(i,PARAM_UNITS[i]);
-   }
-   setParameterSigma(INTRACK_OFFSET, 50.0);
-   setParameterSigma(CRTRACK_OFFSET, 50.0);
-   setParameterSigma(INTRACK_SCALE, 50.0);  
-   setParameterSigma(CRTRACK_SCALE, 50.0);  
-   setParameterSigma(MAP_ROTATION, 0.1);
-//   setParameterSigma(YAW_OFFSET, 0.001);
-}
-
-ossimObject* ossimRpcModel::dup() const
-{
-   return new ossimRpcModel(*this);
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcModel::print()
-//  
-//  Formatted dump of data members.
-//  
-//*****************************************************************************
-std::ostream& ossimRpcModel::print(std::ostream& out) const
-{
-   out << "\nDump of ossimRpcModel object at " << std::hex << this << std::dec << ":\n"
-       << POLY_TYPE_KW   << ": " << thePolyType   << "\n"
-       << LINE_SCALE_KW  << ": " << theLineScale  << "\n"
-       << SAMP_SCALE_KW  << ": " << theSampScale  << "\n"
-       << LAT_SCALE_KW   << ": " << theLatScale   << "\n"
-       << LON_SCALE_KW   << ": " << theLonScale   << "\n"
-       << HGT_SCALE_KW   << ": " << theHgtScale   << "\n"
-       << LINE_OFFSET_KW << ": " << theLineOffset << "\n"
-       << SAMP_OFFSET_KW << ": " << theSampOffset << "\n"
-       << LAT_OFFSET_KW  << ": " << theLatOffset  << "\n"
-       << LON_OFFSET_KW  << ": " << theLonOffset  << "\n"
-       << HGT_OFFSET_KW  << ": " << theHgtOffset  << "\n"
-       << BIAS_ERROR_KW  << ": " << theBiasError  << "\n"
-       << RAND_ERROR_KW  << ": " << theRandError  << "\n"
-       << std::endl;
-
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<LINE_NUM_COEF_KW<<"["<<i<<"]: "<<theLineNumCoef[i]<<std::endl;
-
-   out << std::endl;
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<LINE_DEN_COEF_KW<<"["<<i<<"]: "<<theLineDenCoef[i]<<std::endl;
-
-   out << std::endl;
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<SAMP_NUM_COEF_KW<<"["<<i<<"]: "<<theSampNumCoef[i]<<std::endl;
-
-   out << std::endl;
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<SAMP_DEN_COEF_KW<<"["<<i<<"]: "<<theSampDenCoef[i]<<std::endl;
-      
-   out << std::endl;
-
-   return ossimSensorModel::print(out);
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcModel::saveState()
-//  
-//  Saves the model state to the KWL. This KWL also serves as a geometry file.
-//  
-//*****************************************************************************
-bool ossimRpcModel::saveState(ossimKeywordlist& kwl,
-                              const char* prefix) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::saveState(): entering..." << std::endl;
-
-   kwl.add(prefix, ossimKeywordNames::TYPE_KW, MODEL_TYPE);
-
-   //***
-   // Hand off to base class for common stuff:
-   //***
-   ossimSensorModel::saveState(kwl, prefix);
-
-   //---
-   // Save off offsets and scales:
-   //---
-   kwl.add(prefix, POLY_TYPE_KW,   ((char)thePolyType));
-   kwl.add(prefix, LINE_SCALE_KW,  theLineScale);
-   kwl.add(prefix, SAMP_SCALE_KW,  theSampScale);
-   kwl.add(prefix, LAT_SCALE_KW,   theLatScale);
-   kwl.add(prefix, LON_SCALE_KW,   theLonScale);
-   kwl.add(prefix, HGT_SCALE_KW,   theHgtScale);
-   kwl.add(prefix, LINE_OFFSET_KW, theLineOffset);
-   kwl.add(prefix, SAMP_OFFSET_KW, theSampOffset);
-   kwl.add(prefix, LAT_OFFSET_KW,  theLatOffset);
-   kwl.add(prefix, LON_OFFSET_KW,  theLonOffset);
-   kwl.add(prefix, HGT_OFFSET_KW,  theHgtOffset);
-   kwl.add(prefix, BIAS_ERROR_KW,  theBiasError);
-   kwl.add(prefix, RAND_ERROR_KW,  theRandError);
-
-   for (int i=0; i<NUM_COEFFS; i++)
-   {
-      ossimString key;
-      std::ostringstream os;
-      os << setw(2) << setfill('0') << right << i;
-      
-      key = LINE_NUM_COEF_KW;
-      key += os.str();
-      kwl.add(prefix, key.c_str(), theLineNumCoef[i],
-              true, 15);
-      
-      key = LINE_DEN_COEF_KW;
-      key += os.str();
-      kwl.add(prefix, key.c_str(), theLineDenCoef[i],
-              true, 15);
-
-      key = SAMP_NUM_COEF_KW;
-      key += os.str();
-      kwl.add(prefix, key.c_str(), theSampNumCoef[i],
-              true, 15);
-
-      key = SAMP_DEN_COEF_KW;
-      key += os.str();
-      kwl.add(prefix, key.c_str(), theSampDenCoef[i],
-              true, 15);
-   }
-      
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::saveState(): returning..." << std::endl;
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcModel::loadState()
-//  
-//  Restores the model's state from the KWL. This KWL also serves as a
-//  geometry file.
-//  
-//*****************************************************************************
-bool ossimRpcModel::loadState(const ossimKeywordlist& kwl,
-                              const char* prefix) 
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimRpcModel::loadState(): entering..." << std::endl;
-   }
-
-   const char* value;
-   const char* keyword;
-
-   //***
-   // Pass on to the base-class for parsing first:
-   //***
-   bool success = ossimSensorModel::loadState(kwl, prefix);
-   if (!success)
-   {
-      theErrorStatus++;
-
-      if (traceExec())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimRpcModel::loadState(): returning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-      
-   //---
-   // Continue parsing for local members:
-   //---
-   value = kwl.find(prefix, BIAS_ERROR_KW);
-   if (value)
-   {
-      theBiasError = ossimString(value).toDouble();
-   }
-
-   value = kwl.find(prefix, RAND_ERROR_KW);
-   if (value)
-   {
-      theRandError = ossimString(value).toDouble();
-   }
-        
-   keyword = POLY_TYPE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   thePolyType = (PolynomialType) value[0];
-      
-   keyword = LINE_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLineScale = atof(value);
-   
-   keyword = SAMP_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theSampScale = atof(value);
-   
-   keyword = LAT_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLatScale = atof(value);
-   
-   keyword = LON_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLonScale = atof(value);
-   
-   keyword = HGT_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theHgtScale = atof(value);
-   
-   keyword = LINE_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLineOffset = atof(value);
-   
-   keyword = SAMP_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theSampOffset = atof(value);
-   
-   keyword = LAT_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLatOffset = atof(value);
-   
-   keyword = LON_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLonOffset = atof(value);
-   
-   keyword = HGT_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theHgtOffset = atof(value);
-
-   for (int i=0; i<NUM_COEFFS; i++)
-   {
-      ossimString keyword;
-      ostringstream os;
-      os << setw(2) << setfill('0') << right << i;
-
-      keyword = LINE_NUM_COEF_KW;
-      keyword += os.str();
-      value = kwl.find(prefix, keyword.c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-            << "<" << keyword << ">. Check the keywordlist for proper syntax."
-            << std::endl;
-         return false;
-      }
-      theLineNumCoef[i] = atof(value);
-
-      keyword = LINE_DEN_COEF_KW;
-      keyword += os.str();
-      value = kwl.find(prefix, keyword.c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                             << std::endl;
-         return false;
-      }
-      theLineDenCoef[i] = atof(value);
-   
-      keyword = SAMP_NUM_COEF_KW;
-      keyword += os.str();
-      value = kwl.find(prefix, keyword.c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                             << std::endl;
-         return false;
-      }
-      theSampNumCoef[i] = atof(value);
-
-      keyword = SAMP_DEN_COEF_KW;
-      keyword += os.str();
-      value = kwl.find(prefix, keyword.c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
-                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                             << std::endl;
-         return false;
-      }
-      theSampDenCoef[i] = atof(value);
-   }
-      
-   //***
-   // Initialize other data members given quantities read in KWL:
-   //***
-   theCosMapRot = 1.0;
-   theSinMapRot = 0.0;
-
-   updateModel();
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::loadState(): returning..." << std::endl;
-   return true;
-}
-
-//*****************************************************************************
-// STATIC METHOD: ossimRpcModel::writeGeomTemplate
-//  
-//  Writes a sample kwl to output stream.
-//  
-//*****************************************************************************
-void ossimRpcModel::writeGeomTemplate(ostream& os)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(): entering..." << std::endl;
-
-   os <<
-      "//**************************************************************\n"
-      "// Template for RPC model keywordlist\n"
-      "//**************************************************************\n"
-      << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
-
-   ossimSensorModel::writeGeomTemplate(os);
-   
-   os << "//\n"
-      << "// Derived-class ossimRpcModel Keywords:\n"
-      << "//\n"
-      << POLY_TYPE_KW << ": A|B\n"
-      << "\n"
-      << "// RPC data consists of coefficients and normalization \n"
-      << "// parameters. The RPC keywords used here are compatible with \n"
-      << "// keywords found in Ikonos \"rpc.txt\" files.\n"
-      << "// First are the normalization parameters:\n"
-      << LINE_OFFSET_KW << ": <float>\n"
-      << SAMP_OFFSET_KW << ": <float>\n"
-      << LAT_OFFSET_KW << ": <float>\n"
-      << LON_OFFSET_KW << ": <float>\n"
-      << HGT_OFFSET_KW << ": <float>\n"
-      << LINE_SCALE_KW << ": <float>\n"
-      << SAMP_SCALE_KW << ": <float>\n"
-      << LAT_SCALE_KW << ": <float>\n"
-      << LON_SCALE_KW << ": <float>\n"
-      << HGT_SCALE_KW << ": <float>\n"
-      << BIAS_ERROR_KW << ": <float>\n"
-      << RAND_ERROR_KW << ": <float>\n"
-      << "\n"
-      << "// RPC Coefficients are specified with indexes. Coefficients \n "
-      << "// are specified for the four polynomials: line numerator, line \n"
-      << "// denominator, sample numerator, and sample denominator:" << endl;
-
-   for (int i=1; i<=20; i++)
-      os << LINE_NUM_COEF_KW << setw(2) << setfill('0') << right
-         << i << ": <float>" << endl; 
-   os << endl;
-   for (int i=1; i<=20; i++)
-      os << LINE_DEN_COEF_KW << setw(2) << setfill('0') << right
-         << i << ": <float>" << endl; 
-   os << endl;
-   for (int i=1; i<=20; i++)
-      os << SAMP_NUM_COEF_KW << setw(2) << setfill('0') << right
-         << i << ": <float>" << endl; 
-   os << endl;
-   for (int i=1; i<=20; i++)
-      os << SAMP_DEN_COEF_KW << setw(2) << setfill('0') << right
-         << i << ": <float>" << endl; 
-   os << "\n" <<endl;
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(): returning..." << std::endl;
-   return;
-}
-
-bool ossimRpcModel::setupOptimizer(const ossimString& init_file)
-{
-   ossimKeywordlist kwl;
-
-   if(kwl.addFile(ossimFilename(init_file)))
-   {
-      return loadState(kwl);
-   }
-   else
-   {
-      ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->createProjection(init_file);
-      if(proj.valid())
-      {
-         kwl.clear();
-         proj->saveState(kwl);
-         
-         return loadState(kwl);
-      }
-   }
-   
-   return false;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getForwardDeriv()
-//  
-//  Compute partials of samp/line WRT to ground.
-//  
-//*****************************************************************************
-ossimDpt ossimRpcModel::getForwardDeriv(int derivMode,
-                                        const ossimGpt& pos,
-                                        double h)
-{
-   // If derivMode (parmIdx) >= 0 call base class version
-   // for "adjustable parameters"
-   if (derivMode >= 0)
-   {
-      return ossimSensorModel::getForwardDeriv(derivMode, pos, h);
-   }
-   
-   // Use alternative derivMode definitions
-   else
-   {
-      ossimDpt returnData;
-
-      //******************************************
-      // OBS_INIT mode
-      //    [1] 
-      //    [2] 
-      //  Note: In this mode, pos is used to pass
-      //  in the (s,l) observations.
-      //******************************************
-      if (derivMode==OBS_INIT)
-      {
-         // Image coordinates
-         ossimDpt obs;
-         obs.samp = pos.latd();
-         obs.line = pos.lond();
-         theObs = obs;
-      }
-
-      //******************************************
-      // EVALUATE mode
-      //   [1] evaluate & save partials, residuals
-      //   [2] return residuals
-      //******************************************
-      else if (derivMode==EVALUATE)
-      {
-         //***
-         // Normalize the lat, lon, hgt:
-         //***
-         double nlat = (pos.lat - theLatOffset) / theLatScale;
-         double nlon = (pos.lon - theLonOffset) / theLonScale;
-         double nhgt;
-
-         if( ossim::isnan(pos.hgt) )
-         {
-            nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
-         }
-         else
-         {
-            nhgt = (pos.hgt - theHgtOffset) / theHgtScale;
-         }
-         
-         //***
-         // Compute the normalized line (Un) and sample (Vn):
-         //***
-         double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
-         double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
-         double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
-         double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
-         double Un  = Pu / Qu;
-         double Vn  = Pv / Qv;
-         
-         //***
-         // Compute the actual line (U) and sample (V):
-         //***
-         double U  = Un*theLineScale + theLineOffset;
-         double V  = Vn*theSampScale + theSampOffset;
-
-         //***
-         // Compute the partials of each polynomial wrt lat, lon, hgt
-         //***
-         double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
-         double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
-         double dPu_dHgt, dQu_dHgt, dPv_dHgt, dQv_dHgt;
-         dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
-         dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
-         dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
-         dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
-         dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
-         dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
-         dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
-         dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
-         dPu_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theLineNumCoef);
-         dQu_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theLineDenCoef);
-         dPv_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theSampNumCoef);
-         dQv_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theSampDenCoef);
-         
-         //***
-         // Compute partials of quotients U and V wrt lat, lon, hgt 
-         //***
-         double dU_dLat, dU_dLon, dU_dHgt, dV_dLat, dV_dLon, dV_dHgt;
-         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
-         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
-         dU_dHgt = (Qu*dPu_dHgt - Pu*dQu_dHgt)/(Qu*Qu);
-         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
-         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
-         dV_dHgt = (Qv*dPv_dHgt - Pv*dQv_dHgt)/(Qv*Qv);
-         
-         //***
-         // Apply necessary scale factors 
-         //***
-        dU_dLat *= theLineScale/theLatScale;
-        dU_dLon *= theLineScale/theLonScale;
-        dU_dHgt *= theLineScale/theHgtScale;
-        dV_dLat *= theSampScale/theLatScale;
-        dV_dLon *= theSampScale/theLonScale;
-        dV_dHgt *= theSampScale/theHgtScale;
-
-        dU_dLat *= DEG_PER_RAD;
-        dU_dLon *= DEG_PER_RAD;
-        dV_dLat *= DEG_PER_RAD;
-        dV_dLon *= DEG_PER_RAD;
-
-         // Save the partials referenced to ECF
-         ossimEcefPoint location(pos);
-         NEWMAT::Matrix jMat(3,3);
-         pos.datum()->ellipsoid()->jacobianWrtEcef(location, jMat);
-         //  Line
-         theParWRTx.u = dU_dLat*jMat(1,1)+dU_dLon*jMat(2,1)+dU_dHgt*jMat(3,1);
-         theParWRTy.u = dU_dLat*jMat(1,2)+dU_dLon*jMat(2,2)+dU_dHgt*jMat(3,2);
-         theParWRTz.u = dU_dLat*jMat(1,3)+dU_dLon*jMat(2,3)+dU_dHgt*jMat(3,3);
-         //  Samp
-         theParWRTx.v = dV_dLat*jMat(1,1)+dV_dLon*jMat(2,1)+dV_dHgt*jMat(3,1);
-         theParWRTy.v = dV_dLat*jMat(1,2)+dV_dLon*jMat(2,2)+dV_dHgt*jMat(3,2);
-         theParWRTz.v = dV_dLat*jMat(1,3)+dV_dLon*jMat(2,3)+dV_dHgt*jMat(3,3);
-
-         // Residuals
-         ossimDpt resid(theObs.samp-V, theObs.line-U);
-         returnData = resid;
-      }
-
-      //******************************************
-      // P_WRT_X, P_WRT_Y, P_WRT_Z modes
-      //   [1] 3 separate calls required
-      //   [2] return 3 sets of partials
-      //******************************************
-      else if (derivMode==P_WRT_X)
-      {
-         returnData = theParWRTx;
-      }
-
-      else if (derivMode==P_WRT_Y)
-      {
-         returnData = theParWRTy;
-      }
-
-      else
-      {
-         returnData = theParWRTz;
-      }
-
-      return returnData;
-   }
-}
-
-double ossimRpcModel::getBiasError() const
-{
-   return theBiasError;
-}
-
-double ossimRpcModel::getRandError() const
-{
-   return theRandError;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getRpcParameters)
-//  
-//  Accessor for RPC parameter set.
-//  
-//*****************************************************************************
-void ossimRpcModel::getRpcParameters(ossimRpcModel::rpcModelStruct& model) const
-{
-   model.lineScale  = theLineScale;
-   model.sampScale  = theSampScale;
-   model.latScale   = theLatScale;
-   model.lonScale   = theLonScale;
-   model.hgtScale   = theHgtScale;
-   model.lineOffset = theLineOffset;
-   model.sampOffset = theSampOffset;
-   model.latOffset  = theLatOffset;
-   model.lonOffset  = theLonOffset;
-   model.hgtOffset  = theHgtOffset;
-   
-   for (int i=0; i<20; ++i)
-   {
-      model.lineNumCoef[i] = theLineNumCoef[i];
-      model.lineDenCoef[i] = theLineDenCoef[i];
-      model.sampNumCoef[i] = theSampNumCoef[i];
-      model.sampDenCoef[i] = theSampDenCoef[i];
-   }
-   
-   if (thePolyType == A)
-   {
-      model.type= 'A';
-   }
-   else
-   {
-      model.type= 'B';
-   }
-}
diff --git a/ossim/src/ossim/projection/ossimRpcProjection.cpp b/ossim/src/ossim/projection/ossimRpcProjection.cpp
deleted file mode 100644
index eb58cf5..0000000
--- a/ossim/src/ossim/projection/ossimRpcProjection.cpp
+++ /dev/null
@@ -1,1393 +0,0 @@
-//*****************************************************************************
-// FILE: ossimRpcModel.cc
-//
-// Copyright (C) 2004 Intelligence Data Systems.
-//
-// MIT
-// 
-// AUTHOR: Garrett Potts
-//
-//*****************************************************************************
-//$Id: ossimRpcProjection.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimRpcProjection.h>
-#include <ossim/projection/ossimRpcSolver.h>
-#include <ossim/base/ossimEcefPoint.h>
-#include <ossim/base/ossimEcefVector.h>
-#include <ossim/base/ossimTieGptSet.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-
-RTTI_DEF3(ossimRpcProjection, "ossimRpcProjection", ossimProjection, ossimOptimizableProjection,
-          ossimAdjustableParameterInterface);
-
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <cstdio>
-#include <fstream>
-#include <iostream>
-#include <algorithm>
-#include <ossim/matrix/newmatrc.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimRpcProjection:exec");
-static ossimTrace traceDebug ("ossimRpcProjection:debug");
-
-static const int    MODEL_VERSION_NUMBER  = 1;
-static const int    NUM_COEFFS        = 20;
-static const char*  MODEL_TYPE        = "ossimRpcModel";
-static const char*  POLY_TYPE_KW      = "polynomial_format";
-static const char*  LINE_SCALE_KW     = "line_scale";
-static const char*  SAMP_SCALE_KW     = "samp_scale";
-static const char*  LAT_SCALE_KW      = "lat_scale";
-static const char*  LON_SCALE_KW      = "long_scale";
-static const char*  HGT_SCALE_KW      = "height_scale";
-static const char*  LINE_OFFSET_KW    = "line_off";
-static const char*  SAMP_OFFSET_KW    = "samp_off";
-static const char*  LAT_OFFSET_KW     = "lat_off";
-static const char*  LON_OFFSET_KW     = "long_off";
-static const char*  HGT_OFFSET_KW     = "height_off";
-static const char*  LINE_NUM_COEF_KW  = "line_num_coeff_";
-static const char*  LINE_DEN_COEF_KW  = "line_den_coeff_";
-static const char*  SAMP_NUM_COEF_KW  = "samp_num_coeff_";
-static const char*  SAMP_DEN_COEF_KW  = "samp_den_coeff_";
-
-static const ossim_int32 INTRACK_OFFSET = 0;
-static const ossim_int32 CRTRACK_OFFSET = 1;
-static const ossim_int32 INTRACK_SCALE  = 2;
-static const ossim_int32 CRTRACK_SCALE  = 3;
-static const ossim_int32 MAP_ROTATION   = 4;
-//static const ossim_int32 YAW_OFFSET;
-static const ossim_int32 NUM_ADJUSTABLE_PARAMS = 5;
-
-static const ossimString PARAM_NAMES[] ={"intrack_offset",
-                                        "crtrack_offset",
-                                        "intrack_scale",
-                                        "crtrack_scale",
-                                        "map_rotation",
-                                        "yaw_offset"};
-
-static const ossimString PARAM_UNITS[] ={"pixel",
-                                        "pixel",
-                                        "scale",
-                                        "scale",
-                                        "degrees",
-                                        "degrees"};
-
-//*****************************************************************************
-//  DEFAULT CONSTRUCTOR: ossimRpcModel()
-//  
-//*****************************************************************************
-ossimRpcProjection::ossimRpcProjection()
-   : ossimOptimizableProjection(),
-     theIntrackOffset(0),
-     theCrtrackOffset(0),
-     theIntrackScale(0.0),
-     theCrtrackScale(0.0),
-     theYawSkew   (0.0),
-     theCosMapRot (1.0),
-     theSinMapRot (0.0)
-
- {
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Default Constructor: entering..." << std::endl;
-
-   initAdjustableParameters();
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Default Constructor: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: ossimRpcProjection(ossimRpcProjection)
-//  
-//*****************************************************************************
-ossimRpcProjection::ossimRpcProjection(const ossimRpcProjection& model)
-   :
-      ossimOptimizableProjection(model),
-      ossimAdjustableParameterInterface(model),
-      thePolyType     (model.thePolyType),
-      theLineScale    (model.theLineScale),
-      theSampScale    (model.theSampScale),
-      theLatScale     (model.theLatScale),
-      theLonScale     (model.theLonScale),
-      theHgtScale     (model.theHgtScale),
-      theLineOffset   (model.theLineOffset),
-      theSampOffset   (model.theSampOffset),
-      theLatOffset    (model.theLatOffset),
-      theLonOffset    (model.theLonOffset),
-      theHgtOffset    (model.theHgtOffset),
-      theIntrackOffset(model.theIntrackOffset),
-      theCrtrackOffset(model.theCrtrackOffset),
-      theIntrackScale(model.theIntrackScale),
-      theCrtrackScale(model.theCrtrackScale),
-      theYawSkew      (model.theYawSkew),
-      theCosMapRot    (model.theCosMapRot),
-      theSinMapRot    (model.theSinMapRot)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Copy Constructor: entering..." << std::endl;
-
-   for (int i=0; i<20; i++)
-   {
-      theLineNumCoef[i] = model.theLineNumCoef[i];
-      theLineDenCoef[i] = model.theLineDenCoef[i];
-      theSampNumCoef[i] = model.theSampNumCoef[i];
-      theSampDenCoef[i] = model.theSampDenCoef[i];
-   }
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Copy Constructor: returning..." << std::endl;
-}
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimRpcProjection()
-//  
-//*****************************************************************************
-ossimRpcProjection::~ossimRpcProjection()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ~ossimRpcProjection() Destructor: entering..." << std::endl;
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimNotify(ossimNotifyLevel_DEBUG): returning..." << std::endl;
-}
-
-ossimObject* ossimRpcProjection::getBaseObject()
-{
-   return this;
-}
-
-const ossimObject* ossimRpcProjection::getBaseObject()const
-{
-   return this;
-}
-
-ossimRpcProjection& 
-ossimRpcProjection::operator=(const ossimRpcProjection& source)
-{
-   if (this != &source)
-   {
-      ossimOptimizableProjection::operator=(source);
-
-      thePolyType    = source.thePolyType;
-      theLineScale   = source.theLineScale;
-      theSampScale   = source.theSampScale;
-      theLatScale    = source.theLatScale;
-      theLonScale    = source.theLonScale;
-      theHgtScale    = source.theHgtScale;
-      theLineOffset  = source.theLineOffset;
-      theSampOffset  = source.theSampOffset;
-      theLatOffset   = source.theLatOffset;
-      theLonOffset   = source.theLonOffset;
-      theHgtOffset   = source.theHgtOffset;
-      for (int i=0; i<20; i++)
-      {
-         theLineNumCoef[i] = source.theLineNumCoef[i];
-         theLineDenCoef[i] = source.theLineDenCoef[i];
-         theSampNumCoef[i] = source.theSampNumCoef[i];
-         theSampDenCoef[i] = source.theSampDenCoef[i];
-      }
-   }
-   return *this;
-}
-
-void ossimRpcProjection::setAttributes(ossim_float64 sampleOffset,
-                                       ossim_float64 lineOffset,
-                                       ossim_float64 sampleScale,
-                                       ossim_float64 lineScale,
-                                       ossim_float64 latOffset,
-                                       ossim_float64 lonOffset,
-                                       ossim_float64 heightOffset,
-                                       ossim_float64 latScale,
-                                       ossim_float64 lonScale,
-                                       ossim_float64 heightScale,
-                                       const std::vector<double>& xNumeratorCoeffs,
-                                       const std::vector<double>& xDenominatorCoeffs,
-                                       const std::vector<double>& yNumeratorCoeffs,
-                                       const std::vector<double>& yDenominatorCoeffs,
-                                       PolynomialType polyType)
-{
-   thePolyType = polyType;
-   
-   theLineScale  = lineScale;
-   theSampScale  = sampleScale;
-   theLatScale   = latScale;
-   theLonScale   = lonScale;
-   theHgtScale   = heightScale;
-   theLineOffset = lineOffset;
-   theSampOffset = sampleOffset;
-   theLatOffset  = latOffset;
-   theLonOffset  = lonOffset;
-   theHgtOffset  = heightOffset;
-
-   if(xNumeratorCoeffs.size() == 20)
-   {
-      std::copy(xNumeratorCoeffs.begin(),
-                xNumeratorCoeffs.end(),
-                theSampNumCoef);
-   }
-   if(xDenominatorCoeffs.size() == 20)
-   {
-      std::copy(xDenominatorCoeffs.begin(),
-                xDenominatorCoeffs.end(),
-                theSampDenCoef);
-   }
-   if(yNumeratorCoeffs.size() == 20)
-   {
-      std::copy(yNumeratorCoeffs.begin(),
-                yNumeratorCoeffs.end(),
-                theLineNumCoef);
-   }
-   if(yDenominatorCoeffs.size() == 20)
-   {
-      std::copy(yDenominatorCoeffs.begin(),
-                yDenominatorCoeffs.end(),
-                theLineDenCoef);
-   }
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimRpcProjection::worldToLineSample()
-//  
-//  Overrides base class implementation. Directly computes line-sample from
-//  the polynomials.
-//*****************************************************************************
-void ossimRpcProjection::worldToLineSample(const ossimGpt& ground_point,
-                                      ossimDpt&       imgPt) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::worldToLineSample(): entering..." << std::endl;
-
-   if(ground_point.isLatNan() ||
-      ground_point.isLonNan() )
-     {
-       imgPt.makeNan();
-       return;
-     }
-         
-   //*
-   // Normalize the lat, lon, hgt:
-   //*
-   double nlat = (ground_point.lat - theLatOffset) / theLatScale;
-   double nlon = (ground_point.lon - theLonOffset) / theLonScale;
-   double nhgt;
-
-   if(ossim::isnan(ground_point.hgt))
-   {
-      nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
-   }
-   else
-   {
-      nhgt = (ground_point.hgt - theHgtOffset) / theHgtScale;
-   }
-
-   
-   //***
-   // Compute the adjusted, normalized line (U) and sample (V):
-   //***
-   double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
-   double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
-   double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
-   double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
-   double U_rot  = Pu / Qu;
-   double V_rot  = Pv / Qv;
-
-   //***
-   // U, V are normalized quantities. Need now to establish the image file
-   // line and sample. First, back out the adjustable parameter effects
-   // starting with rotation:
-   //***
-   double U = U_rot*theCosMapRot + V_rot*theSinMapRot;
-   double V = V_rot*theCosMapRot - U_rot*theSinMapRot;
-
-   //***
-   // Now back out skew, scale, and offset adjustments:
-   //***
-   imgPt.line = U*(theLineScale+theIntrackScale) + theLineOffset + theIntrackOffset;
-   imgPt.samp = V*(theSampScale+theCrtrackScale) + theSampOffset + theCrtrackOffset;
-
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::worldToLineSample(): returning..." << std::endl;
-
-   return;
-}
-
-void  ossimRpcProjection::lineSampleToWorld(const ossimDpt& imagePoint,
-                                            ossimGpt&       worldPoint) const
-{
-   if(!imagePoint.hasNans())
-   {
-      
-      lineSampleHeightToWorld(imagePoint,
-                              worldPoint.height(),
-                              worldPoint);
-   }
-   else
-   {
-      worldPoint.makeNan();
-   }
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcProjection::lineSampleHeightToWorld()
-//  
-//  Performs reverse projection of image line/sample to ground point.
-//  The imaging ray is intersected with a level plane at height = elev.
-//
-//  NOTE: U = line, V = sample -- this differs from the convention.
-//
-//*****************************************************************************
-void ossimRpcProjection::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                            const double&   ellHeight,
-                                            ossimGpt&       gpt) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::lineSampleHeightToWorld: entering..." << std::endl;
-
-   //***
-   // Constants for convergence tests:
-   //***
-   static const int    MAX_NUM_ITERATIONS  = 10;
-   static const double CONVERGENCE_EPSILON = 0.1;  // pixels
-   
-   //***
-   // The image point must be adjusted by the adjustable parameters as well
-   // as the scale and offsets given as part of the RPC param normalization.
-   //
-   //      NOTE: U = line, V = sample
-   //***
-   double skew = (image_point.x-theSampOffset - theCrtrackOffset)*theYawSkew;
-   double U    = (image_point.y-theLineOffset - theIntrackOffset+skew) / (theLineScale+theIntrackScale);
-   double V    = (image_point.x-theSampOffset - theCrtrackOffset) / (theSampScale+theCrtrackScale);
-
-   //***
-   // Rotate the normalized U, V by the map rotation error (adjustable param):
-   //***
-   double U_rot = theCosMapRot*U - theSinMapRot*V;
-   double V_rot = theSinMapRot*U + theCosMapRot*V;
-   U = U_rot; V = V_rot;
-
-
-   // now apply adjust intrack and cross track
-   //***
-   // Initialize quantities to be used in the iteration for ground point:
-   //***
-   double nlat      = 0.0;  // normalized latitude
-   double nlon      = 0.0;  // normalized longitude
-   
-   double nhgt;
-
-   if(ossim::isnan(ellHeight))
-   {
-     nhgt = (theHgtScale - theHgtOffset) / theHgtScale;  // norm height
-   }
-   else
-   {
-      nhgt = (ellHeight - theHgtOffset) / theHgtScale;  // norm height
-   }
-   
-   double epsilonU = CONVERGENCE_EPSILON/(theLineScale+theIntrackScale);
-   double epsilonV = CONVERGENCE_EPSILON/(theSampScale+theCrtrackScale);
-   int    iteration = 0;
-
-   //***
-   // Declare variables only once outside the loop. These include:
-   // * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
-   // * partial derivatives of polynomials wrt X, Y,
-   // * computed normalized image point: Uc, Vc,
-   // * residuals of normalized image point: deltaU, deltaV,
-   // * partial derivatives of Uc and Vc wrt X, Y,
-   // * corrections to normalized lat, lon: deltaLat, deltaLon.
-   //***
-   double Pu, Qu, Pv, Qv;
-   double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
-   double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
-   double Uc, Vc;
-   double deltaU, deltaV;
-   double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
-   double deltaLat, deltaLon;
-   
-   //***
-   // Now iterate until the computed Uc, Vc is within epsilon of the desired
-   // image point U, V:
-   //***
-   do
-   {
-      //***
-      // Calculate the normalized line and sample Uc, Vc as ratio of
-      // polynomials Pu, Qu and Pv, Qv:
-      //***
-      Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
-      Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
-      Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
-      Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
-      Uc = Pu/Qu;
-      Vc = Pv/Qv;
-      
-      //***
-      // Compute residuals between desired and computed line, sample:
-      //***
-      deltaU = U - Uc;
-      deltaV = V - Vc;
-      
-      //***
-      // Check for convergence and skip re-linearization if converged:
-      //***
-      if ((fabs(deltaU) > epsilonU) || (fabs(deltaV) > epsilonV))
-      {
-         //***
-         // Analytically compute the partials of each polynomial wrt lat, lon:
-         //***
-         dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
-         dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
-         dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
-         dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
-         dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
-         dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
-         dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
-         dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
-         
-         //***
-         // Analytically compute partials of quotients U and V wrt lat, lon: 
-         //***
-         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
-         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
-         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
-         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
-         
-         W = dU_dLon*dV_dLat - dU_dLat*dV_dLon;
-         
-         //***
-         // Now compute the corrections to normalized lat, lon:
-         //***
-         deltaLat = (dU_dLon*deltaV - dV_dLon*deltaU) / W;
-         deltaLon = (dV_dLat*deltaU - dU_dLat*deltaV) / W;
-         nlat += deltaLat;
-         nlon += deltaLon;
-      }
-      
-      iteration++;
-      
-   } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
-            && (iteration < MAX_NUM_ITERATIONS));
-      
-   //***
-   // Test for exceeding allowed number of iterations. Flag error if so:
-   //***
-   if (iteration == MAX_NUM_ITERATIONS)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimRpcProjection::lineSampleHeightToWorld: \nMax number of iterations reached in ground point "
-                                         << "solution. Results are inaccurate." << endl;
-   }
-
-   //***
-   // Now un-normalize the ground point lat, lon and establish return quantity:
-   //***
-   gpt.lat = nlat*theLatScale + theLatOffset;
-   gpt.lon = nlon*theLonScale + theLonOffset;
-   gpt.hgt = ellHeight;
-   
-}
-
-ossimGpt ossimRpcProjection::origin()const
-{
-   return ossimGpt(theLatOffset,
-                   theLonOffset,
-                   theHgtOffset);
-}
-
-
-ossimDpt ossimRpcProjection::getMetersPerPixel() const
-{
-   ossimDpt result;
-   
-//    ossimDpt left  = ossimDpt(theSampOffset-1,
-//                              theLineOffset);
-//    ossimDpt right = ossimDpt(theSampOffset+1,
-//                              theLineOffset);
-   ossimDpt top  = ossimDpt(theSampOffset,
-                            theLineOffset-1);
-   ossimDpt bottom = ossimDpt(theSampOffset,
-                              theLineOffset+1);
-//    ossimGpt leftG;
-//    ossimGpt rightG;
-   ossimGpt topG;
-   ossimGpt bottomG;
-   
-//    lineSampleToWorld(left, leftG);
-//    lineSampleToWorld(right, rightG);
-   lineSampleToWorld(top, topG);
-   lineSampleToWorld(bottom, bottomG);
-   
-//    result.x = (ossimEcefPoint(leftG) - ossimEcefPoint(rightG)).magnitude()/2.0;
-   result.y = (ossimEcefPoint(topG) - ossimEcefPoint(bottomG)).magnitude()/2.0;
-   result.x = result.y;
-
-   return result;
-}
-
-bool ossimRpcProjection::operator==(const ossimProjection& projection) const
-{
-   if(&projection == this) return true;
-
-   // not implemented yet
-   //
-   return false;
-}
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimRpcProjection::polynomial
-//  
-//  Computes polynomial.
-//  
-//*****************************************************************************
-double ossimRpcProjection::polynomial(const double& P, const double& L,
-                                      const double& H, const double* c) const
-{
-   double r;
-
-   if (thePolyType == A)
-   {
-      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
-          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*P*H +
-          c[ 8]*L*L   + c[ 9]*P*P   + c[10]*H*H   + c[11]*L*L*L +
-          c[12]*L*L*P + c[13]*L*L*H + c[14]*L*P*P + c[15]*P*P*P +
-          c[16]*P*P*H + c[17]*L*H*H + c[18]*P*H*H + c[19]*H*H*H;
-   }
-   else
-   {
-      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
-          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*L   +
-          c[ 8]*P*P   + c[ 9]*H*H   + c[10]*L*P*H + c[11]*L*L*L +
-          c[12]*L*P*P + c[13]*L*H*H + c[14]*L*L*P + c[15]*P*P*P +
-          c[16]*P*H*H + c[17]*L*L*H + c[18]*P*P*H + c[19]*H*H*H;
-   }
-   
-   return r;
-}
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimRpcProjection::dPoly_dLat
-//  
-//  Computes derivative of polynomial wrt normalized Latitude P.
-//  
-//*****************************************************************************
-double ossimRpcProjection::dPoly_dLat(const double& P, const double& L,
-                                 const double& H, const double* c) const
-{
-   double dr;
-
-   if (thePolyType == A)
-   {
-      dr = c[2] + c[4]*L + c[6]*H + c[7]*L*H + 2*c[9]*P + c[12]*L*L +
-           2*c[14]*L*P + 3*c[15]*P*P +2*c[16]*P*H + c[18]*H*H;
-   }
-   else
-   {
-      dr = c[2] + c[4]*L + c[6]*H + 2*c[8]*P + c[10]*L*H + 2*c[12]*L*P +
-           c[14]*L*L + 3*c[15]*P*P + c[16]*H*H + 2*c[18]*P*H;
-   }
-   
-   return dr;
-}
-
-//*****************************************************************************
-// PRIVATE METHOD: ossimRpcProjection::dPoly_dLon
-//  
-//  Computes derivative of polynomial wrt normalized Longitude L.
-//  
-//*****************************************************************************
-double ossimRpcProjection::dPoly_dLon(const double& P, const double& L,
-                                 const double& H, const double* c) const
-{
-   double dr;
-
-   if (thePolyType == A)
-   {
-      dr = c[1] + c[4]*P + c[5]*H + c[7]*P*H + 2*c[8]*L + 3*c[11]*L*L +
-           2*c[12]*L*P + 2*c[13]*L*H + c[14]*P*P + c[17]*H*H;
-   }
-   else
-   {
-      dr = c[1] + c[4]*P + c[5]*H + 2*c[7]*L + c[10]*P*H + 3*c[11]*L*L +
-           c[12]*P*P + c[13]*H*H + 2*c[14]*P*L + 2*c[17]*L*H;
-   }
-   return dr;
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcProjection::print()
-//  
-//  Formatted dump of data members.
-//  
-//*****************************************************************************
-std::ostream& ossimRpcProjection::print(std::ostream& out) const
-{
-   out << "\nDump of ossimRpcProjection object at " << hex << this << ":\n"
-       << POLY_TYPE_KW   << ": " << thePolyType   << "\n"
-       << LINE_SCALE_KW  << ": " << theLineScale  << "\n"
-       << SAMP_SCALE_KW  << ": " << theSampScale  << "\n"
-       << LAT_SCALE_KW   << ": " << theLatScale   << "\n"
-       << LON_SCALE_KW   << ": " << theLonScale   << "\n"
-       << HGT_SCALE_KW   << ": " << theHgtScale   << "\n"
-       << LINE_OFFSET_KW << ": " << theLineOffset << "\n"
-       << SAMP_OFFSET_KW << ": " << theSampOffset << "\n"
-       << LAT_OFFSET_KW  << ": " << theLatOffset  << "\n"
-       << LON_OFFSET_KW  << ": " << theLonOffset  << "\n"
-       << HGT_OFFSET_KW  << ": " << theHgtOffset  << endl;
-
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<LINE_NUM_COEF_KW<<"["<<i<<"]: "<<theLineNumCoef[i]<<endl;
-
-   out << endl;
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<LINE_DEN_COEF_KW<<"["<<i<<"]: "<<theLineDenCoef[i]<<endl;
-
-   out << endl;
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<SAMP_NUM_COEF_KW<<"["<<i<<"]: "<<theSampNumCoef[i]<<endl;
-
-   out << endl;
-   for (int i=0; i<NUM_COEFFS; i++)
-      out<<"  "<<SAMP_DEN_COEF_KW<<"["<<i<<"]: "<<theSampDenCoef[i]<<endl;
-      
-   out << endl;
-
-   return ossimProjection::print(out);
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcProjection::saveState()
-//  
-//  Saves the model state to the KWL. This KWL also serves as a geometry file.
-//  
-//*****************************************************************************
-bool ossimRpcProjection::saveState(ossimKeywordlist& kwl,
-                              const char* prefix) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::saveState(): entering..." << std::endl;
-
-   kwl.add(prefix, ossimKeywordNames::TYPE_KW, MODEL_TYPE);
-
-   //***
-   // Hand off to base class for common stuff:
-   //***
-   ossimProjection::saveState(kwl, prefix);
-
-   kwl.add(prefix,
-           POLY_TYPE_KW,
-           (char)thePolyType,
-           true);
-   
-   kwl.add(prefix, LINE_SCALE_KW, theLineScale);
-   kwl.add(prefix, SAMP_SCALE_KW, theSampScale);
-   kwl.add(prefix, LAT_SCALE_KW, theLatScale);
-   kwl.add(prefix, LON_SCALE_KW, theLonScale);
-   kwl.add(prefix, HGT_SCALE_KW, theHgtScale);
-   kwl.add(prefix, LINE_OFFSET_KW, theLineOffset);
-   kwl.add(prefix, SAMP_OFFSET_KW, theSampOffset);
-   kwl.add(prefix, LAT_OFFSET_KW, theLatOffset);
-   kwl.add(prefix, LON_OFFSET_KW, theLonOffset);
-   
-   kwl.add(prefix, HGT_OFFSET_KW, theHgtOffset);
-
-   for (int i=0; i<NUM_COEFFS; i++)
-   {
-      kwl.add(prefix, (LINE_NUM_COEF_KW + ossimString::toString(i)).c_str(), theLineNumCoef[i]);
-      kwl.add(prefix, (LINE_DEN_COEF_KW + ossimString::toString(i)).c_str(), theLineDenCoef[i]);
-      kwl.add(prefix, (SAMP_NUM_COEF_KW + ossimString::toString(i)).c_str(), theSampNumCoef[i]);
-      kwl.add(prefix, (SAMP_DEN_COEF_KW + ossimString::toString(i)).c_str(), theSampDenCoef[i]);
-   }
-      
-   saveAdjustments(kwl, prefix);
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::saveState(): returning..." << std::endl;
-   return true;
-}
-
-//*****************************************************************************
-//  METHOD: ossimRpcProjection::loadState()
-//  
-//  Restores the model's state from the KWL. This KWL also serves as a
-//  geometry file.
-//  
-//*****************************************************************************
-bool ossimRpcProjection::loadState(const ossimKeywordlist& kwl,
-                              const char* prefix) 
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::loadState(): entering..." << std::endl;
-
-   const char* value;
-   const char* keyword;
-
-   //***
-   // Pass on to the base-class for parsing first:
-   //***
-   bool success = ossimProjection::loadState(kwl, prefix);
-   if (!success)
-   {
-      theErrorStatus++;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::loadState(): returning with error..." << std::endl;
-      return false;
-   }
-      
-   //***
-   // Continue parsing for local members:
-   //***
-   keyword = POLY_TYPE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   thePolyType = (PolynomialType) value[0];
-      
-   keyword = LINE_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLineScale = ossimString(value).toDouble();
-   
-   keyword = SAMP_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theSampScale = ossimString(value).toDouble();
-   
-   keyword = LAT_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLatScale = ossimString(value).toDouble();
-   
-   keyword = LON_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLonScale = ossimString(value).toDouble();
-   
-   keyword = HGT_SCALE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theHgtScale = ossimString(value).toDouble();
-   
-   keyword = LINE_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLineOffset = ossimString(value).toDouble();
-   
-   keyword = SAMP_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theSampOffset = ossimString(value).toDouble();
-   
-   keyword = LAT_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLatOffset = ossimString(value).toDouble();
-   
-   keyword = LON_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theLonOffset = ossimString(value).toDouble();
-   
-   keyword = HGT_OFFSET_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                          << std::endl;
-      return false;
-   }
-   theHgtOffset = ossimString(value).toDouble();
-
-   for (int i=0; i<NUM_COEFFS; i++)
-   {
-      value = kwl.find(prefix, (LINE_NUM_COEF_KW+ossimString::toString(i)).c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                             << std::endl;
-         return false;
-      }
-      theLineNumCoef[i] = ossimString(value).toDouble();
-   
-      value = kwl.find(prefix, (LINE_DEN_COEF_KW+ossimString::toString(i)).c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                             << std::endl;
-         return false;
-      }
-      theLineDenCoef[i] = ossimString(value).toDouble();
-   
-      value = kwl.find(prefix, (SAMP_NUM_COEF_KW+ossimString::toString(i)).c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                             << std::endl;
-         return false;
-      }
-      theSampNumCoef[i] = ossimString(value).toDouble();
-      
-      value = kwl.find(prefix, (SAMP_DEN_COEF_KW+ossimString::toString(i)).c_str());
-      if (!value)
-      {
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
-                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
-                                             << std::endl;
-         return false;
-      }
-      theSampDenCoef[i] = ossimString(value).toDouble();
-   }
-
-   loadAdjustments(kwl, prefix);
-
-   if(getNumberOfAdjustableParameters() < 1)
-   {
-      initAdjustableParameters();
-   }
-      
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::loadState(): returning..." << std::endl;
-
-   return true;
-}
-
-void ossimRpcProjection::initAdjustableParameters()
-{
-   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
-   int numParams = getNumberOfAdjustableParameters();
-   for (int i=0; i<numParams; i++)
-   {
-      setAdjustableParameter(i, 0.0);
-      setParameterDescription(i, PARAM_NAMES[i]);
-      setParameterUnit(i,PARAM_UNITS[i]);
-   }
-   setParameterSigma(INTRACK_OFFSET, 50.0);
-   setParameterSigma(CRTRACK_OFFSET, 50.0);
-   setParameterSigma(INTRACK_SCALE, 50.0);  
-   setParameterSigma(CRTRACK_SCALE, 50.0);  
-   setParameterSigma(MAP_ROTATION, 0.1);
-//   setParameterSigma(YAW_OFFSET, 0.001);
-}
-
-void ossimRpcProjection::adjustableParametersChanged()
-{
-   theIntrackOffset    = computeParameterOffset(INTRACK_OFFSET);
-   theCrtrackOffset    = computeParameterOffset(CRTRACK_OFFSET);
-   theIntrackScale     = computeParameterOffset(INTRACK_SCALE);
-   theCrtrackScale     = computeParameterOffset(CRTRACK_SCALE);
-   double mapRotation  = computeParameterOffset(MAP_ROTATION);
-   theCosMapRot        = ossim::cosd(mapRotation);
-   theSinMapRot        = ossim::sind(mapRotation);
-}
-
-bool
-ossimRpcProjection::setupOptimizer(const ossimString& setup)
-{
-   ossimKeywordlist kwl;
-
-   if(kwl.addFile(ossimFilename(setup)))
-   {
-      return loadState(kwl);
-   }
-   else
-   {
-      ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->createProjection(setup);
-      if(proj.valid())
-      {
-         kwl.clear();
-         proj->saveState(kwl);
-         
-         return loadState(kwl);
-      }
-   }
-   
-   return false;
-}
-
-ossim_uint32
-ossimRpcProjection::degreesOfFreedom()const
-{
-   ossim_uint32 dof = 0;
-   ossim_uint32 idx = 0;
-   ossim_uint32 numAdj = getNumberOfAdjustableParameters();
-   for(idx = 0; idx < numAdj; ++idx)
-   {
-      if(!isParameterLocked(idx))
-      {
-         ++dof;
-      }
-   }
-   
-   return dof;
-}
-//give inverse() partial derivative regarding parameter parmIdx (>=0)
-ossimGpt
-ossimRpcProjection::getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta)
-{   
-   double den = 0.5/hdelta;
-   ossimGpt res,gd;
-
-   double middle = getAdjustableParameter(parmIdx);
-   //set parm to high value
-   setAdjustableParameter(parmIdx, middle + hdelta, true);
-   res = inverse(ipos);
-   //set parm to low value and gte difference
-   setAdjustableParameter(parmIdx, middle - hdelta, true);
-   gd = inverse(ipos);
-
-   //reset parm
-   setAdjustableParameter(parmIdx, middle, true);
-
-   res.lon = den*(res.lon - gd.lon) * 100000.0; //TBC : approx meters
-   res.lat = den*(res.lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
-   res.hgt = den*(res.hgt - gd.hgt);
-
-   return res;
-}
-
-//give forward() partial derivative regarding parameter parmIdx (>=0)
-ossimDpt
-ossimRpcProjection::getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta)
-{   
-   static double den = 0.5/hdelta;
-   ossimDpt res;
-
-   double middle = getAdjustableParameter(parmIdx);
-   //set parm to high value
-   setAdjustableParameter(parmIdx, middle + hdelta, true);
-   res = inverse(gpos);
-   //set parm to low value and gte difference
-   setAdjustableParameter(parmIdx, middle - hdelta, true);
-   res -= inverse(gpos);
-   //get partial derivative
-   res = res*den;
-
-   //reset parm
-   setAdjustableParameter(parmIdx, middle, true);
-
-   return res;
-}
-
-double
-ossimRpcProjection::optimizeFit(const ossimTieGptSet& tieSet, double* /* targetVariance */)
-{
-#if 1
-   //NOTE : ignore targetVariance
-   ossimRefPtr<ossimRpcSolver> solver = new ossimRpcSolver(false, false); //TBD : choices should be part of setupFromString
-
-   std::vector<ossimDpt> imagePoints;
-   std::vector<ossimGpt> groundPoints;
-   tieSet.getSlaveMasterPoints(imagePoints, groundPoints);
-   solver->solveCoefficients(imagePoints, groundPoints);
-
-   ossimRefPtr< ossimImageGeometry > optProj = solver->createRpcProjection();
-   if (!optProj)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::optimizeFit(): error when optimizing the RPC with given tie points"
-                                             << std::endl;
-      return -1.0;
-   }
-
-   if(optProj->hasProjection())
-   {
-      ossimKeywordlist kwl;
-      optProj->getProjection()->saveState(kwl);
-      this->loadState(kwl);
-   }
-
-   return std::pow(solver->getRmsError(), 2); //variance in pixel^2
-#else
-   // COPIED from ossimRpcProjection
-   //
-   //
-   //use a simple Levenberg-Marquardt non-linear optimization
-   //note : please limit the number of tie points
-   //
-   //INPUTS: requires Jacobian matrix (partial derivatives with regards to parameters)
-   //OUPUTS: will also compute parameter covariance matrix
-   //
-   //TBD: use targetVariance!
- 
-   int np = getNumberOfAdjustableParameters();
-   int nobs = tieSet.size();
-
-   //setup initail values
-   int iter=0;
-   int iter_max = 200;
-   double minResidue = 1e-10; //TBC
-   double minDelta = 1e-10; //TBC
-
-   //build Least Squares initial normal equation
-   // don't waste memory, add samples one at a time
-   NEWMAT::SymmetricMatrix A;
-   NEWMAT::ColumnVector residue;
-   NEWMAT::ColumnVector projResidue;
-   double deltap_scale = 1e-4; //step_Scale is 1.0 because we expect parameters to be between -1 and 1
-   buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
-   double ki2=residue.SumSquare();
-
-   //get current adjustment (between -1 and 1 normally) and convert to ColumnVector
-   ossimAdjustmentInfo cadj;
-   getAdjustment(cadj);
-   std::vector< ossimAdjustableParameterInfo >& parmlist = cadj.getParameterList();
-   NEWMAT::ColumnVector cparm(np), nparm(np);
-   for(int n=0;n<np;++n)
-   {
-      cparm(n+1) = parmlist[n].getParameter();
-   }
-
-   double damping_speed = 2.0;
-   //find max diag element for A
-   double maxdiag=0.0;
-   for(int d=1;d<=np;++d) {
-      if (maxdiag < A(d,d)) maxdiag=A(d,d);
-   }
-   double damping = 1e-3 * maxdiag;
-   double olddamping = 0.0;
-   bool found = false;
-
-//DEBUG TBR
-cout<<"rms="<<sqrt(ki2/nobs)<<" ";
-cout.flush();
-
-   while ( (!found) && (iter < iter_max) ) //non linear optimization loop
-   {
-      bool decrease = false;
-
-      do
-      {
-         //add damping update to normal matrix
-         for(int d=1;d<=np;++d) A(d,d) += damping - olddamping;
-         olddamping = damping;
-
-         NEWMAT::ColumnVector deltap = solveLeastSquares(A, projResidue);
-
-         if (deltap.NormFrobenius() <= minDelta) 
-         {
-            found = true;
-         } else {
-            //update adjustment
-            nparm = cparm + deltap;
-            for(int n=0;n<np;++n)
-            {
-               setAdjustableParameter(n, nparm(n+1), false); //do not update now, wait
-            }
-            adjustableParametersChanged();
-
-            //check residue is reduced
-            NEWMAT::ColumnVector newresidue = getResidue(tieSet);
-            double newki2=newresidue.SumSquare();
-            double res_reduction = (ki2 - newki2) / (deltap.t()*(deltap*damping + projResidue)).AsScalar();
- //DEBUG TBR
-       cout<<sqrt(newki2/nobs)<<" ";
-       cout.flush();
-
-            if (res_reduction > 0)
-            {
-               //accept new parms
-               cparm = nparm;
-               ki2=newki2;
-
-               deltap_scale = max(1e-15, deltap.NormInfinity()*1e-4);
-
-               buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
-               olddamping = 0.0;
-
-               found = ( projResidue.NormInfinity() <= minResidue );
-               //update damping factor
-               damping *= std::max( 1.0/3.0, 1.0-std::pow((2.0*res_reduction-1.0),3));
-               damping_speed = 2.0;
-               decrease = true;
-            } else {
-               //cancel parameter update
-               for(int n=0;n<np;++n)
-               {
-                  setAdjustableParameter(n, nparm(n+1), false); //do not update right now
-               }
-               adjustableParametersChanged();
-
-               damping *= damping_speed;
-               damping_speed *= 2.0;
-            }
-         }
-      } while (!decrease && !found);
-      ++iter;
-   }
-
-//DEBUG TBR
-cout<<endl;
-
-   //compute parameter correlation
-   // use normal matrix inverse
-   //TBD
-
-   return ki2/nobs;
-#endif
-}
-
-void
-ossimRpcProjection::buildNormalEquation(const ossimTieGptSet& tieSet,
-                                      NEWMAT::SymmetricMatrix& A,
-                                      NEWMAT::ColumnVector& residue,
-                                      NEWMAT::ColumnVector& projResidue,
-                                      double pstep_scale)
-{
-   //goal:       build Least Squares system
-   //constraint: never store full Jacobian matrix in memory (can be huge)
-   //            so we build the matrices incrementally
-   // the system can be built using forward() or inverse() depending on the projection capabilities : useForward()
-   //
-   //TBD : add covariance matrix for each tie point
-
-   //init
-   int np = getNumberOfAdjustableParameters();
-   int dimObs;
-   bool useImageObs = useForward(); //caching
-   if (useImageObs)
-   {
-      dimObs = 2; //image observation
-   } else {
-      dimObs = 3; //ground observations
-   }
-   int no = dimObs * tieSet.size(); //number of observations
-
-   A.ReSize(np);
-   residue.ReSize(no);
-   projResidue.ReSize(np);
-   //Zeroify matrices that will be accumulated
-   A           = 0.0;
-   projResidue = 0.0;
-
-   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
-   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
-   unsigned long c=1;
-
-   if (useImageObs)
-   { 
-     //image observations 
-     ossimDpt* imDerp = new ossimDpt[np];
-     ossimDpt resIm;
-     // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         resIm = (*tit)->tie - forward(*(*tit));
-         residue(c++) = resIm.x;
-         residue(c++) = resIm.y;
-
-         //compute all image derivatives regarding parametres for the tie point position
-         for(int p=0;p<np;++p)
-         {
-            imDerp[p] = getForwardDeriv( p , *(*tit) , pstep_scale);
-         }
-
-         //compute influence of tie point on all sytem elements
-         for(int p1=0;p1<np;++p1)
-         {        
-            //proj residue: J * residue
-            projResidue.element(p1) += imDerp[p1].x * resIm.x + imDerp[p1].y * resIm.y;
-
-            //normal matrix A = transpose(J)*J
-            for(int p2=p1;p2<np;++p2)
-            {
-               A.element(p1,p2) += imDerp[p1].x * imDerp[p2].x + imDerp[p1].y * imDerp[p2].y;
-            }
-         }
-      }
-      delete []imDerp;
-   }
-   else
-   {
-      // ground observations
-      std::vector<ossimGpt> gdDerp(np);
-      ossimGpt gd, resGd;
-      // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         gd = inverse((*tit)->tie);
-         residue(c++) = resGd.lon = ((*tit)->lon - gd.lon) * 100000.0;
-         residue(c++) = resGd.lat = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
-         residue(c++) = resGd.hgt = (*tit)->hgt - gd.hgt; //TBD : normalize to meters?
-
-         //compute all image derivatives regarding parametres for the tie point position
-         for(int p=0;p<np;++p)
-         {
-            gdDerp[p] = getInverseDeriv( p , (*tit)->tie, pstep_scale);
-         }
-
-         //compute influence of tie point on all sytem elements
-         for(int p1=0;p1<np;++p1)
-         {        
-            //proj residue: J * residue
-            projResidue.element(p1) += gdDerp[p1].lon * resGd.lon + gdDerp[p1].lat * resGd.lat + gdDerp[p1].hgt * resGd.hgt; //TBC
-
-            //normal matrix A = transpose(J)*J
-            for(int p2=p1;p2<np;++p2)
-            {
-               A.element(p1,p2) += gdDerp[p1].lon * gdDerp[p2].lon + gdDerp[p1].lat * gdDerp[p2].lat + gdDerp[p1].hgt * gdDerp[p2].hgt;
-            }
-         }
-      }
-   } //end of if (useImageObs)
-}
-
-NEWMAT::ColumnVector
-ossimRpcProjection::getResidue(const ossimTieGptSet& tieSet)
-{
-   //init
-   NEWMAT::ColumnVector residue;
-   int dimObs;
-
-   bool useImageObs = useForward(); //caching
-   if (useImageObs)
-   {
-      dimObs = 2; //image observation
-   } else {
-      dimObs = 3; //ground observations
-   }
-   int no = dimObs * tieSet.size(); //number of observations
-
-   residue.ReSize(no);
-
-   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
-   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
-   unsigned long c=1;
-
-   if (useImageObs)
-   { 
-     //image observations 
-     ossimDpt resIm;
-     // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         resIm = (*tit)->tie - forward(**tit);
-         residue(c++) = resIm.x;
-         residue(c++) = resIm.y;
-      }
-   } else {
-      // ground observations
-      ossimGpt gd;
-      // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         gd = inverse((*tit)->tie);
-         residue(c++) = ((*tit)->lon - gd.lon) * 100000.0; //approx meters //TBC TBD
-         residue(c++) = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
-         residue(c++) = (*tit)->hgt - gd.hgt; //meters
-      }
-   } //end of if (useImageObs)
-
-   return residue;
-}
-
-/*!
- * solves Ax = r , with A symmetric positive definite
- * A can be rank deficient
- * size of A is typically between 10 and 100 rows
- */
-NEWMAT::ColumnVector 
-ossimRpcProjection::solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const
-{
-   NEWMAT::ColumnVector x = invert(A)*r;
-   return x;
-}
-
-/** 
- * stable invert stolen from ossimRpcSolver
- */
-NEWMAT::Matrix 
-ossimRpcProjection::invert(const NEWMAT::Matrix& m)const
-{
-   ossim_uint32 idx = 0;
-   NEWMAT::DiagonalMatrix d;
-   NEWMAT::Matrix u;
-   NEWMAT::Matrix v;
-
-   // decompose m.t*m which is stored in Temp into the singular values and vectors.
-   //
-   NEWMAT::SVD(m, d, u, v, true, true);
-   
-   // invert the diagonal
-   // this is just doing the reciprical fo all diagonal components and store back int
-   // d.  ths compute d inverse.
-   //
-   for(idx=0; idx < (ossim_uint32)d.Ncols(); ++idx)
-   {
-      if(d[idx] > 1e-14) //TBC : use DBL_EPSILON ?
-      {
-         d[idx] = 1.0/d[idx];
-      }
-      else
-      {
-         d[idx] = 0.0;
-
-//DEBUG TBR
-cout<<"warning: singular matrix in SVD"<<endl;
-
-      }
-   }
-
-   //compute inverse of decomposed m;
-   return v*d*u.t();
-}
diff --git a/ossim/src/ossim/projection/ossimRpcSolver.cpp b/ossim/src/ossim/projection/ossimRpcSolver.cpp
deleted file mode 100644
index 19f7296..0000000
--- a/ossim/src/ossim/projection/ossimRpcSolver.cpp
+++ /dev/null
@@ -1,828 +0,0 @@
-//*****************************************************************************
-// FILE: ossimRpcModel.h
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Garrett Potts
-//
-//*****************************************************************************
-//  $Id: ossimRpcSolver.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <ctime>
-#include <iomanip>
-#include <iostream>
-#include <iterator>
-
-#include <ossim/projection/ossimRpcSolver.h>
-#include <ossim/projection/ossimRpcModel.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/matrix/newmatap.h>
-#include <ossim/matrix/newmatio.h>
-#include <ossim/matrix/newmatnl.h>
-#include <ossim/matrix/newmatio.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/support_data/ossimNitfRpcBTag.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/base/ossim2dTo2dIdentityTransform.h>
-ossimRpcSolver::ossimRpcSolver(bool useElevation,
-                               bool useHeightAboveMSLFlag)
-{
-   theUseElevationFlag   = useElevation;
-   theHeightAboveMSLFlag = useHeightAboveMSLFlag;
-   theXNumCoeffs.resize(20);
-   theXDenCoeffs.resize(20);
-   theYNumCoeffs.resize(20);
-   theYDenCoeffs.resize(20);
-
-   std::fill(theXNumCoeffs.begin(),
-             theXNumCoeffs.end(), 0.0);
-   std::fill(theXDenCoeffs.begin(),
-             theXDenCoeffs.end(), 0.0);
-   std::fill(theYNumCoeffs.begin(),
-             theYNumCoeffs.end(), 0.0);
-   std::fill(theYDenCoeffs.begin(),
-             theYDenCoeffs.end(), 0.0);
-   theXNumCoeffs[0] = 1.0;
-   theXDenCoeffs[0] = 1.0;
-   theYNumCoeffs[0] = 1.0;
-   theYDenCoeffs[0] = 1.0;
-}
-
-void ossimRpcSolver::solveCoefficients(const ossimDrect& imageBounds,
-                                       ossimProjection* proj,
-                                       ossim_uint32 xSamples,
-                                       ossim_uint32 ySamples,
-                                       bool shiftTo0Flag)
-{
-   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
-   geom->setProjection(proj);
-   solveCoefficients(imageBounds, geom.get(), xSamples, ySamples, shiftTo0Flag);
-}
-
-void ossimRpcSolver::solveCoefficients(const ossimDrect& imageBounds,
-                                       ossimImageGeometry* geom,
-                                       ossim_uint32 xSamples,
-                                       ossim_uint32 ySamples,
-                                       bool shiftTo0Flag)
-{
-   std::vector<ossimGpt> theGroundPoints;
-   std::vector<ossimDpt> theImagePoints;
-   ossim_uint32 x,y;
-   ossim_float64 w = imageBounds.width();
-   ossim_float64 h = imageBounds.height();
-   ossimGpt gpt;
-   ossimGpt defaultGround;
-   if(ySamples < 1) ySamples = 12;
-   if(xSamples < 1) xSamples = 12;
-   srand(time(0));
-   double xnorm;
-   double ynorm;
-   ossimDpt ul = imageBounds.ul();
-   ossimDpt shiftTo0(-ul.x,
-                     -ul.y);
-   for(y = 0; y < ySamples; ++y)
-   {
-      for(x = 0; x < xSamples; ++x)
-      {
-         if(ySamples > 1)
-         {
-//            ynorm = (double)y/(double)(ySamples-1.0);
-            ynorm = (double)y/(double)(ySamples);
-         }
-         else
-         {
-            ynorm = 0.0;
-         }
-         if(xSamples > 1)
-         {
-//            xnorm = (double)x/(double)(xSamples-1.0);
-            xnorm = (double)x/(double)(xSamples);
-         }
-         else
-         {
-            xnorm = 0.0;
-         }
-         
-//          ossimDpt dpt((.25 + .5*xnorm)*w + ul.x,
-//                       (.25 + .5*ynorm)*h + ul.y);
-         ossimDpt dpt(w*xnorm + ul.x,
-                      h*ynorm + ul.y);
-         
-         geom->localToWorld(dpt, gpt);
-         gpt.changeDatum(defaultGround.datum());
-
-         if(shiftTo0Flag)
-         {
-            theImagePoints.push_back(dpt+shiftTo0);
-         }
-         else
-         {
-            theImagePoints.push_back(dpt);
-         }
-         if(theHeightAboveMSLFlag)
-         {
-            double h = ossimElevManager::instance()->getHeightAboveMSL(gpt);
-            if(ossim::isnan(h) == false)
-            {
-               gpt.height(h);
-            }
-         }
-         if(gpt.isHgtNan())
-         {
-            gpt.height(0.0);
-         }
-         theGroundPoints.push_back(gpt);
-      }
-   }
-   solveCoefficients(theImagePoints,
-                     theGroundPoints);
-}
-
-void ossimRpcSolver::solveCoefficients(const std::vector<ossimDpt>& imagePoints,
-                                       const std::vector<ossimGpt>& groundControlPoints,
-                                       const ossimDpt& /* imageShift */)
-{
-   if((imagePoints.size() != groundControlPoints.size()))
-   {
-      return;
-   }
-
-   // we will first create f which holds the result of f(x,y,z).
-   // This basically holds the cooresponding image point for each
-   // ground control point.  One for x and a second array for y
-   //
-   std::vector<double> f[2];
-
-   //  Holds the x, y, z vectors
-   //
-   std::vector<double> x;
-   std::vector<double> y;
-   std::vector<double> z;
-   ossim_uint32 c = 0;
-   f[0].resize(imagePoints.size());
-   f[1].resize(imagePoints.size());
-   x.resize(imagePoints.size());
-   y.resize(imagePoints.size());
-   z.resize(imagePoints.size());
-
-   // compute the image bounds for the given image points
-   //
-   ossimDrect rect(imagePoints);
-
-   // get the widtha dn height that will be used
-   // in data normalization
-   //
-   ossim_float64 w = rect.width();
-   ossim_float64 h = rect.height();
-
-   // setup scales for normalization
-//   ossim_float64 xScale = w/2.0;
-//   ossim_float64 yScale = h/2.0;
-
-   // get the shift for the cneter of the data
-   ossimDpt centerImagePoint  = rect.midPoint();
-   
-   double latSum=0.0;
-   double lonSum=0.0;
-   double heightSum=0.0;
-
-   // find the center ground  Use elevation only if its enabled
-   //
-   for(c = 0; c < groundControlPoints.size();++c)
-   {
-      if(ossim::isnan(groundControlPoints[c].latd()) == false)
-      {
-         latSum += groundControlPoints[c].latd();
-      }
-      if(ossim::isnan(groundControlPoints[c].lond()) == false)
-      {
-         lonSum += groundControlPoints[c].lond();
-      }
-      if(!groundControlPoints[c].isHgtNan())
-      {
-         if(theUseElevationFlag)
-         {
-            heightSum += groundControlPoints[c].height();
-         }
-      }
-   }
-
-   // set the center ground for the offset
-   //
-   ossimGpt centerGround(latSum/groundControlPoints.size(),
-                         lonSum/groundControlPoints.size(),
-                         heightSum/groundControlPoints.size());
-
-   // set up ground scales and deltas for normalization
-   //
-//   ossim_float64 latScale       = 0.0;
-//   ossim_float64 lonScale       = 0.0;
-//   ossim_float64 heightScale    = 0.0;
-   ossim_float64 deltaLat       = 0.0;
-   ossim_float64 deltaLon       = 0.0;
-   ossim_float64 deltaHeight    = 0.0;
-   ossim_float64 maxDeltaLat    = 0.0;
-   ossim_float64 maxDeltaLon    = 0.0;
-   ossim_float64 maxDeltaHeight = 0.0;
-   ossim_float64 heightTest       = 0.0;
-   for(c = 0; c < groundControlPoints.size(); ++c)
-   {
-      deltaLat = (groundControlPoints[c].latd()-centerGround.latd());
-      deltaLon = (groundControlPoints[c].lond()-centerGround.lond());
-      if(!groundControlPoints[c].isHgtNan())
-      {
-         if(theUseElevationFlag)
-         {
-            deltaHeight = groundControlPoints[c].height() - centerGround.height();
-            heightTest  = groundControlPoints[c].height();
-         }
-         else
-         {
-            deltaHeight = 0.0;
-            heightTest  = 0.0;
-         }
-      }
-      else
-      {
-         deltaHeight = 0.0;
-      }
-      f[0][c] = (imagePoints[c].x - centerImagePoint.x)/(w/2.0);
-      f[1][c] = (imagePoints[c].y - centerImagePoint.y)/(h/2.0);
-      
-      x[c] = deltaLon;
-      y[c] = deltaLat;
-      z[c] = deltaHeight;
-
-      if(fabs(deltaLat) > maxDeltaLat) maxDeltaLat          = fabs(deltaLat);
-      if(fabs(deltaLon) > maxDeltaLon) maxDeltaLon          = fabs(deltaLon);
-      if(fabs(heightTest) > maxDeltaHeight) maxDeltaHeight  = fabs(heightTest);
-   }
-   bool elevationEnabled = theUseElevationFlag;
-   // always normalize, except if too small
-   //
-   // if max delta is less than a degree set it to 1 degree.
-   //
-   if(maxDeltaLat < 1.0)    maxDeltaLat = 1.0;
-   // if max delta is less than 1 degree then set it to 1.0 degree
-   if(maxDeltaLon < 1.0)    maxDeltaLon = 1.0;
-
-   if(fabs(maxDeltaHeight) < FLT_EPSILON) elevationEnabled = false;
-   // if max delta is less than a meter then set it to a meter.
-   if(maxDeltaHeight < 1.0) maxDeltaHeight = 1.0;
-
-   // set the height scale to something pretty large
-   if(!elevationEnabled)
-   {
-      maxDeltaHeight = 1.0/DBL_EPSILON;
-      centerGround.height(0.0);
-   }
-   // normalize the ground points
-   for(c = 0; c < groundControlPoints.size(); ++c)
-   {
-      x[c] /= maxDeltaLon;
-      y[c] /= maxDeltaLat;
-      z[c] /= maxDeltaHeight;
-   }
-
-   theLatScale    = maxDeltaLat;
-   theLonScale    = maxDeltaLon;
-   theHeightScale = maxDeltaHeight;
-
-   theImageOffset = centerImagePoint;
-   theImageScale  = ossimDpt(w/2.0,
-                             h/2.0);
-   theGroundOffset = centerGround;
-
-   if(ossim::isnan(theGroundOffset.height()))
-   {
-      theGroundOffset.height(0.0);
-   }
-
-   // now lets solve the coefficients
-   //
-   std::vector<double> coeffx;
-   std::vector<double> coeffy;
-
-   NEWMAT::ColumnVector coeffxVec;
-   NEWMAT::ColumnVector coeffyVec;
-   // perform a least squares fit for sample values found in f
-   // given the world values with variables x, y, z
-   //
-   solveCoefficients(coeffxVec,
-                     f[0],
-                     x,
-                     y,
-                     z);
-
-   
-   // perform a least squares fit for line values found in f
-   // given the world values with variables x, y, z
-   //
-   solveCoefficients(coeffyVec,
-                     f[1],
-                     x,
-                     y,
-                     z);
-
-   coeffx.resize(coeffxVec.Nrows());
-   coeffy.resize(coeffyVec.Nrows());
-   
-   for(c = 0; c < coeffx.size();++c)
-   {
-      coeffx[c] = coeffxVec[c];
-      coeffy[c] = coeffyVec[c];
-   }
-   // there are 20 numerator coefficients
-   // and 19 denominator coefficients
-   // I believe that the very first one for the
-   // denominator coefficients is fixed at 1.0
-   //
-   std::copy(coeffx.begin(),
-             coeffx.begin()+20,
-             theXNumCoeffs.begin());
-   std::copy(coeffx.begin()+20,
-             coeffx.begin()+39,
-             theXDenCoeffs.begin()+1);
-   std::copy(coeffy.begin(),
-             coeffy.begin()+20,
-             theYNumCoeffs.begin());
-   std::copy(coeffy.begin()+20,
-             coeffy.begin()+39,
-             theYDenCoeffs.begin()+1);
-   theXDenCoeffs[0] = 1.0;
-   theYDenCoeffs[0] = 1.0;
-
-
-   // now lets compute the RMSE for the given control points by feeding it
-   // back through the modeled RPC
-   //
-   ossim_float64  sumSquareError = 0.0;
-   ossim_uint32 idx = 0;
-
-//    std::cout << "ground offset height = " << theGroundOffset.height()
-//              << "Height scale         = " << theHeightScale << std::endl;
-   for (idx = 0; idx<imagePoints.size(); idx++)
-   {
-      ossim_float64 x = (groundControlPoints[idx].lond() - theGroundOffset.lond())/theLonScale;
-      ossim_float64 y = (groundControlPoints[idx].latd() - theGroundOffset.latd())/theLatScale;
-      ossim_float64 z = (groundControlPoints[idx].height() - theGroundOffset.height())/theHeightScale;
-      
-      if(ossim::isnan(z))
-      {
-         z = 0.0;
-      }
-      else
-      {
-         z = (z - theGroundOffset.height()/theHeightScale);
-      }
-       ossim_float64 imageX = ((eval(theXNumCoeffs, x, y, z)/
-                                eval(theXDenCoeffs, x, y, z))*theImageScale.x) + theImageOffset.x;
-      
-       ossim_float64 imageY = ((eval(theYNumCoeffs, x, y, z)/
-                                eval(theYDenCoeffs, x, y, z))*theImageScale.y) + theImageOffset.y;
-      
-      ossimDpt evalPt(imageX, imageY);
-      ossim_float64 len = (evalPt - imagePoints[idx]).length();
-      
-      sumSquareError += (len*len);
-   }
-
-   // set the error
-   //
-   theError = sqrt(sumSquareError/imagePoints.size());
-}
-
-ossimImageGeometry* ossimRpcSolver::createRpcModel()const
-{
-   ossimRpcModel* model = new ossimRpcModel;
-   
-   model->setAttributes(theImageOffset.x,
-                        theImageOffset.y,
-                        theImageScale.x,
-                        theImageScale.y,
-                        theGroundOffset.latd(),
-                        theGroundOffset.lond(),
-                        theGroundOffset.height(),
-                        theLatScale,
-                        theLonScale,
-                        theHeightScale,
-                        theXNumCoeffs,
-                        theXDenCoeffs,
-                        theYNumCoeffs,
-                        theYDenCoeffs);
-   return new ossimImageGeometry(new ossim2dTo2dIdentityTransform, model);
-}
-
-ossimImageGeometry* ossimRpcSolver::createRpcProjection()const
-{
-   ossimRpcProjection* proj = new ossimRpcProjection;
-   
-   proj->setAttributes(theImageOffset.x,
-                       theImageOffset.y,
-                       theImageScale.x,
-                       theImageScale.y,
-                       theGroundOffset.latd(),
-                       theGroundOffset.lond(),
-                       theGroundOffset.height(),
-                       theLatScale,
-                       theLonScale,
-                       theHeightScale,
-                       theXNumCoeffs,
-                       theXDenCoeffs,
-                       theYNumCoeffs,
-                       theYDenCoeffs);
-   return new ossimImageGeometry(new ossim2dTo2dIdentityTransform, proj);
-}
-
-const std::vector<double>& ossimRpcSolver::getImageXNumCoefficients()const
-{
-   return theXNumCoeffs;
-}
-
-const std::vector<double>& ossimRpcSolver::getImageXDenCoefficients()const
-{
-   return theXDenCoeffs;
-}
-
-const std::vector<double>& ossimRpcSolver::getImageYNumCoefficients()const
-{
-   return theYNumCoeffs;
-}
-
-const std::vector<double>& ossimRpcSolver::getImageYDenCoefficients()const
-{
-   return theYDenCoeffs;
-}
-
-double ossimRpcSolver::getImageXOffset()const
-{
-   return theImageOffset.x;
-}
-
-double ossimRpcSolver::getImageYOffset()const
-{
-   return theImageOffset.y;
-}
-
-double ossimRpcSolver::getLatOffset()const
-{
-   return theGroundOffset.latd();
-}
-
-double ossimRpcSolver::getLonOffset()const
-{
-   return theGroundOffset.lond();
-}
-
-double ossimRpcSolver::getHeightOffset()const
-{
-   return theGroundOffset.height();
-}
-
-double ossimRpcSolver::getImageXScale()const
-{
-   return theImageScale.x;
-}
-
-double ossimRpcSolver::getImageYScale()const
-{
-   return theImageScale.y;
-}
-
-double ossimRpcSolver::getLatScale()const
-{
-   return theLatScale;
-}
-
-double ossimRpcSolver::getLonScale()const
-{
-   return theLonScale;
-}
-
-double ossimRpcSolver::getHeightScale()const
-{
-   return theHeightScale;
-}
-
-double ossimRpcSolver::getRmsError()const
-{
-   return theError;
-}
-
-void ossimRpcSolver::solveInitialCoefficients(NEWMAT::ColumnVector& coeff,
-                                              const std::vector<double>& f,
-                                              const std::vector<double>& x,
-                                              const std::vector<double>& y,
-                                              const std::vector<double>& z)const
-{
-   ossim_uint32 idx = 0;
-   NEWMAT::Matrix m;
-   NEWMAT::ColumnVector r((int)f.size());
-   for(idx = 0; idx < f.size(); ++idx)
-   {
-      r[idx] = f[idx];
-   }
-   setupSystemOfEquations(m,
-                          r,
-                          x,
-                          y,
-                          z);
-   
-   coeff = invert(m.t()*m)*m.t()*r;
-}
-
-void ossimRpcSolver::solveCoefficients(NEWMAT::ColumnVector& coeff,
-                                       const std::vector<double>& f,
-                                       const std::vector<double>& x,
-                                       const std::vector<double>& y,
-                                       const std::vector<double>& z)const
-{
-   // this is an iterative  linear least square fit.  We really pobably need
-   // a nonlinear fit instead
-   //
-   ossim_uint32 idx = 0;
-   NEWMAT::Matrix m;
-
-   NEWMAT::ColumnVector r((int)f.size());
-
-   for(idx = 0; idx < f.size(); ++idx)
-   {
-      r[idx] = f[idx];
-   }
-
-   NEWMAT::ColumnVector tempCoeff;
-   NEWMAT::DiagonalMatrix weights((int)f.size());
-   NEWMAT::ColumnVector denominator(20);
-
-   // initialize the weight matrix to the identity
-   //
-   for(idx = 0; idx < f.size(); ++idx)
-   {
-      weights[idx] = 1.0;
-   }
-
-   double residualValue = 1.0/FLT_EPSILON;
-   ossim_uint32 iterations = 0;
-   NEWMAT::Matrix w2;
-   do
-   {
-      w2 = weights*weights;
-
-      // sets up the matrix to hold the system of
-      // equations
-      setupSystemOfEquations(m,
-                             r,
-                             x,
-                             y,
-                             z);
-
-      // solve the least squares solution.  Note: the invert is used
-      // to do a Singular Value Decomposition for the inverse since the
-      // matrix is more than likely singular.  Slower but more robust
-      //
-      tempCoeff = invert(m.t()*w2*m)*m.t()*w2*r;
-
-      // set up the weight matrix by using the denominator
-      //
-      for(idx = 0; idx < 19; ++idx)
-      {
-         denominator[idx+1] = tempCoeff[20+idx];
-      }
-      denominator[0] = 1.0;
-      
-      setupWeightMatrix(weights,
-                        denominator,
-                        r,
-                        x,
-                        y,
-                        z);
-
-      // compute the residual
-      //
-      NEWMAT::ColumnVector residual = m.t()*w2*(m*tempCoeff-r);
-
-      // now get the innerproduct
-      //
-      NEWMAT::Matrix tempRes = (residual.t()*residual);
-      residualValue = tempRes[0][0];
-
-      ++iterations;
-      
-   }while((residualValue >FLT_EPSILON)&&
-          (iterations < 10));
-   coeff = tempCoeff;
-
-}
-
-NEWMAT::Matrix ossimRpcSolver::invert(const NEWMAT::Matrix& m)const
-{
-   ossim_uint32 idx = 0;
-   NEWMAT::DiagonalMatrix d;
-   NEWMAT::Matrix u;
-   NEWMAT::Matrix v;
-
-   // decompose m.t*m which is stored in Temp into the singular values and vectors.
-   //
-   NEWMAT::SVD(m, d, u, v, true, true);
-   
-   // invert the diagonal
-   // this is just doing the reciprical fo all diagonal components and store back int
-   // d.  ths compute d inverse.
-   //
-   for(idx=0; idx < (ossim_uint32)d.Ncols(); ++idx)
-   {
-      if(d[idx] > FLT_EPSILON)
-      {
-         d[idx] = 1.0/d[idx];
-      }
-      else
-      {
-         d[idx] = 0.0;
-      }
-   }
-
-   //compute inverse of decomposed m;
-   return v*d*u.t();
-}
-
-
-void ossimRpcSolver::setupSystemOfEquations(NEWMAT::Matrix& equations,
-                                            const NEWMAT::ColumnVector& f,
-                                            const std::vector<double>& x,
-                                            const std::vector<double>& y,
-                                            const std::vector<double>& z)const
-{
-   ossim_uint32 idx;
-   equations.ReSize(f.Nrows(),
-                    39);
-   
-   for(idx = 0; idx < (ossim_uint32)f.Nrows();++idx)
-   {
-      equations[idx][0]  = 1;
-      equations[idx][1]  = x[idx];
-      equations[idx][2]  = y[idx];
-      equations[idx][3]  = z[idx];
-      equations[idx][4]  = x[idx]*y[idx];
-      equations[idx][5]  = x[idx]*z[idx];
-      equations[idx][6]  = y[idx]*z[idx];
-      equations[idx][7]  = x[idx]*x[idx];
-      equations[idx][8]  = y[idx]*y[idx];
-      equations[idx][9]  = z[idx]*z[idx];
-      equations[idx][10] = x[idx]*y[idx]*z[idx];
-      equations[idx][11] = x[idx]*x[idx]*x[idx];
-      equations[idx][12] = x[idx]*y[idx]*y[idx];
-      equations[idx][13] = x[idx]*z[idx]*z[idx];
-      equations[idx][14] = x[idx]*x[idx]*y[idx];
-      equations[idx][15] = y[idx]*y[idx]*y[idx];
-      equations[idx][16] = y[idx]*z[idx]*z[idx];
-      equations[idx][17] = x[idx]*x[idx]*z[idx];
-      equations[idx][18] = y[idx]*y[idx]*z[idx];
-      equations[idx][19] = z[idx]*z[idx]*z[idx];
-      equations[idx][20] = -f[idx]*x[idx];
-      equations[idx][21] = -f[idx]*y[idx];
-      equations[idx][22] = -f[idx]*z[idx];
-      equations[idx][23] = -f[idx]*x[idx]*y[idx];
-      equations[idx][24] = -f[idx]*x[idx]*z[idx];
-      equations[idx][25] = -f[idx]*y[idx]*z[idx];
-      equations[idx][26] = -f[idx]*x[idx]*x[idx];
-      equations[idx][27] = -f[idx]*y[idx]*y[idx];
-      equations[idx][28] = -f[idx]*z[idx]*z[idx];
-      equations[idx][29] = -f[idx]*x[idx]*y[idx]*z[idx];
-      equations[idx][30] = -f[idx]*x[idx]*x[idx]*x[idx];
-      equations[idx][31] = -f[idx]*x[idx]*y[idx]*y[idx];
-      equations[idx][32] = -f[idx]*x[idx]*z[idx]*z[idx];
-      equations[idx][33] = -f[idx]*x[idx]*x[idx]*y[idx];
-      equations[idx][34] = -f[idx]*y[idx]*y[idx]*y[idx];
-      equations[idx][35] = -f[idx]*y[idx]*z[idx]*z[idx];
-      equations[idx][36] = -f[idx]*x[idx]*x[idx]*z[idx];
-      equations[idx][37] = -f[idx]*y[idx]*y[idx]*z[idx];
-      equations[idx][38] = -f[idx]*z[idx]*z[idx]*z[idx];
-   }
-}
-
-void ossimRpcSolver::setupWeightMatrix(NEWMAT::DiagonalMatrix& result, // holds the resulting weights
-                                       const NEWMAT::ColumnVector& coefficients,
-                                       const NEWMAT::ColumnVector& f,
-                                       const std::vector<double>& x,
-                                       const std::vector<double>& y,
-                                       const std::vector<double>& z)const
-{
-   result.ReSize(f.Nrows());
-   ossim_uint32 idx = 0;
-   ossim_uint32 idx2 = 0;
-   NEWMAT::RowVector row(coefficients.Nrows());
-   
-    for(idx = 0; idx < (ossim_uint32)f.Nrows(); ++idx)
-    {
-       row[0]  = 1;
-       row[1]  = x[idx];
-       row[2]  = y[idx];
-       row[3]  = z[idx];
-       row[4]  = x[idx]*y[idx];
-       row[5]  = x[idx]*z[idx];
-       row[6]  = y[idx]*z[idx];
-       row[7]  = x[idx]*x[idx];
-       row[8]  = y[idx]*y[idx];
-       row[9]  = z[idx]*z[idx];
-       row[10] = x[idx]*y[idx]*z[idx];
-       row[11] = x[idx]*x[idx]*x[idx];
-       row[12] = x[idx]*y[idx]*y[idx];
-       row[13] = x[idx]*z[idx]*z[idx];
-       row[14] = x[idx]*x[idx]*y[idx];
-       row[15] = y[idx]*y[idx]*y[idx];
-       row[16] = y[idx]*z[idx]*z[idx];
-       row[17] = x[idx]*x[idx]*z[idx];
-       row[18] = y[idx]*y[idx]*z[idx];
-       row[19] = z[idx]*z[idx]*z[idx];
-
-      result[idx] = 0.0;
-      for(idx2 = 0; idx2 < (ossim_uint32)row.Ncols(); ++idx2)
-      {
-         result[idx] += row[idx2]*coefficients[idx2];
-      }
-
-      if(result[idx] > FLT_EPSILON)
-      {
-         result[idx] = 1.0/result[idx];
-      }
-    }
-}
-
-double ossimRpcSolver::eval(const std::vector<double>& coeff,
-                            double x,
-                            double y,
-                            double z)const
-{
-   return coeff[ 0]       + coeff[ 1]*x     + coeff[ 2]*y     + coeff[ 3]*z     +
-          coeff[ 4]*x*y   + coeff[ 5]*x*z   + coeff[ 6]*y*z   + coeff[ 7]*x*x   +
-          coeff[ 8]*y*y   + coeff[ 9]*z*z   + coeff[10]*x*y*z + coeff[11]*x*x*x +
-          coeff[12]*x*y*y + coeff[13]*x*z*z + coeff[14]*x*x*y + coeff[15]*y*y*y +
-          coeff[16]*y*z*z + coeff[17]*x*x*z + coeff[18]*y*y*z + coeff[19]*z*z*z;
-}
-
-
-ossimRefPtr<ossimNitfRegisteredTag> ossimRpcSolver::getNitfRpcBTag() const
-{
-   ossimNitfRpcBTag* rpcbTag = new ossimNitfRpcBTag();
-
-   // success always true
-   rpcbTag->setSuccess(true);
-
-   // temp "0"...
-   rpcbTag->setErrorBias(0.0);
-
-   // temp "0"...
-   rpcbTag->setErrorRand(0.0);
-
-   // line offset
-   rpcbTag->setLineOffset(static_cast<ossim_uint32>(getImageYOffset()));
-
-   // sample offset
-   rpcbTag->setSampleOffset(static_cast<ossim_uint32>(getImageXOffset()));
-
-   // latitude offset
-   rpcbTag->setGeodeticLatOffset(getLatOffset());
-
-   // longitude offset
-   rpcbTag->setGeodeticLonOffset(getLonOffset());
-
-   // height offset
-   rpcbTag->setGeodeticHeightOffset(
-      static_cast<ossim_int32>(getHeightOffset()));
-
-   // line scale
-   rpcbTag->setLineScale(static_cast<ossim_uint32>(getImageYScale()));
-
-   // sample scale
-   rpcbTag->setSampleScale(static_cast<ossim_uint32>(getImageXScale()));
-
-   // latitude scale
-   rpcbTag->setGeodeticLatScale(getLatScale());
-
-   // longitude scale
-   rpcbTag->setGeodeticLonScale(getLonScale());
-
-   // height scale
-   rpcbTag->setGeodeticHeightScale(static_cast<ossim_int32>(getHeightScale()));
-
-   // line numerator coefficients
-   rpcbTag->setLineNumeratorCoeff(getImageYNumCoefficients());
-   
-   // line denominator coefficients
-   rpcbTag->setLineDenominatorCoeff(getImageYDenCoefficients());
-
-   // sample numerator coefficients
-   rpcbTag->setSampleNumeratorCoeff(getImageXNumCoefficients());
-
-   // sample denominator coefficients
-   rpcbTag->setSampleDenominatorCoeff(getImageXDenCoefficients());
-
-   // Return it as an ossimRefPtr<ossimNitfRegisteredTag>...
-   ossimRefPtr<ossimNitfRegisteredTag> tag = rpcbTag;
-   
-   return tag;
-}
-
diff --git a/ossim/src/ossim/projection/ossimRsmModel.cpp b/ossim/src/ossim/projection/ossimRsmModel.cpp
deleted file mode 100644
index ff419fa..0000000
--- a/ossim/src/ossim/projection/ossimRsmModel.cpp
+++ /dev/null
@@ -1,997 +0,0 @@
-//---
-// File: ossimRsmModel.cpp
-//
-//  RP 
-//  LIMITATIONS - This is supporting only the RSM features that have been
-//  observed in current data samples and does not attempt to support the entire
-//  RSM specification.
-//  Examples of currently unsupported items include ->
-//  1.  multiple RSMPC tags for different polynomials for separate image sections 
-//  2.  Error Covariance (this may gain priority as we have access to RSMECA data)
-//  3.  Illumination model
-//  4.  Rectangular coodinate system conversion (RSDIDA GRNDD = "R")
-// 
-//---
-
-#include <ossim/projection/ossimRsmModel.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/elevation/ossimHgtRef.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-
-#include <algorithm>
-#include <iomanip>
-#include <iostream>
-#include <sstream>
-
-// Define Trace flags for use within this file:
-static ossimTrace traceExec  ("ossimRsmModel:exec");
-static ossimTrace traceDebug ("ossimRsmModel:debug");
-
-RTTI_DEF1(ossimRsmModel, "ossimRsmModel", ossimSensorModel);
-
-static const char* MODEL_TYPE = "ossimRsmModel";
-static const char* RNRMO_KW   = "rnrmo";
-static const char* CNRMO_KW   = "cnrmo";
-static const char* XNRMO_KW   = "xnrmo";
-static const char* YNRMO_KW   = "ynrmo";
-static const char* ZNRMO_KW   = "znrmo";
-static const char* RNRMSF_KW  = "rnrmsf";
-static const char* CNRMSF_KW  = "cnrmsf";
-static const char* XNRMSF_KW  = "xnrmsf";
-static const char* YNRMSF_KW  = "ynrmsf";
-static const char* ZNRMSF_KW  = "znrmsf";
-static const char* RNPWRX_KW  = "rnpwrx";
-static const char* RNPWRY_KW  = "rnpwry";
-static const char* RNPWRZ_KW  = "rnpwrz";
-static const char* RNTRMS_KW  = "rntrms";
-static const char* RNPCF_KW   = "rnpcf";
-static const char* RDPWRX_KW  = "rdpwrx";
-static const char* RDPWRY_KW  = "rdpwry";
-static const char* RDPWRZ_KW  = "rdpwrz";
-static const char* RDTRMS_KW  = "rdtrms";
-static const char* RDPCF_KW   = "rdpcf";
-static const char* CNPWRX_KW  = "cnpwrx";
-static const char* CNPWRY_KW  = "cnpwry";
-static const char* CNPWRZ_KW  = "cnpwrz";
-static const char* CNTRMS_KW  = "cntrms";
-static const char* CNPCF_KW   = "cnpcf";
-static const char* CDPWRX_KW  = "cdpwrx";
-static const char* CDPWRY_KW  = "cdpwry";
-static const char* CDPWRZ_KW  = "cdpwrz";
-static const char* CDTRMS_KW  = "cdtrms";
-static const char* CDPCF_KW   = "cdpcf";
-      
-ossimRsmModel::ossimRsmModel()
-   :
-   ossimSensorModel(),
-
-   m_iid(),
-   m_edition(),
-
-   m_rsn(0),
-   m_csn(0),
-
-   m_rfep(0.0),
-   m_cfep(0.0),
-   m_rnrmo(0.0),
-   m_cnrmo(0.0),
-   m_xnrmo(0.0),
-   m_ynrmo(0.0),
-   m_znrmo(0.0),
-   m_rnrmsf(0.0),
-   m_cnrmsf(0.0),
-   m_xnrmsf(0.0),
-   m_ynrmsf(0.0),
-   m_znrmsf(0.0),
-   
-   m_rnpwrx(0),
-   m_rnpwry(0),
-   m_rnpwrz(0),
-   m_rntrms(0),
-
-   m_rnpcf(),
-   
-   m_rdpwrx(0),
-   m_rdpwry(0),
-   m_rdpwrz(0),
-   m_rdtrms(0),
-
-   m_rdpcf(),
-   
-   m_cnpwrx(0),
-   m_cnpwry(0),
-   m_cnpwrz(0),
-   m_cntrms(0),
-
-   m_cnpcf(),
-   
-   m_cdpwrx(0),
-   m_cdpwry(0),
-   m_cdpwrz(0),
-   m_cdtrms(0),
-
-   m_cdpcf()
-{
-   initAdjustableParameters();
-   
-} // End: ossimRsmModel::ossimRsmModel()
-
-ossimRsmModel::ossimRsmModel( const ossimRsmModel& obj )
-   :
-   ossimSensorModel( obj ),
-
-   m_iid( obj.m_iid ),
-   m_edition( obj.m_edition ),
-
-   m_rsn( obj.m_rsn ),
-   m_csn( obj.m_csn ),
-
-   m_rfep( obj.m_rfep ),
-   m_cfep( obj.m_cfep ),
-   m_rnrmo( obj.m_rnrmo ),
-   m_cnrmo( obj.m_cnrmo ),
-   m_xnrmo( obj.m_xnrmo ),
-   m_ynrmo( obj.m_ynrmo ),
-   m_znrmo( obj.m_znrmo ),
-   m_rnrmsf( obj.m_rnrmsf ),
-   m_cnrmsf( obj.m_cnrmsf ),
-   m_xnrmsf( obj.m_xnrmsf ),
-   m_ynrmsf( obj.m_ynrmsf ),
-   m_znrmsf( obj.m_znrmsf ),
-   
-   m_rnpwrx( obj.m_rnpwrx ),
-   m_rnpwry( obj.m_rnpwry ),
-   m_rnpwrz( obj.m_rnpwrz ),
-   m_rntrms( obj.m_rntrms ),
-
-   m_rnpcf( obj.m_rnpcf ),
-   
-   m_rdpwrx( obj.m_rdpwrx ),
-   m_rdpwry( obj.m_rdpwry ),
-   m_rdpwrz( obj.m_rdpwrz ),
-   m_rdtrms( obj.m_rdtrms ),
-
-   m_rdpcf( obj.m_rdpcf ),
-   
-   m_cnpwrx( obj.m_cnpwrx ),
-   m_cnpwry( obj.m_cnpwry ),
-   m_cnpwrz( obj.m_cnpwrz ),
-   m_cntrms( obj.m_cntrms ),
-
-   m_cnpcf( obj.m_cnpcf ),
-   
-   m_cdpwrx( obj.m_cdpwrx ),
-   m_cdpwry( obj.m_cdpwry ),
-   m_cdpwrz( obj.m_cdpwrz ),
-   m_cdtrms( obj.m_cdtrms ),
-
-   m_cdpcf( obj.m_cdpcf )
-{
-   
-} // End: ossimRsmModel::ossimRsmModel( const ossimRsmModel& obj )
-
-const ossimRsmModel& ossimRsmModel::operator=( const ossimRsmModel& rhs )
-{
-   if (this != &rhs)
-   {
-      ossimSensorModel::operator=(rhs);
-
-      m_iid = rhs.m_iid;
-      m_edition = rhs.m_edition;
-      
-      m_rsn = rhs.m_rsn;
-      m_csn = rhs.m_csn;
-      
-      m_rfep = rhs.m_rfep;
-      m_cfep = rhs.m_cfep;
-      m_rnrmo = rhs.m_rnrmo;
-      m_cnrmo = rhs.m_cnrmo;
-      m_xnrmo = rhs.m_xnrmo;
-      m_ynrmo = rhs.m_ynrmo;
-      m_znrmo = rhs.m_znrmo;
-      m_rnrmsf = rhs.m_rnrmsf;
-      m_cnrmsf = rhs.m_cnrmsf;
-      m_xnrmsf = rhs.m_xnrmsf;
-      m_ynrmsf = rhs.m_ynrmsf;
-      m_znrmsf = rhs.m_znrmsf;
-      
-      m_rnpwrx = rhs.m_rnpwrx;
-      m_rnpwry = rhs.m_rnpwry;
-      m_rnpwrz = rhs.m_rnpwrz;
-      m_rntrms = rhs.m_rntrms;
-      
-      m_rnpcf = rhs.m_rnpcf;
-      
-      m_rdpwrx = rhs.m_rdpwrx;
-      m_rdpwry = rhs.m_rdpwry;
-      m_rdpwrz = rhs.m_rdpwrz;
-      m_rdtrms = rhs.m_rdtrms;
-      
-      m_rdpcf = rhs.m_rdpcf;
-      
-      m_cnpwrx = rhs.m_cnpwrx;
-      m_cnpwry = rhs.m_cnpwry;
-      m_cnpwrz = rhs.m_cnpwrz;
-      m_cntrms = rhs.m_cntrms;
-      
-      m_cnpcf = rhs.m_cnpcf;
-      
-      m_cdpwrx = rhs.m_cdpwrx;
-      m_cdpwry = rhs.m_cdpwry;
-      m_cdpwrz = rhs.m_cdpwrz;
-      m_cdtrms = rhs.m_cdtrms;
-      
-      m_cdpcf = rhs.m_cdpcf;
-   }
-   
-   return *this;
-   
-} // End: ossimRsmModel::operator=( const ossimRsmModel& rhs )
-
-ossimRsmModel::~ossimRsmModel()
-{
-}
-
-//---
-//  METHOD: ossimRsmModel::worldToLineSample()
-//  
-//  Overrides base class implementation. Directly computes line-sample from
-//  the polynomials.
-//---
-void ossimRsmModel::worldToLineSample(const ossimGpt& ground_point,
-                                      ossimDpt&       img_pt) const
-{
-   if(ground_point.isLatNan() || ground_point.isLonNan() )
-   {
-      img_pt.makeNan();
-      return;
-   }
-
-   //---
-   // Normalize the lat, lon, hgt:
-   // a_norm = (a-offset)/scalefactor
-   //
-   // Note:
-   //
-   // Was getting bogus line sample values in Western hemisphere; hence, the
-   // test on longitude. (drb - 22 May 2015)
-   //---
-   double lon = (ground_point.lon >= 0.0) ? ground_point.lon : ground_point.lon + 360.0;
-   double y = (ossim::degreesToRadians(ground_point.lat) - m_ynrmo) / m_ynrmsf;
-   // double x = (ossim::degreesToRadians(ground_point.lon) - m_xnrmo) / m_xnrmsf;
-   double x = ( ossim::degreesToRadians(lon) - m_xnrmo) / m_xnrmsf;   
-   double z;
-
-   if( ground_point.isHgtNan() )
-   {
-     z = ( - m_znrmo) / m_znrmsf;
-   }
-   else
-   {
-     z = (ground_point.hgt - m_znrmo) / m_znrmsf;
-   }
-
-   double rnNrm =  polynomial(x, y, z, m_rnpwrx, m_rnpwry, m_rnpwrz, m_rnpcf); 
-   double rdNrm =  polynomial(x, y, z, m_rdpwrx, m_rdpwry, m_rdpwrz, m_rdpcf);
-   double cnNrm =  polynomial(x, y, z, m_cnpwrx, m_cnpwry, m_cnpwrz, m_cnpcf);
-   double cdNrm =  polynomial(x, y, z, m_cdpwrx, m_cdpwry, m_cdpwrz, m_cdpcf);
-   
-   double rNrm  = rnNrm / rdNrm;
-   double cNrm  = cnNrm / cdNrm;
-
-   //---
-   //  Unnormalize the computed value
-   //  a = (a_norm * scalefactor) + offset
-   //
-   //  Note:
-   //
-   //  RSM (0,0) is upper left corner of pixel(0,0). OSSIM (0,0) is
-   //  center of the pixel; hence, the - 0.5. (drb 22 May 2015)
-   //---
-   
-   // img_pt.line = (rNrm * m_rnrmsf) + m_rnrmo; 
-   // img_pt.samp = (cNrm * m_cnrmsf) + m_cnrmo; 
-   img_pt.line = (rNrm * m_rnrmsf) + m_rnrmo - 0.5; 
-   img_pt.samp = (cNrm * m_cnrmsf) + m_cnrmo - 0.5; 
-
-} // End: ossimRsmModel::worldToLineSample( ... )
-
-//---
-//  METHOD: ossimRsmModel::lineSampleToWorld()
-//  
-//  Overrides base class implementation. Performs DEM intersection.
-//---
-void  ossimRsmModel::lineSampleToWorld(const ossimDpt& imagePoint,
-                                       ossimGpt&       worldPoint) const
-{
-   if(!imagePoint.hasNans())
-   {
-      ossimEcefRay ray;
-      
-      //---
-      // Note:
-      // RSM (0,0) is upper left corner of pixel(0,0). OSSIM (0,0) is
-      //  center of the pixel; hence, the + 0.5. (drb 22 May 2015)
-      //---
-      // imagingRay(imagePoint, ray);
-      imagingRay(ossimDpt(imagePoint.x+0.5, imagePoint.y+0.5), ray);
-      ossimElevManager::instance()->intersectRay(ray, worldPoint);
-   }
-   else
-   {
-      worldPoint.makeNan();
-   }
-}
-
-//---
-//  METHOD: ossimRsmModel::lineSampleHeightToWorld()
-//  
-//  Performs reverse projection of image line/sample to ground point.
-//  The imaging ray is intersected with a level plane at height = elev.
-//
-//  NOTE: U = line, V = sample -- this differs from the convention.
-//
-//---
-void ossimRsmModel::lineSampleHeightToWorld(const ossimDpt& image_point,
-                                            const double&   ellHeight,
-                                            ossimGpt&       gpt) const
-{
-   // Borrowed from ossimRpcModel algorithm to converge on polynomial roots
-
-   //---
-   // Constants for convergence tests:
-   //---
-   // SPEC says 1/20 of a pixel for polynomial fit, so converge to at least that point
-   static const int    MAX_NUM_ITERATIONS  = 100;
-   static const double CONVERGENCE_EPSILON = 0.05;  // pixels
-
-   // double U    = (image_point.y-m_rnrmo) / (m_rnrmsf);
-   // double V    = (image_point.x-m_cnrmo) / (m_cnrmsf);
-
-
-   double U = (image_point.y+0.5-m_rnrmo) / (m_rnrmsf);
-   double V = (image_point.x+0.5-m_cnrmo) / (m_cnrmsf);
-
-   //---
-   // Initialize quantities to be used in the iteration for ground point:
-   //---
-   double nlat = 0.0;  // normalized latitude
-   double nlon = 0.0;  // normalized longitude
-   double nhgt;
-
-   if(ossim::isnan(ellHeight))
-   {
-     nhgt = (- m_znrmo) / m_znrmsf;  // norm height
-   }
-   else
-   {
-      nhgt = (ellHeight - m_znrmo) / m_znrmsf;  // norm height
-   }
-
-   double epsilonU = CONVERGENCE_EPSILON/m_rnrmsf;
-   double epsilonV = CONVERGENCE_EPSILON/m_cnrmsf;
-   int    iteration = 0;
-   //---
-   // Declare variables only once outside the loop. These include:
-   // * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
-   // * partial derivatives of polynomials wrt X, Y,
-   // * computed normalized image point: Uc, Vc,
-   // * residuals of normalized image point: deltaU, deltaV,
-   // * partial derivatives of Uc and Vc wrt X, Y,
-   // * corrections to normalized lat, lon: deltaLat, deltaLon.
-   //---
-   double Pu, Qu, Pv, Qv;
-   double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
-   double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
-   double Uc, Vc;
-   double deltaU, deltaV;
-   double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
-   double deltaLat, deltaLon;
-
-   //---
-   // Now iterate until the computed Uc, Vc is within epsilon of the desired
-   // image point U, V:
-   //---
-   do
-   {
-      //---
-      // Calculate the normalized line and sample Uc, Vc as ratio of
-      // polynomials Pu, Qu and Pv, Qv:
-      //---
-      Pu = polynomial(nlon, nlat, nhgt, m_rnpwrx, m_rnpwry, m_rnpwrz, m_rnpcf);
-      Qu = polynomial(nlon, nlat, nhgt, m_rdpwrx, m_rdpwry, m_rdpwrz, m_rdpcf);
-      Pv = polynomial(nlon, nlat, nhgt, m_cnpwrx, m_cnpwry, m_cnpwrz, m_cnpcf);
-      Qv = polynomial(nlon, nlat, nhgt, m_cdpwrx, m_cdpwry, m_cdpwrz, m_cdpcf);
-      Uc = Pu/Qu;
-      Vc = Pv/Qv;
-
-      //---
-      // Compute residuals between desired and computed line, sample:
-      //---
-      deltaU = U - Uc;
-      deltaV = V - Vc;
-
-      //---
-      // Check for convergence and skip re-linearization if converged:
-      //---
-      if ((fabs(deltaU) > epsilonU) || (fabs(deltaV) > epsilonV))
-      {
-         //---
-         // Analytically compute the partials of each polynomial wrt lat, lon:
-         //---
-         dPu_dLat = dPoly_dLat(nlon, nlat, nhgt, m_rnpwrx, m_rnpwry, m_rnpwrz, m_rnpcf);
-         dQu_dLat = dPoly_dLat(nlon, nlat, nhgt, m_rdpwrx, m_rdpwry, m_rdpwrz, m_rdpcf);
-         dPv_dLat = dPoly_dLat(nlon, nlat, nhgt, m_cnpwrx, m_cnpwry, m_cnpwrz, m_cnpcf);
-         dQv_dLat = dPoly_dLat(nlon, nlat, nhgt, m_cdpwrx, m_cdpwry, m_cdpwrz, m_cdpcf);
-         dPu_dLon = dPoly_dLon(nlon, nlat, nhgt, m_rnpwrx, m_rnpwry, m_rnpwrz, m_rnpcf);
-         dQu_dLon = dPoly_dLon(nlon, nlat, nhgt, m_rdpwrx, m_rdpwry, m_rdpwrz, m_rdpcf);
-         dPv_dLon = dPoly_dLon(nlon, nlat, nhgt, m_cnpwrx, m_cnpwry, m_cnpwrz, m_cnpcf);
-         dQv_dLon = dPoly_dLon(nlon, nlat, nhgt, m_cdpwrx, m_cdpwry, m_cdpwrz, m_cdpcf);
-
-         //---
-         // Analytically compute partials of quotients U and V wrt lat, lon:
-         //---
-         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
-         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
-         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
-         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
-
-         W = dU_dLon*dV_dLat - dU_dLat*dV_dLon;
-
-         //---
-         // Now compute the corrections to normalized lat, lon:
-         //---
-         deltaLat = (dU_dLon*deltaV - dV_dLon*deltaU) / W;
-         deltaLon = (dV_dLat*deltaU - dU_dLat*deltaV) / W;
-         nlat += deltaLat;
-         nlon += deltaLon;
-      }
-
-      ++iteration;
-
-   } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
-            && (iteration < MAX_NUM_ITERATIONS));
-   //---
-   // Test for exceeding allowed number of iterations. Flag error if so:
-   //---
-   if (iteration == MAX_NUM_ITERATIONS)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "WARNING ossimRsmModel::lineSampleHeightToWorld:\n"
-         << "Max number of iterations reached in ground point "
-         << "solution. Results are inaccurate." << endl;
-   }
-
-   //---
-   // Now un-normalize the ground point lat, lon and establish return quantity:
-   //
-   // lon will 0 to 2PI when image is near PI radians as specified in RSMIDA
-   // GRNDD field when value is "H" versus "G".   OSSIMGPT wrap handles this
-   // automatically, so no need to worry about it.
-   //---
-   gpt.lat = ossim::radiansToDegrees(nlat*m_ynrmsf + m_ynrmo);
-   gpt.lon = ossim::radiansToDegrees(nlon*m_xnrmsf + m_xnrmo);
-   gpt.hgt = (nhgt * m_znrmsf) + m_znrmo; //ellHeight;
-
-   //---
-   // Note: See above note. Added in wrap call. Longitude was coming out 242
-   // when should have been -118. (drb - 22 May 2015)
-   //---
-   gpt.wrap();
-   
-} // End: ossimRsmModel::lineSampleHeightToWorld( ... )
-
-//---
-//  METHOD: ossimRsmModel::imagingRay()
-//  
-//  Constructs a ray by intersecting 2 ellipsoid heights above and
-//  below the RPC height offset, and then forming a vector between the two.
-//
-//---
-void ossimRsmModel::imagingRay(const ossimDpt& imagePoint,
-                               ossimEcefRay&   imageRay) const
-{
-   //---
-   // For "from point", "to point" we want the image ray to be from above the
-   // ellipsoid down to Earth.
-   // 
-   // It appears the ray "from point" must be above the ellipsiod for the
-   // ossimElevSource::intersectRay method; ultimately, the
-   // ossimEllipsoid::nearestIntersection method, else it goes off in the
-   // weeds...
-   //---
-   double vectorLength = m_znrmsf * 2.0;
-
-   ossimGpt gpt;
-
-   // "from" point
-   double intHgt = m_znrmo + vectorLength;
-   lineSampleHeightToWorld(imagePoint, intHgt, gpt);
-   ossimEcefPoint intECFfrom(gpt);
-
-   // "to" point
-   lineSampleHeightToWorld(imagePoint, m_znrmo, gpt);
-   ossimEcefPoint intECFto(gpt);
-
-   // Construct ray
-   ossimEcefRay ray(intECFfrom, intECFto);
-
-   imageRay = ray;
-}
-
-void ossimRsmModel::updateModel()
-{
-}
-
-void ossimRsmModel::initAdjustableParameters()
-{
-}
-
-ossimObject* ossimRsmModel::dup() const
-{
-   return new ossimRsmModel(*this);
-}
-
-//---
-//  METHOD: ossimRsmModel::print()
-//  
-//  Formatted dump of data members.
-//---
-std::ostream& ossimRsmModel::print(std::ostream& out) const
-{
-   std::string prefix = "";
-   ossimKeywordlist kwl;
-   saveState( kwl, prefix.c_str() );
-   out << kwl;
-   return out;
-}
-
-//---
-//  METHOD: ossimRsmModel::saveState()
-//  
-//  Saves the model state to the KWL. This KWL also serves as a geometry file.
-//  
-//---
-bool ossimRsmModel::saveState(ossimKeywordlist& kwl,
-                              const char* prefix) const
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimRsmModel::saveState(): entering..." << std::endl;
-   }
-
-   kwl.add(prefix, ossimKeywordNames::TYPE_KW, MODEL_TYPE);
-
-   //---
-   // Hand off to base class for common stuff:
-   //---
-   ossimSensorModel::saveState(kwl, prefix);
-
-   //---
-   // Save off offsets and scales:
-   //---
-   kwl.add(prefix, RNRMO_KW, m_rnrmo);
-   kwl.add(prefix, CNRMO_KW, m_cnrmo);
-   kwl.add(prefix, XNRMO_KW, m_xnrmo);
-   kwl.add(prefix, YNRMO_KW, m_ynrmo);
-   kwl.add(prefix, ZNRMO_KW, m_znrmo);
-   kwl.add(prefix, RNRMSF_KW, m_rnrmsf);
-   kwl.add(prefix, CNRMSF_KW, m_cnrmsf);
-   kwl.add(prefix, XNRMSF_KW, m_xnrmsf);
-   kwl.add(prefix, YNRMSF_KW, m_ynrmsf);
-   kwl.add(prefix, ZNRMSF_KW, m_znrmsf);
-
-   kwl.add(prefix, RNPWRX_KW, m_rnpwrx);
-   kwl.add(prefix, RNPWRY_KW, m_rnpwry);
-   kwl.add(prefix, RNPWRZ_KW, m_rnpwrz);
-   kwl.add(prefix, RNTRMS_KW, m_rntrms);
-   for (ossim_uint32 i=0; i<m_rntrms; ++i)
-   {
-      ossimString key;
-      key = RNPCF_KW;
-      key += ossimString::toString(i);
-      kwl.add(prefix, key.c_str(), m_rnpcf[i]);
-   }
-
-   kwl.add(prefix, RDPWRX_KW, m_rdpwrx);
-   kwl.add(prefix, RDPWRY_KW, m_rdpwry);
-   kwl.add(prefix, RDPWRZ_KW, m_rdpwrz);
-   kwl.add(prefix, RDTRMS_KW, m_rdtrms);
-   for (ossim_uint32 i=0; i<m_rdtrms; ++i)
-   {
-	
-      ossimString key;
-      key = RDPCF_KW;
-      key += ossimString::toString(i);
-      kwl.add(prefix, key.c_str(), m_rdpcf[i]);
-   }
-
-   kwl.add(prefix, CNPWRX_KW, m_cnpwrx);
-   kwl.add(prefix, CNPWRY_KW, m_cnpwry);
-   kwl.add(prefix, CNPWRZ_KW, m_cnpwrz);
-   kwl.add(prefix, CNTRMS_KW, m_cntrms);
-   for (ossim_uint32 i=0; i<m_cntrms; ++i)
-   {
-      ossimString key;
-      key = CNPCF_KW;
-      key += ossimString::toString(i);
-      kwl.add(prefix, key.c_str(), m_cnpcf[i]);
-   }
-
-   kwl.add(prefix, CDPWRX_KW, m_cdpwrx);
-   kwl.add(prefix, CDPWRY_KW, m_cdpwry);
-   kwl.add(prefix, CDPWRZ_KW, m_cdpwrz);
-   kwl.add(prefix, CDTRMS_KW, m_cdtrms);
-   for (ossim_uint32 i=0; i<m_cdtrms; ++i)
-   {
-      ossimString key;
-      key = CDPCF_KW;
-      key += ossimString::toString(i);
-      kwl.add(prefix, key.c_str(), m_cdpcf[i]);
-   }
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimRsmModel::saveState(): returning..." << std::endl;
-   }
-
-   return true;
-}
-
-//---
-//  METHOD: ossimRsmModel::loadState()
-//  
-//  Restores the model's state from the KWL. This KWL also serves as a
-//  geometry file.
-//  
-//---
-bool ossimRsmModel::loadState(const ossimKeywordlist& kwl,
-                                  const char* prefix) 
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimRsmModel::loadState(): entering..." << std::endl;
-   }
-   
-   const char* value;
-   
-   //---
-   // Pass on to the base-class for parsing first:
-   //---
-   bool success = ossimSensorModel::loadState(kwl, prefix);
-   if (!success)
-   {
-      if (traceExec())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimRsmModel::loadState(): returning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-   
-   //---
-   // Continue parsing for local members:
-   //---
-   value = kwl.find(prefix, RNRMO_KW);
-   if (value)
-   {
-      m_rnrmo = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, CNRMO_KW);
-   if (value)
-   {
-      m_cnrmo = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, XNRMO_KW);
-   if (value)
-   {
-      m_xnrmo = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, YNRMO_KW);
-   if (value)
-   {
-      m_ynrmo = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, ZNRMO_KW);
-   if (value)
-   {
-      m_znrmo = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, RNRMSF_KW);
-   if (value)
-   {
-      m_rnrmsf = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, CNRMSF_KW);
-   if (value)
-   {
-      m_cnrmsf = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, XNRMSF_KW);
-   if (value)
-   {
-      m_xnrmsf = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, YNRMSF_KW);
-   if (value)
-   {
-      m_ynrmsf = ossimString(value).toFloat64();
-   }
-   value = kwl.find(prefix, ZNRMSF_KW);
-   if (value)
-   {
-      m_znrmsf = ossimString(value).toFloat64();
-   }
-
-   value = kwl.find(prefix, RNPWRX_KW);
-   if (value)
-   {
-      m_rnpwrx = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, RNPWRY_KW);
-   if (value)
-   {
-      m_rnpwry = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, RNPWRZ_KW);
-   if (value)
-   {
-      m_rnpwrz = ossimString(value).toUInt32();
-   }
-   
-   value = kwl.find(prefix, RNTRMS_KW);
-   if (value)
-   {
-      m_rntrms = ossimString(value).toUInt32();
-      m_rnpcf.resize(m_rntrms);      
-      for (ossim_uint32 i=0; i<m_rntrms; ++i)
-      {
-         ossimString keyword;
-         keyword = RNPCF_KW;
-         keyword += ossimString::toString(i); 
-         value = kwl.find(prefix, keyword.c_str());
-         if (!value)
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimRsmModel::loadState(): Error "
-               << "encountered parsing the following required keyword: "
-               << "<" << keyword << ">. Check the keywordlist for proper syntax."
-               << std::endl;
-            return false;
-         }
-         m_rnpcf[i] = ossimString(value).toFloat64();
-      }
-   }
-
-   value = kwl.find(prefix, RDPWRX_KW);
-   if (value)
-   {
-      m_rdpwrx = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, RDPWRY_KW);
-   if (value)
-   {
-      m_rdpwry = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, RDPWRZ_KW);
-   if (value)
-   {
-      m_rdpwrz = ossimString(value).toUInt32();
-   }
-
-   value = kwl.find(prefix, RDTRMS_KW);
-   if (value)
-   {
-      m_rdtrms = ossimString(value).toUInt32();
-      m_rdpcf.resize(m_rdtrms);
-      for (ossim_uint32 i=0; i<m_rdtrms; ++i)
-      {
-         ossimString keyword;
-         keyword = RDPCF_KW;
-         keyword += ossimString::toString(i);
-         value = kwl.find(prefix, keyword.c_str());
-         if (!value)
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimRsmModel::loadState(): Error "
-               << "encountered parsing the following required keyword: "
-               << "<" << keyword << ">. Check the keywordlist for proper syntax."
-               << std::endl;
-            return false;
-         }
-         m_rdpcf[i] = ossimString(value).toFloat64();
-      } 
-   }
-
-   value = kwl.find(prefix, CNPWRX_KW);
-   if (value)
-   {
-      m_cnpwrx = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, CNPWRY_KW);
-   if (value)
-   {
-      m_cnpwry = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, CNPWRZ_KW);
-   if (value)
-   {
-      m_cnpwrz = ossimString(value).toUInt32();
-   }
-
-   value = kwl.find(prefix, CNTRMS_KW);
-   if (value)
-   {
-      m_cntrms = ossimString(value).toUInt32();
-      m_cnpcf.resize(m_cntrms);
-      for (ossim_uint32 i=0; i<m_cntrms; ++i)
-      {
-         ossimString keyword;
-         keyword = CNPCF_KW;
-         keyword += ossimString::toString(i);
-         value = kwl.find(prefix, keyword.c_str());
-         if (!value)
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimRsmModel::loadState(): Error "
-               << "encountered parsing the following required keyword: "
-               << "<" << keyword << ">. Check the keywordlist for proper syntax."
-               << std::endl;
-            return false;
-         }
-         m_cnpcf[i] = ossimString(value).toFloat64();
-      } 
-   }
-
-   value = kwl.find(prefix, CDPWRX_KW);
-   if (value)
-   {
-      m_cdpwrx = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, CDPWRY_KW);
-   if (value)
-   {
-      m_cdpwry = ossimString(value).toUInt32();
-   }
-   value = kwl.find(prefix, CDPWRZ_KW);
-   if (value)
-   {
-      m_cdpwrz = ossimString(value).toUInt32();
-   }
-
-   value = kwl.find(prefix, CDTRMS_KW);
-   if (value)
-   {
-      m_cdtrms = ossimString(value).toUInt32();
-      m_cdpcf.resize(m_cdtrms);
-      for (ossim_uint32 i=0; i<m_cdtrms; ++i)
-      {
-         ossimString keyword;
-         keyword = CDPCF_KW;
-         keyword += ossimString::toString(i);
-         value = kwl.find(prefix, keyword.c_str());
-         if (!value)
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimRsmModel::loadState(): Error "
-               << "encountered parsing the following required keyword: "
-               << "<" << keyword << ">. Check the keywordlist for proper syntax."
-               << std::endl;
-            return false;
-         }
-         m_cdpcf[i] = ossimString(value).toFloat64();
-      }
-   }
-
-   updateModel();
-   
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimRsmModel::loadState(): returning..." << std::endl;
-   }
-   return true;
-}
-
-double ossimRsmModel::polynomial(
-   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
-   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<ossim_float64> pcf) const
-{
-   double r = 0.0;
-   ossim_uint32 index = 0;
-   for (ossim_uint32 k = 0; k <= maxz; ++k)
-   {
-      for (ossim_uint32 j = 0; j <= maxy; ++j)
-      {
-         for (ossim_uint32 i = 0; i <= maxx; ++i)
-         {
-            r+=pcf[index]*std::pow(x,(double)i)*std::pow(y,(double)j)*std::pow(z,(double)k);
-            ++index;
-         }
-      }
-   }
-   return r;
-}
-
-double ossimRsmModel::dPoly_dLat(
-   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
-   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<ossim_float64> pcf) const
-                                 
-{
-   double dr = 0.0;
-   ossim_uint32 index = 0;
-   for (ossim_uint32 k = 0; k <= maxz; ++k)
-   {
-      for (ossim_uint32 j = 0; j <= maxy; ++j)
-      {
-         for (ossim_uint32 i = 0; i <= maxx; ++i)
-         {
-            if (j>0)
-            {
-               dr+=j*pcf[index]*std::pow(x,(double)i)*std::pow(y,(double)(j-1))*std::pow(z,(double)k);
-            }
-            ++index;
-         }
-      }
-   }
-   return dr;
-}
-
-double ossimRsmModel::dPoly_dLon(
-   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
-   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<ossim_float64> pcf) const
-{
-   double dr = 0.0;
-   ossim_uint32 index = 0;
-   for (ossim_uint32 k = 0; k <= maxz; ++k)
-   {
-      for (ossim_uint32 j = 0; j <= maxy; ++j)
-      {
-         for (ossim_uint32 i = 0; i <= maxx; ++i)
-         {
-            if (i>0)
-            {
-               dr += i*pcf[index]*std::pow(x,(double)(i-1)) *
-                  std::pow(y,(double)j)*std::pow(z,(double)k);
-            }
-            ++index;
-         } 
-      }     
-   }
-   return dr;
-}
-
-double ossimRsmModel::dPoly_dHgt(
-   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
-   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<ossim_float64> pcf) const
-{
-   double dr = 0.0;
-   ossim_uint32 index = 0;
-   for (ossim_uint32 k = 0; k <= maxz; ++k)
-   {
-      for (ossim_uint32 j = 0; j <= maxy; ++j)
-      {
-         for (ossim_uint32 i = 0; i <= maxx; ++i)
-         {
-            if (k>0)
-            {
-               dr += k*pcf[index]*std::pow(x,(double)i) *
-                  std::pow(y,(double)j)*std::pow(z,(double)(k-1));
-            }
-            ++index;
-         } 
-      }     
-   }
-   return dr;
-}
diff --git a/ossim/src/ossim/projection/ossimSarModel.cpp b/ossim/src/ossim/projection/ossimSarModel.cpp
deleted file mode 100644
index b457c0b..0000000
--- a/ossim/src/ossim/projection/ossimSarModel.cpp
+++ /dev/null
@@ -1,1402 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Hicks
-//
-// Description: Base class for Synthetic Aperture Radar model.
-//
-//              This model represents a standard model using relatively
-//              generic support data based on the following references:
-//                [1] Modern Photogrammetry; Mikhail, Bethel, & McGlone;
-//                    Sections 11.7-11.9.  Equation number references are
-//                    provided where possible for added clarity.
-//                [2] The Compendium of Controlled Extensions for NITFS
-//                    21 Mar 2006, paragraph E.3.8, SAR MPDSR
-//
-//----------------------------------------------------------------------------
-// $Id: ossimSarModel.cpp 17206 2010-04-25 23:20:40Z dburken $
-
-#include <ossim/elevation/ossimHgtRef.h>
-#include <ossim/projection/ossimSarModel.h>
-#include <ossim/base/ossimLsrSpace.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotify.h>
-
-RTTI_DEF1(ossimSarModel, "ossimSarModel", ossimSensorModel);
-
-static ossimTrace traceExec (ossimString("ossimSarModel:exec"));
-static ossimTrace traceDebug(ossimString("ossimSarModel:debug"));
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimSarModel.cpp 17206 2010-04-25 23:20:40Z dburken $";
-#endif
-
-static const char ACQ_MODE_KW[]         = "acq_mode";
-static const char ORP_POS_KW[]          = "orp_pos";
-static const char ORP_CENTER_KW[]       = "orp_ctr_xy";
-static const char OPNORM_KW[]           = "opnorm";
-static const char OP_X_AXIS_KW[]        = "opx";
-static const char OIPR_KW[]             = "oipr";
-static const char PIX_SIZE_KW[]         = "pixel_size";
-static const char ARP_TIME_KW[]         = "arptm";
-static const char ARP_POLY_COEFF_X_KW[] = "arppol_coeff_x";
-static const char ARP_POLY_COEFF_Y_KW[] = "arppol_coeff_y";
-static const char ARP_POLY_COEFF_Z_KW[] = "arppol_coeff_z";
-static const char TIME_COEFF[]          = "time_coeff";
-
-static const ossimString PARAM_NAMES[] ={"x_pos_offset",
-                                         "y_pos_offset",
-                                         "z_pos_offset"};
-static const ossimString PARAM_UNITS[] ={"meters",
-                                         "meters",
-                                         "meters"};
- 
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::ossimSarModel()
-//  
-//  Constructor.
-//  
-//*****************************************************************************
-ossimSarModel::ossimSarModel()
-   :
-   theAcquisitionMode(),
-   theOrpPosition(),
-   theOrpCenter(),
-   theOutputPlaneNormal(),
-   theOipr(0.0),
-   theLsrOffset(0, 0, 0)
-{
-   initAdjustableParameters();
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimSarModel::ossimSarModel DEBUG:" << std::endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "OSSIM_ID:  " << OSSIM_ID << std::endl;
-#endif 
-   }
-   
-}
-
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimSarModel()
-//  
-//*****************************************************************************
-ossimSarModel::~ossimSarModel()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSarModel(): entering..." << std::endl;
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSarModel(): returning..." << std::endl;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::initAdjustableParameters()
-//  
-//  This method initializes the base class adjustable parameter and associated
-//  sigmas arrays with quantities specific to this model. These are default
-//  values only. A functional implementation would assign the sigmas via a
-//  keywordlist or camera specific derived class.
-//  
-//*****************************************************************************
-void ossimSarModel::initAdjustableParameters()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::initAdjustableParameters: entering..." << std::endl;
-
-   int numParams = NUM_ADJUSTABLE_PARAMS;
-   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
-   
-   //***
-   // Initialize adjustable parameter array:
-   //***
-   for (int i=0; i<numParams; i++)
-   {
-      setAdjustableParameter(i, 0.0);
-      setParameterDescription(i, PARAM_NAMES[i]);
-      setParameterUnit(i, PARAM_UNITS[i]);
-   }
-   
-   //***
-   // Initialize parameter sigma array:
-   //***
-   setParameterSigma(X_POS, 50.0);
-   setParameterSigma(Y_POS, 50.0);
-   setParameterSigma(Z_POS, 50.0);  
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::initAdjustableParameters: returning..." << std::endl;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::loadState()
-//  
-//  Load the state of this object from KWL.
-//  
-//*****************************************************************************
-bool ossimSarModel::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   // Call the base class.  If it fails, no sense going on.
-   if (ossimSensorModel::loadState(kwl, prefix) == false)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimSarModel::loadState(): returning with error..."
-            << std::endl;
-      }
-      
-      return false;
-   }
-
-   const char* lookup;
-   
-   // Get the acquisition mode
-   lookup = kwl.find(prefix, ACQ_MODE_KW);
-   theAcquisitionMode = ossimSarModel::UNKNOWN;
-   if (lookup)
-   {
-      setAcquisitionMode(ossimString(lookup));
-   }
-   if (theAcquisitionMode == ossimSarModel::UNKNOWN)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << ACQ_MODE_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the ORP (aka Output/Ground Reference Point)
-   theOrpPosition.makeNan();
-   lookup = kwl.find(prefix, ORP_POS_KW);
-   if (lookup)
-   {
-      theOrpPosition.toPoint(std::string(lookup));
-   }
-
-   if (theOrpPosition.hasNans())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << ORP_POS_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-   
-   // Get the ORP image coordinates
-   theOrpCenter.makeNan();
-   lookup = kwl.find(prefix, ORP_CENTER_KW);
-   if (lookup)
-   {
-      theOrpCenter.toPoint(std::string(lookup));
-   }
-
-   if (theOrpCenter.hasNans())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << ORP_CENTER_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the output plane normal (slant plane orientation)
-   theOutputPlaneNormal.makeNan();
-   lookup = kwl.find(prefix, OPNORM_KW);
-   if (lookup)
-   {
-      theOutputPlaneNormal.toPoint(std::string(lookup));
-   }
-
-   if (theOutputPlaneNormal.hasNans())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << OPNORM_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the output plane x-axis (slant plane orientation)
-   theOutputPlaneXaxis.makeNan();
-   lookup = kwl.find(prefix, OP_X_AXIS_KW);
-   if (lookup)
-   {
-      theOutputPlaneXaxis.toPoint(std::string(lookup));
-   }
-
-   if (theOutputPlaneXaxis.hasNans())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << OP_X_AXIS_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the output IPR
-   theOipr = ossim::nan();
-   lookup = kwl.find(prefix, OIPR_KW);
-   if (lookup)
-   {
-      theOipr = ossimString::toFloat64(lookup);
-   }
-   
-   if (ossim::isnan(theOipr))
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << OIPR_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the pixel size
-   thePixelSize = ossim::nan();
-   lookup = kwl.find(prefix, PIX_SIZE_KW);
-   if (lookup)
-   {
-      thePixelSize = ossimString::toFloat64(lookup);
-   }
-   
-   if (ossim::isnan(thePixelSize))
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << PIX_SIZE_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the ARP time
-   theArpTime = ossim::nan();
-   lookup = kwl.find(prefix, ARP_TIME_KW);
-   if (lookup)
-   {
-      theArpTime = ossimString::toFloat64(lookup);
-   }
-
-   if (ossim::isnan(theArpTime))
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << ARP_TIME_KW << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the ARP position coefficients
-   //  (variable degree polynomial representation of position)
-   theArpXPolCoeff.clear();
-   theArpYPolCoeff.clear();
-   theArpZPolCoeff.clear();
-   ossim_uint32 x_count = kwl.numberOf(ARP_POLY_COEFF_X_KW);
-   ossim_uint32 y_count = kwl.numberOf(ARP_POLY_COEFF_Y_KW);
-   ossim_uint32 z_count = kwl.numberOf(ARP_POLY_COEFF_Z_KW);
-
-   if ( (x_count == y_count) && (x_count == z_count) )
-   {
-      ossim_uint32 found = 0;
-      ossim_uint32 count = 0;
-   
-      while ( (found < x_count) &&
-              (count < 100) ) // limit lookups to 100...
-      {
-         ossimString s = ossimString::toString(count);
-         ossimString xkw = ARP_POLY_COEFF_X_KW;
-         ossimString ykw = ARP_POLY_COEFF_Y_KW;
-         ossimString zkw = ARP_POLY_COEFF_Z_KW;
-         xkw += s;
-         ykw += s;
-         zkw += s;
-
-         const char* xLookup = kwl.find(prefix, xkw.c_str());
-         const char* yLookup = kwl.find(prefix, ykw.c_str());
-         const char* zLookup = kwl.find(prefix, zkw.c_str());
-
-         if (xLookup && yLookup && zLookup)
-         {
-            ++found;
-            theArpXPolCoeff.push_back(ossimString::toFloat64(xLookup));
-            theArpYPolCoeff.push_back(ossimString::toFloat64(yLookup));
-            theArpZPolCoeff.push_back(ossimString::toFloat64(zLookup));
-         }
-         ++count;
-      }
-   }     
-   else
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << "arppol_coeff" << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-
-   // Get the time coefficients
-   //  (variable degree polynomial representation of time WRT image coordinates)
-   theTimeCoeff.clear();
-   ossim_uint32 timeCount = kwl.numberOf(TIME_COEFF);
-   if (timeCount)
-   {
-      ossim_uint32 found = 0;
-      ossim_uint32 count = 0;
-   
-      while ( (found < timeCount) &&
-              (count < 100) ) // limit lookups to 100...
-      {
-         ossimString kw = TIME_COEFF;
-         kw += ossimString::toString(count);;
-
-         lookup = kwl.find(prefix, kw.c_str());
-
-         if (lookup)
-         {
-            ++found;
-            theTimeCoeff.push_back(ossimString::toFloat64(lookup));
-         }
-         ++count;
-      }
-   }     
-   else
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "DEBUG ossimSarModel::loadState() lookup failure: "
-            << TIME_COEFF << "\nreturning with error..."
-            << std::endl;
-      }
-      return false;
-   }
-   
-   
-   updateModel();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimSarModel::loadState() DEBUG: " << std::endl;
-   }
-   
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::saveState()
-//  
-//  Save the state of this object to KWL.
-//  
-//*****************************************************************************
-bool ossimSarModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix, ACQ_MODE_KW, getAcquistionModeString());
-   kwl.add(prefix, ORP_POS_KW, theOrpPosition.toString(15).c_str());
-   kwl.add(prefix, ORP_CENTER_KW, theOrpCenter.toString(15).c_str());
-   kwl.add(prefix, OPNORM_KW, theOutputPlaneNormal.toString(15).c_str());
-   kwl.add(prefix, OP_X_AXIS_KW, theOutputPlaneXaxis.toString(15).c_str());
-   kwl.add(prefix, OIPR_KW, theOipr);
-   kwl.add(prefix, PIX_SIZE_KW, thePixelSize);
-   kwl.add(prefix, ARP_TIME_KW, theArpTime);
-
-   ossim_uint32 i;
-   for (i = 0; i < theArpXPolCoeff.size(); ++i)
-   {
-      ossimString kw = ARP_POLY_COEFF_X_KW;
-      kw += ossimString::toString(i);
-      kwl.add(prefix, kw, theArpXPolCoeff[i]);
-   }
-   for (i = 0; i < theArpYPolCoeff.size(); ++i)
-   {
-      ossimString kw = ARP_POLY_COEFF_Y_KW;
-      kw += ossimString::toString(i);
-      kwl.add(prefix, kw, theArpYPolCoeff[i]);
-   }
-   for (i = 0; i < theArpZPolCoeff.size(); ++i)
-   {
-      ossimString kw = ARP_POLY_COEFF_Z_KW;
-      kw += ossimString::toString(i);
-      kwl.add(prefix, kw, theArpZPolCoeff[i]);
-   }
-   for (i = 0; i < theTimeCoeff.size(); ++i)
-   {
-      ossimString kw = TIME_COEFF;
-      kw += ossimString::toString(i);
-      kwl.add(prefix, kw, theTimeCoeff[i]);
-   }
-   
-   return ossimSensorModel::saveState(kwl, prefix);
-}
-
-
-//*****************************************************************************
-// STATIC METHOD: ossimSarModel::writeGeomTemplate
-//  
-//  Writes a sample kwl to output stream. Please update this method with any
-//  format and/or keyword changes. It will make life a lot easier for everyone.
-//  
-//*****************************************************************************
-void ossimSarModel::writeGeomTemplate(ostream& os)
-{
-   if (traceExec())
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::writeGeomTemplate: entering..." << std::endl;
-
-   os <<
-      "//************************************\n"
-      "// Template for SAR model keywordlist\n"
-      "//************************************\n";
- 
-   ossimSensorModel::writeGeomTemplate(os);
-   os << "//***\n"
-      << "// Base-class SAR Keywords:\n"
-      << "//***\n"
-      << ACQ_MODE_KW         << ": <SCAN, SPOT>\n"
-      << ORP_POS_KW          << ": <meters (ECF)>\n"
-      << ORP_CENTER_KW       << ": <pixels>\n"
-      << OPNORM_KW           << ": <unit vector>\n"
-      << OP_X_AXIS_KW        << ": <unit vector>\n"
-      << OIPR_KW             << ": <meters>\n"
-      << PIX_SIZE_KW         << ": <meters>\n"
-      << ARP_TIME_KW         << ": <sec>\n"
-      << ARP_POLY_COEFF_X_KW << ": <meters (ECF)>\n"
-      << ARP_POLY_COEFF_Y_KW << ": <meters (ECF)>\n"
-      << ARP_POLY_COEFF_Z_KW << ": <meters (ECF)>\n"
-      << TIME_COEFF          << ": <sec>\n";
-   }
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::print()
-//  
-//  Print the KWL.
-//  
-//*****************************************************************************
-std::ostream& ossimSarModel::print(std::ostream& out) const
-{
-   out << "// ossimSarModel::print:" << std::endl;
-
-   ossimKeywordlist kwl;
-   if (saveState(kwl))
-   {
-      kwl.print(out);
-   }
-   else
-   {
-      out << "// ossimSarModel::saveState failed!" << std::endl;
-   }
-   return ossimSensorModel::print(out);
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getAcquisitionMode()
-//  
-//  Get internal acquisition mode parameter.
-//  
-//*****************************************************************************
-ossimString ossimSarModel::getAcquistionModeString() const
-{
-   ossimString result;
-   
-   switch (theAcquisitionMode)
-   {
-      case ossimSarModel::SCAN:
-         result = "scan";
-         break;
-      case ossimSarModel::SPOT:
-         result = "spot";
-         break;
-      case ossimSarModel::UNKNOWN:
-      default:
-         result = "unknown";
-         break;
-   }
-   return result;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::lineSampleHeightToWorld()
-//  
-//  Perform inverse projection of image space to ground point @ specified hgt.
-//
-//    Note: Special case indicated by 'heightAboveEllipsoid=OSSIM_NAN'
-//          will utilize the ORP height for intersection.
-//  
-//*****************************************************************************
-void ossimSarModel::lineSampleHeightToWorld(const ossimDpt& lineSampPt,
-                                            const double&   heightAboveEllipsoid,
-                                            ossimGpt&       worldPt) const
-{
-   // Compute OP position from image coordinates 
-   ossimEcefPoint opPt;
-   computeOPfromImage(lineSampPt, opPt);
-   
-   // Get image time
-   ossim_float64 iTime = getArpTime(lineSampPt);
-   
-   // Get ARP state
-   ossimEcefPoint  arpPos = getArpPos(iTime);
-   ossimEcefVector arpVel = getArpVel(iTime);
-   
-   // Get range/Doppler
-   ossim_float64 range;
-   ossim_float64 doppler;
-   computeRangeDoppler(opPt, arpPos, arpVel, range, doppler);
-   
-   // Set the height reference
-   ossim_float64 hgtSet;
-   if ( ossim::isnan(heightAboveEllipsoid) )
-   {
-      ossimGpt orpG(theOrpPosition);
-      hgtSet = orpG.height();
-   }
-   else
-   {
-      hgtSet = heightAboveEllipsoid;
-   }
-      
-   ossimHgtRef hgtRef(AT_HGT, hgtSet);
-   
-   // Project OP to DEM
-   ossimEcefPoint ellPt;
-   projOPtoSurface(opPt, range, doppler, arpPos, arpVel, &hgtRef, ellPt);
-   ossimGpt iPt(ellPt);
-   
-   worldPt = iPt;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::worldToLineSample()
-//  
-//  Perform forward projection of ground point to image space.
-//  
-//*****************************************************************************
-void ossimSarModel::worldToLineSample(const ossimGpt& world_point,
-                                      ossimDpt&       image_point) const
-{
-   ossimEcefPoint pt(world_point);
-   
-   // Project to OP plane
-   ossimEcefPoint opPt;
-   projEllipsoidToOP(pt, opPt);
-   
-   // Compute image coordinates from OP position
-   computeImageFromOP(opPt,image_point);
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::lineSampleToWorld()
-//  
-//  Perform inverse projection of image space to ground point.
-//  
-//*****************************************************************************
-void ossimSarModel::lineSampleToWorld(const ossimDpt& lineSampPt,
-                                      ossimGpt&       worldPt) const
-{
-   // Compute OP position from image coordinates 
-   ossimEcefPoint opPt;
-   computeOPfromImage(lineSampPt, opPt);
-   
-   // Get image time
-   ossim_float64 iTime = getArpTime(lineSampPt);
-   
-   // Get ARP state vector
-   ossimEcefPoint  arpPos = getArpPos(iTime);
-   ossimEcefVector arpVel = getArpVel(iTime);
-   
-   // Get range/Doppler
-   ossim_float64 range;
-   ossim_float64 doppler;
-   computeRangeDoppler(opPt, arpPos, arpVel, range, doppler);
-   
-   // Set the height reference
-   ossimHgtRef hgtRef(AT_DEM);
-   
-   // Project OP to DEM
-   ossimEcefPoint ellPt;
-   projOPtoSurface(opPt, range, doppler, arpPos, arpVel, &hgtRef, ellPt);
-   ossimGpt iPt(ellPt);
-   
-   worldPt = iPt;
-
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::imagingRay()
-//  
-//  Given an image point, returns a ray originating at the ARP position
-//  and pointing towards the target's position in the Output
-//  Plane.
-//  This DOES NOT provide the conventional definition for an imaging ray
-//  because the imaging locus for SAR is not a ray.
-//
-//  It DOES provide a radius vector for the range/Doppler circle.
-//  
-//*****************************************************************************
-void ossimSarModel::imagingRay(const ossimDpt& image_point,
-                               ossimEcefRay&   image_ray) const
-{
-   // Compute OP position from image coordinates 
-   ossimEcefPoint opPt;
-   computeOPfromImage(image_point, opPt);
-   
-   // Get image time
-   ossim_float64 iTime = getArpTime(image_point);
-   
-   // Get ARP position
-   ossimEcefPoint arpPos = getArpPos(iTime);
-   
-   // Construct the ray
-   ossimGpt start(arpPos);
-   ossimGpt end(opPt);
-
-   image_ray = ossimEcefRay(start, end);
-
-   return;   
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getObsCovMat()
-//
-//  Gives 2X2 covariance matrix of observations.
-//
-//    Note: At this base class level, the only error source currently
-//          considered is mensuration error.  This is obviously optimistic,
-//          but is included as a placeholder/example.
-//
-//*****************************************************************************
-ossimSensorModel::CovMatStatus ossimSarModel::getObsCovMat(
-   const ossimDpt& /* ipos */, NEWMAT::SymmetricMatrix& Cov)
-{
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Mensuration error contribution
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   //  Sensitivity matrix
-   NEWMAT::SymmetricMatrix B(2);
-   B(1,1) = thePixelSpacing;
-   B(2,2) = B(1,1);
-   B(1,2) = 0.0;
-   //  Default pointing error = 0.5 pixels
-   ossim_float64 defPointingSigma = 0.5;
-   NEWMAT::SymmetricMatrix P(2);
-   P(1,1) = defPointingSigma*defPointingSigma;
-   P(2,2) = P(1,1);
-   P(1,2) = 0.0;
-   //  Propagate to rng/az
-   NEWMAT::SymmetricMatrix Cm;
-   Cm << B * P * B.t();
-   
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Sum total covariance in rng/az
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   NEWMAT::SymmetricMatrix Ctot = Cm; //+ other contributors as identified
-   
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Propagate to rng/Dop
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   NEWMAT::SymmetricMatrix Bad(2);
-   Bad(1,1) = 1.0;
-   Bad(2,2) = theParDopWRTaz;
-   Bad(1,2) = 0.0;
-   
-   Cov << Bad * Ctot * Bad.t();
-
-   return ossimSensorModel::COV_PARTIAL;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::updateModel()
-//  
-//  Update computed parameters.
-//  
-//*****************************************************************************
-void ossimSarModel::updateModel()
-{
-   // Set the pixel size
-   thePixelSpacing = thePixelSize;
-   
-   // Define the output(focus) plane
-   //    Ref[1], eq. 11-29 -> 11-31
-   theOPZ = theOutputPlaneNormal.unitVector();
-   theOPX = theOutputPlaneXaxis.unitVector();
-   
-   theOPY = theOPZ.cross(theOPX);
-   theOPY.normalize();
-   
-   theOPX = theOPY.cross(theOPZ);
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG updateModel:\n OP vectors...";
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "\n  OPX: "<<theOPX
-      << "\n  OPY: "<<theOPY
-      << "\n  OPZ: "<<theOPZ<<endl;
-      ossimGpt orpg(theOrpPosition);
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      <<"  ORPgeo: "<<orpg<<endl;
-   }
-   // Update geometry
-   theLsrOffset.x() = getAdjustableParameter(X_POS) *
-                      getParameterSigma(X_POS);
-   theLsrOffset.y() = getAdjustableParameter(Y_POS) *
-                      getParameterSigma(Y_POS);
-   theLsrOffset.z() = getAdjustableParameter(Z_POS) *
-                      getParameterSigma(Z_POS);
-
-   // Set base class members
-   theRefGndPt = ossimGpt(theOrpPosition);
-   theRefImgPt = theOrpCenter;
-   theGSD.samp = thePixelSpacing;
-   theGSD.line = thePixelSpacing;
-   theMeanGSD  = thePixelSpacing;
-   
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getArpPos()
-//  
-//  Return ARP position as constant term.
-//  
-//*****************************************************************************
-ossimEcefPoint ossimSarModel::getArpPos() const
-{
-   ossimEcefPoint pos(theArpXPolCoeff[0],
-                      theArpYPolCoeff[0],
-                      theArpZPolCoeff[0]);
-                       
-   // Handle the adjustable offset
-   //   Define ENU space at pos
-   ossimGpt posG(pos);
-   ossimLsrSpace enu(posG);
-   //   Rotate offset vector to ECF
-   ossimColumnVector3d tpnn(theLsrOffset[0],theLsrOffset[1], theLsrOffset[2]);
-   ossimEcefVector ecfOffset = enu.lsrToEcefRotMatrix()*tpnn;
-   //   Add the offset   
-   pos = pos + ecfOffset;
-   
-   return pos;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getArpVel()
-//  
-//  Return ARP velocity as 1st order term coefficient.
-//  
-//*****************************************************************************
-ossimEcefVector ossimSarModel::getArpVel() const
-{
-   ossimEcefVector vec(theArpXPolCoeff[1],
-                       theArpYPolCoeff[1],
-                       theArpZPolCoeff[1]);
-
-   return vec;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getArpPos()
-//  
-//  Compute ARP position as function of time-dependent polynomial.
-//    Note: The polynomial degree/coefficients must be
-//    predetermined by the data provider.
-//  
-//*****************************************************************************
-ossimEcefPoint ossimSarModel::getArpPos(const ossim_float64& time) const
-{
-   ossim_int32 i;
-   ossim_uint32 nTermsX = (ossim_uint32)theArpXPolCoeff.size();
-   ossim_uint32 nTermsY = (ossim_uint32)theArpYPolCoeff.size();
-   ossim_uint32 nTermsZ = (ossim_uint32)theArpZPolCoeff.size();
-
-   ossim_float64 x = theArpXPolCoeff[nTermsX-1];
-   for (i=nTermsX-2; i>=0; i--)
-      x = x*time + theArpXPolCoeff[i];
-      
-   ossim_float64 y = theArpYPolCoeff[nTermsY-1];
-   for (i=nTermsY-2; i>=0; i--)
-      y = y*time + theArpYPolCoeff[i];
-      
-   ossim_float64 z = theArpZPolCoeff[nTermsZ-1];
-   for (i=nTermsZ-2; i>=0; i--)
-      z = z*time + theArpZPolCoeff[i];
-   
-   ossimEcefPoint pos(x, y, z);
-                       
-   // Handle the adjustable offset
-   //   Define ENU space at pos
-   ossimGpt posG(pos);
-   ossimLsrSpace enu(posG);
-   //   Rotate offset vector to ECF
-   ossimColumnVector3d tpnn(theLsrOffset[0],theLsrOffset[1], theLsrOffset[2]);
-   ossimEcefVector ecfOffset = enu.lsrToEcefRotMatrix()*tpnn;
-   //   Add the offset
-   pos = pos + ecfOffset;
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpPos:"<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << " time   = "<<time<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << " pos    = "<<pos<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << " offset = "<<theLsrOffset<<endl;
-   }
-   
-   return pos;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getArpVel()
-//  
-//  Compute ARP velocity as 1st derivative of time-dependent polynomial.
-//    Note: The polynomial degree/coefficients must be
-//    predetermined by the data provider.
-//  
-//*****************************************************************************
-ossimEcefVector ossimSarModel::getArpVel(const ossim_float64& time) const
-{
-   ossim_int32 i;
-   ossim_uint32 nTermsX = (ossim_uint32)theArpXPolCoeff.size();
-   ossim_uint32 nTermsY = (ossim_uint32)theArpYPolCoeff.size();
-   ossim_uint32 nTermsZ = (ossim_uint32)theArpZPolCoeff.size();
-   
-   ossim_float64 x = nTermsX * theArpXPolCoeff[nTermsX-1];
-   for (i=nTermsX-2; i>=1; i--)
-      x = x*time + i*theArpXPolCoeff[i];
-      
-   ossim_float64 y = nTermsY * theArpYPolCoeff[nTermsY-1];
-   for (i=nTermsY-2; i>=1; i--)
-      y = y*time + i*theArpYPolCoeff[i];
-      
-   ossim_float64 z = nTermsZ * theArpZPolCoeff[nTermsZ-1];
-   for (i=nTermsZ-2; i>=1; i--)
-      z = z*time + i*theArpZPolCoeff[i];
-      
-   ossimEcefVector vel(x, y, z);
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpVel:"<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << " time = "<<time<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << " vel  = "<<vel<<endl;
-   }
-   
-   return vel;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getArpTime()
-//  
-//  Return constant ARP time.
-//  
-//*****************************************************************************
-ossim_float64 ossimSarModel::getArpTime() const
-{
-   return theTimeCoeff[0];
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getArpTime()
-//  
-//  Compute ARP time as function of line/sample-dependent polynomial.
-//  Defaults to full 3rd order.
-//    Note: The polynomial degree/coefficients must be
-//    predetermined by the data provider.  Higher order terms
-//    can be zeroed out if necessary.
-//  
-//*****************************************************************************
-ossim_float64 ossimSarModel::getArpTime(const ossimDpt& imgPt) const
-{
-   ossim_float64 s = imgPt.samp;
-   ossim_float64 l = imgPt.line;
-  
-   ossim_float64 s2 = s*s;
-   ossim_float64 s3 = s2*s;
-   ossim_float64 l2 = l*l;
-   ossim_float64 l3 = l2*l;
-      
-   // Evaluate the time polynomial
-   ossim_float64 imgTime = theTimeCoeff[0];
-   imgTime += theTimeCoeff[1]  * l;
-   imgTime += theTimeCoeff[2]  * l2;
-   imgTime += theTimeCoeff[3]  * l3;
-   imgTime += theTimeCoeff[4]  * s;
-   imgTime += theTimeCoeff[5]  * s * l;
-   imgTime += theTimeCoeff[6]  * s * l2;
-   imgTime += theTimeCoeff[7]  * s * l3;
-   imgTime += theTimeCoeff[8]  * s2;
-   imgTime += theTimeCoeff[9]  * s2 * l;
-   imgTime += theTimeCoeff[10] * s2 * l2;
-   imgTime += theTimeCoeff[11] * s2 * l3;
-   imgTime += theTimeCoeff[12] * s3;
-   imgTime += theTimeCoeff[13] * s3 * l;
-   imgTime += theTimeCoeff[14] * s3 * l2;
-   imgTime += theTimeCoeff[15] * s3 * l3;
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpTime:"<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << " imgPt   = "<<imgPt<<endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << " imgTime = "<<imgTime<<endl;
-   }
-      
-
-   return imgTime;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::computeRangeDoppler()
-//  
-//  Compute range/Doppler for given ARP state and ECF point.
-//    Ref[1], eq. 11-37, 11-38
-//  
-//*****************************************************************************
-bool ossimSarModel::computeRangeDoppler(const ossimEcefPoint& pt,
-                                        const ossimEcefPoint& arpPos,
-                                        const ossimEcefVector& arpVel,
-                                        ossim_float64& range,
-                                        ossim_float64& doppler) const
-{
-   // Compute range
-   ossimEcefVector delta = pt - arpPos;
-   range = delta.magnitude();
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG computeRangeDoppler: range vector..." << endl;
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << "delta components: \n"<<delta<<endl;
-   }
-   
-   if (range != 0.0)
-   {
-      // Compute Doppler
-      doppler = arpVel.dot(delta) / range;
-      return true;
-   }
-   
-   return false;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::computeOPfromImage()
-//  
-//  Compute Output Plane coordinates from image coordinates.
-//    Ref[1], eq. 11-32 -> 11-35
-//  
-//*****************************************************************************
-bool ossimSarModel::computeOPfromImage(const ossimDpt& imgPt,
-                                       ossimEcefPoint& opPt) const
-{
-   ossim_float64 dL = imgPt.line - theOrpCenter.line;
-   ossim_float64 dS = imgPt.samp - theOrpCenter.samp;
-      
-   dL *= thePixelSpacing;
-   dS *= thePixelSpacing;
-   
-   opPt = theOPX*dL + theOPY*dS + theOrpPosition;
-   
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::computeImageFromOP()
-//  
-//  Compute image coordinates from Output Plane coordinates.
-//    Ref[1], eq. 11-32 -> 11-35
-//  
-//*****************************************************************************
-bool ossimSarModel::computeImageFromOP(const ossimEcefPoint& opPt, ossimDpt& imgPt) const
-{
-   ossimEcefVector delta(opPt - theOrpPosition);
-   
-   ossim_float64 dL = delta.dot(theOPX) / thePixelSpacing;
-   ossim_float64 dS = delta.dot(theOPY) / thePixelSpacing;
-      
-   imgPt.line = theOrpCenter.line + dL;
-   imgPt.samp = theOrpCenter.samp + dS;
-   
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::projOPtoSurface()
-//  
-//  Project Output Plane coordinates to ellipsoid at reference height.
-//  
-//*****************************************************************************
-bool ossimSarModel::projOPtoSurface(const ossimEcefPoint& opPt,
-                                    const ossim_float64& range,
-                                    const ossim_float64& doppler,
-                                    const ossimEcefPoint& arpPos,
-                                    const ossimEcefVector& arpVel,
-                                    const ossimHgtRef* hgtRef,
-                                    ossimEcefPoint& ellPt) const
-{
-   // Set slopes for tangent plane
-   ossim_float64 sx  = 0.0;
-   ossim_float64 sy  = 0.0;
-   
-   // Set tangent plane normal vector in ENU
-   ossimColumnVector3d tpn(sx, sy, 1.0);
-   ossimColumnVector3d tpnn(-sx, -sy, 1.0);
-
-   // Initialize at OP point
-   ossimEcefPoint rg(opPt);
-   
-   // Matrices
-   NEWMAT::SymmetricMatrix BtB(3);
-   NEWMAT::ColumnVector BtF(3);
-   NEWMAT::ColumnVector F(3);
-   NEWMAT::ColumnVector dR(3);
-   
-   // Initialize criteria
-   F(1)=theOipr;
-   
-   ossim_int32 iter = 0;
-   
-   while ((F(1)>=theOipr || F(2)>=0.0003048 || F(3)>=0.5) && iter<5)
-   {
-      // Compute current latitude/longitude estimate
-      ossimGpt pg(rg);
-
-      // Set reference point @ desired elevation
-      ossim_float64 atHgt = hgtRef->getRefHeight(pg);
-      pg.height(atHgt);
-      ossimEcefPoint rt(pg);
-
-      // Define ENU space at reference point
-      ossimLsrSpace enu(pg);
-
-      // Rotate normal vector to ECF
-      ossimEcefVector st = enu.lsrToEcefRotMatrix()*tpn;
-
-      // Compute current range & Doppler estimate
-      ossim_float64 rngComp;
-      ossim_float64 dopComp;
-      computeRangeDoppler(rg, arpPos, arpVel, rngComp, dopComp);
-      
-      // Compute current height estimate
-      ossim_float64 diffHgt = st.dot(rg-rt);
-
-      // Compute current fr, fd, ft
-      F(1) = rngComp - range;
-      F(2) = dopComp - doppler;
-      F(3) = diffHgt;
-   
-      // Compute fr partials
-      ossimEcefVector delta = rg - arpPos;
-      ossimEcefVector deltaUv = delta.unitVector();
-      ossimEcefVector p_fr = -deltaUv;
-
-      // Compute fd partials
-      ossim_float64 vDotr = arpVel.dot(deltaUv);
-      ossimEcefVector p_fd = (arpVel - deltaUv*vDotr)/rngComp;
-
-      // Compute ft partials
-      ossimColumnVector3d p_ft = enu.lsrToEcefRotMatrix()*tpnn;
-
-      // Form B-matrix
-      NEWMAT::Matrix B = ossimMatrix3x3::create(p_fr[0], p_fr[1], p_fr[2],
-                                                p_fd[0], p_fd[1], p_fd[2],
-                                                p_ft[0], p_ft[1], p_ft[2]);
-
-      // Form coefficient matrix & discrepancy vector
-      BtF << B.t()*F;
-      BtB << B.t()*B;
-
-      // Solve system
-      dR = solveLeastSquares(BtB, BtF);
-
-      // Update estimate
-      for (ossim_int32 k=0; k<3; k++)
-         rg[k] -= dR(k+1);
-      
-      iter++;
-   }
-   
-   // Set intersection for return
-   ellPt = rg;
-
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::projEllipsoidToOP()
-//  
-//  Projects ellipsoid coordinates to Output Plane.
-//  
-//*****************************************************************************
-bool ossimSarModel::projEllipsoidToOP(const ossimEcefPoint& ellPt,
-                                      ossimEcefPoint& opPt) const
-{
-   ossimDpt currentImagePt;
-   ossimEcefPoint selPt;
-   
-   // Initialize at ORP image point
-   currentImagePt = theOrpCenter;
-   
-   ossim_float64 checkTime = 1.0;
-   ossim_float64 lTime=10000.0;
-   ossim_int32 iter = 0;
-   
-   
-   // Iterate on imaging time
-   while (checkTime > 10.0e-6 && iter<5)
-   {
-   
-      // Get current time estimate
-      ossim_float64 cTime = getArpTime(currentImagePt);
-      checkTime = fabs(cTime-lTime)/cTime;
-
-      // Get state vector at current time estimate
-      ossimEcefPoint  arpPos = getArpPos(cTime);
-      ossimEcefVector arpVel = getArpVel(cTime);
-      ossimEcefVector arpVelunit = arpVel.unitVector();
-
-      // Define planes
-      ossim_float64 constOP = theOPZ.dot(
-         ossimEcefVector(theOrpPosition[0],theOrpPosition[1],theOrpPosition[2]));
-      ossim_float64 constRD = arpVelunit.dot(
-         ossimEcefVector(ellPt[0],ellPt[1],ellPt[2]));
-
-      // Compute dot product of normals
-      ossim_float64 ndot = theOPZ.dot(arpVelunit);
-
-      // Compute line of intersection of OP and RD planes
-      ossim_float64 det = 1.0 - ndot*ndot;
-      ossim_float64 c1 = (constOP - ndot*constRD) / det;
-      ossim_float64 c2 = (constRD - ndot*constOP) / det;
-      ossimEcefPoint ori = (theOPZ*c1+arpVelunit*c2)+ossimEcefPoint(0.0,0.0,0.0);
-      ossimEcefVector dir = theOPZ.cross(arpVelunit);
-   
-      // Solve for intersection points (RD circle and OP)
-      ossimEcefVector delta = ori - arpPos;
-      ossim_float64 a2 = dir.length()*dir.length();
-      ossim_float64 a1 = delta.dot(dir);
-      ossimEcefVector rng(ellPt-arpPos);
-      ossim_float64 a0 = delta.length()*delta.length()-rng.length()*rng.length();
-
-      ossim_float64 rootSqr = a1*a1-a0*a2;
-      ossim_float64 root = sqrt(rootSqr);
-      ossimEcefPoint p1 = ori - dir*((a1+root)/a2);
-      ossimEcefPoint p2 = ori - dir*((a1-root)/a2);
-
-      ossimEcefVector p1Delta = p1 - ellPt;
-      ossimEcefVector p2Delta = p2 - ellPt;
-
-      // Pick correct point
-      if (p1Delta.magnitude()<p2Delta.magnitude())
-         selPt = p1;
-      else
-         selPt = p2;
-
-      // Compute OP image coordinates
-      computeImageFromOP(selPt,currentImagePt);
-
-      lTime = cTime;
-      iter++;
-   }
-      
-   opPt = selPt;
-   
-   return true;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::getForwardDeriv()
-//  
-//  Compute partials of range/Doppler WRT to ground.
-//  
-//*****************************************************************************
-ossimDpt ossimSarModel::getForwardDeriv(int derivMode,
-                                        const ossimGpt& pos,
-                                        double h)
-{
-   // If derivMode (parmIdx) >= 0 call base class version
-   // for "adjustable parameters"
-   if (derivMode >= 0)
-   {
-      return ossimSensorModel::getForwardDeriv(derivMode, pos, h);
-   }
-   
-   // Use alternative derivMode definitions
-   else
-   {
-      ossimDpt returnData;
-
-      //******************************************
-      // OBS_INIT mode
-      //    [1] compute r/D corresponding to (s,l)
-      //    [2] compute time, ARP posvel and save 
-      //  Note: In this mode, pos is used to pass
-      //  in the (s,l) observations.
-      //******************************************
-      if (derivMode==OBS_INIT)
-      {
-         // Compute the r/D observations from image coordinates
-         ossimDpt obs;
-         obs.samp = pos.latd();
-         obs.line = pos.lond();
-
-         theObsTime = getArpTime(obs);
-         theObsArpPos = getArpPos(theObsTime);
-         theObsArpVel = getArpVel(theObsTime);
-         theObsArpVel_U = theObsArpVel.unitVector();
-         theObsArpVel_Mag = theObsArpVel.magnitude();
-
-         computeOPfromImage(obs, theObsOP);
-         computeRangeDoppler
-            (theObsOP, theObsArpPos, theObsArpVel, theObsRng, theObsDop);
-         ossimDpt obsRD(theObsRng, theObsDop);
-         theObs = obsRD;
-      }
-
-      //******************************************
-      // EVALUATE mode
-      //   [1] evaluate & save partials, residuals
-      //   [2] return residuals
-      //******************************************
-      else if (derivMode==EVALUATE)
-      {
-
-         // Compute the partials
-         ossimEcefPoint gpos(pos);
-         ossimEcefPoint ellObs = gpos;
-         theObsPosition = gpos;
-
-         // Partials of range WRT ground
-         ossimEcefVector rng = ellObs - theObsArpPos;
-         ossimEcefVector rngU = rng.unitVector();
-
-         // Partials of azimuth WRT ground
-         ossimEcefVector slantPerp = rngU.cross(theObsArpVel);
-         ossimEcefVector rs(theObsArpPos[0],theObsArpPos[1],theObsArpPos[2]);
-         ossim_float64 signPar = (slantPerp.dot(rs)<0.0) ? -1:1;
-         ossimEcefVector slantNormal = slantPerp.unitVector() * signPar;
-         ossimEcefVector azU = slantNormal.unitVector().cross(rngU);
-
-         // Partials of Doppler WRT azimuth
-         ossim_float64 dca = acos(theObsArpVel_U.dot(rngU));
-         signPar = ((theObsArpVel.cross(rng)).dot(slantNormal)<0.0) ? 1:-1;
-         theParDopWRTaz = signPar*sin(dca)*theObsArpVel_Mag/rng.magnitude();
-
-         // Save the partials
-         //  Range
-         theParWRTx.u = rngU.x();
-         theParWRTy.u = rngU.y();
-         theParWRTz.u = rngU.z();
-         //  Doppler
-         theParWRTx.v = azU.x()*theParDopWRTaz;
-         theParWRTy.v = azU.y()*theParDopWRTaz;
-         theParWRTz.v = azU.z()*theParDopWRTaz;
-
-         // Residuals
-         ossim_float64 cRng;
-         ossim_float64 cDop;
-         ossimEcefPoint opPt;
-         projEllipsoidToOP(ellObs, opPt);
-         computeRangeDoppler(opPt, theObsArpPos, theObsArpVel, cRng, cDop);
-         ossimDpt resid(theObsRng-cRng, theObsDop-cDop);
-         returnData = resid;
-      }
-
-      //******************************************
-      // P_WRT_X, P_WRT_Y, P_WRT_Z modes
-      //   [1] 3 separate calls required
-      //   [2] return 3 sets of partials
-      //******************************************
-      else if (derivMode==P_WRT_X)
-      {
-         returnData = theParWRTx;
-      }
-
-      else if (derivMode==P_WRT_Y)
-      {
-         returnData = theParWRTy;
-      }
-
-      else
-      {
-         returnData = theParWRTz;
-      }
-
-      return returnData;
-   }
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSarModel::setAcquisitionMode()
-//  
-//  Set internal acquisition mode parameter.
-//  
-//*****************************************************************************
-void ossimSarModel::setAcquisitionMode(const ossimString& mode)
-{
-   ossimString os = mode;
-   os.downcase();
-   if (os == "scan")
-   {
-      theAcquisitionMode = ossimSarModel::SCAN;
-   }
-   else if (os == "spot")
-   {
-      theAcquisitionMode = ossimSarModel::SPOT;
-   }
-   else
-   {
-      theAcquisitionMode = ossimSarModel::UNKNOWN;
-   }
-}
diff --git a/ossim/src/ossim/projection/ossimSensorModel.cpp b/ossim/src/ossim/projection/ossimSensorModel.cpp
deleted file mode 100644
index 33dd80c..0000000
--- a/ossim/src/ossim/projection/ossimSensorModel.cpp
+++ /dev/null
@@ -1,1783 +0,0 @@
-//*****************************************************************************
-// FILE: ossimSensorModel.cc
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR: Oscar Kramer
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimSensorModel. This is the base
-//   class to all sensor model-related projections including replacement
-//   models such as coarse grids and polynomial models. This base class
-//   supports adjustable parameters for registration adjustment.
-//
-//   Important note to sensor model implementors: In order to avoid a separate
-//   set of "initial adjustable parameters," this design assumes ALL initial
-//   values are 0. When designing the derived-class model, insure that the
-//   adjustable parameters are 0-based. This applies to the adjustable param
-//   array declared in this base class only. The derived classes can declare
-//   their own adjstable params that are more descriptive and that can be
-//   assigned an initial value thet is non-zero, but that are linearly related
-//   to the adjustable params of this class. In that case, the updateModel()
-//   method will compute the derived-class's parameters based on
-//   theAdjustableParams array, after an adjustment is made.
-//
-// LIMITATIONS: None.
-//
-//*****************************************************************************
-//  $Id: ossimSensorModel.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <iostream>
-#include <sstream>
-using namespace std;
-
-// #include <stdio.h>
-
-#include <ossim/projection/ossimSensorModel.h>
-
-RTTI_DEF3(ossimSensorModel, "ossimSensorModel", ossimProjection, ossimOptimizableProjection, ossimAdjustableParameterInterface);
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimDatumFactory.h>
-
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/base/ossimTieGptSet.h>
-
-#include <ossim/matrix/newmatrc.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  ("ossimSensorModel:exec");
-static ossimTrace traceDebug ("ossimSensorModel:debug");
-
-static const char*       REF_GPT_LAT_KW      = "ref_point_lat";
-static const char*       REF_GPT_LON_KW      = "ref_point_lon";
-static const char*       REF_GPT_HGT_KW      = "ref_point_hgt";
-static const char*       REF_IPT_LINE_KW     = "ref_point_line";
-static const char*       REF_IPT_SAMP_KW     = "ref_point_samp";
-static const char*       IMAGE_ID_KW         = "image_id";
-static const char*       SENSOR_ID_KW        = "sensor";
-static const ossimString NULL_STRING         = "NULL";
-static const double      RAY_ORIGIN_HEIGHT   = 10000.0; //meters
-
-
-//DEBUG TBR : output ops
-std::ostream& operator<<(std::ostream& os, NEWMAT::GeneralMatrix& mat)
-{
-   int nr=mat.Nrows();
-   int nc=mat.Ncols();
-
-   NEWMAT::MatrixRow crow(&mat,NEWMAT::LoadOnEntry);
-//   NEWMAT::MatrixRowCol crow;
-   mat.RestoreRow(crow);  
-   for (int r=0;r<nr;++r)
-   {
-      for (int c=0;c<nc;++c)
-      {
-         os<<*(crow.Data()+c)<<" ";
-      }
-      os<<std::endl;
-      mat.NextRow(crow);
-   }
-   return os;
-}
-
-//*****************************************************************************
-//  DEFAULT CONSTRUCTOR: ossimSensorModel()
-//*****************************************************************************
-ossimSensorModel::ossimSensorModel()
-   :
-   ossimOptimizableProjection       (),
-   ossimAdjustableParameterInterface(),
-   theImageSize        (0, 0),
-   theSubImageOffset   (0.0, 0.0),
-   theImageID          (),
-   theSensorID         (),
-   theGSD              (0.0, 0.0),
-   theMeanGSD          (0.0),
-   theRefGndPt         (0.0, 0.0, 0.0),
-   theRefImgPt         (0.0, 0.0),
-   theBoundGndPolygon  (),
-   theImageClipRect    (),
-   theRelPosError      (0.0),
-   theNominalPosError  (0.0),
-   theParWRTx          (0.0, 0.0),
-   theParWRTy          (0.0, 0.0),
-   theParWRTz          (0.0, 0.0),
-   theObs              (0.0, 0.0),
-   theResid            (0.0, 0.0),
-   theExtrapolateImageFlag(false),
-   theExtrapolateGroundFlag(false)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): entering...\n"
-         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): returning..."
-         << std::endl;
-   }
-}
-
-//*****************************************************************************
-//  COPY CONSTRUCTOR: ossimSensorModel(ossimSensorModel)
-//*****************************************************************************
-ossimSensorModel::ossimSensorModel(const ossimSensorModel& model)
-   :
-   ossimOptimizableProjection(model),
-   ossimAdjustableParameterInterface(model),
-   theImageSize       (model.theImageSize),
-   theSubImageOffset  (model.theSubImageOffset),
-   theImageID         (model.theImageID),
-   theSensorID        (model.theSensorID),
-   theGSD             (model.theGSD),
-   theMeanGSD         (model.theMeanGSD),
-   theRefGndPt        (model.theRefGndPt),
-   theRefImgPt        (model.theRefImgPt),
-   theBoundGndPolygon (model.theBoundGndPolygon),
-   theImageClipRect   (model.theImageClipRect),
-   theRelPosError     (model.theRelPosError),
-   theNominalPosError (model.theNominalPosError),
-   theParWRTx         (model.theParWRTx),
-   theParWRTy         (model.theParWRTy),
-   theParWRTz         (model.theParWRTz),
-   theObs             (model.theObs),
-   theResid           (model.theResid),
-   theExtrapolateImageFlag(false),
-   theExtrapolateGroundFlag(false)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimSensorModel::ossimSensorModel(model): entering..." << std::endl;
-   }
-
-   theErrorStatus = model.theErrorStatus;
-   
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimSensorModel::ossimSensorModel(model): returning..." << std::endl;
-   }
-   
-   return;
-}
-
-//*****************************************************************************
-//  CONSTRUCTOR: ossimSensorModel(geom_kwl)
-//  
-//  Constructs from a geometry keywordlist.
-//  
-//*****************************************************************************
-ossimSensorModel::ossimSensorModel(const ossimKeywordlist& geom_kwl)
-   :
-   ossimOptimizableProjection     (),
-   ossimAdjustableParameterInterface(),
-   theImageSize        (0, 0),
-   theSubImageOffset   (0.0, 0.0),
-   theImageID          (),
-   theSensorID         (),
-   theGSD              (0.0, 0.0),
-   theMeanGSD          (0.0),
-   theRefGndPt         (0.0, 0.0, 0.0),
-   theRefImgPt         (0.0, 0.0),
-   theBoundGndPolygon  (),
-   theImageClipRect    (),
-   theRelPosError      (0.0),
-   theNominalPosError  (0.0),
-   theParWRTx          (0.0, 0.0),
-   theParWRTy          (0.0, 0.0),
-   theParWRTz          (0.0, 0.0),
-   theObs              (0.0, 0.0),
-   theResid            (0.0, 0.0),
-   theExtrapolateImageFlag(false),
-   theExtrapolateGroundFlag(false)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): entering..." << std::endl;
-   }
-   
-//   ossimElevManager::instance()->loadState(geom_kwl);
-   loadState(geom_kwl);
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): returning..." << std::endl;
-   }
-}
-
-
-const ossimSensorModel& ossimSensorModel::operator=( const ossimSensorModel& rhs )
-{
-   if (this != &rhs)
-   {
-      // ossimProjection base has no data members.
-      ossimOptimizableProjection::operator=(rhs);
-      ossimAdjustableParameterInterface::operator=(rhs);
-      theImageSize             = rhs.theImageSize;
-      theSubImageOffset        = rhs.theSubImageOffset;
-      theImageID               = rhs.theImageID;
-      theSensorID              = rhs.theSensorID;
-      theGSD                   = rhs.theGSD;
-      theMeanGSD               = rhs.theMeanGSD;
-      theRefGndPt              = rhs.theRefGndPt;
-      theRefImgPt              = rhs.theRefImgPt;
-      theBoundGndPolygon       = rhs.theBoundGndPolygon;
-      theImageClipRect         = rhs.theImageClipRect;
-      theRelPosError           = rhs.theRelPosError;
-      theNominalPosError       = rhs.theNominalPosError;
-      theParWRTx               = rhs.theParWRTx;
-      theParWRTy               = rhs.theParWRTy;
-      theParWRTz               = rhs.theParWRTz;
-      theObs                   = rhs.theObs;
-      theResid                 = rhs.theResid;
-      theExtrapolateImageFlag  = rhs.theExtrapolateImageFlag;
-      theExtrapolateGroundFlag = rhs.theExtrapolateGroundFlag;
-   }
-   return *this;
-}
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimSensorModel
-//  
-//*****************************************************************************
-ossimSensorModel::~ossimSensorModel()
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::~ossimSensorModel: entering..." << std::endl;
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::~ossimSensorModel: returning..." << std::endl;
-}
-
-ossimObject* ossimSensorModel::getBaseObject()
-{
-   return this;
-}
-
-const ossimObject* ossimSensorModel::getBaseObject()const
-{
-   return this;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSensorModel::lineSampleToWorld(image_pt, &gpt)
-//  
-//  Intersects the ray associated with image_pt with the available elevation
-//  model. Returns ground point
-//  
-//*****************************************************************************
-void ossimSensorModel::lineSampleToWorld(const ossimDpt& image_point,
-                                         ossimGpt&       gpt) const
-{
-   bool debug = false;  // setable via interactive debugger
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld:entering..." << std::endl;
-   
-   if(image_point.hasNans())
-   {
-      gpt.makeNan();
-      return;
-   }
-   //***
-   // Extrapolate if image point is outside image:
-   //***
-   if (!insideImage(image_point)&&(!theExtrapolateImageFlag))
-   {
-      gpt = extrapolate(image_point);
-      return;
-   }
-
-   //***
-   // Determine imaging ray and invoke elevation source object's services to
-   // intersect ray with terrain model:
-   //***
-   ossimEcefRay ray;
-   imagingRay(image_point, ray);
-   ossimElevManager::instance()->intersectRay(ray, gpt);
-
-   if (traceDebug() || debug)
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
-      ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
-   }
-
-   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSensorModel::worldToLineSample()
-//  
-//  Performs forward projection of ground point to image space.
-//  
-//*****************************************************************************
-void ossimSensorModel::worldToLineSample(const ossimGpt& worldPoint,
-                                         ossimDpt&       ip) const
-{
-   //   static bool recursionFlag = false;
-
-   static const double PIXEL_THRESHOLD    = .1; // acceptable pixel error
-   static const int    MAX_NUM_ITERATIONS = 20;
-
-
-   if(worldPoint.isLatNan() || worldPoint.isLonNan())
-   {
-      ip.makeNan();
-      return;
-   }
-      
-   //***
-   // First check if the world point is inside bounding rectangle:
-   //***
-   int iters = 0;
-   ossimDpt wdp (worldPoint);
-   //   if ((!recursionFlag)&&!(theBoundGndPolygon.pointWithin(wdp)))
-
-   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
-      (!theBoundGndPolygon.hasNans()))
-   {
-      if (!(theBoundGndPolygon.pointWithin(wdp)))
-      {
-         if(theSeedFunction.valid())
-         {
-            theSeedFunction->worldToLineSample(worldPoint, ip);
-         }
-         else if(!theExtrapolateGroundFlag) // if I am not already in the extrapolation routine
-
-         {
-         //      recursionFlag = true;
-            ip = extrapolate(worldPoint);
-         //      recursionFlag = false;
-         }
-         return;
-      }         
-   }
-
-   //***
-   // Substitute zero for null elevation if present:
-   //***
-   double height = worldPoint.hgt;
-   if ( ossim::isnan(height) )
-   {
-      height = 0.0;
-   }
-
-   //
-   // Utilize iterative scheme for arriving at image point. Begin with guess
-   // at image center:
-   //
-   if(theSeedFunction.valid())
-   {
-      theSeedFunction->worldToLineSample(worldPoint, ip);
-   }
-   else
-   {
-      ip.u = theRefImgPt.u;
-      ip.v = theRefImgPt.v;
-   }
-   
-   ossimDpt ip_du;
-   ossimDpt ip_dv;
-
-   ossimGpt gp, gp_du, gp_dv;
-   double dlat_du, dlat_dv, dlon_du, dlon_dv;
-   double delta_lat, delta_lon, delta_u, delta_v;
-   double inverse_norm;
-   bool done = false;
-   //***
-   // Begin iterations:
-   //***
-   do
-   {
-      //***
-      // establish perturbed image points about the guessed point:
-      //***
-      ip_du.u = ip.u + 1.0;
-      ip_du.v = ip.v;
-      ip_dv.u = ip.u;
-      ip_dv.v = ip.v + 1.0;
-      
-      //***
-      // Compute numerical partials at current guessed point:
-      //***
-      lineSampleHeightToWorld(ip,    height, gp);
-      lineSampleHeightToWorld(ip_du, height, gp_du);
-      lineSampleHeightToWorld(ip_dv, height, gp_dv);
-
-      if(gp.isLatNan() || gp.isLonNan())
-      {
-         gp = extrapolate(ip);
-      }
-      if(gp_du.isLatNan() || gp_du.isLonNan())
-      {
-         gp_du = extrapolate(ip_du);
-      }
-      if(gp_dv.isLatNan() | gp_dv.isLonNan())
-      {
-         gp_dv = extrapolate(ip_dv);
-         
-      }
-      dlat_du = gp_du.lat - gp.lat; //e
-      dlon_du = gp_du.lon - gp.lon; //g
-      dlat_dv = gp_dv.lat - gp.lat; //f
-      dlon_dv = gp_dv.lon - gp.lon; //h
-      
-      //
-      // Test for convergence:
-      //
-      delta_lat = worldPoint.lat - gp.lat;
-      delta_lon = worldPoint.lon - gp.lon;
-
-
-      //
-      // Compute linearized estimate of image point given gp delta:
-      //
-      inverse_norm = dlat_dv*dlon_du - dlat_du*dlon_dv; // fg-eh
-      
-      if (!ossim::almostEqual(inverse_norm, 0.0, DBL_EPSILON))
-      {
-         delta_u = (-dlon_dv*delta_lat + dlat_dv*delta_lon)/inverse_norm;
-         delta_v = ( dlon_du*delta_lat - dlat_du*delta_lon)/inverse_norm;
-         ip.u += delta_u;
-         ip.v += delta_v;
-      }
-      else
-      {
-         delta_u = 0;
-         delta_v = 0;
-      }
-      done = ((fabs(delta_u) < PIXEL_THRESHOLD)&&
-              (fabs(delta_v) < PIXEL_THRESHOLD));
-      iters++;
-   } while ((!done) && (iters < MAX_NUM_ITERATIONS));
-   
-//    } while (((fabs(delta_u) > PIXEL_THRESHOLD) ||
-//              (fabs(delta_v) > PIXEL_THRESHOLD)) &&
-//             (iters < MAX_NUM_ITERATIONS));
-
-#if 0 /* Please leave for debug. */
-   //---
-   // Note that this error mesage appears only if max count was reached while
-   // iterating. A linear (no iteration) solution would finish with iters =
-   // MAX_NUM_ITERATIONS + 1:
-   //---
-   if (iters >= MAX_NUM_ITERATIONS)
-   {
-      std::cout << "MAX ITERATION!!!" << std::endl;
-      std::cout << "delta_u = "   << delta_u
-                << "\ndelta_v = " << delta_v << "\n";
-   }
-   else
-   {
-      std::cout << "ITERS === " << iters << std::endl;
-   }
-   std::cout << "iters = " << iters << "\n";
-#endif
-
-   //***
-   // The image point computed this way corresponds to full image space.
-   // Apply image offset in the case this is a sub-image rectangle:
-   //***
-   ip -= theSubImageOffset;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSensorModel::print(ostream)
-//  
-//  Dumps contents of object to ostream.
-//  
-//*****************************************************************************
-std::ostream& ossimSensorModel::print(std::ostream& out) const
-{
-   out << setprecision(15) << setiosflags(ios::fixed)
-       << "\n ossimSensorModel base-class data members:\n"
-       << "\n         theImageID: " << theImageID
-       << "\n        theSensorID: " << theSensorID
-       << "\n       theImageSize: " << theImageSize
-       << "\n  theSubImageOffset: " << theSubImageOffset
-       << "\n             theGSD: " << theGSD
-       << "\n         theMeanGSD: " << theMeanGSD
-       << "\n        theRefGndPt: " << theRefGndPt
-       << "\n        theRefImgPt: " << theRefImgPt
-       << "\n theBoundGndPolygon: \n" << theBoundGndPolygon
-       << "\n   theImageClipRect: " << theImageClipRect
-       << "\n theNominalPosError: " << theNominalPosError
-       << "\n     theNominalPosError: " << theNominalPosError
-       << "\n     theRelPosError: " << theRelPosError
-       << endl;
-
-   //---
-   // Note:
-   // need ossimAdjustableParameterInterface::print(os);
-   //---
-   return ossimProjection::print(out);
-}
-
-void ossimSensorModel::setRefImgPt(const ossimDpt& pt)
-{
-   theRefImgPt = pt;
-}
-
-void ossimSensorModel::setRefGndPt(const ossimGpt& pt)
-{
-   theRefGndPt = pt;
-}
-
-void ossimSensorModel::setImageRect(const ossimDrect& imageRect)
-{
-   theImageClipRect = imageRect;
-   theRefImgPt = imageRect.midPoint();
-}
-void ossimSensorModel::setGroundRect(const ossimGpt& ul,
-                                     const ossimGpt& ur,
-                                     const ossimGpt& lr,
-                                     const ossimGpt& ll)
-{
-   theBoundGndPolygon.clear();
-   theBoundGndPolygon.addPoint(ul);
-   theBoundGndPolygon.addPoint(ur);
-   theBoundGndPolygon.addPoint(lr);
-   theBoundGndPolygon.addPoint(ll);
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSensorModel::saveState()
-//  
-//  Saves the state of this object to KWL.
-//  
-//*****************************************************************************
-bool ossimSensorModel::saveState(ossimKeywordlist& kwl,
-                                 const char*       prefix) const 
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::saveState: entering..." << std::endl;
-
-   kwl.add(prefix, IMAGE_ID_KW, theImageID.chars());
-   kwl.add(prefix, SENSOR_ID_KW, theSensorID.chars());
-   
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_LINES_KW,
-           theImageSize.line,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_SAMPLES_KW,
-           theImageSize.samp,
-           true);
-   
-   kwl.add(prefix,
-           REF_GPT_LAT_KW,
-           theRefGndPt.lat,
-           true);
-   
-   kwl.add(prefix,
-           REF_GPT_LON_KW,
-           theRefGndPt.lon,
-           true);
-   
-   kwl.add(prefix,
-           REF_GPT_HGT_KW,
-           theRefGndPt.hgt,
-           true);
-   
-   kwl.add(prefix,
-           REF_IPT_LINE_KW,
-           theRefImgPt.line,
-           true);
-      
-   kwl.add(prefix,
-           REF_IPT_SAMP_KW,
-           theRefImgPt.samp,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
-           theGSD.line,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::METERS_PER_PIXEL_X_KW,
-           theGSD.samp,
-           true);
-   
-   ossimDpt corner;
-   if(!theBoundGndPolygon.vertex(0, corner))
-   {
-      corner = ossimDpt(0,0);
-   }
-   
-   kwl.add(prefix,
-           ossimKeywordNames::UL_LAT_KW,
-           corner.lat,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::UL_LON_KW,
-           corner.lon,
-           true);
-   
-   if(!theBoundGndPolygon.nextVertex(corner))
-   {
-      corner = ossimDpt(0,0);
-   }
-   kwl.add(prefix,
-           ossimKeywordNames::UR_LAT_KW,
-           corner.lat,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::UR_LON_KW,
-           corner.lon,
-           true);
-   
-   if(!theBoundGndPolygon.nextVertex(corner))
-   {
-      corner = ossimDpt(0,0);
-   }
-   kwl.add(prefix,
-           ossimKeywordNames::LR_LAT_KW,
-           corner.lat,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::LR_LON_KW,
-           corner.lon,
-           true);
-   
-   
-   if(!theBoundGndPolygon.nextVertex(corner))
-   {
-      corner = ossimDpt(0,0);
-   }
-   kwl.add(prefix,
-           ossimKeywordNames::LL_LAT_KW,
-           corner.lat,
-           true);
-   kwl.add(prefix,
-           ossimKeywordNames::LL_LON_KW,
-           corner.lon,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CE90_ABSOLUTE_KW,
-           theNominalPosError,
-           true, 20);
-
-   kwl.add(prefix,
-           ossimKeywordNames::CE90_RELATIVE_KW,
-           theRelPosError,
-           true, 20);
-
-   kwl.add(prefix,
-           "rect",
-           ossimString::toString(theImageClipRect.ul().x)
-           + " " + ossimString::toString(theImageClipRect.ul().y) + " " +
-           ossimString::toString(theImageClipRect.lr().x) + " " +
-           ossimString::toString(theImageClipRect.lr().y),
-           true);
-
-   // Avoid passing null char* to method that takes an ossimString.
-   ossimString tmpStr;
-   if (prefix)
-   {
-      tmpStr = prefix;
-   }
-   saveAdjustments(kwl, tmpStr);
-      
-   //
-   // Also save the state of the elevation object:
-   //
-//   ossimElevManager::instance()->saveState(kwl, prefix);
-   
-   
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::saveState:returning..." << std::endl;
-   return ossimProjection::saveState(kwl, prefix);;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSensorModel::loadState()
-//  
-//  Loads the state of this object from KWL.
-//  
-//*****************************************************************************
-bool ossimSensorModel::loadState(const ossimKeywordlist& kwl,
-                                 const char*       prefix)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::loadState: entering..." << std::endl;
-
-   const char* keyword;
-   const char* value;
-//   int nconv;
-   ossimDpt v[4]; // temporarily holds vertices for ground polygon
-
-   //***
-   // Read each keyword, breaking out if error occurs:
-   //***
-   keyword = IMAGE_ID_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-      theImageID = value;
-   else
-      theImageID = NULL_STRING;
-   
-   keyword = SENSOR_ID_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-      theSensorID = value;
-   else
-      theSensorID = NULL_STRING;
-      
-   keyword = ossimKeywordNames::NUMBER_LINES_KW;//IMAGE_SIZE_LINES_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      theImageSize.line = ossimString(value).toLong();
-   }
-
-   keyword = ossimKeywordNames::NUMBER_SAMPLES_KW;// IMAGE_SIZE_SAMPS_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      theImageSize.samp = ossimString(value).toLong();
-   }
-
-   keyword = REF_IPT_LINE_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      theRefImgPt.line = ossimString(value).toDouble();
-   }
-
-   keyword = REF_IPT_SAMP_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      theRefImgPt.samp = ossimString(value).toDouble();
-   }
-
-   keyword = REF_GPT_LAT_KW;
-   value = kwl.find(prefix, keyword);
-   if(value)
-   {
-      theRefGndPt.latd(ossimString(value).toDouble());
-   }
-   
-
-   keyword = REF_GPT_LON_KW;
-   value = kwl.find(prefix, keyword);
-   if(value)
-   {
-      theRefGndPt.lond(ossimString(value).toDouble());
-   }
-   
-
-   keyword = REF_GPT_HGT_KW;
-   value = kwl.find(prefix, keyword);
-   if(value)
-   {
-      theRefGndPt.hgt = ossimString(value).toDouble();
-   }
-   
-
-   keyword = ossimKeywordNames::METERS_PER_PIXEL_Y_KW;// GSD_LINE_DIR_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      theGSD.line = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::METERS_PER_PIXEL_X_KW;//GSD_SAMP_DIR_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      theGSD.samp = ossimString(value).toDouble();
-   }
-
-   theMeanGSD = (fabs(theGSD.line) + fabs(theGSD.samp))/2.0;
-
-   keyword = ossimKeywordNames::UL_LAT_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[0].lat = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::UL_LON_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[0].lon = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::UR_LAT_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[1].lat = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::UR_LON_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[1].lon = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::LR_LAT_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[2].lat = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::LR_LON_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[2].lon = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::LL_LAT_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[3].lat = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::LL_LON_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-   {
-      v[3].lon = ossimString(value).toDouble();
-   }
-
-   keyword = ossimKeywordNames::CE90_ABSOLUTE_KW;
-   value = kwl.find(prefix, keyword);
-   if (!value)
-   {
-      // Try old keyword for legacy purposes:
-      keyword = ossimKeywordNames::IMAGE_CE90_KW;
-      value = kwl.find(prefix, keyword);
-   }
-   if (value)
-      theNominalPosError = atof(value);
-   else
-      theNominalPosError = 0.0;
-
-   keyword = ossimKeywordNames::CE90_RELATIVE_KW;
-   value = kwl.find(prefix, keyword);
-   if (value)
-      theRelPosError = atof(value);
-   else
-      theRelPosError = theNominalPosError;
-
-   //***
-   // Initialize other data members given quantities read in KWL:
-   //***
-   theBoundGndPolygon = ossimPolygon(4, v);
-
-   const char* rect = kwl.find(prefix, "rect");
-   if(rect)
-   {
-      std::vector<ossimString> splitArray;
-      ossimString rectString(rect);
-      rectString = rectString.trim();
-      rectString.split(splitArray, " ");
-      if(splitArray.size() == 4)
-      {
-         theImageClipRect = ossimDrect(splitArray[0].toDouble(),
-                                       splitArray[1].toDouble(),
-                                       splitArray[2].toDouble(),
-                                       splitArray[3].toDouble());
-      }
-      else
-      {
-         theImageClipRect = ossimDrect(0.0, 0.0,
-                                       theImageSize.samp-1, theImageSize.line-1);
-      }
-   }
-   else
-   {
-      theImageClipRect = ossimDrect(0.0, 0.0,
-                                    theImageSize.samp-1, theImageSize.line-1);
-   }
-   
-   // Avoid passing null char* to method that takes an ossimString.
-   ossimString tmpStr;
-   if (prefix)
-   {
-      tmpStr = prefix;
-   }
-   loadAdjustments(kwl, tmpStr);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::loadState: returning..." << std::endl;
-   return ossimProjection::loadState(kwl, prefix);;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: Model_type::extrapolate(image_point)
-//
-//  This method computes extrapolated values of latitude and longitude for
-//  points which are outside the actual image boundaries.
-//*****************************************************************************
-ossimGpt ossimSensorModel::extrapolate (const ossimDpt& imagePoint,
-                                        const double&   height) const
-{
-   theExtrapolateImageFlag = true;
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimSensorModel::extrapolate: entering... " << std::endl;
-
-   //---
-   // If image point supplied has NaN components, return now with a NaN point.
-   // This prevents an infinite recursion between model worldToLineSample
-   // and this method:
-   //---
-   if (imagePoint.hasNans())
-   {
-      theExtrapolateImageFlag = false;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
-      return ossimGpt(ossim::nan(), ossim::nan(), ossim::nan());
-   }
-
-   if(theSeedFunction.valid())
-   {
-      ossimGpt wpt;
-
-      theSeedFunction->lineSampleToWorld(imagePoint, wpt);
-      theExtrapolateImageFlag = false;
-      return wpt;
-   }
-   //***
-   // Determine which edge is intersected by the radial, and establish
-   // intersection:
-   //***
-   ossimGpt gpt;
-   ossimDpt edgePt (imagePoint);
-   ossimDpt image_center (theRefImgPt);
-   theImageClipRect.clip(image_center, edgePt);
-
-   //***
-   // Need edgePt relative to image center. Compute an epsilon perturbation in
-   // the direction of edgePt for later computing directional derivative,
-   // and back out the offset to origin:
-   //***
-   ossimDpt deltaPt (edgePt - image_center);
-   ossimDpt epsilon (deltaPt/deltaPt.length());
-   edgePt -= epsilon;  // insure that we are inside the image
-   ossimDpt edgePt_prime (edgePt - epsilon); // epsilon=1pixel
-       
-   //***
-   // Establish ground point corresponding to edge point and edgePt+epsilon:
-   //***
-   ossimGpt edgeGP;
-   ossimGpt edgeGP_prime;
-
-   if (ossim::isnan(height))
-   {
-      lineSampleToWorld(edgePt, edgeGP);
-      lineSampleToWorld(edgePt_prime, edgeGP_prime);
-   }
-   else
-   {
-      lineSampleHeightToWorld(edgePt, height, edgeGP);
-      lineSampleHeightToWorld(edgePt_prime, height, edgeGP_prime);
-   }
-   
-   //***
-   // Compute approximate directional derivatives of lat and lon along radial
-   // at the edge:
-   //***
-   double dpixel    = (edgePt-edgePt_prime).length();
-   double dlat_drad = (edgeGP.lat - edgeGP_prime.lat)/dpixel;
-   double dlon_drad = (edgeGP.lon - edgeGP_prime.lon)/dpixel;
-
-   //***
-   // Now extrapolate to image point of interest:
-   //***
-   double delta_pixel = (imagePoint - edgePt).length();
-
-   gpt.lat = edgeGP.lat + dlat_drad*delta_pixel;
-   gpt.lon = edgeGP.lon + dlon_drad*delta_pixel;
-   if ( ossim::isnan(height) )
-   {
-      gpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
-   }
-   else
-   {
-      gpt.hgt = height;
-   }
-   theExtrapolateImageFlag = false;
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
-   return gpt;
-}
-
-
-//*****************************************************************************
-// PROTECTED METHOD: Model_type::extrapolate(ground_point)
-//
-//  This method computes extrapolated values of line and sample for
-//  points which are outside the actual image boundaries.
-//*****************************************************************************
-ossimDpt ossimSensorModel::extrapolate (const ossimGpt& gpt) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimSensorModel::extrapolate: entering... " << std::endl;
-   theExtrapolateGroundFlag = true;
-   double height = 0.0;
-   //---
-   // If ground point supplied has NaN components, return now with a NaN point.
-   //---
-   if ( (ossim::isnan(gpt.lat)) || (ossim::isnan(gpt.lon)) )
-//       (gpt.hgt==OSSIM_DBL_NAN))
-   {
-      theExtrapolateGroundFlag = false;
-      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
-      return ossimDpt(ossim::nan(), ossim::nan());
-   }
-   if(ossim::isnan(gpt.hgt) == false)
-   {
-      height = gpt.hgt;
-   }
-   
-   if(theSeedFunction.valid())
-   {
-      ossimDpt ipt;
-
-      theSeedFunction->worldToLineSample(gpt, ipt);
-
-      theExtrapolateGroundFlag = false;
-     return ipt;
-   }
-   //***
-   // Determine which edge is intersected by the radial, and establish
-   // intersection:
-   //***
-   ossimDpt edgePt (gpt);
-   ossimDpt image_center (theRefGndPt);
-   theBoundGndPolygon.clipLineSegment(image_center, edgePt);
-
-   //---
-   // Compute an epsilon perturbation in the direction away from edgePt for
-   // later computing directional derivative:
-   //---
-   const double  DEG_PER_MTR =  8.983152841e-06; // Equator WGS-84...
-   double epsilon = theMeanGSD*DEG_PER_MTR; //degrees (latitude) per pixel
-   ossimDpt deltaPt (edgePt-image_center);
-   ossimDpt epsilonPt (deltaPt*epsilon/deltaPt.length());
-   edgePt -= epsilonPt;
-   ossimDpt edgePt_prime (edgePt - epsilonPt);
-       
-   //***
-   // Establish image point corresponding to edge point and edgePt+epsilon:
-   //***
-      ossimGpt edgeGP       (edgePt.lat,       edgePt.lon,       height);//gpt.hgt);
-      ossimGpt edgeGP_prime (edgePt_prime.lat, edgePt_prime.lon, height);//gpt.hgt);
-
-   worldToLineSample(edgeGP, edgePt);
-   worldToLineSample(edgeGP_prime, edgePt_prime);
-
-   //***
-   // Compute approximate directional derivatives of line and sample along
-   // radial at the edge:
-   //***
-   double dsamp_drad = (edgePt.samp - edgePt_prime.samp)/epsilon;
-   double dline_drad = (edgePt.line - edgePt_prime.line)/epsilon;
-
-   //***
-   // Now extrapolate to point of interest:
-   //***
-   double delta = (ossimDpt(gpt) - ossimDpt(edgeGP)).length();
-
-   
-   ossimDpt extrapolated_ip (edgePt.samp + delta*dsamp_drad,
-                             edgePt.line + delta*dline_drad);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
-
-   theExtrapolateGroundFlag = false;
-   return extrapolated_ip;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimSensorModel::imagingRay()
-//  
-//  Default implementation for computing imaging ray from image point.
-//  
-//*****************************************************************************
-void ossimSensorModel::imagingRay(const ossimDpt& image_point,
-                                  ossimEcefRay&   image_ray) const
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::imagingRay: entering..." << std::endl;
-
-   ossimGpt start;
-   ossimGpt end;
-
-   lineSampleHeightToWorld(image_point, RAY_ORIGIN_HEIGHT, start);
-   lineSampleHeightToWorld(image_point, 0.0, end);
-
-   image_ray = ossimEcefRay(start, end);
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::imagingRay: returning..." << std::endl;
-   return;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSensorModel::getObsCovMat()
-//  
-//  Default implementation for forming observation covariance matrix.
-//
-//    Note: At this base class level, the only error source currently
-//          considered is mensuration error.  This is obviously optimistic,
-//          but is included as a placeholder/example, and is presently
-//          the trivial case.
-//  
-//*****************************************************************************
-ossimSensorModel::CovMatStatus ossimSensorModel::getObsCovMat(
-   const ossimDpt& /* ipos */ , NEWMAT::SymmetricMatrix& Cov, const ossim_float64 defPointingSigma)
-{
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Mensuration error contribution
-   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   //  Sensitivity matrix
-   NEWMAT::SymmetricMatrix B(2);
-   B = 0.0;
-   B(1,1) = 1.0;
-   B(2,2) = B(1,1);
-
-   //  Pointing covariance matrix
-   NEWMAT::SymmetricMatrix P(2);
-   P = 0.0;
-   P(1,1) = defPointingSigma*defPointingSigma;
-   P(2,2) = P(1,1);
-
-   //  Propagate
-   NEWMAT::SymmetricMatrix Cm;
-   Cm << B * P * B.t();
-
-   // ~~~~~~~~~~~~~~~~~~~~
-   // Sum total covariance
-   // ~~~~~~~~~~~~~~~~~~~~
-   NEWMAT::SymmetricMatrix Ctot = Cm; //+ other contributors as identified
-
-   // ~~~~~~~~~~~~~~~~~~
-   // Propagate to image
-   // ~~~~~~~~~~~~~~~~~~
-   NEWMAT::SymmetricMatrix Bi(2);
-   Bi = 0.0;
-   Bi(1,1) = 1.0;
-   Bi(2,2) = Bi(1,1);
-
-   Cov << Bi * Ctot * Bi.t();
-
-   return ossimSensorModel::COV_PARTIAL;
-}
-
-void ossimSensorModel::computeGsd()
-{
-   static const char MODULE[] = "ossimSensorModel::computeGsd";
-
-   if (theImageSize.hasNans())
-   {
-      std::string e = MODULE;
-      e += "Error image size has nans!";
-      throw ossimException(e);
-   }
-
-   //---
-   // Compute gsd in the x direction from left to right points across the middle of image.
-   // Compute gsd in the y direction from top to bottom points across the middle of image.
-   //---
-
-   // ossim_float64 midLine = 0.0;
-   // ossim_float64 midSamp = 0.0;
-   // ossim_float64 endLine = 1.0;
-   // ossim_float64 endSamp = 1.0;
-   // if (theImageSize.x > 2)
-   // {
-   //    midSamp = (theImageSize.x-1)/2.0;
-   //    endSamp = theImageSize.x-1;
-         
-   // }
-   // if (theImageSize.y > 2)
-   // {
-   //    midLine = (theImageSize.y-1)/2.0;
-   //    endLine = theImageSize.y-1;
-   // }
-
-   ossimDpt centerImagePoint = theRefImgPt;
-   ossimDpt quarterSize;
-   if(!theImageSize.hasNans())
-   {
-      quarterSize = ossimDpt(theImageSize.x/4.0, theImageSize.y/4.0);
-   }
-   else if(!theImageClipRect.hasNans())
-   {
-      ossim_float32 w = theImageClipRect.width();
-      ossim_float32 h = theImageClipRect.height();
-
-      quarterSize = ossimDpt(w/4.0, h/4.0);
-   }
-   else
-   {
-      quarterSize = ossimDpt(1.0,1.0);      
-   }
-   if(centerImagePoint.hasNans()&&(!theImageSize.hasNans()))
-   {
-      centerImagePoint.x = (theImageSize.x)/2.0;
-      centerImagePoint.y = (theImageSize.y-1.0)/2.0;
-   }
-   else if(centerImagePoint.hasNans()&&!theImageClipRect.hasNans())
-   {
-      centerImagePoint = theImageClipRect.midPoint();
-   }
-   
-   if(!centerImagePoint.hasNans())
-   {
-      ossimDpt leftDpt(centerImagePoint.x-quarterSize.x, centerImagePoint.y);//  (0.0,     midLine);
-      ossimDpt rightDpt(centerImagePoint.x+quarterSize.y, centerImagePoint.y);// (endSamp, midLine);
-      ossimDpt topDpt(centerImagePoint.x, centerImagePoint.y-quarterSize.y);//   (midSamp, 0.0);
-      ossimDpt bottomDpt(centerImagePoint.x, centerImagePoint.y+quarterSize.y);//(midSamp, endLine);
-
-      ossimGpt leftGpt;
-      ossimGpt rightGpt;
-      ossimGpt topGpt;
-      ossimGpt bottomGpt;
-
-      //---
-      // Left point.
-      // For the first point use lineSampleToWorld to get the height.
-      //---
-      lineSampleToWorld(leftDpt, leftGpt);
-      if (leftGpt.hasNans())
-      {
-         std::string e = MODULE;
-         e += "Error leftGpt has nans!";
-         throw ossimException(e);
-      }
-
-      //---
-      // Right point:
-      // Use lineSampleHeightToWorld using the left height since we want the horizontal distance.
-      //---
-      lineSampleHeightToWorld(rightDpt, leftGpt.hgt, rightGpt);
-      if (rightGpt.hasNans())
-      {
-         std::string e = MODULE;
-         e += "Error rightGpt has nans!";
-         throw ossimException(e);
-      }
-
-      //---
-      // Top point:
-      // Use lineSampleHeightToWorld using the left height since we want the horizontal distance.
-      //---
-      lineSampleHeightToWorld(topDpt, leftGpt.hgt, topGpt);
-      if (topGpt.hasNans())
-      {
-         std::string e = MODULE;
-         e += "Error topGpt has nans!";
-         throw ossimException(e);
-      }
-      
-      //---
-      // Bottom point:
-      // Use lineSampleHeightToWorld using the left height since we want the horizontal distance.
-      //---
-      lineSampleHeightToWorld(bottomDpt, leftGpt.hgt, bottomGpt);
-      if (bottomGpt.hasNans())
-      {
-         std::string e = MODULE;
-         e += "Error bottomGpt has nans!";
-         throw ossimException(e);
-      }
-
-#if 0 /* Please leave for debug. (drb) */
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "image size:    " << theImageSize
-         << "\nleftDpt:   " << leftDpt
-         << "\nrightDpt:  " << rightDpt
-         << "\ntopDpt:    " << topDpt
-         << "\nbottomDpt: " << bottomDpt      
-         << "\nleftGpt:   " << leftGpt
-         << "\nrightGpt:  " << rightGpt
-         << "\ntopGpt:    " << topGpt
-         << "\nbottomGpt: " << bottomGpt      
-         << "\n";
-#endif
-         
-      theGSD.x   = leftGpt.distanceTo(rightGpt)/(rightDpt.x-leftDpt.x);
-      theGSD.y   = topGpt.distanceTo(bottomGpt)/(bottomDpt.y-topDpt.y);
-      theMeanGSD = (theGSD.x + theGSD.y)/2.0;
-
-   }
-   else
-   {
-         std::string e = MODULE;
-         e += "Error center has nans!";
-         throw ossimException(e);
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimSensorModel::computGsd DEBUG:"
-         << "\ntheGSD:     " << theGSD
-         << "\ntheMeanGSD: " << theMeanGSD << std::endl;
-   }
-}
-
-//*****************************************************************************
-//  STATIC METHOD: ossimSensorModel::writeGeomTemplate
-//  
-//  Outputs a sample geometry KWL to stream provided.
-//  
-//*****************************************************************************
-void ossimSensorModel::writeGeomTemplate(ostream& os)
-{
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::writeGeomTemplate:entering..." << std::endl;
-   
-   os << "//***\n"
-      << "// Base-class ossimSensorModel Keywords:\n"
-      << "//***\n"
-      << ossimKeywordNames::ID_KW << ":  <string>\n"
-      << SENSOR_ID_KW << ": <string>\n"
-      << ossimKeywordNames::NUMBER_LINES_KW << ": <int>\n"
-      << ossimKeywordNames::NUMBER_SAMPLES_KW << ": <int>\n"
-      << REF_GPT_LAT_KW << ": <decimal degrees>\n"
-      << REF_GPT_LON_KW << ": <decimal degrees>\n"
-      << REF_GPT_HGT_KW << ": <float meters>\n"
-      << REF_IPT_LINE_KW << ": <float>\n"
-      << REF_IPT_SAMP_KW << ": <float>\n"
-      << ossimKeywordNames::METERS_PER_PIXEL_Y_KW << ": <float meters>\n"
-      << ossimKeywordNames::METERS_PER_PIXEL_X_KW << ": <float meters>\n"
-      << ossimKeywordNames::UL_LAT_KW << ": <decimal degrees>\n"
-      << ossimKeywordNames::UL_LON_KW << ": <decimal degrees>\n"
-      << ossimKeywordNames::UR_LAT_KW << ": <decimal degrees>\n"
-      << ossimKeywordNames::UR_LON_KW << ": <decimal degrees>\n"
-      << ossimKeywordNames::LR_LAT_KW << ": <decimal degrees>\n"
-      << ossimKeywordNames::LR_LON_KW << ": <decimal degrees>\n"
-      << ossimKeywordNames::LL_LAT_KW << ": <decimal degrees>\n"
-      << ossimKeywordNames::LL_LON_KW << ": <decimal degrees>\n"
-      << "\n"
-      << "//***\n"
-      << "// Repeat following four entries for each adjustable parameter:\n"
-      << "//***\n"
-//       << PARAM_PREFIX << "N." << PARAM_NAME_KW << ": <string>\n" 
-//       << PARAM_PREFIX << "N." << PARAM_UNITS_KW << ": <string>\n" 
-//       << PARAM_PREFIX << "N." << PARAM_VALUE_KW << ": <float>\n" 
-//       << PARAM_PREFIX << "N." << PARAM_SIGMA_KW << ": <float>\n"
-      << std::endl;
-
-   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::writeGeomTemplate: returning..." << std::endl;
-   return;
-}
-
-ossim_uint32 
-ossimSensorModel::degreesOfFreedom()const
-{
-   ossim_uint32 dof = 0;
-   ossim_uint32 idx = 0;
-   ossim_uint32 numAdj = getNumberOfAdjustableParameters();
-   for(idx = 0; idx < numAdj; ++idx)
-   {
-      if(!isParameterLocked(idx))
-      {
-         ++dof;
-      }
-   }
-   
-   return dof;
-}
-
-double
-ossimSensorModel::optimizeFit(const ossimTieGptSet& tieSet, double* /* targetVariance */)
-{
-   //use a simple Levenberg-Marquardt non-linear optimization
-   //note : please limit the number of tie points
-   //
-   //INPUTS: requires Jacobian matrix (partial derivatives with regards to parameters)
-   //OUPUTS: will also compute parameter covariance matrix
-   //
-   //TBD: use targetVariance!
- 
-   int np = getNumberOfAdjustableParameters();
-   int nobs = tieSet.size();
-
-   //setup initail values
-   int iter=0;
-   int iter_max = 200;
-   double minResidue = 1e-10; //TBC
-   double minDelta = 1e-10; //TBC
-
-   //build Least Squares initial normal equation
-   // don't waste memory, add samples one at a time
-   NEWMAT::SymmetricMatrix A;
-   NEWMAT::ColumnVector residue;
-   NEWMAT::ColumnVector projResidue;
-   double deltap_scale = 1e-4; //step_Scale is 1.0 because we expect parameters to be between -1 and 1
-   buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
-   double ki2=residue.SumSquare();
-
-   //get current adjustment (between -1 and 1 normally) and convert to ColumnVector
-   ossimAdjustmentInfo cadj;
-   getAdjustment(cadj);
-   std::vector< ossimAdjustableParameterInfo >& parmlist = cadj.getParameterList();
-   NEWMAT::ColumnVector cparm(np), nparm(np);
-   for(int n=0;n<np;++n)
-   {
-      cparm(n+1) = parmlist[n].getParameter();
-   }
-
-   double damping_speed = 2.0;
-   //find max diag element for A
-   double maxdiag=0.0;
-   for(int d=1;d<=np;++d) {
-      if (maxdiag < A(d,d)) maxdiag=A(d,d);
-   }
-   double damping = 1e-3 * maxdiag;
-   double olddamping = 0.0;
-   bool found = false;
-
-   //DEBUG TBR
-   // cout<<"rms="<<sqrt(ki2/nobs)<<" ";
-   // cout.flush();
-
-   while ( (!found) && (iter < iter_max) ) //non linear optimization loop
-   {
-      bool decrease = false;
-
-      do
-      {
-         //add damping update to normal matrix
-         for(int d=1;d<=np;++d) A(d,d) += damping - olddamping;
-         olddamping = damping;
-
-         NEWMAT::ColumnVector deltap = solveLeastSquares(A, projResidue);
-
-         if (deltap.NormFrobenius() <= minDelta) 
-         {
-            found = true;
-         } else {
-            //update adjustment
-            nparm = cparm + deltap;
-            for(int n=0;n<np;++n)
-            {
-               setAdjustableParameter(n, nparm(n+1), false); //do not update now, wait
-            }
-            updateModel();
-
-            //check residue is reduced
-            NEWMAT::ColumnVector newresidue = getResidue(tieSet);
-            double newki2=newresidue.SumSquare();
-            double res_reduction = (ki2 - newki2) / (deltap.t()*(deltap*damping + projResidue)).AsScalar();
- //DEBUG TBR
-       cout<<sqrt(newki2/nobs)<<" ";
-       cout.flush();
-
-            if (res_reduction > 0)
-            {
-               //accept new parms
-               cparm = nparm;
-               ki2=newki2;
-
-               deltap_scale = max(1e-15, deltap.NormInfinity()*1e-4);
-
-               buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
-               olddamping = 0.0;
-
-               found = ( projResidue.NormInfinity() <= minResidue );
-               //update damping factor
-               damping *= std::max( 1.0/3.0, 1.0-std::pow((2.0*res_reduction-1.0),3));
-               damping_speed = 2.0;
-               decrease = true;
-            } else {
-               //cancel parameter update
-               for(int n=0;n<np;++n)
-               {
-                  setAdjustableParameter(n, nparm(n+1), false); //do not update right now
-               }
-               updateModel();
-
-               damping *= damping_speed;
-               damping_speed *= 2.0;
-            }
-         }
-      } while (!decrease && !found);
-      ++iter;
-   }
-
-//DEBUG TBR
-cout<<endl;
-
-   //compute parameter correlation
-   // use normal matrix inverse
-   //TBD
-
-   return ki2/nobs;
-}
-
-void
-ossimSensorModel::buildNormalEquation(const ossimTieGptSet& tieSet,
-                                      NEWMAT::SymmetricMatrix& A,
-                                      NEWMAT::ColumnVector& residue,
-                                      NEWMAT::ColumnVector& projResidue,
-                                      double pstep_scale)
-{
-   //goal:       build Least Squares system
-   //constraint: never store full Jacobian matrix in memory (can be huge)
-   //            so we build the matrices incrementally
-   // the system can be built using forward() or inverse() depending on the projection capabilities : useForward()
-   //
-   //TBD : add covariance matrix for each tie point
-
-   //init
-   int np = getNumberOfAdjustableParameters();
-   int dimObs;
-   bool useImageObs = useForward(); //caching
-   if (useImageObs)
-   {
-      dimObs = 2; //image observation
-   } else {
-      dimObs = 3; //ground observations
-   }
-   int no = dimObs * tieSet.size(); //number of observations
-
-   A.ReSize(np);
-   residue.ReSize(no);
-   projResidue.ReSize(np);
-   //Zeroify matrices that will be accumulated
-   A           = 0.0;
-   projResidue = 0.0;
-
-   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
-   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
-   unsigned long c=1;
-
-   if (useImageObs)
-   { 
-     //image observations 
-      std::vector<ossimDpt> imDerp(np);
-     ossimDpt resIm;
-     // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         resIm = (*tit)->tie - forward(*(*tit));
-         residue(c++) = resIm.x;
-         residue(c++) = resIm.y;
-
-         //compute all image derivatives regarding parametres for the tie point position
-         for(int p=0;p<np;++p)
-         {
-            imDerp[p] = getForwardDeriv( p , *(*tit) , pstep_scale);
-         }
-
-         //compute influence of tie point on all sytem elements
-         for(int p1=0;p1<np;++p1)
-         {        
-            //proj residue: J * residue
-            projResidue.element(p1) += imDerp[p1].x * resIm.x + imDerp[p1].y * resIm.y;
-
-            //normal matrix A = transpose(J)*J
-            for(int p2=p1;p2<np;++p2)
-            {
-               A.element(p1,p2) += imDerp[p1].x * imDerp[p2].x + imDerp[p1].y * imDerp[p2].y;
-            }
-         }
-      }
-   }
-   else
-   {
-      // ground observations
-      std::vector<ossimGpt>  gdDerp(np);
-      ossimGpt gd, resGd;
-      // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         gd = inverse((*tit)->tie);
-         residue(c++) = resGd.lon = ((*tit)->lon - gd.lon) * 100000.0;
-         residue(c++) = resGd.lat = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
-         residue(c++) = resGd.hgt = (*tit)->hgt - gd.hgt; //TBD : normalize to meters?
-
-         //compute all image derivatives regarding parametres for the tie point position
-         for(int p=0;p<np;++p)
-         {
-            gdDerp[p] = getInverseDeriv( p , (*tit)->tie, pstep_scale);
-         }
-
-         //compute influence of tie point on all sytem elements
-         for(int p1=0;p1<np;++p1)
-         {        
-            //proj residue: J * residue
-            projResidue.element(p1) += gdDerp[p1].lon * resGd.lon + gdDerp[p1].lat * resGd.lat + gdDerp[p1].hgt * resGd.hgt; //TBC
-
-            //normal matrix A = transpose(J)*J
-            for(int p2=p1;p2<np;++p2)
-            {
-               A.element(p1,p2) += gdDerp[p1].lon * gdDerp[p2].lon + gdDerp[p1].lat * gdDerp[p2].lat + gdDerp[p1].hgt * gdDerp[p2].hgt;
-            }
-         }
-      }
-
-   } //end of if (useImageObs)
-}
-
-//give inverse() partial derivative regarding parameter parmIdx (>=0)
-ossimGpt
-ossimSensorModel::getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta)
-{   
-   double den = 0.5/hdelta;
-   ossimGpt res,gd;
-
-   double middle = getAdjustableParameter(parmIdx);
-   //set parm to high value
-   setAdjustableParameter(parmIdx, middle + hdelta, true);
-   res = inverse(ipos);
-   //set parm to low value and gte difference
-   setAdjustableParameter(parmIdx, middle - hdelta, true);
-   gd = inverse(ipos);
-
-   //reset parm
-   setAdjustableParameter(parmIdx, middle, true);
-
-   res.lon = den*(res.lon - gd.lon) * 100000.0; //TBC : approx meters
-   res.lat = den*(res.lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
-   res.hgt = den*(res.hgt - gd.hgt);
-
-   return res;
-}
-
-//give forward() partial derivative regarding parameter parmIdx (>=0)
-ossimDpt
-ossimSensorModel::getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta)
-{   
-   static double den = 0.5/hdelta;
-   ossimDpt res;
-
-   double middle = getAdjustableParameter(parmIdx);
-   //set parm to high value
-   setAdjustableParameter(parmIdx, middle + hdelta, true);
-   res = inverse(gpos);
-   //set parm to low value and gte difference
-   setAdjustableParameter(parmIdx, middle - hdelta, true);
-   res -= inverse(gpos);
-   //get partial derivative
-   res = res*den;
-
-   //reset parm
-   setAdjustableParameter(parmIdx, middle, true);
-
-   return res;
-}
-
-NEWMAT::ColumnVector
-ossimSensorModel::getResidue(const ossimTieGptSet& tieSet)
-{
-   //init
-   NEWMAT::ColumnVector residue;
-   int dimObs;
-
-   bool useImageObs = useForward(); //caching
-   if (useImageObs)
-   {
-      dimObs = 2; //image observation
-   } else {
-      dimObs = 3; //ground observations
-   }
-   int no = dimObs * tieSet.size(); //number of observations
-
-   residue.ReSize(no);
-
-   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
-   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
-   unsigned long c=1;
-
-   if (useImageObs)
-   { 
-     //image observations 
-     ossimDpt resIm;
-     // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         resIm = (*tit)->tie - forward(**tit);
-         residue(c++) = resIm.x;
-         residue(c++) = resIm.y;
-      }
-   } else {
-      // ground observations
-      ossimGpt gd;
-      // loop on tie points
-      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
-      {
-         //compute residue
-         gd = inverse((*tit)->tie);
-         residue(c++) = ((*tit)->lon - gd.lon) * 100000.0; //approx meters //TBC TBD
-         residue(c++) = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
-         residue(c++) = (*tit)->hgt - gd.hgt; //meters
-      }
-   } //end of if (useImageObs)
-
-   return residue;
-}
-
-/*!
- * solves Ax = r , with A symmetric positive definite
- * A can be rank deficient
- * size of A is typically between 10 and 100 rows
- */
-NEWMAT::ColumnVector 
-ossimSensorModel::solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const
-{
-   NEWMAT::ColumnVector x = invert(A)*r;
-   return x;
-}
-
-/** 
- * stable invert stolen from ossimRpcSolver
- */
-NEWMAT::Matrix 
-ossimSensorModel::invert(const NEWMAT::Matrix& m)const
-{
-   ossim_uint32 idx = 0;
-   NEWMAT::DiagonalMatrix d;
-   NEWMAT::Matrix u;
-   NEWMAT::Matrix v;
-
-   // decompose m.t*m which is stored in Temp into the singular values and vectors.
-   //
-   NEWMAT::SVD(m, d, u, v, true, true);
-   
-   // invert the diagonal
-   // this is just doing the reciprical fo all diagonal components and store back int
-   // d.  ths compute d inverse.
-   //
-   for(idx=0; idx < (ossim_uint32)d.Ncols(); ++idx)
-   {
-      if(d[idx] > 1e-14) //TBC : use DBL_EPSILON ?
-      {
-         d[idx] = 1.0/d[idx];
-      }
-      else
-      {
-         d[idx] = 0.0;
-
-//DEBUG TBR
-cout<<"warning: singular matrix in SVD"<<endl;
-
-      }
-   }
-
-   //compute inverse of decomposed m;
-   return v*d*u.t();
-}
-
diff --git a/ossim/src/ossim/projection/ossimSensorModelFactory.cpp b/ossim/src/ossim/projection/ossimSensorModelFactory.cpp
deleted file mode 100644
index eab4d58..0000000
--- a/ossim/src/ossim/projection/ossimSensorModelFactory.cpp
+++ /dev/null
@@ -1,705 +0,0 @@
-//*****************************************************************************
-// FILE: ossimSensorModelFactory.cc
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// AUTHOR:  Oscar Kramer
-//
-// DESCRIPTION:
-//   Contains implementation of class ossimSensorModelFactory
-//
-//*****************************************************************************
-//  $Id: ossimSensorModelFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <fstream>
-#include <algorithm>
-#include <ossim/projection/ossimSensorModelFactory.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-//***
-// Define Trace flags for use within this file:
-//***
-#include <ossim/base/ossimTrace.h>
-static ossimTrace traceExec  = ossimTrace("ossimSensorModelFactory:exec");
-static ossimTrace traceDebug = ossimTrace("ossimSensorModelFactory:debug");
-
-//***
-// Note to programmer: To add a new model, search this file for "ADD_MODEL"
-// to locate places requiring editing. Functional example below...
-//
-// ADD_MODEL: Include all sensor model headers here:
-//***
-#include <ossim/projection/ossimCoarseGridModel.h>
-#include <ossim/projection/ossimRpcModel.h>
-#include <ossim/projection/ossimRpcProjection.h>
-#include <ossim/projection/ossimIkonosRpcModel.h>
-#include <ossim/projection/ossimNitfRpcModel.h>
-#include <ossim/projection/ossimQuickbirdRpcModel.h>
-#include <ossim/projection/ossimLandSatModel.h>
-#include <ossim/projection/ossimSpot5Model.h>
-#include <ossim/projection/ossimBuckeyeSensor.h>
-#include <ossim/projection/ossimSarModel.h>
-#include <ossim/projection/ossimRS1SarModel.h>
-#include <ossim/support_data/ossimSpotDimapSupportData.h>
-#include <ossim/projection/ossimNitfMapModel.h>
-#include <ossim/projection/ossimFcsiModel.h>
-#include <ossim/projection/ossimApplanixUtmModel.h>
-#include <ossim/projection/ossimApplanixEcefModel.h>
-#include <ossim/projection/ossimSkyBoxLearSensor.h>
-#include <ossim/projection/ossimIpodSensor.h>
-#include <ossim/projection/ossimPpjFrameSensor.h>
-#include <ossim/projection/ossimAlphaSensorHRI.h>
-#include <ossim/projection/ossimAlphaSensorHSI.h>
-#include <ossim/projection/ossimNitfRsmModel.h>
-#include <ossim/support_data/ossimFfL7.h>
-#include <ossim/support_data/ossimFfL5.h>
-#include <ossim/support_data/ossimPpjFrameSensorFile.h>
-#include <ossim/support_data/ossimAlphaSensorSupportData.h>
-
-//***
-// ADD_MODEL: List names of all sensor models produced by this factory:
-//***
-//const char* MY_NEW_MODEL = "myNewModel";
-// const char* OCG_MODEL        = "ossimCoarseGridModel";
-// const char* RPC_MODEL        = "ossimRpcModel";
-// const char* IKONOS_RPC_MODEL = "ossimIkonosRpcModel";
-// const char* NITF_RPC_MODEL   = "ossimNitfRpcModel";
-// const char* LANDSAT_MODEL    = "ossimLandSatModel";
-// const char* NITF_MAP_MODEL   = "ossimNitfMapModel";
-// const char* FCSI_MODEL       = "ossimFcsiModel";
-// const char* EMERGE_FCSI_MODEL= "ossimEmergeFcsiModel";
-
-//*****************************************************************************
-//  STATIC METHOD: ossimSensorModelFactory::instance()
-//*****************************************************************************
-ossimSensorModelFactory*  ossimSensorModelFactory::instance()
-{
-   static ossimSensorModelFactory inst;
-   return &inst;
-}
-
-//*****************************************************************************
-//  METHOD: ossimSensorModelFactory::create(kwl, prefix)
-//*****************************************************************************
-ossimProjection* ossimSensorModelFactory::createProjection(const ossimKeywordlist &keywordList,
-                                                           const char *prefix) const
-{
-   ossimRefPtr<ossimProjection> result;
-
-   //
-   // Permit specification of geometry file name in lieu of type:
-   //
-   const char*  value = keywordList.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
-   if (value)
-   {
-      result = createProjection(ossimFilename(value), 0);
-   }
-   //
-   // Search for occurence of "type" keyword:
-   //
-   else
-   {
-      value = keywordList.find(prefix, ossimKeywordNames::TYPE_KW);
-      if(value)
-      {
-         result = createProjection(ossimString(value));
-         if(result.valid())
-         {
-            if(!result->loadState(keywordList, prefix))
-            {
-               result = 0;
-            }
-        }
-      }
-   }
-   
-   return result.release();
-}
-
-//*****************************************************************************
-//  METHOD: 
-//  
-//*****************************************************************************
-ossimProjection*
-ossimSensorModelFactory::createProjection(const ossimString &name) const
-{
-   //***
-   // Name should represent the model type:
-   //***
-   if(name == STATIC_TYPE_NAME(ossimSkyBoxLearSensor))
-   {
-      return new ossimSkyBoxLearSensor;
-   }
-   if(name == STATIC_TYPE_NAME(ossimIpodSensor))
-   {
-      return new ossimIpodSensor;
-   }
-   if(name == STATIC_TYPE_NAME(ossimCoarseGridModel))
-   {
-      return new ossimCoarseGridModel;
-   }
-   if(name == STATIC_TYPE_NAME(ossimBuckeyeSensor))
-   {
-      return new ossimBuckeyeSensor;
-   }
-   
-   if (name ==  STATIC_TYPE_NAME(ossimRpcModel))
-   {
-      return new ossimRpcModel;
-   }
-
-   if(name == STATIC_TYPE_NAME(ossimLandSatModel))
-   {
-      return new ossimLandSatModel;
-   }
-
-   if(name == STATIC_TYPE_NAME(ossimNitfMapModel))
-   {
-      return new ossimNitfMapModel;
-   }
-
-   if(name == STATIC_TYPE_NAME(ossimQuickbirdRpcModel))
-   {
-      return new ossimQuickbirdRpcModel;
-   }
-   
-   if(name == STATIC_TYPE_NAME(ossimIkonosRpcModel))
-   {
-     return new ossimIkonosRpcModel;
-   }
-
-   if(name == STATIC_TYPE_NAME(ossimNitfRpcModel))
-   {
-      return new ossimNitfRpcModel;
-   }
-   if(name == STATIC_TYPE_NAME(ossimRpcProjection))
-   {
-      return new ossimRpcProjection;
-   }
-   if(name == STATIC_TYPE_NAME(ossimFcsiModel))
-   {
-      return new ossimFcsiModel;
-   }
-   if(name == STATIC_TYPE_NAME(ossimApplanixUtmModel))
-   {
-      return new ossimApplanixUtmModel;
-   }
-   if(name == STATIC_TYPE_NAME(ossimApplanixEcefModel))
-   {
-      return new ossimApplanixEcefModel;
-   }
-   if(name == STATIC_TYPE_NAME(ossimSpot5Model))
-   {
-      return new ossimSpot5Model;
-   }
-   if(name == STATIC_TYPE_NAME(ossimSarModel))
-   {
-      return new ossimSarModel;
-   }
-   if(name == STATIC_TYPE_NAME(ossimRS1SarModel))
-   {
-      return new ossimRS1SarModel;
-   }
-   if(name == STATIC_TYPE_NAME(ossimPpjFrameSensor))
-   {
-      return new ossimPpjFrameSensor;
-   }
-   if(name == STATIC_TYPE_NAME(ossimAlphaSensorHRI))
-   {
-      return new ossimAlphaSensorHRI;
-   }
-   if(name == STATIC_TYPE_NAME(ossimAlphaSensorHSI))
-   {
-      return new ossimAlphaSensorHSI;
-   }
-   if(name == STATIC_TYPE_NAME(ossimNitfRsmModel))
-   {
-      return new ossimNitfRsmModel();
-   }
-
-   //***
-   // ADD_MODEL: (Please leave this comment for the next programmer)
-   //***
-//   if(name == MY_NEW_MODEL)
-//      return new myNewModel;
-
-   return NULL;
-}
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-ossimObject*
-ossimSensorModelFactory::createObject(const ossimString& typeName)const
-{
-   return createProjection(typeName);
-}
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-ossimObject*
-ossimSensorModelFactory::createObject(const ossimKeywordlist& kwl,
-                                      const char* prefix)const
-{
-   return createProjection(kwl, prefix);
-}
-   
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-void
-ossimSensorModelFactory::getTypeNameList(std::vector<ossimString>& typeList)
-   const
-{
-   typeList.push_back(STATIC_TYPE_NAME(ossimApplanixEcefModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimApplanixUtmModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimCoarseGridModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRpcModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimIkonosRpcModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdRpcModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimNitfRpcModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimLandSatModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimNitfMapModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimFcsiModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSpot5Model));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSarModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimRS1SarModel));
-   typeList.push_back(STATIC_TYPE_NAME(ossimBuckeyeSensor));
-   typeList.push_back(STATIC_TYPE_NAME(ossimSkyBoxLearSensor));
-   typeList.push_back(STATIC_TYPE_NAME(ossimIpodSensor));
-   typeList.push_back(STATIC_TYPE_NAME(ossimPpjFrameSensor));
-   typeList.push_back(STATIC_TYPE_NAME(ossimAlphaSensorHRI));
-   typeList.push_back(STATIC_TYPE_NAME(ossimAlphaSensorHSI));
-   typeList.push_back(STATIC_TYPE_NAME(ossimNitfRsmModel));
-   //***
-   // ADD_MODEL: Please leave this comment for the next programmer. Add above.
-   //***
-   //typeList.push_back(ossimString(MY_NEW_MODEL));
-   
-}
-
-ossimProjection* ossimSensorModelFactory::createProjection(
-   const ossimFilename& filename, ossim_uint32  entryIdx) const
-{
-   if(!filename.exists()) return 0;
-   static const char MODULE[] = "ossimSensorModelFactory::createProjection";
-   
-   ossimKeywordlist kwl;
-   ossimRefPtr<ossimProjection> model = 0;
-
-   ossimFilename geomFile = filename;
-   geomFile = geomFile.setExtension("geom");
-   
-   if(geomFile.exists()&&
-      kwl.addFile(filename.c_str()))
-   {
-      ossimFilename coarseGrid;
-      
-      const char* type = kwl.find(ossimKeywordNames::TYPE_KW);
-      if(type)
-      {
-         if(ossimString(type) ==
-            ossimString(STATIC_TYPE_NAME(ossimCoarseGridModel)))
-         {
-            findCoarseGrid(coarseGrid, filename);
-            
-            if(coarseGrid.exists() &&(coarseGrid != ""))
-            {
-               kwl.add("grid_file_name",
-                       coarseGrid.c_str(),
-                       true);
-               model = new ossimCoarseGridModel(kwl);
-               if(!model->getErrorStatus())
-               {
-                  return model.release();
-               }
-               model = 0;
-            }
-         }
-      }
-      kwl.clear();
-   }
-
-   // See if there is an external geomtry.
-   ossimRefPtr<ossimProjection> proj =
-      createProjectionFromGeometryFile(filename, entryIdx);
-   if (proj.valid())
-   {
-      return proj.release();
-   }
-
-   if(model.valid())
-   {
-      model = 0;
-   }
-   
-   // first check for override
-   //
-   if(geomFile.exists()&&kwl.addFile(geomFile.c_str()))
-   {
-      model =  createProjection(kwl);
-      if(model.valid())
-      {
-         return model.release();
-      }
-      model = 0;
-   }
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: Testing ossimCoarsGridModel" << std::endl;
-   }
-   
-   ifstream input(geomFile.c_str());
-   char ecgTest[4];
-   input.read((char*)ecgTest, 3);
-   ecgTest[3] = '\0';
-   input.close();
-   if(ossimString(ecgTest) == "eCG")
-   {
-      ossimKeywordlist kwlTemp;
-      kwlTemp.add("type",
-                  "ossimCoarseGridModel",
-                  true);
-      kwlTemp.add("geom_file",
-                  geomFile.c_str(),
-                  true);
-      return createProjection(kwlTemp);
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: testing ossimRpcModel" << std::endl;
-   }
-
-   //---
-   // Test for quick bird rpc.  Could be either a tiff or nitf so not wrapped
-   // around "isNitf()" anymore.
-   //---
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: testing ossimQuickbirdRpcModel"
-         << std::endl;
-   }
-   
-   ossimRefPtr<ossimQuickbirdRpcModel> qbModel = new ossimQuickbirdRpcModel;
-   if(qbModel->parseFile(filename))
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG: returning ossimQuickbirdRpcModel"
-            << std::endl;
-      }
-      model = qbModel.get();
-      qbModel = 0;
-      return model.release();
-   }
-   else
-   {
-      qbModel = 0;
-   }
-   
-   //---
-   // Test for ikonos rpc.  Could be tiff or nitf which is handled in
-   // parseFile method.
-   //---
-   ossimRefPtr<ossimIkonosRpcModel> ikModel = new ossimIkonosRpcModel;
-   if(ikModel->parseFile(filename))
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG returning ossimQuickbirdRpcModel"
-            << std::endl;
-      }
-      model = ikModel.get();
-      ikModel = 0;
-      return model.release();
-   }
-   else
-   {
-      ikModel = 0;
-   }
-   if(isNitf(filename))
-   {
-     if(traceDebug())
-     {
-        ossimNotify(ossimNotifyLevel_DEBUG)
-           << MODULE << " DEBUG: testing ossimNitfRsmModel" << std::endl;
-     }
-     ossimRefPtr<ossimNitfRsmModel> rsmModel = new ossimNitfRsmModel();
-
-     if(rsmModel->parseFile(filename, entryIdx))
-     {
-         model = rsmModel.get();
-         rsmModel = 0;
-         return model.release();
-     }
-     else
-     {
-         rsmModel = 0;
-     }
-     if(traceDebug())
-     {
-        ossimNotify(ossimNotifyLevel_DEBUG)
-           << MODULE << " DEBUG: testing ossimNitfRsmModel" << std::endl;
-     }
-     ossimRefPtr<ossimNitfRpcModel> rpcModel = new ossimNitfRpcModel();
-     if ( rpcModel->parseFile(filename, entryIdx) ) // filename = NITF_file
-     {
-        model = rpcModel.get();
-        rpcModel = 0;
-        return model.release();
-     }
-     else
-     {
-        rpcModel = 0;
-     }
-     
-     if(traceDebug())
-     {
-        ossimNotify(ossimNotifyLevel_DEBUG)
-           << MODULE << " DEBUG: testing ossimIkinosRpcModel" << std::endl;
-     }
-     
-     model = new ossimNitfMapModel(filename); // filename = NITF_file
-     if(!model->getErrorStatus())
-     {
-        return model.release();
-     }
-     model = 0;
-   }
-   else if(isLandsat(filename))
-   {
-      model = new ossimLandSatModel(filename);
-      if(!model->getErrorStatus())
-      {
-         return model.release();
-      }
-      model = 0;
-   }
-   
-   model = new ossimRS1SarModel(filename);
-   if(model->getErrorStatus()!= ossimErrorCodes::OSSIM_OK)
-   {
-      return model.release();
-   }
-   model = 0;
-
-   // SPOT:
-   ossimFilename spot5Test = geomFile;
-   if(!spot5Test.exists())
-   {
-      spot5Test = geomFile.path();
-      spot5Test = spot5Test.dirCat(ossimFilename("METADATA.DIM"));
-      if (spot5Test.exists() == false)
-      {
-         spot5Test = geomFile.path();
-         spot5Test = spot5Test.dirCat(ossimFilename("metadata.dim"));
-      }
-   }
-   if(spot5Test.exists())
-   {
-      //---
-      // Check the basename of the input file. So we don't create a projection
-      // for ancillary files, icon.jpg amd preview.jpg.
-      //---
-      ossimFilename baseName = filename.file();
-      baseName.downcase();
-
-      if ( (baseName != "icon.jpg" ) && ( baseName != "preview.jpg" ) )
-      {
-         ossimRefPtr<ossimSpotDimapSupportData> meta =
-            new ossimSpotDimapSupportData;
-         if(meta->loadXmlFile(spot5Test))
-         {
-            model = new ossimSpot5Model(meta.get());
-            if(!model->getErrorStatus())
-            {
-               return model.release();
-            }
-         }
-      }
-   }
-   model = 0;
-            
-   ossimFilename ppjFilename = filename;
-   ppjFilename = ppjFilename.setExtension("ppj");
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: testing ossimPpjFrameSensor" << std::endl;
-   }
-   if(ppjFilename.exists())
-   {
-      ossimRefPtr<ossimPpjFrameSensorFile> ppjFile = new ossimPpjFrameSensorFile();
-
-      if(ppjFile->readFile(ppjFilename))
-      {
-         ossimRefPtr<ossimPpjFrameSensor> sensor = new ossimPpjFrameSensor();
-         ossimDpt imageSize = ppjFile->getImageSize();
-         sensor->setFocalLength(ppjFile->getIntrinsic()[0][0], ppjFile->getIntrinsic()[1][1]);
-         sensor->setPrincipalPoint(ppjFile->getPrincipalPoint());
-         sensor->setecef2CamMatrix(ppjFile->getExtrinsic().SymSubMatrix(1,3));
-         sensor->setCameraPosition(ppjFile->getPlatformPosition());
-         sensor->setImageSize(imageSize);
-         sensor->setImageRect(ossimDrect(0,0,imageSize.x-1, imageSize.y-1));
-         sensor->setRefImgPt(ossimDpt(imageSize.x*.5, imageSize.y*.5));
-         sensor->setAveragePrjectedHeight(ppjFile->getAverageProjectedHeight());
-         sensor->updateModel();
-         return sensor.release();         
-      }
-      ppjFile = 0;
-   }
-   
-   ossimFilename hdrFilename = filename;
-   hdrFilename = hdrFilename.setExtension("hdr"); // image.hdr
-   if ( !hdrFilename.exists() )   
-   {     
-      hdrFilename = filename;
-      hdrFilename.string() += ".hdr"; // image.ras.hdr
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: testing ossimAlphaSensor\nheader file: " << hdrFilename << std::endl;
-   }
-   if(hdrFilename.exists())
-   {
-      ossimRefPtr<ossimAlphaSensorSupportData> supData = new ossimAlphaSensorSupportData();
-      if(supData->readSupportFiles(hdrFilename))
-      {
-         if (supData->isHSI())
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << MODULE << " DEBUG: loading ossimAlphaSensorHSI" << std::endl;
-            }
-            ossimRefPtr<ossimAlphaSensorHSI> sensor = new ossimAlphaSensorHSI();
-            if ( sensor->initialize( *(supData.get()) ) )
-            {
-               return (ossimProjection*)sensor.release();
-            }
-         }
-         else
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << MODULE << " DEBUG: loading ossimAlphaSensorHRI" << std::endl;
-            }
-            ossimRefPtr<ossimAlphaSensorHRI> sensor = new ossimAlphaSensorHRI();
-            if ( sensor->initialize( *(supData.get()) ) )
-            {
-               return (ossimProjection*)sensor.release();
-            }
-         }
-      }
-      supData = 0;
-   }
-
-   model = new ossimCoarseGridModel(geomFile);
-   if(model.valid())
-   {
-      if(!model->getErrorStatus())
-      {
-         return model.release();
-      }
-      model = 0;
-   }
-
-   return model.release();
-}
-   
-bool ossimSensorModelFactory::isNitf(const ossimFilename& filename)const
-{
-   std::ifstream in(filename.c_str(), ios::in|ios::binary);
-   
-   if(in)
-   {
-      char nitfFile[4];
-      in.read((char*)nitfFile, 4);
-
-      return (ossimString(nitfFile,
-                          nitfFile+4) == "NITF");
-   }
-
-   return false;
-}
-
-bool ossimSensorModelFactory::isLandsat(const ossimFilename& filename)const
-{
-   ossimFilename temp(filename);
-   temp.downcase();
-   ossimRefPtr<ossimFfL7> ff_headerp;
-   if (temp.contains("header.dat"))
-   {
-       ff_headerp = new ossimFfL5(filename);
-   } 
-   else 
-   {
-       ff_headerp = new ossimFfL7(filename);
-   }
-   bool r = !(ff_headerp->getErrorStatus());
-   ff_headerp = 0;
-   return r;
-}
-
-void ossimSensorModelFactory::findCoarseGrid(ossimFilename& result,
-                                             const ossimFilename& geomFile)const
-{
-   result = geomFile;
-   result.setFile(result.fileNoExtension()+"_ocg");
-   result.setExtension("dat");
-   
-   if(!result.exists())
-   {
-      result = geomFile;
-      result.setExtension("dat");
-   }
-   
-   // let's find a .dat file in the current directory
-   //
-   if(!result.exists())
-   {
-      result = "";
-      ossimDirectory directoryList(geomFile.path());
-      ossimFilename file;
-      if(directoryList.getFirst(file,
-                                ossimDirectory::OSSIM_DIR_FILES))
-      {
-         ossimString testString = "OSSIM_DBL_GRID";
-         char tempBuf[14];
-         do
-         {
-            if(file.ext().downcase() == "dat")
-            {
-               std::ifstream in(file.c_str());
-               if(in)
-               {
-                  in.read((char*)tempBuf, 14);
-                  in.close();
-                  if(ossimString(tempBuf, tempBuf+14) == testString)
-                  {
-                     result = file;
-                  }
-               }
-               
-            }
-         }while((directoryList.getNext(file))&&(result == ""));
-      }
-      // try to find it
-   }
-}
-
-
diff --git a/ossim/src/ossim/projection/ossimSinusoidalProjection.cpp b/ossim/src/ossim/projection/ossimSinusoidalProjection.cpp
deleted file mode 100644
index e2efb4b..0000000
--- a/ossim/src/ossim/projection/ossimSinusoidalProjection.cpp
+++ /dev/null
@@ -1,450 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Sinusoidal projection code.  
-//*******************************************************************
-//  $Id: ossimSinusoidalProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-
-#include <math.h>
-#include <ossim/projection/ossimSinusoidalProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimSinusoidalProjection, "ossimSinusoidalProjection", ossimMapProjection)
-/***************************************************************************/
-/*
- *                              DEFINES
- */
-
-#define SINU_NO_ERROR           0x0000
-#define SINU_LAT_ERROR          0x0001
-#define SINU_LON_ERROR          0x0002
-#define SINU_EASTING_ERROR      0x0004
-#define SINU_NORTHING_ERROR     0x0008
-#define SINU_CENT_MER_ERROR     0x0020
-#define SINU_A_ERROR            0x0040
-#define SINU_B_ERROR            0x0080
-#define SINU_A_LESS_B_ERROR     0x0100
-
-#ifndef PI_OVER_2
-#  define PI_OVER_2  ( M_PI / 2.0)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI     (2.0 * M_PI)
-#endif
-
-#define SINU_COEFF_TIMES_SIN(coeff, x, latit)      (coeff * sin(x * latit))
-#define FLOAT_EQ(x,v,epsilon)   (((v - epsilon) < x) && (x < (v + epsilon)))
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS     
- */
-
-ossimSinusoidalProjection::ossimSinusoidalProjection(const ossimEllipsoid& ellipsoid,
-                                                     const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-
-ossimSinusoidalProjection::ossimSinusoidalProjection(const ossimEllipsoid& ellipsoid,
-                                                     const ossimGpt& origin,
-                                                     double falseEasting,
-                                                     double falseNorthing)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   Sinu_False_Easting  = falseEasting;
-   Sinu_False_Northing = falseNorthing;
-   Sinu_Max_Easting    = 20037509.0;
-   Sinu_Min_Easting    = -20037509.0;
-   Sinu_Delta_Northing = 10001966.0;
-
-   update();
-}
-
-void ossimSinusoidalProjection::update()
-{   
-   Set_Sinusoidal_Parameters(theEllipsoid.getA(),
-                             theEllipsoid.getFlattening(),
-                             theOrigin.lonr(),
-                             Sinu_False_Easting,
-                             Sinu_False_Northing);
-
-   theFalseEastingNorthing.x = Sinu_False_Easting;
-   theFalseEastingNorthing.y = Sinu_False_Northing;
- 
-   ossimMapProjection::update();
-}
-
-void ossimSinusoidalProjection::setFalseEasting(double falseEasting)
-{
-   Sinu_False_Easting = falseEasting;
-   
-   update();
-}
-
-void ossimSinusoidalProjection::setFalseNorthing(double falseNorthing)
-{
-   Sinu_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimSinusoidalProjection::setDefaults()
-{
-   Sinu_Max_Easting    = 20037509.0;
-   Sinu_Min_Easting    = -20037509.0;
-   Sinu_Delta_Northing = 10001966.0;
-   Sinu_False_Easting  = 0.0;
-   Sinu_False_Northing = 0.0;
-}
-
-void ossimSinusoidalProjection::setCentralMeridian(double centralMeridian)
-{
-  Sinu_Origin_Long = centralMeridian;
-  update();
-}
-
-void ossimSinusoidalProjection::setFalseEastingNorthing(double falseEasting,
-                                                        double falseNorthing)
-{
-   Sinu_False_Easting  = falseEasting;
-   Sinu_False_Northing = falseNorthing;
-   
-   update();
-}
-
-ossimGpt ossimSinusoidalProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_Sinusoidal_To_Geodetic(eastingNorthing.x,
-                                  eastingNorthing.y,
-                                  &lat,
-                                  &lon);   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
-}
-
-ossimDpt ossimSinusoidalProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Sinusoidal(gpt.latr(),
-                                  gpt.lonr(),
-                                  &easting,
-                                  &northing);   
-   return ossimDpt(easting, northing);
-}
-
-bool ossimSinusoidalProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimSinusoidalProjection::loadState(const ossimKeywordlist& kwl,
-                                          const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   
-   setDefaults();
-
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimSinusoidalProjection))
-   {
-      Sinu_False_Easting  = theFalseEastingNorthing.x;
-      Sinu_False_Northing = theFalseEastingNorthing.y;
-   }
-   
-   update();
-
-   return flag;
-}
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS     
- */
-
-
-long ossimSinusoidalProjection::Set_Sinusoidal_Parameters(double a,
-                                                          double f,
-                                                          double Central_Meridian,
-                                                          double False_Easting,
-                                                          double False_Northing)
-{ /* BEGIN Set_Sinusoidal_Parameters */
-/*
- * The function Set_Sinusoidal_Parameters receives the ellipsoid parameters and
- * Sinusoidal projection parameters as inputs, and sets the corresponding state
- * variables.  If any errors occur, the error code(s) are returned by the function, 
- * otherwise SINU_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid						        (input)
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (input)
- */
-
-  double j;
-  double One_MINUS_es2, Sqrt_One_MINUS_es2, e1, e2, e3, e4;
-//  double inv_f = 1 / f;
-  long Error_Code = SINU_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= SINU_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= SINU_INV_F_ERROR;
-//   }
-//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= SINU_CENT_MER_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    Sinu_a = a;
-    Sinu_f = f;
-    es2 = 2 * Sinu_f - Sinu_f * Sinu_f;
-    es4 = es2 * es2;
-    es6 = es4 * es2;
-    j = 45.0 * es6 / 1024.0;
-    c0 = 1.0 - es2 / 4.0 - 3.0 * es4 / 64.0 - 5.0 * es6 / 256.0;
-    c1 = 3.0 * es2 / 8.0 + 3.0 * es4 / 32.0 + j;
-    c2 = 15.0 * es4 / 256.0 + j;
-    c3 = 35.0 * es6 / 3072.0;
-    One_MINUS_es2 = 1.0 - es2;
-    Sqrt_One_MINUS_es2 = sqrt(One_MINUS_es2);
-    e1 = (1.0 - Sqrt_One_MINUS_es2) / (1.0 + Sqrt_One_MINUS_es2);
-    e2 = e1 * e1;
-    e3 = e2 * e1;
-    e4 = e3 * e1;
-    a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0 ;
-    a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
-    a2 = 151.0 * e3 / 96.0;
-    a3 = 1097.0 * e4 / 512.0;
-//     if (Central_Meridian > M_PI)
-//       Central_Meridian -= TWO_PI;
-    Sinu_Origin_Long = Central_Meridian;
-    Sinu_False_Northing = False_Northing;
-    Sinu_False_Easting = False_Easting;
-
-    if (Sinu_Origin_Long > 0)
-    {
-      Sinu_Max_Easting = 19926189.0;
-      Sinu_Min_Easting = -20037509.0;
-    }
-    else if (Sinu_Origin_Long < 0)
-    {
-      Sinu_Max_Easting = 20037509.0;
-      Sinu_Min_Easting = -19926189.0;
-    }
-    else
-    {
-      Sinu_Max_Easting = 20037509.0;
-      Sinu_Min_Easting = -20037509.0;
-    }
-  } /* END OF if(!Error_Code) */
-  return (Error_Code);
-} /* END OF Set_Sinusoidal_Parameters */
-
-void ossimSinusoidalProjection::Get_Sinusoidal_Parameters(double *a,
-                                                          double *f,
-                                                          double *Central_Meridian,
-                                                          double *False_Easting,
-                                                          double *False_Northing)const
-{ /* BEGIN Get_Sinusoidal_Parameters */
-/*
- * The function Get_Sinusoidal_Parameters returns the current ellipsoid
- * parameters, and Sinusoidal projection parameters.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid						        (output)
- *    Central_Meridian  : Longitude in radians at the center of     (output)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (output)
- */
-
-  *a = Sinu_a;
-  *f = Sinu_f;
-  *Central_Meridian = Sinu_Origin_Long;
-  *False_Easting = Sinu_False_Easting;
-  *False_Northing = Sinu_False_Northing;
-  
-  return;
-} /* END OF Get_Sinusoidal_Parameters */
-
-
-long ossimSinusoidalProjection::Convert_Geodetic_To_Sinusoidal (double Latitude,
-                                                                double Longitude,
-                                                                double *Easting,
-                                                                double *Northing)const
-{ /* BEGIN Convert_Geodetic_To_Sinusoidal */
-/*
- * The function Convert_Geodetic_To_Sinusoidal converts geodetic (latitude and
- * longitude) coordinates to Sinusoidal projection (easting and northing)
- * coordinates, according to the current ellipsoid and Sinusoidal projection
- * parameters.  If any errors occur, the error code(s) are returned by the
- * function, otherwise SINU_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double slat = sin(Latitude);
-  double sin2lat, sin4lat, sin6lat;
-  double dlam;                      /* Longitude - Central Meridan */
-  double mm;
-  double MM;
-  long Error_Code = SINU_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   { /* Latitude out of range */
-//     Error_Code |= SINU_LAT_ERROR;
-//   }
-//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
-//   { /* Longitude out of range */
-//     Error_Code |= SINU_LON_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    dlam = Longitude - Sinu_Origin_Long;
-//     if (dlam > M_PI)
-//     {
-//       dlam -= TWO_PI;
-//     }
-//     if (dlam < -M_PI)
-//     {
-//       dlam += TWO_PI;
-//     }
-    mm = sqrt(1.0 - es2 * slat * slat);
-
-    sin2lat = SINU_COEFF_TIMES_SIN(c1, 2.0, Latitude);
-    sin4lat = SINU_COEFF_TIMES_SIN(c2, 4.0, Latitude);
-    sin6lat = SINU_COEFF_TIMES_SIN(c3, 6.0, Latitude);
-    MM = Sinu_a * (c0 * Latitude - sin2lat + sin4lat - sin6lat);
-
-    *Easting = Sinu_a * dlam * cos(Latitude) / mm + Sinu_False_Easting;
-    *Northing = MM + Sinu_False_Northing;
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Sinusoidal */
-
-
-long ossimSinusoidalProjection::Convert_Sinusoidal_To_Geodetic(double Easting,
-                                                               double Northing,
-                                                               double *Latitude,
-                                                               double *Longitude)const
-{ /* BEGIN Convert_Sinusoidal_To_Geodetic */
-/*
- * The function Convert_Sinusoidal_To_Geodetic converts Sinusoidal projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid and Sinusoidal projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise SINU_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
-  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
-  double mu;
-  double sin2mu, sin4mu, sin6mu, sin8mu;
-  double sin_lat;
-  long Error_Code = SINU_NO_ERROR;
-
-//   if ((Easting < (Sinu_False_Easting + Sinu_Min_Easting))
-//       || (Easting > (Sinu_False_Easting + Sinu_Max_Easting)))
-//   { /* Easting out of range */
-//     Error_Code |= SINU_EASTING_ERROR;
-//   }
-//   if ((Northing < (Sinu_False_Northing - Sinu_Delta_Northing))
-//       || (Northing > (Sinu_False_Northing + Sinu_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= SINU_NORTHING_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    dy = Northing - Sinu_False_Northing;
-    dx = Easting - Sinu_False_Easting;
-
-    mu = dy / (Sinu_a * c0);
-    sin2mu = SINU_COEFF_TIMES_SIN(a0, 2.0, mu);
-    sin4mu = SINU_COEFF_TIMES_SIN(a1, 4.0, mu);
-    sin6mu = SINU_COEFF_TIMES_SIN(a2, 6.0, mu);
-    sin8mu = SINU_COEFF_TIMES_SIN(a3, 8.0, mu);
-    *Latitude = mu + sin2mu + sin4mu + sin6mu + sin8mu;
-
-    if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-      *Latitude = PI_OVER_2;
-    else if (*Latitude < -PI_OVER_2)
-      *Latitude = -PI_OVER_2;
-
-    if (FLOAT_EQ(fabs(*Latitude),PI_OVER_2,1.0e-8))
-      *Longitude = Sinu_Origin_Long;
-    else
-    {
-      sin_lat = sin(*Latitude);
-      *Longitude = Sinu_Origin_Long + dx * sqrt(1.0 - es2 *
-                                                sin_lat * sin_lat) / (Sinu_a * cos(*Latitude));
-
-
-//       if (*Longitude > M_PI)
-//         *Longitude -= TWO_PI;
-//       if (*Longitude < -M_PI)
-//         *Longitude += TWO_PI;
-
-//       if (*Longitude > M_PI)  /* force distorted values to 180, -180 degrees */
-//         *Longitude = M_PI;
-//       else if (*Longitude < -M_PI)
-//         *Longitude = -M_PI;
-    }
-  }
-  return (Error_Code);
-} /* END OF Convert_Sinusoidal_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimSinusoidalProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimSinusoidalProjection* p = PTR_CAST(ossimSinusoidalProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(Sinu_Origin_Long,p->Sinu_Origin_Long)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimSpaceObliqueMercatorProjection.cpp b/ossim/src/ossim/projection/ossimSpaceObliqueMercatorProjection.cpp
deleted file mode 100644
index bd4ad82..0000000
--- a/ossim/src/ossim/projection/ossimSpaceObliqueMercatorProjection.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimSpaceObliqueMercatorProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-#include <ossim/projection/ossimSpaceObliqueMercatorProjection.h>
-#include <math.h>
-#include <ossim/base/ossimConstants.h>
-
-#define PI_OVER_2 (M_PI/2)
-#define PI (M_PI)
-#define TWOPI (2*M_PI)
-#define HALFPI (M_PI/2.0)
-#define TOL 1e-7
-#define PI_HALFPI 4.71238898038468985766
-#define TWOPI_HALFPI 7.85398163397448309610
-#define ONE_TOL	 1.00000000000001
-#define ATOL 1e-50
-#define FORTPI		0.78539816339744833
-
-double aasin(double v)
-{
-   double av;
-
-   if ((av = fabs(v)) >= 1.)
-   {
-      return (v < 0. ? -HALFPI : HALFPI);
-   }
-   return asin(v);
-}
-double aacos(double v)
-{
-	double av;
-
-	if ((av = fabs(v)) >= 1.)
-        {
-           return (v < 0. ? PI : 0.);
-	}
-	return acos(v);
-}
-double asqrt(double v)
-{
-   return ((v <= 0) ? 0. : sqrt(v));
-}
-double aatan2(double n, double d)
-{
-   return ((fabs(n) < ATOL && fabs(d) < ATOL) ? 0. : atan2(n,d));
-}
-
-static const char* PATH_KW                     = "path";
-static const char* SATELLITE_TYPE_KW           = "satellite_type";
-
-#if 0
-static const char* ANGLE_OF_INCLINATION_KW     = "angle_of_inclination";
-static const char* REVOLUTION_TIME_KW          = "earth_rev_time";
-static const char* EARTH_ROTATION_LENGTH_KW    = "earth_rot_length";
-static const char* LONGITUDE_ASCENDING_NODE_KW = "lon_ascending_node";
-static const char* J_COEFFICIENT_KW  = "j_coeff";
-static const char* W_COEFFICIENT_KW  = "w_coeff";
-static const char* Q_COEFFICIENT_KW  = "q_coeff";
-static const char* T_COEFFICIENT_KW  = "t_coeff";
-static const char* A2_COEFFICIENT_KW = "a2_coeff";
-static const char* A4_COEFFICIENT_KW = "a4_coeff";
-static const char* B_COEFFICIENT_KW  = "b_coeff";
-static const char* C1_COEFFICIENT_KW = "c1_coeff";
-static const char* C3_COEFFICIENT_KW = "c3_coeff";
-static const char* ECCENTRICITY_KW   = "eccentricity";
-#endif
-
-RTTI_DEF1(ossimSpaceObliqueMercatorProjection, "ossimSpaceObliqueMercatorProjection", ossimMapProjection);
-
-
-//*****************************************************************************
-//  CONSTRUCTOR
-//*****************************************************************************
-ossimSpaceObliqueMercatorProjection::ossimSpaceObliqueMercatorProjection
-   (ossimSatelliteType type,
-    double pathNumber,
-    const ossimEllipsoid& ellipsoid)
-      :
-      ossimMapProjection(ellipsoid)
-{
-   setParameters(type, pathNumber);
-}
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-void ossimSpaceObliqueMercatorProjection::setParameters(ossimSatelliteType type,
-                                                        double path)
-{
-   thePath = path;
-   theSatelliteType = type;
-   double lam = 0.0;
-   double alf = 0.0;
-   double esc = 0.0;
-   double ess = 0.0;
-   
-   e  = theEllipsoid.eccentricity();
-   es = e*e;
-   one_es = 1- es;
-   rone_es = 1.0/one_es;
-   a   = theEllipsoid.a();
-   
-   switch(theSatelliteType)
-   {
-   case SOM_TYPE_LANDSAT_1:
-   case SOM_TYPE_LANDSAT_2:
-   case SOM_TYPE_LANDSAT_3:
-   {
-      lam0 = RAD_PER_DEG*(128.87 - (360.0/251.0)*path);
-      p22 = 103.2669323;
-      alf = RAD_PER_DEG * 99.092;
-      break;
-   }
-   case SOM_TYPE_LANDSAT_4:
-   case SOM_TYPE_LANDSAT_5:
-   case SOM_TYPE_LANDSAT_7:
-   {
-      
-      lam0 = RAD_PER_DEG*(129.305582487 - (360.0/233.0)*path);
-      p22 = 98.8841202;
-      alf = RAD_PER_DEG * 98.2;
-      break;
-   }
-   }
-   p22 /= 1440.;
-   sa = sin(alf);
-   ca = cos(alf);
-   if (fabs(ca) < 1e-9)
-      ca = 1e-9;
-   esc = es * ca * ca;
-   ess = es * sa * sa;
-   w = (1. - esc) * rone_es;
-   w = w * w - 1.;
-   q = ess * rone_es;
-   t = ess * (2. - es) * rone_es * rone_es;
-   u = esc * rone_es;
-   xj = one_es * one_es * one_es;
-   rlm = PI * (1. / 248. + .5161290322580645);
-   rlm2 = rlm + TWOPI;
-   a2 = a4 = b = c1 = c3 = 0.;
-   seraz0(0.0, 1.0);
-   for (lam = 9.; lam <= 81.0001; lam += 18.)
-      seraz0(lam, 4.0);
-   for (lam = 18; lam <= 72.0001; lam += 18.)
-      seraz0(lam, 2.0);
-   seraz0(90.0, 1.0);
-   a2 /= 30.0;
-   a4 /= 60.0;
-   b /= 30.0;
-   c1 /= 15.0;
-   c3 /= 45.0;
-
-   update();
-}
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-void ossimSpaceObliqueMercatorProjection::seraz0(double lam,
-                                                 double mult)
-{
-    double sdsq, h, s, fc, sd, sq, d__1;
-
-    lam *= RAD_PER_DEG;
-    sd = sin(lam);
-    sdsq = sd * sd;
-    s = p22 * sa * cos(lam) * sqrt((1. + t * sdsq) / ((
-	    1. + w * sdsq) * (1. + q * sdsq)));
-    d__1 = 1. + q * sdsq;
-    h = sqrt((1. + q * sdsq) / (1. + w * sdsq)) * ((1. + 
-	    w * sdsq) / (d__1 * d__1) - p22 * ca);
-    sq = sqrt(xj * xj + s * s);
-    b += fc = mult * (h * xj - s * s) / sq;
-    a2 += fc * cos(lam + lam);
-    a4 += fc * cos(lam * 4.);
-    fc = mult * s * (h + xj) / sq;
-    c1 += fc * cos(lam);
-    c3 += fc * cos(lam * 3.);
-   
-}
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-ossimDpt
-ossimSpaceObliqueMercatorProjection::forward(const ossimGpt &worldPoint) const
-{
-   ossimGpt gpt = worldPoint;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != worldPoint.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   ossimDpt xy;
-   
-   int l, nn;
-   double lamt, xlam, sdsq, c, d, s, lamdp, phidp, lampp, tanph,
-      lamtp, cl, sd, sp, fac, sav, tanphi;
-   double phi = gpt.latr();
-   double lam = gpt.lonr() - lam0;
-   
-   if (phi > HALFPI)
-      phi = HALFPI;
-   else if (phi < -HALFPI)
-      phi = -HALFPI;
-   lampp = phi >= 0. ? HALFPI : PI_HALFPI;
-   tanphi = tan(phi);
-   for (nn = 0;;)
-   {
-      sav = lampp;
-      lamtp = lam + p22 * lampp;
-      cl = cos(lamtp);
-      if (fabs(cl) < TOL)
-         lamtp -= TOL;
-      fac = lampp - sin(lampp) * (cl < 0. ? -HALFPI : HALFPI);
-      for (l = 50; l; --l) {
-         lamt = lam + p22 * sav;
-         if (fabs(c = cos(lamt)) < TOL)
-            lamt -= TOL;
-         xlam = (one_es * tanphi * sa + sin(lamt) * ca) / c;
-         lamdp = atan(xlam) + fac;
-         if (fabs(fabs(sav) - fabs(lamdp)) < TOL)
-            break;
-         sav = lamdp;
-      }
-      if (!l || ++nn >= 3 || (lamdp > rlm && lamdp < rlm2))
-         break;
-      if (lamdp <= rlm)
-         lampp = TWOPI_HALFPI;
-      else if (lamdp >= rlm2)
-         lampp = HALFPI;
-   }
-   if (l) {
-      sp = sin(phi);
-      phidp = aasin((one_es * ca * sp - sa * cos(phi) * 
-                     sin(lamt)) / sqrt(1. - es * sp * sp));
-      tanph = log(tan(FORTPI + .5 * phidp));
-      sd = sin(lamdp);
-      sdsq = sd * sd;
-      s = p22 * sa * cos(lamdp) * sqrt((1. + t * sdsq)
-                                       / ((1. + w * sdsq) * (1. + q * sdsq)));
-      d = sqrt(xj * xj + s * s);
-      xy.x = b * lamdp + a2 * sin(2. * lamdp) + a4 *
-             sin(lamdp * 4.) - tanph * s / d;
-      xy.y = c1 * sd + c3 * sin(lamdp * 3.) + tanph * xj / d;
-   }
-   else
-   {
-      xy.makeNan();
-      return xy;
-//       xy.x = xy.y = 1.0/DBL_EPSILON; // st to large number
-   }
-
-   xy.x*=a;
-   xy.y*=a;
-   return xy;
-}
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-ossimGpt
-ossimSpaceObliqueMercatorProjection::inverse(const ossimDpt &projectedPoint)
-   const
-{
-   int nn;
-   double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
-   double lam, phi;
-   
-   ossimDpt xy = projectedPoint;
-   xy.x/=a;
-   xy.y/=a;
-   
-   lamdp = xy.x / b;
-   nn = 50;
-   do {
-      sav = lamdp;
-      sd = sin(lamdp);
-      sdsq = sd * sd;
-      s = p22 * sa * cos(lamdp) * sqrt((1. + t * sdsq)
-                                       / ((1. + w * sdsq) * (1. + q * sdsq)));
-      lamdp = xy.x + xy.y * s / xj - a2 * sin(
-         2. * lamdp) - a4 * sin(lamdp * 4.) - s / xj * (
-            c1 * sin(lamdp) + c3 * sin(lamdp * 3.));
-      lamdp /= b;
-   } while (fabs(lamdp - sav) >= TOL && --nn);
-   sl = sin(lamdp);
-   fac = exp(sqrt(1. + s * s / xj / xj) * (xy.y - 
-                                           c1 * sl - c3 * sin(lamdp * 3.)));
-   phidp = 2. * (atan(fac) - FORTPI);
-   dd = sl * sl;
-   if (fabs(cos(lamdp)) < TOL)
-      lamdp -= TOL;
-   spp = sin(phidp);
-   sppsq = spp * spp;
-   lamt = atan(((1. - sppsq * rone_es) * tan(lamdp) * ca -
-                spp * sa * sqrt((1. + q * dd) * (1. - sppsq) - sppsq * u) /
-                cos(lamdp)) / (1. - sppsq * (1. + u)));
-   sl = lamt >= 0. ? 1. : -1.;
-   scl = cos(lamdp) >= 0. ? 1. : -1;
-   lamt -= HALFPI * (1. - scl) * sl;
-   
-   lam = lamt - p22 * lamdp;
-   if (fabs(sa) < TOL)
-      phi = aasin(spp / sqrt(one_es * one_es + es * sppsq));
-   else
-      phi = atan((tan(lamdp) * cos(lamt) - ca * sin(lamt)) /
-                    (one_es * sa));
-   return ossimGpt(phi*DEG_PER_RAD,
-                   (lam+lam0)*DEG_PER_RAD, 0.0, theDatum);
-   
-}                        
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-void ossimSpaceObliqueMercatorProjection::update()
-{
-//   theMetersPerPixel.x    = 1.0;
-//   theMetersPerPixel.y    = 1.0;
-   
-//   theUlEastingNorthing.x = 0.0;
-//   theUlEastingNorthing.y = 0.0;
-}
-
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-bool ossimSpaceObliqueMercatorProjection::saveState(ossimKeywordlist& kwl,
-                                                    const char* prefix) const
-{
-   kwl.add(prefix,
-           PATH_KW,
-           thePath,
-           true);
-   
-   kwl.add(prefix,
-           SATELLITE_TYPE_KW,
-           (int)theSatelliteType,
-           true);
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-//*****************************************************************************
-//  METHOD
-//*****************************************************************************
-bool ossimSpaceObliqueMercatorProjection::loadState(const ossimKeywordlist& kwl,
-                                                    const char* prefix)
-{
-   bool result = true;
-
-   const char* path = kwl.find(prefix, PATH_KW);
-   const char* type = kwl.find(prefix,  SATELLITE_TYPE_KW);
-
-   if(path)
-   {
-      thePath = ossimString(path).toDouble();
-   }
-   else
-   {
-      result = false;
-   }
-   if(type)
-   {
-      theSatelliteType = (ossimSatelliteType)ossimString(type).toInt();
-   }
-   else
-   {
-      result = false;
-   }
-
-   setParameters(theSatelliteType, thePath);
-
-   if(result)
-   {
-      result = ossimMapProjection::loadState(kwl, prefix);
-   }
-   else
-   {
-      ossimMapProjection::loadState(kwl, prefix);
-   }
-
-   return result;
-}
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimSpaceObliqueMercatorProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimSpaceObliqueMercatorProjection* p = PTR_CAST(ossimSpaceObliqueMercatorProjection, &proj);
-   if (!p) return false;
-
-   if (theSatelliteType != p->theSatelliteType) return false;
-   if (!ossim::almostEqual(thePath,p->thePath)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimTransCylEquAreaProjection.cpp b/ossim/src/ossim/projection/ossimTransCylEquAreaProjection.cpp
deleted file mode 100644
index 025076c..0000000
--- a/ossim/src/ossim/projection/ossimTransCylEquAreaProjection.cpp
+++ /dev/null
@@ -1,597 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Transverse Cylindrical Equal Area
-// projection code.  
-//*******************************************************************
-//  $Id: ossimTransCylEquAreaProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-
-#include <math.h>
-#include <ossim/projection/ossimTransCylEquAreaProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimTransCylEquAreaProjection, "ossimTransCylEquAreaProjection", ossimMapProjection)
-/***************************************************************************/
-/*
- *                              DEFINES
- */
-
-#ifndef PI_OVER_2
-#  define PI_OVER_2  ( M_PI / 2.0)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI     (2.0 * M_PI)
-#endif
-
-#define TCEA_Q(sinlat,x)                (One_MINUS_es2*(sinlat/(1.0-es2*sinlat*sinlat)-One_OVER_2es*log((1-x)/(1+x))))
-#define TCEA_COEFF_TIMES_SIN(coeff,x,latit)         (coeff * sin(x*latit))
-#define TCEA_M(c0lat,c1lat,c2lat,c3lat)             (Tcea_a * (c0lat - c1lat + c2lat - c3lat))
-#define TCEA_L(Beta,c0lat,c1lat,c2lat)              (Beta + c0lat + c1lat + c2lat)
-#define MIN_SCALE_FACTOR  0.3
-#define MAX_SCALE_FACTOR  3.0
-
-#define TCEA_NO_ERROR           0x0000
-#define TCEA_LAT_ERROR          0x0001
-#define TCEA_LON_ERROR          0x0002
-#define TCEA_EASTING_ERROR      0x0004
-#define TCEA_NORTHING_ERROR     0x0008
-#define TCEA_ORIGIN_LAT_ERROR   0x0010
-#define TCEA_CENT_MER_ERROR     0x0020
-#define TCEA_A_ERROR            0x0040
-#define TCEA_INV_F_ERROR        0x0080
-#define TCEA_SCALE_FACTOR_ERROR 0x0100
-#define TCEA_LON_WARNING        0x0200
-
-ossimTransCylEquAreaProjection::ossimTransCylEquAreaProjection(const ossimEllipsoid& ellipsoid,
-                                                               const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-
-ossimTransCylEquAreaProjection::ossimTransCylEquAreaProjection(const ossimEllipsoid& ellipsoid,
-                                                               const ossimGpt& origin,
-                                                               double falseEasting,
-                                                               double falseNorthing,
-                                                               double scaleFactor)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   Tcea_False_Easting  = falseEasting;
-   Tcea_False_Northing = falseNorthing;
-   Tcea_Scale_Factor   = scaleFactor;
-   Tcea_Min_Easting  = -6398628.0;
-   Tcea_Max_Easting  = 6398628.0;
-   Tcea_Min_Northing = -20003931.0;
-   Tcea_Max_Northing = 20003931.0;
-
-   update();
-}
-
-void ossimTransCylEquAreaProjection::setFalseEasting(double falseEasting)
-{
-   Tcea_False_Easting = falseEasting;
-   
-   update();
-}
-
-
-void ossimTransCylEquAreaProjection::setFalseNorthing(double falseNorthing)
-{
-   Tcea_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimTransCylEquAreaProjection::setFalseEastingNorthing(double falseEasting,
-                                                      double falseNorthing)
-{
-   Tcea_False_Easting  = falseEasting;
-   Tcea_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimTransCylEquAreaProjection::setScaleFactor(double scaleFactor)
-{
-   Tcea_Scale_Factor = scaleFactor;
-   
-   update();
-}
-
-void ossimTransCylEquAreaProjection::setParameters(double falseEasting,
-                                                   double falseNorthing,
-                                                   double scaleFactor)
-{
-   Tcea_False_Easting  = falseEasting;
-   Tcea_False_Northing = falseNorthing;
-   Tcea_Scale_Factor = scaleFactor;
-   
-   update();
-}
-
-void ossimTransCylEquAreaProjection::setDefaults()
-{
-   Tcea_Scale_Factor   = 1.0;
-   Tcea_False_Easting  = 0.0;
-   Tcea_False_Northing = 0.0;
-   Tcea_Min_Easting    = -6398628.0;
-   Tcea_Max_Easting    = 6398628.0;
-   Tcea_Min_Northing   = -20003931.0;
-   Tcea_Max_Northing   = 20003931.0;
-}
-
-void ossimTransCylEquAreaProjection::update()
-{  
-   Set_Trans_Cyl_Eq_Area_Parameters(theEllipsoid.getA(),
-                                    theEllipsoid.getFlattening(),
-                                    theOrigin.latr(),
-                                    theOrigin.lonr(),
-                                    Tcea_False_Easting,
-                                    Tcea_False_Northing,
-                                    Tcea_Scale_Factor);
-
-   theFalseEastingNorthing.x = Tcea_False_Easting;
-   theFalseEastingNorthing.y = Tcea_False_Northing;
-   
-   ossimMapProjection::update();
-}
-   
-
-ossimGpt ossimTransCylEquAreaProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_Trans_Cyl_Eq_Area_To_Geodetic(eastingNorthing.x,
-                                         eastingNorthing.y,
-                                         &lat,
-                                         &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
-}
-
-ossimDpt ossimTransCylEquAreaProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Trans_Cyl_Eq_Area(gpt.latr(),
-                                         gpt.lonr(),
-                                         &easting,
-                                         &northing);
-   
-   return ossimDpt(easting, northing);
-}
-
-bool ossimTransCylEquAreaProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_FACTOR_KW,
-           Tcea_Scale_Factor,
-           true);
-   
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimTransCylEquAreaProjection::loadState(const ossimKeywordlist& kwl,
-                                               const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   const char* scaleFactor   = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
-   
-   setDefaults();
-
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimTransCylEquAreaProjection))
-   {
-      Tcea_False_Easting  = theFalseEastingNorthing.x;
-      Tcea_False_Northing = theFalseEastingNorthing.y;
-
-      if(scaleFactor)
-      {
-         Tcea_Scale_Factor = ossimString(scaleFactor).toDouble();
-      }
-   }
-   
-   update();
-
-   return flag;
-}
-
-long ossimTransCylEquAreaProjection::Set_Trans_Cyl_Eq_Area_Parameters(double a,
-                                                                      double f,
-                                                                      double Origin_Latitude,
-                                                                      double Central_Meridian,
-                                                                      double False_Easting,
-                                                                      double False_Northing,
-                                                                      double Scale_Factor)
-{ /* BEGIN Set_Trans_Cyl_Eq_Area_Parameters */
-/*
- * The function Set_Trans_Cyl_Eq_Area_Parameters receives the ellipsoid parameters and
- * Transverse Cylindrical Equal Area projection parameters as inputs, and sets the 
- * corresponding state variables.  If any errors occur, the error code(s) are returned 
- * by the function, otherwise TCEA_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid						        (input)
- *    Origin_Latitude   : Latitude in radians at which the          (input)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (input)
- *    Scale_Factor      : Multiplier which reduces distances in the
- *                          projection to the actual distance on the
- *                          ellipsoid                               (input)
- */
-
-  double sin_lat_90 = sin(PI_OVER_2);
-  double x, j, three_es4;
-  double Sqrt_One_MINUS_es2;
-  double e1, e2, e3, e4;
-  double lat, sin2lat, sin4lat, sin6lat;
-  double temp, temp_northing;
-//  double inv_f = 1 / f;
-  long Error_Code = TCEA_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= TCEA_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= TCEA_INV_F_ERROR;
-//   }
-//   if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
-//   { /* origin latitude out of range */
-//     Error_Code |= TCEA_ORIGIN_LAT_ERROR;
-//   }
-//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= TCEA_CENT_MER_ERROR;
-//   }
-//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
-//   {
-//     Error_Code |= TCEA_SCALE_FACTOR_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-    Tcea_a = a;
-    Tcea_f = f;
-    Tcea_Origin_Lat = Origin_Latitude;
-    if (Central_Meridian > M_PI)
-      Central_Meridian -= TWO_PI;
-    Tcea_Origin_Long = Central_Meridian;
-    Tcea_False_Northing = False_Northing;
-    Tcea_False_Easting = False_Easting;
-    Tcea_Scale_Factor = Scale_Factor;
-
-    es2 = 2 * Tcea_f - Tcea_f * Tcea_f;
-    es = sqrt(es2);
-    One_MINUS_es2 = 1.0 - es2;
-    Sqrt_One_MINUS_es2 = sqrt(One_MINUS_es2);
-    One_OVER_2es = 1.0 / (2.0 * es);
-    es4 = es2 * es2;
-    es6 = es4 * es2;
-    x = es * sin_lat_90;
-    qp = TCEA_Q(sin_lat_90,x);
-
-    a0 = es2 / 3.0 + 31.0 * es4 / 180.0 + 517.0 * es6 / 5040.0;
-    a1 = 23.0 * es4 / 360.0 + 251.0 * es6 / 3780.0;
-    a2 = 761.0 * es6 / 45360.0;
-
-    e1 = (1.0 - Sqrt_One_MINUS_es2) / (1.0 + Sqrt_One_MINUS_es2);
-    e2 = e1 * e1;
-    e3 = e2 * e1;
-    e4 = e3 * e1;
-    b0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
-    b1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
-    b2 = 151.0 * e3 / 96.0;
-    b3 = 1097.0 * e4 / 512.0;
-
-    j = 45.0 * es6 / 1024.0;
-    three_es4 = 3.0 * es4;
-    c0 = 1.0 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
-    c1 = 3.0 * es2 / 8.0 + three_es4 / 32.0 + j;
-    c2 = 15.0 * es4 / 256.0 + j;
-    c3 = 35.0 * es6 / 3072.0;
-    lat = c0 * Tcea_Origin_Lat;
-    sin2lat = TCEA_COEFF_TIMES_SIN(c1, 2.0, Tcea_Origin_Lat);
-    sin4lat = TCEA_COEFF_TIMES_SIN(c2, 4.0, Tcea_Origin_Lat);
-    sin6lat = TCEA_COEFF_TIMES_SIN(c3, 6.0, Tcea_Origin_Lat);
-    M0 = TCEA_M(lat, sin2lat, sin4lat, sin6lat);
-    Convert_Geodetic_To_Trans_Cyl_Eq_Area(PI_OVER_2, M_PI, &temp, &temp_northing);
-    if (temp_northing > 0)
-    {
-      Tcea_Min_Northing = temp_northing - 20003931.458986;
-      Tcea_Max_Northing = temp_northing;
-    }
-    else if (temp_northing < 0)
-    {
-      Tcea_Max_Northing = temp_northing + 20003931.458986;
-      Tcea_Min_Northing = temp_northing;
-    }
-  } /* END OF if(!Error_Code) */
-  return (Error_Code);
-} /* END OF Set_Trans_Cyl_Eq_Area_Parameters */
-
-void ossimTransCylEquAreaProjection::Get_Trans_Cyl_Eq_Area_Parameters(double *a,
-                                                                      double *f,
-                                                                      double *Origin_Latitude,
-                                                                      double *Central_Meridian,
-                                                                      double *False_Easting,
-                                                                      double *False_Northing,
-                                                                      double *Scale_Factor)const
-{ /* BEGIN Get_Trans_Cyl_Eq_Area_Parameters */
-/*
- * The function Get_Trans_Cyl_Eq_Area_Parameters returns the current ellipsoid
- * parameters, Transverse Cylindrical Equal Area projection parameters, and scale factor.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid						        (output)
- *    Origin_Latitude   : Latitude in radians at which the          (output)
- *                          point scale factor is 1.0
- *    Central_Meridian  : Longitude in radians at the center of     (output)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (output)
- *    Scale_Factor      : Multiplier which reduces distances in the
- *                          projection to the actual distance on the
- *                          ellipsoid                               (output)
- */
-
-  *a = Tcea_a;
-  *f = Tcea_f;
-  *Origin_Latitude = Tcea_Origin_Lat;
-  *Central_Meridian = Tcea_Origin_Long;
-  *False_Easting = Tcea_False_Easting;
-  *False_Northing = Tcea_False_Northing;
-  *Scale_Factor = Tcea_Scale_Factor;
-  
-  return;
-} /* END OF Get_Trans_Cyl_Eq_Area_Parameters */
-
-
-long ossimTransCylEquAreaProjection::Convert_Geodetic_To_Trans_Cyl_Eq_Area (double Latitude,
-                                                                            double Longitude,
-                                                                            double *Easting,
-                                                                            double *Northing)const
-{ /* BEGIN Convert_Geodetic_To_Trans_Cyl_Eq_Area */
-/*
- * The function Convert_Geodetic_To_Trans_Cyl_Eq_Area converts geodetic (latitude and
- * longitude) coordinates to Transverse Cylindrical Equal Area projection (easting and
- * northing) coordinates, according to the current ellipsoid and Transverse Cylindrical 
- * Equal Area projection parameters.  If any errors occur, the error code(s) are returned 
- * by the function, otherwise TCEA_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double x;
-  double dlam;                      /* Longitude - Central Meridan */
-  double sin_lat = sin(Latitude);
-  double qq, qq_OVER_qp;
-  double beta, betac;
-  double sin2betac, sin4betac, sin6betac;
-  double PHIc;
-  double phi, sin2phi, sin4phi, sin6phi;
-  double sinPHIc;
-  double Mc;
-  long Error_Code = TCEA_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   { /* Latitude out of range */
-//     Error_Code |= TCEA_LAT_ERROR;
-//   }
-//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
-//   { /* Longitude out of range */
-//     Error_Code |= TCEA_LON_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    dlam = Longitude - Tcea_Origin_Long;
-    if (fabs(dlam) >= (M_PI / 2.0))
-    { /* Distortion will result if Longitude is more than 90 degrees from the Central Meridian */
-      Error_Code |= TCEA_LON_WARNING;
-    }
-
-    if (dlam > M_PI)
-    {
-      dlam -= TWO_PI;
-    }
-    if (dlam < -M_PI)
-    {
-      dlam += TWO_PI;
-    }
-    if (Latitude == PI_OVER_2)
-    {
-      qq = qp;
-      qq_OVER_qp = 1.0;
-    }
-    else
-    {
-      x = es * sin_lat;
-      qq = TCEA_Q(sin_lat, x);
-      qq_OVER_qp = qq / qp;
-    }
-
-
-    if (qq_OVER_qp > 1.0)
-      qq_OVER_qp = 1.0;
-    else if (qq_OVER_qp < -1.0)
-      qq_OVER_qp = -1.0;
-
-    beta = asin(qq_OVER_qp);
-    betac = atan(tan(beta) / cos(dlam));
-
-    if ((fabs(betac) - PI_OVER_2) > 1.0e-8)
-      PHIc = betac;
-    else
-    {
-      sin2betac = TCEA_COEFF_TIMES_SIN(a0, 2.0, betac);
-      sin4betac = TCEA_COEFF_TIMES_SIN(a1, 4.0, betac);
-      sin6betac = TCEA_COEFF_TIMES_SIN(a2, 6.0, betac);
-      PHIc = TCEA_L(betac, sin2betac, sin4betac, sin6betac);
-    }
-
-    sinPHIc = sin(PHIc);
-    *Easting = Tcea_a * cos(beta) * cos(PHIc) * sin(dlam) /
-               (Tcea_Scale_Factor * cos(betac) * sqrt(1.0 - es2 *
-                                                      sinPHIc * sinPHIc)) + Tcea_False_Easting;
-
-    phi = c0 * PHIc;
-    sin2phi = TCEA_COEFF_TIMES_SIN(c1, 2.0, PHIc);
-    sin4phi = TCEA_COEFF_TIMES_SIN(c2, 4.0, PHIc);
-    sin6phi = TCEA_COEFF_TIMES_SIN(c3, 6.0, PHIc);
-    Mc = TCEA_M(phi, sin2phi, sin4phi, sin6phi);
-
-    *Northing = Tcea_Scale_Factor * (Mc - M0) + Tcea_False_Northing;
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Trans_Cyl_Eq_Area */
-
-
-long ossimTransCylEquAreaProjection::Convert_Trans_Cyl_Eq_Area_To_Geodetic(double Easting,
-                                                                           double Northing,
-                                                                           double *Latitude,
-                                                                           double *Longitude)const
-{ /* BEGIN Convert_Trans_Cyl_Eq_Area_To_Geodetic */
-/*
- * The function Convert_Trans_Cyl_Eq_Area_To_Geodetic converts Transverse
- * Cylindrical Equal Area projection (easting and northing) coordinates
- * to geodetic (latitude and longitude) coordinates, according to the
- * current ellipsoid and Transverse Cylindrical Equal Area projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise TCEA_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double x;
-  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
-  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
-  double Mc;
-  double MUc;
-  double sin2mu, sin4mu, sin6mu, sin8mu;
-  double PHIc;
-  double Qc;
-  double sin_lat;
-  double beta, betac, beta_prime;
-  double sin2beta, sin4beta, sin6beta;
-  double cosbetac;
-  double Qc_OVER_qp;
-  double temp;
-
-  long Error_Code = TCEA_NO_ERROR;
-
-//   if ((Easting < (Tcea_False_Easting + Tcea_Min_Easting))
-//       || (Easting > (Tcea_False_Easting + Tcea_Max_Easting)))
-//   { /* Easting out of range */
-//     Error_Code |= TCEA_EASTING_ERROR;
-//   }
-//   if ((Northing < (Tcea_False_Northing + Tcea_Min_Northing))
-//       || (Northing > (Tcea_False_Northing + Tcea_Max_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= TCEA_NORTHING_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    dy = Northing - Tcea_False_Northing;
-    dx = Easting - Tcea_False_Easting;
-    Mc = M0 + dy / Tcea_Scale_Factor;
-    MUc = Mc / (Tcea_a * c0);
-
-    sin2mu = TCEA_COEFF_TIMES_SIN(b0, 2.0, MUc);
-    sin4mu = TCEA_COEFF_TIMES_SIN(b1, 4.0, MUc);
-    sin6mu = TCEA_COEFF_TIMES_SIN(b2, 6.0, MUc);
-    sin8mu = TCEA_COEFF_TIMES_SIN(b3, 8.0, MUc);
-    PHIc = MUc + sin2mu + sin4mu + sin6mu + sin8mu;
-
-    sin_lat = sin(PHIc);
-    x = es * sin_lat;
-    Qc = TCEA_Q(sin_lat, x);
-    Qc_OVER_qp = Qc / qp;
-
-    if (Qc_OVER_qp < -1.0)
-      Qc_OVER_qp = -1.0;
-    else if (Qc_OVER_qp > 1.0)
-      Qc_OVER_qp = 1.0;
-
-    betac = asin(Qc_OVER_qp);
-    cosbetac = cos(betac);
-    temp = Tcea_Scale_Factor * dx * cosbetac * sqrt(1.0 -
-                                                    es2 * sin_lat * sin_lat) / (Tcea_a * cos(PHIc));
-    if (temp > 1.0)
-      temp = 1.0;
-    else if (temp < -1.0)
-      temp = -1.0;
-    beta_prime = -asin(temp);
-    beta = asin(cos(beta_prime) * sin(betac));
-
-    sin2beta = TCEA_COEFF_TIMES_SIN(a0, 2.0, beta);
-    sin4beta = TCEA_COEFF_TIMES_SIN(a1, 4.0, beta);
-    sin6beta = TCEA_COEFF_TIMES_SIN(a2, 6.0, beta);
-    *Latitude = TCEA_L(beta, sin2beta, sin4beta, sin6beta);
-
-    *Longitude = Tcea_Origin_Long - atan(tan(beta_prime) / cosbetac);
-
-//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-//       *Latitude = PI_OVER_2;
-//     else if (*Latitude < -PI_OVER_2)
-//       *Latitude = -PI_OVER_2;
-
-//     if (*Longitude > M_PI)
-//       *Longitude -= TWO_PI;
-//     if (*Longitude < -M_PI)
-//       *Longitude += TWO_PI;
-
-//     if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
-//       *Longitude = M_PI;
-//     else if (*Longitude < -M_PI)
-//       *Longitude = -M_PI;
-  }
-  return (Error_Code);
-} /* END OF Convert_Trans_Cyl_Eq_Area_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimTransCylEquAreaProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimTransCylEquAreaProjection* p = PTR_CAST(ossimTransCylEquAreaProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(Tcea_Scale_Factor,p->Tcea_Scale_Factor)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimTransMercatorProjection.cpp b/ossim/src/ossim/projection/ossimTransMercatorProjection.cpp
deleted file mode 100644
index ada1493..0000000
--- a/ossim/src/ossim/projection/ossimTransMercatorProjection.cpp
+++ /dev/null
@@ -1,733 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Transverse Mercator  projection code.  
-//*******************************************************************
-//  $Id: ossimTransMercatorProjection.cpp 23002 2014-11-24 17:11:17Z dburken $
-#include <cmath>
-using namespace std;
-
-#include <ossim/projection/ossimTransMercatorProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimTransMercatorProjection, "ossimTransMercatorProjection", ossimMapProjection)
-
-/******************************* DEFINES *********************************/
-
-#define TRANMERC_NO_ERROR           0x0000
-#define TRANMERC_LAT_ERROR          0x0001
-#define TRANMERC_LON_ERROR          0x0002
-#define TRANMERC_EASTING_ERROR      0x0004
-#define TRANMERC_NORTHING_ERROR     0x0008
-#define TRANMERC_ORIGIN_LAT_ERROR   0x0010
-#define TRANMERC_CENT_MER_ERROR     0x0020
-#define TRANMERC_A_ERROR            0x0040
-#define TRANMERC_B_ERROR            0x0080
-#define TRANMERC_A_LESS_B_ERROR     0x0100
-#define TRANMERC_SCALE_FACTOR_ERROR 0x0200
-#define TRANMERC_LON_WARNING        0x0400
-
-#define MAX_LAT         ((M_PI * 90.0)/180.0)    /* 90 degrees in radians */
-#define MAX_DELTA_LONG  ((M_PI * 90.0)/180.0)    /* 90 degrees in radians */
-#define MIN_SCALE_FACTOR  0.3
-#define MAX_SCALE_FACTOR  3.0
-
-#define SPHTMD(Latitude) ((double) (TranMerc_ap * Latitude \
-      - TranMerc_bp * sin(2.e0 * Latitude) + TranMerc_cp * sin(4.e0 * Latitude) \
-      - TranMerc_dp * sin(6.e0 * Latitude) + TranMerc_ep * sin(8.e0 * Latitude) ) )
-
-#define SPHSN(Latitude) ((double) (getA() / sqrt( 1.e0 - TranMerc_es * \
-      pow(sin(Latitude), 2))))
-
-#define SPHSR(Latitude) ((double) (getA() * (1.e0 - TranMerc_es) / \
-    pow(DENOM(Latitude), 3)))
-
-#define DENOM(Latitude) ((double) (sqrt(1.e0 - TranMerc_es * pow(sin(Latitude),2))))
-
-ossimTransMercatorProjection::ossimTransMercatorProjection(const ossimEllipsoid& ellipsoid,
-                                                           const ossimGpt& origin)
-   :
-      ossimMapProjection(ellipsoid, origin),
-      TranMerc_a(6378137.0),
-      TranMerc_f(1.0/298.257223563),
-      TranMerc_es(0.0066943799901413800),
-      TranMerc_ebs(0.0067394967565869),
-      TranMerc_Origin_Lat(origin.latr()),
-      TranMerc_Origin_Long(origin.lonr()),
-      TranMerc_False_Northing(0.0),
-      TranMerc_False_Easting(0.0),
-      TranMerc_Scale_Factor(1.0),
-      TranMerc_ap(6367449.1458008),
-      TranMerc_bp(16038.508696861),
-      TranMerc_cp(16.832613334334),
-      TranMerc_dp(0.021984404273757),
-      TranMerc_Delta_Easting(40000000.0),
-      TranMerc_Delta_Northing(40000000.0)
-{
-   update();
-}
-
-ossimTransMercatorProjection::ossimTransMercatorProjection(const ossimEllipsoid& ellipsoid,
-                                                           const ossimGpt& origin,
-                                                           double falseEasting,
-                                                           double falseNorthing,
-                                                           double scaleFactor)
-   :
-      ossimMapProjection(ellipsoid, origin),
-      TranMerc_a(6378137.0),
-      TranMerc_f(1.0/298.257223563),
-      TranMerc_es(0.0066943799901413800),
-      TranMerc_ebs(0.0067394967565869),
-      TranMerc_Origin_Lat(origin.latr()),
-      TranMerc_Origin_Long(origin.lonr()),
-      TranMerc_False_Northing(falseNorthing),
-      TranMerc_False_Easting(falseEasting),
-      TranMerc_Scale_Factor(scaleFactor),
-      TranMerc_ap(6367449.1458008),
-      TranMerc_bp(16038.508696861),
-      TranMerc_cp(16.832613334334),
-      TranMerc_dp(0.021984404273757),
-      TranMerc_Delta_Easting(40000000.0),
-      TranMerc_Delta_Northing(40000000.0)
-{
-   update();
-}
-
-void ossimTransMercatorProjection::update()
-{
-   Set_Transverse_Mercator_Parameters(theEllipsoid.getA(),
-                                      theEllipsoid.getFlattening(),
-                                      theOrigin.latr(),
-                                      theOrigin.lonr(),
-                                      TranMerc_False_Easting,
-                                      TranMerc_False_Northing,
-                                      TranMerc_Scale_Factor);
-
-   theFalseEastingNorthing.x = TranMerc_False_Easting;
-   theFalseEastingNorthing.y = TranMerc_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-void ossimTransMercatorProjection::setFalseEasting(double falseEasting)
-{
-   TranMerc_False_Easting  = falseEasting;
-   
-   update();
-}
-
-
-void ossimTransMercatorProjection::setFalseNorthing(double falseNorthing)
-{
-   TranMerc_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimTransMercatorProjection::setFalseEastingNorthing(double falseEasting,
-                                                      double falseNorthing)
-{
-   TranMerc_False_Easting  = falseEasting;
-   TranMerc_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimTransMercatorProjection::setScaleFactor(double scaleFactor)
-{
-   TranMerc_Scale_Factor = scaleFactor;
-   
-   update();
-}
-
-void ossimTransMercatorProjection::setParameters(double falseEasting,
-                                                   double falseNorthing,
-                                                   double scaleFactor)
-{
-   TranMerc_False_Easting  = falseEasting;
-   TranMerc_False_Northing = falseNorthing;
-   TranMerc_Scale_Factor   = scaleFactor;
-   
-   update();
-}
-
-void ossimTransMercatorProjection::setDefaults()
-{
-   TranMerc_False_Easting  = 0.0;
-   TranMerc_False_Northing = 0.0;
-   TranMerc_Scale_Factor   = 1.0;
-   TranMerc_Delta_Easting  = 40000000.0;
-   TranMerc_Delta_Northing = 40000000.0;
-}
-
-ossimGpt ossimTransMercatorProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_Transverse_Mercator_To_Geodetic(eastingNorthing.x,
-                                           eastingNorthing.y,
-                                           &lat,
-                                           &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
-}
-
-ossimDpt ossimTransMercatorProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Transverse_Mercator(gpt.latr(),
-                                           gpt.lonr(),
-                                           &easting,
-                                           &northing);
-   
-   return ossimDpt(easting, northing);
-}
-
-bool ossimTransMercatorProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::SCALE_FACTOR_KW,
-           TranMerc_Scale_Factor,
-           true);
-   
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-bool ossimTransMercatorProjection::loadState(const ossimKeywordlist& kwl,
-                                             const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   const char* scaleFactor   = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
-   
-   setDefaults();
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimTransMercatorProjection))
-   {
-      TranMerc_False_Easting  = theFalseEastingNorthing.x;
-      TranMerc_False_Northing = theFalseEastingNorthing.y;
-
-      if(scaleFactor)
-      {
-         double d = ossimString(scaleFactor).toDouble();
-         if (d > 0.0) // Check to avoid divide by zero.
-         {
-            TranMerc_Scale_Factor = d;
-         }
-      }
-   }
-
-   update();
-
-   return flag;
-}
-
-/************************************************************************/
-/*                              FUNCTIONS     
- *
- */
-
-
-long ossimTransMercatorProjection::Set_Transverse_Mercator_Parameters(double a,
-                                                                      double f,
-                                                                      double Origin_Latitude,
-                                                                      double Central_Meridian,
-                                                                      double False_Easting,
-                                                                      double False_Northing,
-                                                                      double Scale_Factor)
-
-{ /* BEGIN Set_Tranverse_Mercator_Parameters */
-  /*
-   * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
-   * parameters and Tranverse Mercator projection parameters as inputs, and
-   * sets the corresponding state variables. If any errors occur, the error
-   * code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
-   * returned.
-   *
-   *    a                 : Semi-major axis of ellipsoid, in meters    (input)
-   *    f                 : Flattening of ellipsoid						         (input)
-   *    Origin_Latitude   : Latitude in radians at the origin of the   (input)
-   *                         projection
-   *    Central_Meridian  : Longitude in radians at the center of the  (input)
-   *                         projection
-   *    False_Easting     : Easting/X at the center of the projection  (input)
-   *    False_Northing    : Northing/Y at the center of the projection (input)
-   *    Scale_Factor      : Projection scale factor                    (input) 
-   */
-
-  double tn;        /* True Meridianal distance constant  */
-  double tn2;
-  double tn3;
-  double tn4;
-  double tn5;
-  double dummy_northing;
-  double TranMerc_b; /* Semi-minor axis of ellipsoid, in meters */
-//  double inv_f = 1 / f;
-  long Error_Code = TRANMERC_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= TRANMERC_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= TRANMERC_INV_F_ERROR;
-//   }
-//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
-//   { /* origin latitude out of range */
-//     Error_Code |= TRANMERC_ORIGIN_LAT_ERROR;
-//   }
-//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= TRANMERC_CENT_MER_ERROR;
-//   }
-//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
-//   {
-//     Error_Code |= TRANMERC_SCALE_FACTOR_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    TranMerc_a = a;
-    TranMerc_f = f;
-    TranMerc_Origin_Lat = 0;
-    TranMerc_Origin_Long = 0;
-    TranMerc_False_Northing = 0;
-    TranMerc_False_Easting = 0; 
-    TranMerc_Scale_Factor = 1;
-
-    /* Eccentricity Squared */
-    TranMerc_es = 2 * TranMerc_f - TranMerc_f * TranMerc_f;
-    /* Second Eccentricity Squared */
-    TranMerc_ebs = (1 / (1 - TranMerc_es)) - 1;
-
-    TranMerc_b = TranMerc_a * (1 - TranMerc_f);    
-    /*True meridianal constants  */
-    tn = (TranMerc_a - TranMerc_b) / (TranMerc_a + TranMerc_b);
-    tn2 = tn * tn;
-    tn3 = tn2 * tn;
-    tn4 = tn3 * tn;
-    tn5 = tn4 * tn;
-
-    TranMerc_ap = TranMerc_a * (1.e0 - tn + 5.e0 * (tn2 - tn3)/4.e0
-                                + 81.e0 * (tn4 - tn5)/64.e0 );
-    TranMerc_bp = 3.e0 * TranMerc_a * (tn - tn2 + 7.e0 * (tn3 - tn4)
-                                       /8.e0 + 55.e0 * tn5/64.e0 )/2.e0;
-    TranMerc_cp = 15.e0 * TranMerc_a * (tn2 - tn3 + 3.e0 * (tn4 - tn5 )/4.e0) /16.0;
-    TranMerc_dp = 35.e0 * TranMerc_a * (tn3 - tn4 + 11.e0 * tn5 / 16.e0) / 48.e0;
-    TranMerc_ep = 315.e0 * TranMerc_a * (tn4 - tn5) / 512.e0;
-    Convert_Geodetic_To_Transverse_Mercator(MAX_LAT,
-                                            MAX_DELTA_LONG,
-                                            &TranMerc_Delta_Easting,
-                                            &TranMerc_Delta_Northing);
-    Convert_Geodetic_To_Transverse_Mercator(0,
-                                            MAX_DELTA_LONG,
-                                            &TranMerc_Delta_Easting,
-                                            &dummy_northing);
-    TranMerc_Origin_Lat = Origin_Latitude;
-    if (Central_Meridian > M_PI)
-      Central_Meridian -= TWO_PI;
-    TranMerc_Origin_Long = Central_Meridian;
-    TranMerc_False_Northing = False_Northing;
-    TranMerc_False_Easting = False_Easting; 
-    TranMerc_Scale_Factor = Scale_Factor;
-  } /* END OF if(!Error_Code) */
-  return (Error_Code);
-}  /* END of Set_Transverse_Mercator_Parameters  */
-
-
-void ossimTransMercatorProjection::Get_Transverse_Mercator_Parameters(double *a,
-                                                                      double *f,
-                                                                      double *Origin_Latitude,
-                                                                      double *Central_Meridian,
-                                                                      double *False_Easting,
-                                                                      double *False_Northing,
-                                                                      double *Scale_Factor)const
-
-{ /* BEGIN Get_Tranverse_Mercator_Parameters  */
-  /*
-   * The function Get_Transverse_Mercator_Parameters returns the current
-   * ellipsoid and Transverse Mercator projection parameters.
-   *
-   *    a                 : Semi-major axis of ellipsoid, in meters    (output)
-   *    f                 : Flattening of ellipsoid						         (output)
-   *    Origin_Latitude   : Latitude in radians at the origin of the   (output)
-   *                         projection
-   *    Central_Meridian  : Longitude in radians at the center of the  (output)
-   *                         projection
-   *    False_Easting     : Easting/X at the center of the projection  (output)
-   *    False_Northing    : Northing/Y at the center of the projection (output)
-   *    Scale_Factor      : Projection scale factor                    (output) 
-   */
-
-  *a = TranMerc_a;
-  *f = TranMerc_f;
-  *Origin_Latitude = TranMerc_Origin_Lat;
-  *Central_Meridian = TranMerc_Origin_Long;
-  *False_Easting = TranMerc_False_Easting;
-  *False_Northing = TranMerc_False_Northing;
-  *Scale_Factor = TranMerc_Scale_Factor;
-  
-  return;
-} /* END OF Get_Tranverse_Mercator_Parameters */
-
-
-
-long ossimTransMercatorProjection::Convert_Geodetic_To_Transverse_Mercator (double Latitude,
-                                                                            double Longitude,
-                                                                            double *Easting,
-                                                                            double *Northing)const
-   
-{      /* BEGIN Convert_Geodetic_To_Transverse_Mercator */
-
-  /*
-   * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
-   * (latitude and longitude) coordinates to Transverse Mercator projection
-   * (easting and northing) coordinates, according to the current ellipsoid
-   * and Transverse Mercator projection coordinates.  If any errors occur, the
-   * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
-   * returned.
-   *
-   *    Latitude      : Latitude in radians                         (input)
-   *    Longitude     : Longitude in radians                        (input)
-   *    Easting       : Easting/X in meters                         (output)
-   *    Northing      : Northing/Y in meters                        (output)
-   */
-
-  double c;       /* Cosine of latitude                          */
-  double c2;
-  double c3;
-  double c5;
-  double c7;
-  double dlam;    /* Delta longitude - Difference in Longitude       */
-  double eta;     /* constant - TranMerc_ebs *c *c                   */
-  double eta2;
-  double eta3;
-  double eta4;
-  double s;       /* Sine of latitude                        */
-  double sn;      /* Radius of curvature in the prime vertical       */
-  double t;       /* Tangent of latitude                             */
-  double tan2;
-  double tan3;
-  double tan4;
-  double tan5;
-  double tan6;
-  double t1;      /* Term in coordinate conversion formula - GP to Y */
-  double t2;      /* Term in coordinate conversion formula - GP to Y */
-  double t3;      /* Term in coordinate conversion formula - GP to Y */
-  double t4;      /* Term in coordinate conversion formula - GP to Y */
-  double t5;      /* Term in coordinate conversion formula - GP to Y */
-  double t6;      /* Term in coordinate conversion formula - GP to Y */
-  double t7;      /* Term in coordinate conversion formula - GP to Y */
-  double t8;      /* Term in coordinate conversion formula - GP to Y */
-  double t9;      /* Term in coordinate conversion formula - GP to Y */
-  double tmd;     /* True Meridional distance                        */
-  double tmdo;    /* True Meridional distance for latitude of origin */
-  long    Error_Code = TRANMERC_NO_ERROR;
-//  double temp_Origin;
-//  double temp_Long;
-
-//   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
-//   {  /* Latitude out of range */
-//     Error_Code|= TRANMERC_LAT_ERROR;
-//   }
-   if (Longitude > M_PI)
-     Longitude -= TWO_PI;
-//   if ((Longitude < (TranMerc_Origin_Long - MAX_DELTA_LONG))
-//       || (Longitude > (TranMerc_Origin_Long + MAX_DELTA_LONG)))
-//   {
-//     if (Longitude < 0)
-//       temp_Long = Longitude + TWO_PI;
-//     else
-//       temp_Long = Longitude;
-//     if (TranMerc_Origin_Long < 0)
-//       temp_Origin = TranMerc_Origin_Long + TWO_PI;
-//     else
-//       temp_Origin = TranMerc_Origin_Long;
-//     if ((temp_Long < (temp_Origin - MAX_DELTA_LONG))
-//         || (temp_Long > (temp_Origin + MAX_DELTA_LONG)))
-//       Error_Code|= TRANMERC_LON_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-
-    /* 
-     *  Delta Longitude
-     */
-    dlam = Longitude - TranMerc_Origin_Long;
-
-//     if (fabs(dlam) > (9.0 * M_PI / 180))
-//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
-//       Error_Code |= TRANMERC_LON_WARNING;
-//     }
-
-     if (dlam > M_PI)
-       dlam -= TWO_PI;
-     if (dlam < -M_PI)
-       dlam += TWO_PI;
-     if (fabs(dlam) < 2.e-10)
-       dlam = 0.0;
-
-    s = sin(Latitude);
-    c = cos(Latitude);
-    c2 = c * c;
-    c3 = c2 * c;
-    c5 = c3 * c2;
-    c7 = c5 * c2;
-    t = tan (Latitude);
-    tan2 = t * t;
-    tan3 = tan2 * t;
-    tan4 = tan3 * t;
-    tan5 = tan4 * t;
-    tan6 = tan5 * t;
-    eta = TranMerc_ebs * c2;
-    eta2 = eta * eta;
-    eta3 = eta2 * eta;
-    eta4 = eta3 * eta;
-
-    /* radius of curvature in prime vertical */
-    sn = SPHSN(Latitude);
-
-    /* True Meridianal Distances */
-    tmd = SPHTMD(Latitude);
-
-    /*  Origin  */
-    tmdo = SPHTMD (TranMerc_Origin_Lat);
-
-    /* northing */
-    t1 = (tmd - tmdo) * TranMerc_Scale_Factor;
-    t2 = sn * s * c * TranMerc_Scale_Factor/ 2.e0;
-    t3 = sn * s * c3 * TranMerc_Scale_Factor * (5.e0 - tan2 + 9.e0 * eta 
-                                                + 4.e0 * eta2) /24.e0; 
-
-    t4 = sn * s * c5 * TranMerc_Scale_Factor * (61.e0 - 58.e0 * tan2
-                                                + tan4 + 270.e0 * eta - 330.e0 * tan2 * eta + 445.e0 * eta2
-                                                + 324.e0 * eta3 -680.e0 * tan2 * eta2 + 88.e0 * eta4 
-                                                -600.e0 * tan2 * eta3 - 192.e0 * tan2 * eta4) / 720.e0;
-
-    t5 = sn * s * c7 * TranMerc_Scale_Factor * (1385.e0 - 3111.e0 * 
-                                                tan2 + 543.e0 * tan4 - tan6) / 40320.e0;
-
-    *Northing = TranMerc_False_Northing + t1 + pow(dlam,2.e0) * t2
-                + pow(dlam,4.e0) * t3 + pow(dlam,6.e0) * t4
-                + pow(dlam,8.e0) * t5; 
-
-    /* Easting */
-    t6 = sn * c * TranMerc_Scale_Factor;
-    t7 = sn * c3 * TranMerc_Scale_Factor * (1.e0 - tan2 + eta ) /6.e0;
-    t8 = sn * c5 * TranMerc_Scale_Factor * (5.e0 - 18.e0 * tan2 + tan4
-                                            + 14.e0 * eta - 58.e0 * tan2 * eta + 13.e0 * eta2 + 4.e0 * eta3 
-                                            - 64.e0 * tan2 * eta2 - 24.e0 * tan2 * eta3 )/ 120.e0;
-    t9 = sn * c7 * TranMerc_Scale_Factor * ( 61.e0 - 479.e0 * tan2
-                                             + 179.e0 * tan4 - tan6 ) /5040.e0;
-
-    *Easting = TranMerc_False_Easting + dlam * t6 + pow(dlam,3.e0) * t7 
-               + pow(dlam,5.e0) * t8 + pow(dlam,7.e0) * t9;
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Transverse_Mercator */
-
-
-long ossimTransMercatorProjection::Convert_Transverse_Mercator_To_Geodetic (double Easting,
-                                                                            double Northing,
-                                                                            double *Latitude,
-                                                                            double *Longitude)const
-{      /* BEGIN Convert_Transverse_Mercator_To_Geodetic */
-
-  /*
-   * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
-   * Mercator projection (easting and northing) coordinates to geodetic
-   * (latitude and longitude) coordinates, according to the current ellipsoid
-   * and Transverse Mercator projection parameters.  If any errors occur, the
-   * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
-   * returned.
-   *
-   *    Easting       : Easting/X in meters                         (input)
-   *    Northing      : Northing/Y in meters                        (input)
-   *    Latitude      : Latitude in radians                         (output)
-   *    Longitude     : Longitude in radians                        (output)
-   */
-
-  double c;       /* Cosine of latitude                          */
-  double de;      /* Delta easting - Difference in Easting (Easting-Fe)    */
-  double dlam;    /* Delta longitude - Difference in Longitude       */
-  double eta;     /* constant - TranMerc_ebs *c *c                   */
-  double eta2;
-  double eta3;
-  double eta4;
-  double ftphi;   /* Footpoint latitude                              */
-  int    i;       /* Loop iterator                   */
-  // double s;       /* Sine of latitude                        */
-  double sn;      /* Radius of curvature in the prime vertical       */
-  double sr;      /* Radius of curvature in the meridian             */
-  double t;       /* Tangent of latitude                             */
-  double tan2;
-  double tan4;
-  double t10;     /* Term in coordinate conversion formula - GP to Y */
-  double t11;     /* Term in coordinate conversion formula - GP to Y */
-  double t12;     /* Term in coordinate conversion formula - GP to Y */
-  double t13;     /* Term in coordinate conversion formula - GP to Y */
-  double t14;     /* Term in coordinate conversion formula - GP to Y */
-  double t15;     /* Term in coordinate conversion formula - GP to Y */
-  double t16;     /* Term in coordinate conversion formula - GP to Y */
-  double t17;     /* Term in coordinate conversion formula - GP to Y */
-  double tmd;     /* True Meridional distance                        */
-  double tmdo;    /* True Meridional distance for latitude of origin */
-  long Error_Code = TRANMERC_NO_ERROR;
-
-//   if ((Easting < (TranMerc_False_Easting - TranMerc_Delta_Easting))
-//       ||(Easting > (TranMerc_False_Easting + TranMerc_Delta_Easting)))
-//   { /* Easting out of range  */
-//     Error_Code |= TRANMERC_EASTING_ERROR;
-//   }
-//   if ((Northing < (TranMerc_False_Northing - TranMerc_Delta_Northing))
-//       || (Northing > (TranMerc_False_Northing + TranMerc_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= TRANMERC_NORTHING_ERROR;
-//   }
-
-  if (!Error_Code)
-  {
-    /* True Meridional Distances for latitude of origin */
-    tmdo = SPHTMD(TranMerc_Origin_Lat);
-
-    /*  Origin  */
-    tmd = tmdo +  (Northing - TranMerc_False_Northing) / TranMerc_Scale_Factor; 
-
-    /* First Estimate */
-    sr = SPHSR(0.e0);
-    ftphi = tmd/sr;
-
-    for (i = 0; i < 5 ; i++)
-    {
-      t10 = SPHTMD (ftphi);
-      sr = SPHSR(ftphi);
-      ftphi = ftphi + (tmd - t10) / sr;
-    }
-
-    /* Radius of Curvature in the meridian */
-    sr = SPHSR(ftphi);
-
-    /* Radius of Curvature in the meridian */
-    sn = SPHSN(ftphi);
-
-    /* Sine Cosine terms */
-    // s = sin(ftphi);
-    c = cos(ftphi);
-
-    /* Tangent Value  */
-    t = tan(ftphi);
-    tan2 = t * t;
-    tan4 = tan2 * tan2;
-    eta = TranMerc_ebs * pow(c,2);
-    eta2 = eta * eta;
-    eta3 = eta2 * eta;
-    eta4 = eta3 * eta;
-    de = Easting - TranMerc_False_Easting;
-    if (fabs(de) < 0.0001)
-      de = 0.0;
-
-    /* Latitude */
-    t10 = t / (2.e0 * sr * sn * pow(TranMerc_Scale_Factor, 2));
-    t11 = t * (5.e0  + 3.e0 * tan2 + eta - 4.e0 * pow(eta,2)
-               - 9.e0 * tan2 * eta) / (24.e0 * sr * pow(sn,3) 
-                                       * pow(TranMerc_Scale_Factor,4));
-    t12 = t * (61.e0 + 90.e0 * tan2 + 46.e0 * eta + 45.E0 * tan4
-               - 252.e0 * tan2 * eta  - 3.e0 * eta2 + 100.e0 
-               * eta3 - 66.e0 * tan2 * eta2 - 90.e0 * tan4
-               * eta + 88.e0 * eta4 + 225.e0 * tan4 * eta2
-               + 84.e0 * tan2* eta3 - 192.e0 * tan2 * eta4)
-          / ( 720.e0 * sr * pow(sn,5) * pow(TranMerc_Scale_Factor, 6) );
-    t13 = t * ( 1385.e0 + 3633.e0 * tan2 + 4095.e0 * tan4 + 1575.e0 
-                * pow(t,6))/ (40320.e0 * sr * pow(sn,7) * pow(TranMerc_Scale_Factor,8));
-    *Latitude = ftphi - pow(de,2) * t10 + pow(de,4) * t11 - pow(de,6) * t12 
-                + pow(de,8) * t13;
-
-    t14 = 1.e0 / (sn * c * TranMerc_Scale_Factor);
-
-    t15 = (1.e0 + 2.e0 * tan2 + eta) / (6.e0 * pow(sn,3) * c * 
-                                        pow(TranMerc_Scale_Factor,3));
-
-    t16 = (5.e0 + 6.e0 * eta + 28.e0 * tan2 - 3.e0 * eta2
-           + 8.e0 * tan2 * eta + 24.e0 * tan4 - 4.e0 
-           * eta3 + 4.e0 * tan2 * eta2 + 24.e0 
-           * tan2 * eta3) / (120.e0 * pow(sn,5) * c  
-                             * pow(TranMerc_Scale_Factor,5));
-
-    t17 = (61.e0 +  662.e0 * tan2 + 1320.e0 * tan4 + 720.e0 
-           * pow(t,6)) / (5040.e0 * pow(sn,7) * c 
-                          * pow(TranMerc_Scale_Factor,7));
-
-    /* Difference in Longitude */
-    dlam = de * t14 - pow(de,3) * t15 + pow(de,5) * t16 - pow(de,7) * t17;
-
-    /* Longitude */
-    (*Longitude) = TranMerc_Origin_Long + dlam;
-    while (*Latitude > (90.0 * RAD_PER_DEG))
-    {
-      *Latitude = M_PI - *Latitude;
-      *Longitude += M_PI;
-      if (*Longitude > M_PI)
-        *Longitude -= TWO_PI;
-    }
-
-     while (*Latitude < (-90.0 * RAD_PER_DEG))
-     {
-       *Latitude = - (*Latitude + M_PI);
-       *Longitude += M_PI;
-       if (*Longitude > M_PI)
-         *Longitude -= TWO_PI;
-     }
-     if (*Longitude > TWO_PI)
-       *Longitude -= TWO_PI;
-     if (*Longitude < -M_PI)
-       *Longitude += TWO_PI;
-
-//     if (fabs(dlam) > (9.0 * M_PI / 180))
-//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
-//       Error_Code |= TRANMERC_LON_WARNING;
-//     }
-  }
-  return (Error_Code);
-} /* END OF Convert_Transverse_Mercator_To_Geodetic */
-
-std::ostream& ossimTransMercatorProjection::print(std::ostream& out) const
-{
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << "// ossimTransMercatorProjection::print\n"
-       << ossimKeywordNames::SCALE_FACTOR_KW << ":  " << TranMerc_Scale_Factor
-       << endl;
-   return ossimMapProjection::print(out);
-}
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimTransMercatorProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimTransMercatorProjection* p = PTR_CAST(ossimTransMercatorProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(TranMerc_Scale_Factor,p->TranMerc_Scale_Factor)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimUpsProjection.cpp b/ossim/src/ossim/projection/ossimUpsProjection.cpp
deleted file mode 100644
index 5c687a7..0000000
--- a/ossim/src/ossim/projection/ossimUpsProjection.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimUpsProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-#include <ossim/projection/ossimUpsProjection.h>
-#include <ossim/projection/ossimPolarst.h>
-
-#define PI       3.14159265358979323e0  /* PI     */
-#define PI_OVER    (PI/2.0e0)           /* PI over 2 */
-#define MAX_LAT    ((PI * 90)/180.0)    /* 90 degrees in radians */
-#define MAX_ORIGIN_LAT ((81.114528 * PI) / 180.0)
-#define MIN_NORTH_LAT (83.5*PI/180.0)
-#define MIN_SOUTH_LAT (-79.5*PI/180.0)
-#define MIN_EAST_NORTH 0
-#define MAX_EAST_NORTH 4000000
-
-#define UPS_NO_ERROR                0x0000
-#define UPS_LAT_ERROR               0x0001
-#define UPS_LON_ERROR               0x0002
-#define UPS_HEMISPHERE_ERROR        0x0004
-#define UPS_EASTING_ERROR           0x0008
-#define UPS_NORTHING_ERROR          0x0010
-#define UPS_A_ERROR                 0x0020
-#define UPS_INV_F_ERROR             0x0040
-
-RTTI_DEF1(ossimUpsProjection, "ossimUpsProjection", ossimMapProjection);
-
-ossimUpsProjection::ossimUpsProjection(const ossimEllipsoid& ellipsoid,
-                                       const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-    
-
-void ossimUpsProjection::setDefaults()
-{
-   if(theOrigin.latd() >= -FLT_EPSILON)
-   {
-      UPS_Origin_Latitude  =  MAX_ORIGIN_LAT;
-      theHemisphere        = 'N';
-   }
-   else
-   {
-      UPS_Origin_Latitude  =  -MAX_ORIGIN_LAT;
-      theHemisphere = 'S';
-   }
-   UPS_False_Easting    = 2000000;
-   UPS_False_Northing   = 2000000;
-   false_easting        = 0.0;
-   false_northing       = 0.0;
-   UPS_Easting          = 0.0;
-   UPS_Northing         = 0.0;
-   UPS_Origin_Longitude = 0.0;
-   theOrigin            = ossimGpt(UPS_Origin_Latitude*DEG_PER_RAD,
-                                   0.0,0.0);
-}
-
-void ossimUpsProjection::setHemisphere(char hemisphere)
-{ 
-  theHemisphere = hemisphere; 
-  update();
-}
-
-ossimGpt ossimUpsProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_UPS_To_Geodetic(theHemisphere,
-                           eastingNorthing.x,
-                           eastingNorthing.y,
-                           &lat,
-                           &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
-}
-
-ossimDpt ossimUpsProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-   
-   Convert_Geodetic_To_UPS(gpt.latr(),
-                           gpt.lonr(),
-                           &theHemisphere,
-                           &easting,
-                           &northing);
-   
-   return ossimDpt(easting, northing);
-}
-
-void ossimUpsProjection::update()
-{
-   Set_UPS_Parameters(theEllipsoid.getA(),
-                      theEllipsoid.getFlattening());
-
-   theFalseEastingNorthing.x = UPS_False_Easting;
-   theFalseEastingNorthing.y = UPS_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-/*!
- * Method to save the state of an object to a keyword list.
- * Return true if ok or false on error.
- */
-bool ossimUpsProjection::saveState(ossimKeywordlist& kwl,
-                                   const char* prefix)const
-{
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-
-/*!
- * Method to the load (recreate) the state of an object from a keyword
- * list.  Return true if ok or false on error.
- */
-bool ossimUpsProjection::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   setDefaults();
-
-   return ossimMapProjection::loadState(kwl, prefix);
-}
-
-/************************************************************************/
-/*                              FUNCTIONS
- *
- */
-
-
-long ossimUpsProjection::Set_UPS_Parameters( double a,
-                                             double f)
-{
-/*
- * The function SET_UPS_PARAMETERS receives the ellipsoid parameters and sets
- * the corresponding state variables. If any errors occur, the error code(s)
- * are returned by the function, otherwise UPS_NO_ERROR is returned.
- *
- *   a     : Semi-major axis of ellipsoid in meters (input)
- *   f     : Flattening of ellipsoid					      (input)
- */
-
-//  double inv_f = 1 / f;
-  long Error_Code = UPS_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= UPS_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= UPS_INV_F_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-    UPS_a = a;
-    UPS_f = f;
-  }
-  return (Error_Code);
-}  /* END of Set_UPS_Parameters  */
-
-
-void ossimUpsProjection::Get_UPS_Parameters( double *a,
-                                             double *f)const
-{
-/*
- * The function Get_UPS_Parameters returns the current ellipsoid parameters.
- *
- *  a      : Semi-major axis of ellipsoid, in meters (output)
- *  f      : Flattening of ellipsoid					       (output)
- */
-
-  *a = UPS_a;
-  *f = UPS_f;
-  
-  return;
-} /* END OF Get_UPS_Parameters */
-
-
-long ossimUpsProjection::Convert_Geodetic_To_UPS ( double Latitude,
-                                                   double Longitude,
-                                                   char   * /* Hemisphere */,
-                                                   double *Easting,
-                                                   double *Northing)const
-{
-/*
- *  The function Convert_Geodetic_To_UPS converts geodetic (latitude and
- *  longitude) coordinates to UPS (hemisphere, easting, and northing)
- *  coordinates, according to the current ellipsoid parameters. If any 
- *  errors occur, the error code(s) are returned by the function, 
- *  otherwide UPS_NO_ERROR is returned.
- *
- *    Latitude      : Latitude in radians                       (input)
- *    Longitude     : Longitude in radians                      (input)
- *    Hemisphere    : Hemisphere either 'N' or 'S'              (output)
- *    Easting       : Easting/X in meters                       (output)
- *    Northing      : Northing/Y in meters                      (output)
- */
-
-  double tempEasting, tempNorthing;
-  long Error_Code = UPS_NO_ERROR;
-
-//   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
-//   {   /* latitude out of range */
-//     Error_Code |= UPS_LAT_ERROR;
-//   }
-//   if ((Latitude < 0) && (Latitude > MIN_SOUTH_LAT))
-//     Error_Code |= UPS_LAT_ERROR;
-//   if ((Latitude >= 0) && (Latitude < MIN_NORTH_LAT))
-//     Error_Code |= UPS_LAT_ERROR;
-//   if ((Longitude < -PI) || (Longitude > (2 * PI)))
-//   {  /* slam out of range */
-//     Error_Code |= UPS_LON_ERROR;
-//   }
-
-  if (!Error_Code)
-  {  /* no errors */
-//     if (Latitude < 0)
-//     {
-//       UPS_Origin_Latitude = -MAX_ORIGIN_LAT; 
-//       *Hemisphere = 'S';
-//     }
-//     else
-//     {
-//       UPS_Origin_Latitude = MAX_ORIGIN_LAT; 
-//       *Hemisphere = 'N';
-//     }
-
-
-    Set_Polar_Stereographic_Parameters( UPS_a,
-                                        UPS_f,
-                                        UPS_Origin_Latitude,
-                                        UPS_Origin_Longitude,
-                                        false_easting,
-                                        false_northing);
-
-    Convert_Geodetic_To_Polar_Stereographic(Latitude,
-                                            Longitude,
-                                            &tempEasting,
-                                            &tempNorthing);
-
-    UPS_Easting = UPS_False_Easting + tempEasting;
-    UPS_Northing = UPS_False_Northing + tempNorthing;
-
-
-    *Easting = UPS_Easting;
-    *Northing = UPS_Northing;
-  }  /*  END of if(!Error_Code)   */
-
-  return (Error_Code);
-}  /* END OF Convert_Geodetic_To_UPS  */
-
-
-long ossimUpsProjection::Convert_UPS_To_Geodetic(char   Hemisphere,
-                                                 double Easting,
-                                                 double Northing,
-                                                 double *Latitude,
-                                                 double *Longitude)const
-{
-/*
- *  The function Convert_UPS_To_Geodetic converts UPS (hemisphere, easting, 
- *  and northing) coordinates to geodetic (latitude and longitude) coordinates
- *  according to the current ellipsoid parameters.  If any errors occur, the 
- *  error code(s) are returned by the function, otherwise UPS_NO_ERROR is 
- *  returned.
- *
- *    Hemisphere    : Hemisphere either 'N' or 'S'              (input)
- *    Easting       : Easting/X in meters                       (input)
- *    Northing      : Northing/Y in meters                      (input)
- *    Latitude      : Latitude in radians                       (output)
- *    Longitude     : Longitude in radians                      (output)
- */
-
-  long Error_Code = UPS_NO_ERROR;
-
-//   if ((Hemisphere != 'N') && (Hemisphere != 'S'))
-//     Error_Code |= UPS_HEMISPHERE_ERROR;
-//   if ((Easting < MIN_EAST_NORTH) || (Easting > MAX_EAST_NORTH))
-//     Error_Code |= UPS_EASTING_ERROR;
-//   if ((Northing < MIN_EAST_NORTH) || (Northing > MAX_EAST_NORTH))
-//     Error_Code |= UPS_NORTHING_ERROR;
-
-  if (Hemisphere =='N')
-  {UPS_Origin_Latitude = MAX_ORIGIN_LAT;}
-  if (Hemisphere =='S')
-  {UPS_Origin_Latitude = -MAX_ORIGIN_LAT;}
-
-  if (!Error_Code)
-  {   /*  no errors   */
-    Set_Polar_Stereographic_Parameters( UPS_a,
-                                        UPS_f,
-                                        UPS_Origin_Latitude,
-                                        UPS_Origin_Longitude,
-                                        UPS_False_Easting,
-                                        UPS_False_Northing);
-
-
-
-    Convert_Polar_Stereographic_To_Geodetic( Easting,
-                                             Northing,
-                                             Latitude,
-                                             Longitude); 
-
-
-//     if ((*Latitude < 0) && (*Latitude > MIN_SOUTH_LAT))
-//       Error_Code |= UPS_LAT_ERROR;
-//     if ((*Latitude >= 0) && (*Latitude < MIN_NORTH_LAT))
-//       Error_Code |= UPS_LAT_ERROR;
-  }  /*  END OF if(!Error_Code) */
-  return (Error_Code);
-}  /*  END OF Convert_UPS_To_Geodetic  */ 
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimUpsProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimUpsProjection* p = PTR_CAST(ossimUpsProjection, &proj);
-   if (!p) return false;
-
-   if (theHemisphere != p->theHemisphere) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimUtmProjection.cpp b/ossim/src/ossim/projection/ossimUtmProjection.cpp
deleted file mode 100644
index ca454b8..0000000
--- a/ossim/src/ossim/projection/ossimUtmProjection.cpp
+++ /dev/null
@@ -1,925 +0,0 @@
-//*******************************************************************
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Geotrans Utm projection code.  
-//*******************************************************************
-//  $Id: ossimUtmProjection.cpp 20133 2011-10-12 19:03:47Z oscarkramer $
-
-#include <cstdlib>
-#include <cmath>
-using namespace std;
-
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/projection/ossimEpsgProjectionDatabase.h>
-
-RTTI_DEF1(ossimUtmProjection, "ossimUtmProjection", ossimMapProjection)
-
-/******************************* DEFINES *********************************/
-   
-#define UTM_NO_ERROR            0x0000
-#define UTM_LAT_ERROR           0x0001
-#define UTM_LON_ERROR           0x0002
-#define UTM_EASTING_ERROR       0x0004
-#define UTM_NORTHING_ERROR      0x0008
-#define UTM_ZONE_ERROR          0x0010
-#define UTM_HEMISPHERE_ERROR    0x0020
-#define UTM_ZONE_OVERRIDE_ERROR 0x0040
-#define UTM_A_ERROR             0x0080
-#define UTM_B_ERROR             0x0100
-#define UTM_A_LESS_B_ERROR      0x0200
-
-#define MIN_LAT      ( (-80.5 * M_PI) / 180.0 ) /* -80.5 degrees in radians */
-#define MAX_LAT      ( (84.5 * M_PI) / 180.0 )  /* 84.5 degrees in radians  */
-#define MAX_DELTA_LONG  ((M_PI * 90.0)/180.0)    /* 90 degrees in radians */
-#define MIN_EASTING  100000
-#define MAX_EASTING  900000
-#define MIN_NORTHING 0
-#define MAX_NORTHING 10000000
-#define MIN_SCALE_FACTOR  0.3
-#define MAX_SCALE_FACTOR  3.0
-
-#define SPHTMD(Latitude) ((double) (theTranMerc_ap * Latitude \
-      - theTranMerc_bp * sin(2.e0 * Latitude) + theTranMerc_cp * sin(4.e0 * Latitude) \
-      - theTranMerc_dp * sin(6.e0 * Latitude) + theTranMerc_ep * sin(8.e0 * Latitude) ) )
-
-#define SPHSN(Latitude) ((double) (getA() / sqrt( 1.e0 - theTranMerc_es * \
-      pow(sin(Latitude), 2))))
-
-#define SPHSR(Latitude) ((double) (getA() * (1.e0 - theTranMerc_es) / \
-    pow(DENOM(Latitude), 3)))
-
-#define DENOM(Latitude) ((double) (sqrt(1.e0 - theTranMerc_es * pow(sin(Latitude),2))))
-
-
-ossimUtmProjection::ossimUtmProjection(const ossimEllipsoid& ellipsoid,
-                                       const ossimGpt& origin)
-   :
-      ossimMapProjection(ellipsoid, origin),
-      theTranMerc_a(6378137.0),
-      theTranMerc_f(1.0/298.257223563),
-      theTranMerc_es(0.0066943799901413800),
-      theTranMerc_ebs(0.0067394967565869),
-      theTranMerc_Origin_Lat(0.0),
-      theTranMerc_Origin_Long(0.0),
-      theTranMerc_False_Northing(0.0),
-      theTranMerc_False_Easting(500000.0),
-      theTranMerc_Scale_Factor(0.9996),
-      theTranMerc_ap(6367449.1458008),
-      theTranMerc_bp(16038.508696861),
-      theTranMerc_cp(16.832613334334),
-      theTranMerc_dp(0.021984404273757),
-      theTranMerc_Delta_Easting(40000000.0),
-      theTranMerc_Delta_Northing(40000000.0),
-      theZone(1),
-      theHemisphere('N')
-      
-{
-   setZone(origin);
-   setHemisphere(origin);
-   update();
-}
-
-ossimUtmProjection::ossimUtmProjection(const ossimEllipsoid& ellipsoid,
-                                       const ossimGpt& origin,
-                                       ossim_int32 zone,
-                                       char hemisphere)
-   :
-      ossimMapProjection(ellipsoid, origin),
-      theTranMerc_a(6378137.0),
-      theTranMerc_f(1.0/298.257223563),
-      theTranMerc_es(0.0066943799901413800),
-      theTranMerc_ebs(0.0067394967565869),
-      theTranMerc_Origin_Lat(0.0),
-      theTranMerc_Origin_Long(0.0),
-      theTranMerc_False_Northing(0.0),
-      theTranMerc_False_Easting(500000.0),
-      theTranMerc_Scale_Factor(0.9996),
-      theTranMerc_ap(6367449.1458008),
-      theTranMerc_bp(16038.508696861),
-      theTranMerc_cp(16.832613334334),
-      theTranMerc_dp(0.021984404273757),
-      theTranMerc_Delta_Easting(40000000.0),
-      theTranMerc_Delta_Northing(40000000.0),
-      theZone(zone),
-      theHemisphere(hemisphere)      
-{
-   setZone(zone);
-   setHemisphere(hemisphere);
-   update();
-}
-
-ossimUtmProjection::ossimUtmProjection(ossim_int32 zone)
-   :
-      ossimMapProjection(),
-      theTranMerc_a(6378137.0),
-      theTranMerc_f(1.0/298.257223563),
-      theTranMerc_es(0.0066943799901413800),
-      theTranMerc_ebs(0.0067394967565869),
-      theTranMerc_Origin_Lat(0.0),
-      theTranMerc_Origin_Long(0.0),
-      theTranMerc_False_Northing(0.0),
-      theTranMerc_False_Easting(500000.0),
-      theTranMerc_Scale_Factor(0.9996),
-      theTranMerc_ap(6367449.1458008),
-      theTranMerc_bp(16038.508696861),
-      theTranMerc_cp(16.832613334334),
-      theTranMerc_dp(0.021984404273757),
-      theTranMerc_Delta_Easting(40000000.0),
-      theTranMerc_Delta_Northing(40000000.0),
-      theZone(zone),
-      theHemisphere('N')      
-{
-   setZone(zone);
-   update();
-}
-
-ossimUtmProjection::ossimUtmProjection(const ossimUtmProjection& src)
-      :ossimMapProjection(src),
-      theTranMerc_a(src.theTranMerc_a),
-      theTranMerc_f(src.theTranMerc_f),
-      theTranMerc_es(src.theTranMerc_es),
-      theTranMerc_ebs(src.theTranMerc_ebs),
-      theTranMerc_Origin_Lat(src.theTranMerc_Origin_Lat),
-      theTranMerc_Origin_Long(src.theTranMerc_Origin_Long),
-      theTranMerc_False_Northing(src.theTranMerc_False_Northing),
-      theTranMerc_False_Easting(src.theTranMerc_False_Easting),
-      theTranMerc_Scale_Factor(src.theTranMerc_Scale_Factor),
-      theTranMerc_ap(src.theTranMerc_ap),
-      theTranMerc_bp(src.theTranMerc_bp),
-      theTranMerc_cp(src.theTranMerc_cp),
-      theTranMerc_dp(src.theTranMerc_dp),
-      theTranMerc_Delta_Easting(src.theTranMerc_Delta_Easting),
-      theTranMerc_Delta_Northing(src.theTranMerc_Delta_Northing),
-      theZone(src.theZone),
-      theHemisphere(src.theHemisphere)      
-{
-   setZone(theZone);
-   setHemisphere(theHemisphere);
-   update();
-}
-
-void ossimUtmProjection::update()
-{
-   ossimGpt origin = theOrigin;
-   origin.lond(computeZoneMeridian(theZone));
-   origin.latd(0.0);
-   double falseNorthing = 10000000.0;
-   if (theHemisphere == 'N')
-   {
-      falseNorthing = 0.0;
-   }
-   Set_Transverse_Mercator_Parameters(theEllipsoid.getA(),
-                                      theEllipsoid.getFlattening(),
-                                      origin.latr(),
-                                      origin.lonr(),
-                                      theTranMerc_False_Easting,
-                                      falseNorthing,
-                                      theTranMerc_Scale_Factor);
-
-   theFalseEastingNorthing.x = theTranMerc_False_Easting;
-   theFalseEastingNorthing.y = theTranMerc_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-ossimGpt ossimUtmProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_Transverse_Mercator_To_Geodetic(eastingNorthing.x,
-                                           eastingNorthing.y,
-                                           &lat,
-                                           &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
-}
-
-ossimDpt ossimUtmProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Transverse_Mercator(gpt.latr(),
-                                           gpt.lonr(),
-                                           &easting,
-                                           &northing);
-   
-   return ossimDpt(easting, northing);
-}
-
-ossimObject* ossimUtmProjection::dup()const
-{
-   ossimUtmProjection* proj = new ossimUtmProjection(*this);
-   return proj;
-}
-
-ossim_int32 ossimUtmProjection::getZone() const
-{
-   return theZone;
-}
-
-char ossimUtmProjection::getHemisphere() const
-{
-   return theHemisphere;
-}
-
-void ossimUtmProjection::setOrigin(const ossimGpt& origin)
-{
-   setZone(origin);
-   // NOTE: We will not set the hemisphere if the origin latitude is 0.0.
-   if (origin.latd() != 0.0)
-   {
-      setHemisphere(origin);
-   }
-   ossimMapProjection::setOrigin(origin);
-}
-
-void ossimUtmProjection::setZone(const ossimGpt& ground)
-{
-   setZone(computeZone(ground));
-}
-
-void ossimUtmProjection::setZone(ossim_int32 zone)
-{
-   if( (zone < 1) || (zone > 60) )
-   {
-      theZone = computeZone(theOrigin);
-   }
-   else
-   {
-      theZone = zone;
-   }
-   theOrigin.lond(computeZoneMeridian(theZone));
-   theOrigin.latd(0);
-   theOrigin.datum(theDatum);
-   theTranMerc_Origin_Long = theOrigin.lonr();
-}
-
-void ossimUtmProjection::setHemisphere(const ossimGpt& ground)
-{
-   char hemisphere = ground.latd()<0.0?'S':'N';
-   setHemisphere(hemisphere);
-}
-
-void ossimUtmProjection::setHemisphere(char hemisphere)
-{
-   hemisphere = toupper(hemisphere);
-   if((hemisphere != 'N') &&
-      (hemisphere != 'S'))
-   {
-      theHemisphere = theOrigin.latd() < 0?'S':'N';
-   }
-   else
-   {
-      theHemisphere = hemisphere;
-   }
-
-   if (theHemisphere == 'N')
-   {
-      theTranMerc_False_Northing = 0.0;
-   }
-   else
-   {
-      theTranMerc_False_Northing  = 10000000.0;
-   }
-}
-
-ossim_int32 ossimUtmProjection::computeZone(const ossimGpt& ground)
-{
-   ossim_int32 result = 0;
-
-   double longitude = ground.lonr();
-   double lat_Degrees  = (ossim_int32)( (ground.latd()) + 0.00000005);
-   double long_Degrees = (ossim_int32)( (ground.lond()) + 0.00000005);
-   
-   if (longitude < M_PI)
-      result = (ossim_int32)( (31 + ((180 * longitude) / (6 * M_PI)) ) + 0.00000005);
-   else
-      result = (ossim_int32)( (((180 * longitude) / (6 * M_PI)) - 29) + 0.00000005);
-   if (result > 60)
-      result = 1;
-    /* UTM special cases */
-   if ((lat_Degrees > 55) && (lat_Degrees < 64) && (long_Degrees > -1)
-       && (long_Degrees < 3))
-      result = 31;
-   if ((lat_Degrees > 55) && (lat_Degrees < 64) && (long_Degrees > 2)
-       && (long_Degrees < 12))
-      result = 32;
-   if ((lat_Degrees > 71) && (long_Degrees > -1) && (long_Degrees < 9))
-      result = 31;
-   if ((lat_Degrees > 71) && (long_Degrees > 8) && (long_Degrees < 21))
-      result = 33;
-   if ((lat_Degrees > 71) && (long_Degrees > 20) && (long_Degrees < 33))
-      result = 35;
-   if ((lat_Degrees > 71) && (long_Degrees > 32) && (long_Degrees < 42))
-      result = 37;
-
-   return result;
-}
-
-double ossimUtmProjection::computeZoneMeridian(ossim_int32 zone)
-{
-   return (6.0 * zone - 183.0);;
-}
-
-bool ossimUtmProjection::loadState(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   const char* zone       = kwl.find(prefix, ossimKeywordNames::ZONE_KW);
-   const char* hemisphere = kwl.find(prefix, ossimKeywordNames::HEMISPHERE_KW);
-
-   ossimMapProjection::loadState(kwl, prefix);
-
-   // initialize zone to a dummy value.
-   //
-   theZone = 0;
-//   if(ossimString(type) == STATIC_TYPE_NAME(ossimUtmProjection))
-   {
-      if(!zone)
-      {
-         theZone = computeZone(theOrigin);
-      }
-      else if (zone) 
-      {
-         theZone = atoi(zone);
-
-         if( (theZone  < 1) || (theZone > 60) )
-         {
-            theZone = computeZone(theOrigin);
-         }
-         else
-         {
-//            if(!kwl.find(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW))
-//            {
-               theOrigin.lond(computeZoneMeridian(theZone));
-//            }
-//            if(!kwl.find(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW))
-//            {
-               theOrigin.latd(0);
-//            }
-         }
-      }
-      if (hemisphere)
-      {
-         ossimString s = hemisphere;
-         s = s.trim();
-         s = s.upcase();
-         
-         setHemisphere(*s.c_str());
-      }
-      else
-      {
-         char hemisphere = theOrigin.latd()<0?'S':'N';
-         setHemisphere(hemisphere);
-      }
-   }
-
-   update();
-   
-   return true;
-}
-
-bool ossimUtmProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::ZONE_KW,
-           theZone,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::HEMISPHERE_KW,
-           theHemisphere,
-           true);
-   
-   return ossimMapProjection::saveState(kwl, prefix);
-}
-   
-ossim_int32 ossimUtmProjection::Set_Transverse_Mercator_Parameters(double a,
-                                                                   double f,
-                                                                   double Origin_Latitude,
-                                                                   double Central_Meridian,
-                                                                   double False_Easting,
-                                                                   double False_Northing,
-                                                                   double /* Scale_Factor */)
-
-{ /* BEGIN Set_Tranverse_Mercator_Parameters */
-  /*
-   * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
-   * parameters and Tranverse Mercator projection parameters as inputs, and
-   * sets the corresponding state variables. If any errors occur, the error
-   * code(s) are returned by the function, otherwise UTM_NO_ERROR is
-   * returned.
-   *
-   *    a                 : Semi-major axis of ellipsoid, in meters    (input)
-   *    f                 : Flattening of ellipsoid						         (input)
-   *    Origin_Latitude   : Latitude in radians at the origin of the   (input)
-   *                         projection
-   *    Central_Meridian  : Longitude in radians at the center of the  (input)
-   *                         projection
-   *    False_Easting     : Easting/X at the center of the projection  (input)
-   *    False_Northing    : Northing/Y at the center of the projection (input)
-   *    Scale_Factor      : Projection scale factor                    (input) 
-   */
-
-  double tn;        /* True Meridianal distance constant  */
-  double tn2;
-  double tn3;
-  double tn4;
-  double tn5;
-  double dummy_northing;
-  double TranMerc_b; /* Semi-minor axis of ellipsoid, in meters */
-//  double inv_f = 1 / f;
-  ossim_int32 Error_Code = UTM_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= UTM_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= UTM_INV_F_ERROR;
-//   }
-//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
-//   { /* origin latitude out of range */
-//     Error_Code |= UTM_ORIGIN_LAT_ERROR;
-//   }
-//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= UTM_CENT_MER_ERROR;
-//   }
-//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
-//   {
-//     Error_Code |= UTM_SCALE_FACTOR_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    theTranMerc_a = a;
-    theTranMerc_f = f;
-    theTranMerc_Origin_Lat = 0;
-    theTranMerc_Origin_Long = 0;
-    theTranMerc_False_Northing = 0;
-    theTranMerc_False_Easting = 0; 
-    // theTranMerc_Scale_Factor = 1;
-
-    /* Eccentricity Squared */
-    theTranMerc_es = 2 * theTranMerc_f - theTranMerc_f * theTranMerc_f;
-    /* Second Eccentricity Squared */
-    theTranMerc_ebs = (1 / (1 - theTranMerc_es)) - 1;
-
-    TranMerc_b = theTranMerc_a * (1 - theTranMerc_f);    
-    /*True meridianal constants  */
-    tn = (theTranMerc_a - TranMerc_b) / (theTranMerc_a + TranMerc_b);
-    tn2 = tn * tn;
-    tn3 = tn2 * tn;
-    tn4 = tn3 * tn;
-    tn5 = tn4 * tn;
-
-    theTranMerc_ap = theTranMerc_a * (1.e0 - tn + 5.e0 * (tn2 - tn3)/4.e0
-                                + 81.e0 * (tn4 - tn5)/64.e0 );
-    theTranMerc_bp = 3.e0 * theTranMerc_a * (tn - tn2 + 7.e0 * (tn3 - tn4)
-                                       /8.e0 + 55.e0 * tn5/64.e0 )/2.e0;
-    theTranMerc_cp = 15.e0 * theTranMerc_a * (tn2 - tn3 + 3.e0 * (tn4 - tn5 )/4.e0) /16.0;
-    theTranMerc_dp = 35.e0 * theTranMerc_a * (tn3 - tn4 + 11.e0 * tn5 / 16.e0) / 48.e0;
-    theTranMerc_ep = 315.e0 * theTranMerc_a * (tn4 - tn5) / 512.e0;
-    Convert_Geodetic_To_Transverse_Mercator(MAX_LAT,
-                                            MAX_DELTA_LONG,
-                                            &theTranMerc_Delta_Easting,
-                                            &theTranMerc_Delta_Northing);
-    Convert_Geodetic_To_Transverse_Mercator(0,
-                                            MAX_DELTA_LONG,
-                                            &theTranMerc_Delta_Easting,
-                                            &dummy_northing);
-    theTranMerc_Origin_Lat = Origin_Latitude;
-    if (Central_Meridian > M_PI)
-      Central_Meridian -= TWO_PI;
-    theTranMerc_Origin_Long = Central_Meridian;
-    theTranMerc_False_Northing = False_Northing;
-    theTranMerc_False_Easting = False_Easting; 
-    // theTranMerc_Scale_Factor = Scale_Factor;
-  } /* END OF if(!Error_Code) */
-  return (Error_Code);
-}  /* END of Set_Transverse_Mercator_Parameters  */
-
-
-void ossimUtmProjection::Get_Transverse_Mercator_Parameters(double *a,
-                                                                      double *f,
-                                                                      double *Origin_Latitude,
-                                                                      double *Central_Meridian,
-                                                                      double *False_Easting,
-                                                                      double *False_Northing,
-                                                                      double *Scale_Factor)const
-
-{ /* BEGIN Get_Tranverse_Mercator_Parameters  */
-  /*
-   * The function Get_Transverse_Mercator_Parameters returns the current
-   * ellipsoid and Transverse Mercator projection parameters.
-   *
-   *    a                 : Semi-major axis of ellipsoid, in meters    (output)
-   *    f                 : Flattening of ellipsoid						         (output)
-   *    Origin_Latitude   : Latitude in radians at the origin of the   (output)
-   *                         projection
-   *    Central_Meridian  : Longitude in radians at the center of the  (output)
-   *                         projection
-   *    False_Easting     : Easting/X at the center of the projection  (output)
-   *    False_Northing    : Northing/Y at the center of the projection (output)
-   *    Scale_Factor      : Projection scale factor                    (output) 
-   */
-
-  *a = theTranMerc_a;
-  *f = theTranMerc_f;
-  *Origin_Latitude = theTranMerc_Origin_Lat;
-  *Central_Meridian = theTranMerc_Origin_Long;
-  *False_Easting = theTranMerc_False_Easting;
-  *False_Northing = theTranMerc_False_Northing;
-  *Scale_Factor = theTranMerc_Scale_Factor;
-  
-  return;
-} /* END OF Get_Tranverse_Mercator_Parameters */
-
-
-
-ossim_int32 ossimUtmProjection::Convert_Geodetic_To_Transverse_Mercator (double Latitude,
-                                                                            double Longitude,
-                                                                            double *Easting,
-                                                                            double *Northing)const
-   
-{      /* BEGIN Convert_Geodetic_To_Transverse_Mercator */
-
-  /*
-   * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
-   * (latitude and longitude) coordinates to Transverse Mercator projection
-   * (easting and northing) coordinates, according to the current ellipsoid
-   * and Transverse Mercator projection coordinates.  If any errors occur, the
-   * error code(s) are returned by the function, otherwise UTM_NO_ERROR is
-   * returned.
-   *
-   *    Latitude      : Latitude in radians                         (input)
-   *    Longitude     : Longitude in radians                        (input)
-   *    Easting       : Easting/X in meters                         (output)
-   *    Northing      : Northing/Y in meters                        (output)
-   */
-
-  double c;       /* Cosine of latitude                          */
-  double c2;
-  double c3;
-  double c5;
-  double c7;
-  double dlam;    /* Delta longitude - Difference in Longitude       */
-  double eta;     /* constant - theTranMerc_ebs *c *c                   */
-  double eta2;
-  double eta3;
-  double eta4;
-  double s;       /* Sine of latitude                        */
-  double sn;      /* Radius of curvature in the prime vertical       */
-  double t;       /* Tangent of latitude                             */
-  double tan2;
-  double tan3;
-  double tan4;
-  double tan5;
-  double tan6;
-  double t1;      /* Term in coordinate conversion formula - GP to Y */
-  double t2;      /* Term in coordinate conversion formula - GP to Y */
-  double t3;      /* Term in coordinate conversion formula - GP to Y */
-  double t4;      /* Term in coordinate conversion formula - GP to Y */
-  double t5;      /* Term in coordinate conversion formula - GP to Y */
-  double t6;      /* Term in coordinate conversion formula - GP to Y */
-  double t7;      /* Term in coordinate conversion formula - GP to Y */
-  double t8;      /* Term in coordinate conversion formula - GP to Y */
-  double t9;      /* Term in coordinate conversion formula - GP to Y */
-  double tmd;     /* True Meridional distance                        */
-  double tmdo;    /* True Meridional distance for latitude of origin */
-  ossim_int32    Error_Code = UTM_NO_ERROR;
-//  double temp_Origin;
-//  double temp_Long;
-
-//   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
-//   {  /* Latitude out of range */
-//     Error_Code|= UTM_LAT_ERROR;
-//   }
-   if (Longitude > M_PI)
-     Longitude -= TWO_PI;
-//   if ((Longitude < (theTranMerc_Origin_Long - MAX_DELTA_LONG))
-//       || (Longitude > (theTranMerc_Origin_Long + MAX_DELTA_LONG)))
-//   {
-//     if (Longitude < 0)
-//       temp_Long = Longitude + TWO_PI;
-//     else
-//       temp_Long = Longitude;
-//     if (theTranMerc_Origin_Long < 0)
-//       temp_Origin = theTranMerc_Origin_Long + TWO_PI;
-//     else
-//       temp_Origin = theTranMerc_Origin_Long;
-//     if ((temp_Long < (temp_Origin - MAX_DELTA_LONG))
-//         || (temp_Long > (temp_Origin + MAX_DELTA_LONG)))
-//       Error_Code|= UTM_LON_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-
-    /* 
-     *  Delta Longitude
-     */
-    dlam = Longitude - theTranMerc_Origin_Long;
-
-//     if (fabs(dlam) > (9.0 * M_PI / 180))
-//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
-//       Error_Code |= UTM_LON_WARNING;
-//     }
-
-     if (dlam > M_PI)
-       dlam -= TWO_PI;
-     if (dlam < -M_PI)
-       dlam += TWO_PI;
-     if (fabs(dlam) < 2.e-10)
-       dlam = 0.0;
-
-    s = sin(Latitude);
-    c = cos(Latitude);
-    c2 = c * c;
-    c3 = c2 * c;
-    c5 = c3 * c2;
-    c7 = c5 * c2;
-    t = tan (Latitude);
-    tan2 = t * t;
-    tan3 = tan2 * t;
-    tan4 = tan3 * t;
-    tan5 = tan4 * t;
-    tan6 = tan5 * t;
-    eta = theTranMerc_ebs * c2;
-    eta2 = eta * eta;
-    eta3 = eta2 * eta;
-    eta4 = eta3 * eta;
-
-    /* radius of curvature in prime vertical */
-    sn = SPHSN(Latitude);
-
-    /* True Meridianal Distances */
-    tmd = SPHTMD(Latitude);
-
-    /*  Origin  */
-    tmdo = SPHTMD (theTranMerc_Origin_Lat);
-
-    /* northing */
-    t1 = (tmd - tmdo) * theTranMerc_Scale_Factor;
-    t2 = sn * s * c * theTranMerc_Scale_Factor/ 2.e0;
-    t3 = sn * s * c3 * theTranMerc_Scale_Factor * (5.e0 - tan2 + 9.e0 * eta 
-                                                + 4.e0 * eta2) /24.e0; 
-
-    t4 = sn * s * c5 * theTranMerc_Scale_Factor * (61.e0 - 58.e0 * tan2
-                                                + tan4 + 270.e0 * eta - 330.e0 * tan2 * eta + 445.e0 * eta2
-                                                + 324.e0 * eta3 -680.e0 * tan2 * eta2 + 88.e0 * eta4 
-                                                -600.e0 * tan2 * eta3 - 192.e0 * tan2 * eta4) / 720.e0;
-
-    t5 = sn * s * c7 * theTranMerc_Scale_Factor * (1385.e0 - 3111.e0 * 
-                                                tan2 + 543.e0 * tan4 - tan6) / 40320.e0;
-
-    *Northing = theTranMerc_False_Northing + t1 + pow(dlam,2.e0) * t2
-                + pow(dlam,4.e0) * t3 + pow(dlam,6.e0) * t4
-                + pow(dlam,8.e0) * t5; 
-
-    /* Easting */
-    t6 = sn * c * theTranMerc_Scale_Factor;
-    t7 = sn * c3 * theTranMerc_Scale_Factor * (1.e0 - tan2 + eta ) /6.e0;
-    t8 = sn * c5 * theTranMerc_Scale_Factor * (5.e0 - 18.e0 * tan2 + tan4
-                                            + 14.e0 * eta - 58.e0 * tan2 * eta + 13.e0 * eta2 + 4.e0 * eta3 
-                                            - 64.e0 * tan2 * eta2 - 24.e0 * tan2 * eta3 )/ 120.e0;
-    t9 = sn * c7 * theTranMerc_Scale_Factor * ( 61.e0 - 479.e0 * tan2
-                                             + 179.e0 * tan4 - tan6 ) /5040.e0;
-
-    *Easting = theTranMerc_False_Easting + dlam * t6 + pow(dlam,3.e0) * t7 
-               + pow(dlam,5.e0) * t8 + pow(dlam,7.e0) * t9;
-  }
-  return (Error_Code);
-} /* END OF Convert_Geodetic_To_Transverse_Mercator */
-
-
-ossim_int32 ossimUtmProjection::Convert_Transverse_Mercator_To_Geodetic (double Easting,
-                                                                            double Northing,
-                                                                            double *Latitude,
-                                                                            double *Longitude)const
-{      /* BEGIN Convert_Transverse_Mercator_To_Geodetic */
-
-  /*
-   * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
-   * Mercator projection (easting and northing) coordinates to geodetic
-   * (latitude and longitude) coordinates, according to the current ellipsoid
-   * and Transverse Mercator projection parameters.  If any errors occur, the
-   * error code(s) are returned by the function, otherwise UTM_NO_ERROR is
-   * returned.
-   *
-   *    Easting       : Easting/X in meters                         (input)
-   *    Northing      : Northing/Y in meters                        (input)
-   *    Latitude      : Latitude in radians                         (output)
-   *    Longitude     : Longitude in radians                        (output)
-   */
-
-  double c;       /* Cosine of latitude                          */
-  double de;      /* Delta easting - Difference in Easting (Easting-Fe)    */
-  double dlam;    /* Delta longitude - Difference in Longitude       */
-  double eta;     /* constant - theTranMerc_ebs *c *c                   */
-  double eta2;
-  double eta3;
-  double eta4;
-  double ftphi;   /* Footpoint latitude                              */
-  int    i;       /* Loop iterator                   */
-  /*double s;        Sine of latitude                        */
-  double sn;      /* Radius of curvature in the prime vertical       */
-  double sr;      /* Radius of curvature in the meridian             */
-  double t;       /* Tangent of latitude                             */
-  double tan2;
-  double tan4;
-  double t10;     /* Term in coordinate conversion formula - GP to Y */
-  double t11;     /* Term in coordinate conversion formula - GP to Y */
-  double t12;     /* Term in coordinate conversion formula - GP to Y */
-  double t13;     /* Term in coordinate conversion formula - GP to Y */
-  double t14;     /* Term in coordinate conversion formula - GP to Y */
-  double t15;     /* Term in coordinate conversion formula - GP to Y */
-  double t16;     /* Term in coordinate conversion formula - GP to Y */
-  double t17;     /* Term in coordinate conversion formula - GP to Y */
-  double tmd;     /* True Meridional distance                        */
-  double tmdo;    /* True Meridional distance for latitude of origin */
-  ossim_int32 Error_Code = UTM_NO_ERROR;
-
-//   if ((Easting < (theTranMerc_False_Easting - theTranMerc_Delta_Easting))
-//       ||(Easting > (theTranMerc_False_Easting + theTranMerc_Delta_Easting)))
-//   { /* Easting out of range  */
-//     Error_Code |= UTM_EASTING_ERROR;
-//   }
-//   if ((Northing < (theTranMerc_False_Northing - theTranMerc_Delta_Northing))
-//       || (Northing > (theTranMerc_False_Northing + theTranMerc_Delta_Northing)))
-//   { /* Northing out of range */
-//     Error_Code |= UTM_NORTHING_ERROR;
-//   }
-
-  if (!Error_Code)
-  {
-    /* True Meridional Distances for latitude of origin */
-    tmdo = SPHTMD(theTranMerc_Origin_Lat);
-
-    /*  Origin  */
-    tmd = tmdo +  (Northing - theTranMerc_False_Northing) / theTranMerc_Scale_Factor; 
-
-    /* First Estimate */
-    sr = SPHSR(0.e0);
-    ftphi = tmd/sr;
-
-    for (i = 0; i < 5 ; i++)
-    {
-      t10 = SPHTMD (ftphi);
-      sr = SPHSR(ftphi);
-      ftphi = ftphi + (tmd - t10) / sr;
-    }
-
-    /* Radius of Curvature in the meridian */
-    sr = SPHSR(ftphi);
-
-    /* Radius of Curvature in the meridian */
-    sn = SPHSN(ftphi);
-
-    /* Sine Cosine terms */
-    // s = sin(ftphi);
-    c = cos(ftphi);
-
-    /* Tangent Value  */
-    t = tan(ftphi);
-    tan2 = t * t;
-    tan4 = tan2 * tan2;
-    eta = theTranMerc_ebs * pow(c,2);
-    eta2 = eta * eta;
-    eta3 = eta2 * eta;
-    eta4 = eta3 * eta;
-    de = Easting - theTranMerc_False_Easting;
-    if (fabs(de) < 0.0001)
-      de = 0.0;
-
-    /* Latitude */
-    t10 = t / (2.e0 * sr * sn * pow(theTranMerc_Scale_Factor, 2));
-    t11 = t * (5.e0  + 3.e0 * tan2 + eta - 4.e0 * pow(eta,2)
-               - 9.e0 * tan2 * eta) / (24.e0 * sr * pow(sn,3) 
-                                       * pow(theTranMerc_Scale_Factor,4));
-    t12 = t * (61.e0 + 90.e0 * tan2 + 46.e0 * eta + 45.E0 * tan4
-               - 252.e0 * tan2 * eta  - 3.e0 * eta2 + 100.e0 
-               * eta3 - 66.e0 * tan2 * eta2 - 90.e0 * tan4
-               * eta + 88.e0 * eta4 + 225.e0 * tan4 * eta2
-               + 84.e0 * tan2* eta3 - 192.e0 * tan2 * eta4)
-          / ( 720.e0 * sr * pow(sn,5) * pow(theTranMerc_Scale_Factor, 6) );
-    t13 = t * ( 1385.e0 + 3633.e0 * tan2 + 4095.e0 * tan4 + 1575.e0 
-                * pow(t,6))/ (40320.e0 * sr * pow(sn,7) * pow(theTranMerc_Scale_Factor,8));
-    *Latitude = ftphi - pow(de,2) * t10 + pow(de,4) * t11 - pow(de,6) * t12 
-                + pow(de,8) * t13;
-
-    t14 = 1.e0 / (sn * c * theTranMerc_Scale_Factor);
-
-    t15 = (1.e0 + 2.e0 * tan2 + eta) / (6.e0 * pow(sn,3) * c * 
-                                        pow(theTranMerc_Scale_Factor,3));
-
-    t16 = (5.e0 + 6.e0 * eta + 28.e0 * tan2 - 3.e0 * eta2
-           + 8.e0 * tan2 * eta + 24.e0 * tan4 - 4.e0 
-           * eta3 + 4.e0 * tan2 * eta2 + 24.e0 
-           * tan2 * eta3) / (120.e0 * pow(sn,5) * c  
-                             * pow(theTranMerc_Scale_Factor,5));
-
-    t17 = (61.e0 +  662.e0 * tan2 + 1320.e0 * tan4 + 720.e0 
-           * pow(t,6)) / (5040.e0 * pow(sn,7) * c 
-                          * pow(theTranMerc_Scale_Factor,7));
-
-    /* Difference in Longitude */
-    dlam = de * t14 - pow(de,3) * t15 + pow(de,5) * t16 - pow(de,7) * t17;
-
-    /* Longitude */
-    (*Longitude) = theTranMerc_Origin_Long + dlam;
-    while (*Latitude > (90.0 * RAD_PER_DEG))
-    {
-      *Latitude = M_PI - *Latitude;
-      *Longitude += M_PI;
-      if (*Longitude > M_PI)
-        *Longitude -= TWO_PI;
-    }
-
-     while (*Latitude < (-90.0 * RAD_PER_DEG))
-     {
-       *Latitude = - (*Latitude + M_PI);
-       *Longitude += M_PI;
-       if (*Longitude > M_PI)
-         *Longitude -= TWO_PI;
-     }
-     if (*Longitude > TWO_PI)
-       *Longitude -= TWO_PI;
-     if (*Longitude < -M_PI)
-       *Longitude += TWO_PI;
-
-//     if (fabs(dlam) > (9.0 * M_PI / 180))
-//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
-//       Error_Code |= UTM_LON_WARNING;
-//     }
-  }
-  return (Error_Code);
-} /* END OF Convert_Transverse_Mercator_To_Geodetic */
-
-std::ostream& ossimUtmProjection::print(std::ostream& out) const
-{
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << "// ossimUtmProjection::print"
-       << "\ntheZone:  " << theZone
-       << "\ntheHemisphere:  " << theHemisphere
-       << endl;
-   return ossimMapProjection::print(out);
-}
-
-double ossimUtmProjection::getFalseEasting() const
-{
-   return theTranMerc_False_Easting;
-}
-
-double ossimUtmProjection::getFalseNorthing() const
-{
-   return theTranMerc_False_Northing;
-}
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimUtmProjection::operator==(const ossimProjection& proj) const
-{
-   bool result = false;
-   if ( this == &proj )
-   {
-      result = true; // Pointer addresses the same.
-   }
-   else
-   {
-      //---
-      // Check our stuff first.  No sense going onto ossimMapProjection::operator==
-      // if we are not a utm projection.
-      //---
-      const ossimUtmProjection* p = dynamic_cast<const ossimUtmProjection*>(&proj);
-      if ( p )
-      {
-         if ( theZone == p->theZone )
-         {
-            if ( theHemisphere == p->theHemisphere )
-            {
-               result = ossimMapProjection::operator==(proj);
-            }
-         }
-      }
-   }
-   return result;   
-}
diff --git a/ossim/src/ossim/projection/ossimUtmpt.cpp b/ossim/src/ossim/projection/ossimUtmpt.cpp
deleted file mode 100644
index ab5060d..0000000
--- a/ossim/src/ossim/projection/ossimUtmpt.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// This is the Universal Transverse Mercator (UTM) point.  Allows
-// easy onversion between different coordinates.
-//*******************************************************************
-//  $Id: ossimUtmpt.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/projection/ossimUtmpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimEcefPoint.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/projection/ossimUtm.h>
-
-ossimUtmpt::ossimUtmpt(const ossimGpt &aPt)
-{
-   convertFromGround(aPt);
-}
-
-ossimUtmpt::ossimUtmpt(const ossimEcefPoint &aPt)
-{
-   convertFromGround(ossimGpt(aPt));
-}
-
-ossimUtmpt::ossimUtmpt(long         zone,
-                       char         hemisphere,  // N or S
-                       double       easting,
-                       double       northing,
-                       const ossimDatum* datum)
-   :
-      theZone       (zone),
-      theHemisphere (hemisphere),
-      theEasting    (easting),
-      theNorthing   (northing),
-      theDatum      (datum)
-{}
-
-void ossimUtmpt::convertFromGround(const ossimGpt &aPt)
-{
-   const ossimDatum *aDatum = aPt.datum();
-
-   if(aDatum)
-   {
-      //call Geotrans init code
-      Set_UTM_Parameters(aDatum->ellipsoid()->a(), aDatum->ellipsoid()->flattening(), 0);
-      Convert_Geodetic_To_UTM(aPt.latr(),
-                              aPt.lonr(),
-                              &theZone,
-                              &theHemisphere,
-                              &theEasting,
-                              &theNorthing);
-      theDatum = aDatum;
-   }
-   else
-   {
-      //ERROR: Should never happen
-   }
-}
-
-void ossimUtmpt::convertToGround(ossimGpt &aPt)
-{
-   Set_UTM_Parameters( theDatum->ellipsoid()->a(),
-                       theDatum->ellipsoid()->flattening(),
-                       0 );
-   
-   double latitude  = 0.0;
-   double longitude = 0.0;
-
-   Convert_UTM_To_Geodetic( zone(),
-                            hemisphere(),
-                            easting(),
-                            northing(),
-                            &latitude,
-                            &longitude );
-
-   aPt.latr(latitude);
-   aPt.lonr(longitude);
-   aPt.datum(theDatum);
-}
-
diff --git a/ossim/src/ossim/projection/ossimVanDerGrintenProjection.cpp b/ossim/src/ossim/projection/ossimVanDerGrintenProjection.cpp
deleted file mode 100644
index 8626e8c..0000000
--- a/ossim/src/ossim/projection/ossimVanDerGrintenProjection.cpp
+++ /dev/null
@@ -1,524 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-// Description:
-//
-// Calls Grinten projection code.  
-//*******************************************************************
-//  $Id: ossimVanDerGrintenProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
-#include <ossim/projection/ossimVanDerGrintenProjection.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-RTTI_DEF1(ossimVanDerGrintenProjection, "ossimVanDerGrintenProjection", ossimMapProjection)
-   
-/***************************************************************************/
-/*
- *                               DEFINES
- */
-
-#ifndef PI_OVER_2
-#  define PI_OVER_2  ( M_PI / 2.0)
-#endif
-#ifndef TWO_PI
-#  define TWO_PI     (2.0 * M_PI)
-#endif
-
-#define MAX_LAT     ( 90.0 * (M_PI / 180.0) )  /* 90 degrees in radians   */
-#define FLOAT_EQ(x,v,epsilon)   (((v - epsilon) < x) && (x < (v + epsilon)))
-
-#define GRIN_NO_ERROR           0x0000
-#define GRIN_LAT_ERROR          0x0001
-#define GRIN_LON_ERROR          0x0002
-#define GRIN_EASTING_ERROR      0x0004
-#define GRIN_NORTHING_ERROR     0x0008
-#define GRIN_CENT_MER_ERROR     0x0020
-#define GRIN_A_ERROR            0x0040
-#define GRIN_B_ERROR            0x0080
-#define GRIN_A_LESS_B_ERROR     0x0100
-#define GRIN_RADIUS_ERROR		  0x0200
-
-/***************************************************************************/
-/*
- *                               GLOBALS
- */
-
-const double TWO_OVER_PI = (2.0 / M_PI);
-const double PI_OVER_3 = (M_PI / 3.0);
-const double ONE_THIRD  = (1.0 / 3.0);
-
-
-ossimVanDerGrintenProjection::ossimVanDerGrintenProjection(const ossimEllipsoid& ellipsoid,
-                                                           const ossimGpt& origin)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   setDefaults();
-   update();
-}
-
-ossimVanDerGrintenProjection::ossimVanDerGrintenProjection(const ossimEllipsoid& ellipsoid,
-                                                   const ossimGpt& origin,
-                                                   double falseEasting,
-                                                   double falseNorthing)
-   :ossimMapProjection(ellipsoid, origin)
-{
-   Grin_False_Easting  = falseEasting;
-   Grin_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimVanDerGrintenProjection::update()
-{   
-   Set_Van_der_Grinten_Parameters(theEllipsoid.getA(),
-                                  theEllipsoid.getFlattening(),
-                                  theOrigin.lonr(),
-                                  Grin_False_Easting,
-                                  Grin_False_Northing);
-
-   theFalseEastingNorthing.x = Grin_False_Easting;
-   theFalseEastingNorthing.y = Grin_False_Northing;
-
-   ossimMapProjection::update();
-}
-
-void ossimVanDerGrintenProjection::setFalseEasting(double falseEasting)
-{
-   Grin_False_Easting = falseEasting;
-   
-   update();
-}
-
-void ossimVanDerGrintenProjection::setFalseNorthing(double falseNorthing)
-{
-   Grin_False_Northing = falseNorthing;
-   
-   update();
-}
-
-void ossimVanDerGrintenProjection::setDefaults()
-{
-   Grin_False_Easting  = 0.0;
-   Grin_False_Northing = 0.0;
-}
-
-void ossimVanDerGrintenProjection::setCentralMeridian(double centralMeridian)
-{
-  Grin_Origin_Long = centralMeridian;
-  update();
-}
-
-void ossimVanDerGrintenProjection::setFalseEastingNorthing(double falseEasting,
-                                                           double falseNorthing)
-{
-   Grin_False_Easting  = falseEasting;
-   Grin_False_Northing = falseNorthing;
-   
-   update();
-}
-
-ossimGpt ossimVanDerGrintenProjection::inverse(const ossimDpt &eastingNorthing)const
-{
-   double lat = 0.0;
-   double lon = 0.0;
-   
-   Convert_Van_der_Grinten_To_Geodetic(eastingNorthing.x,
-                                       eastingNorthing.y,
-                                       &lat,
-                                       &lon);
-   
-   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
-}
-
-ossimDpt ossimVanDerGrintenProjection::forward(const ossimGpt &latLon)const
-{
-   double easting  = 0.0;
-   double northing = 0.0;
-   ossimGpt gpt = latLon;
-   
-   if (theDatum)
-   {
-      if (theDatum->code() != latLon.datum()->code())
-      {
-         gpt.changeDatum(theDatum); // Shift to our datum.
-      }
-   }
-
-   Convert_Geodetic_To_Van_der_Grinten(gpt.latr(),
-                                       gpt.lonr(),
-                                       &easting,
-                                       &northing);
-   return ossimDpt(easting, northing);
-}
-
-bool ossimVanDerGrintenProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
-{
-   return ossimMapProjection::saveState(kwl, prefix);   
-}
-
-bool ossimVanDerGrintenProjection::loadState(const ossimKeywordlist& kwl,
-                                             const char* prefix)
-{
-   bool flag = ossimMapProjection::loadState(kwl, prefix);
-   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   
-   setDefaults();
-
-   if(ossimString(type) == STATIC_TYPE_NAME(ossimVanDerGrintenProjection))
-   {
-      Grin_False_Easting  = theFalseEastingNorthing.x;
-      Grin_False_Northing = theFalseEastingNorthing.y;
-   }
-   
-   update();
-
-   return flag;
-
-}
-
-/***************************************************************************/
-/*
- *                              FUNCTIONS
- */
-
-
-long ossimVanDerGrintenProjection::Set_Van_der_Grinten_Parameters(double a,
-                                                                  double f,
-                                                                  double Central_Meridian,
-                                                                  double False_Easting,
-                                                                  double False_Northing)
-
-{ /* BEGIN Set_Van_der_Grinten_Parameters */
-/*
- * The function Set_Van_der_Grinten_Parameters receives the ellipsoid parameters and
- * projection parameters as inputs, and sets the corresponding state
- * variables.  If any errors occur, the error code(s) are returned by the function, 
- * otherwise Grin_NO_ERROR is returned.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (input)
- *    f                 : Flattening of ellipsoid							      (input)
- *    Central_Meridian  : Longitude in radians at the center of     (input)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (input)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (input)
- */
-
-//  double inv_f = 1 / f;
-  long Error_Code = GRIN_NO_ERROR;
-
-//   if (a <= 0.0)
-//   { /* Semi-major axis must be greater than zero */
-//     Error_Code |= GRIN_A_ERROR;
-//   }
-//   if ((inv_f < 250) || (inv_f > 350))
-//   { /* Inverse flattening must be between 250 and 350 */
-//     Error_Code |= GRIN_INV_F_ERROR;
-//   }
-//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
-//   { /* origin longitude out of range */
-//     Error_Code |= GRIN_CENT_MER_ERROR;
-//   }
-  if (!Error_Code)
-  { /* no errors */
-    Grin_a = a;
-    Grin_f = f;
-    es2 = 2 * Grin_f - Grin_f * Grin_f;
-    es4 = es2 * es2;
-    es6 = es4 * es2;
-    /* spherical radius */
-    Ra = Grin_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 /3024.0);
-    PI_Ra = M_PI * Ra;
-//     if (Central_Meridian > M_PI)
-//       Central_Meridian -= TWO_PI;
-    Grin_Origin_Long    = Central_Meridian;
-    Grin_False_Easting  = False_Easting;
-    Grin_False_Northing = False_Northing;
-
-  } /* END OF if(!Error_Code) */
-  return (Error_Code);
-} /* END OF Set_Van_der_Grinten_Parameters */
-
-
-void ossimVanDerGrintenProjection::Get_Van_der_Grinten_Parameters(double *a,
-                                                                  double *f,
-                                                                  double *Central_Meridian,
-                                                                  double *False_Easting,
-                                                                  double *False_Northing)const
-
-{ /* BEGIN Get_Van_der_Grinten_Parameters */
-/*
- * The function Get_Van_der_Grinten_Parameters returns the current ellipsoid
- * parameters, and Van Der Grinten projection parameters.
- *
- *    a                 : Semi-major axis of ellipsoid, in meters   (output)
- *    f                 : Flattening of ellipsoid						        (output)
- *    Central_Meridian  : Longitude in radians at the center of     (output)
- *                          the projection
- *    False_Easting     : A coordinate value in meters assigned to the
- *                          central meridian of the projection.     (output)
- *    False_Northing    : A coordinate value in meters assigned to the
- *                          origin latitude of the projection       (output)
- */
-
-  *a = Grin_a;
-  *f = Grin_f;
-  *Central_Meridian = Grin_Origin_Long;
-  *False_Easting = Grin_False_Easting;
-  *False_Northing = Grin_False_Northing;
-  
-  return;
-} /* END OF Get_Van_der_Grinten_Parameters */
-
-
-long ossimVanDerGrintenProjection::Convert_Geodetic_To_Van_der_Grinten (double Latitude,
-                                                                        double Longitude,
-                                                                        double *Easting,
-                                                                        double *Northing)const
-
-{ /* BEGIN Convert_Geodetic_To_Van_der_Grinten */
-/*
- * The function Convert_Geodetic_To_Van_der_Grinten converts geodetic (latitude and
- * longitude) coordinates to Van Der Grinten projection (easting and northing)
- * coordinates, according to the current ellipsoid and Van Der Grinten projection
- * parameters.  If any errors occur, the error code(s) are returned by the
- * function, otherwise GRIN_NO_ERROR is returned.
- *
- *    Latitude          : Latitude (phi) in radians           (input)
- *    Longitude         : Longitude (lambda) in radians       (input)
- *    Easting           : Easting (X) in meters               (output)
- *    Northing          : Northing (Y) in meters              (output)
- */
-
-  double dlam;                      /* Longitude - Central Meridan */
-  double aa, aasqr;
-  double gg;
-  double pp, ppsqr;
-  double gg_MINUS_ppsqr, ppsqr_PLUS_aasqr;
-  double in_theta;
-  double theta;
-  double sin_theta, cos_theta;
-  double qq;
-  long   Error_Code = GRIN_NO_ERROR;
-
-//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
-//   {  /* Latitude out of range */
-//     Error_Code |= GRIN_LAT_ERROR;
-//   }
-//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
-//   {  /* Longitude out of range */
-//     Error_Code|= GRIN_LON_ERROR;
-//   }
-
-  if (!Error_Code)
-  { /* no errors */
-
-    dlam = Longitude - Grin_Origin_Long;
-//     if (dlam > M_PI)
-//     {
-//       dlam -= TWO_PI;
-//     }
-//     if (dlam < -M_PI)
-//     {
-//       dlam += TWO_PI;
-//     }
-
-    if (Latitude == 0.0)
-    {
-      *Easting = Ra * dlam + Grin_False_Easting;
-      *Northing = 0.0;
-    }
-    else if (dlam == 0.0 || FLOAT_EQ(Latitude,MAX_LAT,.00001)  || FLOAT_EQ(Latitude,-MAX_LAT,.00001))
-    {
-      in_theta = fabs(TWO_OVER_PI * Latitude);
-
-      if (in_theta > 1.0)
-        in_theta = 1.0;
-      else if (in_theta < -1.0)
-        in_theta = -1.0;
-
-      theta = asin(in_theta);
-      *Easting = 0.0;
-      *Northing = PI_Ra * tan(theta / 2) + Grin_False_Northing;
-      if (Latitude < 0.0)
-        *Northing *= -1.0;
-    }
-    else
-    {
-      aa = 0.5 * fabs(M_PI / dlam - dlam / M_PI);
-      in_theta = fabs(TWO_OVER_PI * Latitude);
-
-      if (in_theta > 1.0)
-        in_theta = 1.0;
-      else if (in_theta < -1.0)
-        in_theta = -1.0;
-
-      theta = asin(in_theta);
-      sin_theta = sin(theta);
-      cos_theta = cos(theta);
-      gg = cos_theta / (sin_theta + cos_theta - 1);
-      pp = gg * (2 / sin_theta - 1);
-      aasqr = aa * aa;
-      ppsqr = pp * pp;
-      gg_MINUS_ppsqr = gg - ppsqr;
-      ppsqr_PLUS_aasqr = ppsqr + aasqr;
-      qq = aasqr + gg;
-      *Easting = PI_Ra * (aa * (gg_MINUS_ppsqr) +
-                          sqrt(aasqr * (gg_MINUS_ppsqr) * (gg_MINUS_ppsqr) -
-                               (ppsqr_PLUS_aasqr) * (gg * gg - ppsqr))) / 
-                 (ppsqr_PLUS_aasqr) + Grin_False_Easting;
-      if (dlam < 0.0)
-        *Easting *= -1.0;
-      *Northing = PI_Ra * (pp * qq - aa * sqrt ((aasqr + 1) * (ppsqr_PLUS_aasqr) - qq * qq)) /
-                  (ppsqr_PLUS_aasqr) + Grin_False_Northing;
-      if (Latitude < 0.0)
-        *Northing *= -1.0;
-    }
-  }
-  return (Error_Code);
-
-} /* END OF Convert_Geodetic_To_Van_der_Grinten */
-
-
-long ossimVanDerGrintenProjection::Convert_Van_der_Grinten_To_Geodetic(double Easting,
-                                                                       double Northing,
-                                                                       double *Latitude,
-                                                                       double *Longitude)const
-{ /* BEGIN Convert_Van_der_Grinten_To_Geodetic */
-/*
- * The function Convert_Van_der_Grinten_To_Geodetic converts Grinten projection
- * (easting and northing) coordinates to geodetic (latitude and longitude)
- * coordinates, according to the current ellipsoid and Grinten projection
- * coordinates.  If any errors occur, the error code(s) are returned by the
- * function, otherwise GRIN_NO_ERROR is returned.
- *
- *    Easting           : Easting (X) in meters                  (input)
- *    Northing          : Northing (Y) in meters                 (input)
- *    Latitude          : Latitude (phi) in radians              (output)
- *    Longitude         : Longitude (lambda) in radians          (output)
- */
-
-  double dx, dy;
-  double xx, xxsqr;
-  double yy, yysqr, two_yysqr;
-  double xxsqr_PLUS_yysqr;
-  double c1;
-  double c2;
-  double c3, c3sqr;
-  double c2_OVER_3c3;
-  double dd;
-  double a1;
-  double m1;
-  double i;
-  double theta1;
-//  double temp;
-//  const double epsilon = 1.0e-2;
-
-  long Error_Code = GRIN_NO_ERROR;
-
-//   if ((Easting > (Grin_False_Easting + PI_Ra + epsilon)) ||
-//       (Easting < (Grin_False_Easting - PI_Ra - epsilon)))
-//   { /* Easting out of range */
-//     Error_Code |= GRIN_EASTING_ERROR;
-//   }
-//   if ((Northing > (Grin_False_Northing + PI_Ra + epsilon)) ||
-//       (Northing < (Grin_False_Northing - PI_Ra - epsilon)))
-//   { /* Northing out of range */
-//     Error_Code |= GRIN_NORTHING_ERROR;
-//   }
-//   if (!Error_Code)
-//   {
-//     temp = sqrt(Easting * Easting + Northing * Northing);     
-
-//     if ((temp > (Grin_False_Easting + PI_Ra + epsilon)) || 
-//         (temp > (Grin_False_Northing + PI_Ra + epsilon)) ||
-//         (temp < (Grin_False_Easting - PI_Ra - epsilon)) || 
-//         (temp < (Grin_False_Northing - PI_Ra - epsilon)))
-//     { /* Point is outside of projection area */
-//       Error_Code |= GRIN_RADIUS_ERROR;
-//     }
-//   }
-
-  if (!Error_Code)
-  {
-    dy = Northing - Grin_False_Northing;
-    dx = Easting - Grin_False_Easting;
-    xx = dx / PI_Ra;
-    yy = dy / PI_Ra;
-    xxsqr = xx * xx;
-    yysqr = yy * yy;
-    xxsqr_PLUS_yysqr = xxsqr + yysqr;
-    two_yysqr = 2 * yysqr;
-
-    if (Northing == 0.0)
-      *Latitude = 0.0;
-
-    else
-    {
-      c1 = - fabs(yy) * (1 + xxsqr_PLUS_yysqr);
-      c2 = c1 - two_yysqr + xxsqr;
-      c3 = - 2 * c1 + 1 + two_yysqr + (xxsqr_PLUS_yysqr) * (xxsqr_PLUS_yysqr);
-      c2_OVER_3c3 = c2 / (3.0 * c3);
-      c3sqr = c3 * c3;
-      dd = yysqr / c3 + ((2 * c2 * c2 * c2) / (c3sqr * c3) - (9 * c1 * c2) / (c3sqr)) / 27;
-      a1 = (c1 - c2 * c2_OVER_3c3) /c3;
-      m1 = 2 * sqrt(-ONE_THIRD * a1);
-      i = 3 * dd/ (a1 * m1);
-      if ((i > 1.0)||(i < -1.0))
-        *Latitude = MAX_LAT;
-      else
-      {
-        theta1 = ONE_THIRD * acos(3 * dd / (a1 * m1));
-        *Latitude = M_PI * (-m1 * cos(theta1 + PI_OVER_3) - c2_OVER_3c3);
-      }
-    }
-    if (Northing < 0.0)
-      *Latitude *= -1.0;
-
-    if (xx == 0.0)
-      *Longitude = Grin_Origin_Long;
-    else
-    {
-      *Longitude = M_PI * (xxsqr_PLUS_yysqr - 1 + 
-                         sqrt(1 + (2 * xxsqr - two_yysqr) + (xxsqr_PLUS_yysqr) * (xxsqr_PLUS_yysqr))) / 
-                   (2 * xx) + Grin_Origin_Long;
-    }
-//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
-//       *Latitude = PI_OVER_2;
-//     else if (*Latitude < -PI_OVER_2)
-//       *Latitude = -PI_OVER_2;
-
-//     if (*Longitude > M_PI)
-//       *Longitude -= TWO_PI;
-//     if (*Longitude < -M_PI)
-//       *Longitude += TWO_PI;
-
-//     if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
-//       *Longitude = M_PI;
-//     else if (*Longitude < -M_PI)
-//       *Longitude = -M_PI;
-
-  }
-  return (Error_Code);
-
-} /* END OF Convert_Van_der_Grinten_To_Geodetic */
-
-//*************************************************************************************************
-//! Returns TRUE if principal parameters are within epsilon tolerance.
-//*************************************************************************************************
-bool ossimVanDerGrintenProjection::operator==(const ossimProjection& proj) const
-{
-   if (!ossimMapProjection::operator==(proj))
-      return false;
-
-   ossimVanDerGrintenProjection* p = PTR_CAST(ossimVanDerGrintenProjection, &proj);
-   if (!p) return false;
-
-   if (!ossim::almostEqual(Grin_Origin_Long,p->Grin_Origin_Long)) return false;
-
-   return true;
-}
diff --git a/ossim/src/ossim/projection/ossimWktProjectionFactory.cpp b/ossim/src/ossim/projection/ossimWktProjectionFactory.cpp
deleted file mode 100644
index 985b9e4..0000000
--- a/ossim/src/ossim/projection/ossimWktProjectionFactory.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-//*************************************************************************************************
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Oscar Kramer
-//
-// DESCRIPTION:
-// Projection Factory for EPSG coded projections. These are projections
-// that are fully defined in database files and specified via a projection coordinate system (PCS)
-// code.
-//
-//*************************************************************************************************
-//  $Id: ossimWktProjectionFactory.cpp 23379 2015-06-17 19:17:24Z okramer $
-
-#include <ossim/projection/ossimWktProjectionFactory.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimCylEquAreaProjection.h>
-#include <ossim/projection/ossimTransMercatorProjection.h>
-#include <ossim/projection/ossimMercatorProjection.h>
-#include <ossim/projection/ossimLambertConformalConicProjection.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimEpsgProjectionDatabase.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimEpsgDatumFactory.h>
-#include <ossim/support_data/ossimWkt.h>
-#include <sstream>
-
-ossimWktProjectionFactory* ossimWktProjectionFactory::m_instance = 0;
-
-static const ossimString WKT_MAGIC("WKT_PCS");
-
-/*************************************************************************************************
- * Sample WKT string (for reference, line feeds and spaces added for human readability)
- *
- * PROJCS["NAD_1983_HARN_Lambert_Conformal_Conic",
- *        GEOGCS["GCS_North_American_1983_HARN",
- *               DATUM["NAD83_High_Accuracy_Regional_Network",
- *                     SPHEROID["GRS_1980",6378137,298.257222101, AUTHORITY["EPSG","7019"]],
- *                     AUTHORITY["EPSG","6152"]],
- *               PRIMEM["Greenwich",0],
- *               UNIT["degree",0.0174532925199433]],
- *        PROJECTION["Lambert_Conformal_Conic_2SP"],
- *        PARAMETER["standard_parallel_1",43],
- *        PARAMETER["standard_parallel_2",45.5],
- *        PARAMETER["latitude_of_origin",41.75],
- *        PARAMETER["central_meridian",-120.5],
- *        PARAMETER["false_easting",1312335.958005249],
- *        PARAMETER["false_northing",0],
- *        UNIT["foot",0.3048, AUTHORITY["EPSG","9002"]]]
- *
- * Another sample (with EPSG at the top for easy instantiation of full projection):
- *
- * PROJCS["WGS 84 / UTM zone 41N",
- *        AUTHORITY["EPSG","32641"],
- *        GEOGCS["WGS 84",
- *               DATUM["WGS_1984",
- *                     SPHEROID["WGS 84",6378137,298.2572235630016, AUTHORITY["EPSG","7030"]],
- *                     AUTHORITY["EPSG","6326"]],
- *               PRIMEM["Greenwich",0],
- *               UNIT["degree",0.0174532925199433]],
- *        PROJECTION["Transverse_Mercator"],
- *        PARAMETER["latitude_of_origin",0],
- *        PARAMETER["central_meridian",63],
- *        PARAMETER["scale_factor",0.9996],
- *        PARAMETER["false_easting",500000],
- *        PARAMETER["false_northing",0],
- *        UNIT["metre",1, AUTHORITY["EPSG","9001"]]]
- *
- **************************************************************************************************/
-
-//*************************************************************************************************
-//! Implements singleton pattern
-//*************************************************************************************************
-ossimWktProjectionFactory* ossimWktProjectionFactory::instance()
-{
-   if (!m_instance)
-      m_instance = new ossimWktProjectionFactory;
-   return m_instance;
-}
-
-//*************************************************************************************************
-//! Loads all SRS CSV files specified in the ossim prefs
-//*************************************************************************************************
-void ossimWktProjectionFactory::loadRecords() const
-{
-   // Fetch filename of WKT projection DB file specified in ossim_preferences:
-   ossimFilename db_name = ossimPreferences::instance()->preferencesKWL().find("wkt_database_file");
-   if (!db_name.isReadable())
-      return;
-
-   // Create only once outside the loop:
-   ossimString format_id;
-   ossimString line;
-
-   // Open the DB file:
-   std::ifstream db_stream(db_name.chars());
-   bool good_file = false;
-   if (db_stream.good())
-   {
-      // Format specification implied in file's magic number:
-      std::getline(db_stream, format_id.string());
-      format_id.trim();
-      if (format_id == WKT_MAGIC)
-         good_file = true;
-   }
-   if (!good_file)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimWktProjectionDatabase::loadRecords() -- Encountered bad WKT database file <"
-            << db_name << ">. Skipping this file." << endl;
-      db_stream.close();
-      return;
-   }
-
-   // The file is good. Skip over the column descriptor line:
-   std::getline(db_stream, line.string());
-
-   // Loop to read all data records:
-   while (!db_stream.eof())
-   {
-      std::getline(db_stream, line.string());
-      std::vector<ossimString> csvRecord = line.explode(","); // ONLY CSV FILES CONSIDERED HERE
-      if (csvRecord.size())
-      {
-         std::pair<std::string, ossim_uint32> projRecord;
-         projRecord.first = csvRecord[1].string();
-         projRecord.second = csvRecord[0].toUInt32();
-         m_wktProjRecords.insert(projRecord);
-      }
-   }
-
-//   for ( std::map<ossimString, ossim_uint32>::const_iterator it = m_wktProjRecords.begin();
-//         it != m_wktProjRecords.end(); it++)
-//     cout << "[" << it->first << ", " << it->second << "]"<<endl;
-
-   db_stream.close();
-}
-
-//*************************************************************************************************
-//! From keywordlist (as generated typically by ossimWkt class)
-//*************************************************************************************************
-ossimProjection* ossimWktProjectionFactory::createProjection(const ossimKeywordlist &keywordList,
-                                                             const char *prefix) const
-{
-   // The WKT for the horizontal projection may be part of a compound coordinate system, as
-   // indicated by the "COMPD_CS" prefix. Need to remove that prefix first.
-   ossimString compd_cs ("COMPD_CS.");
-   ossimKeywordlist temp_kwl (keywordList);
-   temp_kwl.stripPrefixFromAll(compd_cs);
-
-   ossimProjection* proj = 0;
-   ossimString pcs_name = temp_kwl.find(prefix, "PROJCS.name");
-   if (pcs_name.empty())
-      return 0;
-
-   if (m_wktProjRecords.empty())
-      loadRecords();
-
-   // Search the WKT DB for a mapping of projection name to EPSG code. This should take care of
-   // majority of cases, like UTM:
-   ossimString epsg_code;
-   std::map<std::string, ossim_uint32>::const_iterator it = m_wktProjRecords.find(pcs_name.string());
-   if (it != m_wktProjRecords.end())
-   {
-      // Found an entry by this name, fetch the EPSG code:
-      epsg_code = ossimString::toString(it->second);
-   }
-   else
-   {
-      // The name specified in the WKT could not be found in our WKT->EPSG map.
-      // Check for EPSG code in WKT itself:
-      ossimString auth_name = temp_kwl.find(prefix, "PROJCS.AUTHORITY.name");
-      if (auth_name == "EPSG")
-         epsg_code = temp_kwl.find(prefix, "PROJCS.AUTHORITY.param0");
-   }
-
-   // Use EPSG if determined:
-   if (!epsg_code.empty())
-   {
-      proj = ossimEpsgProjectionDatabase::instance()->findProjection(epsg_code.toUInt32());
-      if (proj)
-         return proj;
-   }
-
-   // Not EPSG, so check conventional proj spec in WKT:
-   ossimString proj_name = temp_kwl.find(prefix, "PROJCS.PROJECTION.name");
-   if (proj_name.empty())
-      return 0;
-   proj_name.downcase();
-   proj_name.gsub(" ", "_", true);
-
-   // Note that prefix is ignored. This KWL is assumed to come from ossimWkt that doesn't prefix:
-   if (proj_name.contains("transverse_mercator"))
-      proj = doTransverseMercator(temp_kwl);
-   else if (proj_name.contains("mercator"))
-      proj = doMercator(temp_kwl);
-   else if (proj_name.contains("lambert"))
-      proj = doLambertConformalConic(temp_kwl);
-   else if (proj_name.contains("equirectangular"))
-      proj = doEquiDistCylindrical(temp_kwl);
-   else if (proj_name.contains("cylindrical_equal_area"))
-      proj = doEquiAreaCylindrical(temp_kwl);
-
-   return proj;
-}
-
-//*************************************************************************************************
-// This is the principal factory method. It accepts a WKT string, e.g.
-//
-//    "Anguilla_1957_British_West_Indies_Grid",
-//
-//  or complete WKT, e.g.
-//
-//    PROJCS["Anguilla_1957_British_West_Indies_Grid", GEOGCS[...
-//
-// IMPORTANT NOTE: Image tie-points cannot be conveyed by a WKT projection string. The projection
-// created here will not be fully initialized for use in rendering imagery.
-//*************************************************************************************************
-ossimProjection* ossimWktProjectionFactory::createProjection(const ossimString &spec) const
-{
-   ossimProjection* proj = 0;
-   ossimWkt wkt;
-   if (wkt.parse(spec))
-   {
-      proj = createProjection(wkt.getKwl());
-   }
-   return proj;
-}
-
-//*************************************************************************************************
-ossimObject* ossimWktProjectionFactory::createObject(const ossimString& typeName) const
-{
-   return createProjection(typeName);
-}
-
-//*************************************************************************************************
-ossimObject* ossimWktProjectionFactory::createObject(const ossimKeywordlist& kwl,
-                                                     const char* prefix) const
-{
-   return createProjection(kwl, prefix);
-}
-
-//*************************************************************************************************
-//! STUB. Not implemented
-//*************************************************************************************************
-ossimProjection* ossimWktProjectionFactory::createProjection(const ossimFilename& /* filename */,
-                                                             ossim_uint32 /* entryIdx */) const
-{
-   return 0;
-}
-
-//*************************************************************************************************
-//! This returns the type name of all objects in all factories. This is the name used to 
-//! construct the objects dynamically and this name must be unique.
-//*************************************************************************************************
-void ossimWktProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList) const
-{
-   if (m_wktProjRecords.empty())
-      loadRecords();
-
-   std::map<std::string, ossim_uint32>::iterator db_iter = m_wktProjRecords.begin();
-   while (db_iter != m_wktProjRecords.end())
-   {
-      typeList.push_back(ossimString(db_iter->first));
-      db_iter++;
-   }
-   return;
-}
-
-ossimProjection* ossimWktProjectionFactory::doTransverseMercator(const ossimKeywordlist& kwl) const
-{
-   ossimTransMercatorProjection* proj = new ossimTransMercatorProjection();
-   doMapCommon<ossimTransMercatorProjection*>(kwl, proj);
-
-   // Determine first the units:
-   ossimString name_read;
-   ossimString val_read;
-
-   // Read projection parameters from WKT KWL:
-   int param_idx = 0;
-   do
-   {
-      ossimString param("PROJCS.PARAMETER");
-      param += ossimString::toString(param_idx++);
-      name_read = kwl.find(param + ".name");
-      val_read = kwl.find(param + ".param0");
-
-      if (name_read.contains("scale_factor"))
-      {
-         proj->setScaleFactor(val_read.toDouble());
-         break;
-      }
-
-   } while (!name_read.empty());
-
-   return proj;
-}
-
-ossimProjection* ossimWktProjectionFactory::doMercator(const ossimKeywordlist& kwl) const
-{
-   ossimMercatorProjection* proj = new ossimMercatorProjection();
-   doMapCommon<ossimMercatorProjection*>(kwl, proj);
-
-   // Determine first the units:
-   ossimString name_read;
-   ossimString val_read;
-
-   // Read projection parameters from WKT KWL:
-   int param_idx = 0;
-   do
-   {
-      ossimString param("PROJCS.PARAMETER");
-      param += ossimString::toString(param_idx++);
-      name_read = kwl.find(param + ".name");
-      val_read = kwl.find(param + ".param0");
-
-      if (name_read.contains("scale_factor"))
-      {
-         proj->setScaleFactor(val_read.toDouble());
-         break;
-      }
-
-   } while (!name_read.empty());
-
-   return proj;
-}
-
-ossimProjection* ossimWktProjectionFactory::doLambertConformalConic(const ossimKeywordlist& kwl) const
-{
-   ossimLambertConformalConicProjection* proj = new ossimLambertConformalConicProjection();
-   doMapCommon<ossimLambertConformalConicProjection*>(kwl, proj);
-
-   // Determine first the units:
-   ossimString name_read;
-   ossimString val_read;
-
-   // Read projection parameters from WKT KWL:
-   int param_idx = 0;
-   do
-   {
-      ossimString param("PROJCS.PARAMETER");
-      param += ossimString::toString(param_idx++);
-      name_read = kwl.find(param + ".name");
-      val_read = kwl.find(param + ".param0");
-
-      if (name_read.contains("standard_parallel_1"))
-         proj->setStandardParallel1(val_read.toDouble());
-
-      else if (name_read.contains("standard_parallel_2"))
-         proj->setStandardParallel2(val_read.toDouble());
-
-   } while (!name_read.empty());
-
-   return proj;
-}
-
-ossimProjection* ossimWktProjectionFactory::doEquiDistCylindrical(const ossimKeywordlist& kwl) const
-{
-   ossimEquDistCylProjection* proj = new ossimEquDistCylProjection();
-   doMapCommon<ossimEquDistCylProjection*>(kwl, proj);
-
-   return proj;
-}
-
-ossimProjection* ossimWktProjectionFactory::doEquiAreaCylindrical(const ossimKeywordlist& kwl) const
-{
-   ossimCylEquAreaProjection* proj = new ossimCylEquAreaProjection();
-   doMapCommon<ossimCylEquAreaProjection*>(kwl, proj);
-
-   return proj;
-}
-
-template<class T>
-void ossimWktProjectionFactory::doMapCommon(const ossimKeywordlist& kwl, T proj) const
-{
-   ossimString name_read;
-   ossimString val_read;
-
-   const ossimDatum* datum = 0;
-   name_read = kwl.find("PROJCS.GEOGCS.AUTHORITY.name");
-   val_read = kwl.find("PROJCS.GEOGCS.AUTHORITY.param0");
-   if ((name_read == "EPSG") && (!val_read.empty()))
-   {
-      datum = ossimEpsgDatumFactory::instance()->create(val_read.toUInt32());
-      if (datum)
-         proj->setDatum(datum);
-      // TODO: HARN Datum not being handled
-   }
-
-   // Determine first the units:
-   name_read = kwl.find("PROJCS.UNIT.name");
-   double conv_factor = 1.0;
-   if (name_read.contains("f")) // feet|foot
-   {
-      conv_factor = MTRS_PER_FT;
-      proj->setProjectionUnits(OSSIM_FEET);
-   }
-
-   // Read projection parameters from WKT KWL:
-   int param_idx = 0;
-   ossimGpt origin(0, 0, 0, datum);
-   do
-   {
-      ossimString param("PROJCS.PARAMETER");
-      param += ossimString::toString(param_idx++);
-      name_read = kwl.find(param + ".name");
-      val_read = kwl.find(param + ".param0");
-
-      if (name_read.contains("central_meridian"))
-         origin.lon = val_read.toDouble();
-
-      else if (name_read.contains("latitude_of_origin"))
-         origin.lat = val_read.toDouble();
-
-      else if (name_read.contains("false_easting"))
-         proj->setFalseEasting(val_read.toDouble() * conv_factor);
-
-      else if (name_read.contains("false_northing"))
-         proj->setFalseNorthing(val_read.toDouble() * conv_factor);
-
-   } while (!name_read.empty());
-
-   proj->setOrigin(origin);
-}
-
diff --git a/ossim/src/ossim/support_data/makefile.vc b/ossim/src/ossim/support_data/makefile.vc
deleted file mode 100644
index fba38f8..0000000
--- a/ossim/src/ossim/support_data/makefile.vc
+++ /dev/null
@@ -1,148 +0,0 @@
-###
-# $Id: makefile.vc 17000 2010-04-12 19:13:09Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimAigBounds.obj \
-ossimAigDataFileHeader.obj \
-ossimAigHeader.obj \
-ossimAigIndexFileHeader.obj \
-ossimAigStatistics.obj \
-ossimApplanixEOFile.obj \
-ossimAuxFileHandler.obj \
-ossimCcfInfo.obj \
-ossimDemGrid.obj \
-ossimDemHeader.obj \
-ossimDemInfo.obj \
-ossimDemPoint.obj \
-ossimDemProfile.obj \
-ossimDemStats.obj \
-ossimDemUtil.obj \
-ossimDoqq.obj \
-ossimDtedAcc.obj \
-ossimDtedDsi.obj \
-ossimDtedHdr.obj \
-ossimDtedInfo.obj \
-ossimDtedRecord.obj \
-ossimDtedUhl.obj \
-ossimDtedVol.obj \
-ossimEnviHeader.obj \
-ossimERS.obj \
-ossimFfL5.obj \
-ossimFfL7.obj \
-ossimFfRevb.obj \
-ossimFfRevc.obj \
-ossimGeoTiff.obj \
-ossimIkonosMetaData.obj \
-ossimInfoBase.obj \
-ossimInfoFactory.obj \
-ossimInfoFactoryRegistry.obj \
-ossimJ2kCodRecord.obj \
-ossimJ2kInfo.obj \
-ossimJ2kSizRecord.obj \
-ossimJ2kSotRecord.obj \
-ossimNitfAcftbTag.obj \
-ossimNitfAimidbTag.obj \
-ossimNitfBlockaTag.obj \
-ossimNitfCommon.obj \
-ossimNitfCompressionHeader.obj \
-ossimNitfCscrnaTag.obj \
-ossimNitfCsdidaTag.obj \
-ossimNitfCsexraTag.obj \
-ossimNitfDataExtensionSegment.obj \
-ossimNitfDataExtensionSegmentV2_0.obj \
-ossimNitfEmbeddedRpfDes.obj \
-ossimNitfEngrdaTag.obj \
-ossimNitfFile.obj \
-ossimNitfFileHeader.obj \
-ossimNitfFileHeaderV2_0.obj \
-ossimNitfFileHeaderV2_1.obj \
-ossimNitfFileHeaderV2_X.obj \
-ossimNitfGeoPositioningTag.obj \
-ossimNitfIchipbTag.obj \
-ossimNitfImageBand.obj \
-ossimNitfImageBandV2_0.obj \
-ossimNitfImageBandV2_1.obj \
-ossimNitfImageHeader.obj \
-ossimNitfImageHeaderV2_0.obj \
-ossimNitfImageHeaderV2_1.obj \
-ossimNitfImageHeaderV2_X.obj \
-ossimNitfImageLut.obj \
-ossimNitfImageLutV2_0.obj \
-ossimNitfImageLutV2_1.obj \
-ossimNitfInfo.obj \
-ossimNitfLabelHeader.obj \
-ossimNitfLabelHeaderV2_0.obj \
-ossimNitfLocalCartographicTag.obj \
-ossimNitfLocalGeographicTag.obj \
-ossimNitfMstgtaTag.obj \
-ossimNitfNameConversionTables.obj \
-ossimNitfPiaimcTag.obj \
-ossimNitfProjectionParameterTag.obj \
-ossimNitfRegisteredTag.obj \
-ossimNitfRegisteredTagFactory.obj \
-ossimNitfRpcATag.obj \
-ossimNitfRpcBase.obj \
-ossimNitfRpcBTag.obj \
-ossimNitfRpfTagFactory.obj \
-ossimNitfSensraTag.obj \
-ossimNitfStdidcTag.obj \
-ossimNitfSymbolHeader.obj \
-ossimNitfSymbolHeaderV2_0.obj \
-ossimNitfTagFactory.obj \
-ossimNitfTagFactoryRegistry.obj \
-ossimNitfTagInformation.obj \
-ossimNitfTextHeader.obj \
-ossimNitfTextHeaderV2_0.obj \
-ossimNitfUnknownTag.obj \
-ossimNitfUse00aTag.obj \
-ossimNitfVqCompressionHeader.obj \
-ossimQuickbirdMetaData.obj \
-ossimQuickbirdRpcHeader.obj \
-ossimQuickbirdTile.obj \
-ossimRpfAttributeOffsetRecord.obj \
-ossimRpfAttributes.obj \
-ossimRpfAttributeSectionSubheader.obj \
-ossimRpfBoundaryRectRecord.obj \
-ossimRpfBoundaryRectSectionSubheader.obj \
-ossimRpfBoundaryRectTable.obj \
-ossimRpfColorConverterOffsetRecord.obj \
-ossimRpfColorConverterSubsection.obj \
-ossimRpfColorConverterTable.obj \
-ossimRpfColorGrayscaleOffsetRecord.obj \
-ossimRpfColorGrayscaleSubheader.obj \
-ossimRpfColorGrayscaleTable.obj \
-ossimRpfCompressionLookupOffsetRecord.obj \
-ossimRpfCompressionSection.obj \
-ossimRpfCompressionSectionSubheader.obj \
-ossimRpfCoverageSection.obj \
-ossimRpfFrame.obj \
-ossimRpfFrameEntry.obj \
-ossimRpfFrameFileIndexRecord.obj \
-ossimRpfFrameFileIndexSectionSubheader.obj \
-ossimRpfFrameFileIndexSubsection.obj \
-ossimRpfFrameFileReader.obj \
-ossimRpfHeader.obj \
-ossimRpfImageDescriptionSubheader.obj \
-ossimRpfImageDisplayParameterSubheader.obj \
-ossimRpfLocationSection.obj \
-ossimRpfMaskSubheader.obj \
-ossimRpfMaskSubsection.obj \
-ossimRpfPathnameRecord.obj \
-ossimRpfToc.obj \
-ossimRpfTocEntry.obj \
-ossimSpaceImagingGeom.obj \
-ossimSpotDimapSupportData.obj \
-ossimSrtmFilename.obj \
-ossimSrtmSupportData.obj \
-ossimTiffInfo.obj \
-ossimTiffWorld.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/support_data/ossimAlphaSensorSupportData.cpp b/ossim/src/ossim/support_data/ossimAlphaSensorSupportData.cpp
deleted file mode 100644
index 4f8980e..0000000
--- a/ossim/src/ossim/support_data/ossimAlphaSensorSupportData.cpp
+++ /dev/null
@@ -1,699 +0,0 @@
-#include <ossim/support_data/ossimAlphaSensorSupportData.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEcefPoint.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-#include <fstream>
-#include <sstream>
-
-static ossimTrace traceDebug("ossimAlphaSensorSupportData:debug");
-
-
-ossimAlphaSensorSupportData::ossimAlphaSensorSupportData()
-   : m_isHSI(false),
-     m_sensorType(),
-     m_imageSize(),
-     m_rollBias(ossim::nan()),
-     m_pitchBias(ossim::nan()),
-     m_headingBias(ossim::nan()),
-     m_fov(ossim::nan()),
-     m_slitRot(ossim::nan()),
-     m_imgLine(),
-     m_roll(),
-     m_pitch(),
-     m_heading(),
-     m_lon(),
-     m_lat(),
-     m_alt(),
-     m_scanAng(),
-     m_rollPolyCoef(),
-     m_pitchPolyCoef(),
-     m_headingPolyCoef(),
-     m_lonPolyCoef(),
-     m_altPolyCoef(),
-     m_scanAngPolyCoef()
-{
-   reset();
-}
-
-void ossimAlphaSensorSupportData::reset()
-{
-   m_imageSize.makeNan();
-}
-
-
-bool ossimAlphaSensorSupportData::readSupportFiles(const ossimFilename& hdrFile)
-{
-   bool readOK = false;
-
-   // Read ENVI hdr file
-   ossimEnviHeader hdr;
-   if ( hdr.open(hdrFile) )
-   {
-      readOK= readSupportFiles( hdr );
-   }
-   return readOK;
-}
-
-bool ossimAlphaSensorSupportData::readSupportFiles(const ossimEnviHeader& hdr)
-{
-   bool readOK = readHdrFile(hdr);
-
-   ossimFilename txtFile = hdr.getFile();
-   
-   if ( readOK )
-   {
-      // Derive associated insgps.txt file name
-      if (m_isHSI)
-      {
-         // HSI:
-         //  Associated file is located in /NavData, sub-directory of current container
-         //   example:
-         //   .hdr = "/data/AH/2012-06-15_20-00-29/HSI/Scan_00002/2012-06-15_20-00-29.HSI.Scan_00002.scene.corrected.hsi.hdr"
-         //   .txt = "/data/AH/2012-06-15_20-00-29/HSI/Scan_00002/NavData/2012-06-15_20-00-29.HSI.Scan_00002.scene.insgps.txt"
-         // txtFile.insert(hdr.getFile().find_last_of('/'), "/NavData");
-         // txtFile.gsub("corrected.hsi.hdr", "insgps.txt");
-
-         ossimFilename navDir = hdr.getFile().path();
-         navDir = navDir.dirCat("NavData");
-         if ( navDir.exists() )
-         {
-            txtFile = navDir.dirCat( hdr.getFile().file() );
-            txtFile.gsub("corrected.hsi.hdr", "insgps.txt");
-         }
-         else
-         {
-            //-- 
-            // Example header and inertial nav support(INS) data file paths:
-            // 
-            // Header: /data/20131113/hsi/cal/001_001_hsi_cal_001.hsi.hdr
-            // INS:    /data/20131113/hsi/nav/001_001_hsi_cal_001.txt
-            //---
-            
-            // Expand header file out to absolute path:
-            txtFile = hdr.getFile().expand();
-            
-            // Substitute the "cal" directory with "nav".
-            txtFile.gsub("cal/", "nav/");
-
-            // Substitute the "hsi.hdr" directory with "txt".
-            txtFile.gsub("hsi.hdr", "txt");
-         }
-      }
-      else
-      {
-         // HRI:
-         //  Associated file is located in ../NavData, parallel to current container
-         //  There is one insgps.txt file common to multiple hdr files
-         //   example:
-         //   .hdr = "/data/AH/2012-06-15_20-00-29/HRI/HRI_2/2012-06-15_20-00-29.HRI_2.Strip_00004.corrected.hri.hdr"
-         //   .txt = "/data/AH/2012-06-15_20-00-29/HRI/NavData/2012-06-15_20-00-29.HRI.Strip_00004.insgps.txt"
-
-         // Replaced: 29 July 2013 (drb)
-         // txtFile = hdr.getFile().path();
-         // if ( txtFile.empty() )
-         // {
-         //    txtFile = txtFile.dirCat("../NavData");
-         // }
-         // else
-         // {
-         //    txtFile.replace(txtFile.find("HRI_"), 5, "NavData");
-         // }  
-         // txtFile = txtFile.dirCat( hdr.getFile().file() );
-         // txtFile.replace(txtFile.find("HRI_"), 5, "HRI");
-         // txtFile.gsub("corrected.hri.hdr", "insgps.txt");
-         // 
-         // with:
-
-         ossimFilename navDir = hdr.getFile().path();
-         if ( navDir.empty() )
-         {
-            navDir = navDir.dirCat("../NavData");
-         }
-         else
-         {
-            std::string::size_type pos = navDir.find("HRI_");
-            if(pos!=std::string::npos)
-            {
-               navDir = navDir.replace(pos, 5, "NavData");
-            }
-         }
-         if ( navDir.exists() )
-         {
-            txtFile = navDir.dirCat( hdr.getFile().file() );
-            std::string::size_type pos = txtFile.find("HRI_");
-            if(pos!=std::string::npos)
-            {
-               txtFile.replace(pos, 5, "HRI");
-            }
-            txtFile.gsub("corrected.hri.hdr", "insgps.txt");
-         }
-         else
-         {
-            navDir = "../nav";
-            txtFile = navDir.dirCat( hdr.getFile().file() );
-            txtFile.gsub("hri.hdr", "txt");
-         }
-      }            
-
-      // Read .txt file
-      readOK = readInsGpsFile(txtFile);
-   }    
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimAlphaSensorSupportData::readSupportFiles DEBUG:"
-         << "\n hdrFile = " << hdr.getFile()
-         << "\n txtFile = " << txtFile
-         << std::endl;
-   }
-
-   return readOK;
-}
-
-bool ossimAlphaSensorSupportData::readHdrFile(const ossimFilename& hdrFile)
-{
-   bool result = false;
-   ossimEnviHeader hdr;
-   if ( hdr.open(hdrFile) )
-   {
-      result = readHdrFile( hdr );
-   }
-   return result;
-}
-
-bool ossimAlphaSensorSupportData::readHdrFile(const ossimEnviHeader& hdr)
-{
-   bool result = false;
-
-   while( 1 )
-   {
-      // Required stuff will break from loop if not found/valid.
-
-      m_sensorType = hdr.getSensorType();
-      if ( m_sensorType.empty() ) break;
-      
-      if ( m_sensorType == "Unknown" )
-      {
-         // Make an assumption from file name...
-         if ( hdr.getFile().file().contains( ossimString("HSI") ) )
-         {
-            m_sensorType = "ACES_YOGI-HSI";
-         }
-         else if (  hdr.getFile().file().contains( ossimString("HRI") ) )
-         {
-            m_sensorType = "ACES_YOGI-HRI2";
-         }
-      }
-
-      if ( m_sensorType == "Unknown" )
-      {
-         break; // Get out...
-      }
-
-      // Set the hsi flag:
-      if ( m_sensorType.contains("HSI") || (hdr.getBands() > 63 ) ) // arbitrary...
-      {
-         m_isHSI = true;
-      }
-      else
-      {
-         m_isHSI = false;
-      }
-
-      m_imageSize.x = hdr.getSamples();
-      m_imageSize.y = hdr.getLines();
-      if ( !m_imageSize.x || !m_imageSize.y ) break;
-      
-      ossimString value;
- 
-      hdr.getValue("roll bias", value);
-      if ( value.size() )
-      {
-         m_rollBias = ossimString::toDouble(value);
-      }
-      else
-      {
-         break;
-      }
-
-      hdr.getValue("pitch bias", value);
-      if ( value.size() )
-      {
-         m_pitchBias = ossimString::toDouble(value);
-      }
-      else
-      {
-         break;
-      }
-
-      hdr.getValue("heading bias", value);
-      if ( value.size() )
-      {
-         m_headingBias = ossimString::toDouble(value);
-      }
-      else
-      {
-         break;
-      }
-
-      hdr.getValue("fpa fov deg", value);
-      if ( value.size() )
-      {
-         m_fov = ossimString::toDouble(value);
-      }
-      else
-      {
-         break;
-      }
-
-      hdr.getValue("slit rotation deg", value);
-      if ( value.size() )
-      {
-         m_slitRot = ossimString::toDouble(value);
-      }
-      else
-      {
-         // Removed requirement. Missing in some support data and always 0 when present.
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "Missing: \"slit rotation deg\"\n";
-         }
-      }
-
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimAlphaSensorSupportData::readHdrFile DEBUG:"
-            << "\n getSensorType = " << m_sensorType
-            << "\n getSamples = " << m_imageSize.x
-            << "\n getLines = " << m_imageSize.y
-            << "\n roll bias = " << m_rollBias
-            << "\n pitch bias = " << m_pitchBias
-            << "\n heading bias = " << m_headingBias
-            << "\n fpa fov deg = " << m_fov
-            << "\n slit rotation deg = " << m_slitRot
-            << "\n";
-      }
-
-      // Last two lines of while forever.  If we get here, set status true and break out.
-      result = true;
-      break;
-   }
-
-   return result;
-
-} // End: bool ossimAlphaSensorSupportData::readHdrFile(const ossimEnviHeader& )
-
-bool ossimAlphaSensorSupportData::readInsGpsFile(const ossimFilename& file)
-{
-   bool result = true;
-
-   static const char M[] = "ossimAlphaSensorSupportData::readInsGpsFile";
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered:\n" << "file: " << file << "\n";
-   }
-   
-   std::ifstream in(file.c_str(), std::ios::in);
-   if ( in.good() )
-   {
-      ossim_float64 inum;
-      ossim_float64 roll;
-      ossim_float64 pitch;
-      ossim_float64 heading;
-      ossim_float64 lon;
-      ossim_float64 lat;
-      ossim_float64 alt;
-      ossim_float64 scanAng;
-      int res;
-      int frm;
-      const ossim_float64 BOGUS = -99999.0; // To detect read error/missing value.
-      ossim_float64 timeCode = BOGUS;
-
-      std::vector< ossim_uint32 > lines;
-
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimAlphaSensorSupportData::readInsGpsFile DEBUG:" << std::endl;
-         ossimNotify(ossimNotifyLevel_DEBUG)<<std::setprecision(8);
-         ossimNotify(ossimNotifyLevel_DEBUG)<<std::setiosflags(std::ios_base::scientific);
-
-      }
-
-      // Format: line,roll,pitch,heading,lon,lat,alt,scanAngle,reserved,frame,time
-
-      // Check the first line.  Some data has a phantom line, some starts with good data.
-      std::string line1;
-      std::getline( in, line1 );
-      ossim_uint32 fields = 0;
-      if ( line1.size() )
-      {
-         std::string s;
-         std::istringstream tmpStr( line1 );
-         while ( !tmpStr.eof() )
-         {
-            tmpStr >> s;
-            if ( s.size() )
-            {
-               ++fields;
-               s.clear();
-            }
-         }
-         if ( fields == 11 )
-         {
-            // First line is valid.
-            in.seekg( 0, std::ios_base::beg );
-         }
-      }
-
-      while( !in.eof() )
-      {
-         // To detect read error/missing value. Check eof was missing last line.
-         timeCode = BOGUS; 
-         
-         in >> inum >> roll >> pitch >> heading >> lon >> lat
-            >> alt >> scanAng >> res >> frm >> timeCode;
-
-         // if(!in.eof())
-         if ( timeCode != BOGUS )
-         {
-            lines.push_back(inum);
-            m_roll.push_back(roll);
-            m_pitch.push_back(pitch);
-            m_heading.push_back(heading);
-            m_lon.push_back(lon);
-            m_lat.push_back(lat);
-            m_alt.push_back(alt);
-            m_scanAng.push_back(scanAng);
-          }
-      }
-      
-      // Make sure we have a value per line
-      if( (lines.size() < m_imageSize.y) || (lines.size() < 10) )
-      {
-         return false;
-      }
-
-      // Load independent variable (line number, referenced to first line)
-      vector< ossimPolynom< ossim_float64 , 1 >::VAR_TUPLE >::iterator pit;
-      m_imgLine.resize(lines.size());
-      int j;
-      for (pit=m_imgLine.begin(), j=0; pit!=m_imgLine.end(); ++pit,++j)
-      {
-         pit->push_back(lines[j]-lines[0]);
-      }
-
-      // Dependent variable solutions follow...
-      double rms=0.0;
-
-      // Exponent sets
-      std::vector< ossimPolynom<ossim_float64,1>::EXPT_SET > expSet;
-      expSet.resize(MAX_TERMS);
-      ossimPolynom<ossim_float64,1>::EXP_TUPLE et(1);
-      for (int numExp=1; numExp<=MAX_TERMS; ++numExp)
-      {
-         for(int o=0; o<numExp ; ++o)
-         {
-            et[0]=o;
-            expSet[numExp-1].insert(et);
-         }
-      }
-
-      // Polynomial classes
-      //  scanAngle
-      ossimPolynom<ossim_float64,1> saPoly;
-      //  orientation angles (roll, pitch, heading)
-      ossimPolynom<ossim_float64,1> rPoly;
-      ossimPolynom<ossim_float64,1> pPoly;
-      ossimPolynom<ossim_float64,1> hPoly;
-      //  position (longitude, latitude, altitude)
-      ossimPolynom<ossim_float64,1> lonPoly;
-      ossimPolynom<ossim_float64,1> latPoly;
-      ossimPolynom<ossim_float64,1> altPoly;
-
-      // Solve for polynomial coefficients
-      if (m_isHSI)
-      {
-         result = saPoly.SLSfit(expSet[SCAN_ANGLE_DEG], m_imgLine, m_scanAng, &rms);
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "\n SA  poly deg, rms error = "
-               << SCAN_ANGLE_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
-         }
-      }
-      if (result)
-      {
-         result = rPoly.SLSfit(expSet[ROLL_DEG], m_imgLine, m_roll, &rms);
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "\n R   poly deg, rms error = "
-               << ROLL_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
-         }
-
-         if (result)
-         {
-            result = pPoly.SLSfit(expSet[PITCH_DEG], m_imgLine, m_pitch, &rms);
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "\n P   poly deg, rms error = "
-                  << PITCH_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
-            }
-
-            if (result)
-            {
-               result = hPoly.SLSfit(expSet[HEADING_DEG], m_imgLine, m_heading, &rms);
-               if (traceDebug())
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << "\n H   poly deg, rms error = "
-                     << HEADING_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
-               }
-
-               if (result)
-               {
-                  result = lonPoly.SLSfit(expSet[LON_DEG], m_imgLine, m_lon, &rms);
-                  if (traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_DEBUG)
-                        << "\n Lon poly deg, rms error = "
-                        << LON_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
-                  }
-
-                  if (result)
-                  {
-                     result = latPoly.SLSfit(expSet[LAT_DEG], m_imgLine, m_lat, &rms);
-                     if (traceDebug())
-                     {
-                        ossimNotify(ossimNotifyLevel_DEBUG)
-                           << "\n Lat poly deg, rms error = "
-                           << LAT_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
-                     }
-
-                     if (result)
-                     {
-                        result = altPoly.SLSfit(expSet[ALT_DEG], m_imgLine, m_alt, &rms);
-                        if (traceDebug())
-                        {
-                           ossimNotify(ossimNotifyLevel_DEBUG)
-                              << "\n Alt poly deg, rms error = "
-                              << ALT_DEG << ", " << rms << " mtr";
-                        }
-                     }
-                  }
-               }
-            }
-         }
-      }
-
-      if (result)
-      {
-         // Save coefficients
-         ossimPolynom<ossim_float64,1>::MONOM_MAP::const_iterator it;
-         for (it = rPoly.getMonoms().begin(); it != rPoly.getMonoms().end() ; ++it )
-         {
-            m_rollPolyCoef.push_back(it->second);
-         }
-         for (it = pPoly.getMonoms().begin(); it != pPoly.getMonoms().end() ; ++it )
-         {
-            m_pitchPolyCoef.push_back(it->second);
-         }
-         for (it = hPoly.getMonoms().begin(); it != hPoly.getMonoms().end() ; ++it )
-         {
-            m_headingPolyCoef.push_back(it->second);
-         }
-         for (it = lonPoly.getMonoms().begin(); it != lonPoly.getMonoms().end() ; ++it )
-         {
-            m_lonPolyCoef.push_back(it->second);
-         }
-         for (it = latPoly.getMonoms().begin(); it != latPoly.getMonoms().end() ; ++it )
-         {
-            m_latPolyCoef.push_back(it->second);
-         }
-         for (it = altPoly.getMonoms().begin(); it != altPoly.getMonoms().end() ; ++it )
-         {
-            m_altPolyCoef.push_back(it->second);
-         }
-         if (m_isHSI)
-         {
-            for (it = saPoly.getMonoms().begin(); it != saPoly.getMonoms().end() ; ++it )
-            {
-               m_scanAngPolyCoef.push_back(it->second);
-            }
-         }
-         else
-         {
-            m_scanAngPolyCoef.push_back(0.0);
-         }
-      }
-
-
-      if (traceDebug())
-      {
-         if (result)
-         {
-            vector<ossim_float64> inp(1);
-            inp[0] = 510.0;
-            ossimNotify(ossimNotifyLevel_DEBUG) << "\n Test eval line number = " << inp[0] << endl;
-            if (m_isHSI)
-            {
-               saPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
-               ossim_float64 sa = saPoly.eval(inp);
-               ossimNotify(ossimNotifyLevel_DEBUG)<<"\n sa="<<sa<<endl;
-            }
-            rPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
-            ossim_float64 rr = rPoly.eval(inp);
-            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n r="<<rr<<endl;
-
-            pPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
-            ossim_float64 pp = pPoly.eval(inp);
-            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n p="<<pp<<endl;
-
-            hPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
-            ossim_float64 hh = hPoly.eval(inp);
-            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n h="<<hh<<endl;
-
-            lonPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
-            ossim_float64 lon = lonPoly.eval(inp);
-            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n lon="<<lon<<endl;
-
-            latPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
-            ossim_float64 lat = latPoly.eval(inp);
-            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n lat="<<lat<<endl;
-
-            altPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
-            ossim_float64 alt = altPoly.eval(inp);
-            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n alt="<<alt<<endl;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "  ...polynomial solution error for file: " << file << std::endl;
-         }
-      }
-   }
-   else
-   {
-      result = false;
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Could not open: " << file << "\n";
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " exit status = " << ( result ? "true" : "false" ) << "\n";
-   }
-   
-   return result;
-}
-
-const ossimDpt& ossimAlphaSensorSupportData::getImageSize()const
-{
-   return m_imageSize;
-}
-
-const ossim_float64& ossimAlphaSensorSupportData::getRollBias()const
-{
-   return m_rollBias;
-}
-
-const ossim_float64& ossimAlphaSensorSupportData::getPitchBias()const
-{
-   return m_pitchBias;
-}
-
-const ossim_float64& ossimAlphaSensorSupportData::getHeadingBias()const
-{
-   return m_headingBias;
-}
-
-const ossim_float64& ossimAlphaSensorSupportData::getFov()const
-{
-   return m_fov;
-}
-
-const ossim_float64& ossimAlphaSensorSupportData::getSlitRot()const
-{
-   return m_slitRot;
-}
-
-const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getRollPoly()const
-{
-   return m_rollPolyCoef;
-}
-
-const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getPitchPoly()const
-{
-   return m_pitchPolyCoef;
-}
-
-const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getHeadingPoly()const
-{
-   return m_headingPolyCoef;
-}
-
-const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getLonPoly()const
-{
-   return m_lonPolyCoef;
-}
-
-const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getLatPoly()const
-{
-   return m_latPolyCoef;
-}
-
-const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getAltPoly()const
-{
-   return m_altPolyCoef;
-}
-
-const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getScanPoly()const
-{
-   return m_scanAngPolyCoef;
-}
-
-
-// Hidden from use...
-ossimAlphaSensorSupportData::ossimAlphaSensorSupportData(const ossimAlphaSensorSupportData& /* src */)
-{
-}
-
-ossimAlphaSensorSupportData& ossimAlphaSensorSupportData::operator=(
-   const ossimAlphaSensorSupportData& /* src */)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimApplanixEOFile.cpp b/ossim/src/ossim/support_data/ossimApplanixEOFile.cpp
deleted file mode 100644
index 30897c1..0000000
--- a/ossim/src/ossim/support_data/ossimApplanixEOFile.cpp
+++ /dev/null
@@ -1,691 +0,0 @@
-//*******************************************************************
-//
-// MIT
-// 
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimApplanixEOFile.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <ossim/support_data/ossimApplanixEOFile.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimCommon.h>
-#include <iterator>
-#include <fstream>
-#include <sstream>
-#include <iostream>
-#include <iomanip>
-
-static ossimTrace traceDebug("ossimApplanixEOFile:debug");
-
-static std::istream& applanix_skipws(std::istream& in)
-{
-   int c = in.peek();
-   while(((c == ' ') ||
-          (c == '\r') ||
-          (c == '\t') ||
-          (c == '\n'))&&
-         (in.good()))
-   {
-      in.ignore(1);
-      c = in.peek();
-   }
-   
-   return in;
-}
-
-std::ostream& operator <<(std::ostream& out, const ossimApplanixEORecord& src)
-{
-   if(src.theField.size())
-   {
-      std::copy(src.theField.begin(),
-                src.theField.end(),
-                std::ostream_iterator<ossimString>(out, " "));
-   }
-
-   return out;
-}
-
-std::ostream& operator <<(std::ostream& out, const ossimApplanixEOFile& src)
-{
-   ossim_uint32 idx = 0;
-   out << src.theHeader << std::endl << std::endl;
-
-   if(src.theRecordFormat.size())
-   {
-      std::copy(src.theRecordFormat.begin(),
-                src.theRecordFormat.end()-1,
-                std::ostream_iterator<ossimString>(out, ", "));
-      out << *(src.theRecordFormat.end()-1);
-      out << std::endl;
-   }
-
-   out << "Kappa Cardinal Rotation = " << src.theKappaCardinal << std::endl;
-   out << "Bore Sight tx = " << src.theBoreSightTx << std::endl
-       << "Bore Sight ty = " << src.theBoreSightTy << std::endl
-       << "Bore Sight tz = " << src.theBoreSightTz << std::endl;
-   
-   out << "Lever arm lx = " << src.theLeverArmLx << std::endl
-       << "Lever arm ly = " << src.theLeverArmLy << std::endl
-       << "Lever arm lz = " << src.theLeverArmLz << std::endl;
-   
-   out << "Shift Value X = " << src.theShiftValuesX << std::endl
-       << "Shift Value Y = " << src.theShiftValuesY << std::endl
-       << "Shift Value Z = " << src.theShiftValuesZ << std::endl;
-   
-   out << "Mapping Frame Datum      = " << src.theMappingFrameDatum      << std::endl
-       << "Mapping Frame Projection = " << src.theMappingFrameProjection << std::endl
-       << "Central Meridian         = " << src.theCentralMeridian << std::endl
-       << "Origin of Latitude       = " << src.theOriginLatitude  << std::endl
-       << "Grid Scale Factor        = " << src.theGridScaleFactor << std::endl
-       << "False easting            = " << src.theFalseEasting    << std::endl
-       << "False northing           = " << src.theFalseNorthing   << std::endl;
-
-   out << "theUtmZone               = " << src.theUtmZone << std::endl;
-   out << "theUtmHemisphere         = " << src.theUtmHemisphere << std::endl;
-   
-   if(src.theApplanixRecordList.size())
-   {
-      out << std::endl;
-      for(idx = 0; idx < src.theApplanixRecordList.size()-1; ++idx)
-      {
-         out << *(src.theApplanixRecordList[idx]) << std::endl;
-      }
-      out << *(src.theApplanixRecordList[idx]);
-      
-   }
-
-   return out;
-}
-
-ossimApplanixEOFile::ossimApplanixEOFile()
-{
-   theMinLat = ossim::nan();
-   theMinLon = ossim::nan();
-   theMaxLat = ossim::nan();
-   theMaxLon = ossim::nan();
-}
-
-bool ossimApplanixEOFile::parseFile(const ossimFilename& file)
-{
-   std::ifstream in(file.c_str());
-
-   return parseStream(in);
-}
-
-bool ossimApplanixEOFile::isEOFile(const ossimFilename& file)const
-{
-   std::ifstream in(file.c_str());
-
-   return isEOFile(in);
-}
-
-bool ossimApplanixEOFile::isEOFile(std::istream& in)const
-{
-   ossimString header;
-
-   return parseHeader(in, header);
-}
-
-bool ossimApplanixEOFile::parseStream(std::istream& in)
-{
-   theRecordIdMap.clear();
-   ossimString line;
-   int c = '\0';
-   if(!parseHeader(in, theHeader))
-   {
-      return false;
-   }
-
-   // now parse parameters
-   in>>applanix_skipws;
-   line = "";
-   while(in.good()&&
-         !line.contains("RECORD FORMAT"))
-   {
-      std::getline(in, line.string());
-      line = line.upcase();
-      line = line.substitute("\r","\n", true);
-      if(line.contains("KAPPA CARDINAL"))
-      {
-         theKappaCardinal = line;
-         theKappaCardinal = theKappaCardinal.substitute("KAPPA CARDINAL ROTATION","");
-         theKappaCardinal = theKappaCardinal.substitute(":","");
-         theKappaCardinal = theKappaCardinal.substitute("\n","");
-      }
-      else if(line.contains("LEVER ARM"))
-      {
-         ossimKeywordlist kwl('=');
-         line = line.substitute("LEVER ARM VALUES:",
-                                "");
-         line = line.substitute(",",
-                                "\n",
-                                true);
-         std::istringstream in(line);
-
-         kwl.parseStream(in);
-
-         theLeverArmLx = kwl.find("LX");
-         theLeverArmLy = kwl.find("LY");
-         theLeverArmLz = kwl.find("LZ");
-      }
-      else if(line.contains("BORESIGHT VALUES"))
-      {
-         ossimKeywordlist kwl('=');
-         line = line.substitute("BORESIGHT VALUES:",
-                                "");
-         line = line.substitute(",",
-                                "\n",
-                                true);
-
-         std::istringstream in(line);
-
-         kwl.parseStream(in);
-
-         
-         theBoreSightTx = kwl.find("TX");
-         theBoreSightTy = kwl.find("TY");
-         theBoreSightTz = kwl.find("TZ");
-      }
-      else if(line.contains("SHIFT VALUES:"))
-      {
-         ossimKeywordlist kwl('=');
-         line = line.substitute("SHIFT VALUES:","");
-         line = line.substitute(",",
-                                "\n",
-                                true);
-
-         std::istringstream in(line);
-         kwl.parseStream(in);
-
-         
-         theShiftValuesX = kwl.find("X");
-         theShiftValuesY = kwl.find("Y");
-         theShiftValuesZ = kwl.find("Z");
-         
-      }
-      else if(line.contains("GRID:"))
-      { 
-         ossimKeywordlist kwl(':');
-         line = line.substitute(";",
-                                "\n",
-                                true);
-         std::istringstream in(line);
-         kwl.parseStream(in);
-         theUtmZone = kwl.find("ZONE");
-
-         if(theUtmZone.contains("NORTH"))
-         {
-            theUtmHemisphere = "North";
-         }
-         else
-         {
-            theUtmHemisphere = "South";
-         }
-          theUtmZone = theUtmZone.replaceAllThatMatch("UTM|\\(.*\\)|NORTH|SOUTH","");
-          theUtmZone = theUtmZone.trim();
-      }
-      else if(line.contains("FRAME DATUM"))
-      {
-         ossimKeywordlist kwl(':');
-         line = line.substitute(";",
-                                "\n",
-                                true);
-         std::istringstream in(line);
-         kwl.parseStream(in);
-
-         theMappingFrameDatum = kwl.find("MAPPING FRAME DATUM");
-         theMappingFrameProjection = kwl.find("MAPPING FRAME PROJECTION");
-         theMappingFrameDatum = theMappingFrameDatum.trim();
-         theMappingFrameProjection = theMappingFrameProjection.trim();
-      }
-      else if(line.contains("POSPROC SBET"))
-      {
-         theSbetField = line.after(":");
-         theSbetField = theSbetField.trim();
-      }
-      else if(line.contains("CENTRAL MERIDIAN"))
-      {
-         theCentralMeridian = line;
-         theCentralMeridian = theCentralMeridian.substitute("CENTRAL MERIDIAN","");
-         theCentralMeridian = theCentralMeridian.substitute("=","");
-         theCentralMeridian = theCentralMeridian.substitute("DEG","");
-         theCentralMeridian = theCentralMeridian.substitute(";","");
-      }
-      else if(line.contains("LATITUDE OF THE GRID ORIGIN"))
-      {
-         ossimKeywordlist kwl('=');
-         line = line.substitute(";",
-                                "\n",
-                                true);
-         std::istringstream in(line);
-         kwl.parseStream(in);
-
-         theOriginLatitude  = kwl.find("LATITUDE OF THE GRID ORIGIN");
-         theGridScaleFactor = kwl.find("GRID SCALE FACTOR");
-      }
-      else if(line.contains("FALSE EASTING"))
-      {
-         ossimKeywordlist kwl('=');
-         line = line.substitute(";",
-                                "\n",
-                                true);
-         std::istringstream in(line);
-         kwl.parseStream(in);
-
-         theFalseEasting  = kwl.find("FALSE EASTING");
-         theFalseNorthing = kwl.find("FALSE NORTHING");
-      }
-   }
-
-   in>>applanix_skipws;
-
-   c = in.get();
-
-   std::vector<ossimString> fieldArray;
-   ossimString field;
-
-   while(in.good()&&
-         (c!='\n')&&
-         (c!='\r'))
-   {
-      field = "";
-      while((c != ',')&&
-            (c != '\n')&&
-            (c != '\r'))
-      {
-         field += (char)c;
-         c = in.get();
-      }
-      if((c!='\n')&&
-         (c!='\r'))
-      {
-         c = in.get();
-      }
-      field = field.trim();
-      if(field != "")
-      {
-         theRecordFormat.push_back(field);
-      }
-   }
-   in>>applanix_skipws;
-
-   if(in.peek() == '(')
-   {
-      std::getline(in, line.string());
-   }
-   in>>applanix_skipws;
-   ossimRefPtr<ossimApplanixEORecord> record = new ossimApplanixEORecord((ossim_uint32)theRecordFormat.size());
-   ossim_int32 latIdx = getFieldIdx("LAT");
-   ossim_int32 lonIdx = getFieldIdx("LONG");;
-   bool hasLatLon = (latIdx >=0)&&(lonIdx >= 0);
-
-   
-   if(hasLatLon)
-   {
-      theMinLat = 90.0;
-      theMaxLat = -90.0;
-      theMinLon = 180.0;
-      theMaxLon = -180.0;
-   }
-   else
-   {
-      theMinLat = ossim::nan();
-      theMaxLat = ossim::nan();
-      theMinLon = ossim::nan();
-      theMaxLon = ossim::nan();
-   }
-   
-   while(in.good()&&theRecordFormat.size())
-   {
-      std::getline(in, line.string());
-      line = line.trim();
-      if(line != "")
-      {
-         std::istringstream inStr(line);
-         ossim_uint32 idx;
-         ossimString value;
-
-         for(idx = 0; idx < theRecordFormat.size(); ++idx)
-         {
-            inStr >> (*record)[idx];
-         }
-         if(hasLatLon)
-         {
-            double lat = (*record)[latIdx].toDouble();
-            double lon = (*record)[lonIdx].toDouble();
-
-            if(lat<theMinLat) theMinLat = lat;
-            if(lat>theMaxLat) theMaxLat = lat;
-            if(lon<theMinLon) theMinLon = lon;
-            if(lon>theMaxLon) theMaxLon = lon;
-            
-         }
-         theApplanixRecordList.push_back(new ossimApplanixEORecord(*record));
-      }
-   }
-   indexRecordIds();
-
-   if(traceDebug())
-   {
-      if(hasLatLon)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "min lat: " << theMinLat << std::endl
-                                             << "min lon: " << theMinLon << std::endl
-                                             << "max lat: " << theMaxLat << std::endl
-                                             << "max lon: " << theMaxLon << std::endl;
-      }
-   }
-   return true;
-}
-
-bool ossimApplanixEOFile::parseHeader(const ossimFilename& file,
-                                      ossimString& header)const
-{
-   std::ifstream in(file.c_str());
-
-   return parseHeader(in, header);
-}
-
-bool ossimApplanixEOFile::parseHeader(std::istream& in,
-                                      ossimString& header)const
-{
-   header = "";
-   in >> applanix_skipws;
-
-   int c = in.peek();
-   
-   if((c!='*')||
-      (!in.good()))
-   {
-      return false;
-   }
-   ossimString line;
-
-   std::getline(in, line.string());
-   line = line .substitute("\r",
-                           "\n");
-   if(!line.contains("************"))
-   {
-      return false;
-   }
-
-   header = line;
-   header += "\n";
-
-   in>>applanix_skipws;
-   std::getline(in, line.string());
-   line = line .substitute("\r",
-                           "\n");
-   
-   while((in.good())&&
-         (!line.contains("***********")))
-   {
-      header += line;
-      header += "\n";
-      std::getline(in, line.string());
-      line = line .substitute("\r",
-                              "\n");
-   }
-   header += line;
-   header += "\n";
-
-   if(!header.contains("Applanix"))
-   {
-      return false;
-   }
-   
-   return true;
-}
-
-void ossimApplanixEOFile::indexRecordIds()
-{
-   ossimString id;
-   ossim_uint32 idx;
-   ossim_int32 idIdx = getFieldIdxLike("ID");
-   ossim_uint32 size = (ossim_uint32)theApplanixRecordList.size();
-   theRecordIdMap.clear();
-
-   if(idIdx < 0) return;
-
-   for(idx = 0; idx < size; ++idx)
-   {
-      id = (*theApplanixRecordList[idx])[idIdx];
-      theRecordIdMap.insert(std::make_pair(id, theApplanixRecordList[idx]));
-   }
-}
-
-ossim_int32 ossimApplanixEOFile::getFieldIdxLike(const ossimString& searchKey)const
-{
-   ossimString key = searchKey;
-   ossim_uint32 idx = 0;
-   key = key.upcase();
-
-   for(idx = 0; idx < theRecordFormat.size(); ++idx)
-   {
-      if(ossimString::upcase(theRecordFormat[idx]).contains(key))
-      {
-         return (int)idx;
-      }
-   }
-
-   return -1;
-}
-
-ossim_int32 ossimApplanixEOFile::getFieldIdx(const ossimString& searchKey)const
-{
-   ossimString key = searchKey;
-   ossim_uint32 idx = 0;
-   
-   key = key.upcase();
-
-   for(idx = 0; idx < theRecordFormat.size(); ++idx)
-   {
-      if(ossimString::upcase(theRecordFormat[idx]) == key)
-      {
-         return (int)idx;
-      }
-   }
-   
-   return -1;
-}
-
-
-const ossimRefPtr<ossimApplanixEORecord> ossimApplanixEOFile::getRecordGivenId(const ossimString& id)const
-{
-
-   if(theRecordIdMap.size())
-   {
-      std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>,
-         ossimStringLtstr >::const_iterator iter = theRecordIdMap.find(id);
-      
-      if(iter!=theRecordIdMap.end())
-      {
-         return iter->second;
-      }
-   }
-   else
-   {
-      ossim_uint32 idx;
-      ossim_int32 idxId = getFieldIdx("ID");
-      
-      if(idxId >= 0)
-      {
-         for(idx = 0; idx < theApplanixRecordList.size(); ++idx)
-         {
-            if((*theApplanixRecordList[idx])[idxId] == id)
-            {
-               return theApplanixRecordList[idx];
-            }
-         }
-      }
-   }
-   
-   return 0;
-}
-
-ossim_uint32 ossimApplanixEOFile::getNumberOfRecords()const
-{
-   return (ossim_uint32)theApplanixRecordList.size();
-}
-
-const ossimRefPtr<ossimApplanixEORecord> ossimApplanixEOFile::getRecord(ossim_uint32 idx)const
-{
-   if(idx < theApplanixRecordList.size())
-   {
-      return theApplanixRecordList[idx];
-   }
-   
-   return 0;
-}
-
-bool ossimApplanixEOFile::isHeightAboveMSL()const
-{
-   return (getFieldIdx("ORTHOMETRIC HEIGHT") >= 0);
-}
-
-bool ossimApplanixEOFile::isEcefModel()const
-{
-   ossim_int32 xIdx = getFieldIdx("X");
-   ossim_int32 yIdx = getFieldIdx("Y");
-   ossim_int32 zIdx = getFieldIdx("Z");
-   ossim_int32 rollIdx = getFieldIdx("ROLL");
-   ossim_int32 pitchIdx = getFieldIdx("PITCH");
-   ossim_int32 headingIdx = getFieldIdx("HEADING");
-
-   return ((xIdx >=0)&&
-           (yIdx >=0)&&
-           (zIdx >=0)&&
-           (rollIdx>=0)&&
-           (pitchIdx>=0)&&
-           (headingIdx>=0));
-}
-
-
-bool ossimApplanixEOFile::isUtmFrame()const
-{
-   return ((getFieldIdxLike("EASTING")>=0)&&
-            (getFieldIdxLike("NORTHING") >=0)&&
-            (getFieldIdxLike("HEIGHT") >= 0)&&
-            (getFieldIdxLike("OMEGA") >=0)&&
-            (getFieldIdxLike("PHI") >=0)&&
-            (getFieldIdxLike("KAPPA") >=0));
-            
-   return (getUtmZone() >= 0.0);
-}
-
-ossim_int32 ossimApplanixEOFile::getUtmZone()const
-{
-   return theUtmZone.toInt32();
-}
-
-ossimString ossimApplanixEOFile::getUtmHemisphere()const
-{
-   return theUtmHemisphere;
-}
-
-ossimString ossimApplanixEOFile::getSbetField()const
-{
-   return theSbetField;
-}
-
-double ossimApplanixEOFile::getBoreSightTx()const
-{
-   return theBoreSightTx.toDouble();
-}
-
-double ossimApplanixEOFile::getBoreSightTy()const
-{
-   return theBoreSightTy.toDouble();
-}
-
-double ossimApplanixEOFile::getBoreSightTz()const
-{
-   return theBoreSightTz.toDouble();
-}
-
-double ossimApplanixEOFile::getLeverArmLx()const
-{
-   return theLeverArmLx.toDouble();
-}
-
-double ossimApplanixEOFile::getLeverArmLy()const
-{
-   return theLeverArmLy.toDouble();
-}
-
-double ossimApplanixEOFile::getLeverArmLz()const
-{
-   return theLeverArmLz.toDouble();
-}
-
-double ossimApplanixEOFile::getKardinalKappa()const
-{
-   return theKappaCardinal.toDouble();
-}
-
-double ossimApplanixEOFile::getShiftValuesX()const
-{
-   return theShiftValuesX.toDouble();
-}
-
-double ossimApplanixEOFile::getShiftValuesY()const
-{
-   return theShiftValuesY.toDouble();
-}
-
-double ossimApplanixEOFile::getShiftValuesZ()const
-{
-   return theShiftValuesZ.toDouble();
-}
-
-ossimString ossimApplanixEOFile::getMappingFrameDatum()const
-{
-   return theMappingFrameDatum;
-}
-
-ossimString ossimApplanixEOFile::getMappingFrameProjection()const
-{
-   return theMappingFrameProjection;
-}
-
-double ossimApplanixEOFile::getMappingFrameCentralMeridian()const
-{
-   return theCentralMeridian.toDouble();
-}
-
-double ossimApplanixEOFile::getMappingFrameOriginLatitude()const
-{
-   return theOriginLatitude.toDouble();
-}
-
-double ossimApplanixEOFile::getMappingFrameGridScaleFactor()const
-{
-   return theGridScaleFactor.toDouble();
-}
-
-double ossimApplanixEOFile::getMappingFrameFalseEasting()const
-{
-   return theFalseEasting.toDouble();
-}
-
-double ossimApplanixEOFile::getMappingFrameFalseNorthing()const
-{
-   return theFalseNorthing.toDouble();
-}
-
-ossimString ossimApplanixEOFile::convertToOssimDatumCode(const ossimString& datum)const
-{
-   ossimString result = "WGE";
-   ossimString temp = datum;
-   temp = temp.upcase();
-
-   if(temp == "NAD83")
-   {
-      result = "NAR-C";
-   }
-
-   return result;
-}
diff --git a/ossim/src/ossim/support_data/ossimAuxFileHandler.cpp b/ossim/src/ossim/support_data/ossimAuxFileHandler.cpp
deleted file mode 100644
index 1e8f635..0000000
--- a/ossim/src/ossim/support_data/ossimAuxFileHandler.cpp
+++ /dev/null
@@ -1,1139 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: SPADAC Inc
-//         Adaptd from the GDAL package hfadataset.cpp
-// Description: This class provides some simple utilities for aux file.
-//
-//********************************************************************
-// $Id: ossimAuxFileHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
-
-#include <cstdio>
-#include <cstdlib>
-#include <iostream>
-
-#include <ossim/support_data/ossimAuxFileHandler.h>
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-using namespace std;
-
-void ossimAuxStandardFile( int nBytes, void * pData )
-
-{
-  int		i;
-  char	*entryData = (char *) pData;
-
-  for( i = nBytes/2-1; i >= 0; i-- )
-  {
-    ossim_uint8	byTemp;
-
-    byTemp = entryData[i];
-    entryData[i] = entryData[nBytes-i-1];
-    entryData[nBytes-i-1] = byTemp;
-  }
-}
-
-int ossimAuxGetDataTypeBits( int nDataType )
-
-{
-  switch( nDataType )
-  {
-  case EPT_u1:
-    return 1;
-
-  case EPT_u2:
-    return 2;
-
-  case EPT_u4:
-    return 4;
-
-  case EPT_u8:
-  case EPT_s8:
-    return 8;
-
-  case EPT_u16:
-  case EPT_s16:
-    return 16;
-
-  case EPT_u32:
-  case EPT_s32:
-  case EPT_f32:
-    return 32;
-
-  case EPT_f64:
-  case EPT_c64:
-    return 64;
-
-  case EPT_c128:
-    return 128;
-  }
-
-  return 0;
-}
-
-static char * ossimAuxGetDictionary(ossimAuxInfo* hHFA)
-
-{
-  int		nDictMax = 100;
-  char	*pszDictionary = (char *)malloc(nDictMax);
-  int		nDictSize = 0;
-
-  fseek(hHFA->fp, hHFA->nDictionaryPos, SEEK_SET );
-
-  while( true )
-  {
-    if( nDictSize >= nDictMax-1 )
-    {
-      nDictMax = nDictSize * 2 + 100;
-      pszDictionary = (char *) realloc(pszDictionary, nDictMax );
-    }
-
-    if( fread( pszDictionary + nDictSize, 1, 1, hHFA->fp ) < 1
-      || pszDictionary[nDictSize] == '\0'
-      || (nDictSize > 2 && pszDictionary[nDictSize-2] == ','
-      && pszDictionary[nDictSize-1] == '.') )
-      break;
-
-    nDictSize++;
-  }
-
-  pszDictionary[nDictSize] = '\0';
-
-  return( pszDictionary );
-}
-
-ossimAuxFileHandler::ossimAuxFileHandler()
-{
-  m_auxInfo = NULL;
-}
-
-ossimAuxFileHandler::~ossimAuxFileHandler()
-{
-  if (m_auxInfo != NULL)
-  {
-    delete m_auxInfo;
-    m_auxInfo = 0;
-  }
-}
-
-bool ossimAuxFileHandler::isAuxFile(const ossimFilename& file)
-{
-  bool result = false;
-
-  if ( file.exists() )
-  { 
-    ossimString ext = file.ext();
-    ext.downcase();
-    if (ext == "aux")
-    {
-      result = true;
-    }
-    else
-    {
-      result = false;
-    } 
-  } 
-
-  return result;
-}
-
-bool ossimAuxFileHandler::open(const ossimFilename& file)
-{
-   FILE	*fp = fopen(file.c_str(), "r");
-   char	header[16];
-   ossim_uint32	nHeaderPos;
-
-   if( fp == NULL )
-   {
-      return false;
-   }
-
-   fread( header, 16, 1, fp);
-  
-   char* tmpHeader = const_cast<char*>(header);
-   if(strcmp(tmpHeader,"EHFA_HEADER_TAG") != 0)
-   {
-      fclose( fp );
-      return false;
-   }
-
-   //Create the ossimAuxInfo                                          
-   m_auxInfo = new ossimAuxInfo();
-   m_auxInfo->fp = fp;
- 
-   //Where is the header?						
-   fread( &nHeaderPos, sizeof(ossim_int32), 1, fp );
-
-   fseek( fp, nHeaderPos, SEEK_SET );
-
-   fread( &(m_auxInfo->nVersion), sizeof(ossim_int32), 1, fp );
- 
-   fread( header, 4, 1, fp ); /* skip freeList */
-
-   fread( &(m_auxInfo->nRootPos), sizeof(ossim_int32), 1, fp );
- 
-   fread( &(m_auxInfo->nEntryHeaderLength), sizeof(ossim_int16), 1, fp );
-   fread( &(m_auxInfo->nDictionaryPos), sizeof(ossim_int32), 1, fp );
-  
-   fseek( fp, 0, SEEK_END );
-   m_auxInfo->nEndOfFile = (ossim_int32) ftell(fp);
-
-   m_auxInfo->m_Root = new ossimAuxEntry( m_auxInfo, m_auxInfo->nRootPos, NULL, NULL );
-
-   m_auxInfo->dictionaryData = ossimAuxGetDictionary(m_auxInfo);
-   m_auxInfo->m_Dictionary = new ossimAuxDictionary( m_auxInfo->dictionaryData );
-
-   ossimAuxEntry	*node = m_auxInfo->m_Root->getChild();
-   while( node != NULL )
-   {
-      std::string typeStr = node->getType();
-      size_t typeLen = typeStr.length();
-      std::string str = "Eimg_Layer";
-      size_t strLen = str.length();
-      if( typeLen == strLen)
-      {
-         ossimAuxEntry* projEntry = node->getNamedChild("Map_Info");
-         if( projEntry == NULL )
-         {
-            ossimAuxEntry* childEntry;
-            for( childEntry = node->getChild(); childEntry != NULL && projEntry == NULL; childEntry = childEntry->getNext() )
-            {
-               if (ossimString(childEntry->getType()) == "Eprj_MapInfo")
-                  projEntry = childEntry;
-            }
-         }
-
-         const char* proj = NULL;
-         const char* units = NULL;
-         if (projEntry)
-         {
-            proj = projEntry->getStringField("proName");
-            units = projEntry->getStringField("units");
-         }
-      
-         if (proj != NULL)
-         {
-            m_projName = ossimString(proj);
-         }
-         if (units != NULL)
-         {
-            m_unitsType = ossimString(proj);
-         }
-
-         ossimAuxEntry* datumEntry = node->getNamedChild( "Projection.Datum" );
-         const char* datumStr = NULL;
-         if (datumEntry)
-         {
-            datumStr = datumEntry->getStringField("datumname");
-         }
-         if (datumStr != NULL)
-         {
-            m_datumName = ossimString(datumStr);;
-         }
-         break;
-      }
-      node = node->getNext();
-   }
-
-   fclose(fp);
-   return true;
-}
-
-/************************************************************************/
-/*                              ossimAuxInfo()                              */
-/************************************************************************/
-ossimAuxInfo::ossimAuxInfo()
-{
-   fp = NULL;
-   m_Root = NULL;
-   m_Dictionary = NULL;
-   dictionaryData = NULL;
-}
-
-ossimAuxInfo::~ossimAuxInfo()
-{
-   if (m_Root != NULL)
-   {
-      delete m_Root;
-      m_Root = 0;
-   }
-   
-   if (m_Dictionary != NULL)
-   {
-      delete m_Dictionary;
-      m_Dictionary = 0;
-   }
-   
-   if (dictionaryData != NULL)
-   {
-      delete[] dictionaryData;
-      dictionaryData = 0;
-   }
-}
-
-/************************************************************************/
-/*                              ossimAuxEntry()                              */
-/************************************************************************/
-
-ossimAuxEntry::ossimAuxEntry(ossimAuxInfo * auxInfoIn, ossim_uint32 nPos,
-                             ossimAuxEntry * parentIn, ossimAuxEntry * prevIn)
-
-{
-   m_auxInfo = auxInfoIn;
-
-   nFilePos = nPos;
-  
-   m_Parent = parentIn;
-   m_Prev = prevIn;
-
-   m_Next = NULL;
-   m_Child = NULL;
-   entryData = NULL;
-
-   nDataPos = nDataSize = 0;
-   nNextPos = nChildPos = 0;
-
-   entryNodeName[0] = entryType[0] = '\0';
-
-   ossim_int32	anEntryNums[6];
- 
-   if( fseek( m_auxInfo->fp, nFilePos, SEEK_SET ) == -1
-       || fread( anEntryNums, sizeof(ossim_uint32), 6, m_auxInfo->fp ) < 1 )
-   {
-      return;
-   }
-
-   nNextPos = anEntryNums[0];
-   nChildPos = anEntryNums[3];
-   nDataPos = anEntryNums[4];
-   nDataSize = anEntryNums[5];
-
-   if( fread( entryNodeName, 1, 64, m_auxInfo->fp ) < 1
-       || fread( entryType, 1, 32, m_auxInfo->fp ) < 1 )
-   {
-      return;
-   }
-}
-ossimAuxEntry::~ossimAuxEntry()
-{
-   if( entryData != NULL )
-   {
-      delete entryData;
-      entryData = 0;
-   }
-
-   if( m_Next != NULL )
-   {
-      delete m_Next;
-      m_Next = 0;
-   }
-
-   if( m_Child != NULL )
-   {
-      delete m_Child;
-      m_Child = 0;
-   }
-}
-
-void ossimAuxEntry::setName( const char *nodeName )
-{
-   memset( entryNodeName, '\0', 64 );
-   strncpy( entryNodeName, nodeName, 64 );
-}
-
-ossimAuxEntry *ossimAuxEntry::getChild()
-{
-   if( m_Child == NULL && nChildPos != 0 )
-   {
-      m_Child = new ossimAuxEntry( m_auxInfo, nChildPos, this, NULL );
-   }
-
-   return( m_Child );
-}
-
-ossimAuxEntry* ossimAuxEntry::getNext()
-{
-   if( m_Next == NULL && nNextPos != 0 )
-   {
-      // Check if we have a loop on the next node in this sibling chain.
-      ossimAuxEntry *past;
-
-      for( past = this; 
-           past != NULL && past->nFilePos != nNextPos; 
-           past = past->m_Prev ) {}
-
-      if( past != NULL )
-      {
-         nNextPos = 0;
-         return NULL;
-      }
-
-      m_Next = new ossimAuxEntry(m_auxInfo, nNextPos, m_Parent, this );
-   }
-
-   return( m_Next );
-}
-
-void ossimAuxEntry::loadData()
-{
-   if( entryData != NULL || nDataSize == 0 )
-   {
-      return;
-   }
-
-   entryData = (char*) malloc(nDataSize);
-   if (entryData == NULL)
-   {
-      return;
-   }
-
-   if(fseek(m_auxInfo->fp, nDataPos, SEEK_SET ) < 0 )
-   {
-      return;
-   }
-
-   if( fread( entryData, 1, nDataSize, m_auxInfo->fp ) < 1 )
-   {
-      return;
-   }
-
-   m_Type = m_auxInfo->m_Dictionary->findType( entryType );
-   if(m_Type == NULL)
-   {
-      return;
-   }
-}
-
-ossimAuxEntry* ossimAuxEntry::getNamedChild( const char* name )
-{
-   int		nNameLen;
-   ossimAuxEntry	*entry;
-
-   for( nNameLen = 0;
-        name[nNameLen] != '.'
-           && name[nNameLen] != '\0'
-           && name[nNameLen] != ':';
-        nNameLen++ ) {}
-
-  
-   for( entry = getChild(); entry != NULL; entry = entry->getNext() )
-   {
-      std::string tmpEntryName = const_cast<char*>(entry->getName());
-      tmpEntryName = tmpEntryName.substr(0, nNameLen);
-      std::string tmpName = const_cast<char*>(name);
-      tmpName = tmpName.substr(0, nNameLen);
-      if( strcmp(tmpEntryName.c_str(),tmpName.c_str()) == 0
-          && (int) strlen(entry->getName()) == nNameLen )
-      {
-         if( name[nNameLen] == '.' )
-         {
-            ossimAuxEntry *result;
-
-            result = entry->getNamedChild( name+nNameLen+1 );
-            if( result != NULL )
-               return result;
-         }
-         else
-            return entry;
-      }
-   }
-
-   return NULL;
-}
-
-int ossimAuxEntry::getFieldValue( const char * auxFieldPath,
-                                  char chReqType, void *reqReturn )
-{
-   ossimAuxEntry	*entry = this;
-
-   if( strchr(auxFieldPath,':') != NULL )
-   {
-      entry = getNamedChild( auxFieldPath );
-      if( entry == NULL )
-         return false;
-
-      auxFieldPath = strchr(auxFieldPath,':') + 1;
-   }
-
-   loadData();
-
-   if( entryData == NULL )
-   {
-      return false;
-   }
-
-   if( m_Type == NULL )
-   {
-      return false;
-   }
-
-   return (m_Type->extractInstValue( auxFieldPath,
-                                     entryData, nDataPos, nDataSize,
-                                     chReqType, reqReturn ));
-}
-
-ossim_int16 ossimAuxEntry::getIntField(const char* auxFieldPath)
-{
-   ossim_int16	nIntValue;
-
-   if( !getFieldValue( auxFieldPath, 'i', &nIntValue ) )
-   {
-      return 0;
-   }
-   else
-   {
-      return nIntValue;
-   }
-}
-
-const char* ossimAuxEntry::getStringField( const char* auxFieldPath)
-{
-   char *result = NULL;
-
-   if( !getFieldValue( auxFieldPath, 's', &result ) )
-   {
-      return NULL;
-   }
-   else
-   {
-      return result;
-   }
-}
-
-/************************************************************************/
-/*                              ossimAuxField()                              */
-/************************************************************************/
-
-ossimAuxField::ossimAuxField()
-{
-   nBytes = 0;
-
-   nItemCount = 0;
-   chPointer = '\0';
-   chItemType = '\0';
-
-   itemObjectType = NULL;
-   m_auxItemObjectType = NULL;
-
-   enumNames = NULL;
-   fieldName = NULL;
-}
-
-ossimAuxField::~ossimAuxField()
-{
-   if (itemObjectType != NULL)
-   {
-      delete[] itemObjectType;
-      itemObjectType = 0;
-   }
-
-   if (enumNames != NULL)
-   {
-      delete[] enumNames;
-      enumNames = 0;
-   }
-
-   if (fieldName != NULL)
-   {
-      delete[] fieldName;
-      fieldName = 0;
-   }
-}
-
-int ossimAuxField::extractInstValue( const char* /* auxField */, int nIndexValue,
-                                     char* entryData, ossim_uint32 nDataOffset, int nDataSize,
-                                     char chReqType, void *reqReturn )
-
-{
-   int			nInstItemCount = getInstCount( entryData, nDataSize );
-  
-   if( nIndexValue < 0 || nIndexValue >= nInstItemCount )
-   {
-      if( chItemType == 'b' && nIndexValue >= -3 && nIndexValue < 0 )
-         /* ok - special index values */;
-      else
-         return false;
-   }
-
-   if( chPointer != '\0' )
-   {
-      ossim_uint32	nOffset;
-
-      memcpy( &nOffset, entryData+4, 4 );
-  
-      entryData += 8;
-
-      nDataOffset += 8;
-      nDataSize -= 8;
-   }
-
-   if( (chItemType == 'c' || chItemType == 'C') && chReqType == 's' )
-   {
-      *((char **)reqReturn) = entryData;
-      return( entryData != NULL );
-   }
-
-   return false;
-}
-
-int ossimAuxField::getInstCount( char * entryData, int nDataSize )
-{
-   if( chPointer == '\0' )
-      return nItemCount;
-   else if( chItemType == 'b' )
-   {
-      ossim_int32 nRows, nColumns;
-
-      if( nDataSize < 20 )
-         return 0;
-
-      memcpy( &nRows, entryData+8, 4 );
-      ossimAuxStandardFile( 4, &nRows );
-      memcpy( &nColumns, entryData+12, 4 );
-      ossimAuxStandardFile( 4, &nColumns );
-
-      return nRows * nColumns;
-   }
-   else
-   {
-      ossim_int32 nCount;
-
-      if( nDataSize < 4 )
-         return 0;
-
-      memcpy( &nCount, entryData, 4 );
-      ossimAuxStandardFile( 4, &nCount );
-      return nCount;
-   }
-}
-
-void ossimAuxField::completeDefn( ossimAuxDictionary * auxDict )
-
-{
-   if( itemObjectType != NULL )
-   {
-      m_auxItemObjectType = auxDict->findType( itemObjectType );
-   }
-
-   if( chPointer == 'p' )
-   {
-      nBytes = -1; /* we can't know the instance size */
-   }
-   else if( m_auxItemObjectType != NULL )
-   {
-      m_auxItemObjectType->completeDefn( auxDict );
-      if( m_auxItemObjectType->nBytes == -1 )
-      {
-         nBytes = -1;
-      }
-      else
-      {
-         nBytes = m_auxItemObjectType->nBytes * nItemCount;
-      }
-
-      if( chPointer == '*' && nBytes != -1 )
-      {
-         nBytes += 8; /* count, and offset */
-      }
-   }
-   else
-   {
-      nBytes = auxDict->getItemSize( chItemType ) * nItemCount;
-   }
-}
-
-const char *ossimAuxField::initialize( const char * fieldInput )
-{
-   int		i;
-   nItemCount = atoi(fieldInput);
-
-   while( *fieldInput != '\0' && *fieldInput != ':' )
-   {
-      fieldInput++;
-   }
-
-   if( *fieldInput == '\0' )
-   {
-      return NULL;
-   }
-
-   fieldInput++;
-
-   if( *fieldInput == 'p' || *fieldInput == '*' )
-      chPointer = *(fieldInput++);
-
-   if( *fieldInput == '\0' )
-      return NULL;
-
-   chItemType = *(fieldInput++);
-
-   if( chItemType == 'o' )
-   {
-      for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
-
-      itemObjectType = (char *) malloc(i+1);
-      strncpy( itemObjectType, fieldInput, i );
-      itemObjectType[i] = '\0';
-
-      fieldInput += i+1;
-   }
-
-   if( chItemType == 'x' && *fieldInput == '{' )
-   {
-      int nBraceDepth = 1;
-      fieldInput++;
-
-      // Skip past the definition.
-      while( nBraceDepth > 0 && *fieldInput != '\0' )
-      {
-         if( *fieldInput == '{' )
-            nBraceDepth++;
-         else if( *fieldInput == '}' )
-            nBraceDepth--;
-
-         fieldInput++;
-      }
-
-      chItemType = 'o';
-
-      // find the comma terminating the type name.
-      for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
-
-      itemObjectType = (char *) malloc(i+1);
-      strncpy( itemObjectType, fieldInput, i );
-      itemObjectType[i] = '\0';
-
-      fieldInput += i+1;
-   }
-
-   if( chItemType == 'e' )
-   {
-      int	nEnumCount = atoi(fieldInput);
-      int	iEnum;
-
-      fieldInput = strchr(fieldInput,':');
-      if( fieldInput == NULL )
-         return NULL;
-
-      fieldInput++;
-
-      enumNames = (char **) calloc(sizeof(char *), nEnumCount+1);
-
-      for( iEnum = 0; iEnum < nEnumCount; iEnum++ )
-      {
-         char	*pszToken;
-
-         for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
-
-         if( fieldInput[i] != ',' )
-            return NULL;
-
-         pszToken = (char *) malloc(i+1);
-         strncpy( pszToken, fieldInput, i );
-         pszToken[i] = '\0';
-
-         enumNames[iEnum] = pszToken;
-
-         fieldInput += i+1;
-      }
-   }
-
-   for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
-
-   fieldName = (char *) malloc(i+1);
-   strncpy( fieldName, fieldInput, i );
-   fieldName[i] = '\0';
-
-   fieldInput += i+1;
-
-   return( fieldInput );
-}
-
-int ossimAuxField::getInstBytes( char *entryData, int nDataSize )
-
-{
-   int		nCount;
-   int		nInstBytes = 0;
-
-   if( nBytes > -1 )
-      return nBytes;
-
-   if( chPointer != '\0' )
-   {
-      memcpy( &nCount, entryData, 4 );
-      ossimAuxStandardFile( 4, &nCount );
-
-      entryData += 8;
-      nInstBytes += 8;
-   }
-   else
-      nCount = 1;
-
-   if( chItemType == 'b' && nCount != 0 ) // BASEDATA
-   {
-      ossim_int32 nRows, nColumns;
-      ossim_int16 nBaseItemType;
-
-      memcpy( &nRows, entryData, 4 );
-      ossimAuxStandardFile( 4, &nRows );
-      memcpy( &nColumns, entryData+4, 4 );
-      ossimAuxStandardFile( 4, &nColumns );
-      memcpy( &nBaseItemType, entryData+8, 2 );
-      ossimAuxStandardFile( 2, &nBaseItemType );
-
-      nInstBytes += 12;
-
-      nInstBytes += 
-         ((ossimAuxGetDataTypeBits(nBaseItemType) + 7) / 8) * nRows * nColumns;
-   }
-   else if( m_auxItemObjectType == NULL )
-   {
-      nInstBytes += nCount * ossimAuxDictionary::getItemSize(chItemType);
-   }
-   else
-   {
-      int		i;
-
-      for( i = 0; i < nCount; i++ )
-      {
-         int	nThisBytes;
-
-         nThisBytes =
-            m_auxItemObjectType->getInstBytes( entryData,
-                                               nDataSize - nInstBytes );
-         nInstBytes += nThisBytes;
-         entryData += nThisBytes;
-      }
-   }
-
-   return( nInstBytes );
-}
-
-/************************************************************************/
-/*                              ossimAuxType()                              */
-/************************************************************************/
-ossimAuxType::ossimAuxType()
-{
-   nBytes = 0;
-   nFields = 0;
-   m_auxFields = NULL;
-   auxTypeName = NULL;
-}
-
-ossimAuxType::~ossimAuxType()
-{
-   for(int i = 0; i < nFields; i++ )
-   {
-      delete m_auxFields[i];
-      m_auxFields[i] = 0;
-   }
-
-   if (auxTypeName != NULL)
-   {
-      delete[] auxTypeName;
-      auxTypeName = 0;
-   }
-}
-
-const char* ossimAuxType::initialize( const char * typeInput )
-{
-   int		i;
-   if( *typeInput != '{' )
-   {
-      while( *typeInput != '{' && *typeInput != '\0' )
-         typeInput++;
-
-      if( *typeInput == '\0' )
-         return NULL;
-   }
-
-   typeInput++;
-
-   while( typeInput != NULL && *typeInput != '}' )
-   {
-      ossimAuxField	*newField = new ossimAuxField();
-
-      typeInput = newField->initialize( typeInput );
-      if( typeInput != NULL )
-      {
-         m_auxFields = (ossimAuxField **)realloc(m_auxFields, sizeof(void*) * (nFields+1) );
-         m_auxFields[nFields++] = newField;
-      }
-      else
-      {
-         delete newField;
-      }
-   }
-
-   if( typeInput == NULL )
-   {
-      return NULL;
-   }
-
-   typeInput++; /* skip `}' */
-
-   for( i = 0; typeInput[i] != '\0' && typeInput[i] != ','; i++ ) {}
-
-   auxTypeName = (char *) malloc(i+1);
-   strncpy( auxTypeName, typeInput, i );
-   auxTypeName[i] = '\0';
-
-   typeInput += i+1;
-
-   return( typeInput );
-}
-
-void ossimAuxType::completeDefn( ossimAuxDictionary* auxDict )
-{
-   int		i;
-
-   if( nBytes != 0 )
-      return;
-
-   for( i = 0; i < nFields; i++ )
-   {
-      m_auxFields[i]->completeDefn( auxDict );
-      if( m_auxFields[i]->nBytes < 0 || nBytes == -1 )
-      {
-         nBytes = -1;
-      }
-      else
-      {
-         nBytes += m_auxFields[i]->nBytes;
-      }
-   }
-}
-
-int ossimAuxType::extractInstValue( const char * auxFieldPath,
-                                    char *entryData, ossim_uint32 nDataOffset, int nDataSize,
-                                    char chReqType, void *reqReturn )
-
-{
-   int		nArrayIndex = 0, nNameLen, iField, nByteOffset;
-   const char	*remainder;
-
-   const char *firstArray = strchr(auxFieldPath,'[');
-   const char *firstDot = strchr(auxFieldPath,'.');
-
-   if( firstArray != NULL
-       && (firstDot == NULL
-           || firstDot > firstArray) )
-   {
-      const char	*theEnd = firstArray;
-
-      nArrayIndex = atoi(theEnd+1);
-      nNameLen = theEnd - auxFieldPath;
-
-      remainder = strchr(auxFieldPath,'.');
-      if( remainder != NULL )
-      {
-         remainder++;
-      }
-   }
-   else if( firstDot != NULL )
-   {
-      const char	*theEnd = firstDot;
-
-      nNameLen = theEnd - auxFieldPath;
-
-      remainder = theEnd + 1;
-   }
-   else
-   {
-      nNameLen = (int)strlen(auxFieldPath);
-      remainder = NULL;
-   }
-
-   //Find this field within this type, if possible.                 
-   nByteOffset = 0;
-   for( iField = 0; iField < nFields && nByteOffset < nDataSize; iField++ )
-   {
-      std::string tmpFieldPath = const_cast<char*>(auxFieldPath);
-      tmpFieldPath = tmpFieldPath.substr(0, nNameLen);
-      std::string tmpFieldName = const_cast<char*>(m_auxFields[iField]->fieldName);
-      tmpFieldName = tmpFieldName.substr(0, nNameLen);
-      if( strcmp(tmpFieldPath.c_str(),tmpFieldName.c_str()) == 0
-          && m_auxFields[iField]->fieldName[nNameLen] == '\0' )
-      {
-         break;
-      }
-
-      nByteOffset +=
-         m_auxFields[iField]->getInstBytes( entryData + nByteOffset,
-                                            nDataSize - nByteOffset );
-   }
-
-   if( iField == nFields || nByteOffset >= nDataSize )
-   {
-      return false;
-   }
-
-   //Extract this field value, and return.                          
-   return( m_auxFields[iField]->
-           extractInstValue( remainder, nArrayIndex,
-                             entryData + nByteOffset,
-                             nDataOffset + nByteOffset,
-                             nDataSize - nByteOffset,
-                             chReqType, reqReturn ) );
-}
-
-int ossimAuxType::getInstBytes( char* entryData, int nDataSize )
-{
-   if( nBytes >= 0 )
-   {
-      return( nBytes );
-   }
-   else
-   {
-      int	nTotal = 0;
-      int	iField;
-
-      for( iField = 0; iField < nFields && nTotal < nDataSize; iField++ )
-      {
-         ossimAuxField	*poField = m_auxFields[iField];
-
-         int nInstBytes = poField->getInstBytes( entryData,
-                                                 nDataSize - nTotal );
-
-         entryData += nInstBytes;
-         nTotal += nInstBytes;
-      }
-
-      return( nTotal );
-   }
-}
-
-/************************************************************************/
-/*                              ossimAuxDictionary()                              */
-/************************************************************************/
-static const char *defDefn[] = {
-   "Eprj_MapInfo", 
-   "{0:pcproName,1:*oEprj_Coordinate,upperLeftCenter,1:*oEprj_Coordinate,lowerRightCenter,1:*oEprj_Size,pixelSize,0:pcunits,}Eprj_MapInfo",
-   NULL,
-   NULL };
-
-ossimAuxDictionary::ossimAuxDictionary( const char* auxDictStr )
-{
-   int		i;
-   nTypes = 0;
-   nTypesMax = 0;
-   m_auxTypes = NULL;
-
-   //Read all the types.            
-   while( auxDictStr != NULL && *auxDictStr != '.' )
-   {
-      ossimAuxType* newType = new ossimAuxType();
-      auxDictStr = newType->initialize( auxDictStr );
-
-      if( auxDictStr != NULL )
-      {
-         addType( newType );
-      }
-      else
-      {
-         delete newType;
-      }
-   }
-
-   for( i = 0; defDefn[i] != NULL; i += 2 )
-   {
-      if( findType( defDefn[i] ) == NULL )
-      {
-         ossimAuxType *newType = new ossimAuxType();
-
-         newType->initialize( defDefn[i+1] );
-         addType( newType );
-      }
-   }
-
-   //Complete the definitions.    
-   for( i = 0; i < nTypes; i++ )
-   {
-      m_auxTypes[i]->completeDefn( this );
-   }
-}
-
-ossimAuxDictionary::~ossimAuxDictionary()
-{
-   for(int i = 0; i < nTypes; i++ )
-   {
-      delete m_auxTypes[i];
-      m_auxTypes[i] = 0;
-   }
-}
-
-void ossimAuxDictionary::addType( ossimAuxType *type )
-
-{
-   if( nTypes == nTypesMax )
-   {
-      nTypesMax = nTypes * 2 + 10;
-      m_auxTypes = (ossimAuxType **) realloc( m_auxTypes,
-                                              sizeof(void*) * nTypesMax );
-   }
-
-   m_auxTypes[nTypes++] = type;
-}
-
-ossimAuxType* ossimAuxDictionary::findType( const char * name )
-
-{
-   int		i;
-
-   for( i = 0; i < nTypes; i++ )
-   {
-      if( strcmp(name, m_auxTypes[i]->auxTypeName) == 0 )
-      {
-         return( m_auxTypes[i] );
-      }
-   }
-
-   return NULL;
-}
-
-int ossimAuxDictionary::getItemSize( char chType )
-
-{
-   switch( chType )
-   {
-      case '1':
-      case '2':
-      case '4':
-      case 'c':
-      case 'C':
-         return 1;
-
-      case 'e':
-      case 's':
-      case 'S':
-         return 2;
-
-      case 't':
-      case 'l':
-      case 'L':
-      case 'f':
-         return 4;
-
-      case 'd':
-      case 'm':
-         return 8;
-
-      case 'M':
-         return 16;
-
-      case 'b':
-         return -1;
-
-      case 'o':
-      case 'x':
-         return 0;
-   }
-
-   return 0;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimAuxXmlSupportData.cpp b/ossim/src/ossim/support_data/ossimAuxXmlSupportData.cpp
deleted file mode 100644
index aee64dc..0000000
--- a/ossim/src/ossim/support_data/ossimAuxXmlSupportData.cpp
+++ /dev/null
@@ -1,352 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Utility/support data class to extract the projection from a dot aux dot xml
-// file commonly found with mrsid data.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/support_data/ossimAuxXmlSupportData.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimXmlAttribute.h>
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimProjection.h>
-#include <fstream>
-#include <ostream>
-
-// Static trace for debugging.
-static const ossimTrace traceDebug( ossimString("ossimAuxXmlSupportData:debug") );
-
-ossimAuxXmlSupportData::ossimAuxXmlSupportData()
-{
-}
-
-ossimAuxXmlSupportData::~ossimAuxXmlSupportData()
-{
-}
-
-ossimRefPtr<ossimProjection> ossimAuxXmlSupportData::getProjection(const ossimFilename& file) const
-{
-   ossimRefPtr<ossimProjection> result = 0;
-
-   std::ifstream is(file.c_str(), std::ios_base::binary|std::ios_base::in);
-
-   if ( is.good() )
-   {
-      // Read the xml document:
-      ossimXmlDocument xdoc;
-      if ( xdoc.read( is ) )
-      {
-         // Get the WKT string
-         ossimString wkt;
-         ossimString path = "/PAMDataset/Metadata/GeodataXform/SpatialReference/WKT";
-         if ( getPath( path, xdoc, wkt ) )
-         {
-            if ( wkt.size() )
-            {
-               // Substitute """:
-               ossimString tmpWkt = wkt.substitute( ossimString("""), ossimString(""), true );
-               
-               ossimString name;
-               if ( getProjcsName( tmpWkt.string(), name.string() ) )
-               {
-                  result = ossimProjectionFactoryRegistry::instance()->createProjection( name );
-                  if ( result.valid() == false )
-                  {
-                     // Hack...
-                     if ( name.contains("_NAD83_") )
-                     {
-                        cout << "name1: " << name << endl;
-                        name.gsub( ossimString("Georef_NAD83_m"), ossimString("GeoRef_M"), false );
-                        name.string() = std::string("NAD_1983_") + name.string();
-                        cout << "name2: " << name << endl;
-                        result = ossimProjectionFactoryRegistry::instance()->
-                           createProjection( name );
-                     }
-                  }
-                  
-                  if ( result.valid() )
-                  {
-                     if ( initializeProjection( xdoc, tmpWkt.string(), result.get() ) == false )
-                     {
-                        // Zero out the result if tie or scale not set.
-                        result = 0;
-                     }
-                  }
-               }
-            }
-         }
-      }  
-   }
-   
-   return result;
-   
-} // End: ossimAuxXmlSupportData::getProjection
-
-bool ossimAuxXmlSupportData::initializeProjection( const ossimXmlDocument xdoc,
-                                                   const std::string& wkt, 
-                                                   ossimProjection* proj ) const
-{
-   bool result = false;
-
-   ossimRefPtr<ossimMapProjection> mapProj = dynamic_cast<ossimMapProjection*>( proj );
-   if ( mapProj.valid() )
-   {
-      // Find the tie and scale.
-      ossimString path = "/PAMDataset/Metadata/MDI";
-      std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
-      xdoc.findNodes(path, xnodes);
-      if ( xnodes.size() )
-      {
-         ossimDpt tie;
-         ossimDpt scale;
-         tie.makeNan();
-         scale.makeNan();
-         
-         for ( ossim_uint32 i = 0; i < xnodes.size(); ++i )
-         {
-            if ( xnodes[i].valid() )
-            {
-               ossimString value;
-               ossimString attrName = "key";
-               
-               ossimRefPtr<ossimXmlAttribute> attr = xnodes[i]->findAttribute( attrName );
-               if ( attr.valid() )
-               {
-                  if (attr->getValue() == "IMAGE__XY_ORIGIN" )
-                  {
-                     value = xnodes[i]->getText();
-                     if ( value.size() )
-                     {
-                        // Split it:
-                        std::vector<ossimString> list;
-                        value.split( list, ossimString(","), true );
-                        if ( list.size() == 2 )
-                        {
-                           if ( list[0].size() )
-                           {
-                              tie.x = list[0].toFloat64();
-                           }
-                           if ( list[1].size() )
-                           {
-                              tie.y = list[1].toFloat64();
-                           }
-                        }
-                     }
-                  }
-                  else if (attr->getValue() == "IMAGE__X_RESOLUTION" )
-                  {
-                     value = xnodes[i]->getText();
-                     if ( value.size() )
-                     {
-                        scale.x = value.toFloat64();
-                     }
-                  }
-                  else if (attr->getValue() == "IMAGE__Y_RESOLUTION" )
-                  {
-                     value = xnodes[i]->getText();
-                     if ( value.size() )
-                     {
-                        scale.y = value.toFloat64();
-                     }
-                  }
-               }
-               
-            } // Matches: if ( xnodes[i].valid() )
-            
-         } // Matches: for ( ossim_uint32 i = 0; i < xnodes.size(); ++i )
-
-         if ( !tie.hasNans() && !scale.hasNans() )
-         {
-            if ( mapProj->isGeographic() )
-            {
-               // Assuming tie and scale in decimal degrees:
-               mapProj->setDecimalDegreesPerPixel( scale );
-               ossimGpt gpt(tie.y, tie.x, 0.0);
-               mapProj->setUlTiePoints( ossimGpt( gpt ) );
-               result = true;
-            }
-            else
-            {
-               // Get the units:
-               ossimUnitType units = getUnits( wkt );
-
-               // Convert to meters:
-               result = true;
-               if ( units != OSSIM_METERS )
-               {
-                  if ( units == OSSIM_FEET )
-                  {
-                     tie.x = tie.x * MTRS_PER_FT;
-                     tie.y = tie.y * MTRS_PER_FT;
-                     scale.x = scale.x * MTRS_PER_FT;
-                     scale.y = scale.y * MTRS_PER_FT;                     
-                  }
-                  else if ( units == OSSIM_US_SURVEY_FEET)
-                  {
-                     tie.x = tie.x * US_METERS_PER_FT;
-                     tie.y = tie.y * US_METERS_PER_FT;
-                     scale.x = scale.x * OSSIM_US_SURVEY_FEET;
-                     scale.y = scale.y * OSSIM_US_SURVEY_FEET;
-                  }
-                  else
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << "ossimAuxXmlSupportData::initializeProjection WARNING: "
-                        << "Unhandled unit type: " << units << std::endl;
-                     result = false;
-                  }
-               }
-
-               if ( result )
-               {
-                  mapProj->setMetersPerPixel( scale );
-                  mapProj->setUlTiePoints( tie );
-               }
-            }
-         }
-         
-      } // Matches: if ( xnodes.size() ) 
-   }
-
-   return result;
-   
-} // ossimAuxXmlSupportData::initializeProjection
-
-bool ossimAuxXmlSupportData::getPath(
-   const ossimString& path, const ossimXmlDocument& xdoc, ossimString& s) const
-{
-   bool result = false;
-
-   std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
-   xdoc.findNodes(path, xnodes);
-   if ( xnodes.size() == 1 ) // Error if more than one.
-   {
-      if ( xnodes[0].valid() )
-      {
-         s = xnodes[0]->getText();
-         result = true;
-      }
-      else if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimAuxXmlSupportData::getPath ERROR:\n"
-            << "Node not found: " << path
-            << std::endl;
-      }
-   }
-   else if ( xnodes.size() == 0 )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimAuxXmlSupportData::getPath ERROR:\n"
-            << "Node not found: " << path
-            << std::endl;
-      }
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimAuxXmlSupportData::getPath ERROR:\n"
-            << "Multiple nodes found: " << path
-            << std::endl;
-      }
-   }
-
-   if (!result)
-   {
-      s.clear();
-   }
-   return result;
-   
-} // bool ossimAuxXmlSupportData::getPath
-
-
-
-bool ossimAuxXmlSupportData::getProjcsName( const std::string& wkt,
-                                            std::string& name ) const
-{
-   bool result = false;
-   
-   if ( wkt.size() )
-   {
-      // Find "PROJCS":
-      std::string::size_type startPos = wkt.find( std::string("PROJCS[") );
-      if ( startPos != std::string::npos )
-      {
-         startPos += 7; // Move to end of projcs[ string.
-         
-         // Find first comma ',':
-         std::string::size_type endPos = wkt.find( ',', startPos+1 );
-         if ( endPos != std::string::npos )
-         {
-            if ( startPos < endPos )
-            {
-               name = wkt.substr( startPos, endPos-startPos );
-               if ( name.size() )
-               {
-                  result = true;
-               }
-            }
-         }
-      }
-   }
-   
-   return result;
-                  
-} // End: ossimAuxXmlSupportData::getProgcsName
-
-ossimUnitType ossimAuxXmlSupportData::getUnits( const std::string& wkt ) const
-{
-   ossimUnitType units = OSSIM_UNIT_UNKNOWN;
-   if ( wkt.size() )
-   {
-      // Note this is order dependent, i.e. you have to look for "Foot_US" before "Foot".
-      ossimString os = wkt;
-      os.downcase();
-      if ( os.contains("feet_intl") )
-      {
-         units = OSSIM_FEET;
-      }
-      else if ( os.contains("foot_us") )
-      {
-         units = OSSIM_US_SURVEY_FEET;
-      }
-      else if ( os.contains("feet") || os.contains("foot") )
-      {
-         units = OSSIM_FEET;
-      }
-      //---
-      // There can be two "unit" blocks.  One for PROJCS and one for GEOGCS.
-      // Do this last as the GEOGCS block will have Degree in it. May need to split
-      // the two blocks and then search if this doesn't work.
-      //---
-      else if ( os.contains("degree") )
-      {
-         units = OSSIM_DEGREES;
-      }
-   }
-
-   return units;
-   
-} // End: ossimAuxXmlSupportData::getUnits
-
diff --git a/ossim/src/ossim/support_data/ossimCcfInfo.cpp b/ossim/src/ossim/support_data/ossimCcfInfo.cpp
deleted file mode 100644
index 1ade24c..0000000
--- a/ossim/src/ossim/support_data/ossimCcfInfo.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CCF Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <iostream>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/support_data/ossimCcfInfo.h>
-#include <ossim/imaging/ossimCcfHead.h>
-
-ossimCcfInfo::ossimCcfInfo()
-   : theFile()
-{
-}
-
-ossimCcfInfo::~ossimCcfInfo()
-{
-}
-
-bool ossimCcfInfo::open(const ossimFilename& file)
-{
-   bool result = false;
-
-   ossimString extension = file.ext();
-
-   extension.downcase();
-
-   if (extension == "ccf")
-   {
-      theFile = file;
-      result = true;
-   }
-   else
-   {
-      theFile.clear();
-   }
-
-   return result;
-}
-
-std::ostream& ossimCcfInfo::print(std::ostream& out) const
-{
-   
-   if ( theFile.size() )
-   {
-      ossimCcfHead ccf(theFile);
-      out << "File:  " << theFile << "\n" << ccf;
-   }
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDemGrid.cpp b/ossim/src/ossim/support_data/ossimDemGrid.cpp
deleted file mode 100644
index 4f8a5ca..0000000
--- a/ossim/src/ossim/support_data/ossimDemGrid.cpp
+++ /dev/null
@@ -1,235 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Ken Melero (kmelero at imagelinks.com)
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class defines a DEM grid.
-//
-//********************************************************************
-// $Id: ossimDemGrid.cpp 9094 2006-06-13 19:12:40Z dburken $
-
-#include <ossim/support_data/ossimDemGrid.h>
-#include <ossim/support_data/ossimDemPoint.h>
-#include <ossim/support_data/ossimDemUtil.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-ossimDemGrid::ossimDemGrid(ossim_float32 missingDataValue)
-   : _missDataVal(missingDataValue),
-     _width(0),
-     _height(0),
-     _grid(0),
-     _firstTime(true),
-     _curProfile(0)
-{        
-}
-
-ossimDemGrid::~ossimDemGrid()
-{
-   if(_grid) delete [] _grid; _grid =0;
-}
-
-long
-ossimDemGrid::read(std::istream& dem, bool incrementalRead)
-{
-   if (_firstTime)
-   {
-      dem >> _header;
-   }
-
-   long retval;
-   if (_header.getGroundRefSysCode() == 0)  // Geographic
-      retval = fillGeographic(dem,incrementalRead);
-   else
-      retval = fillUTM(dem,incrementalRead);   // This may not work if it's 
-                                               // really in State Plane.
-
-   if (_firstTime)
-      _firstTime = false;
-
-   return retval;
-}
-
-ossimDemHeader const&
-ossimDemGrid::getHeader() const
-{
-   return _header;
-}
-
-long
-ossimDemGrid::getWidth() const
-{
-   return _width;
-}
-
-long
-ossimDemGrid::getHeight() const
-{
-   return _height;
-}
-
-ossim_float32 ossimDemGrid::getElevation(long x, long y) const
-{
-   if (_grid == 0)
-      return _missDataVal;
-
-   if ((x < 0) || (y < 0) || (x >= _width) || (y >= _height))
-      return _missDataVal;
-
-   return _grid[(y * _width) + x];
-}
-
-ossim_float32 ossimDemGrid::getMissingDataValue() const
-{
-   return _missDataVal;
-}
-
-long ossimDemGrid::fillGeographic(std::istream& dem,bool incrementalRead)
-{
-   if (_firstTime) {
-      _curProfile = 0;
-      _width = _header.getProfileColumns();
-   }
-
-   while (_curProfile < _width)
-   {
-      _profiles.push_back(ossimDemProfile());
-      dem >> _profiles.back();
-      _curProfile++;
-      if (incrementalRead)
-         return _width - _curProfile + 1;
-   }
-
-   // Assume all profiles have as many elevations as the first.
-   _height = _profiles[0].getNumberOfElevations();
-   if(_grid) delete [] _grid; _grid =0;
-   _grid = new ossim_float32[_width * _height];
-
-   ossimDemPoint sw_corner = _profiles[0].getProfileLocation();
-   _northwest_x = sw_corner.getX();
-   _northwest_y = sw_corner.getY() 
-                  + ((_profiles[0].getNumberOfElevations() - 1) * _header.getSpatialResY());
-
-
-   unsigned int i,j;
-   for (i = 0; (int)i < _width; i++)
-   {
-      ossimDemElevationVector const& elev = _profiles[i].getElevations();
-      for (j = 0; j < elev.size(); j++)
-      {
-         setElevation(i, _height - j - 1, elev[j]);
-      }
-   }
-
-   _profiles.erase(_profiles.begin(), _profiles.end());
-
-   return 0;
-}
-
-long
-ossimDemGrid::fillUTM(std::istream& dem, bool incrementalRead)
-{
-   // 7.5 UTM DEMs are small enough we can get away with doing this stupid...
-
-   unsigned int i;
-   unsigned int x,y;
-
-   if (_firstTime)
-   {
-      _curProfile = 0;
-      _width = _header.getProfileColumns();
-   }
-
-
-   while (_curProfile < _width)
-   {
-      _profiles.push_back(ossimDemProfile());
-      dem >> _profiles.back();
-      _curProfile++;
-      if (incrementalRead)
-         return _width - _curProfile + 1;
-   }
-
-   double dy = _header.getSpatialResY();
-
-   // Determine min and max Y values.
-   // Some DEMs can have profiles which do not have any
-   // elevations, and erroneous (x,y) values. I suspect
-   // these are probably illegal DEMs, but we'll try to
-   // do the right thing anyway.
-   ossimDemPoint curpoint;
-   i = 0;
-   while ((_profiles[i].getNumberOfElevations() == 0) &&
-          (i < _profiles.size()))
-      i++;
-   if (i < _profiles.size())
-      curpoint = _profiles[i].getProfileLocation();
-   else
-   {
-      // XXX This isn't the best way to handle this...
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDemGrid::fillUTM: Yikes! All profiles have zero elevations!\n";
-      return(1);
-   }
- 
-   double miny, maxy;
-   miny = curpoint.getY();
-   maxy = miny;
-   double profymin, profymax;  // Min and max y values for current profile.
-   for (i = 0; i < _profiles.size(); i++)
-   {
-      if (_profiles[i].getNumberOfElevations() > 0)
-      {
-         curpoint = _profiles[i].getProfileLocation();
-         profymin = curpoint.getY();
-         profymax = profymin + ((_profiles[i].getNumberOfElevations() - 1) * dy);
-
-         if (profymin < miny)
-            miny = profymin;
-         if (profymax > maxy)
-            maxy = profymax;
-      }
-   }
-
-   // We now have minimum and maximum y values over all profiles in the DEM.
-   // Allocate a rectangular array large enough to hold them.
-
-   _height = static_cast<long>(((maxy - miny) / dy) + 1);
-   if(_grid) delete [] _grid; _grid =0;
-   _grid = new ossim_float32[_width * _height];
-
-   // Fill grid with the "missing data" value.
-   for (i = 0; (int)i < _width * _height; i++)
-      _grid[i] = _missDataVal;
-
-   ossimDemPoint sw_corner = _profiles[0].getProfileLocation();
-   _northwest_x = sw_corner.getX();
-   _northwest_y = maxy;
-
-
-   // Now, insert the elevations in the profiles in the appropriate place in the grid.
-
-   long startpos;
-   for (x = 0; (int)x < _width; x++)
-   {
-      ossimDemElevationVector const& elev = _profiles[x].getElevations();
-      curpoint = _profiles[x].getProfileLocation();
-      startpos = static_cast<long>((curpoint.getY() - miny) / dy);
-      for (y = 0; y < elev.size(); y++)
-      {
-         setElevation(x, _height - startpos - y - 1, elev[y]);
-      }
-   }
-
-   _profiles.erase(_profiles.begin(), _profiles.end());
-
-   return 0;
-}
-
-void
-ossimDemGrid::getGroundCoords(long x, long y, double& ground_x,
-                              double& ground_y)
-{
-   ground_x = _northwest_x + (x * _header.getSpatialResX());
-   ground_y = _northwest_y - (y * _header.getSpatialResY());
-}
diff --git a/ossim/src/ossim/support_data/ossimDemHeader.cpp b/ossim/src/ossim/support_data/ossimDemHeader.cpp
deleted file mode 100644
index 7f06d9a..0000000
--- a/ossim/src/ossim/support_data/ossimDemHeader.cpp
+++ /dev/null
@@ -1,786 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class parses a DEM header.
-//
-//********************************************************************
-// $Id: ossimDemHeader.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <ossim/support_data/ossimDemHeader.h>
-#include <ossim/support_data/ossimDemUtil.h>
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-
-static const char* PROCESS_CODE[]
-= { "Autocorrelation resample simple bilinear",
-    "Manual profile GRIDEM simple bilinear",
-    "DLG/hypsography CTOG 8-direction bilinear",
-    "Interpolation from photogrammetic system contours DCASS",
-    "direction bilinear",
-    "DLG/hypsography LINETRACE, LT4X complex linear",
-    "DLG/hypsography CPS-3, ANUDEM, GRASS complex polynomial",
-    "Electronic imaging (non-photogrammetric), active or passive",
-    "sensor systems" };
-
-static const int MAX_PROCESS_CODE_INDEX = 8;
-
-static const char* GROUND_REF_SYSTEM[]
-= { "Geographic",
-    "UTM",
-    "State Plane" };
-
-static const int MAX_GROUND_REF_SYSTEM_INDEX = 2;
-
-static const char* GROUND_REF_SYSTEM_UNITS[]
-= { "Radians",
-    "Feet",
-    "Meters",
-    "Arc Seconds" };
-
-static const int MAX_GROUND_REF_SYSTEM_UNITS_INDEX = 3;
-
-
-static const char* VERTICAL_DATUM[]
-= { "local mean sea level",
-    "National Geodetic Vertical Datum 1929",
-    "North American Vertical Datum 1988" };
-
-static const int MAX_VERTICAL_DATUM_INDEX = 2;
-
-static const char* HORIZONTAL_DATUM[]
-= { "North American Datum 1927 (NAD 27)",
-    "World Geoditic System 1972 (WGS 72)",
-    "WGS 84",
-    "NAD 83",
-    "Old Hawaii Datum",
-    "Puerto Rico Datum" };
-
-static const int MAX_HORIZONTAL_DATUM_INDEX = 5;
-
-
-ossimDemHeader::ossimDemHeader()
-   : _seGeoCornerX(0.0),
-     _seGeoCornerY(0.0),
-     _processCode(0),
-     _levelCode(0),
-     _elevPattern(0),
-     _groundRefSysCode(0),
-     _groundRefSysZone(0),
-     _groundRefSysUnits(0),
-     _elevUnits(0),
-     _numPolySides(0),
-     _counterclockAngle(0.0),
-     _elevAccuracyCode(0),
-     _minElevation(0),
-     _maxElevation(0),
-     _spatialResX(0.0),
-     _spatialResY(0.0),
-     _spatialResZ(0.0),
-     _profileRows(0),
-     _profileColumns(0),
-     _largeContInt(0),
-     _maxSourceUnits(0),
-     _smallContInt(0),
-     _minSourceUnits(0),
-     _sourceDate(0),
-     _inspRevDate(0),
-     _valFlag(0),
-     _suspectVoidFlg(0),
-     _vertDatum(0),
-     _horizDatum(0),
-     _dataEdition(0),
-     _perctVoid(0),
-     _westEdgeFlag(0),
-     _northEdgeFlag(0),
-     _eastEdgeFlag(0),
-     _southEdgeFlag(0),
-     _vertDatumShift(0.0)
-{
-}
-   
-std::string const&
-ossimDemHeader::getQuadName() const
-{
-   return _quadName;
-}
-
-std::string const&
-ossimDemHeader::getProcessInfo() const
-{
-   return _processInfo;
-}
-
-double
-ossimDemHeader::getSEGeoCornerX() const
-{
-   return _seGeoCornerX;
-}
-
-double
-ossimDemHeader::getSEGeoCornerY() const
-{
-   return _seGeoCornerY;
-}
-
-ossim_int32
-ossimDemHeader::getProcessCode() const
-{
-   return _processCode;
-}
-
-std::string const&
-ossimDemHeader::getSectionIndicator() const
-{
-   return _sectionIndicator;
-}
-
-std::string const&
-ossimDemHeader::getMappingCenterCode() const
-{
-   return _mapCenterCode;
-}
-
-ossim_int32
-ossimDemHeader::getLevelCode() const
-{
-   return _levelCode;
-}
-         
-ossim_int32
-ossimDemHeader::getElevPattern() const
-{
-   return _elevPattern;
-}
-
-ossim_int32
-ossimDemHeader::getGroundRefSysCode() const
-{
-   return _groundRefSysCode;
-}
-    
-ossim_int32
-ossimDemHeader::getGroundRefSysZone() const
-{
-   return _groundRefSysZone;
-}
-
-ossim_int32
-ossimDemHeader::getGroundRefSysUnits() const
-{
-   return _groundRefSysUnits;
-}
-
-ossim_int32
-ossimDemHeader::getElevationUnits() const
-{
-   return _elevUnits;
-}
-
-ossim_int32
-ossimDemHeader::getNumPolySides() const
-{
-   return _numPolySides;
-}
-
-ossimDemPointVector const&
-ossimDemHeader::getDEMCorners() const
-{
-   return _demCorners;
-}
-
-double
-ossimDemHeader::getCounterclockAngle() const
-{
-   return _counterclockAngle;
-}
-
-ossim_int32
-ossimDemHeader::getElevAccuracyCode() const
-{
-   return _elevAccuracyCode;
-}
-
-double
-ossimDemHeader::getMinimumElev() const
-{
-   return _minElevation;
-}
-
-double
-ossimDemHeader::getMaximumElev() const
-{
-   return _maxElevation;
-}
-
-double
-ossimDemHeader::getSpatialResX() const
-{
-   return _spatialResX;
-}
-
-double
-ossimDemHeader::getSpatialResY() const
-{
-   return _spatialResY;
-}
-
-double
-ossimDemHeader::getSpatialResZ() const
-{
-   return _spatialResZ;
-}
-
-ossim_int32
-ossimDemHeader::getProfileRows() const
-{
-   return _profileRows;
-}
-
-ossim_int32
-ossimDemHeader::getProfileColumns() const
-{
-   return _profileColumns;
-}
-
-ossim_int32
-ossimDemHeader::getLargeContInt() const
-{
-   return _largeContInt;
-}
-
-ossim_int32
-ossimDemHeader::getMaxSourceUnits() const
-{
-   return _maxSourceUnits;
-}
-
-ossim_int32
-ossimDemHeader::getSmallContInt() const
-{
-   return _smallContInt;
-}
-
-ossim_int32
-ossimDemHeader::getMinSourceUnits() const
-{
-   return _minSourceUnits;
-}
-
-ossim_int32
-ossimDemHeader::getSourceDate() const
-{
-   return _sourceDate;
-}
-
-ossim_int32
-ossimDemHeader::getInspRevDate() const
-{
-   return _inspRevDate;
-}
-
-std::string const&
-ossimDemHeader::getInspFlag() const
-{
-   return _inspFlag;
-}
-
-ossim_int32
-ossimDemHeader::getDataValFlag() const
-{
-   return _valFlag;
-}
-
-ossim_int32
-ossimDemHeader::getSuspectVoidFlag() const
-{
-   return _suspectVoidFlg;
-}
-
-ossim_int32
-ossimDemHeader::getVertDatum () const
-{
-   return _vertDatum;
-}
-
-ossim_int32
-ossimDemHeader::getHorizDatum() const
-{
-   return _horizDatum;
-}
-
-ossim_int32
-ossimDemHeader::getDataEdition() const
-{
-   return _dataEdition;
-}
-
-ossim_int32
-ossimDemHeader::getPerctVoid() const
-{
-   return _perctVoid;
-}
-
-ossim_int32
-ossimDemHeader::getWestEdgeFlag() const
-{
-   return _westEdgeFlag;
-}
-
-ossim_int32
-ossimDemHeader::getNorthEdgeFlag() const
-{
-   return _northEdgeFlag;
-}
-
-ossim_int32
-ossimDemHeader::getEastEdgeFlag() const
-{
-   return _eastEdgeFlag;
-}
-
-ossim_int32
-ossimDemHeader::getSouthEdgeFlag() const
-{
-   return _southEdgeFlag;
-}
-
-double
-ossimDemHeader::getVertDatumShift() const
-{
-   return _vertDatumShift;
-}
-
-std::ostream&
-operator<<(std::ostream& s, const ossimDemHeader& header)
-{
-   return header.print(s);
-}
-
-bool ossimDemHeader::open(const ossimFilename& file)
-{
-   bool result = ossimDemUtil::isUsgsDem(file);
-   std::ifstream is(file.c_str(), std::ios_base::in | std::ios_base::binary);
-   if ( is.good() )
-   {
-      open(is);
-      is.close();
-   }
-   else
-   {
-      result = false;
-   }
-   return result;
-}
-
-std::istream& ossimDemHeader::open(std::istream& is)
-{
-   if ( is.good() )
-   {
-      char* bufstr = new char[1024];
-      char* temp   = new char[1024];
-      ossim_int32 i;
-      
-      ossimDemUtil::getRecord(is, bufstr);
-      
-      strncpy(temp, bufstr, 40);
-      temp[40] = '\0';
-      _quadName = temp;
-      
-      strncpy(temp,bufstr+40,40);
-      temp[40] = '\0';
-      _processInfo = temp;
-      
-      ossimDemUtil::getDouble(bufstr, 109, 13, _seGeoCornerX);
-      ossimDemUtil::getDouble(bufstr, 122, 13, _seGeoCornerY);
-      _processCode = ossimDemUtil::getLong(bufstr, 135, 1);
-      
-      strncpy(temp,bufstr+137,3);
-      temp[3] = '\0';
-      _sectionIndicator = temp;
-      
-      strncpy(temp,bufstr+140,4);
-      temp[4] = '\0';
-      _mapCenterCode = temp;
-      
-      _levelCode = ossimDemUtil::getLong(bufstr, 144, 6);
-      _elevPattern = ossimDemUtil::getLong(bufstr, 150, 6);
-      _groundRefSysCode = ossimDemUtil::getLong(bufstr, 156, 6);
-      _groundRefSysZone = ossimDemUtil::getLong(bufstr, 162, 6);
-      _groundRefSysUnits = ossimDemUtil::getLong(bufstr, 528, 6);
-      _elevUnits = ossimDemUtil::getLong(bufstr, 534, 6);
-      _numPolySides = ossimDemUtil::getLong(bufstr, 540, 6);
-      
-      for (i = 0; i < 4; i++)
-      {
-         double x,y;
-         ossim_int32 pos = 546 + (i * 48);
-         ossimDemUtil::getDouble(bufstr, pos, 24, x);
-         ossimDemUtil::getDouble(bufstr, pos + 24, 24, y);
-      _demCorners.push_back(ossimDemPoint(x,y));
-      }
-      
-      ossimDemUtil::getDouble(bufstr, 738, 24, _minElevation);
-      ossimDemUtil::getDouble(bufstr, 762, 24, _maxElevation);
-      ossimDemUtil::getDouble(bufstr, 786, 24, _counterclockAngle );
-      _elevAccuracyCode = ossimDemUtil::getLong(bufstr, 810, 6);
-      ossimDemUtil::getDouble(bufstr, 816, 12, _spatialResX);
-      ossimDemUtil::getDouble(bufstr, 828, 12, _spatialResY);
-      ossimDemUtil::getDouble(bufstr, 840, 12, _spatialResZ);
-      _profileRows = ossimDemUtil::getLong(bufstr, 852, 6);
-      _profileColumns = ossimDemUtil::getLong(bufstr, 858, 6);
-      _largeContInt = ossimDemUtil::getLong(bufstr, 864, 5);
-      _maxSourceUnits = ossimDemUtil::getLong(bufstr, 869, 1);
-      _smallContInt = ossimDemUtil::getLong(bufstr, 870, 5);
-      _minSourceUnits = ossimDemUtil::getLong(bufstr, 875, 1);
-      _sourceDate = ossimDemUtil::getLong(bufstr, 876, 4);
-      _inspRevDate = ossimDemUtil::getLong(bufstr, 880, 4);
-      
-      strncpy(temp, bufstr+884,1);
-      temp[1]='\0';
-      _inspFlag = temp;
-      
-      _valFlag = ossimDemUtil::getLong(bufstr, 885, 1);
-      _suspectVoidFlg = ossimDemUtil::getLong(bufstr, 886, 2);
-      _vertDatum = ossimDemUtil::getLong(bufstr, 888, 2);
-      _horizDatum = ossimDemUtil::getLong(bufstr, 890, 2);
-      if (_horizDatum == 0)
-         _horizDatum = 1;   // Default to NAD27
-      
-      _dataEdition = ossimDemUtil::getLong(bufstr, 892, 4);
-      _perctVoid = ossimDemUtil::getLong(bufstr, 896, 4);
-      _westEdgeFlag = ossimDemUtil::getLong(bufstr, 900, 2);
-      _northEdgeFlag = ossimDemUtil::getLong(bufstr, 902, 2);
-      _eastEdgeFlag = ossimDemUtil::getLong(bufstr, 904, 2);
-      _southEdgeFlag = ossimDemUtil::getLong(bufstr, 906, 2);
-      ossimDemUtil::getDouble(bufstr, 908, 7, _vertDatumShift);
-
-      delete [] bufstr;
-      delete [] temp;
-      bufstr = 0;
-      temp = 0;
-   }
-   return is;
-}
-
-
-std::ostream& ossimDemHeader::print(std::ostream& out) const
-{
-   const int W = 24; // format width
-   const int CW = W-8; // format corner width
-   
-   // Capture the original flags then set float output to full precision.
-   std::ios_base::fmtflags f = out.flags();
-
-   // Note:  This is only a partial print for now...
-   std::string prefix = "usgs_dem.";
-   
-   out << std::setiosflags(std::ios_base::fixed|std::ios_base::left)
-       << std::setprecision(10)
-      
-       << prefix << std::setw(W)
-       << "quadrangle_name:" << getQuadName().c_str() << "\n"
-       << prefix << std::setw(W)
-       << "process_info:" << getProcessInfo().c_str() << "\n"
-       << prefix << std::setw(W)
-       << "se_geo_corner_x:" << getSEGeoCornerX() << "\n"
-       << prefix << std::setw(W)
-       << "se_geo_corner_y:" << getSEGeoCornerY() << "\n"
-       << prefix << std::setw(W)
-       << "process_code:";
-   
-   ossim_int32 tmpl = getProcessCode() - 1;
-   if ( tmpl >= 0 && tmpl <= MAX_PROCESS_CODE_INDEX)
-   {
-      out << PROCESS_CODE[tmpl] << "\n";
-   }
-   else
-   {
-      out << "unknown" << "\n";
-   }
-
-   out << prefix << std::setw(W)
-       << "section_indicator: " << getSectionIndicator().c_str() << "\n"
-       << prefix << std::setw(W)
-       << "mapping_center_code: " << getMappingCenterCode().c_str() << "\n"
-       << prefix << std::setw(W)
-       << "level_code: " << getLevelCode() << "\n"
-       << prefix << std::setw(W)
-       << "elev_pattern: " << getElevPattern() << "\n"
-       << prefix << std::setw(W) << "ground_ref_sys: ";
-   
-   tmpl = getGroundRefSysCode();
-   if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_INDEX)
-   {
-      out << GROUND_REF_SYSTEM[tmpl] << "\n";
-   }
-   else
-   {
-      out << "unknown\n";
-   }
-   
-   out << prefix << std::setw(W)
-       << "ground_ref_sys_zone: " << getGroundRefSysZone() << "\n"
-       << prefix << std::setw(W)
-       << "ground_ref_sys_units:";
-   tmpl = getGroundRefSysUnits();
-   if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_UNITS_INDEX)
-   {
-      out << GROUND_REF_SYSTEM_UNITS[tmpl] << "\n";
-   }
-   else
-   {
-      out << "unknown\n";
-   }
-         
-   out << prefix << std::setw(W)
-       << "elevation_units: ";
-   tmpl = getElevationUnits();
-   if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_UNITS_INDEX)
-   {
-      out << GROUND_REF_SYSTEM_UNITS[tmpl] << "\n";
-   }
-   else
-   {
-      out << "unknown\n";
-   }
-
-   out << prefix << std::setw(W)
-       << "number_poly_sides: " << getNumPolySides() << "\n"
-       << prefix << std::setw(W)
-       << "counterclock_angle: " << getCounterclockAngle()<< "\n"
-       << prefix << std::setw(W)
-       << "elev_accuracy_code: " << getElevAccuracyCode()<< "\n"
-       << prefix << std::setw(W)
-       << "minimum_elevation: " << getMinimumElev() << "\n"
-       << prefix << std::setw(W)
-       << "maximum_elevation: " << getMaximumElev() << "\n"
-       << prefix << std::setw(W)
-       << "spatial_res_x: " << getSpatialResX() << "\n"
-       << prefix << std::setw(W)
-       << "spatial_res_y: " << getSpatialResY() << "\n"
-       << prefix << std::setw(W)
-       << "spatial_res_z:" << getSpatialResZ() << "\n"
-       << prefix << std::setw(W)
-       << "profile_rows: " << getProfileRows() << "\n"
-       << prefix << std::setw(W)
-       << "profile_columns:" << getProfileColumns() << "\n"
-       << prefix << std::setw(W)
-       << "source_date:" << getSourceDate() << "\n"
-       << prefix << std::setw(W)
-       << "revision_date:" << getInspRevDate() << "\n"
-       << prefix  << std::setw(W)
-       << "vertical_datum:";
-   
-   tmpl = getVertDatum() - 1;
-   if ( tmpl >= 0 && tmpl <= MAX_VERTICAL_DATUM_INDEX)
-   {
-      out << VERTICAL_DATUM[tmpl] << "\n";
-   }
-   else
-   {
-      out << "unknown\n";
-   }
-
-   out << prefix << std::setw(W)
-       << "vertical_datum_shift:" << getVertDatumShift() << "\n"
-       << prefix << std::setw(W)
-       << "horizontal_datum:";
-   tmpl = getHorizDatum() - 1;
-   if ( tmpl >= 0 && tmpl <= MAX_HORIZONTAL_DATUM_INDEX)
-   {
-      out << HORIZONTAL_DATUM[tmpl] << "\n";
-   }
-   else
-   {
-      out << "unknown\n";
-   }
-
-   const ossimDemPointVector CORNERS = getDEMCorners();
-   for (unsigned int i=0; i < CORNERS.size(); ++i)
-   {
-      out << prefix << "corner[" << i
-          << std::setw(CW)<< "].x:  " << CORNERS[i].getX() << "\n"
-          << prefix << "corner[" << i
-          << std::setw(CW)<< "].y:  " << CORNERS[i].getY() << "\n"
-          << std::endl;
-   }
-
-   out << std::endl;
-
-   // Reset flags.
-   out.setf(f);   
-
-   return out;
-}
-
-std::istream& operator>>(std::istream& s, ossimDemHeader& header)
-{
-   return header.open(s);
-}
-
-bool ossimDemHeader::getImageGeometry(ossimKeywordlist& kwl,
-                                      const char* prefix) const
-{
-   ossimString type = getProjectionType();
-   ossimString datum = getHorizDatumCode();
-   if ( (type == "unknown") || (datum == "unknown") )
-   {
-      return false;
-   }
-
-   if (_demCorners.size() != 4)
-   {
-      return false;
-   }
-
-   double tieX   = _demCorners[1].getX();
-   double tieY   = _demCorners[1].getY();
-   double scaleX = getSpatialResX();
-   double scaleY = getSpatialResX();
-   
-   // Add these for all projections.
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           type);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::DATUM_KW,
-           datum);
-
-   if (getGroundRefSysCode() == 0) // Geographic.
-   {
-      // ESH 10/2008 -- The Dem ground units can be either radians or 
-      // arc seconds, so we have to convert parameters in these units 
-      // to degrees which is what OSSIM is assuming.
-      bool bIsArcSecs = (getGroundRefSysUnits() == 3) ? true : false;
-      bool bIsRadians = (getGroundRefSysUnits() == 0) ? true : false;
-
-      double convertFactor = 1.0;
-      if ( bIsArcSecs == true )
-      {
-         convertFactor = 1.0 / 3600;
-      }
-      else if ( bIsRadians == true )
-      {
-         convertFactor = 180.0 / M_PI;
-      }
-
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_LON_KW,
-              (tieX * convertFactor) );
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_LAT_KW,
-              (tieY * convertFactor) );
-      kwl.add(prefix,
-              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-              (scaleX * convertFactor) );
-      kwl.add(prefix,
-              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-              (scaleY * convertFactor) );
-   }
-   else if (getGroundRefSysCode() == 1) // UTM
-   {
-      // Get the zone.
-      kwl.add(prefix,
-              ossimKeywordNames::ZONE_KW,
-              abs(getGroundRefSysZone()));
-
-      // Set the hemisphere.
-      kwl.add(prefix,
-              ossimKeywordNames::HEMISPHERE_KW,
-              (getGroundRefSysZone()<0?"S":"N"));
-
-      // Set the tie.
-      if (getGroundRefSysUnits() == 1) // Feet...
-      {
-         tieX = ossim::usft2mtrs(tieX);
-         tieY = ossim::usft2mtrs(tieY);
-         scaleX = ossim::usft2mtrs(scaleX);
-         scaleY = ossim::usft2mtrs(scaleY);
-         
-      }
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_EASTING_KW,
-              tieX);
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_NORTHING_KW,
-              tieY);
-      kwl.add(prefix,
-              ossimKeywordNames::METERS_PER_PIXEL_X_KW,
-              scaleX);
-      kwl.add(prefix,
-              ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
-              scaleY);
-   }
-   else if (getGroundRefSysCode() == 2) // State Plane
-   {
-      return false; // Need to code...
-   }
-
-   
-   return true;
-}
-
-ossimString ossimDemHeader::getHorizDatumCode() const
-{
-   ossimString code;
-   switch(getHorizDatum())
-   {
-      case 1:
-         code = "NAS-C";
-         break;
-      case 2:
-         code = "WGD";
-         break;
-      case 3:
-         code = "WGE";
-        break;         
-      case 4:
-         code = "NAR-C";
-        break;         
-      case 5:
-         code = "OHA-M";
-        break;         
-      case 6:
-         code = "PUR";
-         break;
-      default:
-         code = "unknown";
-        break;         
-   }
-   return code;
-}
-         
-ossimString ossimDemHeader::getProjectionType() const
-{
-   ossimString type;
-   switch(getGroundRefSysCode())
-   {
-      case 0:
-         type = "ossimEquDistCylProjection";
-         break;
-      case 1:
-         type = "ossimUtmProjection";
-         break;
-      case 2:
-      default:
-         type = "unknown";
-         break;
-   }
-   return type;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDemInfo.cpp b/ossim/src/ossim/support_data/ossimDemInfo.cpp
deleted file mode 100644
index 7c82e1a..0000000
--- a/ossim/src/ossim/support_data/ossimDemInfo.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: USGS DEM Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <iostream>
-
-#include <ossim/support_data/ossimDemInfo.h>
-
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimFilename.h>
-
-#include <ossim/support_data/ossimDemHeader.h>
-#include <ossim/support_data/ossimDemUtil.h>
-
-ossimDemInfo::ossimDemInfo()
-   : theFile()
-{
-}
-
-ossimDemInfo::~ossimDemInfo()
-{
-}
-
-bool ossimDemInfo::open(const ossimFilename& file)
-{
-   bool result = ossimDemUtil::isUsgsDem(file);
-
-   if ( result )
-   {
-      theFile = file;
-   }
-   else
-   {
-      theFile = ossimFilename::NIL;
-   }
-   
-   return result;
-}
-
-std::ostream& ossimDemInfo::print(std::ostream& out) const
-{
-   if ( theFile.exists() )
-   {
-      ossimDemHeader hdr;
-      if ( hdr.open(theFile) )
-      {
-         // std::string prefix;
-         hdr.print(std::cout);
-      }
-   }
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDemPoint.cpp b/ossim/src/ossim/support_data/ossimDemPoint.cpp
deleted file mode 100644
index 3c6e628..0000000
--- a/ossim/src/ossim/support_data/ossimDemPoint.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Contains class definition for DEMPoint.
-//*******************************************************************
-//  $Id: ossimDemPoint.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimDemPoint.h>
-
diff --git a/ossim/src/ossim/support_data/ossimDemProfile.cpp b/ossim/src/ossim/support_data/ossimDemProfile.cpp
deleted file mode 100644
index 21aee6c..0000000
--- a/ossim/src/ossim/support_data/ossimDemProfile.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class defines a DEM profile.
-//
-//********************************************************************
-// $Id: ossimDemProfile.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <iostream>
-#include <sstream>
-
-#include <ossim/support_data/ossimDemProfile.h>
-#include <ossim/support_data/ossimDemUtil.h>
-
-ossimDemProfile::ossimDemProfile()
-   : _row(0),
-     _column(0),
-     _numberElevations(0),
-     _locDatumElev(0.0),
-     _minElev(0.0),
-     _maxElev(0.0)
-{
-}
-
-ossimDemProfile::ossimDemProfile(ossimDemProfile const& right)
-{
-   operator=(right);
-}
-
-ossimDemProfile const&
-ossimDemProfile::operator=(ossimDemProfile const& right)
-{
-   if (this == &right)
-      return *this;
-
-   _row = right._row;
-   _column = right._column;
-   _numberElevations = right._numberElevations;
-   _profileLocation = right._profileLocation;
-   _locDatumElev = right._locDatumElev;
-   _minElev = right._minElev;
-   _maxElev = right._maxElev;
-   _elevations = right._elevations;
-
-   return *this;
-}
-
-ossim_int32
-ossimDemProfile::getRowNumber() const
-{
-   return _row;
-}
-
-ossim_int32
-ossimDemProfile::getColumnNumber() const
-{
-   return _column;
-}
-
-ossim_int32
-ossimDemProfile::getNumberOfElevations() const
-{
-   return _numberElevations;
-}
-
-ossimDemPoint const&
-ossimDemProfile::getProfileLocation() const
-{
-   return _profileLocation;
-}
-
-double
-ossimDemProfile::getLocalDatumElevation() const
-{
-   return _locDatumElev;
-}
-
-double
-ossimDemProfile::getMinimumElev() const
-{
-   return _minElev;
-}
-
-double
-ossimDemProfile::getMaximumElev() const
-{
-   return _maxElev;
-}
-
-ossimDemElevationVector const&
-ossimDemProfile::getElevations() const
-{
-   return _elevations;
-}
-
-std::istream&
-operator>>(std::istream& s, ossimDemProfile& demp)
-{
-   //   string bufstr;
-   char bufstr[1024];
-
-   ossimDemUtil::getRecord(s,bufstr);
-
-   demp._row = ossimDemUtil::getLong(bufstr, 0, 6);
-   demp._column = ossimDemUtil::getLong(bufstr, 6, 6);
-   demp._numberElevations = ossimDemUtil::getLong(bufstr, 12, 6);
-
-   double x,y;
-   ossimDemUtil::getDouble(bufstr, 24, 24, x);
-   ossimDemUtil::getDouble(bufstr, 48, 24, y);
-   demp._profileLocation.setXY(x,y);
-
-   ossimDemUtil::getDouble(bufstr, 72, 24, demp._locDatumElev);
-   ossimDemUtil::getDouble(bufstr, 96, 24, demp._minElev);
-   ossimDemUtil::getDouble(bufstr, 120, 24, demp._maxElev);
-
-   demp._elevations.erase(demp._elevations.begin(), demp._elevations.end());   
-   demp._elevations.reserve(demp._numberElevations);
-
-   // Extract elevations in this record.
-   ossim_int32 count = 0;
-   while ((count < 146) && (count < demp._numberElevations))
-   {
-      demp._elevations.push_back(ossimDemUtil::getLong(bufstr, 144+(count*6), 6));
-      count++;
-   }
-   
-   ossim_int32 t;
-   while (count < demp._numberElevations)
-   {
-      t = (count - 146) % 170;
-      if (t == 0)
-         ossimDemUtil::getRecord(s,bufstr);
-      demp._elevations.push_back(ossimDemUtil::getLong(bufstr, t*6, 6));
-      count++;
-   }
-
-   return s;
-}
-
-
-std::ostream& operator<<(std::ostream& s, ossimDemProfile& /* demp */)
-{
-   return s;
-}
-
-
-
diff --git a/ossim/src/ossim/support_data/ossimDemStats.cpp b/ossim/src/ossim/support_data/ossimDemStats.cpp
deleted file mode 100644
index 563511f..0000000
--- a/ossim/src/ossim/support_data/ossimDemStats.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class provides some statistics for DEMs.
-//
-//********************************************************************
-// $Id: ossimDemStats.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <stdlib.h>
-
-#include <ossim/support_data/ossimDemStats.h>
-#include <ossim/support_data/ossimDemUtil.h>
-using namespace std;
-
-ossimDemStats::ossimDemStats()
-   : _availCodeDE2(0),
-     _rsmeDE2x(0),
-     _rsmeDE2y(0),
-     _rsmeDE2z(0),
-     _sampleSizeDE2(0),
-     _availCodeDE5(0),
-     _rsmeDE5x(0),
-     _rsmeDE5y(0),
-     _rsmeDE5z(0),
-     _sampleSizeDE5(0)
-
-{
-}
-
-ossimDemStats::~ossimDemStats()
-{
-}
-
-long
-ossimDemStats::getAvailCodeDE2() const
-{
-   return _availCodeDE2;
-}
-
-long
-ossimDemStats::getRSMEDE2x() const
-{
-   return _rsmeDE2x;
-}
-
-long
-ossimDemStats::getRSMEDE2y() const
-{
-   return _rsmeDE2y;
-}
-
-long
-ossimDemStats::getRSMEDE2z() const
-{
-   return _rsmeDE2z;
-}
-
-long
-ossimDemStats::getSampleSizeDE2() const
-{
-   return _sampleSizeDE2;
-}
-
-long
-ossimDemStats::getAvailCodeDE5() const
-{
-   return _availCodeDE5;
-}
-
-long
-ossimDemStats::getRSMEDE5x() const
-{
-   return _rsmeDE5x;
-}
-
-long
-ossimDemStats::getRSMEDE5y() const
-{
-   return _rsmeDE5y;
-}
-
-long
-ossimDemStats::getRSMEDE5z() const
-{
-   return _rsmeDE5z;
-}
-
-long
-ossimDemStats::getSampleSizeDE5() const
-{
-   return _sampleSizeDE5;
-}
-
-ostream&
-operator<<(ostream& s,  ossimDemStats const& /* stats */)
-{
-   return s;
-}
-
-istream&
-operator>>(istream& s, ossimDemStats& stats)
-{
-   char bufstr[1024];
-
-   ossimDemUtil::getRecord(s, bufstr);
-
-   stats._availCodeDE2 = ossimDemUtil::getLong(bufstr, 0, 6);
-   stats._rsmeDE2x = ossimDemUtil::getLong(bufstr, 6, 6);
-   stats._rsmeDE2y = ossimDemUtil::getLong(bufstr, 12, 6);
-   stats._rsmeDE2z = ossimDemUtil::getLong(bufstr, 18, 6);
-   stats._sampleSizeDE2 = ossimDemUtil::getLong(bufstr, 24, 6);
-   stats._availCodeDE5 = ossimDemUtil::getLong(bufstr, 30, 6);
-   stats._rsmeDE5x = ossimDemUtil::getLong(bufstr, 36, 6);
-   stats._rsmeDE5y = ossimDemUtil::getLong(bufstr, 42, 6);
-   stats._rsmeDE5z = ossimDemUtil::getLong(bufstr, 48, 6);
-   stats._sampleSizeDE5 = ossimDemUtil::getLong(bufstr, 54, 6);
-
-   return s;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDemUtil.cpp b/ossim/src/ossim/support_data/ossimDemUtil.cpp
deleted file mode 100644
index 8596813..0000000
--- a/ossim/src/ossim/support_data/ossimDemUtil.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
-//         Adapted from the package KDEM.
-// Description: This class provides some simple utilities for DEMs.
-//
-//********************************************************************
-// $Id: ossimDemUtil.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdio>
-#include <cstdlib>
-#include <iostream>
-
-#include <ossim/support_data/ossimDemUtil.h>
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-using namespace std;
-
-static const char DEM_TYPE_KW[] = "dem_type";
-static const char USGS_DEM_KW[] = "usgs_dem";
-
-bool ossimDemUtil::isUsgsDem(const ossimFilename& file)
-{
-   bool result = false;
-
-   if ( file.exists() )
-   {
-      
-      //---
-      // Open checks:
-      // 1) Check extension for .dem
-      //
-      // 2) Look for file.omd (ossim meta data) file containing keyword
-      //    "dem_type" with value of "usgs_dem".
-      //
-      // NOTE:
-      // There is a keyword list template stored in the templates directory:
-      // "ossim/etc/templates/usgs_dem_template.kwl"
-      //---
-      
-      ossimString ext = file.ext();
-      ext.downcase();
-      if (ext == "dem")
-      {
-         result = true;
-      }
-      else
-      {
-         // Look for file.omd
-         ossimFilename kwlFile = file;
-         kwlFile.setExtension("omd");
-         if (! kwlFile.exists() )
-         {
-            kwlFile.setExtension("OMD");
-         }
-         
-         if ( kwlFile.exists() )
-         {
-            ossimKeywordlist kwl(kwlFile);
-            if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-            {
-               const char* lookup = kwl.find(DEM_TYPE_KW);
-               if (lookup)
-               {
-                  ossimString s = lookup;
-                  s.downcase();
-                  if (s == USGS_DEM_KW)
-                  {
-                     result = true;
-                  }
-               }
-            }
-         }
-      }
-      
-      if ( result )
-      {
-         // Open up the file for reading.
-         std::ifstream is(file.c_str(),
-                          std::ios_base::in | std::ios_base::binary);
-         if ( is.good() )
-         {
-            //---
-            // SPECIAL HACK (drb):
-            // Check some bytes and make sure there is no binary data.
-            // There are files out there with .dem extension that are binary
-            // rasters.
-            //---
-            ossim_uint8* ubuf = new ossim_uint8[512];
-            is.read((char*)ubuf, 512);
-            for (int i = 0; i < 512; ++i)
-            {
-               if (ubuf[i] > 0x7f)
-               {
-                  result = false;
-                  break;
-               }
-            }
-            delete [] ubuf;
-            ubuf = 0;
-            is.close();
-         }
-         else
-         {
-            result = false;
-         }
-      }
-      
-   } // matches:  if ( file.exists() )
-
-   return result;
-}
-
-bool
-ossimDemUtil::getRecord(istream& s, string& strbuf, long reclength)
-{
-   char* buf = new char[reclength + 1];
-
-   bool flag = ossimDemUtil::getRecord(s,buf,reclength);
-   if (flag == true)
-      strbuf = buf;
-
-   delete [] buf;
-
-   return flag;
-}
-
-bool
-ossimDemUtil::getRecord(istream& s, char* buf, long reclength)
-{
-   // buf is assumed to be at least reclength+1 in size.
-
-   if (!s)
-      return false;
-
-   long curpos = 0;
-   buf[curpos] = s.get();
-   while ((buf[curpos] != EOF) && 
-          (buf[curpos] != '\n') &&
-          (curpos < reclength-1))
-   {
-      curpos++;
-      buf[curpos] = s.get();
-   }
-   buf[curpos] = '\0';
-
-   if (s.peek() == '\n')
-      s.get();
-
-   return true;
-
-}
-
-bool
-ossimDemUtil::getDouble(string const& strbuf,
-                   long const startpos,
-                   long const width,
-                   double& val)
-{
-   if ((startpos + width - 1) > (long)(strbuf.length()))
-      return false;
-
-   // Convert FORTRAN 'D' exponent indicator to 'E'.
-   string tempbuf(strbuf.substr(startpos,width));
-   for (unsigned int i = 0; i < tempbuf.length(); i++)
-      if (tempbuf[i] == 'D')
-         tempbuf[i] = 'E';
-
-   val = atof(tempbuf.c_str());
-   return true;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDoqq.cpp b/ossim/src/ossim/support_data/ossimDoqq.cpp
deleted file mode 100644
index a565fa9..0000000
--- a/ossim/src/ossim/support_data/ossimDoqq.cpp
+++ /dev/null
@@ -1,438 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description: This class parses a Digital Ortho Quarter Quad (DOQQ)
-//              header.
-//
-//********************************************************************
-// $Id: ossimDoqq.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <string.h>
-#include <ossim/support_data/ossimDoqq.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-static ossimTrace traceDebug("ossimDoqq:debug");
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDoqq::ossimDoqq()
-   :  theErrorStatus(OSSIM_ERROR)
-{
-}
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDoqq::ossimDoqq(ossimFilename file)
-   :  theErrorStatus(OSSIM_ERROR)
-{
-   open(file);
-   theDoqFile.close();
-}
-
-//**************************************************************************
-// Opens the DOQ header and parses info.
-//**************************************************************************
-bool ossimDoqq::open(const ossimFilename& file)
-{
-   // Assume all kosher:
-   theErrorStatus = OSSIM_OK;
-
-   // Check first line of header to determine which version to parse.
-   if (theDoqFile.is_open())
-      theDoqFile.close();
-
-   theDoqFile.open(file.c_str(), std::ios::in);
-   char header[23];
-   theDoqFile.seekg(0, std::ios::beg);
-   theDoqFile.get(header, 22);
-   header[22] = '\0';
-   if(strcmp((const char*)header, "BEGIN_USGS_DOQ_HEADER") == 0)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimDoqq::ossimDoqq Loading DOQ version 2 header..."
-            << std::endl;
-      }
-
-      ldstr_v2(theDoqFile);
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimDoqq::ossimDoqq  Loading DOQ version 1 header..."
-            << std::endl;
-      }
-
-      ldstr_v1(theDoqFile);
-   }
-
-   // Check for error.
-   if(theErrorStatus)
-      return false;
-   return true;
-}
-
-ossimDoqq::~ossimDoqq()
-{
-}
-
-void ossimDoqq::ldstr_v2(std::istream& in)
-{
-   static const char MODULE[] = "ossimDoqq::ldstr_v2(istream& in)";
-
-   if (!in)
-   {
-      theErrorStatus = OSSIM_ERROR;
-      return;
-   }
-
-   char line[100];
-   char dum1[30];
-   char dum2[30];
-   char dum3[30];
-   char dum4[30];
-
-   while((strncmp(line, "END_USGS_HEADER", 15) != 0)&&
-			(in.good()))
-   {
-      // Read in one line of header at a time.
-      in.getline(line, 100);
-      
-      if(strncmp(line, "SAMPLES_AND_LINES", 17) == 0)
-      {
-         sscanf(line, "%s %s %s", dum1, dum2, dum3);
-         theLine = atoi(dum3);
-         theSample = atoi(dum2);
-      }
-
-      else if(strncmp(line, "HORIZONTAL_COORDINATE_SYSTEM", 28) == 0)
-      {
-         sscanf(line, "%s %s", dum1, dum2);
-         theProjection = dum2;
-      }
-      
-      else if(strncmp(line, "NW_QUAD_CORNER_XY", 17) == 0)
-      {         
-         sscanf(line, "%s %s %s", dum1, dum2, dum3);
-         
-         theUE = atof(dum2);
-         theUN = atof(dum3);
-      }
-      
-      else if(strncmp(line, "NE_QUAD_CORNER_XY", 17) == 0)
-      {
-         sscanf(line, "%s %s %s", dum1, dum2, dum3);
-         theLE = atof(dum2);
-         theLN = atof(dum3);
-      }
-
-      else if(strncmp(line, "COORDINATE_ZONE", 15) == 0)
-      {
-         sscanf(line, "%s %s", dum1, dum2);
-         theUtmZone = atoi(dum2);
-      }
-
-      else if(strncmp(line, "SOURCE_IMAGE_DATE", 17) == 0)
-      {
-         sscanf(line, "%s %s %s %s", dum1, dum2, dum3, dum4);
-         theAcqYear  = ossimString(dum2);
-         theAcqMonth = ossimString(dum3);
-         theAcqDay   = ossimString(dum4);
-      }
-
-      else if((strncmp(line, "XY_ORIGIN", 9) == 0))
-      {
-         sscanf(line, "%s %s %s", dum1, dum2, dum3);
-         theEasting = atof(dum2);
-         theNorthing = atof(dum3);        
-      }
-
-      else if((strncmp(line, "HORIZONTAL_DATUM", 16) == 0) && theDatum.empty())
-      {
-         ossimString datum;         
-         sscanf(line, "%s %s", dum1, dum2);
-         datum = dum2; 
-         
-         if(datum.contains("NAD27"))
-            theDatum = "NAD";
-         else
-            theDatum = "NAR";
-      }
-
-      else if(strncmp(line, "BYTE_COUNT", 10) == 0)
-      {
-         ossimString header;         
-         sscanf(line, "%s %s", dum1, dum2);
-         header = dum2;
-         
-         theHeaderSize = atoi(header.chars());
-      }
-
-      else if(strncmp(line, "BAND_CONTENT", 12) == 0)
-      {
-         ossimString rgbType;        
-         sscanf(line, "%s %s", dum1, dum2);
-         rgbType = dum2;
-
-         if(rgbType.contains("BLACK&WHITE"))
-            theRgb = 1;
-         else
-            theRgb = 3;
-      }
-
-      else if(strncmp(line, "HORIZONTAL_RESOLUTION", 21) == 0)
-      {
-         ossimString gsd;
-         sscanf(line, "%s %s", dum1, dum2);
-         gsd = dum2;
-
-         theGsd.x = gsd.toDouble();
-         theGsd.y = gsd.toDouble();
-      }
-
-      else if(strncmp(line, "QUADRANGLE_NAME", 15) == 0)
-      {
-         sscanf(line, "%s %29c", dum1, dum2);
-         dum2[29] = 0;
-         theQuadName = dum2;
-      }
-
-      else if(strncmp(line, "QUADRANT", 8) == 0)
-      {
-         sscanf(line, "%s %s", dum1, dum2);
-         theQuad = dum2;
-      }
-
-      else if(strncmp(line, "NATION", 6) == 0)
-      {
-         sscanf(line, "%s %s", dum1, dum2);
-         theNation = dum2;
-      }
-
-      else if(strncmp(line, "STATE", 5) == 0)
-      {
-         sscanf(line, "%s %s", dum1, dum2);
-         theState = dum2;
-      }
-
-      else if(strncmp(line, "RMSE_XY", 7) == 0)
-      {
-         sscanf(line, "%s %s", dum1, dum2);
-         theRMSE = ossimString(dum2).toDouble();
-      }
-
-      else if(strncmp(line, "IMAGE_SOURCE", 12) == 0)
-      {
-         sscanf(line, "%s %29c", dum1, dum2);
-         dum2[29] = 0;
-         theImageSource = dum2;
-      }
-
-      else if(strncmp(line, "SOURCE_IMAGE_ID", 15) == 0)
-      {
-         sscanf(line, "%s %29c", dum1, dum2);
-         dum2[29] = 0;
-         theSourceImageID = dum2;
-      }
-   }
-
-	if (!in.good())
-	{
-      theErrorStatus = OSSIM_ERROR;
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-			<< MODULE << " ERROR:\n"
-			<< "\tHeader stream is bad."
-			<< std::endl;
-      }
-		return;
-	}
-
-   // Check for valid lines and samples and header size.
-   if(theLine <= 0 || theSample <= 0 || theHeaderSize <= 0)
-   {
-      theErrorStatus = OSSIM_ERROR;
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:\n"
-            << "\tInvalid lines or samples or header size."
-            << std::endl;
-      }
-      return;
-   }
-
-   // Assign concatenated acquisition date:
-   theAcqYearMonthDay = theAcqYear;
-   theAcqYearMonthDay += "-";
-   theAcqYearMonthDay += theAcqMonth;
-   theAcqYearMonthDay += "-";
-   theAcqYearMonthDay += theAcqDay;
-
-}
-
-void ossimDoqq::ldstr_v1(std::istream& in)
-{
-   static const char MODULE[] = "ossimDoqq::ldstr_v1(istream& in)";
-
-   if (!in)
-   {
-      theErrorStatus = OSSIM_ERROR;
-      return;
-   }
-
-   char tmp1[DATA_ORDER_SIZE+1];
-   in.seekg(DATA_ORDER_OFFSET, std::ios::beg);
-   in.get(tmp1, DATA_ORDER_SIZE+1);
-   theDataOrder = tmp1;
-
-   //***
-   // Perform a sanity check on the data order just in case this isn't a
-   // ossimDoqq file.
-   //***  
-   tmp1[DATA_ORDER_SIZE] = '\0';
-   int data_order = atoi(tmp1);
-   if ( (data_order != 1) && (data_order != 2) )
-   {
-      theErrorStatus = OSSIM_ERROR;
-
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " NOTICE:\n"
-            << "Invalid data ordering.  Not a doq?" << std::endl;
-      }
-   }
-   
-   char tmp2[LINE_SIZE+1];
-   in.seekg(LINE_OFFSET, std::ios::beg);
-   in.get(tmp2, LINE_SIZE+1);
-   theLine = atoi(tmp2);
-
-   char tmp3[SAMPLE_SIZE+1];
-   in.seekg(SAMPLE_OFFSET,std::ios::beg);
-   in.get(tmp3, SAMPLE_SIZE+1); 
-   theSample = atoi(tmp3);
-
-   // Check for valid lines and samples.
-   if (theLine <= 0 || theSample <= 0)
-   {
-      theErrorStatus = OSSIM_ERROR;
-
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " ERROR:\n"
-            << "\tInvalid lines or samples."
-            << std::endl;
-      }
-      
-      return;
-   }
-   
-   char tmp4[PROJECTION_SIZE+1];
-   in.seekg(PROJECTION_OFFSET, std::ios::beg);
-   in.get(tmp4, PROJECTION_SIZE+1);
-   theProjection = tmp4;
-
-   char tmp5[UTM_ZONE_SIZE+1];
-   in.seekg(UTM_ZONE_OFFSET, std::ios::beg);
-   in.get(tmp5, UTM_ZONE_SIZE+1);
-   theUtmZone = atoi(tmp5);
-
-   char tmp8[DATUM_SIZE+1];
-   in.seekg(DATUM_OFFSET, std::ios::beg);
-   in.get(tmp8, DATUM_SIZE+1);
-   theDatum = tmp8;
-
-   char rgbType[RGB_SIZE+1];
-   in.seekg(RGB_OFFSET, std::ios::beg);
-   in.get(rgbType, RGB_SIZE+1);
-
-
-   if(atoi(rgbType) == 5)
-   {
-      theRgb = 3;
-   }
-   else
-   {
-      theRgb = 1;
-   }
-   
-   theHeaderSize = (theSample * theRgb * 4);
-
-   // Calculate the size of each record.
-   theRecordSize = (theSample * theRgb);
-
-   char tmp6[UL_EASTING_SIZE+1];
-   in.seekg( (theRecordSize * 2) + UL_EASTING_OFFSET, std::ios::beg);
-   in.get(tmp6, UL_EASTING_SIZE+1);
-
-   char tmp7[UL_NORTHING_SIZE+1];
-   in.seekg( (theRecordSize * 2) + UL_NORTHING_OFFSET, std::ios::beg);
-   in.get(tmp7, UL_NORTHING_SIZE+1);
-   
-   // Get Easting and Northing.
-   theEasting = convertStr(tmp6);
-   theNorthing = convertStr(tmp7);
-
-   char tmp10[GSD_SIZE+1];
-   in.seekg( (theRecordSize*3) + GSD_X_OFFSET, std::ios::beg);
-   in.get(tmp10, GSD_SIZE+1);
-   theGsd.x = std::abs(ossimString(tmp10, tmp10+GSD_SIZE).toDouble());
-   in.seekg( (theRecordSize*3) + GSD_Y_OFFSET, std::ios::beg);
-   in.get(tmp10, GSD_SIZE+1);
-   theGsd.y = std::abs(ossimString(tmp10, tmp10+GSD_SIZE).toDouble());
-   
-}
-
-ossim_float64 ossimDoqq::convertStr(const char* str) const
-{
-   //***
-   // The USGS Projection Parameters in a OssimDoqq header have a "D" to
-   // denote the exponent.  This simply substitutes the "D" with an
-   // "E" so that atof works properly.
-   //***
-   ossimString tmp = str;
-   tmp.gsub("D", "E");
-   return tmp.toFloat64();
-}
-
-std::ostream& ossimDoqq::print(std::ostream& out) const
-{
-   const char* prefix = "doqq.";
-   out << prefix << "Quadrangle_Name: " << theQuadName << std::endl;
-   out << prefix << "Quadrant: " << theQuad << std::endl;
-   out << prefix << "Image_Source: " << theImageSource << std::endl;
-   out << prefix << "Source_Image_ID: " << theSourceImageID << std::endl;
-   out << prefix << "RMSE_XY: " << theRMSE << std::endl;
-   out << prefix << "Line: " << theLine << std::endl;
-   out << prefix << "Sample: " << theSample << std::endl;
-   out << prefix << "Projection: " << theProjection << std::endl;
-   out << prefix << "Datum: " << theDatum << std::endl;
-   out << prefix << "Easting: " << theEasting << std::endl;
-   out << prefix << "Northing: " << theNorthing << std::endl;
-   out << prefix << "UN: " << theUN << std::endl;
-   out << prefix << "UE: " << theUE << std::endl;
-   out << prefix << "LN: " << theLN << std::endl;
-   out << prefix << "LE: " << theLE << std::endl;
-   out << prefix << "GSD: " << theGsd << std::endl;
-   out << prefix << "Band: " << theRgb << std::endl;
-   out << prefix << "Utm_Zone: " << theUtmZone << std::endl;
-   
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDtedAcc.cpp b/ossim/src/ossim/support_data/ossimDtedAcc.cpp
deleted file mode 100644
index a562ac0..0000000
--- a/ossim/src/ossim/support_data/ossimDtedAcc.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the Accuracy Description
-//               (ACC) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedAcc.cpp 23276 2015-04-24 21:01:51Z rashadkm $
-
-#include <cstdlib>
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <string>
-
-#include <ossim/support_data/ossimDtedAcc.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedAcc::ossimDtedAcc(const ossimFilename& dted_file,
-                           ossim_int32 offset)
-{
-   if(!dted_file.empty())
-   {
-      theStartOffset = offset;
-      // Check to see that dted file exists. 
-      if(!dted_file.exists())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimDtedAcc::ossimDtedAcc: The DTED file does not exist: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Check to see that the dted file is readable.
-      if(!dted_file.isReadable())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimDtedAcc::ossimDtedAcc: The DTED file is not readable: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Open the dted file for reading.
-      std::ifstream in(dted_file.c_str());
-      if(!in)
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimDtedAcc::ossimDtedAcc: Can't open the DTED file: " << dted_file << std::endl;
-         return;
-      }
-      in.seekg(offset);
-      parse(in);
-   }
-   else
-   {
-      clearFields();
-   }
-}
-ossimDtedAcc::ossimDtedAcc(std::istream& in)
-{
-   parse(in);
-}
-
-void ossimDtedAcc::clearFields()
-{
-   memset(theRecSen, '\0', FIELD1_SIZE+1);
-   memset(theAbsoluteCE, '\0',FIELD2_SIZE+1);
-   memset(theAbsoluteLE, '\0',FIELD3_SIZE+1);
-   memset(theRelativeCE, '\0',FIELD4_SIZE+1);
-   memset(theRelativeLE, '\0',FIELD5_SIZE+1);
-   memset(theField6, '\0',FIELD6_SIZE+1);
-   memset(theField7, '\0',FIELD7_SIZE+1);
-   memset(theField8, '\0',FIELD8_SIZE+1);
-   memset(theField9, '\0',FIELD9_SIZE+1);
-   memset(theField10, '\0',FIELD10_SIZE+1);
-   memset(theField11, '\0',FIELD11_SIZE+1);
-   memset(theField12, '\0',FIELD12_SIZE+1);
-   memset(theField13, '\0',FIELD13_SIZE+1);
-   memset(theField14, '\0',FIELD14_SIZE+1);
-   memset(theField15, '\0',FIELD15_SIZE+1);
-   memset(theField16, '\0',FIELD16_SIZE+1);
-   memset(theField17, '\0',FIELD17_SIZE+1);
-   
-   theStartOffset = 0;
-   theStopOffset = 0;
-}
-//**************************************************************************
-// ossimDtedAcc::parse()
-//**************************************************************************
-void ossimDtedAcc::parse(std::istream& in)
-{
-   clearErrorStatus();
-	clearFields();
-	theStartOffset = in.tellg();
-   theStopOffset  = theStartOffset;
-   // Parse theRecSen
-   in.read(theRecSen, FIELD1_SIZE);
-   theRecSen[FIELD1_SIZE] = '\0';
-
-   if(!(strncmp(theRecSen, "ACC", 3) == 0))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      in.seekg(theStartOffset);
-      return;
-   }
-   
-   // Parse theAbsoluteCE
-   in.read(theAbsoluteCE, FIELD2_SIZE);
-   theAbsoluteCE[FIELD2_SIZE] = '\0';
-   
-   // Parse theAbsoluteLE
-   in.read(theAbsoluteLE, FIELD3_SIZE);
-   theAbsoluteLE[FIELD3_SIZE] = '\0';
-   
-   // Parse theRelativeCE
-   in.read(theRelativeCE, FIELD4_SIZE);
-   theRelativeCE[FIELD4_SIZE] = '\0';
-   
-   // Parse theRelativeLE
-   in.read(theRelativeLE, FIELD5_SIZE);
-   theRelativeLE[FIELD5_SIZE] = '\0';
-   
-   // Parse Field 6
-   in.read(theField6, FIELD6_SIZE);
-   theField6[FIELD6_SIZE] = '\0';
-   
-   // Parse Field 7
-   in.read(theField7, FIELD7_SIZE);
-   theField7[FIELD7_SIZE] = '\0';
-   
-   // Parse Field 8
-   in.read(theField8, FIELD8_SIZE);
-   theField8[FIELD8_SIZE] = '\0';
-   
-   // Parse Field 9
-   in.read(theField9, FIELD9_SIZE);
-   theField9[FIELD9_SIZE] = '\0';
-   
-   // Parse Field 10
-   in.read(theField10, FIELD10_SIZE);
-   theField10[FIELD10_SIZE] = '\0';
-   
-   // Parse Field 11
-   in.read(theField11, FIELD11_SIZE);
-   theField11[FIELD11_SIZE] = '\0';
-   
-   // Parse Field 12
-   in.read(theField12, FIELD12_SIZE);
-   theField12[FIELD12_SIZE] = '\0';
-   
-   // Parse Field 13
-   in.read(theField13, FIELD13_SIZE);
-   theField13[FIELD13_SIZE] = '\0';
-   
-   // Parse Field 14
-   in.read(theField14, FIELD14_SIZE);
-   theField14[FIELD14_SIZE] = '\0';
-   
-   // Parse Field 15
-   in.read(theField15, FIELD15_SIZE);
-   theField15[FIELD15_SIZE] = '\0';
-   
-   // Parse Field 16
-   in.read(theField16, FIELD16_SIZE);
-   theField16[FIELD16_SIZE] = '\0';
-   
-   // Parse Field 17
-   in.read(theField17, FIELD17_SIZE);
-   theField17[FIELD17_SIZE] = '\0';
-
-   in.ignore(FIELD18_SIZE);
-   // Set the stop offset.
-   theStopOffset = theStartOffset + ACC_LENGTH;
-}
-
-ossimRefPtr<ossimProperty> ossimDtedAcc::getProperty(
-   const ossimString& name) const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   if (name == "recognition_sentinel")
-   {
-      result = new ossimStringProperty(name, theRecSen);
-      
-   }
-   else if (name == "absolute_ce")
-   {
-      result = new ossimStringProperty(name, theAbsoluteCE);
-   }
-   else if (name == "absolute_le")
-   {
-      result = new ossimStringProperty(name, theAbsoluteLE); 
-   }
-   else if (name == "relative_ce")
-   {
-      result = new ossimStringProperty(name, theRelativeCE);
-   }
-   else if (name == "relative_le")
-   {
-      result = new ossimStringProperty(name, theRelativeLE);
-   }
-   return result;
-}
-
-void ossimDtedAcc::getPropertyNames(
-   std::vector<ossimString>& propertyNames) const
-{
-   propertyNames.push_back(ossimString("recognition_sentinel"));
-   propertyNames.push_back(ossimString("absolute_ce"));
-   propertyNames.push_back(ossimString("absolute_le"));
-   propertyNames.push_back(ossimString("relative_ce"));
-   propertyNames.push_back(ossimString("relative_le"));
-}
-
-std::ostream& ossimDtedAcc::print(std::ostream& out,
-                                  const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += "acc.";
-
-   out << setiosflags(ios::left)
-       << pfx << setw(28) << "recognition_sentinel:" << theRecSen << "\n"
-       << pfx << setw(28) << "absolute_ce:"  << theAbsoluteCE << "\n"
-       << pfx << setw(28) << "absolute_le:"  << theAbsoluteLE << "\n"
-       << pfx << setw(28) << "relative ce:"  << theRelativeCE << "\n"
-       << pfx << setw(28) << "relative le:"  << theRelativeLE << "\n"
-       << pfx << setw(28) << "start_offset:" << theStartOffset << "\n"
-       << pfx << setw(28) << "stop_offset:"  << theStopOffset
-       << std::endl;
-   return out;
-}
-
-ossim_int32 ossimDtedAcc::absCE() const
-{
-   return atoi(theAbsoluteCE);
-}
-
-ossim_int32 ossimDtedAcc::absLE() const
-{
-   return atoi(theAbsoluteLE);
-}
-
-ossim_int32 ossimDtedAcc::relCE() const
-{
-   return atoi(theRelativeCE);
-}
-
-ossim_int32 ossimDtedAcc::relLE() const
-{
-   return atoi(theRelativeLE);
-}
-   
-ossim_int32 ossimDtedAcc::startOffset() const
-{
-   return theStartOffset;
-}
-
-ossim_int32 ossimDtedAcc::stopOffset()  const
-{
-   return theStopOffset;
-}
-
-
-
-//**************************************************************************
-// operator <<
-//**************************************************************************
-std::ostream& operator<<( std::ostream& os, const ossimDtedAcc& acc)
-{
-   std::string prefix;
-   return acc.print(os, prefix);
-}
-
-ossimDtedAcc::ossimDtedAcc(const ossimDtedAcc& /* source */)
-{
-      clearFields();
-}
-
-const ossimDtedAcc& ossimDtedAcc::operator=(const ossimDtedAcc& rhs)
-{
-   return rhs;
-}
diff --git a/ossim/src/ossim/support_data/ossimDtedDsi.cpp b/ossim/src/ossim/support_data/ossimDtedDsi.cpp
deleted file mode 100644
index 68f0a8f..0000000
--- a/ossim/src/ossim/support_data/ossimDtedDsi.cpp
+++ /dev/null
@@ -1,586 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the Data Set Identification
-//               (DSI) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedDsi.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <string>
-
-#include <ossim/support_data/ossimDtedDsi.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedDsi::ossimDtedDsi(const ossimFilename& dted_file, ossim_int32 offset)
-   :
-      theRecSen(),
-      theSecurityCode(),
-      theField3(),
-      theField4(),
-      theProductLevel(),
-      theField7(),
-      theField8(),
-      theEdition(),
-      theMatchMergeVersion(),
-      theMaintenanceDate(),
-      theMatchMergeDate(),
-      theMaintenanceCode(),
-      theProducerCode(),
-      theField15(),
-      theProductStockSpecNumber(),
-      theProductSpecNumber(),
-      theProductSpecDate(),
-      theVerticalDatum(),
-      theHorizontalDatum(),
-      theField21(),
-      theCompilationDate(),
-      theField23(),
-      theLatOrigin(),
-      theLonOrigin(),
-      theLatSW(),
-      theLonSW(),
-      theLatNW(),
-      theLonNW(),
-      theLatNE(),
-      theLonNE(),
-      theLatSE(),
-      theLonSE(),
-      theOrientation(),
-      theLatInterval(),
-      theLonInterval(),
-      theNumLatPoints(),
-      theNumLonLines(),
-      theCellIndicator(),
-      theField40(),
-      theField41(),
-      theField42(),
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   if(!dted_file.empty())
-   {
-      // Check to see that dted file exists.
-      if(!dted_file.exists())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedDsi::ossimDtedDsi: \nThe DTED file does not exist: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Check to see that the dted file is readable.
-      if(!dted_file.isReadable())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedDsi::ossimDtedDsi: The DTED file is not readable: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Open the dted file for reading.
-      std::ifstream in(dted_file.c_str());
-      if(!in)
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedDsi::ossimDtedDsi: Unable to open the DTED file: " << dted_file << std::endl;
-         return;
-      }
-      in.seekg(offset);
-      parse(in);
-      
-      in.close();
-   }
-}
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedDsi::ossimDtedDsi(std::istream&  in)
-   :
-      theRecSen(),
-      theSecurityCode(),
-      theField3(),
-      theField4(),
-      theProductLevel(),
-      theField7(),
-      theField8(),
-      theEdition(),
-      theMatchMergeVersion(),
-      theMaintenanceDate(),
-      theMatchMergeDate(),
-      theMaintenanceCode(),
-      theProducerCode(),
-      theField15(),
-      theProductStockSpecNumber(),
-      theProductSpecNumber(),
-      theProductSpecDate(),
-      theVerticalDatum(),
-      theHorizontalDatum(),
-      theField21(),
-      theCompilationDate(),
-      theField23(),
-      theLatOrigin(),
-      theLonOrigin(),
-      theLatSW(),
-      theLonSW(),
-      theLatNW(),
-      theLonNW(),
-      theLatNE(),
-      theLonNE(),
-      theLatSE(),
-      theLonSE(),
-      theOrientation(),
-      theLatInterval(),
-      theLonInterval(),
-      theNumLatPoints(),
-      theNumLonLines(),
-      theCellIndicator(),
-      theField40(),
-      theField41(),
-      theField42(),
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   parse(in);
-}
-
-void ossimDtedDsi::parse(std::istream& in)
-{
-   clearErrorStatus();
-   theStartOffset = in.tellg();
-   theStopOffset  = theStartOffset;
-   char tmp_chars[26]; // For blank field reads.
-   
-   // Seek to the start of the record.
-   in.seekg(theStartOffset, std::ios::beg);
-   
-   // Parse theRecSen
-   in.read(theRecSen, FIELD1_SIZE);
-   theRecSen[FIELD1_SIZE] = '\0';
-   if(!(strncmp(theRecSen, "DSI", 3) == 0))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      in.seekg(theStartOffset);
-      return;
-   }
-
-   // Parse theSecurityCode
-   in.read(theSecurityCode, FIELD2_SIZE);
-   theSecurityCode[FIELD2_SIZE] = '\0';
-   
-   // Parse Field 3
-   in.read(theField3, FIELD3_SIZE);
-   theField3[FIELD3_SIZE] = '\0';
-   
-   // Parse Field 4
-   in.read(theField4, FIELD4_SIZE);
-   theField4[FIELD4_SIZE] = '\0';
-   
-   // Parse Field 5 (currently blank)
-   in.read(tmp_chars, FIELD5_SIZE);
-   
-   // Parse theProductLevel
-   in.read(theProductLevel, FIELD6_SIZE);
-   theProductLevel[FIELD6_SIZE] = '\0';
-   
-   // Parse Field 7
-   in.read(theField7, FIELD7_SIZE);
-   theField7[FIELD7_SIZE] = '\0';
-   
-   // Parse Field 8
-   in.read(theField8, FIELD8_SIZE);
-   theField8[FIELD8_SIZE] = '\0';
-   
-   // Parse theEdition
-   in.read(theEdition, FIELD9_SIZE);
-   theEdition[FIELD9_SIZE] = '\0';
-   
-   // Parse theMatchMergeVersion
-   in.read(theMatchMergeVersion, FIELD10_SIZE);
-   theMatchMergeVersion[FIELD10_SIZE] = '\0';
-   
-   // Parse theMaintenanceDate
-   in.read(theMaintenanceDate, FIELD11_SIZE);
-   theMaintenanceDate[FIELD11_SIZE] = '\0';
-   
-   // Parse theMatchMergeDate
-   in.read(theMatchMergeDate, FIELD12_SIZE);
-   theMatchMergeDate[FIELD12_SIZE] = '\0';
-   
-   // Parse theMaintenanceCode
-   in.read(theMaintenanceCode, FIELD13_SIZE);
-   theMaintenanceCode[FIELD13_SIZE] = '\0';
-   
-   // Parse theProducerCode
-   in.read(theProducerCode, FIELD14_SIZE);
-   theProducerCode[FIELD14_SIZE] = '\0';
-   
-   // Parse Field 15
-   in.read(theField15, FIELD15_SIZE);
-   theField15[FIELD15_SIZE] = '\0';
-   
-   // Parse theProductStockSpecNumber
-   in.read(theProductStockSpecNumber, FIELD16_SIZE);
-   theProductStockSpecNumber[FIELD16_SIZE] = '\0';
-   
-   // Parse theProductSpecNumber
-   in.read(theProductSpecNumber, FIELD17_SIZE);
-   theProductSpecNumber[FIELD17_SIZE] = '\0';
-   
-   // Parse theProductSpecDate
-   in.read(theProductSpecDate, FIELD18_SIZE);
-   theProductSpecDate[FIELD18_SIZE] = '\0';
-   
-   // Parse theVerticalDatum
-   in.read(theVerticalDatum, FIELD19_SIZE);
-   theVerticalDatum[FIELD19_SIZE] = '\0';
-   
-   // Parse theHorizontalDatum
-   in.read(theHorizontalDatum, FIELD20_SIZE);
-   theHorizontalDatum[FIELD20_SIZE] = '\0';
-   
-   // Parse Field 21
-   in.read(theField21, FIELD21_SIZE);
-   theField21[FIELD21_SIZE] = '\0';
-   
-   // Parse theCompilationDate
-   in.read(theCompilationDate, FIELD22_SIZE);
-   theCompilationDate[FIELD22_SIZE] = '\0';
-   
-   // Parse Field 23
-   in.read(theField23, FIELD23_SIZE);
-   theField23[FIELD23_SIZE] = '\0';
-   
-   // Parse theLatOrigin
-   in.read(theLatOrigin, FIELD24_SIZE);
-   theLatOrigin[FIELD24_SIZE] = '\0';
-   
-   // Parse theLonOrigin
-   in.read(theLonOrigin, FIELD25_SIZE);
-   theLonOrigin[FIELD25_SIZE] = '\0';
-   
-   // Parse theLatSW
-   in.read(theLatSW, FIELD26_SIZE);
-   theLatSW[FIELD26_SIZE] = '\0';
-   
-   // Parse theLonSW
-   in.read(theLonSW, FIELD27_SIZE);
-   theLonSW[FIELD27_SIZE] = '\0';
-   
-   // Parse theLatNW
-   in.read(theLatNW, FIELD28_SIZE);
-   theLatNW[FIELD28_SIZE] = '\0';
-   
-   // Parse theLonNW
-   in.read(theLonNW, FIELD29_SIZE);
-   theLonNW[FIELD29_SIZE] = '\0';
-   
-   // Parse theLatNE
-   in.read(theLatNE, FIELD30_SIZE);
-   theLatNE[FIELD30_SIZE] = '\0';
-   
-   // Parse theLonNE
-   in.read(theLonNE, FIELD31_SIZE);
-   theLonNE[FIELD31_SIZE] = '\0';
-   
-   // Parse theLatSE
-   in.read(theLatSE, FIELD32_SIZE);
-   theLatSE[FIELD32_SIZE] = '\0';
-   
-   // Parse theLonSE
-   in.read(theLonSE, FIELD33_SIZE);
-   theLonSE[FIELD33_SIZE] = '\0';
-   
-   // Parse theOrientation
-   in.read(theOrientation, FIELD34_SIZE);
-   theOrientation[FIELD34_SIZE] = '\0';
-   
-   // Parse theLatInterval
-   in.read(theLatInterval, FIELD35_SIZE);
-   theLatInterval[FIELD35_SIZE] = '\0';
-   
-   // Parse theLonInterval
-   in.read(theLonInterval, FIELD36_SIZE);
-   theLonInterval[FIELD36_SIZE] = '\0';
-   
-   // Parse theNumLatPoints
-   in.read(theNumLatPoints, FIELD37_SIZE);
-   theNumLatPoints[FIELD37_SIZE] = '\0';
-   
-   // Parse theNumLonLines
-   in.read(theNumLonLines, FIELD38_SIZE);
-   theNumLonLines[FIELD38_SIZE] = '\0';
-   
-   // Parse theCellIndicator
-   in.read(theCellIndicator, FIELD39_SIZE);
-   theCellIndicator[FIELD39_SIZE] = '\0';
-   
-   // Parse Field 40
-   in.read(theField40, FIELD40_SIZE);
-   theField40[FIELD40_SIZE] = '\0';
-   
-   // Parse Field 41
-   in.read(theField41, FIELD41_SIZE);
-   theField41[FIELD41_SIZE] = '\0';
-   
-   // Parse Field 42
-   in.read(theField42, FIELD42_SIZE);
-   theField42[FIELD42_SIZE] = '\0';
-
-   // Set the stop offset.
-   theStopOffset = theStartOffset + DSI_LENGTH;
-}
-
-ossimRefPtr<ossimProperty> ossimDtedDsi::getProperty(
-   const ossimString& /* name */) const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   return result;
-}
-
-void ossimDtedDsi::getPropertyNames(
-   std::vector<ossimString>& propertyNames) const
-{
-   propertyNames.push_back(ossimString("dted_dsi_record"));
-}
-
-ossimString ossimDtedDsi::recognitionSentinel() const
-{
-   return theRecSen;
-}
-
-ossimString ossimDtedDsi::securityCode() const
-{
-   return ossimString(theSecurityCode);
-}
-
-ossimString ossimDtedDsi::productLevel() const
-{
-   return ossimString(theProductLevel);
-}
-
-ossimString ossimDtedDsi::edition() const
-{
-   return ossimString(theEdition);
-}
-
-ossimString ossimDtedDsi::matchMergeVersion() const
-{
-   return ossimString(theMatchMergeVersion);
-}
-
-ossimString ossimDtedDsi::maintanenceDate() const
-{
-   return ossimString(theMaintenanceDate);
-}
-
-ossimString ossimDtedDsi::matchMergeDate() const
-{
-   return ossimString(theMatchMergeDate);
-}
-
-ossimString ossimDtedDsi::maintenanceCode() const
-{
-   return ossimString(theMaintenanceCode);
-}
-
-ossimString ossimDtedDsi::producerCode() const
-{
-   return ossimString(theProducerCode);
-}
-
-ossimString ossimDtedDsi::productStockSpecNumber() const
-{
-   return ossimString(theProductStockSpecNumber);
-}
-
-ossimString ossimDtedDsi::productSpecNumber() const
-{
-   return ossimString(theProductSpecNumber);
-}
-
-ossimString ossimDtedDsi::productSpecDate() const
-{
-   return ossimString(theProductSpecDate);
-}
-
-ossimString ossimDtedDsi::verticalDatum() const
-{
-   return ossimString(theVerticalDatum);
-}
-
-ossimString ossimDtedDsi::horizontalDatum() const
-{
-   return ossimString(theHorizontalDatum);
-}
-
-ossimString ossimDtedDsi::compilationDate() const
-{
-   return ossimString(theCompilationDate);
-}
-
-ossimString ossimDtedDsi::latOrigin() const
-{
-   return ossimString(theLatOrigin);
-}
-
-ossimString ossimDtedDsi::lonOrigin() const
-{
-   return ossimString(theLonOrigin);
-}
-
-ossimString ossimDtedDsi::latSW() const
-{
-   return ossimString(theLatSW);
-}
-
-ossimString ossimDtedDsi::lonSW() const
-{
-   return ossimString(theLonSW);
-}
-
-ossimString ossimDtedDsi::latNW() const
-{
-   return ossimString(theLatNW);
-}
-
-ossimString ossimDtedDsi::lonNW() const
-{
-   return ossimString(theLonNW);
-}
-
-ossimString ossimDtedDsi::latNE() const
-{
-   return ossimString(theLatNE);
-}
-
-ossimString ossimDtedDsi::lonNE() const
-{
-   return ossimString(theLonNE);
-}
-
-ossimString ossimDtedDsi::latSE() const
-{
-   return ossimString(theLatSE);
-}
-
-ossimString ossimDtedDsi::lonSE() const
-{
-   return ossimString(theLonSE);
-}
-
-ossimString ossimDtedDsi::orientation() const
-{
-   return ossimString(theOrientation);
-}
-
-ossimString ossimDtedDsi::latInterval() const
-{
-   return ossimString(theLatInterval);
-}
-
-ossimString ossimDtedDsi::lonInterval() const
-{
-   return ossimString(theLonInterval);
-}
-
-ossim_int32  ossimDtedDsi::numLatPoints() const
-{
-   return atoi(theNumLatPoints);
-}
-
-ossim_int32  ossimDtedDsi::numLonLines() const
-{
-   return atoi(theNumLonLines);
-}
-
-ossim_int32  ossimDtedDsi::cellIndicator() const
-{
-   return atoi(theCellIndicator);
-}
-
-ossim_int32 ossimDtedDsi::startOffset() const
-{
-   return theStartOffset;
-}
-ossim_int32 ossimDtedDsi::stopOffset() const
-{
-   return theStopOffset;
-}
-
-//**************************************************************************
-// operator <<
-//**************************************************************************
-std::ostream& operator<<( std::ostream& os, const ossimDtedDsi& dsi)
-{
-   std::string prefix;
-   return dsi.print(os, prefix);
-}
-
-std::ostream& ossimDtedDsi::print(std::ostream& out,
-                                  const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += "dsi.";
-   
-   out << setiosflags(ios::left)
-       << pfx << setw(28) << "recognition_sentinel:" << theRecSen << "\n"
-       << pfx << setw(28) << "security_code:" << theSecurityCode << "\n"
-       << pfx << setw(28) << "product_level:" << theProductLevel << "\n"
-       << pfx << setw(28) << "edition:" << theEdition << "\n"
-       << pfx << setw(28) << "match_merge_version:" << theMatchMergeVersion
-       << "\n"
-       << pfx << setw(28) << "maintenance_date:" << theMaintenanceDate << "\n"
-       << pfx << setw(28) << "match_merge_date:" << theMatchMergeDate << "\n"
-       << pfx << setw(28) << "maintenance_code:" << theMaintenanceCode << "\n"
-       << pfx << setw(28) << "producer_code:" << theProducerCode << "\n"
-       << pfx << setw(28) << "product_stock_spec_number:"
-       << theProductStockSpecNumber
-       << "\n"
-       << pfx << setw(28) << "product_spec_number:"
-       << theProductSpecNumber << "\n"
-       << pfx << setw(28) << "vertical_datum:" << theVerticalDatum << "\n"
-       << pfx << setw(28) << "horizontal_datum:" << theHorizontalDatum << "\n"
-       << pfx << setw(28) << "compilation_date:" << theCompilationDate << "\n"
-       << pfx << setw(28) << "lat_origin:" << theLatOrigin << "\n"
-       << pfx << setw(28) << "lon_origin:" << theLonOrigin << "\n"
-       << pfx << setw(28) << "lat_sw:" << theLatSW << "\n"
-       << pfx << setw(28) << "lon_sw:" << theLonSW << "\n"
-       << pfx << setw(28) << "lat_nw:" << theLatNW << "\n"
-       << pfx << setw(28) << "lon_nw:" << theLonNW << "\n"
-       << pfx << setw(28) << "lat_ne:" << theLatNE << "\n"
-       << pfx << setw(28) << "lon_ne:" << theLonNE << "\n"
-       << pfx << setw(28) << "lat_se:" << theLatSE << "\n"
-       << pfx << setw(28) << "lon_se:" << theLonSE << "\n"
-       << pfx << setw(28) << "orientation:" << theOrientation << "\n"
-       << pfx << setw(28) << "lat_interval:" << theLatInterval << "\n"
-       << pfx << setw(28) << "lon_interval:" << theLonInterval << "\n"
-       << pfx << setw(28) << "number_of_lat_points:" << theNumLatPoints << "\n"
-       << pfx << setw(28) << "number_of_lon_lines:" << theNumLonLines << "\n"
-       << pfx << setw(28) << "cell_indicator:" << theCellIndicator << "\n"
-       << pfx << setw(28) << "start_offset:" << theStartOffset << "\n"
-       << pfx << setw(28) << "stop_offset:" << theStopOffset
-       << std::endl;
-   return out;
-}
-
-ossimDtedDsi::ossimDtedDsi(const ossimDtedDsi& /* source */)
-{}
-
-const ossimDtedDsi& ossimDtedDsi::operator=(const ossimDtedDsi& rhs)
-{
-   return rhs;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDtedHdr.cpp b/ossim/src/ossim/support_data/ossimDtedHdr.cpp
deleted file mode 100644
index c2b4044..0000000
--- a/ossim/src/ossim/support_data/ossimDtedHdr.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the File Header Label
-//               (HDR) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedHdr.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <fstream>
-#include <string>
-
-#include <ossim/support_data/ossimDtedHdr.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedHdr::ossimDtedHdr(const ossimFilename& dted_file, ossim_int32 offset)
-   :
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   if(!dted_file.empty())
-   {
-      // Check to see that dted file exists.
-      if(!dted_file.exists())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedHdr::ossimDtedHdr: The DTED file does not exist: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Check to see that the dted file is readable.
-      if(!dted_file.isReadable())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedHdr::ossimDtedHdr: The DTED file is not readable: " << dted_file << std::endl;
-         return;
-      }
-      
-      std::ifstream in(dted_file.c_str());
-      // Open the dted file for reading.
-      if(!in)
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedHdr::ossimDtedHdr: Error opening the DTED file: " << dted_file << std::endl;
-         return;
-      }
-      in.seekg(offset);
-      // Continue parsing all the record fields.
-      parse(in);
-      
-      in.close();
-   }
-}
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedHdr::ossimDtedHdr(std::istream& in)
-   :
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   parse(in);
-}
-
-//**************************************************************************
-// ossimDtedHdr::parse()
-//**************************************************************************
-void ossimDtedHdr::parse(std::istream& in)
-{
-   clearErrorStatus();
-   theStartOffset = in.tellg();
-   theStopOffset  = theStartOffset;
-   // Parse theRecSen
-   in.read(theRecSen, FIELD1_SIZE);
-   theRecSen[FIELD1_SIZE] = '\0';
-
-   if(!(strncmp(theRecSen, "HDR", 3) == 0))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      in.seekg(theStartOffset);
-      return;
-   }
-   
-   // Parse Field 2
-   in.read(theField2, FIELD2_SIZE);
-   theField2[FIELD2_SIZE] = '\0';
-   
-   // Parse theFilename
-   in.read(theFilename, FIELD3_SIZE);
-   theFilename[FIELD3_SIZE] = '\0';
-   
-   // Parse Field 4
-   in.read(theField4, FIELD4_SIZE);
-   theField4[FIELD4_SIZE] = '\0';
-   
-   // Parse Field 5
-   in.read(theField5, FIELD5_SIZE);
-   theField5[FIELD5_SIZE] = '\0';
-   
-   // Parse Field 6
-   in.read(theField6, FIELD6_SIZE);
-   theField6[FIELD6_SIZE] = '\0';
-   
-   // Parse Field 7
-   in.read(theVersion, FIELD7_SIZE);
-   theVersion[FIELD7_SIZE] = '\0';
-   
-   // Parse theCreationDate
-   in.read(theCreationDate, FIELD8_SIZE);
-   theCreationDate[FIELD8_SIZE] = '\0';
-   
-   // Parse Field 9
-   in.read(theField9, FIELD9_SIZE);
-   theField9[FIELD9_SIZE] = '\0';   
-   
-   // Parse Field 10
-   in.read(theField10, FIELD10_SIZE);
-   theField10[FIELD10_SIZE] = '\0';   
-   
-   // Parse Field 11
-   in.read(theField11, FIELD11_SIZE);
-   theField11[FIELD11_SIZE] = '\0';   
-   
-   // Parse Field 12
-   in.read(theField12, FIELD12_SIZE);
-   theField12[FIELD12_SIZE] = '\0';   
-   
-   // Parse Field 13
-   in.read(theField13, FIELD13_SIZE);
-   theField13[FIELD13_SIZE] = '\0';   
-   
-   // Parse Field 14
-   in.read(theField14, FIELD14_SIZE);
-   theField14[FIELD14_SIZE] = '\0';
-
-   // Set the stop offset.
-   theStopOffset = theStartOffset + HDR_LENGTH;
-}
-
-ossimRefPtr<ossimProperty> ossimDtedHdr::getProperty(
-   const ossimString& /* name */) const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   return result;
-}
-
-void ossimDtedHdr::getPropertyNames(
-   std::vector<ossimString>& propertyNames) const
-{
-   propertyNames.push_back(ossimString("dted_hdr_record"));
-}
-
-
-//**************************************************************************
-// operator <<
-//**************************************************************************
-std::ostream& operator<<( std::ostream& os, const ossimDtedHdr& hdr)
-{
-   std::string prefix;
-   return hdr.print(os, prefix);
-}
-
-std::ostream& ossimDtedHdr::print(std::ostream& out,
-                                  const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += "hdr.";
-   
-   out << pfx << "recognition_sentinel:  " << theRecSen << "\n"
-       << pfx << "field2:                " << theField2 << "\n"
-       << pfx << "filename:              " << theFilename << "\n"
-       << pfx << "field4:                " << theField4 << "\n"
-       << pfx << "field5:                " << theField5 << "\n"
-       << pfx << "field6:                " << theField6 << "\n"
-       << pfx << "version:               " << theVersion << "\n"
-       << pfx << "creation_date:         " << theCreationDate << "\n"
-       << pfx << "field9:                " << theField9 << "\n"
-       << pfx << "field10:               " << theField10 << "\n"
-       << pfx << "field11:               " << theField11 << "\n"
-       << pfx << "field12:               " << theField12 << "\n"
-       << pfx << "field13:               " << theField13 << "\n"
-       << pfx << "field14:               " << theField14 << "\n"
-       << std::endl;
-   
-   return out;
-}
-
-ossimString ossimDtedHdr::recognitionSentinel() const
-{
-   return theRecSen;
-}
-
-ossimString ossimDtedHdr::fileName() const
-{
-   return theFilename;
-}
-ossimString ossimDtedHdr::version() const
-{ return theVersion;
-}
-
-ossimString ossimDtedHdr::creationDate() const
-{
-   return theCreationDate;
-}
-
-ossim_int32 ossimDtedHdr::startOffset() const
-{
-   return theStartOffset;
-}
-
-ossim_int32 ossimDtedHdr::stopOffset() const
-{
-   return theStopOffset;
-}
-
-ossimDtedHdr::ossimDtedHdr(const ossimDtedHdr& /* source */)
-{}
-
-const ossimDtedHdr& ossimDtedHdr::operator=(const ossimDtedHdr& rhs)
-{
-   return rhs;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimDtedInfo.cpp b/ossim/src/ossim/support_data/ossimDtedInfo.cpp
deleted file mode 100644
index ae0c111..0000000
--- a/ossim/src/ossim/support_data/ossimDtedInfo.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: DTED Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <iostream>
-#include <ossim/support_data/ossimDtedInfo.h>
-#include <ossim/support_data/ossimDtedVol.h>
-#include <ossim/support_data/ossimDtedHdr.h>
-#include <ossim/support_data/ossimDtedUhl.h>
-#include <ossim/support_data/ossimDtedDsi.h>
-#include <ossim/support_data/ossimDtedAcc.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimRegExp.h>
-
-
-ossimDtedInfo::ossimDtedInfo()
-   : theFile()
-{
-}
-
-ossimDtedInfo::~ossimDtedInfo()
-{
-}
-
-bool ossimDtedInfo::open(const ossimFilename& file)
-{
-   bool result = false;
-
-   // Test for extension, like dt0, dt1...
-   ossimString ext = file.ext();
-   ossimRegExp regExp("^[d|D][t|T][0-9]");
-   
-   if ( regExp.find( ext.c_str() ) )
-   {
-      ossimDtedVol vol(file, 0);
-      ossimDtedHdr hdr(file, vol.stopOffset());
-      ossimDtedUhl uhl(file, hdr.stopOffset());
-      ossimDtedDsi dsi(file, uhl.stopOffset());
-      ossimDtedAcc acc(file, dsi.stopOffset());
-      
-      //---
-      // Check for errors.  Must have uhl, dsi and acc records.  vol and hdr
-      // are for magnetic tape only; hence, may or may not be there.
-      //---
-      if ( (uhl.getErrorStatus() == ossimErrorCodes::OSSIM_OK) &&
-           (dsi.getErrorStatus() == ossimErrorCodes::OSSIM_OK) &&
-           (acc.getErrorStatus() == ossimErrorCodes::OSSIM_OK) )
-      {
-         theFile = file;
-         result = true;
-      }
-      else
-      {
-         theFile.clear();
-      }
-   }
-
-   return result;
-}
-
-std::ostream& ossimDtedInfo::print(std::ostream& out) const
-{
-   if ( theFile.size() )
-   {
-      std::string prefix = "dted.";
-      
-      ossimDtedVol vol(theFile, 0);
-      ossimDtedHdr hdr(theFile, vol.stopOffset());
-      ossimDtedUhl uhl(theFile, hdr.stopOffset());
-      ossimDtedDsi dsi(theFile, uhl.stopOffset());
-      ossimDtedAcc acc(theFile, dsi.stopOffset());
-      if( vol.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-      {
-         vol.print(out, prefix);
-      }
-      if( hdr.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-      {
-         hdr.print(out, prefix);
-      }
-      if( uhl.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-      {
-         uhl.print(out, prefix);
-      }
-      if( dsi.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-      {
-         dsi.print(out, prefix);
-      }
-      if( acc.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-      {
-         acc.print(out, prefix);
-      }
-   }
-   return out;
-}
-
-ossimRefPtr<ossimProperty> ossimDtedInfo::getProperty(
-   const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-
-   //---
-   // Look through dted records.
-   // Must have uhl, dsi and acc records.  vol and hdr
-   // are for magnetic tape only; hence, may or may not be there.
-   //---
-   ossimDtedVol vol(theFile, 0);
-   if( vol.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-   {
-      if (name == "dted_vol_record")
-      {
-         ossimContainerProperty* box = new ossimContainerProperty();
-         box->setName(name);
-
-         std::vector<ossimString> list;
-         vol.getPropertyNames(list);
-
-         std::vector< ossimRefPtr<ossimProperty> > propList;
-
-         std::vector<ossimString>::const_iterator i = list.begin();
-         while (i != list.end())
-         {
-            ossimRefPtr<ossimProperty> prop = vol.getProperty( (*i) );
-            if (prop.valid())
-            {
-               propList.push_back(prop);
-            }
-            ++i;
-         }
-         box->addChildren(propList);
-         result = box;
-      }
-   }
-   if (result.valid() == false)
-   {
-      ossimDtedHdr hdr(theFile, vol.stopOffset());
-      if( hdr.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-      {
-         if (name == "dted_hdr_record")
-         {
-            ossimContainerProperty* box = new ossimContainerProperty();
-            box->setName(name);
-            
-            std::vector<ossimString> list;
-            hdr.getPropertyNames(list);
-            
-            std::vector< ossimRefPtr<ossimProperty> > propList;
-            
-            std::vector<ossimString>::const_iterator i = list.begin();
-            while (i != list.end())
-            {
-               ossimRefPtr<ossimProperty> prop = hdr.getProperty( (*i) );
-               if (prop.valid())
-               {
-                  propList.push_back(prop);
-               }
-               ++i;
-            }
-            box->addChildren(propList);
-            result = box;
-         }
-      }
-      if (result.valid() == false)
-      {
-         ossimDtedUhl uhl(theFile, hdr.stopOffset());
-         if( uhl.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-         {
-            if (name == "dted_uhl_record")
-            {
-               ossimContainerProperty* box = new ossimContainerProperty();
-               box->setName(name);
-               
-               std::vector<ossimString> list;
-               uhl.getPropertyNames(list);
-               
-               std::vector< ossimRefPtr<ossimProperty> > propList;
-               
-               std::vector<ossimString>::const_iterator i = list.begin();
-               while (i != list.end())
-               {
-                  ossimRefPtr<ossimProperty> prop = uhl.getProperty( (*i) );
-                  if (prop.valid())
-                  {
-                     propList.push_back(prop); 
-                  }
-                  ++i;
-               }
-               box->addChildren(propList);
-               result = box;
-            }
-         }
-         if (result.valid() == false)
-         {
-            ossimDtedDsi dsi(theFile, uhl.stopOffset());
-            if( dsi.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-            {
-               if (name == "dted_dsi_record")
-               {
-                  ossimContainerProperty* box =
-                     new ossimContainerProperty();
-                  box->setName(name);
-                  
-                  std::vector<ossimString> list;
-                  dsi.getPropertyNames(list);
-                  
-                  std::vector< ossimRefPtr<ossimProperty> > propList;
-                  
-                  std::vector<ossimString>::const_iterator i = list.begin();
-                  while (i != list.end())
-                  {
-                     ossimRefPtr<ossimProperty> prop =
-                        dsi.getProperty( (*i) );
-                     if (prop.valid())
-                     {
-                        propList.push_back(prop);
-                     }
-                     ++i;
-                  }
-                  box->addChildren(propList);
-                  result = box;
-               }
-            }
-            if (result.valid() == false)
-            {
-               ossimDtedAcc acc(theFile, dsi.stopOffset());
-               if( acc.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
-               {
-                  if (name == "dted_acc_record")
-                  {
-                     ossimContainerProperty* box =
-                        new ossimContainerProperty();
-                     box->setName(name);
-                     
-                     std::vector<ossimString> list;
-                     acc.getPropertyNames(list);
-                     
-                     std::vector< ossimRefPtr<ossimProperty> > propList;
-                     
-                     ossimRefPtr<ossimProperty> prop = 0;
-                     std::vector<ossimString>::const_iterator i =
-                        list.begin();
-                     while (i != list.end())
-                     {
-                        ossimRefPtr<ossimProperty> prop =
-                           acc.getProperty( (*i) );
-                        if (prop.valid())
-                        {
-                           propList.push_back(prop);
-                        }
-                        ++i;
-                     }
-                     box->addChildren(propList);
-                     result = box;
-                  }
-               }
-            }
-         }
-      }
-   }
-
-   return result;
-}
-
-void ossimDtedInfo::getPropertyNames(
-   std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(ossimString("dted_vol_record"));
-   propertyNames.push_back(ossimString("dted_hdr_record"));
-   propertyNames.push_back(ossimString("dted_uhl_record"));
-   propertyNames.push_back(ossimString("dted_dsi_record"));
-   propertyNames.push_back(ossimString("dted_acc_record"));
-}
-
-
-
diff --git a/ossim/src/ossim/support_data/ossimDtedUhl.cpp b/ossim/src/ossim/support_data/ossimDtedUhl.cpp
deleted file mode 100644
index 3c5cdb5..0000000
--- a/ossim/src/ossim/support_data/ossimDtedUhl.cpp
+++ /dev/null
@@ -1,331 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the User Header Label
-//               (UHL) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedUhl.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdlib>
-#include <iostream>
-#include <iomanip>
-#include <fstream>
-#include <string>
-
-#include <ossim/support_data/ossimDtedUhl.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedUhl::ossimDtedUhl(const ossimFilename& dted_file, ossim_int32 offset)
-   :
-      theRecSen(),
-      theField2(),
-      theLonOrigin(),
-      theLatOrigin(),
-      theLonInterval(),
-      theLatInterval(),
-      theAbsoluteLE(),
-      theSecurityCode(),
-      theNumLonLines(),
-      theNumLatPoints(),
-      theMultipleAccuracy(),
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   if(!dted_file.empty())
-   {
-      // Check to see that dted file exists.
-      if(!dted_file.exists())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedUhl::ossimDtedUhl: The DTED file does not exist: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Check to see that the dted file is readable.
-      if(!dted_file.isReadable())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedUhl::ossimDtedUhl: The DTED file is not readable --> " << dted_file << std::endl;
-         return;
-      }
-      
-      std::ifstream in(dted_file.c_str());
-      if(!in)
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDtedUhl::ossimDtedUhl: Error opening the DTED file: " << dted_file << std::endl;
-         
-         return;
-      }
-      in.seekg(offset);
-      parse(in);
-      
-      in.close();
-   }
-}
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedUhl::ossimDtedUhl(std::istream& in)
-   :
-      theRecSen(),
-      theLonOrigin(),
-      theLatOrigin(),
-      theLonInterval(),
-      theLatInterval(),
-      theAbsoluteLE(),
-      theSecurityCode(),
-      theNumLonLines(),
-      theNumLatPoints(),
-      theMultipleAccuracy(),
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   parse(in);
-}
-
-//**************************************************************************
-// ossimDtedUhl::parse()
-//**************************************************************************
-void ossimDtedUhl::parse(std::istream& in)
-{
-   clearErrorStatus();
-   theStartOffset = in.tellg();
-   theStopOffset  = theStartOffset;
-   // Parse theRecSen
-   in.read(theRecSen, FIELD1_SIZE);
-   theRecSen[FIELD1_SIZE] = '\0';
-
-   if(!(strncmp(theRecSen, "UHL", 3) == 0))
-   {
-      // Not a user header label.
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;  
-      in.seekg(theStartOffset);
-      return;
-   }  
-   
-   // Parse Field 2
-   in.read(theField2, FIELD2_SIZE);
-   theField2[FIELD2_SIZE] = '\0';
-   
-   // Parse theLonOrigin
-   in.read(theLonOrigin, FIELD3_SIZE);
-   theLonOrigin[FIELD3_SIZE] = '\0';
-   
-   // Parse theLatOrigin
-   in.read(theLatOrigin, FIELD4_SIZE);
-   theLatOrigin[FIELD4_SIZE] = '\0';
-   
-   // Parse theLonInterval
-   in.read(theLonInterval, FIELD5_SIZE);
-   theLonInterval[FIELD5_SIZE] = '\0';
-   
-   // Parse theLatInterval
-   in.read(theLatInterval, FIELD6_SIZE);
-   theLatInterval[FIELD6_SIZE] = '\0';
-   
-   // Parse theAbsoluteLE
-   in.read(theAbsoluteLE, FIELD7_SIZE);
-   theAbsoluteLE[FIELD7_SIZE] = '\0';
-   
-   // Parse theSecurityCode
-   in.read(theSecurityCode, FIELD8_SIZE);
-   theSecurityCode[FIELD8_SIZE] = '\0';
-   
-   // Parse Field 9
-   in.read(theField9, FIELD9_SIZE);
-   theField9[FIELD9_SIZE] = '\0';
-   
-   // Parse theNumLonLines
-   in.read(theNumLonLines, FIELD10_SIZE);
-   theNumLonLines[FIELD10_SIZE] = '\0';
-   
-   // Parse theNumLatPoints
-   in.read(theNumLatPoints, FIELD11_SIZE);
-   theNumLatPoints[FIELD11_SIZE] = '\0';
-   
-   // Parse theMultipleAccuracy
-   in.read(theMultipleAccuracy, FIELD12_SIZE);
-   theMultipleAccuracy[FIELD12_SIZE] = '\0';
-
-   // Field 13 not parsed as it's unused.
-   in.ignore(FIELD13_SIZE);
-   // Set the stop offset.
-   theStopOffset = theStartOffset + UHL_LENGTH;
-}
-
-ossimRefPtr<ossimProperty> ossimDtedUhl::getProperty(
-   const ossimString& /* name */) const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   return result;
-}
-
-void ossimDtedUhl::getPropertyNames(
-   std::vector<ossimString>& propertyNames) const
-{
-   propertyNames.push_back(ossimString("dted_uhl_record"));
-}
-
-ossimString ossimDtedUhl::recognitionSentinel() const
-{
-   return theRecSen;
-}
-
-double ossimDtedUhl::lonOrigin() const
-{
-   return degreesFromString(theLonOrigin);
-}
-
-double ossimDtedUhl::latOrigin() const
-{
-   return degreesFromString(theLatOrigin);
-}
-
-double ossimDtedUhl::lonInterval()      const
-{
-   return spacingFromString(theLonInterval);
-}
-
-double ossimDtedUhl::latInterval()      const
-{
-   return spacingFromString(theLatInterval);
-}
-  
-double ossimDtedUhl::degreesFromString(const char* str) const
-{
-   // Parse the string:  DDDMMMSSH
-   if (!str)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "FATAL ossimDtedUhl::degreesFromString: "
-         << "Null pointer passed to method!" << std::endl;
-      return 0.0;
-   }
-   
-   if (strlen(str) < 8)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "FATAL ossimDtedUhl::decimalDegreesFromString:"
-         << "String not big enough!" << std::endl;
-      return 0.0;
-   }
-
-   double d = ((str[0]-'0')*100 + (str[1]-'0')*10 + (str[2]-'0') +
-               (str[3]-'0')/6.0 + (str[4]-'0')/60.0 +
-               (str[5]-'0')/360.0 + (str[6]-'0')/3600.0);
-   
-   if ( (str[7] == 'S') || (str[7] == 's') ||
-        (str[7] == 'W') || (str[7] == 'w') )
-   {
-      d *= -1.0;
-   }
-   
-   return d;
-}
- 
-double ossimDtedUhl::spacingFromString(const char* str) const
-{
-   // Parse the string: SSSS (tenths of a second)
-   if (!str)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "FATAL ossimDtedUhl::decimalDegreesFromString: "
-         << "Null pointer passed to method!" << std::endl;
-      return 0.0;
-   }
-
-   return atof(str) / 36000.0;  // return 10ths of second as decimal degrees.
-}
-
-double ossimDtedUhl::absoluteLE() const
-{
-  return strtod(theAbsoluteLE, NULL);  
-}
-
-ossimString ossimDtedUhl::securityCode() const
-{
-   return theSecurityCode;
-}
-
-ossim_int32 ossimDtedUhl::numLonLines() const
-{
-  return atoi(theNumLonLines);
-}
-
-ossim_int32 ossimDtedUhl::numLatPoints() const
-{
-  return atoi(theNumLatPoints);
-}
-
-ossim_int32 ossimDtedUhl::mulitpleAccuracy() const
-{
-  return atoi(theMultipleAccuracy);
-}
-
-ossim_int32 ossimDtedUhl::startOffset() const
-{
-  return theStartOffset;
-}
-
-ossim_int32 ossimDtedUhl::stopOffset() const
-{
-  return theStopOffset;
-}
-
-//**************************************************************************
-// operator <<
-//**************************************************************************
-std::ostream& operator<<( std::ostream& out, const ossimDtedUhl& uhl)
-{
-   std::string prefix;
-   return uhl.print(out, prefix);
-}
-
-std::ostream& ossimDtedUhl::print(std::ostream& out,
-                                  const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += "uhl.";
-   
-   out << setiosflags(ios::left)
-       << pfx << setw(28) << "recognition_sentinel:" << theRecSen << "\n"
-       << pfx << setw(28) << "lon_origin:" << theLonOrigin << "\n"
-       << pfx << setw(28) << "lat_origin:" << theLatOrigin << "\n"
-       << pfx << setw(28) << "lon_interval:" << theLonInterval << "\n"
-       << pfx << setw(28) << "lat_interval:" << theLatInterval << "\n"
-       << pfx << setw(28) << "absolute_le:" << theAbsoluteLE << "\n"
-       << pfx << setw(28) << "security_code:" << theSecurityCode << "\n"
-       << pfx << setw(28) << "number_of_lat_points:" << theNumLatPoints << "\n"
-       << pfx << setw(28) << "number_of_lon_lines:" << theNumLonLines << "\n"
-       << pfx << setw(28) << "multiple_accuracy:"
-       << theMultipleAccuracy << "\n"
-       << pfx << setw(28) << "start_offset:" << theStartOffset << "\n"
-       << pfx << setw(28) << "stop_offset:" << theStopOffset
-       << std::endl;
-   
-   return out;
-}
-
-ossimDtedUhl::ossimDtedUhl(const ossimDtedUhl& /* source */)
-{
-}
-
-const ossimDtedUhl& ossimDtedUhl::operator=(const ossimDtedUhl& rhs)
-{
-   return rhs;
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimDtedVol.cpp b/ossim/src/ossim/support_data/ossimDtedVol.cpp
deleted file mode 100644
index dabbbb7..0000000
--- a/ossim/src/ossim/support_data/ossimDtedVol.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Ken Melero
-// 
-// Description:  This class gives access to the Volume Header Label
-//               (VOL) of a DTED Level 1 file.
-//
-//********************************************************************
-// $Id: ossimDtedVol.cpp 17501 2010-06-02 11:14:55Z dburken $
-
-#include <iostream>
-#include <fstream>
-#include <string>
-
-#include <ossim/support_data/ossimDtedVol.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedVol::ossimDtedVol(const ossimFilename& dted_file,
-                           ossim_int32 offset)
-   :
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   if(!dted_file.empty())
-   {
-      // Check to see that dted file exists.
-      if(!dted_file.exists())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL)
-         << "FATAL ossimDtedVol::ossimDtedVol"
-         << "\nThe DTED file does not exist: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Check to see that the dted file is readable.
-      if(!dted_file.isReadable())
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL)
-         << "FATAL ossimDtedVol::ossimDtedVol"
-         << "\nThe DTED file is not readable: " << dted_file << std::endl;
-         return;
-      }
-      
-      // Open the dted file for reading.
-      std::ifstream in(dted_file.c_str());
-      if(!in)
-      {
-         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-         ossimNotify(ossimNotifyLevel_FATAL)
-         << "FATAL ossimDtedVol::ossimDtedVol"
-         << "\nUnable to open the DTED file: " << dted_file << std::endl;
-         return;
-      }
-      in.seekg(offset);
-      parse(in);
-      
-      in.close();
-   }
-}
-
-//**************************************************************************
-// CONSTRUCTOR
-//**************************************************************************
-ossimDtedVol::ossimDtedVol(std::istream& in)
-   :
-      theStartOffset(0),
-      theStopOffset(0)
-{
-   parse(in);
-}
-
-void ossimDtedVol::parse(std::istream& in)
-{
-   clearErrorStatus();
-   theStartOffset = in.tellg();
-   theStopOffset  = theStartOffset;
-   // Parse theRecSen
-   in.read(theRecSen, FIELD1_SIZE);
-   theRecSen[FIELD1_SIZE] = '\0';
-   if(!(strncmp(theRecSen, "VOL", 3) == 0))
-   {
-      // Not a volume header label.
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      in.seekg(theStartOffset);
-      return;
-   }   
-
-   // Parse Field 2
-   in.read(theField2, FIELD2_SIZE);
-   theField2[FIELD2_SIZE] = '\0';
-   
-   // Parse theReelNumber
-   in.read(theReelNumber, FIELD3_SIZE);
-   theReelNumber[FIELD3_SIZE] = '\0';
-   
-   // Parse Field 4
-   in.read(theField4, FIELD4_SIZE);
-   theField4[FIELD4_SIZE] = '\0';
-   
-   // Parse Field 5
-   in.read(theField5, FIELD5_SIZE);
-   theField5[FIELD5_SIZE] = '\0';
-   
-   // Parse theAccountNumber
-   in.read(theAccountNumber, FIELD6_SIZE);
-   theAccountNumber[FIELD6_SIZE] = '\0';
-   
-   // Parse Field 7
-   in.read(theField7, FIELD7_SIZE);
-   theField7[FIELD7_SIZE] = '\0';
-
-   // Parse Field 8
-   in.read(theField8, FIELD8_SIZE);
-   theField8[FIELD8_SIZE] = '\0';
-
-   // Set the stop offset.
-   theStopOffset = theStartOffset + VOL_LENGTH;
-}
-
-ossimRefPtr<ossimProperty> ossimDtedVol::getProperty(
-   const ossimString& /* name */) const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-   return result;
-}
-
-void ossimDtedVol::getPropertyNames(
-   std::vector<ossimString>& propertyNames) const
-{
-   propertyNames.push_back(ossimString("dted_vol_record"));
-}
-
-ossimString ossimDtedVol::getRecognitionSentinel() const
-{
-   return ossimString(theRecSen);
-}
-
-ossimString ossimDtedVol::getReelNumber() const
-{
-   return ossimString(theReelNumber);
-}
-
-ossimString ossimDtedVol::getAccountNumber() const
-{
-   return ossimString(theAccountNumber);
-}
-
-ossim_int32 ossimDtedVol::startOffset() const
-{
-   return theStartOffset;
-}
-
-ossim_int32 ossimDtedVol::stopOffset() const
-{
-   return theStopOffset;
-}
-
-std::ostream& ossimDtedVol::print(std::ostream& out,
-                                  const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += "vol.";
-   
-   out << pfx << "recognition_sentinel: " << theRecSen << "\n"
-       << pfx << "field2:                " << theField2 << "\n"
-       << pfx << "reel_number:           " << theReelNumber << "\n"
-       << pfx << "field4:                " << theField4 << "\n"
-       << pfx << "field5:                " << theField5 << "\n"
-       << pfx << "account_number:        " << theAccountNumber << "\n"
-       << pfx << "field7:                " << theField7 << "\n"
-       << pfx << "field8:                " << theField8 << "\n"
-       << std::endl;
-   return out;
-}
-
-//**************************************************************************
-// operator <<
-//**************************************************************************
-std::ostream& operator<<( std::ostream& out, const ossimDtedVol& vol)
-{
-   std::string prefix;
-   return vol.print(out, prefix);
-}
-
-ossimDtedVol::ossimDtedVol(const ossimDtedVol& /* source */)
-{
-}
-
-const ossimDtedVol& ossimDtedVol::operator=(const ossimDtedVol& rhs)
-{
-   return rhs;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimERS.cpp b/ossim/src/ossim/support_data/ossimERS.cpp
deleted file mode 100644
index de39813..0000000
--- a/ossim/src/ossim/support_data/ossimERS.cpp
+++ /dev/null
@@ -1,673 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Chong-Ket Chuah
-// Contributor: Anrew Huang
-// 
-// Description:
-// Implementation of ossimERS class for parsing a ER Mapper raster
-// file format header.
-//
-//********************************************************************
-// $Id: ossimERS.cpp 17501 2010-06-02 11:14:55Z dburken $
-
-#include <cstdio>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimERS.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-static ossimTrace traceDebug("ossimERS:degug");
-
-
-ossimERS::ossimERS()
-   :
-      ossimErrorStatusInterface()
-{
-   clearFields();
-}
-
-ossimERS::ossimERS(const char* headerFile)
-   :
-      ossimErrorStatusInterface()
-{
-   clearFields();
-
-   // open the header file:
-   std::ifstream in;
-   in.open(headerFile, std::ios::in | std::ios::binary);
-
-   if (!in)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   // Begin parsing records:
-   if (!theErrorStatus)
-   {
-      parseHeader(in);
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimERS DEBUG:"
-         << *this
-         << std::endl;
-   }
-}
-
-void ossimERS::parseError(const char* /* msg*/ )
-{
-   theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-}
-
-void ossimERS::parseRasterInfo(std::istream& in)
-{
-   std::vector<ossimString> tokens;
-
-   bool done = false;
-   while (!done)
-   {
-      tokens = parseLine(in);
-      if (tokens.empty())
-      {
-         parseError("premature end of header file.");
-         return;
-      }
-      if (tokens[0] == "CellType")
-      {
-         if (tokens[1] == "Unsigned8BitInteger")
-         {
-            theCelltype = OSSIM_UCHAR;
-         }
-         else if (tokens[1] == "Unsigned16BitInteger")
-         {
-            theCelltype = OSSIM_USHORT16;
-         }
-         else if (tokens[1] == "Signed16BitInteger")
-         {
-            theCelltype = OSSIM_SSHORT16;
-         }
-         else if (tokens[1] == "IEEE4ByteReal")
-         {
-            theCelltype = OSSIM_FLOAT;
-         }
-         else if (tokens[1] == "IEEE8ByteReal")
-         {
-            theCelltype = OSSIM_DOUBLE;
-         }
-         else
-         {
-            parseError("Unsupported CellType.");
-         }
-      }
-      else if (tokens[0] == "NullCellValue")
-      {
-         theHasNullCells = true;
-         theNullCell = tokens[1].toInt();	 // float nullcell value?
-      }
-      else if (tokens[0] == "Xdimension")
-      {	// ignore "CellInfo"
-         theCellSizeX = tokens[1].toDouble();
-      }
-      else if (tokens[0] == "Ydimension")
-      {	// ignore "CellInfo"
-         theCellSizeY = tokens[1].toDouble();
-      }
-      else if (tokens[0] == "NrOfLines")
-      {
-         theLine = tokens[1].toInt();
-      }
-      else if (tokens[0] == "NrOfCellsPerLine")
-      {
-         theSample = tokens[1].toInt();
-      }
-      else if (tokens[0] == "Eastings")
-      {	// ignore "RegistrationCoord"
-         theTieUnitType = OSSIM_METERS;
-         theOriginX = tokens[1].toDouble();
-      }
-      else if (tokens[0] == "Northings")
-      {	// ignore "RegistrationCoord"
-         theTieUnitType = OSSIM_METERS;
-         theOriginY = tokens[1].toDouble();
-      }
-      else if (tokens[0] == "Longitude")
-      {	// ignore "RegistrationCoord"
-                                                // need to check coordinatestype ("Cannot use Latitude with UTM projection")
-         double deg, min, sec;
-         sscanf (tokens[1].chars(), "%lg:%lg:%lg", &deg, &min, &sec);
-         theOriginX = std::abs(deg) + min/60.0 + sec/3600.0;
-         if (deg < 0.0)
-         {
-            theOriginX = -theOriginX;
-         }
-         theTieUnitType = OSSIM_DEGREES;
-      }
-      else if (tokens[0] == "Latitude")
-      {	// ignore "RegistrationCoord"
-         double deg, min, sec;
-         sscanf (tokens[1].chars(), "%lg:%lg:%lg", &deg, &min, &sec);
-         theOriginY = std::abs(deg) + min/60.0 + sec/3600.0;
-         if (deg < 0.0)
-         {
-            theOriginY = -theOriginY;
-         }
-         theTieUnitType = OSSIM_DEGREES;
-      }
-      else if (tokens[0] == "NrOfBands")
-      {
-         theBands = tokens[1].toInt();
-      }
-      else if (tokens[0] == "Value")
-      {	// ignore "BandID"
-        // keep adding to the bandID vector
-        // delete Value key then join the rest of tokens
-         tokens.erase(tokens.begin());
-         ossimString id;
-         id.join(tokens, " ");
-         theBandID.push_back(id);
-      }
-      else if (tokens[0] == "RasterInfo")
-      {
-         done = true;
-      }
-   }
-}
-
-
-void ossimERS::parseCoordinateSpace(std::istream& in)
-{
-   std::vector<ossimString> tokens;
-
-   bool done = false;
-   while (!done)
-   {
-      tokens = parseLine(in);
-      if (tokens.empty())
-      {
-         parseError("premature end of header file.");
-         return;
-      }
-      if (tokens[0] == "Datum")
-      {
-         theDatum = tokens[1];
-         if (theDatum != "WGS84" && theDatum != "RAW")
-         {
-            parseError("Datum must be WGS84 or RAW");
-         }
-      }
-      else if (tokens[0] == "Projection")
-      {
-         theProjection = tokens[1];
-         // need to parse projection string
-         /*(EqualStrings (tok(1,3), "UTM")) {
-           coordinateSystem = 'U';
-           if (tok(0) == 'N')
-           northernHemisphere = 1;
-           else
-           northernHemisphere = 0;
-           spString zoneStr = tok(4,2);
-           sscanf (zoneStr.chars(), "%d", &zone);
-         */
-      }
-      else if (tokens[0] == "CoordinateType")
-      {
-         // ignore it
-      }
-      else if (tokens[0] == "Units")
-      {
-         // ignore it for now
-      }
-      else if (tokens[0] == "Rotation")
-      {
-         double deg, min, sec;
-         sscanf (tokens[1].chars(), "%lg:%lg:%lg", &deg, &min, &sec);
-         theRotation = deg + min/60.0 + sec/3600.0;
-      }
-      else if (tokens[0] == "CoordinateSpace")
-      {
-         done = true;
-      }
-   }
-
-   // requires more error checking on unit and rotation here
-   return;
-}
-
-void ossimERS::parseHeader(std::istream& in)
-{
-   theErrorStatus = ossimErrorCodes::OSSIM_OK;
-   char magicNumberTest[14];
-   in.read(magicNumberTest, 13);
-   if(ossimString(magicNumberTest,
-                  magicNumberTest+13) != "DatasetHeader")
-   {
-      parseError("First line must be DatasetHeader");
-      return;
-   }
-   in.seekg(0);
-   std::vector<ossimString> tokens = parseLine(in);
-   if(!tokens.size())
-   {
-      parseError("First line must be DatasetHeader");
-      return;
-   }
-   if (tokens[0] != "DatasetHeader")
-   {
-      parseError("First line must be DatasetHeader");
-      return;
-   }
-
-   bool done = false;
-   while (!done)
-   {
-      tokens = parseLine(in);
-      if (tokens.empty())
-      {
-         parseError("premature end of header file.");
-         return;
-      }
-      if (tokens[0] == "Version")
-      {
-         theVersion = tokens[1].toDouble();
-         if (theVersion < 4.0)
-         {
-            parseError("Version must be 4.0 or greater");
-         }
-      }
-      else if (tokens[0] == "DataSetType")
-      {
-         theDatasetType = tokens[1];
-         if (theDatasetType != "ERStorage")
-         {
-            parseError("DataSetType must be ERStorage");
-         }
-      }
-      else if (tokens[0] == "DataType")
-      {
-         theDatatype = tokens[1];
-         if (theDatatype != "Raster")
-         {
-            parseError("DataType must be Raster");
-         }
-      }
-      else if (tokens[0] == "ByteOrder")
-      {
-         theByteorder = tokens[1];
-         if (theByteorder != "MSBFirst" && theByteorder != "LSBFirst")
-         {
-            parseError("ByteOrder must either be MSBFirst or LSBFirst");
-         }
-      }
-      else if (tokens[0] == "CoordinateSpace")
-      {
-         if (tokens[1] == "Begin")
-         {
-            parseCoordinateSpace(in);
-         }
-      }
-      else if (tokens[0] == "RasterInfo")
-      {
-         if (tokens[1] == "Begin")
-         {
-            parseRasterInfo(in);
-         }
-      }
-      else if (tokens[0] == "SenseDate")
-      {
-         // ignore for now
-      }
-      else if (tokens[0] == "Comments")
-      {
-         // ignore for now
-      }
-      else if (tokens[0] == "DatasetHeader")
-      {
-         done = true;
-      }
-   }
-
-   if(theProjection.contains("GEODETIC"))
-   {
-      theTieUnitType = OSSIM_DEGREES;
-   }
-
-   return;
-}
-
-
-// read a line from the file, split it using "= \t\n" delimiters.
-// if the first token is empty, if the line begins with a tab, delete
-// the token.  The second token, the value for the key, may be quoted.
-// trim the quotes.
-std::vector<ossimString> ossimERS::parseLine(std::istream& in)
-{
-/*   const int bufSize = 500; */
-   ossimString line;
-   std::vector<ossimString> tokens;
-   bool invalidCharHit = false;
-   const int MAX_LENGTH = 10000;
-   int tempCount = 0;
-   // read a line, skipping empty line
-   while (tokens.empty()&&(in)&&(tempCount < MAX_LENGTH))
-   {
-     tempCount = 1;
-      char c = in.get();
-      while( (c != '\n')&&
-             (!in.eof())&&
-             (!invalidCharHit))
-      {
-         if(c > 0x7e)
-         {
-            invalidCharHit = true;
-         }
-         else
-         {
-            line += (char)c;
-            c = in.get();
-	    ++tempCount;
-         }
-      }
-
-      if(!invalidCharHit)
-      {
-         line.trim('\t');
-         line.trim('\n');
-         line.trim('\r');
-         line.trim(' ');
-
-         if(line != "")
-         {
-            tokens = line.split("= \t");
-            if (tokens.size() > 1)
-            {
-               tokens[1].trim('\"');
-               tokens.back().trim('\"');
-            }
-         }
-      }
-      else
-      {
-         tokens.clear();
-         return tokens;
-      }
-   }
-   if(in.bad()||(tempCount>=MAX_LENGTH))
-     {
-       tokens.clear();
-     }
-
-   return tokens;
-}
-
-bool ossimERS::writeFile(const ossimFilename &file)
-{
-   if (theDescription.empty())
-   {
-      theDescription = file;
-   }
-   
-   std::ofstream out(file.c_str(), std::ios_base::out);
-   
-   if (!out)
-   {
-      return false;
-   }
-   
-   print(out);
-   out.close();
-   return true;
-
-}
-
-std::ostream& ossimERS::print(std::ostream& out) const
-{
-   out<< std::setiosflags(std::ios::fixed) << std::setprecision(12);
-   out<<"DatasetHeader Begin" <<std::endl;
-   out<<"	Version		= \"5.5\"" <<std::endl;
-   out<<"	DataSetType	= " <<theDatasetType <<std::endl;
-   out<<"	DataType	= " <<theDatatype <<std::endl;
-   out<<"	ByteOrder	= " <<theByteorder <<std::endl;
-   
-   out<<"	CoordinateSpace Begin" <<std::endl;
-   out<<"		Datum		= \"" <<theDatum <<"\"" <<std::endl;
-   out<<"		Projection	= \"" <<theProjection <<"\"" <<std::endl;
-   out<<"		CoordinateType	= " <<theCoordSysType <<std::endl;
-   out<<"	CoordinateSpace End" <<std::endl;
-   
-   ossimString celltype;
-   if (theCelltype == OSSIM_UINT8)
-      celltype = "Unsigned8BitInteger";
-   else if (theCelltype == OSSIM_SINT8)
-      celltype = "Signed8BitInteger";
-   else if (theCelltype == OSSIM_UINT16)
-      celltype = "Unsigned16BitInteger";
-   else if (theCelltype == OSSIM_SINT16)
-      celltype = "Signed16BitInteger";
-   else if (theCelltype == OSSIM_UINT32)
-      celltype = "Unsigned32BitInteger";
-   else if (theCelltype == OSSIM_SINT32)
-      celltype = "Signed32BitInteger";
-   else if (theCelltype == OSSIM_USHORT11)
-      celltype = "Unsigned16BitInteger";
-   else if (theCelltype == OSSIM_USHORT16)
-      celltype = "Unsigned16BitInteger";
-   
-   out<<"	RasterInfo Begin" <<std::endl;
-   out<<"		CellType	= " <<celltype <<std::endl;
-   
-   out<<"		CellInfo Begin" <<std::endl;
-   out<<"			Xdimension	= " <<theCellSizeX <<std::endl;
-   out<<"			Ydimension	= " <<theCellSizeY <<std::endl;
-   out<<"		CellInfo End" <<std::endl;
-   
-   out<<"		NrOfLines	= " <<theLine <<std::endl;
-   out<<"		NrOfCellsPerLine	= " <<theSample <<std::endl;
-   
-   out<<"		RegistrationCoord Begin" <<std::endl;
-   if (theTieUnitType == OSSIM_METERS)
-   {
-      out<<"			Eastings	= " <<theOriginX <<std::endl;
-      out<<"			Northings	= " <<theOriginY <<std::endl;
-   }
-   else if (theTieUnitType == OSSIM_DEGREES)
-   {
-      bool minus = false;
-      int min;
-      double degrees, seconds;
-      degrees = theOriginY;
-      if (theOriginY < 0)
-      {
-         minus = true;
-         degrees *=-1;
-      }
-      min = (int)((degrees-(int)degrees)*60);
-      seconds =  ((degrees-(int)degrees)*60 - min)*60;
-      if (minus)
-         degrees *= -1;
-      out<<"			Latitude	= "
-         <<(int)degrees<<":"<<min<<":"<<seconds<<std::endl;
-      
-      minus = false;
-      degrees = theOriginX;
-      if (theOriginX < 0)
-      {
-         minus = true;
-         degrees *=-1;
-      }
-      min = (int)((degrees-(int)degrees)*60);
-      seconds =  ((degrees-(int)degrees)*60 - min)*60;
-      if (minus)
-         degrees *= -1;
-      out<<"			Longitude	= "
-         <<(int)degrees<<":"<<min<<":"<<seconds<<std::endl;
-   }
-   out<<"		RegistrationCoord End" <<std::endl;
-   
-   out<<"		NrOfBands	= " <<theBands <<std::endl;
-   out<<"	RasterInfo End" <<std::endl;
-   
-   out<<"DatasetHeader End" <<std::endl;
-   
-   return out;
-}
-
-bool ossimERS::toOssimProjectionGeom(ossimKeywordlist& kwl,
-                                     const char* prefix)const
-{
-   ossimString proj  = toOssimProjection();
-   ossimString datum = toOssimDatum();
-
-   if(proj == "")
-   {
-      return false;
-   }
-
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           proj.c_str(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::DATUM_KW,
-           datum.c_str(),
-           true);
-
-   // if it's UTM we have to extract out zone and hemisphere
-   // from the projection name stored by ERMapper.
-   //
-   if(proj == "ossimUtmProjection")
-   {
-      ossimString zone(theProjection.begin()+4,
-                       theProjection.end());
-      ossimString hemisphere(theProjection.begin(),
-                             theProjection.begin()+1);
-      kwl.add(prefix,
-              ossimKeywordNames::ZONE_KW,
-              zone.c_str(),
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::HEMISPHERE_KW,
-              hemisphere.c_str(),
-              true);
-   }
-
-   if(theTieUnitType == OSSIM_METERS)
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_EASTING_KW,
-              theOriginX + theCellSizeX/2,
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_NORTHING_KW,
-              theOriginY - theCellSizeY/2,
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::METERS_PER_PIXEL_X_KW,
-              theCellSizeX,
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
-              theCellSizeY,
-              true);
-
-   }
-   else if(theTieUnitType == OSSIM_DEGREES)
-   {
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_LAT_KW,
-              theOriginY - theCellSizeY/2,
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::TIE_POINT_LON_KW,
-              theOriginX + theCellSizeX/2,
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-              theCellSizeX,
-              true);
-      kwl.add(prefix,
-              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-              theCellSizeY,
-              true);
-   }
-
-   return true;
-}
-
-ossimString ossimERS::toOssimProjection()const
-{
-   ossimString result = "";
-
-   if(theProjection.contains("UTM"))
-   {
-      result = "ossimUtmProjection";
-   }
-   else if(theProjection.contains("GEODETIC"))
-   {
-      result = "ossimEquDistCylProjection";
-   }
-
-   return result;
-}
-
-ossimString ossimERS::toOssimDatum()const
-{
-   ossimString result = "WGE"; // wgs 84 default datum code
-
-   if(theDatum != "WGS84")
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING Datum ossimERS::toOssimDatum: " << theDatum << " is not handled in ossimERS::toOssimDatum()\n"
-                                            << "Please notify us with the datum name so we can add it\n";
-   }
-
-   return result;
-}
-
-//***************************************************************************
-// PRIVATE METHOD: ossimERS::initialize()
-// Initializes all fields to blanks (or 0's) and null terminates strings.
-//***************************************************************************
-void ossimERS::clearFields()
-{
-//   static const char source[] = "";
-
-   theErrorStatus = ossimErrorCodes::OSSIM_OK;
-   theVersion       = 0;
-   theFilename      = "";
-   theDescription   = "";
-   theSensorname    = "";
-   theHeaderOffset = 0;
-   theDatasetType   = "";
-   theDatatype      = "";
-   theByteorder     = "";
-   theComments      = "";
-   theDatum         = "";
-   theProjection    = "";
-   theCoordSysType  = "";
-   theUnits         = "";
-   theRotation      = 0.0;
-   theCelltype      = OSSIM_SCALAR_UNKNOWN;
-   theCellsizeof    = 0;
-   theHasNullCells  = false;
-   theNullCell      = 0;
-   theCellSizeX     = 0;
-   theCellSizeY     = 0;
-   theLine       = 0;
-   theSample     = 0;
-   theOriginX       = 0;
-   theOriginY       = 0;
-   theBands      = 0;
-   theTieUnitType= OSSIM_UNIT_UNKNOWN;
-   theBandID.clear();
-
-   return;
-}
diff --git a/ossim/src/ossim/support_data/ossimEnviInfo.cpp b/ossim/src/ossim/support_data/ossimEnviInfo.cpp
deleted file mode 100644
index c1606ea..0000000
--- a/ossim/src/ossim/support_data/ossimEnviInfo.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ENVI Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/support_data/ossimEnviInfo.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-#include <iostream>
-
-ossimEnviInfo::ossimEnviInfo()
-   : ossimInfoBase(),
-     m_file()
-{
-}
-
-ossimEnviInfo::~ossimEnviInfo()
-{
-}
-
-bool ossimEnviInfo::open( const ossimFilename& file )
-{
-   bool result = false;
-
-   m_file = file;
-
-   if ( file.ext().downcase() != "hdr" )
-   {
-      // Typical case, we were fed the image file.  Look for a header file beside image.
-      m_file.setExtension("hdr"); // image.hdr
-      if ( !m_file.exists() )
-      {
-         m_file.setExtension("HDR"); // image.HDR
-         if ( !m_file.exists() )
-         {
-            m_file = file;
-            m_file.string() += ".hdr"; // image.ras.hdr
-         }
-      }
-   }
-
-   if ( m_file.exists() )
-   {
-      if ( ossimEnviHeader::isEnviHeader( m_file ) )
-      {
-         result = true;
-      }
-   }
-
-   if ( !result ) 
-   {
-      m_file.clear();
-   }
-
-   return result;
-}
-
-std::ostream& ossimEnviInfo::print( std::ostream& out ) const
-{
-   if ( m_file.size() )
-   {
-      ossimEnviHeader hdr;
-      if ( hdr.open( m_file ) )
-      {
-         hdr.getMap().addPrefixToAll( ossimString( "envi." ) );
-         out << hdr.getMap() << std::endl;
-      }
-   }
-   return out; 
-}
-
diff --git a/ossim/src/ossim/support_data/ossimFfRevb.cpp b/ossim/src/ossim/support_data/ossimFfRevb.cpp
deleted file mode 100644
index e9c6d6c..0000000
--- a/ossim/src/ossim/support_data/ossimFfRevb.cpp
+++ /dev/null
@@ -1,1136 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Ken Melero (kmelero at imagelinks.com)
-//         Orginally written by Dave Burken (dburken at imagelinks.com)
-// Description: This class parses an EOSAT Fast Format rev b header.
-//
-//********************************************************************
-// $Id: ossimFfRevb.cpp 13217 2008-07-23 19:19:13Z dburken $
-
-#include <cstdlib>
-#include <cstring>
-#include <fstream>
-#include <sstream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimFfRevb.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-// File scope constants for seek positions.
-const int RADIANCE_OFFSET [7] = { 300,
-                                  317,
-                                  334,
-                                  351,
-                                  368,
-                                  385,
-                                  402  };
-
-static const int PROJ_PARAM_OFFSET [15]  = { 594,
-                                      618,
-                                      642,
-                                      666,
-                                      690,
-                                      714,
-                                      738,
-                                      762,
-                                      786,
-                                      810,
-                                      834,
-                                      858,
-                                      882,
-                                      906,
-                                      930 };
-
-
-//***************************************************************************
-// CONSTRUCTOR
-//***************************************************************************
-ossimFfRevb::ossimFfRevb()
-   :
-      the1stLineInVolume(1),
-      theLinesPerVolume(0),
-      theOrientationAngle(0.0),
-      theUsgsProjNumber(0),
-      theUsgsMapZone(0),
-      theSemiMajorAxis(0.0),
-      theSemiMinorAxis(0.0),
-      theGsd(0.0),
-      thePixelsPerLine(0),
-      theLinesPerImage(0),
-      theUlEasting(0.0),
-      theUlNorthing(0.0),
-      theUrEasting(0.0),
-      theUrNorthing(0.0),
-      theLrEasting(0.0),
-      theLrNorthing(0.0),
-      theLlEasting(0.0),
-      theLlNorthing(0.0),
-      theBlockingFactor(0),
-      theRecordSize(0),
-      theSunElevation(0),
-      theSunAzimuth(0),
-      theCenterEasting(0.0),
-      theCenterNorthing(0.0),
-      theCenterSample(0),
-      theCenterLine(0),
-      theOffset(0),
-      theErrorStatus(OSSIM_OK)
-{
-   const char tmpBuff[] = "";
-
-   strcpy(theProductOrderNumber, tmpBuff);
-   strcpy(thePathRowNumber, tmpBuff);
-   strcpy(theAcquisitionDate, tmpBuff);
-   strcpy(theSatNumber, tmpBuff);
-   strcpy(theInstrumentType, tmpBuff);
-   strcpy(theProductType, "MAP ORIENTED");
-   strcpy(theProductSize, tmpBuff);
-   strcpy(theMapSheetName, tmpBuff);
-   strcpy(theProcessingType, "TERRAIN");
-   strcpy(theResampAlgorithm, "NN");
-
-   int i;
-   for (i=0; i<NUMBER_OF_BANDS; i++)
-   {
-      strcpy(theBandRadiance[i], tmpBuff);
-   }
-
-   strcpy(theVolumeNumber, tmpBuff);
-   strcpy(theMapProjName, tmpBuff);
-
-   for (i=0; i<NUMBER_OF_PROJECTION_PARAMETERS; i++)
-   {
-      strcpy(theUsgsProjParam[i], tmpBuff);
-   }
-
-   strcpy(theEllipsoid, tmpBuff);
-   strcpy(theUlLon, tmpBuff);
-   strcpy(theUlLat, tmpBuff);
-   strcpy(theUrLon, tmpBuff);
-   strcpy(theUrLat, tmpBuff);
-   strcpy(theLrLon, tmpBuff);
-   strcpy(theLrLat, tmpBuff);
-   strcpy(theLlLon, tmpBuff);
-   strcpy(theLlLat, tmpBuff);
-   strcpy(theBandsPresentString, "P");
-   strcpy(theCenterLon, tmpBuff);
-   strcpy(theCenterLat, tmpBuff);
-   strcpy(theFormatVersion, "B");
-   
-}
-
-//***************************************************************************
-// CONSTRUCTOR:
-// ossimFfRevb::ossimFfRevb(const char* headerFile)
-//
-// Takes a filename representing an IRS-1C Fast Format rev C header.
-//***************************************************************************
-ossimFfRevb::ossimFfRevb(const char* headerFile)
-   :
-   theErrorStatus(OSSIM_OK)
-{
-   ifstream is;
-
-   is.open(headerFile);
-
-   if (!is)
-   {
-      theErrorStatus = OSSIM_ERROR;
-
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevb::ossimFfRevb(header):"
-                                          << "Cannot open header = " << headerFile << "\n"
-                                          << "Returning from constructor." << std::endl;
-
-      return;
-   }
-
-   loadFromStream(is);
-
-   is.close();
-
-}
-
-
-//***************************************************************************
-// PUBLIC METHOD:
-// int ossimFfRevb::path(int sceneNbr) const
-//
-// Convenience method to parse the path from the path/row string.  Returns
-// zero if stream is not opened.  Current loacation field is:
-// path/row/fraction/subscene in ppp/rrrff format.
-//***************************************************************************
-int ossimFfRevb::path() const
-{
-   char tmpBuff[4];
-   int path = 0;
-
-   istringstream is(thePathRowNumber);
-
-   if (is)
-   {
-      is.get(tmpBuff, 4);
-      tmpBuff[3] = '\0';
-      path = atoi(tmpBuff);
-   }
-
-   return path;
-}
-
-
-//***************************************************************************
-// PUBLIC METHOD:
-// int ossimFfRevb::row(int sceneNbr) const
-//
-// Convenience method to parse the row from the path/row string.  Returns
-// zero if stream is not opened.  Current loacation field is:
-// path/row/fraction/subscene in ppp/rrrff format.
-//***************************************************************************
-int ossimFfRevb::row() const
-{
-   char tmpBuff[4];
-   int row = 0;
-
-   istringstream is(thePathRowNumber);
-
-   if (is)
-   {
-      is.seekg(4, ios::beg);
-      is.get(tmpBuff, 4);
-      tmpBuff[3] = '\0';
-      row = atoi(tmpBuff);
-   }
-
-   return row;
-}
-
-
-//***************************************************************************
-// PUBLIC METHOD:
-// int ossimFfRevb::fraction(int sceneNbr) const
-//
-// Convenience method to parse the fraction from the path/row string.  Returns
-// zero if stream is not opened.  Current loacation field is:
-// path/row/fraction/subscene in ppp/rrrff format.
-//***************************************************************************
-int ossimFfRevb::fraction() const
-{
-   char tmpBuff[3];
-   int fraction = 0;
-
-   istringstream is(thePathRowNumber);
-
-   if (is)
-   {
-      is.seekg(7, ios::beg);
-      is.get(tmpBuff, 3);
-      tmpBuff[2] = '\0';
-      fraction = atoi(tmpBuff);
-   }
-
-   return fraction;
-}
-
-//***************************************************************************
-// PUBLIC METHOD:
-// double ossimFfRevb::projParam(int paramNumber) const
-//
-// Returns the projection parameter as a double from the string taken from
-// the header.  There are fifteen parameters so the possible range for
-// paramNumber is 0 to 14.
-//***************************************************************************
-double ossimFfRevb::projParam(int paramNumber) const
-{
-   if (paramNumber >= NUMBER_OF_PROJECTION_PARAMETERS)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevb::projParam: "
-                                          << "Parameter out of range:  " << paramNumber
-                                          << "\nValid range:  0 - 14" << std::endl;
-      return 0.0;
-   }
-
-   //***
-   // The USGS Projection Parameters in a rev b header have a "D" to
-   // denote the exponent.  This simply substitutes the "D" with an
-   // "E" so that atof works properly.
-   //***
-   ossimString tmp = theUsgsProjParam[paramNumber];
-   tmp.gsub("D", "E");
-
-   return atof(tmp.chars());
-}
-
-//***************************************************************************
-// PUBLIC METHOD:
-// void ossimFfRevb::print(ostream& os) const
-//
-// Prints data members.
-//***************************************************************************
-void ossimFfRevb::print(ostream& os) const
-{
-   os << setiosflags(ios::left | ios::fixed)
-      << setw(30) << "\nimage_id:" 
-      << theProductOrderNumber
-      << setw(30) << "\npath_row_number:"
-      << thePathRowNumber
-      << setw(30) << "\nacquisition_date:"
-      << theAcquisitionDate
-      << setw(30) << "\nsatellite_name:"
-      << theSatNumber
-      << setw(30) << "\nsensor_name:"
-      << theInstrumentType
-      << setw(30) << "\nproduct_type:" 
-      << theProductType
-      << setw(30) << "\nproduct_size:" 
-      << theProductSize
-      << setw(30) << "\nprocessing_type:" 
-      << theProcessingType 
-      << setw(30) << "\nresamp_algorithm:" 
-      << theResampAlgorithm;
-
-   int i;
-   for (i=0; i<NUMBER_OF_BANDS; i++)
-   {
-      os << "\nband" << i+1 << setw(25) << "_radiance:"
-         << theBandRadiance[i];
-   }
-
-   os << setw(30) << "\ntape_volume_number:" 
-      << theVolumeNumber
-      << setw(30) << "\nfirst_line_in_volume:" 
-      << the1stLineInVolume
-      << setw(30) << "\nlines_per_volume:" 
-      << theLinesPerVolume
-      << setw(30) << "\norientation_angle:" 
-      << setprecision(2) << theOrientationAngle
-      << setw(30) << "\nprojection_type:" 
-      << theMapProjName
-      << setw(30) << "\nusgs_projection_number:" 
-      << theUsgsProjNumber
-      << setw(30) << "\nmap_zone:" 
-      << theUsgsMapZone;
-
-//    os << setprecision(15);
-   os << setiosflags(ios::right);
-   for (i=0; i<NUMBER_OF_PROJECTION_PARAMETERS; i++)
-   {
-      os << "\nprojection_parameter_" << i+1 << setw(10) << ":"
-         << setw(24) << theUsgsProjParam[i];
-   }
-   os << resetiosflags(ios::right);
-   
-
-   os << setw(30) << "\nellipsoid:" 
-      << theEllipsoid
-      << setw(30) << "\nsemi_major_axis:"
-      << setprecision(3) << setw(11) << theSemiMajorAxis
-      << setw(30) << "\nsemi_minor_axis:"
-      << setw(11) << theSemiMinorAxis
-      << setw(30) << "\ngsd:" 
-      << setprecision(2) << setw(5) << theGsd      
-      << setw(30) << "\nnumber_samples:"
-      << thePixelsPerLine
-      << setw(30) << "\nnumber_lines:" 
-      << theLinesPerImage
-      << setprecision(3)
-      << setw(30) << "\nul_longitude:" 
-      << theUlLon
-      << setw(30) << "\nul_latitude:" 
-      << theUlLat
-      << setw(30) << "\nul_easting:" 
-      << setw(13) << theUlEasting
-      << setw(30) << "\nul_northing:" 
-      << setw(13) << theUlNorthing   
-      << setw(30) << "\nur_longitude:" 
-      << theUrLon
-      << setw(30) << "\nur_latitude:" 
-      << theUrLat
-      << setw(30) << "\nur_easting:" 
-      << setw(13) << theUrEasting
-      << setw(30) << "\nur_northing:" 
-      << setw(13) << theUrNorthing
-      << setw(30) << "\nlr_longitude:" 
-      << theLrLon
-      << setw(30) << "\nlr_latitude:" 
-      << theLrLat
-      << setw(30) << "\nlr_easting:" 
-      << setw(13) << theLrEasting
-      << setw(30) << "\nlr_northing:" 
-      << setw(13) << theLrNorthing
-      << setw(30) << "\nll_longitude:" 
-      << theLlLon
-      << setw(30) << "\nll_latitude:" 
-      << theLlLat
-      << setw(30) << "\nll_easting:" 
-      << setw(13) << theLlEasting
-      << setw(30) << "\nll_northing:" 
-      << setw(13) << theLlNorthing      
-      << setw(30) << "\nbands_present_string:" 
-      << theBandsPresentString
-      << setw(30) << "\ntape_blocking_factor:" 
-      << theBlockingFactor
-      << setw(30) << "\nrecord_size:" 
-      << theRecordSize
-      << setw(30) << "\nillum_elevation:" 
-      << theSunElevation
-      << setw(30) << "\nillum_azimuth:"
-      << theSunAzimuth
-      << setw(30) << "\ncenter_longitude:" 
-      << theCenterLon
-      << setw(30) << "\ncenter_latitude:" 
-      << theCenterLat
-      << setw(30) << "\ncenter_easting:" 
-      << setw(13) << theCenterEasting
-      << setw(30) << "\ncenter_northing:" 
-      << setw(13) << theCenterNorthing
-      << setw(30) << "\ncenter_sample:" 
-      << theCenterSample
-      << setw(30) << "\ncenter_line:" 
-      << theCenterLine
-      << setw(30) << "\nhorizontal_offset:" 
-      << theOffset
-      << setw(30) << "\nformat_version:" 
-      << theFormatVersion
-      << std::endl;
-
-}
-
-//***************************************************************************
-// PUBLIC METHOD:
-// void ossimFfRevb::write(ostream& os) const
-//
-// Writes an EOSAT Fast Format Rev B formatted header.
-//***************************************************************************
-void ossimFfRevb::write(ostream& os) const
-{
-   const char PRODUCT_ID_DESC [PRODUCT_ORDER_NUMBER_DESC_SIZE + 1]
-      = "PRODUCT =";
-
-   const char WRS_DESC [WRS_DESC_SIZE + 1]
-      = " WRS =";
-
-   const char DATE_DESC [DATE_DESC_SIZE + 1]
-      = " ACQUISITION DATE =";
-   
-   const char SATELLITE_NUMBER_DESC [SAT_NUMBER_DESC_SIZE + 1]
-      = " SATELLITE =";
-   
-   const char INSTRUMENT_TYPE_DESC [INSTRUMENT_TYPE_DESC_SIZE + 1]
-      = " INSTRUMENT =";
-   
-   const char PRODUCT_TYPE_DESC [PRODUCT_TYPE_DESC_SIZE + 1]
-      = " PRODUCT TYPE =";
-   
-   const char PRODUCT_SIZE_DESC [PRODUCT_SIZE_DESC_SIZE + 1]
-      = " PRODUCT SIZE =";
-   
-   const char PROCESSING_TYPE_DESC [PROCESSING_TYPE_DESC_SIZE + 1]
-      = " TYPE OF GEODETIC PROCESSING =";
-   
-   const char RESAMPLING_ALGO_DESC [RESAMPLING_ALGO_DESC_SIZE + 1]
-      = " RESAMPLING =";
-   
-   const char RADIANCE_DESC [RADIANCE_DESC_SIZE + 1]
-      = " RAD GAINS/BIASES = ";
-
-   const char VOLUME_NUMBER_DESC [VOLUME_NUMBER_DESC_SIZE + 1]
-      = " TAPE SPANNING FLAG=";
-   
-   const char  FIRST_LINE_DESC [FIRST_LINE_DESC_SIZE + 1]
-      = " START LINE #=";
-
-   const char LINES_PER_VOLUME_DESC [LINES_PER_VOLUME_DESC_SIZE + 1]
-      = " LINES PER VOL=";
-
-   const char ORIENTATION_ANGLE_DESC [ORIENTATION_ANGLE_DESC_SIZE + 1]
-      = " ORIENTATION =";
-
-   const char MAP_PROJ_NAME_DESC [MAP_PROJ_NAME_DESC_SIZE + 1]
-      = " PROJECTION =";
- 
-   const char USGS_PROJ_NUMBER_DESC [USGS_PROJ_NUMBER_DESC_SIZE + 1]
-      = " USGS PROJECTION # =";
- 
-   const char USGS_MAP_ZONE_DESC [USGS_MAP_ZONE_DESC_SIZE + 1]
-      = " USGS MAP ZONE =";
- 
-   const char PROJECTION_PARAMETER_DESC [USGS_PROJ_PARAMS_DESC_SIZE + 1]
-      = " USGS PROJECTION PARAMETERS =";
-
-   const char ELLIPSOID_DESC [ELLIPSOID_DESC_SIZE + 1]
-      = " EARTH ELLIPSOID =";
-      
-   const char MAJOR_AXIS_DESC [MAJOR_AXIS_DESC_SIZE+ 1]
-      = " SEMI-MAJOR AXIS =";
-      
-   const char MINOR_AXIS_DESC [MINOR_AXIS_DESC_SIZE+ 1]
-      = " SEMI-MINOR AXIS =";
-      
-   const char PIXEL_GSD_DESC [PIXEL_GSD_DESC_SIZE + 1]
-      = " PIXEL SIZE =";
-   
-   const char PIXELS_PER_LINE_DESC [PIXELS_PER_LINE_DESC_SIZE + 1]
-      = " PIXELS PER LINE=";
-   
-   const char LINES_PER_IMAGE_DESC [LINES_PER_IMAGE_DESC_SIZE + 1]
-      = " LINES PER IMAGE=";
-
-   const char UL_DESC [CORNER_DESC_SIZE + 1]
-      = " UL ";
-
-   const char UR_DESC [CORNER_DESC_SIZE + 1]
-      = " UR ";
-   
-   const char LR_DESC [CORNER_DESC_SIZE + 1]
-      = " LR ";
-   
-   const char LL_DESC [CORNER_DESC_SIZE + 1]
-      = " LL ";
-   
-   const char BANDS_PRESENT_DESC [BANDS_PRESENT_DESC_SIZE + 1]
-      = " BANDS PRESENT =";
-   
-   const char BLOCKING_FACTOR_DESC [BLOCKING_FACTOR_DESC_SIZE + 1]
-      = " BLOCKING FACTOR =";
-   
-   const char RECORD_LENGTH_DESC [RECORD_LENGTH_DESC_SIZE + 1]
-      = " RECORD LENGTH =";
-   
-   const char SUN_ELEVATION_DESC [SUN_ELEVATION_DESC_SIZE + 1]
-      = " SUN ELEVATION =";
-   
-   const char SUN_AZIMUTH_DESC [SUN_AZIMUTH_DESC_SIZE + 1]
-      = " SUN AZIMUTH =";
-
-   const char CENTER_DESC [CENTER_DESC_SIZE + 1]
-      = " CENTER ";
-   
-   const char OFFSET_DESC [OFFSET_DESC_SIZE + 1]
-      = " OFFSET=";
-   
-   const char REV_DESC [REV_DESC_SIZE + 1]
-      = " REV";
-      
-   const char SPACE[] = " ";
-
-   //***
-   // Start at beginning of the stream.
-   //***
-   os.seekp(0, ios::beg);
-   os << setiosflags(ios::fixed)  // Disable scientific mode.
-      << setiosflags(ios::left)
-       
-      << PRODUCT_ID_DESC
-      << setw(PRODUCT_ORDER_NUMBER_SIZE)
-      << theProductOrderNumber
-
-      << WRS_DESC         
-      << setw(PATH_ROW_NUMBER_SIZE) 
-      << thePathRowNumber
-
-      << DATE_DESC
-      << setw(DATE_SIZE) 
-      << theAcquisitionDate
-
-      << SATELLITE_NUMBER_DESC
-      << setw(SAT_NUMBER_SIZE) 
-      << theSatNumber 
-
-      << INSTRUMENT_TYPE_DESC
-      << setw(INSTRUMENT_TYPE_SIZE) 
-      << theInstrumentType
-
-      << PRODUCT_TYPE_DESC
-      << setw(PRODUCT_TYPE_SIZE) 
-      << theProductType
-
-      << PRODUCT_SIZE_DESC
-      << setw(PRODUCT_SIZE_SIZE) 
-      << theProductSize
-
-      << setw(MAP_SHEET_SIZE)
-      << theMapSheetName
-
-      << PROCESSING_TYPE_DESC
-      << setw(PROCESSING_TYPE_SIZE) 
-      << theProcessingType
-
-      << RESAMPLING_ALGO_DESC
-      << setw(RESAMPLING_ALGO_SIZE) 
-      << theResampAlgorithm
-
-      << RADIANCE_DESC;
-
-   int i;
-   for (i=0; i<NUMBER_OF_BANDS-1; i++) // Ouput six of the seven bands.
-   {
-      os << setw(RADIANCE_SIZE) << theBandRadiance[i] << SPACE;
-   }
-
-   os << setw(RADIANCE_SIZE) << theBandRadiance[6] // Last one no space.
-
-      << VOLUME_NUMBER_DESC
-      << setw(VOLUME_NUMBER_SIZE) 
-      << theVolumeNumber
-
-      << resetiosflags(ios::left)
-      << setiosflags(ios::right)
-
-      << FIRST_LINE_DESC
-      << setw(FIRST_LINE_IN_VOLUME_SIZE) 
-      << the1stLineInVolume
-
-      << LINES_PER_VOLUME_DESC 
-      << setw(LINES_PER_VOLUME_SIZE) 
-      << theLinesPerVolume 
-
-      << ORIENTATION_ANGLE_DESC 
-      << setprecision(2) << setw(ORIENTATION_ANGLE_SIZE) 
-      << theOrientationAngle  
-
-      << MAP_PROJ_NAME_DESC
-      << setw(MAP_PROJ_NAME_SIZE) 
-      << theMapProjName
-
-      << USGS_PROJ_NUMBER_DESC 
-      << setw(USGS_PROJ_NUMBER_SIZE) 
-      << theUsgsProjNumber 
-
-      << USGS_MAP_ZONE_DESC 
-      << setw(USGS_MAP_ZONE_SIZE) 
-      << theUsgsMapZone 
-
-      << PROJECTION_PARAMETER_DESC;
-
-   for (i=0; i<NUMBER_OF_PROJECTION_PARAMETERS; i++)
-   {
-      os << setw(USGS_PROJ_PARAMS_SIZE)
-         << theUsgsProjParam[i];
-   }
-
-   
-   os << setiosflags(ios::left)
-
-      << ELLIPSOID_DESC
-      << setw(ELLIPSOID_SIZE)
-      << theEllipsoid
-      << resetiosflags(ios::left)
-      << setprecision(3)
-
-      << setiosflags(ios::right)
-
-      << MAJOR_AXIS_DESC
-      << setw(MAJOR_AXIS_SIZE) 
-      << theSemiMajorAxis 
-
-      << MINOR_AXIS_DESC
-      << setw(MINOR_AXIS_SIZE) 
-      << theSemiMinorAxis
-
-      << setprecision(2)
-
-      << PIXEL_GSD_DESC
-      << setw(PIXEL_GSD_SIZE) 
-      << theGsd
-      
-      << PIXELS_PER_LINE_DESC
-      << setw(PIXELS_PER_LINE_SIZE) 
-      << thePixelsPerLine
- 
-      << LINES_PER_IMAGE_DESC
-      << setw(LINES_PER_IMAGE_SIZE) 
-      << theLinesPerImage
-
-      << setprecision(3)
-
-      << UL_DESC
-      << setw(LON_SIZE)
-      << theUlLon
-      << SPACE
-      << setw(LAT_SIZE)
-      << theUlLat
-      << SPACE
-      << setw(EASTING_SIZE)
-      << theUlEasting
-      << SPACE
-      << setw(NORTHING_SIZE) 
-      << theUlNorthing
-
-      << UR_DESC
-      << setw(LON_SIZE)
-      << theUrLon
-      << SPACE
-      << setw(LAT_SIZE)
-      << theUrLat
-      << SPACE
-      << setw(EASTING_SIZE)
-      << theUrEasting
-      << SPACE
-      << setw(NORTHING_SIZE) 
-      << theUrNorthing
-
-      << LR_DESC
-      << setw(LON_SIZE)
-      << theLrLon
-      << SPACE
-      << setw(LAT_SIZE)
-      << theLrLat
-      << SPACE
-      << setw(EASTING_SIZE)
-      << theLrEasting
-      << SPACE
-      << setw(NORTHING_SIZE) 
-      << theLrNorthing
-
-      << LL_DESC
-      << setw(LON_SIZE)
-      << theLlLon
-      << SPACE
-      << setw(LAT_SIZE)
-      << theLlLat
-      << SPACE
-      << setw(EASTING_SIZE)
-      << theLlEasting
-      << SPACE
-      << setw(NORTHING_SIZE) 
-      << theLlNorthing
-
-      << resetiosflags(ios::right);
-
-   os << BANDS_PRESENT_DESC
-      << setw(BANDS_PRESENT_SIZE) 
-      << theBandsPresentString
-
-      << BLOCKING_FACTOR_DESC
-      << setw(BLOCKING_FACTOR_SIZE) 
-      << theBlockingFactor
-
-      << RECORD_LENGTH_DESC
-      << setw(RECORD_LENGTH_SIZE) 
-      << theRecordSize
-         
-      << SUN_ELEVATION_DESC
-      << setw(SUN_ELEVATION_SIZE) 
-      << theSunElevation
-         
-      << SUN_AZIMUTH_DESC
-      << setw(SUN_AZIMUTH_SIZE) 
-      << theSunAzimuth
-         
-      << CENTER_DESC 
-      << setw(LON_SIZE) 
-      << theCenterLon 
-      << SPACE
-      << setw(LAT_SIZE)
-      << theCenterLat
-      << SPACE
-      << setiosflags(ios::right)
-      << setw(EASTING_SIZE)
-      << theCenterEasting
-      << SPACE
-      << setw(NORTHING_SIZE)
-      << theCenterNorthing
-      << setw(CENTER_SAMPLE_SIZE)
-      << theCenterSample
-      << setw(CENTER_LINE_SIZE)
-      << theCenterLine
-
-      << OFFSET_DESC
-      << setw(OFFSET_SIZE)
-      << theOffset
-
-      << REV_DESC
-      << setw(FORMAT_VERSION_SIZE)
-      << theFormatVersion << flush;  // Byte count of file should be 1536.
-
-}
-
-
-//***************************************************************************
-// PRIVATE METHOD:
-// ossimFfRevb::loadFromStream(istream& is)
-// Initializes data members from an EOSAT Fast Format Rev B header.
-//***************************************************************************
-void ossimFfRevb::loadFromStream(istream& is)
-{
-   if (!is)
-   {
-      theErrorStatus = OSSIM_ERROR;
-
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevb::loadFromStream:\n"
-                                          << "Null stream passed in.  Returning from method."
-                                          << std::endl;
-      return;
-   }
-
-   //***
-   // See .h for enumerations for field sizes and offsets. 
-   //***
-
-   //***
-   // NOTE:  Because of header inconsistencies all seeks will be relative to
-   //        the beginning of the stream.
-   //***
-
-   //***
-   // Temporary buffer for fields that need to be converted to integers or
-   // floats.
-   //***
-   char tmpBuff[25];
-
-   int i; // For iterations.
-
-   is.seekg(PRODUCT_ORDER_NUMBER_OFFSET, ios::beg);
-   is.get(theProductOrderNumber, 
-          PRODUCT_ORDER_NUMBER_SIZE + 1,
-          ' ');
-   if (checkStream(is)) return;
- 
-   is.seekg(PATH_ROW_NUMBER_OFFSET, ios::beg);
-   is.get(thePathRowNumber, PATH_ROW_NUMBER_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(DATE_OFFSET, ios::beg);
-   is.get(theAcquisitionDate, DATE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(SAT_NUMBER_OFFSET, ios::beg);
-   is.get(theSatNumber, SAT_NUMBER_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(INSTRUMENT_TYPE_OFFSET, ios::beg);
-   is.get(theInstrumentType, INSTRUMENT_TYPE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(PRODUCT_TYPE_OFFSET, ios::beg);
-   is.get(theProductType, PRODUCT_TYPE_SIZE+ 1);
-   if (checkStream(is)) return;
-
-   is.seekg(PRODUCT_SIZE_OFFSET, ios::beg);
-   is.get(theProductSize, PRODUCT_SIZE_SIZE+ 1);
-   if (checkStream(is)) return;
-
-   is.seekg(MAP_SHEET_NAME_OFFSET, ios::beg);
-   is.get(theMapSheetName, MAP_SHEET_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(PROCESSING_TYPE_OFFSET, ios::beg);
-   is.get(theProcessingType, PROCESSING_TYPE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(RESAMPLING_ALGO_OFFSET, ios::beg);
-   is.get(theResampAlgorithm, RESAMPLING_ALGO_SIZE + 1);
-   if (checkStream(is)) return;
-
-   for (i=0; i<NUMBER_OF_BANDS; i++)
-   {      
-      is.seekg(RADIANCE_OFFSET[i], ios::beg);
-      is.get(theBandRadiance[i], RADIANCE_SIZE + 1);
-      if (checkStream(is)) return;
-   }
-
-   is.seekg(VOLUME_NUMBER_OFFSET, ios::beg);
-   is.get(theVolumeNumber, VOLUME_NUMBER_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(FIRST_LINE_IN_VOLUME_OFFSET, ios::beg);
-   is.get(tmpBuff, FIRST_LINE_IN_VOLUME_SIZE + 1);
-   if (checkStream(is)) return;
-
-   the1stLineInVolume = atoi(tmpBuff);
-
-   is.seekg(LINES_PER_VOLUME_OFFSET, ios::beg);
-   is.get(tmpBuff, LINES_PER_VOLUME_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theLinesPerVolume = atoi(tmpBuff);
-   
-   is.seekg(ORIENTATION_ANGLE_OFFSET, ios::beg);
-   is.get(tmpBuff, ORIENTATION_ANGLE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theOrientationAngle = atof(tmpBuff);
-
-   is.seekg(MAP_PROJ_NAME_OFFSET, ios::beg);
-   is.get(theMapProjName, MAP_PROJ_NAME_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(USGS_PROJ_NUMBER_OFFSET, ios::beg);
-   is.get(tmpBuff, USGS_PROJ_NUMBER_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theUsgsProjNumber = atoi(tmpBuff);
-
-   is.seekg(USGS_MAP_ZONE_OFFSET, ios::beg);
-   is.get(tmpBuff, USGS_MAP_ZONE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theUsgsMapZone = atoi(tmpBuff);
-
-   //***
-   // Get the fifteen projection parameters.
-   //***
-   for (i=0; i < NUMBER_OF_PROJECTION_PARAMETERS; i++)
-   {
-      is.seekg(PROJ_PARAM_OFFSET[i], ios::beg);
-      is.get(theUsgsProjParam[i], USGS_PROJ_PARAMS_SIZE + 1);
-      if (checkStream(is)) return;
-   }
-   
-   is.seekg(ELLIPSOID_OFFSET, ios::beg);
-   is.get(theEllipsoid, ELLIPSOID_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(MAJOR_AXIS_OFFSET, ios::beg);
-   is.get(tmpBuff,  MAJOR_AXIS_SIZE+ 1);
-   if (checkStream(is)) return;
-
-   theSemiMajorAxis = atof(tmpBuff);
-   
-   is.seekg(MINOR_AXIS_OFFSET, ios::beg);
-   is.get(tmpBuff,  MINOR_AXIS_SIZE+ 1);
-   if (checkStream(is)) return;
-
-   theSemiMinorAxis = atof(tmpBuff);
-
-   is.seekg(PIXEL_GSD_OFFSET, ios::beg);
-   is.get(tmpBuff, PIXEL_GSD_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theGsd = atof(tmpBuff);
-   
-   is.seekg(PIXELS_PER_LINE_OFFSET, ios::beg);
-   is.get(tmpBuff, PIXELS_PER_LINE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   thePixelsPerLine = atoi(tmpBuff);
-
-   is.seekg(LINES_PER_IMAGE_OFFSET, ios::beg);
-   is.get(tmpBuff, LINES_PER_IMAGE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theLinesPerImage = atoi(tmpBuff);
-
-   //***
-   // Start of upper left data:  longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(UL_LON_OFFSET, ios::beg);
-   is.get(theUlLon, LON_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(UL_LAT_OFFSET, ios::beg);
-   is.get(theUlLat, LAT_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(UL_EASTING_OFFSET, ios::beg);
-   is.get(tmpBuff, EASTING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theUlEasting = atof(tmpBuff);
-
-   is.seekg(UL_NORTHING_OFFSET, ios::beg);
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theUlNorthing = atof(tmpBuff);
-
-   //***
-   // End of upper left data.
-   //***
-
-   //***
-   // Start of upper right data: longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(UR_LON_OFFSET, ios::beg);
-   is.get(theUrLon, LON_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(UR_LAT_OFFSET, ios::beg);
-   is.get(theUrLat, LAT_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(UR_EASTING_OFFSET, ios::beg);
-   is.get(tmpBuff, EASTING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theUrEasting = atof(tmpBuff);
-
-   is.seekg(UR_NORTHING_OFFSET, ios::beg);
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theUrNorthing = atof(tmpBuff);
-   
-   //***
-   // End of upper right data.
-   //***
-
-   //***
-   // Start of lower right data: longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(LR_LON_OFFSET, ios::beg);
-   is.get(theLrLon, LON_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(LR_LAT_OFFSET, ios::beg);
-   is.get(theLrLat, LAT_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(LR_EASTING_OFFSET, ios::beg);
-   is.get(tmpBuff, EASTING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theLrEasting = atof(tmpBuff);
-
-   is.seekg(LR_NORTHING_OFFSET, ios::beg);
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theLrNorthing = atof(tmpBuff);
-
-   //***
-   // End of lower right data.
-   //***
-
-   //***
-   // Start of lower left data:  longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(LL_LON_OFFSET, ios::beg);
-   is.get(theLlLon, LON_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(LL_LAT_OFFSET, ios::beg);
-   is.get(theLlLat, LAT_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(LL_EASTING_OFFSET, ios::beg);
-   is.get(tmpBuff, EASTING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theLlEasting = atof(tmpBuff);
-
-   is.seekg(LL_NORTHING_OFFSET, ios::beg);
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theLlNorthing = atof(tmpBuff);
-
-   //***
-   // End of lower left data.
-   //***
-
-   is.seekg(BANDS_PRESENT_OFFSET, ios::beg);
-   is.get(theBandsPresentString, BANDS_PRESENT_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(BLOCKING_FACTOR_OFFSET, ios::beg);
-   is.get(tmpBuff, BLOCKING_FACTOR_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theBlockingFactor = atoi(tmpBuff);
-
-   is.seekg(RECORD_LENGTH_OFFSET, ios::beg);
-   is.get(tmpBuff, RECORD_LENGTH_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theRecordSize = atoi(tmpBuff);
-
-   is.seekg(SUN_ELEVATION_OFFSET, ios::beg);
-   is.get(tmpBuff, SUN_ELEVATION_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theSunElevation = atoi(tmpBuff);
-
-   is.seekg(SUN_AZIMUTH_OFFSET, ios::beg);
-   is.get(tmpBuff, SUN_AZIMUTH_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theSunAzimuth = atoi(tmpBuff);
-
-   //***
-   // Start of scene center data:  longitude, latitude, easting, northing,
-   // sample, line. 
-   //***
-   is.seekg(CENTER_LON_OFFSET, ios::beg);
-   is.get(theCenterLon, LON_SIZE + 1);
-   if (checkStream(is)) return;
-
-   is.seekg(CENTER_LAT_OFFSET, ios::beg);
-   is.get(theCenterLat, LAT_SIZE + 1);
-   if (checkStream(is)) return;
-   
-   is.seekg(CENTER_EASTING_OFFSET, ios::beg);
-   is.get(tmpBuff, EASTING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theCenterEasting = atof(tmpBuff);
-
-   is.seekg(CENTER_NORTHING_OFFSET, ios::beg);
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theCenterNorthing = atof(tmpBuff);
-
-   is.seekg(CENTER_SAMPLE_OFFSET, ios::beg);
-   is.get(tmpBuff, CENTER_SAMPLE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theCenterSample = atoi(tmpBuff);
-
-   is.seekg(CENTER_LINE_OFFSET, ios::beg);
-   is.get(tmpBuff, CENTER_LINE_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theCenterLine = atoi(tmpBuff);
-
-   //***
-   // End of scene center data.
-   //***
-
-   is.seekg(OFFSET_OFFSET, ios::beg);
-   is.get(tmpBuff, OFFSET_SIZE + 1);
-   if (checkStream(is)) return;
-
-   theOffset = atoi(tmpBuff);
-
-   is.seekg(FORMAT_VERSION_OFFSET, ios::beg);
-   is.get(theFormatVersion, FORMAT_VERSION_SIZE + 1);
-   if (checkStream(is)) return;
-
-}
-
-//***************************************************************************
-// PRIVATE METHOD:
-// ossimFfRevb::checkStream(istream& is)
-//
-// Checks the stream.  If an error has occurred it sets theErrorStatus.
-// Returns: theErrorStatus    ( 0 = OK,  1 = ERROR )
-//***************************************************************************
-int ossimFfRevb::checkStream(istream& is)
-{
-   //***
-   // istreams set fault bits and the operator! is overloaded to return
-   // true if an error has occurred.
-   //***
-   if (!is)
-   {
-      theErrorStatus = OSSIM_ERROR;
-      ossimNotify(ossimNotifyLevel_FATAL) << "ossimFfRevb::checkStream ERROR: "
-                                          << "Stream corrupted.   Returning from method."
-                                          << std::endl;
-   } 
-   return theErrorStatus;
-}
-   
-//***************************************************************************
-// Function:
-// ostream& operator<<(ostream& os, const ossimFfRevb& head)
-//***************************************************************************
-ostream& operator<<(ostream& os, const ossimFfRevb& head)
-{
-   head.print(os);
-
-   return os;
-}
diff --git a/ossim/src/ossim/support_data/ossimFfRevc.cpp b/ossim/src/ossim/support_data/ossimFfRevc.cpp
deleted file mode 100644
index b896a18..0000000
--- a/ossim/src/ossim/support_data/ossimFfRevc.cpp
+++ /dev/null
@@ -1,1661 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Ken Melero (kmelero at imagelinks.com)
-//         Orginally written by Dave Burken (dburken at imagelinks.com)
-// Description: This class parses an EOSAT Fast Format rev c header.
-//
-//********************************************************************
-// $Id: ossimFfRevc.cpp 13217 2008-07-23 19:19:13Z dburken $
-
-#include <fstream>
-#include <sstream>
-#include <iomanip>
-using namespace std;
-
-#include <cstdlib>
-#include <cstring>
-
-#include <ossim/support_data/ossimFfRevc.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-const int LOCATION_OFFSET [4] = { 23,
-                                  183,
-                                  343,
-                                  503 };
-
-const int PATH_ROW_NUMBER_OFFSET [4] = { 34,
-                                         194,
-                                         354,
-                                         514 };
-
-const int DATE_OFFSET [4] = { 70,
-                              230,
-                              390,
-                              550 };
-
-const int SAT_NAME_OFFSET [4] = { 91,
-                                  251,
-                                  411,
-                                  571 };
-
-const int SENSOR_NAME_OFFSET [4] = { 110,
-                                     270,
-                                     430,
-                                     590 };
-
-const int SENSOR_MODE_OFFSET [4] = { 134,
-                                     294,
-                                     454,
-                                     614 };
-
-const int OFF_NADIR_ANGLE_OFFSET [4] = { 153, 
-                                         313,
-                                         473,
-                                         633 };
-
-
-const int BIAS_OFFSET [8] = { 1616,
-                              1696,
-                              1776,
-                              1856,
-                              1936,
-                              2016,
-                              2096,
-                              2176  };
-
-const int GAIN_OFFSET [8] = { 1641,
-                              1721,
-                              1801,
-                              1881,
-                              1961,
-                              2041,
-                              2121,
-                              2201  };
-
-static const int PROJ_PARAM_OFFSET [15]  = { 3181,
-                                      3206,
-                                      3232,
-                                      3257,
-                                      3282,
-                                      3312,
-                                      3337,
-                                      3362,
-                                      3392,
-                                      3417,
-                                      3442,
-                                      3472,
-                                      3497,
-                                      3522,
-                                      3552  };
-
-static const char BLANK_STRING[] = " ";
-
-//***************************************************************************
-// CONSTRUCTOR
-//***************************************************************************
-ossimFfRevc::ossimFfRevc()
-   :
-      theAdminRecord(),
-      theRadiomRecord(),
-      theGeoRecord(),
-      theErrorStatus(OSSIM_OK)
-{ }
-
-//***************************************************************************
-// CONSTRUCTOR:
-// ossimFfRevc::ossimFfRevc(const char* headerFile)
-//
-// Takes a filename representing an IRS-1C Fast Format rev C header.
-//***************************************************************************
-ossimFfRevc::ossimFfRevc(const char* headerFile)
-   :
-   theErrorStatus(OSSIM_OK)
-{
-   ifstream is;
-
-   is.open(headerFile);
-
-   if (!is)
-   {
-      theErrorStatus = OSSIM_ERROR;
-
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevc::ossimFfRevc(header): "
-                                          << "Cannot open:  " << headerFile << "\n"
-                                          << "Returning from constructor." << std::endl;
-
-      return;
-   }
-
-   loadFromStream(is);
-
-   is.close();
-
-}
-
-
-//***************************************************************************
-// PUBLIC METHOD:
-// int ossimFfRevc::path(int sceneNbr) const
-//
-// Convenience method to parse the path from the path/row string.  Returns
-// zero if stream is not opened.  Current loacation field is:
-// path/row/fraction/subscene in ppp/rrrffss format.
-//***************************************************************************
-int ossimFfRevc::path(int sceneNbr) const
-{
-   char tmpBuff[4];
-   int path = 0;
-
-   istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
-
-   if (is)
-   {
-      is.get(tmpBuff, 4);
-      path = atoi(tmpBuff);
-   }
-
-   return path;
-}
-
-
-//***************************************************************************
-// PUBLIC METHOD:
-// int ossimFfRevc::row(int sceneNbr) const
-//
-// Convenience method to parse the row from the path/row string.  Returns
-// zero if stream is not opened.  Current loacation field is:
-// path/row/fraction/subscene in ppp/rrrffss format.
-//***************************************************************************
-int ossimFfRevc::row(int sceneNbr) const
-{
-   char tmpBuff[4];
-   int row = 0;
-
-   istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
-
-   if (is)
-   {
-      is.seekg(4, ios::beg);
-      is.get(tmpBuff, 4);
-      row = atoi(tmpBuff);
-   }
-
-   return row;
-}
-
-
-//***************************************************************************
-// PUBLIC METHOD:
-// int ossimFfRevc::fraction(int sceneNbr) const
-//
-// Convenience method to parse the fraction from the path/row string.  Returns
-// zero if stream is not opened.  Current loacation field is:
-// path/row/fraction/subscene in ppp/rrrffss format.
-//***************************************************************************
-int ossimFfRevc::fraction(int sceneNbr) const
-{
-   char tmpBuff[3];
-   int fraction = 0;
-
-   istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
-
-   if (is)
-   {
-      is.seekg(7, ios::beg);
-      is.get(tmpBuff, 3);
-      fraction = atoi(tmpBuff);
-   }
-
-   return fraction;
-}
-
-
-//***************************************************************************
-// PUBLIC METHOD:
-// int ossimFfRevc::subScene(int sceneNbr) const
-//
-// Convenience method to parse the subScene from the path/row string.  Returns
-// zero if stream is not opened.  Current loacation field is:
-// path/row/fraction/subscene in ppp/rrrffss format.
-//***************************************************************************
-ossimString ossimFfRevc::subScene(int sceneNbr) const
-{
-   char   tmpBuff[3];
-   ossimString subScene;
-
-   istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
-
-   if (is)
-   {
-      is.seekg(9, ios::beg);
-      is.get(tmpBuff, 3);
-      subScene = tmpBuff;
-   }
-
-   return subScene;
-}
-
-//***************************************************************************
-// ossimFfRevc::pathRow(int sceneNbr)
-//***************************************************************************
-ossimString ossimFfRevc::pathRow(int sceneNbr) const
-{
-   ossimString tmp = "p";
-
-   tmp += theAdminRecord.thePathRowNumber[sceneNbr];
-
-   tmp.gsub("/", "r");
-
-   tmp.gsub(" ", "");
-
-   return tmp;
-}
-
-//***************************************************************************
-// PUBLIC METHOD:
-// void ossimFfRevc::print(ostream& os) const
-//
-// Prints data members.
-//***************************************************************************
-void ossimFfRevc::print(ostream& os) const
-{
-   os << setiosflags(ios::left | ios::fixed)
-      << "Administrative Record:"
-      << setw(30) << "\ntheProductOrderNumber:" 
-      << theAdminRecord.theProductOrderNumber;
-
-   int i;
-   for (i = 0; i < NUMBER_OF_SCENES; i++)
-   {
-      os << "\nScene" << (i + 1) << setw(23) << " PathRowNumber:"
-         << theAdminRecord.thePathRowNumber[i]
-         << "\nScene" << (i + 1) << setw(23) << " AcquisitionDate:  "
-         << theAdminRecord.theAcquisitionDate[i]
-         << "\nScene" << (i + 1) << setw(23) << " SatelliteName:    "
-         << theAdminRecord.theSatName[i]
-         << "\nScene" << (i + 1) << setw(23) << " SensorName:       "
-         << theAdminRecord.theSensorName[i]
-         << "\nScene" << (i + 1) << setw(23) << " SensorMode:       "
-         << theAdminRecord.theSensorMode[i]
-         << "\nScene" << (i + 1) << setw(23) << " OffNadirAngle:    "
-         << setprecision(2) << theAdminRecord.theOffNadirAngle[i];
-   }
-
-   os << setw(30) << "\nProductType:" 
-      << theAdminRecord.theProductType
-      << setw(30) << "\nProductSize:" 
-      << theAdminRecord.theProductSize
-      << setw(30) << "\nProcessingType:" 
-      << theAdminRecord.theProcessingType 
-      << setw(30) << "\nResampAlgorithm:" 
-      << theAdminRecord.theResampAlgorithm
-      << setw(30) << "\nTapeVolumeNumber:" 
-      << theAdminRecord.theTapeVolumeNumber
-      << setw(30) << "\nNumberVolumesPerTape:" 
-      << theAdminRecord.theNumberVolumesPerTape
-      << setw(30) << "\nPixelsPerLine:" 
-      << theAdminRecord.thePixelsPerLine
-      << setw(30) << "\nLinesPerImage:" 
-      << theAdminRecord.theLinesPerImage
-      << setw(30) << "\n1stLineInVolume:" 
-      << theAdminRecord.the1stLineInVolume
-      << setw(30) << "\nTapeBlockingFactor:" 
-      << theAdminRecord.theTapeBlockingFactor
-      << setw(30) << "\nRecordSize:" 
-      << theAdminRecord.theRecordSize
-      << setw(30) << "\nGsd:" 
-      << setprecision(2) << theAdminRecord.theGsd
-      << setw(30) << "\nOutputBitsPerPixel:" 
-      << theAdminRecord.theOutputBitsPerPixel
-      << setw(30) << "\nAcquiredBitsPerPixel:" 
-      << theAdminRecord.theAcquiredBitsPerPixel
-      << setw(30) << "\nBandsPresentString:" 
-      << theAdminRecord.theBandsPresentString
-      << setw(30) << "\nFormatVersion:" 
-      << theAdminRecord.theFormatVersion
-      << endl 
-      << setw(30) << "Radiometric record:";
-
-   os << setprecision(15);
-
-   for (i = 0; i < NUMBER_OF_BANDS; i++)
-   {
-      os << "\nBand" << (i + 1) << setw(24) << " bias:" 
-         << theRadiomRecord.theBias[i]
-         << "\nBand" << (i + 1) << setw(24) << " gain:" 
-         << theRadiomRecord.theGain[i];
-   }
-
-   os << endl
-      << "Geometric Record:"
-      << setw(30) << "\nMapProjectionName:" 
-      << theGeoRecord.theMapProjectionName
-      << setw(30) << "\nEllipsoid:" 
-      << theGeoRecord.theEllipsoid
-      << setw(30) << "\nDatum:" 
-      << theGeoRecord.theDatum;
-
-   for (i = 0; i < 15; i++)
-   {
-      os << "\nProjectionParams[" << setw(2) << i << setw(10) << "]:  "
-         << theGeoRecord.theProjectionParams[i];
-   }
-
-   os << setprecision(3) 
-      << setw(30) << "\nUlLon:" 
-      << theGeoRecord.theUlLon
-      << setw(30) << "\nUlLat:" 
-      << theGeoRecord.theUlLat
-      << setw(30) << "\nUlEasting:" 
-      << theGeoRecord.theUlEasting
-      << setw(30) << "\nUlNorthing:" 
-      << theGeoRecord.theUlNorthing   
-      << setw(30) << "\nUrLon:" 
-      << theGeoRecord.theUrLon
-      << setw(30) << "\nUrLat:" 
-      << theGeoRecord.theUrLat
-      << setw(30) << "\nUrEasting:" 
-      << theGeoRecord.theUrEasting
-      << setw(30) << "\nUrNorthing:" 
-      << theGeoRecord.theUrNorthing
-      << setw(30) << "\nLrLon:" 
-      << theGeoRecord.theLrLon
-      << setw(30) << "\nLrLat:" 
-      << theGeoRecord.theLrLat
-      << setw(30) << "\nLrEasting:" 
-      << theGeoRecord.theLrEasting
-      << setw(30) << "\nLrNorthing:" 
-      << theGeoRecord.theLrNorthing
-      << setw(30) << "\nLlLon:" 
-      << theGeoRecord.theLlLon
-      << setw(30) << "\nLlLat:" 
-      << theGeoRecord.theLlLat
-      << setw(30) << "\nLlEasting:" 
-      << theGeoRecord.theLlEasting
-      << setw(30) << "\nLlNorthing:" 
-      << theGeoRecord.theLlNorthing
-      << setw(30) << "\nCenterLon:" 
-      << theGeoRecord.theCenterLon
-      << setw(30) << "\nCenterLat:" 
-      << theGeoRecord.theCenterLat
-      << setw(30) << "\nCenterEasting:" 
-      << theGeoRecord.theCenterEasting
-      << setw(30) << "\nCenterNorthing:" 
-      << theGeoRecord.theCenterNorthing
-      << setw(30) << "\nCenterSample:" 
-      << theGeoRecord.theCenterSample
-      << setw(30) << "\nCenterLine:" 
-      << theGeoRecord.theCenterLine
-      << setw(30) << "\nHorizontalOffset:" 
-      << theGeoRecord.theHorizontalOffset
-      << setprecision(2) << setw(30) << "\nOrientationAngle:" 
-      << theGeoRecord.theOrientationAngle
-      << setw(30) << "\nSunElevationAngle:" 
-      << setprecision(1) << theGeoRecord.theSunElevationAngle
-      << setw(30) << "\nSunAzimuth:" <<  theGeoRecord.theSunAzimuth
-      << resetiosflags(ios::left)
-      << endl << endl;
-
-}
-
-//***************************************************************************
-// PUBLIC METHOD:
-// void ossimFfRevc::write(ostream& os) const
-//
-// Writes data members in EOSAT Fast Format Rev C format.
-//***************************************************************************
-void ossimFfRevc::write(ostream& os) const
-{
-   const char PRODUCT_ID_DESC [PRODUCT_ORDER_NUMBER_DESC_SIZE + 1]
-      = "PRODUCT ID =";
-
-   const char LOCATION_DESC [LOCATION_DESC_SIZE + 1]
-      = " LOCATION =";
-
-   const char DATE_DESC [DATE_DESC_SIZE + 1]
-      = " ACQUISITION DATE =";
-   
-   const char SATELLITE_NAME_DESC [SAT_NAME_DESC_SIZE + 1]
-      = "SATELLITE =";
-   
-   const char SENSOR_NAME_DESC [SENSOR_NAME_DESC_SIZE + 1]
-      = " SENSOR =";
-   
-   const char SENSOR_MODE_DESC [SENSOR_MODE_DESC_SIZE + 1]
-      = " SENSOR MODE =";
-      
-   const char LOOK_ANGLE_DESC [LOOK_ANGLE_DESC_SIZE + 1]
-      = " LOOK ANGLE =";
-   
-   const char PRODUCT_TYPE_DESC [PRODUCT_TYPE_DESC_SIZE + 1]
-      = "PRODUCT TYPE =";
-   
-   const char PRODUCT_SIZE_DESC [PRODUCT_SIZE_DESC_SIZE + 1]
-      = " PRODUCT SIZE =";
-   
-   const char PROCESSING_TYPE_DESC [PROCESSING_TYPE_DESC_SIZE + 1]
-      = "TYPE OF PROCESSING =";
-   
-   const char RESAMPLING_ALGO_DESC [RESAMPLING_ALGO_DESC_SIZE + 1]
-      = " RESAMPLING =";
-   
-   const char TAPE_VOLUME_NUMBER_DESC [TAPE_VOLUME_NUMBER_DESC_SIZE + 1]
-      = "VOLUME #/# IN SET =";
-   
-   const char PIXELS_PER_LINE_DESC [PIXELS_PER_LINE_DESC_SIZE + 1]
-      = " PIXELS PER LINE =";
-   
-   const char LINES_PER_IMAGE_DESC [LINES_PER_IMAGE_DESC_SIZE + 1]
-      = " LINES PER BAND =";
-
-   const char  FIRST_LINE_DESC [FIRST_LINE_DESC_SIZE + 1]
-      = "START LINE # =";
-   
-   const char BLOCKING_FACTOR_DESC [BLOCKING_FACTOR_DESC_SIZE + 1]
-      = " BLOCKING FACTOR =";
-   
-   const char RECORD_LENGTH_DESC [RECORD_LENGTH_DESC_SIZE + 1]
-      = " RECORD LENGTH =";
-   
-   const char PIXEL_GSD_DESC [PIXEL_GSD_DESC_SIZE + 1]
-      = " PIXEL SIZE =";
-   
-   const char BITS_PER_PIXEL_DESC [BITS_PER_PIXEL_DESC_SIZE + 1]
-      = "OUTPUT BITS PER PIXEL =";
-   
-   const char AQUIRED_BITS_PER_PIXEL_DESC
-      [AQUIRED_BITS_PER_PIXEL_DESC_SIZE + 1] = " ACQUIRED BITS PER PIXEL =";
-   
-   const char BANDS_PRESENT_DESC [BANDS_PRESENT_DESC_SIZE + 1]
-      = "BANDS PRESENT =";
-   
-   const char REV_DESC [REV_DESC_SIZE + 1]
-      = "REV            ";
-   
-   const char BIAS_GAIN_DESC [BIAS_GAIN_DESC_SIZE + 1]
-      = "BIASES AND GAINS IN THE BAND ORDER AS ON THIS TAPE";
-   
-   const char GEO_DESC [GEO_DESC_SIZE + 1]
-      = "GEOMETRIC DATA";
-   
-   const char MAP_PROJECTION_NAME_DESC [MAP_PROJECTION_NAME_DESC_SIZE + 1]
-      = " MAP PROJECTION =";
-   
-   const char ELLIPSOID_DESC [ELLIPSOID_DESC_SIZE + 1]
-      = " ELLIPSOID =";
-      
-   const char DATUM_DESC [DATUM_DESC_SIZE + 1]
-      = " DATUM =";
-   
-   const char PROJECTION_PARAMETER_DESC [PROJECTION_PARAMETER_DESC_SIZE + 1]
-      = "USGS PROJECTION PARAMETERS =";
-   
-   const char UL_DESC [CORNER_DESC_SIZE + 1]
-      = "UL =";
-
-   const char UR_DESC [CORNER_DESC_SIZE + 1]
-      = "UR =";
-   
-   const char LR_DESC [CORNER_DESC_SIZE + 1]
-      = "LR =";
-   
-   const char LL_DESC [CORNER_DESC_SIZE + 1]
-      = "LL =";
-   
-   const char CENTER_DESC [CENTER_DESC_SIZE + 1]
-      = "CENTER =";
-   
-   const char HORIZONTAL_OFFSET_DESC [HORIZONTAL_OFFSET_DESC_SIZE + 1]
-      = "OFFSET =";
-   
-   const char ORIENTATION_ANGLE_DESC [ORIENTATION_ANGLE_DESC_SIZE + 1]
-      = " ORIENTATION ANGLE =";
-   
-   const char SUN_ELEVATION_DESC [SUN_ELEVATION_DESC_SIZE + 1]
-      = "SUN ELEVATION ANGLE =";
-   
-   const char SUN_AZIMUTH_DESC [SUN_AZIMUTH_DESC_SIZE + 1]
-      = " SUN AZIMUTH ANGLE =";
-
-   const char SPACE[] = " ";
-
-   //>
-   // NOTE:  "seekp's" will be perormed as needed for safety.
-   //<
-
-   //>
-   // Start at beginning of the stream.
-   //<
-   os.seekp(0, ios::beg);
-
-   //>
-   // Start of administrative record.
-   //<
-
-   os << setiosflags(ios::fixed)  // Disable scientific mode.
-
-      << PRODUCT_ID_DESC
-
-      << setw(PRODUCT_ORDER_NUMBER_SIZE)
-      << theAdminRecord.theProductOrderNumber;
-
-   //>
-   // The admin record can contain info for up to four scenes.
-   //<
-
-   int i;
-   for (i = 0; i < 4; i++)
-   {
-      os.seekp(LOCATION_OFFSET[i], ios::beg);
-
-      os << LOCATION_DESC         
-      
-         << setw(PATH_ROW_NUMBER_SIZE) 
-         << theAdminRecord.thePathRowNumber[i] 
-
-         << DATE_DESC
-
-         << setw(DATE_SIZE) 
-         << theAdminRecord.theAcquisitionDate[i] 
-
-         << setw(1) << SPACE << endl // End of line.
-
-         << SATELLITE_NAME_DESC // Start of line.
-
-         << setw(SAT_NAME_SIZE) 
-         << theAdminRecord.theSatName[i] 
-
-         << SENSOR_NAME_DESC
-      
-         << setw(SENSOR_NAME_SIZE) 
-         << theAdminRecord.theSensorName[i]
-
-         << SENSOR_MODE_DESC
-
-         << setw(SENSOR_MODE_SIZE) 
-         << theAdminRecord.theSensorMode[i]
-
-         << LOOK_ANGLE_DESC
-
-         << setw(OFF_NADIR_ANGLE_SIZE)
-         << setiosflags(ios::right)
-         << setprecision(2) 
-         << theAdminRecord.theOffNadirAngle[i] // End of scene.
-         << resetiosflags(ios::right)
-         << endl 
-         << setw(23) << SPACE; // End of line.
-   } // End of scene loop.
-
-   os.seekp(640, ios::beg); // Start of line.
-
-   os << PRODUCT_TYPE_DESC
-
-      << setiosflags(ios::left)
-      
-      << setw(PRODUCT_TYPE_SIZE)
-      << theAdminRecord.theProductType
-
-      << PRODUCT_SIZE_DESC
-
-      << setw(PRODUCT_SIZE_SIZE)
-      << theAdminRecord.theProductSize
-
-      << setw(22) << SPACE << endl; // End of line.
-
-   os.seekp(720, ios::beg);
-
-   os << PROCESSING_TYPE_DESC
-
-      << setw(PROCESSING_TYPE_SIZE)
-      << theAdminRecord.theProcessingType
-
-      << RESAMPLING_ALGO_DESC
-
-      << setw(RESAMPLING_ALGO_SIZE)
-      << theAdminRecord.theResampAlgorithm
-
-      << resetiosflags(ios::left)
-
-      << setw(33) << SPACE << endl; // End of line.
-
-   os.seekp(800, ios::beg);  // Start of line.
-   
-   os << TAPE_VOLUME_NUMBER_DESC
-
-      << setiosflags(ios::right)
-
-      << setw(TAPE_VOLUME_NUMBER_SIZE) 
-      << theAdminRecord.theTapeVolumeNumber
-      << "/" << setw(VOLUMES_PER_TAPE_SIZE)
-      << theAdminRecord.theNumberVolumesPerTape
-
-      << PIXELS_PER_LINE_DESC
-
-      << setw(PIXELS_PER_LINE_SIZE)
-      << theAdminRecord.thePixelsPerLine 
-
-      << LINES_PER_IMAGE_DESC
-
-      << setw(LINES_PER_IMAGE_SIZE)
-      << theAdminRecord.theLinesPerImage
-
-      << "/"
-
-      << setw(LINES_PER_IMAGE_SIZE)
-      << theAdminRecord.theLinesPerImage
-
-      << setw(4) << SPACE << endl;  // End of line.
-  
-   os.seekp(880, ios::beg);  // Start of line.
-
-   os << setiosflags(ios::right)
-
-      << FIRST_LINE_DESC
-
-      << setw(LINES_PER_IMAGE_SIZE)
-      << theAdminRecord.the1stLineInVolume
-
-      << BLOCKING_FACTOR_DESC
-
-      << setw(BLOCKING_FACTOR_SIZE)
-      << theAdminRecord.theTapeBlockingFactor
- 
-      << RECORD_LENGTH_DESC
-
-      << setw(RECORD_LENGTH_SIZE)
-      << theAdminRecord.theRecordSize
-
-      << PIXEL_GSD_DESC
-
-      
-      << setw(PIXEL_GSD_SIZE)
-      << setprecision(2)
-      << theAdminRecord.theGsd
-
-      << endl;  // End of line.
-
-   os.seekp(960, ios::beg);  // Start of line.
-
-   os << BITS_PER_PIXEL_DESC
-
-      << setw(BITS_PER_PIXEL_SIZE)
-      << theAdminRecord.theOutputBitsPerPixel
-
-      << AQUIRED_BITS_PER_PIXEL_DESC
-
-      << setw(BITS_PER_PIXEL_SIZE)
-      << theAdminRecord.theAcquiredBitsPerPixel
-
-      << resetiosflags(ios::right)
-
-      << setw(26) << SPACE << endl;  // End of line.
-
-   os.seekp(1040, ios::beg);  // Start of line.
-
-   os << BANDS_PRESENT_DESC
-
-      << setw(BANDS_PRESENT_SIZE)
-      << theAdminRecord.theBandsPresentString
-
-      << setw(31) << SPACE << endl // End of line.
-      << setw(79) << SPACE << endl
-      << setw(79) << SPACE << endl
-      << setw(79) << SPACE << endl
-      << setw(79) << SPACE << endl
-      << setw(79) << SPACE << endl;
-
-   os.seekp(1520, ios::beg);
-   
-   os << REV_DESC
-
-      << setw(FORMAT_VERSION_SIZE)
-      << theAdminRecord.theFormatVersion;
-
-   //***
-   // End of administrative record(bytes 0 to 1535).
-   //***
-
-   //***
-   // Beginning of radiometric record.
-   //***
-
-   os.seekp(1536, ios::beg);  
-
-   os << BIAS_GAIN_DESC
-
-      << setw(29) << SPACE << endl; 
-
-   //***
-   // Loop through the bands and get write out the bias and gain for each
-   // band.
-   //***
-   
-   os << resetiosflags(ios::left) << setiosflags(ios::right);
-
-   for (i = 0; i < 8; i++)
-   {
-      os.seekp(BIAS_OFFSET[i], ios::beg);
-
-      os << setprecision(15)
-         
-         << setw(BIAS_SIZE)
-         << theRadiomRecord.theBias[i]
-
-         << SPACE 
-
-         << setw(GAIN_SIZE) 
-         << theRadiomRecord.theGain[i]
-
-         << setw(30) << SPACE << endl;
-   } // End of loop through the bands.
-
-   os << resetiosflags(ios::right);
-
-   os.seekp(2256, ios::beg);
-
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(79) << SPACE << endl;
-   os << setw(15) << SPACE << endl;
-
-   //***
-   // End of radiometric record(bytes 1536 to 3071).
-   //***
-
-   //**
-   // Start of geometric record(bytes 3072 to 4607).
-   //***
-
-   os.seekp(3072, ios::beg);  // Start of record.
-
-   os << GEO_DESC
-
-      << MAP_PROJECTION_NAME_DESC
-
-      << setiosflags(ios::left) // Alpha fields left justified.
-
-      << setw(MAP_PROJECTION_NAME_SIZE)
-      << theGeoRecord.theMapProjectionName
-
-      << ELLIPSOID_DESC // Looks like this has changed.
-
-      << setw(ELLIPSOID_SIZE)
-      << theGeoRecord.theEllipsoid
-
-      << DATUM_DESC
-
-      << setw(DATUM_SIZE)
-      << theGeoRecord.theDatum
-
-      << resetiosflags(ios::left)
-      
-      << endl // End of line
-
-      << PROJECTION_PARAMETER_DESC
-      << SPACE;
-
-   os.seekp(PROJ_PARAM_OFFSET[0], ios::beg);
-   os << setprecision(15)
-      << setiosflags(ios::right)
-      
-      << setw(PROJECTION_PARAMETER_SIZE) 
-      << theGeoRecord.theProjectionParams[0]
-      << SPACE;
-
-   os.seekp(PROJ_PARAM_OFFSET[1], ios::beg);
-   os << setw(PROJECTION_PARAMETER_SIZE) 
-      << theGeoRecord.theProjectionParams[1]
-      << setw(1) << SPACE << endl;
-
-   //***
-   // Code is duplicated every three projection parameter four times; 
-   // hence, the double loop.
-   //***
-   for (i = 0; i < 4; i++)
-   {
-      for (int j = i * 3 + 2; j < (i * 3) + 5; j++)
-      {
-         os.seekp(PROJ_PARAM_OFFSET[j], ios::beg);
-
-         os << setw(PROJECTION_PARAMETER_SIZE) 
-            << theGeoRecord.theProjectionParams[j]
-            << setw(1) << SPACE;
-
-         os.seekp(PROJ_PARAM_OFFSET[j], ios::beg);
-         os << setw(PROJECTION_PARAMETER_SIZE) 
-            << theGeoRecord.theProjectionParams[j]
-            << setw(1) << SPACE;
-
-         os.seekp(PROJ_PARAM_OFFSET[j], ios::beg);
-         os << setw(PROJECTION_PARAMETER_SIZE) 
-            << theGeoRecord.theProjectionParams[j]
-            << setw(5) << SPACE << endl;
-      }
-   }
-
-   os.seekp(PROJ_PARAM_OFFSET[14], ios::beg);
-   os << setw(PROJECTION_PARAMETER_SIZE) 
-      << theGeoRecord.theProjectionParams[14]
-      << setw(55) << SPACE << endl << resetiosflags(ios::right);
-
-
-   os.seekp(3632, ios::beg);
-   os << UL_DESC
- 
-      << SPACE
-      
-      << setw(LON_SIZE) << theGeoRecord.theUlLon
-
-      << SPACE
-
-      << setw(LAT_SIZE) << theGeoRecord.theUlLat
-
-      << SPACE
-
-      << setprecision(3)
-      
-      << setw(EASTING_SIZE) << setiosflags(ios::right) 
-      << theGeoRecord.theUlEasting
-
-      << SPACE
-
-      << setw(NORTHING_SIZE) 
-      << theGeoRecord.theUlNorthing
-
-      << setw(20) << SPACE << endl << resetiosflags(ios::right);
-
-      
-   os.seekp(3712, ios::beg);
-   os << UR_DESC
- 
-      << SPACE
-      
-      << setw(LON_SIZE) << theGeoRecord.theUrLon
-
-      << SPACE
-
-      << setw(LAT_SIZE) << theGeoRecord.theUrLat
-
-      << SPACE
-
-      << setw(EASTING_SIZE) << setiosflags(ios::right) 
-      << theGeoRecord.theUrEasting
-
-      << SPACE
-
-      << setw(NORTHING_SIZE) 
-      << theGeoRecord.theUrNorthing
-
-      << setw(20) << SPACE << endl << resetiosflags(ios::right);
-
-      
-   os.seekp(3792, ios::beg);
-   os << LR_DESC
- 
-      << SPACE
-      
-      << setw(LON_SIZE) << theGeoRecord.theLrLon
-
-      << SPACE
-
-      << setw(LAT_SIZE) << theGeoRecord.theLrLat
-
-      << SPACE
-
-      << setw(EASTING_SIZE) << setiosflags(ios::right) 
-      << theGeoRecord.theLrEasting
-
-      << SPACE
-
-      << setw(NORTHING_SIZE) 
-      << theGeoRecord.theLrNorthing
-
-      << setw(20) << SPACE << endl << resetiosflags(ios::right);
-
-      
-   os.seekp(3872, ios::beg);
-   os << LL_DESC
- 
-      << SPACE
-      
-      << setw(LON_SIZE) << theGeoRecord.theLlLon
-
-      << SPACE
-
-      << setw(LAT_SIZE) << theGeoRecord.theLlLat
-
-      << SPACE
-
-      << setw(EASTING_SIZE) << setiosflags(ios::right) 
-      << theGeoRecord.theLlEasting
-
-      << SPACE
-
-      << setw(NORTHING_SIZE) 
-      << theGeoRecord.theLlNorthing
-
-      << setw(20) << SPACE << endl << resetiosflags(ios::right);
-
-   os.seekp(3952, ios::beg);
-   os << CENTER_DESC
-
-      << SPACE
-
-      << setw(LON_SIZE) 
-      << theGeoRecord.theCenterLon
-      
-      << SPACE
-
-      << setw(LAT_SIZE) 
-      << theGeoRecord.theCenterLat
-
-      << SPACE
-
-      << setw(EASTING_SIZE) << setiosflags(ios::right) 
-      << theGeoRecord.theCenterEasting
-
-      << SPACE
-
-      << setw(NORTHING_SIZE) 
-      << theGeoRecord.theCenterNorthing
-
-      << SPACE 
-
-      << setw(CENTER_SAMPLE_SIZE) 
-      << theGeoRecord.theCenterSample
-
-      << SPACE 
-
-      << setw(CENTER_LINE_SIZE) 
-      << theGeoRecord.theCenterLine
-
-      << setw(4) << SPACE << endl;
-
-   os.seekp(4032, ios::beg);
-   os << HORIZONTAL_OFFSET_DESC
-
-      << setw(HORIZONTAL_OFFSET_SIZE) 
-      << theGeoRecord.theHorizontalOffset
-
-      << ORIENTATION_ANGLE_DESC
-
-      << setw(ORIENTATION_ANGLE_SIZE) 
-      << setprecision(2)
-      << theGeoRecord.theOrientationAngle
-
-      << setw(39) << SPACE << endl; // 41 in spec
-
-   os.seekp(4112, ios::beg);
-   os << SUN_ELEVATION_DESC
-
-      << setw(SUN_ELEVATION_SIZE) 
-      << setprecision(1) 
-      << theGeoRecord.theSunElevationAngle
-
-      << SUN_AZIMUTH_DESC
-
-      << setw(SUN_AZIMUTH_SIZE) 
-      << setprecision(1) 
-      << theGeoRecord.theSunAzimuth  // End of data.
-
-      << setw(29) << SPACE << endl 
-      << setw(79) << SPACE << endl 
-      << setw(79) << SPACE << endl 
-      << setw(79) << SPACE << endl 
-      << setw(79) << SPACE << endl
-      << setw(79) << SPACE << endl
-      << setw(15) << SPACE << endl << flush; // ? size
-
-   //***
-   // End of geometric record(bytes 3072 to 4607).
-   //***
-   
-}
-
-
-//***************************************************************************
-// PRIVATE METHOD:
-// ossimFfRevc::loadFromStream(istream& is)
-//***************************************************************************
-void ossimFfRevc::loadFromStream(istream& is)
-{
-   //***
-   // See .h for enumerations for field sizes and offsets. 
-   //***
-
-   //***
-   // NOTE:  Because of header inconsistencies all seeks will be relative to
-   //        the beginning of the stream.
-   //***
-
-   //***
-   // Temporary buffer for fields that need to be converted to integers or
-   // floats.
-   //***
-   
-   char tmpBuff[25];
-
-   //***
-   // Start of administrative record.
-   //***
-
-   is.seekg(PRODUCT_ORDER_NUMBER_OFFSET, ios::beg);
-
-   is.get(theAdminRecord.theProductOrderNumber, 
-          PRODUCT_ORDER_NUMBER_SIZE + 1,
-          ' ');
-
-   if (checkStream(is)) return;
-
-   //***
-   // Loop through the four scenes and get the data.
-   //***
-
-   int i;
-   for (i = 0; i < NUMBER_OF_SCENES; i++)
-   {
- 
-      is.seekg(PATH_ROW_NUMBER_OFFSET[i], ios::beg);
-
-      is.get(theAdminRecord.thePathRowNumber[i], PATH_ROW_NUMBER_SIZE + 1);
-   
-      if (checkStream(is)) return;
-
-      is.seekg(DATE_OFFSET[i], ios::beg);
-
-      is.get(theAdminRecord.theAcquisitionDate[i], DATE_SIZE + 1);
-   
-      if (checkStream(is)) return;
-
-      is.seekg(SAT_NAME_OFFSET[i], ios::beg);
-
-      is.get(theAdminRecord.theSatName[i], SAT_NAME_SIZE + 1);
-   
-      if (checkStream(is)) return;
-
-      is.seekg(SENSOR_NAME_OFFSET[i], ios::beg);
-
-      is.get(theAdminRecord.theSensorName[i], SENSOR_NAME_SIZE + 1);
-   
-      if (checkStream(is)) return;
-
-      is.seekg(SENSOR_MODE_OFFSET[i], ios::beg);
-
-      is.get(theAdminRecord.theSensorMode[i], SENSOR_MODE_SIZE + 1);
-  
-      if (checkStream(is)) return;
-
-      is.seekg(OFF_NADIR_ANGLE_OFFSET[i], ios::beg);
-
-      is.get(tmpBuff, OFF_NADIR_ANGLE_SIZE + 1);
-
-      if (checkStream(is)) return;
-
-      theAdminRecord.theOffNadirAngle[i] = atof(tmpBuff);
-
-   } // End of scene loop.
-   
-   is.seekg(PRODUCT_TYPE_OFFSET, ios::beg);
-
-   is.get(theAdminRecord.theProductType, PRODUCT_TYPE_SIZE + 1);
-
-   if (checkStream(is)) return;
- 
-   is.seekg(PRODUCT_SIZE_OFFSET, ios::beg);
-
-   is.get(theAdminRecord.theProductSize, PRODUCT_SIZE_SIZE + 1);
-
-   if (checkStream(is)) return;
-   
-   is.seekg(PROCESSING_TYPE_OFFSET, ios::beg);
-
-   is.get(theAdminRecord.theProcessingType, PROCESSING_TYPE_SIZE + 1);
-
-   if (checkStream(is)) return;
-   
-   is.seekg(RESAMPLING_ALGO_OFFSET, ios::beg);
-
-   is.get(theAdminRecord.theResampAlgorithm, RESAMPLING_ALGO_SIZE + 1);
-
-   if (checkStream(is)) return;
-   
-   is.seekg(TAPE_VOLUME_NUMBER_OFFSET, ios::beg);
-
-   is.get(tmpBuff, TAPE_VOLUME_NUMBER_SIZE + 1, '/');
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theTapeVolumeNumber = atoi(tmpBuff);
-
-   is.seekg(VOLUMES_PER_TAPE_OFFSET, ios::beg);
-
-   is.get(tmpBuff, VOLUMES_PER_TAPE_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theNumberVolumesPerTape = atoi(tmpBuff);
-    
-   is.seekg(PIXELS_PER_LINE_OFFSET, ios::beg);
-
-   is.get(tmpBuff, PIXELS_PER_LINE_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.thePixelsPerLine = atoi(tmpBuff);
-   
-   is.seekg(LINES_PER_IMAGE_OFFSET, ios::beg);
-
-   is.get(tmpBuff, LINES_PER_IMAGE_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theLinesPerImage = atoi(tmpBuff);
-
-   is.seekg(FIRST_LINE_IN_VOLUME_OFFSET, ios::beg);
-
-   is.get(tmpBuff, FIRST_LINE_IN_VOLUME_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.the1stLineInVolume = atoi(tmpBuff);
-
-   is.seekg(BLOCKING_FACTOR_OFFSET, ios::beg);
-
-   is.get(tmpBuff, BLOCKING_FACTOR_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theTapeBlockingFactor = atoi(tmpBuff);
-   
-   is.seekg(RECORD_LENGTH_OFFSET, ios::beg);
-
-   is.get(tmpBuff, RECORD_LENGTH_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theRecordSize = atoi(tmpBuff);
-   
-   is.seekg(PIXEL_GSD_OFFSET, ios::beg);
-
-   is.get(tmpBuff, PIXEL_GSD_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theGsd = atof(tmpBuff);
-   
-   is.seekg(BITS_PER_PIXEL_OFFSET, ios::beg);
-
-   is.get(tmpBuff, BITS_PER_PIXEL_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theOutputBitsPerPixel = atoi(tmpBuff);
-   
-   is.seekg(ACQUIRED_BITS_PER_PIXEL_OFFSET, ios::beg);
-
-   is.get(tmpBuff, BITS_PER_PIXEL_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theAdminRecord.theAcquiredBitsPerPixel = atoi(tmpBuff);
-   
-   is.seekg(BANDS_PRESENT_OFFSET, ios::beg);
-
-   is.get(theAdminRecord.theBandsPresentString, BANDS_PRESENT_SIZE + 1);
-
-   if (checkStream(is)) return;
-   
-   is.seekg(FORMAT_VERSION_OFFSET, ios::beg);
-
-   is.get(theAdminRecord.theFormatVersion, FORMAT_VERSION_SIZE + 1);
-
-   if (checkStream(is)) return;
-   //***
-   // End of administrative record.
-   //***
-
-   //***
-   // Start of radiometric record.
-   //***
-
-   for (i = 0; i < NUMBER_OF_BANDS; i++)
-   {
-      is.seekg(BIAS_OFFSET[i], ios::beg);
-
-      is.get(tmpBuff, BIAS_SIZE + 1);
-
-      if (checkStream(is)) return;
-   
-      theRadiomRecord.theBias[i] = atof(tmpBuff);
-
-      is.seekg(GAIN_OFFSET[i], ios::beg);
-
-      is.get(tmpBuff, GAIN_SIZE + 1);
-
-      if (checkStream(is)) return;
-   
-      theRadiomRecord.theGain[i] = atof(tmpBuff);
-   }
-   //***
-   // End of radiometric record.
-   //***
-
-   //***
-   // Start of geometric record.
-   //***
-
-   is.seekg(MAP_PROJECTION_NAME_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theMapProjectionName, MAP_PROJECTION_NAME_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   is.seekg(ELLIPSOID_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theEllipsoid, ELLIPSOID_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   is.seekg(DATUM_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theDatum, DATUM_SIZE + 1, ' ');
-   
-   if (checkStream(is)) return;
-
-   //***
-   // Get the fifteen projection parameters.
-   //***
-   
-   for(i = 0; i < 15; i++)
-   {
-      is.seekg(PROJ_PARAM_OFFSET[i], ios::beg);
-   
-      is.get(tmpBuff, PROJECTION_PARAMETER_SIZE + 1);
-
-      if (checkStream(is)) return;
-
-      theGeoRecord.theProjectionParams[i] = atof(tmpBuff);
-   }
-
-   //***
-   // Start of upper left data:  longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(UL_LON_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theUlLon, LON_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(UL_LAT_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theUlLat, LAT_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(UL_EASTING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, EASTING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theUlEasting = atof(tmpBuff);
-
-   is.seekg(UL_NORTHING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theUlNorthing = atof(tmpBuff);
-
-   //***
-   // End of upper left data.
-   //***
-
-   //***
-   // Start of upper right data:  longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(UR_LON_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theUrLon, LON_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(UR_LAT_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theUrLat, LAT_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(UR_EASTING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, EASTING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theUrEasting = atof(tmpBuff);
-
-   is.seekg(UR_NORTHING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theUrNorthing = atof(tmpBuff);
-
-   //***
-   // End of upper right data.
-   //***
-
-   //***
-   // Start of lower right data:  longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(LR_LON_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theLrLon, LON_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(LR_LAT_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theLrLat, LAT_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(LR_EASTING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, EASTING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theLrEasting = atof(tmpBuff);
-
-   is.seekg(LR_NORTHING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theLrNorthing = atof(tmpBuff);
-
-   //***
-   // End of lower right data.
-   //***
-
-   //***
-   // Start of lower left data:  longitude, latitude, easting, and northing. 
-   //***
-   is.seekg(LL_LON_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theLlLon, LON_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(LL_LAT_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theLlLat, LAT_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(LL_EASTING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, EASTING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theLlEasting = atof(tmpBuff);
-
-   is.seekg(LL_NORTHING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theLlNorthing = atof(tmpBuff);
-
-   //***
-   // End of lower left data.
-   //***
-
-   //***
-   // Start of scene center data:  longitude, latitude, easting, northing,
-   // sample, line. 
-   //***
-   is.seekg(CENTER_LON_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theCenterLon, LON_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(CENTER_LAT_OFFSET, ios::beg);
-
-   is.get(theGeoRecord.theCenterLat, LAT_SIZE + 1);
-   
-   if (checkStream(is)) return;
-   
-   is.seekg(CENTER_EASTING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, EASTING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theCenterEasting = atof(tmpBuff);
-
-   is.seekg(CENTER_NORTHING_OFFSET, ios::beg);
-
-   is.get(tmpBuff, NORTHING_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theCenterNorthing = atof(tmpBuff);
-
-   is.seekg(CENTER_SAMPLE_OFFSET, ios::beg);
-
-   is.get(tmpBuff, CENTER_SAMPLE_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theCenterSample = atoi(tmpBuff);
-
-   is.seekg(CENTER_LINE_OFFSET, ios::beg);
-
-   is.get(tmpBuff, CENTER_LINE_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theCenterLine = atoi(tmpBuff);
-
-   //***
-   // End of scene center data.
-   //***
-   
-   is.seekg(HORIZONTAL_OFFSET_OFFSET, ios::beg);
-
-   is.get(tmpBuff, HORIZONTAL_OFFSET_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theHorizontalOffset = atoi(tmpBuff);
-   
-   is.seekg(ORIENTATION_ANGLE_OFFSET, ios::beg);
-
-   is.get(tmpBuff, ORIENTATION_ANGLE_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theOrientationAngle = atof(tmpBuff);
-   
-   is.seekg(SUN_ELEVATION_OFFSET, ios::beg);
-
-   is.get(tmpBuff, SUN_ELEVATION_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theSunElevationAngle = atof(tmpBuff);
-   
-   is.seekg(SUN_AZIMUTH_OFFSET, ios::beg);
-
-   is.get(tmpBuff, SUN_AZIMUTH_SIZE + 1);
-
-   if (checkStream(is)) return;
-
-   theGeoRecord.theSunAzimuth = atof(tmpBuff);
-
-   //***
-   // End of geometric record.
-   //***
-   
-}
-
-//***************************************************************************
-// PRIVATE METHOD:
-// ossimFfRevc::checkStream(istream& is)
-//
-// Checks the stream.  If an error has occurred it sets theErrorStatus.
-// Returns: theErrorStatus    ( 0 = OK,  1 = ERROR )
-//***************************************************************************
-int ossimFfRevc::checkStream(istream& is)
-{
-   //***
-   // istreams set fault bits and the operator! is overloaded to return
-   // true if an error has occurred.
-   //***
-   
-   if (!is)
-   {
-      theErrorStatus = OSSIM_ERROR;
-
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevc::checkStream: "
-                                          << "Stream corrupted.   Returning from method."
-                                          << std::endl;
-   } 
-
-   return theErrorStatus;
-}
-   
-//***************************************************************************
-// Function:
-// ostream& operator<<(ostream& os, const ossimFfRevc& head)
-//***************************************************************************
-ostream& operator<<(ostream& os, const ossimFfRevc& head)
-{
-   head.print(os);
-
-   return os;
-}
-
-//***************************************************************************
-// CONSTRUCTOR:
-// ossimFfRevc::AdminRecord::AdminRecord()
-//
-// Default constructor for AdminRecord nested class:
-//***************************************************************************
-ossimFfRevc::AdminRecord::AdminRecord()
-   :
-      theTapeVolumeNumber(1),
-      theNumberVolumesPerTape(1),
-      thePixelsPerLine(0),
-      theLinesPerImage(0),
-      the1stLineInVolume(1),
-      theTapeBlockingFactor(1),
-      theRecordSize(0),
-      theGsd(0.0),
-      theOutputBitsPerPixel(8),
-      theAcquiredBitsPerPixel(6)
-{
-   const char tmpBuff[] = "";
-
-   strcpy(theProductOrderNumber, tmpBuff);
-
-   //>
-   // There can be four scenes.
-   //<
-   
-   for (int i = 0; i < 4; i++)
-   {
-      strcpy(thePathRowNumber[i], tmpBuff);
-      strcpy(theAcquisitionDate[i], tmpBuff);
-      strcpy(theSatName[i], tmpBuff);
-      strcpy(theSensorName[i], tmpBuff);
-      strcpy(theSensorMode[i], tmpBuff);
-      theOffNadirAngle[i] = 0.0;
-   }
-   strcpy(theProductType, "MAP ORIENTED");
-   strcpy(theProductSize, tmpBuff);
-   strcpy(theProcessingType, "SYSTEMATIC");
-   strcpy(theResampAlgorithm, "CC");
-   strcpy(theBandsPresentString, "P");
-   strcpy(theFormatVersion, "C");
-}
-
-//***************************************************************************
-// CONSTRUCTOR:
-// ossimFfRevc::RadiomRecord::RadiomRecord()
-//
-// Default constructor for RadiomRecord nested class:
-//***************************************************************************
-ossimFfRevc::RadiomRecord::RadiomRecord()
-{
-   for (int i = 0; i < 8; i++)
-   {
-      theBias[i] = 0.0;
-      theGain[i] = 0.0;
-   }
-}
-         
-//***************************************************************************
-// CONSTRUCTOR:
-// ossimFfRevc::GeoRecord::GeomRecord()
-//
-// Default constructor for GeoRecord nested class:
-//***************************************************************************
-ossimFfRevc::GeoRecord::GeoRecord()
-   :
-      theUlEasting(0.0),
-      theUlNorthing(0.0),
-      theUrEasting(0.0),
-      theUrNorthing(0.0),
-      theLrEasting(0.0),
-      theLrNorthing(0.0),
-      theLlEasting(0.0),
-      theLlNorthing(0.0),
-      theCenterEasting(0.0),
-      theCenterNorthing(0.0),
-      theCenterSample(0),
-      theCenterLine(0),
-      theHorizontalOffset(0),
-      theOrientationAngle(0.0),
-      theSunElevationAngle(0.0),
-      theSunAzimuth(0.0)
-{
-   for (int i = 0; i < 15; i++)
-   {
-      theProjectionParams[i] = 0.0;
-   }
-
-   const char tmpBuff[] = "";
-
-   strcpy(theMapProjectionName, "UTM");
-   strcpy(theEllipsoid, tmpBuff);
-   strcpy(theDatum, tmpBuff);
-   strcpy(theUlLon, tmpBuff);
-   strcpy(theUlLat, tmpBuff);
-   strcpy(theUrLon, tmpBuff);
-   strcpy(theUrLat, tmpBuff);
-   strcpy(theLrLon, tmpBuff);
-   strcpy(theLrLat, tmpBuff);
-   strcpy(theLlLon, tmpBuff);
-   strcpy(theLlLat, tmpBuff);
-   strcpy(theCenterLon, tmpBuff);
-   strcpy(theCenterLat, tmpBuff);
-}
diff --git a/ossim/src/ossim/support_data/ossimFgdcTxtDoc.cpp b/ossim/src/ossim/support_data/ossimFgdcTxtDoc.cpp
deleted file mode 100644
index 721fef4..0000000
--- a/ossim/src/ossim/support_data/ossimFgdcTxtDoc.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File ossimFgdcTxtDoc.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ossimFgdcTxtDoc class definition.
-//
-// FGDC = "Federal Geographic Data Committee"
-//
-// See: http://www.fgdc.gov/
-// 
-//----------------------------------------------------------------------------
-
-#include <ossim/support_data/ossimFgdcTxtDoc.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/projection/ossimMapProjectionFactory.h>
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-
-static const std::string ALTITUDE_DISTANCE_UNITS_KW = "altitude_distance_units";
-static const std::string FGDC_FILE_KW               = "fgdc_file";
-static const std::string FGDC_VERSION_KW            = "fgdc_version";
-static const std::string FGDC_VERSION_001_1998      = "FGDC-STD-001-1998";
-
-ossimFgdcTxtDoc::ossimFgdcTxtDoc()
-   : m_kwl( new ossimKeywordlist() )
-{
-}
-
-ossimFgdcTxtDoc::~ossimFgdcTxtDoc()
-{
-   m_kwl = 0; // Not a leak, m_kwl is a ossimRefPtr.
-}
-
-bool ossimFgdcTxtDoc::open(const ossimFilename& file)
-{
-   bool result = false;
-
-   // Open the file:
-   std::ifstream str( file.c_str(), std::ios_base::in );
-
-   if ( str.good() )
-   {
-      std::string key = "Metadata_Standard_Version";
-      std::string value;
-      if ( findKey( str, true, key, value ) )
-      {
-         if ( value == FGDC_VERSION_001_1998 )
-         {
-            result = true;
-            m_kwl->addPair( FGDC_VERSION_KW, value );
-            m_kwl->addPair( FGDC_FILE_KW, file.string() );
-
-            // Store for getAltitudeDistanceUnits() method if key found.
-            key = "Altitude_Distance_Units";
-            if ( findKey( str, false, key, value ) )
-            {
-               m_kwl->addPair( ALTITUDE_DISTANCE_UNITS_KW, value );
-            }
-         }
-      }
-   }
-
-   return result;
-}
-
-void ossimFgdcTxtDoc::close()
-{
-   m_kwl->clear();
-}
-
-void ossimFgdcTxtDoc::getProjection(ossimRefPtr<ossimProjection>& proj)
-{
-   static const char M[] = "ossimFgdcTxtDoc::getProjection";
-   
-   try
-   {
-      // Get the file name:
-      std::string file = m_kwl->findKey( FGDC_FILE_KW );
-      if ( file.size() )
-      {
-         // Get the version:
-         std::string version = m_kwl->findKey( FGDC_VERSION_KW );
-         if ( version.size() )
-         {
-            // Note: Currently only coded against FGDC-STD-001-1998
-            if ( version ==  FGDC_VERSION_001_1998)
-            {
-               // Open the file:
-               std::ifstream str( file.c_str(), std::ios_base::in );
-               if ( str.good() )
-               {
-                  // Find the Spatial_Reference_Information  section:
-                  std::string key = "Spatial_Reference_Information:";
-                  if ( findKey( str, key ) )
-                  {
-                     getProjectionV1( str, proj );
-                  }
-               }
-            }
-         }
-      }
-   }
-   catch (const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << M << " caught exception:\n" << e.what() << std::endl;
-   }
-}
-
-void ossimFgdcTxtDoc::getAltitudeDistanceUnits(std::string& units) const
-{
-   units = m_kwl->findKey( ALTITUDE_DISTANCE_UNITS_KW );
-}
-
-void ossimFgdcTxtDoc::getProjectionV1(std::ifstream& str, ossimRefPtr<ossimProjection>& proj)
-{
-   static const char M[] = "ossimFgdcTxtDoc::getProjectionV1";
-   
-   std::string fgdcKey;
-   std::string fgdcValue;
-   std::string key;
-   std::string value;
-   ossimKeywordlist projectionKwl;
-   
-   fgdcKey = "Grid_Coordinate_System_Name";
-   if ( findKey( str, true, fgdcKey, fgdcValue ) )
-   {
-      if ( fgdcValue == "Universal Transverse Mercator" )
-      {
-         key = "type";
-         value = "ossimUtmProjection";
-         projectionKwl.addPair(key, value);
-
-         // Get the zone:
-         fgdcKey = "UTM_Zone_Number";
-         if ( findKey( str, true, fgdcKey, fgdcValue ) )
-         {
-            key = "zone";
-            value = fgdcValue;
-            projectionKwl.addPair(key, value);
-         }
-         else
-         {
-            std::string errMsg = M;
-            errMsg += " ERROR: Could not determine utm zone!";
-            throw ossimException(errMsg);
-         }
-
-         // Check for Southern hemisphere.
-         fgdcKey = "False_Northing";
-         if ( findKey( str, true, fgdcKey, fgdcValue ) )
-         {
-            key = "hemisphere";
-            
-            // Hemisphere( North false easting = 0.0, South = 10000000):
-            ossim_float64 f = ossimString::toFloat64( fgdcKey.c_str() );
-            if ( f == 0.0 )
-            {
-               value = "N";
-            }
-            else
-            {
-               value = "S";
-            }
-            projectionKwl.addPair(key, value);
-         }
-         
-      } // UTM section:
-      else
-      {
-         // Exception thrown so that we see that we are not handling a projection.
-         std::string errMsg = M;
-         errMsg += "ERROR: Unhandled projection: ";
-         errMsg += fgdcValue;
-         throw ossimException(errMsg);  
-      }
-
-      fgdcKey = "Horizontal_Datum_Name";
-      if ( findKey( str, true, fgdcKey, fgdcValue ) )
-      {
-         getOssimDatum( fgdcValue, value );
-         key = "datum";
-         projectionKwl.addPair(key, value);
-      }
-      
-   } // Matches: findKey( Grid_Coordinate_System_Name )
-
-   if ( projectionKwl.getSize() )
-   {
-      proj = ossimMapProjectionFactory::instance()->createProjection(projectionKwl);
-   }
-   else
-   {
-      proj = 0;
-   }
-}
-
-bool ossimFgdcTxtDoc::findKey( std::ifstream& str, const std::string& key)
-{
-   bool result = false;
-   ossimString line;
-   while ( !str.eof() )
-   {
-      // Read line:
-      std::getline( str, line.string() );
-      if ( line.size() )
-      {
-         // Eat white space.
-         line.trim();
-         if ( line.string() == key )
-         {
-            result = true;
-            break;
-         }
-      }
-   }
-   return result;
-}
-
-bool ossimFgdcTxtDoc::findKey(
-   std::ifstream& str, bool seekBack, const std::string& key, std::string& value)
-{
-   bool result = false;
-
-   std::vector<ossimString> fgdcKeyValue;
-   ossimString separator = ":";
-   ossimString line;
-   ossimKeywordlist projectionKwl;
-   std::streampos currentPosition = str.tellg();
-   
-   while ( !str.eof() )
-   {
-      // Read line:
-      std::getline( str, line.string() );
-      
-      if ( line.size() )
-      {
-         // Eat white space.
-         line.trim();
-         
-         // Split between ':'
-         fgdcKeyValue.clear();
-         line.split(fgdcKeyValue, separator, false);
-         if ( fgdcKeyValue.size() == 2 )
-         {
-            fgdcKeyValue[0].trim();
-
-            if ( fgdcKeyValue[0].size() )
-            {
-               if ( fgdcKeyValue[0] == key )
-               {
-                  // Found it.  Initialize value and get out.
-                  result = true;
-                  fgdcKeyValue[1].trim();
-                  value = fgdcKeyValue[1].string();
-                  break; // from while loop.
-               }
-            }
-         }
-      }
-   }
-
-   if ( seekBack )
-   {
-      str.seekg(currentPosition);
-   }
-   
-   return result;
-}
-
-// Could be moved to base class for xml and text doc.
-void ossimFgdcTxtDoc::getOssimDatum( const std::string& fgdcDatumString,
-                                     std::string& ossimDatumCode ) const
-{
-   ossimString horizdn = fgdcDatumString;
-   horizdn.downcase();
-   if ( horizdn == "north american datum of 1983" )
-   {
-      ossimDatumCode = "NAR-C";
-   }
-   else if ( horizdn == "north american datum of 1927" )
-   {
-      ossimDatumCode = "NAS-C";
-   }
-   else if ( horizdn == "wgs84")
-   {
-      ossimDatumCode = "WGE";
-   }
-   else
-   {
-      // Exception thrown so that we see that we are not handling a datum.
-      std::string errMsg = "ossimFgdcTxtDoc::getOssimDatum ERROR: Unhandled datum: ";
-      errMsg += horizdn.string();
-      throw ossimException(errMsg);
-   }
-}
-
diff --git a/ossim/src/ossim/support_data/ossimFgdcXmlDoc.cpp b/ossim/src/ossim/support_data/ossimFgdcXmlDoc.cpp
deleted file mode 100644
index 4a12672..0000000
--- a/ossim/src/ossim/support_data/ossimFgdcXmlDoc.cpp
+++ /dev/null
@@ -1,549 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Utility class to encapsulate parsing projection info in the xml file.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimFgdcXmlDoc.cpp 2063 2011-01-19 19:38:12Z ming.su $
-
-#include <ossim/support_data/ossimFgdcXmlDoc.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimDatumFactoryRegistry.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimUtmProjection.h>
-
-#include <cmath> /* for std::fabs */
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimFgdcXmlDoc:debug");
-
-ossimFgdcXmlDoc::ossimFgdcXmlDoc()
-   : m_xmlFilename(ossimFilename::NIL),
-     m_xmlDocument(0),
-     m_projection(0),
-     m_boundInDegree(false)
-{
-}
-
-ossimFgdcXmlDoc::~ossimFgdcXmlDoc()
-{
-}
-
-bool ossimFgdcXmlDoc::open(const ossimFilename& xmlFileName)
-{
-   bool result = false;
-   if ( isOpen() )
-   {
-      close();
-   }
-   
-   if (xmlFileName.size())
-   {
-      m_xmlDocument = new ossimXmlDocument(xmlFileName);
-      if ( m_xmlDocument.valid() )
-      {
-         // May want to add a test for valid FGDC here??? (drb)
-         m_xmlFilename = xmlFileName;
-         result = true;
-      }
-   }
-   return result;
-}
-
-void ossimFgdcXmlDoc::close()
-{
-   m_xmlFilename = ossimFilename::NIL;
-   m_xmlDocument = 0;
-   m_projection  = 0;
-}
-
-ossimRefPtr<ossimProjection> ossimFgdcXmlDoc::getProjection()
-{
-   if ( (m_projection.valid() == false) && isOpen() )
-   {
-      ossimString projName;
-      if ( getProjCsn(projName) )
-      {
-         if (!projName.empty())
-         {
-            m_projection = ossimEpsgProjectionFactory::instance()->createProjection(projName);
-            
-            if ( m_projection.valid() )
-            {
-               ossimDpt gsd;
-               gsd.makeNan();
-               ossim_float64 d;
-               if ( getXRes(d) )
-               {
-                  gsd.x = std::fabs(d);
-               }
-               if ( getYRes(d) )
-               {
-                  gsd.y = std::fabs(d);
-               }
-               ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(m_projection.get());
-               if (mapProj)
-               {
-                  ossimDrect rect;
-                  getBoundingBox(rect);
-                  if (mapProj->isGeographic())
-                  {
-                     ossimGpt tie(rect.ul().lat, rect.ul().lon);
-                     mapProj->setUlTiePoints(tie);
-                     mapProj->setDecimalDegreesPerPixel(gsd);
-                  }
-                  else
-                  {
-                     ossimDpt tie(rect.ul().x, rect.ul().y);
-                     ossimUnitType unitType = getUnitType();
-                     if ( unitType == OSSIM_US_SURVEY_FEET)
-                     {
-                        gsd = gsd * US_METERS_PER_FT;
-                        tie = tie * US_METERS_PER_FT;
-                     }
-                     else if ( unitType == OSSIM_FEET )
-                     {
-                        gsd = gsd * MTRS_PER_FT;
-                        tie = tie * MTRS_PER_FT;
-                     }
-                        
-                     mapProj->setUlTiePoints(tie);
-                     mapProj->setMetersPerPixel(gsd);
-                  }
-               }
-            }
-         }
-      }
-   }
-   return m_projection;
-}
-
-ossimUnitType ossimFgdcXmlDoc::getUnitType() const
-{
-   ossimUnitType result = OSSIM_METERS; // default
-   ossimString units;
-   if ( getPlanarDistantUnits(units) )
-   {
-      units.downcase();
-      if ( units.contains("feet") )
-      {
-         if ( units.contains("international") )
-         {
-            result = OSSIM_FEET;
-         }
-         else
-         {
-            result = OSSIM_US_SURVEY_FEET; // Default for feet.
-         }
-      }
-   }
-   return result;
-}
-
-bool ossimFgdcXmlDoc::isOpen() const
-{
-   return m_xmlDocument.valid();
-}
-
-bool ossimFgdcXmlDoc::getGeoCsn(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/horizsys/cordsysn/geogcsn";
-   return getPath(xpath, s);
-}
-
-bool ossimFgdcXmlDoc::getProjCsn(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/horizsys/cordsysn/projcsn";
-   return getPath(xpath, s);
-}
-
-bool ossimFgdcXmlDoc::getAltitudeDistantUnits(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/vertdef/altsys/altunits";
-   return getPath(xpath, s);
-}
-
-bool ossimFgdcXmlDoc::getGridCoordinateSystem(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/horizsys/planar/gridsys/gridsysn";
-   return getPath(xpath, s);
-}
-
-ossimRefPtr<ossimProjection> ossimFgdcXmlDoc::getGridCoordSysProjection()
-{
-   static const char M[] = "ossimFgdcXmlDoc::getGridCoordSysProjection";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-
-   if ( m_projection.valid() == false )
-   {
-      ossimString s;
-      if ( getGridCoordinateSystem(s) )
-      {
-         ossimString gridsysn = s.downcase();
-         if ( getHorizontalDatum(s) )
-         {
-            ossimString horizdn = s.downcase();
-            const ossimDatum* datum = createOssimDatum(s); // throws exception
-            
-            if ( gridsysn == "universal transverse mercator" )
-            {
-               // Get the zone:
-               if ( getUtmZone(s) )
-               {
-                  ossim_int32 zone = s.toInt32();
-
-                  //---
-                  // Note: Contruct with an origin with our datum.
-                  // "proj->setDatum" does not change the origin's datum.
-                  // This ensures theossimEpsgProjectionDatabase::findProjectionCode
-                  // sets the psc code correctly down the line.
-                  //---
-                  ossimRefPtr<ossimUtmProjection> utmProj =
-                     new ossimUtmProjection( *(datum->ellipsoid()), ossimGpt(0.0,0.0,0.0,datum) );
-                  utmProj->setDatum(datum);
-                  utmProj->setZone(zone);
-                  
-                  // Hemisphere( North false easting = 0.0, South = 10000000):
-                  bool tmpResult = getUtmFalseNorthing(s);
-                  if ( tmpResult && ( s != "0.0" ) )
-                  {
-                     utmProj->setHemisphere('S');
-                  }
-                  else
-                  {
-                     utmProj->setHemisphere('N');
-                  }
-                  utmProj->setPcsCode(0);
-
-                  ossim_float64 xRes = 0.0;
-                  ossim_float64 yRes = 0.0;
-                  if (getXRes(xRes) && getYRes(yRes))
-                  {
-                     ossimDrect rect;
-                     getBoundingBox(rect);
-
-                     ossimDpt gsd(std::fabs(xRes), std::fabs(yRes));
-                     ossimUnitType unitType = getUnitType();
-                   
-                     if (m_boundInDegree)
-                     {
-                        ossimGpt tieg(rect.ul().lat, rect.ul().lon);
-                        utmProj->setUlTiePoints(tieg);
-                     }
-                     else
-                     {
-                        ossimDpt tie(rect.ul().x, rect.ul().y);
-                        if ( unitType == OSSIM_US_SURVEY_FEET)
-                        {
-                           tie = tie * US_METERS_PER_FT;
-                        }
-                        else if ( unitType == OSSIM_FEET )
-                        {
-                           tie = tie * MTRS_PER_FT;
-                        }
-                        utmProj->setUlTiePoints(tie);
-                     }
-
-                     if ( unitType == OSSIM_US_SURVEY_FEET)
-                     {
-                        gsd = gsd * US_METERS_PER_FT;
-                     }
-                     else if ( unitType == OSSIM_FEET )
-                     {
-                        gsd = gsd * MTRS_PER_FT;
-                     }
-                     utmProj->setMetersPerPixel(gsd);
-                  }
-                  m_projection = utmProj.get(); // Capture projection.
-               }
-               else
-               {
-                  std::string errMsg = M;
-                  errMsg += " ERROR: Could not determine utm zone!";
-                  throw ossimException(errMsg);
-               }
-            }
-         }
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      if ( m_projection.valid() )
-      {
-         m_projection->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exiting...\n";
-   }
-   return m_projection;
-}
-
-
-bool ossimFgdcXmlDoc::getHorizontalDatum(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/horizsys/geodetic/horizdn";
-   return getPath(xpath, s);
-}
-
-bool ossimFgdcXmlDoc::getPlanarDistantUnits(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/horizsys/planar/planci/plandu";
-   return getPath(xpath, s);
-}
-
-bool ossimFgdcXmlDoc::getUtmFalseNorthing(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/horizsys/planar/gridsys/utm/transmer/fnorth";
-   return getPath(xpath, s); 
-}
-
-bool ossimFgdcXmlDoc::getUtmZone(ossimString& s) const
-{
-   ossimString xpath = "/metadata/spref/horizsys/planar/gridsys/utm/utmzone";
-   return getPath(xpath, s); 
-}
-
-bool ossimFgdcXmlDoc::getXRes(ossim_float64& v) const
-{
-   ossimString xpath = "/metadata/spdoinfo/rastinfo/rastxsz";
-   if (getPath(xpath, v) == false)
-   {
-      xpath = "/metadata/spref/horizsys/planar/planci/coordrep/absres";
-   }
-   return getPath(xpath, v);
-}
-
-bool ossimFgdcXmlDoc::getYRes(ossim_float64& v) const
-{
-   ossimString xpath = "/metadata/spdoinfo/rastinfo/rastysz";
-   if (getPath(xpath, v) == false)
-   {
-      xpath = "/metadata/spref/horizsys/planar/planci/coordrep/ordres";
-   }
-   return getPath(xpath, v);
-}
-
-bool ossimFgdcXmlDoc::getImageSize(ossimIpt& size) const
-{
-   bool result = false;
-   if (  m_xmlDocument.valid() )
-   {
-      ossimString xpath = "/metadata/spatRepInfo/GridSpatRep/axDimProps/Dimen/dimSize";
-      vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
-      m_xmlDocument->findNodes(xpath, xml_nodes);
-      if (xml_nodes.size() > 1)
-      {
-         size.x = xml_nodes[0]->getText().toInt32();
-         size.y = xml_nodes[1]->getText().toInt32();
-         result = true;
-      }
-
-      if (result == false)
-      {
-         xpath = "/metadata/spdoinfo/rastinfo/colcount";
-         ossim_float64 x = 0.0;
-         result = getPath(xpath, x);
-         if (result)
-         {
-            size.x = (ossim_int32)x;
-         }
-         xpath = "/metadata/spdoinfo/rastinfo/rowcount";
-         ossim_float64 y = 0.0;
-         result = getPath(xpath, y);
-         if (result)
-         {
-            size.y = (ossim_int32)y;
-         }
-      }
-   }
-   return result;
-}
-
-void ossimFgdcXmlDoc::getBoundingBox(ossimDrect& rect) const
-{
-   rect.makeNan();
-   
-   if (isOpen())
-   {
-      double ll_lat = 0.0;
-      double ll_lon = 0.0;
-      double lr_lat = 0.0;
-      double lr_lon = 0.0;
-      double ul_lat = 0.0;
-      double ul_lon = 0.0;
-      double ur_lat = 0.0;
-      double ur_lon = 0.0;
-     
-      ossimString xpath = "/metadata/idinfo/spdom/lboundng/leftbc";
-      bool result = getPath(xpath, ul_lon);
-      if (!result)
-      {
-         xpath = "/metadata/idinfo/spdom/bounding/westbc";
-         result = getPath(xpath, ul_lon);
-         m_boundInDegree = true;
-      }
-      if (result)
-      {
-         ll_lon = ul_lon;
-      }
-      
-      xpath = "/metadata/idinfo/spdom/lboundng/rightbc";
-      result = getPath(xpath, ur_lon);
-      if (!result)
-      {
-         xpath = "/metadata/idinfo/spdom/bounding/eastbc";
-         result = getPath(xpath, ur_lon);
-         m_boundInDegree = true;
-      }
-      if (result)
-      {
-         lr_lon = ur_lon;
-      }
-
-      xpath = "/metadata/idinfo/spdom/lboundng/bottombc";
-      result = getPath(xpath, ll_lat);
-      if (!result)
-      {
-         xpath = "/metadata/idinfo/spdom/bounding/southbc";
-         result = getPath(xpath, ll_lat);
-         m_boundInDegree = true;
-      }
-      if (result)
-      {
-         lr_lat = ll_lat;
-      }
-
-      xpath = "/metadata/idinfo/spdom/lboundng/topbc";
-      result = getPath(xpath, ul_lat);
-      if (!result)
-      {
-         xpath = "/metadata/idinfo/spdom/bounding/northbc";
-         result = getPath(xpath, ul_lat);
-         m_boundInDegree = true;
-      }
-      if (result)
-      {
-         ur_lat = ul_lat;
-      }
-      
-      rect = ossimDrect(ossimDpt(ul_lon, ul_lat),
-                        ossimDpt(ur_lon, ur_lat),
-                        ossimDpt(lr_lon, lr_lat),
-                        ossimDpt(ll_lon, ll_lat), OSSIM_RIGHT_HANDED); 
-   }
-}
-
-ossim_uint32 ossimFgdcXmlDoc::getNumberOfBands()
-{
-   ossim_uint32 numOfBands = 0;
-   ossimString s;
-   ossimString xpath = "/metadata/spdoinfo/rastinfo/vrtcount";
-   if (getPath(xpath, s))
-   {
-      numOfBands = s.toInt();
-   }
-   return numOfBands;
-}
-
-bool ossimFgdcXmlDoc::getPath(const ossimString& path, ossimString& s) const
-{
-   static const char M[] = "ossimFgdcXmlDoc::getPath";
-   
-   bool result = false;
-   if ( m_xmlDocument.valid() )
-   {
-      std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
-      m_xmlDocument->findNodes(path, xnodes);
-      if ( xnodes.size() == 1 ) // Error if more than one.
-      {
-         if ( xnodes[0].valid() )
-         {
-            s = xnodes[0]->getText();
-            result = true;
-         }
-         else
-         {
-            if(traceDebug())
-            {
-               
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << M << " ERROR:\n"
-                  << "Node not found: " << path
-                  << std::endl;
-            }
-         }
-      }
-      else if ( xnodes.size() == 0 )
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << M << " ERROR:\nNode not found: " << path
-               << std::endl;
-         }
-      }
-      else
-      {
-         if(traceDebug())
-         {
-            
-            ossimNotify(ossimNotifyLevel_WARN)
-               << M << " ERROR:\nMultiple nodes found: " << path << std::endl;
-         }
-      }
-   }
-   if (!result)
-   {
-      s.clear();
-   }
-   return result;      
-}
-   
-bool ossimFgdcXmlDoc::getPath(const ossimString& path, ossim_float64& v) const
-{
-   ossimString s;
-   bool result = getPath(path, s);
-   if ( result )
-   {
-      v = s.toFloat64();
-   }
-   return result;
-}
-
-const ossimDatum* ossimFgdcXmlDoc::createOssimDatum(const ossimString& s) const
-{
-   ossimString horizdn = s.downcase();
-   ossimString datumCode;
-   if ( horizdn == "north american datum of 1983" )
-   {
-      datumCode = "NAR-C";
-   }
-   else if ( horizdn == "north american datum of 1927" )
-   {
-      datumCode = "NAS-C";
-   }
-   else if ( horizdn == "wgs84")
-   {
-      datumCode = "WGE";
-   }
-   else
-   {
-      std::string errMsg = "ossimFgdcXmlDoc::createOssimDatum ERROR: Unhandled datum: ";
-      errMsg += horizdn.string();
-      throw ossimException(errMsg);
-   }
-   return ossimDatumFactoryRegistry::instance()->create(datumCode);   
-}
-
diff --git a/ossim/src/ossim/support_data/ossimGeoTiff.cpp b/ossim/src/ossim/support_data/ossimGeoTiff.cpp
deleted file mode 100644
index fd7c7df..0000000
--- a/ossim/src/ossim/support_data/ossimGeoTiff.cpp
+++ /dev/null
@@ -1,2184 +0,0 @@
-//***************************************************************************
-// FILE: ossimGeoTiff.cpp
-//
-// License:  See top level LICENSE.txt file.
-//
-// Description:
-// 
-// Class definition for ossimGeoTiff which is designed to read and hold tag
-// information.
-//
-//***************************************************************************
-// $Id: ossimGeoTiff.cpp 21024 2012-05-30 08:45:13Z dburken $
-
-#include <ossim/support_data/ossimGeoTiff.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimErrorContext.h>
-#include <ossim/base/ossimGeoTiffCoordTransformsLut.h>
-#include <ossim/base/ossimGeoTiffDatumLut.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/projection/ossimTransMercatorProjection.h>
-#include <ossim/projection/ossimLambertConformalConicProjection.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-#include <ossim/projection/ossimEpsgProjectionDatabase.h>
-#include <ossim/projection/ossimStatePlaneProjectionInfo.h>
-#include <ossim/projection/ossimPolynomProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimBilinearProjection.h>
-#include <ossim/base/ossimTieGptSet.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/base/ossimUnitTypeLut.h>
-#include <tiff.h>
-#include <tiffio.h>
-#include <xtiffio.h>
-#include <geotiff.h>
-#include <geo_normalize.h>
-#include <geovalues.h>
-#include <string.h>
-#include <iomanip>
-#include <iterator>
-#include <sstream>
-#include <cstdlib>
-
-static const ossimGeoTiffCoordTransformsLut COORD_TRANS_LUT;
-static const ossimGeoTiffDatumLut DATUM_LUT;
-OpenThreads::Mutex ossimGeoTiff::theMutex;
-
-#ifdef OSSIM_ID_ENABLED
-static const char OSSIM_ID[] = "$Id: ossimGeoTiff.cpp 21024 2012-05-30 08:45:13Z dburken $";
-#endif
-
-//---
-// Static trace for debugging
-//---
-static ossimTrace traceDebug("ossimGeoTiff:debug");
-
-// Prototype, defined at bottom of this file. ArcMAP 9.2 bug workaround.
-ossim_uint16 getMetersEquivalentHarnCode(ossim_uint16 feet_harn_code);
-
-//---
-// This was created to remove/hide "libgetiff/geo_normalize.h" in ossimGeoTiff.h.
-//---
-class ossimPrivateGtifDef
-{
-public:
-   ossimPrivateGtifDef()
-      : m_defs(0)
-   {}
-   ~ossimPrivateGtifDef()
-   {
-      if ( m_defs )
-      {
-         delete m_defs;
-         m_defs = 0;
-      }
-   }
-   GTIFDefn* m_defs;
-};
-
-//*************************************************************************************************
-// CONSTRUCTOR
-//*************************************************************************************************
-ossimGeoTiff::ossimGeoTiff()
-   :
-      theTiffPtr(0),
-      theGeoKeyOffset(0),
-      theGeoKeyLength(0),
-      theGeoKeysPresentFlag(false),
-      theZone(0),
-      theHemisphere("N"),
-      theProjectionName("unknown"),
-      theDatumName("unknown"),
-      theScale(),
-      theTiePoint(),
-      theModelTransformation(),
-      theWidth(0),
-      theLength(0),
-      theBitsPerSample(),
-      theModelType(0),
-      theRasterType(UNDEFINED),
-      theGcsCode(0),
-      theDatumCode(0),
-      theAngularUnits(0),
-      thePcsCode(0),
-      thePcsCitation(),
-      theCoorTransGeoCode(0),
-      theLinearUnitsCode(UNDEFINED),
-      theStdPar1(0.0),
-      theStdPar2(0.0),
-      theOriginLon(0.0),
-      theOriginLat(0.0),
-      theFalseEasting(0.0),
-      theFalseNorthing(0.0),
-      theScaleFactor(0.0),
-      thePrivateDefinitions(new ossimPrivateGtifDef())
-{
-}
-
-//*************************************************************************************************
-// CONSTRUCTOR
-//*************************************************************************************************
-ossimGeoTiff::ossimGeoTiff(const ossimFilename& file, ossim_uint32 entryIdx)
-   :
-      theTiffPtr(0),
-      theGeoKeyOffset(0),
-      theGeoKeyLength(0),
-      theGeoKeysPresentFlag(false),
-      theZone(0),
-      theHemisphere("N"),
-      theProjectionName("unknown"),
-      theDatumName("unknown"),
-      theScale(),
-      theTiePoint(),
-      theModelTransformation(),
-      theWidth(0),
-      theLength(0),
-      theBitsPerSample(),
-      theModelType(0),
-      theRasterType(UNDEFINED),
-      theGcsCode(0),
-      theDatumCode(0),
-      theAngularUnits(0),
-      thePcsCode(0),
-      thePcsCitation(),
-      theCoorTransGeoCode(0),
-      theLinearUnitsCode(UNDEFINED),
-      theStdPar1(0.0),
-      theStdPar2(0.0),
-      theOriginLon(0.0),
-      theOriginLat(0.0),
-      theFalseEasting(0.0),
-      theFalseNorthing(0.0),
-      theScaleFactor(0.0),
-      thePrivateDefinitions(new ossimPrivateGtifDef())
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimGeoTiff::ossimGeoTiff: Entered..." << std::endl;
-#ifdef OSSIM_ID_ENABLED
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimGeoTiff::ossimGeoTiff: OSSIM_ID =  "
-         << OSSIM_ID << endl;
-#endif      
-   }
-   
-   if(readTags(file, entryIdx) == false)
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimGeoTiff::ossimGeoTiff: "
-            << "Unable to reade tags."
-            << std::endl;
-      }
-      ossimNotify(ossimNotifyLevel_FATAL)
-         << "FATAL ossimGeoTiff::ossimGeoTiff: "
-         << "Unable to reade tags."
-         << std::endl;
-   }
-   if (traceDebug())
-   {
-      print(ossimNotify(ossimNotifyLevel_DEBUG));
-   }
-
-}
-
-ossimGeoTiff::~ossimGeoTiff()
-{
-   if(thePrivateDefinitions)
-   {
-      delete thePrivateDefinitions;
-      thePrivateDefinitions = 0;
-   }
-   if(theTiffPtr)
-   {
-      XTIFFClose(theTiffPtr);
-      theTiffPtr = 0;
-   }
-}
-
-int ossimGeoTiff::getPcsUnitType(ossim_int32 pcsCode) 
-{
-   int pcsUnits = ossimGeoTiff::UNDEFINED;
-   ossimUnitType units = OSSIM_UNIT_UNKNOWN; // default
-
-   // Need to instantiate a projection given the pcs code:
-   ossimMapProjection* proj = PTR_CAST(ossimMapProjection, 
-      ossimEpsgProjectionDatabase::instance()->findProjection(pcsCode));
-   if (proj)
-      units = proj->getProjectionUnits();
-   else   
-      return ossimGeoTiff::UNDEFINED;
-   
-   switch (units)
-   {
-      case OSSIM_METERS:
-         pcsUnits = ossimGeoTiff::LINEAR_METER;
-         break;
-      case OSSIM_FEET:
-         pcsUnits = ossimGeoTiff::LINEAR_FOOT;
-         break;
-      case OSSIM_US_SURVEY_FEET:
-         pcsUnits = ossimGeoTiff::LINEAR_FOOT_US_SURVEY;
-         break;
-      default:
-         break;
-   }
-
-   return pcsUnits;
-}
-
-#define EPSG_CODE_MAX 32767
-bool ossimGeoTiff::writeTags(TIFF* tifPtr,
-                             const ossimRefPtr<ossimMapProjectionInfo> projectionInfo,
-                             bool imagineNad27Flag)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-
-   const ossimMapProjection* mapProj = projectionInfo->getProjection();
-
-   if(!mapProj) return false;
-
-   GTIF* gtif = GTIFNew(tifPtr);
-
-    // Get some things we need throughout.
-   ossimGpt origin      = mapProj->origin();
-   double falseEasting  =  mapProj->getFalseEasting();
-   double falseNorthing =  mapProj->getFalseNorthing();
-   
-   ossimKeywordlist kwl;
-   mapProj->saveState(kwl);
-   const char* stdParallel1 = kwl.find(ossimKeywordNames::STD_PARALLEL_1_KW);
-   const char* stdParallel2 = kwl.find(ossimKeywordNames::STD_PARALLEL_2_KW);
-   const char* scaleFactor  = kwl.find(ossimKeywordNames::SCALE_FACTOR_KW);
-
-   bool gcsTypeSet = false;
-
-   //---
-   // Since using a pcs code is the easiest way to go, look for that first.
-   //---
-   ossim_int16 pcsCode = mapProj->getPcsCode();
-
-   //---
-   // Get the units now.  If user has overriden pcs units then go user defined
-   // projection by setting pcs code to 0.
-   //---
-   ossimString projName = mapProj->getClassName();
-   
-   int units = ossimGeoTiff::UNDEFINED;
-   if(mapProj->isGeographic())
-      units = ossimGeoTiff::ANGULAR_DEGREE;
-   else
-      units = getPcsUnitType(pcsCode);
-   if (units == UNDEFINED)
-      units = LINEAR_METER;
-
-   if (pcsCode)
-   {
-      if ((units==LINEAR_FOOT_US_SURVEY) || (units==LINEAR_FOOT))
-      {
-         // ArcMap 9.2 bug workaround (originally implemented by ESH 2008, reworked by OLK 04/2010
-         ossim_uint16 meter_pcs = getMetersEquivalentHarnCode(pcsCode);
-         if (meter_pcs)
-            pcsCode = meter_pcs;
-      }
-
-      //int gcs_code = mapProj->getGcsCode();
-      int datum_code = USER_DEFINED;
-      int ellipsoid_code = USER_DEFINED;
-      const ossimDatum* datum = mapProj->getDatum();
-      if (datum)
-      {
-         datum_code = (int) datum->epsgCode();
-         const ossimEllipsoid* ellipsoid = datum->ellipsoid();
-         if (ellipsoid)
-            ellipsoid_code = ellipsoid->getEpsgCode();
-      }
-      
-      if(mapProj->isGeographic())
-         GTIFKeySet(gtif, GeographicTypeGeoKey,    TYPE_SHORT, 1, pcsCode);
-
-      GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1, datum_code);
-      GTIFKeySet(gtif, ProjectionGeoKey ,       TYPE_SHORT, 1, pcsCode);
-      GTIFKeySet(gtif, GeogEllipsoidGeoKey,     TYPE_SHORT, 1, ellipsoid_code);
-      GTIFKeySet(gtif, ProjectedCSTypeGeoKey,   TYPE_SHORT, 1, pcsCode);
-   }
-   else
-   {
-      ossimString datumCode = "WGE";
-      ossimString datumName = "WGE";
-      // Attemp to get the datum code
-      const ossimDatum* datum = mapProj->getDatum();
-      if(datum)
-      {
-         datumCode = datum->code();
-         datumName = datum->name();
-      }
-
-      short gcs = USER_DEFINED;
-
-      if (datumCode == "WGE") gcs = GCS_WGS_84;
-      else if (datumCode == "WGD") gcs = GCS_WGS_72;
-      else if (datumCode == "NAR-C") gcs = GCS_NAD83;
-      else if (datumCode == "NAR") gcs = GCS_NAD83;
-      else if (datumCode == "NAS-C") gcs = GCS_NAD27;
-      else if (datumCode == "NAS") gcs = GCS_NAD27;
-      else if (datumCode == "ADI-M") gcs = GCS_Adindan;
-      else if (datumCode == "ARF-M") gcs = GCS_Arc_1950;
-      else if (datumCode == "ARS-M") gcs = GCS_Arc_1960;
-      else if (datumCode == "EUR-7" || datumCode == "EUR-M") gcs = GCS_ED50;
-      else if ((datumCode == "OGB-7") ||
-               (datumCode == "OGB-M") ||
-               (datumCode == "OGB-A") ||
-               (datumCode == "OGB-B") ||
-               (datumCode == "OGB-C") ||
-               (datumCode == "OGB-D")) gcs = GCS_OSGB_1936;
-      else if (datumCode == "TOY-M") gcs = GCS_Tokyo;
-      else if(datumCode == "6055") gcs = 3785; // this is a special google datum so we will give it a gcs code of 3785
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "DATUM = " << datumCode << " tag not written " << std::endl
-               << "Please let us know so we can add it"          << std::endl;
-         }
-      }
-
-      // ***
-      // ERDAS Imagine < v8.7 has a NAD27 Conus Bug.  They are not using the
-      // proper GCS code.  They use user-defined fields and Geog citation tag to
-      // define.  Sucks!  It is an open issue at Leica.  This is a work around
-      // flag for this issue.
-      // ***
-      if((datumCode == "NAS-C") && imagineNad27Flag)
-      {
-         gcs = USER_DEFINED;
-
-         std::ostringstream os;
-         os << "IMAGINE GeoTIFF Support\nCopyright 1991 -  2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 21024 $ $Date: 2012-05-30 04:45:13 -0400 (Wed, 30 May 2012) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)";
-
-         GTIFKeySet(gtif,
-                    GeogCitationGeoKey,
-                    TYPE_ASCII,
-                    1,
-                    os.str().c_str());
-
-         // User-Defined
-         GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,
-                    KvUserDefined );
-         // User-Defined
-         GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT, 1,
-                    KvUserDefined );
-      }
-      else
-      {
-      GTIFKeySet( gtif, GeographicTypeGeoKey, TYPE_SHORT, 1, gcs );
-      gcsTypeSet = true;
-      }
-
-      // Write the projection parameters.
-
-      bool setFalseEastingNorthingFlag = false;
-      
-      if ( projName == "ossimUtmProjection" )
-      {
-         //---
-         // UTM tags needed example from the geo tiff spec page:
-         // ModelTiepointTag       = (0, 0, 0,  350807.4, 5316081.3, 0.0)
-         // ModelPixelScaleTag     = (100.0, 100.0, 0.0)
-         // GeoKeyDirectoryTag:
-         //       GTModelTypeGeoKey        =  1      (ModelTypeProjected)
-         //       GTRasterTypeGeoKey       =  1      (RasterPixelIsArea)
-         //       ProjectedCSTypeGeoKey    =  32660  (PCS_WGS84_UTM_zone_60N)
-         //       PCSCitationGeoKey        =  "UTM Zone 60 N with WGS84"
-         //
-         // NOTE:
-         // The "ProjectedCSTypeGeoKey" can be constructed using the map zone
-         // and the datum.
-         //---
-         const ossimUtmProjection* utmProjection = dynamic_cast<const ossimUtmProjection*>(mapProj);
-
-         // Attempt to get the pcs key.
-         int mapZone = utmProjection->getZone();
-         ossimString hemisphere = utmProjection->getHemisphere();
-         short projSysCode=0;
-
-         //---
-         // Use a projection code that does not imply a datum.
-         // See section "6.3.3.2 Projection Codes" for definition.
-         //---
-         if (mapZone > 0) // Northern hemisphere.
-         {
-            projSysCode = 16000 + mapZone;
-         }
-         else if (mapZone < 0) // Southern hemisphere.
-         {
-            hemisphere = "S";
-            projSysCode = 16100 + abs(mapZone);
-         }
-         
-         // Set the Projected Coordinate System Type to be user defined.
-         GTIFKeySet(gtif,
-                    ProjectedCSTypeGeoKey,
-                    TYPE_SHORT,
-                    1,
-                    USER_DEFINED);
-
-         if ( !gcsTypeSet )
-         {
-            // Set the geographic type to be user defined.
-            GTIFKeySet(gtif,
-                       GeographicTypeGeoKey,
-                       TYPE_SHORT,
-                       1,
-                       USER_DEFINED);
-         }
-         
-         // Set the ProjectionGeoKey in place of the ProjectedCSTypeGeoKey.
-         GTIFKeySet(gtif,
-                    ProjectionGeoKey,
-                    TYPE_SHORT,
-                    1,
-                    projSysCode);
-
-         std::ostringstream os;
-         os << "UTM Zone " << dec << mapZone << hemisphere.c_str()
-            << " with " << datumName << " datum";
-         
-         GTIFKeySet(gtif,
-                    PCSCitationGeoKey,
-                    TYPE_ASCII,
-                    1,
-                    os.str().c_str());
-         
-      } // End of "if ( projName == "ossimUtmProjection" )
-      
-      else if(projName == "ossimBngProjection")
-      {
-         // User-Defined
-         GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
-		    PCS_BRITISH_NATIONAL_GRID);//KvUserDefined );
-         
-         // User-Defined
-         GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1,
-		    KvUserDefined );
-         
-         GTIFKeySet(gtif,
-                    PCSCitationGeoKey,
-                    TYPE_ASCII,
-                    26,
-                    "PCS_British_National_Grid");
-         
-         GTIFKeySet(gtif,
-                    ProjCoordTransGeoKey,
-                    TYPE_SHORT,
-                    1,
-                    (uint16)CT_TransverseMercator);
-         
-         GTIFKeySet(gtif,
-		    ProjNatOriginLongGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.lond());
-         
-         GTIFKeySet(gtif,
-		    ProjNatOriginLatGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.latd());
-
-         setFalseEastingNorthingFlag = true;
-
-         double scale = ossimString(scaleFactor).toDouble();
-
-         GTIFKeySet(gtif,
-                    ProjScaleAtNatOriginGeoKey,
-                    TYPE_DOUBLE,
-                    1,
-                    scale);
-      }
-      else if( projName == "ossimSinusoidalProjection")
-      {
-         GTIFKeySet(gtif,
-                    ProjCoordTransGeoKey,
-                    TYPE_SHORT,
-                    1,
-                    (uint16)CT_Sinusoidal);
-         
-         GTIFKeySet(gtif,
-		    ProjNatOriginLongGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.lond());
-
-         GTIFKeySet(gtif,
-		    ProjNatOriginLatGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.latd());
-
-         setFalseEastingNorthingFlag = true;
-      }
-      else if( (projName == "ossimEquDistCylProjection")||
-               (projName == "ossimLlxyProjection"))
-      {
-         GTIFKeySet(gtif,
-		    ProjNatOriginLongGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.lond());
-         
-         GTIFKeySet(gtif,
-		    ProjNatOriginLatGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.latd());
-      }
-      else if ( (projName == "ossimLambertConformalConicProjection") ||
-                (projName == "ossimAlbersProjection") )
-      {
-         //---
-         // Lambert Conformal Conic:
-         // tags needed example from the geo tiff spec page:
-         // ModelTiepointTag     = (  80,  100, 0,  200000,  1500000, 0)
-         // ModelPixelScaleTag         = (1000, 1000, 0)
-         // GeoKeyDirectoryTag:
-         //       GTModelTypeGeoKey           =  1     (ModelTypeProjected)
-         //       GTRasterTypeGeoKey          =  1     (RasterPixelIsArea)
-         //       GeographicTypeGeoKey        =  4267  (GCS_NAD27)
-         //       ProjectedCSTypeGeoKey       =  32767 (user-defined)
-         //       ProjectionGeoKey            =  32767 (user-defined)
-         //       ProjLinearUnitsGeoKey       =  9001     (Linear_Meter)
-         //       ProjCoordTransGeoKey        =  8 (CT_LambertConfConic_2SP)
-         //            ProjStdParallel1GeoKey     =  41.333
-         //            ProjStdParallel2GeoKey     =  48.666
-         //            ProjCenterLongGeoKey       =-120.0
-         //            ProjNatOriginLatGeoKey     =  45.0
-         //            ProjFalseEastingGeoKey,    = 200000.0
-         //            ProjFalseNorthingGeoKey,   = 1500000.0
-         //
-         // NOTE: Albers Same as Lambert with the exception of the
-         //       ProjCoordTransGeoKey which is:  CT_AlbersEqualArea.
-         //---
-         
-         if (projName == "ossimLambertConformalConicProjection")
-         {
-            GTIFKeySet(gtif,
-                       ProjCoordTransGeoKey,
-                       TYPE_SHORT,
-                       1,
-                       (uint16)CT_LambertConfConic_2SP );
-         }
-         else // Albers
-         {
-            GTIFKeySet(gtif,
-                       ProjCoordTransGeoKey,
-                       TYPE_SHORT,
-                       1,
-                       (uint16)CT_AlbersEqualArea);
-         }
-         
-         // User-Defined
-         GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
-                    KvUserDefined );
-
-         // User-Defined
-         GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1,
-		    KvUserDefined );
-
-         double phi1 = ossimString(stdParallel1).toDouble();
-
-         GTIFKeySet(gtif,
-		    ProjStdParallel1GeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    phi1);  // 1st parallel
-
-         double phi2 = ossimString(stdParallel2).toDouble();
-
-         GTIFKeySet(gtif,
-		    ProjStdParallel2GeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    phi2);  // 2nd parallel
-
-         GTIFKeySet(gtif,
-		    ProjCenterLongGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.lond());  // Longitude at the origin.
-
-         GTIFKeySet(gtif,
-		    ProjNatOriginLatGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.latd());  // Origin
-
-         setFalseEastingNorthingFlag = true;
-
-      }  // End of Lambert.
-
-
-      else if ( projName == "ossimMercatorProjection" )
-      {
-         GTIFKeySet(gtif,
-                    ProjCoordTransGeoKey,
-                    TYPE_SHORT,
-                    1,
-                    (uint16)CT_Mercator);
-         
-         GTIFKeySet(gtif,
-		    ProjNatOriginLongGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.lond());
-
-         GTIFKeySet(gtif,
-		    ProjNatOriginLatGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.latd());
-
-         setFalseEastingNorthingFlag = true;
-
-         double scale = ossimString(scaleFactor).toDouble();
-
-         GTIFKeySet(gtif,
-                    ProjScaleAtNatOriginGeoKey,
-                    TYPE_DOUBLE,
-                    1,
-                    scale);
-      }
-      else if ( projName == "ossimTransMercatorProjection" )
-      {
-         //---
-         // Transverse Mercator ( no example in the geo tiff spec.
-         // Requires:
-         //    - latitude/longitude of the origin
-         //    - easting/northing of some tie point(line/sample 0,0)
-         //    - false easting/northing
-         //    - The scale factor.
-         //---
-
-         //---
-         // The easting/northing is the distance from the origin plus the
-         // false easting/northing.  In other words if line 0 is 5,000
-         // meters from the origin and the false northing is 5,000 meters,
-         // then the northing would be 10,000.  The same goes for the easting.
-         //---
-         GTIFKeySet(gtif,
-                    ProjCoordTransGeoKey,
-                    TYPE_SHORT,
-                    1,
-                    (uint16)CT_TransverseMercator);
-         
-         // User-Defined
-         GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, KvUserDefined );
-         
-         // User-Defined
-         GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1, KvUserDefined );
-         
-         GTIFKeySet(gtif,
-		    ProjNatOriginLongGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.lond());
-
-         GTIFKeySet(gtif,
-		    ProjNatOriginLatGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    origin.latd());
-
-         setFalseEastingNorthingFlag = true;
-
-         double scale = ossimString(scaleFactor).toDouble();
-
-         GTIFKeySet(gtif,
-                    ProjScaleAtNatOriginGeoKey,
-                    TYPE_DOUBLE,
-                    1,
-                    scale);
-      } // End of TM
-
-      if (setFalseEastingNorthingFlag == true)
-      {
-
-         GTIFKeySet(gtif,
-		    ProjFalseEastingGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    falseEasting);
-
-         GTIFKeySet(gtif,
-		    ProjFalseNorthingGeoKey,
-		    TYPE_DOUBLE,
-		    1,
-		    falseNorthing);
-      }
-   }
-
-   //---
-   // Set the model type and units.
-   //---
-   if (units == ossimGeoTiff::ANGULAR_DEGREE)
-   {
-      GTIFKeySet(gtif,
-         GTModelTypeGeoKey,
-         TYPE_SHORT,
-         1,
-         ModelTypeGeographic);
-
-      // Set the units key.
-      GTIFKeySet(gtif,
-         GeogAngularUnitsGeoKey,
-         TYPE_SHORT,
-         1,
-         units);
-   }
-   else
-   {
-      GTIFKeySet(gtif,
-         GTModelTypeGeoKey,
-         TYPE_SHORT,
-         1,
-         ModelTypeProjected);
-
-      // Set the units key.
-      GTIFKeySet(gtif,
-         ProjLinearUnitsGeoKey,
-         TYPE_SHORT,
-         1,
-         units);
-   }
-
-   // Set the ellipsoid major/minor axis.
-   GTIFKeySet(gtif,
-              GeogSemiMajorAxisGeoKey,
-              TYPE_DOUBLE,
-              1,
-              mapProj->getA());
-
-   GTIFKeySet(gtif,
-              GeogSemiMinorAxisGeoKey,
-              TYPE_DOUBLE,
-              1,
-              mapProj->getB());
-
-   // Set the pixel type.
-   if (projectionInfo->getPixelType() == OSSIM_PIXEL_IS_POINT)
-   {
-      // Tie point relative to center of pixel.
-      GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsPoint);
-   }
-   else
-   {
-      // Tie point relative to upper left corner of pixel
-      GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
-   }
-
-   //---
-   // Set the tie point and scale.
-   //---
-   double  tiePoints[6]  = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
-   double  pixScale[3]   = { 0.0, 0.0, 0.0 };
-   switch (units)
-   {
-      case LINEAR_FOOT:
-      {
-         tiePoints[3]  = ossim::mtrs2ft(projectionInfo->ulEastingNorthingPt().x);
-         tiePoints[4]  = ossim::mtrs2ft(projectionInfo->ulEastingNorthingPt().y);
-         pixScale[0]   = ossim::mtrs2ft(projectionInfo->getMetersPerPixel().x);
-         pixScale[1]   = ossim::mtrs2ft(projectionInfo->getMetersPerPixel().y);
-         falseEasting  = ossim::mtrs2ft(falseEasting);
-         falseNorthing = ossim::mtrs2ft(falseNorthing);
-
-         break;
-      }
-      case LINEAR_FOOT_US_SURVEY:
-      {
-         tiePoints[3]  = ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().x);
-         tiePoints[4]  = ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().y);
-         pixScale[0]   = ossim::mtrs2usft(projectionInfo->getMetersPerPixel().x);
-         pixScale[1]   = ossim::mtrs2usft(projectionInfo->getMetersPerPixel().y);
-         falseEasting  = ossim::mtrs2usft(falseEasting);
-         falseNorthing = ossim::mtrs2usft(falseNorthing);
-         break;
-      }
-      case ANGULAR_DEGREE:
-      {
-         tiePoints[3] = projectionInfo->ulGroundPt().lond();
-         tiePoints[4] = projectionInfo->ulGroundPt().latd();
-         pixScale[0]  = projectionInfo->getDecimalDegreesPerPixel().x;
-         pixScale[1]  = projectionInfo->getDecimalDegreesPerPixel().y;
-         break;
-      }
-      case LINEAR_METER:
-      default:
-      {
-         tiePoints[3] = projectionInfo->ulEastingNorthingPt().x;
-         tiePoints[4] = projectionInfo->ulEastingNorthingPt().y;
-         pixScale[0]  = projectionInfo->getMetersPerPixel().x;
-         pixScale[1]  = projectionInfo->getMetersPerPixel().y;
-         break;
-      }
-
-   } // End of "switch (units)"
-
-   TIFFSetField( tifPtr, TIFFTAG_GEOTIEPOINTS,  6, tiePoints );
-   TIFFSetField( tifPtr, TIFFTAG_GEOPIXELSCALE, 3, pixScale );
-
-
-   GTIFWriteKeys(gtif); // Write out geotiff tags.
-   GTIFFree(gtif);
-
-   return true;
-}
-
-bool ossimGeoTiff::writeJp2GeotiffBox(const ossimFilename& tmpFile,
-                                      const ossimIrect& rect,
-                                      const ossimProjection* proj,
-                                       std::vector<ossim_uint8>& buf,
-                                       ossimPixelType pixelType )
-{
-   //---
-   // Snip from The "GeoTIFF Box" Specification for JPEG 2000 Metadata:
-   // This box contains a valid GeoTIFF image.  The image is "degenerate", in
-   // that it represents a very simple image with specific constraints:
-   // . the image height and width are both 1
-   // . the datatype is 8-bit
-   // . the colorspace is grayscale
-   // . the (single) pixel must have a value of 0 for its (single) sample
-   //
-   // NOTE: It also states little endian but I think libtiff writes whatever
-   // endianesss the host is.
-   //
-   // Also assuming class tiff for now.  Not big tiff.
-   //---
-   bool result = true;
-   
-   TIFF* tiff = XTIFFOpen(tmpFile.c_str(), "w");
-   if (tiff)
-   {
-      // Write the projection info out.
-      ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);
-      if(mapProj)
-      {
-         ossimRefPtr<ossimMapProjectionInfo> projectionInfo
-	   = new ossimMapProjectionInfo(mapProj, ossimDrect(rect));
-
-         // Set the pixel type to point of area.
-         projectionInfo->setPixelType(pixelType);
-
-         // Write the geotiff keys.
-         ossimGeoTiff::writeTags(tiff, projectionInfo, false);
-      }
-
-      // Basic tiff tags.
-      TIFFSetField( tiff, TIFFTAG_IMAGEWIDTH, 1 );
-      TIFFSetField( tiff, TIFFTAG_IMAGELENGTH, 1 );
-      TIFFSetField( tiff, TIFFTAG_BITSPERSAMPLE, 8 );
-      TIFFSetField( tiff, TIFFTAG_SAMPLESPERPIXEL, 1 );
-      TIFFSetField( tiff, TIFFTAG_ROWSPERSTRIP, 1 );
-      TIFFSetField( tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG );
-      TIFFSetField( tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK );
-
-      // One pixel image:
-      ossim_uint8 pixel = 0;
-      TIFFWriteEncodedStrip( tiff, 0, (char *) &pixel, 1 );
-
-      TIFFWriteDirectory( tiff );
-      XTIFFClose( tiff );
-
-      // Get the size.  Note 16 bytes added for the JP2 UUID:
-      const std::vector<ossim_uint8>::size_type UUID_SIZE = 16;
-      const std::vector<ossim_uint8>::size_type BOX_SIZE = UUID_SIZE +
-         static_cast<std::vector<ossim_uint8>::size_type>(tmpFile.fileSize());
-
-      // Create the buffer.
-      buf.resize( BOX_SIZE );
-
-      if ( BOX_SIZE == buf.size() )
-      {
-         const ossim_uint8 GEOTIFF_UUID[UUID_SIZE] = 
-         {
-            0xb1, 0x4b, 0xf8, 0xbd,
-            0x08, 0x3d, 0x4b, 0x43,
-            0xa5, 0xae, 0x8c, 0xd7,
-            0xd5, 0xa6, 0xce, 0x03
-         };
-
-         // Copy the UUID.
-         std::vector<ossim_uint8>::size_type i;
-         for (i = 0; i < UUID_SIZE; ++i)
-         {
-            buf[i] = GEOTIFF_UUID[i];
-         }
-
-         // Copy the tiff.
-         std::ifstream str;
-         str.open(tmpFile.c_str(), ios::in | ios::binary);
-         if (str.is_open())
-         {
-            char ch;
-            for (; i < BOX_SIZE; ++i)
-            {
-               str.get(ch);
-               buf[i] = static_cast<ossim_uint8>(ch);
-            }
-         }
-      }
-      else
-      {
-         result = false;
-      }
-
-      // Remove the temp file.
-      tmpFile.remove();
-      
-   }
-   else
-   {
-      result = false;
-      
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimGeoTiff::writeJp2GeotiffBox ERROR:\n"
-            << "Could not open " << tmpFile << std::endl;
-      }
-   }
-   return result;
-}
-
-bool ossimGeoTiff::readTags(const ossimFilename& file, ossim_uint32 entryIdx)
-{
-   bool result = false;
-   
-   TIFF* tiff = XTIFFOpen(file.c_str(), "r");
-   if(tiff)
-   {
-      result = readTags(tiff, entryIdx, true);
-   }
-
-   return result;
-}
-
-bool ossimGeoTiff::readTags(
-   TIFF* tiff, ossim_uint32 entryIdx, bool ownTiffPtrFlag)
-{
-   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
-
-   if ( !tiff )
-   {
-      return false;
-   }
-
-   if(!TIFFSetDirectory(tiff, (ossim_uint16)entryIdx))
-   {
-      return false;
-   }
-   
-   GTIF* gtif = GTIFNew(tiff);
-   if(!gtif)
-   {
-      return false;
-   }
-
-   if(theTiffPtr)
-   {
-      XTIFFClose(theTiffPtr);
-   }
-   theTiffPtr = tiff;
-   
-   if(thePrivateDefinitions->m_defs)
-   {
-      delete thePrivateDefinitions->m_defs;;
-   }
-   thePrivateDefinitions->m_defs = new GTIFDefn;
-   GTIFGetDefn(gtif, thePrivateDefinitions->m_defs);
-   ossim_uint32 idx = 0;
-   theGeoKeysPresentFlag = true;
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimGeoTiff::readTags: Raw Geotiff Tags are\n";
-      GTIFPrint(gtif,0,0);
-   }
-   if(TIFFGetField( theTiffPtr,
-                    TIFFTAG_IMAGELENGTH,
-                    &theLength ))
-   {
-   }
-   if(TIFFGetField( theTiffPtr,
-                    TIFFTAG_IMAGEWIDTH,
-                    &theWidth ))
-   {
-   }
-   theScaleFactor     = 0.0;
-   theModelType       = thePrivateDefinitions->m_defs->Model;
-   theGcsCode         = thePrivateDefinitions->m_defs->GCS;
-   thePcsCode         = thePrivateDefinitions->m_defs->PCS;
-   theDatumCode       = thePrivateDefinitions->m_defs->Datum;
-   theAngularUnits    = thePrivateDefinitions->m_defs->UOMAngle;
-   theLinearUnitsCode = thePrivateDefinitions->m_defs->UOMLength;
-
-   if (theAngularUnits == ANGULAR_DMS_HEMISPHERE)
-   {
-      //---
-      // Hack for bug, where the libgeotiff funtion GTIFGetDefn sets the angular units 
-      // incorrectly to ANGULAR_DMS_HEMISPHERE:
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << " WARNING ossimGeoTiff::addImageGeometry:"           
-            << "The angular units (key 2054) is set to ANGULAR_DMS_HEMISPHERE!"  
-            << "\nAssuming \"Angular_Degree\"..." << std::endl;
-      }
-      theAngularUnits = ANGULAR_DEGREE;  
-   }
-   
-#if 0
-   ossim_uint16 modelType;
-   if(GTIFKeyGet(gtif, GTModelTypeGeoKey, &modelType, 0, 1))
-   {
-      theModelType = (ModelType)modelType;
-   }
-#endif
-   if(GTIFKeyGet(gtif, GTRasterTypeGeoKey, &theRasterType, 0, 1))
-   {
-   }
-   
-#if 0
-   if(GTIFKeyGet(gtif, GeographicTypeGeoKey, &theGcsCode, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, GeogGeodeticDatumGeoKey, &theDatumCode, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, GeogAngularUnitsGeoKey, &theAngularUnits, 0, 1))
-   {
-   }
-#endif
-   
-   if (GTIFKeyGet(gtif, ProjectedCSTypeGeoKey, &thePcsCode, 0, 1))
-      parsePcsCode();
-   
-   //---
-   // ESH 2/2008 -- Handle geotiff's with state plane coordinate systems produced by ERDAS.
-   // They use the citation filed to specify the geometry (complete HACK by Erdas)
-   //---
-   else
-   {
-      const int CITATION_STRING_SIZE = 512;
-      char citationStr[CITATION_STRING_SIZE];
-      if ( GTIFKeyGet(gtif, GTCitationGeoKey,  &citationStr,
-                      0, CITATION_STRING_SIZE))
-      {
-         ossimString gTCitation = citationStr; // key 1026
-
-         // Extract state plane string from the citation key
-         ossimString projStrTemp =
-            gTCitation.afterRegExp( "Projection Name = " );
-         
-         ossimString projStr  = projStrTemp.beforeRegExp( "\n" );
-         if ( projStr.empty() == false )
-         {
-            ossimEpsgProjectionFactory* f = ossimEpsgProjectionFactory::instance();
-            ossimProjection* proj = f->createProjection(projStr);
-            ossimMapProjection* map_proj = PTR_CAST(ossimMapProjection, proj);
-            parseProjection(map_proj);
-         }
-      }  // End of "if(GTIFKeyGet(gtif, GTCitationGeoKey..."
-   }
-   
-   char* buf = 0;
-   theOriginLon = ossim::nan();
-   theOriginLat = ossim::nan();
-   if(GTIFKeyGet(gtif, PCSCitationGeoKey , &buf, 0, 1))
-   {
-      thePcsCitation = ossimString(buf);
-   }
-   GTIFKeyGet(gtif, ProjCoordTransGeoKey , &theCoorTransGeoCode, 0, 1);
-   for(idx = 0; idx < (ossim_uint32)thePrivateDefinitions->m_defs->nParms; ++idx)
-   {
-      switch(thePrivateDefinitions->m_defs->ProjParmId[idx])
-      {
-         case ProjStdParallel1GeoKey:
-         {
-            theStdPar1 = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjStdParallel2GeoKey:
-         {
-            theStdPar2 = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjOriginLongGeoKey:
-         {
-            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjOriginLatGeoKey:
-         {
-            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjFalseEastingGeoKey:
-         {
-            theFalseEasting = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjFalseNorthingGeoKey:
-         {
-            theFalseNorthing = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjCenterLongGeoKey:
-         {
-            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjCenterLatGeoKey:
-         {
-            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjFalseOriginLatGeoKey:
-         {
-            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjFalseOriginLongGeoKey:
-         {
-            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-         case ProjScaleAtNatOriginGeoKey:
-         {
-            theScaleFactor = thePrivateDefinitions->m_defs->ProjParm[idx];
-            break;
-         }
-      }
-   }
-   
-#if 0
-   if(GTIFKeyGet(gtif, ProjStdParallel1GeoKey, &theStdPar1, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, ProjStdParallel2GeoKey, &theStdPar2, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, ProjNatOriginLongGeoKey, &tempDouble, 0, 1))
-   {
-      theOriginLon = tempDouble;
-   }
-   else if(GTIFKeyGet(gtif, ProjOriginLongGeoKey, &tempDouble, 0, 1))
-   {
-      theOriginLon = tempDouble;
-   }
-   if(GTIFKeyGet(gtif, ProjNatOriginLatGeoKey, &tempDouble, 0, 1))
-   {
-      theOriginLat = tempDouble;
-   }
-   else if(GTIFKeyGet(gtif, ProjOriginLatGeoKey, &tempDouble, 0, 1))
-   {
-      theOriginLat = tempDouble;
-   }
-   if(GTIFKeyGet(gtif, ProjFalseEastingGeoKey, &theFalseEasting, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, ProjFalseNorthingGeoKey, &theFalseNorthing, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, ProjCenterLongGeoKey, &theCenterLon, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, ProjCenterLatGeoKey, &theCenterLat, 0, 1))
-   {
-   }
-   if(GTIFKeyGet(gtif, ProjScaleAtNatOriginGeoKey, &theScaleFactor, 0, 1))
-   {
-   }
-#endif
-   theScale.clear();
-   ossim_uint16 pixScaleSize = 0;
-   double* pixScale=0;
-   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOPIXELSCALE, &pixScaleSize, &pixScale))
-   {
-      theScale.insert(theScale.begin(), pixScale, pixScale+pixScaleSize);
-      if ( theModelType == ModelTypeGeographic )
-      {
-         // The origin latitude must be computed so as to achieve the proper horizontal scaling:
-         theOriginLat = ossim::acosd(theScale[1]/theScale[0]);
-      }
-   }
-   theTiePoint.clear();
-   ossim_uint16 tiePointSize = 0;
-   double* tiepoints=0;
-   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOTIEPOINTS,  &tiePointSize, &tiepoints))
-   {
-      theTiePoint.insert(theTiePoint.begin(), tiepoints, tiepoints+tiePointSize);
- 
-      // ESH 05/2009 -- If the image is in a projected coordinate system, the
-      // tiepoints will be projected coordinates not lat/lon. Let's avoid setting
-      // the origin lon/lat to projected x/y. Fix for ticket #711.
-      //if ( theModelType == ModelTypeGeographic )
-      //{
-      //   if(ossim::isnan(theOriginLon) && 
-      //      (pixScaleSize > 1) &&
-      //      (tiePointSize > 3))
-      //   {
-      //      theOriginLon = tiepoints[3] - tiepoints[0] * pixScale[0]; 
-      //   }
-      //   
-      //   if(ossim::isnan(theOriginLat) && (pixScaleSize > 1) && (tiePointSize > 3))
-      //   {
-      //      theOriginLat = tiepoints[4] + tiepoints[1] * fabs(pixScale[1]);
-      //   }
-      //}
-   }
-   theModelTransformation.clear();
-   ossim_uint16 transSize = 0;
-   double* trans = 0;
-   
-   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOTRANSMATRIX, &transSize, &trans))
-   {
-      theModelTransformation.insert(theModelTransformation.begin(),
-                                    trans, trans+transSize);
-   }
-//    if(!theTiePoint.size()&&(theModelTransform.size()==16))
-//    {
-//       // for now we will stuff the tie point with the model transform tie points.
-//       theTiePoint.push_back(0.0);
-//       theTiePoint.push_back(0.0);
-//       theTiePoint.push_back(0.0);
-//       theTiePoint.push_back(theModelTransformation[3]); 
-//       theTiePoint.push_back(theModelTransformation[7]);
-//       theTiePoint.push_back(0.0);
-//    }
-   ossim_uint16 doubleParamSize = 0;
-   double* tempDoubleParam = 0;
-   theDoubleParam.clear();
-   if(TIFFGetField(theTiffPtr, TIFFTAG_GEODOUBLEPARAMS, &doubleParamSize, &tempDoubleParam))
-   {
-      theDoubleParam.insert(theDoubleParam.begin(),
-                            tempDoubleParam,
-                            tempDoubleParam+doubleParamSize);
-   }
-
-   char* tempAsciiParam=0;
-   theAsciiParam = "";
-	
-	// Note: this tag does not have the setting set to return the size
-	// so this call is only a 3 argument call without a size parameter
-	if(TIFFGetField(theTiffPtr, TIFFTAG_GEOASCIIPARAMS, &tempAsciiParam))
-   {
-      theAsciiParam = tempAsciiParam;
-   }
-
-   if(theGeoKeysPresentFlag)
-   {
-      setOssimProjectionName();  // Initialize the ossim projection name.
-      setOssimDatumName();       // Initialize the ossim datum name.
-   }
-
-   // commenting this out.  Frank mentioned the GTIFFGetDefn which in geo_normalize
-   // this should be all we need.
-   //
-#if 0  
-   /* 
-      ESH 05/2009: Replacing badly broken code for making 
-      use of TIFFTAG_GEODOUBLEPARAMS.
-
-      Read the geokey directory tag in order to see how 
-      the TIFFTAG_GEODOUBLEPARAMS are defined.
-
-      For structure of geokey directory, see:
-      http://www.remotesensing.org/geotiff/spec/geotiff2.4.html
-   */
-   ossim_uint16  gkdParamSize = 0;
-   ossim_uint16* gkdParams = 0;
-   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOKEYDIRECTORY, &gkdParamSize, &gkdParams))
-   {
-      ossim_uint16 numKeys = gkdParams ? gkdParams[3] : 0;
-      ossim_uint16 key = 0;
-      for( key=0; key<numKeys; ++key )
-      {
-         ossim_uint16 loc = (key+1) * 4;
-         ossim_uint16 ind = gkdParams[loc+3];
-
-         if ( gkdParams[loc+1] == TIFFTAG_GEODOUBLEPARAMS && 
-              gkdParams[loc+2] == 1 && 
-              ind >= 0 && ind < doubleParamSize )
-         {
-            double dval = theDoubleParam[ind];
-            switch( gkdParams[loc] )
-            {
-               case ProjStdParallel1GeoKey:     theStdPar1       = dval; break;
-               case ProjStdParallel2GeoKey:     theStdPar2       = dval; break;
-               case ProjNatOriginLongGeoKey:    theOriginLon     = dval; break;
-               /* case ProjOriginLongGeoKey:       theOriginLon     = dval; break; (alias) */
-               case ProjNatOriginLatGeoKey:     theOriginLat     = dval; break;
-               /* case ProjOriginLatGeoKey:        theOriginLat     = dval; break; (alias) */
-               case ProjFalseEastingGeoKey:     theFalseEasting  = dval; break;
-               case ProjFalseNorthingGeoKey:    theFalseNorthing = dval; break;
-               case ProjCenterLongGeoKey:       theCenterLon     = dval; break;
-               case ProjCenterLatGeoKey:        theCenterLat     = dval; break;
-               case ProjScaleAtNatOriginGeoKey: theScaleFactor   = dval; break;
-               default: 
-                  if(traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_DEBUG)
-                        << "ossimGeoTiff::readTags: Unrecognized geokey directory entry."
-                        << "\ngeokey directory index = " << loc
-                        << "\ngeokey = " << gkdParams[loc]
-                        << "\ndouble array index = " << ind
-                        << "\ndval = " << dval
-                        << std::endl;
-                  }
-                  break;
-            }
-         }
-      }
-   }
-#endif
-
-   GTIFFree(gtif);
-
-   if (ownTiffPtrFlag == false)
-   {
-      //---
-      // Zero out the pointer so the destructor doesn't close it on some
-      // external code.
-      //---
-      theTiffPtr = 0;
-   }
-   
-   return true;
-}
-
-bool ossimGeoTiff::addImageGeometry(ossimKeywordlist& kwl, const char* prefix) const
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimGeoTiff::addImageGeometry: Entered............."
-         << std::endl;
-   }
-
-   // NOT SURE THIS IS A GOOD IDEA HERE. KEPT FOR LEGACY SAKE. (OLK 5/10)
-   if(theGcsCode == 3785)
-   {
-      ossimRefPtr<ossimProjection> proj = 
-         ossimProjectionFactoryRegistry::instance()->createProjection(ossimString("EPSG:3785"));
-      if(proj.valid())
-      {
-         proj->saveState(kwl, prefix);
-      }
-   }
-
-   //---
-   // Sanity check...
-   // NOTE: It takes six doubles to make one tie point ie:
-   // x,y,z,longitude,latitude,height or x,y,z,easting,northing,height
-   //---
-   if (theErrorStatus ||
-       (!usingModelTransform() &&
-        ( (theScale.size() < 2) && // no scale
-          ( theTiePoint.size() < 24) ) ) )//need at least 3 ties if no scale.
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimGeoTiff::addImageGeometry: Failed sanity check "
-            << std::endl;
-         if(theErrorStatus)
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "for error status" << std::endl;
-         }
-         else if( theTiePoint.size()<5)
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "for tie points, size = " <<  theTiePoint.size()
-               << std::endl;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "for scale" << std::endl;
-         }
-      }
-      return false;
-   }
-
-   double x_tie_point = 0.0;
-   double y_tie_point = 0.0;
-   ossim_uint32 tieCount = (ossim_uint32)theTiePoint.size()/6;
-
-   if( (theScale.size() == 3) && (tieCount == 1))
-   {
-      //---
-      // Shift the tie point to the (0, 0) position if it's not already.
-      //
-      // Note:
-      // Some geotiff writers like ERDAS IMAGINE set the "GTRasterTypeGeoKey"
-      // key to RasterPixelIsArea, then set the tie point to (0.5, 0.5).
-      // This really means "RasterPixelIsPoint" with a tie point of (0.0, 0.0).
-      // Anyway we will check for this blunder and attempt to do the right
-      // thing...
-      //---
-      x_tie_point = theTiePoint[3] - theTiePoint[0]*theScale[0];
-      y_tie_point = theTiePoint[4] + theTiePoint[1]*theScale[1];
-   }
-   else if(tieCount > 1)
-   {
-      //---
-      // Should we check the model type??? (drb)
-      // if (theModelType == ModelTypeGeographic)
-      //---
-      if(tieCount >= 4)
-      {
-         ossimTieGptSet tieSet;
-         getTieSet(tieSet);
-
-         if(tieCount > 4)
-         {
-            // create a cubic polynomial model
-            //ossimRefPtr<ossimPolynomProjection> proj = new ossimPolynomProjection;
-            //proj->setupOptimizer("1 x y x2 xy y2 x3 y3 xy2 x2y z xz yz");
-            ossimRefPtr<ossimBilinearProjection> proj = new ossimBilinearProjection;
-            proj->optimizeFit(tieSet);
-            proj->saveState(kwl, prefix);
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimGeoTiff::addImageGeometry: "
-                  << "Creating a Cubic polynomial projection" << std::endl;
-            }
-            
-            return true;
-            
-         }
-         else if(tieCount == 4)
-         {
-            // create a bilinear model
-
-            // Should we check the model type (drb)
-            // if (theModelType == ModelTypeGeographic)
-            
-            ossimRefPtr<ossimBilinearProjection> proj = new ossimBilinearProjection;
-            proj->optimizeFit(tieSet);
-            proj->saveState(kwl, prefix);
-            
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimGeoTiff::addImageGeometry: "
-                  << "Creating a bilinear projection" << std::endl;
-            }
-           return true;
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimGeoTiff::addImageGeometry: "
-               << "Not enough tie points to create a interpolation model"
-               <<std::endl;
-         }
-         return false;
-      }
-   }
-   else if (usingModelTransform())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimGeoTiff::addImageGeometry: Do not support rotated "
-            << "map models yet.  You should provide the image as a sample "
-            << "and we will fix it" << std::endl;
-      }
-   }
-  
-   if ((theRasterType == PIXEL_IS_AREA))
-   {
-      // Since the internal pixel representation is "point", shift the
-      // tie point to be relative to the center of the pixel.
-      if (theScale.size() > 1)
-      {
-         x_tie_point += (theScale[0])/2.0;
-         y_tie_point -= (theScale[1])/2.0;
-      }
-   }
-
-   if( thePcsCode && (thePcsCode != USER_DEFINED) )
-   {
-      ossimString epsg_spec ("EPSG:");
-      epsg_spec += ossimString::toString(thePcsCode);
-      ossimRefPtr<ossimProjection> proj = 
-         ossimEpsgProjectionFactory::instance()->createProjection(epsg_spec);
-      if (proj.valid())
-      {
-         proj->saveState(kwl, prefix);
-      }
-      // Should be some else "WARNING" here maybe. (drb)
-   }
-   else if (getOssimProjectionName() == "unknown")
-   {
-      //---
-      // Get the projection type.  If unknown no point going on, so get out.
-      //---
-      return false;
-   }
-   else
-   {
-      // No PCS code but we do have a projection name
-      // Add these for all projections.
-      kwl.add(prefix, ossimKeywordNames::TYPE_KW, getOssimProjectionName());
-      kwl.add(prefix, ossimKeywordNames::DATUM_KW, getOssimDatumName());
-   }
-
-   // Now set the image-specific projection info (scale and image tiepoint):
-   if (theModelType == MODEL_TYPE_GEOGRAPHIC)
-   {
-      if (theAngularUnits != ANGULAR_DEGREE)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING ossimGeoTiff::addImageGeometry:"
-            << "\nNot coded yet for unit type:  "
-            << theAngularUnits << endl;
-         return false;
-      }
-
-      //---
-      // Tiepoint
-      // Have data with tie points -180.001389 so use ossimGpt::wrap() to handle:
-      //---
-      ossimGpt tieGpt(y_tie_point, x_tie_point, 0.0);
-      tieGpt.wrap();
-      ossimDpt tiepoint(tieGpt);
-      kwl.add(prefix, ossimKeywordNames::TIE_POINT_XY_KW, tiepoint.toString(), true);
-      kwl.add(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW, "degrees", true);
-
-      // scale or gsd
-      if (theScale.size() > 1)
-      {
-         ossimDpt scale (theScale[0], theScale[1]);
-         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW, scale.toString(), true);
-         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW, "degrees", true);
-
-         // origin
-         if ( ossim::isnan(theOriginLat) )
-         {
-            //---
-            // Put the origin lat at the center of the image so the meters per
-            // pixel is somewhat real.
-            //---
-            double centerY = theLength/2.0;
-            theOriginLat = tieGpt.lat - theScale[1]*centerY;
-         }
-
-         if (  ossim::isnan(theOriginLon) )
-         {
-            theOriginLon = 0.0;
-         }
-      }
-      
-      if (!(ossim::isnan(theOriginLat) || ossim::isnan(theOriginLon)))
-      {
-         kwl.add(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW,  theOriginLat, true);
-         kwl.add(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW, theOriginLon, true);
-      }
-
-   }
-   else // Projected
-   {
-      // Tiepoint
-      ossimDpt tiepoint (convert2meters(x_tie_point),convert2meters(y_tie_point));
-      kwl.add(prefix, ossimKeywordNames::TIE_POINT_XY_KW, tiepoint.toString(), true);
-      kwl.add(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW, "meters", true);
-
-      // scale or gsd
-      if (theScale.size() > 1)
-      {
-         ossimDpt scale (convert2meters(theScale[0]), convert2meters(theScale[1]));
-         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW, scale.toString(), true);
-         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW, "meters", true);
-      }
-      
-      // origin
-      if(!ossim::isnan(theOriginLat))
-         kwl.add(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW, theOriginLat);
-      if(!ossim::isnan(theOriginLon))
-         kwl.add(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW, theOriginLon);
-
-      // std paralles for conical projections
-      kwl.add(prefix, ossimKeywordNames::STD_PARALLEL_1_KW, theStdPar1);
-      kwl.add(prefix, ossimKeywordNames::STD_PARALLEL_2_KW, theStdPar2);
-      
-      // false easting and northing.
-      kwl.add(prefix, ossimKeywordNames::FALSE_EASTING_KW, convert2meters(theFalseEasting));
-      kwl.add(prefix, ossimKeywordNames::FALSE_NORTHING_KW, convert2meters(theFalseNorthing));
-
-      // Based on projection type, override/add the appropriate info.
-      if (getOssimProjectionName() == "ossimUtmProjection")
-      {
-         // Check the zone before adding...
-         if (theZone > 0 && theZone < 61)
-         {
-            kwl.add(prefix, ossimKeywordNames::ZONE_KW, theZone);
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimGeoTiff::addImageGeometry: "
-               << "UTM zone " << theZone << " out of range!\n"
-               << "Valid range:  1 to 60" << endl;
-            return false;
-         }
-
-         // Check the hemisphere before adding.
-         if (theHemisphere == "N" || theHemisphere == "S")
-         {
-            kwl.add(prefix, ossimKeywordNames::HEMISPHERE_KW, theHemisphere);
-         }
-         else
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimGeoTiff::addImageGeometry: "
-               << "UTM hemisphere " << theHemisphere << " is invalid!\n"
-               << "Valid hemisphere:  N or S" << std::endl;
-            return false;
-         }
-
-         //---
-         // Must set the central meridian even though the zone should do it.
-         // (in decimal degrees)
-         //---
-         double central_meridian = ( 6.0 * abs(theZone) ) - 183.0;
-         kwl.add(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW, central_meridian, true);
-         kwl.add(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW, 0.0, true);
-
-      } // End of "if (UTM)"
-
-      else if (getOssimProjectionName() == "ossimTransMercatorProjection")
-         kwl.add(prefix, ossimKeywordNames::SCALE_FACTOR_KW, theScaleFactor, true); 
-
-   } // end of projected CS
-
-   //---
-   // Get the model transformation info if it's present.
-   //---
-   if (usingModelTransform())
-   {
-      std::vector<double> v = getModelTransformation();
-      std::ostringstream out;
-      out << std::setprecision(15); // To avoid truncating.
-      ossim_uint32 idx = 0;
-      for(idx =0; idx < 16; ++idx)
-      {
-         out << v[idx] << " ";
-      }
-      kwl.add(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW, out.str().c_str(), true);
-      ossimUnitType modelTransformUnitType = OSSIM_UNIT_UNKNOWN;
-      if(theModelType == ModelTypeGeographic)
-      {
-         switch(theAngularUnits)
-         {
-            case ANGULAR_DEGREE:
-               modelTransformUnitType = OSSIM_DEGREES;
-               break;
-            case ANGULAR_ARC_MINUTE:
-               modelTransformUnitType = OSSIM_MINUTES;
-               break;
-            case ANGULAR_ARC_SECOND:
-               modelTransformUnitType = OSSIM_SECONDS;
-               break;
-            default:
-               return false;
-         }
-      }
-      else if(theModelType == ModelTypeProjected)
-      {
-         switch(theLinearUnitsCode)
-         {
-            case LINEAR_METER:
-               modelTransformUnitType = OSSIM_METERS;
-               break;
-            default:
-               return false;
-         }
-      }
-      kwl.add(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW,
-              ossimUnitTypeLut::instance()->getEntryString(modelTransformUnitType), true);
-   } 
-
-   if(theScaleFactor > 0.0)
-   {
-      kwl.add(prefix, ossimKeywordNames::SCALE_FACTOR_KW, theScaleFactor, true);
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimGeoTiff::addImageGeometry: Keyword list dump:\n"
-         << kwl << std::endl;
-   }
-   
-   return true;
-}
-
-double ossimGeoTiff::convert2meters(double d) const
-{
-   switch(theLinearUnitsCode)
-   {
-   case LINEAR_METER:
-      return d;
-   case LINEAR_FOOT:
-      return ossim::ft2mtrs(d);
-   case LINEAR_FOOT_US_SURVEY:
-      return ossim::usft2mtrs(d);
-   default:
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimGeoTiff::convert2meters: " 
-            << "Linear units code was undefined!\n"
-            << "No conversion was performed." << std::endl;
-      }
-      break;
-   }
-   
-   return d;
-}
-
-ossimString ossimGeoTiff::getOssimProjectionName() const
-{
-   return theProjectionName;
-}
-
-void ossimGeoTiff::setOssimProjectionName()
-{
-   //---
-   // The "parsePcsCode" method can also set the projection name.  So check
-   // it prior to looking in the lookup table.
-   //---
-   if (theProjectionName == "unknown")
-   {
-      ossimString name =  COORD_TRANS_LUT.getEntryString(theCoorTransGeoCode);
-      
-      if (name.size())
-      {
-         theProjectionName = name;
-      }
-   }
-
-   // If still unknown check for the model type.
-   if (theProjectionName == "unknown")
-   {
-      if (theModelType == ModelTypeGeographic)
-      {
-         theProjectionName = "ossimEquDistCylProjection";
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimGeoTiff::setOssimProjectionName: "
-         << "theProjectionName:  "
-         << theProjectionName
-         << std::endl;
-   }
-   
-}
-
-ossimString ossimGeoTiff::getOssimDatumName() const
-{
-   return theDatumName;
-}
-
-void ossimGeoTiff::setOssimDatumName()
-{
-   //---
-   // The "parsePcsCode" method can also set the datum name.  So check
-   // it prior to trying to assign.
-   //---
-   if (theDatumName == "unknown")
-   {
-      ossimString name = DATUM_LUT.getEntryString(theDatumCode);
-      
-      if (!name.empty())
-      {
-         theDatumName = name;
-      }
-      else
-      {
-         // Try the GCS code.
-         name = DATUM_LUT.getEntryString(theGcsCode);
-         if (name.size())
-         {
-            theDatumName = name;
-         }
-      }
-   }
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimGeoTiff::setOssimDatumName: "
-         << "theDatumName:  "
-         << theDatumName
-         << std::endl;
-   } 
-}
-
-//*************************************************************************************************
-//! Initializes data members given a projection code. Returns TRUE if valid PCS code specified.
-//*************************************************************************************************
-bool ossimGeoTiff::parsePcsCode()
-{
-   // key 3072 Section 6.3.3.1 codes
-   ossimString epsg_spec (ossimString("EPSG:") + ossimString::toString(thePcsCode));
-   ossimRefPtr<ossimProjection> proj = 
-      ossimEpsgProjectionFactory::instance()->createProjection(epsg_spec);
-   ossimMapProjection* map_proj = PTR_CAST(ossimMapProjection, proj.get());
-   if (!parseProjection(map_proj))
-      thePcsCode = 0;
-
-   return (thePcsCode != 0);
-}
-
-//*************************************************************************************************
-//! Initializes data members given a projection.
-//*************************************************************************************************
-bool ossimGeoTiff::parseProjection(ossimMapProjection* map_proj)
-{
-   if (map_proj == NULL)
-      return false;
-
-   // Initialize parameters from base-class ossimMapProjection:
-   if (map_proj->isGeographic())
-   {
-      theModelType = ModelTypeGeographic;
-      theAngularUnits = ANGULAR_DEGREE;
-      theLinearUnitsCode = ANGULAR_DEGREE;
-   }
-   else
-      theModelType = ModelTypeProjected;
-
-   theProjectionName = map_proj->getProjectionName();
-   theFalseEasting   = map_proj->getFalseEasting();
-   theFalseNorthing  = map_proj->getFalseNorthing();
-   theStdPar1        = map_proj->getStandardParallel1();
-   theStdPar2        = map_proj->getStandardParallel2();
-   thePcsCode        = map_proj->getPcsCode();
-
-   // GCS code only defined for geographic projections and is basically the same as PCS in OSSIM:
-   theGcsCode = 0;
-   
-   ossimGpt origin (map_proj->origin());
-   theOriginLat      = origin.lat;
-   theOriginLon      = origin.lon;
-   
-   const ossimDatum* datum = map_proj->getDatum();
-   if (datum)
-   {
-      theDatumName  = datum->name();
-      theDatumCode  = datum->epsgCode();
-   }
-   
-   // Now intercept a select few that have additional parameters specific to their derived type:
-   if (map_proj->getProjectionName() == "ossimEquDistCylProjection")
-   {
-      theGcsCode = map_proj->getPcsCode();
-   }
-   else if (theProjectionName == "ossimUtmProjection")
-   {
-      ossimUtmProjection* utm_proj = PTR_CAST(ossimUtmProjection, map_proj);
-      theHemisphere = utm_proj->getHemisphere();
-      theScaleFactor = 0.9996; // UTM fixed
-      theZone = utm_proj->getZone();
-   }
-   else if (theProjectionName == "ossimTransMercatorProjection")
-   {
-      ossimTransMercatorProjection* tm_proj = PTR_CAST(ossimTransMercatorProjection, map_proj);
-      theScaleFactor = tm_proj->getScaleFactor();
-   }
-   else if (theProjectionName == "ossimBngProjection")
-   {
-      // ### LEGACY HACK ###
-      theDatumName = "OGB-M";
-      theFalseEasting = 400000.0;
-      theFalseNorthing = -100000.0;
-      theScaleFactor   = .9996012717;
-      theOriginLat     = 49.0;
-      theOriginLon     = -2.0;
-      theHemisphere    = "N";
-   }
-
-   return true;
-}
-
-int ossimGeoTiff::mapZone() const
-{
-   return theZone;
-}
-
-void ossimGeoTiff::getScale(std::vector<double>& scale) const
-{
-   scale = theScale;
-}
-
-void ossimGeoTiff::getTiePoint(std::vector<double>& tie_point) const
-{
-   tie_point = theTiePoint;
-}
-
-void ossimGeoTiff::getModelTransformation(std::vector<double>& transform) const
-{
-   transform = theModelTransformation;
-}
-
-const std::vector<double>& ossimGeoTiff::getScale() const
-{
-   return theScale;
-}
-
-ossimPixelType ossimGeoTiff::getRasterType() const
-{
-   if (theRasterType == PIXEL_IS_AREA)
-      return OSSIM_PIXEL_IS_AREA;
-
-   return OSSIM_PIXEL_IS_POINT;
-}
-
-const std::vector<double>& ossimGeoTiff::getTiePoint() const
-{
-   return theTiePoint;
-}
-
-const std::vector<double>& ossimGeoTiff::getModelTransformation() const
-{
-   return theModelTransformation;
-}
-
-int ossimGeoTiff::getWidth() const
-{
-   return theWidth;
-}
-
-int ossimGeoTiff::getLength() const
-{
-   return theLength;
-}
-
-std::ostream& ossimGeoTiff::print(std::ostream& out) const
-{
-   // Capture stream flags.
-   std::ios_base::fmtflags f = out.flags();
-   
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << "ossimGeoTiff::print" << std::endl;
-
-   if (theScale.size())
-   {
-      std::vector<double>::const_iterator i = theScale.begin();
-      ossim_uint32 index = 0;
-      while ( i < theScale.end() )
-      {
-         out << "theScale[" << index << "]: " << (*i) << std::endl;
-         ++index;
-         ++i;
-      }
-   }
-   else
-   {
-      out << "theScale is empty..." << endl;
-   }
-   
-   if (theTiePoint.size())
-   {
-      std::vector<double>::const_iterator i = theTiePoint.begin();
-      ossim_uint32 index = 0;
-      while ( i < theTiePoint.end() )
-      {
-         out << "theTiePoint[" << index << "]: " << (*i) << std::endl;
-         ++index;
-         ++i;
-      }
-   }
-   else
-   {
-      out << "theTiePoint is empty..." << endl;
-   }
-
-   if (theModelTransformation.size())
-   {
-      std::vector<double>::const_iterator i = theModelTransformation.begin();
-      ossim_uint32 index = 0;
-      while ( i < theModelTransformation.end() )
-      {
-         out << "theModelTransformation[" << index << "]: "
-             << (*i) << std::endl;
-         ++index;
-         ++i;
-      }
-   }  
-   else
-   {
-      out << "theModelTransformation is empty..." << endl;
-   }
-
-   // Set the flags back.
-   out.flags(f);
-   
-   return out;
-}
-
-
-bool ossimGeoTiff::usingModelTransform() const
-{
-   //---
-   // If we have 16 model points do we always use them? (drb)
-   //
-   // In other word should the check just be if size == 16?
-   //--- 
-   if (getModelTransformation().size() == 16)
-   {
-      if (theScale.size() == 0)
-      {
-         // Need at least 24 (which is four ties) to use bilinear.
-         if (theTiePoint.size() < 24)
-         {
-            return true;
-         }
-      }
-   }
-   return false;
-}
-
-void ossimGeoTiff::getTieSet(ossimTieGptSet& tieSet) const
-{
-   ossim_uint32 idx = 0;
-   ossim_uint32 tieCount = (ossim_uint32)theTiePoint.size()/6;
-   const double* tiePointsPtr = &theTiePoint.front();
-   double offset = 0;
-   if (hasOneBasedTiePoints())
-   {
-      offset = -1.0;
-   }
-   
-   for(idx = 0; idx < tieCount; ++idx)
-   {
-      ossimDpt xyPixel(tiePointsPtr[0]+offset, tiePointsPtr[1]+offset);
-      // tie[3] = x, tie[4]
-      ossimGpt gpt(tiePointsPtr[4], tiePointsPtr[3], tiePointsPtr[5]);
-      
-      tieSet.addTiePoint(new ossimTieGpt(gpt, xyPixel, .5));
-      tiePointsPtr+=6;
-   }
-}
-
-bool ossimGeoTiff::hasOneBasedTiePoints() const
-{
-   bool result = false;
-   
-   // Assuming ties of (x,y,z,lat,lon,hgt) so size should be divide by 3.
-   if (theTiePoint.size()%6)
-   {
-      return result;
-   }
-   
-   ossim_float64 minX = 999999.0;
-   ossim_float64 minY = 999999.0;
-   ossim_float64 maxX = 0.0;
-   ossim_float64 maxY = 0.0;
-
-   const ossim_uint32 SIZE = (ossim_uint32)theTiePoint.size();
-   ossim_uint32 tieIndex = 0;
-
-   while (tieIndex < SIZE)
-   {
-      if ( theTiePoint[tieIndex]   < minX ) minX = theTiePoint[tieIndex];
-      if ( theTiePoint[tieIndex]   > maxX ) maxX = theTiePoint[tieIndex];
-      if ( theTiePoint[tieIndex+1] < minY ) minY = theTiePoint[tieIndex+1];
-      if ( theTiePoint[tieIndex+1] > maxY ) maxY = theTiePoint[tieIndex+1];
-      tieIndex += 6;
-   }
-
-   if ( (minX == 1) && (maxX == theWidth) &&
-        (minY == 1) && (maxY == theLength) )
-   {
-      result = true;
-   }
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimGeoTiff::hasOneBasedTiePoints DEBUG:"
-         << "\nminX:       " << minX
-         << "\nmaxX:       " << maxX
-         << "\nminY:       " << minY
-         << "\nmaxY:       " << maxY
-         << "\ntheWidth:   " << theWidth
-         << "\ntheLength:  " << theLength
-         << "\none based:  " << (result?"true":"false")
-         << std::endl;
-   }
-#endif
-   
-   return result;
-}
-
-//*************************************************************************************************
-// ArcMAP 9.2 bug workaround.
-// ESH 05/2008 -- ArcMap 9.2 compatibility hack
-// If the PCS code is for a HARN state plane and the implied pcs 
-// code's units is feet (us or intl), we find the equivalent code 
-// for units of meters.  We're doing this because ArcMap (9.2 and 
-// less) doesn't understand the non-meters HARN codes.  However, 
-// the units are left unchanged in this process, so the units can 
-// be different than the user-specified pcs code. ArcMap 9.2 
-// seems to understand the mixed definition just fine.
-// OLK 04/2010 -- Converted to vector<pair> scheme after refactoring EPSG factory. 
-//*************************************************************************************************
-ossim_uint16 getMetersEquivalentHarnCode(ossim_uint16 feet_harn_code)
-{
-   static const ossim_uint16 harn_feet[] =
-   {
-      2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
-      2883, 2884, 2885, 2886, 2887, 2888, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 
-      2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
-      2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2967, 2968
-   };
-   static const ossim_uint16 harn_meters[] =
-   {
-      2761, 2762, 2763, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 
-      2779, 2780, 2781, 2787, 2788, 2789, 2798, 2799, 2804, 2805, 2806, 2807, 2808, 2809, 2813, 2814, 
-      2818, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2836, 2837, 2838, 2839, 2843, 2844, 
-      2845, 2846, 2847, 2848, 2849, 2850, 2851, 2853, 2854, 2855, 2856, 2859, 2860, 2861, 2792, 2793
-   };
-
-   ossim_uint16 result = 0;
-   int index = 0;
-   while ((result == 0) && (index < 64))
-   {
-      if (harn_feet[index] == feet_harn_code)
-         result = harn_meters[index];
-      ++index;
-   }
-   return result;
-};
-
diff --git a/ossim/src/ossim/support_data/ossimGmlSupportData.cpp b/ossim/src/ossim/support_data/ossimGmlSupportData.cpp
deleted file mode 100644
index 7d7bdcc..0000000
--- a/ossim/src/ossim/support_data/ossimGmlSupportData.cpp
+++ /dev/null
@@ -1,1092 +0,0 @@
-//---
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: GML support data object.
-// 
-//---
-// $Id$
-
-#include <ossim/support_data/ossimGmlSupportData.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimXmlAttribute.h>
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimSensorModel.h>
-
-#include <iomanip>
-#include <sstream>
-
-static ossimTrace traceDebug("ossimGmlSupportData:debug");
-
-#define UNKNOWN_PCSCODE 32767
-
-ossimGmlSupportData::ossimGmlSupportData()
-   :
-   m_xmlDocument(0), m_mapProj(0), m_use_gmljp2_version2(true), 
-   m_pcsCodeMap(UNKNOWN_PCSCODE), m_pcsCodeGeo(UNKNOWN_PCSCODE),
-   m_srsNameStringMap("http://www.opengis.net/def/crs/EPSG/0/32767"),
-   m_srsNameStringGeo("http://www.opengis.net/def/crs/EPSG/0/32767"),
-   m_srsDimensionString("2"),
-   m_axisLabelsStringMap("X Y"), m_axisLabelsStringGeo("Lat Long"),
-   m_uomLabelsStringMap("m m"), m_uomLabelsStringGeo("deg deg")
-{
-}
-
-ossimGmlSupportData::~ossimGmlSupportData()
-{
-}
-
-bool ossimGmlSupportData::initialize( std::istream& in )
-{
-   bool status = false;
-   
-   if ( in.good() )
-   {
-      m_xmlDocument = new ossimXmlDocument();
-      m_xmlDocument->read( in );
-      
-      // TODO: Check for correct gml block.
-      
-      status = true;
-   }
-   else
-   {
-      m_xmlDocument = 0;
-   }
-   
-   return status;
-}
-
-bool ossimGmlSupportData::initialize( const ossimImageGeometry* geom )
-{
-   static const char MODULE[] = "ossimGmlSupportData::initialize(geom)";
-   
-   bool status = false;
-   
-   if ( geom )
-   {
-      // ossim_uint32 code = UNKNOWN_PCSCODE; // unknown code
-       
-      ossimRefPtr<const ossimProjection> proj = geom->getProjection();
-      if ( proj.valid() )
-      {
-         ossimRefPtr<const ossimMapProjection> mapProj =
-            dynamic_cast<const ossimMapProjection*>(proj.get());
-         if ( mapProj.valid() )
-         {
-            // Get the PCS code:
-            m_pcsCodeMap = mapProj->getPcsCode();
-            m_pcsCodeGeo = mapProj->getPcsCode();
-            m_mapProj    = mapProj;
-
-            // Create an SRS Name for the map projection
-            std::ostringstream os;
-            os << "http://www.opengis.net/def/crs/EPSG/0/" << m_pcsCodeMap;
-            m_srsNameStringMap = os.str();
-
-            // Create an SRS Name for the projection datum
-            std::ostringstream os2;
-            os2 << "http://www.opengis.net/def/crs/EPSG/0/" << m_pcsCodeGeo;
-            m_srsNameStringGeo = os2.str();
-
-            m_xmlDocument = new ossimXmlDocument(ossimFilename::NIL);
-
-            if ( m_use_gmljp2_version2 == true )
-            {
-               ossimRefPtr<ossimXmlNode> rootNode = getGmljp2V2RootNode();
-               m_xmlDocument->initRoot( rootNode );
-               status = configureGmljp2V2( rootNode, geom );
-            }
-            else
-            {
-               ossimRefPtr<ossimXmlNode> rootNode = getGmljp2V1RootNode();
-               m_xmlDocument->initRoot( rootNode );
-               status = configureGmljp2V1( rootNode, geom );
-            }
-
-            // cout << "gmljp2Node: " << *(gmljp2Node.get()) << endl;
-
-            // cout << "xmlDoc: " << *(m_xmlDocument.get()) << endl;
-         }
-      }
-
-      if ( status == false )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG Entered...\n";
-         
-      }
-   }
-
-   return status;
-   
-} // End: ossimGmlSupportData::initialize( geom, mapProj )
-
-bool ossimGmlSupportData::configureGmljp2V1( 
-   ossimRefPtr<ossimXmlNode> node0, const ossimImageGeometry* geom )
-{
-   bool success = true;
-   const ossimString BLANK = "";
-
-   ossimString gridHighString;
-   ossimString gridLowString;
-   getLimits( geom, gridHighString, gridLowString );
-
-   configureBounds( node0, geom );
-
-   ossimString path = "rectifiedGridDomain";
-   ossimRefPtr<ossimXmlNode> node2 = node0->addChildNode( path, BLANK );
-
-   path = "RectifiedGrid";
-   ossimRefPtr<ossimXmlNode> node2a = node2->addChildNode( path, BLANK );
-
-   ossimRefPtr<ossimXmlAttribute> attr1 = new ossimXmlAttribute();
-   ossimString name = "dimension";
-   ossimString value = "2";
-   attr1->setNameValue( name, value );
-   node2a->addAttribute( attr1 );
-
-   path = "limit";
-   ossimRefPtr<ossimXmlNode> node2a1 = node2a->addChildNode( path, BLANK );
-
-   path = "GridEnvelope"; 
-   ossimRefPtr<ossimXmlNode> node2a1a = node2a1->addChildNode( path, BLANK );
-
-   path = "low";
-   ossimRefPtr<ossimXmlNode> node2a1a1 = node2a1a->addChildNode( path, gridLowString );
-
-   path = "high";
-   ossimRefPtr<ossimXmlNode> node2a1a2 = node2a1a->addChildNode( path, gridHighString );
-
-   return success;
-}
-
-bool ossimGmlSupportData::configureGmljp2V2( 
-   ossimRefPtr<ossimXmlNode> node0, const ossimImageGeometry* geom )
-{
-   bool success = true;
-   const ossimString BLANK = "";
-
-   ossimRefPtr<ossimXmlAttribute> attr(0);
-   ossimString name;
-   ossimString value;
-
-   ossimString gridHighString;
-   ossimString gridLowString;
-   getLimits( geom, gridHighString, gridLowString );
-
-   configureBounds( node0, geom );
-
-   ossimString path = "domainSet";
-   ossimRefPtr<ossimXmlNode> node2 =
-      node0->addChildNode( path, BLANK );
-
-   path = "rangeSet";
-   ossimRefPtr<ossimXmlNode> node3 =
-      node0->addChildNode( path, BLANK );
-
-   path = "File";
-   ossimRefPtr<ossimXmlNode> node3a =
-      node3->addChildNode( path, BLANK );
-
-   path = "rangeParameters";
-   ossimRefPtr<ossimXmlNode> node3a1 =
-      node3a->addChildNode( path, BLANK );
-
-   path = "fileName";
-   ossimRefPtr<ossimXmlNode> node3a2 =
-      node3a->addChildNode( path, "gmljp2://codestream" );
-
-   path = "fileStructure";
-   ossimRefPtr<ossimXmlNode> node3a3 =
-      node3a->addChildNode( path, "inapplicable" );
-
-   path = "gmlcov:rangeType";
-   ossimRefPtr<ossimXmlNode> node4 =
-      node0->addChildNode( path, BLANK );
-
-   path = "gmljp2:featureMember";
-   ossimRefPtr<ossimXmlNode> node5 =
-      node0->addChildNode( path, BLANK );
-
-   path = "gmljp2:GMLJP2RectifiedGridCoverage";
-   ossimRefPtr<ossimXmlNode> node5a =
-      node5->addChildNode( path, BLANK );
-
-   attr  = new ossimXmlAttribute();
-   name  = "gml:id";
-   value = "CodeStream_0";
-   attr->setNameValue( name, value );
-   node5a->addAttribute( attr );
-
-   path = "domainSet";
-   ossimRefPtr<ossimXmlNode> node5a1 =
-      node5a->addChildNode( path, BLANK );
-
-   path = "RectifiedGrid";
-   ossimRefPtr<ossimXmlNode> node5a1a =
-      node5a1->addChildNode( path, BLANK );
-
-   attr  = new ossimXmlAttribute();
-   name  = "gml:id";
-   value = "RG0001";
-   attr->setNameValue( name, value );
-   node5a1a->addAttribute( attr );
-
-   attr  = new ossimXmlAttribute();
-   name  = "dimension";
-   value = "2";
-   attr->setNameValue( name, value );
-   node5a1a->addAttribute( attr );
-
-   attr  = new ossimXmlAttribute();
-   name  = "srsName";
-   attr->setNameValue( name, m_srsNameStringMap );
-   node5a1a->addAttribute( attr );
-
-   path = "limits";
-   ossimRefPtr<ossimXmlNode> node5a1a1 =
-      node5a1a->addChildNode( path, BLANK );
-
-   path = "GridEnvelope";
-   ossimRefPtr<ossimXmlNode> node5a1a1a =
-      node5a1a1->addChildNode( path, BLANK );
-
-   path = "low";
-   ossimRefPtr<ossimXmlNode> node5a1a1a1 =
-      node5a1a1a->addChildNode( path, gridLowString );
-
-   path = "high";
-   ossimRefPtr<ossimXmlNode> node5a1a1a2 =
-      node5a1a1a->addChildNode( path, gridHighString );
-
-   path = "axisLabels";
-   ossimRefPtr<ossimXmlNode> node5a1a2 =
-      node5a1a->addChildNode( path, 
-                              m_mapProj->isGeographic() ? 
-                              m_axisLabelsStringGeo : m_axisLabelsStringMap );
-
-   path = "origin";
-   ossimRefPtr<ossimXmlNode> node5a1a3 =
-      node5a1a->addChildNode( path, BLANK );
-
-   path = "Point";
-   ossimRefPtr<ossimXmlNode> node5a1a3a =
-      node5a1a3->addChildNode( path, BLANK );
-
-   attr  = new ossimXmlAttribute();
-   name  = "gml:id";
-   value = "P0001";
-   attr->setNameValue( name, value );
-   node5a1a3a->addAttribute( attr );
-
-   attr  = new ossimXmlAttribute();
-   name  = "srsName";
-   attr->setNameValue( name, m_srsNameStringMap );
-   node5a1a3a->addAttribute( attr );
-
-   ossimString originString;
-   ossimString offsetVector1String;
-   ossimString offsetVector2String;
-   getOrigin( geom, originString, 
-              offsetVector1String, 
-              offsetVector2String );
-
-   path = "pos";
-   ossimRefPtr<ossimXmlNode> node5a1a3a1 =
-      node5a1a3a->addChildNode( path, originString );
-
-   path = "offsetVector";
-   ossimRefPtr<ossimXmlNode> node5a1a4 =
-      node5a1a->addChildNode( path, offsetVector1String );
-
-   attr  = new ossimXmlAttribute();
-   name  = "srsName";
-   attr->setNameValue( name, 
-                       m_mapProj->isGeographic() ? 
-                       m_srsNameStringGeo : m_srsNameStringMap );
-   node5a1a4->addAttribute( attr );
-
-   path = "offsetVector";
-   ossimRefPtr<ossimXmlNode> node5a1a5 =
-      node5a1a->addChildNode( path, offsetVector2String );
-
-   attr  = new ossimXmlAttribute();
-   name  = "srsName";
-   attr->setNameValue( name, 
-                       m_mapProj->isGeographic() ? 
-                       m_srsNameStringGeo : m_srsNameStringMap );
-   node5a1a5->addAttribute( attr );
-
-   path = "rangeSet";
-   ossimRefPtr<ossimXmlNode> node5a2 =
-      node5a->addChildNode( path, BLANK );
-
-   path = "File";
-   ossimRefPtr<ossimXmlNode> node5a2a =
-      node5a2->addChildNode( path, BLANK );
-
-   path = "rangeParameters";
-   ossimRefPtr<ossimXmlNode> node5a2a1 =
-      node5a2a->addChildNode( path, BLANK );
-
-   path = "fileName";
-   ossimRefPtr<ossimXmlNode> node5a2a2 =
-      node5a2a->addChildNode( path, "gmljp2://codestream" );
-
-   path = "fileStructure";
-   ossimRefPtr<ossimXmlNode> node5a2a3 =
-      node5a2a->addChildNode( path, "inapplicable" );
-
-   return success;
-}
-
-bool ossimGmlSupportData::configureBounds(
-   ossimRefPtr<ossimXmlNode> node0, const ossimImageGeometry* geom )
-{
-   bool success = true;
-   const ossimString BLANK = "";
-
-   ossimString upperCornerString;         
-   ossimString lowerCornerString;
-   getGeoBounds( geom, upperCornerString, lowerCornerString );
-
-   ossimString path = "boundedBy";
-   ossimRefPtr<ossimXmlNode> node1 = node0->addChildNode( path, BLANK );
-
-   path = "Envelope";
-   ossimRefPtr<ossimXmlNode> node1a = node1->addChildNode( path, BLANK );
-
-   ossimRefPtr<ossimXmlAttribute> attr( 0 );
-   ossimString name;
-
-   attr = new ossimXmlAttribute();
-   name = "srsName";
-   attr->setNameValue( name, m_srsNameStringGeo );
-   node1a->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();
-   name = "axisLabels";
-   attr->setNameValue( name, m_axisLabelsStringGeo );
-   node1a->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();
-   name = "uomLabels";
-   attr->setNameValue( name, m_uomLabelsStringGeo );
-   node1a->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();
-   name = "srsDimension";
-   attr->setNameValue( name, m_srsDimensionString );
-   node1a->addAttribute( attr );
-
-   path = "lowerCorner";
-   ossimRefPtr<ossimXmlNode> node1a1 =
-      node1a->addChildNode( path, lowerCornerString );
-
-   path = "upperCorner";
-   ossimRefPtr<ossimXmlNode> node1a2 =
-      node1a->addChildNode( path, upperCornerString );
-
-   return success;
-}
-
-ossimRefPtr<ossimXmlNode> ossimGmlSupportData::getGmljp2V2RootNode() const
-{
-   ossimRefPtr<ossimXmlNode> node = new ossimXmlNode();
-
-   ossimString os = "gmljp2:GMLJP2CoverageCollection";
-   node->setTag( os );
-
-   ossimRefPtr<ossimXmlAttribute> attr( 0 );
-   ossimString name;
-   ossimString value;
-
-   attr = new ossimXmlAttribute();
-   name = "gml:id";
-   value = "JPEG2000_0";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();
-   name = "xmlns";
-   value = "http://www.opengis.net/gml/3.2";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();   
-   name = "xmlns:gml";
-   value = "http://www.opengis.net/gml/3.2";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();   
-   name = "xmlns:gmlcov";
-   value = "http://www.opengis.net/gmlcov/1.0";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();   
-   name = "xmlns:gmljp2";
-   value = "http://www.opengis.net/gmljp2/2.0";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();     
-   name = "xmlns:xsi";
-   value = "http://www.w3.org/2001/XMLSchema-instance";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-      
-   attr = new ossimXmlAttribute();   
-   name = "xsi:schemaLocation";
-   value = "http://www.opengis.net/gmljp2/2.0 http://schemas.opengis.net/gmljp2/2.0/gmljp2.xsd";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   return node;
-   
-} // ossimGmlSupportData::getGmljp2V2Node()
-
-ossimRefPtr<ossimXmlNode> ossimGmlSupportData::getGmljp2V1RootNode() const
-{
-   ossimRefPtr<ossimXmlNode> node = new ossimXmlNode();
-
-   ossimString os = "gml:FeatureCollection";
-   node->setTag( os );
-
-   ossimRefPtr<ossimXmlAttribute> attr(0);
-   ossimString name;
-   ossimString value;
-   
-   attr = new ossimXmlAttribute();
-   name = "xmlns";
-   value = "http://www.opengis.net/gml";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();   
-   name = "xmlns:gml";
-   value = "http://www.opengis.net/gml";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   attr = new ossimXmlAttribute();     
-   name = "xmlns:xsi";
-   value = "http://www.w3.org/2001/XMLSchema-instance";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-      
-   attr = new ossimXmlAttribute();   
-   name = "xsi:schemaLocation";
-   value = "http://www.opengis.net/gml gmlJP2Profile.xsd";
-   attr->setNameValue( name, value );
-   node->addAttribute( attr );
-
-   return node;
-   
-} // ossimGmlSupportData::getGmljp2V1Node()
-
-bool ossimGmlSupportData::write(std::ostream& os)
-{
-   bool status = false;
-   
-   if ( m_xmlDocument.valid() )
-   {
-      os << *(m_xmlDocument.get());
-      
-      status = true;
-   }
-
-   return status;
-}
-
-ossimRefPtr<ossimXmlDocument> ossimGmlSupportData::getXmlDoc() const
-{
-   return m_xmlDocument;
-}
-
-bool ossimGmlSupportData::getImageGeometry( ossimKeywordlist& geomKwl ) const
-{
-   bool success = true;
-   
-   if ( m_xmlDocument.valid() )
-   {
-      vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
-      bool gotSensorImage    = false;
-      bool gotRectifiedImage = false;
-      ossim_uint32 pcsCodeGrid = 32767; // only applies to rectified
-
-      // Check the GMLJP2CoverageCollection attributes for the default namespace.
-      ossimString defaultNamespaceStr( "" );
-      ossimString xpath_root = "/gmljp2:GMLJP2CoverageCollection";
-      xml_nodes.clear();
-      m_xmlDocument->findNodes( xpath_root, xml_nodes );
-      if ( xml_nodes.size() == 0 ) 
-      {
-          // check if the default namespace is gmljp2
-          xpath_root = "/GMLJP2CoverageCollection";
-          m_xmlDocument->findNodes( xpath_root, xml_nodes );
-      }
-      if ( xml_nodes.size() >= 1 )
-      {
-         const ossimString defaultNamespaceIdentifierStr( "xmlns" );
-         ossimString defaultNamespacePrependStr = defaultNamespaceIdentifierStr + ":";
-
-         const ossimRefPtr<ossimXmlAttribute> defaultNamespaceAttribute = xml_nodes[0]->findAttribute( defaultNamespaceIdentifierStr );
-         ossimString defaultNamespaceSettingStr = defaultNamespaceAttribute->getValue();
-
-         // search for the attribute value in the other attributes
-         const ossimXmlNode::AttributeListType& attributeList = xml_nodes[0]->getAttributes();
-         size_t nAttributes = attributeList.size();
-         for ( size_t i=0; i<nAttributes; ++i )
-         {
-            const ossimRefPtr<ossimXmlAttribute> attribute = attributeList[i];
-         
-            const ossimString& attribute_name  = attribute->getName();
-            const ossimString& attribute_value = attribute->getValue();
-
-            if ( attribute_name  != defaultNamespaceIdentifierStr && 
-                 attribute_value == defaultNamespaceSettingStr )
-            {
-                defaultNamespaceStr = attribute_name.after( defaultNamespacePrependStr );
-                defaultNamespaceStr += ":";
-            }
-         }
-      }
-       
-      // Check for a sensor image
-      ossimString xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2ReferenceableGridCoverage/gml:domainSet/gmlcov:ReferenceableGridBySensorModel";
-      xpath0 = xpath0.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-      xml_nodes.clear();
-      m_xmlDocument->findNodes( xpath0, xml_nodes );
-      if ( xml_nodes.size() >= 1 )
-      {
-         // we've got a sensor model image
-         gotSensorImage = true;
-      }
-      else
-      {
-         const ossimString srsNameStr( "srsName" );
-         ossimString pcsCodeDefinitionStr( "http://www.opengis.net/def/crs/EPSG/0/" );
-
-         xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2RectifiedGridCoverage/gml:domainSet/gml:RectifiedGrid";
-         xpath0 = xpath0.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-         xml_nodes.clear();
-         m_xmlDocument->findNodes( xpath0, xml_nodes );
-         if ( xml_nodes.size() >= 1 )
-         {
-            // we've got a rectified image
-            gotRectifiedImage = true;
-
-            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( srsNameStr );
-            const ossimString& originSrsName = hrefAttribute->getValue();
-            ossimString pcsCodeGridStr = originSrsName.after( pcsCodeDefinitionStr.string() );
-            pcsCodeGrid = pcsCodeGridStr.toUInt32();
-            if ( pcsCodeGrid != 32767 )
-            {
-               //---
-               // The ossimEpsgProjectionFactory will not pick up the origin latitude if code is
-               // 4326 (geographic) so we use the projection name; else, the origin_latitude will
-               // always be 0.  This is so the gsd comes out correct for scale.
-               //---
-               if ( pcsCodeGrid != 4326 ) // map projection
-               {
-                  // Add the pcs code.
-                  geomKwl.add( ossimKeywordNames::PCS_CODE_KW,
-                               pcsCodeGridStr.c_str() );
-               }
-               else // geographic
-               {
-                  geomKwl.add( ossimKeywordNames::TYPE_KW, 
-                               ossimString( "ossimEquDistCylProjection" ) );
-               }
-            }
-         }
-      }
-
-      /* Number of lines & samples, for either sensor or rectified imagery */
-
-      ossimString xpath_limits_low  = "/gml:limits/gml:GridEnvelope/gml:low";
-      ossimString xpath_limits_high = "/gml:limits/gml:GridEnvelope/gml:high";
-
-      xpath_limits_low  = xpath_limits_low.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-      xpath_limits_high = xpath_limits_high.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-
-      bool gotLow = false;
-      ossim_int32 lowX, lowY;
-      ossimString xpath = xpath0 + xpath_limits_low;
-      xml_nodes.clear();
-      m_xmlDocument->findNodes( xpath, xml_nodes );
-      if ( xml_nodes.size() == 1 )
-      {
-         const ossimString& lowerCorner = xml_nodes[0]->getText();
-         size_t spacePos = lowerCorner.find( ' ' );
-         ossimString lowerXString = lowerCorner.beforePos( spacePos );
-         ossimString lowerYString = lowerCorner.afterPos ( spacePos );
-         lowX = lowerXString.toInt32();
-         lowY = lowerYString.toInt32();
-         gotLow = true;
-      }
-
-      bool gotHigh = false;
-      ossim_int32 highX = 0;
-      ossim_int32 highY = 0;
-      xpath = xpath0 + xpath_limits_high;
-      xml_nodes.clear();
-      m_xmlDocument->findNodes( xpath, xml_nodes );
-      if ( xml_nodes.size() == 1 )
-      {
-         const ossimString& higherCorner = xml_nodes[0]->getText();
-         size_t spacePos = higherCorner.find( ' ' );
-         ossimString higherXString = higherCorner.beforePos( spacePos );
-         ossimString higherYString = higherCorner.afterPos ( spacePos );
-         highX = higherXString.toInt32();
-         highY = higherYString.toInt32();
-         gotHigh = true;
-      }
-
-      if ( gotHigh && gotLow )
-      {
-         geomKwl.add( ossimKeywordNames::NUMBER_LINES_KW,   highY - lowY + 1 );
-         geomKwl.add( ossimKeywordNames::NUMBER_SAMPLES_KW, highX - lowX + 1 );
-      }
-
-      if ( gotSensorImage )
-      {
-         const ossimString hrefStr( "xlink:href" );
-         const ossimString codeSpaceStr( "codeSpace" );
-
-         ossimString sensorModelHref( "" );
-         ossimString xpath_sensor_model = "/gmlcov:sensorModel";
-         xpath_sensor_model = xpath_sensor_model.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-         xpath = xpath0 + xpath_sensor_model;
-         xml_nodes.clear();
-         m_xmlDocument->findNodes( xpath, xml_nodes );
-         if ( xml_nodes.size() == 1 )
-         {
-            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( hrefStr );
-            sensorModelHref = hrefAttribute->getValue();
-         }
-
-         ossimString sensorInstanceHref( "" );
-         ossimString xpath_sensor_typeOf = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:typeOf";
-         xpath_sensor_typeOf = xpath_sensor_typeOf.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-         xpath = xpath0 + xpath_sensor_typeOf;
-         xml_nodes.clear();
-         m_xmlDocument->findNodes( xpath, xml_nodes );
-         if ( xml_nodes.size() == 1 )
-         {
-            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( hrefStr );
-            sensorInstanceHref = hrefAttribute->getValue();
-         }
-
-         ossimSensorModel* sensor_model = 0;
-         ossimString xpath_sensor_name = "/gmlcov:sensorInstance/sml:SimpleProcess/gml:name";
-         xpath_sensor_name = xpath_sensor_name.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-         xpath = xpath0 + xpath_sensor_name;
-         xml_nodes.clear();
-         m_xmlDocument->findNodes( xpath, xml_nodes );
-         int nSensorNames = (int)xml_nodes.size();
-         for ( int i=0; i<nSensorNames; ++i )
-         {
-            const ossimString& sensorName = xml_nodes[i]->getText();
-
-            ossimProjectionFactoryRegistry* registry = ossimProjectionFactoryRegistry::instance();
-            ossimProjection* proj = registry->createProjection( sensorName );
-
-            // Is it a sensor model ?
-            sensor_model = dynamic_cast<ossimSensorModel*>( proj );
-            if ( sensor_model != 0 )
-            {
-               geomKwl.add( ossimKeywordNames::TYPE_KW, sensorName.c_str() );
-               break;
-            }
-         }
-         if ( sensor_model == 0 )
-         {
-            // Add debug message
-            return false;
-         }
-
-         // Check if the sensor instance is typeOf the sensor model
-         if ( sensorModelHref == sensorInstanceHref )
-         {
-            const ossimString refStr( "ref" );
-
-            /* sml:setValue */
-            ossimString xpath_setValue = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:configuration/sml:Settings/sml:setValue";
-            xpath_setValue = xpath_setValue.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-            xpath = xpath0 + xpath_setValue;
-            xml_nodes.clear();
-            m_xmlDocument->findNodes( xpath, xml_nodes );
-            size_t nXmlNodes = xml_nodes.size();
-            for( size_t i=0; i<nXmlNodes; ++i )
-            {
-               const ossimString& elementValue = xml_nodes[i]->getText();
-
-               const ossimRefPtr<ossimXmlAttribute> refAttribute = xml_nodes[i]->findAttribute( refStr );
-               const ossimString& settingsRef = refAttribute->getValue();
-
-               bool successSetValue = sensor_model->getImageGeometry( settingsRef, elementValue, geomKwl );
-               success &= successSetValue;
-               if ( !successSetValue )
-               {
-                  // Add debug message
-               }
-            }
-
-            /* sml:setArrayValues */
-            ossimString xpath_setArrayValues = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:configuration/sml:Settings/sml:setArrayValues";
-            xpath_setArrayValues = xpath_setArrayValues.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-            xpath = xpath0 + xpath_setArrayValues;
-            xml_nodes.clear();
-            m_xmlDocument->findNodes( xpath, xml_nodes );
-            nXmlNodes = xml_nodes.size();
-            for( size_t i=0; i<nXmlNodes; ++i )
-            {
-               ossimString elementValue( "" );
-
-               const ossimRefPtr<ossimXmlAttribute> refAttribute = xml_nodes[i]->findAttribute( refStr );
-               const ossimString& settingsRef = refAttribute->getValue();
-
-               const ossimXmlNode::ChildListType& children = xml_nodes[i]->getChildNodes();
-               if ( children.size() > 0 )
-               {
-                  const ossimXmlNode::ChildListType& grandchildren = children[0]->getChildNodes();
-                   
-                  if ( (grandchildren.size() > 1) && (grandchildren[1]->getTag() == ossimString( "sml:value")) )
-                  {
-                     elementValue = grandchildren[1]->getText();
-                  }
-               }
-
-               bool successSetArrayValues = sensor_model->getImageGeometry( settingsRef, elementValue, geomKwl );
-               success &= successSetArrayValues;
-               if ( !successSetArrayValues )
-               {
-                  // Add debug message
-               }
-            }
-         }
-      }
-      else
-         if ( gotRectifiedImage )
-         {
-            const ossimString srsNameStr( "srsName" );
-            ossimString pcsCodeDefinitionStr( "http://www.opengis.net/def/crs/EPSG/0/" );
-
-            /* axis labels for rectified imagery */
-
-            ossimString xpath_axisLabels = "/gml:axisLabels";
-            xpath_axisLabels = xpath_axisLabels.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-            ossimString firstAxisLabelString( "" );
-            ossimString secondAxisLabelString( "" );
-            ossimString xpath = xpath0 + xpath_axisLabels;
-            xml_nodes.clear();
-            m_xmlDocument->findNodes( xpath, xml_nodes );
-            if ( xml_nodes.size() == 1 )
-            {
-               const ossimString& axisLabelsString = xml_nodes[0]->getText();
-               size_t spacePos = axisLabelsString.find( ' ' );
-               firstAxisLabelString  = axisLabelsString.beforePos( spacePos );
-               secondAxisLabelString = axisLabelsString.afterPos ( spacePos );
-            }
-
-            /* origin */
-
-            ossim_uint32 pcsCodeOrigin = 32767;
-            ossimString xpath_originPoint = "/gml:origin/gml:Point";
-            xpath_originPoint = xpath_originPoint.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-            xpath = xpath0 + xpath_originPoint;
-            xml_nodes.clear();
-            m_xmlDocument->findNodes( xpath, xml_nodes );
-            if ( xml_nodes.size() == 1 )
-            {
-               const ossimString& originString = xml_nodes[0]->getChildTextValue( ossimString( "pos" ) );
-               size_t spacePos = originString.find( ' ' );
-               ossimString firstOriginString  = originString.beforePos( spacePos );
-               ossimString secondOriginString = originString.afterPos ( spacePos );
-
-               const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( srsNameStr );
-               const ossimString& originSrsName = hrefAttribute->getValue();
-               ossimString pcsCodeOriginStr = originSrsName.after( pcsCodeDefinitionStr.string() );
-               pcsCodeOrigin = pcsCodeOriginStr.toUInt32();
-               if ( pcsCodeOrigin != 32767 )
-               {
-                  if ( pcsCodeOrigin != 4326 ) // map projection
-                  {
-                     /* Convert to geographic */
-                  }
-
-                  if ( firstAxisLabelString == ossimString( "Lat" ) )
-                  {
-                     geomKwl.add( ossimKeywordNames::ORIGIN_LATITUDE_KW, 
-                                  firstOriginString.c_str() );
-                     geomKwl.add( ossimKeywordNames::CENTRAL_MERIDIAN_KW, 
-                                  secondOriginString.c_str() );
-                  }
-                  else
-                  {
-                     geomKwl.add( ossimKeywordNames::ORIGIN_LATITUDE_KW, 
-                                  secondOriginString.c_str() );
-                     geomKwl.add( ossimKeywordNames::CENTRAL_MERIDIAN_KW, 
-                                  firstOriginString.c_str() );
-                  }
-               }
-            }
-
-            /* offset vector */
-
-            ossimString xpath_offsetVector = "/gml:offsetVector";
-            xpath_offsetVector = xpath_offsetVector.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
-            xpath = xpath0 + xpath_offsetVector;
-            xml_nodes.clear();
-            m_xmlDocument->findNodes( xpath, xml_nodes );
-            size_t nNodes = xml_nodes.size();
-            for ( size_t i=0; i<nNodes; ++i )
-            {
-               const ossimString& offsetVectorString = xml_nodes[i]->getText();
-               size_t spacePos = offsetVectorString.find( ' ' );
-               ossimString firstOffsetVectorString  = offsetVectorString.beforePos( spacePos );
-               ossimString secondOffsetVectorString = offsetVectorString.afterPos ( spacePos );
-
-               const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[i]->findAttribute( srsNameStr );
-               const ossimString& offsetVectorSrsName = hrefAttribute->getValue();
-               ossimString pcsCodeOffsetVectorStr = offsetVectorSrsName.after( pcsCodeDefinitionStr.string() );
-               ossim_uint32 pcsCodeOffsetVector = pcsCodeOffsetVectorStr.toUInt32();
-               if ( pcsCodeOffsetVector == 4326 )
-               {
-                  if ( firstAxisLabelString == ossimString( "Lat" ) )
-                  {
-                     if ( firstOffsetVectorString.toDouble() != 0.0 )
-                     {    
-                        geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, 
-                                     firstOffsetVectorString.c_str() );
-                     }
-                     else
-                     {
-                        geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, 
-                                     secondOffsetVectorString.c_str() );
-                     }
-                  }
-                  else
-                  {
-                     if ( firstOffsetVectorString.toDouble() != 0.0 )
-                     { 
-                        geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, 
-                                     firstOffsetVectorString.c_str() );
-                     }
-                     else
-                     {
-                        geomKwl.add( ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, 
-                                     secondOffsetVectorString.c_str() );
-                     }
-                  }
-               }
-               else // map projection
-                  if ( pcsCodeOffsetVector == pcsCodeGrid )
-                  {
-                     if ( firstAxisLabelString == ossimString( "X" ) )
-                     {
-                        if ( firstOffsetVectorString.toDouble() != 0.0 )
-                        {    
-                           geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_X_KW, 
-                                        firstOffsetVectorString.c_str() );
-                        }
-                        else
-                        {
-                           geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_Y_KW, 
-                                        secondOffsetVectorString.c_str() );
-                        }
-                     }
-                     else
-                     {
-                        if ( firstOffsetVectorString.toDouble() != 0.0 )
-                        { 
-                           geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_Y_KW, 
-                                        firstOffsetVectorString.c_str() );
-                        }
-                        else
-                        {
-                           geomKwl.add( ossimKeywordNames::METERS_PER_PIXEL_X_KW, 
-                                        secondOffsetVectorString.c_str() );
-                        }
-                     }
-                  }
-                  else
-                  {
-                     /*
-                       Need to perform a coordinate conversion on the 
-                       offset vector to the pcs code of the grid
-                     */
-                  }
-            }
-         }
-   }
-
-   return success;
-   
-} // End: ossimGmlSupportData::getImageGeometry( geoKwl )
-
-
-void ossimGmlSupportData::getOrigin( 
-   const ossimImageGeometry* geom,
-   ossimString& originString,
-   ossimString& offsetVector1String, 
-   ossimString& offsetVector2String ) const
-{
-   if ( m_mapProj != 0 )
-   {
-      // In meters or decimal degrees.
-      if ( m_mapProj->isGeographic() )
-      {
-         getGeoOrigin( geom, originString, 
-                       offsetVector1String, offsetVector2String );
-      }
-      else
-      {
-         getMapOrigin( geom, originString, 
-                       offsetVector1String, offsetVector2String );
-      }
-   }
-} // End: ossimGmlSupportData::getOrigin
-
-
-void ossimGmlSupportData::getGeoBounds( const ossimImageGeometry* geom,
-                                        ossimString& upperCornerString,
-                                        ossimString& lowerCornerString ) const
-{
-   if ( geom != 0 && m_mapProj != 0 )
-   {
-      // Get the bounding rect:
-      ossimGrect rect;
-      geom->getBoundingGroundRect( rect );
-      
-      ossimDpt upperEdge( rect.ul().lon, rect.ul().lat );
-      ossimDpt lowerEdge( rect.lr().lon, rect.lr().lat );
-
-      std::ostringstream os;
-      os.precision(5);
-      os << upperEdge.lat << " " << upperEdge.lon;
-      upperCornerString = os.str();
-      
-      std::ostringstream os2;
-      os2.precision(5);
-      os2 << lowerEdge.lat << " " << lowerEdge.lon;
-      lowerCornerString = os2.str();
-   }
-   
-} // End: ossimGmlSupportData::getGeoBounds
-
-void ossimGmlSupportData::getGeoOrigin( 
-   const ossimImageGeometry* geom,
-   ossimString& originString,
-   ossimString& offsetVector1String, 
-   ossimString& offsetVector2String ) const
-{
-   if ( geom )
-   {
-      // Get the gsd and bounding rect:
-      ossimDpt gsd;
-      ossimGrect rect;
-      geom->getDegreesPerPixel( gsd );
-      geom->getBoundingGroundRect( rect );
-
-      ossimDpt halfGsd = gsd/2.0;
-      ossimDpt upperEdge( rect.ul().lon + halfGsd.x, rect.ul().lat + halfGsd.y );
-
-      std::ostringstream os;
-      os.precision(15);
-      os << upperEdge.lat << " " << upperEdge.lon;
-      originString = os.str();
-
-      std::ostringstream os2;
-      os2.precision(15);
-      os2 << -gsd.y << " " << "0.0";
-      offsetVector1String = os2.str();
-
-      std::ostringstream os3;
-      os3.precision(15);
-      os3 << "0.0" << " " << gsd.x;
-      offsetVector2String = os3.str();
-   }
-
-} // End: ossimGmlSupportData::getGeoOrigin
-
-
-void ossimGmlSupportData::getMapOrigin( 
-   const ossimImageGeometry* geom,
-   ossimString& originString,
-   ossimString& offsetVector1String, 
-   ossimString& offsetVector2String ) const
-{
-   if ( geom )
-   {
-      if ( m_mapProj != 0 )
-      {
-         ossimDpt originMap = m_mapProj->getUlEastingNorthing();
-
-         std::ostringstream os;
-         os.precision(15);
-         os << originMap.x << " " << originMap.y;
-         originString = os.str();   
-      }
-
-      // Get the projected CS gsd:
-      ossimDpt gsdMap;
-      geom->getMetersPerPixel( gsdMap );
-
-      std::ostringstream os2;
-      os2.precision(15);
-      os2 << gsdMap.x << " " << "0.0";
-      offsetVector1String = os2.str();
-
-      std::ostringstream os3;
-      os3.precision(15);
-      os3 << "0.0" << " " << -gsdMap.y;
-      offsetVector2String = os3.str();
-   }
-
-} // End: ossimGmlSupportData::getMapBounds
-
-void ossimGmlSupportData::getLimits( const ossimImageGeometry* geom,
-                                     ossimString& gridHighString,
-                                     ossimString& gridLowString ) const
-{
-   if ( geom )
-   {
-      // Get the image bounding rect:
-      ossimIrect rect;
-      geom->getBoundingRect( rect );
-      
-      if ( rect.hasNans() == false )
-      {
-         std::ostringstream os;
-         os << rect.ul().x << " " << rect.ul().y;
-         gridLowString = os.str();
-         
-         std::ostringstream os2;
-         os2 << rect.lr().x << " " << rect.lr().y;
-         gridHighString = os2.str();
-      }
-   }
-   
-}
-
diff --git a/ossim/src/ossim/support_data/ossimIkonosMetaData.cpp b/ossim/src/ossim/support_data/ossimIkonosMetaData.cpp
deleted file mode 100644
index b72cbb9..0000000
--- a/ossim/src/ossim/support_data/ossimIkonosMetaData.cpp
+++ /dev/null
@@ -1,600 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-// 
-// Class definition for ossimIkonosMetaData.
-// 
-// This class parses a Space Imaging Ikonos meta data file.
-//
-//********************************************************************
-// $Id: ossimIkonosMetaData.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstdio>
-#include <iostream>
-#include <ossim/support_data/ossimIkonosMetaData.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-
-RTTI_DEF1(ossimIkonosMetaData, "ossimIkonosMetaData", ossimObject);
-
-// Define Trace flags for use within this file:
-static ossimTrace traceExec  ("ossimIkonosMetaData:exec");
-static ossimTrace traceDebug ("ossimIkonosMetaData:debug");
-
-ossimIkonosMetaData::ossimIkonosMetaData()
-  :
-  theNominalCollectionAzimuth(0.0),
-  theNominalCollectionElevation(0.0),
-  theSunAzimuth(0.0),
-  theSunElevation(0.0),
-  theNumBands(0),
-  theBandName("Unknown"),
-  theProductionDate("Unknown"),
-  theAcquisitionDate("Unknown"),
-  theAcquisitionTime("Unknown"),
-  theSensorID("Unknown")
-{
-}
-
-ossimIkonosMetaData::~ossimIkonosMetaData()
-{
-}
-
-bool ossimIkonosMetaData::open(const ossimFilename& imageFile)
-{
-   static const char MODULE[] = "ossimIkonosMetaData::open";
-   
-   clearFields();
-   
-   //retrieve information from the metadata file
-   //if the ikonos tif is po_2619900_pan_0000000.tif
-   //the metadata file will be po_2619900_metadata.txt
-
-   ossimString separator("_");
-   ossimString filenamebase = imageFile.fileNoExtension();
-   std::vector< ossimString > filenameparts = filenamebase.split(separator);
-   
-   if(filenameparts.size() < 2)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " Ikonos filename non standard" << std::endl;
-      }
-      return false;
-   }
-   ossimFilename metadatafile = filenameparts[0];
-   metadatafile += "_";
-   metadatafile += filenameparts[1];
-   metadatafile += "_metadata.txt";
-   
-   metadatafile.setPath(imageFile.path());
-   
-   if( parseMetaData(metadatafile) == false )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " errors parsing metadata" << std::endl;
-      }
-      return false;
-   }
-   
-   ossimFilename hdrfile = imageFile;
-   hdrfile.setExtension(ossimString("hdr"));
-   if( parseHdrData(hdrfile) == false )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " errors parsing hdr" << std::endl;
-      }
-      return false;
-   }
-   
-   ossimFilename rpcfile = imageFile.noExtension();
-   rpcfile += "_rpc.txt";
-   if (parseRpcData (rpcfile) == false)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " errors parsing rpc" << std::endl;
-      }
-      return false;
-   }
-
-   return true;
-}
-
-void ossimIkonosMetaData::clearFields()
-{
-  theNominalCollectionAzimuth = 0.0;
-  theNominalCollectionElevation = 0.0;
-  theSunAzimuth = 0.0;
-  theSunElevation = 0.0;
-  theNumBands = 0;
-  theBandName = "Unknown";
-  theProductionDate = "Unknown";
-  theAcquisitionDate = "Unknown";
-  theAcquisitionTime = "Unknown";
-  theSensorID = "Unknown";
-}
-
-std::ostream& ossimIkonosMetaData::print(std::ostream& out) const
-{
-
-  out << "\n----------------- Info on Ikonos Image -------------------"
-      << "\n  "
-      << "\n  Nominal Azimuth:    " << theNominalCollectionAzimuth
-      << "\n  Nominal Elevation:   " << theNominalCollectionElevation
-      << "\n  Sun Azimuth:    " << theSunAzimuth
-      << "\n  Sun Elevation:   " << theSunElevation
-      << "\n  Number of bands:   " << theNumBands
-      << "\n  Band name:   " << theBandName
-      << "\n  Production date:   " << theProductionDate
-      << "\n  Acquisition date:   " << theAcquisitionDate
-      << "\n  Acquisition time:   " << theAcquisitionTime
-      << "\n  Sensor Type:   " << theSensorID
-      << "\n"
-      << "\n---------------------------------------------------------"
-      << "\n  " << std::endl;
-  return out;
-}
-
-ossimString ossimIkonosMetaData::getSensorID() const
-{
-  return theSensorID;
-}
-
-bool ossimIkonosMetaData::saveState(ossimKeywordlist& kwl,
-                                    const char* prefix)const
-{
-
-  kwl.add(prefix,
-          ossimKeywordNames::TYPE_KW,
-          "ossimIkonosMetaData",
-          true);
-
-  kwl.add(prefix,
-          "nominal_collection_azimuth_angle",
-          theNominalCollectionAzimuth,
-          true);
-
-  kwl.add(prefix,
-          "nominal_collection_elevation_angle",
-          theNominalCollectionElevation,
-          true);
-          
-  kwl.add(prefix,
-          ossimKeywordNames::AZIMUTH_ANGLE_KW,
-          theSunAzimuth,
-          true);
-
-  kwl.add(prefix,
-          ossimKeywordNames::ELEVATION_ANGLE_KW,
-          theSunElevation,
-          true);
-
-  kwl.add(prefix,
-          ossimKeywordNames::NUMBER_BANDS_KW,
-          theNumBands,
-          true);
-
-  kwl.add(prefix,
-          "band_name",
-          theBandName,
-          true);
-
-  kwl.add(prefix,
-          "production_date",
-          theProductionDate,
-          true);
-
-  kwl.add(prefix,
-          "acquisition_date",
-          theAcquisitionDate,
-          true);
-
-  kwl.add(prefix,
-          "acquisition_time",
-          theAcquisitionTime,
-          true);
-
-  kwl.add(prefix,
-          "sensor",
-          theSensorID,
-          true);
-
-  return true;
-}
-
-bool ossimIkonosMetaData::loadState(const ossimKeywordlist& kwl,
-                                    const char* prefix)
-{
-   clearFields();
-
-   const char* lookup = 0;
-   ossimString s;
-  
-   lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      if(s != "ossimIkonosMetaData")
-      {
-         return false;
-      }
-   }
-
-  lookup = kwl.find(prefix, "nominal_collection_azimuth_angle");
-  if (lookup)
-  {
-     s = lookup;
-     theNominalCollectionAzimuth = s.toFloat64();
-  }
-
-  lookup = kwl.find(prefix, "nominal_collection_elevation_angle");
-  if (lookup)
-  {
-     s = lookup;
-     theNominalCollectionElevation = s.toFloat64();
-  }
-  
-   lookup = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      theSunAzimuth = s.toFloat64();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      theSunElevation = s.toFloat64();
-   }
-  
-   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
-   if (lookup)
-   {
-      s = lookup;
-      theNumBands = s.toUInt32();
-   }
-
-   lookup = kwl.find(prefix, "band_name");
-   if (lookup)
-   {
-      theBandName = lookup;
-   }
-
-   lookup = kwl.find(prefix, "production_date");
-   if (lookup)
-   {
-      theProductionDate = lookup;
-   }
-
-  lookup = kwl.find(prefix, "acquisition_date");
-  if (lookup)
-  {
-     theAcquisitionDate = lookup;
-  }
-
-  lookup = kwl.find(prefix, "acquisition_time");
-  if (lookup)
-  {
-     theAcquisitionTime = lookup;
-  }
-
-  lookup = kwl.find(prefix, "sensor");
-  if (lookup)
-  {
-     theSensorID = lookup;
-  }
-  
-   return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimIkonosMetaData::parseMetaData()
-//
-//  Parses the Ikonos metadata file.
-//
-//*****************************************************************************
-bool ossimIkonosMetaData::parseMetaData(const ossimFilename& data_file)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): entering..."
-         << std::endl;
-   }
-
-   FILE* fptr = fopen (data_file, "r");
-   if (!fptr)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimIkonosRpcModel::parseMetaData(data_file) DEBUG:"
-            << "\nCould not open Meta data file:  " << data_file
-            << "\nreturning with error..." << std::endl;
-      }
-      return false;
-   }
-
-   char* strptr;
-   char dummy[80], name[80];
-   double value;
-
-   //---
-   // Read the file into a buffer:
-   //---
-   ossim_int32 fileSize = static_cast<ossim_int32>(data_file.fileSize());
-   char* filebuf = new char[fileSize];
-   fread(filebuf, 1, fileSize, fptr);
-   fclose(fptr);
-
-   //---
-   // Production date:
-   //---
-   strptr = strstr(filebuf, "\nCreation Date:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << std::endl;
-      }
-      delete [] filebuf;
-      return false;
-   }
-
-   sscanf(strptr, "%15c %s", dummy, name);
-   theProductionDate = name;
-
-   //***
-   // Sensor Type:
-   //***
-   strptr = strstr(strptr, "\nSensor:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      { 
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << std::endl;
-      }
-      delete [] filebuf;
-      return false;
-   }
-
-   sscanf(strptr, "%8c %s", dummy, name);
-   theSensorID = name;
-
-
-   //***
-   // Nominal Azimuth:
-   //***
-   strptr = strstr(strptr, "\nNominal Collection Azimuth:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << std::endl;
-      }
-      delete [] filebuf;
-      return false;
-   }
-
-   sscanf(strptr, "%28c %lf %s", dummy, &value, dummy);
-   theNominalCollectionAzimuth = value;
-
-   //***
-   // Nominal Elevation:
-   //***
-   strptr = strstr(strptr, "\nNominal Collection Elevation:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << std::endl;
-      }
-      delete [] filebuf;
-      return false;
-   }
-  
-   sscanf(strptr, "%31c %lf %s", dummy, &value, dummy);
-   theNominalCollectionElevation = value;
-
-   //***
-   // Sun Azimuth:
-   //***
-   strptr = strstr(strptr, "\nSun Angle Azimuth:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << std::endl;
-      }
-      delete [] filebuf;
-      return false;
-   }
-
-   sscanf(strptr, "%19c %lf %s", dummy, &value, dummy);
-   theSunAzimuth = value;
-
-   //***
-   // Sun Elevation:
-   //***
-   strptr = strstr(strptr, "\nSun Angle Elevation:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed meta-data file." << std::endl;
-      }
-      delete [] filebuf;
-      return false;
-   }
-
-   sscanf(strptr, "%21c %lf %s", dummy, &value, name);
-   theSunElevation = value;
-
-   //---
-   // Acquisition date and time:
-   //---
-   strptr = strstr(filebuf, "\nAcquisition Date/Time:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-      ossimNotify(ossimNotifyLevel_FATAL)
-          << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
-          << "\n\tAborting construction. Error encountered parsing "
-          << "presumed meta-data file." << std::endl;
-      }
-      delete [] filebuf;
-      return false;
-   }
-
-   char name2[80];
-   sscanf(strptr, "%23c %s %s", dummy, name, name2);
-   theAcquisitionDate = name;
-   theAcquisitionTime = name2;
-
-   delete [] filebuf;
-   filebuf = 0;
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): returning..."
-         << std::endl;
-   }
-
-   return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimIkonosMetaData::parseHdrData()
-//
-//  Parses the Ikonos hdr file.
-//
-//*****************************************************************************
-bool ossimIkonosMetaData::parseHdrData(const ossimFilename& data_file)
-{
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): entering..."
-         << std::endl;
-   }
-
-   FILE* fptr = fopen (data_file, "r");
-   if (!fptr)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
-            << "\nCould not open hdr data file <" << data_file << ">. "
-            << "returning with error..." << std::endl;
-      }
-      return false;
-   }
-
-   char* strptr;
-   // char linebuf[80];
-   char dummy[80];
-   char name[80];
-   int value=0;
-
-   //***
-   // Read the file into a buffer:
-   //***
-   char filebuf[5000];
-   fread(filebuf, 1, 5000, fptr);
-   fclose(fptr);
-
-   //***
-   // Band name:
-   //***
-   strptr = strstr(filebuf, "\nBand:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file):"
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed hdr file." << std::endl;
-      }
-
-      return false;
-   }
-
-   sscanf(strptr, "%6c %s", dummy, name);
-   theBandName = name;
-
-   //***
-   // Number of Bands:
-   //***
-   strptr = strstr(filebuf, "\nNumber of Bands:");
-   if (!strptr)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimIkonosRpcModel::parseHdrData(data_file):"
-            << "\n\tAborting construction. Error encountered parsing "
-            << "presumed hdr file." << std::endl;
-      }
-
-      return false;
-   }
-
-   sscanf(strptr, "%17c %d", dummy, &value);
-   theNumBands = value;
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): returning..."
-         << std::endl;
-   }
-   return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimIkonosMetaData::parseRpcData()
-//
-//  Parses the Ikonos rpc file.
-//
-//*****************************************************************************
-bool ossimIkonosMetaData::parseRpcData(const ossimFilename& /* data_file */)
-{
-   return true;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimInfoBase.cpp b/ossim/src/ossim/support_data/ossimInfoBase.cpp
deleted file mode 100644
index 806de9b..0000000
--- a/ossim/src/ossim/support_data/ossimInfoBase.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Base class for Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <sstream>
-
-ossimInfoBase::ossimInfoBase()
-   : theOverviewFlag(true)
-{}
-
-ossimInfoBase::~ossimInfoBase()
-{}
-
-void ossimInfoBase::setProcessOverviewFlag(bool flag)
-{
-   theOverviewFlag = flag;
-}
-
-bool ossimInfoBase::getProcessOverviewFlag() const
-{
-   return theOverviewFlag;
-}
-
-bool ossimInfoBase::getKeywordlist(ossimKeywordlist& kwl)const
-{  
-   // Do a print to a memory stream.
-   std::ostringstream out;
-   print(out);
-
-   std::istringstream in(out.str());
-   // Give the result to the keyword list.
-   return kwl.parseStream(in);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimInfoFactory.cpp b/ossim/src/ossim/support_data/ossimInfoFactory.cpp
deleted file mode 100644
index ac8f16c..0000000
--- a/ossim/src/ossim/support_data/ossimInfoFactory.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Factory for info objects.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimInfoFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimInfoFactory.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/support_data/ossimCcfInfo.h>
-#include <ossim/support_data/ossimDemInfo.h>
-#include <ossim/support_data/ossimDoqq.h>
-#include <ossim/support_data/ossimDtedInfo.h>
-#include <ossim/support_data/ossimEnviInfo.h>
-#include <ossim/support_data/ossimJ2kInfo.h>
-#include <ossim/support_data/ossimJp2Info.h>
-#include <ossim/support_data/ossimLasInfo.h>
-#include <ossim/support_data/ossimNitfInfo.h>
-#include <ossim/support_data/ossimRpfInfo.h>
-#include <ossim/support_data/ossimTiffInfo.h>
-#include <ossim/support_data/ossimXmpInfo.h>
-
-#include <ossim/base/ossimFilename.h>
-
-ossimInfoFactory* ossimInfoFactory::theInstance = 0;
-
-ossimInfoFactory::~ossimInfoFactory()
-{}
-
-ossimInfoFactory* ossimInfoFactory::instance()
-{
-   if ( !theInstance )
-   {
-      theInstance = new ossimInfoFactory;
-   }
-   return theInstance;
-}
-
-ossimInfoBase* ossimInfoFactory::create(const ossimFilename& file) const
-{
-   ossimRefPtr<ossimInfoBase> result = 0;
-
-   result = new ossimTiffInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimJp2Info();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimNitfInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimDemInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimDtedInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimEnviInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimRpfInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-   
-   result = new ossimXmpInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-   
-   result = new ossimLasInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimDoqq();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-
-   result = new ossimJ2kInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-   
-   result = new ossimCcfInfo();
-   if ( result->open(file) )
-   {
-      return result.release();
-   }
-   
-   return 0;
-}
-
-ossimInfoFactory::ossimInfoFactory()
-{}
-
-ossimInfoFactory::ossimInfoFactory(const ossimInfoFactory& /* obj */ )
-{}
-
-const ossimInfoFactory& ossimInfoFactory::operator=(
-   const ossimInfoFactory& /* rhs */)
-{
-   return *this;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimInfoFactoryRegistry.cpp b/ossim/src/ossim/support_data/ossimInfoFactoryRegistry.cpp
deleted file mode 100644
index 2317e83..0000000
--- a/ossim/src/ossim/support_data/ossimInfoFactoryRegistry.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file
-//
-// Author:  David Burken
-//
-// Description: Class definition of registry (singleton) for info factories.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/support_data/ossimInfoFactoryRegistry.h>
-#include <ossim/support_data/ossimInfoFactoryInterface.h>
-#include <ossim/support_data/ossimInfoFactory.h>
-
-#include <algorithm> /* for std::find */
-
-ossimInfoFactoryRegistry* ossimInfoFactoryRegistry::m_instance = 0;
-
-ossimInfoFactoryRegistry::~ossimInfoFactoryRegistry()
-{
-   m_factoryList.clear();
-}
-
-ossimInfoFactoryRegistry* ossimInfoFactoryRegistry::instance()
-{
-   if ( !m_instance )
-   {
-      m_instance = new ossimInfoFactoryRegistry;
-   }
-   return m_instance;
-}
-
-void ossimInfoFactoryRegistry::registerFactory(
-   ossimInfoFactoryInterface* factory)
-{
-   if (factory)
-   {
-      m_mutex.lock();
-      m_factoryList.push_back(factory);
-      m_mutex.unlock();
-   }
-}
-
-void ossimInfoFactoryRegistry::registerFactoryToFront(
-   ossimInfoFactoryInterface* factory)
-{
-   if (factory)
-   {
-      m_mutex.lock();
-      m_factoryList.insert( m_factoryList.begin(), factory );
-      m_mutex.unlock();
-   }
-}
-
-void ossimInfoFactoryRegistry::unregisterFactory(
-   ossimInfoFactoryInterface* factory)
-{
-   m_mutex.lock();
-   std::vector<ossimInfoFactoryInterface*>::iterator i =
-      std::find(m_factoryList.begin(), m_factoryList.end(), factory);
-   
-   if( i != m_factoryList.end() )
-   {
-      m_factoryList.erase(i);
-   }
-   m_mutex.unlock();
-}
-
-ossimInfoBase* ossimInfoFactoryRegistry::create(
-   const ossimFilename& file) const
-{
-   ossimInfoBase* result = 0;
-   
-   std::vector<ossimInfoFactoryInterface*>::const_iterator i =
-      m_factoryList.begin();
-
-   while ( i != m_factoryList.end() )
-   {
-      result = (*i)->create(file);
-      if ( result )
-      {
-         break;
-      }
-      ++i;
-   }
-
-   return result;
-}
-
-/** hidden from use default constructor */
-ossimInfoFactoryRegistry::ossimInfoFactoryRegistry()
-   : m_factoryList(),
-     m_mutex()
-{
-   this->registerFactory(ossimInfoFactory::instance());
-}
-
-/** hidden from use copy constructor */
-ossimInfoFactoryRegistry::ossimInfoFactoryRegistry(
-   const ossimInfoFactoryRegistry& /* obj */)
-{}
-
-/** hidden from use operator = */
-const ossimInfoFactoryRegistry& ossimInfoFactoryRegistry::operator=(
-   const ossimInfoFactoryRegistry& /* rhs */ )
-{
-   return *this;
-}
diff --git a/ossim/src/ossim/support_data/ossimJ2kCodRecord.cpp b/ossim/src/ossim/support_data/ossimJ2kCodRecord.cpp
deleted file mode 100644
index 41b83f9..0000000
--- a/ossim/src/ossim/support_data/ossimJ2kCodRecord.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Container class for J2K Coding style default (COD) record.
-//
-// See document BPJ2K01.00 Table 7-7 Image and tile size (15444-1 Annex A5.1)
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJ2kCodRecord.h,v 1.5 2005/10/13 21:24:47 dburken Exp $
-
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimJ2kCodRecord.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEndian.h>
-
-
-ossimJ2kCodRecord::ossimJ2kCodRecord()
-   :
-   m_marker(0xff52),
-   m_lcod(0),
-   m_scod(0),
-   m_progressionOrder(0),
-   m_numberOfLayers(0),
-   m_multipleComponentTransform(0),
-   m_numberOfDecompositionLevels(0),
-   m_codeBlockWidth(0),
-   m_codeBlockHeight(0),
-   m_codeBlockStyle(0),
-   m_transformation(0),
-   m_precinctSize(0)
-{
-}
-
-ossimJ2kCodRecord::~ossimJ2kCodRecord()
-{
-}
-
-void ossimJ2kCodRecord::parseStream(std::istream& in)
-{
-   // Get the stream posistion.
-   std::streamoff pos = in.tellg();
-
-   // Note: Marker is not read.
-   in.read((char*)&m_lcod, 2);
-   in.read((char*)&m_scod, 1);
-   in.read((char*)&m_progressionOrder, 1);
-   in.read((char*)&m_numberOfLayers, 2);
-   in.read((char*)&m_multipleComponentTransform, 1);
-   in.read((char*)&m_numberOfDecompositionLevels, 1);
-   in.read((char*)&m_codeBlockWidth, 1);
-   in.read((char*)&m_codeBlockHeight, 1);
-   in.read((char*)&m_codeBlockStyle, 1);
-   in.read((char*)&m_transformation, 1);
-
-   //---
-   // SPcod - precinct size (only is defined, Scod = xxxx xxx1)
-   //---   
-   if ( 0 )
-   {
-      in.read((char*)&m_precinctSize, 1);
-   }
-
-   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
-   {
-      // Stored big endian, must swap.
-      ossimEndian s;
-      s.swap(m_lcod);
-      s.swap(m_numberOfLayers);
-   }
-
-   //---
-   // Seek to next record.  This is needed because there are sometimes extra
-   // bytes.
-   //---
-   in.seekg(pos + m_lcod, std::ios_base::beg);
-}
-
-std::ostream& ossimJ2kCodRecord::print(std::ostream& out,
-                                       const std::string& prefix) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   std::string pfx = prefix;
-   pfx += "cod.";
-
-   out.setf(std::ios_base::hex, std::ios_base::basefield);
-   out << pfx << "marker: 0x" << m_marker << "\n";
-   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
-
-   out << pfx << "Lcod: " << m_lcod       << "\n"
-       << pfx << "Scod: " << int(m_scod)  << "\n"
-       << pfx << "SGcod_progression_order:  " << int(m_progressionOrder) << "\n"
-       << pfx << "SGcod_number_of_layers:  " << m_numberOfLayers << "\n"
-       << pfx << "SGcod_multiple_component_transform:  "
-       << int(m_multipleComponentTransform) << "\n"
-       << pfx << "SPcod_mumber_of_decomposition_levels: "
-       << int(m_numberOfDecompositionLevels) << "\n"
-       << pfx << "SPcod_code_block_width: " << int(m_codeBlockWidth) << "\n"
-       << pfx << "SPcod_code_block_height: " << int(m_codeBlockHeight) << "\n"
-       << pfx << "SPcod_code_block_style: " << int(m_codeBlockStyle) << "\n"
-       << pfx << "SPcod_transformation: " << int(m_transformation) << "\n"
-       << pfx << "SPcod_precinct_size: " << int(m_precinctSize)
-       << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-
-   return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimJ2kCodRecord& obj)
-{
-   return obj.print(out);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimJ2kInfo.cpp b/ossim/src/ossim/support_data/ossimJ2kInfo.cpp
deleted file mode 100644
index 821cd61..0000000
--- a/ossim/src/ossim/support_data/ossimJ2kInfo.cpp
+++ /dev/null
@@ -1,239 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: J2K Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/support_data/ossimJ2kInfo.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-// #include <ossim/support_data/ossimJ2kCommon.h>
-#include <ossim/support_data/ossimJ2kCodRecord.h>
-#include <ossim/support_data/ossimJ2kSizRecord.h>
-#include <ossim/support_data/ossimJ2kSotRecord.h>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimJ2kInfo:debug");
-static ossimTrace traceDump("ossimJ2kInfo:dump"); // This will dump offsets.
-
-ossimJ2kInfo::ossimJ2kInfo()
-   : ossimInfoBase(),
-     m_file(),
-     m_endian(0)
-{
-   // See if we need to byte swap.  J2k, JP2 boxes are big endian.
-   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
-   {
-      m_endian = new ossimEndian();
-   }
-}
-
-ossimJ2kInfo::~ossimJ2kInfo()
-{
-   if (m_endian)
-   {
-      delete m_endian;
-      m_endian = 0;
-   }
-}
-
-bool ossimJ2kInfo::open(const ossimFilename& file)
-{
-   bool result = false;
-
-   //---
-   // Open the file.
-   //---
-   std::ifstream str(file.c_str(), std::ios_base::binary|std::ios_base::in);
-   if (str.good()) 
-   {
-      //---
-      // Check for the Start Of Codestream (SOC) and Size (SIZ) markers which
-      // are required as first and second fields in the main header.
-      //---
-      ossim_uint16 soc;
-      ossim_uint16 siz;
-      readUInt16(soc, str);
-      readUInt16(siz, str);
-
-      const ossim_uint16 SOC_MARKER = 0xff4f; // start of codestream marker
-      const ossim_uint16 SIZ_MARKER = 0xff51; // size maker
-      
-      if ( (soc == SOC_MARKER) && (siz == SIZ_MARKER) )
-      {
-         result = true; // Is a j2k...
-      }
-   }
-
-   if (result)
-   {
-      
-      m_file = file;
-   }
-   else
-   {
-      m_file.clear();
-      if (m_endian)
-      {
-         delete m_endian;
-         m_endian = 0;
-      }
-   }
-
-   return result;
-}
-
-std::ostream& ossimJ2kInfo::print(std::ostream& out) const
-{
-   static const char MODULE[] = "ossimJ2kInfo::print";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG Entered...\n";
-   }
-
-   if ( m_file.size() )
-   {  
-      // Open the file.
-      std::ifstream str(m_file.c_str(), std::ios_base::binary|std::ios_base::in);
-      if (str.good())
-      {
-         ossim_uint16 marker;
-         readUInt16(marker, str); // SOC
-         readUInt16(marker, str); // SIZ
-         
-         std::string prefix = "j2k.";
-         
-         // SIZ marker required next.
-         printSizMarker(out, prefix, str);
-         
-         readUInt16(marker, str);
-
-         const ossim_uint16 COD_MARKER = 0xff52; // cod maker
-         const ossim_uint16 EOC_MARKER = 0xffd9; // End of codestream marker.
-         const ossim_uint16 SOT_MARKER = 0xff90; // start of tile marker
-         
-         while ( str.good() && (marker != EOC_MARKER) )
-         {
-            switch(marker)
-            {
-               case COD_MARKER:
-               {
-                  printCodMarker(out, prefix, str);
-                  break;
-               }
-               case SOT_MARKER:
-               {
-                  printSotMarker(out, prefix, str);
-                  break;
-               }
-               default:
-               {
-                  printUnknownMarker(out, prefix, str, marker);
-               }
-            }
-            
-            readUInt16(marker, str);
-            
-         }
-      }
-   }
-
-   return out;
-}
-
-void ossimJ2kInfo::readUInt16(ossim_uint16& s, std::ifstream& str) const
-{
-   str.read((char*)&s, 2);
-   if (m_endian)
-   {
-      m_endian->swap(s);
-   }
-}
-
-std::ostream& ossimJ2kInfo::printCodMarker(std::ostream& out,
-                                           const std::string& prefix,
-                                           std::ifstream& str) const
-{
-   ossimJ2kCodRecord siz;
-   siz.parseStream(str);
-   siz.print(out, prefix);
-   return out;
-}
-
-std::ostream& ossimJ2kInfo::printSizMarker(std::ostream& out,
-                                           const std::string& prefix,
-                                           std::ifstream& str) const
-{
-   ossimJ2kSizRecord siz;
-   siz.parseStream(str);
-   siz.print(out, prefix);
-   return out;
-}
-
-std::ostream& ossimJ2kInfo::printSotMarker(std::ostream& out,
-                                           const std::string& prefix,
-                                           std::ifstream& str) const
-{
-   // Get the stream posistion.
-   std::streamoff pos = str.tellg();
-   
-   ossimJ2kSotRecord sot;
-   sot.parseStream(str);
-   pos += sot.thePsot - 2;
-
-   // Seek past the tile to the next marker.
-   str.seekg(pos, std::ios_base::beg);
-   
-   sot.print(out,prefix);
-   return out;
-}
-
-
-std::ostream& ossimJ2kInfo::printUnknownMarker(std::ostream& out,
-                                               const std::string& prefix,
-                                               std::ifstream& str,
-                                               ossim_uint16 marker) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   ossim_uint16 segmentLength;
-   readUInt16(segmentLength, str);
-
-   std::string pfx = prefix;
-   pfx += "unkown.";
-
-   out.setf(std::ios_base::hex, std::ios_base::basefield);
-   out << pfx << "marker: 0x" << std::setfill('0') << std::setw(4)
-       << marker << "\n";
-   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
-   
-   out << pfx << "length: " << segmentLength
-       << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-
-   // Seek to the next marker.
-   str.seekg( (segmentLength-2), std::ios_base::cur);
-
-   return out;
-}
-      
-
-
diff --git a/ossim/src/ossim/support_data/ossimJ2kSizRecord.cpp b/ossim/src/ossim/support_data/ossimJ2kSizRecord.cpp
deleted file mode 100644
index 3c90b66..0000000
--- a/ossim/src/ossim/support_data/ossimJ2kSizRecord.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Container class for J2K Image and tile size (SIZ) record.
-//
-// See document BPJ2K01.00 Table 7-6 Image and tile size (15444-1 Annex A5.1)
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJ2kSizRecord.h,v 1.5 2005/10/13 21:24:47 dburken Exp $
-
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimJ2kSizRecord.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEndian.h>
-
-
-ossimJ2kSizRecord::ossimJ2kSizRecord()
-   :
-   m_marker(0xff51),
-   m_Lsiz(0),
-   m_Rsiz(0),
-   m_Xsiz(0),
-   m_Ysiz(0),
-   m_XOsiz(0),
-   m_YOsiz(0),
-   m_XTsiz(0),
-   m_YTsiz(0),
-   m_XTOsiz(0),
-   m_YTOsiz(0),
-   m_Csiz(0),
-   m_Ssiz(0),
-   m_XRsiz(0),
-   m_YRsiz(0)
-{
-}
-
-ossimJ2kSizRecord::~ossimJ2kSizRecord()
-{
-}
-
-void ossimJ2kSizRecord::parseStream(std::istream& in)
-{
-   // Get the stream posistion.
-   std::streamoff pos = in.tellg();
-
-   // Note: Marker is not read.
-   in.read((char*)&m_Lsiz,      2);
-   in.read((char*)&m_Rsiz,      2);
-   in.read((char*)&m_Xsiz,      4);
-   in.read((char*)&m_Ysiz,      4);
-   in.read((char*)&m_XOsiz,     4);
-   in.read((char*)&m_YOsiz,     4);
-   in.read((char*)&m_XTsiz,     4);
-   in.read((char*)&m_YTsiz,     4);
-   in.read((char*)&m_XTOsiz,    4);
-   in.read((char*)&m_YTOsiz,    4);
-   in.read((char*)&m_Csiz,      2);
-   in.read((char*)&m_Ssiz,      1);
-   in.read((char*)&m_XRsiz,     1);
-   in.read((char*)&m_YRsiz,     1);
-
-   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
-   {
-      // Stored big endian, must swap.
-      ossimEndian s;
-      s.swap(m_Lsiz);
-      s.swap(m_Rsiz);
-      s.swap(m_Xsiz);
-      s.swap(m_Ysiz);
-      s.swap(m_XOsiz);
-      s.swap(m_YOsiz);
-      s.swap(m_XTsiz);
-      s.swap(m_YTsiz);
-      s.swap(m_XTOsiz);
-      s.swap(m_YTOsiz);
-      s.swap(m_Csiz);
-   }
-
-   //---
-   // Seek to next record.  This is needed because there are sometimes extra
-   // bytes.
-   //---
-   in.seekg(pos + m_Lsiz, std::ios_base::beg);
-}
-
-ossimScalarType ossimJ2kSizRecord::getScalarType() const
-{
-   ossimScalarType result = OSSIM_SCALAR_UNKNOWN;
-
-   // Bits per pixel first seven bits plus one.
-   ossim_uint8 bpp = ( m_Ssiz & 0x3f ) + 1;
-
-   // Signed bit is msb.
-   bool isSigned = ( m_Ssiz & 0x80 ) ? true : false;
-
-   // std::cout << "bpp: " << int(bpp) << " signed: " << isSigned << std::endl;
-      
-   if ( bpp <= 8 )
-   {
-      if ( isSigned == 0 )
-      {
-         result = OSSIM_UINT8;
-      }
-      else if (isSigned == 1)
-      {
-         result = OSSIM_SINT8;
-      }
-   }
-   else if ( bpp == 11 )
-   {
-      if ( isSigned == 0 )
-      {
-         result = OSSIM_USHORT11;
-      }
-      else
-      {
-         result = OSSIM_SINT16;
-      }
-   }
-   else if( bpp <= 16 )
-   {
-      if( isSigned == 0 )
-      {
-         result = OSSIM_UINT16;
-      }
-      else if( isSigned == 1 )
-      {
-         result = OSSIM_SINT16;
-      }
-   }
-   return result;
-}
-
-std::ostream& ossimJ2kSizRecord::print(std::ostream& out,
-                                       const std::string& prefix) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   std::string pfx = prefix;
-   pfx += "siz.";
-
-   out.setf(std::ios_base::hex, std::ios_base::basefield);
-   out << pfx << "marker: 0x" << m_marker << "\n";
-   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
-
-   out << pfx << "Lsiz:   " << m_Lsiz       << "\n"
-       << pfx << "Rsiz:   " << m_Rsiz       << "\n"
-       << pfx << "Xsiz:   " << m_Xsiz       << "\n"
-       << pfx << "Yziz:   " << m_Ysiz       << "\n"
-       << pfx << "XOsiz:  " << m_XOsiz      << "\n"
-       << pfx << "YOsiz:  " << m_YOsiz      << "\n"
-       << pfx << "XTsiz:  " << m_XTsiz      << "\n"
-       << pfx << "YTsiz:  " << m_YTsiz      << "\n"
-       << pfx << "XTOsiz: " << m_XTOsiz     << "\n"
-       << pfx << "YTOsiz: " << m_YTOsiz     << "\n"
-       << pfx << "Csiz:   " << m_Csiz       << "\n"
-       << pfx << "Ssiz:   " << int(m_Ssiz)  << "\n"
-       << pfx << "XRsiz:  " << int(m_XRsiz) << "\n"
-       << pfx << "YRsiz:  " << int(m_YRsiz)
-       << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-
-   return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimJ2kSizRecord& obj)
-{
-   return obj.print(out);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimJ2kSotRecord.cpp b/ossim/src/ossim/support_data/ossimJ2kSotRecord.cpp
deleted file mode 100644
index 5f1d827..0000000
--- a/ossim/src/ossim/support_data/ossimJ2kSotRecord.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// // Description: Container class for J2K "Start Of Tile" (SOT) record.
-//
-// See document BPJ2K01.00 Table 7-3 Image and tile size (15444-1 Annex A.4.2)
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJ2kSotRecord.h,v 1.5 2005/10/13 21:24:47 dburken Exp $
-
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimJ2kSotRecord.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEndian.h>
-
-ossimJ2kSotRecord::ossimJ2kSotRecord()
-   :
-   theMarker(0xff90),
-   theLsot(0),
-   theIsot(0),
-   thePsot(0),
-   theTpsot(0),
-   theTnsot(0)
-{
-}
-
-ossimJ2kSotRecord::~ossimJ2kSotRecord()
-{
-}
-
-void ossimJ2kSotRecord::parseStream(std::istream& in)
-{
-   // Note: marker not read...
-   
-   in.read((char*)&theLsot,  2);
-   in.read((char*)&theIsot,  2);
-   in.read((char*)&thePsot,  4);
-   in.read((char*)&theTpsot, 1);
-   in.read((char*)&theTnsot, 1);
-
-   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
-   {
-      // Stored big endian, must swap.
-      ossimEndian s;
-      s.swap(theLsot);
-      s.swap(theIsot);
-      s.swap(thePsot);
-   }
-}
-
-std::ostream& ossimJ2kSotRecord::print(std::ostream& out,
-                                       const std::string& prefix) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   std::string pfx = prefix;
-   pfx += "sot.";
-
-   out.setf(std::ios_base::hex, std::ios_base::basefield);
-   out << pfx << "marker: 0x" << theMarker << "\n";
-   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
-
-   out << pfx << "Lsot:   "  << theLsot      << "\n"
-       << pfx << "Isot:   "  << theIsot      << "\n"
-       << pfx << "Psot:   "  << thePsot      << "\n"
-       << pfx << "Tpsot:  " << int(theTpsot) << "\n"
-       << pfx << "Tnsot:  " << int(theTnsot)
-       << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-
-   return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimJ2kSotRecord& obj)
-{
-   return obj.print(out);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimJp2Info.cpp b/ossim/src/ossim/support_data/ossimJp2Info.cpp
deleted file mode 100644
index 31bb756..0000000
--- a/ossim/src/ossim/support_data/ossimJp2Info.cpp
+++ /dev/null
@@ -1,654 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: JP2 Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimJp2Info.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimJp2Info.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimTrace.h>
-// #include <ossim/support_data/ossimJ2kCommon.h>
-#include <ossim/support_data/ossimTiffInfo.h>
-#include <fstream>
-#include <istream>
-#include <iostream>
-
-static ossimTrace traceDebug("ossimJp2Info:debug");
-
-ossimJp2Info::ossimJp2Info()
-   : ossimJ2kInfo()
-{
-}
-
-ossimJp2Info::~ossimJp2Info()
-{
-}
-
-bool ossimJp2Info::open(const ossimFilename& file)
-{
-   bool result = false;
-
-   std::ifstream str;
-   str.open( file.c_str(), std::ios_base::in | std::ios_base::binary);
-
-   if ( str.is_open() )
-   {
-      const ossim_uint8 J2K_SIGNATURE_BOX[SIGNATURE_BOX_SIZE] = 
-         {0x00,0x00,0x00,0x0c,0x6a,0x50,0x20,0x20,0x0d,0x0a,0x87,0x0a};
-      
-      ossim_uint8 box[SIGNATURE_BOX_SIZE];
-      
-      // Read in the box.
-      str.read((char*)box, SIGNATURE_BOX_SIZE);
-      
-      result = true;
-      for (ossim_uint32 i = 0; i < SIGNATURE_BOX_SIZE; ++i)
-      {
-         if (box[i] != J2K_SIGNATURE_BOX[i])
-         {
-            result = false;
-            break;
-         }
-      }
-      
-      str.close();
-   }
-
-   if ( result )
-   {
-      m_file = file; // Capture file name.
-   }
-   
-   return result;
-}
-
-std::ostream& ossimJp2Info::print(std::ostream& out) const
-{
-   if ( m_file.size() )
-   {
-      // Open the file.
-      std::ifstream str( m_file.c_str(), std::ios_base::in | std::ios_base::binary );
-      if (str.good())
-      {
-         //---
-         // ISO/IEC 15444-1:2004 (E)
-         // LBox, Box Length. This field specifies the length of the box, stored
-         // as a 4-byte big endian unsigned integer. This value includes all of
-         // the fields of the box, including the length and type. If the value
-         // of this field is 1, then the XLBox field shall exist and the value
-         // of that field shall be the actual length of the box. If the value
-         // of this field is 0, then the length of the box was not known when
-         // the LBox field was written. In this case, this box contains all
-         // bytes up to the end of the file. If a box of length 0 is contained
-         // within another box (its superbox), then the length of that superbox
-         // shall also be 0.  This means that this box is the last box in the
-         // file. The values 2-7 are reserved for ISO use.
-         //---
-         ossim_uint32 lbox  = 0;
-         ossim_uint32 tbox  = 0;
-         ossim_uint64 xlbox = 0;
-
-         const ossim_uint32 UUID_TYPE = 0x75756964;
-         const ossim_uint8 GEOTIFF_UUID[GEOTIFF_UUID_SIZE] = 
-            {
-               0xb1, 0x4b, 0xf8, 0xbd,
-               0x08, 0x3d, 0x4b, 0x43,
-               0xa5, 0xae, 0x8c, 0xd7,
-               0xd5, 0xa6, 0xce, 0x03
-            };
-         
-         while ( str.good() )
-         {
-            std::streamoff boxPos = str.tellg();
-            
-            readUInt32( lbox, str );
-            readUInt32( tbox, str );
-            
-            if ( 1 == lbox )
-            {
-               readUInt64( xlbox, str );
-            }
-
-            if ( traceDebug() )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "jp2.lbox: " << std::dec << lbox << "\n"
-                  << "jp2.tbox: " << std::hex << tbox << std::dec << "\n";
-               printTboxType( tbox, ossimNotify(ossimNotifyLevel_DEBUG)  );
-
-               if ( 1 == lbox )
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG) << "jp2.xlbox: " << xlbox << std::endl;
-               }
-            }            
-            
-            if (tbox == UUID_TYPE)
-            {
-               // Check for GeoTIFF box.
-               
-               ossim_uint8 geotiffUuid[GEOTIFF_UUID_SIZE];
-               
-               // Read in the id.
-               str.read((char*)geotiffUuid, GEOTIFF_UUID_SIZE);
-
-#if 0
-               bool foundIt = true;
-               for (ossim_uint32 i = 0; i < GEOTIFF_UUID_SIZE; ++i)
-               {
-                  if (geotiffUuid[i] != GEOTIFF_UUID[i])
-                  {
-                     foundIt = false;
-                     break;
-                  }
-               }
-#endif          
-
-               if( memcmp( (char*)geotiffUuid, GEOTIFF_UUID, GEOTIFF_UUID_SIZE) == 0)
-               {
-                  //---
-                  // Feed the stream to the tiff info object to get a keyword
-                  // list with geometry/projection info.
-                  //---
-                  ossimTiffInfo info;
-                  
-                  //---
-                  // Have geotiff boxes with badly terminated geotiffs. So to keep
-                  // the tag parser from walking past the first image file directory
-                  // (IFD) into garbage we will set the process overview flag to false.
-                  //
-                  // Note if we ever get multiple entries we will need to take this out.
-                  //---
-                  info.setProcessOverviewFlag(false);
-
-                  // Do a print to a memory stream.
-                  std::ostringstream os;
-                  info.print(str, os);
-
-                  // Open an input stream to pass to the keyword list.
-                  std::istringstream in( os.str() );
-                  
-                  ossimKeywordlist kwl;
-                  if ( kwl.parseStream(in) )      
-                  {
-                     kwl.addPrefixToAll( ossimString("jp2.") );
-
-                     // Print it:
-                     out << kwl << std::endl;
-                  }
-                  
-                  // Get out of while loop.
-                  // break;
-               }
-            }
-
-            if (lbox == 0) // last box?
-            {
-               break;
-            }
-            
-            // Seek to the next box.  If xlbox is 1
-            if (lbox == 1)
-            {
-               boxPos += (std::streamoff)xlbox;
-            }
-            else
-            {
-               boxPos += (std::streamoff)lbox;
-            }
-
-            // Go to next box:
-            str.seekg(boxPos, std::ios_base::beg);
-            
-         } // matches: while ( str.good() )
-         
-         // Close the stream.
-         str.close();
-         
-      } // matches: if ( str.is_open() )
-      
-   } // matches: if ( m_file.size() )
-   
-   return out; 
-}
-
-void ossimJp2Info::readUInt32(ossim_uint32& i, std::ifstream& str) const
-{
-   str.read((char*)&i, 4);
-   if (m_endian)
-   {
-      m_endian->swap(i);
-   }
-}
-
-void ossimJp2Info::readUInt64(ossim_uint64& i, std::ifstream& str) const
-{
-   str.read((char*)&i, 8);
-   if (m_endian)
-   {
-      m_endian->swap(i);
-   }
-}
-
-std::streamoff ossimJp2Info::findBoxData( const ossim_uint32& type,
-                                          std::ifstream& str,
-                                          ossim_uint32& length ) const
-{
-   std::streamoff boxPos = 0;
-   std::streamoff dataPosOfType = 0;
-
-   if ( str.good() )
-   {
-      ossim_uint32   lbox   = 0;
-      ossim_uint32   tbox   = 0;
-      ossim_uint64   xlbox  = 0;
-      std::streamoff offsetToDbox = 0;
-
-      while ( str.good() )
-      {
-         boxPos = str.tellg();
-
-         readUInt32( lbox, str );
-         readUInt32( tbox, str );
-
-         if ( lbox == 1 )
-         {
-            readUInt64( xlbox, str );
-            offsetToDbox = 16;
-         }
-         else
-         {
-            offsetToDbox = 8;
-         }
-
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "jp2.lbox: " << std::dec << lbox << "\n"
-               << "jp2.tbox: " << std::hex << tbox << std::dec << "\n";
-            printTboxType( tbox, ossimNotify(ossimNotifyLevel_DEBUG)  );
-
-            if ( lbox == 1 )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG) << "jp2.xlbox: " << xlbox << std::endl;
-            }
-         }            
-
-         if ( tbox == type )
-         {
-            dataPosOfType = boxPos + offsetToDbox; // set up return value
-            length = lbox;
-            break; // done...
-         }
-
-         if ( lbox == 0 ) // last box?
-         {
-            break;
-         }
-
-         // Seek to the next box.
-         std::streamoff nextBoxPos = boxPos;
-         if (lbox == 1)
-         {
-            nextBoxPos+= (std::streamoff)xlbox;
-         }
-         else
-         {
-            nextBoxPos+= (std::streamoff)lbox;
-         }
-
-         // Go to next box:
-         str.seekg(nextBoxPos, std::ios_base::beg);
-
-      } // matches: while ( str.good() )
-
-   } // matches: if ( str.good() )
-
-   return dataPosOfType;
-}
-
-std::streamoff ossimJp2Info::getBox( const ossim_uint32 type,
-                                     bool includeAll,
-                                     std::vector<ossim_uint8>& box ) const
-{
-   std::streamoff boxPos = 0;
-
-   if ( m_file.size() )
-   {
-      // Open the file.
-      std::ifstream str( m_file.c_str(), std::ios_base::in | std::ios_base::binary );
-      if (str.good())
-      {
-         boxPos = getBox( type, includeAll, str, box ) ;
-
-      } // matches: if ( str.is_open() )
-
-   } // matches: if ( m_file.size() ) 
-
-   return boxPos;
-
-} // End: ossimJp2Info::getBox( type, includeAll, box ) const
-
-std::streamoff ossimJp2Info::getBox( const ossim_uint32& type,
-                                     bool includeAll,
-                                     std::ifstream& str,
-                                     std::vector<ossim_uint8>& box ) const
-{
-   std::streamoff boxPos = 0;
-   std::streamoff boxPosOfType = 0;
-   box.clear();
-   
-   if ( str.good() )
-   {
-      ossim_uint32   lbox   = 0;
-      ossim_uint32   tbox   = 0;
-      ossim_uint64   xlbox  = 0;
-      std::streamoff offsetToDbox = 0;
-      
-      while ( str.good() )
-      {
-         boxPos = str.tellg();
-
-         readUInt32( lbox, str );
-         readUInt32( tbox, str );
-            
-         if ( lbox == 1 )
-         {
-            readUInt64( xlbox, str );
-            offsetToDbox = 16;
-         }
-
-         if ( !includeAll )
-         {
-            if ( lbox == 1 )
-            {
-               offsetToDbox = 16;
-            }
-            else
-            {
-               offsetToDbox = 8;
-            }
-         }
-
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "jp2.lbox: " << std::dec << lbox << "\n"
-               << "jp2.tbox: " << std::hex << tbox << std::dec << "\n";
-            printTboxType( tbox, ossimNotify(ossimNotifyLevel_DEBUG)  );
-            
-            if ( 1 == lbox )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG) << "jp2.xlbox: " << xlbox << std::endl;
-            }
-         }            
-
-            
-         if ( tbox == type )
-         {
-            //---
-            // This is our box, copy it to box.
-            // Not copying the lbox,tbox or xlbox
-            std::streamoff boxSize = 0;
-            if ( lbox == 0 )
-            {
-               // Last box, goes to end of file.
-               str.seekg( 0, std::ios_base::end );
-               boxSize = str.tellg() - boxPos;
-            }
-            else if ( lbox == 1 )
-            {
-               boxSize = xlbox;
-            }
-            else
-            {
-               boxSize = lbox;
-            }
-            boxSize -= offsetToDbox;
-               
-            // Seek to box data start
-            str.seekg( boxPos + offsetToDbox, std::ios_base::beg );
-               
-            // std::vector::resize can throw a std::bad_alloc so wrap it...
-            try
-            {
-               box.resize( boxSize );
-               str.read( (char*)&box.front(), boxSize );
-            }
-            catch( std::exception& e )
-            {
-               std::ostringstream errMsg;
-               errMsg << "ossimJp2Info::getBox caught exception on resize:\n"
-                      << "Buffer size in bytes: " << boxSize
-                      << "\n" << e.what() << std::endl;
-               throw ossimException( errMsg.str() );
-            }
-
-            boxPosOfType = boxPos; // set up return value 
-            break; // done...
-         }
-            
-         if (lbox == 0) // last box?
-         {
-            break;
-         }
-            
-         // Seek to the next box.
-         std::streamoff nextBoxPos = boxPos;
-         if (lbox == 1)
-         {
-            nextBoxPos+= (std::streamoff)xlbox;
-         }
-         else
-         {
-            nextBoxPos+= (std::streamoff)lbox;
-         }
-
-         // Go to next box:
-         str.seekg(nextBoxPos, std::ios_base::beg);
-            
-      } // matches: while ( str.good() )
-         
-   } // matches: if ( str.good() )
-   
-   return boxPosOfType;
-   
-} // End: ossimJp2Info::getBox( type, includeAll, str, box ) const
-
-std::streamoff ossimJp2Info::getGeotiffBox(
-   std::ifstream& str, std::vector<ossim_uint8>& box ) const
-{
-   std::streamoff boxPos = 0;
-   if ( str.good() )
-   {
-      const ossim_uint32 UUID_TYPE = 0x75756964;
-      
-      boxPos = getBox( UUID_TYPE, false, str, box );
-      if ( boxPos && ( box.size() >= GEOTIFF_UUID_SIZE) )
-      {
-         const ossim_uint8 GEOTIFF_UUID[GEOTIFF_UUID_SIZE] = 
-            {
-               0xb1, 0x4b, 0xf8, 0xbd,
-               0x08, 0x3d, 0x4b, 0x43,
-               0xa5, 0xae, 0x8c, 0xd7,
-               0xd5, 0xa6, 0xce, 0x03
-            };
-         
-         if( memcmp( (char*)&box.front(), GEOTIFF_UUID, GEOTIFF_UUID_SIZE) != 0)
-         {
-            boxPos = 0;
-            box.clear();
-         }
-      }
-   }
-   return boxPos;
-}
-
-std::streamoff ossimJp2Info::getGmlBox(
-   std::ifstream& str, std::vector<ossim_uint8>& box ) const
-{
-   std::streamoff boxPos = 0;
-   if ( str.good() )
-   {
-      const ossim_uint32 ASOC_TBOX_ID = 0x61736F63;
-      const ossim_uint32 LBL_TBOX_ID  = 0x6C626C20;
-      const ossim_uint32 XML_TBOX_ID  = 0x786D6C20;
-      
-      ossim_uint32 asoc0_data_length = 0;
-      std::streamoff dataPosAsoc0 = findBoxData( ASOC_TBOX_ID, str, asoc0_data_length );
-
-      if ( dataPosAsoc0 > 0 && asoc0_data_length > 0 )
-      {
-         ossim_uint32 lbl0_data_length = 0;
-         std::streamoff dataPosLbl0 = findBoxData( LBL_TBOX_ID, str, lbl0_data_length );
-
-         if ( dataPosLbl0 > 0 && lbl0_data_length > 0 )
-         {
-            std::string gmlDataStr;
-            gmlDataStr.resize( lbl0_data_length );
-
-            // Removed c++ 11 call for portablility...
-            // str.read( (char*)&gmlDataStr.front(), lbl0_data_length );
-            str.read( (char*)&gmlDataStr[0], lbl0_data_length );            
-
-            // Do we have a GML data asoc ?
-            if ( gmlDataStr.compare( 0, 8, "gml.data" ) == 0 )
-            {
-               // Seek to asoc 0 start of data
-               str.seekg( dataPosAsoc0, std::ios_base::beg );
-
-               ossim_uint32 asoc1_data_length = 0;
-               std::streamoff dataPosAsoc1 = findBoxData( ASOC_TBOX_ID, str, asoc1_data_length );
-
-               if ( dataPosAsoc1 > 0 && asoc1_data_length > 0 )
-               {
-                  ossim_uint32 lbl1_data_length = 0;
-                  std::streamoff dataPosLbl1 = findBoxData( LBL_TBOX_ID, str, lbl1_data_length );
-
-                  if ( dataPosLbl1 > 0 && lbl1_data_length > 0 )
-                  {
-                     std::string gmlRootInstanceStr;
-                     gmlRootInstanceStr.resize( lbl1_data_length );
-                     // Removed c++ 11 call for portablility...
-                     // str.read( (char*)&gmlRootInstanceStr.front(), lbl1_data_length );
-                     str.read( (char*)&gmlRootInstanceStr[0], lbl1_data_length );
-
-                     // Do we have a GML root-instance asoc ?
-                     if ( gmlRootInstanceStr.compare( 0, 17, "gml.root-instance" ) == 0 )
-                     {
-                        // Seek to asoc 1 start of data
-                        str.seekg( dataPosAsoc1, std::ios_base::beg );
-
-                        boxPos = getBox( XML_TBOX_ID, false, str, box );
-                     }
-                  }
-               }
-            }
-         }
-      }
-   }
-   return boxPos;
-}
-
-void ossimJp2Info::printTboxType( ossim_uint32 tbox, std::ostream& out ) const
-{
-   std::string boxType;
-
-   const ossim_uint32 JP2_SIG_TYPE   = 0x6A502020;
-   const ossim_uint32 FILE_TYPE      = 0x66747970;
-   const ossim_uint32 JP2_HDR_TYPE   = 0x6A703268;
-   const ossim_uint32 IMG_HDR_TYPE   = 0x69686472;
-   const ossim_uint32 BPCC_TYPE      = 0x62706363;
-   const ossim_uint32 COLR_TYPE      = 0x636F6C72;
-   const ossim_uint32 PCLR_TYPE      = 0x70636C72;
-   const ossim_uint32 CMAP_TYPE      = 0x636D6170;
-   const ossim_uint32 CDEF_TYPE      = 0x63646566;
-   const ossim_uint32 RES_TYPE       = 0x72657320;
-   const ossim_uint32 RESC_TYPE      = 0x72657363;
-   const ossim_uint32 RESD_TYPE      = 0x72657364;
-   const ossim_uint32 JP2C_TYPE      = 0x6A703263;
-   const ossim_uint32 JP2I_TYPE      = 0x6A703269;
-   const ossim_uint32 XML_TYPE       = 0x786D6C20;
-   const ossim_uint32 UUID_TYPE      = 0x75756964;
-
-   if ( tbox == JP2_SIG_TYPE )
-   {
-      boxType = "jp2_sig";
-   }
-   else if ( tbox == FILE_TYPE )
-   {
-      boxType = "ftyp";
-   }
-   else if ( tbox == JP2_HDR_TYPE )
-   {
-      boxType = "jp2h";
-   }
-   else if ( tbox == IMG_HDR_TYPE )
-   {
-      boxType = "ihdr";
-   }
-   else if ( tbox == BPCC_TYPE )
-   {
-      boxType = "bpcc";
-   }
-   else if ( tbox == COLR_TYPE )
-   {
-      boxType = "colr";
-   }
-   else if ( tbox == PCLR_TYPE )
-   {
-      boxType = "pclr";
-   }
-   else if ( tbox == CMAP_TYPE )
-   {
-      boxType = "cmap";
-   }
-   else if ( tbox == CDEF_TYPE )
-   {
-      boxType = "cdef";
-   }
-   else if ( tbox == RES_TYPE )
-   {
-      boxType = "res";
-   }
-   else if ( tbox == RESC_TYPE )
-   {
-      boxType = "resc";
-   }
-   else if ( tbox == RESD_TYPE )
-   {
-      boxType = "resd";
-   }
-   else if ( tbox == JP2C_TYPE )
-   {
-      boxType = "jp2c";
-   }
-   else if ( tbox == JP2I_TYPE )
-   {
-      boxType = "jp2i";
-   }
-   else if ( tbox == XML_TYPE )
-   {
-      boxType = "xml";
-   }
-   else if ( tbox == UUID_TYPE )
-   {
-      boxType = "uuid";
-   }
-   else
-   {
-      boxType = "unhandled";
-   }
-
-   out << "jp2.box_type: " << boxType << "\n";
-}
-
diff --git a/ossim/src/ossim/support_data/ossimLasHdr.cpp b/ossim/src/ossim/support_data/ossimLasHdr.cpp
deleted file mode 100644
index 897eab1..0000000
--- a/ossim/src/ossim/support_data/ossimLasHdr.cpp
+++ /dev/null
@@ -1,627 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimLasHdr.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Container class for LAS LIDAR format public header block.
-
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/support_data/ossimLasHdr.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-#include <bitset>
-#include <cstring>
-#include <iomanip>
-#include <iostream>
-#include <sstream>
-
-ossimLasHdr::ossimLasHdr() :
-   m_fileSourceId(0),
-   m_globalEncoding(0),
-   m_projectIdGuidData1(0),
-   m_projectIdGuidData2(0),
-   m_projectIdGuidData3(0),
-   m_versionMajor(0),
-   m_versionMinor(0),
-   m_fileCreationDay(0),
-   m_fileCreateionYear(0),
-   m_headerSize(0),
-   m_offsetToPointData(0),
-   m_numberOfVariableLengthRecords(0),
-   m_pointDataFormatId(0),
-   m_pointDataRecordLength(0),
-   m_legacyNumberOfPointRecords(0),
-   m_xScaleFactor(0.0),
-   m_yScaleFactor(0.0),
-   m_zScaleFactor(0.0),
-   m_xOffset(0.0),
-   m_yOffset(0.0),
-   m_zOffset(0.0),
-   m_maxX(0.0),
-   m_minX(0.0),
-   m_maxY(0.0),
-   m_minY(0.0),
-   m_maxZ(0.0),
-   m_minZ(0.0),
-   m_startOfWaveformDataPacket(0),
-   m_startOfExtendedVariableLengthRecords(0),
-   m_numberOfExtendedVariableLengthRecords(0),
-   m_numberOfPointRecords(0)
-{
-   // Initialize arrays:
-   strncpy(m_fileSignature, "LASF", 4);
-   m_fileSignature[4] = '\0';
-   memset(m_projectIdGuidData4, 0, 8);
-   memset(m_systemIndentifier, 0, 32);
-   memset(m_generatingSoftware, 0, 32);
-   memset(m_legacyNumberOfPointsByReturn, 0, 20); // 5 uint32s(5 x 4)
-   memset(m_numberOfPointsByReturn, 0, 120);   // 15 unint64s(15 x 8)
-}
-
-ossimLasHdr::ossimLasHdr(const ossimLasHdr& hdr) :
-   m_fileSourceId(hdr.m_fileSourceId),
-   m_globalEncoding(hdr.m_globalEncoding),
-   m_projectIdGuidData1(hdr.m_projectIdGuidData1),
-   m_projectIdGuidData2(hdr.m_projectIdGuidData2),
-   m_projectIdGuidData3(hdr.m_projectIdGuidData3),
-   m_versionMajor(hdr.m_versionMajor),
-   m_versionMinor(hdr.m_versionMinor),
-   m_fileCreationDay(hdr.m_fileCreationDay),
-   m_fileCreateionYear(hdr.m_fileCreateionYear),
-   m_headerSize(hdr.m_headerSize),
-   m_offsetToPointData(hdr.m_offsetToPointData),
-   m_numberOfVariableLengthRecords(hdr.m_numberOfVariableLengthRecords),
-   m_pointDataFormatId(hdr.m_pointDataFormatId),
-   m_pointDataRecordLength(hdr.m_pointDataRecordLength),
-   m_legacyNumberOfPointRecords(hdr.m_legacyNumberOfPointRecords),
-   m_xScaleFactor(hdr.m_xScaleFactor),
-   m_yScaleFactor(hdr.m_yScaleFactor),
-   m_zScaleFactor(hdr.m_zScaleFactor),
-   m_xOffset(hdr.m_xOffset),
-   m_yOffset(hdr.m_yOffset),
-   m_zOffset(hdr.m_zOffset),
-   m_maxX(hdr.m_maxX),
-   m_minX(hdr.m_minX),
-   m_maxY(hdr.m_maxY),
-   m_minY(hdr.m_minY),
-   m_maxZ(hdr.m_maxZ),
-   m_minZ(hdr.m_minZ),
-   m_startOfWaveformDataPacket(hdr.m_startOfWaveformDataPacket),
-   m_startOfExtendedVariableLengthRecords(hdr.m_startOfExtendedVariableLengthRecords),
-   m_numberOfExtendedVariableLengthRecords(hdr.m_numberOfExtendedVariableLengthRecords),
-   m_numberOfPointRecords(hdr.m_numberOfPointRecords)
-{
-   // Copy arrays.
-   memcpy((void*)m_fileSignature, (void*)(hdr.m_fileSignature), 4);
-   memcpy((void*)m_projectIdGuidData4, (void*)(hdr.m_projectIdGuidData4), 8);
-   memcpy((void*)m_systemIndentifier, (void*)(hdr.m_systemIndentifier), 32);
-   memcpy((void*)m_generatingSoftware, (void*)(hdr.m_generatingSoftware), 32);
-   memcpy((void*)m_legacyNumberOfPointsByReturn, (void*)(hdr.m_legacyNumberOfPointsByReturn), 20);
-   memcpy((void*)m_numberOfPointsByReturn, (void*)(hdr.m_numberOfPointsByReturn), 120);
-}
-
-const ossimLasHdr& ossimLasHdr::operator=(const ossimLasHdr& hdr)
-{
-   if (this != &hdr)
-   {
-      m_fileSourceId = hdr.m_fileSourceId;
-      m_globalEncoding = hdr.m_globalEncoding;
-      m_projectIdGuidData1 = hdr.m_projectIdGuidData1;
-      m_projectIdGuidData2 = hdr.m_projectIdGuidData2;
-      m_projectIdGuidData3 = hdr.m_projectIdGuidData3;
-      m_versionMajor = hdr.m_versionMajor;
-      m_versionMinor = hdr.m_versionMinor;
-      strncpy(m_systemIndentifier, hdr.m_systemIndentifier, 32);
-      strncpy(m_generatingSoftware, hdr.m_generatingSoftware, 32);      
-      m_fileCreationDay = hdr.m_fileCreationDay;
-      m_fileCreateionYear = hdr.m_fileCreateionYear;
-      m_headerSize = hdr.m_headerSize;
-      m_offsetToPointData = hdr.m_offsetToPointData;
-      m_numberOfVariableLengthRecords = hdr.m_numberOfVariableLengthRecords;
-      m_pointDataFormatId = hdr.m_pointDataFormatId;
-      m_pointDataRecordLength = hdr.m_pointDataRecordLength;
-      m_legacyNumberOfPointRecords = hdr.m_legacyNumberOfPointRecords;
-      m_xScaleFactor = hdr.m_xScaleFactor;
-      m_yScaleFactor = hdr.m_yScaleFactor;
-      m_zScaleFactor = hdr.m_zScaleFactor;
-      m_xOffset = hdr.m_xOffset;
-      m_yOffset = hdr.m_yOffset;
-      m_zOffset = hdr.m_zOffset;
-      m_maxX = hdr.m_maxX;
-      m_minX = hdr.m_minX;
-      m_maxY = hdr.m_maxY;
-      m_minY = hdr.m_minY;
-      m_maxZ = hdr.m_maxZ;
-      m_minZ = hdr.m_minZ;
-      m_startOfWaveformDataPacket = hdr.m_startOfWaveformDataPacket;
-      m_startOfExtendedVariableLengthRecords = hdr.m_startOfExtendedVariableLengthRecords;
-      m_numberOfExtendedVariableLengthRecords = hdr.m_numberOfExtendedVariableLengthRecords;
-      m_numberOfPointRecords = hdr.m_numberOfPointRecords;
-
-      // Copy arrays.
-      memcpy((void*)m_fileSignature,(void*)(hdr.m_fileSignature), 4);
-      memcpy((void*)m_projectIdGuidData4, (void*)(hdr.m_projectIdGuidData4), 8);
-      memcpy((void*)m_systemIndentifier, (void*)(hdr.m_systemIndentifier), 32);
-      memcpy((void*)m_generatingSoftware, (void*)(hdr.m_generatingSoftware), 32);
-      memcpy((void*)m_legacyNumberOfPointsByReturn,
-             (void*)(hdr.m_legacyNumberOfPointsByReturn), 20);
-      memcpy((void*)m_numberOfPointsByReturn, (void*)(hdr.m_numberOfPointsByReturn), 120);
-   }
-   return *this;
-}
-
-ossimLasHdr::~ossimLasHdr()
-{
-}
-
-bool ossimLasHdr::checkSignature(std::istream& in) const
-{
-   bool result = false;
-   char SIG[4];
-   in.read(SIG, 4);
-   if ( (SIG[0] == 'L') && (SIG[1] == 'A') &&
-        (SIG[2] == 'S') && (SIG[3] == 'F') )
-   {
-      result = true;
-   }
-   return result;
-}
-
-void ossimLasHdr::readStream(std::istream& in)
-{
-   in.read(m_fileSignature, 4);
-   in.read((char*)&m_fileSourceId, 2);
-   in.read((char*)&m_globalEncoding, 2);
-   in.read((char*)&m_projectIdGuidData1, 4);
-   in.read((char*)&m_projectIdGuidData2, 2);
-   in.read((char*)&m_projectIdGuidData3, 2);
-   in.read((char*)&m_projectIdGuidData4, 8);
-   in.read((char*)&m_versionMajor, 1);
-   in.read((char*)&m_versionMinor, 1);
-   in.read(m_systemIndentifier, 32);
-   in.read(m_generatingSoftware, 32);
-   in.read((char*)&m_fileCreationDay, 2);
-   in.read((char*)&m_fileCreateionYear, 2);
-   in.read((char*)&m_headerSize, 2);
-   in.read((char*)&m_offsetToPointData, 4);
-   in.read((char*)&m_numberOfVariableLengthRecords, 4);
-   in.read((char*)&m_pointDataFormatId, 1);
-   in.read((char*)&m_pointDataRecordLength, 2);
-   in.read((char*)&m_legacyNumberOfPointRecords, 4);
-   in.read((char*)&m_legacyNumberOfPointsByReturn, 20);
-   in.read((char*)&m_xScaleFactor, 8);
-   in.read((char*)&m_yScaleFactor, 8);
-   in.read((char*)&m_zScaleFactor, 8);
-   in.read((char*)&m_xOffset, 8);
-   in.read((char*)&m_yOffset, 8);
-   in.read((char*)&m_zOffset, 8);
-   in.read((char*)&m_maxX, 8);
-   in.read((char*)&m_minX, 8);
-   in.read((char*)&m_maxY, 8);
-   in.read((char*)&m_minY, 8);
-   in.read((char*)&m_maxZ, 8);
-   in.read((char*)&m_minZ, 8);
-
-   // Version specific:
-   if ( versionGreaterThan( 1, 2 ) )
-   {
-      // Added in 1.3:
-      in.read((char*)&m_startOfWaveformDataPacket, 8);
-   }
-   if ( versionGreaterThan( 1, 3 ) )
-   {
-      // Added in 1.4:
-      in.read((char*)&m_startOfExtendedVariableLengthRecords, 8);
-      in.read((char*)&m_numberOfExtendedVariableLengthRecords, 4);
-      in.read((char*)&m_numberOfPointRecords, 8);
-      in.read((char*)&m_numberOfPointsByReturn, 120);
-   }
-
-   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
-   {
-      swap();
-   }
-
-   if ( !versionGreaterThan( 1, 3 ) ) // Less than 1.4
-   {
-      //---
-      // Copy legacy point count to 64 bit data members. This will allow LAS code
-      // to always go through same methods for point counts.
-      //---
-      m_numberOfPointRecords = m_legacyNumberOfPointRecords;
-      for ( ossim_uint32 i = 0; i < 5; ++i )
-      {
-         m_numberOfPointsByReturn[i] = m_legacyNumberOfPointsByReturn[i];
-      }
-   }
-}
-
-void ossimLasHdr::writeStream(std::ostream& out)
-{
-   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
-   {
-      // Write little endian per spec.
-      swap();
-   }
-   
-   out.write(m_fileSignature, 4);
-   out.write((char*)&m_fileSourceId, 2);
-   out.write((char*)&m_globalEncoding, 2);
-   out.write((char*)&m_projectIdGuidData1, 4);
-   out.write((char*)&m_projectIdGuidData2, 2);
-   out.write((char*)&m_projectIdGuidData3, 2);
-   out.write((char*)&m_projectIdGuidData4, 8);
-   out.write((char*)&m_versionMajor, 1);
-   out.write((char*)&m_versionMinor, 1);
-   out.write(m_systemIndentifier, 32);
-   out.write(m_generatingSoftware, 32);
-   out.write((char*)&m_fileCreationDay, 2);
-   out.write((char*)&m_fileCreateionYear, 2);
-   out.write((char*)&m_headerSize, 2);
-   out.write((char*)&m_offsetToPointData, 4);
-   out.write((char*)&m_numberOfVariableLengthRecords, 4);
-   out.write((char*)&m_pointDataFormatId, 1);
-   out.write((char*)&m_pointDataRecordLength, 2);
-   out.write((char*)&m_legacyNumberOfPointRecords, 4);
-   out.write((char*)&m_legacyNumberOfPointsByReturn, 20);
-   out.write((char*)&m_xScaleFactor, 8);
-   out.write((char*)&m_yScaleFactor, 8);
-   out.write((char*)&m_zScaleFactor, 8);
-   out.write((char*)&m_xOffset, 8);
-   out.write((char*)&m_yOffset, 8);
-   out.write((char*)&m_zOffset, 8);
-   out.write((char*)&m_maxX, 8);
-   out.write((char*)&m_minX, 8);
-   out.write((char*)&m_maxY, 8);
-   out.write((char*)&m_minY, 8);
-   out.write((char*)&m_maxZ, 8);
-   out.write((char*)&m_minZ, 8);
-
-   if ( versionGreaterThan( 1, 2 ) )
-   {
-      // Added in 1.3:
-      out.write((char*)&m_startOfWaveformDataPacket, 8);
-   }
-   if ( versionGreaterThan( 1, 3 ) )
-   {
-      // Added in 1.4:
-      out.write((char*)&m_startOfExtendedVariableLengthRecords, 8);
-      out.write((char*)&m_numberOfExtendedVariableLengthRecords, 4);
-      out.write((char*)&m_numberOfPointRecords, 8);
-      out.write((char*)&m_numberOfPointsByReturn, 120);
-   }
-
-   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
-   {
-      // Swap back to native byte order if needed:
-      swap();
-   }
-}
-
-std::ostream& ossimLasHdr::print(std::ostream& out) const
-{
-   ossimKeywordlist kwl;
-   getKeywordlist( kwl );
-   return out << kwl;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimLasHdr& hdr)
-{
-   return hdr.print(out);
-}
-
-void ossimLasHdr::getKeywordlist(ossimKeywordlist& kwl) const
-{
-   kwl.add("las.file_source_id", m_fileSourceId);
-
-   //---
-   // m_globalEncoding is a bit encoding so we output bit at a time:
-   // At the time of this coding only first four bits used.
-   //---
-
-   // 1.2:
-   kwl.add("las.gps_time_type", (getGpsTimeTypeBit()?"1":"0") );
-
-   if ( versionGreaterThan( 1, 2 ) )
-   {
-      // Added in 1.3:
-      kwl.add("las.waveform_data_packets_internal", (getWaveforDataPacketsInternalBit()?"1":"0") );
-      kwl.add("las.waveform_data_packets_external", (getWaveforDataPacketsExternalBit()?"1":"0") );
-      kwl.add("las.synthetically_generated", (getReturnsSyntheticallyGeneratedBit()?"1":"0") );
-   }
-
-   if (  versionGreaterThan( 1, 3 ) )
-   {
-      // 1.4:
-      kwl.add("las.wkt", (getWktBit()?"1":"0") );
-   }
-   
-   kwl.add("las.project_id_guid", getProjectIdGuid().c_str());
-
-   kwl.add("las.version", getVersion().c_str());
-
-   kwl.add("las.system_indentifier", getSystemIndentifier().c_str());
-   kwl.add("las.generating_software", getGeneratingSoftware().c_str());
-
-   kwl.add("las.file_creation_day", m_fileCreationDay);
-   kwl.add("las.file_creation_year", m_fileCreateionYear);
-
-   kwl.add("las.header_size", m_headerSize);
-   kwl.add("las.offset_to_point_data", m_offsetToPointData );
-   kwl.add("las.number_of_variable_length_records", m_numberOfVariableLengthRecords);
-   kwl.add("las.point_data_format_id", m_pointDataFormatId);
-   kwl.add("las.point_data_record_length", m_pointDataRecordLength);
-
-   kwl.add("las.x_scale_factor", m_xScaleFactor);
-   kwl.add("las.y_scale_factor", m_yScaleFactor);
-   kwl.add("las.z_scale_factor", m_zScaleFactor);
-
-   kwl.add("las.x_offset", m_xOffset);
-   kwl.add("las.y_offset", m_yOffset);
-   kwl.add("las.z_offset", m_zOffset);
-   
-   kwl.add("las.max_x", m_maxX);
-   kwl.add("las.min_x", m_minX);
-   kwl.add("las.max_y", m_maxY);
-   kwl.add("las.min_y", m_minY);
-   kwl.add("las.max_z", m_maxZ);
-   kwl.add("las.min_z", m_minZ);
-
-   kwl.add("las.start_of_wave_form_data", m_startOfWaveformDataPacket);
-
-   if ( versionGreaterThan( 1, 3 ) )
-   {
-      kwl.add("las.number_of_point_records", m_numberOfPointRecords);
-      for (ossim_uint32 i = 0; i < 15; ++i)
-      {
-         std::ostringstream os;
-         os << "las.number_of_points_return" << (i+1);
-         kwl.add( os.str().c_str(), m_numberOfPointsByReturn[i] );
-      }
-   }
-   else
-   {
-      // Prior to 1.4:
-      kwl.add("las.number_of_point_records", m_legacyNumberOfPointRecords);
-      for (ossim_uint32 i = 0; i < 5; ++i)
-      {
-         std::ostringstream os;
-         os << "las.number_of_points_return" << (i+1);
-         kwl.add( os.str().c_str(), m_legacyNumberOfPointsByReturn[i] );
-      } 
-   }
-}
-
-bool ossimLasHdr::getGpsTimeTypeBit() const
-{
-   // Test the first bit:
-   std::bitset<1> bs( m_globalEncoding );
-   return bs.test(0);
-}
-
-bool ossimLasHdr::getWaveforDataPacketsInternalBit() const
-{
-   // Test the second bit:
-   std::bitset<2> bs( m_globalEncoding );
-   return bs.test(1);
-}
-
-bool ossimLasHdr::getWaveforDataPacketsExternalBit() const
-{
-   // Test the third bit:
-   std::bitset<3> bs( m_globalEncoding );
-   return bs.test(2);
-}
-
-bool ossimLasHdr::getReturnsSyntheticallyGeneratedBit() const
-{
-   // Test the fourth bit:
-   std::bitset<4> bs( m_globalEncoding );
-   return bs.test(3);
-}
-
-bool ossimLasHdr::getWktBit() const
-{
-   // Test the fith bit:
-   std::bitset<5> bs( m_globalEncoding );
-   return bs.test(4); 
-}
-
-std::string ossimLasHdr::getProjectIdGuid() const
-{
-   std::ostringstream os;
-   os << std::hex
-      << m_projectIdGuidData1 << "-"
-      << m_projectIdGuidData2 << "-"
-      << m_projectIdGuidData3 << "-";
-   for (int i=0; i<8; ++i)
-   {
-      ossim_uint16 uid = m_projectIdGuidData4[i];
-      os << uid;
-   }
-   return os.str();
-}
-
-std::string ossimLasHdr::getVersion() const
-{
-   std::ostringstream os;
-   os << int(m_versionMajor) << "." << int(m_versionMinor);
-   return os.str();
-}
-
-std::string  ossimLasHdr::getSystemIndentifier() const
-{
-   std::string s;
-   s.reserve(32);
-   for (int i=0; i<32; ++i)
-   {
-      s.push_back(m_systemIndentifier[i]);
-   }
-   return s;
-}
-
-std::string  ossimLasHdr::getGeneratingSoftware() const
-{
-   std::string s;
-   s.reserve(32);
-   for (int i=0; i<32; ++i)
-   {
-      s.push_back(m_generatingSoftware[i]);
-   }
-   return s;
-}
-
-ossim_uint16 ossimLasHdr::getHeaderSize() const
-{
-   return m_headerSize;
-}
-
-ossim_uint32 ossimLasHdr::getOffsetToPointData() const
-{
-   return m_offsetToPointData;
-}
-
-ossim_uint32 ossimLasHdr::getNumberOfVlrs() const
-{
-   return m_numberOfVariableLengthRecords;
-}
-
-ossim_uint8 ossimLasHdr::getPointDataFormatId() const
-{
-   return m_pointDataFormatId;
-}
-
-ossim_uint64 ossimLasHdr::getNumberOfPoints() const
-{
-   return m_numberOfPointRecords;
-}
-
-ossim_uint64 ossimLasHdr::getNumberOfPoints(ossim_uint32 entry) const
-{
-   ossim_uint64 result = 0;
-   if ( entry < 15 )
-   {
-      result = m_numberOfPointsByReturn[entry];
-   }
-   return result;
-}
-
-const ossim_float64& ossimLasHdr::getScaleFactorX() const
-{
-   return m_xScaleFactor;
-}
-
-const ossim_float64& ossimLasHdr::getScaleFactorY() const
-{
-   return m_yScaleFactor;
-}
-
-const ossim_float64& ossimLasHdr::getScaleFactorZ() const
-{
-   return m_zScaleFactor;
-}
-
-const ossim_float64& ossimLasHdr::getOffsetX() const
-{
-   return m_xOffset;
-}
-
-const ossim_float64& ossimLasHdr::getOffsetY() const
-{
-   return m_yOffset;
-}
-
-const ossim_float64& ossimLasHdr::getOffsetZ() const
-{
-   return m_zOffset;
-}
-
-const ossim_float64& ossimLasHdr::getMinX() const
-{
-   return m_minX;
-}
-
-const ossim_float64& ossimLasHdr::getMinY() const
-{
-   return m_minY;
-}
-
-const ossim_float64& ossimLasHdr::getMinZ() const
-{
-   return m_minZ;
-}
-
-const ossim_float64& ossimLasHdr::getMaxX() const
-{
-   return m_maxX;
-}
-
-const ossim_float64& ossimLasHdr::getMaxY() const
-{
-   return m_maxY;
-}
-
-const ossim_float64& ossimLasHdr::getMaxZ() const
-{
-   return m_maxZ;
-}
-
-void ossimLasHdr::swap()
-{
-   ossimEndian endian;
-   endian.swap(m_fileSourceId);
-   endian.swap(m_globalEncoding);
-   endian.swap(m_projectIdGuidData1);
-   endian.swap(m_projectIdGuidData2);
-   endian.swap(m_projectIdGuidData3);
-   endian.swap(m_fileCreationDay);
-   endian.swap(m_fileCreateionYear);
-   endian.swap(m_headerSize);
-   endian.swap(m_offsetToPointData);
-   endian.swap(m_numberOfVariableLengthRecords);
-   endian.swap(m_pointDataRecordLength);
-   endian.swap(m_legacyNumberOfPointRecords);
-   endian.swap(m_legacyNumberOfPointsByReturn, 5);
-   endian.swap(m_xScaleFactor);
-   endian.swap(m_yScaleFactor);
-   endian.swap(m_zScaleFactor);
-   endian.swap(m_xOffset);
-   endian.swap(m_yOffset);
-   endian.swap(m_zOffset);
-   endian.swap(m_maxX);
-   endian.swap(m_minX);
-   endian.swap(m_maxY);
-   endian.swap(m_minY);
-   endian.swap(m_maxZ);
-   endian.swap(m_minZ);
-   endian.swap(m_startOfWaveformDataPacket);
-   endian.swap(m_startOfExtendedVariableLengthRecords);
-   endian.swap(m_numberOfExtendedVariableLengthRecords);
-   endian.swap(m_numberOfPointRecords);
-   endian.swap(m_numberOfPointsByReturn, 15);
-}
-
-bool ossimLasHdr::versionGreaterThan( ossim_uint8 major, ossim_uint8 minor ) const
-{
-   bool result = false;
-   if ( m_versionMajor == major )
-   {
-      result = m_versionMinor > minor;
-   }
-   else if ( m_versionMajor > major )
-   {
-      result = true;
-   }
-   return result;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimLasInfo.cpp b/ossim/src/ossim/support_data/ossimLasInfo.cpp
deleted file mode 100644
index a022ab1..0000000
--- a/ossim/src/ossim/support_data/ossimLasInfo.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimLibLasInfo.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: LAS LIDAR info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/support_data/ossimLasInfo.h>
-#include <ossim/support_data/ossimLasHdr.h>
-
-#include <fstream>
-
-ossimLasInfo::ossimLasInfo()
-   : m_file()
-{
-}
-
-ossimLasInfo::~ossimLasInfo()
-{
-}
-
-bool ossimLasInfo::open(const ossimFilename& file)
-{
-   bool result = false;
-   std::ifstream istr;
-   istr.open(file.c_str(), std::ios_base::in | std::ios_base::binary);
-   if ( istr.is_open() )
-   {
-      ossimLasHdr hdr;
-      result = hdr.checkSignature(istr);
-      if (result) m_file = file;
-   }
-   return result;
-}
-
-std::ostream& ossimLasInfo::print(std::ostream& out) const
-{
-   std::ifstream istr;
-   istr.open(m_file.c_str(), std::ios_base::in | std::ios_base::binary);
-   if ( istr.is_open() )
-   {
-      ossimLasHdr hdr;
-      if ( hdr.checkSignature(istr) )
-      {
-         istr.seekg(0, std::ios_base::beg);
-         hdr.readStream(istr);
-         hdr.print(out);
-      }
-   }
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfAcftbTag.cpp b/ossim/src/ossim/support_data/ossimNitfAcftbTag.cpp
deleted file mode 100644
index 623c976..0000000
--- a/ossim/src/ossim/support_data/ossimNitfAcftbTag.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ACFTB - Aircraft Infomation Extension Format tag class
-// declaration.
-//
-// See document STDI-0002 (version 3), Appendix E, Table E-6 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfAcftbTag.h>
-
-
-RTTI_DEF1(ossimNitfAcftbTag, "ossimNitfAcftbTag", ossimNitfRegisteredTag);
-
-ossimNitfAcftbTag::ossimNitfAcftbTag()
-   : ossimNitfRegisteredTag(std::string("ACFTB"), CEL_SIZE)
-{
-   clearFields();
-}
-
-ossimNitfAcftbTag::~ossimNitfAcftbTag()
-{
-}
-
-void ossimNitfAcftbTag::parseStream(std::istream& in)
-{
-   clearFields();
-
-   in.read(theAcMsnId, AC_MSN_ID_SIZE);
-   in.read(theAcTailNo, AC_TAIL_NO_SIZE);
-   in.read(theAcTo, AC_TO_SIZE);
-   in.read(theSensorIdType, SENSOR_ID_TYPE_SIZE);
-   in.read(theSensorId, SENSOR_ID_SIZE);
-   in.read(theSceneSource, SCENE_SOURCE_SIZE);
-   in.read(theScNum, SCNUM_SIZE);
-   in.read(thePDate, PDATE_SIZE);
-   in.read(theImHostNo, IMHOSTNO_SIZE);
-   in.read(theImReqID, IMREQID_SIZE);
-   in.read(theMPlan, MPLAN_SIZE);
-   in.read(theEntLoc, ENTLOC_SIZE);
-   in.read(theLocAccy, LOC_ACCY_SIZE);
-   in.read(theEntelv, ENTELV_SIZE);
-   in.read(theElvUnit, ELV_UNIT_SIZE);
-   in.read(theExitLoc, EXITLOC_SIZE);
-   in.read(theExitElev, EXITELV_SIZE);
-   in.read(theTMap, TMAP_SIZE);
-   in.read(theRowSpacing, ROW_SPACING_SIZE);
-   in.read(theRowSpacingUnits, ROW_SPACING_UNITS_SIZE);
-   in.read(theColSpacing, COL_SPACING_SIZE);
-   in.read(theColSpacingUnits, COL_SPACING_UINTS_SIZE);
-   in.read(theFocalLength, FOCAL_LENGTH_SIZE);
-   in.read(theSenserial, SENSERIAL_SIZE);
-   in.read(theAbSwVer, ABSWVER_SIZE);
-   in.read(theCalDate, CAL_DATE_SIZE);
-   in.read(thePatchTot, PATCH_TOT_SIZE);
-   in.read(theMtiTot, MTI_TOT_SIZE);
-}
-
-void ossimNitfAcftbTag::writeStream(std::ostream& out)
-{
-   out.write(theAcMsnId, AC_MSN_ID_SIZE);
-   out.write(theAcTailNo, AC_TAIL_NO_SIZE);
-   out.write(theAcTo, AC_TO_SIZE);
-   out.write(theSensorIdType, SENSOR_ID_TYPE_SIZE);
-   out.write(theSensorId, SENSOR_ID_SIZE);
-   out.write(theSceneSource, SCENE_SOURCE_SIZE);
-   out.write(theScNum, SCNUM_SIZE);
-   out.write(thePDate, PDATE_SIZE);
-   out.write(theImHostNo, IMHOSTNO_SIZE);
-   out.write(theImReqID, IMREQID_SIZE);
-   out.write(theMPlan, MPLAN_SIZE);
-   out.write(theEntLoc, ENTLOC_SIZE);
-   out.write(theLocAccy, LOC_ACCY_SIZE);
-   out.write(theEntelv, ENTELV_SIZE);
-   out.write(theElvUnit, ELV_UNIT_SIZE);
-   out.write(theExitLoc, EXITLOC_SIZE);
-   out.write(theExitElev, EXITELV_SIZE);
-   out.write(theTMap, TMAP_SIZE);
-   out.write(theRowSpacing, ROW_SPACING_SIZE);
-   out.write(theRowSpacingUnits, ROW_SPACING_UNITS_SIZE);
-   out.write(theColSpacing, COL_SPACING_SIZE);
-   out.write(theColSpacingUnits, COL_SPACING_UINTS_SIZE);
-   out.write(theFocalLength, FOCAL_LENGTH_SIZE);
-   out.write(theSenserial, SENSERIAL_SIZE);
-   out.write(theAbSwVer, ABSWVER_SIZE);
-   out.write(theCalDate, CAL_DATE_SIZE);
-   out.write(thePatchTot, PATCH_TOT_SIZE);
-   out.write(theMtiTot, MTI_TOT_SIZE);
-}
-
-void ossimNitfAcftbTag::clearFields()
-{
-   // BCS-N's to '0's, BCS-A's to ' '(spaces)
-
-   // clear
-   memset(theAcMsnId, ' ', AC_MSN_ID_SIZE);
-   memset(theAcTailNo, ' ', AC_TAIL_NO_SIZE);
-   memset(theAcTo, ' ', AC_TO_SIZE);
-   memset(theSensorIdType, ' ', SENSOR_ID_TYPE_SIZE);
-   memset(theSensorId, ' ', SENSOR_ID_SIZE);
-   memset(theSceneSource, ' ', SCENE_SOURCE_SIZE);
-   memset(theScNum, ' ', SCNUM_SIZE);
-   memset(thePDate, ' ', PDATE_SIZE);
-   memset(theImHostNo, ' ', IMHOSTNO_SIZE);
-   memset(theImReqID, ' ', IMREQID_SIZE);
-   memset(theMPlan, ' ', MPLAN_SIZE);
-   memset(theEntLoc, ' ', ENTLOC_SIZE);
-   memset(theLocAccy, ' ', LOC_ACCY_SIZE);
-   memset(theEntelv, ' ', ENTELV_SIZE);
-   memset(theElvUnit, ' ', ELV_UNIT_SIZE);
-   memset(theExitLoc, ' ', EXITLOC_SIZE);
-   memset(theExitElev, ' ', EXITELV_SIZE);
-   memset(theTMap, ' ', TMAP_SIZE);
-   memset(theRowSpacing, ' ', ROW_SPACING_SIZE);
-   memset(theRowSpacingUnits, ' ', ROW_SPACING_UNITS_SIZE);
-   memset(theColSpacing, ' ', COL_SPACING_SIZE);
-   memset(theColSpacingUnits, ' ', COL_SPACING_UINTS_SIZE);
-   memset(theFocalLength, ' ', FOCAL_LENGTH_SIZE);
-   memset(theSenserial, ' ', SENSERIAL_SIZE);
-   memset(theAbSwVer, ' ', ABSWVER_SIZE);
-   memset(theCalDate, ' ', CAL_DATE_SIZE);
-   memset(thePatchTot, ' ', PATCH_TOT_SIZE);
-   memset(theMtiTot, ' ', MTI_TOT_SIZE);
-
-
-   // null terminate
-   theAcMsnId[AC_MSN_ID_SIZE] = '\0';
-   theAcTailNo[AC_TAIL_NO_SIZE] = '\0';
-   theAcTo[AC_TO_SIZE] = '\0';
-   theSensorIdType[SENSOR_ID_TYPE_SIZE] = '\0';
-   theSensorId[SENSOR_ID_SIZE] = '\0';
-   theSceneSource[SCENE_SOURCE_SIZE] = '\0';
-   theScNum[SCNUM_SIZE] = '\0';
-   thePDate[PDATE_SIZE] = '\0';
-   theImHostNo[IMHOSTNO_SIZE] = '\0';
-   theImReqID[IMREQID_SIZE] = '\0';
-   theMPlan[MPLAN_SIZE] = '\0';
-   theEntLoc[ENTLOC_SIZE] = '\0';
-   theLocAccy[LOC_ACCY_SIZE] = '\0';
-   theEntelv[ENTELV_SIZE] = '\0';
-   theElvUnit[ELV_UNIT_SIZE] = '\0';
-   theExitLoc[EXITLOC_SIZE] = '\0';
-   theExitElev[EXITELV_SIZE] = '\0';
-   theTMap[TMAP_SIZE] = '\0';
-   theRowSpacing[ROW_SPACING_SIZE] = '\0';
-   theRowSpacingUnits[ROW_SPACING_UNITS_SIZE] = '\0';
-   theColSpacing[COL_SPACING_SIZE] = '\0';
-   theColSpacingUnits[COL_SPACING_UINTS_SIZE] = '\0';
-   theFocalLength[FOCAL_LENGTH_SIZE] = '\0';
-   theSenserial[SENSERIAL_SIZE] = '\0';
-   theAbSwVer[ABSWVER_SIZE] = '\0';
-   theCalDate[CAL_DATE_SIZE] = '\0';
-   thePatchTot[PATCH_TOT_SIZE] = '\0';
-   theMtiTot[MTI_TOT_SIZE] = '\0';
-}
-
-ossimString ossimNitfAcftbTag::getFocalLength()const
-{
-   return ossimString(theFocalLength);
-}
-
-ossimString ossimNitfAcftbTag::getColumnSpacing()const
-{
-   return ossimString(theColSpacing);
-}
-
-ossimString ossimNitfAcftbTag::getColumnSpacingUnits()const
-{
-   return ossimString(theColSpacingUnits);
-}
-
-ossimString ossimNitfAcftbTag::getRowSpacing()const
-{
-   return ossimString(theRowSpacing);
-}
-
-ossimString ossimNitfAcftbTag::getRowSpacingUnits()const
-{
-   return ossimString(theRowSpacingUnits);
-}
-
-
-std::ostream& ossimNitfAcftbTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "AC_MSN_ID:"
-       << theAcMsnId << "\n"
-       << pfx << std::setw(24) << "AC_TAIL_NO:"
-       << theAcTailNo << "\n"
-       << pfx << std::setw(24) << "AC_TO:"
-       << theAcTo << "\n"
-       << pfx << std::setw(24) << "SENSOR_ID_TYPE:"
-       << theSensorIdType << "\n"
-       << pfx << std::setw(24) << "SENSOR_ID:"
-       << theSensorId << "\n"
-       << pfx << std::setw(24) << "SCENE_SOURCE:"
-       << theSceneSource << "\n"
-       << pfx << std::setw(24) << "SCNUM:"
-       << theScNum << "\n"
-       << pfx << std::setw(24) << "PDATE:"
-       << thePDate << "\n"
-       << pfx << std::setw(24) << "IMHOSTNO:"
-       << theImHostNo << "\n"
-       << pfx << std::setw(24) << "IMREQID:"
-       << theImReqID << "\n"
-       << pfx << std::setw(24) << "MPLAN:"
-       << theMPlan << "\n"
-       << pfx << std::setw(24) << "ENTLOC:"
-       << theEntLoc << "\n"
-       << pfx << std::setw(24) << "LOC_ACCY:"
-       << theLocAccy << "\n"
-       << pfx << std::setw(24) << "ENTELV:"
-       << theEntelv << "\n"
-       << pfx << std::setw(24) << "ELV_UNIT:"
-       << theElvUnit << "\n"
-       << pfx << std::setw(24) << "EXITLOC:"
-       << theExitLoc << "\n"
-       << pfx << std::setw(24) << "EXITELV:"
-       << theExitElev << "\n"
-       << pfx << std::setw(24) << "TMAP:"
-       << theTMap << "\n"
-       << pfx << std::setw(24) << "ROW_SPACING:"
-       << theRowSpacing << "\n"
-       << pfx << std::setw(24) << "ROW_SPACING_UNITS:"
-       << theRowSpacingUnits << "\n"
-       << pfx << std::setw(24) << "COL_SPACING:"
-       << theColSpacing << "\n"
-       << pfx << std::setw(24) << "COL_SPACING_UINTS:"
-       << theColSpacingUnits << "\n"
-       << pfx << std::setw(24) << "FOCAL_LENGTH:"
-       << theFocalLength << "\n"
-       << pfx << std::setw(24) << "SENSERIAL:"
-       << theSenserial << "\n"
-       << pfx << std::setw(24) << "ABSWVER:"
-       << theAbSwVer << "\n"
-       << pfx << std::setw(24) << "CAL_DATE:"
-       << theCalDate << "\n"
-       << pfx << std::setw(24) << "PATCH_TOT:"
-       << thePatchTot << "\n"
-       << pfx << std::setw(24) << "MTI_TOT:"
-       << theMtiTot << "\n";
-   
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfAimidbTag.cpp b/ossim/src/ossim/support_data/ossimNitfAimidbTag.cpp
deleted file mode 100644
index b8b9a4f..0000000
--- a/ossim/src/ossim/support_data/ossimNitfAimidbTag.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: AIMIDB - Additional Image ID Extension Format tag class
-// definition.
-//
-// See document STDI-0002 (version 3), Appendix E, Table E-3 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfAimidbTag.h>
-
-
-RTTI_DEF1(ossimNitfAimidbTag, "ossimNitfAimidbTag", ossimNitfRegisteredTag);
-
-ossimNitfAimidbTag::ossimNitfAimidbTag()
-   : ossimNitfRegisteredTag(std::string("AIMIDB"), CEL_SIZE)
-{
-   clearFields();
-}
-
-ossimNitfAimidbTag::~ossimNitfAimidbTag()
-{
-}
-
-void ossimNitfAimidbTag::parseStream(std::istream& in)
-{
-   clearFields();
-
-   in.read(theAcquisitionDate, ACQUISITION_DATE_SIZE);
-   in.read(theMissionNumber, MISSION_NO_SIZE);
-   in.read(theMissionIdentification, MISSION_IDENTIFICATION_SIZE);
-   in.read(theFlightNo, FLIGHT_NO_SIZE);
-   in.read(theOpNum, OP_NUM_SIZE);
-   in.read(theCurrentSegment, CURRENT_SEGMENT_SIZE);
-   in.read(theReproNum, REPRO_NUM_SIZE);
-   in.read(theReplay, REPLAY_SIZE);
-   in.read(theReserved1, RESERVED_1_SIZE);
-   in.read(theStartTileColumn, START_TILE_COLUMN_SIZE);
-   in.read(theStartTileRow, START_TILE_ROW_SIZE);
-   in.read(theEndSegment, END_SEGMENT_SIZE);
-   in.read(theTileColumn, END_TILE_COLUMN_SIZE);
-   in.read(theTileRow, END_TILE_ROW_SIZE);
-   in.read(theCountry, COUNTRY_SIZE);
-   in.read(theReserved2, RESERVED_2_SIZE);
-   in.read(theLocation, LOCATION_SIZE);
-   in.read(theReserved3, RESERVED_3_SIZE);
-}
-
-void ossimNitfAimidbTag::writeStream(std::ostream& out)
-{
-   out.write(theAcquisitionDate, ACQUISITION_DATE_SIZE);
-   out.write(theMissionNumber, MISSION_NO_SIZE);
-   out.write(theMissionIdentification, MISSION_IDENTIFICATION_SIZE);
-   out.write(theFlightNo, FLIGHT_NO_SIZE);
-   out.write(theOpNum, OP_NUM_SIZE);
-   out.write(theCurrentSegment, CURRENT_SEGMENT_SIZE);
-   out.write(theReproNum, REPRO_NUM_SIZE);
-   out.write(theReplay, REPLAY_SIZE);
-   out.write(theReserved1, RESERVED_1_SIZE);
-   out.write(theStartTileColumn, START_TILE_COLUMN_SIZE);
-   out.write(theStartTileRow, START_TILE_ROW_SIZE);
-   out.write(theEndSegment, END_SEGMENT_SIZE);
-   out.write(theTileColumn, END_TILE_COLUMN_SIZE);
-   out.write(theTileRow, END_TILE_ROW_SIZE);
-   out.write(theCountry, COUNTRY_SIZE);
-   out.write(theReserved2, RESERVED_2_SIZE);
-   out.write(theLocation, LOCATION_SIZE);
-   out.write(theReserved3, RESERVED_3_SIZE);
-}
-
-void ossimNitfAimidbTag::clearFields()
-{
-   // BCS-N's to '0's, BCS-A's to ' '(spaces)
-
-   // clear
-   memset(theAcquisitionDate, ' ', ACQUISITION_DATE_SIZE);
-   memset(theMissionNumber, ' ', MISSION_NO_SIZE);
-   memset(theMissionIdentification, ' ', MISSION_IDENTIFICATION_SIZE);
-   memset(theFlightNo, ' ', FLIGHT_NO_SIZE);
-   memset(theOpNum, ' ', OP_NUM_SIZE);
-   memset(theCurrentSegment, ' ', CURRENT_SEGMENT_SIZE);
-   memset(theReproNum, ' ', REPRO_NUM_SIZE);
-   memset(theReplay, ' ', REPLAY_SIZE);
-   memset(theReserved1, ' ', RESERVED_1_SIZE);
-   memset(theStartTileColumn, ' ', START_TILE_COLUMN_SIZE);
-   memset(theStartTileRow, ' ', START_TILE_ROW_SIZE);
-   memset(theEndSegment, ' ', END_SEGMENT_SIZE);
-   memset(theTileColumn, ' ', END_TILE_COLUMN_SIZE);
-   memset(theTileRow, ' ', END_TILE_ROW_SIZE);
-   memset(theCountry, ' ', COUNTRY_SIZE);
-   memset(theReserved2, ' ', RESERVED_2_SIZE);
-   memset(theLocation, ' ', LOCATION_SIZE);
-   memset(theReserved3, ' ', RESERVED_3_SIZE);
-
-   // null terminate
-   theAcquisitionDate[ACQUISITION_DATE_SIZE] = '\0';
-   theMissionNumber[MISSION_NO_SIZE] = '\0';
-   theMissionIdentification[MISSION_IDENTIFICATION_SIZE] = '\0';
-   theFlightNo[FLIGHT_NO_SIZE] = '\0';
-   theOpNum[OP_NUM_SIZE] = '\0';
-   theCurrentSegment[CURRENT_SEGMENT_SIZE] = '\0';
-   theReproNum[REPRO_NUM_SIZE] = '\0';
-   theReplay[REPLAY_SIZE] = '\0';
-   theReserved1[RESERVED_1_SIZE] = '\0';
-   theStartTileColumn[START_TILE_COLUMN_SIZE] = '\0';
-   theStartTileRow[START_TILE_ROW_SIZE] = '\0';
-   theEndSegment[END_SEGMENT_SIZE] = '\0';
-   theTileColumn[END_TILE_COLUMN_SIZE] = '\0';
-   theTileRow[END_TILE_ROW_SIZE] = '\0';
-   theCountry[COUNTRY_SIZE] = '\0';
-   theReserved2[RESERVED_2_SIZE] = '\0';
-   theLocation[LOCATION_SIZE] = '\0';
-   theReserved3[RESERVED_3_SIZE] = '\0';
-}
-
-std::ostream& ossimNitfAimidbTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "ACQUISITION_DATE:"
-       << theAcquisitionDate << "\n"
-       << pfx << std::setw(24) << "MISSION_NO:"
-       << theMissionNumber << "\n"
-       << pfx << std::setw(24) << "MISSION_IDENTIFICATION:"
-       << theMissionIdentification<< "\n"
-       << pfx << std::setw(24) << "FLIGHT_NO:"
-       << theFlightNo << "\n"
-       << pfx << std::setw(24) << "OP_NUM:"
-       << theOpNum << "\n"
-       << pfx << std::setw(24) << "CURRENT_SEGMENT:"
-       << theCurrentSegment << "\n"
-       << pfx << std::setw(24) << "REPRO_NUM:"
-       << theReproNum<< "\n"
-       << pfx << std::setw(24) << "REPLAY:"
-       << theReplay<< "\n"
-       << pfx << std::setw(24) << "START_TILE_COLUMN:"
-       << theStartTileColumn << "\n"
-       << pfx << std::setw(24) << "START_TILE_ROW:"
-       << theStartTileRow << "\n"
-       << pfx << std::setw(24) << "END_SEGMENT:"
-       << theEndSegment << "\n"
-       << pfx << std::setw(24) << "END_TILE_COLUMN:"
-       << theTileColumn << "\n"
-       << pfx << std::setw(24) << "END_TILE_ROW:"
-       << theTileRow << "\n"
-       << pfx << std::setw(24) << "COUNTRY:"
-       << theCountry << "\n"
-       << pfx << std::setw(24) << "LOCATION:"
-       << theLocation << "\n";
-   
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfBlockaTag.cpp b/ossim/src/ossim/support_data/ossimNitfBlockaTag.cpp
deleted file mode 100644
index 10677d8..0000000
--- a/ossim/src/ossim/support_data/ossimNitfBlockaTag.cpp
+++ /dev/null
@@ -1,326 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: BLOCKA tag class declaration.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfBlockaTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstring> /* for memcpy */
-#include <sstream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfBlockaTag.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimDms.h>
-#include <ossim/base/ossimDpt.h>
-
-static const ossimTrace traceDebug(ossimString("ossimNitfBlockaTag:debug"));
-
-RTTI_DEF1(ossimNitfBlockaTag, "ossimNitfBlockaTag", ossimNitfRegisteredTag);
-
-ossimNitfBlockaTag::ossimNitfBlockaTag()
-   : ossimNitfRegisteredTag(std::string("BLOCKA"), 123)
-{
-   clearFields();
-}
-
-void ossimNitfBlockaTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theBlockInstance, BLOCK_INSTANCE_SIZE);
-   in.read(theNGray,         N_GRAY_SIZE);
-   in.read(theLLines,        L_LINES_SIZE);
-   in.read(theLayoverAngle,  LAYOVER_ANGLE_SIZE);
-   in.read(theShadowAngle,   SHADOW_ANGLE_SIZE);
-   in.read(theField6,        FIELD_6_SIZE);
-   in.read(theFrlcLoc,       FRLC_LOC_SIZE);
-   in.read(theLrlcLoc,       LRLC_LOC_SIZE);
-   in.read(theLrfcLoc,       LRFC_LOC_SIZE);
-   in.read(theFrfcLoc,       FRFC_LOC_SIZE);
-   in.read(theField11,       FIELD_11_SIZE);
-   
-}
-
-void ossimNitfBlockaTag::writeStream(std::ostream& out)
-{
-   out.write(theBlockInstance, BLOCK_INSTANCE_SIZE);
-   out.write(theNGray,         N_GRAY_SIZE);
-   out.write(theLLines,        L_LINES_SIZE);
-   out.write(theLayoverAngle,  LAYOVER_ANGLE_SIZE);
-   out.write(theShadowAngle,   SHADOW_ANGLE_SIZE);
-   out.write(theField6,        FIELD_6_SIZE);
-   out.write(theFrlcLoc,       FRLC_LOC_SIZE);
-   out.write(theLrlcLoc,       LRLC_LOC_SIZE);
-   out.write(theLrfcLoc,       LRFC_LOC_SIZE);
-   out.write(theFrfcLoc,       FRFC_LOC_SIZE);
-   out.write(theField11,       FIELD_11_SIZE);
-}
-
-void ossimNitfBlockaTag::clearFields()
-{
-   memcpy(theBlockInstance, "01",    BLOCK_INSTANCE_SIZE);
-   memset(theNGray,         0,     N_GRAY_SIZE);
-   memset(theLLines,        0,     L_LINES_SIZE);
-   memset(theLayoverAngle,  ' ',     LAYOVER_ANGLE_SIZE);
-   memset(theShadowAngle,   ' ',     SHADOW_ANGLE_SIZE);
-   memset(theField6,        ' ',     FIELD_6_SIZE);
-   memset(theFrlcLoc,       ' ',     FRLC_LOC_SIZE);
-   memset(theLrlcLoc,       ' ',     LRLC_LOC_SIZE);
-   memset(theLrfcLoc,       ' ',     LRFC_LOC_SIZE);
-   memset(theFrfcLoc,       ' ',     FRFC_LOC_SIZE);
-   memcpy(theField11,       "010.0", FIELD_11_SIZE);
-   
-   theBlockInstance[BLOCK_INSTANCE_SIZE] = '\0';
-   theNGray[N_GRAY_SIZE]                 = '\0';
-   theLLines[L_LINES_SIZE]               = '\0';
-   theLayoverAngle[LAYOVER_ANGLE_SIZE]   = '\0';
-   theShadowAngle[SHADOW_ANGLE_SIZE]     = '\0';
-   theField6[FIELD_6_SIZE]               = '\0';
-   theFrlcLoc[FRLC_LOC_SIZE]             = '\0';
-   theLrlcLoc[LRLC_LOC_SIZE]             = '\0';
-   theLrfcLoc[LRFC_LOC_SIZE]             = '\0';
-   theFrfcLoc[FRFC_LOC_SIZE]             = '\0';
-   theField11[FIELD_11_SIZE]              = '\0';
-}
-
-std::ostream& ossimNitfBlockaTag::print(std::ostream& out,
-                                        const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   // Grab the corners parsed into points.
-   ossimDpt ulPt;
-   ossimDpt urPt;
-   ossimDpt lrPt;
-   ossimDpt llPt;
-   getFrfcLoc(ulPt);
-   getFrlcLoc(urPt);
-   getLrlcLoc(lrPt);
-   getLrfcLoc(llPt);
-   
-   out << setiosflags(ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "BLOCK_INSTANCE:" << theBlockInstance << "\n"
-       << pfx << std::setw(24) << "N_GRAY:"         << theNGray << "\n"
-       << pfx << std::setw(24) << "L_LINES:"        << theLLines << "\n"
-       << pfx << std::setw(24) << "LAYOVER_ANGLE:"  << theLayoverAngle << "\n"
-       << pfx << std::setw(24) << "SHADOW_ANGLE:"   << theShadowAngle << "\n"
-       << pfx << std::setw(24) << "FIELD_6:"        << theField6 << "\n"
-       << pfx << std::setw(24) << "FRLC_LOC:"       << theFrlcLoc << "\n"
-       << pfx << std::setw(24) << "LRLC_LOC:"       << theLrlcLoc << "\n"
-       << pfx << std::setw(24) << "LRFC_LOC:"       << theLrfcLoc << "\n"
-       << pfx << std::setw(24) << "FRFC_LOC:"       << theFrfcLoc << "\n"
-       << pfx << std::setw(24) << "FIELD_11:"       << theField11 << "\n"
-       << pfx << std::setw(24) << "upper left:"     << ulPt << "\n"
-       << pfx << std::setw(24) << "upper right:"    << urPt << "\n"
-       << pfx << std::setw(24) << "lower right:"    << lrPt << "\n"
-       << pfx << std::setw(24) << "lower left:"     << llPt << "\n";
-
-   return out;
-}
-
-void ossimNitfBlockaTag::setBlockInstance(ossim_uint32 block)
-{
-   if ( (block > 0) && (block < 100) )
-   {
-      ossimString os =
-         ossimNitfCommon::convertToIntString(block,
-                                             BLOCK_INSTANCE_SIZE);
-      memcpy(theBlockInstance, os.c_str(), BLOCK_INSTANCE_SIZE);
-   }
-}
-
-ossimString ossimNitfBlockaTag::getBlockInstance() const
-{
-   return ossimString(theBlockInstance);
-}
-
-void ossimNitfBlockaTag::setNGray(ossim_uint32 grayCount)
-{
-   if (grayCount < 100000)
-   {
-      ossimString os =
-         ossimNitfCommon::convertToUIntString(grayCount,
-                                              N_GRAY_SIZE);
-      memcpy(theNGray, os.c_str(), N_GRAY_SIZE);
-   }
-}
-
-ossimString ossimNitfBlockaTag::getNGray() const
-{
-   return ossimString(theNGray);
-}
-
-void ossimNitfBlockaTag::setLLines(ossim_uint32 lines)
-{
-   if (lines < 100000)
-   {
-      ossimString os =
-         ossimNitfCommon::convertToUIntString(lines, L_LINES_SIZE);
-      memcpy(theLLines, os.c_str(), L_LINES_SIZE);
-   }
-}
-
-ossimString ossimNitfBlockaTag::getLLines() const
-{
-   return ossimString(theLLines);
-}
-
-void ossimNitfBlockaTag::setLayoverAngle(ossim_uint32 angle)
-{
-   if (angle < 360)
-   {
-      ossimString os =
-         ossimNitfCommon::convertToUIntString(angle, LAYOVER_ANGLE_SIZE);
-      memcpy(theLayoverAngle, os.c_str(), LAYOVER_ANGLE_SIZE);
-   }
-}
-
-ossimString ossimNitfBlockaTag::getLayoverAngle() const
-{
-   return ossimString(theLayoverAngle);
-}
-
-void ossimNitfBlockaTag::setShadowAngle(ossim_uint32 angle)
-{
-   if (angle < 360)
-   {
-      ossimString os =
-         ossimNitfCommon::convertToUIntString(angle, SHADOW_ANGLE_SIZE);
-      memcpy(theShadowAngle, os.c_str(), SHADOW_ANGLE_SIZE);
-   }
-}
-
-ossimString ossimNitfBlockaTag::getShadowAngle() const
-{
-   return ossimString(theShadowAngle);
-}
-
-void ossimNitfBlockaTag::setFrlcLoc(const ossimDpt& pt)
-{
-   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
-   memcpy(theFrlcLoc, os.c_str(), FRLC_LOC_SIZE);
-}
-
-ossimString ossimNitfBlockaTag::getFrlcLoc() const
-{
-   return ossimString(theFrlcLoc);
-}
-
-void ossimNitfBlockaTag::getFrlcLoc(ossimDpt& pt) const
-{
-   ossimString os = theFrlcLoc;
-   converLocStringToPt(os, pt);
-}
-
-void ossimNitfBlockaTag::setLrlcLoc(const ossimDpt& pt)
-{
-   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
-   memcpy(theLrlcLoc, os.c_str(), LRLC_LOC_SIZE);
-}
-   
-ossimString ossimNitfBlockaTag::getLrlcLoc() const
-{
-   return ossimString(theLrlcLoc);
-}
-
-void ossimNitfBlockaTag::getLrlcLoc(ossimDpt& pt) const
-{
-   ossimString os = theLrlcLoc;
-   converLocStringToPt(os, pt);
-}
-
-void ossimNitfBlockaTag::setLrfcLoc(const ossimDpt& pt)
-{
-   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
-   memcpy(theLrfcLoc, os.c_str(), LRFC_LOC_SIZE);
-}
-
-ossimString ossimNitfBlockaTag::getLrfcLoc() const
-{
-   return ossimString(theLrfcLoc);
-}
-
-void ossimNitfBlockaTag::getLrfcLoc(ossimDpt& pt) const
-{
-   ossimString os = theLrfcLoc;
-   converLocStringToPt(os, pt); 
-}
-
-void ossimNitfBlockaTag::setFrfcLoc(const ossimDpt& pt)
-{
-   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
-   memcpy(theFrfcLoc, os.c_str(), FRFC_LOC_SIZE);
-}
-
-ossimString ossimNitfBlockaTag::getFrfcLoc() const
-{
-   return ossimString(theFrfcLoc);
-}
-
-void ossimNitfBlockaTag::getFrfcLoc(ossimDpt& pt) const
-{
-   ossimString os = theFrfcLoc;
-   converLocStringToPt(os, pt);
-}
-
-void ossimNitfBlockaTag::converLocStringToPt(const ossimString& locationString,
-                                             ossimDpt& pt) const
-{
-   if (locationString.size() != 21) return;
-
-   std::string s = locationString;
-   
-   std::string lat(s, 0, 10);
-   std::string lon(s, 10, 11);
-
-   if ( (lat[0] == 'N') || (lat[0] == 'S') )
-   {
-      // Need to enter spaces for ossimDms to parse correctly
-      std::ostringstream latStream;
-      latStream << lat.substr(0, 3) << " " << lat.substr(3, 2)
-                << " " << lat.substr(5);
-      lat = latStream.str();
-      
-      // Use the dms class to parse.
-      ossimDms dms(0.0, true);
-      dms.setDegrees(lat.c_str());
-      pt.y = dms.getDegrees();
-   }
-   else
-   {
-      ossimString os = lat;
-      pt.y = os.toDouble();
-   }
-   if ( (lon[0] == 'E') || (lon[0] == 'W') )
-   {
-      // Need to enter spaces for ossimDms to parse correctly
-      std::ostringstream lonStream;
-      lonStream << lon.substr(0, 4) << " " << lon.substr(4, 2)
-                << " " << lon.substr(6);
-      lon = lonStream.str();
-      
-      // Use the dms class to parse.
-      ossimDms dms(0.0, false);
-      dms.setDegrees(lon.c_str());
-      pt.x = dms.getDegrees();
-   }
-   else
-   {
-      ossimString os = lon;
-      pt.x = os.toDouble();
-   }
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfCommon.cpp b/ossim/src/ossim/support_data/ossimNitfCommon.cpp
deleted file mode 100644
index 69f0cf7..0000000
--- a/ossim/src/ossim/support_data/ossimNitfCommon.cpp
+++ /dev/null
@@ -1,542 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Utility class for global nitf methods.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfCommon.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstring> /* for memcpy */
-#include <sstream>
-#include <iomanip>
-#include <sstream>
-#include <stdexcept>
-#include <iostream>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/base/ossimDms.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-
-static const ossimTrace traceDebug(ossimString("ossimNitfCommon:debug"));
-
-                                   
-ossimNitfCommon::ossimNitfCommon(){}
-
-ossimNitfCommon::~ossimNitfCommon(){}
-
-ossimString ossimNitfCommon::convertToScientificString(
-   const ossim_float64& aValue,
-   ossim_uint32 size)
-{
-   // Precision cannot hit 0 for this to work...
-   if ( ((aValue < 0.0) && (size < 8)) ||
-        ((aValue >= 0.0) && (size < 7)) )
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfCommon::convertToScientificString DEBUG:"
-            << "\nsize range error!"
-            << std::endl;
-      }
-      return ossimString();
-   }
-
-   //--
-   // Set the precision to account for size with 1.xxxxxE+01
-   //---
-   ossim_uint32 precision = size - 6;
-   
-   if (aValue < 0.0)
-   {
-      --precision;
-   }
-   
-   std::ostringstream s1;
-   s1 << std::setiosflags(std::ios_base::scientific|std::ios_base::internal)
-      << std::setfill('0')
-      // << setw(size)
-      << std::setprecision(precision)
-      << aValue;
-   
-   ossimString result = s1.str();
-
-   // Upcase the "e".
-   result.upcase();
-   
-   if (traceDebug())
-   {
-      if (result.size() != size)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfCommon::convertToScientificString DEBUG:"
-            << "\nIncorrect output size!"
-            << "\nValue:  " << aValue
-            << "\nString: " << result
-            << std::endl;
-      }
-   }
-   return result;
-}
-
-ossimString ossimNitfCommon::convertToDoubleString(
-   const ossim_float64& aValue,
-   ossim_uint32 precision,
-   ossim_uint32 size)
-{
-   ossim_uint32 width = size;
-   
-   std::ostringstream s1;
-   s1 << std::setiosflags(std::ios_base::fixed|
-                     std::ios_base::internal)
-      << std::setprecision(precision)
-      << std::setfill('0')
-      << std::setw(width)
-      << aValue;
-   
-   ossimString result = s1.str();
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfCommon::convertToDoubleString DEBUG:"
-         << "\nresult: " << result << std::endl;
-      
-      if (result.size() != size)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfCommon::convertToDoubleString DEBUG:"
-            << "\nIncorrect output size!"
-            << std::endl;
-      }
-   }
-   return result;
-}
-
-ossimString ossimNitfCommon::convertToUIntString(ossim_uint32 aValue,
-                                                ossim_uint32 size)
-{
-   ossim_uint32 width = size;
-   
-   std::ostringstream s1;
-   s1 << std::setiosflags(std::ios_base::fixed|
-                     std::ios_base::internal)
-      << std::setfill('0')
-      << std::setw(width)
-      << aValue;
-   
-   ossimString result = s1.str();
-
-   if (traceDebug())
-   {
-      if (result.size() != size)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfCommon::convertToUIntString DEBUG:"
-            << "\nIncorrect output size!"
-            << "\nValue:  " << aValue
-            << "\nString: " << result
-            << std::endl;
-      }
-   }
-   return result;   
-}
-
-ossimString ossimNitfCommon::convertToIntString(ossim_int32 aValue,
-                                                ossim_uint32 size)
-{
-   ossim_uint32 width = size;
-   
-   std::ostringstream s1;
-   s1 << std::setiosflags(std::ios_base::fixed|
-                     std::ios_base::internal)
-      << std::setfill('0')
-      << std::setw(width)
-      << aValue;
-   
-   ossimString result = s1.str();
-
-   if (traceDebug())
-   {
-      if (result.size() != size)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfCommon::convertToIntString DEBUG:"
-            << "\nIncorrect output size!"
-            << "\nValue:  " << aValue
-            << "\nString: " << result
-            << std::endl;
-      }
-   }
-   return result;   
-}
-
-ossimString ossimNitfCommon::convertToDdLatLonLocString(const ossimDpt& pt,
-                                                        ossim_uint32 precision)
-{
-   ossimString lat;
-   ossimString lon;
-   ossim_uint32 latSize = precision+4; // size = precision + "-33."
-   ossim_uint32 lonSize = precision+5; // size = precision + "-122."
-   
-   if (pt.y >= 0.0)
-   {
-      lat = "+";
-      --latSize;
-   }
-   if (pt.x >= 0.0)
-   {
-      lon = "+";
-      --lonSize;
-   }
-   lat += convertToDoubleString(pt.y,
-                                precision,
-                                latSize);
-   lon += convertToDoubleString(pt.x,
-                                precision,
-                                lonSize);
-   ossimString result = lat+lon;
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfCommon::convertToDdLatLonLocString DEBUG:"
-         << "\nresult: " << result
-         << std::endl;
-   }
-
-   return result;
-}
-
-void ossimNitfCommon::setField(void* fieldDestination,
-                               const ossimString& src,
-                               std::streamsize width,
-                               std::ios_base::fmtflags ioflags,
-                               char fill)
-{
-   std::ostringstream out;
-   out << std::setw(width)
-       << std::setfill(fill)
-       << std::setiosflags(ioflags)
-       << src.trim().c_str();
-   
-   memcpy(fieldDestination, out.str().c_str(), width);
-}
-
-ossimString ossimNitfCommon::encodeUtm(
-                                       ossim_uint32 zone,
-                                       const ossimDpt& ul,
-                                       const ossimDpt& ur,
-                                       const ossimDpt& lr,
-                                       const ossimDpt& ll)
-{
-   std::ostringstream out;
-   
-   if(zone > 60)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUTM zone greate than 60!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   ossim_float64 east  = ul.x;
-   ossim_float64 north = ul.y;
-   
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   out << std::setw(2)
-   << std::setfill('0')
-   << zone
-   << std::setw(6)
-   << std::setfill('0')
-   <<(ossim_uint32)(east+.5)
-   << std::setw(7)
-   << std::setfill('0')
-   <<(ossim_uint32)(north+.5);
-   
-   
-   east  = ur.x;
-   north = ur.y;
-   
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   out << std::setw(2)
-   << std::setfill('0')
-   << zone
-   << std::setw(6)
-   << std::setfill('0')
-   <<(ossim_uint32)(east+.5)
-   << std::setw(7)
-   << std::setfill('0')
-   <<(ossim_uint32)(north+.5);
-   east  = lr.x;
-   north = lr.y;
-   
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }   
-   
-   out << std::setw(2)
-   << std::setfill('0')
-   << zone
-   << std::setw(6)
-   << std::setfill('0')
-   <<(ossim_uint32)(east+.5)
-   << std::setw(7)
-   << std::setfill('0')
-   <<(ossim_uint32)(north+.5);
-   
-   east  = ll.x;
-   north = ll.y;
-   
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   out << std::setw(2)
-   << std::setfill('0')
-   << zone
-   << std::setw(6)
-   << std::setfill('0')
-   <<(ossim_uint32)(east+.5)
-   << std::setw(7)
-   << std::setfill('0')
-   <<(ossim_uint32)(north+.5);
-   
-   return out.str().c_str();
-}
-
-ossimString ossimNitfCommon::encodeGeographicDms(const ossimDpt& ul,
-                                                 const ossimDpt& ur,
-                                                 const ossimDpt& lr,
-                                                 const ossimDpt& ll)
-{
-   std::ostringstream out;
-   
-   out << ossimDms(ul.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(ul.x, false).toString("dddmmssC").c_str();
-   out << ossimDms(ur.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(ur.x, false).toString("dddmmssC").c_str();
-   out << ossimDms(lr.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(lr.x, false).toString("dddmmssC").c_str();
-   out << ossimDms(ll.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(ll.x, false).toString("dddmmssC").c_str();
-
-   return ossimString(out.str());
-}
-
-ossimString ossimNitfCommon::encodeGeographicDecimalDegrees(const ossimDpt& ul,
-                                                            const ossimDpt& ur,
-                                                            const ossimDpt& lr,
-                                                            const ossimDpt& ll)
-{
-   std::ostringstream out;
-   
-   out << (ul.lat >= 0.0?"+":"")
-   << std::setw(6)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << ul.lat
-   << (ul.lon >= 0.0?"+":"")
-   << std::setw(7)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << ul.lon;
-   out << (ur.lat >= 0.0?"+":"")
-   << std::setw(6)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << ur.lat
-   << (ur.lon >= 0.0?"+":"")
-   << std::setw(7)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << ur.lon;
-   out << (lr.lat >= 0.0?"+":"")
-   << std::setw(6)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << lr.lat
-   << (lr.lon >= 0.0?"+":"")
-   << std::setw(7)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << lr.lon;
-   out << (ll.lat >= 0.0?"+":"")
-   << std::setw(6)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << ll.lat
-   << (ll.lon >= 0.0?"+":"")
-   << std::setw(7)
-   << std::setfill('0')
-   << std::setprecision(3)
-   << std::setiosflags(std::ios::fixed)
-   << ll.lon;
-   
-   return ossimString(out.str());
-}
-
-ossimString ossimNitfCommon::getNitfPixelType(ossimScalarType scalarType)
-{
-   ossimString pixelType;
-   switch(scalarType)
-   {
-      case OSSIM_UINT8:
-      case OSSIM_USHORT11:
-      case OSSIM_UINT16:
-      case OSSIM_UINT32:
-      {
-         pixelType = "INT";
-         break;
-      }
-      case OSSIM_SINT16:
-      case OSSIM_SINT32:
-      {
-         pixelType    = "SI";
-         break;
-      }
-      case OSSIM_FLOAT:
-      case OSSIM_NORMALIZED_FLOAT:
-      case OSSIM_DOUBLE:
-      case OSSIM_NORMALIZED_DOUBLE:
-      {
-         pixelType    = "R";
-         break;
-      }
-      default:
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << __FILE__ << ":" << __LINE__
-            << "\nUnhandled scalar type:  " << scalarType << std::endl;
-         break;
-      }
-   }
-   return pixelType;
-}
-
-ossimString ossimNitfCommon::getCompressionRate(const ossimIrect& rect,
-                                                ossim_uint32 bands,
-                                                ossimScalarType scalar,
-                                                ossim_uint64 lengthInBytes)
-{
-   ossimString result("");
-   
-   ossim_float64 uncompressedSize =
-      ossim::scalarSizeInBytes(scalar) * rect.width() * rect.height() * bands;
-   ossim_float64 bitsPerPix = ossim::getBitsPerPixel(scalar);
-   ossim_float64 rate = ( bitsPerPix *
-                          (static_cast<ossim_float64>(lengthInBytes) /
-                           uncompressedSize) );
-
-   // Multiply by ten as there is an implied decimal point.
-   rate *= 10.0;
-
-   // Convert to string with zero precision.
-   ossimString s = ossimString::toString(rate, 0);
-
-   if (s.size())
-   {
-      if (s.size() <= 3)
-      {
-         result = "N";
-         if (s.size() == 2)
-         {
-            result += "0";
-         }
-         else if (s.size() == 1)
-         {
-            result += "00";
-         }
-         result += s;
-      }
-   }
-   return result;
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfCompressionHeader.cpp b/ossim/src/ossim/support_data/ossimNitfCompressionHeader.cpp
deleted file mode 100644
index dc40359..0000000
--- a/ossim/src/ossim/support_data/ossimNitfCompressionHeader.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts
-//
-// LICENSE: MIT see top level LICENSE.txt for more details
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfCompressionHeader.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <ossim/support_data/ossimNitfCompressionHeader.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <sstream>
-
-RTTI_DEF1(ossimNitfCompressionHeader, "ossimNitfCompressionHeader", ossimObject);
-
-bool ossimNitfCompressionHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   return ossimObject::saveState(kwl, prefix);
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfCscrnaTag.cpp b/ossim/src/ossim/support_data/ossimNitfCscrnaTag.cpp
deleted file mode 100644
index 2602f16..0000000
--- a/ossim/src/ossim/support_data/ossimNitfCscrnaTag.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CSCRNA tag class definition.
-//
-// Corner Footprint TRE.
-//
-// See document STDI-0006-NCDRD Table 3.2-13 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfCscrnaTag.h>
-
-
-RTTI_DEF1(ossimNitfCscrnaTag, "ossimNitfCscrnaTag", ossimNitfRegisteredTag);
-
-ossimNitfCscrnaTag::ossimNitfCscrnaTag()
-   : ossimNitfRegisteredTag(std::string("CSCRNA"), 109)
-{
-   clearFields();
-}
-
-ossimNitfCscrnaTag::~ossimNitfCscrnaTag()
-{
-}
-
-void ossimNitfCscrnaTag::parseStream(std::istream& in)
-{
-   clearFields();
-
-   in.read(thePredictedCornerFlag, 1);
-
-   in.read(theUlLat, 9);
-   in.read(theUlLon, 10);
-   in.read(theUlHt, 8);
-
-   in.read(theUrLat, 9);
-   in.read(theUrLon, 10);
-   in.read(theUrHt, 8);
-
-   in.read(theLrLat, 9);
-   in.read(theLrLon, 10);
-   in.read(theLrHt, 8);
-
-   in.read(theLlLat, 9);
-   in.read(theLlLon, 10);
-   in.read(theLlHt, 8);
-}
-
-void ossimNitfCscrnaTag::writeStream(std::ostream& out)
-{
-   out.write(thePredictedCornerFlag, 1);
-
-   out.write(theUlLat, 9);
-   out.write(theUlLon, 10);
-   out.write(theUlHt, 8);
-
-   out.write(theUrLat, 9);
-   out.write(theUrLon, 10);
-   out.write(theUrHt, 8);
-
-   out.write(theLrLat, 9);
-   out.write(theLrLon, 10);
-   out.write(theLrHt, 8);
-
-   out.write(theLlLat, 9);
-   out.write(theLlLon, 10);
-   out.write(theLlHt, 8);
-}
-
-void ossimNitfCscrnaTag::clearFields()
-{
-   // BCS-N's to '0's, BCS-A's to ' '(spaces)
-   memset(thePredictedCornerFlag, ' ', 1);
-   
-   memset(theUlLat, 0, 9);
-   memset(theUlLon, 0, 10);
-   memset(theUlHt, 0, 8);
-
-   memset(theUrLat, 0, 9);
-   memset(theUrLon, 0, 10);
-   memset(theUrHt, 0, 8);
-
-   memset(theLrLat, 0, 9);
-   memset(theLrLon, 0, 10);
-   memset(theLrHt, 0, 8);
-
-   memset(theLlLat, 0, 9);
-   memset(theLlLon, 0, 10);
-   memset(theLlHt, 0, 8);
-
-   thePredictedCornerFlag[1] = '\0';
-   
-   theUlLat[9] = '\0';
-   theUlLon[10] = '\0';
-   theUlHt[8] = '\0';
-
-   theUrLat[9] = '\0';
-   theUrLon[10] = '\0';
-   theUrHt[8] = '\0';
-
-   theLrLat[9] = '\0';
-   theLrLon[10] = '\0';
-   theLrHt[8] = '\0';
-
-   theLlLat[9] = '\0';
-   theLlLon[10] = '\0';
-   theLlHt[8] = '\0';
-}
-
-std::ostream& ossimNitfCscrnaTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-      
-       << pfx << std::setw(24) << "PREDICT_CORNERS:"
-       << thePredictedCornerFlag << "\n"
-      
-       << pfx << std::setw(24) << "ULCRN_LAT:" << theUlLat << "\n"
-       << pfx << std::setw(24) << "ULCRN_LON:" << theUlLon << "\n"
-       << pfx << std::setw(24) << "ULCRN_HT:" << theUlHt << "\n"
-
-       << pfx << std::setw(24) << "URCRN_LAT:" << theUrLat << "\n"
-       << pfx << std::setw(24) << "URCRN_LON:" << theUrLon << "\n"
-       << pfx << std::setw(24) << "URCRN_HT:" << theUrHt << "\n"
-   
-       << pfx << std::setw(24) << "LRCRN_LAT:" << theLrLat << "\n"
-       << pfx << std::setw(24) << "LRCRN_LON:" << theLrLon << "\n"
-       << pfx << std::setw(24) << "LRCRN_HT:" << theLrHt << "\n"
-      
-       << pfx << std::setw(24) << "LLCRN_LAT:" << theLlLat << "\n"
-       << pfx << std::setw(24) << "LLCRN_LON:" << theLlLon << "\n"
-       << pfx << std::setw(24) << "LLCRN_HT:" << theLlHt << "\n";
-
-      return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfCsdidaTag.cpp b/ossim/src/ossim/support_data/ossimNitfCsdidaTag.cpp
deleted file mode 100644
index 346696d..0000000
--- a/ossim/src/ossim/support_data/ossimNitfCsdidaTag.cpp
+++ /dev/null
@@ -1,150 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CSDIDA tag class definition.
-//
-// Dataset Indentification TRE.
-//
-// See document STDI-0006-NCDRD Table 3.3-14 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfCsdidaTag.h>
-
-
-RTTI_DEF1(ossimNitfCsdidaTag, "ossimNitfCsdidaTag", ossimNitfRegisteredTag);
-
-ossimNitfCsdidaTag::ossimNitfCsdidaTag()
-   : ossimNitfRegisteredTag(std::string("CSDIDA"), 70)
-{
-   clearFields();
-}
-
-ossimNitfCsdidaTag::~ossimNitfCsdidaTag()
-{
-}
-
-void ossimNitfCsdidaTag::parseStream(std::istream& in)
-{
-   clearFields();
-
-   in.read(theDay, 2);
-   in.read(theMonth, 3);
-   in.read(theYear, 4);
-   in.read(thePlatformCode, 2);
-   in.read(theVehicleId, 2);
-   in.read(thePass, 2);
-   in.read(theOperation, 3);
-   in.read(theSensorId, 2);
-   in.read(theProductId, 2);
-   in.read(theReservedField1, 4);
-   in.read(theTime, 14);
-   in.read(theProcessTime, 14);
-   in.read(theReservedField2, 2);
-   in.read(theReservedField3, 2);
-   in.read(theReservedField4, 1);
-   in.read(theReservedField5, 1);
-   in.read(theSoftwareVersionNumber, 10);
-}
-
-void ossimNitfCsdidaTag::writeStream(std::ostream& out)
-{
-   out.write(theDay, 2);
-   out.write(theMonth, 3);
-   out.write(theYear, 4);
-   out.write(thePlatformCode, 2);
-   out.write(theVehicleId, 2);
-   out.write(thePass, 2);
-   out.write(theOperation, 3);
-   out.write(theSensorId, 2);
-   out.write(theProductId, 2);
-   out.write(theReservedField1, 4);
-   out.write(theTime, 14);
-   out.write(theProcessTime, 14);
-   out.write(theReservedField2, 2);
-   out.write(theReservedField3, 2);
-   out.write(theReservedField4, 1);
-   out.write(theReservedField5, 1);
-   out.write(theSoftwareVersionNumber, 10);
-}
-
-void ossimNitfCsdidaTag::clearFields()
-{
-   // BCS-N's to '0's, BCS-A's to ' '(spaces)
-   
-   memset(theDay, '0', 2);
-   memset(theMonth, ' ', 3);
-   memset(theYear, '0', 4);
-   memset(thePlatformCode, ' ', 2);
-   memset(theVehicleId, '0', 2);
-   memset(thePass, '0', 2);
-   memset(theOperation, '0', 3);
-   memset(theSensorId, ' ', 2);
-   memset(theProductId, ' ', 2);
-   memcpy(theReservedField1, "00  ", 4);
-   memset(theTime, '0', 14);
-   memset(theProcessTime, '0', 14);
-   memcpy(theReservedField2, "00", 2);
-   memcpy(theReservedField3, "01", 2);
-   memcpy(theReservedField4, "N", 1);
-   memcpy(theReservedField5, "N", 1);
-   memset(theSoftwareVersionNumber, ' ', 10);
-
-   theDay[2] = '\0';
-   theMonth[3] = '\0';
-   theYear[4] = '\0';
-   thePlatformCode[2] = '\0';
-   theVehicleId[2] = '\0';
-   thePass[2] = '\0';
-   theOperation[3] = '\0';
-   theSensorId[2] = '\0';
-   theProductId[2] = '\0';
-   theReservedField1[4] = '\0';
-   theTime[14] = '\0';
-   theProcessTime[14] = '\0';
-   theReservedField2[2] = '\0';
-   theReservedField3[2] = '\0';
-   theReservedField4[0] = '\0';
-   theReservedField5[0] = '\0';
-   theSoftwareVersionNumber[10] = '\0';
-}
-
-std::ostream& ossimNitfCsdidaTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "DAY:" << theDay << "\n"
-       << pfx << std::setw(24) << "MONTH:" << theMonth << "\n"
-       << pfx << std::setw(24) << "YEAR:" << theYear << "\n"
-       << pfx << std::setw(24) << "PLATFORM_CODE:" << thePlatformCode << "\n"
-       << pfx << std::setw(24) << "VEHICLE_ID:" << theVehicleId << "\n"
-       << pfx << std::setw(24) << "PASS:" << thePass << "\n"
-       << pfx << std::setw(24) << "OPERATION:" << theOperation << "\n"
-       << pfx << std::setw(24) << "SENSOR_ID:" << theSensorId << "\n"
-       << pfx << std::setw(24) << "PRODUCT_ID:" << theProductId << "\n"
-       << pfx << std::setw(24) << "TIME:" << theTime << "\n"
-       << pfx << std::setw(24) << "PROCESS_TIME:" << theProcessTime << "\n"
-       << pfx << std::setw(24) << "SOFTWARE_VERSION_NUMBER:"
-       << theSoftwareVersionNumber << "\n";
-   
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfCsexraTag.cpp b/ossim/src/ossim/support_data/ossimNitfCsexraTag.cpp
deleted file mode 100644
index a3f6372..0000000
--- a/ossim/src/ossim/support_data/ossimNitfCsexraTag.cpp
+++ /dev/null
@@ -1,338 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: CSEXRA tag class definition.
-//
-// Exploitation Reference Data TRE.
-//
-// See document STDI-0006-NCDRD Table 3.5-16 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfCsexraTag.h>
-
-
-RTTI_DEF1(ossimNitfCsexraTag, "ossimNitfCsexraTag", ossimNitfRegisteredTag);
-
-ossimNitfCsexraTag::ossimNitfCsexraTag()
-   : ossimNitfRegisteredTag(std::string("CSEXRA"), 132)
-{
-   clearFields();
-}
-
-ossimNitfCsexraTag::~ossimNitfCsexraTag()
-{
-}
-
-void ossimNitfCsexraTag::parseStream(std::istream& in)
-{
-   clearFields();
-
-   in.read(theSensor, 6);
-   in.read(theTileFirstLine, 12);
-   in.read(theImageTimeDuration, 12);
-   in.read(theMaxGsd, 5);
-   in.read(theAlongScanGsd, 5);
-   in.read(theCrossScanGsd, 5);
-   in.read(theGeoMeanGsd, 5);
-   in.read(theAlongScanVertGsd, 5);
-   in.read(theCrossScanVertGsd, 5);
-   in.read(theGeoMeanVertGsd, 5);
-   in.read(theGeoBetaAngle, 5);
-   in.read(theDynamicRange, 5);
-   in.read(theLine, 7);
-   in.read(theSamples, 5);
-   in.read(theAngleToNorth, 7);
-   in.read(theObliquityAngle, 6);
-   in.read(theAzOfObliquity, 7);
-   in.read(theGrdCover, 1);
-   in.read(theSnowDepthCategory, 1);
-   in.read(theSunAzimuth, 7);
-   in.read(theSunElevation, 7);
-   in.read(thePredictedNiirs, 3);
-   in.read(theCircularError, 3);
-   in.read(theLinearError, 3);
-}
-
-void ossimNitfCsexraTag::writeStream(std::ostream& out)
-{
-   out.write(theSensor, 6);
-   out.write(theTileFirstLine, 12);
-   out.write(theImageTimeDuration, 12);
-   out.write(theMaxGsd, 5);
-   out.write(theAlongScanGsd, 5);
-   out.write(theCrossScanGsd, 5);
-   out.write(theGeoMeanGsd, 5);
-   out.write(theAlongScanVertGsd, 5);
-   out.write(theCrossScanVertGsd, 5);
-   out.write(theGeoMeanVertGsd, 5);
-   out.write(theGeoBetaAngle, 5);
-   out.write(theDynamicRange, 5);
-   out.write(theLine, 7);
-   out.write(theSamples, 5);
-   out.write(theAngleToNorth, 7);
-   out.write(theObliquityAngle, 6);
-   out.write(theAzOfObliquity, 7);
-   out.write(theGrdCover, 1);
-   out.write(theSnowDepthCategory, 1);
-   out.write(theSunAzimuth, 7);
-   out.write(theSunElevation, 7);
-   out.write(thePredictedNiirs, 3);
-   out.write(theCircularError, 3);
-   out.write(theLinearError, 3);
-}
-
-void ossimNitfCsexraTag::clearFields()
-{
-   //---
-   // No attempt made to set to defaults.
-   // BCS-N's to '0's, BCS-A's to ' '(spaces)
-   //---
-
-   memset(theSensor, ' ',  6);
-   memset(theTileFirstLine, 0, 12);
-   memset(theImageTimeDuration, 0, 12);
-   memset(theMaxGsd, 0, 5);
-   memset(theAlongScanGsd, ' ', 5);
-   memset(theCrossScanGsd, ' ', 5);
-   memset(theGeoMeanGsd, ' ', 5);
-   memset(theAlongScanVertGsd, ' ', 5);
-   memset(theCrossScanVertGsd, ' ', 5);
-   memset(theGeoMeanVertGsd, ' ', 5);
-   memset(theGeoBetaAngle, ' ', 5);
-   memset(theDynamicRange, 0, 5);
-   memset(theLine, 0, 7);
-   memset(theSamples, 0, 5);
-   memset(theAngleToNorth, 0, 7);
-   memset(theObliquityAngle, 0, 6);
-   memset(theAzOfObliquity, 0, 7);
-   memset(theGrdCover, 0, 1);
-   memset(theSnowDepthCategory, 0, 1);
-   memset(theSunAzimuth, 0, 7);
-   memset(theSunElevation, 0, 7);
-   memset(thePredictedNiirs, ' ', 3);
-   memset(theCircularError, 0, 3);
-   memset(theLinearError, 0, 3);
-
-   theSensor[6] = '\0';
-   theTileFirstLine[12] = '\0';
-   theImageTimeDuration[12] = '\0';
-   theMaxGsd[5] = '\0';
-   theAlongScanGsd[5] = '\0';
-   theCrossScanGsd[5] = '\0';
-   theGeoMeanGsd[5] = '\0';
-   theAlongScanVertGsd[5] = '\0';
-   theCrossScanVertGsd[5] = '\0';
-   theGeoMeanVertGsd[5] = '\0';
-   theGeoBetaAngle[5] = '\0';
-   theDynamicRange[5] = '\0';
-   theLine[7] = '\0';
-   theSamples[5] = '\0';
-   theAngleToNorth[7] = '\0';
-   theObliquityAngle[6] = '\0';
-   theAzOfObliquity[7] = '\0';
-   theGrdCover[1] = '\0';
-   theSnowDepthCategory[1] = '\0';
-   theSunAzimuth[7] = '\0';
-   theSunElevation[7] = '\0';
-   thePredictedNiirs[3] = '\0';
-   theCircularError[3] = '\0';
-   theLinearError[3] = '\0';
-   
-}
-
-std::ostream& ossimNitfCsexraTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"
-       << getTagLength() << "\n"
-       << pfx << std::setw(24) << "SENSOR:"
-       << theSensor << "\n"
-       << pfx << std::setw(24) << "TIME_FIRST_LINE_IMAGE:"
-       << theTileFirstLine << "\n"
-       << pfx << std::setw(24) << "TIME_IMAGE_DURATION:"
-       << theImageTimeDuration << "\n"
-       << pfx << std::setw(24) << "MAX_GSD:"
-       << theMaxGsd << "\n"
-       << pfx << std::setw(24) << "ALONG_SCAN_GSD:"
-       << theAlongScanGsd << "\n"
-       << pfx << std::setw(24) << "CROSS_SCAN_GSD:"
-       << theCrossScanGsd << "\n"
-       << pfx << std::setw(24) << "GEO_MEAN_GSD:"
-       << theGeoMeanGsd << "\n"
-       << pfx << std::setw(24) << "A_S_VERT_GSD:"
-       << theAlongScanVertGsd << "\n"
-       << pfx << std::setw(24) << "C_S_VERT_GSD:"
-       << theCrossScanVertGsd << "\n"
-       << pfx << std::setw(24) << "GEO_MEAN_VERT_GSD:"
-       << theGeoMeanVertGsd << "\n"
-       << pfx << std::setw(24) << "GEO_BETA_ANGLE:"
-       << theGeoBetaAngle << "\n"
-       << pfx << std::setw(24) << "DYNAMIC_RANGE:"
-       << theDynamicRange << "\n"
-       << pfx << std::setw(24) << "NUM_LINES:"
-       << theLine << "\n"
-       << pfx << std::setw(24) << "NUM_SAMPLES:"
-       << theSamples << "\n"
-       << pfx << std::setw(24) << "ANGLE_TO_NORTH:"
-       << theAngleToNorth << "\n"
-       << pfx << std::setw(24) << "OBLIQUITY_ANGLE:"
-       << theObliquityAngle << "\n"
-       << pfx << std::setw(24) << "AZ_OF_OBLIQUITY:"
-       << theAzOfObliquity << "\n"
-       << pfx << std::setw(24) << "GRD_COVER:"
-       << theGrdCover << "\n"
-       << pfx << std::setw(24) << "SNOW_DEPTH_CAT:"
-       << theSnowDepthCategory << "\n"
-       << pfx << std::setw(24) << "SUN_AZIMUTH:"
-       << theSunAzimuth << "\n"
-       << pfx << std::setw(24) << "SUN_ELEVATION:"
-       << theSunElevation << "\n"
-       << pfx << std::setw(24) << "PREDICTED_NIIRS:"
-       << thePredictedNiirs << "\n"
-       << pfx << std::setw(24) << "CIRCL_ERR:"
-       << theCircularError << "\n"
-       << pfx << std::setw(24) << "LINEAR_ERR:"
-       << theLinearError<< "\n";
-   
-   return out;
-}
-
-ossimString ossimNitfCsexraTag::getSensor() const
-{
-   return ossimString(theSensor);
-}
-   
-ossimString ossimNitfCsexraTag::getTimeFirstLineImage() const
-{
-   return ossimString(theTileFirstLine);
-}
-   
-ossimString ossimNitfCsexraTag::getTimeImageDuration() const
-{
-   return ossimString(theImageTimeDuration);
-}
-   
-ossimString ossimNitfCsexraTag::getMaxGsd() const
-{
-   return ossimString(theMaxGsd);
-}
-   
-ossimString ossimNitfCsexraTag::getAlongScanGsd() const
-{
-   return ossimString(theAlongScanGsd);
-}
-   
-ossimString ossimNitfCsexraTag::getCrossScanGsd() const
-{
-   return ossimString(theCrossScanGsd);
-}
-   
-ossimString ossimNitfCsexraTag::getGeoMeanGsd() const
-{
-   return ossimString(theGeoMeanGsd);
-}
-   
-ossimString ossimNitfCsexraTag::getAlongScanVerticalGsd() const
-{
-   return ossimString(theAlongScanVertGsd);
-}
-   
-ossimString ossimNitfCsexraTag::getCrossScanVerticalGsd() const
-{
-   return ossimString(theCrossScanVertGsd);
-}
-
-ossimString ossimNitfCsexraTag::getGeoMeanVerticalGsd() const
-{
-   return ossimString(theGeoMeanVertGsd);
-}
-
-ossimString ossimNitfCsexraTag::getGeoBetaAngle() const
-{
-   return ossimString(theGeoBetaAngle);
-}
-
-ossimString ossimNitfCsexraTag::getDynamicRange() const
-{
-   return ossimString(theDynamicRange);
-}
-   
-ossimString ossimNitfCsexraTag::getNumLines() const
-{
-   return ossimString(theLine);
-}
-   
-ossimString ossimNitfCsexraTag::getNumSamples() const
-{
-   return ossimString(theSamples);
-}
-   
-ossimString ossimNitfCsexraTag::getAngleToNorth() const
-{
-   return ossimString(theAngleToNorth);
-}
-
-ossimString ossimNitfCsexraTag::getObliquityAngle() const
-{
-   return ossimString(theObliquityAngle);
-}
-
-ossimString ossimNitfCsexraTag::getAzimuthOfObliquity() const
-{
-   return ossimString(theAzOfObliquity);
-}
-   
-ossimString ossimNitfCsexraTag::getGroundCover() const
-{
-   return ossimString(theGrdCover);
-}
-
-ossimString ossimNitfCsexraTag::getSnowDepth() const
-{
-   return ossimString(theSnowDepthCategory);
-}
-   
-ossimString ossimNitfCsexraTag::getSunAzimuth() const
-{
-   return ossimString(theSunAzimuth);
-}
-
-ossimString ossimNitfCsexraTag::getSunElevation() const
-{
-   return ossimString(theSunElevation);
-}
-
-ossimString ossimNitfCsexraTag::getPredictedNiirs() const
-{
-   return ossimString(thePredictedNiirs);
-}
-   
-ossimString ossimNitfCsexraTag::getCE90() const
-{
-   return ossimString(theCircularError);
-}
-
-ossimString ossimNitfCsexraTag::getLE90() const
-{
-   return ossimString(theLinearError);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfCsproaTag.cpp b/ossim/src/ossim/support_data/ossimNitfCsproaTag.cpp
deleted file mode 100644
index ddb6b9b..0000000
--- a/ossim/src/ossim/support_data/ossimNitfCsproaTag.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <ossim/support_data/ossimNitfCsproaTag.h>
-#include <iomanip>
-#include <iostream>
-
-ossimNitfCsproaTag::ossimNitfCsproaTag()
-   : ossimNitfRegisteredTag(std::string("CSPROA"), 120)
-{
-   clearFields();
-}
-
-void ossimNitfCsproaTag::parseStream(std::istream& in)
-{
-   in.read(m_reserved1, RESERVE1_SIZE);
-   in.read(m_reserved2, RESERVE2_SIZE);
-   in.read(m_reserved3, RESERVE3_SIZE);
-   in.read(m_reserved4, RESERVE4_SIZE);
-   in.read(m_reserved5, RESERVE5_SIZE);
-   in.read(m_reserved6, RESERVE6_SIZE);
-   in.read(m_reserved7, RESERVE7_SIZE);
-   in.read(m_reserved8, RESERVE8_SIZE);
-   in.read(m_reserved9, RESERVE9_SIZE);
-   in.read(m_bwc, BWC_SIZE);
-}
-
-void ossimNitfCsproaTag::writeStream(std::ostream& out)
-{
-   out.write(m_reserved1, RESERVE1_SIZE);
-   out.write(m_reserved2, RESERVE2_SIZE);
-   out.write(m_reserved3, RESERVE3_SIZE);
-   out.write(m_reserved4, RESERVE4_SIZE);
-   out.write(m_reserved5, RESERVE5_SIZE);
-   out.write(m_reserved6, RESERVE6_SIZE);
-   out.write(m_reserved7, RESERVE7_SIZE);
-   out.write(m_reserved8, RESERVE8_SIZE);
-   out.write(m_reserved9, RESERVE9_SIZE);
-   out.write(m_bwc, BWC_SIZE);
-}
-
-std::ostream& ossimNitfCsproaTag::print(std::ostream& out,
-                            const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagLength();
-   pfx += ".";
-   out << setiosflags(ios::left)
-       << pfx << std::setw(24) << "CETAG:"      << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"        << getTagLength() << "\n"
-       << pfx << std::setw(24) << "RESERVED1:"   << m_reserved1 << "\n"
-       << pfx << std::setw(24) << "RESERVED2:"   << m_reserved2 << "\n"
-       << pfx << std::setw(24) << "RESERVED3:"   << m_reserved3 << "\n"
-       << pfx << std::setw(24) << "RESERVED4:"   << m_reserved4 << "\n"
-       << pfx << std::setw(24) << "RESERVED5:"   << m_reserved5 << "\n"
-       << pfx << std::setw(24) << "RESERVED6:"   << m_reserved6 << "\n"
-       << pfx << std::setw(24) << "RESERVED7:"   << m_reserved7 << "\n"
-       << pfx << std::setw(24) << "RESERVED8:"   << m_reserved8 << "\n"
-       << pfx << std::setw(24) << "RESERVED9:"   << m_reserved9 << "\n"
-       << pfx << std::setw(24) << "BWC:"   << m_bwc << "\n";
-
-    return out;   
-}
-
-void ossimNitfCsproaTag::clearFields()
-{
-   memset(m_reserved1, ' ', RESERVE1_SIZE);
-   memset(m_reserved2, ' ', RESERVE2_SIZE);
-   memset(m_reserved3, ' ', RESERVE3_SIZE);
-   memset(m_reserved4, ' ', RESERVE4_SIZE);
-   memset(m_reserved5, ' ', RESERVE5_SIZE);
-   memset(m_reserved6, ' ', RESERVE6_SIZE);
-   memset(m_reserved7, ' ', RESERVE7_SIZE);
-   memset(m_reserved8, ' ', RESERVE8_SIZE);
-   memset(m_reserved9, ' ', RESERVE9_SIZE);
-   memset(m_bwc, ' ', BWC_SIZE);
-
-   char reserve1[]="LATESTCAL";
-   memcpy(m_reserved1, reserve1, 9);
-   char reserve4[] = "MARKANDFIX";
-   memcpy(m_reserved4, reserve4, 10);
-   char reserve7[] = "SKIPAGM";
-   memcpy(m_reserved7, reserve7, 7);
-   char reserve8[] = "INTERP";
-   memcpy(m_reserved8, reserve8, 6);
-
-   m_reserved1[RESERVE1_SIZE] = '\0';
-   m_reserved2[RESERVE2_SIZE] = '\0';
-   m_reserved3[RESERVE3_SIZE] = '\0';
-   m_reserved4[RESERVE4_SIZE] = '\0';
-   m_reserved5[RESERVE5_SIZE] = '\0';
-   m_reserved6[RESERVE6_SIZE] = '\0';
-   m_reserved7[RESERVE7_SIZE] = '\0';
-   m_reserved8[RESERVE8_SIZE] = '\0';
-   m_reserved9[RESERVE9_SIZE] = '\0';
-   m_bwc[BWC_SIZE] = '\0';
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp b/ossim/src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp
deleted file mode 100644
index 1075179..0000000
--- a/ossim/src/ossim/support_data/ossimNitfEmbeddedRpfDes.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfEmbeddedRpfDes.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <istream>
-#include <ostream>
-#include <ossim/support_data/ossimNitfEmbeddedRpfDes.h>
-
-
-RTTI_DEF1(ossimNitfEmbeddedRpfDes, "ossimNitfEmbeddedRpfDes", ossimNitfRegisteredTag)
-
-
-ossimNitfEmbeddedRpfDes::ossimNitfEmbeddedRpfDes()
-   : ossimNitfRegisteredTag(std::string("RPFDES"), 0)
-{
-}
-
-ossimNitfEmbeddedRpfDes::~ossimNitfEmbeddedRpfDes()
-{
-}
-
-void ossimNitfEmbeddedRpfDes::parseStream(std::istream& /* in */ )
-{
-}
-
-std::ostream& ossimNitfEmbeddedRpfDes::print(std::ostream& out, const std::string& /* prefix */)const
-{
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfEngrdaTag.cpp b/ossim/src/ossim/support_data/ossimNitfEngrdaTag.cpp
deleted file mode 100644
index 78be623..0000000
--- a/ossim/src/ossim/support_data/ossimNitfEngrdaTag.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ENGRDA - Engineering Data tag class declaration.
-//
-// See document STDI-0002 (version 3), Appendix N for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-
-#include <ossim/support_data/ossimNitfEngrdaTag.h>
-#include <ossim/base/ossimNotify.h>
-
-
-RTTI_DEF1(ossimNitfEngrdaTag, "ossimNitfEngrdaTag", ossimNitfRegisteredTag);
-
-ossimNitfEngrdaTag::ossimNitfEngrdaTag()
-   : ossimNitfRegisteredTag(std::string("ENGRDA"), 0)
-{
-   clearFields();
-}
-
-ossimNitfEngrdaTag::~ossimNitfEngrdaTag()
-{
-}
-
-void ossimNitfEngrdaTag::parseStream(std::istream& in)
-{
-   clearFields();
-
-   // m_tagLength = RETAG_SIZE + REL_SIZE;
-   
-   in.read(theReSrc, RESRC_SIZE);
-   m_tagLength += RESRC_SIZE;
-   
-   in.read(theReCnt, RECNT_SIZE);
-   m_tagLength += RECNT_SIZE;
-
-   const ossim_uint16 ELEMENT_COUNT = ossimString(theReCnt).toUInt16();
-   
-   for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
-   {
-      ossimString os;
-      char buf[TMP_BUF_SIZE];
-      ossimEngDataElement element;
-
-      // ENGLN - label length field
-      in.read(buf, ENGLN_SIZE);
-      m_tagLength += ENGLN_SIZE;
-      buf[ENGLN_SIZE] = '\n';
-      os = buf;
-
-      // ENGLBL - label field
-      ossim_uint32 size = os.toUInt16();
-      in.read(buf, size);
-      m_tagLength += size;
-      buf[size] = '\0';
-      element.theEngLbl = buf;
-
-      // ENGMTXC - data column count
-      in.read(buf, ENGMTXC_SIZE);
-      m_tagLength += ENGMTXC_SIZE;
-      buf[ENGMTXC_SIZE] = '\0';
-      os = buf;
-      element.theEngMtxC = os.toUInt16();
-
-      // ENGMTXR - data row count
-      in.read(buf, ENGMTXR_SIZE);
-      m_tagLength += ENGMTXR_SIZE;
-      buf[ENGMTXR_SIZE] = '\0';
-      os = buf;
-      element.theEngMtxR = os.toUInt16();
-
-      // ENGTYP - Value Type of Engineering Data Element.
-      in.get( element.theEngTyp );
-      m_tagLength += ENGTYP_SIZE;
-
-      // ENGDTS - Engineering Data Element Size
-      element.theEngDts = static_cast<ossim_uint8>(in.get());
-      m_tagLength += ENGDTS_SIZE;
-
-      // ENGDATU - Engineering Data Units.
-      in.read(buf, ENGDATU_SIZE);
-      m_tagLength += ENGDATU_SIZE;
-      buf[ENGDATU_SIZE] = '\0';
-      element.theEngDatU = buf;
-
-      // ENGDATC - Engineering Data Count
-      in.read(buf, ENGDATC_SIZE);
-      m_tagLength += ENGDATC_SIZE;
-      buf[ENGDATC_SIZE] = '\n';
-      os = buf;
-      ossim_uint32 engDatC = os.toUInt32();
-
-      // ENGDATA - Engineering Data
-      element.theEngDat.resize(engDatC);
-      in.read((char*)&(element.theEngDat.front()), (std::streamsize)element.theEngDat.size());
-      m_tagLength += engDatC;
-      
-      theData.push_back(element);
-
-   } // Matches: for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
-}
-
-void ossimNitfEngrdaTag::writeStream(std::ostream& out)
-{
-   //out.write(theAcMsnId, AC_MSN_ID_SIZE);
-   // out.write(theAcTailNo, AC_TAIL_NO_SIZE);
-
-   out.write(theReSrc, RESRC_SIZE);
-   out.write(theReCnt, RECNT_SIZE);
-
-   const ossim_uint16 ELEMENT_COUNT = ossimString(theReCnt).toUInt16();
-   
-   for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
-   {
-      // ENGLN - label length field      
-      std::string s;
-      getValueAsString(theData[i].theEngLbl.size(), ENGLN_SIZE, s);
-      out.write(s.data(), ENGLN_SIZE);
-
-      // ENGLBL - label field
-      out.write(theData[i].theEngLbl.data(), (std::streamsize)theData[i].theEngLbl.size());
-
-      // ENGMTXC - data column count
-      getValueAsString(theData[i].theEngMtxC, ENGMTXC_SIZE, s); 
-      out.write(s.data(), ENGMTXC_SIZE);
-
-      // ENGMTXR - data row count
-      getValueAsString(theData[i].theEngMtxR, ENGMTXR_SIZE, s);
-      out.write(s.data(), ENGMTXR_SIZE);
-
-      // ENGTYP - Value Type of Engineering Data Element.
-      out.write(&theData[i].theEngTyp, ENGTYP_SIZE);
-
-      // ENGDTS - Engineering Data Element Size
-      out.write((char*)(&theData[i].theEngDts), ENGDTS_SIZE);
-
-      // ENGDATU - Engineering Data Units.
-      out.write(theData[i].theEngDatU.data(), ENGDATU_SIZE);
-
-      // ENGDATC - Engineering Data Count
-      getValueAsString(theData[i].theEngDat.size(), ENGDATC_SIZE, s); 
-      out.write(s.data(), ENGDATC_SIZE);
-
-      // ENGDATA - Engineering Data NOTE: should be big endian...
-      out.write((char*)&(theData[i].theEngDat.front()),
-                (std::streamsize)theData[i].theEngDat.size());
-
-   } // Matches: for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
-   
-}
-
-void ossimNitfEngrdaTag::clearFields()
-{
-   // BCS-N's to '0's, BCS-A's to ' '(spaces)
-
-   // clear
-   memset(theReSrc, ' ', RESRC_SIZE);
-   memset(theReCnt, ' ', RECNT_SIZE);
-   theData.clear();
-
-   // null terminate
-   theReSrc[RESRC_SIZE] = '\0';
-   theReCnt[RECNT_SIZE] = '\0';
-
-   m_tagLength = 0;
-}
-
-std::ostream& ossimNitfEngrdaTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getSizeInBytes() << "\n"
-       << pfx << std::setw(24) << "RESRC:" << theReSrc << "\n"
-       << pfx << std::setw(24) << "RECNT:" << theReCnt << "\n";
-
-   for (ossim_uint32 i = 0; i < theData.size(); ++i)
-   {
-      out << pfx << "ENGLBL[" << i << std::setw(24) << "]:"
-          << theData[i].theEngLbl << "\n"
-          << pfx << "ENGMTXC[" << i << std::setw(24) << "]:"
-          << theData[i].theEngMtxC << "\n"
-          << pfx << "ENGMTXR[" << i << std::setw(24) << "]:"
-          << theData[i].theEngMtxR << "\n"
-          << pfx << "ENGTYP[" << i << std::setw(24) << "]:"
-          << theData[i].theEngTyp << "\n"
-          << pfx << "ENGDTS[" << i << std::setw(24) << "]:"
-          << theData[i].theEngDts << "\n"
-          << pfx << "ENGDATU[" << i << std::setw(24) << "]:"
-          << theData[i].theEngDatU << "\n"
-          << pfx << "ENGDATC[" << i << std::setw(24) << "]:"
-          << theData[i].theEngDat.size() << "\n";
-      
-      printData(out, theData[i], i, pfx);
-
-      
-   }
-   
-   return out;
-}
-
-std::ostream& ossimNitfEngrdaTag::printData(std::ostream& out,
-                                            const ossimEngDataElement& element,
-                                            ossim_uint32 /* elIndex */,
-                                            const std::string& /* prefix */) const
-{
-   if (element.theEngTyp == 'A')
-   {
-      std::vector<ossim_uint8>::const_iterator i = element.theEngDat.begin();
-      while (i != element.theEngDat.end())
-      {
-         out << static_cast<ossim_int8>(*i);
-         ++i;
-      }
-      out << "\n";
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfEngrdaTag::printData WARNING unhandled data type."
-         << "Data type = " << (char)element.theEngTyp << "\n"
-         << std::endl;
-   } 
-   return out;
-}
-
-template <class T>
-void ossimNitfEngrdaTag::getValueAsString(
-   T v, ossim_uint16 w, std::string& s) const
-{
-   std::ostringstream os;
-   os << std::setw(w) << std::setfill('0') << setiosflags(ios::right) << v;
-   s = os.str();
-}
-   
-
diff --git a/ossim/src/ossim/support_data/ossimNitfFile.cpp b/ossim/src/ossim/support_data/ossimNitfFile.cpp
deleted file mode 100644
index f5445cb..0000000
--- a/ossim/src/ossim/support_data/ossimNitfFile.cpp
+++ /dev/null
@@ -1,416 +0,0 @@
-//*******************************************************************
-//
-//  License:  MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFile.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfTagFactoryRegistry.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/support_data/ossimRpfToc.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimIoStream.h>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimNitfFile:debug");
-
-std::ostream& operator <<(std::ostream& out, const ossimNitfFile& data)
-{
-   return data.print(out);
-}
-
-std::ostream& ossimNitfFile::print(std::ostream& out,
-                                   const std::string& prefix,
-                                   bool printOverviews) const
-{
-   if(theNitfFileHeader.valid())
-   {
-      std::string pfx = prefix;
-      pfx += "nitf.";
-      theNitfFileHeader->print(out, pfx);
-      
-      ossim_int32 n = theNitfFileHeader->getNumberOfImages();
-      for(ossim_int32 idx = 0; idx < n; ++idx)
-      {
-         ossimNitfImageHeader* ih = getNewImageHeader(idx);
-         if(ih)
-         {
-            bool printIt = true;
-            
-            if ( !printOverviews )
-            {
-               // Check the IMAG field.
-               ossim_float64 imag;
-               ih->getDecimationFactor(imag);
-               if ( !ossim::isnan(imag) )
-               {
-                  if ( imag < 1.0)
-                  {
-                     printIt = false;
-                  }
-               }
-
-               //---
-               // Now see if it's a cloud mask image.  Do not print
-               // cloud mask images if the printOverviews is false.
-               //---
-               if ( printIt )
-               {
-                  if ( (ih->getCategory().trim(ossimString(" ")) ==
-                        "CLOUD") &&
-                       (ih->getRepresentation().trim(ossimString(" ")) ==
-                        "NODISPLY") )
-                  {
-                     printIt = false;
-                  }
-               }
-            }
-
-            if (printIt)
-            {
-               // Add our prefix onto prefix.
-               std::string s = pfx;
-               s += "image";
-               s += ossimString::toString(idx).string();
-               s += ".";
-               
-               ih->print(out, s);
-            }
-            
-            delete ih;
-            ih = 0;
-         }
-      }
-
-      //---
-      // Check for RPF stuff:
-      //---
-      ossimNitfTagInformation info; 
-      theNitfFileHeader->getTag(info, "RPFHDR");
-      if(info.getTagName() == "RPFHDR")
-      {
-         // Open of the a.toc.
-         ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc;
-         if ( toc->parseFile(getFilename()) ==
-              ossimErrorCodes::OSSIM_OK )
-         {
-            pfx += "rpf.";
-            toc->print(out, pfx, printOverviews);
-         }
-      }
-      
-   } // matches:  if(theNitfFileHeader.valid())
-
-   return out;
-   
-}
-
-bool ossimNitfFile::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   bool result = theNitfFileHeader.valid(); 
-   
-   if(theNitfFileHeader.valid())
-   {
-      theNitfFileHeader->saveState(kwl, prefix);
-   }
-   ossim_int32 n = theNitfFileHeader->getNumberOfImages();
-   for(ossim_int32 idx = 0; idx < n; ++idx)
-   {
-      ossimRefPtr<ossimNitfImageHeader> ih = getNewImageHeader(idx);
-      ossimString newPrefix = prefix + "image" + ossimString::toString(idx) + ".";
-#if 1     
-      ih->saveState(kwl, newPrefix);
-#else
-      if ( (ih->getCategory().trim(ossimString(" ")) !=
-            "CLOUD") ||
-          (ih->getRepresentation().trim(ossimString(" ")) !=
-           "NODISPLY") )
-      {
-         ih->saveState(kwl, newPrefix);
-      }
-#endif
-   }
-   return result;
-}
-
-ossimNitfFile::ossimNitfFile()
-   : theFilename(""),
-     theNitfFileHeader(0)
-{
-}
-
-ossimNitfFile::~ossimNitfFile()
-{
-   theNitfFileHeader = 0;
-}
-
-bool ossimNitfFile::parseFile(const ossimFilename& file)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfFile::parseFile: "
-         << "endtered......"
-         << std::endl;
-   }
-   if(!file.exists()) return false;
-   // this currently crashes if the open fails so I am going back to
-   // using ifstream instead of this one
-   //
-
-   //ossimIFStream64 in(file.c_str(), std::ios::in|std::ios::binary);
-
-   std::ifstream in(file.c_str(), std::ios::in|std::ios::binary);
-   if (in.fail())
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimNitfFile::parseFile: "
-            << "Could not open file:  " << file.c_str()
-            << "\nReturning..." << std::endl;
-      }
-      return false;
-   }
-      
-   if(theNitfFileHeader.valid())
-   {
-      theNitfFileHeader = 0;
-   }
-
-   char temp[10];
-   in.read(temp, 9);
-   //in.seekg64(0, std::ios::beg);
-   in.seekg(0, std::ios::beg);
-   temp[9] ='\0';
-   
-   theFilename = file;
-
-   ossimString s(temp);
-   if(s == "NITF02.00")
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: NITF Version 2.0"
-            << std::endl;
-      }
-      theNitfFileHeader = new ossimNitfFileHeaderV2_0;
-   }
-   else if ( (s == "NITF02.10") || (s == "NSIF01.00") )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: NITF Version 2.1"
-            << std::endl;
-      }
-      theNitfFileHeader = new ossimNitfFileHeaderV2_1;
-   }
-   else
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimNitfFile::parseFile: "
-            << "Not an NITF file!"
-            << std::endl;
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimNitfFile::parseFile: returning...........false"
-            << "endtered......"
-            << std::endl;
-      }
-      return false;
-   }
-
-   if(theNitfFileHeader.valid())
-   {
-      try
-      {
-         theNitfFileHeader->parseStream(in);
-
-         // Sanity check the size before going on:
-
-#if 0                                                                   \
-   /*
-    * Temp removed for release as workaround for VS10 >2gb offset issue.
-    * drb 20130418
-    */
-         if ( file.fileSize() < theNitfFileHeader->getFileSize() )
-         {
-            if (traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimNitfFile::parseFile ERROR:\n"
-                  << "File size is less than file length in header!"
-                  << "\nNITF FL field: " << theNitfFileHeader->getFileSize()
-                  << "\nActual file length: " << file.fileSize()
-                  << std::endl;
-            }
-            return false;
-         }
-#endif
-         
-      }
-      catch( const ossimException& e )
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimNitfFile::parseFile caught exception:\n"
-               << e.what()
-               << std::endl;
-         }
-         return false;
-      }
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimNitfFile::parseFile: returning...........true"
-         << std::endl;
-   }
-   return true;
-}
-
-const ossimNitfFileHeader* ossimNitfFile::getHeader() const
-{
-   return theNitfFileHeader.get();
-}
-
-ossimNitfFileHeader* ossimNitfFile::getHeader() 
-{
-   return theNitfFileHeader.get();
-}
-
-ossimIrect ossimNitfFile::getImageRect()const
-{
-   if(theNitfFileHeader.valid())
-   {
-      return theNitfFileHeader->getImageRect();
-   }
-
-   return ossimIrect(ossimIpt(0,0), ossimIpt(0,0));
-}
-
-ossimNitfImageHeader* ossimNitfFile::getNewImageHeader(
-   ossim_uint32 imageNumber)const
-{
-   ossimNitfImageHeader* result = 0;
-   if(theNitfFileHeader.valid())
-   {
-      try // getNewImageHeader can throw exception on parse.
-      {
-         std::ifstream in(theFilename.c_str(), std::ios::in|std::ios::binary);
-         result = theNitfFileHeader->getNewImageHeader(imageNumber, in);
-         in.close();
-      }
-      catch( const ossimException& e )
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimNitfFile::getNewImageHeader caught exception:\n"
-               << e.what()
-               << std::endl;
-         }
-         result = 0;
-      }
-   }
-   return result;
-}
-
-ossimNitfSymbolHeader* ossimNitfFile::getNewSymbolHeader(
-   ossim_uint32 symbolNumber)const
-{
-   ossimNitfSymbolHeader* result = 0;
-   if(theNitfFileHeader.valid())
-   {
-      std::ifstream in(theFilename.c_str(), std::ios::in|std::ios::binary);
-
-      result = theNitfFileHeader->getNewSymbolHeader(symbolNumber, in);
-      in.close();
-   }
-   
-   return result;
-}
-
-ossimNitfLabelHeader* ossimNitfFile::getNewLabelHeader(
-   ossim_uint32 labelNumber)const
-{
-   ossimNitfLabelHeader* result = 0;
-   if(theNitfFileHeader.valid())
-   {
-      std::ifstream in(theFilename.c_str(), std::ios::in|std::ios::binary);
-
-      result = theNitfFileHeader->getNewLabelHeader(labelNumber, in);
-      in.close();
-   }
-   
-   return result;
-}
-
-ossimNitfTextHeader* ossimNitfFile::getNewTextHeader(
-   ossim_uint32 textNumber)const
-{
-   ossimNitfTextHeader* result = 0;
-   if(theNitfFileHeader.valid())
-   {
-      std::ifstream in(theFilename.c_str(), std::ios::in|std::ios::binary);
-
-      result = theNitfFileHeader->getNewTextHeader(textNumber, in);
-      in.close();
-   }
-   
-   return result;
-}
-
-ossimNitfDataExtensionSegment* ossimNitfFile::getNewDataExtensionSegment(
-   ossim_uint32 dataExtNumber)const
-{
-   ossimNitfDataExtensionSegment* result = 0;
-   if(theNitfFileHeader.valid())
-   {
-      std::ifstream in(theFilename.c_str(), std::ios::in|std::ios::binary);
-
-      result = theNitfFileHeader->getNewDataExtensionSegment(dataExtNumber, in);
-      in.close();
-   }
-   
-   return result;
-}
-
-ossimString ossimNitfFile::getVersion()const
-{
-   if(theNitfFileHeader.valid())
-   {
-      return ossimString(theNitfFileHeader->getVersion());
-   }
-   
-   return ossimString("");
-}
-
-ossimFilename ossimNitfFile::getFilename() const
-{
-   return theFilename;
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfFileHeader.cpp b/ossim/src/ossim/support_data/ossimNitfFileHeader.cpp
deleted file mode 100644
index 4fcbf1c..0000000
--- a/ossim/src/ossim/support_data/ossimNitfFileHeader.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFileHeader.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <iostream>
-#include <sstream>
-
-static const char* TAGS_KW = "tags";
-
-RTTI_DEF2(ossimNitfFileHeader, "ossimNitfFileHeader", ossimObject, ossimPropertyInterface);
-
-std::ostream& ossimNitfImageOffsetInformation::print(std::ostream& out) const
-{
-   return out << "theImageHeaderOffset:          "
-              << theImageHeaderOffset << std::endl
-              << "theImageDataOffset:            "
-              << theImageDataOffset;
-}
-
-ossimNitfFileHeader::ossimNitfFileHeader()
-{
-}
-
-ossimNitfFileHeader::~ossimNitfFileHeader()
-{
-}
-
-
-bool ossimNitfFileHeader::getTag(ossimNitfTagInformation& tagInfo,
-                                 const ossimString& tagName)const
-{
-   if(theTagList.size())
-   {
-      for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
-      {
-         if(theTagList[i].getTagName() == tagName)
-         {
-            tagInfo = theTagList[i];
-            return true;
-         }
-      }
-   }
-
-   return false;
-}
-
-bool  ossimNitfFileHeader::hasImages()const
-{
-   return (getNumberOfImages() > 0);
-}
-
-bool  ossimNitfFileHeader::hasSymbols()const
-{
-   return (getNumberOfSymbols() > 0);
-}
-
-bool  ossimNitfFileHeader::hasGraphics()const
-{
-   return (getNumberOfGraphics() > 0);
-}
-
-bool  ossimNitfFileHeader::hasText()const
-{
-   return (getNumberOfTextSegments() > 0);
-}
-
-bool  ossimNitfFileHeader::hasLabels()const
-{
-   return (getNumberOfLabels() > 0);
-}
-bool ossimNitfFileHeader::hasDataExtSegments()const
-{
-   return (getNumberOfDataExtSegments() > 0);
-}
-
-void ossimNitfFileHeader::removeTag(const ossimString& tagName)
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theTagList.size(); ++idx)
-   {
-      if(theTagList[idx].getTagName() == tagName)
-      {
-         theTagList.erase(theTagList.begin() + idx);
-         return;
-      }
-   }
-}
-void ossimNitfFileHeader::addTag(const ossimNitfTagInformation& tag, bool unique)
-{
-   if(unique)
-   {
-      removeTag(tag.getTagName());
-   }
-   theTagList.push_back(tag);
-}
-
-bool ossimNitfFileHeader::getTagInformation(ossimNitfTagInformation& tag,
-                                            int idx) const
-{
-   bool result = false;
-   
-   if(static_cast<ossim_uint32>(idx) < theTagList.size())
-   {
-      tag = theTagList[idx];
-      result = true;
-   }
-   
-   return result;
-}
-
-int ossimNitfFileHeader::getNumberOfTags()const
-{
-   return (int)theTagList.size();
-}
-
-ossim_uint32 ossimNitfFileHeader::getTotalTagLength()const
-{
-   ossim_uint32 tagLength = 0;
-   
-   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
-   {
-      tagLength += theTagList[i].getTotalTagLength();
-   }
-   
-   return tagLength;
-}
-
-
-void ossimNitfFileHeader::setProperty(ossimRefPtr<ossimProperty> /* property */)
-{
-}
-
-ossimRefPtr<ossimProperty> ossimNitfFileHeader::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> result = 0;
-
-   if(name == TAGS_KW)
-   {
-      ossim_uint32 idxMax = (ossim_uint32)theTagList.size();
-      if(idxMax > 0)
-      {
-         ossimContainerProperty* containerProperty = new ossimContainerProperty;
-         containerProperty->setName(name);
-         ossim_uint32 idx = 0;
-
-         result = containerProperty;
-         for(idx = 0; idx < idxMax; ++idx)
-         {
-            ossimNitfTagInformation tagInfo;
-            getTagInformation(tagInfo, idx);
-            
-            const ossimRefPtr<ossimNitfRegisteredTag> tagData = tagInfo.getTagData();
-            if(tagData.valid())
-            {
-               ossimContainerProperty* containerPropertyTag = new ossimContainerProperty;
-               containerPropertyTag->setName(tagInfo.getTagName());
-               std::vector<ossimRefPtr<ossimProperty> > propertyList;
-               tagData->getPropertyList(propertyList);
-               
-               containerPropertyTag->addChildren(propertyList);
-               containerProperty->addChild(containerPropertyTag);
-            }
-            else
-            {
-               containerProperty->addStringProperty(tagInfo.getTagName(), "", true);
-            }
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimNitfFileHeader::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(TAGS_KW);
-}
-
-bool ossimNitfFileHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   ossimObject::saveState(kwl, prefix);
-   
-   bool result = true;
-   ossimString tagsPrefix = prefix;
-   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
-   {
-      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
-      if (tag.valid())
-      {
-         // we eventually need to do our own prefix for this object and not let the calling object do any prefix definitions
-//         ossimString newPrefix = tagsPrefix + tag->getRegisterTagName() + ".";
-
-         tag->saveState(kwl, tagsPrefix);
-      }
-   }
-   
-   return result;
-}
-
-std::ostream& ossimNitfFileHeader::print(std::ostream& out,
-                                         const std::string& prefix ) const
-{
-   return printTags(out, prefix);
-}
-
-std::ostream& ossimNitfFileHeader::printTags(std::ostream& out,
-                                             const std::string& prefix) const
-{
-   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
-   {
-      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
-      if (tag.valid())
-      {
-         tag->print(out, prefix);
-      }
-   }
-
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_0.cpp b/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_0.cpp
deleted file mode 100644
index 81d10f4..0000000
--- a/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_0.cpp
+++ /dev/null
@@ -1,1704 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFileHeaderV2_0.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <sstream>
-#include <cstring> // for memset
-#include <iostream>
-#include <iomanip>
-#include <stdexcept>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfSymbolHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfLabelHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfTextHeaderV2_0.h>
-#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_0.h>
-
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimStringProperty.h>
-
-
-const ossimString ossimNitfFileHeaderV2_0::FSDWNG_KW = "fsdwng";
-const ossimString ossimNitfFileHeaderV2_0::FSDEVT_KW = "fsdevt";
-
-static const ossimTrace traceDebug("ossimNitfFileHeaderV2_0:debug");
-
-RTTI_DEF1(ossimNitfFileHeaderV2_0, "ossimNitfFileHeaderV2_0", ossimNitfFileHeaderV2_X)
-
-std::ostream& operator <<(std::ostream& out,
-                          const ossimNitfImageInfoRecordV2_0 &data)
-{
-   return out << "theImageSubheaderLength:       "
-              << data.theImageSubheaderLength << std::endl
-              << "theImageLength:                "
-              << data.theImageLength;
-}
-
-ossim_uint32 ossimNitfImageInfoRecordV2_0::getHeaderLength()const
-{
-   return ossimString(theImageSubheaderLength).toInt32();
-}
-
-ossim_uint64  ossimNitfImageInfoRecordV2_0::getImageLength()const
-{
-   return ossimString(theImageLength).toInt32();
-}
-
-ossim_uint64 ossimNitfImageInfoRecordV2_0::getTotalLength()const
-{
-   return (getHeaderLength() + getImageLength());
-}
-
-void ossimNitfImageInfoRecordV2_0::setSubheaderLength(ossim_uint32 length)
-{
-   ostringstream out;
-   
-   out << std::setw(6)
-   << std::setfill('0')
-   << std::setiosflags(ios::right)
-   << length;
-   
-   memcpy(theImageSubheaderLength, out.str().c_str(), 6);
-   theImageSubheaderLength[6] = '\0';
-}
-
-void ossimNitfImageInfoRecordV2_0::setImageLength(ossim_uint64 length)
-{
-   ostringstream out;
-   
-   out << std::setw(10)
-   << std::setfill('0')
-   << std::setiosflags(ios::right)
-   << length;
-   
-   memcpy(theImageLength, out.str().c_str(), 10);
-   theImageLength[10] = '\0';
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfSymbolInfoRecordV2_0 &data)
-{
-   return out << "theSymbolSubheaderLength:       "
-              << data.theSymbolSubheaderLength << std::endl
-              << "theSymbolLength:                "
-              << data.theSymbolLength;
-}
-ossim_int32 ossimNitfSymbolInfoRecordV2_0::getHeaderLength()const
-{
-   return ossimString(theSymbolSubheaderLength).toInt32();
-}
-
-ossim_int32 ossimNitfSymbolInfoRecordV2_0::getImageLength()const
-{
-   return ossimString(theSymbolLength).toInt32();
-}
-
-ossim_int32 ossimNitfSymbolInfoRecordV2_0::getTotalLength()const
-{
-   return (getHeaderLength() + getImageLength());
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfLabelInfoRecordV2_0 &data)
-{
-   return out << "theLabelSubheaderLength:       "
-              << data.theLabelSubheaderLength << std::endl
-              << "theLabelLength:                "
-              << data.theLabelLength;
-}
-
-ossim_int32 ossimNitfLabelInfoRecordV2_0::getHeaderLength()const
-{
-   return ossimString(theLabelSubheaderLength).toInt32();
-}
-
-ossim_int32 ossimNitfLabelInfoRecordV2_0::getImageLength()const
-{
-   return ossimString(theLabelLength).toInt32();
-}
-
-ossim_int32 ossimNitfLabelInfoRecordV2_0::getTotalLength()const
-{
-   return (getHeaderLength() + getImageLength());
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfTextInfoRecordV2_0 &data)
-{
-   return out << "theTextSubheaderLength:       "
-              << data.theTextSubheaderLength << std::endl
-              << "theTextLength:                "
-              << data.theTextLength;
-}
-
-ossim_int32 ossimNitfTextInfoRecordV2_0::getHeaderLength()const
-{
-   return ossimString(theTextSubheaderLength).toInt32();
-}
-
-ossim_int32 ossimNitfTextInfoRecordV2_0::getImageLength()const
-{
-   return ossimString(theTextLength).toInt32();
-}
-
-ossim_int32 ossimNitfTextInfoRecordV2_0::getTotalLength()const
-{
-   return (getHeaderLength() + getImageLength());
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfDataExtSegInfoRecordV2_0 &data)
-{
-   return out << "theDataExtSegSubheaderLength:       "
-              << data.theDataExtSegSubheaderLength << std::endl
-              << "theDataExtSegLength:                "
-              << data.theDataExtSegLength;
-}
-
-ossim_int32 ossimNitfDataExtSegInfoRecordV2_0::getHeaderLength()const
-{
-   return ossimString(theDataExtSegSubheaderLength).toInt32();
-}
-
-ossim_int32 ossimNitfDataExtSegInfoRecordV2_0::getImageLength()const
-{
-   return ossimString(theDataExtSegLength).toInt32();
-}
-
-ossim_int32 ossimNitfDataExtSegInfoRecordV2_0::getTotalLength()const
-{
-   return (getHeaderLength() + getImageLength());
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfResExtSegInfoRecordV2_0 &data)
-{
-   return out << "theResExtSegSubheaderLength:       "
-              << data.theResExtSegSubheaderLength << std::endl
-              << "theResExtSegLength:                "
-              << data.theResExtSegLength;
-}
-
-ossimNitfFileHeaderV2_0::ossimNitfFileHeaderV2_0()
-   :ossimNitfFileHeaderV2_X()
-{
-   clearFields();
-}
-
-ossimNitfFileHeaderV2_0::~ossimNitfFileHeaderV2_0()
-{
-}
-
-void ossimNitfFileHeaderV2_0::parseStream(std::istream &in)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfFileHeaderV2_0::parseStream:   entered ......."
-         << std::endl;
-   }
-   
-   clearFields();
-   
-   // identification and origination group
-   in.read(theFileTypeVersion, 9);
-   theHeaderSize+=9;
-   in.read(theComplexityLevel, 2);
-   theHeaderSize+=2;
-   in.read(theSystemType, 4);
-   theHeaderSize+=4;
-   in.read(theOriginatingStationId, 10);
-   theHeaderSize+=10;
-   in.read(theDateTime, 14);
-   theHeaderSize+=14;
-   in.read(theFileTitle, 80);
-   theHeaderSize+=80;
-   
-   // read security group
-   in.read(theSecurityClassification, 1);
-   theHeaderSize++;
-   in.read(theCodewords, 40);
-   theHeaderSize+=40;
-   in.read(theControlAndHandling, 40);
-   theHeaderSize+=40;
-   in.read(theReleasingInstructions, 40);
-   theHeaderSize+=40;
-   in.read(theClassificationAuthority, 20);
-   theHeaderSize+=20;
-   in.read(theSecurityControlNumber, 20);
-   theHeaderSize+=20;
-   in.read(theSecurityDowngrade, 6);
-   theHeaderSize+=6;
-   if(ossimString(theSecurityDowngrade) == "999998")
-   {
-      in.read(theDowngradingEvent, 40);
-      theHeaderSize+=40;
-   }      
-   in.read(theCopyNumber, 5);
-   theHeaderSize+=5;
-   in.read(theNumberOfCopies, 5);
-   theHeaderSize+=5;
-   in.read(theEncryption, 1);
-   theHeaderSize++;
-   in.read(theOriginatorsName, 27);
-   theHeaderSize+=27;
-   in.read(theOriginatorsPhone, 18);
-   theHeaderSize+=18;
-   
-   in.read(theFileLength, 12);
-   theHeaderSize+=12;
-   in.read(theHeaderLength, 6);
-   theHeaderSize+=6;
-   
-   // image description group
-   in.read(theNumberOfImageInfoRecords, 3);
-   theHeaderSize+=3;
-   readImageInfoRecords(in);
-
-   // symbol description group
-   in.read(theNumberOfSymbolInfoRecords, 3);
-   theHeaderSize+=3;
-   readSymbolInfoRecords(in);
-   
-   // label description group
-   in.read(theNumberOfLabelInfoRecords, 3);
-   theHeaderSize+=3;
-   readLabelInfoRecords(in);
-   
-   // text file information group
-   in.read(theNumberOfTextFileInfoRecords, 3);
-   theHeaderSize+=3;
-   readTextFileInfoRecords(in);
-   
-   // Data extension group
-   in.read(theNumberOfDataExtSegInfoRecords, 3);
-   theHeaderSize+=3;
-   readDataExtSegInfoRecords(in);
-   
-   // Reserve Extension Segment group
-   in.read(theNumberOfResExtSegInfoRecords, 3);
-   theHeaderSize+=3;
-   readResExtSegInfoRecords(in);
-   
-   in.read(theUserDefinedHeaderDataLength, 5);
-   theHeaderSize+=5;
-   
-   theTagList.clear();
-   // only get the header overflow if there even exists
-   // user defined data.
-   ossim_int32 userDefinedHeaderLength = ossimString(theUserDefinedHeaderDataLength).toInt32();
-   
-   ossimNitfTagInformation         headerTag;
-   
-   std::streampos start   = in.tellg();
-   std::streampos current = in.tellg();
-
-   theHeaderSize+=userDefinedHeaderLength;
-   if(userDefinedHeaderLength > 0)
-   {
-      in.read(theUserDefinedHeaderOverflow, 3);
-      
-      current = in.tellg();
-      while((current - start) < userDefinedHeaderLength)
-      {
-         headerTag.parseStream(in);
-         headerTag.setTagType("UDHD");
-         theTagList.push_back(headerTag);
-         // in.ignore(headerTag.getTagLength());
-         // headerTag.clearFields();
-
-         //---
-         // We will check the stream here as there have been instances of
-         // rpf's with bad stream offsets.
-         //---
-         if (!in)
-         {
-            std::string e =
-               "ossimNitfFileHeaderV2_0::parseStream stream error!";
-            throw ossimException(e);
-         }
-
-         current = in.tellg();
-      }
-   }
-   in.read(theExtendedHeaderDataLength, 5);
-   theHeaderSize+=5;
-   ossim_int32 extendedHeaderDataLength = ossimString(theExtendedHeaderDataLength).toInt32();
-   theHeaderSize+=extendedHeaderDataLength;
-   
-   start   = in.tellg();
-   current = in.tellg();
-   // for now let's just ignore it
-   if(extendedHeaderDataLength > 0)
-   {
-      in.read(theExtendedHeaderOverflow, 3);
-      current = in.tellg();
-     
-      while((current - start) < extendedHeaderDataLength)
-      {
-         headerTag.parseStream(in);
-         headerTag.setTagType("XHD");
-         theTagList.push_back(headerTag);
-         in.ignore(headerTag.getTagLength());
-         headerTag.clearFields();
-         current = in.tellg();
-      }
-   }
-   
-   // this need to be re-thought
-   initializeAllOffsets();
-   readOverflowTags(in);
-
-   if(traceDebug())
-   {
-      ossimNitfFileHeader::print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimNitfFileHeaderV2_0::parseStream:   Leaving......."
-         << std::endl;
-   }
-//      initializeDisplayLevels(in);
-
-}
-
-void ossimNitfFileHeaderV2_0::readOverflowTags(istream& in)
-{
-   ossim_int32 overflow = ossimString(theUserDefinedHeaderOverflow).toInt32();
-   if (overflow != 0)
-   {
-      ossimRefPtr<ossimNitfDataExtensionSegment> des = getNewDataExtensionSegment(overflow-1, in);
-      if (des.valid())
-      {
-         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
-         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); 
-              iter != desTags.end(); 
-              ++iter)
-         {
-            iter->setTagType("UDHD");
-            theTagList.push_back(*iter);
-         }
-         des = 0;
-      }
-   }
-
-   overflow = ossimString(theExtendedHeaderOverflow).toInt32();
-   if (overflow != 0)
-   {
-      ossimRefPtr<ossimNitfDataExtensionSegment> des = getNewDataExtensionSegment(overflow-1, in);
-      if (des.valid())
-      {
-         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
-         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
-         {
-            iter->setTagType("XHD");
-            theTagList.push_back(*iter);
-         }
-         des = 0;
-
-      }
-   }
-}
-
-void ossimNitfFileHeaderV2_0::writeStream(std::ostream &out)
-{
-   // identification and origination group
-   out.write(theFileTypeVersion, 9);
-   out.write(theComplexityLevel, 2);
-   out.write(theSystemType, 4);
-   out.write(theOriginatingStationId, 10);
-   out.write(theDateTime, 14);
-   out.write(theFileTitle, 80);
-   
-   // read security group
-   out.write(theSecurityClassification, 1);
-   out.write(theCodewords, 40);
-   out.write(theControlAndHandling, 40);
-   out.write(theReleasingInstructions, 40);
-   out.write(theClassificationAuthority, 20);
-   out.write(theSecurityControlNumber, 20);
-   out.write(theSecurityDowngrade, 6);
-   if(ossimString(theSecurityDowngrade) == "999998")
-   {
-      out.write(theDowngradingEvent, 40);
-   }      
-   out.write(theCopyNumber, 5);
-   out.write(theNumberOfCopies, 5);
-   out.write(theEncryption, 1);
-   out.write(theOriginatorsName, 27);
-   out.write(theOriginatorsPhone, 18);
-   
-   out.write(theFileLength, 12);
-   out.write(theHeaderLength, 6);   
-   ossim_uint32 idx = 0;
-   {
-      ostringstream outString;
-      
-      
-      outString << std::setw(3)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << theNitfImageInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      
-      for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfImageInfoRecords[idx].theImageSubheaderLength, 6);
-         out.write(theNitfImageInfoRecords[idx].theImageLength, 10);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      outString << std::setw(3)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << theNitfSymbolInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      
-      for(idx = 0; idx < theNitfSymbolInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfSymbolInfoRecords[idx].theSymbolSubheaderLength, 4);
-         out.write(theNitfSymbolInfoRecords[idx].theSymbolLength, 6);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      outString << std::setw(3)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << theNitfLabelInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      
-      for(idx = 0; idx < theNitfLabelInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfLabelInfoRecords[idx].theLabelSubheaderLength, 4);
-         out.write(theNitfLabelInfoRecords[idx].theLabelLength, 3);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      outString << std::setw(3)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << theNitfTextInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      
-      for(idx = 0; idx < theNitfTextInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfTextInfoRecords[idx].theTextSubheaderLength, 4);
-         out.write(theNitfTextInfoRecords[idx].theTextLength, 5);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      outString << std::setw(3)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << theNitfDataExtSegInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      
-      for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegSubheaderLength, 4);
-         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegLength, 9);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      outString << std::setw(3)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << theNitfResExtSegInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      
-      for(idx = 0; idx < theNitfResExtSegInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegSubheaderLength, 4);
-         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegLength, 7);
-      }
-   }
-   out.write(theUserDefinedHeaderDataLength, 5);
-   if(ossimString(theUserDefinedHeaderDataLength).toInt32() > 0)
-   {
-      out.write(theUserDefinedHeaderOverflow, 3);
-   }
-   ossim_uint32 totalLength = getTotalTagLength();
-   if(totalLength <= 99999)
-   {
-      std::ostringstream tempOut;
-      
-      tempOut << std::setw(5)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << totalLength;
-      
-      memcpy(theExtendedHeaderDataLength, tempOut.str().c_str(), 5);
-      
-      out.write(theExtendedHeaderDataLength, 5);
-      
-      // for now we hard code te 000 for we do not currently support writing to the DES if the total tag length is
-      // larger than supported
-      //
-      memset(theExtendedHeaderOverflow, '0', 3);
-      if(totalLength > 0)
-      {
-         ossim_uint32 i = 0;
-         out.write(theExtendedHeaderOverflow, 3);
-         
-         for(i = 0; i < theTagList.size(); ++i)
-         {
-            theTagList[i].writeStream(out);
-         }
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_0::writeStream: Only support writing of total tag length < 99999" << std::endl;
-   }
-}
-
-std::ostream& ossimNitfFileHeaderV2_0::print(std::ostream& out,
-                                             const std::string& prefix) const
-{
-   out << setiosflags(std::ios::left)
-       << prefix << std::setw(24) << "FHDR:"
-       << theFileTypeVersion << "\n"
-       << prefix << std::setw(24) << "CLEVEL:"
-       << theComplexityLevel << "\n"
-       << prefix << std::setw(24) << "STYPE:"
-       << theSystemType  << "\n"    
-       << prefix << std::setw(24) << "OSTAID:"
-       << theOriginatingStationId << "\n"
-       << prefix << std::setw(24) << "FDT:"
-       << theDateTime  << "\n"      
-       << prefix << std::setw(24) << "FTITLE:"
-       << theFileTitle  << "\n"     
-       << prefix << std::setw(24) << "FSCLAS:"
-       << theSecurityClassification << "\n"
-       << prefix << std::setw(24) << "FSCODE:"
-       << theCodewords << "\n"
-       << prefix << std::setw(24) << "FSCTLH:"
-       << theControlAndHandling << "\n"
-       << prefix << std::setw(24) << "FSREL:"
-       << theReleasingInstructions << "\n"
-       << prefix << std::setw(24) << "FSCAUT:"
-       << theClassificationAuthority << "\n"
-       << prefix << std::setw(24) << "FSCTLN:"
-       << theSecurityControlNumber << "\n"
-       << prefix << std::setw(24) << "FSDWNG:"
-       << theSecurityDowngrade << "\n"
-       << prefix << std::setw(24) << "FSDEVT:"
-       << theDowngradingEvent << "\n"
-       << prefix << std::setw(24) << "FSCOP:"
-       << theCopyNumber << "\n"
-       << prefix << std::setw(24) << "FSCPYS:"
-       << theNumberOfCopies << "\n"
-       << prefix << std::setw(24) << "ENCRYP:"
-       << theEncryption << "\n"
-       << prefix << std::setw(24) << "ONAME:"
-       << theOriginatorsName << "\n"
-       << prefix << std::setw(24) << "OPHONE:"
-       << theOriginatorsPhone << "\n"
-       << prefix << std::setw(24) << "FL:"
-       << theFileLength << "\n"
-       << prefix << std::setw(24) << "HL:"
-       << theHeaderLength << "\n"
-       << prefix << std::setw(24) << "NUMI:"
-       << theNumberOfImageInfoRecords << "\n";
-
-   ossim_uint32 index;
-   
-   for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
-   {
-      std::ostringstream os;
-      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-      
-      ossimString tmpStr = "LISH";
-      tmpStr += os.str();
-      
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
-      tmpStr = "LI";
-      tmpStr += os.str();
-      
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfImageInfoRecords[index].theImageLength << "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMS:" << theNumberOfSymbolInfoRecords
-       << "\n";
-
-   for (index = 0; index < theNitfSymbolInfoRecords.size(); ++index)
-   {
-      std::ostringstream os;
-      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LSSH";
-      tmpStr += os.str();
-
-      out << tmpStr
-          << theNitfSymbolInfoRecords[index].theSymbolSubheaderLength << "\n";
-
-      tmpStr = "LS";
-      tmpStr += os.str();
-
-      out << tmpStr 
-          << theNitfSymbolInfoRecords[index].theSymbolLength << "\n";
-   }
-
-   
-   out << prefix << std::setw(24) << "NUML:" << theNumberOfLabelInfoRecords
-       << "\n";
-
-   for (index = 0; index < theNitfLabelInfoRecords.size(); ++index)
-   {
-      std::ostringstream os;
-      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LLSH";
-      tmpStr += os.str();
-
-      out << tmpStr
-          << theNitfLabelInfoRecords[index].theLabelSubheaderLength  << "\n";
-
-      tmpStr = "LL";
-      tmpStr += os.str();
-
-      out << tmpStr 
-          << theNitfLabelInfoRecords[index].theLabelLength << "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMT:" << theNumberOfTextFileInfoRecords
-       << "\n";
-
-   for (index = 0; index < theNitfTextInfoRecords.size(); ++index)
-   {
-      std::ostringstream os;
-      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LTSH";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfTextInfoRecords[index].theTextSubheaderLength << "\n";
-
-      tmpStr = "LT";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr 
-          << theNitfTextInfoRecords[index].theTextLength<< "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMDES:"
-       << theNumberOfDataExtSegInfoRecords << "\n";
-
-   for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
-   {
-      std::ostringstream os;
-      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LDSH";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
-          << "\n";
-
-      tmpStr = "LD";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr 
-          << theNitfDataExtSegInfoRecords[index].theDataExtSegLength << "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMRES:"
-       << theNumberOfResExtSegInfoRecords << "\n";
-
-   for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
-   {
-      std::ostringstream os;
-      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LRSH";
-      tmpStr += os.str();
-
-      out << tmpStr
-          << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
-          << "\n";
-
-      tmpStr = "LR";
-      tmpStr += os.str();
-
-      out << tmpStr 
-          << theNitfResExtSegInfoRecords[index].theResExtSegLength
-          << "\n";
-   }
-
-   out << prefix << std::setw(24) << "UDHDL:"
-       << theUserDefinedHeaderDataLength << "\n"
-       << prefix << std::setw(24) << "UDHOFL:"
-       << theUserDefinedHeaderOverflow << "\n"
-       << prefix << std::setw(24) << "XHDL:"
-       << theExtendedHeaderDataLength << "\n";
-   
-   return ossimNitfFileHeader::print(out, prefix);
-}
-
-
-bool ossimNitfFileHeaderV2_0::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   bool result = ossimNitfFileHeaderV2_X::saveState(kwl, prefix);
-   
-   if(result)
-   {
-      kwl.add(prefix, "FSCODE",theCodewords);
-      kwl.add(prefix, "FSCTLH",theControlAndHandling);
-      kwl.add(prefix, "FSREL",theReleasingInstructions);
-      kwl.add(prefix, "FSCAUT",theClassificationAuthority);
-      kwl.add(prefix, "FSCTLN",theSecurityControlNumber);
-      kwl.add(prefix, "FSDWNG",theSecurityDowngrade);
-      kwl.add(prefix, "FSDEVT",theDowngradingEvent);
-      kwl.add(prefix, "ONAME",theOriginatorsName);
-      kwl.add(prefix, "OPHONE",theOriginatorsPhone);
-      kwl.add(prefix, "FL",theFileLength);
-      kwl.add(prefix, "HL",theHeaderLength);
-      kwl.add(prefix, "NUMI",theNumberOfImageInfoRecords);
-      kwl.add(prefix, "UDHDL",theUserDefinedHeaderDataLength);
-      kwl.add(prefix, "UDHOFL",theUserDefinedHeaderDataLength);
-      kwl.add(prefix, "XHDL",theExtendedHeaderDataLength);
-
-      std::ostringstream out;
-      ossim_uint32 index;
-      for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
-      {
-         std::ostringstream os;
-         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-         
-         ossimString tmpStr = "LISH";
-         tmpStr += os.str();
-         
-         out << tmpStr
-         << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
-         tmpStr = "LI";
-         tmpStr += os.str();
-         
-         out << tmpStr
-         << theNitfImageInfoRecords[index].theImageLength << "\n";
-      }
-      
-      out <<"NUMS:" << theNumberOfSymbolInfoRecords
-      << "\n";
-      
-      for (index = 0; index < theNitfSymbolInfoRecords.size(); ++index)
-      {
-         std::ostringstream os;
-         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-         
-         ossimString tmpStr = "LSSH";
-         tmpStr += os.str();
-         
-         out << tmpStr
-         << theNitfSymbolInfoRecords[index].theSymbolSubheaderLength << "\n";
-         
-         tmpStr = "LS";
-         tmpStr += os.str();
-         
-         out << tmpStr 
-         << theNitfSymbolInfoRecords[index].theSymbolLength << "\n";
-      }
-      
-      
-      out << "NUML:" << theNumberOfLabelInfoRecords
-      << "\n";
-      
-      for (index = 0; index < theNitfLabelInfoRecords.size(); ++index)
-      {
-         std::ostringstream os;
-         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-         
-         ossimString tmpStr = "LLSH";
-         tmpStr += os.str();
-         
-         out << tmpStr
-         << theNitfLabelInfoRecords[index].theLabelSubheaderLength  << "\n";
-         
-         tmpStr = "LL";
-         tmpStr += os.str();
-         
-         out << tmpStr 
-         << theNitfLabelInfoRecords[index].theLabelLength << "\n";
-      }
-      
-      out << "NUMT:" << theNumberOfTextFileInfoRecords
-      << "\n";
-      
-      for (index = 0; index < theNitfTextInfoRecords.size(); ++index)
-      {
-         std::ostringstream os;
-         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-         
-         ossimString tmpStr = "LTSH";
-         tmpStr += os.str();
-         
-         out << tmpStr
-         << theNitfTextInfoRecords[index].theTextSubheaderLength << "\n";
-         
-         tmpStr = "LT";
-         tmpStr += os.str();
-         
-         out << tmpStr 
-         << theNitfTextInfoRecords[index].theTextLength<< "\n";
-      }
-      
-      out << "NUMDES:"
-      << theNumberOfDataExtSegInfoRecords << "\n";
-      
-      for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
-      {
-         std::ostringstream os;
-         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-         
-         ossimString tmpStr = "LDSH";
-         tmpStr += os.str();
-         
-         out << tmpStr
-         << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
-         << "\n";
-         
-         tmpStr = "LD";
-         tmpStr += os.str();
-         
-         out << tmpStr 
-         << theNitfDataExtSegInfoRecords[index].theDataExtSegLength << "\n";
-      }
-      
-      out << "NUMRES:"
-      << theNumberOfResExtSegInfoRecords << "\n";
-      
-      for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
-      {
-         std::ostringstream os;
-         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
-         
-         ossimString tmpStr = "LRSH";
-         tmpStr += os.str();
-         
-         out << tmpStr
-         << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
-         << "\n";
-         
-         tmpStr = "LR";
-         tmpStr += os.str();
-         
-         out << tmpStr 
-         << theNitfResExtSegInfoRecords[index].theResExtSegLength
-         << "\n";
-      }
-      
-      {
-         std::istringstream in(out.str());
-         ossimKeywordlist tempKwl;
-         if(tempKwl.parseStream(in))
-         {
-            result = true;
-            kwl.add(prefix, tempKwl);
-         }
-      }
-   }
-   
-   return result;
-}
-
-ossimDrect ossimNitfFileHeaderV2_0::getImageRect()const
-{
-   return theImageRect;
-}
-
-void ossimNitfFileHeaderV2_0::addImageInfoRecord(const ossimNitfImageInfoRecordV2_0& recordInfo)
-{
-   theNitfImageInfoRecords.push_back(recordInfo);
-   
-   setNumberOfImageInfoRecords(theNitfImageInfoRecords.size());
-}
-
-void ossimNitfFileHeaderV2_0::replaceImageInfoRecord(ossim_uint32 i, const ossimNitfImageInfoRecordV2_0& recordInfo)
-{
-   theNitfImageInfoRecords[i]=recordInfo;
-}
-
-ossimNitfImageHeader*
-ossimNitfFileHeaderV2_0::getNewImageHeader(ossim_uint32 imageNumber,
-                                           std::istream& in)const
-{
-   ossimNitfImageHeader *result = 0;
-   
-   if( (getNumberOfImages() > 0) && (imageNumber < theImageOffsetList.size()) )
-   {
-      result = allocateImageHeader();
-      in.seekg(theImageOffsetList[imageNumber].theImageHeaderOffset, std::ios::beg);
-      result->parseStream(in);
-   }
-   else
-   {
-#if 0
-      ossimNotify(ossimNotifyLevel_FATAL) << "ossimNitfFileHeaderV2_0::getNewImageHeader ERROR:"
-                                          << "\nNo images in file or image number (" << imageNumber
-                                          << ") is out of range!\n";
-#endif
-   }
-   
-   return result;
-}
-
-ossimNitfSymbolHeader *ossimNitfFileHeaderV2_0::getNewSymbolHeader(
-   ossim_uint32 symbolNumber, std::istream& in)const
-{
-   ossimNitfSymbolHeader *result = 0;
-
-   if( (getNumberOfSymbols() > 0) &&
-       (symbolNumber < theSymbolOffsetList.size()) )
-   {
-      result = allocateSymbolHeader();
-      in.seekg(theSymbolOffsetList[symbolNumber].theSymbolHeaderOffset, std::ios::beg);
-      result->parseStream(in);
-   }
-   
-   return result;
-}
-
-ossimNitfLabelHeader *ossimNitfFileHeaderV2_0::getNewLabelHeader(
-   ossim_uint32 labelNumber, std::istream& in)const
-{
-   ossimNitfLabelHeader *result = 0;
-
-   if( (getNumberOfLabels() > 0) &&
-       (labelNumber < theLabelOffsetList.size()) )
-   {
-      result = allocateLabelHeader();
-      in.seekg(theLabelOffsetList[labelNumber].theLabelHeaderOffset, std::ios::beg);
-      result->parseStream(in);
-   }
-   
-   return result;
-}
-
-ossimNitfTextHeader *ossimNitfFileHeaderV2_0::getNewTextHeader(
-   ossim_uint32 textNumber, std::istream& in)const
-{
-   ossimNitfTextHeader *result = 0;
-
-   if( (getNumberOfTextSegments() > 0) &&
-       (textNumber < theTextOffsetList.size()) )
-   {
-      result = allocateTextHeader();
-      in.seekg(theTextOffsetList[textNumber].theTextHeaderOffset, std::ios::beg);
-      result->parseStream(in);
-   }
-   
-   return result;
-}
-
-ossimNitfDataExtensionSegment* ossimNitfFileHeaderV2_0::getNewDataExtensionSegment(ossim_int32 dataExtNumber,
-                                                                                   std::istream& in)const
-{
-   ossimNitfDataExtensionSegment *result = 0;
-
-   if((getNumberOfDataExtSegments() > 0) &&
-      (dataExtNumber < (ossim_int32)theNitfDataExtSegInfoRecords.size()) &&
-      (dataExtNumber >= 0))
-   {
-      result = allocateDataExtSegment();
-      in.seekg(theDataExtSegOffsetList[dataExtNumber].theDataExtSegHeaderOffset, std::ios::beg);
-      result->parseStream(in, theNitfDataExtSegInfoRecords[dataExtNumber].getImageLength());
-   }
-   
-   return result;
-}
-
-void ossimNitfFileHeaderV2_0::initializeDisplayLevels(std::istream& in)
-{
-   // we will need to temporarily save the get pointer since
-   // initializeDisplayLevels changes it.
-   std::streampos saveTheGetPointer = in.tellg();
-   
-   std::vector<ossimNitfImageOffsetInformation>::iterator imageOffsetList = theImageOffsetList.begin();
-
-   // allocate temporary space to store image headers
-   ossimNitfImageHeader* imageHeader = allocateImageHeader();
-
-   // clear the list
-   theDisplayInformationList.clear();
-   
-   theImageRect = ossimDrect(0,0,0,0);
-   if(!imageHeader)
-   {
-      return;
-   }
-   
-   ossim_uint32 idx = 0;
-   while(imageOffsetList != theImageOffsetList.end())
-   {
-      // position the get pointer in the input
-      // stream to the start of the image header
-      in.seekg((*imageOffsetList).theImageHeaderOffset, std::ios::beg);
-      // get the data
-      imageHeader->parseStream(in);
-      // create a union of rects.  The result should be the image rect.
-      ossimDrect tempRect = imageHeader->getImageRect();
-      if((tempRect.width() > 1) &&
-         (tempRect.height() > 1))
-      {
-         theImageRect = theImageRect.combine(tempRect);
-      }
-      
-      insertIntoDisplayInfoList(ossimNitfDisplayInfo(ossimString("IM"),
-                                                     imageHeader->getDisplayLevel(),
-                                                     idx));
-      
-      ++imageOffsetList;
-      ++idx;                                       
-   }
-   delete imageHeader;
-   imageHeader = 0;
-
-
-   
-   // finally we reset the saved get state back
-   // to its original position
-   in.seekg(saveTheGetPointer, std::ios::beg);
-}
-
-void ossimNitfFileHeaderV2_0::insertIntoDisplayInfoList(const ossimNitfDisplayInfo &displayInformation)
-{
-   std::vector<ossimNitfDisplayInfo>::iterator displayList = theDisplayInformationList.begin();
-
-   while(displayList != theDisplayInformationList.end())
-   {
-      if(displayInformation.theDisplayLevel < (*displayList).theDisplayLevel)
-      {
-         theDisplayInformationList.insert(displayList, displayInformation);
-         return;
-      }
-      ++displayList;
-   }
-
-   // If we get here it means it's larger than all others
-   // and we push onto the end
-   theDisplayInformationList.push_back(displayInformation);
-}
-
-void ossimNitfFileHeaderV2_0::initializeAllOffsets()
-{
-   // this will be a running tally 
-   ossim_uint64 tally = theHeaderSize;
-   ossim_uint32 idx = 0;
-
-   // clear out all offset inforamtion and begin populating them
-   theImageOffsetList.clear();
-   theSymbolOffsetList.clear();
-   theLabelOffsetList.clear();
-   theLabelOffsetList.clear();
-   
-
-   for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
-   {
-      theImageOffsetList.push_back(ossimNitfImageOffsetInformation(tally,
-                                                                   tally + theNitfImageInfoRecords[idx].getHeaderLength()));
-      tally += theNitfImageInfoRecords[idx].getTotalLength();
-   }
-   for(idx = 0; idx < theNitfSymbolInfoRecords.size(); ++idx)
-   {
-      theSymbolOffsetList.push_back(ossimNitfSymbolOffsetInformation(tally,
-                                                                     tally + theNitfSymbolInfoRecords[idx].getHeaderLength()));
-      tally += theNitfSymbolInfoRecords[idx].getTotalLength();
-   }
-
-   for(idx = 0; idx < theNitfLabelInfoRecords.size(); ++idx)
-   {
-      theLabelOffsetList.push_back(ossimNitfLabelOffsetInformation(tally,
-                                                                   tally + theNitfLabelInfoRecords[idx].getHeaderLength()));
-      tally += theNitfLabelInfoRecords[idx].getTotalLength();
-   }
-
-   for(idx = 0; idx < theNitfTextInfoRecords.size(); ++idx)
-   {
-      theTextOffsetList.push_back(ossimNitfTextOffsetInformation(tally,
-                                                                 tally + theNitfTextInfoRecords[idx].getHeaderLength()));
-      tally += theNitfTextInfoRecords[idx].getTotalLength();
-   }
-
-   for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
-   {
-      theDataExtSegOffsetList.push_back(ossimNitfDataExtSegOffsetInformation(tally,
-                                                                             tally + theNitfDataExtSegInfoRecords[idx].getHeaderLength()));
-      tally += theNitfDataExtSegInfoRecords[idx].getTotalLength();
-   }
-}
-
-ossimNitfImageHeader *ossimNitfFileHeaderV2_0::allocateImageHeader()const
-{
-   return new ossimNitfImageHeaderV2_0;
-}
-
-ossimNitfSymbolHeader *ossimNitfFileHeaderV2_0::allocateSymbolHeader()const
-{
-   return new ossimNitfSymbolHeaderV2_0;
-}
-
-ossimNitfLabelHeader *ossimNitfFileHeaderV2_0::allocateLabelHeader()const
-{
-   return new ossimNitfLabelHeaderV2_0;
-}
-
-ossimNitfTextHeader *ossimNitfFileHeaderV2_0::allocateTextHeader()const
-{
-   return new ossimNitfTextHeaderV2_0;
-}
-
-ossimNitfDataExtensionSegment* ossimNitfFileHeaderV2_0::allocateDataExtSegment()const
-{
-   return new ossimNitfDataExtensionSegmentV2_0();
-}
-
-bool ossimNitfFileHeaderV2_0::isEncrypted()const
-{
-   return (theEncryption[0] == '1');
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfImages()const
-{
-   return (ossim_int32)theNitfImageInfoRecords.size();
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfLabels()const
-{
-   return ((ossim_int32)theNitfLabelInfoRecords.size());
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfSymbols()const
-{
-   return ((ossim_int32)theNitfSymbolInfoRecords.size());
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfGraphics()const
-{
-   return 0;
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfTextSegments()const
-{
-   return (ossim_int32)theNitfTextInfoRecords.size();
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfDataExtSegments()const
-{
-   return (ossim_int32)theNitfDataExtSegInfoRecords.size();
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getHeaderSize()const
-{
-   return theHeaderSize;
-}
-
-ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfReservedExtSegments()const
-{
-   return theNitfResExtSegInfoRecords.size();
-}
-
-ossim_int64 ossimNitfFileHeaderV2_0::getFileSize()const
-{
-   ossimString temp = theFileLength;
-   if(temp == "999999999999")
-   {
-      return -1;
-   }
-   else
-   {
-      return temp.toInt64();
-   }
-}
-
-const char* ossimNitfFileHeaderV2_0::getVersion()const
-{
-   return &theFileTypeVersion[4];
-}
-
-const char* ossimNitfFileHeaderV2_0::getDateTime()const
-{
-   return theDateTime;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getSecurityClassification()const
-{
-   return theSecurityClassification;
-}
-
-void ossimNitfFileHeaderV2_0::clearFields()
-{
-   theDisplayInformationList.clear();
-   theImageOffsetList.clear();
-   theSymbolOffsetList.clear();
-   theLabelOffsetList.clear();
-   theTextOffsetList.clear();
-   theDataExtSegOffsetList.clear();
-   theNitfSymbolInfoRecords.clear();
-   theNitfLabelInfoRecords.clear();
-   theNitfTextInfoRecords.clear();
-   theNitfDataExtSegInfoRecords.clear();
-   theNitfResExtSegInfoRecords.clear();
-   
-   theFilename = "";
-   memcpy(theFileTypeVersion, "NITF02.00", 9);
-   memset(theComplexityLevel, ' ', 2);
-   memset(theSystemType, ' ', 4);
-   memset(theOriginatingStationId, ' ', 10);
-   memset(theDateTime, ' ', 14);
-   memset(theFileTitle, ' ', 80);
-   memset(theSecurityClassification, ' ', 1);
-   memset(theCodewords, ' ', 40);
-   memset(theControlAndHandling, ' ', 40);
-   memset(theReleasingInstructions, ' ', 40);
-   memset(theClassificationAuthority, ' ', 20);
-   memset(theSecurityControlNumber, ' ', 20);
-   memset(theSecurityDowngrade, ' ', 6);
-   memset(theDowngradingEvent, ' ', 40);
-   memset(theCopyNumber, ' ', 5);
-   memset(theNumberOfCopies, ' ', 5);
-   memset(theEncryption, ' ', 1);
-   memset(theOriginatorsName, ' ', 27);
-   memset(theOriginatorsPhone, ' ', 18);
-   memset(theFileLength, ' ', 12);
-   memset(theHeaderLength, ' ', 6);
-   memset(theNumberOfImageInfoRecords, ' ', 3);
-   memset(theNumberOfSymbolInfoRecords, ' ', 3);
-   memset(theNumberOfLabelInfoRecords, ' ', 3);
-   memset(theNumberOfTextFileInfoRecords, ' ', 3);
-   memset(theNumberOfDataExtSegInfoRecords, ' ', 3);
-   memset(theNumberOfResExtSegInfoRecords, ' ', 3);
-   memset(theUserDefinedHeaderDataLength, '0', 5);
-   memset(theUserDefinedHeaderOverflow, ' ', 3);
-   memset(theExtendedHeaderDataLength, '0', 5);
-   memset(theExtendedHeaderOverflow, ' ', 3);
-   
-   theFileTypeVersion[9] = '\0';
-   theComplexityLevel[2] = '\0';
-   theSystemType[4]      = '\0';
-   theOriginatingStationId[10] = '\0';
-   theDateTime[14]       = '\0';
-   theFileTitle[80]      = '\0';
-   theSecurityClassification[1] = '\0';
-   theCodewords[40] = '\0';
-   theControlAndHandling[40] = '\0';
-   theReleasingInstructions[40] = '\0';
-   theClassificationAuthority[20] = '\0';
-   theSecurityControlNumber[20] = '\0';
-   theSecurityDowngrade[6] = '\0';
-   theDowngradingEvent[40] = '\0';
-   theCopyNumber[5] = '\0';
-   theNumberOfCopies[5] = '\0';
-   theEncryption[1] = '\0';
-   theOriginatorsName[27] = '\0';
-   theOriginatorsPhone[18] = '\0';
-   theFileLength[12]  = '\0';
-   theHeaderLength[6] = '\0';
-   theNumberOfImageInfoRecords[3] = '\0';
-   theNumberOfSymbolInfoRecords[3] = '\0';
-   theNumberOfLabelInfoRecords[3] = '\0';
-   theNumberOfTextFileInfoRecords[3] = '\0';
-   theNumberOfDataExtSegInfoRecords[3] = '\0';
-   theNumberOfResExtSegInfoRecords[3] = '\0';
-   theUserDefinedHeaderDataLength[5] = '\0';
-   theUserDefinedHeaderOverflow[3] = '\0';
-   theExtendedHeaderDataLength[5] = '\0';
-   theExtendedHeaderOverflow[3] = '\0';
-   theHeaderSize = 0;
-}
-
-void ossimNitfFileHeaderV2_0::setNumberOfImageInfoRecords(ossim_uint64 num)
-{
-   if (num < 1000)
-   {
-      ostringstream out;
-      
-      out << std::setw(3)
-      << std::setfill('0')
-      << std::setiosflags(ios::right)
-      << num;
-      
-      memcpy(theNumberOfImageInfoRecords, out.str().c_str(), 3);
-   }
-   else
-   {
-      std::string s = "ossimNitfFileHeaderV2_0::setNumberOfImageInfoRecords:";
-      s += " ERROR\nExceeded max image info number of 999!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-}
-
-void ossimNitfFileHeaderV2_0::readImageInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfImages = ossimString(theNumberOfImageInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfImageInfoRecords.clear();
-   for(index=0; index < numberOfImages; index++)
-   {
-      ossimNitfImageInfoRecordV2_0 temp;
-      
-      in.read(temp.theImageSubheaderLength, 6);
-      in.read(temp.theImageLength, 10);
-      theHeaderSize+=16;
-      temp.theImageSubheaderLength[6] = '\0';
-      temp.theImageLength[10] = '\0';
-
-      theNitfImageInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_0::readSymbolInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfSymbols = ossimString(theNumberOfSymbolInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfSymbolInfoRecords.clear();
-   
-   for(index=0; index < numberOfSymbols; index++)
-   {
-      ossimNitfSymbolInfoRecordV2_0 temp;
-
-      
-      in.read(temp.theSymbolSubheaderLength, 4);
-      in.read(temp.theSymbolLength, 6);
-      theHeaderSize+=10;
-      
-      temp.theSymbolSubheaderLength[4] = '\0';
-      temp.theSymbolLength[6] = '\0';
-      
-      theNitfSymbolInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_0::readLabelInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfLabels = ossimString(theNumberOfLabelInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfLabelInfoRecords.clear();
-   
-   for(index=0; index < numberOfLabels; index++)
-   {
-      ossimNitfLabelInfoRecordV2_0 temp;
-      
-      in.read(temp.theLabelSubheaderLength, 4);
-      in.read(temp.theLabelLength, 3);
-      theHeaderSize+=7;
-      temp.theLabelSubheaderLength[4] = '\0';
-      temp.theLabelLength[3]          = '\0';
-
-      theNitfLabelInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_0::readTextFileInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfTextFiles = ossimString(theNumberOfTextFileInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfTextInfoRecords.clear();
-   for(index=0; index < numberOfTextFiles; index++)
-   {
-      ossimNitfTextInfoRecordV2_0 temp;
-      
-      in.read(temp.theTextSubheaderLength, 4);
-      in.read(temp.theTextLength, 5);
-      theHeaderSize+=9;
-      
-      temp.theTextSubheaderLength[4] = '\0';
-      temp.theTextLength[5] = '\0';
-      
-      theNitfTextInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_0::readDataExtSegInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfDataExtSegs = ossimString(theNumberOfDataExtSegInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfDataExtSegInfoRecords.clear();
-   for(index=0; index < numberOfDataExtSegs; index++)
-   {
-      ossimNitfDataExtSegInfoRecordV2_0 temp;
-      
-      in.read(temp.theDataExtSegSubheaderLength, 4);
-      in.read(temp.theDataExtSegLength, 9);
-      theHeaderSize+=13;
-      
-      temp.theDataExtSegSubheaderLength[4] = '\0';
-      temp.theDataExtSegLength[9]          = '\0';
-
-      theNitfDataExtSegInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_0::readResExtSegInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfResExtSegs = ossimString(theNumberOfResExtSegInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfResExtSegInfoRecords.clear();
-   for(index=0; index < numberOfResExtSegs; index++)
-   {
-      ossimNitfResExtSegInfoRecordV2_0 temp;
-
-      in.read(temp.theResExtSegSubheaderLength, 4);
-      in.read(temp.theResExtSegLength, 7);
-      theHeaderSize+=11;
-      
-      temp.theResExtSegSubheaderLength[4] = '\0';
-      temp.theResExtSegLength[7]          = '\0';
-      
-      theNitfResExtSegInfoRecords.push_back(temp);      
-   }
-}
-
-void ossimNitfFileHeaderV2_0::setComplianceLevel(const ossimString& complianceLevel)
-{
-   ossimNitfCommon::setField(theComplexityLevel, complianceLevel, 2);
-}
-
-void ossimNitfFileHeaderV2_0::setCodeWords(const ossimString& codeWords)
-{
-   ossimNitfCommon::setField(theCodewords, codeWords, 40);
-}
-
-void ossimNitfFileHeaderV2_0::setControlAndHandling(const ossimString& controlAndHandling)
-{
-   ossimNitfCommon::setField(theControlAndHandling, controlAndHandling, 40);
-}
-
-void ossimNitfFileHeaderV2_0::setReleasingInstructions(const ossimString& releasingInstructions)
-{
-   ossimNitfCommon::setField(theReleasingInstructions, releasingInstructions, 40);
-}
-
-void ossimNitfFileHeaderV2_0::setClassificationAuthority(const ossimString& classAuth)
-{
-   ossimNitfCommon::setField(theClassificationAuthority, classAuth, 20);
-}
-
-void ossimNitfFileHeaderV2_0::setSecurityControlNumber(const ossimString& controlNo)
-{
-   ossimNitfCommon::setField(theSecurityControlNumber, controlNo, 20);
-}
-
-void ossimNitfFileHeaderV2_0::setOriginatorsName(const ossimString& originatorName)
-{
-   ossimNitfCommon::setField(theOriginatorsName, originatorName, 27);
-}
-
-void ossimNitfFileHeaderV2_0::setOriginatorsPhone(const ossimString& originatorPhone)
-{
-   ossimNitfCommon::setField(theOriginatorsPhone, originatorPhone, 18);
-}
-
-void ossimNitfFileHeaderV2_0::setSecurityDowngrade(const ossimString& securityDowngrade)
-{
-   ossimNitfCommon::setField(theSecurityDowngrade, securityDowngrade, 6);
-}
-
-void ossimNitfFileHeaderV2_0::setDowngradingEvent(const ossimString& downgradeEvent)
-{
-   ossimNitfCommon::setField(theDowngradingEvent, downgradeEvent, 40);
-}
-
-void ossimNitfFileHeaderV2_0::setFileLength(ossim_uint64 fileLength)
-{
-   ostringstream out;
-   
-   out << std::setw(12)
-   << std::setfill('0')
-   << std::setiosflags(ios::right)
-   << fileLength;
-   
-   memcpy(theFileLength, out.str().c_str(), 12);
-}
-
-void ossimNitfFileHeaderV2_0::setHeaderLength(ossim_uint64 headerLength)
-{
-   ostringstream out;
-   
-   out << std::setw(6)
-   << std::setfill('0')
-   << std::setiosflags(ios::right)
-   << headerLength;
-   
-   memcpy(theHeaderLength, out.str().c_str(), 6);
-}
-
-ossimString ossimNitfFileHeaderV2_0::getComplianceLevel()const
-{
-   return theComplexityLevel;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getSecurityDowngrade()const
-{
-   return theSecurityDowngrade;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getDowngradingEvent()const
-{
-   return theDowngradingEvent;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getCodeWords()const
-{
-   return theCodewords;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getControlAndHandling()const
-{
-   return theControlAndHandling;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getReleasingInstructions()const
-{
-   return theReleasingInstructions;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getClassificationAuthority()const
-{
-   return theClassificationAuthority;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getSecurityControlNumber()const
-{
-   return theSecurityControlNumber;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getOriginatorsName()const
-{
-   return theOriginatorsName;
-}
-
-ossimString ossimNitfFileHeaderV2_0::getOriginatorsPhone()const
-{
-   return theOriginatorsPhone;
-}
-
-void ossimNitfFileHeaderV2_0::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   const ossimString& name = property->getName();
-   if(name == CLEVEL_KW)
-   {
-      setComplianceLevel(property->valueToString());
-   }
-   else if(name == FSDWNG_KW)
-   {
-      setSecurityDowngrade(property->valueToString());
-   }
-   else if(name == FSDEVT_KW)
-   {
-      setDowngradingEvent(property->valueToString());
-   }
-   else if(name == ONAME_KW)
-   {
-      setOriginatorsName(property->valueToString());
-   }
-   else if(name == OPHONE_KW)
-   {
-      setOriginatorsPhone(property->valueToString());
-   }
-   else
-   {
-      ossimNitfFileHeaderV2_X::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitfFileHeaderV2_0::getProperty(const ossimString& name)const
-{
-   ossimProperty* property = 0;
-
-	
-   if(name == CLEVEL_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theComplexityLevel).trim());
-   }
-   else if(name == FSDWNG_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theSecurityDowngrade).trim());
-   }
-   else if(name == FSDEVT_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theDowngradingEvent).trim());
-   }
-   else if(name == ONAME_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theOriginatorsName).trim());
-   }
-   else if(name == OPHONE_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theOriginatorsPhone).trim());
-   }
-   else
-   {
-      return ossimNitfFileHeaderV2_X::getProperty(name);
-   }
-   return property;
-}
-
-void ossimNitfFileHeaderV2_0::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfFileHeaderV2_X::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(CLEVEL_KW);
-   propertyNames.push_back(STYPE_KW);
-   propertyNames.push_back(OSTAID_KW);
-   propertyNames.push_back(FDT_KW);
-   propertyNames.push_back(FTITLE_KW);
-   propertyNames.push_back(FSCLAS_KW);
-   propertyNames.push_back(FSCODE_KW);
-   propertyNames.push_back(FSCTLH_KW);
-   propertyNames.push_back(FSREL_KW);
-   propertyNames.push_back(FSCAUT_KW);
-   propertyNames.push_back(FSCTLN_KW);
-   propertyNames.push_back(FSCOP_KW);
-   propertyNames.push_back(FSCPYS_KW);
-   propertyNames.push_back(ENCRYP_KW);
-   propertyNames.push_back(ONAME_KW);
-   propertyNames.push_back(OPHONE_KW);
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp b/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp
deleted file mode 100644
index 5e4eaea..0000000
--- a/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_1.cpp
+++ /dev/null
@@ -1,2115 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfFileHeaderV2_1.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#include <cstring> // for memset
-
-#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfTextHeaderV2_0.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimColorProperty.h>
-#include <ossim/base/ossimDateProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
-#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h> // ??? drb
-
-
-RTTI_DEF1(ossimNitfFileHeaderV2_1,
-          "ossimNitfFileHeaderV2_1",
-          ossimNitfFileHeaderV2_X)
-
-const ossimString ossimNitfFileHeaderV2_1::FSCLSY_KW  = "FSCLSY";
-const ossimString ossimNitfFileHeaderV2_1::FSDCTP_KW  = "FSDCTP";
-const ossimString ossimNitfFileHeaderV2_1::FSDCDT_KW  = "FSDCDT";
-const ossimString ossimNitfFileHeaderV2_1::FSDCXM_KW  = "FSDCXM";
-const ossimString ossimNitfFileHeaderV2_1::FSDG_KW    = "FSDG";
-const ossimString ossimNitfFileHeaderV2_1::FSDGDT_KW  = "FSDGDT";
-const ossimString ossimNitfFileHeaderV2_1::FSCLTX_KW  = "FSCLTX";
-const ossimString ossimNitfFileHeaderV2_1::FSCATP_KW  = "FSCATP";
-const ossimString ossimNitfFileHeaderV2_1::FSCRSN_KW  = "FSCRSN";
-const ossimString ossimNitfFileHeaderV2_1::FSSRDT_KW  = "FSSRDT";
-const ossimString ossimNitfFileHeaderV2_1::FBKGC_KW   = "FBKGC";
-
-static const
-ossimTrace traceDebug(ossimString("ossimNitfFileHeaderV2_1:debug"));
-   
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfImageInfoRecordV2_1 &data)
-{
-   return out << "theImageSubheaderLength:       "
-              << data.theImageSubheaderLength
-              << "\ntheImageLength:                "
-              << data.theImageLength
-              << std::endl;
-}
-
-ossim_uint64 ossimNitfImageInfoRecordV2_1::getHeaderLength()const
-{
-   return ossimString(theImageSubheaderLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfImageInfoRecordV2_1::getImageLength()const
-{
-   return ossimString(theImageLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfImageInfoRecordV2_1::getTotalLength()const
-{
-   return (getHeaderLength() + getImageLength());
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfGraphicInfoRecordV2_1 &data)
-{
-   return out << "theGraphicSubheaderLength:     "
-              << data.theGraphicSubheaderLength
-              << "\ntheGraphicLength:              "
-              << data.theGraphicLength
-              << std::endl;
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfTextFileInfoRecordV2_1 &data)
-{
-   return out << "theTextFileSubheaderLength:    "
-              << data.theTextFileSubheaderLength
-              << "\ntheTextFileLength:             "
-              << data.theTextFileLength
-              << std::endl;
-}
-ossim_uint64 ossimNitfGraphicInfoRecordV2_1::getHeaderLength()const
-{
-   return ossimString(theGraphicSubheaderLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfGraphicInfoRecordV2_1::getGraphicLength()const
-{
-   return ossimString(theGraphicLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfGraphicInfoRecordV2_1::getTotalLength()const
-{
-   return getGraphicLength() + getHeaderLength();
-}
-
-void ossimNitfTextFileInfoRecordV2_1::setSubheaderLength(ossim_uint64 length)
-{
-   ostringstream out;
-   
-   out << std::setw(4)
-   << std::setfill('0')
-   << std::setiosflags(ios::right)
-   << length;
-   
-   memcpy(theTextFileSubheaderLength, out.str().c_str(), 4);
-   theTextFileSubheaderLength[4] = '\0';
-}
-
-void ossimNitfTextFileInfoRecordV2_1::setTextLength(ossim_uint64 length)
-{
-   ostringstream out;
-   
-   out << std::setw(5)
-   << std::setfill('0')
-   << std::setiosflags(ios::right)
-   << length;
-   
-   memcpy(theTextFileLength, out.str().c_str(), 5);
-   theTextFileLength[5] = '\0';
-}
-
-ossim_uint64 ossimNitfTextFileInfoRecordV2_1::getHeaderLength()const
-{
-   return ossimString(theTextFileSubheaderLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfTextFileInfoRecordV2_1::getTextLength()const
-{
-   return ossimString(theTextFileLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfTextFileInfoRecordV2_1::getTotalLength()const
-{
-   return (getHeaderLength() + getTextLength());
-}
-
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfDataExtSegInfoRecordV2_1 &data)
-{
-   return out << "theDataExtSegSubheaderLength:  "
-              << data.theDataExtSegSubheaderLength
-              << "\ntheDataExtSegLength:           "
-              << data.theDataExtSegLength
-              << std::endl;
-}
-
-ossim_uint64 ossimNitfDataExtSegInfoRecordV2_1::getHeaderLength()const
-{
-   return ossimString(theDataExtSegSubheaderLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfDataExtSegInfoRecordV2_1::getDataExtSegLength()const
-{
-   return ossimString(theDataExtSegLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfDataExtSegInfoRecordV2_1::getTotalLength()const
-{
-   return getDataExtSegLength() + getHeaderLength();
-}
-
-std::ostream& operator <<(std::ostream& out,
-                     const ossimNitfResExtSegInfoRecordV2_1 &data)
-{
-   return out << "theResExtSegSubheaderLength:   "
-              << data.theResExtSegSubheaderLength
-              << "\ntheResExtSegLength:            "
-              << data.theResExtSegLength
-              << std::endl;
-}
-
-ossim_uint64 ossimNitfResExtSegInfoRecordV2_1::getHeaderLength()const
-{
-   return ossimString(theResExtSegSubheaderLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfResExtSegInfoRecordV2_1::getResExtSegLength()const
-{
-   return ossimString(theResExtSegLength).toUInt64();
-}
-
-ossim_uint64 ossimNitfResExtSegInfoRecordV2_1::getTotalLength()const
-{
-   return getResExtSegLength() + getHeaderLength();
-}
-
-void ossimNitfImageInfoRecordV2_1::setSubheaderLength(ossim_uint32 length)
-{
-   ostringstream out;
-
-   out << std::setw(6)
-       << std::setfill('0')
-       << std::setiosflags(ios::right)
-       << length;
-
-   memcpy(theImageSubheaderLength, out.str().c_str(), 6);
-   theImageSubheaderLength[6] = '\0';
-}
-
-void ossimNitfImageInfoRecordV2_1::setImageLength(ossim_uint64 length)
-{
-   ostringstream out;
-
-   out << std::setw(10)
-       << std::setfill('0')
-       << std::setiosflags(ios::right)
-       << length;
-   
-   memcpy(theImageLength, out.str().c_str(), 10);
-   theImageLength[10] = '\0';
-}
-
-// 
-
-ossimNitfFileHeaderV2_1::ossimNitfFileHeaderV2_1()
-   :ossimNitfFileHeaderV2_X()
-{
-   clearFields();
-}
-
-ossimNitfFileHeaderV2_1::~ossimNitfFileHeaderV2_1()
-{
-}
-
-void ossimNitfFileHeaderV2_1::parseStream(std::istream& in)
-{
-   clearFields();
-
-   // identification and origination group
-   in.read(theFileTypeVersion, 9);
-   theHeaderSize += 9;
-   in.read(theComplexityLevel, 2);
-   theHeaderSize += 2;
-   in.read(theSystemType, 4);
-   theHeaderSize += 4;
-   in.read(theOriginatingStationId, 10);
-   theHeaderSize += 10;
-   in.read(theDateTime, 14);
-   theHeaderSize += 14;
-   in.read(theFileTitle, 80);
-   theHeaderSize += 80;
-
-   // read security group
-   in.read(theSecurityClassification, 1);
-   theHeaderSize ++;
-   in.read(theSecurityClassificationSys, 2);
-   theHeaderSize += 2;
-   in.read(theCodewords, 11);
-   theHeaderSize += 11;
-   in.read(theControlAndHandling, 2);
-   theHeaderSize += 2;
-   in.read(theReleasingInstructions, 20);
-   theHeaderSize += 20;
-   in.read(theDeclassificationType, 2);
-   theHeaderSize += 2;
-   in.read(theDeclassificationDate, 8);
-   theHeaderSize += 8;
-   in.read(theDeclassificationExemption, 4);
-   theHeaderSize += 4;
-      
-   in.read(theDowngrade, 1);
-   theHeaderSize ++;
-   in.read(theDowngradingDate, 8);
-   theHeaderSize += 8;
-   in.read(theClassificationText, 43);
-   theHeaderSize += 43;
-   in.read(theClassificationAuthorityType, 1);
-   theHeaderSize ++;
-   in.read(theClassificationAuthority, 40);
-   theHeaderSize += 40;
-   in.read(theClassificationReason, 1);
-   theHeaderSize ++;
-   in.read(theSecuritySourceDate, 8);
-   theHeaderSize += 8;
-   in.read(theSecurityControlNumber, 15);
-   theHeaderSize += 15;
-   in.read(theCopyNumber, 5);
-   theHeaderSize += 5;
-   in.read(theNumberOfCopies, 5);
-   theHeaderSize += 5;
-   in.read(theEncryption, 1);
-   theHeaderSize ++;
-   in.read((char*)theFileBackgroundColor, 3);
-   theHeaderSize += 3;
-   in.read(theOriginatorsName, 24);
-   theHeaderSize += 24;
-   in.read(theOriginatorsPhone, 18);
-   theHeaderSize += 18;
-   in.read(theFileLength, 12);
-   theHeaderSize += 12;
-   in.read(theHeaderLength, 6);
-   theHeaderSize += 6;
-   
-   // image description group
-   in.read(theNumberOfImageInfoRecords, 3); 
-   theHeaderSize += 3;
-   readImageInfoRecords(in); 
-
-   // symbol description group
-   in.read(theNumberOfGraphicInfoRecords, 3); 
-   theHeaderSize += 3;
-   readGraphicInfoRecords(in);
-
-   in.read(theReservedForFutureUse1, 3);
-   theHeaderSize += 3;
-      
-   // text file information group
-   in.read(theNumberOfTextFileInfoRecords, 3); 
-   theHeaderSize += 3;
-   readTextFileInfoRecords(in);
-
-   // Data extension group
-   in.read(theNumberOfDataExtSegInfoRecords, 3); 
-   theHeaderSize += 3;
-   readDataExtSegInfoRecords(in);
-
-   // Reserve Extension Segment group
-   in.read(theNumberOfResExtSegInfoRecords, 3); 
-   theHeaderSize += 3;
-   readResExtSegInfoRecords(in);
-
-   in.read(theUserDefinedHeaderDataLength, 5);
-   theHeaderSize += 5;
-
-   // only get the header overflow if there even exists
-   // user defined data.
-   std::streampos userDefinedHeaderLength = ossimString(theUserDefinedHeaderDataLength).toInt32();
-   ossimNitfTagInformation         headerTag;
-   std::streampos start   = in.tellg();
-   std::streampos current = in.tellg();
-   if(userDefinedHeaderLength > 0)
-   {
-      in.read(theUserDefinedHeaderOverflow, 3);
-      current = in.tellg();
-         
-      while((current - start) < userDefinedHeaderLength)
-      {
-         headerTag.parseStream(in);
-         headerTag.setTagType("UDHD");
-         theTagList.push_back(headerTag);
-         // in.ignore(headerTag.getTagLength());
-         // headerTag.clearFields();
-         current = in.tellg();
-      }
-      //in.seekg(start + userDefinedHeaderLength);
-      theHeaderSize += (userDefinedHeaderLength);
-   }
-   in.read(theExtendedHeaderDataLength, 5);
-   theHeaderSize += 5;
-   std::streampos extendedHeaderDataLength = ossimString(theExtendedHeaderDataLength).toInt32();
-
-   start   = in.tellg();
-   current = in.tellg();
-   // for now let's just ignore it
-   if(extendedHeaderDataLength > 0)
-   {
-      in.read(theExtendedHeaderDataOverflow, 3);
-      current = in.tellg();
-      while((current - start) < extendedHeaderDataLength)
-      {
-         headerTag.parseStream(in);
-	 headerTag.setTagType("XHD");
-         theTagList.push_back(headerTag);
-         
-         // in.ignore(headerTag.getTagLength());
-         // headerTag.clearFields();
-         current = in.tellg();
-      }
-      theHeaderSize += extendedHeaderDataLength;
-      //in.seekg(start + extendedHeaderDataLength);
-   }
-
-   // this need to be re-thought
-   initializeAllOffsets();
-   readOverflowTags(in);
-}
-
-void ossimNitfFileHeaderV2_1::readOverflowTags(istream& in)
-{
-   ossim_int32 overflow = ossimString(theUserDefinedHeaderOverflow).toInt32();
-   if (overflow != 0)
-   {
-      ossimNitfDataExtensionSegment *des = getNewDataExtensionSegment(overflow-1, in);
-      if (des != NULL)
-      {
-         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
-         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
-         {
-            iter->setTagType("UDHD");
-            theTagList.push_back(*iter);
-         }
-      }
-      delete des;
-   }
-
-   overflow = ossimString(theExtendedHeaderDataOverflow).toInt32();
-   if (overflow != 0)
-   {
-      ossimNitfDataExtensionSegment *des = getNewDataExtensionSegment(overflow-1, in);
-      if (des != NULL)
-      {
-         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
-         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
-         {
-            iter->setTagType("XHD");
-            theTagList.push_back(*iter);
-         }
-      }
-      delete des;
-   }
-}
-
-void ossimNitfFileHeaderV2_1::writeStream(std::ostream &out)
-{
-   out.write(theFileTypeVersion, 9);
-   out.write(theComplexityLevel, 2);
-   out.write(theSystemType, 4);
-   out.write(theOriginatingStationId, 10);
-   out.write(theDateTime, 14);
-   out.write(theFileTitle, 80);
-   out.write(theSecurityClassification, 1);
-   out.write(theSecurityClassificationSys, 2);
-   out.write(theCodewords, 11);
-   out.write(theControlAndHandling, 2);
-   out.write(theReleasingInstructions, 20);
-   out.write(theDeclassificationType, 2);
-   out.write(theDeclassificationDate, 8);
-   out.write(theDeclassificationExemption, 4);
-   out.write(theDowngrade, 1);
-   out.write(theDowngradingDate, 8);
-   out.write(theClassificationText, 43);
-   out.write(theClassificationAuthorityType, 1);
-   out.write(theClassificationAuthority, 40);
-   out.write(theClassificationReason, 1);
-   out.write(theSecuritySourceDate, 8);
-   out.write(theSecurityControlNumber, 15);
-   out.write(theCopyNumber, 5);
-   out.write(theNumberOfCopies, 5);
-   out.write(theEncryption, 1);
-   out.write((char*)theFileBackgroundColor, 3);
-   out.write(theOriginatorsName, 24);
-   out.write(theOriginatorsPhone, 18);
-   out.write(theFileLength, 12);
-   out.write(theHeaderLength, 6);
-   ossim_uint32 idx = 0;
-   {
-      ostringstream outString;
-      
-      
-      outString << std::setw(3)
-                << std::setfill('0')
-                << std::setiosflags(ios::right)
-                << theNitfImageInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      
-      for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfImageInfoRecords[idx].theImageSubheaderLength, 6);
-         out.write(theNitfImageInfoRecords[idx].theImageLength, 10);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      
-      outString << std::setw(3)
-                << std::setfill('0')
-                << std::setiosflags(ios::right)
-                << theNitfGraphicInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      for(idx = 0; idx < theNitfGraphicInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfGraphicInfoRecords[idx].theGraphicSubheaderLength, 4);
-         out.write(theNitfGraphicInfoRecords[idx].theGraphicLength, 6);
-      }
-   }
-   out.write(theReservedForFutureUse1, 3);
-   {
-      ostringstream outString;
-      
-      
-      outString << std::setw(3)
-                << std::setfill('0')
-                << std::setiosflags(ios::right)
-                << theNitfTextFileInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      for(idx = 0; idx < theNitfTextFileInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfTextFileInfoRecords[idx].theTextFileSubheaderLength, 4);
-         out.write(theNitfTextFileInfoRecords[idx].theTextFileLength, 5);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      
-      outString << std::setw(3)
-                << std::setfill('0')
-                << std::setiosflags(ios::right)
-                << theNitfDataExtSegInfoRecords.size();
-      
-      out.write(outString.str().c_str(), 3);
-      for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegSubheaderLength, 4);
-         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegLength, 9);
-      }
-   }
-   {
-      ostringstream outString;
-      
-      
-      outString << std::setw(3)
-                << std::setfill('0')
-                << std::setiosflags(ios::right)
-                << theNitfResExtSegInfoRecords.size();
-
-      out.write(outString.str().c_str(), 3);
-      for(idx = 0; idx < theNitfResExtSegInfoRecords.size(); ++idx)
-      {
-         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegSubheaderLength, 4);
-         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegLength, 7);
-      }
-   }
-/*
-   out.write(theUserDefinedHeaderDataLength, 5);
-   if(ossimString(theUserDefinedHeaderDataLength).toInt32() > 0)
-   {
-      out.write(theUserDefinedHeaderOverflow, 3);
-   }
-   ossim_uint32 totalLength = getTotalTagLength();
-   if(totalLength <= 99999)
-   {
-      std::ostringstream tempOut;
-
-      tempOut << std::setw(5)
-              << std::setfill('0')
-	      << std::setiosflags(ios::right)
-              << totalLength;
-      
-      memcpy(theExtendedHeaderDataLength, tempOut.str().c_str(), 5);
-      
-      out.write(theExtendedHeaderDataLength, 5);
-
-      // for now we hard code the 000 for we do not currently support writing to the DES if the total tag length is
-      // larger than supported
-      //
-      memset(theExtendedHeaderDataOverflow, '0', 3);
-
-      if(totalLength > 0)
-      {
-         out.write(theExtendedHeaderDataOverflow, 3);
-         ossim_uint32 i = 0;
-         
-         for(i = 0; i < theTagList.size(); ++i)
-         {
-            theTagList[i].writeStream(out);
-         }
-      }
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length < 99999" << std::endl;
-   }
-   */
-      ossim_uint32 totalLength = ossimString(theUserDefinedHeaderDataLength).toUInt32();
-   if (totalLength > 0)
-   {
-      totalLength += 3;
-   }
-
-   // Scope tempOut
-   {
-      std::ostringstream tempOut;
-      tempOut << std::setw(5)
-              << std::setfill('0')
-              << std::setiosflags(ios::right)
-              << totalLength;
-
-      out.write(tempOut.str().c_str(), 5);
-   }
-
-   if (totalLength > 0)
-   {
-      if(totalLength <= 99999)
-      {
-         out.write(theUserDefinedHeaderOverflow, 3);
-
-         for (unsigned int i = 0; i < theTagList.size(); ++i)
-         {
-            if (theTagList[i].getTagType() == "UDHD")
-            {
-               theTagList[i].writeStream(out);
-            }
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length <= 99999" << std::endl;
-      }
-   }
-
-   totalLength = ossimString(theExtendedHeaderDataLength).toUInt32();
-   if (totalLength > 0)
-   {
-      totalLength += 3;
-   }
-
-   // Scope tempOut
-   {
-      std::ostringstream tempOut;
-      tempOut << std::setw(5)
-              << std::setfill('0')
-              << std::setiosflags(ios::right)
-              << totalLength;
-
-      out.write(tempOut.str().c_str(), 5);
-   }
-
-   if (totalLength > 0)
-   {
-      if(totalLength <= 99999)
-      {
-         out.write(theExtendedHeaderDataOverflow, 3);
-
-         for(unsigned int i = 0; i < theTagList.size(); ++i)
-         {
-            if (theTagList[i].getTagType() == "XHD")
-            {
-               theTagList[i].writeStream(out);
-            }
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length <= 99999" << std::endl;
-      }
-   }
-
-}
-
-std::ostream& ossimNitfFileHeaderV2_1::print(std::ostream& out,
-                                             const std::string& prefix) const
-{
-   out << setiosflags(ios::left)
-       << prefix << std::setw(24) << "FHDR:"
-       << theFileTypeVersion << "\n"
-       << prefix << std::setw(24) << "CLEVEL:"
-       << theComplexityLevel << "\n"
-       << prefix << std::setw(24) << "STYPE:"
-       << theSystemType << "\n"
-       << prefix << std::setw(24) << "OSTAID:"
-       << theOriginatingStationId << "\n"
-       << prefix << std::setw(24) << "FDT:"
-       << theDateTime << "\n"      
-       << prefix << std::setw(24) << "FTITLE:"
-       << theFileTitle << "\n"    
-       << prefix << std::setw(24) << "FSCLAS:"
-       << theSecurityClassification<< "\n"
-       << prefix << std::setw(24) << "FSCLSY:"
-       << theSecurityClassificationSys<< "\n"
-       << prefix << std::setw(24) << "FSCODE:"
-       << theCodewords << "\n"
-       << prefix << std::setw(24) << "FSCTLH:"
-       << theControlAndHandling << "\n"
-       << prefix << std::setw(24) << "FSREL:"
-       << theReleasingInstructions << "\n"
-       << prefix << std::setw(24) << "FSDCTP:"
-       << theDeclassificationType << "\n"
-       << prefix << std::setw(24) << "FSDCDT:"
-       << theDeclassificationDate << "\n"
-       << prefix << std::setw(24) << "FSDCXM:"
-       << theDeclassificationExemption << "\n"
-       << prefix << std::setw(24) << "FSDG:"
-       << theDowngrade << "\n"
-       << prefix << std::setw(24) << "FSDGDT:"
-       << theDowngradingDate << "\n"
-       << prefix << std::setw(24) << "FSCLTX:"
-       << theClassificationText << "\n"
-       << prefix << std::setw(24) << "FSCATP:"
-       << theClassificationAuthorityType << "\n"
-       << prefix << std::setw(24) << "FSCAUT:"
-       << theClassificationAuthority << "\n"
-       << prefix << std::setw(24) << "FSCRSN:"
-       << theClassificationReason << "\n"
-       << prefix << std::setw(24) << "FSSRDT:"
-       << theSecuritySourceDate << "\n"
-       << prefix << std::setw(24) << "FSCTLN:"
-       << theSecurityControlNumber << "\n"
-       << prefix << std::setw(24) << "FSCOP:"
-       << theCopyNumber << "\n"
-       << prefix << std::setw(24) << "FSCOPYS:"
-       << theNumberOfCopies << "\n"
-       << prefix << std::setw(24) << "ENCRYP:"
-       << theEncryption << "\n"
-       << prefix << std::setw(24) << "FBKGC[0]:"
-       << (int)theFileBackgroundColor[0] << "\n"
-       << prefix << std::setw(24) << "FBKGC[1]:"
-       << (int)theFileBackgroundColor[1] << "\n"
-       << prefix << std::setw(24) << "FBKGC[2]:"
-       << (int)theFileBackgroundColor[2] << "\n"
-       << prefix << std::setw(24) << "ONAME:"
-       << theOriginatorsName<< "\n"
-       << prefix << std::setw(24) << "OPHONE:"
-       << theOriginatorsPhone << "\n"
-       << prefix << std::setw(24) << "FL:"
-       << theFileLength  << "\n"
-       << prefix << std::setw(24) << "HL:"
-       << theHeaderLength << "\n"
-       << prefix << std::setw(24) << "NUMI:"
-       << theNumberOfImageInfoRecords << "\n";
-
-   ossim_uint32 index;
-
-   for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
-   {
-      ostringstream os;
-      os << setw(3) << setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LISH";
-      tmpStr += os.str();
-      
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
-      tmpStr = "LI";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfImageInfoRecords[index].theImageLength << "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMS:" << theNumberOfGraphicInfoRecords
-       << "\n";
- 
-   for (index = 0; index < theNitfGraphicInfoRecords.size(); ++index)
-   {
-      ostringstream os;
-      os << setw(3) << setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LSSH";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfGraphicInfoRecords[index].theGraphicSubheaderLength
-          << "\n";
-
-      tmpStr = "LS";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr 
-          << theNitfGraphicInfoRecords[index].theGraphicLength
-          << "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMX:" << theReservedForFutureUse1 << "\n"
-       << prefix << std::setw(24) << "NUMT:" 
-       << theNumberOfTextFileInfoRecords << "\n";
-   
-   for (index = 0; index < theNitfTextFileInfoRecords.size(); ++index)
-   {
-      ostringstream os;
-      os << setw(3) << setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LTSH";
-      tmpStr += os.str();
-      
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfTextFileInfoRecords[index].theTextFileSubheaderLength
-          << "\n";
-
-      tmpStr = "LT";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfTextFileInfoRecords[index].theTextFileLength << "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMDES:" << theNumberOfDataExtSegInfoRecords
-       << "\n";
-
-   for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
-   {
-      ostringstream os;
-      os << setw(3) << setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LDSH";
-      tmpStr += os.str();
-      
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
-          << "\n";
-
-      tmpStr = "LD";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfDataExtSegInfoRecords[index].theDataExtSegLength
-          << "\n";
-   }
-
-   out << prefix << std::setw(24) << "NUMRES:"
-       << theNumberOfResExtSegInfoRecords << "\n";
-   
-   for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
-   {
-      ostringstream os;
-      os << setw(3) << setfill('0') << (index+1) << ":";
-
-      ossimString tmpStr = "LRESSH";
-      tmpStr += os.str();
-      
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
-          << "\n";
-
-      tmpStr = "LRE";
-      tmpStr += os.str();
-
-      out << prefix << std::setw(24) << tmpStr
-          << theNitfResExtSegInfoRecords[index].theResExtSegLength
-          << "\n";
-   }
-   
-   out << prefix << std::setw(24) << "UDHDL:"
-       << theUserDefinedHeaderDataLength
-       << "\n"
-       << prefix << std::setw(24) << "UDHOFL:"
-       << theUserDefinedHeaderOverflow
-       << "\n"
-       << prefix << std::setw(24) << "XHDL:"
-       << theExtendedHeaderDataLength
-       << "\n"
-       << prefix << std::setw(24) << "XHDLOFL:"
-       << theExtendedHeaderDataOverflow
-       << "\n";
-
-   return ossimNitfFileHeader::print(out, prefix);
-}
-
-ossimNitfImageHeader* ossimNitfFileHeaderV2_1::allocateImageHeader()const
-{
-   return new ossimNitfImageHeaderV2_1;
-}
-
-ossimNitfTextHeader *ossimNitfFileHeaderV2_1::allocateTextHeader()const
-{
-   return new ossimNitfTextHeaderV2_0;
-}
-
-ossimNitfDataExtensionSegment* ossimNitfFileHeaderV2_1::allocateDataExtSegment()const
-{
-   return new ossimNitfDataExtensionSegmentV2_1;
-}
-
-bool ossimNitfFileHeaderV2_1::isEncrypted()const
-{
-   return (theEncryption[0]=='1');
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfImages()const
-{
-   return (ossim_int32)theNitfImageInfoRecords.size();
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfTextSegments()const
-{
-   return static_cast<ossim_int32>(theNitfTextFileInfoRecords.size());
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getHeaderSize()const
-{
-   return theHeaderSize;
-}
-
-ossim_int64 ossimNitfFileHeaderV2_1::getFileSize()const
-{
-   ossimString temp = theFileLength;
-
-   if(temp == "999999999999")
-   {
-      return -1;
-   }
-   else
-   {
-      return temp.toInt64();
-   }
-}
-
-const char* ossimNitfFileHeaderV2_1::getVersion()const
-{
-   return &theFileTypeVersion[4];
-}
-
-
-void ossimNitfFileHeaderV2_1::clearFields()
-{
-   memcpy(theFileTypeVersion, "NITF02.10", 9);
-   memcpy(theComplexityLevel, "01", 2);
-   memcpy(theSystemType, "BF01", 4);
-   memset(theOriginatingStationId, ' ', 10);
-   memset(theDateTime, ' ', 14);
-   memset(theFileTitle, ' ', 80);
-   memset(theSecurityClassification, ' ', 1);
-   memset(theSecurityClassificationSys, ' ', 2);
-   memset(theCodewords, ' ', 11);
-   memset(theControlAndHandling, ' ', 2);
-   memset(theReleasingInstructions, ' ', 20);
-   memset(theDeclassificationType, ' ', 2);
-   memset(theDeclassificationDate, ' ', 8);
-   memset(theDeclassificationExemption, ' ', 4);
-   memset(theDowngrade, ' ', 1);
-   memset(theDowngradingDate, ' ', 8);
-   memset(theClassificationText, ' ', 43);
-   memset(theClassificationAuthorityType, ' ', 1);
-   memset(theClassificationAuthority, ' ', 40);
-   memset(theClassificationReason, ' ', 1);
-   memset(theSecuritySourceDate, ' ', 8);
-   memset(theSecurityControlNumber, ' ', 15);
-   memset(theCopyNumber, '0', 5);
-   memset(theNumberOfCopies, '0', 5);
-   memset(theEncryption, ' ', 1);
-   memset(theFileBackgroundColor, 0, 3);
-   memset(theOriginatorsName, ' ', 24);
-   memset(theOriginatorsPhone, ' ', 18);
-   memset(theFileLength, ' ', 12);
-   memset(theHeaderLength, ' ', 6);
-   memset(theNumberOfImageInfoRecords, '0', 3);
-   memset(theNumberOfGraphicInfoRecords, '0', 3);
-   memset(theReservedForFutureUse1, '0', 3);
-   memset(theNumberOfTextFileInfoRecords, '0', 3);
-   memset(theNumberOfDataExtSegInfoRecords, '0', 3);
-   memset(theNumberOfResExtSegInfoRecords, '0', 3);
-   memset(theUserDefinedHeaderDataLength, '0', 5);
-   memset(theUserDefinedHeaderOverflow, '0',3);
-   memset(theExtendedHeaderDataLength, '0',5);
-   memset(theExtendedHeaderDataOverflow, '0', 3);
-   theFileTypeVersion[9] = '\0';
-   theComplexityLevel[2] = '\0';
-   theSystemType[4] = '\0';
-   theOriginatingStationId[10] = '\0';
-   theDateTime[14] = '\0';
-   theFileTitle[80] = '\0';
-   theSecurityClassification[1] = '\0';
-   theSecurityClassificationSys[2] = '\0';
-   theCodewords[11] = '\0';
-   theControlAndHandling[2] = '\0';
-   theReleasingInstructions[20] = '\0';
-   theDeclassificationType[2] = '\0';
-   theDeclassificationDate[8] = '\0';
-   theDeclassificationExemption[4] = '\0';
-   theDowngrade[1] = '\0';
-   theDowngradingDate[8] = '\0';
-   theClassificationText[43] = '\0';
-   theClassificationAuthorityType[1] = '\0';
-   theClassificationAuthority[40] = '\0';
-   theClassificationReason[1] = '\0';
-   theSecuritySourceDate[8] = '\0';
-   theSecurityControlNumber[15] = '\0';
-   theCopyNumber[5] = '\0';
-   theNumberOfCopies[5] = '\0';
-   theEncryption[1] = '\0';
-   theOriginatorsName[24] = '\0';
-   theOriginatorsPhone[18] = '\0';
-   theFileLength[12] = '\0';
-   theHeaderLength[6] = '\0';
-   theNumberOfImageInfoRecords[3] = '\0';
-   theNumberOfGraphicInfoRecords[3] = '\0';
-   theReservedForFutureUse1[3] = '\0';
-   theNumberOfTextFileInfoRecords[3] = '\0';
-   theNumberOfDataExtSegInfoRecords[3] = '\0';
-   theNumberOfResExtSegInfoRecords[3] = '\0';
-   theUserDefinedHeaderDataLength[5] = '\0';
-   theUserDefinedHeaderOverflow[3] = '\0';
-   theExtendedHeaderDataLength[5] = '\0';
-   theExtendedHeaderDataOverflow[3] = '\0';
-
-   theHeaderSize = 0;
-}
-
-void ossimNitfFileHeaderV2_1::readImageInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfImages = ossimString(theNumberOfImageInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfImageInfoRecords.clear();
-   for(index=0; index < numberOfImages; index++)
-   {
-      ossimNitfImageInfoRecordV2_1 temp;
-
-      
-      in.read(temp.theImageSubheaderLength, 6);
-      in.read(temp.theImageLength, 10);
-      theHeaderSize += 16;
-
-      temp.theImageSubheaderLength[6] = '\0';
-      temp.theImageLength[10] = '\0';
-      
-      theNitfImageInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::readGraphicInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfGraphics = ossimString(theNumberOfGraphicInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfGraphicInfoRecords.clear();
-   
-   for(index=0; index < numberOfGraphics; index++)
-   {
-      ossimNitfGraphicInfoRecordV2_1 temp;
-
-      
-      in.read(temp.theGraphicSubheaderLength, 4);
-      in.read(temp.theGraphicLength, 6);
-      theHeaderSize += 10;
-
-      temp.theGraphicSubheaderLength[4] = '\0';
-      temp.theGraphicLength[6] = '\0';
-      
-      theNitfGraphicInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::readTextFileInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfTextFiles = ossimString(theNumberOfTextFileInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfTextFileInfoRecords.clear();
-   for(index=0; index < numberOfTextFiles; index++)
-   {
-      ossimNitfTextFileInfoRecordV2_1 temp;
-      
-      in.read(temp.theTextFileSubheaderLength, 4);
-      in.read(temp.theTextFileLength, 5);
-      theHeaderSize += 9;
-      
-      temp.theTextFileSubheaderLength[4] = '\0';
-      temp.theTextFileLength[5] = '\0';
-      
-      theNitfTextFileInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::readDataExtSegInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfDataExtSegs = ossimString(theNumberOfDataExtSegInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfDataExtSegInfoRecords.clear();
-   for(index=0; index < numberOfDataExtSegs; index++)
-   {
-      ossimNitfDataExtSegInfoRecordV2_1 temp;
-      
-      in.read(temp.theDataExtSegSubheaderLength, 4);
-      in.read(temp.theDataExtSegLength, 9);
-      theHeaderSize += 13;
-
-      temp.theDataExtSegSubheaderLength[4] = '\0';
-      temp.theDataExtSegLength[9]          = '\0';
-
-      theNitfDataExtSegInfoRecords.push_back(temp);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::readResExtSegInfoRecords(std::istream &in)
-{
-   ossim_int32 numberOfResExtSegs = ossimString(theNumberOfResExtSegInfoRecords).toInt32();
-   ossim_int32 index;
-
-   theNitfResExtSegInfoRecords.clear();
-   for(index=0; index < numberOfResExtSegs; index++)
-   {
-      ossimNitfResExtSegInfoRecordV2_1 temp;
-
-      in.read(temp.theResExtSegSubheaderLength, 4);
-      in.read(temp.theResExtSegLength, 7);
-      theHeaderSize += 11;
-
-      temp.theResExtSegSubheaderLength[4] = '\0';
-      temp.theResExtSegLength[7]          = '\0';
-      
-      theNitfResExtSegInfoRecords.push_back(temp);      
-   }
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfLabels()const
-{
-   return 0;
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfSymbols()const
-{
-   return 0;
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfGraphics()const
-{
-   return theNitfGraphicInfoRecords.size();
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfDataExtSegments()const
-{
-   return theNitfDataExtSegInfoRecords.size();
-}
-
-ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfReservedExtSegments()const
-{
-   return theNitfResExtSegInfoRecords.size();
-}
-
-const char* ossimNitfFileHeaderV2_1::getDateTime()const
-{
-   return theDateTime;
-}
-
-ossimDrect ossimNitfFileHeaderV2_1::getImageRect()const
-{
-   return theImageRect;
-}
-
-void ossimNitfFileHeaderV2_1::addImageInfoRecord(const ossimNitfImageInfoRecordV2_1& recordInfo)
-{
-   theNitfImageInfoRecords.push_back(recordInfo);
-
-   setNumberOfImageInfoRecords(theNitfImageInfoRecords.size());
-}
-
-void ossimNitfFileHeaderV2_1::addTextInfoRecord(const ossimNitfTextFileInfoRecordV2_1& recordInfo)
-{
-   theNitfTextFileInfoRecords.push_back(recordInfo);
-
-   setNumberOfTextInfoRecords(theNitfTextFileInfoRecords.size());
-}
-
-void ossimNitfFileHeaderV2_1::addDataExtSegInfoRecord(const ossimNitfDataExtSegInfoRecordV2_1& recordInfo)
-{
-   theNitfDataExtSegInfoRecords.push_back(recordInfo);
-
-   setNumberOfDataExtSegInfoRecords(theNitfDataExtSegInfoRecords.size());
-}
-
-
-void ossimNitfFileHeaderV2_1::replaceImageInfoRecord(int i, const ossimNitfImageInfoRecordV2_1& recordInfo)
-{
-   if ( i < static_cast<int>(theNitfImageInfoRecords.size()) )
-   {
-      theNitfImageInfoRecords[i] = recordInfo;
-   }
-}
-
-ossimNitfSymbolHeader *ossimNitfFileHeaderV2_1::allocateSymbolHeader()const
-{
-   return 0;
-}
-
-ossimNitfLabelHeader *ossimNitfFileHeaderV2_1::allocateLabelHeader()const
-{
-   return 0;
-}
-
-void ossimNitfFileHeaderV2_1::initializeAllOffsets()
-{
-   // this will be a running tally 
-   ossim_uint64 tally = theHeaderSize;
-   ossim_uint64 idx = 0;
-
-   // clear out all offset inforamtion and begin populating them
-   theImageOffsetList.clear();
-   theGraphicOffsetList.clear();
-   theTextFileOffsetList.clear();
-   theDataExtSegOffsetList.clear();
-
-   for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
-   {
-      theImageOffsetList.push_back(ossimNitfImageOffsetInformation(tally,
-                                                                   tally + theNitfImageInfoRecords[idx].getHeaderLength()));
-      tally += theNitfImageInfoRecords[idx].getTotalLength();
-   }
-   for(idx = 0; idx < theNitfGraphicInfoRecords.size(); ++idx)
-   {
-      theGraphicOffsetList.push_back(ossimNitfGraphicOffsetInformation(tally,
-                                                                     tally + theNitfGraphicInfoRecords[idx].getHeaderLength()));
-      tally += theNitfGraphicInfoRecords[idx].getTotalLength();
-   }
-
-   for(idx = 0; idx < theNitfTextFileInfoRecords.size(); ++idx)
-   {
-      theTextFileOffsetList.push_back(ossimNitfTextOffsetInformation(tally,
-                                                                     tally + theNitfTextFileInfoRecords[idx].getHeaderLength()));
-      tally += theNitfTextFileInfoRecords[idx].getTotalLength();
-   }
-
-   for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
-   {
-      theDataExtSegOffsetList.push_back(ossimNitfDataExtSegOffsetInformation(tally,
-                                                                             tally + theNitfDataExtSegInfoRecords[idx].getHeaderLength()));
-      tally += theNitfDataExtSegInfoRecords[idx].getTotalLength();
-   }
-}
-
-ossimNitfImageHeader*
-ossimNitfFileHeaderV2_1::getNewImageHeader(ossim_uint32 imageNumber,
-                                           std::istream& in)const
-{
-   ossimNitfImageHeader *result = 0;
-   
-   if( (getNumberOfImages() > 0) && (imageNumber < theImageOffsetList.size()) )
-   {
-      result = allocateImageHeader();
-      in.seekg(theImageOffsetList[imageNumber].theImageHeaderOffset, ios::beg);
-      ((ossimNitfImageHeaderV2_1*)result)->parseStream(in, this);
-   }
-   else
-   {
-#if 0
-      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimNitfFileHeaderV2_1::getNewImageHeader: "
-                                          << "\nNo images in file or image number (" << imageNumber
-                                          << ") is out of range!\n";
-#endif
-   }
-   
-   return result;
-}
-
-ossimNitfSymbolHeader*
-ossimNitfFileHeaderV2_1::getNewSymbolHeader(ossim_uint32 /* symbolNumber */,
-                                            std::istream& /* in */)const
-{
-   // Currently not implemented...
-   
-   ossimNitfSymbolHeader *result = 0;
-
-
-   
-   return result;
-}
-
-ossimNitfLabelHeader*
-ossimNitfFileHeaderV2_1::getNewLabelHeader(ossim_uint32 /* labelNumber */,
-                                           std::istream& /* in */)const
-{
-   // Currently not implemented...
-   ossimNitfLabelHeader *result = 0;
-   
-   return result;
-}
-
-ossimNitfTextHeader*
-ossimNitfFileHeaderV2_1::getNewTextHeader(ossim_uint32 /* textNumber */,
-                                          std::istream& /* in */)const
-{
-   // Currently not implemented...
-   ossimNitfTextHeader *result = 0;
-   
-   return result;
-}
-
-ossimNitfDataExtensionSegment*
-ossimNitfFileHeaderV2_1::getNewDataExtensionSegment(
-   ossim_int32 dataExtNumber, std::istream&  in )const
-{
-   ossimNitfDataExtensionSegment *result = 0;
-
-   if((getNumberOfDataExtSegments() > 0) &&
-      (dataExtNumber < (ossim_int32)theNitfDataExtSegInfoRecords.size()) &&
-      (dataExtNumber >= 0))
-   {
-      result = allocateDataExtSegment();
-      ossimIFStream64::seekg64(in, theDataExtSegOffsetList[dataExtNumber].theDataExtSegHeaderOffset, ios::beg);
-      result->parseStream(in, theNitfDataExtSegInfoRecords[dataExtNumber].getDataExtSegLength());
-   }
-   
-   return result;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getSecurityClassificationSys()const
-{
-   return theSecurityClassificationSys;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getCodeWords()const
-{
-   return theCodewords;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getControlAndHandling()const
-{
-   return theControlAndHandling;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getReleasingInstructions()const
-{
-   return theReleasingInstructions;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getDeclassificationType()const
-{
-   return theDeclassificationType;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getDeclassificationDate()const
-{
-   return theDeclassificationDate;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getDeclassificationExemption()const
-{
-   return theDeclassificationExemption;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getDowngrade()const
-{
-   return theDowngrade;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getDowngradingDate()const
-{
-   return theDowngradingDate;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getClassificationText()const
-{
-   return theClassificationText;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getClassificationAuthorityType()const
-{
-   return theClassificationAuthorityType;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getClassificationAuthority()const
-{
-   return theClassificationAuthority;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getClassificationReason()const
-{
-   return theClassificationReason;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getSecuritySourceDate()const
-{
-   return theSecuritySourceDate;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getSecurityControlNumber()const
-{
-   return theSecurityControlNumber;
-}
-
-void ossimNitfFileHeaderV2_1::getBackgroundColor(ossim_uint8& r,
-                                                 ossim_uint8& g,
-                                                 ossim_uint8& b)const
-{
-   r = theFileBackgroundColor[0];
-   g = theFileBackgroundColor[1];
-   b = theFileBackgroundColor[2];
-}
-
-ossimString ossimNitfFileHeaderV2_1::getOriginatorsName()const
-{
-   return theOriginatorsName;
-}
-
-ossimString ossimNitfFileHeaderV2_1::getOriginatorsPhone()const
-{
-   return theOriginatorsPhone;
-}
-
-void ossimNitfFileHeaderV2_1::setFileLength(ossim_uint64 fileLength)
-{
-   ostringstream out;
-
-   out << std::setw(12)
-       << std::setfill('0')
-       << std::setiosflags(ios::right)
-       << fileLength;
-
-   memcpy(theFileLength, out.str().c_str(), 12);
-}
-
-
-
-void ossimNitfFileHeaderV2_1::setNumberOfGraphicInfoRecords(ossim_uint64 num)
-	{
-		if (num < 1000)
-   {
-      ostringstream out;
-      
-      out << std::setw(3)
-          << std::setfill('0')
-          << std::setiosflags(ios::right)
-          << num;
-      
-      memcpy(theNumberOfGraphicInfoRecords, out.str().c_str(), 3);
-   }
-   else
-   {
-      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfGraphicInfoRecords:";
-      s += " ERROR\nExceeded max number of 999!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-		
-	}
-
-void ossimNitfFileHeaderV2_1::setNumberOfDataExtSegInfoRecords(ossim_uint64 num)
-{
-   if (num < 1000)
-   {
-      ostringstream out;
-      
-      out << std::setw(3)
-          << std::setfill('0')
-          << std::setiosflags(ios::right)
-          << num;
-      
-      memcpy(theNumberOfDataExtSegInfoRecords, out.str().c_str(), 3);
-   }
-   else
-   {
-      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfDataExtSegInfoRecords:";
-      s += " ERROR\nExceeded max number of 999!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-}
-
-
-void ossimNitfFileHeaderV2_1::setNumberOfTextInfoRecords(ossim_uint64 num)
-{
-   if (num < 1000)
-   {
-      ostringstream out;
-      
-      out << std::setw(3)
-          << std::setfill('0')
-          << std::setiosflags(ios::right)
-          << num;
-      
-      memcpy(theNumberOfTextFileInfoRecords, out.str().c_str(), 3);
-   }
-   else
-   {
-      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfTextRecords:";
-      s += " ERROR\nExceeded max number of 999!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-}
-
-
-void ossimNitfFileHeaderV2_1::setNumberOfImageInfoRecords(ossim_uint64 num)
-{
-   if (num < 1000)
-   {
-      ostringstream out;
-      
-      out << std::setw(3)
-          << std::setfill('0')
-          << std::setiosflags(ios::right)
-          << num;
-      
-      memcpy(theNumberOfImageInfoRecords, out.str().c_str(), 3);
-   }
-   else
-   {
-      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfImageInfoRecords:";
-      s += " ERROR\nExceeded max image info number of 999!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::setHeaderLength(ossim_uint64 headerLength)
-{
-   ostringstream out;
-
-   out << std::setw(6)
-       << std::setfill('0')
-       << std::setiosflags(ios::right)
-       << headerLength;
-
-   memcpy(theHeaderLength, out.str().c_str(), 6);
-}
-
-void ossimNitfFileHeaderV2_1::setSecurityClassificationSys(const ossimString& value)
-{
-   std::ostringstream out;
-   
-   out << std::setw(2)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << ossimString(value).trim();
-
-   memcpy(theSecurityClassificationSys, out.str().c_str(), 2);
-}
-
-void ossimNitfFileHeaderV2_1::setCodeWords(const ossimString& codeWords)
-{
-   std::ostringstream out;
-   
-   out << std::setw(11)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << ossimString(codeWords).trim();
-
-   memcpy(theCodewords, out.str().c_str(), 11);
-}
-
-void ossimNitfFileHeaderV2_1::setControlAndHandling(const ossimString& controlAndHandling)
-{
-   std::ostringstream out;
-   
-   out << std::setw(2)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << ossimString(controlAndHandling).trim();
-
-   memcpy(theControlAndHandling, out.str().c_str(), 2);
-}
-
-void ossimNitfFileHeaderV2_1::setReleasingInstructions(const ossimString& releasingInstructions)
-{
-   std::ostringstream out;
-   
-   out << std::setw(20)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << ossimString(releasingInstructions).trim();
-
-   memcpy(theReleasingInstructions, out.str().c_str(), 20);
-}
-
-void ossimNitfFileHeaderV2_1::setDeclassificationType(const ossimString& declassType)
-{
-   std::ostringstream out;
-   
-   out << std::setw(2)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << declassType.trim();
-
-   memcpy(theDeclassificationType, out.str().c_str(), 2);
-}
-
-void ossimNitfFileHeaderV2_1::setDeclassificationDate(const ossimLocalTm& d)
-{
-   memcpy(theDeclassificationDate, formatDate(getVersion(), d).c_str(), 8);
-}
-
-void ossimNitfFileHeaderV2_1::setDeclassificationDate(const ossimString& d)
-{
-   if(d.size() >=8)
-   {
-      memcpy(theDeclassificationDate, d.c_str(), 8);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::setDeclassificationExemption(const ossimString& exemption)
-{
-   std::ostringstream out;
-   
-   out << std::setw(4)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << exemption.trim();
-
-   memcpy(theDeclassificationExemption, out.str().c_str(), 4);
-}
-
-void ossimNitfFileHeaderV2_1::setDowngrade(const ossimString& downgrade)
-{
-   std::ostringstream out;
-   
-   out << std::setw(1)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << downgrade.trim();
-
-   memcpy(theDowngrade, out.str().c_str(), 1);
-}
-
-void ossimNitfFileHeaderV2_1::setDowngradingDate(const ossimLocalTm& d)
-{
-   memcpy(theDowngradingDate, formatDate(getVersion(), d).c_str(), 8);
-}
-
-void ossimNitfFileHeaderV2_1::setDowngradingDate(const ossimString& d)
-{
-   if(d.size() >=8)
-   {
-      memcpy(theDowngradingDate, d.c_str(), 8);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::setClassificationText(const ossimString& classificationText)
-{
-   std::ostringstream out;
-   
-   out << std::setw(43)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << classificationText.trim();
-
-   memcpy(theClassificationText, out.str().c_str(), 43);
-}
-
-void ossimNitfFileHeaderV2_1::setClassificationAuthorityType(const ossimString& authorityType)
-{
-   std::ostringstream out;
-   
-   out << std::setw(1)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << authorityType.trim();
-
-   memcpy(theClassificationAuthorityType, out.str().c_str(), 1);
-}
-
-void ossimNitfFileHeaderV2_1::setClassificationAuthority(const ossimString& authority)
-{
-   std::ostringstream out;
-   
-   out << std::setw(40)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << authority.trim();
-
-   memcpy(theClassificationAuthority, out.str().c_str(), 40);
-}
-
-void ossimNitfFileHeaderV2_1::setClassificationReason(const ossimString& reason)
-{
-   std::ostringstream out;
-   
-   out << std::setw(1)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << reason.trim();
-
-   memcpy(theClassificationReason, out.str().c_str(), 1);
-}
-
-void ossimNitfFileHeaderV2_1::setSecuritySourceDate(const ossimLocalTm& d)
-{
-   memcpy(theSecuritySourceDate, formatDate(getVersion(), d).c_str(), 8);
-}
-
-void ossimNitfFileHeaderV2_1::setSecuritySourceDate(const ossimString& d)
-{
-   if(d.size() >=8)
-   {
-      memcpy(theSecuritySourceDate, d.c_str(), 8);
-   }
-}
-
-void ossimNitfFileHeaderV2_1::setSecurityControlNumber(const ossimString& number)
-{
-   std::ostringstream out;
-   
-   out << std::setw(15)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << number.trim();
-
-   memcpy(theSecurityControlNumber, out.str().c_str(), 15);
-}
-
-void ossimNitfFileHeaderV2_1::setFileBackgroundColor(ossim_uint8 r,
-                                                     ossim_uint8 g,
-                                                     ossim_uint8 b)
-{
-   theFileBackgroundColor[0] = r;
-   theFileBackgroundColor[1] = g;
-   theFileBackgroundColor[2] = b;
-}
-
-void ossimNitfFileHeaderV2_1::setOriginatorsName(const ossimString& name)
-{
-   std::ostringstream out;
-   
-   out << std::setw(24)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << name.trim();
-   
-   memcpy(theOriginatorsName, out.str().c_str(), 24);
-}
-
-void ossimNitfFileHeaderV2_1::setOriginatorsPhone(const ossimString& phone)
-{
-   std::ostringstream out;
-   
-   out << std::setw(18)
-       << std::setfill(' ')
-       << std::setiosflags(ios::left)
-       << phone.trim();
-   
-   memcpy(theOriginatorsPhone, out.str().c_str(), 18);
-}
-
-bool ossimNitfFileHeaderV2_1::loadState(const ossimKeywordlist& kwl,
-                                        const char* prefix)
-{
-   // Note: Currently not looking up all fieds only ones that make sense.
-   
-   const char* lookup;
-
-   lookup = kwl.find( prefix, FSCLSY_KW);
-   if ( lookup )
-   {
-      setSecurityClassificationSys( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSDCTP_KW);
-   if ( lookup )
-   {
-      setDeclassificationType( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSDCDT_KW);
-   if ( lookup )
-   {
-      setDeclassificationDate( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSDCXM_KW);
-   if ( lookup )
-   {
-      setDeclassificationExemption( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSDG_KW);
-   if ( lookup )
-   {
-      setDowngrade( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSDGDT_KW);
-   if ( lookup )
-   {
-      setDowngradingDate( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSCLTX_KW );
-   if ( lookup )
-   {
-      setClassificationText( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSCATP_KW );
-   if ( lookup )
-   {
-      setClassificationAuthorityType( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSCRSN_KW );
-   if ( lookup )
-   {
-      setClassificationReason( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSSRDT_KW );
-   if ( lookup )
-   {
-      setClassificationReason( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FSSRDT_KW);
-   if ( lookup )
-   {
-      setSecuritySourceDate( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, FBKGC_KW );
-   if ( lookup )
-   {
-      ossimString value = lookup;
-      std::vector<ossimString> splitString;
-      value = value.trim();
-      value.split(splitString, " ");
-      if(splitString.size() == 3)
-      {
-         setFileBackgroundColor((ossim_uint8)splitString[0].toUInt32(), 
-                                (ossim_uint8)splitString[1].toUInt32(), 
-                                (ossim_uint8)splitString[2].toUInt32());
-      }
-   }  
-   
-   return ossimNitfFileHeaderV2_X::loadState(kwl, prefix);
-}
-
-void ossimNitfFileHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid()) return;
-   
-   ossimString name = property->getName();
-
-   // Make case insensitive:
-   name.upcase();
-   
-   if(name == FSCLSY_KW)
-   {
-     setSecurityClassificationSys(property->valueToString()); 
-   }
-   else if(name == FSDCTP_KW)
-   {
-      setDeclassificationType(property->valueToString());
-   }
-   else if(name == FSDCDT_KW)
-   {
-      setDeclassificationDate(property->valueToString());
-   }
-   else if(name == FSDCXM_KW)
-   {
-      setDeclassificationExemption(property->valueToString());
-   }
-   else if(name == FSDG_KW)
-   {
-      setDowngrade(property->valueToString());
-   }
-   else if(name == FSDGDT_KW)
-   {
-      setDowngradingDate(property->valueToString());
-   }
-   else if(name == FSCLTX_KW)
-   {
-      setClassificationText(property->valueToString());
-   }
-   else if(name == FSCATP_KW)
-   {
-      setClassificationAuthorityType(property->valueToString());
-   }
-   else if(name == FSCRSN_KW)
-   {
-      setClassificationReason(property->valueToString());
-   }
-   else if(name == FSSRDT_KW)
-   {
-      setSecuritySourceDate(property->valueToString());
-   }
-   else if(name == FBKGC_KW)
-   {
-      ossimColorProperty* colorProp = PTR_CAST(ossimColorProperty, property.get());
-      if (colorProp)
-      {
-         ossim_uint8 r = colorProp->getRed();
-         ossim_uint8 g = colorProp->getGreen();
-         ossim_uint8 b = colorProp->getBlue();
-
-         setFileBackgroundColor(r, g, b);
-      }
-      else
-      {
-        ossimString value = property->valueToString();
-        std::vector<ossimString> splitString;
-        value = value.trim();
-        value.split(splitString, " ");
-        if(splitString.size() == 3)
-        {
-           setFileBackgroundColor((ossim_uint8)splitString[0].toUInt32(), 
-                                  (ossim_uint8)splitString[1].toUInt32(), 
-                                  (ossim_uint8)splitString[2].toUInt32());
-        }
-      }
-
-   }
-   else
-   {
-      ossimNitfFileHeaderV2_X::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitfFileHeaderV2_1::getProperty(const ossimString& name)const
-{
-   ossimProperty* property = 0;
-   ossimStringProperty* stringProperty = 0;
-   ossimColorProperty* colorProperty = 0;
-
-   if(name == CLEVEL_KW)
-   {
-      property = new ossimStringProperty(name, getComplexityLevel().trim());
-   }
-   else if(name == FSCLSY_KW)
-   {
-      property = new ossimStringProperty(name,
-                                               getSecurityClassificationSys().trim());
-   }
-   else if(name == FSDCTP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getDeclassificationType().trim());
-   }
-   else if(name == FSDCDT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getDeclassificationDate().trim());
-   }
-   else if(name == FSDCXM_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getDeclassificationExemption().trim());
-   }
-   else if(name == FSDG_KW)
-   {
-      stringProperty = new ossimStringProperty(name,
-                                               getDowngrade().trim(),
-                                               false);
-      
-      stringProperty->addConstraint("");
-      stringProperty->addConstraint("S");
-      stringProperty->addConstraint("C");
-      stringProperty->addConstraint("R");
-
-      property = stringProperty;
-   }
-   else if(name == FSDGDT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getDowngradingDate().trim());
-   }
-   else if(name == FSCLTX_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getClassificationText().trim());
-   }
-   else if(name == FSCATP_KW)
-   {
-      stringProperty = new ossimStringProperty(name,
-                                               getClassificationAuthorityType().trim(),
-                                               false);
-      
-      stringProperty->addConstraint("");
-      stringProperty->addConstraint("O");
-      stringProperty->addConstraint("D");
-      stringProperty->addConstraint("M");
-      
-      property = stringProperty;
-   }
-   else if(name == FSCRSN_KW)
-   {
-      stringProperty = new ossimStringProperty(name,
-                                               getClassificationReason().trim(),
-                                               false);
-      
-      stringProperty->addConstraint("");
-      stringProperty->addConstraint("A");
-      stringProperty->addConstraint("B");
-      stringProperty->addConstraint("C");
-      stringProperty->addConstraint("D");
-      stringProperty->addConstraint("E");
-      stringProperty->addConstraint("F");
-      stringProperty->addConstraint("G");
-      
-      property = stringProperty;
-   }
-   else if(name == FSSRDT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getSecuritySourceDate().trim());
-   }
-   else if(name == FBKGC_KW)
-   {
-      ossim_uint8 r, g, b;
-      getBackgroundColor(r, g, b);
-      
-      colorProperty = new ossimColorProperty(name,
-                                             ossimRgbVector(r, g, b));
-
-      property = colorProperty;
-   }
-   else if(name == ONAME_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theOriginatorsName).trim());
-   }
-   else if(name == OPHONE_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theOriginatorsPhone).trim());
-   }
-   else
-   {
-      return ossimNitfFileHeaderV2_X::getProperty(name);
-   }
-   return property;
-}
-
-
-void ossimNitfFileHeaderV2_1::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfFileHeaderV2_X::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(FSCLSY_KW);
-   propertyNames.push_back(FSDCTP_KW);
-   propertyNames.push_back(FSDCDT_KW);
-   propertyNames.push_back(FSDCXM_KW);
-   propertyNames.push_back(FSDG_KW);
-   propertyNames.push_back(FSDGDT_KW);
-   propertyNames.push_back(FSCLTX_KW);
-   propertyNames.push_back(FSCATP_KW);
-   propertyNames.push_back(FSCRSN_KW);
-   propertyNames.push_back(FSSRDT_KW);
-   propertyNames.push_back(FBKGC_KW);
-}
-
-void ossimNitfFileHeaderV2_1::addTag(ossimNitfTagInformation tag, bool unique)
-{
-   if (unique)
-   {
-      removeTag(tag.getTagName());
-   }
-   theTagList.push_back(tag);
-}
-
-void ossimNitfFileHeaderV2_1::removeTag(const ossimString& tagName)
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theTagList.size(); ++idx)
-   {
-      if(theTagList[idx].getTagName() == tagName)
-      {
-         theTagList.erase(theTagList.begin() + idx);
-         return;
-      }
-   }
-}
-
-bool ossimNitfFileHeaderV2_1::takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
-   ossim_uint32 potentialDesIndex, bool userDefinedTags)
-{
-   overflowTags.clear();
-   std::vector<ossimNitfTagInformation>::iterator iter;
-   std::vector<ossimNitfTagInformation> specifiedTags;
-   const ossimString tagType(userDefinedTags ? "UDHD" : "XHD");
-   for (iter = theTagList.begin(); iter != theTagList.end(); ++iter)
-   {
-      if (iter->getTagType() == tagType)
-      {
-         specifiedTags.push_back(*iter);
-      }
-   }
-
-   std::sort(specifiedTags.begin(), specifiedTags.end());
-
-   ossim_uint32 totalSize = 0;
-   const ossim_uint32 maxSize = 9996;
-   for (iter = specifiedTags.begin(); iter != specifiedTags.end() &&
-      totalSize + iter->getTotalTagLength() <= maxSize; ++iter)
-   {
-      totalSize += iter->getTotalTagLength();
-   }
-
-   for (; iter != specifiedTags.end(); ++iter)
-   {
-      overflowTags.push_back(*iter);
-      removeTag(iter->getTagName());
-   }
-
-   // If there are no overflow tags, then no DES is required
-   if (overflowTags.empty() == true)
-   {
-      potentialDesIndex = 0;
-   }
-
-   std::ostringstream overflowDes;
-   overflowDes << std::setw(3)
-           << std::setfill('0')
-           << std::setiosflags(ios::right)
-           << potentialDesIndex;
-
-   std::ostringstream tagLength;
-   tagLength << std::setw(5)
-           << std::setfill('0')
-           << std::setiosflags(ios::right)
-           << totalSize;
-
-   // Even if no overflow tags exist, update the fields
-   if (userDefinedTags)
-   {
-      strcpy(theUserDefinedHeaderOverflow, overflowDes.str().c_str());
-      strcpy(theUserDefinedHeaderDataLength, tagLength.str().c_str());
-   }
-   else
-   {
-      strcpy(theExtendedHeaderDataOverflow, overflowDes.str().c_str());
-      strcpy(theExtendedHeaderDataLength, tagLength.str().c_str());
-   }
-
-   return (overflowTags.empty() == false);
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp b/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp
deleted file mode 100644
index 3ad0c17..0000000
--- a/ossim/src/ossim/support_data/ossimNitfFileHeaderV2_X.cpp
+++ /dev/null
@@ -1,532 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimNitfFileHeaderV2_X.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-
-#include <iomanip>
-#include <sstream>
-#include <ossim/base/ossimDate.h> /* for ossimLocalTm */
-#include <ossim/base/ossimDateProperty.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNumericProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-
-RTTI_DEF1(ossimNitfFileHeaderV2_X, "ossimNitfFileHeaderV2_X", ossimNitfFileHeader);
-static ossimString monthConversionTable[] = {"   ", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
-
-const ossimString ossimNitfFileHeaderV2_X::FILE_TYPE_KW = "FILE_TYPE";
-const ossimString ossimNitfFileHeaderV2_X::VERSION_KW   = "VERSION";
-const ossimString ossimNitfFileHeaderV2_X::FHDR_KW      = "FHDR";
-const ossimString ossimNitfFileHeaderV2_X::CLEVEL_KW    = "CLEVEL";
-const ossimString ossimNitfFileHeaderV2_X::STYPE_KW     = "STYPE";
-const ossimString ossimNitfFileHeaderV2_X::OSTAID_KW    = "OSTAID";
-const ossimString ossimNitfFileHeaderV2_X::FDT_KW       = "FDT";  
-const ossimString ossimNitfFileHeaderV2_X::FTITLE_KW    = "FTITLE";
-const ossimString ossimNitfFileHeaderV2_X::FSCLAS_KW    = "FSCLAS";
-const ossimString ossimNitfFileHeaderV2_X::FSCODE_KW    = "FSCODE";
-const ossimString ossimNitfFileHeaderV2_X::FSCTLH_KW    = "FSCTLH";
-const ossimString ossimNitfFileHeaderV2_X::FSREL_KW     = "FSREL";
-const ossimString ossimNitfFileHeaderV2_X::FSCAUT_KW    = "FSCAUT";
-const ossimString ossimNitfFileHeaderV2_X::FSCTLN_KW    = "FSCTLN";
-const ossimString ossimNitfFileHeaderV2_X::FSCOP_KW     = "FSCOP";
-const ossimString ossimNitfFileHeaderV2_X::FSCPYS_KW    = "FSCPYS";
-const ossimString ossimNitfFileHeaderV2_X::ENCRYP_KW    = "ENCRYP";
-const ossimString ossimNitfFileHeaderV2_X::ONAME_KW     = "ONAME";
-const ossimString ossimNitfFileHeaderV2_X::OPHONE_KW    = "OPHONE";
-
-ossimNitfFileHeaderV2_X::ossimNitfFileHeaderV2_X()
-{
-}
-
-void ossimNitfFileHeaderV2_X::setComplexityLevel(const ossimString& level)
-{
-   ossimNitfCommon::setField(theComplexityLevel, level, 2, std::ios::right, '0');
-}
-
-void ossimNitfFileHeaderV2_X::setSystemType(const ossimString& systemType)
-{
-   ossimNitfCommon::setField(theSystemType, systemType, 4);
-}
-
-void ossimNitfFileHeaderV2_X::setOriginatingStationId(const ossimString& originationId)
-{
-   ossimNitfCommon::setField(theOriginatingStationId, originationId, 10);
-}
-
-ossimString ossimNitfFileHeaderV2_X::formatDate(const ossimString& version,
-                                                const ossimLocalTm& d)
-{
-   // Convert to ZULU as per spec for both versions.
-   ossimLocalTm d1 = d.convertToGmt();
-   
-   std::ostringstream out;
-
-   if(version.contains("2.1"))
-   {
-      out << std::setw(4)
-      << std::setfill('0')
-      << d1.getYear()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getMonth()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getDay()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getHour()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getMin()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getSec();
-   }
-   else
-   {
-      out  << std::setw(2)
-      << std::setfill('0')
-      << d1.getDay()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getHour()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getMin()
-      << std::setw(2)
-      << std::setfill('0')
-      << d1.getSec()
-      << "Z"
-      <<monthConversionTable[d1.getMonth()]
-      << std::setw(2)
-      << std::setfill('0')
-      <<d1.getShortYear();
-      
-   }
-      
-   return out.str();
-}
-
-void ossimNitfFileHeaderV2_X::setDate(const ossimLocalTm& d)
-{
-   memcpy(theDateTime, formatDate(getVersion(), d).c_str(), 14);
-}
-
-void ossimNitfFileHeaderV2_X::setDate(const ossimString& d)
-{
-   if(d.size()==14)
-   {
-      memcpy(theDateTime, d.c_str(), 14);
-   }
-}
-
-void ossimNitfFileHeaderV2_X::setDate()
-{
-   setDate(ossimLocalTm(0));
-}  
-
-void ossimNitfFileHeaderV2_X::setTitle(const ossimString& title)
-{
-   ossimNitfCommon::setField(theFileTitle, title, 80);
-}
-
-void ossimNitfFileHeaderV2_X::setFileSecurityClassification(const ossimString& securityClassification)
-{
-   ossimNitfCommon::setField(theSecurityClassification, securityClassification, 1);
-}
-
-void ossimNitfFileHeaderV2_X::setCopyNumber(const ossimString& copyNumber)
-{
-   if(copyNumber.trim() == "")
-   {
-      memset(theCopyNumber, '0', 5);
-   }
-   else
-   {
-      ossimNitfCommon::setField(theCopyNumber, copyNumber, 5, std::ios::right, '0');
-   }
-}
-
-void ossimNitfFileHeaderV2_X::setNumberOfCopies(const ossimString& numberOfCopies)
-{
-   if(numberOfCopies.trim() == "")
-   {
-      memset(theNumberOfCopies, 0, 5);
-   }
-   else
-   {
-      ossimNitfCommon::setField(theNumberOfCopies, numberOfCopies, 5, std::ios::right, '0');
-   }
-}
-
-void ossimNitfFileHeaderV2_X::setEncryption(const ossimString& encryption)
-{
-   ossimNitfCommon::setField(theEncryption, encryption, 1);
-}
-
-ossimString ossimNitfFileHeaderV2_X::getComplexityLevel()const
-{
-   return theComplexityLevel;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getSystemType()const
-{
-   return theSystemType;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getOriginatingStationId()const
-{
-   return theOriginatingStationId;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getDate()const
-{
-   return theDateTime;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getTitle()const
-{
-   return theFileTitle;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getSecurityClassification()const
-{
-   return theSecurityClassification;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getCopyNumber()const
-{
-   return theCopyNumber;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getNumberOfCopies()const
-{
-   return theNumberOfCopies;
-}
-
-ossimString ossimNitfFileHeaderV2_X::getEncryption()const
-{
-   return theEncryption;
-}
-
-void ossimNitfFileHeaderV2_X::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   if(!property.valid()) return;
-
-   ossimString name = property->getName();
-
-   // Make case insensitive:
-   name.upcase();
-
-   if(name == FHDR_KW)
-   {
-      
-   }
-   else if(name == STYPE_KW)
-   {
-      setSystemType(property->valueToString());
-   }
-   else if(name == OSTAID_KW)
-   {
-      setOriginatingStationId(property->valueToString());
-   }
-   else if(name == FDT_KW)
-   {
-      setDate(property->valueToString());
-   }
-   else if(name == FTITLE_KW)
-   {
-      setTitle(property->valueToString());
-   }
-   else if(name == FSCLAS_KW)
-   {
-      setFileSecurityClassification(property->valueToString());
-   }
-   else if(name == FSCODE_KW)
-   {
-      setCodeWords(property->valueToString()); 
-   }
-   else if(name == FSCTLH_KW)
-   {
-      setControlAndHandling(property->valueToString());
-   }
-   else if(name == FSREL_KW)
-   {
-      setReleasingInstructions(property->valueToString());
-   }
-   else if(name == FSCAUT_KW)
-   {
-      setClassificationAuthority(property->valueToString()); 
-   }
-   else if(name == FSCTLN_KW)
-   {
-      setSecurityControlNumber(property->valueToString());
-   }
-   else if(name == FSCOP_KW)
-   {
-      setCopyNumber(property->valueToString());
-   }
-   else if(name == FSCPYS_KW)
-   {
-      setNumberOfCopies(property->valueToString());
-   }
-   else if(name == ENCRYP_KW)
-   {
-      setEncryption(property->valueToString());
-   }
-   else if(name == ONAME_KW)
-   {
-      setOriginatorsName(property->valueToString());
-   }
-   else if(name == OPHONE_KW)
-   {
-      setOriginatorsPhone(property->valueToString());
-   }
-   else
-   {
-      ossimNitfFileHeader::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitfFileHeaderV2_X::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> property = 0;
-   
-   if(name == FHDR_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(theFileTypeVersion));
-   }
-   else if(name == VERSION_KW)
-   {
-      property = new ossimStringProperty(name, ossimString(getVersion()));
-   }
-   else if(name == FILE_TYPE_KW)
-   {
-      property = new ossimStringProperty(name, "NITF");
-   }
-   else if(name == CLEVEL_KW)
-   {
-      ossimNumericProperty* numericProperty =
-         new ossimNumericProperty(name,
-                                  getComplexityLevel(),
-                                  1,
-                                  99);
-      numericProperty->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT);
-      property = numericProperty;
-      
-   }
-   else if(name == STYPE_KW)
-   {
-      property = new ossimStringProperty(name, getSystemType().trim());
-   }
-   else if(name == OSTAID_KW)
-   {
-      property = new ossimStringProperty(name, getOriginatingStationId().trim());
-   }
-   else if(name == FDT_KW)
-   {
-      property = new ossimStringProperty(name, getDate());
-   }
-   else if(name == FTITLE_KW)
-   {
-      property = new ossimStringProperty(name, getTitle().trim());
-   }
-   else if(name == FSCLAS_KW)
-   {
-      ossimStringProperty* stringProperty =
-         new ossimStringProperty(name,
-                                 getSecurityClassification().trim(),
-                                 false);
-      
-      stringProperty->addConstraint("");
-      stringProperty->addConstraint("T");
-      stringProperty->addConstraint("S");
-      stringProperty->addConstraint("C");
-      stringProperty->addConstraint("R");
-      stringProperty->addConstraint("U");
-      
-      property = stringProperty;
-   }
-   else if(name == FSCODE_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getCodeWords().trim());
-   }
-   else if(name == FSCTLH_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getControlAndHandling().trim());
-   }
-   else if(name == FSREL_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getReleasingInstructions().trim());
-   }
-   else if(name == FSCAUT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getClassificationAuthority().trim());
-   }
-   else if(name == FSCTLN_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getSecurityControlNumber().trim());
-      
-   }
-   else if(name == FSCOP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getCopyNumber().trim());
-   }
-   else if(name == FSCPYS_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getNumberOfCopies().trim());
-   }
-   else if(name == ENCRYP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         getEncryption().trim(),
-                                         false);
-   }
-   else
-   {
-      property = ossimNitfFileHeader::getProperty(name).get();
-   }
-   
-   return property;
-}
-
-bool ossimNitfFileHeaderV2_X::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   bool result = ossimNitfFileHeader::saveState(kwl, prefix);
-   
-   if(result)
-   {
-      kwl.add(prefix, FHDR_KW.c_str(),   theFileTypeVersion);
-      kwl.add(prefix, CLEVEL_KW.c_str(), theComplexityLevel);
-      kwl.add(prefix, STYPE_KW.c_str(),  theSystemType);
-      kwl.add(prefix, OSTAID_KW.c_str(), theOriginatingStationId);
-      kwl.add(prefix, FDT_KW.c_str(),    theDateTime);
-      kwl.add(prefix, FTITLE_KW.c_str(), theFileTitle);
-      kwl.add(prefix, FSCLAS_KW.c_str(), theSecurityClassification);
-      kwl.add(prefix, FSCOP_KW.c_str(),  theCopyNumber);
-      kwl.add(prefix, FSCPYS_KW.c_str(), theNumberOfCopies);
-      kwl.add(prefix, ENCRYP_KW.c_str(), theEncryption);
-   }
-   
-   return result;
-}
-
-bool ossimNitfFileHeaderV2_X::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   // Note: Currently not looking up all fieds only ones that make sense.
-   
-   const char* lookup;
-   
-   lookup = kwl.find( prefix, OSTAID_KW);
-   if ( lookup )
-   {
-      setOriginatingStationId( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FDT_KW);
-   if ( lookup )
-   {
-      setDate( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FTITLE_KW);
-   if ( lookup )
-   {
-      setTitle( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FSCLAS_KW);
-   if ( lookup )
-   {
-      setFileSecurityClassification( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FSCODE_KW);
-   if ( lookup )
-   {
-      setCodeWords( ossimString(lookup) ); 
-   }
-   lookup = kwl.find( prefix, FSCTLH_KW);
-   if ( lookup )
-   {
-      setControlAndHandling( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FSREL_KW);
-   if ( lookup )
-   {
-      setReleasingInstructions( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FSCAUT_KW);
-   if ( lookup )
-   {
-      setClassificationAuthority( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FSCTLN_KW);
-   if ( lookup )
-   {
-      setSecurityControlNumber( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FSCOP_KW);
-   if ( lookup )
-   {
-      setCopyNumber( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, FSCPYS_KW);
-   if ( lookup )
-   {
-      setNumberOfCopies( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ENCRYP_KW);
-   if ( lookup )
-   {
-      setEncryption( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ONAME_KW);
-   if ( lookup )
-   {
-      setOriginatorsName( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, OPHONE_KW);
-   if ( lookup )
-   {
-      setOriginatorsPhone( ossimString(lookup) );
-   }
-
-   return true;
-}
-
-void ossimNitfFileHeaderV2_X::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfFileHeader::getPropertyNames(propertyNames);
-   propertyNames.push_back(FILE_TYPE_KW);
-   propertyNames.push_back(VERSION_KW);
-   propertyNames.push_back(FHDR_KW);
-   propertyNames.push_back(CLEVEL_KW);
-   propertyNames.push_back(STYPE_KW);
-   propertyNames.push_back(OSTAID_KW);
-   propertyNames.push_back(FDT_KW);
-   propertyNames.push_back(FTITLE_KW);
-   propertyNames.push_back(FSCLAS_KW);
-   propertyNames.push_back(FSCODE_KW);
-   propertyNames.push_back(FSCTLH_KW);
-   propertyNames.push_back(FSREL_KW);
-   propertyNames.push_back(FSCAUT_KW);
-   propertyNames.push_back(FSCTLN_KW);
-   propertyNames.push_back(FSCOP_KW);
-   propertyNames.push_back(FSCPYS_KW);
-   propertyNames.push_back(ENCRYP_KW);
-   propertyNames.push_back(ONAME_KW);
-   propertyNames.push_back(OPHONE_KW);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfGeoPositioningTag.cpp b/ossim/src/ossim/support_data/ossimNitfGeoPositioningTag.cpp
deleted file mode 100644
index 78c4d4b..0000000
--- a/ossim/src/ossim/support_data/ossimNitfGeoPositioningTag.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfGeoPositioningTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-
-RTTI_DEF1(ossimNitfGeoPositioningTag, "ossimNitfGeoPositioningTag", ossimNitfRegisteredTag);
-
-ossimNitfGeoPositioningTag::ossimNitfGeoPositioningTag()
-   : ossimNitfRegisteredTag(std::string("GEOPSB"),  443)
-{
-   clearFields();
-}
-
-ossimNitfGeoPositioningTag::~ossimNitfGeoPositioningTag()
-{
-}
-
-void ossimNitfGeoPositioningTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theType, 3);
-   in.read(theCoordinateUnits, 3);
-   in.read(theGeodeticDatumName, 80);
-   in.read(theGeodeticDatumCode, 4);
-   in.read(theEllipsoidName, 80);
-   in.read(theEllipsoidCode, 3);
-   in.read(theVerticalDatumReference, 80);
-   in.read(theVerticalReferenceCode, 4);
-   in.read(theSoundingDatumName, 80);
-   in.read(theSoundingDatumCode, 4);
-   in.read(theZFalseOrigin, 15);
-   in.read(theGridCode, 3);
-   in.read(theGridDescription, 80);
-   in.read(theGridZoneNumber, 4);
-}
-
-void ossimNitfGeoPositioningTag::writeStream(std::ostream& out)
-{
-   out.write(theType, 3);
-   out.write(theCoordinateUnits, 3);
-   out.write(theGeodeticDatumName, 80);
-   out.write(theGeodeticDatumCode, 4);
-   out.write(theEllipsoidName, 80);
-   out.write(theEllipsoidCode, 3);
-   out.write(theVerticalDatumReference, 80);
-   out.write(theVerticalReferenceCode, 4);
-   out.write(theSoundingDatumName, 80);
-   out.write(theSoundingDatumCode, 4);
-   out.write(theZFalseOrigin, 15);
-   out.write(theGridCode, 3);
-   out.write(theGridDescription, 80);
-   out.write(theGridZoneNumber, 4);
-}
-
-void ossimNitfGeoPositioningTag::clearFields()
-{
-   memset(theType, ' ', 3);
-   memset(theCoordinateUnits, ' ', 3);
-   memset(theGeodeticDatumName, ' ', 80);
-   memset(theGeodeticDatumCode, ' ', 4);
-   memset(theEllipsoidName, ' ', 80);
-   memset(theEllipsoidCode, ' ', 3);
-   memset(theVerticalDatumReference, ' ', 80);
-   memset(theVerticalReferenceCode, ' ', 4);
-   memset(theSoundingDatumName, ' ', 80);
-   memset(theSoundingDatumCode, ' ', 4);
-   memset(theZFalseOrigin, '0', 15);
-   memset(theGridCode, ' ', 3);
-   memset(theGridDescription, ' ', 80);
-   memset(theGridZoneNumber, '0',  4);
-   
-   memcpy(theType, "MAP", 3);
-   memcpy(theCoordinateUnits, "M  ", 3);
-   memcpy(theGeodeticDatumName, "World Geodetic System 1984", 26);
-   memcpy(theGeodeticDatumCode, "WGE", 3);
-   memcpy(theEllipsoidName, "World Geodetic System 1984", 26);
-   memcpy(theEllipsoidCode, "WE", 2);
-   memcpy(theVerticalDatumReference, "Geodetic", 8);
-   memcpy(theVerticalReferenceCode, "GEOD", 4);
-   memcpy(theSoundingDatumName, "Mean Sea", 8);
-   memcpy(theSoundingDatumCode, "MSL", 3);
-
-   theType[3]                    = '\0';
-   theCoordinateUnits[3]         = '\0';
-   theGeodeticDatumName[80]      = '\0';
-   theGeodeticDatumCode[4]       = '\0';
-   theEllipsoidName[80]          = '\0';
-   theEllipsoidCode[3]           = '\0';
-   theVerticalDatumReference[80] = '\0';
-   theVerticalReferenceCode[4]   = '\0';
-   theSoundingDatumName[80]      = '\0';
-   theSoundingDatumCode[4]       = '\0';
-   theZFalseOrigin[15]           = '\0';
-   theGridCode[3]                = '\0';
-   theGridDescription[80]        = '\0';
-   theGridZoneNumber[4]          = '\0';
-   
-}
-
-std::ostream& ossimNitfGeoPositioningTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "TYP:" << theType << "\n"
-       << pfx << std::setw(24) << "UNI:" << theCoordinateUnits << "\n"
-       << pfx << std::setw(24) << "DAG:" << theGeodeticDatumName << "\n"
-       << pfx << std::setw(24) << "DCD:" << theGeodeticDatumCode << "\n"
-       << pfx << std::setw(24) << "ELL:" << theEllipsoidName << "\n"
-       << pfx << std::setw(24) << "ELC:" << theEllipsoidCode << "\n"
-       << pfx << std::setw(24) << "DVR:" << theVerticalDatumReference << "\n"
-       << pfx << std::setw(24) << "VDCDVR:" << theVerticalReferenceCode << "\n"
-       << pfx << std::setw(24) << "SDA:" << theSoundingDatumName << "\n"
-       << pfx << std::setw(24) << "VDCSDA:" << theSoundingDatumCode << "\n"
-       << pfx << std::setw(24) << "ZOR:" << theZFalseOrigin << "\n"
-       << pfx << std::setw(24) << "GRD:" << theGridCode << "\n"
-       << pfx << std::setw(24) << "GRN:" << theGridDescription << "\n"
-       << pfx << std::setw(24) << "ZNA:" << theGridZoneNumber << "\n";
-   
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfIchipbTag.cpp b/ossim/src/ossim/support_data/ossimNitfIchipbTag.cpp
deleted file mode 100644
index 0281eb8..0000000
--- a/ossim/src/ossim/support_data/ossimNitfIchipbTag.cpp
+++ /dev/null
@@ -1,495 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description: ICHIPB tag class declaration.
-//
-// See document STDI-0002 Table 5-2 for more info.
-// 
-// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfIchipbTag.cpp 22013 2012-12-19 17:37:20Z dburken $
-
-#include <cstring> /* for memcpy */
-#include <iomanip>
-#include <iostream>
-
-#include <ossim/support_data/ossimNitfIchipbTag.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossim2dBilinearTransform.h>
-
-static const ossimString XFRM_FLAG_KW = "XFRM_FLAG";
-static const ossimString SCALE_FACTOR_KW = "SCALE_FACTOR";
-static const ossimString ANAMRPH_CORR_KW = "ANAMRPH_CORR";
-static const ossimString SCANBLK_NUM_KW = "SCANBLK_NUM";
-static const ossimString OP_ROW_11_KW = "OP_ROW_11";
-static const ossimString OP_COL_11_KW = "OP_COL_11";
-static const ossimString OP_ROW_12_KW = "OP_ROW_12";
-static const ossimString OP_COL_12_KW = "OP_COL_12";
-static const ossimString OP_ROW_21_KW = "OP_ROW_21";
-static const ossimString OP_COL_21_KW = "OP_COL_21";
-static const ossimString OP_ROW_22_KW = "OP_ROW_22";
-static const ossimString OP_COL_22_KW = "OP_COL_22";
-static const ossimString FI_ROW_11_KW = "FI_ROW_11";
-static const ossimString FI_COL_11_KW = "FI_COL_11";
-static const ossimString FI_ROW_12_KW = "FI_ROW_12";
-static const ossimString FI_COL_12_KW = "FI_COL_12";
-static const ossimString FI_ROW_21_KW = "FI_ROW_21";
-static const ossimString FI_COL_21_KW = "FI_COL_21";
-static const ossimString FI_ROW_22_KW = "FI_ROW_22";
-static const ossimString FI_COL_22_KW = "FI_COL_22";
-static const ossimString FI_ROW_KW = "FI_ROW";
-static const ossimString FI_COL_KW = "FI_COL";
-
-RTTI_DEF1(ossimNitfIchipbTag, "ossimNitfIchipbTag", ossimNitfRegisteredTag);
-
-ossimNitfIchipbTag::ossimNitfIchipbTag()
-   : ossimNitfRegisteredTag(std::string("ICHIPB"), 224)
-{
-   clearFields();
-}
-
-void ossimNitfIchipbTag::parseStream(std::istream& in)
-{
-   clearFields();
-
-   in.read(theXfrmFlag,     XFRM_FLAG_SIZE);
-   in.read(theScaleFactor,  SCALE_FACTOR_SIZE);
-   in.read(theAnamrphCorr,  ANAMRPH_CORR_SIZE);
-   in.read(theScanBlock,    SCANBLK_NUM_SIZE);
-   in.read(theOpRow11,      OP_ROW_11_SIZE);
-   in.read(theOpCol11,      OP_COL_11_SIZE);
-   in.read(theOpRow12,      OP_ROW_12_SIZE);
-   in.read(theOpCol12,      OP_COL_12_SIZE);
-   in.read(theOpRow21,      OP_ROW_21_SIZE);
-   in.read(theOpCol21,      OP_COL_21_SIZE);
-   in.read(theOpRow22,      OP_ROW_22_SIZE);
-   in.read(theOpCol22,      OP_COL_22_SIZE);
-   in.read(theFiRow11,      FI_ROW_11_SIZE);
-   in.read(theFiCol11,      FI_COL_11_SIZE);
-   in.read(theFiRow12,      FI_ROW_12_SIZE);
-   in.read(theFiCol12,      FI_COL_12_SIZE);
-   in.read(theFiRow21,      FI_ROW_21_SIZE);
-   in.read(theFiCol21,      FI_COL_21_SIZE);
-   in.read(theFiRow22,      FI_ROW_22_SIZE);
-   in.read(theFiCol22,      FI_COL_22_SIZE);
-   in.read(theFullImageRow, FI_ROW_SIZE);
-   in.read(theFullImageCol, FI_COL_SIZE);
-}
-
-void ossimNitfIchipbTag::writeStream(std::ostream& out)
-{
-   out.write(theXfrmFlag,     XFRM_FLAG_SIZE);
-   out.write(theScaleFactor,  SCALE_FACTOR_SIZE);
-   out.write(theAnamrphCorr,  ANAMRPH_CORR_SIZE);
-   out.write(theScanBlock,    SCANBLK_NUM_SIZE);
-   out.write(theOpRow11,      OP_ROW_11_SIZE);
-   out.write(theOpCol11,      OP_COL_11_SIZE);
-   out.write(theOpRow12,      OP_ROW_12_SIZE);
-   out.write(theOpCol12,      OP_COL_12_SIZE);
-   out.write(theOpRow21,      OP_ROW_21_SIZE);
-   out.write(theOpCol21,      OP_COL_21_SIZE);
-   out.write(theOpRow22,      OP_ROW_22_SIZE);
-   out.write(theOpCol22,      OP_COL_22_SIZE);
-   out.write(theFiRow11,      FI_ROW_11_SIZE);
-   out.write(theFiCol11,      FI_COL_11_SIZE);
-   out.write(theFiRow12,      FI_ROW_12_SIZE);
-   out.write(theFiCol12,      FI_COL_12_SIZE);
-   out.write(theFiRow21,      FI_ROW_21_SIZE);
-   out.write(theFiCol21,      FI_COL_21_SIZE);
-   out.write(theFiRow22,      FI_ROW_22_SIZE);
-   out.write(theFiCol22,      FI_COL_22_SIZE);
-   out.write(theFullImageRow, FI_ROW_SIZE);
-   out.write(theFullImageCol, FI_COL_SIZE);
-}
-
-void ossimNitfIchipbTag::clearFields()
-{
-   memset(theXfrmFlag,     '0', XFRM_FLAG_SIZE);
-   memset(theScaleFactor,  '0', SCALE_FACTOR_SIZE);
-   memset(theAnamrphCorr,  '0', ANAMRPH_CORR_SIZE);
-   memset(theScanBlock,    '0', SCANBLK_NUM_SIZE);
-   memset(theOpRow11,      '0', OP_ROW_11_SIZE);
-   memset(theOpCol11,      '0', OP_COL_11_SIZE);
-   memset(theOpRow12,      '0', OP_ROW_12_SIZE);
-   memset(theOpCol12,      '0', OP_COL_12_SIZE);
-   memset(theOpRow21,      '0', OP_ROW_21_SIZE);
-   memset(theOpCol21,      '0', OP_COL_21_SIZE);
-   memset(theOpRow22,      '0', OP_ROW_22_SIZE);
-   memset(theOpCol22,      '0', OP_COL_22_SIZE);
-   memset(theFiRow11,      '0', FI_ROW_11_SIZE);
-   memset(theFiCol11,      '0', FI_COL_11_SIZE);
-   memset(theFiRow12,      '0', FI_ROW_12_SIZE);
-   memset(theFiCol12,      '0', FI_COL_12_SIZE);
-   memset(theFiRow21,      '0', FI_ROW_21_SIZE);
-   memset(theFiCol21,      '0', FI_COL_21_SIZE);
-   memset(theFiRow22,      '0', FI_ROW_22_SIZE);
-   memset(theFiCol22,      '0', FI_COL_22_SIZE);
-   memset(theFullImageRow, '0', FI_ROW_SIZE);
-   memset(theFullImageCol, '0', FI_COL_SIZE);
-
-   theXfrmFlag[XFRM_FLAG_SIZE]       = '\0';
-   theScaleFactor[SCALE_FACTOR_SIZE] = '\0';
-   theAnamrphCorr[ANAMRPH_CORR_SIZE] = '\0';
-   theScanBlock[SCANBLK_NUM_SIZE]    = '\0';
-   theOpRow11[OP_ROW_11_SIZE]        = '\0';
-   theOpCol11[OP_COL_11_SIZE]        = '\0';
-   theOpRow12[OP_ROW_12_SIZE]        = '\0';
-   theOpCol12[OP_COL_12_SIZE]        = '\0';
-   theOpRow21[OP_ROW_21_SIZE]        = '\0';
-   theOpCol21[OP_COL_21_SIZE]        = '\0';
-   theOpRow22[OP_ROW_22_SIZE]        = '\0';
-   theOpCol22[OP_COL_22_SIZE]        = '\0';
-   theFiRow11[FI_ROW_11_SIZE]        = '\0';
-   theFiCol11[FI_COL_11_SIZE]        = '\0';
-   theFiRow12[FI_ROW_12_SIZE]        = '\0';
-   theFiCol12[FI_COL_12_SIZE]        = '\0';
-   theFiRow21[FI_ROW_21_SIZE]        = '\0';
-   theFiCol21[FI_COL_21_SIZE]        = '\0';
-   theFiRow22[FI_ROW_22_SIZE]        = '\0';
-   theFiCol22[FI_COL_22_SIZE]        = '\0';
-   theFullImageRow[FI_ROW_SIZE]      = '\0';
-   theFullImageCol[FI_COL_SIZE]      = '\0';
-}
-
-std::ostream& ossimNitfIchipbTag::print(std::ostream& out,
-                                        const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"
-       << getTagLength() << "\n"
-       << pfx << std::setw(24) << "XFRM_FLAG:"     << theXfrmFlag << "\n"
-       << pfx << std::setw(24) << "SCALE_FACTOR:"  << theScaleFactor << "\n"
-       << pfx << std::setw(24) << "ANAMRPH_CORR:"  << theAnamrphCorr << "\n"
-       << pfx << std::setw(24) << "SCANBLK_NUM:"   << theScanBlock << "\n"
-       << pfx << std::setw(24) << "OP_ROW_11:"     << theOpRow11 << "\n"
-       << pfx << std::setw(24) << "OP_COL_11:"     << theOpCol11 << "\n"
-       << pfx << std::setw(24) << "OP_ROW_12:"     << theOpRow12 << "\n"
-       << pfx << std::setw(24) << "OP_COL_12:"     << theOpCol12 << "\n"
-       << pfx << std::setw(24) << "OP_ROW_21:"     << theOpRow21 << "\n"
-       << pfx << std::setw(24) << "OP_COL_21:"     << theOpCol21 << "\n"
-       << pfx << std::setw(24) << "OP_ROW_22:"     << theOpRow22 << "\n"
-       << pfx << std::setw(24) << "OP_COL_22:"     << theOpCol22 << "\n"
-       << pfx << std::setw(24) << "FI_ROW_11:"     << theFiRow11 << "\n"
-       << pfx << std::setw(24) << "FI_COL_11:"     << theFiCol11 << "\n"
-       << pfx << std::setw(24) << "FI_ROW_12:"     << theFiRow12 << "\n"
-       << pfx << std::setw(24) << "FI_COL_12:"     << theFiCol12 << "\n"
-       << pfx << std::setw(24) << "FI_ROW_21:"     << theFiRow21 << "\n"
-       << pfx << std::setw(24) << "FI_COL_21:"     << theFiCol21 << "\n"
-       << pfx << std::setw(24) << "FI_ROW_22:"     << theFiRow22 << "\n"
-       << pfx << std::setw(24) << "FI_COL_22:"     << theFiCol22 << "\n"
-       << pfx << std::setw(24) << "FI_ROW:"        << theFullImageRow << "\n"
-       << pfx << std::setw(24) << "FI_COL:"        << theFullImageCol
-       << std::endl;
-
-   return out;
-}
-
-bool ossimNitfIchipbTag::getXfrmFlag() const
-{
-   return ossimString::toBool(theXfrmFlag);
-}
-
-ossim_float64 ossimNitfIchipbTag::getScaleFactor() const
-{
-   return ossimString::toFloat64(theScaleFactor);
-}
-
-bool ossimNitfIchipbTag::getAnamrphCorrFlag() const
-{
-   return ossimString::toBool(theAnamrphCorr);
-}
-
-ossim_uint32 ossimNitfIchipbTag::getScanBlock() const
-{
-   return ossimString::toUInt32(theScanBlock);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpRow11() const
-{
-   return ossimString::toFloat64(theOpRow11);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpCol11() const
-{
-   return ossimString::toFloat64(theOpCol11);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpRow12() const
-{
-   return ossimString::toFloat64(theOpRow12);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpCol12() const
-{
-   return ossimString::toFloat64(theOpCol12);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpRow21() const
-{
-   return ossimString::toFloat64(theOpRow21);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpCol21()
-   const
-{ return ossimString::toFloat64(theOpCol21);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpRow22() const
-{
-   return ossimString::toFloat64(theOpRow22);
-}
-
-ossim_float64 ossimNitfIchipbTag::getOpCol22() const
-{
-   return ossimString::toFloat64(theOpCol22);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiRow11() const
-{
-   return ossimString::toFloat64(theFiRow11);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiCol11() const
-{
-   return ossimString::toFloat64(theFiCol11);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiRow12() const
-{
-   return ossimString::toFloat64(theFiRow12);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiCol12() const
-{
-   return ossimString::toFloat64(theFiCol12);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiRow21() const
-{
-   return ossimString::toFloat64(theFiRow21);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiCol21() const
-{
-   return ossimString::toFloat64(theFiCol21);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiRow22() const
-{
-   return ossimString::toFloat64(theFiRow22);
-}
-
-ossim_float64 ossimNitfIchipbTag::getFiCol22() const
-{
-   return ossimString::toFloat64(theFiCol22);
-}
-
-ossim_uint32 ossimNitfIchipbTag::getFullImageRows() const
-{
-   return ossimString::toUInt32(theFullImageRow);
-}
-
-ossim_uint32 ossimNitfIchipbTag::getFullImageCols() const
-{
-   return ossimString::toUInt32(theFullImageCol);
-}
- 
-#if 0
-void ossimNitfIchipbTag::getImageRect(ossimDrect& rect) const
-{
-   ossimDpt pt;
-
-   pt.x = getOpCol11() - 0.5;
-   pt.y = getOpRow11() - 0.5;
-   rect.set_ul(pt);
-
-   pt.x = getOpCol22() - 0.5;
-   pt.y = getOpRow22() - 0.5;
-   rect.set_lr(pt);
-}
-
-void ossimNitfIchipbTag::getFullImageRect(ossimDrect& rect) const
-{
-   ossimDpt pt;
-
-   ossim_float64 minX = ossim::min(getFiCol11(), getFiCol22());
-   ossim_float64 maxX = ossim::max(getFiCol11(), getFiCol22());
-   ossim_float64 minY = ossim::min(getFiRow11(), getFiRow22());
-   ossim_float64 maxY = ossim::max(getFiRow11(), getFiRow22());
-   
-   pt.x = minX - 0.5;
-   pt.y = minY - 0.5;
-   rect.set_ul(pt);
-
-   pt.x = maxX - 0.5;
-   pt.y = maxY - 0.5;
-   rect.set_lr(pt);
-}
-
-void ossimNitfIchipbTag::getSubImageOffset(ossimDpt& pt) const
-{
-   ossimDrect rect;
-   
-   getFullImageRect(rect);
-   
-   pt = rect.ul();
-}
-#endif
-
-ossim2dTo2dTransform* ossimNitfIchipbTag::newTransform()const
-{
-   return new ossim2dBilinearTransform(ossimDpt(getOpCol11(), getOpRow11()),
-                                       ossimDpt(getOpCol12(), getOpRow12()),
-                                       ossimDpt(getOpCol21(), getOpRow21()),
-                                       ossimDpt(getOpCol22(), getOpRow22()),
-                                       ossimDpt(getFiCol11(), getFiRow11()),
-                                       ossimDpt(getFiCol12(), getFiRow12()),
-                                       ossimDpt(getFiCol21(), getFiRow21()),
-                                       ossimDpt(getFiCol22(), getFiRow22()));
-}
-
-void ossimNitfIchipbTag::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimNitfRegisteredTag::setProperty(property);   
-}
-
-ossimRefPtr<ossimProperty> ossimNitfIchipbTag::getProperty(const ossimString& name)const
-{
-   ossimProperty* result = 0;
-
-   if(name == XFRM_FLAG_KW)
-   {
-      result = new ossimStringProperty(name, theXfrmFlag);
-   }
-   else if(name == SCALE_FACTOR_KW)
-   {
-      result = new ossimStringProperty(name, theScaleFactor);
-   }
-   else if(name == ANAMRPH_CORR_KW)
-   {
-      result = new ossimStringProperty(name, theAnamrphCorr);
-   }
-   else if(name == SCANBLK_NUM_KW)
-   {
-      result = new ossimStringProperty(name, theScanBlock);
-   }
-   else if(name == OP_ROW_11_KW)
-   {
-      result = new ossimStringProperty(name, theOpRow11);
-   }
-   else if(name == OP_COL_11_KW)
-   {
-      result = new ossimStringProperty(name, theOpCol11);
-   }
-   else if(name == OP_ROW_12_KW)
-   {
-      result = new ossimStringProperty(name,theOpRow12 );
-   }
-   else if(name == OP_COL_12_KW)
-   {
-      result = new ossimStringProperty(name, theOpCol12);
-   }
-   else if(name == OP_ROW_21_KW)
-   {
-      result = new ossimStringProperty(name,theOpRow21);
-   }
-   else if(name == OP_COL_21_KW)
-   {
-      result = new ossimStringProperty(name, theOpCol21);
-   }
-   else if(name == OP_ROW_22_KW)
-   {
-      result = new ossimStringProperty(name, theOpRow22);
-   }
-   else if(name == OP_COL_22_KW)
-   {
-      result = new ossimStringProperty(name, theOpCol22);
-   }
-   else if(name == FI_ROW_11_KW)
-   {
-      result = new ossimStringProperty(name, theFiRow11);
-   }
-   else if(name == FI_COL_11_KW)
-   {
-      result = new ossimStringProperty(name, theFiCol11);
-   }
-   else if(name == FI_ROW_12_KW)
-   {
-      result = new ossimStringProperty(name, theFiRow12);
-   }
-   else if(name == FI_COL_12_KW)
-   {
-      result = new ossimStringProperty(name, theFiCol12);
-   }
-   else if(name == FI_ROW_21_KW)
-   {
-      result = new ossimStringProperty(name, theFiRow21);
-   }
-   else if(name == FI_COL_21_KW)
-   {
-      result = new ossimStringProperty(name, theFiCol21);
-   }
-   else if(name == FI_ROW_22_KW)
-   {
-      result = new ossimStringProperty(name, theFiRow22);
-   }
-   else if(name == FI_COL_22_KW)
-   {
-      result = new ossimStringProperty(name, theFiCol22);
-   }
-   else if(name == FI_ROW_KW)
-   {
-      result = new ossimStringProperty(name, theFullImageRow);
-   }
-   else if(name == FI_COL_KW)
-   {
-      result = new ossimStringProperty(name, theFullImageCol);
-   }
-   else
-   {
-      return ossimNitfRegisteredTag::getProperty(name);
-   }
-
-   return result;
-}
-
-void ossimNitfIchipbTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(XFRM_FLAG_KW);
-   propertyNames.push_back(SCALE_FACTOR_KW);
-   propertyNames.push_back(ANAMRPH_CORR_KW);
-   propertyNames.push_back(SCANBLK_NUM_KW);
-   propertyNames.push_back(OP_ROW_11_KW);
-   propertyNames.push_back(OP_COL_11_KW);
-   propertyNames.push_back(OP_ROW_12_KW);
-   propertyNames.push_back(OP_COL_12_KW);
-   propertyNames.push_back(OP_ROW_21_KW);
-   propertyNames.push_back(OP_COL_21_KW);
-   propertyNames.push_back(OP_ROW_22_KW);
-   propertyNames.push_back(OP_COL_22_KW);
-   propertyNames.push_back(FI_ROW_11_KW);
-   propertyNames.push_back(FI_COL_11_KW);
-   propertyNames.push_back(FI_ROW_12_KW);
-   propertyNames.push_back(FI_COL_12_KW);
-   propertyNames.push_back(FI_ROW_21_KW);
-   propertyNames.push_back(FI_COL_21_KW);
-   propertyNames.push_back(FI_ROW_22_KW);
-   propertyNames.push_back(FI_COL_22_KW);
-   propertyNames.push_back(FI_ROW_KW);
-   propertyNames.push_back(FI_COL_KW);
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfImageBand.cpp b/ossim/src/ossim/support_data/ossimNitfImageBand.cpp
deleted file mode 100644
index 907d1fb..0000000
--- a/ossim/src/ossim/support_data/ossimNitfImageBand.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageBand.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/support_data/ossimNitfImageBand.h>
-#include <ossim/support_data/ossimNitfImageLut.h>
-#include <ossim/base/ossimString.h>
-
-RTTI_DEF1(ossimNitfImageBand, "ossimNitfImageBand", ossimObject);
-
-ossimNitfImageBand::ossimNitfImageBand()
-{
-}
-
-ossimNitfImageBand::~ossimNitfImageBand()
-{
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfImageBandV2_0.cpp b/ossim/src/ossim/support_data/ossimNitfImageBandV2_0.cpp
deleted file mode 100644
index 2212c8e..0000000
--- a/ossim/src/ossim/support_data/ossimNitfImageBandV2_0.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageBandV2_0.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <sstream>
-#include <iostream>
-#include <iomanip>
-#include <ossim/support_data/ossimNitfImageBandV2_0.h>
-#include <ossim/base/ossimString.h>
-
-ossimNitfImageBandV2_0::ossimNitfImageBandV2_0()
-{
-   clearFields();
-}
-
-ossimNitfImageBandV2_0::~ossimNitfImageBandV2_0()
-{
-}
-
-void ossimNitfImageBandV2_0::parseStream(std::istream& in)
-{
-   theLookupTables.clear();
-   if(in)
-   {      
-      theLookupTables.clear();
-      in.read(theBandRepresentation, 2);
-      in.read(theBandSignificance, 6);
-      in.read(theBandImageFilterCondition, 1);
-      in.read(theBandStandardImageFilterCode, 3);
-      in.read(theBandNumberOfLuts, 1);
-
-      long numberOfLuts = ossimString(theBandNumberOfLuts).toLong();
-
-      if(numberOfLuts > 0)
-      {
-         theLookupTables.resize(numberOfLuts);
-         in.read(theBandNumberOfLutEntries, 5);
-         
-         ossim_uint32 numberOfLutsIndex = numberOfLuts;
-         ossim_uint32 numberOfLutEntries = ossimString(theBandNumberOfLutEntries).toLong();
-         ossim_uint32 idx = 0;
-
-         while(idx < numberOfLutsIndex)
-         {
-            theLookupTables[idx] = new ossimNitfImageLutV2_0; 
-            theLookupTables[idx]->setNumberOfEntries(numberOfLutEntries);
-            theLookupTables[idx]->parseStream(in);
-            
-            ++idx;
-         }
-      }
-   }   
-}
-
-void ossimNitfImageBandV2_0::writeStream(std::ostream& out)
-{
-   out.write(theBandRepresentation, 2);
-   out.write(theBandSignificance, 6);
-   out.write(theBandImageFilterCondition, 1);
-   out.write(theBandStandardImageFilterCode, 3);
-   out.write(theBandNumberOfLuts, 1);
-
-   if(ossimString(theBandNumberOfLuts).toUInt32() > 0)
-   {
-      // lut output not supported currently
-   }
-}
-
-std::ostream& ossimNitfImageBandV2_0::print(std::ostream& out,
-                                            const std::string& prefix,
-                                            ossim_uint32 band)const
-{
-   std::ostringstream os;
-   os << std::setw(3) << std::setfill('0') << (band+1) << ":";
-
-   ossimString tmpStr = "IREPBAND";
-   tmpStr += os.str();
-   
-   out << prefix << std::setw(24)
-       << tmpStr << theBandRepresentation << "\n";
-
-   tmpStr = "ISUBCAT";
-   tmpStr += os.str();
-   
-   out << prefix << std::setw(24)
-       << tmpStr << theBandSignificance << "\n";
-
-   tmpStr = "IFC";
-   tmpStr += os.str();
-   
-   out << prefix << std::setw(24)
-       << tmpStr << theBandImageFilterCondition << "\n";
-
-   tmpStr = "IMFLT";
-   tmpStr += os.str();
-
-   out << prefix << std::setw(24)
-       << tmpStr << theBandStandardImageFilterCode << "\n";
-
-   tmpStr = "NLUTS";
-   tmpStr += os.str();
-
-   out << prefix << std::setw(24)
-       << tmpStr << theBandNumberOfLuts << "\n";
-
-   tmpStr = "NELUTS";
-   tmpStr += os.str();
-
-   out << prefix << std::setw(24)
-       << tmpStr << theBandNumberOfLutEntries << "\n";
-
-   for(ossim_uint32 idx = 0; idx < theLookupTables.size(); ++idx)
-   {
-      out << *theLookupTables[idx] << std::endl;
-   }
-   
-   return out;
-}
-
-ossim_uint32 ossimNitfImageBandV2_0::getNumberOfLuts()const
-{
-   return static_cast<ossim_uint32>(theLookupTables.size());
-}
-
-const ossimRefPtr<ossimNitfImageLut> ossimNitfImageBandV2_0::getLut(ossim_uint32 idx)const
-{
-   if(idx < getNumberOfLuts())
-   {
-      return theLookupTables[idx];
-   }
-   
-   return NULL;
-}
-
-ossimRefPtr<ossimNitfImageLut> ossimNitfImageBandV2_0::getLut(ossim_uint32 idx)
-{
-   if(idx < getNumberOfLuts())
-   {
-      return theLookupTables[idx];
-   }
-   
-   return NULL;
-}
-
-ossimString ossimNitfImageBandV2_0::getBandRepresentation()const
-{
-   return ossimString(theBandRepresentation);
-}
-
-void ossimNitfImageBandV2_0::setBandRepresentation(const ossimString& rep)
-{
-   std::ostringstream out;
-
-   out << std::setw(2)
-       << std::setfill(' ')
-       << std::setiosflags(std::ios::left)
-       << rep.c_str();
-
-   memcpy(theBandRepresentation, out.str().c_str(), 2);
-}
-
-ossimString ossimNitfImageBandV2_0::getBandSignificance()const
-{
-   return ossimString(theBandSignificance);
-}
-
-void ossimNitfImageBandV2_0::setBandSignificance(const ossimString& rep)
-{
-   std::ostringstream out;
-   
-   out << std::setw(6)
-       << std::setfill(' ')
-       << rep.c_str();
-
-   memcpy(theBandSignificance, out.str().c_str(), 6);
-}
-
-void ossimNitfImageBandV2_0::clearFields()
-{
-   memset(theBandRepresentation, ' ', 2);
-   memset(theBandSignificance, ' ', 6);
-   memset(theBandImageFilterCondition, 'N', 1);
-   memset(theBandStandardImageFilterCode, ' ', 3);
-   memset(theBandNumberOfLuts, 0, 1);
-   memset(theBandNumberOfLutEntries, ' ', 5);
-   
-   theLookupTables.clear();
-   theBandRepresentation[2] = '\0';
-   theBandSignificance[6] = '\0';
-   theBandImageFilterCondition[1] = '\0';
-   theBandStandardImageFilterCode[3] = '\0';
-   theBandNumberOfLuts[1] = '\0';
-   theBandNumberOfLutEntries[5] = '\0';
-}
-
-void ossimNitfImageBandV2_0::printLookupTables(std::ostream& out)const
-{
-   std::vector<ossimRefPtr<ossimNitfImageLut> >::const_iterator tables;
-
-   tables = theLookupTables.begin();
-   while(tables != theLookupTables.end())
-   {
-      if((*tables).valid())
-      {
-         out << *((*tables).get());
-      }
-      ++tables;
-      if(tables != theLookupTables.end())
-      {
-         out << std::endl;
-      }
-   }
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfImageHeader.cpp b/ossim/src/ossim/support_data/ossimNitfImageHeader.cpp
deleted file mode 100644
index c1dfa95..0000000
--- a/ossim/src/ossim/support_data/ossimNitfImageHeader.cpp
+++ /dev/null
@@ -1,400 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageHeader.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cmath> /* for fmod */
-#include <iomanip>
-#include <sstream>
-
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimNotifyContext.h>
-
-RTTI_DEF2(ossimNitfImageHeader,
-          "ossimNitfImageHeader",
-          ossimObject,
-          ossimPropertyInterface)
-static const char* TAGS_KW = "tags";
-ossimNitfImageHeader::ossimNitfImageHeader()
-{
-}
-
-ossimNitfImageHeader::~ossimNitfImageHeader()
-{
-}
-
-bool ossimNitfImageHeader::getTagInformation(ossimNitfTagInformation& tagInfo,
-                                             const ossimString& tagName)const
-{
-   if(theTagList.size())
-   {
-      for(ossim_uint32 idx = 0; idx < theTagList.size(); ++idx)
-      {
-         if(theTagList[idx].getTagName() == tagName)
-         {
-            tagInfo = theTagList[idx];
-            return true;
-         }
-      }
-   }
-   
-   return false;
-}
-
-bool ossimNitfImageHeader::getTagInformation(ossimNitfTagInformation& tag,
-                                             ossim_uint32 idx)const
-{
-   bool result = false;
-   
-   if(idx < theTagList.size())
-   {
-      tag = theTagList[idx];
-      result = true;
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimNitfRegisteredTag> ossimNitfImageHeader::getTagData(
-   const ossimString& tagName)
-{
-   if(theTagList.size())
-   {
-      for(ossim_uint32 idx = 0; idx < theTagList.size(); ++idx)
-      {
-         if(theTagList[idx].getTagName() == tagName)
-         {
-            return theTagList[idx].getTagData();
-         }
-      }
-   }
-
-   return ossimRefPtr<ossimNitfRegisteredTag>();
-}
-   
-const ossimRefPtr<ossimNitfRegisteredTag> ossimNitfImageHeader::getTagData(
-   const ossimString& tagName) const
-{
-   if(theTagList.size())
-   {
-      for(ossim_uint32 idx = 0; idx < theTagList.size(); ++idx)
-      {
-         if(theTagList[idx].getTagName() == tagName)
-         {
-            return theTagList[idx].getTagData();
-         }
-      }
-   }
-   
-   return ossimRefPtr<ossimNitfRegisteredTag>();
-}
-
-ossim_uint32 ossimNitfImageHeader::getNumberOfTags()const
-{
-   return static_cast<ossim_uint32>(theTagList.size());
-}
-
-void ossimNitfImageHeader::addTag(const ossimNitfTagInformation& tag, bool unique)
-{
-   if(unique)
-   {
-      removeTag(tag.getTagName());
-   }
-   theTagList.push_back(tag);
-}
-
-void ossimNitfImageHeader::removeTag(const ossimString& tagName)
-{
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theTagList.size(); ++idx)
-   {
-      if(theTagList[idx].getTagName() == tagName)
-      {
-         theTagList.erase(theTagList.begin() + idx);
-         return;
-      }
-   }
-}
-
-bool ossimNitfImageHeader::isSameAs(const ossimNitfImageHeader* hdr) const
-{
-   if (!hdr) return false;
-   
-   return ( (isCompressed() == hdr->isCompressed()) &&
-            (getNumberOfRows() == hdr->getNumberOfRows()) &&
-            (getNumberOfBands() == hdr->getNumberOfBands()) &&
-            (getNumberOfCols() == hdr->getNumberOfCols()) &&
-            (getNumberOfBlocksPerRow() == hdr->getNumberOfBlocksPerRow()) &&
-            (getNumberOfBlocksPerCol() == hdr->getNumberOfBlocksPerCol()) &&
-            (getNumberOfPixelsPerBlockHoriz() ==
-             hdr->getNumberOfPixelsPerBlockHoriz()) &&
-            (getNumberOfPixelsPerBlockVert() ==
-             hdr->getNumberOfPixelsPerBlockVert()) &&
-            (getBitsPerPixelPerBand() == hdr->getBitsPerPixelPerBand()) &&
-            (getImageRect() == hdr->getImageRect()) &&
-            (getIMode() == hdr->getIMode()) &&
-            (getCoordinateSystem() == hdr->getCoordinateSystem()) &&
-            (getGeographicLocation() == hdr->getGeographicLocation()) );
-}
-
-
-void ossimNitfImageHeader::setProperty(ossimRefPtr<ossimProperty> /* property */)
-{
-}
-
-ossimRefPtr<ossimProperty> ossimNitfImageHeader::getProperty(const ossimString& name)const
-{
-   ossimProperty* result = 0;
-
-   if(name == TAGS_KW)
-   {
-      ossim_uint32 idxMax = getNumberOfTags();
-      if(idxMax > 0)
-      {
-         ossimContainerProperty* containerProperty = new ossimContainerProperty;
-         containerProperty->setName(name);
-         ossim_uint32 idx = 0;
-
-         result = containerProperty;
-         for(idx = 0; idx < idxMax; ++idx)
-         {
-            ossimNitfTagInformation tagInfo;
-            getTagInformation(tagInfo, idx);
-            
-            const ossimRefPtr<ossimNitfRegisteredTag> tagData = tagInfo.getTagData();
-            if(tagData.valid())
-            {
-               ossimContainerProperty* containerPropertyTag = new ossimContainerProperty;
-               containerPropertyTag->setName(tagInfo.getTagName());
-               std::vector<ossimRefPtr<ossimProperty> > propertyList;
-               tagData->getPropertyList(propertyList);
-               
-               containerPropertyTag->addChildren(propertyList);
-               containerProperty->addChild(containerPropertyTag);
-            }
-            else
-            {
-               containerProperty->addStringProperty(tagInfo.getTagName(), "", true);
-            }
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimNitfImageHeader::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   propertyNames.push_back(TAGS_KW);
-  
-}
-
-ossim_uint32 ossimNitfImageHeader::getTotalTagLength()const
-{
-   ossim_uint32 tagLength = 0;
-   
-   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
-   {
-      tagLength += theTagList[i].getTotalTagLength();
-   }
-
-   return tagLength;
-}
-
-std::ostream& ossimNitfImageHeader::printTags(std::ostream& out,
-                                              const std::string& prefix)const
-{
-   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
-   {
-      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
-      if (tag.valid())
-      {
-         tag->print(out, prefix);
-      }
-   }
-   return out;
-}
-
-void ossimNitfImageHeader::getMetadata(ossimKeywordlist& kwl,
-                                       const char* prefix) const
-{
-   kwl.add(prefix, "source",
-           getImageSource().c_str(),
-           false);
-   kwl.add(prefix,
-           "image_date",
-           getAcquisitionDateMonthDayYear().c_str(),
-           false);
-   kwl.add(prefix,
-           "image_title",
-           getTitle().c_str(),
-           false);
-}
-
-bool ossimNitfImageHeader::hasLut() const
-{
-   bool result = false;
-
-   const ossim_uint32 BANDS = static_cast<ossim_uint32>(getNumberOfBands());
-   for (ossim_uint32 band = 0; band < BANDS; ++band)
-   {
-      const ossimRefPtr<ossimNitfImageBand> imgBand = getBandInformation(band);
-      if(imgBand.valid())
-      {
-         ossim_uint32 luts = imgBand->getNumberOfLuts();
-         if(luts > 0)
-         {
-            if(imgBand->getLut(0).valid())
-            {
-               result = true;
-               break;
-            }
-         }
-      }
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimNBandLutDataObject> ossimNitfImageHeader::createLut(
-   ossim_uint32 bandIdx)const
-{
-   ossimRefPtr<ossimNBandLutDataObject> result;
-   
-   if(bandIdx < (ossim_uint32)getNumberOfBands())
-   {
-      const ossimRefPtr<ossimNitfImageBand> band = getBandInformation(bandIdx);
-      if(band.valid())
-      {
-         ossim_uint32 bands = band->getNumberOfLuts();
-         if(bands > 0)
-         {
-            if(band->getLut(0).valid())
-            {
-               ossim_uint32 entries = band->getLut(0)->getNumberOfEntries();
-               
-               result = new ossimNBandLutDataObject();
-               result->create(entries, band->getNumberOfLuts());
-               ossim_uint32 bIdx;
-               ossim_uint32 entryIdx;
-
-               for(bIdx = 0; bIdx < bands; ++bIdx)
-               {
-                  const ossimRefPtr<ossimNitfImageLut> lut = band->getLut(bIdx);
-                  if(lut.valid())
-                  {
-                     for(entryIdx = 0; entryIdx < entries; ++entryIdx)
-                     {
-                        (*result)[entryIdx][bIdx] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(lut->getValue(entryIdx));
-                     }
-                  }
-               }
-            }
-         }
-      }
-   }
-
-   return result;
-}
-
-
-void ossimNitfImageHeader::checkForGeographicTiePointTruncation(
-   const ossimDpt& tie) const
-{
-   // One arc second in decimal degrees.
-   const ossim_float64 ARC_SECOND = 1.0/3600.0;
-
-   // Very small number.
-   const ossim_float64 FUDGE_FACTOR = 0.000000001;
-
-   // Remainder portion of latitude divided by an arc second.
-   ossim_float64 y = std::fmod(tie.y, ARC_SECOND);
-
-   // Remainder portion of longitue divided by an arc second.
-   ossim_float64 x = std::fmod(tie.x, ARC_SECOND);
-
-   if ( (std::fabs(y) > FUDGE_FACTOR) || (std::fabs(x) > FUDGE_FACTOR) )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfImageHeader WARNING:\n"
-         << "Tie point will be truncated in image header:  "
-         << tie
-         << std::endl;
-   }
-}
-
-void ossimNitfImageHeader::getDecimationFactor(ossim_float64& result) const
-{
-   //---
-   // Look for string like:
-   // 
-   // "/2" = 1/2
-   // "/4  = 1/4
-   // ...
-   // "/16 = 1/16
-   // 
-   // If it is full resolution it should be "1.0"
-   //
-   // or
-   //
-   // "0.5" which is the same as "/2"
-   // "0.25" which is the same as "/4"
-   //---
-   ossimString os = getImageMagnification();
-
-   // Spec says to fill with spaces so strip them.
-   os.trim(ossimString(" "));
-
-   if (os.size())
-   {
-      if ( os.contains("/") )
-      {
-         os = os.after("/");
-         result = os.toFloat64();
-         if (result)
-         {
-            result = 1.0 / result;
-         }
-      }
-      else
-      {
-         result = os.toFloat64();
-      }
-   }
-   else
-   {
-      result = ossim::nan();
-   }
-}
-
-
-bool ossimNitfImageHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   if(!ossimObject::saveState(kwl, prefix)) return false;
-   ossimString tagsPrefix = prefix;
-   
-   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
-   {
-      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
-      if (tag.valid())
-      {
-         if(!tag->saveState(kwl, tagsPrefix))
-         {
-            return false;
-         }
-      }
-   }
-   return true;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_0.cpp b/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_0.cpp
deleted file mode 100644
index 4462851..0000000
--- a/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_0.cpp
+++ /dev/null
@@ -1,1039 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageHeaderV2_0.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <cstring> //for memset
-#include <ossim/base/ossimEndian.h>
-#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <stdexcept>
-#include <sstream>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-static const ossimTrace traceDebug(ossimString("ossimNitfImageHeaderV2_0:debug"));
-
-RTTI_DEF1(ossimNitfImageHeaderV2_0,
-          "ossimNitfImageHeaderV2_0",
-          ossimNitfImageHeaderV2_X);
-
-const ossimString ossimNitfImageHeaderV2_0::ISCODE_KW = "iscode";
-const ossimString ossimNitfImageHeaderV2_0::ISCTLH_KW = "isctlh";
-const ossimString ossimNitfImageHeaderV2_0::ISREL_KW = "isrel";
-const ossimString ossimNitfImageHeaderV2_0::ISCAUT_KW = "iscaut";
-const ossimString ossimNitfImageHeaderV2_0::CTLN_KW = "ctln";
-const ossimString ossimNitfImageHeaderV2_0::ISDWNG_KW = "isdwng";
-const ossimString ossimNitfImageHeaderV2_0::ISDEVT_KW = "isdevt";
-
-ossimNitfImageHeaderV2_0::ossimNitfImageHeaderV2_0()
-{
-   clearFields();
-}
-
-ossimNitfImageHeaderV2_0::~ossimNitfImageHeaderV2_0()
-{
-}
-
-void ossimNitfImageHeaderV2_0::parseStream(std::istream &in)
-{
-   clearFields();
-   theImageBands.clear();
-      
-   in.read(theType, 2);
-   if(ossimString(theType) != "IM")
-   {
-      // error
-   }
-   in.read(theImageId, 10);
-   in.read(theDateTime, 14);
-   in.read(theTargetId, 17);
-   in.read(theTitle, 80);
-   in.read(theSecurityClassification, 1);
-   in.read(theCodewords, 40);
-   in.read(theControlAndHandling, 40);
-   in.read(theReleasingInstructions, 40);
-   in.read(theClassificationAuthority, 20);
-   in.read(theSecurityControlNumber, 20);
-   in.read(theSecurityDowngrade, 6);
-   if(ossimString(theSecurityDowngrade) == "999998")
-   {
-      in.read(theDowngradingEvent, 40);
-   }
-   in.read(theEncryption, 1);
-   in.read(theImageSource, 42);
-   in.read(theSignificantRows, 8);
-   in.read(theSignificantCols, 8);
-   in.read(thePixelValueType, 3);
-   in.read(theRepresentation, 8);
-   in.read(theCategory, 8);
-   in.read(theActualBitsPerPixelPerBand, 2);
-   in.read(theJustification, 1);
-   in.read(theCoordinateSystem, 1);
-   if(theCoordinateSystem[0] != 'N')
-   {
-      in.read(theGeographicLocation, 60);
-   }
-   in.read(theNumberOfComments, 1);
-   ossim_uint32 numberOfComments = ossimString(theNumberOfComments).toInt32();
-   if(numberOfComments > 0)
-   {
-      // for now let's ignore the comments about the image
-      in.ignore(numberOfComments*80);
-   }
-   in.read(theCompression, 2);
-   // check to see if there is compression
-   ossimString temp = theCompression;
-   if((temp !=  "NC") &&
-      (temp != "NM"))
-   {
-      // get the rate if compression exists.
-      in.read(theCompressionRateCode, 4);
-   }
-   in.read(theNumberOfBands, 1);
-   ossim_uint32 numberOfBands = ossimString(theNumberOfBands).toUInt32();
-   theImageBands.resize(numberOfBands);
-   ossim_uint32 idx = 0;
-   while(idx < numberOfBands)
-   {
-      theImageBands[idx] = new ossimNitfImageBandV2_0;
-      theImageBands[idx]->parseStream(in);
-      ++idx;
-   }
-   in.read(theImageSyncCode, 1);
-   in.read(theImageMode, 1);
-   in.read(theNumberOfBlocksPerRow, 4);
-   in.read(theNumberOfBlocksPerCol, 4);
-   in.read(theNumberOfPixelsPerBlockHoriz, 4);
-   in.read(theNumberOfPixelsPerBlockVert, 4);
-   in.read(theNumberOfBitsPerPixelPerBand, 2);
-   in.read(theDisplayLevel, 3);
-   in.read(theAttachmentLevel, 3);
-   in.read(theImageLocation, 10);
-   in.read(theImageMagnification, 4);
-   in.read(theUserDefinedImageDataLength, 5);
-   std::streampos userDefinedDataLen = (std::streampos)ossimString(theUserDefinedImageDataLength).toUInt32();
-   theTagList.clear();
-   ossimNitfTagInformation         headerTag;
-   std::streampos start   = in.tellg();
-   std::streampos current = in.tellg();
-   if(userDefinedDataLen > 0)
-   {
-      in.read(theUserDefinedOverflow, 3);
-      
-      while((current - start) < userDefinedDataLen)
-      {
-         headerTag.parseStream(in);
-         theTagList.push_back(headerTag);
-         // in.ignore(headerTag.getTagLength());
-         // headerTag.clearFields();
-         current = in.tellg();
-      }
-   }
-
-   in.read(theExtendedSubheaderDataLen, 5);
-   std::streampos extSubHeadLen = (std::streampos)ossimString(theExtendedSubheaderDataLen).toUInt32();
-   start   = in.tellg();
-   current = in.tellg();
-   if(extSubHeadLen > 0)
-   {
-      in.read(theExtendedSubheaderOverflow, 3);
-
-      // ossim_uint32 test = 0;
-      while((current - start) < extSubHeadLen)
-      {
-         headerTag.parseStream(in);
-         theTagList.push_back(headerTag);
-         // test = headerTag.getTagLength()+in.tellg();
-         // in.ignore(headerTag.getTagLength());
-         // headerTag.clearFields();
-         current = in.tellg();
-      }
-   }
-   
-   ossimString compressionType = theCompression;
-   compressionType = compressionType.trim().upcase();
-   ossimEndian endian;
-   ossim_uint64 locationBefore = in.tellg();
-
-   //---
-   // Note: "C4" added to skip over the image data mask subheader.
-   // See MIL-STD-2500A paragraph 5.5.1.5
-   //
-   // Seems like CIB data does not have.  Could not find a hard and fast
-   // rule in the specs.  Need a better was to detect if this needs to be
-   // read. (drb - 20100317)
-   //---
-   if( (compressionType == "NM") ||
-       (compressionType == "M0") ||
-       (compressionType == "M3") ||
-       (compressionType == "M4") ||
-       ( (compressionType == "C4") && ( !getImageId().contains("CIB")) ) )
-   {
-      in.read((char*)(&theBlockedImageDataOffset), 4);
-      in.read((char*)(&theBlockMaskRecordLength),2);
-      in.read((char*)(&thePadPixelMaskRecordLength), 2);
-      in.read((char*)(&theTransparentOutputPixelCodeLength), 2);
-
-      
-      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-      {
-         endian.swap(theBlockedImageDataOffset);
-         endian.swap(theBlockMaskRecordLength);
-         endian.swap(thePadPixelMaskRecordLength);
-         endian.swap(theTransparentOutputPixelCodeLength);
-      }
-      if(theTransparentOutputPixelCodeLength <9)
-      {
-         if(theTransparentOutputPixelCodeLength != 0)
-         {
-            ossim_uint8 padOutputPixelCode;
-            in.read((char*)(&padOutputPixelCode), 1);
-            thePadOutputPixelCode = padOutputPixelCode;
-         }
-      }
-      else
-      {
-         in.read((char*)(&thePadOutputPixelCode), 2);
-         if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-         {
-            endian.swap(thePadOutputPixelCode);
-         }
-         // I need to add code here to check for justification when its 2 bytes
-         // but the code length is less than 16 bits.
-         //
-      }
-      if(theBlockMaskRecordLength>0)
-      {
-         ossim_uint32 totalNumber = 0;
-         if(theImageMode[0] == 'S')
-         {
-            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
-         }
-         else
-         {
-            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-         }
-         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
-         ossim_uint32 idx = 0;
-         theBlockMaskRecords.resize(totalNumber);
-         in.read((char*)(blockRead), totalNumber*4);
-         for(idx = 0; idx < totalNumber; ++idx)
-         {
-            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-            {
-               endian.swap(blockRead[idx]);
-            }
-            theBlockMaskRecords[idx] = blockRead[idx];
-         }
-         delete [] blockRead;
-      }
-      if((thePadPixelMaskRecordLength > 0)||
-         (( (getCompressionCode().upcase() == "M3"))&&
-          (thePadPixelMaskRecordLength == 0)))
-      {
-         ossim_uint32 totalNumber = 0;
-         if(theImageMode[0] == 'S')
-         {
-            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
-         }
-         else
-         {
-            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-         }
-         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
-         ossim_uint32 idx = 0;
-         thePadPixelMaskRecords.resize(totalNumber);
-         in.read((char*)(blockRead), totalNumber*4);
-         for(idx = 0; idx < totalNumber; ++idx)
-         {
-            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-            {
-               endian.swap(blockRead[idx]);
-            }
-            thePadPixelMaskRecords[idx] = blockRead[idx];
-         }
-         delete [] blockRead;
-      }
-   }
-
-   theCompressionHeader = 0;
-   if((getCompressionCode() == "C4")||
-      (getCompressionCode() == "M4"))
-   {
-      ossimRefPtr<ossimNitfVqCompressionHeader> compressionHeader =
-         new ossimNitfVqCompressionHeader;
-      compressionHeader->parseStream(in);
-      // do a check to see if the compression header is good
-      //
-      
-      if( compressionHeader->getCompressionAlgorithmId()!= 1 )
-      {
-         compressionHeader = 0;
-      }
-      theCompressionHeader = compressionHeader.get();
-   }
-
-   ossim_uint64 delta = (ossim_uint64)in.tellg() - locationBefore;
-   if(delta < theBlockedImageDataOffset)
-   {
-      in.ignore(theBlockedImageDataOffset-delta);
-   }
-   
-   //
-   // The stream should now be at the start of the data location so capture
-   // it.
-   //
-   theDataLocation = in.tellg();
-}
-
-void ossimNitfImageHeaderV2_0::writeStream(std::ostream &out)
-{
-   out.write(theType, 2);
-   out.write(theImageId, 10);
-   out.write(theDateTime, 14);
-   out.write(theTargetId, 17);
-   out.write(theTitle, 80);
-   out.write(theSecurityClassification, 1);
-   out.write(theCodewords, 40);
-   out.write(theControlAndHandling, 40);
-   out.write(theReleasingInstructions, 40);
-   out.write(theClassificationAuthority, 20);
-   out.write(theSecurityControlNumber, 20);
-   out.write(theSecurityDowngrade, 6);
-   if(ossimString(theSecurityDowngrade) == "999998")
-   {
-      out.write(theDowngradingEvent, 40);
-   }
-   out.write(theEncryption, 1);
-   out.write(theImageSource, 42);
-   out.write(theSignificantRows, 8);
-   out.write(theSignificantCols, 8);
-   out.write(thePixelValueType, 3);
-   out.write(theRepresentation, 8);
-   out.write(theCategory, 8);
-   out.write(theActualBitsPerPixelPerBand, 2);
-   out.write(theJustification, 1);
-   out.write(theCoordinateSystem, 1);
-   if(theCoordinateSystem[0] != 'N')
-   {
-      out.write(theGeographicLocation, 60);
-   }
-   out.write(theNumberOfComments, 1);
-   out.write(theCompression, 2);
-   if(ossimString(theCompression) != "NC")
-   {
-      out.write(theCompressionRateCode, 4);
-   }
-   out.write(theNumberOfBands, 1);
-   ossim_uint32 bandIdx = 0;
-   for(bandIdx=0;bandIdx<theImageBands.size();++bandIdx)
-   {
-      theImageBands[bandIdx]->writeStream(out);
-   }
-   out.write(theImageSyncCode, 1);
-   out.write(theImageMode, 1);
-   out.write(theNumberOfBlocksPerRow, 4);
-   out.write(theNumberOfBlocksPerCol, 4);
-   out.write(theNumberOfPixelsPerBlockHoriz, 4);
-   out.write(theNumberOfPixelsPerBlockVert, 4);
-   out.write(theNumberOfBitsPerPixelPerBand, 2);
-   out.write(theDisplayLevel, 3);
-   out.write(theAttachmentLevel, 3);
-   out.write(theImageLocation, 10);
-   out.write(theImageMagnification, 4);
-   out.write(theUserDefinedImageDataLength, 5);
-   if(ossimString(theUserDefinedImageDataLength).toInt32() > 0)
-   {
-      out.write(theUserDefinedOverflow, 3);
-   }
-   ossim_uint32 totalLength = getTotalTagLength();
-   
-   if(totalLength == 0)
-   {
-      //memcpy(theExtendedSubheaderDataLen, "00000", 5);
-      out.write(theExtendedSubheaderDataLen, 5);
-   }
-   else
-   {
-      totalLength += 3; // per Table A-3 of MIL-STD-2500B
-      
-      if(totalLength <= 99999)
-      {
-         std::ostringstream tempOut;
-         
-         tempOut << std::setw(5)
-         << std::setfill('0')
-         << std::setiosflags(ios::right)
-         << totalLength;
-         
-         memcpy(theExtendedSubheaderDataLen, tempOut.str().c_str(), 5);
-         
-         out.write(theExtendedSubheaderDataLen, 5);
-         memset(theExtendedSubheaderOverflow, '0', 3);
-         
-         if(totalLength > 0)
-         {
-            out.write(theExtendedSubheaderOverflow, 3);
-            
-            ossim_uint32 i = 0;
-            
-            for(i = 0; i < theTagList.size(); ++i)
-            {
-               theTagList[i].writeStream(out);
-            }
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_0::writeStream: Only support writing of total tag length < 99999" << std::endl;
-      }
-   }
-}
-
-std::ostream& ossimNitfImageHeaderV2_0::print(std::ostream& out,
-                                              const std::string& prefix) const
-{
-   out << setiosflags(std::ios::left)
-       << prefix << std::setw(24) << "IM:"
-       << theType << "\n"
-       << prefix << std::setw(24) << "IID:"
-       << theImageId  << "\n"
-       << prefix << std::setw(24) << "IDATIM:"
-       << theDateTime << "\n" 
-       << prefix << std::setw(24) << "TGTID:"
-       << theTargetId  << "\n"
-       << prefix << std::setw(24) << "ITITLE:"
-       << theTitle  << "\n"   
-       << prefix << std::setw(24) << "ISCLAS:"
-       << theSecurityClassification << "\n"
-       << prefix << std::setw(24) << "ISCODE:"
-       << theCodewords  << "\n"
-       << prefix << std::setw(24) << "ISCTLH:"
-       << theControlAndHandling << "\n" 
-       << prefix << std::setw(24) << "ISREL:"
-       << theReleasingInstructions << "\n" 
-       << prefix << std::setw(24) << "ISCAUT:"
-       << theClassificationAuthority << "\n" 
-       << prefix << std::setw(24) << "ISCTLN:"
-       << theSecurityControlNumber << "\n" 
-       << prefix << std::setw(24) << "ISDWNG:"
-       << theSecurityDowngrade  << "\n"    
-       << prefix << std::setw(24) << "ISDEBT:"
-       << theDowngradingEvent  << "\n"
-       << prefix << std::setw(24) << "ENCRYP:"
-       << theEncryption  << "\n"
-       << prefix << std::setw(24) << "ISORCE:"
-       << theImageSource  << "\n"
-       << prefix << std::setw(24) << "NROWS:"
-       << theSignificantRows  << "\n"
-       << prefix << std::setw(24) << "NCOLS:"
-       << theSignificantCols  << "\n"
-       << prefix << std::setw(24) << "PVTYPE:"
-       << thePixelValueType  << "\n"
-       << prefix << std::setw(24) << "IREP:"
-       << theRepresentation  << "\n"
-       << prefix << std::setw(24) << "ICAT:"
-       << theCategory  << "\n"      
-       << prefix << std::setw(24) << "ABPP:"
-       << theActualBitsPerPixelPerBand << "\n"
-       << prefix << std::setw(24) << "PJUST:"
-       << theJustification  << "\n"
-       << prefix << std::setw(24) << "ICORDS:"
-       << theCoordinateSystem  << "\n"
-       << prefix << std::setw(24) << "IGEOLO:"
-       << theGeographicLocation  << "\n"
-       << prefix << std::setw(24) << "NICOM:"
-       << theNumberOfComments << "\n" 
-       << prefix << std::setw(24) << "IC:"
-       << theCompression  << "\n"     
-       << prefix << std::setw(24) << "COMRAT:"
-       << theCompressionRateCode  << "\n"
-       << prefix << std::setw(24) << "NBANDS:"
-       << theNumberOfBands  << "\n";
-
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theImageBands.size(); ++idx)
-   {
-      if(theImageBands[idx].valid())
-      {
-         theImageBands[idx]->print(out, prefix, idx); 
-      }
-   }
-   
-   out << prefix << std::setw(24) << "ISYNC:"
-       << theImageSyncCode << "\n" 
-       << prefix << std::setw(24) << "IMODE:"
-       << theImageMode  << "\n"
-       << prefix << std::setw(24) << "NBPR:"
-       << theNumberOfBlocksPerRow << "\n" 
-       << prefix << std::setw(24) << "NBPC:"
-       << theNumberOfBlocksPerCol << "\n" 
-       << prefix << std::setw(24) << "NPPBH:"
-       << theNumberOfPixelsPerBlockHoriz << "\n" 
-       << prefix << std::setw(24) << "NPPBV:"
-       << theNumberOfPixelsPerBlockVert  << "\n"
-       << prefix << std::setw(24) << "NBPP:"
-       << theNumberOfBitsPerPixelPerBand  << "\n"
-       << prefix << std::setw(24) << "IDLVL:"
-       << theDisplayLevel << "\n"
-       << prefix << std::setw(24) << "IALVL:"
-       << theAttachmentLevel << "\n" 
-       << prefix << std::setw(24) << "ILOC:"
-       << theImageLocation << "\n" 
-       << prefix << std::setw(24) << "IMAG:"
-       << theImageMagnification  << "\n"
-       << prefix << std::setw(24) << "UDIDL:"
-       << theUserDefinedImageDataLength  << "\n"
-       << prefix << std::setw(24) << "UDOFL:"
-       << theUserDefinedOverflow  << "\n"
-       << prefix << std::setw(24) << "IXSHDL:"
-       << theExtendedSubheaderDataLen  << "\n"
-       << prefix << std::setw(24) << "IXSOFL:"
-       << theExtendedSubheaderOverflow  << "\n";
-
-   if ( traceDebug() )
-   {
-       out << prefix << std::setw(24) << "theDataLocation:"
-           << theDataLocation << "\n"
-           << prefix << std::setw(24) << "theBlockedImageDataOffset:"
-           << theBlockedImageDataOffset << "\n"
-           << prefix << std::setw(24) << "theBlockMaskRecordLength:"
-           << theBlockMaskRecordLength << "\n"
-           << prefix << std::setw(24) << "thePadPixelMaskRecordLength:"
-           << thePadPixelMaskRecordLength << "\n"
-           << prefix << std::setw(24) << "theTransparentOutputPixelCodeLength:"
-           << theTransparentOutputPixelCodeLength << "\n"
-           << prefix << std::setw(24) << "thePadOutputPixelCode:"
-           << thePadOutputPixelCode << "\n";
-   }
-
-   if(theCompressionHeader.valid())
-   {
-      theCompressionHeader->print(out, prefix);
-   }
-
-   out << std::endl;
-
-   return printTags(out, prefix);
-}
-
-bool ossimNitfImageHeaderV2_0::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   ossimNitfImageHeaderV2_X::saveState(kwl, prefix);
-   std::ostringstream out;
-   
-   kwl.add(prefix, "ITITLE", theTitle);
-
-   ossim_uint32 idx = 0;
-   if(theCompressionHeader.valid())
-   {
-      theCompressionHeader->saveState(kwl, prefix + "compression_header.");
-   }
-   
-   for(idx = 0; idx < theImageBands.size(); ++idx)
-   {
-      if(theImageBands[idx].valid())
-      {
-         theImageBands[idx]->print(out, "", idx); 
-      }
-   }
-   
-   out << std::endl;
-   
-   ossimKeywordlist kwlTemp;
-   
-   std::istringstream in(out.str());
-   if(kwlTemp.parseStream(in))
-   {
-      kwl.add(prefix, kwlTemp);
-   }
-   return true;
-}
-
-bool ossimNitfImageHeaderV2_0::isCompressed()const
-{
-   ossimString temp = theCompression;
-   temp = temp.trim();
-   return ((temp != "NC") &&
-           (temp != "NM"));
-}
-
-bool ossimNitfImageHeaderV2_0::isEncrypted()const
-{
-   return (theEncryption[0] == '1');
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBands()const
-{
-   return ossimString(theNumberOfBands).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfRows()const
-{
-   return ossimString(theSignificantRows).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfCols()const
-{
-   return ossimString(theSignificantCols).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBlocksPerRow()const
-{
-   return ossimString(theNumberOfBlocksPerRow).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBlocksPerCol()const
-{
-   return ossimString(theNumberOfBlocksPerCol).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfPixelsPerBlockHoriz()const
-{
-   return ossimString(theNumberOfPixelsPerBlockHoriz).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfPixelsPerBlockVert()const
-{
-   return ossimString(theNumberOfPixelsPerBlockVert).toInt32();
-}
-
-ossimString ossimNitfImageHeaderV2_0::getImageId()const
-{
-   return theImageId;
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getBitsPerPixelPerBand()const
-{
-   return ossimString(theNumberOfBitsPerPixelPerBand).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_0::getActualBitsPerPixelPerBand()const
-{
-   return ossimString(theActualBitsPerPixelPerBand).toInt32();
-}
-
-ossimString ossimNitfImageHeaderV2_0::getIMode() const
-{
-   return ossimString(theImageMode).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_0::getSecurityClassification()const
-{
-   return ossimString(theSecurityClassification);
-}
-
-ossimString  ossimNitfImageHeaderV2_0::getImageDateAndTime() const
-{
-   return ossimString(theDateTime);
-}
-
-ossimString ossimNitfImageHeaderV2_0::getAcquisitionDateMonthDayYear(ossim_uint8 separationChar)const
-{
-   ossimString result;
-   ossimString month(theDateTime+9,
-                     theDateTime+12);
-   month = month.downcase();
-   if(month == "jan")
-   {
-      result += "01";
-   }
-   else if(month == "feb")
-   {
-      result += "02";
-   }
-   else if(month == "mar")
-   {
-      result += "03";
-   }
-   else if(month == "apr")
-   {
-      result += "04";
-   }
-   else if(month == "may")
-   {
-      result += "05";
-   }
-   else if(month == "jun")
-   {
-      result += "06";
-   }
-   else if(month == "jul")
-   {
-      result += "07";
-   }
-   else if(month == "aug")
-   {
-      result += "08";
-   }
-   else if(month == "sep")
-   {
-      result += "09";
-   }
-   else if(month == "oct")
-   {
-      result += "10";
-   }
-   else if(month == "nov")
-   {
-      result += "11";
-   }
-   else if(month == "dec")
-   {
-      result += "12";
-   }
-   result += ossimString(separationChar);
-   result += ossimString(theDateTime,
-                         theDateTime + 2);
-   result += ossimString(separationChar);
-   ossimString year(theDateTime+12,
-                    theDateTime+14);
-   if(year.toUInt32() < 70)
-   {
-      result += "20";
-   }
-   else
-   {
-      result += "19";
-   }
-   result += ossimString(theDateTime+12,
-                         theDateTime+14);
-
-   return result;
-}
-
-ossimString ossimNitfImageHeaderV2_0::getCategory()const
-{
-   return theCategory;
-}
-
-ossimString ossimNitfImageHeaderV2_0::getImageSource()const
-{
-   return theImageSource;
-}
-
-ossimString ossimNitfImageHeaderV2_0::getRepresentation()const
-{
-   return theRepresentation;
-}
-
-ossimString ossimNitfImageHeaderV2_0::getCoordinateSystem()const
-{
-	return theCoordinateSystem;
-}
-
-ossimString ossimNitfImageHeaderV2_0::getPixelValueType()const
-{
-   return ossimString(thePixelValueType).trim();
-}
-
-bool ossimNitfImageHeaderV2_0::hasBlockMaskRecords()const
-{
-   return (theBlockMaskRecords.size() > 0);
-}
-
-bool ossimNitfImageHeaderV2_0::hasPadPixelMaskRecords()const
-{
-   return (thePadPixelMaskRecords.size() > 0);
-}
-
-bool ossimNitfImageHeaderV2_0::hasTransparentCode()const
-{
-   return (theTransparentOutputPixelCodeLength > 0);
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_0::getTransparentCode()const
-{
-   return thePadOutputPixelCode;
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_0::getBlockMaskRecordOffset(ossim_uint32 blockNumber,
-                                                                ossim_uint32 bandNumber)const
-{
-   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-   ossim_uint32 result = 0xffffffff;
-   
-   if((hasBlockMaskRecords())&&
-      (blockNumber < maxBlock))
-   {
-      if(theImageMode[0] == 'S')
-      {
-         if(bandNumber < (ossim_uint32)getNumberOfBands())
-         {
-            result = theBlockMaskRecords[bandNumber*maxBlock + blockNumber];
-         }
-      }
-      else
-      {
-         result = theBlockMaskRecords[blockNumber];
-      }
-   }
-
-   return result;
-}
-ossim_uint32 ossimNitfImageHeaderV2_0::getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
-                                                                   ossim_uint32 bandNumber)const
-{
-   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-   ossim_uint32 result = 0xffffffff;
-   
-   if((hasPadPixelMaskRecords())&&
-      (blockNumber < maxBlock))
-   {
-      if(theImageMode[0] == 'S')
-      {
-         if(bandNumber < (ossim_uint32)getNumberOfBands())
-         {
-            result = thePadPixelMaskRecords[bandNumber*maxBlock + blockNumber];
-         }
-      }
-      else
-      {
-         result = thePadPixelMaskRecords[blockNumber];
-      }
-   }
-
-   return result;
-}
-
-void ossimNitfImageHeaderV2_0::clearFields()
-{
-   theTagList.clear();
-   
-   memcpy(theType, "IM", 2);
-   memset(theImageId, ' ', 10);
-   memset(theDateTime, ' ', 14);
-   memset(theTargetId, ' ', 17);
-   memset(theTitle, ' ', 80);
-   memset(theSecurityClassification, ' ', 1);
-   memset(theCodewords, ' ', 40);
-   memset(theControlAndHandling, ' ', 40);
-   memset(theReleasingInstructions, ' ', 40);
-   memset(theClassificationAuthority, ' ', 20);
-   memset(theSecurityControlNumber, ' ', 20);
-   memset(theSecurityDowngrade, ' ', 6);
-   memset(theDowngradingEvent, ' ', 40);
-   memset(theEncryption, '0', 1);
-   memset(theImageSource, ' ', 42);
-   memset(theSignificantRows, ' ', 8);
-   memset(theSignificantCols, ' ', 8);
-   memset(thePixelValueType, ' ', 3);
-   memset(theRepresentation, ' ', 8);
-   memset(theCategory, ' ', 8);
-   memset(theActualBitsPerPixelPerBand, '0', 2);
-   memset(theJustification, ' ', 1);
-   memset(theCoordinateSystem, 'N', 1);
-   memset(theGeographicLocation, ' ', 60);
-   memset(theNumberOfComments, '0', 1);
-   memcpy(theCompression, "NC", 2);
-   memset(theCompressionRateCode, ' ', 4);
-   memset(theNumberOfBands, ' ', 1);
-   memset(theImageSyncCode, '0', 1);
-   memset(theImageMode, ' ', 1);
-   memset(theNumberOfBlocksPerRow, ' ', 4);
-   memset(theNumberOfBlocksPerCol, ' ', 4);
-   memset(theNumberOfPixelsPerBlockHoriz, ' ', 4);
-   memset(theNumberOfPixelsPerBlockVert, ' ', 4);
-   memset(theNumberOfBitsPerPixelPerBand, '0', 2);
-   memset(theDisplayLevel, ' ', 3);
-   memset(theAttachmentLevel, ' ', 3);
-   memcpy(theImageLocation, "0000000000", 10);
-   memcpy(theImageMagnification, "1.00", 4);
-   memset(theUserDefinedImageDataLength, '0', 5);
-   memset(theUserDefinedOverflow, '0', 3);
-   memset(theExtendedSubheaderDataLen, '0', 5);
-   memset(theExtendedSubheaderOverflow, ' ', 3);
-   
-   theBlockMaskRecords.clear();
-   thePadPixelMaskRecords.clear();
-
-   theBlockedImageDataOffset = 0;
-   theBlockMaskRecordLength = 0;
-   thePadPixelMaskRecordLength = 0;
-   theTransparentOutputPixelCodeLength = 0;
-   thePadOutputPixelCode = 0;
-   theCompressionHeader  = 0;
-   theType[2] = '\0';
-   theImageId[10] = '\0';
-   theDateTime[14] = '\0';
-   theTargetId[17] = '\0';
-   theTitle[80] = '\0';
-   theSecurityClassification[1] = '\0';
-   theCodewords[40] = '\0';
-   theControlAndHandling[40] = '\0';
-   theReleasingInstructions[40] = '\0';
-   theClassificationAuthority[20] = '\0';
-   theSecurityControlNumber[20] = '\0';
-   theSecurityDowngrade[6] = '\0';
-   theDowngradingEvent[40] = '\0';
-   theEncryption[1] = '\0';
-   theImageSource[42] = '\0';
-   theSignificantRows[8] = '\0';
-   theSignificantCols[8] = '\0';
-   thePixelValueType[3] = '\0';
-   theRepresentation[8] = '\0';
-   theCategory[8] = '\0';
-   theActualBitsPerPixelPerBand[2] = '\0';
-   theJustification[1] = '\0';
-   theCoordinateSystem[1] = '\0';
-   theGeographicLocation[60] = '\0';
-   theNumberOfComments[1] = '\0';
-   theCompression[2] = '\0';
-   theCompressionRateCode[4] = '\0';
-   theNumberOfBands[1] = '\0';
-   theImageSyncCode[1] = '\0';
-   theImageMode[1] = '\0';
-   theNumberOfBlocksPerRow[4] = '\0';
-   theNumberOfBlocksPerCol[4] = '\0';
-   theNumberOfPixelsPerBlockHoriz[4] = '\0';
-   theNumberOfPixelsPerBlockVert[4] = '\0';
-   theNumberOfBitsPerPixelPerBand[2] = '\0';
-   theDisplayLevel[3] = '\0';
-   theAttachmentLevel[3] = '\0';
-   theImageLocation[10] = '\0';
-   theImageMagnification[4] = '\0';
-   theUserDefinedImageDataLength[5] = '\0';
-   theUserDefinedOverflow[3] = '\0';
-   theExtendedSubheaderDataLen[5] = '\0';
-   theExtendedSubheaderOverflow[3] = '\0'; 
-   theDataLocation = 0;
-}
-
-const ossimRefPtr<ossimNitfCompressionHeader> ossimNitfImageHeaderV2_0::getCompressionHeader()const
-{
-   return theCompressionHeader;
-}
-
-const ossimRefPtr<ossimNitfImageBand> ossimNitfImageHeaderV2_0::getBandInformation(ossim_uint32 idx)const
-{
-   if(idx < theImageBands.size())
-   {
-      return (ossimNitfImageBand*)theImageBands[idx].get();
-   }
-   
-   return NULL;
-}
-
-void ossimNitfImageHeaderV2_0::setNumberOfBands(ossim_uint32 nbands)
-{
-   std::ostringstream out;
-   if(nbands > 9)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimNitfImageHeaderV2_0::setNumberOfBands: NBANDS is too large.  For 2.0 spec we can only have up to 9 bands\n";
-      }
-      std::string s = "ossimNitfImageHeaderV2_0::setNumberOfBands:";
-      s += " ERROR\nExceeded max number of bands of 9!";
-      throw std::out_of_range(s);
-   }
-   else
-   {
-      out << nbands;
-      theNumberOfBands[0] = out.str().c_str()[0];
-   }
-   
-   theImageBands.resize(getNumberOfBands());
-}
-
-void ossimNitfImageHeaderV2_0::setBandInfo(ossim_uint32 idx,
-                                           const ossimNitfImageBandV2_0& info)
-{
-   if(idx < theImageBands.size())
-   {
-      if(!theImageBands[idx].valid())
-      {
-         theImageBands[idx] = new ossimNitfImageBandV2_0;
-      }
-      (*theImageBands[idx]) = info;
-   }
-}
-void ossimNitfImageHeaderV2_0::setNumberOfRows(ossim_uint32 rows)
-{
-   std::ostringstream out;
-   if(rows > 99999999) rows = 99999999;
-   
-   out << rows;
-   ossimNitfCommon::setField(theSignificantRows, out.str(), 8, ios::right, '0');
-}
-
-void ossimNitfImageHeaderV2_0::setNumberOfCols(ossim_uint32 cols)
-{
-   std::ostringstream out;
-   if(cols > 99999999) cols = 99999999;
-   
-   out << cols;
-   ossimNitfCommon::setField(theSignificantCols, out.str(), 8, ios::right, '0');
-}
-
-void ossimNitfImageHeaderV2_0::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimNitfImageHeaderV2_X::setProperty(property);
-}
-
-ossimRefPtr<ossimProperty> ossimNitfImageHeaderV2_0::getProperty(const ossimString& name)const
-{
-   ossimRefPtr<ossimProperty> property = 0;
-   if(name == ISCODE_KW)
-   {
-      property = new ossimStringProperty(name, theCodewords);
-   }
-   else if(name == ISCTLH_KW)
-   {
-      property = new ossimStringProperty(name, theControlAndHandling);
-   }
-   else if(name == ISREL_KW)
-   {
-      property = new ossimStringProperty(name, theReleasingInstructions);
-   }
-   else if(name == ISCAUT_KW)
-   {
-      property = new ossimStringProperty(name, theClassificationAuthority);
-   }
-   else if(name == CTLN_KW)
-   {
-      property = new ossimStringProperty(name, theSecurityControlNumber);
-   }
-   else if(name == ISDWNG_KW)
-   {
-      property = new ossimStringProperty(name, theSecurityDowngrade);
-   }
-   else if(name == ISDEVT_KW)
-   {
-      property = new ossimStringProperty(name, theDowngradingEvent);
-   }
-   else 
-   {
-      property = ossimNitfImageHeaderV2_X::getProperty(name);
-   }
-   return property;
-}
-
-void ossimNitfImageHeaderV2_0::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfImageHeaderV2_X::getPropertyNames(propertyNames);
-   propertyNames.push_back(ISCODE_KW);
-   propertyNames.push_back(ISCTLH_KW);
-   propertyNames.push_back(ISREL_KW);
-   propertyNames.push_back(ISCAUT_KW);
-   propertyNames.push_back(CTLN_KW);
-   propertyNames.push_back(ISDWNG_KW);
-   propertyNames.push_back(ISDEVT_KW);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_1.cpp b/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_1.cpp
deleted file mode 100644
index a78e794..0000000
--- a/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_1.cpp
+++ /dev/null
@@ -1,1816 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageHeaderV2_1.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <sstream>
-#include <iomanip>
-#include <cstring> // for memset
-
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimDms.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimIoStream.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
-#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h>
-
-RTTI_DEF1(ossimNitfImageHeaderV2_1,
-          "ossimNitfImageHeaderV2_1",
-          ossimNitfImageHeaderV2_X)
-
-const ossimString ossimNitfImageHeaderV2_1::ISCLSY_KW = "isclsy";
-const ossimString ossimNitfImageHeaderV2_1::ISCODE_KW = "iscode";
-const ossimString ossimNitfImageHeaderV2_1::ISCTLH_KW = "isctlh";
-const ossimString ossimNitfImageHeaderV2_1::ISREL_KW  = "isrel";
-const ossimString ossimNitfImageHeaderV2_1::ISDCTP_KW = "isdctp";
-const ossimString ossimNitfImageHeaderV2_1::ISDCDT_KW = "isdcdt";
-const ossimString ossimNitfImageHeaderV2_1::ISDCXM_KW = "isdcxm";
-const ossimString ossimNitfImageHeaderV2_1::ISDG_KW   = "isdg";
-const ossimString ossimNitfImageHeaderV2_1::ISDGDT_KW = "isdgdt";
-const ossimString ossimNitfImageHeaderV2_1::ISCLTX_KW = "iscltx";
-const ossimString ossimNitfImageHeaderV2_1::ISCATP_KW = "iscatp";
-const ossimString ossimNitfImageHeaderV2_1::ISCAUT_KW = "iscaut";
-const ossimString ossimNitfImageHeaderV2_1::ISCRSN_KW = "iscrsn";
-const ossimString ossimNitfImageHeaderV2_1::ISSRDT_KW = "issrdt";
-const ossimString ossimNitfImageHeaderV2_1::ISCTLN_KW = "isctln";
-const ossimString ossimNitfImageHeaderV2_1::XBANDS_KW = "xbands";
-
-static const
-ossimTrace traceDebug(ossimString("ossimNitfImageHeaderV2_1:debug"));
-
-ossimNitfImageHeaderV2_1::ossimNitfImageHeaderV2_1()
-{
-   clearFields();
-}
-ossimNitfImageHeaderV2_1::~ossimNitfImageHeaderV2_1()
-{
-}
-
-void ossimNitfImageHeaderV2_1::parseStream(std::istream &in)
-{
-   parseStream(in, NULL);
-}
-
-void ossimNitfImageHeaderV2_1::parseStream(std::istream &in, const ossimNitfFileHeaderV2_1 *file)
-{
-   if (!in)
-   {
-      return;
-   }
-   clearFields();
-   theTagList.clear();
-   in.read(theType, 2);
-   in.read(theImageId, 10);
-   in.read(theDateTime,14);
-   in.read(theTargetId, 17);
-   in.read(theTitle, 80);
-   in.read(theSecurityClassification, 1);
-   in.read(theSecurityClassificationSys, 2);
-   in.read(theCodewords, 11);
-   in.read(theControlAndHandling, 2);
-   in.read(theReleasingInstructions, 20);
-   in.read(theDeclassificationType, 2);
-   in.read(theDeclassificationDate, 8);
-   in.read(theDeclassificationExempt, 4);
-   in.read(theDowngrade, 1);
-   in.read(theDowngradeDate, 8);
-   in.read(theClassificationText, 43);
-   in.read(theClassificationAuthType, 1);
-   in.read(theClassificationAuthority, 40);
-   in.read(theClassificationReason, 1);
-   in.read(theSecuritySourceDate, 8);
-   in.read(theSecurityControlNumber, 15);
-   in.read(theEncryption, 1);
-   in.read(theImageSource, 42);
-   in.read(theSignificantRows, 8);
-   in.read(theSignificantCols, 8);
-   in.read(thePixelValueType, 3);
-   in.read(theRepresentation, 8);
-   in.read(theCategory, 8);
-   in.read(theActualBitsPerPixelPerBand, 2);
-   in.read(theJustification, 1);
-   in.read(theCoordinateSystem, 1);
-   // if it's not blank then read coordinates
-   if(theCoordinateSystem[0] != ' ')
-   {
-      in.read(theGeographicLocation, 60);
-   }
-   in.read(theNumberOfComments, 1);
-   ossim_int32 numberOfComments = ossimString(theNumberOfComments).toInt32();
-   
-   // for now just ignore the comments
-   if(numberOfComments > 0)
-   {
-      in.ignore(numberOfComments*80);
-   }
-   in.read(theCompression, 2);
-   
-   // only need the Rate code if its not
-   // NC (No compression)
-   ossimString temp = theCompression;
-   if((temp != "NC") &&
-      (temp != "NM"))
-   {
-      in.read(theCompressionRateCode, 4);
-   }
-   in.read(theNumberOfBands, 1);
-   // check to see if multi spectral bands
-   // exceed 9.  A value of 0 indicates this
-   ossim_int32 numberOfBands = ossimString(theNumberOfBands).toInt32();
-   if (numberOfBands == 0)
-   {
-      in.read(theNumberOfMultispectralBands, 5);
-      numberOfBands = ossimString(theNumberOfMultispectralBands).toInt32();
-   }
-   theImageBands.clear();
-   theImageBands.resize(numberOfBands);
-   for (ossim_int32 band = 0; band < numberOfBands; ++band)
-   {
-      theImageBands[band] = new ossimNitfImageBandV2_1;
-      theImageBands[band]->parseStream(in);
-   }
-   in.read(theImageSyncCode, 1);
-   in.read(theImageMode, 1);
-   in.read(theNumberOfBlocksPerRow, 4);
-   in.read(theNumberOfBlocksPerCol, 4);
-   in.read(theNumberOfPixelsPerBlockHoriz, 4);
-   in.read(theNumberOfPixelsPerBlockVert, 4);
-   in.read(theNumberOfBitsPerPixelPerBand, 2);
-   in.read(theDisplayLevel, 3);
-   in.read(theAttachmentLevel, 3);
-   in.read(theImageLocation, 10);
-   in.read(theImageMagnification, 4);
-   in.read(theUserDefinedImageDataLength, 5);
-   
-   ossimNitfTagInformation         headerTag;
-   std::streampos start   = in.tellg();
-   std::streampos current = in.tellg();
-   
-   std::streampos userDefinedDataLen
-      = ossimString(theUserDefinedImageDataLength).toInt32();
-   if(userDefinedDataLen > 0)
-   {
-      in.read(theUserDefinedOverflow, 3);
-      current = in.tellg();
-      
-      while((current - start) < userDefinedDataLen)
-      {
-         headerTag.parseStream(in);
-         theTagList.push_back(headerTag);
-         headerTag.setTagType("UDID");
-         // in.ignore(headerTag.getTagLength());
-         // headerTag.clearFields();
-         current = in.tellg();
-      }
-//      in.seekg(start + userDefinedDataLen);
-            ossim_int32 overflow = ossimString(theUserDefinedOverflow).toLong();
-      if (overflow != 0 && file != NULL)
-      {
-         ossimNitfDataExtensionSegment *des = file->getNewDataExtensionSegment(overflow-1, in);
-         if (des != NULL)
-         {
-            const vector<ossimNitfTagInformation> &desTags = des->getTagList();
-            for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
-            {
-               iter->setTagType("UDID");
-               theTagList.push_back(*iter);
-            }
-         }
-         delete des;
-      }
-      ossimIFStream64::seekg64(in, start + userDefinedDataLen, ios::beg);
-   }
-   in.read(theExtendedSubheaderDataLen, 5);
-   std::streampos extSubHeadLen = ossimString(theExtendedSubheaderDataLen).toInt32();
-   start   = in.tellg();
-   current = in.tellg();
-   if(extSubHeadLen > 0)
-   {
-      in.read(theExtendedSubheaderOverflow, 3);
-      current = in.tellg();
-      while((current - start) < extSubHeadLen)
-      {
-         headerTag.parseStream(in);
-         headerTag.setTagType("IXSHD");
-         theTagList.push_back(headerTag);
-         
-         // in.ignore(headerTag.getTagLength());
-         // headerTag.clearFields();
-         current = in.tellg();
-      }
-//      in.seekg(start + extSubHeadLen);
-      ossim_int32 overflow = ossimString(theExtendedSubheaderOverflow).toLong();
-      if (overflow != 0 && file != NULL)
-      {
-         ossimNitfDataExtensionSegment *des = file->getNewDataExtensionSegment(overflow-1, in);
-         if (des != NULL)
-         {
-            const vector<ossimNitfTagInformation> &desTags = des->getTagList();
-            for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
-            {
-               iter->setTagType("IXSHD");
-               theTagList.push_back(*iter);
-            }
-            delete des;
-         }
-      }
-      ossimIFStream64::seekg64(in, start + extSubHeadLen, ios::beg);
-   }
-   ossimString compressionType = theCompression;
-   compressionType = compressionType.trim().upcase();
-   ossimEndian endian;
-
-   //---
-   // Note: "C4" added to skip over the image data mask subheader.
-   // See MIL-STD-2500C paragraph 5.4.3.2
-   //---
-   if((compressionType == "NM")||
-      (compressionType == "M1")||
-      (compressionType == "M3")||
-      (compressionType == "M4")||
-      (compressionType == "M5")||
-      (compressionType == "C4"))
-   {
-      ossim_uint64 locationBefore = in.tellg();
-      in.read((char*)(&theBlockedImageDataOffset), 4);
-      in.read((char*)(&theBlockMaskRecordLength),2);
-      in.read((char*)(&thePadPixelMaskRecordLength), 2);
-      in.read((char*)(&theTransparentOutputPixelCodeLength), 2);
-
-      
-      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-      {
-         endian.swap(theBlockedImageDataOffset);
-         endian.swap(theBlockMaskRecordLength);
-         endian.swap(thePadPixelMaskRecordLength);
-         endian.swap(theTransparentOutputPixelCodeLength);
-      }
-      if(theTransparentOutputPixelCodeLength <9)
-      {
-         if(theTransparentOutputPixelCodeLength != 0)
-         {
-            ossim_uint8 padOutputPixelCode;
-            in.read((char*)(&padOutputPixelCode), 1);
-            thePadOutputPixelCode = padOutputPixelCode;
-         }
-      }
-      else
-      {
-         in.read((char*)(&thePadOutputPixelCode), 2);
-         if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-         {
-            endian.swap(thePadOutputPixelCode);
-         }
-         // I need to add code here to check for justification when its 2 bytes
-         // but the code length is less than 16 bits.
-         //
-      }
-      if(theBlockMaskRecordLength>0)
-      {
-         ossim_uint32 totalNumber = 0;
-         if(theImageMode[0] == 'S')
-         {
-             totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
-         }
-         else
-         {
-            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-         }
-         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
-         ossim_uint32 idx = 0;
-         theBlockMaskRecords.resize(totalNumber);
-         in.read((char*)(blockRead), totalNumber*4);
-         for(idx = 0; idx < totalNumber; ++idx)
-         {
-            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-            {
-               endian.swap(blockRead[idx]);
-            }
-            theBlockMaskRecords[idx] = blockRead[idx];
-         }
-         delete [] blockRead;
-      }
-      if( (thePadPixelMaskRecordLength > 0) ||
-          ( (getCompressionCode().upcase() == "M3") && (thePadPixelMaskRecordLength == 0) ) )
-      {
-         ossim_uint32 totalNumber = 0;
-         if(theImageMode[0] == 'S')
-         {
-            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
-         }
-         else
-         {
-            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-         }
-         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
-         ossim_uint32 idx = 0;
-         thePadPixelMaskRecords.resize(totalNumber);
-         in.read((char*)(blockRead), totalNumber*4);
-         for(idx = 0; idx < totalNumber; ++idx)
-         {
-            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-            {
-               endian.swap(blockRead[idx]);
-            }
-            thePadPixelMaskRecords[idx] = blockRead[idx];
-         }
-         delete [] blockRead;
-      }
-      theCompressionHeader = 0;
-      if((getCompressionCode() == "C4")||
-         (getCompressionCode() == "M4"))
-      {
-         ossimRefPtr<ossimNitfVqCompressionHeader> compressionHeader = new ossimNitfVqCompressionHeader;
-         compressionHeader->parseStream(in);
-         // do a check to see if the compression header is good
-         //
-         if(compressionHeader->getCompressionAlgorithmId()!= 1)
-         {
-            compressionHeader = 0;
-         }
-         theCompressionHeader = compressionHeader.get();
-      }
-      
-      ossim_uint64 delta = (ossim_uint64)in.tellg() - locationBefore;
-      if(delta < theBlockedImageDataOffset)
-      {
-         in.ignore(theBlockedImageDataOffset-delta);
-      }
-   }
-   //***
-   // The stream should now be at the start of the data location so capture
-   // it.
-   //***
-   theDataLocation = in.tellg();
-}
-
-void ossimNitfImageHeaderV2_1::writeStream(std::ostream &out)
-{
-   out.write(theType, 2);
-   out.write(theImageId, 10);
-   out.write(theDateTime,14);
-   out.write(theTargetId, 17);
-   out.write(theTitle, 80);
-   out.write(theSecurityClassification, 1);
-   out.write(theSecurityClassificationSys, 2);
-   out.write(theCodewords, 11);
-   out.write(theControlAndHandling, 2);
-   out.write(theReleasingInstructions, 20);
-   out.write(theDeclassificationType, 2);
-   out.write(theDeclassificationDate, 8);
-   out.write(theDeclassificationExempt, 4);
-   out.write(theDowngrade, 1);
-   out.write(theDowngradeDate, 8);
-   out.write(theClassificationText, 43);
-   out.write(theClassificationAuthType, 1);
-   out.write(theClassificationAuthority, 40);
-   out.write(theClassificationReason, 1);
-   out.write(theSecuritySourceDate, 8);
-   out.write(theSecurityControlNumber, 15);
-   out.write(theEncryption, 1);
-   out.write(theImageSource, 42);
-   out.write(theSignificantRows, 8);
-   out.write(theSignificantCols, 8);
-   out.write(thePixelValueType, 3);
-   out.write(theRepresentation, 8);
-   out.write(theCategory, 8);
-   out.write(theActualBitsPerPixelPerBand, 2);
-   out.write(theJustification, 1);
-   out.write(theCoordinateSystem, 1);
-   
-   if(theCoordinateSystem[0] != ' ')
-   {
-      out.write(theGeographicLocation, 60);
-   }
-   // for now force the number of comments to be 0
-   out.write(theNumberOfComments, 1);
-   
-   out.write(theCompression, 2);
-   ossimString compressionTest = theCompression;
-   if(compressionTest != "NC" &&
-      compressionTest != "NM")
-     {
-      out.write(theCompressionRateCode, 4);
-     }
-
-   out.write(theNumberOfBands, 1);
-
-   if(ossimString(theNumberOfBands).toInt32() == 0)
-   {
-      out.write(theNumberOfMultispectralBands, 5);
-   }
-
-   if(theImageBands.size())
-   {
-      ossim_uint32 idx = 0;
-      for(idx = 0; idx < theImageBands.size(); ++idx)
-      {
-         if (theImageBands[idx].valid() == false)
-         {
-            theImageBands[idx] = new ossimNitfImageBandV2_1;
-         }
-         theImageBands[idx]->writeStream(out);
-      }
-   }
-
-   out.write(theImageSyncCode, 1);
-   out.write(theImageMode, 1);
-   out.write(theNumberOfBlocksPerRow, 4);
-   out.write(theNumberOfBlocksPerCol, 4);
-   out.write(theNumberOfPixelsPerBlockHoriz, 4);
-   out.write(theNumberOfPixelsPerBlockVert, 4);
-   out.write(theNumberOfBitsPerPixelPerBand, 2);
-   out.write(theDisplayLevel, 3);
-   out.write(theAttachmentLevel, 3);
-   out.write(theImageLocation, 10);
-   out.write(theImageMagnification, 4);
-   out.write(theUserDefinedImageDataLength, 5);
-
-   if(ossimString(theUserDefinedImageDataLength).toInt32() > 0)
-   {
-      out.write(theUserDefinedOverflow, 3);
-   }
-
-   // need to ouput tagged data
-   // here
-   //
-   ossim_uint32 totalLength = getTotalTagLength();
-
-   if (totalLength == 0)
-   {
-      out.write(theExtendedSubheaderDataLen, 5);
-   }
-   else
-   {
-      totalLength += 3; // per Table A-3 of MIL-STD-2500B
-      
-      if(totalLength <= 99999)
-      {
-         std::ostringstream tempOut;
-         
-         tempOut << std::setw(5)
-                 << std::setfill('0')
-                 << std::setiosflags(ios::right)
-                 << totalLength;
-         
-         memcpy(theExtendedSubheaderDataLen, tempOut.str().c_str(), 5);
-         
-         out.write(theExtendedSubheaderDataLen, 5);
-         memset(theExtendedSubheaderOverflow, '0', 3);
-         
-         if(totalLength > 0)
-         {
-            out.write(theExtendedSubheaderOverflow, 3);
-            
-            ossim_uint32 i = 0;
-            
-            for(i = 0; i < theTagList.size(); ++i)
-            {
-               theTagList[i].writeStream(out);
-            }
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length < 99999" << std::endl;
-      }
-   }
-}
-
-std::ostream& ossimNitfImageHeaderV2_1::print(std::ostream& out,
-                                              const std::string& prefix) const
-{
-   out << setiosflags(ios::left)
-       << prefix << setw(24)
-       << "IM:"     << theType << "\n"
-       << prefix << setw(24)
-       << "IID1:"   << theImageId << "\n"
-       << prefix << setw(24)
-       << "IDATIM:" << theDateTime << "\n"
-       << prefix << setw(24)
-       << "TGTID:"  << theTargetId << "\n"
-       << prefix << setw(24)
-       << "IID2:"   << theTitle << "\n"
-       << prefix << setw(24)
-       << "ISCLAS:" << theSecurityClassification << "\n"
-       << prefix << setw(24)
-       << "ISCLSY:" << theSecurityClassificationSys << "\n"
-       << prefix << setw(24)
-       << "ISCODE:" << theCodewords << "\n"
-       << prefix << setw(24)
-       << "ISCTLH:" << theControlAndHandling << "\n"
-       << prefix << setw(24)
-       << "ISREL:"  << theReleasingInstructions << "\n"
-       << prefix << setw(24)
-       << "ISDCTP:" << theDeclassificationType << "\n"
-       << prefix << setw(24)
-       << "ISDCDT:" << theDeclassificationDate << "\n"
-       << prefix << setw(24)
-       << "ISDCXM:" << theDeclassificationExempt << "\n"
-       << prefix << setw(24)
-       << "ISDG:"   << theDowngrade << "\n"
-       << prefix << setw(24)
-       << "ISDGDT:" << theDowngradeDate << "\n"
-       << prefix << setw(24)
-       << "ISCLTX:" << theClassificationText << "\n"
-       << prefix << setw(24)
-       << "ISCATP:" << theClassificationAuthType << "\n"
-       << prefix << setw(24)
-       << "ISCAUT:" << theClassificationAuthority << "\n"
-       << prefix << setw(24)
-       << "ISCRSN:" << theClassificationReason << "\n"
-       << prefix << setw(24)
-       << "ISSRDT:" << theSecuritySourceDate << "\n"
-       << prefix << setw(24)
-       << "ISCTLN:" << theSecurityControlNumber << "\n"
-       << prefix << setw(24)
-       << "ENCRYP:" << theEncryption << "\n"
-       << prefix << setw(24)
-       << "ISORCE:" << theImageSource << "\n"
-       << prefix << setw(24)
-       << "NROWS:"  << theSignificantRows << "\n"
-       << prefix << setw(24)
-       << "NCOLS:"  << theSignificantCols << "\n"
-       << prefix << setw(24)
-       << "PVTYPE:" << thePixelValueType << "\n"
-       << prefix << setw(24)
-       << "IREP:"   << theRepresentation << "\n"
-       << prefix << setw(24)
-       << "ICAT:"   << theCategory << "\n"
-       << prefix << setw(24)
-       << "ABPP:"   << theActualBitsPerPixelPerBand << "\n"
-       << prefix << setw(24)
-       << "PJUST:"  << theJustification << "\n"
-       << prefix << setw(24)
-       << "ICORDS:" << theCoordinateSystem << "\n"
-       << prefix << setw(24)
-       << "IGEOLO:" << theGeographicLocation << "\n"
-       << prefix << setw(24)
-       << "NICOM:"  << theNumberOfComments << "\n"
-       << prefix << setw(24)
-       << "IC:"     << theCompression << "\n"
-       << prefix << setw(24)
-       << "COMRAT:" << theCompressionRateCode << "\n"
-       << prefix << setw(24)
-       << "NBANDS:" << theNumberOfBands << "\n"
-       << prefix << setw(24)
-       << "XBANDS:" << theNumberOfMultispectralBands << "\n";
-   
-   ossim_uint32 idx = 0;
-   for(idx = 0; idx < theImageBands.size(); ++idx)
-   {
-      if(theImageBands[idx].valid())
-      {
-         theImageBands[idx]->print(out, prefix, idx); 
-      }
-   }
-
-   out << prefix << setw(24)
-       << "ISYNC:"     << theImageSyncCode << "\n"
-       << prefix << setw(24)
-       << "IMODE:"     << theImageMode << "\n"
-       << prefix << setw(24)
-       << "NBPR:"      << theNumberOfBlocksPerRow << "\n"
-       << prefix << setw(24)
-       << "NBPC:"      << theNumberOfBlocksPerCol << "\n"
-       << prefix << setw(24)
-       << "NPPBH:"     << theNumberOfPixelsPerBlockHoriz << "\n"
-       << prefix << setw(24)
-       << "NPPBV:"     << theNumberOfPixelsPerBlockVert << "\n"
-       << prefix << setw(24)
-       << "NBPP:"      << theNumberOfBitsPerPixelPerBand << "\n"
-       << prefix << setw(24)
-       << "IDLVL:"     << theDisplayLevel << "\n"
-       << prefix << setw(24)
-       << "IALVL:"     << theAttachmentLevel << "\n"
-       << prefix << setw(24)
-       << "ILOC:"      << theImageLocation << "\n"
-       << prefix << setw(24)
-       << "IMAG:"      << theImageMagnification << "\n"
-       << prefix << setw(24)
-       << "UDIDL:"     << theUserDefinedImageDataLength << "\n"
-       << prefix << setw(24)
-       << "UDOFL:"     << theUserDefinedOverflow << "\n"
-       << prefix << setw(24)
-       << "IXSHDL:"    << theExtendedSubheaderDataLen << "\n"
-       << prefix << setw(24)
-       << "IXSOFL:"    << theExtendedSubheaderOverflow << "\n"
-       << prefix << setw(24)
-       << "IMDATOFF:"  << theBlockedImageDataOffset << "\n"
-       << prefix << setw(24)
-       << "BMRLNTH:"   << theBlockMaskRecordLength << "\n"
-       << prefix << setw(24)
-       << "TMRLNTH:"   << thePadPixelMaskRecordLength << "\n"
-       << prefix << setw(24)
-       << "TPXCDLNTH:" << theTransparentOutputPixelCodeLength << "\n"
-       << prefix << setw(24)
-       << "TPXCD:"     << thePadOutputPixelCode << "\n";
-
-   if ( traceDebug() )
-   {
-      out << prefix << setw(24)
-          << "theDataLocation:" << theDataLocation << "\n";
-   }
-
-   out << std::endl;
-
-   return printTags(out, prefix);
-}
-
-
-bool ossimNitfImageHeaderV2_1::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   ossimNitfImageHeaderV2_X::saveState(kwl, prefix);
-   
-   kwl.add(prefix, "ISCLSY", theSecurityClassificationSys);
-   kwl.add(prefix, "ISCODE", theCodewords);
-   kwl.add(prefix, "ISCTLH", theControlAndHandling);
-   kwl.add(prefix, "ISREL", theReleasingInstructions);
-   kwl.add(prefix, "ISDCTP", theDeclassificationType);
-   kwl.add(prefix, "ISDCDT", theDeclassificationDate);
-   kwl.add(prefix, "ISDCXM", theDeclassificationExempt);
-   kwl.add(prefix, "ISDG", theDowngrade);
-   kwl.add(prefix, "ISDGDT", theDowngradeDate);
-   kwl.add(prefix, "ISCLTX", theClassificationText);
-   kwl.add(prefix, "ISCATP", theClassificationAuthType);
-   kwl.add(prefix, "ISCAUT", theClassificationAuthority);
-   kwl.add(prefix, "ISCRSN", theClassificationReason);
-   kwl.add(prefix, "ISSRDT", theSecuritySourceDate);
-   kwl.add(prefix, "ISCTLN", theSecurityControlNumber);
-   kwl.add(prefix, "XBANDS", theNumberOfMultispectralBands);
-   
-   ossim_uint32 idx = 0;
-   
-   std::ostringstream out;
-   if(theCompressionHeader.valid())
-   {
-      theCompressionHeader->saveState(kwl, prefix);
-   }
-
-   for(idx = 0; idx < theImageBands.size(); ++idx)
-   {
-      if(theImageBands[idx].valid())
-      {
-         theImageBands[idx]->print(out, "", idx); 
-      }
-   }
-   
-   out << std::endl;
-   
-   ossimKeywordlist kwlTemp;
-   
-   std::istringstream in(out.str());
-   if(kwlTemp.parseStream(in))
-   {
-      kwl.add(prefix, kwlTemp);
-   }
-   
-   return true;
-}
-
-bool ossimNitfImageHeaderV2_1::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   // Note: Currently not looking up all fieds only ones that make sense.
-   
-   const char* lookup;
-
-   lookup = kwl.find( prefix, ISCLSY_KW );
-   if ( lookup )
-   {
-      setSecurityClassificationSystem( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCODE_KW );
-   if ( lookup )
-   {
-      setCodewords( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCTLH_KW );
-   if ( lookup )
-   {
-      setControlAndHandling( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISREL_KW);
-   if ( lookup )
-   {
-      setReleasingInstructions( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISDCTP_KW );
-   if ( lookup )
-   {
-      setDeclassificationType( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISDCDT_KW );
-   if ( lookup )
-   {
-      setDeclassificationDate( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISDCXM_KW );
-   if ( lookup )
-   {
-      setDeclassificationExempt( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISDG_KW );
-   if ( lookup )
-   {
-      setDowngrade( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISDGDT_KW );
-   if ( lookup )
-   {
-      setDowngradeDate( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCLTX_KW );
-   if ( lookup )
-   {
-      setClassificationText( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCATP_KW );
-   if ( lookup )
-   {
-      setClassificationAuthorityType( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCAUT_KW );
-   if ( lookup )
-   {
-      setClassificationAuthority( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCRSN_KW );
-   if ( lookup )
-   {
-      setClassificationReason( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISSRDT_KW );
-   if ( lookup )
-   {
-      setSecuritySourceDate( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCTLN_KW );
-   if ( lookup )
-   {
-      setSecurityControlNumber( ossimString(lookup) );
-   }
-   
-   return ossimNitfImageHeaderV2_X::loadState(kwl, prefix);
-}
-
-bool ossimNitfImageHeaderV2_1::isCompressed()const
-{
-   ossimString temp = theCompression;
-   temp = temp.trim();
-   return ((temp != "NC") && (temp != "NM"));
-}
-
-bool ossimNitfImageHeaderV2_1::isEncrypted()const
-{
-   return (theEncryption[0] == '1');
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfBands()const
-{
-   if(theNumberOfBands[0] == '0')
-   {
-      return ossimString(theNumberOfMultispectralBands).toInt32();
-   }
-   else
-   {
-      return ossimString(theNumberOfBands).toInt32();
-   }
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfRows()const
-{
-   return ossimString(theSignificantRows).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfCols()const
-{
-   return ossimString(theSignificantCols).toInt32();
-}
-
-ossimString ossimNitfImageHeaderV2_1::getImageId()const
-{
-   return theImageId;
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getBitsPerPixelPerBand()const
-{
-   return ossimString(theNumberOfBitsPerPixelPerBand).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getActualBitsPerPixelPerBand()const
-{
-   return ossimString(theActualBitsPerPixelPerBand).toInt32();
-}
-
-ossimString ossimNitfImageHeaderV2_1::getIMode() const
-{
-   return ossimString(theImageMode).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_1::getSecurityClassification()const
-{
-   return theSecurityClassification;
-}
-
-ossimString  ossimNitfImageHeaderV2_1::getImageDateAndTime() const
-{
-   return ossimString(theDateTime);
-}
-
-ossimString ossimNitfImageHeaderV2_1::getAcquisitionDateMonthDayYear(ossim_uint8 separationChar)const
-{
-   ossimString result;
-
-   result += ossimString(theDateTime + 4,
-                         theDateTime + 6);
-   result += ossimString(separationChar);
-   result += ossimString(theDateTime + 6,
-                         theDateTime + 8);
-   result += ossimString(separationChar);
-   result += ossimString(theDateTime,
-                         theDateTime + 4);
-   
-   return result;
-}
-
-ossimString ossimNitfImageHeaderV2_1::getCategory()const
-{
-   return theCategory;
-}
-
-ossimString ossimNitfImageHeaderV2_1::getImageSource()const
-{
-   return theImageSource;
-}
-
-ossimString ossimNitfImageHeaderV2_1::getRepresentation()const
-{
-   return theRepresentation;
-}
-
-ossimString ossimNitfImageHeaderV2_1::getCoordinateSystem()const
-{
-   return theCoordinateSystem;
-}
-ossimString ossimNitfImageHeaderV2_1::getGeographicLocation()const
-{
-  return theGeographicLocation;
-}
-
-bool ossimNitfImageHeaderV2_1::hasBlockMaskRecords()const
-{
-   return (theBlockMaskRecords.size() > 0);
-}
-
-bool ossimNitfImageHeaderV2_1::hasPadPixelMaskRecords()const
-{
-   return (thePadPixelMaskRecords.size()>0);
-}
-
-bool ossimNitfImageHeaderV2_1::hasTransparentCode()const
-{
-   return (theTransparentOutputPixelCodeLength > 0);
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_1::getTransparentCode()const
-{
-   return thePadOutputPixelCode;
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_1::getBlockMaskRecordOffset(ossim_uint32 blockNumber,
-                                                                ossim_uint32 bandNumber)const
-{
-   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-   ossim_uint32 result = 0xffffffff;
-   
-   if((hasBlockMaskRecords())&&
-      (blockNumber < maxBlock))
-   {
-      if(theImageMode[0] == 'S')
-      {
-         if(bandNumber < (ossim_uint32)getNumberOfBands())
-         {
-            result = theBlockMaskRecords[bandNumber*maxBlock + blockNumber];
-         }
-      }
-      else
-      {
-         result = theBlockMaskRecords[blockNumber];
-      }
-   }
-
-   return result;
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_1::getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
-                                                                   ossim_uint32 bandNumber)const
-{
-   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
-   ossim_uint32 result = 0xffffffff;
-   
-   if((hasPadPixelMaskRecords())&&
-      (blockNumber < maxBlock))
-   {
-      if(theImageMode[0] == 'S')
-      {
-         if(bandNumber < (ossim_uint32)getNumberOfBands())
-         {
-            result = thePadPixelMaskRecords[bandNumber*maxBlock + blockNumber];
-         }
-      }
-      else
-      {
-         result = thePadPixelMaskRecords[blockNumber];
-      }
-   }
-
-   return result;
-}
-
-
-void ossimNitfImageHeaderV2_1::clearFields()
-{
-   memcpy(theType, "IM", 2);
-   memset(theImageId, ' ',10);
-   memset(theDateTime, '-',14);
-   memset(theTargetId, ' ',17);
-   memset(theTitle, ' ',80);
-   memset(theSecurityClassification, ' ',1);
-   memset(theSecurityClassificationSys, ' ',2);
-   memset(theCodewords, ' ',11);
-   memset(theControlAndHandling, ' ',2);
-   memset(theReleasingInstructions, ' ',20);
-   memset(theDeclassificationType, ' ',2);
-   memset(theDeclassificationDate, ' ',8);
-   memset(theDeclassificationExempt, ' ',4);
-   memset(theDowngrade, ' ',1);
-   memset(theDowngradeDate, ' ',8);
-   memset(theClassificationText, ' ',43);
-   memset(theClassificationAuthType, ' ',1);
-   memset(theClassificationAuthority, ' ',40);
-   memset(theClassificationReason, ' ',1);
-   memset(theSecuritySourceDate, ' ',8);
-   memset(theSecurityControlNumber, ' ',15);
-   memset(theEncryption, '0',1);
-   memset(theImageSource, ' ',42);
-   memset(theSignificantRows, '0',8);
-   memset(theSignificantCols, '0',8);
-   memset(thePixelValueType, ' ',3);
-   memset(theRepresentation, ' ',8);
-   memset(theCategory, ' ',8);
-   memset(theActualBitsPerPixelPerBand, ' ',2);
-   memset(theJustification, 'R',1);
-   memset(theCoordinateSystem, ' ',1);
-   memset(theGeographicLocation, ' ',60);
-   memset(theNumberOfComments, '0', 1);
-   memcpy(theCompression, "NC",2);
-   memset(theCompressionRateCode, ' ',4);
-   memset(theNumberOfBands, '0',1);
-   memset(theNumberOfMultispectralBands, ' ',5);
-   memset(theImageSyncCode, '0', 1);
-   memset(theImageMode, 'B', 1);
-   memset(theNumberOfBlocksPerRow, '0', 4);
-   memset(theNumberOfBlocksPerCol, '0', 4);
-   memset(theNumberOfPixelsPerBlockHoriz, '0', 4);
-   memset(theNumberOfPixelsPerBlockVert, '0', 4);
-   memset(theNumberOfBitsPerPixelPerBand, '0', 2);
-   memcpy(theDisplayLevel, "001", 3);
-   memset(theAttachmentLevel, '0', 3);
-   memset(theImageLocation, '0', 10);
-   memcpy(theImageMagnification, "1.0 ", 4);
-   
-   memset(theUserDefinedImageDataLength,'0', 5);
-   memset(theUserDefinedOverflow, '0', 3);
-   memset(theExtendedSubheaderDataLen, '0', 5);
-   memset(theExtendedSubheaderOverflow, '0', 3);
-   theBlockMaskRecords.clear();
-   thePadPixelMaskRecords.clear();
-
-   theBlockedImageDataOffset = 0;
-   theBlockMaskRecordLength = 0;
-   thePadPixelMaskRecordLength = 0;
-   theTransparentOutputPixelCodeLength = 0;
-   thePadOutputPixelCode = 0;
-   
-   theCompressionHeader = 0;
-   
-   theType[2] = '\0';
-   theImageId[10] = '\0';
-   theDateTime[14] = '\0';
-   theTargetId[17] = '\0';
-   theTitle[80] = '\0';
-   theSecurityClassification[1] = '\0';
-   theSecurityClassificationSys[2] = '\0';
-   theCodewords[11] = '\0';
-   theControlAndHandling[2] = '\0';
-   theReleasingInstructions[20] = '\0';
-   theDeclassificationType[2] = '\0';
-   theDeclassificationDate[8] = '\0';
-   theDeclassificationExempt[4] = '\0';
-   theDowngrade[1] = '\0';
-   theDowngradeDate[8] = '\0';
-   theClassificationText[43] = '\0';
-   theClassificationAuthType[1] = '\0';
-   theClassificationAuthority[40] = '\0';
-   theClassificationReason[1] = '\0';
-   theSecuritySourceDate[8] = '\0';
-   theSecurityControlNumber[15] = '\0';
-   theEncryption[1] = '\0';
-   theImageSource[42] = '\0';
-   theSignificantRows[8] = '\0';
-   theSignificantCols[8] = '\0';
-   thePixelValueType[3] = '\0';
-   theRepresentation[8] = '\0';
-   theCategory[8] = '\0';
-   theActualBitsPerPixelPerBand[2] = '\0';
-   theJustification[1] = '\0';
-   theCoordinateSystem[1] = '\0';
-   theGeographicLocation[60] = '\0';
-   theNumberOfComments[1] = '\0';
-   theCompression[2] = '\0';
-   theCompressionRateCode[4] = '\0';
-   theNumberOfBands[1] = '\0';
-   theNumberOfMultispectralBands[5] = '\0';
-   theImageSyncCode[1] = '\0';
-   theImageMode[1] = '\0';
-   theNumberOfBlocksPerRow[4] = '\0';
-   theNumberOfBlocksPerCol[4] = '\0';
-   theNumberOfPixelsPerBlockHoriz[4] = '\0';
-   theNumberOfPixelsPerBlockVert[4] = '\0';
-   theNumberOfBitsPerPixelPerBand[2] = '\0';
-   theDisplayLevel[3] = '\0';
-   theAttachmentLevel[3] = '\0';
-   theImageLocation[10] = '\0';
-   theImageMagnification[4] = '\0';
-   theUserDefinedImageDataLength[5] = '\0';
-   theUserDefinedOverflow[3] = '\0';
-   theExtendedSubheaderDataLen[5] = '\0';
-   theExtendedSubheaderOverflow[3] = '\0';
-   
-   theDataLocation = 0;
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfBlocksPerRow()const
-{
-   return ossimString(theNumberOfBlocksPerRow).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfBlocksPerCol()const
-{
-   return ossimString(theNumberOfBlocksPerCol).toInt32();
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfPixelsPerBlockHoriz()const
-{
- //  return ossimString(theNumberOfPixelsPerBlockHoriz).toInt32();
-   ossim_int32 rval = ossimString(theNumberOfPixelsPerBlockHoriz).toInt32();
-   if ((rval == 0) && (getNumberOfBlocksPerCol() == 1))
-   {
-      rval = getNumberOfCols();
-   }
-   return rval;
-   
-}
-
-ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfPixelsPerBlockVert()const
-{
-//   return ossimString(theNumberOfPixelsPerBlockVert).toInt32();
-   ossim_int32 rval = ossimString(theNumberOfPixelsPerBlockVert).toInt32();
-   if ((rval == 0) && (getNumberOfBlocksPerRow() == 1))
-   {
-      rval = getNumberOfRows();
-   }
-   return rval;
-}
-
-ossimIrect ossimNitfImageHeaderV2_1::getImageRect()const
-{
-   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
-               ossimString((char*)theImageLocation,
-                           (char*)(&theImageLocation[5])).toDouble());
-   
-    double rows = ossimString(theSignificantRows).toDouble();
-    double cols = ossimString(theSignificantCols).toDouble();
-
-    ossimDpt lr(ul.x + cols-1,
-                ul.y + rows-1);
-   
-    return ossimIrect(ul, lr);
-}
-
-ossimIrect ossimNitfImageHeaderV2_1::getBlockImageRect()const
-{
-   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
-               ossimString((char*)theImageLocation,
-                           (char*)(&theImageLocation[5])).toDouble());
-   
-   double rows = getNumberOfPixelsPerBlockVert()*getNumberOfBlocksPerCol();
-   double cols = getNumberOfPixelsPerBlockHoriz()*getNumberOfBlocksPerRow();;
-   
-   ossimDpt lr(ul.x + cols-1,
-               ul.y + rows-1);
-   
-    return ossimIrect(ul, lr);
-}
-
-
-ossimString ossimNitfImageHeaderV2_1::getPixelValueType()const
-{
-   return ossimString(thePixelValueType).trim();
-}
-
-
-void ossimNitfImageHeaderV2_1::setNumberOfBands(ossim_uint32 nbands)
-{
-   std::ostringstream out;
-
-   if(nbands > 9)
-   {
-      out << std::setw(5)
-          << std::setfill('0')
-          << std::setiosflags(ios::right)
-          << nbands;
-
-      theNumberOfBands[0] = '0';
-      memcpy(theNumberOfMultispectralBands, out.str().c_str(), 5);
-   }
-   else
-   {
-      out << nbands;
-      theNumberOfBands[0] = out.str().c_str()[0];
-   }
-
-   theImageBands.resize(getNumberOfBands());
-}
-
-void ossimNitfImageHeaderV2_1::setBandInfo(ossim_uint32 idx,
-                                           const ossimNitfImageBandV2_1& info)
-{
-   if(idx < theImageBands.size())
-   {
-      if(!theImageBands[idx].valid())
-      {
-         theImageBands[idx] = new ossimNitfImageBandV2_1;
-      }
-      (*theImageBands[idx]) = info;
-   }
-}
-
-void ossimNitfImageHeaderV2_1::setNumberOfRows(ossim_uint32 rows)
-{
-   std::ostringstream out;
-   if(rows > 99999999) rows = 99999999;
-   
-   out << rows;
-   ossimNitfCommon::setField(theSignificantRows, out.str(), 8, ios::right, '0');
-}
-
-void ossimNitfImageHeaderV2_1::setNumberOfCols(ossim_uint32 cols)
-{
-   std::ostringstream out;
-   if(cols > 99999999) cols = 99999999;
-
-   out << cols;
-   ossimNitfCommon::setField(theSignificantCols, out.str(), 8, ios::right, '0');
-}
-
-void ossimNitfImageHeaderV2_1::setGeographicLocationDms(const ossimDpt& ul,
-                                                        const ossimDpt& ur,
-                                                        const ossimDpt& lr,
-                                                        const ossimDpt& ll)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << ossimDms(ul.y, true).toString("ddmmss.ssssC").c_str()
-         << ossimDms(ul.x, false).toString("dddmmss.ssssC").c_str()
-         << ossimDms(ur.y, true).toString("ddmmss.ssssC").c_str()
-         << ossimDms(ur.x, false).toString("dddmmss.ssssC").c_str()
-         << ossimDms(lr.y, true).toString("ddmmss.ssssC").c_str()
-         << ossimDms(lr.x, false).toString("dddmmss.ssssC").c_str()
-         << ossimDms(ll.y, true).toString("ddmmss.ssssC").c_str()
-         << ossimDms(ll.x, false).toString("dddmmss.ssssC").c_str()
-         << std::endl;
-
-      checkForGeographicTiePointTruncation(ul);
-      checkForGeographicTiePointTruncation(ur);
-      checkForGeographicTiePointTruncation(lr);
-      checkForGeographicTiePointTruncation(ll);
-   }
-      
-   theCoordinateSystem[0] = 'G';
-   std::ostringstream out;
-
-   out << ossimDms(ul.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(ul.x, false).toString("dddmmssC").c_str();
-   out << ossimDms(ur.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(ur.x, false).toString("dddmmssC").c_str();
-   out << ossimDms(lr.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(lr.x, false).toString("dddmmssC").c_str();
-   out << ossimDms(ll.y, true).toString("ddmmssC").c_str();
-   out << ossimDms(ll.x, false).toString("dddmmssC").c_str();
-
-   memcpy(theGeographicLocation, out.str().c_str(), 60);
-}
-
-void ossimNitfImageHeaderV2_1::setGeographicLocationDecimalDegrees(
-   const ossimDpt& ul,
-   const ossimDpt& ur,
-   const ossimDpt& lr,
-   const ossimDpt& ll)
-{
-   theCoordinateSystem[0] = 'D';
-   ostringstream out;
-
-   out << (ul.lat >= 0.0?"+":"")
-       << std::setw(6)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << ul.lat
-       << (ul.lon >= 0.0?"+":"")
-       << std::setw(7)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << ul.lon;
-   out << (ur.lat >= 0.0?"+":"")
-       << std::setw(6)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << ur.lat
-       << (ur.lon >= 0.0?"+":"")
-       << std::setw(7)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << ur.lon;
-   out << (lr.lat >= 0.0?"+":"")
-       << std::setw(6)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << lr.lat
-       << (lr.lon >= 0.0?"+":"")
-       << std::setw(7)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << lr.lon;
-   out << (ll.lat >= 0.0?"+":"")
-       << std::setw(6)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << ll.lat
-       << (ll.lon >= 0.0?"+":"")
-       << std::setw(7)
-       << std::setfill('0')
-       << std::setprecision(3)
-       << std::setiosflags(std::ios::fixed)
-       << ll.lon;
-
-   memcpy(theGeographicLocation, out.str().c_str(), 60);
-}
-
-void ossimNitfImageHeaderV2_1::setUtmNorth(ossim_uint32 zone,
-                                           const ossimDpt& ul,
-                                           const ossimDpt& ur,
-                                           const ossimDpt& lr,
-                                           const ossimDpt& ll)
-{
-   theCoordinateSystem[0] = 'N';
-   
-   memcpy(theGeographicLocation,
-          encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
-}
-
-void ossimNitfImageHeaderV2_1::setUtmSouth(ossim_uint32 zone,
-                                           const ossimDpt& ul,
-                                           const ossimDpt& ur,
-                                           const ossimDpt& lr,
-                                           const ossimDpt& ll)
-{
-   theCoordinateSystem[0] = 'S';
-   
-   memcpy(theGeographicLocation,
-          encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
-}
-
-
-void ossimNitfImageHeaderV2_1::setSecurityClassificationSystem(const ossimString& value)
-{
-   ossimNitfCommon::setField(theSecurityClassificationSys, value, 2);
-}
-
-void ossimNitfImageHeaderV2_1::setCodewords(const ossimString& value)
-{
-   ossimNitfCommon::setField(theCodewords, value, 11);
-}
-
-void ossimNitfImageHeaderV2_1::setControlAndHandling(const ossimString& value)
-{
-   ossimNitfCommon::setField(theControlAndHandling, value, 2);
-}
-
-void ossimNitfImageHeaderV2_1::setReleasingInstructions(const ossimString& value)
-{
-   ossimNitfCommon::setField(theReleasingInstructions, value, 20);
-}
-
-void ossimNitfImageHeaderV2_1::setDeclassificationType(const ossimString& value)
-{
-   ossimNitfCommon::setField(theDeclassificationType, value, 2);
-}
-
-void ossimNitfImageHeaderV2_1::setDeclassificationDate(const ossimString& value)
-{
-   ossimNitfCommon::setField(theDeclassificationDate, value, 8);
-}
-
-void ossimNitfImageHeaderV2_1::setDeclassificationExempt(const ossimString& value)
-{
-   ossimNitfCommon::setField(theDeclassificationExempt, value, 4);
-}
-
-void ossimNitfImageHeaderV2_1::setDowngrade(const ossimString& value)
-{
-   ossimNitfCommon::setField(theDowngrade, value, 1);
-}
-
-void ossimNitfImageHeaderV2_1::setDowngradeDate(const ossimString& value)
-{
-   ossimNitfCommon::setField(theDowngradeDate, value, 8);
-}
-
-void ossimNitfImageHeaderV2_1::setClassificationText(const ossimString& value)
-{
-   ossimNitfCommon::setField(theClassificationText, value, 43);
-}
-
-void ossimNitfImageHeaderV2_1::setClassificationAuthorityType(const ossimString& value)
-{
-   ossimNitfCommon::setField(theClassificationAuthType, value, 1);
-}
-
-void ossimNitfImageHeaderV2_1::setClassificationAuthority(const ossimString& value)
-{
-   ossimNitfCommon::setField(theClassificationAuthority, value, 40);
-}
-
-void ossimNitfImageHeaderV2_1::setClassificationReason(const ossimString& value)
-{
-   ossimNitfCommon::setField(theClassificationReason, value, 1);
-}
-
-void ossimNitfImageHeaderV2_1::setSecuritySourceDate(const ossimString& value)
-{
-   ossimNitfCommon::setField(theSecuritySourceDate, value, 8);
-}
-
-void ossimNitfImageHeaderV2_1::setSecurityControlNumber(const ossimString& value)
-{
-   ossimNitfCommon::setField(theSecurityControlNumber, value, 15);
-}
-
-void ossimNitfImageHeaderV2_1::setImageMagnification(const ossimString& value)
-{
-   ossimNitfCommon::setField(theImageMagnification, value, 4);
-}
-
-void ossimNitfImageHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimString name = property->getName();
-
-   // Make case insensitive:
-   name.downcase();
-   
-   std::ostringstream out;
-   
-   if(!property) return;
-   
-   if(name.contains(ISCLSY_KW))
-   {
-      setSecurityClassificationSystem(property->valueToString());
-   }
-   else if(name.contains(ISCODE_KW))
-   {
-      setCodewords(property->valueToString());
-   }
-   else if(name.contains(ISCTLH_KW))
-   {
-      setControlAndHandling(property->valueToString());
-   }
-   else if(name.contains(ISREL_KW))
-   {
-      setReleasingInstructions(property->valueToString());
-   }
-   else if(name.contains(ISDCTP_KW))
-   {
-      setDeclassificationType(property->valueToString());
-   }
-   else if(name.contains(ISDCDT_KW))
-   {
-      setDeclassificationDate(property->valueToString());
-   }
-   else if(name.contains(ISDCXM_KW))
-   {
-      setDeclassificationExempt(property->valueToString());
-   }
-   else if(name.contains(ISDGDT_KW)) // Must be before: "ISDG_KW"
-   {
-      setDowngradeDate(property->valueToString());
-   }   
-   else if(name.contains(ISDG_KW))
-   {
-      setDowngrade(property->valueToString());
-   }
-   else if(name.contains(ISCLTX_KW))
-   {
-      setClassificationText(property->valueToString());
-   }
-   else if(name.contains(ISCATP_KW))
-   {
-      setClassificationAuthorityType(property->valueToString());
-   }
-   else if(name.contains(ISCAUT_KW))
-   {
-      setClassificationAuthority(property->valueToString());
-   }
-   else if(name.contains(ISCRSN_KW))
-   {
-      setClassificationReason(property->valueToString());
-   }
-   else if(name.contains(ISSRDT_KW))
-   {
-      setSecuritySourceDate(property->valueToString());
-   }
-   else if(name.contains(ISCTLN_KW))
-   {
-      setSecurityControlNumber(property->valueToString());
-   }
-   else
-   {
-      ossimNitfImageHeaderV2_X::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitfImageHeaderV2_1::getProperty(const ossimString& name)const
-{
-   ossimProperty* property = 0;
-
-   if(name == ISCLSY_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theSecurityClassificationSys).trim());
-   }
-   else if(name == ISCODE_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theCodewords).trim());
-   }
-   else if(name == ISCTLH_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theControlAndHandling).trim());
-   }
-   else if(name == ISREL_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theReleasingInstructions).trim());
-   }
-   else if(name == ISDCTP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theDeclassificationType).trim());
-   }
-   else if(name == ISDCDT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theDeclassificationDate).trim());
-   }
-   else if(name == ISDCXM_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theDeclassificationExempt).trim());
-   }
-   else if(name == ISDG_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theDowngrade).trim());
-   }
-   else if(name == ISDGDT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theDowngradeDate).trim());
-   }
-   else if(name == ISCLTX_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theClassificationText).trim());
-   }
-   else if(name == ISCATP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theClassificationAuthType).trim());
-   }
-   else if(name == ISCAUT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theClassificationAuthority).trim());
-   }
-   else if(name == ISCRSN_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theClassificationReason).trim());
-   }
-   else if(name == ISSRDT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theSecuritySourceDate).trim());
-   }
-   else if(name == ISCTLN_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theSecurityControlNumber).trim());
-   }
-   else
-   {
-      return ossimNitfImageHeaderV2_X::getProperty(name);
-   }
-   
-   return property;
-}
-
-void ossimNitfImageHeaderV2_1::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfImageHeaderV2_X::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(ISCLSY_KW);
-   propertyNames.push_back(ISCODE_KW);
-   propertyNames.push_back(ISCTLH_KW);
-   propertyNames.push_back(ISREL_KW);
-   propertyNames.push_back(ISDCTP_KW);
-   propertyNames.push_back(ISDCDT_KW);
-   propertyNames.push_back(ISDCXM_KW);
-   propertyNames.push_back(ISDG_KW);
-   propertyNames.push_back(ISDGDT_KW);
-   propertyNames.push_back(ISCLTX_KW);
-   propertyNames.push_back(ISCATP_KW);
-   propertyNames.push_back(ISCAUT_KW);
-   propertyNames.push_back(ISCRSN_KW);
-   propertyNames.push_back(ISSRDT_KW);
-   propertyNames.push_back(ISCTLN_KW);
-   propertyNames.push_back(XBANDS_KW);
-}
-
-const ossimRefPtr<ossimNitfCompressionHeader> ossimNitfImageHeaderV2_1::getCompressionHeader()const
-{
-   return theCompressionHeader;
-}
-
-const ossimRefPtr<ossimNitfImageBand> ossimNitfImageHeaderV2_1::getBandInformation(ossim_uint32 idx)const
-{
-   if(idx < theImageBands.size())
-   {
-      return (ossimNitfImageBand*)theImageBands[idx].get();
-   }
-   
-   return 0;
-}
-
-
-ossimString ossimNitfImageHeaderV2_1::encodeUtm(
-   ossim_uint32 zone,
-   const ossimDpt& ul,
-   const ossimDpt& ur,
-   const ossimDpt& lr,
-   const ossimDpt& ll) const
-{
-   ostringstream out;
-
-   if(zone > 60)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUTM zone greate than 60!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   ossim_float64 east  = ul.x;
-   ossim_float64 north = ul.y;
-   
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-
-   out << setw(2)
-       << setfill('0')
-       << zone
-       << setw(6)
-       << setfill('0')
-       <<(ossim_uint32)(east+.5)
-       << setw(7)
-          << setfill('0')
-       <<(ossim_uint32)(north+.5);
-
-   
-   east  = ur.x;
-   north = ur.y;
-   
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   out << setw(2)
-       << setfill('0')
-       << zone
-       << setw(6)
-       << setfill('0')
-       <<(ossim_uint32)(east+.5)
-       << setw(7)
-       << setfill('0')
-       <<(ossim_uint32)(north+.5);
-   east  = lr.x;
-   north = lr.y;
-
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }   
-
-   out << setw(2)
-       << setfill('0')
-       << zone
-       << setw(6)
-       << setfill('0')
-       <<(ossim_uint32)(east+.5)
-       << setw(7)
-       << setfill('0')
-       <<(ossim_uint32)(north+.5);
-   
-   east  = ll.x;
-   north = ll.y;
-
-   if((ossim_uint32)(east+.5) > 999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left easting too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   if((ossim_uint32)(north+.5) > 9999999)
-   {
-      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left northing too large for NITF field!";
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
-      }
-      throw std::out_of_range(s);
-   }
-   
-   out << setw(2)
-       << setfill('0')
-       << zone
-       << setw(6)
-       << setfill('0')
-       <<(ossim_uint32)(east+.5)
-       << setw(7)
-       << setfill('0')
-       <<(ossim_uint32)(north+.5);
-   
-   return out.str().c_str();
-}
-
-bool ossimNitfImageHeaderV2_1::takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
-   ossim_uint32 potentialDesIndex, bool userDefinedTags)
-{
-   overflowTags.clear();
-   std::vector<ossimNitfTagInformation>::iterator iter;
-   std::vector<ossimNitfTagInformation> specifiedTags;
-   const ossimString tagType(userDefinedTags ? "UDID" : "IXSHD");
-   for (iter = theTagList.begin(); iter != theTagList.end(); ++iter)
-   {
-      if (iter->getTagType() == tagType)
-      {
-         specifiedTags.push_back(*iter);
-      }
-   }
-
-   std::sort(specifiedTags.begin(), specifiedTags.end());
-
-   ossim_uint32 totalSize = 0;
-   const ossim_uint32 maxSize = 9996;
-   for (iter = specifiedTags.begin(); iter != specifiedTags.end() &&
-      totalSize + iter->getTotalTagLength() <= maxSize; ++iter)
-   {
-      totalSize += iter->getTotalTagLength();
-   }
-
-   for (; iter != specifiedTags.end(); ++iter)
-   {
-      overflowTags.push_back(*iter);
-      removeTag(iter->getTagName());
-   }
-
-   // If there are no overflow tags, then no DES is required
-   if (overflowTags.empty() == true)
-   {
-      potentialDesIndex = 0;
-   }
-
-   std::ostringstream overflowDes;
-   overflowDes << std::setw(3)
-           << std::setfill('0')
-           << std::setiosflags(ios::right)
-           << potentialDesIndex;
-
-   std::ostringstream tagLength;
-   tagLength << std::setw(5)
-           << std::setfill('0')
-           << std::setiosflags(ios::right)
-           << totalSize;
-
-   if (userDefinedTags)
-   {
-      strcpy(theUserDefinedOverflow, overflowDes.str().c_str());
-      strcpy(theUserDefinedImageDataLength, tagLength.str().c_str());
-   }
-   else
-   {
-      strcpy(theExtendedSubheaderOverflow, overflowDes.str().c_str());
-      strcpy(theExtendedSubheaderDataLen, tagLength.str().c_str());
-   }
-
-   return (overflowTags.empty() == false);
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_X.cpp b/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_X.cpp
deleted file mode 100644
index f820fcd..0000000
--- a/ossim/src/ossim/support_data/ossimNitfImageHeaderV2_X.cpp
+++ /dev/null
@@ -1,931 +0,0 @@
-#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
-
-#include <cmath> /* for fmod */
-#include <iomanip>
-#include <sstream>
-
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimDms.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimNitfImageHeader.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-
-static const ossimTrace traceDebug(
-   ossimString("ossimNitfImageHeaderV2_X:debug"));
-
-const ossimString ossimNitfImageHeaderV2_X::IM_KW       = "IM";
-const ossimString ossimNitfImageHeaderV2_X::IID1_KW     = "IID1";
-const ossimString ossimNitfImageHeaderV2_X::IDATIM_KW   = "IDATIM";
-const ossimString ossimNitfImageHeaderV2_X::TGTID_KW    = "TGTID";
-const ossimString ossimNitfImageHeaderV2_X::IID2_KW     = "IID2";
-const ossimString ossimNitfImageHeaderV2_X::ITITLE_KW   = "ITITLE";
-const ossimString ossimNitfImageHeaderV2_X::ISCLAS_KW   = "ISCLAS";
-const ossimString ossimNitfImageHeaderV2_X::ENCRYP_KW   = "ENCRYP";
-const ossimString ossimNitfImageHeaderV2_X::ISORCE_KW   = "ISORCE";
-const ossimString ossimNitfImageHeaderV2_X::NROWS_KW    = "NROWS";
-const ossimString ossimNitfImageHeaderV2_X::NCOLS_KW    = "NCOLS";
-const ossimString ossimNitfImageHeaderV2_X::PVTYPE_KW   = "PVTYPE";
-const ossimString ossimNitfImageHeaderV2_X::IREP_KW     = "IREP";
-const ossimString ossimNitfImageHeaderV2_X::ICAT_KW     = "ICAT";
-const ossimString ossimNitfImageHeaderV2_X::ABPP_KW     = "ABPP";
-const ossimString ossimNitfImageHeaderV2_X::PJUST_KW    = "PJUST";
-const ossimString ossimNitfImageHeaderV2_X::ICORDS_KW   = "ICORDS";
-const ossimString ossimNitfImageHeaderV2_X::IGEOLO_KW   = "IGEOLO";
-const ossimString ossimNitfImageHeaderV2_X::NICOM_KW    = "NICOM";
-const ossimString ossimNitfImageHeaderV2_X::ICOM_KW     =  "ICOM";
-const ossimString ossimNitfImageHeaderV2_X::IC_KW       = "IC";
-const ossimString ossimNitfImageHeaderV2_X::COMRAT_KW   = "COMRAT";
-const ossimString ossimNitfImageHeaderV2_X::NBANDS_KW   = "NBANDS";
-const ossimString ossimNitfImageHeaderV2_X::ISYNC_KW    = "ISYNC";
-const ossimString ossimNitfImageHeaderV2_X::IMODE_KW    = "IMODE";
-const ossimString ossimNitfImageHeaderV2_X::NBPR_KW     = "NBPR";
-const ossimString ossimNitfImageHeaderV2_X::NBPC_KW     = "NBPC";
-const ossimString ossimNitfImageHeaderV2_X::NPPBH_KW    = "NPPBH";
-const ossimString ossimNitfImageHeaderV2_X::NPPBV_KW    = "NPPBV";
-const ossimString ossimNitfImageHeaderV2_X::NBPP_KW     = "NBPP";
-const ossimString ossimNitfImageHeaderV2_X::IDLVL_KW    = "IDLVL";
-const ossimString ossimNitfImageHeaderV2_X::IALVL_KW    = "IALVL";
-const ossimString ossimNitfImageHeaderV2_X::ILOC_KW     = "ILOC";
-const ossimString ossimNitfImageHeaderV2_X::IMAG_KW     = "IMAG";
-const ossimString ossimNitfImageHeaderV2_X::UDIDL_KW    = "UDIDL";
-const ossimString ossimNitfImageHeaderV2_X::UDOFL_KW    = "UDOFL";
-const ossimString ossimNitfImageHeaderV2_X::IXSHDL_KW   = "IXSHDL";
-const ossimString ossimNitfImageHeaderV2_X::IXSOFL_KW   = "IXSOFL";
-const ossimString ossimNitfImageHeaderV2_X::IMDATOFF_KW = "IMDATOFF";
-const ossimString ossimNitfImageHeaderV2_X::BMRLNTH_KW  = "BMRLNTH";
-
-
-
-RTTI_DEF1(ossimNitfImageHeaderV2_X,
-          "ossimNitfImageHeaderV2_X",
-          ossimNitfImageHeader);
-
-ossimNitfImageHeaderV2_X::ossimNitfImageHeaderV2_X()
-:theImageComments(0)
-{
-}
-
-ossimIrect ossimNitfImageHeaderV2_X::getImageRect()const
-{
-   ossimIpt ul(0, 0);
-   ossimIpt lr(getNumberOfCols()-1, getNumberOfRows()-1);
-   return ossimIrect(ul, lr);
-   
-#if 0 
-   //---
-   // Changed to not include offset 20100619 (drb).
-   // Use void getImageLocation(ossimIpt& loc)const to get offset.
-   //---
-   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
-               ossimString((char*)theImageLocation,
-                           (char*)(&theImageLocation[5])).toDouble());
-   
-    double rows = ossimString(theSignificantRows).toDouble();
-    double cols = ossimString(theSignificantCols).toDouble();
-
-    ossimDpt lr(ul.x + cols-1,
-                ul.y + rows-1);
-     return ossimDrect(ul, lr);
-#endif
-}
-
-ossimIrect ossimNitfImageHeaderV2_X::getBlockImageRect()const
-{
-   ossimIpt ul(0, 0);
-   ossimIpt lr( (getNumberOfPixelsPerBlockHoriz()*getNumberOfBlocksPerRow())-1,
-                (getNumberOfPixelsPerBlockVert() *getNumberOfBlocksPerCol())-1);
-               
-   return ossimIrect(ul, lr);
-   
-#if 0
-   //---
-   // Changed to not include offset 20100619 (drb).
-   // Use void getImageLocation(ossimIpt& loc)const to get offset.
-   //---   
-   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
-               ossimString((char*)theImageLocation,
-                           (char*)(&theImageLocation[5])).toDouble());
-   
-   double rows = getNumberOfPixelsPerBlockVert()*getNumberOfBlocksPerCol();
-   double cols = getNumberOfPixelsPerBlockHoriz()*getNumberOfBlocksPerRow();;
-   
-   ossimDpt lr(ul.x + cols-1,
-               ul.y + rows-1);
-   return ossimDrect(ul, lr);
-#endif
-}
-
-void ossimNitfImageHeaderV2_X::setImageId(const ossimString& value)
-{
-   ossimNitfCommon::setField(theImageId, value, 10);
-}
-
-void ossimNitfImageHeaderV2_X::setAquisitionDateTime(const ossimString& value)
-{
-   ossimNitfCommon::setField(theDateTime, value, 14);
-}
-
-void ossimNitfImageHeaderV2_X::setTargetId(const ossimString& value)
-{
-   ossimNitfCommon::setField(theTargetId, value, 17);
-}
-
-void ossimNitfImageHeaderV2_X::setTitle(const ossimString& value)
-{
-   ossimNitfCommon::setField(theTitle, value, 80);
-}
-
-void ossimNitfImageHeaderV2_X::setSecurityClassification(const ossimString& value)
-{
-   ossimNitfCommon::setField(theSecurityClassification, value, 1);
-}
-
-void ossimNitfImageHeaderV2_X::setEncryption(const ossimString& value)
-{
-   ossimNitfCommon::setField(theEncryption, value, 1);
-}
-
-void ossimNitfImageHeaderV2_X::setImageSource(const ossimString& value)
-{
-   ossimNitfCommon::setField(theImageSource, value, 42);
-}
-
-void ossimNitfImageHeaderV2_X::setJustification(const ossimString& value)
-{
-   ossimNitfCommon::setField(theJustification, value, 1);
-}
-
-void ossimNitfImageHeaderV2_X::setCoordinateSystem(const ossimString& value)
-{
-   ossimNitfCommon::setField(theCoordinateSystem, value, 1);
-}
-
-void ossimNitfImageHeaderV2_X::setGeographicLocation(const ossimString& value)
-{
-   ossimNitfCommon::setField(theGeographicLocation, value, 60);
-}
-
-void ossimNitfImageHeaderV2_X::setNumberOfComments(const ossimString& value)
-{
-   ossimNitfCommon::setField(theNumberOfComments, value, 1);
-}
-
-void ossimNitfImageHeaderV2_X::setCompression(const ossimString& value)
-{
-   ossimNitfCommon::setField(theCompression, value, 2);
-}
-
-void ossimNitfImageHeaderV2_X::setCompressionRateCode(const ossimString& value)
-{
-   ossimNitfCommon::setField(theCompressionRateCode, value, 4);
-}
-
-void ossimNitfImageHeaderV2_X::setDisplayLevel(const ossimString& value)
-{
-   ossimNitfCommon::setField(theDisplayLevel, value, 3, std::ios::right, '0');
-}
-
-void ossimNitfImageHeaderV2_X::setAttachmentLevel(const ossimString& value)
-{
-   ossimNitfCommon::setField(theAttachmentLevel, value, 3);
-}
-
-void ossimNitfImageHeaderV2_X::setPixelType(const ossimString& pixelType)
-{
-   ossimNitfCommon::setField(thePixelValueType, pixelType, 3);
-}
-
-void ossimNitfImageHeaderV2_X::setBitsPerPixel(ossim_uint32 bitsPerPixel)
-{
-   std::stringstream strm;
-   strm << bitsPerPixel;
-   ossimNitfCommon::setField(theNumberOfBitsPerPixelPerBand,
-                             strm.str(),
-                             2,
-                             std::ios::right,
-                             '0');
-}
-
-void ossimNitfImageHeaderV2_X::setActualBitsPerPixel(ossim_uint32 bitsPerPixel)
-{
-   std::stringstream strm;
-   strm << bitsPerPixel;
-   ossimNitfCommon::setField(theActualBitsPerPixelPerBand,
-                             strm.str(),
-                             2,
-                             std::ios::right,
-                             '0');
-}
-
-void ossimNitfImageHeaderV2_X::setImageMode(char mode)
-{
-   theImageMode[0] = mode;
-}
-
-void ossimNitfImageHeaderV2_X::setCategory(const ossimString& category)
-{
-   ossimNitfCommon::setField(theCategory, category, 8);
-}
-
-void ossimNitfImageHeaderV2_X::setRepresentation(const ossimString& rep)
-{
-   ossimNitfCommon::setField(theRepresentation, rep, 8);
-}
-
-void ossimNitfImageHeaderV2_X::setBlocksPerRow(ossim_uint32 blocks)
-{
-   std::stringstream strm;
-   strm << blocks;
-   ossimNitfCommon::setField(theNumberOfBlocksPerRow,
-                             strm.str(),
-                             4,
-                             std::ios::right,
-                             '0');
-}
-
-void ossimNitfImageHeaderV2_X::setBlocksPerCol(ossim_uint32 blocks)
-{
-   std::stringstream strm;
-   strm << blocks;
-   ossimNitfCommon::setField(theNumberOfBlocksPerCol,
-                             strm.str(),
-                             4,
-                             std::ios::right,
-                             '0');
-}
-
-void ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockRow(ossim_uint32 pixels)
-{
-   std::stringstream strm;
-   strm << pixels;
-   ossimNitfCommon::setField(theNumberOfPixelsPerBlockHoriz,
-                             strm.str(),
-                             4,
-                             std::ios::right,
-                             '0');
-}
-
-void ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockCol(ossim_uint32 pixels)
-{
-   std::stringstream strm;
-   strm << pixels;
-   ossimNitfCommon::setField(theNumberOfPixelsPerBlockVert,
-                             strm.str(),
-                             4,
-                             std::ios::right,
-                             '0');
-}
-
-ossim_uint64 ossimNitfImageHeaderV2_X::getDataLocation() const
-{
-   return theDataLocation;
-}
-
-ossimString ossimNitfImageHeaderV2_X::getImageId()const
-{
-   return theImageId;
-}
-
-ossimString ossimNitfImageHeaderV2_X::getAquisitionDateTime()const
-{
-   return theDateTime;
-}
-
-ossimString ossimNitfImageHeaderV2_X::getTargetId()const
-{
-   return ossimString(theTargetId).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getTitle()const
-{
-   return ossimString(theTitle).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getSecurityClassification()const
-{
-   return ossimString(theSecurityClassification).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getEncryption()const
-{
-   return ossimString(theEncryption).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getImageSource()const
-{
-   return ossimString(theImageSource).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getJustification()const
-{
-   return ossimString(theJustification).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getCoordinateSystem()const
-{
-   return ossimString(theCoordinateSystem).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getGeographicLocation()const
-{
-   return ossimString(theGeographicLocation).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getNumberOfComments()const
-{
-   return ossimString(theNumberOfComments).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getCompressionCode()const
-{
-   return ossimString(theCompression).trim();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getCompressionRateCode()const
-{
-   return theCompressionRateCode;
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getDisplayLevel()const
-{
-   return ossimString(theDisplayLevel).toUInt32();
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getAttachmentLevel()const
-{
-   return ossimString(theAttachmentLevel).toUInt32();
-}
-
-ossimString ossimNitfImageHeaderV2_X::getPixelType()const
-{
-   return thePixelValueType;
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getBitsPerPixel()const
-{
-   return ossimString(theNumberOfBitsPerPixelPerBand).toUInt32();
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getActualBitsPerPixel()const
-{
-   return ossimString(theActualBitsPerPixelPerBand).toUInt32();
-}
-
-char ossimNitfImageHeaderV2_X::getImageMode()const
-{
-   return theImageMode[0];
-}
-
-ossimString ossimNitfImageHeaderV2_X::getCategory()const
-{
-   return theCategory;
-}
-
-ossimString ossimNitfImageHeaderV2_X::getRepresentation()const
-{
-   return theRepresentation;
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getBlocksPerRow()const
-{
-   return ossimString(theNumberOfBlocksPerRow).toUInt32();
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getBlocksPerCol()const
-{
-   return ossimString(theNumberOfBlocksPerCol).toUInt32();
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getNumberOfPixelsPerBlockRow()const
-{
-   return ossimString(theNumberOfPixelsPerBlockVert).toUInt32();
-}
-
-ossim_uint32 ossimNitfImageHeaderV2_X::getNumberOfPixelsPerBlockCol()const
-{
-   return ossimString(theNumberOfPixelsPerBlockHoriz).toUInt32();
-}
-
-bool ossimNitfImageHeaderV2_X::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   // Note: Currently not looking up all fieds only ones that make sense.
-   
-   const char* lookup;
-
-   lookup = kwl.find( prefix, IID1_KW);
-   if ( lookup )
-   {
-      setImageId( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, IDATIM_KW);
-   if ( lookup )
-   {
-      setAquisitionDateTime( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, TGTID_KW);
-   if ( lookup )
-   {
-      setTargetId( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, IID2_KW);
-   if ( lookup )
-   {
-      setTitle( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ITITLE_KW); // duplicate of above
-   if ( lookup )
-   {
-      setTitle( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ISCLAS_KW);
-   if ( lookup )
-   {
-      setSecurityClassification( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ENCRYP_KW);
-   if ( lookup )
-   {
-      setEncryption( ossimString(lookup) );
-   }  
-   lookup = kwl.find( prefix, ISORCE_KW);
-   if ( lookup )
-   {
-      setImageSource( ossimString(lookup) );
-   }
-   lookup = kwl.find( prefix, ICAT_KW);
-   if ( lookup )
-   {
-      setCategory( ossimString(lookup) );
-   }
-   
-   return true;
-}
-
-void ossimNitfImageHeaderV2_X::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimString name = property->getName();
-
-   // Make case insensitive:
-   name.upcase();
-   
-   std::ostringstream out;
-   
-   if(!property) return;
-   
-   if(name.contains(IID1_KW))
-   {
-      setImageId(property->valueToString());
-   }
-   else if(name.contains(IDATIM_KW))
-   {
-      setAquisitionDateTime(property->valueToString());
-   }
-   else if(name.contains(TGTID_KW))
-   {
-      setTargetId(property->valueToString());
-   }
-   else if(name.contains(IID2_KW)||
-           name.contains(ITITLE_KW))
-   {
-      setTitle(property->valueToString());
-   }
-   else if(name.contains(ISCLAS_KW))
-   {
-      setSecurityClassification(property->valueToString());
-   }
-   else if(name.contains(ENCRYP_KW))
-   {
-      setEncryption(property->valueToString());
-   }
-   else if(name.contains(ISORCE_KW))
-   {
-      setImageSource(property->valueToString());
-   }
-   else if(name.contains(PVTYPE_KW))
-   {
-      setPixelType(property->valueToString());
-   }
-   else if(name.contains(IREP_KW))
-   {
-      setRepresentation(property->valueToString());
-   }
-   else if(name.contains(ICAT_KW))
-   {
-      setCategory(property->valueToString());
-   }
-   else if(name.contains(ABPP_KW))
-   {
-      setActualBitsPerPixel(property->valueToString().toUInt32());
-   }
-   else if(name.contains(PJUST_KW))
-   {
-      setJustification(property->valueToString());
-   }
-   else if(name.contains(ICORDS_KW))
-   {
-      setCoordinateSystem(property->valueToString());
-   }
-   else if(name.contains(IGEOLO_KW))
-   {
-      setGeographicLocation(property->valueToString());
-   }
-   else if(name.contains(NICOM_KW))
-   {
-      setNumberOfComments(property->valueToString());
-   }
-   else if(name.contains(IC_KW))
-   {
-      setCompression(property->valueToString());
-   }
-   else if(name.contains(COMRAT_KW))
-   {
-      setCompressionRateCode(property->valueToString());
-   }
-   else if(name.contains(ISYNC_KW))
-   {
-   }
-   else if(name.contains(IMODE_KW))
-   {
-      setImageMode(*(property->valueToString().trim().begin()));
-   }
-   else if(name.contains(NBPR_KW))
-   {
-      setBlocksPerRow(property->valueToString().toUInt32());
-   }
-   else if(name.contains(NBPC_KW))
-   {
-      setBlocksPerCol(property->valueToString().toUInt32());
-   }
-   else if(name.contains(NPPBH_KW))
-   {
-      setNumberOfPixelsPerBlockRow(property->valueToString().toUInt32());
-   }
-   else if(name.contains(NPPBV_KW))
-   {
-      setNumberOfPixelsPerBlockCol(property->valueToString().toUInt32());
-   }
-   else if(name.contains(NBPP_KW))
-   {
-      setBitsPerPixel(property->valueToString().toUInt32());
-   }
-   else if(name.contains(IDLVL_KW))
-   {
-      setDisplayLevel(property->valueToString());
-   }
-   else if(name.contains(IALVL_KW))
-   {
-      setAttachmentLevel(property->valueToString());
-   }
-   else if(name.contains(ILOC_KW))
-   {
-   }
-   else if(name.contains(IMAG_KW))
-   {
-   }
-   else
-   {
-      ossimNitfImageHeader::setProperty(property);
-   }
-}
-
-ossimRefPtr<ossimProperty> ossimNitfImageHeaderV2_X::getProperty(const ossimString& name)const
-{
-   ossimProperty* property = 0;
-
-   if(name == IID1_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theImageId).trim());
-   }
-   else if(name == IDATIM_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theDateTime).trim());
-   }
-   else if(name == TGTID_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theTargetId).trim());
-   }
-   else if((name == IID2_KW)||
-           (name == ITITLE_KW))
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theTitle).trim());
-   }
-   else if(name == ISCLAS_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theSecurityClassification).trim());
-   }
-   else if(name == ENCRYP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theEncryption).trim());
-   }
-   else if(name == ISORCE_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theImageSource).trim());
-   }
-   else if(name == PVTYPE_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(thePixelValueType).trim());
-   }
-   else if(name == IREP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theRepresentation).trim());
-   }
-   else if(name == ICAT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theCategory).trim());
-   }
-   else if(name == ABPP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theActualBitsPerPixelPerBand).trim());
-   }
-   else if(name == PJUST_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theJustification).trim());
-   }
-   else if(name == ICORDS_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theCoordinateSystem).trim());
-   }
-   else if(name == IGEOLO_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theGeographicLocation).trim());
-   }
-   else if(name == NICOM_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theNumberOfComments).trim());
-   }
-   else if(name == IC_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theCompression).trim());
-   }
-   else if(name == COMRAT_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theCompressionRateCode).trim());
-   }
-   else if(name == ISYNC_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theImageSyncCode).trim());
-   }
-   else if(name == IMODE_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theImageMode).trim());
-   }
-   else if(name == NBPR_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theNumberOfBlocksPerRow).trim());
-   }
-   else if(name == NBPC_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theNumberOfBlocksPerCol).trim());
-   }
-   else if(name == NPPBH_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theNumberOfPixelsPerBlockHoriz).trim());
-   }
-   else if(name == NPPBV_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theNumberOfPixelsPerBlockVert).trim());
-   }
-   else if(name == NBPP_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theNumberOfBitsPerPixelPerBand).trim());
-   }
-   else if(name == IDLVL_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theDisplayLevel).trim());
-   }
-   else if(name == IALVL_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theAttachmentLevel).trim());
-   }
-   else if(name == ILOC_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theImageLocation).trim());
-   }
-   else if(name == IMAG_KW)
-   {
-      property = new ossimStringProperty(name,
-                                         ossimString(theImageMagnification).trim());
-   }
-   else if(name == "source")
-   {
-      property = new ossimStringProperty(name,
-                                         getImageSource());
-   }
-   else if(name == "image_date")
-   {
-      property = new ossimStringProperty(name,
-                                         getAcquisitionDateMonthDayYear());
-   }
-   else if(name == "image_title")
-   {
-      property = new ossimStringProperty(name,
-                                         getTitle());
-   }
-   else
-   {
-      return ossimNitfImageHeader::getProperty(name);
-                                         
-   }
-   return property;
-}
-
-void ossimNitfImageHeaderV2_X::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfImageHeader::getPropertyNames(propertyNames);
-   propertyNames.push_back(IID1_KW);
-   propertyNames.push_back(IDATIM_KW);
-   propertyNames.push_back(TGTID_KW);
-   propertyNames.push_back(IID2_KW);
-   propertyNames.push_back(ISCLAS_KW);
-   propertyNames.push_back(ENCRYP_KW);
-   propertyNames.push_back(ISORCE_KW);
-   propertyNames.push_back(PVTYPE_KW);
-   propertyNames.push_back(IREP_KW);
-   propertyNames.push_back(ICAT_KW);
-   propertyNames.push_back(ABPP_KW);
-   propertyNames.push_back(PJUST_KW);
-   propertyNames.push_back(ICORDS_KW);
-   propertyNames.push_back(IGEOLO_KW);
-   propertyNames.push_back(NICOM_KW);
-   propertyNames.push_back(IC_KW);
-   propertyNames.push_back(COMRAT_KW);
-   propertyNames.push_back(ISYNC_KW);
-   propertyNames.push_back(IMODE_KW);
-   propertyNames.push_back(NBPR_KW);
-   propertyNames.push_back(NBPC_KW);
-   propertyNames.push_back(NPPBH_KW);
-   propertyNames.push_back(NPPBV_KW);
-   propertyNames.push_back(NBPP_KW);
-   propertyNames.push_back(IDLVL_KW);
-   propertyNames.push_back(IALVL_KW);
-   propertyNames.push_back(ILOC_KW);
-   propertyNames.push_back(IMAG_KW);
-
-   // Temp addition (drb)
-   propertyNames.push_back(ossimString("source"));
-   propertyNames.push_back(ossimString("image_date"));
-   propertyNames.push_back(ossimString("image_title"));
-}
-
-ossimString ossimNitfImageHeaderV2_X::getImageMagnification()const
-{
-   return ossimString(theImageMagnification).trim();
-}
-
-void ossimNitfImageHeaderV2_X::getImageLocation(ossimIpt& loc)const
-{
-   loc.x = ossimString((char*)(&theImageLocation[5])).toInt32();
-   loc.y = ossimString((char*)theImageLocation,
-                       (char*)(&theImageLocation[5])).toInt32();
-}
-
-void ossimNitfImageHeaderV2_X::setGeographicLocationDms(const ossimDpt& ul,
-                                                        const ossimDpt& ur,
-                                                        const ossimDpt& lr,
-                                                        const ossimDpt& ll)
-{
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-      << ossimDms(ul.y, true).toString("ddmmss.ssssC").c_str()
-      << ossimDms(ul.x, false).toString("dddmmss.ssssC").c_str()
-      << ossimDms(ur.y, true).toString("ddmmss.ssssC").c_str()
-      << ossimDms(ur.x, false).toString("dddmmss.ssssC").c_str()
-      << ossimDms(lr.y, true).toString("ddmmss.ssssC").c_str()
-      << ossimDms(lr.x, false).toString("dddmmss.ssssC").c_str()
-      << ossimDms(ll.y, true).toString("ddmmss.ssssC").c_str()
-      << ossimDms(ll.x, false).toString("dddmmss.ssssC").c_str()
-      << std::endl;
-      
-      checkForGeographicTiePointTruncation(ul);
-      checkForGeographicTiePointTruncation(ur);
-      checkForGeographicTiePointTruncation(lr);
-      checkForGeographicTiePointTruncation(ll);
-   }
-   
-   theCoordinateSystem[0] = 'G';
-   
-   memcpy(theGeographicLocation,
-          ossimNitfCommon::encodeGeographicDms(ul,ur,lr,ll).c_str(), 60);
-}
-
-void ossimNitfImageHeaderV2_X::setGeographicLocationDecimalDegrees(
-   const ossimDpt& ul,
-   const ossimDpt& ur,
-   const ossimDpt& lr,
-   const ossimDpt& ll)
-{
-   theCoordinateSystem[0] = 'D';
-   memcpy(theGeographicLocation,
-          ossimNitfCommon::encodeGeographicDecimalDegrees(
-             ul, ur, lr, ll).c_str(), 60);
-}
-
-void ossimNitfImageHeaderV2_X::setUtmNorth(ossim_uint32 zone,
-                                           const ossimDpt& ul,
-                                           const ossimDpt& ur,
-                                           const ossimDpt& lr,
-                                           const ossimDpt& ll)
-{
-   theCoordinateSystem[0] = 'N';
-   
-   memcpy(theGeographicLocation,
-          ossimNitfCommon::encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
-}
-
-void ossimNitfImageHeaderV2_X::setUtmSouth(ossim_uint32 zone,
-                                           const ossimDpt& ul,
-                                           const ossimDpt& ur,
-                                           const ossimDpt& lr,
-                                           const ossimDpt& ll)
-{
-   theCoordinateSystem[0] = 'S';
-   
-   memcpy(theGeographicLocation,
-          ossimNitfCommon::encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
-}
-
-
-bool ossimNitfImageHeaderV2_X::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   bool result = ossimNitfImageHeader::saveState(kwl, prefix);
-   
-   kwl.add(prefix, IM_KW.c_str(),       theType);
-   kwl.add(prefix, IID1_KW.c_str(),     theImageId);
-   kwl.add(prefix, IDATIM_KW.c_str(),   theDateTime);
-   kwl.add(prefix, TGTID_KW.c_str(),    theTargetId);
-   kwl.add(prefix, IID2_KW.c_str(),     theTitle);
-   kwl.add(prefix, ISCLAS_KW.c_str(),   theSecurityClassification);
-   kwl.add(prefix, ENCRYP_KW.c_str(),   theEncryption);
-   kwl.add(prefix, ISORCE_KW.c_str(),   theImageSource);
-   kwl.add(prefix, NROWS_KW.c_str(),    theSignificantRows);
-   kwl.add(prefix, NCOLS_KW.c_str(),    theSignificantCols);
-   kwl.add(prefix, PVTYPE_KW.c_str(),   thePixelValueType);
-   kwl.add(prefix, IREP_KW.c_str(),     theRepresentation);
-   kwl.add(prefix, ABPP_KW.c_str(),     theActualBitsPerPixelPerBand);
-   kwl.add(prefix, ICAT_KW.c_str(),     theCategory);
-   kwl.add(prefix, PJUST_KW.c_str(),    theJustification);
-   kwl.add(prefix, ICORDS_KW.c_str(),   theCoordinateSystem);
-   kwl.add(prefix, NICOM_KW.c_str(),    theNumberOfComments);
-   kwl.add(prefix, ICOM_KW.c_str(),     ossimString(theImageComments));
-   kwl.add(prefix, IGEOLO_KW.c_str(),   theGeographicLocation);
-   kwl.add(prefix, IC_KW.c_str(),       theCompression);
-   kwl.add(prefix, COMRAT_KW.c_str(),   theCompressionRateCode);
-   kwl.add(prefix, NBANDS_KW.c_str(),   theNumberOfBands);
-   kwl.add(prefix, ISYNC_KW.c_str(),    theImageSyncCode);
-   kwl.add(prefix, IMODE_KW.c_str(),    theImageMode);
-   kwl.add(prefix, NBPR_KW.c_str(),     theNumberOfBlocksPerRow);
-   kwl.add(prefix, NBPC_KW.c_str(),     theNumberOfBlocksPerCol);
-   kwl.add(prefix, NPPBH_KW.c_str(),    theNumberOfPixelsPerBlockHoriz);
-   kwl.add(prefix, NPPBV_KW.c_str(),    theNumberOfPixelsPerBlockVert);
-   kwl.add(prefix, NBPP_KW.c_str(),     theNumberOfBitsPerPixelPerBand);
-   kwl.add(prefix, IDLVL_KW.c_str(),    theDisplayLevel);
-   kwl.add(prefix, IALVL_KW.c_str(),    theAttachmentLevel);
-   kwl.add(prefix, ILOC_KW.c_str(),     theImageLocation);
-   kwl.add(prefix, IMAG_KW.c_str(),     theImageMagnification);
-   kwl.add(prefix, UDIDL_KW.c_str(),    theUserDefinedImageDataLength);
-   kwl.add(prefix, UDOFL_KW.c_str(),    theUserDefinedOverflow);
-   kwl.add(prefix, IXSHDL_KW.c_str(),   theExtendedSubheaderDataLen);
-   kwl.add(prefix, IXSOFL_KW.c_str(),   theExtendedSubheaderOverflow);
-   kwl.add(prefix, IMDATOFF_KW.c_str(), theBlockedImageDataOffset);
-   kwl.add(prefix, BMRLNTH_KW.c_str(),  theBlockMaskRecordLength);
-   
-   return result;
-}
-
-
-
-
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfImageLut.cpp b/ossim/src/ossim/support_data/ossimNitfImageLut.cpp
deleted file mode 100644
index e33398f..0000000
--- a/ossim/src/ossim/support_data/ossimNitfImageLut.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfImageLut.cpp 9094 2006-06-13 19:12:40Z dburken $
-
-#include <cstring> // memcpy
-#include <ostream>
-
-#include <ossim/support_data/ossimNitfImageLut.h>
-
-std::ostream& operator <<(std::ostream& out,
-                          const ossimNitfImageLut &data)
-{
-   data.print(out);
-
-   return out;
-}
-
-RTTI_DEF1(ossimNitfImageLut, "ossimNitfImageLut", ossimObject);
-ossimNitfImageLut::ossimNitfImageLut()
-{
-}
-
-ossimNitfImageLut::~ossimNitfImageLut()
-{
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfInfo.cpp b/ossim/src/ossim/support_data/ossimNitfInfo.cpp
deleted file mode 100644
index 1f11e12..0000000
--- a/ossim/src/ossim/support_data/ossimNitfInfo.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: NITF Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <iostream>
-
-#include <ossim/support_data/ossimNitfInfo.h>
-
-ossimNitfInfo::ossimNitfInfo()
-   : m_nitfFile(0)
-{
-}
-
-ossimNitfInfo::~ossimNitfInfo()
-{
-   m_nitfFile = 0;
-}
-
-bool ossimNitfInfo::open(const ossimFilename& file)
-{
-   m_nitfFile = new ossimNitfFile();
-
-   bool result = m_nitfFile->parseFile(file);
-
-   if (result == false)
-   {
-      m_nitfFile = 0;
-   }
-
-   return result;
-}
-
-std::ostream& ossimNitfInfo::print(std::ostream& out) const
-{
-   if ( m_nitfFile.valid() )
-   {
-      std::string prefix;
-      m_nitfFile->print(out, prefix, getProcessOverviewFlag());
-   }
-   return out;
-}
-
-bool ossimNitfInfo::getKeywordlist(ossimKeywordlist& kwl)const
-{
-   bool result = false;
-   if ( m_nitfFile.valid() )
-   {
-      m_nitfFile->saveState(kwl, "nitf.");
-   }
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfJ2klraTag.cpp b/ossim/src/ossim/support_data/ossimNitfJ2klraTag.cpp
deleted file mode 100644
index d8e8a4f..0000000
--- a/ossim/src/ossim/support_data/ossimNitfJ2klraTag.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimNitfJ2klraTag.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: NITF J2KLRA tag.
-//
-// See:  ISO/IEC BIIF Profile BPJ2K01.00 Table 9-3.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-
-#include <ossim/support_data/ossimNitfJ2klraTag.h>
-#include <ossim/base/ossimString.h>
-
-#include <cstring> /* for memcpy */
-#include <iomanip>
-#include <istream>
-#include <ostream>
-
-RTTI_DEF1(ossimNitfJ2klraTag, "ossimNitfJ2klraTag", ossimNitfRegisteredTag);
-
-ossimNitfJ2klraTag::ossimNitfJ2klraTag()
-   : ossimNitfRegisteredTag(std::string("J2KLRA"), 0),
-     m_layer(1)
-{
-   clearFields();
-}
-
-void ossimNitfJ2klraTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(m_orig, ORIG_SIZE);
-   in.read(m_levels_o, NLEVELS_O_SIZE);
-   in.read(m_bands_o, NBANDS_O_SIZE);
-   in.read(m_layers_o, NLAYERS_O_SIZE);
-
-   ossim_uint32 layers = getNumberOfLayersOriginal();
-   if ( layers && (layers < 1000) ) // 999 max
-   {
-      m_layer.resize(layers);
-      for ( ossim_uint32 i = 0; i < layers; ++i )
-      {
-         in.read(m_layer[i].m_layer_id, LAYER_ID_SIZE);
-         in.read(m_layer[i].m_bitrate, BITRATE_SIZE);
-         m_layer[i].m_layer_id[LAYER_ID_SIZE] = '\0';
-         m_layer[i].m_bitrate[BITRATE_SIZE]   = '\0';
-      }
-   }
-   else
-   {
-      m_layer.clear();
-   }
-
-   // Conditional:
-   ossim_uint32 orig = getOriginNumber();
-   if ( (orig == 1) || ( orig == 3 ) || ( orig == 9 ) )
-   {
-      in.read(m_nlevels_i, NLEVELS_I_SIZE);
-      in.read(m_nbands_i, NBANDS_I_SIZE);
-      in.read(m_nlayers_i, NLAYERS_I_SIZE);
-   }
-
-   // Set the base tag length.
-   setTagLength( getSizeInBytes() );
-}
-
-void ossimNitfJ2klraTag::writeStream(std::ostream& out)
-{
-   out.write(m_orig, ORIG_SIZE);
-   out.write(m_levels_o, NLEVELS_O_SIZE);
-   out.write(m_bands_o, NBANDS_O_SIZE);
-   out.write(m_layers_o, NLAYERS_O_SIZE);
-   
-   ossim_uint32 size = m_layer.size();
-   for ( ossim_uint32 i = 0; i < size; ++i )
-   {
-      out.write(m_layer[i].m_layer_id, LAYER_ID_SIZE);
-      out.write(m_layer[i].m_bitrate, BITRATE_SIZE);
-   }
-
-   // Conditional:
-   ossim_uint32 orig = getOriginNumber();
-   if ( (orig == 1) || ( orig == 3 ) || ( orig == 9 ) )
-   {
-      out.write(m_nlevels_i, NLEVELS_I_SIZE);
-      out.write(m_nbands_i, NBANDS_I_SIZE);
-      out.write(m_nlayers_i, NLAYERS_I_SIZE);
-   }
-}
-
-ossim_uint32 ossimNitfJ2klraTag::getSizeInBytes()const
-{
-   ossim_uint32 result = 11 + (m_layer.size() * 12);
-
-   // Conditional:
-   ossim_uint32 orig = getOriginNumber();
-   if ( (orig == 1) || ( orig == 3 ) || ( orig == 9 ) )
-   {
-      result += 10;
-   }
-   return result;
-}
-
-void ossimNitfJ2klraTag::clearFields()
-{
-   memset(m_orig, 0, ORIG_SIZE);
-
-   memset(m_levels_o, 0, NLEVELS_O_SIZE);
-   memset(m_bands_o, 0, NBANDS_O_SIZE);
-   memset(m_layers_o, 0, NLAYERS_O_SIZE);
-
-   m_layer.clear();
-
-   memset(m_nlevels_i, 0, NLEVELS_I_SIZE);
-   memset(m_nbands_i, 0, NBANDS_I_SIZE);
-   memset(m_nlayers_i, 0, NLAYERS_I_SIZE);
-   
-   m_orig[ORIG_SIZE]= '\0';
-   
-   m_levels_o[NLEVELS_O_SIZE]= '\0';
-   m_bands_o[NBANDS_O_SIZE]= '\0';
-   m_layers_o[NLAYERS_O_SIZE]= '\0';
-
-   m_nlevels_i[NLEVELS_I_SIZE]= '\0';
-   m_nbands_i[NBANDS_I_SIZE] = '\0';
-   m_nlayers_i[NLAYERS_I_SIZE] = '\0';
-
-   // Set the base tag length.
-   setTagLength( 0 );
-}
-
-std::ostream& ossimNitfJ2klraTag::print(std::ostream& out,
-                                        const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(ios::left)
-       << pfx << std::setw(24) << "CETAG:"     << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"       << getTagLength() << "\n"
-       << pfx << std::setw(24) << "ORIG:"      << m_orig << "\n"
-       << pfx << std::setw(24) << "NLEVELS_O:" << m_levels_o << "\n"
-       << pfx << std::setw(24) << "NBANDS_O:"  << m_bands_o << "\n"
-       << pfx << std::setw(24) << "NLAYERS_O:" << m_layers_o << "\n";
-
-   ossim_uint32 size = m_layer.size();
-   for ( ossim_uint32 i = 0; i < size; ++i )
-   {
-      out << pfx << "LAYER_ID[" << i << std::setw(14) << "]:" << m_layer[i].m_layer_id << "\n"
-          << pfx << "BITRATE[" << i << std::setw(15) << "]:" << m_layer[i].m_bitrate << "\n";
-   }
-
-   // Conditional:
-   ossim_uint32 orig = getOriginNumber();
-   if ( (orig == 1) || ( orig == 3 ) || ( orig == 9 ) )
-   {
-      out << pfx << std::setw(24) << "NLEVELS_I:"     << m_nlevels_i << "\n"
-          << pfx << std::setw(24) << "NBANDS_I_SIZE:" << m_nbands_i << "\n"
-          << pfx << std::setw(24) << "NLAYERS_I:"     << m_nlayers_i << "\n";
-   }
-   return out;
-}
-   
-ossim_uint32 ossimNitfJ2klraTag::getOriginNumber() const
-{
-   return ossimString(m_orig).toUInt32();
-}
-   
-ossim_uint32 ossimNitfJ2klraTag::getNumberOfLayersOriginal() const
-{
-   return ossimString(m_layers_o).toUInt32();
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfLocalCartographicTag.cpp b/ossim/src/ossim/support_data/ossimNitfLocalCartographicTag.cpp
deleted file mode 100644
index f60a00b..0000000
--- a/ossim/src/ossim/support_data/ossimNitfLocalCartographicTag.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfLocalCartographicTag.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <sstream>
-#include <iostream>
-#include <iomanip>
-#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
-
-RTTI_DEF1(ossimNitfLocalCartographicTag, "ossimNitfLocalCartographicTag", ossimNitfRegisteredTag);
-
-ossimNitfLocalCartographicTag::ossimNitfLocalCartographicTag()
-   : ossimNitfRegisteredTag(std::string("MAPLOB"), 43)
-{
-}
-
-ossimNitfLocalCartographicTag::~ossimNitfLocalCartographicTag()
-{
-}
-
-void ossimNitfLocalCartographicTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theLengthUnits, 3);
-   in.read(theEastingInterval, 5);
-   in.read(theNorthingInterval, 5);
-   in.read(theEastingReferenceOrigin, 15);
-   in.read(theNorthingReferenceOrigin, 15);
-}
-
-void ossimNitfLocalCartographicTag::writeStream(std::ostream& out)
-{
-   out.write(theLengthUnits, 3);
-   out.write(theEastingInterval, 5);
-   out.write(theNorthingInterval, 5);
-   out.write(theEastingReferenceOrigin, 15);
-   out.write(theNorthingReferenceOrigin, 15);
-}
-
-void ossimNitfLocalCartographicTag::clearFields()
-{
-   memset(theLengthUnits, ' ', 3);
-   memset(theEastingInterval, '0', 5);
-   memset(theNorthingInterval, '0', 5);
-   memset(theEastingReferenceOrigin, '0', 15);
-   memset(theNorthingReferenceOrigin, '0', 15);
-
-   theLengthUnits[3]              = '\0';
-   theEastingInterval[5]          = '\0';
-   theNorthingInterval[5]         = '\0';
-   theEastingReferenceOrigin[15]  = '\0';
-   theNorthingReferenceOrigin[15] = '\0';
-}
-
-void ossimNitfLocalCartographicTag::setLengthUnits(const ossimString& units)
-{
-   ossimString temp = ossimString(units).trim().upcase();
-   std::ostringstream out;
-
-   out << std::setw(3)
-       << std::setfill(' ')
-       << temp.c_str();
-   
-   memcpy(theLengthUnits, out.str().c_str(), 3);
-}
-
-void ossimNitfLocalCartographicTag::setEastingInterval(ossim_uint32 eastingInterval)
-{
-   ossim_uint32 temp = eastingInterval;
-
-   if(temp > 99999)
-   {
-      temp = 99999;
-   }
-   
-   std::ostringstream out;
-
-   out << std::setw(5)
-       << std::setfill('0')
-       << temp;
-   
-   memcpy(theEastingInterval, out.str().c_str(), 5);
-}
-
-void ossimNitfLocalCartographicTag::setNorthingInterval(ossim_uint32 northingInterval)
-{
-   ossim_uint32 temp = northingInterval;
-
-   if(temp > 99999)
-   {
-      temp = 99999;
-   }
-   
-   std::ostringstream out;
-
-   out << std::setw(5)
-       << std::setfill('0')
-       << temp;
-   
-   memcpy(theNorthingInterval, out.str().c_str(), 5);
-}
-
-void ossimNitfLocalCartographicTag::setEastingReferenceOrigin(ossim_float64 east)
-{
-   std::ostringstream out;
-
-   out << std::setw(15)
-       << std::setfill(' ')
-       << std::setprecision(1)
-       << std::setiosflags(std::ios::fixed)
-       << east;
-   
-   memcpy(theEastingReferenceOrigin, out.str().c_str(), 15);
-   
-}
-
-void ossimNitfLocalCartographicTag::setNorthingReferenceOrigin(ossim_float64 north)
-{
-   std::ostringstream out;
-
-   out << std::setw(15)
-       << std::setfill(' ')
-       << std::setprecision(1)
-       << std::setiosflags(std::ios::fixed)
-       << north;
-   
-   memcpy(theNorthingReferenceOrigin, out.str().c_str(), 15);
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfLocalGeographicTag.cpp b/ossim/src/ossim/support_data/ossimNitfLocalGeographicTag.cpp
deleted file mode 100644
index 3b33c6b..0000000
--- a/ossim/src/ossim/support_data/ossimNitfLocalGeographicTag.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Intelligence Data Systems. 
-//
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfLocalGeographicTag.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
-#include <iomanip>
-#include <sstream>
-
-RTTI_DEF1(ossimNitfLocalGeographicTag, "ossimNitfLocalGeographicTag", ossimNitfRegisteredTag);
-
-ossimNitfLocalGeographicTag::ossimNitfLocalGeographicTag()
-   : ossimNitfRegisteredTag(std::string("GEOLOB"), 48)
-{
-   clearFields();
-}
-
-ossimNitfLocalGeographicTag::~ossimNitfLocalGeographicTag()
-{
-}
-
-void ossimNitfLocalGeographicTag::parseStream(std::istream& in)
-{
-   in.read(theLonDensity, 9);
-   in.read(theLatDensity, 9);
-   in.read(theLonOrigin, 15);
-   in.read(theLatOrigin, 15);
-}
-
-void ossimNitfLocalGeographicTag::writeStream(std::ostream& out)
-{
-   out.write(theLonDensity, 9);
-   out.write(theLatDensity, 9);
-   out.write(theLonOrigin, 15);
-   out.write(theLatOrigin, 15);
-}
-
-void ossimNitfLocalGeographicTag::clearFields()
-{
-   memset(theLonDensity, ' ', 9);
-   memset(theLatDensity, ' ', 9);
-   memset(theLonOrigin, 0, 15);
-   memset(theLatOrigin, 0, 15);
-
-   
-   
-   theLonDensity[9] = '\0';
-   theLatDensity[9] = '\0';
-   theLonOrigin[15] = '\0';
-   theLatOrigin[14] = '\0';
-}
-
-void ossimNitfLocalGeographicTag::setDegreesPerPixelLat(double deltaLat)
-{
-   ossim_uint32 pixels = 0;
-   if(deltaLat > 0.0)
-   {
-      pixels = (ossim_uint32)((1.0/deltaLat)*360.0 + .5);
-   }
-   std::ostringstream out;
-
-   out << std::setw(9)
-       << std::setfill('0')
-       << pixels;
-
-   memcpy(theLatDensity, out.str().c_str(), 9);
-}
-
-void ossimNitfLocalGeographicTag::setDegreesPerPixelLon(double deltaLon)
-{
-   ossim_uint32 pixels = 0;
-   if(deltaLon > 0.0)
-   {
-      pixels = (ossim_uint32)((1.0/deltaLon)*360.0 + .5);
-   }
-   std::ostringstream out;
-
-   out << std::setw(9)
-       << std::setfill('0')
-       << pixels;
-
-   memcpy(theLonDensity, out.str().c_str(), 9);
-}
-
-void ossimNitfLocalGeographicTag::setLatOrigin(double origin)
-{
-   std::ostringstream out;
-
-   out << std::setw(15)
-       << std::setfill('0')
-       << origin;
-   memcpy(theLatOrigin, out.str().c_str(), 15);
-}
-
-void ossimNitfLocalGeographicTag::setLonOrigin(double origin)
-{
-   std::ostringstream out;
-
-   out << std::setw(15)
-       << std::setfill('0')
-       << origin;
-   memcpy(theLonOrigin, out.str().c_str(), 15);
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfMstgtaTag.cpp b/ossim/src/ossim/support_data/ossimNitfMstgtaTag.cpp
deleted file mode 100644
index 4ae3322..0000000
--- a/ossim/src/ossim/support_data/ossimNitfMstgtaTag.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: MSTGTA Mission Target Information Extension Format
-// tag class definition.
-//
-// See document STDI-0002 Table 8-16 for more info.
-// 
-//----------------------------------------------------------------------------
-// $Id
-
-#include <cstring>
-#include <istream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfMstgtaTag.h>
-
-
-RTTI_DEF1(ossimNitfMstgtaTag, "ossimNitfMstgtaTag", ossimNitfRegisteredTag);
-
-ossimNitfMstgtaTag::ossimNitfMstgtaTag()
-   : ossimNitfRegisteredTag(std::string("MSTGTA"), 101)
-{
-   clearFields();
-}
-
-ossimNitfMstgtaTag::~ossimNitfMstgtaTag()
-{
-}
-
-void ossimNitfMstgtaTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theTgtNum, TGT_NUM_SIZE);
-   in.read(theTgtId, TGT_ID_SIZE);
-   in.read(theTgtBe, TGT_BE_SIZE);
-   in.read(theTgtPri, TGT_PRI_SIZE);
-   in.read(theTgtReq, TGT_REQ_SIZE);
-   in.read(theTgtLtiov, TGT_LTIOV_SIZE);
-   in.read(theTgtType, TGT_TYPE_SIZE);
-   in.read(theTgtColl, TGT_COLL_SIZE);
-   in.read(theTgtCat, TGT_CAT_SIZE);
-   in.read(theTgtUtc, TGT_UTC_SIZE);
-   in.read(theTgtElev, TGT_ELEV_SIZE);
-   in.read(theTgtElevUnit, TGT_ELEV_UNIT_SIZE);
-   in.read(theTgtLoc, TGT_LOC_SIZE);
-}
-
-void ossimNitfMstgtaTag::writeStream(std::ostream& out)
-{
-   out.write(theTgtNum, TGT_NUM_SIZE);
-   out.write(theTgtId, TGT_ID_SIZE);
-   out.write(theTgtBe, TGT_BE_SIZE);
-   out.write(theTgtPri, TGT_PRI_SIZE);
-   out.write(theTgtReq, TGT_REQ_SIZE);
-   out.write(theTgtLtiov, TGT_LTIOV_SIZE);
-   out.write(theTgtType, TGT_TYPE_SIZE);
-   out.write(theTgtColl, TGT_COLL_SIZE);
-   out.write(theTgtCat, TGT_CAT_SIZE);
-   out.write(theTgtUtc, TGT_UTC_SIZE);
-   out.write(theTgtElev, TGT_ELEV_SIZE);
-   out.write(theTgtElevUnit, TGT_ELEV_UNIT_SIZE);
-   out.write(theTgtLoc, TGT_LOC_SIZE);
-}
-
-void ossimNitfMstgtaTag::clearFields()
-{
-   // BCS-N's to '0's, BCS-A's to ' '(spaces)
-
-   // clear
-   memset(theTgtNum, '0', TGT_NUM_SIZE);
-   memset(theTgtId, ' ', TGT_ID_SIZE);
-   memset(theTgtBe, ' ', TGT_BE_SIZE);
-   memset(theTgtPri, ' ', TGT_PRI_SIZE);
-   memset(theTgtReq, ' ', TGT_REQ_SIZE);
-   memset(theTgtLtiov, ' ', TGT_LTIOV_SIZE);
-   memset(theTgtType, ' ', TGT_TYPE_SIZE);
-   memset(theTgtColl, '0', TGT_COLL_SIZE);
-   memset(theTgtCat, ' ', TGT_CAT_SIZE);
-   memset(theTgtUtc, ' ', TGT_UTC_SIZE);
-   memset(theTgtElev, ' ', TGT_ELEV_SIZE);
-   memset(theTgtElevUnit, ' ', TGT_ELEV_UNIT_SIZE);
-   memset(theTgtLoc, ' ', TGT_LOC_SIZE);
-
-   // null terminate
-   theTgtNum[TGT_NUM_SIZE] = '\0';
-   theTgtId[TGT_ID_SIZE] = '\0';
-   theTgtBe[TGT_BE_SIZE] = '\0';
-   theTgtPri[TGT_PRI_SIZE] = '\0';
-   theTgtReq[TGT_REQ_SIZE] = '\0';
-   theTgtLtiov[TGT_LTIOV_SIZE] = '\0';
-   theTgtType[TGT_TYPE_SIZE] = '\0';
-   theTgtColl[TGT_COLL_SIZE] = '\0';
-   theTgtCat[TGT_CAT_SIZE] = '\0';
-   theTgtUtc[TGT_UTC_SIZE] = '\0';
-   theTgtElev[TGT_ELEV_SIZE] = '\0';
-   theTgtElevUnit[TGT_ELEV_UNIT_SIZE] = '\0';
-   theTgtLoc[TGT_LOC_SIZE] = '\0';
-}
-
-std::ostream& ossimNitfMstgtaTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "TGT_NUM:" << theTgtNum << "\n"
-       << pfx << std::setw(24) << "TGT_ID:" << theTgtId << "\n"
-       << pfx << std::setw(24) << "TGT_BE:" << theTgtBe << "\n"
-       << pfx << std::setw(24) << "TGT_PRI:" << theTgtPri << "\n"
-       << pfx << std::setw(24) << "TGT_REQ:" << theTgtReq << "\n"
-       << pfx << std::setw(24) << "TGT_LTIOV:" << theTgtLtiov << "\n"
-       << pfx << std::setw(24) << "TGT_TYPE:" << theTgtType << "\n"
-       << pfx << std::setw(24) << "TGT_COLL:" << theTgtColl << "\n"
-       << pfx << std::setw(24) << "TGT_CAT:" << theTgtCat << "\n"
-       << pfx << std::setw(24) << "TGT_UTC:" << theTgtUtc << "\n"
-       << pfx << std::setw(24) << "TGT_ELEV:" << theTgtElev << "\n"
-       << pfx << std::setw(24) << "TGT_ELEV_UNIT:" << theTgtElevUnit << "\n"
-       << pfx << std::setw(24) << "TGT_LOC:" << theTgtLoc << "\n";
-   
-   return out;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfNameConversionTables.cpp b/ossim/src/ossim/support_data/ossimNitfNameConversionTables.cpp
deleted file mode 100644
index ef356a1..0000000
--- a/ossim/src/ossim/support_data/ossimNitfNameConversionTables.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimNitfNameConversionTables.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstddef>
-#include <ossim/support_data/ossimNitfNameConversionTables.h>
-#include <ossim/base/ossimString.h>
-
-struct ossimNitfMapProjectionCodeToOssimName
-{
-   const char* nitfProjCode; // nitf code name
-   const char* projectionName; // ossim projection name
-};
-
-struct ossimNitfMapProjectionCodeToNitfName
-{
-   const char* nitfProjCode; // nitf code name
-   const char* projectionName; // ossim projection name
-};
-
-static const ossimNitfMapProjectionCodeToOssimName mapProjectiontable[]=
-{
-   {"AC", "ossimAlbersProjection"},
-   {"AL", "ossimAzimEquDistProjection"},
-   {"BF", "ossimBonneProjection"},
-   {"CP", "ossimEquDistCylProjection"},
-   {"CP", "ossimLlxyProjection"},
-   {"CS", "ossimCassiniProjection"},
-   {"ED", "ossimEckert6Projection"},
-   {"EF", "ossimEckert4Projection"},
-   {"GN", "ossimGnomonicProjection"},
-   {"LE", "ossimLambertConformalConicProjection"},
-   {"LI", "ossimCylEquAreaProjection"},
-   {"MC", "ossimMercatorProjection"},
-   {"MH", "ossimMillerProjection"},
-   {"MP", "ossimMollweidProjection"},
-   {"NT", "ossimNewZealandMapGridProjection"},
-   {"OD", "ossimOrthoGraphicProjection"},
-   {"PG", "ossimPolarStereoProjection"},
-   {"PH", "ossimPolyconicProjection"},
-   {"SA", "ossimSinusoidalProjection"},
-   {"SX", "ossimSpaceObliqueMercatorProjection"},
-   {"TC", "ossimTransMercatorProjection"},
-   {"TX", "ossimTransCylEquAreaProjection"},
-   {"VA", "ossimVanDerGrintenProjection"},
-   { 0, 0 }
-};
-
-static const ossimNitfMapProjectionCodeToNitfName nitfMapProjectiontable[]=
-{
-   {"AC", "Albers Equal-Area Conic"},
-   {"AK", "(Lambert) Azimuthal Equal-Area"},
-   {"AL", "Azimuthal Equidistant"},
-   {"BF", "Bonne"},
-   {"CC", "Equidistant Conic with 1 Standard Parallel"},
-   {"CP", "Equirectangular"},
-   {"CS", "Cassini-Soldner"},
-   {"ED", "Eckert VI"},
-   {"EF", "Eckert IV"},
-   {"GN", "Gnomonic"},
-   {"HX", "Hotine Oblique Mercator based on 2 Points"},
-   {"KA", " Equidistant Conic with 2 Standard Parallels"},
-   {"LA", "Laborde"},
-   {"LE", "Lambert Conformal Conic"},
-   {"LI", "Cylindrical Equal Area"},
-   {"LJ", " Lambert Equal-Area Meridional"},
-   {"MC", "Mercator"},
-   {"MH", "Miller Cylindrical"},
-   {"MJ", "French Lambert"},
-   {"MP", "Mollweide"},
-   {"NT", "New Zealand Map Grid"},
-   {"OC", "Oblique Mercator"},
-   {"OD", "Orthographic"},
-   {"PG", "Polar Stereographic"},
-   {"PH", "Polyconic"},
-   {"RS", "Hotine Oblique Mercator (Rectified Skew Orthomorphic)"},
-   {"RB", "Hotine Oblique Mercator (Rectified Skew Orthomorphic)"},
-   {"RX", "Robinson"},
-   {"SA", "Sinusoidal"},
-   {"SD", "Oblique Stereographic"},
-   {"SX", "Space Oblique Mercator"},
-   {"TC", " Transverse Mercator"},
-   {"TX", "Transverse Cylindrical Equal Area"},
-   {"VA", "Van der Grinten"},
-   {"VX", "General Vertical NearSide Perspective"},
-   { 0, 0 }
-};
-
-ossimNitfNameConversionTables::ossimNitfNameConversionTables()
-{
-}
-
-ossimString ossimNitfNameConversionTables::convertMapProjectionNameToNitfCode(const ossimString& mapProjectionName)const
-{
-   ossim_uint32 idx = 0;
-
-   while(mapProjectiontable[idx].nitfProjCode)
-   {
-      if(mapProjectionName == mapProjectiontable[idx].projectionName)
-      {
-         return mapProjectiontable[idx].nitfProjCode;
-      }
-      ++idx;
-   }
-
-   return "";
-}
-
-ossimString ossimNitfNameConversionTables::convertNitfCodeToOssimProjectionName(const ossimString& nitfProjectionCode)const
-{
-   ossim_uint32 idx = 0;
-
-   while(mapProjectiontable[idx].nitfProjCode)
-   {
-      if(nitfProjectionCode == mapProjectiontable[idx].nitfProjCode)
-      {
-         return mapProjectiontable[idx].projectionName;
-      }
-      ++idx;
-   }
-
-   return "";
-}
-
-ossimString ossimNitfNameConversionTables::convertNitfCodeToNitfProjectionName(const ossimString& nitfProjectionCode)const
-{
-   ossim_uint32 idx = 0;
-
-   while(nitfMapProjectiontable[idx].nitfProjCode)
-   {
-      if(nitfProjectionCode == nitfMapProjectiontable[idx].nitfProjCode)
-      {
-         return nitfMapProjectiontable[idx].projectionName;
-      }
-      ++idx;
-   }
-
-   return "";
-}
-
-ossimString ossimNitfNameConversionTables::convertNitfProjectionNameToNitfCode(const ossimString& nitfProjectionName)const
-{
-   ossim_uint32 idx = 0;
-
-   while(nitfMapProjectiontable[idx].nitfProjCode)
-   {
-      if(nitfProjectionName ==  nitfMapProjectiontable[idx].projectionName)
-      {
-         return nitfMapProjectiontable[idx].nitfProjCode;
-      }
-      ++idx;
-   }
-
-   return "";
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfPiaimcTag.cpp b/ossim/src/ossim/support_data/ossimNitfPiaimcTag.cpp
deleted file mode 100644
index bcffd2b..0000000
--- a/ossim/src/ossim/support_data/ossimNitfPiaimcTag.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: PIAIMC tag class declaration.
-// 
-// "Profile for Imagery Access Image Support Extensions"
-//
-// See document STDI-0002 Table 6-1 for more info.
-// 
-// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfPiaimcTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstring> /* for memcpy */
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfPiaimcTag.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimCommon.h>
-
-static const ossimString CLOUDCVR_KW = "CLOUDCVR";
-static const ossimString SRP_KW = "SRP";
-static const ossimString SENSMODE_KW = "SENSMODE";
-static const ossimString SENSNAME_KW = "SENSNAME";
-static const ossimString SOURCE_KW = "SOURCE";
-static const ossimString COMGEN_KW = "COMGEN";
-static const ossimString SUBQUAL_KW = "SUBQUAL";
-static const ossimString PIAMSNNUM_KW = "PIAMSNNUM";
-static const ossimString CAMSPECS_KW = "CAMSPECS";
-static const ossimString PROJID_KW = "PROJID";
-static const ossimString GENERATION_KW = "GENERATION";
-static const ossimString ESD_KW = "ESD";
-static const ossimString OTHERCOND_KW = "OTHERCOND";
-static const ossimString MEANGSD_KW = "MEANGSD";
-static const ossimString IDATUM_KW = "IDATUM";
-static const ossimString IELLIP_KW = "IELLIP";
-static const ossimString PREPROC_KW = "PREPROC";
-static const ossimString IPROJ_KW = "IPROJ";
-static const ossimString SATTRACK_KW = "SATTRACK";
-
-RTTI_DEF1(ossimNitfPiaimcTag,
-          "ossimNitfPiaimcTag",
-          ossimNitfRegisteredTag);
-
-ossimNitfPiaimcTag::ossimNitfPiaimcTag()
-   : ossimNitfRegisteredTag(std::string("PIAIMC"), 362)
-{
-   clearFields();
-}
-
-void ossimNitfPiaimcTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theCloudcvr,   CLOUDCVR_SIZE);
-   in.read(theSrp,        SRP_SIZE);
-   in.read(thesSensmode,  SENSMODE_SIZE);
-   in.read(theSensname,   SENSNAME_SIZE);
-   in.read(theSource,     SOURCE_SIZE);
-   in.read(theComgen,     COMGEN_SIZE);
-   in.read(theSubqual,    SUBQUAL_SIZE);
-   in.read(thePiamsnnum,  PIAMSNNUM_SIZE);
-   in.read(theCamspecs,   CAMSPECS_SIZE);
-   in.read(theProjid,     PROJID_SIZE);
-   in.read(theGeneration, GENERATION_SIZE);
-   in.read(theEsd,        ESD_SIZE);
-   in.read(theOthercond,  OTHERCOND_SIZE);
-   in.read(theMeanGsd,    MEANGSD_SIZE);
-   in.read(theIdatum,     IDATUM_SIZE);
-   in.read(theIellip,     IELLIP_SIZE);
-   in.read(thePreproc,    PREPROC_SIZE);
-   in.read(theIproj,      IPROJ_SIZE);
-   in.read(theSattrack,   SATTRACK_SIZE);
-}
-
-void ossimNitfPiaimcTag::writeStream(std::ostream& out)
-{
-   out.write(theCloudcvr,   CLOUDCVR_SIZE);
-   out.write(theSrp,        SRP_SIZE);
-   out.write(thesSensmode,  SENSMODE_SIZE);
-   out.write(theSensname,   SENSNAME_SIZE);
-   out.write(theSource,     SOURCE_SIZE);
-   out.write(theComgen,     COMGEN_SIZE);
-   out.write(theSubqual,    SUBQUAL_SIZE);
-   out.write(thePiamsnnum,  PIAMSNNUM_SIZE);
-   out.write(theCamspecs,   CAMSPECS_SIZE);
-   out.write(theProjid,     PROJID_SIZE);
-   out.write(theGeneration, GENERATION_SIZE);
-   out.write(theEsd,        ESD_SIZE);
-   out.write(theOthercond,  OTHERCOND_SIZE);
-   out.write(theMeanGsd,    MEANGSD_SIZE);
-   out.write(theIdatum,     IDATUM_SIZE);
-   out.write(theIellip,     IELLIP_SIZE);
-   out.write(thePreproc,    PREPROC_SIZE);
-   out.write(theIproj,      IPROJ_SIZE);
-   out.write(theSattrack,   SATTRACK_SIZE);
-}
-
-void ossimNitfPiaimcTag::clearFields()
-{
-   memcpy(theCloudcvr, "999",   CLOUDCVR_SIZE);
-   memset(theSrp,        ' ',        SRP_SIZE);
-   memset(thesSensmode,  ' ',  SENSMODE_SIZE);
-   memset(theSensname,   ' ',   SENSNAME_SIZE);
-   memset(theSource,     ' ',     SOURCE_SIZE);
-   memset(theComgen,     ' ',     COMGEN_SIZE);
-   memset(theSubqual,    ' ',    SUBQUAL_SIZE);
-   memset(thePiamsnnum,  ' ',  PIAMSNNUM_SIZE);
-   memset(theCamspecs,   ' ',   CAMSPECS_SIZE);
-   memset(theProjid,     ' ',     PROJID_SIZE);
-   memset(theGeneration, ' ', GENERATION_SIZE);
-   memset(theEsd,        ' ',        ESD_SIZE);
-   memset(theOthercond,  ' ',  OTHERCOND_SIZE);
-   memset(theMeanGsd,    ' ',    MEANGSD_SIZE);
-   memset(theIdatum,     ' ',     IDATUM_SIZE);
-   memset(theIellip,     ' ',     IELLIP_SIZE);
-   memset(thePreproc,    ' ',    PREPROC_SIZE);
-   memset(theIproj,      ' ',     IPROJ_SIZE);
-   memset(theSattrack,   ' ',   SATTRACK_SIZE);
-
-   theCloudcvr[CLOUDCVR_SIZE]     = '\0';
-   theSrp[SRP_SIZE]               = '\0';
-   thesSensmode[SENSMODE_SIZE]    = '\0';
-   theSensname[SENSNAME_SIZE]     = '\0';
-   theSource[SOURCE_SIZE]         = '\0';
-   theComgen[COMGEN_SIZE]         = '\0';
-   theSubqual[SUBQUAL_SIZE]       = '\0';
-   thePiamsnnum[PIAMSNNUM_SIZE]   = '\0';
-   theCamspecs[CAMSPECS_SIZE]     = '\0';
-   theProjid[PROJID_SIZE]         = '\0';
-   theGeneration[GENERATION_SIZE] = '\0';
-   theEsd[ESD_SIZE]               = '\0';
-   theOthercond[OTHERCOND_SIZE]   = '\0';
-   theMeanGsd[MEANGSD_SIZE]       = '\0';
-   theIdatum[IDATUM_SIZE]         = '\0';
-   theIellip[IELLIP_SIZE]         = '\0';
-   thePreproc[PREPROC_SIZE]       = '\0';
-   theIproj[IPROJ_SIZE]           = '\0';
-   theSattrack[SATTRACK_SIZE]     = '\0';
-}
-
-std::ostream& ossimNitfPiaimcTag::print(std::ostream& out,
-                                        const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "CLOUDCVR:"  << theCloudcvr << "\n"
-       << pfx << std::setw(24) << "SRP:"       << theSrp << "\n"
-       << pfx << std::setw(24) << "SENSMODE:"   << thesSensmode << "\n"
-       << pfx << std::setw(24) << "SENSNAME:"   << theSensname << "\n"
-       << pfx << std::setw(24) << "SOURCE:"     << theSource << "\n"
-       << pfx << std::setw(24) << "COMGEN:"     << theComgen << "\n"
-       << pfx << std::setw(24) << "SUBQUAL:"    << theSubqual << "\n"
-       << pfx << std::setw(24) << "PIAMSNNUM:"  << thePiamsnnum << "\n"
-       << pfx << std::setw(24) << "CAMSPECS:"   << theCamspecs << "\n"
-       << pfx << std::setw(24) << "PROJID:"     << theProjid << "\n"
-       << pfx << std::setw(24) << "GENERATION:" << theGeneration << "\n"
-       << pfx << std::setw(24) << "ESD:"        << theEsd << "\n"
-       << pfx << std::setw(24) << "OTHERCOND:"  << theOthercond << "\n"
-       << pfx << std::setw(24) << "MEANGSD:"    << theMeanGsd << "\n"
-       << pfx << std::setw(24) << "IDATUM:"     << theIdatum << "\n"
-       << pfx << std::setw(24) << "IELLIP:"     << theIellip << "\n"
-       << pfx << std::setw(24) << "PREPROC:"    << thePreproc << "\n"
-       << pfx << std::setw(24) << "IPROJ:"     << theIproj << "\n"
-       << pfx << std::setw(24) << "SATTRACK:"  << theSattrack << "\n";
-
-   return out;
-}
-
-ossimString ossimNitfPiaimcTag::getCloudcvrString() const
-{
-   return ossimString(theCloudcvr);
-}
-
-ossimString ossimNitfPiaimcTag::getSrpString() const
-{
-   return ossimString(theSrp);
-}
-   
-ossimString ossimNitfPiaimcTag::getSensmodeString() const
-{
-   return ossimString(thesSensmode);
-}
-
-ossimString ossimNitfPiaimcTag::getSensnameString() const
-{
-   return ossimString(theSensname);
-}
-   
-ossimString ossimNitfPiaimcTag::getSourceString() const
-{
-   return ossimString(theSource);
-}
-  
-ossimString ossimNitfPiaimcTag::getComgenString() const
-{
-   return ossimString(theComgen);
-}
-
-ossimString ossimNitfPiaimcTag::getSubqualString() const
-{
-   return ossimString(theSubqual);
-}
-
-ossimString ossimNitfPiaimcTag::getPiamsnnumString() const
-{
-   return ossimString(thePiamsnnum);
-}
-
-ossimString ossimNitfPiaimcTag::getCamspecsString() const
-{
-   return ossimString(theCamspecs);
-}
-
-ossimString ossimNitfPiaimcTag::getProjidString() const
-{
-   return ossimString(theProjid);
-}
-
-ossimString ossimNitfPiaimcTag::getGenerationString() const
-{
-   return ossimString(theGeneration);
-}
-
-ossimString ossimNitfPiaimcTag::getEsdString() const
-{
-   return ossimString(theEsd);
-}
-   
-ossimString ossimNitfPiaimcTag::getOthercondString() const
-{
-   return ossimString(theOthercond);
-}
-
-ossimString ossimNitfPiaimcTag::getMeadGsdString() const
-{
-   return ossimString(theMeanGsd);
-}
-
-ossim_float64 ossimNitfPiaimcTag::getMeanGsdInMeters() const
-{
-   ossim_float64 gsd = 0.0;
-   
-   ossimString s = theMeanGsd;
-   if (s.size())
-   {
-      ossim_float64 d = s.toFloat64();
-      if ( (d != 0.0) && (ossim::isnan(d) == false) )
-      {
-         gsd = d / 12.0 * MTRS_PER_FT;
-      }
-   }
-   
-   return gsd;
-}
-
-ossimString ossimNitfPiaimcTag::getIdatumString() const
-{
-   return ossimString(theIdatum);
-}
-   
-ossimString ossimNitfPiaimcTag::getIellipString() const
-{
-   return ossimString(theIellip);
-}
-   
-ossimString ossimNitfPiaimcTag::getPreprocString() const
-{
-   return ossimString(thePreproc);
-}
-   
-ossimString ossimNitfPiaimcTag::getIprojString() const
-{
-   return ossimString(theIproj);
-}
-   
-ossimString ossimNitfPiaimcTag::getSattrackString() const
-{
-   return ossimString(theSattrack);
-}
-
-void ossimNitfPiaimcTag::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimNitfRegisteredTag::setProperty(property);
-}
-
-ossimRefPtr<ossimProperty> ossimNitfPiaimcTag::getProperty(const ossimString& name)const
-{
-   ossimProperty* result = 0;
-
-   if(name == CLOUDCVR_KW)
-   {
-      result = new ossimStringProperty(name, theCloudcvr);
-   }
-   else if(name == SRP_KW)
-   {
-      result = new ossimStringProperty(name, theSrp);
-   }
-   else if(name == SENSMODE_KW)
-   {
-      result = new ossimStringProperty(name, thesSensmode);
-   }
-   else if(name == SENSNAME_KW)
-   {
-      result = new ossimStringProperty(name, theSensname);
-   }
-   else if(name == SOURCE_KW)
-   {
-      result = new ossimStringProperty(name, theSource);
-   }
-   else if(name == COMGEN_KW)
-   {
-      result = new ossimStringProperty(name, theComgen);
-   }
-   else if(name == SUBQUAL_KW)
-   {
-      result = new ossimStringProperty(name, theSubqual);
-   }
-   else if(name == PIAMSNNUM_KW)
-   {
-      result = new ossimStringProperty(name, thePiamsnnum);
-   }
-   else if(name == CAMSPECS_KW)
-   {
-      result = new ossimStringProperty(name, theCamspecs);
-   }
-   else if(name == PROJID_KW)
-   {
-      result = new ossimStringProperty(name, theProjid);
-   }
-   else if(name == GENERATION_KW)
-   {
-      result = new ossimStringProperty(name, theGeneration);
-   }
-   else if(name == ESD_KW)
-   {
-      result = new ossimStringProperty(name, theEsd);
-   }
-   else if(name == OTHERCOND_KW)
-   {
-      result = new ossimStringProperty(name, theOthercond);
-   }
-   else if(name == MEANGSD_KW)
-   {
-      result = new ossimStringProperty(name, theMeanGsd);
-   }
-   else if(name == IDATUM_KW)
-   {
-      result = new ossimStringProperty(name, theIdatum);
-   }
-   else if(name == IELLIP_KW)
-   {
-      result = new ossimStringProperty(name, theIellip);
-   }
-   else if(name == PREPROC_KW)
-   {
-      result = new ossimStringProperty(name, thePreproc);
-   }
-   else if(name == IPROJ_KW)
-   {
-      result = new ossimStringProperty(name, theIproj);
-   }
-   else if(name == SATTRACK_KW)
-   {
-      result = new ossimStringProperty(name, theSattrack);
-   }
-   else
-   {
-      return ossimNitfRegisteredTag::getProperty(name);
-   }
-
-   return result;
-}
-
-void ossimNitfPiaimcTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
-   
-   propertyNames.push_back(CLOUDCVR_KW);
-   propertyNames.push_back(SRP_KW);
-   propertyNames.push_back(SENSMODE_KW);
-   propertyNames.push_back(SENSNAME_KW);
-   propertyNames.push_back(SOURCE_KW);
-   propertyNames.push_back(COMGEN_KW);
-   propertyNames.push_back(SUBQUAL_KW);
-   propertyNames.push_back(PIAMSNNUM_KW);
-   propertyNames.push_back(CAMSPECS_KW);
-   propertyNames.push_back(PROJID_KW);
-   propertyNames.push_back(GENERATION_KW);
-   propertyNames.push_back(ESD_KW);
-   propertyNames.push_back(OTHERCOND_KW);
-   propertyNames.push_back(MEANGSD_KW);
-   propertyNames.push_back(IDATUM_KW);
-   propertyNames.push_back(IELLIP_KW);
-   propertyNames.push_back(PREPROC_KW);
-   propertyNames.push_back(IPROJ_KW);
-   propertyNames.push_back(SATTRACK_KW);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfProjectionParameterTag.cpp b/ossim/src/ossim/support_data/ossimNitfProjectionParameterTag.cpp
deleted file mode 100644
index 4c4bc39..0000000
--- a/ossim/src/ossim/support_data/ossimNitfProjectionParameterTag.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfProjectionParameterTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
-#include <sstream>
-#include <iomanip>
-
-ossimNitfProjectionParameterTag::ossimNitfProjectionParameterTag()
-   :ossimNitfRegisteredTag(std::string("PRJPSB"), 0 )
-{
-   clearFields();
-}
-
-ossimNitfProjectionParameterTag::~ossimNitfProjectionParameterTag()
-{
-}
-
-void ossimNitfProjectionParameterTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theProjectionName, 80);
-   in.read(theProjectionCode, 2);
-   in.read(theNumberOfParameters, 1);
-
-   ossim_uint32 numberOfParameters = ossimString(theNumberOfParameters).toUInt32();
-
-   for(ossim_uint32 i = 0; i < numberOfParameters; ++i)
-   {
-      char param[15];
-
-      in.read(param, 15);
-      theProjectionParameters.push_back(ossimString(param,
-                                                    param + 15));
-   }
-   in.read(theFalseXOrigin, 15);
-   in.read(theFalseYOrigin, 15);
-
-   // Set the base tag length.
-   setTagLength( getSizeInBytes() );
-}
-
-void ossimNitfProjectionParameterTag::writeStream(std::ostream& out)
-{
-   out.write(theProjectionName, 80);
-   out.write(theProjectionCode, 2);
-
-   {
-      std::ostringstream tempOut;
-
-      tempOut << std::setw(1)
-              << theProjectionParameters.size();
-      theNumberOfParameters[0] = *(tempOut.str().c_str());
-   }
-   out.write(theNumberOfParameters, 1);
-   ossim_uint32 numberOfParameters = ossimString(theNumberOfParameters).toUInt32();
-
-   for(ossim_uint32 i = 0; i < numberOfParameters; ++i)
-   {
-      out.write(theProjectionParameters[i].c_str(), 15);
-   }
-   out.write(theFalseXOrigin, 15);
-   out.write(theFalseYOrigin, 15);
-}
-
-ossim_uint32 ossimNitfProjectionParameterTag::getSizeInBytes()const
-{
-   return (113 + (ossim_uint32)theProjectionParameters.size()*15);
-}
-
-std::ostream& ossimNitfProjectionParameterTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getRegisterTagName();
-   pfx += ".";
-
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getRegisterTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "PRN:"   << theProjectionName << "\n"
-       << pfx << std::setw(24) << "PCO:"   << theProjectionCode << "\n"
-       << pfx << std::setw(24) << "NUM_PRJ:" << theNumberOfParameters << "\n";
-
-   for (ossim_uint32 i = 0; i < theProjectionParameters.size(); ++i)
-   {
-      ossimString s = "PRJ";
-      s += ossimString::toString(i);
-      s += ":";
-      out << pfx << std::setw(24) << s
-          << theProjectionParameters[i] << "\n";
-   }
-
-   out << pfx << std::setw(24) << "XOR:"   <<theFalseXOrigin << "\n"
-       << pfx << std::setw(24) << "YOR:"   <<theFalseYOrigin << std::endl;
-   
-   return out;   
-}
-    
-void ossimNitfProjectionParameterTag::clearFields()
-{
-   theProjectionParameters.clear();
-   
-   memset(theProjectionName, ' ', 80);
-   memset(theProjectionCode, ' ', 2);
-   memset(theNumberOfParameters, '0', 1);
-   memset(theFalseXOrigin, '0', 15);
-   memset(theFalseYOrigin, '0', 15);
-
-   theProjectionName[80] = '\0';
-   theProjectionCode[2] = '\0';
-   theNumberOfParameters[1] = '\0';
-   theFalseXOrigin[15] = '\0';
-   theFalseYOrigin[15] = '\0';
-
-   // Set the base tag length.
-   setTagLength( 0 );
-}
-
-void ossimNitfProjectionParameterTag::clearParameters()
-{
-   theProjectionParameters.clear();
-   theNumberOfParameters[0] = '0';
-}
-
-void ossimNitfProjectionParameterTag::addParameter(const ossimString& param)
-{
-   std::ostringstream out;
-
-   out << std::setw(15)
-       << std::setfill('0')
-       << param.c_str();
-
-   theProjectionParameters.push_back(out.str());
-}
-
-void ossimNitfProjectionParameterTag::addParameter(const ossim_float64& param)
-{
-   addParameter(ossimString::toString(param));
-}
-
-void ossimNitfProjectionParameterTag::setName(const ossimString& name)
-{
-   std::ostringstream out;
-
-   out << std::setw(80)
-       << std::setfill(' ')
-       << name.c_str();
-
-   memcpy(theProjectionName, out.str().c_str(), 80);
-}
-
-void ossimNitfProjectionParameterTag::setCode(const ossimString& code)
-{
-   std::ostringstream out;
-
-   out << std::setw(2)
-       << std::setfill(' ')
-       << code.c_str();
-
-   memcpy(theProjectionCode, out.str().c_str(), 2);
-}
-
-ossimString ossimNitfProjectionParameterTag::getName()const
-{
-   return ossimString(theProjectionName).trim();
-}
-
-ossimString ossimNitfProjectionParameterTag::getCode()const
-{
-   return ossimString(theProjectionCode).trim();
-}
-
-void ossimNitfProjectionParameterTag::setFalseX(double falseX)
-{
-   std::ostringstream out;
-   out << std::setw(15)
-       << std::setprecision(15)
-       << std::setfill('0')
-       << falseX;
-   
-   memcpy(theFalseXOrigin, out.str().c_str(), 15);
-}
-
-void ossimNitfProjectionParameterTag::setFalseY(double falseY)
-{
-   std::ostringstream out;
-   out << std::setw(15)
-       << std::setprecision(15)
-       << std::setfill('0')
-       << falseY;
-   
-   memcpy(theFalseYOrigin, out.str().c_str(), 15);
-}
-
-double ossimNitfProjectionParameterTag::getFalseX()const
-{
-   return ossimString(theFalseXOrigin).toDouble();
-}
-
-double ossimNitfProjectionParameterTag::getFalseY()const
-{
-   return ossimString(theFalseYOrigin).toDouble();
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfRegisteredTag.cpp b/ossim/src/ossim/support_data/ossimNitfRegisteredTag.cpp
deleted file mode 100644
index 5a9ec4d..0000000
--- a/ossim/src/ossim/support_data/ossimNitfRegisteredTag.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRegisteredTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <sstream>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-
-RTTI_DEF2(ossimNitfRegisteredTag, "ossimNitfRegisteredTag", ossimObject, ossimPropertyInterface)
-
-ossimNitfRegisteredTag::ossimNitfRegisteredTag()
-   : 
-   ossimObject(),
-   ossimPropertyInterface(),
-   m_tagName(),
-   m_tagLength(0)
-{}
-ossimNitfRegisteredTag::ossimNitfRegisteredTag(const std::string& tagName, ossim_uint32 tagLength)
-   : 
-   ossimObject(),
-   ossimPropertyInterface(),
-   m_tagName(tagName),
-   m_tagLength(tagLength)
-{}
-
-ossimNitfRegisteredTag::~ossimNitfRegisteredTag()
-{}
-
-std::string ossimNitfRegisteredTag::getRegisterTagName() const
-{
-   // Deprecated:
-   return m_tagName;
-}
-
-const std::string& ossimNitfRegisteredTag::getTagName() const
-{
-   return m_tagName;
-}
-
-void ossimNitfRegisteredTag::setTagName(const std::string& tagName)
-{
-   m_tagName = tagName;
-}
-
-ossim_uint32 ossimNitfRegisteredTag::getSizeInBytes() const
-{
-   // Deprecated:
-   return getTagLength();
-}
-
-ossim_uint32 ossimNitfRegisteredTag::getTagLength() const
-{
-   return m_tagLength;
-}
-
-void ossimNitfRegisteredTag::setTagLength(ossim_uint32 length)
-{
-   m_tagLength = length;
-}
-
-void ossimNitfRegisteredTag::setProperty(ossimRefPtr<ossimProperty> /* property */)
-{
-}
-
-ossimRefPtr<ossimProperty> ossimNitfRegisteredTag::getProperty(const ossimString& /* name */)const
-{
-   return 0;
-}
-
-void ossimNitfRegisteredTag::getPropertyNames(std::vector<ossimString>& /* propertyNames */)const
-{
-}
-
-void ossimNitfRegisteredTag::getMetadata(ossimKeywordlist& /* kwl */,
-                                         const char* /* prefix */ ) const
-{
-}
-
-std::ostream& ossimNitfRegisteredTag::print(
-   std::ostream& out, const std::string& /* prefix */) const
-{
-   // return print(out);
-   return out;
-}
-
-bool ossimNitfRegisteredTag::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   bool result = false;
-   // by default we will use the already implemented print method as backup
-   //
-   std::ostringstream out;
-   
-   print(out);
-   
-   ossimKeywordlist kwlTemp;
-   
-   std::istringstream in(out.str());
-   if(kwlTemp.parseStream(in))
-   {
-      result = true;
-      kwl.add(prefix, kwlTemp);
-   }
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfRegisteredTagFactory.cpp b/ossim/src/ossim/support_data/ossimNitfRegisteredTagFactory.cpp
deleted file mode 100644
index 77ae98c..0000000
--- a/ossim/src/ossim/support_data/ossimNitfRegisteredTagFactory.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRegisteredTagFactory.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimNitfRegisteredTagFactory.h>
-
-#include <ossim/support_data/ossimNitfAcftbTag.h>
-#include <ossim/support_data/ossimNitfAimidbTag.h>
-#include <ossim/support_data/ossimNitfBlockaTag.h>
-#include <ossim/support_data/ossimNitfCscrnaTag.h>
-#include <ossim/support_data/ossimNitfCsdidaTag.h>
-#include <ossim/support_data/ossimNitfCsexraTag.h>
-#include <ossim/support_data/ossimNitfCsexraTag.h>
-#include <ossim/support_data/ossimNitfEngrdaTag.h>
-#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
-#include <ossim/support_data/ossimNitfIchipbTag.h>
-#include <ossim/support_data/ossimNitfJ2klraTag.h>
-#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
-#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
-#include <ossim/support_data/ossimNitfMstgtaTag.h>
-#include <ossim/support_data/ossimNitfPiaimcTag.h>
-#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
-#include <ossim/support_data/ossimNitfRpcBTag.h>
-#include <ossim/support_data/ossimNitfRpcATag.h>
-#include <ossim/support_data/ossimNitfSensraTag.h>
-#include <ossim/support_data/ossimNitfStdidcTag.h>
-#include <ossim/support_data/ossimNitfUse00aTag.h>
-#include <ossim/support_data/ossimNitfHistoaTag.h>
-#include <ossim/support_data/ossimNitfCsccgaTag.h>
-#include <ossim/support_data/ossimNitfCsproaTag.h>
-#include <ossim/support_data/ossimNitfExoptaTag.h>
-#include <ossim/support_data/ossimNitfRsmecaTag.h>
-#include <ossim/support_data/ossimNitfRsmidaTag.h>
-#include <ossim/support_data/ossimNitfRsmpcaTag.h>
-#include <ossim/support_data/ossimNitfRsmpiaTag.h>
-
-RTTI_DEF1(ossimNitfRegisteredTagFactory, "ossimNitfRegisteredTagFactory", ossimNitfTagFactory);
-
-static const char ACFTB_TAG[]                = "ACFTB";
-static const char AIMIDB_TAG[]               = "AIMIDB";
-static const char BLOCKA_TAG[]               = "BLOCKA";
-static const char CSCRNA_TAG[]               = "CSCRNA";
-static const char CSDIDA_TAG[]               = "CSDIDA";
-static const char CSEXRA_TAG[]               = "CSEXRA";
-static const char ENGRDA_TAG[]               = "ENGRDA";
-static const char GEO_POSITIONING_TAG[]      = "GEOPSB";
-static const char ICHIPB_TAG[]               = "ICHIPB";
-static const char J2KLRA_TAG[]               = "J2KLRA";
-static const char LOCAL_GEOGRAPHIC_TAG[]     = "GEOLOB";
-static const char LOCAL_CARTOGRAPHIC_TAG[]   = "MAPLOB";
-static const char MSTGTA_TAG[]               = "MSTGTA";
-static const char PIAIMC_TAG[]               = "PIAIMC";
-static const char PROJECTION_PARAMETER_TAG[] = "PRJPSB";
-static const char RPCB_TAG[]                 = "RPC00B";
-static const char RPCA_TAG[]                 = "RPC00A";
-static const char SENSRA_TAG[]               = "SENSRA";
-static const char STDIDC_TAG[]               = "STDIDC";
-static const char USE00A_TAG[]               = "USE00A";
-static const char HISTOA_TAG[]               = "HISTOA";
-static const char CSCCGA_TAG[]               = "CSCCGA";
-static const char CSPROA_TAG[]               = "CSPROA";
-static const char EXOPTA_TAG[]               = "EXOPTA";
-static const char RSMECA_TAG[]               = "RSMECA";
-static const char RSMIDA_TAG[]               = "RSMIDA";
-static const char RSMPCA_TAG[]               = "RSMPCA";
-static const char RSMPIA_TAG[]               = "RSMPIA";
-
-ossimNitfRegisteredTagFactory::ossimNitfRegisteredTagFactory()
-{
-}
-
-ossimNitfRegisteredTagFactory::~ossimNitfRegisteredTagFactory()
-{
-}
-
-ossimNitfRegisteredTagFactory* ossimNitfRegisteredTagFactory::instance()
-{
-   static ossimNitfRegisteredTagFactory inst;
-   return &inst;
-}
-
-ossimRefPtr<ossimNitfRegisteredTag> ossimNitfRegisteredTagFactory::create(
-   const ossimString& tagName)const
-{
-   ossimString name = ossimString(tagName).trim().upcase();
-   
-   if(tagName == ACFTB_TAG)
-   {
-      return new ossimNitfAcftbTag;
-   }
-   else if(tagName == AIMIDB_TAG)
-   {
-      return new ossimNitfAimidbTag;
-   }
-   else if(tagName == BLOCKA_TAG)
-   {
-      return new ossimNitfBlockaTag;
-   }
-   else if(tagName == CSCRNA_TAG)
-   {
-      return new ossimNitfCscrnaTag;
-   }
-   else if(tagName == CSDIDA_TAG)
-   {
-      return new ossimNitfCsdidaTag;
-   }
-   else if(tagName == CSEXRA_TAG)
-   {
-      return new ossimNitfCsexraTag;
-   }
-   else if(tagName == ENGRDA_TAG)
-   {
-      return new ossimNitfEngrdaTag;
-   }
-   else if(tagName == GEO_POSITIONING_TAG)
-   {
-      return new ossimNitfGeoPositioningTag;
-   }
-   else if(tagName == ICHIPB_TAG)
-   {
-      return new ossimNitfIchipbTag;
-   }
-   else if(tagName == J2KLRA_TAG)
-   {
-      return new ossimNitfJ2klraTag;
-   }
-   else if(tagName == LOCAL_GEOGRAPHIC_TAG)
-   {
-      return new ossimNitfLocalGeographicTag;
-   }
-   else if(tagName == LOCAL_CARTOGRAPHIC_TAG)
-   {
-      return new ossimNitfLocalCartographicTag;
-   }
-   else if(tagName == MSTGTA_TAG)
-   {
-      return new ossimNitfMstgtaTag;
-   }
-   else if(tagName == PIAIMC_TAG)
-   {
-      return new ossimNitfPiaimcTag;
-   }
-   else if(tagName == PROJECTION_PARAMETER_TAG)
-   {
-      return new ossimNitfProjectionParameterTag;
-   }
-   else if(tagName == RPCB_TAG)
-   {
-      return new ossimNitfRpcBTag;
-   }
-   else if(tagName == RPCA_TAG)
-   {
-      return new ossimNitfRpcATag;
-   }
-   else if (tagName == SENSRA_TAG)
-   {
-      return new ossimNitfSensraTag;
-   }
-   else if (tagName == STDIDC_TAG)
-   {
-      return new ossimNitfStdidcTag;
-   }
-   else if (tagName == USE00A_TAG)
-   {
-      return new ossimNitfUse00aTag;
-   }
-   else if(tagName == HISTOA_TAG)
-   {
-      return new ossimNitfHistoaTag;
-   }
-   else if(tagName == CSCCGA_TAG)
-   {
-      return new ossimNitfCsccgaTag;
-   }
-   else if(tagName == CSPROA_TAG)
-   {
-      return new ossimNitfCsproaTag;
-   }
-   else if(tagName == EXOPTA_TAG)
-   {
-      return new ossimNitfExoptaTag;
-   }
-   else if(tagName == RSMECA_TAG)
-   {
-      return new ossimNitfRsmecaTag();
-   }
-   else if(tagName == RSMIDA_TAG)
-   {
-      return new ossimNitfRsmidaTag();
-   }
-   else if(tagName == RSMPCA_TAG)
-   {
-      return new ossimNitfRsmpcaTag();
-   }
-   else if(tagName == RSMPIA_TAG)
-   {
-      return new ossimNitfRsmpiaTag();
-   }
-   return NULL;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfRpcATag.cpp b/ossim/src/ossim/support_data/ossimNitfRpcATag.cpp
deleted file mode 100644
index 90170cd..0000000
--- a/ossim/src/ossim/support_data/ossimNitfRpcATag.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-//
-// Description: Nitf support class for RPC00A -
-// Rational Polynomial Coefficient extension.
-//
-//********************************************************************
-// $Id: ossimNitfRpcATag.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <ossim/support_data/ossimNitfRpcATag.h>
-
-RTTI_DEF1(ossimNitfRpcATag, "ossimNitfRpcATag", ossimNitfRpcBase);
-
-ossimNitfRpcATag::ossimNitfRpcATag()
-   : ossimNitfRpcBase()
-{
-   // Set the tag name in base.
-   setTagName(std::string("RPC00A"));
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfRpcBTag.cpp b/ossim/src/ossim/support_data/ossimNitfRpcBTag.cpp
deleted file mode 100644
index bb0f06a..0000000
--- a/ossim/src/ossim/support_data/ossimNitfRpcBTag.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRpcBTag.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <ossim/support_data/ossimNitfRpcBTag.h>
-
-RTTI_DEF1(ossimNitfRpcBTag, "ossimNitfRpcBTag", ossimNitfRpcBase);
-
-ossimNitfRpcBTag::ossimNitfRpcBTag()
-   : ossimNitfRpcBase()
-{
-   // Set the tag name in base.
-   setTagName(std::string("RPC00B"));
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfRpcBase.cpp b/ossim/src/ossim/support_data/ossimNitfRpcBase.cpp
deleted file mode 100644
index 43e5998..0000000
--- a/ossim/src/ossim/support_data/ossimNitfRpcBase.cpp
+++ /dev/null
@@ -1,929 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-// Description: Nitf support class for RPC00A -
-// Rational Polynomial Coefficient extension.
-//
-//********************************************************************
-// $Id: ossimNitfRpcBase.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <algorithm>
-#include <iostream>
-#include <iomanip>
-#include <vector>
-#include <ossim/support_data/ossimNitfRpcBase.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/base/ossimNotifyContext.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimStringProperty.h>
-
-static const ossimTrace traceDebug(ossimString("ossimNitfRpcBase:debug"));
-static const ossimString ERR_BIAS_KW = "ERR_BIAS";
-static const ossimString ERR_RAND_KW = "ERR_RAND";
-static const ossimString LINE_OFF_KW = "LINE_OFF";
-static const ossimString SAMP_OFF_KW = "SAMP_OFF";
-static const ossimString LAT_OFF_KW = "LAT_OFF";
-static const ossimString LONG_OFF_KW = "LONG_OFF";
-static const ossimString HEIGHT_OFF_KW = "HEIGHT_OFF";
-static const ossimString LINE_SCALE_KW = "LINE_SCALE";
-static const ossimString SAMP_SCALE_KW = "SAMP_SCALE";
-static const ossimString LAT_SCALE_KW = "LAT_SCALE";
-static const ossimString LONG_SCALE_KW = "LONG_SCALE";
-static const ossimString HEIGHT_SCALE_KW = "HEIGHT_SCALE";
-static const ossimString LINE_NUM_COEFF_KW = "LINE_NUM_COEFF_";
-static const ossimString LINE_DEN_COEFF_KW = "LINE_DEN_COEFF_";
-static const ossimString SAMP_NUM_COEFF_KW = "SAMP_NUM_COEFF_";
-static const ossimString SAMP_DEN_COEFF_KW = "SAMP_DEN_COEFF_";
-
-RTTI_DEF1(ossimNitfRpcBase, "ossimNitfRpcBase", ossimNitfRegisteredTag);
-
-
-ossimNitfRpcBase::ossimNitfRpcBase()
-   : ossimNitfRegisteredTag()
-{
-   // Set the tag length in base.
-   setTagLength(1041);
-   
-   clearFields();
-}
-
-void ossimNitfRpcBase::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theSuccess, SUCCESS_SIZE);
-   in.read(theErrorBias, ERROR_BIAS_SIZE);
-   in.read(theErrRand, ERR_RAND_SIZE);
-   in.read(theLineOffset, LINE_OFFSET_SIZE);
-   in.read(theSampleOffset, SAMPLE_OFFSET_SIZE);
-   in.read(theGeodeticLatOffset, GEODETIC_LAT_OFFSET_SIZE);
-   in.read(theGeodeticLonOffset, GEODETIC_LON_OFFSET_SIZE);
-   in.read(theGeodeticHeightOffset, GEODETIC_HEIGHT_OFFSET_SIZE);
-   in.read(theLineScale, LINE_SCALE_SIZE);
-   in.read(theSampleScale, SAMPLE_SCALE_SIZE);
-   in.read(theGeodeticLatScale, GEODETIC_LAT_SCALE_SIZE);
-   in.read(theGeodeticLonScale, GEODETIC_LON_SCALE_SIZE);
-   in.read(theGeodeticHeightScale, GEODETIC_HEIGHT_SCALE_SIZE);
-   
-   ossim_uint32 idx = 0;
-   
-   char temp1[LINE_NUMERATOR_COEFFICIENT_SIZE+1];
-   temp1[LINE_NUMERATOR_COEFFICIENT_SIZE] = '\0';
-   for(idx = 0; idx < LINE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      in.read(temp1, LINE_NUMERATOR_COEFFICIENT_SIZE);
-      theLineNumeratorCoefficient[idx] = temp1;
-   }
-   
-   char temp2[LINE_DENOMINATOR_COEFFICIENT_SIZE+1];
-   temp2[LINE_DENOMINATOR_COEFFICIENT_SIZE] = '\0';
-   for(idx = 0; idx < LINE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      in.read(temp2, LINE_DENOMINATOR_COEFFICIENT_SIZE);
-      theLineDenominatorCoefficient[idx] = temp2;
-   }
-   
-   char temp3[SAMPLE_NUMERATOR_COEFFICIENT_SIZE+1];
-   temp3[SAMPLE_NUMERATOR_COEFFICIENT_SIZE] = '\0';
-   for(idx = 0; idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      in.read(temp3, SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
-      theSampleNumeratorCoefficient[idx] = temp3;
-   }
-   
-   char temp4[SAMPLE_DENOMINATOR_COEFFICIENT_SIZE+1];
-   temp4[SAMPLE_DENOMINATOR_COEFFICIENT_SIZE] = '\0';
-   for(idx = 0; idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      in.read(temp4, SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
-      theSampleDenominatorCoefficient[idx] = temp4;
-   }
-}
-
-void ossimNitfRpcBase::writeStream(std::ostream& out)
-{
-   ossim_uint32 idx = 0;
-   
-   out.write(theSuccess, SUCCESS_SIZE);
-   out.write(theErrorBias, ERROR_BIAS_SIZE);
-   out.write(theErrRand, ERR_RAND_SIZE);
-   out.write(theLineOffset, LINE_OFFSET_SIZE);
-   out.write(theSampleOffset, SAMPLE_OFFSET_SIZE);
-   out.write(theGeodeticLatOffset, GEODETIC_LAT_OFFSET_SIZE);
-   out.write(theGeodeticLonOffset, GEODETIC_LON_OFFSET_SIZE);
-   out.write(theGeodeticHeightOffset, GEODETIC_HEIGHT_OFFSET_SIZE);
-   out.write(theLineScale, LINE_SCALE_SIZE);
-   out.write(theSampleScale, SAMPLE_SCALE_SIZE);
-   out.write(theGeodeticLatScale, GEODETIC_LAT_SCALE_SIZE);
-   out.write(theGeodeticLonScale, GEODETIC_LON_SCALE_SIZE);
-   out.write(theGeodeticHeightScale, GEODETIC_HEIGHT_SCALE_SIZE);
-   for(idx = 0; idx < LINE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      out.write(theLineNumeratorCoefficient[idx].c_str(),
-                LINE_NUMERATOR_COEFFICIENT_SIZE);
-   }
-   for(idx = 0; idx < LINE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      out.write(theLineDenominatorCoefficient[idx].c_str(),
-                LINE_DENOMINATOR_COEFFICIENT_SIZE);
-   }
-   for(idx = 0; idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      out.write(theSampleNumeratorCoefficient[idx].c_str(),
-                SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
-   }
-   for(idx = 0; idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
-   {
-      out.write(theSampleDenominatorCoefficient[idx].c_str(),
-                SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
-   }
-}
-
-void ossimNitfRpcBase::clearFields()
-{
-   theSuccess[0] = '1';
-   memcpy(theErrorBias, "0000.00", 7);
-   memcpy(theErrRand, "0000.00", 7);
-   memcpy(theLineOffset, "000000", 6);
-   memcpy(theSampleOffset, "00000", 5);
-   memcpy(theGeodeticLatOffset, "+00.0000", 8);
-   memcpy(theGeodeticLonOffset, "+000.0000", 9);
-   memcpy(theGeodeticHeightOffset, "+0000", 5);
-   memcpy(theLineScale, "000001", 6);
-   memcpy(theSampleScale, "00001", 5);
-   memcpy(theGeodeticLatScale, "+00.0000", 8);
-   memcpy(theGeodeticLonScale, "+000.0000", 9);
-   memcpy(theGeodeticHeightScale, "+0000", 5);
-   
-   theSuccess[1] = '\0';
-   theErrorBias[7] = '\0';
-   theErrRand[7] = '\0';
-   theLineOffset[6] = '\0';
-   theSampleOffset[5] = '\0';
-   theGeodeticLatOffset[8]='\0';
-   theGeodeticLonOffset[9]='\0';
-   theGeodeticHeightOffset[5]='\0';
-   theLineScale[6]='\0';
-   theSampleScale[5]='\0';
-   theGeodeticLatScale[8]='\0';
-   theGeodeticLonScale[9]='\0';
-   theGeodeticHeightScale[5]='\0';
-   
-   theLineNumeratorCoefficient.resize(20);
-   theLineDenominatorCoefficient.resize(20);
-   theSampleNumeratorCoefficient.resize(20);
-   theSampleDenominatorCoefficient.resize(20);
-   ossim_uint32 idx = 0;
-   const char* zeroString = "+0.000000E+0";
-   
-   for(idx = 0; idx < theLineNumeratorCoefficient.size();++idx)
-   {
-      theLineNumeratorCoefficient[idx] = zeroString; 
-      theLineDenominatorCoefficient[idx] = zeroString;;
-      theSampleNumeratorCoefficient[idx] = zeroString;;
-      theSampleDenominatorCoefficient[idx] = zeroString;;
-   }
-}
-
-bool ossimNitfRpcBase::getSuccess()const
-{
-   return (theSuccess[0] == '1');
-}
-
-void ossimNitfRpcBase::setSuccess(bool success)
-{
-   theSuccess[0] = success?'1':'0';
-}
-
-ossimString ossimNitfRpcBase::getErrorBias()const
-{
-   return theErrorBias;
-}
-
-void ossimNitfRpcBase::setErrorBias(const ossim_float64& errorBias)
-{
-   ossimString os = ossimNitfCommon::convertToDoubleString(errorBias,
-                                                           2,
-                                                           ERROR_BIAS_SIZE);
-   setErrorBias(os);
-}
-
-void ossimNitfRpcBase::setErrorBias(const ossimString& errorBias)
-{
-   memset(theErrorBias, ' ', ERROR_BIAS_SIZE);
-   memcpy(theErrorBias, errorBias.c_str(), std::min((size_t)ERROR_BIAS_SIZE, errorBias.length()));
-}
-
-ossimString ossimNitfRpcBase::getErrorRand()const
-{
-   return theErrRand;
-}
-
-void ossimNitfRpcBase::setErrorRand(const ossim_float64& errorRand)
-{
-   ossimString os = ossimNitfCommon::convertToDoubleString(errorRand,
-                                                           2,
-                                                           ERROR_BIAS_SIZE);
-   setErrorRand(os);
-}
-
-void ossimNitfRpcBase::setErrorRand(const ossimString& errorRand)
-{
-   memset(theErrRand, ' ', ERR_RAND_SIZE);
-   memcpy(theErrRand, errorRand.c_str(), std::min((size_t)ERR_RAND_SIZE, errorRand.length()));
-}
-
-ossimString ossimNitfRpcBase::getLineOffset()const
-{
-   return theLineOffset;
-}
-
-void ossimNitfRpcBase::setLineOffset(ossim_uint32 lineOffset)
-{
-   ossimString os = ossimNitfCommon::convertToUIntString(lineOffset,
-                                                         LINE_OFFSET_SIZE);
-   setLineOffset(os);
-}
-
-void ossimNitfRpcBase::setLineOffset(const ossimString& lineOffset)
-{
-   memset(theLineOffset, ' ', LINE_OFFSET_SIZE);
-   memcpy(theLineOffset, lineOffset.c_str(), std::min((size_t)LINE_OFFSET_SIZE, lineOffset.length()));
-}
-
-ossimString ossimNitfRpcBase::getSampleOffset()const
-{
-   return theSampleOffset;
-}
-
-void ossimNitfRpcBase::setSampleOffset(ossim_uint32 sampleOffset)
-{
-   ossimString os = ossimNitfCommon::convertToUIntString(sampleOffset,
-                                                         SAMPLE_OFFSET_SIZE);
-   setSampleOffset(os);
-}
-
-void ossimNitfRpcBase::setSampleOffset(const ossimString& sampleOffset)
-{
-   memset(theSampleOffset, ' ', SAMPLE_OFFSET_SIZE);
-   memcpy(theSampleOffset, sampleOffset.c_str(), std::min((size_t)SAMPLE_OFFSET_SIZE, sampleOffset.length()));
-}
-
-ossimString ossimNitfRpcBase::getGeodeticLatOffset()const
-{
-   return theGeodeticLatOffset;
-}
-
-void ossimNitfRpcBase::setGeodeticLatOffset(
-   const ossim_float64& geodeticLatOffset)
-{
-   if ( (geodeticLatOffset >= -90.0) && (geodeticLatOffset <= 90.0) )
-   {
-      ossimString os =
-         ossimNitfCommon::convertToDoubleString(geodeticLatOffset,
-                                                4,
-                                                GEODETIC_LAT_OFFSET_SIZE);
-      setGeodeticLatOffset(os);
-   }
-}
-
-void ossimNitfRpcBase::setGeodeticLatOffset(
-   const ossimString& geodeticLatOffset)
-{
-   memset(theGeodeticLatOffset, ' ', GEODETIC_LAT_OFFSET_SIZE);
-   memcpy(theGeodeticLatOffset, geodeticLatOffset.c_str(), std::min((size_t)GEODETIC_LAT_OFFSET_SIZE, geodeticLatOffset.length()));
-}
-
-ossimString ossimNitfRpcBase::getGeodeticLonOffset()const
-{
-   return theGeodeticLonOffset;
-}
-
-void ossimNitfRpcBase::setGeodeticLonOffset(
-   const ossim_float64& geodeticLonOffset)
-{
-   if ( (geodeticLonOffset >= -180.0) && (geodeticLonOffset <= 180.0) )
-   {
-      ossimString os =
-         ossimNitfCommon::convertToDoubleString(geodeticLonOffset,
-                                                4,
-                                                GEODETIC_LON_OFFSET_SIZE);
-      setGeodeticLonOffset(os);
-   }
-}
-
-void ossimNitfRpcBase::setGeodeticLonOffset(const ossimString& geodeticLonOffset)
-{
-   memset(theGeodeticLonOffset, ' ', GEODETIC_LON_OFFSET_SIZE);
-   memcpy(theGeodeticLonOffset, geodeticLonOffset.c_str(), std::min((size_t)GEODETIC_LON_OFFSET_SIZE, geodeticLonOffset.length()));
-}
-
-ossimString ossimNitfRpcBase::getGeodeticHeightOffset()const
-{
-   return theGeodeticHeightOffset;
-}
-
-void ossimNitfRpcBase::setGeodeticHeightOffset(
-   ossim_int32 geodeticHeightOffset)
-{
-   ossimString os =
-      ossimNitfCommon::convertToIntString(geodeticHeightOffset,
-                                          GEODETIC_HEIGHT_OFFSET_SIZE);
-   setGeodeticHeightOffset(os);
-}
-
-void ossimNitfRpcBase::setGeodeticHeightOffset(const ossimString& geodeticHeightOffset)
-{
-   memset(theGeodeticHeightOffset, ' ', GEODETIC_HEIGHT_OFFSET_SIZE);
-   memcpy(theGeodeticHeightOffset, geodeticHeightOffset.c_str(), std::min((size_t)GEODETIC_HEIGHT_OFFSET_SIZE, geodeticHeightOffset.length()));
-}
-
-ossimString ossimNitfRpcBase::getLineScale()const
-{
-   return theLineScale;
-}
-
-void ossimNitfRpcBase::setLineScale(ossim_uint32 lineScale)
-{
-   ossimString os = ossimNitfCommon::convertToUIntString(lineScale,
-                                                         LINE_SCALE_SIZE);
-   setLineScale(os);
-}
-
-void ossimNitfRpcBase::setLineScale(const ossimString& lineScale)
-{
-   memset(theLineScale, ' ', LINE_SCALE_SIZE);
-   memcpy(theLineScale, lineScale.c_str(), std::min((size_t)LINE_SCALE_SIZE, lineScale.length()));
-}
-
-ossimString ossimNitfRpcBase::getSampleScale()const
-{
-   return theSampleScale;
-}
-
-void ossimNitfRpcBase::setSampleScale(ossim_uint32 sampleScale)
-{
-   ossimString os = ossimNitfCommon::convertToUIntString(sampleScale,
-                                       SAMPLE_SCALE_SIZE);
-   setSampleScale(os);
-}
-
-void ossimNitfRpcBase::setSampleScale(const ossimString& sampleScale)
-{
-   memset(theSampleScale, ' ', SAMPLE_SCALE_SIZE);
-   memcpy(theSampleScale, sampleScale.c_str(), std::min((size_t)SAMPLE_SCALE_SIZE, sampleScale.length()));
-}
-
-ossimString ossimNitfRpcBase::getGeodeticLatScale()const
-{
-   return theGeodeticLatScale;
-}
-
-void ossimNitfRpcBase::setGeodeticLatScale(
-   const ossim_float64& geodeticLatScale)
-{
-   if (geodeticLatScale == 0.0)
-   {
-      // Error scale cannot be zero.
-      return;
-   }
-   
-   if ( (geodeticLatScale >= -90.0) && (geodeticLatScale <= 90.0) )
-   {
-      ossimString os = ossimNitfCommon::convertToDoubleString(geodeticLatScale,
-                                             4,
-                                             GEODETIC_LAT_SCALE_SIZE);
-      setGeodeticLatScale(os);
-   }
-}
-
-void ossimNitfRpcBase::setGeodeticLatScale(const ossimString& geodeticLatScale)
-{
-   memset(theGeodeticLatScale, ' ', GEODETIC_LAT_SCALE_SIZE);
-   memcpy(theGeodeticLatScale, geodeticLatScale.c_str(), std::min((size_t)GEODETIC_LAT_SCALE_SIZE, geodeticLatScale.length()));
-}
-
-ossimString ossimNitfRpcBase::getGeodeticLonScale()const
-{
-   return theGeodeticLonScale;
-}
-
-void ossimNitfRpcBase::setGeodeticLonScale(
-   const ossim_float64& geodeticLonScale)
-{
-   if (geodeticLonScale == 0.0)
-   {
-      // Error scale cannot be zero.
-      return;
-   }
-   
-   if ( (geodeticLonScale >= -180.0) && (geodeticLonScale <= 180.0) )
-   {
-      ossimString os = ossimNitfCommon::convertToDoubleString(geodeticLonScale,
-                                             4,
-                                             GEODETIC_LON_SCALE_SIZE);
-      setGeodeticLonScale(os);
-   }
-}
-
-void ossimNitfRpcBase::setGeodeticLonScale(const ossimString& geodeticLonScale)
-{
-   memset(theGeodeticLonScale, ' ', GEODETIC_LON_SCALE_SIZE);
-   memcpy(theGeodeticLonScale, geodeticLonScale.c_str(), std::min((size_t)GEODETIC_LON_SCALE_SIZE, geodeticLonScale.length()));
-}
-
-ossimString ossimNitfRpcBase::getGeodeticHeightScale()const
-{
-   return theGeodeticHeightScale;
-}
-
-void ossimNitfRpcBase::setGeodeticHeightScale(ossim_int32 geodeticHeightScale)
-{
-   ossimString os =
-      ossimNitfCommon::convertToIntString(geodeticHeightScale,
-                                          GEODETIC_HEIGHT_SCALE_SIZE);
-   setGeodeticHeightScale(os);
-}
-
-void ossimNitfRpcBase::setGeodeticHeightScale(
-   const ossimString& geodeticHeightScale)
-{
-   memset(theGeodeticHeightScale, ' ', GEODETIC_HEIGHT_SCALE_SIZE);
-   memcpy(theGeodeticHeightScale, geodeticHeightScale.c_str(), std::min((size_t)GEODETIC_HEIGHT_SCALE_SIZE, geodeticHeightScale.length()));
-}
-
-/* Temp comment out until range error handling is decided.*/
-#if 0
-// The assert here will be ignored when compiled with -DNDEBUG so ossimSetError and fix the index
-#define ASSERT_ARRAY_CONSTRAINT(expression, idx, correctedValue, module) \
-   assert(expression);                                                  \
-   ossimSetError(getClassName().c_str(), ossimErrorCodes::OSSIM_ERROR,  \
-                 "File %s line %d Module %s Error:\nArray index constraint error.\n", \
-                 __FILE__, __LINE__, module);                           \
-   if (! (expression) ) idx = correctedValue;
-
-#endif
-   
-ossimString ossimNitfRpcBase::getLineNumeratorCoeff(ossim_uint32 idx)const
-{
-//ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getLineNumeratorCoeff");
-
-   if (idx >= LINE_NUMERATOR_COEFFICIENT_COUNT)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimNitfRpcBase::getLineNumeratorCoeff range error!"
-            << std::endl;
-      }
-      return ossimString();
-   }
-   
-   return theLineNumeratorCoefficient[idx];
-}
-
-void ossimNitfRpcBase::setLineNumeratorCoeff(
-   const std::vector<ossim_float64>& coeff)
-{
-   if (coeff.size() != LINE_NUMERATOR_COEFFICIENT_COUNT)
-   {
-      // Error...
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcBase::setLineNumeratorCoeff WARNING:"
-            << "\nArray not of correct size!"
-            << std::endl;
-      }
-      return;
-   }
-
-   for (ossim_uint32 i = 0; i < LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
-   {
-      ossimString os = ossimNitfCommon::convertToScientificString(
-         coeff[i], LINE_NUMERATOR_COEFFICIENT_SIZE);
-      setLineNumeratorCoeff(i, os);
-   }
-}
-
-void ossimNitfRpcBase::setLineNumeratorCoeff(ossim_uint32 idx,
-                                             const ossimString& coeff)
-{
-   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setLineNumeratorCoeff");
-
-   if (idx >= LINE_NUMERATOR_COEFFICIENT_COUNT)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfRpcBase::setLineNumeratorCoeff range error!"
-         << std::endl;
-      return;
-   } 
-
-   std::string s(coeff, 0, LINE_NUMERATOR_COEFFICIENT_SIZE);
-   theLineNumeratorCoefficient[idx] = s;  
-}
-
-ossimString ossimNitfRpcBase::getLineDenominatorCoeff(ossim_uint32 idx)const
-{
-   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getLineDenominatorCoeff");
-
-   if (idx >= LINE_DENOMINATOR_COEFFICIENT_COUNT)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfRpcBase::getLineDenominatorCoeff range error!"
-         << std::endl;
-      return ossimString();
-   }  
-   
-   return theLineDenominatorCoefficient[idx];
-}
-
-void ossimNitfRpcBase::setLineDenominatorCoeff(
-   const std::vector<ossim_float64>& coeff)
-{
-   if (coeff.size() != LINE_DENOMINATOR_COEFFICIENT_COUNT)
-   {
-      // Error...
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcBase::setLineDenominatorCoeff WARNING:"
-            << "\nArray not of correct size!"
-            << std::endl;
-      }
-      return;
-   }
-
-   for (ossim_uint32 i = 0; i < LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
-   {
-      ossimString os = ossimNitfCommon::convertToScientificString(
-         coeff[i], LINE_DENOMINATOR_COEFFICIENT_SIZE);
-      setLineDenominatorCoeff(i, os);
-   }
-}
-
-void ossimNitfRpcBase::setLineDenominatorCoeff(ossim_uint32 idx,
-                                               const ossimString& coeff)
-{
-   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setLineDenominatorCoeff");
-
-   if (idx >= LINE_DENOMINATOR_COEFFICIENT_COUNT)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfRpcBase::setLineDenominatorCoeff range error!"
-         << std::endl;
-      return;
-   } 
-   
-   std::string s(coeff, 0, LINE_DENOMINATOR_COEFFICIENT_SIZE);
-   theLineDenominatorCoefficient[idx] = s;  
-}
-
-ossimString ossimNitfRpcBase::getSampleNumeratorCoeff(ossim_uint32 idx)const
-{
-   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getSampleNumeratorCoeff");
-
-   if (idx >= SAMPLE_NUMERATOR_COEFFICIENT_COUNT)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfRpcBase::getSampleNumeratorCoeff range error!"
-         << std::endl;
-      return ossimString();
-   } 
-   return theSampleNumeratorCoefficient[idx];
-}
-
-void ossimNitfRpcBase::setSampleNumeratorCoeff(
-   const std::vector<ossim_float64>& coeff)
-{
-   if (coeff.size() != SAMPLE_NUMERATOR_COEFFICIENT_COUNT)
-   {
-      // Error...
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcBase::setSampleNumeratorCoeff WARNING:"
-            << "\nArray not of correct size!"
-            << std::endl;
-      }
-      return;
-   }
-
-   for (ossim_uint32 i = 0; i < SAMPLE_NUMERATOR_COEFFICIENT_COUNT; ++i)
-   {
-      ossimString os = ossimNitfCommon::convertToScientificString(
-         coeff[i], SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
-      setSampleNumeratorCoeff(i, os);
-   }
-}
-
-void ossimNitfRpcBase::setSampleNumeratorCoeff(ossim_uint32 idx,
-                                               const ossimString& coeff)
-{
-   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setSampleNumeratorCoeff");
-
-   if (idx >= SAMPLE_NUMERATOR_COEFFICIENT_COUNT)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfRpcBase::setSampleNumeratorCoeff range error!"
-         << std::endl;
-      return;
-   } 
-   
-   std::string s(coeff, 0, SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
-   theSampleNumeratorCoefficient[idx] = s;  
-}
-
-ossimString ossimNitfRpcBase::getSampleDenominatorCoeff(ossim_uint32 idx)const
-{
-   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getSampleDenominatorCoeff");
-
-   if (idx >= SAMPLE_DENOMINATOR_COEFFICIENT_COUNT)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfRpcBase::getSampleDenominatorCoeff range error!"
-         << std::endl;
-      return ossimString();
-   } 
-   
-   return theSampleDenominatorCoefficient[idx];
-}
-
-void ossimNitfRpcBase::setSampleDenominatorCoeff(
-   const std::vector<ossim_float64>& coeff)
-{
-   if (coeff.size() != SAMPLE_DENOMINATOR_COEFFICIENT_COUNT)
-   {
-      // Error...
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimNitfRpcBase::setSampleDenominatorCoeff WARNING:"
-            << "\nArray not of correct size!"
-            << std::endl;
-      }
-      return;
-   }
-
-   for (ossim_uint32 i = 0; i < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
-   {
-      ossimString os = ossimNitfCommon::convertToScientificString(
-         coeff[i], SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
-      setSampleDenominatorCoeff(i, os);
-   }
-}
-
-void ossimNitfRpcBase::setSampleDenominatorCoeff(
-   ossim_uint32 idx, const ossimString& coeff)
-{
-   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setSampleDenominatorCoeff");
-
-   if (idx >= SAMPLE_DENOMINATOR_COEFFICIENT_COUNT)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossimNitfRpcBase::setSampleDenominatorCoeff range error!"
-         << std::endl;
-      return;
-   }
-   
-  std::string s(coeff, 0, SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
-  s.resize(SAMPLE_DENOMINATOR_COEFFICIENT_SIZE, ' ');
-  theSampleDenominatorCoefficient[idx] = s;  
-}
-
-std::ostream& ossimNitfRpcBase::print(std::ostream& out,
-                                      const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"
-       << getSizeInBytes() << "\n"
-       << pfx << std::setw(24) << "SUCCESS:"
-       << theSuccess << "\n" 
-       << pfx << std::setw(24) << "ERR_BIAS:"
-       << theErrorBias << "\n"
-       << pfx << std::setw(24) << "ERR_RAND:"
-       <<theErrRand  << "\n" 
-       << pfx << std::setw(24) << "LINE_OFF:"
-       << theLineOffset << "\n"
-       << pfx << std::setw(24) << "SAMP_OFF:"
-       << theSampleOffset << "\n" 
-       << pfx << std::setw(24) << "LAT_OFF:"
-       << theGeodeticLatOffset << "\n"
-       << pfx << std::setw(24) << "LONG_OFF:"
-       << theGeodeticLonOffset << "\n" 
-       << pfx << std::setw(24) << "HEIGHT_OFF:"
-       << theGeodeticHeightOffset << "\n"
-       << pfx << std::setw(24) << "LINE_SCALE:"
-       << theLineScale  << "\n" 
-       << pfx << std::setw(24)
-       << "SAMP_SCALE:" << theSampleScale << "\n"
-       << pfx << std::setw(24) << "LAT_SCALE:"
-       << theGeodeticLatScale << "\n" 
-       << pfx << std::setw(24) << "LONG_SCALE:"
-       << theGeodeticLonScale << "\n"
-       << pfx << std::setw(24) << "HEIGHT_SCALE:"
-       << theGeodeticHeightScale << "\n";
-
-   ossim_int32 i;
-   ossimString s;
-   
-   for (i=0; i<LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
-   {
-      s = "LINE_NUM_COEFF_";
-      s += ossimString::toString(i);
-      s += ":";
-      out << pfx << std::setw(24) << s
-          << theLineNumeratorCoefficient[i] << "\n";
-   }
-
-   for (i=0; i<LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
-   {
-      s = "LINE_DEN_COEFF_";
-      s += ossimString::toString(i);
-      s += ":";
-      out << pfx << std::setw(24) << s
-          << theLineDenominatorCoefficient[i] << "\n";
-   }
-
-   for (i=0; i<LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
-   {
-      s = "SAMP_NUM_COEFF_";
-      s += ossimString::toString(i);
-      s += ":";
-      out << pfx << std::setw(24) << s
-          << theSampleNumeratorCoefficient[i] << "\n";
-   }
-
-   for (i=0; i<LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
-   {
-      s = "SAMP_DEN_COEFF_";
-      s += ossimString::toString(i);
-      s += ":";
-      out << pfx << std::setw(24) << s
-          << theSampleDenominatorCoefficient[i] << "\n";
-   }
-
-   out.flush();
-   
-   return out;
-}
-
-void ossimNitfRpcBase::setProperty(ossimRefPtr<ossimProperty> /* property */)
-{
-   
-}
-
-ossimRefPtr<ossimProperty> ossimNitfRpcBase::getProperty(const ossimString& name)const
-{
-   ossimProperty* result = 0;
-   if(name == ERR_BIAS_KW)
-   {
-      result = new ossimStringProperty(name, theErrorBias);
-   }
-   else if(name == ERR_RAND_KW)
-   {
-      result = new ossimStringProperty(name, theErrRand);
-   }
-   else if(name == LINE_OFF_KW)
-   {
-      result = new ossimStringProperty(name, theLineOffset);
-   }
-   else if(name == SAMP_OFF_KW)
-   {
-      result = new ossimStringProperty(name, theSampleOffset);
-   }
-   else if(name == LAT_OFF_KW)
-   {
-      result = new ossimStringProperty(name, theGeodeticLatOffset);
-   }
-   else if(name == LONG_OFF_KW)
-   {
-      result = new ossimStringProperty(name, theGeodeticLonOffset);
-   }
-   else if(name == HEIGHT_OFF_KW)
-   {
-      result = new ossimStringProperty(name, theGeodeticHeightOffset);
-   }
-   else if(name == LINE_SCALE_KW)
-   {
-      result = new ossimStringProperty(name, theLineScale);
-   }
-   else if(name == SAMP_SCALE_KW)
-   {
-      result = new ossimStringProperty(name,theSampleScale );
-   }
-   else if(name == LAT_SCALE_KW)
-   {
-      result = new ossimStringProperty(name, theGeodeticLatScale);
-   }
-   else if(name == LONG_SCALE_KW)
-   {
-      result = new ossimStringProperty(name, theGeodeticLonScale);
-   }
-   else if(name == HEIGHT_SCALE_KW)
-   {
-      result = new ossimStringProperty(name, theGeodeticHeightScale);
-   }
-   else if(name.contains(LINE_NUM_COEFF_KW))
-   {
-      ossim_uint32 idx = 0;
-
-         idx = ossimString(name.begin()+LINE_NUM_COEFF_KW.length(),
-                           name.end()).toUInt32();
-      --idx;
-
-      if(idx < theLineNumeratorCoefficient.size())
-      {
-         result = new ossimStringProperty(name, theLineNumeratorCoefficient[idx]);
-      }
-   }
-   else if(name.contains(LINE_DEN_COEFF_KW))
-   {
-      ossim_uint32 idx = 0;
-
-      idx = ossimString(name.begin()+LINE_DEN_COEFF_KW.length(),
-                        name.end()).toUInt32();
-      --idx;
-
-      if(idx < theLineDenominatorCoefficient.size())
-      {
-         result = new ossimStringProperty(name, theLineDenominatorCoefficient[idx]);
-      }
-   }
-   else if(name.contains(SAMP_NUM_COEFF_KW))
-   {
-      ossim_uint32 idx = 0;
-
-      idx = ossimString(name.begin()+SAMP_NUM_COEFF_KW.length(),
-                        name.end()).toUInt32(); 
-      --idx;
-
-      if(idx < theSampleNumeratorCoefficient.size())
-      {
-         result = new ossimStringProperty(name, theSampleNumeratorCoefficient[idx]);
-      }
-   }
-   else if(name.contains(SAMP_DEN_COEFF_KW))
-   {
-      ossim_uint32 idx = 0;
-
-      idx = ossimString(name.begin()+SAMP_DEN_COEFF_KW.length(),
-                        name.end()).toUInt32();
-      --idx;
-
-      if(idx < theSampleDenominatorCoefficient.size())
-      {
-         result = new ossimStringProperty(name, theSampleDenominatorCoefficient[idx]);
-      }
-   }
-
-   return result;
-}
-
-void ossimNitfRpcBase::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossim_uint32 idx = 0;
-   
-   propertyNames.push_back(ERR_BIAS_KW);
-   propertyNames.push_back(ERR_RAND_KW);
-   propertyNames.push_back(LINE_OFF_KW);
-   propertyNames.push_back(SAMP_OFF_KW);
-   propertyNames.push_back(LAT_OFF_KW);
-   propertyNames.push_back(LONG_OFF_KW);
-   propertyNames.push_back(HEIGHT_OFF_KW);
-   propertyNames.push_back(LINE_SCALE_KW);
-   propertyNames.push_back(SAMP_SCALE_KW);
-   propertyNames.push_back(LAT_SCALE_KW);
-   propertyNames.push_back(LONG_SCALE_KW);
-   propertyNames.push_back(HEIGHT_SCALE_KW);
-
-   for(idx = 1; idx <= 20; ++idx)
-   {
-      propertyNames.push_back(LINE_NUM_COEFF_KW+ossimString::toString(idx));
-   }
-   for(idx = 1; idx <= 20; ++idx)
-   {
-      propertyNames.push_back(LINE_DEN_COEFF_KW+ossimString::toString(idx));
-   }
-   for(idx = 1; idx <= 20; ++idx)
-   {
-      propertyNames.push_back(SAMP_NUM_COEFF_KW+ossimString::toString(idx));
-   }
-   for(idx = 1; idx <= 20; ++idx)
-   {
-      propertyNames.push_back(SAMP_DEN_COEFF_KW+ossimString::toString(idx));
-   }
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfRpfTagFactory.cpp b/ossim/src/ossim/support_data/ossimNitfRpfTagFactory.cpp
deleted file mode 100644
index d9d4651..0000000
--- a/ossim/src/ossim/support_data/ossimNitfRpfTagFactory.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT  see top level LICENSE.txt
-// 
-// Author: Garrett Potts
-// 
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfRpfTagFactory.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-#include <ossim/support_data/ossimNitfRpfTagFactory.h>
-#include <ossim/support_data/ossimRpfHeader.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-
-RTTI_DEF1(ossimNitfRpfTagFactory, "ossimNitfRpfTagFactory", ossimNitfTagFactory);
-
-static const ossimString REGISTERED_RPF_HEADER_TAG = "RPFHDR";
-static const ossimString REGISTERED_RPF_DES_TAG    = "RPFDES";
-
-static ossimTrace traceDebug = ossimTrace("ossimNitfRpfTagFactory:debug");
-
-ossimNitfRpfTagFactory::ossimNitfRpfTagFactory()
-{
-}
-
-ossimNitfRpfTagFactory::~ossimNitfRpfTagFactory()
-{
-}
-
-ossimNitfRpfTagFactory* ossimNitfRpfTagFactory::instance()
-{
-   static ossimNitfRpfTagFactory inst;
-   return &inst;
-}
-
-ossimRefPtr<ossimNitfRegisteredTag> ossimNitfRpfTagFactory::create(const ossimString &tagName)const
-{
-   ossimString temp(ossimString(tagName).trim().upcase());
-   
-   if(temp == REGISTERED_RPF_HEADER_TAG)
-   {
-      return new ossimRpfHeader;
-   }
-   if(temp == REGISTERED_RPF_DES_TAG)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "WARNING  ossimNitfRpfTagFactory::create: Reader for REGISTERED_RPF_DES_TAG not implemented yet" << std::endl;
-      }
-   }
-   
-   return 0;
-}
diff --git a/ossim/src/ossim/support_data/ossimNitfSensraTag.cpp b/ossim/src/ossim/support_data/ossimNitfSensraTag.cpp
deleted file mode 100644
index 99aabd8..0000000
--- a/ossim/src/ossim/support_data/ossimNitfSensraTag.cpp
+++ /dev/null
@@ -1,444 +0,0 @@
-//*******************************************************************
-
-// LICENSE: MIT
-//
-// see top level LICENSE.txt
-// 
-// Author: Walt Bunch
-//
-// Description: Nitf support class for SENSRA - Sensor parameters extension.
-// 
-//********************************************************************
-// $Id: ossimNitfSensraTag.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <istream>
-#include <iomanip>
-#include <ossim/support_data/ossimNitfSensraTag.h>
-
-RTTI_DEF1(ossimNitfSensraTag, "ossimNitfSensraTag", ossimNitfRegisteredTag);
-
-
-ossimNitfSensraTag::ossimNitfSensraTag()
-   : ossimNitfRegisteredTag(std::string("SENSRA"), 132)
-{
-   clearFields();
-}
-
-ossimNitfSensraTag::~ossimNitfSensraTag()
-{
-}
-
-void ossimNitfSensraTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theRefRow, REF_ROW_SIZE);
-   in.read(theRefCol, REF_COL_SIZE);
-   in.read(theSensorModel, SENSOR_MODEL_SIZE);
-   in.read(theSensorMount, SENSOR_MOUNT_SIZE);
-   in.read(theSensorLoc, SENSOR_LOC_SIZE);
-   in.read(theSensorAltSrc, SENSOR_ALT_SRC_SIZE);
-   in.read(theSensorAlt, SENSOR_ALT_SIZE);
-   in.read(theSensorAltUnit, SENSOR_ALT_UNIT_SIZE);
-   in.read(theSensorAgl, SENSOR_AGL_SIZE);
-   in.read(theSensorPitch, SENSOR_PITCH_SIZE);
-   in.read(theSensorRoll, SENSOR_ROLL_SIZE);
-   in.read(theSensorYaw, SENSOR_YAW_SIZE);
-   in.read(thePlatformPitch, PLATFORM_PITCH_SIZE);
-   in.read(thePlatformRoll, PLATFORM_ROLL_SIZE);
-   in.read(thePlatformHdg, PLATFORM_HDG_SIZE);
-   in.read(theGroundSpdSrc, GROUND_SPD_SRC_SIZE);
-   in.read(theGroundSpeed, GROUND_SPEED_SIZE);
-   in.read(theGroundSpdUnit, GROUND_SPD_UNIT_SIZE);
-   in.read(theGroundTrack, GROUND_TRACK_SIZE);
-   in.read(theVerticalVel, VERTICAL_VEL_SIZE);
-   in.read(theVertVelUnit, VERT_VEL_UNIT_SIZE);
-   in.read(theSwathFrames, SWATH_FRAMES_SIZE);
-   in.read(theNSwaths, N_SWATHS_SIZE);
-   in.read(theSpotNum, SPOT_NUM_SIZE);
-}
-
-void ossimNitfSensraTag::writeStream(std::ostream& out)
-{
-   out.write(theRefRow, REF_ROW_SIZE);
-   out.write(theRefCol, REF_COL_SIZE);
-   out.write(theSensorModel, SENSOR_MODEL_SIZE);
-   out.write(theSensorMount, SENSOR_MOUNT_SIZE);
-   out.write(theSensorLoc, SENSOR_LOC_SIZE);
-   out.write(theSensorAltSrc, SENSOR_ALT_SRC_SIZE);
-   out.write(theSensorAlt, SENSOR_ALT_SIZE);
-   out.write(theSensorAltUnit, SENSOR_ALT_UNIT_SIZE);
-   out.write(theSensorAgl, SENSOR_AGL_SIZE);
-   out.write(theSensorPitch, SENSOR_PITCH_SIZE);
-   out.write(theSensorRoll, SENSOR_ROLL_SIZE);
-   out.write(theSensorYaw, SENSOR_YAW_SIZE);
-   out.write(thePlatformPitch, PLATFORM_PITCH_SIZE);
-   out.write(thePlatformRoll, PLATFORM_ROLL_SIZE);
-   out.write(thePlatformHdg, PLATFORM_HDG_SIZE);
-   out.write(theGroundSpdSrc, GROUND_SPD_SRC_SIZE);
-   out.write(theGroundSpeed, GROUND_SPEED_SIZE);
-   out.write(theGroundSpdUnit, GROUND_SPD_UNIT_SIZE);
-   out.write(theGroundTrack, GROUND_TRACK_SIZE);
-   out.write(theVerticalVel, VERTICAL_VEL_SIZE);
-   out.write(theVertVelUnit, VERT_VEL_UNIT_SIZE);
-   out.write(theSwathFrames, SWATH_FRAMES_SIZE);
-   out.write(theNSwaths, N_SWATHS_SIZE);
-   out.write(theSpotNum, SPOT_NUM_SIZE);
-}
-
-void ossimNitfSensraTag::clearFields()
-{
-   memset(theRefRow, ' ', REF_ROW_SIZE);
-   memset(theRefCol, ' ', REF_COL_SIZE);
-   memset(theSensorModel, ' ', SENSOR_MODEL_SIZE);
-   memset(theSensorMount, ' ', SENSOR_MOUNT_SIZE);
-   memset(theSensorLoc, ' ', SENSOR_LOC_SIZE);
-   memset(theSensorAltSrc, ' ', SENSOR_ALT_SRC_SIZE);
-   memset(theSensorAlt, ' ', SENSOR_ALT_SIZE);
-   memset(theSensorAltUnit, ' ', SENSOR_ALT_UNIT_SIZE);
-   memset(theSensorAgl, ' ', SENSOR_AGL_SIZE);
-   memset(theSensorPitch, ' ', SENSOR_PITCH_SIZE);
-   memset(theSensorRoll, ' ', SENSOR_ROLL_SIZE);
-   memset(theSensorYaw, ' ', SENSOR_YAW_SIZE);
-   memset(thePlatformPitch, ' ', PLATFORM_PITCH_SIZE);
-   memset(thePlatformRoll, ' ', PLATFORM_ROLL_SIZE);
-   memset(thePlatformHdg, ' ', PLATFORM_HDG_SIZE);
-   memset(theGroundSpdSrc, ' ', GROUND_SPD_SRC_SIZE);
-   memset(theGroundSpeed, ' ', GROUND_SPEED_SIZE);
-   memset(theGroundSpdUnit, ' ', GROUND_SPD_UNIT_SIZE);
-   memset(theGroundTrack, ' ', GROUND_TRACK_SIZE);
-   memset(theVerticalVel, ' ', VERTICAL_VEL_SIZE);
-   memset(theVertVelUnit, ' ', VERT_VEL_UNIT_SIZE);
-   memset(theSwathFrames, ' ', SWATH_FRAMES_SIZE);
-   memset(theNSwaths, ' ', N_SWATHS_SIZE);
-   memset(theSpotNum, ' ', SPOT_NUM_SIZE);
-
-   theRefRow[REF_ROW_SIZE] = '\0';
-   theRefCol[REF_COL_SIZE] = '\0';
-   theSensorModel[SENSOR_MODEL_SIZE] = '\0';
-   theSensorMount[SENSOR_MOUNT_SIZE] = '\0';
-   theSensorLoc[SENSOR_LOC_SIZE] = '\0';
-   theSensorAltSrc[SENSOR_ALT_SRC_SIZE] = '\0';
-   theSensorAlt[SENSOR_ALT_SIZE] = '\0';
-   theSensorAltUnit[SENSOR_ALT_UNIT_SIZE] = '\0';
-   theSensorAgl[SENSOR_AGL_SIZE] = '\0';
-   theSensorPitch[SENSOR_PITCH_SIZE] = '\0';
-   theSensorRoll[SENSOR_ROLL_SIZE] = '\0';
-   theSensorYaw[SENSOR_YAW_SIZE] = '\0';
-   thePlatformPitch[PLATFORM_PITCH_SIZE] = '\0';
-   thePlatformRoll[PLATFORM_ROLL_SIZE] = '\0';
-   thePlatformHdg[PLATFORM_HDG_SIZE] = '\0';
-   theGroundSpdSrc[GROUND_SPD_SRC_SIZE] = '\0';
-   theGroundSpeed[GROUND_SPEED_SIZE] = '\0';
-   theGroundSpdUnit[GROUND_SPD_UNIT_SIZE] = '\0';
-   theGroundTrack[GROUND_TRACK_SIZE] = '\0';
-   theVerticalVel[VERTICAL_VEL_SIZE] = '\0';
-   theVertVelUnit[VERT_VEL_UNIT_SIZE] = '\0';
-   theSwathFrames[SWATH_FRAMES_SIZE] = '\0';
-   theNSwaths[N_SWATHS_SIZE] = '\0';
-   theSpotNum[SPOT_NUM_SIZE] = '\0';
-}
-
-std::ostream& ossimNitfSensraTag::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << std::setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
-       << pfx << std::setw(24) << "REFROW:" << theRefRow << "\n"
-       << pfx << std::setw(24) << "REFCOL:" << theRefCol << "\n"
-       << pfx << std::setw(24) << "SENSORMODEL:" << theSensorModel<< "\n"
-       << pfx << std::setw(24) << "SENSORMOUNT:" << theSensorMount << "\n"
-       << pfx << std::setw(24) << "SENSORLOC:" << theSensorLoc << "\n"
-       << pfx << std::setw(24) << "SENSORALTSRC:" << theSensorAltSrc<< "\n"
-       << pfx << std::setw(24) << "SENSORALT:" << theSensorAlt << "\n"
-       << pfx << std::setw(24) << "SENSORALTUNIT:" << theSensorAltUnit << "\n"
-       << pfx << std::setw(24) << "SENSORAGL:" << theSensorAgl << "\n"
-       << pfx << std::setw(24) << "SENSORPITCH:" << theSensorPitch << "\n"
-       << pfx << std::setw(24) << "SENSORROLL:" << theSensorRoll<< "\n"
-       << pfx << std::setw(24) << "SENSORYAW:" << theSensorYaw << "\n"
-       << pfx << std::setw(24) << "PLATFORMPITCH:" << thePlatformPitch << "\n"
-       << pfx << std::setw(24) << "PLATFORMROLL:" << thePlatformRoll << "\n"
-       << pfx << std::setw(24) << "PLATFORMHDG:" << thePlatformHdg << "\n"
-       << pfx << std::setw(24) << "GROUNDSPDSRC:" << theGroundSpdSrc << "\n"
-       << pfx << std::setw(24) << "GROUNDSPEED:" << theGroundSpeed << "\n"
-       << pfx << std::setw(24) << "GROUNDSPDUNIT:" << theGroundSpdUnit << "\n"
-       << pfx << std::setw(24) << "GROUNDTRACK:" << theGroundTrack << "\n"
-       << pfx << std::setw(24) << "VERTICALVEL:" << theVerticalVel<< "\n"
-       << pfx << std::setw(24) << "VERTVELUNIT:" << theVertVelUnit << "\n"
-       << pfx << std::setw(24) << "SWATHFRAMES:" << theSwathFrames<< "\n"
-       << pfx << std::setw(24) << "NSWATHS:" << theNSwaths << "\n"
-       << pfx << std::setw(24) << "SPOTNUM:" << theSpotNum << "\n";
-   
-   return out;
-}
-
-ossimString ossimNitfSensraTag::getRefRow()const
-{
-   return theRefRow;
-}
-
-void ossimNitfSensraTag::setRefRow(ossimString refRow)
-{
-   memset(theRefRow, ' ', REF_ROW_SIZE);
-   memcpy(theRefRow, refRow.c_str(), std::min((size_t)REF_ROW_SIZE, refRow.length()));
-}
-
-ossimString ossimNitfSensraTag::getRefCol()const
-{
-   return theRefCol;
-}
-
-void ossimNitfSensraTag::setRefCol(ossimString refCol)
-{
-   memset(theRefCol, ' ', REF_COL_SIZE);
-   memcpy(theRefCol, refCol.c_str(), std::min((size_t)REF_COL_SIZE, refCol.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorModel()const
-{
-   return theSensorModel;
-}
-
-void ossimNitfSensraTag::setSensorModel(ossimString sensorModel)
-{
-   memset(theSensorModel, ' ', SENSOR_MODEL_SIZE);
-   memcpy(theSensorModel, sensorModel.c_str(), std::min((size_t)SENSOR_MODEL_SIZE, sensorModel.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorMount()const
-{
-   return theSensorMount;
-}
-
-void ossimNitfSensraTag::setSensorMount(ossimString sensorMount)
-{
-   memset(theSensorMount, ' ', SENSOR_MOUNT_SIZE);
-   memcpy(theSensorMount, sensorMount.c_str(), std::min((size_t)SENSOR_MOUNT_SIZE, sensorMount.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorLoc()const
-{
-   return theSensorLoc;
-}
-
-void ossimNitfSensraTag::setSensorLoc(ossimString sensorLoc)
-{
-   memset(theSensorLoc, ' ', SENSOR_LOC_SIZE);
-   memcpy(theSensorLoc, sensorLoc.c_str(), std::min((size_t)SENSOR_LOC_SIZE, sensorLoc.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorAltSrc()const
-{
-   return theSensorAltSrc;
-}
-
-void ossimNitfSensraTag::setSensorAltSrc(ossimString sensorAltSrc)
-{
-   memset(theSensorAltSrc, ' ', SENSOR_ALT_SRC_SIZE);
-   memcpy(theSensorAltSrc, sensorAltSrc.c_str(), std::min((size_t)SENSOR_ALT_SRC_SIZE, sensorAltSrc.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorAlt()const
-{
-   return theSensorAlt;
-}
-
-void ossimNitfSensraTag::setSensorAlt(ossimString sensorAlt)
-{
-   memset(theSensorAlt, ' ', SENSOR_ALT_SIZE);
-   memcpy(theSensorAlt, sensorAlt.c_str(), std::min((size_t)SENSOR_ALT_SIZE, sensorAlt.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorAltUnit()const
-{
-   return theSensorAltUnit;
-}
-
-void ossimNitfSensraTag::setSensorAltUnit(ossimString sensorAltUnit)
-{
-   memset(theSensorAltUnit, ' ', SENSOR_ALT_UNIT_SIZE);
-   memcpy(theSensorAltUnit, sensorAltUnit.c_str(), std::min((size_t)SENSOR_ALT_UNIT_SIZE, sensorAltUnit.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorAgl()const
-{
-   return theSensorAgl;
-}
-
-void ossimNitfSensraTag::setSensorAgl(ossimString sensorAgl)
-{
-   memset(theSensorAgl, ' ', SENSOR_AGL_SIZE);
-   memcpy(theSensorAgl, sensorAgl.c_str(), std::min((size_t)SENSOR_AGL_SIZE, sensorAgl.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorPitch()const
-{
-   return theSensorPitch;
-}
-
-void ossimNitfSensraTag::setSensorPitch(ossimString sensorPitch)
-{
-   memset(theSensorPitch, ' ', SENSOR_PITCH_SIZE);
-   memcpy(theSensorPitch, sensorPitch.c_str(), std::min((size_t)SENSOR_PITCH_SIZE, sensorPitch.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorRoll()const
-{
-   return theSensorRoll;
-}
-
-void ossimNitfSensraTag::setSensorRoll(ossimString sensorRoll)
-{
-   memset(theSensorRoll, ' ', SENSOR_ROLL_SIZE);
-   memcpy(theSensorRoll, sensorRoll.c_str(), std::min((size_t)SENSOR_ROLL_SIZE, sensorRoll.length()));
-}
-
-ossimString ossimNitfSensraTag::getSensorYaw()const
-{
-   return theSensorYaw;
-}
-
-void ossimNitfSensraTag::setSensorYaw(ossimString sensorYaw)
-{
-   memset(theSensorYaw, ' ', SENSOR_YAW_SIZE);
-   memcpy(theSensorYaw, sensorYaw.c_str(), std::min((size_t)SENSOR_YAW_SIZE, sensorYaw.length()));
-}
-
-ossimString ossimNitfSensraTag::getPlatformPitch()const
-{
-   return thePlatformPitch;
-}
-
-void ossimNitfSensraTag::setPlatformPitch(ossimString platformPitch)
-{
-   memset(thePlatformPitch, ' ', PLATFORM_PITCH_SIZE);
-   memcpy(thePlatformPitch, platformPitch.c_str(), std::min((size_t)PLATFORM_PITCH_SIZE, platformPitch.length()));
-}
-
-ossimString ossimNitfSensraTag::getPlatformRoll()const
-{
-   return thePlatformRoll;
-}
-
-void ossimNitfSensraTag::setPlatformRoll(ossimString platformRoll)
-{
-   memset(thePlatformRoll, ' ', PLATFORM_ROLL_SIZE);
-   memcpy(thePlatformRoll, platformRoll.c_str(), std::min((size_t)PLATFORM_ROLL_SIZE, platformRoll.length()));
-}
-
-ossimString ossimNitfSensraTag::getPlatformHdg()const
-{
-   return thePlatformHdg;
-}
-
-void ossimNitfSensraTag::setPlatformHdg(ossimString platformHdg)
-{
-   memset(thePlatformHdg, ' ', PLATFORM_HDG_SIZE);
-   memcpy(thePlatformHdg, platformHdg.c_str(), std::min((size_t)PLATFORM_HDG_SIZE, platformHdg.length()));
-}
-
-ossimString ossimNitfSensraTag::getGroundSpdSrc()const
-{
-   return theGroundSpdSrc;
-}
-
-void ossimNitfSensraTag::setGroundSpdSrc(ossimString groundSpdSrc)
-{
-   memset(theGroundSpdSrc, ' ', GROUND_SPD_SRC_SIZE);
-   memcpy(theGroundSpdSrc, groundSpdSrc.c_str(), std::min((size_t)GROUND_SPD_SRC_SIZE, groundSpdSrc.length()));
-}
-
-ossimString ossimNitfSensraTag::getGroundSpeed()const
-{
-   return theGroundSpeed;
-}
-
-void ossimNitfSensraTag::setGroundSpeed(ossimString groundSpeed)
-{
-   memset(theGroundSpeed, ' ', GROUND_SPEED_SIZE);
-   memcpy(theGroundSpeed, groundSpeed.c_str(), std::min((size_t)GROUND_SPEED_SIZE, groundSpeed.length()));
-}
-
-ossimString ossimNitfSensraTag::getGroundSpdUnit()const
-{
-   return theGroundSpdUnit;
-}
-
-void ossimNitfSensraTag::setGroundSpdUnit(ossimString groundSpdUnit)
-{
-   memset(theGroundSpdUnit, ' ', GROUND_SPD_UNIT_SIZE);
-   memcpy(theGroundSpdUnit, groundSpdUnit.c_str(), std::min((size_t)GROUND_SPD_UNIT_SIZE, groundSpdUnit.length()));
-}
-
-ossimString ossimNitfSensraTag::getGroundTrack()const
-{
-   return theGroundTrack;
-}
-
-void ossimNitfSensraTag::setGroundTrack(ossimString groundTrack)
-{
-   memset(theGroundTrack, ' ', GROUND_TRACK_SIZE);
-   memcpy(theGroundTrack, groundTrack.c_str(), std::min((size_t)GROUND_TRACK_SIZE, groundTrack.length()));
-}
-
-ossimString ossimNitfSensraTag::getVerticalVel()const
-{
-   return theVerticalVel;
-}
-
-void ossimNitfSensraTag::setVerticalVel(ossimString verticalVel)
-{
-   memset(theVerticalVel, ' ', VERTICAL_VEL_SIZE);
-   memcpy(theVerticalVel, verticalVel.c_str(), std::min((size_t)VERTICAL_VEL_SIZE, verticalVel.length()));
-}
-
-ossimString ossimNitfSensraTag::getVertVelUnit()const
-{
-   return theVertVelUnit;
-}
-
-void ossimNitfSensraTag::setVertVelUnit(ossimString vertVelUnit)
-{
-   memset(theVertVelUnit, ' ', VERT_VEL_UNIT_SIZE);
-   memcpy(theVertVelUnit, vertVelUnit.c_str(), std::min((size_t)VERT_VEL_UNIT_SIZE, vertVelUnit.length()));
-}
-
-ossimString ossimNitfSensraTag::getSwathFrames()const
-{
-   return theSwathFrames;
-}
-
-void ossimNitfSensraTag::setSwathFrames(ossimString swathFrames)
-{
-   memset(theSwathFrames, ' ', SWATH_FRAMES_SIZE);
-   memcpy(theSwathFrames, swathFrames.c_str(), std::min((size_t)SWATH_FRAMES_SIZE, swathFrames.length()));
-}
-
-ossimString ossimNitfSensraTag::getNSwaths()const
-{
-   return theNSwaths;
-}
-
-void ossimNitfSensraTag::setNSwaths(ossimString nSwaths)
-{
-   memset(theNSwaths, ' ', N_SWATHS_SIZE);
-   memcpy(theNSwaths, nSwaths.c_str(), std::min((size_t)N_SWATHS_SIZE, nSwaths.length()));
-}
-
-ossimString ossimNitfSensraTag::getSpotNum()const
-{
-   return theSpotNum;
-}
-
-void ossimNitfSensraTag::setSpotNum(ossimString spotNum)
-{
-   memset(theSpotNum, ' ', SPOT_NUM_SIZE);
-   memcpy(theSpotNum, spotNum.c_str(), std::min((size_t)SPOT_NUM_SIZE, spotNum.length()));
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfStdidcTag.cpp b/ossim/src/ossim/support_data/ossimNitfStdidcTag.cpp
deleted file mode 100644
index 91cbe7e..0000000
--- a/ossim/src/ossim/support_data/ossimNitfStdidcTag.cpp
+++ /dev/null
@@ -1,469 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author:  Walt Bunch
-// 
-// Description:   NITF support data class for STDIDC - Standard ID extension.
-//
-// See:  STDI-000_v2.1 Table 7-3 for detailed description.
-// 
-//********************************************************************
-// $Id: ossimNitfStdidcTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <iomanip>
-#include <ossim/support_data/ossimNitfStdidcTag.h>
-#include <ossim/base/ossimStringProperty.h>
-
-RTTI_DEF1(ossimNitfStdidcTag, "ossimNitfStdidcTag", ossimNitfRegisteredTag);
-static const ossimString ACQDATE_KW = "ACQDATE";
-static const ossimString MISSION_KW = "MISSION";
-static const ossimString PASS_KW = "PASS";
-static const ossimString OPNUM_KW = "OPNUM";
-static const ossimString STARTSEGMENT_KW = "STARTSEGMENT";
-static const ossimString REPRONUM_KW = "REPRONUM";
-static const ossimString REPLAYREGEN_KW = "REPLAYREGEN";
-static const ossimString BLANKFILL_KW = "BLANKFILL";
-static const ossimString STARTCOLUMN_KW = "STARTCOLUMN";
-static const ossimString STARTROW_KW = "STARTROW";
-static const ossimString ENDSEGMENT_KW = "ENDSEGMENT";
-static const ossimString ENDCOLUMN_KW = "ENDCOLUMN";
-static const ossimString ENDROW_KW = "ENDROW";
-static const ossimString COUNTRY_KW = "COUNTRY";
-static const ossimString WAC_KW = "WAC";
-static const ossimString LOCATION_KW = "LOCATION";
-
-
-ossimNitfStdidcTag::ossimNitfStdidcTag()
-   : ossimNitfRegisteredTag(std::string("STDIDC"), 89)
-{
-   clearFields();
-}
-
-ossimNitfStdidcTag::~ossimNitfStdidcTag()
-{
-}
-
-void ossimNitfStdidcTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theAcqDate,      ACQ_DATE_SIZE);
-   in.read(theMission,      MISSION_SIZE);
-   in.read(thePass,         PASS_SIZE);
-   in.read(theOpNum,        OP_NUM_SIZE);
-   in.read(theStartSegment, START_SEGMENT_SIZE);
-   in.read(theReproNum,     REPRO_NUM_SIZE);
-   in.read(theReplayRegen,  REPLAY_REGEN_SIZE);
-   in.read(theBlankFill,    BLANK_FILL_SIZE);
-   in.read(theStartColumn,  START_COLUMN_SIZE);
-   in.read(theStartRow,     START_ROW_SIZE);
-   in.read(theEndSegment,   END_SEGMENT_SIZE);
-   in.read(theEndColumn,    END_COLUMN_SIZE);
-   in.read(theEndRow,       END_ROW_SIZE);
-   in.read(theCountry,      COUNTRY_SIZE);
-   in.read(theWac,          WAC_SIZE);
-   in.read(theLocation,     LOCATION_SIZE);
-   in.read(theField17,      FIELD17_SIZE);
-   in.read(theField18,      FIELD18_SIZE);
-}
-
-void ossimNitfStdidcTag::writeStream(std::ostream& out)
-{
-   out.write(theAcqDate,      ACQ_DATE_SIZE);
-   out.write(theMission,      MISSION_SIZE);
-   out.write(thePass,         PASS_SIZE);
-   out.write(theOpNum,        OP_NUM_SIZE);
-   out.write(theStartSegment, START_SEGMENT_SIZE);
-   out.write(theReproNum,     REPRO_NUM_SIZE);
-   out.write(theReplayRegen,  REPLAY_REGEN_SIZE);
-   out.write(theBlankFill,    BLANK_FILL_SIZE);
-   out.write(theStartColumn,  START_COLUMN_SIZE);
-   out.write(theStartRow,     START_ROW_SIZE);
-   out.write(theEndSegment,   END_SEGMENT_SIZE);
-   out.write(theEndColumn,    END_COLUMN_SIZE);
-   out.write(theEndRow,       END_ROW_SIZE);
-   out.write(theCountry,      COUNTRY_SIZE);
-   out.write(theWac,          WAC_SIZE);
-   out.write(theLocation,     LOCATION_SIZE);
-   out.write(theField17,      FIELD17_SIZE);
-   out.write(theField18,      FIELD18_SIZE);
-}
-
-void ossimNitfStdidcTag::clearFields()
-{
-   memset(theAcqDate,      ' ', ACQ_DATE_SIZE);
-   memset(theMission,      ' ', MISSION_SIZE);
-   memset(thePass,         ' ', PASS_SIZE);
-   memset(theOpNum,        ' ', OP_NUM_SIZE);
-   memset(theStartSegment, ' ', START_SEGMENT_SIZE);
-   memset(theReproNum,     ' ', REPRO_NUM_SIZE);
-   memset(theReplayRegen,  ' ', REPLAY_REGEN_SIZE);
-   memset(theBlankFill,    ' ', BLANK_FILL_SIZE);
-   memset(theStartColumn,  ' ', START_COLUMN_SIZE);
-   memset(theStartRow,     ' ', START_ROW_SIZE);
-   memset(theEndSegment,   ' ', END_SEGMENT_SIZE);
-   memset(theEndColumn,    ' ', END_COLUMN_SIZE);
-   memset(theEndRow,       ' ', END_ROW_SIZE);
-   memset(theCountry,      ' ', COUNTRY_SIZE);
-   memset(theWac,          ' ', WAC_SIZE);
-   memset(theLocation,     ' ', LOCATION_SIZE);
-   memset(theField17,      ' ', FIELD17_SIZE);
-   memset(theField18,      ' ', FIELD18_SIZE);
-
-   theAcqDate[ACQ_DATE_SIZE]           = '\0';
-   theMission[MISSION_SIZE]            = '\0';
-   thePass[PASS_SIZE]                  = '\0';
-   theOpNum[OP_NUM_SIZE]               = '\0';
-   theStartSegment[START_SEGMENT_SIZE] = '\0';
-   theReproNum[REPRO_NUM_SIZE]         = '\0';
-   theReplayRegen[REPLAY_REGEN_SIZE]   = '\0';
-   theBlankFill[BLANK_FILL_SIZE]       = '\0';
-   theStartColumn[START_COLUMN_SIZE]   = '\0';
-   theStartRow[START_ROW_SIZE]         = '\0';
-   theEndSegment[END_SEGMENT_SIZE]     = '\0';
-   theEndColumn[END_COLUMN_SIZE]       = '\0';
-   theEndRow[END_ROW_SIZE]             = '\0';
-   theCountry[COUNTRY_SIZE]            = '\0';
-   theWac[WAC_SIZE]                    = '\0';
-   theLocation[LOCATION_SIZE]          = '\0';
-   theField17[FIELD17_SIZE]            = '\0';
-   theField18[FIELD18_SIZE]            = '\0';
-}
-
-ossimString ossimNitfStdidcTag::getAcqDate()const
-{
-  return ossimString(theAcqDate);
-}
-
-void ossimNitfStdidcTag::setAcqDate(ossimString acqDate)
-{
-   memset(theAcqDate, ' ', ACQ_DATE_SIZE);
-   memcpy(theAcqDate, acqDate.c_str(), std::min((size_t)ACQ_DATE_SIZE, acqDate.length()));
-}
-
-ossimString ossimNitfStdidcTag::getMission()const
-{
-  return ossimString(theMission);
-}
-
-void ossimNitfStdidcTag::setMission(ossimString mission)
-{
-   memset(theMission, ' ', MISSION_SIZE);
-   memcpy(theMission, mission.c_str(), std::min((size_t)MISSION_SIZE, mission.length()));
-}
-
-ossimString ossimNitfStdidcTag::getPass()const
-{
-  return ossimString(thePass);
-}
-
-void ossimNitfStdidcTag::setPass(ossimString pass)
-{
-   memset(thePass, ' ', PASS_SIZE);
-   memcpy(thePass, pass.c_str(), std::min((size_t)PASS_SIZE, pass.length()));
-}
-
-ossimString ossimNitfStdidcTag::getOpNum()const
-{
-  return ossimString(theOpNum);
-}
-
-void ossimNitfStdidcTag::setOpNum(ossimString opNum) 
-{
-   memset(theOpNum, ' ', OP_NUM_SIZE);
-   memcpy(theOpNum, opNum.c_str(), std::min((size_t)OP_NUM_SIZE, opNum.length()));
-}
-
-ossimString ossimNitfStdidcTag::getStartSegment()const
-{
-  return ossimString(theStartSegment);
-}
-
-void ossimNitfStdidcTag::setStartSegment(ossimString startSegment) 
-{
-   memset(theStartSegment, ' ', START_SEGMENT_SIZE);
-   memcpy(theStartSegment, startSegment.c_str(), std::min((size_t)START_SEGMENT_SIZE, startSegment.length()));
-}
-
-ossimString ossimNitfStdidcTag::getReproNum()const
-{
-  return ossimString(theReproNum);
-}
-
-void ossimNitfStdidcTag::setReproNum(ossimString reproNum) 
-{
-   memset(theReproNum, ' ', REPRO_NUM_SIZE);
-   memcpy(theReproNum, reproNum.c_str(), std::min((size_t)REPRO_NUM_SIZE, reproNum.length()));
-}
-
-ossimString ossimNitfStdidcTag::getReplayRegen()const
-{
-  return ossimString(theReplayRegen);
-}
-
-void ossimNitfStdidcTag::setReplayRegen(ossimString replayRegen) 
-{
-   memset(theReplayRegen, ' ', REPLAY_REGEN_SIZE);
-   memcpy(theReplayRegen, replayRegen.c_str(), std::min((size_t)REPLAY_REGEN_SIZE, replayRegen.length()));
-}
-
-ossimString ossimNitfStdidcTag::getBlankFill()const
-{
-  return ossimString(theBlankFill);
-}
-
-void ossimNitfStdidcTag::setBlankFill(ossimString blankFill) 
-{
-   memset(theBlankFill, ' ', BLANK_FILL_SIZE);
-   memcpy(theBlankFill, blankFill.c_str(), std::min((size_t)BLANK_FILL_SIZE, blankFill.length()));
-}
-
-ossimString ossimNitfStdidcTag::getStartColumn()const
-{
-  return ossimString(theStartColumn);
-}
-
-void ossimNitfStdidcTag::setStartColumn(ossimString startColumn) 
-{
-   memset(theStartColumn, ' ', START_COLUMN_SIZE);
-   memcpy(theStartColumn, startColumn.c_str(), std::min((size_t)START_COLUMN_SIZE, startColumn.length()));
-}
-
-ossimString ossimNitfStdidcTag::getStartRow()const
-{
-  return ossimString(theStartRow);
-}
-
-void ossimNitfStdidcTag::setStartRow(ossimString startRow) 
-{
-   memset(theStartRow, ' ', START_ROW_SIZE);
-   memcpy(theStartRow, startRow.c_str(), std::min((size_t)START_ROW_SIZE, startRow.length()));
-}
-
-ossimString ossimNitfStdidcTag::getEndSegment()const
-{
-  return ossimString(theEndSegment);
-}
-
-void ossimNitfStdidcTag::setEndSegment(ossimString endSegment) 
-{
-   memset(theEndSegment, ' ', END_SEGMENT_SIZE);
-   memcpy(theEndSegment, endSegment.c_str(), std::min((size_t)END_SEGMENT_SIZE, endSegment.length()));
-}
-
-ossimString ossimNitfStdidcTag::getEndColumn()const
-{
-  return ossimString(theEndColumn);
-}
-
-void ossimNitfStdidcTag::setEndColumn(ossimString endColumn) 
-{
-   memset(theEndColumn, ' ', END_COLUMN_SIZE);
-   memcpy(theEndColumn, endColumn.c_str(), std::min((size_t)END_COLUMN_SIZE, endColumn.length()));
-}
-
-ossimString ossimNitfStdidcTag::getEndRow()const
-{
-  return ossimString(theEndRow);
-}
-
-void ossimNitfStdidcTag::setEndRow(ossimString endRow) 
-{
-   memset(theEndRow, ' ', END_ROW_SIZE);
-   memcpy(theEndRow, endRow.c_str(), std::min((size_t)END_ROW_SIZE, endRow.length()));
-}
-
-ossimString ossimNitfStdidcTag::getCountry()const
-{
-  return ossimString(theCountry);
-}
-
-void ossimNitfStdidcTag::setCountry(ossimString country) 
-{
-   memset(theCountry, ' ', COUNTRY_SIZE);
-   memcpy(theCountry, country.c_str(), std::min((size_t)COUNTRY_SIZE, country.length()));
-}
-
-ossimString ossimNitfStdidcTag::getWac()const
-{
-  return ossimString(theWac);
-}
-
-void ossimNitfStdidcTag::setWac(ossimString wac) 
-{
-   memset(theWac, ' ', WAC_SIZE);
-   memcpy(theWac, wac.c_str(), std::min((size_t)WAC_SIZE, wac.length()));
-}
-
-ossimString ossimNitfStdidcTag::getLocation()const
-{
-  return ossimString(theLocation);
-}
-
-void ossimNitfStdidcTag::setLocation(ossimString location) 
-{
-   memset(theLocation, ' ', LOCATION_SIZE);
-   memcpy(theLocation, location.c_str(), std::min((size_t)LOCATION_SIZE, location.length()));
-}
-
-ossimString ossimNitfStdidcTag::getField17()const
-{
-  return ossimString(theField17);
-}
-
-void ossimNitfStdidcTag::setField17(ossimString field17) 
-{
-   memset(theField17, ' ', FIELD17_SIZE);
-   memcpy(theField17, field17.c_str(), std::min((size_t)FIELD17_SIZE, field17.length()));
-}
-
-ossimString ossimNitfStdidcTag::getField18()const
-{
-  return ossimString(theField18);
-}
-
-void ossimNitfStdidcTag::setField18(ossimString field18) 
-{
-   memset(theField18, ' ', FIELD18_SIZE);
-   memcpy(theField18, field18.c_str(), std::min((size_t)FIELD18_SIZE, field18.length()));
-}
-
-std::ostream& ossimNitfStdidcTag::print(std::ostream& out,
-                                        const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-   
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:"
-       << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "ACQDATE:"      << theAcqDate << "\n"
-       << pfx << std::setw(24) << "MISSION:"      << theMission << "\n"
-       << pfx << std::setw(24) << "PASS:"         << thePass << "\n"
-       << pfx << std::setw(24) << "OPNUM:"        << theOpNum  << "\n"
-       << pfx << std::setw(24) << "STARTSEGMENT:" << theStartSegment << "\n"
-       << pfx << std::setw(24) << "REPRONUM:"     << theReproNum << "\n"
-       << pfx << std::setw(24) << "REPLAYREGEN:"  << theReplayRegen << "\n"
-       << pfx << std::setw(24) << "STARTCOLUMN:"  << theStartColumn << "\n"
-       << pfx << std::setw(24) << "STARTROW:"     << theStartRow << "\n"
-       << pfx << std::setw(24) << "ENDSEGMENT:"   << theEndSegment << "\n"
-       << pfx << std::setw(24) << "ENDCOLUMN:"    << theEndColumn << "\n"
-       << pfx << std::setw(24) << "ENDROW:"       << theEndRow << "\n"
-       << pfx << std::setw(24) << "COUNTRY:"      << theCountry << "\n"
-       << pfx << std::setw(24) << "WAC:"          << theWac << "\n"
-       << pfx << std::setw(24) << "LOCATION:"     << theLocation << "\n";
-
-   return out;
-}
-
-void ossimNitfStdidcTag::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimNitfRegisteredTag::setProperty(property);
-}
-
-ossimRefPtr<ossimProperty> ossimNitfStdidcTag::getProperty(const ossimString& name)const
-{
-   ossimProperty* result = 0;
-   
-   if(name == ACQDATE_KW)
-   {
-      result = new ossimStringProperty(name, theAcqDate);
-   }
-   else if(name == MISSION_KW)
-   {
-      result = new ossimStringProperty(name, theMission);
-   }
-   else if(name == PASS_KW)
-   {
-      result = new ossimStringProperty(name, thePass);
-   }
-   else if(name == OPNUM_KW)
-   {
-      result = new ossimStringProperty(name, theOpNum);
-   }
-   else if(name == STARTSEGMENT_KW)
-   {
-      result = new ossimStringProperty(name, theStartSegment);
-   }
-   else if(name == REPRONUM_KW)
-   {
-      result = new ossimStringProperty(name, theReproNum);
-   }
-   else if(name == REPLAYREGEN_KW)
-   {
-      result = new ossimStringProperty(name, theReplayRegen);
-   }
-   else if(name == BLANKFILL_KW)
-   {
-      result = new ossimStringProperty(name, theBlankFill);
-   }
-   else if(name == STARTCOLUMN_KW)
-   {
-      result = new ossimStringProperty(name, theStartColumn);
-   }
-   else if(name == STARTROW_KW)
-   {
-      result = new ossimStringProperty(name, theStartRow);
-   }
-   else if(name == ENDSEGMENT_KW)
-   {
-      result = new ossimStringProperty(name, theEndSegment);
-   }
-   else if(name == ENDCOLUMN_KW)
-   {
-      result = new ossimStringProperty(name, theEndColumn);
-   }
-   else if(name == ENDROW_KW)
-   {
-      result = new ossimStringProperty(name, theEndRow);
-   }
-   else if(name == COUNTRY_KW)
-   {
-      result = new ossimStringProperty(name,theCountry );
-   }
-   else if(name == WAC_KW)
-   {
-      result = new ossimStringProperty(name, theWac);
-   }
-   else if(name == LOCATION_KW)
-   {
-      result = new ossimStringProperty(name, theLocation);
-   }
-   else
-   {
-      return ossimNitfRegisteredTag::getProperty(name);
-   }
-
-   return result;
-}
-
-void ossimNitfStdidcTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(ACQDATE_KW);
-   propertyNames.push_back(MISSION_KW);
-   propertyNames.push_back(PASS_KW);
-   propertyNames.push_back(OPNUM_KW);
-   propertyNames.push_back(STARTSEGMENT_KW);
-   propertyNames.push_back(REPRONUM_KW);
-   propertyNames.push_back(REPLAYREGEN_KW);
-   propertyNames.push_back(BLANKFILL_KW);
-   propertyNames.push_back(STARTCOLUMN_KW);
-   propertyNames.push_back(STARTROW_KW);
-   propertyNames.push_back(ENDSEGMENT_KW);
-   propertyNames.push_back(ENDCOLUMN_KW);
-   propertyNames.push_back(ENDROW_KW);
-   propertyNames.push_back(COUNTRY_KW);
-   propertyNames.push_back(WAC_KW);
-   propertyNames.push_back(LOCATION_KW);
-   
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimNitfTagInformation.cpp b/ossim/src/ossim/support_data/ossimNitfTagInformation.cpp
deleted file mode 100644
index b606de6..0000000
--- a/ossim/src/ossim/support_data/ossimNitfTagInformation.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//*******************************************************************
-//
-// LICENSE: MIT  see top level LICENSE.txt
-//
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfTagInformation.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <ossim/support_data/ossimNitfTagInformation.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/support_data/ossimNitfTagFactoryRegistry.h>
-#include <ossim/support_data/ossimNitfUnknownTag.h>
-#include <sstream>
-#include <iomanip>
-#include <cstring> // for memset
-
-ossimNitfTagInformation::ossimNitfTagInformation(ossimRefPtr<ossimNitfRegisteredTag> tagData)
-{
-   clearFields();
-   setTagData(tagData);
-}
-
-ossimNitfTagInformation::~ossimNitfTagInformation()
-{
-}
-
-void ossimNitfTagInformation::parseStream(std::istream &in)
-{
-   if(in)
-   {
-      clearFields();
-      theTagOffset = in.tellg();
-      in.read(theTagName, 6);
-      in.read(theTagLength, 5);
-      theTagDataOffset = in.tellg();
-
-      theTagData = ossimNitfTagFactoryRegistry::instance()->create(getTagName());
-
-      if (theTagData.valid())
-      {
-         if (theTagData->getClassName() == "ossimNitfUnknownTag")
-         {
-            // Unknown tag doesn't know his tag name yet.
-            theTagData->setTagName( getTagName() );
-         }
-
-         //---
-         // Tags with dynamic tag length construct with 0 length.
-         // Set if 0.
-         //---
-         if ( theTagData->getTagLength() == 0 )
-         {
-            theTagData->setTagLength( getTagLength() );
-         }
-         // Sanity check fixed length in code with length from CEL field:
-         else if ( theTagData->getTagLength() != getTagLength() )
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimNitfTagInformation::parseStream WARNING!"
-               << "\nCEL field length does not match fixed tag length for tag: "
-               << theTagData->getTagName().c_str()
-               << "\nCEL: " << getTagLength()
-               << "\nTag: " << theTagData->getTagLength()
-               << std::endl;
-         }
-                               
-         theTagData->parseStream(in);
-      }
-      else
-      {
-         theTagData = (ossimNitfRegisteredTag*)NULL;
-      }
-   }
-}
-
-void ossimNitfTagInformation::writeStream(std::ostream &out)
-{
-   theTagOffset = out.tellp(); // Capture the offset.
-   out.write(theTagName, 6);
-   out.write(theTagLength, 5);
-   if(theTagData.valid())
-   {
-      theTagDataOffset = out.tellp();
-      theTagData->writeStream(out);
-   }
-}
-
-ossim_uint32 ossimNitfTagInformation::getTotalTagLength()const
-{
-   return (getTagLength() + (ossim_uint32)11);
-}
-
-ossim_uint32 ossimNitfTagInformation::getTagLength()const
-{
-   return ossimString(theTagLength).toUInt32();
-}
-
-ossim_uint64 ossimNitfTagInformation::getTagOffset()const
-{
-   return theTagOffset;
-}
-
-ossim_uint64 ossimNitfTagInformation::getTagDataOffset()const
-{
-   return theTagDataOffset;
-}
-
-ossimString ossimNitfTagInformation::getTagName()const
-{
-   return ossimString(theTagName).trim();
-}
-
-std::ostream& ossimNitfTagInformation::print(std::ostream& out)const
-{
-   out << "theTagName:       " << theTagName
-       << "\ntheTagLength:     " << theTagLength
-       << "\ntheTagType:       " << theTagType
-       << "\ntheTagOffset:     " << theTagOffset
-       << "\ntheTagDataOffset: " << theTagDataOffset
-       << std::endl;
-
-   return out;
-}
-
-void ossimNitfTagInformation::clearFields()
-{
-   memset(theTagName, ' ', 6);
-   memset(theTagLength, 0, 5);
-   strcpy(theTagType, "IXSHD ");
-
-   theTagName[6]    = '\0';
-   theTagLength[5]  = '\0';
-   
-   theTagOffset     = 0;
-   theTagDataOffset = 0;
-}
-
-void ossimNitfTagInformation::setTagName(const ossimString& tagName)
-{
-   memset(theTagName, ' ', 6);
-
-   std::ostringstream out;
-
-   out << std::setw(6)
-       << std::setfill(' ')
-       << tagName;
-   memcpy(theTagName, out.str().c_str(), 6);
-}
-
-void ossimNitfTagInformation::setTagLength(ossim_uint32 tagLength)
-{
-   memset(theTagLength, 0, 5);
-   
-   if(tagLength > 99999)
-   {
-      tagLength = 99999;
-   }
-
-   std::ostringstream out;
-
-   out << std::setw(5)
-       << std::setfill('0')
-       << tagLength;
-   
-   memcpy(theTagLength, out.str().c_str(), 5);
-}
-
-ossimRefPtr<ossimNitfRegisteredTag> ossimNitfTagInformation::getTagData()
-{
-   return theTagData;
-}
-
-const ossimRefPtr<ossimNitfRegisteredTag> ossimNitfTagInformation::getTagData()const
-{
-   return theTagData;
-}
-
-void ossimNitfTagInformation::setTagData(ossimRefPtr<ossimNitfRegisteredTag> tagData)
-{
-   theTagData = tagData;
-
-   memset(theTagName, ' ', 6);
-   memset(theTagLength, ' ', 5);
-   
-   if(theTagData.valid())
-   {
-      setTagName(theTagData->getRegisterTagName());
-      setTagLength(theTagData->getSizeInBytes());
-   }
-}
-ossimString ossimNitfTagInformation::getTagType() const
-{
-   return ossimString(theTagType).trim();
-}
-
-void ossimNitfTagInformation::setTagType(const ossimString& tagType) const
-{
-   std::ostringstream out;
-   out << std::setw(6)
-       << std::setfill(' ')
-       << std::setiosflags(std::ios::left)
-       << tagType;
-   memcpy(theTagType, out.str().c_str(), 6);
-   theTagType[6] = 0;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfUnknownTag.cpp b/ossim/src/ossim/support_data/ossimNitfUnknownTag.cpp
deleted file mode 100644
index a20099e..0000000
--- a/ossim/src/ossim/support_data/ossimNitfUnknownTag.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Unknown tag class declaration.
-//
-// Note: By "unknown" this means that the tag name was not found in any of
-// the tag factories.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimNitfUnknownTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ostream>
-#include <iomanip>
-#include <cctype> /* for isascii */
-
-#include <ossim/support_data/ossimNitfUnknownTag.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-
-RTTI_DEF1(ossimNitfUnknownTag, "ossimNitfUnknownTag", ossimNitfRegisteredTag);
-
-ossimNitfUnknownTag::ossimNitfUnknownTag()
-   : m_tagData(0)
-{
-}
-
-ossimNitfUnknownTag::~ossimNitfUnknownTag()
-{
-   if (m_tagData)
-   {
-      delete [] m_tagData;
-      m_tagData = 0;
-   }
-}
-
-void ossimNitfUnknownTag::parseStream(std::istream& in)
-{
-   if (m_tagLength)
-   {
-      if (m_tagData)
-      {
-         delete [] m_tagData;
-      }
-
-      m_tagData = new char[m_tagLength+1];
-      
-      in.read(m_tagData, m_tagLength);
-
-      m_tagData[m_tagLength] = '\0';
-   }
-}
-
-void ossimNitfUnknownTag::writeStream(std::ostream& out)
-{
-   if (m_tagLength && m_tagData)
-   {
-      out.write(m_tagData, m_tagLength);
-   }
-}
-
-void ossimNitfUnknownTag::clearFields()
-{
-   if (m_tagData)
-   {
-      delete [] m_tagData;
-      m_tagData = 0;
-   }
-}
-
-std::ostream& ossimNitfUnknownTag::print(std::ostream& out,
-                                         const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "unformatted_tag_data: ";
-   
-   if (tagDataIsAscii())
-   {
-      out << m_tagData << "\n";
-   }
-   else
-   {
-      out << "binary not displayed\n";
-   }
-   
-   return out;
-}
-
-void ossimNitfUnknownTag::setTagLength(ossim_uint32 length)
-{
-   if (m_tagData)
-   {
-      delete [] m_tagData;
-      m_tagData = 0;
-   }
-   m_tagLength = length;
-}
-
-bool ossimNitfUnknownTag::tagDataIsAscii() const
-{
-   if ( (m_tagLength == 0) || !m_tagData )
-   {
-      return false;
-   }
-
-   for (ossim_uint32 i = 0; i < m_tagLength; ++i)
-   {
-      int c = m_tagData[i];
-      if (isascii(c) == false)
-      {
-         return false;
-      }
-   }
-
-   return true;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfUse00aTag.cpp b/ossim/src/ossim/support_data/ossimNitfUse00aTag.cpp
deleted file mode 100644
index caca609..0000000
--- a/ossim/src/ossim/support_data/ossimNitfUse00aTag.cpp
+++ /dev/null
@@ -1,540 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Walt Bunch
-//
-// Description: Nitf support class for USE00A -
-// Exploitation Usability extension.
-// 
-//********************************************************************
-// $Id: ossimNitfUse00aTag.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <iomanip>
-#include <ossim/support_data/ossimNitfUse00aTag.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimCommon.h>
-
-RTTI_DEF1(ossimNitfUse00aTag, "ossimNitfUse00aTag", ossimNitfRegisteredTag);
-
-static const ossimString ANGLETONORTH_KW = "ANGLETONORTH";
-static const ossimString MEANGSD_KW = "MEANGSD";
-static const ossimString DYNAMICRANGE_KW = "DYNAMICRANGE";
-static const ossimString OBLANG_KW = "OBLANG";
-static const ossimString ROLLANG_KW = "ROLLANG";
-static const ossimString NREF_KW = "NREF";
-static const ossimString REVNUM_KW = "REVNUM";
-static const ossimString NSEG_KW = "NSEG";
-static const ossimString MAXLPSEG_KW = "MAXLPSEG";
-static const ossimString SUNEL_KW = "SUNEL";
-static const ossimString SUNAZ_KW = "SUNAZ";
-
-
-ossimNitfUse00aTag::ossimNitfUse00aTag()
-   : ossimNitfRegisteredTag(std::string("USE00A"), 107) 
-{
-   clearFields();
-}
-
-ossimNitfUse00aTag::~ossimNitfUse00aTag()
-{
-}
-
-void ossimNitfUse00aTag::parseStream(std::istream& in)
-{
-   clearFields();
-   
-   in.read(theAngleToNorth, ANGLE_TO_NORTH_SIZE);
-   in.read(theMeanGsd, MEAN_GSD_SIZE);
-   in.read(theField3, FIELD3_SIZE);
-   in.read(theDynamicRange, DYNAMIC_RANGE_SIZE);
-   in.read(theField5, FIELD5_SIZE);
-   in.read(theField6, FIELD6_SIZE);
-   in.read(theField7, FIELD7_SIZE);
-   in.read(theOblAng, OBL_ANG_SIZE);
-   in.read(theRollAng, ROLL_ANG_SIZE);
-   in.read(theField10, FIELD10_SIZE);
-   in.read(theField11, FIELD11_SIZE);
-   in.read(theField12, FIELD12_SIZE);
-   in.read(theField13, FIELD13_SIZE);
-   in.read(theField14, FIELD14_SIZE);
-   in.read(theField15, FIELD15_SIZE);
-   in.read(theField16, FIELD16_SIZE);
-   in.read(theNRef, N_REF_SIZE);
-   in.read(theRevNum, REV_NUM_SIZE);
-   in.read(theNSeg, N_SEG_SIZE);
-   in.read(theMaxLpSeg, MAX_LP_SEG_SIZE);
-   in.read(theField20, FIELD20_SIZE);
-   in.read(theField21, FIELD21_SIZE);
-   in.read(theSunEl, SUN_EL_SIZE);
-   in.read(theSunAz, SUN_AZ_SIZE);
-}
-
-void ossimNitfUse00aTag::writeStream(std::ostream& out)
-{
-   out.write(theAngleToNorth, ANGLE_TO_NORTH_SIZE);
-   out.write(theMeanGsd, MEAN_GSD_SIZE);
-   out.write(theField3, FIELD3_SIZE);
-   out.write(theDynamicRange, DYNAMIC_RANGE_SIZE);
-   out.write(theField5, FIELD5_SIZE);
-   out.write(theField6, FIELD6_SIZE);
-   out.write(theField7, FIELD7_SIZE);
-   out.write(theOblAng, OBL_ANG_SIZE);
-   out.write(theRollAng, ROLL_ANG_SIZE);
-   out.write(theField10, FIELD10_SIZE);
-   out.write(theField11, FIELD11_SIZE);
-   out.write(theField12, FIELD12_SIZE);
-   out.write(theField13, FIELD13_SIZE);
-   out.write(theField14, FIELD14_SIZE);
-   out.write(theField15, FIELD15_SIZE);
-   out.write(theField16, FIELD16_SIZE);
-   out.write(theNRef, N_REF_SIZE);
-   out.write(theRevNum, REV_NUM_SIZE);
-   out.write(theNSeg, N_SEG_SIZE);
-   out.write(theMaxLpSeg, MAX_LP_SEG_SIZE);
-   out.write(theField20, FIELD20_SIZE);
-   out.write(theField21, FIELD21_SIZE);
-   out.write(theSunEl, SUN_EL_SIZE);
-   out.write(theSunAz, SUN_AZ_SIZE);
-}
-
-void ossimNitfUse00aTag::clearFields()
-{
-   memset(theAngleToNorth, ' ', ANGLE_TO_NORTH_SIZE);
-   memset(theMeanGsd, ' ', MEAN_GSD_SIZE);
-   memset(theField3, ' ', FIELD3_SIZE);
-   memset(theDynamicRange, ' ', DYNAMIC_RANGE_SIZE);
-   memset(theField5, ' ', FIELD5_SIZE);
-   memset(theField6, ' ', FIELD6_SIZE);
-   memset(theField7, ' ', FIELD7_SIZE);
-   memset(theOblAng, ' ', OBL_ANG_SIZE);
-   memset(theRollAng, ' ', ROLL_ANG_SIZE);
-   memset(theField10, ' ', FIELD10_SIZE);
-   memset(theField11, ' ', FIELD11_SIZE);
-   memset(theField12, ' ', FIELD12_SIZE);
-   memset(theField13, ' ', FIELD13_SIZE);
-   memset(theField14, ' ', FIELD14_SIZE);
-   memset(theField15, ' ', FIELD15_SIZE);
-   memset(theField16, ' ', FIELD16_SIZE);
-   memset(theNRef, ' ', N_REF_SIZE);
-   memset(theRevNum, ' ', REV_NUM_SIZE);
-   memset(theNSeg, ' ', N_SEG_SIZE);
-   memset(theMaxLpSeg, ' ', MAX_LP_SEG_SIZE);
-   memset(theField20, ' ', FIELD20_SIZE);
-   memset(theField21, ' ', FIELD21_SIZE);
-   memset(theSunEl, ' ', SUN_EL_SIZE);
-   memset(theSunAz, ' ', SUN_AZ_SIZE);
-
-   theAngleToNorth[ANGLE_TO_NORTH_SIZE] = '\0';
-   theMeanGsd[MEAN_GSD_SIZE] = '\0';
-   theField3[FIELD3_SIZE] = '\0';
-   theDynamicRange[DYNAMIC_RANGE_SIZE] = '\0';
-   theField5[FIELD5_SIZE] = '\0';
-   theField6[FIELD6_SIZE] = '\0';
-   theField7[FIELD7_SIZE] = '\0';
-   theOblAng[OBL_ANG_SIZE] = '\0';
-   theRollAng[ROLL_ANG_SIZE] = '\0';
-   theField10[FIELD10_SIZE] = '\0';
-   theField11[FIELD11_SIZE] = '\0';
-   theField12[FIELD12_SIZE] = '\0';
-   theField13[FIELD13_SIZE] = '\0';
-   theField14[FIELD14_SIZE] = '\0';
-   theField15[FIELD15_SIZE] = '\0';
-   theField16[FIELD16_SIZE] = '\0';
-   theNRef[N_REF_SIZE] = '\0';
-   theRevNum[REV_NUM_SIZE] = '\0';
-   theNSeg[N_SEG_SIZE] = '\0';
-   theMaxLpSeg[MAX_LP_SEG_SIZE] = '\0';
-   theField20[FIELD20_SIZE] = '\0';
-   theField21[FIELD21_SIZE] = '\0';
-   theSunEl[SUN_EL_SIZE] = '\0';
-   theSunAz[SUN_AZ_SIZE] = '\0';
-}
-
-ossimString ossimNitfUse00aTag::getAngleToNorth()const
-{
-   return theAngleToNorth;
-}
-
-void ossimNitfUse00aTag::setAngleToNorth(const ossimString& angleToNorth)
-{
-   memset(theAngleToNorth, ' ', ANGLE_TO_NORTH_SIZE);
-   memcpy(theAngleToNorth, angleToNorth.c_str(), std::min((size_t)ANGLE_TO_NORTH_SIZE, angleToNorth.length()));
-}
-
-ossimString ossimNitfUse00aTag::getMeanGsd()const
-{
-   return theMeanGsd;
-}
-
-ossim_float64 ossimNitfUse00aTag::getMeanGsdInMeters() const
-{
-   ossim_float64 gsd = 0.0;
-   
-   ossimString s = theMeanGsd;
-   if (s.size())
-   {
-      ossim_float64 d = s.toFloat64();
-      if ( (d != 0.0) && (ossim::isnan(d) == false) )
-      {
-         gsd = d / 12.0 * MTRS_PER_FT;
-      }
-   }
-   
-   return gsd;
-}
-
-void ossimNitfUse00aTag::setMeanGsd(const ossimString& meanGsd)
-{
-   memset(theMeanGsd, ' ', MEAN_GSD_SIZE);
-   memcpy(theMeanGsd, meanGsd.c_str(), std::min((size_t)MEAN_GSD_SIZE, meanGsd.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField3()const
-{
-   return theField3;
-}
-
-void ossimNitfUse00aTag::setField3(const ossimString& field3)
-{
-   memset(theField3, ' ', FIELD3_SIZE);
-   memcpy(theField3, field3.c_str(), std::min((size_t)FIELD3_SIZE, field3.length()));
-}
-
-ossimString ossimNitfUse00aTag::getDynamicRange()const
-{
-   return theDynamicRange;
-}
-
-void ossimNitfUse00aTag::setDynamicRange(const ossimString& dynamicRange)
-{
-   memset(theDynamicRange, ' ', DYNAMIC_RANGE_SIZE);
-   memcpy(theDynamicRange, dynamicRange.c_str(), std::min((size_t)DYNAMIC_RANGE_SIZE, dynamicRange.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField5()const
-{
-   return theField5;
-}
-
-void ossimNitfUse00aTag::setField5(const ossimString& field5)
-{
-   memset(theField5, ' ', FIELD5_SIZE);
-   memcpy(theField5, field5.c_str(), std::min((size_t)FIELD5_SIZE, field5.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField6()const
-{
-   return theField6;
-}
-
-void ossimNitfUse00aTag::setField6(const ossimString& field6)
-{
-   memset(theField6, ' ', FIELD6_SIZE);
-   memcpy(theField6, field6.c_str(), std::min((size_t)FIELD6_SIZE, field6.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField7()const
-{
-   return theField7;
-}
-
-void ossimNitfUse00aTag::setField7(const ossimString& field7)
-{
-   memset(theField7, ' ', FIELD7_SIZE);
-   memcpy(theField7, field7.c_str(), std::min((size_t)FIELD7_SIZE, field7.length()));
-}
-
-ossimString ossimNitfUse00aTag::getOblAng()const
-{
-   return theOblAng;
-}
-
-void ossimNitfUse00aTag::setOblAng(const ossimString& oblAng)
-{
-   memset(theOblAng, ' ', OBL_ANG_SIZE);
-   memcpy(theOblAng, oblAng.c_str(), std::min((size_t)OBL_ANG_SIZE, oblAng.length()));
-}
-
-ossimString ossimNitfUse00aTag::getRollAng()const
-{
-   return theRollAng;
-}
-
-void ossimNitfUse00aTag::setRollAng(const ossimString& rollAng)
-{
-   memset(theRollAng, ' ', ROLL_ANG_SIZE);
-   memcpy(theRollAng, rollAng.c_str(), std::min((size_t)ROLL_ANG_SIZE, rollAng.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField10()const
-{
-   return theField10;
-}
-
-void ossimNitfUse00aTag::setField10(const ossimString& field10)
-{
-   memset(theField10, ' ', FIELD10_SIZE);
-   memcpy(theField10, field10.c_str(), std::min((size_t)FIELD10_SIZE, field10.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField11()const
-{
-   return theField11;
-}
-
-void ossimNitfUse00aTag::setField11(const ossimString& field11)
-{
-   memset(theField11, ' ', FIELD11_SIZE);
-   memcpy(theField11, field11.c_str(), std::min((size_t)FIELD11_SIZE, field11.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField12()const
-{
-   return theField12;
-}
-
-void ossimNitfUse00aTag::setField12(const ossimString& field12)
-{
-   memset(theField12, ' ', FIELD12_SIZE);
-   memcpy(theField12, field12.c_str(), std::min((size_t)FIELD12_SIZE, field12.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField13()const
-{
-   return theField13;
-}
-
-void ossimNitfUse00aTag::setField13(const ossimString& field13)
-{
-   memset(theField13, ' ', FIELD13_SIZE);
-   memcpy(theField13, field13.c_str(), std::min((size_t)FIELD13_SIZE, field13.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField14()const
-{
-   return theField14;
-}
-
-void ossimNitfUse00aTag::setField14(const ossimString& field14)
-{
-   memset(theField14, ' ', FIELD14_SIZE);
-   memcpy(theField14, field14.c_str(), std::min((size_t)FIELD14_SIZE, field14.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField15()const
-{
-   return theField15;
-}
-
-void ossimNitfUse00aTag::setField15(const ossimString& field15)
-{
-   memset(theField15, ' ', FIELD15_SIZE);
-   memcpy(theField15, field15.c_str(), std::min((size_t)FIELD15_SIZE, field15.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField16()const
-{
-   return theField16;
-}
-
-void ossimNitfUse00aTag::setField16(const ossimString& field16)
-{
-   memset(theField16, ' ', FIELD16_SIZE);
-   memcpy(theField16, field16.c_str(), std::min((size_t)FIELD16_SIZE, field16.length()));
-}
-
-ossimString ossimNitfUse00aTag::getNRef()const
-{
-   return theNRef;
-}
-
-void ossimNitfUse00aTag::setNRef(const ossimString& nRef)
-{
-   memset(theNRef, ' ', N_REF_SIZE);
-   memcpy(theNRef, nRef.c_str(), std::min((size_t)N_REF_SIZE, nRef.length()));
-}
-
-ossimString ossimNitfUse00aTag::getRevNum()const
-{
-   return theRevNum;
-}
-
-void ossimNitfUse00aTag::setRevNum(const ossimString& revNum)
-{
-   memset(theRevNum, ' ', REV_NUM_SIZE);
-   memcpy(theRevNum, revNum.c_str(), std::min((size_t)REV_NUM_SIZE, revNum.length()));
-}
-
-ossimString ossimNitfUse00aTag::getNSeg()const
-{
-   return theNSeg;
-}
-
-void ossimNitfUse00aTag::setNSeg(const ossimString& nSeg)
-{
-   memset(theNSeg, ' ', N_SEG_SIZE);
-   memcpy(theNSeg, nSeg.c_str(), std::min((size_t)N_SEG_SIZE, nSeg.length()));
-}
-
-ossimString ossimNitfUse00aTag::getMaxLpSeg()const
-{
-   return theMaxLpSeg;
-}
-
-void ossimNitfUse00aTag::setMaxLpSeg(const ossimString& maxLpSeg)
-{
-   memset(theMaxLpSeg, ' ', MAX_LP_SEG_SIZE);
-   memcpy(theMaxLpSeg, maxLpSeg.c_str(), std::min((size_t)MAX_LP_SEG_SIZE, maxLpSeg.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField20()const
-{
-   return theField20;
-}
-
-void ossimNitfUse00aTag::setField20(const ossimString& field20)
-{
-   memset(theField20, ' ', FIELD20_SIZE);
-   memcpy(theField20, field20.c_str(), std::min((size_t)FIELD20_SIZE, field20.length()));
-}
-
-ossimString ossimNitfUse00aTag::getField21()const
-{
-   return theField21;
-}
-
-void ossimNitfUse00aTag::setField21(const ossimString& field21)
-{
-   memset(theField21, ' ', FIELD21_SIZE);
-   memcpy(theField21, field21.c_str(), std::min((size_t)FIELD21_SIZE, field21.length()));
-}
-
-ossimString ossimNitfUse00aTag::getSunEl()const
-{
-   return theSunEl;
-}
-
-void ossimNitfUse00aTag::setSunEl(const ossimString& sunEl)
-{
-   memset(theSunEl, ' ', SUN_EL_SIZE);
-   memcpy(theSunEl, sunEl.c_str(), std::min((size_t)SUN_EL_SIZE, sunEl.length()));
-}
-
-ossimString ossimNitfUse00aTag::getSunAz()const
-{
-   return theSunAz;
-}
-
-void ossimNitfUse00aTag::setSunAz(const ossimString& sunAz)
-{
-   memset(theSunAz, ' ', SUN_AZ_SIZE);
-   memcpy(theSunAz, sunAz.c_str(), std::min((size_t)SUN_AZ_SIZE, sunAz.length()));
-}
-
-std::ostream& ossimNitfUse00aTag::print(std::ostream& out,
-                                        const std::string& prefix) const
-{
-   std::string pfx = prefix;
-   pfx += getTagName();
-   pfx += ".";
-
-   out << setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
-       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
-       << pfx << std::setw(24) << "ANGLETONORTH:" << theAngleToNorth << "\n" 
-       << pfx << std::setw(24) << "MEANGSD:"      << theMeanGsd << "\n"
-       << pfx << std::setw(24) << "DYNAMICRANGE:" << theDynamicRange << "\n"
-       << pfx << std::setw(24) << "OBLANG:"       << theOblAng << "\n"
-       << pfx << std::setw(24) << "ROLLANG:"      << theRollAng << "\n"
-       << pfx << std::setw(24) << "NREF:"         << theNRef << "\n"
-       << pfx << std::setw(24) << "REVNUM:"       << theRevNum << "\n"
-       << pfx << std::setw(24) << "NSEG:"         << theNSeg << "\n"
-       << pfx << std::setw(24) << "MAXLPSEG:"     << theMaxLpSeg << "\n"
-       << pfx << std::setw(24) << "SUNEL:"        << theSunEl << "\n"
-       << pfx << std::setw(24) << "SUNAZ:"        << theSunAz << "\n";
-
-   return out; 
-}
-   
-void ossimNitfUse00aTag::setProperty(ossimRefPtr<ossimProperty> property)
-{
-   ossimNitfRegisteredTag::setProperty(property);
-}
-
-ossimRefPtr<ossimProperty> ossimNitfUse00aTag::getProperty(const ossimString& name)const
-{
-   ossimProperty* result = 0;
-
-   if(name == ANGLETONORTH_KW)
-   {
-      result = new ossimStringProperty(name, theAngleToNorth);
-   }
-   else if(name == MEANGSD_KW)
-   {
-      result = new ossimStringProperty(name, theMeanGsd);
-   }
-   else if(name == DYNAMICRANGE_KW)
-   {
-      result = new ossimStringProperty(name, theDynamicRange);
-   }
-   else if(name == OBLANG_KW)
-   {
-      result = new ossimStringProperty(name, theOblAng);
-   }
-   else if(name == ROLLANG_KW)
-   {
-      result = new ossimStringProperty(name, theRollAng);
-   }
-   else if(name == NREF_KW)
-   {
-      result = new ossimStringProperty(name, theNRef);
-   }
-   else if(name == REVNUM_KW)
-   {
-      result = new ossimStringProperty(name, theRevNum);
-   }
-   else if(name == NSEG_KW)
-   {
-      result = new ossimStringProperty(name, theNSeg);
-   }
-   else if(name == MAXLPSEG_KW)
-   {
-      result = new ossimStringProperty(name, theMaxLpSeg);
-   }
-   else if(name == SUNEL_KW)
-   {
-      result = new ossimStringProperty(name, theSunEl);
-   }
-   else if(name == SUNAZ_KW)
-   {
-      result = new ossimStringProperty(name, theSunAz);
-   }
-   else
-   {
-      return ossimNitfRegisteredTag::getProperty(name);
-   }
-
-   return result;
-}
-
-void ossimNitfUse00aTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
-{
-   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
-
-   propertyNames.push_back(ANGLETONORTH_KW);
-   propertyNames.push_back(MEANGSD_KW);
-   propertyNames.push_back(DYNAMICRANGE_KW);
-   propertyNames.push_back(OBLANG_KW);
-   propertyNames.push_back(ROLLANG_KW);
-   propertyNames.push_back(NREF_KW);
-   propertyNames.push_back(REVNUM_KW);
-   propertyNames.push_back(NSEG_KW);
-   propertyNames.push_back(MAXLPSEG_KW);
-   propertyNames.push_back(SUNEL_KW);
-   propertyNames.push_back(SUNAZ_KW);
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNitfVqCompressionHeader.cpp b/ossim/src/ossim/support_data/ossimNitfVqCompressionHeader.cpp
deleted file mode 100644
index ba45465..0000000
--- a/ossim/src/ossim/support_data/ossimNitfVqCompressionHeader.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2004 Garrett Potts
-//
-// LICENSE: MIT see top level LICENSE.txt for more details
-// 
-// Author: Garrett Potts
-// Description: Nitf support class
-// 
-//********************************************************************
-// $Id: ossimNitfVqCompressionHeader.cpp 23666 2015-12-14 20:01:22Z rashadkm $
-
-#include <iostream>
-#include <sstream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-RTTI_DEF1(ossimNitfVqCompressionHeader, "ossimNitfVqCompressionHeader", ossimNitfCompressionHeader);
-
-#if 0
-std::ostream& operator<<(std::ostream& out,
-                         const ossimNitfVqCompressionOffsetTableData& data)
-{
-   out << "theTableId:                              " << data.theTableId << std::endl
-       << "theNumberOfCompressionLookupRecords:     " << data.theNumberOfCompressionLookupRecords << std::endl
-       << "theNumberOfValuesPerCompressionLookup:   " << data.theNumberOfValuesPerCompressionLookup << std::endl
-       << "theCompressionLookupValueBitLength:      " << data.theCompressionLookupValueBitLength<< std::endl
-       << "theCompressionLookupTableOffset:         " << data.theCompressionLookupTableOffset;
-
-   return out;
-}
-#endif
-
-
-ossimNitfVqCompressionOffsetTableData::ossimNitfVqCompressionOffsetTableData()
-      :theData(NULL)
-{
-   clearFields();
-}
-
-ossimNitfVqCompressionOffsetTableData::ossimNitfVqCompressionOffsetTableData(const ossimNitfVqCompressionOffsetTableData& rhs)
-      :theTableId(rhs.theTableId),
-       theNumberOfCompressionLookupRecords(rhs.theNumberOfCompressionLookupRecords),
-       theNumberOfValuesPerCompressionLookup(rhs.theNumberOfValuesPerCompressionLookup),
-       theCompressionLookupValueBitLength(rhs.theCompressionLookupValueBitLength),
-       theCompressionLookupTableOffset(rhs.theCompressionLookupTableOffset),
-       theData(NULL)
-
-{
-   ossim_uint32 size = (theNumberOfValuesPerCompressionLookup*
-                        theNumberOfCompressionLookupRecords*
-                        theCompressionLookupValueBitLength)/8;
-   if(size > 0)
-   {
-      theData = new unsigned char[size];
-      if(rhs.theData)
-      {
-         memcpy(theData, rhs.theData, size);
-      }
-   }
-}
-
-ossimNitfVqCompressionOffsetTableData::~ossimNitfVqCompressionOffsetTableData()
-{
-   if(theData)
-   {
-      delete [] theData;
-      theData = NULL;
-   }
-}
-
-const ossimNitfVqCompressionOffsetTableData& ossimNitfVqCompressionOffsetTableData::operator =(const ossimNitfVqCompressionOffsetTableData& rhs)
-{
-   if(this != &rhs)
-   {
-      if(theData)
-      {
-         delete [] theData;
-         theData = NULL;
-      }
-
-      theTableId                            = rhs.theTableId;
-      theNumberOfCompressionLookupRecords   = rhs.theNumberOfCompressionLookupRecords;
-      theCompressionLookupValueBitLength    = rhs.theCompressionLookupValueBitLength;
-      theNumberOfValuesPerCompressionLookup = rhs.theNumberOfValuesPerCompressionLookup;
-      theCompressionLookupTableOffset       = rhs.theCompressionLookupTableOffset;
-      
-      if(rhs.theData)
-      {
-         ossim_uint32 size = (theNumberOfValuesPerCompressionLookup*
-                              theNumberOfCompressionLookupRecords*
-                              theCompressionLookupValueBitLength)/8;
-         if(size > 0)
-         {
-            theData = new unsigned char[size];
-            memcpy(theData, rhs.theData, size);
-         }
-      }
-   }
-   
-   return *this;
-   
-}
-ossim_uint32 ossimNitfVqCompressionOffsetTableData::getDataLengthInBytes()const
-{
-   return (theNumberOfValuesPerCompressionLookup*
-           theNumberOfCompressionLookupRecords*
-           theCompressionLookupValueBitLength)/8;
-}
-
-void ossimNitfVqCompressionOffsetTableData::parseStream(std::istream& in)
-{
-   ossimEndian endian;
-   in.read((char*)(&theTableId), 2);
-   in.read((char*)(&theNumberOfCompressionLookupRecords),4);
-   in.read((char*)(&theNumberOfValuesPerCompressionLookup), 2);
-   in.read((char*)(&theCompressionLookupValueBitLength),2);
-   in.read((char*)(&theCompressionLookupTableOffset), 4);
-
-   if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-   {
-      endian.swap(theTableId);
-      endian.swap(theNumberOfCompressionLookupRecords);
-      endian.swap(theNumberOfValuesPerCompressionLookup);
-      endian.swap(theCompressionLookupValueBitLength);
-      endian.swap(theCompressionLookupTableOffset);
-   }
-}
-
-void ossimNitfVqCompressionOffsetTableData::clearFields()
-{
-   theTableId = 0;
-   theNumberOfCompressionLookupRecords = 0;
-   theNumberOfValuesPerCompressionLookup = 0;
-   theCompressionLookupValueBitLength = 0;
-   theCompressionLookupTableOffset = 0;
-
-   if(theData)
-   {
-      delete [] theData;
-      theData = NULL;
-   }
-}
-
-ossimNitfVqCompressionHeader::ossimNitfVqCompressionHeader()
-{
-   clearFields();
-}
-
-void ossimNitfVqCompressionHeader::parseStream(std::istream &in)
-{
-   ossimEndian endian;
-
-   in.read((char*)(&theNumberOfImageRows), 4);
-   in.read((char*)(&theNumberOfImageCodesPerRow), 4);
-   in.read((char*)(&theImageCodeBitLength), 1);
-   in.read((char*)(&theCompressionAlgorithmId), 2);
-
-   in.read((char*)(&theNumberOfCompressionLookupOffsetRecords), 2);
-   in.read((char*)(&theNumberOfCompressionParameterOffsetRecords), 2);
-   in.read((char*)(&theCompressionLookupOffsetTableOffset), 4);
-   in.read((char*)(&theCompressionLookupTableOffsetRecordLength), 2);
-   
-   if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
-   {
-      endian.swap(theNumberOfImageRows);
-      endian.swap(theNumberOfImageCodesPerRow);
-      endian.swap(theCompressionAlgorithmId);
-      endian.swap(theNumberOfCompressionLookupOffsetRecords);
-      endian.swap(theNumberOfCompressionParameterOffsetRecords);
-      endian.swap(theCompressionLookupOffsetTableOffset);
-      endian.swap(theCompressionLookupTableOffsetRecordLength);
-   }
-   
-   if((theNumberOfCompressionLookupOffsetRecords > 0)&&
-      (theCompressionAlgorithmId == 1)) 
-   {
-      theTable.clear();
-      theTable.resize(theNumberOfCompressionLookupOffsetRecords);
-
-      ossim_uint32 idx = 0;
-
-      for(idx = 0; idx < theNumberOfCompressionLookupOffsetRecords; ++idx)
-      {
-         theTable[idx].parseStream(in);
-      }
-      for(idx = 0; idx < theTable.size(); ++idx)
-      {
-         if(theTable[idx].theData)
-         {
-            delete [] theTable[idx].theData;
-            theTable[idx].theData = 0;
-         }
-         if(theTable[idx].getDataLengthInBytes()>0)
-         {
-            theTable[idx].theData = new ossim_uint8[theTable[idx].getDataLengthInBytes()];
-            in.read((char*)(theTable[idx].theData), theTable[idx].getDataLengthInBytes());
-         }
-      }
-   }
-}
-
-std::ostream& ossimNitfVqCompressionHeader::print(std::ostream& out) const
-{
-   return this->print(out, std::string(""));
-}
-
-std::ostream& ossimNitfVqCompressionHeader::print(
-   std::ostream& out, const std::string& prefix ) const
-{
-   std::string pfx = prefix;
-   pfx += "vq_header.";
-
-   out << std::setiosflags(std::ios::left)
-       << pfx << std::setw(24) << "image_rows:"
-       << theNumberOfImageRows << "\n"
-       << pfx << std::setw(24) << "codes_per_row:"
-       << theNumberOfImageCodesPerRow << "\n"
-       << pfx << std::setw(24) << "codebit_length:"
-       << (ossim_uint32)theImageCodeBitLength << "\n"
-       << pfx << std::setw(24) << "algorithm_id:"
-       << theCompressionAlgorithmId << "\n"
-       << pfx << std::setw(24)
-       << "offset_records:"
-       << theNumberOfCompressionLookupOffsetRecords << "\n"
-       << pfx << std::setw(24)
-       << "offset_record_length:"
-       << theCompressionLookupTableOffsetRecordLength << "\n";
-
-   if(theTable.size() > 0)
-   {
-      for(ossim_uint32 idx = 0; idx < theTable.size()-1; ++idx)
-      {
-         std::string tblPfx = pfx;
-         tblPfx += "table";
-         tblPfx += ossimString::toString(idx).string();
-         tblPfx += ".";
-
-         out << tblPfx << std::setw(24) << "id:"
-             << theTable[idx].theTableId << "\n"
-             << tblPfx << std::setw(24) << "lookup_records:"
-             << theTable[idx].theNumberOfCompressionLookupRecords << "\n"
-             << tblPfx << std::setw(24) << "values_per_lookup:"
-             << theTable[idx].theNumberOfValuesPerCompressionLookup << "\n"
-             << tblPfx << std::setw(24) << "lookup_bit_length:"
-             << theTable[idx].theCompressionLookupValueBitLength << "\n"
-             << tblPfx << std::setw(24) << "lookup_table_offset:"
-             << theTable[idx].theCompressionLookupTableOffset << "\n";
-      }
-
-   }
-
-   return out;
-}
-
-bool ossimNitfVqCompressionHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
-{
-   bool result = ossimNitfCompressionHeader::saveState(kwl, prefix);
-   
-   if(result)
-   {
-      std::ostringstream out;
-      
-      out << std::setiosflags(std::ios::left)
-      << "image_rows:" << theNumberOfImageRows << "\n"
-      << "codes_per_row:" << theNumberOfImageCodesPerRow << "\n"
-      << "codebit_length:" << (ossim_uint32)theImageCodeBitLength << "\n"
-      << "algorithm_id:" << theCompressionAlgorithmId << "\n"
-      << "offset_records:" << theNumberOfCompressionLookupOffsetRecords << "\n"
-      << "offset_record_length:" << theCompressionLookupTableOffsetRecordLength << "\n";
-      
-      if(theTable.size() > 0)
-      {
-         for(ossim_uint32 idx = 0; idx < theTable.size()-1; ++idx)
-         {
-            std::string tblPfx = "table";
-            tblPfx += ossimString::toString(idx).string();
-            tblPfx += ".";
-            
-            out << tblPfx<< "id:"
-            << theTable[idx].theTableId << "\n"
-            << tblPfx << "lookup_records:"<< theTable[idx].theNumberOfCompressionLookupRecords << "\n"
-            << tblPfx <<"values_per_lookup:"<< theTable[idx].theNumberOfValuesPerCompressionLookup << "\n"
-            << tblPfx << "lookup_bit_length:"<< theTable[idx].theCompressionLookupValueBitLength << "\n"
-            << tblPfx << "lookup_table_offset:"<< theTable[idx].theCompressionLookupTableOffset << "\n";
-         }
-      }
-      ossimKeywordlist kwlTemp;
-      
-      std::istringstream in(out.str());
-      if(kwlTemp.parseStream(in))
-      {
-         kwl.add(prefix, kwlTemp);
-      }
-   }
-   
-   return result;
-}
-
-ossim_uint32 ossimNitfVqCompressionHeader::getBlockSizeInBytes()const
-{
-   return (getNumberOfImageRows()*
-           getNumberOfImageCodesPerRow()*
-           getImageCodeBitLength())/8;
-}
-
-ossim_uint32 ossimNitfVqCompressionHeader::getNumberOfImageRows()const
-{
-   return theNumberOfImageRows;
-}
-
-ossim_uint32 ossimNitfVqCompressionHeader::getNumberOfImageCodesPerRow()const
-{
-   return theNumberOfImageCodesPerRow;
-}
-
-ossim_uint32 ossimNitfVqCompressionHeader::getCompressionAlgorithmId()const
-{
-   return theCompressionAlgorithmId;
-}
-
-ossim_uint32 ossimNitfVqCompressionHeader::getImageCodeBitLength()const
-{
-   return theImageCodeBitLength;
-}
-
-ossim_uint32 ossimNitfVqCompressionHeader::getNumberOfTables()const
-{
-   return (ossim_uint32)theTable.size();
-}
-
-const std::vector<ossimNitfVqCompressionOffsetTableData>& ossimNitfVqCompressionHeader::getTable()const
-{
-   return theTable;
-}
-
-void ossimNitfVqCompressionHeader::clearFields()
-{
-   theNumberOfImageRows                        = 0;
-   theNumberOfImageCodesPerRow                 = 0;
-   theImageCodeBitLength                       = 0;
-   theCompressionAlgorithmId                   = 0;
-   theNumberOfCompressionLookupOffsetRecords   = 0;
-   theCompressionLookupTableOffsetRecordLength = 0;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimNmeaMessage.cpp b/ossim/src/ossim/support_data/ossimNmeaMessage.cpp
deleted file mode 100644
index 47222f6..0000000
--- a/ossim/src/ossim/support_data/ossimNmeaMessage.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-//
-// File: ossimNmeaMessage.h
-//
-// Author:  Garrett Potts
-//
-// Description: Contains a general parser for NMEA messages.
-//
-//
-// $Id$
-//----------------------------------------------------------------------------
-#include <ossim/support_data/ossimNmeaMessage.h>
-#include <ossim/base/ossimCommon.h>
-#include <iomanip>
-
-ossim_uint32 ossimNmeaMessage::checksum(std::string::const_iterator start, std::string::const_iterator end)
-{
-   ossim_uint32 sum = 0;
-   
-   while(start!=end&&((*start)!='*'))
-   {
-      sum ^= ((*start)%128);
-      ++start;
-   }
-   return sum;
-}
-
-void ossimNmeaMessage::setFields(std::string::const_iterator start, std::string::const_iterator end)
-{
-   m_fields.clear();
-   ossim_uint32 idx = 0;
-   while(start != end)
-   {
-      m_fields.push_back("");
-      
-      while((start!=end)&&
-            (*start!=','))
-      {
-         m_fields[idx]+=*start;
-         ++start;
-      }
-      
-      if(start!=end)
-      {
-         ++start;
-      }
-      ++idx;
-   }
-}
-
-bool ossimNmeaMessage::isValidStartChar(char c)const
-{
-   std::string::const_iterator iter = std::find(m_startChars.begin(), m_startChars.end(), c);
-   return (iter != m_startChars.end());
-}
-
-
-void ossimNmeaMessage::parseMessage(std::istream& in)throw(ossimException)
-{
-   ossim::skipws(in);
-   m_validCheckSum = false;
-   m_message = "";
-   if(!isValidStartChar(static_cast<char>(in.peek())))
-   {
-      throw ossimException(ossimString("Starting NMEA messsage indicator not found, expected one of ") +
-                           m_startChars + " but found " +
-                           ossimString((char)in.peek()));
-   }
-   
-   char c = static_cast<char>(in.get());
-   while(((c!='\n')&&(c!='\r'))&&
-         !in.eof()&&!in.bad()) 
-   {
-      m_message += c;
-      c = static_cast<char>(in.get());
-   }
-   std::string::iterator iter = std::find(m_message.begin(), m_message.end(), '*');
-   
-   if(iter != m_message.end())
-   {
-      setFields(m_message.begin()+1, m_message.end());
-      ossim_uint32 check = checksum(m_message.begin()+1, iter);
-      std::ostringstream out;
-      out << std::setw(2) << std::setfill('0') << std::hex << check;
-      std::string::iterator endChecksumIter = iter+1;
-      while((endChecksumIter!= m_message.end())&&(*endChecksumIter!=',')) ++endChecksumIter;
-      if(out.str() == ossimString(iter+1, endChecksumIter).downcase()) 
-      {
-         m_validCheckSum = true;
-      }
-   }
-   else
-   {
-      throw ossimException("Terminating * indicator for cbecksum not found in NMEA message format");
-   }
-}
-
diff --git a/ossim/src/ossim/support_data/ossimQuickbirdMetaData.cpp b/ossim/src/ossim/support_data/ossimQuickbirdMetaData.cpp
deleted file mode 100644
index 05b0b40..0000000
--- a/ossim/src/ossim/support_data/ossimQuickbirdMetaData.cpp
+++ /dev/null
@@ -1,819 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Description:
-// 
-// Class definition for ossimQuickbirdMetaData.
-// 
-// This class parses a Space Imaging Quickbird meta data file.
-//
-//********************************************************************
-// $Id: ossimQuickbirdMetaData.cpp 14431 2009-04-30 21:58:33Z dburken $
-
-#include <ossim/support_data/ossimQuickbirdMetaData.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimTrace.h>
-#include <cstdio>
-#include <iostream>
-
-
-RTTI_DEF1(ossimQuickbirdMetaData, "ossimQuickbirdMetaData", ossimObject);
- 
-// Define Trace flags for use within this file:
-static ossimTrace traceExec  ("ossimQuickbirdMetaData:exec");
-static ossimTrace traceDebug ("ossimQuickbirdMetaData:debug");
-
-ossimQuickbirdMetaData::ossimQuickbirdMetaData()
-   :
-   theGenerationDate("Unknown"),
-   theBandId("Unknown"),
-   theBitsPerPixel(0),
-   theSatID("Unknown"),
-   theTLCDate("Unknown"),
-   theSunAzimuth(0.0),
-   theSunElevation(0.0),
-   theSatAzimuth(0.0),
-   theSatElevation(0.0),
-   theTDILevel(0),
-   theAbsCalFactors(),
-   theBandNameList("Unknown"),
-   theImageSize()
-{
-   theImageSize.makeNan();
-   theAbsCalFactors.clear();
-}
-
-ossimQuickbirdMetaData::~ossimQuickbirdMetaData()
-{
-}
-
-bool ossimQuickbirdMetaData::open(const ossimFilename& imageFile)
-{
-   static const char MODULE[] = "ossimQuickbirdMetaData::open";
-
-   clearFields();
-
-   //retrieve information from the metadata file
-   //if the Quickbird tif is 02APR01105228-M1BS-000000128955_01_P001.TIF
-   //the metadata file will be 02APR01105228-M1BS-000000128955_01_P001.IMD
-
-   ossimFilename metadatafile = imageFile;
-   metadatafile.setExtension(ossimString("IMD"));
-
-   if( parseMetaData(metadatafile) == false )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-	    << MODULE << " errors parsing metadata" << std::endl;
-      }
-      return false;
-   }
-
-   return true;
-}
-
-void ossimQuickbirdMetaData::clearFields()
-{
-   theGenerationDate = "Unknown";
-   theBitsPerPixel = 0;
-   theBandId = "Unknown";
-   theSatID = "Unknown";
-   theTLCDate = "Unknown";
-   theSunAzimuth = 0.0;
-   theSunElevation = 0.0;
-   theSatAzimuth = 0.0;
-   theSatElevation = 0.0;
-   theTDILevel = 0;
-   theAbsCalFactors.clear();
-   theBandNameList = "Unknown";
-   theImageSize.makeNan();
-}
-
-std::ostream& ossimQuickbirdMetaData::print(std::ostream& out) const
-{
-
-   out << "\n----------------- Info on Quickbird Image -------------------"
-       << "\n  "
-       << "\n  Generation date:    " << theGenerationDate
-       << "\n  Band Id:            " << theBandId
-       << "\n  Bits per pixel:     " << theBitsPerPixel
-       << "\n  Sat Id:             " << theSatID
-       << "\n  TLC date:           " << theTLCDate
-       << "\n  Sun Azimuth:        " << theSunAzimuth
-       << "\n  Sun Elevation:      " << theSunElevation
-       << "\n  Sat Azimuth:        " << theSatAzimuth
-       << "\n  Sat Elevation:      " << theSatElevation
-       << "\n  Band name list:     " << theBandNameList
-       << "\n  TDI Level:          " << theTDILevel
-       << "\n  abs Calibration Factors:   " 
-       << std::endl;
-   for(unsigned int i=0; i<theAbsCalFactors.size(); i++)
-   {
-      out<<theAbsCalFactors[i] << "   ";
-   }
-   out << "\n  Image Size:         " << theImageSize
-       << "n"
-       << "\n---------------------------------------------------------"
-       << "\n  " << std::endl;
-   return out;
-}
-
-bool ossimQuickbirdMetaData::saveState(ossimKeywordlist& kwl,
-				       const char* prefix)const
-{
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           "ossimQuickbirdMetaData",
-           true);
-
-   kwl.add(prefix,
-           "generation_date",
-           theGenerationDate,
-           true);
-
-   kwl.add(prefix,
-           "bits_per_pixel",
-           theBitsPerPixel,
-           true);
-
-   kwl.add(prefix,
-           "band_id",
-           theBandId,
-           true);
-
-   kwl.add(prefix,
-           "sat_id",
-           theSatID,
-           true);
-
-   kwl.add(prefix,
-           "tlc_date",
-           theTLCDate,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::AZIMUTH_ANGLE_KW,
-           theSunAzimuth,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::ELEVATION_ANGLE_KW,
-           theSunElevation,
-           true);
-
-   kwl.add(prefix,
-           "sat_azimuth_angle",
-           theSatAzimuth,
-           true);
-
-   kwl.add(prefix,
-           "sat_elevation_angle",
-           theSatElevation,
-           true);
-          
-   kwl.add(prefix,
-           "TDI_level",
-           theTDILevel,
-           true);
-   kwl.add(prefix,
-           "band_name_list",
-           theBandNameList,
-           true);
-
-   if( theBandId=="Multi" )
-   {
-      std::vector<ossimString> bandNameList = theBandNameList.split(" ");
-      for(unsigned int i = 0 ; i < bandNameList.size(); ++i)
-      {
-         kwl.add(prefix,
-                 bandNameList[i] + "_band_absCalFactor",
-                 theAbsCalFactors[i],
-                 true);
-      }
-   }
-   else if(!theAbsCalFactors.empty())
-   {
-      kwl.add(prefix,
-              "absCalFactor",
-              theAbsCalFactors[0],
-              true);  	
-   }
-
-   return true;
-}
-
-bool ossimQuickbirdMetaData::loadState(const ossimKeywordlist& kwl,
-				       const char* prefix)
-{
-   clearFields();
-
-   const char* lookup = 0;
-   ossimString s;
-  
-   lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      if(s != "ossimQuickbirdMetaData")
-      {
-         return false;
-      }
-   }
-
-   lookup = kwl.find(prefix, "generation_date");
-   if (lookup)
-   {
-      theGenerationDate = lookup;
-   }
-
-   lookup = kwl.find(prefix, "band_id");
-   if (lookup)
-   {
-      theBandId = lookup;
-   }
-  
-   lookup = kwl.find(prefix, "bits_per_pixel");
-   if (lookup)
-   {
-      s = lookup;
-      theBitsPerPixel = s.toInt();;
-   }
-    
-   lookup = kwl.find(prefix, "sat_id");
-   if (lookup)
-   {
-      theSatID = lookup;
-   }
-
-   lookup = kwl.find(prefix, "tlc_date");
-   if (lookup)
-   {
-      theTLCDate= lookup;
-   }
-
-   lookup = kwl.find(prefix, "TDI_level");
-   if (lookup)
-   {
-      s = lookup;
-      theTDILevel = s.toInt();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      theSunAzimuth = s.toFloat64();
-   }
-
-   lookup = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      theSunElevation = s.toFloat64();
-   }
-
-   lookup = kwl.find(prefix, "sat_azimuth_angle");
-   if (lookup)
-   {
-      s = lookup;
-      theSatAzimuth = s.toFloat64();
-   }
-
-   lookup = kwl.find(prefix, "sat_elevation_angle");
-   if (lookup)
-   {
-      s = lookup;
-      theSatElevation = s.toFloat64();
-   }
-
-   lookup = kwl.find(prefix, "band_name_list");
-   if (lookup)
-   {
-      theBandNameList= lookup;
-   }
-
-   if(theBandId=="Multi")
-   {
-      std::vector<ossimString> bandNameList = theBandNameList.split(" ");
-      theAbsCalFactors = std::vector<double>(bandNameList.size(), 1.);
-      for(unsigned int i = 0 ; i < bandNameList.size() ; ++i)
-      {
-         lookup = kwl.find(prefix, bandNameList[i] + "_band_absCalFactor");
-         if (lookup)
-         {
-            s = lookup;
-            theAbsCalFactors[i] = s.toDouble();
-         }
-      }
-   }
-   else if (theBandId=="P")
-   {
-      theAbsCalFactors = std::vector<double>(1, 1.);
-      lookup = kwl.find(prefix, "absCalFactor");
-      if (lookup)
-      {
-         s = lookup;
-         theAbsCalFactors[0] = s.toDouble();
-      }	
-   }
-   return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimQuickbirdMetaData::parseMetaData()
-//
-//  Parses the Quickbird IMD file.
-//
-//*****************************************************************************
-bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
-{
-   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimQuickbirdMetaData::parseMetaData(data_file): entering..." << std::endl;
-   
-   if( !data_file.exists() )
-   {
-      if (traceExec()) ossimNotify(ossimNotifyLevel_WARN) << "ossimQuickbirdMetaData::parseMetaData(data_file) WARN:" << "\nmetadate data file <" << data_file << ">. " << "doesn't exist..." << std::endl;
-      return false;
-   }
-  
-
-   FILE* fptr = fopen (data_file, "r");
-   if (!fptr)
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-	    << "ossimQuickbirdRpcModel::parseMetaData(data_file) DEBUG:"
-	    << "\nCould not open Meta data file:  " << data_file
-	    << "\nreturning with error..." << std::endl;
-      }
-      return false;
-   }
-
-   char* strptr(NULL);
-
-   //---
-   // Read the file into a buffer:
-   //---
-   ossim_int32 fileSize = static_cast<ossim_int32>(data_file.fileSize());
-   char* filebuf = new char[fileSize];
-   fread(filebuf, 1, fileSize, fptr);
-   strptr = filebuf;
-   fclose(fptr);
-   ossimString temp;
-
-   //---
-   // Generation time:
-   //---
-  
-   if(getEndOfLine( strptr, ossimString("\ngenerationTime ="), "%17c %s", temp))
-      theGenerationDate = ossimString(temp).before(";");
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-	    << "\n\tAborting construction. Error encountered parsing "
-	    << "presumed meta-data file." << std::endl;
-
-         delete [] filebuf;
-         return false;
-      }
-   }
-
-   // Number of rows and columns in full image:
-   if(getEndOfLine( strptr, ossimString("\nnumRows ="), "%10c %s", temp))
-      theImageSize.line = ossimString(temp).before("\";").toInt();
-
-   if(getEndOfLine( strptr, ossimString("\nnumColumns ="), "%13c %s", temp))
-      theImageSize.samp = ossimString(temp).before("\";").toInt();
-
-   //---
-   // BandId:
-   //---
-   if(getEndOfLine( strptr, ossimString("\nbandId ="), "%9c %s", temp))
-      theBandId = ossimString(temp).after("\"").before("\";");
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-	    << "\n\tAborting construction. Error encountered parsing "
-	    << "presumed meta-data file." << std::endl;
-
-         delete [] filebuf;
-         return false;
-      }
-   }
-    
-  
-   //---
-   // BitsPerPixel:
-   //---
-   if(getEndOfLine( strptr, ossimString("\nbitsPerPixel = "), "%16c %s", temp))
-      theBitsPerPixel = ossimString(temp).before(";").toInt();
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-	    << "\n\tAborting construction. Error encountered parsing "
-	    << "presumed meta-data file." << std::endl;
-
-         delete [] filebuf;
-         return false;
-      }
-   }
-     
-   //---
-   // absCalFactors:
-   //---
-
-   char *iter = (char *)filebuf;
-   unsigned int nbBand = 0;
-   theBandNameList = "";
-   for(iter = strstr(iter, "BEGIN_GROUP = BAND_"); iter ; iter = strstr(iter, "BEGIN_GROUP = BAND_"))
-   {
-      ++nbBand;
-      char dummy[80], nameChar[80];
-      sscanf(iter, "%19c %s", dummy, nameChar);
-      ossimString bandCur = ossimString(nameChar).before("\n");
-      theBandNameList = theBandNameList + bandCur + " ";
-      ++iter;
-   }
-   theBandNameList.trim();
-   
-   //--- Multispectral
-   if(theBandId=="Multi")
-   {
-      std::vector<ossimString> bandList;
-      bandList = theBandNameList.split(" ");
-      theAbsCalFactors = std::vector<double>(bandList.size(), 1.);
-      for(unsigned int j=0; j<bandList.size(); j++)
-      {
-         ossimString begin_group = "BEGIN_GROUP = BAND_" + bandList[j];
-         strptr = strstr(filebuf, begin_group.c_str());
-         if(!strptr && traceDebug())
-         {	  				
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-            delete [] filebuf;
-            return false;
-         }
-         else
-         {
-            char dummy[80], nameChar[80];
-            sscanf(strptr, "%19c %s", dummy, nameChar);
-            ossimString bandCur = ossimString(nameChar).before("\n");
-            if(!strptr && traceDebug())
-            {	  				
-               ossimNotify(ossimNotifyLevel_FATAL)
-                  << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-                  << "\n\tAborting construction. Error encountered parsing "
-                  << "presumed meta-data file." << std::endl;
-               delete [] filebuf;
-               return false;
-            }
-            else
-            {
-               if(bandList[j] == bandCur)
-               {
-                  strptr = strstr(strptr, "\tabsCalFactor = ");
-                  sscanf(strptr, "%16c %s", dummy, nameChar);
-                  theAbsCalFactors[j] = ossimString(nameChar).before(";").toDouble();
-               }
-            }
-         }
-      }
-   }
-   //--- Panchromatic
-   else
-   {
-      theAbsCalFactors = std::vector<double>(1, 1.);
-      if(getEndOfLine( strptr, ossimString("\tabsCalFactor = "), "%16c %s", temp))
-         theAbsCalFactors[0] = ossimString(temp).before(";").toDouble();
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-    
-   //---
-   // SatID:
-   //---
-   if(getEndOfLine( strptr, ossimString("\n\tsatId ="), "%9c %s", temp))
-      theSatID = ossimString(temp).after("\"").before("\";");
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-	    << "\n\tAborting construction. Error encountered parsing "
-	    << "presumed meta-data file." << std::endl;
-
-         delete [] filebuf;
-         return false;
-      }
-   }
-
-   //---
-   // TLCTime:
-   //---
-   if(getEndOfLine( strptr, ossimString("\n\tTLCTime ="), "%11c %s", temp))
-      theTLCDate = ossimString(temp).before("\";");
-   else
-   {
-      if(getEndOfLine( strptr, ossimString("\n\tfirstLineTime ="), "%17c %s", temp))
-         theTLCDate = ossimString(temp).before("\";");
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-   
-   //---
-   // Sun Azimuth:
-   //---
-   if(getEndOfLine( strptr, ossimString("\n\tsunAz ="), "%9c %s", temp))
-        theSunAzimuth = ossimString(temp).before(";").toFloat64();
-   else
-   {
-      if(getEndOfLine( strptr, ossimString("\n\tmeanSunAz ="), "%13c %s", temp))
-         theSunAzimuth = ossimString(temp).before(";").toFloat64();
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-
-   //---
-   // Sun Elevation:
-   //---
-   if(getEndOfLine( filebuf, ossimString("\n\tsunEl ="), "%9c %s", temp))
-        theSunElevation = ossimString(temp).before(";").toFloat64();
-   else
-   {
-      if(getEndOfLine( filebuf, ossimString("\n\tmeanSunEl ="), "%13c %s", temp))
-         theSunElevation = ossimString(temp).before(";").toFloat64();
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-
-   //---
-   // Sun Azimuth:
-   //---
-   if(getEndOfLine( strptr, ossimString("\n\tsunAz ="), "%9c %s", temp))
-      theSunAzimuth = ossimString(temp).before(";").toFloat64();
-   else
-   {
-      if(getEndOfLine( strptr, ossimString("\n\tmeanSunAz ="), "%13c %s", temp))
-         theSunAzimuth = ossimString(temp).before(";").toFloat64();
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-            
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-
-   //---
-   // Sun Elevation:
-   //---
-   if(getEndOfLine( filebuf, ossimString("\n\tsunEl ="), "%9c %s", temp))
-      theSunElevation = ossimString(temp).before(";").toFloat64();
-   else
-   {
-      if(getEndOfLine( filebuf, ossimString("\n\tmeanSunEl ="), "%13c %s", temp))
-         theSunElevation = ossimString(temp).before(";").toFloat64();
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-
-
-   //---
-   // Sat Azimuth:
-   //---
-   if(getEndOfLine( strptr, ossimString("\n\tsatAz ="), "%9c %s", temp))
-      theSatAzimuth = ossimString(temp).before(";").toFloat64();
-   else
-   {
-      if(getEndOfLine( strptr, ossimString("\n\tmeanSatAz ="), "%13c %s", temp))
-         theSatAzimuth = ossimString(temp).before(";").toFloat64();
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-            
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-   
-   //---
-   // Sat Elevation:
-   //---
-   if(getEndOfLine( filebuf, ossimString("\n\tsatEl ="), "%9c %s", temp))
-      theSatElevation = ossimString(temp).before(";").toFloat64();
-   else
-   {
-      if(getEndOfLine( filebuf, ossimString("\n\tmeanSatEl ="), "%13c %s", temp))
-         theSatElevation = ossimString(temp).before(";").toFloat64();
-      else
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_FATAL)
-               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-               << "\n\tAborting construction. Error encountered parsing "
-               << "presumed meta-data file." << std::endl;
-            
-            delete [] filebuf;
-            return false;
-         }
-      }
-   }
-   
-   
-   //---
-   // TDILevel:
-   //---
-   if(getEndOfLine( strptr, ossimString("\n\tTDILevel = "), "%13c %s", temp))
-      theTDILevel = ossimString(temp).before(";").toInt();
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
-	    << "\n\tAborting construction. Error encountered parsing "
-	    << "presumed meta-data file." << std::endl;
-
-         delete [] filebuf;
-         return false;
-      }
-   }
-
-
-   delete [] filebuf;
-   filebuf = 0;
-
-   if (traceExec())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "DEBUG ossimQuickbirdRpcModel::parseMetaData(data_file): returning..."
-         << std::endl;
-   }
-
-   return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimQuickbirdMetaData::parseGEOData()
-//
-//  Parses the Quickbird GEO file.
-//
-//*****************************************************************************
-bool ossimQuickbirdMetaData::parseGEOData(const ossimFilename& /* data_file */)
-{
-  return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimQuickbirdMetaData::parseRpcData()
-//
-//  Parses the Quickbird EPH file.
-//
-//*****************************************************************************
-bool ossimQuickbirdMetaData::parseEPHData(const ossimFilename& /* data_file */)
-{
-  return true;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimQuickbirdMetaData::parseRpcData()
-//
-//  Parses the Quickbird ATT file.
-//
-//*****************************************************************************
-bool ossimQuickbirdMetaData::parseATTData(const ossimFilename& /* data_file */)
-{
-  return true;
-}
-
-ossimString ossimQuickbirdMetaData::getSatID() const
-{
-   return theSatID;
-}
-
-//*****************************************************************************
-// PROTECTED METHOD: ossimQuickbirdMetaData::getEndOfLine
-//
-// //  Parse a char * to find another char *. Change the pointer only if the second char * is found.
-//
-//*****************************************************************************
-bool ossimQuickbirdMetaData::getEndOfLine( char * fileBuf,
-                                           ossimString lineBeginning,
-                                           const char * format,
-                                           ossimString & name)
-{
-   //char * res = strstr(fileBuf, lineBeginning.c_str());
-   //if (!res)
-   //{
-   //  return false;
-   // }
-   //// if the lineBeginning is found, update the start pointer adress
-   //fileBuf = res;
-   
-   //char dummy[80], nameChar[80];
-   //sscanf(res, format, dummy, nameChar);    
-   //name = ossimString(nameChar);
-    
-   char * res = strstr(fileBuf, lineBeginning.c_str());
-   if(!res)
-   {
-      return false;
-   }
-   fileBuf = strstr(fileBuf, lineBeginning.c_str());
-   char dummy[80], nameChar[80];
-   sscanf(fileBuf, format, dummy, nameChar);  
-   name = ossimString(nameChar);
-    
-   return true;
-}
-
-const ossimIpt& ossimQuickbirdMetaData::getImageSize() const
-{
-   return theImageSize;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimQuickbirdRpcHeader.cpp b/ossim/src/ossim/support_data/ossimQuickbirdRpcHeader.cpp
deleted file mode 100644
index ba8ab5c..0000000
--- a/ossim/src/ossim/support_data/ossimQuickbirdRpcHeader.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimQuickbirdRpcHeader.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimQuickbirdRpcHeader.h>
-#include <iostream>
-#include <fstream>
-#include <algorithm>
-#include <iterator>
-
-std::ostream& operator << (std::ostream& out,
-		      const ossimQuickbirdRpcHeader& data)
-{
-   out << "theSatId      = " << data.theSatId << std::endl
-       << "theBandId     = " << data.theBandId << std::endl
-       << "theSpecId     = " << data.theSpecId << std::endl
-       << "theErrBias    = " << data.theErrBias << std::endl
-       << "theLineOffset = " << data.theLineOffset << std::endl
-       << "theSampOffset = " << data.theSampOffset << std::endl
-       << "theLatOffset  = " << data.theLatOffset << std::endl
-       << "theLonOffset  = " << data.theLonOffset << std::endl
-       << "theHeightOffset  = " << data.theHeightOffset << std::endl
-       << "theLineScale  = " << data.theLineScale << std::endl
-       << "theSampScale  = " << data.theSampScale << std::endl
-       << "theLatScale  = " << data.theLatScale << std::endl
-       << "theLonScale  = " << data.theLonScale << std::endl
-       << "theHeightScale  = " << data.theHeightScale << std::endl;
-   
-   out << "lineNumCoef = " << std::endl;
-   std::copy(data.theLineNumCoeff.begin(),
-             data.theLineNumCoeff.end(),
-             std::ostream_iterator<double>(out, "\n"));
-   out << "lineDenCoef = " << std::endl;
-   std::copy(data.theLineDenCoeff.begin(),
-             data.theLineDenCoeff.end(),
-             std::ostream_iterator<double>(out, "\n"));
-   out << "sampNumCoef = " << std::endl;
-   std::copy(data.theSampNumCoeff.begin(),
-             data.theSampNumCoeff.end(),
-             std::ostream_iterator<double>(out, "\n"));
-   out << "sampDenCoef = " << std::endl;
-   std::copy(data.theSampDenCoeff.begin(),
-             data.theSampDenCoeff.end(),
-             std::ostream_iterator<double>(out, "\n"));
-   
-   return out;
-}
-
-
-ossimQuickbirdRpcHeader::ossimQuickbirdRpcHeader()
-{
-}
-
-bool ossimQuickbirdRpcHeader::open(const ossimFilename& file)
-{
-   theFilename = file;
-   std::ifstream in(file.c_str(), std::ios::in|std::ios::binary);
-   
-   char test[64];
-   
-   in.read((char*)test, 63);
-   test[63] = '\0';
-   in.seekg(0);
-   ossimString line = test;
-   line = line.upcase();
-   
-   if(parseNameValue(line))
-   {
-      theErrorStatus = ossimErrorCodes::OSSIM_OK;
-      getline(in,
-              line);
-      while((in)&&(theErrorStatus == ossimErrorCodes::OSSIM_OK))
-      {
-         line = line.upcase();
-         if(line.contains("LINENUMCOEF"))
-         {
-            if(!readCoeff(in, theLineNumCoeff))
-            {
-               setErrorStatus();
-               break;
-            }
-         }
-         else if(line.contains("LINEDENCOEF"))
-         {
-            if(!readCoeff(in, theLineDenCoeff))
-            {
-               setErrorStatus();
-               break;
-            }
-         }
-         else if(line.contains("SAMPNUMCOEF"))
-         {
-            if(!readCoeff(in, theSampNumCoeff))
-            {
-               setErrorStatus();
-               break;
-            }
-         }
-         else if(line.contains("SAMPDENCOEF"))
-         {
-            if(!readCoeff(in, theSampDenCoeff))
-            {
-               setErrorStatus();
-               break;
-            }
-         }
-         else if(!parseNameValue(line))
-         {
-            setErrorStatus();
-            break;
-         }
-         getline(in,
-                 line);
-      }
-   }
-   else
-   {
-      setErrorStatus();
-   }
-   return (theErrorStatus == ossimErrorCodes::OSSIM_OK);
-}
-
-bool ossimQuickbirdRpcHeader::readCoeff(std::istream& in,
-					std::vector<double>& coeff)
-{
-   coeff.clear();
-   bool done = false;
-   ossimString line;
-   while(!in.eof()&&!in.bad()&&!done)
-   {
-      getline(in,
-	      line);
-      line.trim();
-      line.trim(',');
-      if(line.contains(");"))
-      {
-         done = true;
-         line.trim(';');
-         line.trim(')');
-      }
-      coeff.push_back(line.toDouble());
-   }
-   return done;
-}
-
-bool ossimQuickbirdRpcHeader::parseNameValue(const ossimString& line)
-{
-   bool result = true;
-   ossimString lineCopy = line;
-   
-   if(lineCopy.contains("SATID"))
-   {
-      theSatId = lineCopy.after("\"");
-      theSatId = theSatId.before("\"");
-   }
-   else if(lineCopy.contains("BANDID"))
-   {
-      theBandId = lineCopy.after("\"");
-      theBandId = theBandId.before("\"");
-   }
-   else if(lineCopy.contains("SPECID"))
-   {
-      theSpecId = lineCopy.after("\"");
-      theSpecId = theSpecId.before("\"");
-   }
-   else if(lineCopy.contains("BEGIN_GROUP"))
-   {
-   }
-   else if(lineCopy.contains("ERRBIAS"))
-   {
-      lineCopy = lineCopy.after("=");
-      theErrBias = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("ERRRAND"))
-   {
-      lineCopy = lineCopy.after("=");
-      theErrRand = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("LINEOFFSET"))
-   {
-      lineCopy = lineCopy.after("=");
-      theLineOffset = lineCopy.before(";").toInt();
-   }
-   else if(lineCopy.contains("SAMPOFFSET"))
-   {
-      lineCopy = lineCopy.after("=");
-      theSampOffset = lineCopy.before(";").toInt();
-   }
-   else if(lineCopy.contains("LATOFFSET"))
-   {
-      lineCopy = lineCopy.after("=");
-      theLatOffset = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("LONGOFFSET"))
-   {
-      lineCopy = lineCopy.after("=");
-      theLonOffset = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("HEIGHTOFFSET"))
-   {
-      lineCopy = lineCopy.after("=");
-      theHeightOffset = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("LINESCALE"))
-   {
-      lineCopy = lineCopy.after("=");
-      theLineScale = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("SAMPSCALE"))
-   {
-      lineCopy = lineCopy.after("=");
-      theSampScale = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("LATSCALE"))
-   {
-      lineCopy = lineCopy.after("=");
-      theLatScale = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("LONGSCALE"))
-   {
-      lineCopy = lineCopy.after("=");
-      theLonScale = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("HEIGHTSCALE"))
-   {
-      lineCopy = lineCopy.after("=");
-      theHeightScale = lineCopy.before(";").toDouble();
-   }
-   else if(lineCopy.contains("END_GROUP"))
-   {
-   }
-   else if(lineCopy.contains("END"))
-   {
-   }
-   else
-   {
-      result = false;
-   }
-
-   return result;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfAttributeOffsetRecord.cpp b/ossim/src/ossim/support_data/ossimRpfAttributeOffsetRecord.cpp
deleted file mode 100644
index d4d7793..0000000
--- a/ossim/src/ossim/support_data/ossimRpfAttributeOffsetRecord.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#include <ossim/support_data/ossimRpfAttributeOffsetRecord.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfAttributeOffsetRecord& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfAttributeOffsetRecord::ossimRpfAttributeOffsetRecord()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfAttributeOffsetRecord::parseStream(istream& in,
-                                                          ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      in.read((char*)&theAttributeId, 2);
-      in.read((char*)&theParameterId, 1);
-      in.read((char*)&theArealCoverageSequenceNumber, 1);
-      in.read((char*)&theAttributeRecordOffset, 4);
-
-      ossimEndian anEndian;
-
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theAttributeId);
-         anEndian.swap(theAttributeRecordOffset);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfAttributeOffsetRecord::print(ostream& out)const
-{
-   out << "theAttributeId:                  " << theAttributeId << endl
-       << "theParameterId:                  " << theParameterId << endl
-       << "theArealCoverageSequenceNumber:  " << theArealCoverageSequenceNumber << endl
-       << "theAttributeRecordOffset:        " << theAttributeRecordOffset;
-}
-
-void ossimRpfAttributeOffsetRecord::clearFields()
-{
-   theAttributeId                 = 0;
-   theParameterId                 = 0;
-   theArealCoverageSequenceNumber = 0;
-   theAttributeRecordOffset       = 0;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfAttributeSectionSubheader.cpp b/ossim/src/ossim/support_data/ossimRpfAttributeSectionSubheader.cpp
deleted file mode 100644
index a5e2105..0000000
--- a/ossim/src/ossim/support_data/ossimRpfAttributeSectionSubheader.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-//*******************************************************************
-//
-// License:  See top level LICENSE.txt file.
-// 
-// Author: Garrett Potts (gpotts at imagelinks.com)
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfAttributeSectionSubheader.cpp 9963 2006-11-28 21:11:01Z gpotts $
-#include <ossim/support_data/ossimRpfAttributeSectionSubheader.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfAttributeSectionSubheader& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfAttributeSectionSubheader::ossimRpfAttributeSectionSubheader()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfAttributeSectionSubheader::parseStream(istream& in,
-                                                              ossimByteOrder byteOrder)
-{
-   theAttributeSectionSubheaderStart = 0;
-   theAttributeSectionSubheaderEnd = 0;
-   if(in)
-   {
-      theAttributeSectionSubheaderStart = in.tellg();
-      in.read((char*)&theNumberOfAttributeOffsetRecords, 2);
-      in.read((char*)&theNumberOfExplicitArealCoverageRecords, 2);
-      in.read((char*)&theAttributeOffsetTableOffset, 4);
-      in.read((char*)&theAttribteOffsetRecordLength, 2);
-      ossimEndian anEndian;
-
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theNumberOfAttributeOffsetRecords);
-         anEndian.swap(theNumberOfExplicitArealCoverageRecords);
-         anEndian.swap(theAttributeOffsetTableOffset);
-         anEndian.swap(theAttribteOffsetRecordLength);
-      }
-      theAttributeSectionSubheaderEnd = in.tellg();
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfAttributeSectionSubheader::print(ostream& out)const
-{
-   out << "theNumberOfAttributeOffsetRecords:         " << theNumberOfAttributeOffsetRecords << endl
-       << "theNumberOfExplicitArealCoverageRecords:   " << theNumberOfExplicitArealCoverageRecords << endl
-       << "theAttributeOffsetTableOffset:             " << theAttributeOffsetTableOffset << endl
-       << "theAttribteOffsetRecordLength:             " << theAttribteOffsetRecordLength;
-}
-
-void ossimRpfAttributeSectionSubheader::clearFields()
-{
-   theNumberOfAttributeOffsetRecords       = 0;
-   theNumberOfExplicitArealCoverageRecords = 0;
-   theAttributeOffsetTableOffset           = 0;
-   theAttribteOffsetRecordLength           = 0;
-   
-   theAttributeSectionSubheaderStart       = 0;
-   theAttributeSectionSubheaderEnd         = 0;
-}
-
-ossim_uint64 ossimRpfAttributeSectionSubheader::getSubheaderStart()const
-{
-   return theAttributeSectionSubheaderStart;
-}
-
-ossim_uint64 ossimRpfAttributeSectionSubheader::getSubheaderEnd()const
-{
-   return theAttributeSectionSubheaderEnd;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfAttributes.cpp b/ossim/src/ossim/support_data/ossimRpfAttributes.cpp
deleted file mode 100644
index 3707dfa..0000000
--- a/ossim/src/ossim/support_data/ossimRpfAttributes.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimRpfAttributes.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
- 
-#include <ossim/support_data/ossimRpfAttributes.h>
-
-std::ostream& operator<<(std::ostream& out,
-                    const ossimRpfAttributes& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfAttributes::ossimRpfAttributes()
-{
-   clearFields();
-}
-ossimRpfAttributes::~ossimRpfAttributes()
-{
-}
-
-std::ostream& ossimRpfAttributes::print(std::ostream& out,
-                                        const std::string& prefix) const
-{
-   out << prefix << "CurrencyDate: " << theCurrencyDate << "\n"
-       << prefix << "ProductionDate: " << theProductionDate << "\n"
-       << prefix << "SignificantDate: " << theSignificantDate << "\n"
-       << prefix << "ChartSeriesCode: " << theChartSeriesCode << "\n"
-       << prefix << "MapDesignationCode: " << theMapDesignationCode << "\n"
-       << prefix << "OldHorDatum: " << theOldHorDatum << "\n"
-       << prefix << "Edition: " << theEdition << "\n"
-       << prefix << "ProjectionCode: " << theProjectionCode << "\n"
-       << prefix << "ProjectionA: " << theProjectionA << "\n"
-       << prefix << "ProjectionB: " << theProjectionB << "\n"
-       << prefix << "ProjectionC: " << theProjectionC << "\n"
-       << prefix << "ProjectionD: " << theProjectionD << "\n"
-       << prefix << "VertDatumCode: " << theVertDatumCode<< "\n"
-       << prefix << "HorDatumCode: " << theHorDatumCode << "\n"
-       << prefix << "VertAbsAccuracy: " << theVertAbsAccuracy << "\n"
-       << prefix << "VertAbsUnits: " << theVertAbsUnits << "\n"
-       << prefix << "HorAbsAccuracy: " << theHorAbsAccuracy << "\n"
-       << prefix << "HorAbsUnits: " << theHorAbsUnits << "\n"
-       << prefix << "VertRelAccuracy: " << theVertRelAccuracy << "\n"
-       << prefix << "VertRelUnits: " << theVertRelUnits << "\n"
-       << prefix << "HorRelAccuracy: " << theHorRelAccuracy << "\n"
-       << prefix << "HorRelUnits: " << theHorRelUnits << "\n"
-       << prefix << "ellipsoidCode: " << ellipsoidCode << "\n"
-       << prefix << "SoundingDatumCode: " << theSoundingDatumCode << "\n"
-       << prefix << "NavSystemCode: " << theNavSystemCode << "\n"
-       << prefix << "GridCode: " << theGridCode << "\n"
-       << prefix << "EeasterlyMagChange: " << theEeasterlyMagChange << "\n"
-       << prefix << "EasterlyMagChangeUnits: " << theEasterlyMagChangeUnits << "\n"
-       << prefix << "WesterlyMagChange: " << theWesterlyMagChange << "\n"
-       << prefix << "WesterlyMagChangeUnits: " << theWesterlyMagChangeUnits << "\n"
-       << prefix << "MagAngle: " << theMagAngle << "\n"
-       << prefix << "GridConver: " << theGridConver << "\n"
-       << prefix << "GridConverUnits: " << theGridConverUnits << "\n"
-       << prefix << "HighElevation: " << theHighElevation << "\n"
-       << prefix << "HighElevationUnits: " << theHighElevationUnits << "\n"
-       << prefix << "HighLat: " << theHighLat << "\n"
-       << prefix << "HighLon: " << theHighLon << "\n"
-       << prefix << "LegendFileName: " << theLegendFileName << "\n"
-       << prefix << "DataSource: " << theDataSource << "\n"
-       << prefix << "gsd: " << theGsd << "\n"
-       << prefix << "DataLevel: " << theDataLevel << std::endl;
-   return out;
-}
-
-bool ossimRpfAttributes::isEmpty()const
-{
-   for(std::map<ossim_uint32, bool>::const_iterator iter= theAttributeIdBoolMap.begin();
-       iter != theAttributeIdBoolMap.end();++iter)
-   {
-      if(iter->second!=false)
-      {
-         return false;
-      }
-   }
-   return true;
-}
-
-void ossimRpfAttributes::clearFields()
-{
-   theCurrencyDate    = "";
-   theProductionDate  = "";
-   theSignificantDate = "";
-   theChartSeriesCode = "";
-   theMapDesignationCode = "";
-   theOldHorDatum = "";
-   theEdition = "";
-   theProjectionCode = "";
-   theProjectionA = 0.0;
-   theProjectionB = 0.0;
-   theProjectionC = 0.0;
-   theProjectionD = 0.0;
-   theVertDatumCode = "";
-   theHorDatumCode = "";
-   theVertAbsAccuracy = 0;
-   theVertAbsUnits = 0;
-   theHorAbsAccuracy = 0;
-   theHorAbsUnits    = 0;
-   theVertRelAccuracy = 0;
-   theVertRelUnits = 0;
-   theHorRelAccuracy = 0;
-   theHorRelUnits = 0;
-   ellipsoidCode = "";
-   theSoundingDatumCode = "";
-   theNavSystemCode = 0;
-   theGridCode = "";
-   theEeasterlyMagChange = 0.0;
-   theEasterlyMagChangeUnits = 0;
-   theWesterlyMagChange = 0.0;
-   theWesterlyMagChangeUnits = 0;
-   theMagAngle = 0.0;
-   theMagAngleUnits = 0;
-   theGridConver = 0.0;
-   theGridConverUnits = 0;
-   theHighElevation = 0.0;
-   theHighElevationUnits = 0;
-   theHighLat = 0.0;
-   theHighLon = 0.0;
-   theLegendFileName = "";
-   theDataSource = "";
-   theGsd = 0;
-   theDataLevel = 0;
-
-   theAttributeIdBoolMap.clear();
-}
-
-void ossimRpfAttributes::setAttributeFlag(ossim_uint32 id,
-                                          bool flag)
-{
-   std::map<ossim_uint32, bool>::iterator iter = theAttributeIdBoolMap.find(id);
-
-   if(iter != theAttributeIdBoolMap.end())
-   {
-      if(flag)
-      {
-         iter->second = flag;
-      }
-      else
-      {
-         theAttributeIdBoolMap.erase(iter); 
-      }
-   }
-   else if(flag)
-   {
-	   theAttributeIdBoolMap.insert(std::make_pair(id, flag));
-   }
-}
-
-bool ossimRpfAttributes::getAttributeFlag(ossim_uint32 id)const
-{
-   std::map<ossim_uint32, bool>::const_iterator iter = theAttributeIdBoolMap.find(id);
-
-   if(iter != theAttributeIdBoolMap.end())
-   {
-      return iter->second;
-   }
-
-   return false;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfColorConverterOffsetRecord.cpp b/ossim/src/ossim/support_data/ossimRpfColorConverterOffsetRecord.cpp
deleted file mode 100644
index a05f1f7..0000000
--- a/ossim/src/ossim/support_data/ossimRpfColorConverterOffsetRecord.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include <ossim/support_data/ossimRpfColorConverterOffsetRecord.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfColorConverterOffsetRecord& data)
-{
-   out << "theColorConverterTableId:                 " << data.theColorConverterTableId << endl
-       << "theNumberOfColorConverterRecords:         " << data.theNumberOfColorConverterRecords << endl
-       << "theColorConverterTableOffset:             " << data.theColorConverterTableOffset << endl
-       << "theSourceColorGrayscaleOffsetTableOffset: " << data.theSourceColorGrayscaleOffsetTableOffset << endl
-       << "theTargetColorGrayscaleOffsetTableOffset: " << data.theTargetColorGrayscaleOffsetTableOffset;
-
-   return out;
-}
-
-ossimRpfColorConverterOffsetRecord::ossimRpfColorConverterOffsetRecord()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfColorConverterOffsetRecord::parseStream(istream& in,
-                                                               ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      in.read((char*)&theColorConverterTableId, 2);
-      in.read((char*)&theNumberOfColorConverterRecords, 4);
-      in.read((char*)&theColorConverterTableOffset, 4);
-      in.read((char*)&theSourceColorGrayscaleOffsetTableOffset, 4);
-      in.read((char*)&theTargetColorGrayscaleOffsetTableOffset, 4);
-      
-      ossimEndian anEndian;
-      
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theColorConverterTableId);
-         anEndian.swap(theNumberOfColorConverterRecords);
-         anEndian.swap(theColorConverterTableOffset);
-         anEndian.swap(theSourceColorGrayscaleOffsetTableOffset);
-         anEndian.swap(theTargetColorGrayscaleOffsetTableOffset);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfColorConverterOffsetRecord::clearFields()
-{
-   theColorConverterTableId                 = 0;
-   theNumberOfColorConverterRecords         = 0;
-   theColorConverterTableOffset             = 0;
-   theSourceColorGrayscaleOffsetTableOffset = 0;
-   theTargetColorGrayscaleOffsetTableOffset = 0;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfColorConverterSubsection.cpp b/ossim/src/ossim/support_data/ossimRpfColorConverterSubsection.cpp
deleted file mode 100644
index 1252f6d..0000000
--- a/ossim/src/ossim/support_data/ossimRpfColorConverterSubsection.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//********************************************************************
-// $Id: ossimRpfColorConverterSubsection.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimRpfColorConverterSubsection.h>
-#include <ossim/support_data/ossimRpfColorConverterOffsetRecord.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfColorConverterSubsection& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfColorConverterSubsection::ossimRpfColorConverterSubsection()
-{
-   theNumberOfColorConverterOffsetRecords = 0;
-   clearFields();
-}
-
-void ossimRpfColorConverterSubsection::clearFields()
-{
-   theColorConverterOffsetTableOffset     = 0;
-   theColorConverterOffsetRecordLength    = 0;
-   theConverterRecordLength               = 0;
-
-   theTableList.clear();
-}
-
-const ossimRpfColorConverterTable* ossimRpfColorConverterSubsection::getColorConversionTable(ossim_uint32 givenThisNumberOfEntires)const
-{
-   vector<ossimRpfColorConverterTable>::const_iterator listElement = theTableList.begin();
-
-   while(listElement != theTableList.end())
-   {
-      if((*listElement).getNumberOfEntries() == givenThisNumberOfEntires)
-      {
-         return &(*listElement);
-      }
-   }
-
-   return NULL;
-}
-
-ossimErrorCode ossimRpfColorConverterSubsection::parseStream(istream& in,
-                                                             ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      clearFields();
-
-      // this is the start of the subsection
-      theStartOffset = in.tellg();
-      in.read((char*)&theColorConverterOffsetTableOffset, 4);
-      in.read((char*)&theColorConverterOffsetRecordLength, 2);
-      in.read((char*)&theConverterRecordLength, 2);
-
-      // this grabs the end of the subsection
-      theEndOffset   = in.tellg();
-
-      ossimEndian anEndian;
-
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theColorConverterOffsetTableOffset);
-         anEndian.swap(theColorConverterOffsetRecordLength);
-         anEndian.swap(theConverterRecordLength);
-
-      }
-      theTableList.resize(theNumberOfColorConverterOffsetRecords);
-      for(unsigned long index = 0;
-          index < theNumberOfColorConverterOffsetRecords;
-          ++index)
-      {
-         ossimRpfColorConverterOffsetRecord recordInfo;
-         
-         if(recordInfo.parseStream(in, byteOrder) ==
-            ossimErrorCodes::OSSIM_OK)
-         {
-            unsigned long rememberGet = in.tellg();
-
-            theTableList[index].setNumberOfEntries(recordInfo.theNumberOfColorConverterRecords);
-            theTableList[index].setTableId(recordInfo.theColorConverterTableId);
-            in.seekg(theStartOffset + recordInfo.theColorConverterTableOffset, ios::beg);
-            theTableList[index].parseStream(in, byteOrder);
-            
-            in.seekg(rememberGet, ios::beg);
-         }
-         else
-         {
-            return ossimErrorCodes::OSSIM_ERROR;
-         }
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfColorConverterSubsection::setNumberOfColorConverterOffsetRecords(ossim_uint16 numberOfRecords)
-{
-   theNumberOfColorConverterOffsetRecords = numberOfRecords;
-}
-
-void ossimRpfColorConverterSubsection::print(ostream& out)const
-{
-   out << "theColorConverterOffsetTableOffset:      "
-       << theColorConverterOffsetTableOffset << endl
-       << "theColorConverterOffsetRecordLength:     "
-       << theColorConverterOffsetRecordLength << endl
-       << "theConverterRecordLength:                "
-       << theConverterRecordLength << endl;
-
-   copy(theTableList.begin(),
-        theTableList.end(),
-        ostream_iterator<ossimRpfColorConverterTable>(out, "\n"));
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfColorConverterTable.cpp b/ossim/src/ossim/support_data/ossimRpfColorConverterTable.cpp
deleted file mode 100644
index a8c2d19..0000000
--- a/ossim/src/ossim/support_data/ossimRpfColorConverterTable.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-#include <ossim/support_data/ossimRpfColorConverterTable.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfColorConverterTable& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfColorConverterTable::ossimRpfColorConverterTable()
-{
-   theTableId                      = 0;
-   theNumberOfEntries              = 0;
-   theColorGrayscaleTableEntryList = NULL;
-}
-
-ossimRpfColorConverterTable::~ossimRpfColorConverterTable()
-{
-   if(theColorGrayscaleTableEntryList)
-   {
-      delete [] theColorGrayscaleTableEntryList;
-      theColorGrayscaleTableEntryList = NULL;
-   }
-}
-ossimErrorCode ossimRpfColorConverterTable::parseStream(istream& in,
-                                                        ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      if(theNumberOfEntries > 0)
-      {
-         in.read((char*)theColorGrayscaleTableEntryList, 4*theNumberOfEntries);
-
-         ossimEndian anEndian;
-         if(anEndian.getSystemEndianType() != byteOrder)
-         {
-            for(ossim_uint32 index = 0;
-                index < theNumberOfEntries;
-                ++index)
-            {
-               anEndian.swap(theColorGrayscaleTableEntryList[index]);
-            }
-         }
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfColorConverterTable::print(ostream& out)const
-{
-   out << "theTableId:                   " << theTableId << endl
-       << "theNumberOfEntries:           " << theNumberOfEntries << endl;
-
-   if(theColorGrayscaleTableEntryList)
-   {
-      out << "Values: " << endl;
-      for(ossim_uint32 index=0; index < theNumberOfEntries; index++)
-      {
-         out<< theColorGrayscaleTableEntryList[index] << endl;
-      }
-   }
-   
-}
-
-void ossimRpfColorConverterTable::setNumberOfEntries(ossim_uint32 entries)
-{
-   if(theColorGrayscaleTableEntryList)
-   {
-      delete [] theColorGrayscaleTableEntryList;
-      theColorGrayscaleTableEntryList = NULL;
-   }
-   theColorGrayscaleTableEntryList = new ossim_uint32[entries];
-   theNumberOfEntries = entries;
-   
-   for(ossim_uint32 index=0;
-       index < theNumberOfEntries;
-       ++index)
-   {
-      theColorGrayscaleTableEntryList[index] = 0;
-   }
-}
-void ossimRpfColorConverterTable::setTableId(ossim_uint16 id)
-{
-   theTableId = id;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.cpp b/ossim/src/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.cpp
deleted file mode 100644
index e0d1ab2..0000000
--- a/ossim/src/ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#include <ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfColorGrayscaleOffsetRecord& data)
-{
-   data.print(out);
-   
-   return out;
-}
-   
-ossimRpfColorGrayscaleOffsetRecord::ossimRpfColorGrayscaleOffsetRecord()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfColorGrayscaleOffsetRecord::parseStream(istream& in,
-                                                               ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      clearFields();
-      
-      in.read((char*)&theColorGrayscaleTableId, 2);
-      in.read((char*)&theNumberOfColorGrayscaleRecords, 4);
-      in.read((char*)&theColorGrayscaleElementLength, 1);
-      in.read((char*)&theHistogramRecordLength, 2);
-      in.read((char*)&theColorGrayscaleTableOffset, 4);
-      in.read((char*)&theHistogramTableOffset, 4);
-
-      ossimEndian anEndian;
-
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theColorGrayscaleTableId);
-         anEndian.swap(theNumberOfColorGrayscaleRecords);
-         anEndian.swap(theHistogramRecordLength);
-         anEndian.swap(theColorGrayscaleTableOffset);
-         anEndian.swap(theHistogramTableOffset);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfColorGrayscaleOffsetRecord::print(ostream& out)const
-{
-   out << "theColorGrayscaleTableId:                 " << theColorGrayscaleTableId << endl
-       << "theNumberOfColorGrayscaleRecords:         " << theNumberOfColorGrayscaleRecords << endl
-       << "theColorGrayscaleElementLength:           " << (unsigned long)theColorGrayscaleElementLength << endl
-       << "theHistogramRecordLength:                 " << theHistogramRecordLength << endl
-       << "theColorGrayscaleTableOffset:             " << theColorGrayscaleTableOffset << endl
-       << "theHistogramTableOffset:                  " << theHistogramTableOffset;
-}
-
-void ossimRpfColorGrayscaleOffsetRecord::clearFields()
-{
-   theColorGrayscaleTableId         = 0;
-   theNumberOfColorGrayscaleRecords = 0;
-   theColorGrayscaleElementLength   = 0;
-   theHistogramRecordLength         = 0;
-   theColorGrayscaleTableOffset     = 0;
-   theHistogramTableOffset          = 0;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfColorGrayscaleSubheader.cpp b/ossim/src/ossim/support_data/ossimRpfColorGrayscaleSubheader.cpp
deleted file mode 100644
index a2f7f52..0000000
--- a/ossim/src/ossim/support_data/ossimRpfColorGrayscaleSubheader.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <ossim/support_data/ossimRpfColorGrayscaleSubheader.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfColorGrayscaleSubheader& data)
-{
-   data.print(out);
-
-   return out;
-}
-
-ossimRpfColorGrayscaleSubheader::ossimRpfColorGrayscaleSubheader()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfColorGrayscaleSubheader::parseStream(istream& in,
-                                                            ossimByteOrder /* byteOrder */)
-{
-   if(in)
-   {
-      clearFields();
-      
-      theStartOffset = in.tellg();
-      in.read((char*)&theNumberOfColorGreyscaleOffsetRecords, 1);
-      in.read((char*)&theNumberOfColorConverterOffsetRecords, 1);
-
-      char tempString[12];
-      in.read(tempString, 12);
-      theColorGrayscaleFilename = ossimString(tempString,
-                                              (char*)(&tempString[12]));
-      theEndOffset = in.tellg();
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfColorGrayscaleSubheader::print(ostream& out)const
-{
-   out << "theNumberOfColorGreyscaleOffsetRecords:    " << (int)theNumberOfColorGreyscaleOffsetRecords << endl
-       << "theNumberOfColorConverterOffsetRecords:    " << (int)theNumberOfColorConverterOffsetRecords << endl
-       << "theColorGrayscaleFilename:                 " << theColorGrayscaleFilename;
-   
-}
-
-void ossimRpfColorGrayscaleSubheader::clearFields()
-{
-   theStartOffset = 0;
-   theEndOffset   = 0;
-   
-   theNumberOfColorGreyscaleOffsetRecords = 0;
-   theNumberOfColorConverterOffsetRecords = 0;
-   theColorGrayscaleFilename              = "";
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfColorGrayscaleTable.cpp b/ossim/src/ossim/support_data/ossimRpfColorGrayscaleTable.cpp
deleted file mode 100644
index c18b406..0000000
--- a/ossim/src/ossim/support_data/ossimRpfColorGrayscaleTable.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-#include <ossim/support_data/ossimRpfColorGrayscaleTable.h>
-#include <string.h> // for memcpy
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream& out,
-                     const ossimRpfColorGrayscaleTable& data)
-{
-   out << "theNumberOfElements:                   " << data.theNumberOfElements << endl
-       << "theTotalNumberOfBytes:                 " << data.theTotalNumberOfBytes << endl
-       << "theTableId:                            " << data.theTableId;
-
-   return out;
-}
-
-ossimRpfColorGrayscaleTable::ossimRpfColorGrayscaleTable()
-   :theNumberOfElements(0),
-    theTotalNumberOfBytes(0),
-    theTableId(0),
-    theData(NULL)
-{
-}
-
-ossimRpfColorGrayscaleTable::ossimRpfColorGrayscaleTable(const ossimRpfColorGrayscaleTable& rhs)
-   :theNumberOfElements(0),
-    theTotalNumberOfBytes(0),
-    theTableId(0),
-    theData(NULL)
-{
-   *this = rhs;
-}
-
-
-ossimRpfColorGrayscaleTable::~ossimRpfColorGrayscaleTable()
-{
-   if(theData)
-   {
-      delete [] theData;
-      theData = NULL;
-   }
-}
-
-ossimErrorCode ossimRpfColorGrayscaleTable::parseStream(istream& in,
-                                                        ossimByteOrder /* byteOrder */)
-{
-   if(in)
-   {
-      if((theTotalNumberOfBytes > 0)&&theData)
-      {
-         in.read((char*)theData, theTotalNumberOfBytes);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-const unsigned char* ossimRpfColorGrayscaleTable::getStartOfData(unsigned long entry)const
-{
-   unsigned long offset = 0;
-
-   switch(theTableId)
-   {
-   case 1: // this is in format RGB
-   {
-      offset = 3*entry;
-      break;
-   }
-   case 2: // format RGBM
-   case 4: // format CMYK
-   {
-      offset = 4*entry;
-      break;
-   }
-   case 3: // format M
-   {
-      offset = entry;
-      break;
-   }
-   }
-
-   return (const unsigned char*)(theData + offset);
-}
-
-void ossimRpfColorGrayscaleTable::setTableData(unsigned short id,
-                                               unsigned long  numberOfElements)
-{
-   if(theData)
-   {
-      delete theData;
-      theData = NULL;
-   }
-
-   unsigned long totalBytes = 0;
-   
-   switch(id)
-   {
-   case 1: // this is in format RGB
-   {
-      totalBytes = 3*numberOfElements;
-      break;
-   }
-   case 2: // format RGBM
-   case 4: // format CMYK
-   {
-      totalBytes = 4*numberOfElements;
-      break;
-   }
-   case 3: // format M
-   {
-      totalBytes = numberOfElements;
-      break;
-   }
-   }
-
-   if(totalBytes > 0)
-   {
-      theTableId            = id;
-      theNumberOfElements   = numberOfElements;
-      theTotalNumberOfBytes = totalBytes;
-
-      theData = new unsigned char[totalBytes];
-   }
-}
-
-
-
-const ossimRpfColorGrayscaleTable& ossimRpfColorGrayscaleTable::operator =(const ossimRpfColorGrayscaleTable& rhs)
-{
-   
-   if(&rhs != this)
-   {
-      theNumberOfElements   = rhs.theNumberOfElements;
-      theTotalNumberOfBytes = rhs.theTotalNumberOfBytes;
-      theTableId            = rhs.theTableId;
-      if(theData)
-      {
-         delete theData;
-         theData = NULL;
-      }
-      if(theTotalNumberOfBytes&&rhs.theData)
-      {
-         theData = new unsigned char[theTotalNumberOfBytes];
-         
-         memcpy(theData, rhs.theData, theTotalNumberOfBytes);
-      }
-   }
-   
-   return *this;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.cpp b/ossim/src/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.cpp
deleted file mode 100644
index 04d0ceb..0000000
--- a/ossim/src/ossim/support_data/ossimRpfCompressionLookupOffsetRecord.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator <<(ostream &out,
-                     const ossimRpfCompressionLookupOffsetRecord& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfCompressionLookupOffsetRecord::ossimRpfCompressionLookupOffsetRecord()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfCompressionLookupOffsetRecord::parseStream(istream& in,
-                                                                  ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      ossimEndian anEndian;
-
-      in.read((char*)&theCompressionLookupTableId, 2);
-      in.read((char*)&theNumberOfCompressionLookupRecords, 4);
-      in.read((char*)&theNumberOfValuesPerCompressionLookupRecord, 2);
-      in.read((char*)&theCompressionLookupValueBitLength, 2);
-      in.read((char*)&theCompressionLookupTableOffset, 4);
-      
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theCompressionLookupTableId);
-         anEndian.swap(theNumberOfCompressionLookupRecords);
-         anEndian.swap(theNumberOfValuesPerCompressionLookupRecord);
-         anEndian.swap(theCompressionLookupValueBitLength);
-         anEndian.swap(theCompressionLookupTableOffset);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfCompressionLookupOffsetRecord::print(ostream& out)const
-{
-   out << "theCompressionLookupTableId:                 " << theCompressionLookupTableId << endl
-       << "theNumberOfCompressionLookupRecords:         " << theNumberOfCompressionLookupRecords << endl
-       << "theNumberOfValuesPerCompressionLookupRecord: " << theNumberOfValuesPerCompressionLookupRecord << endl
-       << "theCompressionLookupValueBitLength:          " << theCompressionLookupValueBitLength << endl
-       << "theCompressionLookupTableOffset:             " << theCompressionLookupTableOffset;
-}
-
-void ossimRpfCompressionLookupOffsetRecord::clearFields()
-{
-   theCompressionLookupTableId                  = 0;
-   theNumberOfCompressionLookupRecords          = 0;
-   theNumberOfValuesPerCompressionLookupRecord  = 0;
-   theCompressionLookupValueBitLength           = 0;
-   theCompressionLookupTableOffset              = 0;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfCompressionSection.cpp b/ossim/src/ossim/support_data/ossimRpfCompressionSection.cpp
deleted file mode 100644
index 310eceb..0000000
--- a/ossim/src/ossim/support_data/ossimRpfCompressionSection.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-#include <ossim/support_data/ossimRpfCompressionSection.h>
-#include <ossim/support_data/ossimRpfCompressionSectionSubheader.h>
-#include <ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h>
-#include <string.h> // for memset
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-#ifndef NULL
-#include <stddef.h>
-#endif
-
-ostream& operator<<(ostream& out,
-                    const ossimRpfCompressionOffsetTableData& data)
-{
-   unsigned long size = (data.theNumberOfValuesPerLookup*data.theNumberOfLookupValues*
-                         data.theCompressionLookupValueBitLength)/8;
-   
-   out << "theTableId:                         " << data.theTableId << endl
-       << "theNumberOfLookupValues:            " << data.theNumberOfLookupValues << endl
-       << "theCompressionLookupValueBitLength: " << data.theCompressionLookupValueBitLength << endl
-       << "theNumberOfValuesPerLookup:         " << data.theNumberOfValuesPerLookup << endl
-       << "Data Size in bytes:                 "
-       << size;
-
-   return out;
-}
-
-
-ossimRpfCompressionOffsetTableData::ossimRpfCompressionOffsetTableData()
-   :theTableId(0),
-    theNumberOfLookupValues(0),
-    theCompressionLookupValueBitLength(0),
-    theNumberOfValuesPerLookup(0),
-    theData(NULL)
-{
-}
-
-ossimRpfCompressionOffsetTableData::ossimRpfCompressionOffsetTableData(
-   const ossimRpfCompressionOffsetTableData& rhs)
-   :theNumberOfLookupValues(0),
-    theCompressionLookupValueBitLength(0),
-    theNumberOfValuesPerLookup(0),
-    theData(NULL)
-{
-   *this = rhs;
-}
-
-const ossimRpfCompressionOffsetTableData& ossimRpfCompressionOffsetTableData::operator = (
-   const ossimRpfCompressionOffsetTableData& rhs)
-{
-   if(this != &rhs)
-   {
-      if(theData)
-      {
-         delete [] theData;
-         theData = 0;
-      }
-
-      if(rhs.theData)
-      {
-         theTableId                         = rhs.theTableId;
-         theNumberOfLookupValues            = rhs.theNumberOfLookupValues;
-         theCompressionLookupValueBitLength = rhs.theCompressionLookupValueBitLength;
-         theNumberOfValuesPerLookup         = rhs.theNumberOfValuesPerLookup;
-         
-         unsigned long size = (theNumberOfValuesPerLookup*
-                               theNumberOfLookupValues*
-                               theCompressionLookupValueBitLength)/8;
-         if(size > 0)
-         {
-            theData = new unsigned char[size];
-            memcpy(theData, rhs.theData, size);
-         }
-      }
-      else
-      {
-         theTableId = 0;
-         theNumberOfLookupValues = 0;
-         theCompressionLookupValueBitLength = 0;
-         theNumberOfValuesPerLookup = 0;
-      }
-   }
-   
-   return *this;
-}
-
-ossimRpfCompressionOffsetTableData::~ossimRpfCompressionOffsetTableData()
-{
-   if(theData)
-   {
-      delete [] theData;
-      theData = 0;
-   }
-}
-
-
-ostream& operator << (ostream& out,
-                      const ossimRpfCompressionSection& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfCompressionSection::ossimRpfCompressionSection()
-   :theSubheader(NULL)
-{
-   theSubheader = new ossimRpfCompressionSectionSubheader;
-}
-
-ossimRpfCompressionSection::~ossimRpfCompressionSection()
-{
-   if(theSubheader)
-   {
-      delete theSubheader;
-      theSubheader = NULL;
-   }
-}
-
-ossimErrorCode ossimRpfCompressionSection::parseStream(istream& in,
-                                                       ossimByteOrder byteOrder)
-{
-   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
-   
-   if(in&&theSubheader)
-   {
-      result = theSubheader->parseStream(in, byteOrder);
-
-      if(result == ossimErrorCodes::OSSIM_OK)
-      {
-         ossimEndian anEndian;
-         ossimRpfCompressionLookupOffsetRecord record;
-         
-         in.read((char*)&theCompressionLookupOffsetTableOffset, 4);
-         in.read((char*)&theCompressionLookupTableOffsetRecordLength, 2);
-         
-         if(byteOrder != anEndian.getSystemEndianType())
-         {
-            anEndian.swap(theCompressionLookupOffsetTableOffset);
-            anEndian.swap(theCompressionLookupTableOffsetRecordLength);
-         }
-
-         if(theSubheader->getNumberOfCompressionLookupOffsetRecords() > 0)
-         {
-            // clear the table
-            theTable.clear();
-
-            // resize it
-            theTable.resize(theSubheader->getNumberOfCompressionLookupOffsetRecords());
-            
-            // now populate it
-            for(long index = 0;
-                index < theSubheader->getNumberOfCompressionLookupOffsetRecords();
-                ++index)
-            {
-               record.parseStream(in, byteOrder);
-               unsigned long rememberLocation = in.tellg();
-               in.seekg(record.getCompressionLookupTableOffset()+
-                        theSubheader->getEndOffset(), ios::beg);
-
-               theTable[index].theTableId                            = record.getCompressionLookupTableId();
-               theTable[index].theNumberOfLookupValues               = record.getNumberOfCompressionLookupRecords();
-               theTable[index].theCompressionLookupValueBitLength    = record.getCompressionLookupValueBitLength();
-               theTable[index].theNumberOfValuesPerLookup            = record.getNumberOfValuesPerCompressionLookupRecord();
-               
-               // store the information about this compress/decompress algorithm
-               // I am not sure but I will assume that the bit length can be
-               // arbitrary.  In other words if someone says that the bit length of
-               // the lookup value is 12 this should be handled ok.
-               //
-               unsigned long size = (theTable[index].theNumberOfValuesPerLookup*
-                                     theTable[index].theNumberOfLookupValues*
-                                     theTable[index].theCompressionLookupValueBitLength)/8;
-               
-               theTable[index].theData = new unsigned char[size];
-
-               in.read( (char*)theTable[index].theData, size);
-               
-               in.seekg(rememberLocation, ios::beg);
-            }
-         }
-      }
-   }
-   else
-   {
-      result = ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return result;
-}
-
-void ossimRpfCompressionSection::print(ostream& out)const
-{
-   if(theSubheader)
-   {
-      out << *theSubheader << endl;
-      copy(theTable.begin(),
-           theTable.end(),
-           ostream_iterator<ossimRpfCompressionOffsetTableData>(out, "\n"));
-   }
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfCompressionSectionSubheader.cpp b/ossim/src/ossim/support_data/ossimRpfCompressionSectionSubheader.cpp
deleted file mode 100644
index 1558d14..0000000
--- a/ossim/src/ossim/support_data/ossimRpfCompressionSectionSubheader.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#include <ossim/support_data/ossimRpfCompressionSectionSubheader.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ossimRpfCompressionSectionSubheader::ossimRpfCompressionSectionSubheader()
-{
-   clearFields();
-}
-
-ostream& operator<<(ostream& out,
-                    const ossimRpfCompressionSectionSubheader& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimErrorCode ossimRpfCompressionSectionSubheader::parseStream(istream& in,
-                                                                ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      theStartOffset = in.tellg();
-      
-      in.read((char*)&theCompressionAlgorithmId, 2);
-      in.read((char*)&theNumberOfCompressionLookupOffsetRecords, 2);
-      in.read((char*)&theNumberOfCompressionParameterOffsetRecords, 2);
-
-      theEndOffset = in.tellg();
-      
-      ossimEndian anEndian;
-
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theCompressionAlgorithmId);
-         anEndian.swap(theNumberOfCompressionLookupOffsetRecords);
-         anEndian.swap(theNumberOfCompressionParameterOffsetRecords);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-   
-void ossimRpfCompressionSectionSubheader::print(ostream& out)const
-{
-   out << "theCompressionAlgorithmId:                    " << theCompressionAlgorithmId << endl
-       << "theNumberOfCompressionLookupOffsetRecords:    " << theNumberOfCompressionLookupOffsetRecords << endl
-       << "theNumberOfCompressionParameterOffsetRecords: " << theNumberOfCompressionParameterOffsetRecords;
-}
-
-void ossimRpfCompressionSectionSubheader::clearFields()
-{
-   theStartOffset                               = 0;
-   theEndOffset                                 = 0;
-   theCompressionAlgorithmId                    = 0;
-   theNumberOfCompressionLookupOffsetRecords    = 0;
-   theNumberOfCompressionParameterOffsetRecords = 0;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfCoverageSection.cpp b/ossim/src/ossim/support_data/ossimRpfCoverageSection.cpp
deleted file mode 100644
index b82407f..0000000
--- a/ossim/src/ossim/support_data/ossimRpfCoverageSection.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-// 
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfCoverageSection.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <istream>
-#include <iostream>
-
-#include <ossim/support_data/ossimRpfCoverageSection.h>
-#include <ossim/base/ossimCommon.h> /* ossim::byteOrder */
-#include <ossim/base/ossimEndian.h>
-
-std::ostream& operator <<(std::ostream &out, const ossimRpfCoverageSection &data)
-{
-   return data.print(out);
-}
-
-ossimRpfCoverageSection::ossimRpfCoverageSection()
-   :
-   theUpperLeftLat(0.0),
-   theUpperLeftLon(0.0),
-
-   theLowerLeftLat(0.0),
-   theLowerLeftLon(0.0),
-
-   theUpperRightLat(0.0),
-   theUpperRightLon(0.0),
-
-   theLowerRightLat(0.0),
-   theLowerRightLon(0.0),
-
-   theVerticalResolution(0.0),
-   theHorizontalResolution(0.0),
-
-   theVerticalInterval(0.0),
-   theHorizontalInterval(0.0)
-{
-}
-
-ossimRpfCoverageSection::ossimRpfCoverageSection(const ossimRpfCoverageSection& obj)
-   :
-   theUpperLeftLat(obj.theUpperLeftLat),
-   theUpperLeftLon(obj.theUpperLeftLon),
-
-   theLowerLeftLat(obj.theLowerLeftLat),
-   theLowerLeftLon(obj.theLowerLeftLon),
-
-   theUpperRightLat(obj.theUpperRightLat),
-   theUpperRightLon(obj.theUpperRightLon),
-
-   theLowerRightLat(obj.theLowerRightLat),
-   theLowerRightLon(obj.theLowerRightLon),
-
-   theVerticalResolution(obj.theVerticalResolution),
-   theHorizontalResolution(obj.theHorizontalResolution),
-
-   theVerticalInterval(obj.theVerticalInterval),
-   theHorizontalInterval(obj.theHorizontalInterval)
-{
-}
-
-const ossimRpfCoverageSection& ossimRpfCoverageSection::operator=(
-   const ossimRpfCoverageSection& rhs)
-{
-   if ( this != & rhs )
-   {
-      theUpperLeftLat = rhs.theUpperLeftLat;
-      theUpperLeftLon = rhs.theUpperLeftLon;
-      
-      theLowerLeftLat = rhs.theLowerLeftLat;
-      theLowerLeftLon = rhs.theLowerLeftLon;
-      
-      theUpperRightLat = rhs.theUpperRightLat;
-      theUpperRightLon = rhs.theUpperRightLon;
-      
-      theLowerRightLat = rhs.theLowerRightLat;
-      theLowerRightLon = rhs.theLowerRightLon;
-      
-      theVerticalResolution = rhs.theVerticalResolution;
-      theHorizontalResolution = rhs.theHorizontalResolution;
-      
-      theVerticalInterval = rhs.theVerticalInterval;
-      theHorizontalInterval = rhs.theHorizontalInterval;
-   }
-   return *this;
-}
-
-ossimErrorCode ossimRpfCoverageSection::parseStream(std::istream &in,
-                                                    ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      in.read((char*)&theUpperLeftLat,  8);
-      in.read((char*)&theUpperLeftLon,  8);
-      in.read((char*)&theLowerLeftLat,  8);
-      in.read((char*)&theLowerLeftLon,  8);
-      in.read((char*)&theUpperRightLat, 8);
-      in.read((char*)&theUpperRightLon, 8);
-      in.read((char*)&theLowerRightLat, 8);
-      in.read((char*)&theLowerRightLon, 8);
-      in.read((char*)&theVerticalResolution,   8);
-      in.read((char*)&theHorizontalResolution, 8);
-      in.read((char*)&theVerticalInterval,     8);
-      in.read((char*)&theHorizontalInterval,   8);
-
-      if( ossim::byteOrder()  != byteOrder )
-      {
-         ossimEndian anEndian;
-         anEndian.swap(theUpperLeftLat);
-         anEndian.swap(theUpperLeftLon);
-         anEndian.swap(theLowerLeftLat);
-         anEndian.swap(theLowerLeftLon);
-         anEndian.swap(theUpperRightLat);
-         anEndian.swap(theUpperRightLon);
-         anEndian.swap(theLowerRightLat);
-         anEndian.swap(theLowerRightLon);
-         anEndian.swap(theVerticalResolution);
-         anEndian.swap(theHorizontalResolution);
-         anEndian.swap(theVerticalInterval);
-         anEndian.swap(theHorizontalInterval);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfCoverageSection::writeStream(std::ostream& out)
-{
-   ossimEndian anEndian;
-
-   if( anEndian.getSystemEndianType() != OSSIM_BIG_ENDIAN )
-   {
-      // Always write out big endian.
-      anEndian.swap(theUpperLeftLat);
-      anEndian.swap(theUpperLeftLon);
-      anEndian.swap(theLowerLeftLat);
-      anEndian.swap(theLowerLeftLon);
-      anEndian.swap(theUpperRightLat);
-      anEndian.swap(theUpperRightLon);
-      anEndian.swap(theLowerRightLat);
-      anEndian.swap(theLowerRightLon);
-      anEndian.swap(theVerticalResolution);
-      anEndian.swap(theHorizontalResolution);
-      anEndian.swap(theVerticalInterval);
-      anEndian.swap(theHorizontalInterval);
-   }     
-   
-   out.write((char*)&theUpperLeftLat,  8);
-   out.write((char*)&theUpperLeftLon,  8);
-   out.write((char*)&theLowerLeftLat,  8);
-   out.write((char*)&theLowerLeftLon,  8);
-   out.write((char*)&theUpperRightLat, 8);
-   out.write((char*)&theUpperRightLon, 8);
-   out.write((char*)&theLowerRightLat, 8);
-   out.write((char*)&theLowerRightLon, 8);
-   out.write((char*)&theVerticalResolution,   8);
-   out.write((char*)&theHorizontalResolution, 8);
-   out.write((char*)&theVerticalInterval,     8);
-   out.write((char*)&theHorizontalInterval,   8);
-   
-   if( anEndian.getSystemEndianType() != OSSIM_BIG_ENDIAN )
-   {
-      // Swap back to native byte order.
-      anEndian.swap(theUpperLeftLat);
-      anEndian.swap(theUpperLeftLon);
-      anEndian.swap(theLowerLeftLat);
-      anEndian.swap(theLowerLeftLon);
-      anEndian.swap(theUpperRightLat);
-      anEndian.swap(theUpperRightLon);
-      anEndian.swap(theLowerRightLat);
-      anEndian.swap(theLowerRightLon);
-      anEndian.swap(theVerticalResolution);
-      anEndian.swap(theHorizontalResolution);
-      anEndian.swap(theVerticalInterval);
-      anEndian.swap(theHorizontalInterval);
-   }
-}
-
-std::ostream& ossimRpfCoverageSection::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   out << prefix << "ul_lat: "
-       << theUpperLeftLat << "\n"
-       << prefix << "ul_lon: "
-       << theUpperLeftLon << "\n"
-       << prefix << "ll_lat: "
-       << theLowerLeftLat << "\n"
-       << prefix << "ll_lon: "
-       << theLowerLeftLon << "\n"
-       << prefix << "ur_lat: "
-       << theUpperRightLat << "\n"
-       << prefix << "ur_lon: "
-       << theUpperRightLon << "\n"
-       << prefix << "lr_lat: "
-       << theLowerRightLat << "\n"
-       << prefix << "lr_lon: "
-       << theLowerRightLon << "\n"
-       << prefix << "vertical_resolution: "
-       << theVerticalResolution << "\n"
-       << prefix << "horizontal_resolution: "
-       << theHorizontalResolution << "\n"
-       << prefix << "vertical_interval: "
-       << theVerticalInterval << "\n"
-       << prefix << "horizontal_interval: "
-       << theHorizontalInterval << std::endl;
-   return out;
-}
-
-void ossimRpfCoverageSection::clearFields()
-{
-   theUpperLeftLat  = 0.0;
-   theUpperLeftLon  = 0.0;
-   theLowerLeftLat  = 0.0;
-   theLowerLeftLon  = 0.0;
-   theUpperRightLat = 0.0;
-   theUpperRightLon = 0.0;
-   theLowerRightLat = 0.0;
-   theLowerRightLon = 0.0;
-   theVerticalResolution   = 0.0;
-   theHorizontalResolution = 0.0;
-   theVerticalInterval     = 0.0;
-   theHorizontalInterval   = 0.0;
-}
-
-void ossimRpfCoverageSection::setUlLat(ossim_float64 value)
-{
-   theUpperLeftLat = value;
-}
-
-void ossimRpfCoverageSection::setUlLon(ossim_float64 value)
-{
-   theUpperLeftLon = value;
-}
-
-void ossimRpfCoverageSection::setLlLat(ossim_float64 value)
-{
-   theLowerLeftLat = value;
-}
-
-void ossimRpfCoverageSection::setLlLon(ossim_float64 value)
-{
-   theLowerLeftLon = value;
-}
-
-void ossimRpfCoverageSection::setLrLat(ossim_float64 value)
-{
-   theLowerRightLat = value;
-}
-
-void ossimRpfCoverageSection::setLrLon(ossim_float64 value)
-{
-   theLowerRightLon = value;
-}
-
-void ossimRpfCoverageSection::setUrLat(ossim_float64 value)
-{
-   theUpperRightLat = value;
-}
-
-void ossimRpfCoverageSection::setUrLon(ossim_float64 value)
-{
-   theUpperRightLon = value;
-}
-
-void ossimRpfCoverageSection::setVerticalResolution(ossim_float64 value)
-{
-   theVerticalResolution = value;
-}
-
-void ossimRpfCoverageSection::setHorizontalResolution(ossim_float64 value)
-{
-   theHorizontalResolution = value;
-}
-
-void ossimRpfCoverageSection::setVerticalInterval(ossim_float64 value)
-{
-   theVerticalInterval = value;
-}
-
-void ossimRpfCoverageSection::setHorizontalInterval(ossim_float64 value)
-{
-   theHorizontalInterval = value;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfFrame.cpp b/ossim/src/ossim/support_data/ossimRpfFrame.cpp
deleted file mode 100644
index 14c950d..0000000
--- a/ossim/src/ossim/support_data/ossimRpfFrame.cpp
+++ /dev/null
@@ -1,1130 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-// Description: This class give the capability to access tiles from an
-//              rpf file.
-//
-//********************************************************************
-// $Id: ossimRpfFrame.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimRpfFrame.h>
-#include <ossim/support_data/ossimRpfHeader.h>
-#include <ossim/support_data/ossimRpfAttributes.h>
-#include <ossim/support_data/ossimRpfAttributeOffsetRecord.h>
-#include <ossim/support_data/ossimRpfAttributeSectionSubheader.h>
-#include <ossim/support_data/ossimRpfCoverageSection.h>
-#include <ossim/support_data/ossimRpfImageDescriptionSubheader.h>
-#include <ossim/support_data/ossimRpfImageDisplayParameterSubheader.h>
-#include <ossim/support_data/ossimRpfMaskSubheader.h>
-#include <ossim/support_data/ossimRpfCompressionSection.h>
-#include <ossim/support_data/ossimRpfColorGrayscaleSubheader.h>
-#include <ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h>
-#include <ossim/support_data/ossimRpfColorConverterSubsection.h>
-#include <ossim/support_data/ossimRpfColorConverterTable.h>
-#include <ossim/support_data/ossimRpfColorGrayscaleTable.h>
-#include <ossim/support_data/ossimRpfLocationSection.h>
-#include <ossim/support_data/ossimRpfColorConverterSubsection.h>
-#include <ossim/support_data/ossimRpfConstants.h>
-#include <ossim/support_data/ossimRpfReplaceUpdateRecord.h>
-#include <ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/support_data/ossimNitfFileHeader.h>
-#include <ossim/support_data/ossimNitfTagInformation.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimTrace.h>
-#include <istream>
-#include <ostream>
-
-static const ossimTrace traceDebug("ossimRpfFrame:debug");
-
-std::ostream& operator <<(std::ostream& out, const ossimRpfFrame& data)
-{
-   data.print(out);
-   
-   return out;
-}
-
-ossimRpfFrame::ossimRpfFrame()
-   :theHeader(0),
-    theFilename(""),
-    theCoverage(0),
-    theAttributes(0),
-    theImageDescriptionSubheader(0),
-    theMaskSubheader(0),
-    theImageDisplayParameterSubheader(0),
-    theCompressionSection(0),
-    theColorGrayscaleSubheader(0),
-    theColorConverterSubsection(0),
-    theNitfFile(0),
-    theSubframeMaskTable(0),
-    theSubframeTransparencyMaskTable(0),
-    theReplaceUpdateTable(0)
-{
-}
-
-ossimRpfFrame::~ossimRpfFrame()
-{
-   deleteAll();
-}
-
-std::ostream& ossimRpfFrame::print(std::ostream& out, const std::string& prefix) const
-{
-   if (traceDebug())
-   {
-      out << "begin_rpf_frame_print:\n";
-   }
-   
-   if(theHeader)
-   {
-      theHeader->print(out, prefix);
-   }
-
-   out << prefix << "filename: " << theFilename << "\n";
-
-   if ( theReplaceUpdateTable.valid() )
-   {
-      theReplaceUpdateTable->print(out, prefix);
-   }
-
-   if (traceDebug())
-   {
-      if(theCoverage)
-      {
-         theCoverage->print(out, prefix);
-      }
-   }
-
-   if(theAttributes)
-   {
-      theAttributes->print(out, prefix);
-   }
-
-   if (traceDebug())
-   {
-      if(theImageDescriptionSubheader)
-      {
-         theImageDescriptionSubheader->print(out, prefix);
-      }
-      
-      if(theMaskSubheader)
-      {
-         out << *theMaskSubheader << endl;
-      }
-      if(theImageDisplayParameterSubheader)
-      {
-         out << *theImageDisplayParameterSubheader << endl;
-      }
-      if(theCompressionSection)
-      {
-         out << *theCompressionSection << endl;
-      }
-      if(theColorGrayscaleSubheader)
-      {
-         out << *theColorGrayscaleSubheader << endl;
-      }
-      if(theColorConverterSubsection)
-      {
-         out << *theColorConverterSubsection << endl;
-      }
-      
-      copy(theColorGrayscaleTable.begin(),
-           theColorGrayscaleTable.end(),
-           ostream_iterator<ossimRpfColorGrayscaleTable>(out, "\n"));
-      
-      if(theImageDescriptionSubheader&&
-         !(theImageDescriptionSubheader->isSubframeMaskTableOffsetNull()))
-      {
-         out << "Subframe Mask Table:" << endl;
-         unsigned long spectralIndex;
-         unsigned long rowIndex;
-         unsigned long colIndex;
-         // first loop through the Mask table and allocate while we do it
-         for(spectralIndex = 0;
-             spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
-             ++spectralIndex)
-         {
-            for(rowIndex = 0;
-                rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
-                ++rowIndex)
-            {
-               for(colIndex = 0;
-                   colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
-                   ++colIndex)
-               {
-                  if( theSubframeMaskTable[spectralIndex][rowIndex][colIndex] == OSSIM_RPF_ULONG_NULL)
-                  {
-                     out << "NULL ";
-                  }
-                  else
-                  {
-                     out << theSubframeMaskTable[spectralIndex][rowIndex][colIndex] << " ";
-                  }
-               }
-               out << endl;
-            }
-         }
-      }
-
-
-      if(theImageDescriptionSubheader&&
-         !(theImageDescriptionSubheader->isTransparencyMaskTableOffsetNull()))
-      {
-         out << "Transparency Mask Table:" << endl;
-         unsigned long spectralIndex;
-         unsigned long rowIndex;
-         unsigned long colIndex;
-         // first loop through the Mask table and allocate while we do it
-         for(spectralIndex = 0;
-             spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
-             ++spectralIndex)
-         {
-            for(rowIndex = 0;
-                rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
-                ++rowIndex)
-            {
-               for(colIndex = 0;
-                   colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
-                   ++colIndex)
-               {
-                  if( theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] == OSSIM_RPF_ULONG_NULL)
-                  {
-                     out << "NULL ";
-                  }
-                  else
-                  {
-                     out << theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] << " ";
-                  }
-               }
-            }
-         }
-      }
-
-
-      
-      out << "end_rpf_frame_print:\n";
-      
-   } // matches:  if (traceDebug())
-
-   out << std::endl;
-   
-   return out;
-}
-
-ossimErrorCode ossimRpfFrame::parseFile(const ossimFilename& filename,
-                                        bool minimalParse)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfFrame::parseFile: entered......" << std::endl;
-   }
-   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
-
-   //Make sure any fileds have beend cleared
-   clearFields();
-
-   // Make sure all data is deleted.  The initialize call the
-   // populate methods.  These methods will re-allocate the information
-   deleteAll();
-
-
-   theNitfFile = new ossimNitfFile;
-   theNitfFile->parseFile(filename);
-   
-   const ossimRefPtr<ossimNitfFileHeader> nitfFileHeader =
-      theNitfFile.valid() ? theNitfFile->getHeader() : 0;
-
-   if(!nitfFileHeader)
-   {
-      theNitfFile = 0;
-
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   ossimNitfTagInformation info;
-   nitfFileHeader->getTag(info, "RPFHDR");
-
-   theFilename = filename;
-   if(info.getTagName() == "RPFHDR")
-   {
-      ifstream in(filename.c_str(), ios::in|ios::binary);
-      // set the get pointer for the stream to the start
-      // of the Rpf header data
-      in.seekg(info.getTagDataOffset(), ios::beg);
-
-      if(theHeader) delete theHeader;
-      theHeader = new ossimRpfHeader;
-      
-      // if(theHeader->parseStream(in) != ossimErrorCodes::OSSIM_OK)
-      theHeader->parseStream(in);
-
-      if ( in.fail() )
-      {
-         deleteAll();
-         
-         return ossimErrorCodes::OSSIM_ERROR;
-      }
-      else
-         // if(!in.fail()&&theHeader)
-      {
-         result = populateAttributeSection(in);
-
-         // This is needed for ossim-rpf --list-frames so NOT put in full parse section.
-         if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
-         {
-            result = populateReplaceUpdateTable(in);
-         }
-
-         if ( minimalParse == false )
-         {
-            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
-            {
-               populateCompressionSection(in);
-            }
-            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
-            {
-               result = populateCoverageSection(in);
-            }
-            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
-            {
-               result = populateImageSection(in);
-            }
-            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
-            {
-               result = populateColorGrayscaleSection(in);
-            }
-            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
-            {
-               result = populateMasks(in);
-            }
-         }
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-bool ossimRpfFrame::hasSubframeMaskTable()const
-{
-   if(theImageDescriptionSubheader)
-   {
-      return (!theImageDescriptionSubheader->isSubframeMaskTableOffsetNull());
-   }
-
-   return false;
-          
-}
-
-bool ossimRpfFrame::fillSubFrameBuffer(ossim_uint8* buffer,
-                                       ossim_uint32 /* spectralGroup */,
-                                       ossim_uint32 row,
-                                       ossim_uint32 col)const
-{
-   if(theImageDescriptionSubheader &&
-      theImageDisplayParameterSubheader&&
-      theHeader&&
-      (col < theImageDescriptionSubheader->getNumberOfSubframesHorizontal()) &&
-      (row < theImageDescriptionSubheader->getNumberOfSubframesVertical()))
-   {
-      ossimRpfComponentLocationRecord info;
-      
-      if(!theHeader->getLocationSection()->getComponent(OSSIM_RPF_SPATIAL_DATA_SUBSECTION, info))
-      {
-         return false;
-      }
-      
-      ossim_uint32 offset = info.m_componentLocation;
-      ossim_uint32 bytesPerSubframe = 0;
-
-      // note that the code length is bit encoded so we must devide by 8
-      // in order to get the byte offset instead of the bit offset.  We
-      // then add that to the start of the spatial data section which is
-      // the current value of offset.
-      bytesPerSubframe = (theImageDisplayParameterSubheader->getNumberOfImageRows()*
-                          theImageDisplayParameterSubheader->getNumberOfImageCodesPerRow()*
-                          theImageDisplayParameterSubheader->getImageCodeLength())/8;
-      
-         
-      if(hasSubframeMaskTable())
-      {
-         // check to see if the offset is NULL.  If it is
-         // then just return false to let the caller know that the
-         // buffer did not exist.
-         if(theSubframeMaskTable[0][row][col] != OSSIM_RPF_ULONG_NULL)
-         {
-            offset += theSubframeMaskTable[0][row][col];
-         }
-         else
-         {
-            return false;
-         }
-      }
-      else
-      {
-         ossim_uint32 bytes = bytesPerSubframe*(row*theImageDescriptionSubheader->getNumberOfSubframesHorizontal()+
-                                                col);
-         offset += bytes;
-      }
-      
-      // now since we have the adjustment and we got to this point then
-      // we can read in the data into the destination buffer.
-      ifstream in(theFilename.c_str(), ios::in|ios::binary);
-      if(!in.fail())
-      {
-         in.seekg(offset, ios::beg);
-         in.read((char*)buffer, bytesPerSubframe);
-         if(in.fail())
-         {
-            return false;
-         }
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      // this is if it was not within the rows and cols of
-      // the subframe or if the image description header didn't exist
-      return false;
-   }
-
-   return true;
-}
-
-void ossimRpfFrame::clearFields()
-{   
-   theFilename = "";
-}
-
-void ossimRpfFrame::deleteAll()
-{
-   if(theHeader)
-   {
-      delete theHeader;
-      theHeader = 0;
-   }
-   if(theAttributes)
-   {
-      delete theAttributes;
-      theAttributes = 0;
-   }
-   if(theCoverage)
-   {
-      delete theCoverage;
-      theCoverage = 0;
-   }
-   if(theImageDescriptionSubheader)
-   {
-      delete theImageDescriptionSubheader;
-      theImageDescriptionSubheader = 0;
-   }
-   if(theMaskSubheader)
-   {
-      delete theMaskSubheader;
-      theMaskSubheader = 0;
-   }
-   if(theImageDisplayParameterSubheader)
-   {
-      delete theImageDisplayParameterSubheader;
-      theImageDisplayParameterSubheader = 0;
-   }
-   if(theCompressionSection)
-   {
-      delete theCompressionSection;
-      theCompressionSection = 0;
-   }
-   if(theColorGrayscaleSubheader)
-   {
-      delete theColorGrayscaleSubheader;
-      theColorGrayscaleSubheader = 0;
-   }
-   if(theColorConverterSubsection)
-   {
-      delete theColorConverterSubsection;
-      theColorConverterSubsection = 0;
-   }
-   if (theNitfFile.valid())
-   {
-      theNitfFile = 0;
-   }
-}
-
-ossimErrorCode ossimRpfFrame::populateCoverageSection(istream& in)
-{
-   if(theCoverage) delete theCoverage;
-   theCoverage = 0;
-   if(theHeader)
-   {
-      theCoverage = theHeader->getNewCoverageSection(in);
-   }
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-ossimErrorCode ossimRpfFrame::populateCompressionSection(istream& in)
-{
-   if(theCompressionSection) delete theCompressionSection;
-   theCompressionSection = 0;
-   if(theHeader)
-   {
-      theCompressionSection = theHeader->getNewCompressionSection(in);
-   }
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-ossimErrorCode ossimRpfFrame::populateColorGrayscaleSection(istream& in)
-{
-   ossimErrorCode resultError = ossimErrorCodes::OSSIM_OK;
-   if(theColorGrayscaleSubheader) delete theColorGrayscaleSubheader;
-   theColorGrayscaleSubheader = 0;
-   if(theHeader)
-   {
-      theColorGrayscaleSubheader  = theHeader->getNewColorGrayscaleSubheader(in);
-
-      if(theColorGrayscaleSubheader)
-      {
-         const ossimRpfLocationSection* location = theHeader->getLocationSection();
-         if(location)
-         {
-            ossimRpfComponentLocationRecord component;
-            
-            if(location->getComponent(OSSIM_RPF_COLOR_CONVERTER_SUBSECTION,
-                                     component))
-            {
-               in.seekg(component.m_componentLocation,ios::beg);
-               if(theColorConverterSubsection) delete theColorConverterSubsection;
-               theColorConverterSubsection = new ossimRpfColorConverterSubsection;
-               theColorConverterSubsection->setNumberOfColorConverterOffsetRecords(
-                  theColorGrayscaleSubheader->getNumberOfColorConverterOffsetRecords());
-               resultError = theColorConverterSubsection->parseStream(in, theHeader->getByteOrder());
-            }
-            if(location->getComponent(OSSIM_RPF_COLORMAP_SUBSECTION, component))
-            {
-               in.seekg(component.m_componentLocation, ios::beg);
-               
-               theColorGrayscaleTable.clear();
-               theColorGrayscaleTable.resize(theColorGrayscaleSubheader->getNumberOfColorGreyscaleOffsetRecords());
-
-               // we will ignore the offset table offset which is a 4 byte value
-               // and ignore the offset record length which is a 2 byte value.
-               // This is suppose to put us at the beginning of the
-               // [color/grayscale offset record].  The total number of
-               // these offset records is found in the [color/grayscale section
-               // subheader.
-               in.ignore(6);
-               for(ossim_uint32 index = 0;
-                   index < theColorGrayscaleSubheader->getNumberOfColorGreyscaleOffsetRecords();
-                   ++index)
-               {
-                  
-                  ossimRpfColorGrayscaleOffsetRecord grayscaleOffsetRecord;
-
-                  if(grayscaleOffsetRecord.parseStream(in, theHeader->getByteOrder()) == ossimErrorCodes::OSSIM_OK)
-                  {
-                     ossim_uint32 rememberLocation = in.tellg();
-                     in.seekg(grayscaleOffsetRecord.getColorGrayscaleTableOffset()+component.m_componentLocation, ios::beg);
-                     theColorGrayscaleTable[index].setTableData(grayscaleOffsetRecord.getColorGrayscaleTableId(),
-                                                                grayscaleOffsetRecord.getNumberOfColorGrayscaleRecords());
-                     theColorGrayscaleTable[index].parseStream(in, theHeader->getByteOrder());
-                     in.seekg(rememberLocation, ios::beg);
-                  }
-                  else
-                  {
-                     return ossimErrorCodes::OSSIM_ERROR;
-                  }
-               }
-            }
-         }
-      }
-   }
-   
-   return resultError;
-}
-
-ossimErrorCode ossimRpfFrame::populateImageSection(istream& in)
-{
-   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
-   if(theImageDescriptionSubheader) delete theImageDescriptionSubheader;
-   theImageDescriptionSubheader = 0;
-   if(theHeader&&in)
-   {
-      // get the subheader information.
-      theImageDescriptionSubheader = theHeader->getNewImageDescriptionSubheader(in);
-
-      
-      // need to do something with the table before going to the display.
-      if(theImageDescriptionSubheader &&(!theImageDescriptionSubheader->isSubframeMaskTableOffsetNull()))
-      {
-         if(theMaskSubheader) delete theMaskSubheader;
-         // need to get the mask subheader
-         theMaskSubheader = new ossimRpfMaskSubheader;
-
-         // seek to the start of the subheader
-         in.seekg(theImageDescriptionSubheader->getEndOffset() +
-                  theImageDescriptionSubheader->getSubframeMaskTableOffset(), ios::beg);
-
-         // get the information
-         result = theMaskSubheader->parseStream(in, theHeader->getByteOrder());
-      }
-
-      if(theImageDisplayParameterSubheader) delete theImageDisplayParameterSubheader;
-      // Get the display parameter header
-      theImageDisplayParameterSubheader = theHeader->getNewImageDisplayParameterSubheader(in);
-   }
-   return result;
-}
-
-ossimErrorCode ossimRpfFrame::populateAttributeSection(istream& in)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimRpfFrame::populateAttributeSection:  entered ..." << std::endl;
-   }
-   ossimRpfAttributeSectionSubheader* temp = 0;
-   
-   const ossimRpfLocationSection* location = theHeader->getLocationSection();
-   if(location)
-   {
-      ossimRpfComponentLocationRecord component;
-      
-      if(location->getComponent(OSSIM_RPF_ATTRIBUTE_SECTION_SUBHEADER,
-                               component))
-      {
-         temp = new ossimRpfAttributeSectionSubheader;
-         in.seekg(component.m_componentLocation, std::ios::beg);
-         if(temp->parseStream(in, theHeader->getByteOrder()) != ossimErrorCodes::OSSIM_OK)
-         {
-            delete temp;
-            temp =0;
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimRpfFrame::populateAttributeSection:  leaving 1 ..." << std::endl;
-            }
-            return ossimErrorCodes::OSSIM_ERROR;
-         }
-      }
-   }
-   if(!in.fail()&&temp)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: Has attribute section" << std::endl;
-      }
-      if(theAttributes) delete theAttributes;
-      theAttributes = new ossimRpfAttributes;
-      ossimRpfAttributeOffsetRecord record;
-      ossim_uint64 locationAttributeSubsection = in.tellg();
-      ossim_uint64 absoluteAddresToTable = locationAttributeSubsection + temp->getAttributeOffsetTableOffset();
-      ossimEndian anEndian;
-
-      
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG: Number of attributes = "
-            <<  temp->getNumberOfAttributeOffsetRecords()
-            << std::endl;
-      }
-      in.seekg(absoluteAddresToTable, ios::beg);
-      for(ossim_uint32 index = 0;
-          index < temp->getNumberOfAttributeOffsetRecords();
-          index++)
-      {
-         if((!in.fail())&&
-            record.parseStream(in, theHeader->getByteOrder()) ==
-            ossimErrorCodes::OSSIM_OK)
-         {
-            // make sure we save the current position.  The attribute
-            // parser in the switch/case will change the location and
-            // we must come back to the start of the next record.
-            ossim_uint64 currentLocation = in.tellg();
-
-            // go to the location of the start of the attribute.               
-            in.seekg(locationAttributeSubsection + record.getAttributeRecordOffset(), ios::beg);
-
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "DEBUG: Parsing attribute number  " << index
-                  << " with id = " << record.getAttributeId()
-                  << std::endl;
-            }
-            // allocate some temporary space for the string type
-            // attributes.
-            char tempString[50];
-            if(!theAttributes->getAttributeFlag(record.getAttributeId()))
-            {
-               theAttributes->setAttributeFlag(record.getAttributeId(), true);
-               switch(record.getAttributeId())
-               {
-               case 1:
-               {
-                  in.read((char*)tempString, 8);
-                  tempString[8] = '\0';
-                  theAttributes->theCurrencyDate = tempString;
-                  break;
-               }
-               case 2:
-               {
-                  in.read((char*)tempString, 8);
-                  tempString[8] = '\0';
-                  theAttributes->theProductionDate = tempString;
-                  break;
-               }
-               case 3:
-               {
-                  in.read((char*)tempString, 8);
-                  tempString[8] = '\0';
-                  theAttributes->theSignificantDate = tempString;
-                  break;
-               }
-               case 4:
-               {
-                  in.read((char*)tempString, 10);
-                  theAttributes->theChartSeriesCode = ossimString(tempString,
-                                                                  &tempString[10]);
-                  in.read((char*)tempString, 8);
-                  theAttributes->theMapDesignationCode = ossimString(tempString,
-                                                                     &tempString[8]);
-                  in.read((char*)tempString, 4);
-                  theAttributes->theOldHorDatum = ossimString(tempString,
-                                                              &tempString[4]);
-                  in.read((char*)tempString, 7);
-                  theAttributes->theEdition = ossimString(tempString,
-                                                          &tempString[7]);
-                  break;
-               }
-               case 5:
-               {
-                  in.read((char*)tempString, 2);
-                  theAttributes->theProjectionCode = ossimString(tempString,
-                                                                 &tempString[2]);
-                  theAttributes->theProjectionCode = theAttributes->theProjectionCode.upcase();
-                  if((theAttributes->theProjectionCode == "AC") ||
-                     (theAttributes->theProjectionCode == "LE") ||
-                     (theAttributes->theProjectionCode == "PG"))
-                  {
-                     in.read((char*)&(theAttributes->theProjectionA), 4);
-                     in.read((char*)&(theAttributes->theProjectionB), 4);
-                     in.read((char*)&(theAttributes->theProjectionC), 4);
-                     in.read((char*)&(theAttributes->theProjectionD), 4);
-                  }
-                  else if((theAttributes->theProjectionCode == "RB") ||
-                          (theAttributes->theProjectionCode == "OC") ||
-                          (theAttributes->theProjectionCode == "TC"))
-                  {
-                     in.read((char*)&(theAttributes->theProjectionA), 4);
-                     in.read((char*)&(theAttributes->theProjectionB), 4);
-                     in.read((char*)&(theAttributes->theProjectionC), 4);
-                  }
-                  else if((theAttributes->theProjectionCode == "AL") ||
-                          (theAttributes->theProjectionCode == "MC") ||
-                          (theAttributes->theProjectionCode == "OD") ||
-                          (theAttributes->theProjectionCode == "PH"))
-                  {
-                     in.read((char*)&(theAttributes->theProjectionA), 4);
-                     in.read((char*)&(theAttributes->theProjectionB), 4);
-                  }
-                  else if((theAttributes->theProjectionCode == "UT"))
-                  {
-                     in.read((char*)&(theAttributes->theProjectionA), 4);
-                  }
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theProjectionA);
-                     anEndian.swap(theAttributes->theProjectionB);
-                     anEndian.swap(theAttributes->theProjectionC);
-                     anEndian.swap(theAttributes->theProjectionD);
-                  }
-                  break;
-               }
-               case 6:
-               {
-                  in.read((char*)tempString, 4);
-                  theAttributes->theVertDatumCode = ossimString(tempString,
-                                                                &tempString[4]);
-                  break;
-               }
-               case 7:
-               {
-                  in.read((char*)tempString, 4);
-                  theAttributes->theHorDatumCode = ossimString(tempString,
-                                                               &tempString[4]);
-                  break;
-               }
-               case 8:
-               {
-                  in.read((char*)&(theAttributes->theVertAbsAccuracy), 4);
-                  in.read((char*)&(theAttributes->theVertAbsUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theVertAbsAccuracy);
-                     anEndian.swap(theAttributes->theVertAbsUnits);
-                  }
-                  break;
-               }
-               case 9:
-               {
-                  in.read((char*)&(theAttributes->theHorAbsAccuracy), 4);
-                  in.read((char*)&(theAttributes->theHorAbsUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theHorAbsAccuracy);
-                     anEndian.swap(theAttributes->theHorAbsUnits);
-                  }
-                  break;
-               }
-               case 10:
-               {
-                  in.read((char*)&(theAttributes->theVertRelAccuracy), 4);
-                  in.read((char*)&(theAttributes->theVertRelUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theVertRelAccuracy);
-                     anEndian.swap(theAttributes->theVertRelUnits);
-                  }
-                  break;
-               }
-               case 11:
-               {
-                  in.read((char*)&(theAttributes->theHorRelAccuracy), 4);
-                  in.read((char*)&(theAttributes->theHorRelUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theHorRelAccuracy);
-                     anEndian.swap(theAttributes->theHorRelUnits);
-                  }
-                  break;
-               }            
-               case 12:
-               {
-                  in.read((char*)tempString, 3);
-                  theAttributes->ellipsoidCode = ossimString(tempString,
-                                                             &tempString[3]);
-                  break;
-               }            
-               case 13:
-               {
-                  in.read((char*)tempString, 4);
-                  theAttributes->theSoundingDatumCode = ossimString(tempString,
-                                                                    &tempString[4]);
-                  break;
-               }            
-               case 14:
-               {
-                  in.read((char*)&(theAttributes->theNavSystemCode), 2);
-                  
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theNavSystemCode);
-                  }
-                  break;
-               }            
-               case 15:
-               {
-                  in.read((char*)tempString, 2);
-                  theAttributes->theGridCode = ossimString(tempString,
-                                                           &tempString[2]);
-                  break;
-               }            
-               case 16:
-               {
-                  in.read((char*)&(theAttributes->theEeasterlyMagChange), 4);
-                  in.read((char*)&(theAttributes->theEasterlyMagChangeUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theEeasterlyMagChange);
-                     anEndian.swap(theAttributes->theEasterlyMagChangeUnits);
-                  }
-                  break;
-               }
-               case 17:
-               {
-                  in.read((char*)&(theAttributes->theWesterlyMagChange), 4);
-                  in.read((char*)&(theAttributes->theWesterlyMagChangeUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theWesterlyMagChange);
-                     anEndian.swap(theAttributes->theWesterlyMagChangeUnits);
-                  }
-                  break;
-               }
-               case 18:
-               {
-                  in.read((char*)&(theAttributes->theMagAngle), 4);
-                  in.read((char*)&(theAttributes->theMagAngleUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theMagAngle);
-                     anEndian.swap(theAttributes->theMagAngleUnits);
-                  }
-                  break;
-               }
-               case 19:
-               {
-                  in.read((char*)&(theAttributes->theGridConver), 4);
-                  in.read((char*)&(theAttributes->theGridConverUnits), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theGridConver);
-                     anEndian.swap(theAttributes->theGridConverUnits);
-                  }
-                  break;
-               }
-               case 20:
-               {
-                  in.read((char*)&(theAttributes->theHighElevation), 8);
-                  in.read((char*)&(theAttributes->theHighElevationUnits), 2);
-                  in.read((char*)&(theAttributes->theHighLat), 8);
-                  in.read((char*)&(theAttributes->theHighLon), 8);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theHighElevation);
-                     anEndian.swap(theAttributes->theHighElevationUnits);
-                     anEndian.swap(theAttributes->theHighLat);
-                     anEndian.swap(theAttributes->theHighLon);
-                  }
-                  break;
-               }
-               case 21:
-               {
-                  in.read((char*)tempString, 12);
-                  theAttributes->theLegendFileName = ossimString(tempString,
-                                                                 &tempString[12]);
-                  break;
-               }
-               case 22:
-               {
-                  in.read((char*)tempString, 12);
-                  tempString[12] = '\0';
-                  theAttributes->theDataSource = tempString;
-                  in.read((char*)&(theAttributes->theGsd), 4);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theGsd);
-                  }
-                  break;
-               }
-               case 23:
-               {
-                  in.read((char*)&(theAttributes->theDataLevel), 2);
-                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                  {
-                     anEndian.swap(theAttributes->theDataLevel);
-                  }
-                  break;
-               }
-               }
-            }
-            in.seekg(currentLocation, ios::beg);
-         }
-         else
-         {
-            delete temp;
-            temp = 0;
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimRpfFrame::populateAttributeSection:  leaving 2 ..." << std::endl;
-            }
-            return ossimErrorCodes::OSSIM_ERROR;
-         }
-      }
-   }
-   if(temp) delete temp;
-   temp = 0;
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimRpfFrame::populateAttributeSection:  leaving OK ..." << std::endl;
-   }
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-ossimErrorCode ossimRpfFrame::populateMasks(istream& in)
-{
-   theSubframeMaskTable.clear();
-   theSubframeTransparencyMaskTable.clear();
-
-   if(!in)
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   if(theImageDescriptionSubheader)
-   {
-      const ossimRpfLocationSection* location = theHeader->getLocationSection();
-      if(location)
-      {
-         ossimRpfComponentLocationRecord component;
-         
-         if(location->getComponent(OSSIM_RPF_MASK_SUBSECTION,
-                                   component))
-         {
-            
-            // now allocate the space we need and then reader the table in
-            
-            theSubframeMaskTable.resize(theImageDescriptionSubheader->getNumberOfSpectralGroups());
-            theSubframeTransparencyMaskTable.resize(theImageDescriptionSubheader->getNumberOfSpectralGroups());
-            
-            ossim_uint32 spectralIndex;
-            ossim_uint32 rowIndex;
-            ossim_uint32 colIndex;
-            
-            if(!theImageDescriptionSubheader->isSubframeMaskTableOffsetNull())
-            {
-               // move get to the first byte of the Mask table.  This is the offset from the
-               // start of the maskSubsection. 
-               in.seekg(component.m_componentLocation +
-                        theImageDescriptionSubheader->getSubframeMaskTableOffset(), ios::beg);
-               // first loop through the Mask table and allocate while we do it
-               for(spectralIndex = 0;
-                   spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
-                   ++spectralIndex)
-               {
-                  // reserve space for the number of rows
-                  theSubframeMaskTable[spectralIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesVertical());
-                  for(rowIndex = 0;
-                      rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
-                      ++rowIndex)
-                  {
-                     // allocate the columns
-                     theSubframeMaskTable[spectralIndex][rowIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesHorizontal());
-                     for(colIndex = 0;
-                         colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
-                         ++colIndex)
-                     {
-                        ossim_uint32 value;
-                        
-                        in.read((char*)&value, 4);
-                        ossimEndian anEndian;
-                        
-                        if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                        {
-                           anEndian.swap(value);
-                        }
-                        theSubframeMaskTable[spectralIndex][rowIndex][colIndex] = value;
-                     }
-                  }
-               }
-            }
-            if(!theImageDescriptionSubheader->isTransparencyMaskTableOffsetNull())
-            {
-               // move get to the first byte of the Mask table.  This is the offset from the
-               // start of the maskSubsection. 
-               in.seekg(component.m_componentLocation +
-                        theImageDescriptionSubheader->getTransparencyMaskTableOffset(),ios::beg);
-               for(spectralIndex = 0;
-                   spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
-                   ++spectralIndex)
-               {
-                  // reserve space for the number of rows
-                  theSubframeTransparencyMaskTable[spectralIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesVertical());
-                  for(rowIndex = 0;
-                      rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
-                      ++rowIndex)
-                  {
-                     // allocate the columns
-                     theSubframeTransparencyMaskTable[spectralIndex][rowIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesHorizontal());
-                     for(colIndex = 0;
-                         colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
-                         ++colIndex)
-                     {
-                        ossim_uint32 value;
-                        
-                        in.read((char*)&value, 4);
-                        ossimEndian anEndian;
-                        
-                        if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
-                        {
-                           anEndian.swap(value);
-                        }
-                        theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] = value;
-                     }
-                  }
-               }
-            }
-         }
-      }
-   }
-   
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-ossimErrorCode ossimRpfFrame::populateReplaceUpdateTable(std::istream& in)
-{
-   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
-   
-   const ossimRpfLocationSection* location = theHeader->getLocationSection();
-
-   if( location )
-   {
-      if ( location->hasComponent(OSSIM_RPF_REPLACE_UPDATE_SECTION_SUBHEADER) )
-      {
-         ossimRpfComponentLocationRecord component;
-         if( location->getComponent(OSSIM_RPF_REPLACE_UPDATE_SECTION_SUBHEADER, component) )
-         {
-            ossimRefPtr<ossimRpfReplaceUpdateSectionSubheader> hdr =
-               new ossimRpfReplaceUpdateSectionSubheader();
-            
-            in.seekg(component.m_componentLocation, ios::beg);
-            
-            if( hdr->parseStream( in, theHeader->getByteOrder() ) == ossimErrorCodes::OSSIM_OK )
-            {
-               ossim_uint16 count = hdr->getNumberOfRecords();
-               if ( count )
-               {
-                  if ( theReplaceUpdateTable.valid() )
-                  {
-                     theReplaceUpdateTable->clear();
-                  }
-                  else
-                  {
-                     theReplaceUpdateTable = new ossimRpfReplaceUpdateTable();
-                  }
-                  ossimRpfReplaceUpdateRecord record;
-                  for ( ossim_uint16 i = 0; i < count; ++i )
-                  {
-                     if ( record.parseStream(in) == ossimErrorCodes::OSSIM_OK )
-                     {
-                        theReplaceUpdateTable->addRecord( record );
-                     }
-                     else
-                     {
-                        break;
-                     }
-                  }
-               }
-               
-            }
-         }  
-      }
-   }
-
-   if ( in.fail() )
-   {
-      theReplaceUpdateTable = 0;
-      result = ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return result;
-
-} // End: ossimRpfFrame::populateReplaceUpdateTable(std::istream& in)
-
-ossimRefPtr<ossimRpfReplaceUpdateTable> ossimRpfFrame::getRpfReplaceUpdateTable() const
-{
-   return theReplaceUpdateTable;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfFrameEntry.cpp b/ossim/src/ossim/support_data/ossimRpfFrameEntry.cpp
deleted file mode 100644
index d658c1f..0000000
--- a/ossim/src/ossim/support_data/ossimRpfFrameEntry.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfFrameEntry.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ostream>
-#include <ossim/support_data/ossimRpfFrameEntry.h>
-
-std::ostream& operator<<(std::ostream& out, const ossimRpfFrameEntry& data)
-{
-   return data.print(out);
-}
-
-ossimRpfFrameEntry::ossimRpfFrameEntry(const ossimFilename& rootDirectory,
-                                       const ossimFilename& pathToFrameFileFromRoot)
-   :m_exists(false),
-    m_rootDirectory(rootDirectory),
-    m_pathToFrameFileFromRoot(pathToFrameFileFromRoot),
-    m_fullValidPath()
-{
-   setEntry(rootDirectory,
-            pathToFrameFileFromRoot);
-}
-
-ossimRpfFrameEntry::ossimRpfFrameEntry(const ossimRpfFrameEntry& obj)
-   :m_exists(obj.m_exists),
-    m_rootDirectory(obj.m_rootDirectory),
-    m_pathToFrameFileFromRoot(obj.m_pathToFrameFileFromRoot),
-    m_fullValidPath(obj.m_fullValidPath)
-{}
-
-const ossimRpfFrameEntry& ossimRpfFrameEntry::operator=(const ossimRpfFrameEntry& rhs)
-{
-   if (this != &rhs)
-   {
-      m_exists                  = rhs.m_exists;
-      m_rootDirectory           = rhs.m_rootDirectory;
-      m_pathToFrameFileFromRoot = rhs.m_pathToFrameFileFromRoot;
-      m_fullValidPath           = rhs.m_fullValidPath;
-   }
-   return *this;
-}
-
-void ossimRpfFrameEntry::setEntry(const ossimFilename& rootDirectory,
-                                  const ossimFilename& pathToFrameFileFromRoot)
-{
-   //---
-   // We must check for case combinations:
-   //---
-   m_rootDirectory           = rootDirectory;
-   m_pathToFrameFileFromRoot = pathToFrameFileFromRoot;
-   m_fullValidPath = m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
-
-   // Check as supplied:
-   if(m_fullValidPath.exists())
-   {
-      m_exists = true;
-   }
-   else // Check root/downcased_path
-   {
-      m_pathToFrameFileFromRoot = m_pathToFrameFileFromRoot.downcase();
-      m_fullValidPath = m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
-
-      if(m_fullValidPath.exists())
-      {
-         m_exists = true;
-      }
-      else // Check root/upcased_path
-      {
-         m_pathToFrameFileFromRoot = m_pathToFrameFileFromRoot.upcase();
-         m_fullValidPath =
-            m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
-         if(m_fullValidPath.exists())
-         {
-            m_exists = true;
-         }
-         else
-         {
-            m_pathToFrameFileFromRoot = pathToFrameFileFromRoot;
-            m_fullValidPath =
-               m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
-            m_exists = false;
-         }
-      }
-   }
-}
-std::ostream& ossimRpfFrameEntry::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   out << prefix << "exists:       " << m_exists << "\n"
-       << prefix << "root_directory: " << m_rootDirectory << "\n"
-       << prefix << "relative_path: "
-       << m_pathToFrameFileFromRoot << "\n"
-       << prefix << "full_path:     " << m_fullValidPath << "\n";
-
-   return out;
-}
-
-bool ossimRpfFrameEntry::exists() const
-{
-   return m_exists;
-}
-
-const ossimFilename& ossimRpfFrameEntry::getFullPath() const
-{
-   return m_fullValidPath;
-}
-
-const ossimString& ossimRpfFrameEntry::getRootDirectory() const
-{
-   return m_rootDirectory;
-}
-
-const ossimString ossimRpfFrameEntry::getPathToFrameFileFromRoot() const
-{
-   return m_pathToFrameFileFromRoot;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfHeader.cpp b/ossim/src/ossim/support_data/ossimRpfHeader.cpp
deleted file mode 100644
index ad16c54..0000000
--- a/ossim/src/ossim/support_data/ossimRpfHeader.cpp
+++ /dev/null
@@ -1,873 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: This class extends the stl's string class.
-//
-//********************************************************************
-// $Id: ossimRpfHeader.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <cstring>
-#include <iostream>
-#include <fstream>
-
-#include <ossim/support_data/ossimRpfHeader.h>
-#include <ossim/base/ossimCommon.h> /* ossim::byteOrder() */
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/support_data/ossimNitfCommon.h>
-#include <ossim/support_data/ossimRpfLocationSection.h>
-#include <ossim/support_data/ossimRpfCoverageSection.h>
-#include <ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h>
-#include <ossim/support_data/ossimRpfBoundaryRectTable.h>
-#include <ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h>
-#include <ossim/support_data/ossimRpfFrameFileIndexSubsection.h>
-#include <ossim/support_data/ossimRpfImageDescriptionSubheader.h>
-#include <ossim/support_data/ossimRpfMaskSubsection.h>
-#include <ossim/support_data/ossimRpfAttributeSectionSubheader.h>
-#include <ossim/support_data/ossimRpfImageDisplayParameterSubheader.h>
-#include <ossim/support_data/ossimRpfCompressionSectionSubheader.h>
-#include <ossim/support_data/ossimRpfCompressionSection.h>
-#include <ossim/support_data/ossimRpfColorGrayscaleSubheader.h>
-
-#include <ossim/base/ossimTrace.h>
-
- // Static trace for debugging
-static ossimTrace traceDebug("ossimRpfHeader:debug");
-
-// Keywords:
-static const ossimString HEADER_SECTION_LENGTH_KW    = "HeaderSectionLength";
-static const ossimString NEW_REP_UP_INDICATOR_KW     = "NewRepUpIndicator";
-static const ossimString GOV_SPEC_NUMBER_KW          = "GovSpecNumber";
-static const ossimString GOV_SPEC_DATE_KW            = "GovSpecDate";
-static const ossimString SECURITY_CLASSIFICATION_KW  = "SecurityClassification";
-static const ossimString COUNTRY_CODE_KW             = "CountryCode";
-static const ossimString SECURITY_RELEASE_MARKING_KW = "SecurityReleaseMarking";
-
-
-ossimRpfHeader::ossimRpfHeader()
-   :
-   ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
-   m_littleBigEndianIndicator(0x00),
-   m_headerSectionLength(48),
-   m_fileName(),
-   m_newRepUpIndicator(0),
-   m_govSpecNumber(),
-   m_govSpecDate(),
-   m_securityClassification(),
-   m_countryCode(),
-   m_securityReleaseMarking(),
-   m_locSectionLoc(0),
-   m_locationSection(new ossimRpfLocationSection)
-{
-   memset(m_fileName, ' ' , 12);
-   memset(m_govSpecNumber, ' ', 15);
-   memset(m_govSpecDate, ' ', 8);
-   memset(m_securityClassification, ' ', 1);
-   memset(m_countryCode, ' ', 2);
-   memset(m_securityReleaseMarking, ' ', 2);
-   
-   m_fileName[12] = '\0';
-   m_govSpecNumber[15] = '\0';
-   m_govSpecDate[8] = '\0';
-   m_securityClassification[1] = '\0';
-   m_countryCode[2] = '\0';
-   m_securityReleaseMarking[2] = '\0';
-}
-
-ossimRpfHeader::ossimRpfHeader(const ossimRpfHeader& obj)
-   :
-   ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
-   m_littleBigEndianIndicator(obj.m_littleBigEndianIndicator),
-   m_headerSectionLength(obj.m_headerSectionLength),
-   m_fileName(),
-   m_newRepUpIndicator(obj.m_newRepUpIndicator),
-   m_govSpecNumber(),
-   m_govSpecDate(),
-   m_securityClassification(),
-   m_countryCode(),
-   m_securityReleaseMarking(),
-   m_locSectionLoc(obj.m_locSectionLoc),
-   m_locationSection( new ossimRpfLocationSection( *(obj.m_locationSection) ) )
-{
-   memcpy(m_fileName, obj.m_fileName, 13);
-   memcpy(m_govSpecNumber, obj.m_govSpecNumber, 16);
-   memcpy(m_govSpecDate, obj.m_govSpecDate, 9);
-   memcpy(m_securityClassification, obj.m_securityClassification, 2);
-   memcpy(m_countryCode, obj.m_countryCode, 3);
-   memcpy(m_securityReleaseMarking, obj.m_securityReleaseMarking, 3);
-}
-
-const ossimRpfHeader& ossimRpfHeader::operator=(const ossimRpfHeader& rhs)
-{
-   if ( this != &rhs )
-   {
-      m_littleBigEndianIndicator = rhs.m_littleBigEndianIndicator;
-      m_headerSectionLength = rhs.m_headerSectionLength;
-      memcpy(m_fileName, rhs.m_fileName, 13);
-      m_newRepUpIndicator = rhs.m_newRepUpIndicator;
-      memcpy(m_govSpecNumber, rhs.m_govSpecNumber, 16);
-      memcpy(m_govSpecDate, rhs.m_govSpecDate, 9);   
-      memcpy(m_securityClassification, rhs.m_securityClassification, 2);
-      memcpy(m_countryCode, rhs.m_countryCode, 3);
-      memcpy(m_securityReleaseMarking, rhs.m_securityReleaseMarking, 3);
-      m_locSectionLoc = rhs.m_locSectionLoc;
-
-      m_locationSection = new ossimRpfLocationSection( *(rhs.m_locationSection) );
-   }
-   return *this;
-}
-
-ossimRpfHeader::~ossimRpfHeader()
-{
-   if(m_locationSection)
-   {
-      delete m_locationSection;
-      m_locationSection = 0;
-   }
-}
-
-void ossimRpfHeader::parseStream(std::istream& in)
-{
-   if(in)
-   {
-      in.read((char*)&m_littleBigEndianIndicator, 1);
-
-      in.read((char*)&m_headerSectionLength, 2);
-      in.read((char*)m_fileName, 12);
-      in.read((char*)&m_newRepUpIndicator, 1);
-      in.read((char*)m_govSpecNumber, 15);
-      in.read((char*)m_govSpecDate, 8);
-      in.read((char*)m_securityClassification, 1);
-      in.read((char*)m_countryCode, 2);
-      in.read((char*)m_securityReleaseMarking, 2);
-      in.read((char*)&m_locSectionLoc, 4);
-      
-      m_fileName[12] = '\0';
-      m_govSpecNumber[15] = '\0';
-      m_govSpecDate[8] = '\0';
-      m_securityClassification[1] = '\0';
-      m_countryCode[2] = '\0';
-      m_securityReleaseMarking[2] = '\0';
-      
-      //---
-      // From spec:  MIL-PRF-89038CARDG m_littleBigEndianIndicator shall
-      // be 0x00 for all data denoting big endian storage.  We will test
-      // anyway just in case...
-      //---
-      ossimByteOrder dataByteOrder = getByteOrder();
-
-      if( ossim::byteOrder() != dataByteOrder )
-      {
-         ossimEndian anEndian;
-         anEndian.swap(m_headerSectionLength);
-         anEndian.swap(m_locSectionLoc);
-      }
-
-      std::streamoff saveGet = in.tellg();
-      in.seekg(m_locSectionLoc, ios::beg);
-      m_locationSection->parseStream(in, dataByteOrder);
-      in.seekg(saveGet, ios::beg);
-   }
-}
-
-void ossimRpfHeader::writeStream(std::ostream& out)
-{
-   // Always write in big endian.
-   if (m_littleBigEndianIndicator != 0x00)
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "ossimRpfHeader::writeStream writing in big endian even though"
-         << " the m_littleBigEndianIndicator is set to little endian."
-         << std::endl;
-      m_littleBigEndianIndicator = 0x00;
-   }
-   
-   ossimByteOrder dataByteOrder = getByteOrder();
-
-   if( ossim::byteOrder() != dataByteOrder )
-   {
-      ossimEndian anEndian;
-      anEndian.swap(m_headerSectionLength);
-      anEndian.swap(m_locSectionLoc);
-   }
-
-   out.write((char*)&m_littleBigEndianIndicator, 1);
-   
-   out.write((char*)&m_headerSectionLength, 2);
-   out.write((char*)m_fileName, 12);
-   out.write((char*)&m_newRepUpIndicator, 1);
-   out.write((char*)m_govSpecNumber, 15);
-   out.write((char*)m_govSpecDate, 8);
-   out.write((char*)m_securityClassification, 1);
-   out.write((char*)m_countryCode, 2);
-   out.write((char*)m_securityReleaseMarking, 2);
-   out.write((char*)&m_locSectionLoc, 4);
-
-   if( ossim::byteOrder() != dataByteOrder )
-   {
-      // Must swap things back or we will seek to a bad location.
-      ossimEndian anEndian;
-      anEndian.swap(m_headerSectionLength);
-      anEndian.swap(m_locSectionLoc);
-   }
-
-   if (m_locSectionLoc) // May or may not be set.
-   {
-      std::streampos pos = out.tellp();
-      out.seekp(m_locSectionLoc, ios::beg);
-      m_locationSection->writeStream(out);
-      out.seekp(pos);
-   }
-}
-
-std::ostream& ossimRpfHeader::print(std::ostream& out, const std::string& prefix) const
-{
-   out << prefix << "byte_order:               "
-       << (m_littleBigEndianIndicator==0x00?"big_endian\n":"little_endian\n")
-       << prefix << HEADER_SECTION_LENGTH_KW << ":      "
-       << m_headerSectionLength << "\n"
-       << prefix << ossimKeywordNames::FILENAME_KW << ":                 "
-       << m_fileName << "\n"
-       << prefix << NEW_REP_UP_INDICATOR_KW << ":        "
-       << int(m_newRepUpIndicator) << "\n"       
-       << prefix << GOV_SPEC_NUMBER_KW << ":            "
-       << m_govSpecNumber << "\n"
-       << prefix << GOV_SPEC_DATE_KW << ":              "
-       << m_govSpecDate << "\n"
-       << prefix << SECURITY_CLASSIFICATION_KW << ":   "
-       << m_securityClassification << "\n"
-       << prefix << COUNTRY_CODE_KW << ":              "
-       << m_countryCode   << "\n"           
-       << prefix << SECURITY_RELEASE_MARKING_KW << ":   "
-       << m_securityReleaseMarking << "\n";
-
-   if ( traceDebug() )
-   {
-      out << prefix << "LocSectionLoc:            "
-          << m_locSectionLoc << "\n";
-      if (m_locationSection)
-      {
-         m_locationSection->print(out, prefix);
-      }
-   }
-
-   return out;
-}
-
-ossimByteOrder ossimRpfHeader::getByteOrder()const
-{
-   return ( (m_littleBigEndianIndicator==0x00) ? OSSIM_BIG_ENDIAN : OSSIM_LITTLE_ENDIAN);
-}
-
-const ossimRpfLocationSection* ossimRpfHeader::getLocationSection() const
-{
-   return m_locationSection;
-}
-
-ossimRpfLocationSection* ossimRpfHeader::getLocationSection()
-{
-   return m_locationSection;
-}
-
-bool ossimRpfHeader::hasComponent(ossimRpfComponentId componentId)const
-{
-   if(m_locationSection)
-   {
-      return m_locationSection->hasComponent(componentId);
-   }
-   
-   return false;
-}
-
-ossimString ossimRpfHeader::getSecurityClassification()const
-{
-   return m_securityClassification;
-}
-
-ossimRpfCoverageSection* ossimRpfHeader::getNewCoverageSection(std::istream& in)const
-{
-   ossimRpfCoverageSection* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_COVERAGE_SECTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfCoverageSection;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            result->parseStream(in, getByteOrder());
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }
-   return result;
-}
-
-ossimRpfMaskSubsection*  ossimRpfHeader::getNewMaskSubsection(std::istream& in)const
-{
-   ossimRpfMaskSubsection* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_MASK_SUBSECTION,
-                                          component))
-      {
-         result = new ossimRpfMaskSubsection;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }
-   
-   return result;   
-}
-
-
-ossimRpfAttributeSectionSubheader* ossimRpfHeader::getNewAttributeSectionSubheader(std::istream& in)const
-{
-   ossimRpfAttributeSectionSubheader* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_ATTRIBUTE_SECTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfAttributeSectionSubheader;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }
-   
-   return result;
-}
-
-ossimRpfColorGrayscaleSubheader* ossimRpfHeader::getNewColorGrayscaleSubheader(std::istream& in)const
-{
-   ossimRpfColorGrayscaleSubheader* result = 0;
-   
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_COLOR_GRAYSCALE_SECTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfColorGrayscaleSubheader;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }      
-   }
-
-   return result;
-}
-
-ossimRpfCompressionSection* ossimRpfHeader::getNewCompressionSection(std::istream& in)const
-{   
-   ossimRpfCompressionSection* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_COMPRESSION_SECTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfCompressionSection;
-         
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }
-   
-   return result;   
-}
-
-ossimRpfCompressionSectionSubheader* ossimRpfHeader::getNewCompressionSectionSubheader(std::istream& in)const
-{
-   ossimRpfCompressionSectionSubheader* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_COMPRESSION_SECTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfCompressionSectionSubheader;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }
-   
-   return result;   
-}
-
-   
-
-ossimRpfImageDisplayParameterSubheader* ossimRpfHeader::getNewImageDisplayParameterSubheader(std::istream& in)const
-{
-   ossimRpfImageDisplayParameterSubheader* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_IMAGE_DISPLAY_PARAMETERS_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfImageDisplayParameterSubheader;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }
-   
-   return result;
-}
-
-ossimRpfImageDescriptionSubheader* ossimRpfHeader::getNewImageDescriptionSubheader(std::istream& in)const
-{
-   ossimRpfImageDescriptionSubheader* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_IMAGE_DESCRIPTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfImageDescriptionSubheader;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }
-   
-   return result;
-}
-
-
-ossimRpfBoundaryRectTable* ossimRpfHeader::getNewBoundaryRectTable(std::istream &in)const
-{
-   ossimRpfBoundaryRectTable* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      ossimRpfBoundaryRectSectionSubheader* tempSubheader = getNewBoundaryRectSectSubheader(in);
-
-      if(tempSubheader)
-      {
-         if(m_locationSection->getComponent(OSSIM_RPF_BOUNDARY_RECT_TABLE,
-                                             component))
-         {
-            result = new ossimRpfBoundaryRectTable;
-            
-            result->setNumberOfEntries(tempSubheader->getNumberOfEntries());
-            in.seekg(component.m_componentLocation, ios::beg);
-            if(in)
-            {
-               if(result->parseStream(in, getByteOrder()) !=
-                  ossimErrorCodes::OSSIM_OK)
-               {
-                  delete result;
-                  result = 0;
-               }
-            }
-            else
-            {
-               delete result;
-               result = 0;
-            }
-         }
-
-         delete tempSubheader;
-         tempSubheader = 0;
-      }
-   }   
-
-   return result;
-}
-
-ossimRpfBoundaryRectSectionSubheader* ossimRpfHeader::getNewBoundaryRectSectSubheader(std::istream &in)const
-{
-   ossimRpfBoundaryRectSectionSubheader* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-      
-      if(m_locationSection->getComponent(OSSIM_RPF_BOUNDARY_RECT_SECTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfBoundaryRectSectionSubheader;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }   
-
-   return result;
-   
-}
-
-ossimRpfFrameFileIndexSectionSubheader* ossimRpfHeader::getNewFrameFileIndexSectionSubheader(std::istream &in)const
-{
-   ossimRpfFrameFileIndexSectionSubheader* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-
-      if(m_locationSection->getComponent(OSSIM_RPF_FRAME_FILE_INDEX_SECTION_SUBHEADER,
-                                          component))
-      {
-         result = new ossimRpfFrameFileIndexSectionSubheader;
-
-         in.seekg(component.m_componentLocation, ios::beg);
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-   }   
-
-   return result;   
-}
-
-ossimRpfFrameFileIndexSubsection* ossimRpfHeader::getNewFileIndexSubsection(std::istream& in)const
-{
-   ossimRpfFrameFileIndexSubsection* result = 0;
-
-   if(in&&m_locationSection)
-   {
-      ossimRpfComponentLocationRecord component;
-      ossimRpfFrameFileIndexSectionSubheader* tempSubheader = getNewFrameFileIndexSectionSubheader(in);
-
-      if(m_locationSection->getComponent(OSSIM_RPF_FRAME_FILE_INDEX_SUBSECTION,
-                                          component))
-      {
-         result = new ossimRpfFrameFileIndexSubsection;
-
-         result->setNumberOfFileIndexRecords(tempSubheader->getNumberOfIndexRecords());
-         result->setNumberOfPathnames(tempSubheader->getNumberOfPathnameRecords());
-         in.seekg(component.m_componentLocation, ios::beg);
-         if(in)
-         {
-            if(result->parseStream(in, getByteOrder()) !=
-               ossimErrorCodes::OSSIM_OK)
-            {
-               delete result;
-               result = 0;
-            }
-         }
-         else
-         {
-            delete result;
-            result = 0;
-         }
-      }
-      if(tempSubheader)
-      {
-         delete tempSubheader;
-         tempSubheader = 0;
-      }
-   }   
-
-   return result;      
-}
-
-ossimRpfCompressionSection* ossimRpfHeader::getNewCompressionSection(const ossimFilename& file)const
-{
-   ifstream in(file.c_str(), ios::in|ios::binary);
-
-   return getNewCompressionSection(in);
-}
-
-ossimRpfCoverageSection* ossimRpfHeader::getNewCoverageSection(const ossimFilename& file)const
-{
-   ifstream in(file.c_str(), ios::in|ios::binary);
-   
-   return getNewCoverageSection(in);
-}
-
-ossimRpfBoundaryRectTable* ossimRpfHeader::getNewBoundaryRectTable(const ossimFilename &file)const
-{
-   ifstream in(file.c_str(), ios::in|ios::binary);
-   
-   return getNewBoundaryRectTable(in);
-}
-
-ossimRpfBoundaryRectSectionSubheader* ossimRpfHeader::getNewBoundaryRectSectSubheader(const ossimFilename &file)const
-{
-   ifstream in(file.c_str(), ios::in|ios::binary);
-
-   return getNewBoundaryRectSectSubheader(in);
-}
-
-ossimRpfFrameFileIndexSectionSubheader* ossimRpfHeader::getNewFrameFileIndexSectionSubheader(const ossimFilename &file)const
-{
-   ifstream in(file.c_str(), ios::in|ios::binary);
-
-   return getNewFrameFileIndexSectionSubheader(in);
-}
-
-ossimRpfFrameFileIndexSubsection* ossimRpfHeader::getNewFileIndexSubsection(const ossimFilename& file)const
-{
-   ifstream in(file.c_str(), ios::in|ios::binary);
-
-   return getNewFileIndexSubsection(in);
-}
-
-ossimString ossimRpfHeader::getDate()const
-{
-   return m_govSpecDate;
-}
-
-ossim_uint32 ossimRpfHeader::getLocationSectionLocation() const
-{
-   return m_locSectionLoc;
-}
-
-void ossimRpfHeader::setFilename(const ossimString& file)
-{
-   ossimNitfCommon::setField(m_fileName, file, 12);
-}
-
-void ossimRpfHeader::setNewRepUpIndicator(const ossimString& s)
-{
-   if (s.size())
-   {
-      // Range check maybe??? (drb)
-      m_newRepUpIndicator = static_cast<ossim_uint8>(*s.begin());
-   }
-}
-
-void ossimRpfHeader::setGovSpecNumber(const ossimString& s)
-{
-   ossimNitfCommon::setField(m_govSpecNumber, s, 15); 
-}
-
-void ossimRpfHeader::setGovSpecDate(const ossimString& s)
-{
-   ossimNitfCommon::setField(m_govSpecDate, s, 8); 
-}
-
-void ossimRpfHeader::setSecurityClassification(const ossimString& s)
-{
-   ossimNitfCommon::setField(m_securityClassification, s, 1);
-}
-
-void ossimRpfHeader::setCountryCode(const ossimString& s)
-{
-   ossimNitfCommon::setField(m_countryCode, s, 2); 
-}
-
-void ossimRpfHeader::setSecurityReleaseMarking(const ossimString& s)
-{
-   ossimNitfCommon::setField(m_securityReleaseMarking, s, 2);
-}
-
-void ossimRpfHeader::setLocationSectionPos(std::streamoff off)
-{
-   m_locSectionLoc = static_cast<ossim_uint32>(off);
-}
-
-bool ossimRpfHeader::loadState(const ossimKeywordlist& kwl, const char* prefix)
-{
-   const char* lookup = 0;
-   ossimString s;
-
-   lookup = kwl.find(prefix, NEW_REP_UP_INDICATOR_KW);
-   if (lookup)
-   {
-      s = lookup;
-      setNewRepUpIndicator(s);
-   }
-
-   lookup = kwl.find(prefix, GOV_SPEC_NUMBER_KW);
-   if (lookup)
-   {
-      s = lookup;
-      setGovSpecNumber(s);
-   }
-
-   lookup = kwl.find(prefix, GOV_SPEC_DATE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      setGovSpecDate(s);
-   }
-
-   lookup = kwl.find(prefix, SECURITY_CLASSIFICATION_KW);
-   if (lookup)
-   {
-      s = lookup;
-      setSecurityClassification(s);
-   }
-
-   lookup = kwl.find(prefix, COUNTRY_CODE_KW);
-   if (lookup)
-   {
-      s = lookup;
-      setCountryCode(s);
-   }
-
-   lookup = kwl.find(prefix, SECURITY_RELEASE_MARKING_KW);
-   if (lookup)
-   {
-      s = lookup;
-      setSecurityReleaseMarking(s);
-   }
-
-   return true;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfImageDescriptionSubheader.cpp b/ossim/src/ossim/support_data/ossimRpfImageDescriptionSubheader.cpp
deleted file mode 100644
index 7897cb6..0000000
--- a/ossim/src/ossim/support_data/ossimRpfImageDescriptionSubheader.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: This class extends the stl's string class.
-//
-//********************************************************************
-// $Id: ossimRpfImageDescriptionSubheader.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <istream>
-#include <ostream>
-#include <ossim/support_data/ossimRpfImageDescriptionSubheader.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-std::ostream& operator <<(std::ostream& out,
-                          const ossimRpfImageDescriptionSubheader& data)
-{
-   return data.print(out);
-}
-
-ossimRpfImageDescriptionSubheader::ossimRpfImageDescriptionSubheader()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfImageDescriptionSubheader::parseStream(
-   std::istream& in, ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      theStartOffset = in.tellg();
-      in.read((char*)&theNumberOfSpectralGroups, 2);
-      in.read((char*)&theNumberOfSubframeTables, 2);
-      in.read((char*)&theNumberOfSpectralBandTables, 2);
-      in.read((char*)&theNumberOfSpectralBandLinesPerImageRow, 2);
-      in.read((char*)&theNumberOfSubframesHorizontal, 2);
-      in.read((char*)&theNumberOfSubframesVertical, 2);
-      in.read((char*)&theNumberOfOutputColumnsPerSubframe, 4);
-      in.read((char*)&theNumberOfOutputRowsPerSubframe, 4);
-      in.read((char*)&theSubframeMaskTableOffset, 4);
-      in.read((char*)&theTransparencyMaskTableOffset, 4);
-
-      theEndOffset = in.tellg();
-      ossimEndian anEndian;
-
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theNumberOfSpectralGroups);
-         anEndian.swap(theNumberOfSubframeTables);
-         anEndian.swap(theNumberOfSpectralBandTables);
-         anEndian.swap(theNumberOfSpectralBandLinesPerImageRow);
-         anEndian.swap(theNumberOfSubframesHorizontal);
-         anEndian.swap(theNumberOfSubframesVertical);
-         anEndian.swap(theNumberOfOutputColumnsPerSubframe);
-         anEndian.swap(theNumberOfOutputRowsPerSubframe);
-         anEndian.swap(theSubframeMaskTableOffset);
-         anEndian.swap(theTransparencyMaskTableOffset);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-std::ostream& ossimRpfImageDescriptionSubheader::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   out << prefix << "NumberOfSpectralGroups: "
-       << theNumberOfSpectralGroups << "\n"
-       << prefix << "NumberOfSubframeTables: "
-       << theNumberOfSubframeTables << "\n"
-       << prefix << "NumberOfSpectralBandTables: "
-       << theNumberOfSpectralBandTables << "\n"
-       << prefix << "NumberOfSpectralBandLinesPerImageRow: "
-       << theNumberOfSpectralBandLinesPerImageRow << "\n"
-       << prefix << "NumberOfSubframesHorizontal: "
-       << theNumberOfSubframesHorizontal << "\n"
-       << prefix << "NumberOfSubframesVertical: "
-       << theNumberOfSubframesVertical << "\n"
-       << prefix << "NumberOfOutputColumnsPerSubframe: "
-       << theNumberOfOutputColumnsPerSubframe << "\n"
-       << prefix << "NumberOfOutputRowsPerSubframe: "
-       << theNumberOfOutputRowsPerSubframe << "\n"
-       << prefix << "SubframeMaskTableOffset: "
-       << theSubframeMaskTableOffset << "\n"
-       << prefix << "TransparencyMaskTableOffset: "
-       << theTransparencyMaskTableOffset << std::endl;
-   return out;
-}
-
-void ossimRpfImageDescriptionSubheader::clearFields()
-{
-   theStartOffset                          = 0;
-   theEndOffset                            = 0;
-   
-   theNumberOfSpectralGroups               = 0;
-   theNumberOfSubframeTables               = 0;
-   theNumberOfSpectralBandTables           = 0;
-   theNumberOfSpectralBandLinesPerImageRow = 0;
-   theNumberOfSubframesHorizontal          = 0;
-   theNumberOfSubframesVertical            = 0;
-   theNumberOfOutputColumnsPerSubframe     = 0;
-   theNumberOfOutputRowsPerSubframe        = 0;
-   theSubframeMaskTableOffset              = 0;
-   theTransparencyMaskTableOffset          = 0;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfImageDisplayParameterSubheader.cpp b/ossim/src/ossim/support_data/ossimRpfImageDisplayParameterSubheader.cpp
deleted file mode 100644
index ee4293c..0000000
--- a/ossim/src/ossim/support_data/ossimRpfImageDisplayParameterSubheader.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-//*******************************************************************
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-// 
-// Description: This class extends the stl's string class.
-//
-//********************************************************************
-// $Id: ossimRpfImageDisplayParameterSubheader.cpp 9963 2006-11-28 21:11:01Z gpotts $
-#include <ossim/support_data/ossimRpfImageDisplayParameterSubheader.h>
-
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ostream& operator<<(ostream& out,
-                    const ossimRpfImageDisplayParameterSubheader& data)
-{
-   data.print(out);
-
-   return out;
-}
-
-ossimRpfImageDisplayParameterSubheader::ossimRpfImageDisplayParameterSubheader()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfImageDisplayParameterSubheader::parseStream(istream& in,
-                                                         ossimByteOrder byteOrder)
-{
-   clearFields();
-   if(in)
-   {
-      theStartOffset = in.tellg();
-      in.read((char*)&theNumberOfImageRows, 4);
-      in.read((char*)&theNumberOfImageCodesPerRow, 4);
-      in.read((char*)&theImageCodeBitLength, 1);
-      theEndOffset = in.tellg();
-
-      ossimEndian anEndian;
-      if(anEndian.getSystemEndianType() != byteOrder)
-      {
-         anEndian.swap(theNumberOfImageRows);
-         anEndian.swap(theNumberOfImageCodesPerRow);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   return ossimErrorCodes::OSSIM_OK;
-}
-   
-void ossimRpfImageDisplayParameterSubheader::print(ostream& out)const
-{
-   out << "theNumberOfImageRows:          " << theNumberOfImageRows << endl
-       << "theNumberOfImageCodesPerRow:   " << theNumberOfImageCodesPerRow << endl
-       << "theImageCodeBitLength:         " << (unsigned long)theImageCodeBitLength;
-}
-
-void ossimRpfImageDisplayParameterSubheader::clearFields()
-{
-   theNumberOfImageRows        = 0;
-   theNumberOfImageCodesPerRow = 0;
-   theImageCodeBitLength       = 0;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfInfo.cpp b/ossim/src/ossim/support_data/ossimRpfInfo.cpp
deleted file mode 100644
index c125b76..0000000
--- a/ossim/src/ossim/support_data/ossimRpfInfo.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Mingjie Su
-//
-// Description: Rpf Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimRpfInfo.cpp 1237 2010-08-05 19:50:27Z ming.su $
-
-//ossim includes
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimRpfInfo.h>
-#include <ossim/support_data/ossimInfoFactory.h>
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimRpfInfo:debug");
-static ossimTrace traceDump("ossimRpfInfo:dump"); // This will dump offsets.
-
-ossimRpfInfo::ossimRpfInfo()
-   : ossimInfoBase(),
-     theFile(),
-     m_infoFile()
-{
-}
-
-ossimRpfInfo::~ossimRpfInfo()
-{
-}
-
-bool ossimRpfInfo::open(const ossimFilename& file)
-{
-   theFile = file;
-   if (isOpen())
-   {
-     std::ifstream in((theFile).c_str() );
-
-     std::string line;
-     int index = 0;
-     while(in.good())
-     {
-       // Read in a line.
-       std::getline(in, line);
-       ossimString tmpStr = ossimString(line);
-       if (index > 0)
-       {
-         if (!tmpStr.empty())
-         {
-           std::vector<ossimString> tmpVector = tmpStr.split("|");
-           if (tmpVector.size() > 0)
-           {
-             m_infoFile = tmpVector[0];
-             break;
-           }
-         }
-       }
-       index++;
-     }
-     in.close();
-
-     return true;
-   }
-   return false;
-}
-
-bool ossimRpfInfo::isOpen()
-{
-  ossimString ext = theFile.ext().downcase();
-
-  if(ext == "rpf")
-  {
-    return true;
-  }
-  else
-  {
-    return false;
-  }
-}
-
-std::ostream& ossimRpfInfo::print(std::ostream& out) const
-{
-  ossimInfoBase* info = ossimInfoFactory::instance()->create(m_infoFile);
-  if (info)
-  {
-    info->print(out);
-  }
-
-  return out;
-}
diff --git a/ossim/src/ossim/support_data/ossimRpfLocationSection.cpp b/ossim/src/ossim/support_data/ossimRpfLocationSection.cpp
deleted file mode 100644
index df3e2ee..0000000
--- a/ossim/src/ossim/support_data/ossimRpfLocationSection.cpp
+++ /dev/null
@@ -1,316 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Rpf support class
-//
-//********************************************************************
-// $Id: ossimRpfLocationSection.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimRpfLocationSection.h>
-#include <ossim/base/ossimCommon.h> /* ossim::byteOrder() */
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimRpfComponentIdLut.h>
-#include <istream>
-#include <ostream>
-#include <iterator>
-
-static const ossimTrace traceDebug("ossimRpfLocationSection:debug");
-
-std::ostream& operator<<(std::ostream& out, const ossimRpfComponentLocationRecord& data)
-{
-   return data.print(out);
-}
-
-ossimRpfComponentLocationRecord::ossimRpfComponentLocationRecord()
-   : m_componentId(0),
-     m_componentLength(0),
-     m_componentLocation(0)
-{
-}
-
-ossimRpfComponentLocationRecord::ossimRpfComponentLocationRecord(
-   const ossimRpfComponentLocationRecord& record)
-   : m_componentId(record.m_componentId),
-     m_componentLength(record.m_componentLength),
-     m_componentLocation(record.m_componentLocation)
-{
-}
-
-const ossimRpfComponentLocationRecord& ossimRpfComponentLocationRecord::operator=(
-   const ossimRpfComponentLocationRecord& rhs)
-{
-   if (this != &rhs)
-   {
-      m_componentId       = rhs.m_componentId;
-      m_componentLength   = rhs.m_componentLength;
-      m_componentLocation = rhs.m_componentLocation;
-   }
-   return *this;
-}
-
-std::ostream& ossimRpfComponentLocationRecord::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   out << prefix << "ComponentId:             "
-       << m_componentId << "\n"
-       << prefix << "ComponentIdString:       "
-       << ossimRpfComponentIdLut::instance()->getEntryString(m_componentId) << "\n"
-       << prefix << "ComponentLength:         "
-       << m_componentLength   << "\n"
-       << prefix << "ComponentLocation:       "
-       << m_componentLocation << "\n";
-   return out;
-}
-
-std::ostream& operator <<(std::ostream& out, const ossimRpfLocationSection &data)
-{
-   return data.print(out);
-}
-
-ossimErrorCode ossimRpfComponentLocationRecord::parseStream(
-   std::istream& in, ossimByteOrder byteOrder)
-{
-   if(in)
-   {
-      in.read((char*)&m_componentId, 2);
-      in.read((char*)&m_componentLength, 4);
-      in.read((char*)&m_componentLocation, 4);
-
-      if( ossim::byteOrder() != byteOrder)
-      {
-         // swap to native
-         ossimEndian anEndian;
-         anEndian.swap(m_componentId);
-         anEndian.swap(m_componentLength);
-         anEndian.swap(m_componentLocation);
-      }
-   }
-   else
-   {
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return  ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfComponentLocationRecord::writeStream(std::ostream& out)
-{
-   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
-   {
-      ossimEndian endian;
-      endian.swap(m_componentId);
-      endian.swap(m_componentLength);
-      endian.swap(m_componentLocation);
-   }
-
-   out.write((char*)&m_componentId, 2);
-   out.write((char*)&m_componentLength, 4);
-   out.write((char*)&m_componentLocation, 4);
-
-   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
-   {
-      // Swap back to native byte order.
-      ossimEndian endian;
-      endian.swap(m_componentId);
-      endian.swap(m_componentLength);
-      endian.swap(m_componentLocation);
-   }
-}
-
-ossimRpfLocationSection::ossimRpfLocationSection()
-{
-   clearFields();
-}
-
-ossimErrorCode ossimRpfLocationSection::parseStream(std::istream& in,
-                                                    ossimByteOrder byteOrder)
-{
-   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
-   
-   if(in)
-   {
-      clearFields();
-      
-      in.read((char*)&m_locationSectionLength, 2);
-      in.read((char*)&m_locationTableOffset, 4);
-      in.read((char*)&m_numberOfComponentLocationRecords, 2);
-      in.read((char*)&m_locationRecordLength, 2);
-      in.read((char*)&m_componentAggregateLength, 4);
-
-      if( ossim::byteOrder() != byteOrder )
-      {
-         ossimEndian anEndian;
-         anEndian.swap(m_locationSectionLength);
-         anEndian.swap(m_locationTableOffset);
-         anEndian.swap(m_numberOfComponentLocationRecords);
-         anEndian.swap(m_locationRecordLength);
-         anEndian.swap(m_componentAggregateLength);
-      }
-      
-      if(traceDebug())
-      {
-         print(ossimNotify(ossimNotifyLevel_DEBUG));
-         ossimNotify(ossimNotifyLevel_DEBUG) << std::endl;
-      }
-
-      m_componentLocationList.resize(m_numberOfComponentLocationRecords);
-      for(ossim_uint32 index = 0;
-          (index < m_componentLocationList.size())&&
-             (result == ossimErrorCodes::OSSIM_OK);
-          ++index)
-      {        
-         result = m_componentLocationList[index].parseStream(in, byteOrder);
-      }
-   }
-   else
-   {
-      result = ossimErrorCodes::OSSIM_ERROR;
-   }
-
-   return result;
-}
-
-
-void ossimRpfLocationSection::writeStream(std::ostream& out)
-{
-   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
-   {
-      // Always write in big endian.
-      ossimEndian endian;
-      endian.swap(m_locationSectionLength);
-      endian.swap(m_locationTableOffset);
-      endian.swap(m_numberOfComponentLocationRecords);
-      endian.swap(m_locationRecordLength);
-      endian.swap(m_componentAggregateLength);
-   }
-   
-   out.write((char*)&m_locationSectionLength, 2);
-   out.write((char*)&m_locationTableOffset, 4);
-   out.write((char*)&m_numberOfComponentLocationRecords, 2);
-   out.write((char*)&m_locationRecordLength, 2);
-   out.write((char*)&m_componentAggregateLength, 4);
-
-   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
-   {
-      // Swap back to native byte order.
-      ossimEndian endian;
-      endian.swap(m_locationSectionLength);
-      endian.swap(m_locationTableOffset);
-      endian.swap(m_numberOfComponentLocationRecords);
-      endian.swap(m_locationRecordLength);
-      endian.swap(m_componentAggregateLength);
-   }
-   
-   for(ossim_uint32 i = 0; i < m_componentLocationList.size(); ++i)
-   {
-      m_componentLocationList[i].writeStream(out);
-   }
-}
-
-std::ostream& ossimRpfLocationSection::print(
-   std::ostream& out, const std::string& prefix) const
-{
-   out << prefix << "LocationSectionLength:            "
-       << m_locationSectionLength << "\n"
-       << prefix << "LocationTableOffset:              "
-       << m_locationTableOffset << "\n"
-       << prefix << "NumberOfComponentLocationRecords: "
-       << m_numberOfComponentLocationRecords << "\n"
-       << prefix << "LocationRecordLength:             "
-       << m_locationRecordLength << "\n"
-       << prefix << "ComponentAggregateLength:         "
-       << m_componentAggregateLength << "\n";
-   
-   if(m_numberOfComponentLocationRecords > 0)
-   {
-      std::vector<ossimRpfComponentLocationRecord>::const_iterator i =
-         m_componentLocationList.begin();
-      while (i != m_componentLocationList.end())
-      {
-         (*i).print(out, prefix);
-         ++i;
-      }
-   }
-   return out;
-}
-
-bool ossimRpfLocationSection::hasComponent(ossimRpfComponentId componentId)const
-{
-   ossimRpfComponentLocationRecord result;
-   
-   return getComponent(componentId, result);
-}
-
-bool ossimRpfLocationSection::getComponent(ossimRpfComponentId componentId,
-                                           ossimRpfComponentLocationRecord &result)const
-{
-   std::vector<ossimRpfComponentLocationRecord>::const_iterator component =
-      m_componentLocationList.begin();
-   
-   while(component != m_componentLocationList.end())
-   {
-      if((*component).m_componentId == static_cast<unsigned short>(componentId))
-      {
-         result = *component;
-
-         return true;
-      }      
-      ++component;
-   }
-   
-   return false;
-}
-
-void ossimRpfLocationSection::addComponentRecord(const ossimRpfComponentLocationRecord& record)
-{
-   m_componentLocationList.push_back(record);
-}
-
-void ossimRpfLocationSection::setLocationSectionLength(ossim_uint16 length)
-{
-   m_locationSectionLength = length;
-}
-
-void ossimRpfLocationSection::setLocationTableOffset(ossim_uint32 offset)
-{
-   m_locationTableOffset = offset;
-}
-
-void ossimRpfLocationSection::setNumberOfComponentLocationRecords(ossim_uint16 count)
-{
-   m_numberOfComponentLocationRecords = count;
-}
-
-void ossimRpfLocationSection::setLocationRecordLength(ossim_uint16 length)
-{
-   m_locationRecordLength = length;
-}
-
-void ossimRpfLocationSection::setComponentAggregateLength(ossim_uint32 length)
-{
-   m_componentAggregateLength = length;
-}
-
-void ossimRpfLocationSection::clearFields()
-{
-   m_locationSectionLength            = 0;
-   m_locationTableOffset              = 0;
-   m_numberOfComponentLocationRecords = 0;
-   m_locationRecordLength             = 0;
-   m_componentAggregateLength         = 0;
-
-   m_componentLocationList.clear();
-}
-
-std::vector<ossimRpfComponentLocationRecord>& ossimRpfLocationSection::getLocationRecordList()
-{
-   return m_componentLocationList;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfToc.cpp b/ossim/src/ossim/support_data/ossimRpfToc.cpp
deleted file mode 100644
index b7c0fcf..0000000
--- a/ossim/src/ossim/support_data/ossimRpfToc.cpp
+++ /dev/null
@@ -1,1295 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-// 
-// Description: Rpf support class
-// 
-//********************************************************************
-// $Id: ossimRpfToc.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/support_data/ossimRpfToc.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
-#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
-#include <ossim/support_data/ossimRpfFrame.h>
-#include <ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h>
-#include <ossim/support_data/ossimRpfFrameFileIndexSubsection.h>
-#include <ossim/support_data/ossimRpfBoundaryRectTable.h>
-#include <ossim/support_data/ossimRpfLocationSection.h>
-#include <ossim/support_data/ossimRpfTocEntry.h>
-#include <ossim/support_data/ossimRpfFrameFileIndexRecord.h>
-#include <ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h>
-#include <ossim/support_data/ossimRpfPathnameRecord.h>
-#include <ossim/support_data/ossimNitfFile.h>
-#include <ossim/base/ossimTrace.h>
-#include <iostream>
-#include <fstream>
-
-static ossimTrace traceDebug("ossimRpfToc:debug");
-
-std::ostream& operator <<(std::ostream& out, const ossimRpfToc& data)
-{
-   return data.print(out);
-}
-
-ossimRpfToc::ossimRpfToc()
-   :m_tocEntryList(),
-    m_filename(),
-    m_nitfFileHeader(0),
-    m_rpfHeader(0)
-{
-}
-
-ossimRpfToc::~ossimRpfToc()
-{
-   deleteAll();
-}
-
-ossimErrorCode ossimRpfToc::parseFile(const ossimFilename &fileName, bool keepFileHeader)
-{
-   static const char MODULE[] = "ossimRpfToc::parseFile";
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered....." << std::endl;
-   }
-
-   ossimRefPtr<ossimNitfFile> nitfFile = new ossimNitfFile;
-
-   clearAll();
-
-   nitfFile->parseFile(fileName);
-
-   m_nitfFileHeader = nitfFile->getHeader();
-
-   m_rpfHeader = 0; // ossimRefPtr
-   
-   if( !m_nitfFileHeader.valid() )
-   {
-      nitfFile = 0;
-      
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " leaving with no nitf header found....." << std::endl;
-      }
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   ossimNitfTagInformation info; 
-   m_nitfFileHeader->getTag(info, "RPFHDR");
-
-   if(traceDebug() && (info.getTagName() == "RPFHDR") )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " nitf file header print\n";
-      m_nitfFileHeader->print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-   
-   if ( !keepFileHeader )
-   {
-      // we no longer need access to the nitf header.  We got what we needed.
-      m_nitfFileHeader = 0;
-   }
-   nitfFile = 0;
-   
-   m_filename = fileName;
-
-   if(info.getTagName() == "RPFHDR")
-   {
-      m_rpfHeader = new ossimRpfHeader;
-
-      std::ifstream in(m_filename.c_str(), std::ios::in|std::ios::binary);
-      
-      // set the get pointer for the stream to the start
-      // of the Rpf header data
-      in.seekg(info.getTagDataOffset(), std::ios::beg);
-      
-      // now get the header data.  We do not need to pass in the byte order.
-      // this is grabbed from the first byte of the stream.  To see this,
-      // Look at the RpfHeader implementation.
-      m_rpfHeader->parseStream(in);
-
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG: Found RPF HEADER tag\n";
-         m_rpfHeader->print( ossimNotify(ossimNotifyLevel_DEBUG) );
-      }
-
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimRpfToc::parseFile: Leaving No RPFHDR tag found" << "\n";
-      }
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   if( m_rpfHeader.valid() )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: Building toc list" << "\n";
-      }
-      buildTocEntryList( m_rpfHeader.get() );
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimRpfToc::parseFile: Leaving no RPFHDR " << __LINE__ << "\n";
-      }
-      return ossimErrorCodes::OSSIM_ERROR;
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimRpfToc::parseFile: Returning with OK." << std::endl;
-   }
-   
-   return ossimErrorCodes::OSSIM_OK;
-}
-
-void ossimRpfToc::createTocAndCopyFrames( const ossimFilename& dotRpfFile,
-                                          const ossimFilename& outputDir )
-{
-   static const char MODULE[] = "ossimRpfToc::createTocAndCopyFrames";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\ndot rpf file:      " << dotRpfFile
-         << "\noutput directory:  " << outputDir
-         << "\n";
-   }
-
-   if ( outputDir.expand().exists() == false )
-   {
-      if ( !outputDir.createDirectory(true, 0775) )
-      {
-         std::string e = MODULE;
-         e += " ERROR:\nCould not create directory: ";
-         e+= outputDir.c_str();
-         throw ossimException(e);
-      }
-   }
-
-   // Open the dot rpf file.
-   std::ifstream* dotRpfStr = new std::ifstream;
-   dotRpfStr->open(dotRpfFile.c_str(), ios_base::in);
-   if ( !dotRpfStr->good() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-
-      std::string e = MODULE;
-      e += " ERROR:\nCould not open: ";
-      e += dotRpfFile.c_str();
-      throw ossimException(e);
-   }
-
-   ossimFilename sourceADotTocFile = getSourceTocFile(*dotRpfStr);
-   if ( sourceADotTocFile.empty() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-
-      std::string e = MODULE;
-      e += " ERROR:\nCould not deduce source a.toc file!";
-      throw ossimException(e);
-   }
-   
-   // Open the source a.toc file. Note the true flag is to keep the file header.
-   ossimRefPtr<ossimRpfToc> sourceADotToc = new ossimRpfToc;
-   if ( sourceADotToc->parseFile(sourceADotTocFile, true) != ossimErrorCodes::OSSIM_OK )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
- 
-      std::string e = MODULE;
-      e += " ERROR:\nCould not open: ";
-      e += sourceADotTocFile.c_str();
-      throw ossimException(e);
-   }
-
-   ossimRefPtr<const ossimNitfFileHeader> sourceNitfFileHdr = sourceADotToc->getNitfFileHeader();
-   if ( !sourceNitfFileHdr.valid() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;        
-
-      std::string e = MODULE;
-      e += " ERROR:\nCould not get nitf file header from: ";
-      e += sourceADotTocFile.c_str();
-      throw ossimException(e);
-   }
-   
-   ossimRefPtr<const ossimRpfHeader> sourceRpfHdr = sourceADotToc->getRpfHeader();
-   if ( !sourceRpfHdr.valid() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-      
-      std::string e = MODULE;
-      e += " ERROR:\nCould not get rpf header from: ";
-      e += sourceADotTocFile.c_str();
-      throw ossimException(e);
-   }
-
-   // Get the boundary rect sub header from the source a.toc.
-   ossimRefPtr<ossimRpfBoundaryRectSectionSubheader> boundaryRectSectionSubheader =
-      sourceRpfHdr->getNewBoundaryRectSectSubheader(sourceADotTocFile);
-   if ( !boundaryRectSectionSubheader.valid() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-
-      std::string e = MODULE;
-      e += " ERROR:\nCould not pull boundary rect sub header from source file: ";
-      e += sourceADotTocFile.c_str();
-      throw ossimException(e);
-   }   
-
-   // Get the boundary rect table from the source a.toc.
-   ossimRefPtr<ossimRpfBoundaryRectTable> boundaryRectTable =
-      sourceRpfHdr->getNewBoundaryRectTable(sourceADotTocFile);
-   if ( !boundaryRectTable.valid() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-      
-      std::string e = MODULE;
-      e += " ERROR:\nCould not pull boundary rect table from source file: ";
-      e += sourceADotTocFile.c_str();
-      throw ossimException(e);
-   }
-   
-   // Get the frame file subheader from the source a.toc.
-   ossimRefPtr<ossimRpfFrameFileIndexSectionSubheader> frameFileSubHeader =
-      sourceRpfHdr->getNewFrameFileIndexSectionSubheader(sourceADotTocFile);
-   if ( !frameFileSubHeader.valid() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-
-      std::string e = MODULE;
-      e += " ERROR:\nCould not pull frame file sub header from source file: ";
-      e += sourceADotTocFile.c_str();
-      throw ossimException(e);
-   }
-
-   // Get the frame file subsection from the source a.toc.
-   ossimRefPtr<ossimRpfFrameFileIndexSubsection> frameFileSubSection =
-      sourceRpfHdr->getNewFileIndexSubsection(sourceADotTocFile);
-   if ( !frameFileSubSection.valid() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-
-      std::string e = MODULE;
-      e += " ERROR:\nCould not pull frame file sub section from source file: ";
-      e += sourceADotTocFile.c_str();
-      throw ossimException(e); 
-   }
-   
-   // Open the output file to write to.
-   const ossimFilename A_DOT_TOC_FILE = "a.toc";
-   ossimFilename dotTocFile = outputDir.dirCat(A_DOT_TOC_FILE);
-   std::ofstream* dotTocStr = new std::ofstream;
-   dotTocStr->open( dotTocFile.c_str(), ios::out|ios::binary );
-   if ( !dotTocStr->good() )
-   {
-      delete dotRpfStr;
-      dotRpfStr = 0;
-      delete dotTocStr;
-      dotTocStr =0;
-
-      std::string e = MODULE;
-      e += " ERROR:\nCould not open: ";
-      e += dotTocFile.c_str();
-      throw ossimException(e);
-   }
-   
-   // Variables used throughout:
-   ossimRefPtr<ossimProperty> prop = new ossimStringProperty();
-   ossimString field;
-   ossimString s;
-   // std::streampos fileHeaderLength = 0;
-   // std::streampos fileLength = 0;
-      
-   ossimRefPtr<ossimNitfFileHeaderV2_0> fileHdr = new ossimNitfFileHeaderV2_0();
-   
-   // Set the CLEVEL:
-   s = "01";
-   fileHdr->setComplexityLevel(s);
-   
-   // Set the OSTAID:
-   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::OSTAID_KW);
-   fileHdr->setProperty(prop);
-   
-   // Set the FDT (date):
-   fileHdr->setDate();
-   
-   // Set the FTITLE:
-   s = "a.toc";
-   fileHdr->setTitle(s);
-   
-   // Set the FSCLAS:
-   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::FSCLAS_KW);
-   fileHdr->setProperty(prop);
-   
-   // Set the FSCODE:
-   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::FSCODE_KW);
-   fileHdr->setProperty(prop);
-   
-   // Set the FSCTLH:
-   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::FSCTLH_KW);
-   fileHdr->setProperty(prop);
-   
-   // Set the ONAME:
-   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::ONAME_KW);
-   fileHdr->setProperty(prop);
-   
-   // Set the OPHONE:
-   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::OPHONE_KW);
-   fileHdr->setProperty(prop);
-   
-   // Add the rpf header.
-   ossimRpfHeader* rpfHdr = new ossimRpfHeader( *(sourceRpfHdr.get()) );
-   
-   ossimRefPtr<ossimNitfRegisteredTag> rpfHdrRp = rpfHdr;
-   ossimNitfTagInformation rpfHdrInfo(rpfHdrRp);
-   fileHdr->addTag(rpfHdrInfo);
-   
-   //---
-   // Write it out...
-   // The first write will be with an rpfheader with no location sections just
-   // to see where the end of the file header is.
-   //---
-   fileHdr->writeStream(*dotTocStr);
-   
-   //---
-   // End of file header. Get the header length. This will also be the
-   // start of the location section.
-   //---
-   std::streampos pos = dotTocStr->tellp();
-   std::streamoff locationSectionOffset = pos;
-   
-   // Set the header length:
-   fileHdr->setHeaderLength( static_cast<ossim_uint64>(locationSectionOffset) );
-   
-   // Set the location of the location section.
-   rpfHdr->setLocationSectionPos(locationSectionOffset);
-
-   // Set the file name.
-   rpfHdr->setFilename(A_DOT_TOC_FILE);
-   
-   // Add the component location records to the header.
-   ossimRpfLocationSection* locSec = rpfHdr->getLocationSection();
-   
-   // Clear the records copied from the source a.toc.
-   locSec->clearFields();
-   
-   //---
-   // Set the length of the locSec to 74.  The record itself is 14 bytes plus
-   // an additional 60 bytes for six location records ten bytes each.
-   //---
-   const ossim_uint16 LOCATION_SECTION_SIZE = 74;
-   locSec->setLocationSectionLength(LOCATION_SECTION_SIZE);
-   
-   // Set the offset which 14 bytes to get to the first record.
-   locSec->setLocationTableOffset(14);
-   
-   // Six records:
-   locSec->setNumberOfComponentLocationRecords(6);
-   
-   // Each record 10 bytes:
-   locSec->setLocationRecordLength(10);
-   
-   // Don't know the aggregate length yet.
-   
-   ossimRpfComponentLocationRecord locRec;
-   
-   // Note: See ossimRpfConstants for enum ossimRpfComponentId
-   
-   const ossim_uint32 RPFHDR_SIZE = 48;
-   const ossim_uint32 LOCATION_SECTION_OFFSET = static_cast<ossim_uint32>(locationSectionOffset);
-   const ossim_uint32 BOUNDARY_SUBHEADER_SIZE = 8;
-   const ossim_uint32 BOUNDARY_RECORD_SIZE = 132;
-   const ossim_uint32 FILE_SUBHEADER_SIZE = 13;
-   // const ossim_uint32 = ;
-   
-   // Record 1 RPFHDR location:
-   ossim_uint32 rpfHdrOffset = 0;
-   if ( fileHdr->getTag(rpfHdrInfo, "RPFHDR") )
-   {
-      rpfHdrOffset = rpfHdrInfo.getTagDataOffset();
-   }
-
-   locRec.m_componentId = OSSIM_RPF_HEADER_COMPONENT; // 128
-   locRec.m_componentLength = RPFHDR_SIZE;
-   locRec.m_componentLocation = static_cast<ossim_uint32>(rpfHdrInfo.getTagDataOffset());
-   locSec->addComponentRecord(locRec);
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "rpf hdr offset: " << rpfHdrOffset << "\n";
-      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-   
-   // Record 2 location section:
-   locRec.m_componentId = OSSIM_RPF_LOCATION_COMPONENT; // 129
-   locRec.m_componentLength = LOCATION_SECTION_SIZE;
-   locRec.m_componentLocation = LOCATION_SECTION_OFFSET;
-   locSec->addComponentRecord(locRec);
-
-   if ( traceDebug() )
-   {
-      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-   
-   // Record 3 boundary rect sub header section:
-   locRec.m_componentId = OSSIM_RPF_BOUNDARY_RECT_SECTION_SUBHEADER; // 148
-   locRec.m_componentLength = BOUNDARY_SUBHEADER_SIZE;
-   locRec.m_componentLocation = locRec.m_componentLocation + LOCATION_SECTION_SIZE;
-   locSec->addComponentRecord(locRec);
-
-   if ( traceDebug() )
-   {
-      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-   
-   // Capture the location.
-   std::streamoff boundaryRectPosition = locRec.m_componentLocation;
-   
-   // Record 4 boundary rect table:
-   locRec.m_componentId = OSSIM_RPF_BOUNDARY_RECT_TABLE; // 149
-   locRec.m_componentLength = BOUNDARY_RECORD_SIZE;
-   locRec.m_componentLocation = locRec.m_componentLocation + BOUNDARY_SUBHEADER_SIZE;
-   locSec->addComponentRecord(locRec);
-
-   if ( traceDebug() )
-   {
-      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-   
-   // Record 5 file index sub header:
-   locRec.m_componentId = OSSIM_RPF_FRAME_FILE_INDEX_SECTION_SUBHEADER; // 150
-   locRec.m_componentLength = FILE_SUBHEADER_SIZE;
-   locRec.m_componentLocation = locRec.m_componentLocation + BOUNDARY_RECORD_SIZE;
-   locSec->addComponentRecord(locRec);
-
-   if ( traceDebug() )
-   {
-      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-    
-   // Record 6 file index sub header:
-   locRec.m_componentId = OSSIM_RPF_FRAME_FILE_INDEX_SUBSECTION; // 151
-   locRec.m_componentLength = 0;  // need to calculate.
-   locRec.m_componentLocation = locRec.m_componentLocation + FILE_SUBHEADER_SIZE;
-   locSec->addComponentRecord(locRec);
-
-   if ( traceDebug() )
-   {
-      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
-   }
-   
-   // Seek back and re-write...
-   dotTocStr->seekp(0, ios::beg);
-   fileHdr->writeStream(*dotTocStr);
-   
-   dotTocStr->seekp(boundaryRectPosition, ios::beg);
-
-   // Only writing one entry:
-   boundaryRectSectionSubheader->setNumberOfEntries(1);
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "writing boundaryRectSectionSubheader:\n" << *(boundaryRectSectionSubheader.get())
-         << "\n";
-   }
-
-   //---
-   // Write the boundary rectangle section.  This includes the subheader and subsection.
-   // These coorespond to location records 3 and 4 above.
-   //---
-   boundaryRectSectionSubheader->writeStream(*dotTocStr);
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) 
-         << "Original boundaryRectTable:\n" << *(boundaryRectTable.get()) << "\n";
-   }
-
-   ossim_uint32 entry;
-   if ( getCorespondingEntry( frameFileSubSection.get(), *dotRpfStr, entry ) )
-   {
-      ossimRpfBoundaryRectRecord boundaryRectRecord;
-      if ( boundaryRectTable->getEntry( entry, boundaryRectRecord) )
-      {
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) 
-               << "writing boundaryRectTable:\n" << boundaryRectRecord << "\n";
-         }
-         
-         boundaryRectRecord.writeStream(*dotTocStr);
-      }
-      else
-      {
-         std::string e = MODULE;
-         e += " ERROR:\nCould not get bounding rect record for entry: ";
-         e += ossimString::toString(entry).c_str();
-         throw ossimException(e);
-      }
-   }
-   else
-   {
-      std::string e = MODULE;
-      e += " ERROR:\nCould not deduce entry from frame list!";
-      throw ossimException(e);
-   }
-
-   frameFileSubHeader->setNumberOfIndexRecords( getNumberOfFrames(*dotRpfStr) );
-   frameFileSubHeader->setNumberOfPathnameRecords(1);
-   const ossim_uint16 FRAME_FILE_INDEX_RECORD_LENGTH = 33;
-   frameFileSubHeader->setIndexRecordLength( FRAME_FILE_INDEX_RECORD_LENGTH );
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "writing frameFileSubHeader:\n" << *(frameFileSubHeader.get()) << "\n";
-   }
-   frameFileSubHeader->writeStream( *dotTocStr );
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "writing frameFileSubSection:\n";
-   }
-
-   std::streamoff frameFileIndexSectionStartPos = dotTocStr->tellp();
-   
-   writeFrameFileIndexSection(frameFileSubSection.get(), *dotRpfStr, *dotTocStr);
-   
-   std::streamoff endOfFilePos = dotTocStr->tellp();
-
-   // Update the location section length for the frame file index section.
-   locSec->getLocationRecordList()[5].m_componentLength =
-      static_cast<ossim_uint32>(endOfFilePos - frameFileIndexSectionStartPos);
-
-   // Update the length of all location sections.
-   locSec->setComponentAggregateLength(
-      static_cast<ossim_uint32>(endOfFilePos) - rpfHdr->getLocationSectionLocation() );
-   
-
-   fileHdr->setFileLength(static_cast<ossim_uint64>(endOfFilePos));
-   dotTocStr->seekp(0, ios::beg);
-   fileHdr->writeStream(*dotTocStr);
-
-   ossimNotify(ossimNotifyLevel_DEBUG) << "Wrote file: " << dotTocFile << "\n";
-
-   // Copy the frames to the output directory.
-   copyFrames(*dotRpfStr, outputDir);
-
-   // Cleanup:
-   delete dotRpfStr;
-   dotRpfStr = 0;
-   delete dotTocStr;
-   dotTocStr =0;
-}
-
-std::ostream& ossimRpfToc::print(std::ostream& out,
-                                 const std::string& prefix,
-                                 bool printOverviews) const
-{
-   if( m_rpfHeader.valid() )
-   {
-      m_rpfHeader->print(out, prefix);
-
-      //---
-      // Go through the entries...  We're going to skip overviews here.
-      //---
-      ossim_uint32 prefixIndex = 0;
-      std::vector< ossimRpfTocEntry*>::const_iterator tocEntry =
-         m_tocEntryList.begin();
-      while(tocEntry != m_tocEntryList.end())
-      {
-         if (*tocEntry)
-         {
-            if ( traceDebug() )
-            {
-               (*tocEntry)->print(out, prefix);
-            }
-            
-            const ossimRpfBoundaryRectRecord REC =
-               (*tocEntry)->getBoundaryInformation();
-
-            ossimString scale = REC.getScale();
-            if ( (scale.contains("OVERVIEW")) == false ||
-                 printOverviews )
-            {
-               ossimString entryPrefix = prefix;
-               entryPrefix += "image";
-               entryPrefix += ossimString::toString(prefixIndex);
-               entryPrefix += ".";
-               REC.print(out, entryPrefix);
-
-               //---
-               // Get the first frame that exists so we can get to
-               // the attributes.
-               //---
-               ossimRpfFrameEntry frameEntry;
-               getFirstEntry((*tocEntry), frameEntry);
-
-               if (frameEntry.exists())
-               {
-                  ossimRpfFrame rpfFrame;
-                  if ( rpfFrame.parseFile(frameEntry.getFullPath())
-                       == ossimErrorCodes::OSSIM_OK )
-                  {
-                     rpfFrame.print(out, entryPrefix);
-                  }
-               }
-            }
-         }
-         ++prefixIndex;
-         ++tocEntry;
-      }
-   }
-   return out;
-}
-
-ossim_uint32 ossimRpfToc::getNumberOfEntries()const
-{
-   return static_cast<ossim_uint32>(m_tocEntryList.size());
-}
-
-const ossimRpfTocEntry* ossimRpfToc::getTocEntry(ossim_uint32 index)const
-{
-   if(index < m_tocEntryList.size())
-   {
-      return m_tocEntryList[index];
-   }
-   return 0;
-}
-
-ossim_int32 ossimRpfToc::getTocEntryIndex(const ossimRpfTocEntry* entry)
-
-{
-   for(ossim_int32 i = 0; i < (ossim_int32)m_tocEntryList.size(); ++i)
-   {
-      if(m_tocEntryList[i] == entry)
-      {
-         return i;
-      }
-   }
-
-   return -1;
-}
-
-const ossimNitfFileHeader* ossimRpfToc::getNitfFileHeader()const
-{
-   return m_nitfFileHeader.get();
-}
-
-const ossimRpfHeader* ossimRpfToc::getRpfHeader()const
-{
-   return m_rpfHeader.get();
-}
-
-ossim_uint32 ossimRpfToc::getNumberOfFramesHorizontal(ossim_uint32 idx) const
-{
-   ossim_uint32 nFrames = 0;
-   const ossimRpfTocEntry* pEntry = getTocEntry( idx );
-   if ( pEntry != NULL )
-   {
-      nFrames = pEntry->getNumberOfFramesHorizontal();
-   }
-   return nFrames;
-}
-
-ossim_uint32 ossimRpfToc::getNumberOfFramesVertical(ossim_uint32 idx) const
-{
-   ossim_uint32 nFrames = 0;
-   const ossimRpfTocEntry* pEntry = getTocEntry( idx );
-   if ( pEntry != NULL )
-   {
-      nFrames = pEntry->getNumberOfFramesVertical();
-   }
-   return nFrames;
-}
-
-bool ossimRpfToc::getRpfFrameEntry(ossim_uint32 entryIdx, 
-                                   ossim_uint32 row,
-                                   ossim_uint32 col,
-                                   ossimRpfFrameEntry& result)const
-{
-   const ossimRpfTocEntry* pEntry = getTocEntry( entryIdx );
-   if ( pEntry != NULL )
-   {
-      return pEntry->getEntry( row, col, result );
-   }
-   return false;
-}
-
-const ossimString ossimRpfToc::getRelativeFramePath( ossim_uint32 entryIdx,
-                                                     ossim_uint32 row,
-                                                     ossim_uint32 col) const
-{
-   ossimRpfFrameEntry frameEntry;
-   bool bResult = getRpfFrameEntry( entryIdx, row, col, frameEntry );
-   if ( bResult == true )
-   {
-      return frameEntry.getPathToFrameFileFromRoot();
-   }
-   return ossimString("");
-}
-
-void ossimRpfToc::deleteAll()
-{
-   m_rpfHeader = 0;
-
-   deleteTocEntryList();
-}
-
-void ossimRpfToc::clearAll()
-{
-   deleteTocEntryList();
-   m_filename = "";
-}
-
-void ossimRpfToc::deleteTocEntryList()
-{
-   std::vector< ossimRpfTocEntry*>::iterator tocEntry =
-      m_tocEntryList.begin();
-   while(tocEntry != m_tocEntryList.end())
-   {
-      if(*tocEntry)
-      {
-         delete (*tocEntry);
-         *tocEntry = NULL;
-      }
-      ++tocEntry;
-   }
-   m_tocEntryList.clear();
-}
-
-void ossimRpfToc::buildTocEntryList(ossimRpfHeader* rpfHeader)
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimRpfToc::buildTocEntryList: entered.....\n";
-   }
-   std::ifstream in(m_filename.c_str(), std::ios::in | std::ios::binary);
-
-   if(!in)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimRpfToc::buildTocEntryList: invalid input leaving..... " << std::endl;
-      }
-      return;
-   }
-   
-   if(rpfHeader)
-   {
-      if(traceDebug())
-      {
-         rpfHeader->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-      
-      deleteTocEntryList();
-      ossimRpfBoundaryRectSectionSubheader *boundaryRect =
-         rpfHeader->getNewBoundaryRectSectSubheader(in);
-
-      if(boundaryRect)
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: Got boundary rect\n";
-         }
-         std::streamoff current = in.tellg();
-
-         // they give the offset from the
-         // end of the boundary subheader to the start of the 
-         // entry table.  We have to create an absolute
-         // offset.
-         current += boundaryRect->getTableOffset();
-
-         // take to the start of the table entries
-         in.seekg(current, ios::beg);
-         allocateTocEntryList(boundaryRect->getNumberOfEntries());
-
-         // now we can read the entries
-         if(m_tocEntryList.size() > 0)
-         {
-            for(ossim_uint32 index = 0; index < m_tocEntryList.size(); index++)
-            {
-               m_tocEntryList[index]->parseStream(in, rpfHeader->getByteOrder());
-            }
-         }
-         
-         ossimRpfFrameFileIndexSectionSubheader* frameFileIndexHead = rpfHeader->getNewFrameFileIndexSectionSubheader(in);
-         // get the offset to the table
-         long offsetToIndexSubsection = in.tellg();
-         if(frameFileIndexHead)
-         {
-            ossimRpfFrameFileIndexRecord tempIndexRec;
-            ossimRpfPathnameRecord       tempPathNameRec;
-            
-            ossim_int32 count = frameFileIndexHead->getNumberOfIndexRecords();
-            while(count > 0)
-            {
-               tempIndexRec.parseStream(in, rpfHeader->getByteOrder() );
-
-               // get the path information.  we must seek to a different location
-               // within the file.  So we must remember where we currently are at
-               std::streamoff currentPosition = in.tellg();
-               
-               in.seekg(offsetToIndexSubsection + tempIndexRec.getPathnameRecordOffset(), ios::beg);
-               tempPathNameRec.parseStream(in, rpfHeader->getByteOrder());
-
-               // We have the root directory where all frame files are subfiles of
-//               ossimString rootDirectory(ossimFilename(m_filename.path())+
-               // ossimFilename(ossimFilename::thePathSeparator));
-               ossimFilename rootDirectory;
-               getRootDirectory(rootDirectory);
-
-               // we have the actual path from the root directory to the
-               // frame file.  We must separate the two.  There have been
-               // occurrences where the path in the A.TOC file
-               // is upper case but the path in the directory on the file
-               // system is lower case.  This
-               // will fool the system in thinking the file does not exist
-               // when it actually does.
-               ossimString pathToFrameFile( ossimFilename(tempPathNameRec.getPathname()) +
-                                              tempIndexRec.getFilename());
-
-               ossimRpfFrameEntry entry(rootDirectory,
-                                        pathToFrameFile);
-               m_tocEntryList[tempIndexRec.getBoundaryRecNumber()]->setEntry(entry,
-                                                                              tempIndexRec.getLocationRowNumber(),
-                                                                              tempIndexRec.getLocationColNumber());
-               // now go back to where we were
-               in.seekg(currentPosition, ios::beg);
-               
-               --count;
-            }
-            delete frameFileIndexHead;
-            frameFileIndexHead = 0;
-         }
-      }
-      delete boundaryRect;
-      boundaryRect = NULL;
-   }
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimRpfToc::buildTocEntryList: leaving....." << std::endl;
-   }
-}
-
-void ossimRpfToc::allocateTocEntryList(ossim_uint32 numberOfEntries)
-{
-   if(m_tocEntryList.size() > 0)
-   {
-      deleteTocEntryList();
-   }
-   for(ossim_uint32 index = 0; index < numberOfEntries; index++)
-   {
-      m_tocEntryList.push_back(new ossimRpfTocEntry);
-   }   
-}
-
-void ossimRpfToc::getRootDirectory(ossimFilename& dir) const
-{
-   dir = m_filename.expand().path();
-}
-
-void ossimRpfToc::getFirstEntry(const ossimRpfTocEntry* rpfTocEntry,
-                                ossimRpfFrameEntry& frameEntry) const
-{
-   if (rpfTocEntry)
-   {
-      ossim_int32 framesHorizontal =
-         rpfTocEntry->getNumberOfFramesHorizontal();
-      ossim_int32 framesVertical =
-         rpfTocEntry->getNumberOfFramesVertical();
-   
-      bool foundEntry = false;
-      for (ossim_int32 v = 0; v < framesVertical; ++v)
-      {
-         for (ossim_int32 h = 0; h < framesHorizontal; ++h)
-         {
-            rpfTocEntry->getEntry(v, h, frameEntry);
-            if (frameEntry.exists())
-            {
-               foundEntry = true;
-               break;
-            }
-         }
-         if (foundEntry)
-         {
-            break;
-         }
-      }
-   }
-}
-
-void ossimRpfToc::writeFrameFileIndexSection(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
-                                             std::ifstream& dotRpfStr,
-                                             std::ofstream& dotTocStr)
-{
-   static const char MODULE[] = "ossimRpfToc::writeFrameFileIndexSection";
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   const ossim_uint16 FRAME_FILE_INDEX_RECORD_LENGTH = 33;
-   ossim_uint32 frames = getNumberOfFrames(dotRpfStr);
-   ossim_uint32 pathnameRecordOffset = FRAME_FILE_INDEX_RECORD_LENGTH * frames;
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "frames: " << frames << "\n";
-   }
-   
-   if ( !dotRpfStr.good() )
-   {
-      // see if we can clear it.  Someone might have hit end of file(eof).
-      dotRpfStr.clear();
-   }
-
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   std::string line;
-   ossimFilename file;
-   ossimRpfFrameFileIndexRecord record;
-   ossim_uint32 framesWritten = 0;
-
-   // Eat the first line which is the bounding rect line
-   std::getline(dotRpfStr, line);
-
-   while( dotRpfStr.good() )
-   {
-      std::getline(dotRpfStr, line);
-
-      if ( dotRpfStr.good() )
-      {
-         if ( getFile(line, file) )
-         {
-            if ( frameFileSubSection->getFrameFileIndexRecordFromFile(file.file(), record) )
-            {
-               // Always single entry.
-               record.setBoundaryRecNumber(0);
-               
-               record.setPathnameRecordOffset(pathnameRecordOffset);
-               record.writeStream(dotTocStr);
-               ++framesWritten;
-
-               if ( traceDebug() )
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG) << "wrote record:\n" << record << "\n";
-               }
-            }
-         }
-      }
-   }
-
-   // Now set the path record.
-   ossimFilename d = file.path();
-   ossimString s = "./";
-   s += d.file();
-   s += "/";
-   ossimRpfPathnameRecord pathRecord;
-   pathRecord.setPathName(s);
-   pathRecord.writeStream(dotTocStr);
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "frames written: " << framesWritten
-         << "\nwrote record:\n" << pathRecord
-         << "\n";
-   }
-
-   dotRpfStr.clear();
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
-   }
-}
-
-void ossimRpfToc::copyFrames(std::ifstream& dotRpfStr, const ossimFilename& outputDir)
-{
-   static const char MODULE[] = "ossimRpfToc::copyFrames";
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossim_uint32 frames = getNumberOfFrames(dotRpfStr);
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "frames to copy: " << frames << "\n";
-   }
-   
-   if ( !dotRpfStr.good() )
-   {
-      // see if we can clear it.  Someone might have hit end of file(eof).
-      dotRpfStr.clear();
-   }
-
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   std::string line;
-   ossimFilename file;
-   ossimFilename destinationFile;
-   ossimFilename subDir;
-   ossim_uint32 framesCopied = 0;
-            
-   // Eat the first line which is the bounding rect line
-   std::getline(dotRpfStr, line);
-
-   // Get the second line which is first file. 
-   std::getline(dotRpfStr, line);
-
-   // Get the file name and make the sub directory if needed.
-   if ( getFile(line, file) )
-   {
-      destinationFile = outputDir;
-      subDir = file.path();
-      subDir = subDir.file();
-      destinationFile = destinationFile.dirCat( subDir );
-      
-      // This is output_dir/subdir.  See if subdir exist:
-      if ( !destinationFile.exists() )
-      {
-         destinationFile.createDirectory();
-      }
-   }
-
-   // Start over:
-   if ( !dotRpfStr.good() )
-   {
-      // see if we can clear it.  Someone might have hit end of file(eof).
-      dotRpfStr.clear();
-   }
-   dotRpfStr.seekg(0, ios_base::beg);
-   
-   // Eat the first line which is the bounding rect line
-   std::getline(dotRpfStr, line);
-   
-   while( dotRpfStr.good() )
-   {
-      std::getline(dotRpfStr, line);
-
-      if ( dotRpfStr.good() )
-      {
-         if ( getFile(line, file) )
-         {
-            destinationFile = outputDir;
-            subDir = file.path();
-            subDir = subDir.file();
-            destinationFile = destinationFile.dirCat( subDir );
-            destinationFile = destinationFile.dirCat( file.file() );
-
-            if ( file.copyFileTo(destinationFile) )
-            {
-               ++framesCopied;
-            }
-            if ( traceDebug() )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG) << "Copied frame: " << destinationFile << "\n";
-            }
-         }
-      }
-   }
-
-   ossimNotify(ossimNotifyLevel_NOTICE) << "Frames copied: " << framesCopied << std::endl;
-
-   dotRpfStr.clear();
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
-   }
-}
-
-ossim_uint32 ossimRpfToc::getNumberOfFrames(std::ifstream& dotRpfStr) const
-{
-   ossim_uint32 result = 0;
-
-   if ( !dotRpfStr.good() )
-   {
-      // see if we can clear it.  Someone might have hit end of file(eof).
-      dotRpfStr.clear();
-   }
-
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   // Eat the first line which is the bounding rect.
-   std::string line;
-   std::getline(dotRpfStr, line);
-   
-   while( dotRpfStr.good() )
-   {
-      std::getline(dotRpfStr, line);
-
-      if ( dotRpfStr.good() )
-      {
-         ++result;
-      }
-   }
-
-   dotRpfStr.clear();
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   return result;
-}
-
-ossimFilename ossimRpfToc::getSourceTocFile(std::ifstream& dotRpfStr) const
-{
-   ossimFilename tocFile;
-   
-   if ( !dotRpfStr.good() )
-   {
-      dotRpfStr.clear();
-   }
-
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   // Eat the first line which is the bounding rect.
-   std::string line;
-   std::getline(dotRpfStr, line);
-
-   // Get the second line which is first file. 
-   std::getline(dotRpfStr, line);
-
-   // Get the file name and make the sub directory if needed.
-   ossimFilename file;
-   if ( getFile(line, file) )
-   {
-      ossimFilename subDir = file.path();
-      tocFile = subDir.dirCat("a.toc");
-      if ( !tocFile.exists() )
-      {
-         tocFile = subDir.dirCat("A.TOC");
-         if ( !tocFile.exists() )
-         {
-            subDir = subDir.path();
-            tocFile = subDir.dirCat("a.toc");
-            if ( !tocFile.exists() )
-            {
-               tocFile = subDir.dirCat("A.TOC");
-               if ( !tocFile.exists() )
-               {
-                  tocFile.clear();
-               }
-            }
-         }
-      }
-   }
-
-   if ( !dotRpfStr.good() )
-   {
-      dotRpfStr.clear();
-   }
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfToc::getSourceTocFile result: " << tocFile << "\n";
-   }
-
-   return tocFile;
-}
-
-bool ossimRpfToc::getCorespondingEntry(
-   ossimRpfFrameFileIndexSubsection* frameFileSubSection,
-   std::ifstream& dotRpfStr, ossim_uint32& entry) const
-{
-   bool result = false;
-   
-   if ( !dotRpfStr.good() )
-   {
-      // see if we can clear it.  Someone might have hit end of file(eof).
-      dotRpfStr.clear();
-   }
-   
-   dotRpfStr.seekg(0, ios_base::beg);
-
-   std::string line;
-   ossimFilename file;
-   ossimRpfFrameFileIndexRecord record;
-
-   // Eat the first line which is the bounding rect line
-   std::getline(dotRpfStr, line);
-
-   std::getline(dotRpfStr, line);
-
-   if ( getFile(line, file) )
-   {
-      if ( frameFileSubSection->getFrameFileIndexRecordFromFile(file.file(), record) )
-      {
-         entry = record.getBoundaryRecNumber();
-         result = true;
-      }
-   }
-
-   if ( !dotRpfStr.good() )
-   {
-      dotRpfStr.clear();
-   }
-
-   dotRpfStr.seekg(0, ios_base::beg);
-   return result;
-}
-
-bool ossimRpfToc::getFile(const std::string& line, ossimFilename& file) const
-{
-   //---
-   // line form:
-   // /some_path/N03E030/006EZC1B.I21|30.4654240835311,3.59074642049858|30.5401678385356,3.65984532949882
-   //           <file>                    <lr_lon>           <lr_lat>        <ur_lon>          <ur_lat>
-   //---
-   
-   bool result = false;
-   if ( line.size() )
-   {
-      ossimString os(line);
-      std::vector<ossimString> lineArray;
-      os.split(lineArray, "|");
-      if ( lineArray.size() )
-      {
-         file = lineArray[0];
-         result = true;
-      }
-   }
-   return result;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimRpfTocEntry.cpp b/ossim/src/ossim/support_data/ossimRpfTocEntry.cpp
deleted file mode 100644
index 58d38a4..0000000
--- a/ossim/src/ossim/support_data/ossimRpfTocEntry.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-// 
-// Author: Garrett Potts
-//
-//*************************************************************************
-// $Id: ossimRpfTocEntry.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <istream>
-#include <ostream>
-#include <iterator>
-
-#include <ossim/support_data/ossimRpfTocEntry.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimAzimEquDistProjection.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/support_data/ossimRpfFrameEntry.h>
-
-std::ostream& operator <<(std::ostream& out,
-                          const ossimRpfTocEntry& data)
-{
-   data.print(out);
-   return out;
-}
-
-ossimRpfTocEntry::ossimRpfTocEntry()
-{
-   
-}
-
-ossimErrorCode ossimRpfTocEntry::parseStream(
-   std::istream &in, ossimByteOrder byteOrder)
-{
-   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
-   
-   result = theBoundaryInformation.parseStream(in, byteOrder);
-   if(result == ossimErrorCodes::OSSIM_OK)
-   {
-      allocateFrameEntryArray();
-   }
-
-   // Fetch the number of samples as data member since it may need to be adjusted due to 
-   // wrap (OLK 10/10):
-   theNumSamples =  theBoundaryInformation.getNumberOfFramesHorizontal() * 1536;
-   ossimDpt ddpp;
-   getDecimalDegreesPerPixel(ddpp);
-   ossim_float64 width_in_deg = theNumSamples*ddpp.x;
-   if (width_in_deg >= 360.0)
-      theNumSamples -= (width_in_deg - 360.0)/ddpp.x;
-
-   return result;
-}
-
-std::ostream& ossimRpfTocEntry::print(std::ostream& out,
-                                      const std::string& prefix) const
-{
-   theBoundaryInformation.print(out, prefix);
-
-   std::vector< std::vector<ossimRpfFrameEntry> >::const_iterator frameEntry =
-      theFrameEntryArray.begin();
-
-   while( frameEntry != theFrameEntryArray.end() )
-   {
-      std::vector<ossimRpfFrameEntry>::const_iterator i =
-         (*frameEntry).begin();
-      while ( i != (*frameEntry).end() ) 
-      {
-         (*i).print(out, prefix);
-         ++i;
-      }
-      ++frameEntry;
-   }
-   return out;
-}
-
-ossim_uint32 ossimRpfTocEntry::getNumberOfFramesHorizontal()const
-{
-   return theBoundaryInformation.getNumberOfFramesHorizontal();
-}
-
-ossim_uint32 ossimRpfTocEntry::getNumberOfFramesVertical()const
-{
-   return theBoundaryInformation.getNumberOfFramesVertical();
-}
-
-ossim_uint32 ossimRpfTocEntry::getNumberOfLines() const
-{
-   return  theBoundaryInformation.getNumberOfFramesVertical() * 1536;
-}
-
-ossim_uint32 ossimRpfTocEntry::getNumberOfSamples() const
-{
-   return theNumSamples;
-}
-
-ossim_uint32 ossimRpfTocEntry::getNumberOfBands() const
-{
-   ossim_uint32 result = 0;
-   ossimString productType = getProductType().trim().upcase();
-   if( productType == "CIB" )
-   {
-      result = 1;
-   }
-   else if ( productType == "CADRG" )
-   {
-      result = 3;
-   }
-   return result;
-}
-
-void ossimRpfTocEntry::getBoundingRect(ossimIrect& rect) const
-{
-   rect = ossimIrect(0, 0, getNumberOfSamples()-1, getNumberOfLines()-1); 
-}
-
-const ossimRpfBoundaryRectRecord& ossimRpfTocEntry::getBoundaryInformation() const
-{
-   return theBoundaryInformation;
-}
-
-void ossimRpfTocEntry::setEntry(const ossimRpfFrameEntry& entry,
-                                long row,
-                                long col)
-{
-   if(row < (long)theFrameEntryArray.size() && row >= 0)
-   {
-      if(col < (long)theFrameEntryArray[row].size() && col >= 0)
-      {
-         theFrameEntryArray[row][col] = entry;
-      }
-   }
-}
-
-bool ossimRpfTocEntry::getEntry(long row,
-                                long col,
-                                ossimRpfFrameEntry& result)const
-{
-   if(row < (long)theFrameEntryArray.size() && row >= 0)
-   {
-      if(col < (long)theFrameEntryArray[row].size() && col >= 0)
-      {
-         result = theFrameEntryArray[row][col];
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-   
-   return true;
-}
-
-ossimString ossimRpfTocEntry::getProductType() const
-{
-   return theBoundaryInformation.getProductType();
-}
-
-/*!
- * If there is an entry and all the files don't exist we will return
- * true.
- */
-bool ossimRpfTocEntry::isEmpty()const
-{
-   long rows = (long)theFrameEntryArray.size();
-   long cols = 0;
-   if(rows > 0)
-   {
-      cols = (long)theFrameEntryArray[0].size();
-      for(long rowIndex = 0; rowIndex < rows; ++ rowIndex)
-      {
-         for(long colIndex = 0; colIndex < cols; ++colIndex)
-         {
-            if(theFrameEntryArray[rowIndex][colIndex].exists())
-            {
-               return false;
-            }
-         }
-      }
-   }
-
-   return true;
-}
-
-ossimRefPtr<ossimImageGeometry> ossimRpfTocEntry::getImageGeometry() const
-{
-
-   ossimGpt ul(theBoundaryInformation.getCoverage().getUlLat(), 
-               theBoundaryInformation.getCoverage().getUlLon());
-
-   // Decimal degrees per pixel:
-   ossimDpt ddpp;
-   getDecimalDegreesPerPixel(ddpp);
-   
-   // Tie point - Shifted to pixel-is-point:
-   ossimGpt tie( (ul.latd() - (ddpp.y/2.0)), (ul.lond() + (ddpp.x/2.0)), 0.0 );
-   
-   // Origin - Use the center latitude for horizontal scale, and the left edge as origin longitude
-   // (OLK 10/10)
-   ossimGpt origin ((ul.lat + theBoundaryInformation.getCoverage().getLlLat())/2.0, tie.lon);
-
-#if 0 /* Please leave for debug. (drb) */
-   std::cout << "boundaryInfo:\n" << boundaryInfo << std::endl;
-#endif
-
-   int z = theBoundaryInformation.getZone();
-   
-   if (z == 74) z--; // Fix J to a zone.
-   if (z > 64) z -= 64; // Below the equator
-   else z -= 48; // Above the equator
-
-   ossimRefPtr<ossimMapProjection> mapProj = 0;
-   if ( z != 9 )
-   {
-      mapProj = new ossimEquDistCylProjection;
-   }
-   else
-   {
-      mapProj = new ossimAzimEquDistProjection;
-   }
-
-   // Set the origin:
-   mapProj->setOrigin(origin);
-   
-   // Set the scale:
-   mapProj->setDecimalDegreesPerPixel(ddpp);
-
-   // Set the tie:
-   mapProj->setUlTiePoints(tie);
-
-   // Give projection to the geometry object.
-   ossimRefPtr<ossimImageGeometry> geom =  new ossimImageGeometry;
-   geom->setProjection( mapProj.get() );
-
-   return geom;
-}
-
-void ossimRpfTocEntry::getDecimalDegreesPerPixel(ossimDpt& scale) const
-{
-#if 1
-   scale.x = theBoundaryInformation.getCoverage().getHorizontalInterval();
-   scale.y = theBoundaryInformation.getCoverage().getVerticalInterval();
-#else
-   ossim_float64 ulLat = theBoundaryInformation.getCoverage().getUlLat();
-   ossim_float64 ulLon = theBoundaryInformation.getCoverage().getUlLon();
-   ossim_float64 urLon = theBoundaryInformation.getCoverage().getUrLon();
-   ossim_float64 llLat = theBoundaryInformation.getCoverage().getLrLat();
-   ossim_float64 lines = getNumberOfLines();
-   ossim_float64 samps = getNumberOfSamples();
-   scale.x = (urLon - ulLon) / samps;
-   scale.y = (ulLat - llLat) / lines;
-#endif
-}
-
-void ossimRpfTocEntry::getMetersPerPixel(ossimDpt& scale) const
-{
-   scale.x = theBoundaryInformation.getCoverage().getVerticalResolution();
-   scale.y = theBoundaryInformation.getCoverage().getHorizontalResolution();
-}
-
-void ossimRpfTocEntry::allocateFrameEntryArray()
-{
-   theFrameEntryArray.resize(theBoundaryInformation.getNumberOfFramesVertical());
-   ossim_uint32 horizontalSize = theBoundaryInformation.getNumberOfFramesHorizontal();
-
-   for(ossim_uint32 index = 0; index < theFrameEntryArray.size(); index++)
-   {
-      theFrameEntryArray[index].resize(horizontalSize);
-   }
-}
-
diff --git a/ossim/src/ossim/support_data/ossimSrtmSupportData.cpp b/ossim/src/ossim/support_data/ossimSrtmSupportData.cpp
deleted file mode 100644
index 5679d08..0000000
--- a/ossim/src/ossim/support_data/ossimSrtmSupportData.cpp
+++ /dev/null
@@ -1,913 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description:
-// 
-// Support data class for a Shuttle Radar Topography Mission (SRTM) file.
-//
-//----------------------------------------------------------------------------
-// $Id: ossimSrtmSupportData.cpp 21527 2012-08-26 16:50:49Z dburken $
-
-#include <cmath>
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-
-#include <ossim/support_data/ossimSrtmSupportData.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimDatumFactory.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimRegExp.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStreamFactoryRegistry.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimMapProjection.h>
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimSrtmSupportData:debug");
-
-//---
-// Start with the min and max at some default setting.
-// Mt. Everest highest elev point on Earth 8850 meters.
-//---
-static const ossim_float64 DEFAULT_MIN = -8850.0;
-static const ossim_float64 DEFAULT_MAX =  8850.0;
-
-
-ossimSrtmSupportData::ossimSrtmSupportData()
-   :
-   theFile(),
-   theNumberOfLines(0),
-   theNumberOfSamples(0),
-   theSouthwestLatitude(ossim::nan()),
-   theSouthwestLongitude(ossim::nan()),
-   theLatSpacing(ossim::nan()),
-   theLonSpacing(ossim::nan()),
-   theMinPixelValue(DEFAULT_MIN),
-   theMaxPixelValue(DEFAULT_MAX),
-   theScalarType(OSSIM_SCALAR_UNKNOWN)
-{
-}
-
-ossimSrtmSupportData::~ossimSrtmSupportData()
-{
-}
-
-bool ossimSrtmSupportData::setFilename(const ossimFilename& srtmFile,
-                                       bool scanForMinMax)
-{
-   theFile = srtmFile;
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimSrtmSupportData::setFilename: entered:"
-         << "\nsrtmFile:  " << srtmFile
-         << "\nscanForMinMax flag:  " << scanForMinMax
-         << std::endl;
-   }
-   
-   theFileStream =  ossimStreamFactoryRegistry::instance()->
-      createNewIFStream(theFile,
-                        std::ios_base::in | std::ios_base::binary);
-   if (theFileStream.valid())
-   {
-      if(theFileStream->fail())
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << theFile << " does not exist: leaving ..." << std::endl;
-         }
-         clear();
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-
-   // Start with default.
-   theMinPixelValue = DEFAULT_MIN;
-   theMaxPixelValue = DEFAULT_MAX;
-   
-   // See if we have an ossim metadata file to initialize from.
-   bool outputOmd     = false;
-   bool loadedFromOmd = false;
-   
-   ossimFilename omdFile = theFile;
-   omdFile.setExtension(ossimString("omd"));
-   if (omdFile.exists())
-   {
-      //---
-      // The loadOmd is called instead of loadState so theFile is not
-      // overwrote.
-      //---
-      ossimKeywordlist kwl(omdFile);
-      loadedFromOmd = loadOmd(kwl);
-   }
-
-   if (!loadedFromOmd)
-   {
-      if (!setCornerPoints())
-      {
-         clear();
-         return false;
-      }
-      if (!setSize())
-      {
-         clear();
-         return false;
-      }
-      outputOmd = true;
-   }
-
-   if (scanForMinMax)
-   {
-      // These could have been picked up in the loadOmd.
-      if ( (theMinPixelValue == DEFAULT_MIN) ||
-           (theMaxPixelValue == DEFAULT_MAX) )
-      {
-         if ( computeMinMax() )
-         {
-            outputOmd = true;
-         }
-         else
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "Unable to compute min max: leaving ..." << std::endl;
-            }
-            clear();
-            return false;
-         }
-      }
-   }
-
-   //---
-   // NOTE:  The outputOmd flag should probably be set if !loadedFromOmd.
-   // Leaving as is for now (only set if scanForMinMax).
-   //---
-   if (outputOmd)
-   {
-      ossimKeywordlist kwl;
-      saveState(kwl);
-      kwl.write(omdFile);
-   }
-
-   if(theFileStream->is_open())
-   {
-      theFileStream->close();
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << *this << std::endl;
-   }
-   
-   return true;
-}
-
-ossimFilename ossimSrtmSupportData::getFilename() const
-{
-   return theFile;
-}
-
-ossim_uint32 ossimSrtmSupportData::getNumberOfLines() const
-{
-   return theNumberOfLines;
-}
-
-ossim_uint32 ossimSrtmSupportData::getNumberOfSamples() const
-{
-   return theNumberOfSamples;
-}
-
-bool ossimSrtmSupportData::getImageGeometry(ossimKeywordlist& kwl,
-                                            const char* prefix)
-{
-   if (theFile == ossimFilename::NIL)
-   {
-      return false;
-   }
-   
-   kwl.add(prefix,
-           ossimKeywordNames::TYPE_KW,
-           "ossimEquDistCylProjection",
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::ORIGIN_LATITUDE_KW,
-           0.0,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::CENTRAL_MERIDIAN_KW,
-           theSouthwestLongitude,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LAT_KW,
-           (theSouthwestLatitude+1.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LON_KW,
-           theSouthwestLongitude,
-           true);
-
-   // Add the pixel scale.
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-           theLatSpacing,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-           theLonSpacing,
-           true);
-
-   // Add the datum.  (always WGS-84 per spec)
-   kwl.add(prefix,
-           ossimKeywordNames::DATUM_KW,
-           ossimDatumFactory::instance()->wgs84()->code(),
-           true);
-
-   // Add the number of lines and samples.
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_LINES_KW,
-           theNumberOfLines,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_SAMPLES_KW,
-           theNumberOfSamples,
-           true);
-   
-   return true;
-}
-
-ossimRefPtr<ossimProjection> ossimSrtmSupportData::getProjection() const
-{
-   //---
-   // Make an Equidistant Cylindrical projection with a origin at the equator
-   // since the DTED post spacing is considered to be square.
-   //---
-   const ossimDatum* datum = ossimDatumFactory::instance()->wgs84();
-   ossimRefPtr<ossimEquDistCylProjection> eq = new ossimEquDistCylProjection(*(datum->ellipsoid()));
-   
-   //---
-   // Set the tie point.
-   // NOTE: Latitude southwest corner we need northwest; hence, the +1.
-   //---
-   eq->setUlTiePoints( ossimGpt(theSouthwestLatitude+1.0, theSouthwestLongitude, 0.0, datum) );
-   
-   // Set the scale:
-   eq->setDecimalDegreesPerPixel( ossimDpt(theLonSpacing, theLatSpacing) );
-
-   ossimRefPtr<ossimProjection> proj = eq.get();
-
-   return proj;
-}
-
-bool ossimSrtmSupportData::saveState(ossimKeywordlist& kwl,
-                                     const char* prefix) const
-{
-   if (theFile == ossimFilename::NIL)
-   {
-      return false;
-   }
-   
-   ossimString bandPrefix;
-   if (prefix)
-   {
-      bandPrefix = prefix;
-   }
-   bandPrefix += "band1.";
-   
-   kwl.add(prefix,
-           ossimKeywordNames::FILENAME_KW,
-           theFile.c_str(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_BANDS_KW,
-           1,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_LINES_KW,
-           theNumberOfLines,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::NUMBER_SAMPLES_KW,
-           theNumberOfSamples,
-           true);
-
-   //---
-   // Special case, store the tie point as the upper left lat so add one.
-   //---
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LAT_KW,
-           (theSouthwestLatitude + 1.0),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_LON_KW,
-           theSouthwestLongitude,
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-           theLatSpacing,
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-           theLonSpacing,
-           true);
-
-   // User can opt out of scanning for this so don't save if it is still nan.
-   if (theMinPixelValue != DEFAULT_MIN)
-   {
-      kwl.add(bandPrefix,
-              ossimKeywordNames::MIN_VALUE_KW,
-              theMinPixelValue,
-              true);
-   }
-
-   // User can opt out of scanning for this so don't save if it is still nan.
-   if (theMaxPixelValue != DEFAULT_MAX)
-   {
-      kwl.add(bandPrefix.c_str(),
-              ossimKeywordNames::MAX_VALUE_KW,
-              theMaxPixelValue,
-              true);
-   }
-
-   // constant
-   kwl.add(bandPrefix,
-           ossimKeywordNames::NULL_VALUE_KW,
-           "-32768",
-           true);
-
-   // constant
-   kwl.add(prefix,
-           ossimKeywordNames::BYTE_ORDER_KW,
-           "big_endian",
-           true);
-
-   // constant
-   kwl.add(prefix,
-           ossimKeywordNames::SCALAR_TYPE_KW,
-           ossimScalarTypeLut::instance()->getEntryString(theScalarType),
-           true);
-
-   return true;
-}
-   
-bool ossimSrtmSupportData::loadState(const ossimKeywordlist& kwl,
-                                     const char* prefix)
-{
-   ossimString bandPrefix;
-   if (prefix)
-   {
-      bandPrefix = prefix;
-   }
-   bandPrefix += "band1.";
-   
-   ossimString s; // For numeric conversions.
-   
-   const char* lookup;
-
-   // Look for "filename" then look for deprecated "image_file" next.
-   lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
-   if (lookup)
-   {
-      theFile = lookup;
-   }
-   else
-   {
-      // Deprecated...
-      lookup = kwl.find(prefix, ossimKeywordNames::IMAGE_FILE_KW);
-      if (lookup)
-      {
-         theFile = lookup;
-      }
-      else
-      {
-         return false;
-      }
-   }
-
-   return loadOmd(kwl, prefix);
-}
-
-bool ossimSrtmSupportData::loadOmd(const ossimKeywordlist& kwl,
-                                   const char* prefix)
-{
-   std::string pfx;
-   std::string bandPrefix;
-   
-   if (prefix) // Cannot give null to std::string.
-   {
-      pfx        = prefix;
-      bandPrefix = prefix;
-   }
-   bandPrefix += "band1.";
-   
-   ossimString value;
-
-   //---
-   // Look for the min and max first since they could have been populated by
-   // "cmm" (compute min max).  Min and Max are not required by this method
-   // as they are handled elsewhere if they are not found here.
-   //---
-   
-   // Not an error if not present.
-   value.string() = kwl.findKey(bandPrefix, std::string(ossimKeywordNames::MIN_VALUE_KW));
-   if ( value.size() )
-   {
-      theMinPixelValue = value.toFloat64();
-   }
-   
-   // Not an error if not present.
-   value.string() = kwl.findKey(bandPrefix.c_str(), std::string(ossimKeywordNames::MAX_VALUE_KW));
-   if ( value.size() )
-   {
-      theMaxPixelValue = value.toFloat64();
-   }
-   
-   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_LINES_KW));
-   if ( value.size() )
-   {
-      theNumberOfLines = value.toUInt32();
-   }
-   else
-   {
-      return false;
-   }
-   
-   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_SAMPLES_KW));
-   if ( value.size() )
-   {
-      theNumberOfSamples = value.toUInt32();
-   }
-   else
-   {
-      return false;
-   }
-
-   //---
-   // Special case the tie point was stored as the upper left so we must
-   // subtract one.
-   //---
-   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::TIE_POINT_LAT_KW));
-   if ( value.size() )
-   {
-      theSouthwestLatitude = value.toFloat64() - 1.0;
-   }
-   else
-   {
-      return false;
-   }
-
-   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::TIE_POINT_LON_KW));
-   if ( value.size() )
-   {
-      theSouthwestLongitude = value.toFloat64();
-   }
-   else
-   {
-      return false;
-   }
-   
-   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
-   
-   if (scalar != ossimLookUpTable::NOT_FOUND)
-   {
-      theScalarType = (ossimScalarType)scalar;
-      if((theScalarType != OSSIM_FLOAT32) && (theScalarType != OSSIM_SINT16))
-      {
-         return false;
-      }
-   }
-   else
-   {
-      return false;
-   }
-   
-   theLatSpacing = 1.0 / (theNumberOfLines   - 1);
-   theLonSpacing = 1.0 / (theNumberOfSamples - 1);
-   
-   return true;
-}
-
-ossim_float64 ossimSrtmSupportData::getSouthwestLatitude() const
-{
-   return theSouthwestLatitude;
-}
-
-ossim_float64 ossimSrtmSupportData::getSouthwestLongitude() const
-{
-   return theSouthwestLongitude;
-}
-ossim_float64 ossimSrtmSupportData::getLatitudeSpacing() const
-{
-   return theLatSpacing;
-}
-
-ossim_float64 ossimSrtmSupportData::getLongitudeSpacing() const
-{
-   return theLonSpacing;
-}
-
-void ossimSrtmSupportData::clear()
-{
-   theFile               = ossimFilename::NIL;
-   theNumberOfLines      = 0;
-   theNumberOfSamples    = 0;
-   theSouthwestLatitude  = ossim::nan();
-   theSouthwestLongitude = ossim::nan();
-   theLatSpacing         = ossim::nan();
-   theLonSpacing         = ossim::nan();
-   theMinPixelValue      = DEFAULT_MIN;
-   theMaxPixelValue      = DEFAULT_MAX;
-}
-
-bool ossimSrtmSupportData::setCornerPoints()
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimSrtmSupportData::setCornerPoints(): entered..." << std::endl;
-   }
-   
-   ossimFilename f = theFile.fileNoExtension();
-   ossimString regularExp1 = "[N|S][0-9][0-9][E|W][0-9][0-9][0-9]";
-   ossimString regularExp2 = "[E|W][0-9][0-9][0-9][N|S][0-9][0-9]";
-   ossimRegExp regEx;
-   bool latLonOrderFlag = true;
-   bool foundFlag = false;
-   f = f.upcase();
-
-   regEx.compile(regularExp1.c_str());
-   foundFlag = regEx.find(f.c_str());
-   if(!foundFlag)
-   {
-      regEx.compile(regularExp2.c_str());
-      foundFlag = regEx.find(f.c_str());
-      if(foundFlag)
-      {
-         latLonOrderFlag = false;
-         f = ossimFilename(ossimString(f.begin()+regEx.start(),
-                                       f.begin()+regEx.end()));
-      }
-   }
-   if(foundFlag)
-   {
-      f = ossimFilename(ossimString(f.begin()+regEx.start(),
-                                    f.begin()+regEx.end()));
-   }
-   if (f.size() != 7)
-   {
-      return false;
-   }
-//    ossimString s;
-
-   if(latLonOrderFlag)
-   {
-      
-//       s.push_back(f[1]);
-//       s.push_back(f[2]);
-      theSouthwestLatitude = ossimString(f.begin()+1,
-                                         f.begin()+3).toDouble();//s.toDouble();
-      // Get the latitude.
-      if (f[static_cast<std::string::size_type>(0)] == 'S')
-      {
-         theSouthwestLatitude *= -1;
-      }
-      else if (f[static_cast<std::string::size_type>(0)] != 'N')
-      {
-         return false; // Must be either 's' or 'n'.
-      }
-      // Get the longitude.
-//       s.clear();
-//       s.push_back(f[4]);
-//       s.push_back(f[5]);
-//       s.push_back(f[6]);
-      theSouthwestLongitude = ossimString(f.begin()+4,
-                                          f.begin()+7).toDouble();//s.toDouble();
-      if (f[static_cast<std::string::size_type>(3)] == 'W')
-      {
-      theSouthwestLongitude *= -1;
-      }
-      else if (f[static_cast<std::string::size_type>(3)] != 'E')
-      {
-         return false; // Must be either 'e' or 'w'.
-      }
-   }
-   else
-   {
-      // Get the longitude.
-//       s.clear();
-//       s.push_back(f[1]);
-//       s.push_back(f[2]);
-//       s.push_back(f[3]);
-      theSouthwestLongitude =  ossimString(f.begin()+1,
-                                           f.begin()+4).toDouble();//s.toDouble();
-      if (f[static_cast<std::string::size_type>(0)] == 'W')
-      {
-      theSouthwestLongitude *= -1;
-      }
-      else if (f[static_cast<std::string::size_type>(0)] != 'E')
-      {
-         return false; // Must be either 'e' or 'w'.
-      }
-//       s.clear();
-      
-//       s.push_back(f[5]);
-//       s.push_back(f[6]);
-      theSouthwestLatitude = ossimString(f.begin()+5,
-                                         f.begin()+7).toDouble();//s.toDouble();
-      // Get the latitude.
-      if (f[static_cast<std::string::size_type>(4)] == 'S')
-      {
-         theSouthwestLatitude *= -1;
-      }
-      else if (f[static_cast<std::string::size_type>(4)] != 'N')
-      {
-         return false; // Must be either 's' or 'n'.
-      }
-   }
-   
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimSrtmSupportData::setCornerPoints(): leaving with true..."
-         << std::endl;
-   }
-   return true;
-}
-
-bool ossimSrtmSupportData::setSize()
-{
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimSrtmSupportData::setSize(): entered..." << std::endl;
-   }
-
-   if(theFileStream->is_open() == false)
-   {
-      theFileStream =
-         ossimStreamFactoryRegistry::instance()->createNewIFStream(
-            theFile,
-            std::ios_base::in | std::ios_base::binary);
-   }
-   
-   if (!theFileStream.valid())
-   {
-      return false;
-   }
-
-   if(theFileStream->fail())
-   {
-      return false;
-   }
-   
-   ossim_float64 size = 0.0;
-   theFileStream->seekg(0, std::ios::beg);
-   if(theFileStream->isCompressed())
-   {
-      ossimFilename tmp = theFile;
-      tmp.setExtension("hgt");
-      if(!tmp.exists())
-      {
-         ossimOFStream out(tmp.c_str(),
-                           std::ios::out|std::ios::binary);
-
-         if(!out.fail())
-         {
-            bool done = false;
-            char buf[1024];
-            while(!done&&!theFileStream->fail())
-            {
-               theFileStream->read(buf, 1024);
-               if(theFileStream->gcount() < 1024)
-               {
-                  done = true;
-               }
-               if(theFileStream->gcount() > 0)
-               {
-                  out.write(buf, theFileStream->gcount());
-               }
-            }
-            out.close();
-            size = tmp.fileSize();
-            tmp.remove();
-         }
-      }
-   }
-   else
-   {
-      size = theFile.fileSize();
-   }
-   if (!size)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ossimSrtmSupportData::setSize(): leaving with false at line "
-            << __LINE__ << std::endl;
-      }
-      return false;
-   }
-
-   theScalarType = OSSIM_SCALAR_UNKNOWN;
-   
-   //---
-   // Assuming square for now.  Have to check the spec for this.
-   //---
-   if (size == 25934402) // 2 * 3601 * 3601 three arc second
-   {
-      theNumberOfLines     = 3601;
-      theNumberOfSamples   = 3601;
-      theScalarType = OSSIM_SINT16;
-   }
-   else if(size == 51868804) // 4*3601*3601
-   {
-      theNumberOfLines   = 3601;
-      theNumberOfSamples = 3601;
-      theScalarType = OSSIM_FLOAT32;
-   }
-   else if (size == 2884802) // 2 * 1201 * 1201 one arc second
-   {
-      theNumberOfLines   = 1201;
-      theNumberOfSamples = 1201;
-      theScalarType = OSSIM_SINT16;
-   }
-   else if (size == 5769604)
-   {
-      theNumberOfLines   = 1201;
-      theNumberOfSamples = 1201;
-      theScalarType = OSSIM_FLOAT32;
-   }
-   else // try to get a square width and height
-   {
-      ossim_uint64 lines   = (ossim_uint64)sqrt((ossim_float64)(size / 2));
-      ossim_uint64 samples = (ossim_uint64)sqrt((ossim_float64)(size / 2));
-      // check square
-      if(lines*samples*2 == size)
-      {
-         theNumberOfLines   = lines;
-         theNumberOfSamples = samples;
-         theScalarType = OSSIM_SINT16;
-         
-      }
-      else
-      {
-         ossim_uint64 lines   = (ossim_uint64)sqrt((ossim_float64)(size / 4));
-         ossim_uint64 samples = (ossim_uint64)sqrt((ossim_float64)(size / 4));
-         // check square
-         if(lines*samples*4 == size)
-         {
-            theNumberOfLines   = lines;
-            theNumberOfSamples = samples;
-            theScalarType = OSSIM_FLOAT32;
-         }
-         else
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "ossimSrtmSupportData::setSize(): leaving with false at line " << __LINE__ << std::endl;
-            }
-            return false;
-         }
-      }
-   }
-      
-   theLatSpacing      = 1.0 / (theNumberOfLines   - 1);
-   theLonSpacing      = 1.0 / (theNumberOfSamples - 1);
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimSrtmSupportData::setSize(): leaving with true..."
-         << std::endl;
-   }
-
-   theFileStream->close();
-   
-   return true;
-}
-
-bool ossimSrtmSupportData::computeMinMax()
-{
-   if(theScalarType == OSSIM_FLOAT32)
-   {
-      return computeMinMaxTemplate((ossim_float32)0,
-                                   -32768.0);
-   }
-   return computeMinMaxTemplate((ossim_sint16)0,
-                                -32768.0);
-}
-
-template <class T>
-bool ossimSrtmSupportData::computeMinMaxTemplate(T /* dummy */,
-                                                 double defaultNull)
-{
-   if(theFileStream->is_open() == false)
-   {
-      theFileStream =
-         ossimStreamFactoryRegistry::instance()->createNewIFStream(
-            theFile,
-            std::ios_base::in | std::ios_base::binary);
-   }
-   
-   if (!theFileStream.valid())
-   {
-      return false;
-   }
-
-   if(theFileStream->fail())
-   {
-      return false;
-   }
-   
-   const size_t BYTES_IN_LINE = theNumberOfSamples * 2;
-   const T NULL_PIX = (T)defaultNull;
-
-   double minValue = 1.0/FLT_EPSILON;
-   double maxValue = -1.0/FLT_EPSILON;
-   T* line_buf = new T[theNumberOfSamples];
-   char* char_buf = (char*)line_buf;
-   ossimEndian swapper;
-
-   ossimByteOrder endianType = ossim::byteOrder();
-   for (ossim_uint32 line = 0; line < theNumberOfLines; ++line)
-   {
-      theFileStream->read(char_buf, (std::streamsize)BYTES_IN_LINE);
-      if(endianType == OSSIM_LITTLE_ENDIAN)
-      {
-         swapper.swap(line_buf, theNumberOfSamples);
-      }
-      for (ossim_uint32 sample = 0; sample < theNumberOfSamples; ++sample)
-      {
-         if (line_buf[sample] == NULL_PIX) continue;
-         if (line_buf[sample] > maxValue) maxValue = line_buf[sample];
-         if (line_buf[sample] < minValue) minValue = line_buf[sample];
-      }
-   }
-   delete [] line_buf;
-   theMinPixelValue = minValue;
-   theMaxPixelValue = maxValue;
-
-   theFileStream->close();
-
-   return true;
-}
-
-ossim_float64 ossimSrtmSupportData::getMinPixelValue() const
-{
-   return theMinPixelValue;
-}
-
-ossim_float64 ossimSrtmSupportData::getMaxPixelValue() const
-{
-   return theMaxPixelValue;
-}
-
-ossimScalarType ossimSrtmSupportData::getScalarType()const
-{
-   return theScalarType;
-}
-
-std::ostream& ossimSrtmSupportData::print(std::ostream& out) const
-{
-   out << std::setprecision(15) << "ossimSrtmSupportData data members:"
-       << "\nFile:                  " << theFile
-       << "\nLines:                 " << theNumberOfLines
-       << "\nSamples:               " << theNumberOfSamples
-       << "\nSouth West Latitude:   " << theSouthwestLatitude
-       << "\nSouth West Longitude:  " << theSouthwestLongitude
-       << "\nLatitude spacing:      " << theLatSpacing
-       << "\nLongitude spacing:     " << theLonSpacing
-       << "\nMin post value:        " << theMinPixelValue
-       << "\nMax post value:        " << theMaxPixelValue
-       << std::endl;
-   return out;
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimSupportFilesList.cpp b/ossim/src/ossim/support_data/ossimSupportFilesList.cpp
deleted file mode 100644
index 0224a1f..0000000
--- a/ossim/src/ossim/support_data/ossimSupportFilesList.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//**************************************************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Oscar Kramer
-// 
-// Description: Singleton class for logging all support data files opened during a session.
-//
-//**************************************************************************************************
-// $Id$
-
-#include <ossim/support_data/ossimSupportFilesList.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-ossimSupportFilesList* ossimSupportFilesList::m_instance = 0;
-
-//*************************************************************************************************
-// Implements singleton pattern
-//*************************************************************************************************
-ossimSupportFilesList* ossimSupportFilesList::instance()
-{
-   if (!m_instance)
-      m_instance = new ossimSupportFilesList;
-
-   return m_instance;
-}
-
-//*************************************************************************************************
-// Saves the list to a KWL
-//*************************************************************************************************
-void ossimSupportFilesList::save(ossimKeywordlist& kwl, const char* prefix) const
-{
-   ossimString baseName ("support_file");
-   for (unsigned int i=0; i< (unsigned int) m_list.size(); i++)
-   {
-      ossimString key = baseName + ossimString::toString(i);
-      kwl.add(prefix, key.chars(), m_list[i]);
-   }
-}
-
diff --git a/ossim/src/ossim/support_data/ossimTiffInfo.cpp b/ossim/src/ossim/support_data/ossimTiffInfo.cpp
deleted file mode 100644
index ce2e6c0..0000000
--- a/ossim/src/ossim/support_data/ossimTiffInfo.cpp
+++ /dev/null
@@ -1,3913 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: TIFF Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimTiffInfo.cpp 2673 2011-06-06 14:57:24Z david.burken $
-
-#include <ossim/support_data/ossimTiffInfo.h>
-
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimGeoTiffCoordTransformsLut.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTieGptSet.h>
-#include <ossim/base/ossimTrace.h>
-
-#include <ossim/projection/ossimBilinearProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimEpsgProjectionFactory.h>
-
-#include <fstream>
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-
-// Static trace for debugging
-static ossimTrace traceDebug("ossimTiffInfo:debug");
-static ossimTrace traceDump("ossimTiffInfo:dump"); // This will dump offsets.
-
-static const std::string PHOTO_INTERP[] =
-{
-   "MINISWHITE",
-   "MINISBLACK",
-   "RGB",
-   "PALETTE",
-   "MASK",
-   "SEPARATED",
-   "YCBCR",
-   "CIELAB"
-};
-
-static const std::string ANGULAR_UNITS_KW = "angular_units";
-static const std::string CENTER_LATITUDE__KW = "center_latitude";
-static const std::string CENTER_LONGITUDE_KW = "center_longitude";
-static const std::string COORD_TRANS_CODE_KW = "coord_trans_code";
-static const std::string FALSE_ORIGIN_LONGITUDE_KW = "false_origin_longitude";
-static const std::string FALSE_ORIGIN_LATITUDE_KW = "false_origin_latitude";
-static const std::string FALSE_ORIGIN_EASTING_KW = "false_origin_easting";
-static const std::string FALSE_ORIGIN_NORTHING_KW = "false_origin_northing";
-static const std::string GEODETIC_DATUM_KW = "geodetic_datum";
-static const std::string IMAGE_LENGTH_KW = "image_length";
-static const std::string IMAGE_WIDTH_KW = "image_width";
-static const std::string LINEAR_UNITS_KW = "linear_units";
-static const std::string MODEL_PIXEL_SCALE_KW = "model_pixel_scale";
-static const std::string MODEL_TIE_POINT_KW = "model_tie_point";
-static const std::string MODEL_TRANSFORM_KW = "model_transform";
-static const std::string MODEL_TYPE_KW = "model_type";
-static const std::string ORIGIN_LATITUDE_KW = "origin_latitude";
-static const std::string ORIGIN_LONGITUDE_KW = "origin_longitude";
-static const std::string RASTER_TYPE_KW = "raster_type";
-static const std::string VERTICAL_UNITS_KW = "vertical_units";
-
-
-ossimTiffInfo::ossimTiffInfo()
-   : ossimInfoBase(),
-     theFile(),
-     theEndian(0)
-{
-}
-
-ossimTiffInfo::~ossimTiffInfo()
-{
-   if (theEndian)
-   {
-      delete theEndian;
-      theEndian = 0;
-   }
-}
-
-bool ossimTiffInfo::open(const ossimFilename& file)
-{
-   bool result = false;
-
-   //---
-   // Open the tif file.
-   //---
-   std::ifstream str(file.c_str(), std::ios_base::binary|std::ios_base::in);
-   if (str.good()) 
-   {
-      //---
-      // Get the byte order.  First two byte should be "II" or "MM".
-      //---
-      char byteOrder[2];
-      str.read(byteOrder, 2); // Read the byte order.
-      ossimByteOrder sysByteOrder = ossim::byteOrder();
-      ossimByteOrder tifByteOrder = OSSIM_LITTLE_ENDIAN;
-      
-      if (byteOrder[0] == 'M')
-      {
-         tifByteOrder = OSSIM_BIG_ENDIAN;
-      }
-
-      if (sysByteOrder != tifByteOrder)
-      {
-         if (!theEndian)
-         {
-            theEndian = new ossimEndian();
-         }
-      }
-      else if (theEndian)
-      {
-         delete theEndian;
-         theEndian = 0;
-      }
-      
-      //--
-      // Get the version. Note theEndian must be set/unset before calling
-      // "readShort".
-      //---
-      ossim_uint16 version;
-      readShort(version, str);
-
-      if ( ( (byteOrder[0] == 'M') || (byteOrder[0] == 'I') ) &&
-           ( (version == 42) || (version == 43) ) )
-      {
-         result = true;  // is a tif...
-      }
-   }
-
-   if (result)
-   {
-      theFile = file;
-   }
-   else
-   {
-      theFile.clear();
-      if (theEndian)
-      {
-         delete theEndian;
-         theEndian = 0;
-      }
-   }
-
-   return result;
-}
-
-std::ostream& ossimTiffInfo::print(std::ostream& out) const
-{
-   static const char MODULE[] = "ossimTiffInfo::print";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG Entered...\n";
-   }
-
-   //---
-   // Open the tif file.
-   //---
-   std::ifstream str(theFile.c_str(), std::ios_base::binary|std::ios_base::in);
-   if (!str) 
-   {
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " Cannot open file:  " << theFile << std::endl;
-      }
-      return out;
-   }
-   
-   //---
-   // Get the byte order.  First two byte should be "II" or "MM".
-   //---
-   char byteOrder[2];
-   str.read(byteOrder, 2); // Read the byte order.
-   ossimByteOrder sysByteOrder = ossim::byteOrder();
-   ossimByteOrder tifByteOrder = OSSIM_LITTLE_ENDIAN;
-   
-   if (byteOrder[0] == 'M')
-   {
-      tifByteOrder = OSSIM_BIG_ENDIAN;
-   }
-   
-   if (sysByteOrder != tifByteOrder)
-   {
-      if (!theEndian)
-      {
-         theEndian = new ossimEndian();
-      }
-   }
-   else if (theEndian) // No swapping required.
-   {
-      delete theEndian;
-      theEndian = 0;
-   }
-
-   //--
-   // Get the version. Note theEndian must be set/unset before calling
-   // "readShort".
-   //---
-   ossim_uint16 version;
-   readShort(version, str);
-
-   // Set the tag value length.
-   ossim_uint64 tagValueLength;
-   if (version == 42)
-   {
-      tagValueLength = 4;
-   }
-   else
-   {
-      tagValueLength = 8;
-   }
-
-   out << "tiff.version: " << int(version)
-       << ((version==42)?"(classic)\n":"(big)\n")
-       << "tiff.byte_order: ";
-   
-   if (byteOrder[0] == 'M')
-   {
-      out << "big_endian\n";
-   }
-   else // OSSIM_LITTLE_ENDIAN
-   {
-      out  << "little_endian\n";
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "system_byte_order: ";
-      if (ossim::byteOrder() == OSSIM_BIG_ENDIAN)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)<< "big_endian\n";
-      }
-      else // OSSIM_LITTLE_ENDIAN
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)<< "little_endian\n";
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "tiff.tag_value_length: " << tagValueLength << "\n";
-   }
-
-   //---
-   // Variables used within the loop.
-   //---
-   std::streamoff seekOffset;      // used throughout
-   std::streampos streamPosition;  // used throughout
-
-   if (version == 43)
-   {
-      // We must skip the first four bytes.
-      ossim_uint32 offsetSize;
-      readLong(offsetSize, str);
-   }
-
-   // Get the offset.
-   if (getOffset(seekOffset, str, version) == false)
-   {
-     ossimNotify(ossimNotifyLevel_WARN) 
-        << MODULE << " FATAL ERROR - "
-        << "No offset to an image file directory found.\n"
-        << "Returning with error."
-        << std::endl;
-     str.close();
-     return out;
-   }
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG: "
-         << "Offset to first ifd:  " << seekOffset
-         << "\n";
-   }
-
-   // Capture the original flags then set float output to full precision.
-   std::ios_base::fmtflags f = out.flags();
-   out << std::setprecision(15);
-   
-   // Image File Directory (IFD) loop.
-   ossim_int32 ifdIndex = 0;
-   while(seekOffset)
-   {
-      out << "tiff.directory_offset: " << seekOffset << "\n";
-
-      // Seek to the image file directory.
-      str.seekg(seekOffset, std::ios_base::beg);  
-
-      // directory prefix for prints.
-      std::string prefix = "tiff.";
-      getDirPrefix(ifdIndex, prefix);
-
-      //---
-      // Things we need to save for printGeoKeys:
-      //---
-      ossim_uint16*  geoKeyBlock     = 0;
-      ossim_uint64   geoKeyLength    = 0;
-      ossim_float64* geoDoubleBlock  = 0;
-      ossim_uint64   geoDoubleLength = 0;
-      ossim_int8*    geoAsciiBlock   = 0;
-      ossim_uint64   geoAsciiLength  = 0;
-      
-      //---
-      // Get the number of directories within the IFD.
-      //---
-      ossim_uint64 nTags; // Number of tags in an IFD.
-      if (getValue(nTags, str, TWO_OR_EIGHT, version) == false)
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " FATAL error reading number of direcories."
-               << std::endl;
-         }
-         str.close();
-         return out;
-      }
-
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG:\n"
-            << "ifd:  " << seekOffset
-            << "\ntags in directory:  " << nTags<< "\n";
-      }
-
-      // Tag loop:
-      for (ossim_uint64 tagIdx = 0; tagIdx < nTags; ++tagIdx)
-      {
-         // Variables used within the loop.
-         ossim_uint16   tag              = 0; // Tag number
-         ossim_uint16   type             = 0; // Type(short, long...)
-         ossim_uint64   count            = 0;
-         ossim_uint64   arraySizeInBytes = 0; // 
-         ossim_uint8*   valueArray       = 0; // To hold value.
-         
-         //---
-         // Get the tag.
-         //---
-         readShort(tag, str);
-         if (!str)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " FATAL error reading tag number."
-                  << std::endl;
-            }
-            str.close();
-            return out;
-         }
-
-         //---
-         // Get the type (byte, ascii, short...)
-         //---
-         readShort(type, str);
-         if (!str)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " FATAL error reading type number."
-                  << std::endl;
-            }
-            str.close();
-            return out;
-         }
-
-         //---
-         // Get the count.  This is not in bytes.  It is based on the
-         // type.  So if the type is a short and the count is one then
-         // read "sizeof(short"(2) bytes.
-         //---
-         getValue(count, str, FOUR_OR_EIGHT, version);
-         if (!str)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " FATAL error reading count."
-                  << std::endl;
-            }
-            str.close();
-            return out;
-         }
-
-         // Get the array size in bytes.
-         arraySizeInBytes = getArraySizeInBytes(count, type);
-         if (arraySizeInBytes == 0)
-         {
-            // Could be an unhandle type.  Gobble the value.
-            eatValue(str, version);
-         }
-         else
-         {
-            // Allocate array.
-            if (valueArray) delete [] valueArray;
-            valueArray = new ossim_uint8[arraySizeInBytes];
-
-            if (arraySizeInBytes <= tagValueLength)
-            {
-               // Read in the value(s).
-               str.read((char*)valueArray, arraySizeInBytes);
-
-               // Skip any byes left in the field.
-               if (arraySizeInBytes < tagValueLength)
-               {
-                  // Skip these bytes.
-                  str.ignore(tagValueLength-arraySizeInBytes);
-               }
-            }
-            else // Data to big for field.  Stored elsewhere...
-            {
-               // Get the offset to the data.
-               getOffset(seekOffset, str, version);
-
-               // Capture the seek position to come back to.
-               streamPosition = str.tellg();
-
-               // Seek to the data.
-               str.seekg(seekOffset, std::ios_base::beg);
-
-               // Read in the value(s).
-               str.read((char*)valueArray, arraySizeInBytes);
-
-               // Seek back.
-               str.seekg(streamPosition);
-            }
-
-            // Swap the bytes if needed.
-            swapBytes(valueArray, type, count);
-         }
-
-         if( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << MODULE << " DEBUG:"
-               << "\ntag[" << tagIdx << "]:" << tag
-               << "\ntype:                " << type
-               << "\ncount:        " << count
-               << "\narray size in bytes: " << arraySizeInBytes
-               << "\n";
-	 }
-
-         if (tag == OGEO_KEY_DIRECTORY_TAG)
-         {
-            // tag 34735 save for printGeoKeys
-            if ( geoKeyBlock )
-            {
-               delete [] geoKeyBlock;
-            }
-            geoKeyBlock = reinterpret_cast<ossim_uint16*>(valueArray);
-            geoKeyLength = count;
-         }
-         else if (tag == OGEO_DOUBLE_PARAMS_TAG)
-         {
-            // tag 34736 save for printGeoKeys
-            if ( geoDoubleBlock )
-            {
-               delete [] geoDoubleBlock;
-            }
-            geoDoubleBlock  = reinterpret_cast<ossim_float64*>(valueArray);
-            geoDoubleLength = count;
-         }
-         else if (tag == OGEO_ASCII_PARAMS_TAG)
-         {
-            // tag 34737 save for printGeoKeys
-            if ( geoAsciiBlock )
-            {
-               delete [] geoAsciiBlock;
-            }
-            geoAsciiBlock   = reinterpret_cast<ossim_int8*>(valueArray);
-            geoAsciiLength  = count;
-         }
-         else
-         {
-            print(out,
-                  prefix,
-                  tagIdx,
-                  tag,
-                  type,
-                  count,
-                  arraySizeInBytes,
-                  valueArray);
-            
-            // Free memory if allocated...
-            if (valueArray)
-            {
-               delete [] valueArray;
-               valueArray = 0;
-            }
-         }
-         
-      } // End of tag loop.
-
-      //---
-      // If Geotiff Keys read them.
-      // This had to done last since the keys could
-      // have references to tags GEO_DOUBLE_PARAMS_TAG and
-      // GEO_ASCII_PARAMS_TAG.
-      //---
-      if (geoKeyBlock)
-      {
-         printGeoKeys(out, prefix, geoKeyLength, geoKeyBlock,
-                      geoDoubleLength,geoDoubleBlock,
-                      geoAsciiLength,geoAsciiBlock);
-
-         delete [] geoKeyBlock;
-         geoKeyBlock = 0;
-      }
-
-      if (geoDoubleBlock)
-      {
-         delete [] geoDoubleBlock;
-         geoDoubleBlock = 0;
-      }
-      if (geoAsciiBlock)
-      {
-         delete [] geoAsciiBlock;
-         geoAsciiBlock = 0;
-      }
-      geoKeyLength = 0;
-      geoDoubleLength = 0;
-      geoAsciiLength = 0;
-
-      //---
-      // Get the next IFD offset.  Continue this loop until the offset is
-      // zero.
-      //---
-      if (getOffset(seekOffset, str, version) == false)
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " No offset to an image file directory found.\n"
-               << "Returning with error."
-               << std::endl;
-         }
-         str.close();
-         return out;
-      }
-      
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimTiffInfo::readTags: "
-            << "Next Image File Directory(IFD) offset = "
-            << seekOffset << "\n";
-      }
-
-      ++ifdIndex; // next ifd
-
-      //---
-      // Note this does NOT check to see if sub_file_type is '1' simply
-      // skips all directories past the first if theOverviewFlag is false.
-      //---
-      if ( ifdIndex && !theOverviewFlag) // Don't process overviews...
-      {
-         break;
-      }
-      
-   } // End of loop through the IFD's.
-   
-   out << std::endl;
-    
-   str.close();
-
-   // Reset flags.
-   out.setf(f);
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG Exited..." << std::endl;
-   }
-   
-   return out;
-}
-
-std::ostream& ossimTiffInfo::print(std::istream& inStr,
-                                   std::ostream& outStr) const
-{
-   static const char MODULE[] = "ossimTiffInfo::print(std::istream&, std::ostream&)";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG Entered...\n";
-   }
-
-   std::streampos startPosition = inStr.tellg();
-   
-   //---
-   // Get the byte order.  First two byte should be "II" or "MM".
-   //---
-   char byteOrder[2];
-   inStr.read(byteOrder, 2); // Read the byte order.
-   ossimByteOrder sysByteOrder = ossim::byteOrder();
-   ossimByteOrder tifByteOrder = OSSIM_LITTLE_ENDIAN;
-   
-   if (byteOrder[0] == 'M')
-   {
-      tifByteOrder = OSSIM_BIG_ENDIAN;
-   }
-   
-   if (sysByteOrder != tifByteOrder)
-   {
-      if (!theEndian)
-      {
-         theEndian = new ossimEndian();
-      }
-   }
-   else if (theEndian) // No swapping required.
-   {
-      delete theEndian;
-      theEndian = 0;
-   }
-
-   //--
-   // Get the version. Note theEndian must be set/unset before calling
-   // "readShort".
-   //---
-   ossim_uint16 version;
-   readShort(version, inStr);
-
-   // Set the tag value length.
-   ossim_uint64 tagValueLength;
-   if (version == 42)
-   {
-      tagValueLength = 4;
-   }
-   else
-   {
-      tagValueLength = 8;
-   }
-
-   outStr << "tiff.version: " << int(version)
-          << ((version==42)?"(classic)\n":"(big)\n")
-          << "tiff.byte_order: ";
-   
-   if (byteOrder[0] == 'M')
-   {
-      outStr << "big_endian\n";
-   }
-   else // OSSIM_LITTLE_ENDIAN
-   {
-      outStr  << "little_endian\n";
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)<< "system_byte_order: ";
-      if (ossim::byteOrder() == OSSIM_BIG_ENDIAN)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)<< "big_endian\n";
-      }
-      else // OSSIM_LITTLE_ENDIAN
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)<< "little_endian\n";
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "tiff.tag_value_length: " << tagValueLength << "\n";
-   }
-
-   //---
-   // Variables used within the loop.
-   //---
-   std::streamoff seekOffset;      // used throughout
-   std::streampos streamPosition;  // used throughout
-
-   if (version == 43)
-   {
-      // We must skip the first four bytes.
-      ossim_uint32 offsetSize;
-      readLong(offsetSize, inStr);
-   }
-
-   // Get the offset.
-   if (getOffset(seekOffset, inStr, version) == false)
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN) 
-            << MODULE << " FATAL ERROR - "
-            << "No offset to an image file directory found.\n"
-            << "Returning with error."
-            << std::endl;
-      }
-      return outStr;
-   }
-   
-   if (traceDebug())
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << MODULE << " DEBUG: "
-            << "Offset to first ifd:  " << seekOffset
-            << "\n";
-      }
-   }
-
-   // Capture the original flags then set float output to full precision.
-   std::ios_base::fmtflags f = outStr.flags();
-   outStr << std::setprecision(15);
-   
-   // Image File Directory (IFD) loop.
-   ossim_int32 ifdIndex = 0;
-   while(seekOffset)
-   {
-      outStr << "tiff.directory_offset: " << seekOffset << "\n";
-
-      // Seek to the image file directory.
-      inStr.seekg(startPosition+seekOffset, std::ios_base::beg);  
-
-      // directory prefix for prints.
-      std::string prefix = "tiff.";
-      getDirPrefix(ifdIndex, prefix);
-
-      //---
-      // Things we need to save for printGeoKeys:
-      //---
-      ossim_uint16*  geoKeyBlock     = 0;
-      ossim_uint64   geoKeyLength    = 0;
-      ossim_float64* geoDoubleBlock  = 0;
-      ossim_uint64   geoDoubleLength = 0;
-      ossim_int8*    geoAsciiBlock   = 0;
-      ossim_uint64   geoAsciiLength  = 0;
-      
-      //---
-      // Get the number of directories within the IFD.
-      //---
-      ossim_uint64 nTags; // Number of tags in an IFD.
-      if (getValue(nTags, inStr, TWO_OR_EIGHT, version) == false)
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " FATAL error reading number of direcories."
-               << std::endl;
-         }
-         return outStr;
-      }
-
-      if (traceDebug())
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << MODULE << " DEBUG:\n"
-               << "ifd:  " << seekOffset
-               << "\ntags in directory:  " << nTags<< "\n";
-         }
-      }
-
-      // Tag loop:
-      for (ossim_uint64 tagIdx = 0; tagIdx < nTags; ++tagIdx)
-      {
-         // Variables used within the loop.
-         ossim_uint16   tag              = 0; // Tag number
-         ossim_uint16   type             = 0; // Type(short, long...)
-         ossim_uint64   count            = 0;
-         ossim_uint64   arraySizeInBytes = 0; // 
-         ossim_uint8*   valueArray       = 0; // To hold value.
-         
-         //---
-         // Get the tag.
-         //---
-         readShort(tag, inStr);
-         if (!inStr)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " FATAL error reading tag number."
-                  << std::endl;
-            }
-            return outStr;
-         }
-
-         //---
-         // Get the type (byte, ascii, short...)
-         //---
-         readShort(type, inStr);
-         if (!inStr)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " FATAL error reading type number."
-                  << std::endl;
-            }
-            return outStr;
-         }
-
-         //---
-         // Get the count.  This is not in bytes.  It is based on the
-         // type.  So if the type is a short and the count is one then
-         // read "sizeof(short"(2) bytes.
-         //---
-         getValue(count, inStr, FOUR_OR_EIGHT, version);
-         if (!inStr)
-         {
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << MODULE << " FATAL error reading count."
-                  << std::endl;
-            }
-            return outStr;
-         }
-
-         // Get the array size in bytes.
-         arraySizeInBytes = getArraySizeInBytes(count, type);
-         if (arraySizeInBytes == 0)
-         {
-            // Could be an unhandle type.  Gobble the value.
-            eatValue(inStr, version);
-         }
-         else
-         {
-            // Allocate array.
-            if (valueArray) delete [] valueArray;
-            valueArray = new ossim_uint8[arraySizeInBytes];
-
-            if (arraySizeInBytes <= tagValueLength)
-            {
-               // Read in the value(s).
-               inStr.read((char*)valueArray, arraySizeInBytes);
-
-               // Skip any byes left in the field.
-               if (arraySizeInBytes < tagValueLength)
-               {
-                  // Skip these bytes.
-                  inStr.ignore(tagValueLength-arraySizeInBytes);
-               }
-            }
-            else // Data to big for field.  Stored elsewhere...
-            {
-               // Get the offset to the data.
-               getOffset(seekOffset, inStr, version);
-
-               // Capture the seek position to come back to.
-               streamPosition = inStr.tellg();
-
-               // Seek to the data.
-               inStr.seekg(startPosition+seekOffset, std::ios_base::beg);
-
-               // Read in the value(s).
-               inStr.read((char*)valueArray, arraySizeInBytes);
-
-               // Seek back.
-               inStr.seekg(streamPosition);
-            }
-
-            // Swap the bytes if needed.
-            swapBytes(valueArray, type, count);
-         }
-
-         if( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << MODULE << " DEBUG:"
-               << "\ntag[" << tagIdx << "]:" << tag
-               << "\ntype:                " << type
-               << "\ncount:        " << count
-               << "\narray size in bytes: " << arraySizeInBytes
-               << "\n";
-         }
-
-         if (tag == OGEO_KEY_DIRECTORY_TAG)
-         {
-            // tag 34735 save for printGeoKeys
-            geoKeyBlock = reinterpret_cast<ossim_uint16*>(valueArray);
-            geoKeyLength = count;
-         }
-         else if (tag == OGEO_DOUBLE_PARAMS_TAG)
-         {
-            // tag 34736 save for printGeoKeys
-            geoDoubleBlock  = reinterpret_cast<ossim_float64*>(valueArray);
-            geoDoubleLength = count;
-         }
-         else if (tag == OGEO_ASCII_PARAMS_TAG)
-         {
-            // tag 34737 save for printGeoKeys
-            geoAsciiBlock   = reinterpret_cast<ossim_int8*>(valueArray);
-            geoAsciiLength  = count;
-         }
-         else
-         {
-            print(outStr,
-                  prefix,
-                  tagIdx,
-                  tag,
-                  type,
-                  count,
-                  arraySizeInBytes,
-                  valueArray);
-            
-            // Free memory if allocated...
-            if (valueArray)
-            {
-               delete [] valueArray;
-               valueArray = 0;
-            }
-         }
-         
-      } // End of tag loop.
-
-      //---
-      // If Geotiff Keys read them.
-      // This had to done last since the keys could
-      // have references to tags GEO_DOUBLE_PARAMS_TAG and
-      // GEO_ASCII_PARAMS_TAG.
-      //---
-      if (geoKeyBlock)
-      {
-         printGeoKeys(outStr, prefix, geoKeyLength, geoKeyBlock,
-                      geoDoubleLength,geoDoubleBlock,
-                      geoAsciiLength,geoAsciiBlock);
-
-         delete [] geoKeyBlock;
-         geoKeyBlock = 0;
-      }
-
-      if (geoDoubleBlock)
-      {
-         delete [] geoDoubleBlock;
-         geoDoubleBlock = 0;
-      }
-      if (geoAsciiBlock)
-      {
-         delete [] geoAsciiBlock;
-         geoAsciiBlock = 0;
-      }
-      geoKeyLength = 0;
-      geoDoubleLength = 0;
-      geoAsciiLength = 0;
-
-      //---
-      // Get the next IFD offset.  Continue this loop until the offset is
-      // zero.
-      //---
-      if (getOffset(seekOffset, inStr, version) == false)
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << MODULE << " No offset to an image file directory found.\n"
-               << "Returning with error."
-               << std::endl;
-         }
-         return outStr;
-      }
-      
-      if (traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "DEBUG ossimTiffInfo::readTags: "
-            << "Next Image File Directory(IFD) offset = "
-            << seekOffset << "\n";
-      }
-
-      ++ifdIndex; // next ifd
-
-      //---
-      // Note this does NOT check to see if sub_file_type is '1' simply
-      // skips all directories past the first if theOverviewFlag is false.
-      //---
-      if ( ifdIndex && !theOverviewFlag) // Don't process overviews...
-      {
-         break;
-      }
-      
-   } // End of loop through the IFD's.
-   
-   outStr << std::endl;
-    
-   // Reset flags.
-   outStr.setf(f);
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " DEBUG Exited..." << std::endl;
-   }
-   
-   return outStr;
-}
-
-bool ossimTiffInfo::getImageGeometry(ossimKeywordlist& geomKwl,
-                                     ossim_uint32 entryIndex) const
-{
-   static const char MODULE[] = "ossimTiffInfo::getImageGeometry #1";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << " entered...\n";
-   }
-   
-   bool result = false;
-
-   // Open the file.
-   std::ifstream str;
-   str.open(theFile.c_str(), ios::in | ios::binary);
-   
-   if ( str.is_open() )
-   {
-      result = getImageGeometry(str, geomKwl, entryIndex);
-
-      str.close();
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "geomKwl:\n"
-         << geomKwl
-         << MODULE << " exit status = " << (result?"true":"false") << "\n";
-   }
-
-   return result;
-}
-
-bool ossimTiffInfo::getImageGeometry(std::istream& inStr,
-                                     ossimKeywordlist& geomKwl,
-                                     ossim_uint32 entryIndex) const
-{
-   static const char M[] = "ossimTiffInfo::getImageGeometry #2";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-   
-   bool result = false;
-
-   // Do a print to a memory stream.
-   std::ostringstream out;
-   print(inStr, out);
-
-   // Open an input stream to pass to the keyword list.
-   std::istringstream in( out.str() );
-
-   // Since the print is in key:value format we can pass to a keyword list.
-   ossimKeywordlist gtiffKwl;
-   if ( gtiffKwl.parseStream(in) )      
-   {
-      result = getImageGeometry(gtiffKwl, geomKwl, entryIndex);
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "geomKwl:\n"
-         << geomKwl
-         << M << " exit status = " << (result?"true":"false") << "\n";
-   }
-
-   return result;
-}
-
-void ossimTiffInfo::getImageGeometry(ossim_uint64   geoKeyLength,
-                                     ossim_uint16*  geoKeyBlock,
-                                     ossim_uint64   geoDoubleLength,
-                                     ossim_float64* geoDoubleBlock,
-                                     ossim_uint64   geoAsciiLength,
-                                     ossim_int8*    geoAsciiBlock,
-                                     ossimKeywordlist& geomKwl) const
-{
-   static const char M[] = "ossimTiffInfo::getImageGeometry #3";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-
-   // Dump the geotiff keys to memory.
-   ostringstream out;
-   printGeoKeys(out, std::string("tiff.image0."),
-                geoKeyLength, geoKeyBlock,
-                geoDoubleLength,geoDoubleBlock,
-                geoAsciiLength,geoAsciiBlock);
-
-   // Open an input stream to pass to the keyword list.
-   std::istringstream in( out.str() );
-
-   // Since the print is in key:value format we can pass to a keyword list.
-   ossimKeywordlist gtiffKwl;
-   if ( gtiffKwl.parseStream(in) )
-   {
-      getImageGeometry(gtiffKwl, geomKwl, 0);
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-}
-
-// Private method:
-bool ossimTiffInfo::getImageGeometry(const ossimKeywordlist& gtiffKwl,
-                                     ossimKeywordlist& geomKwl,
-                                     ossim_uint32 entryIndex) const
-{
-   static const char M[] = "ossimTiffInfo::getImageGeometry #4";
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-   
-   //---
-   // Start with a return status of true and set to false if something bad
-   // happens.
-   //---
-   bool result = true;
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "tiffinfo dump to kwl:\n" << gtiffKwl << "\n";
-   }
-   
-   ossimString gtiffPrefix = "tiff.image";
-   gtiffPrefix += ossimString::toString(entryIndex);
-   gtiffPrefix += ".";
-   ossimString geomPrefix = "image";
-   geomPrefix += ossimString::toString(entryIndex);
-   geomPrefix += ".";
-   
-   // Get the pixel type.
-   ossimString pixelType;
-   if ( getPixelType(gtiffPrefix, gtiffKwl, pixelType) == false )
-   {
-      pixelType = "pixel_is_point"; // Not an error we'll make assumption?
-   }
-   geomKwl.add(geomPrefix.c_str(),
-               ossimKeywordNames::PIXEL_TYPE_KW,
-               pixelType.c_str());
-   
-   // Get the lines.
-   ossim_uint32 height = getLines(gtiffPrefix, gtiffKwl);
-   if (height)
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::NUMBER_LINES_KW,
-                  height);
-   }
-   else
-   {
-      result = false;
-   }
-   
-   // Get the samples.
-   ossim_uint32 width = getSamples(gtiffPrefix, gtiffKwl);
-   if (width)
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::NUMBER_SAMPLES_KW,
-                  width);
-   }
-   else
-   {
-      result = false;
-   }
-   
-   // Add the pixel type.
-   geomKwl.add(geomPrefix.c_str(),
-               ossimKeywordNames::PIXEL_TYPE_KW,
-               pixelType.c_str());
-   
-   // Set the projection type.
-   bool isGeographic = false;
-   ossimString pcsCode;
-   ossimString ossimProjectionName = "";
-   bool hasPcsCode = getPcsCode(gtiffPrefix, gtiffKwl, pcsCode);
-
-   //---
-   // The ossimEpsgProjectionFactory will not pick up the origin latitude if code is
-   // 4326 (geographic) so we use the projection name; else, the origin_latitude will
-   // always be 0.  This is so the gsd comes out correct for scale.
-   //---
-   if ( hasPcsCode && ( pcsCode != "4326" ) )
-   {
-      // Add the pcs code.
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::PCS_CODE_KW,
-                  pcsCode.c_str());
-   }
-   else
-   {
-      if ( getOssimProjectionName(gtiffPrefix, gtiffKwl, ossimProjectionName) == false )
-      {
-         ossimProjectionName = "ossimEquDistCylProjection";
-      }
-      geomKwl.add(geomPrefix.c_str(), ossimKeywordNames::TYPE_KW, ossimProjectionName);
-
-      if ( ossimProjectionName == "ossimEquDistCylProjection" )
-      {
-         isGeographic = true;
-      }
-   }
-   
-   // Get the units. 
-   ossimString units = "";
-   getUnits(gtiffPrefix, gtiffKwl, units);
-   if (units.empty() || (units.contains("unknown")))
-   {
-      // HACK: Encountered JP2 with geotiff info that did not specify units, so using projection
-      // type to discern units if none explicitly specified. (OLK 05/11)
-      if (ossimProjectionName == "ossimEquDistCylProjection")
-         units = "degrees";
-   }
-   
-   // Get the pixel scale.
-   ossimDpt scale;
-   bool hasScale = getPixelScale(gtiffPrefix, gtiffKwl, scale);
-   
-   // Get the tie point.
-   std::vector<ossim_float64> ties;
-   getTiePoint(gtiffPrefix, gtiffKwl, ties);
-
-   //---
-   // Tie count:
-   // NOTE: It takes six doubles to make one tie point ie:
-   // x,y,z,longitude,latitude,height or x,y,z,easting,northing,height
-   //--- 
-   ossim_uint32 tieCount = (ossim_uint32)ties.size()/6;
-   
-   // Get the model transform.
-   std::vector<ossim_float64> xfrm;
-   getModelTransform(gtiffPrefix, gtiffKwl, xfrm);
-   
-   bool useXfrm = false;
-   if ( xfrm.size() == 16 )
-   {
-      // Need at least 24 (which is four ties) to use bilinear.
-      if ( !hasScale && ties.size() < 24 )
-      {
-         useXfrm = true;
-      }
-   }
-   if (useXfrm)
-   {
-      std::ostringstream out;
-      out << std::setprecision(15); // To avoid truncating.
-      ossim_uint32 idx = 0;
-      for(idx =0; idx < 16; ++idx)
-      {
-         out << xfrm[idx] << " ";
-      }
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW,
-                  out.str().c_str(), true);
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW,
-                  units.c_str(), true);
-   }
-   else // Use tie points.
-   {
-      if ( hasScale && (tieCount == 1) )
-      {
-         // Shift the tile to 0,0 pixel of image if not already there.
-         ossimDpt tie;
-         tie.x = ties[3] - ties[0] * scale.x;
-         tie.y = ties[4] + ties[1] * scale.y;
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::TIE_POINT_XY_KW,
-                     tie.toString().c_str());
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::TIE_POINT_UNITS_KW,
-                     units.c_str());
-         
-         // Add the scale.
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::PIXEL_SCALE_XY_KW,
-                     scale.toString().c_str());
-         geomKwl.add(geomPrefix.c_str(),
-                     ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
-                     units.c_str());
-      }
-      else if (tieCount > 1) // four or better tie points.
-      {
-         ossimTieGptSet tieSet;
-         getTieSets(ties, width, height, tieSet);
-         
-         if(tieCount >= 4)
-         {
-            ossimRefPtr<ossimBilinearProjection> proj =
-               new ossimBilinearProjection;
-            proj->optimizeFit(tieSet);
-            proj->saveState(geomKwl, geomPrefix.c_str());
-            if(traceDebug())
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "Creating a bilinear projection\n";
-            }
-         }
-         else  // Need at least four ties.
-         {
-            result = false;
-         }
-      }
-      else
-      {
-         result = false;
-      }
-      
-   } // matches: else Use tie points block.
-   
-   ossimString tmpStr;
-   if ( getStdParallelOne(gtiffPrefix, gtiffKwl, tmpStr) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::STD_PARALLEL_1_KW,
-                  tmpStr);
-   }
-   
-   if ( getStdParallelTwo(gtiffPrefix, gtiffKwl, tmpStr) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::STD_PARALLEL_2_KW,
-                  tmpStr);
-   }
-   
-   ossimDpt eastingNorthing;
-   if ( getFalseEastingNorthing(gtiffPrefix, gtiffKwl,
-                                eastingNorthing) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::FALSE_EASTING_NORTHING_KW,
-                  eastingNorthing.toString());
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::
-                  FALSE_EASTING_NORTHING_UNITS_KW, units);
-   }
-   
-   ossim_float64 tmpDbl = ossim::nan();
-   
-   if ( getOriginLat(gtiffPrefix, gtiffKwl, tmpDbl) == false )
-   {
-      if ( isGeographic && hasScale && scale.x )
-      {
-         //---
-         // ossimEquDistCylProjection uses the origin_latitude for meters per pixel (gsd)
-         // computation.  So is not set in tiff tags, compute to achieve the proper
-         // horizontal scaling.
-         //---
-         tmpDbl = ossim::acosd(scale.y/scale.x);
-      }
-   }
-   if ( !ossim::isnan(tmpDbl) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::ORIGIN_LATITUDE_KW,
-                  tmpDbl);
-   }
-   
-   if ( getCentralMeridian(gtiffPrefix, gtiffKwl, tmpDbl) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::CENTRAL_MERIDIAN_KW,
-                  tmpDbl);
-   }
-   
-   if ( getScaleFactor(gtiffPrefix, gtiffKwl, tmpDbl) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::SCALE_FACTOR_KW,
-                  tmpDbl);
-   }
-   
-   if ( getDatumCode(gtiffPrefix, gtiffKwl, tmpStr) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  ossimKeywordNames::DATUM_KW,
-                  tmpStr.c_str());
-   }
-
-   //---
-   // Linear and vertical units not read by projection factories but added so external user could
-   // query.
-   //---
-   if ( getLinearUnits(gtiffPrefix, gtiffKwl, tmpStr) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  LINEAR_UNITS_KW.c_str(),
-                  tmpStr.c_str());
-   }
-
-   if ( getVerticalUnits(gtiffPrefix, gtiffKwl, tmpStr) )
-   {
-      geomKwl.add(geomPrefix.c_str(),
-                  VERTICAL_UNITS_KW.c_str(),
-                  tmpStr.c_str());
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "geomKwl:\n"
-         << geomKwl << "\n"
-         << M << " exit status = " << (result?"true":"false") << "\n";
-   }
-   
-   return result;
-}
-
-void ossimTiffInfo::readShort(ossim_uint16& s, std::istream& str) const
-{
-   str.read((char*)&s, sizeof(s));
-   if (theEndian)
-   {
-      theEndian->swap(s);
-   }
-}
-
-void ossimTiffInfo::readLong(ossim_uint32& l, std::istream& str) const
-{
-   str.read((char*)&l, sizeof(l));
-   if (theEndian)
-   {
-      theEndian->swap(l);
-   }
-}
-
-void ossimTiffInfo::readLongLong(ossim_uint64& l, std::istream& str) const
-{
-   str.read((char*)&l, sizeof(l));
-   if (theEndian)
-   {
-      theEndian->swap(l);
-   }
-}
-
-
-
-bool ossimTiffInfo::getOffset(
-   std::streamoff& offset, std::istream& str, ossim_uint16 version) const
-{
-   bool status = true;
-   if  (version == 42)
-   {
-      ossim_uint32   littleOffset;
-      readLong(littleOffset, str);
-      offset = littleOffset;
-   }
-   else
-   {
-      ossim_uint64 bigOffset;
-      readLongLong(bigOffset, str);
-      offset = bigOffset;
-   }
-   if (!str)
-   {
-      status = false;
-   }
-   return status;
-}
-
-bool ossimTiffInfo::getValue(ossim_uint64& value,
-                             std::istream& str,
-                             WordType type,
-                             ossim_uint16 version) const
-{
-   bool status = true;
-   if  (version == 42)
-   {
-      if (type == TWO_OR_EIGHT)
-      {
-         ossim_uint16 i;
-         readShort(i, str);
-         value = i;
-      }
-      else
-      {
-         ossim_uint32 i;
-         readLong(i, str);
-         value = i;
-      }
-   }
-   else
-   {
-      ossim_uint64 i;
-      readLongLong(i, str);
-      value = i;
-   }
-   if (!str)
-   {
-      status = false;
-   }
-   return status;
-}
-
-ossim_uint64 ossimTiffInfo::getArraySizeInBytes(ossim_uint64 length,
-                                                ossim_uint16 type) const
-{
-   return length * getTypeByteSize(type);
-}
-
-ossim_uint16 ossimTiffInfo::getTypeByteSize(ossim_uint16 type) const
-{
-   ossim_uint16 result = 0;
-   
-   switch (type)
-   {
-      case OTIFF_BYTE:
-      case OTIFF_ASCII:
-      case OTIFF_SBYTE:
-      case OTIFF_UNDEFINED:
-      {
-         result = 1;
-         break;
-      }
-         
-      case OTIFF_SHORT:
-      case OTIFF_SSHORT:
-      {
-         result = 2;
-         break;
-      }
-         
-      case OTIFF_LONG:
-      case OTIFF_SLONG:
-      case OTIFF_IFD:
-      case OTIFF_FLOAT:
-      {
-         result = 4;
-         break;
-      }
-         
-      case OTIFF_RATIONAL:
-      case OTIFF_SRATIONAL:
-      case OTIFF_DOUBLE:
-      case 16:             // TIFF_LONG8 defined in big tiff only.
-      case 17:             // TIFF_SLONG8 defined in big tiff only.
-      case 18:             // TIFF_IFD8 defined in big tiff only.
-      {
-         result = 8;
-         break;
-      }
-
-      default:
-      {
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimTiffInfo::getTypeByteSize DEBUG:"
-               << "\nUnhandled type: " << int(type) << "\n";
-         }
-         break;
-      }
-   }
-   return result;
-}
-
-void ossimTiffInfo::eatValue(std::istream& str, ossim_uint16 version) const
-{
-   if (version == 42)
-   {
-      ossim_uint32 dummy;
-      readLong(dummy, str);
-   }
-   else
-   {
-      ossim_uint64 dummy;
-      readLongLong(dummy, str);
-   }
-}
-
-void ossimTiffInfo::swapBytes(ossim_uint8* v,
-                              ossim_uint16 type,
-                              ossim_uint64 count) const
-{
-   if (theEndian)
-   {
-      ossim_uint32 byteSize = getTypeByteSize(type);
-      switch(byteSize)
-      {
-         case 2:
-            theEndian->swapTwoBytes(v, count);
-            break;
-         case 4:
-            theEndian->swapFourBytes(v, count);
-            break;
-         case 8:
-            theEndian->swapEightBytes(v, count);
-            break;
-         default:
-            break;
-      }
-   }
-}
-
-template <class T> void ossimTiffInfo::getArrayValue(
-   T& v,
-   ossim_uint8* array,
-   ossim_uint64 position) const
-{
-   T* p = (T*)array;
-   v = p[position];
-}
-
-std::ostream& ossimTiffInfo::print(std::ostream& out,
-                                   const std::string& prefix,
-                                   ossim_uint64 tagIdx,
-                                   ossim_uint16 tag,
-                                   ossim_uint16 type,
-                                   ossim_uint64 count,
-                                   ossim_uint64 arraySizeInBytes,
-                                   ossim_uint8* valueArray) const
-{
-   switch(tag)
-   {
-      case OTIFFTAG_SUBFILETYPE: // tag 254
-      {
-         out << prefix << "sub_file_type: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      case OTIFFTAG_IMAGEWIDTH: // tag 256
-      {
-         out << prefix << IMAGE_WIDTH_KW << ": ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      
-      case OTIFFTAG_IMAGELENGTH: // tag 257
-      {
-         out << prefix << IMAGE_LENGTH_KW << ": ";
-         printValue(out, type, valueArray);
-         break;
-      }
-
-      case OTIFFTAG_BITSPERSAMPLE: // tag 258
-      {
-         out << prefix << "bits_per_sample: ";
-         if (count == 1)
-         {
-            printValue(out, type, valueArray);
-         }
-         else if (valueArray)
-         {
-            printArray(out, type, count, valueArray);
-         }
-         break;
-      }
-         
-      case OTIFFTAG_COMPRESSION: // tag 259
-      {
-         if ( (count == 1) && (type == OTIFF_SHORT) )
-         {
-            out << prefix << "compression: ";
-            
-            ossim_uint16 s;
-            getArrayValue(s, valueArray, 0);
-            if (s == 1)
-            {
-               out << "false\n";
-            }
-            else
-            {
-               out << "true\n";
-            }
-         }
-         break;
-      }
-
-      case OTIFFTAG_PHOTOMETRIC: // tag 262
-      {
-         out << prefix << "photo_interpretation: ";
-
-         if ( (count == 1) && (type == OTIFF_SHORT) )
-         {
-            ossim_uint16 s;
-            getArrayValue(s, valueArray, 0);
-            if (s <= OPHOTO_CIELAB)
-            {
-               out << PHOTO_INTERP[s] << "\n";
-            }
-            else
-            {
-               out <<"range error!\n";
-            }
-         }
-         break;
-      }
-
-      case OTIFFTAG_FILLORDER: // tag 266
-      {
-         if ( (count == 1) && (type == OTIFF_SHORT) )
-         {
-            out << prefix << "fill_order: ";
-            ossim_uint16 s;
-            getArrayValue(s, valueArray, 0);
-            out << s << "\n";
-
-         }
-         break;
-      }
-
-      case OTIFFTAG_IMAGEDESCRIPTION: // tag 270
-      {
-         out << prefix << "image_description: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-
-      case OTIFFTAG_STRIPOFFSETS: // tag 273
-      {
-         if (traceDump())
-         {
-            out << prefix << "bytes_per_strip: ";
-            
-            if (count == 1)
-            {
-               printValue(out, type, valueArray);
-            }
-            else
-            {
-               printArray(out, type, count, valueArray);
-            }
-         }
-         break;
-      }
-      case OTIFFTAG_ORIENTATION: // tag 274
-      {
-         ossim_uint16 code;
-         getArrayValue(code, valueArray, 0);
-         printOrientation(out, prefix, code);
-         break;
-      }
-      
-      case OTIFFTAG_SAMPLESPERPIXEL: // tag 277
-      {
-         out << prefix << "samples_per_pixel: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-
-      case OTIFFTAG_ROWSPERSTRIP: // tag 278
-      {
-         out << prefix << "rows_per_strip: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-
-      case OTIFFTAG_STRIPBYTECOUNTS: // tag 279
-      {
-         if (traceDump())
-         {
-            out << prefix << "bytes_per_strip: ";
-            
-            if (count == 1)
-            {
-               printValue(out, type, valueArray);
-            }
-            else
-            {
-               printArray(out, type, count, valueArray);
-            }
-         }
-         break;
-      }
-      
-      case OTIFFTAG_MINSAMPLEVALUE: // tag 280
-      {
-         out << prefix << "min_sample_value: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      case OTIFFTAG_MAXSAMPLEVALUE: // tag 281
-      {
-         out << prefix << "max_sample_value: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      
-      case OTIFFTAG_XRESOLUTION: // tag 282
-      {
-         out << prefix << "xresolution: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      case OTIFFTAG_YRESOLUTION: // tag 283
-      {
-         out << prefix << "yresolution: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      
-      case OTIFFTAG_PLANARCONFIG: // tag 284
-      {
-         if ( (count == 1) && (type == OTIFF_SHORT) )
-         {
-            out << prefix << "planar_configuration: ";
-            ossim_uint16 v;
-            getArrayValue(v, valueArray, 0);
-            if (v == 1)
-            {
-               out << "single image plane\n";
-            }
-            else if (v == 2)
-            {
-               out << "separate image planes\n";
-            }
-            else
-            {
-               out << "unknown planar value!\n";
-            }
-         }
-         break;
-      }
-
-      case OTIFFTAG_RESOLUTIONUNIT: // tag 296
-      {
-         out << prefix << "resolution_units: ";
-         ossim_uint16 v;
-         getArrayValue(v, valueArray, 0);
-         if (v == 2) 
-         {
-            out << "inch\n";
-         }
-         else if (v == 3)
-         {
-            out << "cm\n";
-         }
-         else
-         {
-            out << "none\n";
-         }
-         break;
-      }
-
-      case OTIFFTAG_PAGENUMBER: // tag 297
-      {
-         if ( (count == 2) && (type == OTIFF_SHORT) )
-         {
-            out << prefix << "page_number: ";
-            ossim_uint16 s;
-            getArrayValue(s, valueArray, 0);
-            out << s << "\n";
-            out << prefix << "total_pages: ";
-            getArrayValue(s, valueArray, 1);
-            out << s << "\n";
-         }
-         break;
-      }
-      
-      case OTIFFTAG_SOFTWARE: // tag 305
-      {
-         out << prefix << "software: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-
-      case OTIFFTAG_DATETIME: // tag 306
-      {
-         out << prefix << "date_time: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-
-      case OTIFFTAG_ARTIST: // tag 315
-      {
-         out << prefix << "artist: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      
-      case OTIFFTAG_TILEWIDTH: // tag 322
-      {
-         out << prefix << "tile_width: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      case OTIFFTAG_TILELENGTH: // tag 323
-      {
-         out << prefix << "tile_length: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      case OTIFFTAG_TILEOFFSETS: // tag 324
-      {
-         if (traceDump())
-         {
-            out << prefix << "tile_offsets: ";
-            if (count == 1)
-            {
-               printValue(out, type, valueArray);
-            }
-            else
-            {
-               printArray(out, type, count, valueArray);
-            }
-         }
-         break;
-      }
-      case OTIFFTAG_TILEBYTECOUNTS: // tag 325
-      {
-         if (traceDump())
-         {
-            out << prefix << "tile_byte_counts: ";
-            if (count == 1)
-            {
-               printValue(out, type, valueArray);
-            }
-            else
-            {
-               printArray(out, type, count, valueArray);
-            }
-         }
-         break;
-      }
-      case OTIFFTAG_SUBIFD: // tag 330
-      {
-         if ( (count == 1) && (type == OTIFF_IFD8) )
-         {
-            out << prefix << "subimage_descriptor: ";
-            ossim_uint64 v;
-            getArrayValue(v, valueArray, 0);
-            out << v << "\n";
-         }
-         else
-         {
-            out << prefix << "tag 330 unhandled condition.\n";
-         }
-         break;
-      }
-      case OTIFFTAG_EXTRASAMPLES: // tag 338
-      {
-         out << prefix << "extra_samples: ";
-         ossim_uint16 v;
-         getArrayValue(v, valueArray, 0);
-         switch (v)
-         {
-            case 1:
-            {
-               out << "associated_alpha_data\n";
-               break;
-            }
-            case 2:
-            {
-               out << "unassociated_alpha_data\n";
-               break;
-            }
-            default:
-            {
-               out << "unspecified_data\n";
-               break;
-            }
-         }
-         break;
-      }
-      case OTIFFTAG_SAMPLEFORMAT: // tag 339
-      {
-         out << prefix << "sample_format: ";
-         
-         if (count == 1)
-         {
-            printValue(out, type, valueArray);
-         }
-         else if (valueArray)
-         {
-            printArray(out, type, count, valueArray);
-         }
-         for (ossim_uint64 i = 0; i < count; ++i)
-         {
-            std::ostringstream s;
-            s << "sample_format_string";
-            if (count > 1)
-            {
-               s << i;
-            }
-            out << prefix << s.str() << ": ";
-            
-            ossim_uint16 v;
-            getArrayValue(v, valueArray, i);
-            switch (v)
-            {
-               case OSAMPLEFORMAT_UINT:
-                  out << "unsigned integer data\n";
-                  break;
-               case OSAMPLEFORMAT_INT:
-                  out << "signed integer data\n";
-                  break;
-               case OSAMPLEFORMAT_IEEEFP:
-                  out << "IEEE floating point data\n";
-                  break;
-               case OSAMPLEFORMAT_COMPLEXINT:
-                  out << "complex signed int\n";
-                  break;
-               case OSAMPLEFORMAT_COMPLEXIEEEFP:
-                  out << "complex ieee floating\n";
-                  break;
-               case OSAMPLEFORMAT_VOID:
-               default:
-                  out << "untyped data\n";
-                  break;
-            }
-         }
-         break;
-      }
-      case OTIFFTAG_SMINSAMPLEVALUE: // tag 340
-      {
-         out << prefix << "smin_sample_value: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      case OTIFFTAG_SMAXSAMPLEVALUE: // tag 341
-      {
-         out << prefix << "smax_sample_value: ";
-         printValue(out, type, valueArray);
-         break;
-      }
-      case OTIFFTAG_COPYRIGHT: // tag 33432
-      {
-         out << prefix << "copyright: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      case OMODEL_PIXEL_SCALE_TAG: // tag 33550
-      {
-         out << prefix << MODEL_PIXEL_SCALE_KW << ": ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      case OMODEL_TIE_POINT_TAG: // tag 33992
-      {
-         out << prefix << MODEL_TIE_POINT_KW << ": ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      case OMODEL_TRANSFORM_TAG: // tag 34264
-      {
-         out << prefix << MODEL_TRANSFORM_KW << ": ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      case OTIFFTAG_PHOTOSHOP:  // tag 34377
-      {
-         out << prefix << "photoshop_image_resource_blocks: found\n";
-         break;
-      }
-      case OGEO_DOUBLE_PARAMS_TAG: // tag 34736
-      {
-         out << prefix << "double_params: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      case OGEO_ASCII_PARAMS_TAG: // tag 34737
-      {
-         out << prefix << "ascii_params: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      case OGDAL_METADATA_TAG: // tag  42112
-      {
-         printGdalMetadata(out, prefix, count, valueArray);
-         break;
-      }
-      case OGDAL_NODATA: // tag 42113
-      {
-         out << prefix << "gdal_nodata: ";
-         printArray(out, type, count, valueArray);
-         break;
-      }
-      default:
-      {
-         out << prefix << "unhandled_tag: " << tag << "\n";
-         if (traceDebug())
-         {
-             ossimNotify(ossimNotifyLevel_DEBUG)
-                << "generic:"
-                << "\ntag[" << tagIdx << "]:         " << tag
-                << "\ntype:                " << type
-                << "\ncount:        " << count
-                << "\narray size in bytes: " << arraySizeInBytes
-                << "\n";
-            printArray(out, type, count, valueArray);
-         }
-         break;
-      }
-
-   } // end of switch on tag...
-
-   return out;
-
-} // end of print
-
-std::ostream& ossimTiffInfo::printValue(std::ostream& out,
-                                        ossim_uint16 type,
-                                        ossim_uint8* valueArray) const
-{
-   switch (type)
-   {
-      case OTIFF_BYTE:
-      {
-         ossim_uint8 v;
-         getArrayValue(v, valueArray, 0);
-         out << (ossim_uint16)v << "\n";
-         break;
-      }
-      case OTIFF_SHORT:
-      {
-         ossim_uint16 v;
-         getArrayValue(v, valueArray, 0);
-         out << v << "\n";
-         break;
-      }
-      case OTIFF_SSHORT:
-      {
-         ossim_sint16 v;
-         getArrayValue(v, valueArray, 0);
-         out << v << "\n";
-         break;
-      }
-      case OTIFF_LONG:
-      {
-         ossim_uint32 v;
-         getArrayValue(v, valueArray, 0);
-         out << v << "\n";
-         break;
-      }
-      case OTIFF_RATIONAL: // two longs first=numerator, second=denominator
-      {
-         ossim_uint32 num;
-         ossim_uint32 den;
-         
-         getArrayValue(num, valueArray, 0);
-         getArrayValue(den, valueArray, 1);
-
-         if ( den )
-         {
-            out << (num/den) << "\n";
-         }
-         else
-         {
-            out << num << " / " << den << "\n";
-         }
-         
-         break;
-         
-      }
-      case OTIFF_SLONG:
-      {
-         ossim_sint32 v;
-         getArrayValue(v, valueArray, 0);
-         out << v << "\n";
-         break;
-      }
-      case OTIFF_FLOAT:
-      {
-         ossim_float32 v;
-         getArrayValue(v, valueArray, 0);
-         out << v << "\n";
-         break;
-      }
-      case OTIFF_DOUBLE:
-      {
-         ossim_float64 v;
-         getArrayValue(v, valueArray, 0);
-         out << v << "\n";
-         break;
-      }
-      default:
-      {
-         out << "print_value_unhandled type: " << type << "\n";
-         break;
-      }
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printArray(std::ostream& out,
-                                        ossim_uint16 type,
-                                        ossim_uint64 arraySizeInBytes,
-                                        ossim_uint8* valueArray) const
-{
-   if (valueArray)
-   {
-      switch (type)
-      {
-         case OTIFF_BYTE:
-         {
-            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
-            {
-               out << ((ossim_uint8)valueArray[i]);
-            }
-            out << "\n";
-            break;
-         }
-         case OTIFF_ASCII:
-         {
-            //---
-            // Add tripple quotes front and back for ossimKeywordlist to handle multi-line
-            // comments.
-            //---
-            out << "\"\"\"";
-            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
-            {
-               //---
-               // Test to avoid putting nulls in the ascii string out.  Added to fix
-               // ossimKeywordlist::parseStream returning false on trailing null Where array was
-               // tagged as 11 bytes and ascii string was OrthoVista(10 bytes) and 11 byte was
-               // ascii NUL '\0'.
-               //---
-               if ( valueArray[i] != 0 )
-               {
-                  out << ((char)valueArray[i]);
-               }
-            }
-            out << "\"\"\"\n";
-            break;
-         }
-         case OTIFF_SHORT:
-         {
-            ossim_uint16* p = (ossim_uint16*)valueArray;
-            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
-            {
-               out << p[i] << " ";
-            }
-            out << "\n";
-            break;
-         }
-         case OTIFF_LONG:
-         {
-            ossim_uint32* p = (ossim_uint32*)valueArray;
-            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
-            {
-               out << p[i] << " ";
-            }
-            out << "\n";
-            break;
-         }
-         case OTIFF_DOUBLE:
-         {
-            ossim_float64* p = (ossim_float64*)valueArray;
-            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
-            {
-               out << p[i] << " ";
-            }
-            out << "\n";
-            break;
-         }
-         default:
-         {
-            out << "print_array_unhandled type: " << type << "\n";
-            break;
-         }
-      }
-   }
-   else
-   {
-      out << "null array passed to ossimTiffInfo::printArray method." << "\n";
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printGdalMetadata(std::ostream& out,
-                                               const std::string& prefix,
-                                               ossim_uint64 count,
-                                               ossim_uint8* valueArray) const
-{
-   ossimString xmlString(valueArray, valueArray+count);
-   ossimRefPtr<ossimXmlNode> xmlNode = new ossimXmlNode();
-   std::istringstream in(xmlString);
-   if(xmlNode->read(in))
-   {
-      const ossimXmlNode::ChildListType& children = xmlNode->getChildNodes();
-      
-      ossim_uint32 idx = 0;
-      for(idx = 0; idx < children.size(); ++idx)
-      {
-         out << prefix << "gdalmetadata."
-             << ossimString(children[idx]->getAttributeValue("name")).downcase()
-             << ":" << children[idx]->getText() << std::endl;
-      }
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printGeoKeys(
-   std::ostream& out,
-   const std::string&  prefix,
-   ossim_uint64   geoKeyLength,
-   ossim_uint16*  geoKeyBlock,
-   ossim_uint64   geoDoubleLength,
-   ossim_float64* geoDoubleBlock,
-   ossim_uint64   geoAsciiLength,
-   ossim_int8*    geoAsciiBlock) const
-{
-   if (geoKeyLength && geoKeyBlock)
-   {
-      //---
-      // Length passed in is the total number of shorts in the geo key
-      // directory.  Each key has four short values; hence, "length/4".
-      //---
-      ossim_int32 index = 0;
-      ossim_int32 tagCount = static_cast<ossim_int32>(geoKeyLength/4);
-      for (ossim_int32 i = 0; i < tagCount; ++i)
-      {
-         //---
-         // Each key contains four unsigned shorts:
-         // GeoKey ID
-         // TIFF Tag ID or 0
-         // GeoKey value count
-         // value or tag offset
-         //---
-         ossim_uint16 key   = geoKeyBlock[index++];
-         ossim_uint16 tag   = geoKeyBlock[index++];
-         ossim_uint16 count = geoKeyBlock[index++];
-         ossim_uint16 code  = geoKeyBlock[index++];
-
-         if (traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "DEBUG  ossimTiffInfo::printGeoKeys"
-               << "\nKey index:  " << i
-               << "\ngeo key:  " << key
-               << "\ntag:      " << tag
-               << "\ncount:    " << count
-               << "\ncode:     " << code
-               << "\n";
-         }
-
-         //---
-         // NOTE: Add tripple quotes front and back of ascii blocks for
-         // ossimKeywordlist to handle multi-line comments.
-         //---
-         
-         switch (key)
-         {
-            case OGT_MODEL_TYPE_GEO_KEY:  // key 1024 Section 6.3.1.1 Codes
-            {
-               printModelType(out, prefix, code);
-               break;
-            }               
-            case OGT_RASTER_TYPE_GEO_KEY:  // key 1025 Section 6.3.1.2 Code
-            {
-               printRasterType(out, prefix, code);
-               break;
-            }
-
-            case OGT_CITATION_GEO_KEY: // key 1026
-            {
-               if (tag == 34737) // using ascii array
-               {
-                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
-                  {
-                     std::string s;
-                     int i = 0;
-                     while (i < count)
-                     {
-                        s.push_back(geoAsciiBlock[code+i]);
-                        ++i;
-                     }
-                     out << prefix << "citation: \"\"\"" << s << "\"\"\"\n";
-                  }
-               }
-               break;
-            }
-
-            case OGEOGRAPHIC_TYPE_GEO_KEY:  // key 2048  Section 6.3.2.1 Codes
-            {
-               out << prefix << ossimKeywordNames::GCS_CODE_KW << ": "
-                   << code << "\n";
-               break;
-            }
-
-            case OGEOG_CITATION_GEO_KEY: // key 2049
-            {
-               if (tag == 34737) // using ascii array
-               {
-                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
-                  {
-                     std::string s;
-                     int i = 0;
-                     while (i < count)
-                     {
-                        s.push_back(geoAsciiBlock[code+i]);
-                        ++i;
-                     }
-                     out << prefix << "geographic_citation: \"\"\"" << s << "\"\"\"\n";
-                  }
-               }
-               break;
-            }
-
-            case OGEOG_GEODETIC_DATUM_GEO_KEY:// key 2050 Section 6.3.2.2 Codes
-            {
-               out << prefix << GEODETIC_DATUM_KW << ": " << code << "\n";
-               break;
-            }
-
-            case OGEOG_PRIME_MERIDIAN_GEOKEY:// key 2051 Section 6.3.2.4 Codes
-            {
-               out << prefix << "prime_meridian_code: " << code << "\n";
-               break;
-            }
-            
-            case OGEOG_LINEAR_UNITS_GEO_KEY:// key 2052  Section 6.3.1.3 Codes
-            {
-               out << prefix << "linear_units_code: " << code << "\n";
-               printLinearUnits(out, prefix, LINEAR_UNITS_KW, code);
-               break;
-            }
-            
-            case OGEOG_ANGULAR_UNITS_GEO_KEY:// key 2054  Section 6.3.1.4 Codes
-            {
-               out << prefix << "angular_units_code: " << code << "\n";
-               printAngularUnits(out, prefix, code);
-               break;
-            }
-
-            case OGEOG_ANGULAR_UNIT_SIZE_GEO_KEY:// key 2055 Size in radians Section 6.2.2
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && (code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "angular_units_size_radians: "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-            
-            case OGEOG_ELLIPSOID_GEO_KEY:// key 2056  Section 6.3.23 Codes
-            {
-               out << prefix << "ellipsoid_code: " << code << "\n";
-               break;
-            }
-            
-            case OGEOG_SEMI_MAJOR_AXIS: // key 2057
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && (code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "semi_major_axis: " << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-            
-            case OGEOG_SEMI_MINOR_AXIS: // key 2058
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "semi_minor_axis: "  << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OGEOG_INV_FLATTENING_GEO_KEY: // key 2059 ratio Section 6.2.2
-            {
-               if (tag == 34736) // using double array
-               {  
-                  // Code is index into array.
-                  if ( geoDoubleBlock && (code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "inverse_flattening_ratio: " << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OGEOG_PRIME_MERIDIAN_LONG_GEO_KEY: // key 2061 GeogAngularUnit Section 6.2.2
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && (code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "prime_meridian_longitude: " << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OPROJECTED_CS_TYPE_GEO_KEY: // key 3072 Section 6.3.3.1 codes
-            {
-               out << prefix << "pcs_code: " << code << "\n";
-               break;
-            }
-
-            case OPCS_CITATION_GEO_KEY: // key 3073 ascii
-            {
-               if (tag == 34737) // using ascii array
-               {
-                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
-                  {
-                     std::string s;
-                     int i = 0;
-                     while (i < count)
-                     {
-                        s.push_back(geoAsciiBlock[code+i]);
-                        ++i;
-                     }
-                     out << prefix << "pcs_citation: \"\"\"" << s << "\"\"\"\n";
-                  }
-               }
-               
-               break;
-            }
-      
-            case OPROJECTION_GEO_KEY: // key 3074 Section 6.3.3.2 codes
-            {
-               out << prefix << "proj_code: " << code << "\n";
-               break;
-            }
-            
-            case OPROJ_COORD_TRANS_GEO_KEY:  // key 3075 Section 6.3.3.3 codes
-            {
-               out << prefix << COORD_TRANS_CODE_KW << ": " << code << "\n";
-               printCoordTrans(out, prefix, code);
-               break;
-            }
-         
-            case OPROJ_LINEAR_UNITS_GEO_KEY:  // key 3076 Section 6.3.1.3 codes
-            {
-               out << prefix << "linear_units_code: " << code << "\n";
-               printLinearUnits(out, prefix, std::string("linear_units"), code);
-               break;
-            }
-
-            case OPROJ_LINEAR_UNIT_SIZE_GEO_KEY:  // key 3077 meters Section 6.2.3
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "linear_units_size: " << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OPROJ_STD_PARALLEL1_GEO_KEY:  // key 3078
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && (code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         << ossimKeywordNames::STD_PARALLEL_1_KW << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-         
-            case OPROJ_STD_PARALLEL2_GEO_KEY:  // key 3079
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         << ossimKeywordNames::STD_PARALLEL_2_KW << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-         
-            case OPROJ_NAT_ORIGIN_LONG_GEO_KEY:  // key 3080
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << ORIGIN_LONGITUDE_KW << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-               
-            case OPROJ_NAT_ORIGIN_LAT_GEO_KEY:  // key 3081
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << ORIGIN_LATITUDE_KW << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OPROJ_FALSE_EASTING_GEO_KEY:  // key 3082
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         << ossimKeywordNames::FALSE_EASTING_KW<< ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OPROJ_FALSE_NORTHING_GEO_KEY:  // key 3083
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         << ossimKeywordNames::FALSE_NORTHING_KW
-                         << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-            
-            case OPROJ_FALSE_ORIGIN_LONG_GEO_KEY:  // key 3084
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         << FALSE_ORIGIN_LONGITUDE_KW << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-            
-            case OPROJ_FALSE_ORIGIN_LAT_GEO_KEY:  // key 3085
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         << FALSE_ORIGIN_LATITUDE_KW << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-            
-            case OPROJ_FALSE_ORIGIN_EASTING_GEO_KEY:  // key 3086
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         <<  FALSE_ORIGIN_EASTING_KW<< ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-            
-            case OPROJ_FALSE_ORIGIN_NORTHING_GEO_KEY:  // key 3087
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix
-                         <<  FALSE_ORIGIN_NORTHING_KW<< ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-           
-            case OPROJ_CENTER_LONG_GEO_KEY:  // key 3088
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "center_longitude: "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OPROJ_CENTER_LAT_GEO_KEY:  // key 3089
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << "center_latitude: "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OPROJ_SCALE_AT_NAT_ORIGIN_GEO_KEY:  // key 3092
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << ossimKeywordNames::SCALE_FACTOR_KW
-                         << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-            case OPROJ_SCALE_AT_CENTER_GEO_KEY:  // key 3093
-            {
-               if (tag == 34736) // using double array
-               {
-                  // Code is index into array.
-                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
-                  {
-                     // Always count of one.
-                     out << prefix << ossimKeywordNames::SCALE_FACTOR_KW
-                         << ": "
-                         << geoDoubleBlock[code] << "\n";
-                  }
-               }
-               break;
-            }
-
-            case OVERTICAL_CITATION_GEO_KEY: // key 4097
-            {               
-               if (tag == 34737) // using ascii array
-               {
-                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
-                  {
-                     std::string s;
-                     int i = 0;
-                     while (i < count)
-                     {
-                        s.push_back(geoAsciiBlock[code+i]);
-                        ++i;
-                     }
-                     out << prefix << "vertical_citation: \"\"\"" << s << "\"\"\"\n";
-                  }
-               }
-               break;
-            }
-
-            case OVERTICAL_UNITS_GEO_KEY: // key 4099  Section 6.3.1.3 Codes
-            {
-               out << prefix << "vertical_units_code: " << code << "\n";
-               printLinearUnits(out, prefix, VERTICAL_UNITS_KW, code);
-               break;
-            }
- 
-            default:
-            {
-               if (key > 1)
-               {
-                  if (tag == 34737) // using ascii array
-                  {
-                     if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
-                     {
-                        std::string s;
-                        int i = 0;
-                        while (i < count)
-                        {
-                           s.push_back(geoAsciiBlock[code+i]);
-                           ++i;
-                        }
-                        out << prefix << "key_" << key << ": \"\"\"" << s << "\"\"\"\n";
-                     }
-                  }
-                  else
-                  {
-                     out << prefix << "unhandle_key: " << key << "\n";
-                  }
-               }
-               break;
-            }
-            
-         } // matches: switch(key)
-
-      } //  for (ossim_int32 i = 0; i < tagCount; ++i)
-      
-      if (traceDebug())
-      {
-         if (geoAsciiBlock && geoAsciiLength)
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "ossimTiffInfo::printGeoKeys DEBUG: geo ascii block: ";
-            std::string s(geoAsciiBlock, static_cast<std::string::size_type>(geoAsciiLength));
-            ossimNotify(ossimNotifyLevel_DEBUG)<< s << "\n";
-         }
-      } 
-      
-   } // if (geoKeyLength && geoKeyBlock)
-   
-   return out;
-}
-
-
-std::ostream& ossimTiffInfo::printModelType(std::ostream& out,
-                                            const std::string& prefix,
-                                            ossim_uint16 code) const
-{
-   // key 1024 Section 6.3.1.1 Codes
-   out << prefix << MODEL_TYPE_KW << ": ";
-   if (code == 1)
-   {
-      out << "projected\n";
-   }
-   else if (code == 2)
-   {
-      out << "geographic\n";
-   }
-   else if (code == 2)
-   {
-      out << "geocentric\n";
-   }
-   else
-   {
-      out << "unknown\n";
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printRasterType(std::ostream& out,
-                                             const std::string& prefix,
-                                             ossim_uint16 code) const
-{
-   // key 1025 Section 6.3.1.2 Codes
-   out << prefix << RASTER_TYPE_KW << ": ";
-   if (code == 1)
-   {
-      out << "pixel_is_area\n";
-   }
-   else if (code == 2)
-   {
-      out << "pixel_is_point\n";
-   }
-   else
-   {
-      out << "unknown\n";
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printAngularUnits(std::ostream& out,
-                                               const std::string& prefix,
-                                               ossim_uint16 code) const
-{
-   // key 2054 Section 6.3.1.4 Codes
-   out << prefix << ANGULAR_UNITS_KW << ": ";
-   switch (code)
-   {
-      case 9101:
-      {
-         out << "radians\n";
-         break;
-      }
-      case 9102:
-      {
-         out << "degrees\n";
-         break;
-      }
-      case 9103:
-      {
-         out << "arc_minutes\n";
-         break;
-      }
-      case 9104:
-      {
-         out << "arc_seconds\n";
-         break;
-      }
-      case 9105:
-      {
-         out << "grad\n";
-         break;
-      }
-      case 9106:
-      {
-         out << "gon\n";
-         break;
-      }
-      case 9107:
-      {
-         out << "dms\n";
-         break;
-      }
-      case 9108:
-      {
-         out << "dms_hemisphere\n";
-         break;
-      }
-      default:
-      {
-         out << "unknown\n";
-         break;
-      }
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printCoordTrans(std::ostream& out,
-                                             const std::string& prefix,
-                                             ossim_uint16 code) const
-{
-   // key 3075 Section 6.3.3.3 Codes
-   out << prefix << "coord_trans: ";
-   switch (code)
-   {
-      case 1:
-      {
-         out << "TransverseMercator\n";
-         break;
-      }
-      case 2:
-      {
-         out << "TransvMercator_Modified_Alaska\n";
-         break;
-      }
-      case 3:
-      {
-         out << "ObliqueMercator\n";
-         break;
-      }
-      case 4:
-      {
-         out << "ObliqueMercator_Laborde\n";
-         break;
-      }
-      case 5:
-      {
-         out << "ObliqueMercator_Rosenmund\n";
-         break;
-      }
-      case 6:
-      {
-         out << "ObliqueMercator_Spherical\n";
-         break;
-      }
-      case 7:
-      {
-         out << "Mercator\n";
-         break;
-      }
-      case 8:
-      {
-         out << "LambertConfConic_2SP\n";
-         break;
-      }
-      case 9:
-      {
-         out << "LambertConfConic_Helmert\n";
-         break;
-      }
-      case 10:
-      {
-         out << "LambertAzimEqualArea\n";
-         break;
-      }
-      case 11:
-      {
-         out << "AlbersEqualArea\n";
-         break;
-      }
-      case 12:
-      {
-         out << "AzimuthalEquidistant\n";
-         break;
-      }
-      case 13:
-      {
-         out << "EquidistantConic\n";
-         break;
-      }
-      case 14:
-      {
-         out << "Stereographic\n";
-         break;
-      }
-      case 15:
-      {
-         out << "PolarStereographic\n";
-         break;
-      }
-      case 16:
-      {
-         out << "ObliqueStereographic\n";
-         break;
-      }
-      case 17:
-      {
-         out << "Equirectangular\n";
-         break;
-      }
-      case 18:
-      {
-         out << "CassiniSoldner\n";
-         break;
-      }
-      case 19:
-      {
-         out << "Gnomonic\n";
-         break;
-      }
-      case 20:
-      {
-         out << "MillerCylindrical\n";
-         break;
-      }
-      case 21:
-      {
-         out << "Orthographic\n";
-         break;
-      }
-      case 22:
-      {
-         out << "Polyconic\n";
-         break;
-      }
-      case 23:
-      {
-         out << "Robinson\n";
-         break;
-      }
-      case 24:
-      {
-         out << "Sinusoidal\n";
-         break;
-      }
-      case 25:
-      {
-         out << "VanDerGrinten\n";
-         break;
-      }
-      case 26:
-      {
-         out << "NewZealandMapGrid\n";
-         break;
-      }
-      case 27:
-      {
-         out << "TransvMercator_SouthOriented\n";
-         break;
-      }
-      default:
-      {
-         out << code << " unknown\n";
-         break;
-      }
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printLinearUnits(std::ostream& out,
-                                              const std::string& prefix,
-                                              const std::string& key,
-                                              ossim_uint16 code) const
-{
-   // key 3076 Section 6.3.1.3 Codes
-   out << prefix << key << ": ";
-   switch (code)
-   {
-      case 9001:
-      {
-         out << "meters\n";
-         break;
-      }
-      case 9002:
-      {
-         out << "feet\n";
-         break;
-      }
-      case 9003:
-      {
-         out << "us_survey_feet\n";
-         break;
-      }
-      case 9004:
-      {
-         out << "foot_modified_american\n";
-         break;
-      }
-      case 9005:
-      {
-         out << "foot_clarke\n";
-         break;
-      }
-      case 9006:
-      {
-         out << "foot_indian\n";
-         break;
-      }
-      case 9007:
-      {
-         out << "link\n";
-         break;
-      }
-      case 9008:
-      {
-         out << "link_benoit\n";
-         break;
-      }
-      case 9009:
-      {
-         out << "link_sears\n";
-         break;
-      }
-      case 9010:
-      {
-         out << "chain_benoit\n";
-         break;
-      }
-      case 9011:
-      {
-         out << "chain_sears\n";
-         break;
-      }
-      case 9012:
-      {
-         out << "yard_sears\n";
-         break;
-      }
-      case 9013:
-      {
-         out << "yard_indian\n";
-         break;
-      }
-      case 9014:
-      {
-         out << "fathom\n";
-         break;
-      }
-      case 9015:
-      {
-         out << "mile_international_nautical\n";
-         break;
-      }
-      default:
-      {
-         out << code << " unknown\n";
-         break;
-      }
-   }
-   return out;
-}
-
-std::ostream& ossimTiffInfo::printOrientation(std::ostream& out,
-                                              const std::string& prefix,
-                                              ossim_uint16 code) const
-{
-   // Tag 274:
-   out << prefix << "orientation: ";
-   switch (code)
-   {
-      case 1:
-      {
-         out << "top_left\n";
-         break;
-      }
-      case 2:
-      {
-         out << "top_right\n";
-         break;
-      }
-      case 3:
-      {
-         out << "bottom_right\n";
-         break;
-      }
-      case 4:
-      {
-         out << "bottom_left\n";
-         break;
-      }
-      case 5:
-      {
-         out << "left_top\n";
-         break;
-      }
-      case 6:
-      {
-         out << "right_top\n";
-         break;
-      }
-      case 7:
-      {
-         out << "right_bottom\n";
-         break;
-      }
-      case 8:
-      {
-         out << "left_bottom\n";
-         break;
-      }
-      default:
-      {
-         out << code << " unknown\n";
-         break;
-      }
-   }
-   return out;
-}
-
-void ossimTiffInfo::getDirPrefix(ossim_int32 index,
-                                 std::string& prefix) const
-{
-   prefix += "image";
-   std::ostringstream s;
-   s << index;
-   prefix += s.str();
-   prefix += ".";
-}
-
-bool ossimTiffInfo::getPixelScale(const ossimString& gtiffPrefix,
-                                  const ossimKeywordlist& gtiffKwl,
-                                  ossimDpt& scale) const
-{
-   bool result = false;
-
-   std::vector<ossim_float64> floats;
-   if ( getFloats(gtiffPrefix, MODEL_PIXEL_SCALE_KW, gtiffKwl, floats) )
-   {
-      if ( floats.size() == 3 )
-      {
-         scale.x = floats[0];
-         scale.y = floats[1];
-         result = true;
-      }
-   }
-
-   return result;
-}
-
-bool ossimTiffInfo::getTiePoint(const ossimString& gtiffPrefix,
-                                const ossimKeywordlist& gtiffKwl,
-                                std::vector<ossim_float64>& ties) const
-{
-   return getFloats(gtiffPrefix, MODEL_TIE_POINT_KW, gtiffKwl, ties);
-}
-
-bool ossimTiffInfo::getModelTransform(const ossimString& gtiffPrefix,
-                                      const ossimKeywordlist& gtiffKwl,
-                                      std::vector<ossim_float64>& xfrm) const
-{
-   return getFloats(gtiffPrefix, MODEL_TRANSFORM_KW, gtiffKwl, xfrm);
-}
-
-bool ossimTiffInfo::getFloats(const ossimString& gtiffPrefix,
-                              const ossimString& key,
-                              const ossimKeywordlist& gtiffKwl,
-                              std::vector<ossim_float64>& floats) const
-{
-   bool result = false;
-   
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), key.c_str());
-   if ( lookup )
-   {
-      ossimString line = lookup;
-      result  = getFloats(line, floats);
-   }
-
-   return result; 
-}
-
-bool ossimTiffInfo::getFloats(const ossimString& line,
-                              std::vector<ossim_float64>& floats) const
-{
-   bool result = false;
-   
-   floats.clear();
-   
-   if (line.size())
-   {
-      ossim_float64 f;
-      std::istringstream is(line);
-
-      is >> f; // Get the first double.
-      while ( ! is.fail() )
-      {
-         floats.push_back(f);
-         is >> f;
-      }
-   }
-
-   if ( floats.size() )
-   {
-      result = true;
-   }
-
-   return result;
-}
-
-bool ossimTiffInfo::getDatumCode(const ossimString& gtiffPrefix,
-                                 const ossimKeywordlist& gtiffKwl,
-                                 ossimString& datumCode) const
-{
-   bool result = false;
-   
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), GEODETIC_DATUM_KW.c_str());
-
-   // There is some ambiguity in the definition of EPSG GCS code. Here both the datum code (6000-
-   // series) and projection code (4000-series) are tested to get to the datum's native ascii code:
-
-   // Look for GEODETIC_DATUM_KW code first:
-   if (lookup)
-   {
-      ossim_int32 code = ossimString(lookup).toInt32();
-      result = getDatumCode( code, datumCode );
-   }
-
-   if ( !result )
-   {
-      // Try GCS_CODE_KW:
-      lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::GCS_CODE_KW);
-      if ( lookup )
-      {
-         ossim_int32 code = ossimString(lookup).toInt32();
-         result = getDatumCode( code, datumCode );
-      }
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getDatumCode(ossim_int32 code, ossimString& datumCode) const
-{
-   bool result = false;
-   datumCode.clear();
-   switch(code)
-   {
-      case 4267:
-      case 6267:   
-      {
-         datumCode = "NAS-C";
-         break;
-      }
-      case 4269:
-      case 6269:
-      {
-         datumCode = "NAR-C";
-         break;
-      }
-      case 4322:
-      case 6322:
-      {
-         datumCode = "WGD";
-         break;
-      }
-      case 4326:
-      case 6326:
-      {
-         datumCode = "WGE";
-         break;
-      }
-      
-   } // matches: switch(code)
-
-   if ( datumCode.size() )
-   {
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getPcsCode(const ossimString& gtiffPrefix,
-                               const ossimKeywordlist& gtiffKwl,
-                               ossimString& pcsCode) const
-{
-   bool result = false;
-
-   // Check for key "pcs_code":
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::PCS_CODE_KW);
-   if (lookup)
-   {
-      pcsCode = lookup;
-      
-      ossim_uint32 code = pcsCode.toUInt32();
-      if ( code != 32767 )
-      {
-         // See if we handle this code in our projection factories.
-         ossimRefPtr<ossimProjection>  proj = 
-            ossimEpsgProjectionFactory::instance()->createProjection(pcsCode);
-         if (proj.valid())
-         {
-            proj = 0;
-            result = true;
-         }
-      }
-      
-   }
-
-   if (result == false)
-   {
-      // Check for key "pcs_citation":
-      lookup = gtiffKwl.find(gtiffPrefix.c_str(), "pcs_citation");
-      if ( lookup )
-      {
-         ossimString spec = lookup;
-
-         // Strip commonly found or bar '|' from end if present.
-         spec.trim(ossimString("|"));
-
-         // See if we handle this code in our projection factories.
-         ossimRefPtr<ossimProjection>  proj =
-            ossimEpsgProjectionFactory::instance()->createProjection(spec);
-         if (proj.valid())
-         {
-            ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(proj.get());
-            if ( mapProj )
-            {
-               ossim_uint32 intCode = mapProj->getPcsCode();
-               if ( intCode != 32767 )
-               {
-                  proj = 0;
-                  pcsCode = ossimString::toString(intCode);
-                  result = true;
-               }
-            }
-         }
-      }
-   }
-
-   return result;
-}
-
-bool ossimTiffInfo::getUnits(const ossimString& gtiffPrefix,
-                             const ossimKeywordlist& gtiffKwl,
-                             ossimString& units) const
-{
-   bool result = true;
-   
-   ossimString linearUnits = "";
-   getLinearUnits(gtiffPrefix, gtiffKwl, linearUnits);
-   
-   ossimString angularUnits = "";
-   getAngularUnits(gtiffPrefix, gtiffKwl, angularUnits);
-
-   ossimString modelType;
-   getModelType(gtiffPrefix, gtiffKwl, modelType);
-   
-   if (modelType == "geographic")
-   {
-      if (angularUnits.size())
-      {
-         units = angularUnits;
-      }
-      else
-      {
-         units = "degrees";
-      }
-   }
-   else if (modelType == "projected")
-   {
-      if (linearUnits.size())
-      {
-         units = linearUnits;
-      }
-      else
-      {
-         units = "meters";
-      }
-   }
-   else
-   {
-      units = "meters";
-   }
-
-   return result;
-}
-
-
-bool ossimTiffInfo::getLinearUnits(const ossimString& gtiffPrefix,
-                                   const ossimKeywordlist& gtiffKwl,
-                                   ossimString& linearUnits) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), LINEAR_UNITS_KW.c_str());
-   if (lookup)
-   {
-      linearUnits = lookup;
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getVerticalUnits(const ossimString& gtiffPrefix,
-                                     const ossimKeywordlist& gtiffKwl,
-                                     ossimString& verticalUnits) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), VERTICAL_UNITS_KW.c_str());
-   if (lookup)
-   {
-      verticalUnits = lookup;
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getAngularUnits(const ossimString& gtiffPrefix,
-                                    const ossimKeywordlist& gtiffKwl,
-                                    ossimString& angularUnits) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ANGULAR_UNITS_KW.c_str());
-   if (lookup)
-   {
-      angularUnits = lookup;
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getPixelType(const ossimString& gtiffPrefix,
-                                 const ossimKeywordlist& gtiffKwl,
-                                 ossimString& pixelType) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), RASTER_TYPE_KW.c_str());
-   if (lookup)
-   {
-      pixelType = lookup;
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getModelType(const ossimString& gtiffPrefix,
-                                 const ossimKeywordlist& gtiffKwl,
-                                 ossimString& modelType) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), MODEL_TYPE_KW.c_str());
-   if (lookup)
-   {
-      modelType = lookup;
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getOssimProjectionName(const ossimString& gtiffPrefix,
-                                           const ossimKeywordlist& gtiffKwl,
-                                           ossimString& ossimProj) const
-{
-   bool result = false;
-   ossimProj.clear();
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), COORD_TRANS_CODE_KW.c_str());
-   if (lookup)
-   {
-      ossim_uint32 code = ossimString(lookup).toUInt32();
-
-      ossimGeoTiffCoordTransformsLut lut;
-      
-      ossimProj = lut.getEntryString(code);
-      
-      if (ossimProj.size())
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-ossim_uint32 ossimTiffInfo::getLines(const ossimString& gtiffPrefix,
-                                     const ossimKeywordlist& gtiffKwl) const
-{
-   ossim_uint32 result = 0;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), IMAGE_LENGTH_KW.c_str());
-   if (lookup)
-   {
-      result = ossimString(lookup).toUInt32();
-   }
-   return result;
-}
-
-ossim_uint32 ossimTiffInfo::getSamples(const ossimString& gtiffPrefix,
-                                       const ossimKeywordlist& gtiffKwl) const
-{
-   ossim_uint32 result = 0;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), IMAGE_WIDTH_KW.c_str());
-   if (lookup)
-   {
-      result = ossimString(lookup).toUInt32();
-   }   
-   return result;
-}
-
-bool ossimTiffInfo::getStdParallelOne(const ossimString& gtiffPrefix,
-                                      const ossimKeywordlist& gtiffKwl,
-                                      ossimString& value) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::STD_PARALLEL_1_KW);
-   if (lookup)
-   {
-      value = lookup;
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getStdParallelTwo(const ossimString& gtiffPrefix,
-                                      const ossimKeywordlist& gtiffKwl,
-                                      ossimString& value) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::STD_PARALLEL_2_KW);
-   if (lookup)
-   {
-      value = lookup;
-      result = true;
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getFalseEasting(const ossimString& gtiffPrefix,
-                                    const ossimKeywordlist& gtiffKwl,
-                                    ossimString& value) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::FALSE_EASTING_KW);
-   if (lookup)
-   {
-      value = lookup;
-      result = true;
-   }
-   return result; 
-}
-
-bool ossimTiffInfo::getFalseNorthing(const ossimString& gtiffPrefix,
-                                     const ossimKeywordlist& gtiffKwl,
-                                     ossimString& value) const
-{
-   bool result = false;
-   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::FALSE_NORTHING_KW);
-   if (lookup)
-   {
-      value = lookup;
-      result = true;
-   }
-   return result; 
-}
-
-bool ossimTiffInfo::getFalseEastingNorthing(const ossimString& gtiffPrefix,
-                                            const ossimKeywordlist& gtiffKwl,
-                                            ossimDpt& eastingNorthing) const
-{
-   bool result = false;
-   ossimString value;
-   if ( getFalseEasting(gtiffPrefix, gtiffKwl, value) )
-   {
-      eastingNorthing.x = value.toFloat64();
-
-      if ( getFalseNorthing(gtiffPrefix, gtiffKwl, value) )
-      {
-         eastingNorthing.y = value.toFloat64();
-         result = true;
-      }
-   }
-   return result;
-}
-
-bool ossimTiffInfo::getScaleFactor(const ossimString& gtiffPrefix,
-                                   const ossimKeywordlist& gtiffKwl,
-                                   ossim_float64& value) const
-{
-   bool result = false;
-
-   const char* lookup =
-      gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::SCALE_FACTOR_KW);
-   
-   if (lookup)
-   {
-      value = ossimString(lookup).toFloat64();
-      result = true;
-   }
-
-   return result; 
-}
-
-bool ossimTiffInfo::getOriginLat(const ossimString& gtiffPrefix,
-                                 const ossimKeywordlist& gtiffKwl,
-                                 ossim_float64& value) const
-{
-   bool result = false;
-
-   //---
-   // Not sure of the order of precedence here.
-   //---
-   const char* projOriginLatGeoKey =
-      gtiffKwl.find(gtiffPrefix.c_str(), ORIGIN_LATITUDE_KW.c_str());
-
-   //---
-   // Go for this key first as it is used in geotiff spec example:
-   // http://www.remotesensing.org/geotiff/spec/geotiff3.html#3.1.3.
-   //---
-   if (projOriginLatGeoKey)
-   {
-      value = ossimString(projOriginLatGeoKey).toFloat64();
-      result = true;
-   }
-   else
-   {
-      const char* projCenterLatGeoKey =
-         gtiffKwl.find(gtiffPrefix.c_str(), CENTER_LATITUDE__KW.c_str());
-
-      if (projCenterLatGeoKey)
-      {
-         value = ossimString(projCenterLatGeoKey).toFloat64();
-         result = true;
-      }
-      else
-      {
-         const char* projFalseOriginLatGeoKey =
-            gtiffKwl.find(gtiffPrefix.c_str(),
-                          FALSE_ORIGIN_LATITUDE_KW.c_str());
-
-         if (projFalseOriginLatGeoKey)
-         {
-            //---
-            // Seems the term "false" implies it should be added to the real
-            // origin?
-            //---
-            value = ossimString(projFalseOriginLatGeoKey).toFloat64();
-            result = true;
-         }
-      }
-   }
-   
-   return result;
-}
-
-bool ossimTiffInfo::getCentralMeridian(const ossimString& gtiffPrefix,
-                                       const ossimKeywordlist& gtiffKwl,
-                                       ossim_float64& value) const
-{
-   bool result = false;
-
-   //---
-   // Not sure of the order of precedence here.
-   //---
-   const char* projCenterLongGeoKey =
-      gtiffKwl.find(gtiffPrefix.c_str(), CENTER_LONGITUDE_KW.c_str());
-
-   //---
-   // Go for this key first as it is used in geotiff spec example:
-   // http://www.remotesensing.org/geotiff/spec/geotiff3.html#3.1.3.
-   //---
-   if (projCenterLongGeoKey)
-   {
-      value = ossimString(projCenterLongGeoKey).toFloat64();
-      result = true;
-   }
-   else
-   {
-      const char* projOriginLongGeoKey =
-         gtiffKwl.find(gtiffPrefix.c_str(), ORIGIN_LONGITUDE_KW.c_str());
-
-      if (projOriginLongGeoKey)
-      {
-         value = ossimString(projOriginLongGeoKey).toFloat64();
-         result = true;
-      }
-      else
-      {
-         const char* projFalseOriginLongGeoKey =
-            gtiffKwl.find(gtiffPrefix.c_str(),
-                          FALSE_ORIGIN_LONGITUDE_KW.c_str());
-
-         if (projFalseOriginLongGeoKey)
-         {
-            //---
-            // Seems the term "false" implies it should be added to the real
-            // origin?
-            //---
-            value = ossimString(projFalseOriginLongGeoKey).toFloat64();
-            result = true;
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimTiffInfo::getTieSets(const std::vector<ossim_float64>& ties,
-                               ossim_uint32 width,
-                               ossim_uint32 height,
-                               ossimTieGptSet& tieSet) const
-{
-   ossim_uint32 idx = 0;
-   ossim_uint32 tieCount = (ossim_uint32)ties.size()/6;
-   const double* tiePointsPtr = &ties.front();
-   double offset = 0;
-   if (hasOneBasedTiePoints(ties, width, height))
-   {
-      offset = -1.0;
-   }
-   
-   for(idx = 0; idx < tieCount; ++idx)
-   {
-      ossimDpt xyPixel(tiePointsPtr[0]+offset, tiePointsPtr[1]+offset);
-      // tie[3] = x, tie[4]
-      ossimGpt gpt(tiePointsPtr[4], tiePointsPtr[3], tiePointsPtr[5]);
-      
-      tieSet.addTiePoint(new ossimTieGpt(gpt, xyPixel, .5));
-      tiePointsPtr+=6;
-   }
-}
-
-bool ossimTiffInfo::hasOneBasedTiePoints(
-   const std::vector<ossim_float64>& ties,
-   ossim_uint32 width, ossim_uint32 height) const
-{
-   bool result = false;
-   
-   // Assuming ties of (x,y,z,lat,lon,hgt) so size should be divide by 3.
-   if (ties.size()%6)
-   {
-      return result;
-   }
-   
-   ossim_float64 minX = 999999.0;
-   ossim_float64 minY = 999999.0;
-   ossim_float64 maxX = 0.0;
-   ossim_float64 maxY = 0.0;
-
-   const ossim_uint32 SIZE = (ossim_uint32)ties.size();
-   ossim_uint32 tieIndex = 0;
-
-   while (tieIndex < SIZE)
-   {
-      if ( ties[tieIndex]   < minX ) minX = ties[tieIndex];
-      if ( ties[tieIndex]   > maxX ) maxX = ties[tieIndex];
-      if ( ties[tieIndex+1] < minY ) minY = ties[tieIndex+1];
-      if ( ties[tieIndex+1] > maxY ) maxY = ties[tieIndex+1];
-      tieIndex += 6;
-   }
-
-   if ( (minX == 1) && (maxX == width) &&
-        (minY == 1) && (maxY == height) )
-   {
-      result = true;
-   }
-
-#if 0
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimGeoTiff::hasOneBasedTiePoints DEBUG:"
-         << "\nminX:       " << minX
-         << "\nmaxX:       " << maxX
-         << "\nminY:       " << minY
-         << "\nmaxY:       " << maxY
-         << "\ntheWidth:   " << theWidth
-         << "\ntheLength:  " << theLength
-         << "\none based:  " << (result?"true":"false")
-         << std::endl;
-   }
-#endif
-   
-   return result;
-}
-
diff --git a/ossim/src/ossim/support_data/ossimTiffWorld.cpp b/ossim/src/ossim/support_data/ossimTiffWorld.cpp
deleted file mode 100644
index 12cd7d7..0000000
--- a/ossim/src/ossim/support_data/ossimTiffWorld.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-//*******************************************************************
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Ken Melero
-// 
-// Description: Container class for a tiff world file data.
-//
-//********************************************************************
-// $Id: ossimTiffWorld.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimUnitConversionTool.h>
-#include <ossim/support_data/ossimTiffWorld.h>
-#include <ossim/base/ossimNotify.h>
-#include <cmath>
-#include <fstream>
-#include <iomanip>
-#include <iostream>
-using namespace std;
-
-//**************************************************************************
-// ossimTiffWorld::ossimTiffWorld()
-//***************************************************************************
-ossimTiffWorld::ossimTiffWorld()
-   :
-      theXform1(1.0),
-      theXform2(0.0),
-      theXform3(0.0),
-      theXform4(-1.0),
-      theTranslation(0.0,0.0),
-      thePixelType(OSSIM_PIXEL_IS_AREA),
-      theUnit(OSSIM_METERS),
-      theComputedScale(0.0, 0.0),
-      theComputedRotation(0.0)
-{}
-
-//**************************************************************************
-// ossimTiffWorld::ossimTiffWorld(const char* file, PixelType ptype)
-//***************************************************************************
-ossimTiffWorld::ossimTiffWorld(const char* file, 
-			       ossimPixelType ptype,
-			       ossimUnitType  scaleUnits)
-   :
-      theXform1(1.0),
-      theXform2(0.0),
-      theXform3(0.0),
-      theXform4(-1.0),
-      theTranslation(0.0,0.0),
-      thePixelType(ptype),
-      theUnit(scaleUnits),
-      theComputedScale(0.0, 0.0),
-      theComputedRotation(0.0)
-{
-   open(ossimFilename(file), ptype, scaleUnits);
-}
-
-bool ossimTiffWorld::open(const ossimFilename& file, ossimPixelType ptype, ossimUnitType  unit)
-{
-   bool result = false;
-
-   ifstream is;
-   is.open(file.c_str());
-
-   if( !is.is_open() )
-   {
-      // ESH 07/2008, Trac #234: OSSIM is case sensitive 
-      // when using worldfile templates during ingest
-      // -- If first you don't succeed with the user-specified
-      // filename, try again with the results of a case insensitive search.
-      ossimFilename fullName(file);
-      ossimDirectory directory(fullName.path());
-      ossimFilename filename(fullName.file());
-      
-      std::vector<ossimFilename> result;
-      bool bSuccess = directory.findCaseInsensitiveEquivalents(
-         filename, result );
-      if ( bSuccess == true )
-      {
-         int numResults = (int)result.size();
-         int i;
-         for ( i=0; i<numResults && !is.is_open(); ++i )
-         {
-            is.open( result[i].c_str() );
-         }
-      }
-   }
-      
-   if ( is.is_open() )
-   {
-      double x,y;
-      is >> theXform1 >> theXform2 >> theXform3 >> theXform4 >> x >> y;
-      theTranslation = ossimDpt(x,y);
-      
-      // Compute the affine parameters from the transform:
-      theComputedRotation = atan2(theXform2,theXform1);
-      
-/*
- * Commented out warning.
- * Used all the time for tie and scale, NOT for affine. We could wrap around trace
- * if we added trace to class. (drb - 20110115)
- */
-#if 0
-      double angle2 = atan2(theXform4,theXform3);
-      if (fabs(theComputedRotation - angle2) > 0.00001)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimTiffWorld -- Non-affine transform encountered."
-            << " Use of an affine transform to represent this world file geometry will result in errors."
-            << endl;
-      }
-#endif
-      
-      double cos_rot = cos(theComputedRotation);
-      if (cos_rot != 0.0)
-      {
-         theComputedScale.x = theXform1/cos_rot;
-         theComputedScale.y = theXform4/cos_rot;
-      }
-      else
-      {
-         theComputedScale.x = theXform4;
-         theComputedScale.y = theXform1;
-      }
-      thePixelType = ptype;
-      theUnit = unit;
-      is.close();
-      result = true;
-   }
-   return result;
-}
-
-ossimTiffWorld::~ossimTiffWorld()
-{
-}
-
-void ossimTiffWorld::forward(const ossimDpt& ip,
-                             ossimDpt& transformedPoint)
-{
-   transformedPoint.x = ip.x*theXform1 + ip.y*theXform2 + theTranslation.x;
-   transformedPoint.y = ip.x*theXform3 + ip.y*theXform4 + theTranslation.y;
-}
-
-bool ossimTiffWorld::saveToOssimGeom(ossimKeywordlist& kwl, const char* prefix)const
-{
-   ossimDpt scale(fabs(theXform1), fabs(theXform4));
-   ossimDpt tie(theTranslation.x, theTranslation.y);
-
-   if ( (theUnit == OSSIM_FEET) || (theUnit == OSSIM_US_SURVEY_FEET) )
-   {
-      // Convert to meters.
-      scale.x = ossimUnitConversionTool(scale.x, theUnit).getMeters();
-      scale.y = ossimUnitConversionTool(scale.y, theUnit).getMeters();
-      tie.x   = ossimUnitConversionTool(tie.x, theUnit).getMeters();
-      tie.y   = ossimUnitConversionTool(tie.y, theUnit).getMeters();
-   }
-   
-   // Shift the tie point to be relative to the center of the pixel.
-   if(thePixelType == OSSIM_PIXEL_IS_AREA)
-   {
-      tie.x += (scale.x/2.0);
-      tie.y -= (scale.y/2.0);
-
-      // Adjust the keyword list to reflect pixel is point.
-      kwl.add(prefix,
-              ossimKeywordNames::PIXEL_TYPE_KW,
-              "pixel_is_point",
-              true);
-   }
-
-   // Units in feet converted to meters up above.
-   ossimString units = "meters";
-   if(theUnit == OSSIM_DEGREES)
-   {
-      units = "degrees";
-   }
-   
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_XY_KW,
-           tie.toString().c_str(),
-           true);
-   
-   kwl.add(prefix,
-           ossimKeywordNames::TIE_POINT_UNITS_KW,
-           units.c_str(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::PIXEL_SCALE_XY_KW,
-           scale.toString().c_str(),
-           true);
-
-   kwl.add(prefix,
-           ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
-           units.c_str(),
-           true);
-
-   return true;
-}
-
-bool ossimTiffWorld::loadFromOssimGeom(const ossimKeywordlist& kwl, const char* prefix)
-{
-   theXform2 = 0.0;
-   theXform3 = 0.0;
-
-   const char* lookup;
-
-   // Get the scale...
-   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW);
-   if (lookup)
-   {
-      ossimDpt scale;
-      scale.toPoint(std::string(lookup));
-      theXform1      = scale.x;
-      theXform4      = -(scale.y);
-   }
-   else // BACKWARDS COMPATIBILITY LOOKUPS...
-   {
-      ossimString xscale = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_X_KW);
-      ossimString yscale = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW);
-      theXform1 = xscale.toDouble();
-      theXform4 = -(yscale.toDouble());
-   }
-
-   // Get the tie...
-   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_XY_KW);
-   if (lookup)
-   {
-      ossimDpt tie;
-      tie.toPoint(std::string(lookup));
-      theTranslation.x  = tie.x;
-      theTranslation.y  = tie.y;
-   }
-   else // BACKWARDS COMPATIBILITY LOOKUPS...
-   {
-      ossimString easting  =
-         kwl.find(prefix, ossimKeywordNames::TIE_POINT_EASTING_KW);
-      ossimString northing =
-         kwl.find(prefix, ossimKeywordNames::TIE_POINT_NORTHING_KW);
-      theTranslation.x  = easting.toDouble();
-      theTranslation.y  = northing.toDouble(); 
-   }
-   
-   return true;
-}
-
-std::ostream& ossimTiffWorld::print(std::ostream& out) const
-{
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << theXform1     << "\n"
-       << theXform2     << "\n"
-       << theXform3     << "\n"
-       << theXform4     << "\n"
-       << theTranslation
-       << endl;
-   return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const ossimTiffWorld& obj)
-{
-   return obj.print(out);
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimWavelength.cpp b/ossim/src/ossim/support_data/ossimWavelength.cpp
deleted file mode 100644
index 419ee08..0000000
--- a/ossim/src/ossim/support_data/ossimWavelength.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Class definition for ossimWavelength.
-//
-//----------------------------------------------------------------------------
-
-#include <ossim/support_data/ossimWavelength.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-#include <cmath>
-
-ossimWavelength::ossimWavelength()
-   : m_map()
-{}
-
-ossimWavelength::ossimWavelength( const ossimWavelength& obj )
-   : m_map( obj.m_map )
-{}
-
-const ossimWavelength& ossimWavelength::operator=( const ossimWavelength& rhs )
-{
-   if ( this != &rhs )
-   {
-      m_map = rhs.m_map;
-   }
-   return *this;   
-}
-
-ossimWavelength::~ossimWavelength()
-{
-}
-   
-const ossimWavelength::WavelengthMap& ossimWavelength::getMap() const
-{
-   return m_map;
-}
-   
-ossimWavelength::WavelengthMap& ossimWavelength::getMap()
-{
-   return m_map;
-}
-
-bool ossimWavelength::initialize( const ossimEnviHeader& hdr )
-{
-   //---
-   // Example envi wavelength format:
-   // wavelength = { 374.323608,  382.530487,  390.737427 }
-   //---
-   ossimString value;
-
-   // Check the units...
-   ossimString key = "wavelength units";
-   if ( hdr.getValue( key, value ) )
-   {
-      if ( value.downcase() == "nanometers" )
-      {
-         // Check for wavelength key:
-         key = "wavelength";
-         if ( hdr.getValue( key, value ) )
-         {
-            if ( value.size() )
-            {
-               // Split into array.
-               value.trim( ossimString("{}") );
-               std::vector<ossimString> list;
-               value.split( list, ossimString(","), true );
-
-               if ( list.size() )
-               {
-                  // Initialize the map:
-                  
-                  std::vector<ossimString>::const_iterator i = list.begin();
-                  ossim_uint32 band = 0;
-                  ossim_float32 wavelength = 0.0;
-            
-                  while ( i != list.end() )
-                  {
-                     wavelength = (*i).toFloat64();
-                     m_map.insert( std::make_pair( wavelength, band ) );
-                     ++band;
-                     ++i;
-                  }
-               }
-            }
-         }
-      }
-   }
-   
-   return ( m_map.size() ? true : false);
-   
-} // End: bool ossimWavelength::initialize(const ossimEnviHeader&)
-
-using namespace std;
-ossimWavelength::WavelengthMap::const_iterator ossimWavelength::findClosestIterator(
-   const ossim_float64& requestedWavelength,
-   const ossim_float64& thresholdFromCenter  ) const
-{
-   WavelengthMap::const_iterator result = m_map.lower_bound( requestedWavelength );
-   if ( result != m_map.end() )
-   {
-      if ( result != m_map.begin() ) //  && (result->first > requestedWavelength) )
-      {
-         // Somewhere in the middle.
-         WavelengthMap::const_iterator lower = result;
-         --lower;
-
-         ossim_float64 t = (requestedWavelength - lower->first) / (result->first -lower->first);
-         if ( t < 0.5 )
-         {
-            result = lower;
-         }
-      }
-   }
-   else
-   {
-      --result;
-   }
-      
-   if ( result != m_map.end() )
-   {
-      // Within threshold check.
-      if ( std::fabs( result->first - requestedWavelength) > thresholdFromCenter )
-      {
-         result = m_map.end();
-      }
-      
-   } // if ( result != m_map.end() )
-
-   return result;
-   
-} // End: WavelengthMap::const_iterator ossimWavelength::findClosestIterator
-
-ossim_int32 ossimWavelength::findClosestIndex(
-   const ossim_float64& requestedWavelength, const ossim_float64& thresholdFromCenter  ) const
-{
-   ossim_int32 result = -1;
-   WavelengthMap::const_iterator i =
-      findClosestIterator( requestedWavelength, thresholdFromCenter );
-   if ( i != m_map.end() )
-   {
-      result = (*i).second;
-   }
-   return result;
-   
-} // End: ossim_int32 ossimWavelength::findClosestIndex(...
-
-bool ossimWavelength::getRgbBands( std::vector<ossim_uint32>& bands ) const
-{
-   bool result = false;
-
-   if ( m_map.size() )
-   {
-      //---
-      // Attempt to find bands with closest rgb wavelengths.
-      // red:   620 - 750 nm
-      // green: 495 - 570 nm
-      // blue:  450 - 495 nm
-      //---
-      //const ossim_float32 RED_WAVELENGTH              = 439.978577; // 442.0;      
-      //const ossim_float32 GREEN_WAVELENGTH            = 546.666504; // 546.0;
-      //const ossim_float32 BLUE_WAVELENGTH             = 636.941406; // 637.0;
-      const ossim_float32 RED_WAVELENGTH              = 685.0;      
-      const ossim_float32 GREEN_WAVELENGTH            = 532.5;
-      const ossim_float32 BLUE_WAVELENGTH             = 472.5;
-      const ossim_float32 RED_THRESHOLD_FROM_CENTER   =  65.0;      
-      const ossim_float32 GREEN_THRESHOLD_FROM_CENTER =  37.5;
-      const ossim_float32 BLUE_THRESHOLD_FROM_CENTER  =  22.5;
-
-      WavelengthMap::const_iterator r =
-         findClosestIterator( RED_WAVELENGTH, RED_THRESHOLD_FROM_CENTER );
-      WavelengthMap::const_iterator g =
-         findClosestIterator( GREEN_WAVELENGTH, GREEN_THRESHOLD_FROM_CENTER );
-      WavelengthMap::const_iterator b =
-         findClosestIterator( BLUE_WAVELENGTH, BLUE_THRESHOLD_FROM_CENTER );
-
-      if ( (r != m_map.end()) && (g != m_map.end()) && (b != m_map.end()) )
-      {
-         bands.resize(3);
-         bands[0] = (*r).second;
-         bands[1] = (*g).second;
-         bands[2] = (*b).second;
-         result = true;
-      }
-   }
-   return result;
-   
-} // bool ossimWavelength::getRgbBands( std::vector<ossim_uint32>& ) const
-
-ossimWavelength::WavelengthMap::const_iterator ossimWavelength::end() const
-{
-   return m_map.end();
-}
-
-ossimWavelength::WavelengthMap::iterator ossimWavelength::end()
-{
-   return m_map.end();
-}
-
diff --git a/ossim/src/ossim/support_data/ossimWkt.cpp b/ossim/src/ossim/support_data/ossimWkt.cpp
deleted file mode 100644
index fc30aa1..0000000
--- a/ossim/src/ossim/support_data/ossimWkt.cpp
+++ /dev/null
@@ -1,274 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// ossimWkt class definition.  A well known text(WKT) utility class.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-/*************************************************************************************************
- * Sample WKT string (for reference, line feeds and spaces added for human readability)
- *
- * PROJCS["NAD_1983_HARN_Lambert_Conformal_Conic",
- *        GEOGCS["GCS_North_American_1983_HARN",
- *               DATUM["NAD83_High_Accuracy_Regional_Network",
- *                     SPHEROID["GRS_1980",6378137,298.257222101, AUTHORITY["EPSG","7019"]],
- *                     AUTHORITY["EPSG","6152"]],
- *               PRIMEM["Greenwich",0],
- *               UNIT["degree",0.0174532925199433]],
- *        PROJECTION["Lambert_Conformal_Conic_2SP"],
- *        PARAMETER["standard_parallel_1",43],
- *        PARAMETER["standard_parallel_2",45.5],
- *        PARAMETER["latitude_of_origin",41.75],
- *        PARAMETER["central_meridian",-120.5],
- *        PARAMETER["false_easting",1312335.958005249],
- *        PARAMETER["false_northing",0],
- *        UNIT["foot",0.3048, AUTHORITY["EPSG","9002"]]]
- *
- **************************************************************************************************/
-#include <ossim/support_data/ossimWkt.h>
-#include <cstdio>
-#include <iostream>
-#include <sstream>
-
-using namespace std; // tmp drb...
-
-ossimWkt::ossimWkt()
-   : m_kwl()
-{
-}
-
-ossimWkt::~ossimWkt()
-{
-}
-
-bool ossimWkt::parse( const std::string& wkt )
-{
-   bool result = false;
-   if ( wkt.size() )
-   {
-      std::istringstream is( wkt );
-      result = parseWktGroup( is, m_kwl );
-   }
-   return result;
-}
-
-const ossimKeywordlist& ossimWkt::getKwl() const
-{
-   return m_kwl;
-}
-
-bool ossimWkt::parseWktGroup( std::istringstream& is, ossimKeywordlist& kwl )
-{
-   bool result = false;
-
-   if ( is.good() )
-   {
-      char c;
-
-      // Get the wkt group name up to '[', e.g. "PROJCS[".
-      std::string prefix = "";      
-      std::string object;
-      // std::string v;
-      while ( is.good() )
-      {
-         is.get(c);
-         if ( is.good() )
-         {
-            // Look for parens or square brackets.
-            if ( (c != '[') && (c != '(') )
-            {
-               object.push_back(c);
-            }
-            else
-            {
-               result = parseObject( is, prefix, object, kwl );
-            }
-         }
-         else
-         {
-            break;
-         }
-      }
-   }
-   
-   return result;
-}
-
-bool ossimWkt::parseObject( std::istringstream& is,
-                            const std::string& prefix,
-                            const std::string& object,
-                            ossimKeywordlist& kwl )
-{
-   bool result = false;
-
-   result = parseName( is, prefix, object, kwl );
-
-   if ( result && is.good() )
-   {
-      char c;
-      ossim_uint32 myObjectIndex = 0;
-      ossim_uint32 paramIndex = 0;
-      while ( is.good() )
-      {
-         is.get(c);
-         if ( is.good() )
-         {  
-            if ( c == ',' )
-            {
-               parseParam( is, prefix, object, myObjectIndex, paramIndex, kwl );
-            }
-            else if ( (c == ']') || (c == ')') )
-            {
-               break; // End of object.
-            }
-         }
-      }
-      
-   }
-   
-   return result;
-}
-
-bool ossimWkt::parseName( std::istringstream& is,
-                          const std::string& prefix,
-                          const std::string& object,
-                          ossimKeywordlist& kwl )
-{
-   bool result = false;
-   char c;
-   std::string name;
-
-   // Find the first quote:
-   while ( is.good() )
-   {
-      is.get(c);
-      if ( is.good() )
-      {  
-         if ( c == '"' )
-         {
-            break;
-         }
-      }
-   }
-
-   // Get the name:
-   while ( is.good() )
-   {
-      is.get(c);
-      if ( is.good() )
-      {  
-         if ( c != '"' )
-         {
-            name.push_back(c);
-         }
-         else
-         {
-            break; // End quote:
-         }
-      }
-   }
-
-   if ( name.size() )
-   {
-      // Add to keyword list.
-      std::string key;
-      if ( prefix.size() )
-      {
-         key += prefix;
-      }
-      key += object;
-      key += ".name";
-      kwl.addPair( key, name );
-      result = true;
-   }
-   
-   return result;
-}
-
-bool ossimWkt::parseParam( std::istringstream& is,
-                           const std::string& prefix,
-                           const std::string& object,
-                           ossim_uint32& objectIndex,
-                           ossim_uint32& paramIndex,
-                           ossimKeywordlist& kwl )
-{
-   bool result = false;
-   char c;
-   std::string name;
-
-   // Get the name:
-   while ( is.good() )
-   {
-      int i = is.peek(); // Don't gobble the trailing comma or bracket.
-      
-      if ( (i == ',') || (i == ']') || (i == ')') )
-      {
-         // End of param.
-         if ( name.size() )
-         {
-            // Add to keyword list.
-            std::string key;
-            if ( prefix.size() )
-            {
-               key += prefix;
-            }
-            key += object;
-            key += ".param";
-            key += ossimString::toString(paramIndex).string();
-            kwl.addPair( key, name );
-            name = "";
-            ++paramIndex;
-            result = true;
-         }
-         
-         break; // Next param or at end of object.
-      }
-
-      is.get(c);
-      if ( is.good() )
-      {
-         // Look nexted object.
-         if ( (c == '[') || (c == '(') )
-         {
-            std::string myPrefix;
-            if ( prefix.size() )
-            {
-               myPrefix += prefix;
-            }
-            
-            myPrefix += object;
-
-            myPrefix += ".";
-
-            //---
-            // Special hack for duplicated keyword "PARAMETER"
-            //---
-            if ( name == "PARAMETER" )
-            {
-               name += ossimString::toString(objectIndex).string();
-               ++objectIndex;
-            }
-
-            result = parseObject( is, myPrefix, name, kwl );
-
-            name = "";
-         }
-         else
-         {
-            name.push_back(c);
-         }
-      }
-   }
-   
-   return result;
-}
-
-
diff --git a/ossim/src/ossim/support_data/ossimXmpInfo.cpp b/ossim/src/ossim/support_data/ossimXmpInfo.cpp
deleted file mode 100644
index 93243fd..0000000
--- a/ossim/src/ossim/support_data/ossimXmpInfo.cpp
+++ /dev/null
@@ -1,645 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Extensible Metadata Platform (XMP) Info object.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/support_data/ossimXmpInfo.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimEndian.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/base/ossimXmlNode.h>
-#include <ossim/projection/ossimBilinearProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <fstream>
-#include <iomanip>
-#include <iostream>
-#include <sstream>
-#include <vector>
-
-// Static trace for debugging.
-static const ossimTrace traceDebug( ossimString("ossimXmpInfo:debug") );
-
-ossimXmpInfo::ossimXmpInfo()
-   : ossimInfoBase(),
-     m_file(),
-     m_xmpApp1XmlBlock()
-{
-}
-
-ossimXmpInfo::~ossimXmpInfo()
-{
-}
-
-bool ossimXmpInfo::open(const ossimFilename& file)
-{
-   //---
-   // NOTE:
-   // This parser was written for a specific aerial camera.  If something more generic is
-   // needed please provide sample to the group. D. Burken, 17 January 2013.
-   //---
-   
-   bool result = false;
-
-   //---
-   // Open the file.
-   //---
-   std::ifstream str(file.c_str(), std::ios_base::binary|std::ios_base::in);
-   if ( str.good() ) 
-   {
-      // Parse for XMP APP1 XML block. Currently only case.
-      std::string xmlString;
-      result = getXmpApp1XmlBlock( str, xmlString );
-      if ( result )
-      {
-         m_file = file;
-         m_xmpApp1XmlBlock = xmlString;
-      }
-      else
-      {
-         m_file.clear();
-         m_xmpApp1XmlBlock.clear();
-      }
-   }
-
-   return result;
-}
-
-bool ossimXmpInfo::getXmpApp1XmlBlock( std::ifstream& str, std::string& xmpApp1XmlBlock ) const
-{
-   bool result = false;
-
-   if ( str.good() )
-   {
-      ossim_uint8 c;
-      
-      // Look for Start Of Image (SOI) marker 0xFFD8:
-      str.read( (char*)&c, 1);
-      if ( c == 0xff )
-      {
-         str.read( (char*)&c, 1);
-         if ( c == 0xd8 )
-         {
-            // Found SOI marker.
-            
-            // Now find APP1 marker 0xffe1.  Only do 24 iterations max:
-            for ( ossim_uint32 i = 0; i < 24; ++i )
-            {
-               str.read( (char*)&c, 1);
-               if ( c == 0xff )
-               {
-                  str.read( (char*)&c, 1);
-                  if ( c == 0xe1 )
-                  {
-                     // Found APP1 marker.
-                     
-                     //---
-                     // Next two bytes are the length, MSB first (big endian) per jpeg spec.
-                     // length = 2 + 29 + length_of_xmp_packet
-                     //---
-                     ossim_uint16 xpacketLength = 0;
-                     str.read( (char*)&xpacketLength, 2 );
-                     
-                     // See if system is not big endian and swap if needed.
-                     if ( ossim::byteOrder() != OSSIM_BIG_ENDIAN )
-                     {
-                        ossimEndian swapper;
-                        swapper.swap( xpacketLength );
-                     }
-                     
-                     if ( xpacketLength > 31 )
-                     {
-                        //---
-                        // XMP namepsace URI, used as unique ID:
-                        // Null terminated ascii string: "http://ns.adobe.com/xap/1.0/"
-                        // (29 bytes)
-                        // Not using getline until ID verified.
-                        //---
-                        const ossim_uint32 XMP_ID_SIZE = 29;
-                        std::vector<char> v( XMP_ID_SIZE );
-                        
-                        // Read the next 29 bytes.  (string + null)
-                        str.read( &v.front(), XMP_ID_SIZE );
-                        
-                        // Copy.
-                        v.push_back( '\0' ); // Just in case string is bad.
-                        std::string s = &v.front();
-                        
-                        if ( s == "http://ns.adobe.com/xap/1.0/" )
-                        {
-                           //---
-                           // Now read header to determine encoding:
-                           // Note: Currently hard coded for UTF-8.
-                           //---
-                           
-                           //---
-                           // Look for "<?xpacket begin="
-                           // Line has binary data in it or getline could be used.
-                           //---
-                           const ossim_uint32 HEADER_SIZE = 16;
-                           v.resize( HEADER_SIZE );
-                           str.read( &v.front(), HEADER_SIZE );
-                           
-                           v.push_back( '\0' ); // Null terminate.
-                           s = &v.front();
-                           
-                           if ( s == "<?xpacket begin=" )
-                           {
-                              // Skip the quote which can be single or double.
-                              str.seekg( 1, std::ios_base::cur );
-                              
-                              // Now look for 0xEF, 0xBB, 0xBF which is UTF-8
-                              ossim_uint8 encode_bytes[3];
-                              str.read( (char*)encode_bytes, 3 );
-                              
-                              if ( ( encode_bytes[0] == 0xef ) &&
-                                   ( encode_bytes[1] == 0xbb ) &&
-                                   ( encode_bytes[2] == 0xbf ) )
-                              {
-                                 // Skip the next six bytes: "' id='"
-                                 str.seekg( 6, std::ios_base::cur );
-                                 
-                                 // Read the ID: W5M0MpCehiHzreSzNTczkc9d
-                                 const ossim_uint32 XPACKET_ID_SIZE = 24;
-                                 v.resize( XPACKET_ID_SIZE );
-                                 str.read ( &v.front(), XPACKET_ID_SIZE );
-                                 
-                                 v.push_back( '\0' ); // null terminate
-                                 s = &v.front();
-                                 
-                                 if ( s == "W5M0MpCehiHzreSzNTczkc9d" )
-                                 {
-                                    //---
-                                    // Gobble the rest of the line. No more binary characters
-                                    // so just use getline.
-                                    //---
-                                    std::getline( str, s );
-                                    
-                                    // Read in the xml string (single line):
-                                    std::getline( str, xmpApp1XmlBlock );
-                                    
-                                    if ( xmpApp1XmlBlock.size() )
-                                    {
-                                       result = true;
-                                    }
-                                 }
-                              }
-                              
-                           } // Matches: if ( s == "<?xpacket begin=" )
-                           
-                        } // Matches: if ( s == "http://ns.adobe.com/xap/1.0/" )
-                        
-                     } // Matches: if ( xpacketLength > 31 )
-                  
-                  } // Matches: if ( c == 0xd8 )
-                  
-               } // Matches: if ( c == 0xff )
-               
-            } // Matches: for ( ossim_uint32 i; i < 24; ++i )
-            
-         } // Matches: if ( c == 0xd8 )
-         
-      } // Matches: if ( c == 0xff )
-      
-   } // Matches: if ( str.good() ) 
-
-   return result;
-   
-} // End: ossimXmpInfo::getXmpApp1XmlBlock
-
-std::ostream& ossimXmpInfo::print(std::ostream& out) const
-{
-   if ( getXmpApp1XmlBlock().size() )
-   {
-      std::string prefix = "";
-      std::string ext = m_file.ext().downcase().string();
-      if ( ( ext == "jpg" ) || ( ext == "jpeg" ) )
-      {
-         prefix = "jpeg.";
-      }
-      
-      std::string s;
-
-      // Date:
-      getDate( s );
-      if ( s.size() )
-      {
-         out << prefix << "acquisitionDate: " << s << std::endl;
-      }      
-      
-      // Mission ID:
-      getMissionId( s );
-      if ( s.size() )
-      {
-         out << prefix << "missionId: " << s << std::endl;
-      }
-
-      // Sensor ID:
-      getSensorId( s );
-      if ( s.size() )
-      {
-         out << prefix << "sensorId: " << s << std::endl;
-      }
-      
-      out << prefix << "xmp.app1.xml: " << getXmpApp1XmlBlock() << std::endl;
-      
-   }
-   return out;
-
-} // End: std::ostream& ossimXmpInfo::print(std::ostream& out) const
-
-const std::string& ossimXmpInfo::getXmpApp1XmlBlock() const
-{
-   return m_xmpApp1XmlBlock;
-}
-
-ossimRefPtr<ossimProjection> ossimXmpInfo::getProjection( const ossimDrect& imageRect ) const
-{
-   ossimRefPtr<ossimProjection> result = 0;
-
-   if ( getXmpApp1XmlBlock().size() && ( imageRect.hasNans() == false ) )
-   {
-      // Open a stream to the xml block.
-      std::istringstream is;
-      is.str( m_xmpApp1XmlBlock );
-
-      ossimXmlDocument xmlDoc;
-
-      // Read the xml document:
-      if ( xmlDoc.read( is ) )
-      {
-         // Find the four corner ground points.
-         ossimString s;
-         ossimString path;
-         ossimGpt ulg;
-         ossimGpt urg;
-         ossimGpt lrg;
-         ossimGpt llg;
-         bool foundAll = false;
-
-         while ( 1 )
-         {
-            // Upper left:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UL_Latitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               ulg.lat = s.toFloat64();
-            }
-            else
-            {
-               break;
-            }
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UL_Longitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               ulg.lon = s.toFloat64();
-            }
-            else
-            {
-               break;
-            }
-
-            // Upper right:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UR_Latitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               urg.lat = s.toFloat64();
-            }
-            else
-            {
-               break;
-            }
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UR_Longitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               urg.lon = s.toFloat64();
-            }
-            else
-            {
-               break;
-            }
-            
-            // Lower right:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LR_Latitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               lrg.lat = s.toFloat64();
-            }
-            else
-            {
-               break;
-            }
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LR_Longitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               lrg.lon = s.toFloat64();
-            }
-            else
-            {
-               break;
-            }
-            
-            // Lower left:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LL_Latitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               llg.lat = s.toFloat64();
-            }
-            else
-            {
-               break;
-            }
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LL_Longitude";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               llg.lon = s.toFloat64();
-
-               // If we get here mark the status good:
-               foundAll = true;
-            }
-            else
-            {
-               break;
-            }
-
-            //---
-            // Final trailing break out of infinite loop.
-            // No code past this point if while loop.
-            //---
-            break;
-         }
-
-         if ( foundAll )
-         {
-            result = new ossimBilinearProjection( imageRect.ul(),
-                                                  imageRect.ur(),
-                                                  imageRect.lr(),
-                                                  imageRect.ll(),
-                                                  ulg,
-                                                  urg,
-                                                  lrg,
-                                                  llg );
-         }
-         
-      } // Matches: if ( xmlDoc.read( is ) )
-      
-   } // Matches: if ( getXmpApp1XmlBlock().size() )
-   
-   return result;
-   
-} // End: ossimXmpInfo::getProjection
-
-void  ossimXmpInfo::getDate( std::string& date ) const
-{
-   date.clear();
-   
-   if ( getXmpApp1XmlBlock().size() )
-   {
-      // Open a stream to the xml block.
-      std::istringstream is;
-      is.str( m_xmpApp1XmlBlock );
-      
-      ossimXmlDocument xmlDoc;
-      
-      // Read the xml document:
-      if ( xmlDoc.read( is ) )
-      {
-         //---
-         // ISO8601 date in the form of: YYYY-MM-DDThh:mm:ss.sssZ
-         // Find the four corner ground points.
-         //---
-         ossimString s;
-         ossimString path;
-         std::string year;
-         std::string month;
-         std::string dayOfMonth;
-         std::string hour;
-         std::string minute;
-         std::string second;
-         std::string milliSecond;
-         
-         bool foundAll = false;
-
-         while ( 1 )
-         {
-            // year:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Year";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               year = s.string();
-            }
-            else
-            {
-               break;
-            }
-            // month:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Month";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               month = s.string();
-            }
-            else
-            {
-               break;
-            }
-            
-            // day of month:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Day_of_Month";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               dayOfMonth = s.string();
-            }
-            else
-            {
-               break;
-            }
-            
-            // hour:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Hour";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               hour = s.string();
-            }
-            else
-            {
-               break;
-            }
-            
-            // minute:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Min";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               minute = s.string();
-            }
-            else
-            {
-               break;
-            }
-            
-            // second:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Sec";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               second = s.string();
-            }
-            else
-            {
-               break;
-            }
-            
-            // millisecond:
-            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Msec";
-            if ( getPath( path, xmlDoc, s ) )
-            {
-               milliSecond = s.string();
-            }
-            else
-            {
-               break;
-            }
-
-            // If we get here mark the status good for downstream code.
-            foundAll = true;
-            
-            //---
-            // Final trailing break out of infinite loop.
-            // No code past this point if while loop.
-            //---
-            break;
-
-         } // End: while ( 1 )
-         
-         if ( foundAll )
-         {
-            date = year + "-"; // Assuming year in 4 digit form, e.g. 2013.
-
-            // Month two digit wide.
-            std::ostringstream os1;
-            os1 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
-                << std::setfill('0')
-                << std::setw(2)
-                << month;
-            date += os1.str() + "-";
-
-            // Day two digit wide.
-            std::ostringstream os2;
-            os2 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
-                << std::setfill('0')
-                << std::setw(2)
-                << dayOfMonth;
-            date += os2.str() + "T";
-
-            // Hour two digit wide.
-            std::ostringstream os3;
-            os3 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
-                << std::setfill('0')
-                << std::setw(2)
-                << hour;
-            date += os3.str() + ":";
-
-            // Minute two digit wide.
-            std::ostringstream os4;
-            os4 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
-                << std::setfill('0')
-                << std::setw(2)
-                << minute;
-            date += os4.str() + ":";
-
-            // Second two digit wide.
-            std::ostringstream os5;
-            os5 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
-                << std::setfill('0')
-                << std::setw(2)
-                << second;
-            date += os5.str() + ".";
-
-             // Milli second three digit wide.
-            std::ostringstream os6;
-            os6 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
-                << std::setfill('0')
-                << std::setw(3)
-                << milliSecond;
-            date += os6.str() + "Z"; // Assumption...
-         }
-         
-      } // Matches: if ( xmlDoc.read( is ) )
-      
-   } // Matches: if ( getXmpApp1XmlBlock().size() )
-   
-} // End: void  ossimXmpInfo::getDate( std::string& date ) const
-
-
-void ossimXmpInfo::getMissionId( std::string& mission ) const
-{
-   // Currently nothing in sample data to grab so using mission "x".
-   mission = "x";
-}
-
-void ossimXmpInfo::getSensorId( std::string& sensor ) const
-{
-   // Currently nothing in sample data to grab so using sensor "x".
-   sensor = "x";
-}
-
-bool ossimXmpInfo::getPath(
-   const ossimString& path, const ossimXmlDocument& xdoc, ossimString& s) const
-{
-   bool result = false;
-
-   std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
-   xdoc.findNodes(path, xnodes);
-   if ( xnodes.size() == 1 ) // Error if more than one.
-   {
-      if ( xnodes[0].valid() )
-      {
-         s = xnodes[0]->getText();
-         result = true;
-      }
-      else if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimXmpInfo::getPath ERROR:\n"
-            << "Node not found: " << path
-            << std::endl;
-      }
-   }
-   else if ( xnodes.size() == 0 )
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimXmpInfo::getPath ERROR:\n"
-            << "Node not found: " << path
-            << std::endl;
-      }
-   }
-   else
-   {
-      if(traceDebug())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimXmpInfo::getPath ERROR:\n"
-            << "Multiple nodes found: " << path
-            << std::endl;
-      }
-   }
-
-   if (!result)
-   {
-      s.clear();
-   }
-   return result;
-   
-} // bool ossimXmpInfo::getPath
-
-
diff --git a/ossim/src/ossim/util/ossimAutRegUtil.cpp b/ossim/src/ossim/util/ossimAutRegUtil.cpp
deleted file mode 100644
index 1cc5cf6..0000000
--- a/ossim/src/ossim/util/ossimAutRegUtil.cpp
+++ /dev/null
@@ -1,1747 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimAutRegUtil.cpp
-//
-// License: MIT
-// 
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Hicks
-//
-// Description: Utility class for autonomous registration operations.
-//
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/util/ossimAutRegUtil.h>
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimDate.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimVisitor.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimTieMeasurementGeneratorInterface.h>
-#include <ossim/base/ossimAdjustmentExecutive.h>
-#include <ossim/base/ossimPointObservation.h>
-#include <ossim/base/ossimObservationSet.h>
-
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/projection/ossimImageViewAffineTransform.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/init/ossimInit.h>
-
-#include <iostream>
-
-static ossimTrace traceDebug ("ossimAutRegUtil:debug");
-static ossimTrace traceLog("ossimAutRegUtil:log");
-static ossimTrace traceOptions("ossimAutRegUtil:options");
-
-static const std::string APPLICATION_NAME_KW            = "application_name";
-static const std::string ADJ_DESC_LABEL_KW              = "adj_desc_label";
-static const std::string FALSE_KW                       = "false";
-static const std::string IMG_1_KW                       = "img_1";
-static const std::string IMG_2_KW                       = "img_2";
-static const std::string IMG_M_KW                       = "img_m"; // master
-static const std::string IMG_S_KW                       = "img_s"; // slave
-static const std::string OP_KW                          = "operation";
-static const std::string SRC_FILE_KW                    = "src_file";
-static const std::string TRUE_KW                        = "true";
-static const std::string ROI_CENTER_LAT_KW              = "roi_center_lat";
-static const std::string ROI_CENTER_LON_KW              = "roi_center_lon";
-static const std::string ROI_RADIUS_KW                  = "roi_radius";  // meters
-static const std::string ROI_HEIGHT_KW                  = "roi_height";  // pixels
-static const std::string ROI_MAX_LAT_KW                 = "roi_max_lat";
-static const std::string ROI_MAX_LON_KW                 = "roi_max_lon";
-static const std::string ROI_MIN_LAT_KW                 = "roi_min_lat";
-static const std::string ROI_MIN_LON_KW                 = "roi_min_lon";
-static const std::string ROI_WIDTH_KW                   = "roi_width";   // pixels
-static const std::string REPORT_FILE_KW                 = "report_file";
-        
-static const std::string FILE_KW                 = "file";
-static const std::string IMG_KW                  = "image";
-static const std::string READER_PROPERTY_KW      = "reader_property";
-
-static const std::string OCV_CONFIG_FILE_KW             = "ocv_config_file";
-static const std::string OCV_DETECTOR_NAME_KW           = "ocv_detector_name";
-static const std::string OCV_DRAW_MATCHES_FLAG_KW       = "ocv_draw_matches_flag";
-static const std::string OCV_EXTRACTOR_NAME_KW          = "ocv_extractor_name";
-static const std::string OCV_MATCHER_NAME_KW            = "ocv_matcher_name";
-static const std::string OCV_MAX_MATCHES_KW             = "ocv_max_matches";
-static const std::string OCV_USE_CROSS_CHECK_KW         = "ocv_use_cross_check";
-static const std::string OCV_USE_GRID_ADAPTED_DETECT_KW = "ocv_use_grid_adapted_detect";
-static const std::string OCV_RESULTS_WINDOW_SHOW_KW     = "ocv_results_window_show";//????
-
-static const std::string OAX_CONFIG_FILE_KW             = "oax_config_file";
-static const std::string OAX_CONVERGENCE_CRITERIA_KW    = "oax_convergence_criteria";
-static const std::string OAX_GROUND_SIGMA_KW            = "oax_ground_sigma";
-static const std::string OAX_LAT_SIGMA_KW               = "oax_lat_sigma";
-static const std::string OAX_LON_SIGMA_KW               = "oax_lon_sigma";
-static const std::string OAX_HGT_SIGMA_KW               = "oax_hgt_sigma";
-static const std::string OAX_CONTROL_SIGMA_KW           = "oax_control_sigma";
-static const std::string OAX_MAX_ITERATIONS_KW          = "oax_max_iterations";
-
-
-//*****************************************************************************
-//  METHOD: ossimAutRegUtil::ossimAutRegUtil()
-//  
-//  Constructor.
-//*****************************************************************************
-ossimAutRegUtil::ossimAutRegUtil()
-   : ossimReferenced(),
-     m_tGen(0),
-     m_tGenObj(0),
-     m_roiRects(),
-     m_showMatchWindow(false),
-     m_adjExec(0),
-     m_obsSet(0),
-     m_LatLonHgtSigmas(),
-     m_LatLonHgtControlSigmas(),
-     m_rep(0),
-     m_imgLayer(0),
-     m_kwl(new ossimKeywordlist()),
-     m_ocvKwl(0),
-     m_oaxKwl(0),
-     m_srcKwl(0),
-     m_operation(OSSIM_AUTREG_OP_UNKNOWN)
-{
-   // traceDebug.setTraceFlag(true);
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nossimAutRegUtil::ossimAutRegUtil 1 DEBUG:" << std::endl;
-   }
-
-   // Default tie point ground sigmas
-   m_LatLonHgtSigmas[0] = 50.0;
-   m_LatLonHgtSigmas[1] = 50.0;
-   m_LatLonHgtSigmas[2] = 50.0;
-
-   // Default control point ground sigmas
-   m_LatLonHgtControlSigmas[0] = 1.0;
-   m_LatLonHgtControlSigmas[1] = 1.0;
-   m_LatLonHgtControlSigmas[2] = 1.0;
-
-   // ossimImageGeometry
-   m_geom[0] = 0;
-   m_geom[1] = 0;
-
-   // Default control image flags
-   m_controlImage[0] = false;
-   m_controlImage[1] = false;
-
-
-   m_kwl->setExpandEnvVarsFlag(true);
-
-}
-
-// Private/hidden
-ossimAutRegUtil::ossimAutRegUtil( const ossimAutRegUtil& /* obj */ )
-{
-}
-
-// Private/hidden
-const ossimAutRegUtil& ossimAutRegUtil::operator=( const ossimAutRegUtil& /* rhs */)
-{
-   return *this;
-}
-
-
-//*****************************************************************************
-//  DESTRUCTOR: ~ossimAutRegUtil()
-//*****************************************************************************
-ossimAutRegUtil::~ossimAutRegUtil()
-{
-   
-   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG: ~ossimAutRegUtil(): entered..." << std::endl;
-
-   clear();
-
-   *m_rep << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
-   *m_rep << endl;
-
-   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG)
-      << "DEBUG: ~ossimAutRegUtil(): returning..." << std::endl;
-}
-
-
-void ossimAutRegUtil::addArguments(ossimArgumentParser& ap)
-{
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [option]... [input-option]... -img_1 <input-file 1> -img_2 <input-file 2>\n\nAvailable traces:\n-T \"ossimAutRegUtil:debug\"   - General debug trace to standard out.\n-T \"ossimAutRegUtil:log\"     - Writes a log file to output-file.log.\n-T \"ossimAutRegUtil:options\" - Writes the options to output-file-options.kwl.";
-
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   
-   au->setCommandLineUsage(usageString);
-    
-   au->setDescription(ap.getApplicationName()+": Utility application for autonomous image registration.");
-
-   au->addCommandLineOption("-h or --help", "Display this help and exit.");
-
-   au->addCommandLineOption("--quality", "<quality>\nNOT WORKING... Desired quality of tiepoint collection.\nRange: 1 to 5, Default = 3");
-   
-   au->addCommandLineOption("--roi-center-llwh","<latitude> <longitude> <width> <height>\nSpecify the center ROI in latitude longitude space with width and height in pixels.");
-
-   au->addCommandLineOption("--roi-center-llr","<latitude> <longitude> <radius_in_meters>\nSpecify the center ROI in latitude longitude space with radius in meters.");
-
-   au->addCommandLineOption("--ocv_config_file","<file_path>\nSpecify a keyword list OpenCV configuration file.");
-
-   au->addCommandLineOption("--oax_config_file","<file_path>\nSpecify a keyword list oax configuration file.");
-
-   
-} // End: ossimAutRegUtil::addArguments
-
-
-void ossimAutRegUtil::clear()
-{
-   // Must disconnect chains so that they destroy.
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator i = m_imgLayer.begin();
-   while ( i != m_imgLayer.end() )
-   {
-      (*i)->disconnect();
-      (*i) = 0;
-      ++i;
-   }
-   m_imgLayer.clear();
-
-   // i = m_demLayer.begin();
-   // while ( i != m_demLayer.end() )
-   // {
-   //    (*i)->disconnect();
-   //    (*i) = 0;
-   //    ++i;
-   // }
-   // m_demLayer.clear();
-}
-
-bool ossimAutRegUtil::initialize(ossimArgumentParser& ap)
-{
-   static const char MODULE[] = "ossimAutRegUtil::initialize(ossimArgumentParser&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   clear();
-   if( ap.read("-h") || ap.read("--help") || (ap.argc() == 1) )
-   {
-      usage(ap);
-      
-      return false; // Indicates process should be terminated to caller.
-   }
-
-   // Start with clean options keyword list.
-   m_kwl->clear();
-
-   std::string tempString1;
-   ossimArgumentParser::ossimParameter stringParam1(tempString1);
-   std::string tempString2;
-   ossimArgumentParser::ossimParameter stringParam2(tempString2);
-   std::string tempString3;
-   ossimArgumentParser::ossimParameter stringParam3(tempString3);
-   std::string tempString4;
-   ossimArgumentParser::ossimParameter stringParam4(tempString4);
-
-   double tempDouble1;
-   ossimArgumentParser::ossimParameter doubleParam1(tempDouble1);
-   double tempDouble2;
-   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
-
-   ossimString key = "";
-   
-   // Extract arguments and stuff them in a keyword list.
-   if( ap.read("--report_file", stringParam1) )
-   {
-      m_kwl->addPair( std::string(REPORT_FILE_KW), tempString1 );
-   }
-
-   // report file
-   if( ap.read("--quality", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::QUALITY_KW), tempString1 );
-   }
-
-   // operation
-   if( ap.read("--op", stringParam1) )
-   {
-      m_kwl->addPair( OP_KW, tempString1 );
-   }
-
-   // image 1
-   if( ap.read("--img_1", stringParam1))
-   {
-      m_kwl->addPair( std::string(IMG_1_KW), tempString1 );
-   }
-
-   // image 2
-   if( ap.read("--img_2", stringParam1))
-   {
-     m_kwl->addPair( std::string(IMG_2_KW), tempString1 );
-   }
-
-   // master image
-   if( ap.read("--img_m", stringParam1))
-   {
-      m_kwl->addPair( std::string(IMG_M_KW), tempString1 );
-   }
-
-   // slave image
-   if( ap.read("--img_s", stringParam1))
-   {
-     m_kwl->addPair( std::string(IMG_S_KW), tempString1 );
-   }
-
-   // OpenCV config
-   if( ap.read("--ocv_config_file", stringParam1))
-   {
-     m_kwl->addPair( std::string(OCV_CONFIG_FILE_KW), tempString1 );
-   }
-
-   // oax config
-   if( ap.read("--oax_config_file", stringParam1))
-   {
-     m_kwl->addPair( std::string(OAX_CONFIG_FILE_KW), tempString1 );
-   }
-
-   // llwh chipping parameters
-   if( ap.read("--roi-center-llwh", stringParam1, stringParam2, stringParam3, stringParam4) )
-   {
-      m_kwl->addPair( ROI_CENTER_LAT_KW, tempString1 );
-      m_kwl->addPair( ROI_CENTER_LON_KW, tempString2 );
-      m_kwl->addPair( ROI_WIDTH_KW,      tempString3 );
-      m_kwl->addPair( ROI_HEIGHT_KW,     tempString4 );
-   }
-
-   // llr chipping parameters
-   if( ap.read("--roi-center-llr", stringParam1, stringParam2, stringParam3) )
-   {
-      m_kwl->addPair( ROI_CENTER_LAT_KW, tempString1 );
-      m_kwl->addPair( ROI_CENTER_LON_KW, tempString2 );
-      m_kwl->addPair( ROI_RADIUS_KW,     tempString3 );
-   }
-
-   // TODO Necessary???
-   if( ap.read("--input-src", stringParam1) )
-   {
-      m_kwl->addPair( SRC_FILE_KW, tempString1 );
-   }
-
-   // TODO  For now, just an example of using ossimKeywordNames content
-   if( ap.read("--quality", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::QUALITY_KW), tempString1 );
-   }
-
-   //---
-   // Deprecated: "--options-keyword-list"
-   //---
-   if( ap.read("--options", stringParam1) )
-   {
-      ossimFilename optionsKwl = tempString1;
-      if ( optionsKwl.exists() )
-      {
-         if ( m_kwl->addFile(optionsKwl) == false )
-         {
-            std::string errMsg = "ERROR could not open options keyword list file: ";
-            errMsg += optionsKwl.string();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = "ERROR options keyword list file does not exists: ";
-         errMsg += optionsKwl.string();
-         throw ossimException(errMsg); 
-      }
-   }
-
-
-   // End of arg parsing.
-
-
-   ap.reportRemainingOptionsAsUnrecognized();
-   if ( ap.errors() )
-   {
-      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-      std::string errMsg = "Unknown option...";
-      throw ossimException(errMsg);
-   }
-
-
-   if ( ap.argc() >= 2 )
-   {
-      // Output file is last arg:
-      m_kwl->add( ossimKeywordNames::OUTPUT_FILE_KW, ap[ap.argc()-1]);
-   }
-   else
-   {
-      if ( !m_kwl->find(ossimKeywordNames::OUTPUT_FILE_KW) )
-      {
-         ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-         std::string errMsg = "Must supply an output file.";
-         throw ossimException(errMsg);
-      }
-   }
-
-   if ( ap.argc() > 2 ) // User passed inputs in front of output file.
-   {
-      int pos = 1; // ap.argv[0] is application name. 
-      while ( pos < (ap.argc()-1) )
-      {
-         ossimFilename file = ap[pos];
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "argv[" << pos << "]: " << file << "\n";
-         }
-         
-         if ( isSrcFile(file) ) 
-         {
-            if ( m_kwl->find( SRC_FILE_KW.c_str() ) ) // --input-src used also
-            {
-               std::string errMsg = MODULE;
-               errMsg += "ERROR Multiple src files passed in.  Please combine into one.";
-               throw ossimException(errMsg);
-            }
-            
-            m_kwl->addPair( SRC_FILE_KW, file.string() );
-         }
-         else // Add as an input image.
-         {
-            // key = IMG_KW;
-            // key += ossimString::toString(imgIdx);
-            // key += ".";
-            // key += FILE_KW;
-            // m_kwl->addPair(key.string(), file.string() );
-            // ++imgIdx;
-         }
-         
-         ++pos; // Go to next arg...
-         
-      } // End: while ( pos < (ap.argc()-1) )
-       
-   } // End: if ( ap.argc() > 2 )
-
-   initialize();
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
-   }  
-   return true;
-   
-} // End: void ossimAutRegUtil::initialize(ossimArgumentParser& ap)
-
-
-void ossimAutRegUtil::initialize( const ossimKeywordlist& kwl )
-{
-   clear();
-
-   // Start with clean options keyword list.
-   m_kwl->clear();
-
-   m_kwl->addList( kwl, true );
-
-   initialize();
-}
-
-
-
-void ossimAutRegUtil::initialize()
-{
-   static const char MODULE[] = "ossimAutRegUtil::initialize()";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   
-   if ( traceOptions() )
-   {
-      ossimFilename optionsFile;
-      getOutputFilename(optionsFile);
-      optionsFile = optionsFile.noExtension();
-      optionsFile += "-options.kwl";
-      ossimString comment = " Can be use for --options argument.";
-      m_kwl->write( optionsFile.c_str(), comment.c_str() );
-   }
-
-   // Determine the operation to do.
-   std::string op = m_kwl->findKey( OP_KW );
-   if ( op.size() )
-   {
-      ossimString s = op;
-      s.downcase();
-      
-      if ( s == "coreg" )
-      {
-         m_operation = OSSIM_AUTREG_OP_COREG;
-      }
-      else if ( s == "masreg" )
-      {
-         m_operation = OSSIM_AUTREG_OP_MASREG;
-      }
-      else
-      {
-         std::string errMsg = "unknown operation: ";
-         errMsg += s.string();
-         throw ossimException(errMsg);
-      }
-   }
-   else
-   {
-      std::string errMsg = "keyword not found: ";
-      errMsg += OP_KW;
-      errMsg += "\nUse --op option to specify operation.\n";
-      throw ossimException(errMsg);  
-   }
-
-   //---
-   // Report file
-   //---
-   ossimFilename repFile = m_kwl->findKey( REPORT_FILE_KW );
-
-   if (repFile.size())
-   {
-      m_rep = new ofstream( repFile.c_str(), ios::out );
-   }
-   else
-   {
-      m_rep = &std::cout;
-   }
-   *m_rep << "\n ossimAutRegUtil Summary..."<<std::endl;
-   ossimString ts;
-   ossim::getFormattedTime("%a %m.%d.%y %H:%M:%S", false, ts);
-   *m_rep << "\n" << ts;
-   *m_rep << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
-   *m_rep << endl;
-
-
-   //---
-   // Populate the m_srcKwl if --src option was set.
-   // Note do this before creating chains.
-   //---
-   initializeSrcKwl();
-   
-   //---
-   // Load OpenCV config if --ocv_config_file option was set.
-   //---
-   initializeOcvKwl();
-   
-   //---
-   // Load oax config if --oax_config_file option was set.
-   //---
-   initializeOaxKwl();
-
-
-   //---
-   // Load input image pair
-   //---
-   if (!loadImages())
-   {
-      throw ossimException("loadImages() failed...");
-   }
-
-//=========================================================
-// TODO...  Is there a possibility of ortho image input?
-//   What about associated geometry/adjustbale parameters?
-//=========================================================
-   //--
-   // Raw image input
-   //--
-   createIdentityProjection(0);
-   createIdentityProjection(1);
-
-
-   //---
-   // Determine overlap ROIs
-   //---
-   if (!delineateROIs())
-   {
-      throw ossimException("delineateROIs() failed...");
-   }
-
-
-   if ( traceLog() )
-   {
-      ossimKeywordlist logKwl;
-      // m_writer->saveStateOfAllInputs(logKwl);
-      
-      ossimFilename logFile;
-      getOutputFilename(logFile);
-      logFile.setExtension("log");
-
-      logKwl.write( logFile.c_str() );
-   }
-
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "options keyword list:\n"
-         << *(m_kwl.get()) << "\n";
-      
-      if ( m_srcKwl.valid() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "support record keyword list:\n"
-            << *(m_srcKwl.get()) << "\n";
-      }
-   }
-
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Instantiate ossimTieMeasurementGenerator
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    m_tGenObj = ossimObjectFactoryRegistry::instance()->
-      createObject(ossimString("ossimTieMeasurementGenerator"));
-   if(m_tGenObj.valid())
-   {
-      m_tGen = dynamic_cast<ossimTieMeasurementGeneratorInterface*> (m_tGenObj.get());
-   }
-   else
-   {
-      throw ossimException("ossimTieMeasurementGenerator createObject failed...");
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-
-} // End: void ossimAutRegUtil::initialize()
-
-
-
-//*****************************************************************************
-//  METHOD: ossimAutRegUtil::loadImages()
-//  
-//  Load image pair.
-//  
-//*****************************************************************************
-bool ossimAutRegUtil::loadImages()
-{
-   static const char MODULE[] = "ossimAutRegUtil::loadImages";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   bool isGoodLoad = false;
-   ossimFilename inputFile;
-
-   ossimString key;
-
-
-   // Load 1st image
-   if (m_operation == OSSIM_AUTREG_OP_COREG)
-   {
-      key = IMG_1_KW;
-   }
-   else  // Load master image
-   {
-      key = IMG_M_KW;
-      m_controlImage[0] = true;
-   }
-   inputFile = m_kwl->findKey(key.string());
-   if (addImgSource(inputFile, 0 ))
-   {
-      ossimImageHandler *ih1 = m_imgLayer[0]->getImageHandler().get();
-      if (!ih1)
-      {
-         *m_rep << " open for image 1 failed..."<<std::endl;
-      }
-      else
-      {
-         int overviews     = ih1->getNumberOfDecimationLevels();
-         ossimIrect bounds = ih1->getBoundingRect(0);
-         // ossimScalarType scalarType = ih1->getOutputScalarType();
-         ossimScalarTypeLut* lut = ossimScalarTypeLut::instance();
-         *m_rep << "-----------------" << endl
-                << "filename       = " << ih1->getFilename() << endl
-                << "width          = " << bounds.width() << endl
-                << "height         = " << bounds.height() << endl
-                << "overview count = " << (overviews-1) << endl
-                << "scalar type    = " << lut->getEntryString(ih1->getOutputScalarType()) << endl
-                << "Handler used   = " << ih1->getClassName() << endl;
-
-
-         // Load 2nd image
-         if (m_operation == OSSIM_AUTREG_OP_COREG)
-         {
-            key = IMG_2_KW;
-         }
-         else  // Load slave image
-         {
-            key = IMG_S_KW;
-            m_controlImage[1] = false;
-         }
-         inputFile = m_kwl->findKey(key.string());
-         if (addImgSource(inputFile, 0 ))
-         {
-            ossimImageHandler *ih2 = m_imgLayer[1]->getImageHandler().get();
-            if (!ih2)
-            {
-               *m_rep << " open for image 2 failed"<<std::endl;
-            }
-            else
-            {
-               int overviews     = ih2->getNumberOfDecimationLevels();
-               ossimIrect bounds = ih2->getBoundingRect(0);
-               // ossimScalarType scalarType = ih2->getOutputScalarType();
-               ossimScalarTypeLut* lut = ossimScalarTypeLut::instance();
-               *m_rep << "-----------------" << endl
-                      << "filename       = " << ih2->getFilename() << endl
-                      << "width          = " << bounds.width() << endl
-                      << "height         = " << bounds.height() << endl
-                      << "overview count = " << (overviews-1) << endl
-                      << "scalar type    = " << lut->getEntryString(ih2->getOutputScalarType()) << endl
-                      << "Handler used   = " << ih2->getClassName() << endl;
-               *m_rep << "-----------------" << endl;
-               isGoodLoad = true;
-            }
-         }
-      }  
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-   return isGoodLoad;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimAutRegUtil::delineateROIs()
-//  
-//  Determine correlation region of interest.
-//  
-//*****************************************************************************
-bool ossimAutRegUtil::delineateROIs()
-{
-   static const char MODULE[] = "ossimAutRegUtil::delineateROIs";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   bool isGoodOp = false;
-
-   for (int img=0; img<2; ++img)
-   {
-      ossimIrect rect;
-      rect.makeNan();
-   
-      ossimImageSource* source = m_imgLayer[img].get();
-      
-      if ( source )
-      {
-   
-         if ( m_geom[img].valid() )
-         {
-            if ( m_kwl->find( ROI_CENTER_LAT_KW.c_str() ) ) 
-            {
-               // "ROI Center" with: --roi-center-llwh or --roi-center-llr:
-               ossimString latStr = m_kwl->findKey( ROI_CENTER_LAT_KW );
-               ossimString lonStr = m_kwl->findKey( ROI_CENTER_LON_KW );
-               if ( latStr.size() && lonStr.size() )
-               {
-                  ossimGpt centerGpt;
-   
-                  //---
-                  // Want the height nan going into worldToLocal call so it gets picked
-                  // up by the elevation manager.
-                  //---
-                  centerGpt.makeNan(); 
-   
-                  centerGpt.lat = latStr.toFloat64();
-                  centerGpt.lon = lonStr.toFloat64();
-   
-                  if ( !centerGpt.isLatNan() && !centerGpt.isLonNan() )
-                  {
-                     // Ground "cut center" to view:
-                     ossimDpt centerDpt(0.0, 0.0);
-                     m_geom[img]->worldToLocal(centerGpt, centerDpt);
-   
-                     if ( !centerDpt.hasNans() )
-                     {
-                        // if ( isIdentity() && m_ivt.valid() ) // Chipping in image space.
-                        if ( m_ivt[img].valid() ) // Chipping in image space.
-                        {
-                           // Transform image center point to view:
-                           ossimDpt ipt = centerDpt;
-                           m_ivt[img]->imageToView( ipt, centerDpt );
-                        }
-                        
-                        // --roi-center-llwh:
-                        ossimString widthStr  = m_kwl->findKey( ROI_WIDTH_KW );
-                        ossimString heightStr = m_kwl->findKey( ROI_HEIGHT_KW );
-                        if ( widthStr.size() && heightStr.size() )
-                        {
-                           ossim_int32 width  = widthStr.toInt32();
-                           ossim_int32 height = heightStr.toInt32();
-                           if ( width && height )
-                           {
-                              ossimIpt ul( ossim::round<int>(centerDpt.x - (width/2)),
-                                           ossim::round<int>(centerDpt.y - (height/2)) );
-                              ossimIpt lr( (ul.x + width - 1), ul.y + height - 1);
-                              rect = ossimIrect(ul, lr);
-                           }
-                        }
-                        else // --roi-center-llr: 
-                        {
-                           ossimString radiusStr = m_kwl->findKey( ROI_RADIUS_KW );
-                           if ( radiusStr.size() )
-                           {
-                              ossim_float64 radius = radiusStr.toFloat64();
-                              if ( radius )
-                              {
-                                 ossimDpt mpp;
-                                 m_geom[0]->getMetersPerPixel( mpp );
-   
-                                 if ( !mpp.hasNans() )
-                                 {
-                                    ossim_float64 rx = radius/mpp.x;
-                                    ossim_float64 ry = radius/mpp.y;
-                                    
-                                    ossimIpt ul( ossim::round<int>( centerDpt.x - rx ),
-                                                 ossim::round<int>( centerDpt.y - ry ) );
-                                    ossimIpt lr( ossim::round<int>( centerDpt.x + rx ),
-                                                 ossim::round<int>( centerDpt.y + ry ) );
-                                    rect = ossimIrect(ul, lr);
-                                 }
-                              }
-                           }
-                        }
-                     }
-                     
-                  } // Matches: if ( !centerGpt.hasNans() )
-                  
-               } // Matches: if ( latStr && lonStr )
-               
-            } // Matches: if ( m_kwl->find( ROI_CENTER_LAT_KW ) )
-   
-         } // if ( igeom.valid() )
-   
-         else
-         {
-            // Should never happen...
-            std::string errMsg = MODULE;
-            if ( !source )
-            {
-               errMsg += " image source null!";
-            }
-            throw( ossimException(errMsg) );
-         }
-   
-         // rect.print(*m_rep);
-         m_roiRects.push_back(rect);
-      } // if ( source )
-
-   }
-
-   isGoodOp = true;
-
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-   return isGoodOp;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimAutRegUtil::populateObsSet()
-//  
-//  Transfer tie points from generator to observation set.
-//  
-//*****************************************************************************
-bool ossimAutRegUtil::populateObsSet()
-{
-   static const char MODULE[] = "ossimAutRegUtil::populateObsSet";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   bool isGoodLoad = true;
-
-   ossimString id;
-   ossimGpt gp;
-
-
-   for (int m=0; m<m_tGen->numMeasurements(); ++m)
-   {
-      id = ossimString::toString(m+1);
-
-      // Initialize ground point
-      gp.makeNan();
-      ossimPointObservation *pt = new ossimPointObservation(gp, id, m_LatLonHgtSigmas);
-
-      for (int img=0; img<2; ++img)
-      {
-         ossimDpt imgPt = m_tGen->pointIndexedAt(img,m);
-         // If control, set ground coordinates and reset sigmas
-         if (m_controlImage[img])
-         {
-            // Point drop to get control coordinates
-            ossimGpt worldPt;
-            m_geom[img]->localToWorld(imgPt, worldPt);
-            if (worldPt.isHgtNan())
-            {
-               ossim_float64 hgt =
-                  ossimElevManager::instance()->getHeightAboveEllipsoid(worldPt);
-               worldPt.height(hgt);
-            }
-            pt->Gpt() = worldPt;
-
-            // Set control sigmas
-            pt->setGroundSigmas
-               (m_LatLonHgtControlSigmas[0],m_LatLonHgtControlSigmas[1],m_LatLonHgtControlSigmas[2]);
-         }
-         else
-         {
-            // Get image filename
-            ossimFilename filename = m_imgLayer[img]->getImageHandler()->getFilename();
-            
-            // Add measurement to point observation
-            pt->addMeasurement(imgPt, filename);
-         }
-      }
-      // Add point observation to set
-      if (pt->numMeas() > 0)
-      {
-         m_obsSet->addObservation(pt);
-      }
-   }
-
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-   return isGoodLoad;
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimAutRegUtil::configureTieMeasGenerator()
-//  
-//  Configure the tie measurement generator using m_ocvKwl
-//  
-//*****************************************************************************
-void ossimAutRegUtil::configureTieMeasGenerator()
-{
-   static const char MODULE[] = "ossimAutRegUtil::configureTieMeasGenerator";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   if ( m_ocvKwl.valid() )
-   {
-
-      // Draw OpenCV match window
-      m_showMatchWindow = keyIsTrue(m_ocvKwl, OCV_DRAW_MATCHES_FLAG_KW);
-      m_tGen->setShowCvWindow(m_showMatchWindow);
-   
-      // OpenCV detector
-      if (m_ocvKwl->find(OCV_DETECTOR_NAME_KW.c_str()))
-      {
-         m_tGen->setFeatureDetector(m_ocvKwl->findKey(OCV_DETECTOR_NAME_KW));
-      }
-   
-      // OpenCV descriptor/extractor
-      if (m_ocvKwl->find(OCV_EXTRACTOR_NAME_KW.c_str()))
-      {
-         m_tGen->setDescriptorExtractor(m_ocvKwl->findKey(OCV_EXTRACTOR_NAME_KW));
-      }
-   
-      // OpenCV matcher
-      if (m_ocvKwl->find(OCV_MATCHER_NAME_KW.c_str()))
-      {
-         m_tGen->setDescriptorMatcher(m_ocvKwl->findKey(OCV_MATCHER_NAME_KW));
-      }
-
-      // OpenCV maximum number of matches
-      if (m_ocvKwl->find(OCV_MAX_MATCHES_KW.c_str()))
-      {
-         ossimString maxMatches = m_ocvKwl->findKey(OCV_MAX_MATCHES_KW);
-         if (maxMatches.size())
-         {
-            ossim_int32 max  = maxMatches.toInt32();
-            m_tGen->setMaxMatches(max);
-         }
-      }
-   
-      // TODO: set crossCheck currently commented out in ossimTieMeasurementGenerator
-      // m_tGen->setUseCrossCheck(keyIsTrue(m_ocvKwl, OCV_USE_CROSS_CHECK_KW));
-   
-      // Use OpenCV GridAdaptedFeatureDetector
-      m_tGen->setUseGrid(keyIsTrue(m_ocvKwl, OCV_USE_GRID_ADAPTED_DETECT_KW));
-
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimAutRegUtil::configureAdjustmentExecutive()
-//  
-//  Configure the adjustment executive using m_oaxKwl
-//  
-//*****************************************************************************
-void ossimAutRegUtil::configureAdjustmentExecutive()
-{
-   static const char MODULE[] = "ossimAutRegUtil::configureAdjustmentExecutive";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   if ( m_oaxKwl.valid() )
-   {
-
-      if (m_oaxKwl->find(OAX_MAX_ITERATIONS_KW.c_str()))
-      {
-         ossimString maxIter = m_oaxKwl->findKey(OAX_MAX_ITERATIONS_KW);
-         if (maxIter.size())
-         {
-            ossim_int32 max  = maxIter.toInt32();
-            m_adjExec->setMaxIter(max);
-         }
-      }
-
-      if (m_oaxKwl->find(OAX_CONVERGENCE_CRITERIA_KW.c_str()))
-      {
-         ossimString conv = m_oaxKwl->findKey(OAX_CONVERGENCE_CRITERIA_KW);
-         if (conv.size())
-         {
-            ossim_float64 convPerc = conv.toFloat64();
-            m_adjExec->setConvCriteria(convPerc);
-         }
-      }
-
-      if (m_oaxKwl->find(OAX_GROUND_SIGMA_KW.c_str()))
-      {
-         ossimString conv = m_oaxKwl->findKey(OAX_GROUND_SIGMA_KW);
-         if (conv.size())
-         {
-            ossim_float64 gndSigma = conv.toFloat64();
-            m_LatLonHgtSigmas[0] = gndSigma;
-            m_LatLonHgtSigmas[1] = gndSigma;
-            m_LatLonHgtSigmas[2] = gndSigma;
-         }
-      }
-
-      if (m_oaxKwl->find(OAX_CONTROL_SIGMA_KW.c_str()))
-      {
-         ossimString conv = m_oaxKwl->findKey(OAX_CONTROL_SIGMA_KW);
-         if (conv.size())
-         {
-            ossim_float64 gndSigma = conv.toFloat64();
-            m_LatLonHgtControlSigmas[0] = gndSigma;
-            m_LatLonHgtControlSigmas[1] = gndSigma;
-            m_LatLonHgtControlSigmas[2] = gndSigma;
-         }
-      }
-
-      if (m_oaxKwl->find(OAX_LAT_SIGMA_KW.c_str()))
-      {
-         ossimString conv = m_oaxKwl->findKey(OAX_LAT_SIGMA_KW);
-         if (conv.size())
-         {
-            ossim_float64 gndLatSigma = conv.toFloat64();
-            m_LatLonHgtSigmas[0] = gndLatSigma;
-         }
-      }
-
-      if (m_oaxKwl->find(OAX_LON_SIGMA_KW.c_str()))
-      {
-         ossimString conv = m_oaxKwl->findKey(OAX_LON_SIGMA_KW);
-         if (conv.size())
-         {
-            ossim_float64 gndLonSigma = conv.toFloat64();
-            m_LatLonHgtSigmas[1] = gndLonSigma;
-         }
-      }
-
-      if (m_oaxKwl->find(OAX_HGT_SIGMA_KW.c_str()))
-      {
-         ossimString conv = m_oaxKwl->findKey(OAX_HGT_SIGMA_KW);
-         if (conv.size())
-         {
-            ossim_float64 gndHgtSigma = conv.toFloat64();
-            m_LatLonHgtSigmas[2] = gndHgtSigma;
-         }
-      }
-
-   }
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-}
-
-
-//*****************************************************************************
-//  METHOD: ossimAutRegUtil::execute()
-//  
-//  Execute registration operation.
-//*****************************************************************************
-void ossimAutRegUtil::execute()
-{
-   static const char MODULE[] = "ossimAutRegUtil::execute";
-
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Initialize the measurement generator
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   *m_rep<<"\n\n >> Tie point collection follows...\n"<<endl;
-   m_tGen->init(*m_rep);
-
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Configure the measurement generator
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   configureTieMeasGenerator();
-
-
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Load ossimImageSource vector
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   std::vector<ossimImageSource*> src;
-   src.push_back(m_imgLayer[0].get());
-   src.push_back(m_imgLayer[1].get());
-
-
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Set correlation areas
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   int primeIndex = 0; //TODO
-   m_tGen->setBox(m_roiRects, primeIndex, src);
-
-
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   // Run the OpenCV detector/extractor/matcher to collect tiepoints
-   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-   if (m_tGen->run())
-   {
-
-      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      // Close match window if active
-      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      if (m_showMatchWindow)
-      {
-         bool waitKey = true;
-         m_tGen->closeCvWindow(waitKey);
-      }
-
-      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      // Check for adjustable parameter interface before adjustment
-      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      ossimAdjustableParameterInterface* iface1 = m_geom[0]->getAdjustableParameterInterface();
-      ossimAdjustableParameterInterface* iface2 = m_geom[1]->getAdjustableParameterInterface();
-      
-      if (iface1 && iface2)
-      {
-
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         // Create observation set
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         m_obsSet = new ossimObservationSet;
-
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         // Create adjustment executive
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         m_adjExec = new ossimAdjustmentExecutive(*m_rep);
-
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         // Configure adjustment executive
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         configureAdjustmentExecutive();
-
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         // Load measurements into the observation set
-         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-         if (populateObsSet())
-         {
-   
-            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-            // Perform adjustment
-            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-            bool solutionOK = false;
-         
-            *m_rep<<"\n\n >> Adjustment summary follows...\n"<<endl;
-            if (m_adjExec->initializeSolution(*m_obsSet))
-            {
-               solutionOK = m_adjExec->runSolution();
-               m_adjExec->summarizeSolution();
-               if (solutionOK)
-               {
-                  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-                  // Write updated geometry files
-                  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-                  saveAdjustment();
-
-                  if (traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "Solution complete...\n";
-                  }   
-               }
-               else
-               {
-                  throw ossimException("m_adjExec->runSolution() failed...");
-               } //end if m_adjExec->runSolution()
-            }
-            else
-            {
-               throw ossimException("m_adjExec->initializeSolution() failed...");
-            } //end if m_adjExec->initializeSolution()
-      
-         } 
-         else
-         {
-            throw ossimException("populateObsSet() failed...");
-         } //end if (populateObsSet())
-
-      }
-      else
-      {
-         throw ossimException("ossimAdjustableParameterInterface missing...");
-      } //end if (iface1 && iface2)
-
-   }
-   else
-   {
-      throw ossimException( "m_tGen->run() failed...");
-   } //end if (m_tGen->run())
-   
-   if (traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-}
-
-
-void ossimAutRegUtil::saveAdjustment()
-{
-   ossimString ts;
-   ossim::getFormattedTime("ossim-autreg_%a_%m.%d.%y_%H:%M:%S", false, ts);
- 
-   ossimAdjustmentInfo* adjInfo = new ossimAdjustmentInfo;
-
-   for (int img=0; img<2; ++img)
-   {
-      if (!m_controlImage[img])
-      {
-         // Get the adjustment info from the bundle adjustment via m_obsSet
-         ossimFilename filename = m_imgLayer[img]->getImageHandler()->getFilename();
-
-         ossimAdjustableParameterInterface* adjParIface;
-
-         for (ossim_uint32 ii=0; ii<m_obsSet->numImages(); ++ii)
-         {
-            if (filename == m_obsSet->imageFile(ii))
-               adjParIface = m_obsSet->getImageGeom(ii)->getAdjustableParameterInterface();
-         }
-
-         adjParIface->setAdjustmentDescription(ts);
-         adjParIface->getAdjustment(*adjInfo);
-   
-         // Grab adjustable parameter interface and update it with the adjustment info
-         ossimAdjustableParameterInterface* iface = m_geom[img]->getAdjustableParameterInterface();
-         iface->setAdjustment(*adjInfo, true);
-
-         if (iface)
-         {
-            ossimFilename fn = m_imgLayer[img]->getImageHandler()->createDefaultGeometryFilename();
-// TODO ***********
-//  dirty flag????
-// fn += "_test";
-// TODO ***********
-            ossimKeywordlist kwl;
-            iface->getBaseObject()->saveState(kwl);
-            kwl.write(fn);
-         }
-      }
-   }
-
-   delete adjInfo;
-}
-
-
-void ossimAutRegUtil::getOutputFilename(ossimFilename& f) const
-{
-   f.string() = m_kwl->findKey( std::string(ossimKeywordNames::OUTPUT_FILE_KW) );
-}
-
-
-bool ossimAutRegUtil::isSrcFile(const ossimFilename& file) const
-{
-   bool result = false;
-   ossimString ext = file.ext();
-   ext.downcase();
-   if ( ext == "src" )
-   {
-      result = true;
-   }
-   return result;
-}
-
-
-void ossimAutRegUtil::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-   
-   // Set app name.
-   std::string appName = ap.getApplicationName();
-   ap.getApplicationUsage()->setApplicationName( ossimString( appName ) );
-
-   // Add options.
-   addArguments(ap);
-   
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-
-   // Keeping single line in tact for examples for cut and paste purposes.
-   ossimNotify(ossimNotifyLevel_INFO)
-      << "NOTES:\n"
-      << "1) Note 1 content\n"
-      << "   Note 1 place holder continued...\n"
-      << "2) Note 2 content\n"
-      << "   Note 2 place holder continued...\n"
-      
-      << "\nExample commands:\n"
-
-      << "\n// Co-register image1 and image2 with 512x512 ROIs centered on point:\n"
-      << appName << " --op coreg --img_1 image1.ntf --img_2 image2.ntf --roi-center-llwh 28.097255037664400 -80.630762190246145 512 512\n"
-
-      << "\n// Register image2 to control image1 (master): (TBD... not working)\n"
-      << appName << " --op masreg -img_m image1.ntf -img_s image2.ntf -cfg configFile.kwl\n"
-
-      << "\n// Above command where all options are in a keyword list:\n"
-      << appName << " --options autreg-options.kwl\n"
-      << std::endl;
-}
-
-
-void  ossimAutRegUtil::initializeSrcKwl()
-{
-   static const char MODULE[] = "ossimAutRegUtil::initializeSrcKwl";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\n";
-   }
-
-   std::string value = m_kwl->findKey(std::string(SRC_FILE_KW));
-   if ( value.size() )
-   {
-      m_srcKwl = new ossimKeywordlist();
-      m_srcKwl->setExpandEnvVarsFlag(true);
-      if ( m_srcKwl->addFile( value.c_str() ) == false )
-      {
-         m_srcKwl = 0;
-      }
-   }
-   else
-   {
-      m_srcKwl = 0; 
-   }
-
-   if ( traceDebug() )
-   {
-      if ( m_srcKwl.valid() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "src keyword list:\n" << *(m_srcKwl.get()) << "\n";
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exited...\n";
-   }
-}
-
-
-void  ossimAutRegUtil::initializeOcvKwl()
-{
-   static const char MODULE[] = "ossimAutRegUtil::initializeOcvKwl";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\n";
-   }
-
-   std::string value = m_kwl->findKey(std::string(OCV_CONFIG_FILE_KW));
-   if ( value.size() )
-   {
-      m_ocvKwl = new ossimKeywordlist();
-      m_ocvKwl->setExpandEnvVarsFlag(true);
-      if ( m_ocvKwl->addFile( value.c_str() ) == false )
-      {
-         m_ocvKwl = 0;
-      }
-   }
-   else
-   {
-      m_ocvKwl = 0; 
-   }
-
-   if ( traceDebug() )
-   {
-      if ( m_ocvKwl.valid() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "ocv keyword list:\n" << *(m_ocvKwl.get()) << "\n";
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exited...\n";
-   }
-}
-
-
-void  ossimAutRegUtil::initializeOaxKwl()
-{
-   static const char MODULE[] = "ossimAutRegUtil::initializeOaxKwl";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\n";
-   }
-
-   std::string value = m_kwl->findKey(std::string(OAX_CONFIG_FILE_KW));
-   if ( value.size() )
-   {
-      m_oaxKwl = new ossimKeywordlist();
-      m_oaxKwl->setExpandEnvVarsFlag(true);
-      if ( m_oaxKwl->addFile( value.c_str() ) == false )
-      {
-         m_oaxKwl = 0;
-      }
-   }
-   else
-   {
-      m_oaxKwl = 0; 
-   }
-
-   if ( traceDebug() )
-   {
-      if ( m_oaxKwl.valid() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "oax keyword list:\n" << *(m_oaxKwl.get()) << "\n";
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exited...\n";
-   }
-}
-
-
-bool ossimAutRegUtil::addImgSource(const ossimFilename& file, ossim_uint32 entryIndex)
-{
-   static const char MODULE[] = "ossimAutRegUtil::addImgSource";
-
-   bool addOK = false;
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\nFile: " << file << "\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(file, entryIndex);
-   if ( ic.valid() )
-   {
-      m_imgLayer.push_back(ic);
-      addOK = true;
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-
-   return addOK;
-}
-
-
-void ossimAutRegUtil::setReaderProps( ossimImageHandler* ih ) const
-{
-   if ( ih && m_kwl.valid() )
-   {
-      ossim_uint32 count = m_kwl->numberOf( READER_PROPERTY_KW.c_str() );
-      for (ossim_uint32 i = 0; i < count; ++i)
-      {
-         ossimString key = READER_PROPERTY_KW;
-         key += ossimString::toString(i);
-         ossimString value = m_kwl->findKey( key.string() );
-         if ( value.size() )
-         {
-            std::vector<ossimString> splitArray;
-            value.split(splitArray, "=");
-            if(splitArray.size() == 2)
-            {
-               ossimRefPtr<ossimProperty> prop =
-                  new ossimStringProperty(splitArray[0], splitArray[1]);
-               
-               ih->setProperty( prop );
-            }
-         }
-      }
-   }
-}
-
-
-bool ossimAutRegUtil::setChainEntry(
-   ossimRefPtr<ossimSingleImageChain>& chain, ossim_uint32 entryIndex ) const
-{
-   bool result = false;
-   if ( chain.valid() )
-   {
-      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
-      if ( ih.valid() )
-      {
-         result = ih->setCurrentEntry( entryIndex );
-      }
-   }
-   return result;
-}
-
-ossimRefPtr<ossimSingleImageChain> ossimAutRegUtil::createChain(const ossimFilename& file,
-                                                                 ossim_uint32 entryIndex) const
-{
-   static const char MODULE[] = "ossimAutRegUtil::createChain(const ossimFilename&";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\nfile: " << file
-         << "\nentry: " << entryIndex
-         << "\n";
-   }   
-   
-   ossimRefPtr<ossimSingleImageChain> ic = 0;
-
-   if ( file.size() )
-   {
-      if ( file.exists() )
-      {
-         ic = new ossimSingleImageChain;
-         if ( ic->open( file ) )
-         {
-            // Set any reader props:
-            setReaderProps( ic->getImageHandler().get() );
-            
-            // we can't guarantee the state of the image handler at this point so
-            // let's make sure that the entry is always set to the requested location
-            //  On Cib/Cadrg we were having problems.  Removed the compare for entry 0
-            //
-             if ( setChainEntry( ic, entryIndex ) == false )
-             {
-                std::ostringstream errMsg;
-                errMsg << MODULE << " ERROR:\nEntry " << entryIndex << " out of range!"
-                       << std::endl;
-                throw ossimException( errMsg.str() );
-             }
-
-            
-            // Always have resampler cache.
-            ic->setAddResamplerCacheFlag(true);
-
-            //---
-            // Don't need a chain cache as we're doing a sequential write.  So the same tile
-            // should never be visited more than once.
-            //---
-            ic->setAddChainCacheFlag(false);
-
-
-            // // Brightness, contrast. Note in same filter.
-            // if ( hasBrightnesContrastOperation() )
-            // {
-            //    ic->setBrightnessContrastFlag(true);
-            // }
-
-            // std::string sharpnessMode = getSharpenMode();
-            // if ( sharpnessMode.size() )
-            // {
-            //    ic->setSharpenFlag(true);
-            // }
-
-            // Create the chain.
-            ic->createRenderedChain();
-
-
-            // // Histogram setup.
-            // if ( hasHistogramOperation() )
-            // {
-            //    setupChainHistogram( ic );
-            // }
-
-            // // Brightness contrast setup:
-            // if ( hasBrightnesContrastOperation() )
-            // {
-            //    // Assumption bright contrast filter in chain:
-               
-            //    ossim_float64 value = getBrightness();
-            //    ic->getBrightnessContrast()->setBrightness( value );
-               
-            //    value = getContrast();
-            //    ic->getBrightnessContrast()->setContrast( value );
-            // }
-
-            // // Sharpness:
-            // if ( sharpnessMode.size() )
-            // {
-            //    if ( sharpnessMode == "light" )
-            //    {
-            //       ic->getSharpenFilter()->setWidthAndSigma( 3, 0.5 );
-            //    }
-            //    else if ( sharpnessMode == "heavy" )
-            //    {
-            //       ic->getSharpenFilter()->setWidthAndSigma( 5, 1.0 );
-            //    }
-            // }
-         }
-      }
-   }
-
-   if ( ic.valid() == false )
-   {
-      std::string errMsg = "Could not open: ";
-      errMsg += file.string();
-      throw ossimException(errMsg); 
-   }
-
-   if ( traceDebug() )
-   {
-      ossimKeywordlist kwl;
-      ic->saveState(kwl, 0);
-
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "chain:\n" << kwl << "\n"
-         << MODULE << " exiting...\n";
-   }   
-
-   return ic;
-}
-
-
-void ossimAutRegUtil::createIdentityProjection(int idx)
-{
-   static const char MODULE[] = "ossimAutRegUtil::createIdentityProjection";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   // Get the singe image chain.  Should be only one.
-   ossimRefPtr<ossimSingleImageChain> sic = 0;
-   if ( m_imgLayer.size() )
-   {
-      sic = m_imgLayer[idx];
-   }
-
-   if ( sic.valid() )
-   {
-      // Get the image handler.
-      ossimRefPtr<ossimImageHandler>  ih = sic->getImageHandler();
-
-      // Resampler:
-      ossimRefPtr<ossimImageRenderer> resampler = sic->getImageRenderer();
-
-      if ( ih.valid() )
-      {
-         //---
-         // Get the geometry from the image handler.  Since we're in "identity"
-         // mode use the inputs for the outputs.
-         //---
-         m_geom[idx] = ih->getImageGeometry();
-
-         if ( m_geom[idx].valid() )
-         {
-            // Get the image projection.
-            ossimRefPtr<ossimProjection> proj = m_geom[idx]->getProjection();
-            if ( proj.valid() )
-            {
-               ossim_float64 rotation = 0.0;
-               
-               ossimDrect rect;
-               m_geom[idx]->getBoundingRect(rect);
-               ossimDpt midPt = rect.midPoint();
-               
-               if ( traceDebug() )
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << MODULE
-                     << "\nAffine transform parameters:"
-                     << "\nrotation:  " << rotation
-                     << "\nmid point: " << midPt << std::endl;
-               }
-               
-               m_ivt[idx] = new ossimImageViewAffineTransform(-rotation,
-                                                              1.0, 1.0, // image space scale x and y
-                                                              1.0, 1.0, //scale x and y
-                                                              0.0, 0.0, // translate x,y
-                                                              midPt.x, midPt.y); // pivot point
-               
-               resampler->setImageViewTransform( m_ivt[idx].get() );
-            }
-
-         } // Matches: if ( m_geom.valid() )
-         
-      } // Matches: if ( ih.valid() )
-      
-   } // Matches: if ( sic.valid() 
-   
-} // End: createIdentityProjection()
-
-
-bool ossimAutRegUtil::keyIsTrue(ossimRefPtr<ossimKeywordlist> kwl, const std::string& key ) const
-{
-   bool result = false;
-   if ( kwl.valid() )
-   {
-      std::string value = kwl->findKey( key );
-      if ( value.size() )
-      {
-         result = ossimString(value).toBool();
-      }
-   }
-   return result;
-}
-
diff --git a/ossim/src/ossim/util/ossimBatchTest.cpp b/ossim/src/ossim/util/ossimBatchTest.cpp
deleted file mode 100644
index 99b0368..0000000
--- a/ossim/src/ossim/util/ossimBatchTest.cpp
+++ /dev/null
@@ -1,1257 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File ossim-batch-test.cpp
-// 
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken, Oscar Kramer
-//
-// Description: Test code application ossim batch test.
-//
-//----------------------------------------------------------------------------
-// $Id: ossim-batch-test.cpp 3112 2012-01-26 17:28:00Z david.burken $
-
-#include <ossim/util/ossimBatchTest.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimEnvironmentUtility.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/init/ossimInit.h>
-
-#include <cstdlib> /* for system() */
-#include <ctime>
-#include <iomanip>
-#include <iostream>
-#include <string>
-#include <sstream>
-
-using namespace std;
-
-//**************************************************************************************************
-// Constructor
-//**************************************************************************************************
-ossimBatchTest::ossimBatchTest()
-   :
-   m_acceptTestList(),
-   m_cleanTestList(),
-   m_preprocessTestList(),
-   m_runTestList(),
-   m_templateModeActive(false),
-   m_configFileName(),
-   m_outDir(),
-   m_expDir(),
-   m_logStr()
-{
-}
-
-//**************************************************************************************************
-// Initialize parses the command line. Returns true if status OK.
-//**************************************************************************************************
-bool ossimBatchTest::initialize(ossimArgumentParser& ap)
-{
-   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
-   {
-      usage(ap);
-
-      // continue_after_init to false
-      return false;
-   }
-
-   // Initialize environment:
-#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
-   _putenv("DEL_CMD=del /Q"); // For backwards compatiblity.
-   _putenv("DIFF_CMD=fc /W");
-   _putenv("COPY_CMD=copy /Y");
-   _putenv("MKDIR_CMD=mkdir");
-   _putenv("RM_CMD=del /Q");
-   _putenv("RMDIR_CMD=rmdir /S /Q");
-   
-#else
-   setenv("DEL_CMD",  "rm -rf",    1); // For backwards compatiblity.
-   setenv("DIFF_CMD",  "diff -w",  1);
-   setenv("COPY_CMD",  "cp",       1);
-   setenv("MKDIR_CMD", "mkdir -p", 1);
-   setenv("RM_CMD",    "rm -f",    1);
-   setenv("RMDIR_CMD", "rm -rf",   1);
-   
-#endif
-   
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   
-   if (ap.read("-W", stringParam) || ap.read("-W"))
-   {
-      ossimFilename templateFile (tempString.c_str());
-      if (templateFile.empty())
-         templateFile = "obt_config_long_template.kwl";
-      m_templateModeActive = true;
-      writeTemplate(templateFile, true);
-      return true;
-   }
-   if (ap.read("-w", stringParam) || ap.read("-w"))
-   {
-      ossimFilename templateFile(tempString.c_str());
-      if (templateFile.empty())
-         templateFile = "obt_config_short_template.kwl";
-      m_templateModeActive = true;
-      writeTemplate(templateFile, false);
-      return true;
-   }
-   
-   while ( ap.read("-a", stringParam) || ap.read("--accept-test", stringParam) )
-   {
-      if ( tempString.size() )
-      {
-         ossimString os = tempString;
-         ossimString separatorList = " ";
-         std::vector<ossimString> result;
-         os.split(result, separatorList);
-         std::vector<ossimString>::const_iterator i = result.begin();
-         while ( i != result.end() )
-         {
-            m_acceptTestList.push_back((*i));
-            ++i;
-         }
-      }
-   }
-
-   while ( ap.read("-c", stringParam) || ap.read("--clean-test", stringParam) )
-   {
-      if ( tempString.size() )
-      {
-         ossimString os = tempString;
-         ossimString separatorList = " ";
-         std::vector<ossimString> result;
-         os.split(result, separatorList);
-         std::vector<ossimString>::const_iterator i = result.begin();
-         while ( i != result.end() )
-         {
-            m_cleanTestList.push_back((*i));
-            ++i;
-         }
-      }
-   }
-
-   while ( ap.read("-p", stringParam) || ap.read("--preprocess-test", stringParam) )
-   {
-      if ( tempString.size() )
-      {
-         ossimString os = tempString;
-         ossimString separatorList = " ";
-         std::vector<ossimString> result;
-         os.split(result, separatorList);
-         std::vector<ossimString>::const_iterator i = result.begin();
-         while ( i != result.end() )
-         {
-            m_preprocessTestList.push_back((*i));
-            ++i;
-         }
-      }
-   }
-
-   while ( ap.read("-r", stringParam) || ap.read("--run-test", stringParam) )
-   {
-      if ( tempString.size() )
-      {
-         ossimString os = tempString;
-         ossimString separatorList = " ";
-         std::vector<ossimString> result;
-         os.split(result, separatorList);
-         std::vector<ossimString>::const_iterator i = result.begin();
-         while ( i != result.end() )
-         {
-            m_runTestList.push_back((*i));
-            ++i;
-         }
-      }
-   }
-
-   // End of arg parsing.
-   ap.reportRemainingOptionsAsUnrecognized();
-   if ( ap.errors() )
-   {
-      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-      return false;
-   }
-
-   if (ap.argc() > 1 )
-   {
-      m_configFileName = ap.argv()[1];
-   }
-   else
-   {
-      usage(ap);
-
-      // continue_after_init to false
-      return false;
-   }
-
-   // Special command line case: When only a config filename is provided, this implies "run all 
-   // tests".
-   if (m_cleanTestList.empty()  && m_preprocessTestList.empty() &&
-       m_acceptTestList.empty() && m_runTestList.empty() && m_configFileName.size())
-   {
-      m_runTestList.push_back("all");
-   }
-
-   return true;
-}
-
-//**************************************************************************************************
-// Writes a template (either long form or short) to the file name specified.
-//**************************************************************************************************
-void ossimBatchTest::writeTemplate(const ossimFilename& templateFile, bool write_long_form)
-{
-   if (templateFile.exists())
-   {
-      ossimString del_cmd ("$(RM_CMD) ");
-      del_cmd += templateFile;
-      del_cmd = del_cmd.expandEnvironmentVariable();
-      if (system(del_cmd.chars()) != 0)
-      {
-         cerr << "ERROR: Could not delete existing template file before writing new template."
-            " Please delete the existing and rerun the command."<< endl;
-         return;
-      }
-   }
-
-   std::ofstream out(templateFile.c_str());
-   if ( !out.good() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "Could not open: " << templateFile.c_str() << std::endl;
-      return;
-   }
-
-   if (write_long_form)
-   {
-      out<< "//===================================================================================\n"
-         << "// \n"
-         << "// File: " << templateFile.c_str() << "\n"
-         << "// Generated by command: ossim-batch-test -W " << templateFile.c_str() << "\n"
-         << "// Description: ossim-batch-test template config file.\n"
-         << "// \n"
-         << "// Control flags:\n"
-         << "// Use 1 or true, 0 or false to turn on and off sections.\n"
-         << "// Typically preprocess and expected results only turned on for first run.\n"
-         << "// Clean commands should erase anything created by this test.\n"
-         << "// Command order if flag turned on:\n"
-         << "// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process\n"
-         << "// \n"
-         << "// NOTES:\n"
-         << "// * The following environment variables must be set before running batch test:\n"
-         << "//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data\n"
-         << "//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, \n"
-         << "//                               out and log),\n"
-         << "// \n"
-         << "// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to\n"
-         << "//   the proper paths according to the config filename. It isn't required to replace\n"
-         << "//   these nor predefine them in the environment. You can leave them as is or modify\n"
-         << "//   the paths to your unconventional file paths.\n"
-         << "// \n"
-         << "// * In order to preserve platform independence, please utilize the following \n"
-         << "//   variables for the common OS commands when adding new commands to the test\n"
-         << "//   configuration KWL file. Examples are provided in this template\n"
-         << "//       $(DIFF_CMD) Use this var for windows \"fc\" or linux \"diff\"\n"
-         << "//       $(COPY_CMD) Use this var for windows \"copy\" or linux \"cp\"\n"
-         << "//       $(MKDIR_CMD) Use this var for windows \"mkdir\" or linux \"mkdir\"\n"
-         << "//       $(RM_CMD) Use this var for windows \"del /Q\" or linux \"rm -f\"\n"
-         << "//       $(RMDIR_CMD) Use this var for windows \"rmdir /S /Q\" or linux \"rm -rf\"\n"
-         << "//   This application will set the environment variables to the proper values at \n"
-         << "//   runtime, so no need to worry about defining these.\n"
-         << "// \n"
-         << "// * Use forward slashes \"//\", at beginning of line for comments.\n"
-         << "// \n"
-         << "// * You can use existing environment variables as $(YOUR_VARIABLE). They will be \n"
-         << "//   expanded at run time if valid.\n"
-         << "// \n"
-         << "// * Clean, preprocess, run, and accept test sections can be switched on or off\n"
-         << "//   at run time.  These override config file flags.  Optional arguments are the \n"
-         << "//   the following: \n"
-         << "//      -c or --clean-test \n"
-         << "//      -p or --preprocess-test\n"
-         << "//      -r or --run-test \n"
-         << "//      -a or --accept-test \n"
-         << "//   Multiple tests can be entered by quoting string of space-separated\n"
-         << "//   test names, e.g. \"test1 test2\". To do all tests use \"all\" or leave blank.\n"
-         << "// \n"
-         << "//===================================================================================\n"
-         << "\n"
-         << "// If the config file will contain only a list of subordinate config files to be\n"
-         << "// run as one consolidated \"super-test\", then use only the following suffixed\n"
-         << "// keywords. Otherwise, REMOVE THESE:\n"
-         << "test_config_file1: <my_first_test_config.kwl>\n"
-         << "test_config_file2: <my_second_test_config.kwl>\n"
-         << "// ... etc.\n"
-         << "\n"
-         << "// The remaining keywords are used exclusive of \"test_config_fileX\" above. The\n"
-         << "// config files must be either a list of subordinate configs, or a concrete, \n"
-         << "// low-level config file.\n"
-         << "\n"
-         << "// Where you want the top-level (inter-test) log files to go:\n"
-         << "log_directory: $(OBT_OUT_DIR)\\..\\log\n"
-         << "\n"
-         << "//===================================================================================\n"
-         << "// Begin Test 1\n"
-         << "// NOTE: If the config file contains just a single test, then the use of the \"test1\"\n"
-         << "// prefix is optional. Make sure the results directory spec reflects the proper path.\n"
-         << "\n"
-         << "test1.name: <YOUR_TEST_NAME>\n"
-         << "test1.description: Test height for the center of the image for test2 and test3.\n"
-         << "\n"
-         << "// Controls/turns on/off whole test (all sections):\n"
-         << "test1.enabled: 1\n"
-         << "\n"
-         << "// Individual control flags:\n"
-         << "test1.run_clean_commands: 0\n"
-         << "test1.run_preprocessing_commands: 0\n"
-         << "test1.run_expected_results_commands: 0\n"
-         << "test1.run_test_commands: 1\n"
-         << "test1.run_postprocessing_commands: 1\n"
-         << "\n"
-         << "// Temp file to catch diff output.\n"
-         << "test1.temp_file: $(TEMP)\\tmp.txt\n"
-         << "\n"
-         << "// Clean up commands\n"
-         << "test1.clean_command1: $(RMDIR_CMD) $(OBT_OUT_DIR)\n"
-         << "\n"
-         << "// Pre-process commands\n"
-         << "test1.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)\n"
-         << "test1.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)\\..\\log\n"
-         << "\n"
-         << "//---------------------------------------\n"
-         << "// Commands to generate expected results\n"
-         << "//---------------------------------------\n"
-         << "// Since test2 and test3 are dependent on elevation test the center of the image.\n"
-         << "test1.expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OBT_EXP_DIR)\\height.txt\n"
-         << "test1.expected_results_command1: $(COPY_CMD) $(OBT_OUT_DIR)\\height.txt $(OBT_EXP_DIR)\\height.txt\n"
-         << "\n"
-         << "//---------------------------------------\n"
-         << "// The actual commands to test\n"
-         << "//---------------------------------------\n"
-         << "test1.test_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n"
-         << "\n"
-         << "//-------------------------------------------\n"
-         << "// Post process commands for diffs, etc.\n"
-         << "//-------------------------------------------\n"
-         << "test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)\\height.txt $(OBT_OUT_DIR)\\height.txt\n"
-         << " \n"
-         << "\n"
-         << "// End <TEST_NAME>\n"
-         << "//===================================================================================\n"
-         << "// Begin <TEST2_NAME>...\n"
-         << "\n"
-         << "// You can specify additional tests by copying the test1 keywords and changing the\n"
-         << "// prefix indices to be unique. It is not necessary to be consecutive.\n"
-         << "\n"
-         << std::endl;
-   }
-   else 
-   {
-      out<< "//===================================================================================\n"
-         << "// \n"
-         << "// File: " << templateFile.c_str() << "\n"
-         << "// Generated by command: ossim-batch-test -w " << templateFile.c_str() << "\n"
-         << "// Description: ossim-batch-test template config file.\n"
-         << "// \n"
-         << "// NOTES:\n"
-         << "// * The following environment variables must be set before running batch test:\n"
-         << "//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data\n"
-         << "//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, \n"
-         << "//                               out and log),\n"
-         << "// \n"
-         << "// * You can use existing environment variables as $(YOUR_VARIABLE). They will be \n"
-         << "//   expanded at run time if valid.\n"
-         << "// \n"
-         << "// * If the config file contains more than a single test, then it will be necessary \n" 
-         << "//   to prefix all test-specific keywords with \"testN.\"\n"
-         << "// \n"
-         << "// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to\n"
-         << "//   the proper paths according to the config filename. It isn't required to replace\n"
-         << "//   these nor predefine them in the environment. You can leave them as is or modify\n"
-         << "//   the paths to your unconventional file paths.\n"
-         << "// \n"
-         << "//===================================================================================\n"
-         << "\n"
-         << "description: Test height for the center of the image for test2 and test3.\n"
-         << "\n"
-         << "//---------------------------------------\n"
-         << "// Commands to generate expected results.\n"
-         << "//---------------------------------------\n"
-         << "expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n"
-         << "expected_results_command1: $(COPY_CMD) $(OBT_OUT_DIR)\\height.txt $(OBT_EXP_DIR)\\height.txt\n"
-         << "\n"
-         << "//---------------------------------------\n"
-         << "// The actual commands to test.\n"
-         << "//---------------------------------------\n"
-         << "test_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n"
-         << "\n"
-         << "//---------------------------------------\n"
-         << "// The post-processing (comparison) commands. Typically these involve a file \n"
-         << "// comparison of last run command against expected results.\n"
-         << "//---------------------------------------\n"
-         << "postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)\\height.txt $(OBT_OUT_DIR)\\height.txt\n"
-         << std::endl;
-   }
-
-   out.close();
-   ossimNotify(ossimNotifyLevel_NOTICE) << "Wrote file: " << templateFile.c_str() << std::endl;
-
-}
-
-//**************************************************************************************************
-// Processes a test config file
-//**************************************************************************************************
-ossim_uint8 ossimBatchTest::execute()
-{
-   if (m_templateModeActive)
-      return (ossim_uint8) TEST_PASSED;
-
-   // Establish the top-level test directory that will contain log, exp and out subdirs:
-   ossimFilename base_output_dir = ossimEnvironmentUtility::instance()->getEnvironmentVariable(
-         ossimString("OSSIM_BATCH_TEST_RESULTS") );
-   if (base_output_dir.empty())
-   {
-      cout<<"\nossimBatchTest WARNING: The environment variable OSSIM_BATCH_TEST_RESULTS is not "
-         "defined. Results will be written relative to the current working directory."<<endl;
-   }
-   base_output_dir = base_output_dir.expand().dirCat(m_configFileName.fileNoExtension());
-   
-   // The following env vars permits the user to specify the test directory as a variable in the KWL
-   // config file:
-   m_outDir = base_output_dir.dirCat("out");
-   m_expDir = base_output_dir.dirCat("exp");
-#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
-   ossimString env_spec = ossimString("OBT_OUT_DIR=") + m_outDir;
-   _putenv(env_spec.chars());
-   env_spec = ossimString("OBT_EXP_DIR=") + m_expDir;
-   _putenv(env_spec.chars());
-#else
-   setenv("OBT_OUT_DIR", m_outDir.chars(), 1);
-   setenv("OBT_EXP_DIR", m_expDir.chars(), 1);
-#endif
-
-   // Turn expansion of for like: $(OBT_TEST_RESULTS)
-   ossimKeywordlist kwl;
-   kwl.setExpandEnvVarsFlag(true);
-   if (!kwl.addFile(m_configFileName))
-   {
-      return (ossim_uint8) TEST_ERROR;
-   }
-
-   // The KWL may contain names of other test config files. Is this a list of config files? If the
-   // status returns anything other than TBD, then a list was present and processed:
-   ossim_uint8 status = processConfigList(kwl);
-   if (status != TEST_TBD)
-   {
-      return status;
-   }
-
-   // Pick up individual test options passed in by user.  These will adjust the keyword list
-   // flags loaded in memory.
-   if ( m_cleanTestList.size() ) // Do this first always...
-   {
-      std::string testCommand = "run_clean_commands";
-      preprocessKwl(m_cleanTestList, testCommand, kwl);
-   }
-
-   if ( m_preprocessTestList.size() )
-   {
-      std::string testCommand = "run_preprocessing_commands";
-      preprocessKwl(m_preprocessTestList, testCommand, kwl);
-   }
-
-   if ( m_acceptTestList.size() )
-   {
-      std::string testCommand = "run_expected_results_commands";
-      preprocessKwl(m_acceptTestList, testCommand, kwl);
-   }
-
-   if ( m_runTestList.size() ) // Do this last always...
-   {
-      std::string testCommand = "run_test_commands";
-      preprocessKwl(m_runTestList, testCommand, kwl);
-   }
-
-   ossimFilename logDir = base_output_dir.dirCat("log");
-   const char* lookup = kwl.find("log_directory");
-   if ( lookup )
-   {
-      logDir = convertToNative( lookup ).c_str();
-   }
-
-   if ( logDir.exists() == false ) 
-   {
-      if ( logDir.createDirectory() == false )
-      {
-         cerr << "Could not create: " << logDir << endl;
-         return (ossim_uint8) TEST_ERROR;
-      }
-   }
-
-   // Establish path to and active stream for the log file:
-   ossimFilename logFile;
-   getLogFilename(logFile);
-   logFile = logDir.dirCat(logFile);
-   ossimSetLogFilename(logFile);
-   m_logStr.open(logFile.c_str());
-   if ( m_logStr.fail() )
-   {
-      cerr << "Could not open: " << logFile << endl;
-      return (ossim_uint8) TEST_ERROR;
-   }
-   else
-   {
-      cout << "Logging to file: " << logFile << "\n";
-   }
-
-   ossimString date;
-   getDateString(date);
-   m_logStr << "// ---\n"
-      << "// ossim-batch-test log:\n"
-      << "// date format = yyyymmddhhmmss\n"
-      << "//---\n"
-      << "start_time: " << date << "\n"
-      << "config_file: " << m_configFileName<< "\n";
-   // Start the timer.
-   ossimTimer::instance()->setStartTick();
-
-   double startTime = ossimTimer::instance()->time_s();
-
-   // Get the number of test:
-   ossimString regExpStr = "test[0-9]+\\.";
-   ossim_uint32 num_tests = kwl.getNumberOfSubstringKeys(regExpStr);
-   const ossim_uint32 MAX_INDEX = num_tests + 1000;
-   ossimString prefixBase = "test";
-   ossim_uint32 index = 0;
-   ossim_uint32 processedIndexes = 0;
-   ossimString prefix;
-
-   // If no test prefix is used, this implies a single test:
-   bool is_single_test = (num_tests == 0);
-   if (is_single_test)
-   {
-      num_tests = 1;
-      prefix = "";
-   }
-   
-   ossim_uint8 overall_test_status = (ossim_uint8) TEST_TBD;
-   while ( processedIndexes < num_tests )
-   {
-      if (!is_single_test)
-         prefix = prefixBase + ossimString::toString(index) + ".";
-
-      ossim_uint8 individual_test_status = processTest( prefix, kwl);
-      if ( individual_test_status != (ossim_uint8) TEST_TBD)
-         ++processedIndexes;
-
-      overall_test_status |= individual_test_status;
-      ++index;
-      if ( index >= MAX_INDEX ) 
-         break; 
-   }
-
-   getDateString(date);
-   m_logStr << "\nstop_time: " << date << "\n";
-   double stopTime = ossimTimer::instance()->time_s();
-   m_logStr << "total elapsed time in seconds: "
-      << std::setiosflags(ios::fixed) << std::setprecision(4)
-      << (stopTime-startTime)
-      << endl; // flush
-   m_logStr.close();
-
-   cout << "\nWrote log: " << logFile << "\n" << endl;
-   return overall_test_status;
-}
-
-//************************************************************************************************
-// Special handler for KWL containing list of test config files.
-//************************************************************************************************
-ossim_uint8 ossimBatchTest::processConfigList(const ossimKeywordlist& kwl)
-{
-   ossim_uint8 overall_test_status = (ossim_uint8) TEST_TBD;
-   ossimFilename config_list_path = m_configFileName.path();
-
-   // Look for keywords for config file name:
-   ossimString prefixBase = "test_config_file";
-   ossimString regExpStr = prefixBase + "[0-9]+";
-   const ossim_uint32 count = kwl.getNumberOfSubstringKeys(regExpStr);
-   const ossim_uint32 MAX_INDEX = count + 100;
-   if (count != 0)
-   {
-      // This is indeed a list of config files:
-      ossim_uint32 index = 0;
-      ossim_uint32 processedIndexes = 0;
-      while (processedIndexes < count)
-      {
-         // Looping over each config file listed, performing an execute() on each:
-         ossimString kw = prefixBase + ossimString::toString(index);
-         m_configFileName = ossimFilename(kwl.find(kw.chars()));
-         
-         if (!m_configFileName.empty())
-         {
-            // Expand any environment variable:
-            if (m_configFileName.contains("$("))
-               m_configFileName = m_configFileName.expand();
-
-            // Handle paths relative to the master config list file:
-            if (m_configFileName.path().empty())
-               m_configFileName = m_configFileName.setPath(config_list_path);
-         }
-
-         // Execute this config file:
-         if (m_configFileName.isReadable())
-         {
-            overall_test_status |= execute();
-            ++processedIndexes;
-         }
-
-         ++index;
-         
-         if ( index >= MAX_INDEX )
-         {
-            break;  // Config file has bad numbering...
-         }
-      }
-   }
-
-   return overall_test_status;
-}
-
-//************************************************************************************************
-//! Fetches string from OS for naming and tagging the log file.
-//************************************************************************************************
-void ossimBatchTest::getDateString(ossimString& date)
-{
-   time_t t;
-   time(&t);
-   tm* lt;
-   lt = localtime(&t);
-   std::string frmt = "%Y%m%d%H%M%S";
-   // yyyymmddhhmmss
-   char s[15];
-   size_t count = strftime(s, 15, frmt.c_str(), lt);
-   if ( count && (count < 15) )
-      date = s;
-   else
-      date.clear();
-
-}
-
-//**************************************************************************************************
-//! Establishes name of output log file.
-//**************************************************************************************************
-void ossimBatchTest::getLogFilename(ossimFilename& logFile)
-{
-   logFile = "obt-log-";
-   ossimString date;
-   getDateString(date);
-   logFile += date;
-   logFile += ".txt";
-}
-
-//**************************************************************************************************
-//! Within a single config file can be multiple tests, distinguished by the "test*." prefix. This
-//! method manages the execution of a single test.
-//**************************************************************************************************
-ossim_uint8 ossimBatchTest::processTest(const ossimString& prefix, const ossimKeywordlist& kwl)
-{
-   ossim_uint8 testStatus = TEST_TBD;
-
-   // Determine first if this test prefix is represented in the KWL:
-   if (kwl.getNumberOfSubstringKeys(prefix) == 0)
-      return testStatus;
-
-   ossimString testName;
-   const char* lookup = kwl.find( prefix, "name" );
-   if ( lookup )
-   {
-      testName = lookup;
-   }
-   if (testName.empty())
-   {
-      if (prefix.empty())
-         testName = m_configFileName.fileNoExtension();
-      else
-         testName = prefix.trim(".");
-   }
-
-   m_logStr << "\n----------------------------------------------------------------------\n";
-
-   // See if test is disabled/enabled:
-   
-   bool enabled = true;
-   lookup = kwl.find( prefix, "enabled" );
-   if ( lookup )
-   {
-      enabled = ossimString(lookup).toBool();
-   }
-
-   if ( !enabled )
-   {
-      testStatus = TEST_DISABLED;
-      ossimString statusString;
-      if ( prefix.size() )
-      {
-         statusString = prefix.trim(ossimString(".")) + ossimString(": disabled");
-      }
-      else
-      {
-         statusString = "test: disabled";
-      }
-      cout << "test_name: " << testName << "\n" << statusString << endl;
-      m_logStr << "test_name: " << testName << "\n" << statusString << endl;
-      return testStatus;
-   }
-
-   cout     << "\n\nbegin_test:\n" << prefix << "name: " << testName << "\n";
-   m_logStr << "\n\nbegin_test:\n" << prefix << "name: " << testName << "\n";   
-   lookup = kwl.find( prefix, "description" );
-   if ( lookup )
-      m_logStr << "description: " << lookup << "\n";
-
-   bool preProcessFlag  = false;
-   bool expectedFlag    = false;
-   bool testFlag        = false;
-   bool postProcessFlag = false;
-   bool cleanFlag       = false;
-   std::string date; 
-
-   lookup = kwl.find(prefix.c_str(), "run_clean_commands");
-   if ( lookup )
-   {
-      cleanFlag = ossimString(lookup).toBool();
-   }
-
-   lookup = kwl.find(prefix.c_str(), "run_preprocessing_commands");
-   if ( lookup )
-   {  
-      preProcessFlag = ossimString(lookup).toBool();
-   }
-
-   lookup = kwl.find(prefix.c_str(), "run_expected_results_commands");
-   if ( lookup )
-   {
-      expectedFlag = ossimString(lookup).toBool();
-   }
-
-   lookup = kwl.find(prefix.c_str(), "run_test_commands");
-   if ( lookup )
-   {
-      testFlag = ossimString(lookup).toBool();
-   }
-
-   lookup = kwl.find(prefix.c_str(), "run_postprocessing_commands");
-   if ( lookup )
-   {
-      postProcessFlag = ossimString(lookup).toBool();
-   }
-
-   m_logStr << "preProcessFlag:  " << preProcessFlag
-            << "\nexpectedFlag:    " <<expectedFlag
-            << "\ntestFlag:        " <<testFlag
-            << "\npostProcessFlag: " <<postProcessFlag
-            << "\ncleanFlag:       " <<cleanFlag
-            << "\n";
-
-   // Run the clean first if set...
-   if ( cleanFlag )
-   {
-      ossimString prefixBase = prefix + "clean_command";
-      testStatus |= processCommands( prefixBase, kwl, testName, false );
-   }
-
-   if ( preProcessFlag && !(testStatus & TEST_ERROR))
-   {
-      ossimString prefixBase = prefix + "preprocess_command";
-      testStatus |= processCommands( prefixBase, kwl, testName, false );
-   }
-   if ( expectedFlag  && !(testStatus & TEST_ERROR))
-   {
-      ossimString prefixBase = prefix + "expected_results_command";
-      testStatus |= processCommands( prefixBase, kwl, testName, true );
-   }
-   if ( testFlag  && !(testStatus & TEST_ERROR))
-   {
-      ossimString prefixBase = prefix + "test_command";
-      testStatus |= processCommands( prefixBase, kwl, testName, true );
-   }
-   if ( postProcessFlag  && !(testStatus & TEST_ERROR))
-   {
-      ossimFilename tempFile;
-
-      if ( getTempFileName( prefix, kwl, tempFile ) )
-      {
-         ossimString prefixBase = prefix + "postprocess_command";
-         testStatus |= processCommands( prefixBase, kwl, testName, false, tempFile );
-      }
-      else
-      {
-         m_logStr << testName << ": ERROR temp file could not be derived..." << endl;
-         testStatus |= TEST_ERROR; // Set an error bit...
-      }
-   }
-
-   cout     << "end_test:\n";
-   m_logStr << "end_test:\n";
-
-   m_logStr << "----------------------------------------------------------------------\n"; 
-   return testStatus; 
-}
-
-//**************************************************************************************************
-ossim_uint8 ossimBatchTest::processCommands(const ossimString& prefixBase,
-                                            const ossimKeywordlist& kwl,
-                                            const ossimString& testName,
-                                            bool logTime,
-                                            const ossimFilename& tempFileName)
-{
-   ossim_uint8 result = TEST_TBD;
-
-   //---
-   // We must do these in order so we will use the
-   // ossimKeywordlist::getNumberOfSubstringKeys
-   // instead of: ossimKeywordlist::getSubstringKeyList
-   //
-   // MAX_INDEX is just so people can skip numbers in their config file like:
-   // test1.command
-   // test3.command oops...
-   //---
-   ossimString regExpStr = prefixBase + "[0-9]+";
-   const ossim_uint32 num_commands = kwl.getNumberOfSubstringKeys(regExpStr);
-   const ossim_uint32 MAX_INDEX = num_commands + 1000;
-
-   // Hack to permit defaulted results paths and default clean operation:
-   if (num_commands == 0)
-   {
-      bool rtn_ok = true;
-      if (prefixBase.contains("preprocess"))
-         rtn_ok = makeDefaultResultsDir();
-      if (prefixBase.contains("clean"))
-         rtn_ok = doDefaultClean();
-      if (rtn_ok)
-         result = TEST_PASSED;
-      else
-         result = TEST_ERROR;
-      return result;
-   }
-
-   ossimString date;
-   double startTime;
-   double stopTime;
-   
-   ossimString command;
-   ossim_uint32 index = 0;
-   ossim_uint32 processedIndexes = 0;
-   const char* lookup = 0;
-   
-   bool postprocessing = false;
-   if (prefixBase.contains("postprocess"))
-      postprocessing = true;
-
-   while (  processedIndexes < num_commands )
-   {
-      ossimString cmd_kw =  prefixBase + ossimString::toString(index);
-      lookup = kwl.find( cmd_kw );
-      if ( lookup )
-      {
-         ossimString command_line = convertToNative( lookup ).c_str();
-         if ( tempFileName.size() )
-         {
-            command_line += " > " + tempFileName;
-         }
-
-         m_logStr << "executing command: " << command_line << "\n";
-
-         if ( logTime )
-         {
-            getDateString(date);
-            m_logStr << "begin: " << date << "\n";
-
-            // Start the clock:
-            startTime = ossimTimer::instance()->time_s();
-         }
-            
-         // Launch the command:
-         int status = system(command_line.chars());
-         if (status == 0)
-            result |= TEST_PASSED;
-         else if (postprocessing)
-            result |= TEST_FAILED;
-         else
-            result |= TEST_ERROR;
-
-         if ( logTime )
-         {
-            // Log the time and status:
-            stopTime = ossimTimer::instance()->time_s();
-            getDateString(date);
-            m_logStr << "end: " << date << "\n"
-                   << testName << "[" << index << "]: elapsed time in seconds: "
-                   << std::setiosflags(ios::fixed)
-                   << std::setprecision(4)
-                   << (stopTime-startTime) << "\n";
-         }
-         
-         m_logStr << "return status: " << status << "\n";
-         
-         // Output the status.
-         // If failed write the temp file to the log.  This should have the diffs in it.
-         ostringstream statusString;
-         if ( prefixBase.size() )
-         {
-            statusString << prefixBase;
-         }
-         else
-         {
-            statusString << "test";
-         }
-         statusString << "[" << index << "]: ";
-
-         if ( status != 0 )
-         {
-            // A bad return status can be a test fail if the command was a postprocess:
-            if ( postprocessing )
-            {
-               statusString << "FAILED";
-            }
-            else
-            {
-               statusString << "ERROR";
-            }
-
-            cout << statusString.str() << endl;
-            m_logStr << statusString.str() << endl;
-            m_logStr << command << "\noutput follows:\n";
-            std::ifstream in;
-            if (!tempFileName.empty())
-            {
-               in.open(tempFileName.c_str(), ios::in | ios::binary);
-               if ( in.is_open() )
-               {
-                  char ch;
-                  while ( in.get(ch) ) m_logStr.put(ch);
-                  m_logStr << "\n";
-                  in.close();
-               }
-            }
-         }
-         else
-         {
-            statusString << "PASSED";
-            cout << statusString.str() << endl;
-            m_logStr << statusString.str() << endl;
-         }
-
-         ++processedIndexes;
-      }
-      ++index;
-      
-      if ( index >= MAX_INDEX ) 
-         break; // Config file has bad numbering...
-   }
-   return result;
-}
-
-//**************************************************************************************************
-void ossimBatchTest::preprocessKwl(const std::vector<std::string>& testList,
-                                   const std::string& testCommand,
-                                   ossimKeywordlist& kwl)
-{
-   if ( testList.empty() || testCommand.empty() || (kwl.getSize()==0) )
-      return;
-
-   // Check for user passed in "all" to option.
-   std::vector<std::string>::const_iterator testIter = testList.begin();
-   bool enableAllTestFlag = false;
-   ossimString firstTest(*testIter);
-   firstTest.downcase();
-   if ( firstTest == "all" )
-   {
-      enableAllTestFlag = true;
-   }
-
-   while ( testIter != testList.end() )
-   {
-      // Get the number of test:
-      ossimString regExpStr = "test[0-9]+\\.";
-      ossim_uint32 num_tests = kwl.getNumberOfSubstringKeys(regExpStr);
-      const ossim_uint32 MAX_INDEX = num_tests + 1000;
-      ossimString prefixBase = "test";
-      ossim_uint32 index = 0;
-      ossim_uint32 processedIndexes = 0;
-
-      // A count of 0 may indicate that the config file consists of a single, unprefixed test spec:
-      bool is_single_test = false;
-      if (num_tests == 0)
-      {
-         regExpStr = "test_command[0-9]+";
-         const ossim_uint32 cmd_count = kwl.getNumberOfSubstringKeys(regExpStr);
-         if (cmd_count != 0)
-         {
-            ++num_tests;
-            is_single_test = true;
-         }
-         else
-            break; // Nothing to do here:
-      }
-
-      while ( processedIndexes < num_tests )
-      {
-         ossimString prefix ("");
-         bool test_name_matches = true;
-         bool test_exists = true;
-         
-         if (!is_single_test)
-         {
-            // The tests are prefixed with "test*". Assign the prefix for this test set:
-            prefix = prefixBase + ossimString::toString(index);
-            test_name_matches = (prefix == (*testIter).c_str());
-            prefix += ".";
-            
-            // With a valid prefix, check if this test even exists before doing any more 
-            // preprocessing:
-            regExpStr = prefix + "test_command[0-9]+";
-            const ossim_uint32 cmd_count = kwl.getNumberOfSubstringKeys(regExpStr);
-            test_exists = cmd_count > 0;
-         }
-
-         if ( test_exists )
-         {
-            if ( test_name_matches || enableAllTestFlag )
-            {
-               //---
-               // Removed adjustment of "enable" flag. Let the config file "enable" key
-               // control this.  drb - 20151202
-               // kwl.add(prefix.c_str(), "enabled", "1", true);
-               //---
-               kwl.add(prefix.c_str(), testCommand.c_str(), "1", true);
-               if ( testCommand == "run_expected_results_commands" )
-               {
-                  // Need pre-processing if clean performed.
-                  kwl.add(prefix.c_str(), "run_preprocessing_commands", "1", true);
-               }
-               if ( testCommand == "run_test_commands" )
-               {
-                  // Need pre/post-processing:
-                  kwl.add(prefix.c_str(), "run_preprocessing_commands", "1", true);
-                  kwl.add(prefix.c_str(), "run_postprocessing_commands", "1", true);
-               }
-            }
-            ++processedIndexes;
-         }
-         ++index;
-         if ( index >= MAX_INDEX ) break; 
-      }
-      ++testIter;
-
-   } // End: while ( testIter != testList.end() )
-   
-} // End: preprocessKwl method
-
-//**************************************************************************************************
-//! Default preprocessing step makes expected and output results directories. Returns TRUE if
-//! successful.
-//**************************************************************************************************
-bool ossimBatchTest::makeDefaultResultsDir()
-{
-   if ( !m_outDir.exists() && !m_outDir.createDirectory() )
-   {
-      cerr << "Could not create: " << m_outDir << endl;
-      return false;
-   }
-   if ( !m_expDir.exists() &&  !m_expDir.createDirectory() )
-   {
-      cerr << "Could not create: " << m_expDir << endl;
-      return false;
-   }
-   return true;
-}
-
-//**************************************************************************************************
-//! Default clean step deletes all files in out and exp dirs. Returns TRUE if successful.
-//**************************************************************************************************
-bool ossimBatchTest::doDefaultClean()
-{
-   bool result = true;
-
-   ossimString del_cmd = ossimEnvironmentUtility::instance()->getEnvironmentVariable(
-      ossimString("RMDIR_CMD") );
-   ossimString command_line;
-   
-   if ( m_outDir.exists() )
-   {
-      command_line = del_cmd + " " + m_outDir;
-      m_logStr << "executing command: " << command_line << "\n";
-      if (system(command_line) != 0)
-      {
-         m_logStr << "ERROR: execution failed!\n";
-         cerr << "ERROR: Could not delete <"<<m_outDir<<">. Clean operation failed."<< endl;
-         result = false;
-      }
-   }
-   
-   ossimFilename tmpDir;
-   if ( getDefaultTempFileDir( tmpDir ) )
-   {
-      if ( tmpDir.exists() )
-      {
-         command_line = del_cmd + " " + tmpDir;
-         m_logStr << "executing command: " << command_line << "\n";
-         if (system(command_line) != 0)
-         {
-            m_logStr << "ERROR: execution failed!\n";
-            cerr << "ERROR: Could not delete <"<<m_outDir<<">. Clean operation failed."<< endl;
-            result = false;
-         }
-      }
-   }
-   
-   return result;
-}
-
-bool ossimBatchTest::getTempFileName( const ossimString& prefix,
-                                      const ossimKeywordlist& kwl,
-                                      ossimFilename& tempFile ) const
-{
-   const char* lookup = kwl.find(prefix.c_str(), "temp_file");
-   if ( lookup )
-   {
-      tempFile = ossimFilename(lookup);
-      if (tempFile.contains("$("))
-         tempFile = tempFile.expand();
-   }
-   else
-   {
-      if ( getDefaultTempFileDir( tempFile ) )
-      {
-         if ( tempFile.createDirectory( true, 0775 ) )
-         {
-            // Tack on the file name.
-            tempFile = tempFile.dirCat("tmp.txt");
-         }
-         else
-         {
-            tempFile.clear();
-         }
-      }
-   }
-   return ( tempFile.size() > 0 );
-}
-
-bool ossimBatchTest::getDefaultTempFileDir( ossimFilename& tempFile ) const
-{
-   // Create a default tmp directory under OSSIM_BATCH_TEST_RESULTS.
-   tempFile = ossimEnvironmentUtility::instance()->getEnvironmentVariable(
-      ossimString("OSSIM_BATCH_TEST_RESULTS") );
-   if (!tempFile.empty())
-      tempFile = tempFile.dirCat("tmp");
-   else
-      tempFile = ossimEnvironmentUtility::instance()->getEnvironmentVariable(ossimString("TEMP"));
-   return ( tempFile.size() > 0 );
-}
-
-void ossimBatchTest::usage(ossimArgumentParser& ap)
-{
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-
-   au->setApplicationName(ap.getApplicationName());
-   au->setDescription(ap.getApplicationName()+" batch test application.");
-   
-   au->setCommandLineUsage(ap.getApplicationName()+" <test-configuration-file.kwl>\n\n"
-      "This will run all test within the configuration file.  For individual test control edit "
-      "flags of the configuration file or use individual test options below. The following status "
-      "is returned on exit:"
-      "\n   -1 if any error occurred during test"
-      "\n    1 if any test failed"
-      "\n    0 if all tests passed\n");
-
-   au->addCommandLineOption("-a or --accept-test", 
-      "<testX> Runs \"run_expected_results_commands\" portion from test configuration file for "
-      "testX where X is some test number, i.e. 1, 2, 3...  This will turn off all other test in "
-      "the test config file. Notes: Multiple tests can be entered by quoting string of space "
-      "separated test, e.g. \"test1 test2\". To accept all tests use \"all\" for test.");
-   
-   au->addCommandLineOption("-c or --clean-test", "<testX> Runs \"run_clean_commands\" portion "
-      "from test configuration file for testX where X is some test number, i.e. 1, 2, 3...  This "
-      "will turn off all other test in the test config file. Notes: Multiple tests can be entered "
-      "by quoting string of space separated test, e.g. \"test1 test2\". To clean all tests use "
-      "\"all\" for test.");
-
-   au->addCommandLineOption("-p or --preprocess-test", 
-      "<testX> Runs \"run_preprocessing_commands\" portion from test configuration file for testX "
-      "where X is some test number, i.e. 1, 2, 3...  This will turn off all other test in the test "
-      "config file. Notes: Multiple tests can be entered by quoting string of space separated "
-      "test, e.g. \"test1 test2\". To preprocess all tests use \"all\" for test.");
-   
-   au->addCommandLineOption("-r or --run-test", 
-      "<testX> Runs \"run_test_commands\" portion from test configuration file for testX where X "
-      "is some test number, i.e. 1, 2, 3...  This will turn off all other test in the test config "
-      "file. Notes: Multiple tests can be entered by quoting string of space separated test, e.g. "
-      "\"test1 test2\". To run all tests use \"all\" for test.");
-   
-   au->addCommandLineOption("-h or --help", "Display usage.");
-   
-   au->addCommandLineOption("-W or -w", 
-      "<template_name.kwl> Writes a long-form (-W) or a short-form (-w) template test "
-      "configuration file.");
-
-   // Write usage.
-   au->write(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::string ossimBatchTest::convertToNative( const char* lookup ) const
-{
-   std::string s;
-   
-   if ( lookup )
-   {
-      s = lookup;
-      const std::string::size_type SIZE = s.size();
-      std::string::size_type i = 0;
-      
-#if defined(_WIN32)
-      //---
-      // Must not convert slashes for: "del /Q", "fc /W", and "copy /Y"
-      //---
-      while( i < SIZE )
-      {
-         if( s[i] == '/' )
-         {
-            bool replace = true;
-            if ( (i+2) < SIZE ) // Could fit a window command and space like: "/Y "
-            {
-               if ( (s[i+1] == 'Q') || (s[i+1] == 'W') || (s[i+1] == 'Y') )
-               {
-                  if ( s[i+2] == ' ' ) // Check for space after "/Q".
-                  {
-                     replace = false;
-                  }
-               }
-            }
-            if ( replace )
-            {
-               s[i] = '\\';
-            }
-         }
-         ++i;
-      }
-#else
-      while( i < SIZE )
-      {
-         if( s[i] == '\\' )
-         {
-            s[i] = '/';
-         }
-         ++i;
-      }
-#endif
-      
-   } // Matches: if ( lookup )
-   
-   return s;
-}
-
diff --git a/ossim/src/ossim/util/ossimChipperUtil.cpp b/ossim/src/ossim/util/ossimChipperUtil.cpp
deleted file mode 100644
index b54888c..0000000
--- a/ossim/src/ossim/util/ossimChipperUtil.cpp
+++ /dev/null
@@ -1,5081 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimChipperUtil.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Utility class definition processing digital elevation
-// models(dems).
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimChipperUtil.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/util/ossimChipperUtil.h>
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGeoPolygon.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimRefreshEvent.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimVisitor.h>
-
-#include <ossim/imaging/ossimBrightnessContrastSource.h>
-#include <ossim/imaging/ossimBumpShadeTileSource.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/imaging/ossimFusionCombiner.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/imaging/ossimRectangleCutFilter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimSFIMFusion.h>
-#include <ossim/imaging/ossimTwoColorView.h>
-#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
-#include <ossim/init/ossimInit.h>
-
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimImageViewAffineTransform.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimUtmProjection.h>
-
-#include <ossim/support_data/ossimSrcRecord.h>
-
-#include <cmath>
-#include <sstream>
-#include <string>
-
-static ossimTrace traceDebug("ossimChipperUtil:debug");
-static ossimTrace traceLog("ossimChipperUtil:log");
-static ossimTrace traceOptions("ossimChipperUtil:options");
-
-static const std::string APPLICATION_NAME_KW     = "application_name";
-static const std::string BRIGHTNESS_KW           = "brightness";
-static const std::string COLOR_BLUE_KW           = "color_blue";
-static const std::string COLOR_GREEN_KW          = "color_green";
-static const std::string COLOR_RED_KW            = "color_red";
-static const std::string CONTRAST_KW             = "contrast";
-static const std::string CLIP_WMS_BBOX_LL_KW     = "clip_wms_bbox_ll";
-static const std::string CLIP_POLY_LAT_LON_KW    = "clip_poly_lat_lon";
-static const std::string CUT_BBOX_XYWH_KW        = "cut_bbox_xywh";
-static const std::string CUT_WMS_BBOX_KW         = "cut_wms_bbox";
-static const std::string CUT_WMS_BBOX_LL_KW      = "cut_wms_bbox_ll";
-static const std::string CUT_CENTER_LAT_KW       = "cut_center_lat";
-static const std::string CUT_CENTER_LON_KW       = "cut_center_lon";
-static const std::string CUT_RADIUS_KW           = "cut_radius";  // meters
-static const std::string CUT_HEIGHT_KW           = "cut_height";  // pixels
-static const std::string CUT_MAX_LAT_KW          = "cut_max_lat";
-static const std::string CUT_MAX_LON_KW          = "cut_max_lon";
-static const std::string CUT_MIN_LAT_KW          = "cut_min_lat";
-static const std::string CUT_MIN_LON_KW          = "cut_min_lon";
-static const std::string CUT_WIDTH_KW            = "cut_width";   // pixels
-static const std::string DEM_KW                  = "dem";
-static const std::string GAIN_KW                 = "gain";
-static const std::string FILE_KW                 = "file";
-static const std::string HISTO_OP_KW             = "hist_op";
-static const std::string IMAGE_SPACE_SCALE_X_KW  = "image_space_scale_x";
-static const std::string IMAGE_SPACE_SCALE_Y_KW  = "image_space_scale_y";
-static const std::string IMG_KW                  = "image";
-static const std::string LUT_FILE_KW             = "lut_file";
-static const std::string DEGREES_X_KW            = "degrees_x";
-static const std::string DEGREES_Y_KW            = "degrees_y";
-static const std::string METERS_KW               = "meters";
-static const std::string NORTH_UP_KW             = "north_up"; // bool
-static const std::string OP_KW                   = "operation";
-static const std::string OUTPUT_RADIOMETRY_KW    = "output_radiometry";
-static const std::string PAD_THUMBNAIL_KW        = "pad_thumbnail"; // bool
-static const std::string READER_PROPERTY_KW      = "reader_property";
-static const std::string RESAMPLER_FILTER_KW     = "resampler_filter";
-static const std::string ROTATION_KW             = "rotation";
-static const std::string RRDS_KW                 = "rrds";
-static const std::string SCALE_2_8_BIT_KW        = "scale_2_8_bit";
-static const std::string SHARPEN_MODE_KW         = "sharpen_mode";
-static const std::string SNAP_TIE_TO_ORIGIN_KW   = "snap_tie_to_origin";
-static const std::string SRC_FILE_KW             = "src_file";
-static const std::string SRS_KW                  = "srs";
-static const std::string THREE_BAND_OUT_KW       = "three_band_out"; // bool
-static const std::string THUMBNAIL_RESOLUTION_KW = "thumbnail_resolution"; // pixels
-static const std::string TILE_SIZE_KW            = "tile_size"; // pixels
-static const std::string TRUE_KW                 = "true";
-static const std::string UP_IS_UP_KW             = "up_is_up"; // bool
-static const std::string WRITER_KW               = "writer";
-static const std::string WRITER_PROPERTY_KW      = "writer_property";
-static const std::string COMBINER_TYPE_KW        = "combiner_type"; 
-
-static const std::string TWOCMV_OLD_INPUT_BAND_KW      = "2cmv_old_input_band";
-static const std::string TWOCMV_NEW_INPUT_BAND_KW      = "2cmv_new_input_band";
-static const std::string TWOCMV_RED_OUTPUT_SOURCE_KW   = "2cmv_red_output_source";
-static const std::string TWOCMV_GREEN_OUTPUT_SOURCE_KW = "2cmv_green_output_source";
-static const std::string TWOCMV_BLUE_OUTPUT_SOURCE_KW  = "2cmv_blue_output_source";
-
-ossimChipperUtil::ossimChipperUtil()
-   : ossimReferenced(),
-     m_operation(OSSIM_CHIPPER_OP_UNKNOWN),
-     m_kwl(new ossimKeywordlist()),
-     m_srcKwl(0),
-     m_geom(0),
-     m_ivt(0),
-     m_demLayer(0),
-     m_imgLayer(0)
-{
-   // traceDebug.setTraceFlag(true);
-   
-   m_kwl->setExpandEnvVarsFlag(true);
-}
-
-// Private/hidden from use.
-ossimChipperUtil::ossimChipperUtil( const ossimChipperUtil& /* obj */ )
-{
-}
-
-// Private/hidden from use.
-const ossimChipperUtil& ossimChipperUtil::operator=( const ossimChipperUtil& /* rhs */)
-{
-   return *this;
-}
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::createCombiner()const
-{
-   ossimRefPtr<ossimImageSource> result;
-   ossimString combinerType = m_kwl->find(COMBINER_TYPE_KW.c_str());
-   if(combinerType.empty())
-   {
-      combinerType = "ossimImageMosaic";
-   }
-
-   result = ossimImageSourceFactoryRegistry::instance()->createImageSource(combinerType);
-   if(!result.valid())
-   {
-      result = new ossimImageMosaic();
-   }
-
-   return result;
-}
-
-ossimChipperUtil::~ossimChipperUtil()
-{
-   clear();
-}
-
-void ossimChipperUtil::addArguments(ossimArgumentParser& ap)
-{
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [option]... [input-option]... <input-file(s)> <output-file>\nNote at least one input is required either from one of the input options, e.g. --input-dem <my-dem.hgt> or adding to command line in front of the output file in which case the code will try to ascertain what type of input it is.\n\nAvailable traces:\n-T \"ossimChipperUtil:debug\"   - General debug trace to standard out.\n-T \"ossimChipperUtil:log\"     - Writes a log file to output-file.log.\n-T \"ossimChipp [...]
-
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   
-   au->setCommandLineUsage(usageString);
-    
-   au->setDescription(ap.getApplicationName()+" Utility application for generating elevation products from dem data.");
-   
-   au->addCommandLineOption("--azimuth", "<azimuth>\nhillshade option - Light source azimuth angle for bump shade.\nRange: 0 to 360, Default = 180.0");
-
-   au->addCommandLineOption( "-b or --bands <n,n...>", "Use the specified bands in given order: e.g. \"3,2,1\" will select bands 3, 2 and 1 of the input image.\nNote: it is 1 based" );
-
-   au->addCommandLineOption( "--brightness", "<brightness>\nApply brightness to input image(s). Valid range: -1.0 to 1.0" );
-
-   au->addCommandLineOption("--central-meridian","<central_meridian_in_decimal_degrees>\nNote if set this will be used for the central meridian of the projection.  This can be used to lock the utm zone.");
-
-   au->addCommandLineOption("--color","<r> <g> <b>\nhillshade option - Set the red, green and blue color values to be used with hillshade.\nThis option can be used with or without an image source for color.\nRange 0 to 255, Defualt r=255, g=255, b=255");
-
-   au->addCommandLineOption("--color-table","<color-table.kwl>\nhillshade or color-relief option - Keyword list containing color table for color-relief option.");
-
-   au->addCommandLineOption( "--contrast", "<constrast>\nApply constrast to input image(s). Valid range: -1.0 to 1.0" );
-
-   au->addCommandLineOption("--cut-bbox-xywh", "<x>,<y>,<width>,<height>\nSpecify a comma separated bounding box.");
-   
-   au->addCommandLineOption("--cut-wms-bbox", "<minx>,<miny>,<maxx>,<maxy>\nSpecify a comma separated list in the format of a WMS BBOX.\nThe units are in the units of the projector defined by the --srs key");
-
-   au->addCommandLineOption("--cut-wms-bbox-ll", "<minx>,<miny>,<maxx>,<maxy>\nSpecify a comma separated list in the format of a WMS BBOX.\nThe units are always decimal degrees");
-
-   au->addCommandLineOption("--cut-width", "<width>\nSpecify the cut width in pixel");
-
-   au->addCommandLineOption("--cut-height", "<height>\nSpecify the cut height in pixel");
-
-   au->addCommandLineOption("--clip-wms-bbox-ll", "<minx>,<miny>,<maxx>,<maxy>\nSpecify a comma separated list in the format of a WMS BBOX.\nThe units are always decimal degrees");
-   
-   au->addCommandLineOption("--clip-poly-lat-lon", "Polygon in the form of a string: (lat,lon),(lat,lon),...(lat,lon)");
-
-   au->addCommandLineOption("--cut-bbox-ll", "<min_lat> <min_lon> <max_lat> <max_lon>\nSpecify a bounding box with the minimum latitude/longitude and max latitude/longitude in decimal degrees.\nNote coordinates are edge to edge.");
-   
-   au->addCommandLineOption("--cut-bbox-llwh", "<min_lat> <min_lon> <max_lat> <max_lon> <width> <height>\nSpecify a bounding box with the minimum latitude/longitude, max latitude/longitude in decimal degrees and width/height in pixels.\nNote coordinates are edge to edge.");
-   
-   au->addCommandLineOption("--cut-center-llwh","<latitude> <longitude> <width> <height>\nSpecify the center cut in latitude longitude space with width and height in pixels.");
-
-   au->addCommandLineOption("--cut-center-llr","<latitude> <longitude> <radius_in_meters>\nSpecify the center cut in latitude longitude space with radius in meters.");
-
-   au->addCommandLineOption("--degrees","<dpp_xy> | <dpp_x> <dpp_y>\nSpecifies an override for degrees per pixel. Takes either a single value applied equally to x and y directions, or two values applied correspondingly to x then y. This option takes precedence over the \"--meters\" option.");
-
-   au->addCommandLineOption("--elevation", "<elevation>\nhillshade option - Light source elevation angle for bumb shade.\nRange: 0 to 90, Default = 45.0");
-
-   au->addCommandLineOption("-e or --entry", "<entry> For multi image handlers which entry do you wish to extract. For list of entries use: \"ossim-info -i <your_image>\" ");  
-
-   au->addCommandLineOption("--exaggeration", "<factor>\nMultiplier for elevation values when computing surface normals. Has the effect of lengthening shadows for oblique lighting.\nRange: .0001 to 50000, Default = 1.0");
-   
-   au->addCommandLineOption("-h or --help", "Display this help and exit.");
-
-   au->addCommandLineOption("--hemisphere", "<hemisphere>\nSpecify a projection hemisphere if supported. E.g. UTM projection. This will lock the hemisphere even if input scene center is the other hemisphere. Valid values for UTM are \"N\" and \"S\""); 
-   
-   au->addCommandLineOption("--histogram-op", "<operation>\nHistogram operation to perform. Valid operations are \"auto-minmax\", \"std-stretch-1\", \"std-stretch-2\" and \"std-stretch-3\".");
-
-   au->addCommandLineOption("--image-space-scale","<x> <y>\nSpecifies an image space scale for x and y direction. \"chip\" operation only.");
-
-   au->addCommandLineOption("--input-dem", "<dem> Input dem to process.");
-
-   au->addCommandLineOption("--input-img", "<image> Input image to process.");
-   
-   au->addCommandLineOption("--input-src","<file.src> Input source file list keyword list with list of dems or images or both to process.");
-   
-   au->addCommandLineOption("--meters", "<meters>\nSpecifies an override for the meters per pixel");
-
-   au->addCommandLineOption("-n or --north-up", "Rotates image North up. \"chip\" operation only.");
-   
-   au->addCommandLineOption( "--op", "<operation>\nOperation to perform. Valid operations are \"chip\", \"color-relief\", \"hillshade\", \"psm\"(pan sharpened multispectral), \"2cmv\"(two color multi view) and \"ortho\".\nchip = input projection = output projection(image space), single image operation only." );
-
-   au->addCommandLineOption("--options","<options.kwl>  This can be all or part of the application options.  To get a template you can turn on trace to the ossimChipperUtil class by adding \"-T ossimChipperUtil\" to your command.");
-
-   au->addCommandLineOption("--origin-latitude","<latidude_in_decimal_degrees>\nNote if set this will be used for the origin latitude of the projection.  Setting this to something other than 0.0 with a geographic projection creates a scaled geographic projection.");
-
-   au->addCommandLineOption("--output-radiometry", "<R>\nSpecifies the desired product's pixel radiometry type. Possible values for <R> are: U8, U11, U16, S16, F32. Note this overrides the deprecated option \"scale-to-8-bit\".");
-
-   au->addCommandLineOption("--pad-thumbnail", "<boolean>\nIf true, output thumbnail dimensions will be padded in width or height to make square; else, it will have the aspect ratio of input,  Default=false");
-
-   au->addCommandLineOption("--projection", "<output_projection> Valid projections: geo, geo-scaled, input or utm\ngeo = Equidistant Cylindrical, origin latitude = 0.0\ngeo-scaled = Equidistant Cylindrical, origin latitude = image center\ninput Use first images projection. Must be a map projecion.\nutm = Universal Tranverse Mercator\nIf input and multiple sources the projection of the first image will be used.\nIf utm the zone will be set from the scene center of first image.\nNOTE: --sr [...]
-
-   au->addCommandLineOption("--resample-filter","<type>\nSpecify what resampler filter to use, e.g. nearest neighbor, bilinear, cubic, sinc.\nSee ossim-info --resampler-filters"); 
-
-   au->addCommandLineOption("-r or --rotate", "<degrees>\nRotate image by degrees. \"chip\" operation only.");
-
-   au->addCommandLineOption("--reader-prop", "<string>Adds a property to send to the reader. format is name=value");
-
-   au->addCommandLineOption("--rrds", "<rrds> Reduced resolution data set where 0 is full resolution. \"chip\" operation only.");
-   
-   au->addCommandLineOption("--scale-to-8-bit", "Scales the output to unsigned eight bits per band. This option has been deprecated by the newer \"--output-radiometry\" option.");
-
-   au->addCommandLineOption("--sharpen-mode", "<mode> Applies sharpness to image chain(s). Valid modes: \"light\", \"heavy\"");
-
-   au->addCommandLineOption("--snap-tie-to-origin",
-                                "Snaps tie point to projection origin so that (tie-origin)/gsd come out on an even integer boundary.");   
-   
-   au->addCommandLineOption("--srs","<src_code>\nSpecify a spatial reference system(srs) code for the output projection. Example: --srs EPSG:4326");
-
-   au->addCommandLineOption("-t or --thumbnail", "<max_dimension>\nSpecify a thumbnail resolution.\nScale will be adjusted so the maximum dimension = argument given.");
-
-   au->addCommandLineOption("--three-band-out", "Force three band output even if input is not. Attempts to map bands to RGB if possible.");
-
-   au->addCommandLineOption("--tile-size", "<size_in_pixels>\nSets the output tile size if supported by writer.  Notes: This sets both dimensions. Must be a multiple of 16, e.g. 1024.");
-
-   au->addCommandLineOption("-u or --up-is-up", "Rotates image to up is up. \"chip\" operation only.");
-
-   au->addCommandLineOption("-w or --writer","<writer>\nSpecifies the output writer.  Default uses output file extension to determine writer. For valid output writer types use: \"ossim-info --writers\"\n");
-   
-   au->addCommandLineOption("--writer-prop", "<writer-property>\nPasses a name=value pair to the writer for setting it's property. Any number of these can appear on the line.");
-
-   au->addCommandLineOption("--zone", "<zone>\nSpecify a projection zone if supported.  E.g. UTM projection. This will lock the zone even if input scene center is in another zone. Valid values for UTM are \"1\" to \"60\"");  
-
-   au->addCommandLineOption("--2cmv-old-input-band", "<band>\nBand to use for two color multi view old input.\n");   
-   au->addCommandLineOption("--2cmv-new-input-band", "<band>\nBand to use for two color multi view new input.\n");
-   
-   au->addCommandLineOption("--2cmv-red-output-source", "<source>\nTwo color multi view source input for red output.  Either, old, new, or mp(min pix).  Default=old.\n");
-   
-   au->addCommandLineOption("--2cmv-green-output-source", "<source>\nTwo color multi view source input for green output.  Either, old, new, or mp(min pix).  Default=new.\n");
-   
-   au->addCommandLineOption("--2cmv-blue-output-source", "<source>\nTwo color multi view source input for blue output.  Either, old, new, or mp(min pix).  Default=new.\n");
-   au->addCommandLineOption("--combiner-type", "<type>\nossimBlendMosaic, ossimFeatherMosaic, ossimImageMosaic.  Default: ossimImageMosaic.  Example --combiner-type ossimImageMosaic\n");
-   
-} // End: ossimChipperUtil::addArguments
-
-void ossimChipperUtil::clear()
-{
-      // Must disonnect chains so that they destroy.
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator i = m_imgLayer.begin();
-   while ( i != m_imgLayer.end() )
-   {
-      (*i)->disconnect();
-      (*i) = 0;
-      ++i;
-   }
-   m_imgLayer.clear();
-
-   i = m_demLayer.begin();
-   while ( i != m_demLayer.end() )
-   {
-      (*i)->disconnect();
-      (*i) = 0;
-      ++i;
-   }
-   m_demLayer.clear();
-
-   if(m_writer.valid())
-   {
-      m_writer->disconnect();
-      m_writer = 0;
-   }
-}
-
-bool ossimChipperUtil::initialize(ossimArgumentParser& ap)
-{
-   static const char MODULE[] = "ossimChipperUtil::initialize(ossimArgumentParser&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   clear();
-   if( ap.read("-h") || ap.read("--help") || (ap.argc() == 1) )
-   {
-      usage(ap);
-      
-      return false; // Indicates process should be terminated to caller.
-   }
-
-   // Start with clean options keyword list.
-   m_kwl->clear();
-
-   std::string tempString1;
-   ossimArgumentParser::ossimParameter stringParam1(tempString1);
-   std::string tempString2;
-   ossimArgumentParser::ossimParameter stringParam2(tempString2);
-   std::string tempString3;
-   ossimArgumentParser::ossimParameter stringParam3(tempString3);
-   std::string tempString4;
-   ossimArgumentParser::ossimParameter stringParam4(tempString4);
-   std::string tempString5;
-   ossimArgumentParser::ossimParameter stringParam5(tempString5);
-   std::string tempString6;
-   ossimArgumentParser::ossimParameter stringParam6(tempString6);
-   double tempDouble1;
-   ossimArgumentParser::ossimParameter doubleParam1(tempDouble1);
-   double tempDouble2;
-   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
-
-   ossim_uint32 demIdx        = 0;
-   ossim_uint32 imgIdx        = 0;
-   ossim_uint32 readerPropIdx = 0;
-   ossim_uint32 writerPropIdx = 0;
-   ossimString  key           = "";
-   
-   // Extract optional arguments and stuff them in a keyword list.
-   if( ap.read("--azimuth", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::AZIMUTH_ANGLE_KW), tempString1 );
-   }
-
-   if (ap.read("-b", stringParam1) || ap.read("--bands", stringParam1))
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::BANDS_KW), tempString1 );
-   }   
-
-   if( ap.read("--brightness", stringParam1) )
-   {
-      m_kwl->addPair( BRIGHTNESS_KW, tempString1 );
-   }
-   
-   if( ap.read("--central-meridian", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::CENTRAL_MERIDIAN_KW), tempString1 );
-   }
-
-   if( ap.read("--color", stringParam1, stringParam2, stringParam3) )
-   {
-      m_kwl->addPair( COLOR_RED_KW,   tempString1 );
-      m_kwl->addPair( COLOR_GREEN_KW, tempString2 );
-      m_kwl->addPair( COLOR_BLUE_KW,  tempString3 );
-   }
-
-   if( ap.read("--color-table", stringParam1) )
-   {
-      m_kwl->addPair( LUT_FILE_KW, tempString1 );
-   }
-
-   if( ap.read("--contrast", stringParam1) )
-   {
-      m_kwl->addPair( CONTRAST_KW, tempString1 );
-   }
-
-   if( ap.read("--cut-width", stringParam1) )
-   {
-      m_kwl->addPair( CUT_WIDTH_KW,   tempString1 );
-   }
-   if( ap.read("--cut-height", stringParam1) )
-   {
-      m_kwl->addPair( CUT_HEIGHT_KW,  tempString1 );
-   }
-   if( ap.read("--cut-bbox-xywh", stringParam1) )
-   {
-      m_kwl->addPair(CUT_BBOX_XYWH_KW, tempString1);
-   }
-   if( ap.read("--cut-wms-bbox", stringParam1) )
-   {
-      m_kwl->addPair(CUT_WMS_BBOX_KW, tempString1);
-   }
-   if( ap.read("--cut-wms-bbox-ll", stringParam1) )
-   {
-      m_kwl->addPair(CUT_WMS_BBOX_LL_KW, tempString1);
-   }
-   
-   if( ap.read("--clip-wms-bbox-ll", stringParam1) )
-   {
-      m_kwl->addPair(CLIP_WMS_BBOX_LL_KW, tempString1);
-   }
-   
-   if( ap.read("--clip-poly-lat-lon", stringParam1) )
-   {
-      //std::vector<ossimGpt> result;
-      //ossim::toVector(result, ossimString(tempString1));
-      //std::cout << result[0] << std::endl;
-      //std::cout <<tempString1<<std::endl;
-      //exit(0);
-      m_kwl->addPair(CLIP_POLY_LAT_LON_KW, tempString1);
-   }
-
-   if( ap.read("--cut-bbox-ll", stringParam1, stringParam2, stringParam3, stringParam4) )
-   {
-      m_kwl->addPair( CUT_MIN_LAT_KW, tempString1 );
-      m_kwl->addPair( CUT_MIN_LON_KW, tempString2 );
-      m_kwl->addPair( CUT_MAX_LAT_KW, tempString3 );
-      m_kwl->addPair( CUT_MAX_LON_KW, tempString4 );
-   }
-
-   if( ap.read("--cut-bbox-llwh", stringParam1, stringParam2, stringParam3,
-               stringParam4, stringParam5, stringParam6) )
-   {
-      m_kwl->addPair( CUT_MIN_LAT_KW, tempString1 );
-      m_kwl->addPair( CUT_MIN_LON_KW, tempString2 );
-      m_kwl->addPair( CUT_MAX_LAT_KW, tempString3 );
-      m_kwl->addPair( CUT_MAX_LON_KW, tempString4 );
-      m_kwl->addPair( CUT_WIDTH_KW,   tempString5 );
-      m_kwl->addPair( CUT_HEIGHT_KW,  tempString6 );
-   }
-   
-   if( ap.read("--cut-center-llwh", stringParam1, stringParam2, stringParam3, stringParam4) )
-   {
-      m_kwl->addPair( CUT_CENTER_LAT_KW, tempString1 );
-      m_kwl->addPair( CUT_CENTER_LON_KW, tempString2 );
-      m_kwl->addPair( CUT_WIDTH_KW,      tempString3 );
-      m_kwl->addPair( CUT_HEIGHT_KW,     tempString4 );
-   }
-
-   if( ap.read("--cut-center-llr", stringParam1, stringParam2, stringParam3) )
-   {
-      m_kwl->addPair( CUT_CENTER_LAT_KW, tempString1 );
-      m_kwl->addPair( CUT_CENTER_LON_KW, tempString2 );
-      m_kwl->addPair( CUT_RADIUS_KW,     tempString3 );
-   }
-
-   int num_params = ap.numberOfParams("--degrees", doubleParam1);
-   if (num_params == 1)
-   {
-      ap.read("--degrees", doubleParam1);
-      m_kwl->add( DEGREES_X_KW.c_str(), tempDouble1 );
-      m_kwl->add( DEGREES_Y_KW.c_str(), tempDouble1 );
-   }
-   else if (num_params == 2)
-   {
-      ap.read("--degrees", doubleParam1, doubleParam2);
-      m_kwl->add( DEGREES_X_KW.c_str(), tempDouble1 );
-      m_kwl->add( DEGREES_Y_KW.c_str(), tempDouble2 );
-   }   
-
-   if ( ap.read("--elevation", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::ELEVATION_ANGLE_KW), tempString1 );
-   }
-
-   if ( ap.read("-e", stringParam1) || ap.read("--entry", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::ENTRY_KW), tempString1 );
-   }
-
-   if ( ap.read("--exaggeration", stringParam1) )
-   {
-      m_kwl->addPair( GAIN_KW, tempString1 );
-   }
-
-   if ( ap.read("--hemisphere", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::HEMISPHERE_KW), tempString1 );
-   }
-
-   if ( ap.read("--histogram-op", stringParam1) )
-   {
-      m_kwl->addPair( HISTO_OP_KW, tempString1 );
-   }
-
-   if ( ap.read("--image-space-scale", doubleParam1, doubleParam2) )
-   {
-      m_kwl->add( IMAGE_SPACE_SCALE_X_KW.c_str(), tempDouble1 );
-      m_kwl->add( IMAGE_SPACE_SCALE_Y_KW.c_str(), tempDouble2 );      
-   }
-
-   while( ap.read("--input-dem", stringParam1) )
-   {
-      key = DEM_KW;
-      key += ossimString::toString(demIdx);
-      key += ".";
-      key += FILE_KW;
-      m_kwl->addPair( key.string(), tempString1 );
-      ++demIdx;
-   }
-   
-   while( ap.read("--input-img", stringParam1) )
-   {
-      key = IMG_KW;
-      key += ossimString::toString(imgIdx);
-      key += ".";
-      key += FILE_KW;
-      m_kwl->addPair(key.string(), tempString1 );
-      ++imgIdx;
-   }
-
-   if( ap.read("--input-src", stringParam1) )
-   {
-      m_kwl->addPair( SRC_FILE_KW, tempString1 );
-   }
-
-   if( ap.read("--meters", stringParam1) )
-   {
-      m_kwl->addPair( METERS_KW, tempString1 );
-   }
-
-   if ( ap.read("-n") || ap.read("--north-up") )
-   {
-      m_kwl->addPair( NORTH_UP_KW, TRUE_KW);
-   }
-
-   if( ap.read("--op", stringParam1) )
-   {
-      m_kwl->addPair( OP_KW, tempString1 );
-   }
-
-   //---
-   // Deprecated: "--options-keyword-list"
-   //---
-   if( ap.read("--options", stringParam1) )
-   {
-      ossimFilename optionsKwl = tempString1;
-      if ( optionsKwl.exists() )
-      {
-         if ( m_kwl->addFile(optionsKwl) == false )
-         {
-            std::string errMsg = "ERROR could not open options keyword list file: ";
-            errMsg += optionsKwl.string();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = "ERROR options keyword list file does not exists: ";
-         errMsg += optionsKwl.string();
-         throw ossimException(errMsg); 
-      }
-   }
-   
-   if( ap.read("--origin-latitude", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::ORIGIN_LATITUDE_KW), tempString1 );
-   }
-
-   if(ap.read("--output-radiometry", stringParam1))
-   {
-      m_kwl->addPair( OUTPUT_RADIOMETRY_KW, tempString1 );
-   }
-   
-   if ( ap.read("--pad-thumbnail", stringParam1) )
-   {
-      m_kwl->addPair( PAD_THUMBNAIL_KW, tempString1 );
-   }
-   
-   if( ap.read("--projection", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::PROJECTION_KW), tempString1 );
-   }
-
-   if( ap.read("--resample-filter", stringParam1) )
-   {
-      m_kwl->addPair( RESAMPLER_FILTER_KW, tempString1 );
-   }
-
-   if ( ap.read("-r", stringParam1) || ap.read("--rotate", stringParam1) )
-   {
-      m_kwl->addPair( ROTATION_KW, tempString1 );
-   }
-
-   while (ap.read("--reader-prop", stringParam1))
-   {
-      key = READER_PROPERTY_KW;
-      key += ossimString::toString(readerPropIdx);
-      m_kwl->addPair(key.string(), tempString1 );
-      ++readerPropIdx;
-   }
-
-   if ( ap.read("--rrds", stringParam1) )
-   {
-      m_kwl->addPair( RRDS_KW, tempString1);
-   }
-
-   if ( ap.read("--scale-to-8-bit") )
-   {
-      m_kwl->addPair( SCALE_2_8_BIT_KW, TRUE_KW);
-   }
-
-   if ( ap.read("--sharpen-mode", stringParam1) )
-   {
-      m_kwl->addPair( SHARPEN_MODE_KW, tempString1 );
-   }
-
-   if ( ap.read("--snap-tie-to-origin") )
-   {
-      m_kwl->addPair( SNAP_TIE_TO_ORIGIN_KW, TRUE_KW);
-   }
-   
-   if( ap.read("--srs", stringParam1) )
-   {
-      ossimString os = tempString1;
-      if ( os.contains("EPSG:") )
-      {
-         os.gsub( ossimString("EPSG:"), ossimString("") );
-      }
-      m_kwl->addPair( SRS_KW, os.string() );
-   }
-
-   if( ap.read("-t", stringParam1) || ap.read("--thumbnail", stringParam1) )
-   {
-      m_kwl->addPair( THUMBNAIL_RESOLUTION_KW, tempString1 );
-   }
-
-   if ( ap.read("--three-band-out") )
-   {
-      m_kwl->addPair( THREE_BAND_OUT_KW, TRUE_KW);
-   }
-
-   if( ap.read("--tile-size", stringParam1) )
-   {
-      m_kwl->addPair( TILE_SIZE_KW, tempString1 );
-   }
-
-   if ( ap.read("-u") || ap.read("--up-is-up") )
-   {
-      m_kwl->addPair( UP_IS_UP_KW, TRUE_KW);
-   }
-
-   if( ap.read("-w", stringParam1) || ap.read("--writer", stringParam1) )
-   {
-      m_kwl->addPair( WRITER_KW, tempString1); 
-   }
-
-   while (ap.read("--writer-prop", stringParam1))
-   {
-      key = WRITER_PROPERTY_KW;
-      key += ossimString::toString(writerPropIdx);
-      m_kwl->addPair(key.string(), tempString1 );
-      ++writerPropIdx;
-   }
-
-   if( ap.read("--zone", stringParam1) )
-   {
-      m_kwl->addPair( std::string(ossimKeywordNames::ZONE_KW), tempString1); 
-   }
-   
-   if( ap.read("--2cmv-old-input-band", stringParam1) )
-   {
-      m_kwl->addPair( TWOCMV_OLD_INPUT_BAND_KW, tempString1 );
-   }
-
-   if( ap.read("--2cmv-new-input-band", stringParam1) )
-   {
-      m_kwl->addPair( TWOCMV_NEW_INPUT_BAND_KW, tempString1 );
-   }
-   if( ap.read("--2cmv-red-output-source", stringParam1) )
-   {
-      m_kwl->addPair( TWOCMV_RED_OUTPUT_SOURCE_KW, tempString1 );
-   }
-   
-   if( ap.read("--2cmv-green-output-source", stringParam1) )
-   {
-      m_kwl->addPair( TWOCMV_GREEN_OUTPUT_SOURCE_KW, tempString1 );
-   }
-   
-   if( ap.read("--2cmv-blue-output-source", stringParam1) )
-   {
-      m_kwl->addPair( TWOCMV_BLUE_OUTPUT_SOURCE_KW, tempString1 );
-   }
-   if(ap.read("--combiner-type", stringParam1))
-   {
-      m_kwl->addPair(COMBINER_TYPE_KW, tempString1);
-   }
-   // End of arg parsing.
-   ap.reportRemainingOptionsAsUnrecognized();
-   if ( ap.errors() )
-   {
-      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-      std::string errMsg = "Unknown option...";
-      throw ossimException(errMsg);
-   }
-
-   if ( ap.argc() >= 2 )
-   {
-      // Output file is last arg:
-      m_kwl->add( ossimKeywordNames::OUTPUT_FILE_KW, ap[ap.argc()-1]);
-   }
-   else
-   {
-      if ( !m_kwl->find(ossimKeywordNames::OUTPUT_FILE_KW) )
-      {
-         ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-         std::string errMsg = "Must supply an output file.";
-         throw ossimException(errMsg);
-      }
-   }
-
-   if ( ap.argc() > 2 ) // User passed inputs in front of output file.
-   {
-      int pos = 1; // ap.argv[0] is application name. 
-      while ( pos < (ap.argc()-1) )
-      {
-         ossimFilename file = ap[pos];
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "argv[" << pos << "]: " << file << "\n";
-         }
-         
-         if ( isDemFile(file) )
-         {
-            key = DEM_KW;
-            key += ossimString::toString(demIdx);
-            key += ".";
-            key += FILE_KW;
-            m_kwl->addPair( key, file.string() );
-            ++demIdx;
-         }
-         else if ( isSrcFile(file) ) 
-         {
-            if ( m_kwl->find( SRC_FILE_KW.c_str() ) ) // --input-src used also
-            {
-               std::string errMsg = MODULE;
-               errMsg += "ERROR Multiple src files passed in.  Please combine into one.";
-               throw ossimException(errMsg);
-            }
-            
-            m_kwl->addPair( SRC_FILE_KW, file.string() );
-         }
-         else // Add as an input image.
-         {
-            key = IMG_KW;
-            key += ossimString::toString(imgIdx);
-            key += ".";
-            key += FILE_KW;
-            m_kwl->addPair(key.string(), file.string() );
-            ++imgIdx;
-         }
-         
-         ++pos; // Go to next arg...
-         
-      } // End: while ( pos < (ap.argc()-1) )
-       
-   } // End: if ( ap.argc() > 2 )
-
-   initialize();
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
-   }  
-   return true;
-   
-} // End: void ossimChipperUtil::initialize(ossimArgumentParser& ap)
-
-void ossimChipperUtil::initialize( const ossimKeywordlist& kwl )
-{
-   clear();
-
-   // Start with clean options keyword list.
-   m_kwl->clear();
-
-   m_kwl->addList( kwl, true );
-
-   initialize();
-}
-
-void ossimChipperUtil::initialize()
-{
-   static const char MODULE[] = "ossimChipperUtil::initialize()";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   
-   if ( traceOptions() )
-   {
-      ossimFilename optionsFile;
-      getOutputFilename(optionsFile);
-      optionsFile = optionsFile.noExtension();
-      optionsFile += "-options.kwl";
-      ossimString comment = " Can be use for --options argument.";
-      m_kwl->write( optionsFile.c_str(), comment.c_str() );
-   }
-
-   // Determine the operation to do.
-   std::string op = m_kwl->findKey( OP_KW );
-   if ( op.size() )
-   {
-      ossimString s = op;
-      s.downcase();
-      
-      if ( s == "chip" )
-      {
-         m_operation = OSSIM_CHIPPER_OP_CHIP;
-      }
-      else if ( s == "hillshade" )
-      {
-         m_operation = OSSIM_CHIPPER_OP_HILL_SHADE;
-      }
-
-      else if ( s == "color-relief" )
-      {
-         m_operation = OSSIM_CHIPPER_OP_COLOR_RELIEF;
-      }
-      else if ( s == "ortho" )
-      {
-         m_operation = OSSIM_CHIPPER_OP_ORTHO;
-      }
-      else if ( s == "psm" )
-      {
-         m_operation = OSSIM_CHIPPER_OP_PSM;
-      }
-      else if ( s == "2cmv" )
-      {
-         m_operation = OSSIM_CHIPPER_OP_2CMV;
-      }
-      else
-      {
-         std::string errMsg = "unknown operation: ";
-         errMsg += s.string();
-         throw ossimException(errMsg);
-      }
-   }
-   else
-   {
-      std::string errMsg = "keyword not found: ";
-      errMsg += OP_KW;
-      errMsg += "\nUse --op option to specify operation.\n";
-      throw ossimException(errMsg);  
-   }
-
-   //---
-   // Populate the m_srcKwl if --src option was set.
-   // Note do this before creating chains.
-   //---
-   initializeSrcKwl();
-   
-   // Check for required inputs. Do this after initializeSrcKwl.
-   if ( m_operation == OSSIM_CHIPPER_OP_CHIP )
-   {
-      if ( getNumberOfInputs() != 1 )
-      {
-         std::ostringstream errMsg;
-         errMsg << op << " operation takes one input.";
-         throw ossimException( errMsg.str() );
-      }
-   }
-   
-   if ( ( m_operation == OSSIM_CHIPPER_OP_2CMV ) || ( m_operation == OSSIM_CHIPPER_OP_PSM ) )
-   {
-      if ( getNumberOfInputs() != 2 )
-      {
-         std::ostringstream errMsg;
-         errMsg << op << " operation requires two inputs.";
-         throw ossimException( errMsg.str() );
-      }
-   }
-
-   // Sanity check rotation options.
-   if ( upIsUp() || northUp() || hasRotation() )
-   {
-      std::string option;
-      ossim_uint32 rotationOptionCount = 0;
-      if ( upIsUp() )
-      {
-         option = UP_IS_UP_KW;
-         ++rotationOptionCount; 
-      }
-      if ( northUp() )
-      {
-         option = NORTH_UP_KW;
-         ++rotationOptionCount; 
-      }
-      if ( hasRotation() )
-      {
-         option = ROTATION_KW; 
-         ++rotationOptionCount;
-      }
-
-      // Can only do ONE rotation option.
-      if ( rotationOptionCount > 1 )
-      {
-         std::ostringstream errMsg;
-         if ( upIsUp() )
-         {
-            errMsg << UP_IS_UP_KW << " is on.\n";
-         }
-         if ( northUp() )
-         {
-            errMsg << NORTH_UP_KW << " is on.\n";
-         }
-         if ( hasRotation() )
-         {
-            errMsg << ROTATION_KW << " is on.\n";
-         }
-         errMsg << "Multiple rotation options do not make sense!";
-         throw ossimException( errMsg.str() );
-      }
-         
-      // One input, chip operation only.
-      if ( getNumberOfInputs() != 1 )
-      {
-         std::ostringstream errMsg;
-         errMsg << option << " option takes one input.";
-         throw ossimException( errMsg.str() );
-      }
-
-      if ( m_operation != OSSIM_CHIPPER_OP_CHIP )
-      {
-         std::ostringstream errMsg;
-         errMsg << option << " option only valid with \"chip\" operation.";
-         throw ossimException( errMsg.str() );
-      }
-   }
-
-   // Create chains for any dem sources.
-   addDemSources();
-
-   // Create chains for any image sources.
-   addImgSources();
-
-   // Initialize projection and propagate to chains.
-   initializeOutputProjection();
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "options keyword list:\n"
-         << *(m_kwl.get()) << "\n";
-      
-      if ( m_srcKwl.valid() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "support record keyword list:\n"
-            << *(m_srcKwl.get()) << "\n";
-      }
-      
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-   
-} // End: void ossimChipperUtil::initialize()
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeChain( ossimIrect& aoi )
-{
-   static const char MODULE[] = "ossimChipperUtil::initializeChain";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimString lookup;  // used throughout...
-
-   ossimRefPtr<ossimImageSource> source = 0;
-
-   if ( hasBumpShadeArg() )
-   {
-      // Create chain:
-      source = initializeBumpShadeChain();
-   }
-   else if ( m_operation == OSSIM_CHIPPER_OP_COLOR_RELIEF )
-   {
-      source = initializeColorReliefChain();
-   }
-   else if ( ( m_operation == OSSIM_CHIPPER_OP_CHIP ) ||
-             ( m_operation == OSSIM_CHIPPER_OP_ORTHO ) )  
-   {
-      source = combineLayers();
-   }
-   else if ( m_operation == OSSIM_CHIPPER_OP_2CMV )
-   {
-      source = initialize2CmvChain(); // Two Color Multiview.
-   }
-   else if ( m_operation == OSSIM_CHIPPER_OP_PSM )
-   {
-      source = initializePsmChain(); // Pan sharpened multispectral.
-   }
-
-   if ( source.valid() )
-   {
-      //---
-      // This is conditional.  Output radiometry may of may not be set.  This can also be set at
-      // the ossimSingleImageChain level.
-      //---
-      if ( ( getOutputScalarType() != OSSIM_SCALAR_UNKNOWN) &&
-           ( source->getOutputScalarType() != getOutputScalarType() ) )
-      {
-         source = addScalarRemapper( source, getOutputScalarType() );
-      }
-      
-      //---
-      // Get the area of interest. This will be the scene bounding rect if not
-      // explicitly set by user with one of the --cut options.
-      //  Need to get this before the thumbnail code.
-      //---
-      getAreaOfInterest(source.get(), aoi);
-
-      //---
-      // Set the image size here.  Note must be set after combineLayers.  This is needed for
-      // the ossimImageGeometry::worldToLocal call for a geographic projection to handle wrapping
-      // accross the date line.
-      //---
-      m_geom->setImageSize( aoi.size() );
-
-      if ( hasThumbnailResolution() )
-      {
-         //---
-         // Adjust the projection scale and get the new rect.
-         // Note this will resize the ossimImageGeometry::m_imageSize is scale changes.
-         //---
-         initializeThumbnailProjection( aoi, aoi );
-
-         // Reset the source bounding rect if it changed.
-         source->initialize();
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-
-   return source;
-}
-
-void ossimChipperUtil::setOptionsToChain(
-   ossimIrect& aoi, const ossimKeywordlist& /* kwl */ )
-{
-   getAreaOfInterest(m_source.get(), aoi);  
-}
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeBumpShadeChain()
-{
-   static const char MODULE[] = "ossimChipperUtil::initializeBumpShadeChain";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimString lookup;
-   ossimRefPtr<ossimImageSource> source = 0;
-
-   // Combine the dems.
-   ossimRefPtr<ossimImageSource> demSource = combineLayers( m_demLayer );
-   
-   // Set up the normal source.
-   ossimRefPtr<ossimImageToPlaneNormalFilter> normSource = new ossimImageToPlaneNormalFilter;
-
-   //---
-   // Set the track scale flag to true.  This enables scaling the surface
-   // normals by the GSD in order to maintain terrain proportions.
-   //---
-   normSource->setTrackScaleFlag(true);
-   
-   // Connect to dems.
-   normSource->connectMyInputTo( demSource.get() );
-   
-   // Set the smoothness factor.
-   ossim_float64 gain = 1.0;
-   lookup = m_kwl->findKey( GAIN_KW );
-   if ( lookup.size() )
-   {
-      gain = lookup.toFloat64();
-   }
-   normSource->setSmoothnessFactor(gain);
-
-   ossimRefPtr<ossimImageSource> colorSource = 0;
-   if ( hasLutFile() )
-   {
-      if ( m_imgLayer.size() )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << MODULE << " WARNING:"
-            << "\nBoth a color table and image(s) have been provided for a color source.\n"
-            << "Choosing color table of image(s).\n";
-      }
-
-      colorSource = addIndexToRgbLutFilter( demSource );
-   }
-   else
-   {
-      // Combine the images and set as color source for bump shade.
-      colorSource = combineLayers( m_imgLayer );
-   }
-
-   // Create the bump shade.
-   ossimRefPtr<ossimBumpShadeTileSource> bumpShade = new ossimBumpShadeTileSource;
-
-   // Set the azimuth angle.
-   ossim_float64 azimuthAngle = 180;
-   lookup = m_kwl->findKey( ossimKeywordNames::AZIMUTH_ANGLE_KW );
-   if ( lookup.size() )
-   {
-      ossim_float64 f = lookup.toFloat64();
-      if ( (f >= 0) && (f <= 360) )
-      {
-         azimuthAngle = f;
-      }
-   }
-   bumpShade->setAzimuthAngle(azimuthAngle);
-
-   // Set the elevation angle.
-   ossim_float64 elevationAngle = 45.0;
-   lookup = m_kwl->findKey( ossimKeywordNames::ELEVATION_ANGLE_KW );
-   if ( lookup.size() )
-   {
-      ossim_float64 f = lookup.toFloat64();
-      if ( (f >= 0.0) && (f <= 90) )
-      {
-         elevationAngle = f;
-      }
-   }
-   bumpShade->setElevationAngle(elevationAngle);
-
-   if ( !hasLutFile() )
-   {
-      // Set the color.
-      ossim_uint8 r = 0xff;
-      ossim_uint8 g = 0xff;
-      ossim_uint8 b = 0xff;
-      lookup = m_kwl->findKey( COLOR_RED_KW );
-      if ( lookup.size() )
-      {
-         r = lookup.toUInt8();
-      }
-      lookup = m_kwl->findKey( COLOR_GREEN_KW );
-      if ( lookup.size() )
-      {
-         g = lookup.toUInt8();
-      }
-      lookup = m_kwl->findKey( COLOR_BLUE_KW );
-      if ( lookup.size() )
-      {
-         b = lookup.toUInt8();
-      }
-      bumpShade->setRgbColorSource(r, g, b);
-   }
-
-   // Connect the two sources.
-   bumpShade->connectMyInputTo(0, normSource.get());
-   bumpShade->connectMyInputTo(1, colorSource.get());
-   
-   if ( traceDebug() )
-   {
-      ossim_uint8 r = 0xff;
-      ossim_uint8 g = 0xff;
-      ossim_uint8 b = 0xff;
-      bumpShade->getRgbColorSource(r, g, b);
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nazimuthAngle:      " << azimuthAngle
-         << "\nelevation angle:   " << elevationAngle
-         << "\ngain factor:       " << gain
-         << "\nr:                 " << int(r)
-         << "\ng:                 " << int(g)
-         << "\nb:                 " << int(b)
-         << "\n";
-   }
-   
-   // Capture the pointer to give to the writer.
-   source = bumpShade.get();
-
-   return source;
-   
-} // End: ossimChipperUtil::initializeBumpShadeChain()
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeColorReliefChain()
-{
-   ossimRefPtr<ossimImageSource> result = combineLayers();
-   if ( hasLutFile() )
-   {
-      result = addIndexToRgbLutFilter( result );
-   }
-   else
-   {
-      // No LUT file provided, so doing the default 8-bit linear stretch:
-      if ( result->getOutputScalarType() != OSSIM_UINT8 )
-      {
-         result = addScalarRemapper( result, OSSIM_UINT8 );
-      }
-   }
-   return result;  
-}
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::initializePsmChain()
-{
-   ossimRefPtr<ossimImageSource> result = 0;
-   
-   ossim_uint32 layerCount = (ossim_uint32) (m_demLayer.size() + m_imgLayer.size());
-
-   // Must have two and only two inputs.
-   if ( layerCount == 2 )
-   {     
-      ossimRefPtr<ossimSingleImageChain> input1 = 0; // First input should be color.
-      ossimRefPtr<ossimSingleImageChain> input2 = 0; // Second input should be pan.
-
-      // Most likely case, two image layers.
-      if ( m_imgLayer.size() )
-      {
-         input1 = m_imgLayer[0].get();
-         
-         if ( m_imgLayer.size() == 2 )
-         {
-            input2 = m_imgLayer[1].get();
-         }
-      }
-
-      if ( m_demLayer.size() )
-      {
-         if ( !input1.valid() )
-         {
-            input1 = m_demLayer[0].get();
-         }
-
-         if ( !input2.valid() )
-         {
-            if ( m_demLayer.size() == 1 )
-            {
-               input2 = m_demLayer[0].get();
-            }
-            else if ( m_demLayer.size() == 2 )
-            {
-               input2 = m_demLayer[1].get();
-            }
-         }
-      }
-
-      if ( input1.valid() && input2.valid() )
-      {
-         // Make the color input the first connection to the combiner.
-         if ( input1->getNumberOfOutputBands() == 1 )
-         {
-            // Swap:
-            ossimRefPtr<ossimSingleImageChain> tmpChain = input1;
-            input1 = input2;
-            input2 = tmpChain;
-         }
-
-         //---
-         // Check the pan source for one band:
-         // This really shouldn't happen, i.e. caller should typically pass a
-         // one band pan image that is higher resolution than the color source.
-         //---
-         if ( input2->getNumberOfOutputBands() > 1 )
-         {
-            // Note this will add a band selector if there isn't one in chain.
-            std::vector<ossim_uint32> bandList(1);
-            bandList[0] = 0;
-            input2->setBandSelection( bandList );
-         }
-
-         // TODO: Make dynamic by type.
-         ossimRefPtr<ossimFusionCombiner> psm = new ossimSFIMFusion();
-         psm->connectMyInputTo(0, input1.get());
-         psm->connectMyInputTo(1, input2.get());
-         psm->initialize();
-         result = dynamic_cast<ossimImageSource*>(psm.get());
-      }
-      
-   } // Matches: if ( layerCount == 2 ) 
-   
-   return result;
-   
-} // End: ossimChipperUtil::initializePsmChain() 
-
-void ossimChipperUtil::initializeOutputProjection()
-{
-   if ( isIdentity() )
-   {
-      createIdentityProjection();
-   }
-   else
-   {
-      // Create the output projection.
-      createOutputProjection();
-      
-      // Setup the view in all the chains.
-      propagateOutputProjectionToChains();
-   }
-}
-
-void ossimChipperUtil::execute()
-{
-   static const char MODULE[] = "ossimChipperUtil::execute";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimIrect aoi;
-   ossimRefPtr<ossimImageSource> source = initializeChain( aoi );
-
-   if ( source.valid() && !aoi.hasNans() )
-   {
-      //---
-      // Add a cut filter. This will:
-      // 1) Null out/clip any data pulled in.
-      // 2) Speed up by not propagating get tile request outside the cut or "aoi"
-      //    to the left hand side(input).
-      //---
-      ossimRefPtr<ossimRectangleCutFilter> cutter = new ossimRectangleCutFilter();
-
-      // Set the cut rectangle:
-      cutter->setRectangle( aoi );
-
-      // Null outside.
-      cutter->setCutType( ossimRectangleCutFilter::OSSIM_RECTANGLE_NULL_OUTSIDE );
-
-      // Connect cutter input to source chain.
-      cutter->connectMyInputTo( 0, source.get() );
-      
-      // Set up the writer.
-      m_writer = createNewWriter();
-
-      // Connect the writer to the cutter.
-      m_writer->connectMyInputTo(0, cutter.get());
-
-      //---
-      // Set the area of interest.
-      // NOTE: This must be called after the writer->connectMyInputTo as
-      // ossimImageFileWriter::initialize incorrectly resets theAreaOfInterest
-      // back to the bounding rect.
-      //---
-      m_writer->setAreaOfInterest(aoi);
-
-      if (m_writer->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
-      {
-         // Add a listener to get percent complete.
-         ossimStdOutProgress prog(0, true);
-         m_writer->addListener(&prog);
-
-         if ( traceLog() )
-         {
-            ossimKeywordlist logKwl;
-            m_writer->saveStateOfAllInputs(logKwl);
-            
-            ossimFilename logFile;
-            getOutputFilename(logFile);
-            logFile.setExtension("log");
-
-            logKwl.write( logFile.c_str() );
-         }
-         
-         // Write the file:
-         m_writer->execute();
-
-         m_writer->removeListener(&prog);
-
-         if(m_writer->isAborted())
-         {
-            throw ossimException( "Writer Process aborted!" );
-         }
-      }
-      else
-      {
-         throw ossimException( "Unable to initialize writer for execution" );
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }   
-}
-void ossimChipperUtil::abort()
-{
-   if(m_writer.valid())
-   {
-      m_writer->abort();
-   }
-}
-  
-ossimRefPtr<ossimImageData> ossimChipperUtil::getChip(const ossimKeywordlist& optionsKwl)
-{
-  ossimRefPtr<ossimImageData> result = 0;
-
-  ossimIrect aoi;
-  
-  if(optionsKwl.getSize() > 0)
-  {
-    m_kwl->addList(optionsKwl, true);
-  }
-
-  // (GP)
-  // Until we add more ellaborate code to check for scale changes 
-  // as well as moving windows we will just always initialize
-  // the output projection
-  //
-  initializeOutputProjection();
-  if(!m_source.valid())
-  {
-    m_source = initializeChain( aoi );
-  }
-  getAreaOfInterest(m_source.get(), aoi);
-
-  m_geom->setImageSize( aoi.size() );
-
-  if ( m_source.valid() )
-  {    
-    result = m_source->getTile( aoi, 0 );
-  }
-
-   return result;
-}
-
-void ossimChipperUtil::addDemSources()
-{
-   static const char MODULE[] = "ossimChipperUtil::addDemSources";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   // Add the images from the options keyword list.
-   ossim_uint32 demCount = m_kwl->numberOf( DEM_KW.c_str() );
-   ossim_uint32 maxIndex = demCount + 100; // Allow for skippage in numbering.
-   ossim_uint32 foundRecords = 0;
-   ossim_uint32 i = 0;
-   while ( foundRecords < demCount )
-   {
-      ossimString key = DEM_KW;
-      key += ossimString::toString(i);
-      key += ".";
-      key += FILE_KW;
-      ossimFilename f = m_kwl->findKey( key.string() );
-      if ( f.size() )
-      {
-         // Look for the entry key, e.g. dem0.entry: 10
-         ossim_uint32 entryIndex = 0;
-         key = DEM_KW;
-         key += ossimString::toString(i);
-         key += ".";
-         key += ossimKeywordNames::ENTRY_KW;
-         std::string value = m_kwl->findKey( key.string() );
-         if ( value.size() )
-         {
-            entryIndex = ossimString(value).toUInt32();
-         }
-         else
-         {
-            // Get global entry.  Set by "-e" on command line apps.
-            entryIndex = getEntryNumber();
-         }
-         
-         addDemSource( f, entryIndex );
-         ++foundRecords;
-      }
-      ++i;
-      if ( i >= maxIndex ) break;
-   }
-
-   if ( m_srcKwl.valid() )
-   {
-      // Add stuff from src keyword list.
-      demCount = m_srcKwl->numberOf( DEM_KW.c_str() );
-      maxIndex = demCount + 100;
-      foundRecords = 0;
-      i = 0;
-      while ( foundRecords < demCount )
-      {
-         ossimString prefix = DEM_KW;
-         prefix += ossimString::toString(i);
-         prefix += ".";
-         ossimSrcRecord src;
-         if ( src.loadState( *(m_srcKwl.get()), prefix ) )
-         {
-            addDemSource(src);
-            ++foundRecords;
-         }
-         ++i;
-         if ( i >= maxIndex ) break;
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   } 
-}
-
-void ossimChipperUtil::addDemSource(const ossimFilename& file, ossim_uint32 entryIndex)
-{
-   static const char MODULE[] = "ossimChipperUtil::addDemSource(const ossimFilename&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(file, entryIndex, true);
-   if ( ic.valid() )
-   {
-      m_demLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-void ossimChipperUtil::addDemSource(const ossimSrcRecord& rec)
-{
-   static const char MODULE[] = "ossimChipperUtil::addDemSource(const ossimSrcRecord&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(rec, true);
-   if ( ic.valid() )
-   {
-      m_demLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-void ossimChipperUtil::addImgSources()
-{
-   static const char MODULE[] = "ossimChipperUtil::addImgSources";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-   
-   ossim_uint32 imgCount = m_kwl->numberOf( IMG_KW.c_str() );
-   ossim_uint32 maxIndex = imgCount + 100; // Allow for skippage in numbering.
-   ossim_uint32 foundRecords = 0;
-   ossim_uint32 i = 0;
-   while ( foundRecords < imgCount )
-   {
-      ossimString key = IMG_KW;
-      key += ossimString::toString(i);
-      key += ".";
-      key += FILE_KW;
-      ossimFilename f = m_kwl->findKey( key.string() );
-      if ( f.size() )
-      {
-         // Look for the entry key, e.g. image0.entry: 10
-         ossim_uint32 entryIndex = 0;
-         key = IMG_KW;
-         key += ossimString::toString(i);
-         key += ".";
-         key += ossimKeywordNames::ENTRY_KW;
-         std::string value = m_kwl->findKey( key.string() );
-         if ( value.size() )
-         {
-            entryIndex = ossimString(value).toUInt32();
-         }
-         else
-         {
-            // Get global entry.  Set by "-e" on command line apps.
-            entryIndex = getEntryNumber();
-         }
-         // Add it:
-         addImgSource(f, entryIndex );         
-         ++foundRecords;
-      }
-      ++i;
-      if ( i >= maxIndex ) break;
-   }
-
-   if ( m_srcKwl.valid() )
-   {
-      // Add stuff from src keyword list.
-      imgCount = m_srcKwl->numberOf( IMG_KW.c_str() );
-      maxIndex = imgCount + 100;
-      foundRecords = 0;
-      i = 0;
-      while ( foundRecords < imgCount )
-      {
-         ossimString prefix = IMG_KW;
-         prefix += ossimString::toString(i);
-         prefix += ".";
-         ossimSrcRecord src;
-         if ( src.loadState( *(m_srcKwl.get()), prefix ) )
-         {
-            addImgSource(src);
-            ++foundRecords;
-         }
-         ++i;
-         if ( i >= maxIndex ) break;
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::addImgSource(const ossimFilename& file, ossim_uint32 entryIndex)
-{
-   static const char MODULE[] = "ossimChipperUtil::addImgSource";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\nFile: " << file << "\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(file, entryIndex, false);
-   if ( ic.valid() )
-   {
-      m_imgLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-void ossimChipperUtil::addImgSource(const ossimSrcRecord& rec)
-{
-   static const char MODULE[] = "ossimChipperUtil::addImgSource(const ossimSrcRecord&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimSingleImageChain> ic = createChain(rec, false);
-   if ( ic.valid() )
-   {
-      m_imgLayer.push_back(ic);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
-   }
-}
-
-ossimRefPtr<ossimSingleImageChain> ossimChipperUtil::createChain(const ossimFilename& file,
-                                                                 ossim_uint32 entryIndex,
-                                                                 bool isDemSource) const
-{
-   static const char MODULE[] = "ossimChipperUtil::createChain(const ossimFilename&";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\nfile: " << file
-         << "\nentry: " << entryIndex
-         << "\nisDemSource: " << (isDemSource?"true":"false")
-         << "\n";
-   }   
-   
-   ossimRefPtr<ossimSingleImageChain> ic = 0;
-
-   if ( file.size() )
-   {
-      if ( file.exists() )
-      {
-         ic = new ossimSingleImageChain;
-         if ( ic->open( file ) )
-         {
-            // Set any reader props:
-            setReaderProps( ic->getImageHandler().get() );
-            
-            // we can't guarantee the state of the image handler at this point so
-            // let's make sure that the entry is always set to the requested location
-            //  On Cib/Cadrg we were having problems.  Removed the compare for entry 0
-            //
-
-             if ( setChainEntry( ic, entryIndex ) == false )
-             {
-                std::ostringstream errMsg;
-                errMsg << MODULE << " ERROR:\nEntry " << entryIndex << " out of range!"
-                       << std::endl;
-                throw ossimException( errMsg.str() );
-             }
-
-            //---
-            // If PSM (pan sharpening) operation and this input is one band, don't
-            // mess with its bands.
-            //---
-            bool psmPanInput = false;
-            if ( ( m_operation == OSSIM_CHIPPER_OP_PSM ) && ( ic->getNumberOfOutputBands() == 1 ) )
-            {
-               psmPanInput = true;
-            }
-            
-            // Bands selection.  Note: Not performed on PSM pan band.
-            if ( !psmPanInput )
-            {
-               if ( isThreeBandOut() )
-               {
-                  //---
-                  // This will guarantee three bands out.  Will put band selector at
-                  // the end of the chain if input is one band.
-                  //---
-                  ic->setThreeBandFlag( true );
-               }
-
-               if ( hasBandSelection() ) 
-               {
-                  // User entered band list.
-                  std::vector<ossim_uint32> bandList(0);
-                  getBandList( bandList );
-                  if ( bandList.size() )
-                  {
-                     ic->setBandSelection( bandList );
-                  }
-               }
-            }
-            
-            //---
-            // If multiple inputs and scaleToEightBit do it at the end of the processing
-            // chain to alleviate un-even stretches between inputs.
-            //---
-            const ossim_uint32 INPUT_COUNT = getNumberOfInputs();
-            bool scaleFlag = ( scaleToEightBit() && (INPUT_COUNT == 1) );
-            ic->setRemapToEightBitFlag( scaleFlag );
-            
-            // Always have resampler cache.
-            ic->setAddResamplerCacheFlag(true);
-
-            //---
-            // Don't need a chain cache as we're doing a sequential write.  So the same tile
-            // should never be visited more than once.
-            //---
-            ic->setAddChainCacheFlag(false);
-
-            //---
-            // Histogram:
-            // Don't apply histogram stretch to dem sources for hill shade
-            // operation.
-            //---
-            if ( ( isDemSource == false ) ||
-                 ( isDemSource && (m_operation != OSSIM_CHIPPER_OP_HILL_SHADE) ) )
-            {
-               ic->setAddHistogramFlag( hasHistogramOperation() );
-            }
-
-            // Brightness, contrast. Note in same filter.
-            if ( hasBrightnesContrastOperation() )
-            {
-               ic->setBrightnessContrastFlag(true);
-            }
-
-            std::string sharpnessMode = getSharpenMode();
-            if ( sharpnessMode.size() )
-            {
-               ic->setSharpenFlag(true);
-            }
-
-            // Create the chain.
-            ic->createRenderedChain();
-
-            // Set the filter type if needed.
-            ossimString lookup = m_kwl->findKey( RESAMPLER_FILTER_KW );
-            if ( lookup.size() )
-            {
-               // Assumption image renderer is in chain:
-               ic->getImageRenderer()->getResampler()->setFilterType( lookup );
-            }
-
-            // Histogram setup.
-            if ( hasHistogramOperation() )
-            {
-               setupChainHistogram( ic );
-            }
-
-            // Brightness constrast setup:
-            if ( hasBrightnesContrastOperation() )
-            {
-               // Assumption bright contrast filter in chain:
-               
-               ossim_float64 value = getBrightness();
-               ic->getBrightnessContrast()->setBrightness( value );
-               
-               value = getContrast();
-               ic->getBrightnessContrast()->setContrast( value );
-            }
-
-            // Sharpness:
-            if ( sharpnessMode.size() )
-            {
-               if ( sharpnessMode == "light" )
-               {
-                  ic->getSharpenFilter()->setWidthAndSigma( 3, 0.5 );
-               }
-               else if ( sharpnessMode == "heavy" )
-               {
-                  ic->getSharpenFilter()->setWidthAndSigma( 5, 1.0 );
-               }
-            }
-
-            if(hasGeoPolyCutterOption())
-            {
-               ossimGeoPolygon polygon;
-               getClipPolygon(polygon);
-               if(polygon.size()>0)
-               {
-                  ic->addGeoPolyCutterPolygon(polygon);
-               }
-            }
-         }
-      }
-   }
-
-   if ( ic.valid() == false )
-   {
-      std::string errMsg = "Could not open: ";
-      errMsg += file.string();
-      throw ossimException(errMsg); 
-   }
-
-   if ( traceDebug() )
-   {
-      ossimKeywordlist kwl;
-      ic->saveState(kwl, 0);
-
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "chain:\n" << kwl << "\n"
-         << MODULE << " exiting...\n";
-   }   
-
-   return ic;
-}
-
-ossimRefPtr<ossimSingleImageChain> ossimChipperUtil::createChain(const ossimSrcRecord& rec,
-                                                                 bool isDemSource) const
-{
-   static const char MODULE[] = "ossimChipperUtil::createChain(const ossimSrcRecord&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }   
-   
-   ossimRefPtr<ossimSingleImageChain> ic = new ossimSingleImageChain;
-   if ( ic->open(rec) )
-   {
-      //---
-      // If multiple inputs and scaleToEightBit do it at the end of the processing
-      // chain to alleviate un-even strectes between inputs.
-      //---
-      bool scaleFlag = ( scaleToEightBit() && ( getNumberOfInputs() == 1) );
-      ic->setRemapToEightBitFlag( scaleFlag );
-      
-      // Always have resampler cache.
-      ic->setAddResamplerCacheFlag(true);
-      
-      //---
-      // Don't need a chain cache as we're doing a sequential write.  So the same tile
-      // should never be visited more than once.
-      //---
-      ic->setAddChainCacheFlag(false);
-
-      // Histogram.
-      if ( isDemSource == false )
-      {
-         ic->setAddHistogramFlag( hasHistogramOperation() );
-      }
-
-      //---
-      // NOTE: Histogram and band selector can be set in ic->createRenderedChain(rec)
-      // if the right keywords are there.
-      //---
-      ic->createRenderedChain(rec);
-
-      // Set the filter type if needed.
-      ossimString lookup = m_kwl->findKey( RESAMPLER_FILTER_KW );
-      if ( lookup.size() )
-      {
-         ic->getImageRenderer()->getResampler()->setFilterType( lookup );
-      }
-   }
-   else // Open failed.
-   {
-      std::string errMsg = "Could not open from src record!";
-      throw ossimException(errMsg); 
-   }
-
-   if ( traceDebug() )
-   {
-      ossimKeywordlist kwl;
-      ic->saveState(kwl, 0);
-
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "chain:\n" << kwl << "\n"
-         << MODULE << " exiting...\n";
-   }   
-
-   return ic;
-}
-   
-void ossimChipperUtil::createOutputProjection()
-{
-   static const char MODULE[] = "ossimChipperUtil::createOutputProjection";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   std::string op  = m_kwl->findKey( std::string(ossimKeywordNames::PROJECTION_KW) );
-   std::string srs = m_kwl->findKey( SRS_KW );
-   
-   if ( op.size() && srs.size() )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << MODULE << " WARNING:"
-         << "\nBoth " << SRS_KW << " and " << ossimKeywordNames::PROJECTION_KW
-         << " keywords are set!"
-         << "\nsrs:               " << srs
-         << "\noutput_projection: " << op
-         << "\nTaking " << srs << " over " << op << "\n";
-   }
-   
-   bool usingInput = false;
-   ossimChipperOutputProjection projType = getOutputProjectionType();
-   ossimRefPtr<ossimMapProjection> proj = 0;
-   
-   // If an srs code use that first.
-   if ( srs.size() )
-   {
-      proj = getNewProjectionFromSrsCode( srs );
-   }
-   else if ( op.size() )
-   {
-      switch ( projType )
-      {
-         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO:
-         {
-            proj = getNewGeoProjection();
-            break;
-         }
-         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO_SCALED:
-         {
-            proj = getNewGeoScaledProjection();
-            break;
-         }
-         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_INPUT:
-         {
-            proj = getFirstInputProjection();
-            usingInput = true;
-            break;
-         }
-         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_UTM:
-         {
-            proj = getNewUtmProjection();
-            break;
-         }
-         default:
-         {
-            break; // Just for un-handled type warning.
-         }
-      }
-   }
-   
-   // Check for identity projection:
-   ossimRefPtr<ossimMapProjection> inputProj = getFirstInputProjection();   
-   if ( proj.valid() && inputProj.valid() )
-   {
-      if ( *(inputProj.get()) == *(proj.get()) )
-      {
-         if ( projType == OSSIM_CHIPPER_PROJ_GEO_SCALED )
-         {
-            // Get the origin used for scaling. 
-            ossimGpt origin = proj->getOrigin();
-
-            // Copy the input projection to our projection.  Has the tie and scale we need.
-            proj = inputProj;
-
-            // Set the origin for scaling.
-            proj->setOrigin(origin);
-         }
-         else
-         {
-            proj = inputProj;
-         }
-         usingInput = true;
-      }
-   }
-   
-   if ( !proj.valid() )
-   {
-      // Try first input. If map projected use that.
-      if ( inputProj.valid() )
-      {
-         proj = inputProj;
-         usingInput = true;
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "WARNING: No projection set!"
-               << "\nDefaulting to first input's projection.\n";
-         }
-      }
-      else
-      {
-         proj = getNewGeoScaledProjection();
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "WARNING: No projection set!"
-               << "\nDefaulting to scaled geographic at scene center.\n";
-         }
-      }
-   }
-
-   // Create our ossimImageGeometry with projection (no transform).
-   m_geom  = new ossimImageGeometry( 0, proj.get() );
-
-   //---
-   // If the input is the same as output projection do not modify; else, set
-   // the gsd to user selected "METERS_KW" or the best resolution of the inputs,
-   // set the tie and then snap it to the projection origin.
-   //---
-   if ( !usingInput || hasScaleOption() )
-   {
-      // Set the scale.
-      initializeProjectionGsd();
-   }
-
-   // Set the tie.
-   intiailizeProjectionTiePoint();
-
-   if ( snapTieToOrigin() )
-   {
-      // Adjust the projection tie to the origin.
-      proj->snapTiePointToOrigin();
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "using input projection: " << (usingInput?"true":"false")
-         << "\noutput image geometry:\n";
-
-      m_geom->print(ossimNotify(ossimNotifyLevel_DEBUG));
-
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-   
-} // End: ossimChipperUtil::createOutputProjection()
-
-void ossimChipperUtil::createIdentityProjection()
-{
-   static const char MODULE[] = "ossimChipperUtil::createIdentityProjection";
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   // Get the singe image chain.  Sould be only one.
-   ossimRefPtr<ossimSingleImageChain> sic = 0;
-   if ( m_demLayer.size() )
-   {
-      sic = m_demLayer[0];
-   }
-   else if ( m_imgLayer.size() )
-   {
-      sic = m_imgLayer[0];
-   }
-
-   if ( sic.valid() )
-   {
-      // Get the image handler.
-      ossimRefPtr<ossimImageHandler>  ih = sic->getImageHandler();
-
-      // Resampler:
-      ossimRefPtr<ossimImageRenderer> resampler = sic->getImageRenderer();
-
-      if ( ih.valid() )
-      {
-         //---
-         // Get the geometry from the image handler.  Since we're in "identity"
-         // mode use the inputs for the outputs.
-         //---
-         m_geom = ih->getImageGeometry();
-
-         if ( m_geom.valid() )
-         {
-            // Get the image projection.
-            ossimRefPtr<ossimProjection> proj = m_geom->getProjection();
-            if ( proj.valid() )
-            {
-               ossim_float64 rotation = 0.0;
-               if ( upIsUp() )
-               {
-                  rotation = m_geom->upIsUpAngle();
-               }
-               else if ( northUp() )
-               {
-                  rotation = m_geom->northUpAngle();
-               }
-               else if ( hasRotation() )
-               {
-                  rotation = getRotation();
-               }
-
-               if ( ossim::isnan( rotation ) )
-               {
-                  rotation = 0.0;
-               }
-
-               ossimDpt imageSpaceScale;
-               getImageSpaceScale( imageSpaceScale );
-               
-               ossimDrect rect;
-               m_geom->getBoundingRect(rect);
-               ossimDpt midPt = rect.midPoint();
-               
-               if ( traceDebug() )
-               {
-                  ossimNotify(ossimNotifyLevel_DEBUG)
-                     << MODULE
-                     << "\nAffine transform parameters:"
-                     << "\nrotation:  " << rotation
-                     << "\nmid point: " << midPt << std::endl;
-               }
-               
-               m_ivt = new ossimImageViewAffineTransform(-rotation,
-                                                         imageSpaceScale.x, // image space scale x
-                                                         imageSpaceScale.y, // image space scale y
-                                                         1.0,1.0,  //scale x and y
-                                                         0.0, 0.0, // translate x,y
-                                                         midPt.x, midPt.y); // pivot point
-
-               if ( m_kwl->hasKey( METERS_KW )    ||
-                    m_kwl->hasKey( DEGREES_X_KW ) ||
-                    m_kwl->hasKey( RRDS_KW ) )
-               {
-                  // Set the image view transform scale.
-                  initializeIvtScale();
-               }
-               
-               resampler->setImageViewTransform( m_ivt.get() );
-            }
-
-         } // Matches: if ( m_geom.valid() )
-         
-      } // Matches: if ( ih.valid() )
-      
-   } // Matches: if ( sic.valid() 
-   
-} // End: createIdentityProjection()
-
-void ossimChipperUtil::initializeIvtScale()
-{
-   if ( isIdentity() && m_ivt.valid() && m_geom.valid() )
-   {
-      ossimDpt scale;
-      scale.makeNan();
-      
-      // Check for GSD spec. Degrees/pixel takes priority over meters/pixel:
-      ossimString lookup;
-      lookup.string() = m_kwl->findKey( DEGREES_X_KW );
-      if ( lookup.size() )
-      {
-         ossimDpt outputDpp;
-         outputDpp.makeNan();
-
-         outputDpp.x = lookup.toFloat64();
-
-         lookup.string() = m_kwl->findKey( DEGREES_Y_KW );
-         if ( lookup.size() )
-         {
-            outputDpp.y = lookup.toFloat64();
-         }
-         
-         if ( !outputDpp.hasNans() )
-         {
-            // Input degress per pixel.  Consider this a scale of 1.0.
-            ossimDpt inputDpp;
-            m_geom->getDegreesPerPixel( inputDpp );
-
-            if ( !inputDpp.hasNans() )
-            {
-               scale.x = inputDpp.x/outputDpp.x;
-               scale.y = inputDpp.y/outputDpp.y;
-            }
-         }
-      }
-
-      if ( scale.hasNans() )
-      {
-         lookup = m_kwl->findKey( METERS_KW );
-         if ( lookup.size() )
-         {
-            ossimDpt outputMpp;
-            outputMpp.makeNan();
-            outputMpp.x = lookup.toFloat64();
-            outputMpp.y = outputMpp.x;
-
-            if ( !outputMpp.hasNans() )
-            {
-               // Input meters per pixel.  Consider this a scale of 1.0.
-               ossimDpt inputMpp;
-               m_geom->getMetersPerPixel( inputMpp );
-               
-               if ( !inputMpp.hasNans() )
-               {
-                  scale.x = inputMpp.x/outputMpp.x;
-                  scale.y = inputMpp.y/outputMpp.y;
-               }
-            }
-         }
-      }
-
-      if ( scale.hasNans() )
-      {
-         lookup = m_kwl->findKey( RRDS_KW );
-         if ( lookup.size() )
-         {
-            ossim_float64 d = lookup.toInt32();
-            if ( d == 0.0 )
-            {
-               scale.x = 1.0;
-            }
-            else
-            {
-               scale.x = 1.0 / std::pow(2.0, d);
-            }
-            scale.y = scale.x;
-         }
-      }
-
-      if ( !scale.hasNans() )
-      {
-         m_ivt->scale( scale.x, scale.y );
-      }
-      else
-      {
-         std::string errMsg = "ossimChipperUtil::initializeIvtScale failed!";
-         throw ossimException(errMsg);
-      }
-      
-   } // Matches: if ( isIdentity() && ... )
-   
-} // End: ossimChipperUtil::initializeIvtScale()
-
-void ossimChipperUtil::intiailizeProjectionTiePoint()
-{
-   static const char MODULE[] = "ossimChipperUtil::initializeProjectionTiePoint()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   // Get the map projection from the output geometry:
-   ossimRefPtr<ossimMapProjection> mapProj = getMapProjection();
-
-   if ( mapProj.valid() )
-   {
-      //---
-      // If the output is geographic of there are sensor model inputs, get the tie
-      // using the ground point.
-      //---
-      if ( mapProj->isGeographic() || hasSensorModelInput() )
-      {
-         ossimGpt tiePoint;
-         tiePoint.makeNan();
-         getTiePoint(tiePoint);
-         
-         if ( !tiePoint.hasNans() )
-         {
-            //---
-            // The tie point coordinates currently reflect the UL edge of the UL pixel.
-            // We'll need to shift the tie point bac from the edge to the center base on the
-            // output gsd.
-            //---
-            ossimDpt half_pixel_shift = m_geom->getDegreesPerPixel() * 0.5;
-            tiePoint.lat -= half_pixel_shift.lat;
-            tiePoint.lon += half_pixel_shift.lon;
-            mapProj->setUlTiePoints(tiePoint);
-         }
-         else
-         {
-            std::string errMsg = MODULE;
-            errMsg += " tie point has nans!";
-            throw( ossimException(errMsg) );
-         }
-
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "projection tie point: " << tiePoint << "\n" << MODULE << " exited...\n";
-         }
-      }
-      else
-      {
-         //---
-         // TODO: Add test for like input projections and use above geographic tie
-         // code if not.
-         //---
-         ossimDpt tiePoint;
-         tiePoint.makeNan();
-         getTiePoint(tiePoint);
-
-         if ( !tiePoint.hasNans() )
-         {
-            //---
-            // The tie point coordinates currently reflect the UL edge of the UL pixel.
-            // We'll need to shift the tie point bac from the edge to the center base on the
-            // output gsd.
-            //---
-            ossimDpt half_pixel_shift = m_geom->getMetersPerPixel() * 0.5;
-            tiePoint.y -= half_pixel_shift.y;
-            tiePoint.x += half_pixel_shift.x;
-            mapProj->setUlTiePoints(tiePoint);
-         }
-         else
-         {
-            std::string errMsg = MODULE;
-            errMsg += " tie point has nans!";
-            throw( ossimException(errMsg) );
-         }
-
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "projection tie point: " << tiePoint << "\n" << MODULE << " exited...\n";
-         }
-      }
-      
-   } // Matches: if ( mapProj.valid() )
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += "m_projection is null!";
-      throw( ossimException(errMsg) ); 
-   }
-}
-
-void ossimChipperUtil::initializeProjectionGsd()
-{
-   static const char MODULE[] = "ossimChipperUtil::initializeProjectionGsd()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimMapProjection> mapProj = getMapProjection();
-   if ( !mapProj.valid() )
-   {
-      std::string errMsg = MODULE;
-      errMsg += " projection is null!";
-      throw( ossimException(errMsg) ); 
-   }
-   
-   ossimDpt gsd;
-   gsd.makeNan();
-
-   ossimString degreesX;
-   ossimString degreesY;
-   ossimString meters;
-   degreesX.string() = m_kwl->findKey( DEGREES_X_KW );
-   degreesY.string() = m_kwl->findKey( DEGREES_Y_KW );      
-   meters.string()   = m_kwl->findKey( METERS_KW );
-   
-   if ( hasCutBoxWidthHeight() )
-   {
-      // --cut-bbox-llwh Implies a scale...
-      if ( degreesX.size() || degreesY.size() || meters.size() )
-      {
-         std::ostringstream errMsg;
-         errMsg << MODULE << " ERROR: Ambiguous scale keywords!\n"
-                << "Do not combine meters or degrees with cut box with a width and height.\n";
-         throw( ossimException( errMsg.str() ) );
-      }
-
-      ossimString cutMinLat;
-      ossimString cutMinLon;
-      ossimString cutMaxLat;
-      ossimString cutMaxLon;
-      ossimString cutWidth;
-      ossimString cutHeight;
-      cutMinLat.string() = m_kwl->findKey( CUT_MIN_LAT_KW );
-      cutMinLon.string() = m_kwl->findKey( CUT_MIN_LON_KW );
-      cutMaxLat.string() = m_kwl->findKey( CUT_MAX_LAT_KW );
-      cutMaxLon.string() = m_kwl->findKey( CUT_MAX_LON_KW );
-      cutWidth.string()  = m_kwl->findKey( CUT_WIDTH_KW );
-      cutHeight.string() = m_kwl->findKey( CUT_HEIGHT_KW );
-      if ( cutMinLat.size() && cutMinLon.size() && cutMaxLat.size() &&
-           cutMaxLon.size() && cutWidth.size() && cutHeight.size() )
-      {
-         ossim_float64 minLat = cutMinLat.toFloat64();
-         ossim_float64 minLon = cutMinLon.toFloat64();
-         ossim_float64 maxLat = cutMaxLat.toFloat64();
-         ossim_float64 maxLon = cutMaxLon.toFloat64();
-         ossim_float64 width  = cutWidth.toFloat64();
-         ossim_float64 height = cutHeight.toFloat64();
-         if ( !ossim::isnan(minLat) && !ossim::isnan(minLon) && !ossim::isnan(maxLat) &&
-              !ossim::isnan(maxLon) && !ossim::isnan(width) && !ossim::isnan(height) )
-         {
-            gsd.x = std::fabs( maxLon - minLon ) / width;
-            gsd.y = std::fabs( maxLat - minLat ) / height;
-
-            mapProj->setDecimalDegreesPerPixel(gsd);
-         }
-      }
-   }
-   else if(hasWmsBboxCutWidthHeight())
-   {
-      ossimString cutWidth;
-      ossimString cutHeight;
-      ossimString cutWmsBbox;
-
-      cutWidth.string()   = m_kwl->findKey( CUT_WIDTH_KW );
-      cutHeight.string()  = m_kwl->findKey( CUT_HEIGHT_KW );
-      cutWmsBbox.string() = m_kwl->findKey( CUT_WMS_BBOX_KW );
-
-      cutWmsBbox = cutWmsBbox.upcase().replaceAllThatMatch("BBOX:","");
-      std::vector<ossimString> cutBox = cutWmsBbox.split(",");
-      if(cutBox.size()==4)
-      {
-         ossim_float64 minx = cutBox[0].toFloat64();
-         ossim_float64 miny = cutBox[1].toFloat64();
-         ossim_float64 maxx = cutBox[2].toFloat64();
-         ossim_float64 maxy = cutBox[3].toFloat64();
-         ossim_float64 width  = cutWidth.toFloat64();
-         ossim_float64 height = cutHeight.toFloat64();
-         gsd.x = std::fabs( maxx - minx ) / width;
-         gsd.y = std::fabs( maxy - miny ) / height;
-
-         // bbox is in the units of the projector
-         if(mapProj->isGeographic())
-         {
-
-            mapProj->setDecimalDegreesPerPixel(gsd);
-         }
-         else
-         {
-            mapProj->setMetersPerPixel(gsd);
-         }
-      }
-      else
-      {
-         std::ostringstream errMsg;
-         errMsg << MODULE << " ERROR: cut box does not have 4 values!\n";
-         throw( ossimException( errMsg.str() ) );
-      }
-   } 
-   else
-   {
-      if ( meters.size() && ( degreesX.size() || degreesY.size() ) )
-      {  
-         std::ostringstream errMsg;
-         errMsg << MODULE << " ERROR: Ambiguous scale keywords!\n"
-                << "Do not combine meters with degrees.\n";
-         throw( ossimException( errMsg.str() ) );
-      }
-      
-      if ( degreesX.size() )
-      {
-         // --degrees
-         gsd.x = degreesX.toFloat64();
-
-         if ( degreesY.size() )
-         {
-            gsd.y = degreesY.toFloat64();
-         }
-         if ( !gsd.hasNans() )
-         {
-            mapProj->setDecimalDegreesPerPixel(gsd);
-         }
-      }
-      else if ( meters.size() )
-      {
-         // --meters
-         gsd.x = meters.toFloat64();
-         gsd.y = gsd.x;
-         if ( !gsd.hasNans() )
-         {
-            mapProj->setMetersPerPixel(gsd);
-         }
-      }
-   }
-
-   if ( gsd.hasNans() )
-   {
-      // Get the best resolution from the inputs.
-      getMetersPerPixel(gsd);
-
-      // See if the output projection is geo-scaled; if so, make the pixels square in meters.
-      if ( getOutputProjectionType() == ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO_SCALED )
-      {
-         // Pick the best resolution and make them both the same.
-         gsd.x = ossim::min<ossim_float64>(gsd.x, gsd.y);
-         gsd.y = gsd.x;
-      }
-
-      // Set to input gsd.
-      mapProj->setMetersPerPixel(gsd);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "projection gsd: " << gsd << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::getTiePoint(ossimGpt& tie)
-{
-   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimGpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
-
-   tie.lat = ossim::nan();
-   tie.lon = ossim::nan();
-   tie.hgt = 0.0;
-   
-   // Loop through dem layers.
-   ossimGpt chainTiePoint;
-   chainIdx = m_demLayer.begin();
-   while ( chainIdx != m_demLayer.end() )
-   {
-      getTiePoint( (*chainIdx).get(), chainTiePoint );
-      if ( tie.hasNans() )
-      {
-         tie = chainTiePoint;
-      }
-      else
-      {
-         if ( chainTiePoint.lat > tie.lat )
-         {
-            tie.lat = chainTiePoint.lat;
-         }
-         if ( chainTiePoint.lon < tie.lon )
-         {
-            tie.lon = chainTiePoint.lon;
-         }
-      }
-      ++chainIdx;
-   }
-
-   // Loop through image layers.
-   chainIdx = m_imgLayer.begin();
-   while ( chainIdx != m_imgLayer.end() )
-   {
-      getTiePoint( (*chainIdx).get(), chainTiePoint );
-      if ( tie.hasNans() )
-      {
-         tie = chainTiePoint;
-      }
-      else
-      {
-         if ( chainTiePoint.lat > tie.lat )
-         {
-            tie.lat = chainTiePoint.lat;
-         }
-         if ( chainTiePoint.lon < tie.lon )
-         {
-            tie.lon = chainTiePoint.lon;
-         }
-      }
-      ++chainIdx;
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "tie point: " << tie << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::getTiePoint(ossimSingleImageChain* chain, ossimGpt& tie)
-{
-   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimSingleImageChain*,ossimGpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }   
-
-   if (chain && m_geom.valid() )
-   {
-      //---
-      // The view is not set yet in the chain so we get the tie point from the
-      // image handler geometry not from the chain which will come from the
-      // ossimImageRenderer.
-      //---
-      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
-      if ( ih.valid() )
-      {
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if ( geom.valid() )
-         {
-            geom->getTiePoint( tie, true );
-         }
-         
-
-         // Set height to 0.0 even though it's not used so hasNans test works.
-         tie.hgt = 0.0;
-         
-         if ( tie.hasNans() )
-         {
-            std::string errMsg = MODULE;
-            errMsg += "\ngeom->localToWorld returned nan for chain.";
-            errMsg += "\nChain: ";
-            errMsg += chain->getFilename().string();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "\nNo geometry for chain: ";
-         errMsg += chain->getFilename().string();
-         throw ossimException(errMsg);
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR: Null chain passed to method!";
-      throw ossimException(errMsg);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "chain name: " << chain->getFilename()
-         << "\ntie point:  " << tie << "\n"
-         << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::getTiePoint(ossimDpt& tie)
-{
-   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimDpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
-
-   tie.makeNan();
-   
-   // Loop through dem layers.
-   ossimDpt chainTiePoint;
-   chainIdx = m_demLayer.begin();
-   while ( chainIdx != m_demLayer.end() )
-   {
-      getTiePoint( (*chainIdx).get(), chainTiePoint );
-      if ( tie.hasNans() )
-      {
-         tie = chainTiePoint;
-      }
-      else
-      {
-         if ( chainTiePoint.y > tie.y )
-         {
-            tie.y = chainTiePoint.y;
-         }
-         if ( chainTiePoint.x < tie.x )
-         {
-            tie.x = chainTiePoint.x;
-         }
-      }
-      ++chainIdx;
-   }
-
-   // Loop through image layers.
-   chainIdx = m_imgLayer.begin();
-   while ( chainIdx != m_imgLayer.end() )
-   {
-      getTiePoint( (*chainIdx).get(), chainTiePoint );
-      if ( tie.hasNans() )
-      {
-         tie = chainTiePoint;
-      }
-      else
-      {
-         if ( chainTiePoint.y > tie.y )
-         {
-            tie.y = chainTiePoint.y;
-         }
-         if ( chainTiePoint.x < tie.x )
-         {
-            tie.x = chainTiePoint.x;
-         }
-      }
-      ++chainIdx;
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "tie point: " << tie << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::getTiePoint(ossimSingleImageChain* chain, ossimDpt& tie)
-{
-   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimSingleImageChain*,ossimDpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }   
-
-   if (chain && m_geom.valid() )
-   {
-      //---
-      // The view is not set yet in the chain so we get the tie point from the
-      // image handler geometry not from the chain which will come from the
-      // ossimImageRenderer.
-      //---
-      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
-      if ( ih.valid() )
-      {
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if ( geom.valid() )
-         {
-            geom->getTiePoint( tie, true );
-         }
-         
-         if ( tie.hasNans() )
-         {
-            std::string errMsg = MODULE;
-            errMsg += "\ngeom->localToWorld returned nan for chain.";
-            errMsg += "\nChain: ";
-            errMsg += chain->getFilename().string();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "\nNo geometry for chain: ";
-         errMsg += chain->getFilename().string();
-         throw ossimException(errMsg);
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR: Null chain passed to method!";
-      throw ossimException(errMsg);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "chain name: " << chain->getFilename()
-         << "\ntie point:  " << tie << "\n"
-         << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::getMetersPerPixel(ossimDpt& gsd)
-{
-   static const char MODULE[] = "ossimChipperUtil::getMetersPerPixel(ossimDpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   gsd.makeNan();
-   
-   ossimDpt chainGsd;
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
-
-   // Loop through dem layers.
-   chainIdx = m_demLayer.begin();
-   while ( chainIdx != m_demLayer.end() )
-   {
-      getMetersPerPixel( (*chainIdx).get(), chainGsd);
-      if ( gsd.hasNans() || ( chainGsd.x < gsd.x ) ) 
-      {
-         gsd = chainGsd;
-      }
-      ++chainIdx;
-   }
-
-   // Loop through image layers.
-   chainIdx = m_imgLayer.begin();
-   while ( chainIdx != m_imgLayer.end() )
-   {
-      getMetersPerPixel( (*chainIdx).get(), chainGsd);
-      if ( gsd.hasNans() || ( chainGsd.x < gsd.x ) )
-      {
-         gsd = chainGsd;
-      }
-      ++chainIdx;
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "gsd: " << gsd << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::getMetersPerPixel(ossimSingleImageChain* chain, ossimDpt& gsd)
-{
-   static const char MODULE[] = "ossimChipperUtil::getMetersPerPixel(ossimSingleImageChain*,ossimDpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   if (chain)
-   {
-      ossimRefPtr<ossimImageGeometry> geom = chain->getImageGeometry();
-      if ( geom.valid() )
-      {
-         geom->getMetersPerPixel( gsd );
-         if ( gsd.hasNans() )
-         {
-            std::string errMsg = MODULE;
-            errMsg += "\ngeom->getMetersPerPixel returned nan for chain.";
-            errMsg += "\nChain: ";
-            errMsg += chain->getFilename().string();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "\nNo geometry for chain: ";
-         errMsg += chain->getFilename().string();
-         throw ossimException(errMsg);
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR: Null chain passed to method!";
-      throw ossimException(errMsg);
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "chain name: " << chain->getFilename()
-         << "\nmeters per pixel: " << gsd << "\n" << MODULE << " exited...\n";
-   }
-}
-
-ossim_float64 ossimChipperUtil::getCentralMeridian() const
-{
-   ossim_float64 result = ossim::nan();
-   ossimString lookup = m_kwl->findKey( std::string(ossimKeywordNames::CENTRAL_MERIDIAN_KW) );
-   if ( lookup.size() )
-   {
-      result = lookup.toFloat64();
-      if ( (result < -180.0) || (result > 180.0) )
-      {
-         std::string errMsg = "central meridian range error!";
-         errMsg += " Valid range: -180 to 180";
-         throw ossimException(errMsg);
-      }
-   }
-   return result;
-}
-
-ossim_float64 ossimChipperUtil::getOriginLatitude() const
-{
-   ossim_float64 result = ossim::nan();
-   ossimString lookup = m_kwl->find(ossimKeywordNames::ORIGIN_LATITUDE_KW);
-   if ( lookup.size() )
-   {
-      result = lookup.toFloat64();
-      if ( (result < -90) || (result > 90.0) )
-      {
-         std::string errMsg = "origin latitude range error!";
-         errMsg += " Valid range: -90 to 90";
-         throw ossimException(errMsg);
-      }
-   }
-   return result;
-}
-
-void ossimChipperUtil::getSceneCenter(ossimGpt& gpt)
-{
-   static const char MODULE[] = "ossimChipperUtil::getSceneCenter(ossimGpt&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   std::vector<ossimGpt> centerGptArray;
-   ossimGpt centerGpt;
-   
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
-
-   // Loop through dem layers.
-   chainIdx = m_demLayer.begin();
-   while ( chainIdx != m_demLayer.end() )
-   {
-      getSceneCenter( (*chainIdx).get(), centerGpt);
-      if ( !centerGpt.hasNans() )
-      {
-         centerGptArray.push_back( centerGpt );
-      }
-      ++chainIdx;
-   }
-
-   // Loop through image layers.
-   chainIdx = m_imgLayer.begin();
-   while ( chainIdx != m_imgLayer.end() )
-   {
-      getSceneCenter( (*chainIdx).get(), centerGpt);
-      if ( !centerGpt.hasNans() )
-      {
-         centerGptArray.push_back( centerGpt );
-      }
-      ++chainIdx;
-   }
-
-   ossim_float64 lat = 0.0;
-   ossim_float64 lon = 0.0;
-   
-   std::vector<ossimGpt>::const_iterator pointIdx = centerGptArray.begin();
-   while ( pointIdx != centerGptArray.end() )
-   {
-      lat += (*pointIdx).lat;
-      lon += (*pointIdx).lon;
-      ++pointIdx;
-   }
-
-   lat /= centerGptArray.size();
-   lon /= centerGptArray.size();
-
-   if ( (lat >= -90.0) && (lat <= 90.0) && (lon >= -180.0) && (lon <= 180.0) )
-   {
-      gpt.lat = lat;
-      gpt.lon = lon;
-   }
-   else
-   {
-      std::ostringstream errMsg;
-      errMsg << MODULE << " range error!\nlatitude = "
-             << ossimString::toString(lat).string()
-             << "\nlongitude = "
-             << ossimString::toString(lon).string();
-      throw ossimException( errMsg.str() );
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "scene center: " << gpt << "\n" << MODULE << " exited...\n";
-   }
-}
-
-void ossimChipperUtil::getSceneCenter(ossimSingleImageChain* chain, ossimGpt& gpt)
-{
-   static const char MODULE[] =
-      "ossimChipperUtil::getSceneCenter(const ossimSingleImageChain*,ossimGpt&)";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }   
-   
-   if (chain)
-   {
-      ossimRefPtr<ossimImageGeometry> geom = chain->getImageGeometry();
-      if ( geom.valid() )
-      {
-         ossimIrect boundingRect = chain->getBoundingRect();
-         ossimDpt midPoint = boundingRect.midPoint();
-         geom->localToWorld(midPoint, gpt);
-         gpt.hgt = 0.0;
-         
-         if ( gpt.hasNans() )
-         {
-            std::string errMsg = MODULE;
-            errMsg += "\ngeom->localToWorld returned nan for chain.";
-            errMsg += "\nChain: ";
-            errMsg += chain->getFilename().string();
-            throw ossimException(errMsg);
-         }
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += "\nNo geometry for chain: ";
-         errMsg += chain->getFilename().string();
-         throw ossimException(errMsg);
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR: Null chain passed to method!";
-      throw ossimException(errMsg);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "chain name: " << chain->getFilename()
-         << "\nscene center: " << gpt << "\n"
-         << MODULE << " exited...\n";
-   }
-}
-
-ossimRefPtr<ossimMapProjection> ossimChipperUtil::getFirstInputProjection()
-{
-   static const char MODULE[] = "ossimChipperUtil::getFirstInputProjection";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimImageHandler>  ih     = 0;
-   ossimRefPtr<ossimMapProjection> result = 0;
-
-   // Get the first image handler.
-   if ( m_demLayer.size() )
-   {
-      ih = m_demLayer[0]->getImageHandler();
-   }
-   else if ( m_imgLayer.size() )
-   {
-      ih = m_imgLayer[0]->getImageHandler();
-   }
-   
-   if ( ih.valid() )
-   {
-      // Get the geometry from the first image handler.      
-      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-      if ( geom.valid() )
-      {
-         // Get the image projection.
-         ossimRefPtr<ossimProjection> proj = geom->getProjection();
-         if ( proj.valid() )
-         {
-            // Cast and assign to result.
-            ossimMapProjection* mapProj = PTR_CAST( ossimMapProjection, proj.get() );
-            if (mapProj)
-            {
-               // Must duplicate in case the output projection gets modified.
-               result = (ossimMapProjection*) mapProj->dup();
-            }
-            if ( !result.valid() && traceDebug() )
-            {
-               ossimNotify(ossimNotifyLevel_WARN) << "Could not cast to map projection.\n";
-            }
-         }
-         else if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_WARN) << "No projection in first chain...\n";
-         }
-      }
-   }
-   else if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "No image handler in first chain...\n";
-   }
-   
-   if ( traceDebug() )
-   {
-      if ( result.valid() )
-      {
-         result->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewGeoProjection()
-{
-   return ossimRefPtr<ossimMapProjection>(new ossimEquDistCylProjection());
-}
-
-ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewGeoScaledProjection()
-{
-   // Make projection:
-   ossimRefPtr<ossimMapProjection> result = getNewGeoProjection();
-
-   // Set the origin for scaling:
-   
-   // First check for user set "central_meridian" and "origin_latitude":
-   ossimGpt origin;
-   origin.lat = getOriginLatitude();
-   origin.lon = getCentralMeridian();
-   origin.hgt = 0.0;
-   
-   if ( origin.hasNans() )
-   {
-      // Use the scene center from the input.
-      getSceneCenter( origin );
-
-      //---
-      // Note only latitude used for scaling, origin kept at 0.0.
-      // This is a fix/hack for ossimEquDistCylProjection wrapping issues.
-      //---
-      origin.lon = 0.0;
-   }
-
-   if ( !origin.hasNans() )
-   {
-      result->setOrigin(origin);
-   }
-   else
-   {
-      std::string errMsg = "ossimChipperUtil::getNewGeoScaledProjection ERROR";
-      errMsg += "\nOrigin has nans!";
-      throw ossimException(errMsg);
-   }
-   
-   return result;
-}
-
-ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewProjectionFromSrsCode(
-   const std::string& code)
-{
-   ossimRefPtr<ossimMapProjection> result = 0;
-
-   if (code == "4326")  // Avoid factory call for this.
-   {
-      result = new ossimEquDistCylProjection();
-   }
-   else
-   {
-      ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->
-         createProjection(code);
-      if ( proj.valid() )
-      {
-         result = PTR_CAST( ossimMapProjection, proj.get() );
-      }
-   }
-   return result;
-}
-
-ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewUtmProjection()
-{
-   // Make projection:
-   ossimRefPtr<ossimUtmProjection> utm = new ossimUtmProjection;
-
-   // Set the zone from keyword option:
-   bool setZone = false;
-   ossim_int32 zone = getZone();
-   if ( (zone > 0 ) && ( zone < 61 ) )
-   {
-      utm->setZone( zone );
-      setZone = true;
-   }
-   
-   // Set the hemisphere from keyword option:
-   bool setHemisphere = false;
-   std::string hemisphere = getHemisphere();
-   if ( hemisphere.size() )
-   {
-      ossimString h(hemisphere);
-      h.upcase();
-      if ( ( h == "N" ) || ( h == "NORTH" ) )
-      {
-         char c = 'N';
-         utm->setHemisphere( c );
-         setHemisphere = true;
-      }
-      if ( ( h == "S" ) || ( h == "SOUTH" ) )
-      {
-         char c = 'S';
-         utm->setHemisphere( c );
-         setHemisphere = true;
-      }
-   }
-
-   if ( !setZone || !setHemisphere )
-   {
-      // First check for user set "central_meridian" and "origin_latitude":
-      ossimGpt origin;
-      origin.lat = getOriginLatitude();
-      origin.lon = getCentralMeridian();
-      origin.hgt = 0.0;
-      
-      if ( origin.hasNans() )
-      {
-         // Use the scene center from the input.
-         getSceneCenter( origin );
-      }
-      
-      if ( !origin.hasNans() )
-      {
-         if ( !setZone )
-         {
-            utm->setZone(origin);
-         }
-         if ( !setHemisphere )
-         {
-            utm->setHemisphere(origin);
-         }
-      }
-      else
-      {
-         std::string errMsg = "ossimChipperUtil::getNewUtmProjection ERROR";
-         errMsg += "\nOrigin has nans!";
-         throw ossimException(errMsg);
-      }
-   }
-
-   return ossimRefPtr<ossimMapProjection>(utm.get());
-}
-
-ossimRefPtr<ossimMapProjection> ossimChipperUtil::getMapProjection()
-{
-   ossimRefPtr<ossimMapProjection> mp = 0;
-   if ( m_geom.valid() )
-   {
-      mp = dynamic_cast<ossimMapProjection*>( m_geom->getProjection() );
-   }
-   return mp;
-}
-
-ossimRefPtr<ossimImageFileWriter> ossimChipperUtil::createNewWriter() const
-{
-   static const char MODULE[] = "ossimChipperUtil::createNewWriter()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimFilename outputFile;
-   getOutputFilename(outputFile);
-
-   if ( outputFile == ossimFilename::NIL)
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR no output file name!";
-      throw ossimException(errMsg);
-   }
-
-   ossimRefPtr<ossimImageFileWriter> writer = 0;
-   
-   ossimString lookup = m_kwl->findKey( WRITER_KW );
-   if ( lookup.size() )
-   {
-      writer = ossimImageWriterFactoryRegistry::instance()->createWriter( lookup );
-      if ( !writer.valid() )
-      {
-         std::string errMsg = MODULE;
-         errMsg += " ERROR creating writer: ";
-         errMsg += lookup.string();
-         throw ossimException(errMsg);
-      }
-   }
-   else // Create from output file extension.
-   {
-      writer = ossimImageWriterFactoryRegistry::instance()->
-         createWriterFromExtension( outputFile.ext() );
-
-      if ( !writer.valid() )
-      {
-         std::string errMsg = MODULE;
-         errMsg += " ERROR creating writer from extension: ";
-         errMsg += outputFile.ext().string();
-         throw ossimException(errMsg);
-      }
-   }
-
-   // Set the output name.
-   writer->setFilename( outputFile );
-
-   // Add any writer props.
-   ossim_uint32 count = m_kwl->numberOf( WRITER_PROPERTY_KW.c_str() );
-   for (ossim_uint32 i = 0; i < count; ++i)
-   {
-      ossimString key = WRITER_PROPERTY_KW;
-      key += ossimString::toString(i);
-      lookup = m_kwl->findKey( key.string() );
-      if ( lookup.size() )
-      {
-         std::vector<ossimString> splitArray;
-         lookup.split(splitArray, "=");
-         if(splitArray.size() == 2)
-         {
-            ossimRefPtr<ossimProperty> prop =
-               new ossimStringProperty(splitArray[0], splitArray[1]);
-
-            if ( traceDebug() )
-            {
-               ossimNotify(ossimNotifyLevel_DEBUG)
-                  << "Setting writer prop: " << splitArray[0] << "=" << splitArray[1] << "\n";
-            }
-            
-            writer->setProperty( prop );
-         }
-      }
-   }
-
-   // Output tile size:
-   lookup = m_kwl->findKey( TILE_SIZE_KW );
-   if ( lookup.size() )
-   {
-      ossimIpt tileSize;
-      tileSize.x = lookup.toInt32();
-      if ( (tileSize.x % 16) == 0 )
-      {
-         tileSize.y = tileSize.x;
-         writer->setTileSize( tileSize );
-      }
-      else if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << MODULE << " NOTICE:"
-            << "\nTile width must be a multiple of 16! Using default.."
-            << std::endl;
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "writer name: " << writer->getClassName() << "\n"
-         << MODULE << " exited...\n";
-   }
-
-   return writer;
-}
-
-void ossimChipperUtil::propagateOutputProjectionToChains()
-{
-   static const char MODULE[] = "ossimChipperUtil::propagateOutputProjectionToChains()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
-   
-   // we need to make sure the outputs are refreshed so they can reset themselves
-   // Needed when we are doing interactive update to the GSD and clip window
-   ossimRefPtr<ossimRefreshEvent> refreshEvent = new ossimRefreshEvent();
-   ossimEventVisitor eventVisitor(refreshEvent.get());
-   ossimViewInterfaceVisitor viewVisitor(m_geom.get());
-   // Loop through dem layers.
-   chainIdx = m_demLayer.begin();
-   while ( chainIdx != m_demLayer.end() )
-   {
-    viewVisitor.reset();
-    eventVisitor.reset();
-    (*chainIdx)->accept(viewVisitor);
-    (*chainIdx)->accept(eventVisitor);
-
-    ossimRefPtr<ossimImageRenderer> resampler = (*chainIdx)->getImageRenderer();
-      if ( resampler.valid() )
-      {
-         //resampler->setView( m_geom.get() );
-        // resampler->propagateEventToOutputs(refreshEvent);
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += " chain has no resampler!";
-         throw( ossimException(errMsg) );
-      }
-      ++chainIdx;
-   }
-
-   // Loop through image layers.
-   chainIdx = m_imgLayer.begin();
-   while ( chainIdx != m_imgLayer.end() )
-   {
-      ossimRefPtr<ossimImageRenderer> resampler = (*chainIdx)->getImageRenderer();
-      eventVisitor.reset();
-      viewVisitor.reset();
-      (*chainIdx)->accept(viewVisitor);
-      (*chainIdx)->accept(eventVisitor);
-
-      if ( resampler.valid() )
-      {
-//         resampler->setView( m_geom.get() );
-        // resampler->propagateEventToOutputs(refreshEvent);
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += " chain has no resampler!";
-         throw( ossimException(errMsg) );
-      }
-      ++chainIdx;
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-}
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::combineLayers(
-   std::vector< ossimRefPtr<ossimSingleImageChain> >& layers) const
-{
-   static const char MODULE[] = "ossimChipperUtil::combineLayers(layers)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimImageSource> result = 0;
-
-   if ( layers.size() == 1 )
-   {
-      result = layers[0].get();
-   }
-   else if ( layers.size() > 1 )
-   {
-
-      result = createCombiner();//new ossimImageMosaic;
-
-      std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx = layers.begin();
-      while ( chainIdx != layers.end() )
-      {
-         result->connectMyInputTo( (*chainIdx).get() );
-         ++chainIdx;
-      }
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::combineLayers()
-{
-   static const char MODULE[] = "ossimChipperUtil::combineLayers()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimImageSource> result = 0;
-
-   ossim_uint32 layerCount = (ossim_uint32) (m_demLayer.size() + m_imgLayer.size());
-
-   if ( layerCount )
-   {
-      if ( layerCount == 1 )
-      {
-         if ( m_imgLayer.size() )
-         {
-            result = m_imgLayer[0].get();
-         }
-         else
-         {
-            result = m_demLayer[0].get();
-         }
-      }
-      else
-      {
-         result = createCombiner();//new ossimImageMosaic;
-         
-         // Combine the images.  Note we'll put the images on top of the dems.
-         if ( m_imgLayer.size() )
-         {
-            std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx =
-               m_imgLayer.begin();
-            while ( chainIdx !=  m_imgLayer.end() )
-            {
-               result->connectMyInputTo( (*chainIdx).get() );
-               ++chainIdx;
-            }
-         }
-         if ( m_demLayer.size() ) // Combine any dem layers.
-         {
-            std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx =
-               m_demLayer.begin();
-            while ( chainIdx != m_demLayer.end() )
-            {
-               result->connectMyInputTo( (*chainIdx).get() );
-               ++chainIdx;
-            }
-         }
-      }
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-   
-   return result;
-   
-} // End: ossimChipperUtil::combineLayers
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::initialize2CmvChain()
-{
-   ossimRefPtr<ossimImageSource> result = 0;
-
-   ossim_uint32 layerCount = (ossim_uint32) (m_demLayer.size() + m_imgLayer.size());
-
-   // Must have two and only two inputs.
-   if ( layerCount == 2 )
-   {     
-      ossimRefPtr<ossimConnectableObject> oldImg = 0;
-      ossimRefPtr<ossimConnectableObject> newImg = 0;
-
-      //---
-      // Expecting two image layers.  We'll code it for flexabilty though...
-      // - Take old and new from m_imgLayer if present.
-      // - Use m_demLayer only if missing.
-      // - Using first image found as old, second new.
-      //---
-
-      // Most likely case, two image layers.
-      if ( m_imgLayer.size() )
-      {
-         oldImg = m_imgLayer[0].get();
-         
-         if ( m_imgLayer.size() == 2 )
-         {
-            newImg = m_imgLayer[1].get();
-         }
-      }
-
-      if ( m_demLayer.size() )
-      {
-         if ( !oldImg.valid() )
-         {
-            oldImg = m_demLayer[0].get();
-         }
-
-         if ( !newImg.valid() )
-         {
-            if ( m_demLayer.size() == 1 )
-            {
-               newImg = m_demLayer[0].get();
-            }
-            else if ( m_demLayer.size() == 2 )
-            {
-               newImg = m_demLayer[1].get();
-            }
-         }
-      }
-
-      if ( newImg.valid() && oldImg.valid() )
-      {
-         // Input 0 is old, 1 is new.
-         ossimRefPtr<ossimTwoColorView> tcmv = new ossimTwoColorView;
-         tcmv->connectMyInputTo( 0, oldImg.get() );
-         tcmv->connectMyInputTo( 1, newImg.get() );
-
-         // Look for 2cmv options.
-         ossim_uint32 oldInputBandIndex = 0;
-         ossim_uint32 newInputBandIndex = 0;
-         ossimTwoColorView::ossimTwoColorMultiViewOutputSource redOutputSource =
-            ossimTwoColorView::OLD;
-         ossimTwoColorView::ossimTwoColorMultiViewOutputSource grnOutputSource =
-            ossimTwoColorView::NEW;
-         ossimTwoColorView::ossimTwoColorMultiViewOutputSource bluOutputSource =
-            ossimTwoColorView::NEW;
-
-         ossimString os;
-         std::string key = TWOCMV_OLD_INPUT_BAND_KW;
-         std::string val = m_kwl->findKey( key );
-         
-         if ( val.size() )
-         {
-            os = val;
-            oldInputBandIndex = os.toUInt32();
-         }
-         
-         key = TWOCMV_NEW_INPUT_BAND_KW;
-         val = m_kwl->findKey( key );
-         if ( val.size() )
-         {
-            os = val;
-            newInputBandIndex = os.toUInt32();
-         }
-
-         key = TWOCMV_RED_OUTPUT_SOURCE_KW;
-         val = m_kwl->findKey( key );
-         if ( val.size() )
-         {
-            os = val;
-            os.downcase();
-            
-            if ( os == "new" )
-            {
-               redOutputSource = ossimTwoColorView::NEW;
-            }
-            else if ( os == "MIN" )
-            {
-               redOutputSource = ossimTwoColorView::MIN;
-            }
-         }
-
-         key = TWOCMV_GREEN_OUTPUT_SOURCE_KW;
-         val = m_kwl->findKey( key );
-         if ( val.size() )
-         {
-            os = val;
-            os.downcase();
-            
-            if ( os == "old" )
-            {
-               grnOutputSource = ossimTwoColorView::OLD;
-            }
-            else if ( os == "MIN" )
-            {
-               grnOutputSource = ossimTwoColorView::MIN;
-            }
-         }
-
-         key = TWOCMV_BLUE_OUTPUT_SOURCE_KW;
-         val = m_kwl->findKey( key );
-         if ( val.size() )
-         {
-            os = val;
-            os.downcase();
-            
-            if ( os == "old" )
-            {
-               bluOutputSource = ossimTwoColorView::OLD;
-            }
-            else if ( os == "MIN" )
-            {
-               bluOutputSource = ossimTwoColorView::MIN;
-            }
-         }
-
-         // Set options.
-         tcmv->setBandIndexMapping( oldInputBandIndex,
-                                    newInputBandIndex,
-                                    redOutputSource,
-                                    grnOutputSource,
-                                    bluOutputSource );
-         tcmv->initialize();
-
-         result = tcmv.get();
-      }
-   }
-   
-   return result;
-   
-} // ossimChipperUtil::initialize2CmvChain()
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::addIndexToRgbLutFilter(
-   ossimRefPtr<ossimImageSource> &source) const
-{
-   static const char MODULE[] = "ossimChipperUtil::addIndexToRgbLutFilter(source)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimImageSource> result = 0;
-
-   if ( source.valid() )
-   {
-      ossimRefPtr<ossimIndexToRgbLutFilter> lut = new ossimIndexToRgbLutFilter();
-      ossimFilename lutFile;
-      lutFile.string() = m_kwl->findKey( LUT_FILE_KW );
-      if ( lutFile.exists() )
-      {
-         //---
-         // Connect to dems:
-         // Must do this first so that the min and max get set from the input
-         // connection prior to initializing the lut.
-         //---
-         lut->connectMyInputTo( source.get() );
-
-         // Note sure about this.  Make option maybe? (drb)
-         lut->setMode(ossimIndexToRgbLutFilter::REGULAR);
-
-         lut->setLut(lutFile);
-         
-         // Set as color source for bump shade.
-         result = lut.get();
-      }
-      else
-      {
-         std::string errMsg = MODULE;
-         errMsg += " color table does not exists: ";
-         errMsg += lutFile.string();
-         throw ossimException(errMsg);
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR: Null source passed to method!";
-      throw ossimException(errMsg);
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-
-   return result;
-}
-
-ossimRefPtr<ossimImageSource> ossimChipperUtil::addScalarRemapper(
-   ossimRefPtr<ossimImageSource> &source, ossimScalarType scalar) const
-{
-   static const char MODULE[] = "ossimChipperUtil::addScalarRemapper(source)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   ossimRefPtr<ossimImageSource> result = 0;
-   
-   if ( source.valid() )
-   {
-      if ( ( scalar != OSSIM_SCALAR_UNKNOWN ) && ( source->getOutputScalarType() != scalar ) )
-      {
-         ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper();
-         remapper->setOutputScalarType(scalar);
-         remapper->connectMyInputTo( source.get() );
-         result = remapper.get();
-         
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "\nOutput remapped to: "
-               << ossimScalarTypeLut::instance()->getEntryString(scalar) << "\n";
-         }
-      }
-      else
-      {
-         result = source;
-      }
-   }
-   else
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR: Null source passed to method!";
-      throw ossimException(errMsg);
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exited...\n";
-   }
-   
-   return result;
-}
-
-bool ossimChipperUtil::setupChainHistogram( ossimRefPtr<ossimSingleImageChain>& chain) const
-{
-   static const char MODULE[] = "ossimChipperUtil::setupChainHistogram(chain)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   } 
-   
-   bool result = false;
-
-   if ( chain.valid() )
-   {
-      ossimRefPtr<ossimHistogramRemapper> remapper = chain->getHistogramRemapper();
-
-      if ( remapper.valid() )
-      {
-         if ( remapper->getHistogramFile() == ossimFilename::NIL )
-         {
-            ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
-            if ( ih.valid() )
-            {
-               ossimFilename f = ih->getFilenameWithThisExtension( ossimString("his") );
-
-               if ( f.empty() || (f.exists() == false) )
-               {
-                  // For backward compatibility check if single entry and _e0.his
-                  f = ih->getFilenameWithThisExtension( ossimString("his"), true );
-               }
-
-               if ( remapper->openHistogram( f ) == false )
-               {
-                  if(traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << MODULE << " WARNING:"
-                        << "\nCould not open:  " << f << "\n";
-                  }
-               }
-            }
-         }
-
-         if ( remapper->getHistogramFile() != ossimFilename::NIL )
-         {
-            ossimString op = m_kwl->findKey( HISTO_OP_KW );
-            if ( op.size() )
-            {
-               result = true;
-               
-               // Enable.
-               remapper->setEnableFlag(true);
-               
-               // Set the histo mode:
-               op.downcase();
-               if ( op == "auto-minmax" )
-               {
-                  remapper->setStretchMode( ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX );
-               }
-               else if ( (op == "std-stretch-1") || (op == "std-stretch 1") )
-               {
-                  remapper->setStretchMode( ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN );
-               } 
-               else if ( (op == "std-stretch-2") || (op == "std-stretch 2") )
-               {
-                  remapper->setStretchMode( ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN );
-               } 
-               else if ( (op == "std-stretch-3") || (op == "std-stretch 3") )
-               {
-                  remapper->setStretchMode( ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN );
-               }
-               else
-               {
-                  result = false;
-                  remapper->setEnableFlag(false);
-                  if(traceDebug())
-                  {
-                     ossimNotify(ossimNotifyLevel_WARN)
-                        << MODULE << "\nUnhandled operation: " << op << "\n";
-                  }
-               }
-            }
-         }
-      }
-   }
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-   
-   return result;
-}
-
-bool ossimChipperUtil::setChainEntry(
-   ossimRefPtr<ossimSingleImageChain>& chain, ossim_uint32 entryIndex ) const
-{
-   bool result = false;
-   if ( chain.valid() )
-   {
-      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
-      if ( ih.valid() )
-      {
-         result = ih->setCurrentEntry( entryIndex );
-      }
-   }
-   return result;
-}
-
-void ossimChipperUtil::getOutputFilename(ossimFilename& f) const
-{
-   f.string() = m_kwl->findKey( std::string(ossimKeywordNames::OUTPUT_FILE_KW) );
-}
-
-void ossimChipperUtil::getAreaOfInterest(ossimImageSource* source, ossimIrect& rect) const
-{
-   static const char MODULE[] = "ossimChipperUtil::getAreaOfInterest()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
-   }
-
-   // Nan rect for starters.
-   rect.makeNan();
-   
-   if ( source )
-   {
-      if (  m_kwl->hasKey( CUT_BBOX_XYWH_KW ) )
-      {
-         // <x>,<y>,<w>,<h>
-         ossimString cutBbox = m_kwl->findKey( CUT_BBOX_XYWH_KW );
-         std::vector<ossimString> keys;
-         cutBbox.split(keys, ",");
-         if( keys.size() > 3 )
-         {
-            ossimIpt ul;
-            ossimIpt lr;
-            ul.x = keys[0].toInt32();
-            ul.y = keys[1].toInt32();
-            lr.x = ul.x + keys[2].toInt32() - 1;
-            lr.y = ul.y + keys[3].toInt32() - 1;
-            rect = ossimIrect(ul, lr);
-         }
-      }
-      
-      if ( rect.hasNans() )
-      {
-         if ( m_geom.valid() )
-         {
-            if ( m_kwl->find( CUT_CENTER_LAT_KW.c_str() ) ) 
-            {
-               // "Cut Center" with: --cut-center-llwh or --cut-center-llr:
-               
-               ossimString latStr = m_kwl->findKey( CUT_CENTER_LAT_KW );
-               ossimString lonStr = m_kwl->findKey( CUT_CENTER_LON_KW );
-               if ( latStr.size() && lonStr.size() )
-               {
-                  ossimGpt centerGpt;
-
-                  //---
-                  // Want the height nan going into worldToLocal call so it gets picked
-                  // up by the elevation manager.
-                  //---
-                  centerGpt.makeNan(); 
-
-                  centerGpt.lat = latStr.toFloat64();
-                  centerGpt.lon = lonStr.toFloat64();
-
-                  if ( !centerGpt.isLatNan() && !centerGpt.isLonNan() )
-                  {
-                     // Ground "cut center" to view:
-                     ossimDpt centerDpt(0.0, 0.0);
-                     m_geom->worldToLocal(centerGpt, centerDpt);
-
-                     if ( !centerDpt.hasNans() )
-                     {
-                        if ( isIdentity() && m_ivt.valid() ) // Chipping in image space.
-                        {
-                           // Tranform image center point to view:
-                           ossimDpt ipt = centerDpt;
-                           m_ivt->imageToView( ipt, centerDpt );
-                        }
-                     
-                        // --cut-center-llwh:
-                        ossimString widthStr  = m_kwl->findKey( CUT_WIDTH_KW );
-                        ossimString heightStr = m_kwl->findKey( CUT_HEIGHT_KW );
-                        if ( widthStr.size() && heightStr.size() )
-                        {
-                           ossim_int32 width  = widthStr.toInt32();
-                           ossim_int32 height = heightStr.toInt32();
-                           if ( width && height )
-                           {
-                              ossimIpt ul( ossim::round<int>(centerDpt.x - (width/2)),
-                                           ossim::round<int>(centerDpt.y - (height/2)) );
-                              ossimIpt lr( (ul.x + width - 1), ul.y + height - 1);
-                              rect = ossimIrect(ul, lr);
-                           }
-                        }
-                        else // --cut-center-llr: 
-                        {
-                           ossimString radiusStr = m_kwl->findKey( CUT_RADIUS_KW );
-                           if ( radiusStr.size() )
-                           {
-                              ossim_float64 radius = radiusStr.toFloat64();
-                              if ( radius )
-                              {
-                                 ossimDpt mpp;
-                                 m_geom->getMetersPerPixel( mpp );
-
-                                 if ( !mpp.hasNans() )
-                                 {
-                                    ossim_float64 rx = radius/mpp.x;
-                                    ossim_float64 ry = radius/mpp.y;
-                                 
-                                    ossimIpt ul( ossim::round<int>( centerDpt.x - rx ),
-                                                 ossim::round<int>( centerDpt.y - ry ) );
-                                    ossimIpt lr( ossim::round<int>( centerDpt.x + rx ),
-                                                 ossim::round<int>( centerDpt.y + ry ) );
-                                    rect = ossimIrect(ul, lr);
-                                 }
-                              }
-                           }
-                        }
-                     }
-                  
-                  } // Matches: if ( !centerGpt.hasNans() )
-               
-               } // Matches: if ( latStr && lonStr )
-            
-            } // Matches: if ( m_kwl->find( CUT_CENTER_LAT_KW ) )
-         
-            else if ( (m_kwl->find( CUT_MAX_LAT_KW.c_str() ) ||
-                       (m_kwl->find( CUT_WMS_BBOX_LL_KW.c_str() )))) 
-            {
-               ossimString maxLat;
-               ossimString maxLon;
-               ossimString minLat;
-               ossimString minLon;
-
-               // --cut-bbox-ll or --cut-bbox-llwh
-               if(m_kwl->find( CUT_MAX_LAT_KW.c_str() ))
-               {
-                  maxLat = m_kwl->findKey( CUT_MAX_LAT_KW );
-                  maxLon = m_kwl->findKey( CUT_MAX_LON_KW );
-                  minLat = m_kwl->findKey( CUT_MIN_LAT_KW );
-                  minLon = m_kwl->findKey( CUT_MIN_LON_KW );               
-               }
-               else
-               {
-                  ossimString cutBbox = m_kwl->findKey( CUT_WMS_BBOX_LL_KW );
-
-                  cutBbox = cutBbox.upcase().replaceAllThatMatch("BBOX:");
-                  std::vector<ossimString> cutBox = cutBbox.split(",");
-                  if(cutBox.size() >3)
-                  {
-                     minLon = cutBox[0];
-                     minLat = cutBox[1];
-                     maxLon = cutBox[2];
-                     maxLat = cutBox[3];
-                  }
-               }
-        
-               if ( maxLat.size() && maxLon.size() && minLat.size() && minLon.size() )
-               {
-                  ossim_float64 minLatF = minLat.toFloat64();
-                  ossim_float64 maxLatF = maxLat.toFloat64();
-                  ossim_float64 minLonF = minLon.toFloat64();
-                  ossim_float64 maxLonF = maxLon.toFloat64();
-
-                  //---
-                  // Check for swap so we don't get a negative height.
-                  // Note no swap check for longitude as box could cross date line.
-                  //---
-                  if ( minLatF > maxLatF )
-                  {
-                     ossim_float64 tmpF = minLatF;
-                     minLatF = maxLatF;
-                     maxLatF = tmpF;
-                  }
-
-                  //---
-                  // Assume cut box is edge to edge or "Pixel Is Area". Our
-                  // AOI(area of interest) uses center of pixel or "Pixel Is Point"
-                  // so get the degrees per pixel and shift AOI to center.
-                  //---
-                  ossimDpt halfDpp;
-                  m_geom->getDegreesPerPixel( halfDpp );
-                  halfDpp = halfDpp/2.0;
-            
-                  ossimGpt gpt(0.0, 0.0, 0.0);
-                  ossimDpt ulPt;
-                  ossimDpt lrPt;
-            
-                  // Upper left:
-                  gpt.lat = maxLatF - halfDpp.y;
-                  gpt.lon = minLonF + halfDpp.x;
-                  m_geom->worldToLocal(gpt, ulPt);
-            
-                  // Lower right:
-                  gpt.lat = minLatF + halfDpp.y;
-                  gpt.lon = maxLonF - halfDpp.x;
-                  m_geom->worldToLocal(gpt, lrPt);
-
-                  if ( isIdentity() && m_ivt.valid() )
-                  {
-                     // Chipping in image space:
-                  
-                     // Tranform image ul point to view:
-                     ossimDpt ipt = ulPt;
-                     m_ivt->imageToView( ipt, ulPt );
-                  
-                     // Tranform image lr point to view:
-                     ipt = lrPt;
-                     m_ivt->imageToView( ipt, lrPt );
-                  }
-            
-                  rect = ossimIrect( ossimIpt(ulPt), ossimIpt(lrPt) );
-               }
-            }
-            else if ( m_kwl->find( CUT_WMS_BBOX_KW.c_str() ) ) 
-            {
-               ossimString cutBbox = m_kwl->findKey( CUT_WMS_BBOX_KW );
-
-               cutBbox = cutBbox.upcase().replaceAllThatMatch("BBOX:");
-               std::vector<ossimString> cutBox = cutBbox.split(",");
-               if(cutBox.size()==4)
-               {
-
-                  ossim_float64 minx=cutBox[0].toFloat64();
-                  ossim_float64 miny=cutBox[1].toFloat64();
-                  ossim_float64 maxx=cutBox[2].toFloat64();
-                  ossim_float64 maxy=cutBox[3].toFloat64();
-
-                  const ossimMapProjection* mapProj = m_geom->getAsMapProjection();
-                  if(mapProj)
-                  {
-                     std::vector<ossimDpt> pts(4);
-                     ossimDpt* ptsArray = &pts.front();
-                     if(mapProj->isGeographic())
-                     {
-                        ossimDpt halfDpp;
-                        m_geom->getDegreesPerPixel( halfDpp );
-                        halfDpp = halfDpp/2.0;
-                  
-                        ossimGpt gpt(0.0, 0.0, 0.0);
-                        ossimDpt ulPt;
-                        ossimDpt lrPt;
-                  
-                        // Upper left:
-                        gpt.lat = maxy - halfDpp.y;
-                        gpt.lon = minx + halfDpp.x;
-                        m_geom->worldToLocal(gpt, ptsArray[0]);
-                        // Upper right:
-                        gpt.lat = maxy - halfDpp.y;
-                        gpt.lon = maxx - halfDpp.x;
-                        m_geom->worldToLocal(gpt, ptsArray[1]);
-                  
-                        // Lower right:
-                        gpt.lat = miny + halfDpp.y;
-                        gpt.lon = maxx - halfDpp.x;
-                        m_geom->worldToLocal(gpt, ptsArray[2]);
-
-                        //Lower left
-                        gpt.lat = miny + halfDpp.y;
-                        gpt.lon = minx + halfDpp.x;
-                        m_geom->worldToLocal(gpt, ptsArray[3]);
-                        //m_geom->worldToLocal(ossimGpt(miny,minx), ptsArray[0]);
-                        //m_geom->worldToLocal(ossimGpt(maxy,minx), ptsArray[1]);
-                        //m_geom->worldToLocal(ossimGpt(maxy,maxx), ptsArray[2]);
-                        //m_geom->worldToLocal(ossimGpt(miny,maxx), ptsArray[3]);
-
-                     }
-                     else
-                     {
-                        ossimDpt halfMpp;
-                        ossimDpt eastingNorthing;
-                        m_geom->getMetersPerPixel( halfMpp );
-                        halfMpp = halfMpp/2.0;
-
-                        eastingNorthing.x = minx+halfMpp.x;
-                        eastingNorthing.y = miny+halfMpp.y;
-                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[0]);
-                        eastingNorthing.x = minx+halfMpp.x;
-                        eastingNorthing.y = maxy-halfMpp.y;
-                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[1]);
-                        eastingNorthing.x = maxx-halfMpp.x;
-                        eastingNorthing.y = maxy-halfMpp.y;
-                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[2]);
-                        eastingNorthing.x = maxx-halfMpp.x;
-                        eastingNorthing.y = miny+halfMpp.y;
-                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[3]);
-                     }
-                     rect = ossimIrect(pts);
-                  }
-               }
-            }
-
-            // If no user defined rect set to scene bounding rect.
-            if ( rect.hasNans() ) 
-            {
-               // Get the rectangle from the input chain:
-               rect = source->getBoundingRect(0);
-            }
-      
-         } // if ( m_getOuputGeometry.valid() )
-         else
-         {
-            // Should never happer...
-            std::string errMsg = MODULE;
-            if ( !source )
-            {
-               errMsg += " image source null!";
-            }
-            else
-            {
-               errMsg += " output projection null!";
-            }
-            throw( ossimException(errMsg) );
-         }
-         
-      } // if ( rect.hasNans() )
-
-   } // if ( source )
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "aoi: " << rect << "\n"
-         << MODULE << " exited...\n";
-   }
-   
-} // End: ossimChipperUtil::getAreaOfInterest
-
-void ossimChipperUtil::initializeThumbnailProjection(const ossimIrect& originalRect,
-                                                     ossimIrect& adjustedRect)
-{
-   static const char MODULE[] = "ossimChipperUtil::initializeThumbnailProjection";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\n"
-         << "origial rect:  " << originalRect << "\n";
-
-      if (m_geom.valid())
-      {
-         m_geom->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-   }
-
-   if ( !originalRect.hasNans() && m_geom.valid() )
-   {
-      //---
-      // Thumbnail setup:
-      //---
-      ossimString thumbRes = m_kwl->findKey( THUMBNAIL_RESOLUTION_KW );
-      if ( thumbRes.size() )
-      {
-         ossim_float64 thumbSize = thumbRes.toFloat64();
-         ossim_float64 maxRectDimension =
-            ossim::max( originalRect.width(), originalRect.height() );
-
-         if ( maxRectDimension > thumbSize )
-         {
-            // Need to adjust scale:
-            
-            // Get the corners before the scale change:
-            ossimGpt ulGpt;
-            ossimGpt lrGpt;
-            
-            m_geom->localToWorld(ossimDpt(originalRect.ul()), ulGpt);
-            m_geom->localToWorld(ossimDpt(originalRect.lr()), lrGpt);         
-            
-            if ( isIdentity()  && m_ivt.valid() ) // Chipping in image space.)
-            {
-               ossim_float64 scale = thumbSize / maxRectDimension;
-               if ( m_ivt->getScale().hasNans() )
-               {
-                  m_ivt->scale( scale, scale );
-               }
-               else
-               {
-                  m_ivt->scale( m_ivt->getScale().x*scale,m_ivt->getScale().y*scale ); 
-               }
-            }
-            else
-            {
-               ossim_float64 scale = maxRectDimension / thumbSize;
-               
-               //---
-               // Adjust the projection scale.  Note the "true" is to recenter
-               // the tie point so it falls relative to the projection origin.
-               //
-               // This call also scales: ossimImageGeometry::m_imageSize
-               //---
-               m_geom->applyScale(ossimDpt(scale, scale), true);
-            }
-
-            // Must call to reset the ossimImageRenderer's bounding rect for each input.
-            propagateOutputProjectionToChains();  
-
-            // Get the new upper left in view space.
-            ossimDpt dpt;
-            m_geom->worldToLocal(ulGpt, dpt);
-            ossimIpt ul(dpt);
-            
-            // Get the new lower right in view space.
-            m_geom->worldToLocal(lrGpt, dpt);
-            ossimIpt lr(dpt);
-
-            //---
-            // Clamp to thumbnail bounds with padding if turned on.
-            // Padding is optional. If padding turned on alway make square.
-            //---
-            ossim_int32 ts = thumbSize;
-            bool pad = padThumbnail();
-            
-            if ( ( (lr.x - ul.x + 1) > ts ) || pad )
-            {
-               lr.x = ul.x + ts - 1;
-            }
-            if ( ( (lr.y - ul.y + 1) > ts ) || pad )
-            {
-               lr.y = ul.y + ts - 1;
-            }
-            
-            adjustedRect = ossimIrect(ul, lr);
-         }
-      }
-      
-   } // if ( !originalRect.hasNans() && m_geom.valid() )
-   else
-   {
-      // Should never happer...
-      std::string errMsg = MODULE;
-      if ( originalRect.hasNans() )
-      {
-         errMsg += " passed in rect has nans!";
-      }
-      else
-      {
-         errMsg += " output projection null!";
-      }
-      throw( ossimException(errMsg) );
-   }
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << "\nadjusted rect: " << adjustedRect << "\n";
-      if (m_geom.valid())
-      {
-         m_geom->print(ossimNotify(ossimNotifyLevel_DEBUG));
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
-   }
-}
-
-bool ossimChipperUtil::hasBandSelection() const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      result = m_kwl->hasKey( std::string(ossimKeywordNames::BANDS_KW) );
-   }
-   return result;
-}
-
-bool ossimChipperUtil::hasWmsBboxCutWidthHeight()const
-{
-   bool result = false;
-
-   if(m_kwl.valid())
-   {
-      result = (m_kwl->hasKey( CUT_HEIGHT_KW )&&
-                m_kwl->hasKey( CUT_WIDTH_KW ) &&
-                (m_kwl->hasKey( CUT_WMS_BBOX_KW )||
-                  m_kwl->hasKey(CUT_WMS_BBOX_LL_KW)));
-   }
-
-   return result;
-}
-        
-bool ossimChipperUtil::hasCutBoxWidthHeight() const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      if ( m_kwl->hasKey( CUT_HEIGHT_KW ) )
-      {
-         if ( m_kwl->hasKey( CUT_WIDTH_KW ) )
-         {
-            if ( m_kwl->hasKey( CUT_MIN_LAT_KW ) )
-            {
-               if ( m_kwl->hasKey( CUT_MIN_LON_KW ) )               
-               {
-                  if ( m_kwl->hasKey( CUT_MAX_LAT_KW ) )
-                  {
-                     if ( m_kwl->hasKey( CUT_MAX_LON_KW ) )
-                     {
-                        result = true;
-                     }
-                  }
-               }
-            } // if lat and lon WMS style bbox is specified then we will behave the same as above
-            else if( m_kwl->hasKey(CUT_WMS_BBOX_LL_KW))
-            {
-              result = true;
-            }
-         }
-      }
-   }
-   return result;
-}
-
-bool ossimChipperUtil::hasScaleOption() const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      if ( m_kwl->hasKey( METERS_KW.c_str() ) ||
-           m_kwl->hasKey( DEGREES_X_KW.c_str() ) ||
-           hasCutBoxWidthHeight()||
-           hasWmsBboxCutWidthHeight() )
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-bool ossimChipperUtil::isThreeBandOut() const
-{
-   return keyIsTrue( THREE_BAND_OUT_KW );
-}
-
-bool ossimChipperUtil::padThumbnail() const
-{
-   return  keyIsTrue( PAD_THUMBNAIL_KW );
-}
-
-void ossimChipperUtil::setReaderProps( ossimImageHandler* ih ) const
-{
-   if ( ih && m_kwl.valid() )
-   {
-      ossim_uint32 count = m_kwl->numberOf( READER_PROPERTY_KW.c_str() );
-      for (ossim_uint32 i = 0; i < count; ++i)
-      {
-         ossimString key = READER_PROPERTY_KW;
-         key += ossimString::toString(i);
-         ossimString value = m_kwl->findKey( key.string() );
-         if ( value.size() )
-         {
-            std::vector<ossimString> splitArray;
-            value.split(splitArray, "=");
-            if(splitArray.size() == 2)
-            {
-               ossimRefPtr<ossimProperty> prop =
-                  new ossimStringProperty(splitArray[0], splitArray[1]);
-               
-               ih->setProperty( prop );
-            }
-         }
-      }
-   }
-}
-
-void ossimChipperUtil::getBandList( std::vector<ossim_uint32>& bandList ) const
-{
-   bandList.clear();
-   if ( m_kwl.valid() )
-   {
-      ossimString os;
-      os.string() = m_kwl->findKey( std::string( ossimKeywordNames::BANDS_KW ) );
-      if ( os.size() )
-      {
-         std::vector<ossimString> band_list(0);
-         os.split( band_list, ossimString(","), false );
-         if ( band_list.size() )
-         {
-            std::vector<ossimString>::const_iterator i = band_list.begin();
-            while ( i != band_list.end() )
-            {
-               ossim_uint32 band = (*i).toUInt32();
-               if ( band ) // One based so we need to subtract.
-               {
-                  bandList.push_back( band - 1 );
-               }
-               ++i;
-            }
-         }
-      }
-   }
-   
-} // End: ossimChipperUtil::getBandList
-
-bool ossimChipperUtil::hasLutFile() const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      result = ( m_kwl->find( LUT_FILE_KW.c_str() ) != 0 );
-   }
-   return result;
-}
-
-bool ossimChipperUtil::hasBrightnesContrastOperation() const
-{
-   bool result = false;
-   std::string value = m_kwl->findKey( BRIGHTNESS_KW );
-   if ( value.size() )
-   {
-      result = true;
-   }
-   else
-   {
-      value = m_kwl->findKey( CONTRAST_KW );
-      if ( value.size() )
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-bool ossimChipperUtil::hasGeoPolyCutterOption()const
-{
-   bool result = (m_kwl->find(CLIP_WMS_BBOX_LL_KW.c_str())||
-                  m_kwl->find(CLIP_POLY_LAT_LON_KW.c_str()));
-   
-   return result;
-}
-
-bool ossimChipperUtil::hasBumpShadeArg() const
-{
-   bool result = ( m_operation == OSSIM_CHIPPER_OP_HILL_SHADE );
-   if ( !result && m_kwl.valid() )
-   {
-      result = ( m_kwl->find( ossimKeywordNames::AZIMUTH_ANGLE_KW ) ||
-                 m_kwl->find( COLOR_RED_KW.c_str() ) ||
-                 m_kwl->find( COLOR_GREEN_KW.c_str() ) ||
-                 m_kwl->find( COLOR_BLUE_KW.c_str() ) ||
-                 m_kwl->find( ossimKeywordNames::ELEVATION_ANGLE_KW ) ||
-                 m_kwl->find( GAIN_KW.c_str() ) );
-   }
-   return result;
-}
-
-bool ossimChipperUtil::hasThumbnailResolution() const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      result = ( m_kwl->find( THUMBNAIL_RESOLUTION_KW.c_str() ) != 0 );
-   }
-   return result;
-}
-
-bool ossimChipperUtil::hasHistogramOperation() const
-{
-   bool result = false;
-   
-   if ( m_kwl.valid() )
-   {
-      result = ( m_kwl->find( HISTO_OP_KW.c_str() ) != 0 );
-   }
-   // No option for this right now.  Only through src file.
-   return result;
-}
-
-bool ossimChipperUtil::isDemFile(const ossimFilename& file) const
-{
-   bool result = false;
-   ossimString ext = file.ext();
-   if ( ext.size() >= 2 )
-   {
-      ext.downcase();
-      if ( ( ext == "hgt" ) ||
-           ( ext == "dem" ) ||
-          ( ( (*ext.begin()) == 'd' ) && ( (*(ext.begin()+1)) == 't' ) ) )
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-bool ossimChipperUtil::isSrcFile(const ossimFilename& file) const
-{
-   bool result = false;
-   ossimString ext = file.ext();
-   ext.downcase();
-   if ( ext == "src" )
-   {
-      result = true;
-   }
-   return result;
-}
-
-ossimScalarType ossimChipperUtil::getOutputScalarType() const
-{
-   ossimScalarType scalar = OSSIM_SCALAR_UNKNOWN;
-   ossimString lookup = m_kwl->findKey( OUTPUT_RADIOMETRY_KW );
-   if ( lookup.size() )
-   {
-      scalar = ossimScalarTypeLut::instance()->getScalarTypeFromString( lookup );
-   }
-   if ( scalar == OSSIM_SCALAR_UNKNOWN )
-   {
-      // deprecated keyword...
-      if ( keyIsTrue( std::string(SCALE_2_8_BIT_KW) ) )
-      {
-         scalar = OSSIM_UINT8;
-      }
-   }
-   return scalar;
-}
-
-bool ossimChipperUtil::scaleToEightBit() const
-{
-   bool result = false;
-   if ( getOutputScalarType() == OSSIM_UINT8 )
-   {
-      result = true;
-   }
-   return result;
-}
-
-bool ossimChipperUtil::snapTieToOrigin() const
-{
-   return keyIsTrue( SNAP_TIE_TO_ORIGIN_KW );
-}
-
-void ossimChipperUtil::getImageSpaceScale( ossimDpt& imageSpaceScale ) const
-{
-   std::string value = m_kwl->findKey( IMAGE_SPACE_SCALE_X_KW );
-   if ( value.size() )
-   {
-      imageSpaceScale.x = ossimString(value).toFloat64();
-   }
-   else
-   {
-      imageSpaceScale.x = 1.0;
-   }
-   value = m_kwl->findKey( IMAGE_SPACE_SCALE_Y_KW );
-   if ( value.size() )
-   {
-      imageSpaceScale.y = ossimString(value).toFloat64();
-   }
-   else
-   {
-      imageSpaceScale.y = 1.0;
-   }
-}
-
-ossim_float64 ossimChipperUtil::getRotation() const
-{
-   ossim_float64 result = ossim::nan();
-   if ( m_kwl.valid() )
-   {
-      std::string value = m_kwl->findKey( ROTATION_KW);
-      if ( value.size() )
-      {
-         result = ossimString(value).toFloat64();
-         if ( result < 0 )
-         {
-            result += 360.0;
-         }
-
-         // Range check:
-         if ( ( result < 0.0 ) || ( result > 360.0 ) )
-         {
-            std::ostringstream errMsg;
-            errMsg << "ossimChipperUtil::getRotation range error!\n"
-                   << "rotation = " << result
-                   << "\nMust be between 0 and 360.";
-            throw ossimException( errMsg.str() );
-         }
-      }
-   }
-   return result;
-}
-
-bool ossimChipperUtil::upIsUp() const
-{
-   return keyIsTrue( std::string(UP_IS_UP_KW) );
-}
-
-bool ossimChipperUtil::hasRotation() const
-{
-   bool result = false;
-   std::string value = m_kwl->findKey(std::string(ROTATION_KW));
-   if ( value.size() )
-   {
-      result = true;
-   }
-   return result;
-}
-
-bool ossimChipperUtil::northUp() const
-{
-   return keyIsTrue( std::string(NORTH_UP_KW) );
-}
-
-bool ossimChipperUtil::isIdentity() const
-{
-   return (m_operation == OSSIM_CHIPPER_OP_CHIP);
-}
-
-bool ossimChipperUtil::keyIsTrue( const std::string& key ) const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      std::string value = m_kwl->findKey( key );
-      if ( value.size() )
-      {
-         result = ossimString(value).toBool();
-      }
-   }
-   return result;
-}
-
-ossim_uint32 ossimChipperUtil::getEntryNumber() const
-{
-   ossim_uint32 result = 0;
-   if ( m_kwl.valid() )
-   {
-      std::string value = m_kwl->findKey( std::string( ossimKeywordNames::ENTRY_KW ) );
-      if ( value.size() )
-      {
-         result = ossimString(value).toUInt32();
-      }
-   }
-   return result;
-}
-
-ossim_int32 ossimChipperUtil::getZone() const
-{
-   ossim_int32 result = 0;
-   if ( m_kwl.valid() )
-   {
-      std::string value = m_kwl->findKey( std::string( ossimKeywordNames::ZONE_KW ) );
-      if ( value.size() )
-      {
-         result = ossimString(value).toUInt32();
-      }
-   }
-   return result;
-}
-      
-
-std::string ossimChipperUtil::getHemisphere() const
-{
-   std::string result;
-   if ( m_kwl.valid() )
-   {
-      result = m_kwl->findKey( std::string( ossimKeywordNames::HEMISPHERE_KW ) );
-   }
-   return result;
-}
-
-bool ossimChipperUtil::hasSensorModelInput()
-{
-   bool result = false;
-
-   // Test image layers.
-   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx = m_imgLayer.begin();
-   while ( chainIdx != m_imgLayer.end() )
-   {
-      // Get the image handler:
-      ossimRefPtr<ossimImageHandler> ih = (*chainIdx)->getImageHandler();
-      if ( ih.valid() )
-      {
-         // Get the geometry from the first image handler.      
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if ( geom.valid() )
-         {
-            // Get the image projection.
-            ossimRefPtr<ossimProjection> proj = geom->getProjection();
-            if ( proj.valid() )
-            {
-               // Cast and assign to result.
-               ossimMapProjection* mapProj = PTR_CAST( ossimMapProjection, proj.get() );
-               if ( !mapProj )
-               {
-                  result = true;
-                  break;
-               }
-            }
-         }
-      }   
-      ++chainIdx;
-   }
-
-   if ( !result )
-   {
-      // Test dem layers.
-      chainIdx = m_demLayer.begin();
-      while ( chainIdx != m_demLayer.end() )
-      {
-         // Get the image handler:
-         ossimRefPtr<ossimImageHandler>  ih = (*chainIdx)->getImageHandler();
-         if ( ih.valid() )
-         {
-            // Get the geometry from the first image handler.      
-            ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-            if ( geom.valid() )
-            {
-               // Get the image projection.
-               ossimRefPtr<ossimProjection> proj = geom->getProjection();
-               if ( proj.valid() )
-               {
-                  // Cast and assign to result.
-                  ossimMapProjection* mapProj = PTR_CAST( ossimMapProjection, proj.get() );
-                  if ( !mapProj )
-                  {
-                     result = true;
-                     break;
-                  }
-               }
-            }
-         }   
-         ++chainIdx;
-      }
-   }
-   
-   return result;
-}
-
-void  ossimChipperUtil::initializeSrcKwl()
-{
-   static const char MODULE[] = "ossimChipperUtil::initializeSrcKwl";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered...\n";
-   }
-
-   std::string value = m_kwl->findKey(std::string(SRC_FILE_KW));
-   if ( value.size() )
-   {
-      m_srcKwl = new ossimKeywordlist();
-      m_srcKwl->setExpandEnvVarsFlag(true);
-      if ( m_srcKwl->addFile( value.c_str() ) == false )
-      {
-         m_srcKwl = 0;
-      }
-   }
-   else
-   {
-      m_srcKwl = 0; 
-   }
-
-   if ( traceDebug() )
-   {
-      if ( m_srcKwl.valid() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "src keyword list:\n" << *(m_srcKwl.get()) << "\n";
-      }
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " exited...\n";
-   }
-}
-
-ossim_uint32 ossimChipperUtil::getNumberOfInputs() const
-{
-   ossim_uint32 result = 0;
-   if ( m_kwl.valid() )
-   {
-      // Look for dems, e.g. dem0.file: foo.tif
-      ossimString regularExpression = "dem[0-9]*\\.file";
-      result = m_kwl->getNumberOfKeysThatMatch( regularExpression );
-      
-      // Look for images, e.g. image0.file: foo.tif
-      regularExpression = "image[0-9]*\\.file";
-      result += m_kwl->getNumberOfKeysThatMatch( regularExpression );
-   }
-   if ( m_srcKwl.valid() )
-   {
-      result += m_srcKwl->numberOf( DEM_KW.c_str() );
-      result += m_srcKwl->numberOf( IMG_KW.c_str() );
-   }
-   return result;
-}
-
-ossimChipperUtil::ossimChipperOutputProjection ossimChipperUtil::getOutputProjectionType() const
-{
-   ossimChipperOutputProjection result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_UNKNOWN;
-   const char* op  = m_kwl->find(ossimKeywordNames::PROJECTION_KW);
-   if ( op )
-   {
-      ossimString os = op;
-      os.downcase();
-      if (os == "geo")
-      {
-         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO;
-      }
-      else if (os == "geo-scaled")
-      {
-         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO_SCALED;
-      }
-      else if ( os == "input" )
-      {
-         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_INPUT;
-      }
-      else if ( (os == "utm") || (os == "ossimutmprojection") )
-      {
-         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_UTM;
-      }
-   }
-   return result;
-}
-
-void ossimChipperUtil::getClipPolygon(ossimGeoPolygon& polygon)const
-{
-   ossimString param = m_kwl->find(CLIP_WMS_BBOX_LL_KW.c_str());
-   if(!param.empty())
-   {
-      if(!polygon.addWmsBbox(param))
-      {
-         polygon.clear();
-      }
-   }
-   else
-   {
-      param = m_kwl->find(CLIP_POLY_LAT_LON_KW.c_str());
-      if(!param.empty())
-      {
-         std::vector<ossimGpt> points;
-         ossim::toVector(points, param);
-         if(!points.empty())
-         {
-            polygon = points;
-         }
-      }
-   }
-}
-
-ossim_float64 ossimChipperUtil::getBrightness() const
-{
-   ossim_float64 brightness = 0.0;
-   std::string value = m_kwl->findKey( BRIGHTNESS_KW );
-   if ( value.size() )
-   {
-      brightness = ossimString(value).toFloat64();
-
-      // Range check it:
-      if ( ( brightness < -1.0 ) || ( brightness > 1.0 ) )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimChipperUtil::getBrightness range error!"
-            << "\nbrightness: " << brightness
-            << "\nvalid range: -1.0 to 1.0"
-            << "\nReturned brightness has been reset to: 0.0"
-            << std::endl;
-         
-         brightness = 0.0;
-      }
-   }
-   return brightness;
-   
-}
-
-ossim_float64 ossimChipperUtil::getContrast() const
-{
-   ossim_float64 contrast = 1.0;
-   std::string value = m_kwl->findKey( CONTRAST_KW );
-   if ( value.size() )
-   {
-      contrast = ossimString(value).toFloat64();
-
-      // Range check it:
-      if ( ( contrast < 0.0 ) || ( contrast > 20.0 ) )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimChipperUtil::getContrast range error!"
-            << "\ncontrast: " << contrast
-            << "\nvalid range: 0 to 20.0"
-            << "\nReturned contrast has been reset to: 1.0"
-            << std::endl;
-         
-         contrast = 1.0;
-      }
-   }
-   return contrast;
-   
-}
-
-std::string ossimChipperUtil::getSharpenMode() const
-{
-   ossimString mode = m_kwl->findKey( SHARPEN_MODE_KW );
-   if ( mode.size() )
-   {   
-      mode.downcase();
-      if ( (mode != "light") && (mode != "heavy") && (mode != "none") )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimChipperUtil::getSharpnessMode WARNING!"
-            << "\nInvalid sharpness mode: " << mode
-            << "\nValid modes: \"light\" and \"heavy\""
-            << std::endl;
-         mode = "";
-      }
-   }
-   return mode.string();
-}
-
-void ossimChipperUtil::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-   
-   // Set app name.
-   std::string appName = ap.getApplicationName();
-   ap.getApplicationUsage()->setApplicationName( ossimString( appName ) );
-
-   // Add options.
-   addArguments(ap);
-   
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-
-   // Keeping single line in tact for examples for cut and paste purposes.
-   ossimNotify(ossimNotifyLevel_INFO)
-
-      << "NOTES:\n"
-      << "1) Never use same base name in the same directory! Example is you have a Chicago.tif\n"
-      << "   and you want a Chicago.jp2, output Chicago.jp2 to its own directory.\n"
-      
-      << "\nExample commands:\n"
-
-      << "\n// File conversion: Convert geotiff to a jp2 file.\n"
-      << appName << " --op chip -w ossim_kakadu_jp2 Chicago.tif outputs/Chicago.jp2\n"
-
-      << "\n// Orthorectification: Orthorectify a nitf with RPC model out to a geotiff.\n"
-      << appName << " --op ortho 5V090205P0001912264B220000100282M_001508507.ntf outputs/ortho.tif\n"
-      
-      << "\n// Mosaic: Mosaic multiple images together and output to a geotiff.\n"
-      << appName << " --combiner-type ossimImageMosaic --op ortho f1.tif f2.tif f3.tif outputs/mosaic.tif\n"
-      
-      << "\n// Mosaic: Feather Mosaic multiple images together and output to a geotiff.\n"
-      << appName << " --combiner-type ossimFeatherMosaic --op ortho f1.tif f2.tif f3.tif outputs/feather.tif\n"
-
-      << "\n// Color relief: Colorize two DEMs from a lut, output to a geotiff.\n"
-      << appName << " --op color-relief --color-table ossim-dem-color-table-template.kwl N37W123.hgt N38W123.hgt outputs/color-relief.tif\n"
-
-      << "\n// Color relief: Colorize two DEMs from a lut, output to a png thumbnail.\n"
-      << appName << " --op color-relief --color-table ossim-dem-color-table-template.kwl -t 1024 -w ossim_png N37W123.hgt N38W123.hgt outputs/color-relief.png\n"
-
-      << "\n// Hill shade: Hill shade two DEMs, output to a geotiff.\n"
-      << appName << " --color 255 255 255 --azimuth 270 --elevation 45 --exaggeration 2.0 --op  hillshade N37W123.hgt N38W123.hgt outputs/hillshade.tif\n"
-      
-      << "\n// Two color multi view with cut box.  First image is old, second image is new:\n"
-      << appName << " --cut-bbox-ll 28.092885092033352 -80.664539599998633 28.109128691071547 -80.626914963229325 --op 2cmv oldMLB.tif newMLB.tif outputs/2cmv-test1.tif\n"
-
-      << "\n// Ortho about point, 512x512, with histogram stretch, and 3,2,1 band order:\n"
-      << appName << " --op ortho -b 3,2,1 --histogram-op auto-minmax --cut-center-llwh -42.819784401784275 147.265811350983 512 512 5V090205M0001912264B220000100072M_001508507.ntf orth.tif\n"
-
-      << "\n// Chip, in image space, about point, 512x512, with histogram stretch, and 3,2,1 band order:\n"
-      << appName << " --op chip -b 3,2,1 --histogram-op auto-minmax --cut-center-llwh -42.819784401784275 147.265811350983 512 512 5V090205M0001912264B220000100072M_001508507.ntf chip.tif\n"
-
-      << "\n// Chip in image space, rotate \"up is up\"(-u option) about point, 512x512 with histogram stretch and 3,2,1 band order:\n"
-      << appName << " --op chip -u -b 3,2,1 --histogram-op auto-minmax --cut-center-llwh -42.819784401784275 147.265811350983 512 512 5V090205M0001912264B220000100072M_001508507.ntf up-is-up-chip.tif\n"
-
-      << "\n// Chip in image space, rotate 39 degrees (-r option) about point, 1024x1024, scaled to eight bit:\n"
-      << appName << " --op chip -r 39 --histogram-op auto-minmax --cut-center-llwh -42.883809539602893 147.331984112985765 1024 1024 --output-radiometry U8 5V090205P0001912264B220000100282M_001508507.ntf outputs/r39.png\n"
-
-      << "\n// Above command where all options are in a keyword list:\n"
-      << appName << " --options r39-options.kwl\n"
-      << std::endl;
-}
-
-
diff --git a/ossim/src/ossim/util/ossimEquationUtil.cpp b/ossim/src/ossim/util/ossimEquationUtil.cpp
deleted file mode 100644
index 201d80e..0000000
--- a/ossim/src/ossim/util/ossimEquationUtil.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Garrett Potts
-//
-//*******************************************************************
-//  $Id: ossimEquationUtil.cpp 23434 2015-07-15 17:01:59Z gpotts $
-#include <iostream>
-#include <sstream>
-#include <fstream>
-using namespace std;
-
-#include <ossim/util/ossimEquationUtil.h>
-#include <ossim/imaging/ossimEquationCombiner.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/projection/ossimUtmProjection.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimRtti.h>
-
-static ossimTrace traceDebug(ossimString("mosaic:main"));
-
-// Copied from ossimEquationCombiner.h:
-static const char* EQ_SPEC = "\nEquation Specification:\n\
-\n\
-sin(x)                 takes the sine of the input  \n\
-sind(x)                takes the sin of the input and assumes degree input \n\
-cos(x)                 takes cosine of input \n\
-cosd(x)                takes the cosine of input and assumes input in degrees \n\
-sqrt(x)                takes square root of input \n\
-log(x)                 takes the natural log of input \n\
-log10(x)               takes the log base 10 of the input \n\
-exp(x)                 takes the e raised to the passed in argument \n\
-abs(x)                 takes the absolute value of the passed in value \n\
-min(x1, x2, ... xn)    takes the min of all values in the list \n\
-max(x1, x2, ... xn)    takes the max of all values in the list. \n\
-\n\
-clamp(image_data, min, max) \n\
-                      will clamp all data to be between the min max values. \n\
-                      will set anything less than min to min and anythin \n\
-                      larger than max to max \n\
-\n\
-band(image_data, num)  returns a single band image object \n\
-                      by selecting band num from input image i1.  Note \n\
-                      the first argument must be an image \n\
-                      and the second argument must be a number \n\
-\n\
-shift(index, num_x, num_y) \n\
-                      currently, the first argument must be an image \n\
-                      variable(i1, i2, ... in) and x, and y must b numbers \n\
-                      indicating the delta in that direction to shift the \n\
-                      input. \n\
-\n\
-blurr(index, rows, cols) \n\
-                      Will blurr the input image i with a \n\
-                      rows-by-cols kernel.  All values are equal \n\
-                      weight.  Note the fist argument must by an image \n\
-                      variable (ex: i1, i2,....in). \n\
-\n\
-conv(index, rows, cols, <row ordered list of values> ) \n\
-                      this allows you to define an arbitrary matrix.  The \n\
-                      <row ordered list of values> is a comma separated \n\
-                      list of constant values. \n\
-\n\
-assign_band(image_data, num1, data2, num2) \n\
-                      will take band num2 from image data2 and assign it to \n\
-                      band num1 in data 1. \n\
-\n\
-assign_band(image_data, num1, data2) \n\
-                      will take band 1 from image data2 and assign it to \n\
-                      band num1 in data 1. \n\
-\n\
-assign_band(image_data, num1, num2) \n\
-                      will assin to band num1 of data 1 the value of num2 \n\
-\n\
-x1 * x2                will multiply x1 and x2 \n\
-x1 + x2                will add x1 and x2 \n\
-x1 - x2                will subtract x1 and x2 \n\
-x1 / x2                will divide x1 and x2 \n\
-x1 ^ x2                will do a power, raises x1 to x2 \n\
-x1 | x2                will do a bitwise or operation \n\
-                      ( will do it in unisgned char precision) \n\
-\n\
-x1 & x2                will do a bitwise and operation \n\
-                      ( will do it in unsigned char precision) \n\
-\n\
-~x1                    will do the ones complement of the input \n\
-\n\
-x1 xor x2              will do an xclusive or operation \n\
-                      (will do it in unsigned char precision) \n\
-\n\
-- x1                   will negative of x1 \n\
-\n\
-Boolean ops: 1=true, 0=false \n\
-x1 > x2 \n\
-x1 >= x2 \n\
-x1 == x2 \n\
-x1 <= x2 \n\
-x1 < x2 \n\
-x1 <> x2 \n\
-\n\
-Note: \n\
-\n\
-Currently an image input is reference by the variable in[<I>] where \n\
-<I> is the input image index beginning at 0.  So 1 referes to the second image \n\
-in the input list. \n\
-\n\
-(in[0] + in[1])/2 \n\
-Will take image 1 and add it to image 2 and average them. \n\
-\n\
-exp(sqrt(in[0])/4) \n\
-Will take the root of the image and divide by 4 and then raise e to that \n\
-amount. \n\
-\n\
-128 \n\
-Will return a constant value of 128 for all input bands. \n\
-\n\
-min(1,in[2],in[3], max(in[1],in[0])) \n\
-\n\
-shift(0, 1, 1) - i1 \n\
-Will shift input 0 by 1 pixel along the diagonal  and then subtract it \n\
-from input 1. \n\
-\n\
-assign_band(in[0], 1, blurr(in[0], 5, 5), 2) \n\
-Will assign to the first band of i1 the 2nd band of the 5x5 blurr of i1. \n\
-\n\
-conv(0, 3, 3, -1, -2, -1, 0, 0, 0, 1, 2, 1) \n\
-Will convolve the first input connection with a 3x3 matrix. \n\
-The args are row ordered: \n\
-                        -1, -2, -1 \n\
-                         0,  0,  0 \n\
-                         1,  2,  1 \n\
-\n\
-NDVI: \n\
-N=(in[0]-in[1])/(in[0]+in[1]) \n\
-\n\
-For indexed-type values,like NDVI, (with limited values) it is better \n\
-to rescale between 0.0 and 1.0 and use type NormalizedFloat. \n\
-\n\
-Rescaled NDVI between 0 and 1: \n\
-(N+1)/2 = in[0]/(in[0]+in[1]) \n\
-\n";
-
-ossimEquationUtil::ossimEquationUtil(ossimArgumentParser& ap)
-:  m_argumentParser(new ossimArgumentParser(ap))
-{
-   m_usage.setApplicationName(ap.getApplicationName());
-   m_usage.setDescription(ap.getApplicationName() +
-                        " Takes a list of images and performs the specified equation. The inputs"
-                        "must be in the same projection as the operations are done at the pixel"
-                        "level with no renderer in th chain. The output file will contain the same"
-                        "geospatial header info as the first image in the input list.");
-   m_usage.setCommandLineUsage(ap.getApplicationName()+
-                              " \"<equation spec>\" <input_file1> <input_file2> <input_file...> <output_file>");
-   m_usage.addCommandLineOption("-h or --help","Display this information");
-   m_usage.addCommandLineOption("-k <filename>", "keyword list to load from");
-   m_usage.addCommandLineOption("-w <type>", "Writer type (tiff_strip, jpeg, etc... see ossim-info --writers) (default=tiff_strip)");
-   m_usage.addCommandLineOption("--writer-prop <string>", "Adds a property to send to the writer. format is name=value");
-   m_usage.addCommandLineOption("-t <filename>", "ouput a keyword list template");
-}
-
-bool ossimEquationUtil::execute()
-{
-   // Allocate some stuff up front for use later
-   ossimString writerType = "tiff_strip";
-   ossimString equationSpec;
-   std::string tempString;
-   ossimArgumentParser::ossimParameter stringParam(tempString);
-   std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;
-   vector<ossimFilename> infiles;
-   ossimFilename outfile;
-
-   // Display Help
-   if (m_argumentParser->read("-h") || m_argumentParser->read("--help") || (m_argumentParser->argc() < 4))
-   {
-      m_usage.write(ossimNotify(ossimNotifyLevel_INFO));
-      ossimNotify(ossimNotifyLevel_INFO)<<EQ_SPEC<<endl;
-      return false;
-   }
-
-   // Output KWL template
-   if (m_argumentParser->read("-t", stringParam))
-   {
-      ossimFilename templateFilename = tempString.c_str();
-      outputTemplateKeywordlist(templateFilename);
-      return false;
-   }
-
-   // Keyword list to load from
-   if (m_argumentParser->read("-k", stringParam))
-   {
-      if (!parseKwl(tempString.c_str(), infiles, equationSpec, outfile, writerType))
-         return false;
-   }
-   else
-   {
-      // Everything on command line:
-      // user input writer props, should use those
-      while(m_argumentParser->read("--writer-prop", stringParam))
-      {
-         std::vector<ossimString> nameValue;
-         ossimString(tempString).split(nameValue, "=");
-         if(nameValue.size() == 2)
-            writerPropertyMap.insert(std::make_pair(nameValue[0], nameValue[1]));
-      }
-
-      // User input a writer type
-      if (m_argumentParser->read("-w", stringParam))
-         writerType = tempString;
-
-      int argCount = m_argumentParser->argc();
-      if (argCount < 4)
-      {
-         m_usage.write(ossimNotify(ossimNotifyLevel_INFO));
-         ossimNotify(ossimNotifyLevel_INFO)<<EQ_SPEC<<endl;
-         return false;
-      }
-
-      // First the equation spec:
-      equationSpec = m_argumentParser->argv()[1];
-
-      // Get the input files.
-      for (int i=2; i< (argCount-1); ++i)
-         infiles.push_back(ossimFilename(m_argumentParser->argv()[i]));
-
-      // Get the output file.
-      outfile = m_argumentParser->argv()[argCount-1];
-   }
-
-   if (!initInputSources(infiles))
-      return false;
-
-   // Create combiner object
-   ossimRefPtr<ossimEquationCombiner> combiner = new ossimEquationCombiner(m_inputSources);
-   combiner->setEquation(equationSpec);
-
-   // Create writer:
-   ossimRefPtr<ossimImageFileWriter> writer;
-   writer = ossimImageWriterFactoryRegistry::instance()->createWriter(writerType);
-   if(!writer.valid())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)<<"Could not create writer of type <"<<writerType<<">"<<endl;
-      return false;
-   }
-   writer->connectMyInputTo(combiner.get());
-   writer->setFilename(outfile);
-   ossimIrect bounding_irect;
-   m_prodGeometry->getBoundingRect(bounding_irect);
-   writer->setAreaOfInterest(bounding_irect);
-   writer->initialize();
-
-   if ( writerPropertyMap.size() )
-   {
-      ossimPropertyInterface* propInterface = (ossimPropertyInterface*) writer.get();
-      std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = writerPropertyMap.begin();
-      while(iter!=writerPropertyMap.end())
-      {
-         propInterface->setProperty(iter->first, iter->second);
-         ++iter;
-      }
-   }
-
-   // Execute:
-   ossimStdOutProgress listener;
-   writer->addListener(&listener);
-   if (!writer->execute())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<< "Error encountered writing file..."<<endl;
-      return false;
-   }
-
-   writer->close();
-   return true;
-}
-
-void ossimEquationUtil::outputTemplateKeywordlist(const ossimFilename &templateFilename)
-{
-   ofstream out(templateFilename.c_str());
-
-   out << "file1.filename: <full path and file name>" << endl
-       << "file2.filename: <full path and file name>" << endl
-       << "// :\n"
-       << "// :\n"
-       << "// fileN.filename:: <full path and file name>" << endl
-       << "\n// currently this option has been tested\n"
-       << "// with ossimTiffWriter and ossimJpegWriter\n"
-       << "writer.type: tiff_strip"            << endl
-       << "writer.filename: <full path to output file>"  << endl
-       << "\n// Equation specification:\n"
-       << "equation: <equation spec string>"<<endl;
-
-   ossimNotify(ossimNotifyLevel_NOTICE) << "Wrote file: " << templateFilename << std::endl;
-}
-
-bool ossimEquationUtil::parseKwl(const ossimFilename& kwl_file,
-              vector<ossimFilename>& inputs,
-              ossimString& equationSpec,
-              ossimFilename& output,
-              ossimString& writerType)
-{
-   ossimKeywordlist kwl;
-   if (!kwl.addFile(kwl_file))
-      return false;
-
-   ossim_int32 index = 0;
-   ossim_int32 result = kwl.getNumberOfSubstringKeys("file[0-9]+\\.filename");
-   const char* lookup = NULL;
-   ossim_int32 numberOfMatches = 0;
-
-   while(numberOfMatches < result)
-   {
-      ossimString searchValue = "file" + ossimString::toString(index);
-
-      ossimString filename = searchValue + ".filename";
-      lookup = kwl.find(filename.c_str());
-      if(lookup)
-      {
-         inputs.push_back(ossimFilename(lookup));
-         ++numberOfMatches;
-      }
-      ++index;
-   }
-
-   equationSpec = kwl.find("equation");
-   if (equationSpec.empty())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)<<"No equation specified in KWL"<<endl;
-      return false;
-   }
-
-   output = kwl.find("writer.filename");
-   if (output.empty())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)<<"No output filename specified in KWL"<<endl;
-      return false;
-   }
-
-   writerType = kwl.find("writer.type");
-   if (writerType.empty())
-      writerType = "tiff_strip";
-
-   return true;
-}
-
-bool ossimEquationUtil::initInputSources(vector<ossimFilename>& fileList)
-{
-   bool result = true;
-   m_inputSources.clear();
-   ossimRefPtr<ossimImageGeometry> input_geom;
-
-   for(ossim_int32 index = 0; index < (ossim_int32)fileList.size();++index)
-   {
-      ossimRefPtr<ossimImageHandler> handler =
-            ossimImageHandlerRegistry::instance()->open(fileList[index]);
-      if(!handler.valid())
-      {
-         cerr << "Error: Unable to load image " << fileList[index] << endl;
-         result = false;
-         break;
-      }
-
-      input_geom = handler->getImageGeometry();
-
-      if (index == 0)
-      {
-         m_prodGeometry = (ossimImageGeometry*) input_geom->dup();
-         ossimGpt origin;
-         m_prodGeometry->getTiePoint(origin, false);
-         ossimDpt gsd (m_prodGeometry->getMetersPerPixel());
-
-         if (m_prodGeometry->isAffectedByElevation())
-         {
-            // Need to ortho to UTM, so define output geometry shared by all input chains:
-            ossimMapProjection* prod_proj = new ossimUtmProjection;
-            prod_proj->setOrigin(origin);
-            prod_proj->setMetersPerPixel(m_prodGeometry->getMetersPerPixel());
-            m_prodGeometry->setProjection(prod_proj);
-         }
-      }
-
-      // Set up the IVT for this input's renderer:
-      ossimRefPtr<ossimImageViewProjectionTransform> transform = new ossimImageViewProjectionTransform;
-      transform->setImageGeometry(input_geom.get());
-      transform->setViewGeometry(m_prodGeometry.get());
-
-      ossimRefPtr<ossimImageRenderer> renderer = new ossimImageRenderer;
-      renderer->connectMyInputTo(0, handler.get());
-      renderer->setImageViewTransform(transform.get());
-      renderer->initialize();
-
-      m_inputSources.push_back(renderer.get());
-   }
-
-   return result;
-}
-
diff --git a/ossim/src/ossim/util/ossimFileWalker.cpp b/ossim/src/ossim/util/ossimFileWalker.cpp
deleted file mode 100644
index 50f1fcf..0000000
--- a/ossim/src/ossim/util/ossimFileWalker.cpp
+++ /dev/null
@@ -1,535 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossimFileWalker.h
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:
-//
-// Utility class to walk through directories and get a list of files to
-// process.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/util/ossimFileWalker.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimFileProcessorInterface.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/parallel/ossimJobQueue.h>
-#include <OpenThreads/Thread>
-
-static ossimTrace traceDebug(ossimString("ossimFileWalker:debug"));
-
-ossimFileWalker::ossimFileWalker()
-   : m_fileProcessor(0),
-     m_jobQueue(new ossimJobMultiThreadQueue(new ossimJobQueue(), 1)),     
-     m_filteredExtensions(0),
-     m_recurseFlag(true),
-     m_waitOnDirFlag(false),
-     m_abortFlag(false),
-     m_mutex()
-{
-}
-
-ossimFileWalker::~ossimFileWalker()
-{
-   m_jobQueue = 0; // Not a leak, ref pointer.
-}
-
-void ossimFileWalker::walk(const std::vector<ossimFilename>& files)
-{
-   static const char M[] = "ossimFileWalker::walk";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered\n";
-   }
-
-   if ( files.size() )
-   {
-      std::vector<ossimFilename>::const_iterator i = files.begin();
-      while ( i != files.end() )
-      {
-         // Must have call back set at this point.
-         if ( !m_abortFlag && m_fileProcessor )
-         {
-            ossimFilename file = (*i).expand();
-            if ( file.size() && file.exists() )
-            {
-               if ( file.isDir() ) // Directory:
-               {
-                  walkDir(file);
-               }  
-               else // File:
-               {
-                  if ( isFiltered(file) == false )
-                  {
-                     if(traceDebug())
-                     {
-                        ossimNotify(ossimNotifyLevel_DEBUG)
-                           << "Making the job for: " << (*i) << std::endl;
-                     }
-                     
-                     // Make the job:
-                     ossimRefPtr<ossimFileWalkerJob> job =
-                        new ossimFileWalkerJob( m_fileProcessor, file );
-                     
-                     job->setName( ossimString( file.string() ) );
-                     
-                     job->setCallback( new ossimFileWalkerJobCallback() );
-                     
-                     // Set the state to ready:
-                     job->ready();
-                     
-                     // Add job to the queue:
-                     m_jobQueue->getJobQueue()->add( job.get() );
-                     
-                     m_mutex.lock();
-                     if ( m_abortFlag )
-                     {
-                        // Clear out the queue.
-                        m_jobQueue->getJobQueue()->clear();
-                        
-                        break; // Callee set our abort flag so break out of loop.
-                     }
-                     m_mutex.unlock();
-                  }
-               }
-            }
-            else
-            {
-               ossimNotify(ossimNotifyLevel_WARN)
-                  << M << " WARNING: file: \""<< file << "\" does not exist" << std::endl;
-            }
-         }
-
-         ++i;
-      
-      } // while ( i != files.end() )
-
-      // FOREVER loop until all jobs are completed.
-      while (1)
-      {
-         if ( OpenThreads::Thread::microSleep(250) == 0 )
-         {
-            if ( m_jobQueue->hasJobsToProcess() == false )
-            {
-               break;
-            }
-         }
-      }
-
-   } // if ( files.size() )
-
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exiting...\n";
-   }  
-}
-
-void ossimFileWalker::walk(const ossimFilename& root)
-{
-   static const char M[] = "ossimFileWalker::walk";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered root=" << root << "\n";
-   }
-
-   // Must have call back set at this point.
-   if ( !m_abortFlag && m_fileProcessor )
-   {
-      ossimFilename rootFile = root.expand();
-      if ( rootFile.size() && rootFile.exists() )
-      {
-         if ( rootFile.isDir() )
-         {
-            walkDir(rootFile);
-
-            // FOREVER loop until all jobs are completed.
-            while (1)
-            {
-               if ( OpenThreads::Thread::microSleep(250) == 0 )
-               {
-                  if ( m_jobQueue->hasJobsToProcess() == false )
-                  {
-                     break;
-                  }
-               }
-            }
-         }
-         else
-         {
-            // Single file no job queue needed.
-            if ( isFiltered( rootFile ) == false )
-            {
-               m_fileProcessor->processFile( rootFile );
-            }
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << M << " WARNING: file: \""<< rootFile << "\" does not exist" << std::endl;
-      }
-   }
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exiting...\n";
-   }  
-}
-
-void ossimFileWalker::walkDir(const ossimFilename& dir)
-{
-   static const char M[] = "ossimFileWalker::walkDir";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "processing dir: " << dir << "\n";
-   }
-
-   // List of directories in this directory...
-   std::vector<ossimFilename> dirs;
-   
-   // List of files in this directory...
-   std::vector<ossimFilename> files;
-
-   m_mutex.lock();
-   ossimDirectory d;
-   bool ossimDirectoryStatus = d.open(dir);
-   m_mutex.unlock();
-
-   if ( ossimDirectoryStatus )
-   {
-      // Loop to get the list of files and directories in this directory.
-      m_mutex.lock();
-      ossimFilename f;
-      bool valid_file = d.getFirst(f);
-      while ( valid_file )
-      {
-         if ( isFiltered(f) == false )
-         {
-            if (f.isDir())
-            {
-               dirs.push_back(f);
-            }
-            else
-            {
-               files.push_back(f);
-            }
-         }
-         valid_file = d.getNext(f);
-      }
-      m_mutex.unlock();
-
-      //---
-      // Process files first before recursing directories.  If a file is a directory base image,
-      // e.g. RPF, then the callee should call ossimFileWalker::setRecurseFlag to false to
-      // stop us from going into sub directories.
-      //---
-      std::vector<ossimFilename>::const_iterator i = files.begin();
-      while (i != files.end())
-      {
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "Making the job for: " << (*i) << std::endl;
-         }
-         
-         // Make the job:
-         ossimRefPtr<ossimFileWalkerJob> job =
-            new ossimFileWalkerJob( m_fileProcessor, (*i) );
-
-         job->setName( ossimString( (*i).string() ) );
-
-         job->setCallback( new ossimFileWalkerJobCallback() );
-
-         // Set the state to ready:
-         job->ready();
-
-         // Add job to the queue:
-         m_jobQueue->getJobQueue()->add( job.get() );
-
-         m_mutex.lock();
-         if ( m_abortFlag )
-         {
-            // Clear out the queue.
-            m_jobQueue->getJobQueue()->clear();
-            
-            break; // Callee set our abort flag so break out of loop.
-         }
-         m_mutex.unlock();
-
-         ++i;
-      }
-
-      if ( m_waitOnDirFlag )
-      {
-         // FOREVER loop until all jobs are completed.
-         while (1)
-         {
-            if ( OpenThreads::Thread::microSleep(250) == 0 )
-            {
-               if ( m_jobQueue->hasJobsToProcess() == false )
-               {
-                  break;
-               }
-            }
-         }
-      }
-
-      m_mutex.lock();
-      if ( !m_abortFlag && m_recurseFlag )
-      {
-         // Process sub directories...
-         i = dirs.begin();
-         while (i != dirs.end())
-         {
-            m_mutex.unlock();
-            walkDir( (*i) );
-            m_mutex.lock();
-
-            if ( m_abortFlag )
-            {
-               break; // Callee set our abort flag so break out of loop.
-            }
-            ++i;
-         }
-      }
-      m_mutex.unlock();
-      
-   } // if ( ossimDirectoryOpenStatus )
-
-   // Reset the m_recurseFlag.
-   m_mutex.lock();
-   m_recurseFlag = true;
-   m_mutex.unlock();
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-}
-
-bool ossimFileWalker::isFiltered(const ossimFilename& file) const
-{
-   bool result = false;
-   if ( file.size() )
-   {
-      if ( isDotFile(file) )
-      {
-         result = true;
-      }
-      else if ( file[file.size()-1] == '~' )
-      {
-         result = true;
-      }
-      else 
-      {
-         std::string ext = file.ext().downcase().c_str();
-         if ( ext.size() )
-         {
-            std::vector<std::string>::const_iterator i = m_filteredExtensions.begin();
-            while ( i != m_filteredExtensions.end() )
-            {
-               if ( ext == (*i) )
-               {
-                  result = true;
-                  break;
-               }
-               ++i;
-            }
-         }
-      }
-   }
-#if 0 /* Please leave for debug. (drb) */
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimFileWalker::isFiltered file " << (result?"filtered: ":"not filtered: ")
-         << file << "\n";
-   }
-#endif
-   
-   return result;
-}
-
-bool ossimFileWalker::isDotFile(const ossimFilename& f) const
-{
-   bool result = false;
-   
-   // Get the size in bytes.
-   if ( f.size() )
-   {
-      std::string::size_type firstDotPos = f.find('.');
-      if ( firstDotPos == 0 )
-      {
-         result = true;
-      }
-      else if ( firstDotPos != std::string::npos ) // Dot in file.
-      {
-         // Get the position of first dot from the end.
-         std::string::size_type lastDotPos = f.find_last_of('.');
-         if ( lastDotPos != std::string::npos )
-         {
-            // Make copy.
-            ossimFilename f2 = f;
-            
-            // Convert an '\'s to '/'s. 
-            f2.convertBackToForwardSlashes();
-            
-            // Find the first slash from end.
-            std::string::size_type lastSlashPos = f2.find_last_of('/');
-            
-            if (lastSlashPos != std::string::npos) // Found a slash.
-            {
-               if ( (lastSlashPos+1) == lastDotPos )
-               {
-                  // dot in front of slash like /home/foo/.xemacs
-                  result = true;
-               }
-            }
-         }
-      }
-   }
-
-   return result;
-}
-
-const std::vector<std::string>& ossimFileWalker::getFilteredExtensions() const
-{
-   return m_filteredExtensions;
-}
-
-std::vector<std::string>& ossimFileWalker::getFilteredExtensions()
-{
-   return m_filteredExtensions;
-}
-
-void ossimFileWalker::dumpFilteredExtensionList() const
-{
-   ossimNotify(ossimNotifyLevel_NOTICE) << "Filtered extension list:\n";
-   std::vector<std::string>::const_iterator i = m_filteredExtensions.begin();
-   while ( i != m_filteredExtensions.end() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << (*i) << "\n";
-      ++i;
-   }
-   ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
-}
-
-void ossimFileWalker::initializeDefaultFilterList()
-{
-   m_mutex.lock();
-   
-   // Common extensions to filter out, most common first.
-   m_filteredExtensions.push_back(std::string("ovr"));
-   m_filteredExtensions.push_back(std::string("omd"));
-   m_filteredExtensions.push_back(std::string("his"));
-   m_filteredExtensions.push_back(std::string("geom"));
-   
-   // The rest alphabetical.
-   m_filteredExtensions.push_back(std::string("aux"));
-   m_filteredExtensions.push_back(std::string("bin"));
-   m_filteredExtensions.push_back(std::string("dbf"));
-   m_filteredExtensions.push_back(std::string("h5"));
-   m_filteredExtensions.push_back(std::string("hdr"));
-   m_filteredExtensions.push_back(std::string("jgw"));
-   m_filteredExtensions.push_back(std::string("jpw"));   
-   m_filteredExtensions.push_back(std::string("kwl"));
-   m_filteredExtensions.push_back(std::string("log"));
-   m_filteredExtensions.push_back(std::string("man"));
-   m_filteredExtensions.push_back(std::string("ocg"));
-   m_filteredExtensions.push_back(std::string("out"));
-   m_filteredExtensions.push_back(std::string("prj"));
-   m_filteredExtensions.push_back(std::string("save"));
-   m_filteredExtensions.push_back(std::string("sdw"));
-   m_filteredExtensions.push_back(std::string("sh"));
-   m_filteredExtensions.push_back(std::string("shp"));
-   m_filteredExtensions.push_back(std::string("shx"));
-   m_filteredExtensions.push_back(std::string("spec"));
-   m_filteredExtensions.push_back(std::string("statistics"));
-   m_filteredExtensions.push_back(std::string("tar"));
-   m_filteredExtensions.push_back(std::string("til"));   
-   m_filteredExtensions.push_back(std::string("tfw"));
-   m_filteredExtensions.push_back(std::string("tgz"));
-   m_filteredExtensions.push_back(std::string("tmp"));
-   m_filteredExtensions.push_back(std::string("txt"));
-
-   m_mutex.unlock();
-}
-
-void ossimFileWalker::setRecurseFlag(bool flag)
-{
-   m_mutex.lock();
-   m_recurseFlag = flag;
-   m_mutex.unlock();
-}
-
-void ossimFileWalker::setWaitOnDirFlag(bool flag)
-{
-   m_mutex.lock();
-   m_waitOnDirFlag = flag;
-   m_mutex.unlock();
-}
-
-void ossimFileWalker::setAbortFlag(bool flag)
-{
-   m_mutex.lock();
-   m_abortFlag = flag;
-   m_mutex.unlock();
-}
-
-void ossimFileWalker::setNumberOfThreads(ossim_uint32 nThreads)
-{
-   m_mutex.lock();
-   m_jobQueue->setNumberOfThreads(nThreads);
-   m_mutex.unlock();
-}
-
-void ossimFileWalker::setFileProcessor(ossimFileProcessorInterface* fpi)
-{
-   m_mutex.lock();
-   m_fileProcessor = fpi;
-   m_mutex.unlock();
-}
-
-ossimFileWalker::ossimFileWalkerJob::ossimFileWalkerJob(
-   ossimFileProcessorInterface* fpi,
-   const ossimFilename& file)
-   : m_fileProcessor( fpi ),
-     m_file( file )
-{
-}
-
-void ossimFileWalker::ossimFileWalkerJob::start()
-{
-   if ( m_fileProcessor && m_file.size() )
-   {
-      m_fileProcessor->processFile( m_file );
-   }
-}
-
-ossimFileWalker::ossimFileWalkerJobCallback::ossimFileWalkerJobCallback()
-   : ossimJobCallback()
-{
-}
-
-void ossimFileWalker::ossimFileWalkerJobCallback::started(ossimJob* job)
-{
-   ossimJobCallback::started(job);
-}
-
-void ossimFileWalker::ossimFileWalkerJobCallback::finished(ossimJob* job)
-{
-   ossimJobCallback::finished(job);
-}
-
-void ossimFileWalker::ossimFileWalkerJobCallback::canceled(ossimJob* job)
-{
-   ossimJobCallback::canceled(job);
-}
-
diff --git a/ossim/src/ossim/util/ossimHLZUtil.cpp b/ossim/src/ossim/util/ossimHLZUtil.cpp
deleted file mode 100644
index 0822e8e..0000000
--- a/ossim/src/ossim/util/ossimHLZUtil.cpp
+++ /dev/null
@@ -1,1108 +0,0 @@
-//*******************************************************************
-// License:  See top level LICENSE.txt file.
-// Author:  Oscar Kramer
-//*******************************************************************
-//  $Id: ossimHLZUtil.cpp 23465 2015-08-13 13:36:26Z okramer $
-
-#include <ossim/util/ossimHLZUtil.h>
-
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/elevation/ossimImageElevationDatabase.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimSlopeFilter.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimMemoryImageSource.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/point_cloud/ossimPointCloudHandlerRegistry.h>
-#include <fstream>
-
-const char* MASK_PREFIX = "mask";
-const char* MASK_EXCLUDE_KW = "exclude";
-
-ossimHLZUtil::ossimHLZUtil()
-: m_slopeThreshold(7.0),
-  m_roughnessThreshold(0.5),
-  m_hlzMinRadius(25.0),
-  m_aoiRadius(0),
-  m_outBuffer(NULL),
-  m_gsd(0),
-  m_reticleSize(10),
-  m_outputSummary(false),
-  m_jobCount(0),
-  m_badLzValue(0),
-  m_marginalLzValue(1),
-  m_goodLzValue(2),
-  m_reticleValue(3),
-  m_useLsFitMethod(false),
-  m_numThreads(1),
-  d_accumT(0)
-{
-   m_destinationGpt.makeNan();
-}
-
-ossimHLZUtil::~ossimHLZUtil()
-{
-}
-
-void ossimHLZUtil::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-
-   // Add options.
-   addArguments(ap);
-
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-
-   ossimNotify(ossimNotifyLevel_INFO)
-   << "\nFinds acceptable helicopter landing zones given terrain data and LZ criteria. The "
-   << "output is an 8-bit, single band, raster image. Options exist for customizing the output"
-   << " pixel values including an option to generate a color raster with the use of a look-up"
-   << " table.\n\n"
-   << "Examples:\n\n"
-   << "    "<<ap.getApplicationName()<<" [options] --roi 5000 --rlz 25 --target 25.5000 -80.000 output-hlz.tif\n"
-   << "    "<<ap.getApplicationName()<<" [options] --dem mydata.hgt --rlz 25 output-hlz.tif \n\n"
-   << std::endl;
-}
-
-void ossimHLZUtil::addArguments(ossimArgumentParser& ap)
-{
-   // Set the general usage:
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options] <output-image>";
-   au->setCommandLineUsage(usageString);
-
-   // Set the command line options:
-   au->addCommandLineOption(
-         "--gsd <meters>",
-         "Specifies output GSD in meters. Defaults to the same resolution as best input DEM. "
-         "Alternatively, if a DEM file is specified, the product GSD defaults to the input DEM's GSD.");
-   au->addCommandLineOption(
-         "--dem <filename>",
-         "Specifies the input DEM filename to use for level-1 processing. If none provided, the "
-         "elevation database is referenced as specified in prefs file for the ROI specified.");
-   au->addCommandLineOption(
-         "--ls-fit",
-         "Slope is computed via an LS fit to a plane instead of the default slope computation using "
-         "differences to compute normal vector.");
-   au->addCommandLineOption(
-         "--lut <filename>",
-         "Specifies the optional lookup table filename for mapping the single-band output image to "
-         "an RGB. The LUT provided must be in the ossimIndexToRgbLutFilter format and must handle "
-         "the discrete output values (see --values option).");
-   au->addCommandLineOption(
-         "--mask <filename>",
-         "Either a Keyword-list file or raster image. The KWL file can contain multiple mask files "
-         "and how to interpret them, i.e., whether non-null pixels define exclusion zones (cannot "
-         "land inside) or inclusion (must land inside). A single mask raster image is assumed to "
-         "represent exclusion zones.");
-   au->addCommandLineOption(
-         "--output-slope <filename.tif>",
-         "Generates a slope byproduct image (floating point degrees) to the specified filename. "
-         "Only valid if normal-vector method used (i.e., --ls-fit option NOT specified)");
-   au->addCommandLineOption(
-         "--pc | --point-cloud <filename>",
-         "Specifies ancillary point-cloud data file for level-2 search for obstructions.");
-   au->addCommandLineOption(
-         "--request-api",
-         "Causes applications API to be output as JSON to stdout. Accepts optional filename to "
-         "store JSON output.");
-   au->addCommandLineOption(
-         "--reticle <int>",
-         "Specifies the size of the reticle at the destination point location in pixels from the "
-         "center (i.e., the radius of the reticle). Defaults to 10. A value of 0 hides the reticle. "
-         "See --values option for setting reticle color.");
-   au->addCommandLineOption(
-         "--rlz <meters>",
-         "Specifies minimum radius of landing zone. Defaults to 25 m. ");
-   au->addCommandLineOption(
-         "--roi <meters>",
-         "radius of interest surrounding the destination point. If absent, the product defaults to "
-         "1024 x 1024 pixels, with a radius of 512 * GSD. Alternatively, if a DEM file is "
-         "specified, the product ROI defaults to the full DEM coverage.");
-   au->addCommandLineOption(
-         "--roughness <meters>",
-         "Specifies the terrain roughness threshold (meters). This is the maximum deviation from a "
-         "flat plane permitted. Defaults to 0.5 m. Valid only with --ls-fit specified.");
-   au->addCommandLineOption("--simulation", "For engineering/debug purposes ");
-   au->addCommandLineOption(
-         "--size <int>",
-         "Instead of a radius of interest, directly specifies the dimensions of the "
-         " output product in pixels (output is square). Required unless --roi is specified and/or "
-         "an inout DEM is specified.");
-   au->addCommandLineOption(
-         "--slope <degrees>",
-         "Threshold for acceptable landing zone terrain slope. Defaults to 7 deg.");
-   au->addCommandLineOption(
-         "--summary",
-         "Causes a product summary to be output to the console.");
-   au->addCommandLineOption(
-         "--target <lat> <lon>",
-         "The center target destination around which suitable HLZs are identified. This can be "
-         "omitted if an input DEM file is provided, in which case the center of the DEM is the target.");
-   au->addCommandLineOption(
-         "--threads <n>",
-         "Number of threads. Defaults to use single core. For engineering/debug purposes.");
-   au->addCommandLineOption(
-         "--values <bad marg good ret>",
-         "Specifies the pixel values (0-255) for the output product corresponding to bad, marginal, "
-         "and good landing zones, respectively, with the fourth value representing the reticle "
-         "value. Defaults to bad=0 (null), marg=1, , good=2, and reticle is highlighted with 3.");
-}
-
-bool ossimHLZUtil::parseCommand(ossimArgumentParser& ap)
-{
-   if ((ap.argc() == 1) || ap.read("-h") || ap.read("--help"))
-   {
-      usage(ap);
-      return false;
-   }
-
-   std::string ts1;
-   ossimArgumentParser::ossimParameter sp1(ts1);
-   std::string ts2;
-   ossimArgumentParser::ossimParameter sp2(ts2);
-   std::string ts3;
-   ossimArgumentParser::ossimParameter sp3(ts3);
-   std::string ts4;
-   ossimArgumentParser::ossimParameter sp4(ts4);
-
-   if (ap.read("--gsd", sp1))
-      m_gsd = ossimString(ts1).toDouble();
-
-   if (ap.read("--dem", sp1))
-      m_demFile = ts1;
-
-   if (ap.read("--ls-fit"))
-      m_useLsFitMethod = true;
-
-   if (ap.read("--lut", sp1))
-      m_lutFile = ts1;
-
-   if (ap.read("--mask", sp1))
-      m_maskFile = ts1;
-
-   if ( ap.read("--output-slope", sp1))
-   {
-      m_slopeFile = ts1;
-   }
-   if (ap.read("--pc", sp1) || ap.read("--point-cloud", sp1))
-      m_pcFile = ts1;
-
-   if ( ap.read("--request-api", sp1))
-   {
-      ofstream ofs ( ts1.c_str() );
-      printApiJson(ofs);
-      ofs.close();
-      return false;
-   }
-   if ( ap.read("--request-api"))
-   {
-      printApiJson(cout);
-      return false;
-   }
-   if (ap.read("--reticle", sp1))
-      m_reticleSize = ossimString(ts1).toInt32();
-
-   if (ap.read("--rlz", sp1))
-      m_hlzMinRadius = ossimString(ts1).toDouble();
-
-   if (ap.read("--roi", sp1))
-      m_aoiRadius = ossimString(ts1).toDouble();
-
-   if (ap.read("--roughness", sp1))
-      m_roughnessThreshold = ossimString(ts1).toDouble();
-
-   if (ap.read("--summary"))
-      m_outputSummary = true;
-
-   if (ap.read("--size", sp1))
-   {
-      m_viewRect.set_lrx(ossimString(ts1).toUInt32());
-      m_viewRect.set_lry(m_viewRect.lr().x);
-   }
-
-   if (ap.read("--slope", sp1))
-      m_slopeThreshold = ossimString(ts1).toDouble();
-
-   if (ap.read("--target", sp1, sp2))
-   {
-      m_destinationGpt.lat = ossimString(ts1).toDouble();
-      m_destinationGpt.lon = ossimString(ts2).toDouble();
-   }
-
-   if (ap.read("--threads", sp1))
-   {
-      m_numThreads = ossimString(ts1).toUInt32();
-   }
-
-   if (ap.read("--values", sp1, sp2, sp3, sp4))
-   {
-      m_badLzValue = ossimString(ts1).toUInt8();
-      m_marginalLzValue = ossimString(ts2).toUInt8();
-      m_goodLzValue = ossimString(ts3).toUInt8();
-      m_reticleValue = ossimString(ts4).toUInt8();
-   }
-
-   // There should only be the required command line args left:
-   if (ap.argc() != 2)
-   {
-      usage(ap);
-      return false;
-   }
-
-   // Parse the required command line params:
-   m_productFile = ap[1];
-
-   // Verify minimum required args were specified:
-   if (m_demFile.empty() && m_destinationGpt.isLonLatNan())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimHLZUtil::initialize ERR: Command line is underspecified." << std::endl;
-      usage(ap);
-      return false;
-   }
-   return initialize();
-}
-
-bool ossimHLZUtil::initialize()
-{
-   m_productGeom = new ossimImageGeometry;
-
-   // If DEM provided as file on command line, reset the elev manager to use only this:
-   if (!m_demFile.empty() && !loadDemFile())
-      return false;
-
-   // Determine if default GSD needs to be computed.
-   if (m_gsd == 0)
-   {
-      // Query for target H so as to autoload cell(s):
-      ossimElevManager::instance()->getHeightAboveEllipsoid(m_destinationGpt);
-      m_gsd = ossimElevManager::instance()->getMeanSpacingMeters();
-      if (ossim::isnan(m_gsd))
-         m_gsd = 0;
-   }
-
-   // Make sure that AOI and GSD are initialized:
-   if ((m_aoiRadius == 0) && (m_gsd != 0))
-   {
-      // The radius of interest can default given a GSD to achieve a specific output image size.
-      if (m_viewRect.area() <= 1)
-            m_viewRect = ossimIrect(0, 0, 1023, 1023);
-      m_aoiRadius = (m_viewRect.size().x + m_viewRect.size().y - 2) * m_gsd / 4.0;
-   }
-   else if ((m_gsd == 0) && (m_aoiRadius != 0))
-   {
-      // Likewise, the GSD can default given an AOI and image size:
-      if (m_viewRect.area() <= 1)
-            m_viewRect = ossimIrect(0,0,1023,1023);
-      m_gsd = 4.0 * m_aoiRadius / (m_viewRect.size().x + m_viewRect.size().y - 2);
-   }
-   if ((m_gsd == 0) || (m_aoiRadius == 0))
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << "ossimHLZUtil::initialize() ERROR: GSD and/or AOI "
-            "radius have not been set." << std::endl;
-      return false;
-   }
-
-   // If needed, compute the bounding rect in pixel space given the visibility range and the GSD:
-   if (m_viewRect.area() <= 1)
-   {
-      m_viewRect.set_lrx(2.0 * ossim::round<ossim_int32, double>(m_aoiRadius / m_gsd) - 1);
-      m_viewRect.set_lry(m_viewRect.lr().x);
-   }
-
-   // Establish the output image geometry's map projection if not already done:
-   ossimRefPtr<ossimMapProjection> mapProj = m_productGeom->getAsMapProjection();
-   if (!mapProj.valid())
-   {
-      mapProj = new ossimEquDistCylProjection();
-      m_productGeom->setProjection(mapProj.get());
-   }
-
-   mapProj->setOrigin(m_destinationGpt);
-   mapProj->setMetersPerPixel(ossimDpt(m_gsd, m_gsd));
-   ossimDpt degPerPixel(mapProj->getDecimalDegreesPerPixel());
-   mapProj->setElevationLookupFlag(false);
-   ossimGpt ulTiePt(m_destinationGpt);
-   ossimIpt image_size(m_viewRect.width(), m_viewRect.height());
-   ossimDpt offset (-image_size.x / 2.0, -image_size.y / 2.0);
-   ulTiePt.lat -= degPerPixel.lat * offset.y;
-   ulTiePt.lon += degPerPixel.lon * offset.x;
-   mapProj->setUlTiePoints(ulTiePt);
-
-   // Need a transform so that we can use the observer point as the output image origin (0,0):
-   m_productGeom->setImageSize(image_size);
-
-   // Establish the ground rect:
-   ossimGpt ul, ur, lr, ll;
-   m_productGeom->getBoundingGroundRect(m_gndRect);
-
-   // If PC provided as file on command line, Load it. This uses the output ground rect so needs to
-   // be after the initialization of m_geometry:
-   if (!m_pcFile.empty() && !loadPcFile())
-      return false;
-
-   // If threat-domes spec (or any mask) provided as file on command line, Load it:
-   if (!m_maskFile.empty() && !loadMaskFiles())
-      return false;
-
-   // Allocate the output image buffer:
-   m_outBuffer = ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, m_viewRect.width(),
-                                                           m_viewRect.height());
-   if (!m_outBuffer.valid())
-      return false;
-
-   // Initialize the image with all points hidden:
-   m_outBuffer->initialize();
-   m_outBuffer->setImageRectangle(m_viewRect);
-   m_outBuffer->fill(m_badLzValue);
-
-   // Establish connection to DEM posts directly as raster "images" versus using the OSSIM elev
-   // manager that performs interpolation of DEM posts for arbitrary locations. These elev images
-   // feed into a combiner in order to have a common tap for elev pixels:
-   if (!initProcessingChain())
-      return false;
-
-   if (!initHlzFilter())
-      return false;
-
-   if (m_outputSummary)
-      dumpProductSummary();
-
-   return true;
-}
-
-void ossimHLZUtil::setProductGSD(const double& meters_per_pixel)
-{
-   m_gsd = meters_per_pixel;
-
-   if (m_productGeom.valid())
-   {
-      ossimMapProjection* map_proj =
-            dynamic_cast<ossimMapProjection*>(m_productGeom->getProjection());
-      if (map_proj)
-         map_proj->setMetersPerPixel(ossimDpt(m_gsd, m_gsd));
-   }
-}
-
-bool ossimHLZUtil::loadDemFile()
-{
-   ossimElevManager* elevMgr = ossimElevManager::instance();
-   elevMgr->clear();
-
-   ossimRefPtr<ossimImageElevationDatabase> ied = new ossimImageElevationDatabase;
-   if (!ied->open(m_demFile))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimHLZUtil::initialize ERR: Cannot open DEM file at <" << m_demFile << ">\n"
-               << std::endl;
-      return false;
-   }
-   elevMgr->addDatabase(ied.get());
-
-   // When a dem file is provided, certain parameters can be implied versus explicitely provided
-   // in the command-line arguments:
-   ossimRefPtr<ossimImageHandler> dem_handler =
-         ossimImageHandlerRegistry::instance()->open(m_demFile, true, false);
-   if (!dem_handler.valid())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimHLZUtil::initialize ERR: Cannot open DEM file <" << m_demFile << "> "
-               "as image handler.\n" << std::endl;
-      return false;
-   }
-
-   // Create the processing chain used for this elevation single image source:
-   createInputChain(dem_handler, m_combinedElevSource);
-   ossimRefPtr<ossimImageGeometry> dem_geom = dem_handler->getImageGeometry();
-   if (dem_geom == 0)
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-               << "ossimHLZUtil::loadDemFile() ERR: DEM file <" << m_demFile << "> "
-               "does not have valid geometry.\n" << std::endl;
-      return false;
-   }
-
-   // Match the DEM's projection:
-   //m_productGeom = new ossimImageGeometry(*dem_geom);
-   dem_geom->getBoundingGroundRect(m_gndRect);
-   if (m_destinationGpt.isLatLonNan())
-   {
-      m_destinationGpt = m_gndRect.midPoint();
-   }
-   if (m_gsd == 0)
-   {
-      ossimDpt gsdPt (dem_geom->getMetersPerPixel());
-      m_gsd = 0.5 * (gsdPt.x + gsdPt.y);
-   }
-   if (m_aoiRadius == 0)
-   {
-      ossimDpt mtrsPerDeg (m_destinationGpt.metersPerDegree());
-      m_aoiRadius = 0.25 * (m_gndRect.width()*mtrsPerDeg.x + m_gndRect.height()*mtrsPerDeg.y);
-   }
-
-   return true;
-}
-
-void ossimHLZUtil::createInputChain(ossimRefPtr<ossimImageHandler>& handler,
-                                    ossimRefPtr<ossimImageSource>& chain)
-{
-   ossimRefPtr<ossimImageViewProjectionTransform> ivt = new ossimImageViewProjectionTransform;
-   ivt->setImageGeometry(handler->getImageGeometry().get());
-   ivt->setViewGeometry(m_productGeom.get());
-
-   chain = new ossimImageRenderer(handler.get(),ivt.get());
-   chain->initialize();
-}
-
-
-bool ossimHLZUtil::initProcessingChain()
-{
-   // If a DEM file was not provided as an argument, the elev sources array needs be initialized:
-   if (!m_combinedElevSource.valid())
-   {
-      // HLZ requires access to individual elevation posts for computing statistics. We use the
-      // elevation manager to identify cells that provide coverage over the AOI, then we open those
-      // cells as images with associated geometries.
-      ossimElevManager* elevMgr = ossimElevManager::instance();
-
-      // Query elevation manager for cells providing needed coverage:
-      std::vector<std::string> cells;
-      elevMgr->getCellsForBounds(m_gndRect, cells);
-
-      // Open a raster image for each elevation source being considered:
-      ossimConnectableObject::ConnectableObjectList elevChains;
-      std::vector<std::string>::iterator fname_iter = cells.begin();
-      while (fname_iter != cells.end())
-      {
-         ossimRefPtr<ossimImageHandler> dem =
-               ossimImageHandlerRegistry::instance()->open(*fname_iter);
-         if (!dem.valid())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-                    << "ossimHLZUtil::initElevSources() ERR: Cannot open DEM file at <"
-                    <<*fname_iter<<">\n"<< std::endl;
-            return false;
-         }
-
-         ossimRefPtr<ossimImageSource> chain;
-         createInputChain(dem, chain);
-         ossimRefPtr<ossimConnectableObject> connectable = chain.get();
-         elevChains.push_back(connectable);
-         ++fname_iter;
-      }
-
-      if (elevChains.size() == 1)
-         m_combinedElevSource = (ossimImageSource*) elevChains[0].get();
-      else
-         m_combinedElevSource = new ossimImageMosaic(elevChains);
-   }
-
-   if (!m_useLsFitMethod)
-   {
-      // Add the slope computation engine on the elevation source.
-      // Set up processing chain with plane to normal filter, equation combiner, and band selector.
-      ossimRefPtr<ossimSlopeFilter> slope_filter = new ossimSlopeFilter;
-      slope_filter->connectMyInputTo(m_combinedElevSource.get());
-      slope_filter->setSlopeType(ossimSlopeFilter::DEGREES);
-      m_combinedElevSource = slope_filter.get();
-      m_combinedElevSource->initialize();
-
-      if (!m_slopeFile.empty())
-         writeSlopeImage();
-   }
-
-   return true;
-}
-
-bool ossimHLZUtil::loadPcFile()
-{
-   // When a PC file is provided, certain parameters can be implied versus explicitely provided
-   // in the command-line arguments:
-   ossimRefPtr<ossimPointCloudHandler> pc_handler =
-         ossimPointCloudHandlerRegistry::instance()->open(m_pcFile);
-   if (!pc_handler.valid())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHLZUtil::loadPointCloudFile ERR: Cannot open point-cloud file <" << m_pcFile << "> "
-            << std::endl;
-      return false;
-   }
-
-   // Verify that PC bounding rect overlaps the output bounding rect:
-   ossimGrect pc_bbox;
-   pc_handler->getBounds(pc_bbox);
-   if (!m_gndRect.intersects(pc_bbox))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-            << "ossimHLZUtil::loadPointCloudFile ERR: point-cloud file <" << m_pcFile << "> "
-            << "does not overlap the output ROI." << std::endl;
-      return false;
-   }
-
-   m_pcSources.push_back(pc_handler);
-   return true;
-}
-
-bool ossimHLZUtil::loadMaskFiles()
-{
-   // First check if the filename specified is an image file:
-   MaskSource mask_image (this, m_maskFile);
-   if (mask_image.valid)
-   {
-      m_maskSources.push_back(mask_image);
-      return true;
-   }
-
-   ossimKeywordlist mask_kwl (m_maskFile);
-   ossim_uint32 index = 0;
-   while (true)
-   {
-      MaskSource mask_source (this, mask_kwl, index);
-      if (mask_source.valid)
-         m_maskSources.push_back(mask_source);
-      else if (index > 0)
-         break;
-      ++index;
-   }
-
-   return true;
-}
-
-bool ossimHLZUtil::initHlzFilter()
-{
-   if ((m_hlzMinRadius == 0) || !m_combinedElevSource.valid())
-      return false;
-
-   // Determine number of posts (in one dimension) needed to cover the specified LZ radius:
-   m_demGsd = m_productGeom->getMetersPerPixel();
-   m_demFilterSize.x = (int) ceil(m_hlzMinRadius/m_demGsd.x);
-   m_demFilterSize.y = (int) ceil(m_hlzMinRadius/m_demGsd.y);
-   if ((m_demFilterSize.x < 2) || (m_demFilterSize.y < 2))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimHLZUtil::initHlzFilter() ERR: The DEM provided does not have sufficient"
-                  " resolution to determine HLZs. Aborting..." << std::endl;
-      return false;
-   }
-
-   // clip the requested output geo rect by the rect available from the dem:
-   ossimGrect demGndRect;
-   m_productGeom->getBoundingGroundRect(demGndRect);
-   if (m_gndRect.hasNans())
-      m_gndRect = demGndRect;
-   else
-      m_gndRect = m_gndRect.clipToRect(demGndRect);
-
-   // Convert (clipped) requested rect to raster coordinate space in the DEM file:
-   ossimDpt ulp, lrp;
-   m_productGeom->worldToLocal(m_gndRect.ul(), ulp);
-   m_productGeom->worldToLocal(m_gndRect.lr(), lrp);
-   m_demRect.set_ul(ulp);
-   m_demRect.set_lr(lrp);
-
-   // To help with multithreading, just load entire AOI of DEM into memory:
-   m_demBuffer = m_combinedElevSource->getTile(m_demRect);
-   if (!m_demBuffer.valid())
-      return false;
-
-   return true;
-}
-
-bool ossimHLZUtil::execute()
-{
-   if (!m_productGeom.valid() && !initialize())
-      return false;
-
-   d_accumT = 0;
-   bool success = false;
-
-   // Establish loop limits in input DEM raster coordinate space:
-   ossim_int32 min_x = m_demRect.ul().x;
-   ossim_int32 min_y = m_demRect.ul().y;
-   ossim_int32 max_x = m_demRect.lr().x - m_demFilterSize.x;
-   ossim_int32 max_y = m_demRect.lr().y - m_demFilterSize.y;
-   ossimIpt chip_origin;
-   ossim_uint32 numChips = (max_x-min_x)*(max_y-min_y);
-
-   // Determine the DEM step size as a fraction of the LZ radius:
-   const double CHIP_STEP_FACTOR = 0.25; // chip position increment as fraction of chip width
-   ossim_int32 dem_step =
-         (ossim_int32) floor(4*CHIP_STEP_FACTOR*m_hlzMinRadius/(m_demGsd.x+m_demGsd.y));
-
-   // Hack: degrading to single thread when slope-image scheme is used. Runs extremely slow in
-   // multithread mode, but much faster as single thread than multithreaded ls-fit
-   if ((m_numThreads == 1) || !m_useLsFitMethod)
-   {
-      // Not threaded (or slope-image scheme):
-      setPercentComplete(0);
-      ossim_uint32 chipId = 0;
-      for (chip_origin.y = min_y; chip_origin.y <= max_y; chip_origin.y += dem_step)
-      {
-         for (chip_origin.x = min_x; chip_origin.x <= max_x; chip_origin.x += dem_step)
-         {
-            ossimHLZUtil::ChipProcessorJob* job = 0;
-            if (m_useLsFitMethod)
-               job = new ossimHLZUtil::LsFitChipProcessorJob(this, chip_origin, chipId++);
-            else
-               job = new ossimHLZUtil::NormChipProcessorJob(this, chip_origin, chipId++);
-            job->start();
-         }
-         setPercentComplete(100*chipId/numChips);
-      }
-   }
-   else
-   {
-      if (m_numThreads == 0)
-         m_numThreads = ossim::getNumberOfThreads();
-
-      // Loop over input DEM, creating a thread job for each filter window:
-      ossimRefPtr<ossimJobQueue> jobQueue = new ossimJobQueue();
-      m_jobMtQueue = new ossimJobMultiThreadQueue(jobQueue.get(), m_numThreads);
-
-      cout << "\nPreparing " << numChips << " jobs..." << endl; // TODO: DEBUG
-      setPercentComplete(0);
-      ossim_int32 qsize = 0;
-      ossimIpt chip_origin;
-      ossim_uint32 chipId = 0;
-      for (chip_origin.y = min_y; chip_origin.y <= max_y; ++chip_origin.y)
-      {
-         for (chip_origin.x = min_x; chip_origin.x <= max_x; ++chip_origin.x)
-         {
-            //cout << "Submitting " << chipId << endl;
-            ossimHLZUtil::ChipProcessorJob* job = 0;
-            if (m_useLsFitMethod)
-               job = new ossimHLZUtil::LsFitChipProcessorJob(this, chip_origin, chipId++);
-            else
-               job = new ossimHLZUtil::NormChipProcessorJob(this, chip_origin, chipId++);
-            jobQueue->add(job, false);
-         }
-         qsize = jobQueue->size();
-         setPercentComplete(100*(chipId-qsize)/numChips);
-      }
-
-      // Wait until all chips have been processed before proceeding:
-      cout << "All jobs queued. Waiting for job threads to finish..." << endl;
-      while (m_jobMtQueue->hasJobsToProcess() || m_jobMtQueue->numberOfBusyThreads())
-      {
-         qsize = m_jobMtQueue->getJobQueue()->size();
-         setPercentComplete(100*(numChips-qsize)/numChips);
-         OpenThreads::Thread::microSleep(10000);
-      }
-   }
-
-   cout << "Finished processing chips." << endl;
-   paintReticle();
-
-   cout << "Writing output file..." << endl;
-   success = writeFile();
-
-   cout << "Returning..." << endl;
-   return success;
-}
-
-void ossimHLZUtil::paintReticle()
-{
-   // Highlight the observer position with X reticle:
-   ossimDpt center;
-   m_viewRect.getCenter(center);
-
-   if (m_reticleSize > 0)
-   {
-      m_outBuffer->setValue((int) center.x, (int) center.y, m_reticleValue);
-      for (int i = -m_reticleSize; i <= m_reticleSize; ++i)
-      {
-         m_outBuffer->setValue(i + (int) center.x,       (int) center.y, m_reticleValue);
-         m_outBuffer->setValue(    (int) center.x  , i + (int) center.y, m_reticleValue);
-      }
-   }
-
-   // Also outline the square area of interest:
-   for (ossim_int32 x = m_viewRect.ul().x; x <= m_viewRect.lr().x; ++x)
-   {
-      m_outBuffer->setValue(x, m_viewRect.ul().y, m_reticleValue);
-      m_outBuffer->setValue(x, m_viewRect.lr().y, m_reticleValue);
-   }
-   for (ossim_int32 y = m_viewRect.ul().y; y <= m_viewRect.lr().y; ++y)
-   {
-      m_outBuffer->setValue(m_viewRect.ul().x, y, m_reticleValue);
-      m_outBuffer->setValue(m_viewRect.lr().x, y, m_reticleValue);
-   }
-}
-
-bool ossimHLZUtil::writeFile()
-{
-   ossimIrect rect(0, 0, m_viewRect.width() - 1, m_viewRect.height() - 1);
-   m_outBuffer->setImageRectangle(rect);
-
-   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
-   memSource->setImage(m_outBuffer);
-   memSource->setImageGeometry(m_productGeom.get());
-   ossimImageSource* last_source = memSource.get();
-
-   // See if an LUT is requested:
-   ossimRefPtr<ossimIndexToRgbLutFilter> lutSource = 0;
-   if (!m_lutFile.empty())
-   {
-      ossimKeywordlist lut_kwl;
-      lut_kwl.addFile(m_lutFile);
-      lutSource = new ossimIndexToRgbLutFilter;
-      if (!lutSource->loadState(lut_kwl))
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimHLZUtil::writeFile() ERROR: The LUT "
-               "file <"
-               << m_lutFile
-               << "> could not be read. Ignoring remap request.\n"
-               << std::endl;
-         lutSource = 0;
-      }
-      else
-      {
-         lutSource->connectMyInputTo(last_source);
-         lutSource->initialize();
-         last_source = lutSource.get();
-      }
-   }
-
-   // Set up the writer:
-   ossimRefPtr<ossimImageFileWriter> writer = 0;
-   if (m_productFile.ext().contains("tif"))
-   {
-      ossimTiffWriter* tif_writer = new ossimTiffWriter();
-      tif_writer->setGeotiffFlag(true);
-      tif_writer->setFilename(m_productFile);
-      writer = tif_writer;
-   }
-   else
-   {
-      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(m_productFile);
-   }
-   bool success = false;
-   if (writer.valid())
-   {
-      writer->connectMyInputTo(0, last_source);
-      success = writer->execute();
-   }
-
-   return success;
-}
-
-void ossimHLZUtil::writeSlopeImage()
-{
-   // Set up the writer:
-   ossimRefPtr<ossimImageFileWriter> writer = 0;
-   ossimTiffWriter* tif_writer = new ossimTiffWriter();
-   tif_writer->setGeotiffFlag(true);
-   tif_writer->setFilename(m_slopeFile);
-   writer = tif_writer;
-   writer->connectMyInputTo(0, m_combinedElevSource.get());
-   writer->setAreaOfInterest(m_viewRect);
-   if (writer->execute())
-      cout<<"Wrote slope image to <"<<m_slopeFile<<">."<<endl;
-   else
-   {
-      cout<<"ossimHLZUtil::writeSlopeImage() Error encountered writing slope image to <"
-            <<m_slopeFile<<">."<<endl;
-   }
-}
-
-void ossimHLZUtil::dumpProductSummary() const
-{
-   ossimIpt isize(m_productGeom->getImageSize());
-   cout << "\nSummary of HLZ product image:" << "\n   Output file name: " << m_productFile
-         << "\n   Image size: " << isize
-         << "\n   Slope threshold: " << m_slopeThreshold << " deg"
-         << "\n   Roughness threshold: " << m_roughnessThreshold << " m"
-         << "\n   Min LZ radius: " << m_hlzMinRadius << " m"
-         << "\n   product GSD: " << m_gsd << " m"
-         << "\n   radius-of-interest: " << (int) (m_gsd * isize.x / 2.0) << " m"
-         << "\n   Scalar type: " << m_outBuffer->getScalarTypeAsString() << endl;
-}
-
-OpenThreads::ReadWriteMutex ossimHLZUtil::ChipProcessorJob::m_bufMutex;
-
-ossimHLZUtil::ChipProcessorJob::ChipProcessorJob(ossimHLZUtil* hlzUtil, const ossimIpt& origin,
-                                   ossim_uint32 /*chip_id*/)
-: m_hlzUtil (hlzUtil),
-  m_demChipUL (origin),
-  m_status (0),
-  m_nullValue (hlzUtil->m_demBuffer->getNullPix(0))
-{
-   m_demChipLR.x = m_demChipUL.x + m_hlzUtil->m_demFilterSize.x;
-   m_demChipLR.y = m_demChipUL.y + m_hlzUtil->m_demFilterSize.y;
-}
-
-void ossimHLZUtil::ChipProcessorJob::start()
-{
-   if (level1Test() && level2Test() && maskTest())
-   {
-      // Passed all tests (though m_status may indicate obstruction), so mark this chip
-      // appropriately as marginal or good:
-      ossimIpt p;
-
-      for (p.y = m_demChipUL.y; p.y < m_demChipLR.y; ++p.y)
-      {
-         for (p.x = m_demChipUL.x; p.x < m_demChipLR.x; ++p.x)
-         {
-            OpenThreads::ScopedWriteLock lock (m_bufMutex);
-            if (m_status == 2)
-               m_hlzUtil->m_outBuffer->setValue(p.x, p.y, m_hlzUtil->m_goodLzValue);
-            else
-               m_hlzUtil->m_outBuffer->setValue(p.x, p.y, m_hlzUtil->m_marginalLzValue);
-         }
-      }
-   }
-}
-
-bool ossimHLZUtil::ChipProcessorJob::level2Test()
-{
-   // Level 2 only valid if a point cloud dataset is available:
-   if (m_hlzUtil->m_pcSources.empty())
-   {
-      ++m_status; // assumes level2 passes
-      return true;
-   }
-
-   // Need to convert DEM file coordinate bounds to geographic.
-   ossimGpt chipUlGpt, chipLrGpt;
-   m_hlzUtil->m_productGeom->localToWorld(ossimDpt(m_demChipUL), chipUlGpt);
-   m_hlzUtil->m_productGeom->localToWorld(ossimDpt(m_demChipLR), chipLrGpt);
-   chipUlGpt.hgt = ossim::nan();
-   chipLrGpt.hgt = ossim::nan();
-   ossimGrect grect (chipUlGpt, chipLrGpt);
-
-   // TODO: LIMITATION: Only a single point cloud source is considered. Need to expand to handle
-   // a list:
-   const ossimPointCloudHandler* pc_src = m_hlzUtil->m_pcSources[0].get();
-
-   // First check if there is even any coverage:
-   m_status = 0; // reset assumes no coverage
-   ossimGrect bb;
-   pc_src->getBounds(bb);
-   if (!bb.intersects(grect))
-      return false;
-
-   ossimPointBlock pc_block(0, ossimPointRecord::ReturnNumber|ossimPointRecord::NumberOfReturns);
-   pc_src->getBlock(grect, pc_block);
-   if (pc_block.empty())
-      return false;
-
-   bool found_obstruction = false;
-   m_status = 1; // bump to indicate passed level 1
-
-   // Scan the block for obstructions:
-   ossimGpt point_plh;
-   ossimDpt point_xy;
-   ossim_uint32 numPoints = pc_block.size();
-   for (ossim_uint32 i=0; (i<numPoints) && !found_obstruction; ++i)
-   {
-      //If this is not the only return, implies clutter along the ray:
-      int num_returns = (int) pc_block[i]->getField(ossimPointRecord::NumberOfReturns);
-      if (num_returns > 1)
-      {
-         found_obstruction = true;
-         break;
-      }
-   }
-
-   if (!found_obstruction)
-      m_status = 2;
-
-   return true;
-}
-
-
-bool ossimHLZUtil::ChipProcessorJob::maskTest()
-{
-   // Threat dome only valid if a point cloud dataset is available:
-   if (m_hlzUtil->m_maskSources.empty())
-      return true;
-
-   ossimIrect chipRect (m_demChipUL, m_demChipLR);
-   vector<MaskSource>::iterator mask_source = m_hlzUtil->m_maskSources.begin();
-   bool test_passed = true;
-   ossimIpt p;
-   ossim_uint8 mask_value;
-
-   while (mask_source != m_hlzUtil->m_maskSources.end())
-   {
-      ossimRefPtr<ossimImageData> mask_data = mask_source->image->getTile(chipRect);
-      for (p.y = m_demChipUL.y; (p.y < m_demChipLR.y) && test_passed; ++p.y)
-      {
-         for (p.x = m_demChipUL.x; (p.x < m_demChipLR.x) && test_passed; ++p.x)
-         {
-            mask_value = mask_data->getPix(p);
-            if (  ( mask_value &&  mask_source->exclude) ||
-                  (!mask_value && !mask_source->exclude) )
-               test_passed = false;
-         }
-      }
-      if (!test_passed)
-         break;
-
-      ++mask_source;
-   }
-
-   return test_passed;
-}
-
-
-bool ossimHLZUtil::LsFitChipProcessorJob::level1Test()
-{
-   // Start with computing best-fit plane:
-   ossimIpt p;
-   double z;
-   double y_meters;
-   for (p.y = m_demChipUL.y; p.y < m_demChipLR.y; ++p.y)
-   {
-      y_meters = p.y*m_hlzUtil->m_demGsd.y;
-      for (p.x = m_demChipUL.x; p.x < m_demChipLR.x; ++p.x)
-      {
-         z = m_hlzUtil->m_demBuffer->getPix(p, 0);
-         if ((z == m_nullValue) || ossim::isnan(z))
-            return false;
-         m_plane->addSample(p.x*m_hlzUtil->m_demGsd.x, y_meters, z);
-      }
-   }
-   if (!m_plane->solveLS())
-      return false;
-
-   // The slope is derived from the normal unit vector. Extract that from the solution and test
-   // against threshold:
-   double a, b, c;
-   m_plane->getLSParms(a, b, c);
-   double z_proj = 1.0 / sqrt(a*a + b*b + 1.0);
-   double theta = fabs(ossim::acosd(z_proj));
-   if (theta > m_hlzUtil->m_slopeThreshold)
-      return false;
-
-   // Passed the slope test. Now measure the roughness as peak deviation from the plane:
-   double distance;
-   for (p.y = m_demChipUL.y; (p.y < m_demChipLR.y); ++p.y)
-   {
-      for (p.x = m_demChipUL.x; (p.x < m_demChipLR.x); ++p.x)
-      {
-         z = m_hlzUtil->m_demBuffer->getPix(p, 0);
-         distance = fabs(z_proj * (a*p.x + b*p.y + c - z));
-         if (distance > m_hlzUtil->m_roughnessThreshold)
-            return false;
-      }
-   }
-
-   m_status = 1; // indicates passed level 1
-   return true;
-}
-
-bool ossimHLZUtil::NormChipProcessorJob::level1Test()
-{
-   // The processing chain is outputing slope values in degrees from vertical.
-   // Scan the data tile for slopes outside the threshold:
-   ossimIpt p;
-   float theta;
-   for (p.y = m_demChipUL.y; p.y < m_demChipLR.y; ++p.y)
-   {
-      for (p.x = m_demChipUL.x; p.x < m_demChipLR.x; ++p.x)
-      {
-         theta = m_hlzUtil->m_demBuffer->getPix(p, 0);
-         if ((theta == m_nullValue) || ossim::isnan(theta) || (theta > m_hlzUtil->m_slopeThreshold))
-            return false;
-      }
-   }
-
-   m_status = 1; // indicates passed level 1
-   return true;
-}
-
-void ossimHLZUtil::printApiJson(ostream& out) const
-{
-   ossimFilename json_path (ossimPreferences::instance()->findPreference("ossim_share_directory"));
-   json_path += "/ossim/util/ossimHlzApi.json";
-   if (json_path.isReadable())
-   {
-      char line[256];
-      ifstream ifs (json_path.chars());
-      ifs.getline(line, 256);
-
-       while (ifs.good())
-       {
-         out << line << endl;
-         ifs.getline(line, 256);
-       }
-
-       ifs.close();
-   }
-}
-
-ossimHLZUtil::MaskSource::MaskSource(ossimHLZUtil* hlzUtil, ossimKeywordlist& kwl,
-                                     ossim_uint32 index)
-:  exclude (true),
-   valid (false)
-{
-   ossimString prefix (MASK_PREFIX);
-   prefix += ossimString::toString(index) + ".";
-
-   ossimFilename maskFile = kwl.find(prefix.chars(), ossimKeywordNames::FILENAME_KW);
-   if (maskFile.empty())
-      return;
-
-   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(maskFile);
-   if (!handler.valid())
-   {
-      ossimNotify(ossimNotifyLevel_WARN) <<
-            "ossimHLZUtil::MaskSource -- Error encountered instantiating mask image <"
-            <<maskFile<<">. Ignoring mask source." << endl;
-      return;
-   }
-
-   kwl.getBoolKeywordValue(exclude, MASK_EXCLUDE_KW, prefix.chars());
-
-   hlzUtil->createInputChain(handler, image);
-   valid = true;
-};
-
-
-
-ossimHLZUtil::MaskSource::MaskSource(ossimHLZUtil* hlzUtil, const ossimFilename& mask_image)
-:  exclude (true),
-   valid (false)
-{
-   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(mask_image);
-   if (handler.valid())
-   {
-      hlzUtil->createInputChain(handler, image);
-      valid = true;
-   }
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ossim/src/ossim/util/ossimImageUtil.cpp b/ossim/src/ossim/util/ossimImageUtil.cpp
deleted file mode 100644
index 4b721e6..0000000
--- a/ossim/src/ossim/util/ossimImageUtil.cpp
+++ /dev/null
@@ -1,2133 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimImageUtil.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ossimImageUtil class definition
-//
-// Utility class for processing image recursively.  This is for doing things like:
-// building overview, histograms, compute min/max, extract vertices.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/util/ossimImageUtil.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimDatumFactoryRegistry.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimPropertyInterface.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/imaging/ossimHistogramWriter.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageHistogramSource.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/plugin/ossimSharedPluginRegistry.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/support_data/ossimSupportFilesList.h>
-#include <ossim/util/ossimFileWalker.h>
-
-#include <cstdlib>
-#include <iomanip>
-#include <string>
-#include <vector>
- 
-static std::string CMM_MAX_KW                  = "cmm_max"; // CMM(ComputeMinMax)
-static std::string CMM_MIN_KW                  = "cmm_min";
-static std::string CMM_NULL_KW                 = "cmm_null";
-static std::string COPY_ALL_FLAG_KW            = "copy_all_flag";
-static std::string CREATE_HISTOGRAM_KW         = "create_histogram";
-static std::string CREATE_HISTOGRAM_FAST_KW    = "create_histogram_fast";
-static std::string CREATE_HISTOGRAM_R0_KW      = "create_histogram_r0";
-static std::string CREATE_OVERVIEWS_KW         = "create_overviews";
-static std::string DUMP_FILTERED_IMAGES_KW     = "dump_filter_image";
-static std::string FALSE_KW                    = "false";
-static std::string FILE_KW                     = "file";
-static std::string INTERNAL_OVERVIEWS_FLAG_KW  = "internal_overviews_flag";
-static std::string OUTPUT_DIRECTORY_KW         = "output_directory";
-static std::string OUTPUT_FILENAMES_KW         = "output_filenames";
-static std::string OVERRIDE_FILTERED_IMAGES_KW = "override_filtered_images";
-static std::string OVERVIEW_STOP_DIM_KW        = "overview_stop_dimension";
-static std::string OVERVIEW_TYPE_KW            = "overview_type";
-static std::string READER_PROP_KW              = "reader_prop";
-static std::string REBUILD_HISTOGRAM_KW        = "rebuild_histogram";
-static std::string REBUILD_OVERVIEWS_KW        = "rebuild_overviews";
-static std::string SCAN_MIN_MAX_KW             = "scan_for_min_max";
-static std::string SCAN_MIN_MAX_NULL_KW        = "scan_for_min_max_null";
-static std::string THREADS_KW                  = "threads";
-static std::string TILE_SIZE_KW                = "tile_size";
-static std::string TRUE_KW                     = "true";
-static std::string WRITER_PROP_KW              = "writer_prop";
- 
-// Static trace for debugging.  Use -T ossimImageUtil to turn on.
-static ossimTrace traceDebug = ossimTrace("ossimImageUtil:debug");
- 
-ossimImageUtil::ossimImageUtil()
-   :
-   ossimReferenced(),
-   ossimFileProcessorInterface(),
-   m_kwl( new ossimKeywordlist() ),
-   m_fileWalker(0),
-   m_mutex(),
-   m_errorStatus(0),
-   m_filteredImages(0)
-{
-}
- 
-ossimImageUtil::~ossimImageUtil()
-{
-   if ( m_fileWalker )
-   {
-      delete m_fileWalker;
-      m_fileWalker = 0;
-   }
-}
-    
-void ossimImageUtil::addOptions(ossimApplicationUsage* au)
-{
-   // Set the command line options:
-   au->addCommandLineOption("-a or --include-fullres", "Copy full res dataset to overview file as well as building reduced res sets. Option only valid with tiff overview builder. Requires -o option.");
- 
-   au->addCommandLineOption("--ch or --create-histogram", "Computes full histogram alongside overview.");
- 
-   au->addCommandLineOption("--chf or --create-histogram-fast", "Computes a histogram in fast mode which samples partial tiles.");
- 
-   au->addCommandLineOption("--compression-quality", "Compression quality for TIFF JPEG takes values from 0 to 100, where 100 is best.  For J2K plugin, numerically_lossless, visually_lossless, lossy");
- 
-   au->addCommandLineOption("--compute-min-max", "Turns on min, max scanning when reading tiles and writes a dot omd file. This option assumes the null is known.");
- 
-   au->addCommandLineOption("--compute-min-max-null", "Turns on min, max, null scanning when reading tiles and write a dot omd file. This option tries to find a null value which is useful for float data.");
- 
-   au->addCommandLineOption("--compression-type", "Compression type can be: deflate, jpeg, lzw, none or packbits");
- 
-   au->addCommandLineOption("--create-histogram-r0", "Forces create-histogram code to compute a histogram using r0 instead of the starting resolution for the overview builder. Can require a separate pass of R0 layer if the base image has built in overviews.");
- 
-   au->addCommandLineOption("-d", "<output_directory> Write overview to output directory specified.");
- 
-   au->addCommandLineOption("--dump-filtered-image-list", "Outputs list of filtered images and extensions.");
- 
-   au->addCommandLineOption("-h", "Display this information");
- 
-   au->addCommandLineOption("-i or --internal-overviews", "Builds internal overviews. Requires -o option. Option only valid with tiff input image and tiff overview builder. WARNING: Modifies source image and cannot be undone!");
- 
-   au->addCommandLineOption("--list-entries", "Lists the entries within the image");
- 
-   au->addCommandLineOption("--max","Overrides max value for compute-min-max option.");
- 
-   au->addCommandLineOption("--min","Overrides min value for compute-min-max option.");
- 
-   au->addCommandLineOption("--null", "<null_value> Overrides null value for compute-min-max option.  e.g. -9999.0 for float data");
- 
-   au->addCommandLineOption("-o", "Creates overviews. (default=ossim_tiff_box)");
- 
-   au->addCommandLineOption("--of or --output-files", "Output image files we can open, exluding overviews.");
-
-   au->addCommandLineOption("--options","<options.kwl>  This can be all or part of the application options. Also used for custom prep, per file and post system commands. To get a template you can turn on trace to the ossimImageUtil class by adding \"-T ossimImageUtil\" to your command.");
- 
-   au->addCommandLineOption("--ot", "<overview_type> Overview type. see list at bottom for valid types. (default=ossim_tiff_box)");
- 
-   au->addCommandLineOption("--override-filtered-images", "Allows processing of file that is in the filtered image list.");
- 
-   au->addCommandLineOption("-r or --rebuild-overviews", "Rebuild overviews even if they are already present.");
- 
-   au->addCommandLineOption("--rebuild-histogram", "Rebuild histogram even if they are already present.");
- 
-   au->addCommandLineOption("--reader-prop", "Adds a property to send to the reader. format is name=value");
- 
-   au->addCommandLineOption("-s",  "Stop dimension for overviews.  This controls how \nmany layers will be built. If set to 64 then the builder will stop when height and width for current level are less than or equal to 64.  Note a default can be set in the ossim preferences file by setting the keyword \"overview_stop_dimension\".");
-
-   au->addCommandLineOption("--tile-size", "<size> Defines the tile size for overview builder.  Tiff option only. Must be a multiple of 16. Size will be used in both x and y directions. Note a default can be set in your ossim preferences file by setting the key \"tile_size\".");
- 
-   au->addCommandLineOption("--threads", "<threads> The number of threads to use. (default=1) Note a default can be set in your ossim preferences file by setting the key \"ossim_threads\".");
- 
-   au->addCommandLineOption("--writer-prop", "Adds a property to send to the writer. format is name=value");
-}
-
-void ossimImageUtil::addArguments(ossimArgumentParser& ap)
-{
-   // Set the general usage:
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options] <file-or-directory-to-walk>";
-   au->setCommandLineUsage(usageString);
-
-   addOptions(au);
- 
-} // void ossimImageUtil::addArguments(ossimArgumentParser& ap)
- 
-bool ossimImageUtil::initialize(ossimArgumentParser& ap)
-{
-   static const char M[] = "ossimImageUtil::initialize(ossimArgumentParser&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
- 
-   bool result = true;
- 
-   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
-   {
-      usage(ap);
- 
-      // continue_after_init to false
-      result = false;
-   }
-   else
-   {
-      // Start with clean options keyword list.
-      m_kwl->clear();
-
-      // Used throughout below:
-      std::string ts1;
-      ossimArgumentParser::ossimParameter sp1(ts1);
-      std::string ts2;
-      ossimArgumentParser::ossimParameter sp2(ts2);
- 
-      while ( 1 ) //  While forever loop...
-      {
-         if( ap.read("-a") || ap.read("--include-fullres") )
-         {
-            setCopyAllFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--compression-quality", sp1) )
-         {
-            if ( ts1.size() )
-            {
-               setCompressionQuality( ts1 );
-            }
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--compression-type", sp1) )
-         {
-            if ( ts1.size() )
-            {
-               setCompressionType( ts1 );
-            }
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--ch") || ap.read("--create-histogram") )
-         {
-            setCreateHistogramFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--chf") || ap.read("--create-histogram-fast") )
-         {
-            setCreateHistogramFastFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--compute-min-max") )
-         {
-            setScanForMinMax( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--compute-min-max-null") )
-         {
-            setScanForMinMaxNull( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--create-histogram-r0") )
-         {
-            setCreateHistogramR0Flag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("-d", sp1) )
-         {
-            setOutputDirectory( ts1 );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--dump-filtered-image-list") )
-         {
-            setDumpFilteredImageListFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("-i") || ap.read("--internal-overviews") )
-         {
-            setInternalOverviewsFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--max", sp1) )
-         {
-            addOption( CMM_MAX_KW, ts1 );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--min", sp1) )
-         {
-            addOption( CMM_MIN_KW, ts1 );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--null", sp1) )
-         {
-            addOption( CMM_NULL_KW, ts1 );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--options", sp1) )
-         {
-            ossimFilename optionsKwl = ts1;
-            if ( optionsKwl.exists() )
-            {
-               if ( m_kwl->addFile(optionsKwl) == false )
-               {
-                  std::string errMsg = "ERROR could not open options keyword list file: ";
-                  errMsg += optionsKwl.string();
-                  throw ossimException(errMsg);
-               }
-            }
-            else
-            {
-               std::string errMsg = "ERROR options keyword list file does not exists: ";
-               errMsg += optionsKwl.string();
-               throw ossimException(errMsg); 
-            }
-         }
-         
-         if( ap.read("--of") || ap.read("--output-files") )
-         {
-            setOutputFileNamesFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("-o") )
-         {
-            setCreateOverviewsFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }        
- 
-         if( ap.read("--ot", sp1) )
-         {
-            setOverviewType( ts1 );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--override-filtered-images") )
-         {
-            setOverrideFilteredImagesFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("-r") || ap.read("--rebuild-overviews") )
-         {
-            setRebuildOverviewsFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--rebuild-histogram") )
-         {
-            setRebuildHistogramFlag( true );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         while(ap.read("--reader-prop", sp1))
-         {
-            if (ts1.size())
-            {
-               std::string key = READER_PROP_KW;
-               key += ossimString::toString( getNextReaderPropIndex() ).string();
-               addOption( key, ts1 );
-            }
-         }
-         if ( ap.argc() < 2 )
-         {
-            break;
-         }
- 
- 
- 
-         if( ap.read("-s", sp1) )
-         {
-            setOverviewStopDimension( ts1 );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if ( ap.read("-tile-size", sp1))
-         {
-            setTileSize( ossimString(ts1).toInt32() );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         if( ap.read("--threads", sp1) )
-         {
-            m_kwl->addPair( THREADS_KW, ts1 );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
- 
-         while(ap.read("--writer-prop", sp1))
-         {
-            if (ts1.size())
-            {
-               std::string key = WRITER_PROP_KW;
-               key += ossimString::toString( getNextWriterPropIndex() ).string();
-               addOption( key, ts1 );
-            }
-         }
-         if ( ap.argc() < 2 )
-         {
-            break;
-         }
- 
-         // End of arg parsing.
-         ap.reportRemainingOptionsAsUnrecognized();
-         if ( ap.errors() )
-         {
-            ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-            std::string errMsg = "Unknown option...";
-            throw ossimException(errMsg);
-         }
- 
-         break; // Break from while forever.
- 
-      } // End while (forever) loop.
- 
-      if(ap.argc() > 1)
-      {
-         for (ossim_int32 i = 0; i < (ap.argc()-1); ++i)
-         {
-            ossimString kw = FILE_KW;
-            kw += ossimString::toString(i);
-            std::string value = ap[i+1];
-            m_kwl->addPair(kw.string(), value, true);
-         }
-      }
-      else
-      {
-         if ( getDumpFilterImagesFlag() )
-         {
-            // Caller wants to see filtered image names:
-            if ( m_filteredImages.empty() )
-            {
-               initializeDefaultFilterList();
-            }
-
-            // Dump our filtered images.
-            dumpFilteredImageList();
-
-            if ( !m_fileWalker )
-            {
-               m_fileWalker = new ossimFileWalker();
-               m_fileWalker->initializeDefaultFilterList();
-            }
-
-            // Dump the file walker's filtered extensions.
-            m_fileWalker->dumpFilteredExtensionList();
-         }
-         else
-         {
-            usage(ap);
-         }
- 
-         // continue_after_init to false
-         result = false; 
- 
-      }
- 
-   } // not usage
- 
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "m_kwl:\n" << *(m_kwl.get()) << "\n"
-         << M << " exit result = " << (result?"true":"false")
-         << "\n";
-   }
- 
-   return result;
-}
- 
-ossim_int32 ossimImageUtil::execute()
-{
-   static const char M[] = "ossimImageUtil::execute()";
- 
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-
-   // Launch any prep system commands:
-   executePrepCommands();
-
-   // Get the number of "file*" keywords.
-   ossim_uint32 fileCount = m_kwl->numberOf("file");
- 
-   if ( fileCount )
-   {
-      if ( !m_fileWalker )
-      {
-         m_fileWalker = new ossimFileWalker();
-      }
- 
-      if ( !getOverrideFilteredImagesFlag() )
-      {
-         if ( m_filteredImages.empty() )
-         {
-            initializeDefaultFilterList();
-         }
-         if ( m_fileWalker->getFilteredExtensions().empty() )
-         {
-            m_fileWalker->initializeDefaultFilterList();
-         }
-      }
- 
-      m_fileWalker->setNumberOfThreads( getNumberOfThreads() );
- 
-      // Must set this so we can stop recursion on directory based images.
-      m_fileWalker->setWaitOnDirFlag( true );
- 
-      // This links the file walker back to our "processFile" method.
-      m_fileWalker->setFileProcessor( this );
- 
-      // Wrap in try catch block as excptions can be thrown under the hood.
-      try
-      {
-         // Get the list of files passed to us:
-         std::vector<ossimFilename> files;
-         ossim_uint32 processedFiles = 0;;
-         ossim_uint32 i = 0;
-         while ( processedFiles < fileCount )
-         {
-            ossimString key = FILE_KW;
-            key += ossimString::toString(i);
-            std::string lookup = m_kwl->findKey( key.string() );
-            if ( lookup.size() )
-            {
-               files.push_back( ossimFilename(lookup) );
-               ++processedFiles;
-            }
- 
-            ++i;
-            if ( i > (fileCount + 100) ) break;
-         }
-
-         // Process the files:
-         m_fileWalker->walk( files ); 
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Caught exception: " << e.what() << endl;
-         setErrorStatus( ossimErrorCodes::OSSIM_ERROR );
-      }
- 
-   } // if ( fileCount )
-
-   // Launch any post system commands:
-   executePostCommands();
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " exit status: " << m_errorStatus << std::endl;
-   }
- 
-   // Zero is good, non zero is bad.
-   return m_errorStatus; 
-}
- 
-//---
-// This method is called back by the ossimFileWalker::walk method for each file it finds that it
-// deems can be processed.
-//---
-void ossimImageUtil::processFile(const ossimFilename& file)
-{
-   static const char M[] = "ossimImageUtil::processFile";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered...\n" << "file: " << file << "\n";
-   }
- 
-   bool processFileFlag = true;
-   if ( !getOverrideFilteredImagesFlag() )
-   {
-      processFileFlag = !isFiltered( file );
-   }
- 
-   if ( processFileFlag )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << "Processing file: " << file << std::endl;
- 
-      m_mutex.lock();
-      ossimRefPtr<ossimImageHandler> ih =
-         ossimImageHandlerRegistry::instance()->open(file, true, true);
-      m_mutex.unlock();
- 
-      if ( ih.valid() && !ih->hasError() )
-      {
-         // Check for output directory:
-         if ( m_kwl->hasKey( OUTPUT_DIRECTORY_KW ) )
-         {
-            ossimFilename outputDir;
-            outputDir.string() = m_kwl->findKey( OUTPUT_DIRECTORY_KW );
-
-            if ( outputDir.exists() && outputDir.isDir() )
-            {
-               ih->setSupplementaryDirectory( outputDir );
-            }
-         }
-         
-         if ( isDirectoryBasedImage( ih.get() ) )
-         {
-            // Tell the walker not to recurse this directory.
-            m_mutex.lock();
-            m_fileWalker->setRecurseFlag(false);
-            m_mutex.unlock();
-         }
-
-         // Set any reader props:
-         ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>(ih.get());
-         if ( pi ) setProps(pi);
- 
-         bool consumedHistogramOptions  = false;
-         bool consumedCmmOptions = false;
- 
-         if ( getOutputFileNamesFlag() )
-         {
-            // Simply output the file name of any images we can open:
-            ossimNotify(ossimNotifyLevel_NOTICE) << ih->getFilename().expand(); 
-         }
- 
-         if ( createOverviews() )
-         {
-            // Skip shape files...
-            if ( ih->getClassName() != "ossimOgrGdalTileSource" )
-            {
-               createOverview(ih, consumedHistogramOptions, consumedCmmOptions);
-            }
-         }
- 
-         // Build stand alone histogram.  Note the overview sequencer may have computed for us.
-         if ( hasHistogramOption() && !consumedHistogramOptions)
-         {
-            createHistogram( ih );
-         }
- 
-         // Compute/Scan for min, max.  Note the overview sequencer may have computed for us.
-         if ( ( scanForMinMax() || scanForMinMaxNull() ) && !consumedCmmOptions )
-         {
-            computeMinMax( ih );
-         }
-
-         // Launch any file system commands.
-         executeFileCommands( file );
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << M << "\nCould not open: " << file << std::endl;
-      }
-   }
-   else // Matches: if ( processFileFlag )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "Filtered file, not processing: " << file << std::endl;
-   }
- 
-   if(traceDebug())
-   {
-      // Since ossimFileWalker is threaded output the file so we know which job exited.
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
-   }
-}
-
-// Create overview for image:
-void ossimImageUtil::createOverview( ossimRefPtr<ossimImageHandler>& ih,
-                                     bool& consumedHistogramOptions,
-                                     bool& consumedCmmOptions )
-{
-   static const char M[] = "ossimImageUtil::createOverview #1";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
- 
-   if ( ih.valid() )
-   {
-      // Get the entry list:
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
- 
-      bool useEntryIndex = false;
-      if ( entryList.size() )
-      {
-         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
-      }
-
-      // Create the overview builder:
-      ossimString overviewType;
-      getOverviewType( overviewType.string() );
-      ossimRefPtr<ossimOverviewBuilderBase> ob =
-         ossimOverviewBuilderFactoryRegistry::instance()->createBuilder(overviewType);
-      if ( ob.valid() )
-      {
-         // Set up any overview builder options that don't involve histograms.
-         ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>( ob.get() );
-         if ( pi ) setProps(pi);
- 
-         ossim_uint32 stopDimension = getOverviewStopDimension();
-         if ( stopDimension ) ob->setOverviewStopDimension(stopDimension);
- 
-         if ( ( scanForMinMax() || scanForMinMaxNull() ) && !hasCmmOption() )
-         {
-            //---
-            // If scan is set and we don't have any min, max, null overrides let the
-            // overview builder scan for min, max.
-            //
-            // If min, max, or null option is set, scan will be performed in
-            // separate function.
-            //---
-            ob->setScanForMinMax( scanForMinMax() );
-            ob->setScanForMinMaxNull( scanForMinMaxNull() );
-            consumedCmmOptions = true;
-         }
- 
-         for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
-         {
-            createOverview(ih, ob, entryList[idx], useEntryIndex, consumedHistogramOptions);
-         }
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "ERROR:\nCould not create builder for:  "<< overviewType << std::endl;
-         outputOverviewWriterTypes();
-      }
-   }
- 
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-}
-
-// Create overview for entry:
-void ossimImageUtil::createOverview(ossimRefPtr<ossimImageHandler>& ih,
-                                    ossimRefPtr<ossimOverviewBuilderBase>& ob,
-                                    ossim_uint32 entry,
-                                    bool useEntryIndex,
-                                    bool& consumedHistogramOptions)
-{
-   static const char M[] = "ossimImageUtil::createOverview #2";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
- 
-   if ( ih.valid() && ob.valid() )
-   {
-      if (useEntryIndex)
-      {
-         // Set entry before deriving file name.
-         ih->setCurrentEntry(entry);
-         ossimNotify(ossimNotifyLevel_NOTICE) << "entry number: "<< entry << std::endl;
-      }
- 
-      ossimFilename outputFile =
-         ih->getFilenameWithThisExtension(ossimString(".ovr"), useEntryIndex);
- 
-      if ( rebuildOverviews() )
-      {
-         ih->closeOverview(); 
-         if ( outputFile.exists() )
-         {
-            outputFile.remove();
-         }
-      }
- 
-      if ( getInternalOverviewsFlag() )
-      {
-         if ( ih->getClassName() == "ossimTiffTileSource")
-         {
-            //---
-            // INTERNAL_OVERVIEWS_FLAG_KW is set to true:
-            // Tiff reader can handle internal overviews.  Set the output file to
-            // input file.  Do it after the above remove so that if there were
-            // external overviews they will get removed.
-            //---
-            outputFile = ih->getFilename();
-         }
-         else 
-         {
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "Internal overviews not supported for reader type: "
-               <<ih->getClassName()
-               << "\nIgnoring option..."
-               << endl;
-         }
-      }
- 
-      if ( hasRequiredOverview( ih, ob ) == false )
-      {
-         //---
-         // Set create histogram code...
-         //
-         // Notes:
-         // 1) Must put this logic after any removal of external overview file.
-         // 
-         // 2) Base file could have built in overviews, e.g. jp2 files.  So the sequensor could
-         //    start at R6 even if there is no external overview file.
-         //
-         // 3) If user want the histogram from R0 the overview builder can do as long as
-         //    ossimImageHandler::getNumberOfDecimationLevels returns 1.  If we are starting
-         //    overview building at R6 then we must do the create histogram in a separate path.
-         //---
-         ossimHistogramMode histoMode = OSSIM_HISTO_MODE_UNKNOWN;
-         if ( createHistogram() ||
-              ( createHistogramR0() && ( ih->getNumberOfDecimationLevels() == 1 ) ) )
-         {
-            histoMode = OSSIM_HISTO_MODE_NORMAL;
-         }
-         else if ( createHistogramFast() )
-         {
-            histoMode = OSSIM_HISTO_MODE_FAST;
-         }
- 
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG) << "Histogram mode: " << histoMode << "\n";
-         }
- 
-         if ( histoMode != OSSIM_HISTO_MODE_UNKNOWN )
-         {
-            consumedHistogramOptions = true;
-            ob->setHistogramMode(histoMode);
- 
-            ossimNotify(ossimNotifyLevel_NOTICE)
-               << "Creating overviews with histogram for file: " << ih->getFilename() << std::endl;
-         }
-         else
-         {
-            if ( histoMode != OSSIM_HISTO_MODE_UNKNOWN )
-            {
-               consumedHistogramOptions = false;  
-               ossimNotify(ossimNotifyLevel_NOTICE)
-                  << "Creating overviews for file: " << ih->getFilename() << std::endl;
-            }
-         }
- 
-         ob->setOutputFile(outputFile);
-         ob->setInputSource(ih.get());
-
-         // Create the overview for this entry in this file:
-         if ( ob->execute() == false )
-         {
-            setErrorStatus( ossimErrorCodes::OSSIM_ERROR );
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "Error returned creating overviews for file: " << ih->getFilename() << std::endl;
-         }
-      }
-      else
-      {
-         consumedHistogramOptions = false;
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "Image has required reduced resolution data sets." << std::endl;
-      }
-   }
- 
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-}
- 
-bool ossimImageUtil::hasRequiredOverview( ossimRefPtr<ossimImageHandler>& ih,
-                                          ossimRefPtr<ossimOverviewBuilderBase>& ob )
-{
-   bool result = false;
-   if ( ih.valid() && ob.valid() && ( getCopyAllFlag() == false ) )
-   {
-      if ( ih->getClassName() == "ossimCcfTileSource" )
-      {
-         // CCF reader does not use external overviews.
-         result = true;
-      }
-      else
-      {
-         // Note we always have one rset
-         ossim_uint32 required = 1;
- 
-         ossim_uint32 startingResLevel      = ih->getNumberOfDecimationLevels();
-         ossim_uint32 overviewStopDimension = ob->getOverviewStopDimension();
- 
-         ossim_uint32 largestImageDimension =
-            ih->getNumberOfSamples(0) >
-            ih->getNumberOfLines(0) ?
-            ih->getNumberOfSamples(0) :
-            ih->getNumberOfLines(0);
- 
-         while(largestImageDimension > overviewStopDimension)
-         {
-            largestImageDimension /= 2;
-            ++required;
-         }
- 
-         if ( startingResLevel >= required )
-         {
-            result = true;
-         }
-      }
-   }
-   return result;
-}
- 
-void ossimImageUtil::createHistogram(ossimRefPtr<ossimImageHandler>& ih)
-{
-   static const char M[] = "ossimImageUtil::createHistogram #1";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
- 
-   if ( ih.valid() )
-   {
-      // Get the entry list:
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
- 
-      bool useEntryIndex = false;
-      if ( entryList.size() )
-      {
-         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
-      }
- 
-      for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
-      {
-         createHistogram(ih, entryList[idx], useEntryIndex);
-      }
-   }
- 
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-}
-
-// Create histogram for entry:
-void ossimImageUtil::createHistogram(ossimRefPtr<ossimImageHandler>& ih,
-                                     ossim_uint32 entry,
-                                     bool useEntryIndex)
-{
-   static const char M[] = "ossimImageUtil::createHistogram #2";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
- 
-   if ( ih.valid() )
-   {
-      if (useEntryIndex)
-      {
-         // Set entry before deriving file name.
-         ih->setCurrentEntry(entry);
-         ossimNotify(ossimNotifyLevel_NOTICE) << "entry number: "<< entry << std::endl;
-      }
- 
-      ossimFilename outputFile =
-         ih->getFilenameWithThisExtension(ossimString(".his"), useEntryIndex);
-
-      // Only build if needed:
-      if ( (outputFile.exists() == false) || rebuildHistogram() )
-      {
-         ossimNotify(ossimNotifyLevel_NOTICE)
-            << "Computing histogram for file: " << ih->getFilename() << std::endl;
- 
-         // Check handler to see if it's filtering bands.
-         std::vector<ossim_uint32> originalBandList(0);
-         if ( ih->isBandSelector() )
-         { 
-            // Capture for finalize method.
-            ih->getOutputBandList( originalBandList );
- 
-            // Set output list to input.
-            ih->setOutputToInputBandList();
-         }
- 
-         ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
-         ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
- 
-         histoSource->setMaxNumberOfRLevels(1); // Currently hard coded...
- 
-#if 0 /* TODO tmp drb */
-         if( !ossim::isnan(histoMin) )
-         {
-            histoSource->setMinValueOverride(histoMin);
-         }
- 
-         if( !ossim::isnan(histoMax) )
-         {
-            histoSource->setMaxValueOverride(histoMax);
-         }
- 
-         if(histoBins > 0)
-         {
-            histoSource->setNumberOfBinsOverride(histoBins);
-         }
-#endif
- 
-         if(traceDebug())
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "Histogram mode: " << getHistogramMode() << "\n";
-         }
- 
-         // Connect histogram source to image handler.
-         histoSource->setComputationMode( getHistogramMode() );
-         histoSource->connectMyInputTo(0, ih.get() );
-         histoSource->enableSource();
- 
-         // Connect writer to histogram source.
-         writer->connectMyInputTo(0, histoSource.get());
-         writer->setFilename(outputFile);
-         theStdOutProgress.setFlushStreamFlag(true);
-         writer->addListener(&theStdOutProgress);
- 
-         // Compute...
-         writer->execute();
- 
-         writer=0;
- 
-         // Reset the band list.
-         if ( ih->isBandSelector() && originalBandList.size() )
-         {
-            ih->setOutputBandList( originalBandList );
-         }
- 
-      } // Matches: if ( (outputFile.exists() == false) || rebuildHistogram() )
- 
-   } // Matches: if ( ih.valid() )
- 
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
- 
-} // End: ossimImageUtil::createHistogram #2
- 
-void ossimImageUtil::computeMinMax(ossimRefPtr<ossimImageHandler>& ih)
-{
-   static const char M[] = "ossimImageUtil::computeMinMax #1";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
- 
-   if ( ih.valid() )
-   {
-      // Get the entry list:
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
- 
-      bool useEntryIndex = false;
-      if ( entryList.size() )
-      {
-         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
-      }
- 
-      for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
-      {
-         computeMinMax(ih, entryList[idx], useEntryIndex);
-      }
-   }
- 
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
- 
-} // End: ossimImageUtil::computeMinMax( ih )
- 
-void ossimImageUtil::computeMinMax( ossimRefPtr<ossimImageHandler>& ih,
-                                    ossim_uint32 entry,
-                                    bool useEntryIndex )
-{
-   static const char M[] = "ossimImageUtil::computeMinMax #2";
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
- 
-   if ( ih.valid() )
-   {
-      // Get any min, max, null overrides;
-      double maxValue  = ossim::nan();
-      double minValue  = ossim::nan();
-      double nullValue = ossim::nan();
-
-      ossimString value = m_kwl->findKey( CMM_MAX_KW );
-      if ( value.size() )
-      {
-         maxValue = value.toDouble();
-      }
-
-      value = m_kwl->findKey( CMM_MIN_KW );
-      if ( value.size() )
-      {
-         minValue = value.toDouble();
-      }
-
-      bool hasNull = false;
-      value = m_kwl->findKey( CMM_NULL_KW );
-      if ( value.size() )
-      {
-         nullValue = value.toDouble();
-         if ( !ossim::isnan(nullValue) )
-         {
-            hasNull = true;
-         }
-      }
- 
-      // Select the entry.
-      ih->setCurrentEntry( entry );
- 
-      // Build the .omd file name.
-      ossimFilename omd_file = ih->getFilename();;
-
-      // Check for output directory:
-      if ( m_kwl->hasKey( OUTPUT_DIRECTORY_KW ) )
-      {
-         ossimFilename outputDir;
-         outputDir.string() = m_kwl->findKey( OUTPUT_DIRECTORY_KW );
-         
-         if ( outputDir.exists() && outputDir.isDir() )
-         {
-            omd_file = outputDir.dirCat( omd_file.file() );
-         }
-      }
- 
-      if ( useEntryIndex )
-      {
-         ossim_uint32 currentEntry = ih->getCurrentEntry();
-         omd_file.setExtension("");
-         omd_file += "_e";
-         omd_file += ossimString::toString(currentEntry);
- 
-         //---
-         // Note:  Set extension was not used here deliberately to avoid
-         // messing
-         // up a MODIS file in hdf format with multiple '.'s in the file
-         // name.
-         //---
-         omd_file += ".omd";
-      }
-      else
-      {
-         omd_file.setExtension("omd");
-      }
- 
-      ossimRefPtr<ossimImageSourceSequencer> is = new ossimImageSourceSequencer(ih.get());
- 
-      //---
-      // Note: getImageTileWidth/Height will return zero if the image is not
-      // intenally tiles.
-      //---
-      ossimIpt tileWidthHeight(ih->getImageTileWidth(), ih->getImageTileHeight());
- 
-      if (!tileWidthHeight.x)
-      {
-         //---
-         // Make the sequencer read entire strips from the image handler
-         // at a time.  This will speed up access time for strip images
-         //---
-         tileWidthHeight.x = ih->getBoundingRect().width();
-      }
-      if(!tileWidthHeight.y)
-      {
-         tileWidthHeight.y = ih->getTileHeight();
-      }
- 
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "Sequencer tile size: " << tileWidthHeight << endl;
-      }
- 
-      is->setTileSize(tileWidthHeight);
- 
-      //---
-      // Make arrays of doubles to hold the min/max values.
-      // Initialize mins to default maxes and maxes to default mins to be
-      // safe.
-      //---
-      ossim_uint32 i; // for numerous iterations...
- 
-      const ossimScalarType ST = ih->getOutputScalarType();
- 
-      const double DEFAULT_MIN = ossim::defaultMin(ST);
-      const double DEFAULT_MAX = ossim::defaultMax(ST);
- 
-      const ossim_uint32 BANDS = ih->getNumberOfInputBands();
- 
-      vector<double> tmin(BANDS);
-      vector<double> tmax(BANDS);
-      vector<double> tnull(BANDS);
-      for (i = 0; i < BANDS; ++i)
-      {
-         tmin[i] = DEFAULT_MAX;
-         tmax[i] = DEFAULT_MIN;
- 
-         if ( hasNull )
-         {
-            // User passed in with --null option so set here.
-            tnull[i] = nullValue;
-         }
-         else
-         {
-            tnull[i] = ih->getNullPixelValue(i);
-         }
-      }
- 
-      // Scan the image and compute the min and max.
-      const double TOTAL_TILES = is->getNumberOfTiles();
-      double tile_count = 0.0;
-      ossimNotify(ossimNotifyLevel_INFO)
-         << setiosflags(ios::fixed) << setprecision(0);
- 
-      if( (ossim::isnan(minValue) ) || (ossim::isnan(maxValue) ) )
-      {
-         ossimRefPtr<ossimImageData> id = is->getNextTile();
-         while(id.valid())
-         {
-            if ( hasNull )
-            {
-               // Pass null to image data object so it doesn't get picked up as "min".
-               id->setNullPix( nullValue );
-            }
-            id->computeMinMaxPix(tmin, tmax);
-            id = is->getNextTile();
-            ++tile_count;
-            ossimNotify(ossimNotifyLevel_INFO)
-               << "\r"  << setw(3)
-               << (tile_count / TOTAL_TILES * 100.0) << "%"
-               << flush;
-         }
-      }
-      
-      if(!ossim::isnan(minValue))
-      {
-         std::fill(tmin.begin(), tmin.end(), minValue);
-      }
-      if(!ossim::isnan(maxValue))
-      {
-         std::fill(tmax.begin(), tmax.end(), maxValue);
-      }
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "\r100%\nFinished..." << endl;
- 
-      ossimKeywordlist okwl(omd_file);
- 
-      for(i = 0; i < BANDS; ++i)
-      {
-         //---
-         // Check to see if values got assigned.  If not flip to default and
-         // issue a warning.
-         //---
-         if (tmin[i] == DEFAULT_MAX)
-         {
-            tmin[i] = DEFAULT_MIN;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "cmm scan for min failed! Using default min."
-               << std::endl;
-         }
-         if (tmax[i] == DEFAULT_MIN)
-         {
-            tmax[i] = DEFAULT_MAX;
-            ossimNotify(ossimNotifyLevel_WARN)
-               << "cmm scan for max failed! Using default max."
-               << std::endl;
-         }
-            
-         ossimString band =
-            ossimString("band")+ossimString::toString(i+1)+".";
-
-         if (tmin[i] == DEFAULT_MAX)
-         {
-            tmin[i] = DEFAULT_MIN;
-         }
-         // if (tmax[i] == DEFAULT_MIN){}
-            
-         okwl.add(band + "min_value", tmin[i], true);
-         okwl.add(band + "max_value", tmax[i], true);
-         okwl.add(band + "null_value", tnull[i], true); 
-         
-         if( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_INFO)
-               << setiosflags(ios::fixed) << setprecision(16)
-               << "band" << ossimString::toString(i+1) << ".min_value: "
-               << tmin[i]
-               << "\nband" << ossimString::toString(i+1) << ".max_value: "
-               << tmax[i]
-               << "\nband" << ossimString::toString(i+1) << ".null_value: "
-               << tnull[i] << endl;
-         }
-         
-      } // End of band loop.
-      
-      // Add missing info (number of bands, scalar type) to the .omd file
-      okwl.add("bytes_per_pixel", ossim::scalarSizeInBytes(ST), true);
-      okwl.add("number_bands", BANDS, true);
-      okwl.add("scalar_type", (ossimScalarTypeLut::instance()->getEntryString(ST)), true);
-
-      // Write the file to disk:
-      okwl.write(omd_file);
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "wrote file:  " << omd_file << endl;
-         
-   } // Matches: if ( ih.valid() )
-   
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-   
-} // End: ossimImageUtil::computeMinMax( ih, entry, ... )
-
-void ossimImageUtil::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-   
-   // Set app name.
-   ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
-
-   // Add options.
-   addArguments(ap);
-   
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-
-   outputOverviewWriterTypes();
-   
-   ossimNotify(ossimNotifyLevel_INFO)
-      << "\nExample commands:\n"
-
-      << "\n// A single image standard tiff overviews, histogram:\n"
-      << "ossim-preproc -o --ch <file>\n"
-
-      << "\n// A single image with j2k overviews(requires kakadu plugin), histogram:\n"
-      << "ossim-preproc --ot ossim_kakadu_nitf_j2k --ch <file>\n"
-      << "\n// j2k, histogram, 4 threads\n"
-
-      << "\n// standard tiff overviews, full histogram, 4 threads:\n"
-      << "ossim-preproc -r -o --ch --threads 4 <directory_to_walk>\n"
-
-      << "\n// j2k, histogram (fast mode), 4 threads\n"
-      << "ossim-preproc -r --ot ossim_kakadu_nitf_j2k --chf --threads 4 "
-      << "<directory_to_walk>\n"
-
-      << "\n// tiff, jpeg compression, histogram, 4 threads\n"
-      << "ossim-preproc -r --ch --compression-quality 75 --compression-type "
-      << "jpeg --threads 4 <directory_to_walk>\n"
-      << "ossim-preproc -r --ch --compression-quality 75 --compression-type "
-      << "jpeg --threads 4 <directory_to_walk>\n"
-
-      << "\n// Process all the tiffs in a directory feeding \"prep\", \"file\", \"post\" system commands via the --options option which includes indexing file into the omar database via omar-data-mgr app:\n"
-      << "ossim-preproc --options preproc-options.kwl -r -o --ch *.tif\n"
-      << "\n// Contents of preproc-options.kwl used in above command:\n"
-      << "prep.command0: echo start_time: %{date}\n"
-      << "prep.command0.strf_time_format: %Y%m%d%H%M%S\n"
-      << "prep.command1: mkdir -p %{date}\n"
-      << "file.command0: mv %{file_no_ext}.* %{date}/.\n"
-      << "file.command1: omar-data-mgr -u http://localhost:8080/omar add %{date}/%{basename}\n"
-      << "post.command0: echo end_time: %{date}\n"
-      << "post.command0.strf_time_format: %Y%m%d%H%M%S\n"
-      
-      << "\nNOTES:\n"
-      << "\n  --ch  equals --create-histogram"
-      << "\n  --chf equals --create-histogram-fast"
-
-      << "\n\nExpanded command option variables:\n\n"
-      << "%{basename}        = filename without path\n"
-      << "%{basename_no_ext} = filename without path and without extention\n"
-      << "%{date}            = Expanded to current zulu time. Default format=yyyymmdd\n"
-      << "                     output format controlled by command0.strf_time_format key.\n"
-      << "%{dirname}         = path of filename\n"
-      << "%{file}            = filename being processed\n"
-      << "%{file_no_ext}     = filename with no extension\n"
-
-      << std::endl;
-}
-
-// Private method:
-void ossimImageUtil::outputOverviewWriterTypes() const
-{
-   ossimNotify(ossimNotifyLevel_NOTICE)
-      << "\nValid overview types: " << std::endl;
-   
-   std::vector<ossimString> outputType;
-   
-   ossimOverviewBuilderFactoryRegistry::instance()->getTypeNameList(outputType);
-   std::copy(outputType.begin(),
-             outputType.end(),
-             std::ostream_iterator<ossimString>(ossimNotify(ossimNotifyLevel_NOTICE), "\t\n"));
-}
-
-// Private method:
-bool ossimImageUtil::isDirectoryBasedImage(const ossimImageHandler* ih) const
-{
-   bool result = false;
-   if ( ih )
-   {
-      // Get the image handler name.
-      ossimString imageHandlerName = ih->getClassName();
-      if ( (imageHandlerName == "ossimAdrgTileSource") ||
-           (imageHandlerName == "ossimCibCadrgTileSource") )  
-      {
-         result = true;
-      }
-   }
-   return result;
-}
-
-void ossimImageUtil::setCreateOverviewsFlag( bool flag )
-{
-   addOption( CREATE_OVERVIEWS_KW, ( flag ? TRUE_KW : FALSE_KW ) );
-}
-
-bool ossimImageUtil::createOverviews() const
-{
-   return  keyIsTrue( CREATE_OVERVIEWS_KW );
-}
-
-void ossimImageUtil::setRebuildOverviewsFlag( bool flag )
-{
-   addOption( REBUILD_OVERVIEWS_KW, ( flag ? TRUE_KW : FALSE_KW ) );
-   if ( flag )
-   {
-      setCreateOverviewsFlag( true ); // Turn on overview building.
-   }
-}
-
-bool ossimImageUtil::rebuildOverviews() const
-{
-   return keyIsTrue( REBUILD_OVERVIEWS_KW );
-}
-
-void ossimImageUtil::setRebuildHistogramFlag( bool flag )
-{
-   addOption( REBUILD_HISTOGRAM_KW, ( flag ? TRUE_KW : FALSE_KW ) );
-   if ( flag )
-   {
-      setCreateHistogramFlag( true ); // Turn on histogram building.
-   }
-}
-
-bool ossimImageUtil::rebuildHistogram() const
-{
-   return keyIsTrue( REBUILD_HISTOGRAM_KW );
-}
-
-void ossimImageUtil::setScanForMinMax( bool flag )
-{
-   addOption( SCAN_MIN_MAX_KW, ( flag ? TRUE_KW : FALSE_KW ) ); 
-}
-
-bool ossimImageUtil::scanForMinMax() const
-{
-   return keyIsTrue( SCAN_MIN_MAX_KW );
-}
-
-void ossimImageUtil::setScanForMinMaxNull( bool flag )
-{
-   addOption( SCAN_MIN_MAX_NULL_KW, ( flag ? TRUE_KW : FALSE_KW ) ); 
-}
-
-bool ossimImageUtil::scanForMinMaxNull() const
-{
-   return keyIsTrue( SCAN_MIN_MAX_NULL_KW );
-}
-
-void ossimImageUtil::setCompressionQuality( const std::string& quality )
-{
-   if ( quality.size() )
-   {
-      std::string key = WRITER_PROP_KW;
-      key += ossimString::toString( getNextWriterPropIndex() ).string();
-      std::string value = ossimKeywordNames::COMPRESSION_QUALITY_KW;
-      value += "=";
-      value += quality;
-      addOption( key, value );
-   }
-}
-
-void ossimImageUtil::setCompressionType(const std::string& type)
-{
-   if ( type.size() )
-   {
-      std::string key = WRITER_PROP_KW;
-      key += ossimString::toString( getNextWriterPropIndex() ).string();
-      std::string value = ossimKeywordNames::COMPRESSION_TYPE_KW;
-      value += "=";
-      value += type;
-      addOption( key, value );
-   }   
-}
-
-void ossimImageUtil::setCopyAllFlag( bool flag )
-{
-   // Add this for hasRequiredOverview method.
-   std::string key   = COPY_ALL_FLAG_KW;
-   std::string value = ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-
-   // Add as a writer prop:
-   key = WRITER_PROP_KW;
-   key += ossimString::toString( getNextWriterPropIndex() ).string();
-   value = COPY_ALL_FLAG_KW;
-   value += "=";
-   value += ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-}
-
-bool ossimImageUtil::getCopyAllFlag() const
-{
-   return keyIsTrue( COPY_ALL_FLAG_KW );
-}
-
-void ossimImageUtil::setDumpFilteredImageListFlag( bool flag )
-{
-   std::string key   = DUMP_FILTERED_IMAGES_KW;
-   std::string value = ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-}
-
-bool ossimImageUtil::getDumpFilterImagesFlag() const
-{
-   return keyIsTrue( DUMP_FILTERED_IMAGES_KW );
-}
-
-void ossimImageUtil::setInternalOverviewsFlag( bool flag )
-{
-   // Add this for hasRequiredOverview method.
-   std::string key   = INTERNAL_OVERVIEWS_FLAG_KW;
-   std::string value = ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-
-   // Add as a writer prop:
-   key = WRITER_PROP_KW;
-   key += ossimString::toString( getNextWriterPropIndex() ).string();
-   value = INTERNAL_OVERVIEWS_FLAG_KW;
-   value += "=";
-   value += ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-}
-
-bool ossimImageUtil::getInternalOverviewsFlag() const
-{
-   return keyIsTrue( INTERNAL_OVERVIEWS_FLAG_KW );
-}
-
-void ossimImageUtil::setOutputFileNamesFlag( bool flag )
-{
-   std::string key   = OUTPUT_FILENAMES_KW;
-   std::string value = ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-}
-
-bool ossimImageUtil::getOutputFileNamesFlag() const
-{
-   return keyIsTrue( OUTPUT_FILENAMES_KW );
-}
-
-void ossimImageUtil::setOverrideFilteredImagesFlag( bool flag )
-{
-   std::string key   = OVERRIDE_FILTERED_IMAGES_KW;
-   std::string value = ( flag ? TRUE_KW : FALSE_KW );
-   addOption( key, value );
-}
-
-bool ossimImageUtil::getOverrideFilteredImagesFlag() const
-{
-   return keyIsTrue( OVERRIDE_FILTERED_IMAGES_KW );
-}
-
-void ossimImageUtil::setOutputDirectory( const std::string& directory )
-{
-   std::string key = OUTPUT_DIRECTORY_KW;
-   addOption( key, directory );
-}
-   
-void ossimImageUtil::setOverviewType( const std::string& type )
-{
-   std::string key = OVERVIEW_TYPE_KW;
-   addOption( key, type );
-   setCreateOverviewsFlag( true ); // Assume caller wants overviews.
-}
-
-void ossimImageUtil::getOverviewType(std::string& type) const
-{
-   std::string lookup = m_kwl->findKey(OVERVIEW_TYPE_KW);
-   if ( lookup.size() )
-   {
-      type = lookup;
-   }
-   else
-   {
-      type = "ossim_tiff_box"; // default
-   }
-}
-
-void ossimImageUtil::setProps(ossimPropertyInterface* pi) const
-{
-   if ( pi )
-   {
-      ossimString baseKey;
-      if ( dynamic_cast<ossimImageHandler*>(pi) )
-      {
-         baseKey = READER_PROP_KW;
-      }
-      else
-      {
-         baseKey = WRITER_PROP_KW;
-      }
-      
-      ossim_uint32 propCount = m_kwl->numberOf( baseKey.c_str() );
-      if ( propCount )
-      {
-         ossim_uint32 foundProps = 0;
-         ossim_uint32 index = 0;
-         
-         // (propCount+100) is to allow for holes like reader_prop0, reader_prop2...
-         while ( (foundProps < propCount) && (index < (propCount+100) ) ) 
-         {
-            ossimString key = baseKey;
-            key += ossimString::toString(index);
-            std::string lookup = m_kwl->findKey( key.string() );
-            if ( lookup.size() )
-            {
-               ossimString value = lookup;
-               std::vector<ossimString> v = value.split("=");
-               if (v.size() == 2)
-               {
-                  ossimString propertyName  = v[0];
-                  ossimString propertyValue = v[1];
-                  ossimRefPtr<ossimProperty> p =
-                     new ossimStringProperty(propertyName, propertyValue);
-                  pi->setProperty( p );
-               }
-               ++foundProps;
-            }
-            ++index;
-         }
-      }
-   }
-}
-
-void ossimImageUtil::setOverviewStopDimension( ossim_uint32 dimension )
-{
-   addOption( OVERVIEW_STOP_DIM_KW, dimension );
-}
-
-void ossimImageUtil::setOverviewStopDimension( const std::string& dimension )
-{
-   addOption( OVERVIEW_STOP_DIM_KW, dimension );
-}
-
-void ossimImageUtil::setTileSize( ossim_uint32 tileSize )
-{
-   if ((tileSize % 16) == 0)
-   {
-      addOption( TILE_SIZE_KW, tileSize );
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE)
-         << "ossimImageUtil::setTileSize NOTICE:"
-         << "\nTile width must be a multiple of 16!"
-         << std::endl;
-   }
-}
-
-
-ossim_uint32 ossimImageUtil::getOverviewStopDimension() const
-{
-   ossim_uint32 result = 0;
-   std::string lookup = m_kwl->findKey( OVERVIEW_STOP_DIM_KW );
-   if ( lookup.size() )
-   {
-      result = ossimString(lookup).toUInt32();
-   }
-   return result;
-}
-
-void ossimImageUtil::setCreateHistogramFlag( bool flag )
-{
-   addOption( CREATE_HISTOGRAM_KW, ( flag ? TRUE_KW : FALSE_KW ) );
-}
-
-bool ossimImageUtil::createHistogram() const
-{
-   return keyIsTrue( CREATE_HISTOGRAM_KW );
-}
-
-void ossimImageUtil::setCreateHistogramFastFlag( bool flag )
-{
-   addOption( CREATE_HISTOGRAM_FAST_KW, ( flag ? TRUE_KW : FALSE_KW ) );
-}
-
-bool ossimImageUtil::createHistogramFast() const
-{
-   return keyIsTrue( CREATE_HISTOGRAM_FAST_KW );
-}
-
-void ossimImageUtil::setCreateHistogramR0Flag( bool flag )
-{
-   addOption( CREATE_HISTOGRAM_R0_KW, ( flag ? TRUE_KW : FALSE_KW ) );
-}
-
-bool ossimImageUtil::createHistogramR0() const
-{
-   return keyIsTrue( CREATE_HISTOGRAM_R0_KW );
-}
-
-bool ossimImageUtil::hasHistogramOption() const
-{
-   return ( createHistogram() || createHistogramFast() || createHistogramR0() );
-}
-
-bool ossimImageUtil::hasCmmOption() const
-{
-   return ( keyIsTrue( CMM_MAX_KW ) || keyIsTrue( CMM_MIN_KW )|| keyIsTrue( CMM_NULL_KW ) );
-}
-
-ossimHistogramMode ossimImageUtil::getHistogramMode() const
-{
-   ossimHistogramMode result = OSSIM_HISTO_MODE_UNKNOWN;
-   if ( createHistogram() || createHistogramR0() )
-   {
-      result = OSSIM_HISTO_MODE_NORMAL;
-   }
-   else if ( createHistogramFast() )
-   {
-      result = OSSIM_HISTO_MODE_FAST;
-   }
-   return result;
-}
-
-void ossimImageUtil::setNumberOfThreads( ossim_uint32 threads )
-{
-   addOption( THREADS_KW, threads );
-}
-
-void ossimImageUtil::setNumberOfThreads( const std::string& threads )
-{
-   addOption( THREADS_KW, threads );
-}
-
-ossim_uint32 ossimImageUtil::getNumberOfThreads() const
-{
-   ossim_uint32 result;
-   std::string lookup = m_kwl->findKey( THREADS_KW );
-   if ( lookup.size() )
-   {
-      result = ossimString(lookup).toUInt32();
-   }
-   else
-   {
-      result = ossim::getNumberOfThreads();
-   }
-   return result;
-}
-
-ossim_uint32 ossimImageUtil::getNextWriterPropIndex() const
-{
-   ossim_uint32 result = m_kwl->numberOf( WRITER_PROP_KW.c_str() );
-   if ( result )
-   {
-      ossim_uint32 foundProps = 0;
-      ossim_uint32 index = 0;
-
-      //---
-      // Loop until we find the last index used for WRITER_PROP_KW.
-      // (result+100) is to allow for holes like writer_prop0, writer_prop2...
-      //---
-      while ( (foundProps < result) && (index < (result+100) ) ) 
-      {
-         ossimString key = WRITER_PROP_KW;
-         key += ossimString::toString(index);
-         std::string lookup = m_kwl->findKey( key.string() );
-         if ( lookup.size() )
-         {
-            ++foundProps;
-         }
-         ++index;
-      }
-      result = index;
-   }
-   return result;
-}
-
-ossim_uint32 ossimImageUtil::getNextReaderPropIndex() const
-{
-   ossim_uint32 result = m_kwl->numberOf( READER_PROP_KW.c_str() );
-   if ( result )
-   {
-      ossim_uint32 foundProps = 0;
-      ossim_uint32 index = 0;
-      
-      //---
-      // Loop until we find the last index used for WRITER_PROP_KW.
-      // (result+100) is to allow for holes like reader_prop0, reader_prop2...
-      //---
-      while ( (foundProps < result) && (index < (result+100) ) ) 
-      {
-         ossimString key = READER_PROP_KW;
-         key += ossimString::toString(index);
-         std::string lookup = m_kwl->findKey( key.string() );
-         if ( lookup.size() )
-         {
-            ++foundProps;
-         }
-         ++index;
-      }
-      result = index;
-   }
-   return result;
-}
-
-void ossimImageUtil::addOption( const std::string& key, ossim_uint32 value )
-{
-   addOption( key, ossimString::toString( value ).string() );
-}
-
-void ossimImageUtil::addOption(  const std::string& key, const std::string& value )
-{
-   m_mutex.lock();
-   if ( m_kwl.valid() )
-   {
-      if ( key.size() && value.size() )
-      {
-         m_kwl->addPair( key, value );
-      }
-   }
-   m_mutex.unlock();
-}
-
-void ossimImageUtil::setErrorStatus( ossim_int32 status )
-{
-   m_mutex.lock();
-   m_errorStatus = status;
-   m_mutex.unlock();
-}
-
-bool ossimImageUtil::isFiltered(const ossimFilename& file) const
-{
-   bool result = false;
-   if ( file.size() )
-   {
-      // Strip full path to base name.
-      std::string baseName = file.file().string();
-      if ( baseName.size() )
-      {
-         std::vector<std::string>::const_iterator i = m_filteredImages.begin();
-         while ( i != m_filteredImages.end() )
-         {
-            if ( baseName == (*i) )
-            {
-               result = true;
-               break;
-            }
-            ++i;
-         }
-      }
-   }
-#if 0 /* Please leave for debug. (drb) */
-   if(traceDebug())
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "ossimFileWalker::isFiltered file " << (result?"filtered: ":"not filtered: ")
-         << file << "\n";
-   }
-#endif
-   
-   return result;
-}
-
-bool ossimImageUtil::keyIsTrue( const std::string& key ) const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      std::string value = m_kwl->findKey( key );
-      if ( value.size() )
-      {
-         result = ossimString(value).toBool();
-      }
-   }
-   return result;
-}
-
-const std::vector<std::string>& ossimImageUtil::getFilteredImages() const
-{
-   return m_filteredImages;
-}
-
-std::vector<std::string>& ossimImageUtil::getFilteredImages()
-{
-   return m_filteredImages;
-}
-
-void ossimImageUtil::initializeDefaultFilterList()
-{
-   m_mutex.lock();
-
-   // Common images to filter out, put most common first.
-   m_filteredImages.push_back(std::string("icon.jpg"));
-   m_filteredImages.push_back(std::string("logo.jpg"));
-   m_filteredImages.push_back(std::string("preview.jpg"));
-   
-   m_mutex.unlock();
-}
-
-void ossimImageUtil::dumpFilteredImageList() const
-{
-   ossimNotify(ossimNotifyLevel_NOTICE) << "Filtered image list:\n";
-   std::vector<std::string>::const_iterator i = m_filteredImages.begin();
-   while ( i != m_filteredImages.end() )
-   {
-      ossimNotify(ossimNotifyLevel_NOTICE) << (*i) << "\n";
-      ++i;
-   }
-   ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
-}
-
-void ossimImageUtil::executePrepCommands() const
-{
-   std::string prefix = "prep.";
-   ossimFilename file = "";
-   executeCommands( prefix, file );
-}
-
-void ossimImageUtil::executeFileCommands( const ossimFilename& file ) const
-{
-   std::string prefix = "file.";
-   executeCommands( prefix, file ); 
-}
-
-void ossimImageUtil::executePostCommands() const
-{
-   std::string prefix = "post.";
-   ossimFilename file = "";
-   executeCommands( prefix, file );   
-}
-
-void ossimImageUtil::executeCommands(
-   const std::string& prefix, const ossimFilename& file  ) const
-{
-   const std::string BASE_KEY = "command";
-   
-   // Get the number of test:
-   const std::string REG_EXP_STR = prefix + BASE_KEY + std::string("[0-9]+");
-   const ossim_uint32 NUM_COMMANDS = m_kwl->getNumberOfSubstringKeys(REG_EXP_STR);
-   if ( NUM_COMMANDS )
-   {
-      const ossim_uint32 MAX_INDEX = NUM_COMMANDS + 1000; // for skipage...
-      ossim_uint32 index = 0;
-      ossim_uint32 processedIndexes = 0;
-      std::string commandKey;
-      ossimString command;
-
-      while ( processedIndexes < MAX_INDEX )
-      {
-         commandKey = prefix + BASE_KEY + ossimString::toString( index++ ).string();
-         command.string() = m_kwl->findKey( commandKey );
-
-         if ( command.size() )
-         {
-            substituteCommandString( file, prefix, commandKey, command );
-
-            ossimNotify( ossimNotifyLevel_NOTICE )
-               << "executing_command: " << command << std::endl;
-            
-            // Launch the command:
-            int status = system( command.c_str() );
-
-            ossimNotify( ossimNotifyLevel_NOTICE )
-               << "return_status: " << status << std::endl;
-            
-            ++processedIndexes;
-
-            if ( processedIndexes == NUM_COMMANDS )
-            {
-               break;
-            }
-         }
-      }
-   }
-}
-
-void ossimImageUtil::substituteCommandString(
-   const ossimFilename& file,
-   const std::string& prefix,
-   const std::string& commandKey,
-   ossimString& command ) const
-{
-   // Expand any environment vars, e.g. $(env_var_name):
-   command.expandEnvironmentVariable();
-
-   gsubDate( commandKey, command );
-
-   if ( prefix == "file." )
-   {
-      substituteFileStrings( file, command );
-   }
-}
-
-void ossimImageUtil::substituteFileStrings( const ossimFilename& file,
-                                            ossimString& command ) const
-{
-   const std::string BASENAME_VARIABLE = "%{basename}";
-   command.gsub( BASENAME_VARIABLE, file.file().string() );
-   
-   const std::string BASENAME_NO_EXT_VARIABLE = "%{basename_no_ext}";
-   command.gsub( BASENAME_NO_EXT_VARIABLE, file.file().string() );
-
-   const std::string DIRNAME_VARIABLE = "%{dirname}";
-   command.gsub( DIRNAME_VARIABLE, file.path().string() );
-
-   const std::string FILE_VARIABLE = "%{file}";
-   command.gsub( FILE_VARIABLE, file.string(), true );
-
-   const std::string FILE_NO_EXT_VARIABLE = "%{file_no_ext}";
-   command.gsub( FILE_NO_EXT_VARIABLE, file.noExtension().string(), true );
-}
-
-void ossimImageUtil::gsubDate( const std::string& commandKey,
-                               ossimString& command ) const
-{
-   // Date:
-   const std::string DATE_VARIABLE = "%{date}";
-   if ( command.find( DATE_VARIABLE ) )
-   {
-      std::string key = ".strf_time_format";
-      std::string strfTimeFormat = m_kwl->findKey( commandKey, key );
-      if ( strfTimeFormat.empty() )
-      {
-         // yyyymmdd
-         strfTimeFormat = "%Y%m%d";
-      }
-      
-      //---
-      // Get the date as a string, e.g 20150411.
-      // true for gmt time.
-      //---
-      std::string date;
-      ossim::getFormattedTime( strfTimeFormat, true, date );
-      
-      if ( date.size() )
-      {
-         // Sustitute:
-         command.gsub( DATE_VARIABLE, date, true );
-      }
-   }
-}
-
-   
-
diff --git a/ossim/src/ossim/util/ossimInfo.cpp b/ossim/src/ossim/util/ossimInfo.cpp
deleted file mode 100644
index 831a900..0000000
--- a/ossim/src/ossim/util/ossimInfo.cpp
+++ /dev/null
@@ -1,2772 +0,0 @@
-//----------------------------------------------------------------------------
-// File: ossimInfo.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: ossimInfo class definition
-//
-// Utility class for getting information from the ossim library.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossimInfo.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/util/ossimInfo.h>
-#include <ossim/ossimVersion.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimContainerProperty.h>
-#include <ossim/base/ossimDatum.h>
-#include <ossim/base/ossimDatumFactoryRegistry.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimEllipsoid.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/base/ossimGeoidManager.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/plugin/ossimSharedPluginRegistry.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/support_data/ossimInfoBase.h>
-#include <ossim/support_data/ossimInfoFactoryRegistry.h>
-#include <ossim/support_data/ossimSupportFilesList.h>
-
-#include <iomanip>
-#include <sstream>
-#include <vector>
-
-static const char BUILD_DATE_KW[]           = "build_date";
-static const char CENTER_GROUND_KW[]        = "center_ground";
-static const char CENTER_IMAGE_KW[]         = "center_image";
-static const char CONFIGURATION_KW[]        = "configuration";
-static const char DATUMS_KW[]               = "datums";
-static const char DEG2RAD_KW[]              = "deg2rad";
-static const char DUMP_KW[]                 = "dump";
-static const char DUMP_NO_OVERVIEWS_KW[]    = "dump_no_overviews";
-static const char FACTORIES_KW[]            = "factories";
-static const char FACTORY_KEYWORD_LIST_KW[] = "factory_keyword_list";
-static const char FACTORY_OBJECT_KW[]       = "factory_object";
-static const char FACTORY_TYPE_KW[]         = "factory_type";
-static const char FORMAT_KW[]               = "format"; 
-static const char FT2MTRS_KW[]              = "ft2mtrs";
-static const char FT2MTRS_US_SURVEY_KW[]    = "ft2mtrs_us_survey";
-static const char GEOM_INFO_KW[]            = "geometry_info";
-static const char HEIGHT_KW[]               = "height";
-static const char IMAGE_CENTER_KW[]         = "image_center";
-static const char IMAGE_FILE_KW[]           = "image_file";
-static const char IMAGE_INFO_KW[]           = "image_info";
-static const char IMAGE_RECT_KW[]           = "image_rect";
-static const char METADATA_KW[]             = "metadata";
-static const char MTRS2FT_KW[]              = "mtrs2ft";
-static const char MTRS2FT_US_SURVEY_KW[]    = "mtrs2ft_us_survey";
-static const char MTRSPERDEG_KW[]           = "mtrs_per_deg";
-static const char NORTH_UP_KW[]             = "north_up_angle";
-static const char OUTPUT_FILE_KW[]          = "output_file";
-static const char OSSIM_LOGFILE_KW[]        = "ossim_logfile";
-static const char OVERVIEW_TYPES_KW[]       = "overview_types";
-static const char OVERWRITE_KW[]            = "overwrite";
-static const char PALETTE_KW[]              = "palette";
-static const char PLUGINS_KW[]              = "plugins";
-static const char PLUGIN_TEST_KW[]          = "plugin_test";
-static const char PROJECTIONS_KW[]          = "projections";
-static const char RAD2DEG_KW[]              = "rad2deg";
-static const char READER_PROPS_KW[]         = "reader_props";
-static const char RESAMPLER_FILTERS_KW[]    = "resampler_filters";
-static const char REVISION_NUMBER_KW[]      = "revision_number";
-static const char UP_IS_UP_KW[]             = "up_is_up_angle";
-static const char VERSION_KW[]              = "version";
-static const char WRITERS_KW[]              = "writers_kw";
-static const char WRITER_PROPS_KW[]         = "writer_props";
-static const char ZOOM_LEVEL_GSDS_KW[]      = "zoom_level_gsds";
-
-// Static trace for debugging.  Use -T ossimInfo to turn on.
-static ossimTrace traceDebug = ossimTrace("ossimInfo:debug");
-
-ossimInfo::ossimInfo() :
-   m_kwl(new ossimKeywordlist()),
-   m_img(0)
-{
-}
-
-ossimInfo::~ossimInfo()
-{
-}
-
-void ossimInfo::addArguments(ossimArgumentParser& ap)
-{
-   // Set the general usage:
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options] <optional-image>";
-   au->setCommandLineUsage(usageString);
-
-   // Set the command line options:
-   au->addCommandLineOption("--build-date", "Build date of code.");
-   
-   au->addCommandLineOption("-c", "Will print ground and image center.");
-
-   au->addCommandLineOption("--cg", "Will print out ground center.");
-
-   au->addCommandLineOption("--ci", "Will print out image center.");
-
-   au->addCommandLineOption("--config", "Displays configuration info.");
-
-   au->addCommandLineOption("-d", "A generic dump if one is available.");
-
-   au->addCommandLineOption("--datums", "Prints datum list.");   
-
-   au->addCommandLineOption("--deg2rad", "<degrees> Gives radians from degrees.");
-   
-   au->addCommandLineOption("--dno", "A generic dump if one is available.  This option ignores overviews.");
-   
-   au->addCommandLineOption("-f", "<format> Will output the information specified format [KWL | XML].  Default is KWL.");   
-
-   au->addCommandLineOption("--factories", "<keyword_list_flag> Prints factory list.  If keyword_list_flag is true, the result of a saveState will be output for each object.");
-   
-   au->addCommandLineOption("--ft2mtrs", "<feet> Gives meters from feet (0.3048 meters per foot).");
-   
-   au->addCommandLineOption("--ft2mtrs-us-survey", "<feet> Gives meters from feet (0.3048006096 meters per foot).");
-   
-   au->addCommandLineOption("-h", "Display this information");
-
-   au->addCommandLineOption("--height", "<latitude-in-degrees> <longitude-in-degrees> Returns the MSL and ellipoid height given a latitude longitude position.");
-
-   au->addCommandLineOption("-i", "Will print out the general image information.");
-   
-   au->addCommandLineOption("-m", "Will print out meta data image information.");
-
-   au->addCommandLineOption("--mtrsPerDeg", "<latitude> Gives meters per degree and meters per minute for a given latitude.");
-   
-   au->addCommandLineOption("--mtrs2ft", "<meters> Gives feet from meters (0.3048 meters per foot).");
-
-   au->addCommandLineOption("--mtrs2ft-us-survey", "<meters> Gives feet from meters (0.3048006096 meters per foot).");
-
-   au->addCommandLineOption("-n or --north-up", "Rotation angle to North for an image.");
-   
-   au->addCommandLineOption("-o", "<output-file> Will output the information to the file specified.  Default is to standard out.");
-
-   au->addCommandLineOption("--overview-types", "Prints overview builder types.");
-   
-   au->addCommandLineOption("-p", "Will print out the image projection information.");
-   
-   au->addCommandLineOption("--palette", "Will print out the color palette if one exists.");
-
-   au->addCommandLineOption("--plugins", "Prints plugin list.");
-   
-   au->addCommandLineOption("--plugin-test", "Test plugin passed to option.");
-   
-   au->addCommandLineOption("--projections", "Prints projections.");
-   
-   au->addCommandLineOption("-r", "Will print image rectangle.");
-
-   au->addCommandLineOption("--rad2deg", "<radians> Gives degrees from radians.");
-
-   au->addCommandLineOption("--reader-props", "Prints readers and properties.");
-
-   au->addCommandLineOption("--resampler-filters", "Prints resampler filter list.");
-
-   au->addCommandLineOption("--revision-number", "Revision number of code.");
-   
-   au->addCommandLineOption("-s", "Force the ground rect to be the specified datum");
-   
-   au->addCommandLineOption("-u or --up-is-up", "Rotation angle to \"up is up\" for an image.\nWill return 0 if image's projection is not affected by elevation.");
-
-   au->addCommandLineOption("-v", "Overwrite existing geometry.");
-
-   au->addCommandLineOption("-V or --vesion", "Version of code, e.g. 1.8.20");
-   
-   au->addCommandLineOption("--writer-props", "Prints writers and properties.");
-
-   au->addCommandLineOption("--writers", "Prints list of available writers.");
-
-   au->addCommandLineOption("--zoom-level-gsds", "Prints zoom level gsds for projections EPSG:4326 and EPSG:3857.");
-   
-} // void ossimInfo::addArguments(ossimArgumentParser& ap)
-
-bool ossimInfo::initialize(ossimArgumentParser& ap)
-{
-   static const char M[] = "ossimInfo::initialize(ossimArgumentParser&)";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
-   }
-
-   bool result = true;
-
-   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
-   {
-      usage(ap);
-
-      // continue_after_init to false
-      result = false;
-   }
-   else
-   {
-      //---
-      // Start with clean options keyword list.
-      //---
-      m_kwl->clear();
-
-      bool requiresInputImage = false;
-      
-      while ( 1 ) //  While forever loop...
-      {
-         // Used throughout below:
-         std::string ts1;
-         ossimArgumentParser::ossimParameter sp1(ts1);
-         std::string ts2;
-         ossimArgumentParser::ossimParameter sp2(ts2);
-         const char TRUE_KW[] = "true";
-         
-         if( ap.read("--build-date") )
-         {
-            m_kwl->add( BUILD_DATE_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-c") )
-         {
-            m_kwl->add( IMAGE_CENTER_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--cg") )
-         {
-            m_kwl->add( CENTER_GROUND_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--ci") )
-         {
-            m_kwl->add( CENTER_IMAGE_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--config") || ap.read("--configuration") )
-         {
-            m_kwl->add( CONFIGURATION_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--datums") )
-         {
-            m_kwl->add( DATUMS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--deg2rad", sp1) )
-         {
-            m_kwl->add( DEG2RAD_KW, ts1.c_str() );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         if( ap.read("-d") )
-         {
-            m_kwl->add( DUMP_KW, TRUE_KW );
-            requiresInputImage = true;
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--dno") )
-         {
-            m_kwl->add( DUMP_KW, TRUE_KW );
-            m_kwl->add( DUMP_NO_OVERVIEWS_KW, TRUE_KW );
-            requiresInputImage = true;
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-f", sp1) )
-         {
-            m_kwl->add( FORMAT_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--factories", sp1) )
-         {
-            m_kwl->add( FACTORIES_KW, TRUE_KW);
-            m_kwl->add( FACTORY_KEYWORD_LIST_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--ft2mtrs", sp1) )
-         {
-            m_kwl->add( FT2MTRS_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--ft2mtrs-us-survey", sp1) )
-         {
-            m_kwl->add( FT2MTRS_KW, ts1.c_str());
-            m_kwl->add( FT2MTRS_US_SURVEY_KW, TRUE_KW);
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--height", sp1, sp2) )
-         {
-            ossimString lat = ts1;
-            ossimString lon = ts2;
-            ossimGpt gpt;
-            gpt.lat = lat.toFloat64();
-            gpt.lon = lon.toFloat64();
-            m_kwl->add( HEIGHT_KW, gpt.toString().c_str() );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("-i") )
-         {
-            m_kwl->add( IMAGE_INFO_KW, TRUE_KW );
-            requiresInputImage = true;
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-m") )
-         {
-            m_kwl->add( METADATA_KW, TRUE_KW );
-            requiresInputImage = true;
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--mtrs2ft", sp1) )
-         {
-            m_kwl->add( MTRS2FT_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--mtrs2ft-us-survey", sp1) )
-         {
-            m_kwl->add( MTRS2FT_KW, ts1.c_str());
-            m_kwl->add( MTRS2FT_US_SURVEY_KW, TRUE_KW);
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("--mtrsPerDeg", sp1) )
-         {
-            m_kwl->add( MTRSPERDEG_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-n") || ap.read("--north-up") )
-         {
-            m_kwl->add( NORTH_UP_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-o", sp1) )
-         {
-            m_kwl->add( OUTPUT_FILE_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--overview-types") )
-         {
-            m_kwl->add( OVERVIEW_TYPES_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-p") )
-         {
-            m_kwl->add( GEOM_INFO_KW, TRUE_KW );
-            requiresInputImage = true;
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("--palette") )
-         {
-            m_kwl->add( PALETTE_KW, TRUE_KW );
-            requiresInputImage = true;
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--plugins") )
-         {
-            m_kwl->add( PLUGINS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--plugin-test", sp1) )
-         {
-            m_kwl->add( PLUGIN_TEST_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--projections") )
-         {
-            m_kwl->add( PROJECTIONS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-r") )
-         {
-            m_kwl->add( IMAGE_RECT_KW, TRUE_KW );
-            requiresInputImage = true;
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--rad2deg", sp1) )
-         {
-            m_kwl->add( RAD2DEG_KW, ts1.c_str());
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--reader-props") )
-         {
-            m_kwl->add( READER_PROPS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("--resampler-filters") )
-         {
-            m_kwl->add( RESAMPLER_FILTERS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--revision-number") )
-         {
-            m_kwl->add( REVISION_NUMBER_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("-u") || ap.read("--up-is-up") )
-         {
-            m_kwl->add( UP_IS_UP_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("-v") )
-         {
-            m_kwl->add( OVERWRITE_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--version") || ap.read("-V") )
-         {
-            m_kwl->add( VERSION_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("--writer-props") )
-         {
-            m_kwl->add( WRITER_PROPS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-
-         if( ap.read("--writers") )
-         {
-            m_kwl->add( WRITERS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-         
-         if( ap.read("--zoom-level-gsds") )
-         {
-            m_kwl->add( ZOOM_LEVEL_GSDS_KW, TRUE_KW );
-            if ( ap.argc() < 2 )
-            {
-               break;
-            }
-         }
-        
-         // End of arg parsing.
-         ap.reportRemainingOptionsAsUnrecognized();
-         if ( ap.errors() )
-         {
-            ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
-            std::string errMsg = "Unknown option...";
-            throw ossimException(errMsg);
-         }
-
-         break; // Break from while forever.
-         
-      } // End while (forever) loop.
-
-      if ( ap.argc() == 2 )
-      {
-         m_kwl->add( IMAGE_FILE_KW, ap[1]  );
-      }
-
-      if ( requiresInputImage && ( ap.argc() == 1 ) )
-      {
-         usage(ap);
-         
-         // continue_after_init to false
-         result = false;
-      }
-
-   } // not usage
-         
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "m_kwl:\n" << *(m_kwl.get()) << "\n"
-         << M << " exit result = " << (result?"true":"false")
-         << "\n";
-   }
-   
-   return result;
-}
-
-void ossimInfo::execute()
-{
-   static const char M[] = "ossimInfo::execute()";
-   
-   const ossim_uint32 KEY_COUNT = m_kwl->getSize();
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << M << " entered..."
-         << "\nMap size: " << KEY_COUNT << "\n";
-   }
-
-   if ( KEY_COUNT )
-   {
-      ossim_uint32 consumedKeys = 0;
-   
-      const char* lookup;
-
-      lookup = m_kwl->find(IMAGE_FILE_KW);
-      if ( lookup )
-      {
-         ++consumedKeys;
-         ossimFilename image = lookup;
-
-         consumedKeys += executeImageOptions(image);
-      }
-
-      if ( consumedKeys < KEY_COUNT )
-      {
-         ossimString value;
-
-         if ( keyIsTrue( std::string(BUILD_DATE_KW)) )
-         {
-            getBuildDate( value.string() );
-            ossimNotify(ossimNotifyLevel_INFO)
-               << BUILD_DATE_KW << ": " << value << "\n";
-         }
-         
-         lookup = m_kwl->find(CONFIGURATION_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printConfiguration();
-            }
-         }
-   
-         lookup = m_kwl->find(DATUMS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printDatums();
-            }
-         }
-
-         lookup = m_kwl->find(DEG2RAD_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            deg2rad( value.toFloat64() );
-         }
-
-         lookup = m_kwl->find(FACTORIES_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            ossimString factories = lookup;
-            bool keywordListFlag = false;
-            lookup = m_kwl->find(FACTORY_KEYWORD_LIST_KW);
-            if ( lookup )
-            {
-               ++consumedKeys;
-               keywordListFlag = ossimString(lookup).toBool();
-            }
-            printFactories(keywordListFlag);
-         }
-
-         lookup = m_kwl->find(FT2MTRS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            bool us_survey = false;
-            lookup = m_kwl->find(FT2MTRS_US_SURVEY_KW);
-            if ( lookup )
-            {
-               ++consumedKeys;
-               us_survey = ossimString(lookup).toBool();
-            }
-            ft2mtrs( value.toFloat64(), us_survey);
-         }
-
-         lookup = m_kwl->find(HEIGHT_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            ossimGpt gpt;
-            gpt.toPoint(value);
-            outputHeight(gpt);
-         }
-
-         lookup = m_kwl->find(MTRS2FT_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            bool us_survey = false;
-            lookup = m_kwl->find(MTRS2FT_US_SURVEY_KW);
-            if ( lookup )
-            {
-               ++consumedKeys;
-               us_survey = ossimString(lookup).toBool();
-            }
-            mtrs2ft( value.toFloat64(), us_survey);
-         }
-
-         lookup = m_kwl->find(MTRSPERDEG_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            mtrsPerDeg( value.toFloat64() );
-         }
-
-         lookup = m_kwl->find(OVERVIEW_TYPES_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printOverviewTypes();
-            }
-         }
-
-         lookup = m_kwl->find(PLUGINS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printPlugins();
-            }
-         }
-
-         lookup = m_kwl->find(PLUGIN_TEST_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            testPlugin(value);
-         }
-
-         lookup = m_kwl->find(PROJECTIONS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printProjections();
-            }
-         }
-
-         lookup = m_kwl->find(RAD2DEG_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            rad2deg( value.toFloat64() );
-         }
-
-         lookup = m_kwl->find(READER_PROPS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printReaderProps();
-            }
-         }
-   
-         lookup = m_kwl->find(RESAMPLER_FILTERS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printResamplerFilters();
-            }
-         }
-
-         if ( keyIsTrue( std::string(REVISION_NUMBER_KW) ) )
-         {
-            getRevisionNumber( value.string() );
-            ossimNotify(ossimNotifyLevel_INFO)
-               << REVISION_NUMBER_KW << ": " << value << "\n";
-         }
-
-         if ( keyIsTrue( std::string(VERSION_KW) ) )
-         {
-            getVersion( value.string() );
-            ossimNotify(ossimNotifyLevel_INFO)
-               << VERSION_KW << ": " << value << "\n";
-         }
-
-         lookup = m_kwl->find(WRITERS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printWriters();
-            }
-         }
-
-         lookup = m_kwl->find(WRITER_PROPS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printWriterProps();
-            }
-         }
-
-         lookup = m_kwl->find(ZOOM_LEVEL_GSDS_KW);
-         if ( lookup )
-         {
-            ++consumedKeys;
-            value = lookup;
-            if ( value.toBool() )
-            {
-               printZoomLevelGsds();
-            }
-         }
-         
-      } // if ( consumedKeys < KEY_COUNT )
-
-      if ( traceDebug() )
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "KEY_COUNT:    " << KEY_COUNT
-            << "\nconsumedKeys: " << consumedKeys << "\n";
-      }
-         
-   } // if ( KEY_COUNT )
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
-   }
-}
-
-ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
-{
-   static const char M[] = "ossimInfo::executeImageOptions()";
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\nfile: " << file << "\n";
-   }
-
-   // Output keyword list.
-   ossimKeywordlist okwl;
-
-   ossim_uint32 consumedKeys = 0;
-   const char* lookup = 0;
-   ossimString value  = "";
-   
-   bool dnoFlag       = false;
-   bool overwriteFlag = false;   
-   bool xmlOutFlag    = false;
-
-   lookup = m_kwl->find( OVERWRITE_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      overwriteFlag = value.toBool();
-   }
-   
-   // Check for xml format option.
-   lookup = m_kwl->find( FORMAT_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      ossimString format = lookup;
-      if ( format.upcase() == "XML" )
-      {
-         xmlOutFlag = true;
-      }
-   }
-
-   lookup = m_kwl->find( OUTPUT_FILE_KW );
-   ossimFilename outputFile;
-   if ( lookup )
-   {
-      ++consumedKeys;
-      outputFile = lookup;
-   }
-   
-   // Check for dump.  Does not require image to be opened.
-   lookup = m_kwl->find( DUMP_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      lookup = m_kwl->find( DUMP_NO_OVERVIEWS_KW );
-      if ( lookup )
-      {
-         ++consumedKeys;
-         value = lookup;
-         dnoFlag = value.toBool();
-      }
-
-      if ( !xmlOutFlag && ( outputFile == ossimFilename::NIL ) )
-      {
-         //---
-         // Write to standard out:
-         // This dump will come out in order so is preferred over going to
-         // okwl(output keyword list) which will come out alphabetical.
-         //---
-         dumpImage(file, dnoFlag);
-      }
-      else
-      {
-         // Save to output keyword list. Will be output later.
-         dumpImage(file, dnoFlag, okwl);
-      }
-   }
-   
-   bool centerGroundFlag = false;
-   bool centerImageFlag  = false;
-   bool imageCenterFlag  = false;
-   bool imageGeomFlag    = false;
-   bool imageInfoFlag    = false;
-   bool imageRectFlag    = false;
-   bool metaDataFlag     = false;
-   bool northUpFlag      = false;
-   bool paletteFlag      = false;
-   bool upIsUpFlag       = false;
-   
-   // Center Ground:
-   lookup = m_kwl->find( CENTER_GROUND_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      centerGroundFlag = value.toBool();
-   }
-
-   // Center Image:
-   lookup = m_kwl->find( CENTER_IMAGE_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      centerImageFlag = value.toBool();
-   }
-
-   // Metadata:
-   lookup = m_kwl->find( METADATA_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      metaDataFlag = value.toBool();
-   }
-   
-   // Palette:
-   lookup = m_kwl->find( PALETTE_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      paletteFlag = value.toBool();
-   }
-
-   // Image center:
-   lookup = m_kwl->find( IMAGE_CENTER_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      imageCenterFlag = value.toBool();
-   }
-
-   // Image rect:
-   lookup = m_kwl->find( IMAGE_RECT_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      imageRectFlag = value.toBool();
-   }
-   
-   //---
-   // General image info:
-   // Defaulted ON if no image options set.
-   //---
-   lookup = m_kwl->find( IMAGE_INFO_KW ); 
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      imageInfoFlag = value.toBool();
-   }
-   
-   //---
-   // Image geometry info:
-   // Defaulted on if no image options set.
-   //---
-   lookup = m_kwl->find( GEOM_INFO_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      imageGeomFlag = value.toBool();
-   }      
-
-   // North up:
-   lookup = m_kwl->find( NORTH_UP_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      northUpFlag = value.toBool();
-   }
-
-   // Up is up:
-   lookup = m_kwl->find( UP_IS_UP_KW );
-   if ( lookup )
-   {
-      ++consumedKeys;
-      value = lookup;
-      upIsUpFlag = value.toBool();
-   }
-   
-   // If no options consumed default is image info and geom info:
-   if ( consumedKeys == 0 )
-   {
-      imageInfoFlag = true;
-      imageGeomFlag = true;
-   }
-
-   if ( centerGroundFlag || centerImageFlag || imageCenterFlag || imageRectFlag ||
-        metaDataFlag || paletteFlag || imageInfoFlag || imageGeomFlag ||
-        northUpFlag || upIsUpFlag )
-   {
-      // Requires open image.
-      if ( m_img.valid() == false )
-      {
-         openImage(file);
-      }
-
-      if ( centerGroundFlag )
-      {
-         getCenterGround(okwl);
-      }
-
-      if ( centerImageFlag )
-      {
-         getCenterImage(okwl);
-      }
-
-      if ( imageCenterFlag )
-      {
-         getCenterGround(okwl);
-         getCenterImage(okwl);
-      }
-
-      if ( imageRectFlag )
-      {
-         getImageRect(okwl);
-      }
-    
-      if ( metaDataFlag )
-      {
-         getImageMetadata(okwl);
-      }
-      
-      if ( paletteFlag )
-      {
-         getImagePalette(okwl);
-      }
-      
-      if ( imageInfoFlag )
-      {
-         getImageInfo(okwl, dnoFlag);
-      }
-      
-      if ( imageGeomFlag )
-      {
-         getImageGeometryInfo(okwl, dnoFlag);
-      }
-
-      if ( imageRectFlag )
-      {
-         getImageRect(okwl);
-      }
-
-      if ( northUpFlag )
-      {
-         getNorthUpAngle( okwl );
-      }
-      
-      if ( upIsUpFlag )
-      {
-         getUpIsUpAngle( okwl );
-      }
-      
-   } // if ( metaDataFlag || paletteFlag || imageInfoFlag || imageGeomFlag )
-   
-   if ( okwl.getSize() ) // Output section:
-   {
-      if ( outputFile == ossimFilename::NIL )
-      {
-         // Write to standard out:
-         if ( !xmlOutFlag )
-         {
-            ossimNotify(ossimNotifyLevel_INFO) << okwl << std::endl;
-         }
-         else
-         {
-            outputXml( okwl );
-         }
-      }
-      else
-      {
-         // Write to file:
-         
-         if ( !overwriteFlag && outputFile.exists() )
-         {
-            ossimNotify(ossimNotifyLevel_INFO)
-               << "ERROR: File already exists: "  << outputFile
-               << "\nUse -v option to overwrite."
-               << std::endl;
-         }
-         else
-         {
-            if ( !xmlOutFlag )
-            {
-               okwl.write( outputFile );
-            }
-            else
-            {
-               outputXml( okwl, outputFile );
-            }
-         }
-      }
-      
-   } // if ( okwl )
-   
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "consumedKeys: " << consumedKeys << "\n"
-         << M << " exited...\n";
-   }
-   
-   return consumedKeys;
-   
-} // ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
-
-void ossimInfo::getImageInfo( const ossimFilename& file,
-                              bool dumpFlag,
-                              bool dnoFlag,
-                              bool imageGeomFlag,
-                              bool imageInfoFlag,
-                              bool metaDataFlag,
-                              bool paletteFlag,
-                              ossimKeywordlist& kwl ) const
-{
-   if ( dumpFlag || dnoFlag )
-   {
-      dumpImage(file, dnoFlag, kwl);
-   }
-
-   // These flags requires open image.
-   if ( imageGeomFlag || imageInfoFlag || metaDataFlag || paletteFlag )
-   {
-      // Note: openImageHandler throws ossimException if it can't open.
-      ossimRefPtr<ossimImageHandler> ih = openImageHandler( file );
-      if ( ih.valid() )
-      {
-         if ( metaDataFlag )
-         {
-            getImageMetadata( ih.get(), kwl );
-         }
-         if ( paletteFlag )
-         {
-            getImagePalette( ih.get(), kwl );
-         }
-         if ( imageInfoFlag )
-         {
-            getImageInfo( ih.get(), kwl, dnoFlag );
-         }
-         if ( imageGeomFlag )
-         {
-            getImageGeometryInfo( ih.get(), kwl, dnoFlag) ;
-         }
-      }
-   }
-}
- 
-bool ossimInfo::getImageInfo( const ossimFilename& file,
-                              ossim_uint32 entry,
-                              ossimKeywordlist& kwl ) const
-{
-   bool result = false;
-   
-   // Note: openImageHandler throws ossimException if it can't open.
-   ossimRefPtr<ossimImageHandler> ih = openImageHandler( file );
-   if ( ih.valid() )
-   {
-      if ( ih->setCurrentEntry( entry ) )
-      {
-         if ( getImageInfo( ih.get(), entry, kwl, false ) )
-         {
-            result = getImageGeometryInfo( ih.get(), entry, kwl, false );
-         }
-      }
-      else
-      {
-         std::ostringstream errMsg;
-         errMsg << "ossimInfo::getImageInfo ERROR:\nInvalid entry: " << entry
-                << "\n";
-         throw ossimException( errMsg.str() );
-      }
-   }
-
-   return result;
-}
-
-void ossimInfo::openImage(const ossimFilename& file)
-{
-   m_img = openImageHandler( file );
-}
-
-ossimRefPtr<ossimImageHandler> ossimInfo::openImageHandler(const ossimFilename& file) const
-{
-   ossimRefPtr<ossimImageHandler> result = ossimImageHandlerRegistry::instance()->open(file);
-   if ( result.valid() == false )
-   {
-      std::string errMsg = "ossimInfo::openImage ERROR:\nCould not open: ";
-      errMsg += file.string();
-      throw ossimException(errMsg);
-   }
-   return result;
-}
-
-void ossimInfo::closeImage()
-{
-   m_img = 0;
-}
-
-ossimRefPtr<ossimImageHandler> ossimInfo::getImageHandler()
-{
-   return m_img;
-}
-
-void ossimInfo::dumpImage(const ossimFilename& file, bool dnoFlag) const
-{
-   ossimRefPtr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(file);
-   if (info.valid())
-   {
-      if (dnoFlag) // Default info processes overviews.
-      {
-         info->setProcessOverviewFlag(false);
-      }
-      info->print(ossimNotify(ossimNotifyLevel_INFO));
-      info = 0;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "No dump available for:  " << file.c_str() << std::endl;
-   }
-}
-
-void ossimInfo::dumpImage(const ossimFilename& file,
-                          bool dnoFlag,
-                          ossimKeywordlist& kwl) const
-{
-   ossimRefPtr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(file);
-   if (info.valid())
-   {
-      if (dnoFlag) // Default info processes overviews.
-      {
-         info->setProcessOverviewFlag(false);
-      }
-      info->getKeywordlist(kwl);
-      info = 0;
-   }
-   else
-   {
-      ossimNotify(ossimNotifyLevel_INFO)
-         << "No dump available for:  " << file.c_str() << std::endl;
-   }
-}
-void ossimInfo::getImageMetadata(ossimKeywordlist& kwl) const
-{
-   if ( m_img.valid() )
-   {
-      getImageMetadata( m_img.get(), kwl);
-   }
-}
-
-void ossimInfo::getImageMetadata(const ossimImageHandler* ih, ossimKeywordlist& kwl) const
-{
-   if ( ih )
-   {
-      std::vector< ossimRefPtr< ossimProperty > > list;
-      ih->getPropertyList(list);
-      std::vector< ossimRefPtr< ossimProperty > >::const_iterator i = list.begin();
-      while (i != list.end())
-      {
-         if ( (*i).valid() )
-         {
-            ossimString key;
-            ossimString value;
-            
-            // Check for one level of nested container.
-            if ((*i)->getClassName() == "ossimContainerProperty")
-            {
-               ossimContainerProperty* ptr = PTR_CAST(ossimContainerProperty, (*i).get());
-               if (ptr)
-               {
-                  std::vector< ossimRefPtr< ossimProperty > > list2;    
-                  ptr->getPropertyList(list2);
-                  
-                  std::vector< ossimRefPtr< ossimProperty > >::const_iterator i2 = list2.begin();
-                  while (i2 != list2.end())
-                  {
-                     key   = (*i2)->getName();
-                     value = (*i2)->valueToString();
-                     kwl.add(key.c_str(), value.c_str(), true);
-                     ++i2;
-                  }
-               }
-            }
-            else // Not a container.
-            {
-               key   = (*i)->getName();
-               value = (*i)->valueToString();
-               kwl.add(key.c_str(), value.c_str(), true);
-            }
-         }
-         ++i;
-      }
-      
-   } // if ( ih )
-
-} // End: getImageMetadata(ossimImageHandler* ih, ossimKeywordlist& kwl)
-
-void ossimInfo::getImagePalette(ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getImagePalette( m_img.get(), kwl );
-   }
-}
-
-void ossimInfo::getImagePalette(ossimImageHandler* ih, ossimKeywordlist& kwl) const
-{
-   if ( ih )
-   {
-      if(ih->getLut().valid())
-      {
-         ossim_uint32 entryIdx = 0;
-         std::vector<ossim_uint32> entryList;
-         ih->getEntryList(entryList);
-         for(entryIdx = 0; entryIdx < ih->getNumberOfEntries();++entryIdx)
-         {
-            ih->setCurrentEntry(entryList[entryIdx]);
-            ossimString prefix = "image";
-            prefix = prefix + ossimString::toString(entryList[entryIdx]) + ".lut.";
-            if(ih->getLut().valid())
-            {
-               ih->getLut()->saveState(kwl, prefix);
-            }
-         }
-      }
-      
-   } // if ( ih )
-}
-
-void ossimInfo::getImageInfo(ossimKeywordlist& kwl, bool dnoFlag)
-{
-   if ( m_img.valid() )
-   {
-      getImageInfo( m_img.get(), kwl, dnoFlag );
-   }
-}
-
-void ossimInfo::getImageInfo( ossimImageHandler* ih, ossimKeywordlist& kwl, bool dnoFlag ) const
-{
-   if ( ih )
-   {
-      ossim_uint32 numEntries = 0;
-
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
-
-      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
-      while ( i != entryList.end() )
-      {
-         if ( getImageInfo( ih, (*i), kwl, dnoFlag ) )
-         {
-            ++numEntries;
-         }
-         ++i;
-      }
-      
-      kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
-
-   } // if ( ih )
-}
-   
-bool ossimInfo::getImageInfo( ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag )
-{
-   bool result = false;
-   if ( m_img.valid() )
-   {
-      result = getImageInfo( m_img.get(), entry, kwl, dnoFlag );
-   }
-   return result;
-}
- 
-bool ossimInfo::getImageInfo( ossimImageHandler* ih, ossim_uint32 entry, 
-                              ossimKeywordlist& kwl, bool dnoFlag ) const
-{
-   bool result = false;
-   
-   if ( ih )
-   {
-      if ( ih->setCurrentEntry(entry) )
-      {
-         bool outputEntry = true;
-         if ( dnoFlag )
-         {
-            if ( isImageEntryOverview() )
-            {
-               outputEntry = false;
-            }
-         }
-
-         if ( outputEntry )
-         {
-            result = true;
-
-            // Entry number:
-            ossimString prefix = "image";
-            prefix = prefix + ossimString::toString(entry) + ".";
-            kwl.add(prefix.c_str(), ossimKeywordNames::ENTRY_KW, entry, true);
-            
-            // Get the entry_name (specialized multi-entry readers only):
-            std::string entryName;
-            ih->getEntryName( entry, entryName );
-            if ( entryName.size() )
-            {
-               kwl.add(prefix.c_str(), "entry_name", entryName.c_str(), true);
-            }
-
-            // Type/class of reader:
-            kwl.add(prefix, "type", ih->getClassName().c_str(), true);
-
-            // Add RGB bands if available:
-            getRgbBands( ih, entry, kwl );
-
-            // Driver name if different from class name:
-            if ( ih->getClassName() != ih->getShortName() )
-            {
-               kwl.add(prefix, "driver", ih->getShortName().c_str(), true);
-            }
-
-            // Type/class of overview reader:
-            if (ih->getOverview())
-            {
-               kwl.add(prefix, "overview.type",
-                       ih->getOverview()->getClassName().c_str(), true);
-            }
-            
-            ossimDrect boundingRect = ih->getBoundingRect();
-            kwl.add(prefix,ossimKeywordNames::UL_X_KW, boundingRect.ul().x, true);
-            kwl.add(prefix,ossimKeywordNames::UL_Y_KW, boundingRect.ul().y, true);
-            kwl.add(prefix,ossimKeywordNames::LR_X_KW, boundingRect.lr().x, true);
-            kwl.add(prefix,ossimKeywordNames::LR_Y_KW, boundingRect.lr().y, true);
-            
-            const ossim_uint32 BANDS = ih->getNumberOfInputBands();
-            kwl.add(prefix,ossimKeywordNames::NUMBER_INPUT_BANDS_KW, BANDS, true);
-            kwl.add(prefix,ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
-                    ih->getNumberOfOutputBands(), true);
-            kwl.add(prefix,ossimKeywordNames::NUMBER_LINES_KW,
-                    boundingRect.height(), true);
-            kwl.add(prefix,ossimKeywordNames::NUMBER_SAMPLES_KW,
-                    boundingRect.width(), true);
-            
-            ossimScalarType scalar = ih->getOutputScalarType();
-            
-            for(ossim_uint32 i = 0; i < BANDS; ++i)
-            {
-               ossimString band = ossimString("band") + ossimString::toString(i) + ".";
-               
-               kwl.add(prefix, band+"null_value", ih->getNullPixelValue(i), true);
-               kwl.add(prefix, band+"min_value", ih->getMinPixelValue(i), true);
-               kwl.add(prefix, band+"max_value", ih->getMaxPixelValue(i), true);
-            }
-            
-            // Output Radiometry.
-            std::string rad;
-            getRadiometry(scalar, rad);
-            kwl.add(prefix, "radiometry", rad.c_str(), true);
-            kwl.add(prefix,"number_decimation_levels", ih->getNumberOfDecimationLevels(), true);
-            
-         } // if ( outputEntry )
-         
-      } // if ( ih->setCurrentEntry(entry) )
-      
-   } // if ( ih )
-   
-   return result;
-
-} // End: ossimInfo::getImageInfo( ih, entry...
-
-void ossimInfo::getImageGeometryInfo(ossimKeywordlist& kwl, bool dnoFlag)
-{
-   if ( m_img.valid() )
-   {
-      getImageGeometryInfo( m_img.get(), kwl, dnoFlag );
-   }
-}
-
-void ossimInfo::getImageGeometryInfo( ossimImageHandler* ih, ossimKeywordlist& kwl, bool dnoFlag) const
-{
-   if ( ih )
-   {      ossim_uint32 numEntries = 0;
-
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
-
-      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
-      while ( i != entryList.end() )
-      {
-         if ( getImageGeometryInfo( ih, (*i), kwl, dnoFlag ) )
-         {
-            ++numEntries;
-         }
-         ++i;
-      }
-      
-      kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
-
-   } // if ( ih )
-}
-   
-bool ossimInfo::getImageGeometryInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag)
-{
-   bool result = false; 
-   if ( m_img.valid() )
-   {
-      getImageGeometryInfo( m_img.get(), entry, kwl, dnoFlag );
-   }
-   return result;
-}
-
-bool ossimInfo::getImageGeometryInfo( ossimImageHandler* ih,
-                                      ossim_uint32 entry, 
-                                      ossimKeywordlist& kwl, 
-                                      bool dnoFlag) const
-{
-   bool result = false;
-   
-   if ( ih )
-   {      
-      if ( ih->setCurrentEntry(entry) )
-      {
-         bool outputEntry = true;
-         if ( dnoFlag )
-         {
-            if ( isImageEntryOverview() )
-            {
-               outputEntry = false;
-            }
-         }
-
-         if ( outputEntry )
-         {
-            ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-            if(geom.valid())
-            {
-               result = true;
-               
-               ossimString prefix = "image";
-               prefix = prefix + ossimString::toString(entry) + ossimString(".geometry.");
-               
-               geom->saveState(kwl, prefix);
-               
-               // Output support files list:
-               ossimSupportFilesList::instance()->save(kwl, prefix);
-               
-               ossimGpt ulg;
-               ossimGpt llg;
-               ossimGpt lrg;
-               ossimGpt urg;
-
-               ossimDrect outputRect = ih->getBoundingRect();
-
-               geom->localToWorld(outputRect.ul(), ulg);
-               geom->localToWorld(outputRect.ll(), llg);
-               geom->localToWorld(outputRect.lr(), lrg);
-               geom->localToWorld(outputRect.ur(), urg);
-               
-               //---
-               // *** HACK *** 
-               // Encountered CADRG RPF imagery where the left edge was longitude -180 and
-               // right edge +180. The projection code above reasonably maps all -180 to +180.
-               // This however breaks the image footprint since it would appear that the left
-               // and right edges were coincident instead of 360 degrees apart, i.e., a line
-               // segment instead of a rect. So added check here for coincident left and right
-               // edges and remapping left edge to -180.
-               //---
-               if ((ulg.lon == 180.0) && (urg.lon == 180.0))  
-               {
-                  ulg.lon = -180.0;
-               }
-               if ((llg.lon == 180.0) && (lrg.lon == 180.0))  
-               {
-                  llg.lon = -180.0;
-               }
-
-               kwl.add(prefix, "ul_lat", ulg.latd(), true);
-               kwl.add(prefix, "ul_lon", ulg.lond(), true);
-               kwl.add(prefix, "ll_lat", llg.latd(), true);
-               kwl.add(prefix, "ll_lon", llg.lond(), true);
-               kwl.add(prefix, "lr_lat", lrg.latd(), true);
-               kwl.add(prefix, "lr_lon", lrg.lond(), true);
-               kwl.add(prefix, "ur_lat", urg.latd(), true);
-               kwl.add(prefix, "ur_lon", urg.lond(), true);
-               
-               if(!kwl.find(ossimKeywordNames::TIE_POINT_LAT_KW))
-               {
-                  kwl.add(prefix, ossimKeywordNames::TIE_POINT_LAT_KW, ulg.latd(), true);
-                  kwl.add(prefix, ossimKeywordNames::TIE_POINT_LON_KW, ulg.lond(), true);
-                  
-                  if ( outputRect.height()-1.0 > DBL_EPSILON )
-                  {
-                     kwl.add(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
-                             fabs(ulg.latd()-llg.latd())/(outputRect.height()-1.0), true);
-                  }
-                  
-                  if ( outputRect.width()-1.0 > DBL_EPSILON )
-                  {
-                     kwl.add(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
-                             fabs(ulg.lond()-urg.lond())/(outputRect.width()-1.0), true);
-                  }
-               }
-               
-               ossimDpt gsd = geom->getMetersPerPixel();
-               kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_X_KW, gsd.x, true);
-               kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW, gsd.y, true);
-               
-            } // if(geom.valid())
-
-         } // if ( outputEntry )
-
-      } // if ( ih->setCurrentEntry(entry) )
-
-      if ( !result )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "No geometry for file " << ih->getFilename() << std::endl;
-      }
-      
-   } // if ( ih )
-   
-   return result;
-
-} // End: ossimInfo::getImageGeometryInfo( ih, entry...
-
-void ossimInfo::getCenterImage(ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getCenterImage( m_img.get(), kwl );
-   }
-}
-
-void ossimInfo::getCenterImage( ossimImageHandler* ih, ossimKeywordlist& kwl) const
-{
-   if ( ih )
-   {  
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
-      
-      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
-      while ( i != entryList.end() )
-      {
-         getCenterImage( ih, (*i), kwl );
-         ++i;
-      }
-   } 
-}
-   
-void ossimInfo::getCenterImage(ossim_uint32 entry, ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getCenterImage( m_img.get(), entry, kwl );
-   }
-}
-
-void ossimInfo::getCenterImage( ossimImageHandler* ih,
-                                ossim_uint32 entry, 
-                                ossimKeywordlist& kwl ) const
-{
-   if ( ih )
-   {
-      if ( ih->setCurrentEntry(entry) )
-      {
-         ossimString prefix = "image";
-         prefix = prefix + ossimString::toString(entry) + ".";
-         ossimDrect bounds = ih->getBoundingRect();
-
-         if( !bounds.hasNans() )
-         {
-            ossimDpt iPt = bounds.midPoint();
-            kwl.add(prefix, "center_image", iPt.toString().c_str(), true);
-         }
-
-      } // if ( ih->setCurrentEntry(entry) )
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Could not get image center for: " << ih->getFilename() << std::endl;
-      }
-      
-   } // if ( ih )
-}
-
-void ossimInfo::getCenterGround(ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getCenterGround( m_img.get(), kwl );
-   }
-}
-
-void ossimInfo::getCenterGround( ossimImageHandler* ih, ossimKeywordlist& kwl) const
-{
-   if ( ih )
-   {  
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
-      
-      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
-      while ( i != entryList.end() )
-      {
-         getCenterGround( ih, (*i), kwl );
-         ++i;
-      }
-   } 
-}
-   
-void ossimInfo::getCenterGround(ossim_uint32 entry, ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getCenterGround( m_img.get(), entry, kwl );
-   }
-}
-
-void ossimInfo::getCenterGround( ossimImageHandler* ih,
-                                 ossim_uint32 entry, 
-                                 ossimKeywordlist& kwl ) const
-{
-   if ( ih )
-   {
-      if ( ih->setCurrentEntry(entry) )
-      {
-         ossimString prefix = "image";
-         prefix = prefix + ossimString::toString(entry) + ".";
-
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if(geom.valid())
-         {
-            ossimDrect bounds;
-            geom->getBoundingRect( bounds );
-            
-            if( !bounds.hasNans() )
-            {
-               ossimDpt iPt = bounds.midPoint();
-               ossimGpt gPt;
-               geom->localToWorld(iPt, gPt);
-               kwl.add(prefix, "center_ground", gPt.toString().c_str(), true);
-            }
-         }
-
-      } // if ( ih->setCurrentEntry(entry) )
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Could not get ground center for: " << ih->getFilename() << std::endl;
-      }
-      
-   } // if ( ih )
-}
-
-void ossimInfo::getUpIsUpAngle(ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getUpIsUpAngle( m_img.get(), kwl );
-   }
-}
-
-void ossimInfo::getUpIsUpAngle( ossimImageHandler* ih, ossimKeywordlist& kwl) const
-{
-   if ( ih )
-   {  
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
-      
-      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
-      while ( i != entryList.end() )
-      {
-         getUpIsUpAngle( ih, (*i), kwl );
-         ++i;
-      }
-   } 
-}
-
-void ossimInfo::getUpIsUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getUpIsUpAngle( m_img.get(), entry, kwl );
-   }
-}
-
-void ossimInfo::getUpIsUpAngle( ossimImageHandler* ih,
-                                ossim_uint32 entry, 
-                                ossimKeywordlist& kwl ) const
-{
-   if ( ih )
-   {
-      bool result = false;
-
-      if ( ih->setCurrentEntry(entry) )
-      {
-         ossimString prefix = "image";
-         prefix = prefix + ossimString::toString(entry) + ".";
-         
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if(geom.valid())
-         {
-            ossim_float64 upIsUp = 0.0;
-            if ( geom->isAffectedByElevation() )
-            {
-               upIsUp = geom->upIsUpAngle();
-               kwl.add(prefix, UP_IS_UP_KW, upIsUp, true);
-            }
-         }
-
-         result = true;
-
-      } // if ( ih->setCurrentEntry(entry) )
-
-      if ( !result )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Could not get up is up angle for: " << ih->getFilename() << std::endl;
-      }
-      
-   } // if ( ih )
-}
-   
-void ossimInfo::getNorthUpAngle(ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getNorthUpAngle( m_img.get(), kwl );
-   }
-}
-
-void ossimInfo::getNorthUpAngle( ossimImageHandler* ih, ossimKeywordlist& kwl) const
-{
-   if ( ih )
-   {  
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
-      
-      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
-      while ( i != entryList.end() )
-      {
-         getNorthUpAngle( ih, (*i), kwl );
-         ++i;
-      }
-   } 
-}
-
-void ossimInfo::getNorthUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getNorthUpAngle( m_img.get(), entry, kwl );
-   }
-}
-
-void ossimInfo::getNorthUpAngle( ossimImageHandler* ih,
-                                 ossim_uint32 entry, 
-                                 ossimKeywordlist& kwl ) const
-{
-   if ( ih )
-   {
-      bool result = false;
-
-      if ( ih->setCurrentEntry(entry) )
-      {
-         ossimString prefix = "image";
-         prefix = prefix + ossimString::toString(entry) + ".";
-         
-         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-         if(geom.valid())
-         {
-            ossim_float64 northUp = geom->northUpAngle();
-            kwl.add(prefix, NORTH_UP_KW, northUp, true);
-         }
-
-         result = true;
-
-      } // if ( ih->setCurrentEntry(entry) )
-
-      if ( !result )
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Could not get north up angle for: " << ih->getFilename() << std::endl;
-      }
-      
-   } // if ( ih )
-}
-
-void ossimInfo::getImageRect(ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getImageRect( m_img.get(), kwl );
-   }
-}
-
-void ossimInfo::getImageRect( ossimImageHandler* ih, ossimKeywordlist& kwl) const
-{
-   if ( ih )
-   {  
-      std::vector<ossim_uint32> entryList;
-      ih->getEntryList(entryList);
-      
-      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
-      while ( i != entryList.end() )
-      {
-         getImageRect( ih, (*i), kwl );
-         ++i;
-      }
-   } // if ( ih )
-}
-
-bool ossimInfo::getRgbBands(
-   ossimImageHandler* ih, ossim_uint32 entry, ossimKeywordlist& kwl ) const
-{
-   bool result = false;
-   if ( ih )
-   {
-      std::vector<ossim_uint32> bandList;
-      result = ih->getRgbBandList( bandList );
-      if ( result && ( bandList.size() == 3 ) )
-      {
-         ossimString os;
-         ossim::toSimpleStringList<ossim_uint32>(os, bandList);
-         if ( os.size() )
-         {
-            ossimString prefix = "image";
-            prefix = prefix + ossimString::toString(entry) + ".";
-            kwl.add(prefix, "rgb_bands", os.c_str(), true);
-         }
-      }
-   }
-   return result;
-   
-} // End: ossimInfo::getRgbBands( ... )
-   
-void ossimInfo::getImageRect(ossim_uint32 entry, ossimKeywordlist& kwl)
-{
-   if ( m_img.valid() )
-   {
-      getImageRect( m_img.get(), entry, kwl );
-   }
-}
-
-void ossimInfo::getImageRect( ossimImageHandler* ih,
-                              ossim_uint32 entry, 
-                              ossimKeywordlist& kwl ) const
-{
-   if ( ih )
-   {
-      if ( ih->setCurrentEntry(entry) )
-      {
-         ossimString prefix = "image";
-         prefix = prefix + ossimString::toString(entry) + ".";
-         ossimIrect outputRect = ih->getBoundingRect();
-         kwl.add(prefix, "image_rectangle", outputRect.toString().c_str(), true);
-
-      } // if ( ih->setCurrentEntry(entry) )
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-            << "Could not get image rectangle for: " << ih->getFilename() << std::endl;
-      }
-      
-   } // if ( ih )
-
-} // End: getImageRect( ih, entry...
-
-// Note be sure to m_img->setCurrentEntry before calling.
-bool ossimInfo::isImageEntryOverview() const
-{
-   bool result = false; // Have to prove it.
-   if ( m_img.valid() )
-   {
-      result = isImageEntryOverview( m_img.get() );
-   }
-   return result;
-}
- 
-bool ossimInfo::isImageEntryOverview( const ossimImageHandler* ih ) const
-{
-   bool result = false; // Have to prove it.
-   if ( ih )
-   {     
-      ossimString s = "imag";
-      ossimRefPtr<ossimProperty> prop = ih->getProperty(s);
-      if (prop.valid())
-      {
-         ossimString s;
-         prop->valueToString(s);
-         if (s.toFloat32() < 1.0)
-         {
-            result = true;
-         }
-      }
-   }
-   return result;
-}
-
-void ossimInfo::printConfiguration() const
-{
-   printConfiguration( ossimNotify(ossimNotifyLevel_INFO) );
-}
-
-std::ostream& ossimInfo::printConfiguration(std::ostream& out) const
-{
-   out << "\npreferences_keyword_list:\n"
-       << ossimPreferences::instance()->preferencesKWL()
-       << std::endl;
-   return out;
-}
-
-void ossimInfo::printFactories(bool keywordListFlag)const
-{
-   std::vector<ossimString> typeList;
-   ossimObjectFactoryRegistry::instance()->getTypeNameList(typeList);
-   for(int i = 0; i < (int)typeList.size(); ++i)
-   {
-      if(keywordListFlag)
-      {
-         ossimObject* obj = ossimObjectFactoryRegistry::instance()->createObject(typeList[i]);
-         if(obj)
-         {
-            cout << typeList[i] << endl;
-            cout << "______________________________________________________" << endl;
-            ossimKeywordlist kwl;
-            obj->saveState(kwl);
-            cout << kwl << endl;
-            cout << "______________________________________________________" << endl;
-            delete obj;
-         }
-      }
-      else
-      {
-         cout << typeList[i] << endl;
-      }
-   }  
-}
-
-void ossimInfo::printDatums() const
-{
-   ossimInfo::printDatums( ossimNotify(ossimNotifyLevel_INFO) );
-}
-
-std::ostream& ossimInfo::printDatums(std::ostream& out) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   std::vector<ossimString> datumList;
-   ossimDatumFactoryRegistry::instance()->getList(datumList);
-   
-   std::vector<ossimString>::const_iterator i = datumList.begin();
-   
-   while ( i != datumList.end() )
-   {
-      const ossimDatum* datum = ossimDatumFactoryRegistry::instance()->create(*i);
-      if (datum)
-      {
-         if ( datum->ellipsoid() )
-         {
-            out << setiosflags(ios::left)
-                << setw(7)
-                << datum->code().c_str()
-                << setw(48)
-                << datum->name().c_str()
-                << setw(10) 
-                << "Ellipse:"
-                << datum->ellipsoid()->name()
-                << std::endl;
-         }
-         else
-         {
-            out << "No ellipsoid for code: " << (*i) << std::endl;
-         }
-      }
-      else
-      {
-         out << "No datum for code: " << (*i) << std::endl;
-      }
-      
-      ++i;
-   }
-
-   // Reset flags.
-   out.setf(f);
-   
-   return out;
-}
-
-void ossimInfo::deg2rad(const ossim_float64& degrees) const
-{
-   deg2rad( degrees, ossimNotify(ossimNotifyLevel_INFO) );
-}
-
-std::ostream& ossimInfo::deg2rad(const ossim_float64& degrees, std::ostream& out) const
-{
-   double radians = degrees * RAD_PER_DEG;
-
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-   
-   out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
-       << "\n" << degrees << " degrees = "
-       << radians << " radians.\n" << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-
-   return out;
-}
-
-void ossimInfo::rad2deg(const ossim_float64& radians) const
-{
-   rad2deg(radians, ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::rad2deg(const ossim_float64& radians, std::ostream& out) const
-{
-   double degrees = radians * DEG_PER_RAD;
-
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-   
-   out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
-       << "\n" << radians << " radians = "
-       << degrees << " degrees.\n" << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-
-   return out;
-}
-
-void ossimInfo::ft2mtrs(const ossim_float64& feet, bool us_survey) const
-{
-   ft2mtrs( feet, us_survey, ossimNotify(ossimNotifyLevel_INFO) );
-}
-
-std::ostream& ossimInfo::ft2mtrs(const ossim_float64& feet,
-                                 bool us_survey,
-                                 std::ostream& out) const
-{
-   ossim_float64 meters = 0.0;
-   std::string conversionString;
-   if (us_survey)
-   {
-      meters = feet * US_METERS_PER_FT;
-      conversionString = "0.3048006096";
-   }
-   else
-   {
-      meters = feet * MTRS_PER_FT;
-      conversionString = "0.3048";
-   }
-
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-   
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << feet << " * " << conversionString << " = "
-       << meters << " meters." << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-
-   return out;
-}
-
-void ossimInfo::mtrs2ft(const ossim_float64& meters, bool us_survey) const
-{
-   mtrs2ft(meters, us_survey, ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::mtrs2ft(const ossim_float64& meters,
-                                 bool us_survey,
-                                 std::ostream& out) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   double feet = 0.0;
-   std::string conversionString;
-
-   if (us_survey)
-   {
-      feet = meters / US_METERS_PER_FT;
-      conversionString = "0.3048006096";
-   }
-   else
-   {
-      feet = meters / MTRS_PER_FT;
-      conversionString = "0.3048";
-   }
-
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << meters << " / " << conversionString << " = "
-       << feet << " feet." << std::endl;
-
-   // Reset flags.
-   out.setf(f);
-   
-   return out;
-}
-
-void ossimInfo::mtrsPerDeg(const ossim_float64& latitude) const
-{
-   mtrsPerDeg(latitude, ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::mtrsPerDeg(const ossim_float64& latitude, std::ostream& out) const
-{
-   ossimGpt gpt(latitude, 0.0);
-   ossimDpt      mpd          = gpt.metersPerDegree();  
-   ossim_float64 radius       = gpt.datum()->ellipsoid()->geodeticRadius(latitude);
-   ossim_float64 arcLengthLat = mpd.y/60.0;
-   ossim_float64 arcLengthLon = mpd.x/60.0;
-   out << setiosflags(ios::fixed) << setprecision(15)
-       << "Meters per degree and minute at latitude of " << latitude << ":\n"
-       << "Meters per degree latitude:   "
-       << setw(20) << mpd.y << "\n"
-       << "Meters per degree longitude:  "
-       << setw(20) << mpd.x << "\n"
-       << "Meters per minute latitude:   "
-       << setw(20) << arcLengthLat << "\n"
-       << "Meters per minute longitude:  "
-       << setw(20) << arcLengthLon << "\n"
-       << "Geodetic radius:              "
-       << setw(20) << radius << "\n"
-       << std::endl;
-   return out;
-}
-
-void ossimInfo::outputHeight(const ossimGpt& gpt) const
-{
-   outputHeight(gpt, ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::outputHeight(const ossimGpt& gpt, std::ostream& out) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-
-   // Handle wrap conditions.
-   ossimGpt copyGpt = gpt;
-   copyGpt.wrap();
-
-   ossim_float64 hgtAboveMsl = ossimElevManager::instance()->getHeightAboveMSL(copyGpt);
-   ossim_float64 hgtAboveEllipsoid =
-      ossimElevManager::instance()->getHeightAboveEllipsoid(copyGpt);
-   ossim_float64 geoidOffset = ossimGeoidManager::instance()->offsetFromEllipsoid(copyGpt);
-   ossim_float64 mslOffset = 0.0;
-   
-   if(ossim::isnan(hgtAboveEllipsoid)||ossim::isnan(hgtAboveMsl))
-   {
-      mslOffset = ossim::nan();
-   }
-   else
-   {
-      mslOffset = hgtAboveEllipsoid - hgtAboveMsl;
-   }
-   
-   std::vector<ossimFilename> cellList;
-   ossimElevManager::instance()->getOpenCellList(cellList);
-   
-   if (!cellList.empty())
-   {
-      out << "Opened cell:            " << cellList[0] << "\n";
-   }
-   else
-   {
-      out << "Did not find cell for point: " << gpt << "\n";
-   }
-   
-   out << "MSL to ellipsoid delta: ";
-   if (!ossim::isnan(mslOffset))
-   {
-      out << std::setprecision(15) << mslOffset;
-   }
-   else
-   {
-      out << "nan";
-   }
-   out << "\nHeight above MSL:       ";
-   if (!ossim::isnan(hgtAboveMsl))
-   {
-      out << std::setprecision(15) << hgtAboveMsl;
-   }
-   else
-   {
-      out << "nan";
-   }
-   out << "\nHeight above ellipsoid: ";
-   if (!ossim::isnan(hgtAboveEllipsoid))
-   {
-      out << std::setprecision(15) << hgtAboveEllipsoid << "\n";
-   }
-   else
-   {
-      out << "nan" << "\n";
-   }
-   out << "Geoid value:            ";
-
-   if (!ossim::isnan(geoidOffset))
-   {
-      out << std::setprecision(15) << geoidOffset << std::endl;
-   }
-   else
-   {
-      out << "nan" << std::endl;
-   }
-
-   // Reset flags.
-   out.setf(f);
-   
-   return out;
-}
-
-void ossimInfo::printPlugins() const
-{
-   printPlugins(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printPlugins(std::ostream& out) const
-{
-   if(ossimSharedPluginRegistry::instance()->getNumberOfPlugins() > 0)
-   {
-      ossimSharedPluginRegistry::instance()->printAllPluginInformation(out);
-   }
-   else
-   {
-      out << "No plugins loaded in the OSSIM core library" << std::endl;
-   }
-   return out;
-}
-
-void ossimInfo::testPlugin(const ossimFilename& plugin) const
-{
-   testPlugin(plugin, ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::testPlugin(const ossimFilename& plugin, std::ostream& out) const
-{
-   if( ossimSharedPluginRegistry::instance()->registerPlugin(plugin.expand()) )
-   {
-      out << "Plugin loaded: " << plugin << std::endl;
-   }
-   else
-   {
-      out << "Unable to load plugin: " << plugin << std::endl;
-   }
-   return out;
-}
-
-void ossimInfo::printOverviewTypes() const
-{
-   printOverviewTypes(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printOverviewTypes(std::ostream& out) const
-{
-   out << "\nValid overview types: " << std::endl;
-   
-   std::vector<ossimString> outputType;
-   
-   ossimOverviewBuilderFactoryRegistry::instance()->getTypeNameList(outputType);
-   std::copy(outputType.begin(),
-             outputType.end(),
-             std::ostream_iterator<ossimString>(out, "\t\n"));
-   return out;
-}
-
-void ossimInfo::printProjections() const
-{
-   printProjections(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printProjections(std::ostream& out) const
-{
-   out << "Projections:\n";
-   
-   std::vector<ossimString> list;
-   ossimProjectionFactoryRegistry::instance()->
-      getAllTypeNamesFromRegistry(list);
-   
-   std::vector<ossimString>::const_iterator i = list.begin();
-   while ( i != list.end() )
-   {
-      out << *i << "\n";
-      ++i;
-   }
-   out << std::endl;
-   
-   return out;
-}
-
-void ossimInfo::printReaderProps() const
-{
-   printReaderProps(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printReaderProps(std::ostream& out) const
-{
-   return ossimImageHandlerRegistry::instance()->printReaderProps( out );
-}
-
-void ossimInfo::printResamplerFilters() const
-{
-   printResamplerFilters(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printResamplerFilters(std::ostream& out) const
-{
-   std::vector<ossimString> list;
-   ossimFilterResampler f;
-   f.getFilterTypes(list);
-   std::vector<ossimString>::const_iterator i = list.begin();
-   while ( i != list.end() )
-   {
-      out << *i << "\n";
-      ++i;
-   }
-   out << std::endl;
-   return out;
-}
-
-void ossimInfo::printWriters() const
-{
-   printWriters(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printWriters(std::ostream& out) const
-{
-   return ossimImageWriterFactoryRegistry::instance()->printImageTypeList( out );
-}
-
-void ossimInfo::printZoomLevelGsds() const
-{
-   printZoomLevelGsds(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printZoomLevelGsds(std::ostream& out) const
-{
-   // Capture the original flags.
-   std::ios_base::fmtflags f = out.flags();
-   
-   out << setprecision(15)<< setiosflags(std::ios_base::fixed|std::ios_base::right);
-   
-   const int MAX_LEVEL = 24;
-   const double TILE_SIZE = 256.0;
-   const double EPSG_4326_BOUNDS = 180.0;
-   const double EPSG_3857_BOUNDS = 40075016.685578488;
-   
-   // From: ossim-info --mtrsPerDeg 0.0
-   const double MTRS_PER_DEGREE_AT_EQUATOR = 111319.490793273565941;
-   
-   out << "Notes:\n"
-       << "tile size: 256\n"
-       << "dpp = \"degrees per pixel\"\n"
-       << "mpp = \"meters per pixel\"\n\n";
-   
-   // Assuming square pixels, level 0 having (2 x 1) tiles.
-   double level_0_gsd = EPSG_4326_BOUNDS / TILE_SIZE;
-   double level_gsd = 0.0;
-   int i = 0;
-   
-   out << "EPSG:4326 level info:\n"
-       << "Note: Assuming square pixels, level 0 having (2x1) tiles.\n"
-       << "bounds: 360.0 X 180.0\n"
-       << "level[" << std::setw(2) << std::setfill('0') << i << "] dpp:"
-       << std::setw(20) << std::setfill(' ') << level_0_gsd
-       << "  equivalent mpp:" << std::setw(23)
-       << (level_0_gsd * MTRS_PER_DEGREE_AT_EQUATOR) << "\n";
-   
-   for ( i = 1; i <= MAX_LEVEL; ++i )
-   {
-      level_gsd = level_0_gsd / std::pow( 2.0, i );
-      out << "level[" << std::setw(2) << std::setfill('0') << i << "] dpp:"
-          << std::setw(20) << std::setfill(' ') << level_gsd
-          << "  equivalent mpp:" << std::setw(23)
-          << (level_gsd * MTRS_PER_DEGREE_AT_EQUATOR) << "\n";
-      
-   }
-   
-   // Assuming square pixels, level 0 having (1 x 1) tiles.
-   level_0_gsd = EPSG_3857_BOUNDS / TILE_SIZE;
-   level_gsd = 0.0;
-   i = 0;
-   
-   out << "\n\nEPSG:3857 level info:\n"
-       << "Note: Assuming square pixels, level 0 having (1x1) tile.\n"
-       << "bounds: 40075016.685578488 X 40075016.685578488\n"
-       << "level[" << std::setw(2) << std::setfill('0') << i << "] mpp:"
-       << std::setw(24) << std::setfill(' ') << level_0_gsd << "\n";
-   
-   for ( i = 1; i <= MAX_LEVEL; ++i )
-   {
-      level_gsd = level_0_gsd / std::pow( 2.0, i );
-      out << "level[" << std::setw(2) << std::setfill('0') << i << "] mpp:"
-          << std::setw(24) << std::setfill(' ') << level_gsd << "\n";
-   }
-
-   // Reset flags.
-   out.setf(f);
-
-   return out;
-   
-} // End: ossimInfo::printZoomLevelGsds(std::ostream& out)
-
-void ossimInfo::printWriterProps() const
-{
-   printWriterProps(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-std::ostream& ossimInfo::printWriterProps(std::ostream& out) const
-{
-   return ossimImageWriterFactoryRegistry::instance()->printWriterProps( out );
-}
-
-void ossimInfo::getRadiometry(ossimScalarType scalar, std::string& s) const
-{
-   // Output Radiometry.
-   switch(scalar)
-   {
-      case OSSIM_UINT8:
-      {
-         s = "8-bit";
-         break;
-      }
-      case OSSIM_USHORT11:
-      {
-         s = "11-bit";
-         break;
-      }
-      case OSSIM_UINT16:
-      {
-         s = "16-bit unsigned";
-         break;
-      }
-      case OSSIM_SINT16:
-      {
-         s = "16-bit signed";
-         break;
-      }
-      case OSSIM_UINT32:
-      {
-         s = "32-bit unsigned";
-         break;
-      }
-      case OSSIM_SINT32:
-      {
-         s = "32-bit signed";
-         break;
-      }
-      case OSSIM_FLOAT32:
-      {
-         s = "float";
-         break;
-      }
-      case OSSIM_NORMALIZED_FLOAT:
-      {
-         s = "normalized float";
-         break;
-      }
-      default:
-      {
-         s = "unknown";
-         break;
-      }
-   }
-}
-
-void ossimInfo::getBuildDate(std::string& s) const
-{
-#ifdef OSSIM_BUILD_DATE
-   s = OSSIM_BUILD_DATE;
-#else
-   s = "unknown";
-#endif
-}
-
-void ossimInfo::getRevisionNumber(std::string& s) const
-{
-#ifdef OSSIM_REVISION_NUMBER
-   s = OSSIM_REVISION_NUMBER;
-#else
-   s = "unknown";
-#endif
-}
-
-void ossimInfo::getVersion(std::string& s) const
-{
-#ifdef OSSIM_VERSION
-   s = OSSIM_VERSION;
-#else
-   s = "unknown";
-#endif
-}
-
-void ossimInfo::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-   
-   // Set app name.
-   ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
-
-   // Add options.
-   addArguments(ap);
-   
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-   
-   ossimNotify(ossimNotifyLevel_INFO)
-      << " examples:\n\n" 
-      << "    ossim-info --version\n"
-      << "    ossim-info -i ./myfile.tif\n"
-      << "      prints out only general image information\n\n"
-      << "    ossim-info -p ./myfile.tif\n"
-      << "      prints out only image projection information\n\n"
-      << "    ossim-info -p -s wge ./myfile.tif\n"
-      << "      prints out only image projection information and shifts to wgs84\n\n"
-      << "    ossim-info -p -i ./myfile.tif\n"
-      << "      prints out both image and projection information\n\n"
-      << "    ossim-info -p -i ./myfile.tif -o ./myfile.geom\n"
-      << "      writes geometry file with both image and projection information\n\n"
-      << "    ossim-info -p -i ./myfile.tif -v -o ./myfile.geom\n"
-      << "      writes geometry file with both image and projection information\n"
-      << "      while overwriting existing .geom file.\n\n"
-      << "    ossim-info -f XML ./myfile.tif\n"
-      << "      prints out image and projection information as an XML document\n\n"
-      << "    ossim-info -d myfile.ntf\n"
-      << "      Dumps all data available, in this case, all nitf tags, from file.\n\n"
-      << "    ossim-info -d a.toc\n"
-      << "      Dumps all data available, in this case, all nitf and rpf tags, from file.\n\n"
-      << "    ossim-info --dno a.toc\n"
-      << "      \"dno\" for \"dump no overviews\" Dumps all data available,\n"
-      << "       in this case, all nitf and rpf tags, from file ignoring overviews.\n\n"
-      << "    ossim-info -d -i -p myfile.ntf\n"
-      << "      Typical usage case, i.e. do a dump of tags and print out image and\n"
-      << "      projection information.\n\n"
-      << std::endl;
-}
-
-void ossimInfo::outputXml( const ossimKeywordlist& kwl ) const
-{
-   ossimXmlDocument document;
-   document.fromKwl( kwl );
-   ossimNotify(ossimNotifyLevel_INFO) << document << std::endl;
-}
-
-void ossimInfo::outputXml( const ossimKeywordlist& kwl, const ossimFilename& file  ) const
-{
-   ossimXmlDocument document;
-   document.fromKwl( kwl );
-   document.write( file );
-}
-
-bool ossimInfo::keyIsTrue( const std::string& key ) const
-{
-   bool result = false;
-   if ( m_kwl.valid() )
-   {
-      std::string value = m_kwl->findKey( key );
-      if ( value.size() )
-      {
-         result = ossimString(value).toBool();
-      }
-   }
-   return result;
-}
-
diff --git a/ossim/src/ossim/util/ossimRpfUtil.cpp b/ossim/src/ossim/util/ossimRpfUtil.cpp
deleted file mode 100644
index df3ede9..0000000
--- a/ossim/src/ossim/util/ossimRpfUtil.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description:  ossimRpfUtil.cpp
-// 
-// Utility class to stuff with rpf files.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/util/ossimRpfUtil.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/support_data/ossimRpfToc.h>
-#include <ossim/support_data/ossimRpfTocEntry.h>
-#include <ctime>
-#include <iomanip>
-
-static ossimTrace traceDebug = ossimTrace("ossimRpfUtil:debug");
-
-ossimRpfUtil::ossimRpfUtil()
-{
-}
-
-ossimRpfUtil::~ossimRpfUtil()
-{
-}
-
-
-// Note: throws ossimException on error.
-void ossimRpfUtil::writeDotRpfFiles( const ossimFilename& aDotTocFile,
-                                     const ossimFilename& outputDir )
-{
-   static const char MODULE[] = "ossimRpfUtil::writeDotRpfFiles";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\na.toc file:        " << aDotTocFile
-         << "\noutput directory:  " << outputDir
-         << "\n";
-   }
-   
-   // Parse the a.toc file:
-   ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc();
-   
-   if ( toc->parseFile(aDotTocFile) != ossimErrorCodes::OSSIM_OK )
-   {
-      std::string e = MODULE;
-      e += " ERROR:\nCould not open: ";
-      e+= aDotTocFile.string();
-      throw ossimException(e);
-   }
-
-   if ( outputDir.expand().exists() == false )
-   {
-      if ( !outputDir.createDirectory(true, 0775) )
-      {
-         std::string e = MODULE;
-         e += " ERROR:\nCould not create directory: ";
-         e+= outputDir.c_str();
-         throw ossimException(e);
-      }
-   }
-
-   //---
-   // Go through the entries...
-   //---
-   ossim_uint32 entries = toc->getNumberOfEntries();
-   for (ossim_uint32 entry = 0; entry < entries; ++entry)
-   {
-      const ossimRpfTocEntry* tocEntry = toc->getTocEntry(entry);
-      if (tocEntry)
-      {
-         if ( tocEntry->isEmpty() == false )
-         {
-            writeDotRpfFile(toc.get(), tocEntry, outputDir, entry);
-         }
-      }
-      else
-      {
-         std::string e = MODULE;
-         e += " ERROR:  Null entry: ";
-         e += ossimString::toString(entry).string();
-         throw ossimException(e);
-      }
-   }
-   
-} // End: ossimRpfUtil::writeDotRpfFiles
-
-//---
-// Writer a dot rpf file for entry to output directory.
-// 
-// NOTES:
-//
-// 1) All coordinate written out in AREA or edge to edge format.
-// 2) Throws ossimException on error.
-//---
-void ossimRpfUtil::writeDotRpfFile( const ossimRpfToc* toc,
-                                    const ossimRpfTocEntry* tocEntry,
-                                    const ossimFilename& outputDir,
-                                    ossim_uint32 entry)
-{
-   static const char MODULE[] = "ossimRpfUtil::writeDotRpfFile";
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << MODULE << " entered..."
-         << "\noutput directory:  " << outputDir
-         << "\nentry: " << entry << "\n";
-   }
-
-   if ( !toc )
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR toc pointer null!";
-      throw ossimException(errMsg);
-   }
-   if ( !tocEntry )
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR toc entry pointer null!";
-      throw ossimException(errMsg);
-   }
-
-   // Get the file name.
-   ossimFilename outFile;
-   if ( outputDir.expand().isDir() )
-   {
-      getDotRfpFilenameForEntry(outputDir, entry, outFile);
-   }
-   else
-   {
-      outFile = outputDir;
-   }
-   
-   // Open the file to write.
-   std::ofstream os;
-   os.open(outFile.c_str(), ios::out);
-   if ( os.good() == false )
-   {
-      std::string errMsg = MODULE;
-      errMsg += "ERROR could not open: ";
-      errMsg += outFile.string();
-      throw ossimException(errMsg);
-   }
-   
-   // Set up the output stream fix with full precision for ground points.
-   os << setiosflags(std::ios_base::fixed) << setprecision(15);
-   
-   //---
-   // Overall TOC entry bounds:
-   // 
-   // Write the first line which is the bounding box of the entry in the form of:
-   // "89.9850464205332, 23.9892538162654|90.5085823882692, 24.5002602501599|1"
-   //      lr-lon            lr-lat           ul-lon            ul-lat
-   //---
-   ossimRefPtr<ossimImageGeometry> geom = tocEntry->getImageGeometry();
-   if( geom.valid() == false)
-   {
-      std::string errMsg = "ERROR could not get geometry.";
-      errMsg += outFile.string();
-      throw ossimException(errMsg);  
-   }
-
-   // Rectangle in image space.
-   ossimIrect outputRect;
-   tocEntry->getBoundingRect(outputRect);
-
-   // bands:
-   ossim_uint32 bands = tocEntry->getNumberOfBands();
-
-   // scale:
-   ossimDpt scale;
-   tocEntry->getDecimalDegreesPerPixel(scale);
-   ossimDpt halfPix = scale / 2.0;
-
-   ossimGpt llg;
-   ossimGpt urg;
-   geom->localToWorld(outputRect.ur(), urg);
-   geom->localToWorld(outputRect.ll(), llg);
-
-   if ( traceDebug() )
-   {
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "outputRect: " << outputRect
-         << "\nbands: " << bands
-         << "\nscale: " << scale
-         << "\nllg:   " << llg
-         << "\nurg:   " << urg
-         << std::endl;
-   }
-
-   // Expand coordinates to edge:
-   llg.lon -= halfPix.x;
-   llg.lat -= halfPix.y;
-   urg.lon += halfPix.x;
-   urg.lat += halfPix.y;
-   
-   // Test for 360 degrees apart.
-   checkLongitude(llg, urg);
-   
-   os << llg.lon << "," // lower left longitude
-      << llg.lat << "|" // lower left latitude
-      << urg.lon << "," // upper right longitude
-      << urg.lat << "|" // upper right latitude
-      << bands << "\n";
-
-   // Frame loop:
-   const ossim_int32 FRAMESIZE = 1536;
-   const ossim_int32 ROWS = static_cast<ossim_int32>(tocEntry->getNumberOfFramesVertical());
-   if( ROWS == 0 )
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR no rows!";
-      throw ossimException(errMsg);  
-   }
-   const ossim_int32 COLS = static_cast<ossim_int32>(tocEntry->getNumberOfFramesHorizontal());
-   if( COLS == 0 )
-   {
-      std::string errMsg = MODULE;
-      errMsg += " ERROR no columns!";
-      throw ossimException(errMsg);  
-   }
-
-   // Set the initial lower left and upper right image points for localToWorld call.
-   //ossimDpt urd( ( (ROWS-1)*FRAMESIZE) -1, 0.0);
-   //ossimDpt lld(0.0, (ROWS*FRAMESIZE)-1);
-   ossimDpt urd( FRAMESIZE-1, 0.0);
-   ossimDpt lld(0.0, FRAMESIZE-1);
-   
-   for (ossim_int32 row = ROWS-1; row > -1; --row)
-   {
-      for (ossim_int32 col = 0; col < COLS; ++col)
-      {
-         //---
-         // Example format (only with 15 digit precision):
-         // /data/spadac/rpf/world/cb01/ng467a1/0xslpk1a.i41|90.0448,24.3621|90.0598,24.3750
-         //---
-         
-         // Get the path to the frame.
-         ossimFilename path;
-         toc->getRootDirectory(path);
-         
-         path = path.dirCat( toc->getRelativeFramePath(entry, row, col) );
-
-         // Not sure if this is backwards:
-         geom->localToWorld(urd, urg);
-         geom->localToWorld(lld, llg);
-
-         // Expand coordinates to edge:
-         llg.lon -= halfPix.x;
-         llg.lat -= halfPix.y;
-         urg.lon += halfPix.x;
-         urg.lat += halfPix.y;
-         
-         // Test for 360 degrees apart.
-         checkLongitude(llg, urg);
-
-         os << path.c_str() << "|"
-            << llg.lon << "," // lower left longitude
-            << llg.lat << "|" // lower left latitude
-            << urg.lon << "," // upper right longitude
-            << urg.lat        // upper right latitude
-            << "\n";
-
-         if ( traceDebug() )
-         {
-            ossimNotify(ossimNotifyLevel_DEBUG)
-               << "row[" << row << "]col[" << col << "]path: " << path
-               << "\nlld: " << lld
-               << "\nllg: " << llg
-               << "\nurd: " << urd
-               << "\nurg: " << urg
-               << std::endl;
-         }
-
-         // Go to next col.
-         urd.x += FRAMESIZE;
-         lld.x += FRAMESIZE;
-            
-      } // End column loop.
-
-      // Go to nex row.
-      urd.y += FRAMESIZE;
-      urd.x = FRAMESIZE-1;
-      lld.y += FRAMESIZE;
-      lld.x = 0;
-      
-   } // End row loop.
-
-   // Close the file.
-   os.close();
-
-   ossimNotify(ossimNotifyLevel_DEBUG) << "wrote file: " << outFile << std::endl;
-   
-} // End: ossimRpfUtil::writeDotRpfFile
-
-void ossimRpfUtil::checkLongitude(ossimGpt& left, ossimGpt& right) const
-{
-   //---
-   // Test for scene coordinates being 180 to 180 (360 degree spread) and
-   // adjust leftLon to -180 if so.
-   //
-   // NOTE:
-   // Setting tolerance to 1/7200 about 15 meters.
-   // Not sure if this is too loose or not. (drb)
-   //---
-   const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
-
-   if ( ossim::almostEqual(left.lon, 180.0, TOLERANCE) )
-   {
-      if ( ossim::almostEqual(right.lon, 180.0, TOLERANCE) )
-      {
-         left.lon = -180.0;
-         right.lon = 180.0;
-      }
-   }
-}
-
-void ossimRpfUtil::getDotRfpFilenameForEntry(const ossimFilename& outputDir,
-                                             ossim_uint32 entry,
-                                             ossimFilename& outFile) const
-{
-   // Get the build date in the format of (yyyymmddhhmmss).
-   char s[15];
-   s[14] = '\0';
-   time_t t;
-   time(&t);
-   tm* lt = localtime(&t);
-   strftime(s, 15, "%Y%m%d%H%M%S", lt);
-   std::string date = s;
-   
-   outFile = outputDir.dirCat(s);
-   outFile += "_e";
-   outFile += ossimString::toString(entry);
-   outFile += ".rpf";
-}
-
diff --git a/ossim/src/ossim/util/ossimSlopeUtil.cpp b/ossim/src/ossim/util/ossimSlopeUtil.cpp
deleted file mode 100644
index d846618..0000000
--- a/ossim/src/ossim/util/ossimSlopeUtil.cpp
+++ /dev/null
@@ -1,374 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-//*******************************************************************
-//  $Id: ossimSlopeUtil.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/util/ossimSlopeUtil.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimImageViewProjectionTransform.h>
-#include <ossim/imaging/ossimSlopeFilter.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <iostream>
-
-using namespace std;
-
-ossimSlopeUtil::ossimSlopeUtil()
-:  m_aoiRadius(0),
-   m_remapToByte(false)
-{
-   m_centerGpt.makeNan();
-}
-
-ossimSlopeUtil::~ossimSlopeUtil()
-{
-}
-
-void ossimSlopeUtil::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-
-   // Add options.
-   addArguments(ap);
-
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-
-   ossimNotify(ossimNotifyLevel_INFO)
-   << "\nUtility for computing the slope at each elevation post and generating "
-   << "a corresponding slope image. The output scalar type is a normalized float with 1.0 = 90 "
-   << "degree angle from the local vertical. Optional 8-bit scalar type is available."
-   << "Examples:\n\n"
-   << "    ossim-slope [options] --dem <input-dem> <output-slope-image-file>\n"
-   << "    ossim-slope [options] --center <lat> <lon> --roi <meters> <output-slope-image-file>\n"
-   << std::endl;
-}
-
-void ossimSlopeUtil::addArguments(ossimArgumentParser& ap)
-{
-   // Set the general usage:
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options] <output-image>";
-   au->setCommandLineUsage(usageString);
-
-   // Set the command line options:
-   au->addCommandLineOption(
-         "--center <lat> <lon>",
-         "The center position of the output product. Required if no input DEM is specified.");
-   au->addCommandLineOption(
-         "--dem <filename>",
-         "Specifies the input DEM filename. If none provided, the elevation database is referenced "
-         "as specified in prefs file for the center and ROI specified.");
-   au->addCommandLineOption(
-         "--remap",
-         "The range of slope angle (0.0 to 90.0) is remapped to 0-255 (one byte/pixel)");
-   au->addCommandLineOption(
-         "--lut <filename>",
-         "Specifies the optional lookup table filename for mapping the single-band output "
-         "image to an RGB. The LUT provided must be in the ossimIndexToRgbLutFilter format "
-         "and should accomodate the output pixel range. This option forces remap to 8-bit, "
-         "0-255 where 255 = 90 deg slope");
-   au->addCommandLineOption(
-         "--request-api",
-         "Causes applications API to be output as JSON to stdout. Accepts optional filename "
-         "to store JSON output.");
-   au->addCommandLineOption(
-         "--roi <meters>",
-         "radius of interest surrounding the center point. If absent, the product defaults to "
-         "1024 x 1024 pixels, with a radius of 512 * GSD. Alternatively, if a DEM file is "
-         "specified, the product ROI defaults to the full DEM coverage.");
-}
-
-bool ossimSlopeUtil::initialize(ossimArgumentParser& ap)
-{
-   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
-   {
-      usage(ap);
-      return false;
-   }
-
-   std::string ts1;
-   ossimArgumentParser::ossimParameter sp1(ts1);
-   std::string ts2;
-   ossimArgumentParser::ossimParameter sp2(ts2);
-
-   if (ap.read("--center", sp1, sp2))
-   {
-      m_centerGpt.lat = ossimString(ts1).toDouble();
-      m_centerGpt.lon = ossimString(ts2).toDouble();
-      m_centerGpt.hgt = 0.0;
-   }
-
-   if (ap.read("--dem", sp1))
-      m_demFile = ts1;
-
-   if ( ap.read("--remap"))
-   {
-      m_remapToByte = true;
-   }
-
-   if ( ap.read("--lut", sp1) )
-      m_lutFile = ts1;
-
-   if ( ap.read("--request-api", sp1))
-   {
-      ofstream ofs ( ts1.c_str() );
-      printApiJson(ofs);
-      ofs.close();
-      return false;
-   }
-   if ( ap.read("--request-api"))
-   {
-      printApiJson(cout);
-      return false;
-   }
-
-   if (ap.read("--roi", sp1))
-      m_aoiRadius = ossimString(ts1).toDouble();
-
-   if (m_demFile.empty() && m_centerGpt.hasNans())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)<<"No DEM file nor center point provided. Cannot "
-            <<"compute slope image."<<endl;
-      usage(ap);
-      return false;
-   }
-
-   // There should only be the required command line args left:
-   if (ap.argc() != 2)
-   {
-      usage(ap);
-      return false;
-   }
-
-   m_slopeFile = ap[1];
-
-   return initializeChain();
-}
-
-bool ossimSlopeUtil::initializeChain()
-{
-   // Establish connection to elevation data. Image handler (or combiner) returned in m_procChain:
-   if (!m_demFile.empty())
-   {
-      if (!loadDemFile())
-      return false;
-   }
-   else if (!loadElevDb())
-      return false;
-
-   ossimRefPtr<ossimSlopeFilter> slope_filter = new ossimSlopeFilter(m_procChain.get());
-   slope_filter->setSlopeType(ossimSlopeFilter::NORMALIZED);
-   m_procChain = slope_filter.get();
-
-   // If remap to one byte per pixel selected, insert remapper here:
-   if (m_remapToByte || !m_lutFile.empty())
-   {
-      ossimRefPtr<ossimScalarRemapper> sr = new ossimScalarRemapper;
-      sr->connectMyInputTo(0, m_procChain.get());
-      m_procChain = sr.get();
-      sr->setOutputScalarType(OSSIM_UINT8);
-   }
-
-   // If LUT remap requested, insert here in the chain:
-   if (!m_lutFile.empty())
-   {
-      if (m_lutFile.isReadable())
-      {
-         ossimRefPtr<ossimIndexToRgbLutFilter> lut = new ossimIndexToRgbLutFilter;
-         lut->connectMyInputTo(0, m_procChain.get());
-         m_procChain = lut.get();
-         lut->setLut(m_lutFile);
-      }
-      else
-      {
-         ossimNotify(ossimNotifyLevel_WARN)<<"The LUT file specified, <"<<m_lutFile<<"> is "
-               "not readbale. The LUT remap will be ignored."<<endl;
-      }
-   }
-
-   m_procChain->initialize();
-   return true;
-}
-
-bool ossimSlopeUtil::loadDemFile()
-{
-   m_procChain = ossimImageHandlerRegistry::instance()->open(m_demFile, true, false);
-   if (!m_procChain.valid())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "Could not open DEM file at <"<<m_demFile
-            <<">. Aborting..."<<endl;
-      return false;
-   }
-
-   return true;
-}
-
-bool ossimSlopeUtil::loadElevDb()
-{
-   // Determine if default GSD needs to be computed. Query for target H so as to autoload cell:
-   ossimElevManager* elevMgr = ossimElevManager::instance();
-   elevMgr->getHeightAboveEllipsoid(m_centerGpt);
-   double gsd = elevMgr->getMeanSpacingMeters();
-   if (ossim::isnan(gsd))
-   {
-      ossimNotify(ossimNotifyLevel_FATAL) << "Could not establish DEM GSD at center point "
-            <<m_centerGpt<<". Verify that the elevation database provides coverage at this "
-            <<"location."<<endl;
-      return false;
-   }
-
-   // Establish output radius if not provided:
-   ossimIrect viewRect(0, 0, 1023, 1023);
-   if (m_aoiRadius == 0)
-   {
-      // The radius of interest can default given a GSD to achieve a specific output image size.
-      m_aoiRadius = (viewRect.size().x + viewRect.size().y -2) * gsd / 4.0;
-   }
-
-   // Establish ground-space AOI rectangle:
-   ossimDpt metersPerDeg (m_centerGpt.metersPerDegree());
-   double dlat = m_aoiRadius/metersPerDeg.y;
-   double dlon = m_aoiRadius/metersPerDeg.x;
-   ossimGrect gndRect (m_centerGpt.lat + dlat, m_centerGpt.lon - dlon,
-                       m_centerGpt.lat - dlat, m_centerGpt.lon + dlon);
-
-   // Query elevation manager for cells providing needed coverage:
-   std::vector<std::string> cells;
-   elevMgr->getCellsForBounds(gndRect, cells);
-
-   // Open a raster image for each elevation source being considered:
-   ossimConnectableObject::ConnectableObjectList elevChains;
-   std::vector<std::string>::iterator fname_iter = cells.begin();
-   while (fname_iter != cells.end())
-   {
-      ossimRefPtr<ossimImageHandler> dem =
-            ossimImageHandlerRegistry::instance()->open(*fname_iter);
-      if (!dem.valid())
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-              << "ossimHLZUtil::initElevSources() ERR: Cannot open DEM file at <"
-              <<*fname_iter<<">\n"<< std::endl;
-         return false;
-      }
-
-      elevChains.push_back(dem.get());
-      ++fname_iter;
-   }
-
-   // Establish the output image's projection geometry:
-   ossimRefPtr<ossimEquDistCylProjection> mapProj = new ossimEquDistCylProjection();
-   mapProj->setOrigin(m_centerGpt);
-   mapProj->setMetersPerPixel(ossimDpt(gsd, gsd));
-   ossimDpt degPerPixel(mapProj->getDecimalDegreesPerPixel());
-   mapProj->setElevationLookupFlag(false);
-   mapProj->setUlTiePoints(gndRect.ul());
-   ossimRefPtr<ossimImageGeometry> productGeom = new ossimImageGeometry(0, mapProj.get());
-   ossimDpt viewPt;
-   productGeom->worldToLocal(gndRect.ul(), viewPt);
-   viewRect.set_ulx(ossim::round<ossim_int32, double>(viewPt.x));
-   viewRect.set_uly(ossim::round<ossim_int32, double>(viewPt.y));
-   productGeom->worldToLocal(gndRect.lr(), viewPt);
-   viewRect.set_lrx(ossim::round<ossim_int32, double>(viewPt.x));
-   viewRect.set_lry(ossim::round<ossim_int32, double>(viewPt.y));
-   ossimIpt image_size(viewRect.width(), viewRect.height());
-   productGeom->setImageSize(image_size);
-
-   // Now loop to add a renderer to each input cell to insure common output projection:
-   ossimConnectableObject::ConnectableObjectList::iterator cell_iter = elevChains.begin();
-   while (cell_iter != elevChains.end())
-   {
-      ossimImageSource* chain = (ossimImageSource*) cell_iter->get();
-      ossimRefPtr<ossimImageViewProjectionTransform> ivt = new ossimImageViewProjectionTransform(
-            chain->getImageGeometry().get(), productGeom.get());
-
-      chain = new ossimImageRenderer(chain, ivt.get());
-      chain->initialize();
-      *cell_iter = chain;
-      ++cell_iter;
-   }
-
-   // Finally create the combiner:
-   m_procChain = new ossimImageMosaic(elevChains);
-   return true;
-}
-
-bool ossimSlopeUtil::execute()
-{
-   if (!m_procChain.valid())
-   {
-      if (!initializeChain())
-         return false;
-   }
-
-   // Set up the writer:
-   bool all_good = false;
-
-   ossimRefPtr<ossimTiffWriter> tif_writer =  new ossimTiffWriter();
-   tif_writer->setGeotiffFlag(true);
-
-   tif_writer->setFilename(m_slopeFile);
-   if (tif_writer.valid())
-   {
-      tif_writer->connectMyInputTo(0, m_procChain.get());
-      ossimIrect viewRect;
-      m_procChain->getImageGeometry()->getBoundingRect(viewRect);
-      tif_writer->setAreaOfInterest(viewRect);
-
-      all_good = tif_writer->execute();
-      if (all_good)
-         ossimNotify(ossimNotifyLevel_INFO)<<"Output written to <"<<m_slopeFile<<">"<<endl;
-      else
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)<<"Error encountered writing out slope image to <"
-               <<m_slopeFile<<">."<<endl;
-      }
-   }
-
-   return all_good;
-}
-
-
-void ossimSlopeUtil::printApiJson(ostream& out) const
-{
-   ossimFilename json_path (ossimPreferences::instance()->findPreference("ossim_share_directory"));
-   json_path += "/ossim/util/ossimSlopeApi.json";
-   if (json_path.isReadable())
-   {
-      char line[256];
-      ifstream ifs (json_path.chars());
-      ifs.getline(line, 256);
-
-       while (ifs.good())
-       {
-         out << line << endl;
-         ifs.getline(line, 256);
-       }
-
-       ifs.close();
-   }
-}
-
diff --git a/ossim/src/ossim/util/ossimViewshedUtil.cpp b/ossim/src/ossim/util/ossimViewshedUtil.cpp
deleted file mode 100644
index 1373e39..0000000
--- a/ossim/src/ossim/util/ossimViewshedUtil.cpp
+++ /dev/null
@@ -1,873 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc.
-//
-// License: MIT
-//
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  Oscar Kramer
-//
-//*******************************************************************
-//  $Id: ossimViewshedUtil.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/util/ossimViewshedUtil.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimPolygon.h>
-#include <ossim/base/ossimRtti.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossim2dTo2dShiftTransform.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimPreferences.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/elevation/ossimImageElevationDatabase.h>
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimMemoryImageSource.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-
-ossimViewshedUtil::ossimViewshedUtil()
-:   m_obsHgtAbvTer (1.5),
-    m_visRadius (0.0),
-    m_radials (0),
-    m_initialized (false),
-    m_halfWindow (0),
-    m_outBuffer (NULL),
-    m_gsd (0),
-    m_visibleValue (0),
-    m_hiddenValue (128),
-    m_observerValue (255),
-    m_reticleSize(2),
-    m_simulation (false),
-    m_numThreads(0),
-    m_outputSummary(false),
-    m_startFov(0),
-    m_stopFov(0),
-    m_threadBySector(false),
-    d_accumT(0)
-{
-   m_observerGpt.makeNan();
-}
-
-ossimViewshedUtil::~ossimViewshedUtil()
-{
-   for (int i=0; i<4; ++i)
-      delete [] m_radials[i];
-   delete [] m_radials;
-}
-
-void ossimViewshedUtil::usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-
-   // Add options.
-   addArguments(ap);
-
-   // Write usage.
-   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-
-   ossimNotify(ossimNotifyLevel_INFO)
-   <<"\nComputes the viewshed for the given viewpt coordinates. The output is a binary image "
-   << "with 0 representing hidden points, and 1 representing visible points.\n\n"
-   << "Examples:\n\n"
-   << "    ossim-viewshed --radius 50  28.0 -80.5 output-hlz.tif\n"
-   << "    ossim-viewshed --size 1024  28.0 -80.5 output-hlz.tif\n\n"
-   << "An alternate command line provides switch for observer lat and lon:\n\n"
-   << "    ossim-viewshed --rlz 25 --observer 28.0 -80.5  output-hlz.tif \n"
-   << std::endl;
-}
-
-void ossimViewshedUtil::addArguments(ossimArgumentParser& ap)
-{
-   // Set the general usage:
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options] <obs_lat> <obs_lon> <output-image>";
-   au->setCommandLineUsage(usageString);
-
-   // Set the command line options:
-   au->addCommandLineOption(
-         "--fov <start> <end>",
-         "Optional arguments specifying the field-of"
-         "-view boundary azimuths (in degrees). By default, a 360 deg FOV is"
-         " computed. The arc is taken clockwise from start to end, so for a"
-         " FOV of 225 deg from W, through N to SE, start=270 and end=135");
-   au->addCommandLineOption(
-         "--gsd <meters>",
-         "Specifies output GSD in meters. Defaults to the same "
-         "resolution as input DEM.");
-   au->addCommandLineOption(
-         "--hgt-of-eye <meters>",
-         "Specifies the observers height-of-eye above the "
-         "terrain in meters. Defaults to 1.5 m.");
-   au->addCommandLineOption(
-         "--horizon <filename>",
-         "Experimental. Outputs the max elevation angles "
-         "for all azimuths to <filename>, for horizon profiling.");
-   au->addCommandLineOption(
-         "--dem <filename>",
-         "Specifies the input DEM filename. If none "
-         "provided, the elevation database is referenced as specified in prefs file");
-   au->addCommandLineOption(
-         "--lut <filename>",
-         "Specifies the optional lookup table filename for "
-         "mapping the single-band output image to an RGB. The LUT provided must be "
-         "in the ossimIndexToRgbLutFilter format and must handle the three output "
-         "viewshed values (see --values option).");
-   au->addCommandLineOption(
-         "--radius <meters>",
-         "Specifies max visibility in meters. Required "
-         "unless --size is specified. This option constrains output to a circle, "
-         "similar to a radar display");
-   au->addCommandLineOption(
-         "--request-api",
-         "Causes applications API to be output as JSON to stdout."
-         " Accepts optional filename to store JSON output.");
-   au->addCommandLineOption(
-         "--reticle <int>",
-         "Specifies the size of the reticle at the observer"
-         "location in pixels from the center (i.e., the radius of the reticle). "
-         "Defaults to 2. A value of 0 hides the reticle. See --values option for "
-         "setting reticle color.");
-   au->addCommandLineOption(
-         "--simulation",
-         "For engineering/debug purposes ");
-   au->addCommandLineOption(
-         "--size <int>",
-         "Instead of a visibility radius, directly specifies "
-         "the dimensions of the output product in pixels (output is "
-         "square). Required unless --radius is specified.");
-   au->addCommandLineOption(
-         "--summary",
-         "Causes a product summary to be output to the console.");
-   au->addCommandLineOption(
-         "--tbs",
-         "\"Thread By Sector\". For engineering/debug purposes ");
-   au->addCommandLineOption(
-         "--threads <n>",
-         "Number of threads. Defaults to use all available cores. "
-         "For engineering/debug purposes ");
-   au->addCommandLineOption(
-         "--values <int int int>",
-         "Specifies the pixel values (0-255) for the visible,"
-         " hidden and reticle pixels, respectively. Defaults to visible=null (0), "
-         "hidden=128, and observer position reticle is highlighted with 255.");
-}
-
-bool ossimViewshedUtil::initialize(ossimArgumentParser& ap)
-{
-   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
-   {
-      usage(ap);
-      return false;
-   }
-
-   std::string ts1;
-   ossimArgumentParser::ossimParameter sp1(ts1);
-   std::string ts2;
-   ossimArgumentParser::ossimParameter sp2(ts2);
-   std::string ts3;
-   ossimArgumentParser::ossimParameter sp3(ts3);
-
-   if ( ap.read("--dem", sp1) )
-      m_demFile = ts1;
-
-   if ( ap.read("--fov", sp1, sp2) )
-   {
-      m_startFov = ossimString(ts1).toDouble();
-      m_stopFov = ossimString(ts2).toDouble();
-      if (m_startFov < 0)
-         m_startFov += 360.0;
-   }
-
-   if ( ap.read("--gsd", sp1) )
-      m_gsd = ossimString(ts1).toDouble();
-
-   if ( ap.read("--hgt-of-eye", sp1) )
-      m_obsHgtAbvTer = ossimString(ts1).toDouble();
-
-   if ( ap.read("--horizon", sp1) )
-      m_horizonFile = ossimString(ts1);
-
-   if ( ap.read("--lut", sp1) )
-      m_lutFile = ts1;
-
-   if ( ap.read("--observer", sp1, sp2) )
-   {
-      m_observerGpt.lat = ossimString(ts1).toDouble();
-      m_observerGpt.lon = ossimString(ts2).toDouble();
-      m_observerGpt.hgt = 0.0;
-   }
-
-   if ( ap.read("--radius", sp1) )
-      m_visRadius = ossimString(ts1).toDouble();
-
-   if ( ap.read("--request-api", sp1))
-   {
-      ofstream ofs ( ts1.c_str() );
-      printApiJson(ofs);
-      ofs.close();
-      return false;
-   }
-   if ( ap.read("--request-api"))
-   {
-      printApiJson(cout);
-      return false;
-   }
-   if ( ap.read("--reticle", sp1) )
-      m_reticleSize = ossimString(ts1).toInt32();
-
-   if ( ap.read("--tbs") )
-      m_threadBySector = true;
-
-   if ( ap.read("--simulation") )
-      m_simulation = true;
-
-   if ( ap.read("--summary") )
-      m_outputSummary = true;
-
-   if ( ap.read("--size", sp1) )
-      m_halfWindow = ossimString(ts1).toUInt32() / 2;
-
-   if ( ap.read("--threads", sp1) )
-      m_numThreads = ossimString(ts1).toUInt32();
-
-   if ( ap.read("--values", sp1, sp2, sp3) )
-   {
-      m_visibleValue = ossimString(ts1).toUInt8();
-      m_hiddenValue = ossimString(ts2).toUInt8();
-      m_observerValue = ossimString(ts3).toUInt8();
-   }
-
-   // There should only be the required command line args left:
-   if ( (m_observerGpt.hasNans() && (ap.argc() != 4)) ||
-        (!m_observerGpt.hasNans() && (ap.argc() != 2)) )
-   {
-      usage(ap);
-      return false;
-   }
-
-   // Verify minimum required args were specified:
-   if (m_demFile.empty() && (m_visRadius == 0) && (m_halfWindow == 0))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimViewshedUtil::initialize ERR: Command line is underspecified."
-                  << std::endl;
-      usage(ap);
-      return false;
-   }
-   // Parse the required command line params:
-   int ap_idx = 1;
-   if (m_observerGpt.hasNans())
-   {
-      m_observerGpt.lat =  ossimString(ap[1]).toDouble();
-      m_observerGpt.lon =  ossimString(ap[2]).toDouble();
-      m_observerGpt.hgt =  0;
-      ap_idx = 3;
-   }
-   m_filename = ap[ap_idx];
-
-   return initialize();
-}
-
-bool ossimViewshedUtil::initialize()
-{
-   if (m_observerGpt.hasNans())
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimViewshedUtil::initialize ERR: Observer ground position has not been set."
-                  << std::endl;
-      return false;
-   }
-
-   ossimElevManager* elevMgr = ossimElevManager::instance();
-
-   // If DEM provided as file on command line, reset the elev manager to use only this:
-   if (!m_demFile.empty())
-   {
-      elevMgr->clear();
-      ossimRefPtr<ossimImageElevationDatabase> ied = new ossimImageElevationDatabase;
-      if(!ied->open(m_demFile))
-      {
-         ossimNotify(ossimNotifyLevel_WARN)
-                     << "ossimViewshedUtil::initialize ERR: Cannot open DEM file at <"<<m_demFile<<">\n"
-                     << std::endl;
-         return false;
-      }
-
-      if (m_simulation)
-         ied->setGeoid(new ossimIdentityGeoid);
-
-      elevMgr->addDatabase(ied.get());
-
-      // Possibly the image size has not been specified, in which case we use the same dimensions
-      // as the input dem:
-      if (((m_halfWindow == 0) && (m_visRadius == 0)) || (m_gsd == 0))
-      {
-
-         ossimRefPtr<ossimImageHandler> dem = ossimImageHandlerRegistry::instance()->open(m_demFile);
-         if (!dem.valid())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-                        << "ossimViewshedUtil::initialize ERR: Cannot open DEM file at <"<<m_demFile<<">\n"
-                        << std::endl;
-            return false;
-         }
-         ossimRefPtr<ossimImageGeometry> geom = dem->getImageGeometry();
-         if (!geom.valid())
-         {
-            ossimNotify(ossimNotifyLevel_WARN)
-                        << "ossimViewshedUtil::initialize ERR: Could not establish geometry of DEM file at <"<<m_demFile<<">\n"
-                        << std::endl;
-            return false;
-         }
-
-         // Hack workaround for ossimElevManager::getMeanSpacingMeters() returning 0 when DEM file
-         // specified:
-         if (m_gsd == 0)
-         {
-            ossimDpt gsd = geom->getMetersPerPixel();
-            m_gsd = (gsd.x + gsd.y)/2.0;
-         }
-         if ((m_halfWindow == 0) && (m_visRadius == 0))
-         {
-            ossimIpt size = geom->getImageSize();
-            m_halfWindow = (size.x + size.y) / 4;
-         }
-      }
-
-      // When DEM file specified, need to turn off all defaulting to ellipsoid/geoid to make sure
-      // only the DEM file data is processed:
-      elevMgr->setDefaultHeightAboveEllipsoid(ossim::nan());
-      elevMgr->setUseGeoidIfNullFlag(false);
-   }
-
-   if (m_simulation)
-      elevMgr->setEnableFlag(false);
-
-   // Initialize the height of eye component of observer position:
-   m_observerGpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(m_observerGpt);
-   m_observerGpt.hgt += m_obsHgtAbvTer;
-
-   // Determine if default GSD needs to be computed.
-   if (m_gsd == 0)
-   {
-      // This is incorrectly returning 0 when DEM is provided on command line:
-      m_gsd = ossimElevManager::instance()->getMeanSpacingMeters();
-      if (ossim::isnan(m_gsd))
-         m_gsd = 0;
-   }
-
-   // Compute the bounding rect in pixel space given the visibility range and the GSD:
-   if ((m_gsd == 0) || ((m_visRadius == 0) && (m_halfWindow == 0)))
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-                  << "ossimViewshedUtil::initialize ERR: GSD, visibility radius or image size have not"
-                  " been set."  << std::endl;
-      return false;
-   }
-   if (m_halfWindow == 0)
-      m_halfWindow = ossim::round<ossim_int32, double>(m_visRadius/m_gsd);
-
-   m_viewRect.set_ulx(-m_halfWindow);
-   m_viewRect.set_uly(-m_halfWindow);
-   m_viewRect.set_lrx(m_halfWindow);
-   m_viewRect.set_lry(m_halfWindow);
-   ossimIpt image_size (m_viewRect.width(), m_viewRect.height());
-
-   // Establish the image geometry's map projection:
-   ossimRefPtr<ossimEquDistCylProjection> mapProj = new ossimEquDistCylProjection();
-   mapProj->setOrigin(m_observerGpt);
-   mapProj->setMetersPerPixel(ossimDpt(m_gsd, m_gsd));
-   ossimDpt degPerPixel (mapProj->getDecimalDegreesPerPixel());
-   mapProj->setElevationLookupFlag(true);
-   ossimGpt ulTiePt (m_observerGpt);
-   ulTiePt.lat += degPerPixel.lat * m_halfWindow;
-   ulTiePt.lon -= degPerPixel.lon * m_halfWindow;
-   mapProj->setUlTiePoints(ulTiePt);
-
-   // Need a transform so that we can use the observer point as the output image origin (0,0):
-   ossimRefPtr<ossim2dTo2dTransform> transform =  new ossim2dTo2dShiftTransform(m_viewRect.lr());
-   m_geometry = new ossimImageGeometry(transform.get(), mapProj.get());
-   m_geometry->setImageSize(image_size);
-
-   // Allocate the output image buffer:
-   m_outBuffer = ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1,
-                                                           m_viewRect.width(), m_viewRect.height());
-   if(!m_outBuffer.valid())
-      return false;
-
-   // Initialize the image with all points hidden:
-   m_outBuffer->initialize();
-   m_outBuffer->setImageRectangle(m_viewRect);
-   m_outBuffer->fill(m_visibleValue);
-
-#if 0
-   //### TODO: REMOVE DEBUG BLOCK
-   {
-      ossimDpt viewPt;
-      m_geometry->worldToLocal(m_observerGpt, viewPt);
-      cout<<"ossimViewshedUtil::initialize() should get (0,0)... viewPt="<<viewPt<<endl;
-      ossimGpt testPt(m_observerGpt);
-      testPt.lat -= 100*degPerPixel.y;
-      testPt.lon += 100*degPerPixel.x;
-      m_geometry->worldToLocal(testPt, viewPt);
-      cout<<"ossimViewshedUtil::initialize() should get ~(100,100)... viewPt="<<viewPt<<endl;
-   }
-#endif
-
-   // Initialize the radials:
-   initRadials();
-
-   if (m_outputSummary)
-      dumpProductSummary();
-
-   m_initialized = true;
-   return true;
-}
-
-void ossimViewshedUtil::initRadials()
-{
-   // All eaight sectors' radials have the same azimuths except that the abscissa and ordinate are
-   // reversed between the N-S and E-W sectors, i.e., the N and S sectors use the y-axis as the
-   // abscissa (u) and the x-axis is the ordinate (v). The azimuth (dv/du) is therefore DX/DY for
-   // the north and south, while the azimuth is DY/DX for the east and west sectors. Nevertheless,
-   // each sectors radials must be maintained separately as they contain the max elevation angle.
-
-   // First determine which sectors are involved given the desired FOV:
-   bool* sectorInFov = new bool[8];
-   std::memset(sectorInFov, false, 8);
-   bool crossed_north = true;
-   if (m_stopFov <= m_startFov) // Crosses 0 azimuth
-      crossed_north = false;
-   double azimuth = m_startFov;
-   for (int i=0; (i < 8) && ((azimuth < m_stopFov) || !crossed_north); ++i)
-   {
-      if ((azimuth >= 0) && (azimuth < 45.0))
-         sectorInFov[0] = true;
-      else if (azimuth < 90.0)
-         sectorInFov[1] = true;
-      else if (azimuth < 135.0)
-         sectorInFov[2] = true;
-      else if (azimuth < 180.0)
-         sectorInFov[3] = true;
-      else if (azimuth < 225.0)
-         sectorInFov[4] = true;
-      else if (azimuth < 270.0)
-         sectorInFov[5] = true;
-      else if (azimuth < 315.0)
-         sectorInFov[6] = true;
-      else if (azimuth < 360.0)
-         sectorInFov[7] = true;
-
-      azimuth += 45.0;
-      if (azimuth >= 360.0)
-      {
-         azimuth -= 360.0;
-         crossed_north = true;
-      }
-   }
-
-   // Compute the azimuth slopes for each radial in the sector.
-   m_radials = new Radial* [8];
-   double du = m_halfWindow;
-   for (int sector=0; sector<8; ++sector)
-   {
-      if (!sectorInFov[sector])
-      {
-         m_radials[sector] = 0;
-         continue;
-      }
-
-      ossim_uint32 ridx = 0;
-      m_radials[sector] = new Radial [m_halfWindow+1];
-      for (ossim_int32 dv = 0; dv <= (ossim_int32) m_halfWindow; ++dv)
-      {
-         if (sector & 1) // odd-numbered sector, azimuths computed in reverse order
-            m_radials[sector][m_halfWindow-ridx].azimuth = ((double)dv)/du;
-         else
-            m_radials[sector][ridx].azimuth = ((double)dv)/du;
-         ++ridx;
-      }
-   }
-
-   // Cleanup:
-   delete [] sectorInFov;
-   sectorInFov = 0;
-}
-
-bool ossimViewshedUtil::execute()
-{
-   if (!m_initialized)
-   {
-      initialize();
-      if (!m_initialized)
-         return false;
-   }
-
-   d_accumT = 0;
-   bool success =  false;
-
-   if (m_numThreads == 0)
-      m_numThreads = ossim::getNumberOfThreads();
-
-if (m_numThreads > 1)
-   {
-      ossimRefPtr<ossimJobQueue> jobQueue = new ossimJobQueue();
-      for (int sector=0; sector<8; ++sector)
-      {
-         if (m_radials[sector] == 0)
-            continue;
-
-         if (m_threadBySector)
-         {
-            SectorProcessorJob* job = new SectorProcessorJob(this, sector, m_halfWindow);
-            jobQueue->add(job, false);
-         }
-         else
-         {
-            for (ossim_uint32 r=0; r<=m_halfWindow; ++r)
-            {
-               RadialProcessorJob* job = new RadialProcessorJob(this, sector, r, m_halfWindow);
-               jobQueue->add(job, false);
-            }
-         }
-         if (needsAborting())
-            return false;
-      }
-
-      cout << "\nSubmitting "<<jobQueue->size()<<" jobs..."<<endl;
-      m_jobMtQueue = new ossimJobMultiThreadQueue(jobQueue.get(), m_numThreads);
-
-      // Wait until all radials have been processed before proceeding:
-      cout << "Waiting for job threads to finish..."<<endl;
-      while (m_jobMtQueue->hasJobsToProcess() || m_jobMtQueue->numberOfBusyThreads())
-         OpenThreads::Thread::microSleep(250);
-   }
-   else
-   {
-      // Unthreaded processing:
-      cout << "\nProcessing radials (non-threaded)..."<<endl;
-
-      // Loop over pixels in layer for each sector:
-      for (int sector=0; sector<8; ++sector)
-      {
-         if (m_radials[sector] == 0)
-            continue;
-
-         SectorProcessorJob spj (this, sector, m_halfWindow);
-         spj.start();
-
-         if (needsAborting())
-            return false;
-
-      } // end loop over sectors
-   }
-
-   cout << "Finished processing radials."<<endl;
-   paintReticle();
-
-   cout << "Writing output file..." <<endl;
-   success = writeFile();
-
-   if (!m_horizonFile.empty())
-   {
-      cout << "Writing horizon profile output file..." <<endl;
-      success = writeHorizonProfile();
-   }
-
-   cout << "Returning..."<<endl;
-   return success;
-}
-
-void ossimViewshedUtil::paintReticle()
-{
-   // Highlight the observer position with X reticle:
-   if (m_reticleSize > 0)
-   {
-      m_outBuffer->setValue(0, 0, m_observerValue);
-      for (int i=-m_reticleSize; i<=m_reticleSize; ++i)
-      {
-         m_outBuffer->setValue(i, 0, m_observerValue);
-         m_outBuffer->setValue(0,  i, m_observerValue);
-      }
-   }
-
-   if (m_visRadius == 0)
-   {
-      // Also outline the square area of interest:
-      ossim_int32 hw = (ossim_int32) m_halfWindow;
-      for (ossim_int32 u=-hw; u<=hw; ++u)
-      {
-         m_outBuffer->setValue(  u,-hw, m_observerValue);
-         m_outBuffer->setValue(  u, hw, m_observerValue);
-         m_outBuffer->setValue(-hw,  u, m_observerValue);
-         m_outBuffer->setValue( hw,  u, m_observerValue);
-      }
-   }
-}
-
-bool ossimViewshedUtil::writeFile()
-{
-   ossimIrect rect (0, 0, m_viewRect.width()-1, m_viewRect.height()-1);
-   m_outBuffer->setImageRectangle(rect);
-
-   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
-   memSource->setImage(m_outBuffer);
-   memSource->setImageGeometry(m_geometry.get());
-   ossimImageSource* last_source = memSource.get();
-
-   // See if an LUT is requested:
-   ossimRefPtr<ossimIndexToRgbLutFilter> lutSource = 0;
-   if (!m_lutFile.empty())
-   {
-      ossimKeywordlist lut_kwl;
-      lut_kwl.addFile(m_lutFile);
-      lutSource = new ossimIndexToRgbLutFilter;
-      if (!lutSource->loadState(lut_kwl))
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << "ossimViewshedUtil::writeFile() ERROR: The LUT "
-               "file <"<<m_lutFile<<"> could not be read. Ignoring remap request.\n"<< std::endl;
-         lutSource = 0;
-      }
-      else
-      {
-         lutSource->connectMyInputTo(last_source);
-         lutSource->initialize();
-         last_source = lutSource.get();
-      }
-   }
-
-   // Set up the writer:
-   ossimRefPtr<ossimImageFileWriter> writer = 0;
-   if (m_filename.ext().contains("tif"))
-   {
-      ossimTiffWriter* tif_writer = new ossimTiffWriter();
-      tif_writer->setGeotiffFlag(true);
-      tif_writer->setFilename(m_filename);
-      writer = tif_writer;
-   }
-   else
-   {
-      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(m_filename);
-   }
-   bool success = false;
-   if (writer.valid())
-   {
-      writer->connectMyInputTo(0, last_source);
-      success = writer->execute();
-   }
-
-   return success;
-}
-
-bool ossimViewshedUtil::writeHorizonProfile()
-{
-   // Store the max elevation angles for horizon profiling:
-   double az_deg, arctan;
-   for (ossim_uint32 sector=0; sector<8; ++sector)
-   {
-      if (m_radials[sector] == 0)
-         continue;
-
-      for (ossim_uint32 radial = 0; radial <= m_halfWindow; ++radial)
-      {
-         arctan = ossim::atand(m_radials[sector][radial].azimuth);
-         switch (sector)
-         {
-         case 0: // 0 - 45
-            az_deg = arctan;
-            break;
-         case 1: // 45 - 90
-            az_deg = 90 - arctan;
-            break;
-         case 2: // 90 - 135
-            az_deg = 90 + arctan;
-            break;
-         case 3: // 135 - 180
-            az_deg = 180 - arctan;
-            break;
-         case 4: // 180 - 225
-            az_deg = 180 + arctan;
-            break;
-         case 5: // 225 - 270
-            az_deg = 270 - arctan;
-            break;
-         case 6: // 270 - 315
-            az_deg = 270 + arctan;
-            break;
-         case 7: // 315 - 360
-            az_deg = 360 - arctan;
-            break;
-         default:
-            break;
-         }
-
-         m_horizonMap.insert(pair<double, double>(az_deg, m_radials[sector][radial].elevation));
-      }
-   }
-
-   // Open output file and write the map:
-   ofstream fstr (m_horizonFile.chars());
-   if (!fstr.is_open())
-      return false;
-   std::map<double, double>::iterator iter = m_horizonMap.begin();
-   while (iter != m_horizonMap.end())
-   {
-      fstr << iter->first << ", " << iter->second << endl;
-      ++iter;
-   }
-
-   fstr.close();
-   return true;
-}
-
-void ossimViewshedUtil::dumpProductSummary() const
-{
-   ossimIpt isize (m_geometry->getImageSize());
-   cout  << "\nSummary of Viewshed product image:"
-         << "\n   Output file name: " << m_filename
-         << "\n   Image size: " << isize
-         << "\n   product GSD: " << m_gsd << " m"
-         << "\n   View radius: " << (int) (m_gsd * isize.x/2.0) << " m"
-         << "\n   Scalar type: " << m_outBuffer->getScalarTypeAsString()
-         << endl;
-}
-
-void SectorProcessorJob::start()
-{
-   // Loop over all the sector's radials and walk over each one.
-   for (ossim_uint32 r=0; r<=m_numRadials; ++r)
-      RadialProcessor::doRadial(m_vsUtil, m_sector, r);
-}
-
-
-void RadialProcessorJob::start()
-{
-   RadialProcessor::doRadial(m_vsUtil, m_sector, m_radial);
-}
-
-OpenThreads::ReadWriteMutex RadialProcessor::m_bufMutex;
-OpenThreads::ReadWriteMutex RadialProcessor::m_radMutex;
-
-void RadialProcessor::doRadial(ossimViewshedUtil* vsUtil,
-                               ossim_uint32 sector,
-                               ossim_uint32 radial)
-{
-   double v;
-   ossimDpt pt_i;
-   double elev_i, elev;
-   double r2_max = vsUtil->m_halfWindow*vsUtil->m_halfWindow;
-
-   // Walk along the radial using the appropriate coordinate abscissa for that sector and
-   // compute ordinate using the radials azimuth:
-   for (double u=1.0; u <= (double) vsUtil->m_halfWindow; u += 1.0)
-   {
-      // Compute ordinate from abscissa and slope of this radial:
-      v = vsUtil->m_radials[sector][radial].azimuth*(u);
-      switch (sector)
-      {
-      case 0: // N-NE, (u, v) = (-y, x)
-         pt_i.y = -u;
-         pt_i.x = v;
-         break;
-      case 1: // NE-E, (u, v) = (x, -y)
-         pt_i.x = u;
-         pt_i.y = -v;
-         break;
-      case 2: // E-SE, (u, v) = (x, y)
-         pt_i.x = u;
-         pt_i.y = v;
-         break;
-      case 3: // SE-S, (u, v) = (y, x)
-         pt_i.y = u;
-         pt_i.x = v;
-         break;
-      case 4: // S-SW, (u, v) = (y, -x)
-         pt_i.y = u;
-         pt_i.x = -v;
-         break;
-      case 5: // SW-W, (u, v) = (-x, y)
-         pt_i.x = -u;
-         pt_i.y = v;
-         break;
-      case 6: // W-NW, (u, v) = (-x, -y)
-         pt_i.x = -u;
-         pt_i.y = -v;
-         break;
-      case 7: // NW-N, (u, v) = (-y, -x)
-         pt_i.y = -u;
-         pt_i.x = -v;
-         break;
-      default:
-         break;
-      }
-
-      ossimIpt ipt (ossim::round<ossim_int32,double>(pt_i.x),
-                    ossim::round<ossim_int32,double>(pt_i.y));
-
-      // Check if we passed beyong the visibilty radius, and exit loop if so:
-      if ((vsUtil->m_visRadius > 0) && ((u*u + v*v) >= r2_max))
-      {
-         OpenThreads::ScopedWriteLock lock (m_bufMutex);
-         vsUtil->m_outBuffer->setValue(ipt.x, ipt.y, vsUtil->m_observerValue);
-         break;
-      }
-
-      // Fetch the pixel value as the elevation value and compute elevation angle from
-      // the observer pt as dz/dx
-      ossimGpt gpt_i;
-      vsUtil->m_geometry->localToWorld(pt_i, gpt_i);
-
-      if (vsUtil->m_simulation && ossim::isnan(gpt_i.hgt))
-         gpt_i.hgt = vsUtil->m_observerGpt.hgt-vsUtil->m_obsHgtAbvTer; // ground level
-
-      else if (!gpt_i.hasNans())
-      {
-         // Compare elev angle to max angle latched so far along this radial:
-         elev_i = (gpt_i.hgt - vsUtil->m_observerGpt.hgt) / u;
-         elev = vsUtil->m_radials[sector][radial].elevation;
-         if (elev_i > elev)
-         {
-            // point is visible, latch this line-of-sight as the new max elevation angle for this
-            // radial, and mark the output pixel as visible:
-            //   m_outBuffer->setValue(ossim::round<ossim_int32,double>(pt_i.x),
-            //                           ossim::round<ossim_int32,double>(pt_i.y), m_visibleValue);
-            //OpenThreads::ScopedWriteLock lock (m_radMutex);
-            vsUtil->m_radials[sector][radial].elevation = elev_i;
-         }
-         else
-         {
-            OpenThreads::ScopedWriteLock lock (m_bufMutex);
-            vsUtil->m_outBuffer->setValue(ipt.x, ipt.y, vsUtil->m_hiddenValue);
-         }
-      }
-   } // end loop over radial's abscissas
-}
-
-void ossimViewshedUtil::printApiJson(ostream& out) const
-{
-   ossimFilename json_path (ossimPreferences::instance()->findPreference("ossim_share_directory"));
-   json_path += "/ossim/util/ossimViewshedApi.json";
-   if (json_path.isReadable())
-   {
-      char line[256];
-      ifstream ifs (json_path.chars());
-      ifs.getline(line, 256);
-
-       while (ifs.good())
-       {
-         out << line << endl;
-         ifs.getline(line, 256);
-       }
-
-       ifs.close();
-   }
-}
-
diff --git a/ossim/src/ossim/vec/makefile.vc b/ossim/src/ossim/vec/makefile.vc
deleted file mode 100644
index e40c77c..0000000
--- a/ossim/src/ossim/vec/makefile.vc
+++ /dev/null
@@ -1,25 +0,0 @@
-###
-# $Id: makefile.vc 13289 2008-07-25 15:49:55Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-ossimVpfBoundingRecordTable.obj \
-ossimVpfCoverage.obj \
-ossimVpfDatabase.obj \
-ossimVpfDatabaseHeader.obj \
-ossimVpfDatabaseHeaderTableValidator.obj \
-ossimVpfExtent.obj \
-ossimVpfFeatureClass.obj \
-ossimVpfFeatureClassSchema.obj \
-ossimVpfLibraryAttributeTableValidator.obj \
-ossimVpfLibrary.obj \
-ossimVpfTable.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/vec/ossimVpfDatabase.cpp b/ossim/src/ossim/vec/ossimVpfDatabase.cpp
deleted file mode 100644
index 09a2548..0000000
--- a/ossim/src/ossim/vec/ossimVpfDatabase.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-//*******************************************************************
-// License:  See top level LICENSE.txt file.
-//
-// Author: Garrett Potts
-// 
-// Description: This class extends the stl's string class.
-//
-//********************************************************************
-// $Id: ossimVpfDatabase.cpp 19636 2011-05-24 16:48:45Z gpotts $
-#include <ossim/vec/ossimVpfDatabase.h>
-#include <ossim/vec/ossimVpfDatabaseHeader.h>
-#include <ossim/vec/ossimVpfDatabaseHeaderTableValidator.h>
-#include <ossim/vec/ossimVpfLibraryAttributeTableValidator.h>
-#include <ossim/vec/ossimVpfTable.h>
-#include <ossim/vec/ossimVpfLibrary.h>
-#include <ossim/base/ossimErrorCodes.h>
-
-ossimVpfDatabase::ossimVpfDatabase()
-   :theDatabaseHeaderTable(""),
-    theLibraryAttributeTable(""),
-    theOpenedFlag(false)
-{
-}
-
-ossimVpfDatabase::~ossimVpfDatabase()
-{
-   deleteLibraryList();
-   
-   closeDatabase();
-}
-
-bool ossimVpfDatabase::openDatabase(const ossimFilename& filename)
-{
-   bool result = true;
-
-   ossimFilename tempFilename = filename;
-
-   tempFilename.convertBackToForwardSlashes();
-
-   // we should have two table to look at for the database.
-   // 1) database header (dht) 2) and the Library attribute (lat)
-   theDatabaseHeaderTable   = ossimFilename(tempFilename.path()).dirCat("dht");
-   theLibraryAttributeTable = ossimFilename(tempFilename.path()).dirCat("lat");
-
-   if(theDatabaseHeaderTable.exists() &&
-      theLibraryAttributeTable.exists())
-   {
-      ossimVpfTable table;
-      // now lets see if they are valid tables
-      result = table.openTable(theDatabaseHeaderTable);
-      if(result&&
-         !ossimVpfDatabaseHeaderTableValidator().isValid(table))
-      {
-         result =  false;
-      }
-      
-      result = table.openTable(theLibraryAttributeTable);
-      if((result) &&!ossimVpfLibraryAttributeTableValidator().isValid(table))
-      {
-         result = false;
-      }
-   }
-   else
-   {
-      result = false;
-   }
-
-   if(result)
-   {
-      theOpenedFlag = true;
-      initializeLibraryList();
-   }
-   
-   return result;
-}
-
-void ossimVpfDatabase::closeDatabase()
-{
-   theLibraryAttributeTable = "";
-   theDatabaseHeaderTable   = "";
-   theOpenedFlag = false;
-   deleteLibraryList();
-}
-
-
-ossimFilename ossimVpfDatabase::getPath()const
-{
-   // we can use either table name since all we need is the path
-   return theLibraryAttributeTable.path();
-}
-
-long ossimVpfDatabase::getNumberOfLibraries()const
-{
-   return (long)theVpfLibraryList.size();
-}
-
-ossimVpfLibrary* ossimVpfDatabase::getLibrary(unsigned long libraryNumber)
-{
-
-   if(libraryNumber < theVpfLibraryList.size())
-   {
-      return theVpfLibraryList[libraryNumber];
-   }
-   
-   return NULL;
-}
-
-ossimVpfLibrary* ossimVpfDatabase::getLibrary(const ossimString& name)
-{
-   for(long index = 0; index < (long)theVpfLibraryList.size(); ++index)
-   {
-      if(theVpfLibraryList[index]->getName() == name)
-      {
-         return theVpfLibraryList[index];
-      }
-   }
-   
-   return NULL;
-}
-
-
-bool ossimVpfDatabase::isOpened()const
-{
-   return theOpenedFlag;
-}
-
-vector<ossimString> ossimVpfDatabase::getLibraryNames()const
-{
-
-   ossimVpfTable table;
-
-   if(table.openTable(theLibraryAttributeTable))
-   {
-      return table.getColumnValues("LIBRARY_NAME");
-   }
-   
-   return vector<ossimString>();
-}
-
-vector<ossimString> ossimVpfDatabase::getLibraryNamesFullPath()const
-{
-   vector<ossimString> result;
-   
-   ossimVpfTable table;
-
-   if(table.openTable(theLibraryAttributeTable))
-   {
-      result = table.getColumnValues("LIBRARY_NAME");
-   }
-
-   for(long index=0; index < (long)result.size();index++)
-   {
-      result[index] = ossimString(theLibraryAttributeTable.path()) +
-                      ossimString("/") +
-                      result[index];
-   }
-   
-   return result;
-}
-
-ossimFilename ossimVpfDatabase::getLibraryAttributeTable()const
-{
-   return theLibraryAttributeTable;
-}
-
-void ossimVpfDatabase::initializeLibraryList()
-{
-   // make sure the library list is deleted
-   deleteLibraryList();
-   vector<ossimString> libraryNames = getLibraryNames();
-   for(long index = 0; index < (long)libraryNames.size(); index++)
-   {
-      ossimVpfLibrary *library = new ossimVpfLibrary;
-      library->openLibrary(this,
-                           libraryNames[index],
-                           getPath().dirCat(libraryNames[index]));
-      theVpfLibraryList.push_back(library);
-   }
-}
-
-void ossimVpfDatabase::deleteLibraryList()
-{
-   for(long idx = 0; idx <(long)theVpfLibraryList.size(); idx++)
-   {
-      delete theVpfLibraryList[idx];
-      theVpfLibraryList[idx] = 0;
-   }
-
-   theVpfLibraryList.clear();
-}
diff --git a/ossim/src/ossim/vec/ossimVpfDatabaseHeaderTableValidator.cpp b/ossim/src/ossim/vec/ossimVpfDatabaseHeaderTableValidator.cpp
deleted file mode 100644
index b49df27..0000000
--- a/ossim/src/ossim/vec/ossimVpfDatabaseHeaderTableValidator.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-//-----------------------------------------------------------------
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//-----------------------------------------------------------------
-#include <ossim/vec/ossimVpfDatabaseHeaderTableValidator.h>
-#include <ossim/vec/ossimVpfTable.h>
-
-ossimVpfDatabaseHeaderTableValidator::~ossimVpfDatabaseHeaderTableValidator()
-{
-}
-
-bool ossimVpfDatabaseHeaderTableValidator::isValid(ossimVpfTable& aTable)const
-{
-   // make sure the table is not null
-   if(&aTable == NULL)
-   {
-      return false;
-   }
-
-   // and make sure that the table is not closed
-   if(aTable.isClosed())
-   {
-      return false;
-   }
-
-   // get the table data defined in vpf_util/vpftable.h"
-   const vpf_table_type* data = aTable.getVpfTableData();
-
-   if(!data)
-   {
-      return false;
-   }
-   
-   // if the file is not open then we can't validate
-   if(!data->fp)
-   {
-      return false;
-   }
-
-   // The way that we will validate is to see if the columns of a dht
-   // exist.  if the column didn't exist then the position
-   // will be negative
-   long column = table_pos("ID", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("VPF_VERSION", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("DATABASE_NAME", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("DATABASE_DESC", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("MEDIA_STANDARD", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("ORIGINATOR", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("ADDRESSEE", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("MEDIA_VOLUMES", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("SEQ_NUMBERS", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("NUM_DATA_SETS", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("SECURITY_CLASS", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("DOWNGRADING", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("DOWNGRADE_DATE", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("RELEASABILITY", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("TRANSMITTAL_ID", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("EDITION_NUMBER", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   column = table_pos("EDITION_DATE", *data);
-   if(column < 0)
-   {
-      return false;
-   }
-   
-   return true;
-
-}
-
diff --git a/ossim/src/ossim/vec/ossimVpfFeatureClass.cpp b/ossim/src/ossim/vec/ossimVpfFeatureClass.cpp
deleted file mode 100644
index 0abcade..0000000
--- a/ossim/src/ossim/vec/ossimVpfFeatureClass.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-#include <algorithm>
-using namespace std;
-
-#include <ossim/vec/ossimVpfFeatureClass.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/vec/ossimVpfCoverage.h>
-#include <ossim/base/ossimErrorCodes.h>
-#include <ossim/vec/ossimVpfTable.h>
-
-#include <string.h> 
-
-#ifndef NULL
-#include <stddef.h>
-#endif
-
-ossimVpfFeatureClass::ossimVpfFeatureClass()
-{
-}
-
-
-bool ossimVpfFeatureClass::openFeatureClass(const ossimString& featureClassName,
-                                            const ossimFilename& featureClassFullPath,
-                                            const ossimFilename& table1,
-                                            const ossimString&   columnNameIdTable1,
-                                            const ossimFilename& table2,
-                                            const ossimString&   columnNameIdTable2)
-{
-   theFeatureClassFullPath = featureClassFullPath;
-   theFeatureClassName     = featureClassName;
-   theTableName1           = table1;
-   theColumnNameId1        = columnNameIdTable1;
-   theTableName2           = table2;
-   theColumnNameId2        = columnNameIdTable2;
-   
-   ossimVpfTable t1;
-   ossimVpfTable t2;
-
-   ossimFilename t1Name = getTable1();
-   ossimFilename t2Name = getTable2();
-
-   if((!t1.openTable(t1Name))||
-      (!t2.openTable(t2Name)))
-     {
-       
-       return false;
-     }
-   
-   return true;
-}
-
-const ossimString& ossimVpfFeatureClass::getName()const
-{
-  return theFeatureClassName;
-  
-}
-
-bool ossimVpfFeatureClass::isPrimitive(const ossimString& featureName)
-{
-   // make sure we have forward slashes
-   ossimFilename filename(featureName.trim());   
-   filename.convertBackToForwardSlashes();
-   
-   ossimString copyOfFeature = filename;
-
-   // find
-   const char* temp = strrchr(copyOfFeature.c_str(), '/');
-
-   ossimString value;
-   if(temp)
-   {
-      ++temp;
-      value = temp;
-   }
-   else
-   {
-      
-      value = copyOfFeature;
-   }
-
-   value = value.downcase();
-   return( (value == "end") ||
-           (value == "cnd") ||
-           (value == "edg") ||
-           (value == "fac") ||
-           (value == "txt") );
-}
-
-bool ossimVpfFeatureClass::isSimpleFeature(const ossimString& featureName)
-{
-   // find the suffix
-   ossimString value = strrchr(featureName.trim().c_str(), '.');
-
-   // the suffix will be null or empty string if not found.
-   if(value == "")
-   {
-      return false;
-   }
-   // make case insensitive
-   value = value.downcase();
-
-   return ( (value == ".pft")||
-            (value == ".lft")||
-            (value == ".aft")||
-            (value == ".tft"));
-}
-
-bool ossimVpfFeatureClass::isComplexFeature(const ossimString& featureName)
-{
-   const char* suffix = strrchr(featureName.trim(), '.');
-   
-   if (!suffix)
-   {
-      return false;
-   }
-
-   ossimString value = ossimString(suffix).downcase();
-   
-   return (value == ".cft");
-}
-
-bool ossimVpfFeatureClass::isFeature(const ossimString& featureName)
-{
-   return (isSimpleFeature(featureName) || isComplexFeature(featureName));
-}
-
-bool ossimVpfFeatureClass::isJoin(const ossimString& featureName)
-{
-   ossimString value = strrchr(featureName.c_str(), '.');
-   if(value == "")
-   {
-      return false;
-   }
-   
-   value = value.downcase();
-   
-   return ( (value == ".cjt")||
-            (value == ".pjt")||
-            (value == ".ljt")||
-            (value == ".ajt")||
-            (value == ".tjt"));
-}
-
-ossimFilename ossimVpfFeatureClass::getTable1()const
-{
-  return theFeatureClassFullPath.dirCat(theTableName1);
-}
-
-ossimFilename ossimVpfFeatureClass::getTable2()const
-{
-  return theFeatureClassFullPath.dirCat(theTableName2);
-}
diff --git a/ossim/src/ossim/vec/ossimVpfFeatureClassSchema.cpp b/ossim/src/ossim/vec/ossimVpfFeatureClassSchema.cpp
deleted file mode 100644
index 1524a33..0000000
--- a/ossim/src/ossim/vec/ossimVpfFeatureClassSchema.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-//*******************************************************************
-// Copyright (C) 2000 ImageLinks Inc. 
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author: Garrett Potts
-//
-//********************************************************************
-// $Id: ossimVpfFeatureClassSchema.cpp 23664 2015-12-14 14:17:27Z dburken $
-#include <ossim/vec/ossimVpfLibrary.h>
-#include <ossim/vec/ossimVpfCoverage.h>
-#include <ossim/vec/ossimVpfFeatureClassSchema.h>
-#include <ossim/vec/ossimVpfFeatureClass.h>
-
-ossimVpfFeatureClassSchema::ossimVpfFeatureClassSchema()
-   :theCoverage(NULL)
-{
-}
-
-bool ossimVpfFeatureClassSchema::openSchema(ossimVpfCoverage* coverage)
-{
-   theCoverage = coverage;
-   bool result = false;
-
-   if(theCoverage)
-   {
-      theSchemaTableName = theCoverage->getPath().dirCat("fcs");
-
-      if(theSchemaTableName.exists())
-      {
-         result = openTable(theSchemaTableName);
-
-         if(result)
-         {
-            result = validateColumnNames();
-         }
-         if(result)
-         {
-            setFeatureClassMapping();
-         }
-      }
-   }
-   
-   return result;
-}
-
-void ossimVpfFeatureClassSchema::closeTable()
-{
-   ossimVpfTable::closeTable();
-   theFeatureClassMap.clear();
-}
-
-void ossimVpfFeatureClassSchema::getFeatureClasses(std::vector<ossimString>& featureClassArray)const
-{
-   featureClassArray.clear();
-   std::map<ossimString, ossimVpfFeatureClassSchemaNode, ossimStringLtstr>::const_iterator featureClassIter = theFeatureClassMap.begin();
-
-   while(featureClassIter != theFeatureClassMap.end())
-   {
-      featureClassArray.push_back((*featureClassIter).first);
-      ++featureClassIter;
-   }
-}
-
-bool ossimVpfFeatureClassSchema::getFeatureClassNode(const ossimString& featureClass,
-                                                     ossimVpfFeatureClassSchemaNode& featureClassNode)const
-{
-   std::map<ossimString, ossimVpfFeatureClassSchemaNode, ossimStringLtstr>::const_iterator fIter = theFeatureClassMap.find(featureClass);
-
-   if(fIter != theFeatureClassMap.end())
-   {
-      featureClassNode = (*fIter).second;
-      return true;
-   }
-
-   return false;
-}
-
-ossim_int32 ossimVpfFeatureClassSchema::getNumberOfFeatureClasses()const
-{
-   return (ossim_int32)theFeatureClassMap.size();
-}
-
-bool ossimVpfFeatureClassSchema::validateColumnNames()const
-{
-   if(isClosed()) return false;
-   return ((getColumnPosition("feature_class")>=0)&&
-           (getColumnPosition("table1")>=0)&&
-           (getColumnPosition("table1_key")>=0)&&
-           (getColumnPosition("table2")>=0)&&
-           (getColumnPosition("table2_key")>=0));
-}
-
-void ossimVpfFeatureClassSchema::setFeatureClassMapping()
-{
-   if(!isClosed())
-   {
-      ossim_int32 featureIdx = getColumnPosition("feature_class");
-      ossim_int32 table1Idx = getColumnPosition("table1");
-      ossim_int32 table1KeyIdx = getColumnPosition("table1_key");
-      ossim_int32 table2Idx = getColumnPosition("table2");
-      ossim_int32 table2KeyIdx = getColumnPosition("table2_key");
-      reset();
-      if(getNumberOfRows() > 0)
-      {
-         row_type row;
-         const int ROWS = getNumberOfRows();
-         for(int rowIdx = 1; rowIdx <= ROWS; ++rowIdx)
-         {
-            if(rowIdx == 1)
-            {
-               row = read_row(rowIdx,
-                              *theTableInformation);
-            }
-            else
-            {
-               row = read_next_row(*theTableInformation);
-            }
-            ossimFilename primitiveTable =  getColumnValueAsString(row,
-                                                                   table2Idx);
-            if(ossimVpfFeatureClass::isPrimitive(primitiveTable))
-            {
-               ossimString primitiveTableKey = getColumnValueAsString(row,
-                                                                      table2KeyIdx);
-               ossimFilename table = getColumnValueAsString(row,
-                                                            table1Idx);
-               ossimString tableKey = getColumnValueAsString(row,
-                                                             table1KeyIdx);
-               ossimString featureClass = getColumnValueAsString(row,
-                                                                 featureIdx);
-               ossimVpfFeatureClassSchemaNode node(table,
-                                                   tableKey,
-                                                   primitiveTable,
-                                                   primitiveTableKey);
-               
-               theFeatureClassMap.insert(make_pair(featureClass,
-                                                   node));
-            }
-            
-            free_row(row, *theTableInformation);
-         }
-      }
-   }
-}
-
-
-
diff --git a/ossim/src/ossim/vpfutil/linklist.c b/ossim/src/ossim/vpfutil/linklist.c
deleted file mode 100644
index d9adceb..0000000
--- a/ossim/src/ossim/vpfutil/linklist.c
+++ /dev/null
@@ -1,712 +0,0 @@
-/*************************************************************************
- *
- *N  Module LINKLIST.C
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This module contains functions that make up a singly linked list
- *     data structure.  It is generic in the sense that it can hold any
- *     type of data, including user-defined types and structures.  That
- *     is why you must treat the data element as a void pointer and pass
- *     in its size when inserting into the list.  These routines are
- *     assured of working with "non-pointer" types of data elements.
- *     If you try storing other lists, or structures with pointers hanging
- *     off of them, the results will become unpredictable.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    N/A
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    linked_list_type ll_init();
- *    int ll_empty( linked_list_type list );
- *    position_type ll_first( linked_list_type list );
- *    position_type ll_last( linked_list_type list );
- *    position_type ll_next( position_type position );
- *    position_type ll_previous( position_type position, linked_list_type
- *                  list );
- *    int ll_end( position_type position );
- *    void ll_element( position_type position, void *element );
- *    void ll_insert( void *element, unsigned size, position_type position );
- *    void ll_delete( position_type position );
- *    void ll_reset( linked_list_type list );
- *    position_type ll_locate( void *element, linked_list_type list );
- *    void ll_replace( void *element, position_type position );
- *E
- *************************************************************************/
-#ifdef __MSDOS__
-#include <alloc.h>
-#include <mem.h>
-#else
-#ifdef __APPLE__ 
-#include <sys/types.h>
-#include <sys/malloc.h>
-#else
-#ifndef __FreeBSD__
-#include <malloc.h>
-#include <string.h>
-#endif
-#endif
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ossim/vpfutil/linklist.h>
-#include <string.h>
-
-#ifndef __MSDOS__
-#define farmalloc malloc
-#define farfree free
-#define movmem(a,b,c) memmove(b,a,c)
-#endif
-
-/*************************************************************************
- *
- *N  ll_init
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function allocates and initializes a new linked list structure.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    ll_init <output> == (linked_list_type) initialized head of the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-linked_list_type ll_init()
-{
-   linked_list_type list;
-
-   if ((list = (linked_list_type) farmalloc( sizeof(cell_type) ))==NULL) {
-      printf("Out of memory in ll_init()\n");
-      exit(1);
-   }
-   list->element = NULL;
-   list->element_size = 0;
-   list->next = NULL;
-   return list;
-}
-
-
-/*************************************************************************
- *
- *N  ll_empty
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function TRUE if the list is empty and FALSE if it is not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    list      <input> == (linked_list_type) linked list being checked.
- *    ll_empty <output> == (int) boolean function result.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-int ll_empty( linked_list_type list )
-{
-   if (list == NULL) return TRUE;
-   if (list->next == NULL)
-      return TRUE;
-   else
-      return FALSE;
-}
-
-
-/*************************************************************************
- *
- *N  ll_first
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the head of the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    list      <input> == (linked_list_type) linked list.
- *    ll_first <output> == (position_type) head of the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-position_type ll_first( linked_list_type list )
-{
-   return ((position_type) list);
-}
-
-
-/*************************************************************************
- *
- *N  ll_last
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns *THE* last position in the list, which is
- *     not useable.  Use ll_previous to get to the las USEABLE link in
- *     the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    list     <input> == (linked_list_type) linked list.
- *    ll_last <output> == (position_type) tail of the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-position_type ll_last( linked_list_type list )
-{
-   position_type p;
-
-   p = (position_type) list;
-   while (p->next != NULL)
-      p = p->next;
-   return p;
-}
-
-
-/*************************************************************************
- *
- *N  ll_next
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the next position in the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    position <input> == (position_type) current position in the list.
- *    ll_next <output> == (position_type) next position in the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-position_type ll_next( position_type position )
-{
-   return(position->next);
-}
-
-
-/*************************************************************************
- *
- *N  ll_previous
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the previous position in the list.  Note:
- *     This is a singly linked list -> no backward pointer -> this
- *     operation is relatively inefficient.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    position     <input> == (position_type) current position.
- *    list         <input> == (linked_list_type) linked list.
- *    ll_previous <output> == (position_type) previous position in the list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-position_type ll_previous( position_type    position,
-			   linked_list_type list )
-{
-   position_type p;
-
-   if (position==list) return(position);
-   p = list;
-   while (p->next != position)
-      p = p->next;
-   return(p);
-}
-
-
-/*************************************************************************
- *
- *N  ll_end
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines if the given position is at the end of the
- *     list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    position <input> == (position_type) current position in the list.
- *    ll_end  <output> == (int) TRUE  -- if position is the end of the list.
- *                              FALSE -- if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-int ll_end( position_type position )
-{
-   if (position == NULL)
-      return(TRUE);
-   else {
-      if (position->next == NULL)
-	 return(TRUE);
-      else
-	 return(FALSE);
-   }
-}
-
-
-/*************************************************************************
- *
- *N  ll_element
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function copies the element at position in the list into the
- *     contents of element.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    position <input> == (position_type) position in the list.
- *    element <output> == (void *) pointer to the element data.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-void ll_element( position_type position,
-		 void         *element )
-{
-   movmem(position->next->element,element,position->next->element_size);
-}
-
-/*************************************************************************
- *
- *N  ll_insert
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function inserts a new cell into the list at position that will
- *     contain the data pointed to by element.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    element  <input> == (void *) pointer to the data element to insert.
- *    size     <input> == (unsigned) size of the data element.
- *    position <input> == (position_type) position to insert the new cell.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-void ll_insert( void          *element,
-		unsigned      size,
-		position_type position )
-{
-   position_type temp;
-
-   if ((temp = (position_type) farmalloc( sizeof(cell_type) )) == NULL) {
-      printf("out of memory\n");
-      abort();
-   }
-   temp->next = position->next;
-   position->next = temp;
-   temp->element_size = size;
-   if ((temp->element = farmalloc( size ))==NULL) {
-      printf("out of memory\n");
-      abort();
-   }
-   movmem(element,temp->element,size);
-
-}
-
-
-/*************************************************************************
- *
- *N  ll_delete
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function deletes and disposes of a cell from the linked list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    position <input> == (position_type) position in the list to delete.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-void ll_delete( position_type position )
-{
-   position_type    p;
-
-   if (position != NULL) {  /* Cut the element out of the chain */
-      p = position->next;
-      position->next = p->next;
-      farfree( p->element );
-      farfree( p );
-   }
-}
-
-
-
-
-/*************************************************************************
- *
- *N  ll_reset
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function empties out a linked list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    list <inout> == (linked_list_type) linked list to be emptied.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    void ll_delete( position_type position );
- *    int ll_empty( linked_list_type list );
- *E
- *************************************************************************/
-void ll_reset( linked_list_type list )
-{
-   while (! ll_empty(list))
-      ll_delete(ll_first(list));
-   farfree(list);
-   list = NULL;
-}
-
-
-
-/*************************************************************************
- *
- *N  ll_locate
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function locates a position in the list by comparing data.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    element <input> == (void *) pointer to the data element to locate.
- *    list    <input> == (linked_list_type) linked list.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-position_type ll_locate( void             *element,
-			 linked_list_type list )
-{
-   position_type p;
-
-   p = list;
-   while (p->next != NULL) {
-      if ( memcmp(p->next->element,element,p->next->element_size) == 0 )
-	 return p;
-      else
-	 p = p->next;
-   }
-   return NULL;
-}
-
-
-/*************************************************************************
- *
- *N  ll_replace
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function replaces an element in the linked list at the given
- *     position.  WARNING:  The new data element must be the same size as
- *     the previous data element or you will get some rather INTERESTING
- *     results.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    element  <input> == (void *) data element to replace existing data.
- *    position <input> == (position_type) position in the list to replace
- *                        the data.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Feb. 1990                      DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-void ll_replace( void          *element,
-		 position_type position )
-{
-   movmem(element,position->next->element,position->next->element_size);
-}
-
-
-
diff --git a/ossim/src/ossim/vpfutil/makefile.vc b/ossim/src/ossim/vpfutil/makefile.vc
deleted file mode 100644
index 2c9d1a1..0000000
--- a/ossim/src/ossim/vpfutil/makefile.vc
+++ /dev/null
@@ -1,36 +0,0 @@
-###
-# $Id: makefile.vc 9234 2006-07-05 21:52:33Z dburken $
-#
-# Windows nmake make file.
-###
-OSSIM_ROOT	=	..\..\..
-!INCLUDE $(OSSIM_ROOT)\nmake.opt
-
-OBJ = \
-bitarray.obj \
-distance.obj \
-linklist.obj \
-polygrf.obj \
-set.obj \
-vpfclip.obj \
-vpfcntnt.obj \
-vpfdict.obj \
-vpfdisp.obj \
-vpfdraw.obj \
-vpfmisc.obj \
-vpfnear.obj \
-vpfprim.obj \
-vpfptply.obj \
-vpfquery.obj \
-vpfread.obj \
-vpfrelat.obj \
-vpfselec.obj \
-vpfspx.obj \
-vpftable.obj \
-vpftidx.obj \
-vpfwrite.obj
-
-default:	$(OBJ)
-
-clean:
-	$(RM) *.obj
diff --git a/ossim/src/ossim/vpfutil/vpfclip.c b/ossim/src/ossim/vpfutil/vpfclip.c
deleted file mode 100644
index 7826197..0000000
--- a/ossim/src/ossim/vpfutil/vpfclip.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*************************************************************************
- *
- *N  Module VPFCLIP
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This module geometrically clips an edge table to a given map
- *     extent and creates a new edge table.  It does not attempt to
- *     maintain topology, nor does it maintain its relationship to
- *     any feature tables associated with it.  Its intent is to be
- *     used only for the Library Reference coverage.  It may also serve
- *     as a basic starting point for a complete GIS clipping algorithm.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    N/A
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    Dec 1991                     DOS Turbo C
- *E
- *************************************************************************/
-
-
-#include <stdio.h>
-#include <math.h>
-#include <stdlib.h>
-
-#if defined(__MSDOS__) || defined(__MINGW32__)
-#  include <malloc.h>
-#  include <mem.h>
-#else
-#  ifdef __APPLE__ 
-#    include <sys/types.h>
-#    include <sys/malloc.h>
-#  else
-#    ifndef __FreeBSD__
-#      include <malloc.h>
-#      include <string.h>
-#    endif
-#  endif
-#endif
-
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfview.h>
-#include <ossim/vpfutil/vpfprim.h>
-#  ifndef min
-#    define min(a,b) ((a) <= (b) ? (a) : (b))
-#  endif
-#  ifndef max
-#    define max(a,b) ((a) <= (b) ? (b) : (a))
-#  endif
-
-typedef struct {
-   float x1, y1, x2, y2;
-} line_segment_type;
-
-/* Defined in VPFPTPLY.C */
-int intersect( line_segment_type l1, line_segment_type l2,
-	       float *xint, float *yint );
-
-edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table );
-
-/* Determine if a line segment intersects a box. 		   */
-/* If so return the intersection coordinate in the parameter list. */
-static int box_intersection( line_segment_type lseg,
-			     extent_type extent,
-			     coordinate_type *coord )
-{
-   line_segment_type boxseg;
-   float xint, yint;
-
-   boxseg.x1 = extent.x1;
-   boxseg.y1 = extent.y1;
-   boxseg.x2 = extent.x2;
-   boxseg.y2 = extent.y1;
-   if (intersect(lseg,boxseg,&xint,&yint)) {
-      coord->x = xint;
-      coord->y = yint;
-      return TRUE;
-   }
-
-   boxseg.x1 = extent.x2;
-   boxseg.y1 = extent.y1;
-   boxseg.x2 = extent.x2;
-   boxseg.y2 = extent.y2;
-   if (intersect(lseg,boxseg,&xint,&yint)) {
-      coord->x = xint;
-      coord->y = yint;
-      return TRUE;
-   }
-
-   boxseg.x1 = extent.x2;
-   boxseg.y1 = extent.y2;
-   boxseg.x2 = extent.x1;
-   boxseg.y2 = extent.y2;
-   if (intersect(lseg,boxseg,&xint,&yint)) {
-      coord->x = xint;
-      coord->y = yint;
-      return TRUE;
-   }
-
-   boxseg.x1 = extent.x1;
-   boxseg.y1 = extent.y2;
-   boxseg.x2 = extent.x1;
-   boxseg.y2 = extent.y1;
-   if (intersect(lseg,boxseg,&xint,&yint)) {
-      coord->x = xint;
-      coord->y = yint;
-      return TRUE;
-   }
-   return FALSE;
-}
-
-/* Replace the given coordinate string into the given edge row */
-/* and write the new row to the specified edge table.	       */
-static void write_edge_record( ossim_int32 id, coordinate_type *coord,
-			       ossim_int32 ncoord, row_type row,
-			       vpf_table_type *table )
-{
-   int ID_, COORD_;
-
-   ID_ = table_pos("ID",*table);
-   COORD_ = table_pos("COORDINATES",*table);
-
-   put_table_element(ID_, row, *table, &id, 1);
-   put_table_element(COORD_, row, *table, coord, ncoord);
-   write_next_row(row,table);
-
-}
-
-
-
-#define WITHIN(x,y,ext) ((x>=ext.x1)&&(x<=ext.x2)&&(y>=ext.y1)&&(y<=ext.y2))
-
-/*************************************************************************
- *
- *N  vpf_edge_clip
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function clips an edge table to the given extent and writes
- *     the clipped table to the specified output path.
- *     NOTE: If a segment of an edge in the EDG table has both a beginning
- *     point and ending point outside of the given extent, and the line
- *     segment passes through the extent, the segment will not be written
- *     out to the new edge table.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    covpath <input> == (char *) path to the coverage of the edge table.
- *    extent  <input> == (extent_type) clipping extent.
- *    outpath <input> == (char *) output path for the clipped edge table.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    Dec 1991      Original Version    DOS Turbo C
- *E
- *************************************************************************/
-void vpf_edge_clip( char *covpath, extent_type extent, char *outpath )
-{
-   vpf_table_type in, out;
-   row_type row;
-   edge_rec_type inedge, outedge;
-   ossim_int32 i,j,n,id;
-   line_segment_type lseg;
-   coordinate_type coord;
-   char path[255], *def;
-   float xmin, xmax, ymin, ymax;
-
-   /* Standardize extent, Lower Left, Upper Right */
-   xmin = (float)min(extent.x1,extent.x2);
-   xmax = (float)max(extent.x1,extent.x2);
-   ymin = (float)min(extent.y1,extent.y2);
-   ymax = (float)max(extent.y1,extent.y2);
-   extent.x1 = xmin;
-   extent.y1 = ymin;
-   extent.x2 = xmax;
-   extent.y2 = ymax;
-
-   sprintf(path,"%sedg",covpath);
-   in = vpf_open_table(path,disk,"rb",NULL);
-
-   rewind(in.fp);
-   fread(&n,sizeof(n),1,in.fp);
-   def = (char *)vpfmalloc((n+1)*sizeof(char));
-   fread(def,sizeof(char),n,in.fp);
-   def[n] = '\0';
-   sprintf(path,"%sedg",outpath);
-   out = vpf_open_table(path,disk,"wb",def);
-
-   for (i=1,id=1;i<=in.nrows;i++) {
-      row = get_row( i, in );
-      inedge = create_edge_rec( row, in );
-      if (!inedge.coord) {
-	 free_row(row,in);
-	 continue;
-      }
-      outedge.coord = (coordinate_type *)malloc(inedge.npts*sizeof(
-						coordinate_type));
-      if (!outedge.coord) {
-	 free(inedge.coord);
-	 free_row(row,in);
-	 continue;
-      }
-
-      n = 0;
-
-      for (j=0;j<inedge.npts;j++) {
-
-	 if (WITHIN(inedge.coord[j].x,inedge.coord[j].y,extent)) {
-	    /* Current coordinate within extent */
-
-	    if (j > 0) {
-	       if (!WITHIN(inedge.coord[j-1].x,inedge.coord[j-1].y,
-			    extent)) {
-		  /* Previous coordinate was not in the extent - */
-		  /* create an intersection vertex */
-
-		  lseg.x1 = inedge.coord[j-1].x;
-		  lseg.y1 = inedge.coord[j-1].y;
-		  lseg.x2 = inedge.coord[j].x;
-		  lseg.y2 = inedge.coord[j].y;
-		  if (box_intersection(lseg,extent,&coord)) {
-		     outedge.coord[n].x = coord.x;
-		     outedge.coord[n].y = coord.y;
-		  } else {
-		     outedge.coord[n].x = lseg.x1;
-		     outedge.coord[n].y = lseg.y1;
-		  }
-		  n++;
-	       }
-	    }
-	    outedge.coord[n].x = inedge.coord[j].x;
-	    outedge.coord[n].y = inedge.coord[j].y;
-	    n++;
-	 } else {
-	    if (j > 0) {
-	       if (WITHIN(inedge.coord[j-1].x,inedge.coord[j-1].y,extent)) {
-
-		  /* The coordinate is not within the extent and     */
-		  /* the previous one was - Create an intersection   */
-		  /* vertex point and write the current edge record. */
-
-		  lseg.x1 = inedge.coord[j-1].x;
-		  lseg.y1 = inedge.coord[j-1].y;
-		  lseg.x2 = inedge.coord[j].x;
-		  lseg.y2 = inedge.coord[j].y;
-		  if (box_intersection(lseg,extent,&coord)) {
-		     outedge.coord[n].x = coord.x;
-		     outedge.coord[n].y = coord.y;
-		  } else {
-		     outedge.coord[n].x = lseg.x2;
-                     outedge.coord[n].y = lseg.y2;
-		  }
-
-		  /* Break the edge in (at least) two */
-		  n++;
-		  write_edge_record( id, outedge.coord, n, row, &out );
-		  id++;
-		  n=0;
-
-	       }
-	    }
-	 }
-      }
-      free(inedge.coord);
-
-      if (n > 0) {
-	 write_edge_record( id, outedge.coord, n, row, &out );
-	 id++;
-      }
-
-      free(outedge.coord);
-      free_row(row,in);
-   }
-
-   vpf_close_table(&in);
-   vpf_close_table(&out);
-}
-
diff --git a/ossim/src/ossim/vpfutil/vpfcntnt.c b/ossim/src/ossim/vpfutil/vpfcntnt.c
deleted file mode 100644
index 8a1caa1..0000000
--- a/ossim/src/ossim/vpfutil/vpfcntnt.c
+++ /dev/null
@@ -1,513 +0,0 @@
-/***************************************************************************
- *
- *N  VPFCNTNT.C  - VPF Contents
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This module contains functions to display the contents of VPF tables
- *    and VPF databases and libraries.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels      November 1991
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- **************************************************************************/
-#if defined(__CYGWIN__) || defined(__APPLE__)|| defined(_WIN32) || defined(__FreeBSD__) || defined(__OpenBSD__)
-#  include "ossim/vpfutil/values.h"
-#else
-#  include <values.h>
-#endif
-
-#include <stdlib.h>
-
-#ifdef __MSDOS__
-#  include <graphics.h>
-#  include <dir.h>
-#  include <dos.h>
-#  include <alloc.h>
-#else
-#  ifndef _WIN32
-#    include <unistd.h>
-#  endif
-#  ifdef __APPLE__
-#    include <sys/types.h>
-#    include <sys/malloc.h>
-#    define MAXINT INT_MAX
-#    ifndef MAXSHORT
-#        define MAXSHORT SHORT_MAX
-#    endif
-#    define MAXLONG  LONG_MAX
-#  else
-#    ifndef __FreeBSD__
-#      include <malloc.h>
-#    endif
-#  endif
-#endif
-#ifdef _MSC_VER
-#  include <io.h>
-#endif
-
-#include <string.h>
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfview.h>
-#include <ossim/vpfutil/system.h>
-#include <ossim/vpfutil/vpfmisc.h>
-#include <ossim/vpfutil/vpfdisp.h>
-
-#include <ossim/vpfutil/vpfapi.h>
-
-
-
-/**************************************************************************
- *
- *N  vpf_dump_table
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Dump the contents of a VPF table into an ASCII file
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    tablename <input> == (char *) VPF table to dump.
- *    outname   <input> == (char *) name of ASCII dump file.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-void vpf_dump_table( char *tablename, char *outname )
-{
-   vpf_table_type table;
-   ossim_int32   i,j,k,n;
-   int        ival,*iptr;
-   ossim_int32   lval,*lptr;
-   float      fval,*fptr;
-   date_type  dval,*dptr;
-   id_triplet_type kval, *kptr;
-   coordinate_type cval, *cptr;
-   char       *buf,  ch, date[40];
-   row_type   row;
-   FILE       *fp;
-
-   fp = fopen(outname,"w");
-
-   table = vpf_open_table(tablename,disk,"rb",NULL);
-
-   fprintf(fp,"%s\n%s\n\n",tablename,table.description);
-
-   fprintf(fp,"Definition:\n");
-   for (i=0;i<table.nfields;i++) {
-      if (table.header[i].count < 0)
-	 fprintf(fp,"%s (%c,*)  %s\n",
-		 table.header[i].name,table.header[i].type,
-		 table.header[i].description);
-      else
-	 fprintf(fp,"%s (%c,%ld)  %s\n",
-		 table.header[i].name,table.header[i].type,
-		 table.header[i].count,table.header[i].description);
-   }
-
-   fprintf(fp,"\nContents:\n");
-   for (i=1;i<=table.nrows;i++) {
-      row = read_next_row(table);
-      for (j=0;j<table.nfields;j++) {
-	 fprintf(fp,"%s: ",table.header[j].name);
-	 switch (table.header[j].type) {
-	    case 'T':
-	       if (table.header[j].count==1) {
-		  get_table_element(j,row,table,&ch,&n);
-		  fprintf(fp,"%c\n",ch);
-	       } else {
-		  buf = (char *)get_table_element(j,row,table,NULL,&n);
-		  n = (long)strlen(table.header[j].name) + 2;
-		  for (k=0;(unsigned int)k<strlen(buf);k++) {
-		     fprintf(fp,"%c",buf[k]);
-		     n++;
-		     if (n>80) {
-			fprintf(fp,"\n");
-			n = 0;
-		     }
-		  }
-		  fprintf(fp,"\n");
-		  free(buf);
-	       }
-	       break;
-	    case 'I':
-	       if (table.header[j].count==1) {
-		  get_table_element(j,row,table,&lval,&n);
-		  if (lval != MAXFLOAT)
-		     fprintf(fp,"%ld\n",lval);
-		  else
-		     fprintf(fp,"(null)\n");
-	       } else {
-		  lptr = (ossim_int32*)get_table_element(j,row,table,NULL,&n);
-		  for (k=0;k<n;k++) {
-		     if (lptr[k] != MAXFLOAT)
-			fprintf(fp,"%ld ",lptr[k]);
-		     else
-			fprintf(fp,"(null) ");
-		  }
-		  fprintf(fp,"\n");
-		  free(lptr);
-	       }
-	       break;
-	    case 'S':
-	       if (table.header[j].count==1) {
-		  get_table_element(j,row,table,&ival,&n);
-		  if (ival != MAXINT)
-		     fprintf(fp,"%d\n",ival);
-		  else
-		     fprintf(fp,"(null)\n");
-	       } else {
-		  iptr = (int*)get_table_element(j,row,table,NULL,&n);
-		  for (k=0;k<n;k++) {
-		     if (iptr[k] != MAXINT)
-			fprintf(fp,"%d ",iptr[k]);
-		     else
-			fprintf(fp,"(null) ");
-		  }
-		  fprintf(fp,"\n");
-		  free(iptr);
-	       }
-	       break;
-	    case 'F':
-	       if (table.header[j].count==1) {
-		  get_table_element(j,row,table,&fval,&n);
-		  if (fval != MAXFLOAT)
-		     fprintf(fp,"%f\n",fval);
-		  else
-		     fprintf(fp,"(null)\n");
-	       } else {
-		  fptr = (float*)get_table_element(j,row,table,NULL,&n);
-		  for (k=0;k<n;k++) {
-		     if (fptr[k] != MAXFLOAT)
-			fprintf(fp,"%f ",fptr[k]);
-		     else
-			fprintf(fp,"(null) ");
-		  }
-		  fprintf(fp,"\n");
-		  free(fptr);
-	       }
-	       break;
-	    case 'C':
-	       if (table.header[j].count==1) {
-		  get_table_element(j,row,table,&cval,&n);
-		  fprintf(fp,"(%f,%f)\n",cval.x,cval.y);
-	       } else {
-		  cptr = (coordinate_type*)get_table_element(j,row,table,NULL,&n);
-		  for (k=0;k<n;k++)
-		     fprintf(fp,"(%f,%f) ",cptr[k].x,cptr[k].y);
-		  fprintf(fp,"\n");
-		  free(cptr);
-	       }
-	       break;
-	    case 'K':
-	       if (table.header[j].count==1) {
-		  get_table_element(j,row,table,&kval,&n);
-		  fprintf(fp,"(%ld,%ld,%ld)\n",
-			  kval.id,kval.tile,kval.exid);
-	       } else {
-		  kptr = (id_triplet_type*)get_table_element(j,row,table,NULL,&n);
-		  for (k=0;k<n;k++)
-		     fprintf(fp,"(%ld,%ld,%ld)  ",
-			     kptr[k].id,kptr[k].tile,kptr[k].exid);
-		  fprintf(fp,"\n");
-		  free(kptr);
-	       }
-	       break;
-	    case 'D':   /* Date */
-	       if (table.header[j].count==1) {
-		  get_table_element(j,row,table,&dval,&n);
-		  format_date(dval,date);
-		  fprintf(fp,"%s\n",date);
-	       } else {
-		  dptr = (date_type*)get_table_element(j,row,table,NULL,&n);
-		  for (k=0;k<n;k++) {
-		     format_date((char*)(&dptr[k]),date);
-		     fprintf(fp,"%s ",date);
-		  }
-		  fprintf(fp,"\n");
-		  free(dptr);
-	       }
-	       break;
-	 }
-      }
-      fprintf(fp,"\n");
-      free_row( row, table );
-   }
-
-   fclose(fp);
-   vpf_close_table( &table );
-}
-
-
-/* Dump a Narrative-style .DOC VPF table to an ASCII file */
-/**************************************************************************
- *
- *N  vpf_dump_doc_table
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Dump the contents of a narrative-style .DOC VPF table into an
- *    ASCII file as a series of text strings.  This function checks
- *    to make sure that the given table is a real narrative file
- *    (two fields: ID and TEXT).  If not, it displays it as a normal
- *    VPF table.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    tablename <input> == (char *) narrative-style .DOC VPF table to dump.
- *    outname   <input> == (char *) name of ASCII dump file.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-void vpf_dump_doc_table( char *tablename, char *outname )
-{
-   vpf_table_type table;
-   ossim_int32   i,n;
-   char       *buf;
-   row_type   row;
-   FILE       *fp;
-
-   fp = fopen(outname,"w");
-
-   table = vpf_open_table(tablename,disk,"rb",NULL);
-
-   /* Check header to make sure the table is a narrative table */
-   if ((ossim_strcasecmp(table.header[1].name,"TEXT") != 0) ||
-       (table.nfields != 2)) {
-      /* Not a real narrative table -> normal VPF table dump */
-      vpf_close_table(&table);
-      vpf_dump_table(tablename,outname);
-      return;
-   }
-
-   fprintf(fp,"%s\n%s\n\n",tablename,table.description);
-
-   for (i=1;i<=table.nrows;i++) {
-      row = read_next_row(table);
-      buf = (char *)get_table_element(1,row,table,NULL,&n);
-      fprintf(fp,"%s\n",buf);
-      free(buf);
-      free_row(row,table);
-   }
-
-   fclose(fp);
-   vpf_close_table( &table );
-}
-
-#if 0
-static void not_a_vpf_table( char *path )
-{
-   char *buf,*filename,*tempstr,ch;
-
-   buf = (char *)vpfmalloc(255);
-   filename = (char *)vpfmalloc(255);
-
-   /* Not a VPF table - try to determine what type of file it is */
-   if (strstr(path,"\\asi") ||
-       strstr(path,"\\lsi") ||
-       strstr(path,"\\nsi") ||
-       strstr(path,"\\csi") ||
-       strstr(path,"\\tsi")) {
-      sprintf(filename,"%s is a spatial index file.",path);
-      displaymessage(filename,
-	   "It is not a VPF table and cannot be viewed directly",
-	   NULL);
-   } else if (strstr(path,".ati") ||
-	      strstr(path,".lti") ||
-	      strstr(path,".pti") ||
-	      strstr(path,".tti")) {
-      sprintf(filename,"%s is a thematic index file.",path);
-      displaymessage(filename,
-	       "It is not a VPF table and cannot be viewed directly",
-	       NULL);
-   } else if (path[strlen(path)-1] == 'x') {
-      /* Need to determine what file it is the index for */
-      sprintf(buf,"%s is a variable-length index file",path);
-      strcpy(filename,path);
-      for (ch='a';ch <= 'z';ch++) {
-	 if (ch=='x') continue;
-	 filename[strlen(path)-1] = ch;
-	 if (access(filename,0) == 0) {
-	    tempstr = strdup(filename);
-	    sprintf(filename,"for %s.",tempstr);
-	    free(tempstr);
-	    break;
-	 }
-      }
-      if (strcmp(path,filename)==0) {
-	 displaymessage(buf,
-	       "It is not a VPF table and cannot be viewed directly.",
-	       NULL);
-      } else {
-	    displaymessage(buf, filename,
-	       "It is not a VPF table and cannot be viewed directly.",
-	       NULL);
-      }
-   } else {
-      /* Not a VPF type of file */
-      sprintf(filename,"%s: Not a VPF table",path);
-      display_message(filename);
-   }
-
-   free(filename);
-   free(buf);
-}
-#endif
-
-#if 0
-/**************************************************************************
- *
- *N  display_database_contents
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    List the tables in the Database level directory and display their
- *    contents if selected.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    database <input> == (database_type) VPF database.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-void display_database_contents( database_type database )
-{
-   char *filename, *dbpath, *path, *dbstr;
-
-   dbstr = (char *)vpfmalloc(128);
-   dbpath = (char *)vpfmalloc(255);
-   filename = (char *)vpfmalloc(128);
-   path = (char *)vpfmalloc(255);
-
-   strcpy( dbstr, "Database: " );
-   strcat( dbstr, database.name );
-
-   strcpy(dbpath,database.path);
-   strcat(dbpath,"*.*");
-   do {
-      strcpy(filename,pickfile(dbpath,0,dbstr));
-      if (strcmp(filename,"")==0) break;
-      strcpy( path, database.path );
-      strcat( path, filename );
-      rightjust(path);
-      strlwr(path);
-      if (is_vpf_table(path)) {
-	 if (strstr(path,".doc"))
-	    vpf_dump_doc_table(path,"temp.out");
-	 else
-	    vpf_dump_table(path,"temp.out");
-	 viewfile("temp.out", getmaxy()/3);
-	 unlink("temp.out");
-      } else {
-	 not_a_vpf_table(path);
-      }
-   } while (strcmp(filename,"") != 0);
-
-   free(path);
-   free(filename);
-   free(dbpath);
-   free(dbstr);
-}
-
-/**************************************************************************
- *
- *N  display_library_contents
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    List the tables in the Library level directory and display their
- *    contents if selected.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    library   <input> == (library_type) VPF library structure.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-void display_library_contents( library_type library )
-{
-   char *filename, *libpath, *path, *libstr;
-
-   libstr = (char *)vpfmalloc(128);
-   libpath = (char *)vpfmalloc(255);
-   filename = (char *)vpfmalloc(128);
-   path = (char *)vpfmalloc(255);
-
-   strcpy( libstr, "Library: " );
-   strcat( libstr, library.name );
-
-   strcpy(libpath,library.path);
-   strcat(libpath,"*.*");
-   do {
-      strcpy(filename,pickfile(libpath,0,libstr));
-      if (strcmp(filename,"")==0) break;
-      strcpy( path, library.path );
-      strcat( path, filename );
-      rightjust(path);
-      leftjust(path);
-      strlwr(path);
-      if (is_vpf_table(path)) {
-	 strlwr(path);
-	 if (strstr(path,".doc"))
-	    vpf_dump_doc_table(path,"temp.out");
-	 else
-	    vpf_dump_table(path,"temp.out");
-	 viewfile("temp.out", getmaxy()/3);
-	 unlink("temp.out");
-      } else {
-	 not_a_vpf_table(path);
-      }
-   } while (strcmp(filename,"") != 0);
-
-   free(path);
-   free(filename);
-   free(libpath);
-   free(libstr);
-}
-#endif
diff --git a/ossim/src/ossim/vpfutil/vpfdict.c b/ossim/src/ossim/vpfutil/vpfdict.c
deleted file mode 100644
index 6836e5f..0000000
--- a/ossim/src/ossim/vpfutil/vpfdict.c
+++ /dev/null
@@ -1,238 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#ifdef __MSDOS__
-#include <graphics.h>
-#endif
-
-#ifdef __MSDOS__
-#include <alloc.h>
-#include <mem.h>
-#else
-#ifdef __APPLE__ 
-#include <sys/types.h>
-#include <sys/malloc.h>
-#else
-#ifndef __FreeBSD__
-#include <malloc.h>
-#include <string.h>
-#endif
-#endif
-#endif
-
-
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfview.h>
-#include <ossim/vpfutil/vpfinit.h>
-
-extern color_type menutextcolor,menubordercolor,menucolor;
-#if 0
-/*************************************************************************
- *
- *N  feature_class_dictionary
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays the data dictionary for a feature class.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    fc  <input> == (int) feature class number.
- *    lib <input> == (library_type) VPF library structure.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Mody Buchbinder  May 1991   Original Version   DOS Turbo C
- *    Barry Michaels July 1991 - Separated into two routines
- *    Barry Michaels  Oct 1991 - Modified narrative table read
- *E
- *************************************************************************/
-void feature_class_dictionary( int fc, library_type lib )
-{
-   int                i,j,k,
-		      it_pos,val_pos,des_pos,att_pos;
-   char               *outfile,*line,temp[128],temp2[128],
-		      *item_buf, *att_buf, *des_buf, *tval;
-   vpf_table_type     ft,table,nar;
-   storage_type       stor = disk;
-   FILE               *out;
-   row_type           row;
-   float              fval;
-   ossim_int32           ival,n;
-
-   hidemousecursor();
-   time_cursor();
-   showmousecursor();
-
-   /** prepare temporary display file **/
-   outfile = (char *)malloc(L_tmpnam + 2);
-   outfile = tmpnam(outfile);
-   out = fopen(outfile,"w");
-
-   /** start to write to display file **/
-   fprintf(out,"FEATURE CLASS: %s \n",lib.fc[fc].description);
-   fprintf(out,"COVERAGE     : %s \n",
-	   lib.cover[lib.fc[fc].coverage].description);
-
-   ft = vpf_open_table(lib.fc[fc].table,stor,"rb",NULL);
-
-   fprintf(out,"ATTRIBUTES:\n");
-
-   for(i=0;i<ft.nfields;i++) {
-     fprintf(out,"   %s - %s \n",ft.header[i].name,ft.header[i].description);
-     if(ft.header[i].vdt[0] != '\0')
-
-	 /** create table name **/
-      { strcpy(temp,lib.fc[fc].table);
-	 /** cut temp to path and name **/
-	for(j=strlen(temp);temp[j] != '\\';j--);
-	temp[j] = '\0';
-
-	rightjust(temp);
-
-	 /** add to the path the new table name **/
-	strcpy(temp2,temp);
-	strcat(temp2,"\\");
-	strcat(temp2,ft.header[i].vdt);
-	if(access(temp2,0) == 0)
-	  {
-	    table   = vpf_open_table(temp2,stor,"rb",NULL);
-	    it_pos  = table_pos("TABLE",table);
-	    val_pos = table_pos("VALUE",table);
-	    des_pos = table_pos("DESCRIPTION",table);
-	    att_pos = table_pos("ATTRIBUTE",table);
-
-	    for(k=1;k<=table.nrows;k++)
-	      {
-		if (stor == disk)
-		   row = read_next_row(table);
-		else
-		   row = get_row(k,table);
-		item_buf = (char *)get_table_element( it_pos
-						,row,table,NULL,&n);
-
-		rightjust(item_buf);
-
-		att_buf  = (char *)get_table_element(att_pos
-						,row,table,NULL,&n);
-
-		rightjust(att_buf);
-
-		if(ossim_strcasecmp(item_buf,&temp[j+1]) == 0 &&
-                   ossim_strcasecmp(att_buf,ft.header[i].name) == 0)
-		   { des_buf  = (char *)get_table_element(des_pos
-						,row,table,NULL,&n);
-		     switch (ft.header[i].type) {
-			case 'T':
-		     tval = (char *)get_table_element(val_pos
-						,row,table,NULL,&n);
-		     fprintf(out,"    %s =  %s  \n",tval,des_buf);
-		     free(tval);break;
-			case 'I':
-		     get_table_element(val_pos,row,table,&ival,&n);
-		     fprintf(out,"    %12ld =  %s  \n",ival,des_buf);
-		     break;
-			case 'F':
-		     get_table_element(val_pos,row,table,&fval,&n);
-		     fprintf(out,"    %12f =  %s  \n",fval,des_buf);
-		     break;
-		     } /** switch **/
-		     free(des_buf);
-		   }  /** if strcmp **/
-
-		free(item_buf);
-		free(att_buf);
-		free_row(row,table);
-	      }  /** for k on table.nrows **/
-	    vpf_close_table(&table);
-	  } /** if access **/
-      } /** if there is vdt **/
-   }  /** for fields **/
-
-   /** get information from narrative file if it exists **/
-   if(ft.narrative[0] != '\0') {
-      sprintf(temp,"%s%s",ft.path,ft.narrative);
-      if (access(temp,0)==0) {
-	 fprintf(out,"\n\n");
-	 nar = vpf_open_table(temp,disk,"rb",NULL);
-	 for (i=1;i<=nar.nrows;i++) {
-	    row = read_next_row(nar);
-	    line = (char *)get_table_element(1,row,nar,NULL,&n);
-	    rightjust(line);
-	    fprintf(out,"%s\n",line);
-	    free(line);
-	    free_row(row,nar);
-	 }
-	 vpf_close_table(&nar);
-      }
-   }
-
-   /** clean up **/
-   vpf_close_table(&ft);
-   fclose(out);
-
-   arrow_cursor();
-
-   viewfile(outfile,getmaxy()/3);
-   remove(outfile);
-   free(outfile);
-}
-
-/*************************************************************************
- *
- *N  display_data_dictionary
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function shows a feature class menu, lets the user select
- *     a feature class and print the information from the data dictionary
- *     for this feature class
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    lib <in> == (library_type) VPF library structure.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Mody Buchbinder  May 1991   Original Version   DOS Turbo C
- *    Barry Michaels  June 1991 - Separated into two routines.
- *    Barry Michaels   Oct 1991 - Feature class selection from a panel.
- *    Barry Michaels   Jan 1992 - Select FCs by coverage first.
- *E
- *************************************************************************/
-void display_data_dictionary(library_type lib)
-{
-   int       fc,cov;
-   view_type dummyview;
-   char      title[80];
-
-   dummyview.nthemes = 0;
-
-   cov = 0;
-   while (cov >= 0) {
-      sprintf(title,"%s COVERAGES",lib.name);
-      cov = select_coverage(&dummyview,&lib,title);
-      if (cov < 0) break;
-      fc = 0;
-      while (fc >= 0) {
-	 sprintf(title,"%s Feature Classes",lib.cover[cov].description);
-	 fc = select_feature_class(&dummyview,&lib,title,cov);
-	 if (fc < 0) break;
-	 feature_class_dictionary( fc, lib );
-      }
-   }
-
-}
-
-#endif
diff --git a/ossim/src/ossim/vpfutil/vpfmisc.c b/ossim/src/ossim/vpfutil/vpfmisc.c
deleted file mode 100644
index d216473..0000000
--- a/ossim/src/ossim/vpfutil/vpfmisc.c
+++ /dev/null
@@ -1,1837 +0,0 @@
-/*************************************************************************
- *
- *N  Module VPFMISC
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This module contains miscellaneous routines used (potentially) by
- *     several other VPF modules.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    N/A
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                     DOS Turbo C
- *E
- *************************************************************************/
-
-#ifdef __MSDOS__
-#  include <graphics.h>
-#  include <alloc.h>
-#else
-#  ifdef __APPLE__ 
-#    include <sys/types.h>
-#    include <sys/malloc.h>
-#  else
-#    ifndef __FreeBSD__
-#      include <malloc.h>
-#      include <string.h>
-#    endif
-#  endif
-#endif
-
-
-#include <ctype.h> /* For toupper function. */
-
-#include <ossim/vpfutil/vpftidx.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <fcntl.h>
-#ifdef __MSDOS__
-#  include <sys\stat.h>
-#  include <io.h>
-#  include <conio.h>
-#  include <dos.h>
-#  include <dir.h>
-#else
-#  include <sys/stat.h>
-#endif
-#include <math.h>
-#include <errno.h>
-#include <stdarg.h>
-#ifdef __MSDOS__
-#  include <process.h>
-#  include <bios.h>
-#  include "gui.h"
-#endif
-#include <ossim/vpfutil/vpfmisc.h>
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfview.h>
-
-
-#ifdef __MSDOS__
-  extern color_type menucolor, menubordercolor, menutextcolor;
-#endif
-
-#if !defined(__MSDOS__) && !defined(_MSC_VER)
-char* strrev(char* str)
-{
-  register int i,len;
-  char *copy;
-
-  len = strlen(str);
-  copy = (char *) malloc(sizeof(char)*(len+1));
-  (void) strcpy(copy,str);
-  for(i=0;i<len;i++)
-    str[i]=copy[(len-1)-i];
-  free(copy);
-  return str;
-}
-
-char* strupr(char* str)
-{
-  char* s = str;
-  while (*s)
-  {
-	  *s = toupper(*s);
-	  ++s;
-  }
-  return str;
-}
-#endif /* #ifndef __MSDOS__ */
-
-/*************************************************************************
- *
- *N  vpfmalloc
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function allocates memory off of the heap and checks for
- *     success.  If not enough memory is available, this routine will abort
- *     the program with an error message.  Can be in graphics mode to call
- *     this procedure, not a necessity.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    size    <input> == (unsigned long) number of bytes to allocate.
- *    return <output> == (void *) pointer to the allocated memory.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1990    Original Version    DOS Turbo C
- *    Ronald Rozensky   Sept 1991 check for no memory, graphics mode
- *E
- *************************************************************************/
-void *vpfmalloc( unsigned long size )
-{
-   void *p;
-#ifdef __MSDOS__
-   p = farmalloc( size );
-   if (!p)
-   {
-      printf("Out of memory  %ld  %ld\n",size,farcoreleft());
-      getch();
-
-      if (graphic_mode())
-	 closegraph();
-      exit(1);
-   }
-#else
-   p = malloc(size);
-   if (!p)
-   {
-     printf("Out of memory %ld\n", size);
-     exit(1);
-   }
-#endif
-   return p;
-}
-#ifdef __MSDOS__
-/*************************************************************************
- *
- *N  get_display_position
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function finds a suitable position to display a new window on
- *     the screen.  If the window fits, its upper left hand corner will be
- *     the current mouse position.  If not, it will be adjusted so that it
- *     will fit on the screen.  Should be in graphics mode to call this
- *     function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    x     <output> == (int *) pointer to the x display position.
- *    y     <output> == (int *) pointer to the y display position.
- *    window <input> == (window_type) window to be displayed.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1990    Original Version    DOS Turbo C
- *E
- *************************************************************************/
-void get_display_position( int *x, int *y, window_type window )
-{
-   int mbutton, delta;
-
-   getmouseposition( x, y, &mbutton );
-   delta = window.x2 - window.x1;
-   if ((*x) + delta > getmaxx()-2)
-      (*x) = getmaxx()-delta-10;
-   if ((*x) < 2)
-      (*x) = 2;
-   delta = window.y2 - window.y1;
-   if ((*y) + delta > getmaxy()-2)
-      (*y) = getmaxy()-delta-10;
-   if ((*y) < 2)
-      (*y) = 2;
-}
-
-
-/*************************************************************************
- *
- *N  displayinfo
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays an array of text strings in a
- *     popup text window.  Must be in graphics mode to call this function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    text[] <input> == (char *) array of text strings to be displayed.
- *    nlines <input> == (int) number of text lines.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    June 1990    Original Version    DOS Turbo C
- *E
- *************************************************************************/
-void displayinfo( char *text[],
-		  int  nlines )
-{
-   int         i,maxw,height,x,y,pad;
-   panel_type  panel;
-
-   arrow_cursor();
-   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
-   maxw = 0;
-   height = 0;
-   for (i=0;i<nlines;i++) {
-      if (textwidth(text[i]) > maxw) maxw = textwidth(text[i]);
-      height = height + textheight(text[i]) + 5;
-   }
-   if (maxw < (textwidth("Continue") + 10))
-      maxw = textwidth("Continue") + 10;
-   pad = (maxw*10)/100;
-   maxw = maxw + (2*pad);
-   if (maxw > getmaxx())
-     maxw = getmaxx() - 8;
-   height = height + 2*(textheight("Continue") + 10);
-
-   create_panel( &panel, maxw, height, menucolor, menubordercolor );
-   x = pad;
-   y = 0;
-   for (i=0;i<nlines;i++) {
-      y = y + textheight(text[i]) + 3;
-      create_label( text[i], x, y, SMALL_FONT, 4, menutextcolor, &panel );
-   }
-   y = height - (textheight("Continue") + 6);
-   x = (maxw - (textwidth("Continue") + 10))/2;
-   create_button( 27, "Continue", x, y, SMALL_FONT, 4,
-		  menutextcolor, menucolor, menubordercolor, RELIEVED,
-		  &panel );
-
-   get_display_position( &x, &y, panel.window );
-
-   display_panel( &panel, x, y );
-   i = process_panel( &panel, i );
-
-   destroy_panel( &panel );
-   close_panel( &panel );
-}
-
-
-
-/*************************************************************************
- *
- *N  displaymessage
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays a list of text strings in a
- *     popup text window.  The list must be NULL-terminated.  Must be in
- *     graphics mode to call this function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    string <input> == (char *) first text string to be displayed.
- *    ... <input> == (char *) variable list of text strings to be displayed.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    August 1991                        DOS Turbo C
- *E
- *************************************************************************/
-void displaymessage( char *string, ... )
-{
-   int         i,maxw,height,x,y,pad, nlines;
-   panel_type  panel;
-   char **text;
-   va_list arglist;
-
-   va_start(arglist,string);
-   nlines = 1;
-   while (va_arg(arglist,char *)) nlines++;
-   va_end(arglist);
-
-   text = (char **)vpfmalloc((nlines+1)*sizeof(char *));
-   text[0] = string;
-   va_start(arglist,string);
-   for (i=1;i<nlines;i++) {
-      text[i] = va_arg(arglist,char *);
-   }
-   va_end(arglist);
-
-   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
-   maxw = 0;
-   height = 0;
-   for (i=0;i<nlines;i++) {
-      if (textwidth(text[i]) > maxw) maxw = textwidth(text[i]);
-      height = height + textheight(text[i]) + 5;
-
-   }
-   if (maxw < (textwidth("Continue") + 10))
-      maxw = textwidth("Continue") + 10;
-   pad = (maxw*10)/100;
-   maxw = maxw + (2*pad);
-   if (maxw > getmaxx())
-     maxw = getmaxx() - 8;
-   height = height + 2*(textheight("Continue") + 5) + 5;
-
-   create_panel( &panel, maxw, height, menucolor, menubordercolor );
-   x = pad;
-   y = 0;
-   for (i=0;i<nlines;i++) {
-      y = y + textheight(text[i]) + 5;
-      create_label( text[i], x, y, SMALL_FONT, 4, menutextcolor, &panel );
-   }
-   y = height - (textheight("Continue") + 6);
-   x = (maxw - (textwidth("Continue") + 10))/2;
-   create_button( 27, "Continue", x, y, SMALL_FONT, 4,
-		  menutextcolor, menucolor, menubordercolor, RELIEVED,
-		  &panel );
-
-   get_display_position( &x, &y, panel.window );
-
-   display_panel( &panel, x, y );
-   i = process_panel( &panel, i );
-
-   destroy_panel( &panel );
-   close_panel( &panel );
-
-   free(text);
-}
-
-
-
-/*************************************************************************
- *
- *N  display_message
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays a one-line informational message to the
- *     screen and waits for the user to continue.  Must be in graphics mode
- *     to call this function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    str <input> == (char *) message to be displayed.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    July 1990    Original Version    DOS Turbo C
- *E
- *************************************************************************/
-void display_message(char *str)
-{
-   char **txt;
-
-   txt = (char **)vpfmalloc( (unsigned long)(1*sizeof(char **)) );
-   txt[0] = strdup(str);
-   displayinfo( txt, 1 );
-   free(txt[0]);
-   free(txt);
-}
-
-#else
-
-void displaymessage( char *s, ... )
-{
-   int         i, nlines;
-   char **text;
-   va_list arglist;
-
-   va_start(arglist,s);
-   nlines = 1;
-   while (va_arg(arglist,char *)) nlines++;
-   va_end(arglist);
-
-   text = (char **)vpfmalloc((nlines+1)*sizeof(char *));
-   text[0] = s;
-   va_start(arglist,s);
-   for (i=1;i<nlines;i++) {
-      text[i] = va_arg(arglist,char *);
-   }
-   va_end(arglist);
-   for (i=0;i<nlines;i++) {
-       fprintf(stderr, "%s", text[i]);
-   }
-   free(text);
-}
-
-void display_message(char *str)
-{
-   fprintf(stderr, "%s", str);
-}
-
-
-#endif
-
-
-/*************************************************************************
- *
- *N  float_to_dms
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function converts a floating point lat lon coordinate to
- *     degrees-minutes-seconds format.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    coord   <input> == (double) floating point lat lon coordinate.
- *    return <output> == (dms_type) degrees-minutes-seconds coordinate.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1990    Original Version    DOS Turbo C
- *E
- *************************************************************************/
-dms_type float_to_dms( double coord )
-{
-   dms_type dms_coord;
-
-   dms_coord.degrees = (int)coord;
-   dms_coord.minutes = (int)((double)(coord-(int)coord)*60.0);
-   dms_coord.seconds = (float)((((double)(coord-(int)coord)* 60.0) -
-			(double)dms_coord.minutes) * 60.0);
-   dms_coord.minutes = abs(dms_coord.minutes);
-   dms_coord.seconds = (float)(fabs(dms_coord.seconds));
-
-   if (dms_coord.minutes == 60) {
-      if (dms_coord.degrees > 0)
-	 dms_coord.degrees++;
-      else
-	 dms_coord.degrees--;
-      dms_coord.minutes = 0;
-   }
-
-   if ((dms_coord.degrees == 0)&&(coord < 0.0)) dms_coord.minutes *= -1;
-
-   return dms_coord;
-}
-
-
-/*************************************************************************
- *
- *N  dms_to_float
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function converts a coordinate in degrees-minutes-seconds format
- *     to a floating point coordinate.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    coord   <input> == (dms_type) degrees-minutes-seconds coordinate.
- *    return <output> == (double) floating point lat lon coordinate.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1990    Original Version    DOS Turbo C
- *E
- *************************************************************************/
-double dms_to_float( dms_type coord )
-{
-   return ( (double)coord.degrees +
-	    ((double)coord.minutes / 60.0) +
-	    (coord.seconds/3600.0) );
-}
-
-
-
-/*************************************************************************
- *
- *N  dms_string
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function converts a coordinate in degrees-minutes-seconds format
- *     to a character string.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    coord   <input> == (dms_type) degrees-minutes-seconds coordinate.
- *    seconds <input> == (int) flag to indicate if seconds are to be
- *                       displayed.
- *    return <output> == (char *) character string.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1990    Original Version    DOS Turbo C
- *E
- *************************************************************************/
-char *dms_string( dms_type coord, int seconds )
-{
-   char *str,deg[5],min[3],sec[3];
-
-   str = (char *)vpfmalloc( (20*sizeof(char))+
-			    sizeof(deg)+sizeof(min)+sizeof(sec) );
-
-   itoa( coord.degrees, deg, 10 );
-   itoa( abs(coord.minutes), min, 10 );
-   if (seconds) itoa( ((int)floor(coord.seconds)), sec, 10 );
-   if ((coord.degrees==0)&&(coord.minutes < 0)) {
-      strcpy(str,"-0");
-      coord.minutes *= -1;
-   } else {
-      strcpy(str,deg);
-   }
-   strcat(str," deg ");
-   strcat(str,min);
-   strcat(str," min ");
-   if (seconds) {
-      strcat(str,sec);
-      strcat(str," sec");
-   }
-
-   return(str);
-}
-#ifdef __MSDOS__
-/*************************************************************************
- *
- *N  out_dms
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays the given degree-minutes-seconds coordinate
- *     at the specified location on the screen.  The direction is given
- *     for placement along the edges of the screen.  Must be in graphics
- *     mode to call this function.  User must make sure that all text will
- *     fit on the screen; this program will not adjust size, but will adjust
- *     location to make sure that all text that CAN fit on the screen WILL
- *     fit on the screen.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    coord   <input> == (dms_type) degrees-minutes-seconds coordinate.
- *    x       <input> == (int) x location.
- *    y       <input> == (int) y location.
- *    dir     <input> == (int) dir.  HORIZ_DIR=0, VERT_DIR=1
- *    seconds <input> == (int) flag indicating whether to display seconds.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    October 1990    Original Version    DOS Turbo C
- *    Ronald Rozensky   Sept 1991 x,y adjustments to make text fit on screen
- *E
- *************************************************************************/
-void out_dms( dms_type coord, int x, int y, int dir, int seconds )
-{
-   char deg[8],min[8],sec[8];
-   int x1,x2,y1,y2, width, adjust, minutes;
-
-   settextjustify(LEFT_TEXT,BOTTOM_TEXT);
-
-   itoa( coord.degrees, deg, 10 );
-   if ((coord.seconds >= 30.0)&&(!seconds)) {
-      /* Round up */
-      minutes = abs(coord.minutes)+1;
-      if (minutes == 60) {
-	 /* Rounded up to next degree */
-	 strcpy(min,"0");
-	 if (coord.degrees > 0)
-	    coord.degrees++;
-	 else if (coord.degrees < 0)
-	    coord.degrees--;
-	 else {
-	    if (coord.minutes < 0 || coord.seconds < 0.0)
-	       coord.degrees++;
-	    else
-	       coord.degrees--;
-	 }
-      } else {
-	 itoa( minutes, min, 10 );
-      }
-      itoa( coord.degrees, deg, 10 );
-   } else {
-      itoa( abs(coord.minutes), min, 10 );
-   }
-   if (seconds) itoa( floor(abs(coord.seconds+0.5)), sec, 10 );
-   if ((coord.degrees==0)&&(coord.minutes < 0)) {
-      strcpy(deg,"-0");
-   }
-   if ((coord.degrees==0)&&(coord.minutes==0)&&(coord.seconds<0)) {
-      strcpy(deg,"-0");
-   }
-   strcat(min,"'");
-   if (seconds) strcat(sec,"''");
-
-   if (dir==HORIZ_DIR) {
-      width = textwidth(deg)+3;
-      if ((coord.minutes > 0)||(seconds)) {
-	 width += textwidth(min)+3;
-      }
-      if (seconds) {
-	 width += textwidth(sec)+3;
-      }
-      x1 = x - width/2;
-      x2 = x1 + width;
-      y1 = y-textheight(deg)-1;
-      y2 = y+1;
-   } else {
-      width = textwidth(deg)+3;
-      if ((coord.minutes > 0)||(seconds)) {
-	 width += textwidth(min)+3;
-      }
-      if (seconds) {
-	 width += textwidth(sec)+3;
-      }
-      x1 = x;
-      x2 = x1 + width;
-      y1 = y - (textheight(deg)+4)/2;
-      y2 = y + (textheight(deg)+4)/2;
-   }
-
-   setfillstyle(SOLID_FILL,DARKGRAY);
-   if (x1 <0)
-     {
-     adjust = 0-x1;
-     x1 = 0;
-     x2 = x2 += adjust;
-     }
-   if (y1 <0)
-     {
-     adjust = 0-y1;
-     y1 = 0;
-     y2 = y2 += adjust;
-     }
-   if ((y1-y2 < getmaxy()) && (y2 > getmaxy()))
-     {
-     adjust = y2-getmaxy();
-     y2 = getmaxy();
-     y1 -= adjust;
-     }
-   if ((x1-x2 < getmaxx()) && (x2 > getmaxx()))
-     {
-     adjust = x2-getmaxx();
-     x2 = getmaxx();
-     x1 -= adjust;
-     }
-   bar(x1,y1,x2,y2);
-   outtextxy(x1,y2,deg);
-   circle(x1+textwidth(deg)+1, y2-textheight(deg), 2);
-   if ((coord.minutes > 0)||(seconds))
-      outtextxy(x1+textwidth(deg)+5,y2-1,min);
-   if (seconds)
-      outtextxy(x1+textwidth(deg)+3+textwidth(min)+3,y2-1,sec);
-
-}
-#endif
-
-
-/*************************************************************************
- *
- *N  strpos
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the character array position of the first
- *     occurrence of the given character. (-1 if not present)
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    str     <input> == (char *) character string to be searched.
- *    ch      <input> == (char) character to search for.
- *    return <output> == (int) position of character (-1 if not present).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1990    Original Version    DOS Turbo C
- *E
- *************************************************************************/
-int strpos( char *str, char ch )
-{
-   register int i;
-
-   for (i=0;(unsigned int)i<strlen(str);i++)
-      if (str[i] == ch) return i;
-   return -1;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  fwithin
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether the input (x,y) coordinate lies
- *     within the given rectangular extent.  It returns either TRUE or FALSE.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    x        <input> == (float) x coordinate of the test point.
- *    y        <input> == (float) y coordinate of the test point.
- *    extent   <input> == (extent_type) rectangular area to be tested.
- *    fwithin <output> == (VPF_BOOLEAN) VPF_BOOLEAN:
- *                               TRUE if (x,y) lies within area
- *                               FALSE if (x,y) lies outside of area
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-VPF_BOOLEAN fwithin( float x,
-		 float y,
-		 extent_type extent )
-{
-   if ((x >= extent.x1) && (x <= extent.x2) &&
-      (y >= extent.y1) && (y <= extent.y2))
-      return TRUE;
-   else
-      return FALSE;
-}
-
-
-
-/*************************************************************************
- *
- *N  contained
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether an input rectangular 'extent1' is
- *     contained within another rectangular 'extent2'.  It returns either
- *     TRUE or FALSE.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    extent1 <input> == (extent_type) rectangular area to be tested within.
- *    extent2 <input> == (extent_type) rectangular area to be tested against.
- *    contained <output> == (VPF_BOOLEAN) VPF_BOOLEAN:
- *                               TRUE if extent2 contains extent1
- *                               FALSE if extent2 does not contain extent1
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-VPF_BOOLEAN contained( extent_type extent1,
-		   extent_type extent2 )
-{
-   /* Test each of the four corners of extent1 */
-   /*   	  ____________
-		  |          |
-		  |  2       |
-		  |    ______+___
-		  |    |     |
-		  |    |     |
-		  |    |  1  |
-		  |    |     |
-		  ------------
-		       |
-		       |
-   */
-   if ((extent1.x1 >= extent2.x1) && (extent1.x1 <= extent2.x2) &&
-      (extent1.y1 >= extent2.y1) && (extent1.y1 <= extent2.y2))
-      return TRUE;
-   /*             ____________
-		  |          |
-		  |  2       |
-		  |          |
-	       ---+------    |
-		  |     |    |
-		  |  1  |    |
-		  |     |    |
-		  ------------
-			|
-			|
-   */
-   if ((extent1.x2 >= extent2.x1) && (extent1.x2 <= extent2.x2) &&
-      (extent1.y1 >= extent2.y1) && (extent1.y1 <= extent2.y2))
-      return TRUE;
-   /*
-		       |
-		  _____|______
-		  |    |     |
-		  |  1 |     |
-		  |    |     |
-		--+-----     |
-		  |          |
-		  |    2     |
-		  |__________|
-   */
-   if ((extent1.x2 >= extent2.x1) && (extent1.x2 <= extent2.x2) &&
-      (extent1.y2 >= extent2.y1) && (extent1.y2 <= extent2.y2))
-      return TRUE;
-   /*			|
-			|
-		  ______|_____
-		  |     |    |
-		  |     | 1  |
-		  |     |    |
-		  | 2   -----+--
-		  |          |
-		  |          |
-		  ------------
-   */
-   if ((extent1.x1 >= extent2.x1) && (extent1.x1 <= extent2.x2) &&
-      (extent1.y2 >= extent2.y1) && (extent1.y2 <= extent2.y2))
-      return TRUE;
-
-
-   /* Test for overlaps */
-   /*	 ________             --------------
-	 |      |             |     2      |
-	 |  1   |             | ---------- |
-     ----+------+----         | |        | |
-     | 2 |      |   |         | |        | |
-     |   |      |   |         | |   1    | |
-     ----+------+----         | |        | |
-	 |      |             | |        | |
-	 |      |             | ---------- |
-	 --------             |            |
-			      --------------
-   */
-   if ((extent1.y1 >= extent2.y1) && (extent1.y2 <= extent2.y2) &&
-       (extent1.x1 <= extent2.x2) && (extent1.x2 >= extent2.x1))
-      return TRUE;
-   /*	 ________             --------------
-	 |      |             |     1      |
-	 |  2   |             | ---------- |
-     ----+------+----         | |        | |
-     | 1 |      |   |         | |        | |
-     |   |      |   |         | |   2    | |
-     ----+------+----         | |        | |
-	 |      |             | |        | |
-	 |      |             | ---------- |
-	 --------             |            |
-			      --------------
-   */
-   if ((extent1.x1 >= extent2.x1) && (extent1.x2 <= extent2.x2) &&
-       (extent1.y1 <= extent2.y2) && (extent1.y2 >= extent2.y1))
-      return TRUE;
-   return FALSE;
-}
-
-
-#ifdef __MSDOS__
-/*************************************************************************
- *
- *N  info_window
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays a temporary window to the screen with a
- *     single string of text.  Must be in graphics mode to call this
- *     function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    text    <input> == (char *)message to display.
- *    return <output> == (window_type) window created and displayed.
- *                       [Will need to be deleted]
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   July 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-window_type info_window( char *text )
-{
-   window_type w;
-   int x,y;
-
-   settextstyle(SMALL_FONT,HORIZ_DIR,4);
-   settextjustify(LEFT_TEXT,BOTTOM_TEXT);
-   if (textwidth(text) > getmaxx())
-     x = getmaxx()-20;
-    else
-     x = textwidth(text) + 20;
-   create_window( &w, x, textheight(text)+10,
-		  menucolor,menubordercolor );
-   get_display_position( &x, &y, w );
-   open_window( &w, x,y );
-   setcolor(menutextcolor);
-   hidemousecursor();
-   outtextxy( 10,textheight(text)+5,text );
-   showmousecursor();
-   return w;
-}
-#endif
-
-
-/*************************************************************************
- *
- *N  rightjust
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function right justifies the given string and removes the
- *     trailing newline character (if one exists).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    str <inout> == (char *) string to be justified.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   November 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-char *rightjust( char *str )
-{
-   return strrev(leftjust(strrev(str)));
-}
-
-/*************************************************************************
- *
- *N  leftjust
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function left justifies the given string and removes the
- *     trailing newline character (if one exists)
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    str <inout> == (char *) string to be justified.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   November 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-char *leftjust(char * str)
-{
-   register char * eol;
-
-   strcpy(str, str + strspn(str, " \t\n\b"));
-
-   if ((eol = strchr(str, '\n')) != NULL)
-     *eol = 0;
-
-   return str;
-}
-
-#ifdef __MSDOS__
-/*************************************************************************
- *
- *N  displayerror
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays an error message when a disk error is detected.
- *     It displays the given lines of text in a popup panel and waits for
- *     the user to click on either retry or cancel.  It returns 1 for retry
- *     and 0 for cancel.  Must be in graphics mode to call this function.
- *
- *     text strings may contain embedded newlines, in which case text to the
- *     right of the newline will be displayed on (what else?) a new line.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    text[]  <input> == (char *) array of text strings to be displayed.
- *    nlines  <input> == (int) number of lines of text (this count ignores
- *                             newline characters embedded in the text
- *                             strings
- *    return <output> == (VPF_BOOLEAN) 1 => retry,
- *                                 0 => cancel.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    July 1990    Prototype 3    DOS Turbo C
- *E
- *************************************************************************/
-VPF_BOOLEAN displayerror( char *text[],
-		      int  nlines )
-{
-   register int i;
-   int          maxw,
-		height,
-		x,
-		y,
-		pad,
-		choice,
-		n_real_lines;
-   panel_type   panel;
-   int          retry_button  = 'r',
-		cancel_button = 'c',
-		msg_ar_sz     = 10;
-   char       * walker,
-	     ** msgs;
-   struct viewporttype view;
-
-   getviewsettings( &view );
-   setviewport(0,0,getmaxx(),getmaxy(),1);
-
-
-   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
-   msgs = (char **) vpfmalloc(msg_ar_sz * sizeof(char *));
-   maxw = height = 0;
-
-   for (n_real_lines = i = 0; i < nlines; i++) {
-     walker = text[i];
-     while (1) {
-	size_t substr_len = strcspn(walker, "\n");
-	char   plug;
-
-	maxw                 = max(maxw, textwidth(walker));
-	height               = height + textheight(walker) + 5;
-	plug                 = walker[substr_len];
-	walker[substr_len]   = '\0';
-	msgs[n_real_lines++] = strdup(walker);
-
-	if (n_real_lines == msg_ar_sz)
-	  msgs = (char **) realloc(msgs, (msg_ar_sz += 5) * sizeof(char *));
-	if (plug == 0)
-	  break;
-
-	walker[substr_len] = plug;
-	walker            += substr_len + 1;
-     }
-   }
-
-   if (maxw < (textwidth("Retry") + textwidth("Cancel") + 20))
-      maxw = textwidth("Retry") + textwidth("Cancel") + 20;
-
-   pad    = (maxw*10)/100;
-   maxw   = maxw + (2*pad);
-   height = height + 2*(textheight("Retry") + 5) + 1;
-   maxw   = min(getmaxx(), maxw);
-   height = min(getmaxy()-10, height);
-
-   create_panel( &panel, maxw, height, menucolor, menubordercolor );
-
-   for (y = i = 0; i < n_real_lines; i++) {
-     create_label(msgs[i], pad, y, SMALL_FONT, 4, menutextcolor, &panel );
-     y += textheight(msgs[i]) + 3;
-   }
-
-   y = height-15;
-
-   create_button( retry_button,
-		  "Retry",
-		  3,
-		  y,
-		  SMALL_FONT,
-		  4,
-		  menutextcolor,
-		  menucolor,
-		  menubordercolor,
-		  RELIEVED,
-		  &panel );
-   create_button( cancel_button,
-		  "Cancel",
-		  maxw - (textwidth("Cancel") + 13),
-		  y,
-		  SMALL_FONT,
-		  4,
-		  menutextcolor,
-		  menucolor,
-		  menubordercolor,
-		  RELIEVED,
-		  &panel );
-
-   get_display_position( &x, &y, panel.window );
-
-   display_panel( &panel, x,y );
-   showmousecursor();
-   arrow_cursor();
-   choice = process_panel( &panel, 0 );
-   hidemousecursor();
-
-   destroy_panel( &panel );
-   close_panel( &panel );
-
-   setviewport(view.left,view.top,view.right,view.bottom,view.clip);
-
-   for (i = 0; i < n_real_lines; i++)
-     free(msgs[i]);
-   free(msgs);
-
-   return (choice == retry_button) ? 1 : 0;
-}
-
-
-
-/*************************************************************************
- *
- *N  getcursorposition
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the cursor position when either the mouse
- *     has been moved or an arrow key has been pressed.  Must have called
- *     showmousecursor() before calling this routine.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    x       <inout> == (int *) x position of the cursor.
- *    y       <inout> == (int *) y position of the cursor.
- *    button  <inout> == (int *) mouse button pressed (or simulated with
- *                               the keyboard).
- *    return <output> == (int) escape status:
- *                             FALSE -> escape pressed
- *                             TRUE  -> escape not pressed
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   November 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-int getcursorposition( int *x,
-		       int *y,
-		       int *button )
-{
-   char ch,ch2;
-   int  xpos,ypos, ok = TRUE;
-
-   if (kbhit()) {
-      xpos = *x;
-      ypos = *y;
-      ch = getch();
-      switch (ch) {
-	 case 13:                         /* Enter key */
-	    *button = LEFT_BUTTON_DOWN;
-	    break;
-	 case '8':
-	    ypos -= 10;
-	    break;
-	 case '2':
-	    ypos += 10;
-	    break;
-	 case '4':
-	    xpos -= 10;
-	    break;
-	 case '6':
-	    xpos += 10;
-	    break;
-	 case 27:
-	    ok = FALSE;
-	    break;
-      }
-      if (ch==0) {
-	 ch2 = getch();
-	 switch (ch2) {
-	    case 72:
-	       ypos--;
-	       break;
-	    case 80:
-	       ypos++;
-	       break;
-	    case 75:
-	       xpos--;
-	       break;
-	    case 77:
-	       xpos++;
-	       break;
-	    case 59: /* F1 key */
-	       *button = RIGHT_BUTTON_DOWN;
-	       break;
-	 }
-      }
-      setmouseposition(xpos,ypos);
-      *x = xpos;
-      *y = ypos;
-   } else getmouseposition(x,y,button);
-   return ok;
-}
-
-
-
-/*************************************************************************
- *
- *N  yes_no
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function displays a panel asking the user a yes or no
- *     question and returns the response.  Must be in graphics mode to call
- *     this function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    text     <input>==(char *) question string.
- *    return  <output>==(int) yes (TRUE) or no (FALSE).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                    DOS Turbo C
- *E
- *************************************************************************/
-int yes_no( char *text )
-{
-   panel_type  panel;
-   int         no_id = 27;
-   int         yes_id = 13;
-   int         x,y,width,height,maxheight,id=0;
-
-   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
-
-   width = 0;
-   maxheight = 0;
-   width = textwidth(text);
-   maxheight = textheight(text);
-
-   width = width + 50;
-   if (width > getmaxx())
-      width = getmaxx()-10;
-   height = maxheight * 5;
-
-   create_panel( &panel,width,height,menucolor,menubordercolor );
-
-   y = maxheight;
-   create_label( text,CENTER,y,SMALL_FONT,4,menutextcolor,&panel );
-   y += maxheight;
-
-   create_button( yes_id, "Yes",
-		  3, height-textheight("Y")-6,
-		  SMALL_FONT, 4,
-		  menutextcolor, menucolor, menubordercolor, RELIEVED,
-		  &panel );
-   create_button( no_id, "No",
-		  width-textwidth("No")-13,
-		  height-textheight("No")-6,
-		  SMALL_FONT, 4,
-		  menutextcolor, menucolor, menubordercolor, RELIEVED,
-		  &panel );
-
-   get_display_position( &x, &y, panel.window );
-
-   display_panel( &panel, x,y );
-
-   id = process_panel(&panel, id);
-
-   destroy_panel( &panel );
-   close_panel( &panel );
-
-   if (id == yes_id)
-      return TRUE;
-   else
-      return FALSE;
-}
-
-
-
-/*************************************************************************
- *
- *N  printer_ready
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether or not the attached
- *     printer is ready.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    return <output> == (int) TRUE if ready, FALSE if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   November 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-int printer_ready( void )
-{
-   union REGS reg;
-
-   reg.h.ah = 2;
-   reg.x.dx = 0;
-   int86(0x17, &reg, &reg);
-
-   /* this is not busy           not an io error      not out of paper */
-   return (reg.h.ah & 0x80) && (!(reg.h.ah & 8)) && (!(reg.h.ah & 32));
-}
-
-
-/*************************************************************************
- *
- *N  printer_ok
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether the printer is ready and allows
- *     the user to keep retrying or cancel.  Must be in graphics mode to call
- *     this function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    return <output> == (int) TRUE if ready, FALSE if cancel.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   November 1990   Original Version   DOS Turbo C
- *E
- *************************************************************************/
-int printer_ok( void )
-{
-   int retry;
-   char *msg[] = {"Printer not ready"};
-
-   while (!printer_ready()) {
-      hidemousecursor();
-      retry = displayerror(msg,1);
-      showmousecursor();
-      if (!retry) return FALSE;
-   }
-   return TRUE;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  coprocessor_present
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether a math coprocessor chip is present
- *     on the current computer configuration.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    return <output> == (int) TRUE if present, FALSE if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   July 1991                          DOS Turbo C
- *E
- *************************************************************************/
-int coprocessor_present( void )
-{
-   int stat;
-
-   stat = biosequip();
-
-   /* If bit 1 of stat is on, a coprocessor is present */
-   if (stat & 2)
-      return TRUE;
-   else
-      return FALSE;
-}
-#endif
-
-
-
-
-/*************************************************************************
- *
- *N  is_primitive
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether the given file name specifies a
- *     VPF primitive table (Edge, Face, Entity Node, or Text).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    name    <input> == (char *) file name to be tested.
- *    return <output> == (int) TRUE if primitive, FALSE if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int is_primitive( char *name )
-{
-   strupr(name);
-   if (strstr(name,"END")) return TRUE;
-   if (strstr(name,"CND")) return TRUE;
-   if (strstr(name,"EDG")) return TRUE;
-   if (strstr(name,"FAC")) return TRUE;
-   if (strstr(name,"TXT")) return TRUE;
-   return FALSE;
-}
-
-
-
-/*************************************************************************
- *
- *N  is_simple_feature
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether the given file name specifies a
- *     VPF simple feature table (Point, Line, or Area feature table).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    name    <input> == (char *) file name to be tested.
- *    return <output> == (int) TRUE if simple feature, FALSE if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int is_simple_feature( char *name )
-{
-   strupr(name);
-   if (strstr(name,"PFT")) return TRUE;
-   if (strstr(name,"LFT")) return TRUE;
-   if (strstr(name,"AFT")) return TRUE;
-   return FALSE;
-}
-
-
-
-/*************************************************************************
- *
- *N  is_complex_feature
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether the given file name specifies a
- *     VPF complex feature table.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    name    <input> == (char *) file name to be tested.
- *    return <output> == (int) TRUE if complex feature, FALSE if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int is_complex_feature( char *name )
-{
-   strupr(name);
-   if (strstr(name,"CFT")) return TRUE;
-   return FALSE;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  is_feature
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether the given file name specifies a
- *     VPF feature table (Point, Line, Area, or Complex feature table).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    name    <input> == (char *) file name to be tested.
- *    return <output> == (int) TRUE if feature, FALSE if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int is_feature( char *name )
-{
-   strupr(name);
-   if (strstr(name,"PFT")) return TRUE;
-   if (strstr(name,"LFT")) return TRUE;
-   if (strstr(name,"AFT")) return TRUE;
-   if (strstr(name,"TFT")) return TRUE;
-   if (strstr(name,"CFT")) return TRUE;
-   return FALSE;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  feature_type
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the type of feature the given table name
- *     refers to (POINT, LINE, AREA, ANNO, or COMPLEX_FEATURE).  If the table
- *     name does not specify a feature type, the function returns FALSE.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    name    <input> == (char *) file name to be tested.
- *    return <output> == (int) feature type (FALSE if invalid name).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int feature_type( char *name )
-{
-   strupr(name);
-   if (strstr(name,"PFT")) return VPF_POINT;
-   if (strstr(name,"LFT")) return VPF_LINE;
-   if (strstr(name,"AFT")) return VPF_AREA;
-   if (strstr(name,"TXT")) return VPF_ANNO;
-   if (strstr(name,"TFT")) return VPF_ANNO;
-   if (strstr(name,"CFT")) return VPF_COMPLEX_FEATURE;
-   return FALSE;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  is_join
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function determines whether the given file name specifies a
- *     VPF join table.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    name    <input> == (char *) file name to be tested.
- *    return <output> == (int) TRUE if join, FALSE if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int is_join( char *name )
-{
-   char *ptr;
-
-   strupr(name);
-   ptr = strstr(name,".");
-   if (strstr(ptr,"JT")) return TRUE;
-   return FALSE;
-}
-
-
-
-/*************************************************************************
- *
- *N  primitive_class
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the feature type the given primitive table
- *     name refers to (POINT, LINE, AREA, or ANNO).  If the table
- *     name is not a valid primitive table name, the function returns NULL.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    name    <input> == (char *) file name to be tested.
- *    return <output> == (int) feature type (NULL if invalid primitive
- *                             name).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int primitive_class( char *name )
-{
-   strupr(name);
-   if (strstr(name,"END")) return VPF_ENTITY_NODE;
-   if (strstr(name,"CND")) return VPF_CONNECTED_NODE;
-   if (strstr(name,"EDG")) return VPF_EDGE;
-   if (strstr(name,"FAC")) return VPF_FACE;
-   if (strstr(name,"TXT")) return VPF_TEXT;
-#ifdef __MSDOS__
-   return NULL;
-#else
-   return 0;
-#endif
-}
-
-int ossim_strcasecmp(const char *s1, const char *s2)
-{
-   size_t s1_size;
-   size_t s2_size;
-   unsigned int i;
-
-   /* Check for one string being null, one not. */
-   if (!s1 && s2)
-   {
-      return -1;
-   }
-   else if (s1 && !s2)
-   {
-      return 1;
-   }
-
-   /* Check for both strings being null.  Consider this equal? */
-   if (!s1 && !s2)
-   {
-      return 0;
-   }
-
-   /* Check for size differences. */
-   s1_size = strlen(s1);
-   s2_size = strlen(s2);
-   if (s1_size < s2_size)
-   {
-      return -1;
-   }
-   else if (s1_size > s2_size)
-   {
-      return 1;
-   }
-
-   /* Check the strings. */
-   for (i=0; i<s1_size; i++)
-   {
-      if ( toupper(s1[i]) != toupper(s2[i]) )
-      {
-         return ( (toupper(s1[i]) < toupper(s2[i]) ) ? -1 : 1);
-      }
-   }
-
-      /* Equal */   
-   return 0;
-}
-
-int ossim_strncasecmp(const char *s1, const char *s2, unsigned int n)
-{
-   size_t s1_size;
-   size_t s2_size;
-   unsigned int i;
-
-   /* Check for one string being null, one not. */
-   if (!s1 && s2)
-   {
-      return -1;
-   }
-   else if (s1 && !s2)
-   {
-      return 1;
-   }
-
-   /* Check for both strings being null.  Consider this equal? */
-   if (!s1 && !s2)
-   {
-      return 0;
-   }
-
-   /* Check for size. */
-   if (n == 0)
-   {
-      return 0;
-   }
-   
-   s1_size = strlen(s1);
-   s2_size = strlen(s2);
-   if (n > s1_size)
-   {
-      return -1;
-   }
-   else if (n > s2_size )
-   {
-      return 1;
-   }
-
-   /* Check the strings. */
-   for (i=0; i<n; i++)
-   {
-      if ( toupper(s1[i]) != toupper(s2[i]) )
-      {
-         return ( (toupper(s1[i]) < toupper(s2[i]) ) ? -1 : 1);
-      }
-   }
-
-      /* Equal */   
-   return 0;
-}
diff --git a/ossim/src/ossim/vpfutil/vpfprim.c b/ossim/src/ossim/vpfutil/vpfprim.c
deleted file mode 100644
index a7fe9a9..0000000
--- a/ossim/src/ossim/vpfutil/vpfprim.c
+++ /dev/null
@@ -1,1137 +0,0 @@
-/*************************************************************************
- *
- *N  Module VPFPRIM  -  VPF Primitives
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This module contains functions for handling VPF primitives
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    N/A
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   April 1991                  DOS Turbo C
- *E
- *************************************************************************/
-
-#include <stdio.h>
-#ifdef __MSDOS__
-#include <io.h>
-#include <dos.h>
-#include <graphics.h>
-#else
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-#endif
-
-#include <string.h>
-#include <ctype.h>
-#if defined(__CYGWIN__) || defined(__APPLE__)|| defined(_WIN32)
-#include <ossim/vpfutil/values.h>
-#else
-#include <ossim/vpfutil/values.h>
-#endif
-#ifdef __MSDOS__
-#include <alloc.h>
-#else
-#ifdef __APPLE__ 
-#include <sys/types.h>
-#include <sys/malloc.h>
-#else
-#ifndef __FreeBSD__
-#include <malloc.h>
-#include <string.h>
-#endif
-#endif
-#endif
-#include <stdlib.h>
-
-
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfprim.h>
-
-/* Compute the offset from the start of the row to the given field */
-static ossim_int32 row_offset( int field, row_type row, vpf_table_type table) 
-{
-   ossim_int32 offset,n,size;
-   int i;
-   id_triplet_type key;
-   int keysize[] = {0,sizeof(char),sizeof(short int),sizeof(ossim_int32)};
-
-   if (field < 0 || field >= table.nfields) return -1;
-
-   offset = 0L;
-   for (i=0;i<field;i++) {
-      switch (table.header[i].type) {
-	 case 'I':
-	    offset += sizeof(ossim_int32)*row[i].count;
-	    break;
-	 case 'S':
-	    offset += sizeof(short int)*row[i].count;
-	    break;
-	 case 'T':
-	    offset += sizeof(char)*row[i].count;
-	    break;
-	 case 'F':
-	    offset += sizeof(float)*row[i].count;
-	    break;
-	 case 'D':
-	    offset += sizeof(date_type)*row[i].count;
-	    break;
-	 case 'K':
-	    get_table_element(i,row,table,&key,&n);
-	    size = sizeof(char) +
-		   keysize[TYPE0(key.type)] +
-		   keysize[TYPE1(key.type)] +
-		   keysize[TYPE2(key.type)];
-	    offset += size*row[i].count;
-	    break;
-	 case 'R':
-	    offset += sizeof(double)*row[i].count;
-	    break;
-	 case 'C':
-	    offset += sizeof(coordinate_type)*row[i].count;
-	    break;
-	 case 'B':
-	    offset += sizeof(double_coordinate_type)*row[i].count;
-	    break;
-	 case 'Z':
-	    offset += sizeof(tri_coordinate_type)*row[i].count;
-	    break;
-	 case 'Y':
-	    offset += sizeof(double_tri_coordinate_type)*row[i].count;
-	    break;
-      }
-   }
-   return offset;
-}
-
-
-/*************************************************************************
- *
- *N  create_edge_rec
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function creates an edge record internal structure from a
- *     row of a VPF edge table.   NOTE:  This function allocates memory
- *     for "edge_rec.coord". This array should be freed when no longer
- *     needed.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    row        <input> == (row_type) VPF table row.
- *    edge_table <input> == (vpf_table_type) opened VPF table to read.
- *    return    <output> == (edge_rec_type) returned edge record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table )
-{
-   edge_rec_type edge;
-   ossim_int32 count,i;
-   int rowid,start,end,right,left,rightfwd,leftfwd,coord;
-   id_triplet_type key;
-   tri_coordinate_type *Zcoord;
-   double_coordinate_type *Bcoord;
-   double_tri_coordinate_type *Ycoord;
-
-   rowid = table_pos( "ID", edge_table );
-   start = table_pos( "START_NODE", edge_table );
-   end = table_pos( "END_NODE", edge_table );
-   right = table_pos( "RIGHT_FACE", edge_table );
-   left = table_pos( "LEFT_FACE", edge_table );
-   rightfwd = table_pos( "RIGHT_EDGE", edge_table );
-   leftfwd = table_pos( "LEFT_EDGE", edge_table );
-   coord = table_pos( "COORDINATES", edge_table );
-
-   get_table_element( rowid, row, edge_table, &(edge.id), &count );
-
-   if (start >= 0)
-      get_table_element( start, row, edge_table, &(edge.start), &count );
-   else
-      edge.start = 0;
-
-   if (end >= 0)
-      get_table_element( end, row, edge_table, &(edge.end), &count );
-   else
-      edge.end = 0;
-
-   if (right >= 0) {
-      if (edge_table.header[right].type=='K') {
-	 get_table_element( right, row, edge_table, &key, &count );
-	 edge.right = key.id;
-      } else if (edge_table.header[right].type=='I') {
-	 get_table_element( right, row, edge_table, &(edge.right),
-			    &count );
-      } else {
-	 edge.right=1;
-      }
-   } else {
-      edge.right = 1;
-   }
-
-   if (left >= 0) {
-      if (edge_table.header[right].type=='K') {
-	 get_table_element( left, row, edge_table, &key, &count );
-	 edge.left = key.id;
-      } else if (edge_table.header[left].type=='I') {
-	 get_table_element( right, row, edge_table, &(edge.left),
-			    &count );
-      } else {
-	 edge.left=1;
-      }
-   } else {
-      edge.left = 1;
-   }
-
-   if (edge_table.header[rightfwd].type=='K') {
-      get_table_element( rightfwd, row, edge_table, &key, &count );
-      edge.rightfwd = key.id;
-   } else if (edge_table.header[rightfwd].type=='I') {
-      get_table_element( rightfwd, row, edge_table, &(edge.rightfwd),
-			 &count );
-   } else {
-      edge.rightfwd=0;
-   }
-
-   if (edge_table.header[leftfwd].type=='K') {
-      get_table_element( leftfwd, row, edge_table, &key, &count );
-      edge.leftfwd = key.id;
-   } else if (edge_table.header[leftfwd].type=='I') {
-      get_table_element( leftfwd, row, edge_table, &(edge.leftfwd),
-			 &count );
-   } else {
-      edge.leftfwd=0;
-   }
-
-   switch (edge_table.header[coord].type) {
-      case 'C':
-	 edge.coord = (coordinate_type *)get_table_element( coord,
-						      row, edge_table,
-						      NULL, &count );
-	 break;
-      case 'Z':
-	 Zcoord = (tri_coordinate_type *)get_table_element( coord,
-						      row, edge_table,
-						      NULL, &count );
-	 edge.coord = (coordinate_type *)malloc(count*
-					  sizeof(coordinate_type));
-	 if (edge.coord) {
-	    for (i=0;i<count;i++) {
-	       edge.coord[i].x = Zcoord[i].x;
-	       edge.coord[i].y = Zcoord[i].y;
-	    }
-	 }
-	 free(Zcoord);
-	 break;
-      case 'B':
-	 Bcoord = (double_coordinate_type *)get_table_element( coord,
-						      row, edge_table,
-						      NULL, &count );
-	 edge.coord = (coordinate_type *)malloc(count*
-					  sizeof(coordinate_type));
-	 if (edge.coord) {
-	    for (i=0;i<count;i++) {
-	       edge.coord[i].x = (float)Bcoord[i].x;
-	       edge.coord[i].y = (float)Bcoord[i].y;
-	    }
-	 }
-	 free(Bcoord);
-	 break;
-      case 'Y':
-	 Ycoord = (double_tri_coordinate_type *)get_table_element( coord,
-						      row, edge_table,
-						      NULL, &count );
-	 edge.coord = (coordinate_type *)malloc(count*
-					  sizeof(coordinate_type));
-	 if (edge.coord) {
-	    for (i=0;i<count;i++) {
-	       edge.coord[i].x = (float)Ycoord[i].x;
-	       edge.coord[i].y = (float)Ycoord[i].y;
-	    }
-	 }
-	 free(Ycoord);
-	 break;
-      default:
-	 count = 0;
-	 break;
-   }
-   edge.coord_type = edge_table.header[coord].type;
-   edge.npts = count;
-
-   edge.fp = NULL;
-   if (!edge.coord) {
-      edge.fp = edge_table.fp;
-      edge.startpos = index_pos(edge.id,edge_table) +
-		      row_offset(coord,row,edge_table) +
-		      (ossim_int32)sizeof(ossim_int32);
-      edge.pos = -1;
-   }
-
-   edge.current_coordinate = -1;
-
-   edge.dir = ' ';
-
-   return edge;
-}
-
-
-/*************************************************************************
- *
- *N  read_edge
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads a VPF edge record from the input VPF table.
- *     It performs a search for the specified line number, and, if found,
- *     allocates, reads, and returns the edge record.   NOTE:  This function
- *     allocates memory for "edge_rec.coord". This array should be freed
- *     when no longer needed.  If an invalid row id is passed in, this
- *     function will have unpredictable results.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    id         <input> == (ossim_int32) edge id number.
- *    edge_table <input> == (vpf_table_type) opened VPF table to read.
- *    return    <output> == (edge_rec_type) returned edge record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-edge_rec_type read_edge( ossim_int32  id,
-			 vpf_table_type edge_table )
-{
-   edge_rec_type edge;
-   row_type row;
-
-   row = get_row( id, edge_table );
-   edge = create_edge_rec( row, edge_table );
-   free_row( row, edge_table );
-   return edge;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  read_next_edge
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads the next VPF edge record from the input VPF table.
- *     NOTE:  This function allocates memory for "edge_rec.coord".
- *     This array should be freed when no longer needed.
- *     Must have called vpf_open_table with DISK as the storage type,
- *     since this function accesses the disk to read the next row.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    edge_table  <input> == (vpf_table_type) opened VPF table to read.
- *    return     <output> == (edge_rec_type) returned edge record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-edge_rec_type read_next_edge( vpf_table_type edge_table )
-{
-   edge_rec_type edge;
-   row_type row;
-
-   row = read_next_row( edge_table );
-   edge = create_edge_rec( row, edge_table );
-   free_row( row, edge_table );
-
-   return edge;
-}
-
-coordinate_type first_edge_coordinate( edge_rec_type *edge_rec )
-{
-   coordinate_type coord;
-   tri_coordinate_type Zcoord;
-   double_coordinate_type Bcoord;
-   double_tri_coordinate_type Ycoord;
-   int size;
-
-   edge_rec->current_coordinate = 0;
-
-   if (edge_rec->coord) {
-      /* Coordinate array is in memory */
-      return edge_rec->coord[0];
-   }
-
-   /* Read coordinate from table */
-   fseek(edge_rec->fp,edge_rec->startpos,SEEK_SET);
-   switch (edge_rec->coord_type) {
-      case 'C':
-	 fread(&coord,sizeof(coord),1,edge_rec->fp);
-	 size = sizeof(coord);
-	 break;
-      case 'Z':
-	 fread(&Zcoord,sizeof(Zcoord),1,edge_rec->fp);
-	 coord.x = Zcoord.x;
-	 coord.y = Zcoord.y;
-	 size = sizeof(Zcoord);
-	 break;
-      case 'B':
-	 fread(&Bcoord,sizeof(Bcoord),1,edge_rec->fp);
-	 coord.x = (float)Bcoord.x;
-	 coord.y = (float)Bcoord.y;
-	 size = sizeof(Bcoord);
-	 break;
-      case 'Y':
-	 fread(&Ycoord,sizeof(Ycoord),1,edge_rec->fp);
-	 coord.x = (float)Ycoord.x;
-	 coord.y = (float)Ycoord.y;
-	 size = sizeof(Ycoord);
-	 break;
-      default:
-	 coord.x = MAXFLOAT/2.0;
-	 coord.y = MAXFLOAT/2.0;
-	 size = 0;
-	 break;
-   }
-   edge_rec->pos = edge_rec->startpos + size;
-
-   return coord;
-}
-
-coordinate_type next_edge_coordinate( edge_rec_type *edge_rec )
-{
-   coordinate_type coord;
-   tri_coordinate_type Zcoord;
-   double_coordinate_type Bcoord;
-   double_tri_coordinate_type Ycoord;
-   int size;
-
-   if (edge_rec->current_coordinate < 0)
-      return first_edge_coordinate(edge_rec);
-
-   edge_rec->current_coordinate++;
-
-   if (edge_rec->current_coordinate >= edge_rec->npts) {
-      edge_rec->current_coordinate = edge_rec->npts-1L;
-      if (!edge_rec->coord)
-	 fseek(edge_rec->fp,edge_rec->startpos +
-			    (edge_rec->npts-1L)*sizeof(coord),
-	       SEEK_SET);
-   }
-
-   if (edge_rec->coord) {
-      /* Coordinate array is in memory */
-      return edge_rec->coord[edge_rec->current_coordinate];
-   }
-
-   /* Read coordinate from table */
-   switch (edge_rec->coord_type) {
-      case 'C':
-	 fread(&coord,sizeof(coord),1,edge_rec->fp);
-	 size = sizeof(coord);
-	 break;
-      case 'Z':
-	 fread(&Zcoord,sizeof(Zcoord),1,edge_rec->fp);
-	 coord.x = Zcoord.x;
-	 coord.y = Zcoord.y;
-	 size = sizeof(Zcoord);
-	 break;
-      case 'B':
-	 fread(&Bcoord,sizeof(Bcoord),1,edge_rec->fp);
-	 coord.x = (float)Bcoord.x;
-	 coord.y = (float)Bcoord.y;
-	 size = sizeof(Bcoord);
-	 break;
-      case 'Y':
-	 fread(&Ycoord,sizeof(Ycoord),1,edge_rec->fp);
-	 coord.x = (float)Ycoord.x;
-	 coord.y = (float)Ycoord.y;
-	 size = sizeof(Ycoord);
-	 break;
-      default:
-	 coord.x = MAXFLOAT/2.0;
-	 coord.y = MAXFLOAT/2.0;
-	 size = 0;
-	 break;
-   }
-   edge_rec->pos = edge_rec->startpos + size;
-
-   return coord;
-}
-
-coordinate_type get_edge_coordinate( ossim_int32 n,
-				     edge_rec_type *edge_rec )
-{
-   coordinate_type coord;
-   tri_coordinate_type Zcoord;
-   double_coordinate_type Bcoord;
-   double_tri_coordinate_type Ycoord;
-   ossim_int32 size;
-
-   if (n < 0)
-      return first_edge_coordinate(edge_rec);
-
-   if (n >= edge_rec->npts) n = edge_rec->npts-1L;
-
-   edge_rec->current_coordinate = n;
-
-   if (edge_rec->coord) {
-      /* Coordinate array is in memory */
-      return edge_rec->coord[n];
-   }
-
-   /* Read coordinate from table */
-   switch (edge_rec->coord_type) {
-      case 'C':
-	 size = sizeof(coord);
-	 break;
-      case 'Z':
-	 size = sizeof(Zcoord);
-	 break;
-      case 'B':
-	 size = sizeof(Bcoord);
-	 break;
-      case 'Y':
-	 size = sizeof(Ycoord);
-	 break;
-      default:
-	 size = 0;
-	 break;
-   }
-   edge_rec->pos = edge_rec->startpos + (n*size);
-   fseek(edge_rec->fp,edge_rec->pos,SEEK_SET);
-   switch (edge_rec->coord_type) {
-      case 'C':
-	 fread(&coord,sizeof(coord),1,edge_rec->fp);
-	 break;
-      case 'Z':
-	 fread(&Zcoord,sizeof(Zcoord),1,edge_rec->fp);
-	 coord.x = Zcoord.x;
-	 coord.y = Zcoord.y;
-	 break;
-      case 'B':
-	 fread(&Bcoord,sizeof(Bcoord),1,edge_rec->fp);
-	 coord.x = (float)Bcoord.x;
-	 coord.y = (float)Bcoord.y;
-	 break;
-      case 'Y':
-	 fread(&Ycoord,sizeof(Ycoord),1,edge_rec->fp);
-	 coord.x = (float)Ycoord.x;
-	 coord.y = (float)Ycoord.y;
-	 break;
-      default:
-	 coord.x = MAXFLOAT/2.0;
-	 coord.y = MAXFLOAT/2.0;
-	 break;
-   }
-
-   return coord;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  read_face
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads a VPF face record from the input VPF table.
- *     It performs a search for the specified face number, and, if found,
- *     reads and returns the face record.  If id is out of range,
- *     either the lowest or highest id numbered face record type will be
- *     returned.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    id           <input> == (ossim_int32) face id number.
- *    face_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return      <output> == (face_rec_type) returned face record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-face_rec_type read_face( ossim_int32  id,
-			 vpf_table_type face_table )
-{
-   face_rec_type face;
-   int rowid,ring;
-   ossim_int32 count;
-   row_type row;
-
-   rowid = table_pos( "ID", face_table );
-   ring = table_pos( "RING_PTR", face_table );
-
-   row = get_row( id, face_table );
-
-   get_table_element( rowid, row, face_table, &(face.id), &count );
-
-   get_table_element( ring, row, face_table, &(face.ring), &count );
-
-   free_row( row, face_table );
-
-   return face;
-}
-
-
-
-
-
-/*************************************************************************
- *
- *N  read_next_face
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads the next VPF face record from the input VPF
- *     table.  Must have used vpf_open_table with DISK as the storage type.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    face_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return      <output> == (face_rec_type) returned face record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-face_rec_type read_next_face( vpf_table_type face_table )
-{
-   face_rec_type face;
-   int rowid,ring;
-   ossim_int32 count;
-   row_type row;
-
-   rowid = table_pos( "ID", face_table );
-   ring = table_pos( "RING_PTR", face_table );
-
-   row = read_next_row( face_table );
-
-   get_table_element( rowid, row, face_table, &(face.id), &count );
-
-   get_table_element( ring, row, face_table, &(face.ring), &count );
-
-   free_row( row, face_table );
-
-   return face;
-}
-
-
-
-
-
-/*************************************************************************
- *
- *N  read_ring
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads a VPF ring record from the input VPF table.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    id           <input> == (ossim_int32) ring id number.
- *    ring_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return      <output> == (ring_rec_type) returned ring record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-ring_rec_type read_ring( ossim_int32  id,
-			 vpf_table_type ring_table )
-{
-   ring_rec_type ring;
-   int rowid,face,edge;
-   ossim_int32 count;
-   row_type row;
-
-   rowid = table_pos( "ID", ring_table );
-   face = table_pos( "FACE_ID", ring_table );
-   edge = table_pos( "START_EDGE", ring_table );
-
-   row = get_row( id, ring_table );
-
-   get_table_element( rowid, row, ring_table, &(ring.id), &count );
-
-   get_table_element( face, row, ring_table, &(ring.face), &count );
-
-   get_table_element( edge, row, ring_table, &(ring.edge), &count );
-
-   free_row( row, ring_table );
-
-   return ring;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  read_next_ring
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads the next VPF ring record from the input VPF table.
- *     If read_next_ring goes past the end of the vpftable, ring_rec_type
- *     id will be a garbage number.  The programmer must ensure that this
- *     does NOT happen.  Must have called vpf_open_table with DISK as the
- *     storage type.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    ring_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return      <output> == (ring_rec_type) returned ring record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-ring_rec_type read_next_ring( vpf_table_type ring_table )
-{
-   ring_rec_type ring;
-   int rowid,face,edge;
-   ossim_int32 count;
-   row_type row;
-
-   rowid = table_pos( "ID", ring_table );
-   face = table_pos( "FACE_ID", ring_table );
-   edge = table_pos( "START_EDGE", ring_table );
-
-   row = read_next_row( ring_table );
-
-   get_table_element( rowid, row, ring_table, &(ring.id), &count );
-
-   get_table_element( face, row, ring_table, &(ring.face), &count );
-
-   get_table_element( edge, row, ring_table, &(ring.edge), &count );
-
-   free_row( row, ring_table );
-
-   return ring;
-}
-
-
-
-
-
-
-/*************************************************************************
- *
- *N  read_point
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads a VPF point record from the input VPF table.
- *     It performs a search for the specified point number, and, if found,
- *     reads and returns the point record.  If read_point is given an
- *     invalid id (eg 1000000) it will return garbage.  It is the programmers
- *     responsibility to ensure that this does NOT happen.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    id            <input> == (ossim_int32) point id number.
- *    point_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return       <output> == (point_rec_type) returned point record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-point_rec_type read_point( ossim_int32  id,
-			   vpf_table_type point_table )
-{
-   point_rec_type point;
-   int rowid,face,coord;
-   ossim_int32 count;
-   coordinate_type c;
-   tri_coordinate_type Zcoord;
-   double_coordinate_type Bcoord;
-   double_tri_coordinate_type Ycoord;
-   row_type row;
-
-   rowid = table_pos( "ID", point_table );
-   face = table_pos( "CONTAINING_FACE", point_table );
-   coord = table_pos( "COORDINATE", point_table );
-
-   row = get_row( id, point_table );
-
-   get_table_element( rowid, row, point_table, &(point.id), &count );
-
-   if (face == -1)
-     point.face = -1;
-   else
-     get_table_element( face, row, point_table, &(point.face), &count );
-
-   switch (point_table.header[coord].type) {
-      case 'C':
-	 get_table_element( coord, row, point_table, &c, &count );
-	 point.x = c.x;
-	 point.y = c.y;
-	 break;
-      case 'Z':
-	 get_table_element( coord, row, point_table, &Zcoord, &count );
-	 point.x = Zcoord.x;
-	 point.y = Zcoord.y;
-	 break;
-      case 'B':
-	 get_table_element( coord, row, point_table, &Bcoord, &count );
-	 point.x = (float)Bcoord.x;
-	 point.y = (float)Bcoord.y;
-	 break;
-      case 'Y':
-	 get_table_element( coord, row, point_table, &Ycoord, &count );
-	 point.x = (float)Ycoord.x;
-	 point.y = (float)Ycoord.y;
-	 break;
-      default:
-	 point.x = MAXFLOAT/2.0;
-	 point.y = MAXFLOAT/2.0;
-	 break;
-   }
-
-   free_row( row, point_table );
-
-   return point;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  read_next_point
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads the next VPF point record from the input
- *     VPF table.  Must have called vpf_open_table with DISK as the
- *     storage type.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    point_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return       <output> == (point_rec_type) returned point record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-point_rec_type read_next_point( vpf_table_type point_table )
-{
-   point_rec_type point;
-   int rowid,face,coord;
-   ossim_int32 count;
-   coordinate_type c;
-   tri_coordinate_type Zcoord;
-   double_coordinate_type Bcoord;
-   double_tri_coordinate_type Ycoord;
-   row_type row;
-
-   rowid = table_pos( "ID", point_table );
-   face = table_pos( "CONTAINING_FACE", point_table );
-   coord = table_pos( "COORDINATE", point_table );
-
-   row = read_next_row( point_table );
-
-   get_table_element( rowid, row, point_table, &(point.id), &count );
-
-   get_table_element( face, row, point_table, &(point.face), &count );
-
-   switch (point_table.header[coord].type) {
-      case 'C':
-	 get_table_element( coord, row, point_table, &c, &count );
-	 point.x = c.x;
-	 point.y = c.y;
-	 break;
-      case 'Z':
-	 get_table_element( coord, row, point_table, &Zcoord, &count );
-	 point.x = Zcoord.x;
-	 point.y = Zcoord.y;
-	 break;
-      case 'B':
-	 get_table_element( coord, row, point_table, &Bcoord, &count );
-	 point.x = (float)Bcoord.x;
-	 point.y = (float)Bcoord.y;
-	 break;
-      case 'Y':
-	 get_table_element( coord, row, point_table, &Ycoord, &count );
-	 point.x = (float)Ycoord.x;
-	 point.y = (float)Ycoord.y;
-	 break;
-      default:
-	 point.x = MAXFLOAT/2.0;
-	 point.y = MAXFLOAT/2.0;
-	 break;
-   }
-
-   free_row( row, point_table );
-
-   return point;
-}
-
-
-
-
-
-
-/*************************************************************************
- *
- *N  read_anno
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads a VPF annotation record from the input VPF table.
- *     It performs a search for the specified annotation id, and, if
- *     found, reads and returns the annotation record.  NOTE: This function
- *     allocates memory for "anno.text".  This must be freed when no
- *     longer needed.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    id           <input> == (ossim_int32) annotation id.
- *    anno_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return      <output> == (anno_rec_type) returned annotation record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-anno_rec_type read_anno( ossim_int32 id,
-			 vpf_table_type anno_table )
-{
-   anno_rec_type anno;
-   int rowid,text,coord;
-   ossim_int32 count;
-   coordinate_type *c;
-   tri_coordinate_type *Zcoord;
-   double_coordinate_type *Bcoord;
-   double_tri_coordinate_type *Ycoord;
-   row_type row;
-
-   rowid = table_pos( "ID", anno_table );
-   text = table_pos( "STRING", anno_table );
-   coord = table_pos( "SHAPE_LINE", anno_table );
-
-   row = get_row( id, anno_table );
-
-   get_table_element( rowid, row, anno_table, &(anno.id), &count );
-
-   anno.text = (char*)get_table_element( text, row, anno_table, NULL, &count );
-
-   switch (anno_table.header[coord].type) {
-      case 'C':
-	 c = (coordinate_type *)get_table_element( coord, row,
-					  anno_table, NULL, &count );
-	 anno.x = c[0].x;
-	 anno.y = c[0].y;
-	 free(c);
-	 break;
-      case 'Z':
-	 Zcoord = (tri_coordinate_type *)get_table_element( coord, row,
-					       anno_table, NULL, &count );
-	 anno.x = Zcoord[0].x;
-	 anno.y = Zcoord[0].y;
-	 free(Zcoord);
-	 break;
-      case 'B':
-	 Bcoord = (double_coordinate_type *)get_table_element( coord, row,
-					       anno_table, NULL, &count );
-	 anno.x = (float)Bcoord[0].x;
-	 anno.y = (float)Bcoord[0].y;
-	 free(Bcoord);
-	 break;
-      case 'Y':
-	 Ycoord = (double_tri_coordinate_type *)get_table_element( coord,
-					 row, anno_table, NULL, &count );
-	 anno.x = (float)Ycoord[0].x;
-	 anno.y = (float)Ycoord[0].y;
-	 free(Ycoord);
-	 break;
-      default:
-	 anno.x = MAXFLOAT/2.0;
-	 anno.y = MAXFLOAT/2.0;
-	 break;
-   }
-
-   free_row( row, anno_table );
-
-   return anno;
-}
-
-
-
-
-/*************************************************************************
- *
- *N  read_next_anno
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function reads the next VPF annotation record from the input
- *     VPF table.  Must have called vpf_open_table with DISK as the storage
- *     type.  NOTE: This function allocates memory for "anno.text".  This
- *     must be freed when no longer needed.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    anno_table   <input> == (vpf_table_type) opened VPF table to read.
- *    return      <output> == (anno_rec_type) returned annotation record.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    April 1991                      DOS Turbo C
- *E
- *************************************************************************/
-anno_rec_type read_next_anno( vpf_table_type anno_table )
-{
-   anno_rec_type anno;
-   int rowid,text,coord;
-   ossim_int32 count;
-   coordinate_type *c;
-   tri_coordinate_type *Zcoord;
-   double_coordinate_type *Bcoord;
-   double_tri_coordinate_type *Ycoord;
-   row_type row;
-
-   rowid = table_pos( "ID", anno_table );
-   text = table_pos( "STRING", anno_table );
-   coord = table_pos( "SHAPE_LINE", anno_table );
-
-   row = read_next_row( anno_table );
-
-   get_table_element( rowid, row, anno_table, &(anno.id), &count );
-
-   anno.text = (char*)get_table_element( text, row, anno_table, NULL, &count );
-
-   switch (anno_table.header[coord].type) {
-      case 'C':
-	 c = (coordinate_type *)get_table_element( coord, row,
-					  anno_table, NULL, &count );
-	 anno.x = c[0].x;
-	 anno.y = c[0].y;
-	 free(c);
-	 break;
-      case 'Z':
-	 Zcoord = (tri_coordinate_type *)get_table_element( coord, row,
-					       anno_table, NULL, &count );
-	 anno.x = Zcoord[0].x;
-	 anno.y = Zcoord[0].y;
-	 free(Zcoord);
-	 break;
-      case 'B':
-	 Bcoord = (double_coordinate_type *)get_table_element( coord, row,
-					       anno_table, NULL, &count );
-	 anno.x = (float)Bcoord[0].x;
-	 anno.y = (float)Bcoord[0].y;
-	 free(Bcoord);
-	 break;
-      case 'Y':
-	 Ycoord = (double_tri_coordinate_type *)get_table_element( coord,
-					 row, anno_table, NULL, &count );
-	 anno.x = (float)Ycoord[0].x;
-	 anno.y = (float)Ycoord[0].y;
-	 free(Ycoord);
-	 break;
-      default:
-	 anno.x = MAXFLOAT/2.0;
-	 anno.y = MAXFLOAT/2.0;
-	 break;
-   }
-
-   free_row( row, anno_table );
-
-   return anno;
-}
-
-
diff --git a/ossim/src/ossim/vpfutil/vpfquery.c b/ossim/src/ossim/vpfutil/vpfquery.c
deleted file mode 100644
index 14b8afd..0000000
--- a/ossim/src/ossim/vpfutil/vpfquery.c
+++ /dev/null
@@ -1,972 +0,0 @@
-/*************************************************************************
- *
- *N  Module VPFQUERY
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This module contains functions for querying a VPF table with a
- *     selection expression.  It has one main entry point - query_table().
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    N/A
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions:
- *F
- *    set_type query_table( char *expression, vpf_table_type table );
- *E
-*************************************************************************/
-
-#include <string.h>
-#include <stdlib.h>
-#if defined(__MSDOS__)
-#include <alloc.h>
-#include <mem.h>
-#include <conio.h>
-#else
-#ifdef __APPLE__ 
-#include <sys/types.h>
-#include <sys/malloc.h>
-#else
-#ifndef __FreeBSD__
-#include <malloc.h>
-#include <string.h>
-#endif
-#endif
-#endif
-
-
-#ifndef __MSDOS__
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-#endif
-#include <stdio.h>
-#include <ossim/vpfutil/linklist.h>
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfview.h>
-#include <ossim/vpfutil/vpftidx.h>
-#include <ossim/vpfutil/set.h>
-
-
-/* Delimiter tokens */
-typedef enum { EQ, NE, LE, GE, LT, GT, AND, OR, QUOTE } delim_type;
-/*static delim_type delim;*/
-
-/* Valid delimeter strings */
-char *delimstr[] = { "=", "<>", "<=", ">=", "<", ">", " AND ",
-		     " OR ", "\"" };
-int ndelim = 9;
-
-char **fieldname;
-int *fieldcol;
-int nfields;
-
-/* Token types */
-#define DELIMETER  1
-#define FIELD      2
-#define VALUE      3
-#define QUOTE      4
-#define STRING     5
-#define EOL        6
-#define FINISHED   7
-#define LOP        8   /* Logical Operator */
-#define JOIN       9
-#define ERROR     10
-
-#ifndef TRUE
-#define TRUE  1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-
-typedef struct {
-   int field;
-   char op;
-   char value[255];
-   char join;
-} expr_type;
-
-
-static void *memalloc( ossim_uint32 size )
-{
-   void *ptr;
-
-   ptr = malloc(size);
-   if (!ptr) {
-#ifdef __MSDOS__
-      printf("Memory allocation error in VPFQUERY  (%d)(%d)\n",size,
-	     farcoreleft());
-#else
-      printf("Memory allocation error in VPFQUERY  (%d)\n",(int)size);
-#endif
-      exit(1);
-   }
-   return ptr;
-}
-
-int is_white( char c )
-{
-   if (c==' ' || c=='\t') return 1;
-   return 0;
-}
-
-
-/*************************************************************************
- *
- *N  return_token
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the first token string found in the
- *     expression string.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    expr   <input>==(char *) selection expression string.
- *    token <output>==(char *) first token in the string.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
-*************************************************************************/
-static void return_token( char *expr, char *token )
-{
-   register int i,j,n,found=0,stopflag;
-
-   n = 0;
-   stopflag=0;
-   while (expr[0] == ' ') {
-      for (i=0;i<ndelim;i++)
-	 if (ossim_strncasecmp(expr,delimstr[i],(unsigned int)strlen(delimstr[i])) == 0) {
-	    stopflag=1;
-	    break;
-	 }
-      if (stopflag) break;
-      expr++;
-   }
-   strcpy(token,expr);
-   for (i=0;(unsigned int)i<strlen(token);i++) {
-      for (j=0;j<ndelim;j++) {
-	 if (ossim_strncasecmp(expr,delimstr[j],(unsigned int)strlen(delimstr[j]))==0) {
-	    if (n>0)
-	       token[i] = '\0';
-	    else
-	       token[strlen(delimstr[j])] = '\0';
-	    found = 1;
-	    break;
-	 }
-      }
-      if ((found) || (!is_white(*expr))) n++;
-      if ((!found)&&(*expr)) expr++;
-/*      if (!is_white(*expr)) n++;  */
-/*      if ((found) || (!is_white(*expr))) n++; */
-      if (found) break;
-   }
-}
-
-
-
-
-/*************************************************************************
- *
- *N  get_token
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function gets the first token, token type, and token value of
- *     the expression string, and then advances the expression string
- *     past the token.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    expression   <input>==(char *) selection expression string.
- *    token       <output>==(char *) first token in the string.
- *    token_type  <output>==(int *) token type.
- *    token_value <output>==(int *) token_value.
- *    return      <output>==(char *) new selection expression.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    static void return_token( char *expr, char *token ) VPFQUERY.C
- *E
- *************************************************************************/
-static char *get_token( char *expression,
-		 char *token, int *token_type, int *token_value )
-{
-   register int i, stopflag;
-
-   *token_type = 0;
-
-   if (*expression == '\0') {
-      *token_type = FINISHED;
-      *token_value = 0;
-      return expression;
-   }
-
-   if (*expression=='\r') {  /* crlf */
-      ++expression; ++expression;
-      *token = '\r';
-      token[1] = '\n';
-      token[2] = 0;
-      *token_type = DELIMETER;
-   }
-
-   stopflag = 0;
-   while ((expression[0] == '\"') || (expression[0] == ' ')) {
-      for (i=0;i<ndelim;i++)
-	 if (ossim_strncasecmp(expression,delimstr[i],(unsigned int)strlen(delimstr[i]))==0) {
-	    stopflag=1;
-	    break;
-	 }
-      if (stopflag) break;
-      expression++;
-   }
-
-   return_token( expression, token );
-   expression += strlen(token);
-
-   if (*token == '\0') {
-      *token_type = FINISHED;
-      *expression = '\0';
-      return expression;
-   }
-
-   leftjust(token);
-   rightjust(token);
-
-   if (ossim_strcasecmp(token,"AND")==0) {
-      strupr(token);
-      *token_type = JOIN;
-      *token_value = AND;
-      while ((expression[0] == '\"') || (expression[0] == ' ')) expression++;
-      return expression;
-   }
-
-   if (ossim_strcasecmp(token,"OR")==0) {
-      strupr(token);
-      *token_type = JOIN;
-      *token_value = OR;
-      while ((expression[0] == '\"') || (expression[0] == ' ')) expression++;
-      return expression;
-   }
-
-   if (token[0] == '"') {   /* quoted string */
-      if (*expression) expression++;
-      i = 0;
-      while (*expression != '"') {
-	 token[i] = *expression;
-	 i++;
-	 expression++;
-	 if (*expression == '\0') {
-	    *token_type = ERROR;
-	    *token_value = ERROR;
-	    return expression;
-	 }
-      }
-
-      while ((expression[0] == '\"') || (expression[0] == ' '))
-	 expression++;
-      token[i] = '\0';
-      *token_type = STRING;
-      *token_value = (int)strlen(token);
-      return expression;
-   }
-
-   for (i=0;i<ndelim;i++) {
-      if (ossim_strcasecmp(token,delimstr[i])==0) {
-	 *token_type = LOP;
-	 *token_value = i;
-	 return expression;
-      }
-   }
-
-   for (i=0;i<nfields;i++) {
-      if (ossim_strcasecmp(token,fieldname[i])==0) {
-	 strupr(token);
-	 *token_type = FIELD;
-	 *token_value = i;
-	 return expression;
-      }
-   }
-
-   *token_type = VALUE;
-   *token_value = 0;
-   return expression;
-}
-
-
-/*************************************************************************
- *
- *N  parse_expression
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns a list of selection expression clause
- *     structures.  This list forms the internal structure of the query
- *     expression.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    expression   <input>==(char *) selection expression string.
- *    table        <input>==(vpf_table_type) VPF table structure.
- *    return      <output>==(linked_list_type) list of expression clauses.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    char *get_token( char *expression, char *token, int *token_type,
- *    int *token_value) VPFQUERY.C
- *    void display_message( char *input) USER DEFINED
- *    linked_list_type ll_init() LINKLIST.C
- *    void ll_reset( linked_list_type list ) LINKLIST.C
- *    void ll_insert( void *element, unsigned size,
- *    position_type position ) LINKLIST.C
- *E
- *************************************************************************/
-static linked_list_type parse_expression( char *expression, vpf_table_type table )
-{
-   linked_list_type exprlist;
-   position_type pos;
-   expr_type expr;
-   int i, token_type, token_value;
-   char token[260];
-
-   exprlist = ll_init();
-   pos = exprlist;
-
-   /* Set up static globals */
-
-   nfields = table.nfields;
-
-   fieldname = (char **)memalloc( (nfields+2) * sizeof(char *) );
-   fieldcol = (int *)memalloc( (nfields+2) * sizeof(int) );
-
-   for (i=0;i<table.nfields;i++) {
-      fieldname[i] = (char *)memalloc(40*sizeof(char));
-      strcpy(fieldname[i], table.header[i].name);
-      fieldcol[i] = i;
-   }
-
-   /*****/
-
-   expression = get_token( expression, token, &token_type, &token_value );
-   while (token_type != FINISHED) {
-      if (token_type != FIELD) {
-	 display_message("Expression syntax error -- Invalid field name");
-	 ll_reset(exprlist);
-	 exprlist = NULL;
-	 break;
-      }
-      expr.field = token_value;
-
-      expression = get_token( expression, token, &token_type, &token_value );
-      if (token_type != LOP) {
-	 display_message("Expression syntax error");
-	 ll_reset(exprlist);
-	 exprlist = NULL;
-	 break;
-      }
-      expr.op = (char)token_value;
-
-      expression = get_token( expression, token, &token_type, &token_value );
-      if (token_type == ERROR) {
-	 display_message("Expression syntax error");
-	 ll_reset(exprlist);
-	 exprlist = NULL;
-	 break;
-      }
-      strcpy(expr.value,token);
-
-      expression = get_token( expression, token, &token_type, &token_value );
-      if (token_type == JOIN) {
-	 expr.join = (char)token_value;
-	 ll_insert( &expr, sizeof(expr), pos );
-	 pos = pos->next;
-	 expression = get_token( expression, token, &token_type,
-				 &token_value );
-      } else if (token_type == FINISHED) {
-	 expr.join = '\0';
-	 ll_insert( &expr, sizeof(expr), pos );
-      } else {
-	 display_message("Expression syntax error");
-	 ll_reset(exprlist);
-	 exprlist = NULL;
-	 break;
-      }
-   }
-
-   for (i=0;i<nfields;i++) free(fieldname[i]);
-   free(fieldname);
-   free(fieldcol);
-
-   return exprlist;
-}
-
-
-
-/*************************************************************************
- *
- *N  comp
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function is a general comparison function for comparing two
- *     buffers.  NOTE:  This function compares the bytes of the buffers
- *     as unsigned characters.  Numeric values > 255 should not be
- *     compared with this function.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    val1    <input>==(void *) first buffer to compare.
- *    val2    <input>==(void *) second buffer to compare.
- *    size    <input>==(int) number of bytes to compare.
- *    op      <input>==(char) logical operator.
- *    return <output>==(int) TRUE or FALSE.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-static int comp( void *val1, void *val2, int size, char op )
-{
-   int result;
-
-   result = memcmp(val1,val2,size);
-
-   switch (op) {
-      case EQ:
-	 result = !result;
-	 break;
-      case NE:
-	 break;
-      case LT:
-	 if (result < 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      case LE:
-	 if (result <= 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      case GT:
-	 if (result > 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      case GE:
-	 if (result >= 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      default:
-	 printf("Invalid logical operator (%d)\n",op);
-	 result = FALSE;
-	 break;
-   }
-   return result;
-}
-
-
-/*************************************************************************
- *
- *N  strcompare
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function compares two strings with the given logical operator.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    val1    <input>==(char *) first buffer to compare.
- *    val2    <input>==(char *) second buffer to compare.
- *    op      <input>==(char) logical operator.
- *    return <output>==(int) TRUE or FALSE.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-static int strcompare( char *val1, char *val2, char op )
-{
-   int result;
-   char str1[300], str2[300];
-
-   strcpy(str1,val1);
-   rightjust(str1);
-   strcpy(str2,val2);
-   rightjust(val2);
-
-   result = ossim_strcasecmp(str1,str2);
-
-   switch (op) {
-      case EQ:
-	 result = !result;
-	 break;
-      case NE:
-	 break;
-      case LT:
-	 if (result < 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      case LE:
-	 if (result <= 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      case GT:
-	 if (result > 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      case GE:
-	 if (result >= 0)
-	    result = TRUE;
-	 else
-	    result = FALSE;
-	 break;
-      default:
-	 printf("Invalid logical operator (%d)\n",op);
-	 result = FALSE;
-	 break;
-   }
-   return result;
-}
-
-
-/*************************************************************************
- *
- *N  icompare
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function compares two ossim_int32 integers with the given logical
- *     operator.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    val1    <input>==(ossim_int32) first buffer to compare.
- *    val2    <input>==(ossim_int32) second buffer to compare.
- *    op      <input>==(char) logical operator.
- *    return <output>==(int) TRUE or FALSE.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-static int icompare( ossim_int32 val1, ossim_int32 val2, char op )
-{
-   int result;
-
-   switch (op) {
-      case EQ:
-	 result = (val1 == val2);
-	 break;
-      case NE:
-	 result = (val1 != val2);
-	 break;
-      case LT:
-	 result = (val1 < val2);
-	 break;
-      case LE:
-	 result = (val1 <= val2);
-	 break;
-      case GT:
-	 result = (val1 > val2);
-	 break;
-      case GE:
-	 result = (val1 >= val2);
-	 break;
-      default:
-	 printf("Invalid logical operator (%d)\n",op);
-	 result = FALSE;
-	 break;
-   }
-   return result;
-}
-
-
-/*************************************************************************
- *
- *N  fcompare
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function compares two floating point numbers with the given
- *     logical operator.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    val1    <input>==(ossim_int32) first buffer to compare.
- *    val2    <input>==(ossim_int32) second buffer to compare.
- *    op      <input>==(char) logical operator.
- *    return <output>==(int) TRUE or FALSE.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    None
- *E
- *************************************************************************/
-static int fcompare( float val1, float val2, char op )
-{
-   int result;
-
-   switch (op) {
-      case EQ:
-	 result = (val1 == val2);
-	 break;
-      case NE:
-	 result = (val1 != val2);
-	 break;
-      case LT:
-	 result = (val1 < val2);
-	 break;
-      case LE:
-	 result = (val1 <= val2);
-	 break;
-      case GT:
-	 result = (val1 > val2);
-	 break;
-      case GE:
-	 result = (val1 >= val2);
-	 break;
-      default:
-	 printf("Invalid logical operator (%d)\n",op);
-	 result = FALSE;
-	 break;
-   }
-   return result;
-}
-
-
-/*************************************************************************
- *
- *N  query_table
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This function returns the set of selected rows of a VPF table
- *     based upon the evaluation of the given selection expression string.
- *
- *     The expression is strictly evaluated left to right.  No nesting
- *     is supported, so parentheses are not allowed.  The expression
- *     must match the form:
- *        <field><log op><value> [ <join> <field><log op><value>]
- *     where,
- *        <field> is a valid field name of the table.
- *        <log op> is one of the following: =, <, >, <=, >=, <> (not equal).
- *        <value> is a valid value for the field.
- *        <join> is either " AND " or " OR ".
- *     Any number of clauses (<field><log op><value>) may be joined
- *     together with AND or OR to form the expression.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    expression <input>==(char *) selection expression string.
- *    table      <input>==(vpf_table_type) VPF table structure.
- *    return    <output>==(set_type) set of selected rows.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels    May 1991                          DOS Turbo C
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Functions Called:
- *F
- *    set_type set_init( ossim_int32 n ) SET.C
- *    void set_insert( ossim_int32 element, set_type set ) SET.C
- *    linked_list_type parse_expression( char *expression,
- *                     vpf_table_type table ) VPFQUERY.C
- *    row_type read_next_row( vpf_table_type table ) VPFREAD.C
- *    position_type ll_first( linked_list_type list ) LINKLIST.C
- *    int ll_end( position_type position ) LINKLIST.C
- *    void ll_element( position_type position, void *element ) LINKLIST.C
- *    void *get_table_element( ossim_int32 field_number,
- * 			 row_type row,
- *			 vpf_table_type table,
- *			 void *value,
- *			 ossim_int32  *count ) VPFREAD.C
- *    void display_message( char *info ) USER DEFINED
- *    static int strcompare( char *val1, char *val2, char op ) VPFQUERY.C
- *    static int icompare( ossim_int32 val1, ossim_int32 val2, char op ) VPFQUERY.C
- *    static int fcompare( float val1, float val2, char op ) VPFQUERY.C
- *    void ll_reset( linked_list_type list ) LINKLIST.C
-      void free_row( row_type row, vpf_table_type table) VPFREAD.C
- *E
- *************************************************************************/
-set_type query_table( char *expression, vpf_table_type table )
-{
-   row_type row;
-   position_type pos;
-   expr_type expr;
-   register ossim_int32 i;
-   int boolval=FALSE, booltemp=0, join = OR;
-   ossim_int32 lval, lval2, count;
-   float fval, fval2;
-   char tval, tval2, *tptr;
-   linked_list_type exprlist;
-   set_type select_set;
-
-   select_set = set_init(table.nrows+1);
-
-   if (strcmp(expression,"*")==0) {
-      set_on(select_set);
-      return select_set;
-   }
-
-   exprlist = parse_expression( expression, table );
-
-   if (!exprlist) return select_set;
-
-   if (table.storage == DISK)
-      fseek( table.fp, index_pos(1,table), SEEK_SET );
-
-   for (i=1;i<=table.nrows;i++) {
-
-      if (table.storage == DISK)
-	 row = read_next_row(table);
-      else
-	 row = get_row( i, table );
-
-      pos = ll_first(exprlist);
-      while (!ll_end(pos)) {
-	 ll_element( pos, &expr );
-	 switch (table.header[expr.field].type) {
-	    case 'I':
-	       if (table.header[expr.field].count == 1) {
-		  get_table_element( expr.field, row, table, &lval, &count );
-		  lval2 = atol(expr.value);
-		  booltemp = icompare( lval, lval2, expr.op );
-	       } else {
-		  display_message(
-		     "Selection may not be performed upon arrays");
-		  i=table.nrows+1;
-	       }
-	       break;
-	    case 'T':
-	       if (table.header[expr.field].count == 1) {
-		  get_table_element( expr.field, row, table, &tval, &count );
-		  tval2 = expr.value[0];
-		  booltemp = comp( &tval, &tval2, sizeof(tval), expr.op );
-	       } else {
-		  tptr = (char *)get_table_element( expr.field, row, table,
-				   NULL, &count );
-		  booltemp = strcompare( tptr, expr.value, expr.op );
-		  free(tptr);
-	       }
-	       break;
-	    case 'F':
-	       if (table.header[expr.field].count == 1) {
-		  get_table_element( expr.field, row, table, &fval, &count );
-		  if (!is_vpf_null_float(fval)) {
-		     fval2 = (float)atof(expr.value);
-		     booltemp = fcompare( fval, fval2, expr.op );
-		  } else booltemp = FALSE;
-	       } else {
-		  display_message(
-		     "Selection may not be performed upon arrays");
-		  i=table.nrows+3;
-	       }
-	       break;
-	    default:
-	       display_message("Field type not supported for query");
-	       i=table.nrows+3;
-	       break;
-	 }
-
-	 if (i>table.nrows) break;
-
-	 if (join==OR)
-	    boolval = boolval || booltemp;
-	 else
-	    boolval = boolval && booltemp;
-
-	 join = expr.join;
-
-	 pos = pos->next;
-      }
-      free_row( row, table );
-      if (boolval) set_insert(i,select_set);
-      boolval = FALSE;
-      join = OR;
-
-      if (i==table.nrows+3) break;
-
-   }
-
-   ll_reset(exprlist);
-
-   return select_set;
-}
-
diff --git a/ossim/src/ossim/vpfutil/vpfrelat.c b/ossim/src/ossim/vpfutil/vpfrelat.c
deleted file mode 100644
index 6fe2592..0000000
--- a/ossim/src/ossim/vpfutil/vpfrelat.c
+++ /dev/null
@@ -1,907 +0,0 @@
-/***************************************************************************
- *
- *N  Module VPFRELAT.C
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This module contains functions supporting relates between VPF
- *    feature classes and primitives (and vice versa).  It relies
- *    upon the information provided by the Feature Class Schema table.
- *    This table is used to generate a feature class relationship (fcrel)
- *    data structure for a feature class.  This structure contains all
- *    of the tables and their primary and foreign keys for the
- *    relationships between a feature table and its primitive, or
- *    from a primitive to its feature table (each relate chain is one way).
- *    This module tries to be as much of a black box as it can to
- *    enable a programmer to simply return the corresponding primitive
- *    row of a feature record, or the corresponding feature row of a
- *    primitive record.
- *
- *    This is one of the most difficult modules required to support
- *    a truly 'generic' VPF application, since VPF allows so many
- *    variations of feature-primitive relationships.  The final version
- *    of this module must support every allowed relationship.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels
- *
- *    Added one-to-many relates 3/2/92 - BJM
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   External Variables:
- *X
- *    None
- *E
- **************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef __MSDOS__
-#include <alloc.h>
-#include <mem.h>
-#else
-#ifdef __APPLE__ 
-#include <sys/types.h>
-#include <sys/malloc.h>
-#else
-#ifndef __FreeBSD__
-#include <malloc.h>
-#include <string.h>
-#endif
-#endif
-#endif
-
-
-#if defined(__CYGWIN__)||defined(__APPLE__)|| defined(_WIN32)
-#include <ossim/vpfutil/values.h>
-#else
-#include <ossim/vpfutil/values.h>
-#endif
-#include <string.h>
-#include <stdarg.h>
-#include <ossim/vpfutil/vpftable.h>
-#include <ossim/vpfutil/vpfview.h>
-#include <ossim/vpfutil/vpfrelat.h>
-#include <ossim/vpfutil/vpftidx.h>
-
-/* Determine if the given table name is in the given list of */
-/* vpf relate structures.                */
-static int table_in_list( char *tablename, linked_list_type rlist )
-{
-   position_type p;
-   vpf_relate_struct rcell;
-
-   p = ll_first(rlist);
-   while (!ll_end(p)) {
-      ll_element(p,&rcell);
-      if (strcmp(rcell.table1,tablename)==0) return 1;
-      p = ll_next(p);
-   }
-   return 0;
-}
-
-/**************************************************************************
- *
- *N  fcs_relate_list
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Read the feature class schema table and create the list of
- *    tables to chain through.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    fcname       <input> == (char *) feature class name.
- *    start_table  <input> == (char *) table to start from.
- *    end_table    <input> == (char *) table to end with.
- *    fcs          <input> == (vpf_table_type) feature class schema table.
- *    fcs_relate_list <output> == (linked_list_type) list of tables to
- *                                chain through.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-linked_list_type fcs_relate_list( char *fcname, char *start_table,
-              char *end_table, vpf_table_type fcs )
-{
-   linked_list_type rlist;
-   vpf_relate_struct rstruct;
-   set_type fcset, set1, set2;
-   char tablename[255], *buf, expr[255];
-   row_type row;
-   ossim_int32 rownum,n;
-   int TABLE1_, KEY1_, TABLE2_, KEY2_;
-
-   rlist = ll_init();
-
-   sprintf(expr,"FEATURE_CLASS = %s",fcname);
-
-   fcset = query_table(expr,fcs);
-
-   if (set_empty(fcset)) {
-      set_nuke(&fcset);
-      return rlist;
-   }
-
-   TABLE1_ = table_pos("TABLE1",fcs);
-   KEY1_ = table_pos("FOREIGN_KEY",fcs);
-   if (KEY1_ < 0) KEY1_ = table_pos("TABLE1_KEY",fcs);
-   TABLE2_ = table_pos("TABLE2",fcs);
-   KEY2_ = table_pos("PRIMARY_KEY",fcs);
-   if (KEY2_ < 0) KEY2_ = table_pos("TABLE2_KEY",fcs);
-
-   strcpy( tablename, start_table );
-   while (1) {
-      sprintf(expr,"TABLE1 = %s",tablename);
-
-      set1 = query_table(expr,fcs);
-      set2 = set_intersection(set1,fcset);
-      set_nuke(&set1);
-      if (set_empty(set2)) {
-    set_nuke(&fcset);
-    set_nuke(&set2);
-    return rlist;
-      }
-      rownum = set_min(set2);
-
-      set_nuke(&set2);
-
-      row = get_row(rownum,fcs);
-
-      buf = (char *)get_table_element(TABLE1_,row,fcs,NULL,&n);
-      strcpy(rstruct.table1,buf);
-      rightjust(rstruct.table1);
-      free(buf);
-
-      buf = (char *)get_table_element(KEY1_,row,fcs,NULL,&n);
-      strcpy(rstruct.key1,buf);
-      rightjust(rstruct.key1);
-      free(buf);
-
-      buf = (char *)get_table_element(TABLE2_,row,fcs,NULL,&n);
-      strcpy(rstruct.table2,buf);
-      rightjust(rstruct.table2);
-      free(buf);
-
-      buf = (char *)get_table_element(KEY2_,row,fcs,NULL,&n);
-      strcpy(rstruct.key2,buf);
-      rightjust(rstruct.key2);
-      free(buf);
-
-      rstruct.degree = R_ONE;  /* Default */
-
-      free_row( row, fcs );
-
-      if (table_in_list(rstruct.table1, rlist)) break;
-
-      ll_insert( &rstruct, sizeof(rstruct), ll_last(rlist) );
-
-      strcpy( tablename, rstruct.table2 );
-
-      if (ossim_strcasecmp(tablename,end_table)==0) break;
-   }
-
-   set_nuke(&fcset);
-
-   return rlist;
-}
-
-
-/**************************************************************************
- *
- *N  vpf_binary_search
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function performs a binary search on a VPF table for the
- *    specified integer value.  Only VPF data type 'I' is supported.
- *    The table must be sorted on the specified field, or this function
- *    will give unpredictable results.  The table must have been
- *    successfully opened.  If more than one row matches the search
- *    value, only the first encountered will be returned.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    srchval <input> == (ossim_int32) specified search value.
- *    field   <input> == (int) table sort field.
- *    table   <input> == (vpf_table_type) VPF table.
- *    vpf_binary_search <output> == (ossim_int32) first matching row.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-ossim_int32 vpf_binary_search( ossim_int32 srchval,
-             int field,
-             vpf_table_type table )
-{
-   ossim_int32 left,right, ival, rowid, n;
-   row_type row;
-
-   left = 1;
-   right = table.nrows;
-
-   do {
-      rowid = (left+right)/2;
-      row = get_row(rowid,table);
-      get_table_element(field,row,table,&ival,&n);
-      free_row(row,table);
-      if (ival < srchval)
-    right = rowid-1;
-      else
-    left = rowid+1;
-   } while ((srchval != ival) && (left <= right));
-
-   if (srchval != ival) rowid = 0;
-
-   return rowid;
-}
-
-
-/**************************************************************************
- *
- *N  related_row
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Return the related row of table2 based upon the value of table 1's key
- *    Table 2 must be the '1' side of an n:1 relationship  --  If it isn't,
- *    use 'related_rows()'.
- *    Supported data types - I and T<n>.
- *    Binary search supported only for data type I. (column must be sorted)
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-ossim_int32 related_row( void *keyval1,
-            vpf_table_type table2, char *key2,
-            int sort_flag )
-{
-   ossim_int32 rowid, i, ival, kval, n;
-   row_type row;
-   int KEY2_;
-   char cval, *tval;
-
-   if (ossim_strcasecmp(key2,"ID")==0) {
-      memcpy( &rowid, keyval1, sizeof(rowid) );
-      return rowid;
-   }
-
-   rowid = 0;
-
-   KEY2_ = table_pos(key2,table2);
-
-   if ((table2.header[KEY2_].type != 'I')&&
-       (table2.header[KEY2_].type != 'T')) return rowid;
-
-   if ((table2.header[KEY2_].type == 'I')&&
-       (table2.header[KEY2_].count != 1)) return rowid;
-
-   if ((table2.header[KEY2_].type == 'T')&&(sort_flag)) sort_flag = 0;
-
-   if (table2.header[KEY2_].type == 'I') memcpy(&kval,keyval1,sizeof(kval));
-
-   if (!sort_flag) {   /* Sequential search */
-
-      for (i=1;i<=table2.nrows;i++) {
-    row = get_row(i,table2);
-    if (table2.header[KEY2_].type == 'I') {
-       get_table_element(KEY2_,row,table2,&ival,&n);
-       if (ival == kval) rowid = i;
-    } else {
-       if (table2.header[KEY2_].count==1) {
-          get_table_element(KEY2_,row,table2,&cval,&n);
-          if (memcmp(&cval,keyval1,sizeof(ival))==0) rowid = i;
-       } else {
-          tval = (char*)get_table_element(KEY2_,row,table2,NULL,&n);
-          if (strcmp(tval,(char *)keyval1)==0) rowid = i;
-       }
-    }
-    free_row(row,table2);
-    if (rowid > 0) break;
-      }
-
-   } else {   /* Binary search */
-
-      memcpy(&kval,keyval1,sizeof(kval));
-      rowid = vpf_binary_search( kval, KEY2_, table2 );
-
-   }
-
-   return rowid;
-}
-
-
-/**************************************************************************
- *
- *N  related_rows
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Return the list of related rows of table2 based upon the value of
- *    table 1's key.
- *    Supported data types - I and T<n>.
- *    Binary search supported only for data type I. (column must be sorted)
- *    Thematic index used, if present on key column.
- *    NOTE: A sequential search operation will search the entire
- *          table ...zzz...
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-linked_list_type related_rows( void *keyval1,
-             vpf_table_type table2, char *key2,
-             int sort_flag,
-             ThematicIndex *idx )
-{
-   linked_list_type rowlist;
-   set_type rowset;
-   ossim_int32 rowid, i, ival, kval, n, start,end;
-   row_type row = 0;
-   int KEY2_;
-   char cval, *tval;
-
-   rowlist = ll_init();
-
-   if (ossim_strcasecmp(key2,"ID")==0) {
-      memcpy( &rowid, keyval1, sizeof(rowid) );
-      ll_insert(&rowid,sizeof(rowid),rowlist);
-      return rowlist;
-   }
-
-   KEY2_ = table_pos(key2,table2);
-
-   if ((table2.header[KEY2_].type != 'I')&&
-       (table2.header[KEY2_].type != 'T')) return rowlist;
-
-   if ((table2.header[KEY2_].type == 'I')&&
-       (table2.header[KEY2_].count != 1)) return rowlist;
-
-   if ((table2.header[KEY2_].type == 'T')&&(sort_flag)) sort_flag = 0;
-
-   if (idx) {
-      if (idx->fp) {
-    rowset = search_thematic_index(idx,(char *)keyval1);
-    start = set_min(rowset);
-    end = set_max(rowset);
-    for (i=start;i<=end;i++)
-       if (set_member(i,rowset)) {
-          ll_insert(&i,sizeof(i),ll_last(rowlist));
-       }
-    set_nuke(&rowset);
-    return rowlist;
-      }
-   }
-
-   if (!sort_flag) {   /* Sequential search */
-
-      for (i=1;i<=table2.nrows;i++) {
-    row = get_row(i,table2);
-    if (table2.header[KEY2_].type == 'I') {
-       get_table_element(KEY2_,row,table2,&ival,&n);
-       if (memcmp(&ival,keyval1,sizeof(ival))==0)
-          ll_insert(&i,sizeof(i),ll_last(rowlist));
-    } else {
-       if (table2.header[KEY2_].count==1) {
-          get_table_element(KEY2_,row,table2,&cval,&n);
-          if (memcmp(&cval,keyval1,sizeof(ival))==0)
-        ll_insert(&i,sizeof(i),ll_last(rowlist));
-       } else {
-          tval = (char*)get_table_element(KEY2_,row,table2,NULL,&n);
-          if (strcmp(tval,(char *)keyval1)==0)
-        ll_insert(&i,sizeof(i),ll_last(rowlist));
-       }
-    }
-    free_row(row,table2);
-      }
-
-   } else {   /* Binary search */
-
-      memcpy(&kval,keyval1,sizeof(kval));
-      rowid = vpf_binary_search( kval, KEY2_, table2 );
-
-      if (rowid > 0) {
-    ll_insert(&rowid,sizeof(rowid),ll_last(rowlist));
-    i = rowid-1L;
-    do {
-       row = get_row(i,table2);
-       get_table_element(KEY2_,row,table2,&ival,&n);
-       if (ival == kval)
-          ll_insert(&i,sizeof(i),ll_last(rowlist));
-       i--;
-       free_row(row, table2);
-    } while ((ival==kval)&&(i>0));
-    i = rowid+1L;
-    do {
-
-       row = get_row(i,table2);
-       get_table_element(KEY2_,row,table2,&ival,&n);
-       if (ival == kval)
-          ll_insert(&i,sizeof(i),ll_last(rowlist));
-       i++;
-       free_row(row, table2);
-    } while ((ival==kval)&&(i<=table2.nrows));
-      }
-
-   }
-
-   return rowlist;
-}
-
-
-/**************************************************************************
- *
- *N  vpf_nullify_table
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Nullify the given VPF table structure.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-void vpf_nullify_table( vpf_table_type *table )
-{
-   strcpy(table->name,"");
-   table->path = NULL;
-   table->nfields = 0;
-   strcpy(table->description,"");
-   strcpy(table->narrative,"");
-   table->header = NULL;
-   table->xfp = NULL;
-   table->index = NULL;
-   table->xstorage = (storage_type)0;
-   table->fp = NULL;
-   table->nrows = 0;
-   table->row = NULL;
-   table->reclen = 0;
-   table->ddlen = 0;
-   table->defstr = NULL;
-   table->storage = (storage_type)0;
-   table->mode = (file_mode)0;
-   table->status = CLOSED;
-}
-
-
-/**************************************************************************
- *
- *N  select_feature_class_relate
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Set up the relationships between features and primitives or between
- *    primitives and features (one way only) for a specified feature class.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-fcrel_type select_feature_class_relate( int fcnum,
-               library_type *library,
-               char *start_table,
-               char *end_table )
-{
-   int storage, cov;
-   vpf_table_type fcs;
-   ossim_int32 i;
-   char path[255], covpath[255];
-   position_type p;
-   vpf_relate_struct rcell;
-   fcrel_type fcrel;
-
-   fcrel.nchain = 0;
-   fcrel.table = NULL;
-   fcrel.relate_list = NULL;
-
-   cov = library->fc[fcnum].coverage;
-   strcpy(covpath,library->cover[cov].path);
-   rightjust(covpath);
-   sprintf( path, "%sfcs", covpath );
-
-   /* Feature Class Schema table */
-   fcs = vpf_open_table( path, disk, "rb", NULL );
-
-   fcrel.relate_list = fcs_relate_list( library->fc[fcnum].name,
-               start_table,end_table,
-               fcs );
-
-   if (ll_empty(fcrel.relate_list)) {
-      ll_reset(fcrel.relate_list);
-      displaymessage("ERROR in feature class relationship!",
-           start_table,end_table,NULL);
-      return fcrel;
-   }
-
-   /* Find the number of tables in the relate chain */
-   p = ll_first(fcrel.relate_list);
-   fcrel.nchain = 0;
-   while (!ll_end(p)) {
-      fcrel.nchain++;
-      p = ll_next(p);
-   }
-   /* Allow for last table2 */
-   fcrel.nchain++;
-
-   fcrel.table = (vpf_table_type *)
-        vpfmalloc((fcrel.nchain+1)*
-              sizeof(vpf_table_type));
-
-   for (i=0;i<fcrel.nchain+1;i++)
-      vpf_nullify_table( &(fcrel.table[i]) );
-
-
-   p = ll_first(fcrel.relate_list);
-   for (i=0;i<fcrel.nchain-1;i++) {
-
-      ll_element(p,&rcell);
-
-      /** Can't open primitive table - may be several under tile **/
-      /** directories.  Open all others **/
-      if (!is_primitive(rcell.table1)) {
-
-    sprintf(path,"%s%s",covpath,rcell.table1);
-    if (is_join(rcell.table1))
-       storage = ram;
-    else
-       storage = disk;
-
-    fcrel.table[i] = vpf_open_table(path,(storage_type)storage,"rb",NULL);
-
-      }
-
-      if (!ll_end(p)) p = ll_next(p);
-   }
-
-   /* End of relate chain */
-   i = fcrel.nchain-1;
-   if (!is_primitive(rcell.table2)) {
-
-      sprintf(path,"%s%s",covpath,rcell.table2);
-      storage = disk;
-
-      fcrel.table[i] = vpf_open_table(path,(storage_type)storage,"rb",NULL);
-
-   }
-
-
-   vpf_close_table( &fcs );
-
-   return fcrel;
-}
-
-
-/**************************************************************************
- *
- *N  fc_row_number
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Given the starting row of a feature class relationship, return the
- *    row number of the table at the end of the feature class relate
- *    chain.
- *    If your relate goes from the feature to the primitive, this will
- *    return the primitive id for the given feature row.
- *    If your relate goes from the primitive to the feature, this will
- *    return the feature id of the given primitive row.
- *
- *    Currently only supports relates on 'I' or 'K' fields.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-ossim_int32 fc_row_number( row_type row, fcrel_type fcrel, ossim_int32 tile )
-{
-   row_type relrow;
-   ossim_int32 count;
-   ossim_int32 i, rownum, keyval;
-   id_triplet_type triplet_keyval;
-   int KEY1_, KEY_;
-   position_type p;
-   vpf_relate_struct rcell;
-
-   p = ll_first(fcrel.relate_list);
-   ll_element(p,&rcell);
-   KEY1_ = table_pos(rcell.key1,fcrel.table[0]);
-
-   get_table_element(0,row,fcrel.table[0],&rownum,&count);
-
-   if (KEY1_ == 0) {     /* "ID" */
-      keyval = rownum;
-   } else {
-      switch (fcrel.table[0].header[KEY1_].type) {
-    case 'I':
-       get_table_element(KEY1_,row,fcrel.table[0],&keyval,&count);
-       break;
-    case 'K':
-       get_table_element(KEY1_,row,fcrel.table[0],&triplet_keyval,
-               &count);
-       keyval = triplet_keyval.exid;
-       if (tile != triplet_keyval.tile) {
-          return -2;
-       }
-       break;
-    default:
-       keyval = 0;
-       break;
-      }
-   }
-
-   p = ll_first(fcrel.relate_list);
-   for (i=1;i<(fcrel.nchain-1);i++) {
-      /* Relate through Join table(s) */
-      rownum = related_row(&keyval,fcrel.table[i],rcell.key2,0);
-      relrow = get_row(rownum,fcrel.table[i]);
-
-      p = ll_next(p);
-      ll_element(p,&rcell);
-      KEY_ = table_pos(rcell.key1,fcrel.table[i]);
-
-      if (KEY_ == 0) {     /* "ID" */
-    keyval = rownum;
-      } else {
-    switch (fcrel.table[i].header[KEY_].type) {
-    case 'I':
-       get_table_element(KEY_,relrow,fcrel.table[i],&keyval,&count);
-       break;
-    case 'K':
-       get_table_element(KEY_,relrow,fcrel.table[i],&triplet_keyval,
-               &count);
-       keyval = triplet_keyval.exid;
-       if (tile != triplet_keyval.tile) {
-         free_row(relrow,fcrel.table[i]);
-          return -2;
-       }
-       break;
-    default:
-       keyval = 0;
-       break;
-    }
-      }
-
-      free_row(relrow,fcrel.table[i]);
-   }
-
-   if (ossim_strcasecmp(rcell.key2,"ID")==0)
-      rownum = keyval;
-   else
-      rownum = related_row(&keyval,fcrel.table[i],rcell.key2,0);
-
-   return rownum;
-}
-
-
-/**************************************************************************
- *
- *N  fc_row_numbers
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Given the starting row of a feature class relationship, return the
- *    list of row numbers of the table at the end of the feature class
- *    relate chain.
- *    If your relate goes from the feature to the primitive, this will
- *    return the primitive ids for the given feature row.
- *    If your relate goes from the primitive to the feature, this will
- *    return the feature ids of the given primitive row.
- *
- *    Currently only supports relates on 'I' or 'K' fields.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-linked_list_type fc_row_numbers( row_type row,
-             fcrel_type fcrel,
-             ossim_int32 tile,
-             ThematicIndex *idx )
-{
-   row_type relrow;
-   ossim_int32 count;
-   ossim_int32 n, rownum, keyval;
-   id_triplet_type triplet_keyval;
-   int KEY1_, KEY_;
-   position_type p, prow, pkey;
-   vpf_relate_struct rcell;
-   linked_list_type rowlist, keylist, templist;
-
-   p = ll_first(fcrel.relate_list);
-   ll_element(p,&rcell);
-   KEY1_ = table_pos(rcell.key1,fcrel.table[0]);
-
-   get_table_element(0,row,fcrel.table[0],&rownum,&count);
-
-   if (KEY1_ == 0) {     /* "ID" */
-      keyval = rownum;
-   } else {
-      switch (fcrel.table[0].header[KEY1_].type) {
-    case 'I':
-       get_table_element(KEY1_,row,fcrel.table[0],&keyval,&count);
-       break;
-    case 'K':
-       get_table_element(KEY1_,row,fcrel.table[0],&triplet_keyval,
-               &count);
-       keyval = triplet_keyval.exid;
-       if (tile != triplet_keyval.tile) {
-          keyval = -2;
-       }
-       break;
-    default:
-       keyval = 0;
-       break;
-      }
-   }
-
-   keylist = ll_init();
-   ll_insert(&keyval,sizeof(keyval),keylist);
-
-   n = 0;
-
-   p = ll_first(fcrel.relate_list);
-   for (n=1;n<(fcrel.nchain-1);n++) {
-
-      /* Relate through Join table(s) */
-
-      rowlist = ll_init();
-      pkey = ll_first(keylist);
-      while (!ll_end(pkey)) {
-    ll_element(pkey,&keyval);
-    templist = related_rows(&keyval,fcrel.table[n],rcell.key2,0,NULL);
-    prow = ll_first(templist);
-    while (!ll_end(prow)) {
-       ll_element(prow,&rownum);
-       if (!ll_locate(&rownum,rowlist))
-          ll_insert(&rownum,sizeof(rownum),ll_last(rowlist));
-       prow = ll_next(prow);
-    }
-    ll_reset(templist);
-    pkey = ll_next(pkey);
-      }
-      ll_reset(keylist);
-
-      p = ll_next(p);
-      ll_element(p,&rcell);
-      KEY_ = table_pos(rcell.key1,fcrel.table[n]);
-
-      keylist = ll_init();
-      prow = ll_first(rowlist);
-      while (!ll_end(prow)) {
-    ll_element(prow,&rownum);
-    relrow = get_row(rownum,fcrel.table[n]);
-
-    if (KEY_ == 0) {     /* "ID" */
-       keyval = rownum;
-    } else {
-       switch (fcrel.table[n].header[KEY_].type) {
-       case 'I':
-          get_table_element(KEY_,relrow,fcrel.table[n],&keyval,&count);
-          break;
-       case 'K':
-          get_table_element(KEY_,relrow,fcrel.table[n],&triplet_keyval,
-             &count);
-          keyval = triplet_keyval.exid;
-          if (tile != triplet_keyval.tile) {
-        keyval = -2;
-          }
-          break;
-       default:
-          keyval = 0;
-          break;
-       }
-    }
-    if (keyval > 0)
-       ll_insert(&keyval,sizeof(keyval),ll_last(keylist));
-    prow = ll_next(prow);
-    free_row(relrow,fcrel.table[n]);
-      }
-      ll_reset(rowlist);
-   }
-
-   rowlist = ll_init();
-   p = ll_first(keylist);
-   while (!ll_end(p)) {
-      ll_element(p,&keyval);
-      templist = related_rows(&keyval,fcrel.table[n],rcell.key2,0,idx);
-      prow = ll_first(templist);
-      while (!ll_end(prow)) {
-    ll_element(prow,&rownum);
-    if (!ll_locate(&rownum,rowlist))
-       ll_insert(&rownum,sizeof(rownum),ll_last(rowlist));
-    prow = ll_next(prow);
-      }
-      ll_reset(templist);
-      p = ll_next(p);
-   }
-   ll_reset(keylist);
-
-   return rowlist;
-}
-
-
-/**************************************************************************
- *
- *N  deselect_feature_class_relate
- *
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    Clear out a previously allocated feature class relate structure
- *    from memory.
- *E
- *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels  DOS Turbo C
- *E
- *************************************************************************/
-void deselect_feature_class_relate( fcrel_type *fcrel )
-{
-   register int i;
-
-   if (fcrel->nchain > 0) {
-      for (i=0;i<fcrel->nchain;i++) {
-    if (fcrel->table[i].status == OPENED) {
-       vpf_close_table(&(fcrel->table[i]));
-    }
-      }
-      free(fcrel->table);
-      ll_reset(fcrel->relate_list);
-   }
-   fcrel->nchain = 0;
-}
\ No newline at end of file
diff --git a/ossim/src/ossim/vpfutil/vpfselec.c b/ossim/src/ossim/vpfutil/vpfselec.c
deleted file mode 100644
index 2e0ed71..0000000
--- a/ossim/src/ossim/vpfutil/vpfselec.c
+++ /dev/null
@@ -1,1320 +0,0 @@
-/*************************************************************************
- *
- *N  Module VPFSELEC - VPF SELECTED FEATURES
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *     This module contains functions for selecting VPF features and
- *     primitives.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     N/A
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   Nov 1991                           DOS Turbo C
- *                     Feb 1992 - Optimized for CD-ROM performance.
- *E
- *************************************************************************/
-
-#ifdef __MSDOS__
-#include <alloc.h>
-#include <mem.h>
-#else
-#ifdef __APPLE__ 
-#include <sys/types.h>
-#include <sys/malloc.h>
-#else
-#ifndef __FreeBSD__
-#include <malloc.h>
-#include <string.h>
-#endif
-#endif
-#endif
-
-
-#ifdef __MSDOS__
-#include <graphics.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#ifdef __MSDOS__
-#include <sys\stat.h>
-#include <dos.h>
-#else
-#include <sys/stat.h>
-#include <limits.h>
-#endif
-#include <ossim/vpfutil/vpfview.h>
-#include <ossim/vpfutil/vpfprim.h>
-#include <ossim/vpfutil/vpfrelat.h>
-#include <ossim/vpfutil/mapgraph.h>
-#include <ossim/vpfutil/projectn.h>
-#include <ossim/vpfutil/vpftidx.h>
-#include <ossim/vpfutil/vpfselec.h>
-#include <ossim/vpfutil/vpfdraw.h>
-
-
-extern char home[255];
-
-/* Defined in VPFSPX.C */
-set_type spatial_index_search( char *fname,
-			       float x1, float y1, float x2, float y2 );
-
-
-#ifdef __MSDOS__
-/*************************************************************************
- *
- *N  read_selected_features
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function reads a saved selection set for a given theme of the
- *    specified view.
- *
- *    NOTE:  This function has "special knowledge" about the structure of
- *    a set.  If that structure is changed, this function must account
- *    for those changes.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     view       <input>==(view_type *) view structure.
- *     themenum   <input>==(int) theme number.
- *     return    <output>==(set_type) set of selected features.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-set_type read_selected_features( view_type *view, int themenum )
-{
-   set_type selset;
-   char path[255], *num = "          ", byte;
-   FILE *fp;
-   register int i;
-
-   /* Determine path name from theme number */
-   strcpy(path,home);
-   strcat(path,view->name);
-   strcat(path,"\\sel");
-   num = itoa(themenum,num,10);
-   for (i=0;i<(4-strlen(num));i++)
-      strcat(path,"0");
-   strcat(path,num);
-
-   if (access(path,0) != 0) {
-      selset.size = 0;
-      selset.buf = NULL;
-      return selset;
-   }
-
-   /* Read the set */
-   if ((fp = fopen(path,"rb")) == NULL) {
-      selset.size = 0;
-      selset.buf = NULL;
-      return selset;
-   }
-   fread( &selset.size, sizeof(ossim_int32), 1, fp );
-   selset.buf = (char *)malloc( ((selset.size/8L)+1L) * sizeof(char) );
-   if (selset.buf) {
-      fread( selset.buf, sizeof(char), (selset.size/8L)+1L, fp );
-      selset.diskstorage = 0;
-   } else {
-      selset.diskstorage = 1;
-      /* Can speed this up by buffering */
-      selset.fp = tmpfile();
-      if (!selset.fp) {
-	 selset.diskstorage=0;
-	 selset.size=0;
-	 selset.buf=NULL;
-	 return selset;
-      }
-      fread(&byte,1,1,selset.fp);
-      while (!feof(fp)) {
-	 fwrite(&byte,1,1,selset.fp);
-	 fread(&byte,1,1,fp);
-      }
-   }
-   fclose(fp);
-
-
-   return selset;
-}
-
-
-/*************************************************************************
- *
- *N  save_selected_features
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function saves the selection set for a given theme of the
- *    specified view to a file in the view directory.
- *
- *    NOTE:  This function has "special knowledge" about the structure of
- *    a set.  If that structure is changed, this function must account
- *    for those changes.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     view     <input>==(view_type *) view structure.
- *     themenum <input>==(int) theme number.
- *     selset   <input>==(set_type) set of selected features.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-void save_selected_features( view_type *view, int themenum,
-			     set_type selset )
-{
-   char path[80], *num="    ", byte;
-   FILE *fp;
-   register int i;
-
-   /* Determine the path name from the theme number */
-   strcpy(path,home);
-   strcat(path,view->name);
-   strcat(path,"\\sel");
-   num = itoa(themenum,num,10);
-   for (i=0;i<(4-strlen(num));i++)
-      strcat(path,"0");
-   strcat(path,num);
-
-   /* Write the set */
-   fp = fopen(path,"wb");
-   if (!fp) return;
-   fwrite( &(selset.size), sizeof(ossim_int32), 1, fp );
-   if (!selset.diskstorage) {
-      fwrite( selset.buf, sizeof(char), (selset.size/8L)+1L, fp );
-   } else {
-      rewind(selset.fp);
-      fread(&byte,1,1,selset.fp);
-      while (!feof(selset.fp)) {
-	 fwrite(&byte,1,1,fp);
-	 fread(&byte,1,1,selset.fp);
-      }
-   }
-   fclose(fp);
-}
-
-
-/*************************************************************************
- *
- *N  get_selected_features
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function gets the selection set for a given theme of the
- *    specified view, either by querying the table, or by reading a
- *    previously saved selection set file.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     view     <input>==(view_type *) view structure.
- *     themenum <input>==(int) theme number.
- *     library  <input>==(library-type) VPF library structure.
- *     return  <output>==(set_type) set of selected features.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-set_type get_selected_features( view_type *view, int themenum,
-				library_type library )
-{
-   set_type selset;
-   vpf_table_type ft;
-   register int i;
-
-   /* Read a selection set, if present */
-   if (strcmp(view->name,"") != 0) {
-      selset = read_selected_features( view, themenum );
-      if (selset.size > 0) return selset;
-   }
-
-   /* No selection set... */
-
-   /* Find the feature class for the theme */
-   for (i=0;i<library.nfc;i++)
-      if (strcasecmp(library.fc[i].name,view->theme[themenum].fc)==0) break;
-   if (i>=library.nfc) {
-      display_message("Invalid theme in view");
-      return selset;
-   }
-
-   /* Query the feature table */
-   ft = vpf_open_table( library.fc[i].table, disk, "rb", NULL );
-   selset = query_table( view->theme[themenum].expression, ft );
-   vpf_close_table( &ft );
-
-   /* Save the selection set so we don't have to query again */
-   if (strcmp(view->name,"") != 0) {
-      save_selected_features( view, themenum, selset );
-   }
-
-   return selset;
-}
-
-
-
-/*************************************************************************
- *
- *N  bounding_select
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function reads the bounding rectangle table to weed out the
- *    local primitives.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *    path      <input> == (char *) path to the bounding rectangle table.
- *    mapextent <input> == (extent_type) map extent to compare.
- *    dec_degrees <input> == (int) flag to indicate if data is in decimal
- *                                 degrees.
- *    bounding_select <output> == (set_type) set of bounding rectangle ids.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-set_type bounding_select( char *path, extent_type mapextent,
-			  int dec_degrees )
-{
-   vpf_table_type table;
-   set_type set;
-   ossim_int32 i, count;
-   extent_type box, pextent;
-   double x1,y1,x2,y2;
-   row_type row;
-   int XMIN_,YMIN_,XMAX_,YMAX_;
-
-   /* Project all extents to plate-carree for cartesian comparisons */
-   /* (decimal degree coordinate systems) */
-
-   x1 = mapextent.x1; y1 = mapextent.y1;
-   x2 = mapextent.x2; y2 = mapextent.y2;
-   if (dec_degrees) {
-      set_plate_carree_parameters( central_meridian(x1,x2), 0.0, 1.0 );
-      pcarree_xy(&x1,&y1);
-      pcarree_xy(&x2,&y2);
-   }
-   pextent.x1 = x1; pextent.y1 = y1;
-   pextent.x2 = x2; pextent.y2 = y2;
-
-   table = vpf_open_table(path,disk,"rb",NULL);
-   XMIN_ = table_pos("XMIN",table);
-   YMIN_ = table_pos("YMIN",table);
-   XMAX_ = table_pos("XMAX",table);
-   YMAX_ = table_pos("YMAX",table);
-   set = set_init(table.nrows+1);
-   for (i=1;i<=table.nrows;i++) {
-      row = read_next_row(table);
-      get_table_element(XMIN_,row,table,&box.x1,&count);
-      get_table_element(YMIN_,row,table,&box.y1,&count);
-      get_table_element(XMAX_,row,table,&box.x2,&count);
-      get_table_element(YMAX_,row,table,&box.y2,&count);
-      free_row(row,table);
-
-      x1 = box.x1; y1 = box.y1;
-      x2 = box.x2; y2 = box.y2;
-      if (dec_degrees) {
-	 pcarree_xy(&x1,&y1);
-	 pcarree_xy(&x2,&y2);
-      }
-      box.x1 = x1; box.y1 = y1;
-      box.x2 = x2; box.y2 = y2;
-
-      if ( contained(box,pextent) || contained(pextent,box) ) {
-	 set_insert(i,set);
-      }
-   }
-   vpf_close_table(&table);
-
-   return set;
-}
-
-
-
-/*************************************************************************
- *
- *N  tile_thematic_index_name
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function determines the name of the tile thematic index for
- *    the given table.  If the table does not have a "TILE_ID" field,
- *    the name is set to null.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     table    <input>==(vpf_table_type) opened VPF table.
- *     path    <output>==(char *) name of the thematic index file.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-void tile_thematic_index_name( vpf_table_type table,
-			       char *path )
-{
-   int i;
-
-   i = table_pos("TILE_ID",table);
-   if (i<0) {
-      strcpy(path,"");
-   } else {
-      /* Thematic index name from the table header */
-      sprintf(path,"%s%s",table.path,table.header[i].tdx);
-   }
-}
-#endif
-/*************************************************************************
- *
- *N  completely_within
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function determines whether extent1 is completely within
- *    extent2.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     extent1 <input>==(extent_type) first extent to compare.
- *     extent2 <input>==(extent_type) second extent to compare.
- *     return  <output>==(int) 1 if extent1 is completely within extent2,
- *                             0 if not.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-int completely_within( extent_type extent1, extent_type extent2 )
-{
-   if (extent1.x1 < extent2.x1) return 0;
-   if (extent1.y1 < extent2.y1) return 0;
-   if (extent1.x2 > extent2.x2) return 0;
-   if (extent1.y2 > extent2.y2) return 0;
-   return 1;
-}
-
-#ifdef __MSDOS__
-/*************************************************************************
- *
- *N  get_selected_primitives
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function determines all of the selected primitive rows from
- *    the selected features.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     view     <input> == (view_type *) view structure.
- *     themenum <input> == (int) theme number.
- *     library  <input> == (library_type *) VPF library structure.
- *     mapenv   <input> == (map_environment_type *) map environment.
- *     status  <output> == (int *) status of the function:
- *                         1 if completed, 0 if user escape.
- *     get_selected_primitives <output> == (set_type *) array of sets, each position
- *                         representing the set of primitives for the
- *                         corresponding tile in the tileref.aft table.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-set_type *get_selected_primitives( view_type *view,
-				   int themenum,
-				   library_type *library,
-				   map_environment_type *mapenv,
-				   int *status )
-{
-   int fcnum, finished, found, cov, tilecover, TILEPATH_, degree;
-   int feature, prim;
-   vpf_table_type tile_table;
-   row_type row;
-   char *ptable[] = {"","edg","fac","txt","end","cnd"};
-   char *spxname[] = {"","esi","fsi","tsi","nsi","csi"};
-   char *brname[] = {"","ebr","fbr","tbr","nbr","cbr"};
-   set_type feature_rows, primitive_rows, tile_features;
-   set_type *primitives;
-   ossim_int32 prim_rownum, count, tile;
-   register ossim_int32 i,j, pclass, start,end;
-   char path[255], covpath[255], tiledir[255], *buf, str[255];
-   fcrel_type fcrel;
-   linked_list_type primlist;
-   position_type p;
-   vpf_relate_struct rcell;
-   ThematicIndex idx;
-
-   primitives = (set_type *)vpfmalloc((library->ntiles+1)*sizeof(set_type));
-   for (i=0;i<=library->ntiles;i++) {
-      primitives[i].size = 0;
-      primitives[i].buf = NULL;
-   }
-
-   fcnum = view->theme[themenum].fcnum;
-
-   feature_rows = get_selected_features( view, themenum, *library );
-
-   /* Open the tile reference table, if present */
-   sprintf(path,"%stileref\\tileref.aft",library->path);
-   if (access(path,0) != 0) {
-      tilecover = FALSE;
-   } else {
-      tile_table = vpf_open_table(path,disk,"rb",NULL);
-      TILEPATH_ = table_pos("TILE_NAME",tile_table);
-      tilecover = TRUE;
-   }
-
-   for (pclass=EDGE;pclass<=CONNECTED_NODE;pclass++) {
-
-      if ((pclass != library->fc[fcnum].primclass) &&
-	  (library->fc[fcnum].primclass != COMPLEX_FEATURE)) continue;
-
-      /* Set up the feature class table relate chain.        */
-      /* The feature table is fcrel.table[0].                */
-      /* The primitive table is the last table in the chain: */
-      /*    fcrel.table[ fcrel.nchain-1 ].                   */
-
-      j = 0;
-      for (i=0;i<strlen(library->fc[fcnum].table);i++)
-	 if (library->fc[fcnum].table[i] == '\\') j = i+1;
-      strcpy( str, &(library->fc[fcnum].table[j]));
-      fcrel = select_feature_class_relate(fcnum, library, str,
-					  ptable[pclass]);
-      feature = 0;
-      prim = fcrel.nchain-1;
-
-      p = ll_previous(ll_last(fcrel.relate_list),fcrel.relate_list);
-      ll_element(p,&rcell);
-      degree = rcell.degree;
-
-      /*** 'Tile' number 1 is the universe polygon for the tileref cover ***/
-      for (tile = 2; tile <= library->ntiles; tile++ ) {
-
-	 if (!set_member(tile,library->tile_set)) continue;
-
-	 if (tilecover) {
-	    row = get_row(tile,tile_table);
-	    buf = (char *)get_table_element(TILEPATH_,row,tile_table,
-					     NULL,&count);
-	    free_row(row,tile_table);
-	    strcpy(tiledir,buf);
-	    rightjust(tiledir);
-	    strcat(tiledir,"\\");
-	    free(buf);
-	 } else {
-	    strcpy(tiledir,"");
-	 }
-
-	 cov = library->fc[fcnum].coverage;
-	 strcpy( covpath, library->cover[cov].path );
-
-	 finished = 1;
-	 found = 0;
-
-	 /* Open primitive table in tile */
-	 sprintf(path,"%s%s%s",covpath,tiledir,ptable[pclass]);
-	 if (access(path,0) != 0) continue;
-	 found = 1;
-	 fcrel.table[prim] = vpf_open_table(path,disk,"rb",NULL);
-
-	 if (primitives[tile].size > 0) {
-	    printf("Oops!  size = %ld\n",primitives[tile].size);
-	    exit(1);
-	 }
-	 primitives[tile] = set_init(fcrel.table[prim].nrows+1);
-
-	 /* Get the set of primitive rows within the map extent */
-
-	 /* Look for spatial index file */
-	 primitive_rows.size = 0;
-	 if (mapenv->projection == PLATE_CARREE &&
-	     mapenv->mapextent.x1 < mapenv->mapextent.x2) {
-	    sprintf(path,"%s%s%s",covpath,tiledir,spxname[pclass]);
-	    if ((access(path,0)==0)&&(fcrel.table[prim].nrows > 20)) {
-
-	       primitive_rows = spatial_index_search(path,
-			  mapenv->mapextent.x1,mapenv->mapextent.y1,
-			  mapenv->mapextent.x2,mapenv->mapextent.y2);
-
-	    } else {
-	       /* Next best thing - bounding rectangle table */
-	       sprintf(path,"%s%s%s",covpath,tiledir,brname[pclass]);
-	       if (access(path,0)==0) {
-		  primitive_rows = bounding_select(path,mapenv->mapextent,
-						   library->dec_degrees);
-	       }
-	    }
-	 } /* projection check */
-
-	 if (primitive_rows.size == 0) {
-	    /* Search through all the primitives */
-	    primitive_rows=set_init(fcrel.table[prim].nrows+1);
-	    set_on(primitive_rows);
-	 }
-
-	 tile_thematic_index_name(fcrel.table[feature], path);
-	 if ( (strcmp(path,"") != 0) && (access(path,4)==0) ) {
-	    /* Tile thematic index for feature table present, */
-	    tile_features = read_thematic_index( path, (char *)&tile );
-	 } else {
-	    tile_features = set_init(fcrel.table[feature].nrows+1);
-	    set_on(tile_features);
-	 }
-
-	 idx.fp = NULL;
-	 i = table_pos(rcell.key2,fcrel.table[prim]);
-	 if (i >= 0) {
-	    if (fcrel.table[prim].header[i].tdx) {
-	       sprintf(path,"%s%s",fcrel.table[prim].path,
-				fcrel.table[prim].header[i].tdx);
-	       if (access(path,0)==0)
-		  idx = open_thematic_index(path);
-	    }
-	    if (fcrel.table[prim].header[i].keytype == 'U') degree = R_ONE;
-	    if (fcrel.table[prim].header[i].keytype == 'N') degree = R_MANY;
-	    if (fcrel.table[prim].header[i].keytype == 'P') degree = R_ONE;
-	 }
-
-	 finished = 1;
-
-	 start = set_min(tile_features);
-	 end = set_max(tile_features);
-
-	 fseek(fcrel.table[feature].fp,
-	       index_pos(start,fcrel.table[feature]),
-	       SEEK_SET);
-
-	 for (i=start;i<=end;i++) {
-
-	    row = read_next_row(fcrel.table[feature]);
-
-	    if (!set_member( i, feature_rows )) {
-	       free_row(row,fcrel.table[feature]);
-	       continue;
-	    }
-
-	    if (!set_member( i, tile_features )) {
-	       free_row(row,fcrel.table[feature]);
-	       continue;
-	    }
-
-	    if (degree == R_ONE) {
-	       prim_rownum = fc_row_number( row, fcrel, tile );
-	       primlist = NULL;
-	       p = NULL;
-	    } else {
-	       primlist = fc_row_numbers( row, fcrel, tile, &idx );
-	    }
-
-	    free_row( row, fcrel.table[feature] );
-
-	    if (!primlist) {
-	       if ((prim_rownum<1)||
-		   (prim_rownum>fcrel.table[prim].nrows))
-		  continue;
-	       if (set_member( prim_rownum, primitive_rows )) {
-		  set_insert(prim_rownum,primitives[tile]);
-	       }
-	    } else {
-	       p = ll_first(primlist);
-	       while (!ll_end(p)) {
-		  ll_element(p,&prim_rownum);
-		  if ((prim_rownum<1)||
-		      (prim_rownum>fcrel.table[prim].nrows))
-		     continue;
-		  if (set_member( prim_rownum, primitive_rows )) {
-		     set_insert(prim_rownum,primitives[tile]);
-		  }
-		  p = ll_next(p);
-	       }
-	    }
-
-	    if (kbhit()) {
-	       if (getch()==27) {
-		  *status = 0;
-		  finished = 0;
-		  break;
-	       }
-	    }
-	 }
-
-	 if (idx.fp) close_thematic_index(&idx);
-
-	 vpf_close_table(&(fcrel.table[prim]));
-
-	 set_nuke(&primitive_rows);
-
-	 set_nuke(&tile_features);
-
-	 if (set_empty(primitives[tile])) {
-	    set_nuke(&primitives[tile]);
-	    primitives[tile].size = 0;
-	    primitives[tile].buf = NULL;
-	 }
-
-	 if (!finished) {
-	    *status = 0;
-	    break;
-	 }
-
-      }
-
-      if (!finished) {
-	 *status = 0;
-	 deselect_feature_class_relate( &fcrel );
-	 break;
-      }
-
-      if (found) *status = 1;
-
-      if (kbhit()) {
-	 if (getch()==27) {
-	    *status = 0;
-	    deselect_feature_class_relate( &fcrel );
-	    break;
-	 }
-      }
-
-      deselect_feature_class_relate( &fcrel );
-   }
-
-   set_nuke(&feature_rows);
-
-   if (tilecover) {
-      vpf_close_table(&tile_table);
-   }
-
-   return primitives;
-}
-
-
-
-/*************************************************************************
- *
- *N  get_selected_tile_primitives
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function determines all of the selected primitive rows from
- *    the selected features of a given tile.
- *
- *    This function expects a feature class relationship structure that
- *    has been successfully created with select_feature_class_relate()
- *    from the feature table to the primitive.  The primitive table in
- *    the feature class relate structure must have been successfully
- *    opened for the given tile.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     library   <input>==(library_type *) VPF library structure.
- *     fcnum     <input>==(int) feature class number of the feature table.
- *     fcrel     <input>==(fcrel_type) feature class relate structure.
- *     feature_rows <input>==(set_type) set of selected features.
- *     mapenv    <input>==(map_environment_type *) map environment.
- *     tile      <input>==(ossim_int32) tile number.
- *     tiledir   <input>==(char *) path to the tile directory.
- *     status   <output>==(int *) status of the function:
- *                         1 if completed, 0 if user escape.
- *     return   <output>==(set_type) set of primitives for the features
- *                         in the corresponding tile.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   May 1991                           DOS Turbo C
- *E
- *************************************************************************/
-set_type get_selected_tile_primitives( library_type *library,
-				       int fcnum,
-				       fcrel_type fcrel,
-				       set_type feature_rows,
-				       map_environment_type *mapenv,
-				       ossim_int32 tile,
-				       char *tiledir,
-				       int *status )
-{
-   int cov, degree;
-   int feature, prim;
-   row_type row;
-   char *spxname[] = {"","esi","fsi","tsi","nsi","csi"};
-   char *brname[] = {"","ebr","fbr","tbr","nbr","cbr"};
-   set_type primitive_rows, tile_features;
-   set_type primitives;
-   ossim_int32 prim_rownum;
-   register ossim_int32 i,pclass, start,end;
-   char path[255], covpath[255];
-   linked_list_type primlist;
-   position_type p;
-   vpf_relate_struct rcell;
-   ThematicIndex idx;
-
-   feature = 0;
-   prim = fcrel.nchain-1;
-
-   /* Assume that fcrel.table[prim] has been opened */
-
-   primitives.size = 0;
-   primitives.buf = NULL;
-
-   cov = library->fc[fcnum].coverage;
-   strcpy( covpath, library->cover[cov].path );
-
-   p = ll_previous(ll_last(fcrel.relate_list),fcrel.relate_list);
-   ll_element(p,&rcell);
-   degree = rcell.degree;
-
-   for (pclass=EDGE;pclass<=CONNECTED_NODE;pclass++) {
-
-      if ((pclass != library->fc[fcnum].primclass) &&
-	  (library->fc[fcnum].primclass != COMPLEX_FEATURE)) continue;
-
-      primitives = set_init(fcrel.table[prim].nrows+1);
-
-      /* Get the set of primitive rows within the map extent */
-
-      /* Look for the spatial index file to weed out primitives in the */
-      /* given tile but outside of the viewing area.  If a projection  */
-      /* other than plate-carree (rectangular) is on, or if the extent */
-      /* crosses the meridian, the quick check is no longer valid.     */
-
-      primitive_rows.size = 0;
-
-      if (mapenv->projection == PLATE_CARREE &&
-	  mapenv->mapextent.x1 < mapenv->mapextent.x2) {
-	 sprintf(path,"%s%s%s",covpath,tiledir,spxname[pclass]);
-	 /* 20 (below) is a fairly arbitrary cutoff of the number of */
-	 /* primitives that make a spatial index search worth while. */
-	 if ((access(path,0)==0)&&(fcrel.table[prim].nrows > 20)) {
-	    primitive_rows = spatial_index_search(path,
-			  mapenv->mapextent.x1,mapenv->mapextent.y1,
-			  mapenv->mapextent.x2,mapenv->mapextent.y2);
-	 } else {
-	    /* Next best thing - bounding rectangle table */
-	    sprintf(path,"%s%s%s",covpath,tiledir,brname[pclass]);
-	    if ((access(path,0)==0)&&(fcrel.table[prim].nrows > 20)) {
-	       primitive_rows = bounding_select(path,mapenv->mapextent,
-						library->dec_degrees);
-	    }
-	 }
-      }
-      if (primitive_rows.size == 0) {
-	 /* Search through all the primitives */
-	 primitive_rows=set_init(fcrel.table[prim].nrows+1);
-	 set_on(primitive_rows);
-      }
-
-      if (strcmp(tiledir,"") != 0) {
-	 tile_thematic_index_name(fcrel.table[feature], path);
-	 if ((strcmp(path,"")!=0) && (access(path,4)==0)) {
-	    /* Tile thematic index for feature table present, */
-	    tile_features = read_thematic_index( path, (char *)&tile );
-	 } else {
-	    tile_features = set_init(fcrel.table[feature].nrows+1);
-	    set_on(tile_features);
-	 }
-      } else {
-	 tile_features = set_init(fcrel.table[feature].nrows+1);
-	 set_on(tile_features);
-      }
-      set_delete(0,tile_features);
-
-      idx.fp = NULL;
-      i = table_pos(rcell.key2,fcrel.table[prim]);
-      if (i >= 0) {
-	 if (fcrel.table[prim].header[i].tdx) {
-	    sprintf(path,"%s%s",fcrel.table[prim].path,
-				fcrel.table[prim].header[i].tdx);
-	    if (access(path,0)==0)
-	       idx = open_thematic_index(path);
-	 }
-	 if (fcrel.table[prim].header[i].keytype == 'U') degree = R_ONE;
-	 if (fcrel.table[prim].header[i].keytype == 'N') degree = R_MANY;
-	 if (fcrel.table[prim].header[i].keytype == 'P') degree = R_ONE;
-      }
-
-      start = set_min(tile_features);
-      end = set_max(tile_features);
-
-      /* It turns out to be MUCH faster off of a CD-ROM to */
-      /* read each row and discard unwanted ones than to   */
-      /* forward seek past them.  It's about the same off  */
-      /* of a hard disk.				      */
-
-      fseek(fcrel.table[feature].fp,index_pos(start,fcrel.table[feature]),
-	    SEEK_SET);
-
-      for (i=start;i<=end;i++) {
-
-	 row = read_next_row(fcrel.table[feature]);
-
-	 if (!set_member( i, feature_rows )) {
-	    free_row(row,fcrel.table[feature]);
-	    continue;
-	 }
-	 if (!set_member( i, tile_features )) {
-	    free_row(row,fcrel.table[feature]);
-	    continue;
-	 }
-
-	 if (degree == R_ONE) {
-	    prim_rownum = fc_row_number( row, fcrel, tile );
-	    primlist = NULL;
-	    p = NULL;
-	 } else {
-	    primlist = fc_row_numbers( row, fcrel, tile, &idx );
-	 }
-
-	 free_row( row, fcrel.table[feature] );
-
-	 if (!primlist) {
-	    if ((prim_rownum<1)||(prim_rownum>fcrel.table[prim].nrows))
-	       continue;
-	    if (set_member( prim_rownum, primitive_rows )) {
-	       set_insert(prim_rownum,primitives);
-	    }
-	 } else {
-	    p = ll_first(primlist);
-	    while (!ll_end(p)) {
-	       ll_element(p,&prim_rownum);
-	       if ((prim_rownum<1)||
-		   (prim_rownum>fcrel.table[prim].nrows))
-		  continue;
-	       if (set_member( prim_rownum, primitive_rows )) {
-		  set_insert(prim_rownum,primitives);
-	       }
-	       p = ll_next(p);
-	    }
-	 }
-
-	 if (primlist) ll_reset(primlist);
-
-	 if (kbhit()) {
-	    if (getch()==27) {
-	       *status = 0;
-	       break;
-	    }
-	 }
-      }
-
-      set_nuke(&primitive_rows);
-
-      set_nuke(&tile_features);
-
-      if (idx.fp) close_thematic_index(&idx);
-
-      *status = 1;
-
-      if (kbhit()) {
-	 if (getch()==27) {
-	    *status = 0;
-	    break;
-	 }
-      }
-   }
-
-   return primitives;
-}
-#endif
-
-#if __MSDOS__
-static ossim_int32 filesize( char *file )
-{
-   struct stat s;
-   stat(file,&s);
-   return (ossim_int32)s.st_size;
-}
-
-static ossim_int32 available_space( char *drive )
-{
-   struct dfree disktable;
-   int disknum;
-
-   if (!drive) return 0;
-
-   disknum=toupper(drive[0])-'A'+1;
-   getdfree(disknum,&disktable);
-   return (ossim_int32) disktable.df_avail *
-	  (ossim_int32) disktable.df_sclus *
-	  (ossim_int32) disktable.df_bsec;
-}
-#endif
-
-#ifdef __MSDOS__
-/*************************************************************************
- *
- *N  draw_selected_features
- *
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Purpose:
- *P
- *    This function draws the selected features from a specified feature
- *    class based upon a query (either an expression or the pre-compiled
- *    results of an expression).
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   Parameters:
- *A
- *     view     <inout>==(view_type *) view structure.
- *     themenum <input>==(int) theme number.
- *     library  <input>==(library_type *) VPF library structure.
- *     mapenv   <input>==(map_environment_type *) map environment structure.
- *     return  <output>==(int) completion status:
- *                                1 if completed successfully,
- *                                0 if an error occurred.
- *E
- *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- *
- *   History:
- *H
- *    Barry Michaels   August 1991                        DOS Turbo C
- *E
- *************************************************************************/
-int draw_selected_features( view_type *view,
-			    int themenum,
-			    library_type *library,
-			    map_environment_type *mapenv )
-{
-   int status, fcnum, finished, cov, tilecover, TILEPATH_, prim;
-   int outline, color1, color2, color3, color4;
-   vpf_table_type rngtable,edgtable,fbrtable, tile_table;
-   row_type row;
-   char *ptable[] = {"","edg","fac","txt","end","cnd"};
-   register ossim_int32 i, j, p, pclass, tile;
-   int display_order[] = {FACE,EDGE,ENTITY_NODE,CONNECTED_NODE,TEXT};
-   register ossim_int32 starttile, endtile, startprim, endprim;
-   ossim_int32 count;
-   char path[255], covpath[255], tiledir[255], *buf, str[255];
-   char *drive, rngpath[255],edgpath[255],edxpath[255],fbrpath[255];
-   boolean rng_rdisk,edg_rdisk,fbr_rdisk;
-   set_type primitives, feature_rows;
-   fcrel_type fcrel;
-   window_type info;
-   struct viewporttype vp;
-
-   getviewsettings(&vp);
-
-   fcnum = view->theme[themenum].fcnum;
-
-   sprintf(path,"%stileref\\tileref.aft",library->path);
-   if (access(path,0) != 0) {
-      tilecover = FALSE;
-   } else {
-      tile_table = vpf_open_table(path,disk,"rb",NULL);
-      TILEPATH_ = table_pos("TILE_NAME",tile_table);
-      tilecover = TRUE;
-   }
-
-   feature_rows = get_selected_features( view, themenum, *library );
-
-   for (p=0;p<5;p++) {
-      pclass = display_order[p];
-
-      if ((pclass != library->fc[fcnum].primclass) &&
-	  (library->fc[fcnum].primclass != COMPLEX_FEATURE)) continue;
-
-      if ((library->fc[fcnum].primclass == COMPLEX_FEATURE) &&
-	  (!library->fc[fcnum].cprim[pclass])) continue;
-
-      /* Set up the feature class table relate chain.        */
-      /* The feature table is fcrel.table[0].                */
-      /* The primitive table is the last table in the chain: */
-      /*    fcrel.table[ fcrel.nchain-1 ].                   */
-
-      j = 0;
-      for (i=0;i<strlen(library->fc[fcnum].table);i++)
-	 if (library->fc[fcnum].table[i] == '\\') j = i+1;
-      strcpy( str, &(library->fc[fcnum].table[j]));
-      fcrel = select_feature_class_relate(fcnum, library, str,
-					  ptable[pclass]);
-      prim = fcrel.nchain-1;
-
-      /*** 'Tile' number 1 is the universe polygon for
-	   the tileref cover ***/
-      starttile = set_min(library->tile_set);
-      if (starttile < 2) starttile = 2;
-      endtile = set_max(library->tile_set);
-      if (endtile < 2) endtile = 2;
-
-      for (tile = starttile; tile <= endtile; tile++ ) {
-
-	 if (!set_member(tile,library->tile_set)) continue;
-
-	 if (tilecover) {
-	    row = get_row(tile,tile_table);
-	    buf = (char *)get_table_element(TILEPATH_,row,tile_table,
-					     NULL,&count);
-	    free_row(row,tile_table);
-	    strcpy(tiledir,buf);
-	    rightjust(tiledir);
-	    strcat(tiledir,"\\");
-	    free(buf);
-	 } else {
-	    strcpy(tiledir,"");
-	 }
-
-	 cov = library->fc[fcnum].coverage;
-	 strcpy( covpath, library->cover[cov].path );
-
-	 finished = TRUE;
-
-	 sprintf(path,"%s%s%s",covpath,tiledir,ptable[pclass]);
-
-	 if (access(path,0) != 0) continue;
-	 fcrel.table[prim] = vpf_open_table(path,disk,"rb",NULL);
-
-	 info = info_window("Searching...");
-
-	 primitives = get_selected_tile_primitives( library,
-						    fcnum, fcrel,
-						    feature_rows,
-						    mapenv,
-						    tile, tiledir,
-						    &status );
-	 delete_window(&info);
-	 setviewport(vp.left,vp.top,vp.right,vp.bottom,vp.clip);
-
-	 /* Reset plate-carree parameters (changed in  */
-	 /* get_selected_tile_primitives() )           */
-	 if (mapenv->projection == PLATE_CARREE)
-	    set_plate_carree_parameters( central_meridian(
-					 mapenv->mapextent.x1,
-					 mapenv->mapextent.x2),
-					 0.0, 1.0 );
-
-	 if (primitives.size < 1) {
-	    vpf_close_table(&fcrel.table[prim]);
-	    continue;
-	 }
-
-	 if (!status) {
-	    set_nuke(&primitives);
-	    vpf_close_table(&fcrel.table[prim]);
-	    break;
-	 }
-
-	 if (pclass == FACE) {
-	    /* Must also open RNG, EDG, and FBR for drawing faces. */
-	    /* If a RAM disk is specified, copy these to it and open */
-	    /* them there. */
-	    rng_rdisk = FALSE;
-	    edg_rdisk = FALSE;
-	    fbr_rdisk = FALSE;
-	    drive = getenv("TMP");
-	    buf = (char *)vpfmalloc(255);
-
-	    sprintf(path,"%s%srng",covpath,tiledir);
-	    strcpy(rngpath,path);
-	    if (drive && filesize(path) < available_space(drive)) {
-	       sprintf(rngpath,"%s\\RNG",drive);
-	       sprintf(buf,"COPY %s %s > NUL",path,rngpath);
-	       system(buf);
-	       rng_rdisk = TRUE;
-	    }
-	    rngtable = vpf_open_table(rngpath,disk,"rb",NULL);
-
-	    sprintf(path,"%s%sedg",covpath,tiledir);
-	    strcpy(edgpath,path);
-            sprintf(edxpath,"%s%sedx",covpath,tiledir);
-	    if (drive &&
-	       (filesize(path)+filesize(edxpath))<available_space(drive)) {
-	       sprintf(edgpath,"%s\\EDG",drive);
-	       sprintf(buf,"COPY %s %s > NUL",path,edgpath);
-	       system(buf);
-	       sprintf(edxpath,"%s\\EDX",drive);
-	       sprintf(buf,"COPY %s%sedx %s > NUL",covpath,tiledir,edxpath);
-	       system(buf);
-	       edg_rdisk = TRUE;
-	    }
-	    edgtable = vpf_open_table(edgpath,disk,"rb",NULL);
-
-	    sprintf(path,"%s%sfbr",covpath,tiledir);
-	    strcpy(fbrpath,path);
-	    if (drive && filesize(path) < available_space(drive)) {
-	       sprintf(fbrpath,"%s\\FBR",drive);
-	       sprintf(buf,"COPY %s %s > NUL",path,fbrpath);
-	       system(buf);
-	       fbr_rdisk = TRUE;
-	    }
-	    fbrtable = vpf_open_table(fbrpath,disk,"rb",NULL);
-
-	    free(buf);
-	 }
-
-	 finished = 1;
-
-	 startprim = set_min(primitives);
-	 endprim = set_max(primitives);
-
-	 /* It turns out to be MUCH faster off of a CD-ROM to */
-	 /* read each row and discard unwanted ones than to   */
-	 /* forward seek past them.  It's about the same off  */
-	 /* of a hard disk.				      */
-
-	 fseek(fcrel.table[prim].fp,
-	       index_pos(startprim,fcrel.table[prim]),
-	       SEEK_SET);
-
-	 for (i=startprim;i<=endprim;i++) {
-
-	    row = read_next_row(fcrel.table[prim]);
-
-	    if (set_member( i, primitives )) {
-	       /* Draw the primitive */
-	       switch (pclass) {
-		  case EDGE:
-		     finished = draw_edge_row(row,fcrel.table[prim]);
-		     break;
-		  case ENTITY_NODE:
-		  case CONNECTED_NODE:
-		     finished = draw_point_row(row,fcrel.table[prim]);
-		     break;
-		  case FACE:
-		     gpgetlinecolor( &outline );
-		     gpgetpattern( &color1, &color2, &color3, &color4 );
-		     hidemousecursor();
-		     draw_face_row( row,fcrel.table[prim],
-				    rngtable, edgtable, fbrtable,
-				    outline,
-				    color1, color2, color3, color4 );
-		     showmousecursor();
-		     finished = 1;
-		     if (kbhit()) {
-			if (getch()==27) finished = 0;
-		     }
-		     break;
-		  case TEXT:
-		     finished = draw_text_row(row,fcrel.table[prim]);
-		     break;
-	       }
-	    }
-
-	    free_row(row,fcrel.table[prim]);
-
-	    if (!finished) {
-	       status = 0;
-	       break;
-	    }
-	 }
-
-	 if (pclass == FACE) {
-	    vpf_close_table(&rngtable);
-	    if (rng_rdisk) remove(rngpath);
-	    vpf_close_table(&edgtable);
-	    if (edg_rdisk) {
-	       remove(edgpath);
-	       remove(edxpath);
-	    }
-	    vpf_close_table(&fbrtable);
-	    if (fbr_rdisk) remove(fbrpath);
-	 }
-
-	 vpf_close_table(&fcrel.table[prim]);
-
-	 set_nuke(&primitives);
-
-	 if (!finished) {
-	    status = 0;
-	    break;
-	 }
-
-      }
-
-      if (!finished) {
-	 status = 0;
-	 deselect_feature_class_relate( &fcrel );
-	 break;
-      }
-
-      status = 1;
-
-      if (kbhit()) {
-	 if (getch()==27) {
-	    status = 0;
-	    deselect_feature_class_relate( &fcrel );
-	    break;
-	 }
-      }
-
-      deselect_feature_class_relate(&fcrel);
-   }
-
-   if (tilecover) {
-      vpf_close_table(&tile_table);
-   }
-
-   set_nuke(&feature_rows);
-
-   return status;
-}
-#endif
-
-
diff --git a/ossim/src/test/CMakeLists.txt b/ossim/src/test/CMakeLists.txt
deleted file mode 100644
index 23bf264..0000000
--- a/ossim/src/test/CMakeLists.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
-
-OSSIM_SETUP_APPLICATION(ossim-aux-dot-xml-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-aux-dot-xml-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-byte-stream-buffer-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-byte-stream-buffer-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-csv-file-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-csv-file-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-date-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-date-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-datum-shift COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-datum-shift.cpp)
-OSSIM_SETUP_APPLICATION(ossim-directory-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-directory-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-dms-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-dms-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-dted-handler-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-dted-handler-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-dump-vpf-table COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-dump-vpf-table.cpp)
-OSSIM_SETUP_APPLICATION(ossim-duration-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-duration-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-elevation-manager-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-elevation-manager-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-envi-hdr-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-envi-hdr-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-epsg-factory-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-epsg-factory-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-eq-projection-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-eq-projection-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-fgdc-txt-doc-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-fgdc-txt-doc-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-filename-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-filename-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-foo COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-foo.cpp)
-OSSIM_SETUP_APPLICATION(ossim-get-pixel-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-get-pixel-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-gpkg-writer-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gpkg-writer-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-gpt-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gpt-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-gsd-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gsd-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-gsoc1 COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gsoc1.cpp)
-OSSIM_SETUP_APPLICATION(ossim-histo-compare COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-histo-compare.cpp)
-OSSIM_SETUP_APPLICATION(ossim-image-chain-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-chain-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-image-elevation-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-elevation-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-image-geometry-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-geometry-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-image-handler-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-handler-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-index-to-rgb-lut-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-index-to-rgb-lut-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-info-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-info-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-image-writer-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-writer-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-jobqueue-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-jobqueue-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-keywordlist-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-keywordlist-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-least-squares-plane-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-least-squares-plane-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-loadtile-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-loadtile-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-lsr-space-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-lsr-space-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-mask-filter-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-mask-filter-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-nitf-rsm-model-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-nitf-rsm-model-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-notify-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-notify-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-obj-allocate COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-obj-allocate.cpp)
-OSSIM_SETUP_APPLICATION(ossim-piecewise-remapper-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-piecewise-remapper-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-pixel-flipper-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-pixel-flipper-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-point-cloud-handler-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-point-cloud-handler-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-point-cloud-image-handler-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-point-cloud-image-handler-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-point-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-point-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-projection-factory-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-projection-factory-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-projection-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-projection-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-range-dome-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-range-dome-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-read-write-consistency-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-read-write-consistency-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-rect-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-rect-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-ref-ptr-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-ref-ptr-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-remap-table-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-remap-table-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-shift-filter-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-shift-filter-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-single-image-chain-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-single-image-chain-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-single-image-chain-threaded-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-single-image-chain-threaded-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-srtm-support-data-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-srtm-support-data-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-string-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-string-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-thin-plate-spline-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-thin-plate-spline-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-threaded-chain-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-chain-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-threaded-elevation-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-elevation-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-threaded-polyarea2d-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-polyarea2d-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-threaded-logfile-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-logfile-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-tiled-elevation-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-tiled-elevation-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-tiff-info-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-tiff-info-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-visitor-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-visitor-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-wavelength-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-wavelength-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-wkt-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-wkt-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-wkt-proj-factory-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-wkt-proj-factory-test.cpp)
-OSSIM_SETUP_APPLICATION(ossim-xml-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-xml-test.cpp)
diff --git a/ossim/src/test/ossim-date-test.cpp b/ossim/src/test/ossim-date-test.cpp
deleted file mode 100644
index cc2a85a..0000000
--- a/ossim/src/test/ossim-date-test.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test code for generic ossim test.
-//
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-date-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimDate.h>
-#include <ossim/init/ossimInit.h>
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   std::string s1 = "2009-02-05T11:26:13.458650Z";
-   ossimLocalTm d1;
-   d1.setIso8601(s1);
-   
-   std::string s2 = "2009-01-11T09:06:05.606000Z";
-   ossimLocalTm d2;
-   d2.setIso8601(s2);
-
-   cout << "s1: " << s1 << "\n";
-   d1.dump(std::cout);
-   cout << "s2: " << s2 << "\n";
-   d2.dump(std::cout);
-
-   ossimLocalTm d4;
-   cout << "local time:\n";
-   d4.dump(cout);
- 
-   ossimLocalTm d5 = d4.convertToGmt();
-   cout << "local time converted to GMT:\n";
-   d5.dump(cout);
-
-   
-   ossimDate d6;
-   cout << "Date:\n";
-   d6.print(cout);
-   cout << "\n";
-   d6.dump(cout);
-   cout << endl;
-
-   return 0;
-}
-
-
diff --git a/ossim/src/test/ossim-directory-test.cpp b/ossim/src/test/ossim-directory-test.cpp
deleted file mode 100644
index 2f7aac5..0000000
--- a/ossim/src/test/ossim-directory-test.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-directory-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test application for ossimDirectory class.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimDirectory.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <iostream>
-using namespace std;
-
-static void usage()
-{
-   cout << "ossim-directory-test <directory>"
-        << "\nDumps files in directory..." << endl;
-}
-
-int main(int argc, char *argv[])
-{
-   int result = 0;
-   
-   ossimInit::instance()->initialize(argc, argv);
-   
-   if (argc == 2)
-   {
-      try // Exceptions can be thrown so 
-      {
-         ossimFilename directory = argv[1];
-         
-         cout << "directory: " << directory << "\n";
-         directory = directory.expand();
-
-         ossimDirectory d;
-         if ( d.open(directory) )
-         {
-            ossimFilename f;
-            if ( d.getFirst(f) )
-            {
-               do
-               {
-                  if ( f.size() )
-                  {
-                     cout << "file: " << f << endl;
-                  }
-                  else
-                  {
-                     cout << "file is empty!" << endl;
-                  }
-               } while ( d.getNext(f) );
-            }
-            else
-            {
-               cout << "ossimDirectory::getFirst() returned false!" << endl;
-            }
-         }
-      }
-      catch( const ossimException& e )
-      {
-         cout << e.what() << endl;
-         result = 1;
-      }
-   }
-   else
-   {
-      usage();
-   }
-   
-   return result;
-}
-
diff --git a/ossim/src/test/ossim-dted-handler-test.cpp b/ossim/src/test/ossim-dted-handler-test.cpp
deleted file mode 100644
index 78f3124..0000000
--- a/ossim/src/test/ossim-dted-handler-test.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2005 David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application / example code of opening a dted handler
-// and using it.
-//
-// $Id: ossim-dted-handler-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/elevation/ossimDtedHandler.h>
-
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   //---
-   // Note: You must tweak the next three variables...
-   // This is a 3601x3601 cell.
-   //---
-   ossimFilename dtedCell = "/work/drb/image_formats/dted/1arc/w092/n40.dt1";
-   double neLat = 41.0;
-   double neLon = -92.0;
-   
-   ossimDtedHandler* dh = new ossimDtedHandler(dtedCell);
-   double p00 = dh->getPostValue(ossimIpt(0, 3599));
-   double p01 = dh->getPostValue(ossimIpt(0, 3600));
-   double p10 = dh->getPostValue(ossimIpt(1, 3599));
-   double p11 = dh->getPostValue(ossimIpt(1, 3600));
-
-   double ps  = 1.0/3601.0; // post spacing
-   double hps = ps/2.0;     // half post spacing
-   
-   ossimGpt gp00( (neLat-ps),    neLon,      0.0 );
-   ossimGpt gp01(  neLat,        neLon,      0.0 );
-   ossimGpt gp10( (neLat-ps),   (neLon+ps),  0.0);
-   ossimGpt gp11(  neLat,       (neLon+ps),  0.0 );
-   ossimGpt gpMid( (neLat-hps), (neLon+hps), 0.0 );
-   
-   double hp00  =  dh->getHeightAboveMSL(gp00);   
-   double hp01  =  dh->getHeightAboveMSL(gp01);
-   double hp10  =  dh->getHeightAboveMSL(gp10);
-   double hp11  =  dh->getHeightAboveMSL(gp11);
-   double hpMid =  dh->getHeightAboveMSL(gpMid);
-
-   cout << "\ngp00:   " << gp00
-        << "\np00:    " << p00
-        << "\nhp00:   " << hp00
-      
-        << "\ngp01:   " << gp01
-        << "\np01:    " << p01
-        << "\nhp01:   " << hp01
-      
-        << "\ngp10:   " << gp10
-        << "\np10:    " << p10
-        << "\nhp10:   " << hp10
-
-        << "\ngp11:   " << gp11
-        << "\np11:    " << p11
-        << "\nhp11:   " << hp11
-
-        << "\ngpMid:  " << gpMid
-        << "\nhpMid:  " << hpMid
-
-        << endl;
-
-   delete dh;
-   
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-elevation-manager-test.cpp b/ossim/src/test/ossim-elevation-manager-test.cpp
deleted file mode 100644
index 12a6055..0000000
--- a/ossim/src/test/ossim-elevation-manager-test.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  David Burken
-//
-// Description: Test code for ossimElevManger.
-//
-// $Id: ossim-elevation-manager-test.cpp 22751 2014-04-25 17:54:56Z dburken $
-//----------------------------------------------------------------------------
-#include <iostream>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/elevation/ossimElevManager.h>
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-#if 1
-   if (argc != 2)
-   {
-      cout << "usage: " << argv[0] << " <elevationDirectoryToOpen>" << endl;
-      return 0;
-   }
-   
-   ossimFilename dir = argv[1];
-
-   cout << "dir: " << dir << endl;
-   
-   if (ossimElevManager::instance()->loadElevationPath(dir))
-   {
-      cout << "ossimElevManager::openDirectory worked for: " << dir << endl;
-   }
-   else
-   {
-      cout << "ossimElevManager::openDirectory failed for: " << dir << endl;
-   }
-#endif
-#if 1
-   std::vector<std::string> cells;
-   ossimElevManager::instance()->getCellsForBounds( 24.0, -83.0, 28.0, -80.0, cells );
-
-   std::vector<std::string>::const_iterator i = cells.begin();
-   while ( i != cells.end() )
-   {
-      cout << "cell: " << (*i) << endl;
-      ++i;
-   }
-#endif
-   
-   return 0;
-}
diff --git a/ossim/src/test/ossim-envi-hdr-test.cpp b/ossim/src/test/ossim-envi-hdr-test.cpp
deleted file mode 100644
index f5c6c4d..0000000
--- a/ossim/src/test/ossim-envi-hdr-test.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test app for ossimEnviHeader class.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-#include <iostream>
-using namespace std;
-
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 2)
-   {
-      cout << argv[0] << " <envi_header_file>"
-           << "\nOpen, parse and print ossimEnviHeader object." << endl;
-      return 0;
-   }
-
-   cout << "ossimEnviHeader test:\n";
-
-   ossimEnviHeader hdr;
-   if ( hdr.open( ossimFilename( argv[1] ) ) )
-   {
-      ossimString s = "Hello world...";
-      hdr.setDescription( s );
-      
-      cout << hdr << endl;
-   }
-   else
-   {
-      cout << "Could not open: " << argv[1] << endl;
-   }
-
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-eq-projection-test.cpp b/ossim/src/test/ossim-eq-projection-test.cpp
deleted file mode 100644
index 915f29e..0000000
--- a/ossim/src/test/ossim-eq-projection-test.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <iostream>
-
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   ossimGpt gpt_ul (38.0, -77.0);
-   ossimDpt ipt_ul (0.0, 0.0);
-   ossimDpt ipt_lr (255.0, 255.0);
-   ossimGpt gpt;
-   ossimDpt gsd;
-
-   ossimEquDistCylProjection proj;
-
-   proj.setUlTiePoints(gpt_ul);
-   proj.setDecimalDegreesPerPixel(ossimDpt(0.0000090,0.0000090));
-
-   cout << "\n Normal initialization ***************"<<endl;
-   cout << "ORIG: "<<proj.getOrigin()<<endl;
-   cout << "TP: "<<proj.getUlGpt()<<endl;
-   cout << "GSD: "<<proj.getMetersPerPixel() << endl;
-   proj.lineSampleHeightToWorld(ipt_ul, 0.0, gpt);
-   cout << "UL: " <<gpt << endl;
-   proj.lineSampleHeightToWorld(ipt_lr, 0.0, gpt);
-   cout << "LR: " <<gpt << endl;
-
-   proj.setOrigin(gpt_ul);
-
-   cout << "\n Origin set to UL ***************"<<endl;
-   cout << "ORIG: "<<proj.getOrigin()<<endl;
-   cout << "TP: "<<proj.getUlGpt()<<endl;
-   cout << "GSD: "<<proj.getMetersPerPixel() << endl;
-   proj.lineSampleHeightToWorld(ipt_ul, 0.0, gpt);
-   cout << "UL: " <<gpt << endl;
-   proj.lineSampleHeightToWorld(ipt_lr, 0.0, gpt);
-   cout << "LR: " <<gpt << endl;
-
-   proj.setUlTiePoints(gpt_ul);
-
-   cout << "\n Tiepoint reset to UL ***************"<<endl;
-   cout << "ORIG: "<<proj.getOrigin()<<endl;
-   cout << "TP: "<<proj.getUlGpt()<<endl;
-   cout << "GSD: "<<proj.getMetersPerPixel() << endl;
-   proj.lineSampleHeightToWorld(ipt_ul, 0.0, gpt);
-   cout << "UL: " <<gpt << endl;
-   proj.lineSampleHeightToWorld(ipt_lr, 0.0, gpt);
-   cout << "LR: " <<gpt << endl;
-
-   return 0;
-}
diff --git a/ossim/src/test/ossim-fgdc-txt-doc-test.cpp b/ossim/src/test/ossim-fgdc-txt-doc-test.cpp
deleted file mode 100644
index 77df47c..0000000
--- a/ossim/src/test/ossim-fgdc-txt-doc-test.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File ossim-fgdc-txt-doc-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application for ossimFgdcTxtDoc class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-info-test.cpp 19751 2011-06-13 15:13:07Z dburken $
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/support_data/ossimFgdcTxtDoc.h>
-
-#include <iostream>
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   ossimArgumentParser ap(&argc, argv);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   if ( ap.argc() == 2 )
-   {
-      try
-      {
-         // Test the ossimFgdcTxtDoc
-         ossimRefPtr<ossimFgdcTxtDoc> fgdcDoc = new ossimFgdcTxtDoc();
-         ossimFilename file(argv[1]);
-         if ( fgdcDoc->open( file ) )
-         {
-            cout << "opened: " << file << endl;
-            ossimRefPtr<ossimProjection> proj;
-            fgdcDoc->getProjection(proj);
-            if ( proj.valid() )
-            {
-               proj->print(cout);
-            }
-
-            std::string units;
-            fgdcDoc->getAltitudeDistanceUnits(units);
-            cout << "units: " << units << endl;
-         }
-         
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         return 1;
-      }
-      
-   }  // End: if ( ( ap.argc() == 2 ) ...
-   else
-   {
-      cout << argv[0] << " <FGDC-text-doc.txt>\nTest ossimFgdcTxtDoc class..." << endl;
-   }
-   
-   return 0;
-   
-} // End of main...
-
diff --git a/ossim/src/test/ossim-filename-test.cpp b/ossim/src/test/ossim-filename-test.cpp
deleted file mode 100644
index 8817c0d..0000000
--- a/ossim/src/test/ossim-filename-test.cpp
+++ /dev/null
@@ -1,202 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// ossimFilename class test app.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-filename-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimFilename.h>
-
-#include <iostream>
-#include <string>
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   ossimFilename directoryToDelete;
-
-   if ( argc == 2 )
-   {
-      ossimString osArg1 = argv[1];
-      osArg1.downcase();
-      if ( (osArg1 == "-h") || (osArg1 == "--help") )
-      {
-         cout << "\nUsage: ossim-filename-test <optional_directory_to_delete>\n"
-              << "Runs various test on ossimFilename class.\n"
-              << "If optional_directory_to_delete is set calls ossimFilename::remove on it.\n"
-              << "Options: -h --help Gives this usage.\n" << endl;
-         return 0;
-      }
-      else
-      {
-         directoryToDelete = argv[1];
-      }
-   }
-         
-   ossimFilename a  = "c:\\foo\\you";
-   ossimFilename a2 = "\\foo\\you";
-   ossimFilename b  = "/foo/you";
-   ossimFilename c  = "foo/you";
-   ossimFilename d1 = "~/docs";
-   ossimFilename d2 = "./foo";
-   ossimFilename d3 = "../../foo";
-   ossimFilename d4 = ".";
-   ossimFilename d5 = "ab";
-   ossimFilename d6 = "a";
-
-   // Environment var WORK must be set.
-   ossimFilename d7 = "$(WORK)/ossim";
-   ossimFilename d8 = "~/tmp/$(WORK)/ossim";
-   
-  ossimFilename e = "/foo/you.xxx";
-   ossimString   ext1 = ".tif";
-   ossimString   ext2 = "jpg";
-   ossimString   ext3;
-
-
-   cout << "\na:              " << a
-        << "\na.expand():     " << a.expand()
-        << "\na.isRelative(): " << a.isRelative() << "\n"
-
-        << "\na2:              " << a2
-        << "\na2.expand():     " << a2.expand()
-        << "\na2.isRelative(): " << a2.isRelative() << "\n"      
-
-        << "\nb:              " << b
-        << "\nb.expand():     " << b.expand()
-        << "\nb.isRelative(): " << b.isRelative() << "\n"
-      
-        << "\nc:              " << c
-        << "\nc.expand():     " << c.expand()
-        << "\nc.isRelative(): " << c.isRelative() << "\n"
-
-        << "\nd1:              " << d1
-        << "\nd1.expand():     " << d1.expand()
-        << "\nd1.isRelative(): " << d1.isRelative() << "\n"
-      
-        << "\nd2:              " << d2
-        << "\nd2.expand():     " << d2.expand()
-        << "\nd2.isRelative(): " << d2.isRelative() << "\n"
-
-        << "\nd3:              " << d3
-        << "\nd3.expand():     " << d3.expand()
-        << "\nd3.isRelative(): " << d3.isRelative() << "\n"
-
-        << "\nd4:              " << d4
-        << "\nd4.expand():     " << d4.expand()
-        << "\nd4.isRelative(): " << d4.isRelative() << "\n"
-
-        << "\nd5:              " << d5
-        << "\nd5.expand():     " << d5.expand()
-        << "\nd5.isRelative(): " << d5.isRelative() << "\n"
-      
-        << "\nd6:              " << d6
-        << "\nd6.expand():     " << d6.expand()
-        << "\nd6.isRelative(): " << d6.isRelative() << "\n";
-
-   cout << "\nNOTE: d7 and d8 output require variable WORK be set in your "
-        << "environment.\n"
-      
-        << "\nd7:              " << d7
-        << "\nd7.expand():     " << d7.expand()
-        << "\nd7.isRelative(): " << d7.isRelative() << "\n"
-
-        << "\nd8:              " << d8
-        << "\nd8.expand():     " << d8.expand()
-        << "\nd8.isRelative(): " << d8.isRelative() << "\n"
-      
-        << "\next1:        " << ext1
-        << "\next2:        " << ext2
-        << "\next3:        " << ext3 << "\n";
-   
-   cout << "e:                    " << e << "\n";
-   cout << "e.setExtension(ext1): " << e.setExtension(ext1) << "\n";
-   cout << "e.setExtension(ext2): " << e.setExtension(ext2) << "\n";
-   cout << "e.setExtension(ext3): " << e.setExtension(ext3) << "\n";
-
-   // Test dir cat.
-   a = "/foo/";
-   b = "you";
-   c = a.dirCat(b);
-   cout << "\na:           " << a
-        << "\nb:           " << b
-        << "\nc = a.dirCat(b): " << c << "\n";
-
-   a = "/foo";
-   b = "you";
-   c = a.dirCat(b);
-   cout << "\na:           " << a
-        << "\nb:           " << b
-        << "\nc = a.dirCat(b): " << c << "\n";
-
-   a = "/foo";
-   b = "./you";
-   c = a.dirCat(b);
-   cout << "\na:           " << a
-        << "\nb:           " << b
-        << "\nc = a.dirCat(b): " << c << "\n";
-
-   a = "/foo";
-   b = "/you";
-   c = a.dirCat(b);
-   cout << "\na:           " << a
-        << "\nb:           " << b
-        << "\nc = a.dirCat(b): " << c << "\n";
-
-   a = "/foo";
-   b = "";
-   c = a.dirCat(b);
-   cout << "\na:           " << a
-        << "\nb:           " << b
-        << "\nc = a.dirCat(b): " << c << "\n";
-
-   a = "";
-   b = "you";
-   c = a.dirCat(b);
-   cout << "\na:           " << a
-        << "\nb:           " << b
-        << "\nc = a.dirCat(b): " << c << "\n";
-
-   a = "/data/images/t1.tif";
-   cout << "\na: " << a
-        << "\na.fileNoExtension(): " << a.fileNoExtension()
-        << "\na.noExtension(): " << a.noExtension() << "\n";
-
-   // Test a file with two dots.
-   a = "/data/ascii_dems/dtm_v1.5_5mp_3141.asc";
-   cout << "\n// Test a file with two dots."
-        << "\na: " << a
-        << "\na.fileNoExtension(): " << a.fileNoExtension()
-        << "\na.noExtension(): " << a.noExtension() << "\n";
-
-   std::string s = "abc";
-   ossimFilename f = s; // Used to not compile.
-   cout << "ossimFilename f = std::string(abc): " << f << "\n";
-
-   if ( directoryToDelete.size() )
-   {
-      cout << "ossimFilename::remove on " << directoryToDelete << " was ";
-      if ( directoryToDelete.remove() )
-      {
-         cout << "successful...\n";
-      }
-      else
-      {
-         cout << "unsuccessful...\n";
-      }
-   }
-
-   cout << endl;
-   
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-foo.cpp b/ossim/src/test/ossim-foo.cpp
deleted file mode 100644
index 1a317a2..0000000
--- a/ossim/src/test/ossim-foo.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// File: ossim-foo.cpp
-//
-// Author:  David Burken
-//
-// Description: Contains application definition "ossim-foo" app.
-//
-// NOTE:  This is supplied for simple quick test. DO NOT checkin your test to
-//        the svn repository.  Simply edit ossim-foo.cpp and run your test.
-//        After completion you can do a "svn revert foo.cpp" if you want to
-//        keep your working repository up to snuff.
-//
-// $Id: ossim-foo.cpp 23002 2014-11-24 17:11:17Z dburken $
-//----------------------------------------------------------------------------
-
-// ossim includes:  These are here just to save time/typing...
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimConnectableObject.h>
-#include <ossim/base/ossimCsvFile.h>
-#include <ossim/base/ossimDate.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimIrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimKeywordNames.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimObjectFactory.h>
-#include <ossim/base/ossimObjectFactoryRegistry.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimScalarTypeLut.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTrace.h>
-#include <ossim/base/ossimVisitor.h>
-
-#include <ossim/imaging/ossimBrightnessContrastSource.h>
-#include <ossim/imaging/ossimBumpShadeTileSource.h>
-#include <ossim/imaging/ossimFilterResampler.h>
-#include <ossim/imaging/ossimFusionCombiner.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageMosaic.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimImageSource.h>
-#include <ossim/imaging/ossimImageSourceFilter.h>
-#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/imaging/ossimRectangleCutFilter.h>
-#include <ossim/imaging/ossimScalarRemapper.h>
-#include <ossim/imaging/ossimSFIMFusion.h>
-#include <ossim/imaging/ossimTwoColorView.h>
-#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
-
-#include <ossim/init/ossimInit.h>
-
-#include <ossim/projection/ossimEquDistCylProjection.h>
-#include <ossim/projection/ossimImageViewAffineTransform.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-#include <ossim/projection/ossimUtmProjection.h>
-
-#include <ossim/support_data/ossimSrcRecord.h>
-#include <ossim/support_data/ossimWkt.h>
-
-// Put your includes here:
-
-// System includes:
-#include <cmath>
-#include <sstream>
-#include <iostream>
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   int returnCode = 0;
-   
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-   
-   try
-   {
-      // Put your code here.
-   }
-   catch(const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-      returnCode = 1;
-   }
-   catch( ... )
-   {
-      ossimNotify(ossimNotifyLevel_WARN)
-         << "ossim-foo caught unhandled exception!" << std::endl;
-      returnCode = 1;
-   }
-   
-   return returnCode;
-}
diff --git a/ossim/src/test/ossim-get-pixel-test.cpp b/ossim/src/test/ossim-get-pixel-test.cpp
deleted file mode 100644
index 176d8c9..0000000
--- a/ossim/src/test/ossim-get-pixel-test.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: ossim-get-pixel-test.cpp
-//
-// Test code to spit out a pixel value at a given band, line, sample.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-get-pixel-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimProperty.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-
-#include <iostream>
-#include <vector>
-using namespace std;
-
-static void usage(ossimArgumentParser& ap)
-{
-   // Add global usage options.
-   ossimInit::instance()->addOptions(ap);
-   
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   
-   // Set app name.
-   au->setApplicationName(ap.getApplicationName());
-   
-   au->setDescription(ossimString("Returns pixel value at the given sample and line.\nNotes:\nBand, line and sample are zero based.\nUse an \"a\" for <band> if you want to see all bands.\n"));
-   
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options] <imagefile> <band> <sample> <line>\n";
-   au->setCommandLineUsage(usageString);
-   
-   au->addCommandLineOption("-e","<entry_index> Entry index to get pixel from.  Only significant with multi entry data only.");
-
-   au->addCommandLineOption("--reader-prop","Passes a name=value pair to the reader(s) for setting it's property.  Any number of these can appear on the line.");
-   
-   // Write usage.
-   au->write(ossimNotify(ossimNotifyLevel_INFO));
-}
-
-struct readerProp
-{
-   ossimString name;
-   ossimString value;
-};
-
-/**
- * @brief Adds band to bandList returning true on success, false on range error
- * with error message to standard out.
- */
-static bool addBand( ossim_uint32 band,
-                     ossim_uint32 bandCount,
-                     vector<ossim_uint32>& bandList );
-
-int main(int argc, char *argv[])
-{
-   // Initialize:
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-
-   // Argument check:
-   if ( (ap.argc() < 5) || ap.read("-h") || ap.read("--help") )
-   {
-      usage(ap);
-      return 1;
-   }
-
-   // Read options:
-   
-   // For argument parser reads.
-   ossimString ts1;
-   ossimArgumentParser::ossimParameter sp1(ts1);
-
-   // Entry index:
-   ossim_uint32 entryIndex = 0;
-   if ( ap.read("-e", sp1) )
-   {
-      entryIndex = ts1.toUInt32();
-   }
-
-   // Set the reader properties if any.
-   std::vector<readerProp> readerProps;
-   while(ap.read("--reader-prop", sp1))
-   {
-      std::vector<ossimString> splitArray;
-      ts1.split(splitArray, "=");
-      if(splitArray.size() == 2)
-      {
-         readerProp prop;
-         prop.name = splitArray[0];
-         prop.value = splitArray[1];
-         readerProps.push_back(prop);
-      }
-   }
-
-   ap.reportRemainingOptionsAsUnrecognized();
-
-   // Check the input file:
-   ossimFilename imageFile = argv[1];
-   if ( !imageFile.exists() )
-   {
-      usage(ap);
-      return 1;
-   }
-
-   // Open up an image handler.
-   ossimRefPtr<ossimImageHandler> ih
-      = (ossimImageHandler*)ossimImageHandlerRegistry::instance()->open( imageFile );
-   if ( ih.valid() == false )
-   {
-      cerr << "Could not open: " << imageFile << endl;
-      return 1;
-   }
-
-   if ( entryIndex )
-   {
-      if ( ih->setCurrentEntry( entryIndex ) == false )
-      {
-         cerr << "Invalid entry: " << entryIndex << endl;
-         return 1;
-      }
-   }
-   
-   // Set the reader properties if any.
-   if ( readerProps.size() )
-   {
-      std::vector<readerProp>::const_iterator i = readerProps.begin();
-      while( i != readerProps.end() )
-      {
-         ossimRefPtr<ossimProperty> prop = new ossimStringProperty( (*i).name, (*i).value );
-         ih->setProperty(prop);
-         ++i;
-      }
-   }
-
-   vector<ossim_uint32> bandList;
-   ossimString bandString = argv[2];
-
-   const ossim_uint32 BANDS = ih->getNumberOfOutputBands();
-   if ( bandString.downcase() == "a" )
-   {
-      for ( ossim_uint32 band = 0; band < BANDS; ++band)
-      {
-         if ( addBand( band, BANDS, bandList ) == false )
-         {
-            return 1;
-         }
-      }
-   }
-   else
-   {
-      ossim_int32 band = bandString.toUInt32();
-      if ( addBand( band, BANDS, bandList ) == false )
-      {
-         return 1;
-      }
-   }
-      
-   ossimIpt pt;
-   pt.x = ossimString::toInt32(argv[3]);
-   pt.y = ossimString::toInt32(argv[4]);
-   
-   ossimIrect rect(pt.x, pt.y, pt.x+1, pt.y+1);
-   ossimRefPtr<ossimImageData> id = ih->getTile(rect, 0);
-
-   if ( id.valid() )
-   {
-      cout << "image_file: " << imageFile
-           << "\nsample:     " << pt.x
-           << "\nline:       " << pt.y;
-
-      vector<ossim_uint32>::const_iterator i = bandList.begin();
-      while ( i != bandList.end() )
-      {
-         cout << "\nvalue[" << (*i) << "]: " << id->getPix( pt, (*i) );
-         ++i;
-      }
-      cout << endl;
-   }
-   else
-   {
-      cerr << "getTile request failed!" << endl;
-      return 1;
-   }
-   
-   return 0;
-}
-
-bool addBand( ossim_uint32 band, ossim_uint32 bandCount, vector<ossim_uint32>& bandList )
-{
-   bool result = true;
-   if ( band < bandCount )
-   {
-      bandList.push_back(band);
-   }
-   else
-   {
-      cerr << "Band number " << band << " is out of range!" << endl;
-      result = false;
-   }
-   return result;
-}
-
diff --git a/ossim/src/test/ossim-gpkg-writer-test.cpp b/ossim/src/test/ossim-gpkg-writer-test.cpp
deleted file mode 100644
index 365d4d1..0000000
--- a/ossim/src/test/ossim-gpkg-writer-test.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// File: ossim-gpkg-writer-test.cpp
-//
-// Description: Test class for ossimGpkgWriter.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/imaging/ossimGpkgWriterInterface.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/imaging/ossimU8ImageData.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-
-#include <iomanip>
-#include <iostream>
-#include <string>
-using namespace std;
-
-int main(int argc, char* argv[])
-{
-   int status = 0;
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc == 2 )
-   {
-      ossimFilename outputFile = argv[1];
-      
-      ossimString writerClass = "ossimGpkgWriter";
-      ossimRefPtr<ossimImageFileWriter> writer =
-         ossimImageWriterFactoryRegistry::instance()->createWriter( writerClass );
-
-      if ( writer.valid() )
-      {
-         ossimGpkgWriterInterface* gpkgWriter =
-            dynamic_cast<ossimGpkgWriterInterface*>( writer.get() );
-
-         if ( gpkgWriter )
-         {
-            ossimKeywordlist kwl;
-            std::string key;
-            std::string value;
-            
-            key = "zoom_levels";
-            // value = "(0,1,2,3,4,5,6,7,8,9,10,11)";
-            value = "(2,3,4,5)";
-            kwl.addPair( key, value );
-            
-            key = "epsg";
-            value = "3857";
-            kwl.addPair( key, value );
-            
-            key = "filename";
-            value = outputFile.string();
-            kwl.addPair( key, value );
-
-            if ( gpkgWriter->openFile( kwl ) )
-            {
-               gpkgWriter->beginTileProcessing();
-               
-               // Write some tiles:
-               ossimRefPtr<ossimImageData> id = new ossimU8ImageData(0, 3, 256, 256);
-               id->initialize();
-               id->createTestTile();
-
-               // Valid tile:
-               if ( gpkgWriter->writeTile( id, 2, 0, 0 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 2, 0, 0 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 2, 0, 0 failed..." << endl;
-               }
-               
-               if ( gpkgWriter->writeTile( id, 2, 0, 1 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 2, 0, 1 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 2, 0, 1 failed..." << endl;
-               }
-               
-               if ( gpkgWriter->writeTile( id, 2, 1, 0 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 2, 1, 0 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 2, 1, 0 failed..." << endl;
-               }
-
-               if ( gpkgWriter->writeTile( id, 2, 1, 1 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 2, 1, 1 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 2, 1, 1 failed..." << endl;
-               }
-
-               if ( gpkgWriter->writeTile( id, 3, 0, 0 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 3, 0, 0 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 3, 0, 0 failed..." << endl;
-               }
-               
-               if ( gpkgWriter->writeTile( id, 4, 0, 0 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 4, 0, 0 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 4, 0, 0 failed..." << endl;
-               }
-
-               if ( gpkgWriter->writeTile( id, 5, 0, 0 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 5, 0, 0 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 5, 0, 0 failed..." << endl;
-               }
-               // Invalid level
-               if ( gpkgWriter->writeTile( id, 20, 0, 0 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 20, 0, 0 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 20, 0, 0 failed..." << endl;
-               }
-
-               // Invalid row
-               if ( gpkgWriter->writeTile( id, 4, 10000, 0 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 4, 10000, 0success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 4, 10000, 0 failed..." << endl;
-               }
-
-               // Invalid col
-               if ( gpkgWriter->writeTile( id, 4, 0, 10000 ) ) // tile, level, row, col
-               {
-                  cout << "writeTile id, 4, 0, 10000 success..." << endl;
-               }
-               else
-               {
-                  cout << "writeTile id, 4, 0, 10000 failed..." << endl;
-               }
-
-               gpkgWriter->finalizeTileProcessing();
-
-               // Close this writer and test append mode:
-               writer->close();
-               gpkgWriter = 0;
-               writer = 0; // ref ptr
-
-               cout << "Testing append mode..." << endl;
-               
-               writer = ossimImageWriterFactoryRegistry::instance()->createWriter( writerClass );
-               if ( writer.valid() )
-               {
-                  ossimGpkgWriterInterface* gpkgWriter =
-                     dynamic_cast<ossimGpkgWriterInterface*>( writer.get() );
-                  
-                  if ( gpkgWriter )
-                  {
-                     // Add append to options:
-                     key = "append";
-                     value = "true";
-                     kwl.addPair( key, value );
-
-                     if ( gpkgWriter->openFile( kwl ) )
-                     {
-                        gpkgWriter->beginTileProcessing();
-                        
-                        if ( gpkgWriter->writeTile( id, 3, 0, 1 ) ) // tile, level, row, col
-                        {
-                           cout << "writeTile id, 3, 0, 1 success..." << endl;
-                        }
-                        else
-                        {
-                           cout << "writeTile id, 3, 0, 1 failed..." << endl;
-                        }
-                     }
-
-                     gpkgWriter->finalizeTileProcessing();
-                     
-                     writer->close();
-                     gpkgWriter = 0;
-                  }
-                  writer = 0;
-               }
-            }
-         }
-         else
-         {
-            cerr << "Could not cast!" << endl;
-         }
-         
-         writer = 0;
-      }
-      else // Matches: 
-      {
-         cerr << "ossimImageWriterFactoryRegistry::instance()->createWriter( ossimGpkgWriter ) failed!" << endl;
-      }
-   }
-   else // Matches: if (argc == 2 ){ ... }
-   {
-      cout << argv[0] << " <output_file>"
-           << "\n\nGeoPackage writer test code.\n" << endl;
-   }
-
-   return status;
-}
-
diff --git a/ossim/src/test/ossim-gpt-test.cpp b/ossim/src/test/ossim-gpt-test.cpp
deleted file mode 100644
index 274a094..0000000
--- a/ossim/src/test/ossim-gpt-test.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test code for ossimGpt class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-gpt-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimGpt.h>
-#include <ossim/init/ossimInit.h>
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   cout << "ossimGpt::wrap test:\n";
-   
-   ossimGpt gpt(0.0, 0.0, 0.0);
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 45.0;
-   gpt.lon = 45.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-   
-   gpt.lat = 90.0;
-   gpt.lon = 180.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 91.0;
-   gpt.lon = 181.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 179.0;
-   gpt.lon = 359.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 181.0;
-   gpt.lon = 361.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 271.0;
-   gpt.lon = 361.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 359.0;
-   gpt.lon = 361.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 361.0;
-   gpt.lon = 721.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = 451.0;
-   gpt.lon = 901.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -45.0;
-   gpt.lon = -45.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-   
-   gpt.lat = -90.0;
-   gpt.lon = -180.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -91.0;
-   gpt.lon = -181.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -179.0;
-   gpt.lon = -359.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -181.0;
-   gpt.lon = -361.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -271.0;
-   gpt.lon = -361.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -359.0;
-   gpt.lon = -361.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -361.0;
-   gpt.lon = -721.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   gpt.lat = -451.0;
-   gpt.lon = -901.0;
-   cout << "gpt: " << gpt << "\n";
-   gpt.wrap();
-   cout << "gpt::wrap: " << gpt << "\n\n";
-
-   
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-gsd-test.cpp b/ossim/src/test/ossim-gsd-test.cpp
deleted file mode 100644
index fa05dcf..0000000
--- a/ossim/src/test/ossim-gsd-test.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-gsd-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test to output gsd from image geometry and then compute the gsd from center
-// latitude of the image if the projecion is geographic, i.e. scale is in
-// decimal degrees.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-gsd-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-
-#include <iostream>
-using namespace std;
-
-static void usage()
-{
-   cout << "ossim-gsd-test <imagefile>"
-        << "\nThis will compute meters per pixel from the center latitude if the\n"
-        << "underlying projection scale units are in degrees." << endl;
-}
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 2)
-   {
-      usage();
-      return 0;
-   }
-
-   ossimFilename imageFile = argv[argc - 1];
-
-   if ( !imageFile.exists() )
-   {
-      usage();
-      return 1;
-   }
-
-   // Open up an image handler.
-   ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(
-      ossimFilename(argv[argc - 1]));
-   if ( ih.valid() == false )
-   {
-      cerr << "Could not open: " << imageFile << endl;
-      return 1;
-   }
-   
-   cout << "image_file:  " << imageFile << "\n";
-   
-   ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-   if ( geom.valid() )
-   {
-      ossimDpt imageGeomGsd = geom->getMetersPerPixel();
-      cout << "image_geometry_meters_per_pixel: " << imageGeomGsd << "\n";
-
-      ossimDrect rect = ih->getImageRectangle(0);
-      ossimKeywordlist kwl;
-      geom->saveState(kwl);
-      ossimDpt ipt = rect.midPoint();
-      cout << "center_image_point: " << ipt << "\n";
-      ossimGpt wpt;
-      geom->localToWorld(ipt, wpt);
-      cout << "center_world_point: " << wpt << "\n";
-
-      ossimDpt scale;
-      bool scaleDegrees = false;
-      const char* lookup = kwl.find("projection.pixel_scale_xy");
-      if ( lookup )
-      {
-         ossimString s = lookup;
-         scale.toPoint(s);
-         cout << "projection.pixel_scale_xy: " << scale << "\n";
-         const char* lookup = kwl.find("projection.pixel_scale_units");
-         if ( lookup )
-         {
-            s = lookup;
-            scaleDegrees = (s == "degrees");
-            cout << "projection.scale_units: " << s << "\n";
-         }
-
-         if ( scaleDegrees )
-         {
-            ossimDpt mpd = wpt.metersPerDegree();
-            cout << "meters_per_degree_for_center: " << mpd << "\n";
-            ossimDpt computeGsd;
-            computeGsd.x = mpd.x * scale.x;
-            computeGsd.y = mpd.y * scale.y;
-            cout << "computed_meters_per_pixel_for_center_lat: " << computeGsd << "\n";
-         }
-      }
-   }
-   else
-   {
-      cout << "null geometry!\n";
-   }
-
-   cout << endl;
-   return 0;
-}
-
-
diff --git a/ossim/src/test/ossim-image-chain-test.cpp b/ossim/src/test/ossim-image-chain-test.cpp
deleted file mode 100644
index 9d0bf16..0000000
--- a/ossim/src/test/ossim-image-chain-test.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-image-chain-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test application for ossimImageChain class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-image-chain-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageChain.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-
-#include <iostream>
-using namespace std;
-
-static void usage()
-{
-   cout << "ossim-image-chain-test <image>" << endl;
-}
-
-int main(int argc, char *argv[])
-{
-   int result = 0;
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc == 2)
-   {
-      try // In case exceptions is thrown. 
-      {
-         ossimFilename image = argv[1];
-         ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(image);
-         if ( ih.valid() )
-         {
-            cout << "Opened image: " << image << endl;
-
-            ossimRefPtr<ossimImageChain> ic = new ossimImageChain();
-            ic->addLast( ih.get() );
-            cout << "Added to image chain via ossimImageChain::addLast" << endl;
-
-            cout << "Calling ossimImageChain::removeChild" << endl;
-
-            if ( ic->removeChild( ih.get() ) )
-            {
-               cout << "Removed from chain..." << endl;
-               ih = 0;
-            }
-
-            ic = 0;
-         }
-         else
-         {
-            cout << "Could not open: " << image << endl;
-            result = 1;
-         }
-      }
-      catch( const ossimException& e )
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         result = 1;
-      }
-   }
-   else
-   {
-      usage();
-   }
-
-   return result;
-}
-
diff --git a/ossim/src/test/ossim-image-elevation-test.cpp b/ossim/src/test/ossim-image-elevation-test.cpp
deleted file mode 100644
index 71b2153..0000000
--- a/ossim/src/test/ossim-image-elevation-test.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-tiled-elevation-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test application for ossimImageElevationDatabase class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-image-elevation-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/elevation/ossimImageElevationDatabase.h>
-
-#include <iomanip>
-#include <iostream>
-using namespace std;
-
-static void usage()
-{
-   cout << "ossim-image-elevation-test <elev-dir>"
-        << "\nCreates a ossimImageElevationDatabase from elev-dir." << endl;
-}
-
-int main(int argc, char *argv[])
-{
-   int result = 0;
-
-   ossimTimer::instance()->setStartTick();
-
-   // Turn off elevation initialization as we want to use ours.
-   ossimInit::instance()->setElevEnabledFlag(false);
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   cout << std::setiosflags(ios::fixed) << std::setprecision(3)
-        << "elapsed time after initialize: "
-        << ossimTimer::instance()->time_s() << "\n";
-   
-   if (argc == 2)
-   {
-      try // Exceptions can be thrown so 
-      {
-         ossimString elevDir = argv[1];
-         
-         cout << "elev-dir: " << elevDir << "\n";
-         
-         ossimImageElevationDatabase* elevdb = new ossimImageElevationDatabase();
-         if ( elevdb->open(elevDir) )
-         {
-            std::vector<ossimGpt> pts(10);
-            
-            pts[0] = ossimGpt(3.5, -67.5);
-            pts[1] = ossimGpt(7.5, -79.5);
-            pts[2] = ossimGpt(35.694166666666668, 51.598333333333336);
-            pts[3] = ossimGpt(35.821992089329882, 51.437673634967858);
-            pts[4] = ossimGpt(35.843333333333334, 51.373333333333335);
-            pts[5] = ossimGpt(3.25, -67.25);
-            pts[6] = ossimGpt(7.5, -79.5);
-            pts[7] = ossimGpt(35.821992089329882, 51.437673634967858);
-            pts[8] = ossimGpt(7, -80);
-            pts[9] = ossimGpt(7.9, -79.1);
-            std::vector<ossimGpt>::iterator i = pts.begin();
-
-            while ( i != pts.end() )
-            {
-               cout << "getHeightAboveEllipsoid(" << (*i) << "): " 
-                    << elevdb->getHeightAboveEllipsoid( (*i) ) << endl;
-               ++i;
-            }
-         }
-         else
-         {
-            cout << "Could not open: " << elevDir << endl;
-         }
-      }
-      catch( const ossimException& e )
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         result = 1;
-      }
-   }
-   else
-   {
-      usage();
-   }
-   return result;
-}
-
-
diff --git a/ossim/src/test/ossim-image-geometry-test.cpp b/ossim/src/test/ossim-image-geometry-test.cpp
deleted file mode 100644
index 644f210..0000000
--- a/ossim/src/test/ossim-image-geometry-test.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test app for image geometries.  Prints out projection keyword
-// list.  Performs lineSampleToWorld, worldToLineSample, lineSampleToWorld
-// round trip dumping points and delta on image points.  Dumps elevation cells
-// used.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-image-geometry-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <iomanip>
-#include <string>
-#include <sstream>
-#include <ctime>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/projection/ossimMapProjection.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimProjectionFactoryRegistry.h>
-
-// Points in one direction.  If 5, will get 5X5 or 25.
-static const ossim_int32 POINTS = 5; 
-
-static std::string getDate()
-{
-// Get the build date in the format of (yyyymmdd).
-   char s[9];
-   s[8] = '\0';
-   time_t t;
-   time(&t);
-   tm* lt = localtime(&t);
-   strftime(s, 9, "%Y%m%d", lt);
-   std::string date = s;
-   return date;
-}
-
-static void usage()
-{
-   cout << "ossimGeometryTest <imagefile>"
-        << "\nTest image geometry." << endl;
-}
-
-static const ossim_uint32 W = 14;
-
-static void print(const std::string& prefix,
-                  const ossimDpt& ipt,
-                  const ossimGpt& wpt,
-                  const ossimDpt& rpt)
-{
-   ossimDpt delta = ipt - rpt;
-   ossim_uint32 w =
-      (prefix.size() < W) ? (W - prefix.size()) : prefix.size();
-                                                     
-   cout << std::setfill(' ') << setiosflags(ios::left) 
-        << prefix << std::setw(w) << "ipt:" << ipt.toString().c_str() << "\n"
-        << prefix << std::setw(w) << "wpt:" << wpt.toString().c_str() << "\n"
-        << prefix << std::setw(w) << "rpt:" << rpt.toString().c_str() << "\n"
-        << prefix << std::setw(w) << "delta:" << delta.toString() << "\n\n";
-}
-
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 2)
-   {
-      usage();
-      return 0;
-   }
-
-   ossimFilename imageFile = argv[argc - 1];
-
-   if ( !imageFile.exists() )
-   {
-      usage();
-      return 1;
-   }
-
-   // Open up an image handler.
-   ossimRefPtr<ossimImageHandler> ih
-      = (ossimImageHandler*)ossimImageHandlerRegistry::instance()->open(
-         ossimFilename(argv[argc - 1]));
-   if ( !ih )
-   {
-      cerr << "Could not open: " << imageFile << endl;
-      return 1;
-   }
-
-   cout << "image_file:  " << imageFile << "\n";
-
-   // cout << "date_yyyymmdd: " << getDate().c_str() << "\n"; 
-   
-   // Get the entry list:
-   std::vector<ossim_uint32> entryList;
-   ih->getEntryList(entryList);
-   
-   std::vector<ossim_uint32>::const_iterator entry = entryList.begin();
-   while ( entry != entryList.end() )
-   {
-      cout << "entry_index:  " << (*entry) << "\n";
-      ih->setCurrentEntry( (*entry) );
-
-      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-
-      if ( geom.valid() )
-      {
-#if 1    /* Comment out to disable elevation for map projections. */
-         ossimRefPtr<ossimProjection> proj = geom->getProjection();
-         if (proj.valid() )
-         {
-            ossimRefPtr<ossimMapProjection> mp = PTR_CAST(ossimMapProjection, proj.get());
-            if (mp.valid())
-            {
-               cout << "setting elev lookup flag..." << endl;
-               mp->setElevationLookupFlag(true);
-            }
-         }
-#endif
-         ossimKeywordlist kwl;
-         geom->saveState(kwl, 0);
-         cout << kwl << "\n";
-
-         ossimDrect rect = ih->getImageRectangle(0);
-
-         cout << "image_rect: " << rect << "\n\n";
-
-         // Do forward, inverse, forward on corners and center.
-
-         std::string prefix;
-         ossimDpt ipt;  // image point
-         ossimDpt rpt;  // round trip image point
-         ossimGpt wpt;  // world point
-
-         // Upper left:
-         prefix = "ul.";
-         ipt = rect.ul();
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // Upper right:
-         prefix = "ur.";
-         ipt = rect.ur();
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // Lower right:
-         prefix = "lr.";
-         ipt = rect.lr();
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // Lower left:
-         prefix = "ll.";
-         ipt = rect.ll();
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // center:
-         prefix = "center.";
-         ipt = rect.midPoint();
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         geom->setTargetRrds(2);
-         cout << "geometry target rrds set to: " << geom->getTargetRrds() << "\n\n";
-         
-         // Upper left:
-         prefix = "ul-r2.";
-         geom->rnToRn(rect.ul(), 0, 2, ipt);
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // Upper right:
-         prefix = "ur-r2.";
-         geom->rnToRn(rect.ur(), 0, 2, ipt);
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // Lower right:
-         prefix = "lr-r2.";
-         geom->rnToRn(rect.lr(), 0, 2, ipt);
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // Lower left:
-         prefix = "ll-r2.";
-         ipt = rect.ll();
-         geom->rnToRn(rect.ll(), 0, 2, ipt);
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // center:
-         prefix = "center-r2.";
-         ipt = rect.midPoint();
-         geom->rnToRn(ipt, 0, 2, ipt);
-         geom->localToWorld(ipt, wpt);
-         geom->worldToLocal(wpt, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         // Test rnToWorld and world to rn:
-         cout << "testing rnToWorld and worldToRn:\n\n";
-         prefix = "center-r3.";
-         ipt = rect.midPoint();
-         geom->rnToRn(ipt, 0, 3, ipt);
-         geom->rnToWorld(ipt, 3, wpt);
-         geom->worldToRn(wpt, 3, rpt);
-         print(prefix, ipt, wpt, rpt);
-
-         geom->setTargetRrds(0);
-         cout << "geometry target rrds set to: " << geom->getTargetRrds() << "\n\n";
-
-         prefix = "center-r3.";
-         ipt = rect.midPoint();
-         geom->rnToRn(ipt, 0, 3, ipt);
-         geom->rnToWorld(ipt, 3, wpt);
-         geom->worldToRn(wpt, 3, rpt);
-         print(prefix, ipt, wpt, rpt);
-         
-
-         ossim_int32 tenthW  = rect.width()  / POINTS;
-         ossim_int32 tenthH  = rect.height() / POINTS;
-         ossim_int32 offW    = tenthW / 2;
-         ossim_int32 offH    = tenthH / 2;
-         ossimIpt    ul      = rect.ul();
-         ossimIpt    lr      = rect.lr();
-         ossim_int32 ptIndex = 0;
-
-         // Line loop:
-         for (ossim_int32 y = ul.y+offH; y < lr.y; y += tenthH)
-         {
-            ipt.y = y;
-            
-            // Sample loop:
-            for (ossim_int32 x = ul.x+offW; x < lr.x; x += tenthW)
-            {
-               ipt.x = x;
-
-               std::ostringstream s;
-               s << std::setfill('0') << setiosflags(ios::right) 
-                 << "pt" << std::setw(3) << ptIndex << ".";
-               prefix = s.str();
-               geom->localToWorld(ipt, wpt);
-               geom->worldToLocal(wpt, rpt);
-               print(s.str(), ipt, wpt, rpt);
-
-               ++ptIndex;
-            }
-         }
-
-      } // matches: if ( proj.valid() )
-
-      // Test the decimationFactors method.
-      ossim_uint32 level;
-      std::vector<ossimDpt> decimations;
-      geom->decimationFactors(decimations);
-      
-      for (level = 0; level < decimations.size(); ++level)
-      {
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "decimation[" << level << "]: " << decimations[level]
-            << std::endl;
-      }
-
-      bool isAffectedByElevation = geom->isAffectedByElevation();
-      ossimNotify(ossimNotifyLevel_DEBUG)
-         << "\nImage projection " << ( isAffectedByElevation ? "is" : "isn't")
-         << " affected by elevation." << std::endl;
-      
-      // Test up is code:
-      if ( isAffectedByElevation )
-      {
-         ossim_float64 upIsUpAngle = geom->upIsUpAngle();
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "\nUp is up rotation angle: " << upIsUpAngle << "\n" << std::endl;
-      }
-      
-#if 0 /* commented out as one time test is good */
-      
-      // Test the decimationFactor method.
-      ossimDpt decimation;
-      geom->decimationFactors(decimations);
-      ossim_float64 r0_lines = ih->getNumberOfLines(0);
-      ossim_float64 r0_samps = ih->getNumberOfSamples(0);
-      
-      for (level = 0; level < geom->getNumberOfDecimations(); ++level)
-      {
-         geom->decimationFactor(level, decimation);
-         ossimNotify(ossimNotifyLevel_DEBUG)
-            << "decimation[" << level << "]:          " << decimation
-            << "\nlines[" << level << "]:             " << ih->getNumberOfLines(level)
-            << "\nsamples[" << level << "]:           " << ih->getNumberOfSamples(level)
-            << "\ncomputed lines[" << level << "]:    " << (r0_lines * decimation.y)
-            << "\ncomputed samples[" << level << "]:  " << (r0_samps * decimation.x)
-            << std::endl;
-      }
-#endif
-      
-      ++entry; // Go to next entry.
-      
-   } // matches: while ( entry != entryList.end() )
-
-#if 0
-   // Dump the elevation cells used:
-   std::vector<ossimFilename> cells;
-   ossimElevManager::instance()->getOpenCellList(cells);
-
-   for (ossim_uint32 cellIndex = 0; cellIndex < cells.size(); ++cellIndex)
-   {
-      std::ostringstream s;
-      s << std::setfill('0')
-        << "cell" << std::setw(3) << cellIndex << ": ";
-
-      cout << std::setfill(' ') << setiosflags(ios::left) << std::setw(W)
-           << s.str().c_str() << cells[cellIndex] << "\n";
-   }
-
-   cout << endl;
-#endif
-   return 0;
-}
-
-
diff --git a/ossim/src/test/ossim-index-to-rgb-lut-test.cpp b/ossim/src/test/ossim-index-to-rgb-lut-test.cpp
deleted file mode 100644
index a18dd5f..0000000
--- a/ossim/src/test/ossim-index-to-rgb-lut-test.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Author:  Oscar Kramer
-//
-// Description: Test of ossimIndexToRgbLutFilter.
-//
-// $Id: ossim-index-to-rgb-lut-test.cpp 23068 2015-01-07 23:08:29Z okramer $
-//----------------------------------------------------------------------------
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>  // ossim contants...
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/imaging/ossimMemoryImageSource.h>
-#include <ossim/imaging/ossimImageDataFactory.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-
-static const std::string kwl_literal =
-      "type: ossimIndexToRgbLutFilter \n"
-      "mode: literal  \n"
-      "entry0.index: 0 \n"
-      "entry0.color: 1 2 3 \n"
-      "entry1.index: 1.0 \n"
-      "entry1.color: 255 1 1 \n"
-      "entry2.index: 2.0 \n"
-      "entry2.color: 1 255 1 \n";
-
-static const std::string kwl_vertices =
-      "type: ossimIndexToRgbLutFilter \n"
-      "mode: vertices  \n"
-      "entry0.index: 0.5 \n"
-      "entry0.color: 1 2 3 \n"
-      "entry1.index: 127.5 \n"
-      "entry1.color: 255 1 1 \n"
-      "entry2.index: 250.0 \n"
-      "entry2.color: 1 255 1 \n";
-
-static const std::string kwl_regular =
-      "type: ossimIndexToRgbLutFilter \n"
-      "mode: regular \n"
-      "entry0: 1 1 255 \n"
-      "entry1: 1 255 1 \n"
-      "entry2: 255 1 1 \n"
-      "max_value:  250 \n"
-      "min_value:  1 \n";
-
-static const std::string kwl_regular2 =
-      "type: ossimIndexToRgbLutFilter \n"
-      "mode: regular \n"
-      "entry0.r: 1 \n"
-      "entry0.g: 1 \n"
-      "entry0.b: 255 \n"
-      "entry1.r: 1 \n"
-      "entry1.g: 255 \n"
-      "entry1.b: 1 \n"
-      "entry2.r: 255 \n"
-      "entry2.g: 1 \n"
-      "entry2.b: 1 \n"
-      "max_value:  250 \n"
-      "min_value:  1 \n";
-
-static const std::string kwl_regnorm =
-      "type: ossimIndexToRgbLutFilter \n"
-      "mode: regular \n"
-      "entry0: 1 1 255 \n"
-      "entry1: 1 255 1 \n"
-      "entry2: 255 1 1 \n"
-      "max_value:  1.0 \n"
-      "min_value:  0 \n";
-
-
-bool runTest(const std::string& kwlString, ossimRefPtr<ossimImageSourceFilter>& lutFilter)
-{
-   ossimKeywordlist kwl;
-   kwl.parseString(kwlString);
-   if (!lutFilter->loadState(kwl))
-   {
-      cout << "ERROR: bad state returned from ossimIndexToRgbLutFilter::loadState()" << endl;
-      return false;
-   }
-
-   ossimKeywordlist savedKwl;
-   lutFilter->saveState(savedKwl);
-   cout << savedKwl << endl;
-
-   lutFilter->initialize();
-   ossimIrect rect (lutFilter->getBoundingRect());
-   ossimRefPtr<ossimImageData> rgbBuffer = lutFilter->getTile(rect);
-
-   ossim_uint8* outBuf[3];
-   outBuf[0] = (ossim_uint8*)(rgbBuffer->getBuf(0));
-   outBuf[1] = (ossim_uint8*)(rgbBuffer->getBuf(1));
-   outBuf[2] = (ossim_uint8*)(rgbBuffer->getBuf(2));
-   for (int x=0; x<256; ++x)
-   {
-      cout << "[" <<  x  << "] : " << (int)outBuf[0][x] << "  " << (int)outBuf[1][x] << "  "
-            << (int)outBuf[2][x] << endl;
-   }
-   cout << endl;
-
-   return true;
-}
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   // For batch testing, permit assigning output dir for test tiff:
-   ossimFilename tiffOutFile ("./test-tif.tif");
-   if (argc > 1)
-      tiffOutFile = argv[1];
-
-   // Initialize the input index buffer:
-   ossimRefPtr<ossimImageData> indexBuffer =
-         ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, 256, 1);
-   if(!indexBuffer.valid())
-      return -1;
-   indexBuffer->initialize();
-   for (int x=0; x<256; ++x)
-      indexBuffer->setValue(x, 0, x);
-   indexBuffer->validate();
-
-   // Create output image chain:
-   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
-   memSource->setImage(indexBuffer);
-   memSource->setRect(0, 0, 256, 1);
-   ossimRefPtr<ossimImageSourceFilter> lutFilter = new ossimIndexToRgbLutFilter();
-   lutFilter->connectMyInputTo(memSource.get());
-   bool success;
-
-   // Test 1: LITERAL mode
-   cout << "\nTEST 1 -- Running LITERAL mode test...\n"<<endl;
-   if (!runTest(kwl_literal, lutFilter))
-      return -1;
-
-   // Test 2: VERTICES mode
-   cout << "\nTEST 2 -- Running VERTICES mode test...\n"<<endl;
-   if (!runTest(kwl_vertices, lutFilter))
-      return -1;
-
-   // Test 3: REGULAR mode, compact-format
-   cout << "\nTEST 3 -- Running REGULAR mode, compact-format test...\n"<<endl;
-   if (!runTest(kwl_regular, lutFilter))
-      return -1;
-
-   // Test 4: REGULAR mode, bloated-format
-   cout << "\nTEST 4 -- Running REGULAR mode, bloated-format test...\n"<<endl;
-   if (!runTest(kwl_regular2, lutFilter))
-      return -1;
-
-   // Test 5: Heat map tile output using type double input index:
-   cout << "\nTEST 5 --Output of heatmap tile from floating point normalized index data...\n"<<endl;
-   indexBuffer = ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT64, 1, 512, 512);
-   indexBuffer->initialize();
-   for (int y=0; y<512; ++y)
-   {
-      for (int x=0; x<512; ++x)
-      {
-         double distance = sqrt((double) ((x-256)*(x-256) + (y-256)*(y-256)));
-         double d = (256.0 - distance) / 256.0;
-         if (d <= 0)
-            d = 0.0;
-         indexBuffer->setValue(x, y, d);
-      }
-   }
-   indexBuffer->validate();
-
-   ossimRefPtr<ossimMemoryImageSource> idxSource = new ossimMemoryImageSource;
-   idxSource->setImage(indexBuffer);
-
-   ossimRefPtr<ossimImageSourceFilter> lut2Filter = new ossimIndexToRgbLutFilter();
-   lut2Filter->connectMyInputTo(idxSource.get());
-   ossimKeywordlist kwl;
-   kwl.parseString(kwl_regnorm);
-   lut2Filter->loadState(kwl);
-   lut2Filter->initialize();
-   ossimIrect rect (lut2Filter->getBoundingRect());
-
-   ossimRefPtr<ossimImageData> rgbBuffer = lut2Filter->getTile(rect);
-
-   ossimRefPtr<ossimMemoryImageSource> rgbSource = new ossimMemoryImageSource;
-   rgbSource->setImage(rgbBuffer);
-   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter;
-   writer->setFilename(tiffOutFile);
-   writer->connectMyInputTo(0, rgbSource.get());
-   writer->setAreaOfInterest(rect);
-   writer->setGeotiffFlag(false);
-   success = writer->execute();
-   if (success)
-      cout << "Heat map image successfully written."<<endl;
-   else
-      return -1;
-
-   return 0;
-}
diff --git a/ossim/src/test/ossim-info-test.cpp b/ossim/src/test/ossim-info-test.cpp
deleted file mode 100644
index bfe14c2..0000000
--- a/ossim/src/test/ossim-info-test.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application for ossimInfo class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-info-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/util/ossimInfo.h>
-
-#include <iostream>
-using namespace std;
-
-int main(int argc, char *argv[])
-{
-   //---
-   // Get the arg count so we can tell if an arg was consumed by
-   // ossimInit::instance()->initialize
-   //---
-   // int originalArgCount = argc;
-
-   ossimArgumentParser ap(&argc, argv);
-
-   // Initialize ossim stuff, factories, plugin, etc.
-   ossimInit::instance()->initialize(ap);
-
-   if ( ap.argc() == 2 )
-   {
-      try
-      {
-         // Test the ossimInfo::getImageInfo method.
-         ossimRefPtr<ossimInfo> oi = new ossimInfo;
-         ossimFilename file(argv[1]);
-         ossimKeywordlist kwl;
-         oi->getImageInfo(file,
-                          true,  // dump
-                          false, // dno
-                          true,  // image geom
-                          true,  // image info
-                          true,  // metadata
-                          true,  // palette
-                          kwl);
-         cout << kwl << endl;
-      }
-      catch (const ossimException& e)
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         return 1;
-      }
-      
-   }  // End: if ( ( ap.argc() == 2 ) ...
-   else
-   {
-      cout << argv[0] << " <image_file>\nTest ossimInfo class..." << endl;
-   }
-   
-   return 0;
-   
-} // End of main...
-
diff --git a/ossim/src/test/ossim-keywordlist-test.cpp b/ossim/src/test/ossim-keywordlist-test.cpp
deleted file mode 100644
index 5e5ff4c..0000000
--- a/ossim/src/test/ossim-keywordlist-test.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-#include <iostream>
-#include <fstream>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimTempFilename.h>
-
-
-void runTestForFileVariations()
-{
-   std::cout << "------------------ Running tests on different file variations ---------------- \n";
-   
-   ossimTempFilename tempFile(".", "temp","txt",true,false);
-   tempFile.generateRandomFile();
-   
-   {
-      
-      std::ofstream out(tempFile.c_str());
-      
-      out<< "";
-      out.close();
-      
-      ossimKeywordlist kwl;
-      std::cout << "Empty File Test? ";
-      if(kwl.addFile(tempFile))
-      {
-         std::cout << "passed" << std::endl;
-      }
-      else 
-      {
-         std::cout << "failed" << std::endl;
-      }
-   }
-   {
-      ossimTempFilename tempFileDos(".", "tempDos","txt",true,false);
-      tempFileDos.generateRandomFile();
-      
-      std::ofstream outUnix(tempFile.c_str());
-      std::ofstream outDos(tempFileDos.c_str());
-      
-      outUnix<< "key1: value1\n";
-      outUnix<< "key2: value2\n";
-      outUnix<< "key3: value3\n";
-      outUnix<< "key4: value4\n";
-      outUnix<< "key5: value5\n";
-      outUnix.close();
-      outDos<< "key1: value1\r";
-      outDos<< "key2: value2\r";
-      outDos<< "key3: value3\r";
-      outDos<< "key4: value4\r";
-      outDos<< "key5: value5\r";
-      outDos.close();
-      
-      ossimKeywordlist kwlUnix;
-      ossimKeywordlist kwlDos;
-      std::cout << "Dos carriage returns and unix returns? ";
-      
-      if((kwlUnix.addFile(tempFile)&&kwlDos.addFile(tempFileDos))&&
-         (kwlUnix.getMap() == kwlDos.getMap()))
-      {
-         std::cout << "passed" << std::endl;
-      }
-      else 
-      {
-         std::cout << "failed" << std::endl;
-      }
-   }
-   {
-      std::ofstream out(tempFile.c_str());
-      
-      out<< "/adfakdfhkadkjh\n";
-      out.close();
-      
-      ossimKeywordlist kwl;
-      std::cout << "bad comment? ";
-      if(!kwl.addFile(tempFile))
-      {
-         std::cout << "passed" << std::endl;
-      }
-      else 
-      {
-         std::cout << "failed" << std::endl;
-      }
-   }
-   {
-      std::ofstream out(tempFile.c_str());
-      
-      out<< "//adfakdfhkadkjh\n";
-      out.close();
-      
-      ossimKeywordlist kwl;
-      std::cout << "good comment? ";
-      if(kwl.addFile(tempFile))
-      {
-         std::cout << "passed" << std::endl;
-      }
-      else 
-      {
-         std::cout << "failed" << std::endl;
-      }
-   }
-   {
-      std::ofstream out(tempFile.c_str());
-      
-      out<< "//adfakdfhkadkjh";
-      out.close();
-      
-      ossimKeywordlist kwl;
-      std::cout << "good comment no end of line? ";
-      if(kwl.addFile(tempFile))
-      {
-         std::cout << "passed" << std::endl;
-      }
-      else 
-      {
-         std::cout << "failed" << std::endl;
-      }
-   }
-   {
-      std::ofstream out(tempFile.c_str());
-      
-      out<< "/test:";
-      out.close();
-      
-      ossimKeywordlist kwl;
-      std::cout << "----------- 1 token lookahead problem, single slash start of line with valid key but no value ------------ \n";
-      std::cout << "Accepted file? ";
-      if(kwl.addFile(tempFile))
-      {
-         std::cout << "passed" << std::endl;
-      }
-      else 
-      {
-         std::cout << "failed" << std::endl;
-      }
-      std::cout << "Verify key? " << (kwl.find("/test")?"passed\n":"failed\n");
-   }
-   {
-      std::ofstream out(tempFile.c_str());
-      
-      out<< "test   :";
-      out.close();
-      std::cout << "----------- trailing spaces for key trimmed ------------ \n";
-      
-      ossimKeywordlist kwl;
-      std::cout << "Accepted file? ";
-      if(kwl.addFile(tempFile))
-      {
-         std::cout << "passed" << std::endl;
-      }
-      else 
-      {
-         std::cout << "failed" << std::endl;
-      }
-      std::cout << "Verify key? " << (kwl.find("test")?"passed\n":"failed\n");
-   }
-   {
-
-      ossimKeywordlist kwl;
-      ossimString value1 ="   --leading and trailing---   ";
-      ossimString value2 ="   --trailing---";
-      ossimString value3 ="--leading---   ";
-      kwl.add("","key1", value1);
-      kwl.add("","key2", value2);
-      kwl.add("","key3", value3);
-      kwl.trimAllValues();
-      std::cout << "----------- Testing utility method trimAll values ------------ \n";
-      std::cout << "Verify  value1? " << ((value1.trim() == ossimString(kwl.find("key1")))?"passed":"failed") << std::endl;
-      std::cout << "Verify  value2? " << ((value2.trim() == ossimString(kwl.find("key2")))?"passed":"failed") << std::endl;
-      std::cout << "Verify  value3? " << ((value3.trim() == ossimString(kwl.find("key3")))?"passed":"failed") << std::endl;
-   }
-}
-
-int main(int argc, char* argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-   ossimString complicatedHtmlEmbed = "<html>\n\
-   <head>\n\
-   <title>OMAR Login</title>\n\
-   <link rel=\"stylesheet\" href=\"/omar/css/main.css\"/>\n\
-   <link rel=\"stylesheet\" href=\"/omar/css/omar-2.0.css\"/>\n\
-   <link rel=\"stylesheet\" href=\"/omar/css/main.css\"/>\
-   <link rel=\"stylesheet\" href=\"/omar/css/omar-2.0.css\"/>\n\
-   <link rel=\"stylesheet\" type=\"text/css\" href=\"richui-0.8/js/yui/reset-fonts-grids/reset-fonts-grids.css\"/>\n\
-   <link rel=\"stylesheet\" type=\"text/css\" href=\"richui-0.8/js/yui/layout/assets/skins/sam/layout.css\"/>\n\
-   \n\
-   \n\
-   \n\
-   <style>\n\
-   /*\n\
-   margin and padding on body element\n\
-   can introduce errors in determining\n\
-   element position and are not recommended;\n\
-   we turn them off as a foundation for YUI\n\
-   CSS treatments.\n\
-   */ \n\
-   body {\n\
-   margin: 0;\n\
-   padding: 0;\n\
-   }\n\
-   \n\
-   /* Set the background color */\n\
-   .yui-skin-sam .yui-layout {\n\
-   background-color: #FFFFFF;\n\
-   }\n\
-   \n\
-   /* Style the body */\n\
-   .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {\n\
-   background-color: #FFFFFF;\n\
-   }\n\
-   \n\
-   </style>\n\
-   </head>\n\
-   ";
-   ossimString testValueAllBlanks = "          ";
-   ossimString testValueLeftBlanks = "  blanks are to the left";
-   ossimString testValueRightBlanks = "blanks are to the right    ";
-   ossimString testValueRightBlanksEol = "\n\n\n\n\nblanks are to the right   \n\n ";
-   ossimKeywordlist kwl;
-   ossimKeywordlist kwl2;
-   
-   kwl.add("test1.", "value", "value no new line", true);
-   kwl.add("test2.", "value", "value \n\n\non separate\nlines", true);
-   kwl.add("test3.", "value", "value no new line", true);
-   kwl.add("test4.", "value", "", true);
-   kwl.add("testAllBlanks.",   "value", testValueAllBlanks, true);
-   kwl.add("testLeftBlanks.",  "value", testValueLeftBlanks, true);
-   kwl.add("testRightBlanks.", "value", testValueRightBlanks, true);
-   kwl.add("testRightBlanks.", "value", testValueRightBlanks, true);
-   kwl.add("testRightBlanksEol.", "value", testValueRightBlanksEol, true);
-   kwl.add("testZ.", "value", "", true);
-   kwl.add("complicatedHtmlEmbed.", "value", complicatedHtmlEmbed, true);
-   ossimTempFilename tempFile(".", "temp","txt",true,false);
-   tempFile.generateRandomFile();
-   std::cout << "tempFile === " << tempFile << std::endl;
-   std::ofstream out(tempFile.c_str());
-   out << kwl << std::endl;
-   out.close();
-   
-   kwl2.addFile(tempFile.c_str());
-   
-   std::cout << "---------------------- Original KWL --------------------\n";
-   std::cout << kwl << std::endl;
-   std::cout << "---------------------- Testing Original KWL Read back in from file --------------------\n";
-   std::cout << kwl2 << std::endl;
-   std::cout << "---------------------- Testing Original KWL toString no arguments--------------------\n";
-   std::cout << kwl.toString() << std::endl;
-   std::cout << "---------------------- Testing Original KWL toString with arguments--------------------\n";
-   ossimString result;
-   kwl.toString(result);
-   std::cout << result << std::endl;
-   std::cout << "---------------------- Testing environment variable expand for add variable--------------------\n";
-   ossimKeywordlist kwl3;
-   kwl3.setExpandEnvVarsFlag(true);
-   kwl3.add("test1.", "value", "$(HOME) no new line", true);
-   kwl3.add("test1.", "value", "$(HOME) no $(HOME) new line", true);
-   std::cout << kwl3 << std::endl;
-   std::cout << "------------------ Running sanity tests to make sure that triple quotes are retained ---------------- \n";
- 
-   std::cout << "kwl1 == kwl2? " << ((kwl.getMap() == kwl2.getMap())?"passed":"failed") << std::endl;
-   std::cout << "testValueAllBlanks preserved? " << ((ossimString(kwl2.find("testAllBlanks.value"))==testValueAllBlanks)?"passed":"failed") << std::endl;
-   std::cout << "testValueLeftBlanks preserved? " << ((ossimString(kwl2.find("testLeftBlanks.value"))==testValueLeftBlanks)?"passed":"failed") << std::endl;
-   std::cout << "testValueRightBlanks preserved? " << ((ossimString(kwl2.find("testRightBlanks.value"))==testValueRightBlanks)?"passed":"failed") << std::endl;
-   std::cout << "testRightBlanksEol preserved? " << ((ossimString(kwl2.find("testRightBlanksEol.value"))==testValueRightBlanksEol)?"passed":"failed") << std::endl;
-   std::cout << "complicatedHtmlEmbed preserved? " << ((ossimString(kwl2.find("complicatedHtmlEmbed.value"))==complicatedHtmlEmbed)?"passed":"failed") << std::endl;
-   runTestForFileVariations();
-}
\ No newline at end of file
diff --git a/ossim/src/test/ossim-loadtile-test.cpp b/ossim/src/test/ossim-loadtile-test.cpp
deleted file mode 100644
index 1762f92..0000000
--- a/ossim/src/test/ossim-loadtile-test.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// File: ossim-foo.cpp
-//
-// Author:  David Burken
-//
-// Description: Test app:
-//
-// 1) Makes a 256x256 tile.  Each line having a single value from 0 to 255.
-// 2) Test ossimImageData::loadTile where source is 16 bit, destination 8 bit.
-// 3) Test histogram.  Should have 256 bins (0 to 255) each with count of 256.
-//
-// Returns 0 on success and outputs PASSED, 1 on failure and outputs FAILED.
-//
-// $Id$
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/base/ossimConstants.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimHistogram.h>
-#include <ossim/base/ossimMultiBandHistogram.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageData.h>
-#include <ossim/init/ossimInit.h>
-
-#include <iostream>
-using namespace std;
-
-int main( int argc, char* argv[] )
-{
-   enum
-   {
-      PASSED = 0,
-      FAILED = 1
-   };
-
-   int status = PASSED;
-   
-   ossimArgumentParser ap(&argc, argv);
-   ossimInit::instance()->addOptions(ap);
-   ossimInit::instance()->initialize(ap);
-
-   try
-   {
-      ossimIrect rect(0,0,255,255);
-      
-      ossimRefPtr<ossimImageData> srcTile = new ossimImageData(0, OSSIM_UINT16, 1, 256, 256);
-      srcTile->initialize();
-      srcTile->setImageRectangle( rect );
-
-      // Set max for conversion to 8 bit.
-      srcTile->setMaxPix( 255, 0 );
-      ossim_uint16* src = srcTile->getUshortBuf();
-      
-      const ossim_uint32 LINES   = 256;
-      const ossim_uint32 SAMPLES = 256;
-      ossim_uint32 s = 0;
-   
-      // line loop
-      for(ossim_uint32 line = 0; line < LINES; ++line)
-      {
-         // sample loop
-         for(ossim_uint32 samp = 0; samp < SAMPLES; ++samp)
-         {
-            src[samp] = s;
-         }
-         src += SAMPLES;
-         ++s;
-      }
-      
-      ossimRefPtr<ossimImageData> destTile = new ossimImageData(0, OSSIM_UINT8, 1, 256, 256);
-      destTile->initialize();
-      destTile->setImageRectangle( rect );
-      destTile->loadTile( srcTile.get() );
-      destTile->validate();
-
-      ossimRefPtr<ossimMultiBandHistogram> his = new ossimMultiBandHistogram( 1, 256, 0, 255 );
-
-      destTile->populateHistogram( his );
-
-      const ossimRefPtr<ossimHistogram> h = his->getHistogram( 0 );
-      if ( h.valid() )
-      {
-         float count;
-         for( ossim_uint32 i = 0; i < LINES; ++i )
-         {
-            count = h->GetCount( static_cast<float>(i) );
-            if ( count != 256.0 )
-            {
-               status = FAILED;
- 
-               cerr << "bin[254]: " << h->GetCount( 254.0)
-                    << "\nbin[" << i << "]: count = " << count
-                    << "\nShould be 256..."
-                    << "\nhistogram bin count: " << h->GetRes()
-                    << endl;
-
-               const ossim_uint8* buf = destTile->getUcharBuf();
-               if ( buf )
-               {
-                  cerr << "tile buffer index(255, 255) = "
-                       << (int)buf[65535] << endl;
-               }
-
-               break;
-            }
-         }
-      }
-      else
-      {
-         status = FAILED;
-      }
-   }
-   catch (const ossimException& e)
-   {
-      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-      status = FAILED;
-   }
-
-   cout << "ossim-loadtile-test: " << (status == PASSED ? "PASSED" : "FAILED")  << endl;
-   return status;
-}
diff --git a/ossim/src/test/ossim-mask-filter-test.cpp b/ossim/src/test/ossim-mask-filter-test.cpp
deleted file mode 100644
index a44dd78..0000000
--- a/ossim/src/test/ossim-mask-filter-test.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// File: ossim-mask-filter-test.cpp
-//
-// Author:  David Burken
-//
-// Description: Test application for ossimMaskFilter.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-mask-filter-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/base/ossimViewInterface.h>
-#include <ossim/imaging/ossimImageFileWriter.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/imaging/ossimMaskFilter.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/init/ossimInit.h>
-
-int main(int argc, char* argv[])
-{
-   ossimTimer::instance()->setStartTick();
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 6)
-   {
-      cout << argv[0] << " <mask_type> <resample_flag> <image_file> <shape_file> <output_file>"
-           << "\nCombines image and shape files with mask filter and writes "
-           << "result to output file.\n"
-           << "valid mask_types:\n"
-           << "1 = OSSIM_MASK_TYPE_SELECT\n"
-           << "2 = OSSIM_MASK_TYPE_INVERT\n"
-           << "3 = OSSIM_MASK_TYPE_WEIGHTED\n"
-           << "4 = OSSIM_MASK_TYPE_BINARY\n"
-           << "5 = OSSIM_MASK_TYPE_BINARY_INVERSE\n"
-           << "resample_flag if true the output will be rendered to a geographic projection.\n"
-           << "output_file is a mask of image and shape.\n"
-           << endl;
-      return 0;
-   }
-
-
-   int i = atoi(argv[1]);
-   if ( (i < 1) || (i > 5) )
-   {
-      cerr << "mask type out of range!" << endl;
-      return 1;
-   }
-   ossimMaskFilter::ossimFileSelectionMaskType mask_type =
-      static_cast<ossimMaskFilter::ossimFileSelectionMaskType>(i);
-   i = atoi(argv[2]);
-   bool resample_flag = (i?true:false);
-   ossimFilename inputImgName = ossimFilename(argv[3]);
-   ossimFilename inputShpName = ossimFilename(argv[4]);
-   ossimFilename outputFile  = ossimFilename(argv[5]);
-
-   cout << "ossim-mask-filter-test:"
-        << "\nmask_type:     " << mask_type
-        << "\nresample_flag: " << resample_flag
-        << "\ninputImgName:  " << inputImgName
-        << "\ninputShpName:  " << inputShpName
-        << "\noutputFile:    " << outputFile
-        << endl;
-
-   //---
-   // Test masking shape and image:
-   //---
-   ossimRefPtr<ossimImageSource> inputImg = 0;
-   if ( !resample_flag )
-   {
-      inputImg = ossimImageHandlerRegistry::instance()->open(inputImgName);
-   }
-   else
-   {
-      ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
-      if ( sic->open( inputImgName ) )
-      {
-         // Render the image chain.
-         sic->createRenderedChain();
-         inputImg = sic.get();
-      }
-      else
-      {
-         sic = 0;
-      }
-   }
-   if ( inputImg.valid() == false )
-   {
-      cout << "Could not open: " << inputImgName  << endl;
-      return 1;
-   }
-         
-   ossimRefPtr<ossimImageHandler> inputShp =
-      ossimImageHandlerRegistry::instance()->open(inputShpName);
-   if ( inputShp.valid() )
-   {
-      if ( inputShp->getClassName() == "ossimOgrGdalTileSource" )
-      {
-         ossimViewInterface* shpView = PTR_CAST(ossimViewInterface, inputShp.get());
-         if (shpView)
-         {
-            //---
-            // Test masking image handler and shape file.
-            //---
-            
-            // Set the shape reader's view to that of the image's.
-            shpView->setView(inputImg->getImageGeometry().get());
-            
-            // Turn fill on...
-            ossimRefPtr<ossimProperty> fillProp =
-               new ossimStringProperty(ossimString("fill_flag"),
-                                       ossimString("1"));
-            inputShp->setProperty(fillProp);
-            
-            
-            ossimRefPtr<ossimMaskFilter> maskFlt = new ossimMaskFilter();
-            maskFlt->setMaskType(mask_type);
-            maskFlt->connectMyInputTo( 0, inputImg.get() );
-            // maskFlt->connectMyInputTo(1, inputShp.get());
-            maskFlt->setMaskSource( inputShp.get() );
-            maskFlt->initialize();
-            
-            ossimRefPtr<ossimImageFileWriter> writer =
-               ossimImageWriterFactoryRegistry::instance()->
-               createWriterFromExtension(outputFile.ext());
-            
-            if ( writer->open( outputFile ) )
-            {
-               // Add a listener to get percent complete.
-               ossimStdOutProgress prog(0, true);
-               writer->addListener(&prog);
-               
-               writer->connectMyInputTo(0, maskFlt.get());
-               
-               // Set the cut rect to the input image.
-               writer->setAreaOfInterest(inputImg->getBoundingRect());
-               
-               writer->execute();
-               
-               cout << "Wrote file: " << outputFile
-                    << "\nElapsed time(seconds): "
-                    << ossimTimer::instance()->time_s() << "\n";
-            }
-            else
-            {
-               cout << "Could not open: " << argv[3] << endl;
-            }
-         }
-         else
-         {
-            cerr << "Could not get view interface..." << endl;
-         }
-      }
-      else
-      {
-         cerr << "2nd argument must be a shape file." << endl;
-      }
-   }
-   else
-   {
-      cerr << "Could not open: " << inputShpName << endl;
-   }
-
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-nitf-rsm-model-test.cpp b/ossim/src/test/ossim-nitf-rsm-model-test.cpp
deleted file mode 100644
index bd26341..0000000
--- a/ossim/src/test/ossim-nitf-rsm-model-test.cpp
+++ /dev/null
@@ -1,513 +0,0 @@
-//---
-// File: ossim-nitf-rsm-model-test.cpp
-//
-// Description: Test app for ossimNitfRsmModel class.
-// 
-//---
-
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <ossim/projection/ossimNitfRsmModel.h>
-#include <ossim/projection/ossimProjection.h>
-#include <ossim/projection/ossimRsmModel.h>
-#include <ossim/support_data/ossimNitfRegisteredTag.h>
-#include <ossim/support_data/ossimNitfRsmecaTag.h>
-#include <ossim/support_data/ossimNitfRsmidaTag.h>
-#include <ossim/support_data/ossimNitfRsmpcaTag.h>
-#include <ossim/support_data/ossimNitfRsmpiaTag.h>
-#include <ossim/support_data/ossimNitfTagFactoryRegistry.h>
-
-#include <fstream>
-#include <iomanip>
-#include <iostream>
-#include <string>
-#include <vector>
-
-using namespace std;
-
-static ossimRefPtr<ossimNitfRegisteredTag> getTag( const std::string& tagLine );
-static ossimRefPtr<ossimNitfRsmModel> getModel( const ossimFilename& file );
-static ossimRefPtr<ossimNitfRsmModel> getModelFromExtFile( const ossimFilename& file );
-static ossimRefPtr<ossimNitfRsmModel> getModelFromImage( const ossimFilename& file );
-static void testGpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl );
-static void testIpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl );
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if ( argc == 3 )
-   {
-      ossimFilename file = argv[1];
-      ossimKeywordlist kwl;
-      if ( kwl.addFile( argv[2] ) )
-      {
-         ossimString ext = file.ext();
-         
-         ossimRefPtr<ossimNitfRsmModel> model = getModel( file );
-         if ( model.valid() )
-         {
-            testGpts( model, kwl );
-            testIpts( model, kwl );
-         }
-         else
-         {
-            cerr << "Could not create model!" << endl;
-         }
-      }
-      else
-      {
-         cerr << "Could not open keyword list: " << argv[2] << endl;
-      }  
-   }
-   else
-   {
-      cout << "\n" << argv[0] << " <input-test-file> <options.kwl>"
-           << "\ninput-test-file can be an input test file or a test.ext file.\n"
-           << "\nPrints out debug info for model testing.."
-           << "\ngpts test:"
-           << "\nmodel->worldToLineSample(...), model->lineSampleToWorld(...)"
-           << "\nipts test:"
-           << "\nmodel->lineSampleHeightToWorld(...), model->worldToLineSample(...)"
-           << "\noptions.kwl format example:\n"
-
-           << "\ngtest_id0: E123456\n"
-           << "gtest_gpt0: ( lat, lon, hgt )\n"
-
-           << "gtest_gpt_id1: E123457\n"
-           << "gtest_gpt1: ( lat, lon, hgt )\n"
-
-           << "ggtest_pt_id2: E123458\n"
-           << "gtest_gpt2: ( lat, lon, hgt )\n"
-
-           << "gtest_gpt_id3: E123459\n"
-           << "gtest_gpt3: ( lat, lon, hgt )\n"
-
-           << "gtest_gpt_id4: E123459\n"
-           << "gtest_pt4: ( lat, lon, hgt )\n"
-
-           << "\nitest_height_units: feet\n"
-         
-           << "itest_id0: E123456\n"
-           << "itest_ipt0: ( sample, line )\n"
-           << "itest_hgt0: hgt\n"
-         
-           << "itest_id1: E123457\n"
-           << "itest_ipt1: ( x, y )\n"
-           << "itest_hgt1: hgt\n"
-
-           << "itest_id2: E123458\n"
-           << "itest_ipt2: ( x, y )\n"
-           << "itest_hgt2: hgt\n"
-
-           << "itest_id3: E123459\n"
-           << "itest_ipt3: ( x, y )\n"
-           << "itest_hgt3: hgt\n"
-
-           << "itest_id4: E123459\n"
-           << "itest_ipt4: ( x, y )\n"
-           << "itest_hgt4: hgt\n"
-
-           << "\nNotes:\n"
-           << "* itest_hgt default = meters if units not specified.\n"
-           << "* gpt0: ( lat, lon, hgt ) \"hgt\" is in meters.\n"
-           << "* All test height output is in meters.\n"
-           << "* \"rtd\"=round trip delta.\n"
-           << endl;
-   }
-
-   return 0;
-}
-
-
-ossimRefPtr<ossimNitfRegisteredTag> getTag( const std::string& tagLine )
-{
-   ossimRefPtr<ossimNitfRegisteredTag> result = 0;
-
-   if ( tagLine.size() > 6 )
-   {
-      ossimString tagName = tagLine.substr(0, 6);
-      result = ossimNitfTagFactoryRegistry::instance()->create( tagName );
-      if ( result.valid() )
-      {
-         cout << "tag_name: " << tagName << "\n";
-         
-         istringstream is( tagLine );
-         if ( is.good() )
-         {
-            is.seekg( 6 );
-            char tagLength[6];
-            tagLength[5] = '\0';
-            is.read( tagLength, 5 );
-            cout << "tag_length: " << tagLength << "\n";
-            result->parseStream( is );
-
-            result->print( cout, std::string("") );
-         }
-      }
-      else
-      {
-         cerr << "unhandled_tag: " << tagName << endl;
-      }
-   }
-   return result;
-}
-
-ossimRefPtr<ossimNitfRsmModel> getModel( const ossimFilename& file )
-{
-   ossimRefPtr<ossimNitfRsmModel> result = 0;
-   if ( file.size() )
-   {
-      // Get downcased extension:
-      std::string ext = file.ext().downcase().string();
-      
-      if ( ext == "ext" )
-      {
-         result = getModelFromExtFile( file );
-      }
-      else if ( ( ext == "ntf" ) || ( ext == "nitf" ) )
-      {
-         result = getModelFromImage( file );
-      }
-   }
-   return result;
-}
-
-ossimRefPtr<ossimNitfRsmModel> getModelFromExtFile( const ossimFilename& file )
-{
-   ossimRefPtr<ossimNitfRsmModel> result = 0;
-
-   // Test file with newline separated nitf tags only.
-   ifstream is( file.c_str() );
-   if ( is.good() )
-   {
-      const std::string RSMECA_TAG = "RSMECA";
-      const std::string RSMIDA_TAG = "RSMIDA";
-      const std::string RSMPCA_TAG = "RSMPCA";
-      const std::string RSMPIA_TAG = "RSMPIA";
-      
-      ossimRefPtr<ossimNitfRsmecaTag> rsmecaTag = 0;
-      ossimRefPtr<ossimNitfRsmidaTag> rsmidaTag = 0;
-      ossimRefPtr<ossimNitfRsmpcaTag> rsmpcaTag = 0; 
-      ossimRefPtr<ossimNitfRsmpiaTag> rsmpiaTag = 0;        
-      std::vector< ossimRefPtr<ossimNitfRegisteredTag> > tags;
-      
-      while ( is.good() )
-      {
-         string tagLine;
-         std::getline( is, tagLine );
-         
-         ossimRefPtr<ossimNitfRegisteredTag> tag = getTag( tagLine );
-         if ( tag.valid() )
-         {
-            tags.push_back( tag );
-            if ( tag->getTagName() ==  RSMECA_TAG )
-            {
-               rsmecaTag = dynamic_cast<ossimNitfRsmecaTag*>( tag.get() );
-            }
-            else if ( tag->getTagName() == RSMIDA_TAG )
-            {
-               rsmidaTag = dynamic_cast<ossimNitfRsmidaTag*>( tag.get() );
-            }
-            else if ( tag->getTagName() == RSMPCA_TAG )
-            {
-               rsmpcaTag = dynamic_cast<ossimNitfRsmpcaTag*>( tag.get() );
-            }
-            else if ( tag->getTagName() == RSMPIA_TAG )
-            {
-               rsmpiaTag = dynamic_cast<ossimNitfRsmpiaTag*>( tag.get() );
-            }
-         }
-      }
-      
-      if ( rsmecaTag.valid() && rsmidaTag.valid() &&
-           rsmpcaTag.valid() && rsmpiaTag.valid() )
-      {
-         result = new ossimNitfRsmModel();
-         if ( result->initializeModel( rsmecaTag.get() ) )
-         {
-            if ( result->initializeModel( rsmidaTag.get() ) )
-            {
-               if ( result->initializeModel( rsmpcaTag.get() ) )
-               {
-                  if ( result->initializeModel( rsmpiaTag.get() ) )
-                  {
-                     cout << "Initialize from ext file success!" << endl;
-                  }
-                  else
-                  {
-                     result = 0;
-                     cerr << "ossimNitfRsmModel::initializeModel(" << RSMPIA_TAG
-                          << ") failed!" << endl;
-                  }
-               }
-               else
-               {
-                  result = 0;
-                  cerr << "ossimNitfRsmModel::initializeModel(" << RSMPCA_TAG
-                       << ") failed!" << endl;
-               }
-            }
-            else
-            {
-               result = 0;
-               cerr << "ossimNitfRsmModel::initializeModel(" << RSMIDA_TAG
-                    << ") failed!" << endl;
-            }
-         }
-         else
-         {
-            result = 0;
-            cerr << "ossimNitfRsmModel::initializeModel(" << RSMECA_TAG
-                 << ") failed!" << endl;
-         }
-      }
-      else
-      {
-         // At least one RSM tag was not found.
-         if ( rsmecaTag.valid() == false )
-         {
-            cerr << RSMECA_TAG << " not found!" << endl;
-         }
-         if ( rsmidaTag.valid() == false )
-         {
-            cerr << RSMIDA_TAG << " not found!" << endl;
-         }
-         if ( rsmpcaTag.valid() == false )
-         {
-            cerr << RSMPCA_TAG << " not found!" << endl;
-         }
-         if ( rsmpiaTag.valid() == false )
-         {
-            cerr << RSMPIA_TAG << " not found!" << endl;
-         }
-      }
-   }
-   else
-   {
-      cerr << "Could not open: " << file << endl;
-   }
-         
-   return result;
-   
-} // End: getModelFromExtFile(...)
-
-
-ossimRefPtr<ossimNitfRsmModel> getModelFromImage( const ossimFilename& file )
-{
-   ossimRefPtr<ossimNitfRsmModel> result = 0;
-
-   ossimRefPtr<ossimImageHandler> ih =
-      ossimImageHandlerRegistry::instance()->open(file,
-                                                  true,   // try suffix first
-                                                  false); // open overview
-   if ( ih.valid() )
-   {
-      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
-      if ( geom.valid() )
-      {
-         ossimRefPtr<ossimProjection> proj = geom->getProjection();
-         if ( proj.valid() )
-         {
-            result = dynamic_cast<ossimNitfRsmModel*>( proj.get() );
-         }
-      }
-   }
-   
-   return result;  
-}
-
-void testGpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl )
-{
-   if ( model.valid() )
-   {
-      cout << std::setfill(' ') << setiosflags(ios::left);
-      
-      const std::string  ID_KW  = "gtest_id";
-      const std::string  GPT_KW = "gtest_gpt";
-      const ossim_uint32 POINTS = kwl.numberOf( ID_KW.c_str() );
-      
-      cout << "\ngtest begin ********************************\n\n"
-           << "number_of_points_world_points: " << POINTS << "\n";
-      
-      ossim_uint32 foundPts = 0;
-      ossim_uint32 i = 0;
-      
-      std::string key;
-      std::string value;
-      
-      while ( foundPts < POINTS )
-      {
-         // ID:
-         key = ID_KW + ossimString::toString( i ).string();
-         value = kwl.findKey( key );
-         if ( value.size() )
-         {
-            cout << "gtest_id" << std::setw(6) << i << ":  " << value << "\n";
-         }
-      
-         // World point :
-         key = GPT_KW + ossimString::toString( i ).string();
-         value = kwl.findKey( key );
-      
-         if ( value.size() )
-         {
-            ossimDpt ipt; // image point
-            ossimGpt wpt; // world point
-            ossimGpt rtp; // round trip point
-            ossimDpt rtd; // round trip delta;
-         
-            wpt.toPoint( value );
-
-            cout << "gtest_gpt" << std::setw(5) << i << ":  " << wpt << "\n";
-
-            model->worldToLineSample( wpt, ipt );
-
-            if ( wpt.hasNans() == false )
-            {
-               model->lineSampleHeightToWorld( ipt, wpt.hgt, rtp );
-            
-               rtd.x = wpt.lon - rtp.lon;
-               rtd.y = wpt.lat - rtp.lat;
-            
-               cout << "gtest_ipt" << std::setw(5) << i << ":  " << ipt << "\n"
-                    << "gtest_rtp" << std::setw(5) << i << ":  " << rtp << "\n"
-                    << "gtest_rtd" << std::setw(5) << i << ":  " << rtd << "\n\n";  
-            }
-            else
-            {
-               cerr << "model->worldToLineSample(...) result has nans!\n"
-                    << wpt << endl;
-            }
-         
-            ++foundPts;
-         }
-      
-         ++i;
-      
-         if ( i > POINTS+100 )
-         {
-            break;
-         }
-      }
-
-      cout << "\ngtest end **********************************\n\n";
-   }
-   
-} // End: testGpts
-
-void testIpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl )
-{
-   if ( model.valid() )
-   {
-      cout << std::setfill(' ') << setiosflags(ios::left);
-
-      const std::string  ID_KW      = "itest_id";
-      const std::string  IPT_KW     = "itest_ipt";
-      const std::string  IPT_HGT_KW = "itest_hgt";
-      const ossim_uint32 POINTS     = kwl.numberOf( ID_KW.c_str() );
-   
-      // Test data height values can be in feet.
-      ossimUnitType heightUnits = OSSIM_METERS;
-      std::string key = "itest_height_units";
-      std::string value = kwl.findKey( key );
-      if ( value.size() )
-      {
-         cout << key << ": " << value << "\n";
-         if ( value == "feet" )
-         {
-            heightUnits = OSSIM_FEET;
-         }
-      }
-      cout << "\nitest begin ********************************\n\n"
-           << "number_of_line_sample_points: " << POINTS << "\n";
-      
-      ossim_uint32 foundPts = 0;
-      ossim_uint32 i = 0;
-
-      while ( foundPts < POINTS )
-      {
-         // ID:
-         key = ID_KW + ossimString::toString( i ).string();
-         value = kwl.findKey( key );
-         if ( value.size() )
-         {
-            cout << "itest_id" << std::setw(6) << i << ":  " << value << "\n";
-         }
-      
-         // Image point, sample, line:
-         key = IPT_KW + ossimString::toString( i ).string();
-         value = kwl.findKey( key );
-      
-         if ( value.size() )
-         {
-            ossimDpt ipt; // image point
-            ossimGpt wpt; // world point
-            ossimDpt rtp; // round trip point
-            ossimDpt rtd; // round trip delta;
-         
-            ipt.toPoint( value );
-         
-            cout << "itest_ipt" << std::setw(5) << i << ":  " << value << "\n";
-         
-            // Get the height above ellipsoid:
-            ossim_float64 hgt = 0.0;
-            key = IPT_HGT_KW + ossimString::toString( i ).string();
-            value = kwl.findKey( key );
-            if ( value.size() )
-            {
-               ossimString os ( value );
-               hgt = os.toFloat64();
-            
-               if ( heightUnits == OSSIM_FEET )
-               {
-                  hgt *= MTRS_PER_FT;
-               }
-            }
-            else
-            {
-               cerr << "missing height above ellipsoid for point!  Using 0.0."
-                    << endl;
-            }
-         
-            cout << "itest_hgt" << std::setw(5) << i << ":  " << value << "\n";
-         
-            model->lineSampleHeightToWorld( ipt, hgt, wpt );
-            if ( wpt.hasNans() == false )
-            {
-               model->worldToLineSample( wpt, rtp );
-            
-               rtd = ipt - rtp;
-            
-               cout << "itest_wpt" << std::setw(5) << i << ":  " << wpt << "\n"
-                    << "itest_rtp" << std::setw(5) << i << ":  " << rtp << "\n"
-                    << "itest_rtd" << std::setw(5) << i << ":  " << rtd << "\n\n";
-            }
-            else
-            {
-               cerr << "model->worldToLineSample(...) result has nans!\n"
-                    << wpt << endl;
-            }
-         
-            ++foundPts;
-         }
-      
-         ++i;
-      
-         if ( i > POINTS+100 )
-         {
-            break;
-         }
-      }
-
-      cout << "\ntestIpts end **********************************\n\n";
-   }
-   
-} // End: testIpts
diff --git a/ossim/src/test/ossim-notify-test.cpp b/ossim/src/test/ossim-notify-test.cpp
deleted file mode 100644
index b6289b7..0000000
--- a/ossim/src/test/ossim-notify-test.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// ossimNotify functions test.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-notify-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimNotify.h>
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   ossimFilename logFile;
-   ossimGetLogFilename(logFile);
-
-   cout << "log file after ossimInit::instance()->initialize: "
-        << logFile << endl;
-
-   if (logFile.size() == 0)
-   {
-      logFile = "/tmp/ossim-log.txt";
-      ossimSetLogFilename(logFile);
-   }
-
-   ossimGetLogFilename(logFile);
-
-   cout << "set logFile end of test: " << logFile << endl;
-
-   // ossimSetError was hanging:
-   cout << "Calling ossimSetError(...) ..." << endl;
-   ossimSetError( ossimString("ossimTiffOverviewBuilder"),
-                 ossimErrorCodes::OSSIM_WRITE_FILE_ERROR,
-                 "%s file %s line %d\nError creating reduced res set!",
-                 "MODULE",
-                 __FILE__,
-                 __LINE__);
-   cout << "ossimSetError(...) returned..." << endl;
-   
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-piecewise-remapper-test.cpp b/ossim/src/test/ossim-piecewise-remapper-test.cpp
deleted file mode 100644
index 3560428..0000000
--- a/ossim/src/test/ossim-piecewise-remapper-test.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application for ossimPiecewiseRemapper class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-single-image-chain-test.cpp 21631 2012-09-06 18:10:55Z dburken $
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimPiecewiseRemapper.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/init/ossimInit.h>
-#include <iomanip>
-#include <iostream>
-using namespace std;
-
-int main(int argc, char* argv[])
-{
-   ossimTimer::instance()->setStartTick();
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
-   
-   cout << "elapsed time after initialize(ms): "
-        << std::setiosflags(ios::fixed)
-        << std::setprecision(3)
-        << ossimTimer::instance()->time_s() << "\n";
-
-   if (argc < 2)
-   {
-      cout << argv[0] << "<image_file> <optional_output_file>"
-           << "\nOpens up single image chain and dumps the state to keyword"
-           << " list." << endl;
-      return 0;
-   }
-
-   ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      cout << "Opened: " << argv[1] << endl;
-      
-      ossimRefPtr<ossimPiecewiseRemapper> pwr = new ossimPiecewiseRemapper();
-
-      // Add to the end of the chain. So it's image_handler->piecewise_remapper.
-      sic1->addFirst( pwr.get() );
-
-      ossimKeywordlist kwl;
-      std::string key;
-      std::string val;
-      
-      key = "number_bands";
-      val = "1";
-      kwl.addPair(key, val);
-
-      key = "remap_type";
-      val = "linear_native";
-      kwl.addPair(key, val);
-
-      // ((<min_in> <max_in> <min_out> <max_out>),(<min_in> <max_in> <min_out> <max_out>))
-      key = "band0.remap0";
-      val = "((0, 127, 0, 127), (128, 255, 128, 382))";
-      kwl.addPair(key, val);
-      key = "band0.remap1";
-      val = "((0, 382, 0, 255))";
-      kwl.addPair(key, val);
-
-      key = "scalar_type";
-      val = "OSSIM_UINT8";
-      kwl.addPair(key, val);
-
-      key = "type";
-      val = "ossimPiecewiseRemapper";
-      kwl.addPair(key, val);
-
-      cout << "kwl:\n" << kwl << "\n";
-
-      pwr->loadState( kwl, 0 );
-      // pwr->initialize();
-
-      // sic1->addScalarRemapper();
-      sic1->addCache();
-
-      sic1->initialize();
-      
-      // Set up chain:
-      if ( sic1->getImageHandler()->getNumberOfOutputBands() == 4 )
-      {
-         // Just guessing...
-         // sic1->setThreeBandReverseFlag(true);
-      }
-               
-      // Always have resampler cache.
-      // sic1->setAddResamplerCacheFlag(true);
-
-      // Histogram:
-      // sic1->setAddHistogramFlag(true);
-
-      // sic1->createRenderedChain();
-
-      kwl.clear();
-      sic1->saveState(kwl, 0);
-
-      cout << "sic1 state: " << kwl << endl;
-   }
-
-   if (argc == 3)
-   {
-      // Write image:
-      ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
-      if ( writer->open( ossimFilename(argv[2]) ) )
-      {
-         cout << "Outputting file: " << ossimFilename(argv[2]) << endl;
-         
-         // Add a listener to get percent complete.
-         ossimStdOutProgress prog(0, true);
-         writer->addListener(&prog);
-         
-         writer->connectMyInputTo(0, sic1.get());
-         writer->execute();
-         ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
-         cout << "elapsed time after write(ms): "
-              << std::setiosflags(ios::fixed)
-              << std::setprecision(3)
-              << ossimTimer::instance()->time_s() << "\n";
-         
-         cout << "write time minus initialize: "
-              << std::setiosflags(ios::fixed)
-              << std::setprecision(3)
-              << ossimTimer::instance()->delta_s(t1, t2) << "\n";
-      }
-   }
-
-   return 0;
-}
-
-#if 0
-      // Histogram stretch:
-      if ( sic1->openHistogram(ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX) == false )
-      {
-         cout << "Could not do histogram stretch!" << endl;
-      }
-      
-      if (argc == 3)
-      {
-         // Write image:
-         ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
-         if ( writer->open( ossimFilename(argv[2]) ) )
-         {
-            cout << "Outputting file: " << ossimFilename(argv[2]) << endl;
-            
-            // Add a listener to get percent complete.
-            ossimStdOutProgress prog(0, true);
-            writer->addListener(&prog);
-
-            writer->connectMyInputTo(0, sic1.get());
-            writer->execute();
-            ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
-            cout << "elapsed time after write(ms): "
-                 << std::setiosflags(ios::fixed)
-                 << std::setprecision(3)
-                 << ossimTimer::instance()->time_s() << "\n";
-
-            cout << "write time minus initialize: "
-                 << std::setiosflags(ios::fixed)
-                 << std::setprecision(3)
-                 << ossimTimer::instance()->delta_s(t1, t2) << "\n";
-         }
-      }
-#endif
-
-#if 0 
-      ossimRefPtr<ossimImageGeometry> geom = sic1->getImageGeometry();
-      if (geom.valid())
-      {
-         geom->print(cout);
-      }
-
-      // Test the load state.
-      // ossimKeywordlist kwl;
-      kwl.clear();
-      sic1->saveState(kwl, 0);
-
-      ossimSingleImageChain* sic2 = new ossimSingleImageChain();
-      sic2->loadState(kwl, 0);
-
-      kwl.clear();
-      sic2->saveState(kwl, 0);
-
-      cout << "\n\nSingle image chain from load state kwl\n" << kwl;
-   }
-
-#endif
-
-#if 0
-
-   // Create a normal chain.
-   sic1 = new ossimSingleImageChain(true,  // addHistogramFlag
-                                    true,  // addResamplerCacheFlag
-                                    true,  // addChainCacheFlag
-                                    false, // remapToEightBitFlag
-                                    false, // threeBandFlag
-                                    false); // threeBandReverseFlag
-   
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      sic1->createRenderedChain();
-      ossimKeywordlist kwl;
-      sic1->saveState(kwl, 0);
-      cout << "\n\nNormal single image chain kwl\n" << kwl;
-   }
-
-   // Create a stripped down chain.
-   sic1 = new ossimSingleImageChain();
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      sic1->createRenderedChain();
-      ossimKeywordlist kwl;
-      sic1->saveState(kwl, 0);
-      cout << "\n\nSingle image chain stripped down kwl\n" << kwl;
-   }
-
-   // Create a rgb reversed chain.
-   sic1 = new ossimSingleImageChain();
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      sic1->setThreeBandReverseFlag(true);
-      sic1->createRenderedChain();
-      ossimKeywordlist kwl;
-      sic1->saveState(kwl, 0);
-      cout << "\n\nSingle image chain rgb reversed kwl\n" << kwl;
-   }
-
-   cout << "constness test:\n";
-   ossimRefPtr<const ossimSingleImageChain> consSic = sic1.get();
-   ossimRefPtr<const ossimImageHandler> ihConst =  consSic->getImageHandler().get();
-   cout << "image handler bands: " << ihConst->getNumberOfOutputBands() << endl;
-
-
-   
-   return 0;
-}
-#endif
-
diff --git a/ossim/src/test/ossim-point-test.cpp b/ossim/src/test/ossim-point-test.cpp
deleted file mode 100644
index 893be4a..0000000
--- a/ossim/src/test/ossim-point-test.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-//----------------------------------------------------------------------------
-// $Id: ossim-point-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <string>
-#include <iostream>
-#include <sstream>
-
-#include <ossim/base/ossimIpt.h>
-#include <ossim/base/ossimDpt.h>
-#include <ossim/base/ossimDpt3d.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimEcefPoint.h>
-#include <ossim/base/ossimEcefVector.h>
-
-int main()
-{
-   //---
-   // Test ossiIpt::operator>>
-   //---
-   std::string is1(" ( 0, 1 )");
-   std::string is2(" (2,3)");
-   std::string is3(" ( 4, 5 )");
-   std::string is4_5_6_7(" ( 6, 7 )(8, 9) ( 10, 11 ) ( 12, 13) 9876");
-
-   ossimIpt ip1;
-   ossimIpt ip2;
-   ossimIpt ip3;
-   ossimIpt ip4;
-   ossimIpt ip5;
-   ossimIpt ip6;
-   ossimIpt ip7;
-   
-
-   ip1.toPoint(is1);
-   ip2.toPoint(is2);
-   ip3.toPoint(is3);
-   int i;
-
-   std::istringstream istr(is4_5_6_7);
-   istr >> ip4 >> ip5 >> ip6 >> ip7 >> i;
-
-   //---
-   // Test ossiDpt::operator>>
-   //---
-   std::string ds1(" ( 0.0, 1.1 )");
-   std::string ds2(" (2.2,3.3)");
-   std::string ds3(" ( 4.4, 5.5 )");
-   std::string ds4_5_6_7(" ( 6.6, 7.7 )(8.8, 9.9) ( 10.0, 11.0 ) ( 12.0, 13.0) 9876.12345678");
-   std::string ds8("12 20");
-
-   ossimDpt dp1;
-   ossimDpt dp2;
-   ossimDpt dp3;
-   ossimDpt dp4;
-   ossimDpt dp5;
-   ossimDpt dp6;
-   ossimDpt dp7;
-   ossimDpt dp8;
-
-   dp1.toPoint(ds1);
-   dp2.toPoint(ds2);
-   dp3.toPoint(ds3);
-   double d;
-
-   std::istringstream istr2(ds4_5_6_7);
-   istr2 >> dp4 >> dp5 >> dp6 >> dp7 >> d;
-
-   dp8.toPoint(ds8); // Test an invalid string "12 20"
-
-    //---
-   // Test ossiDpt3d
-   //---
-   std::string ds3d1  = " ( 0.0, 1.1, 2.2 )";
-   std::string ds3d2 = "(1.0,2.0,3.0)";
-   
-   ossimDpt3d dp3d1;
-   ossimDpt3d dp3d2;
-   dp3d1.toPoint(ds3d1);
-   dp3d2.toPoint(ds3d2);
-
-
-   //---
-   // Test ossiGpt::operator>>
-   //---
-   std::string gs1("(0.0,0.0,0.0,WGE)");
-   std::string gs2("(1.1,2.2,3.3,NAR-C)");
-   std::string gs3(" (4.4,5.5,6.6,NAS-C )");
-   std::string gs4_5_6_7(" (4.4,5.5,6.6,NAS-C )( 10.0, 10.0 ,5.0, TOY-C ) (17, -89, 50.0, xxx) (28.2, -44.5, 10000.0, NAS-B) 12345.6789");
-
-   ossimGpt gp1;
-   ossimGpt gp2;
-   ossimGpt gp3;
-   ossimGpt gp4;
-   ossimGpt gp5;
-   ossimGpt gp6;
-   ossimGpt gp7;
-   double d2;
-
-   gp1.toPoint(gs1);
-   gp2.toPoint(gs2);
-   gp3.toPoint(gs3);
-
-   std::istringstream istr4(gs4_5_6_7);
-   istr4 >> gp4 >> gp5 >> gp6 >> gp7 >> d2;
-
-
-   //---
-   // Test ossimEcefPoint toString and toPoint methods.
-   //---
-   std::string es1("(1.0,2.0,3.0)");
-   ossimEcefPoint ep1;
-   ep1.toPoint(es1);
-   std::string es2 = ep1.toString(10).string();
-
-   //---
-   // Test ossimEcefPoint toString and toPoint methods.
-   //---
-   ossimEcefVector ev1;
-   ev1.toPoint(es1);
-   std::string es3 = ev1.toString(10).string();
-  
-   std::cout
-      << "\nis1:       " << is1
-      << "\nip1:       " << ip1
-      << "\nis2:       " << is2
-      << "\nip2:       " << ip2
-      << "\nis3:       " << is3
-      << "\nip3:       " << ip3
-      << "\nis4_5_6_7: " << is4_5_6_7
-      << "\nip4:       " << ip4
-      << "\nip5:       " << ip5
-      << "\nip6:       " << ip6
-      << "\nip7:       " << ip7
-      << "\ni:         " << i
-
-      << "\n\n\nds1:       " << ds1
-      << "\ndp1:       " << dp1
-      << "\nds2:       " << ds2
-      << "\ndp2:       " << dp2
-      << "\nds3:       " << ds3
-      << "\ndp3:       " << dp3
-      << "\nds4_5_6_7: " << ds4_5_6_7
-      << "\ndp4:       " << dp4
-      << "\ndp5:       " << dp5
-      << "\ndp6:       " << dp6
-      << "\ndp7:       " << dp7
-      << "\nds8:       " << ds8
-      << "\ndp8:       " << dp8
-      << "\nd:         " << d
-
-      << "\n\nds3d1:       " << ds3d1
-      << "\nds3d2:     " << ds3d2
-      << "\ndp3d1:     " << dp3d1
-      << "\ndp3d2:     " << dp3d2
-
-      << "\n\n\ngs1:       " << gs1
-      << "\ngp1:       " << gp1
-      << "\ngs2:       " << gs2
-      << "\ngp2:       " << gp2
-      << "\ngs3:       " << gs3
-      << "\ngp3:       " << gp3
-      << "\ngs4_5_6_7: " << gs4_5_6_7
-      << "\ngp4:       " << gp4
-      << "\ngp5:       " << gp5
-      << "\ngp6:       " << gp6
-      << "\ngp7:       " << gp7
-      << "\nd2:         " << d2
-
-      << "\n\n\nes1:       " << es1
-      << "\nep1:       " << ep1
-      << "\nes2:       " << es2
-      << "\nev1:       " << ev1
-      << "\nes3:       " << es3
-
-      << std::endl;
-
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-range-dome-test.cpp b/ossim/src/test/ossim-range-dome-test.cpp
deleted file mode 100644
index 32ca4a1..0000000
--- a/ossim/src/test/ossim-range-dome-test.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License:  See top level LICENSE.txt file.
-//
-// Description: Functional test for ossimRangeDomeTileSource class.
-//
-// $Id: ossim-range-dome-test.cpp 23468 2015-08-19 01:51:42Z dburken $
-//----------------------------------------------------------------------------
-
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimArgumentParser.h>
-#include <ossim/base/ossimApplicationUsage.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
-#include <ossim/imaging/ossimRangeDomeTileSource.h>
-#include <ossim/imaging/ossimImageHandlerRegistry.h>
-#include <iostream>
-#include <cstdlib> /* for exit */
-
-using namespace std;
-
-const char* data = "OSSIM_RANGE_DOMES 1.0\n"
-      "# ID, Lat, Lon, Hgt, Radius, Classification [, Az_start, Az_end] [, \"Description\"]\n"
-      "1, 25.8607, -80.1343, 0, 20, 1\n"
-      "2, 25.8601, -80.1336, 0, 40, 3, 135, 45, NATO friendly dome\n"
-      "3, 25.8605, -80.1343, 0, 40, 102, 135, 225, 50mm battery threat dome\n"
-      "4, 25.8601, -80.1335, 0, 50, 103, 45, 135\n"
-      "5, 25.8605, -80.1336, 0, 50, 104, 340, 20\n";
-
-const char* lut =
-      "type: ossimIndexToRgbLutFilter \n"
-      "mode: literal \n"
-      "entry0.index: 1 \n"
-      "entry0.color: 48 48 255\n"
-      "entry1.index: 2 \n"
-      "entry1.color: 32 32 255 \n"
-      "entry2.index: 3 \n"
-      "entry2.color: 16 16 255 \n"
-      "entry3.index: 4 \n"
-      "entry3.color: 1 1 255 \n"
-      "entry0.index: 101 \n"
-      "entry0.color: 255 32 32 \n"
-      "entry4.index: 102 \n"
-      "entry4.color: 255 128 1 \n"
-      "entry5.index: 103 \n"
-      "entry5.color: 255 64 1 \n"
-      "entry6.index: 104 \n"
-      "entry6.color: 255 1 1 \n";
-
-const char* TEMP_CSV_FILE = "rdtltest-default.csv";
-const char* TEMP_LUT_FILE = "rdtltest-default.lut";
-const char* DEFAULT_RESULTS_FILE = "rdtltest-RESULT.tif";
-
-class Executive
-{
-public:
-   Executive(ossimArgumentParser& ap);
-   ~Executive();
-   bool run();
-
-private:
-   ossimFilename m_csvFile;
-   ossimFilename m_lutFile;
-   ossimFilename m_resultsFile;
-   double m_gsd;
-   bool m_saveFiles;
-};
-
-Executive::Executive(ossimArgumentParser& ap)
-:  m_gsd (1.0),
-   m_saveFiles (false)
-{
-   // Set the general usage:
-   ossimApplicationUsage* au = ap.getApplicationUsage();
-   ossimString usageString = ap.getApplicationName();
-   usageString += " [options]";
-   au->setCommandLineUsage(usageString);
-
-   // Set the command line options:
-   au->addCommandLineOption(
-         "--domes <filename>",
-         "Specifies the input range-dome specifications CSV file name.");
-   au->addCommandLineOption(
-         "--gsd <meters>",
-         "Specifies output GSD in meters. Defaults to 1 meter. ");
-   au->addCommandLineOption(
-         "--lut <filename>",
-         "Causes single-band, output range-dome raster to be remapped to the RGB LUT specified in "
-         "<filename>. Implies \"--use-lut\" option.");
-   au->addCommandLineOption(
-         "--out <filename>",
-         "Specifies output filename. Defaults to <rdtltest-OUT.tif>.");
-   au->addCommandLineOption(
-         "--save",
-         "Prevents temporary domes CSV file and LUT file from being deleted after test so they "
-         "can be used as examples for custom inputs.");
-   au->addCommandLineOption(
-         "--use-lut",
-         "Causes single-band, output range-dome raster to be remapped to default "
-         "range-dome RGB LUT.");
-
-   if (ap.read("-h") || ap.read("--help"))
-   {
-      ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
-      return;
-   }
-
-   std::string ts1;
-   ossimArgumentParser::ossimParameter sp1(ts1);
-   m_csvFile = TEMP_CSV_FILE;
-   m_resultsFile = DEFAULT_RESULTS_FILE;
-   m_lutFile.clear();
-
-   if (ap.read("--gsd", sp1))
-      m_gsd = ossimString(ts1).toDouble();
-
-   if (ap.read("--domes", sp1))
-      m_csvFile = ts1;
-
-   if (ap.read("--lut", sp1))
-      m_lutFile = ts1;
-
-   if (ap.read("--out", sp1))
-      m_resultsFile = ts1;
-
-   if (ap.read("--save"))
-      m_saveFiles = true;
-
-   if (ap.read("--use-lut"))
-      m_lutFile = TEMP_LUT_FILE;
-}
-
-Executive::~Executive()
-{
-   if (!m_saveFiles)
-   {
-      if (m_csvFile == TEMP_CSV_FILE)
-         m_csvFile.remove();
-
-      if (m_lutFile == TEMP_LUT_FILE)
-         m_lutFile.remove();
-   }
-}
-
-bool Executive::run()
-{
-   if (m_resultsFile.empty())
-      return false;
-
-   // Output temp datafile if none provided:
-   if (m_csvFile == TEMP_CSV_FILE)
-   {
-      ofstream ofs (m_csvFile.string().c_str(), ios_base::trunc);
-      if (ofs.fail())
-      {
-         ossimNotify(ossimNotifyLevel_FATAL)
-               << "Could not write out temporary CSV file to CWD. Check permissions." << endl;
-         return false;
-      }
-      ofs << data << endl;
-      ofs.close();
-   }
-
-   // Use factory to open the RDTS:
-   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(m_csvFile);
-   if (!handler.valid())
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-            << "Error encountered instantiating threat dome handler from CSV." << std::endl;
-      return false;
-   }
-
-   // Set up the range-dome filter chain:
-   ossimRangeDomeTileSource* rdts =  dynamic_cast<ossimRangeDomeTileSource*>(handler.get());
-   if (!rdts)
-   {
-      ossimNotify(ossimNotifyLevel_FATAL)
-            << "Error encountered casting handler to ossimRangeDomeTileSource" << std::endl;
-      return false;
-   }
-   ossimConnectableObject* chain_head = rdts;
-   rdts->setGSD(m_gsd);
-
-   cout<<" numLines = "<< rdts->getNumberOfLines()<<endl;
-   cout<<" numSamps = "<< rdts->getNumberOfSamples()<<endl;
-   cout<<" numDomes = "<< rdts->getNumRangeDomes()<<endl;
-
-   // Add LUT for visibility if requested:
-   if (!m_lutFile.empty())
-   {
-      if (m_lutFile == TEMP_LUT_FILE)
-      {
-         // Need to output default temporary LUT:
-         ofstream lutfs (m_lutFile.string().c_str(), ios_base::trunc);
-         if (lutfs.fail())
-         {
-            cout << "Could not write out temporary LUT file to CWD. Check permissions." << endl;
-            return false;
-         }
-         lutfs << lut << endl;
-         lutfs.close();
-      }
-
-      ossimRefPtr<ossimIndexToRgbLutFilter> lutFilter = new ossimIndexToRgbLutFilter();
-      lutFilter->connectMyInputTo(chain_head);
-      lutFilter->setLut(m_lutFile);
-      lutFilter->initialize();
-      chain_head = lutFilter.get();
-   }
-
-   // Set up the writer for results file:
-   ossimRefPtr<ossimTiffWriter> tiffWriter = new ossimTiffWriter();
-   tiffWriter->connectMyInputTo(chain_head);
-   tiffWriter->setFilename(m_resultsFile);
-   if (!tiffWriter->execute())
-   {
-      cout << "Could not write results file <"<<m_resultsFile<<">." << endl;
-      return false;
-   }
-
-   tiffWriter->close();
-   tiffWriter = 0;
-   handler = 0;
-
-   cout<<"\nTest completed. Output written to <"<<m_resultsFile<<">.\n"<<endl;
-   return true;
-}
-
-int main(int argc, char *argv[])
-{
-   ossimArgumentParser ap(&argc, argv);
-   ap.getApplicationUsage()->setApplicationName(argv[0]);
-   ossimInit::instance()->initialize(ap);
-
-   Executive* executive = new Executive(ap);
-   bool success = executive->run();
-   delete executive;
-
-   if (!success)
-      exit(1);
-
-   exit(0);
-}
-
-
diff --git a/ossim/src/test/ossim-rect-test.cpp b/ossim/src/test/ossim-rect-test.cpp
deleted file mode 100644
index 5a01061..0000000
--- a/ossim/src/test/ossim-rect-test.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-rect-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test app for ossimIrect and ossimDrect classes.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimDrect.h>
-#include <ossim/base/ossimIrect.h>
-
-#include <iostream>
-using namespace std;
-
-int main()
-{
-   // IRECTS:
-
-   // left handed irects
-   ossimIrect ir1(0, 0, 10, 10);
-   ossimIrect ir2(1, 1, 9, 9);
-   ossimIrect ir3 = ir1.clipToRect(ir2);
-   cout << "ossimIrect Left Handed:"
-        << "\nrect ir1:            " << ir1
-        << "\nrect ir2:            " << ir2
-        << "\nir1.clipToRect(ir2): " << ir3
-        << "\nexpected: ul=(1,1), ur=(9,1), lr=(9,9), ll=(1,9)\n\n";
-   
-   // right handed irects
-   ossimIrect ir4(0,10, 10,0,OSSIM_RIGHT_HANDED);
-   ossimIrect ir5(-5,8,14,1,OSSIM_RIGHT_HANDED);
-   ossimIrect ir6 = ir4.clipToRect(ir5);
-   cout << "ossimIrect Right Handed:"
-        << "\nrect ir4:          " << ir4
-        << "\nrect ir5:          " << ir5
-        << "\nd.clipToRect(e):   " << ir6
-        << "\nexpected: ul=(0,8), ur=(10,8), lr=(10,1), ll=(0,1)\n\n";
-
-   // DRECTS:
-
-   // left handed irects
-   ossimDrect dr1(0, 0, 10, 10);
-   ossimDrect dr2(1, 1, 9, 9);
-   ossimDrect dr3 = dr1.clipToRect(dr2);
-   cout << "ossimDrect Left Handed:"
-        << "\nrect dr1:            " << dr1
-        << "\nrect dr2:            " << dr2
-        << "\ndr1.clipToRect(dr2): " << dr3
-        << "\nexpected: ul=(1,1), ur=(9,1), lr=(9,9), ll=(1,9)\n\n";
-   
-   // right handed drects
-   ossimDrect dr4(0,10, 10,0,OSSIM_RIGHT_HANDED);
-   ossimDrect dr5(-5,8,14,1,OSSIM_RIGHT_HANDED);
-   ossimDrect dr6 = dr4.clipToRect(dr5);
-   cout << "ossimDrect Right Handed:"
-        << "\nrect dr4:          " << dr4
-        << "\nrect dr5:          " << dr5
-        << "\nd.clipToRect(e):   " << dr6
-        << "\nexpected: ul=(0,8), ur=(10,8), lr=(10,1), ll=(0,1)\n"
-        << endl;
-
-   return 0;
-}
-
-
diff --git a/ossim/src/test/ossim-ref-ptr-test.cpp b/ossim/src/test/ossim-ref-ptr-test.cpp
deleted file mode 100644
index b7561d4..0000000
--- a/ossim/src/test/ossim-ref-ptr-test.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application for ossimRefPtr class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-ref-ptr-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimReferenced.h>
-#include <ossim/init/ossimInit.h>
-
-// Referenced object.
-class Obj : public ossimReferenced
-{
-public:
-   Obj(){}
-   virtual ~Obj(){ cout << "~Obj..." << endl; }
-};
-
-// Owns a ref ptr.
-class Foo
-{
-public:
-   Foo() : m_refPtr(new Obj) {}
-   ~Foo() { m_refPtr = 0; }
-   ossimRefPtr<Obj>& getRefPtr() { return m_refPtr; }
-
-private:
-   ossimRefPtr<Obj> m_refPtr;
-};
-
-static void assignRefPtr(ossimRefPtr<Obj>& rp)
-{
-   rp = new Obj;
-}
-
-static ossimRefPtr<Obj> getRefPtr()
-{
-   return ossimRefPtr<Obj>(new Obj);
-}
-
-// Test app
-int main( /* int argc, char* argv[] */ )
-{
-   ossimInit::instance()->initialize();
-
-   Foo* f = new Foo;
-
-   cout << "count(1): " << f->getRefPtr()->referenceCount() << endl;
-
-   ossimRefPtr<Obj> rp = f->getRefPtr();
-
-   cout << "count(2): " << f->getRefPtr()->referenceCount() << endl;
-
-   delete f;  
-   f = 0;
-
-   cout << "count(1): " << rp->referenceCount() << endl;
-
-   rp = 0; // Should destroy here...
-
-   rp = 0;
-   assignRefPtr(rp);
-
-   if ( rp.valid() )
-   {
-      cout << "assignRefPtr rp count(1): " << rp->referenceCount() << endl;
-   }
-
-   rp = 0;
-
-   rp = getRefPtr();
-
-   if ( rp.valid() )
-   {
-      cout << "getRefPtr rp count(1): " << rp->referenceCount() << endl;
-   }
-   
-   
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-remap-table-test.cpp b/ossim/src/test/ossim-remap-table-test.cpp
deleted file mode 100644
index d6089ab..0000000
--- a/ossim/src/test/ossim-remap-table-test.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description: Test normalized remap table.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-remap-table-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-#include <iomanip>
-using namespace std;
-
-#include <ossim/base/ossimConstants.h>  // ossim contants...
-#include <ossim/imaging/ossimNormalizedS16RemapTable.h>
-#include <ossim/imaging/ossimNormalizedU16RemapTable.h>
-#include <ossim/imaging/ossimNormalizedU11RemapTable.h>
-#include <ossim/imaging/ossimNormalizedU8RemapTable.h>
-
-
-int main(int argc, char *argv[])
-{
-   cout << setiosflags(std::ios::fixed) << setprecision(15);
-
-   ossim_float64 n;
-   ossim_int32   p;
-   ossim_int32   i;
-   
-   cout << "//------------------------------------------\n"
-        << "// *** ossimNormalizedS16RemapTable test ***\n"
-        << "//------------------------------------------\n"
-        << endl;
-   
-   ossimNormalizedS16RemapTable s16tbl;
-   
-   i = -32768;
-   while (i < 32768)
-   {
-      n = s16tbl[i];
-      p = s16tbl.pixFromNorm(n);
-      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
-      ++i;
-   }
-
-   n = -0.1;
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-    
-   n = 0.0;
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.000000250; // Just above null pixel
-   p = s16tbl.pixFromNorm(n);
-   cout << "Just above null\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 0.000015250; // Slightly less than -32767
-   p = s16tbl.pixFromNorm(n);
-   cout << "Slightly less than -32767\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.0000152588; // -32767
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 0.000015258;  // Slightly bigger than -32767
-   p = s16tbl.pixFromNorm(n);
-   cout << "Slightly bigger than -32767\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.000030518043793; // -32766
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 0.0000305180436;  // Slightly to the left of -32766
-   p = s16tbl.pixFromNorm(n);
-   cout << "Slightly less than -32766\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.5;
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.999984740977; // Slightly less than 32766
-   p = s16tbl.pixFromNorm(n);
-   cout << "Slightly less than 32766\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.999984740978103; // 32766
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.99998474098; // Slightly greater than 32766
-   p = s16tbl.pixFromNorm(n);
-   cout << "Slightly greater than 32766\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 1.0;
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 1.1;
-   p = s16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   p = -32768;
-   n = s16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-   
-   p = -32767;
-   n = s16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 0;
-   n = s16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 32766.99999999999;
-   n = s16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 32767;
-   n = s16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 32768;
-   n = s16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   cout << "//------------------------------------------\n"
-        << "// *** ossimNormalizedU16RemapTable test ***\n"
-        << "//------------------------------------------\n"
-        << endl;
-   
-   ossimNormalizedU16RemapTable u16tbl;
-   
-   i = 0;
-   while (i < 65536)
-   {
-      n = u16tbl[i];
-      p = u16tbl.pixFromNorm(n);
-      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
-      ++i;
-   }
-
-   n = -0.1;
-   p = u16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-
-   n = 0.0;
-   p = u16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.001;
-   p = u16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.000000250; // Just above null pixel
-   p = u16tbl.pixFromNorm(n);
-   cout << "Just above null\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 1.0;
-   p = u16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 1.1;
-   p = u16tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   p = -1;
-   n = u16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 0;
-   n = u16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 1;
-   n = u16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 65534;
-   n = u16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 65535;
-   n = u16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 65536;
-   n = u16tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-      
-   cout << "\n\n//------------------------------------------\n"
-        << "// *** ossimNormalizedU11RemapTable test ***\n"
-        << "//------------------------------------------\n"
-        << endl;
-   
-   ossimNormalizedU11RemapTable u11tbl;
-   
-   i = 0;
-   while (i < 2048)
-   {
-      n = u11tbl[i];
-      p = u11tbl.pixFromNorm(n);
-      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
-      ++i;
-   }
-
-   n = -0.1;
-   p = u11tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-    
-   n = 0.0;
-   p = u11tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.00000852; // Just above null pixel
-   p = u11tbl.pixFromNorm(n);
-   cout << "Just above null\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.000;
-   p = u11tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = .000488519785; // Slightly less than 1
-   p = u11tbl.pixFromNorm(n);
-   cout << "Slightly less than 1\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.000488519785051; // 1
-   cout << "1\n";
-   p = u11tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.000488519786;  // Slightly bigger than 1
-   p = u11tbl.pixFromNorm(n);
-   cout << "Slightly bigger than 1\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.9995114802149; // Slightly less than 2046
-   p = u11tbl.pixFromNorm(n);
-   cout << "Slightly less than 2046\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.999511480214949; // 2046
-   p = u11tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.999511480215; // Slightly greater than 2046
-   p = u11tbl.pixFromNorm(n);
-   cout << "Slightly greater than 2046\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 1.0;
-   p = u11tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 1.1;
-   p = u11tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   p = -1;
-   n = u11tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-   
-   p = 0;
-   n = u11tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 2046;
-   n = u11tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 2047;
-   n = u11tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 2048;
-   n = u11tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   cout << "\n\n//------------------------------------------\n"
-        << "// *** ossimNormalizedU8RemapTable test ***\n"
-        << "//------------------------------------------\n"
-        << endl;
-   
-   ossimNormalizedU8RemapTable u8tbl;
-   
-   i = 0;
-   while (i < 256)
-   {
-      n = u8tbl[i];
-      p = u8tbl.pixFromNorm(n);
-      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
-      ++i;
-   }
-
-   n = -0.1;
-   p = u8tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-    
-   n = 0.0;
-   p = u8tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.00000625; // Just above null pixel
-   p = u8tbl.pixFromNorm(n);
-   cout << "Just above null\n";
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 0.001;
-   p = u8tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 1.0;
-   p = u8tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 1.1;
-   p = u8tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   n = 1.0;
-   p = u8tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-   
-   n = 1.1;
-   p = u8tbl.pixFromNorm(n);
-   cout << "pixFromNorm(" << n << "): " << p << "\n";
-
-   p = -1;
-   n = u8tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-   
-   p = 0;
-   n = u8tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 254;
-   n = u8tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 255;
-   n = u8tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-
-   p = 256;
-   n = u8tbl.normFromPix(p);
-   cout << "normFromPix(" << p << "): " << n << "\n";
-   
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-shift-filter-test.cpp b/ossim/src/test/ossim-shift-filter-test.cpp
deleted file mode 100644
index 287513c..0000000
--- a/ossim/src/test/ossim-shift-filter-test.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// File: ossim-viirs-proc
-//
-// Description: Application to extract VIIRS Radiance layer, shifting
-// min/max linearly to 16 bit space with coarse grid geometry file.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimMetadataInterface.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimStringProperty.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/imaging/ossimCastTileSourceFilter.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimShiftFilter.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/projection/ossimCoarseGridModel.h>
-#include <ossim/projection/ossimProjection.h>
-
-#include <iomanip>
-#include <iostream>
-#include <string>
-using namespace std;
-
-int main(int argc, char* argv[])
-{
-   int status = 0;
-
-   // Timer for elapsed time:
-   ossimTimer::instance()->setStartTick();
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc == 2 )
-   {
-      ossimFilename inputFile = argv[1];
-      if ( inputFile.exists() )
-      {
-         ossimFilename outputFile = inputFile.expand().noExtension();
-         outputFile.string() += "_1.tif";
-         
-         if ( inputFile != outputFile )
-         {
-            std::string command =
-               "ossim-cmm --null -9999.0 --reader-prop layer=/All_Data/VIIRS-DNB-SDR_All/Radiance ";
-            command += inputFile.string();
-            cout << "Executing command: " << command << endl;
-
-            status = system( command.c_str() );
-
-            if ( status == 0 )
-            {
-               ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
-               if ( sic->open( inputFile, false ) )
-               {
-                  cout << "Opened: " << inputFile << endl;
-
-                  // Set the entry to the Radiance layer.
-                  ossimRefPtr<ossimProperty> readerProp = new  ossimStringProperty(
-                     ossimString("layer"),
-                     ossimString("/All_Data/VIIRS-DNB-SDR_All/Radiance") );
-
-                  sic->getImageHandler()->setProperty( readerProp );
-
-                  // Add filter to shift/stretch data uint16 range.
-                  ossimRefPtr<ossimShiftFilter> sf = new ossimShiftFilter();
-                  sf->setNullPixelValue( 0.0 );
-                  sf->setMinPixelValue( 1.0 );
-                  sf->setMaxPixelValue( 65535.0 );
-                  sic->addFirst( sf.get() );
-
-                  // Cast it to uint16:
-                  ossimRefPtr<ossimCastTileSourceFilter> cf =
-                     new ossimCastTileSourceFilter(0, OSSIM_UINT16 );
-                  sic->addFirst( cf.get() );
-
-                  // Put a cache in front of resampler.
-                  sic->addCache();
-                  
-                  // sic->addResampler();
-                  
-                  sic->initialize();
-                  
-                  // Write image:
-                  ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
-                  if ( writer->open( outputFile ) )
-                  {
-                     // Turn on overviews and histograms:
-                     writer->setWriteOverviewFlag( true );
-                     writer->setWriteHistogramFlag( true );
-
-                     // Add a listener to get percent complete.
-                     ossimStdOutProgress prog(0, true);
-                     writer->addListener(&prog);
-                     
-                     writer->connectMyInputTo(0, sic.get());
-
-                     ossimIrect rect = writer->getAreaOfInterest();
-                     
-                     writer->execute();
-
-                     cout << "Wrote file: " << outputFile << endl;
-                     
-                     ossimRefPtr<ossimImageHandler> ih = sic->getImageHandler();
-
-                     if ( ih.valid() )
-                     {
-                        //---
-                        // If there is a coarse grid model write it out so the
-                        // oqutput file will pick it up.
-                        //---
-                        ossimRefPtr<ossimImageGeometry> geom = sic->getImageHandler()->
-                           getImageGeometry();
-                        if ( geom.valid() )
-                        {
-                           ossimRefPtr<ossimProjection> proj = geom->getProjection();
-                           if ( proj.valid() )
-                           {
-                              ossimRefPtr<ossimCoarseGridModel> cg =
-                                 dynamic_cast<ossimCoarseGridModel*>( proj.get() );
-                              if ( cg.valid() )
-                              {
-                                 ossimFilename geomFile = outputFile.noExtension();
-                                 geomFile.string() += ".geom";
-
-                                 // this saves geom file as well
-                                 cg->saveCoarseGrid( geomFile );
-                                 cout << "Wrote file: " << geomFile << endl;
-                              }
-                           }
-                        }
-
-                        //---
-                        // If the image handler is a metadata interface pass the metadata
-                        // to the dot.omd file and rewrite it.
-                        //---
-                        ossimMetadataInterface* mdi =
-                           dynamic_cast<ossimMetadataInterface*>( ih.get() );
-                        if ( mdi )
-                        {
-                           ossimFilename omdFile = outputFile.noExtension();
-                           omdFile += ".omd";
-                           ossimRefPtr<ossimKeywordlist> kwl = new ossimKeywordlist();
-                           if ( omdFile.exists() )
-                           {
-                              kwl->addFile( omdFile );
-                           }
-                           
-                           std::string prefix = "";
-                           mdi->addMetadata( kwl.get(), prefix );
-                           kwl->write( omdFile.c_str() );
-                           cout << "Wrote file: " << omdFile << endl;
-                        }
-                     }
-                  }
-                  else
-                  {
-                     cerr << "Could not open: " << outputFile << endl;
-                  }
-               }
-            }
-         } 
-         else // Matches: 
-         {
-            cerr << "Input file is same as output file!  Returning..." << endl;
-            status = -1;
-         }
-      }
-      else // Match: if ( inputFile.exists() ){ ... }
-      {
-         cerr << "Input file does not exists!" << endl;
-         status = -1;
-      }
-   }
-   else // Matches: if (argc == 2 ){ ... }
-   {
-      cout << argv[0] << " <image_file>"
-           << "\n\nExtracts VIIRS Radiance layer from hdf5 file, shifting min/max "
-           << "linearly to 16 bit space with coarse grid geometry file.\n" << endl;
-   }
-
-   cout << "Elapsed time in seconds: "
-        << std::setiosflags(ios::fixed)
-        << std::setprecision(3)
-        << ossimTimer::instance()->time_s() << "\n";
-
-   return status;
-}
-
diff --git a/ossim/src/test/ossim-single-image-chain-test.cpp b/ossim/src/test/ossim-single-image-chain-test.cpp
deleted file mode 100644
index 03563d1..0000000
--- a/ossim/src/test/ossim-single-image-chain-test.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application for ossimSingleImageChain class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-single-image-chain-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimImageHandler.h>
-#include <ossim/imaging/ossimImageRenderer.h>
-#include <ossim/imaging/ossimPiecewiseRemapper.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/init/ossimInit.h>
-#include <iomanip>
-#include <iostream>
-using namespace std;
-
-int main(int argc, char* argv[])
-{
-   ossimTimer::instance()->setStartTick();
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
-   
-   cout << "elapsed time after initialize(ms): "
-        << std::setiosflags(ios::fixed)
-        << std::setprecision(3)
-        << ossimTimer::instance()->time_s() << "\n";
-
-   if (argc < 2)
-   {
-      cout << argv[0] << "<image_file> <optional_output_file>"
-           << "\nOpens up single image chain and dumps the state to keyword"
-           << " list." << endl;
-      return 0;
-   }
-
-   ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      // Set up chain:
-      
-      if ( sic1->getImageHandler()->getNumberOfOutputBands() == 4 )
-      {
-         // Just guessing...
-         sic1->setThreeBandReverseFlag(true);
-      }
-               
-      // Always have resampler cache.
-      sic1->setAddResamplerCacheFlag(true);
-
-      // Histogram:
-      sic1->setAddHistogramFlag(true);
-
-      sic1->createRenderedChain();
-
-      // Histogram stretch:
-      if ( sic1->openHistogram(ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX) == false )
-      {
-         cout << "Could not do histogram stretch!" << endl;
-      }
-      
-      if (argc == 3)
-      {
-         // Write image:
-         ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
-         if ( writer->open( ossimFilename(argv[2]) ) )
-         {
-            cout << "Outputting file: " << ossimFilename(argv[2]) << endl;
-            
-            // Add a listener to get percent complete.
-            ossimStdOutProgress prog(0, true);
-            writer->addListener(&prog);
-
-            writer->connectMyInputTo(0, sic1.get());
-            writer->execute();
-            ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
-            cout << "elapsed time after write(ms): "
-                 << std::setiosflags(ios::fixed)
-                 << std::setprecision(3)
-                 << ossimTimer::instance()->time_s() << "\n";
-
-            cout << "write time minus initialize: "
-                 << std::setiosflags(ios::fixed)
-                 << std::setprecision(3)
-                 << ossimTimer::instance()->delta_s(t1, t2) << "\n";
-         }
-      }
-
-      ossimRefPtr<ossimImageGeometry> geom = sic1->getImageGeometry();
-      if (geom.valid())
-      {
-         geom->print(cout);
-      }
-
-      // Test the load state.
-      ossimKeywordlist kwl;
-      sic1->saveState(kwl, 0);
-
-      ossimSingleImageChain* sic2 = new ossimSingleImageChain();
-      sic2->loadState(kwl, 0);
-
-      kwl.clear();
-      sic2->saveState(kwl, 0);
-
-      cout << "\n\nSingle image chain from load state kwl\n" << kwl;
-   }
-
-   // Create a normal chain.
-   sic1 = new ossimSingleImageChain(true,  // addHistogramFlag
-                                    true,  // addResamplerCacheFlag
-                                    true,  // addChainCacheFlag
-                                    false, // remapToEightBitFlag
-                                    false, // threeBandFlag
-                                    false); // threeBandReverseFlag
-   
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      sic1->createRenderedChain();
-      ossimKeywordlist kwl;
-      sic1->saveState(kwl, 0);
-      cout << "\n\nNormal single image chain kwl\n" << kwl;
-   }
-
-   // Create a stripped down chain.
-   sic1 = new ossimSingleImageChain();
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      sic1->createRenderedChain();
-      ossimKeywordlist kwl;
-      sic1->saveState(kwl, 0);
-      cout << "\n\nSingle image chain stripped down kwl\n" << kwl;
-   }
-
-   // Create a rgb reversed chain.
-   sic1 = new ossimSingleImageChain();
-   if ( sic1->open( ossimFilename(argv[1]) ) )
-   {
-      sic1->setThreeBandReverseFlag(true);
-      sic1->createRenderedChain();
-      ossimKeywordlist kwl;
-      sic1->saveState(kwl, 0);
-      cout << "\n\nSingle image chain rgb reversed kwl\n" << kwl;
-   }
-
-   cout << "constness test:\n";
-   ossimRefPtr<const ossimSingleImageChain> consSic = sic1.get();
-   ossimRefPtr<const ossimImageHandler> ihConst =  consSic->getImageHandler();
-   cout << "image handler bands: " << ihConst->getNumberOfOutputBands() << endl;
-
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-single-image-chain-threaded-test.cpp b/ossim/src/test/ossim-single-image-chain-threaded-test.cpp
deleted file mode 100644
index 8d487cc..0000000
--- a/ossim/src/test/ossim-single-image-chain-threaded-test.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-single-image-chain-threaded-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application for ossimSingleImageChain with a
-// ossimMultiThreadSequencer.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-single-image-chain-threaded-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimCommon.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimRefPtr.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-#include <ossim/init/ossimInit.h>
-#include <ossim/parallel/ossimMultiThreadSequencer.h>
-
-int main(int argc, char* argv[])
-{
-   ossimTimer::instance()->setStartTick();
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
-   
-   cout << "elapsed time after initialize(ms): "
-        << ossimTimer::instance()->time_s() << "\n";
-
-   if (argc < 4)
-   {
-      cout << argv[0] << "<threads> <image_file> <output_file.tif>"
-           << "\nOpens up single image chain and writes to output_file using N threads."
-           << " list.\nNOTE: Hard wired tiff writer; hence, the output_file.tif." << endl;
-      return 0;
-   }
-
-   ossim_uint32  threads     = ossimString(argv[1]).toUInt32();
-   if ( threads == 0 )
-   {
-      threads = ossim::getNumberOfThreads();
-   }
-   ossimFilename image_file  = argv[2];
-   ossimFilename output_file = argv[3];
-
-   cout << "threads:     " << threads
-        << "\nimage_file:  " << image_file
-        << "\noutput_file: " << output_file
-        << "\n";
-   
-   ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
-   
-   if ( sic1->open( image_file ) )
-   {
-      sic1->createRenderedChain();
-
-      // Establish the MT sequencer:
-      ossimRefPtr<ossimMultiThreadSequencer> mts =
-         new ossimMultiThreadSequencer( sic1.get(), threads );
-
-      ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
-      writer->changeSequencer( mts.get() );
-      
-      if ( writer->open( output_file ) )
-      {
-         // Add a listener to get percent complete.
-         ossimStdOutProgress prog(0, true);
-         writer->addListener(&prog);
-
-         // Connect the chain to writer.
-         writer->connectMyInputTo(0, sic1.get());
-
-         // Write the file.
-         writer->execute();
-         
-         ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
-         cout << "elapsed time after write(ms): "
-              << std::setiosflags(ios::fixed)
-              << std::setprecision(3)
-              << ossimTimer::instance()->time_s() << "\n";
-         
-         cout << "write time minus initialize: "
-              << std::setiosflags(ios::fixed)
-              << std::setprecision(3)
-              << ossimTimer::instance()->delta_s(t1, t2) << "\n";
-      }
-   }
-
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-srtm-support-data-test.cpp b/ossim/src/test/ossim-srtm-support-data-test.cpp
deleted file mode 100644
index 71268e3..0000000
--- a/ossim/src/test/ossim-srtm-support-data-test.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//----------------------------------------------------------------------------
-// Copyright (C) 2005 David Burken, all rights reserved.
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test application / example code for srtm support data class.
-// and using it.
-//
-// $Id: ossim-srtm-support-data-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-//----------------------------------------------------------------------------
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/support_data/ossimSrtmSupportData.h>
-#include <ossim/base/ossimKeywordlist.h>
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 2)
-   {
-      cout << "usage:  " << argv[0] << " srtm_file" << endl;
-      return 0;
-   }
-
-   ossimSrtmSupportData sd;
-   if (sd.setFilename(ossimFilename(argv[1]), true))
-   {
-      cout << sd << endl;
-
-      ossimKeywordlist kwl;
-      sd.getImageGeometry(kwl);
-      cout << "geometry file:\n" << kwl << endl;
-   }
-   else
-   {
-      cout << "Could not open:  " << argv[1] << endl;
-   }
-   
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-tiff-info-test.cpp b/ossim/src/test/ossim-tiff-info-test.cpp
deleted file mode 100644
index f8128b3..0000000
--- a/ossim/src/test/ossim-tiff-info-test.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// Description: Test app for ossimTiffInfo class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-tiff-info-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/support_data/ossimTiffInfo.h>
-#include <ossim/support_data/ossimGeoTiff.h>
-
-
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 2)
-   {
-      cout << argv[0] << "<tiff_file>"
-           << "\nPrint dump and geometry info for tiff_file." << endl;
-      return 0;
-   }
-
-   cout << "ossimTiffInfo test:\n";
-   
-   ossimTiffInfo* info = new ossimTiffInfo();
-
-   if ( info->open( ossimFilename(argv[1]) ) )
-   {
-      cout << "ossimTiffInfo dump info:\n";
-      info->print(cout);
-
-      ossimKeywordlist kwl;
-      if ( info->getImageGeometry(kwl, 0) )
-      {
-         cout << "ossimTiffInfo geometry info:\n" << kwl << endl;
-      }
-      else
-      {
-         cout << "ossimTiffInfo get image geometry failed..." << endl;
-      }
-   }
-   else
-   {
-      cout << "Could not open: " << argv[1] << endl;
-   }
-
-   delete info;
-   info = 0;
-
-   cout << "ossimGeoTiff test:\n";
-   
-   ossimGeoTiff* gtif = new ossimGeoTiff();
-   if ( gtif->readTags(argv[1], 0) )
-   {
-      ossimKeywordlist kwl;
-      if ( gtif->addImageGeometry(kwl, 0) )
-      {
-         cout << "ossimGeoTiff geometry info:\n" << kwl << endl;
-      }
-      else
-      {
-         cout << "ossimGeoTiff get image geometry failed..." << endl;
-      }
-   }
-
-   delete gtif;
-   gtif = 0;
-
-   return 0;
-}
-
diff --git a/ossim/src/test/ossim-tiled-elevation-test.cpp b/ossim/src/test/ossim-tiled-elevation-test.cpp
deleted file mode 100644
index 1900049..0000000
--- a/ossim/src/test/ossim-tiled-elevation-test.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// File: ossim-tiled-elevation-test.cpp
-// 
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test application for ossimTiledElevationDatabase class.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-tiled-elevation-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/base/ossimException.h>
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimGpt.h>
-#include <ossim/base/ossimGrect.h>
-#include <ossim/base/ossimKeywordlist.h>
-#include <ossim/base/ossimNotify.h>
-#include <ossim/base/ossimStdOutProgress.h>
-#include <ossim/base/ossimString.h>
-#include <ossim/base/ossimTimer.h>
-#include <ossim/elevation/ossimElevManager.h>
-#include <ossim/elevation/ossimTiledElevationDatabase.h>
-#include <ossim/imaging/ossimImageGeometry.h>
-#include <ossim/imaging/ossimSingleImageChain.h>
-#include <ossim/imaging/ossimTiffWriter.h>
-
-#include <iostream>
-using namespace std;
-
-static void usage()
-{
-   cout << "ossim-tiled-elevation-test <elev-dir> <input-image> <output-image>"
-        << "\n\nCreates a ossimTiledElevationDatabase from elev-dir for the bounding box of\ninput-image and writes output-image in tiff format.\n\nThis test the ossimTiledElevationDatabase ability to map a region of interest\nand serve it up as an elevation source.  Since this is testing elevation, the\n\"input-image\" should have a projection affected by elevation.  In other words,\nsome type of sensor model." << endl;
-}
-
-int main(int argc, char *argv[])
-{
-   int result = 0;
-
-   ossimTimer::instance()->setStartTick();
-
-   // Turn off elevation initialization as we want to use ours.
-   ossimInit::instance()->setElevEnabledFlag(false);
-   
-   ossimInit::instance()->initialize(argc, argv);
-
-   cout << std::setiosflags(ios::fixed) << std::setprecision(3)
-        << "elapsed time after initialize: "
-        << ossimTimer::instance()->time_s() << "\n";
-   
-   if (argc == 4)
-   {
-      try // Exceptions can be thrown so 
-      {
-         ossimFilename elevDir     = argv[1];
-         ossimFilename inputImage  = argv[2];
-         ossimFilename outputImage = argv[3];
-         
-         cout << "elev-dir: " << elevDir << "\ninput-image: " << inputImage
-              << "\noutput-image: " << outputImage << "\n";
-         
-         ossimTiledElevationDatabase* elevdb = new ossimTiledElevationDatabase();
-         
-         ossimKeywordlist kwl;
-         kwl.setExpandEnvVarsFlag(true);
-         // kwl.add("connection_string", "$(OSSIM_DATA)/elevation/srtm/3arc");
-         kwl.add("connection_string", elevDir.c_str());
-         kwl.add("geoid.type", "geoid1996");
-         kwl.add("max_open_cells", "50");
-         kwl.add("memory_map_cells", "false");
-         kwl.add("min_open_cells", "25");
-         kwl.add("type", "ossimTiledElevationDatabase");
-         
-         if ( elevdb->loadState(kwl, 0) )
-         {
-            ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
-            sic1->setAddResamplerCacheFlag(true);
-            sic1->setAddChainCacheFlag(true);
-
-            // Open:
-            if ( sic1->open( inputImage ) )
-            {
-               // Get the geometry:
-               ossimRefPtr<ossimImageGeometry> geom = sic1->getImageGeometry();
-               
-               // Get the bounding rectangle:
-               ossimGrect boundingRect;
-               std::vector<ossimGpt> corner(4);
-               if ( geom->getCornerGpts(corner[0], corner[1], corner[2], corner[3]) )
-               {
-                  ossimGpt ulGpt(corner[0]);
-                  ossimGpt lrGpt(corner[0]);
-                  cout << "corner[0]: " << corner[0] << endl;
-                  for ( ossim_uint32 i = 1; i < 4; ++i )
-                  {
-                     cout << "corner[" << i << "]: " << corner[i] << endl;
-                     if ( corner[i].lon < ulGpt.lon ) ulGpt.lon = corner[i].lon;
-                     if ( corner[i].lat > ulGpt.lat ) ulGpt.lat = corner[i].lat;
-                     if ( corner[i].lon > lrGpt.lon ) lrGpt.lon = corner[i].lon;
-                     if ( corner[i].lat < lrGpt.lat ) lrGpt.lat = corner[i].lat;
-                  }
-
-                  //---
-                  // Add a padding to ensure no nans on edges:
-                  // Should check for wrap here but just test code.
-                  //---
-                  const ossim_float64 PADDING = 1.0/60.0; // one minute.
-                  ulGpt.lon -= PADDING;
-                  ulGpt.lat += PADDING;
-                  lrGpt.lon += PADDING;
-                  lrGpt.lat -= PADDING;
-                  cout << "ulGpt: " << ulGpt
-                       << "\nlrGpt: " << lrGpt
-                       << endl;
-                  boundingRect = ossimGrect(ulGpt, lrGpt);
-               }
-               else
-               {
-                  boundingRect.makeNan();
-               }
-               
-               if ( boundingRect.isLonLatNan() == false )
-               {
-                  // Create the chain:
-                  sic1->createRenderedChain();
-                  
-                  cout << "boundingRect: " << boundingRect << endl;
-                  elevdb->mapRegion(boundingRect);
-
-                  cout << std::setiosflags(ios::fixed) << std::setprecision(3)
-                       << "elapsed time after mapping elevation: "
-                       << ossimTimer::instance()->time_s() << "\n";
-
-                  cout << "ossimTiledElevationDatabase::getMeanSpacingMeters: "
-                       << elevdb->getMeanSpacingMeters() << "\n";
-                  
-                  cout << "mappedRect: " << elevdb->getBoundingGndRect() << endl;
-                  ossimElevManager::instance()->setDefaultHeightAboveEllipsoid(0.0);
-                  ossimElevManager::instance()->setUseGeoidIfNullFlag(true);
-                  ossimElevManager::instance()->addDatabase(elevdb);
-
-#if 0
-                  // 35.821992089329882, 51.437673634967858
-                  // Height: 1874.649761970292 MSL: 1871.642024320508
-                  ossimGpt pt1(35.821992089329882, 51.437673634967858);
-                  ossimGpt pt2(35.843333333333334, 51.373333333333335);
-                  ossimGpt pt3(35.694166666666668, 51.598333333333336);
-
-                  cout << "getHeightAboveEllipsoid(35.821992089329882, 51.437673634967858): "
-                       << ossimElevManager::instance()->getHeightAboveEllipsoid(pt1)
-                       << "\ngetHeightAboveEllipsoid(35.843333333333334, 51.373333333333335): "
-                       << ossimElevManager::instance()->getHeightAboveEllipsoid(pt2)
-                       << "\ngetHeightAboveEllipsoid(35.694166666666668, 51.598333333333336): "
-                       << ossimElevManager::instance()->getHeightAboveEllipsoid(pt3) << endl;
-#endif
-                  
-                  ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
-                  if ( writer->open( outputImage ) )
-                  {
-                     // Add a listener to get percent complete.
-                     ossimStdOutProgress prog(0, true);
-                     writer->addListener(&prog);
-                     
-                     writer->connectMyInputTo(0, sic1.get());
-                     writer->execute();
-                     cout << std::setiosflags(ios::fixed) << std::setprecision(3)
-                          << "elapsed time in seconds: "
-                          << ossimTimer::instance()->time_s() << "\n";
-                  }
-                  else
-                  {
-                    cout << "Could not open: " << outputImage << endl;
-                  }
-               }
-               else
-               {
-                  cout << "bounding box for " << inputImage << " has nans...\n";
-               }
-               
-            } // if ( sic1->open( inputImage) ) )
-            else
-            {
-               cout << "Could not open: " << inputImage << endl;
-            }
-            
-            // ossimDrect boundingRect = elevdb->getBounding
-         }
-
-            
-      }
-      catch( const ossimException& e )
-      {
-         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
-         result = 1;
-      }
-   }
-   else
-   {
-      usage();
-   }
-   return result;
-}
-
-
diff --git a/ossim/src/test/ossim-wavelength-test.cpp b/ossim/src/test/ossim-wavelength-test.cpp
deleted file mode 100644
index cbe06f6..0000000
--- a/ossim/src/test/ossim-wavelength-test.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Description:
-//
-// Test app for ossimWavelength class.
-// 
-//----------------------------------------------------------------------------
-// $Id$
-
-#include <ossim/init/ossimInit.h>
-#include <ossim/support_data/ossimEnviHeader.h>
-#include <ossim/support_data/ossimWavelength.h>
-
-#include <iostream>
-#include <vector>
-using namespace std;
-
-static void usage()
-{
-   cout << "\nUsage:\nossim-wavelength-test <envi-header-file> <wavelength> <threshold_from_center>"
-        << "\nWill output found closest index and wavelength."
-        << "Note: Units in nanometers"
-        << "\nContents of minimal header file:"
-        << "\nwavelength units = Nanometers"
-        << "\nwavelength = {374.323608,  382.530487,  390.737427,  398.944336,  407.150970}"
-        << "\n" << endl;
-}
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 4)
-   {
-      usage();
-      return 0;
-   }
-
-   ossimFilename hdrFile                   = argv[argc - 3];
-   ossimString   waveLengthString          = argv[argc - 2];
-   ossimString   thresholdFromCenterString = argv[argc - 1];
-   ossim_float64 wavelength                = waveLengthString.toFloat64();
-   ossim_float64 thresholdFromCenter       = thresholdFromCenterString.toFloat64();
-   
-
-   cout << "header file: " << hdrFile
-        << "\nwavelength:  " << waveLengthString
-        << "\nthreshold from center: " << thresholdFromCenterString
-        << "\n";
-
-   if ( hdrFile.exists() )
-   {
-      ossimEnviHeader hdr;
-      if ( hdr.open( hdrFile ) )
-      {
-         ossimWavelength wl;
-         if ( wl.initialize( hdr ) )
-         {
-            cout << "\nossimWavelength::getRgbBands returned:\n";
-            std::vector<ossim_uint32> bands;
-            ossim_uint32 band = 0;
-            if ( wl.getRgbBands( bands ) )
-            {
-               std::vector<ossim_uint32>::const_iterator i = bands.begin();
-               while ( i != bands.end() )
-               {
-                  cout << "band[" << band << "]: " << (*i) << "\n";
-                  ++band;
-                  ++i;
-               }
-            }
-            else
-            {
-               cout << "error...\n";
-            }
-
-            cout << "\nossimWavelength::findClosestIterator(...) returned:\n";
-            ossimWavelength::WavelengthMap::const_iterator i =
-               wl.findClosestIterator( wavelength, thresholdFromCenter );
-            if ( i != wl.end() )
-            {
-               cout << "(*i).first: " << (*i).first << " (*i).second: " << (*i).second << "\n";
-            }
-            else
-            {
-               cout << "error...\n";
-            }
-
-            cout << "\nossimWavelength::findClosestIndex(...) returned:\n";
-            ossim_int32 index = wl.findClosestIndex( wavelength, thresholdFromCenter );
-            if ( index > -1 )
-            {
-               cout << "index: " << index << "\n";
-            }
-            else
-            {
-               cout << "error...\n";
-            }
-
-
-            
-         }
-         else
-         {
-            cerr << "ossimWavelength::initialize( ossimEnviHeader ) failed!" << endl;
-         }
-      }
-      else
-      {
-         cout << "Could not open: " << hdrFile << endl;
-      }
-   }
-   else
-   {
-      cerr << "File: " << hdrFile << "\nDoes not exists!" << endl;
-      usage();
-   }
-   cout << endl;
-   
-   return 0;
-   
-} // End of main...
-
-
diff --git a/ossim/src/test/ossim-xml-test.cpp b/ossim/src/test/ossim-xml-test.cpp
deleted file mode 100644
index 8c41a81..0000000
--- a/ossim/src/test/ossim-xml-test.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//----------------------------------------------------------------------------
-//
-// License: MIT
-// 
-// See LICENSE.txt file in the top level directory for more details.
-//
-// Author:  David Burken
-//
-// XML functions test.
-// 
-//----------------------------------------------------------------------------
-// $Id: ossim-xml-test.cpp 23664 2015-12-14 14:17:27Z dburken $
-
-#include <iostream>
-using namespace std;
-
-#include <ossim/base/ossimFilename.h>
-#include <ossim/base/ossimXmlDocument.h>
-#include <ossim/init/ossimInit.h>
-
-int main(int argc, char *argv[])
-{
-   ossimInit::instance()->initialize(argc, argv);
-
-   if (argc != 2)
-   {
-      cout << "usage: " << argv[0] << " <xml_file>" << endl;
-      return 0;
-   }
-   
-   ossimFilename f = argv[1];
-
-   cout << "file: " << f << endl;
-
-   ossimXmlDocument* xdoc = new ossimXmlDocument();
-   if ( xdoc->openFile(f) )
-   {
-      cout << "opened..." << endl;
-   }
-   else
-   {
-      cout << "not opened..." << endl;
-   }
-   
-   delete xdoc;
-
-   return 0;
-}
-
diff --git a/ossim_header.txt b/ossim_header.txt
new file mode 100644
index 0000000..4729762
--- /dev/null
+++ b/ossim_header.txt
@@ -0,0 +1,7 @@
+/*****************************************************************************
+*                                                                            *
+*                                 O S S I M                                  *
+*            Open Source, Geospatial Image Processing Project                *
+*          License: MIT, see LICENSE at the top-level directory              *
+*                                                                            *
+*****************************************************************************/
diff --git a/scripts/archive.sh b/scripts/archive.sh
new file mode 100755
index 0000000..cf2b38c
--- /dev/null
+++ b/scripts/archive.sh
@@ -0,0 +1,237 @@
+#!/bin/bash
+
+#---
+# File: archive.sh
+# 
+# Description: Convenience script to create a tar ball suitable for rpmbuild.
+# This script will create a tarball, e.g. ossim-1.9.0.tar.gz 
+# from a the top level set of ossim git modules, i.e. ossim_labs_dev_root.
+#---
+pushd `dirname $0` >/dev/null
+export SCRIPT_DIR=$PWD
+popd >/dev/null
+pushd $SCRIPT_DIR/../.. > /dev/null
+export OSSIM_DEV_HOME=$PWD
+popd >/dev/null
+
+if [ $# -ne 6 ]
+then
+  echo "Usage:    $(basename $0) <remote_url> <output_dir> <version> <branch> <path_to_kakadu_source> <path_to_mrsid_code"
+  echo "Example:  $(basename $0) https://github.com/ossimlabs ossimlabs-1.9.0 1.9.0 dev ~/code/kakadu/v7_7_1-01123C"
+  echo "Where:    ossimlabs-1.9.0 is directory to put archived files and tar ball."
+  echo -n "Creates:  ossim-1.9.0.tar.gz and ossim-kakadu-plugin-1.9.0.tar.gz suitable for building rpms with "
+  echo "rpmbuild."
+  exit 1
+fi
+
+remote=$1
+output_dir=$2
+version=$3
+branch=$4
+kakadu_src=$5
+mrsid_code=$6
+
+archive="ossim-${version}"
+kakadu_archive="ossim-kakadu-plugin-${version}"
+mrsid_archive="ossim-mrsid-plugin-${version}"
+
+echo "remote:         $remote"
+echo "output_dir      $output_dir"
+echo "version:        $version"
+echo "branch:         $branch"
+echo "kakadu_src:     $kakadu_src"
+echo "mrsid_code:     $mrsid_code"
+echo "archive:        $archive"
+echo "kakadu_archive: $kakadu_archive"
+echo "mrsid_archive:  $mrsid_archive"
+
+echo ""
+
+while true; do
+   read -p "Continue? [y/n] " yn
+   case $yn in
+      [Yy]* ) break;;
+      [Nn]* ) exit;;
+          * ) echo "Please answer yes or no.";;
+   esac
+done
+
+if [ ! -d $output_dir ]; then
+   command="mkdir -p $output_dir"
+   echo $command
+   $command
+
+   if [ ! -d $output_dir ]; then
+      echo "Could not create: $output_dir"
+      exit
+   fi
+
+   if [ ! -d $output_dir/$archive ]; then
+      command="mkdir -p $output_dir/$archive"
+      echo $command
+      $command
+
+      if [ ! -d $output_dir/$archive ]; then
+         echo "Could not create: $output_dir/$archive"
+         exit
+      fi
+   fi
+fi
+
+
+function archiveModule()
+{
+   dir=$(pwd)
+   module=$1
+
+   cd $output_dir/$archive
+
+   if [ -d $module ]; then
+      command="rm -rf $module"
+      echo $command
+      $command
+   fi
+
+   command="svn export ${remote}/${module}/branches/${branch} $module"
+   echo $command
+   $command
+
+   cd $dir
+}
+
+function createOssimTarball()
+{
+   if [ -d $output_dir ]; then
+
+      dir=$(pwd)
+      cd $output_dir
+
+      # Make the tarball for main ossim rpm:
+      tar cvzf $archive.tar.gz $archive
+      if [ -f $archive.tar.gz ]; then
+         echo "wrote file: $output_dir/$archive.tar.gz"
+      else
+         echo "Error creating ossim tar file!"
+      fi
+
+      cd $dir
+   fi
+}
+
+function createKakaduTarball()
+{
+   if [ -d $output_dir ]; then
+      
+      dir=$(pwd)
+      cd $output_dir
+
+      # Make the tarball for kakadu rpm:
+      if [ -d $kakadu_archive ]; then
+         command="rm -rf $kakadu_archive"
+         echo $command
+         $command
+      fi
+
+      command="mkdir $kakadu_archive"
+      echo $command
+      $command
+
+      if [ ! -d $kakadu_archive ]; then
+         echo "Could not create: $dir"
+         exit
+      fi
+
+      # cmake modules:
+      command="cp -r $archive/ossim/cmake/CMakeModules $kakadu_archive/."
+      echo $command
+      $command
+
+      # ossim-plugins/kakadu code:
+      command="cp -r $archive/ossim-plugins/kakadu $kakadu_archive/."
+      echo $command
+      $command
+
+      # Kakadu source:
+      command="cp -r $kakadu_src $kakadu_archive/kakadu_src"
+      echo $command
+      $command
+   
+      tar cvzf ${kakadu_archive}.tar.gz $kakadu_archive
+      if [ -f $kakadu_archive.tar.gz ]; then
+         echo "wrote file: $output_dir/${kakadu_archive}.tar.gz"
+      else
+         echo "Error creating kakadu tar file!"
+      fi
+      
+      cd $dir
+   fi
+}
+
+function createMrsidTarball()
+{
+   if [ -d $output_dir ]; then
+      
+      dir=$(pwd)
+      cd $output_dir
+
+      # Make the tarball for mrsid rpm:
+      if [ -d $mrsid_archive ]; then
+         command="rm -rf $mrsid_archive"
+         echo $command
+         $command
+      fi
+
+      command="mkdir $mrsid_archive"
+      echo $command
+      $command
+
+      command="mkdir $mrsid_archive/mrsid_code"
+      echo $command
+      $command
+
+      if [ ! -d $mrsid_archive ]; then
+         echo "Could not create: $dir"
+         exit
+      fi
+
+      # cmake modules:
+      command="cp -r $archive/ossim/cmake/CMakeModules $mrsid_archive/."
+      echo $command
+      $command
+
+      # ossim-plugins/mrsid code:
+      command="cp -r $archive/ossim-plugins/mrsid $mrsid_archive/."
+      echo $command
+      $command
+
+      # Mrsid source:
+      command="cp -r $mrsid_code/* $mrsid_archive/mrsid_code/."
+      echo $command
+      $command
+   
+      tar cvzf ${mrsid_archive}.tar.gz $mrsid_archive
+      if [ -f $mrsid_archive.tar.gz ]; then
+         echo "wrote file: $output_dir/${mrsid_archive}.tar.gz"
+      else
+         echo "Error creating mrsid tar file!"
+      fi
+      
+      cd $dir
+   fi
+}
+
+
+archiveModule ossim
+archiveModule ossim-gui
+archiveModule ossim-oms
+archiveModule ossim-planet
+archiveModule ossim-plugins
+archiveModule ossim-video
+archiveModule ossim-wms
+archiveModule ossim-GoCD
+createOssimTarball
+createKakaduTarball
+createMrsidTarball
+
+# End of script:
+exit
diff --git a/scripts/build-dependencies.sh b/scripts/build-dependencies.sh
new file mode 100755
index 0000000..78e7704
--- /dev/null
+++ b/scripts/build-dependencies.sh
@@ -0,0 +1,741 @@
+#!/bin/bash
+#===========================================================================================
+#
+# Script to download, build, and install (as a sandbox), all OSSIM dependencies in an 
+# interactive fashion.
+#
+#===========================================================================================
+
+# Working directory must be top-level dir:
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+pushd $SCRIPT_DIR/../..
+OSSIM_DEV_HOME=$PWD
+
+if [ $# -ne 2 ]
+then
+  echo "Usage: `basename $0` <ossim_install_prefix> <config_dir>"
+  exit 1
+fi
+
+OSSIM_INSTALL_PREFIX=$2
+if [ -z "$OSSIM_INSTALL_PREFIX" ]; then
+   echo "OSSIM_INSTALL_PREFIX environment variable is not set!  Exiting..."
+   exit 1
+fi
+
+CONFIG_DIR=$3
+if [ -z "$CONFIG_DIR" ]; then
+   echo "CONFIG_DIR environment variable is not set!  Exiting..."
+   exit 1
+fi
+
+OS=linux
+THREADS=4
+
+# Whether or not to clean package before building.
+CLEAN=0
+
+echo "OSSIM_DEV_HOME:       $OSSIM_DEV_HOME"
+echo "OSSIM_INSTALL_PREFIX: $OSSIM_INSTALL_PREFIX"
+echo "CONFIG_DIR:           $CONFIG_DIR"
+echo "CLEAN flag:           $CLEAN"
+echo ""
+
+while true; do
+   read -p "Continue? [y/n] " yn
+   case $yn in
+      [Yy]* ) break;;
+      [Nn]* ) exit;;
+          * ) echo "Please answer yes or no.";;
+   esac
+done
+
+# Export for cmake scripts:
+export OSSIM_DEV_HOME
+export OSSIM_INSTALL_PREFIX
+export CONFIG_DIR
+
+#---
+# Dependency links:
+# Last updated: 10 June 2015
+#---
+CMAKE_BASE=cmake-3.2.3
+CMAKE_URL=http://www.cmake.org/files/v3.2/$CMAKE_BASE.tar.bz2
+
+FFMPEG_BASE=ffmpeg-2.4.10
+FFMPEG_URL=http://ffmpeg.org/releases/$FFMPEG_BASE.tar.bz2
+
+GDAL_BASE=gdal-1.11.2
+GDAL_URL=http://download.osgeo.org/gdal/1.11.2/$GDAL_BASE.tar.gz
+
+GEOS_BASE=geos-3.4.2
+GEOS_URL=http://download.osgeo.org/geos/$GEOS_BASE.tar.bz2
+
+GEOTIFF_BASE=libgeotiff-1.4.1
+GEOTIFF_URL=http://download.osgeo.org/geotiff/libgeotiff/$GEOTIFF_BASE.tar.gz
+
+GIT_BASE=git-1.8.5.2
+GIT_URL=http://git-core.googlecode.com/files/$GIT_BASE.tar.gz
+
+# HDF4_BASE=hdf-4.2.10
+# HDF4_URL=http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/$HDF4_BASE.tar.gz
+
+HDF5_BASE=hdf5-1.8.15-patch1
+HDF5_URL=http://www.hdfgroup.org/ftp/HDF5/current/src/$HDF5_BASE.tar.gz
+
+LIBJPEG_TURBO_BASE=libjpeg-turbo-1.4.1
+LIBJPEG_TURBO_URL=http://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-1.4.1.tar.gz
+
+OSG_BASE=OpenSceneGraph-3.2.0
+OSG_URL=http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip
+
+OSSIM_BASE_URL=https://svn.osgeo.org/ossim/trunk
+# OSSIM_BASE_URL=https://svn.osgeo.org/ossim/branches/v1.8.18
+
+PODOFO_BASE=podofo-0.9.2
+PODOFO_URL=http://downloads.sourceforge.net/podofo/$PODOFO_BASE.tar.gz
+
+PROJ_BASE=proj-4.8.0
+PROJ_URL=http://download.osgeo.org/proj/$PROJ_BASE.tar.gz
+
+SZIP_BASE=szip-2.1
+SZIP_URL=http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/$SZIP_BASE.tar.gz
+
+TIFF_BASE=tiff-4.0.3
+TIFF_URL=http://download.osgeo.org/libtiff/$TIFF_BASE.tar.gz
+
+ZLIB_BASE=zlib-1.2.8
+ZLIB_URL=http://zlib.net/$ZLIB_BASE.tar.gz
+
+# Install useful system utilities:
+
+YUM_CMD=$(which yum)
+APT_GET_CMD=$(which apt-get)
+
+answer=
+echo -n "Install common system packages (must have sudo priveledges) [y/N]: "
+read answer
+if [ "$answer" == 'y' ]; then
+  packages="aspell automake cmake cvs expat-devel freeglut-devel freetype-devel gcc-c++ gcc-gfortran git libcurl-devel libjpeg-turbo-devel libxml2-devel minizip-devel openssl openssl-devel qt-devel subversion xemacs xemacs-common xemacs-info xemacs-muse xemacs-packages-base xemacs-packages-extra yasm zlib-devel"
+  if [[ ! -z $YUM_CMD ]]; then
+    sudo yum install $packages
+  elif [[ ! -z $APT_GET_CMD ]]; then
+    sudo apt-get install $packages
+  else
+    echo "Cannot determine system install mechanism (expected yum or apt-get). You'll need to install them manually."; echo
+  fi
+  if [ $? -ne 0 ]; then
+    echo "Error encountered during package installs. You'll need to install them manually."; echo
+  fi
+fi
+
+
+#---
+# Functions:
+#----
+# automake ./configure build:
+function buildPackage()
+{
+   if [ -n $1 ]; then
+      pkg=$1 # package
+ 
+      if [ -d $OSSIM_DEV_HOME/$pkg/latest ]; then
+
+         cd $OSSIM_DEV_HOME/$pkg/latest          
+       
+         # Check for previous build:
+         if [ -f $OSSIM_DEV_HOME/$pkg/latest/Makefile ]; then
+            if [ $CLEAN -eq 1 ]; then
+               command="make clean"
+               echo $command
+               $command
+            else
+               echo "clean disabled..."
+            fi
+         fi
+
+         CONFIG_FILE=$pkg-automake-config.sh
+
+         if [ ! -f $OSSIM_DEV_HOME/$pkg/latest/$CONFIG_FILE ]; then
+            command="cp $CONFIG_DIR/$CONFIG_FILE $OSSIM_DEV_HOME/$pkg/latest/."
+            echo $command
+            $command
+         fi
+       
+         if [ -f $CONFIG_FILE ]; then
+      
+            ./$CONFIG_FILE
+
+            # Some packages getting bad builds with threads...
+            command="make -j $THREADS"
+            # command="make"
+            echo $command
+            $command
+
+            command="make install"
+            echo $command
+            $command
+
+         else
+            echo "Missing file: $OSSIM_DEV_HOME/$pkg/${pkg}-automake-config.sh"
+            exit 1
+         fi
+
+         cd $OSSIM_DEV_HOME
+
+      else
+         echo "No directory: $OSSIM_DEV_HOME/$pkg/latest"
+         exit 1
+      fi
+
+   fi
+}
+
+function buildCmakePackage()
+{
+   if [ -n $1 ]; then
+
+      pkg=$1 # package
+      build_dir=$OSSIM_DEV_HOME/build/build_$pkg
+    
+      if [ ! -d $build_dir ]; then
+         command="mkdir -p $build_dir"
+         echo $command
+         $command
+      fi
+       
+      if [ -d $build_dir ]; then
+
+         cd $build_dir
+
+         if [ -f $build_dir/Makefile ]; then
+            if [ $CLEAN -eq 1 ]; then
+               command="make clean"
+               echo $command
+               $command
+            else
+               echo "clean disabled..."
+            fi
+         fi
+
+         if [ -f $build_dir/CMakeCache.txt ]; then
+            command="rm $build_dir/CMakeCache.txt"
+            echo $command
+            $command
+         fi
+    
+         if [ -f $CONFIG_DIR/$pkg-cmake-config.sh ]; then
+
+            command="$CONFIG_DIR/$pkg-cmake-config.sh"
+            echo $command
+            $command
+
+            command="make -j $THREADS"
+            echo $command
+            $command
+
+            command="make install"
+            echo $command
+            $command
+
+            cd $OSSIM_DEV_HOME
+         else
+            echo "Missing file: $CONFIG_DIR/$pkg-cmake-config.sh"
+            exit 1
+         fi
+      else
+         echo "No directory: $OSSIM_DEV_HOME/$pkg/build"
+         exit 1
+      fi
+   else
+      echo "buildCmakePackage ERROR no package arg!!!"
+   fi
+}
+
+function checkoutPackages()
+{
+   #---
+   # Some old OS's don't have git so do this first:
+   #---
+   GIT_CMD=$(which git)
+   if [[ ! -z $GIT_CMD ]]; then
+     echo -n "Check out and build git[y/n]: "
+     read answer
+     if [ "$answer" == 'y' ]; then
+        echo "git..."
+        cd $OSSIM_DEV_HOME
+        mkdir -p $OSSIM_DEV_HOME/git
+        cd $OSSIM_DEV_HOME/git
+        wget $GIT_URL
+        tar xvzf $GIT_BASE.tar.gz
+        ln -s  $GIT_BASE latest
+        buildPackage git
+        cd $OSSIM_DEV_HOME
+     fi
+   fi
+
+   #---
+   # Set the path:
+   #---
+   echo -n "Add $OSSIM_INSTALL_PREFIX to path for this script[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      export PATH=$OSSIM_INSTALL_PREFIX:$PATH
+      echo "New path: $PATH"
+   fi
+
+   #---
+   # Some old OS's don't have cmake so do this second:
+   #---
+   echo -n "Check out cmake[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "cmake..."
+      cd $OSSIM_DEV_HOME
+      mkdir -p $OSSIM_DEV_HOME/cmake
+      cd $OSSIM_DEV_HOME/cmake
+      # git clone git://cmake.org/cmake.git cmake-git
+      wget $CMAKE_URL
+      bunzip2 $CMAKE_BASE.tar.bz2
+      tar xvf $CMAKE_BASE.tar
+      ln -s  $CMAKE_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out ffmpeg[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+
+      echo "ffmpeg..."
+      cd $OSSIM_DEV_HOME
+      mkdir -p $OSSIM_DEV_HOME/ffmpeg
+      # git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg-git
+      cd $OSSIM_DEV_HOME/ffmpeg
+      wget $FFMPEG_URL
+      bunzip2 $FFMPEG_BASE.tar.bz2
+      tar xvf $FFMPEG_BASE.tar
+      ln -s  $FFMPEG_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out gdal[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "gdal..."
+      mkdir -p $OSSIM_DEV_HOME/gdal
+      cd $OSSIM_DEV_HOME/gdal
+      # svn co  http://svn.osgeo.org/gdal/trunk/gdal gdal-svn
+      wget $GDAL_URL
+      tar xvzf $GDAL_BASE.tar.gz
+      ln -s $GDAL_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out geos[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "geos..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_geos
+      mkdir -p $OSSIM_DEV_HOME/geos
+      cd $OSSIM_DEV_HOME/geos
+      wget $GEOS_URL
+      bunzip2 $GEOS_BASE.tar.bz2
+      tar xvf $GEOS_BASE.tar
+      ln -s $GEOS_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out geotiff[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "geotiff..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_geotiff
+      mkdir -p $OSSIM_DEV_HOME/geotiff
+      cd $OSSIM_DEV_HOME/geotiff
+      wget $GEOTIFF_URL
+      tar xvzf $GEOTIFF_BASE.tar.gz
+      ln -s $GEOTIFF_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out hdf4[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "hdf4..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_hdf4
+      mkdir -p $OSSIM_DEV_HOME/hdf4
+      cd $OSSIM_DEV_HOME/hdf4
+      wget $HDF4_URL
+      tar xvzf $HDF4_BASE.tar.gz
+      ln -s $HDF4_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out hdf5[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "hdf5..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_hdf5
+      mkdir -p $OSSIM_DEV_HOME/hdf5
+      cd $OSSIM_DEV_HOME/hdf5
+      wget $HDF5_URL
+      tar xvzf $HDF5_BASE.tar.gz
+      ln -s $HDF5_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out libjpeg-turbo[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "geotiff..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_libjpeg-turbo
+      mkdir -p $OSSIM_DEV_HOME/libjpeg-turbo
+      cd $OSSIM_DEV_HOME/libjpeg-turbo
+      wget $LIBJPEG_TURBO_URL
+      tar xvzf $LIBJPEG_TURBO_BASE.tar.gz
+      ln -s $LIBJPEG_TURBO_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   answer=
+   echo -n "Check out libwms[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossimwms..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/libwms libwms
+   fi
+
+   answer=
+   echo -n "Check out omar[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "git clone omar..."
+      cd $OSSIM_DEV_HOME
+      git clone https://github.com/radiantbluetechnologies/omar.git omar
+   fi
+
+   answer=
+   echo -n "Check out oms[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co oms..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/oms oms
+   fi
+
+   echo -n "Check out OpenSceneGraph[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "geos..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_osg
+      mkdir -p $OSSIM_DEV_HOME/osg
+      cd $OSSIM_DEV_HOME/osg
+      wget $OSG_URL
+      unzip $OSG_BASE.zip
+      ln -s $OSG_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   answer=
+   echo -n "Check out ossim[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossim..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossim ossim
+   fi
+
+   answer=
+   echo -n "Check out ossimGui[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossimGui..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossimGui ossimGui
+   fi
+
+   answer=
+   echo -n "Check out ossimjni[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossimjni..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossimjni ossimjni
+   fi
+
+   answer=
+   echo -n "Check out ossim_junkyard[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossimjunkyard..."
+      cd $OSSIM_DEV_HOME
+      svn co https://svn.osgeo.org/ossim/ossim_junkyard ossim_junkyard
+   fi
+
+   answer=
+   echo -n "Check out ossimPlanet[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossimPlanet..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossimPlanet ossimPlanet
+   fi
+
+   answer=
+   echo -n "Check out ossimPlanetQt[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossimPlanetQt..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossimPlanetQt ossimPlanetQt
+   fi
+
+   answer=
+   echo -n "Check out ossimPredator[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossimPredator..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossimPredator ossimPredator
+   fi
+
+   answer=
+   echo -n "Check out ossim_package_support[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossim_package_support..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossim_package_support ossim_package_support
+   fi
+
+   answer=
+   echo -n "Check out ossim_plugins[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossim_plugins..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossim_plugins ossim_plugins
+   fi
+
+   answer=
+   echo -n "Check out ossim_qt4[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co ossim_qt4..."
+      cd $OSSIM_DEV_HOME
+      svn co $OSSIM_BASE_URL/ossim_qt4 ossim_qt4
+   fi
+
+   echo -n "Check out pdal[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "pdal..."
+      cd $OSSIM_DEV_HOME
+      mkdir -p $OSSIM_DEV_HOME/pdal
+      cd $OSSIM_DEV_HOME/pdal
+      git clone https://github.com/PDAL/PDAL.git pdal-git
+      ln -s pdal-git latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out podofo[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "szip..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_podofo
+      mkdir -p $OSSIM_DEV_HOME/podofo
+      cd $OSSIM_DEV_HOME/podofo
+      wget $PODOFO_URL
+      tar xvzf $PODOFO_BASE.tar.gz
+      ln -s $PODOFO_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   answer=
+   echo -n "Check out proj[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "svn co proj..."
+      mkdir -p $OSSIM_DEV_HOME/proj
+      cd $OSSIM_DEV_HOME/proj
+      wget $PROJ_URL
+      tar xvzf $PROJ_BASE.tar.gz
+      ln -s $PROJ_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out szip[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "szip..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_szip
+      mkdir -p $OSSIM_DEV_HOME/szip
+      cd $OSSIM_DEV_HOME/szip
+      wget $SZIP_URL
+      tar xvzf $SZIP_BASE.tar.gz
+      ln -s $SZIP_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   answer=
+   echo -n "Check out tiff[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "tiff..."
+      mkdir -p $OSSIM_DEV_HOME/tiff
+      cd $OSSIM_DEV_HOME/tiff
+      wget $TIFF_URL
+      tar xvzf $TIFF_BASE.tar.gz
+      ln -s $TIFF_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   echo -n "Check out zlib[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      echo "zlib..."
+      mkdir -p $OSSIM_DEV_HOME/build/build_zlib
+      mkdir -p $OSSIM_DEV_HOME/zlib
+      cd $OSSIM_DEV_HOME/zlib
+      wget $ZLIB_URL
+      tar xvzf $ZLIB_BASE.tar.gz
+      ln -s $ZLIB_BASE latest
+      cd $OSSIM_DEV_HOME
+   fi
+
+   #---
+   # End of get code section:
+   #---
+
+} # End checkoutPackages(){...}
+
+function buildPackages()
+{
+   #---
+   # Build section:
+   #
+   # Note: Order dependent...
+   #---
+   echo -n "Build cmake[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildPackage cmake
+   fi
+
+   echo -n "Build libjpeg-turbo[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildPackage libjpeg-turbo
+   fi
+
+   echo -n "Build zlib[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage zlib
+   fi
+
+   echo -n "Build ffmpeg[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildPackage ffmpeg
+   fi
+
+   echo -n "Build geos[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage geos
+   fi
+
+   # Must build before hdf5 code:
+   echo -n "Build szip[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage szip
+   fi
+
+   echo -n "Build hdf4[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage hdf4
+   fi
+
+   echo -n "Build hdf5[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage hdf5
+   fi
+
+   echo -n "Build tiff[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildPackage tiff
+   fi
+
+   # Must build before geotiff:
+   echo -n "Build proj[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildPackage proj
+      command="cp $OSSIM_DEV_HOME/proj/latest/src/projects.h $OSSIM_INSTALL_PREFIX/include/."
+      echo $command
+      $command
+   fi
+
+   echo -n "Build geotiff[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage geotiff
+   fi
+
+   echo -n "Build gdal[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildPackage gdal
+   fi
+
+   echo -n "Build OpenSceneGraph[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage osg
+   fi
+
+   echo -n "Buil2d podofo[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage podofo
+   fi
+
+   echo -n "Build pdal[y/n]: "
+   read answer
+   if [ "$answer" == 'y' ]; then
+      buildCmakePackage pdal
+   fi
+
+   #---
+   # End of build section:
+   #---
+
+} # End: buildPackages(){...}
+
+answer=
+echo -n "Go to check out packages section:[y/n]: "
+read answer
+if [ "$answer" == 'y' ]; then
+   checkoutPackages
+fi
+
+answer=
+echo -n "Go to build packages section:[y/n]: "
+read answer
+if [ "$answer" == 'y' ]; then
+   buildPackages
+fi
+
+exit 0
+# End
+
+
+
+
+
diff --git a/scripts/build.sh b/scripts/build.sh
new file mode 100755
index 0000000..1284d7d
--- /dev/null
+++ b/scripts/build.sh
@@ -0,0 +1,95 @@
+#!/bin/bash 
+###############################################################################
+#
+# Build script for all OSSIM repositories
+#
+# This script can be run from anywhere. It performs three functions:
+# 
+#   1. If running in an interactive shell, it queries for user for a build type
+#      (Release, Debug, etc.),
+#   2. It invokes the cmake configuration script to generate Makefiles in the
+#      build directory.
+#   3. It builds all OSSIM code.
+#
+# No env vars need to be predefined. The build output will be written to
+# $OSSIMLABS_DIR/build/<build_type> where $OSSIMLABS_DIR is the top-level
+# folder containing all OSSIM repositories (including this one).
+#
+# For customized output location, you can define the env var OSSIM_BUILD_DIR
+# prior to running this script, and the output will be written there.
+#
+###############################################################################
+
+# Uncomment following line to debug script line by line:
+#set -x; trap read debug
+
+# Working directory must be top-level dir:
+#SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+#pushd $SCRIPT_DIR/../..
+#OSSIM_DEV_HOME=$PWD
+
+#CMAKE_CONFIG_SCRIPT=$OSSIM_DEV_HOME/ossim/cmake/scripts/ossim-cmake-config.sh
+pushd `dirname $0` >/dev/null
+export SCRIPT_DIR=`pwd -P`
+popd >/dev/null
+# source variables used during the builds
+. $SCRIPT_DIR/env.sh
+
+# Consider whether running in interactive shell or batch for possible 
+# prompting on build configuration:
+if [ "$(ps -o stat= -p $PPID)" == "Ss" ]; then
+  echo
+  echo "Select build type:"
+  echo "  <1> Release,"
+  echo "  <2> Debug,"
+  echo "  <3> RelWithDebInfo,"
+  echo "  <4> MinSizeRel"
+  while 
+    read -p "Enter 1-4 [1]: " buildtype
+    if [ -z $buildtype ]; then
+      buildtype=1
+    fi
+    [ $buildtype -lt 1 ] || [ $buildtype -gt 4 ] 
+  do
+    continue
+  done
+  case $buildtype in
+    1) CMAKE_BUILD_TYPE="Release";; 
+    2) CMAKE_BUILD_TYPE="Debug";;
+    3) CMAKE_BUILD_TYPE="RelWithDebInfo";;
+    4) CMAKE_BUILD_TYPE="MinSizeRel";;
+  esac
+else
+  if [ -z $CMAKE_BUILD_TYPE ] ; then
+    CMAKE_BUILD_TYPE="Release"
+  fi
+fi 
+
+# Try running the CMake config script (sourcing here to capture OSSIM_BUILD_DIR var 
+# possibly initialized in cmake config script)
+if [ -x $CMAKE_CONFIG_SCRIPT ]; then
+  . $CMAKE_CONFIG_SCRIPT $CMAKE_BUILD_TYPE
+else
+  echo; echo "Error: Cannot locate the cmake config script expected at $CMAKE_CONFIG_SCRIPT. Cannot continue."
+  exit 1
+fi
+if [ $? -ne 0 ]; then
+  echo; echo "Error encountered during CMake configuration. Build aborted."
+  exit 1
+fi
+
+# CMake successful, now run make in the build directory (OSSIM_BUILD_DIR 
+# exported by cmake config script):
+pushd $OSSIM_BUILD_DIR >/dev/null
+make $MAKE_VERBOSE -j $OSSIM_MAKE_JOBS
+if [ $? -ne 0 ]; then
+  echo; echo "Error encountered during make. Check the console log and correct."
+  popd>/dev/null
+  exit 1
+fi
+echo; echo "Build completed successfully. Binaries located in $OSSIM_BUILD_DIR"
+popd # out of $OSSIM_BUILD_DIR
+
+
+exit 0
+
diff --git a/scripts/env.bat b/scripts/env.bat
new file mode 100644
index 0000000..cba052a
--- /dev/null
+++ b/scripts/env.bat
@@ -0,0 +1,16 @@
+ at echo off
+setlocal enabledelayedexpansion
+set SCRIPT_DIR="%~dp0"
+if not defined OSSIM_DEV_HOME (
+   pushd %SCRIPT_DIR%..\..
+   set OSSIM_DEV_HOME=!CD!
+   popd
+)
+if not defined VISUAL_STUDIO_VERSION ( 
+    set VISUAL_STUDIO_VERSION=14
+)
+if not defined OSSIM_INSTALL_PREFIX ( 
+    set OSSIM_INSTALL_PREFIX=!OSSIM_DEV_HOME!install
+)
+
+call "C:\Program Files (x86)\Microsoft Visual Studio %VISUAL_STUDIO_VERSION%\VC\vcvarsall.bat" amd64
diff --git a/scripts/env.sh b/scripts/env.sh
new file mode 100755
index 0000000..fb1ea56
--- /dev/null
+++ b/scripts/env.sh
@@ -0,0 +1,204 @@
+#!/bin/bash 
+pushd `dirname $0` >/dev/null
+export SCRIPT_DIR=`pwd -P`
+popd >/dev/null
+
+. $SCRIPT_DIR/git-prompt.sh
+
+if [ -z $OSSIM_GIT_BRANCH ] ; then
+  export OSSIM_GIT_BRANCH=`__git_ps1 "%s"`
+fi
+
+if [ -z $WORKSPACE ] ; then
+   if [ -z "$OSSIM_DEV_HOME" ]; then
+      pushd $SCRIPT_DIR/../.. >/dev/null
+      export OSSIM_DEV_HOME=$PWD
+      popd >/dev/null
+   fi
+else
+   export OSSIM_DEV_HOME=$WORKSPACE
+fi
+
+if [ -z "$OSSIM_MAKE_JOBS" ]; then
+   export OSSIM_MAKE_JOBS=4
+fi
+
+if [ -z "$OSSIM_INSTALL_PREFIX" ]; then
+   export OSSIM_INSTALL_PREFIX=$OSSIM_DEV_HOME/install
+fi
+if [ -z "$OSSIM_BUILD_DIR" ]; then
+   export OSSIM_BUILD_DIR=$OSSIM_DEV_HOME/build
+fi
+export CMAKE_CONFIG_SCRIPT=$OSSIM_DEV_HOME/ossim/cmake/scripts/ossim-cmake-config.sh
+
+
+# Setup JAVA Home
+#
+# If not explicitly set then try to set.  Add more for other OS's
+# this should work with OpenJDK installation.
+#
+if [ -z $JAVA_HOME ] ; then
+  if [ -d "/usr/lib/jvm/java" ] ; then
+    export JAVA_HOME="/usr/lib/jvm/java"
+  elif [ -f "/usr/libexec/java_home" ] ; then
+    export JAVA_HOME=`/usr/libexec/java_home`
+  fi
+fi
+
+# for packaging and general version number 
+#
+if [ -z $OSSIM_VERSION ] ; then
+   export OSSIM_VERSION=1.9.0
+fi
+
+if [ -z $OSSIM_VERSION_TAG ] ; then
+   if [ "${OSSIM_GIT_BRANCH}" == "dev" ] ; then
+      export OSSIM_VERSION_TAG="SNAPSHOT"
+   else 
+       export OSSIM_VERSION_TAG="RELEASE"
+   fi
+fi
+# For RPM packaging
+#
+if [ -z $OSSIM_BUILD_RELEASE ] ; then
+   export OSSIM_BUILD_RELEASE=1
+fi
+
+if [ -z $BUILD_OSSIM_APPS ] ; then
+   export BUILD_OSSIM_APPS=ON
+fi
+
+if [ -z $BUILD_OSSIM_CURL_APPS ] ; then
+   export BUILD_OSSIM_CURL_APPS=ON
+fi
+
+if [ -d $OSSIM_DEV_HOME/ossim-video ] ; then
+   if [ -z $BUILD_OSSIM_VIDEO ] ; then
+      export BUILD_OSSIM_VIDEO=ON
+   fi
+else
+   export BUILD_OSSIM_VIDEO=ON
+fi
+
+if [ -d $OSSIM_DEV_HOME/ossim-oms ] ; then
+   if [ -z $BUILD_OMS ] ; then
+      export BUILD_OMS=ON
+   fi
+else
+   export BUILD_OMS=OFF
+fi
+
+if [ -d $OSSIM_DEV_HOME/ossim-gui ] ; then
+   if [ -z $BUILD_OSSIM_GUI ] ; then
+      export BUILD_OSSIM_GUI=ON
+   fi
+else
+   export BUILD_OSSIM_GUI=OFF
+fi
+
+if [ -d $OSSIM_DEV_HOME/ossim-planet ] ; then
+   if [ -z $BUILD_OSSIM_PLANET ] ; then
+      export BUILD_OSSIM_PLANET=ON
+   fi
+else
+   export BUILD_OSSIM_PLANET=OFF
+fi
+
+if [ -d $OSSIM_DEV_HOME/ossim-wms ] ; then
+   if [ -z $BUILD_OSSIM_WMS ] ; then
+      export BUILD_OSSIM_WMS=ON
+   fi
+else
+   export BUILD_OSSIM_WMS=OFF
+fi
+
+if [ -d $OSSIM_DEV_HOME/ossim-plugins ] ; then
+
+   if [ -z $BUILD_CNES_PLUGIN ] ; then
+      export BUILD_CNES_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_CSM_PLUGIN ] ; then
+      export BUILD_CSM_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_WEB_PLUGIN ] ; then
+      export BUILD_WEB_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_SQLITE_PLUGIN ] ; then
+      export BUILD_SQLITE_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_KAKADU_PLUGIN ] ; then
+      export BUILD_KAKADU_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_KML_PLUGIN ] ; then
+      export BUILD_KML_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_GDAL_PLUGIN ] ; then
+      export BUILD_GDAL_PLUGIN=ON
+   fi
+
+   #if [ -z $BUILD_HDF5_PLUGIN ] ; then
+   #   export BUILD_HDF5_PLUGIN=ON
+   #fi
+
+   if [ -z $BUILD_POTRACE_PLUGIN ] ; then
+      export BUILD_POTRACE_PLUGIN=ON
+   fi
+   
+   if [ -z $BUILD_FFTW3_PLUGIN ] ; then
+      export BUILD_FFTW3_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_GEOPDF_PLUGIN ] ; then
+   export BUILD_GEOPDF_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_OPENCV_PLUGIN ] ; then
+      export BUILD_OPENCV_PLUGIN=OFF
+   fi
+
+   if [ -z $BUILD_OPENJPEG_PLUGIN ] ; then
+      export BUILD_OPENJPEG_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_PNG_PLUGIN ] ; then
+      export BUILD_PNG_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_JPEG12_PLUGIN ] ; then
+      export BUILD_JPEG12_PLUGIN=ON
+   fi
+
+   if [ -z $BUILD_OSSIM_HDF5_SUPPORT ] ; then
+      export BUILD_OSSIM_HDF5_SUPPORT=ON
+   fi
+fi
+
+if [ -z $OSSIM_BUILD_ADDITIONAL_DIRECTORIES ] ; then
+   if [ -d $OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server ]; then
+     export OSSIM_BUILD_ADDITIONAL_DIRECTORIES=$OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server
+   fi
+fi
+
+if [ \( "${BUILD_KAKADU_PLUGIN}"="ON" \) -o \( -d "$OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server" \) ] ; then
+
+   if [ -d "${OSSIM_DEV_HOME}/kakadu-${KAKADU_VERSION}" ] ; then
+      if [ -z $KAKADU_ROOT_SRC ] ; then
+         export KAKADU_ROOT_SRC="${OSSIM_DEV_HOME}/kakadu-${KAKADU_VERSION}"
+      fi
+      if [ -d "${KAKADU_ROOT_SRC}/lib/Linux-x86-64-gcc" ] ; then
+         if [ -z $KAKADU_LIBRARY ] ; then
+              export KAKADU_LIBRARY="${KAKADU_ROOT_SRC}/lib/Linux-x86-64-gcc/libkdu_v75R.so"
+         fi
+         if [ -z $KAKADU_AUX_LIBRARY ] ; then
+            export KAKADU_AUX_LIBRARY="${KAKADU_ROOT_SRC}/lib/Linux-x86-64-gcc/libkdu_a75R.so"
+         fi
+      fi
+   fi
+fi
+
diff --git a/scripts/gcrbr.sh b/scripts/gcrbr.sh
new file mode 100755
index 0000000..8a8c4b9
--- /dev/null
+++ b/scripts/gcrbr.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+#----------------------------------------------------------------------------------
+# Git create branch. Also creates upstream origin/branch and switches to new branch
+#----------------------------------------------------------------------------------
+
+if [ -z $1 ]; then
+  echo; echo "git remove branch: need branch name."; echo
+  exit 0
+fi 
+
+branchname=$1
+git checkout -b $branchname
+if [ $? -ne 0 ]; then
+  echo; echo "Local branch not created."; echo
+  exit 1
+fi
+git push -u origin  $branchname
+if [ $? -ne 0 ]; then
+  echo; echo "Remote branch not created."; echo
+  exit 1
+fi
+echo; echo "Branch $branchname successfully created."; echo
+
+exit 0
+
+      
+
diff --git a/scripts/git-prompt.sh b/scripts/git-prompt.sh
new file mode 100755
index 0000000..97eacd7
--- /dev/null
+++ b/scripts/git-prompt.sh
@@ -0,0 +1,531 @@
+# bash/zsh git prompt support
+#
+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce at spearce.org>
+# Distributed under the GNU General Public License, version 2.0.
+#
+# This script allows you to see repository status in your prompt.
+#
+# To enable:
+#
+#    1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
+#    2) Add the following line to your .bashrc/.zshrc:
+#        source ~/.git-prompt.sh
+#    3a) Change your PS1 to call __git_ps1 as
+#        command-substitution:
+#        Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
+#        ZSH:  setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
+#        the optional argument will be used as format string.
+#    3b) Alternatively, for a slightly faster prompt, __git_ps1 can
+#        be used for PROMPT_COMMAND in Bash or for precmd() in Zsh
+#        with two parameters, <pre> and <post>, which are strings
+#        you would put in $PS1 before and after the status string
+#        generated by the git-prompt machinery.  e.g.
+#        Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
+#          will show username, at-sign, host, colon, cwd, then
+#          various status string, followed by dollar and SP, as
+#          your prompt.
+#        ZSH:  precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
+#          will show username, pipe, then various status string,
+#          followed by colon, cwd, dollar and SP, as your prompt.
+#        Optionally, you can supply a third argument with a printf
+#        format string to finetune the output of the branch status
+#
+# The repository status will be displayed only if you are currently in a
+# git repository. The %s token is the placeholder for the shown status.
+#
+# The prompt status always includes the current branch name.
+#
+# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
+# unstaged (*) and staged (+) changes will be shown next to the branch
+# name.  You can configure this per-repository with the
+# bash.showDirtyState variable, which defaults to true once
+# GIT_PS1_SHOWDIRTYSTATE is enabled.
+#
+# You can also see if currently something is stashed, by setting
+# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
+# then a '$' will be shown next to the branch name.
+#
+# If you would like to see if there're untracked files, then you can set
+# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
+# files, then a '%' will be shown next to the branch name.  You can
+# configure this per-repository with the bash.showUntrackedFiles
+# variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is
+# enabled.
+#
+# If you would like to see the difference between HEAD and its upstream,
+# set GIT_PS1_SHOWUPSTREAM="auto".  A "<" indicates you are behind, ">"
+# indicates you are ahead, "<>" indicates you have diverged and "="
+# indicates that there is no difference. You can further control
+# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list
+# of values:
+#
+#     verbose       show number of commits ahead/behind (+/-) upstream
+#     name          if verbose, then also show the upstream abbrev name
+#     legacy        don't use the '--count' option available in recent
+#                   versions of git-rev-list
+#     git           always compare HEAD to @{upstream}
+#     svn           always compare HEAD to your SVN upstream
+#
+# You can change the separator between the branch name and the above
+# state symbols by setting GIT_PS1_STATESEPARATOR. The default separator
+# is SP.
+#
+# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
+# find one, or @{upstream} otherwise.  Once you have set
+# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
+# setting the bash.showUpstream config variable.
+#
+# If you would like to see more information about the identity of
+# commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
+# to one of these values:
+#
+#     contains      relative to newer annotated tag (v1.6.3.2~35)
+#     branch        relative to newer tag or branch (master~4)
+#     describe      relative to older annotated tag (v1.6.3.1-13-gdd42c2f)
+#     default       exactly matching tag
+#
+# If you would like a colored hint about the current dirty state, set
+# GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
+# the colored output of "git status -sb" and are available only when
+# using __git_ps1 for PROMPT_COMMAND or precmd.
+#
+# If you would like __git_ps1 to do nothing in the case when the current
+# directory is set up to be ignored by git, then set
+# GIT_PS1_HIDE_IF_PWD_IGNORED to a nonempty value. Override this on the
+# repository level by setting bash.hideIfPwdIgnored to "false".
+
+# check whether printf supports -v
+__git_printf_supports_v=
+printf -v __git_printf_supports_v -- '%s' yes >/dev/null 2>&1
+
+# stores the divergence from upstream in $p
+# used by GIT_PS1_SHOWUPSTREAM
+__git_ps1_show_upstream ()
+{
+	local key value
+	local svn_remote svn_url_pattern count n
+	local upstream=git legacy="" verbose="" name=""
+
+	svn_remote=()
+	# get some config options from git-config
+	local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
+	while read -r key value; do
+		case "$key" in
+		bash.showupstream)
+			GIT_PS1_SHOWUPSTREAM="$value"
+			if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
+				p=""
+				return
+			fi
+			;;
+		svn-remote.*.url)
+			svn_remote[$((${#svn_remote[@]} + 1))]="$value"
+			svn_url_pattern="$svn_url_pattern\\|$value"
+			upstream=svn+git # default upstream is SVN if available, else git
+			;;
+		esac
+	done <<< "$output"
+
+	# parse configuration values
+	for option in ${GIT_PS1_SHOWUPSTREAM}; do
+		case "$option" in
+		git|svn) upstream="$option" ;;
+		verbose) verbose=1 ;;
+		legacy)  legacy=1  ;;
+		name)    name=1 ;;
+		esac
+	done
+
+	# Find our upstream
+	case "$upstream" in
+	git)    upstream="@{upstream}" ;;
+	svn*)
+		# get the upstream from the "git-svn-id: ..." in a commit message
+		# (git-svn uses essentially the same procedure internally)
+		local -a svn_upstream
+		svn_upstream=($(git log --first-parent -1 \
+					--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null))
+		if [[ 0 -ne ${#svn_upstream[@]} ]]; then
+			svn_upstream=${svn_upstream[${#svn_upstream[@]} - 2]}
+			svn_upstream=${svn_upstream%@*}
+			local n_stop="${#svn_remote[@]}"
+			for ((n=1; n <= n_stop; n++)); do
+				svn_upstream=${svn_upstream#${svn_remote[$n]}}
+			done
+
+			if [[ -z "$svn_upstream" ]]; then
+				# default branch name for checkouts with no layout:
+				upstream=${GIT_SVN_ID:-git-svn}
+			else
+				upstream=${svn_upstream#/}
+			fi
+		elif [[ "svn+git" = "$upstream" ]]; then
+			upstream="@{upstream}"
+		fi
+		;;
+	esac
+
+	# Find how many commits we are ahead/behind our upstream
+	if [[ -z "$legacy" ]]; then
+		count="$(git rev-list --count --left-right \
+				"$upstream"...HEAD 2>/dev/null)"
+	else
+		# produce equivalent output to --count for older versions of git
+		local commits
+		if commits="$(git rev-list --left-right "$upstream"...HEAD 2>/dev/null)"
+		then
+			local commit behind=0 ahead=0
+			for commit in $commits
+			do
+				case "$commit" in
+				"<"*) ((behind++)) ;;
+				*)    ((ahead++))  ;;
+				esac
+			done
+			count="$behind	$ahead"
+		else
+			count=""
+		fi
+	fi
+
+	# calculate the result
+	if [[ -z "$verbose" ]]; then
+		case "$count" in
+		"") # no upstream
+			p="" ;;
+		"0	0") # equal to upstream
+			p="=" ;;
+		"0	"*) # ahead of upstream
+			p=">" ;;
+		*"	0") # behind upstream
+			p="<" ;;
+		*)	    # diverged from upstream
+			p="<>" ;;
+		esac
+	else
+		case "$count" in
+		"") # no upstream
+			p="" ;;
+		"0	0") # equal to upstream
+			p=" u=" ;;
+		"0	"*) # ahead of upstream
+			p=" u+${count#0	}" ;;
+		*"	0") # behind upstream
+			p=" u-${count%	0}" ;;
+		*)	    # diverged from upstream
+			p=" u+${count#*	}-${count%	*}" ;;
+		esac
+		if [[ -n "$count" && -n "$name" ]]; then
+			__git_ps1_upstream_name=$(git rev-parse \
+				--abbrev-ref "$upstream" 2>/dev/null)
+			if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
+				p="$p \${__git_ps1_upstream_name}"
+			else
+				p="$p ${__git_ps1_upstream_name}"
+				# not needed anymore; keep user's
+				# environment clean
+				unset __git_ps1_upstream_name
+			fi
+		fi
+	fi
+
+}
+
+# Helper function that is meant to be called from __git_ps1.  It
+# injects color codes into the appropriate gitstring variables used
+# to build a gitstring.
+__git_ps1_colorize_gitstring ()
+{
+	if [[ -n ${ZSH_VERSION-} ]]; then
+		local c_red='%F{red}'
+		local c_green='%F{green}'
+		local c_lblue='%F{blue}'
+		local c_clear='%f'
+	else
+		# Using \[ and \] around colors is necessary to prevent
+		# issues with command line editing/browsing/completion!
+		local c_red='\[\e[31m\]'
+		local c_green='\[\e[32m\]'
+		local c_lblue='\[\e[1;34m\]'
+		local c_clear='\[\e[0m\]'
+	fi
+	local bad_color=$c_red
+	local ok_color=$c_green
+	local flags_color="$c_lblue"
+
+	local branch_color=""
+	if [ $detached = no ]; then
+		branch_color="$ok_color"
+	else
+		branch_color="$bad_color"
+	fi
+	c="$branch_color$c"
+
+	z="$c_clear$z"
+	if [ "$w" = "*" ]; then
+		w="$bad_color$w"
+	fi
+	if [ -n "$i" ]; then
+		i="$ok_color$i"
+	fi
+	if [ -n "$s" ]; then
+		s="$flags_color$s"
+	fi
+	if [ -n "$u" ]; then
+		u="$bad_color$u"
+	fi
+	r="$c_clear$r"
+}
+
+__git_eread ()
+{
+	local f="$1"
+	shift
+	test -r "$f" && read "$@" <"$f"
+}
+
+# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
+# when called from PS1 using command substitution
+# in this mode it prints text to add to bash PS1 prompt (includes branch name)
+#
+# __git_ps1 requires 2 or 3 arguments when called from PROMPT_COMMAND (pc)
+# in that case it _sets_ PS1. The arguments are parts of a PS1 string.
+# when two arguments are given, the first is prepended and the second appended
+# to the state string when assigned to PS1.
+# The optional third parameter will be used as printf format string to further
+# customize the output of the git-status string.
+# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
+__git_ps1 ()
+{
+	# preserve exit status
+	local exit=$?
+	local pcmode=no
+	local detached=no
+	local ps1pc_start='\u@\h:\w '
+	local ps1pc_end='\$ '
+	local printf_format=' (%s)'
+
+	case "$#" in
+		2|3)	pcmode=yes
+			ps1pc_start="$1"
+			ps1pc_end="$2"
+			printf_format="${3:-$printf_format}"
+			# set PS1 to a plain prompt so that we can
+			# simply return early if the prompt should not
+			# be decorated
+			PS1="$ps1pc_start$ps1pc_end"
+		;;
+		0|1)	printf_format="${1:-$printf_format}"
+		;;
+		*)	return $exit
+		;;
+	esac
+
+	# ps1_expanded:  This variable is set to 'yes' if the shell
+	# subjects the value of PS1 to parameter expansion:
+	#
+	#   * bash does unless the promptvars option is disabled
+	#   * zsh does not unless the PROMPT_SUBST option is set
+	#   * POSIX shells always do
+	#
+	# If the shell would expand the contents of PS1 when drawing
+	# the prompt, a raw ref name must not be included in PS1.
+	# This protects the user from arbitrary code execution via
+	# specially crafted ref names.  For example, a ref named
+	# 'refs/heads/$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)' might cause the
+	# shell to execute 'sudo rm -rf /' when the prompt is drawn.
+	#
+	# Instead, the ref name should be placed in a separate global
+	# variable (in the __git_ps1_* namespace to avoid colliding
+	# with the user's environment) and that variable should be
+	# referenced from PS1.  For example:
+	#
+	#     __git_ps1_foo=$(do_something_to_get_ref_name)
+	#     PS1="...stuff...\${__git_ps1_foo}...stuff..."
+	#
+	# If the shell does not expand the contents of PS1, the raw
+	# ref name must be included in PS1.
+	#
+	# The value of this variable is only relevant when in pcmode.
+	#
+	# Assume that the shell follows the POSIX specification and
+	# expands PS1 unless determined otherwise.  (This is more
+	# likely to be correct if the user has a non-bash, non-zsh
+	# shell and safer than the alternative if the assumption is
+	# incorrect.)
+	#
+	local ps1_expanded=yes
+	[ -z "${ZSH_VERSION-}" ] || [[ -o PROMPT_SUBST ]] || ps1_expanded=no
+	[ -z "${BASH_VERSION-}" ] || shopt -q promptvars || ps1_expanded=no
+
+	local repo_info rev_parse_exit_code
+	repo_info="$(git rev-parse --git-dir --is-inside-git-dir \
+		--is-bare-repository --is-inside-work-tree \
+		--short HEAD 2>/dev/null)"
+	rev_parse_exit_code="$?"
+
+	if [ -z "$repo_info" ]; then
+		return $exit
+	fi
+
+	local short_sha=""
+	if [ "$rev_parse_exit_code" = "0" ]; then
+		short_sha="${repo_info##*$'\n'}"
+		repo_info="${repo_info%$'\n'*}"
+	fi
+	local inside_worktree="${repo_info##*$'\n'}"
+	repo_info="${repo_info%$'\n'*}"
+	local bare_repo="${repo_info##*$'\n'}"
+	repo_info="${repo_info%$'\n'*}"
+	local inside_gitdir="${repo_info##*$'\n'}"
+	local g="${repo_info%$'\n'*}"
+
+	if [ "true" = "$inside_worktree" ] &&
+	   [ -n "${GIT_PS1_HIDE_IF_PWD_IGNORED-}" ] &&
+	   [ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] &&
+	   git check-ignore -q .
+	then
+		return $exit
+	fi
+
+	local r=""
+	local b=""
+	local step=""
+	local total=""
+	if [ -d "$g/rebase-merge" ]; then
+		__git_eread "$g/rebase-merge/head-name" b
+		__git_eread "$g/rebase-merge/msgnum" step
+		__git_eread "$g/rebase-merge/end" total
+		if [ -f "$g/rebase-merge/interactive" ]; then
+			r="|REBASE-i"
+		else
+			r="|REBASE-m"
+		fi
+	else
+		if [ -d "$g/rebase-apply" ]; then
+			__git_eread "$g/rebase-apply/next" step
+			__git_eread "$g/rebase-apply/last" total
+			if [ -f "$g/rebase-apply/rebasing" ]; then
+				__git_eread "$g/rebase-apply/head-name" b
+				r="|REBASE"
+			elif [ -f "$g/rebase-apply/applying" ]; then
+				r="|AM"
+			else
+				r="|AM/REBASE"
+			fi
+		elif [ -f "$g/MERGE_HEAD" ]; then
+			r="|MERGING"
+		elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
+			r="|CHERRY-PICKING"
+		elif [ -f "$g/REVERT_HEAD" ]; then
+			r="|REVERTING"
+		elif [ -f "$g/BISECT_LOG" ]; then
+			r="|BISECTING"
+		fi
+
+		if [ -n "$b" ]; then
+			:
+		elif [ -h "$g/HEAD" ]; then
+			# symlink symbolic ref
+			b="$(git symbolic-ref HEAD 2>/dev/null)"
+		else
+			local head=""
+			if ! __git_eread "$g/HEAD" head; then
+				return $exit
+			fi
+			# is it a symbolic ref?
+			b="${head#ref: }"
+			if [ "$head" = "$b" ]; then
+				detached=yes
+				b="$(
+				case "${GIT_PS1_DESCRIBE_STYLE-}" in
+				(contains)
+					git describe --contains HEAD ;;
+				(branch)
+					git describe --contains --all HEAD ;;
+				(describe)
+					git describe HEAD ;;
+				(* | default)
+					git describe --tags --exact-match HEAD ;;
+				esac 2>/dev/null)" ||
+
+				b="$short_sha..."
+				b="($b)"
+			fi
+		fi
+	fi
+
+	if [ -n "$step" ] && [ -n "$total" ]; then
+		r="$r $step/$total"
+	fi
+
+	local w=""
+	local i=""
+	local s=""
+	local u=""
+	local c=""
+	local p=""
+
+	if [ "true" = "$inside_gitdir" ]; then
+		if [ "true" = "$bare_repo" ]; then
+			c="BARE:"
+		else
+			b="GIT_DIR!"
+		fi
+	elif [ "true" = "$inside_worktree" ]; then
+		if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
+		   [ "$(git config --bool bash.showDirtyState)" != "false" ]
+		then
+			git diff --no-ext-diff --quiet || w="*"
+			git diff --no-ext-diff --cached --quiet || i="+"
+			if [ -z "$short_sha" ] && [ -z "$i" ]; then
+				i="#"
+			fi
+		fi
+		if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] &&
+		   git rev-parse --verify --quiet refs/stash >/dev/null
+		then
+			s="$"
+		fi
+
+		if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
+		   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
+		   git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null
+		then
+			u="%${ZSH_VERSION+%}"
+		fi
+
+		if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
+			__git_ps1_show_upstream
+		fi
+	fi
+
+	local z="${GIT_PS1_STATESEPARATOR-" "}"
+
+	# NO color option unless in PROMPT_COMMAND mode
+	if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
+		__git_ps1_colorize_gitstring
+	fi
+
+	b=${b##refs/heads/}
+	if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
+		__git_ps1_branch_name=$b
+		b="\${__git_ps1_branch_name}"
+	fi
+
+	local f="$w$i$s$u"
+	local gitstring="$c$b${f:+$z$f}$r$p"
+
+	if [ $pcmode = yes ]; then
+		if [ "${__git_printf_supports_v-}" != yes ]; then
+			gitstring=$(printf -- "$printf_format" "$gitstring")
+		else
+			printf -v gitstring -- "$printf_format" "$gitstring"
+		fi
+		PS1="$ps1pc_start$gitstring$ps1pc_end"
+	else
+		printf -- "$printf_format" "$gitstring"
+	fi
+
+	return $exit
+}
diff --git a/scripts/got b/scripts/got
new file mode 100755
index 0000000..b009778
--- /dev/null
+++ b/scripts/got
@@ -0,0 +1,65 @@
+#!/bin/bash
+###############################################################################
+#
+# got = git for OSSIM
+#
+# Convenience script for performing git operations on multiple OSSIMLABS repos.
+# Up to four git parameters are handled, for example:
+#
+#    got commit -a
+#    got log --oneline --graph
+#
+# Obviously, only commands that make sense to run on all repos will work. You
+# can't commit a specific file for example.
+#
+# Run this script from ossimlabs parent directory (a.k.a. OSSIM_DEV_HOME) 
+#
+###############################################################################
+
+
+# FUNCTION: do_git <repo_name> <cmd_line_arg_1> <cmd_line_arg_2> <cmd_line_arg_3> <cmd_line_arg_4>
+function do_git {
+  if [ -d $1 ]; then
+    echo; 
+    echo "*************************** $(basename $1) ***************************"
+
+    pushd $1 > /dev/null
+    git $2 $3 $4 $5
+    popd > /dev/null
+  fi
+}
+export -f do_git
+
+# FUNCTION: usage <script_basename> 
+function usage {
+  echo; echo "Runs specified git command across all ossimlabs repositories. Usage:"
+  echo; echo "  $1 <git-arg1> [<git-arg2> [<git-arg3>]]"
+  echo; echo "This script must be run from the ossimlabs parent directory."
+  echo; echo "Examples:"; echo 
+  echo "  $1 status"
+  echo "  $1 log --oneline --graph"; echo  
+  exit 0
+}
+
+# Check for incorrect usage:
+if [ -z $1 ]; then
+  usage `basename "$0"`
+fi
+
+# Loop over all ossim repos in working dir:
+find . -maxdepth 1 -type d -name "ossim*" -exec bash -c "do_git {} $*" \;
+
+# Check OMAR as well...
+if [ -d omar ]; then
+  bash -c "do_git omar $*"
+fi
+find . -maxdepth 1 -type d -name "omar-*" -exec bash -c "do_git {} $*" \;
+
+if [ -d o2-paas ]; then
+  bash -c "do_git o2-paas $*"
+fi
+
+echo
+  
+
+
diff --git a/scripts/grmbr.sh b/scripts/grmbr.sh
new file mode 100755
index 0000000..edbdd40
--- /dev/null
+++ b/scripts/grmbr.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+#----------------------------------------------------------------------------------
+# Git remove branch. Deletes local AND upstream origin/branch.
+#----------------------------------------------------------------------------------
+
+if [ -z $1 ]; then
+  echo; echo "git remove branch: need branch name."; echo
+  exit 0
+fi 
+
+branchname=$1
+echo 
+read -p "Are you sure you want to completely delete $branchname? [y/N]" yesno
+if [ -z $yesno ]; then
+  yesno="no"
+fi
+
+if [ $yesno == "y" ] || [ $yesno == "Y" ]; then
+  git branch -d $branchname
+  if [ $? -ne 0 ]; then
+    echo; echo "Local branch not deleted."; echo
+    exit 1
+  fi
+  git push origin --delete $branchname
+  if [ $? -ne 0 ]; then
+    echo; echo "Remote branch not deleted."; echo
+    exit 1
+  fi
+fi
+
+echo; echo "Branch $branchname successfully removed."; echo
+exit 0
+
+      
+
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 0000000..cdea747
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,14 @@
+#!/bin/bash 
+pushd `dirname $0` >/dev/null
+export SCRIPT_DIR=`pwd -P`
+popd >/dev/null
+# source variables used during the builds
+. $SCRIPT_DIR/env.sh
+
+pushd $OSSIM_BUILD_DIR >/dev/null
+make install
+popd >/dev/null
+
+pushd $OSSIM_DEV_HOME/ossim
+  
+popd
diff --git a/scripts/setup.sh b/scripts/setup.sh
new file mode 100755
index 0000000..45ead80
--- /dev/null
+++ b/scripts/setup.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+#####################################################################################
+#
+# Test data setup script for all OSSIM repositories. The following env vars must be 
+# set in the GoCD environment:
+#
+#   OSSIM_DATA_REPOSITORY -- local NFS mount point for data repository
+#   OSSIM_DATA -- Local directory to contain elevation, imagery, and expected results
+#
+# The test data directory, specified by the env var OSSIM_DATA is
+# syncronized against a master repository. The master data repository is
+# assumed to be NFS-mounted at the mount point specified in the environment
+# variable "OSSIM_DATA_REPOSITORY". The data will be rsynced to the local
+# directory specified by "OSSIM_DATA" env var.
+#
+#####################################################################################
+
+echo; echo "Running setup.sh script from <$PWD>...";
+
+echo "STATUS: Checking presence of env var OSSIM_DATA = <$OSSIM_DATA>...";
+if [ -z $OSSIM_DATA ] || [ ! -d $OSSIM_DATA ] ; then
+  echo "ERROR: Env var OSSIM_DATA must be defined and exist in order to syncronize against data repository.";
+  exit 1;
+fi
+
+echo "STATUS: Checking access to data repository at <$OSSIM_DATA_REPOSITORY>...";
+if [ -z $OSSIM_DATA_REPOSITORY ] || [ ! -d $OSSIM_DATA_REPOSITORY ] ; then
+  echo "ERROR: Env var OSSIM_DATA_REPOSITORY must be defined and exist in order to syncronize against data repository.";
+  exit 1;
+fi
+
+# rsync elevation data:
+echo "STATUS: Syncing elevation data...";
+rsync -rmv --delete $OSSIM_DATA_REPOSITORY/elevation/dted/level0 $OSSIM_DATA/elevation/dted;
+if [ $? != 0 ] ; then 
+  echo "ERROR: Failed data repository rsync of elevation.";
+  exit 1;
+fi
+
+# rsync nadcon data:
+echo "STATUS: Syncing nadcon data...";
+rsync -rm --delete $OSSIM_DATA_REPOSITORY/elevation/nadcon $OSSIM_DATA/elevation;
+if [ $? != 0 ] ; then 
+  echo "ERROR: Failed data repository rsync of nadcon grids.";
+  exit 1;
+fi
+
+if [ ! -d $OSSIM_DATA/elevation/geoids ] ; then
+  echo "STATUS: Creating missing geoids subdirectory";
+  mkdir $OSSIM_DATA/elevation/geoids; 
+  if [ $? != 0 ] ; then 
+    echo "ERROR: Failed creatiion of geoids directory at <$OSSIM_DATA/elevation/geoids>.";
+    exit 1;
+  fi
+fi
+
+# rsync geoid 96 data:
+echo "STATUS: Syncing geoid96 data...";
+rsync -rm --delete $OSSIM_DATA_REPOSITORY/elevation/geoid96_little_endian/ $OSSIM_DATA/elevation/geoids/geoid96;
+if [ $? != 0 ] ; then 
+  echo "ERROR: Failed data repository rsync of geoid96 grids.";
+  exit 1;
+fi
+
+# rsync geoid 99 data:
+echo "STATUS: Syncing geoid99 data...";
+rsync -rm --delete $OSSIM_DATA_REPOSITORY/elevation/geoid99_little_endian/ $OSSIM_DATA/elevation/geoids/geoid99;
+if [ $? != 0 ] ; then 
+  echo "ERROR: Failed data repository rsync of geoid99 grids.";
+  exit 1;
+fi
+
+#rsync imagery
+echo "STATUS: Syncing image data...";
+rsync -rm --delete $OSSIM_DATA_REPOSITORY/test/data/public $OSSIM_DATA/ossim_data;
+if [ $? != 0 ] ; then 
+  echo "ERROR: Failed data repository rsync of imagery.";
+  exit 1;
+fi
+  
+exit 0;
+
+
diff --git a/scripts/test.sh b/scripts/test.sh
new file mode 100755
index 0000000..c179b78
--- /dev/null
+++ b/scripts/test.sh
@@ -0,0 +1,122 @@
+#!/bin/bash
+
+###############################################################################
+#
+# Test script for all OSSIM repositories. 
+#
+# Usage: test.sh [genx]
+# 
+# The only required environment variable is OSSIM_DATA which should also 
+# contain elevation data as specified in the ossim_preferences file.
+#
+# The test data referenced must be available at $OSSIM_BATCH_TEST_DATA. This 
+# environment variable can be predefined, otherwise, will default to:
+# $OSSIM_DATA.
+#
+# The expected results should be in $OSSIM_BATCH_TEST_RESULTS. This environment 
+# variable can be predefined, otherwise, will default to
+# $OSSIM_BATCH_TEST_DATA/ossim-test-results.
+#
+# If the optional "genx" argument is specified, then expected results will be
+# generated at $OSSIM_BATCH_TEST_RESULTS ONLY IF this directory is not present.
+# If $OSSIM_BATCH_TEST_RESULTS exists, no expected results will be generated.
+#
+###############################################################################
+#set -x; trap read debug
+
+GENERATE_EXPECTED_RESULTS=0
+if [ ! -z $1 ] && [ $1 == "genx" ]; then
+  GENERATE_EXPECTED_RESULTS=1
+  echo; echo "STATUS: Generating expected results..."; echo
+fi
+
+SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+if [ -z $OSSIM_BUILD_DIR ]; then
+  pushd $SCRIPT_DIR/../../build
+  OSSIM_BUILD_DIR=$PWD
+  #echo "#### DEBUG #### OSSIM_BUILD_DIR=$OSSIM_BUILD_DIR"
+  popd
+  export OSSIM_BUILD_DIR
+fi
+
+if [ -z $OSSIM_DATA ]; then
+  echo "ERROR: Required env var OSSIM_DATA is not defined. Aborting setup..."; 
+  exit 1
+fi
+
+if [ -z $OSSIM_BATCH_TEST_DATA ]; then
+  export OSSIM_BATCH_TEST_DATA=$OSSIM_DATA
+fi
+
+if [ -z $OSSIM_BATCH_TEST_RESULTS ]; then
+  export OSSIM_BATCH_TEST_RESULTS=$OSSIM_BATCH_TEST_DATA/ossim-test-results
+fi
+
+#echo "#### DEBUG #### OSSIM_BUILD_DIR=$OSSIM_BUILD_DIR"
+#echo "#### DEBUG #### OSSIM_BATCH_TEST_DATA=$OSSIM_BATCH_TEST_DATA"
+#echo "#### DEBUG #### OSSIM_BATCH_TEST_RESULTS=$OSSIM_BATCH_TEST_RESULTS"
+
+#export the OSSIM runtime env to child processes:
+export PATH=$OSSIM_BUILD_DIR/bin:$PATH
+export LD_LIBRARY_PATH=$OSSIM_BUILD_DIR/lib:$LD_LIBRARY_PATH
+
+# TEST 1: Check ossim-info version:
+echo; echo "STATUS: Running ossim-info test...";
+COMMAND1="ossim-info --config --plugins"
+$COMMAND1
+if [ $? -ne 0 ]; then
+  echo; echo "ERROR: Failed while attempting to run <$COMMAND1>."
+  exit 1
+fi
+
+COUNT=`ossim-info --version | grep --count "ossim-info 1.9"`
+if [ $COUNT != "1" ]; then
+  echo "FAIL: Failed ossim-info test"; exit 1
+else
+  echo "STATUS: Passed ossim-info test"
+fi
+
+
+if [ $GENERATE_EXPECTED_RESULTS -eq 1 ] && [ ! -e $OSSIM_BATCH_TEST_RESULTS ]; then
+
+  # Check if expected results are present, generate if not:
+  echo; echo "STATUS: No expected results detected, generating new expected results in <$OSSIM_BATCH_TEST_RESULTS>..."
+  mkdir $OSSIM_BATCH_TEST_RESULTS
+  if [ $? -ne 0 ]; then
+    echo; echo "ERROR: Failed while attempting to create results directory at <$OSSIM_BATCH_TEST_RESULTS>. Check permissions."
+    echo 1
+  fi
+  pushd $SCRIPT_DIR/../../test/scripts
+  ossim-batch-test --accept-test all super-test.kwl
+  popd
+  #echo "STATUS: ossim-batch-test exit code = $?";echo
+  if [ $? != 0 ]; then
+    echo "FAIL: Error encountered generating expected results."
+    exit 1
+  else
+    echo "STATUS: Successfully generated expected results."; echo
+  fi
+
+else
+
+  # Run batch tests
+  echo; echo "STATUS: Running batch tests..."
+  pushd $SCRIPT_DIR/../../test/scripts
+  ossim-batch-test super-test.kwl
+  EXIT_CODE=$?
+  popd
+  #echo "#### DEBUG #### EXIT_CODE = $EXIT_CODE"
+  if [ $EXIT_CODE != 0 ]; then
+    echo "FAIL: Failed batch test"
+    exit 1
+  else
+    echo "STATUS: Passed batch test"
+  fi
+
+fi
+
+
+# Success!
+echo "STATUS: Passed all tests."
+exit 0
+
diff --git a/share/ossim/fonts/arial.ttf b/share/ossim/fonts/arial.ttf
new file mode 100644
index 0000000..910202c
Binary files /dev/null and b/share/ossim/fonts/arial.ttf differ
diff --git a/share/ossim/fonts/times.ttf b/share/ossim/fonts/times.ttf
new file mode 100644
index 0000000..1603d7a
Binary files /dev/null and b/share/ossim/fonts/times.ttf differ
diff --git a/share/ossim/geoids/egm96.grd b/share/ossim/geoids/egm96.grd
new file mode 100755
index 0000000..763dbc8
Binary files /dev/null and b/share/ossim/geoids/egm96.grd differ
diff --git a/share/ossim/projection/ossim_epsg_projections-v7_4.csv b/share/ossim/projection/ossim_epsg_projections-v7_4.csv
new file mode 100644
index 0000000..fc42c4b
--- /dev/null
+++ b/share/ossim/projection/ossim_epsg_projections-v7_4.csv
@@ -0,0 +1,3253 @@
+EPSG_DB_FORMAT_A
+code,name,type,unit,datum code,datum name,ellipsoid,False easting,Latitude of natural origin,False northing,Longitude of natural origin,Scale factor at natural origin,Azimuth of initial line,Latitude of projection centre,Northing at projection centre,Angle from Rectified to Skew Grid,Scale factor on initial line,Easting at projection centre,Longitude of projection centre,Latitude of pseudo standard parallel,Scale factor on pseudo standard parallel,Longitude of origin,Latitude of 2nd stan [...]
+2000,Anguilla 1957 / British West Indies Grid,Transverse Mercator,metre,4600,Anguilla 1957,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2001,Antigua 1943 / British West Indies Grid,Transverse Mercator,metre,4601,Antigua 1943,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2002,Dominica 1945 / British West Indies Grid,Transverse Mercator,metre,4602,Dominica 1945,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2003,Grenada 1953 / British West Indies Grid,Transverse Mercator,metre,4603,Grenada 1953,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2004,Montserrat 1958 / British West Indies Grid,Transverse Mercator,metre,4604,Montserrat 1958,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2005,St. Kitts 1955 / British West Indies Grid,Transverse Mercator,metre,4605,St. Kitts 1955,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2006,St. Lucia 1955 / British West Indies Grid,Transverse Mercator,metre,4606,St. Lucia 1955,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2007,St. Vincent 45 / British West Indies Grid,Transverse Mercator,metre,4607,St. Vincent 1945,Clarke 1880 (RGS),400000,0,0,-62,0.9995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2008,NAD27(CGQ77) / SCoPQ zone 2,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-55.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2009,NAD27(CGQ77) / SCoPQ zone 3,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-58.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2010,NAD27(CGQ77) / SCoPQ zone 4,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2011,NAD27(CGQ77) / SCoPQ zone 5,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2012,NAD27(CGQ77) / SCoPQ zone 6,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-67.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2013,NAD27(CGQ77) / SCoPQ zone 7,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-70.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2014,NAD27(CGQ77) / SCoPQ zone 8,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-73.3,0.9999
+2015,NAD27(CGQ77) / SCoPQ zone 9,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-76.3,0.9999
+2016,NAD27(CGQ77) / SCoPQ zone 10,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,304800,0,0,-79.3,0.9999
+2017,NAD27(76) / MTM zone 8,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-73.3,0.9999
+2018,NAD27(76) / MTM zone 9,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-76.3,0.9999
+2019,NAD27(76) / MTM zone 10,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-79.3,0.9999
+2020,NAD27(76) / MTM zone 11,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-82.3,0.9999
+2021,NAD27(76) / MTM zone 12,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-81,0.9999
+2022,NAD27(76) / MTM zone 13,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-84,0.9999
+2023,NAD27(76) / MTM zone 14,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-87,0.9999
+2024,NAD27(76) / MTM zone 15,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-90,0.9999
+2025,NAD27(76) / MTM zone 16,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-93,0.9999
+2026,NAD27(76) / MTM zone 17,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,304800,0,0,-96,0.9999
+2027,NAD27(76) / UTM zone 15N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-93,0.9996
+2028,NAD27(76) / UTM zone 16N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-87,0.9996
+2029,NAD27(76) / UTM zone 17N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-81,0.9996
+2030,NAD27(76) / UTM zone 18N,Transverse Mercator,metre,4608,North American Datum 1927 (1976),Clarke 1866,500000,0,0,-75,0.9996
+2031,NAD27(CGQ77) / UTM zone 17N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-81,0.9996
+2032,NAD27(CGQ77) / UTM zone 18N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-75,0.9996
+2033,NAD27(CGQ77) / UTM zone 19N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-69,0.9996
+2034,NAD27(CGQ77) / UTM zone 20N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-63,0.9996
+2035,NAD27(CGQ77) / UTM zone 21N,Transverse Mercator,metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,500000,0,0,-57,0.9996
+2039,Israel / Israeli TM Grid,Transverse Mercator,metre,4141,Israel,GRS 1980,219529.584,31.4403817,626907.39,35.1216261,1.0000067
+2040,Locodjo 1965 / UTM zone 30N,Transverse Mercator,metre,4142,Locodjo 1965,Clarke 1880 (RGS),500000,0,0,-3,0.9996
+2041,Abidjan 1987 / UTM zone 30N,Transverse Mercator,metre,4143,Abidjan 1987,Clarke 1880 (RGS),500000,0,0,-3,0.9996
+2042,Locodjo 1965 / UTM zone 29N,Transverse Mercator,metre,4142,Locodjo 1965,Clarke 1880 (RGS),500000,0,0,-9,0.9996
+2043,Abidjan 1987 / UTM zone 29N,Transverse Mercator,metre,4143,Abidjan 1987,Clarke 1880 (RGS),500000,0,0,-9,0.9996
+2044,Hanoi 1972 / Gauss-Kruger zone 18,Transverse Mercator,metre,4147,Hanoi 1972,Krassowsky 1940,18500000,0,0,105,1
+2045,Hanoi 1972 / Gauss-Kruger zone 19,Transverse Mercator,metre,4147,Hanoi 1972,Krassowsky 1940,19500000,0,0,111,1
+2046,Hartebeesthoek94 / Lo15,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,15,1
+2047,Hartebeesthoek94 / Lo17,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,17,1
+2048,Hartebeesthoek94 / Lo19,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,19,1
+2049,Hartebeesthoek94 / Lo21,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,21,1,0,0,0,0,0,0,0,0,0,
+2050,Hartebeesthoek94 / Lo23,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,23,1,0,0,0,0,0,0,0,0,0,
+2051,Hartebeesthoek94 / Lo25,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,25,1,0,0,0,0,0,0,0,0,0,
+2052,Hartebeesthoek94 / Lo27,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,27,1,0,0,0,0,0,0,0,0,0,
+2053,Hartebeesthoek94 / Lo29,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,29,1,0,0,0,0,0,0,0,0,0,
+2054,Hartebeesthoek94 / Lo31,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,31,1,0,0,0,0,0,0,0,0,0,
+2055,Hartebeesthoek94 / Lo33,Transverse Mercator (South Orientated),metre,4148,Hartebeesthoek94,WGS 84,0,0,0,33,1,0,0,0,0,0,0,0,0,0,
+2056,CH1903+ / LV95,Oblique Mercator,metre,4149,CH1903+,Bessel 1841,0,0,0,0,0,90,46.570866,1200000,90,1,2600000,7.26225,0,0,
+2057,Rassadiran / Nakhl e Taqi,Oblique Mercator,metre,4153,Rassadiran,International 1924,0,0,0,0,0,0.34179803,27.31077837,3044969.194,0.34179803,0.999895934,658377.437,52.3612741,0,0,
+2058,ED50(ED77) / UTM zone 38N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,
+2059,ED50(ED77) / UTM zone 39N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,
+2060,ED50(ED77) / UTM zone 40N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,57,0.9996,0,0,0,0,0,0,0,0,0,
+2061,ED50(ED77) / UTM zone 41N,Transverse Mercator,metre,4154,European Datum 1950(1977),International 1924,500000,0,0,63,0.9996,0,0,0,0,0,0,0,0,0,
+2062,Madrid 1870 (Madrid) / Spain,Lambert Conic Conformal (1SP),metre,4903,Madrid 1870 (Madrid),Struve 1860,600000,40,600000,0,0.998808529,0,0,0,0,0,0,0,0,0,
+2065,S-JTSK (Ferro) / Krovak,Krovak Oblique Conic Conformal,metre,4156,S-JTSK (Ferro),Bessel 1841,0,0,0,0,0,30.1717303,49.3,0,0,0,0,0,78.3,0.9999,42.3
+2066,Mount Dillon / Tobago Grid,Cassini-Soldner,Clarke's link,4157,Mount Dillon,Clarke 1858,187500,11.1507843,180000,-60.4109632,0,0,0,0,0,0,0,0,0,0,
+2067,Naparima 1955 / UTM zone 20N,Transverse Mercator,metre,4158,Naparima 1955,International 1924,500000,0,0,-63,0.9996
+2068,ELD79 / Libya zone 5,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,9,0.9999
+2069,ELD79 / Libya zone 6,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,11,0.9999
+2070,ELD79 / Libya zone 7,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,13,0.9999
+2071,ELD79 / Libya zone 8,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,15,0.9999
+2072,ELD79 / Libya zone 9,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,17,0.9999
+2073,ELD79 / Libya zone 10,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,19,0.9999
+2074,ELD79 / Libya zone 11,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,21,0.9999
+2075,ELD79 / Libya zone 12,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,23,0.9999
+2076,ELD79 / Libya zone 13,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,200000,0,0,25,0.9999
+2077,ELD79 / UTM zone 32N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,9,0.9996
+2078,ELD79 / UTM zone 33N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,15,0.9996
+2079,ELD79 / UTM zone 34N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,21,0.9996
+2080,ELD79 / UTM zone 35N,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,27,0.9996
+2081,Chos Malal 1914 / Argentina zone 2,Transverse Mercator,metre,4160,Chos Malal 1914,International 1924,2500000,-90,0,-69,1
+2082,Pampa del Castillo / Argentina zone 2,Transverse Mercator,metre,4161,Pampa del Castillo,International 1924,2500000,-90,0,-69,1
+2083,Hito XVIII 1963 / Argentina zone 2,Transverse Mercator,metre,4254,Hito XVIII 1963,International 1924,2500000,-90,0,-69,1
+2084,Hito XVIII 1963 / UTM zone 19S,Transverse Mercator,metre,4254,Hito XVIII 1963,International 1924,500000,0,10000000,-69,0.9996
+2087,ELD79 / TM 12 NE,Transverse Mercator,metre,4159,European Libyan Datum 1979,International 1924,500000,0,0,12,0.9996
+2088,Carthage / TM 11 NE,Transverse Mercator,metre,4223,Carthage,Clarke 1880 (IGN),500000,0,0,11,0.9996
+2089,Yemen NGN96 / UTM zone 38N,Transverse Mercator,metre,4163,Yemen National Geodetic Network 1996,WGS 84,500000,0,0,45,0.9996
+2090,Yemen NGN96 / UTM zone 39N,Transverse Mercator,metre,4163,Yemen National Geodetic Network 1996,WGS 84,500000,0,0,51,0.9996
+2093,Hanoi 1972 / GK 106 NE,Transverse Mercator,metre,4147,Hanoi 1972,Krassowsky 1940,500000,0,0,106,1
+2094,WGS 72BE / TM 106 NE,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,106,0.9996
+2095,Bissau / UTM zone 28N,Transverse Mercator,metre,4165,Bissau,International 1924,500000,0,0,-15,0.9996
+2096,Korean 1985 / Korea East Belt,Transverse Mercator,metre,4162,Korean Datum 1985,Bessel 1841,200000,38,500000,129,1
+2097,Korean 1985 / Korea Central Belt,Transverse Mercator,metre,4162,Korean Datum 1985,Bessel 1841,200000,38,500000,127,1
+2098,Korean 1985 / Korea West Belt,Transverse Mercator,metre,4162,Korean Datum 1985,Bessel 1841,200000,38,500000,125,1
+2099,Qatar 1948 / Qatar Grid,Cassini-Soldner,metre,4286,Qatar 1948,Helmert 1906,100000,25.22565,100000,50.4541,
+2100,GGRS87 / Greek Grid,Transverse Mercator,metre,4121,Greek Geodetic Reference System 1987,GRS 1980,500000,0,0,24,0.9996
+2101,Lake / Maracaibo Grid M1,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,0,10.1,-52684.972,-71.3620224,1
+2102,Lake / Maracaibo Grid,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,200000,10.1,147315.028,-71.3620224,1
+2103,Lake / Maracaibo Grid M3,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,500000,10.1,447315.028,-71.3620224,1
+2104,Lake / Maracaibo La Rosa Grid,Lambert Conic Conformal (1SP),metre,4249,Lake,International 1924,-17044,10.1,-23139.97,-71.3620224,1
+2105,NZGD2000 / Mount Eden 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-36.5247,800000,174.4551,0.9999
+2106,NZGD2000 / Bay of Plenty 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-37.454,800000,176.2758,1
+2107,NZGD2000 / Poverty Bay 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-38.3728,800000,177.5308,1
+2108,NZGD2000 / Hawkes Bay 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-39.3903,800000,176.4025,1
+2109,NZGD2000 / Taranaki 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-39.0808,800000,174.134,1
+2110,NZGD2000 / Tuhirangi 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-39.3044,800000,175.3824,1
+2111,NZGD2000 / Wanganui 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-40.1431,800000,175.2917,1
+2112,NZGD2000 / Wairarapa 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-40.5531,800000,175.385,1
+2113,NZGD2000 / Wellington 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.1804,800000,174.4635,1
+2114,NZGD2000 / Collingwood 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-40.4253,800000,172.4019,1
+2115,NZGD2000 / Nelson 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.1628,800000,173.1757,1
+2116,NZGD2000 / Karamea 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.1723,800000,172.0632,1
+2117,NZGD2000 / Buller 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.4838,800000,171.3452,1
+2118,NZGD2000 / Grey 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-42.2001,800000,171.3259,1
+2119,NZGD2000 / Amuri 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-42.412,800000,173.0036,1
+2120,NZGD2000 / Marlborough 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-41.324,800000,173.4807,1
+2121,NZGD2000 / Hokitika 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-42.531,800000,170.5847,1
+2122,NZGD2000 / Okarito 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.0636,800000,170.1539,1
+2123,NZGD2000 / Jacksons Bay 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.584,800000,168.3622,1
+2124,NZGD2000 / Mount Pleasant 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.3526,800000,172.4337,1
+2125,NZGD2000 / Gawler 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-43.4455,800000,171.2138,1
+2126,NZGD2000 / Timaru 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-44.2407,800000,171.0326,1
+2127,NZGD2000 / Lindis Peak 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-44.4406,800000,169.2803,1
+2128,NZGD2000 / Mount Nicholas 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.0758,800000,168.2355,1
+2129,NZGD2000 / Mount York 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.3349,800000,167.4419,1
+2130,NZGD2000 / Observation Point 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.4858,800000,170.3742,1
+2131,NZGD2000 / North Taieri 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-45.5141,800000,170.1657,0.99996
+2132,NZGD2000 / Bluff 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-46.36,800000,168.2034,1
+2133,NZGD2000 / UTM zone 58S,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,500000,0,10000000,165,0.9996
+2134,NZGD2000 / UTM zone 59S,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,500000,0,10000000,171,0.9996
+2135,NZGD2000 / UTM zone 60S,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,500000,0,10000000,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2136,Accra / Ghana National Grid,Transverse Mercator,Gold Coast foot,4168,Accra,War Office,900000,4.4,0,-1,0.99975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2137,Accra / TM 1 NW,Transverse Mercator,metre,4168,Accra,War Office,500000,0,0,-1,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2138,NAD27(CGQ77) / Quebec Lambert,Lambert Conic Conformal (2SP),metre,4609,North American Datum 1927 (CGQ77),Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-68.3,60,0,0
+2154,RGF93 / Lambert-93,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,46.3,3,49,6600000,700000
+2157,IRENET95 / Irish Transverse Mercator,Transverse Mercator,metre,4173,IRENET95,GRS 1980,600000,53.3,750000,-8,0.99982,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2158,IRENET95 / UTM zone 29N,Transverse Mercator,metre,4173,IRENET95,GRS 1980,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2159,Sierra Leone 1924 / New Colony Grid,Transverse Mercator,Gold Coast foot,4174,Sierra Leone Colony 1924,War Office,500000,6.4,0,-12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2160,Sierra Leone 1924 / New War Office Grid,Transverse Mercator,Gold Coast foot,4174,Sierra Leone Colony 1924,War Office,800000,6.4,600000,-12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2161,Sierra Leone 1968 / UTM zone 28N,Transverse Mercator,metre,4175,Sierra Leone 1968,Clarke 1880 (RGS),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2162,Sierra Leone 1968 / UTM zone 29N,Transverse Mercator,metre,4175,Sierra Leone 1968,Clarke 1880 (RGS),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2163,US National Atlas Equal Area,Lambert Azimuthal Equal Area (Spherical),metre,4035,Not specified (based on Clarke 1866 Authalic Sphere),Clarke 1866 Authalic Sphere,0,45,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2164,Locodjo 1965 / TM 5 NW,Transverse Mercator,metre,4142,Locodjo 1965,Clarke 1880 (RGS),500000,0,0,-5,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2165,Abidjan 1987 / TM 5 NW,Transverse Mercator,metre,4143,Abidjan 1987,Clarke 1880 (RGS),500000,0,0,-5,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2169,Luxembourg 1930 / Gauss,Transverse Mercator,metre,4181,Luxembourg 1930,International 1924,80000,49.5,100000,6.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2172,Pulkovo 1942(58) / Poland zone II,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4603000,53.0007,5806000,21.301,0.9998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2173,Pulkovo 1942(58) / Poland zone III,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3501000,53.35,5999000,17.003,0.9998
+2174,Pulkovo 1942(58) / Poland zone IV,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3703000,51.4015,5627000,16.402,0.9998
+2175,Pulkovo 1942(58) / Poland zone V,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,237000,0,-4700000,18.573,0.999983
+2176,ETRS89 / Poland CS2000 zone 5,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,5500000,0,0,15,0.999923
+2177,ETRS89 / Poland CS2000 zone 6,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,6500000,0,0,18,0.999923
+2178,ETRS89 / Poland CS2000 zone 7,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,7500000,0,0,21,0.999923
+2179,ETRS89 / Poland CS2000 zone 8,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,8500000,0,0,24,0.999923
+2180,ETRS89 / Poland CS92,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,-5300000,19,0.9993
+2188,Azores Occidental 1939 / UTM zone 25N,Transverse Mercator,metre,4182,Azores Occidental Islands 1939,International 1924,500000,0,0,-33,0.9996
+2189,Azores Central 1948 / UTM zone 26N,Transverse Mercator,metre,4183,Azores Central Islands 1948,International 1924,500000,0,0,-27,0.9996
+2190,Azores Oriental 1940 / UTM zone 26N,Transverse Mercator,metre,4184,Azores Oriental Islands 1940,International 1924,500000,0,0,-27,0.9996
+2192,ED50 / France EuroLambert,Lambert Conic Conformal (1SP),metre,4154,European Datum 1950,International 1924,600000,46.48,2200000,2.2014025,0.99987742
+2193,NZGD2000 / New Zealand Transverse Mercator 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,1600000,0,10000000,173,0.9996
+2195,NAD83(HARN) / UTM zone 2S,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,10000000,-171,0.9996
+2196,ETRS89 / Kp2000 Jutland,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,200000,0,0,9.3,0.99995
+2197,ETRS89 / Kp2000 Zealand,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,12,0.99995
+2198,ETRS89 / Kp2000 Bornholm,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,900000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2200,ATS77 / New Brunswick Stereographic (ATS77),Oblique Stereographic,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,300000,46.3,800000,-66.3,0.999912,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2201,REGVEN / UTM zone 18N,Transverse Mercator,metre,4189,Red Geodesica Venezolana,GRS 1980,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2202,REGVEN / UTM zone 19N,Transverse Mercator,metre,4189,Red Geodesica Venezolana,GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2203,REGVEN / UTM zone 20N,Transverse Mercator,metre,4189,Red Geodesica Venezolana,GRS 1980,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2204,NAD27 / Tennessee,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.25,34.4,-86,35.15,100000,2000000
+2205,NAD83 / Kentucky North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,500000
+2206,ED50 / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4154,European Datum 1950,International 1924,9500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2207,ED50 / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4154,European Datum 1950,International 1924,10500000,0,0,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2208,ED50 / 3-degree Gauss-Kruger zone 11,Transverse Mercator,metre,4154,European Datum 1950,International 1924,11500000,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2209,ED50 / 3-degree Gauss-Kruger zone 12,Transverse Mercator,metre,4154,European Datum 1950,International 1924,12500000,0,0,36,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2210,ED50 / 3-degree Gauss-Kruger zone 13,Transverse Mercator,metre,4154,European Datum 1950,International 1924,13500000,0,0,39,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2211,ED50 / 3-degree Gauss-Kruger zone 14,Transverse Mercator,metre,4154,European Datum 1950,International 1924,14500000,0,0,42,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2212,ED50 / 3-degree Gauss-Kruger zone 15,Transverse Mercator,metre,4154,European Datum 1950,International 1924,15500000,0,0,45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2213,ETRS89 / TM 30 NE,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,30,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2215,Manoca 1962 / UTM zone 32N,Transverse Mercator,metre,4193,Manoca 1962,Clarke 1880 (IGN),500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2216,Qornoq 1927 / UTM zone 22N,Transverse Mercator,metre,4194,Qornoq 1927,International 1924,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2217,Qornoq 1927 / UTM zone 23N,Transverse Mercator,metre,4194,Qornoq 1927,International 1924,500000,0,0,-45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2218,Scoresbysund 1952 / Greenland zone 5 east,Lambert Conic Conformal (West Orientated),metre,4195,Scoresbysund 1952,International 1924,0,70.3,0,-24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2219,ATS77 / UTM zone 19N,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2220,ATS77 / UTM zone 20N,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2221,Scoresbysund 1952 / Greenland zone 6 east,Lambert Conic Conformal (West Orientated),metre,4195,Scoresbysund 1952,International 1924,0,67.3,0,-32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2222,NAD83 / Arizona East (ft),Transverse Mercator,foot,4269,North American Datum 1983,GRS 1980,700000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2223,NAD83 / Arizona Central (ft),Transverse Mercator,foot,4269,North American Datum 1983,GRS 1980,700000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2224,NAD83 / Arizona West (ft),Transverse Mercator,foot,4269,North American Datum 1983,GRS 1980,700000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2225,NAD83 / California zone 1 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,1640416.667,6561666.667
+2226,NAD83 / California zone 2 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,1640416.667,6561666.667
+2227,NAD83 / California zone 3 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,1640416.667,6561666.667
+2228,NAD83 / California zone 4 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,1640416.667,6561666.667
+2229,NAD83 / California zone 5 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,1640416.667,6561666.667
+2230,NAD83 / California zone 6 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,1640416.667,6561666.667
+2231,NAD83 / Colorado North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,1000000,3000000
+2232,NAD83 / Colorado Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,1000000,3000000
+2233,NAD83 / Colorado South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,1000000,3000000
+2234,NAD83 / Connecticut (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,500000,1000000
+2235,NAD83 / Delaware (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2236,NAD83 / Florida East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2237,NAD83 / Florida West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2238,NAD83 / Florida North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,1968500
+2239,NAD83 / Georgia East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2240,NAD83 / Georgia West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2296583.333,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2241,NAD83 / Idaho East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.667,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2242,NAD83 / Idaho Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2243,NAD83 / Idaho West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2624666.667,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2246,NAD83 / Kentucky North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,1640416.667
+2247,NAD83 / Kentucky South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,1640416.667,1640416.667
+2248,NAD83 / Maryland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,1312333.333
+2249,NAD83 / Massachusetts Mainland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,2460625,656166.667
+2250,NAD83 / Massachusetts Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,1640416.667
+2251,NAD83 / Michigan North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,26246719.16
+2252,NAD83 / Michigan Central (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,19685039.37
+2253,NAD83 / Michigan South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,13123359.58
+2254,NAD83 / Mississippi East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2255,NAD83 / Mississippi West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2296583.333,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2256,NAD83 / Montana (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,1968503.937
+2257,NAD83 / New Mexico East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,541337.5,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2258,NAD83 / New Mexico Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2259,NAD83 / New Mexico West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2723091.667,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2260,NAD83 / New York East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2261,NAD83 / New York Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,820208.333,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2262,NAD83 / New York West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1148291.667,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2263,NAD83 / New York Long Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,984250
+2264,NAD83 / North Carolina (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,2000000
+2265,NAD83 / North Dakota North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,1968503.937
+2266,NAD83 / North Dakota South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,1968503.937
+2267,NAD83 / Oklahoma North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,1968500
+2268,NAD83 / Oklahoma South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,1968500
+2269,NAD83 / Oregon North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,8202099.738
+2270,NAD83 / Oregon South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,4921259.843
+2271,NAD83 / Pennsylvania North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,1968500
+2272,NAD83 / Pennsylvania South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,1968500
+2273,NAD83 / South Carolina (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,2000000
+2274,NAD83 / Tennessee (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,1968500
+2275,NAD83 / Texas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,3280833.333,656166.667
+2276,NAD83 / Texas North Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,6561666.667,1968500
+2277,NAD83 / Texas Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,9842500,2296583.333
+2278,NAD83 / Texas South Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,13123333.33,1968500
+2279,NAD83 / Texas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,16404166.67,984250
+2280,NAD83 / Utah North (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280839.895,1640419.948
+2281,NAD83 / Utah Central (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561679.79,1640419.948
+2282,NAD83 / Utah South (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842519.685,1640419.948
+2283,NAD83 / Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,6561666.667,11482916.67
+2284,NAD83 / Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,3280833.333,11482916.67
+2285,NAD83 / Washington North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,1640416.667
+2286,NAD83 / Washington South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,1640416.667
+2287,NAD83 / Wisconsin North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,1968500
+2288,NAD83 / Wisconsin Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,1968500
+2289,NAD83 / Wisconsin South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,1968500
+2290,ATS77 / Prince Edward Isl. Stereographic (ATS77),Oblique Stereographic,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,700000,47.15,400000,-63,0.999912,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2294,ATS77 / MTM Nova Scotia zone 4,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,4500000,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2295,ATS77 / MTM Nova Scotia zone 5,Transverse Mercator,metre,4041,Average Terrestrial System 1977,Average Terrestrial System 1977,5500000,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2296,Ammassalik 1958 / Greenland zone 7 east,Lambert Conic Conformal (West Orientated),metre,4196,Ammassalik 1958,International 1924,0,64.3,0,-40,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2299,Qornoq 1927 / Greenland zone 2 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,79.3,0,-64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2301,Qornoq 1927 / Greenland zone 3 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,76.3,0,-64,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2303,Qornoq 1927 / Greenland zone 4 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,73.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2304,Qornoq 1927 / Greenland zone 5 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,70.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2305,Qornoq 1927 / Greenland zone 6 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,67.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2306,Qornoq 1927 / Greenland zone 7 west,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,64.3,0,-52,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2307,Qornoq 1927 / Greenland zone 8 east,Lambert Conic Conformal (West Orientated),metre,4194,Qornoq 1927,International 1924,0,61.3,0,-48,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2308,Batavia / TM 109 SE,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,109,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2309,WGS 84 / TM 116 SE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,116,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2310,WGS 84 / TM 132 SE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,132,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2311,WGS 84 / TM 6 NE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,6,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2312,Garoua / UTM zone 33N,Transverse Mercator,metre,4197,Garoua,Clarke 1880 (RGS),500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2313,Kousseri / UTM zone 33N,Transverse Mercator,metre,4198,Kousseri,Clarke 1880 (RGS),500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2314,Trinidad 1903 / Trinidad Grid (ftCla),Cassini-Soldner,Clarke's foot,4302,Trinidad 1903,Clarke 1858,283800,10.263,214500,-61.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2315,Campo Inchauspe / UTM zone 19S,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,500000,0,10000000,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2316,Campo Inchauspe / UTM zone 20S,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,500000,0,10000000,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2317,PSAD56 / ICN Regional,Lambert Conic Conformal (2SP),metre,4248,Provisional South American Datum 1956,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,-66,9,1000000,1000000
+2318,Ain el Abd / Aramco Lambert,Lambert Conic Conformal (2SP),metre,4204,Ain el Abd 1970,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,25.0522236,48,17,0,0
+2319,ED50 / TM27,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2320,ED50 / TM30,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2321,ED50 / TM33,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,33,1
+2322,ED50 / TM36,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,36,1
+2323,ED50 / TM39,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,39,1
+2324,ED50 / TM42,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,42,1
+2325,ED50 / TM45,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,45,1
+2326,Hong Kong 1980 Grid System,Transverse Mercator,metre,4611,Hong Kong 1980,International 1924,836694.05,22.184368,819069.8,114.10428,1
+2327,Xian 1980 / Gauss-Kruger zone 13,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,13500000,0,0,75,1
+2328,Xian 1980 / Gauss-Kruger zone 14,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,14500000,0,0,81,1
+2329,Xian 1980 / Gauss-Kruger zone 15,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,15500000,0,0,87,1
+2330,Xian 1980 / Gauss-Kruger zone 16,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,16500000,0,0,93,1
+2331,Xian 1980 / Gauss-Kruger zone 17,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,17500000,0,0,99,1
+2332,Xian 1980 / Gauss-Kruger zone 18,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,18500000,0,0,105,1
+2333,Xian 1980 / Gauss-Kruger zone 19,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,19500000,0,0,111,1
+2334,Xian 1980 / Gauss-Kruger zone 20,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,20500000,0,0,117,1
+2335,Xian 1980 / Gauss-Kruger zone 21,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,21500000,0,0,123,1
+2336,Xian 1980 / Gauss-Kruger zone 22,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,22500000,0,0,129,1
+2337,Xian 1980 / Gauss-Kruger zone 23,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,23500000,0,0,135,1
+2338,Xian 1980 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,75,1
+2339,Xian 1980 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,81,1
+2340,Xian 1980 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,87,1
+2341,Xian 1980 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,93,1
+2342,Xian 1980 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,99,1
+2343,Xian 1980 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,105,1
+2344,Xian 1980 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,111,1
+2345,Xian 1980 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,117,1
+2346,Xian 1980 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,123,1
+2347,Xian 1980 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,129,1
+2348,Xian 1980 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,135,1
+2349,Xian 1980 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,25500000,0,0,75,1
+2350,Xian 1980 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,26500000,0,0,78,1
+2351,Xian 1980 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,27500000,0,0,81,1
+2352,Xian 1980 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,28500000,0,0,84,1
+2353,Xian 1980 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,29500000,0,0,87,1
+2354,Xian 1980 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,30500000,0,0,90,1
+2355,Xian 1980 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,31500000,0,0,93,1
+2356,Xian 1980 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,32500000,0,0,96,1
+2357,Xian 1980 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,33500000,0,0,99,1
+2358,Xian 1980 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,34500000,0,0,102,1
+2359,Xian 1980 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,35500000,0,0,105,1
+2360,Xian 1980 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,36500000,0,0,108,1
+2361,Xian 1980 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,37500000,0,0,111,1
+2362,Xian 1980 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,38500000,0,0,114,1
+2363,Xian 1980 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,39500000,0,0,117,1
+2364,Xian 1980 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,40500000,0,0,120,1
+2365,Xian 1980 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,41500000,0,0,123,1
+2366,Xian 1980 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,42500000,0,0,126,1
+2367,Xian 1980 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,43500000,0,0,129,1
+2368,Xian 1980 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,44500000,0,0,132,1
+2369,Xian 1980 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,45500000,0,0,135,1
+2370,Xian 1980 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,75,1
+2371,Xian 1980 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,78,1
+2372,Xian 1980 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,81,1
+2373,Xian 1980 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,84,1
+2374,Xian 1980 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,87,1
+2375,Xian 1980 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,90,1
+2376,Xian 1980 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,93,1
+2377,Xian 1980 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,96,1
+2378,Xian 1980 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,99,1
+2379,Xian 1980 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,102,1
+2380,Xian 1980 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,105,1
+2381,Xian 1980 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,108,1
+2382,Xian 1980 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,111,1
+2383,Xian 1980 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,114,1
+2384,Xian 1980 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,117,1
+2385,Xian 1980 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,120,1
+2386,Xian 1980 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,123,1
+2387,Xian 1980 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,126,1
+2388,Xian 1980 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,129,1
+2389,Xian 1980 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,132,1
+2390,Xian 1980 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4610,Xian 1980,IAG 1975,500000,0,0,135,1
+2391,KKJ / Finland zone 1,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,1500000,0,0,21,1
+2392,KKJ / Finland zone 2,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,2500000,0,0,24,1
+2393,KKJ / Finland Uniform Coordinate System,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,3500000,0,0,27,1
+2394,KKJ / Finland zone 4,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,4500000,0,0,30,1
+2395,South Yemen / Gauss-Kruger zone 8,Transverse Mercator,metre,4164,South Yemen,Krassowsky 1940,8500000,0,0,45,1
+2396,South Yemen / Gauss-Kruger zone 9,Transverse Mercator,metre,4164,South Yemen,Krassowsky 1940,9500000,0,0,51,1
+2397,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,3500000,0,0,9,1
+2398,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,4500000,0,0,12,1
+2399,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,5500000,0,0,15,1
+2401,Beijing 1954 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,25500000,0,0,75,1
+2402,Beijing 1954 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,26500000,0,0,78,1
+2403,Beijing 1954 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,27500000,0,0,81,1
+2404,Beijing 1954 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,28500000,0,0,84,1
+2405,Beijing 1954 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,29500000,0,0,87,1
+2406,Beijing 1954 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,30500000,0,0,90,1
+2407,Beijing 1954 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,31500000,0,0,93,1
+2408,Beijing 1954 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,32500000,0,0,96,1
+2409,Beijing 1954 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,33500000,0,0,99,1
+2410,Beijing 1954 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,34500000,0,0,102,1
+2411,Beijing 1954 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,35500000,0,0,105,1
+2412,Beijing 1954 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,36500000,0,0,108,1
+2413,Beijing 1954 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,37500000,0,0,111,1
+2414,Beijing 1954 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,38500000,0,0,114,1
+2415,Beijing 1954 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,39500000,0,0,117,1
+2416,Beijing 1954 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,40500000,0,0,120,1
+2417,Beijing 1954 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,41500000,0,0,123,1
+2418,Beijing 1954 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,42500000,0,0,126,1
+2419,Beijing 1954 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,43500000,0,0,129,1
+2420,Beijing 1954 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,44500000,0,0,132,1
+2421,Beijing 1954 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,45500000,0,0,135,1
+2422,Beijing 1954 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,75,1
+2423,Beijing 1954 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,78,1
+2424,Beijing 1954 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,81,1
+2425,Beijing 1954 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,84,1
+2426,Beijing 1954 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,87,1
+2427,Beijing 1954 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,90,1
+2428,Beijing 1954 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,93,1
+2429,Beijing 1954 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,96,1
+2430,Beijing 1954 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,99,1
+2431,Beijing 1954 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,102,1
+2432,Beijing 1954 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,105,1
+2433,Beijing 1954 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,108,1
+2434,Beijing 1954 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,111,1
+2435,Beijing 1954 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,114,1
+2436,Beijing 1954 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,117,1
+2437,Beijing 1954 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,120,1
+2438,Beijing 1954 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,123,1
+2439,Beijing 1954 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,126,1
+2440,Beijing 1954 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,129,1
+2441,Beijing 1954 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,132,1
+2442,Beijing 1954 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,135,1
+2443,JGD2000 / Japan Plane Rectangular CS I,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,33,0,129.3,0.9999
+2444,JGD2000 / Japan Plane Rectangular CS II,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,33,0,131,0.9999
+2445,JGD2000 / Japan Plane Rectangular CS III,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,132.1,0.9999
+2446,JGD2000 / Japan Plane Rectangular CS IV,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,33,0,133.3,0.9999
+2447,JGD2000 / Japan Plane Rectangular CS V,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,134.2,0.9999
+2448,JGD2000 / Japan Plane Rectangular CS VI,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,136,0.9999
+2449,JGD2000 / Japan Plane Rectangular CS VII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,137.1,0.9999
+2450,JGD2000 / Japan Plane Rectangular CS VIII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,138.3,0.9999
+2451,JGD2000 / Japan Plane Rectangular CS IX,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,36,0,139.5,0.9999
+2452,JGD2000 / Japan Plane Rectangular CS X,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,40,0,140.5,0.9999
+2453,JGD2000 / Japan Plane Rectangular CS XI,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,44,0,140.15,0.9999
+2454,JGD2000 / Japan Plane Rectangular CS XII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,44,0,142.15,0.9999
+2455,JGD2000 / Japan Plane Rectangular CS XIII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,44,0,144.15,0.9999
+2456,JGD2000 / Japan Plane Rectangular CS XIV,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,142,0.9999
+2457,JGD2000 / Japan Plane Rectangular CS XV,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,127.3,0.9999
+2458,JGD2000 / Japan Plane Rectangular CS XVI,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,124,0.9999
+2459,JGD2000 / Japan Plane Rectangular CS XVII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,131,0.9999
+2460,JGD2000 / Japan Plane Rectangular CS XVIII,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,20,0,136,0.9999
+2461,JGD2000 / Japan Plane Rectangular CS XIX,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,0,26,0,154,0.9999
+2462,Albanian 1987 / Gauss-Kruger zone 4,Transverse Mercator,metre,4191,Albanian 1987,Krassowsky 1940,4500000,0,0,21,1
+2463,Pulkovo 1995 / Gauss-Kruger CM 21E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,21,1
+2464,Pulkovo 1995 / Gauss-Kruger CM 27E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,27,1
+2465,Pulkovo 1995 / Gauss-Kruger CM 33E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,33,1
+2466,Pulkovo 1995 / Gauss-Kruger CM 39E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,39,1
+2467,Pulkovo 1995 / Gauss-Kruger CM 45E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,45,1
+2468,Pulkovo 1995 / Gauss-Kruger CM 51E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,51,1
+2469,Pulkovo 1995 / Gauss-Kruger CM 57E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,57,1
+2470,Pulkovo 1995 / Gauss-Kruger CM 63E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,63,1
+2471,Pulkovo 1995 / Gauss-Kruger CM 69E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,69,1
+2472,Pulkovo 1995 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,75,1
+2473,Pulkovo 1995 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,81,1
+2474,Pulkovo 1995 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,87,1
+2475,Pulkovo 1995 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,93,1
+2476,Pulkovo 1995 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,99,1
+2477,Pulkovo 1995 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,105,1
+2478,Pulkovo 1995 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,111,1
+2479,Pulkovo 1995 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,117,1
+2480,Pulkovo 1995 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,123,1
+2481,Pulkovo 1995 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,129,1
+2482,Pulkovo 1995 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,135,1
+2483,Pulkovo 1995 / Gauss-Kruger CM 141E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,141,1
+2484,Pulkovo 1995 / Gauss-Kruger CM 147E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,147,1
+2485,Pulkovo 1995 / Gauss-Kruger CM 153E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,153,1
+2486,Pulkovo 1995 / Gauss-Kruger CM 159E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,159,1
+2487,Pulkovo 1995 / Gauss-Kruger CM 165E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,165,1
+2488,Pulkovo 1995 / Gauss-Kruger CM 171E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,171,1
+2489,Pulkovo 1995 / Gauss-Kruger CM 177E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,177,1
+2490,Pulkovo 1995 / Gauss-Kruger CM 177W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-177,1
+2491,Pulkovo 1995 / Gauss-Kruger CM 171W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-171,1
+2494,Pulkovo 1942 / Gauss-Kruger CM 21E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,21,1
+2495,Pulkovo 1942 / Gauss-Kruger CM 27E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,27,1
+2496,Pulkovo 1942 / Gauss-Kruger CM 33E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,33,1
+2497,Pulkovo 1942 / Gauss-Kruger CM 39E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,39,1
+2498,Pulkovo 1942 / Gauss-Kruger CM 45E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,45,1
+2499,Pulkovo 1942 / Gauss-Kruger CM 51E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,51,1
+2500,Pulkovo 1942 / Gauss-Kruger CM 57E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,57,1
+2501,Pulkovo 1942 / Gauss-Kruger CM 63E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,63,1
+2502,Pulkovo 1942 / Gauss-Kruger CM 69E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,69,1
+2503,Pulkovo 1942 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,75,1
+2504,Pulkovo 1942 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,81,1
+2505,Pulkovo 1942 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,87,1
+2506,Pulkovo 1942 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,93,1
+2507,Pulkovo 1942 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,99,1
+2508,Pulkovo 1942 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,105,1
+2509,Pulkovo 1942 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,111,1
+2510,Pulkovo 1942 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,117,1
+2511,Pulkovo 1942 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,123,1
+2512,Pulkovo 1942 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,129,1
+2513,Pulkovo 1942 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,135,1
+2514,Pulkovo 1942 / Gauss-Kruger CM 141E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,141,1
+2515,Pulkovo 1942 / Gauss-Kruger CM 147E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,147,1
+2516,Pulkovo 1942 / Gauss-Kruger CM 153E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,153,1
+2517,Pulkovo 1942 / Gauss-Kruger CM 159E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,159,1
+2518,Pulkovo 1942 / Gauss-Kruger CM 165E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,165,1
+2519,Pulkovo 1942 / Gauss-Kruger CM 171E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,171,1
+2520,Pulkovo 1942 / Gauss-Kruger CM 177E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,177,1
+2521,Pulkovo 1942 / Gauss-Kruger CM 177W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-177,1
+2522,Pulkovo 1942 / Gauss-Kruger CM 171W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-171,1
+2523,Pulkovo 1942 / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,7500000,0,0,21,1
+2524,Pulkovo 1942 / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,8500000,0,0,24,1
+2525,Pulkovo 1942 / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,9500000,0,0,27,1
+2526,Pulkovo 1942 / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,10500000,0,0,30,1
+2527,Pulkovo 1942 / 3-degree Gauss-Kruger zone 11,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,11500000,0,0,33,1
+2528,Pulkovo 1942 / 3-degree Gauss-Kruger zone 12,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,12500000,0,0,36,1
+2529,Pulkovo 1942 / 3-degree Gauss-Kruger zone 13,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,13500000,0,0,39,1
+2530,Pulkovo 1942 / 3-degree Gauss-Kruger zone 14,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,14500000,0,0,42,1
+2531,Pulkovo 1942 / 3-degree Gauss-Kruger zone 15,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,15500000,0,0,45,1
+2532,Pulkovo 1942 / 3-degree Gauss-Kruger zone 16,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,16500000,0,0,48,1
+2533,Pulkovo 1942 / 3-degree Gauss-Kruger zone 17,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,17500000,0,0,51,1
+2534,Pulkovo 1942 / 3-degree Gauss-Kruger zone 18,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,18500000,0,0,54,1
+2535,Pulkovo 1942 / 3-degree Gauss-Kruger zone 19,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,19500000,0,0,57,1
+2536,Pulkovo 1942 / 3-degree Gauss-Kruger zone 20,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,20500000,0,0,60,1
+2537,Pulkovo 1942 / 3-degree Gauss-Kruger zone 21,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,21500000,0,0,63,1
+2538,Pulkovo 1942 / 3-degree Gauss-Kruger zone 22,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,22500000,0,0,66,1
+2539,Pulkovo 1942 / 3-degree Gauss-Kruger zone 23,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,23500000,0,0,69,1
+2540,Pulkovo 1942 / 3-degree Gauss-Kruger zone 24,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,24500000,0,0,72,1
+2541,Pulkovo 1942 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,25500000,0,0,75,1
+2542,Pulkovo 1942 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,26500000,0,0,78,1
+2543,Pulkovo 1942 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,27500000,0,0,81,1
+2544,Pulkovo 1942 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,28500000,0,0,84,1
+2545,Pulkovo 1942 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,29500000,0,0,87,1
+2546,Pulkovo 1942 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,30500000,0,0,90,1
+2547,Pulkovo 1942 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,31500000,0,0,93,1
+2548,Pulkovo 1942 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,32500000,0,0,96,1
+2549,Pulkovo 1942 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,33500000,0,0,99,1
+2551,Pulkovo 1942 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,34500000,0,0,102,1
+2552,Pulkovo 1942 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,35500000,0,0,105,1
+2553,Pulkovo 1942 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,36500000,0,0,108,1
+2554,Pulkovo 1942 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,37500000,0,0,111,1
+2555,Pulkovo 1942 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,38500000,0,0,114,1
+2556,Pulkovo 1942 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,39500000,0,0,117,1
+2557,Pulkovo 1942 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,40500000,0,0,120,1
+2558,Pulkovo 1942 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,41500000,0,0,123,1
+2559,Pulkovo 1942 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,42500000,0,0,126,1
+2560,Pulkovo 1942 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,43500000,0,0,129,1
+2561,Pulkovo 1942 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,44500000,0,0,132,1
+2562,Pulkovo 1942 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,45500000,0,0,135,1
+2563,Pulkovo 1942 / 3-degree Gauss-Kruger zone 46,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,46500000,0,0,138,1
+2564,Pulkovo 1942 / 3-degree Gauss-Kruger zone 47,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,47500000,0,0,141,1
+2565,Pulkovo 1942 / 3-degree Gauss-Kruger zone 48,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,48500000,0,0,144,1
+2566,Pulkovo 1942 / 3-degree Gauss-Kruger zone 49,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,49500000,0,0,147,1
+2567,Pulkovo 1942 / 3-degree Gauss-Kruger zone 50,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,50500000,0,0,150,1
+2568,Pulkovo 1942 / 3-degree Gauss-Kruger zone 51,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,51500000,0,0,153,1
+2569,Pulkovo 1942 / 3-degree Gauss-Kruger zone 52,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,52500000,0,0,156,1
+2570,Pulkovo 1942 / 3-degree Gauss-Kruger zone 53,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,53500000,0,0,159,1
+2571,Pulkovo 1942 / 3-degree Gauss-Kruger zone 54,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,54500000,0,0,162,1
+2572,Pulkovo 1942 / 3-degree Gauss-Kruger zone 55,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,55500000,0,0,165,1
+2573,Pulkovo 1942 / 3-degree Gauss-Kruger zone 56,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,56500000,0,0,168,1
+2574,Pulkovo 1942 / 3-degree Gauss-Kruger zone 57,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,57500000,0,0,171,1
+2575,Pulkovo 1942 / 3-degree Gauss-Kruger zone 58,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,58500000,0,0,174,1
+2576,Pulkovo 1942 / 3-degree Gauss-Kruger zone 59,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,59500000,0,0,177,1
+2578,Pulkovo 1942 / 3-degree Gauss-Kruger zone 61,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,61500000,0,0,-177,1
+2579,Pulkovo 1942 / 3-degree Gauss-Kruger zone 62,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,62500000,0,0,-174,1
+2580,Pulkovo 1942 / 3-degree Gauss-Kruger zone 63,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,63500000,0,0,-171,1
+2581,Pulkovo 1942 / 3-degree Gauss-Kruger zone 64,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,64500000,0,0,-168,1
+2582,Pulkovo 1942 / 3-degree Gauss-Kruger CM 21E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,21,1
+2583,Pulkovo 1942 / 3-degree Gauss-Kruger CM 24E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,24,1
+2584,Pulkovo 1942 / 3-degree Gauss-Kruger CM 27E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,27,1
+2585,Pulkovo 1942 / 3-degree Gauss-Kruger CM 30E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,30,1
+2586,Pulkovo 1942 / 3-degree Gauss-Kruger CM 33E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,33,1
+2587,Pulkovo 1942 / 3-degree Gauss-Kruger CM 36E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,36,1
+2588,Pulkovo 1942 / 3-degree Gauss-Kruger CM 39E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,39,1
+2589,Pulkovo 1942 / 3-degree Gauss-Kruger CM 42E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,42,1
+2590,Pulkovo 1942 / 3-degree Gauss-Kruger CM 45E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,45,1
+2591,Pulkovo 1942 / 3-degree Gauss-Kruger CM 48E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,48,1
+2592,Pulkovo 1942 / 3-degree Gauss-Kruger CM 51E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,51,1
+2593,Pulkovo 1942 / 3-degree Gauss-Kruger CM 54E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,54,1
+2594,Pulkovo 1942 / 3-degree Gauss-Kruger CM 57E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,57,1
+2595,Pulkovo 1942 / 3-degree Gauss-Kruger CM 60E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,60,1
+2596,Pulkovo 1942 / 3-degree Gauss-Kruger CM 63E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,63,1
+2597,Pulkovo 1942 / 3-degree Gauss-Kruger CM 66E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,66,1
+2598,Pulkovo 1942 / 3-degree Gauss-Kruger CM 69E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,69,1
+2599,Pulkovo 1942 / 3-degree Gauss-Kruger CM 72E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,72,1
+2601,Pulkovo 1942 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,75,1
+2602,Pulkovo 1942 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,78,1
+2603,Pulkovo 1942 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,81,1
+2604,Pulkovo 1942 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,84,1
+2605,Pulkovo 1942 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,87,1
+2606,Pulkovo 1942 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,90,1
+2607,Pulkovo 1942 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,93,1
+2608,Pulkovo 1942 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,96,1
+2609,Pulkovo 1942 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,99,1
+2610,Pulkovo 1942 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,102,1
+2611,Pulkovo 1942 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,105,1
+2612,Pulkovo 1942 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,108,1
+2613,Pulkovo 1942 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,111,1
+2614,Pulkovo 1942 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,114,1
+2615,Pulkovo 1942 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,117,1
+2616,Pulkovo 1942 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,120,1
+2617,Pulkovo 1942 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,123,1
+2618,Pulkovo 1942 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,126,1
+2619,Pulkovo 1942 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,129,1
+2620,Pulkovo 1942 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,132,1
+2621,Pulkovo 1942 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,135,1
+2622,Pulkovo 1942 / 3-degree Gauss-Kruger CM 138E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,138,1
+2623,Pulkovo 1942 / 3-degree Gauss-Kruger CM 141E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,141,1
+2624,Pulkovo 1942 / 3-degree Gauss-Kruger CM 144E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,144,1
+2625,Pulkovo 1942 / 3-degree Gauss-Kruger CM 147E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,147,1
+2626,Pulkovo 1942 / 3-degree Gauss-Kruger CM 150E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,150,1
+2627,Pulkovo 1942 / 3-degree Gauss-Kruger CM 153E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,153,1
+2628,Pulkovo 1942 / 3-degree Gauss-Kruger CM 156E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,156,1
+2629,Pulkovo 1942 / 3-degree Gauss-Kruger CM 159E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,159,1
+2630,Pulkovo 1942 / 3-degree Gauss-Kruger CM 162E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,162,1
+2631,Pulkovo 1942 / 3-degree Gauss-Kruger CM 165E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,165,1
+2632,Pulkovo 1942 / 3-degree Gauss-Kruger CM 168E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,168,1
+2633,Pulkovo 1942 / 3-degree Gauss-Kruger CM 171E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,171,1
+2634,Pulkovo 1942 / 3-degree Gauss-Kruger CM 174E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,174,1
+2635,Pulkovo 1942 / 3-degree Gauss-Kruger CM 177E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,177,1
+2636,Pulkovo 1942 / 3-degree Gauss-Kruger CM 180E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,180,1
+2637,Pulkovo 1942 / 3-degree Gauss-Kruger CM 177W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-177,1
+2638,Pulkovo 1942 / 3-degree Gauss-Kruger CM 174W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-174,1
+2639,Pulkovo 1942 / 3-degree Gauss-Kruger CM 171W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-171,1
+2640,Pulkovo 1942 / 3-degree Gauss-Kruger CM 168W,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,-168,1
+2641,Pulkovo 1995 / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,7500000,0,0,21,1
+2642,Pulkovo 1995 / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,8500000,0,0,24,1
+2643,Pulkovo 1995 / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,9500000,0,0,27,1
+2644,Pulkovo 1995 / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,10500000,0,0,30,1
+2645,Pulkovo 1995 / 3-degree Gauss-Kruger zone 11,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,11500000,0,0,33,1
+2646,Pulkovo 1995 / 3-degree Gauss-Kruger zone 12,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,12500000,0,0,36,1
+2647,Pulkovo 1995 / 3-degree Gauss-Kruger zone 13,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,13500000,0,0,39,1
+2648,Pulkovo 1995 / 3-degree Gauss-Kruger zone 14,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,14500000,0,0,42,1
+2649,Pulkovo 1995 / 3-degree Gauss-Kruger zone 15,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,15500000,0,0,45,1
+2650,Pulkovo 1995 / 3-degree Gauss-Kruger zone 16,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,16500000,0,0,48,1
+2651,Pulkovo 1995 / 3-degree Gauss-Kruger zone 17,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,17500000,0,0,51,1
+2652,Pulkovo 1995 / 3-degree Gauss-Kruger zone 18,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,18500000,0,0,54,1
+2653,Pulkovo 1995 / 3-degree Gauss-Kruger zone 19,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,19500000,0,0,57,1
+2654,Pulkovo 1995 / 3-degree Gauss-Kruger zone 20,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,20500000,0,0,60,1
+2655,Pulkovo 1995 / 3-degree Gauss-Kruger zone 21,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,21500000,0,0,63,1
+2656,Pulkovo 1995 / 3-degree Gauss-Kruger zone 22,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,22500000,0,0,66,1
+2657,Pulkovo 1995 / 3-degree Gauss-Kruger zone 23,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,23500000,0,0,69,1
+2658,Pulkovo 1995 / 3-degree Gauss-Kruger zone 24,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,24500000,0,0,72,1
+2659,Pulkovo 1995 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,25500000,0,0,75,1
+2660,Pulkovo 1995 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,26500000,0,0,78,1
+2661,Pulkovo 1995 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,27500000,0,0,81,1
+2662,Pulkovo 1995 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,28500000,0,0,84,1
+2663,Pulkovo 1995 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,29500000,0,0,87,1
+2664,Pulkovo 1995 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,30500000,0,0,90,1
+2665,Pulkovo 1995 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,31500000,0,0,93,1
+2666,Pulkovo 1995 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,32500000,0,0,96,1
+2667,Pulkovo 1995 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,33500000,0,0,99,1
+2668,Pulkovo 1995 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,34500000,0,0,102,1
+2669,Pulkovo 1995 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,35500000,0,0,105,1
+2670,Pulkovo 1995 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,36500000,0,0,108,1
+2671,Pulkovo 1995 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,37500000,0,0,111,1
+2672,Pulkovo 1995 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,38500000,0,0,114,1
+2673,Pulkovo 1995 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,39500000,0,0,117,1
+2674,Pulkovo 1995 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,40500000,0,0,120,1
+2675,Pulkovo 1995 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,41500000,0,0,123,1
+2676,Pulkovo 1995 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,42500000,0,0,126,1
+2677,Pulkovo 1995 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,43500000,0,0,129,1
+2678,Pulkovo 1995 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,44500000,0,0,132,1
+2679,Pulkovo 1995 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,45500000,0,0,135,1
+2680,Pulkovo 1995 / 3-degree Gauss-Kruger zone 46,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,46500000,0,0,138,1
+2681,Pulkovo 1995 / 3-degree Gauss-Kruger zone 47,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,47500000,0,0,141,1
+2682,Pulkovo 1995 / 3-degree Gauss-Kruger zone 48,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,48500000,0,0,144,1
+2683,Pulkovo 1995 / 3-degree Gauss-Kruger zone 49,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,49500000,0,0,147,1
+2684,Pulkovo 1995 / 3-degree Gauss-Kruger zone 50,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,50500000,0,0,150,1
+2685,Pulkovo 1995 / 3-degree Gauss-Kruger zone 51,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,51500000,0,0,153,1
+2686,Pulkovo 1995 / 3-degree Gauss-Kruger zone 52,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,52500000,0,0,156,1
+2687,Pulkovo 1995 / 3-degree Gauss-Kruger zone 53,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,53500000,0,0,159,1
+2688,Pulkovo 1995 / 3-degree Gauss-Kruger zone 54,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,54500000,0,0,162,1
+2689,Pulkovo 1995 / 3-degree Gauss-Kruger zone 55,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,55500000,0,0,165,1
+2690,Pulkovo 1995 / 3-degree Gauss-Kruger zone 56,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,56500000,0,0,168,1
+2691,Pulkovo 1995 / 3-degree Gauss-Kruger zone 57,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,57500000,0,0,171,1
+2692,Pulkovo 1995 / 3-degree Gauss-Kruger zone 58,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,58500000,0,0,174,1
+2693,Pulkovo 1995 / 3-degree Gauss-Kruger zone 59,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,59500000,0,0,177,1
+2695,Pulkovo 1995 / 3-degree Gauss-Kruger zone 61,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,61500000,0,0,-177,1
+2696,Pulkovo 1995 / 3-degree Gauss-Kruger zone 62,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,62500000,0,0,-174,1
+2697,Pulkovo 1995 / 3-degree Gauss-Kruger zone 63,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,63500000,0,0,-171,1
+2698,Pulkovo 1995 / 3-degree Gauss-Kruger zone 64,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,64500000,0,0,-168,1
+2699,Pulkovo 1995 / 3-degree Gauss-Kruger CM 21E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,21,1
+2700,Pulkovo 1995 / 3-degree Gauss-Kruger CM 24E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,24,1
+2701,Pulkovo 1995 / 3-degree Gauss-Kruger CM 27E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,27,1
+2702,Pulkovo 1995 / 3-degree Gauss-Kruger CM 30E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,30,1
+2703,Pulkovo 1995 / 3-degree Gauss-Kruger CM 33E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,33,1
+2704,Pulkovo 1995 / 3-degree Gauss-Kruger CM 36E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,36,1
+2705,Pulkovo 1995 / 3-degree Gauss-Kruger CM 39E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,39,1
+2706,Pulkovo 1995 / 3-degree Gauss-Kruger CM 42E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,42,1
+2707,Pulkovo 1995 / 3-degree Gauss-Kruger CM 45E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,45,1
+2708,Pulkovo 1995 / 3-degree Gauss-Kruger CM 48E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,48,1
+2709,Pulkovo 1995 / 3-degree Gauss-Kruger CM 51E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,51,1
+2710,Pulkovo 1995 / 3-degree Gauss-Kruger CM 54E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,54,1
+2711,Pulkovo 1995 / 3-degree Gauss-Kruger CM 57E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,57,1
+2712,Pulkovo 1995 / 3-degree Gauss-Kruger CM 60E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,60,1
+2713,Pulkovo 1995 / 3-degree Gauss-Kruger CM 63E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,63,1
+2714,Pulkovo 1995 / 3-degree Gauss-Kruger CM 66E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,66,1
+2715,Pulkovo 1995 / 3-degree Gauss-Kruger CM 69E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,69,1
+2716,Pulkovo 1995 / 3-degree Gauss-Kruger CM 72E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,72,1
+2717,Pulkovo 1995 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,75,1
+2718,Pulkovo 1995 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,78,1
+2719,Pulkovo 1995 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,81,1
+2720,Pulkovo 1995 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,84,1
+2721,Pulkovo 1995 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,87,1
+2722,Pulkovo 1995 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,90,1
+2723,Pulkovo 1995 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,93,1
+2724,Pulkovo 1995 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,96,1
+2725,Pulkovo 1995 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,99,1
+2726,Pulkovo 1995 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,102,1
+2727,Pulkovo 1995 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,105,1
+2728,Pulkovo 1995 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,108,1
+2729,Pulkovo 1995 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,111,1
+2730,Pulkovo 1995 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,114,1
+2731,Pulkovo 1995 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,117,1
+2732,Pulkovo 1995 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,120,1
+2733,Pulkovo 1995 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,123,1
+2734,Pulkovo 1995 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,126,1
+2735,Pulkovo 1995 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,129,1
+2736,Tete / UTM zone 36S,Transverse Mercator,metre,4127,Tete,Clarke 1866,500000,0,10000000,33,0.9996
+2737,Tete / UTM zone 37S,Transverse Mercator,metre,4127,Tete,Clarke 1866,500000,0,10000000,39,0.9996
+2738,Pulkovo 1995 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,132,1
+2739,Pulkovo 1995 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,135,1
+2740,Pulkovo 1995 / 3-degree Gauss-Kruger CM 138E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,138,1
+2741,Pulkovo 1995 / 3-degree Gauss-Kruger CM 141E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,141,1
+2742,Pulkovo 1995 / 3-degree Gauss-Kruger CM 144E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,144,1
+2743,Pulkovo 1995 / 3-degree Gauss-Kruger CM 147E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,147,1
+2744,Pulkovo 1995 / 3-degree Gauss-Kruger CM 150E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,150,1
+2745,Pulkovo 1995 / 3-degree Gauss-Kruger CM 153E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,153,1
+2746,Pulkovo 1995 / 3-degree Gauss-Kruger CM 156E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,156,1
+2747,Pulkovo 1995 / 3-degree Gauss-Kruger CM 159E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,159,1
+2748,Pulkovo 1995 / 3-degree Gauss-Kruger CM 162E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,162,1
+2749,Pulkovo 1995 / 3-degree Gauss-Kruger CM 165E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,165,1
+2750,Pulkovo 1995 / 3-degree Gauss-Kruger CM 168E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,168,1
+2751,Pulkovo 1995 / 3-degree Gauss-Kruger CM 171E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,171,1
+2752,Pulkovo 1995 / 3-degree Gauss-Kruger CM 174E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,174,1
+2753,Pulkovo 1995 / 3-degree Gauss-Kruger CM 177E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,177,1
+2754,Pulkovo 1995 / 3-degree Gauss-Kruger CM 180E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,180,1
+2755,Pulkovo 1995 / 3-degree Gauss-Kruger CM 177W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-177,1
+2756,Pulkovo 1995 / 3-degree Gauss-Kruger CM 174W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-174,1
+2757,Pulkovo 1995 / 3-degree Gauss-Kruger CM 171W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-171,1
+2758,Pulkovo 1995 / 3-degree Gauss-Kruger CM 168W,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,-168,1
+2759,NAD83(HARN) / Alabama East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,30.3,0,-85.5,0.99996
+2760,NAD83(HARN) / Alabama West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,600000,30,0,-87.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2761,NAD83(HARN) / Arizona East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,213360,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2762,NAD83(HARN) / Arizona Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,213360,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2763,NAD83(HARN) / Arizona West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,213360,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2764,NAD83(HARN) / Arkansas North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,400000
+2765,NAD83(HARN) / Arkansas South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,400000,400000
+2766,NAD83(HARN) / California zone 1,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,500000,2000000
+2767,NAD83(HARN) / California zone 2,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,500000,2000000
+2768,NAD83(HARN) / California zone 3,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,500000,2000000
+2769,NAD83(HARN) / California zone 4,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,500000,2000000
+2770,NAD83(HARN) / California zone 5,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,500000,2000000
+2771,NAD83(HARN) / California zone 6,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,500000,2000000
+2772,NAD83(HARN) / Colorado North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,304800.6096,914401.8289
+2773,NAD83(HARN) / Colorado Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,304800.6096,914401.8289
+2774,NAD83(HARN) / Colorado South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,304800.6096,914401.8289
+2775,NAD83(HARN) / Connecticut,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,152400.3048,304800.6096
+2776,NAD83(HARN) / Delaware,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2777,NAD83(HARN) / Florida East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2778,NAD83(HARN) / Florida West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2779,NAD83(HARN) / Florida North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,600000
+2780,NAD83(HARN) / Georgia East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2781,NAD83(HARN) / Georgia West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2782,NAD83(HARN) / Hawaii zone 1,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,18.5,0,-155.3,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2783,NAD83(HARN) / Hawaii zone 2,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,20.2,0,-156.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2784,NAD83(HARN) / Hawaii zone 3,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2785,NAD83(HARN) / Hawaii zone 4,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,21.5,0,-159.3,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2786,NAD83(HARN) / Hawaii zone 5,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,21.4,0,-160.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2787,NAD83(HARN) / Idaho East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2788,NAD83(HARN) / Idaho Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2789,NAD83(HARN) / Idaho West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,800000,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2790,NAD83(HARN) / Illinois East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2791,NAD83(HARN) / Illinois West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2792,NAD83(HARN) / Indiana East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,100000,37.3,250000,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2793,NAD83(HARN) / Indiana West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,900000,37.3,250000,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2794,NAD83(HARN) / Iowa North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,1000000,1500000
+2795,NAD83(HARN) / Iowa South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,500000
+2796,NAD83(HARN) / Kansas North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,400000
+2797,NAD83(HARN) / Kansas South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,400000,400000
+2798,NAD83(HARN) / Kentucky North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,500000
+2799,NAD83(HARN) / Kentucky South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,500000,500000
+2800,NAD83(HARN) / Louisiana North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,1000000
+2801,NAD83(HARN) / Louisiana South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,1000000
+2802,NAD83(HARN) / Maine East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2803,NAD83(HARN) / Maine West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,900000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2804,NAD83(HARN) / Maryland,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,400000
+2805,NAD83(HARN) / Massachusetts Mainland,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,750000,200000
+2806,NAD83(HARN) / Massachusetts Island,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,500000
+2807,NAD83(HARN) / Michigan North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,8000000
+2808,NAD83(HARN) / Michigan Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,6000000
+2809,NAD83(HARN) / Michigan South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,4000000
+2810,NAD83(HARN) / Minnesota North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,100000,800000
+2811,NAD83(HARN) / Minnesota Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,100000,800000
+2812,NAD83(HARN) / Minnesota South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,100000,800000
+2813,NAD83(HARN) / Mississippi East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2814,NAD83(HARN) / Mississippi West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2815,NAD83(HARN) / Missouri East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,250000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2816,NAD83(HARN) / Missouri Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2817,NAD83(HARN) / Missouri West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,850000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2818,NAD83(HARN) / Montana,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,600000
+2819,NAD83(HARN) / Nebraska,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,500000
+2820,NAD83(HARN) / Nevada East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,34.45,8000000,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2821,NAD83(HARN) / Nevada Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,34.45,6000000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2822,NAD83(HARN) / Nevada West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,800000,34.45,4000000,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2823,NAD83(HARN) / New Hampshire,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2824,NAD83(HARN) / New Jersey,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2825,NAD83(HARN) / New Mexico East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,165000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2826,NAD83(HARN) / New Mexico Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2827,NAD83(HARN) / New Mexico West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,830000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2828,NAD83(HARN) / New York East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2829,NAD83(HARN) / New York Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,250000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2830,NAD83(HARN) / New York West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,350000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2831,NAD83(HARN) / New York Long Island,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,300000
+2832,NAD83(HARN) / North Dakota North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,600000
+2833,NAD83(HARN) / North Dakota South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,600000
+2834,NAD83(HARN) / Ohio North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,600000
+2835,NAD83(HARN) / Ohio South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,600000
+2836,NAD83(HARN) / Oklahoma North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,600000
+2837,NAD83(HARN) / Oklahoma South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,600000
+2838,NAD83(HARN) / Oregon North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,2500000
+2839,NAD83(HARN) / Oregon South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,1500000
+2840,NAD83(HARN) / Rhode Island,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,100000,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2841,NAD83(HARN) / South Dakota North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,600000
+2842,NAD83(HARN) / South Dakota South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,600000
+2843,NAD83(HARN) / Tennessee,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,600000
+2844,NAD83(HARN) / Texas North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,1000000,200000
+2845,NAD83(HARN) / Texas North Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,2000000,600000
+2846,NAD83(HARN) / Texas Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,3000000,700000
+2847,NAD83(HARN) / Texas South Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,4000000,600000
+2848,NAD83(HARN) / Texas South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,5000000,300000
+2849,NAD83(HARN) / Utah North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,1000000,500000
+2850,NAD83(HARN) / Utah Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,2000000,500000
+2851,NAD83(HARN) / Utah South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,3000000,500000
+2852,NAD83(HARN) / Vermont,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2853,NAD83(HARN) / Virginia North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,2000000,3500000
+2854,NAD83(HARN) / Virginia South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,1000000,3500000
+2855,NAD83(HARN) / Washington North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,500000
+2856,NAD83(HARN) / Washington South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,500000
+2857,NAD83(HARN) / West Virginia North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,600000
+2858,NAD83(HARN) / West Virginia South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,600000
+2859,NAD83(HARN) / Wisconsin North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,600000
+2860,NAD83(HARN) / Wisconsin Central,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,600000
+2861,NAD83(HARN) / Wisconsin South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,600000
+2862,NAD83(HARN) / Wyoming East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,200000,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2863,NAD83(HARN) / Wyoming East Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,400000,40.3,100000,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2864,NAD83(HARN) / Wyoming West Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,600000,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2865,NAD83(HARN) / Wyoming West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,800000,40.3,100000,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2866,NAD83(HARN) / Puerto Rico and Virgin Is.,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,200000,200000
+2867,NAD83(HARN) / Arizona East (ft),Transverse Mercator,foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2868,NAD83(HARN) / Arizona Central (ft),Transverse Mercator,foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2869,NAD83(HARN) / Arizona West (ft),Transverse Mercator,foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2870,NAD83(HARN) / California zone 1 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,1640416.667,6561666.667
+2871,NAD83(HARN) / California zone 2 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,1640416.667,6561666.667
+2872,NAD83(HARN) / California zone 3 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,1640416.667,6561666.667
+2873,NAD83(HARN) / California zone 4 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,1640416.667,6561666.667
+2874,NAD83(HARN) / California zone 5 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,1640416.667,6561666.667
+2875,NAD83(HARN) / California zone 6 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,1640416.667,6561666.667
+2876,NAD83(HARN) / Colorado North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,1000000,3000000
+2877,NAD83(HARN) / Colorado Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,1000000,3000000
+2878,NAD83(HARN) / Colorado South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,1000000,3000000
+2879,NAD83(HARN) / Connecticut (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,500000,1000000
+2880,NAD83(HARN) / Delaware (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2881,NAD83(HARN) / Florida East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2882,NAD83(HARN) / Florida West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2883,NAD83(HARN) / Florida North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,1968500
+2884,NAD83(HARN) / Georgia East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2885,NAD83(HARN) / Georgia West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2296583.333,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2886,NAD83(HARN) / Idaho East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.667,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2887,NAD83(HARN) / Idaho Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2888,NAD83(HARN) / Idaho West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2624666.667,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2891,NAD83(HARN) / Kentucky North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,1640416.667
+2892,NAD83(HARN) / Kentucky South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,1640416.667,1640416.667
+2893,NAD83(HARN) / Maryland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,1312333.333
+2894,NAD83(HARN) / Massachusetts Mainland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,2460625,656166.667
+2895,NAD83(HARN) / Massachusetts Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,1640416.667
+2896,NAD83(HARN) / Michigan North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,26246719.16
+2897,NAD83(HARN) / Michigan Central (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,19685039.37
+2898,NAD83(HARN) / Michigan South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,13123359.58
+2899,NAD83(HARN) / Mississippi East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2900,NAD83(HARN) / Mississippi West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2296583.333,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2901,NAD83(HARN) / Montana (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,1968503.937
+2902,NAD83(HARN) / New Mexico East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,541337.5,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2903,NAD83(HARN) / New Mexico Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2904,NAD83(HARN) / New Mexico West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2723091.667,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2905,NAD83(HARN) / New York East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2906,NAD83(HARN) / New York Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,820208.333,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2907,NAD83(HARN) / New York West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1148291.667,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2908,NAD83(HARN) / New York Long Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,984250
+2909,NAD83(HARN) / North Dakota North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,1968503.937
+2910,NAD83(HARN) / North Dakota South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,1968503.937
+2911,NAD83(HARN) / Oklahoma North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,1968500
+2912,NAD83(HARN) / Oklahoma South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,1968500
+2913,NAD83(HARN) / Oregon North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,8202099.738
+2914,NAD83(HARN) / Oregon South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,4921259.843
+2915,NAD83(HARN) / Tennessee (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,1968500
+2916,NAD83(HARN) / Texas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,3280833.333,656166.667
+2917,NAD83(HARN) / Texas North Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,6561666.667,1968500
+2918,NAD83(HARN) / Texas Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,9842500,2296583.333
+2919,NAD83(HARN) / Texas South Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,13123333.33,1968500
+2920,NAD83(HARN) / Texas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,16404166.67,984250
+2921,NAD83(HARN) / Utah North (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280839.895,1640419.948
+2922,NAD83(HARN) / Utah Central (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561679.79,1640419.948
+2923,NAD83(HARN) / Utah South (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842519.685,1640419.948
+2924,NAD83(HARN) / Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,6561666.667,11482916.67
+2925,NAD83(HARN) / Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,3280833.333,11482916.67
+2926,NAD83(HARN) / Washington North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,1640416.667
+2927,NAD83(HARN) / Washington South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,1640416.667
+2928,NAD83(HARN) / Wisconsin North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,1968500
+2929,NAD83(HARN) / Wisconsin Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,1968500
+2930,NAD83(HARN) / Wisconsin South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,1968500
+2931,Beduaram / TM 13 NE,Transverse Mercator,metre,4213,Beduaram,Clarke 1880 (IGN),500000,0,0,13,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2932,QND95 / Qatar National Grid,Transverse Mercator,metre,4614,Qatar National Datum 1995,International 1924,200000,24.27,300000,51.13,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2933,Segara / UTM zone 50S,Transverse Mercator,metre,4820,Gunung Segara,Bessel 1841,500000,0,10000000,117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2935,Pulkovo 1942 / CS63 zone A1,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,1300000,0.07,0,41.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2936,Pulkovo 1942 / CS63 zone A2,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,2300000,0.07,0,44.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2937,Pulkovo 1942 / CS63 zone A3,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,3300000,0.07,0,47.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2938,Pulkovo 1942 / CS63 zone A4,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,4300000,0.07,0,50.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2939,Pulkovo 1942 / CS63 zone K2,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,2300000,0.08,0,50.46,1
+2940,Pulkovo 1942 / CS63 zone K3,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,3300000,0.08,0,53.46,1
+2941,Pulkovo 1942 / CS63 zone K4,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,4300000,0.08,0,56.46,1
+2942,Porto Santo / UTM zone 28N,Transverse Mercator,metre,4615,Porto Santo 1936,International 1924,500000,0,0,-15,0.9996
+2943,Selvagem Grande / UTM zone 28N,Transverse Mercator,metre,4616,Selvagem Grande,International 1924,500000,0,0,-15,0.9996
+2944,NAD83(CSRS) / SCoPQ zone 2,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-55.3,0.9999
+2945,NAD83(CSRS) / MTM zone 3,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-58.3,0.9999
+2946,NAD83(CSRS) / MTM zone 4,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-61.3,0.9999
+2947,NAD83(CSRS) / MTM zone 5,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-64.3,0.9999
+2948,NAD83(CSRS) / MTM zone 6,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-67.3,0.9999
+2949,NAD83(CSRS) / MTM zone 7,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-70.3,0.9999
+2950,NAD83(CSRS) / MTM zone 8,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-73.3,0.9999
+2951,NAD83(CSRS) / MTM zone 9,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-76.3,0.9999
+2952,NAD83(CSRS) / MTM zone 10,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-79.3,0.9999
+2953,NAD83(CSRS) / New Brunswick Stereographic,Oblique Stereographic,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,2500000,46.3,7500000,-66.3,0.999912
+2954,NAD83(CSRS) / Prince Edward Isl. Stereographic (NAD83),Oblique Stereographic,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,400000,47.15,800000,-63,0.999912
+2955,NAD83(CSRS) / UTM zone 11N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2956,NAD83(CSRS) / UTM zone 12N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2957,NAD83(CSRS) / UTM zone 13N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2958,NAD83(CSRS) / UTM zone 17N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2959,NAD83(CSRS) / UTM zone 18N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2960,NAD83(CSRS) / UTM zone 19N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2961,NAD83(CSRS) / UTM zone 20N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2962,NAD83(CSRS) / UTM zone 21N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2963,Lisbon 1890 (Lisbon) / Portugal Bonne,Bonne (South Orientated),metre,4666,Lisbon 1890 (Lisbon),Bessel 1841,0,39.4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2964,NAD27 / Alaska Albers,Albers Equal Area,US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,50,-154,55,0,0
+2965,NAD83 / Indiana East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,328083.333,37.3,820208.333,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2966,NAD83 / Indiana West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2952750,37.3,820208.333,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2967,NAD83(HARN) / Indiana East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,328083.333,37.3,820208.333,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2968,NAD83(HARN) / Indiana West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2952750,37.3,820208.333,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2969,Fort Marigot / UTM zone 20N,Transverse Mercator,metre,4621,Fort Marigot,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2970,Guadeloupe 1948 / UTM zone 20N,Transverse Mercator,metre,4622,Guadeloupe 1948,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2971,CSG67 / UTM zone 22N,Transverse Mercator,metre,4623,Centre Spatial Guyanais 1967,International 1924,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2972,RGFG95 / UTM zone 22N,Transverse Mercator,metre,4624,Reseau Geodesique Francais Guyane 1995,GRS 1980,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2973,Martinique 1938 / UTM zone 20N,Transverse Mercator,metre,0,Martinique 1938,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2975,RGR92 / UTM zone 40S,Transverse Mercator,metre,4627,Reseau Geodesique de la Reunion 1992,GRS 1980,500000,0,10000000,57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2976,Tahiti 52 / UTM zone 6S,Transverse Mercator,metre,4628,Tahiti 52,International 1924,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2977,Tahaa 54 / UTM zone 5S,Transverse Mercator,metre,4629,Tahaa 54,International 1924,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2978,IGN72 Nuku Hiva / UTM zone 7S,Transverse Mercator,metre,4630,IGN72 Nuku Hiva,International 1924,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2980,Combani 1950 / UTM zone 38S,Transverse Mercator,metre,4632,Combani 1950,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2981,IGN56 Lifou / UTM zone 58S,Transverse Mercator,metre,4633,IGN56 Lifou,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2985,Petrels 1972 / Terre Adelie Polar Stereographic,Polar Stereographic (variant C),metre,4636,Petrels 1972,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,0,0,200000,300000,-67
+2986,Perroud 1950 / Terre Adelie Polar Stereographic,Polar Stereographic (variant C),metre,4637,Pointe Geologie Perroud 1950,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,0,0,200000,300000,-67
+2987,Saint Pierre et Miquelon 1950 / UTM zone 21N,Transverse Mercator,metre,4638,Saint Pierre et Miquelon 1950,Clarke 1866,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2988,MOP78 / UTM zone 1S,Transverse Mercator,metre,4639,MOP78,International 1924,500000,0,10000000,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2991,NAD83 / Oregon Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,400000,
+2992,NAD83 / Oregon Lambert (ft),Lambert Conic Conformal (2SP),foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,1312335.958,
+2993,NAD83(HARN) / Oregon Lambert,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,400000,
+2994,NAD83(HARN) / Oregon Lambert (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,1312335.958
+2995,IGN53 Mare / UTM zone 58S,Transverse Mercator,metre,4641,IGN53 Mare,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2996,ST84 Ile des Pins / UTM zone 58S,Transverse Mercator,metre,4642,ST84 Ile des Pins,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2997,ST71 Belep / UTM zone 58S,Transverse Mercator,metre,4643,ST71 Belep,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2998,NEA74 Noumea / UTM zone 58S,Transverse Mercator,metre,4644,NEA74 Noumea,International 1924,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2999,Grand Comoros / UTM zone 38S,Transverse Mercator,metre,4646,Grand Comoros,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3000,Segara / NEIEZ,Mercator (1SP),metre,4820,Gunung Segara,Bessel 1841,3900000,0,900000,110,0.997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3001,Batavia / NEIEZ,Mercator (1SP),metre,4211,Batavia,Bessel 1841,3900000,0,900000,110,0.997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3002,Makassar / NEIEZ,Mercator (1SP),metre,4257,Makassar,Bessel 1841,3900000,0,900000,110,0.997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3003,Monte Mario / Italy zone 1,Transverse Mercator,metre,4265,Monte Mario,International 1924,1500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3004,Monte Mario / Italy zone 2,Transverse Mercator,metre,4265,Monte Mario,International 1924,2520000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3005,NAD83 / BC Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58.3,45,-126,50,0,1000000
+3006,SWEREF99 TM,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3007,SWEREF99 12 00,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3008,SWEREF99 13 30,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,13.3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3009,SWEREF99 15 00,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3010,SWEREF99 16 30,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,16.3,1
+3011,SWEREF99 18 00,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,18,1
+3012,SWEREF99 14 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,14.15,1
+3013,SWEREF99 15 45,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,15.45,1
+3014,SWEREF99 17 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,17.15,1
+3015,SWEREF99 18 45,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,18.45,1
+3016,SWEREF99 20 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,20.15,1
+3017,SWEREF99 21 45,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,21.45,1
+3018,SWEREF99 23 15,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,150000,0,0,23.15,1
+3019,RT90 7.5 gon V,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,11.18298,1
+3020,RT90 5 gon V,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,13.33298,1
+3021,RT90 2.5 gon V,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,15.48298,1
+3022,RT90 0 gon,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,18.03298,1
+3023,RT90 2.5 gon O,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,20.18298,1
+3024,RT90 5 gon O,Transverse Mercator,metre,4124,Rikets koordinatsystem 1990,Bessel 1841,1500000,0,0,22.33298,1
+3025,RT38 7.5 gon V,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,11.18298,1
+3026,RT38 5 gon V,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,13.33298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3027,RT38 2.5 gon V,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,15.48298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3028,RT38 0 gon,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,18.03298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3029,RT38 2.5 gon O,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,20.18298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3030,RT38 5 gon O,Transverse Mercator,metre,4308,Stockholm 1938,Bessel 1841,1500000,0,0,22.33298,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3031,WGS 84 / Antarctic Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71
+3032,WGS 84 / Australian Antarctic Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,6000000,0,6000000,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,0,0,-71
+3033,WGS 84 / Australian Antarctic Lambert,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-74.3,-50,70,-68.3,6000000,6000000,
+3034,ETRS89 / ETRS-LCC,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,52,10,35,2800000,4000000,
+3035,ETRS89 / ETRS-LAEA,Lambert Azimuthal Equal Area,metre,4258,European Terrestrial Reference System 1989,GRS 1980,4321000,52,3210000,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3036,Moznet / UTM zone 36S,Transverse Mercator,metre,4130,Moznet (ITRF94),WGS 84,500000,0,10000000,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3037,Moznet / UTM zone 37S,Transverse Mercator,metre,4130,Moznet (ITRF94),WGS 84,500000,0,10000000,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3038,ETRS89 / ETRS-TM26,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3039,ETRS89 / ETRS-TM27,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3040,ETRS89 / ETRS-TM28,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3041,ETRS89 / ETRS-TM29,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3042,ETRS89 / ETRS-TM30,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3043,ETRS89 / ETRS-TM31,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3044,ETRS89 / ETRS-TM32,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3045,ETRS89 / ETRS-TM33,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3046,ETRS89 / ETRS-TM34,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3047,ETRS89 / ETRS-TM35,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3048,ETRS89 / ETRS-TM36,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3049,ETRS89 / ETRS-TM37,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3050,ETRS89 / ETRS-TM38,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3051,ETRS89 / ETRS-TM39,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3052,Reykjavik 1900 / Lambert 1900,Lambert Conic Conformal (West Orientated),metre,4657,Reykjavik 1900,Danish 1876,0,65,0,-19.011965,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3053,Hjorsey 1955 / Lambert 1955,Lambert Conic Conformal (West Orientated),metre,4658,Hjorsey 1955,International 1924,500000,65,500000,-18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3054,Hjorsey 1955 / UTM zone 26N,Transverse Mercator,metre,4658,Hjorsey 1955,International 1924,500000,0,0,-27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3055,Hjorsey 1955 / UTM zone 27N,Transverse Mercator,metre,4658,Hjorsey 1955,International 1924,500000,0,0,-21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3056,Hjorsey 1955 / UTM zone 28N,Transverse Mercator,metre,4658,Hjorsey 1955,International 1924,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3057,ISN93 / Lambert 1993,Lambert Conic Conformal (2SP),metre,4659,Islands Network 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65.45,65,-19,64.15,500000,500000
+3058,Helle 1954 / Jan Mayen Grid,Transverse Mercator,metre,4660,Helle 1954,International 1924,50000,0,-7800000,-8.3,1
+3059,LKS92 / Latvia TM,Transverse Mercator,metre,4661,Latvia 1992,GRS 1980,500000,0,-6000000,24,0.9996
+3060,IGN72 Grande Terre / UTM zone 58S,Transverse Mercator,metre,4662,IGN72 Grande Terre,International 1924,500000,0,10000000,165,0.9996
+3061,Porto Santo 1995 / UTM zone 28N,Transverse Mercator,metre,4663,Porto Santo 1995,International 1924,500000,0,0,-15,0.9996
+3062,Azores Oriental 1995 / UTM zone 26N,Transverse Mercator,metre,4664,Azores Oriental Islands 1995,International 1924,500000,0,0,-27,0.9996
+3063,Azores Central 1995 / UTM zone 26N,Transverse Mercator,metre,4665,Azores Central Islands 1995,International 1924,500000,0,0,-27,0.9996
+3064,IGM95 / UTM zone 32N,Transverse Mercator,metre,4670,Istituto Geografico Militaire 1995,WGS 84,500000,0,0,9,0.9996
+3065,IGM95 / UTM zone 33N,Transverse Mercator,metre,4670,Istituto Geografico Militaire 1995,WGS 84,500000,0,0,15,0.9996
+3066,ED50 / Jordan TM,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,-3000000,37,0.9998
+3067,ETRS89 / ETRS-TM35FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,0.9996
+3068,DHDN / Soldner Berlin,Cassini-Soldner,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,40000,52.25071338,10000,13.37379332,
+3069,NAD27 / Wisconsin Transverse Mercator,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,-4500000,-90,0.9996
+3070,NAD83 / Wisconsin Transverse Mercator,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,520000,0,-4480000,-90,0.9996
+3071,NAD83(HARN) / Wisconsin Transverse Mercator,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,520000,0,-4480000,-90,0.9996
+3072,NAD83 / Maine CS2000 East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,43.5,0,-67.523,0.99998
+3074,NAD83 / Maine CS2000 West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,42.5,0,-70.223,0.99998
+3075,NAD83(HARN) / Maine CS2000 East,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,700000,43.5,0,-67.523,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3077,NAD83(HARN) / Maine CS2000 West,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,300000,42.5,0,-70.223,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3078,NAD83 / Michigan Oblique Mercator,Hotine Oblique Mercator,metre,4269,North American Datum 1983,GRS 1980,2546731.496,0,-4354009.816,0,0,337.25556,45.1833,0,337.25556,0.9996,0,-86,0,0,0,0,0,0,0,0,
+3079,NAD83(HARN) / Michigan Oblique Mercator,Hotine Oblique Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2546731.496,0,-4354009.816,0,0,337.25556,45.1833,0,337.25556,0.9996,0,-86,0,0,0,0,0,0,0,0,
+3080,NAD27 / Shackleford,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.55,31.1,-100,27.25,3000000,3000000
+3081,NAD83 / Texas State Mapping System,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.55,31.1,-100,27.25,1000000,1000000
+3082,NAD83 / Texas Centric Lambert Conformal,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,5000000,1500000
+3083,NAD83 / Texas Centric Albers Equal Area,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,6000000,1500000
+3084,NAD83(HARN) / Texas Centric Lambert Conformal,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,5000000,1500000
+3085,NAD83(HARN) / Texas Centric Albers Equal Area,Albers Equal Area,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,6000000,1500000
+3086,NAD83 / Florida GDL Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.3,24,-84,24,0,400000
+3087,NAD83(HARN) / Florida GDL Albers,Albers Equal Area,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.3,24,-84,24,0,400000
+3088,NAD83 / Kentucky Single Zone,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,1000000,1500000
+3089,NAD83 / Kentucky Single Zone (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,3280833.333,4921250
+3090,NAD83(HARN) / Kentucky Single Zone,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,1000000,1500000
+3091,NAD83(HARN) / Kentucky Single Zone (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,3280833.333,4921250
+3092,Tokyo / UTM zone 51N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3093,Tokyo / UTM zone 52N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3094,Tokyo / UTM zone 53N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3095,Tokyo / UTM zone 54N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3096,Tokyo / UTM zone 55N,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,500000,0,0,147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3097,JGD2000 / UTM zone 51N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3098,JGD2000 / UTM zone 52N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3099,JGD2000 / UTM zone 53N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3100,JGD2000 / UTM zone 54N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3101,JGD2000 / UTM zone 55N,Transverse Mercator,metre,4612,Japanese Geodetic Datum 2000,GRS 1980,500000,0,0,147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3102,American Samoa 1962 / American Samoa Lambert,Lambert Conic Conformal (1SP),US survey foot,4169,American Samoa 1962,Clarke 1866,500000,-14.16,312234.65,-170,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3106,Gulshan 303 / Bangladesh Transverse Mercator,Transverse Mercator,metre,0,Gulshan 303,Everest 1830 (1937 Adjustment),500000,0,0,90,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3107,GDA94 / SA Lambert,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,-32,135,-28,2000000,1000000
+3108,ETRS89 / Guernsey Grid,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,47000,49.3,50000,-2.25,0.999997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3109,ETRS89 / Jersey Transverse Mercator,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,40000,49.225,70000,-2.135,0.9999999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3110,AGD66 / Vicgrid66,Lambert Conic Conformal (2SP),metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-38,-37,145,-36,4500000,2500000
+3111,GDA94 / Vicgrid94,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-38,-37,145,-36,2500000,2500000
+3112,GDA94 / Geoscience Australia Lambert,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,0,134,-18,0,0
+3113,GDA94 / BCSG02,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,50000,-28,100000,153,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3114,MAGNA-SIRGAS / Colombia Far West zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-80.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3115,MAGNA-SIRGAS / Colombia West zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-77.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3116,MAGNA-SIRGAS / Colombia Bogota zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-74.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3117,MAGNA-SIRGAS / Colombia East Central zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-71.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3118,MAGNA-SIRGAS / Colombia East zone,Transverse Mercator,metre,4170,Marco Geocentrico Nacional de Referencia,GRS 1980,1000000,4.35463215,1000000,-68.04390285,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3119,Douala 1948 / AEF west,Transverse Mercator,metre,4192,Douala 1948,International 1924,1000000,0,1000000,10.3,0.999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3120,Pulkovo 1942(58) / Poland zone I,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4637000,50.373,5467000,21.05,0.9998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3121,PRS92 / Philippines zone 1,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,117,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3122,PRS92 / Philippines zone 2,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,119,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3123,PRS92 / Philippines zone 3,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,121,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3124,PRS92 / Philippines zone 4,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,123,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3125,PRS92 / Philippines zone 5,Transverse Mercator,metre,0,Philippine Reference System 1992,Clarke 1866,500000,0,0,125,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3126,ETRS89 / ETRS-GK19FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,19,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3127,ETRS89 / ETRS-GK20FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,20,1
+3128,ETRS89 / ETRS-GK21FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,21,1
+3129,ETRS89 / ETRS-GK22FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,22,1
+3130,ETRS89 / ETRS-GK23FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,23,1
+3131,ETRS89 / ETRS-GK24FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,24,1
+3132,ETRS89 / ETRS-GK25FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,25,1
+3133,ETRS89 / ETRS-GK26FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,26,1
+3134,ETRS89 / ETRS-GK27FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,1
+3135,ETRS89 / ETRS-GK28FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,28,1
+3136,ETRS89 / ETRS-GK29FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,29,1
+3137,ETRS89 / ETRS-GK30FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,30,1
+3138,ETRS89 / ETRS-GK31FIN,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,31,1
+3139,Vanua Levu 1915 / Vanua Levu Grid,Hyperbolic Cassini-Soldner,link,0,Vanua Levu 1915,Clarke 1880 (international foot),1251331.8,-16.15,1662888.5,179.2,
+3140,Viti Levu 1912 / Viti Levu Grid,Cassini-Soldner,link,0,Viti Levu 1912,Clarke 1880 (international foot),544000,-18,704000,178,
+3141,Fiji 1956 / UTM zone 60S,Transverse Mercator,metre,0,Fiji 1956,International 1924,500000,0,10000000,177,0.9996
+3142,Fiji 1956 / UTM zone 1S,Transverse Mercator,metre,0,Fiji 1956,International 1924,500000,0,10000000,-177,0.9996
+3144,FD54 / Faroe Lambert,Lambert Conic Conformal (West Orientated),metre,0,Faroe Datum 1954,International 1924,500000,62,500000,-9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3145,ETRS89 / Faroe Lambert,Lambert Conic Conformal (West Orientated),metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,62,500000,-9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3146,Pulkovo 1942 / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,6500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3147,Pulkovo 1942 / 3-degree Gauss-Kruger CM 18E,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3148,Indian 1960 / UTM zone 48N,Transverse Mercator,metre,4131,Indian 1960,Everest 1830 (1937 Adjustment),500000,0,0,105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3149,Indian 1960 / UTM zone 49N,Transverse Mercator,metre,4131,Indian 1960,Everest 1830 (1937 Adjustment),500000,0,0,111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3150,Pulkovo 1995 / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,6500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3151,Pulkovo 1995 / 3-degree Gauss-Kruger CM 18E,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3152,ST74,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,100178.1808,0,-6500614.784,18.0328044,0.99999425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3153,NAD83(CSRS) / BC Albers,Albers Equal Area,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58.3,45,-126,50,0,1000000
+3154,NAD83(CSRS) / UTM zone 7N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3155,NAD83(CSRS) / UTM zone 8N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3156,NAD83(CSRS) / UTM zone 9N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3157,NAD83(CSRS) / UTM zone 10N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3158,NAD83(CSRS) / UTM zone 14N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3159,NAD83(CSRS) / UTM zone 15N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3160,NAD83(CSRS) / UTM zone 16N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3161,NAD83 / Ontario MNR Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53.5,0,-85,44.5,6430000,930000
+3162,NAD83(CSRS) / Ontario MNR Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53.5,0,-85,44.5,6430000,930000
+3163,RGNC91-93 / Lambert New Caledonia,Lambert Conic Conformal (2SP),metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.2,-21.3,166,-20.4,300000,400000
+3164,ST87 Ouvea / UTM zone 58S,Transverse Mercator,metre,4635,ST87 Ouvea,WGS 84,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3165,NEA74 Noumea / Noumea Lambert,Lambert Conic Conformal (2SP),metre,4644,NEA74 Noumea,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.17408903,-22.16108903,166.2632733,-22.14408903,1.02,0.66
+3166,NEA74 Noumea / Noumea Lambert 2,Lambert Conic Conformal (2SP),metre,4644,NEA74 Noumea,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-22.1741,-22.1611,166.2633,-22.1441,-2.354,8.313
+3167,Kertau (RSO) / RSO Malaya (ch),Hotine Oblique Mercator,British chain (Sears 1922 truncated),4245,Kertau (RSO),Everest 1830 (RSO 1969),40000,0,0,0,0,323.0132846,4,0,323.0748369,0.99984,0,102.15,0,0,0,0,0,0,0,0,
+3168,Kertau (RSO) / RSO Malaya (m),Hotine Oblique Mercator,metre,4245,Kertau (RSO),Everest 1830 (RSO 1969),804670.24,0,0,0,0,323.0132846,4,0,323.0748369,0.99984,0,102.15,0,0,0,0,0,0,0,0,
+3169,RGNC91-93 / UTM zone 57S,Transverse Mercator,metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,500000,0,10000000,159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3170,RGNC91-93 / UTM zone 58S,Transverse Mercator,metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,500000,0,10000000,165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3171,RGNC91-93 / UTM zone 59S,Transverse Mercator,metre,4645,Reseau Geodesique de Nouvelle Caledonie 91-93,GRS 1980,500000,0,10000000,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3172,IGN53 Mare / UTM zone 59S,Transverse Mercator,metre,4641,IGN53 Mare,International 1924,500000,0,10000000,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3173,fk89 / Faroe Lambert FK89,Lambert Conic Conformal (West Orientated),metre,0,fk89,International 1924,700000,62,700000,-9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3174,NAD83 / Great Lakes Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.01518,45.568977,-84.455955,42.122774,1000000,1000000
+3175,NAD83 / Great Lakes and St Lawrence Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.01518,45.568977,-83.248627,42.122774,1000000,1000000
+3176,Indian 1960 / TM 106 NE,Transverse Mercator,metre,4131,Indian 1960,Everest 1830 (1937 Adjustment),500000,0,0,106,0.9996
+3177,LGD2006 / Libya TM,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,1000000,0,0,17,0.9965
+3178,GR96 / UTM zone 18N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-75,0.9996
+3179,GR96 / UTM zone 19N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-69,0.9996
+3180,GR96 / UTM zone 20N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-63,0.9996
+3181,GR96 / UTM zone 21N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-57,0.9996
+3182,GR96 / UTM zone 22N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-51,0.9996
+3183,GR96 / UTM zone 23N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-45,0.9996
+3184,GR96 / UTM zone 24N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-39,0.9996
+3185,GR96 / UTM zone 25N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-33,0.9996
+3186,GR96 / UTM zone 26N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-27,0.9996
+3187,GR96 / UTM zone 27N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-21,0.9996
+3188,GR96 / UTM zone 28N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-15,0.9996
+3189,GR96 / UTM zone 29N,Transverse Mercator,metre,0,Greenland 1996,GRS 1980,500000,0,0,-9,0.9996
+3190,LGD2006 / Libya TM zone 5,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,9,0.99995
+3191,LGD2006 / Libya TM zone 6,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,11,0.99995
+3192,LGD2006 / Libya TM zone 7,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,13,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3193,LGD2006 / Libya TM zone 8,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,15,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3194,LGD2006 / Libya TM zone 9,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,17,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3195,LGD2006 / Libya TM zone 10,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,19,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3196,LGD2006 / Libya TM zone 11,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,21,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3197,LGD2006 / Libya TM zone 12,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,23,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3198,LGD2006 / Libya TM zone 13,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,200000,0,0,25,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3199,LGD2006 / UTM zone 32N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3200,FD58 / Iraq zone,Lambert Conic Conformal (1SP),metre,4132,Final Datum 1958,Clarke 1880 (RGS),1500000,32.3,1166200,45,0.998786408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3201,LGD2006 / UTM zone 33N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3202,LGD2006 / UTM zone 34N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3203,LGD2006 / UTM zone 35N,Transverse Mercator,metre,0,Libyan Geodetic Datum 2006,International 1924,500000,0,0,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3204,WGS 84 / SCAR IMW SP19-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-63.2,-90,-66,-60.4,0,0
+3205,WGS 84 / SCAR IMW SP21-22,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-63.2,-90,-54,-60.4,0,0
+3206,WGS 84 / SCAR IMW SP23-24,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-63.2,-90,-42,-60.4,0,0
+3207,WGS 84 / SCAR IMW SQ01-02,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,-174,-64.4,0,0
+3208,WGS 84 / SCAR IMW SQ19-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,-66,-64.4,0,0
+3209,WGS 84 / SCAR IMW SQ21-22,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,-54,-64.4,0,0
+3210,WGS 84 / SCAR IMW SQ37-38,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,42,-64.4,0,0
+3211,WGS 84 / SCAR IMW SQ39-40,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,54,-64.4,0,0
+3212,WGS 84 / SCAR IMW SQ41-42,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,66,-64.4,0,0
+3213,WGS 84 / SCAR IMW SQ43-44,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,78,-64.4,0,0
+3214,WGS 84 / SCAR IMW SQ45-46,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,90,-64.4,0,0
+3215,WGS 84 / SCAR IMW SQ47-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,102,-64.4,0,0
+3216,WGS 84 / SCAR IMW SQ49-50,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,114,-64.4,0,0
+3217,WGS 84 / SCAR IMW SQ51-52,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,126,-64.4,0,0
+3218,WGS 84 / SCAR IMW SQ53-54,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,138,-64.4,0,0
+3219,WGS 84 / SCAR IMW SQ55-56,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,150,-64.4,0,0
+3220,WGS 84 / SCAR IMW SQ57-58,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-67.2,-90,162,-64.4,0,0
+3221,WGS 84 / SCAR IMW SR13-14,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-102,-68.4,0,0
+3222,WGS 84 / SCAR IMW SR15-16,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-90,-68.4,0,0
+3223,WGS 84 / SCAR IMW SR17-18,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-78,-68.4,0,0
+3224,WGS 84 / SCAR IMW SR19-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-66,-68.4,0,0
+3225,WGS 84 / SCAR IMW SR27-28,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-18,-68.4,0,0
+3226,WGS 84 / SCAR IMW SR29-30,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,-6,-68.4,0,0
+3227,WGS 84 / SCAR IMW SR31-32,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,6,-68.4,0,0
+3228,WGS 84 / SCAR IMW SR33-34,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,18,-68.4,0,0
+3229,WGS 84 / SCAR IMW SR35-36,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,30,-68.4,0,0
+3230,WGS 84 / SCAR IMW SR37-38,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,42,-68.4,0,0
+3231,WGS 84 / SCAR IMW SR39-40,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,54,-68.4,0,0
+3232,WGS 84 / SCAR IMW SR41-42,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,66,-68.4,0,0
+3233,WGS 84 / SCAR IMW SR43-44,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,78,-68.4,0,0
+3234,WGS 84 / SCAR IMW SR45-46,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,90,-68.4,0,0
+3235,WGS 84 / SCAR IMW SR47-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,102,-68.4,0,0
+3236,WGS 84 / SCAR IMW SR49-50,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,114,-68.4,0,0
+3237,WGS 84 / SCAR IMW SR51-52,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,126,-68.4,0,0
+3238,WGS 84 / SCAR IMW SR53-54,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,138,-68.4,0,0
+3239,WGS 84 / SCAR IMW SR55-56,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,150,-68.4,0,0
+3240,WGS 84 / SCAR IMW SR57-58,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,162,-68.4,0,0
+3241,WGS 84 / SCAR IMW SR59-60,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-71.2,-90,174,-68.4,0,0
+3242,WGS 84 / SCAR IMW SS04-06,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-153,-72.4,0,0
+3243,WGS 84 / SCAR IMW SS07-09,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-135,-72.4,0,0
+3244,WGS 84 / SCAR IMW SS10-12,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-117,-72.4,0,0
+3245,WGS 84 / SCAR IMW SS13-15,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-99,-72.4,0,0
+3246,WGS 84 / SCAR IMW SS16-18,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-81,-72.4,0,0
+3247,WGS 84 / SCAR IMW SS19-21,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-63,-72.4,0,0
+3248,WGS 84 / SCAR IMW SS25-27,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-27,-72.4,0,0
+3249,WGS 84 / SCAR IMW SS28-30,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,-9,-72.4,0,0
+3250,WGS 84 / SCAR IMW SS31-33,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,9,-72.4,0,0
+3251,WGS 84 / SCAR IMW SS34-36,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,27,-72.4,0,0
+3252,WGS 84 / SCAR IMW SS37-39,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,45,-72.4,0,0
+3253,WGS 84 / SCAR IMW SS40-42,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,63,-72.4,0,0
+3254,WGS 84 / SCAR IMW SS43-45,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,81,-72.4,0,0
+3255,WGS 84 / SCAR IMW SS46-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,99,-72.4,0,0
+3256,WGS 84 / SCAR IMW SS49-51,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,117,-72.4,0,0
+3257,WGS 84 / SCAR IMW SS52-54,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,135,-72.4,0,0
+3258,WGS 84 / SCAR IMW SS55-57,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,153,-72.4,0,0
+3259,WGS 84 / SCAR IMW SS58-60,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75.2,-90,171,-72.4,0,0
+3260,WGS 84 / SCAR IMW ST01-04,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-168,-76.4,0,0
+3261,WGS 84 / SCAR IMW ST05-08,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-144,-76.4,0,0
+3262,WGS 84 / SCAR IMW ST09-12,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-120,-76.4,0,0
+3263,WGS 84 / SCAR IMW ST13-16,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-96,-76.4,0,0
+3264,WGS 84 / SCAR IMW ST17-20,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-72,-76.4,0,0
+3265,WGS 84 / SCAR IMW ST21-24,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-48,-76.4,0,0
+3266,WGS 84 / SCAR IMW ST25-28,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,-24,-76.4,0,0
+3267,WGS 84 / SCAR IMW ST29-32,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,0,-76.4,0,0
+3268,WGS 84 / SCAR IMW ST33-36,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,24,-76.4,0,0
+3269,WGS 84 / SCAR IMW ST37-40,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,48,-76.4,0,0
+3270,WGS 84 / SCAR IMW ST41-44,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,72,-76.4,0,0
+3271,WGS 84 / SCAR IMW ST45-48,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,96,-76.4,0,0
+3272,WGS 84 / SCAR IMW ST49-52,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,120,-76.4,0,0,
+3273,WGS 84 / SCAR IMW ST53-56,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,144,-76.4,0,0,
+3274,WGS 84 / SCAR IMW ST57-60,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,168,-76.4,0,0,
+3275,WGS 84 / SCAR IMW SU01-05,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-165,0,0,0,0,0,0,-80.1419
+3276,WGS 84 / SCAR IMW SU06-10,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-135,0,0,0,0,0,0,-80.1419
+3277,WGS 84 / SCAR IMW SU11-15,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-105,0,0,0,0,0,0,-80.1419
+3278,WGS 84 / SCAR IMW SU16-20,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-75,0,0,0,0,0,0,-80.1419
+3279,WGS 84 / SCAR IMW SU21-25,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-45,0,0,0,0,0,0,-80.1419
+3280,WGS 84 / SCAR IMW SU26-30,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,0,0,0,0,0,-80.1419
+3281,WGS 84 / SCAR IMW SU31-35,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,-80.1419
+3282,WGS 84 / SCAR IMW SU36-40,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0,0,0,0,-80.1419
+3283,WGS 84 / SCAR IMW SU41-45,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,0,0,0,0,0,-80.1419
+3284,WGS 84 / SCAR IMW SU46-50,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,0,0,0,0,0,0,-80.1419
+3285,WGS 84 / SCAR IMW SU51-55,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,0,0,0,0,0,0,-80.1419
+3286,WGS 84 / SCAR IMW SU56-60,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,-80.1419
+3287,WGS 84 / SCAR IMW SV01-10,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-150,0,0,0,0,0,0,-80.1419
+3288,WGS 84 / SCAR IMW SV11-20,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-90,0,0,0,0,0,0,-80.1419
+3289,WGS 84 / SCAR IMW SV21-30,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-30,0,0,0,0,0,0,-80.1419
+3290,WGS 84 / SCAR IMW SV31-40,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,0,0,0,-80.1419
+3291,WGS 84 / SCAR IMW SV41-50,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,0,0,0,0,0,0,-80.1419
+3292,WGS 84 / SCAR IMW SV51-60,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,150,0,0,0,0,0,0,-80.1419
+3293,WGS 84 / SCAR IMW SW01-60,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-80.1419
+3294,WGS 84 / USGS Transantarctic Mountains,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-78,162,-76.4,0,0,
+3295,Guam 1963 / Yap Islands,Modified Azimuthal Equidistant,metre,0,Guam 1963,Clarke 1866,40000,9.324815,60000,138.100748,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3296,RGPF / UTM zone 5S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3297,RGPF / UTM zone 6S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3298,RGPF / UTM zone 7S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3299,RGPF / UTM zone 8S,Transverse Mercator,metre,0,Reseau Geodesique de la Polynesie Francaise,GRS 1980,500000,0,10000000,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3300,Estonian Coordinate System of 1992,Lambert Conic Conformal (2SP),metre,0,Estonia 1992,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,57.31031942,24,59.2,6375000,500000,
+3301,Estonian Coordinate System of 1997,Lambert Conic Conformal (2SP),metre,0,Estonia 1997,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,57.31031942,24,59.2,6375000,500000,
+3302,IGN63 Hiva Oa / UTM zone 7S,Transverse Mercator,metre,0,IGN63 Hiva Oa,International 1924,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3303,Fatu Iva 72 / UTM zone 7S,Transverse Mercator,metre,0,Fatu Iva 72,International 1924,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3304,Tahiti 79 / UTM zone 6S,Transverse Mercator,metre,0,Tahiti 79,International 1924,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3305,Moorea 87 / UTM zone 6S,Transverse Mercator,metre,0,Moorea 87,International 1924,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3306,Maupiti 83 / UTM zone 5S,Transverse Mercator,metre,0,Maupiti 83,International 1924,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3307,Nakhl-e Ghanem / UTM zone 39N,Transverse Mercator,metre,0,Nakhl-e Ghanem,WGS 84,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3308,GDA94 / NSW Lambert,Lambert Conic Conformal (2SP),metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-35.75,-33.25,147,-30.75,4500000,9300000
+3309,NAD27 / California Albers,Albers Equal Area,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
+3310,NAD83 / California Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
+3311,NAD83(HARN) / California Albers,Albers Equal Area,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
+3312,CSG67 / UTM zone 21N,Transverse Mercator,metre,4623,Centre Spatial Guyanais 1967,International 1924,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3313,RGFG95 / UTM zone 21N,Transverse Mercator,metre,4624,Reseau Geodesique Francais Guyane 1995,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3316,Kasai 1953 / Congo TM zone 22,Transverse Mercator,metre,0,Kasai 1953,Clarke 1880 (RGS),500000,0,10000000,22,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3317,Kasai 1953 / Congo TM zone 24,Transverse Mercator,metre,0,Kasai 1953,Clarke 1880 (RGS),500000,0,10000000,24,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3318,IGC 1962 / Congo TM zone 12,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,12,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3319,IGC 1962 / Congo TM zone 14,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,14,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3320,IGC 1962 / Congo TM zone 16,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,16,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3321,IGC 1962 / Congo TM zone 18,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,18,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3322,IGC 1962 / Congo TM zone 20,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,20,0.9999
+3323,IGC 1962 / Congo TM zone 22,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,22,0.9999
+3324,IGC 1962 / Congo TM zone 24,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,24,0.9999
+3325,IGC 1962 / Congo TM zone 26,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,26,0.9999
+3326,IGC 1962 / Congo TM zone 28,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,28,0.9999
+3327,IGC 1962 / Congo TM zone 30,Transverse Mercator,metre,0,IGC 1962 Arc of the 6th Parallel South,Clarke 1880 (RGS),500000,0,10000000,30,0.9999
+3328,Pulkovo 1942(58) / GUGiK-80,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,500000,52.1,500000,19.1,0.999714
+3329,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,5500000,0,0,15,1
+3330,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,6500000,0,0,18,1
+3331,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,7500000,0,0,21,1
+3332,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,8500000,0,0,24,1
+3333,Pulkovo 1942(58) / Gauss-Kruger zone 3,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3500000,0,0,15,1
+3334,Pulkovo 1942(58) / Gauss-Kruger zone 4,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4500000,0,0,21,1
+3335,Pulkovo 1942(58) / Gauss-Kruger zone 5,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,5500000,0,0,27,1
+3336,IGN 1962 Kerguelen / UTM zone 42S,Transverse Mercator,metre,0,IGN 1962 Kerguelen,International 1924,500000,0,10000000,69,0.9996
+3337,Le Pouce 1934 / Mauritius Grid,Lambert Conic Conformal (1SP),metre,0,Le Pouce 1934,Clarke 1880 (RGS),1000000,-20.114225,1000000,57.311858,1
+3338,NAD83 / Alaska Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,50,-154,55,0,0
+3339,IGCB 1955 / Congo TM zone 12,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,12,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3340,IGCB 1955 / Congo TM zone 14,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,14,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3341,IGCB 1955 / Congo TM zone 16,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,16,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3342,IGCB 1955 / UTM zone 33S,Transverse Mercator,metre,0,Institut Geographique du Congo Belge 1955,Clarke 1880 (RGS),500000,0,10000000,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3343,Mauritania 1999 / UTM zone 28N,Transverse Mercator,metre,0,Mauritania 1999,GRS 1980,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3344,Mauritania 1999 / UTM zone 29N,Transverse Mercator,metre,0,Mauritania 1999,GRS 1980,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3345,Mauritania 1999 / UTM zone 30N,Transverse Mercator,metre,0,Mauritania 1999,GRS 1980,500000,0,0,-3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3346,LKS94 / Lithuania TM,Transverse Mercator,metre,4669,Lithuania 1994 (ETRS89),GRS 1980,500000,0,0,24,0.9998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3347,NAD83 / Statistics Canada Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,63.390675,-91.52,49,3000000,6200000
+3348,NAD83(CSRS) / Statistics Canada Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,63.390675,-91.52,49,3000000,6200000
+3350,Pulkovo 1942 / CS63 zone C0,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,250000,0.06,0,21.57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3351,Pulkovo 1942 / CS63 zone C1,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,1250000,0.06,0,24.57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3352,Pulkovo 1942 / CS63 zone C2,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,2250000,0.06,0,27.57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3353,Mhast (onshore) / UTM zone 32S,Transverse Mercator,metre,4264,Mhast (onshore),International 1924,500000,0,10000000,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3354,Mhast (offshore) / UTM zone 32S,Transverse Mercator,metre,4264,Mhast (offshore),International 1924,500000,0,10000000,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3355,Egypt Gulf of Suez S-650 TL / Red Belt,Transverse Mercator,metre,0,Egypt Gulf of Suez S-650 TL,Helmert 1906,615000,30,810000,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3356,Grand Cayman 1959 / UTM zone 17N,Transverse Mercator,metre,0,Grand Cayman 1959,Clarke 1866,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3357,Little Cayman 1961 / UTM zone 17N,Transverse Mercator,metre,0,Little Cayman 1961,Clarke 1866,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3358,NAD83(HARN) / North Carolina,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,609601.22
+3360,NAD83(HARN) / South Carolina,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,609600
+3361,NAD83(HARN) / South Carolina (ft),Lambert Conic Conformal (2SP),foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,2000000
+3362,NAD83(HARN) / Pennsylvania North,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,600000
+3363,NAD83(HARN) / Pennsylvania North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,1968500
+3364,NAD83(HARN) / Pennsylvania South,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,600000
+3365,NAD83(HARN) / Pennsylvania South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,1968500
+3367,IGN Astro 1960 / UTM zone 28N,Transverse Mercator,metre,0,IGN Astro 1960,Clarke 1880 (RGS),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3368,IGN Astro 1960 / UTM zone 29N,Transverse Mercator,metre,0,IGN Astro 1960,Clarke 1880 (RGS),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3369,IGN Astro 1960 / UTM zone 30N,Transverse Mercator,metre,0,IGN Astro 1960,Clarke 1880 (RGS),500000,0,0,-3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3370,NAD27 / UTM zone 59N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3371,NAD27 / UTM zone 60N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3372,NAD83 / UTM zone 59N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3373,NAD83 / UTM zone 60N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3374,FD54 / UTM zone 29N,Transverse Mercator,metre,0,Faroe Datum 1954,International 1924,500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3375,GDM2000 / Peninsula RSO,Hotine Oblique Mercator,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,804671,0,0,0,0,323.0132867,4,0,323.0748369,0.99984,0,102.15,0,0,0,0,0,0,
+3376,GDM2000 / East Malaysia BRSO,Hotine Oblique Mercator,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,0,0,0,0,0,53.18569158,4,0,53.07483685,0.99984,0,115,0,0,0,0,0,0,
+3377,GDM2000 / Johor Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-14810.562,2.071804708,8758.32,103.254057,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3378,GDM2000 / Sembilan and Melaka Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,3673.785,2.405645149,-4240.573,101.5829658,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3379,GDM2000 / PahangGrid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-7368.228,3.460979712,6485.858,102.2205876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3380,GDM2000 / Selangor Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-34836.161,3.410473658,56464.049,101.2320788,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3381,GDM2000 / Terengganu Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,19594.245,4.583462672,3371.895,103.0412992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3382,GDM2000 / Pinang Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-23.414,5.251746315,62.283,100.2039757,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3383,GDM2000 / Kedah and Perlis Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,0,5.575282177,0,100.3810936,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3384,GDM2000 / Perak Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,-1.769,4.513262688,133454.779,100.4855478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3385,GDM2000 / Kelantan Grid,Cassini-Soldner,metre,0,Geodetic Datum of Malaysia 2000,GRS 1980,13227.851,5.582115717,8739.894,102.174287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3386,KKJ / Finland zone 0,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3387,KKJ / Finland zone 5,Transverse Mercator,metre,4123,Kartastokoordinaattijarjestelma (1966),International 1924,5500000,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3388,Pulkovo 1942 / Caspian Sea Mercator,Mercator (2SP),metre,4284,Pulkovo 1942,Krassowsky 1940,0,0,0,51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42
+3389,Pulkovo 1942 / 3-degree Gauss-Kruger zone 60,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,60500000,0,0,180,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3390,Pulkovo 1995 / 3-degree Gauss-Kruger zone 60,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,60500000,0,0,180,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3391,Karbala 1979 / UTM zone 37N,Transverse Mercator,metre,0,Karbala 1979,Clarke 1880 (RGS),500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3392,Karbala 1979 / UTM zone 38N,Transverse Mercator,metre,0,Karbala 1979,Clarke 1880 (RGS),500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3393,Karbala 1979 / UTM zone 39N,Transverse Mercator,metre,0,Karbala 1979,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3394,Nahrwan 1934 / Iraq zone,Lambert Conic Conformal (1SP),metre,0,Nahrwan 1934,Clarke 1880 (RGS),1500000,32.3,1166200,45,0.998786408,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3395,WGS 84 / World Mercator,Mercator (1SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3396,PD/83 / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,0,Potsdam Datum/83,Bessel 1841,3500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3397,PD/83 / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,0,Potsdam Datum/83,Bessel 1841,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3398,RD/83 / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,0,Rauenberg Datum/83,Bessel 1841,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3399,RD/83 / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,0,Rauenberg Datum/83,Bessel 1841,5500000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3400,NAD83 / Alberta 10-TM (Forest),Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3401,NAD83 / Alberta 10-TM (Resource),Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3402,NAD83(CSRS) / Alberta 10-TM (Forest),Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3403,NAD83(CSRS) / Alberta 10-TM (Resource),Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-115,0.9992,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3404,NAD83(HARN) / North Carolina (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,2000000
+3405,VN-2000 / UTM zone 48N,Transverse Mercator,metre,0,Vietnam 2000,WGS 84,500000,0,0,105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3406,VN-2000 / UTM zone 49N,Transverse Mercator,metre,0,Vietnam 2000,WGS 84,500000,0,0,111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3407,Hong Kong 1963 Grid System,Cassini-Soldner,Clarke's foot,0,Hong Kong 1963,Clarke 1858,132033.92,22.184368,62565.96,114.10428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3408,NSIDC EASE-Grid North,Lambert Azimuthal Equal Area (Spherical),metre,0,Not specified (based on International 1924 Authalic Sphere),International 1924 Authalic Sphere,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3409,NSIDC EASE-Grid South,Lambert Azimuthal Equal Area (Spherical),metre,0,Not specified (based on International 1924 Authalic Sphere),International 1924 Authalic Sphere,0,-90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3410,NSIDC EASE-Grid Global,Lambert Cylindrical Equal Area (Spherical),metre,0,Not specified (based on International 1924 Authalic Sphere),International 1924 Authalic Sphere,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0,
+3411,NSIDC Sea Ice Polar Stereographic North,Polar Stereographic (variant B),metre,0,Not specified (based on Hughes 1980 ellipsoid),Hughes 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-45,0,0,0,0,0,0,70
+3412,NSIDC Sea Ice Polar Stereographic South,Polar Stereographic (variant B),metre,0,Not specified (based on Hughes 1980 ellipsoid),Hughes 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-70
+3413,WGS 84 / NSIDC Sea Ice Polar Stereographic North,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-45,0,0,0,0,0,0,70
+3414,SVY21 / Singapore TM,Transverse Mercator,metre,0,SVY21,WGS 84,28001.642,1.22,38744.572,103.5,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3415,WGS 72BE / South China Sea Lambert,Lambert Conic Conformal (2SP),metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,21,114,18,500000,500000,
+3416,ETRS89 / Austria Lambert,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,47.3,13.2,49,400000,400000,
+3417,NAD83 / Iowa North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,3280833.333,4921250,
+3418,NAD83 / Iowa South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,1640416.667,
+3419,NAD83 / Kansas North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,1312333.333,
+3420,NAD83 / Kansas South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,1312333.333,1312333.333,
+3421,NAD83 / Nevada East (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.6667,34.45,26246666.67,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3422,NAD83 / Nevada Central (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,34.45,19685000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3423,NAD83 / Nevada West (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2624666.667,34.45,13123333.33,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3424,NAD83 / New Jersey (ft US),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3425,NAD83(HARN) / Iowa North (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,3280833.333,4921250
+3426,NAD83(HARN) / Iowa South (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,1640416.667
+3427,NAD83(HARN) / Kansas North (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,1312333.333
+3428,NAD83(HARN) / Kansas South (ft US),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,1312333.333,1312333.333
+3429,NAD83(HARN) / Nevada East (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.6667,34.45,26246666.67,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3430,NAD83(HARN) / Nevada Central (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,34.45,19685000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3431,NAD83(HARN) / Nevada West (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2624666.667,34.45,13123333.33,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3432,NAD83(HARN) / New Jersey (ft US),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3433,NAD83 / Arkansas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,1312333.333
+3434,NAD83 / Arkansas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,1312333.333,1312333.333
+3435,NAD83 / Illinois East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3436,NAD83 / Illinois West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2296583.333,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3437,NAD83 / New Hampshire (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3438,NAD83 / Rhode Island (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,328083.3333,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3439,PSD93 / UTM zone 39N,Transverse Mercator,metre,4134,PDO Survey Datum 1993,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3440,PSD93 / UTM zone 40N,Transverse Mercator,metre,4134,PDO Survey Datum 1993,Clarke 1880 (RGS),500000,0,0,57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3441,NAD83(HARN) / Arkansas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,1312333.333
+3442,NAD83(HARN) / Arkansas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,1312333.333,1312333.333
+3443,NAD83(HARN) / Illinois East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3444,NAD83(HARN) / Illinois West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2296583.333,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3445,NAD83(HARN) / New Hampshire (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3446,NAD83(HARN) / Rhode Island (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,328083.3333,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3447,ETRS89 / Belgian Lambert 2005,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,50.4752134,4.2133177,49.5,166262,150328
+3448,JAD2001 / Jamaica Metric Grid,Lambert Conic Conformal (1SP),metre,0,Jamaica 2001,WGS 84,750000,18,650000,-77,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3449,JAD2001 / UTM zone 17N,Transverse Mercator,metre,0,Jamaica 2001,WGS 84,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3450,JAD2001 / UTM zone 18N,Transverse Mercator,metre,0,Jamaica 2001,WGS 84,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3451,NAD83 / Louisiana North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,3280833.333
+3452,NAD83 / Louisiana South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,3280833.333
+3453,NAD83 / Louisiana Offshore (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.3,-91.2,27.5,0,3280833.333
+3455,NAD83 / South Dakota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,1968500
+3456,NAD83(HARN) / Louisiana North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,3280833.333
+3457,NAD83(HARN) / Louisiana South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,3280833.333
+3458,NAD83(HARN) / South Dakota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,1968500
+3459,NAD83(HARN) / South Dakota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,1968500
+3460,Fiji 1986 / Fiji Map Grid,Transverse Mercator,metre,0,Fiji Geodetic Datum 1986,WGS 72,2000000,-17,4000000,178.45,0.99985,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3461,Dabola 1981 / UTM zone 28N,Transverse Mercator,metre,0,Dabola 1981,Clarke 1880 (IGN),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3462,Dabola 1981 / UTM zone 29N,Transverse Mercator,metre,0,Dabola 1981,Clarke 1880 (IGN),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3463,NAD83 / Maine CS2000 Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,43.3,0,-69.073,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3464,NAD83(HARN) / Maine CS2000 Central,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,43.3,0,-69.073,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3465,NAD83(NSRS2007) / Alabama East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,30.3,0,-85.5,0.99996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3466,NAD83(NSRS2007) / Alabama West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,600000,30,0,-87.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3467,NAD83(NSRS2007) / Alaska Albers,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,50,-154,55,0,0
+3468,NAD83(NSRS2007) / Alaska zone 1,Hotine Oblique Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,5000000,0,-5000000,0,0,323.0748369,57,0,323.0748369,0.9999,0,-133.4,0,0,0,0,0,0,0,0,
+3469,NAD83(NSRS2007) / Alaska zone 2,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-142,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3470,NAD83(NSRS2007) / Alaska zone 3,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-146,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3471,NAD83(NSRS2007) / Alaska zone 4,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-150,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3472,NAD83(NSRS2007) / Alaska zone 5,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-154,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3473,NAD83(NSRS2007) / Alaska zone 6,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-158,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3474,NAD83(NSRS2007) / Alaska zone 7,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-162,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3475,NAD83(NSRS2007) / Alaska zone 8,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-166,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3476,NAD83(NSRS2007) / Alaska zone 9,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,54,0,-170,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3477,NAD83(NSRS2007) / Alaska zone 10,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.5,51,-176,53.5,0,1000000
+3478,NAD83(NSRS2007) / Arizona Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,213360,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3479,NAD83(NSRS2007) / Arizona Central (ft),Transverse Mercator,foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3480,NAD83(NSRS2007) / Arizona East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,213360,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3481,NAD83(NSRS2007) / Arizona East (ft),Transverse Mercator,foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3482,NAD83(NSRS2007) / Arizona West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,213360,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3483,NAD83(NSRS2007) / Arizona West (ft),Transverse Mercator,foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3484,NAD83(NSRS2007) / Arkansas North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,400000
+3485,NAD83(NSRS2007) / Arkansas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,1312333.333
+3486,NAD83(NSRS2007) / Arkansas South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,400000,400000
+3487,NAD83(NSRS2007) / Arkansas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,1312333.333,1312333.333
+3488,NAD83(NSRS2007) / California Albers,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.5,0,-120,34,-4000000,0
+3489,NAD83(NSRS2007) / California zone 1,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,500000,2000000
+3490,NAD83(NSRS2007) / California zone 1 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,1640416.667,6561666.667
+3491,NAD83(NSRS2007) / California zone 2,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,500000,2000000
+3492,NAD83(NSRS2007) / California zone 2 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,1640416.667,6561666.667
+3493,NAD83(NSRS2007) / California zone 3,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,500000,2000000
+3494,NAD83(NSRS2007) / California zone 3 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,1640416.667,6561666.667
+3495,NAD83(NSRS2007) / California zone 4,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,500000,2000000
+3496,NAD83(NSRS2007) / California zone 4 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,1640416.667,6561666.667
+3497,NAD83(NSRS2007) / California zone 5,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,500000,2000000
+3498,NAD83(NSRS2007) / California zone 5 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,1640416.667,6561666.667
+3499,NAD83(NSRS2007) / California zone 6,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,500000,2000000
+3500,NAD83(NSRS2007) / California zone 6 (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,1640416.667,6561666.667
+3501,NAD83(NSRS2007) / Colorado Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,304800.6096,914401.8289
+3502,NAD83(NSRS2007) / Colorado Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,1000000,3000000
+3503,NAD83(NSRS2007) / Colorado North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,304800.6096,914401.8289
+3504,NAD83(NSRS2007) / Colorado North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,1000000,3000000
+3505,NAD83(NSRS2007) / Colorado South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,304800.6096,914401.8289
+3506,NAD83(NSRS2007) / Colorado South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,1000000,3000000
+3507,NAD83(NSRS2007) / Connecticut,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,152400.3048,304800.6096
+3508,NAD83(NSRS2007) / Connecticut (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,500000,1000000
+3509,NAD83(NSRS2007) / Delaware,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3510,NAD83(NSRS2007) / Delaware (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3511,NAD83(NSRS2007) / Florida East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3512,NAD83(NSRS2007) / Florida East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3513,NAD83(NSRS2007) / Florida GDL Albers,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.3,24,-84,24,0,400000
+3514,NAD83(NSRS2007) / Florida North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,600000
+3515,NAD83(NSRS2007) / Florida North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,1968500
+3516,NAD83(NSRS2007) / Florida West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3517,NAD83(NSRS2007) / Florida West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3518,NAD83(NSRS2007) / Georgia East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,30,0,-82.1,0.9999
+3519,NAD83(NSRS2007) / Georgia East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,30,0,-82.1,0.9999
+3520,NAD83(NSRS2007) / Georgia West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,30,0,-84.1,0.9999
+3521,NAD83(NSRS2007) / Georgia West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2296583.333,30,0,-84.1,0.9999
+3522,NAD83(NSRS2007) / Idaho Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,41.4,0,-114,0.999947368
+3523,NAD83(NSRS2007) / Idaho Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1640416.667,41.4,0,-114,0.999947368
+3524,NAD83(NSRS2007) / Idaho East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,41.4,0,-112.1,0.999947368
+3525,NAD83(NSRS2007) / Idaho East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.667,41.4,0,-112.1,0.999947368
+3526,NAD83(NSRS2007) / Idaho West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,800000,41.4,0,-115.45,0.999933333
+3527,NAD83(NSRS2007) / Idaho West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2624666.667,41.4,0,-115.45,0.999933333
+3528,NAD83(NSRS2007) / Illinois East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,36.4,0,-88.2,0.999975
+3529,NAD83(NSRS2007) / Illinois East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,36.4,0,-88.2,0.999975
+3530,NAD83(NSRS2007) / Illinois West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,36.4,0,-90.1,0.999941177
+3531,NAD83(NSRS2007) / Illinois West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2296583.333,36.4,0,-90.1,0.999941177
+3532,NAD83(NSRS2007) / Indiana East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,100000,37.3,250000,-85.4,0.999966667
+3533,NAD83(NSRS2007) / Indiana East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,328083.333,37.3,820208.333,-85.4,0.999966667
+3534,NAD83(NSRS2007) / Indiana West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,900000,37.3,250000,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3535,NAD83(NSRS2007) / Indiana West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2952750,37.3,820208.333,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3536,NAD83(NSRS2007) / Iowa North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,1000000,1500000
+3537,NAD83(NSRS2007) / Iowa North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,3280833.333,4921250
+3538,NAD83(NSRS2007) / Iowa South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,500000
+3539,NAD83(NSRS2007) / Iowa South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,1640416.667
+3540,NAD83(NSRS2007) / Kansas North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,400000
+3541,NAD83(NSRS2007) / Kansas North (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,1312333.333
+3542,NAD83(NSRS2007) / Kansas South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,400000,400000
+3543,NAD83(NSRS2007) / Kansas South (ft US),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,1312333.333,1312333.333
+3544,NAD83(NSRS2007) / Kentucky North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,500000
+3545,NAD83(NSRS2007) / Kentucky North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,1640416.667
+3546,NAD83(NSRS2007) / Kentucky Single Zone,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,1000000,1500000
+3547,NAD83(NSRS2007) / Kentucky Single Zone (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.4,36.2,-85.45,37.05,3280833.333,4921250
+3548,NAD83(NSRS2007) / Kentucky South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,500000,500000
+3549,NAD83(NSRS2007) / Kentucky South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,1640416.667,1640416.667
+3550,NAD83(NSRS2007) / Louisiana North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,1000000
+3551,NAD83(NSRS2007) / Louisiana North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,3280833.333
+3552,NAD83(NSRS2007) / Louisiana South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,1000000
+3553,NAD83(NSRS2007) / Louisiana South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,3280833.333
+3554,NAD83(NSRS2007) / Maine CS2000 Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,43.3,0,-69.073,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3555,NAD83(NSRS2007) / Maine CS2000 East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,43.5,0,-67.523,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3556,NAD83(NSRS2007) / Maine CS2000 West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,42.5,0,-70.223,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3557,NAD83(NSRS2007) / Maine East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3558,NAD83(NSRS2007) / Maine West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,900000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3559,NAD83(NSRS2007) / Maryland,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,400000
+3560,NAD83 / Utah North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280833.333,1640416.667
+3561,Old Hawaiian / Hawaii zone 1,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,18.5,0,-155.3,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3562,Old Hawaiian / Hawaii zone 2,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,20.2,0,-156.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3563,Old Hawaiian / Hawaii zone 3,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3564,Old Hawaiian / Hawaii zone 4,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,21.5,0,-159.3,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3565,Old Hawaiian / Hawaii zone 5,Transverse Mercator,US survey foot,4135,Old Hawaiian,Clarke 1866,500000,21.4,0,-160.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3566,NAD83 / Utah Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561666.667,1640416.667
+3567,NAD83 / Utah South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842500,1640416.667
+3568,NAD83(HARN) / Utah North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280833.333,1640416.667
+3569,NAD83(HARN) / Utah Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561666.667,1640416.667
+3570,NAD83(HARN) / Utah South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842500,1640416.667
+3571,WGS 84 / North Pole LAEA Bering Sea,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3572,WGS 84 / North Pole LAEA Alaska,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,-150,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3573,WGS 84 / North Pole LAEA Canada,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,-100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3574,WGS 84 / North Pole LAEA Atlantic,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,-40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3575,WGS 84 / North Pole LAEA Europe,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3576,WGS 84 / North Pole LAEA Russia,Lambert Azimuthal Equal Area,metre,4326,World Geodetic System 1984,WGS 84,0,90,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3577,GDA94 / Australian Albers,Albers Equal Area,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,0,132,-18,0,0
+3578,NAD83 / Yukon Albers,Albers Equal Area,metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,59,-132.3,61.4,500000,500000
+3579,NAD83(CSRS) / Yukon Albers,Albers Equal Area,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,59,-132.3,61.4,500000,500000
+3580,NAD83 / NWT Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,-112,62,0,0
+3581,NAD83(CSRS) / NWT Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,0,-112,62,0,0
+3582,NAD83(NSRS2007) / Maryland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,1312333.333
+3583,NAD83(NSRS2007) / Massachusetts Island,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,500000
+3584,NAD83(NSRS2007) / Massachusetts Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,1640416.667
+3585,NAD83(NSRS2007) / Massachusetts Mainland,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,750000,200000
+3586,NAD83(NSRS2007) / Massachusetts Mainland (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,2460625,656166.667
+3587,NAD83(NSRS2007) / Michigan Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,6000000
+3588,NAD83(NSRS2007) / Michigan Central (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,19685039.37
+3589,NAD83(NSRS2007) / Michigan North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,8000000
+3590,NAD83(NSRS2007) / Michigan North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,26246719.16
+3591,NAD83(NSRS2007) / Michigan Oblique Mercator,Hotine Oblique Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2546731.496,0,-4354009.816,0,0,337.25556,45.1833,0,337.25556,0.9996,0,-86,0,0,0,0,0,0,0,0,
+3592,NAD83(NSRS2007) / Michigan South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,4000000
+3593,NAD83(NSRS2007) / Michigan South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,13123359.58
+3594,NAD83(NSRS2007) / Minnesota Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,100000,800000
+3595,NAD83(NSRS2007) / Minnesota North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,100000,800000
+3596,NAD83(NSRS2007) / Minnesota South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,100000,800000
+3597,NAD83(NSRS2007) / Mississippi East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3598,NAD83(NSRS2007) / Mississippi East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3599,NAD83(NSRS2007) / Mississippi West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,700000,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3600,NAD83(NSRS2007) / Mississippi West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2296583.333,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3601,NAD83(NSRS2007) / Missouri Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3602,NAD83(NSRS2007) / Missouri East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,250000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3603,NAD83(NSRS2007) / Missouri West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,850000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3604,NAD83(NSRS2007) / Montana,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,600000
+3605,NAD83(NSRS2007) / Montana (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,1968503.937
+3606,NAD83(NSRS2007) / Nebraska,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,500000
+3607,NAD83(NSRS2007) / Nevada Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,34.45,6000000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3608,NAD83(NSRS2007) / Nevada Central (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1640416.667,34.45,19685000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3609,NAD83(NSRS2007) / Nevada East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,34.45,8000000,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3610,NAD83(NSRS2007) / Nevada East (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.6667,34.45,26246666.67,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3611,NAD83(NSRS2007) / Nevada West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,800000,34.45,4000000,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3612,NAD83(NSRS2007) / Nevada West (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2624666.667,34.45,13123333.33,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3613,NAD83(NSRS2007) / New Hampshire,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,300000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3614,NAD83(NSRS2007) / New Hampshire (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3615,NAD83(NSRS2007) / New Jersey,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3616,NAD83(NSRS2007) / New Jersey (ft US),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3617,NAD83(NSRS2007) / New Mexico Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3618,NAD83(NSRS2007) / New Mexico Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1640416.667,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3619,NAD83(NSRS2007) / New Mexico East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,165000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3620,NAD83(NSRS2007) / New Mexico East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,541337.5,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3621,NAD83(NSRS2007) / New Mexico West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,830000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3622,NAD83(NSRS2007) / New Mexico West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2723091.667,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3623,NAD83(NSRS2007) / New York Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,250000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3624,NAD83(NSRS2007) / New York Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,820208.333,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3625,NAD83(NSRS2007) / New York East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3626,NAD83(NSRS2007) / New York East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,492125,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3627,NAD83(NSRS2007) / New York Long Island,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,300000
+3628,NAD83(NSRS2007) / New York Long Island (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,984250
+3629,NAD83(NSRS2007) / New York West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,350000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3630,NAD83(NSRS2007) / New York West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1148291.667,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3631,NAD83(NSRS2007) / North Carolina,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,609601.22
+3632,NAD83(NSRS2007) / North Carolina (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,2000000
+3633,NAD83(NSRS2007) / North Dakota North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,600000
+3634,NAD83(NSRS2007) / North Dakota North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,1968503.937
+3635,NAD83(NSRS2007) / North Dakota South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,600000
+3636,NAD83(NSRS2007) / North Dakota South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,1968503.937
+3637,NAD83(NSRS2007) / Ohio North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,600000
+3638,NAD83(NSRS2007) / Ohio South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,600000
+3639,NAD83(NSRS2007) / Oklahoma North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,600000
+3640,NAD83(NSRS2007) / Oklahoma North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,1968500
+3641,NAD83(NSRS2007) / Oklahoma South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,600000
+3642,NAD83(NSRS2007) / Oklahoma South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,1968500
+3643,NAD83(NSRS2007) / Oregon Lambert,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,400000
+3644,NAD83(NSRS2007) / Oregon Lambert (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,41.45,-120.3,43,0,1312335.958
+3645,NAD83(NSRS2007) / Oregon North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,2500000
+3646,NAD83(NSRS2007) / Oregon North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,8202099.738
+3647,NAD83(NSRS2007) / Oregon South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,1500000
+3648,NAD83(NSRS2007) / Oregon South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,4921259.843
+3649,NAD83(NSRS2007) / Pennsylvania North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,600000
+3650,NAD83(NSRS2007) / Pennsylvania North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,1968500
+3651,NAD83(NSRS2007) / Pennsylvania South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,600000
+3652,NAD83(NSRS2007) / Pennsylvania South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,1968500
+3653,NAD83(NSRS2007) / Rhode Island,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,100000,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3654,NAD83(NSRS2007) / Rhode Island (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,328083.3333,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3655,NAD83(NSRS2007) / South Carolina,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,609600
+3656,NAD83(NSRS2007) / South Carolina (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,2000000
+3657,NAD83(NSRS2007) / South Dakota North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,600000
+3658,NAD83(NSRS2007) / South Dakota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,1968500
+3659,NAD83(NSRS2007) / South Dakota South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,600000
+3660,NAD83(NSRS2007) / South Dakota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,1968500
+3661,NAD83(NSRS2007) / Tennessee,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,600000
+3662,NAD83(NSRS2007) / Tennessee (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,1968500
+3663,NAD83(NSRS2007) / Texas Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,3000000,700000
+3664,NAD83(NSRS2007) / Texas Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,9842500,2296583.333
+3665,NAD83(NSRS2007) / Texas Centric Albers Equal Area,Albers Equal Area,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,6000000,1500000
+3666,NAD83(NSRS2007) / Texas Centric Lambert Conformal,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,18,-100,27.3,5000000,1500000
+3667,NAD83(NSRS2007) / Texas North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,1000000,200000
+3668,NAD83(NSRS2007) / Texas North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,3280833.333,656166.667
+3669,NAD83(NSRS2007) / Texas North Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,2000000,600000
+3670,NAD83(NSRS2007) / Texas North Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,6561666.667,1968500
+3671,NAD83(NSRS2007) / Texas South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,5000000,300000
+3672,NAD83(NSRS2007) / Texas South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,16404166.67,984250
+3673,NAD83(NSRS2007) / Texas South Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,4000000,600000
+3674,NAD83(NSRS2007) / Texas South Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,13123333.33,1968500
+3675,NAD83(NSRS2007) / Utah Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,2000000,500000
+3676,NAD83(NSRS2007) / Utah Central (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561679.79,1640419.948
+3677,NAD83(NSRS2007) / Utah Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,6561666.667,1640416.667
+3678,NAD83(NSRS2007) / Utah North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,1000000,500000
+3679,NAD83(NSRS2007) / Utah North (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280839.895,1640419.948
+3680,NAD83(NSRS2007) / Utah North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,3280833.333,1640416.667
+3681,NAD83(NSRS2007) / Utah South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,3000000,500000
+3682,NAD83(NSRS2007) / Utah South (ft),Lambert Conic Conformal (2SP),foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842519.685,1640419.948
+3683,NAD83(NSRS2007) / Utah South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,9842500,1640416.667
+3684,NAD83(NSRS2007) / Vermont,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3685,NAD83(NSRS2007) / Virginia North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,2000000,3500000
+3686,NAD83(NSRS2007) / Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,6561666.667,11482916.67
+3687,NAD83(NSRS2007) / Virginia South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,1000000,3500000
+3688,NAD83(NSRS2007) / Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,3280833.333,11482916.67
+3689,NAD83(NSRS2007) / Washington North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,500000
+3690,NAD83(NSRS2007) / Washington North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,1640416.667
+3691,NAD83(NSRS2007) / Washington South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,500000
+3692,NAD83(NSRS2007) / Washington South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,1640416.667
+3693,NAD83(NSRS2007) / West Virginia North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,600000
+3694,NAD83(NSRS2007) / West Virginia South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,600000
+3695,NAD83(NSRS2007) / Wisconsin Central,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,600000
+3696,NAD83(NSRS2007) / Wisconsin Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,1968500
+3697,NAD83(NSRS2007) / Wisconsin North,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,600000
+3698,NAD83(NSRS2007) / Wisconsin North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,1968500
+3699,NAD83(NSRS2007) / Wisconsin South,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,600000
+3700,NAD83(NSRS2007) / Wisconsin South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,1968500
+3701,NAD83(NSRS2007) / Wisconsin Transverse Mercator,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,520000,0,-4480000,-90,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3702,NAD83(NSRS2007) / Wyoming East,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,200000,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3703,NAD83(NSRS2007) / Wyoming East Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,400000,40.3,100000,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3704,NAD83(NSRS2007) / Wyoming West Central,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,600000,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3705,NAD83(NSRS2007) / Wyoming West,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,800000,40.3,100000,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3706,NAD83(NSRS2007) / UTM zone 59N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3707,NAD83(NSRS2007) / UTM zone 60N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3708,NAD83(NSRS2007) / UTM zone 1N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3709,NAD83(NSRS2007) / UTM zone 2N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3710,NAD83(NSRS2007) / UTM zone 3N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-165,0.9996
+3711,NAD83(NSRS2007) / UTM zone 4N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-159,0.9996
+3712,NAD83(NSRS2007) / UTM zone 5N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-153,0.9996
+3713,NAD83(NSRS2007) / UTM zone 6N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-147,0.9996
+3714,NAD83(NSRS2007) / UTM zone 7N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-141,0.9996
+3715,NAD83(NSRS2007) / UTM zone 8N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-135,0.9996
+3716,NAD83(NSRS2007) / UTM zone 9N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-129,0.9996
+3717,NAD83(NSRS2007) / UTM zone 10N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-123,0.9996
+3718,NAD83(NSRS2007) / UTM zone 11N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-117,0.9996
+3719,NAD83(NSRS2007) / UTM zone 12N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-111,0.9996
+3720,NAD83(NSRS2007) / UTM zone 13N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-105,0.9996
+3721,NAD83(NSRS2007) / UTM zone 14N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-99,0.9996
+3722,NAD83(NSRS2007) / UTM zone 15N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-93,0.9996
+3723,NAD83(NSRS2007) / UTM zone 16N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-87,0.9996
+3724,NAD83(NSRS2007) / UTM zone 17N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-81,0.9996
+3725,NAD83(NSRS2007) / UTM zone 18N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-75,0.9996
+3726,NAD83(NSRS2007) / UTM zone 19N,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3727,Reunion 1947 / TM Reunion,Transverse Mercator,metre,0,Reunion 1947,International 1924,160000,-21.07,50000,55.32,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3728,NAD83(NSRS2007) / Ohio North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,1968500
+3729,NAD83(NSRS2007) / Ohio South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,1968500
+3730,NAD83(NSRS2007) / Wyoming East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,656166.6667,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3731,NAD83(NSRS2007) / Wyoming East Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1312333.333,40.3,328083.3333,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3732,NAD83(NSRS2007) / Wyoming West Central (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,1968500,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3733,NAD83(NSRS2007) / Wyoming West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2624666.667,40.3,328083.3333,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3734,NAD83 / Ohio North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,1968500
+3735,NAD83 / Ohio South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,1968500
+3736,NAD83 / Wyoming East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,656166.6667,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3737,NAD83 / Wyoming East Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1312333.333,40.3,328083.3333,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3738,NAD83 / Wyoming West Central (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1968500,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3739,NAD83 / Wyoming West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2624666.667,40.3,328083.3333,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3740,NAD83(HARN) / UTM zone 10N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3741,NAD83(HARN) / UTM zone 11N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3742,NAD83(HARN) / UTM zone 12N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3743,NAD83(HARN) / UTM zone 13N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3744,NAD83(HARN) / UTM zone 14N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3745,NAD83(HARN) / UTM zone 15N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3746,NAD83(HARN) / UTM zone 16N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3747,NAD83(HARN) / UTM zone 17N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3748,NAD83(HARN) / UTM zone 18N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3749,NAD83(HARN) / UTM zone 19N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-69,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3750,NAD83(HARN) / UTM zone 4N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3751,NAD83(HARN) / UTM zone 5N,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,0,0,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3753,NAD83(HARN) / Ohio North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,1968500
+3754,NAD83(HARN) / Ohio South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,1968500
+3755,NAD83(HARN) / Wyoming East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,656166.6667,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3756,NAD83(HARN) / Wyoming East Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1312333.333,40.3,328083.3333,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3757,NAD83(HARN) / Wyoming West Central (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1968500,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3758,NAD83(HARN) / Wyoming West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2624666.667,40.3,328083.3333,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3759,NAD83 / Hawaii zone 3 (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.667,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3760,NAD83(HARN) / Hawaii zone 3 (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,1640416.667,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3761,NAD83(CSRS) / UTM zone 22N,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3762,WGS 84 / South Georgia Lambert,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-54.45,-55,-37,-54,0,0
+3763,ETRS89 / Portugal TM06,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,39.400573,0,-8.075919,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3764,NZGD2000 / Chatham Island Circuit 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,400000,-44,800000,-176.3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3765,HTRS96 / Croatia TM,Transverse Mercator,metre,0,Croatian Terrestrial Reference System,GRS 1980,500000,0,0,16.5,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3766,HTRS96 / Croatia LCC,Lambert Conic Conformal (2SP),metre,0,Croatian Terrestrial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.05,0,16.3,45.55,0,0
+3767,HTRS96 / UTM zone 33N,Transverse Mercator,metre,0,Croatian Terrestrial Reference System,GRS 1980,500000,0,0,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3768,HTRS96 / UTM zone 34N,Transverse Mercator,metre,0,Croatian Terrestrial Reference System,GRS 1980,500000,0,0,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3769,Bermuda 1957 / UTM zone 20N,Transverse Mercator,metre,4216,Bermuda 1957,Clarke 1866,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3770,BDA2000 / Bermuda 2000 National Grid,Transverse Mercator,metre,0,Bermuda 2000,WGS 84,550000,32,100000,-64.45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3771,NAD27 / Alberta 3TM ref merid 111 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-111,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3772,NAD27 / Alberta 3TM ref merid 114 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-114,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3773,NAD27 / Alberta 3TM ref merid 117 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-117,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3774,NAD27 / Alberta 3TM ref merid 120 W (deprecated),Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3775,NAD83 / Alberta 3TM ref merid 111 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-111,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3776,NAD83 / Alberta 3TM ref merid 114 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-114,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3777,NAD83 / Alberta 3TM ref merid 117 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-117,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3778,NAD83 / Alberta 3TM ref merid 120 W (deprecated),Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3779,NAD83(CSRS) / Alberta 3TM ref merid 111 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-111,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3780,NAD83(CSRS) / Alberta 3TM ref merid 114 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-114,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3781,NAD83(CSRS) / Alberta 3TM ref merid 117 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-117,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3782,NAD83(CSRS) / Alberta 3TM ref merid 120 W (deprecated),Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3783,Pitcairn 2006 / Pitcairn TM 2006,Transverse Mercator,metre,0,Pitcairn 2006,WGS 84,14200,-25.04067894,15500,-130.0646682,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3784,Pitcairn 1967 / UTM zone 9S,Transverse Mercator,metre,0,Pitcairn 1967,International 1924,500000,0,10000000,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3788,NZGD2000 / Auckland Islands TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,166,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3789,NZGD2000 / Campbell Island TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,169,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3790,NZGD2000 / Antipodes Islands TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,179,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3791,NZGD2000 / Raoul Island TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,-178,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3793,NZGD2000 / Chatham Islands TM 2000,Transverse Mercator,metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,3500000,0,10000000,-176.3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3794,Slovenia 1996 / Slovene National Grid,Transverse Mercator,metre,0,Slovenia Geodetic Datum 1996,GRS 1980,500000,0,-5000000,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3795,NAD27 / Cuba Norte,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21.42,22.21,-81,23,280296.016,500000
+3796,NAD27 / Cuba Sur,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20.08,20.43,-76.5,21.18,229126.939,500000
+3797,NAD27 / MTQ Lambert,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-70,50,0,800000
+3798,NAD83 / MTQ Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-70,50,0,800000
+3799,NAD83(CSRS) / MTQ Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-70,50,0,800000
+3800,NAD27 / Alberta 3TM ref merid 120 W,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3801,NAD83 / Alberta 3TM ref merid 120 W,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3802,NAD83(CSRS) / Alberta 3TM ref merid 120 W,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,-120,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3812,ETRS89 / Belgian Lambert 2008,Lambert Conic Conformal (2SP),metre,4258,European Terrestrial Reference System 1989,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,50.4752134,4.2133177,49.5,665262,649328
+3814,NAD83 / Mississippi TM,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,32.3,1300000,-89.45,0.9998335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3815,NAD83(HARN) / Mississippi TM,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,500000,32.3,1300000,-89.45,0.9998335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3816,NAD83(NSRS2007) / Mississippi TM,Transverse Mercator,metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,500000,32.3,1300000,-89.45,0.9998335,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3825,TWD97 / TM2 zone 119,Transverse Mercator,metre,0,Taiwan Datum 1997,GRS 1980,250000,0,0,119,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3826,TWD97 / TM2 zone 121,Transverse Mercator,metre,0,Taiwan Datum 1997,GRS 1980,250000,0,0,121,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3827,TWD67 / TM2 zone 119,Transverse Mercator,metre,0,Taiwan Datum 1967,GRS 1967 Modified,250000,0,0,119,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3828,TWD67 / TM2 zone 121,Transverse Mercator,metre,0,Taiwan Datum 1967,GRS 1967 Modified,250000,0,0,121,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3829,Hu Tzu Shan / UTM zone 51N,Transverse Mercator,metre,4236,Hu Tzu Shan 1950,International 1924,500000,0,0,123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3832,WGS 84 / PDC Mercator,Mercator (1SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,150,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3833,Pulkovo 1942(58) / Gauss-Kruger zone 2,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,2500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3834,Pulkovo 1942(83) / Gauss-Kruger zone 2,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,2500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3835,Pulkovo 1942(83) / Gauss-Kruger zone 3,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,3500000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3836,Pulkovo 1942(83) / Gauss-Kruger zone 4,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,4500000,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3837,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,3500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3838,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3839,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 9,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,9500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3840,Pulkovo 1942(58) / 3-degree Gauss-Kruger zone 10,Transverse Mercator,metre,4179,Pulkovo 1942(58),Krassowsky 1940,10500000,0,0,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3841,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 6,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,6500000,0,0,18,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3844,Pulkovo 1942(58) / Stereo70,Oblique Stereographic,metre,4179,Pulkovo 1942(58),Krassowsky 1940,500000,46,500000,25,0.99975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3845,SWEREF99 / RT90 7.5 gon V emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500025.141,0,-667.282,11.18225,1.000006,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3846,SWEREF99 / RT90 5 gon V emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500044.695,0,-667.13,13.332256,1.0000058,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3847,SWEREF99 / RT90 2.5 gon V emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500064.274,0,-667.711,15.48226243,1.00000561,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3848,SWEREF99 / RT90 0 gon emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500083.521,0,-668.844,18.032268,1.0000054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3849,SWEREF99 / RT90 2.5 gon O emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500102.765,0,-670.706,20.182274,1.0000052,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3850,SWEREF99 / RT90 5 gon O emulation,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,1500121.846,0,-672.557,22.33228,1.0000049,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3851,NZGD2000 / NZCS2000,Lambert Conic Conformal (2SP),metre,4167,New Zealand Geodetic Datum 2000,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-44.3,-41,173,-37.3,7000000,3000000
+3852,RSRGD2000 / DGLC2000,Lambert Conic Conformal (2SP),metre,0,Ross Sea Region Geodetic Datum 2000,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-79.2,-90,157,-76.4,0,500000
+3854,County ST74,Transverse Mercator,metre,4619,SWEREF99,GRS 1980,100182.7406,0,-6500620.121,18.0328332,0.99999506,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3857,WGS 84 / Pseudo-Mercator,Popular Visualisation Pseudo Mercator,metre,6055,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3785,WGS 84 / Sperical-Mercator,Popular Visualisation Sphere,metre,6055,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3890,IGRS / UTM zone 37N,Transverse Mercator,metre,0,Iraqi Geospatial Reference System,GRS 1980,500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3891,IGRS / UTM zone 38N,Transverse Mercator,metre,0,Iraqi Geospatial Reference System,GRS 1980,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3892,IGRS / UTM zone 39N,Transverse Mercator,metre,0,Iraqi Geospatial Reference System,GRS 1980,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3893,ED50 / Iraq National Grid,Transverse Mercator,metre,4154,European Datum 1950,International 1924,800000,29.0134566,0,46.3,0.9994,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3907,MGI 1901 / Balkans zone 5,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,5500000,0,0,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3908,MGI 1901 / Balkans zone 6,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,6500000,0,0,18,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3909,MGI 1901 / Balkans zone 7,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,7500000,0,0,21,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3910,MGI 1901 / Balkans zone 8,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,8500000,0,0,24,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3911,MGI 1901 / Slovenia Grid,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,500000,0,0,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3912,MGI 1901 / Slovene National Grid,Transverse Mercator,metre,4312,MGI 1901,Bessel 1841,500000,0,-5000000,15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3920,Puerto Rico / UTM zone 20N,Transverse Mercator,metre,4139,Puerto Rico,Clarke 1866,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3942,RGF93 / CC42,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.75,42,3,41.25,1200000,1700000
+3943,RGF93 / CC43,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.75,43,3,42.25,2200000,1700000
+3944,RGF93 / CC44,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.75,44,3,43.25,3200000,1700000
+3945,RGF93 / CC45,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.75,45,3,44.25,4200000,1700000
+3946,RGF93 / CC46,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.75,46,3,45.25,5200000,1700000
+3947,RGF93 / CC47,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.75,47,3,46.25,6200000,1700000
+3948,RGF93 / CC48,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.75,48,3,47.25,7200000,1700000
+3949,RGF93 / CC49,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.75,49,3,48.25,8200000,1700000
+3950,RGF93 / CC50,Lambert Conic Conformal (2SP),metre,4171,Reseau Geodesique Francais 1993,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50.75,50,3,49.25,9200000,1700000
+3968,NAD83 / Virginia Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.5,36,-79.5,37,0,0
+3969,NAD83(HARN) / Virginia Lambert,Lambert Conic Conformal (2SP),metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.5,36,-79.5,37,0,0
+3970,NAD83(NSRS2007) / Virginia Lambert,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.5,36,-79.5,37,0,0
+3973,WGS 84 / NSIDC EASE-Grid North,Lambert Azimuthal Equal Area (Spherical),metre,4326,World Geodetic System 1984,WGS 84,0,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3974,WGS 84 / NSIDC EASE-Grid South,Lambert Azimuthal Equal Area (Spherical),metre,4326,World Geodetic System 1984,WGS 84,0,-90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+3975,WGS 84 / NSIDC EASE-Grid Global,Lambert Cylindrical Equal Area (Spherical),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,0
+3976,WGS 84 / NSIDC Sea Ice Polar Stereographic South,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-70
+3978,NAD83 / Canada Atlas Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,49,-95,49,0,0,
+3979,NAD83(CSRS) / Canada Atlas Lambert,Lambert Conic Conformal (2SP),metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,49,-95,49,0,0,
+3986,Katanga 1955 / Katanga Gauss zone A,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,30,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3987,Katanga 1955 / Katanga Gauss zone B,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,28,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3988,Katanga 1955 / Katanga Gauss zone C,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,26,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3989,Katanga 1955 / Katanga Gauss zone D,Transverse Mercator,metre,0,Katanga 1955,Clarke 1866,200000,-9,500000,24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3991,Puerto Rico State Plane CS of 1927,Lambert Conic Conformal (2SP),US survey foot,4139,Puerto Rico,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,0,500000,
+3992,Puerto Rico / St. Croix,Lambert Conic Conformal (2SP),US survey foot,4139,Puerto Rico,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,100000,500000,
+3993,Guam 1963 / Guam SPCS,Guam Projection,metre,0,Guam 1963,Clarke 1866,50000,13.28208789,50000,144.4455503,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+3994,WGS 84 / Mercator 41,Mercator (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-41,0,0,
+3995,WGS 84 / Arctic Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71
+3996,WGS 84 / IBCAO Polar Stereographic,Polar Stereographic (variant B),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,75
+3997,WGS 84 / Dubai Local TM,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,55.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4026,MOLDREF99 / Moldova TM,Transverse Mercator,metre,0,MOLDREF99,GRS 1980,200000,0,-5000000,28.24,0.99994,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4037,WGS 84 / TMzn35N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4038,WGS 84 / TMzn36N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+4048,RGRDC 2005 / Congo TM zone 12,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,12,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+4049,RGRDC 2005 / Congo TM zone 14,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,14,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+4050,RGRDC 2005 / Congo TM zone 16,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,16,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4051,RGRDC 2005 / Congo TM zone 18,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,18,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4056,RGRDC 2005 / Congo TM zone 20,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,20,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4057,RGRDC 2005 / Congo TM zone 22,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,22,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4058,RGRDC 2005 / Congo TM zone 24,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,24,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4059,RGRDC 2005 / Congo TM zone 26,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,26,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4060,RGRDC 2005 / Congo TM zone 28,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,28,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4061,RGRDC 2005 / UTM zone 33S,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4062,RGRDC 2005 / UTM zone 34S,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4063,RGRDC 2005 / UTM zone 35S,Transverse Mercator,metre,0,Reseau Geodesique de la RDC 2005,GRS 1980,500000,0,10000000,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4071,Chua / UTM zone 23S,Transverse Mercator,metre,0,Chua,International 1924,500000,0,10000000,-45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4082,REGCAN95 / UTM zone 27N,Transverse Mercator,metre,0,Red Geodesica de Canarias 1995,GRS 1980,500000,0,0,-21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4083,REGCAN95 / UTM zone 28N,Transverse Mercator,metre,0,Red Geodesica de Canarias 1995,GRS 1980,500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4088,World Equidistant Cylindrical (Sphere),Equidistant Cylindrical (Spherical),metre,0,Not specified (based on GRS 1980 Authalic Sphere),GRS 1980 Authalic Sphere,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,
+4093,ETRS89 / DKTM1,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,200000,0,-5000000,9,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,,,
+4094,ETRS89 / DKTM2,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,400000,0,-5000000,10,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4095,ETRS89 / DKTM3,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,600000,0,-5000000,11.75,0.99998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4096,ETRS89 / DKTM4,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,800000,0,-5000000,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4326,WGS 84 / World Equidistant Cylindrical,Equidistant Cylindrical,metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,
+4414,NAD83(HARN) / Guam Map Grid,Transverse Mercator,metre,4152,NAD83 (High Accuracy Regional Network),GRS 1980,100000,13.3,200000,144.45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4415,Katanga 1955 / Katanga Lambert,Lambert Conic Conformal (2SP),metre,0,Katanga 1955,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-11.5,-9,26,-6.5,500000,500000
+4417,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 7,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,7500000,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4434,Pulkovo 1942(83) / 3-degree Gauss-Kruger zone 8,Transverse Mercator,metre,4178,Pulkovo 1942(83),Krassowsky 1940,8500000,0,0,24,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4437,NAD83(NSRS2007) / Puerto Rico and Virgin Is.,Lambert Conic Conformal (2SP),metre,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,200000,200000
+4455,NAD27 / Pennsylvania South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,2000000
+4456,NAD27 / New York Long Island,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.3,-74,41.02,100000,2000000
+4457,NAD83 / South Dakota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,1968500
+4462,WGS 84 / Australian Centre for Remote Sensing Lambert,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-36,-27,132,-18,0,0
+4467,RGSPM06 / UTM zone 21N,Transverse Mercator,metre,0,Reseau Geodesique de Saint Pierre et Miquelon 2006,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4471,RGM04 / UTM zone 38S,Transverse Mercator,metre,0,Reseau Geodesique de Mayotte 2004,GRS 1980,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+4474,Cadastre 1997 / UTM zone 38S,Transverse Mercator,metre,4632,Combani 1950,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+4484,Mexican Datum of 1993 / UTM zone 11N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+4485,Mexican Datum of 1993 / UTM zone 12N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-111,0.9996,,,,,,,,,,,,,,,
+4486,Mexican Datum of 1993 / UTM zone 13N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-105,0.9996,,,,,,,,,,,,,,,
+4487,Mexican Datum of 1993 / UTM zone 14N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-99,0.9996,,,,,,,,,,,,,,,
+4488,Mexican Datum of 1993 / UTM zone 15N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-93,0.9996,,,,,,,,,,,,,,,
+4489,Mexican Datum of 1993 / UTM zone 16N,Transverse Mercator,metre,0,Mexican Datum of 1993,GRS 1980,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,
+4491,CGCS2000 / Gauss-Kruger zone 13,Transverse Mercator,metre,0,China 2000,CGCS2000,13500000,0,0,75,1,,,,,,,,,,,,,,,
+4492,CGCS2000 / Gauss-Kruger zone 14,Transverse Mercator,metre,0,China 2000,CGCS2000,14500000,0,0,81,1,,,,,,,,,,,,,,,
+4493,CGCS2000 / Gauss-Kruger zone 15,Transverse Mercator,metre,0,China 2000,CGCS2000,15500000,0,0,87,1,,,,,,,,,,,,,,,
+4494,CGCS2000 / Gauss-Kruger zone 16,Transverse Mercator,metre,0,China 2000,CGCS2000,16500000,0,0,93,1,,,,,,,,,,,,,,,
+4495,CGCS2000 / Gauss-Kruger zone 17,Transverse Mercator,metre,0,China 2000,CGCS2000,17500000,0,0,99,1,,,,,,,,,,,,,,,
+4496,CGCS2000 / Gauss-Kruger zone 18,Transverse Mercator,metre,0,China 2000,CGCS2000,18500000,0,0,105,1,,,,,,,,,,,,,,,
+4497,CGCS2000 / Gauss-Kruger zone 19,Transverse Mercator,metre,0,China 2000,CGCS2000,19500000,0,0,111,1,,,,,,,,,,,,,,,
+4498,CGCS2000 / Gauss-Kruger zone 20,Transverse Mercator,metre,0,China 2000,CGCS2000,20500000,0,0,117,1,,,,,,,,,,,,,,,
+4499,CGCS2000 / Gauss-Kruger zone 21,Transverse Mercator,metre,0,China 2000,CGCS2000,21500000,0,0,123,1
+4500,CGCS2000 / Gauss-Kruger zone 22,Transverse Mercator,metre,0,China 2000,CGCS2000,22500000,0,0,129,1
+4501,CGCS2000 / Gauss-Kruger zone 23,Transverse Mercator,metre,0,China 2000,CGCS2000,23500000,0,0,135,1
+4502,CGCS2000 / Gauss-Kruger CM 75E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,75,1
+4503,CGCS2000 / Gauss-Kruger CM 81E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,81,1
+4504,CGCS2000 / Gauss-Kruger CM 87E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,87,1
+4505,CGCS2000 / Gauss-Kruger CM 93E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,93,1
+4506,CGCS2000 / Gauss-Kruger CM 99E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,99,1
+4507,CGCS2000 / Gauss-Kruger CM 105E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,105,1
+4508,CGCS2000 / Gauss-Kruger CM 111E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,111,1
+4509,CGCS2000 / Gauss-Kruger CM 117E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,117,1
+4510,CGCS2000 / Gauss-Kruger CM 123E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,123,1
+4511,CGCS2000 / Gauss-Kruger CM 129E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,129,1
+4512,CGCS2000 / Gauss-Kruger CM 135E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,135,1
+4513,CGCS2000 / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,0,China 2000,CGCS2000,25500000,0,0,75,1
+4514,CGCS2000 / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,0,China 2000,CGCS2000,26500000,0,0,78,1
+4515,CGCS2000 / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,0,China 2000,CGCS2000,27500000,0,0,81,1
+4516,CGCS2000 / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,0,China 2000,CGCS2000,28500000,0,0,84,1
+4517,CGCS2000 / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,0,China 2000,CGCS2000,29500000,0,0,87,1
+4518,CGCS2000 / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,0,China 2000,CGCS2000,30500000,0,0,90,1
+4519,CGCS2000 / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,0,China 2000,CGCS2000,31500000,0,0,93,1
+4520,CGCS2000 / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,0,China 2000,CGCS2000,32500000,0,0,96,1
+4521,CGCS2000 / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,0,China 2000,CGCS2000,33500000,0,0,99,1
+4522,CGCS2000 / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,0,China 2000,CGCS2000,34500000,0,0,102,1
+4523,CGCS2000 / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,0,China 2000,CGCS2000,35500000,0,0,105,1
+4524,CGCS2000 / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,0,China 2000,CGCS2000,36500000,0,0,108,1
+4525,CGCS2000 / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,0,China 2000,CGCS2000,37500000,0,0,111,1
+4526,CGCS2000 / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,0,China 2000,CGCS2000,38500000,0,0,114,1
+4527,CGCS2000 / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,0,China 2000,CGCS2000,39500000,0,0,117,1
+4528,CGCS2000 / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,0,China 2000,CGCS2000,40500000,0,0,120,1
+4529,CGCS2000 / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,0,China 2000,CGCS2000,41500000,0,0,123,1
+4530,CGCS2000 / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,0,China 2000,CGCS2000,42500000,0,0,126,1
+4531,CGCS2000 / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,0,China 2000,CGCS2000,43500000,0,0,129,1
+4532,CGCS2000 / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,0,China 2000,CGCS2000,44500000,0,0,132,1
+4533,CGCS2000 / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,0,China 2000,CGCS2000,45500000,0,0,135,1
+4534,CGCS2000 / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,75,1
+4535,CGCS2000 / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,78,1
+4536,CGCS2000 / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,81,1
+4537,CGCS2000 / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,84,1
+4538,CGCS2000 / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,87,1
+4539,CGCS2000 / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,90,1
+4540,CGCS2000 / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,93,1
+4541,CGCS2000 / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,96,1
+4542,CGCS2000 / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,99,1
+4543,CGCS2000 / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,102,1
+4544,CGCS2000 / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,105,1
+4545,CGCS2000 / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,108,1
+4546,CGCS2000 / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,111,1
+4547,CGCS2000 / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,114,1
+4548,CGCS2000 / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,117,1
+4549,CGCS2000 / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,120,1
+4550,CGCS2000 / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,123,1
+4551,CGCS2000 / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,126,1
+4552,CGCS2000 / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,129,1
+4553,CGCS2000 / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,132,1
+4554,CGCS2000 / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,0,China 2000,CGCS2000,500000,0,0,135,1
+4559,RRAF 1991 / UTM zone 20N,Transverse Mercator,metre,4640,Reseau de Reference des Antilles Francaises 1991,GRS 1980,500000,0,0,-63,0.9996
+4568,New Beijing / Gauss-Kruger zone 13,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,13500000,0,0,75,1
+4569,New Beijing / Gauss-Kruger zone 14,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,14500000,0,0,81,1
+4570,New Beijing / Gauss-Kruger zone 15,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,15500000,0,0,87,1
+4571,New Beijing / Gauss-Kruger zone 16,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,16500000,0,0,93,1
+4572,New Beijing / Gauss-Kruger zone 17,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,17500000,0,0,99,1
+4573,New Beijing / Gauss-Kruger zone 18,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,18500000,0,0,105,1
+4574,New Beijing / Gauss-Kruger zone 19,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,19500000,0,0,111,1
+4575,New Beijing / Gauss-Kruger zone 20,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,20500000,0,0,117,1
+4576,New Beijing / Gauss-Kruger zone 21,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,21500000,0,0,123,1
+4577,New Beijing / Gauss-Kruger zone 22,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,22500000,0,0,129,1
+4578,New Beijing / Gauss-Kruger zone 23,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,23500000,0,0,135,1
+4579,New Beijing / Gauss-Kruger CM 75E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,75,1
+4580,New Beijing / Gauss-Kruger CM 81E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,81,1
+4581,New Beijing / Gauss-Kruger CM 87E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,87,1
+4582,New Beijing / Gauss-Kruger CM 93E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,93,1
+4583,New Beijing / Gauss-Kruger CM 99E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,99,1
+4584,New Beijing / Gauss-Kruger CM 105E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,105,1
+4585,New Beijing / Gauss-Kruger CM 111E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,111,1
+4586,New Beijing / Gauss-Kruger CM 117E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,117,1
+4587,New Beijing / Gauss-Kruger CM 123E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,123,1
+4588,New Beijing / Gauss-Kruger CM 129E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,129,1
+4589,New Beijing / Gauss-Kruger CM 135E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,135,1
+4647,ETRS89 / UTM zone N32,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,32500000,0,0,9,0.9996
+4652,New Beijing / 3-degree Gauss-Kruger zone 25,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,25500000,0,0,75,1
+4653,New Beijing / 3-degree Gauss-Kruger zone 26,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,26500000,0,0,78,1
+4654,New Beijing / 3-degree Gauss-Kruger zone 27,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,27500000,0,0,81,1
+4655,New Beijing / 3-degree Gauss-Kruger zone 28,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,28500000,0,0,84,1
+4656,New Beijing / 3-degree Gauss-Kruger zone 29,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,29500000,0,0,87,1
+4766,New Beijing / 3-degree Gauss-Kruger zone 30,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,30500000,0,0,90,1
+4767,New Beijing / 3-degree Gauss-Kruger zone 31,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,31500000,0,0,93,1
+4768,New Beijing / 3-degree Gauss-Kruger zone 32,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,32500000,0,0,96,1
+4769,New Beijing / 3-degree Gauss-Kruger zone 33,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,33500000,0,0,99,1
+4770,New Beijing / 3-degree Gauss-Kruger zone 34,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,34500000,0,0,102,1
+4771,New Beijing / 3-degree Gauss-Kruger zone 35,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,35500000,0,0,105,1
+4772,New Beijing / 3-degree Gauss-Kruger zone 36,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,36500000,0,0,108,1
+4773,New Beijing / 3-degree Gauss-Kruger zone 37,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,37500000,0,0,111,1
+4774,New Beijing / 3-degree Gauss-Kruger zone 38,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,38500000,0,0,114,1
+4775,New Beijing / 3-degree Gauss-Kruger zone 39,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,39500000,0,0,117,1
+4776,New Beijing / 3-degree Gauss-Kruger zone 40,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,40500000,0,0,120,1
+4777,New Beijing / 3-degree Gauss-Kruger zone 41,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,41500000,0,0,123,1
+4778,New Beijing / 3-degree Gauss-Kruger zone 42,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,42500000,0,0,126,1
+4779,New Beijing / 3-degree Gauss-Kruger zone 43,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,43500000,0,0,129,1
+4780,New Beijing / 3-degree Gauss-Kruger zone 44,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,44500000,0,0,132,1
+4781,New Beijing / 3-degree Gauss-Kruger zone 45,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,45500000,0,0,135,1
+4782,New Beijing / 3-degree Gauss-Kruger CM 75E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,75,1
+4783,New Beijing / 3-degree Gauss-Kruger CM 78E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,78,1
+4784,New Beijing / 3-degree Gauss-Kruger CM 81E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,81,1
+4785,New Beijing / 3-degree Gauss-Kruger CM 84E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,84,1
+4786,New Beijing / 3-degree Gauss-Kruger CM 87E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,87,1
+4787,New Beijing / 3-degree Gauss-Kruger CM 90E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,90,1
+4788,New Beijing / 3-degree Gauss-Kruger CM 93E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,93,1
+4789,New Beijing / 3-degree Gauss-Kruger CM 96E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,96,1
+4790,New Beijing / 3-degree Gauss-Kruger CM 99E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,99,1
+4791,New Beijing / 3-degree Gauss-Kruger CM 102E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,102,1
+4792,New Beijing / 3-degree Gauss-Kruger CM 105E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,105,1
+4793,New Beijing / 3-degree Gauss-Kruger CM 108E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,108,1,,,,,,,,,,,,,,,,
+4794,New Beijing / 3-degree Gauss-Kruger CM 111E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,111,1,,,,,,,,,,,,,,,,
+4795,New Beijing / 3-degree Gauss-Kruger CM 114E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,114,1,,,,,,,,,,,,,,,,
+4796,New Beijing / 3-degree Gauss-Kruger CM 117E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,117,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4797,New Beijing / 3-degree Gauss-Kruger CM 120E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,120,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4798,New Beijing / 3-degree Gauss-Kruger CM 123E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,123,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4799,New Beijing / 3-degree Gauss-Kruger CM 126E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,126,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4800,New Beijing / 3-degree Gauss-Kruger CM 129E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,129,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4812,New Beijing / 3-degree Gauss-Kruger CM 132E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,132,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4822,New Beijing / 3-degree Gauss-Kruger CM 135E,Transverse Mercator,metre,0,New Beijing,Krassowsky 1940,500000,0,0,135,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+4826,WGS 84 / Cape Verde National,Lambert Conic Conformal (2SP),metre,4326,World Geodetic System 1984,WGS 84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16.4,15.5,-24,15,128511.202,161587.83
+20004,Pulkovo 1995 / Gauss-Kruger zone 4,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,4500000,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+20005,Pulkovo 1995 / Gauss-Kruger zone 5,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,5500000,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+20006,Pulkovo 1995 / Gauss-Kruger zone 6,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,6500000,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+20007,Pulkovo 1995 / Gauss-Kruger zone 7,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,7500000,0,0,39,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+20008,Pulkovo 1995 / Gauss-Kruger zone 8,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,8500000,0,0,45,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+20009,Pulkovo 1995 / Gauss-Kruger zone 9,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,9500000,0,0,51,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+20010,Pulkovo 1995 / Gauss-Kruger zone 10,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,10500000,0,0,57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+20011,Pulkovo 1995 / Gauss-Kruger zone 11,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,11500000,0,0,63,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+20012,Pulkovo 1995 / Gauss-Kruger zone 12,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,12500000,0,0,69,1,,,,,,,,,,,,,,,
+20013,Pulkovo 1995 / Gauss-Kruger zone 13,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,13500000,0,0,75,1,,,,,,,,,,,,,,,
+20014,Pulkovo 1995 / Gauss-Kruger zone 14,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,14500000,0,0,81,1,,,,,,,,,,,,,,,
+20015,Pulkovo 1995 / Gauss-Kruger zone 15,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,15500000,0,0,87,1,,,,,,,,,,,,,,,
+20016,Pulkovo 1995 / Gauss-Kruger zone 16,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,16500000,0,0,93,1,,,,,,,,,,,,,,,
+20017,Pulkovo 1995 / Gauss-Kruger zone 17,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,17500000,0,0,99,1,,,,,,,,,,,,,,,
+20018,Pulkovo 1995 / Gauss-Kruger zone 18,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,18500000,0,0,105,1,,,,,,,,,,,,,,,
+20019,Pulkovo 1995 / Gauss-Kruger zone 19,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,19500000,0,0,111,1,,,,,,,,,,,,,,,
+20020,Pulkovo 1995 / Gauss-Kruger zone 20,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,20500000,0,0,117,1,,,,,,,,,,,,,,,
+20021,Pulkovo 1995 / Gauss-Kruger zone 21,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,21500000,0,0,123,1,,,,,,,,,,,,,,,
+20022,Pulkovo 1995 / Gauss-Kruger zone 22,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,22500000,0,0,129,1,,,,,,,,,,,,,,,
+20023,Pulkovo 1995 / Gauss-Kruger zone 23,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,23500000,0,0,135,1,,,,,,,,,,,,,,,
+20024,Pulkovo 1995 / Gauss-Kruger zone 24,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,24500000,0,0,141,1,,,,,,,,,,,,,,,
+20025,Pulkovo 1995 / Gauss-Kruger zone 25,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,25500000,0,0,147,1
+20026,Pulkovo 1995 / Gauss-Kruger zone 26,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,26500000,0,0,153,1
+20027,Pulkovo 1995 / Gauss-Kruger zone 27,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,27500000,0,0,159,1
+20028,Pulkovo 1995 / Gauss-Kruger zone 28,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,28500000,0,0,165,1
+20029,Pulkovo 1995 / Gauss-Kruger zone 29,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,29500000,0,0,171,1
+20030,Pulkovo 1995 / Gauss-Kruger zone 30,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,30500000,0,0,177,1
+20031,Pulkovo 1995 / Gauss-Kruger zone 31,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,31500000,0,0,-177,1
+20032,Pulkovo 1995 / Gauss-Kruger zone 32,Transverse Mercator,metre,4200,Pulkovo 1995,Krassowsky 1940,32500000,0,0,-171,1
+20135,Adindan / UTM zone 35N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,27,0.9996
+20136,Adindan / UTM zone 36N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,33,0.9996
+20137,Adindan / UTM zone 37N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,39,0.9996
+20138,Adindan / UTM zone 38N,Transverse Mercator,metre,4201,Adindan,Clarke 1880 (RGS),500000,0,0,45,0.9996
+20248,AGD66 / AMG zone 48,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,105,0.9996
+20249,AGD66 / AMG zone 49,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,111,0.9996
+20250,AGD66 / AMG zone 50,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,117,0.9996
+20251,AGD66 / AMG zone 51,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,123,0.9996
+20252,AGD66 / AMG zone 52,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,129,0.9996
+20253,AGD66 / AMG zone 53,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,135,0.9996
+20254,AGD66 / AMG zone 54,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,141,0.9996
+20255,AGD66 / AMG zone 55,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,147,0.9996
+20256,AGD66 / AMG zone 56,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,153,0.9996
+20257,AGD66 / AMG zone 57,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,159,0.9996
+20258,AGD66 / AMG zone 58,Transverse Mercator,metre,4202,Australian Geodetic Datum 1966,Australian National Spheroid,500000,0,10000000,165,0.9996
+20348,AGD84 / AMG zone 48,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,105,0.9996
+20349,AGD84 / AMG zone 49,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,111,0.9996
+20350,AGD84 / AMG zone 50,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,117,0.9996
+20351,AGD84 / AMG zone 51,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,123,0.9996
+20352,AGD84 / AMG zone 52,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,129,0.9996
+20353,AGD84 / AMG zone 53,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,135,0.9996
+20354,AGD84 / AMG zone 54,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,141,0.9996
+20355,AGD84 / AMG zone 55,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,147,0.9996
+20356,AGD84 / AMG zone 56,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,153,0.9996
+20357,AGD84 / AMG zone 57,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,159,0.9996
+20358,AGD84 / AMG zone 58,Transverse Mercator,metre,4203,Australian Geodetic Datum 1984,Australian National Spheroid,500000,0,10000000,165,0.9996
+20436,Ain el Abd / UTM zone 36N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,33,0.9996
+20437,Ain el Abd / UTM zone 37N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,39,0.9996
+20438,Ain el Abd / UTM zone 38N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,45,0.9996
+20439,Ain el Abd / UTM zone 39N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,51,0.9996
+20440,Ain el Abd / UTM zone 40N,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,57,0.9996
+20499,Ain el Abd / Bahrain Grid,Transverse Mercator,metre,4204,Ain el Abd 1970,International 1924,500000,0,0,51,0.9996
+20538,Afgooye / UTM zone 38N,Transverse Mercator,metre,4205,Afgooye,Krassowsky 1940,500000,0,0,45,0.9996
+20539,Afgooye / UTM zone 39N,Transverse Mercator,metre,4205,Afgooye,Krassowsky 1940,500000,0,0,51,0.9996
+20790,Lisbon (Lisbon) / Portuguese National Grid,Transverse Mercator,metre,4207,Lisbon 1937 (Lisbon),International 1924,200000,39.4,300000,1,1
+20791,Lisbon (Lisbon) / Portuguese Grid,Transverse Mercator,metre,4207,Lisbon 1937 (Lisbon),International 1924,0,39.4,0,1,1
+20822,Aratu / UTM zone 22S,Transverse Mercator,metre,4208,Aratu,International 1924,500000,0,10000000,-51,0.9996
+20823,Aratu / UTM zone 23S,Transverse Mercator,metre,4208,Aratu,International 1924,500000,0,10000000,-45,0.9996
+20824,Aratu / UTM zone 24S,Transverse Mercator,metre,4208,Aratu,International 1924,500000,0,10000000,-39,0.9996
+20934,Arc 1950 / UTM zone 34S,Transverse Mercator,metre,4209,Arc 1950,Clarke 1880 (Arc),500000,0,10000000,21,0.9996
+20935,Arc 1950 / UTM zone 35S,Transverse Mercator,metre,4209,Arc 1950,Clarke 1880 (Arc),500000,0,10000000,27,0.9996
+20936,Arc 1950 / UTM zone 36S,Transverse Mercator,metre,4209,Arc 1950,Clarke 1880 (Arc),500000,0,10000000,33,0.9996
+21035,Arc 1960 / UTM zone 35S,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,10000000,27,0.9996
+21036,Arc 1960 / UTM zone 36S,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,10000000,33,0.9996
+21037,Arc 1960 / UTM zone 37S,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,10000000,39,0.9996
+21095,Arc 1960 / UTM zone 35N,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,0,27,0.9996
+21096,Arc 1960 / UTM zone 36N,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,0,33,0.9996
+21097,Arc 1960 / UTM zone 37N,Transverse Mercator,metre,4210,Arc 1960,Clarke 1880 (RGS),500000,0,0,39,0.9996
+21148,Batavia / UTM zone 48S,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,105,0.9996
+21149,Batavia / UTM zone 49S,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,111,0.9996
+21150,Batavia / UTM zone 50S,Transverse Mercator,metre,4211,Batavia,Bessel 1841,500000,0,10000000,117,0.9996
+21291,Barbados 1938 / British West Indies Grid,Transverse Mercator,metre,4212,Barbados 1938,Clarke 1880 (RGS),400000,0,0,-62,0.9995
+21292,Barbados 1938 / Barbados National Grid,Transverse Mercator,metre,4212,Barbados 1938,Clarke 1880 (RGS),30000,13.1035,75000,-59.3335,0.9999986
+21413,Beijing 1954 / Gauss-Kruger zone 13,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,13500000,0,0,75,1
+21414,Beijing 1954 / Gauss-Kruger zone 14,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,14500000,0,0,81,1
+21415,Beijing 1954 / Gauss-Kruger zone 15,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,15500000,0,0,87,1
+21416,Beijing 1954 / Gauss-Kruger zone 16,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,16500000,0,0,93,1
+21417,Beijing 1954 / Gauss-Kruger zone 17,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,17500000,0,0,99,1
+21418,Beijing 1954 / Gauss-Kruger zone 18,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,18500000,0,0,105,1
+21419,Beijing 1954 / Gauss-Kruger zone 19,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,19500000,0,0,111,1
+21420,Beijing 1954 / Gauss-Kruger zone 20,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,20500000,0,0,117,1
+21421,Beijing 1954 / Gauss-Kruger zone 21,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,21500000,0,0,123,1
+21422,Beijing 1954 / Gauss-Kruger zone 22,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,22500000,0,0,129,1
+21423,Beijing 1954 / Gauss-Kruger zone 23,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,23500000,0,0,135,1
+21453,Beijing 1954 / Gauss-Kruger CM 75E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,75,1
+21454,Beijing 1954 / Gauss-Kruger CM 81E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,81,1
+21455,Beijing 1954 / Gauss-Kruger CM 87E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,87,1
+21456,Beijing 1954 / Gauss-Kruger CM 93E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,93,1
+21457,Beijing 1954 / Gauss-Kruger CM 99E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,99,1
+21458,Beijing 1954 / Gauss-Kruger CM 105E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,105,1
+21459,Beijing 1954 / Gauss-Kruger CM 111E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,111,1
+21460,Beijing 1954 / Gauss-Kruger CM 117E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,117,1
+21461,Beijing 1954 / Gauss-Kruger CM 123E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,123,1,,,,,,,,,,,,,,,,
+21462,Beijing 1954 / Gauss-Kruger CM 129E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,129,1,,,,,,,,,,,,,,,,
+21463,Beijing 1954 / Gauss-Kruger CM 135E,Transverse Mercator,metre,4214,Beijing 1954,Krassowsky 1940,500000,0,0,135,1,,,,,,,,,,,,,,,,
+21500,Belge 1950 (Brussels) / Belge Lambert 50,Lambert Conic Conformal (2SP),metre,4215,Reseau National Belge 1950 (Brussels),International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,90,0,49.5,5400000,150000
+21780,Bern 1898 (Bern) / LV03C,Oblique Mercator,metre,4801,CH1903 (Bern),Bessel 1841,0,0,0,0,0,90,46.570866,0,90,1,0,0,0,0,0,0,0,0,0,0,
+21781,CH1903 / LV03,Oblique Mercator,metre,4149,CH1903,Bessel 1841,0,0,0,0,0,90,46.570866,200000,90,1,600000,7.26225,0,0,0,0,0,0,0,0,
+21782,CH1903 / LV03C-G,Oblique Mercator,metre,4149,CH1903,Bessel 1841,0,0,0,0,0,90,46.570866,0,90,1,0,7.26225,0,0,0,0,0,0,0,0,
+21818,Bogota 1975 / UTM zone 18N,Transverse Mercator,metre,4218,Bogota 1975,International 1924,500000,0,0,-75,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+21896,Bogota 1975 / Colombia West zone,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-77.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+21897,Bogota 1975 / Colombia Bogota zone,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-74.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+21898,Bogota 1975 / Colombia East Central zone,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-71.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+21899,Bogota 1975 / Colombia East,Transverse Mercator,metre,4218,Bogota 1975,International 1924,1000000,4.355657,1000000,-68.04513,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+22032,Camacupa / UTM zone 32S,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+22033,Camacupa / UTM zone 33S,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+22091,Camacupa / TM 11.30 SE,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,11.3,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+22092,Camacupa / TM 12 SE,Transverse Mercator,metre,4220,Camacupa,Clarke 1880 (RGS),500000,0,10000000,12,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+22171,POSGAR 98 / Argentina 1,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,1500000,-90,0,-72,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22172,POSGAR 98 / Argentina 2,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,2500000,-90,0,-69,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22173,POSGAR 98 / Argentina 3,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,3500000,-90,0,-66,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22174,POSGAR 98 / Argentina 4,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,4500000,-90,0,-63,1,,,,,,,,,,,,,,,
+22175,POSGAR 98 / Argentina 5,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,5500000,-90,0,-60,1,,,,,,,,,,,,,,,
+22176,POSGAR 98 / Argentina 6,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,6500000,-90,0,-57,1,,,,,,,,,,,,,,,
+22177,POSGAR 98 / Argentina 7,Transverse Mercator,metre,4190,Posiciones Geodesicas Argentinas 1998,GRS 1980,7500000,-90,0,-54,1,,,,,,,,,,,,,,,
+22181,POSGAR 94 / Argentina 1,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,1500000,-90,0,-72,1,,,,,,,,,,,,,,,
+22182,POSGAR 94 / Argentina 2,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,2500000,-90,0,-69,1,,,,,,,,,,,,,,,
+22183,POSGAR 94 / Argentina 3,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,3500000,-90,0,-66,1,,,,,,,,,,,,,,,
+22184,POSGAR 94 / Argentina 4,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,4500000,-90,0,-63,1,,,,,,,,,,,,,,,
+22185,POSGAR 94 / Argentina 5,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,5500000,-90,0,-60,1,,,,,,,,,,,,,,,
+22186,POSGAR 94 / Argentina 6,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,6500000,-90,0,-57,1,,,,,,,,,,,,,,,
+22187,POSGAR 94 / Argentina 7,Transverse Mercator,metre,4172,Posiciones Geodesicas Argentinas 1994,WGS 84,7500000,-90,0,-54,1,,,,,,,,,,,,,,,
+22191,Campo Inchauspe / Argentina 1,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,1500000,-90,0,-72,1,,,,,,,,,,,,,,,
+22192,Campo Inchauspe / Argentina 2,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,2500000,-90,0,-69,1,,,,,,,,,,,,,,,
+22193,Campo Inchauspe / Argentina 3,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,3500000,-90,0,-66,1,,,,,,,,,,,,,,,
+22194,Campo Inchauspe / Argentina 4,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,4500000,-90,0,-63,1,,,,,,,,,,,,,,,
+22195,Campo Inchauspe / Argentina 5,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,5500000,-90,0,-60,1,,,,,,,,,,,,,,,
+22196,Campo Inchauspe / Argentina 6,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,6500000,-90,0,-57,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22197,Campo Inchauspe / Argentina 7,Transverse Mercator,metre,4221,Campo Inchauspe,International 1924,7500000,-90,0,-54,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22234,Cape / UTM zone 34S,Transverse Mercator,metre,4222,Cape,Clarke 1880 (Arc),500000,0,10000000,21,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22235,Cape / UTM zone 35S,Transverse Mercator,metre,4222,Cape,Clarke 1880 (Arc),500000,0,10000000,27,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22236,Cape / UTM zone 36S,Transverse Mercator,metre,4222,Cape,Clarke 1880 (Arc),500000,0,10000000,33,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22275,Cape / Lo15,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22277,Cape / Lo17,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,17,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22279,Cape / Lo19,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,19,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22281,Cape / Lo21,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22283,Cape / Lo23,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,23,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22285,Cape / Lo25,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,25,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22287,Cape / Lo27,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22289,Cape / Lo29,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,29,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+22291,Cape / Lo31,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+22293,Cape / Lo33,Transverse Mercator (South Orientated),metre,4222,Cape,Clarke 1880 (Arc),0,0,0,33,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+22300,Carthage (Paris) / Tunisia Mining Grid,Tunisia Mining Grid,kilometre,4816,Carthage (Paris),Clarke 1880 (IGN),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.81973,7.83445,0,582,270
+22332,Carthage / UTM zone 32N,Transverse Mercator,metre,4223,Carthage,Clarke 1880 (IGN),500000,0,0,9,0.9996,,,,,,,,,,,,,,,,
+22391,Carthage / Nord Tunisie,Lambert Conic Conformal (1SP),metre,4223,Carthage,Clarke 1880 (IGN),500000,40,300000,11,0.999625544,,,,,,,,,,,,,,,,
+22392,Carthage / Sud Tunisie,Lambert Conic Conformal (1SP),metre,4223,Carthage,Clarke 1880 (IGN),500000,37,300000,11,0.999625769,,,,,,,,,,,,,,,,
+22521,Corrego Alegre / UTM zone 21S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-57,0.9996,,,,,,,,,,,,,,,,
+22522,Corrego Alegre / UTM zone 22S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-51,0.9996,,,,,,,,,,,,,,,,
+22523,Corrego Alegre / UTM zone 23S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-45,0.9996,,,,,,,,,,,,,,,,
+22524,Corrego Alegre / UTM zone 24S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-39,0.9996,,,,,,,,,,,,,,,,
+22525,Corrego Alegre / UTM zone 25S,Transverse Mercator,metre,4225,Corrego Alegre,International 1924,500000,0,10000000,-33,0.9996,,,,,,,,,,,,,,,,
+22700,Deir ez Zor / Levant Zone,Lambert Conic Near-Conformal,metre,4227,Deir ez Zor,Clarke 1880 (IGN),300000,34.39,300000,37.21,0.9996256,,,,,,,,,,,,,,,,
+22770,Deir ez Zor / Syria Lambert,Lambert Conic Conformal (1SP),metre,4227,Deir ez Zor,Clarke 1880 (IGN),300000,34.39,300000,37.21,0.9996256,,,,,,,,,,,,,,,,
+22780,Deir ez Zor / Levant Stereographic,Oblique Stereographic,metre,4227,Deir ez Zor,Clarke 1880 (IGN),0,38,0,43.5,0.9995341,,,,,,,,,,,,,,,,
+22991,Egypt 1907 / Blue Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,300000,30,1100000,35,1,,,,,,,,,,,,,,,,
+22992,Egypt 1907 / Red Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,615000,30,810000,31,1,,,,,,,,,,,,,,,,
+22993,Egypt 1907 / Purple Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,700000,30,200000,27,1,,,,,,
+22994,Egypt 1907 / Extended Purple Belt,Transverse Mercator,metre,4229,Egypt 1907,Helmert 1906,700000,30,1200000,27,1,,,,,,
+23028,ED50 / UTM zone 28N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,-15,0.9996,,,,,,
+23029,ED50 / UTM zone 29N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,-9,0.9996,0,0,0,0,0,0
+23030,ED50 / UTM zone 30N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,-3,0.9996,0,0,0,0,0,0
+23031,ED50 / UTM zone 31N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,3,0.9996,0,0,0,0,0,0
+23032,ED50 / UTM zone 32N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,9,0.9996,0,0,0,0,0,0
+23033,ED50 / UTM zone 33N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,15,0.9996,0,0,0,0,0,0
+23034,ED50 / UTM zone 34N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,21,0.9996,0,0,0,0,0,0
+23035,ED50 / UTM zone 35N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,27,0.9996,0,0,0,0,0,0
+23036,ED50 / UTM zone 36N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,33,0.9996,0,0,0,0,0,0
+23037,ED50 / UTM zone 37N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,39,0.9996,0,0,0,0,0,0
+23038,ED50 / UTM zone 38N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,45,0.9996,0,0,0,0,0,0
+23090,ED50 / TM 0 N,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,0,0.9996,0,0,0,0,0,0
+23095,ED50 / TM 5 NE,Transverse Mercator,metre,4154,European Datum 1950,International 1924,500000,0,0,5,0.9996,0,0,0,0,0,0
+23239,Fahud / UTM zone 39N,Transverse Mercator,metre,4232,Fahud,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0
+23240,Fahud / UTM zone 40N,Transverse Mercator,metre,4232,Fahud,Clarke 1880 (RGS),500000,0,0,57,0.9996,0,0,0,0,0,0,
+23700,HD72 / EOV,Oblique Mercator,metre,4237,Hungarian Datum 1972,GRS 1967,0,0,0,0,0,90,47.08398174,200000,90,0.99993,650000,19.02548584
+23830,DGN95 / Indonesia TM-3 zone 46.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,94.5,0.9999,0,0,0,0,0,0,
+23831,DGN95 / Indonesia TM-3 zone 47.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,97.5,0.9999,,,,,,,
+23832,DGN95 / Indonesia TM-3 zone 47.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,100.5,0.9999,,,,,,,
+23833,DGN95 / Indonesia TM-3 zone 48.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,103.5,0.9999,,,,,,,
+23834,DGN95 / Indonesia TM-3 zone 48.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,106.5,0.9999,,,,,,,
+23835,DGN95 / Indonesia TM-3 zone 49.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,109.5,0.9999,,,,,,,
+23836,DGN95 / Indonesia TM-3 zone 49.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,112.5,0.9999,,,,,,,
+23837,DGN95 / Indonesia TM-3 zone 50.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,115.5,0.9999,,,,,,,
+23838,DGN95 / Indonesia TM-3 zone 50.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,118.5,0.9999,,,,,,,
+23839,DGN95 / Indonesia TM-3 zone 51.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,121.5,0.9999,,,,,,,
+23840,DGN95 / Indonesia TM-3 zone 51.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,124.5,0.9999,,,,,,,
+23841,DGN95 / Indonesia TM-3 zone 52.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,127.5,0.9999,,,,,,,
+23842,DGN95 / Indonesia TM-3 zone 52.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,130.5,0.9999,,,,,,,
+23843,DGN95 / Indonesia TM-3 zone 53.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,133.5,0.9999,,,,,,,
+23844,DGN95 / Indonesia TM-3 zone 53.2,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,136.5,0.9999
+23845,DGN95 / Indonesia TM-3 zone 54.1,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,200000,0,1500000,139.5,0.9999
+23846,ID74 / UTM zone 46N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,93,0.9996
+23847,ID74 / UTM zone 47N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,99,0.9996
+23848,ID74 / UTM zone 48N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,105,0.9996
+23849,ID74 / UTM zone 49N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,111,0.9996
+23850,ID74 / UTM zone 50N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,117,0.9996
+23851,ID74 / UTM zone 51N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,123,0.9996
+23852,ID74 / UTM zone 52N,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,0,129,0.9996
+23866,DGN95 / UTM zone 46N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,93,0.9996
+23867,DGN95 / UTM zone 47N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,99,0.9996
+23868,DGN95 / UTM zone 48N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,105,0.9996
+23869,DGN95 / UTM zone 49N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,111,0.9996
+23870,DGN95 / UTM zone 50N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,117,0.9996
+23871,DGN95 / UTM zone 51N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,123,0.9996
+23872,DGN95 / UTM zone 52N,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,0,129,0.9996
+23877,DGN95 / UTM zone 47S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,99,0.9996
+23878,DGN95 / UTM zone 48S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,105,0.9996
+23879,DGN95 / UTM zone 49S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,111,0.9996
+23880,DGN95 / UTM zone 50S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,117,0.9996
+23881,DGN95 / UTM zone 51S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,123,0.9996
+23882,DGN95 / UTM zone 52S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,129,0.9996
+23883,DGN95 / UTM zone 53S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,135,0.9996
+23884,DGN95 / UTM zone 54S,Transverse Mercator,metre,4021,Datum Geodesi Nasional 1995,WGS 84,500000,0,10000000,141,0.9996
+23887,ID74 / UTM zone 47S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,99,0.9996
+23888,ID74 / UTM zone 48S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,105,0.9996
+23889,ID74 / UTM zone 49S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,111,0.9996
+23890,ID74 / UTM zone 50S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,117,0.9996
+23891,ID74 / UTM zone 51S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,123,0.9996
+23892,ID74 / UTM zone 52S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,129,0.9996
+23893,ID74 / UTM zone 53S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,135,0.9996
+23894,ID74 / UTM zone 54S,Transverse Mercator,metre,4238,Indonesian Datum 1974,Indonesian National Spheroid,500000,0,10000000,141,0.9996
+23946,Indian 1954 / UTM zone 46N,Transverse Mercator,metre,4239,Indian 1954,Everest 1830 (1937 Adjustment),500000,0,0,93,0.9996
+23947,Indian 1954 / UTM zone 47N,Transverse Mercator,metre,4239,Indian 1954,Everest 1830 (1937 Adjustment),500000,0,0,99,0.9996
+23948,Indian 1954 / UTM zone 48N,Transverse Mercator,metre,4239,Indian 1954,Everest 1830 (1937 Adjustment),500000,0,0,105,0.9996
+24047,Indian 1975 / UTM zone 47N,Transverse Mercator,metre,4240,Indian 1975,Everest 1830 (1937 Adjustment),500000,0,0,99,0.9996
+24048,Indian 1975 / UTM zone 48N,Transverse Mercator,metre,4240,Indian 1975,Everest 1830 (1937 Adjustment),500000,0,0,105,0.9996
+24100,Jamaica 1875 / Jamaica (Old Grid),Lambert Conic Conformal (1SP),Clarke's foot,4241,Jamaica 1875,Clarke 1880,550000,18,400000,-77,1
+24200,JAD69 / Jamaica National Grid,Lambert Conic Conformal (1SP),metre,4242,Jamaica 1969,Clarke 1866,250000,18,150000,-77,1
+24305,Kalianpur 1937 / UTM zone 45N,Transverse Mercator,metre,4144,Kalianpur 1937,Everest 1830 (1937 Adjustment),500000,0,0,87,0.9996
+24306,Kalianpur 1937 / UTM zone 46N,Transverse Mercator,metre,4144,Kalianpur 1937,Everest 1830 (1937 Adjustment),500000,0,0,93,0.9996
+24311,Kalianpur 1962 / UTM zone 41N,Transverse Mercator,metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),500000,0,0,63,0.9996
+24312,Kalianpur 1962 / UTM zone 42N,Transverse Mercator,metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),500000,0,0,69,0.9996
+24313,Kalianpur 1962 / UTM zone 43N,Transverse Mercator,metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),500000,0,0,75,0.9996
+24342,Kalianpur 1975 / UTM zone 42N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,69,0.9996
+24343,Kalianpur 1975 / UTM zone 43N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,75,0.9996
+24344,Kalianpur 1975 / UTM zone 44N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,81,0.9996
+24345,Kalianpur 1975 / UTM zone 45N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,87,0.9996
+24346,Kalianpur 1975 / UTM zone 46N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,93,0.9996
+24347,Kalianpur 1975 / UTM zone 47N,Transverse Mercator,metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),500000,0,0,99,0.9996
+24370,Kalianpur 1880 / India zone 0,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),2355500,39.3,2590000,68,0.99846154
+24371,Kalianpur 1880 / India zone I,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,32.3,1000000,68,0.99878641
+24372,Kalianpur 1880 / India zone IIa,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,26,1000000,74,0.99878641
+24373,Kalianpur 1880 / India zone III,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,19,1000000,80,0.99878641
+24374,Kalianpur 1880 / India zone IV,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,12,1000000,80,0.99878641
+24375,Kalianpur 1937 / India zone IIb,Lambert Conic Conformal (1SP),metre,4144,Kalianpur 1937,Everest 1830 (1937 Adjustment),2743185.69,26,914395.23,90,0.99878641
+24376,Kalianpur 1962 / India zone I,Lambert Conic Conformal (1SP),metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),2743196.4,32.3,914398.8,68,0.99878641
+24377,Kalianpur 1962 / India zone IIa,Lambert Conic Conformal (1SP),metre,4145,Kalianpur 1962,Everest 1830 (1962 Definition),2743196.4,26,914398.8,74,0.99878641
+24378,Kalianpur 1975 / India zone I,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,32.3,914398.5,68,0.99878641
+24379,Kalianpur 1975 / India zone IIa,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,26,914398.5,74,0.99878641
+24380,Kalianpur 1975 / India zone IIb,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,26,914398.5,90,0.99878641
+24381,Kalianpur 1975 / India zone III,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,19,914398.5,80,0.99878641
+24382,Kalianpur 1880 / India zone IIb,Lambert Conic Conformal (1SP),Indian yard,4243,Kalianpur 1880,Everest (1830 Definition),3000000,26,1000000,90,0.99878641
+24383,Kalianpur 1975 / India zone IV,Lambert Conic Conformal (1SP),metre,4146,Kalianpur 1975,Everest 1830 (1975 Definition),2743195.5,12,914398.5,80,0.99878641
+24500,Kertau 1968 / Singapore Grid,Cassini-Soldner,metre,4245,Kertau 1968,Everest 1830 Modified,30000,1.1715528,30000,103.5110808,
+24547,Kertau 1968 / UTM zone 47N,Transverse Mercator,metre,4245,Kertau 1968,Everest 1830 Modified,500000,0,0,99,0.9996
+24548,Kertau 1968 / UTM zone 48N,Transverse Mercator,metre,4245,Kertau 1968,Everest 1830 Modified,500000,0,0,105,0.9996
+24600,KOC Lambert,Lambert Conic Conformal (1SP),metre,4246,Kuwait Oil Company,Clarke 1880 (RGS),1500000,32.3,1166200,45,0.998786408
+24718,La Canoa / UTM zone 18N,Transverse Mercator,metre,4247,La Canoa,International 1924,500000,0,0,-75,0.9996
+24719,La Canoa / UTM zone 19N,Transverse Mercator,metre,4247,La Canoa,International 1924,500000,0,0,-69,0.9996
+24720,La Canoa / UTM zone 20N,Transverse Mercator,metre,4247,La Canoa,International 1924,500000,0,0,-63,0.9996
+24817,PSAD56 / UTM zone 17N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-81,0.9996
+24818,PSAD56 / UTM zone 18N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-75,0.9996
+24819,PSAD56 / UTM zone 19N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-69,0.9996
+24820,PSAD56 / UTM zone 20N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-63,0.9996
+24821,PSAD56 / UTM zone 21N,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,0,-57,0.9996
+24877,PSAD56 / UTM zone 17S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-81,0.9996
+24878,PSAD56 / UTM zone 18S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-75,0.9996
+24879,PSAD56 / UTM zone 19S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-69,0.9996
+24880,PSAD56 / UTM zone 20S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-63,0.9996
+24881,PSAD56 / UTM zone 21S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-57,0.9996
+24882,PSAD56 / UTM zone 22S,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,500000,0,10000000,-51,0.9996
+24891,PSAD56 / Peru west zone,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,222000,-6,1426834.743,-80.3,0.99983008
+24892,PSAD56 / Peru central zone,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,720000,-9.3,1039979.159,-76,0.99932994
+24893,PSAD56 / Peru east zone,Transverse Mercator,metre,4248,Provisional South American Datum 1956,International 1924,1324000,-9.3,1040084.558,-70.3,0.99952992
+25000,Leigon / Ghana Metre Grid,Transverse Mercator,metre,4250,Leigon,Clarke 1880 (RGS),274319.51,4.4,0,-1,0.99975
+25231,Lome / UTM zone 31N,Transverse Mercator,metre,4252,Lome,Clarke 1880 (IGN),500000,0,0,3,0.9996
+25391,Luzon 1911 / Philippines zone I,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,117,0.99995
+25392,Luzon 1911 / Philippines zone II,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,119,0.99995
+25393,Luzon 1911 / Philippines zone III,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,121,0.99995
+25394,Luzon 1911 / Philippines zone IV,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,123,0.99995
+25395,Luzon 1911 / Philippines zone V,Transverse Mercator,metre,4253,Luzon 1911,Clarke 1866,500000,0,0,125,0.99995
+25828,ETRS89 / UTM zone 28N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-15,0.9996
+25829,ETRS89 / UTM zone 29N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-9,0.9996
+25830,ETRS89 / UTM zone 30N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,-3,0.9996
+25831,ETRS89 / UTM zone 31N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,3,0.9996
+25832,ETRS89 / UTM zone 32N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,9,0.9996
+25833,ETRS89 / UTM zone 33N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,15,0.9996
+25834,ETRS89 / UTM zone 34N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,21,0.9996
+25835,ETRS89 / UTM zone 35N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,27,0.9996
+25836,ETRS89 / UTM zone 36N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,33,0.9996
+25837,ETRS89 / UTM zone 37N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,39,0.9996
+25838,ETRS89 / UTM zone 38N,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,45,0.9996
+25884,ETRS89 / TM Baltic93,Transverse Mercator,metre,4258,European Terrestrial Reference System 1989,GRS 1980,500000,0,0,24,0.9996
+25932,Malongo 1987 / UTM zone 32S,Transverse Mercator,metre,4259,Malongo 1987,International 1924,500000,0,10000000,9,0.9996
+26191,Merchich / Nord Maroc,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),500000,37,300000,-6,0.999625769
+26192,Merchich / Sud Maroc,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),500000,33,300000,-6,0.999615596
+26194,Merchich / Sahara Nord,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),1200000,29,400000,-6,0.999616304
+26195,Merchich / Sahara Sud,Lambert Conic Conformal (1SP),metre,4261,Merchich,Clarke 1880 (IGN),1500000,25,400000,-6,0.999616437
+26237,Massawa / UTM zone 37N,Transverse Mercator,metre,4262,Massawa,Bessel 1841,500000,0,0,39,0.9996
+26331,Minna / UTM zone 31N,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),500000,0,0,3,0.9996
+26332,Minna / UTM zone 32N,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),500000,0,0,9,0.9996
+26391,Minna / Nigeria West Belt,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),230738.26,4,0,4.3,0.99975
+26392,Minna / Nigeria Mid Belt,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),670553.98,4,0,8.3,0.99975
+26393,Minna / Nigeria East Belt,Transverse Mercator,metre,4263,Minna,Clarke 1880 (RGS),1110369.7,4,0,12.3,0.99975
+26632,M'poraloko / UTM zone 32N,Transverse Mercator,metre,4266,M'poraloko,Clarke 1880 (IGN),500000,0,0,9,0.9996
+26692,M'poraloko / UTM zone 32S,Transverse Mercator,metre,4266,M'poraloko,Clarke 1880 (IGN),500000,0,10000000,9,0.9996
+26701,NAD27 / UTM zone 1N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-177,0.9996
+26702,NAD27 / UTM zone 2N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-171,0.9996
+26703,NAD27 / UTM zone 3N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-165,0.9996
+26704,NAD27 / UTM zone 4N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-159,0.9996
+26705,NAD27 / UTM zone 5N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-153,0.9996
+26706,NAD27 / UTM zone 6N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-147,0.9996
+26707,NAD27 / UTM zone 7N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-141,0.9996
+26708,NAD27 / UTM zone 8N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-135,0.9996
+26709,NAD27 / UTM zone 9N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-129,0.9996
+26710,NAD27 / UTM zone 10N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-123,0.9996
+26711,NAD27 / UTM zone 11N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-117,0.9996
+26712,NAD27 / UTM zone 12N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-111,0.9996,,,,,,,
+26713,NAD27 / UTM zone 13N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-105,0.9996,,,,,,,
+26714,NAD27 / UTM zone 14N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-99,0.9996,,,,,,,
+26715,NAD27 / UTM zone 15N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-93,0.9996,0,0,0,0,0,0,
+26716,NAD27 / UTM zone 16N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-87,0.9996,0,0,0,0,0,0,
+26717,NAD27 / UTM zone 17N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-81,0.9996,0,0,0,0,0,0,
+26718,NAD27 / UTM zone 18N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-75,0.9996,0,0,0,0,0,0,
+26719,NAD27 / UTM zone 19N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-69,0.9996,0,0,0,0,0,0,
+26720,NAD27 / UTM zone 20N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-63,0.9996,0,0,0,0,0,0,
+26721,NAD27 / UTM zone 21N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-57,0.9996,0,0,0,0,0,0,
+26722,NAD27 / UTM zone 22N,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,500000,0,0,-51,0.9996,0,0,0,0,0,0,
+26729,NAD27 / Alabama East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30.3,0,-85.5,0.99996,0,0,0,0,0,0,
+26730,NAD27 / Alabama West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30,0,-87.3,0.999933333,0,0,0,0,0,0,
+26731,NAD27 / Alaska zone 1,Hotine Oblique Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,16404166.67,0,-16404166.67,0,0,323.0748369,57,0,323.0748369,0.9999,0,-133.4
+26732,NAD27 / Alaska zone 2,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-142,0.9999,0,0,0,0,0,0,
+26733,NAD27 / Alaska zone 3,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-146,0.9999,0,0,0,0,0,0,
+26734,NAD27 / Alaska zone 4,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-150,0.9999,0,0,0,0,0,0,,,,,,,,,,
+26735,NAD27 / Alaska zone 5,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-154,0.9999,0,0,0,0,0,0,,,,,,,,,,
+26736,NAD27 / Alaska zone 6,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-158,0.9999,0,0,0,0,0,0,,,,,,,,,,
+26737,NAD27 / Alaska zone 7,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,700000,54,0,-162,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26738,NAD27 / Alaska zone 8,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,54,0,-166,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26739,NAD27 / Alaska zone 9,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,600000,54,0,-170,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26740,NAD27 / Alaska zone 10,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.5,51,-176,53.5,0,3000000
+26741,NAD27 / California zone I,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,0,2000000
+26742,NAD27 / California zone II,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,0,2000000
+26743,NAD27 / California zone III,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,0,2000000
+26744,NAD27 / California zone IV,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,0,2000000
+26745,NAD27 / California zone V,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,0,2000000
+26746,NAD27 / California zone VI,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,0,2000000
+26748,NAD27 / Arizona East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26749,NAD27 / Arizona Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26750,NAD27 / Arizona West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26751,NAD27 / Arkansas North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,2000000
+26752,NAD27 / Arkansas South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,0,2000000
+26753,NAD27 / Colorado North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.47,39.2,-105.3,39.43,0,2000000
+26754,NAD27 / Colorado Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,0,2000000
+26755,NAD27 / Colorado South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,0,2000000
+26756,NAD27 / Connecticut,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,0,600000
+26757,NAD27 / Delaware,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26758,NAD27 / Florida East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26759,NAD27 / Florida West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26760,NAD27 / Florida North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,2000000
+26766,NAD27 / Georgia East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26767,NAD27 / Georgia West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26768,NAD27 / Idaho East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26769,NAD27 / Idaho Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26770,NAD27 / Idaho West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26771,NAD27 / Illinois East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26772,NAD27 / Illinois West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26773,NAD27 / Indiana East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,37.3,0,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26774,NAD27 / Indiana West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,37.3,0,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26775,NAD27 / Iowa North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,0,2000000
+26776,NAD27 / Iowa South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,2000000
+26777,NAD27 / Kansas North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,2000000
+26778,NAD27 / Kansas South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,0,2000000
+26779,NAD27 / Kentucky North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.58,37.3,-84.15,37.58,0,2000000
+26780,NAD27 / Kentucky South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.56,36.2,-85.45,36.44,0,2000000
+26781,NAD27 / Louisiana North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.4,30.4,-92.3,31.1,0,2000000
+26782,NAD27 / Louisiana South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.42,28.4,-91.2,29.18,0,2000000
+26783,NAD27 / Maine East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,43.5,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26784,NAD27 / Maine West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26785,NAD27 / Maryland,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.27,37.5,-77,38.18,0,800000
+26786,NAD27 / Massachusetts Mainland,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.41,41,-71.3,41.43,0,600000
+26787,NAD27 / Massachusetts Island,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.29,41,-70.3,41.17,0,200000
+26791,NAD27 / Minnesota North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.38,46.3,-93.06,47.02,0,2000000
+26792,NAD27 / Minnesota Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.03,45,-94.15,45.37,0,2000000
+26793,NAD27 / Minnesota South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.13,43,-94,43.47,0,2000000
+26794,NAD27 / Mississippi East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,29.4,0,-88.5,0.99996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26795,NAD27 / Mississippi West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,30.3,0,-90.2,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26796,NAD27 / Missouri East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26797,NAD27 / Missouri Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26798,NAD27 / Missouri West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26799,NAD27 / California zone VII,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.52,34.08,-118.2,34.25,4160926.74,4186692.58
+26801,NAD Michigan / Michigan East,Transverse Mercator,US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,500000,41.3,0,-83.4,0.999942857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26802,NAD Michigan / Michigan Old Central,Transverse Mercator,US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,500000,41.3,0,-85.45,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26803,NAD Michigan / Michigan West,Transverse Mercator,US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,500000,41.3,0,-88.45,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26811,NAD Michigan / Michigan North,Lambert Conic Conformal (2SP),US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.05,44.47,-87,45.29,0,2000000
+26812,NAD Michigan / Michigan Central,Lambert Conic Conformal (2SP),US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.42,43.19,-84.2,44.11,0,2000000
+26813,NAD Michigan / Michigan South,Lambert Conic Conformal (2SP),US survey foot,4268,NAD Michigan,Clarke 1866 Michigan,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.4,41.3,-84.2,42.06,0,2000000
+26847,NAD83 / Maine East (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,984250,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26848,NAD83 / Maine West (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,2952750,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26849,NAD83 / Minnesota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,328083.3333,2624666.667
+26850,NAD83 / Minnesota Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,328083.3333,2624666.667
+26851,NAD83 / Minnesota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,328083.3333,2624666.667
+26852,NAD83 / Nebraska (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,1640416.667
+26853,NAD83 / West Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,1968500
+26854,NAD83 / West Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,1968500
+26855,NAD83(HARN) / Maine East (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,984250,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26856,NAD83(HARN) / Maine West (ftUS),Transverse Mercator,US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,2952750,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26857,NAD83(HARN) / Minnesota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,328083.3333,2624666.667
+26858,NAD83(HARN) / Minnesota Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,328083.3333,2624666.667
+26859,NAD83(HARN) / Minnesota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,328083.3333,2624666.667
+26860,NAD83(HARN) / Nebraska (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,1640416.667
+26861,NAD83(HARN) / West Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,1968500
+26862,NAD83(HARN) / West Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4152,NAD83 (High Accuracy Regional Network),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,1968500
+26863,NAD83(NSRS2007) / Maine East (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,984250,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26864,NAD83(NSRS2007) / Maine West (ftUS),Transverse Mercator,US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,2952750,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26865,NAD83(NSRS2007) / Minnesota North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,328083.3333,2624666.667
+26866,NAD83(NSRS2007) / Minnesota Central (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,328083.3333,2624666.667
+26867,NAD83(NSRS2007) / Minnesota South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,328083.3333,2624666.667
+26868,NAD83(NSRS2007) / Nebraska (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,1640416.667
+26869,NAD83(NSRS2007) / West Virginia North (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,1968500
+26870,NAD83(NSRS2007) / West Virginia South (ftUS),Lambert Conic Conformal (2SP),US survey foot,4269,NAD83 (National Spatial Reference System 2007),GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,1968500
+26891,NAD83(CSRS) / MTM zone 11,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-82.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26892,NAD83(CSRS) / MTM zone 12,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-81,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26893,NAD83(CSRS) / MTM zone 13,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-84,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26894,NAD83(CSRS) / MTM zone 14,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-87,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26895,NAD83(CSRS) / MTM zone 15,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-90,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26896,NAD83(CSRS) / MTM zone 16,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-93,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26897,NAD83(CSRS) / MTM zone 17,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-96,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26898,NAD83(CSRS) / MTM zone 1,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-53,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26899,NAD83(CSRS) / MTM zone 2,Transverse Mercator,metre,4617,NAD83 Canadian Spatial Reference System,GRS 1980,304800,0,0,-56,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26901,NAD83 / UTM zone 1N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26902,NAD83 / UTM zone 2N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26903,NAD83 / UTM zone 3N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26904,NAD83 / UTM zone 4N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-159,0.9996,,,,,,,,,,,,,,,
+26905,NAD83 / UTM zone 5N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-153,0.9996,,,,,,,,,,,,,,,
+26906,NAD83 / UTM zone 6N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-147,0.9996,,,,,,,,,,,,,,,
+26907,NAD83 / UTM zone 7N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-141,0.9996,,,,,,,,,,,,,,,
+26908,NAD83 / UTM zone 8N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-135,0.9996,,,,,,,,,,,,,,,
+26909,NAD83 / UTM zone 9N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-129,0.9996,,,,,,,,,,,,,,,
+26910,NAD83 / UTM zone 10N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-123,0.9996,,,,,,,,,,,,,,,
+26911,NAD83 / UTM zone 11N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-117,0.9996,,,,,,,,,,,,,,,
+26912,NAD83 / UTM zone 12N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-111,0.9996,,,,,,,,,,,,,,,
+26913,NAD83 / UTM zone 13N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-105,0.9996,,,,,,,,,,,,,,,
+26914,NAD83 / UTM zone 14N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-99,0.9996,,,,,,,,,,,,,,,
+26915,NAD83 / UTM zone 15N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-93,0.9996,,,,,,,,,,,,,,,
+26916,NAD83 / UTM zone 16N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,
+26917,NAD83 / UTM zone 17N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-81,0.9996,,,,,,,,,,,,,,,
+26918,NAD83 / UTM zone 18N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-75,0.9996,,,,,,,,,,,,,,,
+26919,NAD83 / UTM zone 19N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-69,0.9996,,,,,,,,,,,,,,,
+26920,NAD83 / UTM zone 20N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26921,NAD83 / UTM zone 21N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26922,NAD83 / UTM zone 22N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26923,NAD83 / UTM zone 23N,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,0,0,-45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26929,NAD83 / Alabama East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,30.3,0,-85.5,0.99996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26930,NAD83 / Alabama West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,600000,30,0,-87.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26931,NAD83 / Alaska zone 1,Hotine Oblique Mercator,metre,4269,North American Datum 1983,GRS 1980,5000000,0,-5000000,0,0,323.0748369,57,0,323.0748369,0.9999,0,-133.4,0,0,0,0,0,0,0,0
+26932,NAD83 / Alaska zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-142,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26933,NAD83 / Alaska zone 3,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-146,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26934,NAD83 / Alaska zone 4,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-150,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26935,NAD83 / Alaska zone 5,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-154,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26936,NAD83 / Alaska zone 6,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-158,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26937,NAD83 / Alaska zone 7,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-162,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+26938,NAD83 / Alaska zone 8,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-166,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26939,NAD83 / Alaska zone 9,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,54,0,-170,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26940,NAD83 / Alaska zone 10,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.5,51,-176,53.5,0,1000000
+26941,NAD83 / California zone 1,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.2,-122,41.4,500000,2000000
+26942,NAD83 / California zone 2,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.2,37.4,-122,39.5,500000,2000000
+26943,NAD83 / California zone 3,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.04,36.3,-120.3,38.26,500000,2000000
+26944,NAD83 / California zone 4,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,35.2,-119,37.15,500000,2000000
+26945,NAD83 / California zone 5,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.02,33.3,-118,35.28,500000,2000000
+26946,NAD83 / California zone 6,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.47,32.1,-116.15,33.53,500000,2000000
+26948,NAD83 / Arizona East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,213360,31,0,-110.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26949,NAD83 / Arizona Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,213360,31,0,-111.55,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26950,NAD83 / Arizona West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,213360,31,0,-113.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26951,NAD83 / Arkansas North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.56,34.2,-92,36.14,0,400000
+26952,NAD83 / Arkansas South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.18,32.4,-92,34.46,400000,400000
+26953,NAD83 / Colorado North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.43,39.2,-105.3,40.47,304800.6096,914401.8289
+26954,NAD83 / Colorado Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.27,37.5,-105.3,39.45,304800.6096,914401.8289
+26955,NAD83 / Colorado South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.14,36.4,-105.3,38.26,304800.6096,914401.8289
+26956,NAD83 / Connecticut,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.12,40.5,-72.45,41.52,152400.3048,304800.6096
+26957,NAD83 / Delaware,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,38,0,-75.25,0.999995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26958,NAD83 / Florida East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,24.2,0,-81,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26959,NAD83 / Florida West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,24.2,0,-82,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26960,NAD83 / Florida North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.35,29,-84.3,30.45,0,600000
+26961,NAD83 / Hawaii zone 1,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,18.5,0,-155.3,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26962,NAD83 / Hawaii zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,20.2,0,-156.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26963,NAD83 / Hawaii zone 3,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,21.1,0,-158,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26964,NAD83 / Hawaii zone 4,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,21.5,0,-159.3,0.99999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26965,NAD83 / Hawaii zone 5,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,21.4,0,-160.1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26966,NAD83 / Georgia East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,30,0,-82.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26967,NAD83 / Georgia West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,30,0,-84.1,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26968,NAD83 / Idaho East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,41.4,0,-112.1,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26969,NAD83 / Idaho Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,41.4,0,-114,0.999947368,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26970,NAD83 / Idaho West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,800000,41.4,0,-115.45,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26971,NAD83 / Illinois East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,36.4,0,-88.2,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26972,NAD83 / Illinois West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,36.4,0,-90.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26973,NAD83 / Indiana East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,100000,37.3,250000,-85.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26974,NAD83 / Indiana West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,900000,37.3,250000,-87.05,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26975,NAD83 / Iowa North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.04,41.3,-93.3,43.16,1000000,1500000
+26976,NAD83 / Iowa South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.37,40,-93.3,41.47,0,500000
+26977,NAD83 / Kansas North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.43,38.2,-98,39.47,0,400000
+26978,NAD83 / Kansas South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.16,36.4,-98.3,38.34,400000,400000
+26980,NAD83 / Kentucky South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.44,36.2,-85.45,37.56,500000,500000
+26981,NAD83 / Louisiana North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.1,30.3,-92.3,32.4,0,1000000
+26982,NAD83 / Louisiana South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29.18,28.3,-91.2,30.42,0,1000000
+26983,NAD83 / Maine East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,43.4,0,-68.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26984,NAD83 / Maine West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,900000,42.5,0,-70.1,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26985,NAD83 / Maryland,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.18,37.4,-77,39.27,0,400000
+26986,NAD83 / Massachusetts Mainland,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,41,-71.3,42.41,750000,200000
+26987,NAD83 / Massachusetts Island,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.17,41,-70.3,41.29,0,500000
+26988,NAD83 / Michigan North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.29,44.47,-87,47.05,0,8000000
+26989,NAD83 / Michigan Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.11,43.19,-84.22,45.42,0,6000000
+26990,NAD83 / Michigan South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.06,41.3,-84.22,43.4,0,4000000
+26991,NAD83 / Minnesota North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.02,46.3,-93.06,48.38,100000,800000
+26992,NAD83 / Minnesota Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.37,45,-94.15,47.03,100000,800000
+26993,NAD83 / Minnesota South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43.47,43,-94,45.13,100000,800000
+26994,NAD83 / Mississippi East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,29.3,0,-88.5,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26995,NAD83 / Mississippi West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,700000,29.3,0,-90.2,0.99995,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26996,NAD83 / Missouri East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,250000,35.5,0,-90.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26997,NAD83 / Missouri Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,35.5,0,-92.3,0.999933333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+26998,NAD83 / Missouri West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,850000,36.1,0,-94.3,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+27037,Nahrwan 1967 / UTM zone 37N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,39,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+27038,Nahrwan 1967 / UTM zone 38N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+27039,Nahrwan 1967 / UTM zone 39N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+27040,Nahrwan 1967 / UTM zone 40N,Transverse Mercator,metre,4270,Nahrwan 1967,Clarke 1880 (RGS),500000,0,0,57,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+27120,Naparima 1972 / UTM zone 20N,Transverse Mercator,metre,4271,Naparima 1972,International 1924,500000,0,0,-63,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+27200,NZGD49 / New Zealand Map Grid,New Zealand Map Grid,metre,4272,New Zealand Geodetic Datum 1949,International 1924,2510000,-41,6023150,173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+27205,NZGD49 / Mount Eden Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-36.5247515,700000,174.4551622,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+27206,NZGD49 / Bay of Plenty Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-37.45404993,700000,176.275831,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+27207,NZGD49 / Poverty Bay Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-38.372893,700000,177.5308291,1,,,,,,,,,,,,,,,
+27208,NZGD49 / Hawkes Bay Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39.39033455,700000,176.402525,1,,,,,,,,,,,,,,,
+27209,NZGD49 / Taranaki Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39.08087299,700000,174.1340842,1,,,,,,,,,,,,,,,
+27210,NZGD49 / Tuhirangi Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39.30448934,700000,175.3824133,1,,,,,,,,,,,,,,,
+27211,NZGD49 / Wanganui Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-40.14310097,700000,175.2917159,1,,,,,,,,,,,,,,,
+27212,NZGD49 / Wairarapa Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-40.55319175,700000,175.3850459,1,,,,,,,,,,,,,,,
+27213,NZGD49 / Wellington Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.18047507,700000,174.4635843,1,,,,,,,,,,,,,,,
+27214,NZGD49 / Collingwood Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-40.42531326,700000,172.4019367,1,,,,,,,,,,,,,,,
+27215,NZGD49 / Nelson Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.1628361,700000,173.1757541,1,,,,,,,,,,,,,,,
+27216,NZGD49 / Karamea Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.17236815,700000,172.0632502,1,,,,,,,,,,,,,,,
+27217,NZGD49 / Buller Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.48388903,700000,171.3452536,1,,,,,,,,,,,,,,,
+27218,NZGD49 / Grey Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-42.20012994,700000,171.3259177,1,,,,,,,,,,,,,,,
+27219,NZGD49 / Amuri Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-42.41208197,700000,173.003648,1,,,,,,,,,,,,,,,
+27220,NZGD49 / Marlborough Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-41.3240152,700000,173.4807467,1
+27221,NZGD49 / Hokitika Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-42.53107605,700000,170.5847977,1
+27222,NZGD49 / Okarito Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.06364613,700000,170.1539333,1
+27223,NZGD49 / Jacksons Bay Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.58400904,700000,168.3622561,1
+27224,NZGD49 / Mount Pleasant Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.35262953,700000,172.4337897,1
+27225,NZGD49 / Gawler Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-43.44553616,700000,171.2138695,1
+27226,NZGD49 / Timaru Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-44.24079933,700000,171.0326103,1
+27227,NZGD49 / Lindis Peak Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-44.44069647,700000,169.2803918,1
+27228,NZGD49 / Mount Nicholas Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.07584493,700000,168.2355108,1
+27229,NZGD49 / Mount York Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.33494142,700000,167.4419902,1
+27230,NZGD49 / Observation Point Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.48583078,700000,170.3742943,1
+27231,NZGD49 / North Taieri Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300000,-45.51414481,700000,170.1657321,0.99996
+27232,NZGD49 / Bluff Circuit,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,300002.66,-46.36000346,699999.58,168.2034339,1
+27258,NZGD49 / UTM zone 58S,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,500000,0,10000000,165,0.9996
+27259,NZGD49 / UTM zone 59S,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,500000,0,10000000,171,0.9996
+27260,NZGD49 / UTM zone 60S,Transverse Mercator,metre,4272,New Zealand Geodetic Datum 1949,International 1924,500000,0,10000000,177,0.9996
+27291,NZGD49 / North Island Grid,Transverse Mercator,British yard (Sears 1922),4272,New Zealand Geodetic Datum 1949,International 1924,300000,-39,400000,175.3,1
+27292,NZGD49 / South Island Grid,Transverse Mercator,British yard (Sears 1922),4272,New Zealand Geodetic Datum 1949,International 1924,500000,-44,500000,171.3,1
+27391,NGO 1948 (Oslo) / NGO zone I,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,-4.4,1
+27392,NGO 1948 (Oslo) / NGO zone II,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,-2.2,1
+27393,NGO 1948 (Oslo) / NGO zone III,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,0,1
+27394,NGO 1948 (Oslo) / NGO zone IV,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,2.3,1
+27395,NGO 1948 (Oslo) / NGO zone V,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,6.1,1
+27396,NGO 1948 (Oslo) / NGO zone VI,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,10.1,1
+27397,NGO 1948 (Oslo) / NGO zone VII,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,14.1,1
+27398,NGO 1948 (Oslo) / NGO zone VIII,Transverse Mercator,metre,4273,NGO 1948 (Oslo),Bessel Modified,0,58,0,18.2,1
+27429,Datum 73 / UTM zone 29N,Transverse Mercator,metre,4274,Datum 73,International 1924,500000,0,0,-9,0.9996
+27493,Datum 73 / Modified Portuguese Grid,Transverse Mercator,metre,4274,Datum 73,International 1924,180.598,39.4,-86.99,-8.0754862,1
+27500,ATF (Paris) / Nord de Guerre,Lambert Conic Conformal (1SP),metre,4901,Ancienne Triangulation Francaise (Paris),Plessis 1817,500000,55,300000,6,0.99950908
+27561,NTF (Paris) / Lambert Nord France,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,55,200000,0,0.999877341
+27562,NTF (Paris) / Lambert Centre France,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,52,200000,0,0.99987742
+27563,NTF (Paris) / Lambert Sud France,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,49,200000,0,0.999877499
+27564,NTF (Paris) / Lambert Corse,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),234.358,46.85,185861.369,0,0.99994471
+27571,NTF (Paris) / Lambert zone I,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,55,1200000,0,0.999877341
+27572,NTF (Paris) / Lambert zone II,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,52,2200000,0,0.99987742
+27573,NTF (Paris) / Lambert zone III,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),600000,49,3200000,0,0.999877499
+27574,NTF (Paris) / Lambert zone IV,Lambert Conic Conformal (1SP),metre,4807,Nouvelle Triangulation Francaise (Paris),Clarke 1880 (IGN),234.358,46.85,4185861.369,0,0.99994471
+27700,OSGB 1936 / British National Grid,Transverse Mercator,metre,4277,OSGB 1936,Airy 1830,400000,49,-100000,-2,0.999601272
+28191,Palestine 1923 / Palestine Grid,Cassini-Soldner,metre,4281,Palestine 1923,Clarke 1880 (Benoit),170251.555,31.4402749,126867.909,35.124349,
+28192,Palestine 1923 / Palestine Belt,Transverse Mercator,metre,4281,Palestine 1923,Clarke 1880 (Benoit),170251.555,31.4402749,1126867.909,35.124349,1
+28193,Palestine 1923 / Israeli CS Grid,Cassini-Soldner,metre,4281,Palestine 1923,Clarke 1880 (Benoit),170251.555,31.4402749,1126867.909,35.124349,
+28232,Pointe Noire / UTM zone 32S,Transverse Mercator,metre,4282,Congo 1960 Pointe Noire,Clarke 1880 (IGN),500000,0,10000000,9,0.9996
+28348,GDA94 / MGA zone 48,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,105,0.9996
+28349,GDA94 / MGA zone 49,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,111,0.9996
+28350,GDA94 / MGA zone 50,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,117,0.9996
+28351,GDA94 / MGA zone 51,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,123,0.9996
+28352,GDA94 / MGA zone 52,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,129,0.9996
+28353,GDA94 / MGA zone 53,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,135,0.9996
+28354,GDA94 / MGA zone 54,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,141,0.9996
+28355,GDA94 / MGA zone 55,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,147,0.9996
+28356,GDA94 / MGA zone 56,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,153,0.9996
+28357,GDA94 / MGA zone 57,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,159,0.9996
+28358,GDA94 / MGA zone 58,Transverse Mercator,metre,4283,Geocentric Datum of Australia 1994,GRS 1980,500000,0,10000000,165,0.9996
+28404,Pulkovo 1942 / Gauss-Kruger zone 4,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,4500000,0,0,21,1
+28405,Pulkovo 1942 / Gauss-Kruger zone 5,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,5500000,0,0,27,1
+28406,Pulkovo 1942 / Gauss-Kruger zone 6,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,6500000,0,0,33,1
+28407,Pulkovo 1942 / Gauss-Kruger zone 7,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,7500000,0,0,39,1
+28408,Pulkovo 1942 / Gauss-Kruger zone 8,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,8500000,0,0,45,1
+28409,Pulkovo 1942 / Gauss-Kruger zone 9,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,9500000,0,0,51,1
+28410,Pulkovo 1942 / Gauss-Kruger zone 10,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,10500000,0,0,57,1
+28411,Pulkovo 1942 / Gauss-Kruger zone 11,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,11500000,0,0,63,1
+28412,Pulkovo 1942 / Gauss-Kruger zone 12,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,12500000,0,0,69,1
+28413,Pulkovo 1942 / Gauss-Kruger zone 13,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,13500000,0,0,75,1
+28414,Pulkovo 1942 / Gauss-Kruger zone 14,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,14500000,0,0,81,1
+28415,Pulkovo 1942 / Gauss-Kruger zone 15,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,15500000,0,0,87,1
+28416,Pulkovo 1942 / Gauss-Kruger zone 16,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,16500000,0,0,93,1
+28417,Pulkovo 1942 / Gauss-Kruger zone 17,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,17500000,0,0,99,1
+28418,Pulkovo 1942 / Gauss-Kruger zone 18,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,18500000,0,0,105,1
+28419,Pulkovo 1942 / Gauss-Kruger zone 19,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,19500000,0,0,111,1
+28420,Pulkovo 1942 / Gauss-Kruger zone 20,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,20500000,0,0,117,1
+28421,Pulkovo 1942 / Gauss-Kruger zone 21,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,21500000,0,0,123,1
+28422,Pulkovo 1942 / Gauss-Kruger zone 22,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,22500000,0,0,129,1
+28423,Pulkovo 1942 / Gauss-Kruger zone 23,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,23500000,0,0,135,1
+28424,Pulkovo 1942 / Gauss-Kruger zone 24,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,24500000,0,0,141,1
+28425,Pulkovo 1942 / Gauss-Kruger zone 25,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,25500000,0,0,147,1
+28426,Pulkovo 1942 / Gauss-Kruger zone 26,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,26500000,0,0,153,1
+28427,Pulkovo 1942 / Gauss-Kruger zone 27,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,27500000,0,0,159,1
+28428,Pulkovo 1942 / Gauss-Kruger zone 28,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,28500000,0,0,165,1
+28429,Pulkovo 1942 / Gauss-Kruger zone 29,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,29500000,0,0,171,1
+28430,Pulkovo 1942 / Gauss-Kruger zone 30,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,30500000,0,0,177,1
+28431,Pulkovo 1942 / Gauss-Kruger zone 31,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,31500000,0,0,-177,1
+28432,Pulkovo 1942 / Gauss-Kruger zone 32,Transverse Mercator,metre,4284,Pulkovo 1942,Krassowsky 1940,32500000,0,0,-171,1
+28600,Qatar 1974 / Qatar National Grid,Transverse Mercator,metre,4285,Qatar 1974,International 1924,200000,24.27,300000,51.13,0.99999
+28991,Amersfoort / RD Old,Oblique Stereographic,metre,4289,Amersfoort,Bessel 1841,0,52.0922178,0,5.23155,0.9999079
+28992,Amersfoort / RD New,Oblique Stereographic,metre,4289,Amersfoort,Bessel 1841,155000,52.0922178,463000,5.23155,0.9999079
+29101,SAD69 / Brazil Polyconic,American Polyconic,metre,4291,South American Datum 1969,GRS 1967 Modified,5000000,0,10000000,-54,
+29168,SAD69 / UTM zone 18N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-75,0.9996
+29169,SAD69 / UTM zone 19N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-69,0.9996
+29170,SAD69 / UTM zone 20N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-63,0.9996
+29171,SAD69 / UTM zone 21N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-57,0.9996
+29172,SAD69 / UTM zone 22N,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,0,-51,0.9996
+29187,SAD69 / UTM zone 17S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-81,0.9996
+29188,SAD69 / UTM zone 18S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-75,0.9996
+29189,SAD69 / UTM zone 19S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-69,0.9996
+29190,SAD69 / UTM zone 20S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-63,0.9996
+29191,SAD69 / UTM zone 21S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-57,0.9996
+29192,SAD69 / UTM zone 22S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-51,0.9996,,,,,,,
+29193,SAD69 / UTM zone 23S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-45,0.9996,,,,,,,
+29194,SAD69 / UTM zone 24S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-39,0.9996,,,,,,,
+29195,SAD69 / UTM zone 25S,Transverse Mercator,metre,4291,South American Datum 1969,GRS 1967 Modified,500000,0,10000000,-33,0.9996,0,0,0,0,0,0,
+29220,Sapper Hill 1943 / UTM zone 20S,Transverse Mercator,metre,4292,Sapper Hill 1943,International 1924,500000,0,10000000,-63,0.9996,0,0,0,0,0,0,
+29221,Sapper Hill 1943 / UTM zone 21S,Transverse Mercator,metre,4292,Sapper Hill 1943,International 1924,500000,0,10000000,-57,0.9996,0,0,0,0,0,0,
+29333,Schwarzeck / UTM zone 33S,Transverse Mercator,metre,4293,Schwarzeck,Bessel Namibia (GLM),500000,0,10000000,15,0.9996,0,0,0,0,0,0,
+29371,Schwarzeck / Lo22/11,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,11,1,0,0,0,0,0,0,
+29373,Schwarzeck / Lo22/13,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,13,1,0,0,0,0,0,0,
+29375,Schwarzeck / Lo22/15,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,15,1,0,0,0,0,0,0,
+29377,Schwarzeck / Lo22/17,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,17,1,0,0,0,0,0,0,
+29379,Schwarzeck / Lo22/19,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,19,1,0,0,0,0,0,0,
+29381,Schwarzeck / Lo22/21,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,21,1,0,0,0,0,0,0,
+29383,Schwarzeck / Lo22/23,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,23,1,0,0,0,0,0,0,
+29385,Schwarzeck / Lo22/25,Transverse Mercator (South Orientated),German legal metre,4293,Schwarzeck,Bessel Namibia (GLM),0,-22,0,25,1,0,0,0,0,0,0,
+29701,Tananarive (Paris) / Laborde Grid,Laborde Madagascar,metre,4810,Tananarive 1925 (Paris),International 1924,400000,0,800000,0,0,21,-21,0,0,0.9995,0,49
+29702,Tananarive (Paris) / Laborde Grid approximation,Oblique Mercator,metre,4810,Tananarive 1925 (Paris),International 1924,0,0,0,0,0,21,-21,800000,21,0.9995,400000,49
+29738,Tananarive / UTM zone 38S,Transverse Mercator,metre,4297,Tananarive 1925,International 1924,500000,0,10000000,45,0.9996,0,0,0,0,0,0,
+29739,Tananarive / UTM zone 39S,Transverse Mercator,metre,4297,Tananarive 1925,International 1924,500000,0,10000000,51,0.9996,0,0,0,0,0,0,
+29849,Timbalai 1948 / UTM zone 49N,Transverse Mercator,metre,4298,Timbalai 1948,Everest 1830 (1967 Definition),500000,0,0,111,0.9996,0,0,0,0,0,0,
+29850,Timbalai 1948 / UTM zone 50N,Transverse Mercator,metre,4298,Timbalai 1948,Everest 1830 (1967 Definition),500000,0,0,117,0.9996,0,0,0,0,0,0,
+29871,Timbalai 1948 / RSO Borneo (ch),Oblique Mercator,British chain (Sears 1922),4298,Timbalai 1948,Everest 1830 (1967 Definition),0,0,0,0,0,53.18569537,4,22014.3572,53.07483685,0.99984,29352.4763,115
+29872,Timbalai 1948 / RSO Borneo (ft),Oblique Mercator,British foot (Sears 1922),4298,Timbalai 1948,Everest 1830 (1967 Definition),0,0,0,0,0,53.18569537,4,1452947.58,53.07483685,0.99984,1937263.44,115
+29873,Timbalai 1948 / RSO Borneo (m),Oblique Mercator,metre,4298,Timbalai 1948,Everest 1830 (1967 Definition),0,0,0,0,0,53.18569537,4,442857.65,53.07483685,0.99984,590476.87,115
+29901,OSNI 1952 / Irish National Grid,Transverse Mercator,metre,4188,OSNI 1952,Airy 1830,200000,53.3,250000,-8,1,0,0,0,0,0,0,
+29902,TM65 / Irish Grid,Transverse Mercator,metre,4299,TM65,Airy Modified 1849,200000,53.3,250000,-8,1.000035,0,0,0,0,0,0,
+29903,TM75 / Irish Grid,Transverse Mercator,metre,4300,Geodetic Datum of 1965,Airy Modified 1849,200000,53.3,250000,-8,1.000035,0,0,0,0,0,0,
+30161,Tokyo / Japan Plane Rectangular CS I,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,33,0,129.3,0.9999,0,0,0,0,0,0,
+30162,Tokyo / Japan Plane Rectangular CS II,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,33,0,131,0.9999,0,0,0,0,0,0,
+30163,Tokyo / Japan Plane Rectangular CS III,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,132.1,0.9999,0,0,0,0,0,0,
+30164,Tokyo / Japan Plane Rectangular CS IV,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,33,0,133.3,0.9999,0,0,0,0,0,0,
+30165,Tokyo / Japan Plane Rectangular CS V,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,134.2,0.9999,0,0,0,0,0,0,
+30166,Tokyo / Japan Plane Rectangular CS VI,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,136,0.9999,0,0,0,0,0,0
+30167,Tokyo / Japan Plane Rectangular CS VII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,137.1,0.9999,0,0,0,0,0,0
+30168,Tokyo / Japan Plane Rectangular CS VIII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,138.3,0.9999,0,0,0,0,0,0
+30169,Tokyo / Japan Plane Rectangular CS IX,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,36,0,139.5,0.9999,,,,,,
+30170,Tokyo / Japan Plane Rectangular CS X,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,40,0,140.5,0.9999,,,,,,
+30171,Tokyo / Japan Plane Rectangular CS XI,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,44,0,140.15,0.9999,,,,,,
+30172,Tokyo / Japan Plane Rectangular CS XII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,44,0,142.15,0.9999,,,,,,
+30173,Tokyo / Japan Plane Rectangular CS XIII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,44,0,144.15,0.9999,,,,,,
+30174,Tokyo / Japan Plane Rectangular CS XIV,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,142,0.9999,,,,,,
+30175,Tokyo / Japan Plane Rectangular CS XV,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,127.3,0.9999,,,,,,
+30176,Tokyo / Japan Plane Rectangular CS XVI,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,124,0.9999,,,,,,
+30177,Tokyo / Japan Plane Rectangular CS XVII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,131,0.9999,,,,,,
+30178,Tokyo / Japan Plane Rectangular CS XVIII,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,20,0,136,0.9999,,,,,,
+30179,Tokyo / Japan Plane Rectangular CS XIX,Transverse Mercator,metre,4301,Tokyo,Bessel 1841,0,26,0,154,0.9999,,,,,,
+30200,Trinidad 1903 / Trinidad Grid,Cassini-Soldner,Clarke's link,4302,Trinidad 1903,Clarke 1858,430000,10.263,325000,-61.2,,,,,,,
+30339,TC(1948) / UTM zone 39N,Transverse Mercator,metre,4303,Trucial Coast 1948,Helmert 1906,500000,0,0,51,0.9996,,,,,,
+30340,TC(1948) / UTM zone 40N,Transverse Mercator,metre,4303,Trucial Coast 1948,Helmert 1906,500000,0,0,57,0.9996
+30491,Voirol 1875 / Nord Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4304,Voirol 1875,Clarke 1880 (IGN),500000,40,300000,3,0.999625544
+30492,Voirol 1875 / Sud Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4304,Voirol 1875,Clarke 1880 (IGN),500000,37,300000,3,0.999625769
+30493,Voirol 1879 / Nord Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4671,Voirol 1879,Clarke 1880 (IGN),500000,40,300000,3,0.999625544
+30494,Voirol 1879 / Sud Algerie (ancienne),Lambert Conic Conformal (1SP),metre,4671,Voirol 1879,Clarke 1880 (IGN),500000,37,300000,3,0.999625769
+30729,Nord Sahara 1959 / UTM zone 29N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,-9,0.9996
+30730,Nord Sahara 1959 / UTM zone 30N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,-3,0.9996
+30731,Nord Sahara 1959 / UTM zone 31N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,3,0.9996
+30732,Nord Sahara 1959 / UTM zone 32N,Transverse Mercator,metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500000,0,0,9,0.9996
+30791,Nord Sahara 1959 / Voirol Unifie Nord,Lambert Conic Conformal (1SP),metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500135,40,300090,3,0.999625544
+30792,Nord Sahara 1959 / Voirol Unifie Sud,Lambert Conic Conformal (1SP),metre,4307,Nord Sahara 1959,Clarke 1880 (RGS),500135,37,300090,3,0.999625769
+31028,Yoff / UTM zone 28N,Transverse Mercator,metre,4310,Yoff,Clarke 1880 (IGN),500000,0,0,-15,0.9996
+31121,Zanderij / UTM zone 21N,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-57,0.9996
+31154,Zanderij / TM 54 NW,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-54,0.9996
+31170,Zanderij / Suriname Old TM,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-55.41,0.9996
+31171,Zanderij / Suriname TM,Transverse Mercator,metre,4311,Zanderij,International 1924,500000,0,0,-55.41,0.9999
+31251,MGI (Ferro) / Austria GK West Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,-5000000,28,1,,,,,,,,,,,,,,,,
+31252,MGI (Ferro) / Austria GK Central Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,-5000000,31,1,,,,,,,,,,,,,,,,
+31253,MGI (Ferro) / Austria GK East Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,-5000000,34,1,,,,,,,,,,,,,,,,
+31254,MGI / Austria GK West,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,-5000000,10.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31255,MGI / Austria GK Central,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,-5000000,13.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31256,MGI / Austria GK East,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,-5000000,16.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31257,MGI / Austria GK M28,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,150000,0,-5000000,10.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31258,MGI / Austria GK M31,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,450000,0,-5000000,13.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31259,MGI / Austria GK M34,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,750000,0,-5000000,16.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31281,MGI (Ferro) / Austria West Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,0,28,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31282,MGI (Ferro) / Austria Central Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,0,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31283,MGI (Ferro) / Austria East Zone,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,0,0,0,34,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31284,MGI / Austria M28,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,150000,0,0,10.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31285,MGI / Austria M31,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,450000,0,0,13.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31286,MGI / Austria M34,Transverse Mercator,metre,4312,Militar-Geographische Institut,Bessel 1841,750000,0,0,16.2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31287,MGI / Austria Lambert,Lambert Conic Conformal (2SP),metre,4312,Militar-Geographische Institut,Bessel 1841,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,47.3,13.2,49,400000,400000
+31288,MGI (Ferro) / M28,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,150000,0,0,28,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31289,MGI (Ferro) / M31,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,450000,0,0,31,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31290,MGI (Ferro) / M34,Transverse Mercator,metre,4805,Militar-Geographische Institut (Ferro),Bessel 1841,750000,0,0,34,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31300,Belge 1972 / Belge Lambert 72,Lambert Conic Conformal (2SP Belgium),metre,4313,Reseau National Belge 1972,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51.1,90,4.2124983,49.5,5400088.438,150000.0126
+31370,Belge 1972 / Belgian Lambert 72,Lambert Conic Conformal (2SP),metre,4313,Reseau National Belge 1972,International 1924,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49.5000002,90,4.2202952,51.1000002,5400088.438,150000.013
+31466,DHDN / 3-degree Gauss-Kruger zone 2,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,2500000,0,0,6,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31467,DHDN / 3-degree Gauss-Kruger zone 3,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,3500000,0,0,9,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31468,DHDN / 3-degree Gauss-Kruger zone 4,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,4500000,0,0,12,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31469,DHDN / 3-degree Gauss-Kruger zone 5,Transverse Mercator,metre,4314,Deutsches Hauptdreiecksnetz,Bessel 1841,5500000,0,0,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31528,Conakry 1905 / UTM zone 28N,Transverse Mercator,metre,4315,Conakry 1905,Clarke 1880 (IGN),500000,0,0,-15,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31529,Conakry 1905 / UTM zone 29N,Transverse Mercator,metre,4315,Conakry 1905,Clarke 1880 (IGN),500000,0,0,-9,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31600,Dealul Piscului 1930 / Stereo 33,Oblique Stereographic,metre,4316,Dealul Piscului 1930,International 1924,500000,45.54,500000,25.23328772,0.9996667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31838,NGN / UTM zone 38N,Transverse Mercator,metre,4318,National Geodetic Network,WGS 84,500000,0,0,45,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31839,NGN / UTM zone 39N,Transverse Mercator,metre,4318,National Geodetic Network,WGS 84,500000,0,0,51,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31901,KUDAMS / KTM,Transverse Mercator,metre,4319,Kuwait Utility,GRS 1980,500000,0,0,48,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31965,SIRGAS 2000 / UTM zone 11N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+31966,SIRGAS 2000 / UTM zone 12N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+31967,SIRGAS 2000 / UTM zone 13N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+31968,SIRGAS 2000 / UTM zone 14N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+31969,SIRGAS 2000 / UTM zone 15N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-93,0.9996,,,,,,,,,,,,,,,
+31970,SIRGAS 2000 / UTM zone 16N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,
+31971,SIRGAS 2000 / UTM zone 17N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-81,0.9996,,,,,,,,,,,,,,,
+31972,SIRGAS 2000 / UTM zone 18N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-75,0.9996,,,,,,,,,,,,,,,
+31973,SIRGAS 2000 / UTM zone 19N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-69,0.9996,,,,,,,,,,,,,,,
+31974,SIRGAS 2000 / UTM zone 20N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-63,0.9996,,,,,,,,,,,,,,,
+31975,SIRGAS 2000 / UTM zone 21N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-57,0.9996,,,,,,,,,,,,,,,
+31976,SIRGAS 2000 / UTM zone 22N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,0,-51,0.9996,,,,,,,,,,,,,,,
+31977,SIRGAS 2000 / UTM zone 17S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-81,0.9996,,,,,,,,,,,,,,,
+31978,SIRGAS 2000 / UTM zone 18S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-75,0.9996,,,,,,,,,,,,,,,
+31979,SIRGAS 2000 / UTM zone 19S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-69,0.9996,,,,,,,,,,,,,,,
+31980,SIRGAS 2000 / UTM zone 20S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-63,0.9996,,,,,,,,,,,,,,,
+31981,SIRGAS 2000 / UTM zone 21S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-57,0.9996,,,,,,,,,,,,,,,
+31982,SIRGAS 2000 / UTM zone 22S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-51,0.9996
+31983,SIRGAS 2000 / UTM zone 23S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-45,0.9996
+31984,SIRGAS 2000 / UTM zone 24S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-39,0.9996
+31985,SIRGAS 2000 / UTM zone 25S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 2000,GRS 1980,500000,0,10000000,-33,0.9996
+31986,SIRGAS 1995 / UTM zone 17N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-81,0.9996
+31987,SIRGAS 1995 / UTM zone 18N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-75,0.9996
+31988,SIRGAS 1995 / UTM zone 19N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-69,0.9996
+31989,SIRGAS 1995 / UTM zone 20N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-63,0.9996
+31990,SIRGAS 1995 / UTM zone 21N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-57,0.9996
+31991,SIRGAS 1995 / UTM zone 22N,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,0,-51,0.9996
+31992,SIRGAS 1995 / UTM zone 17S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-81,0.9996
+31993,SIRGAS 1995 / UTM zone 18S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-75,0.9996
+31994,SIRGAS 1995 / UTM zone 19S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-69,0.9996
+31995,SIRGAS 1995 / UTM zone 20S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-63,0.9996
+31996,SIRGAS 1995 / UTM zone 21S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-57,0.9996
+31997,SIRGAS 1995 / UTM zone 22S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-51,0.9996
+31998,SIRGAS 1995 / UTM zone 23S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-45,0.9996,,,,,,,,,,,,,,,,
+31999,SIRGAS 1995 / UTM zone 24S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-39,0.9996,,,,,,,,,,,,,,,,
+32000,SIRGAS 1995 / UTM zone 25S,Transverse Mercator,metre,4170,Sistema de Referencia Geocentrico para America del Sur 1995,GRS 1980,500000,0,10000000,-33,0.9996,,,,,,,,,,,,,,,,
+32001,NAD27 / Montana North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.51,47,-109.3,48.43,0,2000000
+32002,NAD27 / Montana Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.27,45.5,-109.3,47.53,0,2000000
+32003,NAD27 / Montana South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.52,44,-109.3,46.24,0,2000000
+32005,NAD27 / Nebraska North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.49,41.2,-100,41.51,0,2000000
+32006,NAD27 / Nebraska South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.43,39.4,-99.3,40.17,0,2000000
+32007,NAD27 / Nevada East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,34.45,0,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32008,NAD27 / Nevada Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,34.45,0,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32009,NAD27 / Nevada West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,34.45,0,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32010,NAD27 / New Hampshire,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32011,NAD27 / New Jersey,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,2000000,38.5,0,-74.4,0.999975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32012,NAD27 / New Mexico East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32013,NAD27 / New Mexico Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32014,NAD27 / New Mexico West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32015,NAD27 / New York East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40,0,-74.2,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32016,NAD27 / New York Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32017,NAD27 / New York West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32019,NAD27 / North Carolina,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.1,33.45,-79,34.2,0,2000000
+32020,NAD27 / North Dakota North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.44,47,-100.3,47.26,0,2000000
+32021,NAD27 / North Dakota South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.29,45.4,-100.3,46.11,0,2000000
+32022,NAD27 / Ohio North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.42,39.4,-82.3,40.26,0,2000000
+32023,NAD27 / Ohio South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.02,38,-82.3,38.44,0,2000000
+32024,NAD27 / Oklahoma North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,35,-98,35.34,0,2000000
+32025,NAD27 / Oklahoma South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.14,33.2,-98,33.56,0,2000000
+32026,NAD27 / Oregon North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,43.4,-120.3,44.2,0,2000000
+32027,NAD27 / Oregon South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,41.4,-120.3,42.2,0,2000000
+32028,NAD27 / Pennsylvania North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.57,40.1,-77.45,40.53,0,2000000
+32030,NAD27 / Rhode Island,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,41.05,0,-71.3,0.9999938,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32031,NAD27 / South Carolina North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.58,33,-81,33.46,0,2000000
+32033,NAD27 / South Carolina South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.4,31.5,-81,32.2,0,2000000
+32034,NAD27 / South Dakota North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.41,43.5,-100,44.25,0,2000000
+32035,NAD27 / South Dakota South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.24,42.2,-100.2,42.5,0,2000000
+32037,NAD27 / Texas North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.11,34,-101.3,34.39,0,2000000
+32038,NAD27 / Texas North Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.58,31.4,-97.3,32.08,0,2000000
+32039,NAD27 / Texas Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31.53,29.4,-100.2,30.07,0,2000000
+32040,NAD27 / Texas South Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.17,27.5,-99,28.23,0,2000000
+32041,NAD27 / Texas South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27.5,25.4,-98.3,26.1,0,2000000
+32042,NAD27 / Utah North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41.47,40.2,-111.3,40.43,0,2000000
+32043,NAD27 / Utah Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.39,38.2,-111.3,39.01,0,2000000
+32044,NAD27 / Utah South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.21,36.4,-111.3,37.13,0,2000000
+32045,NAD27 / Vermont,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32046,NAD27 / Virginia North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.12,37.4,-78.3,38.02,0,2000000
+32047,NAD27 / Virginia South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.58,36.2,-78.3,36.46,0,2000000
+32048,NAD27 / Washington North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48.44,47,-120.5,47.3,0,2000000
+32049,NAD27 / Washington South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.2,45.2,-120.3,45.5,0,2000000
+32050,NAD27 / West Virginia North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.15,38.3,-79.3,39,0,2000000
+32051,NAD27 / West Virginia South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.53,37,-81,37.29,0,2000000
+32052,NAD27 / Wisconsin North,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.46,45.1,-90,45.34,0,2000000
+32053,NAD27 / Wisconsin Central,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.3,43.5,-90,44.15,0,2000000
+32054,NAD27 / Wisconsin South,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.04,42,-90,42.44,0,2000000
+32055,NAD27 / Wyoming East,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-105.1,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32056,NAD27 / Wyoming East Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-107.2,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32057,NAD27 / Wyoming West Central,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-108.45,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32058,NAD27 / Wyoming West,Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,500000,40.4,0,-110.05,0.999941177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32061,NAD27 / Guatemala Norte,Lambert Conic Conformal (1SP),metre,4267,North American Datum 1927,Clarke 1866,500000,16.49,292209.579,-90.2,0.99992226,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32062,NAD27 / Guatemala Sur,Lambert Conic Conformal (1SP),metre,4267,North American Datum 1927,Clarke 1866,500000,14.54,325992.681,-90.2,0.99989906,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32064,NAD27 / BLM 14N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32065,NAD27 / BLM 15N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32066,NAD27 / BLM 16N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32067,NAD27 / BLM 17N (ftUS),Transverse Mercator,US survey foot,4267,North American Datum 1927,Clarke 1866,1640416.67,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32081,NAD27 / MTM zone 1,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-53,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32082,NAD27 / MTM zone 2,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-56,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32083,NAD27 / MTM zone 3,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-58.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32084,NAD27 / MTM zone 4,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32085,NAD27 / MTM zone 5,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32086,NAD27 / MTM zone 6,Transverse Mercator,metre,4267,North American Datum 1927,Clarke 1866,304800,0,0,-67.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32098,NAD27 / Quebec Lambert,Lambert Conic Conformal (2SP),metre,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-68.3,60,0,0
+32099,NAD27 / Louisiana Offshore,Lambert Conic Conformal (2SP),US survey foot,4267,North American Datum 1927,Clarke 1866,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-91.2,27.5,0,2000000
+32100,NAD83 / Montana,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,44.15,-109.3,49,0,600000
+32104,NAD83 / Nebraska,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,39.5,-100,43,0,500000
+32107,NAD83 / Nevada East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,34.45,8000000,-115.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32108,NAD83 / Nevada Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,34.45,6000000,-116.4,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32109,NAD83 / Nevada West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,800000,34.45,4000000,-118.35,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32110,NAD83 / New Hampshire,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,300000,42.3,0,-71.4,0.999966667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32111,NAD83 / New Jersey,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32112,NAD83 / New Mexico East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,165000,31,0,-104.2,0.999909091,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32113,NAD83 / New Mexico Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,31,0,-106.15,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32114,NAD83 / New Mexico West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,830000,31,0,-107.5,0.999916667,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32115,NAD83 / New York East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,150000,38.5,0,-74.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32116,NAD83 / New York Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,250000,40,0,-76.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32117,NAD83 / New York West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,350000,40,0,-78.35,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32118,NAD83 / New York Long Island,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.4,40.1,-74,41.02,0,300000
+32119,NAD83 / North Carolina,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.2,33.45,-79,36.1,0,609601.22
+32120,NAD83 / North Dakota North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.26,47,-100.3,48.44,0,600000
+32121,NAD83 / North Dakota South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46.11,45.4,-100.3,47.29,0,600000
+32122,NAD83 / Ohio North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.26,39.4,-82.3,41.42,0,600000
+32123,NAD83 / Ohio South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.44,38,-82.3,40.02,0,600000
+32124,NAD83 / Oklahoma North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.34,35,-98,36.46,0,600000
+32125,NAD83 / Oklahoma South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33.56,33.2,-98,35.14,0,600000
+32126,NAD83 / Oregon North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.2,43.4,-120.3,46,0,2500000
+32127,NAD83 / Oregon South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.2,41.4,-120.3,44,0,1500000
+32128,NAD83 / Pennsylvania North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.53,40.1,-77.45,41.57,0,600000
+32129,NAD83 / Pennsylvania South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.56,39.2,-77.45,40.58,0,600000
+32130,NAD83 / Rhode Island,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,100000,41.05,0,-71.3,0.99999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32133,NAD83 / South Carolina,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.3,31.5,-81,34.5,0,609600
+32134,NAD83 / South Dakota North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.25,43.5,-100,45.41,0,600000
+32135,NAD83 / South Dakota South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.5,42.2,-100.2,44.24,0,600000
+32136,NAD83 / Tennessee,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35.15,34.2,-86,36.25,0,600000
+32137,NAD83 / Texas North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34.39,34,-101.3,36.11,1000000,200000
+32138,NAD83 / Texas North Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32.08,31.4,-98.3,33.58,2000000,600000
+32139,NAD83 / Texas Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30.07,29.4,-100.2,31.53,3000000,700000
+32140,NAD83 / Texas South Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28.23,27.5,-99,30.17,4000000,600000
+32141,NAD83 / Texas South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.4,-98.3,27.5,5000000,300000
+32142,NAD83 / Utah North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40.43,40.2,-111.3,41.47,1000000,500000
+32143,NAD83 / Utah Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39.01,38.2,-111.3,40.39,2000000,500000
+32144,NAD83 / Utah South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.13,36.4,-111.3,38.21,3000000,500000
+32145,NAD83 / Vermont,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,500000,42.3,0,-72.3,0.999964286,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32146,NAD83 / Virginia North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38.02,37.4,-78.3,39.12,2000000,3500000
+32147,NAD83 / Virginia South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36.46,36.2,-78.3,37.58,1000000,3500000
+32148,NAD83 / Washington North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47.3,47,-120.5,48.44,0,500000
+32149,NAD83 / Washington South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.5,45.2,-120.3,47.2,0,500000
+32150,NAD83 / West Virginia North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,38.3,-79.3,40.15,0,600000
+32151,NAD83 / West Virginia South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37.29,37,-81,38.53,0,600000
+32152,NAD83 / Wisconsin North,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45.34,45.1,-90,46.46,0,600000
+32153,NAD83 / Wisconsin Central,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44.15,43.5,-90,45.3,0,600000
+32154,NAD83 / Wisconsin South,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42.44,42,-90,44.04,0,600000
+32155,NAD83 / Wyoming East,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,200000,40.3,0,-105.1,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32156,NAD83 / Wyoming East Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,400000,40.3,100000,-107.2,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32157,NAD83 / Wyoming West Central,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,600000,40.3,0,-108.45,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32158,NAD83 / Wyoming West,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,800000,40.3,100000,-110.05,0.9999375,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32161,NAD83 / Puerto Rico & Virgin Is.,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18.02,17.5,-66.26,18.26,200000,200000
+32164,NAD83 / BLM 14N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32165,NAD83 / BLM 15N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32166,NAD83 / BLM 16N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32167,NAD83 / BLM 17N (ftUS),Transverse Mercator,US survey foot,4269,North American Datum 1983,GRS 1980,1640416.67,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32180,NAD83 / SCoPQ zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-55.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32181,NAD83 / MTM zone 1,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-53,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32182,NAD83 / MTM zone 2,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-56,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32183,NAD83 / MTM zone 3,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-58.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32184,NAD83 / MTM zone 4,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-61.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32185,NAD83 / MTM zone 5,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-64.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32186,NAD83 / MTM zone 6,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-67.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32187,NAD83 / MTM zone 7,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-70.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32188,NAD83 / MTM zone 8,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-73.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32189,NAD83 / MTM zone 9,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-76.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32190,NAD83 / MTM zone 10,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-79.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32191,NAD83 / MTM zone 11,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-82.3,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32192,NAD83 / MTM zone 12,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-81,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32193,NAD83 / MTM zone 13,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-84,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32194,NAD83 / MTM zone 14,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-87,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32195,NAD83 / MTM zone 15,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-90,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32196,NAD83 / MTM zone 16,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-93,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32197,NAD83 / MTM zone 17,Transverse Mercator,metre,4269,North American Datum 1983,GRS 1980,304800,0,0,-96,0.9999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32198,NAD83 / Quebec Lambert,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,44,-68.3,60,0,0
+32199,NAD83 / Louisiana Offshore,Lambert Conic Conformal (2SP),metre,4269,North American Datum 1983,GRS 1980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26.1,25.3,-91.2,27.5,0,1000000
+32201,WGS 72 / UTM zone 1N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-177,0.9996,,,,,,,,,,,,,,,,
+32202,WGS 72 / UTM zone 2N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-171,0.9996,,,,,,,,,,,,,,,,
+32203,WGS 72 / UTM zone 3N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-165,0.9996,,,,,,,,,,,,,,,,
+32204,WGS 72 / UTM zone 4N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-159,0.9996,,,,,,,,,,,,,,,,
+32205,WGS 72 / UTM zone 5N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-153,0.9996,,,,,,,,,,,,,,,,
+32206,WGS 72 / UTM zone 6N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-147,0.9996,,,,,,,,,,,,,,,,
+32207,WGS 72 / UTM zone 7N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-141,0.9996,,,,,,,,,,,,,,,,
+32208,WGS 72 / UTM zone 8N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-135,0.9996,,,,,,,,,,,,,,,,
+32209,WGS 72 / UTM zone 9N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-129,0.9996,,,,,,,,,,,,,,,,
+32210,WGS 72 / UTM zone 10N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-123,0.9996,,,,,,,,,,,,,,,,
+32211,WGS 72 / UTM zone 11N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-117,0.9996,,,,,,,,,,,,,,,,
+32212,WGS 72 / UTM zone 12N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-111,0.9996,,,,,,,,,,,,,,,,
+32213,WGS 72 / UTM zone 13N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-105,0.9996,,,,,,,,,,,,,,,,
+32214,WGS 72 / UTM zone 14N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-99,0.9996
+32215,WGS 72 / UTM zone 15N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-93,0.9996
+32216,WGS 72 / UTM zone 16N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-87,0.9996
+32217,WGS 72 / UTM zone 17N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-81,0.9996
+32218,WGS 72 / UTM zone 18N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-75,0.9996
+32219,WGS 72 / UTM zone 19N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-69,0.9996
+32220,WGS 72 / UTM zone 20N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-63,0.9996
+32221,WGS 72 / UTM zone 21N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-57,0.9996
+32222,WGS 72 / UTM zone 22N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-51,0.9996
+32223,WGS 72 / UTM zone 23N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-45,0.9996
+32224,WGS 72 / UTM zone 24N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-39,0.9996
+32225,WGS 72 / UTM zone 25N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-33,0.9996
+32226,WGS 72 / UTM zone 26N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-27,0.9996
+32227,WGS 72 / UTM zone 27N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-21,0.9996
+32228,WGS 72 / UTM zone 28N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-15,0.9996
+32229,WGS 72 / UTM zone 29N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-9,0.9996
+32230,WGS 72 / UTM zone 30N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,-3,0.9996
+32231,WGS 72 / UTM zone 31N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,3,0.9996
+32232,WGS 72 / UTM zone 32N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,9,0.9996
+32233,WGS 72 / UTM zone 33N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,15,0.9996
+32234,WGS 72 / UTM zone 34N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,21,0.9996
+32235,WGS 72 / UTM zone 35N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,27,0.9996
+32236,WGS 72 / UTM zone 36N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,33,0.9996
+32237,WGS 72 / UTM zone 37N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,39,0.9996
+32238,WGS 72 / UTM zone 38N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,45,0.9996
+32239,WGS 72 / UTM zone 39N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,51,0.9996
+32240,WGS 72 / UTM zone 40N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,57,0.9996
+32241,WGS 72 / UTM zone 41N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,63,0.9996
+32242,WGS 72 / UTM zone 42N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,69,0.9996
+32243,WGS 72 / UTM zone 43N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,75,0.9996
+32244,WGS 72 / UTM zone 44N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,81,0.9996
+32245,WGS 72 / UTM zone 45N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,87,0.9996
+32246,WGS 72 / UTM zone 46N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,93,0.9996
+32247,WGS 72 / UTM zone 47N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,99,0.9996
+32248,WGS 72 / UTM zone 48N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,105,0.9996
+32249,WGS 72 / UTM zone 49N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,111,0.9996
+32250,WGS 72 / UTM zone 50N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,117,0.9996
+32251,WGS 72 / UTM zone 51N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,123,0.9996
+32252,WGS 72 / UTM zone 52N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,129,0.9996
+32253,WGS 72 / UTM zone 53N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,135,0.9996
+32254,WGS 72 / UTM zone 54N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,141,0.9996
+32255,WGS 72 / UTM zone 55N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,147,0.9996
+32256,WGS 72 / UTM zone 56N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,153,0.9996
+32257,WGS 72 / UTM zone 57N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,159,0.9996
+32258,WGS 72 / UTM zone 58N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,165,0.9996
+32259,WGS 72 / UTM zone 59N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,171,0.9996
+32260,WGS 72 / UTM zone 60N,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,0,177,0.9996
+32301,WGS 72 / UTM zone 1S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-177,0.9996
+32302,WGS 72 / UTM zone 2S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-171,0.9996
+32303,WGS 72 / UTM zone 3S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-165,0.9996
+32304,WGS 72 / UTM zone 4S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-159,0.9996
+32305,WGS 72 / UTM zone 5S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-153,0.9996
+32306,WGS 72 / UTM zone 6S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-147,0.9996
+32307,WGS 72 / UTM zone 7S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-141,0.9996
+32308,WGS 72 / UTM zone 8S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-135,0.9996
+32309,WGS 72 / UTM zone 9S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-129,0.9996
+32310,WGS 72 / UTM zone 10S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-123,0.9996
+32311,WGS 72 / UTM zone 11S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-117,0.9996
+32312,WGS 72 / UTM zone 12S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-111,0.9996
+32313,WGS 72 / UTM zone 13S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-105,0.9996
+32314,WGS 72 / UTM zone 14S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-99,0.9996
+32315,WGS 72 / UTM zone 15S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-93,0.9996
+32316,WGS 72 / UTM zone 16S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-87,0.9996
+32317,WGS 72 / UTM zone 17S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-81,0.9996
+32318,WGS 72 / UTM zone 18S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-75,0.9996
+32319,WGS 72 / UTM zone 19S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-69,0.9996
+32320,WGS 72 / UTM zone 20S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-63,0.9996
+32321,WGS 72 / UTM zone 21S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-57,0.9996
+32322,WGS 72 / UTM zone 22S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-51,0.9996
+32323,WGS 72 / UTM zone 23S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-45,0.9996
+32324,WGS 72 / UTM zone 24S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-39,0.9996
+32325,WGS 72 / UTM zone 25S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-33,0.9996
+32326,WGS 72 / UTM zone 26S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-27,0.9996
+32327,WGS 72 / UTM zone 27S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-21,0.9996
+32328,WGS 72 / UTM zone 28S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-15,0.9996
+32329,WGS 72 / UTM zone 29S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-9,0.9996
+32330,WGS 72 / UTM zone 30S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,-3,0.9996
+32331,WGS 72 / UTM zone 31S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,3,0.9996
+32332,WGS 72 / UTM zone 32S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,9,0.9996
+32333,WGS 72 / UTM zone 33S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,15,0.9996
+32334,WGS 72 / UTM zone 34S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,21,0.9996
+32335,WGS 72 / UTM zone 35S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,27,0.9996
+32336,WGS 72 / UTM zone 36S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,33,0.9996
+32337,WGS 72 / UTM zone 37S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,39,0.9996
+32338,WGS 72 / UTM zone 38S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,45,0.9996
+32339,WGS 72 / UTM zone 39S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,51,0.9996
+32340,WGS 72 / UTM zone 40S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,57,0.9996
+32341,WGS 72 / UTM zone 41S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,63,0.9996
+32342,WGS 72 / UTM zone 42S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,69,0.9996
+32343,WGS 72 / UTM zone 43S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,75,0.9996
+32344,WGS 72 / UTM zone 44S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,81,0.9996
+32345,WGS 72 / UTM zone 45S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,87,0.9996
+32346,WGS 72 / UTM zone 46S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,93,0.9996
+32347,WGS 72 / UTM zone 47S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,99,0.9996
+32348,WGS 72 / UTM zone 48S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,105,0.9996
+32349,WGS 72 / UTM zone 49S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,111,0.9996
+32350,WGS 72 / UTM zone 50S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,117,0.9996
+32351,WGS 72 / UTM zone 51S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,123,0.9996
+32352,WGS 72 / UTM zone 52S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,129,0.9996
+32353,WGS 72 / UTM zone 53S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,135,0.9996
+32354,WGS 72 / UTM zone 54S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,141,0.9996
+32355,WGS 72 / UTM zone 55S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,147,0.9996
+32356,WGS 72 / UTM zone 56S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,153,0.9996
+32357,WGS 72 / UTM zone 57S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,159,0.9996
+32358,WGS 72 / UTM zone 58S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,165,0.9996
+32359,WGS 72 / UTM zone 59S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,171,0.9996
+32360,WGS 72 / UTM zone 60S,Transverse Mercator,metre,4322,World Geodetic System 1972,WGS 72,500000,0,10000000,177,0.9996
+32401,WGS 72BE / UTM zone 1N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-177,0.9996
+32402,WGS 72BE / UTM zone 2N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-171,0.9996
+32403,WGS 72BE / UTM zone 3N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-165,0.9996
+32404,WGS 72BE / UTM zone 4N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-159,0.9996
+32405,WGS 72BE / UTM zone 5N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-153,0.9996
+32406,WGS 72BE / UTM zone 6N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-147,0.9996
+32407,WGS 72BE / UTM zone 7N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-141,0.9996
+32408,WGS 72BE / UTM zone 8N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-135,0.9996
+32409,WGS 72BE / UTM zone 9N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-129,0.9996
+32410,WGS 72BE / UTM zone 10N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-123,0.9996
+32411,WGS 72BE / UTM zone 11N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-117,0.9996
+32412,WGS 72BE / UTM zone 12N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-111,0.9996
+32413,WGS 72BE / UTM zone 13N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-105,0.9996
+32414,WGS 72BE / UTM zone 14N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-99,0.9996
+32415,WGS 72BE / UTM zone 15N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-93,0.9996
+32416,WGS 72BE / UTM zone 16N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-87,0.9996
+32417,WGS 72BE / UTM zone 17N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-81,0.9996
+32418,WGS 72BE / UTM zone 18N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-75,0.9996
+32419,WGS 72BE / UTM zone 19N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-69,0.9996
+32420,WGS 72BE / UTM zone 20N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-63,0.9996
+32421,WGS 72BE / UTM zone 21N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-57,0.9996
+32422,WGS 72BE / UTM zone 22N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-51,0.9996
+32423,WGS 72BE / UTM zone 23N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-45,0.9996
+32424,WGS 72BE / UTM zone 24N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-39,0.9996
+32425,WGS 72BE / UTM zone 25N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-33,0.9996
+32426,WGS 72BE / UTM zone 26N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-27,0.9996
+32427,WGS 72BE / UTM zone 27N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-21,0.9996
+32428,WGS 72BE / UTM zone 28N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-15,0.9996
+32429,WGS 72BE / UTM zone 29N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-9,0.9996
+32430,WGS 72BE / UTM zone 30N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,-3,0.9996
+32431,WGS 72BE / UTM zone 31N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,3,0.9996
+32432,WGS 72BE / UTM zone 32N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,9,0.9996
+32433,WGS 72BE / UTM zone 33N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,15,0.9996
+32434,WGS 72BE / UTM zone 34N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,21,0.9996
+32435,WGS 72BE / UTM zone 35N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,27,0.9996
+32436,WGS 72BE / UTM zone 36N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,33,0.9996
+32437,WGS 72BE / UTM zone 37N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,39,0.9996
+32438,WGS 72BE / UTM zone 38N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,45,0.9996
+32439,WGS 72BE / UTM zone 39N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,51,0.9996
+32440,WGS 72BE / UTM zone 40N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,57,0.9996
+32441,WGS 72BE / UTM zone 41N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,63,0.9996
+32442,WGS 72BE / UTM zone 42N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,69,0.9996
+32443,WGS 72BE / UTM zone 43N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,75,0.9996
+32444,WGS 72BE / UTM zone 44N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,81,0.9996
+32445,WGS 72BE / UTM zone 45N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,87,0.9996
+32446,WGS 72BE / UTM zone 46N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,93,0.9996
+32447,WGS 72BE / UTM zone 47N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,99,0.9996
+32448,WGS 72BE / UTM zone 48N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,105,0.9996
+32449,WGS 72BE / UTM zone 49N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,111,0.9996
+32450,WGS 72BE / UTM zone 50N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,117,0.9996
+32451,WGS 72BE / UTM zone 51N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,123,0.9996
+32452,WGS 72BE / UTM zone 52N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,129,0.9996
+32453,WGS 72BE / UTM zone 53N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,135,0.9996
+32454,WGS 72BE / UTM zone 54N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,141,0.9996
+32455,WGS 72BE / UTM zone 55N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,147,0.9996
+32456,WGS 72BE / UTM zone 56N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,153,0.9996
+32457,WGS 72BE / UTM zone 57N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,159,0.9996
+32458,WGS 72BE / UTM zone 58N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,165,0.9996
+32459,WGS 72BE / UTM zone 59N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,171,0.9996
+32460,WGS 72BE / UTM zone 60N,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,0,177,0.9996
+32501,WGS 72BE / UTM zone 1S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-177,0.9996
+32502,WGS 72BE / UTM zone 2S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-171,0.9996
+32503,WGS 72BE / UTM zone 3S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-165,0.9996
+32504,WGS 72BE / UTM zone 4S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-159,0.9996
+32505,WGS 72BE / UTM zone 5S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-153,0.9996
+32506,WGS 72BE / UTM zone 6S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-147,0.9996
+32507,WGS 72BE / UTM zone 7S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-141,0.9996
+32508,WGS 72BE / UTM zone 8S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-135,0.9996
+32509,WGS 72BE / UTM zone 9S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-129,0.9996
+32510,WGS 72BE / UTM zone 10S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-123,0.9996
+32511,WGS 72BE / UTM zone 11S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-117,0.9996
+32512,WGS 72BE / UTM zone 12S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-111,0.9996
+32513,WGS 72BE / UTM zone 13S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-105,0.9996
+32514,WGS 72BE / UTM zone 14S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-99,0.9996
+32515,WGS 72BE / UTM zone 15S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-93,0.9996
+32516,WGS 72BE / UTM zone 16S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-87,0.9996
+32517,WGS 72BE / UTM zone 17S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-81,0.9996
+32518,WGS 72BE / UTM zone 18S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-75,0.9996
+32519,WGS 72BE / UTM zone 19S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-69,0.9996
+32520,WGS 72BE / UTM zone 20S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-63,0.9996
+32521,WGS 72BE / UTM zone 21S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-57,0.9996
+32522,WGS 72BE / UTM zone 22S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-51,0.9996
+32523,WGS 72BE / UTM zone 23S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-45,0.9996
+32524,WGS 72BE / UTM zone 24S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-39,0.9996
+32525,WGS 72BE / UTM zone 25S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-33,0.9996
+32526,WGS 72BE / UTM zone 26S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-27,0.9996
+32527,WGS 72BE / UTM zone 27S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-21,0.9996
+32528,WGS 72BE / UTM zone 28S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-15,0.9996
+32529,WGS 72BE / UTM zone 29S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-9,0.9996
+32530,WGS 72BE / UTM zone 30S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,-3,0.9996
+32531,WGS 72BE / UTM zone 31S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,3,0.9996
+32532,WGS 72BE / UTM zone 32S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,9,0.9996
+32533,WGS 72BE / UTM zone 33S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,15,0.9996
+32534,WGS 72BE / UTM zone 34S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,21,0.9996
+32535,WGS 72BE / UTM zone 35S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,27,0.9996
+32536,WGS 72BE / UTM zone 36S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,33,0.9996
+32537,WGS 72BE / UTM zone 37S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,39,0.9996
+32538,WGS 72BE / UTM zone 38S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,45,0.9996
+32539,WGS 72BE / UTM zone 39S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,51,0.9996
+32540,WGS 72BE / UTM zone 40S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,57,0.9996
+32541,WGS 72BE / UTM zone 41S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,63,0.9996
+32542,WGS 72BE / UTM zone 42S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,69,0.9996
+32543,WGS 72BE / UTM zone 43S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,75,0.9996
+32544,WGS 72BE / UTM zone 44S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,81,0.9996
+32545,WGS 72BE / UTM zone 45S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,87,0.9996
+32546,WGS 72BE / UTM zone 46S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,93,0.9996
+32547,WGS 72BE / UTM zone 47S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,99,0.9996
+32548,WGS 72BE / UTM zone 48S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,105,0.9996
+32549,WGS 72BE / UTM zone 49S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,111,0.9996
+32550,WGS 72BE / UTM zone 50S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,117,0.9996
+32551,WGS 72BE / UTM zone 51S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,123,0.9996
+32552,WGS 72BE / UTM zone 52S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,129,0.9996
+32553,WGS 72BE / UTM zone 53S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,135,0.9996
+32554,WGS 72BE / UTM zone 54S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,141,0.9996
+32555,WGS 72BE / UTM zone 55S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,147,0.9996
+32556,WGS 72BE / UTM zone 56S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,153,0.9996
+32557,WGS 72BE / UTM zone 57S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,159,0.9996
+32558,WGS 72BE / UTM zone 58S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,165,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
+32559,WGS 72BE / UTM zone 59S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,171,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
+32560,WGS 72BE / UTM zone 60S,Transverse Mercator,metre,4324,WGS 72 Transit Broadcast Ephemeris,WGS 72,500000,0,10000000,177,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
+32600,WGS 84 / UTM grid system (northern hemisphere),Transverse Mercator Zoned Grid System,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,0,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-180,6
+32601,WGS 84 / UTM zone 1N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32602,WGS 84 / UTM zone 2N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32603,WGS 84 / UTM zone 3N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32604,WGS 84 / UTM zone 4N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32605,WGS 84 / UTM zone 5N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32606,WGS 84 / UTM zone 6N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32607,WGS 84 / UTM zone 7N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32608,WGS 84 / UTM zone 8N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32609,WGS 84 / UTM zone 9N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32610,WGS 84 / UTM zone 10N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32611,WGS 84 / UTM zone 11N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32612,WGS 84 / UTM zone 12N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32613,WGS 84 / UTM zone 13N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32614,WGS 84 / UTM zone 14N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-99,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32615,WGS 84 / UTM zone 15N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-93,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32616,WGS 84 / UTM zone 16N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-87,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32617,WGS 84 / UTM zone 17N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-81,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32618,WGS 84 / UTM zone 18N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-75,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32619,WGS 84 / UTM zone 19N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-69,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32620,WGS 84 / UTM zone 20N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-63,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32621,WGS 84 / UTM zone 21N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-57,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32622,WGS 84 / UTM zone 22N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-51,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32623,WGS 84 / UTM zone 23N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-45,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32624,WGS 84 / UTM zone 24N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-39,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32625,WGS 84 / UTM zone 25N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-33,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32626,WGS 84 / UTM zone 26N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-27,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32627,WGS 84 / UTM zone 27N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-21,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32628,WGS 84 / UTM zone 28N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-15,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32629,WGS 84 / UTM zone 29N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-9,0.9996
+32630,WGS 84 / UTM zone 30N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,-3,0.9996
+32631,WGS 84 / UTM zone 31N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,3,0.9996
+32632,WGS 84 / UTM zone 32N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,9,0.9996
+32633,WGS 84 / UTM zone 33N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,15,0.9996
+32634,WGS 84 / UTM zone 34N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,21,0.9996
+32635,WGS 84 / UTM zone 35N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,27,0.9996
+32636,WGS 84 / UTM zone 36N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,33,0.9996
+32637,WGS 84 / UTM zone 37N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,39,0.9996
+32638,WGS 84 / UTM zone 38N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,45,0.9996
+32639,WGS 84 / UTM zone 39N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,51,0.9996
+32640,WGS 84 / UTM zone 40N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,57,0.9996
+32641,WGS 84 / UTM zone 41N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,63,0.9996
+32642,WGS 84 / UTM zone 42N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,69,0.9996
+32643,WGS 84 / UTM zone 43N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,75,0.9996
+32644,WGS 84 / UTM zone 44N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,81,0.9996
+32645,WGS 84 / UTM zone 45N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,87,0.9996
+32646,WGS 84 / UTM zone 46N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,93,0.9996
+32647,WGS 84 / UTM zone 47N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,99,0.9996
+32648,WGS 84 / UTM zone 48N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,105,0.9996
+32649,WGS 84 / UTM zone 49N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,111,0.9996
+32650,WGS 84 / UTM zone 50N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,117,0.9996
+32651,WGS 84 / UTM zone 51N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,123,0.9996
+32652,WGS 84 / UTM zone 52N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,129,0.9996
+32653,WGS 84 / UTM zone 53N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,135,0.9996
+32654,WGS 84 / UTM zone 54N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,141,0.9996
+32655,WGS 84 / UTM zone 55N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,147,0.9996
+32656,WGS 84 / UTM zone 56N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,153,0.9996
+32657,WGS 84 / UTM zone 57N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,159,0.9996
+32658,WGS 84 / UTM zone 58N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,165,0.9996
+32659,WGS 84 / UTM zone 59N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,171,0.9996
+32660,WGS 84 / UTM zone 60N,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,0,177,0.9996
+32661,WGS 84 / UPS North,Polar Stereographic (variant A),metre,4326,World Geodetic System 1984,WGS 84,2000000,90,2000000,0,0.994,,,,,,,,,,,,,,,,,,,,,,,,,,
+32664,WGS 84 / BLM 14N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-99,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
+32665,WGS 84 / BLM 15N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-93,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,,
+32666,WGS 84 / BLM 16N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-87,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32667,WGS 84 / BLM 17N (ftUS),Transverse Mercator,US survey foot,4326,World Geodetic System 1984,WGS 84,1640416.67,0,0,-81,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32700,WGS 84 / UTM grid system (southern hemisphere),Transverse Mercator Zoned Grid System,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,0,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-180,6
+32701,WGS 84 / UTM zone 1S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-177,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32702,WGS 84 / UTM zone 2S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-171,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32703,WGS 84 / UTM zone 3S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-165,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32704,WGS 84 / UTM zone 4S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-159,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32705,WGS 84 / UTM zone 5S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-153,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32706,WGS 84 / UTM zone 6S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-147,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32707,WGS 84 / UTM zone 7S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-141,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32708,WGS 84 / UTM zone 8S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-135,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32709,WGS 84 / UTM zone 9S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-129,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32710,WGS 84 / UTM zone 10S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-123,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+32711,WGS 84 / UTM zone 11S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-117,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32712,WGS 84 / UTM zone 12S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-111,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32713,WGS 84 / UTM zone 13S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-105,0.9996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+32714,WGS 84 / UTM zone 14S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-99,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32715,WGS 84 / UTM zone 15S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-93,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32716,WGS 84 / UTM zone 16S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-87,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32717,WGS 84 / UTM zone 17S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-81,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32718,WGS 84 / UTM zone 18S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-75,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32719,WGS 84 / UTM zone 19S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-69,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32720,WGS 84 / UTM zone 20S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-63,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32721,WGS 84 / UTM zone 21S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-57,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32722,WGS 84 / UTM zone 22S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-51,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32723,WGS 84 / UTM zone 23S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-45,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32724,WGS 84 / UTM zone 24S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-39,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32725,WGS 84 / UTM zone 25S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-33,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32726,WGS 84 / UTM zone 26S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-27,0.9996,,,,,,,,,,,,,,,,,,,,,,,,,
+32727,WGS 84 / UTM zone 27S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-21,0.9996
+32728,WGS 84 / UTM zone 28S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-15,0.9996
+32729,WGS 84 / UTM zone 29S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-9,0.9996
+32730,WGS 84 / UTM zone 30S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,-3,0.9996
+32731,WGS 84 / UTM zone 31S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,3,0.9996
+32732,WGS 84 / UTM zone 32S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,9,0.9996
+32733,WGS 84 / UTM zone 33S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,15,0.9996
+32734,WGS 84 / UTM zone 34S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,21,0.9996
+32735,WGS 84 / UTM zone 35S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,27,0.9996
+32736,WGS 84 / UTM zone 36S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,33,0.9996
+32737,WGS 84 / UTM zone 37S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,39,0.9996
+32738,WGS 84 / UTM zone 38S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,45,0.9996
+32739,WGS 84 / UTM zone 39S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,51,0.9996
+32740,WGS 84 / UTM zone 40S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,57,0.9996
+32741,WGS 84 / UTM zone 41S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,63,0.9996
+32742,WGS 84 / UTM zone 42S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,69,0.9996
+32743,WGS 84 / UTM zone 43S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,75,0.9996
+32744,WGS 84 / UTM zone 44S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,81,0.9996
+32745,WGS 84 / UTM zone 45S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,87,0.9996
+32746,WGS 84 / UTM zone 46S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,93,0.9996
+32747,WGS 84 / UTM zone 47S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,99,0.9996
+32748,WGS 84 / UTM zone 48S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,105,0.9996
+32749,WGS 84 / UTM zone 49S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,111,0.9996
+32750,WGS 84 / UTM zone 50S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,117,0.9996
+32751,WGS 84 / UTM zone 51S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,123,0.9996
+32752,WGS 84 / UTM zone 52S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,129,0.9996
+32753,WGS 84 / UTM zone 53S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,135,0.9996
+32754,WGS 84 / UTM zone 54S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,141,0.9996
+32755,WGS 84 / UTM zone 55S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,147,0.9996
+32756,WGS 84 / UTM zone 56S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,153,0.9996
+32757,WGS 84 / UTM zone 57S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,159,0.9996
+32758,WGS 84 / UTM zone 58S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,165,0.9996
+32759,WGS 84 / UTM zone 59S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,171,0.9996
+32760,WGS 84 / UTM zone 60S,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,177,0.9996
+32761,WGS 84 / UPS South,Polar Stereographic (variant A),metre,4326,World Geodetic System 1984,WGS 84,2000000,-90,2000000,0,0.994
+32766,WGS 84 / TM 36 SE,Transverse Mercator,metre,4326,World Geodetic System 1984,WGS 84,500000,0,10000000,36,0.9996
diff --git a/ossim/share/ossim/projection/ossim_harn_state_plane_epsg.csv b/share/ossim/projection/ossim_harn_state_plane_epsg.csv
similarity index 100%
rename from ossim/share/ossim/projection/ossim_harn_state_plane_epsg.csv
rename to share/ossim/projection/ossim_harn_state_plane_epsg.csv
diff --git a/ossim/share/ossim/projection/ossim_harn_state_plane_esri.csv b/share/ossim/projection/ossim_harn_state_plane_esri.csv
similarity index 100%
rename from ossim/share/ossim/projection/ossim_harn_state_plane_esri.csv
rename to share/ossim/projection/ossim_harn_state_plane_esri.csv
diff --git a/ossim/share/ossim/projection/ossim_state_plane_readme.txt b/share/ossim/projection/ossim_state_plane_readme.txt
similarity index 100%
rename from ossim/share/ossim/projection/ossim_state_plane_readme.txt
rename to share/ossim/projection/ossim_state_plane_readme.txt
diff --git a/ossim/share/ossim/projection/ossim_state_plane_spcs.csv b/share/ossim/projection/ossim_state_plane_spcs.csv
similarity index 100%
rename from ossim/share/ossim/projection/ossim_state_plane_spcs.csv
rename to share/ossim/projection/ossim_state_plane_spcs.csv
diff --git a/ossim/share/ossim/projection/ossim_wkt_pcs.csv b/share/ossim/projection/ossim_wkt_pcs.csv
similarity index 100%
rename from ossim/share/ossim/projection/ossim_wkt_pcs.csv
rename to share/ossim/projection/ossim_wkt_pcs.csv
diff --git a/ossim/share/ossim/templates/LambertConformalConicProjection_template.geom b/share/ossim/templates/LambertConformalConicProjection_template.geom
similarity index 100%
rename from ossim/share/ossim/templates/LambertConformalConicProjection_template.geom
rename to share/ossim/templates/LambertConformalConicProjection_template.geom
diff --git a/ossim/share/ossim/templates/applanix.geom b/share/ossim/templates/applanix.geom
similarity index 100%
rename from ossim/share/ossim/templates/applanix.geom
rename to share/ossim/templates/applanix.geom
diff --git a/ossim/share/ossim/templates/applanix_ecef.geom b/share/ossim/templates/applanix_ecef.geom
similarity index 100%
rename from ossim/share/ossim/templates/applanix_ecef.geom
rename to share/ossim/templates/applanix_ecef.geom
diff --git a/ossim/share/ossim/templates/applanix_ecef_camera_file_sn0056.kwl b/share/ossim/templates/applanix_ecef_camera_file_sn0056.kwl
similarity index 100%
rename from ossim/share/ossim/templates/applanix_ecef_camera_file_sn0056.kwl
rename to share/ossim/templates/applanix_ecef_camera_file_sn0056.kwl
diff --git a/ossim/share/ossim/templates/applanix_ecef_eo_example.txt b/share/ossim/templates/applanix_ecef_eo_example.txt
similarity index 100%
rename from ossim/share/ossim/templates/applanix_ecef_eo_example.txt
rename to share/ossim/templates/applanix_ecef_eo_example.txt
diff --git a/ossim/share/ossim/templates/applanix_utm.geom b/share/ossim/templates/applanix_utm.geom
similarity index 100%
rename from ossim/share/ossim/templates/applanix_utm.geom
rename to share/ossim/templates/applanix_utm.geom
diff --git a/ossim/share/ossim/templates/applanix_utm_camera_file_sn0085D.kwl b/share/ossim/templates/applanix_utm_camera_file_sn0085D.kwl
similarity index 100%
rename from ossim/share/ossim/templates/applanix_utm_camera_file_sn0085D.kwl
rename to share/ossim/templates/applanix_utm_camera_file_sn0085D.kwl
diff --git a/ossim/share/ossim/templates/applanix_utm_eo_example.txt b/share/ossim/templates/applanix_utm_eo_example.txt
similarity index 100%
rename from ossim/share/ossim/templates/applanix_utm_eo_example.txt
rename to share/ossim/templates/applanix_utm_eo_example.txt
diff --git a/ossim/share/ossim/templates/bilinear_projection_template.geom b/share/ossim/templates/bilinear_projection_template.geom
similarity index 100%
rename from ossim/share/ossim/templates/bilinear_projection_template.geom
rename to share/ossim/templates/bilinear_projection_template.geom
diff --git a/ossim/share/ossim/templates/elevation_database_template.sql b/share/ossim/templates/elevation_database_template.sql
similarity index 100%
rename from ossim/share/ossim/templates/elevation_database_template.sql
rename to share/ossim/templates/elevation_database_template.sql
diff --git a/ossim/share/ossim/templates/fgdc_metadata_file_writer_template.xml b/share/ossim/templates/fgdc_metadata_file_writer_template.xml
similarity index 100%
rename from ossim/share/ossim/templates/fgdc_metadata_file_writer_template.xml
rename to share/ossim/templates/fgdc_metadata_file_writer_template.xml
diff --git a/ossim/share/ossim/templates/general_raster_template.omd b/share/ossim/templates/general_raster_template.omd
similarity index 100%
rename from ossim/share/ossim/templates/general_raster_template.omd
rename to share/ossim/templates/general_raster_template.omd
diff --git a/ossim/share/ossim/templates/geographic_projection_template.geom b/share/ossim/templates/geographic_projection_template.geom
similarity index 100%
rename from ossim/share/ossim/templates/geographic_projection_template.geom
rename to share/ossim/templates/geographic_projection_template.geom
diff --git a/ossim/share/ossim/templates/index_to_rgb.lut b/share/ossim/templates/index_to_rgb.lut
similarity index 100%
rename from ossim/share/ossim/templates/index_to_rgb.lut
rename to share/ossim/templates/index_to_rgb.lut
diff --git a/ossim/share/ossim/templates/nitf-site-configuration.kwl b/share/ossim/templates/nitf-site-configuration.kwl
similarity index 100%
rename from ossim/share/ossim/templates/nitf-site-configuration.kwl
rename to share/ossim/templates/nitf-site-configuration.kwl
diff --git a/ossim/share/ossim/templates/orthoigen1.kwl b/share/ossim/templates/orthoigen1.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigen1.kwl
rename to share/ossim/templates/orthoigen1.kwl
diff --git a/ossim/share/ossim/templates/orthoigen2.kwl b/share/ossim/templates/orthoigen2.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigen2.kwl
rename to share/ossim/templates/orthoigen2.kwl
diff --git a/ossim/share/ossim/templates/orthoigen3.kwl b/share/ossim/templates/orthoigen3.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigen3.kwl
rename to share/ossim/templates/orthoigen3.kwl
diff --git a/ossim/share/ossim/templates/orthoigen4.kwl b/share/ossim/templates/orthoigen4.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigen4.kwl
rename to share/ossim/templates/orthoigen4.kwl
diff --git a/ossim/share/ossim/templates/orthoigenTilingTemplateByOutputBytes.kwl b/share/ossim/templates/orthoigenTilingTemplateByOutputBytes.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigenTilingTemplateByOutputBytes.kwl
rename to share/ossim/templates/orthoigenTilingTemplateByOutputBytes.kwl
diff --git a/ossim/share/ossim/templates/orthoigen_annotation_template.kwl b/share/ossim/templates/orthoigen_annotation_template.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigen_annotation_template.kwl
rename to share/ossim/templates/orthoigen_annotation_template.kwl
diff --git a/ossim/share/ossim/templates/orthoigen_srtm.kwl b/share/ossim/templates/orthoigen_srtm.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigen_srtm.kwl
rename to share/ossim/templates/orthoigen_srtm.kwl
diff --git a/ossim/share/ossim/templates/orthoigen_writer_template.kwl b/share/ossim/templates/orthoigen_writer_template.kwl
similarity index 100%
rename from ossim/share/ossim/templates/orthoigen_writer_template.kwl
rename to share/ossim/templates/orthoigen_writer_template.kwl
diff --git a/ossim/share/ossim/templates/ossim-batch-test-template.kwl b/share/ossim/templates/ossim-batch-test-template.kwl
similarity index 100%
rename from ossim/share/ossim/templates/ossim-batch-test-template.kwl
rename to share/ossim/templates/ossim-batch-test-template.kwl
diff --git a/share/ossim/templates/ossim-chipper-annotation-template.kwl b/share/ossim/templates/ossim-chipper-annotation-template.kwl
new file mode 100644
index 0000000..b387f79
--- /dev/null
+++ b/share/ossim/templates/ossim-chipper-annotation-template.kwl
@@ -0,0 +1,66 @@
+// ---
+// Outouts:
+// 1024 x 1024 png chip about center lat, lon, rotating up is up, with
+// auto histogram stretch, three bands out, eight bit, with two cross hair
+// annotations, one using scene center, one using ground point.
+//
+// Example usage:
+// $ ossim-chipper --options ossim-chipper-annotation-template.kwl
+// 
+// --
+
+cut_center_lat:  -42.845907553579273
+cut_center_lon:  147.326010803416864
+cut_height:  1024
+cut_width:  1024
+hist_op:  auto-minmax
+image0.file:  5V090205P0001912264B220000100282M_001508507.ntf
+operation:  chip
+output_file:  outputs/chipper-annotation-test.png
+output_radiometry: U8
+three_band_out: true
+up_is_up:  true
+writer:  ossim_png
+
+
+annotation0.type: cross_hair
+annotation0.line.location: scene_center
+
+// Size in pixels in one direction:
+annotation0.line.size: 33
+annotation0.line.red: 255
+annotation0.line.green: 1
+annotation0.line.blue: 255
+annotation0.line.thickness: 2
+annotation0.text.location: bottom
+annotation0.text.string: ABC123DEF
+annotation0.text.red: 1
+annotation0.text.green: 255
+annotation0.text.blue: 1
+annotation0.text.thickness: 2
+annotation0.text.point_size: ( 18, 18 )
+annotation0.text.rotation:  0.000000000000000
+annotation0.text.scale: ( 1.0, 1.0 )
+annotation0.text.shear: ( 0.0, 0.0 )
+
+annotation1.type: cross_hair
+
+// ( lat, lon, height, datum ) 
+annotation1.line.location.gpt: (-42.846310078173751,147.323676170201878,2.613,WGE) 
+
+// Size in pixels in one direction:
+annotation1.line.size: 33
+annotation1.line.red: 255
+annotation1.line.green: 1
+annotation1.line.blue: 255
+annotation1.line.thickness: 2
+annotation1.text.location: bottom
+annotation1.text.string: BLDG0123
+annotation1.text.red: 1
+annotation1.text.green: 255
+annotation1.text.blue: 1
+annotation1.text.thickness: 2
+annotation1.text.point_size: ( 18, 18 )
+annotation1.text.rotation:  1.000000000000000
+annotation1.text.scale: ( 1.0, 1.0 )
+annotation1.text.shear: ( 0.0, 0.0 )
diff --git a/ossim/share/ossim/templates/ossim-chipper-color-table-template.kwl b/share/ossim/templates/ossim-chipper-color-table-template.kwl
similarity index 100%
rename from ossim/share/ossim/templates/ossim-chipper-color-table-template.kwl
rename to share/ossim/templates/ossim-chipper-color-table-template.kwl
diff --git a/ossim/share/ossim/templates/ossim-dem-example-commands.txt b/share/ossim/templates/ossim-dem-example-commands.txt
similarity index 100%
rename from ossim/share/ossim/templates/ossim-dem-example-commands.txt
rename to share/ossim/templates/ossim-dem-example-commands.txt
diff --git a/share/ossim/templates/ossim_preferences_template b/share/ossim/templates/ossim_preferences_template
new file mode 100644
index 0000000..c07c6f9
--- /dev/null
+++ b/share/ossim/templates/ossim_preferences_template
@@ -0,0 +1,734 @@
+// ------------------------------------------------------------------------
+// 
+// Description:  ossim_preferences_template
+// 
+// This file will be automatically loaded by ossim applications provided the
+// environment variable "OSSIM_PREFS_FILE" is set to point to some form of 
+// this file.
+//
+// Note:  c++ comments "//" can be used to comment a line.
+//
+// To set the environment variable for automatic preference file loading:
+//
+// This assumes a preference file in your home called "ossim_preferences".
+// Typically this would be put in a dot file read at startup of a shell.
+//
+// tcsh and csh users:  setenv OSSIM_PREFS_FILE ~/ossim_preferences
+//
+// bash and sh users:   export OSSIM_PREFS_FILE=~/ossim_preferences
+// 
+// windoze users:       I'll have to look this up...
+//
+// Use the "-P <preference_file>" option at application startup to specify
+// a path to preferences file.  Where <preference_file> is full path and 
+// filename.
+//
+// Use the "-K key=value option at application startup to specify a key value
+// pair. e.g.:
+// ossim-chipper -K ossim.std.out.progress=1 --options tgt-008-options.kwl
+//
+// Note that system environment variables found in this ossim preferences
+// file in the format "$(env_var_name)" will be expanded in place.
+//
+// To view your preferences use below command.  This is useful when trouble
+// shooting paths and so on:
+//
+// $ ossim-info --config
+// 
+// ------------------------------------------------------------------------
+
+//---
+// Elevation setup:
+//
+// Keyword pair: 
+// elevation_source.type
+// elevation_source.filename 
+// 
+// Indicates an elevation source.  These should be listed in pairs.  Numbering
+// should start with 0 with lowest number being the highest resolution.  This
+// can be a cell(file) or a directory.
+// 
+// There are four elevation_source.type types:
+// elevation_source.type: dted_directory
+// elevation_source.type: srtm_directory
+// elevation_source.type: general_raster_directory
+// elevation_source.type: image_directory
+// 
+// The elevation_source.connection_string is a connection for your database.
+// Typically this is a directory location.
+// 
+// NOTES:
+// 
+// 1) Order dependent, i.e. ALWAYS put your highest resolution first.
+//
+// 2) We support bringing cells into memory for dted and srtm datasets.  You can also control the
+// number of open cells by specifying a min and max open cells.  If the number of cells opened
+// exceeds the maximum then it will shrink the active opened cells to the minumum.  We currently
+// use a least recently used algorithm.
+// 
+// 3) A good elevation source is the Shuttle Radar Topographic Mission(SRTM):
+//    http://srtm.usgs.gov/index.php
+//
+// 4) Examples below are defaulted to some value.  To change enabled key to
+//    true, e.g.:
+//    elevation_manager.elevation_source0.enabled: true
+// 
+// 5) Key "extension" is currently for dted only.  If set this disables the scanning for
+//    the extension at start up.  e.g.:
+//    elevation_manager.elevation_source0.extension: .dt2
+// 
+// 6) Key "upcase" is currently for dted only. If true looks for upcased files.
+//    If this is set to true, note that the "extension" should also be upcase.
+//    elevation_manager.elevation_source0.upcase: false
+//    looks for (example): e045/n34.dt2
+//    else:
+//    looks for (example): E045/N34.DT2
+//---
+
+// One arc second post spacing dted, ~30 meters, default enabled:
+elevation_manager.elevation_source0.connection_string: $(OSSIM_DATA)/elevation/dted/level2
+elevation_manager.elevation_source0.enabled: true
+elevation_manager.elevation_source0.extension: .dt2
+elevation_manager.elevation_source0.type: dted_directory
+elevation_manager.elevation_source0.min_open_cells: 25
+elevation_manager.elevation_source0.max_open_cells: 50
+elevation_manager.elevation_source0.memory_map_cells: false
+elevation_manager.elevation_source0.geoid.type: geoid1996
+elevation_manager.elevation_source0.upcase: false
+
+// One arc second post spacing srtm, ~30 meters, default disabled:
+elevation_manager.elevation_source1.connection_string: $(OSSIM_DATA)/elevation/srtm/1arc
+elevation_manager.elevation_source1.enabled: false
+elevation_manager.elevation_source1.type: srtm_directory
+elevation_manager.elevation_source1.mean_spacing: 30
+elevation_manager.elevation_source1.min_open_cells: 25
+elevation_manager.elevation_source1.max_open_cells: 50
+elevation_manager.elevation_source1.memory_map_cells: false
+elevation_manager.elevation_source1.geoid.type: geoid1996
+
+// Three arc seconds post spacing dted, ~90 meters, default enabled:
+elevation_manager.elevation_source2.connection_string: $(OSSIM_DATA)/elevation/dted/level1
+elevation_manager.elevation_source2.enabled: true
+elevation_manager.elevation_source2.extension: .dt1
+elevation_manager.elevation_source2.type: dted_directory
+elevation_manager.elevation_source2.min_open_cells: 25
+elevation_manager.elevation_source2.max_open_cells: 50
+elevation_manager.elevation_source2.memory_map_cells: false
+elevation_manager.elevation_source2.geoid.type: geoid1996
+elevation_manager.elevation_source2.upcase: false
+
+// Three arc seconds post spacing srtm, ~90 meters, default disabled:
+elevation_manager.elevation_source3.connection_string: $(OSSIM_DATA)/elevation/srtm/3arc
+elevation_manager.elevation_source3.enabled: false
+elevation_manager.elevation_source3.type: srtm_directory
+elevation_manager.elevation_source3.mean_spacing: 90
+elevation_manager.elevation_source3.min_open_cells: 25
+elevation_manager.elevation_source3.max_open_cells: 50
+elevation_manager.elevation_source3.memory_map_cells: false
+elevation_manager.elevation_source3.geoid.type: geoid1996
+
+// One Kilometer post spacing, can memory map, default enabled, always last:
+elevation_manager.elevation_source4.connection_string: $(OSSIM_DATA)/elevation/dted/level0
+elevation_manager.elevation_source4.enabled: true
+elevation_manager.elevation_source2.extension: .dt0
+elevation_manager.elevation_source4.type: dted_directory
+elevation_manager.elevation_source4.min_open_cells: 25
+elevation_manager.elevation_source4.max_open_cells: 50
+elevation_manager.elevation_source4.memory_map_cells: true
+elevation_manager.elevation_source4.geoid.type: geoid1996
+elevation_manager.elevation_source4.upcase: false
+
+//---
+// Identity geoid is 0 everywhere, so MSL = Ellipsoid. Useful when DEM
+// provides posts relative to ellipsoid instead of customary MSL. This is
+// specific to each elev database:
+//---
+// elevation_manager.elevation_source3.geoid.type: identity
+
+//---
+// Default height above ellipsoid, for use when no elev data is present, 
+// instead of returning NAN:
+//---
+// elevation_manager.default_height_above_ellipsoid: 0.0
+
+// ---
+// This is n elevation offset that is added to the height returned from the
+// elevation manager.
+// if the value is nan then nothing is added.
+// ---
+//elevation_manager.elevation_offset: nan
+
+//---
+// Allows one to specify to the elevation manager to use the ellipsoid offset
+// as defined by the geoid manager if a getHeightAboveEllipsoid fails.
+//---
+elevation_manager.use_geoid_if_null: true
+
+//---
+// Keyword:  default_elevation_path
+// Default path for the elevation manager popup "Add" to start at.
+//---
+default_elevation_path: $(OSSIM_DATA)/elevation/dted/level2 
+// ---
+
+//---
+// Keyword:  elevation.enabled
+// If disabled calls to the elevation manager getHeightAboveMSL and 
+// getHeightAboveEllipsoid will return a null height.  (default=true)
+// Use: "true", "yes", "y" or "1" to enable, 
+//      "false", "no", "n" or "0" to disable.
+//---
+elevation_manager.enabled:  true
+
+//---
+// Keyword:  elevation.threads
+// Defines the number of instances of elevation databases to maintain for multithreading.
+// Can be boolean "yes" or "true" to use all available cores or an integer value for
+// custom experimentation. Set to "no" (or "false") or 1 for no multithreading capability. 
+// Default is "true".
+//---
+elevation_manager.threads: yes                 
+
+// ---
+// Location of datum grids:
+//
+// Snip from: http://www.ngs.noaa.gov/TOOLS/Nadcon/Nadcon.html
+// 
+// Advances in the accuracies now obtainable in geodetic surveys, specifically
+// through use of differential GPS, has allowed for the creation of state 
+// High Precision Geodetic Networks (HPGNs), also referred to as High Accuracy
+// Reference Networks (HARNs) throughout the country.
+// 
+// Latest ftp location(20100206):
+// ftp://ftp.ngs.noaa.gov/pub/pcsoft/nadcon/
+//
+// ---
+// datum_grids: $(OSSIM_DATA)/ossim/elevation/nadcon-grids
+
+//---
+// Location of other shared files can be accessed using this preference to permit 
+// specifying paths relative to it.
+//---
+ossim_share_directory: $(OSSIM_INSTALL_PREFIX)/share/ossim
+
+//---
+// Look-up tables for European Petroleum Survey Group (EPSG) coded 
+// projections and datums (located in <ossim_share_directory>/projection)
+// These are expected to be delimiter-separated value (*.csv|tsv) files.
+// NOTE: ESRI codes are NOT EPSG codes, however, they do not conflict with 
+// EPSG so ingesting them as if they were EPSG. Eventually, separate 
+// databases or a multi-Db solution may need to be 
+// implemented. OLK 05/2010
+// --- 
+epsg_database_file0: projection/ossim_epsg_projections-v7_4.csv
+epsg_database_file1: projection/ossim_harn_state_plane_epsg.csv
+epsg_database_file2: projection/ossim_state_plane_spcs.csv
+epsg_database_file3: projection/ossim_harn_state_plane_esri.csv
+
+// Database file for WKT-based projection factory 
+// (located in <ossim_share_directory>/ossim/projection):
+wkt_database_file: projection/ossim_wkt_pcs.csv
+
+//---
+// Geoid support:
+// Note:  Since the sensor models do earth intersects at height above the 
+//        ellipsoid and the vertical datum of DTED is geoid_egm_96_grid, you
+//        should have a geoid grid in place for accurate earth intersections.
+//---
+
+//---
+// Generic geoid support:
+// Specifying a "geoid_manager.geoid_source0.type: geoid_image" uses an image handler
+// based geoid reader.  So this can be any type of image, i.e. tiff, raster, provided
+// it can be opened and a good image geometry is returned.
+// 
+// In the below example for geoid_manager.geoid_source0 an external geometry file was
+// created for Und_min1x1_egm2008_isw_equal_82_WGS84_TideFree_SE.ras.
+//---
+geoid_manager.geoid_source0.connection_string: $(OSSIM_DATA)/elevation/geoids/egm2008/Und_min1x1_egm2008_isw_equal_82_WGS84_TideFree_SE.ras
+geoid_manager.geoid_source0.enabled: true
+geoid_manager.geoid_source0.geoid.type: egm2008
+geoid_manager.geoid_source0.memory_map: false
+geoid_manager.geoid_source0.type: geoid_image
+
+//---
+// GEOID 99:  Set keyword to the directory containing the GEOID 99 grids.
+// 
+// Notes:  
+// - Grids MUST be in the native byte order.
+// - Can be downloaded from:
+// http://www.ngs.noaa.gov/GEOID/GEOID99
+// ---
+// geoid_99_directory:  $(OSSIM_DATA)/ele1/geoid/geoid99
+
+//---
+// Generic support has been added to each NGS geoid grid. You can download
+// ngs grids for 1999, 2003.
+// Current release only allows for a single directory we will allow for
+//  multiple directories later and auto detecting if possible.
+//
+// Currently the file names are hard coded and need to be from the NGS 
+// distribution also downloadable from ftp.remotesensing.org under
+// /ossim/test_data.tgz
+//---
+geoid_ngs_directory: $(OSSIM_DATA)/elevation/geoids/geoid99
+geoid_ngs_directory.byte_order: little_endian
+// geoid_ngs_directory.byte_order: big_endian
+
+//---
+// GEOID EGM 96:  Set keyword to the path to the egm96.grd
+// 
+// Notes:
+// - Grid must be in BIG ENDIAN (UNIX) format.
+// - Can be downloaded from svn:
+// svn co http://svn.osgeo.org/ossim/trunk/ossim_package_support/geoids geoids
+//---
+geoid_egm_96_grid: $(OSSIM_INSTALL_PREFIX)/share/ossim/geoids/egm96.grd
+
+// ---
+// Font support:
+// NOTE:  To use the MapCompositionSource you must at least have "font.dir1"
+//        set to some default.
+// ---
+// font.file1: /usr/share/fonts/default/Type1/b018032l.pfb
+// font.dir1: /usr/share/fonts/default/Type1
+font.dir0: $(OSSIM_INSTALL_PREFIX)/share/ossim/fonts
+
+
+//---
+// OSSIM plugin support:
+//
+// Notes:
+//
+// View plugins with:
+//
+// $ ossim-info --plugins
+//
+// To troubleshoot problems  embedded trace debug can be turned on using 
+// "ossimDynamic". Example:
+//
+// $ ossim-info -T ossimDynamic --plugins 
+//
+// ossimDynamicLibrary::load DEBUG:
+// Loaded library:  /usr/local/lib/libossimpng_plugin.so
+// ossimDynamicLibrary::load DEBUG:
+// Loaded library:  /usr/local/lib/libossimgdal_plugin.so
+// ossimDynamicLibrary::load DEBUG:
+// Loaded library:  /usr/local/lib/libossimreg_plugin.so
+// ossimDynamicLibrary::load DEBUG:
+// Loaded library:  /usr/local/lib/libossimcontrib_plugin.so
+//
+// Keywords:
+// 
+// plugin0.file: <path to>/libossim_kakadu_plugin
+// plugin0.options: """
+//                  read_factory.location: front
+//                  writer_factory.location: back
+//                  """
+// 
+// OLD style with no options:
+//
+// plugin.file1: < full path and file name >
+// plugin.dir1:  < directory where plugins are >
+//---
+
+// Example, edit/uncomment as needed:
+plugin0.file:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_png_plugin.so
+// plugin0.options:
+
+// NTM plugin, alway make second plugin:
+plugin1.file1: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_ntm_plugin.so
+plugin1.options:
+
+plugin3.file:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_aws_plugin.so
+// plugin3.options:
+
+plugin5.file:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_kakadu_plugin.so
+// plugin5.options:
+
+// plugin10.file:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_jpeg12_plugin.so
+// plugin10.options:
+
+plugin15.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_mrsid_plugin.so
+// plugin15 .options:
+
+plugin20.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_cnes_plugin.so
+// plugin20.options:
+
+plugin30.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_sqlite_plugin.so
+// plugin30.options:
+
+// plugin35.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_potrace_plugin.so
+// plugin35.options:
+
+plugin40.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_web_plugin.so
+// plugin40.options:
+
+plugin45.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_kml_plugin.so
+// plugin45.options:
+
+plugin50.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_ndf_plugin.so
+// plugin50.options:
+
+plugin55.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_geopdf_plugin.so
+// plugin55.options:
+
+// plugin60.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_opencv_plugin.so
+// plugin60.options:
+
+// plugin70.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_openjpeg_plugin.so
+// plugin70.options:
+
+// plugin80.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_pdal_plugin.so
+// plugin80.options:
+
+//---
+// Always put gdal last as it has duplicate readers and need to pick ours up
+// first.
+//---
+//plugin85.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_gdal_plugin.so
+// plugin85.options:
+
+//---
+// Old style with no options keyword:
+//---
+
+// plugin.file0:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_png_plugin.so
+
+// NTM plugin, alway make second plugin:
+// plugin.file1: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_ntm_plugin.so
+
+// plugin.file3:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_aws_plugin.so
+// plugin.file5:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_kakadu_plugin.so
+// plugin.file10:  $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_jpeg12_plugin.so
+// plugin.file15: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_mrsid_plugin.so
+// plugin.file20: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_cnes_plugin.so
+// plugin.file30: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_sqlite_plugin.so
+// plugin.file35: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_potrace_plugin.so
+// plugin.file40: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_web_plugin.so
+// plugin.file45: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_kml_plugin.so
+// plugin.file50: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_ndf_plugin.so
+// plugin.file55: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_geopdf_plugin.so
+// plugin.file60: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_opencv_plugin.so
+// plugin.file70: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_openjpeg_plugin.so
+// plugin.file80: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_pdal_plugin.so
+
+//---
+// Always put gdal last as it has duplicate readers and need to pick ours up
+// first.
+//---
+// plugin.file65: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_gdal_plugin.so
+//
+// END OSSIM plugin support
+//---
+
+
+// Toggles for recceVue application:
+statusLatLon: true
+statusHeight: true
+statusDatum: true
+statusGSD: true
+statusUpdateOnClick: true
+
+
+// ---
+// Keyword: cache_size
+// The cache size is in megabytes.
+// ---
+// cache_size: 256
+// cache_size: 512
+cache_size: 1024
+// cache_size: 2048
+
+
+// ---
+// Keyword: overview_stop_dimension
+//
+// Affects any overview building from img2rr, imagelinker, iview. Controls
+// the amount of resLevels created.  This is also used to control the amount
+// of levels the J2K writers use from the kakadu plugin.
+// 
+// This is the point where "img2rr" or the overview builder will stop 
+// decimating the image down.  So in other words, if the 
+// overview_stop_dimension keyword is 64, img2rr application will build 
+// overviews, decimating each level by 2 until both the width and height are 
+// less than or equal to 64.  Note the larger the dimension the less levels
+// created.
+// 
+// Uncomment one below.
+// ---
+overview_stop_dimension: 8
+// overview_stop_dimension: 16
+// overview_stop_dimension: 32
+// overview_stop_dimension: 64
+// overview_stop_dimension: 128
+// overview_stop_dimension: 256
+// overview_stop_dimension: 512
+
+// ---
+// Keyword: overview_builder.scan_for_min_max_null_if_float
+// 
+// Control overview sequencer scanning for min, max, nulls for float data. If
+// true and input data is float scalar type scanning will be performed and a
+// dot.omd file will be written with the min, max, nulls in it.
+// 
+// Type: boolean, set to true, false, 1, 0
+// 
+// CAUTION: Because the j2k overview builder requires the min/max up front for 
+// normalization this is NOT a good option to turn on.  In other word if you
+// are doing ossim-img2rr -r -t ossim_kakadu_nitf_j2k <float-image> you should
+// disable this and set the min/max with ossim-cmm(compute min max) or do it
+// manually.
+// ---
+// overview_builder.scan_for_min_max_null_if_float: true
+
+// ---
+// Keyword: tile_size
+//
+// Tile size x y
+//
+// Affects all ossim application.  This is the internal tile size of any
+// image chain unless overridden by the filter.
+// 
+// Notes: 
+// 1) OSSIM can handle any tile size; however it is best to use a size that
+// is a power of two.
+// 2) 
+// 
+// Uncomment one below.  
+// ---
+// tile_size: 32 32
+ tile_size: 64 64
+// tile_size: 128 128
+//tile_size: 256 256
+// tile_size: 512 512
+// tile_size: 1024 1024
+
+
+// ---
+// Keyword: shapefile_colors_auto
+// 
+// Shape file colors set to automatic.
+// This is a boolean value.  If true pen and brush color of shape files will
+// be determined by indexing a color table in a round robin approach.  If set 
+// to true the auto colors override keywords for "pen" and "brush" color.
+// Default value if not found if "false".
+// 
+// Value can be: true, yes, y, 1, false, no, n or 0
+// ---
+shapefile_colors_auto: false
+
+// ---
+// Shape file pen color:
+// Three values for red, green and blue between 0 and 1.0 with 1.0 being 
+// brightness and 0.0 being black.
+// ---
+shapefile_normalized_rgb_pen_color: 0.004 1.0 0.004
+
+// ---
+// Shape file pen color:
+// Three values for red, green and blue between 0 and 1.0 with 1.0 being 
+// brightness and 0.0 being black.
+// ---
+shapefile_normalized_rgb_brush_color: 0.004 1.0 0.004
+
+// ---
+// Shape file point size:
+// Width and height for points in pixels.
+// ---
+shapefile_point_size: 6.0 6.0
+
+
+// --------------------------
+// Some keywords for the OSSIM GUI application
+//
+//
+// igen spec files output./  This is the directory location you would
+// like the igen export GUI to default to when outputing spec files
+ossim.igen_spec_output_directory: /work/gpotts/igen_test
+
+// this is the igen executable.  Make sure you put the full path
+ossim.igen_executable:  /work/gpotts/ossim/bin/igen
+
+// END keywords for OSSIM GUI
+//--------------------------
+
+// ---
+// Position Quality Evaluator (PQE) keywords. 
+// Note Circulay Error(CE) and Linear Error (LE)  units are in meters.
+// These keywords are for the imagelinker->image-window->PQE dialog box.
+// They allow the user to calculater position quality factoring in backdrop
+// and elevation uncertainty.
+// ---
+
+// Backdrop enter "name,ce90,le90" like "JOG-A,77,38".
+pqe_backdrop1: TLM50,31,25
+pqe_backdrop2: TLM100,61,25
+pqe_backdrop3: JOG-A,77,38
+pqe_backdrop4: TPC,613,47
+pqe_backdrop5: ONC,1226,93
+pqe_backdrop6: JNC,2452,187
+pqe_backdrop7: GNC,6129,465
+
+// Elevation enter "name,ce90,le90" like "SRTM_1ARC,20,16"
+// Accuracies vary widely depending on terrain and how they were computed.
+// These are just examples.
+pqe_elev1: SRTM_3ARC,20,16
+pqe_elev2: SRTM_1ARC,20,10
+pqe_elev3: DTED_LEVEL2,40,20
+pqe_elev4: DTED_LEVEL1,50,30
+pqe_elev5: RPC_No_DEM_State,-2,-1.6449
+// Special Case
+// RPC_No_DEM_State, Scale Divisor, 1-Sigma Divisor (minus signs required)
+
+pqe_normalized_rgb_ellipse_color: 0.004 1.0 0.004
+
+// End of PQE keywords...
+
+// ---
+// Log file support:  If set all output from ossimNotify to stdout and to 
+// stderr will be written to the log file.  Optionally users of ossim 
+// applications can use the "--ossim-logfile <some_file>" command line 
+// argument.  Note that the "--ossim-logfile" command line argument overrides
+// the preference setting.
+// 
+// Uncomment and set path to use log file:
+// ---
+// ossim.log.file: D:\tmp\ossim-log.txt
+
+// ---
+// Kakadu threads:
+// ---
+kakadu_threads: 4
+
+// ---
+// ossim threads:
+// ---
+ossim_threads: 4
+
+//---
+// Keyword for ingesting terrasar-x and radarsat-2 data. When TRUE, instructs
+// the sensor model to create an ossim coarse grid replacement model to
+// improve performance geometric_sar_sensor_model.create_ocg: true
+// Keyword parsed presently by orthoigen. If true, histograms will be
+// computed when needed for all images that do not yet have a histogram. 
+//---
+autogenerate_histogram: true
+
+//---
+// specify true or fals if you want the ossimInit to look in the current 
+// program path to see if any plugins are available.  Turn this off if you 
+// want to load them from a keyword list and remove the need to scan the 
+// directory for valid plugins
+//---
+ossim_init.auto_load_plugins: false
+
+//---
+// When true, indicates to orthoigen application that the specified cut
+// rectangle for the product shall be adjusted to fit the minimum bounding
+// valid image rect. This eliminates null exterior pixels when the cut rect
+// extends beyond the valid image rect. This preference can be overriden
+// by an option on the orthoigen command line. See the usage on orthoigen.
+// [default is false]
+//---
+orthoigen.clip_to_valid_rect: false
+
+//---
+// Specifies the preference for remapping null-valued pixels to 1 (min).
+// Possible settings are:
+// "none" -- Bypasses pixel flipper
+// "all_nulls" -- replaces any occurrence of the null value with 1. 
+//    Ex: (20,0,10) becomes (20,1,10), also (0,0,0) becomes (1,1,1)
+// "only_partial_nulls" -- 
+// replaces null-valued band only if another band is non-null.
+//    Ex: (20,0,10) becomes (20,1,10), but (0,0,0) is not remapped.
+// "all_bands_if_partial_null" -- 
+// Remaps all bands of a pixel if even one band is null.
+//    Ex: (20,0,10) becomes (1,1,1), but (0,0,0) is not remapped
+// "only_full_nulls" -- Remaps pixel only if all bands are null.
+//    Ex: (0,0,0) becomes (1,1,1), but (20,0,10) is not remapped
+//---
+orthoigen.flip_null_pixels: none
+
+// ---
+// NITF writer site configuration file:
+// ---
+// nitf_writer.site_configuration_file: $(OSSIM_DATA)/ossim/share/nitf-site-configuration.kwl
+
+// TFRD support files(ntm plugin):
+tfrd_fq_file: $(OSSIM_INSTALL_PREFIX)/share/ossim/tfrd-tables/fq.dat
+tfrd_iamp_file: $(OSSIM_INSTALL_PREFIX)/share/ossim/tfrd-tables/oamt.dat
+
+//----
+// HDF5 READER
+//----
+// allows on to specify configuration options and parsing for the hdf5 plugin
+// In this example we have only the Radiance file supported for VIIRS data
+// to get a listing of dataset use the ossim-info -d on any hdf5 dataset file
+// and look at the top for the dataset comma seperated list of dataset paths.
+// You can add a comma seperated list for renderable_datasets and only those will show
+// up in an ossim-info
+// 
+hdf5.options.max_recursion_level: 8
+hdf5.options.renderable_datasets: /All_Data/VIIRS-DNB-SDR_All/Radiance
+
+
+//-------
+// AWS plugin settings
+//-------
+//
+// We can specify the S3 read block size.
+// You can give it a numerical value and end it with B, K, M, or G.
+// which stand for Bytes, Kilobytes, Megabytes or Gigabytes.
+//
+//  So a value of 1k means 1024 bytes
+//  A value of 1024k is equivalent to 1M or one megabyte
+//
+ossim.plugins.aws.s3.readBlocksize: 1M
+
+// Override default aws region:
+// ossim.plugins.aws.s3.region: us-iso-east-1
+ossim.plugins.aws.s3.region: us-east-1
+
+// We can specify the S3 open file for read entries to cache.
+//
+// here we say we can remember 10000 different files and cache their sizes so 
+// we do not have to query the content length
+// If it exceeds this limit then the cache will shrink down by 20%.
+//
+ossim.plugins.aws.s3.nReadCacheHeaders: 10000
+
+//---
+// Turn on/off progress output to console standard output. Code
+// auto detects if running in a console window; hence, typically this is not
+// needed.
+// values: 0, 1, true or false
+// default = commented out / auto-detected.
+//---
+// ossim.std.out.progress: 1
+
+
+//---
+// If you have the ossim-web-plugin installed then these options are available
+//
+//
+// Uncomment to add a Certificate Authority for CERT verification
+// Sometimes this is not needed and the client Cert and key is all that is needed.
+//
+//ossim.plugins.web.curl.cacert: 
+
+// Uncomment to add a client certificate file. 
+//ossim.plugins.web.curl.clientCert: 
+
+// Uncomment and specify the type of the client certificate
+// P12 or PEM
+//ossim.plugins.web.curl.clientCertType: P12
+
+// If the client private key is not bundled in the clientCert then you can specify the key 
+// here.
+//
+//ossim.plugins.web.curl.clientKey:
+
+// If a password is on your private key file then specify it here. 
+//ossim.plugins.web.curl.clientKeyPassword:
+/---
diff --git a/ossim/share/ossim/templates/sample_applanix_camera.kwl b/share/ossim/templates/sample_applanix_camera.kwl
similarity index 100%
rename from ossim/share/ossim/templates/sample_applanix_camera.kwl
rename to share/ossim/templates/sample_applanix_camera.kwl
diff --git a/ossim/share/ossim/templates/shapefile_template.omd b/share/ossim/templates/shapefile_template.omd
similarity index 100%
rename from ossim/share/ossim/templates/shapefile_template.omd
rename to share/ossim/templates/shapefile_template.omd
diff --git a/ossim/share/ossim/templates/usgs_dem_template.kwl b/share/ossim/templates/usgs_dem_template.kwl
similarity index 100%
rename from ossim/share/ossim/templates/usgs_dem_template.kwl
rename to share/ossim/templates/usgs_dem_template.kwl
diff --git a/ossim/share/ossim/templates/utm_projection_template.geom b/share/ossim/templates/utm_projection_template.geom
similarity index 100%
rename from ossim/share/ossim/templates/utm_projection_template.geom
rename to share/ossim/templates/utm_projection_template.geom
diff --git a/share/ossim/util/ossimChipProcUtil.json b/share/ossim/util/ossimChipProcUtil.json
new file mode 100644
index 0000000..9ab642a
--- /dev/null
+++ b/share/ossim/util/ossimChipProcUtil.json
@@ -0,0 +1,91 @@
+{
+    "name": "ossimChipProcUtil",
+    "description": {
+        "version" : "1.00",
+        "short_description": "OSSIM HLZ Utility",
+        "long_description": "Utility for finding suitable helicopter landing zones surrounding a speciflzied target location."
+     },
+     "inputs": {
+        "elev_sources": {
+            "datatype": "list:file:elevation",
+            "description": "Optional DEM file to use in lieu of default elevation database.",
+            "required": false    
+        },
+        "gsd": {
+            "datatype": "double:positive_range",
+            "description": "Product resolution in meters-per-pixel. Defaults to the best resolution of elevation files referenced.",
+            "required": false    
+        },
+        "lut": {
+            "datatype": "file:text",
+            "description": "Specifies the optional lookup table filename for mapping the single-band output image to an RGB. The LUT provided must be in the ossimIndexToRgbLutFilter format and must handle the three output viewshed values (see --values option).",
+            "required": false    
+        },
+        "reticle": {
+            "datatype": "int:positive_range",
+            "description": "Size (in pixels) of reticle centered on observer's position. If non-zero, a border is drawn delineating the ROI.",
+            "required": false    
+        },
+        "rlz": {         
+            "datatype": "double:positive_range",
+            "description": "Radius of interest (meters)",
+            "required": true    
+        },
+        "roi": {         
+            "datatype": "double:positive_range",
+            "description": "Radius of interest surrounding the target (meters)",
+            "required": true    
+        },
+        "roughness": {         
+            "datatype": "double:positive_range",
+            "description": "Threshold for acceptable landing zone terrain roughness (meters).",
+            "required": false    
+        },
+        "slope": {         
+            "datatype": "double:positive_range",
+            "description": "Threshold for acceptable landing zone terrain slope (deg).",
+            "required": false    
+        },
+        "target": {         
+            "datatype": "geo_pos_2d",
+            "description": "Geographic position of target (lat-deg, lon-deg)",
+            "required": true   
+        },
+        "threat-domes": {
+            "datatype": "file:text",
+            "description": "Optional file containing threat dome specifications.",
+            "required": false    
+        },
+        "viewsheds": {
+            "datatype": "file:text",
+            "description": "Optional file containing specifications of observers used in identifying visible or hidden LZs.",
+            "required": false    
+        },
+        "bad_zone_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing unsuitable terrain.",
+            "required": false    
+        },
+        "marginal_zone_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing marginal terrain.",
+            "required": false    
+        },
+        "good_zone_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing good terrain.",
+            "required": false    
+        },
+        "outputFile": {
+            "datatype": "url:wms",
+            "description": "The URL/filename of the WMS server where the file is now accessible",
+            "required": true
+        }
+    },
+    "outputs": { },
+    "ranges" : {
+       "azimuth_range": [ 0.0, 360.0 ],
+       "positive_range": [ 0, "+inf"],
+       "byte_range": [ 0, 255 ]
+    }
+}
diff --git a/share/ossim/util/ossimChipProcUtil.kwl b/share/ossim/util/ossimChipProcUtil.kwl
new file mode 100644
index 0000000..aed0295
--- /dev/null
+++ b/share/ossim/util/ossimChipProcUtil.kwl
@@ -0,0 +1,66 @@
+//***************************************************************
+// Template KWL for all chip-processor utilities.
+// See ossimUtility.kwl for common keywords also referenced.
+//***************************************************************
+
+// *** Specifications of Area-of-Interest (AOI) can be in various forms ***
+aoi_geo_rect: <min_lat> <min_lon> <max_lat> <max_lon>
+// or
+aoi_map_rect: <min_x> <min_y> <max_x> <max_y>
+// or
+aoi_geo_center: <lat> <lon>
+
+// When aoi_geo_center provided, the AOI must also include the size as follows:
+aoi_size_meters: <DX> <DY>
+// or
+aoi_size_pixels:  <DX> <DY>
+
+// *** End of AOI specification ***
+
+// Indicate the desired projection origin/zone (used for latitude scaling of geographic projection
+// or selecting UTM zone):
+central_meridian: <lon>
+origin_latitude: <lat>
+hemisphere: N|S
+zone: <utm_zone>
+
+// Specifies any number of input image filenames. Also can optionally specify band selection for 
+// multispectral and entry index for multi-image files:
+image_file<n>: <image_file>
+image_file<n>.bands: <R> <G> <B>
+image_file<n>.entry: <int>
+
+// Reader properties (applies to all input images):
+reader_property<n>: <key=value>
+
+// Specifies any number of input DEM filenames. If none provided, the elevation database is referenced 
+// as specified in prefs file for the center and ROI specified.
+elevation_source<n>: <dem_file>
+
+// Specify product resolution in meters per pixel:
+gsd: <meters>
+
+// Output product filename:
+output_file: <image_file>
+
+// Product pixel radiometry. The 'N' entries mean "normalized":
+output_radiometry: U8 | S8 | U11 |U16 | S16 | F32 | F64 | N32 | N64
+
+// Output projection specification:
+projection: geo | geo-scaled | input | utm | identity
+// or
+srs: <epsg code>
+
+// If true, forces the output scene tie-point to be set to the projection origin location:
+snap_tie_to_origin: true|false
+
+// Specifies the optional lookup table filename for mapping the single-band output 
+// image to an RGB. The LUT provided must be in the ossimIndexToRgbLutFilter format 
+// and should accomodate the output pixel range. 
+lut_file: <lut_file>
+
+// Specifies to product writer the size of the output file's tiling in pixels (always square):
+tile_size: <int>
+
+// Geographic polygon defining a clip region that excludes all imagery outside the polygon
+clip_poly_lat_lon: (lat1, lon1) (lat2, lon2) (lat3, lon3) [...]
diff --git a/share/ossim/util/ossimHillshadeUtil.kwl b/share/ossim/util/ossimHillshadeUtil.kwl
new file mode 100644
index 0000000..14eb486
--- /dev/null
+++ b/share/ossim/util/ossimHillshadeUtil.kwl
@@ -0,0 +1,20 @@
+//***********************************
+// Template KWL for Hillshade Utility.
+//***********************************
+type: ossimHillshadeUtil
+
+#include ossimChipProcUtil.kwl
+
+// Sun elevation and azimuth angle:
+elevation_angle: <degrees>
+azimuth_angle: <degrees>
+
+// Color of shadow instead of grayscale
+color_red: <0-255> 
+color_green: <0-255> 
+color_blue: <0-255> 
+
+// List of raster image(s) to use as a color source
+color_source: <file1>
+
+
diff --git a/share/ossim/util/ossimHlzUtil.json b/share/ossim/util/ossimHlzUtil.json
new file mode 100644
index 0000000..91f464b
--- /dev/null
+++ b/share/ossim/util/ossimHlzUtil.json
@@ -0,0 +1,66 @@
+{
+    "name": "ossim-hlz",
+    "description": {
+        "version" : "1.00",
+        "short_description": "OSSIM HLZ Utility",
+        "long_description": "Utility for finding suitable helicopter landing zones surrounding a speciflzied target location."
+     },
+     "inputs": {
+        "exclude_regions": {         
+            "datatype": "list:string:csv_file",
+            "description": "List of raster image(s) representing mask files that defines regions to be excluded from HLZ solutions",
+            "required": false    
+        },
+        "include_regions": {         
+            "datatype": "list:file:csv_file",
+            "description": "List of raster image(s) representing mask files that defines regions that must be included in HLZ solutions",
+            "required": false    
+        },
+        "max_roughness": {         
+            "datatype": "double:positive_range",
+            "description": "Threshold for acceptable landing zone terrain roughness (meters).",
+            "required": false    
+        },
+        "max_slope": {         
+            "datatype": "double:positive_range",
+            "description": "Threshold for acceptable landing zone terrain slope (deg).",
+            "required": false    
+        },
+        "min_lz_radius": {         
+            "datatype": "double:positive_range",
+            "description": "Minimum radius of landing zone (meters)",
+            "required": true    
+        },
+        "point_clouds": {
+            "datatype": "list:file:csv",
+            "description": "Specifies list of ancillary point-cloud data for level-2 search for obstructions.",
+            "required": false    
+        },
+        "hlz_coding": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing unsuitable terrain.",
+            "required": false    
+        },
+        "marginal_zone_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing marginal terrain.",
+            "required": false    
+        },
+        "good_zone_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing good terrain.",
+            "required": false    
+        },
+        "outputFile": {
+            "datatype": "url:wms",
+            "description": "The URL/filename of the WMS server where the file is now accessible",
+            "required": true
+        }
+    },
+    "outputs": { },
+    "ranges" : {
+       "azimuth_range": [ 0.0, 360.0 ],
+       "positive_range": [ 0, "+inf"],
+       "byte_range": [ 0, 255 ]
+    }
+}
diff --git a/share/ossim/util/ossimHlzUtil.kwl b/share/ossim/util/ossimHlzUtil.kwl
new file mode 100644
index 0000000..bce5b30
--- /dev/null
+++ b/share/ossim/util/ossimHlzUtil.kwl
@@ -0,0 +1,36 @@
+//***********************************
+// Template KWL for HLZ Utility.
+//***********************************
+type: ossimHlzUtil
+
+#include ossimChipProcUtil.kwl
+
+// List of raster image(s) representing mask files that defines regions to be excluded from HLZ 
+// solutions. Any non-zero pixel represents an exclusion zone.
+excludes1: <file1>
+excludes2: <file2>
+
+// Specifies the pixel values (0-255) for the output product corresponding to bad, marginal, and 
+// good landing zones, respectively. Defaults to bad=255 (null), marginal=128, and good=64.
+hlz-coding: <bad> <marginal> <good>
+
+// List of raster image(s) representing mask files that defines regions where the HLZs
+// identified must overlap. Any non-zero pixel represents an inclusion zone. 
+includes1: <file1>
+includes2: <file2>
+
+// Specifies minimum radius of landing zone. Defaults to 25 m.
+lz_min_radius: <meters>
+
+// Specifies ancillary point-cloud data file(s) for level-2 search for obstructions.
+point_cloud_file1: <file1>
+point_cloud_file2: <file2>
+
+// Specifies the terrain roughness threshold (meters). This is the maximum deviation from a 
+// flat plane permitted. Defaults to 0.5 m. Valid only with ls-fit used.
+roughness_threshold: <meters>
+
+// Threshold for acceptable landing zone terrain slope. Defaults to 7 deg.
+slope_threshold: <degrees>
+
+
diff --git a/share/ossim/util/ossimInfo.kwl b/share/ossim/util/ossimInfo.kwl
new file mode 100644
index 0000000..64fea9e
--- /dev/null
+++ b/share/ossim/util/ossimInfo.kwl
@@ -0,0 +1,40 @@
+//***************************************************************
+// Template KWL for ossimInfo utility.
+// See ossimUtility.kwl for common keywords also referenced.
+//***************************************************************
+
+image_file: <image_file>
+build_date: <value>
+center_ground: <value>
+center_image: <value>
+configuration: <value>
+datums: <value>
+dump: <value>
+dump_no_overviews: <value>
+factories: <value>
+factory_keyword_list: <value>
+factory_object: <value>
+factory_type: <value>
+format: <value> 
+geometry_info: <value>
+image_center: <value>
+image_info: <value>
+image_rect: <value>
+metadata: <value>
+north_up_angle: <value>
+output_file: <value>
+ossim_logfile: <value>
+overview_types: <value>
+overwrite: <value>
+palette: <value>
+plugins: <value>
+projections: <value>
+reader_props: <value>
+resampler_filters: <value>
+revision_number: <value>
+up_is_up_angle: <value>
+version: <value>
+writers_kw: <value>
+writer_props: <value>
+zoom_level_gsds: <value>
+
diff --git a/share/ossim/util/ossimOrthoUtil.kwl b/share/ossim/util/ossimOrthoUtil.kwl
new file mode 100644
index 0000000..b644116
--- /dev/null
+++ b/share/ossim/util/ossimOrthoUtil.kwl
@@ -0,0 +1,8 @@
+//***************************************************************
+// Template KWL for Ortho Utility.
+// See ossimChipProcUtil.kwl for common keywords also referenced
+//***************************************************************
+type: ossimOrthoUtil
+
+#include ossimChipProcUtil.kwl
+
diff --git a/share/ossim/util/ossimShorelineUtil.json b/share/ossim/util/ossimShorelineUtil.json
new file mode 100644
index 0000000..6933c21
--- /dev/null
+++ b/share/ossim/util/ossimShorelineUtil.json
@@ -0,0 +1,20 @@
+{
+    "name": "ossim-shoreline",
+    "description": {
+        "version" : "1.00",
+        "short_description": "OSSIM Shoreline Utility",
+        "long_description": "Utility for extracting the shoreline as a raster edge detection given input image(s)."
+     },
+     "inputs": {
+        "gsd": {
+            "datatype": "double:positive_range",
+            "description": "Product resolution in meters-per-pixel. Defaults to the best resolution of elevation files referenced.",
+            "required": false    
+        },
+        "outputFile": {
+            "datatype": "url:wms",
+            "description": "The URL/filename of the WMS server where the file is now accessible",
+            "required": true
+        },
+    "outputs": { }
+}
diff --git a/share/ossim/util/ossimShorelineUtil.kwl b/share/ossim/util/ossimShorelineUtil.kwl
new file mode 100644
index 0000000..bfd8555
--- /dev/null
+++ b/share/ossim/util/ossimShorelineUtil.kwl
@@ -0,0 +1,17 @@
+//***************************************************************
+// Template KWL for Shoreline Utility.
+// See ossimChipProcUtil.kwl for common keywords also referenced
+//***************************************************************
+#include ossimChipProcUtil.kwl
+
+type: ossimShorelineUtil
+
+// Accepts pixel value coding as:  <land> <marginal> <water> (range 0-255) 
+color_coding: 255 128 0
+
+// Threshold for index cutoff between land and water:
+threshold: 0.55
+
+// tolerance +- deviation from threshold for marginal classifications
+tolerance: 0
+
diff --git a/ossim/share/ossim/util/ossimSlopeApi.json b/share/ossim/util/ossimSlopeUtil.json
similarity index 100%
copy from ossim/share/ossim/util/ossimSlopeApi.json
copy to share/ossim/util/ossimSlopeUtil.json
diff --git a/share/ossim/util/ossimSlopeUtil.kwl b/share/ossim/util/ossimSlopeUtil.kwl
new file mode 100644
index 0000000..bc2bf16
--- /dev/null
+++ b/share/ossim/util/ossimSlopeUtil.kwl
@@ -0,0 +1,8 @@
+//***************************************************************
+// Template KWL for Slope Utility.
+// See ossimChipProcUtil.kwl for common keywords also referenced
+//***************************************************************
+type: ossimSlopeUtil
+
+#include ossimChipProcUtil.kwl
+
diff --git a/ossim/share/ossim/util/ossimSlopeApi.json b/share/ossim/util/ossimSlopeUtilX.json
similarity index 100%
rename from ossim/share/ossim/util/ossimSlopeApi.json
rename to share/ossim/util/ossimSlopeUtilX.json
diff --git a/share/ossim/util/ossimViewshedUtil.json b/share/ossim/util/ossimViewshedUtil.json
new file mode 100644
index 0000000..f4f0954
--- /dev/null
+++ b/share/ossim/util/ossimViewshedUtil.json
@@ -0,0 +1,86 @@
+{
+    "name": "ossim-viewshed",
+    "description": {
+        "version" : "1.00",
+        "short_description": "OSSIM Viewshed Utility",
+        "long_description": "Utility for computing the viewshed from a given observer position for a specified area of interest."
+     },
+     "inputs": {
+        "radius": {         
+            "datatype": "double:positive_range",
+            "description": "Radius of interest (meters)",
+            "required": true    
+        },
+        "observer": {         
+            "datatype": "geo_pos_2d",
+            "description": "Geographic position of observer (lat-deg, lon-deg)",
+            "required": true   
+        },
+        "fovStart": {
+            "datatype": "int:azimuth_range",
+            "description": "FOV starting azimuth for clockwise sweep (deg).",
+            "required": false    
+        },
+        "fovEnd": {
+            "datatype": "int:azimuth_range",
+            "description": "FOV ending azimuth for clockwise sweep (deg).",
+            "required": false    
+        },
+        "dem": {
+            "datatype": "file:elevation",
+            "description": "Optional DEM file to se in lieu of default elevation database.",
+            "required": false    
+        },
+        "eyeHeight": {
+            "datatype": "double:positive_range",
+            "description": "eye height (meters)",
+            "required": false    
+        },
+        "gsd": {
+            "datatype": "double:positive_range",
+            "description": "Product resolution in meters-per-pixel. Defaults to the best resolution of elevation files referenced.",
+            "required": false    
+        },
+        "reticle": {
+            "datatype": "int:positive_range",
+            "description": "Size (in pixels) of reticle centered on observer's position. If non-zero, a border is drawn delineating the ROI.",
+            "required": false    
+        },
+        "lut": {
+            "datatype": "file:text",
+            "description": "Specifies the optional lookup table filename for mapping the single-band output image to an RGB. The LUT provided must be in the ossimIndexToRgbLutFilter format and must handle the three output viewshed values (see --values option).",
+            "required": false    
+        },
+        "visible_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing visible terrain.",
+            "required": false    
+        },
+        "hidden_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) for the pixels representing hidden terrain.",
+            "required": false    
+        },
+        "reticle_index": {
+            "datatype": "int:byte_range",
+            "description": "Specifies the pixel values (0-255) to use for the reticle and borders.",
+            "required": false    
+        },
+        "outputFile": {
+            "datatype": "url:wms",
+            "description": "The URL/filename of the WMS server where the file is now accessible",
+            "required": true
+        },
+        "horizonFile": {
+            "datatype": "url:wms",
+            "description": "If specified, outputs the max elevation angles for all azimuths to specified URL/filename, for horizon profiling.",
+            "required": false    
+        }
+    },
+    "outputs": { },
+    "ranges" : {
+       "azimuth_range": [ 0.0, 360.0 ],
+       "positive_range": [ 0, "+inf"],
+       "byte_range": [ 0, 255 ]
+    }
+}
diff --git a/share/ossim/util/ossimViewshedUtil.kwl b/share/ossim/util/ossimViewshedUtil.kwl
new file mode 100644
index 0000000..2163dae
--- /dev/null
+++ b/share/ossim/util/ossimViewshedUtil.kwl
@@ -0,0 +1,38 @@
+//***********************************
+// Template KWL for Viewshed Utility.
+//***********************************
+type: ossimViewshedUtil
+
+#include ossimChipProcUtil.kwl
+
+// Optional arguments specifying the field-of
+// -view boundary azimuths (in degrees). By default, a 360 deg FOV is
+//  computed. The arc is taken clockwise from start to end, so for a
+//  FOV of 225 deg from W, through N to SE, start=270 and end=135
+fov: <start_az> <end_az>
+
+// Specifies the observers height-of-eye above the 
+// terrain in meters. Defaults to 1.5 m.
+height_of_eye: <meters>
+
+// Experimental. Outputs the max elevation angles 
+// for all azimuths to <filename>, for horizon profiling.
+horizon_file: <filename>
+
+// Geographic horizontal position of the observer. Does not need to be in the AOI
+observer: <lat> <lon>
+
+// Specifies the size of the reticle at the observer location in pixels from the center 
+// (i.e., the radius of the reticle). Defaults to 5. A value of 0 hides the reticle. 
+reticle_size: <int>
+
+// Specifies the pixel values (0-255) for the visible,
+// hidden and reticle pixels, respectively. Defaults to visible=null (0), 
+// hidden=128, and observer position reticle is highlighted with 255.
+viewshed_coding: <int> <int> <int>
+
+// Specifies max visibility in meters. Required unless AOI specified. This option constrains 
+// output to a circle, similar to a radar display
+visibility_radius: <meters>
+
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..7f9f9e4
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,178 @@
+SET(LIB_NAME ossim)
+
+########################################### BEGIN: GRAB SOURCE FILES ##########################################
+FILE(GLOB ossim_SRCS  RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} 
+        "${CMAKE_CURRENT_SOURCE_DIR}/ossimConfig*.cpp" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/ossimVer*.cpp" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/init/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/init/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/base/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/base/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/elevation/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/elevation/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/font/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/font/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/imaging/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/imaging/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/matrix/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/matrix/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/parallel/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/parallel/*.c"
+        "${CMAKE_CURRENT_SOURCE_DIR}/point_cloud/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/point_cloud/*.c"
+        "${CMAKE_CURRENT_SOURCE_DIR}/projection/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/projection/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/support_data/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/support_data/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/util/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/util/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/vec/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/vec/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/video/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/video/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/vpfutil/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/vpfutil/*.c" 
+        "${CMAKE_CURRENT_SOURCE_DIR}/plugin/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/plugin/*.c")
+IF(UNIX)
+   FILE(GLOB ossim_sockets_SRCS RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/sockets/*.cpp")
+   LIST(APPEND ossim_SRCS "${ossim_sockets_SRCS}")
+ELSEIF(WIN32)
+   FILE(GLOB ossim_dll_main_SRCS RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/dll_main/*.cpp")
+	LIST(APPEND ossim_SRCS "${ossim_dll_main_SRCS}")
+ENDIF(UNIX)
+   
+IF (OSSIM_HAS_HDF5)
+   message( STATUS "HDF5 components will be included." )
+   FILE(GLOB ossim_hdf5_SRCS RELATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/hdf5/*.cpp")
+   LIST(APPEND ossim_SRCS "${ossim_hdf5_SRCS}")
+ELSE (OSSIM_HAS_HDF5)
+   message( STATUS "HDF5 components are being excluded from the build." )
+ENDIF (OSSIM_HAS_HDF5)
+
+ADD_DEFINITIONS("-DOSSIMMAKINGDLL")
+############################### GRAB HEADERS #####################################
+FILE(GLOB ossim_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/*.h")
+FILE(GLOB ossim_base_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/base/*.h")
+FILE(GLOB ossim_elevation_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/elevation/*.h")
+FILE(GLOB ossim_font_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/font/*.h")
+FILE(GLOB ossim_imaging_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/imaging/*.h")
+FILE(GLOB ossim_init_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/init/*.h")
+FILE(GLOB ossim_matrix_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/matrix/*.h")
+FILE(GLOB ossim_parallel_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/parallel/*.h")
+FILE(GLOB ossim_plugin_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/plugin/*.h")
+FILE(GLOB ossim_point_cloud_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/point_cloud/*.h")
+FILE(GLOB ossim_projection_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/projection/*.h")
+FILE(GLOB ossim_support_data_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/support_data/*.h")
+FILE(GLOB ossim_util_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/util/*.h")
+FILE(GLOB ossim_vec_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/vec/*.h")
+FILE(GLOB ossim_video_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/video/*.h")
+FILE(GLOB ossim_vpfutil_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/vpfutil/*.h")
+
+IF(UNIX)
+  FILE(GLOB ossim_sockets_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/sockets/*.h")
+ENDIF(UNIX)
+
+IF (OSSIM_HAS_HDF5)
+  FILE(GLOB ossim_hdf5_HDRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../include/ossim/hdf5/*.h")
+ENDIF (OSSIM_HAS_HDF5)
+
+MESSAGE( "${ossim_HDRS}" )
+SET(OSSIM_HEADER_FILES 
+	${ossim_HDRS}
+ 	${ossim_base_HDRS} ${ossim_elevation_HDRS} ${ossim_font_HDRS}  ${ossim_imaging_HDRS} 
+ 	${ossim_init_HDRS} ${ossim_matrix_HDRS} ${ossim_parallel_HDRS} ${ossim_plugin_HDRS} 
+ 	${ossim_point_cloud_HDRS} ${ossim_projection_HDRS} ${ossim_support_data_HDRS} ${ossim_util_HDRS} 
+ 	${ossim_vec_HDRS} ${ossim_video_HDRS} ${ossim_vpfutil_HDRS} ${ossim_sockets_HDRS} ${ossim_hdf5_HDRS} )
+
+
+################################## APPLE Framework support deep header mapping ###################################
+IF(APPLE)
+  FOREACH(f  ${ossim_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_base_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/base )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_elevation_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/elevation )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_font_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/font )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_imaging_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/imaging )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_init_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/init )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_matrix_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/matrix )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_parallel_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/parallel )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_plugin_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/plugin )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_point_cloud_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/point_cloud )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_projection_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/projection )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_support_data_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/support_data )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_util_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/util )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_vec_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/vec )
+  ENDFOREACH(f)
+  FOREACH(f  ${ossim_video_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/video )
+  ENDFOREACH(f)
+
+  FOREACH(f  ${ossim_vpfutil_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/vpfutil )
+  ENDFOREACH(f)
+
+  IF (OSSIM_HAS_HDF5)
+    FOREACH(f  ${ossim_hdf5_HDRS} )
+      SET_SOURCE_FILES_PROPERTIES( ${f} PROPERTIES MACOSX_PACKAGE_LOCATION Headers/hdf5 )
+    ENDFOREACH(f)
+  ENDIF (OSSIM_HAS_HDF5)
+
+ENDIF(APPLE)
+
+#################################### SETUP the required link parameters using the Ossim macro ####################################
+OSSIM_LINK_LIBRARY(${LIB_NAME} 
+                   COMPONENT_NAME ossim 
+                   TYPE ${OSSIM_USER_DEFINED_DYNAMIC_OR_STATIC}
+                   LIBRARIES ${ossimDependentLibs}
+                   HEADERS "${OSSIM_HEADER_FILES}" 
+                   PUBLIC_HEADERS "${ossim_HDRS}"
+                   SOURCE_FILES "${ossim_SRCS}"
+                   INSTALL_LIB VERSION_SYMLINKS)
+
+# The install headers was duplicating ossimVersion.h and ossimConfig.h in "install_prefix/include".
+# INSTALL_HEADERS)
+
+########################################################## If DO special case for ossim core needs to have the files mapped properly ################################ 
+IF(NOT OSSIM_BUILD_FRAMEWORKS OR NOT APPLE)
+   install(FILES ${ossim_HDRS} DESTINATION include/ossim COMPONENT ossim) 
+   install(FILES ${ossim_base_HDRS} DESTINATION include/ossim/base COMPONENT ossim) 
+   install(FILES ${ossim_elevation_HDRS} DESTINATION include/ossim/elevation COMPONENT ossim)
+   install(FILES ${ossim_font_HDRS} DESTINATION include/ossim/font COMPONENT ossim)
+   install(FILES ${ossim_imaging_HDRS} DESTINATION include/ossim/imaging COMPONENT ossim) 
+   install(FILES ${ossim_init_HDRS} DESTINATION include/ossim/init COMPONENT ossim) 
+   install(FILES ${ossim_matrix_HDRS} DESTINATION include/ossim/matrix COMPONENT ossim) 
+   install(FILES ${ossim_parallel_HDRS} DESTINATION include/ossim/parallel COMPONENT ossim) 
+   install(FILES ${ossim_plugin_HDRS} DESTINATION include/ossim/plugin COMPONENT ossim) 
+   install(FILES ${ossim_point_cloud_HDRS} DESTINATION include/ossim/point_cloud COMPONENT ossim) 
+   install(FILES ${ossim_projection_HDRS} DESTINATION include/ossim/projection COMPONENT ossim) 
+   install(FILES ${ossim_support_data_HDRS} DESTINATION include/ossim/support_data COMPONENT ossim) 
+   install(FILES ${ossim_util_HDRS} DESTINATION include/ossim/util COMPONENT ossim) 
+   install(FILES ${ossim_vec_HDRS} DESTINATION include/ossim/vec COMPONENT ossim) 
+   install(FILES ${ossim_video_HDRS} DESTINATION include/ossim/video COMPONENT ossim) 
+   install(FILES ${ossim_vpfutil_HDRS} DESTINATION include/ossim/vpfutil COMPONENT ossim) 
+   IF(UNIX)
+     install(FILES ${ossim_sockets_HDRS} DESTINATION include/ossim/sockets COMPONENT ossim) 
+   ENDIF(UNIX)
+   IF (OSSIM_HAS_HDF5)
+     install(FILES ${ossim_hdf5_HDRS} DESTINATION include/ossim/hdf5 COMPONENT ossim) 
+  ENDIF (OSSIM_HAS_HDF5)
+ENDIF(NOT OSSIM_BUILD_FRAMEWORKS OR NOT APPLE)
+# ENDIF(NOT OSSIM_FRAMEWORK_GENERATION OR NOT APPLE)
+
+# ---
+# This is the old list of library for the link line.  Replaced with ${ossimDependentLibs}.  
+# Kept temporarily in case I broke something.  drb - 31 Aug. 2011
+# LIBRARIES ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${GEOTIFF_LIBRARIES} ${OPENTHREADS_LIBRARIES} ${FREETYPE_LIBRARIES} ${MPI_LIBRARIES} ${ZLIB_LIBRARIES} ${DL_LIBRARY}
+# ---
diff --git a/ossim/src/ossim/base/ellips.dat b/src/base/ellips.dat
similarity index 100%
rename from ossim/src/ossim/base/ellips.dat
rename to src/base/ellips.dat
diff --git a/src/base/jsoncpp.cpp b/src/base/jsoncpp.cpp
new file mode 100644
index 0000000..069ade3
--- /dev/null
+++ b/src/base/jsoncpp.cpp
@@ -0,0 +1,5206 @@
+/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/).
+/// It is intended to be used with #include "json/json.h"
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: LICENSE
+// //////////////////////////////////////////////////////////////////////
+
+/*
+The JsonCpp library's source code, including accompanying documentation,
+tests and demonstration applications, are licensed under the following
+conditions...
+
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+jurisdictions which recognize such a disclaimer. In such jurisdictions,
+this software is released into the Public Domain.
+
+In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
+2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
+released under the terms of the MIT License (see below).
+
+In jurisdictions which recognize Public Domain property, the user of this
+software may choose to accept it either as 1) Public Domain, 2) under the
+conditions of the MIT License (see below), or 3) under the terms of dual
+Public Domain/MIT License conditions described here, as they choose.
+
+The MIT License is about as close to Public Domain as a license can get, and is
+described in clear, concise terms at:
+
+   http://en.wikipedia.org/wiki/MIT_License
+
+The full text of the MIT License follows:
+
+========================================================================
+Copyright (c) 2007-2010 Baptiste Lepilleur
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy,
+modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+========================================================================
+(END LICENSE TEXT)
+
+The MIT license is compatible with both the GPL and commercial
+software, affording one all of the rights of Public Domain with the
+minor nuisance of being required to keep the above copyright notice
+and license text in the source code. Note also that by accepting the
+Public Domain "license" you can re-license your copy using whatever
+license you like.
+
+*/
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: LICENSE
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+#include <ossim/base/jsoncpp.h>
+
+#ifndef JSON_IS_AMALGAMATION
+#error "Compile with -I PATH_TO_JSON_DIRECTORY"
+#endif
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: src/lib_json/json_tool.h
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED
+#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED
+
+/* This header provides common string manipulation support, such as UTF-8,
+ * portable conversion from/to string...
+ *
+ * It is an internal header that must not be exposed.
+ */
+
+namespace Json {
+
+/// Converts a unicode code-point to UTF-8.
+static inline std::string codePointToUTF8(unsigned int cp) {
+  std::string result;
+
+  // based on description from http://en.wikipedia.org/wiki/UTF-8
+
+  if (cp <= 0x7f) {
+    result.resize(1);
+    result[0] = static_cast<char>(cp);
+  } else if (cp <= 0x7FF) {
+    result.resize(2);
+    result[1] = static_cast<char>(0x80 | (0x3f & cp));
+    result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
+  } else if (cp <= 0xFFFF) {
+    result.resize(3);
+    result[2] = static_cast<char>(0x80 | (0x3f & cp));
+    result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
+    result[0] = static_cast<char>(0xE0 | (0xf & (cp >> 12)));
+  } else if (cp <= 0x10FFFF) {
+    result.resize(4);
+    result[3] = static_cast<char>(0x80 | (0x3f & cp));
+    result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
+    result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));
+    result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
+  }
+
+  return result;
+}
+
+/// Returns true if ch is a control character (in range [1,31]).
+static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; }
+
+enum {
+  /// Constant that specify the size of the buffer that must be passed to
+  /// uintToString.
+  uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1
+};
+
+// Defines a char buffer for use with uintToString().
+typedef char UIntToStringBuffer[uintToStringBufferSize];
+
+/** Converts an unsigned integer to string.
+ * @param value Unsigned interger to convert to string
+ * @param current Input/Output string buffer.
+ *        Must have at least uintToStringBufferSize chars free.
+ */
+static inline void uintToString(LargestUInt value, char*& current) {
+  *--current = 0;
+  do {
+    *--current = static_cast<signed char>(value % 10U + static_cast<unsigned>('0'));
+    value /= 10;
+  } while (value != 0);
+}
+
+/** Change ',' to '.' everywhere in buffer.
+ *
+ * We had a sophisticated way, but it did not work in WinCE.
+ * @see https://github.com/open-source-parsers/jsoncpp/pull/9
+ */
+static inline void fixNumericLocale(char* begin, char* end) {
+  while (begin < end) {
+    if (*begin == ',') {
+      *begin = '.';
+    }
+    ++begin;
+  }
+}
+
+} // namespace Json {
+
+#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: src/lib_json/json_tool.h
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: src/lib_json/json_reader.cpp
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2011 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include <json/assertions.h>
+#include <json/reader.h>
+#include <json/value.h>
+#include "json_tool.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+#include <utility>
+#include <cstdio>
+#include <cassert>
+#include <cstring>
+#include <istream>
+#include <sstream>
+#include <memory>
+#include <set>
+#include <limits>
+
+#if defined(_MSC_VER)
+#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
+#define snprintf sprintf_s
+#elif _MSC_VER >= 1900 // VC++ 14.0 and above
+#define snprintf std::snprintf
+#else
+#define snprintf _snprintf
+#endif
+#elif defined(__ANDROID__) || defined(__QNXNTO__)
+#define snprintf snprintf
+#elif __cplusplus >= 201103L
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
+#define snprintf std::snprintf
+#endif
+#endif
+
+#if defined(__QNXNTO__)
+#define sscanf std::sscanf
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
+// Disable warning about strdup being deprecated.
+#pragma warning(disable : 4996)
+#endif
+
+static int const stackLimit_g = 1000;
+static int       stackDepth_g = 0;  // see readValue()
+
+namespace Json {
+
+#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
+typedef std::unique_ptr<CharReader> CharReaderPtr;
+#else
+typedef std::auto_ptr<CharReader>   CharReaderPtr;
+#endif
+
+// Implementation of class Features
+// ////////////////////////////////
+
+Features::Features()
+    : allowComments_(true), strictRoot_(false),
+      allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) {}
+
+Features Features::all() { return Features(); }
+
+Features Features::strictMode() {
+  Features features;
+  features.allowComments_ = false;
+  features.strictRoot_ = true;
+  features.allowDroppedNullPlaceholders_ = false;
+  features.allowNumericKeys_ = false;
+  return features;
+}
+
+// Implementation of class Reader
+// ////////////////////////////////
+
+static bool containsNewLine(Reader::Location begin, Reader::Location end) {
+  for (; begin < end; ++begin)
+    if (*begin == '\n' || *begin == '\r')
+      return true;
+  return false;
+}
+
+// Class Reader
+// //////////////////////////////////////////////////////////////////
+
+Reader::Reader()
+    : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
+      lastValue_(), commentsBefore_(), features_(Features::all()),
+      collectComments_() {}
+
+Reader::Reader(const Features& features)
+    : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
+      lastValue_(), commentsBefore_(), features_(features), collectComments_() {
+}
+
+bool
+Reader::parse(const std::string& document, Value& root, bool collectComments) {
+  document_ = document;
+  const char* begin = document_.c_str();
+  const char* end = begin + document_.length();
+  return parse(begin, end, root, collectComments);
+}
+
+bool Reader::parse(std::istream& sin, Value& root, bool collectComments) {
+  // std::istream_iterator<char> begin(sin);
+  // std::istream_iterator<char> end;
+  // Those would allow streamed input from a file, if parse() were a
+  // template function.
+
+  // Since std::string is reference-counted, this at least does not
+  // create an extra copy.
+  std::string doc;
+  std::getline(sin, doc, (char)EOF);
+  return parse(doc, root, collectComments);
+}
+
+bool Reader::parse(const char* beginDoc,
+                   const char* endDoc,
+                   Value& root,
+                   bool collectComments) {
+  if (!features_.allowComments_) {
+    collectComments = false;
+  }
+
+  begin_ = beginDoc;
+  end_ = endDoc;
+  collectComments_ = collectComments;
+  current_ = begin_;
+  lastValueEnd_ = 0;
+  lastValue_ = 0;
+  commentsBefore_ = "";
+  errors_.clear();
+  while (!nodes_.empty())
+    nodes_.pop();
+  nodes_.push(&root);
+
+  stackDepth_g = 0;  // Yes, this is bad coding, but options are limited.
+  bool successful = readValue();
+  Token token;
+  skipCommentTokens(token);
+  if (collectComments_ && !commentsBefore_.empty())
+    root.setComment(commentsBefore_, commentAfter);
+  if (features_.strictRoot_) {
+    if (!root.isArray() && !root.isObject()) {
+      // Set error location to start of doc, ideally should be first token found
+      // in doc
+      token.type_ = tokenError;
+      token.start_ = beginDoc;
+      token.end_ = endDoc;
+      addError(
+          "A valid JSON document must be either an array or an object value.",
+          token);
+      return false;
+    }
+  }
+  return successful;
+}
+
+bool Reader::readValue() {
+  // This is a non-reentrant way to support a stackLimit. Terrible!
+  // But this deprecated class has a security problem: Bad input can
+  // cause a seg-fault. This seems like a fair, binary-compatible way
+  // to prevent the problem.
+  if (stackDepth_g >= stackLimit_g) throwRuntimeError("Exceeded stackLimit in readValue().");
+  ++stackDepth_g;
+
+  Token token;
+  skipCommentTokens(token);
+  bool successful = true;
+
+  if (collectComments_ && !commentsBefore_.empty()) {
+    currentValue().setComment(commentsBefore_, commentBefore);
+    commentsBefore_ = "";
+  }
+
+  switch (token.type_) {
+  case tokenObjectBegin:
+    successful = readObject(token);
+    currentValue().setOffsetLimit(current_ - begin_);
+    break;
+  case tokenArrayBegin:
+    successful = readArray(token);
+    currentValue().setOffsetLimit(current_ - begin_);
+    break;
+  case tokenNumber:
+    successful = decodeNumber(token);
+    break;
+  case tokenString:
+    successful = decodeString(token);
+    break;
+  case tokenTrue:
+    {
+    Value v(true);
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenFalse:
+    {
+    Value v(false);
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenNull:
+    {
+    Value v;
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenArraySeparator:
+  case tokenObjectEnd:
+  case tokenArrayEnd:
+    if (features_.allowDroppedNullPlaceholders_) {
+      // "Un-read" the current token and mark the current value as a null
+      // token.
+      current_--;
+      Value v;
+      currentValue().swapPayload(v);
+      currentValue().setOffsetStart(current_ - begin_ - 1);
+      currentValue().setOffsetLimit(current_ - begin_);
+      break;
+    } // Else, fall through...
+  default:
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    return addError("Syntax error: value, object or array expected.", token);
+  }
+
+  if (collectComments_) {
+    lastValueEnd_ = current_;
+    lastValue_ = &currentValue();
+  }
+
+  --stackDepth_g;
+  return successful;
+}
+
+void Reader::skipCommentTokens(Token& token) {
+  if (features_.allowComments_) {
+    do {
+      readToken(token);
+    } while (token.type_ == tokenComment);
+  } else {
+    readToken(token);
+  }
+}
+
+bool Reader::readToken(Token& token) {
+  skipSpaces();
+  token.start_ = current_;
+  Char c = getNextChar();
+  bool ok = true;
+  switch (c) {
+  case '{':
+    token.type_ = tokenObjectBegin;
+    break;
+  case '}':
+    token.type_ = tokenObjectEnd;
+    break;
+  case '[':
+    token.type_ = tokenArrayBegin;
+    break;
+  case ']':
+    token.type_ = tokenArrayEnd;
+    break;
+  case '"':
+    token.type_ = tokenString;
+    ok = readString();
+    break;
+  case '/':
+    token.type_ = tokenComment;
+    ok = readComment();
+    break;
+  case '0':
+  case '1':
+  case '2':
+  case '3':
+  case '4':
+  case '5':
+  case '6':
+  case '7':
+  case '8':
+  case '9':
+  case '-':
+    token.type_ = tokenNumber;
+    readNumber();
+    break;
+  case 't':
+    token.type_ = tokenTrue;
+    ok = match("rue", 3);
+    break;
+  case 'f':
+    token.type_ = tokenFalse;
+    ok = match("alse", 4);
+    break;
+  case 'n':
+    token.type_ = tokenNull;
+    ok = match("ull", 3);
+    break;
+  case ',':
+    token.type_ = tokenArraySeparator;
+    break;
+  case ':':
+    token.type_ = tokenMemberSeparator;
+    break;
+  case 0:
+    token.type_ = tokenEndOfStream;
+    break;
+  default:
+    ok = false;
+    break;
+  }
+  if (!ok)
+    token.type_ = tokenError;
+  token.end_ = current_;
+  return true;
+}
+
+void Reader::skipSpaces() {
+  while (current_ != end_) {
+    Char c = *current_;
+    if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
+      ++current_;
+    else
+      break;
+  }
+}
+
+bool Reader::match(Location pattern, int patternLength) {
+  if (end_ - current_ < patternLength)
+    return false;
+  int index = patternLength;
+  while (index--)
+    if (current_[index] != pattern[index])
+      return false;
+  current_ += patternLength;
+  return true;
+}
+
+bool Reader::readComment() {
+  Location commentBegin = current_ - 1;
+  Char c = getNextChar();
+  bool successful = false;
+  if (c == '*')
+    successful = readCStyleComment();
+  else if (c == '/')
+    successful = readCppStyleComment();
+  if (!successful)
+    return false;
+
+  if (collectComments_) {
+    CommentPlacement placement = commentBefore;
+    if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {
+      if (c != '*' || !containsNewLine(commentBegin, current_))
+        placement = commentAfterOnSameLine;
+    }
+
+    addComment(commentBegin, current_, placement);
+  }
+  return true;
+}
+
+static std::string normalizeEOL(Reader::Location begin, Reader::Location end) {
+  std::string normalized;
+  normalized.reserve(static_cast<size_t>(end - begin));
+  Reader::Location current = begin;
+  while (current != end) {
+    char c = *current++;
+    if (c == '\r') {
+      if (current != end && *current == '\n')
+         // convert dos EOL
+         ++current;
+      // convert Mac EOL
+      normalized += '\n';
+    } else {
+      normalized += c;
+    }
+  }
+  return normalized;
+}
+
+void
+Reader::addComment(Location begin, Location end, CommentPlacement placement) {
+  assert(collectComments_);
+  const std::string& normalized = normalizeEOL(begin, end);
+  if (placement == commentAfterOnSameLine) {
+    assert(lastValue_ != 0);
+    lastValue_->setComment(normalized, placement);
+  } else {
+    commentsBefore_ += normalized;
+  }
+}
+
+bool Reader::readCStyleComment() {
+  while (current_ != end_) {
+    Char c = getNextChar();
+    if (c == '*' && *current_ == '/')
+      break;
+  }
+  return getNextChar() == '/';
+}
+
+bool Reader::readCppStyleComment() {
+  while (current_ != end_) {
+    Char c = getNextChar();
+    if (c == '\n')
+      break;
+    if (c == '\r') {
+      // Consume DOS EOL. It will be normalized in addComment.
+      if (current_ != end_ && *current_ == '\n')
+        getNextChar();
+      // Break on Moc OS 9 EOL.
+      break;
+    }
+  }
+  return true;
+}
+
+void Reader::readNumber() {
+  const char *p = current_;
+  char c = '0'; // stopgap for already consumed character
+  // integral part
+  while (c >= '0' && c <= '9')
+    c = (current_ = p) < end_ ? *p++ : 0;
+  // fractional part
+  if (c == '.') {
+    c = (current_ = p) < end_ ? *p++ : 0;
+    while (c >= '0' && c <= '9')
+      c = (current_ = p) < end_ ? *p++ : 0;
+  }
+  // exponential part
+  if (c == 'e' || c == 'E') {
+    c = (current_ = p) < end_ ? *p++ : 0;
+    if (c == '+' || c == '-')
+      c = (current_ = p) < end_ ? *p++ : 0;
+    while (c >= '0' && c <= '9')
+      c = (current_ = p) < end_ ? *p++ : 0;
+  }
+}
+
+bool Reader::readString() {
+  Char c = 0;
+  while (current_ != end_) {
+    c = getNextChar();
+    if (c == '\\')
+      getNextChar();
+    else if (c == '"')
+      break;
+  }
+  return c == '"';
+}
+
+bool Reader::readObject(Token& tokenStart) {
+  Token tokenName;
+  std::string name;
+  Value init(objectValue);
+  currentValue().swapPayload(init);
+  currentValue().setOffsetStart(tokenStart.start_ - begin_);
+  while (readToken(tokenName)) {
+    bool initialTokenOk = true;
+    while (tokenName.type_ == tokenComment && initialTokenOk)
+      initialTokenOk = readToken(tokenName);
+    if (!initialTokenOk)
+      break;
+    if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
+      return true;
+    name = "";
+    if (tokenName.type_ == tokenString) {
+      if (!decodeString(tokenName, name))
+        return recoverFromError(tokenObjectEnd);
+    } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
+      Value numberName;
+      if (!decodeNumber(tokenName, numberName))
+        return recoverFromError(tokenObjectEnd);
+      name = numberName.asString();
+    } else {
+      break;
+    }
+
+    Token colon;
+    if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
+      return addErrorAndRecover(
+          "Missing ':' after object member name", colon, tokenObjectEnd);
+    }
+    Value& value = currentValue()[name];
+    nodes_.push(&value);
+    bool ok = readValue();
+    nodes_.pop();
+    if (!ok) // error already set
+      return recoverFromError(tokenObjectEnd);
+
+    Token comma;
+    if (!readToken(comma) ||
+        (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
+         comma.type_ != tokenComment)) {
+      return addErrorAndRecover(
+          "Missing ',' or '}' in object declaration", comma, tokenObjectEnd);
+    }
+    bool finalizeTokenOk = true;
+    while (comma.type_ == tokenComment && finalizeTokenOk)
+      finalizeTokenOk = readToken(comma);
+    if (comma.type_ == tokenObjectEnd)
+      return true;
+  }
+  return addErrorAndRecover(
+      "Missing '}' or object member name", tokenName, tokenObjectEnd);
+}
+
+bool Reader::readArray(Token& tokenStart) {
+  Value init(arrayValue);
+  currentValue().swapPayload(init);
+  currentValue().setOffsetStart(tokenStart.start_ - begin_);
+  skipSpaces();
+  if (*current_ == ']') // empty array
+  {
+    Token endArray;
+    readToken(endArray);
+    return true;
+  }
+  int index = 0;
+  for (;;) {
+    Value& value = currentValue()[index++];
+    nodes_.push(&value);
+    bool ok = readValue();
+    nodes_.pop();
+    if (!ok) // error already set
+      return recoverFromError(tokenArrayEnd);
+
+    Token token;
+    // Accept Comment after last item in the array.
+    ok = readToken(token);
+    while (token.type_ == tokenComment && ok) {
+      ok = readToken(token);
+    }
+    bool badTokenType =
+        (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);
+    if (!ok || badTokenType) {
+      return addErrorAndRecover(
+          "Missing ',' or ']' in array declaration", token, tokenArrayEnd);
+    }
+    if (token.type_ == tokenArrayEnd)
+      break;
+  }
+  return true;
+}
+
+bool Reader::decodeNumber(Token& token) {
+  Value decoded;
+  if (!decodeNumber(token, decoded))
+    return false;
+  currentValue().swapPayload(decoded);
+  currentValue().setOffsetStart(token.start_ - begin_);
+  currentValue().setOffsetLimit(token.end_ - begin_);
+  return true;
+}
+
+bool Reader::decodeNumber(Token& token, Value& decoded) {
+  // Attempts to parse the number as an integer. If the number is
+  // larger than the maximum supported value of an integer then
+  // we decode the number as a double.
+  Location current = token.start_;
+  bool isNegative = *current == '-';
+  if (isNegative)
+    ++current;
+  // TODO: Help the compiler do the div and mod at compile time or get rid of them.
+  Value::LargestUInt maxIntegerValue =
+      isNegative ? Value::LargestUInt(Value::maxLargestInt) + 1
+                 : Value::maxLargestUInt;
+  Value::LargestUInt threshold = maxIntegerValue / 10;
+  Value::LargestUInt value = 0;
+  while (current < token.end_) {
+    Char c = *current++;
+    if (c < '0' || c > '9')
+      return decodeDouble(token, decoded);
+    Value::UInt digit(static_cast<Value::UInt>(c - '0'));
+    if (value >= threshold) {
+      // We've hit or exceeded the max value divided by 10 (rounded down). If
+      // a) we've only just touched the limit, b) this is the last digit, and
+      // c) it's small enough to fit in that rounding delta, we're okay.
+      // Otherwise treat this number as a double to avoid overflow.
+      if (value > threshold || current != token.end_ ||
+          digit > maxIntegerValue % 10) {
+        return decodeDouble(token, decoded);
+      }
+    }
+    value = value * 10 + digit;
+  }
+  if (isNegative && value == maxIntegerValue)
+    decoded = Value::minLargestInt;
+  else if (isNegative)
+    decoded = -Value::LargestInt(value);
+  else if (value <= Value::LargestUInt(Value::maxInt))
+    decoded = Value::LargestInt(value);
+  else
+    decoded = value;
+  return true;
+}
+
+bool Reader::decodeDouble(Token& token) {
+  Value decoded;
+  if (!decodeDouble(token, decoded))
+    return false;
+  currentValue().swapPayload(decoded);
+  currentValue().setOffsetStart(token.start_ - begin_);
+  currentValue().setOffsetLimit(token.end_ - begin_);
+  return true;
+}
+
+bool Reader::decodeDouble(Token& token, Value& decoded) {
+  double value = 0;
+  std::string buffer(token.start_, token.end_);
+  JSONCPP_ISTRINGSTREAM is(buffer);
+  if (!(is >> value))
+    return addError("'" + std::string(token.start_, token.end_) +
+                        "' is not a number.",
+                    token);
+  decoded = value;
+  return true;
+}
+
+bool Reader::decodeString(Token& token) {
+  std::string decoded_string;
+  if (!decodeString(token, decoded_string))
+    return false;
+  Value decoded(decoded_string);
+  currentValue().swapPayload(decoded);
+  currentValue().setOffsetStart(token.start_ - begin_);
+  currentValue().setOffsetLimit(token.end_ - begin_);
+  return true;
+}
+
+bool Reader::decodeString(Token& token, std::string& decoded) {
+  decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
+  Location current = token.start_ + 1; // skip '"'
+  Location end = token.end_ - 1;       // do not include '"'
+  while (current != end) {
+    Char c = *current++;
+    if (c == '"')
+      break;
+    else if (c == '\\') {
+      if (current == end)
+        return addError("Empty escape sequence in string", token, current);
+      Char escape = *current++;
+      switch (escape) {
+      case '"':
+        decoded += '"';
+        break;
+      case '/':
+        decoded += '/';
+        break;
+      case '\\':
+        decoded += '\\';
+        break;
+      case 'b':
+        decoded += '\b';
+        break;
+      case 'f':
+        decoded += '\f';
+        break;
+      case 'n':
+        decoded += '\n';
+        break;
+      case 'r':
+        decoded += '\r';
+        break;
+      case 't':
+        decoded += '\t';
+        break;
+      case 'u': {
+        unsigned int unicode;
+        if (!decodeUnicodeCodePoint(token, current, end, unicode))
+          return false;
+        decoded += codePointToUTF8(unicode);
+      } break;
+      default:
+        return addError("Bad escape sequence in string", token, current);
+      }
+    } else {
+      decoded += c;
+    }
+  }
+  return true;
+}
+
+bool Reader::decodeUnicodeCodePoint(Token& token,
+                                    Location& current,
+                                    Location end,
+                                    unsigned int& unicode) {
+
+  if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
+    return false;
+  if (unicode >= 0xD800 && unicode <= 0xDBFF) {
+    // surrogate pairs
+    if (end - current < 6)
+      return addError(
+          "additional six characters expected to parse unicode surrogate pair.",
+          token,
+          current);
+    unsigned int surrogatePair;
+    if (*(current++) == '\\' && *(current++) == 'u') {
+      if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
+        unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
+      } else
+        return false;
+    } else
+      return addError("expecting another \\u token to begin the second half of "
+                      "a unicode surrogate pair",
+                      token,
+                      current);
+  }
+  return true;
+}
+
+bool Reader::decodeUnicodeEscapeSequence(Token& token,
+                                         Location& current,
+                                         Location end,
+                                         unsigned int& ret_unicode) {
+  if (end - current < 4)
+    return addError(
+        "Bad unicode escape sequence in string: four digits expected.",
+        token,
+        current);
+  int unicode = 0;
+  for (int index = 0; index < 4; ++index) {
+    Char c = *current++;
+    unicode *= 16;
+    if (c >= '0' && c <= '9')
+      unicode += c - '0';
+    else if (c >= 'a' && c <= 'f')
+      unicode += c - 'a' + 10;
+    else if (c >= 'A' && c <= 'F')
+      unicode += c - 'A' + 10;
+    else
+      return addError(
+          "Bad unicode escape sequence in string: hexadecimal digit expected.",
+          token,
+          current);
+  }
+  ret_unicode = static_cast<unsigned int>(unicode);
+  return true;
+}
+
+bool
+Reader::addError(const std::string& message, Token& token, Location extra) {
+  ErrorInfo info;
+  info.token_ = token;
+  info.message_ = message;
+  info.extra_ = extra;
+  errors_.push_back(info);
+  return false;
+}
+
+bool Reader::recoverFromError(TokenType skipUntilToken) {
+  size_t const errorCount = errors_.size();
+  Token skip;
+  for (;;) {
+    if (!readToken(skip))
+      errors_.resize(errorCount); // discard errors caused by recovery
+    if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)
+      break;
+  }
+  errors_.resize(errorCount);
+  return false;
+}
+
+bool Reader::addErrorAndRecover(const std::string& message,
+                                Token& token,
+                                TokenType skipUntilToken) {
+  addError(message, token);
+  return recoverFromError(skipUntilToken);
+}
+
+Value& Reader::currentValue() { return *(nodes_.top()); }
+
+Reader::Char Reader::getNextChar() {
+  if (current_ == end_)
+    return 0;
+  return *current_++;
+}
+
+void Reader::getLocationLineAndColumn(Location location,
+                                      int& line,
+                                      int& column) const {
+  Location current = begin_;
+  Location lastLineStart = current;
+  line = 0;
+  while (current < location && current != end_) {
+    Char c = *current++;
+    if (c == '\r') {
+      if (*current == '\n')
+        ++current;
+      lastLineStart = current;
+      ++line;
+    } else if (c == '\n') {
+      lastLineStart = current;
+      ++line;
+    }
+  }
+  // column & line start at 1
+  column = int(location - lastLineStart) + 1;
+  ++line;
+}
+
+std::string Reader::getLocationLineAndColumn(Location location) const {
+  int line, column;
+  getLocationLineAndColumn(location, line, column);
+  char buffer[18 + 16 + 16 + 1];
+  snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
+  return buffer;
+}
+
+// Deprecated. Preserved for backward compatibility
+std::string Reader::getFormatedErrorMessages() const {
+  return getFormattedErrorMessages();
+}
+
+std::string Reader::getFormattedErrorMessages() const {
+  std::string formattedMessage;
+  for (Errors::const_iterator itError = errors_.begin();
+       itError != errors_.end();
+       ++itError) {
+    const ErrorInfo& error = *itError;
+    formattedMessage +=
+        "* " + getLocationLineAndColumn(error.token_.start_) + "\n";
+    formattedMessage += "  " + error.message_ + "\n";
+    if (error.extra_)
+      formattedMessage +=
+          "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n";
+  }
+  return formattedMessage;
+}
+
+std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
+  std::vector<Reader::StructuredError> allErrors;
+  for (Errors::const_iterator itError = errors_.begin();
+       itError != errors_.end();
+       ++itError) {
+    const ErrorInfo& error = *itError;
+    Reader::StructuredError structured;
+    structured.offset_start = error.token_.start_ - begin_;
+    structured.offset_limit = error.token_.end_ - begin_;
+    structured.message = error.message_;
+    allErrors.push_back(structured);
+  }
+  return allErrors;
+}
+
+bool Reader::pushError(const Value& value, const std::string& message) {
+  ptrdiff_t const length = end_ - begin_;
+  if(value.getOffsetStart() > length
+    || value.getOffsetLimit() > length)
+    return false;
+  Token token;
+  token.type_ = tokenError;
+  token.start_ = begin_ + value.getOffsetStart();
+  token.end_ = end_ + value.getOffsetLimit();
+  ErrorInfo info;
+  info.token_ = token;
+  info.message_ = message;
+  info.extra_ = 0;
+  errors_.push_back(info);
+  return true;
+}
+
+bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) {
+  ptrdiff_t const length = end_ - begin_;
+  if(value.getOffsetStart() > length
+    || value.getOffsetLimit() > length
+    || extra.getOffsetLimit() > length)
+    return false;
+  Token token;
+  token.type_ = tokenError;
+  token.start_ = begin_ + value.getOffsetStart();
+  token.end_ = begin_ + value.getOffsetLimit();
+  ErrorInfo info;
+  info.token_ = token;
+  info.message_ = message;
+  info.extra_ = begin_ + extra.getOffsetStart();
+  errors_.push_back(info);
+  return true;
+}
+
+bool Reader::good() const {
+  return !errors_.size();
+}
+
+// exact copy of Features
+class OurFeatures {
+public:
+  static OurFeatures all();
+  bool allowComments_;
+  bool strictRoot_;
+  bool allowDroppedNullPlaceholders_;
+  bool allowNumericKeys_;
+  bool allowSingleQuotes_;
+  bool failIfExtra_;
+  bool rejectDupKeys_;
+  bool allowSpecialFloats_;
+  int stackLimit_;
+};  // OurFeatures
+
+// exact copy of Implementation of class Features
+// ////////////////////////////////
+
+OurFeatures OurFeatures::all() { return OurFeatures(); }
+
+// Implementation of class Reader
+// ////////////////////////////////
+
+// exact copy of Reader, renamed to OurReader
+class OurReader {
+public:
+  typedef char Char;
+  typedef const Char* Location;
+  struct StructuredError {
+    ptrdiff_t offset_start;
+    ptrdiff_t offset_limit;
+    std::string message;
+  };
+
+  OurReader(OurFeatures const& features);
+  bool parse(const char* beginDoc,
+             const char* endDoc,
+             Value& root,
+             bool collectComments = true);
+  std::string getFormattedErrorMessages() const;
+  std::vector<StructuredError> getStructuredErrors() const;
+  bool pushError(const Value& value, const std::string& message);
+  bool pushError(const Value& value, const std::string& message, const Value& extra);
+  bool good() const;
+
+private:
+  OurReader(OurReader const&);  // no impl
+  void operator=(OurReader const&);  // no impl
+
+  enum TokenType {
+    tokenEndOfStream = 0,
+    tokenObjectBegin,
+    tokenObjectEnd,
+    tokenArrayBegin,
+    tokenArrayEnd,
+    tokenString,
+    tokenNumber,
+    tokenTrue,
+    tokenFalse,
+    tokenNull,
+    tokenNaN,
+    tokenPosInf,
+    tokenNegInf,
+    tokenArraySeparator,
+    tokenMemberSeparator,
+    tokenComment,
+    tokenError
+  };
+
+  class Token {
+  public:
+    TokenType type_;
+    Location start_;
+    Location end_;
+  };
+
+  class ErrorInfo {
+  public:
+    Token token_;
+    std::string message_;
+    Location extra_;
+  };
+
+  typedef std::deque<ErrorInfo> Errors;
+
+  bool readToken(Token& token);
+  void skipSpaces();
+  bool match(Location pattern, int patternLength);
+  bool readComment();
+  bool readCStyleComment();
+  bool readCppStyleComment();
+  bool readString();
+  bool readStringSingleQuote();
+  bool readNumber(bool checkInf);
+  bool readValue();
+  bool readObject(Token& token);
+  bool readArray(Token& token);
+  bool decodeNumber(Token& token);
+  bool decodeNumber(Token& token, Value& decoded);
+  bool decodeString(Token& token);
+  bool decodeString(Token& token, std::string& decoded);
+  bool decodeDouble(Token& token);
+  bool decodeDouble(Token& token, Value& decoded);
+  bool decodeUnicodeCodePoint(Token& token,
+                              Location& current,
+                              Location end,
+                              unsigned int& unicode);
+  bool decodeUnicodeEscapeSequence(Token& token,
+                                   Location& current,
+                                   Location end,
+                                   unsigned int& unicode);
+  bool addError(const std::string& message, Token& token, Location extra = 0);
+  bool recoverFromError(TokenType skipUntilToken);
+  bool addErrorAndRecover(const std::string& message,
+                          Token& token,
+                          TokenType skipUntilToken);
+  void skipUntilSpace();
+  Value& currentValue();
+  Char getNextChar();
+  void
+  getLocationLineAndColumn(Location location, int& line, int& column) const;
+  std::string getLocationLineAndColumn(Location location) const;
+  void addComment(Location begin, Location end, CommentPlacement placement);
+  void skipCommentTokens(Token& token);
+
+  typedef std::stack<Value*> Nodes;
+  Nodes nodes_;
+  Errors errors_;
+  std::string document_;
+  Location begin_;
+  Location end_;
+  Location current_;
+  Location lastValueEnd_;
+  Value* lastValue_;
+  std::string commentsBefore_;
+  int stackDepth_;
+
+  OurFeatures const features_;
+  bool collectComments_;
+};  // OurReader
+
+// complete copy of Read impl, for OurReader
+
+OurReader::OurReader(OurFeatures const& features)
+    : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
+      lastValue_(), commentsBefore_(),
+      stackDepth_(0),
+      features_(features), collectComments_() {
+}
+
+bool OurReader::parse(const char* beginDoc,
+                   const char* endDoc,
+                   Value& root,
+                   bool collectComments) {
+  if (!features_.allowComments_) {
+    collectComments = false;
+  }
+
+  begin_ = beginDoc;
+  end_ = endDoc;
+  collectComments_ = collectComments;
+  current_ = begin_;
+  lastValueEnd_ = 0;
+  lastValue_ = 0;
+  commentsBefore_ = "";
+  errors_.clear();
+  while (!nodes_.empty())
+    nodes_.pop();
+  nodes_.push(&root);
+
+  stackDepth_ = 0;
+  bool successful = readValue();
+  Token token;
+  skipCommentTokens(token);
+  if (features_.failIfExtra_) {
+    if (token.type_ != tokenError && token.type_ != tokenEndOfStream) {
+      addError("Extra non-whitespace after JSON value.", token);
+      return false;
+    }
+  }
+  if (collectComments_ && !commentsBefore_.empty())
+    root.setComment(commentsBefore_, commentAfter);
+  if (features_.strictRoot_) {
+    if (!root.isArray() && !root.isObject()) {
+      // Set error location to start of doc, ideally should be first token found
+      // in doc
+      token.type_ = tokenError;
+      token.start_ = beginDoc;
+      token.end_ = endDoc;
+      addError(
+          "A valid JSON document must be either an array or an object value.",
+          token);
+      return false;
+    }
+  }
+  return successful;
+}
+
+bool OurReader::readValue() {
+  if (stackDepth_ >= features_.stackLimit_) throwRuntimeError("Exceeded stackLimit in readValue().");
+  ++stackDepth_;
+  Token token;
+  skipCommentTokens(token);
+  bool successful = true;
+
+  if (collectComments_ && !commentsBefore_.empty()) {
+    currentValue().setComment(commentsBefore_, commentBefore);
+    commentsBefore_ = "";
+  }
+
+  switch (token.type_) {
+  case tokenObjectBegin:
+    successful = readObject(token);
+    currentValue().setOffsetLimit(current_ - begin_);
+    break;
+  case tokenArrayBegin:
+    successful = readArray(token);
+    currentValue().setOffsetLimit(current_ - begin_);
+    break;
+  case tokenNumber:
+    successful = decodeNumber(token);
+    break;
+  case tokenString:
+    successful = decodeString(token);
+    break;
+  case tokenTrue:
+    {
+    Value v(true);
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenFalse:
+    {
+    Value v(false);
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenNull:
+    {
+    Value v;
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenNaN:
+    {
+    Value v(std::numeric_limits<double>::quiet_NaN());
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenPosInf:
+    {
+    Value v(std::numeric_limits<double>::infinity());
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenNegInf:
+    {
+    Value v(-std::numeric_limits<double>::infinity());
+    currentValue().swapPayload(v);
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    }
+    break;
+  case tokenArraySeparator:
+  case tokenObjectEnd:
+  case tokenArrayEnd:
+    if (features_.allowDroppedNullPlaceholders_) {
+      // "Un-read" the current token and mark the current value as a null
+      // token.
+      current_--;
+      Value v;
+      currentValue().swapPayload(v);
+      currentValue().setOffsetStart(current_ - begin_ - 1);
+      currentValue().setOffsetLimit(current_ - begin_);
+      break;
+    } // else, fall through ...
+  default:
+    currentValue().setOffsetStart(token.start_ - begin_);
+    currentValue().setOffsetLimit(token.end_ - begin_);
+    return addError("Syntax error: value, object or array expected.", token);
+  }
+
+  if (collectComments_) {
+    lastValueEnd_ = current_;
+    lastValue_ = &currentValue();
+  }
+
+  --stackDepth_;
+  return successful;
+}
+
+void OurReader::skipCommentTokens(Token& token) {
+  if (features_.allowComments_) {
+    do {
+      readToken(token);
+    } while (token.type_ == tokenComment);
+  } else {
+    readToken(token);
+  }
+}
+
+bool OurReader::readToken(Token& token) {
+  skipSpaces();
+  token.start_ = current_;
+  Char c = getNextChar();
+  bool ok = true;
+  switch (c) {
+  case '{':
+    token.type_ = tokenObjectBegin;
+    break;
+  case '}':
+    token.type_ = tokenObjectEnd;
+    break;
+  case '[':
+    token.type_ = tokenArrayBegin;
+    break;
+  case ']':
+    token.type_ = tokenArrayEnd;
+    break;
+  case '"':
+    token.type_ = tokenString;
+    ok = readString();
+    break;
+  case '\'':
+    if (features_.allowSingleQuotes_) {
+    token.type_ = tokenString;
+    ok = readStringSingleQuote();
+    break;
+    } // else continue
+  case '/':
+    token.type_ = tokenComment;
+    ok = readComment();
+    break;
+  case '0':
+  case '1':
+  case '2':
+  case '3':
+  case '4':
+  case '5':
+  case '6':
+  case '7':
+  case '8':
+  case '9':
+    token.type_ = tokenNumber;
+    readNumber(false);
+    break;
+  case '-':
+    if (readNumber(true)) {
+      token.type_ = tokenNumber;
+    } else {
+      token.type_ = tokenNegInf;
+      ok = features_.allowSpecialFloats_ && match("nfinity", 7);
+    }
+    break;
+  case 't':
+    token.type_ = tokenTrue;
+    ok = match("rue", 3);
+    break;
+  case 'f':
+    token.type_ = tokenFalse;
+    ok = match("alse", 4);
+    break;
+  case 'n':
+    token.type_ = tokenNull;
+    ok = match("ull", 3);
+    break;
+  case 'N':
+    if (features_.allowSpecialFloats_) {
+      token.type_ = tokenNaN;
+      ok = match("aN", 2);
+    } else {
+      ok = false;
+    }
+    break;
+  case 'I':
+    if (features_.allowSpecialFloats_) {
+      token.type_ = tokenPosInf;
+      ok = match("nfinity", 7);
+    } else {
+      ok = false;
+    }
+    break;
+  case ',':
+    token.type_ = tokenArraySeparator;
+    break;
+  case ':':
+    token.type_ = tokenMemberSeparator;
+    break;
+  case 0:
+    token.type_ = tokenEndOfStream;
+    break;
+  default:
+    ok = false;
+    break;
+  }
+  if (!ok)
+    token.type_ = tokenError;
+  token.end_ = current_;
+  return true;
+}
+
+void OurReader::skipSpaces() {
+  while (current_ != end_) {
+    Char c = *current_;
+    if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
+      ++current_;
+    else
+      break;
+  }
+}
+
+bool OurReader::match(Location pattern, int patternLength) {
+  if (end_ - current_ < patternLength)
+    return false;
+  int index = patternLength;
+  while (index--)
+    if (current_[index] != pattern[index])
+      return false;
+  current_ += patternLength;
+  return true;
+}
+
+bool OurReader::readComment() {
+  Location commentBegin = current_ - 1;
+  Char c = getNextChar();
+  bool successful = false;
+  if (c == '*')
+    successful = readCStyleComment();
+  else if (c == '/')
+    successful = readCppStyleComment();
+  if (!successful)
+    return false;
+
+  if (collectComments_) {
+    CommentPlacement placement = commentBefore;
+    if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {
+      if (c != '*' || !containsNewLine(commentBegin, current_))
+        placement = commentAfterOnSameLine;
+    }
+
+    addComment(commentBegin, current_, placement);
+  }
+  return true;
+}
+
+void
+OurReader::addComment(Location begin, Location end, CommentPlacement placement) {
+  assert(collectComments_);
+  const std::string& normalized = normalizeEOL(begin, end);
+  if (placement == commentAfterOnSameLine) {
+    assert(lastValue_ != 0);
+    lastValue_->setComment(normalized, placement);
+  } else {
+    commentsBefore_ += normalized;
+  }
+}
+
+bool OurReader::readCStyleComment() {
+  while (current_ != end_) {
+    Char c = getNextChar();
+    if (c == '*' && *current_ == '/')
+      break;
+  }
+  return getNextChar() == '/';
+}
+
+bool OurReader::readCppStyleComment() {
+  while (current_ != end_) {
+    Char c = getNextChar();
+    if (c == '\n')
+      break;
+    if (c == '\r') {
+      // Consume DOS EOL. It will be normalized in addComment.
+      if (current_ != end_ && *current_ == '\n')
+        getNextChar();
+      // Break on Moc OS 9 EOL.
+      break;
+    }
+  }
+  return true;
+}
+
+bool OurReader::readNumber(bool checkInf) {
+  const char *p = current_;
+  if (checkInf && p != end_ && *p == 'I') {
+    current_ = ++p;
+    return false;
+  }
+  char c = '0'; // stopgap for already consumed character
+  // integral part
+  while (c >= '0' && c <= '9')
+    c = (current_ = p) < end_ ? *p++ : 0;
+  // fractional part
+  if (c == '.') {
+    c = (current_ = p) < end_ ? *p++ : 0;
+    while (c >= '0' && c <= '9')
+      c = (current_ = p) < end_ ? *p++ : 0;
+  }
+  // exponential part
+  if (c == 'e' || c == 'E') {
+    c = (current_ = p) < end_ ? *p++ : 0;
+    if (c == '+' || c == '-')
+      c = (current_ = p) < end_ ? *p++ : 0;
+    while (c >= '0' && c <= '9')
+      c = (current_ = p) < end_ ? *p++ : 0;
+  }
+  return true;
+}
+bool OurReader::readString() {
+  Char c = 0;
+  while (current_ != end_) {
+    c = getNextChar();
+    if (c == '\\')
+      getNextChar();
+    else if (c == '"')
+      break;
+  }
+  return c == '"';
+}
+
+
+bool OurReader::readStringSingleQuote() {
+  Char c = 0;
+  while (current_ != end_) {
+    c = getNextChar();
+    if (c == '\\')
+      getNextChar();
+    else if (c == '\'')
+      break;
+  }
+  return c == '\'';
+}
+
+bool OurReader::readObject(Token& tokenStart) {
+  Token tokenName;
+  std::string name;
+  Value init(objectValue);
+  currentValue().swapPayload(init);
+  currentValue().setOffsetStart(tokenStart.start_ - begin_);
+  while (readToken(tokenName)) {
+    bool initialTokenOk = true;
+    while (tokenName.type_ == tokenComment && initialTokenOk)
+      initialTokenOk = readToken(tokenName);
+    if (!initialTokenOk)
+      break;
+    if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
+      return true;
+    name = "";
+    if (tokenName.type_ == tokenString) {
+      if (!decodeString(tokenName, name))
+        return recoverFromError(tokenObjectEnd);
+    } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
+      Value numberName;
+      if (!decodeNumber(tokenName, numberName))
+        return recoverFromError(tokenObjectEnd);
+      name = numberName.asString();
+    } else {
+      break;
+    }
+
+    Token colon;
+    if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
+      return addErrorAndRecover(
+          "Missing ':' after object member name", colon, tokenObjectEnd);
+    }
+    if (name.length() >= (1U<<30)) throwRuntimeError("keylength >= 2^30");
+    if (features_.rejectDupKeys_ && currentValue().isMember(name)) {
+      std::string msg = "Duplicate key: '" + name + "'";
+      return addErrorAndRecover(
+          msg, tokenName, tokenObjectEnd);
+    }
+    Value& value = currentValue()[name];
+    nodes_.push(&value);
+    bool ok = readValue();
+    nodes_.pop();
+    if (!ok) // error already set
+      return recoverFromError(tokenObjectEnd);
+
+    Token comma;
+    if (!readToken(comma) ||
+        (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
+         comma.type_ != tokenComment)) {
+      return addErrorAndRecover(
+          "Missing ',' or '}' in object declaration", comma, tokenObjectEnd);
+    }
+    bool finalizeTokenOk = true;
+    while (comma.type_ == tokenComment && finalizeTokenOk)
+      finalizeTokenOk = readToken(comma);
+    if (comma.type_ == tokenObjectEnd)
+      return true;
+  }
+  return addErrorAndRecover(
+      "Missing '}' or object member name", tokenName, tokenObjectEnd);
+}
+
+bool OurReader::readArray(Token& tokenStart) {
+  Value init(arrayValue);
+  currentValue().swapPayload(init);
+  currentValue().setOffsetStart(tokenStart.start_ - begin_);
+  skipSpaces();
+  if (*current_ == ']') // empty array
+  {
+    Token endArray;
+    readToken(endArray);
+    return true;
+  }
+  int index = 0;
+  for (;;) {
+    Value& value = currentValue()[index++];
+    nodes_.push(&value);
+    bool ok = readValue();
+    nodes_.pop();
+    if (!ok) // error already set
+      return recoverFromError(tokenArrayEnd);
+
+    Token token;
+    // Accept Comment after last item in the array.
+    ok = readToken(token);
+    while (token.type_ == tokenComment && ok) {
+      ok = readToken(token);
+    }
+    bool badTokenType =
+        (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);
+    if (!ok || badTokenType) {
+      return addErrorAndRecover(
+          "Missing ',' or ']' in array declaration", token, tokenArrayEnd);
+    }
+    if (token.type_ == tokenArrayEnd)
+      break;
+  }
+  return true;
+}
+
+bool OurReader::decodeNumber(Token& token) {
+  Value decoded;
+  if (!decodeNumber(token, decoded))
+    return false;
+  currentValue().swapPayload(decoded);
+  currentValue().setOffsetStart(token.start_ - begin_);
+  currentValue().setOffsetLimit(token.end_ - begin_);
+  return true;
+}
+
+bool OurReader::decodeNumber(Token& token, Value& decoded) {
+  // Attempts to parse the number as an integer. If the number is
+  // larger than the maximum supported value of an integer then
+  // we decode the number as a double.
+  Location current = token.start_;
+  bool isNegative = *current == '-';
+  if (isNegative)
+    ++current;
+  // TODO: Help the compiler do the div and mod at compile time or get rid of them.
+  Value::LargestUInt maxIntegerValue =
+      isNegative ? Value::LargestUInt(-Value::minLargestInt)
+                 : Value::maxLargestUInt;
+  Value::LargestUInt threshold = maxIntegerValue / 10;
+  Value::LargestUInt value = 0;
+  while (current < token.end_) {
+    Char c = *current++;
+    if (c < '0' || c > '9')
+      return decodeDouble(token, decoded);
+    Value::UInt digit(static_cast<Value::UInt>(c - '0'));
+    if (value >= threshold) {
+      // We've hit or exceeded the max value divided by 10 (rounded down). If
+      // a) we've only just touched the limit, b) this is the last digit, and
+      // c) it's small enough to fit in that rounding delta, we're okay.
+      // Otherwise treat this number as a double to avoid overflow.
+      if (value > threshold || current != token.end_ ||
+          digit > maxIntegerValue % 10) {
+        return decodeDouble(token, decoded);
+      }
+    }
+    value = value * 10 + digit;
+  }
+  if (isNegative)
+    decoded = -Value::LargestInt(value);
+  else if (value <= Value::LargestUInt(Value::maxInt))
+    decoded = Value::LargestInt(value);
+  else
+    decoded = value;
+  return true;
+}
+
+bool OurReader::decodeDouble(Token& token) {
+  Value decoded;
+  if (!decodeDouble(token, decoded))
+    return false;
+  currentValue().swapPayload(decoded);
+  currentValue().setOffsetStart(token.start_ - begin_);
+  currentValue().setOffsetLimit(token.end_ - begin_);
+  return true;
+}
+
+bool OurReader::decodeDouble(Token& token, Value& decoded) {
+  double value = 0;
+  const int bufferSize = 32;
+  int count;
+  ptrdiff_t const length = token.end_ - token.start_;
+
+  // Sanity check to avoid buffer overflow exploits.
+  if (length < 0) {
+    return addError("Unable to parse token length", token);
+  }
+  size_t const ulength = static_cast<size_t>(length);
+
+  // Avoid using a string constant for the format control string given to
+  // sscanf, as this can cause hard to debug crashes on OS X. See here for more
+  // info:
+  //
+  //     http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html
+  char format[] = "%lf";
+
+  if (length <= bufferSize) {
+    Char buffer[bufferSize + 1];
+    memcpy(buffer, token.start_, ulength);
+    buffer[length] = 0;
+    count = sscanf(buffer, format, &value);
+  } else {
+    std::string buffer(token.start_, token.end_);
+    count = sscanf(buffer.c_str(), format, &value);
+  }
+
+  if (count != 1)
+    return addError("'" + std::string(token.start_, token.end_) +
+                        "' is not a number.",
+                    token);
+  decoded = value;
+  return true;
+}
+
+bool OurReader::decodeString(Token& token) {
+  std::string decoded_string;
+  if (!decodeString(token, decoded_string))
+    return false;
+  Value decoded(decoded_string);
+  currentValue().swapPayload(decoded);
+  currentValue().setOffsetStart(token.start_ - begin_);
+  currentValue().setOffsetLimit(token.end_ - begin_);
+  return true;
+}
+
+bool OurReader::decodeString(Token& token, std::string& decoded) {
+  decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
+  Location current = token.start_ + 1; // skip '"'
+  Location end = token.end_ - 1;       // do not include '"'
+  while (current != end) {
+    Char c = *current++;
+    if (c == '"')
+      break;
+    else if (c == '\\') {
+      if (current == end)
+        return addError("Empty escape sequence in string", token, current);
+      Char escape = *current++;
+      switch (escape) {
+      case '"':
+        decoded += '"';
+        break;
+      case '/':
+        decoded += '/';
+        break;
+      case '\\':
+        decoded += '\\';
+        break;
+      case 'b':
+        decoded += '\b';
+        break;
+      case 'f':
+        decoded += '\f';
+        break;
+      case 'n':
+        decoded += '\n';
+        break;
+      case 'r':
+        decoded += '\r';
+        break;
+      case 't':
+        decoded += '\t';
+        break;
+      case 'u': {
+        unsigned int unicode;
+        if (!decodeUnicodeCodePoint(token, current, end, unicode))
+          return false;
+        decoded += codePointToUTF8(unicode);
+      } break;
+      default:
+        return addError("Bad escape sequence in string", token, current);
+      }
+    } else {
+      decoded += c;
+    }
+  }
+  return true;
+}
+
+bool OurReader::decodeUnicodeCodePoint(Token& token,
+                                    Location& current,
+                                    Location end,
+                                    unsigned int& unicode) {
+
+  if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
+    return false;
+  if (unicode >= 0xD800 && unicode <= 0xDBFF) {
+    // surrogate pairs
+    if (end - current < 6)
+      return addError(
+          "additional six characters expected to parse unicode surrogate pair.",
+          token,
+          current);
+    unsigned int surrogatePair;
+    if (*(current++) == '\\' && *(current++) == 'u') {
+      if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
+        unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
+      } else
+        return false;
+    } else
+      return addError("expecting another \\u token to begin the second half of "
+                      "a unicode surrogate pair",
+                      token,
+                      current);
+  }
+  return true;
+}
+
+bool OurReader::decodeUnicodeEscapeSequence(Token& token,
+                                         Location& current,
+                                         Location end,
+                                         unsigned int& ret_unicode) {
+  if (end - current < 4)
+    return addError(
+        "Bad unicode escape sequence in string: four digits expected.",
+        token,
+        current);
+  int unicode = 0;
+  for (int index = 0; index < 4; ++index) {
+    Char c = *current++;
+    unicode *= 16;
+    if (c >= '0' && c <= '9')
+      unicode += c - '0';
+    else if (c >= 'a' && c <= 'f')
+      unicode += c - 'a' + 10;
+    else if (c >= 'A' && c <= 'F')
+      unicode += c - 'A' + 10;
+    else
+      return addError(
+          "Bad unicode escape sequence in string: hexadecimal digit expected.",
+          token,
+          current);
+  }
+  ret_unicode = static_cast<unsigned int>(unicode);
+  return true;
+}
+
+bool
+OurReader::addError(const std::string& message, Token& token, Location extra) {
+  ErrorInfo info;
+  info.token_ = token;
+  info.message_ = message;
+  info.extra_ = extra;
+  errors_.push_back(info);
+  return false;
+}
+
+bool OurReader::recoverFromError(TokenType skipUntilToken) {
+  size_t errorCount = errors_.size();
+  Token skip;
+  for (;;) {
+    if (!readToken(skip))
+      errors_.resize(errorCount); // discard errors caused by recovery
+    if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)
+      break;
+  }
+  errors_.resize(errorCount);
+  return false;
+}
+
+bool OurReader::addErrorAndRecover(const std::string& message,
+                                Token& token,
+                                TokenType skipUntilToken) {
+  addError(message, token);
+  return recoverFromError(skipUntilToken);
+}
+
+Value& OurReader::currentValue() { return *(nodes_.top()); }
+
+OurReader::Char OurReader::getNextChar() {
+  if (current_ == end_)
+    return 0;
+  return *current_++;
+}
+
+void OurReader::getLocationLineAndColumn(Location location,
+                                      int& line,
+                                      int& column) const {
+  Location current = begin_;
+  Location lastLineStart = current;
+  line = 0;
+  while (current < location && current != end_) {
+    Char c = *current++;
+    if (c == '\r') {
+      if (*current == '\n')
+        ++current;
+      lastLineStart = current;
+      ++line;
+    } else if (c == '\n') {
+      lastLineStart = current;
+      ++line;
+    }
+  }
+  // column & line start at 1
+  column = int(location - lastLineStart) + 1;
+  ++line;
+}
+
+std::string OurReader::getLocationLineAndColumn(Location location) const {
+  int line, column;
+  getLocationLineAndColumn(location, line, column);
+  char buffer[18 + 16 + 16 + 1];
+  snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
+  return buffer;
+}
+
+std::string OurReader::getFormattedErrorMessages() const {
+  std::string formattedMessage;
+  for (Errors::const_iterator itError = errors_.begin();
+       itError != errors_.end();
+       ++itError) {
+    const ErrorInfo& error = *itError;
+    formattedMessage +=
+        "* " + getLocationLineAndColumn(error.token_.start_) + "\n";
+    formattedMessage += "  " + error.message_ + "\n";
+    if (error.extra_)
+      formattedMessage +=
+          "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n";
+  }
+  return formattedMessage;
+}
+
+std::vector<OurReader::StructuredError> OurReader::getStructuredErrors() const {
+  std::vector<OurReader::StructuredError> allErrors;
+  for (Errors::const_iterator itError = errors_.begin();
+       itError != errors_.end();
+       ++itError) {
+    const ErrorInfo& error = *itError;
+    OurReader::StructuredError structured;
+    structured.offset_start = error.token_.start_ - begin_;
+    structured.offset_limit = error.token_.end_ - begin_;
+    structured.message = error.message_;
+    allErrors.push_back(structured);
+  }
+  return allErrors;
+}
+
+bool OurReader::pushError(const Value& value, const std::string& message) {
+  ptrdiff_t length = end_ - begin_;
+  if(value.getOffsetStart() > length
+    || value.getOffsetLimit() > length)
+    return false;
+  Token token;
+  token.type_ = tokenError;
+  token.start_ = begin_ + value.getOffsetStart();
+  token.end_ = end_ + value.getOffsetLimit();
+  ErrorInfo info;
+  info.token_ = token;
+  info.message_ = message;
+  info.extra_ = 0;
+  errors_.push_back(info);
+  return true;
+}
+
+bool OurReader::pushError(const Value& value, const std::string& message, const Value& extra) {
+  ptrdiff_t length = end_ - begin_;
+  if(value.getOffsetStart() > length
+    || value.getOffsetLimit() > length
+    || extra.getOffsetLimit() > length)
+    return false;
+  Token token;
+  token.type_ = tokenError;
+  token.start_ = begin_ + value.getOffsetStart();
+  token.end_ = begin_ + value.getOffsetLimit();
+  ErrorInfo info;
+  info.token_ = token;
+  info.message_ = message;
+  info.extra_ = begin_ + extra.getOffsetStart();
+  errors_.push_back(info);
+  return true;
+}
+
+bool OurReader::good() const {
+  return !errors_.size();
+}
+
+
+class OurCharReader : public CharReader {
+  bool const collectComments_;
+  OurReader reader_;
+public:
+  OurCharReader(
+    bool collectComments,
+    OurFeatures const& features)
+  : collectComments_(collectComments)
+  , reader_(features)
+  {}
+  bool parse(
+      char const* beginDoc, char const* endDoc,
+      Value* root, std::string* errs) {
+    bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
+    if (errs) {
+      *errs = reader_.getFormattedErrorMessages();
+    }
+    return ok;
+  }
+};
+
+CharReaderBuilder::CharReaderBuilder()
+{
+  setDefaults(&settings_);
+}
+CharReaderBuilder::~CharReaderBuilder()
+{}
+CharReader* CharReaderBuilder::newCharReader() const
+{
+  bool collectComments = settings_["collectComments"].asBool();
+  OurFeatures features = OurFeatures::all();
+  features.allowComments_ = settings_["allowComments"].asBool();
+  features.strictRoot_ = settings_["strictRoot"].asBool();
+  features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool();
+  features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
+  features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool();
+  features.stackLimit_ = settings_["stackLimit"].asInt();
+  features.failIfExtra_ = settings_["failIfExtra"].asBool();
+  features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
+  features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool();
+  return new OurCharReader(collectComments, features);
+}
+static void getValidReaderKeys(std::set<std::string>* valid_keys)
+{
+  valid_keys->clear();
+  valid_keys->insert("collectComments");
+  valid_keys->insert("allowComments");
+  valid_keys->insert("strictRoot");
+  valid_keys->insert("allowDroppedNullPlaceholders");
+  valid_keys->insert("allowNumericKeys");
+  valid_keys->insert("allowSingleQuotes");
+  valid_keys->insert("stackLimit");
+  valid_keys->insert("failIfExtra");
+  valid_keys->insert("rejectDupKeys");
+  valid_keys->insert("allowSpecialFloats");
+}
+bool CharReaderBuilder::validate(Json::Value* invalid) const
+{
+  Json::Value my_invalid;
+  if (!invalid) invalid = &my_invalid;  // so we do not need to test for NULL
+  Json::Value& inv = *invalid;
+  std::set<std::string> valid_keys;
+  getValidReaderKeys(&valid_keys);
+  Value::Members keys = settings_.getMemberNames();
+  size_t n = keys.size();
+  for (size_t i = 0; i < n; ++i) {
+    std::string const& key = keys[i];
+    if (valid_keys.find(key) == valid_keys.end()) {
+      inv[key] = settings_[key];
+    }
+  }
+  return 0u == inv.size();
+}
+Value& CharReaderBuilder::operator[](std::string key)
+{
+  return settings_[key];
+}
+// static
+void CharReaderBuilder::strictMode(Json::Value* settings)
+{
+//! [CharReaderBuilderStrictMode]
+  (*settings)["allowComments"] = false;
+  (*settings)["strictRoot"] = true;
+  (*settings)["allowDroppedNullPlaceholders"] = false;
+  (*settings)["allowNumericKeys"] = false;
+  (*settings)["allowSingleQuotes"] = false;
+  (*settings)["stackLimit"] = 1000;
+  (*settings)["failIfExtra"] = true;
+  (*settings)["rejectDupKeys"] = true;
+  (*settings)["allowSpecialFloats"] = false;
+//! [CharReaderBuilderStrictMode]
+}
+// static
+void CharReaderBuilder::setDefaults(Json::Value* settings)
+{
+//! [CharReaderBuilderDefaults]
+  (*settings)["collectComments"] = true;
+  (*settings)["allowComments"] = true;
+  (*settings)["strictRoot"] = false;
+  (*settings)["allowDroppedNullPlaceholders"] = false;
+  (*settings)["allowNumericKeys"] = false;
+  (*settings)["allowSingleQuotes"] = false;
+  (*settings)["stackLimit"] = 1000;
+  (*settings)["failIfExtra"] = false;
+  (*settings)["rejectDupKeys"] = false;
+  (*settings)["allowSpecialFloats"] = false;
+//! [CharReaderBuilderDefaults]
+}
+
+//////////////////////////////////
+// global functions
+
+bool parseFromStream(
+    CharReader::Factory const& fact, JSONCPP_ISTREAM& sin,
+    Value* root, std::string* errs)
+{
+  JSONCPP_OSTRINGSTREAM ssin;
+  ssin << sin.rdbuf();
+  std::string doc = ssin.str();
+  char const* begin = doc.data();
+  char const* end = begin + doc.size();
+  // Note that we do not actually need a null-terminator.
+  CharReaderPtr const reader(fact.newCharReader());
+  return reader->parse(begin, end, root, errs);
+}
+
+JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
+  CharReaderBuilder b;
+  std::string errs;
+  bool ok = parseFromStream(b, sin, &root, &errs);
+  if (!ok) {
+    fprintf(stderr,
+            "Error from reader: %s",
+            errs.c_str());
+
+    throwRuntimeError(errs);
+  }
+  return sin;
+}
+
+} // namespace Json
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: src/lib_json/json_reader.cpp
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: src/lib_json/json_valueiterator.inl
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2007-2010 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+// included by json_value.cpp
+
+namespace Json {
+
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// class ValueIteratorBase
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+
+ValueIteratorBase::ValueIteratorBase()
+    : current_(), isNull_(true) {
+}
+
+ValueIteratorBase::ValueIteratorBase(
+    const Value::ObjectValues::iterator& current)
+    : current_(current), isNull_(false) {}
+
+Value& ValueIteratorBase::deref() const {
+  return current_->second;
+}
+
+void ValueIteratorBase::increment() {
+  ++current_;
+}
+
+void ValueIteratorBase::decrement() {
+  --current_;
+}
+
+ValueIteratorBase::difference_type
+ValueIteratorBase::computeDistance(const SelfType& other) const {
+#ifdef JSON_USE_CPPTL_SMALLMAP
+  return other.current_ - current_;
+#else
+  // Iterator for null value are initialized using the default
+  // constructor, which initialize current_ to the default
+  // std::map::iterator. As begin() and end() are two instance
+  // of the default std::map::iterator, they can not be compared.
+  // To allow this, we handle this comparison specifically.
+  if (isNull_ && other.isNull_) {
+    return 0;
+  }
+
+  // Usage of std::distance is not portable (does not compile with Sun Studio 12
+  // RogueWave STL,
+  // which is the one used by default).
+  // Using a portable hand-made version for non random iterator instead:
+  //   return difference_type( std::distance( current_, other.current_ ) );
+  difference_type myDistance = 0;
+  for (Value::ObjectValues::iterator it = current_; it != other.current_;
+       ++it) {
+    ++myDistance;
+  }
+  return myDistance;
+#endif
+}
+
+bool ValueIteratorBase::isEqual(const SelfType& other) const {
+  if (isNull_) {
+    return other.isNull_;
+  }
+  return current_ == other.current_;
+}
+
+void ValueIteratorBase::copy(const SelfType& other) {
+  current_ = other.current_;
+  isNull_ = other.isNull_;
+}
+
+Value ValueIteratorBase::key() const {
+  const Value::CZString czstring = (*current_).first;
+  if (czstring.data()) {
+    if (czstring.isStaticString())
+      return Value(StaticString(czstring.data()));
+    return Value(czstring.data(), czstring.data() + czstring.length());
+  }
+  return Value(czstring.index());
+}
+
+UInt ValueIteratorBase::index() const {
+  const Value::CZString czstring = (*current_).first;
+  if (!czstring.data())
+    return czstring.index();
+  return Value::UInt(-1);
+}
+
+JSONCPP_STRING ValueIteratorBase::name() const {
+  char const* keey;
+  char const* end;
+  keey = memberName(&end);
+  if (!keey) return JSONCPP_STRING();
+  return JSONCPP_STRING(keey, end);
+}
+
+char const* ValueIteratorBase::memberName() const {
+  const char* cname = (*current_).first.data();
+  return cname ? cname : "";
+}
+
+char const* ValueIteratorBase::memberName(char const** end) const {
+  const char* cname = (*current_).first.data();
+  if (!cname) {
+    *end = NULL;
+    return NULL;
+  }
+  *end = cname + (*current_).first.length();
+  return cname;
+}
+
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// class ValueConstIterator
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+
+ValueConstIterator::ValueConstIterator() {}
+
+ValueConstIterator::ValueConstIterator(
+    const Value::ObjectValues::iterator& current)
+    : ValueIteratorBase(current) {}
+
+ValueConstIterator::ValueConstIterator(ValueIterator const& other)
+    : ValueIteratorBase(other) {}
+
+ValueConstIterator& ValueConstIterator::
+operator=(const ValueIteratorBase& other) {
+  copy(other);
+  return *this;
+}
+
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// class ValueIterator
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+
+ValueIterator::ValueIterator() {}
+
+ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current)
+    : ValueIteratorBase(current) {}
+
+ValueIterator::ValueIterator(const ValueConstIterator& other)
+    : ValueIteratorBase(other) {
+  throwRuntimeError("ConstIterator to Iterator should never be allowed.");
+}
+
+ValueIterator::ValueIterator(const ValueIterator& other)
+    : ValueIteratorBase(other) {}
+
+ValueIterator& ValueIterator::operator=(const SelfType& other) {
+  copy(other);
+  return *this;
+}
+
+} // namespace Json
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: src/lib_json/json_valueiterator.inl
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: src/lib_json/json_value.cpp
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2011 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include <json/assertions.h>
+#include <json/value.h>
+#include <json/writer.h>
+#endif // if !defined(JSON_IS_AMALGAMATION)
+#include <math.h>
+#include <sstream>
+#include <utility>
+#include <cstring>
+#include <cassert>
+#ifdef JSON_USE_CPPTL
+#include <cpptl/conststring.h>
+#endif
+#include <cstddef> // size_t
+#include <algorithm> // min()
+
+#define JSON_ASSERT_UNREACHABLE assert(false)
+
+namespace Json {
+
+// This is a walkaround to avoid the static initialization of Value::null.
+// kNull must be word-aligned to avoid crashing on ARM.  We use an alignment of
+// 8 (instead of 4) as a bit of future-proofing.
+#if defined(__ARMEL__)
+#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
+#else
+#define ALIGNAS(byte_alignment)
+#endif
+static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };
+const unsigned char& kNullRef = kNull[0];
+const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
+const Value& Value::nullRef = null;
+
+const Int Value::minInt = Int(~(UInt(-1) / 2));
+const Int Value::maxInt = Int(UInt(-1) / 2);
+const UInt Value::maxUInt = UInt(-1);
+#if defined(JSON_HAS_INT64)
+const Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2));
+const Int64 Value::maxInt64 = Int64(UInt64(-1) / 2);
+const UInt64 Value::maxUInt64 = UInt64(-1);
+// The constant is hard-coded because some compiler have trouble
+// converting Value::maxUInt64 to a double correctly (AIX/xlC).
+// Assumes that UInt64 is a 64 bits integer.
+static const double maxUInt64AsDouble = 18446744073709551615.0;
+#endif // defined(JSON_HAS_INT64)
+const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2));
+const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2);
+const LargestUInt Value::maxLargestUInt = LargestUInt(-1);
+
+#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+template <typename T, typename U>
+static inline bool InRange(double d, T min, U max) {
+  // The casts can lose precision, but we are looking only for
+  // an approximate range. Might fail on edge cases though. ~cdunn
+  //return d >= static_cast<double>(min) && d <= static_cast<double>(max);
+  return d >= min && d <= max;
+}
+#else  // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+static inline double integerToDouble(Json::UInt64 value) {
+  return static_cast<double>(Int64(value / 2)) * 2.0 + Int64(value & 1);
+}
+
+template <typename T> static inline double integerToDouble(T value) {
+  return static_cast<double>(value);
+}
+
+template <typename T, typename U>
+static inline bool InRange(double d, T min, U max) {
+  return d >= integerToDouble(min) && d <= integerToDouble(max);
+}
+#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+
+/** Duplicates the specified string value.
+ * @param value Pointer to the string to duplicate. Must be zero-terminated if
+ *              length is "unknown".
+ * @param length Length of the value. if equals to unknown, then it will be
+ *               computed using strlen(value).
+ * @return Pointer on the duplicate instance of string.
+ */
+static inline char* duplicateStringValue(const char* value,
+                                         size_t length) {
+  // Avoid an integer overflow in the call to malloc below by limiting length
+  // to a sane value.
+  if (length >= static_cast<size_t>(Value::maxInt))
+    length = Value::maxInt - 1;
+
+  char* newString = static_cast<char*>(malloc(length + 1));
+  if (newString == NULL) {
+    throwRuntimeError(
+        "in Json::Value::duplicateStringValue(): "
+        "Failed to allocate string value buffer");
+  }
+  memcpy(newString, value, length);
+  newString[length] = 0;
+  return newString;
+}
+
+/* Record the length as a prefix.
+ */
+static inline char* duplicateAndPrefixStringValue(
+    const char* value,
+    unsigned int length)
+{
+  // Avoid an integer overflow in the call to malloc below by limiting length
+  // to a sane value.
+  JSON_ASSERT_MESSAGE(length <= static_cast<unsigned>(Value::maxInt) - sizeof(unsigned) - 1U,
+                      "in Json::Value::duplicateAndPrefixStringValue(): "
+                      "length too big for prefixing");
+  unsigned actualLength = length + static_cast<unsigned>(sizeof(unsigned)) + 1U;
+  char* newString = static_cast<char*>(malloc(actualLength));
+  if (newString == 0) {
+    throwRuntimeError(
+        "in Json::Value::duplicateAndPrefixStringValue(): "
+        "Failed to allocate string value buffer");
+  }
+  *reinterpret_cast<unsigned*>(newString) = length;
+  memcpy(newString + sizeof(unsigned), value, length);
+  newString[actualLength - 1U] = 0; // to avoid buffer over-run accidents by users later
+  return newString;
+}
+inline static void decodePrefixedString(
+    bool isPrefixed, char const* prefixed,
+    unsigned* length, char const** value)
+{
+  if (!isPrefixed) {
+    *length = static_cast<unsigned>(strlen(prefixed));
+    *value = prefixed;
+  } else {
+    *length = *reinterpret_cast<unsigned const*>(prefixed);
+    *value = prefixed + sizeof(unsigned);
+  }
+}
+/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
+ */
+static inline void releaseStringValue(char* value) { free(value); }
+
+} // namespace Json
+
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// ValueInternals...
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+#if !defined(JSON_IS_AMALGAMATION)
+
+#include "json_valueiterator.inl"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+
+namespace Json {
+
+Exception::Exception(JSONCPP_STRING const& msg)
+  : msg_(msg)
+{}
+Exception::~Exception() throw()
+{}
+char const* Exception::what() const throw()
+{
+  return msg_.c_str();
+}
+RuntimeError::RuntimeError(JSONCPP_STRING const& msg)
+  : Exception(msg)
+{}
+LogicError::LogicError(JSONCPP_STRING const& msg)
+  : Exception(msg)
+{}
+void throwRuntimeError(JSONCPP_STRING const& msg)
+{
+  throw RuntimeError(msg);
+}
+void throwLogicError(JSONCPP_STRING const& msg)
+{
+  throw LogicError(msg);
+}
+
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// class Value::CommentInfo
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+
+Value::CommentInfo::CommentInfo() : comment_(0) {}
+
+Value::CommentInfo::~CommentInfo() {
+  if (comment_)
+    releaseStringValue(comment_);
+}
+
+void Value::CommentInfo::setComment(const char* text, size_t len) {
+  if (comment_) {
+    releaseStringValue(comment_);
+    comment_ = 0;
+  }
+  JSON_ASSERT(text != 0);
+  JSON_ASSERT_MESSAGE(
+      text[0] == '\0' || text[0] == '/',
+      "in Json::Value::setComment(): Comments must start with /");
+  // It seems that /**/ style comments are acceptable as well.
+  comment_ = duplicateStringValue(text, len);
+}
+
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// class Value::CZString
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+
+// Notes: policy_ indicates if the string was allocated when
+// a string is stored.
+
+Value::CZString::CZString(ArrayIndex aindex) : cstr_(0), index_(aindex) {}
+
+Value::CZString::CZString(char const* str, unsigned ulength, DuplicationPolicy allocate)
+    : cstr_(str) {
+  // allocate != duplicate
+  storage_.policy_ = allocate & 0x3;
+  storage_.length_ = ulength & 0x3FFFFFFF;
+}
+
+Value::CZString::CZString(const CZString& other)
+    : cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0
+                ? duplicateStringValue(other.cstr_, other.storage_.length_)
+                : other.cstr_) {
+  storage_.policy_ = static_cast<unsigned>(other.cstr_
+                 ? (static_cast<DuplicationPolicy>(other.storage_.policy_) == noDuplication
+                     ? noDuplication : duplicate)
+                 : static_cast<DuplicationPolicy>(other.storage_.policy_));
+  storage_.length_ = other.storage_.length_;
+}
+
+#if JSON_HAS_RVALUE_REFERENCES
+Value::CZString::CZString(CZString&& other)
+  : cstr_(other.cstr_), index_(other.index_) {
+  other.cstr_ = nullptr;
+}
+#endif
+
+Value::CZString::~CZString() {
+  if (cstr_ && storage_.policy_ == duplicate)
+    releaseStringValue(const_cast<char*>(cstr_));
+}
+
+void Value::CZString::swap(CZString& other) {
+  std::swap(cstr_, other.cstr_);
+  std::swap(index_, other.index_);
+}
+
+Value::CZString& Value::CZString::operator=(CZString other) {
+  swap(other);
+  return *this;
+}
+
+bool Value::CZString::operator<(const CZString& other) const {
+  if (!cstr_) return index_ < other.index_;
+  //return strcmp(cstr_, other.cstr_) < 0;
+  // Assume both are strings.
+  unsigned this_len = this->storage_.length_;
+  unsigned other_len = other.storage_.length_;
+  unsigned min_len = std::min(this_len, other_len);
+  JSON_ASSERT(this->cstr_ && other.cstr_);
+  int comp = memcmp(this->cstr_, other.cstr_, min_len);
+  if (comp < 0) return true;
+  if (comp > 0) return false;
+  return (this_len < other_len);
+}
+
+bool Value::CZString::operator==(const CZString& other) const {
+  if (!cstr_) return index_ == other.index_;
+  //return strcmp(cstr_, other.cstr_) == 0;
+  // Assume both are strings.
+  unsigned this_len = this->storage_.length_;
+  unsigned other_len = other.storage_.length_;
+  if (this_len != other_len) return false;
+  JSON_ASSERT(this->cstr_ && other.cstr_);
+  int comp = memcmp(this->cstr_, other.cstr_, this_len);
+  return comp == 0;
+}
+
+ArrayIndex Value::CZString::index() const { return index_; }
+
+//const char* Value::CZString::c_str() const { return cstr_; }
+const char* Value::CZString::data() const { return cstr_; }
+unsigned Value::CZString::length() const { return storage_.length_; }
+bool Value::CZString::isStaticString() const { return storage_.policy_ == noDuplication; }
+
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// class Value::Value
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+// //////////////////////////////////////////////////////////////////
+
+/*! \internal Default constructor initialization must be equivalent to:
+ * memset( this, 0, sizeof(Value) )
+ * This optimization is used in ValueInternalMap fast allocator.
+ */
+Value::Value(ValueType vtype) {
+  initBasic(vtype);
+  switch (vtype) {
+  case nullValue:
+    break;
+  case intValue:
+  case uintValue:
+    value_.int_ = 0;
+    break;
+  case realValue:
+    value_.real_ = 0.0;
+    break;
+  case stringValue:
+    value_.string_ = 0;
+    break;
+  case arrayValue:
+  case objectValue:
+    value_.map_ = new ObjectValues();
+    break;
+  case booleanValue:
+    value_.bool_ = false;
+    break;
+  default:
+    JSON_ASSERT_UNREACHABLE;
+  }
+}
+
+Value::Value(Int value) {
+  initBasic(intValue);
+  value_.int_ = value;
+}
+
+Value::Value(UInt value) {
+  initBasic(uintValue);
+  value_.uint_ = value;
+}
+#if defined(JSON_HAS_INT64)
+Value::Value(Int64 value) {
+  initBasic(intValue);
+  value_.int_ = value;
+}
+Value::Value(UInt64 value) {
+  initBasic(uintValue);
+  value_.uint_ = value;
+}
+#endif // defined(JSON_HAS_INT64)
+
+Value::Value(double value) {
+  initBasic(realValue);
+  value_.real_ = value;
+}
+
+Value::Value(const char* value) {
+  initBasic(stringValue, true);
+  value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(strlen(value)));
+}
+
+Value::Value(const char* beginValue, const char* endValue) {
+  initBasic(stringValue, true);
+  value_.string_ =
+      duplicateAndPrefixStringValue(beginValue, static_cast<unsigned>(endValue - beginValue));
+}
+
+Value::Value(const JSONCPP_STRING& value) {
+  initBasic(stringValue, true);
+  value_.string_ =
+      duplicateAndPrefixStringValue(value.data(), static_cast<unsigned>(value.length()));
+}
+
+Value::Value(const StaticString& value) {
+  initBasic(stringValue);
+  value_.string_ = const_cast<char*>(value.c_str());
+}
+
+#ifdef JSON_USE_CPPTL
+Value::Value(const CppTL::ConstString& value) {
+  initBasic(stringValue, true);
+  value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(value.length()));
+}
+#endif
+
+Value::Value(bool value) {
+  initBasic(booleanValue);
+  value_.bool_ = value;
+}
+
+Value::Value(Value const& other)
+    : type_(other.type_), allocated_(false)
+      ,
+      comments_(0), start_(other.start_), limit_(other.limit_)
+{
+  switch (type_) {
+  case nullValue:
+  case intValue:
+  case uintValue:
+  case realValue:
+  case booleanValue:
+    value_ = other.value_;
+    break;
+  case stringValue:
+    if (other.value_.string_ && other.allocated_) {
+      unsigned len;
+      char const* str;
+      decodePrefixedString(other.allocated_, other.value_.string_,
+          &len, &str);
+      value_.string_ = duplicateAndPrefixStringValue(str, len);
+      allocated_ = true;
+    } else {
+      value_.string_ = other.value_.string_;
+      allocated_ = false;
+    }
+    break;
+  case arrayValue:
+  case objectValue:
+    value_.map_ = new ObjectValues(*other.value_.map_);
+    break;
+  default:
+    JSON_ASSERT_UNREACHABLE;
+  }
+  if (other.comments_) {
+    comments_ = new CommentInfo[numberOfCommentPlacement];
+    for (int comment = 0; comment < numberOfCommentPlacement; ++comment) {
+      const CommentInfo& otherComment = other.comments_[comment];
+      if (otherComment.comment_)
+        comments_[comment].setComment(
+            otherComment.comment_, strlen(otherComment.comment_));
+    }
+  }
+}
+
+#if JSON_HAS_RVALUE_REFERENCES
+// Move constructor
+Value::Value(Value&& other) {
+  initBasic(nullValue);
+  swap(other);
+}
+#endif
+
+Value::~Value() {
+  switch (type_) {
+  case nullValue:
+  case intValue:
+  case uintValue:
+  case realValue:
+  case booleanValue:
+    break;
+  case stringValue:
+    if (allocated_)
+      releaseStringValue(value_.string_);
+    break;
+  case arrayValue:
+  case objectValue:
+    delete value_.map_;
+    break;
+  default:
+    JSON_ASSERT_UNREACHABLE;
+  }
+
+  if (comments_)
+    delete[] comments_;
+}
+
+Value& Value::operator=(Value other) {
+  swap(other);
+  return *this;
+}
+
+void Value::swapPayload(Value& other) {
+  ValueType temp = type_;
+  type_ = other.type_;
+  other.type_ = temp;
+  std::swap(value_, other.value_);
+  int temp2 = allocated_;
+  allocated_ = other.allocated_;
+  other.allocated_ = temp2 & 0x1;
+}
+
+void Value::swap(Value& other) {
+  swapPayload(other);
+  std::swap(comments_, other.comments_);
+  std::swap(start_, other.start_);
+  std::swap(limit_, other.limit_);
+}
+
+ValueType Value::type() const { return type_; }
+
+int Value::compare(const Value& other) const {
+  if (*this < other)
+    return -1;
+  if (*this > other)
+    return 1;
+  return 0;
+}
+
+bool Value::operator<(const Value& other) const {
+  int typeDelta = type_ - other.type_;
+  if (typeDelta)
+    return typeDelta < 0 ? true : false;
+  switch (type_) {
+  case nullValue:
+    return false;
+  case intValue:
+    return value_.int_ < other.value_.int_;
+  case uintValue:
+    return value_.uint_ < other.value_.uint_;
+  case realValue:
+    return value_.real_ < other.value_.real_;
+  case booleanValue:
+    return value_.bool_ < other.value_.bool_;
+  case stringValue:
+  {
+    if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
+      if (other.value_.string_) return true;
+      else return false;
+    }
+    unsigned this_len;
+    unsigned other_len;
+    char const* this_str;
+    char const* other_str;
+    decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+    decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
+    unsigned min_len = std::min(this_len, other_len);
+    JSON_ASSERT(this_str && other_str);
+    int comp = memcmp(this_str, other_str, min_len);
+    if (comp < 0) return true;
+    if (comp > 0) return false;
+    return (this_len < other_len);
+  }
+  case arrayValue:
+  case objectValue: {
+    int delta = int(value_.map_->size() - other.value_.map_->size());
+    if (delta)
+      return delta < 0;
+    return (*value_.map_) < (*other.value_.map_);
+  }
+  default:
+    JSON_ASSERT_UNREACHABLE;
+  }
+  return false; // unreachable
+}
+
+bool Value::operator<=(const Value& other) const { return !(other < *this); }
+
+bool Value::operator>=(const Value& other) const { return !(*this < other); }
+
+bool Value::operator>(const Value& other) const { return other < *this; }
+
+bool Value::operator==(const Value& other) const {
+  // if ( type_ != other.type_ )
+  // GCC 2.95.3 says:
+  // attempt to take address of bit-field structure member `Json::Value::type_'
+  // Beats me, but a temp solves the problem.
+  int temp = other.type_;
+  if (type_ != temp)
+    return false;
+  switch (type_) {
+  case nullValue:
+    return true;
+  case intValue:
+    return value_.int_ == other.value_.int_;
+  case uintValue:
+    return value_.uint_ == other.value_.uint_;
+  case realValue:
+    return value_.real_ == other.value_.real_;
+  case booleanValue:
+    return value_.bool_ == other.value_.bool_;
+  case stringValue:
+  {
+    if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
+      return (value_.string_ == other.value_.string_);
+    }
+    unsigned this_len;
+    unsigned other_len;
+    char const* this_str;
+    char const* other_str;
+    decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+    decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
+    if (this_len != other_len) return false;
+    JSON_ASSERT(this_str && other_str);
+    int comp = memcmp(this_str, other_str, this_len);
+    return comp == 0;
+  }
+  case arrayValue:
+  case objectValue:
+    return value_.map_->size() == other.value_.map_->size() &&
+           (*value_.map_) == (*other.value_.map_);
+  default:
+    JSON_ASSERT_UNREACHABLE;
+  }
+  return false; // unreachable
+}
+
+bool Value::operator!=(const Value& other) const { return !(*this == other); }
+
+const char* Value::asCString() const {
+  JSON_ASSERT_MESSAGE(type_ == stringValue,
+                      "in Json::Value::asCString(): requires stringValue");
+  if (value_.string_ == 0) return 0;
+  unsigned this_len;
+  char const* this_str;
+  decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+  return this_str;
+}
+
+bool Value::getString(char const** str, char const** cend) const {
+  if (type_ != stringValue) return false;
+  if (value_.string_ == 0) return false;
+  unsigned length;
+  decodePrefixedString(this->allocated_, this->value_.string_, &length, str);
+  *cend = *str + length;
+  return true;
+}
+
+JSONCPP_STRING Value::asString() const {
+  switch (type_) {
+  case nullValue:
+    return "";
+  case stringValue:
+  {
+    if (value_.string_ == 0) return "";
+    unsigned this_len;
+    char const* this_str;
+    decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+    return JSONCPP_STRING(this_str, this_len);
+  }
+  case booleanValue:
+    return value_.bool_ ? "true" : "false";
+  case intValue:
+    return valueToString(value_.int_);
+  case uintValue:
+    return valueToString(value_.uint_);
+  case realValue:
+    return valueToString(value_.real_);
+  default:
+    JSON_FAIL_MESSAGE("Type is not convertible to string");
+  }
+}
+
+#ifdef JSON_USE_CPPTL
+CppTL::ConstString Value::asConstString() const {
+  unsigned len;
+  char const* str;
+  decodePrefixedString(allocated_, value_.string_,
+      &len, &str);
+  return CppTL::ConstString(str, len);
+}
+#endif
+
+Value::Int Value::asInt() const {
+  switch (type_) {
+  case intValue:
+    JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range");
+    return Int(value_.int_);
+  case uintValue:
+    JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range");
+    return Int(value_.uint_);
+  case realValue:
+    JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt),
+                        "double out of Int range");
+    return Int(value_.real_);
+  case nullValue:
+    return 0;
+  case booleanValue:
+    return value_.bool_ ? 1 : 0;
+  default:
+    break;
+  }
+  JSON_FAIL_MESSAGE("Value is not convertible to Int.");
+}
+
+Value::UInt Value::asUInt() const {
+  switch (type_) {
+  case intValue:
+    JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
+    return UInt(value_.int_);
+  case uintValue:
+    JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
+    return UInt(value_.uint_);
+  case realValue:
+    JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
+                        "double out of UInt range");
+    return UInt(value_.real_);
+  case nullValue:
+    return 0;
+  case booleanValue:
+    return value_.bool_ ? 1 : 0;
+  default:
+    break;
+  }
+  JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
+}
+
+#if defined(JSON_HAS_INT64)
+
+Value::Int64 Value::asInt64() const {
+  switch (type_) {
+  case intValue:
+    return Int64(value_.int_);
+  case uintValue:
+    JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
+    return Int64(value_.uint_);
+  case realValue:
+    JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
+                        "double out of Int64 range");
+    return Int64(value_.real_);
+  case nullValue:
+    return 0;
+  case booleanValue:
+    return value_.bool_ ? 1 : 0;
+  default:
+    break;
+  }
+  JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
+}
+
+Value::UInt64 Value::asUInt64() const {
+  switch (type_) {
+  case intValue:
+    JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
+    return UInt64(value_.int_);
+  case uintValue:
+    return UInt64(value_.uint_);
+  case realValue:
+    JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
+                        "double out of UInt64 range");
+    return UInt64(value_.real_);
+  case nullValue:
+    return 0;
+  case booleanValue:
+    return value_.bool_ ? 1 : 0;
+  default:
+    break;
+  }
+  JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
+}
+#endif // if defined(JSON_HAS_INT64)
+
+LargestInt Value::asLargestInt() const {
+#if defined(JSON_NO_INT64)
+  return asInt();
+#else
+  return asInt64();
+#endif
+}
+
+LargestUInt Value::asLargestUInt() const {
+#if defined(JSON_NO_INT64)
+  return asUInt();
+#else
+  return asUInt64();
+#endif
+}
+
+double Value::asDouble() const {
+  switch (type_) {
+  case intValue:
+    return static_cast<double>(value_.int_);
+  case uintValue:
+#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+    return static_cast<double>(value_.uint_);
+#else  // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+    return integerToDouble(value_.uint_);
+#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+  case realValue:
+    return value_.real_;
+  case nullValue:
+    return 0.0;
+  case booleanValue:
+    return value_.bool_ ? 1.0 : 0.0;
+  default:
+    break;
+  }
+  JSON_FAIL_MESSAGE("Value is not convertible to double.");
+}
+
+float Value::asFloat() const {
+  switch (type_) {
+  case intValue:
+    return static_cast<float>(value_.int_);
+  case uintValue:
+#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+    return static_cast<float>(value_.uint_);
+#else  // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+    // This can fail (silently?) if the value is bigger than MAX_FLOAT.
+    return static_cast<float>(integerToDouble(value_.uint_));
+#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
+  case realValue:
+    return static_cast<float>(value_.real_);
+  case nullValue:
+    return 0.0;
+  case booleanValue:
+    return value_.bool_ ? 1.0f : 0.0f;
+  default:
+    break;
+  }
+  JSON_FAIL_MESSAGE("Value is not convertible to float.");
+}
+
+bool Value::asBool() const {
+  switch (type_) {
+  case booleanValue:
+    return value_.bool_;
+  case nullValue:
+    return false;
+  case intValue:
+    return value_.int_ ? true : false;
+  case uintValue:
+    return value_.uint_ ? true : false;
+  case realValue:
+    // This is kind of strange. Not recommended.
+    return (value_.real_ != 0.0) ? true : false;
+  default:
+    break;
+  }
+  JSON_FAIL_MESSAGE("Value is not convertible to bool.");
+}
+
+bool Value::isConvertibleTo(ValueType other) const {
+  switch (other) {
+  case nullValue:
+    return (isNumeric() && asDouble() == 0.0) ||
+           (type_ == booleanValue && value_.bool_ == false) ||
+           (type_ == stringValue && asString() == "") ||
+           (type_ == arrayValue && value_.map_->size() == 0) ||
+           (type_ == objectValue && value_.map_->size() == 0) ||
+           type_ == nullValue;
+  case intValue:
+    return isInt() ||
+           (type_ == realValue && InRange(value_.real_, minInt, maxInt)) ||
+           type_ == booleanValue || type_ == nullValue;
+  case uintValue:
+    return isUInt() ||
+           (type_ == realValue && InRange(value_.real_, 0, maxUInt)) ||
+           type_ == booleanValue || type_ == nullValue;
+  case realValue:
+    return isNumeric() || type_ == booleanValue || type_ == nullValue;
+  case booleanValue:
+    return isNumeric() || type_ == booleanValue || type_ == nullValue;
+  case stringValue:
+    return isNumeric() || type_ == booleanValue || type_ == stringValue ||
+           type_ == nullValue;
+  case arrayValue:
+    return type_ == arrayValue || type_ == nullValue;
+  case objectValue:
+    return type_ == objectValue || type_ == nullValue;
+  }
+  JSON_ASSERT_UNREACHABLE;
+  return false;
+}
+
+/// Number of values in array or object
+ArrayIndex Value::size() const {
+  switch (type_) {
+  case nullValue:
+  case intValue:
+  case uintValue:
+  case realValue:
+  case booleanValue:
+  case stringValue:
+    return 0;
+  case arrayValue: // size of the array is highest index + 1
+    if (!value_.map_->empty()) {
+      ObjectValues::const_iterator itLast = value_.map_->end();
+      --itLast;
+      return (*itLast).first.index() + 1;
+    }
+    return 0;
+  case objectValue:
+    return ArrayIndex(value_.map_->size());
+  }
+  JSON_ASSERT_UNREACHABLE;
+  return 0; // unreachable;
+}
+
+bool Value::empty() const {
+  if (isNull() || isArray() || isObject())
+    return size() == 0u;
+  else
+    return false;
+}
+
+bool Value::operator!() const { return isNull(); }
+
+void Value::clear() {
+  JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue ||
+                          type_ == objectValue,
+                      "in Json::Value::clear(): requires complex value");
+  start_ = 0;
+  limit_ = 0;
+  switch (type_) {
+  case arrayValue:
+  case objectValue:
+    value_.map_->clear();
+    break;
+  default:
+    break;
+  }
+}
+
+void Value::resize(ArrayIndex newSize) {
+  JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,
+                      "in Json::Value::resize(): requires arrayValue");
+  if (type_ == nullValue)
+    *this = Value(arrayValue);
+  ArrayIndex oldSize = size();
+  if (newSize == 0)
+    clear();
+  else if (newSize > oldSize)
+    (*this)[newSize - 1];
+  else {
+    for (ArrayIndex index = newSize; index < oldSize; ++index) {
+      value_.map_->erase(index);
+    }
+    JSON_ASSERT(size() == newSize);
+  }
+}
+
+Value& Value::operator[](ArrayIndex index) {
+  JSON_ASSERT_MESSAGE(
+      type_ == nullValue || type_ == arrayValue,
+      "in Json::Value::operator[](ArrayIndex): requires arrayValue");
+  if (type_ == nullValue)
+    *this = Value(arrayValue);
+  CZString key(index);
+  ObjectValues::iterator it = value_.map_->lower_bound(key);
+  if (it != value_.map_->end() && (*it).first == key)
+    return (*it).second;
+
+  ObjectValues::value_type defaultValue(key, nullRef);
+  it = value_.map_->insert(it, defaultValue);
+  return (*it).second;
+}
+
+Value& Value::operator[](int index) {
+  JSON_ASSERT_MESSAGE(
+      index >= 0,
+      "in Json::Value::operator[](int index): index cannot be negative");
+  return (*this)[ArrayIndex(index)];
+}
+
+const Value& Value::operator[](ArrayIndex index) const {
+  JSON_ASSERT_MESSAGE(
+      type_ == nullValue || type_ == arrayValue,
+      "in Json::Value::operator[](ArrayIndex)const: requires arrayValue");
+  if (type_ == nullValue)
+    return nullRef;
+  CZString key(index);
+  ObjectValues::const_iterator it = value_.map_->find(key);
+  if (it == value_.map_->end())
+    return nullRef;
+  return (*it).second;
+}
+
+const Value& Value::operator[](int index) const {
+  JSON_ASSERT_MESSAGE(
+      index >= 0,
+      "in Json::Value::operator[](int index) const: index cannot be negative");
+  return (*this)[ArrayIndex(index)];
+}
+
+void Value::initBasic(ValueType vtype, bool allocated) {
+  type_ = vtype;
+  allocated_ = allocated;
+  comments_ = 0;
+  start_ = 0;
+  limit_ = 0;
+}
+
+// Access an object value by name, create a null member if it does not exist.
+// @pre Type of '*this' is object or null.
+// @param key is null-terminated.
+Value& Value::resolveReference(const char* key) {
+  JSON_ASSERT_MESSAGE(
+      type_ == nullValue || type_ == objectValue,
+      "in Json::Value::resolveReference(): requires objectValue");
+  if (type_ == nullValue)
+    *this = Value(objectValue);
+  CZString actualKey(
+      key, static_cast<unsigned>(strlen(key)), CZString::noDuplication); // NOTE!
+  ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
+  if (it != value_.map_->end() && (*it).first == actualKey)
+    return (*it).second;
+
+  ObjectValues::value_type defaultValue(actualKey, nullRef);
+  it = value_.map_->insert(it, defaultValue);
+  Value& value = (*it).second;
+  return value;
+}
+
+// @param key is not null-terminated.
+Value& Value::resolveReference(char const* key, char const* cend)
+{
+  JSON_ASSERT_MESSAGE(
+      type_ == nullValue || type_ == objectValue,
+      "in Json::Value::resolveReference(key, end): requires objectValue");
+  if (type_ == nullValue)
+    *this = Value(objectValue);
+  CZString actualKey(
+      key, static_cast<unsigned>(cend-key), CZString::duplicateOnCopy);
+  ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
+  if (it != value_.map_->end() && (*it).first == actualKey)
+    return (*it).second;
+
+  ObjectValues::value_type defaultValue(actualKey, nullRef);
+  it = value_.map_->insert(it, defaultValue);
+  Value& value = (*it).second;
+  return value;
+}
+
+Value Value::get(ArrayIndex index, const Value& defaultValue) const {
+  const Value* value = &((*this)[index]);
+  return value == &nullRef ? defaultValue : *value;
+}
+
+bool Value::isValidIndex(ArrayIndex index) const { return index < size(); }
+
+Value const* Value::find(char const* key, char const* cend) const
+{
+  JSON_ASSERT_MESSAGE(
+      type_ == nullValue || type_ == objectValue,
+      "in Json::Value::find(key, end, found): requires objectValue or nullValue");
+  if (type_ == nullValue) return NULL;
+  CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
+  ObjectValues::const_iterator it = value_.map_->find(actualKey);
+  if (it == value_.map_->end()) return NULL;
+  return &(*it).second;
+}
+const Value& Value::operator[](const char* key) const
+{
+  Value const* found = find(key, key + strlen(key));
+  if (!found) return nullRef;
+  return *found;
+}
+Value const& Value::operator[](JSONCPP_STRING const& key) const
+{
+  Value const* found = find(key.data(), key.data() + key.length());
+  if (!found) return nullRef;
+  return *found;
+}
+
+Value& Value::operator[](const char* key) {
+  return resolveReference(key, key + strlen(key));
+}
+
+Value& Value::operator[](const JSONCPP_STRING& key) {
+  return resolveReference(key.data(), key.data() + key.length());
+}
+
+Value& Value::operator[](const StaticString& key) {
+  return resolveReference(key.c_str());
+}
+
+#ifdef JSON_USE_CPPTL
+Value& Value::operator[](const CppTL::ConstString& key) {
+  return resolveReference(key.c_str(), key.end_c_str());
+}
+Value const& Value::operator[](CppTL::ConstString const& key) const
+{
+  Value const* found = find(key.c_str(), key.end_c_str());
+  if (!found) return nullRef;
+  return *found;
+}
+#endif
+
+Value& Value::append(const Value& value) { return (*this)[size()] = value; }
+
+Value Value::get(char const* key, char const* cend, Value const& defaultValue) const
+{
+  Value const* found = find(key, cend);
+  return !found ? defaultValue : *found;
+}
+Value Value::get(char const* key, Value const& defaultValue) const
+{
+  return get(key, key + strlen(key), defaultValue);
+}
+Value Value::get(JSONCPP_STRING const& key, Value const& defaultValue) const
+{
+  return get(key.data(), key.data() + key.length(), defaultValue);
+}
+
+
+bool Value::removeMember(const char* key, const char* cend, Value* removed)
+{
+  if (type_ != objectValue) {
+    return false;
+  }
+  CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
+  ObjectValues::iterator it = value_.map_->find(actualKey);
+  if (it == value_.map_->end())
+    return false;
+  *removed = it->second;
+  value_.map_->erase(it);
+  return true;
+}
+bool Value::removeMember(const char* key, Value* removed)
+{
+  return removeMember(key, key + strlen(key), removed);
+}
+bool Value::removeMember(JSONCPP_STRING const& key, Value* removed)
+{
+  return removeMember(key.data(), key.data() + key.length(), removed);
+}
+Value Value::removeMember(const char* key)
+{
+  JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
+                      "in Json::Value::removeMember(): requires objectValue");
+  if (type_ == nullValue)
+    return nullRef;
+
+  Value removed;  // null
+  removeMember(key, key + strlen(key), &removed);
+  return removed; // still null if removeMember() did nothing
+}
+Value Value::removeMember(const JSONCPP_STRING& key)
+{
+  return removeMember(key.c_str());
+}
+
+bool Value::removeIndex(ArrayIndex index, Value* removed) {
+  if (type_ != arrayValue) {
+    return false;
+  }
+  CZString key(index);
+  ObjectValues::iterator it = value_.map_->find(key);
+  if (it == value_.map_->end()) {
+    return false;
+  }
+  *removed = it->second;
+  ArrayIndex oldSize = size();
+  // shift left all items left, into the place of the "removed"
+  for (ArrayIndex i = index; i < (oldSize - 1); ++i){
+    CZString keey(i);
+    (*value_.map_)[keey] = (*this)[i + 1];
+  }
+  // erase the last one ("leftover")
+  CZString keyLast(oldSize - 1);
+  ObjectValues::iterator itLast = value_.map_->find(keyLast);
+  value_.map_->erase(itLast);
+  return true;
+}
+
+#ifdef JSON_USE_CPPTL
+Value Value::get(const CppTL::ConstString& key,
+                 const Value& defaultValue) const {
+  return get(key.c_str(), key.end_c_str(), defaultValue);
+}
+#endif
+
+bool Value::isMember(char const* key, char const* cend) const
+{
+  Value const* value = find(key, cend);
+  return NULL != value;
+}
+bool Value::isMember(char const* key) const
+{
+  return isMember(key, key + strlen(key));
+}
+bool Value::isMember(JSONCPP_STRING const& key) const
+{
+  return isMember(key.data(), key.data() + key.length());
+}
+
+#ifdef JSON_USE_CPPTL
+bool Value::isMember(const CppTL::ConstString& key) const {
+  return isMember(key.c_str(), key.end_c_str());
+}
+#endif
+
+Value::Members Value::getMemberNames() const {
+  JSON_ASSERT_MESSAGE(
+      type_ == nullValue || type_ == objectValue,
+      "in Json::Value::getMemberNames(), value must be objectValue");
+  if (type_ == nullValue)
+    return Value::Members();
+  Members members;
+  members.reserve(value_.map_->size());
+  ObjectValues::const_iterator it = value_.map_->begin();
+  ObjectValues::const_iterator itEnd = value_.map_->end();
+  for (; it != itEnd; ++it) {
+    members.push_back(JSONCPP_STRING((*it).first.data(),
+                                  (*it).first.length()));
+  }
+  return members;
+}
+//
+//# ifdef JSON_USE_CPPTL
+// EnumMemberNames
+// Value::enumMemberNames() const
+//{
+//   if ( type_ == objectValue )
+//   {
+//      return CppTL::Enum::any(  CppTL::Enum::transform(
+//         CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ),
+//         MemberNamesTransform() ) );
+//   }
+//   return EnumMemberNames();
+//}
+//
+//
+// EnumValues
+// Value::enumValues() const
+//{
+//   if ( type_ == objectValue  ||  type_ == arrayValue )
+//      return CppTL::Enum::anyValues( *(value_.map_),
+//                                     CppTL::Type<const Value &>() );
+//   return EnumValues();
+//}
+//
+//# endif
+
+static bool IsIntegral(double d) {
+  double integral_part;
+  return modf(d, &integral_part) == 0.0;
+}
+
+bool Value::isNull() const { return type_ == nullValue; }
+
+bool Value::isBool() const { return type_ == booleanValue; }
+
+bool Value::isInt() const {
+  switch (type_) {
+  case intValue:
+    return value_.int_ >= minInt && value_.int_ <= maxInt;
+  case uintValue:
+    return value_.uint_ <= UInt(maxInt);
+  case realValue:
+    return value_.real_ >= minInt && value_.real_ <= maxInt &&
+           IsIntegral(value_.real_);
+  default:
+    break;
+  }
+  return false;
+}
+
+bool Value::isUInt() const {
+  switch (type_) {
+  case intValue:
+    return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt);
+  case uintValue:
+    return value_.uint_ <= maxUInt;
+  case realValue:
+    return value_.real_ >= 0 && value_.real_ <= maxUInt &&
+           IsIntegral(value_.real_);
+  default:
+    break;
+  }
+  return false;
+}
+
+bool Value::isInt64() const {
+#if defined(JSON_HAS_INT64)
+  switch (type_) {
+  case intValue:
+    return true;
+  case uintValue:
+    return value_.uint_ <= UInt64(maxInt64);
+  case realValue:
+    // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a
+    // double, so double(maxInt64) will be rounded up to 2^63. Therefore we
+    // require the value to be strictly less than the limit.
+    return value_.real_ >= double(minInt64) &&
+           value_.real_ < double(maxInt64) && IsIntegral(value_.real_);
+  default:
+    break;
+  }
+#endif // JSON_HAS_INT64
+  return false;
+}
+
+bool Value::isUInt64() const {
+#if defined(JSON_HAS_INT64)
+  switch (type_) {
+  case intValue:
+    return value_.int_ >= 0;
+  case uintValue:
+    return true;
+  case realValue:
+    // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
+    // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
+    // require the value to be strictly less than the limit.
+    return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble &&
+           IsIntegral(value_.real_);
+  default:
+    break;
+  }
+#endif // JSON_HAS_INT64
+  return false;
+}
+
+bool Value::isIntegral() const {
+#if defined(JSON_HAS_INT64)
+  return isInt64() || isUInt64();
+#else
+  return isInt() || isUInt();
+#endif
+}
+
+bool Value::isDouble() const { return type_ == realValue || isIntegral(); }
+
+bool Value::isNumeric() const { return isIntegral() || isDouble(); }
+
+bool Value::isString() const { return type_ == stringValue; }
+
+bool Value::isArray() const { return type_ == arrayValue; }
+
+bool Value::isObject() const { return type_ == objectValue; }
+
+void Value::setComment(const char* comment, size_t len, CommentPlacement placement) {
+  if (!comments_)
+    comments_ = new CommentInfo[numberOfCommentPlacement];
+  if ((len > 0) && (comment[len-1] == '\n')) {
+    // Always discard trailing newline, to aid indentation.
+    len -= 1;
+  }
+  comments_[placement].setComment(comment, len);
+}
+
+void Value::setComment(const char* comment, CommentPlacement placement) {
+  setComment(comment, strlen(comment), placement);
+}
+
+void Value::setComment(const JSONCPP_STRING& comment, CommentPlacement placement) {
+  setComment(comment.c_str(), comment.length(), placement);
+}
+
+bool Value::hasComment(CommentPlacement placement) const {
+  return comments_ != 0 && comments_[placement].comment_ != 0;
+}
+
+JSONCPP_STRING Value::getComment(CommentPlacement placement) const {
+  if (hasComment(placement))
+    return comments_[placement].comment_;
+  return "";
+}
+
+void Value::setOffsetStart(ptrdiff_t start) { start_ = start; }
+
+void Value::setOffsetLimit(ptrdiff_t limit) { limit_ = limit; }
+
+ptrdiff_t Value::getOffsetStart() const { return start_; }
+
+ptrdiff_t Value::getOffsetLimit() const { return limit_; }
+
+JSONCPP_STRING Value::toStyledString() const {
+  StyledWriter writer;
+  return writer.write(*this);
+}
+
+Value::const_iterator Value::begin() const {
+  switch (type_) {
+  case arrayValue:
+  case objectValue:
+    if (value_.map_)
+      return const_iterator(value_.map_->begin());
+    break;
+  default:
+    break;
+  }
+  return const_iterator();
+}
+
+Value::const_iterator Value::end() const {
+  switch (type_) {
+  case arrayValue:
+  case objectValue:
+    if (value_.map_)
+      return const_iterator(value_.map_->end());
+    break;
+  default:
+    break;
+  }
+  return const_iterator();
+}
+
+Value::iterator Value::begin() {
+  switch (type_) {
+  case arrayValue:
+  case objectValue:
+    if (value_.map_)
+      return iterator(value_.map_->begin());
+    break;
+  default:
+    break;
+  }
+  return iterator();
+}
+
+Value::iterator Value::end() {
+  switch (type_) {
+  case arrayValue:
+  case objectValue:
+    if (value_.map_)
+      return iterator(value_.map_->end());
+    break;
+  default:
+    break;
+  }
+  return iterator();
+}
+
+// class PathArgument
+// //////////////////////////////////////////////////////////////////
+
+PathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {}
+
+PathArgument::PathArgument(ArrayIndex index)
+    : key_(), index_(index), kind_(kindIndex) {}
+
+PathArgument::PathArgument(const char* key)
+    : key_(key), index_(), kind_(kindKey) {}
+
+PathArgument::PathArgument(const JSONCPP_STRING& key)
+    : key_(key.c_str()), index_(), kind_(kindKey) {}
+
+// class Path
+// //////////////////////////////////////////////////////////////////
+
+Path::Path(const JSONCPP_STRING& path,
+           const PathArgument& a1,
+           const PathArgument& a2,
+           const PathArgument& a3,
+           const PathArgument& a4,
+           const PathArgument& a5) {
+  InArgs in;
+  in.push_back(&a1);
+  in.push_back(&a2);
+  in.push_back(&a3);
+  in.push_back(&a4);
+  in.push_back(&a5);
+  makePath(path, in);
+}
+
+void Path::makePath(const JSONCPP_STRING& path, const InArgs& in) {
+  const char* current = path.c_str();
+  const char* end = current + path.length();
+  InArgs::const_iterator itInArg = in.begin();
+  while (current != end) {
+    if (*current == '[') {
+      ++current;
+      if (*current == '%')
+        addPathInArg(path, in, itInArg, PathArgument::kindIndex);
+      else {
+        ArrayIndex index = 0;
+        for (; current != end && *current >= '0' && *current <= '9'; ++current)
+          index = index * 10 + ArrayIndex(*current - '0');
+        args_.push_back(index);
+      }
+      if (current == end || *current++ != ']')
+        invalidPath(path, int(current - path.c_str()));
+    } else if (*current == '%') {
+      addPathInArg(path, in, itInArg, PathArgument::kindKey);
+      ++current;
+    } else if (*current == '.') {
+      ++current;
+    } else {
+      const char* beginName = current;
+      while (current != end && !strchr("[.", *current))
+        ++current;
+      args_.push_back(JSONCPP_STRING(beginName, current));
+    }
+  }
+}
+
+void Path::addPathInArg(const JSONCPP_STRING& /*path*/,
+                        const InArgs& in,
+                        InArgs::const_iterator& itInArg,
+                        PathArgument::Kind kind) {
+  if (itInArg == in.end()) {
+    // Error: missing argument %d
+  } else if ((*itInArg)->kind_ != kind) {
+    // Error: bad argument type
+  } else {
+    args_.push_back(**itInArg);
+  }
+}
+
+void Path::invalidPath(const JSONCPP_STRING& /*path*/, int /*location*/) {
+  // Error: invalid path.
+}
+
+const Value& Path::resolve(const Value& root) const {
+  const Value* node = &root;
+  for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
+    const PathArgument& arg = *it;
+    if (arg.kind_ == PathArgument::kindIndex) {
+      if (!node->isArray() || !node->isValidIndex(arg.index_)) {
+        // Error: unable to resolve path (array value expected at position...
+      }
+      node = &((*node)[arg.index_]);
+    } else if (arg.kind_ == PathArgument::kindKey) {
+      if (!node->isObject()) {
+        // Error: unable to resolve path (object value expected at position...)
+      }
+      node = &((*node)[arg.key_]);
+      if (node == &Value::nullRef) {
+        // Error: unable to resolve path (object has no member named '' at
+        // position...)
+      }
+    }
+  }
+  return *node;
+}
+
+Value Path::resolve(const Value& root, const Value& defaultValue) const {
+  const Value* node = &root;
+  for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
+    const PathArgument& arg = *it;
+    if (arg.kind_ == PathArgument::kindIndex) {
+      if (!node->isArray() || !node->isValidIndex(arg.index_))
+        return defaultValue;
+      node = &((*node)[arg.index_]);
+    } else if (arg.kind_ == PathArgument::kindKey) {
+      if (!node->isObject())
+        return defaultValue;
+      node = &((*node)[arg.key_]);
+      if (node == &Value::nullRef)
+        return defaultValue;
+    }
+  }
+  return *node;
+}
+
+Value& Path::make(Value& root) const {
+  Value* node = &root;
+  for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
+    const PathArgument& arg = *it;
+    if (arg.kind_ == PathArgument::kindIndex) {
+      if (!node->isArray()) {
+        // Error: node is not an array at position ...
+      }
+      node = &((*node)[arg.index_]);
+    } else if (arg.kind_ == PathArgument::kindKey) {
+      if (!node->isObject()) {
+        // Error: node is not an object at position...
+      }
+      node = &((*node)[arg.key_]);
+    }
+  }
+  return *node;
+}
+
+} // namespace Json
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: src/lib_json/json_value.cpp
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+// //////////////////////////////////////////////////////////////////////
+// Beginning of content of file: src/lib_json/json_writer.cpp
+// //////////////////////////////////////////////////////////////////////
+
+// Copyright 2011 Baptiste Lepilleur
+// Distributed under MIT license, or public domain if desired and
+// recognized in your jurisdiction.
+// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+#if !defined(JSON_IS_AMALGAMATION)
+#include <json/writer.h>
+#include "json_tool.h"
+#endif // if !defined(JSON_IS_AMALGAMATION)
+#include <iomanip>
+#include <memory>
+#include <sstream>
+#include <utility>
+#include <set>
+#include <cassert>
+#include <cstring>
+#include <cstdio>
+
+#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1800 // Between VC++ 6.0 and VC++ 11.0
+#include <float.h>
+#define isfinite _finite
+#elif defined(__sun) && defined(__SVR4) //Solaris
+#if !defined(isfinite)
+#include <ieeefp.h>
+#define isfinite finite
+#endif
+#elif defined(_AIX)
+#if !defined(isfinite)
+#include <math.h>
+#define isfinite finite
+#endif
+#elif defined(__hpux)
+#if !defined(isfinite)
+#if defined(__ia64) && !defined(finite)
+#define isfinite(x) ((sizeof(x) == sizeof(float) ? \
+                     _Isfinitef(x) : _IsFinite(x)))
+#else
+#include <math.h>
+#define isfinite finite
+#endif
+#endif
+#else
+#include <cmath>
+#if !(defined(__QNXNTO__)) // QNX already defines isfinite
+#define isfinite std::isfinite
+#endif
+#endif
+
+#if defined(_MSC_VER)
+#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
+#define snprintf sprintf_s
+#elif _MSC_VER >= 1900 // VC++ 14.0 and above
+#define snprintf std::snprintf
+#else
+#define snprintf _snprintf
+#endif
+#elif defined(__ANDROID__) || defined(__QNXNTO__)
+#define snprintf snprintf
+#elif __cplusplus >= 201103L
+#if !defined(__MINGW32__) && !defined(__CYGWIN__)
+#define snprintf std::snprintf
+#endif
+#endif
+
+#if defined(__BORLANDC__)
+#include <float.h>
+#define isfinite _finite
+#define snprintf _snprintf
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
+// Disable warning about strdup being deprecated.
+#pragma warning(disable : 4996)
+#endif
+
+namespace Json {
+
+#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
+typedef std::unique_ptr<StreamWriter> StreamWriterPtr;
+#else
+typedef std::auto_ptr<StreamWriter>   StreamWriterPtr;
+#endif
+
+static bool containsControlCharacter(const char* str) {
+  while (*str) {
+    if (isControlCharacter(*(str++)))
+      return true;
+  }
+  return false;
+}
+
+static bool containsControlCharacter0(const char* str, unsigned len) {
+  char const* end = str + len;
+  while (end != str) {
+    if (isControlCharacter(*str) || 0==*str)
+      return true;
+    ++str;
+  }
+  return false;
+}
+
+std::string valueToString(LargestInt value) {
+  UIntToStringBuffer buffer;
+  char* current = buffer + sizeof(buffer);
+  if (value == Value::minLargestInt) {
+    uintToString(LargestUInt(Value::maxLargestInt) + 1, current);
+    *--current = '-';
+  } else if (value < 0) {
+    uintToString(LargestUInt(-value), current);
+    *--current = '-';
+  } else {
+    uintToString(LargestUInt(value), current);
+  }
+  assert(current >= buffer);
+  return current;
+}
+
+std::string valueToString(LargestUInt value) {
+  UIntToStringBuffer buffer;
+  char* current = buffer + sizeof(buffer);
+  uintToString(value, current);
+  assert(current >= buffer);
+  return current;
+}
+
+#if defined(JSON_HAS_INT64)
+
+std::string valueToString(Int value) {
+  return valueToString(LargestInt(value));
+}
+
+std::string valueToString(UInt value) {
+  return valueToString(LargestUInt(value));
+}
+
+#endif // # if defined(JSON_HAS_INT64)
+
+std::string valueToString(double value, bool useSpecialFloats, unsigned int precision) {
+  // Allocate a buffer that is more than large enough to store the 16 digits of
+  // precision requested below.
+  char buffer[32];
+  int len = -1;
+
+  char formatString[6];
+  sprintf(formatString, "%%.%dg", precision);
+
+  // Print into the buffer. We need not request the alternative representation
+  // that always has a decimal point because JSON doesn't distingish the
+  // concepts of reals and integers.
+  if (isfinite(value)) {
+    len = snprintf(buffer, sizeof(buffer), formatString, value);
+  } else {
+    // IEEE standard states that NaN values will not compare to themselves
+    if (value != value) {
+      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "NaN" : "null");
+    } else if (value < 0) {
+      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "-Infinity" : "-1e+9999");
+    } else {
+      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "Infinity" : "1e+9999");
+    }
+    // For those, we do not need to call fixNumLoc, but it is fast.
+  }
+  assert(len >= 0);
+  fixNumericLocale(buffer, buffer + len);
+  return buffer;
+}
+
+std::string valueToString(double value) { return valueToString(value, false, 17); }
+
+std::string valueToString(bool value) { return value ? "true" : "false"; }
+
+std::string valueToQuotedString(const char* value) {
+  if (value == NULL)
+    return "";
+  // Not sure how to handle unicode...
+  if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL &&
+      !containsControlCharacter(value))
+    return std::string("\"") + value + "\"";
+  // We have to walk value and escape any special characters.
+  // Appending to std::string is not efficient, but this should be rare.
+  // (Note: forward slashes are *not* rare, but I am not escaping them.)
+  std::string::size_type maxsize =
+      strlen(value) * 2 + 3; // allescaped+quotes+NULL
+  std::string result;
+  result.reserve(maxsize); // to avoid lots of mallocs
+  result += "\"";
+  for (const char* c = value; *c != 0; ++c) {
+    switch (*c) {
+    case '\"':
+      result += "\\\"";
+      break;
+    case '\\':
+      result += "\\\\";
+      break;
+    case '\b':
+      result += "\\b";
+      break;
+    case '\f':
+      result += "\\f";
+      break;
+    case '\n':
+      result += "\\n";
+      break;
+    case '\r':
+      result += "\\r";
+      break;
+    case '\t':
+      result += "\\t";
+      break;
+    // case '/':
+    // Even though \/ is considered a legal escape in JSON, a bare
+    // slash is also legal, so I see no reason to escape it.
+    // (I hope I am not misunderstanding something.
+    // blep notes: actually escaping \/ may be useful in javascript to avoid </
+    // sequence.
+    // Should add a flag to allow this compatibility mode and prevent this
+    // sequence from occurring.
+    default:
+      if (isControlCharacter(*c)) {
+        JSONCPP_OSTRINGSTREAM oss;
+        oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
+            << std::setw(4) << static_cast<int>(*c);
+        result += oss.str();
+      } else {
+        result += *c;
+      }
+      break;
+    }
+  }
+  result += "\"";
+  return result;
+}
+
+// https://github.com/upcaste/upcaste/blob/master/src/upcore/src/cstring/strnpbrk.cpp
+static char const* strnpbrk(char const* s, char const* accept, size_t n) {
+  assert((s || !n) && accept);
+
+  char const* const end = s + n;
+  for (char const* cur = s; cur < end; ++cur) {
+    int const c = *cur;
+    for (char const* a = accept; *a; ++a) {
+      if (*a == c) {
+        return cur;
+      }
+    }
+  }
+  return NULL;
+}
+static std::string valueToQuotedStringN(const char* value, unsigned length) {
+  if (value == NULL)
+    return "";
+  // Not sure how to handle unicode...
+  if (strnpbrk(value, "\"\\\b\f\n\r\t", length) == NULL &&
+      !containsControlCharacter0(value, length))
+    return std::string("\"") + value + "\"";
+  // We have to walk value and escape any special characters.
+  // Appending to std::string is not efficient, but this should be rare.
+  // (Note: forward slashes are *not* rare, but I am not escaping them.)
+  std::string::size_type maxsize =
+      length * 2 + 3; // allescaped+quotes+NULL
+  std::string result;
+  result.reserve(maxsize); // to avoid lots of mallocs
+  result += "\"";
+  char const* end = value + length;
+  for (const char* c = value; c != end; ++c) {
+    switch (*c) {
+    case '\"':
+      result += "\\\"";
+      break;
+    case '\\':
+      result += "\\\\";
+      break;
+    case '\b':
+      result += "\\b";
+      break;
+    case '\f':
+      result += "\\f";
+      break;
+    case '\n':
+      result += "\\n";
+      break;
+    case '\r':
+      result += "\\r";
+      break;
+    case '\t':
+      result += "\\t";
+      break;
+    // case '/':
+    // Even though \/ is considered a legal escape in JSON, a bare
+    // slash is also legal, so I see no reason to escape it.
+    // (I hope I am not misunderstanding something.)
+    // blep notes: actually escaping \/ may be useful in javascript to avoid </
+    // sequence.
+    // Should add a flag to allow this compatibility mode and prevent this
+    // sequence from occurring.
+    default:
+      if ((isControlCharacter(*c)) || (*c == 0)) {
+        JSONCPP_OSTRINGSTREAM oss;
+        oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
+            << std::setw(4) << static_cast<int>(*c);
+        result += oss.str();
+      } else {
+        result += *c;
+      }
+      break;
+    }
+  }
+  result += "\"";
+  return result;
+}
+
+// Class Writer
+// //////////////////////////////////////////////////////////////////
+Writer::~Writer() {}
+
+// Class FastWriter
+// //////////////////////////////////////////////////////////////////
+
+FastWriter::FastWriter()
+    : yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false),
+      omitEndingLineFeed_(false) {}
+
+void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; }
+
+void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }
+
+void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }
+
+std::string FastWriter::write(const Value& root) {
+  document_ = "";
+  writeValue(root);
+  if (!omitEndingLineFeed_)
+    document_ += "\n";
+  return document_;
+}
+
+void FastWriter::writeValue(const Value& value) {
+  switch (value.type()) {
+  case nullValue:
+    if (!dropNullPlaceholders_)
+      document_ += "null";
+    break;
+  case intValue:
+    document_ += valueToString(value.asLargestInt());
+    break;
+  case uintValue:
+    document_ += valueToString(value.asLargestUInt());
+    break;
+  case realValue:
+    document_ += valueToString(value.asDouble());
+    break;
+  case stringValue:
+  {
+    // Is NULL possible for value.string_?
+    char const* str;
+    char const* end;
+    bool ok = value.getString(&str, &end);
+    if (ok) document_ += valueToQuotedStringN(str, static_cast<unsigned>(end-str));
+    break;
+  }
+  case booleanValue:
+    document_ += valueToString(value.asBool());
+    break;
+  case arrayValue: {
+    document_ += '[';
+    ArrayIndex size = value.size();
+    for (ArrayIndex index = 0; index < size; ++index) {
+      if (index > 0)
+        document_ += ',';
+      writeValue(value[index]);
+    }
+    document_ += ']';
+  } break;
+  case objectValue: {
+    Value::Members members(value.getMemberNames());
+    document_ += '{';
+    for (Value::Members::iterator it = members.begin(); it != members.end();
+         ++it) {
+      const std::string& name = *it;
+      if (it != members.begin())
+        document_ += ',';
+      document_ += valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length()));
+      document_ += yamlCompatiblityEnabled_ ? ": " : ":";
+      writeValue(value[name]);
+    }
+    document_ += '}';
+  } break;
+  }
+}
+
+// Class StyledWriter
+// //////////////////////////////////////////////////////////////////
+
+StyledWriter::StyledWriter()
+    : rightMargin_(74), indentSize_(3), addChildValues_() {}
+
+std::string StyledWriter::write(const Value& root) {
+  document_ = "";
+  addChildValues_ = false;
+  indentString_ = "";
+  writeCommentBeforeValue(root);
+  writeValue(root);
+  writeCommentAfterValueOnSameLine(root);
+  document_ += "\n";
+  return document_;
+}
+
+void StyledWriter::writeValue(const Value& value) {
+  switch (value.type()) {
+  case nullValue:
+    pushValue("null");
+    break;
+  case intValue:
+    pushValue(valueToString(value.asLargestInt()));
+    break;
+  case uintValue:
+    pushValue(valueToString(value.asLargestUInt()));
+    break;
+  case realValue:
+    pushValue(valueToString(value.asDouble()));
+    break;
+  case stringValue:
+  {
+    // Is NULL possible for value.string_?
+    char const* str;
+    char const* end;
+    bool ok = value.getString(&str, &end);
+    if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+    else pushValue("");
+    break;
+  }
+  case booleanValue:
+    pushValue(valueToString(value.asBool()));
+    break;
+  case arrayValue:
+    writeArrayValue(value);
+    break;
+  case objectValue: {
+    Value::Members members(value.getMemberNames());
+    if (members.empty())
+      pushValue("{}");
+    else {
+      writeWithIndent("{");
+      indent();
+      Value::Members::iterator it = members.begin();
+      for (;;) {
+        const std::string& name = *it;
+        const Value& childValue = value[name];
+        writeCommentBeforeValue(childValue);
+        writeWithIndent(valueToQuotedString(name.c_str()));
+        document_ += " : ";
+        writeValue(childValue);
+        if (++it == members.end()) {
+          writeCommentAfterValueOnSameLine(childValue);
+          break;
+        }
+        document_ += ',';
+        writeCommentAfterValueOnSameLine(childValue);
+      }
+      unindent();
+      writeWithIndent("}");
+    }
+  } break;
+  }
+}
+
+void StyledWriter::writeArrayValue(const Value& value) {
+  unsigned size = value.size();
+  if (size == 0)
+    pushValue("[]");
+  else {
+    bool isArrayMultiLine = isMultineArray(value);
+    if (isArrayMultiLine) {
+      writeWithIndent("[");
+      indent();
+      bool hasChildValue = !childValues_.empty();
+      unsigned index = 0;
+      for (;;) {
+        const Value& childValue = value[index];
+        writeCommentBeforeValue(childValue);
+        if (hasChildValue)
+          writeWithIndent(childValues_[index]);
+        else {
+          writeIndent();
+          writeValue(childValue);
+        }
+        if (++index == size) {
+          writeCommentAfterValueOnSameLine(childValue);
+          break;
+        }
+        document_ += ',';
+        writeCommentAfterValueOnSameLine(childValue);
+      }
+      unindent();
+      writeWithIndent("]");
+    } else // output on a single line
+    {
+      assert(childValues_.size() == size);
+      document_ += "[ ";
+      for (unsigned index = 0; index < size; ++index) {
+        if (index > 0)
+          document_ += ", ";
+        document_ += childValues_[index];
+      }
+      document_ += " ]";
+    }
+  }
+}
+
+bool StyledWriter::isMultineArray(const Value& value) {
+  ArrayIndex const size = value.size();
+  bool isMultiLine = size * 3 >= rightMargin_;
+  childValues_.clear();
+  for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
+    const Value& childValue = value[index];
+    isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
+                        childValue.size() > 0);
+  }
+  if (!isMultiLine) // check if line length > max line length
+  {
+    childValues_.reserve(size);
+    addChildValues_ = true;
+    ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
+    for (ArrayIndex index = 0; index < size; ++index) {
+      if (hasCommentForValue(value[index])) {
+        isMultiLine = true;
+      }
+      writeValue(value[index]);
+      lineLength += static_cast<ArrayIndex>(childValues_[index].length());
+    }
+    addChildValues_ = false;
+    isMultiLine = isMultiLine || lineLength >= rightMargin_;
+  }
+  return isMultiLine;
+}
+
+void StyledWriter::pushValue(const std::string& value) {
+  if (addChildValues_)
+    childValues_.push_back(value);
+  else
+    document_ += value;
+}
+
+void StyledWriter::writeIndent() {
+  if (!document_.empty()) {
+    char last = document_[document_.length() - 1];
+    if (last == ' ') // already indented
+      return;
+    if (last != '\n') // Comments may add new-line
+      document_ += '\n';
+  }
+  document_ += indentString_;
+}
+
+void StyledWriter::writeWithIndent(const std::string& value) {
+  writeIndent();
+  document_ += value;
+}
+
+void StyledWriter::indent() { indentString_ += std::string(indentSize_, ' '); }
+
+void StyledWriter::unindent() {
+  assert(indentString_.size() >= indentSize_);
+  indentString_.resize(indentString_.size() - indentSize_);
+}
+
+void StyledWriter::writeCommentBeforeValue(const Value& root) {
+  if (!root.hasComment(commentBefore))
+    return;
+
+  document_ += "\n";
+  writeIndent();
+  const std::string& comment = root.getComment(commentBefore);
+  std::string::const_iterator iter = comment.begin();
+  while (iter != comment.end()) {
+    document_ += *iter;
+    if (*iter == '\n' &&
+       (iter != comment.end() && *(iter + 1) == '/'))
+      writeIndent();
+    ++iter;
+  }
+
+  // Comments are stripped of trailing newlines, so add one here
+  document_ += "\n";
+}
+
+void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
+  if (root.hasComment(commentAfterOnSameLine))
+    document_ += " " + root.getComment(commentAfterOnSameLine);
+
+  if (root.hasComment(commentAfter)) {
+    document_ += "\n";
+    document_ += root.getComment(commentAfter);
+    document_ += "\n";
+  }
+}
+
+bool StyledWriter::hasCommentForValue(const Value& value) {
+  return value.hasComment(commentBefore) ||
+         value.hasComment(commentAfterOnSameLine) ||
+         value.hasComment(commentAfter);
+}
+
+// Class StyledStreamWriter
+// //////////////////////////////////////////////////////////////////
+
+StyledStreamWriter::StyledStreamWriter(std::string indentation)
+    : document_(NULL), rightMargin_(74), indentation_(indentation), indented_ (true),
+      addChildValues_() {}
+
+void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {
+  document_ = &out;
+  addChildValues_ = false;
+  indentString_ = "";
+  indented_ = true;
+  writeCommentBeforeValue(root);
+  if (!indented_) writeIndent();
+  indented_ = true;
+  writeValue(root);
+  writeCommentAfterValueOnSameLine(root);
+  *document_ << "\n";
+  document_ = NULL; // Forget the stream, for safety.
+}
+
+void StyledStreamWriter::writeValue(const Value& value) {
+  switch (value.type()) {
+  case nullValue:
+    pushValue("null");
+    break;
+  case intValue:
+    pushValue(valueToString(value.asLargestInt()));
+    break;
+  case uintValue:
+    pushValue(valueToString(value.asLargestUInt()));
+    break;
+  case realValue:
+    pushValue(valueToString(value.asDouble()));
+    break;
+  case stringValue:
+  {
+    // Is NULL possible for value.string_?
+    char const* str;
+    char const* end;
+    bool ok = value.getString(&str, &end);
+    if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+    else pushValue("");
+    break;
+  }
+  case booleanValue:
+    pushValue(valueToString(value.asBool()));
+    break;
+  case arrayValue:
+    writeArrayValue(value);
+    break;
+  case objectValue: {
+    Value::Members members(value.getMemberNames());
+    if (members.empty())
+      pushValue("{}");
+    else {
+      writeWithIndent("{");
+      indent();
+      Value::Members::iterator it = members.begin();
+      for (;;) {
+        const std::string& name = *it;
+        const Value& childValue = value[name];
+        writeCommentBeforeValue(childValue);
+        writeWithIndent(valueToQuotedString(name.c_str()));
+        *document_ << " : ";
+        writeValue(childValue);
+        if (++it == members.end()) {
+          writeCommentAfterValueOnSameLine(childValue);
+          break;
+        }
+        *document_ << ",";
+        writeCommentAfterValueOnSameLine(childValue);
+      }
+      unindent();
+      writeWithIndent("}");
+    }
+  } break;
+  }
+}
+
+void StyledStreamWriter::writeArrayValue(const Value& value) {
+  unsigned size = value.size();
+  if (size == 0)
+    pushValue("[]");
+  else {
+    bool isArrayMultiLine = isMultineArray(value);
+    if (isArrayMultiLine) {
+      writeWithIndent("[");
+      indent();
+      bool hasChildValue = !childValues_.empty();
+      unsigned index = 0;
+      for (;;) {
+        const Value& childValue = value[index];
+        writeCommentBeforeValue(childValue);
+        if (hasChildValue)
+          writeWithIndent(childValues_[index]);
+        else {
+          if (!indented_) writeIndent();
+          indented_ = true;
+          writeValue(childValue);
+          indented_ = false;
+        }
+        if (++index == size) {
+          writeCommentAfterValueOnSameLine(childValue);
+          break;
+        }
+        *document_ << ",";
+        writeCommentAfterValueOnSameLine(childValue);
+      }
+      unindent();
+      writeWithIndent("]");
+    } else // output on a single line
+    {
+      assert(childValues_.size() == size);
+      *document_ << "[ ";
+      for (unsigned index = 0; index < size; ++index) {
+        if (index > 0)
+          *document_ << ", ";
+        *document_ << childValues_[index];
+      }
+      *document_ << " ]";
+    }
+  }
+}
+
+bool StyledStreamWriter::isMultineArray(const Value& value) {
+  ArrayIndex const size = value.size();
+  bool isMultiLine = size * 3 >= rightMargin_;
+  childValues_.clear();
+  for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
+    const Value& childValue = value[index];
+    isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
+                        childValue.size() > 0);
+  }
+  if (!isMultiLine) // check if line length > max line length
+  {
+    childValues_.reserve(size);
+    addChildValues_ = true;
+    ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
+    for (ArrayIndex index = 0; index < size; ++index) {
+      if (hasCommentForValue(value[index])) {
+        isMultiLine = true;
+      }
+      writeValue(value[index]);
+      lineLength += static_cast<ArrayIndex>(childValues_[index].length());
+    }
+    addChildValues_ = false;
+    isMultiLine = isMultiLine || lineLength >= rightMargin_;
+  }
+  return isMultiLine;
+}
+
+void StyledStreamWriter::pushValue(const std::string& value) {
+  if (addChildValues_)
+    childValues_.push_back(value);
+  else
+    *document_ << value;
+}
+
+void StyledStreamWriter::writeIndent() {
+  // blep intended this to look at the so-far-written string
+  // to determine whether we are already indented, but
+  // with a stream we cannot do that. So we rely on some saved state.
+  // The caller checks indented_.
+  *document_ << '\n' << indentString_;
+}
+
+void StyledStreamWriter::writeWithIndent(const std::string& value) {
+  if (!indented_) writeIndent();
+  *document_ << value;
+  indented_ = false;
+}
+
+void StyledStreamWriter::indent() { indentString_ += indentation_; }
+
+void StyledStreamWriter::unindent() {
+  assert(indentString_.size() >= indentation_.size());
+  indentString_.resize(indentString_.size() - indentation_.size());
+}
+
+void StyledStreamWriter::writeCommentBeforeValue(const Value& root) {
+  if (!root.hasComment(commentBefore))
+    return;
+
+  if (!indented_) writeIndent();
+  const std::string& comment = root.getComment(commentBefore);
+  std::string::const_iterator iter = comment.begin();
+  while (iter != comment.end()) {
+    *document_ << *iter;
+    if (*iter == '\n' &&
+       (iter != comment.end() && *(iter + 1) == '/'))
+      // writeIndent();  // would include newline
+      *document_ << indentString_;
+    ++iter;
+  }
+  indented_ = false;
+}
+
+void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) {
+  if (root.hasComment(commentAfterOnSameLine))
+    *document_ << ' ' << root.getComment(commentAfterOnSameLine);
+
+  if (root.hasComment(commentAfter)) {
+    writeIndent();
+    *document_ << root.getComment(commentAfter);
+  }
+  indented_ = false;
+}
+
+bool StyledStreamWriter::hasCommentForValue(const Value& value) {
+  return value.hasComment(commentBefore) ||
+         value.hasComment(commentAfterOnSameLine) ||
+         value.hasComment(commentAfter);
+}
+
+//////////////////////////
+// BuiltStyledStreamWriter
+
+/// Scoped enums are not available until C++11.
+struct CommentStyle {
+  /// Decide whether to write comments.
+  enum Enum {
+    None,  ///< Drop all comments.
+    Most,  ///< Recover odd behavior of previous versions (not implemented yet).
+    All  ///< Keep all comments.
+  };
+};
+
+struct BuiltStyledStreamWriter : public StreamWriter
+{
+  BuiltStyledStreamWriter(
+      std::string const& indentation,
+      CommentStyle::Enum cs,
+      std::string const& colonSymbol,
+      std::string const& nullSymbol,
+      std::string const& endingLineFeedSymbol,
+      bool useSpecialFloats,
+      unsigned int precision);
+  int write(Value const& root, JSONCPP_OSTREAM* sout) ;
+private:
+  void writeValue(Value const& value);
+  void writeArrayValue(Value const& value);
+  bool isMultineArray(Value const& value);
+  void pushValue(std::string const& value);
+  void writeIndent();
+  void writeWithIndent(std::string const& value);
+  void indent();
+  void unindent();
+  void writeCommentBeforeValue(Value const& root);
+  void writeCommentAfterValueOnSameLine(Value const& root);
+  static bool hasCommentForValue(const Value& value);
+
+  typedef std::vector<std::string> ChildValues;
+
+  ChildValues childValues_;
+  std::string indentString_;
+  unsigned int rightMargin_;
+  std::string indentation_;
+  CommentStyle::Enum cs_;
+  std::string colonSymbol_;
+  std::string nullSymbol_;
+  std::string endingLineFeedSymbol_;
+  bool addChildValues_ : 1;
+  bool indented_ : 1;
+  bool useSpecialFloats_ : 1;
+  unsigned int precision_;
+};
+BuiltStyledStreamWriter::BuiltStyledStreamWriter(
+      std::string const& indentation,
+      CommentStyle::Enum cs,
+      std::string const& colonSymbol,
+      std::string const& nullSymbol,
+      std::string const& endingLineFeedSymbol,
+      bool useSpecialFloats,
+      unsigned int precision)
+  : rightMargin_(74)
+  , indentation_(indentation)
+  , cs_(cs)
+  , colonSymbol_(colonSymbol)
+  , nullSymbol_(nullSymbol)
+  , endingLineFeedSymbol_(endingLineFeedSymbol)
+  , addChildValues_(false)
+  , indented_(false)
+  , useSpecialFloats_(useSpecialFloats)
+  , precision_(precision)
+{
+}
+int BuiltStyledStreamWriter::write(Value const& root, JSONCPP_OSTREAM* sout)
+{
+  sout_ = sout;
+  addChildValues_ = false;
+  indented_ = true;
+  indentString_ = "";
+  writeCommentBeforeValue(root);
+  if (!indented_) writeIndent();
+  indented_ = true;
+  writeValue(root);
+  writeCommentAfterValueOnSameLine(root);
+  *sout_ << endingLineFeedSymbol_;
+  sout_ = NULL;
+  return 0;
+}
+void BuiltStyledStreamWriter::writeValue(Value const& value) {
+  switch (value.type()) {
+  case nullValue:
+    pushValue(nullSymbol_);
+    break;
+  case intValue:
+    pushValue(valueToString(value.asLargestInt()));
+    break;
+  case uintValue:
+    pushValue(valueToString(value.asLargestUInt()));
+    break;
+  case realValue:
+    pushValue(valueToString(value.asDouble(), useSpecialFloats_, precision_));
+    break;
+  case stringValue:
+  {
+    // Is NULL is possible for value.string_?
+    char const* str;
+    char const* end;
+    bool ok = value.getString(&str, &end);
+    if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+    else pushValue("");
+    break;
+  }
+  case booleanValue:
+    pushValue(valueToString(value.asBool()));
+    break;
+  case arrayValue:
+    writeArrayValue(value);
+    break;
+  case objectValue: {
+    Value::Members members(value.getMemberNames());
+    if (members.empty())
+      pushValue("{}");
+    else {
+      writeWithIndent("{");
+      indent();
+      Value::Members::iterator it = members.begin();
+      for (;;) {
+        std::string const& name = *it;
+        Value const& childValue = value[name];
+        writeCommentBeforeValue(childValue);
+        writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));
+        *sout_ << colonSymbol_;
+        writeValue(childValue);
+        if (++it == members.end()) {
+          writeCommentAfterValueOnSameLine(childValue);
+          break;
+        }
+        *sout_ << ",";
+        writeCommentAfterValueOnSameLine(childValue);
+      }
+      unindent();
+      writeWithIndent("}");
+    }
+  } break;
+  }
+}
+
+void BuiltStyledStreamWriter::writeArrayValue(Value const& value) {
+  unsigned size = value.size();
+  if (size == 0)
+    pushValue("[]");
+  else {
+    bool isMultiLine = (cs_ == CommentStyle::All) || isMultineArray(value);
+    if (isMultiLine) {
+      writeWithIndent("[");
+      indent();
+      bool hasChildValue = !childValues_.empty();
+      unsigned index = 0;
+      for (;;) {
+        Value const& childValue = value[index];
+        writeCommentBeforeValue(childValue);
+        if (hasChildValue)
+          writeWithIndent(childValues_[index]);
+        else {
+          if (!indented_) writeIndent();
+          indented_ = true;
+          writeValue(childValue);
+          indented_ = false;
+        }
+        if (++index == size) {
+          writeCommentAfterValueOnSameLine(childValue);
+          break;
+        }
+        *sout_ << ",";
+        writeCommentAfterValueOnSameLine(childValue);
+      }
+      unindent();
+      writeWithIndent("]");
+    } else // output on a single line
+    {
+      assert(childValues_.size() == size);
+      *sout_ << "[";
+      if (!indentation_.empty()) *sout_ << " ";
+      for (unsigned index = 0; index < size; ++index) {
+        if (index > 0)
+          *sout_ << ", ";
+        *sout_ << childValues_[index];
+      }
+      if (!indentation_.empty()) *sout_ << " ";
+      *sout_ << "]";
+    }
+  }
+}
+
+bool BuiltStyledStreamWriter::isMultineArray(Value const& value) {
+  ArrayIndex const size = value.size();
+  bool isMultiLine = size * 3 >= rightMargin_;
+  childValues_.clear();
+  for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
+    Value const& childValue = value[index];
+    isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
+                        childValue.size() > 0);
+  }
+  if (!isMultiLine) // check if line length > max line length
+  {
+    childValues_.reserve(size);
+    addChildValues_ = true;
+    ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
+    for (ArrayIndex index = 0; index < size; ++index) {
+      if (hasCommentForValue(value[index])) {
+        isMultiLine = true;
+      }
+      writeValue(value[index]);
+      lineLength += static_cast<ArrayIndex>(childValues_[index].length());
+    }
+    addChildValues_ = false;
+    isMultiLine = isMultiLine || lineLength >= rightMargin_;
+  }
+  return isMultiLine;
+}
+
+void BuiltStyledStreamWriter::pushValue(std::string const& value) {
+  if (addChildValues_)
+    childValues_.push_back(value);
+  else
+    *sout_ << value;
+}
+
+void BuiltStyledStreamWriter::writeIndent() {
+  // blep intended this to look at the so-far-written string
+  // to determine whether we are already indented, but
+  // with a stream we cannot do that. So we rely on some saved state.
+  // The caller checks indented_.
+
+  if (!indentation_.empty()) {
+    // In this case, drop newlines too.
+    *sout_ << '\n' << indentString_;
+  }
+}
+
+void BuiltStyledStreamWriter::writeWithIndent(std::string const& value) {
+  if (!indented_) writeIndent();
+  *sout_ << value;
+  indented_ = false;
+}
+
+void BuiltStyledStreamWriter::indent() { indentString_ += indentation_; }
+
+void BuiltStyledStreamWriter::unindent() {
+  assert(indentString_.size() >= indentation_.size());
+  indentString_.resize(indentString_.size() - indentation_.size());
+}
+
+void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {
+  if (cs_ == CommentStyle::None) return;
+  if (!root.hasComment(commentBefore))
+    return;
+
+  if (!indented_) writeIndent();
+  const std::string& comment = root.getComment(commentBefore);
+  std::string::const_iterator iter = comment.begin();
+  while (iter != comment.end()) {
+    *sout_ << *iter;
+    if (*iter == '\n' &&
+       (iter != comment.end() && *(iter + 1) == '/'))
+      // writeIndent();  // would write extra newline
+      *sout_ << indentString_;
+    ++iter;
+  }
+  indented_ = false;
+}
+
+void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) {
+  if (cs_ == CommentStyle::None) return;
+  if (root.hasComment(commentAfterOnSameLine))
+    *sout_ << " " + root.getComment(commentAfterOnSameLine);
+
+  if (root.hasComment(commentAfter)) {
+    writeIndent();
+    *sout_ << root.getComment(commentAfter);
+  }
+}
+
+// static
+bool BuiltStyledStreamWriter::hasCommentForValue(const Value& value) {
+  return value.hasComment(commentBefore) ||
+         value.hasComment(commentAfterOnSameLine) ||
+         value.hasComment(commentAfter);
+}
+
+///////////////
+// StreamWriter
+
+StreamWriter::StreamWriter()
+    : sout_(NULL)
+{
+}
+StreamWriter::~StreamWriter()
+{
+}
+StreamWriter::Factory::~Factory()
+{}
+StreamWriterBuilder::StreamWriterBuilder()
+{
+  setDefaults(&settings_);
+}
+StreamWriterBuilder::~StreamWriterBuilder()
+{}
+StreamWriter* StreamWriterBuilder::newStreamWriter() const
+{
+  std::string indentation = settings_["indentation"].asString();
+  std::string cs_str = settings_["commentStyle"].asString();
+  bool eyc = settings_["enableYAMLCompatibility"].asBool();
+  bool dnp = settings_["dropNullPlaceholders"].asBool();
+  bool usf = settings_["useSpecialFloats"].asBool();
+  unsigned int pre = settings_["precision"].asUInt();
+  CommentStyle::Enum cs = CommentStyle::All;
+  if (cs_str == "All") {
+    cs = CommentStyle::All;
+  } else if (cs_str == "None") {
+    cs = CommentStyle::None;
+  } else {
+    throwRuntimeError("commentStyle must be 'All' or 'None'");
+  }
+  std::string colonSymbol = " : ";
+  if (eyc) {
+    colonSymbol = ": ";
+  } else if (indentation.empty()) {
+    colonSymbol = ":";
+  }
+  std::string nullSymbol = "null";
+  if (dnp) {
+    nullSymbol = "";
+  }
+  if (pre > 17) pre = 17;
+  std::string endingLineFeedSymbol = "";
+  return new BuiltStyledStreamWriter(
+      indentation, cs,
+      colonSymbol, nullSymbol, endingLineFeedSymbol, usf, pre);
+}
+static void getValidWriterKeys(std::set<std::string>* valid_keys)
+{
+  valid_keys->clear();
+  valid_keys->insert("indentation");
+  valid_keys->insert("commentStyle");
+  valid_keys->insert("enableYAMLCompatibility");
+  valid_keys->insert("dropNullPlaceholders");
+  valid_keys->insert("useSpecialFloats");
+  valid_keys->insert("precision");
+}
+bool StreamWriterBuilder::validate(Json::Value* invalid) const
+{
+  Json::Value my_invalid;
+  if (!invalid) invalid = &my_invalid;  // so we do not need to test for NULL
+  Json::Value& inv = *invalid;
+  std::set<std::string> valid_keys;
+  getValidWriterKeys(&valid_keys);
+  Value::Members keys = settings_.getMemberNames();
+  size_t n = keys.size();
+  for (size_t i = 0; i < n; ++i) {
+    std::string const& key = keys[i];
+    if (valid_keys.find(key) == valid_keys.end()) {
+      inv[key] = settings_[key];
+    }
+  }
+  return 0u == inv.size();
+}
+Value& StreamWriterBuilder::operator[](std::string key)
+{
+  return settings_[key];
+}
+// static
+void StreamWriterBuilder::setDefaults(Json::Value* settings)
+{
+  //! [StreamWriterBuilderDefaults]
+  (*settings)["commentStyle"] = "None";
+  (*settings)["indentation"] = "  ";
+  (*settings)["enableYAMLCompatibility"] = false;
+  (*settings)["dropNullPlaceholders"] = false;
+  (*settings)["useSpecialFloats"] = false;
+  (*settings)["precision"] = 11;
+  //! [StreamWriterBuilderDefaults]
+}
+
+std::string writeString(StreamWriter::Factory const& builder, Value const& root) {
+  JSONCPP_OSTRINGSTREAM sout;
+  StreamWriterPtr const writer(builder.newStreamWriter());
+  writer->write(root, &sout);
+  return sout.str();
+}
+
+JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM& sout, Value const& root) {
+  StreamWriterBuilder builder;
+  StreamWriterPtr const writer(builder.newStreamWriter());
+  writer->write(root, &sout);
+  return sout;
+}
+
+} // namespace Json
+
+// //////////////////////////////////////////////////////////////////////
+// End of content of file: src/lib_json/json_writer.cpp
+// //////////////////////////////////////////////////////////////////////
+
+
+
+
diff --git a/ossim/src/ossim/base/ossim2dBilinearTransform.cpp b/src/base/ossim2dBilinearTransform.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossim2dBilinearTransform.cpp
rename to src/base/ossim2dBilinearTransform.cpp
diff --git a/ossim/src/ossim/base/ossim2dLinearRegression.cpp b/src/base/ossim2dLinearRegression.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossim2dLinearRegression.cpp
rename to src/base/ossim2dLinearRegression.cpp
diff --git a/ossim/src/ossim/base/ossim2dTo2dIdentityTransform.cpp b/src/base/ossim2dTo2dIdentityTransform.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossim2dTo2dIdentityTransform.cpp
rename to src/base/ossim2dTo2dIdentityTransform.cpp
diff --git a/src/base/ossim2dTo2dMatrixTransform.cpp b/src/base/ossim2dTo2dMatrixTransform.cpp
new file mode 100644
index 0000000..a0f88ae
--- /dev/null
+++ b/src/base/ossim2dTo2dMatrixTransform.cpp
@@ -0,0 +1,183 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:
+//
+// Description: 
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossim2dTo2dMatrixTransform.h>
+#include <ossim/base/ossimLeastSquaresBilin.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <iostream>
+RTTI_DEF1(ossim2dTo2dMatrixTransform, "ossim2dTo2dMatrixTransform", ossim2dTo2dTransform);
+ossim2dTo2dMatrixTransform::ossim2dTo2dMatrixTransform()
+{
+   std::fill(m_coefficientsXTerm, m_coefficientsXTerm+4, 0.0);
+   std::fill(m_coefficientsYTerm, m_coefficientsYTerm+4, 0.0);
+   std::fill(m_inverseCoefficientsXTerm, m_inverseCoefficientsXTerm+4, 0.0);
+   std::fill(m_inverseCoefficientsYTerm, m_inverseCoefficientsYTerm+4, 0.0);
+   
+   // setup identity
+   //
+   m_coefficientsXTerm[1] = 1.0;
+   m_coefficientsYTerm[2] = 1.0;
+   m_inverseCoefficientsXTerm[1] = 1.0;
+   m_inverseCoefficientsYTerm[2] = 1.0;
+}
+
+ossim2dTo2dMatrixTransform::ossim2dTo2dMatrixTransform(const ossim2dTo2dMatrixTransform& src)
+:ossim2dTo2dTransform(src)
+{
+   std::copy(src.m_coefficientsXTerm, src.m_coefficientsXTerm+4, m_coefficientsXTerm);
+   std::copy(src.m_coefficientsYTerm, src.m_coefficientsYTerm+4, m_coefficientsYTerm);
+   std::copy(src.m_inverseCoefficientsXTerm, src.m_inverseCoefficientsXTerm+4, m_inverseCoefficientsXTerm);
+   std::copy(src.m_inverseCoefficientsYTerm, src.m_inverseCoefficientsYTerm+4, m_inverseCoefficientsYTerm);
+}
+
+void ossim2dTo2dMatrixTransform::setFromPoints(const ossimDpt& in1, const ossimDpt& in2, const ossimDpt& in3, const ossimDpt& in4,
+                                             const ossimDpt& out1, const ossimDpt& out2, const ossimDpt& out3, const ossimDpt& out4)
+{
+   ossimDpt input[4];
+   ossimDpt output[4];
+   
+   input[0] = in1;
+   input[1] = in2;
+   input[2] = in3;
+   input[3] = in4;
+   
+   output[0] = out1;
+   output[1] = out2;
+   output[2] = out3;
+   output[3] = out4;
+   
+   setFromPoints(&input[0], &output[0], 4);
+}
+
+void ossim2dTo2dMatrixTransform::setFromPoints(const ossimDpt* input,
+                                             const ossimDpt* output, 
+                                             ossim_uint32 arraySize)
+{
+   ossimLeastSquaresBilin inx;
+   ossimLeastSquaresBilin inversex;
+   ossimLeastSquaresBilin iny;
+   ossimLeastSquaresBilin inversey;
+   ossim_uint32 idx = 0;
+   for(idx=0; idx < arraySize; ++idx)
+   {
+      inx.addSample(input[idx].x, input[idx].y, output[idx].x);
+      inversex.addSample(output[idx].x, output[idx].y, input[idx].x);
+      iny.addSample(input[idx].x, input[idx].y, output[idx].y);
+      inversey.addSample(output[idx].x, output[idx].y, input[idx].y);
+   }
+   inx.solveLS();
+   inversex.solveLS();
+   iny.solveLS();
+   inversey.solveLS();
+   inx.getLSParms(m_coefficientsXTerm[0], m_coefficientsXTerm[1], m_coefficientsXTerm[2], m_coefficientsXTerm[3]);
+   iny.getLSParms(m_coefficientsYTerm[0], m_coefficientsYTerm[1], m_coefficientsYTerm[2], m_coefficientsYTerm[3]);
+   inversex.getLSParms(m_inverseCoefficientsXTerm[0], m_inverseCoefficientsXTerm[1], m_inverseCoefficientsXTerm[2], m_inverseCoefficientsXTerm[3]);
+   inversey.getLSParms(m_inverseCoefficientsYTerm[0], m_inverseCoefficientsYTerm[1], m_inverseCoefficientsYTerm[2], m_inverseCoefficientsYTerm[3]);
+}
+
+bool ossim2dTo2dMatrixTransform::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix)const
+{
+   ossimString xterm = (ossimString::toString(m_coefficientsXTerm[0])
+                        +" "+ossimString::toString(m_coefficientsXTerm[1])
+                        +" "+ossimString::toString(m_coefficientsXTerm[2])
+                        +" "+ossimString::toString(m_coefficientsXTerm[3]));
+   ossimString yterm = (ossimString::toString(m_coefficientsYTerm[0])
+                        +" "+ossimString::toString(m_coefficientsYTerm[1])
+                        +" "+ossimString::toString(m_coefficientsYTerm[2])
+                        +" "+ossimString::toString(m_coefficientsYTerm[3]));
+   ossimString inverse_xterm = (ossimString::toString(m_inverseCoefficientsXTerm[0])
+                        +" "+ossimString::toString(m_inverseCoefficientsXTerm[1])
+                        +" "+ossimString::toString(m_inverseCoefficientsXTerm[2])
+                        +" "+ossimString::toString(m_inverseCoefficientsXTerm[3]));
+   ossimString inverse_yterm = (ossimString::toString(m_inverseCoefficientsYTerm[0])
+                        +" "+ossimString::toString(m_inverseCoefficientsYTerm[1])
+                        +" "+ossimString::toString(m_inverseCoefficientsYTerm[2])
+                        +" "+ossimString::toString(m_inverseCoefficientsYTerm[3]));
+   
+   kwl.add(prefix, "xterm", xterm, true);
+   kwl.add(prefix, "yterm", yterm, true);
+   kwl.add(prefix, "inverse_xterm", inverse_xterm, true);
+   kwl.add(prefix, "inverse_yterm", inverse_yterm, true);
+   return ossim2dTo2dTransform::saveState(kwl, prefix);
+}
+
+bool ossim2dTo2dMatrixTransform::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   bool result = true;
+   ossimString xterm = kwl.find(prefix, "xterm");
+   ossimString yterm = kwl.find(prefix, "yterm");
+   ossimString inverse_xterm = kwl.find(prefix, "inverse_xterm");
+   ossimString inverse_yterm = kwl.find(prefix, "inverse_yterm");
+   
+   std::vector<ossimString> values;
+   xterm.split(values, " ");
+   if(values.size() == 4)
+   {
+      m_coefficientsXTerm[0] = values[0].toDouble();
+      m_coefficientsXTerm[1] = values[1].toDouble();
+      m_coefficientsXTerm[2] = values[2].toDouble();
+      m_coefficientsXTerm[3] = values[3].toDouble();
+   }
+   else 
+   {
+      result = false;
+   }
+   values.clear();
+   yterm.split(values, " ");
+   if(values.size() == 4)
+   {
+      m_coefficientsYTerm[0] = values[0].toDouble();
+      m_coefficientsYTerm[1] = values[1].toDouble();
+      m_coefficientsYTerm[2] = values[2].toDouble();
+      m_coefficientsYTerm[3] = values[3].toDouble();
+   }
+   else 
+   {
+      result = false;
+   }
+   values.clear();
+   inverse_xterm.split(values, " ");
+   if(values.size() == 4)
+   {
+      m_inverseCoefficientsXTerm[0] = values[0].toDouble();
+      m_inverseCoefficientsXTerm[1] = values[1].toDouble();
+      m_inverseCoefficientsXTerm[2] = values[2].toDouble();
+      m_inverseCoefficientsXTerm[3] = values[3].toDouble();
+   }
+   else 
+   {
+      result = false;
+   }
+   values.clear();
+   inverse_yterm.split(values, " ");
+   if(values.size() == 4)
+   {
+      m_inverseCoefficientsYTerm[0] = values[0].toDouble();
+      m_inverseCoefficientsYTerm[1] = values[1].toDouble();
+      m_inverseCoefficientsYTerm[2] = values[2].toDouble();
+      m_inverseCoefficientsYTerm[3] = values[3].toDouble();
+   }
+   else 
+   {
+      result = false;
+   }
+
+   if(result)
+   {
+      result = ossim2dTo2dTransform::loadState(kwl, prefix);
+   }
+   
+   return result;
+}
diff --git a/ossim/src/ossim/base/ossim2dTo2dShiftTransform.cpp b/src/base/ossim2dTo2dShiftTransform.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossim2dTo2dShiftTransform.cpp
rename to src/base/ossim2dTo2dShiftTransform.cpp
diff --git a/src/base/ossim2dTo2dTransform.cpp b/src/base/ossim2dTo2dTransform.cpp
new file mode 100644
index 0000000..68c9f02
--- /dev/null
+++ b/src/base/ossim2dTo2dTransform.cpp
@@ -0,0 +1,280 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossim2dTo2dTransform.cpp 15766 2009-10-20 12:37:09Z gpotts $
+
+#include <cstdlib>
+#include <sstream>
+#include <ossim/base/ossim2dTo2dTransform.h>
+
+
+RTTI_DEF1(ossim2dTo2dTransform, "ossim2dTo2dTransform", ossimObject);
+
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+// ### CREATE_COPY ###
+// Implementation of static factory method createCopy() requires includes here of ALL 2D-to-2D
+// transform types that need a deep copy capability:
+#include <ossim/base/ossimAffineTransform.h>
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/projection/ossimMeanRadialLensDistortion.h>
+#include <ossim/base/ossimQuadTreeWarp.h>
+#include <ossim/projection/ossimRadialDecentLensDistortion.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossim2dTo2dTransform:exec");
+static ossimTrace traceDebug ("ossim2dTo2dTransform:debug");
+
+static const double DEFAULT_THRESHOLD      = 1000.0*DBL_EPSILON;
+static const int    DEFAULT_MAX_ITERATIONS = 10;
+
+//*****************************************************************************
+//  CONSTRUCTOR: 
+//*****************************************************************************
+ossim2dTo2dTransform::ossim2dTo2dTransform()
+   :
+      theConvergenceThreshold (DEFAULT_THRESHOLD),
+      theMaxIterations        (DEFAULT_MAX_ITERATIONS),
+      theDxDy(1.0, 1.0)
+{
+}
+ 
+//*****************************************************************************
+//  METHOD: 
+//*****************************************************************************
+void ossim2dTo2dTransform::inverse(const ossimDpt& input,
+                                   ossimDpt&       output) const
+{
+   static const char MODULE[] = "ossim2dTo2dTransform::inverse";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: " << MODULE << ", entering...\n";
+   
+   //***
+   // Begin with guess. Forward transform is defined as trasforming left to
+   // right. We are therefore solving for left:
+   //***
+   ossimDpt left = getOrigin();
+   ossimDpt left_dx;
+   ossimDpt left_dy;
+   ossimDpt right;
+   ossimDpt right_dx;
+   ossimDpt right_dy;
+   ossimDpt dr_dx;
+   ossimDpt dr_dy;
+   ossimDpt r_diff;
+   ossimDpt l_diff;
+   double inverse_norm;
+   int iters=0;
+   //***
+   // Begin iterations:
+   //***
+   do
+   {
+      //***
+      // establish perturbed image points about the guessed point:
+      //***
+      left_dx.x = left.x + theDxDy.x;
+      left_dx.y = left.y;
+      left_dy.x = left.x;
+      left_dy.y = left.y + theDxDy.y;
+      
+      //***
+      // Compute numerical partials at current guessed point:
+      //***
+      forward(left,    right);
+      forward(left_dx, right_dx);
+      forward(left_dy, right_dy);
+
+      dr_dx.x = (right_dx.x - right.x)/theDxDy.x; //e
+      dr_dx.y = (right_dx.y - right.y)/theDxDy.y; //g
+      dr_dy.x = (right_dy.x - right.x)/theDxDy.x; //f
+      dr_dy.y = (right_dy.y - right.y)/theDxDy.y; //h
+
+      //***
+      // Test for convergence:
+      //***
+      r_diff = input - right;
+      
+      //***
+      // Compute linearized estimate of image point given gp delta:
+      //***
+      inverse_norm = dr_dy.x*dr_dx.y - dr_dx.x*dr_dy.y; // fg-eh
+
+      if (inverse_norm != 0)
+      {
+         l_diff.x = (-dr_dy.y*r_diff.x + dr_dy.x*r_diff.y)/inverse_norm;
+         l_diff.y = ( dr_dx.y*r_diff.x - dr_dx.x*r_diff.y)/inverse_norm;
+
+         left += l_diff;
+      }
+      else
+      {
+         l_diff.x = 0;
+         l_diff.y = 0;
+      }
+
+      iters++;
+      
+   } while (((fabs(l_diff.x) > theConvergenceThreshold) ||
+             (fabs(l_diff.y) > theConvergenceThreshold)) &&
+            (iters < theMaxIterations));
+
+   //***
+   // Note that this error mesage appears only if max count was reached while
+   // iterating. A linear (no iteration) solution would finish with iters =
+   // MAX_NUM_ITERATIONS + 1:
+   //***
+    if (iters == theMaxIterations)
+    {
+       ossimNotify(ossimNotifyLevel_WARN) << "WARNING: " << MODULE << ", exceeded max number of iterations computing inverse "
+                                          << "transform for point: " << input << "\n";
+    }
+
+   output = left;
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: " << MODULE << ", returning...\n";
+   return;
+   
+}
+
+//*****************************************************************************
+//  METHOD: 
+//*****************************************************************************
+bool ossim2dTo2dTransform::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::CONVERGENCE_THRESHOLD_KW,
+           theConvergenceThreshold,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::MAX_ITERATIONS_KW,
+           theMaxIterations,
+           true);
+   kwl.add(prefix,
+           "dxdy",
+           ossimString::toString(theDxDy.x) + " " +
+           ossimString::toString(theDxDy.y),
+           true);
+           
+   return ossimObject::saveState(kwl, prefix);
+}
+
+//*****************************************************************************
+//  METHOD: 
+//*****************************************************************************
+bool ossim2dTo2dTransform::loadState(const ossimKeywordlist& kwl,
+               const char* prefix)
+{
+  bool result = true;
+
+   const char* buf;
+
+   buf= kwl.find(prefix, ossimKeywordNames::CONVERGENCE_THRESHOLD_KW);
+
+   if (buf)
+   {
+      theConvergenceThreshold = atof(buf);
+   }
+   else
+   {
+      theConvergenceThreshold = .00000000000002;
+   }
+   
+   buf= kwl.find(prefix, ossimKeywordNames::MAX_ITERATIONS_KW);
+   if(buf)
+   {
+      theMaxIterations = atoi(buf);
+   }
+   else
+   {
+      theMaxIterations = 10;
+   }
+   const char* dxdy = kwl.find(prefix, "dxdy");
+   if(dxdy)
+   {
+      ossimString tempString(dxdy);
+      std::vector<ossimString> splitArray;
+      tempString = tempString.trim();
+      tempString.split(splitArray, " ");
+      if(splitArray.size()==2)
+      {
+         theDxDy.x = splitArray[0].toDouble();
+         theDxDy.y = splitArray[1].toDouble();
+      }
+   }
+   if(result)
+   {
+      ossimObject::loadState(kwl, prefix);
+   }
+   
+   return result;
+}
+   
+void ossim2dTo2dTransform::forward(ossimDpt&  modify_this) const 
+{
+   ossimDpt output;
+   forward(modify_this, output);
+   modify_this = output;
+}
+
+void ossim2dTo2dTransform::inverse(ossimDpt&  modify_this) const 
+{
+   ossimDpt output;
+   inverse(modify_this, output);
+   modify_this = output;
+}
+
+ossimDpt ossim2dTo2dTransform::getOrigin()const
+{
+   return ossimDpt(0,0);
+}
+
+void ossim2dTo2dTransform::setConvergenceThreshold(const double& new_threshold)
+{
+   theConvergenceThreshold = new_threshold;
+}
+
+void ossim2dTo2dTransform::setMaxIterations(int new_max_iters)
+{
+   theMaxIterations = new_max_iters;
+}
+
+void ossim2dTo2dTransform::setDxDy(const ossimDpt& dxdy)
+{
+   theDxDy.x = dxdy.x;
+   theDxDy.y = dxdy.y;
+}
+
+const ossim2dTo2dTransform& ossim2dTo2dTransform::operator=(const ossim2dTo2dTransform&  rhs )
+{
+   if (this != &rhs)
+   {
+      ossimObject::operator = (rhs);
+      
+      theConvergenceThreshold = rhs.theConvergenceThreshold;
+      theMaxIterations        = rhs.theMaxIterations;
+      theDxDy                 = rhs.theDxDy;
+   }
+   return *this;
+}
+
+std::ostream& ossim2dTo2dTransform::print(std::ostream& out) const
+{
+   out << "convergenceThreshold: " << theConvergenceThreshold << "\n"
+   << "maxIterations:        " << theMaxIterations << "\n"
+   << "dxdy:                 " << theDxDy << "\n";
+   return out;
+}
+
diff --git a/src/base/ossim2dTo2dTransformFactory.cpp b/src/base/ossim2dTo2dTransformFactory.cpp
new file mode 100644
index 0000000..1b78919
--- /dev/null
+++ b/src/base/ossim2dTo2dTransformFactory.cpp
@@ -0,0 +1,66 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Implementation of ossim2dTo2dTransformFactory.
+//
+//**************************************************************************************************
+// $Id$
+#include <ossim/base/ossim2dTo2dTransformFactory.h>
+#include <ossim/base/ossim2dBilinearTransform.h>
+#include <ossim/base/ossim2dTo2dShiftTransform.h>
+#include <ossim/base/ossim2dTo2dIdentityTransform.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+
+ossim2dTo2dTransformFactory* ossim2dTo2dTransformFactory::m_instance = 0;
+ossim2dTo2dTransformFactory* ossim2dTo2dTransformFactory::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossim2dTo2dTransformFactory();
+   }
+   return m_instance;
+}
+
+ossim2dTo2dTransform* ossim2dTo2dTransformFactory::createTransform(const ossimString& name)const
+{
+   ossim2dTo2dTransform* result = 0;
+   if(name == STATIC_TYPE_NAME(ossim2dBilinearTransform))
+   {
+      result = new ossim2dBilinearTransform();
+   }
+   else if(name == STATIC_TYPE_NAME(ossim2dTo2dShiftTransform))
+   {
+      result = new ossim2dTo2dShiftTransform();
+   }
+   else if(name == STATIC_TYPE_NAME(ossim2dTo2dIdentityTransform))
+   {
+      result = new ossim2dTo2dIdentityTransform();
+   }
+   
+   return result;
+}
+
+ossim2dTo2dTransform* ossim2dTo2dTransformFactory::createTransform(const ossimKeywordlist& kwl,
+                                                                   const char* prefix)const
+{
+   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   ossimRefPtr<ossim2dTo2dTransform> result =  createTransform(type);
+   if(result.valid()&&!result->loadState(kwl, prefix))
+   {
+      result = 0;
+   }
+   
+   return result.release();
+}
+
+void ossim2dTo2dTransformFactory::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   typeList.push_back(STATIC_TYPE_NAME(ossim2dBilinearTransform));
+   typeList.push_back(STATIC_TYPE_NAME(ossim2dTo2dShiftTransform));
+   typeList.push_back(STATIC_TYPE_NAME(ossim2dTo2dIdentityTransform));
+}
diff --git a/src/base/ossim2dTo2dTransformRegistry.cpp b/src/base/ossim2dTo2dTransformRegistry.cpp
new file mode 100644
index 0000000..37f666b
--- /dev/null
+++ b/src/base/ossim2dTo2dTransformRegistry.cpp
@@ -0,0 +1,26 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Implementation of ossim2dTo2dTransformRegistry.
+//
+//**************************************************************************************************
+// $Id$
+#include <ossim/base/ossim2dTo2dTransformRegistry.h>
+#include <ossim/base/ossim2dTo2dTransformFactory.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+ossim2dTo2dTransformRegistry* ossim2dTo2dTransformRegistry::m_instance = 0;
+RTTI_DEF1(ossim2dTo2dTransformRegistry, "ossim2dTo2dTransformRegistry", ossimObjectFactory);
+ossim2dTo2dTransformRegistry* ossim2dTo2dTransformRegistry::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossim2dTo2dTransformRegistry();
+      m_instance->registerFactory(ossim2dTo2dTransformFactory::instance());
+      ossimObjectFactoryRegistry::instance()->registerFactory(m_instance);
+   }
+   
+   return m_instance;
+}
diff --git a/ossim/src/ossim/base/ossimActiveEdgeTable.cpp b/src/base/ossimActiveEdgeTable.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimActiveEdgeTable.cpp
rename to src/base/ossimActiveEdgeTable.cpp
diff --git a/ossim/src/ossim/base/ossimAdjSolutionAttributes.cpp b/src/base/ossimAdjSolutionAttributes.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimAdjSolutionAttributes.cpp
rename to src/base/ossimAdjSolutionAttributes.cpp
diff --git a/ossim/src/ossim/base/ossimAdjustableParameterInfo.cpp b/src/base/ossimAdjustableParameterInfo.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimAdjustableParameterInfo.cpp
rename to src/base/ossimAdjustableParameterInfo.cpp
diff --git a/ossim/src/ossim/base/ossimAdjustableParameterInterface.cpp b/src/base/ossimAdjustableParameterInterface.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimAdjustableParameterInterface.cpp
rename to src/base/ossimAdjustableParameterInterface.cpp
diff --git a/ossim/src/ossim/base/ossimAdjustmentExecutive.cpp b/src/base/ossimAdjustmentExecutive.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimAdjustmentExecutive.cpp
rename to src/base/ossimAdjustmentExecutive.cpp
diff --git a/ossim/src/ossim/base/ossimAdjustmentInfo.cpp b/src/base/ossimAdjustmentInfo.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimAdjustmentInfo.cpp
rename to src/base/ossimAdjustmentInfo.cpp
diff --git a/ossim/src/ossim/base/ossimAffineTransform.cpp b/src/base/ossimAffineTransform.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimAffineTransform.cpp
rename to src/base/ossimAffineTransform.cpp
diff --git a/ossim/src/ossim/base/ossimApplicationUsage.cpp b/src/base/ossimApplicationUsage.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimApplicationUsage.cpp
rename to src/base/ossimApplicationUsage.cpp
diff --git a/src/base/ossimArgumentParser.cpp b/src/base/ossimArgumentParser.cpp
new file mode 100755
index 0000000..3bd5b07
--- /dev/null
+++ b/src/base/ossimArgumentParser.cpp
@@ -0,0 +1,670 @@
+//-------------------------------------------------------------------------
+//
+// This code was taken from Open Scene Graph and incorporated from into
+// OSSIM.
+//
+//-------------------------------------------------------------------------
+// $Id: ossimArgumentParser.cpp 22491 2013-11-26 18:17:29Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimString.h>
+
+#include <cstring>
+#include <iostream>
+#include <set>
+
+using namespace std;
+
+bool ossimArgumentParser::isOption(const char* str)
+{
+   return str && str[0]=='-';
+}
+
+bool ossimArgumentParser::isString(const char* str)
+{
+   if (!str) return false;
+
+   return true;
+//    return !isOption(str);
+}
+
+bool ossimArgumentParser::isNumber(const char* str)
+{
+   if (!str) return false;
+   
+   bool hadPlusMinus = false;
+   bool hadDecimalPlace = false;
+   bool hadExponent = false;
+   bool couldBeInt = true;
+   bool couldBeFloat = true;
+   int noZeroToNine = 0;
+
+   const char* ptr = str;
+
+   // check if could be a hex number.
+   if (std::strncmp(ptr,"0x",2)==0)
+   {
+      // skip over leading 0x, and then go through rest of string
+      // checking to make sure all values are 0...9 or a..f.
+      ptr+=2;
+      while (
+         *ptr!=0 &&
+         ((*ptr>='0' && *ptr<='9') ||
+          (*ptr>='a' && *ptr<='f') ||
+          (*ptr>='A' && *ptr<='F'))
+         )
+      {
+         ++ptr;
+      }
+
+      // got to end of string without failure, therefore must be a hex integer.
+      if (*ptr==0) return true;
+   }
+
+   ptr = str;
+
+   // check if a float or an int.
+   while (*ptr!=0 && couldBeFloat)
+   {
+      if (*ptr=='+' || *ptr=='-')
+      {
+         if (hadPlusMinus)
+         {
+            couldBeInt = false;
+            couldBeFloat = false;
+         }
+         else
+         {
+            hadPlusMinus = true;
+         }
+      }
+      else if (*ptr>='0' && *ptr<='9')
+      {
+         noZeroToNine++;
+      }
+      else if (*ptr=='.')
+      {
+         if (hadDecimalPlace)
+         {
+            couldBeInt = false;
+            couldBeFloat = false;
+         }
+         else
+         {
+            hadDecimalPlace = true;
+            couldBeInt = false;
+         }
+      }
+      else if (*ptr=='e' || *ptr=='E')
+      {
+         if (hadExponent || noZeroToNine==0)
+         {
+            couldBeInt = false;
+            couldBeFloat = false;
+         }
+         else
+         {
+            hadExponent = true;
+            couldBeInt = false;
+            hadDecimalPlace = false;
+            hadPlusMinus = false;
+            noZeroToNine=0;
+         }
+      }
+      else
+      {
+         couldBeInt = false;
+         couldBeFloat = false;
+      }
+      ++ptr;
+   }
+
+   if (couldBeInt && noZeroToNine>0) return true;
+   if (couldBeFloat && noZeroToNine>0) return true;
+
+   return false;
+
+}
+
+bool ossimArgumentParser::ossimParameter::valid(const char* str) const
+{
+   switch(theType)
+   {
+      case ossimParameter::OSSIM_FLOAT_PARAMETER:        return isNumber(str);
+      case ossimParameter::OSSIM_DOUBLE_PARAMETER:       return isNumber(str);
+      case ossimParameter::OSSIM_INT_PARAMETER:          return isNumber(str);
+      case ossimParameter::OSSIM_UNSIGNED_INT_PARAMETER: return isNumber(str);
+      case ossimParameter::OSSIM_STRING_PARAMETER:       return isString(str);
+   }
+   return false;
+}
+
+bool ossimArgumentParser::ossimParameter::assign(const char* str)
+{
+   if (!valid(str))
+      return false;
+
+   switch(theType)
+   {
+   case ossimParameter::OSSIM_FLOAT_PARAMETER:
+      *theValue.theFloat = (float)ossimString(str).toDouble();
+      break;
+   case ossimParameter::OSSIM_DOUBLE_PARAMETER:
+      *theValue.theDouble = ossimString(str).toDouble();
+      break;
+   case ossimParameter::OSSIM_INT_PARAMETER:
+      *theValue.theInt = ossimString(str).toInt();
+      break;
+   case ossimParameter::OSSIM_UNSIGNED_INT_PARAMETER:
+      *theValue.theUint = ossimString(str).toUInt32();
+      break;
+   case ossimParameter::OSSIM_STRING_PARAMETER:
+      *theValue.theString = ossimString(str).chars();
+      break;
+   }
+   return true;
+}
+
+ossimArgumentParser::ossimArgumentParser(int* argc,char **argv):
+   theArgc(argc),
+   theArgv(argv),
+   theUsage(ossimApplicationUsage::instance()),
+   theMemAllocated(false)
+{
+   if (theArgc)
+      theUsage->setApplicationName(argv[0]);
+}
+
+ossimArgumentParser::ossimArgumentParser(const ossimString& commandLine):
+   theArgc(new int),
+   theArgv(0),
+   theUsage(ossimApplicationUsage::instance()),
+   theMemAllocated(true)
+{
+   vector<ossimString> args = commandLine.split(" ", true);
+   *theArgc = (int)args.size();
+   if (theArgc > 0)
+   {
+      theArgv = new char* [*theArgc];
+      for (size_t i=0; i<args.size(); i++)
+      {
+         size_t n = args[i].size();
+         theArgv[i] = new char [n+1];
+         strncpy(theArgv[i], args[i].chars(), n);
+         theArgv[i][n] = '\0';
+      }
+      theUsage->setApplicationName(theArgv[0]);
+   }
+}
+
+ossimArgumentParser::~ossimArgumentParser()
+{
+   if (theMemAllocated)
+   {
+      for (int i=0; i<*theArgc; ++i)
+         delete [] theArgv[i];
+      delete [] theArgv;
+      delete theArgc;
+   }
+}
+
+void ossimArgumentParser::initialize(int* argc, const char **argv)
+{
+   if(argc > 0) delete (theArgv);
+   theArgc = argc;
+   theArgv = new char*[*argc];
+   for(int i=0;i<*argc;i++)
+   {
+      theArgv[i] = new char[strlen(argv[i])];
+      strcpy(theArgv[i], argv[i]);
+   }
+}
+
+std::string ossimArgumentParser::getApplicationName() const
+{
+   if (theArgc && *theArgc>0 ) return std::string(theArgv[0]);
+   return "";
+}
+
+bool ossimArgumentParser::isOption(int pos) const
+{
+   return pos<*theArgc && isOption(theArgv[pos]);
+}
+
+bool ossimArgumentParser::isString(int pos) const
+{
+   return pos < *theArgc && isString(theArgv[pos]);
+}
+
+bool ossimArgumentParser::isNumber(int pos) const
+{
+   return pos < *theArgc && isNumber(theArgv[pos]);
+}
+
+int ossimArgumentParser::find(const std::string& str) const
+{
+   for(int pos=1;pos<*theArgc;++pos)
+   {
+      if (str==theArgv[pos])
+      {
+         return pos;
+      }
+   }
+   return 0;
+}
+
+bool ossimArgumentParser::match(int pos, const std::string& str) const
+{
+   return pos<*theArgc && str==theArgv[pos];
+}
+
+bool ossimArgumentParser::containsOptions() const
+{
+   for(int pos=1;pos<*theArgc;++pos)
+   {
+      if (isOption(pos)) return true;
+   }
+   return false;
+}
+
+int ossimArgumentParser::numberOfParams(const std::string& str, const ossimParameter param) const
+{
+   int pos=find(str);
+   if (pos<=0) 
+      return -1;
+
+   ++pos;
+   int num_params = 0;
+   while (param.valid(theArgv[pos+num_params]))
+      ++num_params;
+   return num_params;
+}
+
+void ossimArgumentParser::remove(int pos,int num)
+{
+   if (num==0) return;
+   
+   for(;pos+num<*theArgc;++pos)
+   {
+      theArgv[pos]=theArgv[pos+num];
+   }
+   for(;pos<*theArgc;++pos)
+   {
+      theArgv[pos]=0;
+   }
+   *theArgc-=num;
+}
+
+void ossimArgumentParser::insert(int pos, const ossimString& argstr)
+{
+   if (argstr.size()==0)
+      return;
+
+   // Split arg into components (separated by spaces). Need to reallocate args array to new size:
+   vector<ossimString> components = argstr.split(" ");
+   int new_argc = *theArgc + (int)components.size();
+   char** new_argv = new char*[new_argc];
+
+   // First copy the original list, leaving space for the new components:
+   int j = 0;
+   for (int i=0; i<*theArgc; ++i)
+   {
+      if (j == pos)
+         j += (int)components.size();
+      new_argv[j] = theArgv[i];
+      ++j;
+   }
+
+   // Insert new components:
+   for(ossim_uint32 i=0; i<components.size(); ++i)
+      new_argv[pos+i]=components[i].stringDup();
+
+   // Need to deallocate old arg storage?
+   if (theMemAllocated)
+      delete [] theArgv;
+   theArgv = new_argv;
+   *theArgc = new_argc;
+   theMemAllocated = true;
+}
+
+bool ossimArgumentParser::read(const std::string& str)
+{
+   int pos=find(str);
+   if (pos<=0) return false;
+   remove(pos);
+   return true;
+}
+
+bool ossimArgumentParser::read(const std::string& str, ossimParameter value1)
+{
+   int pos=find(str);
+   if (pos<=0) return false;
+   if (!value1.valid(theArgv[pos+1]))
+   {
+      reportError("argument to `"+str+"` is missing");
+      return false;
+   }
+   value1.assign(theArgv[pos+1]);
+   remove(pos,2);
+   return true;
+}
+
+bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
+                               ossimParameter value2)
+{
+   int pos=find(str);
+   if (pos<=0) return false;
+   if (!value1.valid(theArgv[pos+1]) ||
+       !value2.valid(theArgv[pos+2]))
+   {
+      reportError("argument to `"+str+"` is missing");
+      return false;
+   }
+   value1.assign(theArgv[pos+1]);
+   value2.assign(theArgv[pos+2]);
+   remove(pos,3);
+   return true;
+}
+
+bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
+                               ossimParameter value2, ossimParameter value3)
+{
+   int pos=find(str);
+   if (pos<=0) return false;
+   if (!value1.valid(theArgv[pos+1]) ||
+       !value2.valid(theArgv[pos+2]) ||
+       !value3.valid(theArgv[pos+3]))
+   {
+      reportError("argument to `"+str+"` is missing");
+      return false;
+   }
+   value1.assign(theArgv[pos+1]);
+   value2.assign(theArgv[pos+2]);
+   value3.assign(theArgv[pos+3]);
+   remove(pos,4);
+   return true;
+}
+
+bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
+                               ossimParameter value2, ossimParameter value3,
+                               ossimParameter value4)
+{
+   int pos=find(str);
+   if (pos<=0) return false;
+   if (!value1.valid(theArgv[pos+1]) ||
+       !value2.valid(theArgv[pos+2]) ||
+       !value3.valid(theArgv[pos+3]) ||
+       !value4.valid(theArgv[pos+4]))
+   {
+      reportError("argument to `"+str+"` is missing");
+      return false;
+   }
+   value1.assign(theArgv[pos+1]);
+   value2.assign(theArgv[pos+2]);
+   value3.assign(theArgv[pos+3]);
+   value4.assign(theArgv[pos+4]);
+   remove(pos,5);
+   return true;
+}
+
+bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
+                               ossimParameter value2, ossimParameter value3,
+                               ossimParameter value4, ossimParameter value5)
+{
+   int pos=find(str);
+   if (pos<=0) return false;
+   if (!value1.valid(theArgv[pos+1]) ||
+       !value2.valid(theArgv[pos+2]) ||
+       !value3.valid(theArgv[pos+3]) ||
+       !value4.valid(theArgv[pos+4]) ||
+       !value5.valid(theArgv[pos+5]))
+   {
+      reportError("argument to `"+str+"` is missing");
+      return false;
+   }
+   value1.assign(theArgv[pos+1]);
+   value2.assign(theArgv[pos+2]);
+   value3.assign(theArgv[pos+3]);
+   value4.assign(theArgv[pos+4]);
+   value5.assign(theArgv[pos+5]);    
+   remove(pos,6);
+   return true;
+}
+
+bool ossimArgumentParser::read(const std::string& str, ossimParameter value1,
+                               ossimParameter value2, ossimParameter value3,
+                               ossimParameter value4, ossimParameter value5,
+                               ossimParameter value6)
+{
+   int pos=find(str);
+   if (pos<=0) return false;
+   if (!value1.valid(theArgv[pos+1]) ||
+       !value2.valid(theArgv[pos+2]) ||
+       !value3.valid(theArgv[pos+3]) ||
+       !value4.valid(theArgv[pos+4]) ||
+       !value5.valid(theArgv[pos+5]) ||
+       !value6.valid(theArgv[pos+6]))       
+   {
+      reportError("argument to `"+str+"` is missing");
+      return false;
+   }
+   value1.assign(theArgv[pos+1]);
+   value2.assign(theArgv[pos+2]);
+   value3.assign(theArgv[pos+3]);
+   value4.assign(theArgv[pos+4]);
+   value5.assign(theArgv[pos+5]);
+   value6.assign(theArgv[pos+6]);    
+   remove(pos,7);
+   return true;
+}
+
+bool ossimArgumentParser::read(const std::string& str, std::vector<ossimString>& param_list)
+{
+   // This method reads a comma-separated list.
+   param_list.clear();
+
+   int pos=find(str);
+   if (pos<=0)
+      return false;
+
+   // Option is removed even if no values found:
+   remove(pos, 1);
+   bool includeNextItem = true;
+   while (pos < *theArgc)
+   {
+      // Check for occurence of next option:
+      if ((theArgv[pos][0] == '-'))
+         break;
+
+      // Skip a comma surrounded by spaces:
+      ossimString arg = theArgv[pos];
+      if (arg == ",")
+      {
+         remove(pos, 1);
+         includeNextItem = true;
+         continue;
+      }
+
+      if (!includeNextItem && (arg.string()[0] != ','))
+         break;
+
+      // Handle comma separated with no spaces (i.e., multiple args reflected as one in theArgv):
+      vector<ossimString> sub_args = arg.split(",", true);
+      for (ossim_uint32 i=0; i<sub_args.size(); ++i)
+         param_list.push_back(sub_args[i]);
+
+      // If current item ends with comma, the list continues:
+      if (arg[arg.length()-1] != ',')
+         includeNextItem = false;
+
+      remove(pos, 1);
+   }
+
+   return true;
+}
+
+/** if the argument value at the posotion pos matches specified string, and subsequent
+ * parameters are also matched then set the paramter values and remove the from the list of arguments.*/
+bool ossimArgumentParser::read(int pos, const std::string& str)
+{
+   if (match(pos,str))
+   {
+      remove(pos,1);
+      return true;
+   }
+   else
+   {
+      return false;
+   }
+}
+
+bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1)
+{
+   if (match(pos,str) &&
+       value1.valid(theArgv[pos+1]))
+   {
+      value1.assign(theArgv[pos+1]);
+      remove(pos,2);
+      return true;
+   }
+   else
+   {
+      return false;
+   }
+}
+
+bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1, ossimParameter value2)
+{
+   if (match(pos,str) &&
+       value1.valid(theArgv[pos+1]) &&
+       value2.valid(theArgv[pos+2]))
+   {
+      value1.assign(theArgv[pos+1]);
+      value2.assign(theArgv[pos+2]);
+      remove(pos,3);
+      return true;
+   }
+   else
+   {
+      return false;
+   }
+}
+
+bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1, ossimParameter value2, ossimParameter value3)
+{
+   if (match(pos,str) &&
+       value1.valid(theArgv[pos+1]) &&
+       value2.valid(theArgv[pos+2]) &&
+       value3.valid(theArgv[pos+3]))
+   {
+      value1.assign(theArgv[pos+1]);
+      value2.assign(theArgv[pos+2]);
+      value3.assign(theArgv[pos+3]);
+      remove(pos,4);
+      return true;
+   }
+   else
+   {
+      return false;
+   }
+}
+
+bool ossimArgumentParser::read(int pos, const std::string& str, ossimParameter value1, ossimParameter value2, ossimParameter value3, ossimParameter value4)
+{
+   if (match(pos,str) &&
+       value1.valid(theArgv[pos+1]) &&
+       value2.valid(theArgv[pos+2]) &&
+       value3.valid(theArgv[pos+3]) &&
+       value4.valid(theArgv[pos+4]))
+   {
+      value1.assign(theArgv[pos+1]);
+      value2.assign(theArgv[pos+2]);
+      value3.assign(theArgv[pos+3]);
+      value4.assign(theArgv[pos+4]);
+      remove(pos,5);
+      return true;
+   }
+   else
+   {
+      return false;
+   }
+}
+
+bool ossimArgumentParser::errors(ossimErrorSeverity severity) const
+{
+   for(ossimErrorMessageMap::const_iterator itr=theErrorMessageMap.begin();
+       itr!=theErrorMessageMap.end();
+       ++itr)
+   {
+      if (itr->second>=severity) return true;
+   }
+   return false;
+}
+
+void ossimArgumentParser::reportError(const std::string& message, ossimErrorSeverity severity)
+{
+   theErrorMessageMap[message]=severity;
+}
+
+void ossimArgumentParser::reportRemainingOptionsAsUnrecognized(ossimErrorSeverity severity)
+{
+   std::set<std::string> options;
+   if (theUsage)
+   {
+      // parse the usage options to get all the option that the application can potential handle.
+      for(ossimApplicationUsage::UsageMap::const_iterator itr=theUsage->getCommandLineOptions().begin();
+          itr!=theUsage->getCommandLineOptions().end();
+          ++itr)
+      {
+         const std::string& option = itr->first;
+         std::string::size_type prevpos = 0, pos = 0;
+         while ((pos=option.find(' ',prevpos))!=std::string::npos)
+         {
+            if (option[prevpos]=='-')
+            {
+               options.insert(std::string(option,prevpos,pos-prevpos));
+            }
+            prevpos=pos+1;
+         }
+         if (option[prevpos]=='-')
+         {
+
+            options.insert(std::string(option,prevpos,std::string::npos));
+         }
+      }
+
+   }
+
+   for(int pos=1;pos<argc();++pos)
+   {
+      // if an option and havn't been previous querried for report as unrecognized.
+      if (isOption(pos) && options.find(theArgv[pos])==options.end())
+      {
+         reportError(getApplicationName() +": unrecognized option "+theArgv[pos],severity);
+      }
+   }
+}
+
+ossimArgumentParser::ossimErrorMessageMap& ossimArgumentParser::getErrorMessageMap()
+{
+   return theErrorMessageMap;
+}
+   
+const ossimArgumentParser::ossimErrorMessageMap& ossimArgumentParser::getErrorMessageMap() const
+{
+   return theErrorMessageMap;
+}
+
+void ossimArgumentParser::writeErrorMessages(std::ostream& output, ossimErrorSeverity severity)
+{
+   for(ossimErrorMessageMap::iterator itr=theErrorMessageMap.begin();
+       itr!=theErrorMessageMap.end();
+       ++itr)
+   {
+      if (itr->second>=severity)
+      {
+         output<< getApplicationName() << ": " << itr->first << std::endl;
+      }
+   }
+}
diff --git a/ossim/src/ossim/base/ossimBaseObjectFactory.cpp b/src/base/ossimBaseObjectFactory.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimBaseObjectFactory.cpp
rename to src/base/ossimBaseObjectFactory.cpp
diff --git a/ossim/src/ossim/base/ossimBilSplitter.cpp b/src/base/ossimBilSplitter.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimBilSplitter.cpp
rename to src/base/ossimBilSplitter.cpp
diff --git a/ossim/src/ossim/base/ossimBinaryDataProperty.cpp b/src/base/ossimBinaryDataProperty.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimBinaryDataProperty.cpp
rename to src/base/ossimBinaryDataProperty.cpp
diff --git a/src/base/ossimBooleanProperty.cpp b/src/base/ossimBooleanProperty.cpp
new file mode 100644
index 0000000..204565d
--- /dev/null
+++ b/src/base/ossimBooleanProperty.cpp
@@ -0,0 +1,67 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+//*************************************************************************
+// $Id: ossimBooleanProperty.cpp 19888 2011-08-03 11:30:22Z gpotts $
+#include <ossim/base/ossimBooleanProperty.h>
+
+RTTI_DEF1(ossimBooleanProperty, "ossimBooleanProperty", ossimProperty);
+
+ossimBooleanProperty::ossimBooleanProperty(const ossimString& name,
+                                           bool value)
+   :ossimProperty(name),
+    theValue(value)
+{
+}
+
+ossimBooleanProperty::ossimBooleanProperty(const ossimBooleanProperty& rhs)
+   :ossimProperty(rhs),
+    theValue(rhs.theValue)
+{
+}
+
+ossimObject* ossimBooleanProperty::dup()const
+{
+   return new ossimBooleanProperty(*this);
+}
+
+const ossimProperty& ossimBooleanProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+
+   const ossimBooleanProperty* property = dynamic_cast<const ossimBooleanProperty*>(&rhs);
+   if(property)
+   {
+      theValue = property->theValue;
+   }
+   
+   return *this;
+}
+
+bool ossimBooleanProperty::setValue(const ossimString& value)
+{
+   theValue = value.toBool();
+   
+   return true;
+}
+
+bool ossimBooleanProperty::setBooleanValue(bool value,
+					   ossimString& /* msg */)
+{
+   theValue = value;
+
+   return true;
+}
+
+void ossimBooleanProperty::valueToString(ossimString& valueResult)const
+{
+   valueResult = theValue?"true":"false";
+}
+
+bool ossimBooleanProperty::getBoolean()const
+{
+   return theValue;
+}
diff --git a/ossim/src/ossim/base/ossimByteStreamBuffer.cpp b/src/base/ossimByteStreamBuffer.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimByteStreamBuffer.cpp
rename to src/base/ossimByteStreamBuffer.cpp
diff --git a/ossim/src/ossim/base/ossimCmyVector.cpp b/src/base/ossimCmyVector.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimCmyVector.cpp
rename to src/base/ossimCmyVector.cpp
diff --git a/src/base/ossimColorProperty.cpp b/src/base/ossimColorProperty.cpp
new file mode 100644
index 0000000..2162f96
--- /dev/null
+++ b/src/base/ossimColorProperty.cpp
@@ -0,0 +1,120 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+//*************************************************************************
+// $Id: ossimColorProperty.cpp 13667 2008-10-02 19:59:55Z gpotts $
+#include <sstream>
+#include <ossim/base/ossimColorProperty.h>
+
+RTTI_DEF1(ossimColorProperty, "ossimColorProperty", ossimProperty);
+
+ossimColorProperty::ossimColorProperty(const ossimString& name,
+                                       const ossimRgbVector& value)
+   :ossimProperty(name),
+    theValue(value)
+{
+}
+
+ossimColorProperty::ossimColorProperty(const ossimColorProperty& rhs)
+   :ossimProperty(rhs),
+    theValue(rhs.theValue)
+{
+}
+
+ossimColorProperty::~ossimColorProperty()
+{
+}
+
+ossimObject* ossimColorProperty::dup()const
+{
+   return new ossimColorProperty(*this);
+}
+
+const ossimProperty& ossimColorProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+
+   const ossimColorProperty* rhsPtr = dynamic_cast<const ossimColorProperty*>(&rhs);
+   if(rhsPtr)
+   {
+      theValue = rhsPtr->theValue;
+   }
+   else
+   {
+      setValue(rhs.valueToString());
+   }
+
+   return *this;
+}
+
+bool ossimColorProperty::setValue(const ossimString& value)
+{
+   bool result = false;
+   std::vector<ossimString> splitArray;
+   
+   value.split(splitArray, " ");
+   if(splitArray.size() == 3)
+   {
+      int r,g,b;
+      r = splitArray[0].toInt32();
+      g = splitArray[1].toInt32();
+      b = splitArray[2].toInt32();
+      result = true;
+      
+      theValue = ossimRgbVector(r,g,b);
+   }
+   
+   return result;
+}
+
+void ossimColorProperty::valueToString(ossimString& valueResult)const
+{
+   ostringstream out;
+
+   out << (int)theValue.getR() << " " << (int)theValue.getG() << " " << (int)theValue.getB() << endl;
+
+   valueResult = out.str().c_str();
+}
+
+const ossimRgbVector& ossimColorProperty::getColor()const
+{
+   return theValue;
+}
+
+void ossimColorProperty::setColor(const ossimRgbVector& value)
+{
+   theValue = value;
+}
+
+ossim_uint8 ossimColorProperty::getRed()const
+{
+   return theValue.getR();
+}
+
+ossim_uint8 ossimColorProperty::getGreen()const
+{
+   return theValue.getG();
+}
+
+ossim_uint8 ossimColorProperty::getBlue()const
+{
+   return theValue.getB();
+}
+
+void ossimColorProperty::setRed(ossim_uint8 r)
+{
+   theValue.setR(r);
+}
+
+void ossimColorProperty::setGreen(ossim_uint8 g)
+{
+   theValue.setG(g);
+}
+
+void ossimColorProperty::setBlue(ossim_uint8 b)
+{
+   theValue.setB(b);
+}
diff --git a/ossim/src/ossim/base/ossimColumnVector3d.cpp b/src/base/ossimColumnVector3d.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimColumnVector3d.cpp
rename to src/base/ossimColumnVector3d.cpp
diff --git a/src/base/ossimCommon.cpp b/src/base/ossimCommon.cpp
new file mode 100644
index 0000000..b953f3d
--- /dev/null
+++ b/src/base/ossimCommon.cpp
@@ -0,0 +1,1287 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: David Burken
+//
+// Description: Common file for global functions.
+//
+//*************************************************************************
+// $Id: ossimCommon.cpp 23141 2015-02-10 19:43:19Z dburken $
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/matrix/newmat.h>
+#include <OpenThreads/Mutex>
+#include <OpenThreads/Thread>
+#include <ctime>
+#include <sstream>
+
+static OpenThreads::Mutex timeMutex;
+static ossimTrace traceDebug("ossimCommon:debug");
+
+// stores a floating point nan value
+const ossim::IntFloatBitCoercion ossim::nanValue(~ossim_int64(0));
+
+std::istream& ossim::skipws(std::istream& in)
+{
+   int c = in.peek();
+   while( !in.bad() && ossim::isWhiteSpace(c))
+   {
+      in.ignore();
+      c = in.peek();
+   }
+   
+   return in;
+}
+bool ossim::isWhiteSpace(int c)
+{
+   return ( (c == ' ') || (c == '\t') || (c == '\n')|| (c == '\r') ) ;
+}
+
+ossimByteOrder ossim::byteOrder()
+{
+   union
+   {
+      short s;
+      char  c[sizeof(short)];
+   } un;
+
+   un.s = 0x0102;
+   if (un.c[0] ==  2 && un.c[1] == 1)
+   {
+      return OSSIM_LITTLE_ENDIAN;
+   }
+   else
+   {
+      return OSSIM_BIG_ENDIAN;
+   }
+}
+
+double ossim::defaultMin(ossimScalarType scalarType)
+{
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      {
+	return OSSIM_DEFAULT_MIN_PIX_UINT8;
+      }
+      case OSSIM_SINT8:
+      {
+	return OSSIM_DEFAULT_MIN_PIX_SINT8;
+      }
+      case OSSIM_UINT16:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_UINT16;
+      }
+      case OSSIM_SINT16:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_SINT16;
+      }
+      case OSSIM_USHORT11:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_UINT11;
+      }
+      case OSSIM_USHORT12:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_UINT12;
+      }
+      case OSSIM_USHORT13:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_UINT13;
+      }
+      case OSSIM_USHORT14:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_UINT14;
+      }
+      case OSSIM_USHORT15:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_UINT15;
+      }
+      case OSSIM_UINT32:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_UINT32;
+      }
+      case OSSIM_SINT32:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_SINT32;
+      }
+      case OSSIM_FLOAT32:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_FLOAT;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
+      }
+      case OSSIM_FLOAT64:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_DOUBLE;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         return OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << __FILE__ << ":" << __LINE__
+               << "\nUnhandled scalar type:  " << scalarType << std::endl;
+         }
+         break;
+      }
+   }
+   return 0.0; // Should never happen...
+}
+
+double ossim::defaultMax(ossimScalarType scalarType)
+{
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_UINT8;
+      }
+      case OSSIM_SINT8:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_SINT8;
+      }
+      case OSSIM_UINT16:
+      {
+	return OSSIM_DEFAULT_MAX_PIX_UINT16;
+      }
+      case OSSIM_SINT16:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_SINT16;
+      }
+      case OSSIM_UINT11:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_UINT11;
+      }
+      case OSSIM_UINT12:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_UINT12;
+      }
+      case OSSIM_UINT13:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_UINT13;
+      }
+      case OSSIM_UINT14:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_UINT14;
+      }
+      case OSSIM_UINT15:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_UINT15;
+      }
+      case OSSIM_UINT32:
+      {
+	return OSSIM_DEFAULT_MAX_PIX_UINT32;
+      }
+      case OSSIM_SINT32:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_SINT32;
+      }
+      case OSSIM_FLOAT32:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_FLOAT;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
+      }
+      case OSSIM_FLOAT64:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_DOUBLE;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         return OSSIM_DEFAULT_MAX_PIX_NORM_DOUBLE;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << __FILE__ << ":" << __LINE__
+               << "\nUnhandled scalar type:  " << scalarType << std::endl;
+         }
+         break;
+      }
+   }
+   return 0.0; // Should never happen...
+}
+
+double ossim::defaultNull(ossimScalarType scalarType)
+{
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT8;
+      }
+      case OSSIM_SINT8:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_SINT8;
+      }
+      case OSSIM_UINT16:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT16;
+      }
+      case OSSIM_SINT16:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_SINT16;
+      }
+      case OSSIM_UINT11:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT11;
+      }
+      case OSSIM_UINT12:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT12;
+      }
+      case OSSIM_UINT13:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT13;
+      }
+      case OSSIM_UINT14:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT14;
+      }
+      case OSSIM_UINT15:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT15;
+      }
+      case OSSIM_UINT32:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_UINT32;
+      }
+      case OSSIM_SINT32:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_SINT32;
+      }
+      case OSSIM_FLOAT32:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_FLOAT;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_NORM_FLOAT;
+      }
+      case OSSIM_FLOAT64:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_DOUBLE;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         return OSSIM_DEFAULT_NULL_PIX_NORM_DOUBLE;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << __FILE__ << ":" << __LINE__
+               << "\nUnhandled scalar type:  " << scalarType << std::endl;
+         }
+         break;
+      }
+    }
+
+   return 0.0; // Should never happen...
+}
+
+ossim_uint32 ossim::scalarSizeInBytes(ossimScalarType scalarType)
+{
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      {
+         return sizeof(ossim_uint8);
+      }
+      case OSSIM_SINT8:
+      {
+         return sizeof(ossim_sint8);
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         return sizeof(ossim_uint16);
+      }
+      case OSSIM_SINT16:
+      {
+         return sizeof(ossim_sint16);
+      }
+      case OSSIM_UINT32:
+      {
+         return sizeof(ossim_uint32);
+      }
+      case OSSIM_SINT32:
+      {
+         return sizeof(ossim_sint32);
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         return sizeof(ossim_float32);
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         return sizeof(ossim_float64);
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << __FILE__ << ":" << __LINE__
+               << "\nUnhandled scalar type:  " << scalarType << std::endl;
+         }
+         break;
+      }
+  }
+  
+  return 1;
+}
+
+bool ossim::isSigned(ossimScalarType scalarType)
+{
+   bool result = false;
+   switch(scalarType)
+   {
+      case OSSIM_SINT8:
+      case OSSIM_SINT16:
+      case OSSIM_SINT32:
+      case OSSIM_FLOAT32:
+      case OSSIM_FLOAT64:
+      {
+         result = true;
+         break;
+      }
+      default:
+      {
+         break;
+      }
+  }
+  return result;
+}
+
+ossim_uint32 ossim::getActualBitsPerPixel(ossimScalarType scalarType)
+{
+   ossim_uint32 actualBitsPerPixel = 0;
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      case OSSIM_SINT8:
+      {
+         actualBitsPerPixel = 8;
+         break;
+      }
+      case OSSIM_USHORT11:
+      {
+         actualBitsPerPixel = 11;
+         break;
+      }
+      case OSSIM_USHORT12:
+      {
+         actualBitsPerPixel = 12;
+         break;
+      }
+      case OSSIM_USHORT13:
+      {
+         actualBitsPerPixel = 13;
+         break;
+      }
+      case OSSIM_USHORT14:
+      {
+         actualBitsPerPixel = 14;
+         break;
+      }
+      case OSSIM_USHORT15:
+      {
+         actualBitsPerPixel = 15;
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_SINT16:
+      {
+         actualBitsPerPixel = 16;
+         break;
+      }
+      case OSSIM_UINT32:
+      case OSSIM_SINT32:
+      case OSSIM_FLOAT32:
+      case OSSIM_CINT16:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         actualBitsPerPixel = 32;
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_CFLOAT32:
+      case OSSIM_CINT32:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         actualBitsPerPixel = 64;
+         break;
+      }
+      case OSSIM_CFLOAT64:
+      {
+         actualBitsPerPixel = 128;
+         
+         break;
+      }
+      default:
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << __FILE__ << ":" << __LINE__
+               << "\nUnhandled scalar type:  " << scalarType << std::endl;
+         }
+         break;
+      }
+   }
+   return actualBitsPerPixel;
+}
+
+ossim_uint32 ossim::getBitsPerPixel(ossimScalarType scalarType)
+{
+   ossim_uint32 bitsPerPixel = 0;
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      case OSSIM_SINT8:
+      {
+         bitsPerPixel = 8;
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         bitsPerPixel = 16;
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_SINT16:
+      {
+         bitsPerPixel = 16;
+         break;
+      }
+      case OSSIM_UINT32:
+      case OSSIM_SINT32:
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         bitsPerPixel = 32;
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         bitsPerPixel = 64;
+         break;
+      }
+      default:
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << __FILE__ << ":" << __LINE__
+               << "\nUnhandled scalar type:  " << scalarType << std::endl;
+         }
+         break;
+      }
+   }
+   return bitsPerPixel;
+}
+
+void ossim::defaultTileSize(ossimIpt& tileSize)
+{
+   const char* tileSizeKw = ossimPreferences::instance()->
+      findPreference("tile_size");
+
+   if(tileSizeKw)
+   {
+      std::vector<ossimString> splitArray;
+      ossimString tempString(tileSizeKw);
+      tempString.split(splitArray, " ");
+      bool hasX = true;
+    if(splitArray.size() == 2)
+      {
+         tileSize.x = splitArray[0].toInt32();
+         tileSize.y = splitArray[1].toInt32();
+      }
+      else if(splitArray.size() == 1)
+      {
+         tileSize.x = splitArray[0].toInt32();
+         tileSize.y = splitArray[0].toInt32();
+      }
+      else
+      {
+         tileSize = ossimIpt(0,0);
+      }
+      if(tileSize.x < 1)
+      {
+         tileSize.x = OSSIM_DEFAULT_TILE_WIDTH;
+         hasX = false;
+      }
+      if(tileSize.y < 1)
+      {
+         if(!hasX)
+         {
+            tileSize.y = OSSIM_DEFAULT_TILE_HEIGHT;
+         }
+         else
+         {
+            tileSize.y = tileSize.x;
+         }
+      }
+   }
+   else
+   {
+      tileSize.x = OSSIM_DEFAULT_TILE_WIDTH;
+      tileSize.y = OSSIM_DEFAULT_TILE_HEIGHT;
+   }
+}
+
+std::string ossim::convertHtmlSpecialCharactersToNormalCharacter(const std::string& src)
+{
+   ossimString result = src;
+   std::string::size_type pos = 0;
+   pos = result.find("&");
+   
+   while(pos != std::string::npos)
+   {
+      std::string::size_type size = result.size();
+      std::string test1(&result[pos], ossim::min(6, (int)(size-pos)));
+      std::string test2(&result[pos], ossim::min(5, (int)(size-pos)));
+      std::string test3(&result[pos], ossim::min(4, (int)(size-pos)));
+      
+      if(test1 == "'")
+      {
+         result = result.substitute(test1, "'");
+      }
+      else if(test1 == """)
+      {
+         result = result.substitute(test1, "\"");
+      }
+      else if(test2 == "&")
+      {
+         result = result.substitute(test2, "&");
+      }
+      else if(test3 == ">")
+      {
+         result = result.substitute(test3, ">");
+      }
+      else if(test3 == "<")
+      {
+         result = result.substitute(test3, "<");
+      }
+      pos = result.find("&", pos+1);
+   }
+   
+   return result;
+}
+
+bool ossim::matrixToHpr( ossim_float64 hpr[3], const NEWMAT::Matrix& rotation )
+{
+    //implementation converted from plib's sg.cxx
+    //PLIB - A Suite of Portable Game Libraries
+    //Copyright (C) 1998,2002  Steve Baker
+    //For further information visit http://plib.sourceforge.net
+    
+   NEWMAT::Matrix mat(rotation);
+    
+   ossimDpt3d col1(rotation[0][0], rotation[1][0], rotation[2][0]);
+   double s = col1.length();
+   
+   hpr[0] = 0.0;
+   hpr[1] = 0.0;
+   hpr[2] = 0.0;
+
+   if ( s <= 0.00001 )
+   {
+      return true;
+   }
+   
+   
+   double oneOverS = 1.0f / s;
+   for( int i = 0; i < 3; i++ )
+      for( int j = 0; j < 3; j++ )
+         mat[i][j] = rotation[j][i] * oneOverS;
+   
+   
+   hpr[1] = ossim::asind(ossim::clamp(mat[1][2], -1.0, 1.0));
+   
+   double cp = ossim::cosd(hpr[1]);
+   
+   if ( cp > -0.00001 && cp < 0.00001 )
+   {
+      double cr = ossim::clamp(mat[0][1], -1.0, 1.0);
+      double sr = ossim::clamp(-mat[2][1], -1.0, 1.0);
+      
+      hpr[0] = 0.0f;
+      hpr[2] = ossim::atan2d(sr,cr);
+   }
+   else
+   {
+      cp = 1.0 / cp;
+      double sr = ossim::clamp((-mat[0][2] * cp), -1.0,1.0);
+      double cr = ossim::clamp((mat[2][2] * cp), -1.0, 1.0);
+      double sh = ossim::clamp((-mat[1][0] * cp), -1.0, 1.0);
+      double ch = ossim::clamp((mat[1][1] * cp), -1.0, 1.0);
+      
+      if ( (sh == 0.0f && ch == 0.0f) || (sr == 0.0f && cr == 0.0f) )
+      {
+         cr = ossim::clamp(mat[0][1], -1.0, 1.0);
+         sr = ossim::clamp(-mat[2][1], -1.0, 1.0);
+         
+         hpr[0] = 0.0f;
+      }
+      else
+      {
+         hpr[0] = ossim::atan2d(sh, ch);
+      }
+      
+      hpr[2] = ossim::atan2d(sr, cr);
+   }
+   
+   hpr[0] *= -1.0;
+   return true;
+}
+
+bool ossim::matrixToHpr( ossim_float64 hpr[3],
+                  const NEWMAT::Matrix& lsrMatrix,
+                  const NEWMAT::Matrix& rotationalMatrix)
+{
+    bool result = false;
+    NEWMAT::Matrix invertLsr(lsrMatrix.i());
+   
+    hpr[0] = 0.0;
+    hpr[1] = 0.0;
+    hpr[2] = 0.0;
+    result = matrixToHpr(hpr, invertLsr*rotationalMatrix);
+    if(std::abs(hpr[0]) < FLT_EPSILON)
+    {
+       hpr[0] = 0.0;
+    }
+    if(std::abs(hpr[1]) < FLT_EPSILON)
+    {
+       hpr[1] = 0.0;
+    }
+    if(std::abs(hpr[2]) < FLT_EPSILON)
+    {
+       hpr[2] = 0.0;
+    }
+    
+    return result;
+}
+
+
+void ossim::lexQuotedTokens(const std::string& str,
+                            ossim_uint32 start,
+                            const char* whitespace,
+                            const char* quotes,
+                            std::vector<std::string>& tokens,
+                            bool& unbalancedQuotes)
+{
+   ossimREQUIRE(whitespace != NULL);
+   ossimREQUIRE(quotes != NULL);
+   ossimREQUIRE(tokens != NULL);
+   
+   const char openQuote(quotes[0]), closeQuote(quotes[1]);
+   
+   tokens.clear();
+   unbalancedQuotes = false;
+   
+   int end=0;
+   while (start < str.length())
+   {
+      if (str[start] == openQuote)
+      {
+         int openBraceCount = 1;
+         
+         if (start+1 < str.length())
+         {
+            start++;
+            if (str[start] != closeQuote)
+            {
+               //               end = start+1;
+               end = start;
+               while (static_cast<ossim_uint32>(end) < str.length() &&
+                      openBraceCount > 0)
+               {
+                  if (str[end] == openQuote)
+                     openBraceCount++;
+                  else if (str[end] == closeQuote)
+                     openBraceCount--;
+                  end++;
+               }
+            }
+            else
+            {
+               openBraceCount = 0;
+               start++;
+               end = start+1;
+            }
+         }
+         if (openBraceCount == 0)
+         {
+            tokens.push_back(str.substr(start, end-1-start));
+         }
+         else
+         {
+            unbalancedQuotes = true;
+            end = (int)str.length();
+         }
+      }
+      else if (str[start] == closeQuote)
+      {
+         unbalancedQuotes = true;
+         end = (int)str.length();
+	 
+      }
+      else
+      {
+         end = (int)str.find_first_of(whitespace, start);
+         tokens.push_back(str.substr(start, end-start));
+      }
+      
+      start = (ossim_uint32)str.find_first_not_of(whitespace, end);
+   }
+}
+
+void ossim::toStringList(ossimString& resultStringOfPoints,
+                         const std::vector<ossimDpt>& pointList, 
+                         char separator)
+{
+   ossim_uint32 idx = 0;
+   for(;idx < pointList.size();++idx)
+   {
+      ossimString pt = pointList[idx].toString();
+      if(resultStringOfPoints.empty())
+      {
+         resultStringOfPoints = pt;
+      }
+      else
+      {
+         resultStringOfPoints += (separator + pt);
+      }
+   }
+}
+
+void ossim::toStringList(ossimString& resultStringOfPoints,
+                         const std::vector<ossimIpt>& pointList, 
+                         char separator)
+{
+   ossim_uint32 idx = 0;
+   for(;idx < pointList.size();++idx)
+   {
+      ossimString pt = pointList[idx].toString();
+      if(resultStringOfPoints.empty())
+      {
+         resultStringOfPoints = pt;
+      }
+      else
+      {
+         resultStringOfPoints += (separator + pt);
+      }
+   }
+}
+
+void ossim::toStringList(ossimString& resultStringOfPoints,
+                         const std::vector<ossimGpt>& pointList, 
+                         char separator)
+{
+   ossim_uint32 idx = 0;
+   for(;idx < pointList.size();++idx)
+   {
+      ossimString pt = pointList[idx].toString();
+      if(resultStringOfPoints.empty())
+      {
+         resultStringOfPoints = pt;
+      }
+      else
+      {
+         resultStringOfPoints += (separator + pt);
+      }
+   }
+}
+
+void ossim::toVector(std::vector<ossimDpt>& result,
+                     const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> splitResult;
+  
+   // let grab each point string that is surrounded by ()
+   std::istringstream in(stringOfPoints.trim());
+   ossimString currentPoint = "";
+   ossimDpt tempPoint;
+   while(!in.bad()&&!in.eof())
+   {
+      skipws(in);
+      if(in.peek() == '(')
+      {
+         currentPoint += (char)in.get();
+         skipws(in);
+         if(in.peek() == '(') in.ignore();
+         
+         while(!in.bad()&&!in.eof()&&(in.peek() != ')'))
+         {
+            currentPoint += (char)in.get();
+         }
+         if(in.good())
+         {
+            currentPoint += (char)in.get();
+            tempPoint.toPoint(currentPoint);
+            result.push_back(tempPoint);
+         }
+         currentPoint = "";
+      }
+      else 
+      {
+         in.ignore();
+      }
+   }   
+}
+
+void ossim::toVector(std::vector<ossimIpt>& result,
+                     const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> splitResult;
+   
+   // let grab each point string that is surrounded by ()
+   std::istringstream in(stringOfPoints.trim());
+   ossimString currentPoint = "";
+   ossimIpt tempPoint;
+   while(!in.bad()&&!in.eof())
+   {
+      skipws(in);
+      if(in.peek() == '(')
+      {
+         currentPoint += (char)in.get();
+         skipws(in);
+         if(in.peek() == '(') in.ignore();
+         
+         while(!in.bad()&&!in.eof()&&(in.peek() != ')'))
+         {
+            currentPoint += (char)in.get();
+         }
+         if(in.good())
+         {
+            currentPoint += (char)in.get();
+            tempPoint.toPoint(currentPoint);
+            result.push_back(tempPoint);
+         }
+         currentPoint = "";
+      }
+      else 
+      {
+         in.ignore();
+      }
+   }   
+}
+void ossim::toVector(std::vector<ossimGpt>& result,
+                     const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> splitResult;
+   
+   // let grab each point string that is surrounded by ()
+   std::istringstream in(stringOfPoints.trim());
+   ossimString currentPoint = "";
+   ossimGpt tempPoint;
+   while(!in.bad()&&!in.eof())
+   {
+      skipws(in);
+      if(in.peek() == '(')
+      {
+         currentPoint += (char)in.get();
+         skipws(in);
+         if(in.peek() == '(') in.ignore();
+         
+         while(!in.bad()&&!in.eof()&&(in.peek() != ')'))
+         {
+            currentPoint += (char)in.get();
+         }
+         if(in.good())
+         {
+            currentPoint += (char)in.get();
+            tempPoint.toPoint(currentPoint);
+            result.push_back(tempPoint);
+         }
+         currentPoint = "";
+      }
+      else 
+      {
+         in.ignore();
+      }
+   }   
+}
+
+bool ossim::extractSimpleValues(std::vector<ossimString>& values,
+                                const ossimString& stringOfPoints)
+{
+   std::istringstream in(stringOfPoints);
+   ossim::skipws(in);
+   bool result = true;
+   if(stringOfPoints.empty()) return result;
+   char c = in.get();
+   ossimString value = "";
+   if(c == '(')
+   {
+      c = (char)in.get();
+      while((c!=')')&&
+            (c!= '\n')&&
+            (in.good()))
+      {
+         if(c!= ',')
+         {
+            value += ossimString(c);
+         }
+         else
+         {
+            values.push_back(value);
+            value = "";
+         }
+         c = in.get();
+      }
+   }
+   if(c!= ')')
+   {
+      result = false;
+   }
+   else
+   {
+      if(!value.empty())
+      {
+         values.push_back(value);
+      }
+   }
+   
+   return result;
+}
+
+bool ossim::toSimpleVector(std::vector<ossim_uint32>& result,
+                           const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> extractedValues;
+   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
+   if(resultFlag)
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
+      for(idx = 0; idx < size; ++idx)
+      {
+         result.push_back(extractedValues[idx].toUInt32());
+      }
+   }
+   return resultFlag;
+}
+
+template <>
+void ossim::toSimpleStringList(ossimString& result,
+                               const std::vector<ossim_uint8>& valuesList)
+
+{
+   std::ostringstream out;
+   
+   if(!valuesList.empty())
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32)(valuesList.size()-1);
+      for(idx = 0; idx < size; ++idx)
+      {
+         out << ((ossim_uint32)valuesList[idx]) << ",";
+      }
+      out << static_cast<ossim_uint32>(valuesList[size]);
+   }
+   
+   result = "("+out.str()+")";
+}
+
+template <>
+void ossim::toSimpleStringList(ossimString& result,
+                               const std::vector<ossim_float64>& valuesList)
+
+{
+   std::ostringstream out;
+   out << std::setiosflags(std::ios::fixed) << std::setprecision(20);
+   if(!valuesList.empty())
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32) (valuesList.size()-1);
+      for(idx = 0; idx < size; ++idx)
+      {
+         out << valuesList[idx] << ",";
+      }
+      out << valuesList[size];
+   }
+   
+   result = "("+out.str()+")";
+}
+
+template <>
+void ossim::toSimpleStringList(ossimString& result,
+                               const std::vector<ossim_float32>& valuesList)
+
+{
+   std::ostringstream out;
+   out << std::setiosflags(std::ios::fixed) << std::setprecision(20);
+   if(!valuesList.empty())
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32) (valuesList.size()-1);
+      for(idx = 0; idx < size; ++idx)
+      {
+         out << valuesList[idx] << ",";
+      }
+      out << valuesList[size];
+   }
+   
+   result = "("+out.str()+")";
+}
+
+template <>
+void ossim::toSimpleStringList(ossimString& result,
+                               const std::vector<ossimString>& valuesList)
+
+{
+   std::ostringstream out;
+   if(!valuesList.empty())
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32) (valuesList.size()-1);
+      for(idx = 0; idx < size; ++idx)
+      {
+         out << valuesList[idx] << ",";
+      }
+      out << valuesList[size];
+   }
+   
+   result = "("+out.str()+")";
+}
+
+bool ossim::toSimpleVector(std::vector<ossim_int32>& result,
+                           const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> extractedValues;
+   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
+   if(resultFlag)
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_int32) extractedValues.size();
+      for(idx = 0; idx < size; ++idx)
+      {
+         result.push_back(extractedValues[idx].toInt32());
+      }
+   }
+   return resultFlag;
+}
+
+bool ossim::toSimpleVector(std::vector<ossim_uint16>& result,
+                           const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> extractedValues;
+   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
+   if(resultFlag)
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_int32) extractedValues.size();
+      for(idx = 0; idx < size; ++idx)
+      {
+         result.push_back(extractedValues[idx].toUInt32());
+      }
+   }
+   return resultFlag;
+}
+
+bool ossim::toSimpleVector(std::vector<ossim_int16>& result,
+                           const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> extractedValues;
+   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
+   if(resultFlag)
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
+      for(idx = 0; idx < size; ++idx)
+      {
+         result.push_back(extractedValues[idx].toInt32());
+      }
+   }
+   return resultFlag;
+}
+
+bool ossim::toSimpleVector(std::vector<ossim_uint8>& result,
+                    const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> extractedValues;
+   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
+   if(resultFlag)
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
+      for(idx = 0; idx < size; ++idx)
+      {
+         result.push_back(extractedValues[idx].toUInt8());
+      }
+   }
+   return resultFlag;
+}
+
+bool ossim::toSimpleVector(std::vector<ossim_int8>& result,
+                    const ossimString& stringOfPoints)
+{
+   std::vector<ossimString> extractedValues;
+   bool resultFlag = extractSimpleValues(extractedValues, stringOfPoints);
+   if(resultFlag)
+   {
+      ossim_uint32 idx = 0;
+      ossim_uint32 size = (ossim_uint32) extractedValues.size();
+      for(idx = 0; idx < size; ++idx)
+      {
+         result.push_back(extractedValues[idx].toUInt8());
+      }
+   }
+   return resultFlag;
+}
+
+bool ossim::toSimpleVector(std::vector<ossimString>& result,
+                    const ossimString& stringOfStrings)
+{
+   std::vector<ossimString> extractedValues;
+   bool resultFlag = extractSimpleValues(result, stringOfStrings);
+
+   return resultFlag;
+}
+
+ossim_uint32 ossim::getNumberOfThreads()
+{
+   ossim_uint32 result;
+   const char* str = ossimPreferences::instance()->findPreference("ossim_threads");
+   if ( str )
+   {
+      result = ossimString(str).toUInt32();
+   }
+   else
+   {
+      result = static_cast<ossim_uint32>( OpenThreads::GetNumberOfProcessors() );
+   }
+   if ( !result )
+   {
+      result = 1;
+   }
+   return result;
+}
+
+void ossim::getFormattedTime(
+   const std::string& format, bool gmtFlag, std::string& result )
+{
+   timeMutex.lock();
+   
+   time_t rawTime;
+   time(&rawTime);
+   
+   struct tm* timeInfo;
+   if ( gmtFlag )
+   {
+      timeInfo = gmtime(&rawTime);
+   }
+   else
+   {
+      timeInfo = localtime(&rawTime);
+   }
+   
+   size_t size = 0;
+   if ( timeInfo )
+   {
+      const size_t STRING_SIZE = 196; // This is a big time string size.
+      char outStr[STRING_SIZE];
+
+      size = strftime(outStr, STRING_SIZE, format.c_str(), timeInfo );
+
+      if ( size )
+      {
+         // Per strftime spec not needed but null terminating anyway.
+         outStr[STRING_SIZE-1] = '\0';
+         result = outStr;
+      }
+   }
+   if ( !size )
+   {
+      result.clear();
+   }
+
+   timeMutex.unlock();
+}
+
+ossim_int64 ossim::getTime()
+{
+   time_t rawTime;
+   
+   timeMutex.lock();
+   time(&rawTime);
+   timeMutex.unlock();
+   
+   return (ossim_int64)rawTime;
+}
+
+ossim_uint32 ossim::computeLevels(const ossimIrect& rect)
+{
+   ossim_uint32 result = 0;
+   ossim_uint32 stopDimension = 0;
+      
+   // Get the stop dimension from ossim preferences.
+   const char* lookup = ossimPreferences::instance()->
+      findPreference(ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW);
+   if (lookup)
+   {
+      stopDimension = ossimString(lookup).toUInt32();
+   }
+   
+   if (stopDimension == 0)
+   {
+      // Use the smallest default tile size.
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      stopDimension = tileSize.x < tileSize.y ? tileSize.x : tileSize.y;
+   }
+      
+   ossim_uint32 largestImageDimension =
+      rect.width() > rect.height() ? rect.width() : rect.height();
+   
+   while(largestImageDimension > stopDimension)
+   {
+      largestImageDimension /= 2;
+      ++result;
+   }
+   
+   return result;
+}
diff --git a/ossim/src/ossim/base/ossimConnectableContainer.cpp b/src/base/ossimConnectableContainer.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimConnectableContainer.cpp
rename to src/base/ossimConnectableContainer.cpp
diff --git a/ossim/src/ossim/base/ossimConnectableContainerInterface.cpp b/src/base/ossimConnectableContainerInterface.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimConnectableContainerInterface.cpp
rename to src/base/ossimConnectableContainerInterface.cpp
diff --git a/src/base/ossimConnectableDisplayListener.cpp b/src/base/ossimConnectableDisplayListener.cpp
new file mode 100644
index 0000000..9804bd5
--- /dev/null
+++ b/src/base/ossimConnectableDisplayListener.cpp
@@ -0,0 +1,179 @@
+
+//----------------------------------------------------------------------------
+// Copyright (c) 2004, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: 
+//
+//----------------------------------------------------------------------------
+// $Id: ossimConnectableDisplayListener.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/base/ossimConnectableDisplayListener.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimObjectEvents.h>
+#include <ossim/base/ossimDisplayListEvent.h>
+#include <ossim/base/ossimDisplayRefreshEvent.h>
+
+#include <ossim/base/ossimNotifyContext.h>
+
+RTTI_DEF1(ossimConnectableDisplayListener,
+          "ossimConnectableDisplayListener",
+          ossimListener);
+
+ossimConnectableDisplayListener::ossimConnectableDisplayListener()
+   : ossimListener()
+{}
+
+void ossimConnectableDisplayListener::processEvent(ossimEvent& event)
+{
+   switch(event.getId())
+   {
+      case OSSIM_EVENT_OBJECT_DESTRUCTING_ID:
+      {
+         ossimObjectDestructingEvent* eventCast =
+            static_cast<ossimObjectDestructingEvent*>(&event);
+         objectDestructingEvent(*eventCast);
+         
+         break;
+      }
+      case OSSIM_EVENT_CONNECTION_CONNECT_ID:
+      case OSSIM_EVENT_CONNECTION_DISCONNECT_ID:
+      {
+         ossimConnectionEvent* eventCast =
+            static_cast<ossimConnectionEvent*>(&event);
+         
+         connectionEvent(*eventCast);
+         if(event.getId() == OSSIM_EVENT_CONNECTION_DISCONNECT_ID)
+         {
+            if(eventCast->isInputDirection())
+            {
+               disconnectInputEvent(*eventCast);
+            }
+            else if(eventCast->isOutputDirection())
+            {
+               disconnectOutputEvent(*eventCast);
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimConnectableDisplayListener::processEvent, Direction not set\n";
+            }
+         }
+         else
+         {
+            ossimConnectionEvent* eventCast = static_cast<ossimConnectionEvent*>(&event);
+            
+            if(eventCast->isInputDirection())
+            {
+               connectInputEvent(*eventCast);
+            }
+            else if(eventCast->isOutputDirection())
+            {
+               connectOutputEvent(*eventCast);
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableDisplayListener::processEvent, Direction not set\n";
+            }
+         }
+         break;
+      }
+      case OSSIM_EVENT_PROPERTY_ID:
+      {
+         ossimPropertyEvent* eventCast = static_cast<ossimPropertyEvent*>(&event);
+         propertyEvent(*eventCast);
+         break;
+      }
+      case OSSIM_EVENT_ADD_OBJECT_ID:
+      {
+         ossimContainerEvent* eventCast = static_cast<ossimContainerEvent*>(&event);
+         addObjectEvent(*eventCast);
+         break;
+      }
+      case OSSIM_EVENT_REMOVE_OBJECT_ID:
+      {
+         ossimContainerEvent* eventCast = static_cast<ossimContainerEvent*>(&event);
+         removeObjectEvent(*eventCast);
+         break;
+      }
+      case OSSIM_EVENT_REFRESH_ID:
+      {
+         ossimRefreshEvent* eventCast = static_cast<ossimRefreshEvent*>(&event);
+         refreshEvent(*eventCast);
+         break;
+      }
+      case OSSIM_EVENT_DISPLAY_LIST_ID:
+      {
+         ossimDisplayListEvent* eventCast =
+            static_cast<ossimDisplayListEvent*>(&event);
+         displayListEvent(*eventCast);
+         break;
+      }
+      case OSSIM_EVENT_DISPLAY_REFRESH_ID:
+      {
+         ossimDisplayRefreshEvent* eventCast =
+            static_cast<ossimDisplayRefreshEvent*>(&event);
+         displayRefreshEvent(*eventCast);
+         break;
+      }
+      default:
+      {
+         ossimListener::processEvent(event);
+         break;
+      }
+   }
+}
+
+void ossimConnectableDisplayListener::objectDestructingEvent(
+   ossimObjectDestructingEvent& /*event*/)
+{
+}
+
+void ossimConnectableDisplayListener::connectionEvent(
+   ossimConnectionEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::disconnectInputEvent(
+   ossimConnectionEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::disconnectOutputEvent(
+   ossimConnectionEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::connectInputEvent(
+   ossimConnectionEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::connectOutputEvent(
+   ossimConnectionEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::propertyEvent(
+   ossimPropertyEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::displayListEvent(ossimDisplayListEvent&)
+{}
+
+void ossimConnectableDisplayListener::displayRefreshEvent(
+   ossimDisplayRefreshEvent&)
+{}
+
+void ossimConnectableDisplayListener::addObjectEvent(
+   ossimContainerEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::removeObjectEvent(
+   ossimContainerEvent& /* event */)
+{}
+
+void ossimConnectableDisplayListener::refreshEvent(
+   ossimRefreshEvent& /* event */)
+{}
+
diff --git a/src/base/ossimConnectableObject.cpp b/src/base/ossimConnectableObject.cpp
new file mode 100644
index 0000000..30922be
--- /dev/null
+++ b/src/base/ossimConnectableObject.cpp
@@ -0,0 +1,2351 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimConnectableObject.cpp 21850 2012-10-21 20:09:55Z dburken $
+
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimIdManager.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimObjectEvents.h>
+#include <ossim/base/ossimConnectableContainerInterface.h>
+#include <ossim/base/ossimConnectableContainer.h>
+#include <ossim/base/ossimTextProperty.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimVisitor.h>
+#include <algorithm>
+
+RTTI_DEF3(ossimConnectableObject,
+          "ossimConnectableObject",
+          ossimObject,
+          ossimListenerManager,
+          ossimPropertyInterface);
+
+const char* CONNECTABLE_INPUT_LIST_FIXED_KW  = "input_list_fixed";
+const char* CONNECTABLE_OUTPUT_LIST_FIXED_KW = "output_list_fixed";
+
+ossimConnectableObject::ossimConnectableObject(ossimObject* owner)
+:ossimObject(),
+ossimListenerManager(),
+theInputListIsFixedFlag(false),
+theOutputListIsFixedFlag(false)
+{
+   theId    = ossimIdManager::instance()->generateId();
+   theOwner = owner;
+}
+
+ossimConnectableObject::ossimConnectableObject(ossimObject* owner,
+                                               ossim_int32 inputListSize,
+                                               ossim_int32 outputListSize,
+                                               bool inputListIsFixedFlag,
+                                               bool outputListIsFixedFlag)
+:ossimObject(),
+ossimListenerManager(),
+theInputListIsFixedFlag(inputListIsFixedFlag),
+theOutputListIsFixedFlag(outputListIsFixedFlag)
+{
+   theId    = ossimIdManager::instance()->generateId();
+   theOwner = owner;
+   
+   setNumberOfInputs(inputListSize);
+   setNumberOfOutputs(outputListSize);
+}
+
+ossimConnectableObject::~ossimConnectableObject()
+{
+   
+   // tell the immediate listeners that we are destructing.
+   // RP - Probably not a great change, but the multithread sequencer boms
+   // here due to one image handler with multiple connected thread image
+   // chains
+   //ossimObjectDestructingEvent event(this);
+   
+   //    if(theOwner)
+   //    {
+   //       ossimListenerManager* manager = PTR_CAST(ossimListenerManager, theOwner);
+   
+   //       if(manager)
+   //       {
+   //          // notify the owner that you are destructing
+   //          //
+   //          manager->fireEvent(event);
+   //       }
+   //    }
+   
+   // notify all other listeners that you are destructing
+   //
+   //fireEvent(event);
+   
+ }
+
+void ossimConnectableObject::changeOwner(ossimObject* owner)
+{
+   theOwner = owner;
+}
+
+void ossimConnectableObject::setDescription(const ossimString& description)
+{
+   theDescription = description;
+}
+
+ossimString ossimConnectableObject::getDescription()const
+{
+   return theDescription;
+}
+
+bool ossimConnectableObject::isConnected(ossimConnectableObjectDirectionType direction)const
+{
+   if(direction & CONNECTABLE_DIRECTION_INPUT)
+   {
+      if(getNumberOfInputs())
+      {
+         ConnectableObjectList::const_iterator current = theInputObjectList.begin();
+         
+         while(current != theInputObjectList.end())
+         {
+            if(! (*current))
+            {
+               return false;
+            }
+            
+            ++current;
+         }
+      }
+      else if(!theInputListIsFixedFlag)
+      {
+         return false;
+      }
+   }
+   
+   if(direction & CONNECTABLE_DIRECTION_OUTPUT)
+   {
+      if(theOutputObjectList.empty())
+      {
+         return theOutputListIsFixedFlag;
+         
+      }
+      ConnectableObjectList::const_iterator current = theOutputObjectList.begin();
+      current = theOutputObjectList.begin();
+      while(current != theOutputObjectList.end())
+      {
+         if(! (*current))
+         {
+            return false;
+         }
+         
+         ++current;
+      }
+   }
+   
+   return true;
+}
+
+ossimConnectableObject* ossimConnectableObject::findConnectableObject(const ossimId& id)
+{
+   ConnectableObjectList::iterator current;
+   
+   current = theInputObjectList.begin();
+   while(current != theInputObjectList.end())
+   {
+      ossimConnectableObject* temp = (*current).get();
+      
+      if(temp->getId() == id)
+      {
+         return temp;
+      }
+      
+      ++current;
+   }
+   
+   // go through the outputs
+   current = theOutputObjectList.begin();
+   while(current != theOutputObjectList.end())
+   {
+      ossimConnectableObject* temp = (*current).get();
+      
+      if(temp->getId() == id)
+      {
+         return temp;
+      }
+      
+      ++current;
+   }
+   
+   return 0;
+}
+
+ossimConnectableObject* ossimConnectableObject::findObjectOfType(
+   RTTItypeid typeId,
+   ossimConnectableObjectDirectionType directionType,
+   bool recurse)
+{
+   ossimConnectableObject* result = 0;
+
+   if(directionType != CONNECTABLE_DIRECTION_NONE)
+   {
+      ConnectableObjectList* connectableList = 0;
+
+      if ( CONNECTABLE_DIRECTION_INPUT )
+      {
+         connectableList = &theInputObjectList;
+      }
+      else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
+      {
+         connectableList = &theOutputObjectList;
+      }
+
+      // see if it is in the immediate list
+      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
+      {
+         if( (*connectableList)[index].valid() )
+         {
+            if( (*connectableList)[index]->canCastTo( typeId ) )
+            {
+               result = (*connectableList)[index].get();
+               break;
+            }
+         }
+      }
+
+      if ( !result )
+      {
+         ossimVisitor::VisitorType vType = ossimVisitor::VISIT_NONE;
+         
+         if ( CONNECTABLE_DIRECTION_INPUT )
+         {
+            if ( recurse )
+            {
+               // Cast needed for compiler...
+               vType = (ossimVisitor::VisitorType)
+                  (ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_CHILDREN);
+            }
+            else
+            {
+               vType = ossimVisitor::VISIT_INPUTS;
+            }
+         }
+         else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
+         {
+            if ( recurse )
+            {
+               // Cast needed for compiler...
+               vType = (ossimVisitor::VisitorType)
+                  (ossimVisitor::VISIT_OUTPUTS|ossimVisitor::VISIT_CHILDREN);
+            }
+            else
+            {
+               vType = ossimVisitor::VISIT_OUTPUTS;
+            }
+         }
+         
+         ossimTypeIdVisitor visitor( typeId,
+                                     true, // firstofTypeFlag
+                                     vType );
+
+
+         this->accept( visitor );
+         result = dynamic_cast<ossimConnectableObject*>( visitor.getObject(0) );
+      }
+      
+   } // Matches: if(directionType != CONNECTABLE_DIRECTION_NONE)
+   
+   return result;
+   
+} // End: findObjectOfType( RTTItypeid ...
+
+ossimConnectableObject* ossimConnectableObject::findObjectOfType(
+   const ossimString& className,
+   ossimConnectableObjectDirectionType directionType,
+   bool recurse )
+{
+   ossimConnectableObject* result = 0;
+   
+   if(directionType != CONNECTABLE_DIRECTION_NONE)
+   {
+      ConnectableObjectList* connectableList = 0;
+      
+      if ( CONNECTABLE_DIRECTION_INPUT )
+      {
+         connectableList = &theInputObjectList;
+      }
+      else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
+      {
+         connectableList = &theOutputObjectList;
+      }
+      
+      // see if it is in the immediate list
+      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
+      {
+         if( (*connectableList)[index].valid() )
+         {
+            if( (*connectableList)[index]->canCastTo( className ) )
+            {
+               result = (*connectableList)[index].get();
+               break;
+            }
+         }
+      }
+      
+      if ( !result )
+      {
+         ossimVisitor::VisitorType vType = ossimVisitor::VISIT_NONE;
+         
+         if ( CONNECTABLE_DIRECTION_INPUT )
+         {
+            if ( recurse )
+            {
+               // Cast needed for compiler...
+               vType = (ossimVisitor::VisitorType)
+                  (ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_CHILDREN);
+            }
+            else
+            {
+               vType = ossimVisitor::VISIT_INPUTS;
+            }
+         }
+         else // (directionType == CONNECTABLE_DIRECTION_OUTPUT)
+         {
+            if ( recurse )
+            {
+               // Cast needed for compiler...
+               vType = (ossimVisitor::VisitorType)
+                  (ossimVisitor::VISIT_OUTPUTS|ossimVisitor::VISIT_CHILDREN);
+            }
+            else
+            {
+               vType = ossimVisitor::VISIT_OUTPUTS;
+            }
+         }
+         
+         ossimTypeNameVisitor visitor( className,
+                                       true, // firstofTypeFlag
+                                       vType );
+         this->accept( visitor );
+         result = dynamic_cast<ossimConnectableObject*>( visitor.getObject(0) );
+      }
+      
+   } // Matches: if(directionType != CONNECTABLE_DIRECTION_NONE)
+   
+   return result;
+   
+} // End: findObjectOfType( const ossimString& className ...
+
+ossimConnectableObject* ossimConnectableObject::findInputObjectOfType(
+   const ossimString& className)
+{
+   ossimConnectableObject* result = 0;
+   
+   // See if we are of class type.
+   if ( canCastTo( className ) )
+   {
+      result = this;
+   }
+
+   if ( !result )
+   {
+      ConnectableObjectList* connectableList = &theInputObjectList;
+
+      // see if it is in the immediate list
+      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
+      {
+         if( (*connectableList)[index].valid() )
+         {
+            if( (*connectableList)[index]->canCastTo( className ) )
+            {
+               result = (*connectableList)[index].get();
+               break;
+            }
+         }
+      }
+      
+      if ( !result )
+      {
+         ossimTypeNameVisitor visitor( className,
+                                       true, // firstofTypeFlag
+                                       (ossimVisitor::VISIT_INPUTS|
+                                        ossimVisitor::VISIT_CHILDREN) );
+         this->accept( visitor );
+         result = dynamic_cast<ossimConnectableObject*>( visitor.getObject(0) );
+      }
+   }
+   
+   return result;
+   
+} // End: findInputObjectOfType( const ossimString& className )
+
+// Old findObject findInputObject code kept here until debugged to satisfaction.
+#if 0 /* drb */
+
+ossimConnectableObject* ossimConnectableObject::findObjectOfType(RTTItypeid typeId,
+                                                                 ossimConnectableObjectDirectionType directionType,
+                                                                 bool recurse)
+{
+   ConnectableObjectList* connectableList = &theInputObjectList;
+   
+   
+   if(directionType == CONNECTABLE_DIRECTION_NONE)
+   {
+      return 0;
+   }
+   
+   if(directionType == CONNECTABLE_DIRECTION_OUTPUT)
+   {
+      connectableList = &theOutputObjectList;
+   }
+   // see if it is in the immediate list
+   for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
+   {
+      if((*connectableList)[index].valid())
+      {
+         if((*connectableList)[index]->canCastTo(typeId))//typeId.can_cast(TYPE_INFO(theInputObjectList[index])))
+         {
+            return (*connectableList)[index].get();
+         }
+      }
+   }
+   
+   if(recurse)
+   {
+      ossimConnectableContainerInterface* inter =
+         dynamic_cast<ossimConnectableContainerInterface*>(this);
+      if(inter)
+      {
+         ossimConnectableObject* tempObj = inter->findFirstObjectOfType(typeId);
+         if(tempObj)
+         {
+            return tempObj;
+         }
+      }
+      
+      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
+      {
+         inter = dynamic_cast<ossimConnectableContainerInterface*>((*connectableList)[index].get());
+         if(inter)
+         {
+            ossimConnectableObject* tempObj = inter->findFirstObjectOfType(typeId);
+            if(tempObj)
+            {
+               return tempObj;
+            }
+         }
+         if((*connectableList)[index].valid())
+         {
+            ossimConnectableObject* result = (*connectableList)[index]->findObjectOfType(typeId,
+                                                                                         directionType,
+                                                                                         recurse);
+            if(result)
+            {
+               return result;
+            }
+         }
+      }
+   }
+   
+   ossimConnectableObject* result = 0;
+   for(ossim_uint32 index = 0; (index < connectableList->size())&&!result; ++index)
+   {
+      if((*connectableList)[index].valid())
+      {
+         result = ((*connectableList)[index])->findObjectOfType(typeId,
+                                                                directionType,
+                                                                recurse);
+      }
+   }
+   
+   return result;
+}
+
+ossimConnectableObject* ossimConnectableObject::findObjectOfType(
+                                                                 const ossimString& className,
+                                                                 ossimConnectableObjectDirectionType directionType,
+                                                                 bool recurse)
+{
+   ConnectableObjectList *connectableList = &theInputObjectList;
+   
+   if(directionType == CONNECTABLE_DIRECTION_NONE)
+   {
+      return 0;
+   }
+   
+   if(directionType == CONNECTABLE_DIRECTION_OUTPUT)
+   {
+      connectableList = &theOutputObjectList;
+      
+   }
+   
+   // see if it is in the immediate list
+   for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
+   {
+      if((*connectableList)[index].valid())
+      {
+         if((*connectableList)[index]->canCastTo(className))//typeId.can_cast(TYPE_INFO(theInputObjectList[index])))
+         {
+            return (*connectableList)[index].get();
+         }
+      }
+   }
+   
+   if(recurse)
+   {
+      ossimConnectableContainerInterface* inter =
+         dynamic_cast<ossimConnectableContainerInterface*>(this);
+      if(inter)
+      {
+         ossimConnectableObject* tempObj = inter->findFirstObjectOfType(className);
+         if(tempObj)
+         {
+            return tempObj;
+         }
+      }
+      for(ossim_uint32 index = 0; index < connectableList->size(); ++index)
+      {
+         inter = dynamic_cast<ossimConnectableContainerInterface*>(
+                          (*connectableList)[index].get());
+         if(inter)
+         {
+            ossimConnectableObject* tempObj = inter->findFirstObjectOfType(className);
+            if(tempObj)
+            {
+               return tempObj;
+            }
+         }
+         if((*connectableList)[index].valid())
+         {
+            ossimConnectableObject* result = (*connectableList)[index]->findObjectOfType(className,
+                                                                                         directionType,
+                                                                                         recurse);
+            if(result)
+            {
+               return result;
+            }
+         }
+      }
+   }
+   ossimConnectableObject* result = 0;
+   for(ossim_uint32 index = 0; (index < connectableList->size())&&!result; ++index)
+   {
+      if((*connectableList)[index].valid())
+      {
+         result = ((*connectableList)[index])->findObjectOfType(className,
+                                                                directionType,
+                                                                recurse);
+      }
+   }
+   
+   return result;
+}
+
+ossimConnectableObject* ossimConnectableObject::findInputObjectOfType(
+    
+                                                                      const ossimString& className)
+{
+   // See if we are of class type.
+   if (canCastTo(className))
+   {
+      return this;
+   }
+   ossimConnectableObject* result = 0;
+   // If we are a container, look inside for type.
+   ossimConnectableContainerInterface* container =
+      dynamic_cast<ossimConnectableContainerInterface*>(this);
+   if (container)
+   {
+      const ossim_uint32 NUMBER_OF_OBJECTS =
+      container->getNumberOfObjects(false);
+      if (NUMBER_OF_OBJECTS)
+      {
+         for (ossim_uint32 idx = NUMBER_OF_OBJECTS; idx > 0; --idx) 
+         {
+            result =
+            container->getConnectableObject(idx-1);
+            if (result)
+            {
+               if (result->canCastTo(className))
+               {
+                  return result;
+               }
+               else 
+               {
+                  result = result->findInputObjectOfType(className);
+                  if(result)
+                  {
+                     return result;
+                  }
+               }
+            }
+         }
+      }
+   }
+  
+   ossim_uint32 inputs = getNumberOfInputs();
+   ossim_uint32 inputIdx = 0;
+   for(inputIdx = 0; inputIdx < inputs; ++inputIdx)
+   {
+      ossimConnectableObject* input = getInput(inputIdx);
+      if(input)
+      {
+         result = input->findInputObjectOfType(className);
+         if(result)
+         {
+            return result;
+         }
+      }
+   }
+   return result;
+}
+#endif /* drb */
+// End: Old findObject findInputObject code kept here until debugged to satisfaction.
+
+ossim_int32 ossimConnectableObject::findInputIndex(const ossimConnectableObject* object)
+{
+   ossim_int32 i = 0;
+   for(i = 0; i < (ossim_int32)theInputObjectList.size(); ++i)
+   {
+      if(theInputObjectList[i].get() == object)
+      {
+         return i;
+      }
+   }
+   
+   return -1;
+}
+
+ossim_int32 ossimConnectableObject::findInputIndex(const ossimId& id)
+{
+   ossim_int32 i = 0;
+   for(i = 0; i < (ossim_int32)theInputObjectList.size(); ++i)
+   {
+      if(theInputObjectList[i].valid() &&
+         (theInputObjectList[i]->getId() == id))
+      {
+         return i;
+      }
+   }
+   
+   return -1;
+}
+
+ossim_int32 ossimConnectableObject::findOutputIndex(const ossimConnectableObject* object)
+{
+   ossim_int32 i = 0;
+   for(i = 0; i < (ossim_int32)theOutputObjectList.size(); ++i)
+   {
+      if(theOutputObjectList[i] == object)
+      {
+         return i;
+      }
+   }
+   
+   return -1;
+}
+
+ossim_int32 ossimConnectableObject::findOutputIndex(const ossimId& id)
+{
+   ossim_int32 i = 0;
+   for(i = 0; i < (ossim_int32)theOutputObjectList.size(); ++i)
+   {
+      if(theOutputObjectList[i].valid() &&
+         (theOutputObjectList[i]->getId() == id))
+      {
+         return i;
+      }
+   }
+   
+   return -1;
+}
+
+ossim_int32 ossimConnectableObject::getMyInputIndexToConnectTo(ossimConnectableObject* object)const
+{
+   ConnectableObjectList::const_iterator current;
+   
+   ossim_int32 index = 0;
+   current = theInputObjectList.begin();
+   while(current != theInputObjectList.end())
+   {
+      if(!(*current))
+      {
+         if(canConnectMyInputTo(index, object))
+         {
+            return index;
+         }
+      }
+      ++current;
+      ++index;
+   }
+   if(!theInputListIsFixedFlag)
+   {
+      if(canConnectMyInputTo((ossim_int32)theInputObjectList.size(),
+                             object))
+      {
+         return (ossim_int32)theInputObjectList.size();
+      }
+   }
+   return -1;
+}
+
+ossim_int32 ossimConnectableObject::getMyOutputIndexToConnectTo(ossimConnectableObject* object)const
+{
+   ConnectableObjectList::const_iterator current;
+   
+   ossim_int32 index = 0;
+   current = theOutputObjectList.begin();
+   while(current != theOutputObjectList.end())
+   {
+      if(!(*current))
+      {
+         if(canConnectMyOutputTo(index, object))
+         {
+            return index;
+         }
+      }
+      ++current;
+      ++index;
+   }
+   if(!theOutputListIsFixedFlag)
+   {
+      if(canConnectMyOutputTo((ossim_int32)theOutputObjectList.size(),
+                              object))
+      {
+         return (ossim_int32)theOutputObjectList.size();
+      }
+   }
+   // default to return the size.  This will force an append.
+   //
+   return -1;
+}
+
+void ossimConnectableObject::disconnect(ossimConnectableObject* object)
+{
+   if( (object==this) || (object==0) )
+   {
+      disconnectAllInputs();
+      disconnectAllOutputs();
+   }
+   else
+   {
+      ossim_int32 index = findInputIndex(object);
+      if(index > -1)
+      {
+         disconnectMyInput(index);
+      }
+      index = findOutputIndex(object);
+      if(index > -1)
+      {
+         disconnectMyOutput(index, object);
+      }
+   }
+}
+
+void ossimConnectableObject::disconnect(const ossimId& id)
+{
+   if(id == theId)
+   {
+      disconnect(this);
+   }
+   else
+   {
+      ossimIdVisitor visitor( id,
+                              (ossimVisitor::VISIT_CHILDREN |
+                               ossimVisitor::VISIT_INPUTS   |
+                               ossimVisitor::VISIT_OUTPUTS) );
+      accept( visitor );
+      disconnect( visitor.getObject() );
+   }
+}
+
+ossimRefPtr<ossimConnectableObject> ossimConnectableObject::disconnectMyInput(ossim_int32 inputIndex,
+                                                                  bool disconnectOutputFlag,
+                                                                  bool createEventFlag)
+{
+   if(theInputObjectList.size() == 0)
+   {
+      return 0;
+   }
+   
+   ConnectableObjectList::iterator current;
+   ossimRefPtr<ossimConnectableObject> result = 0;
+   
+   if( (inputIndex > -1)&&
+      (inputIndex < (ossim_int32)theInputObjectList.size()))
+   {
+      current = (theInputObjectList.begin()+inputIndex);
+      result = (*current).get();
+      
+      if(!theInputListIsFixedFlag)
+      {
+         current = theInputObjectList.erase(current);
+      }
+      else
+      {
+         *current = 0;
+      }
+      if(createEventFlag&&result.valid())
+      {
+         ossimConnectionEvent event(this,  // owner of message
+                                    OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
+                                    0,  // new object
+                                    result.get(),// old object
+                                    ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+         
+         // send event to all listeners.
+         //
+         fireEvent(event);
+      }
+      
+      if(disconnectOutputFlag&&result.valid())
+      {
+         result->disconnectMyOutput(this, false, createEventFlag);
+      }
+   }
+   return result;
+}
+
+
+void ossimConnectableObject::disconnectMyInput(ossimConnectableObject* input,
+                                               bool disconnectOutputFlag,
+                                               bool createEventFlag)
+{
+   disconnectMyInput(findInputIndex(input),
+                     disconnectOutputFlag,
+                     createEventFlag);
+}
+
+void ossimConnectableObject::disconnectMyInputs(ConnectableObjectList& inputList,
+                                                bool disconnectOutputFlag,
+                                                bool createEventFlag)
+{
+   if(theInputObjectList.size() == 0) return;
+   ConnectableObjectList oldInputs;
+   ConnectableObjectList newInputs;
+   ossim_int32 i = 0;
+   
+   for(i = 0; i < (ossim_int32)inputList.size(); ++i)
+   {
+      if(findInputIndex(inputList[i].get()) >= 0)
+      {
+         disconnectMyInput(inputList[i].get(), disconnectOutputFlag, false);
+         oldInputs.push_back(inputList[i]);
+      }
+   }
+   if(createEventFlag && oldInputs.size())
+   {
+      ossimConnectionEvent event(this,
+                                 OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
+                                 newInputs,
+                                 oldInputs,
+                                 ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+      fireEvent(event);
+   }
+}
+
+ossimRefPtr<ossimConnectableObject> ossimConnectableObject::disconnectMyOutput(ossim_int32 outputIndex,
+                                                                   bool disconnectInputFlag,
+                                                                   bool createEvent)
+{
+   if(theOutputObjectList.size() == 0)
+   {
+      return 0;
+   }
+   
+   ConnectableObjectList::iterator current;
+   ossimRefPtr<ossimConnectableObject> result = 0;
+   if( (outputIndex > -1)&&
+      (outputIndex < (ossim_int32)theOutputObjectList.size()))
+   {
+      current = (theOutputObjectList.begin()+outputIndex);
+      result = (*current).get();
+      if(!theOutputListIsFixedFlag)
+      {
+         current = theOutputObjectList.erase(current);
+      }
+      else
+      {
+         *current = 0;
+      }
+      if(createEvent)
+      {
+         ossimConnectionEvent event(this,  // owner of message
+                                    OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
+                                    0,  // new object
+                                    result.get(),// old object
+                                    ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
+         
+         // send event to all listeners.
+         //
+         fireEvent(event);
+      }
+      
+      if(disconnectInputFlag&&result.valid())
+      {
+         result->disconnectMyInput(this, false, createEvent);
+      }
+   }
+   return result;
+}
+
+void ossimConnectableObject::disconnectMyOutput(ossimConnectableObject* output,
+                                                bool disconnectInputFlag,
+                                                bool createEventFlag)
+{
+   disconnectMyOutput(findOutputIndex(output), disconnectInputFlag, createEventFlag);
+}
+
+void ossimConnectableObject::disconnectMyOutputs(ConnectableObjectList& outputList,
+                                                 bool disconnectInputFlag,
+                                                 bool createEventFlag)
+{
+   if(theOutputObjectList.size() == 0) return;
+   
+   if(theOutputObjectList.size() == 1)
+   {
+      disconnectMyOutput((ossim_int32)0);
+      return;
+   }
+   ConnectableObjectList oldOutputs;
+   ConnectableObjectList newOutputs;
+   ossim_int32 i = 0;
+   for(i = 0; i < (ossim_int32)outputList.size(); ++i)
+   {
+      if(findOutputIndex(outputList[i].get()) >= 0)
+      {
+         disconnectMyOutput(outputList[i].get(), disconnectInputFlag, false);
+         oldOutputs.push_back(outputList[i]);
+      }
+   }
+   if(createEventFlag && oldOutputs.size())
+   {
+      ossimConnectionEvent event(this,
+                                 OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
+                                 newOutputs,
+                                 oldOutputs,
+                                 ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
+      fireEvent(event);
+   }
+}
+
+void ossimConnectableObject::disconnectAllInputs()
+{
+   if(theInputObjectList.size() == 0) return;
+   if(theInputObjectList.size() == 1)
+   {
+      //     ossimConnectableObject* obj = disconnectMyInput((ossim_int32)0, false);
+      disconnectMyInput((ossim_int32)0);
+      //     if(obj)
+      //     {
+      //        obj->disconnectMyOutput(this, false);
+      //     }
+      return;
+   }
+   ConnectableObjectList::iterator current;
+   ConnectableObjectList oldInputs = theInputObjectList;
+   ConnectableObjectList newInputs;
+   
+   
+   current = theInputObjectList.begin();
+   while(current != theInputObjectList.end())
+   {
+      if(!theInputListIsFixedFlag)
+      {
+         current = theInputObjectList.erase(current);
+      }
+      else
+      {
+         *current = 0;
+         ++current;
+      }
+   }
+   ossimConnectionEvent event(this,
+                              OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
+                              newInputs,
+                              oldInputs,
+                              ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+   fireEvent(event);
+   
+   for(ossim_uint32 index = 0; index < oldInputs.size(); ++index)
+   {
+      if(oldInputs[index].valid())
+      {
+         oldInputs[index]->disconnectMyOutput(this, false);
+      }
+   }
+}
+
+void ossimConnectableObject::disconnectAllOutputs()
+{
+   if(theOutputObjectList.size() == 0) return;
+   if(theOutputObjectList.size() == 1)
+   {
+      //     ossimConnectableObject* obj = disconnectMyOutput((ossim_int32)0, false);
+      // RP - another probably bad change to keep the multithread adapter from
+      // crashing on the destructor
+      disconnectMyOutput((ossim_int32)0, false, false);
+      //     if(obj)
+      //     {
+      //        obj->disconnectMyInput(this,
+      //                               false);
+      //     }
+      return;
+   }
+   ConnectableObjectList::iterator current;
+   
+   ConnectableObjectList oldOutputs = theOutputObjectList;
+   ConnectableObjectList newOutputs;
+   
+   current = theOutputObjectList.begin();
+   while(current != theOutputObjectList.end())
+   {
+      if(!theOutputListIsFixedFlag)
+      {
+         current = theOutputObjectList.erase(current);
+      }
+      else
+      {
+         *current = 0;
+         ++current;
+      }
+   }
+   ossimConnectionEvent event(this,
+                              OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
+                              newOutputs,
+                              oldOutputs,
+                              ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
+   fireEvent(event);
+   
+   for(ossim_uint32 index = 0; index < oldOutputs.size(); ++index)
+   {
+      if(oldOutputs[index].valid())
+      {
+         oldOutputs[index]->disconnectMyInput(this, false);
+      }
+   }
+}
+
+ossim_int32 ossimConnectableObject::connectMyInputTo(ossimConnectableObject* object,
+                                                     bool makeOutputConnection,
+                                                     bool createEventFlag)
+{
+   if(!object) return false;
+   
+   ossim_int32 index = findInputIndex(object);
+   if(index >= 0) return index;
+   
+   index = getMyInputIndexToConnectTo(object);
+   
+   if(index>-1)
+   {
+      if(index >= (ossim_int32)theInputObjectList.size())
+      {
+         if(theInputListIsFixedFlag) return -1;
+         
+         index = (ossim_int32)theInputObjectList.size();
+         theInputObjectList.push_back(object);
+      }
+      else
+      {
+         if(!theInputObjectList[index])
+         {
+            theInputObjectList[index] = object;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "Must issue a detach first!! trying to attach object " << object->getClassName()
+            << "\n to input index " << index << " in " << getClassName() << "\n";
+            
+            return -1;
+         }
+      }
+      if(createEventFlag)
+      {
+         ossimConnectionEvent event(this,  // owner of message
+                                    OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                    theInputObjectList[index].get(),  // new object
+                                    0,// old object
+                                    ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+         // send event to any listener.
+         //
+         fireEvent(event);
+      }
+      
+      if(makeOutputConnection&&object)
+      {
+         // make sure we tell the input not to connect
+         // back to us or infinite loop
+         //
+         object->connectMyOutputTo(this, false, createEventFlag);
+      }
+   }
+   else
+   {
+      return index;
+   }
+   
+   return index;
+}
+
+ossim_int32 ossimConnectableObject::connectMyInputTo(ossim_int32 inputIndex,
+                                                     ossimConnectableObject* inputObject,
+                                                     bool makeOutputConnection,
+                                                     bool createEventFlag)
+{
+   if(!inputObject)
+   {
+      if(inputIndex < (ossim_int32)theInputObjectList.size())
+      {
+         ossimConnectableObject* oldObject = theInputObjectList[inputIndex].get();
+         if(theInputListIsFixedFlag)
+         {
+            theInputObjectList[inputIndex] = 0;
+         }
+         else
+         {
+            theInputObjectList.erase(theInputObjectList.begin() + inputIndex);
+         }
+         if(createEventFlag)
+         {
+            ossimConnectionEvent event(this,  // owner of message
+                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                       0,  // new object
+                                       oldObject,// old object
+                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+            // send event to any listener.
+            //
+            fireEvent(event);
+         }
+         return -1;
+      }
+      return -1;
+   }
+   
+   ossim_int32 index = findInputIndex(inputObject);
+   
+   if((index >= 0)&&!inputObject) return index;
+   if(!inputObject) return -1;
+   
+   if(canConnectMyInputTo(inputIndex, inputObject))
+   {
+      if(inputIndex>-1)
+      {
+         ossimConnectableObject* oldObject=0;
+         if(inputIndex >= (ossim_int32)theInputObjectList.size())
+         {
+            if(theInputListIsFixedFlag) return -1;
+            
+            inputIndex = (ossim_int32)theInputObjectList.size();
+            theInputObjectList.push_back(inputObject);
+         }
+         else
+         {
+            oldObject = theInputObjectList[inputIndex].get();
+            theInputObjectList[inputIndex] = inputObject;
+            if(oldObject)
+            {
+               oldObject->disconnectMyOutput(this, false);
+            }
+         }
+         
+         if(createEventFlag)
+         {
+            ossimConnectionEvent event(this,  // owner of message
+                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                       theInputObjectList[inputIndex].get(),  // new object
+                                       oldObject,// old object
+                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+            // send event to any listener.
+            //
+            fireEvent(event);
+         }
+         
+         if(makeOutputConnection&&inputObject)
+         {
+            // make sure we tell the input not to connect
+            // back to us or infinite loop
+            //
+            inputObject->connectMyOutputTo(this, false, createEventFlag);
+         }
+      }
+      else
+      {
+         return inputIndex;
+      }
+      
+      return inputIndex;
+   }
+   
+   return -1;
+}
+
+bool ossimConnectableObject::connectMyInputTo(ConnectableObjectList& inputList,
+                                              bool makeOutputConnection,
+                                              bool createEventFlag)
+{
+   bool result = true;
+   ConnectableObjectList oldInputs;
+   ConnectableObjectList newInputs;
+   
+   if(inputList.size() == 1)
+   {
+      if(inputList[0].valid())
+      {
+         return (connectMyInputTo(inputList[0].get(), makeOutputConnection, createEventFlag) >= 0);
+      }
+      else
+      {
+         if(theInputListIsFixedFlag)
+         {
+            theInputObjectList[0] = 0;
+         }
+         else
+         {
+            theInputObjectList.clear();
+         }
+         if(createEventFlag)
+         {
+            ossimConnectionEvent event(this,
+                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                       0,
+                                       theInputObjectList[0].get(),
+                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+            fireEvent(event);
+         }
+         
+         return true;
+      }
+   }
+   ossim_int32 i = 0;
+   for(i = 0; i < (ossim_int32)inputList.size(); ++i)
+   {
+      if(inputList[i].valid())
+      {
+         if(connectMyInputTo(inputList[i].get(), makeOutputConnection, false)<0)
+         {
+            result = false;
+         }
+         else
+         {
+            newInputs.push_back(inputList[i]);
+         }
+      }
+      else
+      {
+         newInputs.push_back(0);
+      }
+   }
+   if(createEventFlag)
+   {
+      ossimConnectionEvent event(this,
+                                 OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                 newInputs,
+                                 oldInputs,
+                                 ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+      fireEvent(event);
+   }
+   return result;
+}
+
+ossim_int32 ossimConnectableObject::connectMyOutputTo(ossimConnectableObject* output,
+                                                      bool makeInputConnection,
+                                                      bool createEventFlag)
+{
+   ossim_int32 index = findOutputIndex(output);
+   if(index >= 0) return index;
+   
+   index = getMyOutputIndexToConnectTo(output);
+   
+   if(index > -1)
+   {
+      if((index >= (ossim_int32)theOutputObjectList.size())&&
+         !theOutputListIsFixedFlag)
+      {
+         index = (ossim_int32)theOutputObjectList.size();
+         theOutputObjectList.push_back(output);
+      }
+      else
+      {
+         if(!theOutputObjectList[index])
+         {
+            theOutputObjectList[index] = output;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "Must issue a disconnect first!! trying to connect object " << output->getClassName()
+            << "\n to output index " << index << " in " << getClassName() << "\n";
+            
+            return -1;
+         }
+      }
+      if(createEventFlag)
+      {
+         ossimConnectionEvent event(this,  // owner of message
+                                    OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                    theOutputObjectList[index].get(),  // new object
+                                    0,// old object
+                                    ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
+         // send event to any listener.
+         //
+         fireEvent(event);
+      }
+      if(makeInputConnection&&output)
+      {
+         // tell the output object not to connect back
+         // to us since this is already done.
+         //
+         output->connectMyInputTo(this, false, createEventFlag);
+      }
+   }
+   else
+   {
+      return index;
+   }
+   
+   return index;
+}
+
+bool ossimConnectableObject::connectMyOutputTo(ConnectableObjectList& outputList,
+                                               bool makeInputConnection,
+                                               bool createEventFlag)
+{
+   bool result = true;
+   ConnectableObjectList oldOutputs;
+   ConnectableObjectList newOutputs;
+   
+   if(outputList.size() == 0)
+   {
+      disconnectAllOutputs();
+      return true;
+   }
+   if((outputList.size() == 1)&&outputList[0].valid())
+   {
+      if(outputList[0].valid())
+      {
+         return (connectMyOutputTo(outputList[0].get(), makeInputConnection, createEventFlag) >= 0);
+      }
+      else
+      {
+         disconnectAllOutputs();
+      }
+   }
+   
+   ossim_int32 i = 0;
+   for(i = 0; i < (ossim_int32)outputList.size(); ++i)
+   {
+      if((connectMyOutputTo(outputList[i].get(), makeInputConnection, false)<0)&&outputList[i].valid())
+      {
+         newOutputs.push_back(outputList[i].get());
+         result = false;
+      }
+   }
+   if(createEventFlag&&newOutputs.size())
+   {
+      ossimConnectionEvent event(this,
+                                 OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                 newOutputs,
+                                 oldOutputs,
+                                 ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
+      fireEvent(event);
+   }
+   
+   return result;
+}
+
+ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 idx)
+{
+   if(idx < theInputObjectList.size())
+   {
+      return theInputObjectList[idx].get();
+   }
+   
+   return 0;
+}
+
+const ossimConnectableObject* ossimConnectableObject::getInput(ossim_uint32 idx)const
+{
+   if( idx < theInputObjectList.size())
+   {
+      return theInputObjectList[idx].get();
+   }
+   
+   return 0;
+}
+
+ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 idx)
+{
+   if(idx < theOutputObjectList.size())
+   {
+      return theOutputObjectList[idx].get();
+   }
+   
+   return 0;
+}
+
+bool ossimConnectableObject::connectInputList(ConnectableObjectList& inputList)
+{
+   bool result = true;
+   ossim_uint32 i = 0;
+   ConnectableObjectList oldInputs = theInputObjectList;
+   ConnectableObjectList newInputs;
+   ConnectableObjectList::iterator currentInput = inputList.begin();
+   ConnectableObjectList tempOld;
+   if(theInputObjectList.size())
+   {
+      for(i = 0; i < theInputObjectList.size(); ++i)
+      {
+         if(oldInputs[i].valid())
+         {
+            tempOld.push_back(oldInputs[i].get());
+         }
+         theInputObjectList[i] = 0;
+      }
+   }
+   if(theInputListIsFixedFlag && (theInputObjectList.size()==0))
+   {
+      return false;
+   }
+   
+   if(!theInputListIsFixedFlag)
+   {
+      theInputObjectList.clear();
+   }
+   if(tempOld.size())
+   {
+      for(i = 0; i < tempOld.size(); ++ i)
+      {
+         tempOld[i]->disconnectMyOutput(this, false);
+      }
+   }
+   //   disconnectAllInputs();
+   
+   if(inputList.size() == 1)
+   {
+      return (connectMyInputTo(inputList[0].get())>=0);
+   }
+   i = 0;
+   // now connect the new outputs
+   //
+   currentInput = inputList.begin();
+   result = false;
+   
+   while(currentInput != inputList.end())
+   {
+      if((*currentInput).valid())
+      {
+         if(connectMyInputTo((*currentInput).get(), false) >= 0)
+         {
+            newInputs.push_back((*currentInput).get());
+            result = true;
+         }
+      }
+      ++currentInput;
+   }
+   ossimConnectionEvent event(this,
+                              OSSIM_EVENT_CONNECTION_DISCONNECT_ID,
+                              newInputs,
+                              oldInputs,
+                              ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+   
+   if(theInputObjectList.size())
+   {
+      fireEvent(event);
+   }
+   
+   newInputs          = theInputObjectList;
+   
+   
+   
+   event = ossimConnectionEvent(this,
+                                OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                newInputs,
+                                oldInputs,
+                                ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+   fireEvent(event);
+   
+   return result;
+}
+
+bool ossimConnectableObject::connectOutputList(ConnectableObjectList& outputList)
+{
+   bool result = true;
+   ossim_int32 index  = 0;
+   ConnectableObjectList oldOutputs = theOutputObjectList;
+   ConnectableObjectList newOutputs;
+   ConnectableObjectList::const_iterator currentOutput = outputList.begin();
+   
+   disconnectAllOutputs();
+   
+   if(outputList.size() == 1)
+   {
+      return (connectMyOutputTo(outputList[0].get())>=0);
+   }
+   while(currentOutput != outputList.end())
+   {
+      if(!canConnectMyOutputTo(index, (*currentOutput).get()))
+      {
+         result = false;
+      }
+      ++currentOutput;
+   }
+   
+   if(!result)
+   {
+      return false;
+   }
+   
+   theOutputObjectList = outputList;
+   newOutputs = theOutputObjectList;
+   
+   ossimConnectionEvent event(this,
+                              OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                              newOutputs,
+                              oldOutputs,
+                              ossimConnectionEvent::OSSIM_OUTPUT_DIRECTION);
+   fireEvent(event);
+   
+   return result;
+}
+
+void ossimConnectableObject::setNumberOfInputs(ossim_int32 numberOfInputs)
+{
+   if((ossim_int32)theInputObjectList.size() == numberOfInputs)
+   {
+      return;
+   }
+   ossim_int32 i = 0;
+   if(numberOfInputs < (ossim_int32)theInputObjectList.size())
+   {
+      ConnectableObjectList v(theInputObjectList.begin(),
+                              theInputObjectList.begin()+numberOfInputs);
+      ConnectableObjectList disconnectList;
+      
+      for(i = numberOfInputs;
+          i < (ossim_int32)theInputObjectList.size();
+          ++i)
+      {
+         if(theInputObjectList[i].valid())
+         {
+            disconnectList.push_back(theInputObjectList[i]);
+         }
+      }
+      disconnectMyInputs(disconnectList);
+      
+      theInputObjectList.clear();
+      theInputObjectList = v;
+   }
+   else
+   {
+      for(i = (ossim_int32)theInputObjectList.size();
+          i < numberOfInputs;
+          ++i)
+      {
+         theInputObjectList.push_back(0);
+      }
+   }
+}
+
+void ossimConnectableObject::setNumberOfOutputs(ossim_int32 numberOfOutputs)
+{
+   if((ossim_int32)theOutputObjectList.size() == numberOfOutputs)
+   {
+      return;
+   }
+   ossim_int32 i = 0;
+   if(numberOfOutputs < (ossim_int32)theOutputObjectList.size())
+   {
+      ConnectableObjectList v(theOutputObjectList.begin(),
+                              theOutputObjectList.begin()+numberOfOutputs);
+      ConnectableObjectList disconnectList;
+      for(i = numberOfOutputs;
+          i < (ossim_int32)theOutputObjectList.size();
+          ++i)
+      {
+         if(theOutputObjectList[i].valid())
+         {
+            disconnectList.push_back(theOutputObjectList[i]);
+         }
+      }
+      disconnectMyOutputs(disconnectList);
+      
+      theOutputObjectList.clear();
+      theOutputObjectList = v;
+   }
+   else
+   {
+      for(i = (ossim_int32)theOutputObjectList.size();
+          i < numberOfOutputs;
+          ++i)
+      {
+         theOutputObjectList.push_back(0);
+      }
+   }
+}
+
+
+const ossimConnectableObject* ossimConnectableObject::getOutput(ossim_uint32 idx)const
+{
+   if(idx < theOutputObjectList.size())
+   {
+      return theOutputObjectList[idx].get();
+   }
+   
+   return 0;
+}
+
+void  ossimConnectableObject::findAllObjectsOfType(ConnectableObjectList& result,
+                                                   const RTTItypeid& typeInfo,
+                                                   bool recurse)
+{
+   int j;
+   // go through children first
+   //
+   ossimConnectableContainerInterface* inter =
+      dynamic_cast<ossimConnectableContainerInterface*>(this);
+   if(inter)
+   {
+      ConnectableObjectList tempList = inter->findAllObjectsOfType(typeInfo,
+                                                                   recurse);
+      
+      for(j = 0; j < (int)tempList.size(); ++j)
+      {
+         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
+         if(iter == result.end())
+         {
+            result.push_back(tempList[j].get());
+         }
+      }
+   }
+   
+}
+
+void ossimConnectableObject::findAllObjectsOfType(ConnectableObjectList& result, 
+                                                  const ossimString& className,
+                                                  bool recurse)
+{
+   int j;
+   // go through children first
+   //
+   ossimConnectableContainerInterface* inter =
+      dynamic_cast<ossimConnectableContainerInterface*>(this);
+   if(inter)
+   {
+      ConnectableObjectList tempList = inter->findAllObjectsOfType(className,
+                                                                   recurse);
+      
+      for(j = 0; j < (int)tempList.size(); ++j)
+      {
+         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
+         if(iter == result.end())
+         {
+            result.push_back(tempList[j].get());
+         }
+      }
+   }
+}
+
+#if 0
+void ossimConnectableObject::findAllInputsOfType(ConnectableObjectList& result,
+                                                 const RTTItypeid& typeInfo,
+                                                 bool propagateToInputs,
+                                                 bool recurseChildren)
+{
+   int i;
+   int j;
+   // go through children first
+   //
+   ossimConnectableContainerInterface* inter =
+      dynamic_cast<ossimConnectableContainerInterface*>(this);
+   if(inter&&recurseChildren)
+   {
+      ConnectableObjectList tempList = inter->findAllObjectsOfType(typeInfo,
+                                                                   true);
+      
+      for(j = 0; j < (int)tempList.size(); ++j)
+      {
+         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
+         if(iter == result.end())
+         {
+            result.push_back(tempList[j].get());
+         }
+      }
+   }
+   
+   for(i = 0; i < (int)getNumberOfInputs(); ++i)
+   {
+      ossimConnectableObject* current = getInput(i);
+      if(current&&(current->canCastTo(typeInfo)))
+      {
+         ConnectableObjectList::iterator position = std::find(result.begin(), result.end(), current);
+         
+         if(position == result.end())
+         {
+            result.push_back(current);
+         }
+      }
+      inter = dynamic_cast<ossimConnectableContainerInterface*>(current);
+      if(inter)
+      {
+         ConnectableObjectList tempList = inter->findAllObjectsOfType(typeInfo, true);
+         for(j = 0; j < (int)tempList.size(); ++j)
+         {
+            ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
+            if(iter == result.end())
+            {
+               result.push_back(tempList[j]);
+            }
+         }
+      }
+      
+      if(propagateToInputs&&current)
+      {
+         current->findAllInputsOfType(result,
+                                      typeInfo,
+                                      true,
+                                      recurseChildren);
+      }
+   }
+}
+
+void ossimConnectableObject::findAllInputsOfType(ConnectableObjectList& result,
+                                                 const ossimString& className,
+                                                 bool propagateToInputs,
+                                                 bool recurseChildren)
+{
+   int j;
+   // go through children first
+   //
+   ossimConnectableContainerInterface* inter =
+      dynamic_cast<ossimConnectableContainerInterface*>(this);
+   if(inter&&recurseChildren)
+   {
+      ConnectableObjectList tempList = inter->findAllObjectsOfType(className,
+                                                                   true);
+      
+      for(j = 0; j < (int)tempList.size(); ++j)
+      {
+         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
+         if(iter == result.end())
+         {
+            result.push_back(tempList[j]);
+         }
+      }
+   }
+   for(ossim_uint32 i = 0; i < getNumberOfInputs(); ++i)
+   {
+      ossimConnectableObject* current = getInput(i);
+      if(current&&(current->canCastTo(className)))
+      {
+         ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), current);
+         if(iter == result.end())
+         {
+            result.push_back(current);
+         }
+      }
+      ossimConnectableContainerInterface* inter =
+         dynamic_cast<ossimConnectableContainerInterface*>(current);
+      if(inter)
+      {
+         ConnectableObjectList tempList = inter->findAllObjectsOfType(className, true);
+         for(j = 0; j < (int)tempList.size(); ++j)
+         {
+            ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), tempList[j]);
+            if(iter == result.end())
+            {
+               result.push_back(tempList[j]);
+            }
+         }
+      }
+      
+      if(propagateToInputs&&current)
+      {
+         current->findAllInputsOfType(result,
+                                      className,
+                                      true,
+                                      recurseChildren);
+      }
+   }
+}
+#endif
+
+void ossimConnectableObject::propagateEventToOutputs(ossimEvent& event)
+{
+   ossim_uint32 i;
+   
+   for(i = 0; i <getNumberOfOutputs(); ++i)
+   {
+      ossimConnectableObject* obj = getOutput(i);
+      if(obj)
+      {
+         event.setPropagationType(ossimEvent::PROPAGATION_OUTPUT);
+         obj->fireEvent(event);
+         obj->propagateEventToOutputs(event);
+      }
+   }
+}
+
+void ossimConnectableObject::propagateEventToInputs(ossimEvent& event)
+{
+   ossim_uint32 i;
+   
+   for(i = 0; i <getNumberOfInputs(); ++i)
+   {
+      ossimConnectableObject* obj = getInput(i);
+      if(obj)
+      {
+         obj->fireEvent(event);
+         obj->propagateEventToInputs(event);
+      }
+   }
+}
+
+void ossimConnectableObject::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid()) return;
+   if(property->getName() == "Description")
+   {
+      property->valueToString(theDescription);
+   }
+}
+
+void ossimConnectableObject::setProperty(const ossimString& name, const ossimString& value)
+{
+   ossimPropertyInterface::setProperty(name, value);
+}
+
+ossimRefPtr<ossimProperty> ossimConnectableObject::getProperty(const ossimString& name)const
+{
+   if(name == "Description")
+   {
+      return new ossimTextProperty(name, theDescription);
+   }
+   // "Class name" check for backwards compatibility only.
+   else if( (name == "class_name") ||
+           (name == "Class name") ) 
+   {
+      ossimProperty* prop = new ossimTextProperty(name,
+                                                  getClassName());
+      prop->setReadOnlyFlag(true);
+      
+      return prop;
+   }
+   return ossimRefPtr<ossimProperty>();
+}
+
+void ossimConnectableObject::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back("class_name");
+   propertyNames.push_back("Description");
+}
+
+bool ossimConnectableObject::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   const char* lookup = kwl.find(prefix,
+                                 ossimKeywordNames::ID_KW);
+   
+   // disconnect(this);
+   
+   if(lookup)
+   {
+      theId = ossimId(ossimString(lookup).toLong());
+   }
+   
+   lookup = kwl.find(prefix, CONNECTABLE_INPUT_LIST_FIXED_KW);
+   if(lookup)
+   {
+      theInputListIsFixedFlag = ossimString(lookup).toBool();
+   }
+   
+   lookup = kwl.find(prefix, CONNECTABLE_OUTPUT_LIST_FIXED_KW);
+   if(lookup)
+   {
+      theOutputListIsFixedFlag = ossimString(lookup).toBool();
+   }
+   
+   ossim_int32 numberInputs  = 0;
+   ossim_int32 numberOutputs = 0;
+   
+   ossimString regExpression;
+   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_INPUTS_KW);
+   if(lookup)
+   {
+      numberInputs = ossimString(lookup).toLong();
+   }
+   else if(!theInputListIsFixedFlag)
+   {
+      regExpression = ossimString("^(") + ossimString(prefix) + "input_connection[0-9]+)";
+      numberInputs = kwl.getNumberOfSubstringKeys(regExpression);
+   }
+   else
+   {
+      // if we are fixed then the list should already be set
+      numberInputs = (ossim_int32) theInputObjectList.size();
+   }
+
+   
+   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_OUTPUTS_KW);
+   if(lookup)
+   {
+      numberOutputs = ossimString(lookup).toLong();
+   }
+   else if(!theOutputListIsFixedFlag)
+   {
+      regExpression = ossimString("^(") + ossimString(prefix) + "output_connection[0-9]+)";
+      numberOutputs = kwl.getNumberOfSubstringKeys(regExpression);
+   }
+   else 
+   {
+      // if we are fixed then the list should already be set
+      numberOutputs = (ossim_int32) theOutputObjectList.size();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::DESCRIPTION_KW);
+   if (lookup)
+   {
+      theDescription = lookup;
+   }
+   
+   setNumberOfInputs(numberInputs);
+   setNumberOfOutputs(numberOutputs);
+   
+   return ossimObject::loadState(kwl, prefix);
+}
+
+bool ossimConnectableObject::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix)const
+{
+   ossimObject::saveState(kwl, prefix);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::ID_KW,
+           theId.getId(),
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::DESCRIPTION_KW,
+           theDescription,
+           true);
+   
+   kwl.add(prefix,
+           CONNECTABLE_INPUT_LIST_FIXED_KW,
+           theInputListIsFixedFlag,
+           true);
+   
+   kwl.add(prefix,
+           CONNECTABLE_OUTPUT_LIST_FIXED_KW,
+           theOutputListIsFixedFlag,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_INPUTS_KW,
+           static_cast<ossim_uint32>(theInputObjectList.size()),
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_OUTPUTS_KW,
+           static_cast<ossim_uint32>(theOutputObjectList.size()),
+           true);
+   
+   ossim_int32 i = 0;
+   for(i = 1; i <= (ossim_int32)theInputObjectList.size(); ++i)
+   {
+      ossimString value = "input_connection" + ossimString::toString(i);
+      
+      ossim_int32 id;
+      
+      if(theInputObjectList[i-1].valid())
+      {
+         id = theInputObjectList[i-1]->getId().getId();
+      }
+      else
+      {
+         id = -1;
+      }
+      kwl.add(prefix,
+              value.c_str(),
+              id,
+              true);
+   }
+   
+   for(i = 1; i <= (ossim_int32)theOutputObjectList.size(); ++i)
+   {
+      ossimString value = "output_connection" + ossimString::toString(i);
+      
+      ossim_int32 id;
+      
+      if(theOutputObjectList[i-1].valid())
+      {
+         id = theOutputObjectList[i-1]->getId().getId();
+      }
+      else
+      {
+         id = -1;
+      }
+      kwl.add(prefix,
+              value.c_str(),
+              id,
+              true);
+   }
+   
+   return true;
+}
+
+ossim_uint32 ossimConnectableObject::saveStateOfAllInputs(ossimKeywordlist& kwl,
+                                                          bool              saveThisStateFlag,
+                                                          ossim_uint32      objectIndex,
+                                                          const char*       prefix) const
+{
+   ossim_uint32 index = objectIndex;
+
+   const ossim_uint32 NUMBER_OF_INPUTS = getNumberOfInputs();
+   if (NUMBER_OF_INPUTS)
+   {
+      // Save all the inputs.
+      for(ossim_uint32 i = 0; i < NUMBER_OF_INPUTS; ++i)
+      {
+         const ossimConnectableObject* input = getInput(i);
+         if(input)
+            index = input->saveStateOfAllInputs(kwl, true, index, prefix);
+      }
+   }
+
+   if (saveThisStateFlag)
+   {
+      ossimString myPrefix;
+      if (prefix)
+         myPrefix = prefix;
+
+      myPrefix += "object" + ossimString::toString(index) + ".";
+
+      // Save the state of this object.
+      saveState(kwl, myPrefix.c_str());
+      ++index;
+   }
+
+   return index;
+}
+
+bool ossimConnectableObject::fillContainer(ossimConnectableContainer& container)
+{
+   // Insert inputs into the container:
+   bool good_fill = true;
+   ossim_uint32 num_inputs = getNumberOfInputs();
+   for(ossim_uint32 i=0; (i<num_inputs) && good_fill; ++i)
+   {
+      ossimConnectableObject* input = getInput(i);
+      if (input)
+         good_fill = input->fillContainer(container);
+   }
+   
+   // Insert this object and all of its children and inputs into the container provided:
+   if (good_fill)
+      good_fill = container.addChild(this);
+
+   return good_fill;
+}
+
+bool ossimConnectableObject::canConnectMyOutputTo(ossim_int32 myOutputIndex,
+                                                  const ossimConnectableObject* /* object */ ) const
+{
+   if(theOutputListIsFixedFlag)
+   {
+      return ((myOutputIndex >= 0) &&
+              (myOutputIndex < (ossim_int32)theOutputObjectList.size()));
+   }
+   
+   return ((myOutputIndex >= 0) &&
+           (myOutputIndex  <= (ossim_int32)theOutputObjectList.size()));
+}
+
+bool ossimConnectableObject::moveInputUp(const ossimId& id)
+{
+   bool result = false;
+   
+   if (theInputListIsFixedFlag == false)
+   {
+      if ( theInputObjectList.size() )
+      {
+         ossim_int32 indexOfId = findInputIndex(id);
+         
+         if (indexOfId > 0)
+         {
+            ConnectableObjectList oldInputs =
+            theInputObjectList;
+            
+            // Swap with index above.
+            ossimRefPtr<ossimConnectableObject> tmpObj  = theInputObjectList[indexOfId].get();
+            theInputObjectList[indexOfId]   = theInputObjectList[indexOfId-1].get();
+            theInputObjectList[indexOfId-1] = tmpObj;
+            result = true;
+            
+            ConnectableObjectList newInputs =
+            theInputObjectList;
+            
+            ossimConnectionEvent event(this,
+                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                       newInputs,
+                                       oldInputs,
+                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+            fireEvent(event);
+         }
+      }
+   }
+   
+   return result;
+}
+
+bool ossimConnectableObject::moveInputDown(const ossimId& id)
+{
+   bool result = false;
+   
+   if (theInputListIsFixedFlag == false)
+   {
+      if ( theInputObjectList.size() )
+      {
+         ossim_int32 indexOfId = findInputIndex(id);
+         
+         if ( indexOfId <
+             static_cast<ossim_int32>(theInputObjectList.size()-1) )
+         {
+            ConnectableObjectList oldInputs =
+            theInputObjectList;
+            
+            // Swap with index below.
+            ossimRefPtr<ossimConnectableObject> tmpObj  = theInputObjectList[indexOfId].get();
+            theInputObjectList[indexOfId]   = theInputObjectList[indexOfId+1].get();
+            theInputObjectList[indexOfId+1] = tmpObj;
+            result = true;
+            
+            ConnectableObjectList newInputs =
+            theInputObjectList;
+            
+            ossimConnectionEvent event(this,
+                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                       newInputs,
+                                       oldInputs,
+                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+            fireEvent(event);
+         }
+      }
+   }
+   
+   return result;
+}
+
+bool ossimConnectableObject::moveInputToTop(const ossimId& id)
+{
+   bool result = false;
+   
+   if (theInputListIsFixedFlag == false)
+   {
+      if ( theInputObjectList.size() )
+      {
+         ConnectableObjectList::iterator i =
+         theInputObjectList.begin();
+         
+         while (i != theInputObjectList.end())
+         {
+            if ( (*i)->getId() == id )
+            {
+               break;
+            }
+            ++i;
+         }
+         
+         if ( (i != theInputObjectList.begin()) &&
+             (i != theInputObjectList.end()) )
+         {
+            ConnectableObjectList oldInputs =
+            theInputObjectList;
+            
+            ossimRefPtr<ossimConnectableObject> obj = (*i).get();               
+            theInputObjectList.erase(i);
+            theInputObjectList.insert(theInputObjectList.begin(), obj.get());
+            result = true;
+            
+            ConnectableObjectList newInputs =
+            theInputObjectList;
+            
+            ossimConnectionEvent event(
+                                       this,
+                                       OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                       newInputs,
+                                       oldInputs,
+                                       ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+            fireEvent(event);
+         }
+      }
+   }
+   
+   return result;
+}
+
+bool ossimConnectableObject::moveInputToBottom(const ossimId& id)
+{
+   bool result = false;
+   
+   if (theInputListIsFixedFlag == false)
+   {
+      if ( theInputObjectList.size() )
+      {
+         ConnectableObjectList::iterator bottom =
+         theInputObjectList.end()-1;
+         
+         // if not bottom already
+         if ( (*bottom)->getId() != id ) 
+         {
+            ConnectableObjectList::iterator i =
+            theInputObjectList.begin();
+            
+            while (i != bottom)
+            {
+               if ( (*i)->getId() == id )
+               {
+                  break;
+               }
+               ++i;
+            }
+            
+            if (i != bottom)
+            {
+               ConnectableObjectList oldInputs =
+               theInputObjectList;
+               
+               ossimRefPtr<ossimConnectableObject> obj = (*i).get();
+               theInputObjectList.erase(i);
+               theInputObjectList.push_back(obj);
+               result = true;
+               
+               ConnectableObjectList newInputs =
+               theInputObjectList;
+               
+               ossimConnectionEvent event(
+                                          this,
+                                          OSSIM_EVENT_CONNECTION_CONNECT_ID,
+                                          newInputs,
+                                          oldInputs,
+                                          ossimConnectionEvent::OSSIM_INPUT_DIRECTION);
+               fireEvent(event);
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimConnectableObject::accept(ossimVisitor& visitor)
+{
+   if(!visitor.stopTraversal())
+   {
+      if(!visitor.hasVisited(this))
+      {
+         visitor.visit(this);
+      }
+      
+      if(!visitor.stopTraversal())
+      {
+         
+         if(visitor.getVisitorType() & ossimVisitor::VISIT_INPUTS)
+         {
+            ConnectableObjectList::iterator current = theInputObjectList.begin();
+            while(current != theInputObjectList.end())
+            {
+               if((*current).get()&&!visitor.hasVisited((*current).get())) (*current)->accept(visitor);
+               ++current;
+            }
+         }
+         
+         if(visitor.getVisitorType() & ossimVisitor::VISIT_OUTPUTS)
+         {
+            // go through the outputs
+            ConnectableObjectList::iterator current = theOutputObjectList.begin();
+            while(current != theOutputObjectList.end())
+            {
+               if((*current).get()&&!visitor.hasVisited((*current).get())) (*current)->accept(visitor);
+               ++current;
+            }
+            ossimConnectableObject* obj = dynamic_cast<ossimConnectableObject*>(theOwner);
+            
+            if((!getNumberOfOutputs()||!isConnected(CONNECTABLE_DIRECTION_OUTPUT))&&obj)
+            {
+               ossimVisitor::VisitorType currentType = visitor.getVisitorType();
+               // lets make sure inputs and outputs are turned off for we are traversing all children and we should not have
+               // to have that enabled
+               //
+               visitor.turnOffVisitorType(ossimVisitor::VISIT_INPUTS);// |ossimVisitor::VISIT_CHILDREN);
+               
+               //obj->accept(visitor);
+               visitor.setVisitorType(currentType);
+              // visitor.turnOffVisitorType(ossimVisitor::VISIT_INPUTS);
+               // now go through outputs
+               //
+               ConnectableObjectList::iterator current = obj->theOutputObjectList.begin();
+               while(current != obj->theOutputObjectList.end())
+               {
+                  if((*current).get()&&!visitor.hasVisited((*current).get())) (*current)->accept(visitor);
+                  ++current;
+               }
+               
+               visitor.setVisitorType(currentType);
+               
+            }
+         } 
+      }  
+   }
+}
+
+void ossimConnectableObject::setId(const ossimId& id)
+{
+   theId = id;
+}
+
+const ossimId& ossimConnectableObject::getId()const
+{
+   return theId;
+}
+
+const ossimObject* ossimConnectableObject::getOwner() const
+{
+   return theOwner;
+}
+
+ossim_uint32 ossimConnectableObject::getNumberOfInputs()const
+{
+   return (ossim_uint32)theInputObjectList.size();
+}
+
+ossim_uint32 ossimConnectableObject::getNumberOfOutputs()const
+{
+   return (ossim_uint32)theOutputObjectList.size();
+}
+
+bool ossimConnectableObject::getInputListIsFixedFlag()const
+{
+   return theInputListIsFixedFlag;
+}
+
+bool ossimConnectableObject::getOutputListIsFixedFlag()const
+{
+   return theOutputListIsFixedFlag;
+}
+
+const ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getInputList()const
+{
+   return theInputObjectList;
+}
+
+const ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getOutputList()const
+{
+   return theOutputObjectList;
+}
+
+ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getInputList()
+{
+   return theInputObjectList;
+}
+
+ossimConnectableObject::ConnectableObjectList& ossimConnectableObject::getOutputList()
+{
+   return theOutputObjectList;
+}
diff --git a/src/base/ossimConnectableObjectListener.cpp b/src/base/ossimConnectableObjectListener.cpp
new file mode 100644
index 0000000..4c213e9
--- /dev/null
+++ b/src/base/ossimConnectableObjectListener.cpp
@@ -0,0 +1,112 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimConnectableObjectListener.cpp 19961 2011-08-16 18:10:36Z gpotts $
+
+#include <ossim/base/ossimConnectableObjectListener.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimObjectEvents.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+RTTI_DEF1(ossimConnectableObjectListener,
+          "ossimConnectableObjectListener",
+          ossimListener);
+
+void ossimConnectableObjectListener::processEvent(ossimEvent& event)
+{
+   switch(event.getId())
+   {
+      case OSSIM_EVENT_OBJECT_DESTRUCTING_ID:
+      {
+         ossimObjectDestructingEvent* eventCast = dynamic_cast<ossimObjectDestructingEvent*>(&event);
+         if(eventCast) objectDestructingEvent(*eventCast);
+         
+         break;
+      }
+      case OSSIM_EVENT_CONNECTION_CONNECT_ID:
+      case OSSIM_EVENT_CONNECTION_DISCONNECT_ID:
+      {
+         ossimConnectionEvent* eventCast = dynamic_cast<ossimConnectionEvent*>(&event);
+         
+         if(eventCast)
+         {
+            connectionEvent(*eventCast);
+         
+            if(event.getId() == OSSIM_EVENT_CONNECTION_DISCONNECT_ID)
+            {
+               if(eventCast->isInputDirection())
+               {
+                  disconnectInputEvent(*eventCast);
+               }
+               else if(eventCast->isOutputDirection())
+               {
+                  disconnectOutputEvent(*eventCast);
+               }
+               else
+               {
+                  ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
+               }
+            }
+            else
+            {
+               if(eventCast->isInputDirection())
+               {
+                  connectInputEvent(*eventCast);
+               }
+               else if(eventCast->isOutputDirection())
+               {
+                  connectOutputEvent(*eventCast);
+               }
+               else
+               {
+                  ossimNotify(ossimNotifyLevel_WARN) << "ossimConnectableObjectListener::processEvent, Direction not set\n";
+               }
+            }
+         }
+         break;
+      }
+      case OSSIM_EVENT_PROPERTY_ID:
+      {
+         ossimPropertyEvent* eventCast = dynamic_cast<ossimPropertyEvent*>(&event);
+         if(eventCast) propertyEvent(*eventCast);
+         break;
+      }
+      case OSSIM_EVENT_ADD_OBJECT_ID:
+      {
+         ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
+         if(eventCast)
+         {
+            containerEvent(*eventCast);
+            addObjectEvent(*eventCast);
+         }
+         break;
+      }
+      case OSSIM_EVENT_REMOVE_OBJECT_ID:
+      {
+         ossimContainerEvent* eventCast = dynamic_cast<ossimContainerEvent*>(&event);
+         if(eventCast)
+         {
+            containerEvent(*eventCast);
+            removeObjectEvent(*eventCast);
+         }
+         break;
+      }
+      case OSSIM_EVENT_REFRESH_ID:
+      {
+         ossimRefreshEvent* eventCast = dynamic_cast<ossimRefreshEvent*>(&event);
+         if(eventCast) refreshEvent(*eventCast);
+         break;
+      }
+      default:
+      {
+         ossimListener::processEvent(event);
+         break;
+      }
+   }
+}
diff --git a/ossim/src/ossim/base/ossimConnectionEvent.cpp b/src/base/ossimConnectionEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimConnectionEvent.cpp
rename to src/base/ossimConnectionEvent.cpp
diff --git a/src/base/ossimContainerEvent.cpp b/src/base/ossimContainerEvent.cpp
new file mode 100644
index 0000000..9c440c7
--- /dev/null
+++ b/src/base/ossimContainerEvent.cpp
@@ -0,0 +1,31 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimContainerEvent.cpp 19965 2011-08-16 18:12:15Z gpotts $
+
+#include <ossim/base/ossimContainerEvent.h>
+
+RTTI_DEF1(ossimContainerEvent, "ossimContainerEvent", ossimEvent);
+
+ossimContainerEvent::ossimContainerEvent(ossimObject* obj,
+                                         long id)
+   :ossimEvent(obj, id)
+{
+}
+
+void ossimContainerEvent::setObjectList(ossimObject* obj)
+{
+   m_objectList.clear();
+   m_objectList.push_back(obj);
+}
+
+void ossimContainerEvent::setObjectList(ObjectList& objects)
+{
+   m_objectList = objects;
+}
diff --git a/src/base/ossimContainerProperty.cpp b/src/base/ossimContainerProperty.cpp
new file mode 100644
index 0000000..5930d88
--- /dev/null
+++ b/src/base/ossimContainerProperty.cpp
@@ -0,0 +1,227 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimContainerProperty.cpp 19920 2011-08-09 12:04:27Z gpotts $
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimVisitor.h>
+
+RTTI_DEF1(ossimContainerProperty, "ossimContainerProperty", ossimProperty);
+
+ossimContainerProperty::ossimContainerProperty(const ossimString& name)
+   :ossimProperty(name)
+{
+}
+
+ossimContainerProperty::ossimContainerProperty(const ossimContainerProperty& rhs)
+   :ossimProperty(rhs)
+{
+   copyList(rhs);
+}
+
+ossimContainerProperty::~ossimContainerProperty()
+{
+   deleteChildren();
+}
+
+ossimObject* ossimContainerProperty::dup()const
+{
+   return new ossimContainerProperty(*this);
+}
+
+const ossimProperty& ossimContainerProperty::assign(const ossimProperty& rhs)
+{
+   const ossimContainerProperty* rhsContainer = dynamic_cast<const ossimContainerProperty*>(&rhs);
+   ossimProperty::assign(rhs);
+
+   if(rhsContainer)
+   {
+      copyList(*rhsContainer);
+   }
+
+   return *this;
+}
+
+void ossimContainerProperty::copyList(const ossimContainerProperty& rhs)
+{
+   deleteChildren();
+
+   for(ossim_uint32 idx = 0; idx < rhs.theChildPropertyList.size();++idx)
+   {
+      if(rhs.theChildPropertyList[idx].valid())
+      {
+         theChildPropertyList.push_back((ossimProperty*)(rhs.theChildPropertyList[idx]->dup()));
+      }
+      else
+      {
+         theChildPropertyList.push_back((ossimProperty*)0);
+      }
+   }
+}
+
+void ossimContainerProperty::addChildren(std::vector<ossimRefPtr<ossimProperty> >& propertyList)
+{
+   for(ossim_uint32 idx = 0; idx < propertyList.size(); ++idx)
+   {
+      if(propertyList[idx].valid())
+      {
+         theChildPropertyList.push_back(propertyList[idx]);
+      }
+   }
+}
+
+void ossimContainerProperty::addChild(ossimProperty* property)
+{
+   theChildPropertyList.push_back(property);
+}
+
+void ossimContainerProperty::addStringProperty(const ossimString& name,
+                                               const ossimString& value,
+                                               bool readOnlyFlag)
+{
+   ossimProperty* prop = new ossimStringProperty(name, value);
+   
+   prop->setReadOnlyFlag(readOnlyFlag);
+   addChild(prop);
+}
+
+const ossimContainerProperty* ossimContainerProperty::asContainer()const
+{
+   return this;
+}
+
+ossimContainerProperty* ossimContainerProperty::asContainer()
+{
+   return this;
+}
+
+ossimRefPtr<ossimProperty> ossimContainerProperty::getProperty(const ossimString& name,
+                                                               bool recurse)
+{
+   ossim_uint32 idx = 0;
+   std::vector<ossimRefPtr<ossimContainerProperty> > containers;
+   if(name == getName())
+   {
+      return this;
+   }
+   for(idx = 0; idx < theChildPropertyList.size(); ++idx)
+   {
+      if(theChildPropertyList[idx].valid())
+      {
+         if(theChildPropertyList[idx]->getName() == name)
+         {
+            return theChildPropertyList[idx];
+         }
+         if(dynamic_cast<ossimContainerProperty*>(theChildPropertyList[idx].get())&&recurse)
+         {
+            containers.push_back(dynamic_cast<ossimContainerProperty*>(theChildPropertyList[idx].get()));
+         }
+      }
+   }
+   
+   if(containers.size())
+   {
+      for(idx = 0; idx < containers.size();++idx)
+      {
+         ossimRefPtr<ossimProperty> prop = containers[idx]->getProperty(name, recurse);
+         if(prop.valid())
+         {
+            return prop;
+         }
+      }
+   }
+   
+   return (ossimProperty*)0;
+}
+
+void ossimContainerProperty::deleteChildren()
+{
+//    for(ossim_uint32 idx = 0; idx < theChildPropertyList.size(); ++idx)
+//    {
+//       if(theChildPropertyList[idx])
+//       {
+//          delete theChildPropertyList[idx];
+//          theChildPropertyList[idx] = (ossimProperty*)0;
+//       }
+//    }
+   theChildPropertyList.clear();
+}
+
+
+bool ossimContainerProperty::setValue(const ossimString& /* value */ )
+{
+   return false;
+}
+
+void ossimContainerProperty::valueToString(ossimString& /* valueResult */ )const
+{
+}
+
+ossim_uint32 ossimContainerProperty::getNumberOfProperties()const
+{
+   return (ossim_uint32)theChildPropertyList.size();
+}
+
+ossimRefPtr<ossimProperty> ossimContainerProperty::getProperty(ossim_uint32 idx)
+{
+   if(idx < theChildPropertyList.size())
+   {
+      return theChildPropertyList[idx];
+   }
+
+   return (ossimProperty*)0;
+}
+
+void ossimContainerProperty::getPropertyList(
+   std::vector<ossimRefPtr<ossimProperty> >& children) const
+{
+   children = theChildPropertyList;
+}
+
+ossimRefPtr<ossimXmlNode> ossimContainerProperty::toXml()const
+{
+   ossimXmlNode* result = new ossimXmlNode;
+
+   result->setTag(getName());
+   
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theChildPropertyList.size(); ++idx)
+   {
+      ossimRefPtr<ossimXmlNode> child = theChildPropertyList[idx]->toXml();
+
+      result->addChildNode(child.get());
+   }
+
+   return result;
+}
+
+void ossimContainerProperty::setReadOnlyFlag(bool flag)
+{
+   ossimProperty::setReadOnlyFlag(flag);
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theChildPropertyList.size(); ++idx)
+   {
+      theChildPropertyList[idx]->setReadOnlyFlag(flag);
+   }
+}
+
+void ossimContainerProperty::accept(ossimVisitor& visitor)
+{
+   ossim_uint32 idx = 0;
+   if(!visitor.hasVisited(this))
+   {
+      ossimProperty::accept(visitor);
+      if(visitor.getVisitorType()&ossimVisitor::VISIT_CHILDREN)
+      {
+         for(idx = 0; idx < theChildPropertyList.size(); ++idx)
+         {
+            theChildPropertyList[idx]->accept(visitor);
+         }
+      }
+   }
+}
+
diff --git a/ossim/src/ossim/base/ossimCplUtil.cpp b/src/base/ossimCplUtil.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimCplUtil.cpp
rename to src/base/ossimCplUtil.cpp
diff --git a/ossim/src/ossim/base/ossimCsvFile.cpp b/src/base/ossimCsvFile.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimCsvFile.cpp
rename to src/base/ossimCsvFile.cpp
diff --git a/ossim/src/ossim/base/ossimCustomEditorWindow.cpp b/src/base/ossimCustomEditorWindow.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimCustomEditorWindow.cpp
rename to src/base/ossimCustomEditorWindow.cpp
diff --git a/ossim/src/ossim/base/ossimCustomEditorWindowFactoryBase.cpp b/src/base/ossimCustomEditorWindowFactoryBase.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimCustomEditorWindowFactoryBase.cpp
rename to src/base/ossimCustomEditorWindowFactoryBase.cpp
diff --git a/ossim/src/ossim/base/ossimCustomEditorWindowRegistry.cpp b/src/base/ossimCustomEditorWindowRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimCustomEditorWindowRegistry.cpp
rename to src/base/ossimCustomEditorWindowRegistry.cpp
diff --git a/src/base/ossimDataObject.cpp b/src/base/ossimDataObject.cpp
new file mode 100644
index 0000000..b1b2e19
--- /dev/null
+++ b/src/base/ossimDataObject.cpp
@@ -0,0 +1,190 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimDataObject.cpp 19931 2011-08-10 11:53:25Z gpotts $
+#include <ossim/base/ossimDataObject.h>
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+
+RTTI_DEF1(ossimDataObject, "ossimDataObject", ossimObject)
+   
+ossimDataObject::ossimDataObject(ossimSource* source,
+                                 ossimDataObjectStatus status)
+   :
+      theOwner(source),
+      theDataObjectStatus(status)
+{
+}
+
+ossimDataObject::ossimDataObject(const ossimDataObject& rhs)
+   : ossimObject(),
+     theOwner(0),
+     theDataObjectStatus(rhs.theDataObjectStatus)
+{
+}
+
+ossimDataObject::~ossimDataObject()
+{
+}
+
+void ossimDataObject::setOwner(ossimSource* aSource)
+{
+   theOwner = aSource;
+}
+
+ossimSource* ossimDataObject::getOwner()
+{
+   return theOwner;
+}
+
+const ossimSource* ossimDataObject::getOwner() const
+{
+   return theOwner;
+}
+
+void ossimDataObject::setDataObjectStatus(ossimDataObjectStatus status) const
+{
+   theDataObjectStatus = status;
+}
+
+ossimDataObjectStatus ossimDataObject::getDataObjectStatus()const
+{
+   return theDataObjectStatus;
+}
+
+ossimString ossimDataObject::getDataObjectStatusString() const
+{
+   ossimString s;
+   
+   switch (theDataObjectStatus)
+   {
+      case OSSIM_NULL:
+         s = "OSSIM_NULL";
+         break;
+
+      case OSSIM_EMPTY:
+         s = "OSSIM_EMPTY";
+         break;
+
+      case OSSIM_PARTIAL:
+         s = "OSSIM_PARTIAL";
+         break;
+
+      case OSSIM_FULL:
+         s = "OSSIM_FULL";
+         break;
+         
+      case OSSIM_STATUS_UNKNOWN:
+      default:
+         s = "OSSIM_STATUS_UNKNOWN";
+         break;
+   }
+   
+   return s;
+}
+
+ossim_uint32 ossimDataObject::getObjectSizeInBytes()const
+{
+   return sizeof(theOwner);
+}
+
+bool ossimDataObject::isInitialize()const
+{
+   return (getDataObjectStatus()!=OSSIM_NULL);
+}
+
+bool ossimDataObject::operator!=(const ossimDataObject& rhs) const
+{
+   return ( theOwner               != rhs.theOwner ||
+            theDataObjectStatus    != rhs.theDataObjectStatus );
+}
+
+bool ossimDataObject::operator==(const ossimDataObject& rhs) const
+{
+   return (theOwner            == rhs.theOwner &&
+           theDataObjectStatus == rhs.theDataObjectStatus);
+}
+
+void ossimDataObject::assign(const ossimDataObject* rhs)
+{
+   if(rhs != this)
+   {
+      theOwner               = rhs->theOwner;
+      theDataObjectStatus     = rhs->theDataObjectStatus;
+   }
+}
+
+const ossimDataObject* ossimDataObject::operator=(const ossimDataObject* rhs)
+{
+   assign(rhs);
+   return this;
+}
+
+const ossimDataObject& ossimDataObject::operator=(const ossimDataObject& rhs)
+{
+   if (this != &rhs)
+   {
+      theOwner            = rhs.theOwner;
+      theDataObjectStatus = rhs.theDataObjectStatus; 
+   }
+   return *this;
+}
+
+std::ostream& ossimDataObject::print(ostream& out) const
+{
+   out << "ossimDataObject::print:";
+   
+   if (theOwner)
+   {
+      out << "\ntheOwner->getClassName():  "
+          << theOwner->getClassName()<<endl;
+   }
+   else
+   {
+      out << "\ntheOwner is null"
+          <<endl;
+   }
+   out << "theDataObjectStatus: " << getDataObjectStatusString()
+       << endl;
+
+   return out;
+}
+
+bool ossimDataObject::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix, "data_object_status", getDataObjectStatusString(), true);
+   return ossimObject::saveState(kwl, prefix);
+}
+
+bool ossimDataObject::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   ossimString data_object_status = kwl.find(prefix, "data_object_status");
+   if(!data_object_status.empty())
+   {
+      data_object_status = data_object_status.upcase();
+      if(data_object_status == "OSSIM_FULL")
+      {
+         theDataObjectStatus = OSSIM_FULL;
+      }
+      else if(data_object_status == "OSSIM_PARTIAL")
+      {
+         theDataObjectStatus = OSSIM_PARTIAL;
+      }
+      else if(data_object_status == "OSSIM_EMPTY")
+      {
+         theDataObjectStatus = OSSIM_EMPTY;
+      }
+      else if(data_object_status == "OSSIM_STATUS_UNKNOWN")
+      {
+         theDataObjectStatus = OSSIM_STATUS_UNKNOWN;
+      }
+   }
+   
+   return ossimObject::loadState(kwl, prefix);
+}                     
diff --git a/src/base/ossimDate.cpp b/src/base/ossimDate.cpp
new file mode 100644
index 0000000..ed5b5c0
--- /dev/null
+++ b/src/base/ossimDate.cpp
@@ -0,0 +1,1158 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimDate.cpp 23002 2014-11-24 17:11:17Z dburken $
+
+#include <ossim/base/ossimDate.h>
+#include <cctype> /* for isdigit */
+#include <iomanip>
+#include <sstream>
+#include <iostream>
+OpenThreads::Mutex ossimLocalTm::m_mutex;
+
+std::ostream& operator<< (std::ostream& out, const ossimDate& src)
+{
+   return src.print(out);
+}
+
+std::ostream& operator<< (std::ostream & os, ossimLocalTm const & t)
+{
+   return t.print(os);
+}
+
+int operator== (ossimLocalTm const & t1, ossimLocalTm const & t2)
+{
+   return int(t1.compare(t2) == 0);
+}
+
+int operator!= (ossimLocalTm const & t1, ossimLocalTm const & t2)
+{
+   return int(t1.compare(t2) != 0);
+}
+
+int operator<  (ossimLocalTm const & t1, ossimLocalTm const & t2)
+{
+   return int(t1.compare(t2) < 0);
+}
+
+int operator<= (ossimLocalTm const & t1, ossimLocalTm const & t2)
+{
+   return int(t1.compare(t2) <= 0);
+}
+
+int operator>  (ossimLocalTm const & t1, ossimLocalTm const & t2)
+{
+   return int(t1.compare(t2) > 0);
+}
+
+int operator>=  (ossimLocalTm const & t1, ossimLocalTm const & t2)
+{
+   return int(t1.compare(t2) >= 0);
+}
+
+char ossimLocalTm::timech = ':';
+char ossimLocalTm::datech = '/';
+
+int ossimLocalTm::datefmt = ossimLocalTm::ossimLocalTmFormatFull;
+int ossimLocalTm::timefmt = ossimLocalTm::ossimTimeFormatInternational;
+
+
+ossimLocalTm::ossimLocalTm (time_t t)
+   :theFractionalSecond(0.0)
+{
+  if (t == 0)
+      t = time(0);
+  *(tm *)this = *localtime(&t);
+
+  setTimezoneOffsetFromGmt();
+
+}
+
+ossimLocalTm::ossimLocalTm (tm const & t)
+   :theFractionalSecond(0.0)
+{
+  *((tm *)this) = t;
+  setTimezoneOffsetFromGmt();
+}
+ossimLocalTm::ossimLocalTm (const ossimLocalTm& t)
+   :theFractionalSecond(t.theFractionalSecond)
+{
+  *((tm *)this) = t;
+  setTimezoneOffsetFromGmt();
+}
+
+ossimLocalTm& ossimLocalTm::operator= (tm const & t)
+{
+    *((tm *)this) = t;
+    return *this;
+}
+
+ossimLocalTm & ossimLocalTm::operator= (const ossimLocalTm & t)
+{
+    *((tm *)this) = t;
+    theFractionalSecond = t.theFractionalSecond;
+    return *this;
+}
+
+int ossimLocalTm::compare (ossimLocalTm const & t) const
+{
+    return compare ((time_t)t);
+}
+
+int ossimLocalTm::compare (time_t const tt) const
+{
+    time_t tx = (time_t)*this;
+    return (tx == tt) ? 0 : (tx > tt) ? 1 : -1;
+}
+
+ossimLocalTm::operator time_t (void) const
+{
+    return mktime ((tm *)this);
+}
+
+int ossimLocalTm::isValid (void) const
+{
+    static int maxd[] =
+    {
+        31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+    };
+
+    return ((tm_year > 0) &&
+            (tm_mon >= 0) && (tm_mon < 12) &&
+            (tm_mday > 0) && (tm_mday <= maxd[tm_mon]) &&
+            (tm_wday < 7) && (tm_yday < 367) &&
+            (tm_sec < 60) && (tm_min < 60) && (tm_hour < 24));
+}
+void ossimLocalTm::now()
+{
+   time_t t = time(0);
+   *this = *localtime(&t);
+}
+
+void ossimLocalTm::dSfx (std::ostream & os, int fmt) const
+{
+    if (fmt & ossimLocalTmFormatSepChar)
+        os << datech;
+    if (fmt & ossimLocalTmFormatSepSpace)
+        os << ' ';
+}
+
+void ossimLocalTm::pYear (std::ostream & os, int fmt) const
+{
+    if (fmt & ossimLocalTmFormatYear)
+    {
+        int year = tm_year;
+        int dig;
+        if (fmt & ossimLocalTmFormatYearShort)
+        {
+            dig = 2;
+            year %= 100;
+        }
+        else
+        {
+            dig = 4;
+            if (year < 200)
+                year += 1900;
+        }
+        os << std::setw((fmt & ossimLocalTmFormatPadYear) ? dig : 0);
+        os << std::setfill((fmt & ossimLocalTmFormatZeroYear) ? '0' : ' ');
+        os << year;
+        if ((fmt & ossimLocalTmFormatYearFirst))
+        {
+            fmt &= (ossimLocalTmFormatSepChar|ossimLocalTmFormatSepSpace);
+            dSfx (os, fmt);
+        }
+    }
+}
+
+void ossimLocalTm::pMonth (std::ostream & os, int fmt) const
+{
+
+    static const char * _months[] =
+    {
+        "January", "February", "March", "April",
+        "May", "June", "July", "August", "September",
+        "October", "November", "December"
+    };
+
+    if (fmt & ossimLocalTmFormatMonth)
+    {
+        int mon = (tm_mon % 12);
+        if (fmt & ossimLocalTmFormatMonText)
+        {
+            char const * tmon = _months[mon];
+            if (!(fmt & ossimLocalTmFormatPadMon))
+                os << tmon;
+            else
+                for (int x = 0; x < 3; ++x)
+                    os << tmon[x];
+        }
+        else
+        {
+            ++mon;
+            os << std::setw((fmt & ossimLocalTmFormatPadMon) ? 2 : 0);
+            os << std::setfill((fmt & ossimLocalTmFormatZeroMon) ? '0' : ' ');
+            os << mon;
+        }
+        if (((fmt & ossimLocalTmFormatYear) && !(fmt & ossimLocalTmFormatYearFirst)) ||
+            ((fmt & ossimLocalTmFormatDay) && (fmt & ossimLocalTmFormatMonFirst)))
+        {
+            fmt &= (ossimLocalTmFormatSepChar|ossimLocalTmFormatSepSpace);
+            dSfx (os, fmt);
+        }
+    }
+}
+
+
+void ossimLocalTm::pDate (std::ostream & os, int fmt) const
+{
+    if (fmt & ossimLocalTmFormatDay)
+    {
+        int day = tm_mday;
+        os << std::setw((fmt & ossimLocalTmFormatPadDay) ? 2 : 0);
+        os << std::setfill((fmt & ossimLocalTmFormatZeroDay) ? '0' : ' ');
+        os << day;
+        if (!(fmt & ossimLocalTmFormatYearFirst) || !(fmt & ossimLocalTmFormatMonFirst))
+        {
+            fmt &= (ossimLocalTmFormatSepChar|ossimLocalTmFormatSepSpace);
+            dSfx (os, fmt);
+        }
+    }
+}
+
+void ossimLocalTm::setTimezoneOffsetFromGmt()
+{
+   m_mutex.lock();
+   // struct tm gmt = *this;
+#if !defined(_MSC_VER) 
+   tzset();
+#else
+   _tzset();
+#endif
+   
+#if ( defined(__APPLE__) || defined(__FreeBSD__)  || defined(__OpenBSD__) )
+   //gmt.tm_sec -= tm_gmtoff; // Seconds east of UTC
+   m_timezoneOffset = tm_gmtoff;
+#elif (defined(WIN32))
+   long timezoneOffset=0;
+   _get_timezone(&timezoneOffset);
+   //m_timezoneOffset = timezone; // Seconds west of UTC
+   if ( tm_isdst )
+   {
+      timezoneOffset -= 3600; // Subtract an hour.
+   }
+   m_timezoneOffset = -timezoneOffset;
+#else
+   m_timezoneOffset = timezone; // Seconds west of UTC
+   if ( tm_isdst )
+   {
+      m_timezoneOffset -= 3600; // Subtract an hour.
+   }
+   m_timezoneOffset = -m_timezoneOffset;
+#endif
+   m_mutex.unlock();
+   
+   m_timezoneOffset = m_timezoneOffset/3600;
+}
+
+std::ostream& ossimLocalTm::print(std::ostream & os,
+                                    int df,
+                                    int tf) const
+{
+    std::ostringstream pTmp;
+    printDate (pTmp, df);
+    pTmp << ' ';
+    printTime (pTmp, tf);
+
+    return os << pTmp.str();
+}
+
+
+
+std::ostream& ossimLocalTm::printDate (std::ostream & os, int fmt) const
+{
+    std::ostringstream pTmp;
+
+    static const char * _days[] =
+    {
+        "Sunday", "Monday", "Tuesday", "Wednesday",
+        "Thursday", "Friday", "Saturday"
+    };
+
+    if (fmt & ossimLocalTmFormatDayOfWeek)
+    {
+        int day = tm_wday % 7;
+        char const * p = _days[day];
+        if (fmt & ossimLocalTmFormatPadDay)
+            for (int x = 0; x < 3; ++x)
+                pTmp << p[x];
+        else
+        {
+            pTmp << p;
+            if (fmt & ossimLocalTmFormatDMY)
+                pTmp << ',';
+        }
+        if ((fmt & ossimLocalTmFormatDMY) && fmt & ossimLocalTmFormatSepSpace)
+            pTmp << ' ';
+    }
+    if (fmt & ossimLocalTmFormatYearFirst)
+        pYear (pTmp, fmt);
+    if (fmt & ossimLocalTmFormatMonFirst)
+        pMonth (pTmp, fmt);
+    pDate (pTmp, fmt);
+    if (!(fmt & ossimLocalTmFormatMonFirst))
+        pMonth (pTmp, fmt);
+    if (!(fmt & ossimLocalTmFormatYearFirst))
+        pYear (pTmp, fmt);
+
+    return os << pTmp.str();
+}
+
+std::ostream& ossimLocalTm::dump(std::ostream& os) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = os.flags();
+
+   os << setiosflags(ios::fixed) << setprecision(8) << setiosflags(ios::left);
+
+   os << "fr_sec:   " << setw(12) << theFractionalSecond
+      << "fractional second\n"
+      << "tm_sec:   " << setw(12) << tm_sec
+      << "seconds [0-60] (1 leap second)\n"
+      << "tm_min:   " << setw(12) << tm_min   << "minutes [0-59]\n"
+      << "tm_hour:  " << setw(12) << tm_hour  << "hours [0-23]\n"
+      << "tm_mday:  " << setw(12) << tm_mday  << "day [1-31]\n"
+      << "tm_mon:   " << setw(12) << tm_mon   << "month [0-11]\n"
+      << "tm_year:  " << setw(12) << tm_year  << "year - 1900\n"
+      << "tm_wday:  " << setw(12) << tm_wday  << "day of week [0-6]\n"
+      << "tm_yday:  " << setw(12) << tm_yday  << "days in year[0-365]\n"
+      << "tm_isdst: " << setw(12) << tm_isdst << "DST.[-1/0/1]\n"
+      << std::endl;
+
+   // Reset flags.
+   os.setf(f);
+   
+   return os;
+}
+
+void ossimLocalTm::tSfx (std::ostream & os, int fmt, char ch) const
+{
+    if (fmt & ossimTimeFormatSepAbbrev)
+        os << ch;
+    if (fmt & ossimTimeFormatSepChar)
+        os << timech;
+    if (fmt & ossimTimeFormatSepSpace)
+        os << ' ';
+}
+
+void ossimLocalTm::pHour (std::ostream & os, int fmt) const
+{
+    if (fmt & ossimTimeFormatHour)
+    {
+        int hour = tm_hour;
+        if (!(fmt & ossimTimeFormat24hour))
+        {
+            if (hour > 12)
+                hour -= 12;
+            else if (!hour && (fmt & ossimTimeFormatAmPm))
+                hour += 12;
+        }
+        os << std::setw((fmt & ossimTimeFormatPadHour) ? 2 : 0);
+        os << std::setfill((fmt & ossimTimeFormatZeroHour) ? '0' : ' ');
+        os << hour;
+        if (!(fmt & ossimTimeFormatMins))
+            fmt &= ossimTimeFormatSepAbbrev;
+        tSfx (os, fmt, 'h');
+    }
+}
+
+void ossimLocalTm::pMins (std::ostream & os, int fmt) const
+{
+    if (fmt & ossimTimeFormatMins)
+    {
+        int min = tm_min;
+        int dig = 2;
+        if (!(fmt & ossimTimeFormatHour))
+        {
+            min += (tm_hour * 60);
+            dig += 2;
+        }
+        os << std::setw((fmt & ossimTimeFormatPadMins) ? dig : 0);
+        os << std::setfill((fmt & ossimTimeFormatZeroMins) ? '0' : ' ');
+        os << min;
+        if (!(fmt & ossimTimeFormatSecs))
+            fmt &= ossimTimeFormatSepAbbrev;
+        tSfx (os, fmt, 'm');
+    }
+}
+
+void ossimLocalTm::pSecs (std::ostream & os, int fmt) const
+{
+    if (fmt & ossimTimeFormatSecs)
+    {
+        int sec = tm_sec;
+        int dig = 2;
+        if (!(fmt & (ossimTimeFormatHour|ossimTimeFormatMins)))
+        {
+            sec += ((tm_hour * 60) + tm_min) + 60;
+            dig += 3;
+        }
+        os << std::setw((fmt & ossimTimeFormatPadSecs) ? dig : 0);
+        os << std::setfill((fmt & ossimTimeFormatZeroSecs) ? '0' : ' ');
+        os << sec;
+        if (fmt & ossimTimeFormatAmPm)
+            fmt &= ~ossimTimeFormatSepChar;
+        else
+            fmt &= (ossimTimeFormatSepAbbrev|ossimTimeFormatSepSpace);
+        tSfx (os, fmt, 's');
+    }
+}
+
+std::ostream &ossimLocalTm::printTime (std::ostream & os, int fmt) const
+{
+    std::ostringstream pTmp;
+    pHour (pTmp, fmt);
+    pMins (pTmp, fmt);
+    pSecs (pTmp, fmt);
+    if (fmt & ossimTimeFormatAmPm)
+    {
+        pTmp << (tm_hour > 11 ? "pm" : "am");
+    }
+
+    return os << pTmp.str();
+}
+
+
+int ossimLocalTm::getYear()const
+{
+   int result = tm_year;
+//   if (result < 200)
+   {
+      result += 1900;
+   }
+   return result;
+}
+
+int ossimLocalTm::getShortYear()const
+{
+   return (getYear()%100);
+}
+
+int ossimLocalTm::getMonth()const
+{
+   return ((tm_mon % 12)+1); 
+}
+
+int ossimLocalTm::getDay()const
+{
+   return tm_mday;
+}
+
+double ossimLocalTm::getJulian()const
+{
+   int J = getMonth();
+   int K = getDay();
+   int I = getYear();
+
+   return (K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12)
+           /12-3*((I+4900+(J-14)/12)/100)/4+
+           (getHour()/24.0)+
+           (getMin()/1440.0)+
+           ((getSec()+theFractionalSecond)/86400.0));
+}
+
+double ossimLocalTm::getModifiedJulian()const
+{
+   return getJulian() - 2400000.5;
+}
+
+ossimLocalTm& ossimLocalTm::setDay(int day)
+{
+   tm_mday = day;
+   
+   return *this;
+}
+
+ossimLocalTm& ossimLocalTm::setMonth(int month)
+{
+   tm_mon = month - 1;
+
+   return *this;
+}
+
+ossimLocalTm& ossimLocalTm::setYear(int year)
+{
+   if(year < 2099)
+   {
+      tm_year = year - 1900;
+   }
+   else
+   {
+      tm_year = year;
+   }
+
+   return *this;
+}
+
+ossimLocalTm& ossimLocalTm::setDateFromJulian(double jd)
+{
+   double fractional = jd - (long)jd;
+   long l;
+   long n;
+   long i;
+   long j;
+   long k;
+
+
+   l= (long)(jd+68569);
+   n= 4*l/146097;
+   l= l-(146097*n+3)/4;
+   i= 4000*(l+1)/1461001;
+   l= l-1461*i/4+31l;
+   j= 80*l/2447;
+   k= l-2447*j/80;
+   l= j/11;
+   j= j+2-12*l;
+   i= 100*(n-49)+i+l;
+   setDay(k);
+   setMonth(j);
+   setYear(i);
+
+   setFractionalDay(fractional);
+   
+   return *this;
+}
+
+ossimLocalTm& ossimLocalTm::setDateFromModifiedJulian(double mjd)
+{
+   setDateFromJulian(mjd + 2400000.5);
+
+   return *this;
+}
+
+void ossimLocalTm::setFractionalDay(double fractionalDay)
+{
+   int h, m, s;
+   double fractionalSecond;
+   extractHmsFromFractionalDay(fractionalDay, h, m, s, fractionalSecond);
+
+   setHour(h);
+   setMin(m);
+   setSec(s);
+   setFractionalSecond(fractionalSecond);
+}
+
+void ossimLocalTm::extractHmsFromFractionalDay(double fractionalDay,
+                                               int &h,
+                                               int &m,
+                                               int &s,
+                                               double& fractionalSecond)
+{
+   fractionalDay *=24;
+   h = (int)fractionalDay;
+   fractionalDay = fractionalDay-h;
+   fractionalDay*=60;
+   m = (int)fractionalDay;
+   fractionalDay = fractionalDay-m;
+   fractionalDay*=60;
+   s = (int)fractionalDay;
+   fractionalDay = fractionalDay-s;
+   fractionalSecond = fractionalDay;
+}
+
+int ossimLocalTm::getHour()const
+{
+   return tm_hour;
+}
+
+int ossimLocalTm::getMin()const
+{
+   return tm_min;
+}
+
+int ossimLocalTm::getSec()const
+{
+   return tm_sec;
+}
+
+double ossimLocalTm::getFractionalSecond()const
+{
+   return theFractionalSecond;
+}
+
+ossimLocalTm& ossimLocalTm::setHour(int h)
+{
+   tm_hour = h;
+
+   return *this;
+}
+
+ossimLocalTm& ossimLocalTm::setMin(int m)
+{
+   tm_min = m;
+
+   return *this;
+}
+
+ossimLocalTm& ossimLocalTm::setSec(int s)
+{
+   tm_sec = s;
+
+   return *this;
+}
+
+ossimLocalTm& ossimLocalTm::setFloatSec(double s)
+{
+   tm_sec = (int)s;
+   return setFractionalSecond(s-tm_sec);
+}
+
+ossimLocalTm& ossimLocalTm::setFractionalSecond(double fractionalSecond)
+{
+   theFractionalSecond = fractionalSecond;
+
+   return *this;
+}
+
+time_t ossimLocalTm::getTicks()const
+{
+   return getEpoc();
+}
+
+time_t ossimLocalTm::getEpoc()const
+{
+   std::tm temp = *this;
+
+   return mktime(&temp);
+}
+
+void ossimLocalTm::addSeconds(ossim_float64 n)
+{
+   // use julian to help in this addition.  Julian is in days
+   setDateFromJulian(getJulian() + (n/86400.0));
+}
+
+void ossimLocalTm::addMinutes(ossim_float64 n)
+{
+   setDateFromJulian(getJulian() + (n/1440.0));
+}
+
+void ossimLocalTm::addHours(ossim_float64 n)
+{
+   setDateFromJulian(getJulian() + (n/24.0));
+}
+
+void ossimLocalTm::addDays(ossim_float64 n)
+{
+   setDateFromJulian(getJulian() + n);
+}
+
+ossim_float64 ossimLocalTm::deltaInSeconds(const ossimLocalTm& d)const
+{
+   return (getJulian()-d.getJulian())*86400.0;
+}
+
+ossim_float64 ossimLocalTm::deltaInMinutes(const ossimLocalTm& d)const
+{
+   return (getJulian()-d.getJulian())*1440.0;
+}
+
+ossim_float64 ossimLocalTm::delatInHours(const ossimLocalTm& d)const
+{
+   return (getJulian()-d.getJulian())*24;
+}
+
+ossim_float64 ossimLocalTm::deltaInDays(const ossimLocalTm& d)const
+{
+   return (getJulian()-d.getJulian());
+}
+
+ossimLocalTm ossimLocalTm::convertToGmt()const
+{
+  m_mutex.lock();
+   struct tm gmt = *this;
+#if !defined(_MSC_VER) 
+   tzset();
+#else
+   _tzset();
+#endif
+
+#if ( defined(__APPLE__) || defined(__FreeBSD__)  || defined(__OpenBSD__) )
+   gmt.tm_sec -= tm_gmtoff; // Seconds east of UTC
+#elif (defined(WIN32))
+   long timezoneOffset=0;
+   _get_timezone(&timezoneOffset);
+   //m_timezoneOffset = timezone; // Seconds west of UTC
+   if ( tm_isdst )
+   {
+      timezoneOffset -= 3600; // Subtract an hour.
+   }
+   m_timezoneOffset = -timezoneOffset;
+#else
+   m_timezoneOffset = timezone; // Seconds west of UTC
+   if ( tm_isdst )
+   {
+      m_timezoneOffset -= 3600; // Subtract an hour.
+   }
+   m_timezoneOffset = -m_timezoneOffset;
+#endif
+   
+   time_t t = mktime(&gmt);
+   std::tm localTime = *localtime(&t);
+
+m_mutex.unlock();
+   ossimLocalTm result(localTime);
+   
+   return result;
+}
+
+void ossimLocalTm::setTimeNoAdjustmentGivenEpoc(time_t ticks)
+{
+  OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+   *this = *gmtime(&ticks);
+}
+
+void ossimLocalTm::setTimeGivenEpoc(time_t ticks)
+{
+  OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+  *this = *localtime(&ticks);
+}
+
+
+static bool readIntegerFromString(ossim_int32& result,
+                                 const std::string& input,
+                                 std::string::size_type& currentPos,
+                                 int digits)
+{
+   ossimString number;
+   while((digits>0)&&
+         (currentPos < input.size()))
+   {
+      if(isdigit(input[currentPos]))
+      {
+         number += input[currentPos];
+         ++currentPos;
+         --digits;
+      }
+      else
+      {
+         return false;
+      }
+   }
+   result = number.toInt32();
+   return (digits <= 0);
+}
+
+static bool readTimeZoneOffset(ossim_int32& result,
+                               const std::string& input,
+                               std::string::size_type& currentPos)
+{
+   bool returnValue = false;
+   result = 0;
+   if(input[currentPos] == '+'||
+      input[currentPos] == '-')
+   {
+      returnValue = true;
+      ossim_int32 signMult = ((input[0] == '+')?1:-1);
+      ossim_int32 zoneMin = 0;
+      ossim_int32 zoneHour = 0;
+      ++currentPos;
+      if(readIntegerFromString(zoneHour,
+                               input,
+                               currentPos,
+                               2))
+      {
+         if(!isdigit(input[currentPos]))
+         {
+            ++currentPos; // skip :
+         }
+         if(readIntegerFromString(zoneMin,
+                                  input,
+                                  currentPos,
+                                  2))
+         {
+            result = signMult*(zoneMin*60 + zoneHour*3600);
+         }
+      }
+   }
+   
+   return returnValue;
+}
+
+bool ossimLocalTm::setIso8601(const std::string& timeString, bool shiftToGmtOffsetZero)
+{
+   ossimDate now;
+   std::string::size_type pos = 0;
+   ossim_int32 year  = 0;
+   ossim_int32 month = 0;
+   ossim_int32 day   = 0;
+   ossim_int32 timeZoneOffset = 0;
+   
+   if(timeString[0] != 'T') // make sure it's not time only
+   {
+      // look for year
+      //
+      if(readIntegerFromString(year,
+                               timeString,
+                               pos,
+                               4))
+      {
+         // retrieved the year portion
+         // now check for separator not digit
+         //
+         
+         // we at least have a year
+         // now check for others
+         setYear(year);
+         if(!isdigit(timeString[pos]))
+         {
+            // skip separator
+            ++pos;
+         }
+         if(readIntegerFromString(month,
+                                  timeString,
+                                  pos,
+                                  2))
+         
+         {
+            setMonth(month);
+            if(!isdigit(timeString[pos]))
+            {
+               // skip separator
+               ++pos;
+            }
+            if(readIntegerFromString(day,
+                                     timeString,
+                                     pos,
+                                     2))
+            {
+               setDay(day);
+            }
+         }
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else // set year month day to current
+   {
+      setYear(now.getYear());
+      setMonth(now.getMonth());
+      setDay(now.getDay());
+   }
+   // check to see if we need to read time portion
+   if(timeString[pos] == 'T')
+   {
+      ++pos; // skip T character
+      ossim_int32 hours=0, minutes=0;
+      
+      if(readIntegerFromString(hours,
+                               timeString,
+                               pos,
+                               2))
+      {
+         setHour(hours);
+         
+         // now check for separator
+         if(!std::isdigit(timeString[pos]))
+         {
+            ++pos; // skip separator if present
+         }
+         if(readIntegerFromString(minutes,
+                                  timeString,
+                                  pos,
+                                  2))
+         {
+            setMin(minutes);
+            // now check for time zone if only a hour minute time
+            //
+            if(timeString[pos] == 'Z')
+            {
+              std::time_t t = mktime(this);
+              t += m_timezoneOffset*3600;
+              setTimeGivenEpoc(t);
+            }
+            else if(!readTimeZoneOffset(timeZoneOffset,
+                                       timeString,
+                                       pos))
+            {
+               double fractionalSeconds = 0.0;
+               if(!std::isdigit(timeString[pos]))
+               {
+                  ++pos;
+               }
+               std::string::size_type endPos = timeString.find_first_not_of("0123456789.", pos);
+               if(endPos == std::string::npos)
+               {
+                  fractionalSeconds = ossimString(timeString.begin()+pos,
+                                                  timeString.end()).toDouble();
+               }
+               else
+               {
+                  fractionalSeconds = ossimString(timeString.begin()+pos,
+                                                  timeString.begin()+endPos).toDouble();
+               }
+               setFloatSec(fractionalSeconds);
+               pos = endPos;
+               if(pos == std::string::npos)
+               {
+                  // we will not be too strict so if at the end then just return we got enough
+                  return true;
+               }
+               if(timeString[pos] == 'Z')
+               {
+                  std::time_t t = mktime(this);
+                  t += m_timezoneOffset*3600;
+                  setTimeGivenEpoc(t);
+                //std::cout << "OFFSET == " << m_timezoneOffset << std::endl;
+               }
+               else
+               {
+                  readTimeZoneOffset(timeZoneOffset,
+                                     timeString,
+                                     pos);
+               }
+            }
+         }
+      }
+      else
+      {
+         // need at least hours 
+         return false;
+      }
+   }
+   else if(std::isdigit(timeString[pos]))
+   {
+      ossim_int32 hours=0, minutes=0;
+      
+      if(readIntegerFromString(hours,
+                               timeString,
+                               pos,
+                               2))
+      {
+         setHour(hours);
+         
+         // now check for separator
+         if(!std::isdigit(timeString[pos]))
+         {
+            ++pos; // skip separator if present
+         }
+         if(readIntegerFromString(minutes,
+                                  timeString,
+                                  pos,
+                                  2))
+         {
+            setMin(minutes);
+            
+            if(!readTimeZoneOffset(timeZoneOffset,
+                                  timeString,
+                                  pos))
+            {
+               double fractionalSeconds = 0.0;
+               if(!std::isdigit(timeString[pos]))
+               {
+                  ++pos;
+               }
+               std::string::size_type endPos = timeString.find_first_not_of("0123456789.", pos);
+               if(endPos == std::string::npos)
+               {
+                  fractionalSeconds = ossimString(timeString.begin()+pos,
+                                                  timeString.end()).toDouble();
+               }
+               else
+               {
+                  fractionalSeconds = ossimString(timeString.begin()+pos,
+                                                  timeString.begin()+endPos).toDouble();
+               }
+               setFloatSec(fractionalSeconds);
+               pos = endPos;
+               if(pos == std::string::npos)
+               {
+                  // we will not be too strict so if at the end then just return we got enough
+                  return true;
+               }
+               if(timeString[pos] == 'Z')
+               {
+                  // For proper readouts we need to shift
+                  // to current time zone of the system
+                  //
+                //std::cout << "OFFSET == " << m_timezoneOffset << std::endl;
+               
+                  std::time_t t = mktime(this);
+                  t += m_timezoneOffset*3600;
+                  setTimeGivenEpoc(t);
+               }
+               else
+               {
+                  readTimeZoneOffset(timeZoneOffset,
+                                     timeString,
+                                     pos);
+               }
+            }
+         }
+      }  
+   }
+   else
+   {
+      // need at least hours 
+      return false;
+   }
+   
+   if(shiftToGmtOffsetZero && (timeZoneOffset!=0))
+   {
+      addSeconds(-timeZoneOffset);
+   }
+   return true;
+}
+
+ossimRefPtr<ossimXmlNode> ossimLocalTm::saveXml()const
+{
+   ossimRefPtr<ossimXmlNode> result = new ossimXmlNode;
+
+   result->setTag("ossimDate");
+   result->addAttribute("version", "1");
+   result->addChildNode("month", ossimString::toString(getMonth()));
+   result->addChildNode("day", ossimString::toString(getDay()));
+   result->addChildNode("year", ossimString::toString(getYear()));
+   result->addChildNode("hour", ossimString::toString(getHour()));
+   result->addChildNode("minutes", ossimString::toString(getMin()));
+   result->addChildNode("seconds", ossimString::toString(getSec()));
+   result->addChildNode("fractionalSecond", ossimString::toString(getFractionalSecond()));
+   
+   return result.get();
+}
+
+bool ossimLocalTm::loadXml(ossimRefPtr<ossimXmlNode> dateNode)
+{
+   bool result = true;
+   ossimRefPtr<ossimXmlNode> month = dateNode->findFirstNode("month");
+   ossimRefPtr<ossimXmlNode> day = dateNode->findFirstNode("day");
+   ossimRefPtr<ossimXmlNode> year = dateNode->findFirstNode("year");
+   ossimRefPtr<ossimXmlNode> hour = dateNode->findFirstNode("hour");
+   ossimRefPtr<ossimXmlNode> minutes = dateNode->findFirstNode("minutes");
+   ossimRefPtr<ossimXmlNode> seconds = dateNode->findFirstNode("seconds");
+   ossimRefPtr<ossimXmlNode> fractionalSecond = dateNode->findFirstNode("fractionalSecond");
+   ossimRefPtr<ossimXmlNode> julian = dateNode->findFirstNode("julian");
+   ossimRefPtr<ossimXmlNode> modifiedJulian = dateNode->findFirstNode("modifiedJulian");
+
+   if(month.valid()&&
+      day.valid()&&
+      year.valid()&&
+      hour.valid()&&
+      minutes.valid()&&
+      seconds.valid())
+   {
+      setMonth(month->getText().toInt32());
+      setDay(day->getText().toInt32());
+      setYear(year->getText().toInt32());
+      setHour(hour->getText().toInt32());
+      setMin(minutes->getText().toInt32());
+      setSec(seconds->getText().toInt32());
+      if(fractionalSecond.valid())
+      {
+         setFractionalSecond(fractionalSecond->getText().toDouble());
+      }
+      else
+      {
+         setFractionalSecond(0.0);
+      }
+   }
+   else if(modifiedJulian.valid())
+   {
+      setDateFromModifiedJulian(modifiedJulian->getText().toDouble());
+   }
+   else if(julian.valid())
+   {
+      setDateFromJulian(julian->getText().toDouble());
+   }
+   else
+   {
+      result = false;
+   }
+
+   return result;
+}
+
+ossimDate::ossimDate(int datefmt)
+   :ossimLocalTm(0), _fmt(datefmt)
+{}
+
+ossimDate::ossimDate (ossimLocalTm const & t,
+                      int dtfmt)
+   : ossimLocalTm (t), _fmt(dtfmt)
+{}
+
+ossimDate::ossimDate (time_t t, int dtfmt)
+   : ossimLocalTm (t), _fmt(dtfmt)
+{}
+
+ossimDate::ossimDate(int month,
+                     int day,
+                     int year,
+                     int dtfmt)
+   :ossimLocalTm (0), _fmt(dtfmt)
+{
+   setMonth(month);
+   setDay(day);
+   setYear(year);
+   setHour(0);
+   setMin(0);
+   setSec(0);
+   setFractionalSecond(0.0);
+}
+
+int ossimDate::fmt(int f)
+{
+   return _fmt = f;
+}
+
+int ossimDate::fmt(void) const
+{
+   return _fmt;
+}
+
+std::ostream& ossimDate::print (std::ostream & os) const
+{
+   return printDate (os, _fmt);
+}
+
+std::ostream& operator <<(std::ostream& out, const ossimTime& src)
+{
+   return src.print(out);
+}
+ossimTime::ossimTime(int tmfmt)
+      : ossimLocalTm(0), _fmt(tmfmt)
+{
+}
+ossimTime::ossimTime(ossimTime const & t,
+                      int tmfmt)
+      : ossimLocalTm (t), _fmt(tmfmt)
+{
+}
+
+ossimTime::ossimTime(time_t t, int tmfmt)
+      : ossimLocalTm (t), _fmt(tmfmt)
+{
+}
+      
+int ossimTime::fmt(int f)
+{
+   return _fmt = f;
+}
+
+int ossimTime::fmt(void) const
+{
+   return _fmt;
+}
+
+std::ostream& ossimTime::print (std::ostream & os) const
+{
+   return printTime(os, _fmt);
+}
diff --git a/src/base/ossimDateProperty.cpp b/src/base/ossimDateProperty.cpp
new file mode 100644
index 0000000..e10027c
--- /dev/null
+++ b/src/base/ossimDateProperty.cpp
@@ -0,0 +1,145 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: LGPL see top level license.txt
+//
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+//*************************************************************************
+// $Id: ossimDateProperty.cpp 9094 2006-06-13 19:12:40Z dburken $
+//
+
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <ossim/base/ossimDateProperty.h>
+
+
+RTTI_DEF1(ossimDateProperty, "ossimDateProperty", ossimProperty);
+
+ossimDateProperty::ossimDateProperty()
+      :ossimProperty("")
+{
+   setDate(ossimDate());
+}
+
+ossimDateProperty::ossimDateProperty(const ossimString& name,
+                                     const ossimString& value)
+      :ossimProperty(name)
+{
+   setValue(value);
+}
+
+ossimDateProperty::ossimDateProperty(const ossimString& name,
+                                     const ossimLocalTm& value)
+      :ossimProperty(name),
+       theValue(value)
+{
+}
+
+ossimDateProperty::ossimDateProperty(const ossimDateProperty& src)
+   :ossimProperty(src),
+    theValue(src.theValue)
+{
+}
+
+ossimObject* ossimDateProperty::dup()const
+{
+   return new ossimDateProperty(*this);
+}
+
+void ossimDateProperty::setDate(const ossimLocalTm& localTm)
+{
+   theValue = localTm;
+}
+
+const ossimLocalTm& ossimDateProperty::getDate()const
+{
+   return theValue;
+}
+
+bool ossimDateProperty::setValue(const ossimString& value)
+{
+   if(value.trim() == "")
+   {
+      theValue = ossimDate();
+      return true;
+   }
+   bool result = value.size() == 14;
+   
+   ossimString year;
+   ossimString month;
+   ossimString day;
+   ossimString hour;
+   ossimString min;
+   ossimString sec;
+
+   if(value.size() == 14)
+   {
+      year = ossimString(value.begin(),
+                         value.begin()+4);
+      month = ossimString(value.begin()+4,
+                          value.begin()+6);
+      day = ossimString(value.begin()+6,
+                        value.begin()+8);
+      hour = ossimString(value.begin()+8,
+                        value.begin()+10);
+      min = ossimString(value.begin()+10,
+                        value.begin()+12);
+      sec = ossimString(value.begin()+12,
+                        value.begin()+14);
+
+      theValue.setYear(year.toUInt32());
+      theValue.setMonth(month.toUInt32());
+      theValue.setDay(day.toUInt32());
+      theValue.setHour(hour.toUInt32());
+      theValue.setMin(min.toUInt32());
+      theValue.setSec(sec.toUInt32());
+   }
+
+   return result;
+}
+
+void ossimDateProperty::valueToString(ossimString& valueResult)const
+{
+    std::ostringstream out;
+
+   out << std::setw(4)
+       << std::setfill('0')
+       << theValue.getYear()
+       << std::setw(2)
+       << std::setfill('0')
+       << theValue.getMonth()
+       << std::setw(2)
+       << std::setfill('0')
+       << theValue.getDay()
+       << std::setw(2)
+       << std::setfill('0')
+       << theValue.getHour()
+       << std::setw(2)
+       << std::setfill('0')
+       << theValue.getMin()
+       << std::setw(2)
+       << std::setfill('0')
+       << theValue.getSec();
+   
+   valueResult =  out.str();
+  
+}
+
+const ossimProperty& ossimDateProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+
+   const ossimDateProperty* rhsPtr = dynamic_cast<const ossimDateProperty*>(&rhs);
+   if(rhsPtr)
+   {
+      theValue = rhsPtr->theValue;
+   }
+   else
+   {
+      setValue(rhs.valueToString());
+   }
+
+   return *this;
+}
diff --git a/ossim/src/ossim/base/ossimDatum.cpp b/src/base/ossimDatum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDatum.cpp
rename to src/base/ossimDatum.cpp
diff --git a/ossim/src/ossim/base/ossimDatumFactory.cpp b/src/base/ossimDatumFactory.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDatumFactory.cpp
rename to src/base/ossimDatumFactory.cpp
diff --git a/src/base/ossimDatumFactory.inc b/src/base/ossimDatumFactory.inc
new file mode 100644
index 0000000..60babb1
--- /dev/null
+++ b/src/base/ossimDatumFactory.inc
@@ -0,0 +1,287 @@
+//*************************************************************************
+// LGPL
+// 
+// Author:  Garrett Potts
+//
+//**************************************************************************
+// $Id: ossimDatumFactory.inc 16414 2010-01-26 18:10:18Z gpotts $
+
+struct ossimSevenParamDatumType
+{
+   const char* theCode;
+   const char* theName;
+   const char* theEllipsoidCode;
+   ossim_float64 theSigmaX;
+   ossim_float64 theSigmaY;
+   ossim_float64 theSigmaZ;
+   ossim_float64 theWestLongitude;
+   ossim_float64 theEastLongitude;
+   ossim_float64 theSouthLatitude;
+   ossim_float64 theNorthLatitude;
+   ossim_float64 theParam1;
+   ossim_float64 theParam2;
+   ossim_float64 theParam3;
+   ossim_float64 theParam4;
+   ossim_float64 theParam5;
+   ossim_float64 theParam6;
+   ossim_float64 theParam7;
+};
+
+struct ossimThreeParamDatumType
+{
+public:
+   const char* theCode;
+   const char* theName;
+   const char* theEllipsoidCode;
+   ossim_float64 theSigmaX;
+   ossim_float64 theSigmaY;
+   ossim_float64 theSigmaZ;
+   ossim_float64 theWestLongitude;
+   ossim_float64 theEastLongitude;
+   ossim_float64 theSouthLatitude;
+   ossim_float64 theNorthLatitude;
+   ossim_float64 theParam1;
+   ossim_float64 theParam2;
+   ossim_float64 theParam3;
+};
+
+#define NUMBER_OF_SEVEN_PARAM_DATUMS 2
+#define NUMBER_OF_THREE_PARAM_DATUMS 226
+
+static ossimThreeParamDatumType threeParamDatum[] = {
+{"ADI-A", "ADINDAN, Ethiopia", "CD", 3, 3, 3, 26, 50, -3, 25, -165, -11, 206},
+{"ADI-B", "ADINDAN, Sudan", "CD", 3, 5, 3, 15, 45, -3, 31, -161, -14, 205},
+{"ADI-C", "ADINDAN, Mali", "CD", 25, 25, 25, -20, 11, 3, 31, -123, -20, 220},
+{"ADI-D", "ADINDAN, Senegal", "CD", 25, 25, 25, -24, -5, 5, 23, -128, -18, 224},
+{"ADI-E", "ADINDAN, Burkina Faso", "CD", 25, 25, 25, -5, 8, 4, 22, -118, -14, 218},
+{"ADI-F", "ADINDAN, Cameroon", "CD", 25, 25, 25, 3, 23, -4, 19, -134, -2, 210},
+{"ADI-M", "ADINDAN, Mean", "CD", 5, 5, 3, 15, 55, -5, 31, -166, -15, 204},
+{"AFG", "AFGOOYE, Somalia", "KA", 25, 25, 25, 35, 60, -8, 19, -43, -163, 45},
+{"AIA", "ANTIGUA ISLAND ASTRO 1943", "CD", 25, 25, 25, -65, -61, 16, 20, -270, 13, 62},
+{"AIN-A", "AIN EL ABD 1970, Bahrain", "IN", 25, 25, 25, 49, 53, 24, 28, -150, -250, -1},
+{"AIN-B", "AIN EL ABD 1970, Saudi Arabia", "IN", 10, 10, 10, 28, 62, 8, 38, -143, -236, 7},
+{"AMA", "AMERICAN SAMOA 1962", "CC", 25, 25, 25, -174, -165, -19, -9, -115, 118, 426},
+{"ANO", "ANNA 1 ASTRO 1965, Cocos Is.", "AN", 25, 25, 25, 94, 99, -14, -10, -491, -22, 435},
+{"ARF-A", "ARC 1950, Botswana", "CD", 3, 5, 3, 13, 36, -33, -13, -138, -105, -289},
+{"ARF-B", "ARC 1950, Lesotho", "CD", 3, 3, 8, 21, 35, -36, -23, -125, -108, -295},
+{"ARF-C", "ARC 1950, Malawi", "CD", 9, 24, 8, 26, 42, -21, -3, -161, -73, -317},
+{"ARF-D", "ARC 1950, Swaziland", "CD", 15, 15, 15, 25, 40, -33, -20, -134, -105, -295},
+{"ARF-E", "ARC 1950, Zaire", "CD", 25, 25, 25, 4, 38, -21, 10, -169, -19, -278},
+{"ARF-F", "ARC 1950, Zambia", "CD", 21, 21, 27, 15, 40, -24, -1, -147, -74, -283},
+{"ARF-G", "ARC 1950, Zimbabwe", "CD", 5, 8, 11, 19, 39, -29, -9, -142, -96, -293},
+{"ARF-H", "ARC 1950, Burundi", "CD", 20, 20, 20, 21, 37, -11, 4, -153, -5, -292},
+{"ARF-M", "ARC 1950, Mean", "CD", 20, 33, 20, 4, 42, -36, 10, -143, -90, -294},
+{"ARS-A", "ARC 1960, Kenya", "CD", 4, 3, 3, 28, 47, -11, 8, -157, -2, -299},
+{"ARS-B", "ARC 1960, Tanzania", "CD", 6, 9, 10, 23, 47, -18, 5, -175, -23, -303},
+{"ARS-M", "ARC 1960, Kenya & Tanzania", "CD", 20, 20, 20, 23, 47, -18, 8, -160, -6, -302},
+{"ASC", "ASCENSION ISLAND 1958", "IN", 25, 25, 25, -16, -13, -9, -6, -205, 107, 53},
+{"ASM", "MONTSERRAT ISLAND ASTRO 1958", "CD", 25, 25, 25, -64, -61, 15, 18, 174, 359, 365},
+{"ASQ", "ASTRO STATION 1952, Marcus Is.", "IN", 25, 25, 25, 152, 156, 22, 26, 124, -234, -25},
+{"ATF", "ASTRO BEACON E 1845, Iwo Jima", "IN", 25, 25, 25, 140, 144, 22, 26, 145, 75, -272},
+{"AUA", "AUSTRALIAN GEODETIC 1966", "AN", 3, 3, 3, 109, 161, -46, -4, -133, -48, 148},
+{"AUG", "AUSTRALIAN GEODETIC 1984", "AN", 2, 2, 2, 109, 161, -46, -4, -134, -48, 149},
+{"BAT", "DJAKARTA, INDONESIA", "BR", 3, 3, 3, 89, 146, -16, 11, -377, 681, -50},
+{"BER", "BERMUDA 1957, Bermuda Islands", "CC", 20, 20, 20, -66, -63, 31, 34, -73, 213, 296},
+{"BID", "BISSAU, Guinea-Bissau", "IN", 25, 25, 25, -23, -7, 5, 19, -173, 253, 27},
+{"BOO", "BOGOTA OBSERVATORY, Columbia", "IN", 6, 5, 6, -85, -61, -10, 16, 307, 304, -318},
+{"BUR", "BUKIT RIMPAH, Banka & Belitung", "BR", -1, -1, -1, 103, 110, -6, 0, -384, 664, -48},
+{"CAC", "CAPE CANAVERAL, Fla & Bahamas", "CC", 3, 3, 3, -94, -12, 15, 38, -2, 151, 181},
+{"CAI", "CAMPO INCHAUSPE 1969, Arg.", "IN", 5, 5, 5, -72, -51, -58, -27, -148, 136, 90},
+{"CAO", "CANTON ASTRO 1966, Phoenix Is.", "IN", 15, 15, 15, -180, -165, -13, 3, 298, -304, -375},
+{"CAP", "CAPE, South Africa", "CD", 3, 6, 6, 10, 40, -43, -15, -136, -108, -292},
+{"CAZ", "CAMP AREA ASTRO, Camp McMurdo", "IN", -1, -1, -1, 135, 180, -85, -70, -104, -129, 239},
+{"CCD", "S-JTSK, Czech Republic", "BR", 4, 2, 3, 6, 28, 43, 56, 589, 76, 480},
+{"CGE", "CARTHAGE, Tunisia", "CD", 6, 9, 8, 2, 18, 24, 43, -263, 6, 431},
+{"CHI", "CHATHAM ISLAND ASTRO 1971, NZ", "IN", 15, 15, 15, -180, -174, -46, -42, 175, -38, 113},
+{"CHU", "CHUA ASTRO, Paraguay", "IN", 6, 9, 5, -69, -49, -33, -14, -134, 229, -29},
+{"COA", "CORREGO ALEGRE, Brazil", "IN", 5, 3, 5, -80, -29, -39, -2, -206, 172, -6},
+{"DAL", "DABOLA, Guinea", "CD", 15, 15, 15, 12, 11, 1, 19, -83, 37, 124},
+{"DID", "DECEPTION ISLAND", "CD", 20, 20, 20, 58, 62, -65, -62, 260, 12, -147},
+{"DOB", "GUX 1 ASTRO, Guadalcanal Is.", "IN", 25, 25, 25, 158, 163, -12, -8, 252, -209, -751},
+{"EAS", "EASTER ISLAND 1967", "IN", 25, 25, 25, -111, -108, -29, -26, 211, 147, 111},
+{"ENW", "WAKE-ENIWETOK 1960", "HO", 3, 3, 3, 159, 175, 1, 16, 102, 52, -38},
+{"EST", "ESTONIA, 1937", "BR", 2, 3, 3, 16, 34, 52, 65, 374, 150, 588},
+{"EUR-A", "EUROPEAN 1950, Western Europe", "IN", 3, 3, 3, -15, 25, 30, 78, -87, -96, -120},
+{"EUR-B", "EUROPEAN 1950, Greece", "IN", 25, 25, 25, 14, 34, 30, 48, -84, -95, -130},
+{"EUR-C", "EUROPEAN 1950, Norway & Finland", "IN", 3, 5, 3, -2, 38, 52, 80, -87, -95, -120},
+{"EUR-D", "EUROPEAN 1950, Portugal & Spain", "IN", 5, 6, 3, -15, 10, 30, 49, -84, -107, -120},
+{"EUR-E", "EUROPEAN 1950, Cyprus", "IN", 15, 15, 15, 31, 36, 33, 37, -104, -101, -140},
+{"EUR-F", "EUROPEAN 1950, Egypt", "IN", 6, 8, 8, 19, 42, 16, 38, -130, -117, -151},
+{"EUR-G", "EUROPEAN 1950, England, Channel", "IN", 3, 3, 3, -10, 3, 48, 62, -86, -96, -120},
+{"EUR-H", "EUROPEAN 1950, Iran", "IN", 9, 12, 11, 37, 69, 19, 47, -117, -132, -164},
+{"EUR-I", "EUROPEAN 1950, Sardinia(Italy)", "IN", 25, 25, 25, 6, 12, 37, 43, -97, -103, -120},
+{"EUR-J", "EUROPEAN 1950, Sicily(Italy)", "IN", 20, 20, 20, 10, 17, 35, 40, -97, -88, -135},
+{"EUR-K", "EUROPEAN 1950, England, Ireland", "IN", 3, 3, 3, -12, 3, 48, 62, -86, -96, -120},
+{"EUR-L", "EUROPEAN 1950, Malta", "IN", 25, 25, 25, 12, 16, 34, 38, -107, -88, -149},
+{"EUR-M", "EUROPEAN 1950, Mean (3 Param)", "IN", 3, 8, 5, 5, 33, 30, 80, -87, -98, -121},
+{"EUR-S", "EUROPEAN 1950, Iraq, Israel", "IN", -1, -1, -1, 36, 57, -38, -4, -103, -106, -141},
+{"EUR-T", "EUROPEAN 1950, Tunisia", "IN", 25, 25, 25, 2, 18, 24, 43, -112, -77, -145},
+{"EUS", "EUROPEAN 1979", "IN", 3, 3, 3, -15, 24, 30, 80, -86, -98, -119},
+{"FAH", "OMAN", "CD", 3, 3, 9, 46, 65, 10, 32, -346, -1, 224},
+{"FLO", "OBSERVATORIO MET. 1939, Flores", "IN", 20, 20, 20, -33, -30, 38, 41, -425, -169, 81},
+{"FOT", "FORT THOMAS 1955, Leeward Is.", "CD", 25, 25, 25, -64, -61, 16, 19, -7, 215, 225},
+{"GAA", "GAN 1970, Rep. of Maldives", "IN", 25, 25, 25, 71, 75, -2, 9, -133, -321, 50},
+{"GEO", "GEODETIC DATUM 1949, NZ", "IN", 5, 3, 5, 165, 180, -48, -33, 84, -22, 209},
+{"GIZ", "DOS 1968, Gizo Island", "IN", 25, 25, 25, 155, 158, -10, -7, 230, -199, -752},
+{"GRA", "GRACIOSA BASE SW 1948, Azores", "IN", 3, 3, 3, -30, -26, 37, 41, -104, 167, -38},
+{"GSE", "GUNUNG SEGARA, Indonesia", "BR", -1, -1, -1, 106, 121, -6, 9, -403, 684, 41},
+{"GUA", "GUAM 1963", "CC", 3, 3, 3, 143, 146, 12, 15, -100, -248, 259},
+{"HEN", "HERAT NORTH, Afghanistan", "IN", -1, -1, -1, 55, 81, 23, 44, -333, -222, 114},
+{"HER", "HERMANNSKOGEL, old Yugoslavia", "BR", -1, -1, -1, 7, 29, 35, 52, 682, -203, 480},
+{"HIT", "PROVISIONAL SOUTH CHILEAN 1963", "IN", 25, 25, 25, -83, -60, -64, -25, 16, 196, 93},
+{"HJO", "HJORSEY 1955, Iceland", "IN", 3, 3, 6, -24, -11, 61, 69, -73, 46, -86},
+{"HKD", "HONG KONG 1963", "IN", 25, 25, 25, 112, 116, 21, 24, -156, -271, -189},
+{"HTN", "HU-TZU-SHAN, Taiwan", "IN", 15, 15, 15, 117, 124, 20, 28, -637, -549, -203},
+{"IBE", "BELLEVUE (IGN), Efate Is.", "IN", 20, 20, 20, 167, 171, -20, -16, -127, -769, 472},
+{"IDN", "INDONESIAN 1974", "ID", 25, 25, 25, 89, 146, -16, 11, -24, -15, 5},
+{"IND-B", "INDIAN, Bangladesh", "EA", 10, 8, 12, 80, 100, 15, 33, 282, 726, 254},
+{"IND-I", "INDIAN, India & Nepal", "EC", 12, 10, 15, 62, 105, 2, 44, 295, 736, 257},
+{"IND-P", "INDIAN, Pakistan", "EA", -1, -1, -1, 55, 81, 17, 44, 283, 682, 231},
+{"INF-A", "INDIAN 1954, Thailand", "EA", 15, 6, 12, 91, 111, 0, 27, 217, 823, 299},
+{"ING-A", "INDIAN 1960, Vietnam 16N", "EA", 25, 25, 25, 101, 115, 11, 23, 198, 881, 317},
+{"ING-B", "INDIAN 1960, Con Son Island", "EA", 25, 25, 25, 104, 109, 6, 11, 182, 915, 344},
+{"INH-A", "INDIAN 1975, Thailand", "EA", 12, 10, 12, 91, 111, 0, 27, 209, 818, 290},
+{"INH-A1", "INDIAN 1975, Thailand", "EA", 3, 2, 3, 91, 111, 0, 27, 210, 814, 289},
+{"IRL", "IRELAND 1965", "AM", 3, 3, 3, -12, -4, 50, 57, 506, -122, 611},
+{"ISG", "ISTS 061 ASTRO 1968, S Georgia", "IN", 25, 25, 25, -38, -34, -56, -52, -794, 119, -298},
+{"IST", "ISTS 073 ASTRO 1969, Diego Garc", "IN", 25, 25, 25, 69, 75, -10, -4, 208, -435, -229},
+{"JOH", "JOHNSTON ISLAND 1961", "IN", 25, 25, 25, -76, -73, -46, -43, 189, -79, -202},
+{"KAN", "KANDAWALA, Sri Lanka", "EA", 20, 20, 20, 77, 85, 4, 12, -97, 787, 86},
+{"KEA", "KERTAU 1948, W Malaysia & Sing.", "EE", 10, 8, 6, 94, 112, -5, 12, -11, 851, 5},
+{"KEG", "KERGUELEN ISLAND 1949", "IN", 25, 25, 25, 139, 180, -81, -74, 145, -187, 103},
+{"KUS", "KUSAIE ASTRO 1951, Caroline Is.", "IN", 25, 25, 25, 134, 167, -1, 12, 647, 1777, -1124},
+{"LCF", "L.C. 5 ASTRO 1961, Cayman Brac", "CC", 25, 25, 25, -81, -78, 18, 21, 42, 124, 147},
+{"LEH", "LEIGON, Ghana", "CD", 2, 3, 2, -9, 7, -1, 17, -130, 29, 364},
+{"LIB", "LIBERIA 1964", "CD", 15, 15, 15, -17, -1, -1, 14, -90, 40, 88},
+{"LUZ-A", "LUZON, Phillipines", "CC", 8, 11, 9, 115, 128, 3, 23, -133, -77, -51},
+{"LUZ-B", "LUZON, Mindanao Island", "CC", 25, 25, 25, 120, 128, 4, 12, -133, -79, -72},
+{"MAS", "MASSAWA, Ethiopia", "BR", 25, 25, 25, 37, 53, 7, 25, 639, 405, 60},
+{"MER", "MERCHICH, Morocco", "CD", 5, 3, 3, -19, 5, 22, 42, 31, 146, 47},
+{"MID", "MIDWAY ASTRO 1961, Midway Is.", "IN", 25, 25, 25, -180, -169, 25, 30, 912, -58, 1227},
+{"MIK", "MAHE 1971, Mahe Is.", "CD", 25, 25, 25, 54, 57, -6, -3, 41, -220, -134},
+{"MIN-A", "MINNA, Cameroon", "CD", 25, 25, 25, 3, 23, -4, 19, -81, -84, 115},
+{"MIN-B", "MINNA, Nigeria", "CD", 3, 6, 5, -4, 20, -1, 21, -92, -93, 122},
+{"MOD", "ROME 1940, Sardinia", "IN", 25, 25, 25, 6, 12, 37, 43, -225, -65, 9},
+{"MPO", "M'PORALOKO, Gabon", "CD", 25, 25, 25, 3, 20, -10, 8, -74, -130, 42},
+{"MVS", "VITI LEVU 1916, Viti Levu Is.", "CD", 25, 25, 25, 176, 180, -20, -16, 51, 391, -36},
+{"NAH-A", "NAHRWAN, Masirah Island (Oman)", "CD", 25, 25, 25, 57, 60, 19, 22, -247, -148, 369},
+{"NAH-B", "NAHRWAN, United Arab Emirates", "CD", 25, 25, 25, 45, 62, 17, 32, -249, -156, 381},
+{"NAH-C", "NAHRWAN, Saudi Arabia", "CD", 25, 25, 20, 28, 62, 8, 38, -243, -192, 477},
+{"NAP", "NAPARIMA, Trinidad & Tobago", "IN", 15, 15, 15, -64, -59, 8, 13, -10, 375, 165},
+{"NAR-A", "NORTH AMERICAN 1983, Alaska", "RF", 2, 2, 2, -175, -135, 48, 78, 0, 0, 0},
+{"NAR-B", "NORTH AMERICAN 1983, Canada", "RF", 2, 2, 2, -150, -50, 36, 90, 0, 0, 0},
+{"NAR-C", "NORTH AMERICAN 1983, CONUS", "RF", 2, 2, 2, -135, -60, 15, 60, 0, 0, 0},
+{"NAR-D", "NORTH AMERICAN 1983, Mexico", "RF", 2, 2, 2, -122, -72, 11, 35, 0, 0, 0},
+{"NAR-E", "NORTH AMERICAN 1983, Aleutian", "RF", 5, 2, 5, -180, 180, 51, 74, -2, 0, 4},
+{"NAR-H", "NORTH AMERICAN 1983, Hawai'i", "RF", 2, 2, 2, -164, -153, 17, 24, 1, 1, -1},
+{"NAS-A", "NORTH AMERICAN 1927, Eastern US", "CC", 5, 5, 8, -102, -60, 18, 55, -9, 161, 179},
+{"NAS-B", "NORTH AMERICAN 1927, Western US", "CC", 5, 3, 3, -132, -87, 19, 55, -8, 159, 175},
+{"NAS-C", "NORTH AMERICAN 1927, CONUS", "CC", 5, 5, 6, -135, -60, 15, 60, -8, 160, 176},
+{"NAS-D", "NORTH AMERICAN 1927, Alaska", "CC", 5, 9, 5, -175, -130, 47, 78, -5, 135, 172},
+{"NAS-E", "NORTH AMERICAN 1927, Canada", "CC", 15, 11, 6, -150, -50, 36, 90, -10, 158, 187},
+{"NAS-F", "NORTH AMERICAN 1927, Alberta/BC", "CC", 8, 8, 6, -145, -105, 43, 65, -7, 162, 188},
+{"NAS-G", "NORTH AMERICAN 1927, E. Canada", "CC", 6, 6, 3, -85, -45, 38, 68, -22, 160, 190},
+{"NAS-H", "NORTH AMERICAN 1927, Man/Ont", "CC", 9, 5, 5, -108, -69, 36, 63, -9, 157, 184},
+{"NAS-I", "NORTH AMERICAN 1927, NW Terr.", "CC", 5, 5, 3, -144, -55, 43, 90, 4, 159, 188},
+{"NAS-J", "NORTH AMERICAN 1927, Yukon", "CC", 5, 8, 3, -147, -117, 53, 75, -7, 139, 181},
+{"NAS-L", "NORTH AMERICAN 1927, Mexico", "CC", 8, 6, 6, -122, -80, 10, 38, -12, 130, 190},
+{"NAS-N", "NORTH AMERICAN 1927, C. America", "CC", 8, 3, 5, -98, -77, 3, 25, 0, 125, 194},
+{"NAS-O", "NORTH AMERICAN 1927, Canal Zone", "CC", 20, 20, 20, -86, -74, 3, 15, 0, 125, 201},
+{"NAS-P", "NORTH AMERICAN 1927, Caribbean", "CC", 3, 9, 12, -87, -58, 8, 29, -3, 142, 183},
+{"NAS-Q", "NORTH AMERICAN 1927, Bahamas", "CC", 5, 3, 5, -83, -71, 19, 29, -4, 154, 178},
+{"NAS-R", "NORTH AMERICAN 1927, San Salv.", "CC", 25, 25, 25, -75, -74, 23, 26, 1, 140, 165},
+{"NAS-T", "NORTH AMERICAN 1927, Cuba", "CC", 25, 25, 25, -87, -72, 18, 25, -9, 152, 178},
+{"NAS-U", "NORTH AMERICAN 1927, Greenland", "CC", 25, 25, 25, 74, 56, 74, 81, 11, 114, 195},
+{"NAS-V", "NORTH AMERICAN 1927, Aleutian E", "CC", 6, 8, 10, -180, -161, 50, 58, -2, 152, 149},
+{"NAS-W", "NORTH AMERICAN 1927, Aleutian W", "CC", 10, 10, 10, 169, 180, 50, 58, 2, 204, 105},
+{"NSD", "NORTH SAHARA 1959, Algeria", "CD", 25, 25, 25, -15, 11, 13, 43, -186, -93, 310},
+{"NTF", "NOUVELLE TRIANGULATION DE LA FRANCE, FRANCE", "CE", 0, 0, 0, -6, 12, 41, 51, -168, -60, 320},
+{"OEG", "OLD EGYPTIAN 1907", "HE", 3, 6, 8, 19, 42, 16, 38, -130, 110, -13},
+{"OGB-A", "ORDNANCE GB 1936, England", "AA", 5, 5, 6, -12, 7, 44, 61, 371, -112, 434},
+{"OGB-B", "ORDNANCE GB 1936, Eng., Wales", "AA", 10, 10, 15, -12, 7, 44, 61, 371, -111, 434},
+{"OGB-C", "ORDNANCE GB 1936, Scotland", "AA", 10, 10, 10, -14, 4, 49, 66, 384, -111, 425},
+{"OGB-D", "ORDNANCE GB 1936, Wales", "AA", 20, 20, 20, -11, 3, 46, 59, 370, -108, 434},
+{"OGB-M", "ORDNANCE GB 1936, Mean (3 Para)", "AA", 10, 10, 15, -14, 7, 44, 66, 375, -111, 431},
+{"OHA-A", "OLD HAWAI'IAN (CC), Hawai'i", "CC", 25, 25, 25, -158, -153, 17, 22, 89, -279, -183},
+{"OHA-B", "OLD HAWAI'IAN (CC), Kauai", "CC", 20, 20, 20, -161, -158, 20, 24, 45, -290, -172},
+{"OHA-C", "OLD HAWAI'IAN (CC), Maui", "CC", 25, 25, 25, -158, -154, 19, 23, 65, -290, -190},
+{"OHA-D", "OLD HAWAI'IAN (CC), Oahu", "CC", 10, 6, 6, -160, -156, 20, 23, 58, -283, -182},
+{"OHA-M", "OLD HAWAI'IAN (CC), Mean", "CC", 25, 20, 20, -164, -153, 17, 24, 61, -285, -181},
+{"OHI-A", "OLD HAWAI'IAN (IN), Hawai'i", "IN", 25, 25, 25, -158, -153, 17, 22, 229, -222, -348},
+{"OHI-B", "OLD HAWAI'IAN (IN), Kauai", "IN", 20, 20, 20, -161, -158, 20, 24, 185, -233, -337},
+{"OHI-C", "OLD HAWAI'IAN (IN), Maui", "IN", 25, 25, 25, -158, -154, 19, 23, 205, -233, -355},
+{"OHI-D", "OLD HAWAI'IAN (IN), Oahu", "IN", 10, 6, 6, -160, -156, 20, 23, 198, -226, -347},
+{"OHI-M", "OLD HAWAI'IAN (IN), Mean", "IN", 25, 20, 20, -164, -153, 17, 24, 201, -228, -346},
+{"PHA", "AYABELLA LIGHTHOUSE, Bjibouti", "CD", 25, 25, 25, 36, 49, 5, 20, -79, -129, 145},
+{"PIT", "PITCAIRN ASTRO 1967", "IN", 25, 25, 25, -134, -119, -27, -21, 185, 165, 42},
+{"PLN", "PICO DE LAS NIEVES, Canary Is.", "IN", 25, 25, 25, -20, -12, 26, 31, -307, -92, 127},
+{"POS", "PORTO SANTO 1936, Madeira Is.", "IN", 25, 25, 25, -18, -15, 31, 35, -499, -249, 314},
+{"PRP-A", "PROV. S AMERICAN 1956, Bolivia", "IN", 5, 11, 14, -75, -51, -28, -4, -270, 188, -388},
+{"PRP-B", "PROV. S AMERICAN 1956, N Chile", "IN", 25, 25, 25, -83, -60, -45, -12, -270, 183, -390},
+{"PRP-C", "PROV. S AMERICAN 1956, S Chile", "IN", 20, 20, 20, -83, -60, -64, -20, -305, 243, -442},
+{"PRP-D", "PROV. S AMERICAN 1956, Colombia", "IN", 15, 15, 15, -85, -61, -10, 16, -282, 169, -371},
+{"PRP-E", "PROV. S AMERICAN 1956, Ecuador", "IN", 3, 5, 3, -85, -70, -11, 7, -278, 171, -367},
+{"PRP-F", "PROV. S AMERICAN 1956, Guyana", "IN", 6, 14, 5, -67, -51, -4, 14, -298, 159, -369},
+{"PRP-G", "PROV. S AMERICAN 1956, Peru", "IN", 6, 8, 12, -87, -63, -24, 5, -279, 175, -379},
+{"PRP-H", "PROV. S AMERICAN 1956, Venez", "IN", 9, 14, 15, -79, -54, -5, 18, -295, 173, -371},
+{"PRP-M", "PROV. S AMERICAN 1956, Mean", "IN", 17, 27, 27, -87, -51, -64, 18, -288, 175, -376},
+{"PTB", "POINT 58, Burkina Faso & Niger", "CD", 25, 25, 25, -15, 25, 0, 10, -106, -129, 165},
+{"PTN", "POINT NOIRE 1948", "CD", 25, 25, 25, 5, 25, -11, 10, -148, 51, -291},
+{"PUK", "PULKOVO 1942, Russia", "KA", -1, -1, -1, -180, 180, 36, 89, 28, -130, -95},
+{"PUR", "PUERTO RICO & Virgin Is.", "CC", 3, 3, 3, -69, -63, 16, 20, 11, 72, -101},
+{"QAT", "QATAR NATIONAL", "IN", 20, 20, 20, 45, 57, 19, 32, -128, -283, 22},
+{"QUO", "QORNOQ, South Greenland", "IN", 25, 25, 32, -77, -7, 57, 85, 164, 138, -189},
+{"REU", "REUNION, Mascarene Is.", "IN", 25, 25, 25, 47, 65, -27, -12, 94, -948, -1262},
+{"SAE", "SANTO (DOS) 1965", "IN", 22, 25, 25, 160, 169, -17, -13, 170, 42, 84},
+{"SAN-A", "SOUTH AMERICAN 1969, Argentina", "SA", 5, 5, 5, -76, -47, -62, -23, -62, -1, -37},
+{"SAN-B", "SOUTH AMERICAN 1969, Bolivia", "SA", 15, 15, 15, -75, -51, -28, -4, -61, 2, -48},
+{"SAN-C", "SOUTH AMERICAN 1969, Brazil", "SA", 3, 5, 5, -80, -29, -39, -2, -60, -2, -41},
+{"SAN-D", "SOUTH AMERICAN 1969, Chile", "SA", 15, 8, 11, -83, -60, -64, -12, -75, -1, -44},
+{"SAN-E", "SOUTH AMERICAN 1969, Colombia", "SA", 6, 6, 5, -85, -61, -10, 16, -44, 6, -36},
+{"SAN-F", "SOUTH AMERICAN 1969, Ecuador", "SA", 3, 3, 3, -85, -70, -11, 7, -48, 3, -44},
+{"SAN-G", "SOUTH AMERICAN 1969, Guyana", "SA", 9, 5, 5, -67, -51, -4, 14, -53, 3, -47},
+{"SAN-H", "SOUTH AMERICAN 1969, Paraguay", "SA", 15, 15, 15, -69, -49, -33, -14, -61, 2, -33},
+{"SAN-I", "SOUTH AMERICAN 1969, Peru", "SA", 5, 5, 5, -87, -63, -24, 5, -58, 0, -44},
+{"SAN-J", "SOUTH AMERICAN 1969, Baltra", "SA", 25, 25, 25, -92, -89, -2, 1, -47, 26, -42},
+{"SAN-K", "SOUTH AMERICAN 1969, Trinidad", "SA", 25, 25, 25, -68, -55, 4, 17, -45, 12, -33},
+{"SAN-L", "SOUTH AMERICAN 1969, Venezuela", "SA", 3, 6, 3, -79, -54, -5, 18, -45, 8, -33},
+{"SAN-M", "SOUTH AMERICAN 1969, Mean", "SA", 15, 6, 9, -90, -25, -65, -50, -57, 1, -41},
+{"SAO", "SAO BRAZ, Santa Maria Is.", "IN", 25, 25, 25, -27, -23, 35, 39, -203, 141, 53},
+{"SAP", "SAPPER HILL 1943, E Falkland Is", "IN", 1, 1, 1, -61, -56, -54, -50, -355, 21, 72},
+{"SCK", "SCHWARZECK, Namibia", "BN", 20, 20, 20, 5, 31, -35, -11, 616, 97, -251},
+{"SGM", "SELVAGEM GRADE 1938, Salvage Is", "IN", 25, 25, 25, -18, -14, 28, 32, -289, -124, 60},
+{"SHB", "ASTRO DOS 71/4, St. Helena Is.", "IN", 25, 25, 25, -7, -4, -18, -14, -320, 550, -494},
+{"SOA", "SOUTH ASIA, Singapore", "FA", 25, 25, 25, 102, 106, 0, 3, 7, -10, -26},
+{"SPK-A", "S-42 (PULKOVO 1942), Hungary", "KA", 2, 2, 2, 11, 29, 40, 54, 28, -121, -77},
+{"SPK-B", "S-42 (PULKOVO 1942), Poland", "KA", 4, 2, 4, 8, 30, 43, 60, 23, -124, -82},
+{"SPK-C", "S-42 (PK42) Former Czechoslov.", "KA", 3, 3, 2, 6, 28, 42, 57, 26, -121, -78},
+{"SPK-D", "S-42 (PULKOVO 1942), Latvia", "KA", 2, 2, 2, 15, 34, 50, 64, 24, -124, -82},
+{"SPK-E", "S-42 (PK 1942), Kazakhstan", "KA", 25, 25, 25, 41, 93, 35, 62, 15, -130, -84},
+{"SPK-F", "S-42 (PULKOVO 1942), Albania", "KA", 3, 3, 3, 14, 26, 34, 48, 24, -130, -92},
+{"SPK-G", "S-42 (PULKOVO 1942), Romania", "KA", 3, 5, 3, 15, 35, 38, 54, 28, -121, -77},
+{"SRL", "SIERRA LEONE 1960", "CD", 15, 15, 15, -19, -4, 1, 16, -88, 4, 101},
+{"TAN", "TANANARIVE OBSERVATORY 1925", "IN", -1, -1, -1, 40, 53, -34, -8, -189, -242, -91},
+{"TDC", "TRISTAN ASTRO 1968", "IN", 25, 25, 25, -14, -11, -39, -36, -632, 438, -609},
+{"TIL", "TIMBALAI 1948, Brunei & E Malay", "EA", 10, 10, 12, 101, 125, -5, 15, -679, 669, -48},
+{"TOY-A", "TOKYO, Japan", "BR", 8, 5, 8, 119, 156, 19, 51, -148, 507, 685},
+{"TOY-B", "TOKYO, South Korea", "BR", 8, 5, 8, 120, 139, 27, 45, -146, 507, 687},
+{"TOY-B1", "TOKYO, South Korea", "BR", 2, 2, 2, 120, 139, 27, 45, -147, 506, 687},
+{"TOY-C", "TOKYO, Okinawa", "BR", 20, 5, 20, 119, 134, 19, 31, -158, 507, 676},
+{"TOY-M", "TOKYO, Mean", "BR", 20, 5, 20, 120, 155, 23, 53, -148, 507, 685},
+{"TRN", "ASTRO TERN ISLAND (FRIG) 1961", "IN", 25, 25, 25, -166, -166, 22, 26, 114, -116, -333},
+{"VOI", "VOIROL 1874, Algeria", "CD", -1, -1, -1, -15, 11, 13, 43, -73, -247, 227},
+{"VOR", "VOIROL 1960, Algeria", "CD", 25, 25, 25, -15, 11, 13, 43, -123, -206, 219},
+{"WAK", "WAKE ISLAND ASTRO 1952", "IN", 25, 25, 25, -176, -171, 17, 21, 276, -57, 149},
+{"WGD", "World Geodetic System 1972", "WD", 0, 0, 0, -180.0, 180.0, -90, 90, 0, 0, 0},
+{"WGE", "World Geodetic System 1984", "WE", 0, 0, 0, -180.0, 180.0, -90, 90, 0, 0, 0},
+{"YAC", "YACARE, Uruguay", "IN", -1, -1, -1, -65, -47, -40, -25, -155, 171, 37},
+{"ZAN", "ZANDERIJ, Suriname", "IN", 5, 5, 8, -76, -47, -10, 20, -265, 120, -358},
+{"6055", "Popular Visualisation", "7059", 0, 0, 0, -180.0, 180.0, -85, 85, 0, 0, 0},
+{"", "", "", 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0}
+};
+
+static ossimSevenParamDatumType sevenParamDatum[] = {
+{"EUR-7", "EUROPEAN 1950, Mean (7 Param)", "IN", 0, 0, 0, -180, 180, -90, 90, -102, -102, -129, 2.00228e-06, -8.92057e-07, 1.86653e-06, 2.4664e-06},
+{"OGB-7", "ORDNANCE GB 1936, Mean (7 Para)", "AA", 0, 0, 0, -180, 180, -90, 90, 446, -99, 544, -4.58149e-06, -1.26536e-06, -2.10894e-06, -2.08927e-05},
+{"", "", "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+};
diff --git a/ossim/src/ossim/base/ossimDatumFactoryRegistry.cpp b/src/base/ossimDatumFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDatumFactoryRegistry.cpp
rename to src/base/ossimDatumFactoryRegistry.cpp
diff --git a/src/base/ossimDblGrid.cpp b/src/base/ossimDblGrid.cpp
new file mode 100644
index 0000000..861b5e1
--- /dev/null
+++ b/src/base/ossimDblGrid.cpp
@@ -0,0 +1,1239 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// AUTHOR:  Oscar Kramer (okramer at imagelinks.com)
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimDblGrid. This class maintains
+//   a regular grid of floating point (double) values. Access methods to the
+//   grid include interpolation between grid nodes. Capability is included
+//   to address the grid in an arbitrary, floating-point x, y coordinate
+//   system. 
+//
+//*****************************************************************************
+//  $Id: ossimDblGrid.cpp 23329 2015-05-27 14:24:19Z dburken $
+
+#include <ossim/base/ossimDblGrid.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+
+#include <climits>
+#include <cstring>
+#include <iostream>
+#include <vector>
+using namespace std;
+
+//***
+// Define Trace flags for use within this file:
+//***
+static ossimTrace traceExec  ("ossimDblGrid:exec");
+static ossimTrace traceDebug ("ossimDblGrid:debug");
+
+static const ossimString MAGIC_NUMBER ("OSSIM_DBL_GRID");
+
+/*!****************************************************************************
+*  DEFAULT CONSTRUCTOR: ossimDblGrid
+*  
+*****************************************************************************/
+ossimDblGrid::ossimDblGrid()
+:
+theGridData       (0),
+theSize           (0, 0),
+theOrigin         (0.0, 0.0),
+theSpacing        (0.0, 0.0),
+theMinValue       (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
+theMaxValue       (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
+theNullValue      (OSSIM_DEFAULT_NULL_PIX_DOUBLE),
+theMeanValue      (0.0),
+theDeviation      (0.0),
+theMeanIsComputed (false),
+theExtrapIsEnabled (true),
+theDomainType     (CONTINUOUS)
+{ }
+
+
+/*!****************************************************************************
+*  COPY CONSTRUCTOR: ossimDblGrid
+*  
+*****************************************************************************/
+ossimDblGrid::ossimDblGrid(const ossimDblGrid&  source)
+:
+theGridData   (0),
+theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
+theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
+theExtrapIsEnabled (true),
+theDomainType (CONTINUOUS)
+{
+   static const char MODULE[] = "ossimDblGrid Constructor";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   *this = source;
+   /*!
+   * Allocate mem for the grid, and initialize:
+   */
+   //    int buflen = theSize.x * theSize.y;
+   //    theGridData = new double [buflen];
+
+   //    for (int i=0; i<buflen; i++)
+   //       theGridData[i] = source.theGridData[i];
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+}
+
+/*!****************************************************************************
+*  CONSTRUCTOR: ossimDblGrid
+*  
+*****************************************************************************/
+ossimDblGrid::ossimDblGrid(const ossimIpt&  size, 
+                           const ossimDpt&  origin,
+                           const ossimDpt&  spacing,
+                           double           null_value)
+                           :
+theGridData   (0),
+theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
+theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
+theExtrapIsEnabled (true),
+theDomainType (CONTINUOUS)
+{
+   static const char MODULE[] = "ossimDblGrid Constructor";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   initialize(size, origin, spacing, null_value);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+}
+
+/*!****************************************************************************
+*  CONSTRUCTOR: ossimDblGrid
+*  
+*****************************************************************************/
+ossimDblGrid::ossimDblGrid(const ossimDrect&  rect, 
+                           const ossimDpt&    spacing,
+                           double             null_value)
+                           :
+theGridData   (0),
+theMinValue   (OSSIM_DEFAULT_MIN_PIX_DOUBLE),
+theMaxValue   (OSSIM_DEFAULT_MAX_PIX_DOUBLE),
+theExtrapIsEnabled (true),
+theDomainType (CONTINUOUS)
+{
+   static const char MODULE[] = "ossimDblGrid Constructor";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   ossimIpt size ((int) (rect.width()/spacing.x)  + 1,
+      (int) (rect.height()/spacing.y) + 1);
+
+   initialize(size, rect.ul(), spacing, null_value);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " returning...\n";
+}
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimDblGrid()
+//  
+//*****************************************************************************
+ossimDblGrid::~ossimDblGrid()
+{
+   if(theGridData)
+   {
+      delete [] theGridData;
+      theGridData = NULL;
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimDblGrid::initialize()
+//  
+//  Permits initialization after construction
+//  
+//*****************************************************************************
+void ossimDblGrid::initialize(const ossimIpt&  size, 
+                              const ossimDpt&  origin,
+                              const ossimDpt&  spacing,
+                              double           null_value)
+{
+   static const char MODULE[] = "ossimDblGrid::initialize()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " entering...\n";
+
+   //***
+   // Delete any existing grid:
+   //***
+   if (theGridData)
+   {
+      delete [] theGridData;
+      theGridData = 0;
+   }
+
+   //***
+   // Initialize data members:
+   //***
+   theSize           = size;
+   theOrigin         = origin;
+   theSpacing        = spacing;
+   theNullValue      = null_value;
+   theMinValue       = OSSIM_DEFAULT_MIN_PIX_DOUBLE;
+   theMaxValue       = OSSIM_DEFAULT_MAX_PIX_DOUBLE;
+   theMeanIsComputed = false;
+
+   /*!
+   * Allocate mem for the grid, and initialize:
+   */
+   ossim_uint32 buflen = theSize.x * theSize.y;
+   if(buflen > 0)
+   {
+      theGridData = new double [buflen];
+
+      for (ossim_uint32 i=0; i<buflen; i++)
+         theGridData[i] = theNullValue;
+   }   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " returning...\n";
+
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimDblGrid::initialize()
+//  
+//  Permits initialization after construction
+//  
+//*****************************************************************************
+void ossimDblGrid::initialize(const ossimDrect&  uv_rect, 
+                              const ossimDpt&    spacing,
+                              double null_value)
+{
+   static const char MODULE[] = "ossimDblGrid::initialize()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   ossimIpt size ((int) (uv_rect.width()/spacing.x)  + 1,
+      (int) (uv_rect.height()/spacing.y) + 1);
+
+   initialize(size, uv_rect.ul(), spacing, null_value);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+   return;
+}
+
+//**************************************************************************************************
+void ossimDblGrid::deallocate()
+{
+   if(theGridData)
+   {
+      delete [] theGridData;
+      theGridData = 0;
+   }
+   theSize = ossimIpt(0,0); 
+}
+
+/*!****************************************************************************
+* METHOD: ossimDblGrid::setNode(x, y) NON-CONST
+*
+*  This method is used to assign the grid data values.
+*  
+*****************************************************************************/
+void ossimDblGrid::setNode (int x, int y, const double& input) 
+{
+   if(!theGridData) return;
+
+   // Insure the value passed in is allowed:
+   double value = input;
+   constrain(value);
+
+   if ((x>=0)&&(x<theSize.x)&&(y>=0)&&(y<theSize.y))
+   {
+      theGridData[index(x, y)] = value;
+
+      if (value != theNullValue)
+      {
+         if (value < theMinValue)
+            theMinValue = value;
+         if (value > theMaxValue)
+            theMaxValue = value;
+      }
+
+      theMeanIsComputed = false;
+   }
+
+   return;
+}
+
+/*!****************************************************************************
+* METHOD: ossimDblGrid::setNearestNode(uv)
+*
+* Sets the node nearest the U,V point specified to the value given. This is
+* different from setNode() in that the UV coordinate system is used to
+* address a node instead of an XY grid point.
+*  
+*****************************************************************************/
+void ossimDblGrid::setNearestNode (const ossimDpt& uv_point,
+                                   const double&   input) 
+{
+   if(!theGridData) return;
+   
+   // Insure the value passed in is allowed:
+   double value = input;
+   constrain(value);
+
+   //***
+   // Establish the grid indexes:
+   //***
+   int xi = ossim::round<int>((uv_point.u - theOrigin.u)/theSpacing.x);
+   int yi = ossim::round<int>((uv_point.v - theOrigin.v)/theSpacing.y);
+
+   if (xi < 0)
+      xi = 0;
+   if (xi >= theSize.x)
+      xi = theSize.x - 1;
+   if (yi < 0)
+      yi = 0;
+   if (yi >= theSize.y)
+      yi = theSize.y - 1;
+
+   setNode (xi, yi, value);
+
+   return;
+}
+
+/*!****************************************************************************
+* METHOD: ossimDblGrid::getNode(x, y) CONST
+*
+*  This method is used to return the grid data values.
+*  
+*****************************************************************************/
+double ossimDblGrid::getNode (int x, int y) const
+{
+   if(!theGridData) return theNullValue;
+   if ((x>=0)&&(x<theSize.x)&&(y>=0)&&(y<theSize.y))
+   {
+      ossim_uint32 i = index(x, y);
+      double val = theGridData[i];
+      return val;
+   }
+   return theNullValue;
+}
+
+/*!****************************************************************************
+* METHOD: ossimDblGrid::operator(double, double)
+*
+*  This method interpolates between grid points given a fractional location
+*  in UV (external) world space.
+*  
+*****************************************************************************/
+double ossimDblGrid::operator() (const double& u, const double& v) const
+{
+   if(!theGridData) return theNullValue;
+
+   double xi = (u - theOrigin.u)/theSpacing.x;
+   double yi = (v - theOrigin.v)/theSpacing.y;
+
+   if ((xi >= 0.0) && (xi <= (double)theSize.x-1) && (yi >= 0.0) && (yi <= (double)theSize.y-1))
+      return interpolate(xi, yi);
+
+   else if (theExtrapIsEnabled)
+      return extrapolate(xi, yi);
+
+   return theNullValue;
+}
+
+//*************************************************************************************************
+//! Interpolates given non-integral point x, y
+//*************************************************************************************************
+double ossimDblGrid::interpolate(double xi, double yi) const
+{
+   if(!theGridData) 
+      return theNullValue;
+
+   // Establish the grid cell origin indices:
+   int x0 = (int) xi;
+   int y0 = (int) yi;
+
+   // Compute bilinear interpolation weights:
+   double wx1 = xi - x0;
+   double wy1 = yi - y0;
+   double wx0 = 1.0 - wx1;
+   double wy0 = 1.0 - wy1;
+   double w00 = wx0 * wy0;
+   double w01 = wx0 * wy1;
+   double w10 = wx1 * wy0;
+   double w11 = wx1 * wy1;
+
+   // Establish grid indices for 4 surrounding points:
+   int index00  = theSize.x*y0 + x0;
+   int index10 = index00;
+   int index11 = index00;
+   int index01 = index00;
+
+   if (x0 < (theSize.x-1)) index10 = index00 + 1;
+   if (y0 < (theSize.y-1)) index01 = index00 + theSize.x;
+   if (y0 < (theSize.y-1)) index01 = index00 + theSize.x;
+   if (x0 < (theSize.x-1)) index11 = index01 + 1;
+
+   // Safety check:
+   int max_idx = theSize.x * theSize.y;
+   if ((index00 > max_idx) || (index10 > max_idx) || (index11 > max_idx) || (index01 > max_idx))
+      return ossim::nan();
+
+   // Extract the four data points:
+   double p00 = theGridData[index00];
+   double p01 = theGridData[index01];
+   double p10 = theGridData[index10];
+   double p11 = theGridData[index11];
+
+   // Consider the numerical domain to catch any wrap condition:
+   if (theDomainType >= WRAP_180)
+   {
+      double dp01_00 = p01 - p00;
+      double dp10_00 = p10 - p00;
+      double dp11_00 = p11 - p00;
+
+      if (dp01_00 > 180.0)
+         p01 -= 360.0;
+      else if (dp01_00 < -180.0)
+         p01 += 360.0;
+
+      if (dp10_00 > 180.0)
+         p10 -= 360.0;
+      else if (dp10_00 < -180.0)
+         p10 += 360.0;
+
+      if (dp11_00 > 180.0)
+         p11 -= 360.0;
+      else if (dp11_00 < -180.0)
+         p11 += 360.0;
+   }
+
+   // Perform interpolation:
+   double value = (p00*w00 + p01*w01 + p10*w10 + p11*w11) / (w00 + w01 + w10 + w11);
+   constrain(value);
+
+   return value;
+}
+
+//**************************************************************************************************
+//  METHOD: ossimDblGrid::extrapolate()
+//  
+//  Establishes bilinear extrapolation value for point outside of the grid. 
+//
+//**************************************************************************************************
+double ossimDblGrid::extrapolate(double x, double y) const
+{
+   if(!theGridData) 
+      return theNullValue;
+
+
+   // Decide which extra-grid region contains the input point:
+   double dx=0, dy=0, dR_dx=0, dR_dy=0, R0;
+   if (y < 0)
+   {
+      // The point is above the top edge of grid space:
+      dy = y;
+      if (x < 0)
+      {
+         // The point is in the top-left region. Use UL corner alone as reference, and compute first
+         // and second partials:
+         R0 = getNode(0, 0);
+         dx = x;
+         dR_dx = getNode(1, 0) - R0;
+         dR_dy = getNode(0, 1) - R0;
+      }
+      else if (x <= theSize.x-1)
+      {
+         // The point directly above the grid, use the dR_dy of the edge pixel:
+         R0 = interpolate(x, 0);
+         dR_dy = interpolate(x, 1.0) - R0;
+      }
+      else
+      {
+         // The point is in the top-right region:
+         R0 = getNode(theSize.x - 1, 0);
+         dx = x - theSize.x + 1;
+         dR_dx = R0 - getNode(theSize.x-2, 0);
+         dR_dy = getNode(theSize.x-1, 1) - R0;
+      }
+   }
+   else if (y <= theSize.y-1)
+   {
+      // The point is either to the left, the right, or inside of the grid:
+      if (x < 0)
+      {
+         // The point is directly to the left of the grid:
+         R0 = interpolate(0, y);
+         dx = x;
+         dR_dx = interpolate(1.0, y) - R0;
+      }
+      else if (x <= theSize.x-1)
+      {
+         // The point is inside the grid. This should never happen, but handle just in case:
+         return interpolate(x, y);
+      }
+      else 
+      {
+         // The point directly to the right of the grid:
+         R0 = interpolate((double)theSize.x-1, y);
+         dx = x - theSize.x + 1;
+         dR_dx = R0 - interpolate((double)theSize.x-2, y);
+      }
+   }
+   else
+   {
+      // The point is below the bottom edge of grid space:
+      dy = y - theSize.y + 1;
+      if (x < 0)
+      {
+         // The point is in the bottom-left region:
+         R0 = getNode(0, theSize.y-1);
+         dx = x;
+         dR_dx = getNode(1, theSize.y-1) - R0;
+         dR_dy = R0 - getNode(0, theSize.y-2);
+      }
+      else if (x < theSize.x-1)
+      {
+         // The point directly below the grid:
+         R0 = interpolate(x, (double)theSize.y-1);
+         dR_dy = R0 - interpolate(x, (double)theSize.y-2);
+      }
+      else
+      {
+         // The point is in the bottom-right region:
+         R0 = getNode(theSize.x - 1, theSize.y-1);
+         dx = x - theSize.x + 1;
+         dR_dx = R0 - getNode(theSize.x-2, theSize.y-1);
+         dR_dy = R0 - getNode(theSize.x-1, theSize.y-2);
+      }
+   }
+
+   // Consider the numerical domain and adjust potential wrap conditions in the differences:
+   if (theDomainType >= WRAP_180)
+   {
+      if (dR_dx > 180.0) dR_dx -= 360.0;
+      else if (dR_dx < -180.0) dR_dx += 360.0;
+
+      if (dR_dy > 180.0) dR_dy -= 360.0;
+      else if (dR_dy < -180.0) dR_dy += 360.0;
+   }
+
+   double R = R0 + dR_dx*dx + dR_dy*dy;
+   constrain(R);
+   return R;
+}
+
+//*****************************************************************************
+//  OPERATOR: =
+//  
+//*****************************************************************************
+const ossimDblGrid& ossimDblGrid::operator = (const ossimDblGrid& source)
+{
+   if(&source == this) return *this;
+
+   if (theGridData)
+   {
+      delete [] theGridData;
+      theGridData = 0;
+   }
+
+   //***
+   // Assign data members:
+   //***
+   theSize           = source.theSize;
+   theOrigin         = source.theOrigin;
+   theSpacing        = source.theSpacing;
+   theMinValue       = source.theMinValue;
+   theMaxValue       = source.theMaxValue;
+   theNullValue      = source.theNullValue;
+   theMeanValue      = source.theMeanValue;
+   theDeviation      = source.theDeviation;
+   theMeanIsComputed = source.theMeanIsComputed;
+   theDomainType     = source.theDomainType;
+   theExtrapIsEnabled = source.theExtrapIsEnabled;
+
+   //***
+   // Allocate mem for the grid, and initialize:
+   //***
+   int buflen = theSize.x * theSize.y;
+   if(buflen>0)
+   {
+      theGridData = new double [buflen];
+
+      for (int i=0; i<buflen; i++)
+      {
+         theGridData[i] = source.theGridData[i];
+      }
+   }
+
+   return *this;
+}
+
+
+/*!****************************************************************************
+* METHOD: ossimDblGrid::meanValue()
+*  
+*****************************************************************************/
+double  ossimDblGrid::meanValue()
+{
+   static const char MODULE[] = "ossimDblGrid::meanValue()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   if (!theMeanIsComputed)
+   {
+      computeMean();
+   }
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+   return theMeanValue;
+}
+
+/*!****************************************************************************
+* METHOD: ossimDblGrid::meanStdDev()
+*  
+*****************************************************************************/
+double  ossimDblGrid::meanStdDev()
+{
+   static const char MODULE[] = "ossimDblGrid::meanStdDev()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   if (!theMeanIsComputed)
+      computeMean();
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";;
+   return theDeviation;
+}
+
+/*!****************************************************************************
+* METHOD: ossimDblGrid::computeMean()
+*  
+*****************************************************************************/
+void ossimDblGrid::computeMean()
+{
+   static const char MODULE[] = "ossimDblGrid::meanStdDev()";
+   if(!theGridData) return;
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "entering...\n";
+
+   if (!theMeanIsComputed)
+   {
+      double accum = 0.0;
+      double num_samples = 0.0;
+
+      /*!
+      * Loop to compute mean:
+      */
+      for (int i=0; i<(theSize.x*theSize.y); i++)
+      {
+         if (theGridData[i] != theNullValue)
+         {
+            accum += theGridData[i];
+            num_samples += 1.0;
+         }
+      }
+      theMeanValue = accum/num_samples;
+
+      /*!
+      * Loop again to compute deviation:
+      */
+      accum = 0.0;
+      double diff;
+      for (int i=0; i<(theSize.x*theSize.y); i++)
+      {
+         if (theGridData[i] != theNullValue)
+         {
+            diff = theMeanValue - theGridData[i];
+            accum += diff*diff;
+         }
+      }
+      theDeviation = sqrt(accum/num_samples);
+
+      theMeanIsComputed = true;
+   }
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+   return;
+}
+
+/*!****************************************************************************
+* INLINE METHOD: ossimDblGrid::isInside(const ossimDpt& pt) const
+*****************************************************************************/
+bool ossimDblGrid::isInside(const double& u, const double& v) const
+{
+   double xi = (u - theOrigin.u)/theSpacing.x;
+   double yi = (v - theOrigin.v)/theSpacing.y;
+   return ((xi >= 0.0) && (xi <= ((double)theSize.x - 1.0)) &&
+      (yi >= 0.0) && (yi <= ((double)theSize.y - 1.0)));
+   //return ((xi >= 0.0) && (xi < ((double)theSize.x)) &&
+   //        (yi >= 0.0) && (yi < ((double)theSize.y)));
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimDblGrid::save()
+//  
+//  Saves the grid to the stream in compact ASCII format (not necessarily
+//  human readable).
+//  
+//*****************************************************************************
+bool ossimDblGrid::save(ostream& os, const char* descr) const
+{
+   static const char MODULE[] = "ossimDblGrid::save()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   //***
+   // Preserve the stream's settings:
+   //***
+   ios::fmtflags new_options = ios::scientific|ios::dec;
+   //ios::streamsize new_precision = 12;
+   int new_precision = 12;
+
+   ios::fmtflags old_options = os.flags(new_options);
+   int old_precision = os.precision(new_precision);
+
+   //***
+   // Verify the description string is not too long:
+   //***
+   char descr_buf[81];
+   std::strncpy(descr_buf, descr, 80);
+   descr_buf[80] = '\0';
+
+   //***
+   // write magic number tag and the grid size X, Y, num params:
+   //***
+   os << MAGIC_NUMBER << " " << descr_buf << "\n"
+      << theSize.x << "  "
+      << theSize.y << "  "
+      << theOrigin.u << "  "
+      << theOrigin.v << "  "
+      << theSpacing.u << "  "
+      << theSpacing.v << "  "
+      << theNullValue << "  "
+      << (int) theDomainType << "\n";
+
+   if(theGridData)
+   {
+      //***
+      // Loop to write grid points:
+      //***
+      int max_index = theSize.x*theSize.y;
+      for (int i=0; i<max_index; i++)
+         os << theGridData[i] << "  ";
+   }
+   os << "\n";
+
+   //***
+   // Restore the stream's state:
+   //***
+   os.flags(old_options);
+   os.precision(old_precision);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimDblGrid::load()
+//  
+//  Loads the grid from the stream in compact ASCII format (not necessarily
+//  human readable).
+//  
+//*****************************************************************************
+bool ossimDblGrid::load(istream& is)
+{
+   static const char MODULE[] = "ossimDblGrid::load()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+
+   ossimString strbuf;
+
+   //***
+   // Read magic number tag to insure it is an ossimDblGrid record:
+   //***
+   getline(is, strbuf);
+   if (!strbuf.contains(MAGIC_NUMBER))
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << MODULE << "Error reading OSSIM_DBL_GRID magic number from stream. "
+         << "Aborting...\n";
+      return false;
+   }
+
+   theSize           = ossimDpt(0,0);
+   theOrigin         = ossimDpt(0,0);
+   theSpacing        = ossimDpt(0,0);
+   theMinValue       = OSSIM_DEFAULT_MAX_PIX_DOUBLE;
+   theMaxValue       =  OSSIM_DEFAULT_MIN_PIX_DOUBLE;
+  // theNullValue      = theNullValue;
+   theMeanIsComputed = false;
+
+   //***
+   // Read the grid size, origin, and spacing:
+   //***
+   ossimIpt size;
+   ossimDpt origin, spacing;
+   double null_value;
+   getline(is, strbuf);
+   vector<ossimString> items =  strbuf.split(" ", true);
+   if (items.size() < 7)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << MODULE << "Error reading OSSIM_DBL_GRID parameters. "
+         << "Aborting...\n";
+      return false;
+   }
+   size.x = items[0].toInt();
+   size.y = items[1].toInt();
+   origin.u = items[2].toDouble();
+   origin.v = items[3].toDouble();
+   spacing.u = items[4].toDouble();
+   spacing.v = items[5].toDouble();
+   null_value = items[6].toDouble();
+
+   // Check for possible domain type 7th parameter (Added Sep 2016 OLK)
+   if ((items.size() > 7))
+      theDomainType = (DomainType) items[7].toInt();
+
+   initialize(size, origin, spacing, null_value);
+
+   //***
+   // Loop to read grid points:
+   //***
+   int max_index = theSize.x*theSize.y;
+   for (int i=0; i<max_index; i++)
+   {
+      is >> theGridData[i];
+   }
+   getline(is, strbuf);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+
+   return true;
+}
+
+//*****************************************************************************
+//  PRIVATE FUNCTION: isBlocked()
+//  
+//  Used by interpolateNullValuedNodes. Returns true if the direction indicated
+//  by the vector (x, y) has been blocked from further sampling. This occurs if
+//  a sample has already been found in that general direction. The directions
+//  are discrete (16) evenly distributed about a "compass rose." Each index
+//  corresponds to one of the directions as illustrated here:
+//
+//                        15 0 1
+//                     14    |    2
+//                    13     |     3
+//                   12------+------4
+//                    11     |     5
+//                     10    |    6
+//                         9 8 7
+//
+//*****************************************************************************
+bool isBlocked(bool* blocked, int x, int y)
+{
+   if (y == 0)
+   {
+      if (x > 0) return blocked[4];
+      return blocked[12];
+   }
+
+   double r = x/y;
+   int c = 0;
+   int i;
+   if (x < 0.0) c = 8;
+
+   //***
+   // Test the tangent value instead of computing angle:
+   //***
+   if      (r >  5.02734) i = 12 + c;
+   else if (r >  1.49660) i = 13 + c;
+   else if (r >  0.66818) i = 14 + c;
+   else if (r >  0.19891) i = 15 + c;
+   else if (r > -0.19891) i =  0 + c;
+   else if (r > -0.66818) i =  1 + c;
+   else if (r > -1.49660) i =  2 + c;
+   else if (r > -5.02734) i =  3 + c;
+   else                   i =  4 + c;
+
+   if (i > 15) i -= 16;  // modulo 16
+
+   return blocked[i];
+}
+
+//*****************************************************************************
+//  PRIVATE FUNCTION: blockDirection()
+//  
+//  Used by interpolateNullValuedNodes. Blocks the resampler from exploring
+//  further in a general direction, specified by thevector (x, y). The blocking
+//  is requested when a sample is found. This prevents a sample that is shadowed
+//  by a closer sample from having influence.
+//
+//  See method isBlocked() above for a description of the compass rose indexing.
+//  
+//*****************************************************************************
+void blockDirection(bool* blocked, int x, int y)
+{
+   if (y == 0)
+   {
+      if (x > 0) blocked[4] = true;
+      else       blocked[12] = true;
+      return;
+   }
+
+   double r = x/y;
+   int c = 0;
+   int i;
+   if (x < 0.0) c = 8;
+
+   //***
+   // Test the tangent value instead of computing angle:
+   //***
+   if      (r >  5.02734) i = 12 + c;
+   else if (r >  1.49660) i = 13 + c;
+   else if (r >  0.66818) i = 14 + c;
+   else if (r >  0.19891) i = 15 + c;
+   else if (r > -0.19891) i =  0 + c;
+   else if (r > -0.66818) i =  1 + c;
+   else if (r > -1.49660) i =  2 + c;
+   else if (r > -5.02734) i =  3 + c;
+   else                   i =  4 + c;
+
+   if (i > 15) i -= 16;  // modulo 16
+   blocked[i] = true;
+
+   return;
+}
+
+//*****************************************************************************
+//   METHOD: ossimDblGrid::interpolateNullValuedNodes(decay_rate)
+//
+//   This method performs a resampling of the defined grid nodes in order to
+//   compute interpolated values for those uninitialized nodes. This is
+//   necessary when only a subset of nodes are available for initializing the
+//   grid.
+//
+//   The decay rate is a geometric (1/r) factor applied to the weights to
+//   amplify the rate at which a neighbor's influence diminishes. For a
+//   decay_rate = 1, the influence of a sample diminishes linearly with the
+//   distance.
+//  
+//*****************************************************************************
+void ossimDblGrid::interpolateNullValuedNodes(const double& decay_rate)
+{
+   static const char MODULE[] = "ossimDblGrid::interpolateNullValuedNodes()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering...\n";
+   if(!theGridData) return;
+
+   //***
+   // Allocate buffer to store resampled nodes:
+   //***
+   int buf_size = theSize.x*theSize.y;
+
+   //---
+   // Note: Changed resampled_grid from double* to vector<double> to fix
+   // coverity scan uninitialized error. This calls the fill constructor.
+   // drb - 20150527
+   //---
+   std::vector<double> resampled_grid( buf_size, 0.0 );
+
+   double min_weight_needed = 4.0/decay_rate;
+
+   int      start_x, start_y, end_x, end_y;
+   int      diameter;
+   double   sum_weights;
+   double   accumulator;
+   double   weight;
+   double   sample;
+   double   node_value;
+   bool     sample_found;
+   int      node_idx;
+   double   adj_delta;
+   int      dx, dy;
+   bool     blocked[16];
+
+   //***
+   // Loop over the entire grid to resample all NULL nodes:
+   //***
+   for (int y=0; y<theSize.y; ++y)
+   {
+      for (int x=0; x<theSize.x; ++x)
+      {
+         //***
+         // Only resample those nodes that contain NULL:
+         //***
+         node_idx = index(x, y);
+         node_value = theGridData[node_idx];
+         if (node_value != theNullValue)
+         {
+            //***
+            // This node had a value. Simply copy it into the resample_grid:
+            //***
+            resampled_grid[node_idx] = node_value;
+         }
+
+         else
+         {
+            //***
+            // Resampling is necessary. Initialize quantities used:
+            //***
+            start_x = x;
+            start_y = y;
+            diameter = 0;
+            sum_weights = 0;
+            accumulator = 0;
+            weight = 1.0;
+            sample_found = true;
+
+            for (int i=0; i<16; i++)
+               blocked[i] = false;
+
+            //***
+            // Loop collecting contributions from non-null neighbors. Begin with
+            // a small kernel size (diameter) and successively grow until a
+            // sufficient number of contributors is found:
+            //***
+            while ((sum_weights < min_weight_needed) && sample_found)
+            {
+               diameter += 2;
+               start_x -= 1;
+               start_y -= 1;
+               weight *= decay_rate;
+               sample_found = false;
+
+               //***
+               // Loop over each pixel in kernel and sum in it's contribution:
+               //***
+               end_y = start_y + diameter;
+               end_x = start_x + diameter;
+
+               for (int yn=start_y; yn<=end_y; ++yn)
+               {
+                  if ((yn == start_y) || (yn == end_y))
+                  {
+                     //***
+                     // This is the top edge or bottom edge, need samples from
+                     // each x along kernel edge:
+                     //***
+                     for (int xn=start_x; xn<=end_x; ++xn)
+                     {
+                        sample_found = sample_found || isInside(xn, yn);
+                        sample = getNode(xn, yn);
+                        if (sample != theNullValue)
+                        {
+                           dx = x - xn; dy = y - yn;
+                           if (!isBlocked(blocked, dx, dy))
+                           {
+                              adj_delta = weight*sqrt((double)(dx*dx + dy*dy));
+                              accumulator += sample/adj_delta;
+                              sum_weights += 1.0/adj_delta;
+                              blockDirection(blocked, dx, dy);
+                           }
+                        }
+                     }
+                  }
+                  else
+                  {
+                     //***
+                     // For the left/right edge of the kernel, need to sample
+                     // only the first (start_x) and last (end_x):
+                     //***
+                     sample_found = sample_found || isInside(start_x, yn);
+                     sample = getNode(start_x, yn);
+                     if (sample != theNullValue)
+                     {
+                        dx = x - start_x; dy = y - yn;
+                        if (!isBlocked(blocked, dx, dy))
+                        {
+                           adj_delta = weight*sqrt((double)(dx*dx + dy*dy));
+                           accumulator += sample/adj_delta;
+                           sum_weights += 1.0/adj_delta;
+                           blockDirection(blocked, dx, dy);
+                        }
+                     }
+
+                     sample_found = sample_found || isInside(end_x, yn);
+                     sample = getNode(end_x, yn);
+                     if (sample != theNullValue)
+                     {
+                        dx = x - end_x; dy = y - yn;
+                        if (!isBlocked(blocked, dx, dy))
+                        {
+                           adj_delta = weight*sqrt((double)(dx*dx + dy*dy));
+                           accumulator += sample/adj_delta;
+                           sum_weights += 1.0/adj_delta;
+                           blockDirection(blocked, dx, dy);
+                        }
+                     }
+                  } // end else
+               } // end for loop over all rows in kernel
+            } // end while loop inflating kernel size
+
+            //***
+            // Finished collecting sample contributions for this node. compute
+            // convolution and save in buffer:
+            //***
+            if (sum_weights != 0)
+               resampled_grid[node_idx] = accumulator/sum_weights;
+            else
+               resampled_grid[node_idx] = theNullValue;
+
+         } // end else (if input node is NULL)
+      } // end for loop over all columns in grid
+   } // end for loop over all lines in grid
+
+   //***
+   // Now copy the resampled grid back into the original buffer:
+   //***
+   for (node_idx=0; node_idx<buf_size; node_idx++)
+      theGridData[node_idx] = resampled_grid[node_idx];
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimDblGrid::filter(size_x, size_y, kernel)
+//  
+//  Passes the grid data through a convolution filter given in the kernel array.
+//  The grid must not contain any NULL nodes as these are not scanned for.
+//  The kernel sizes should be odd numbers.
+//  
+//*****************************************************************************
+void ossimDblGrid::filter(int size_x, int size_y, double* kernel)
+{
+   static const char MODULE[] = "ossimDblGrid::filter()";
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "entering...\n";
+   if(!theGridData) return;
+
+   int      rx      = (size_x - 1)/2;     // kernel radii
+   int      ry      = (size_y - 1)/2;     
+   int      start_x = rx;                 // indexes to start sampling grid
+   int      start_y = ry;
+   int      end_x   = theSize.x - rx;     // indexes to end buffer sampling
+   int      end_y   = theSize.y - ry;
+   int      knl_ctr = ry*size_x + rx;     // offset to center of kernel buffer
+   double   node_value, kernel_value;
+   int      resample_node_idx;
+   
+   // The resampled data is accumulated and stored in a temporary ossimDblGrid object so that we
+   // can take advantage of the extrapolation feature later in this method.
+   ossimIpt resample_grid_size(end_x-start_x, end_y-start_y);
+   ossimDpt resample_grid_origin(start_x, start_y);
+   ossimDpt resample_grid_spacing(1,1);
+   ossimDblGrid resample_grid(resample_grid_size, resample_grid_origin, resample_grid_spacing);
+   resample_grid.enableExtrapolation();
+   resample_grid.fill(0.0);
+
+   // Loop over the entire grid to resample all NULL nodes:
+   for (int y=start_y; y<end_y; y++)
+   {
+      for (int x=start_x; x<end_x; x++)
+      {
+         resample_node_idx = resample_grid.index(x-start_x, y-start_y);
+      
+         // Fetch samples for each kernel element, apply gain, then accumulate
+         // in output buffer:
+         for (int ky=-ry; ky<=ry; ky++)
+         {
+            for (int kx=-rx; kx<=rx; kx++)
+            {
+               node_value = theGridData[index(x+kx, y+ky)];
+               kernel_value = kernel[knl_ctr + ky*size_x + kx];
+               resample_grid.theGridData[resample_node_idx] += kernel_value*node_value;
+            }
+         }
+      }
+   }
+   
+   // Copy the resampled data to the original grid.
+   // Note: the grid margin has unfiltered data due to the kernel radius. Use the resample_grid's
+   // inherent extrapolator to fill in these unfiltered border nodes:
+   for (int y=0; y<theSize.y; y++)
+   {
+      for (int x=0; x<theSize.x; x++)
+      {
+         theGridData[index(x, y)] = resample_grid(x, y); // automatically extrapolates if necessary
+      }
+   }
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " returning...\n";
+   return;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimDblGrid::fill
+//  
+//  Fills the current grid with constant value provided.
+//  
+//*****************************************************************************
+void ossimDblGrid::fill(double fill_value)
+{
+   if (!theGridData)
+   {
+      return;
+   }
+
+   int size = theSize.x * theSize.y;
+   for (int i=0; i<size; i++)
+      theGridData[i] = fill_value;
+
+   return;
+}
+
+//*************************************************************************************************
+// Constrains the value to the numerical domain specified in theDomainType.
+//*************************************************************************************************
+void ossimDblGrid::constrain(double& value) const
+{
+   if ((theDomainType == CONTINUOUS) || (value == theNullValue))
+      return;
+      
+   // Consider again the domain to verify the value is within allowable range:
+   if (theDomainType == WRAP_180) 
+   {
+      if (value <= -180.0)
+         value += 360.0;
+      else if (value > 180.0) 
+         value -= 360.0;
+   }
+   else if (theDomainType == WRAP_360)
+   {
+      if (value < 0.0) 
+         value += 360.0;
+      else if (value >= 360.0) 
+         value -= 360.0;
+   }
+   //else if (theDomainType == SAWTOOTH_90)
+   //{
+   //   // Any adjustment here corrupts the data value since it is clipped:
+   //   if (value < -90.0) 
+   //      value = -90.0;
+   //   else if (value > 90.0) 
+   //      value = 90.0;
+   //}
+}
+
+//*****************************************************************************
+//  FRIEND OPERATOR: ostream& << (ostream&) 
+//  
+//*****************************************************************************
+ostream& operator<<(ostream& os, const ossimDblGrid& grid) 
+{
+   os << "\nDump of ossimDblGrid at " << (void*) &grid
+      << "\n  theSize: "           << grid.theSize
+      << "\n  theOrigin: "         << grid.theOrigin
+      << "\n  theSpacing: "        << grid.theSpacing
+      << "\n  theMinValue: "       << grid.theMinValue
+      << "\n  theMaxValue: "       << grid.theMaxValue
+      << "\n  theNullValue: "      << grid.theNullValue
+      << "\n  theMeanValue: "      << grid.theMeanValue
+      << "\n  theDeviation: "      << grid.theDeviation
+      << "\n  theMeanIsComputed: " << grid.theMeanIsComputed
+      << "\n";
+
+   if(grid.theGridData)
+   {
+
+      for (int y=0; y<grid.theSize.y; y++)
+      {
+         for (int x=0; x<grid.theSize.x; x++)
+         {
+            os << "\n  node(" << x << ", " << y << "): " << grid.getNode(x,y);
+         }
+      }
+   }
+
+   return os;
+}
diff --git a/src/base/ossimDirectory.cpp b/src/base/ossimDirectory.cpp
new file mode 100644
index 0000000..cc7a61b
--- /dev/null
+++ b/src/base/ossimDirectory.cpp
@@ -0,0 +1,319 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: A brief description of the contents of the file.
+//
+//*************************************************************************
+// $Id: ossimDirectory.cpp 20229 2011-11-08 17:01:17Z oscarkramer $
+
+#include <cstring> /* for strncasecmp */
+#include <iostream>
+
+#if defined (_WIN32)
+#include <io.h>
+#include <direct.h>
+#else
+#include <ossim/base/ossimDirectoryData.h>
+#endif
+#ifdef __BORLANDC__
+# include <dir.h>
+#include <direct.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <io.h>
+#define _chdir chdir
+#endif
+
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimRegExp.h>
+
+//#include "wx/filefn.h"          // for wxMatchWild
+
+// #include <sys/types.h>
+
+// #include <dirent.h>
+
+// ----------------------------------------------------------------------------
+// ossimDirectory construction/destruction
+// ----------------------------------------------------------------------------
+
+#if defined (_WIN32)
+ossimDirectory::ossimDirectory()
+   :
+      theData(0),
+      theDirectoryName(),
+      theFlags(0)
+{}
+
+ossimDirectory::ossimDirectory(const ossimFilename &dirname)
+   :
+      theData(0),
+      theDirectoryName(dirname),
+      theFlags(0)
+{
+   open(dirname);
+}
+
+ossimDirectory::~ossimDirectory()
+{
+   if (theData != 0) _findclose( theData );
+}
+
+bool ossimDirectory::open(const ossimFilename &dirname)
+{
+   // close out currently open directory
+   if (theData != 0)
+   {
+      _findclose( theData );
+      theData = 0;
+   }
+   
+   // set new directory name
+   theDirectoryName = dirname;
+
+	return (dirname.isDir());
+   // cd to the new directory
+//   if (_chdir( theDirectoryName) == -1)
+//   {
+//      return false;
+//   }
+   
+//   return true;
+}
+
+bool ossimDirectory::getFirst(ossimFilename &filename, int flags)
+{
+   struct _finddata_t c_file;
+   ossimFilename temp;
+   //long theData1 = _findfirst( "*.*", &c_file );
+   ossimFilename dirName = theDirectoryName.dirCat("*");
+   if( (theData = _findfirst( dirName.c_str(), &c_file )) != 0L )
+   {
+      setFlags(flags);
+      
+      temp = theDirectoryName.dirCat(c_file.name);
+      
+	  
+      while (!fileMatched(temp))
+      {
+         // look for next file in the directory
+         if (_findnext( theData, &c_file ) == 0 )
+         {
+            temp = theDirectoryName.dirCat(c_file.name);
+         }
+         else
+         {
+            // no more file in the directory
+            filename.clear();
+            return false;
+         }
+      }
+   }
+
+   // set the filenane that matches
+   filename = temp.trim();
+
+   return (filename!="");
+}
+
+bool ossimDirectory::getNext(ossimFilename &filename) const
+{
+   struct _finddata_t c_file;
+   bool matches = false;
+   ossimFilename temp;
+
+   while (!matches )
+   {
+      // look for next file in the directory
+      if (_findnext( theData, &c_file ) == 0 )
+      {
+         temp = theDirectoryName.dirCat(c_file.name);
+         matches = fileMatched(temp);
+      }
+      else
+      {
+         // no more file in the directory
+         filename.clear();
+         return false;
+      }
+   }
+
+   // set the filenane that matches
+   if (matches)
+   {
+      filename = temp.trim();
+   }
+
+   return (matches&&(filename!=""));
+}
+
+bool ossimDirectory::fileMatched(ossimFilename &filename) const
+{
+   bool matches = false;
+
+   // Don't return "." and ".." unless asked for.
+   if ( (filename.file() == "..") || (filename.file() == ".")   )
+   {
+      if (theFlags & ossimDirectory::OSSIM_DIR_DOTDOT)
+      {
+         matches = true;
+      }
+   }
+   else if((filename.isDir()) && (theFlags & ossimDirectory::OSSIM_DIR_DIRS))
+   {
+      matches = true;
+   }
+   else if((filename.isFile()) && (theFlags & ossimDirectory::OSSIM_DIR_FILES))
+   {
+      matches = true;
+   }
+
+   return matches;
+}
+
+bool ossimDirectory::isOpened() const
+{
+   return theDirectoryName.isDir();
+    //return theData != 0;
+}
+
+#else
+
+ossimDirectory::ossimDirectory()
+   :
+      theData(NULL)
+{}
+
+ossimDirectory::ossimDirectory(const ossimFilename &dirname)
+{
+    theData = NULL;
+    open(dirname);
+}
+
+bool ossimDirectory::open(const ossimFilename &dirname)
+{
+    delete theData;
+    theData = new ossimDirectoryData(dirname);
+
+    if ( theData &&
+         (!theData->isOk()) )
+    {
+        delete theData;
+        theData = NULL;
+
+        return false;
+    }
+
+    return true;
+}
+
+ossimDirectory::~ossimDirectory()
+{
+    delete theData;
+}
+
+// ----------------------------------------------------------------------------
+// ossimDirectory enumerating
+// ----------------------------------------------------------------------------
+
+bool ossimDirectory::getFirst(ossimFilename &filename,
+                              int flags)
+{
+   if(theData && isOpened())
+   {
+      theData->rewind();
+
+      theData->setFlags(flags);
+
+      return getNext(filename);
+   }
+
+   return false;
+}
+
+bool ossimDirectory::getNext(ossimFilename &filename) const
+{
+   if(theData && isOpened())
+   {
+      return theData->read(filename);
+   }
+
+   return false;
+}
+
+bool ossimDirectory::isOpened() const
+{
+    return theData != NULL;
+}
+
+#endif
+
+void ossimDirectory::findAllFilesThatMatch(std::vector<ossimFilename>& result,
+					   const ossimString& regularExpressionPattern,
+					   int flags)
+{
+   ossimFilename filename;
+   ossimRegExp   regExpr;
+   regExpr.compile(regularExpressionPattern.c_str());
+   if(getFirst(filename, flags))
+   {
+      do
+      {
+         ossimString fileOnly = filename.file();
+         if(regExpr.find(fileOnly.c_str()))
+         {
+            result.push_back(filename);
+         }
+      }while(getNext(filename));
+   }
+}
+
+// ESH 07/2008, Trac #234: OSSIM is case sensitive 
+// when using worldfile templates during ingest
+bool ossimDirectory::findCaseInsensitiveEquivalents(
+   const ossimFilename &filename, 
+   std::vector<ossimFilename>& result,
+   bool bExcludeExactMatch )
+{
+   bool bSuccess = false;
+   ossimFilename candidate;
+   bool bFoundCandidate = getFirst( candidate );
+   int compareSize = static_cast<int>( filename.length() );
+   
+   while( bFoundCandidate == true )
+   {
+      // Do a case insensitive string compare
+#if defined (_WIN32)
+      bool bFoundEquivalent = _strnicmp( filename.c_str(), candidate.c_str(), 
+                                         compareSize ) == 0 ? true : false;
+#else
+      //bool bFoundEquivalent =  strnicmp( filename.c_str(), candidate.c_str(), // 
+      //                                         compareSize ) == 0 ? true : false;
+      bool bFoundEquivalent =  strncasecmp( filename.c_str(), candidate.c_str(), 
+                                            compareSize ) == 0 ? true : false;
+#endif
+      
+      if ( bFoundEquivalent == true )
+      {
+         bool bFoundExact = ( filename == candidate.c_str() ) ? true : false;
+         bool bShouldExclude = ( bFoundExact == true && 
+                                 bExcludeExactMatch == true ) ? true : false;
+         
+         if ( bShouldExclude == false )
+         {
+            bSuccess = true;
+            result.push_back( candidate );
+         }
+      }
+      
+      bFoundCandidate = getNext( candidate );
+   }
+   
+   return bSuccess;
+}
diff --git a/ossim/src/ossim/base/ossimDirectoryData.cpp b/src/base/ossimDirectoryData.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDirectoryData.cpp
rename to src/base/ossimDirectoryData.cpp
diff --git a/ossim/src/ossim/base/ossimDirectoryTree.cpp b/src/base/ossimDirectoryTree.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDirectoryTree.cpp
rename to src/base/ossimDirectoryTree.cpp
diff --git a/src/base/ossimDisplayEventListener.cpp b/src/base/ossimDisplayEventListener.cpp
new file mode 100644
index 0000000..0f30a2f
--- /dev/null
+++ b/src/base/ossimDisplayEventListener.cpp
@@ -0,0 +1,48 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id
+
+#include <ossim/base/ossimDisplayEventListener.h>
+#include <ossim/base/ossimDisplayListEvent.h>
+#include <ossim/base/ossimDisplayRefreshEvent.h>
+
+RTTI_DEF1(ossimDisplayEventListener, "ossimDisplayEventListener", ossimListener);
+
+ossimDisplayEventListener::ossimDisplayEventListener()
+   : ossimListener()
+{
+}
+
+ossimDisplayEventListener::~ossimDisplayEventListener()
+{
+}
+
+void ossimDisplayEventListener::processEvent(ossimEvent& event)
+{
+   ossimDisplayListEvent* displayListEvtPtr = dynamic_cast<ossimDisplayListEvent*>(&event);
+
+   if(displayListEvtPtr)
+   {
+      displayListEvent(*displayListEvtPtr);
+   }
+
+   ossimDisplayRefreshEvent* displayRefreshEvt = dynamic_cast<ossimDisplayRefreshEvent*>(&event);
+   if(displayRefreshEvt)
+   {
+      displayRefreshEvent(*displayRefreshEvt);
+   }
+   
+}
+
+void ossimDisplayEventListener::displayListEvent(ossimDisplayListEvent&)
+{
+}
+
+void ossimDisplayEventListener::displayRefreshEvent(ossimDisplayRefreshEvent&)
+{
+}
diff --git a/src/base/ossimDisplayInterface.cpp b/src/base/ossimDisplayInterface.cpp
new file mode 100644
index 0000000..da31439
--- /dev/null
+++ b/src/base/ossimDisplayInterface.cpp
@@ -0,0 +1,31 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimDisplayInterface.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/base/ossimDisplayInterface.h>
+
+RTTI_DEF(ossimDisplayInterface, "ossimDisplayInterface");
+
+ossimDisplayInterface::ossimDisplayInterface()
+{
+}
+
+ossimDisplayInterface::~ossimDisplayInterface()
+{
+}
+
+ossimString ossimDisplayInterface::getTitle()const
+{
+   ossimString result;
+   
+   getTitle(result);
+   
+   return result;
+}
diff --git a/ossim/src/ossim/base/ossimDisplayListEvent.cpp b/src/base/ossimDisplayListEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDisplayListEvent.cpp
rename to src/base/ossimDisplayListEvent.cpp
diff --git a/ossim/src/ossim/base/ossimDisplayRefreshEvent.cpp b/src/base/ossimDisplayRefreshEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDisplayRefreshEvent.cpp
rename to src/base/ossimDisplayRefreshEvent.cpp
diff --git a/ossim/src/ossim/base/ossimDms.cpp b/src/base/ossimDms.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDms.cpp
rename to src/base/ossimDms.cpp
diff --git a/src/base/ossimDoubleGridProperty.cpp b/src/base/ossimDoubleGridProperty.cpp
new file mode 100644
index 0000000..89612d2
--- /dev/null
+++ b/src/base/ossimDoubleGridProperty.cpp
@@ -0,0 +1,159 @@
+#include <sstream>
+#include <ossim/base/ossimDoubleGridProperty.h>
+
+RTTI_DEF1(ossimDoubleGridProperty, "ossimDoubleGridProperty", ossimProperty);
+
+ossimDoubleGridProperty::ossimDoubleGridProperty(const ossimString& name,
+						 int /* numberOfRows */,
+						 int /* numberOfCols */,
+						 const std::vector<double>& /* values*/ )
+  :ossimProperty(name),
+   theMinNumberOfCols(-1),
+   theMaxNumberOfCols(-1),
+   theMinNumberOfRows(-1),
+   theMaxNumberOfRows(-1)
+{
+
+}
+
+ossimDoubleGridProperty::ossimDoubleGridProperty(const ossimDoubleGridProperty& rhs)
+  :ossimProperty(rhs),
+  theMinNumberOfCols(rhs.theMinNumberOfCols),
+  theMaxNumberOfCols(rhs.theMaxNumberOfCols),
+  theMinNumberOfRows(rhs.theMinNumberOfRows),
+  theMaxNumberOfRows(rhs.theMaxNumberOfRows),
+  theValues(rhs.theValues)
+{
+}
+
+ossimDoubleGridProperty::~ossimDoubleGridProperty()
+{
+}
+
+ossimObject* ossimDoubleGridProperty::dup()const
+{
+  return new ossimDoubleGridProperty(*this);
+}
+
+const ossimProperty& ossimDoubleGridProperty::assign(const ossimProperty& rhs)
+{
+  ossimProperty::assign(rhs);
+  const ossimDoubleGridProperty* rhsPtr = dynamic_cast<const ossimDoubleGridProperty*>(&rhs);
+  if(rhsPtr)
+  {
+     theMinNumberOfCols = rhsPtr->theMinNumberOfCols;
+     theMaxNumberOfCols = rhsPtr->theMaxNumberOfCols;
+     theMinNumberOfRows = rhsPtr->theMinNumberOfRows;
+     theMaxNumberOfRows = rhsPtr->theMaxNumberOfRows;
+     theValues          = rhsPtr->theValues;
+  }
+  else
+  {
+     setValue(rhs.valueToString());  
+  }
+  
+  return *this;
+}
+
+  
+bool ossimDoubleGridProperty::setValue(const ossimString& value)
+{
+   std::istringstream in(value.c_str());
+   ossimString nRows, nCols, v;
+   int numberOfRows=0;
+   int numberOfCols=0;
+   int rowIdx = 0;
+   int colIdx = 0;
+   in >> nRows >> nCols;
+   numberOfRows = nRows.toInt32();
+   numberOfCols = nCols.toInt32();
+   theValues.resize(numberOfRows);
+   
+   for(rowIdx = 0; rowIdx < numberOfRows; ++rowIdx)
+   {
+      theValues[rowIdx].resize(numberOfCols);
+      for(colIdx = 0; colIdx < numberOfCols; ++ colIdx)
+      {
+         in >> v;
+         theValues[rowIdx][colIdx] = v.toDouble();
+      }
+   }
+   
+   return true;
+}
+
+void ossimDoubleGridProperty::valueToString(ossimString& valueResult)const
+{
+  std::ostringstream out;
+  int rowIdx = 0;
+  int colIdx = 0;
+  out << getNumberOfRows() << " " << getNumberOfCols() << " ";
+
+  for(rowIdx = 0; rowIdx < (int)getNumberOfRows(); ++rowIdx)
+    {
+      for(colIdx = 0; colIdx < (int)getNumberOfCols(); ++colIdx)
+	{
+	  out << ossimString::toString(getValue(rowIdx, colIdx)) << " ";
+	}
+    }
+  valueResult = out.str();
+}
+
+void ossimDoubleGridProperty::clearConstraints()
+{
+  theMinNumberOfCols = -1;
+  theMaxNumberOfCols = -1;
+  theMinNumberOfRows = -1;
+  theMaxNumberOfRows = -1;
+}
+
+void ossimDoubleGridProperty::setColConstraints(int minNumberOfCols,
+		  int maxNumberOfCols)
+{
+  theMinNumberOfCols = minNumberOfCols;
+  theMaxNumberOfCols = maxNumberOfCols;
+}
+
+void ossimDoubleGridProperty::setRowConstraints(int minNumberOfRows,
+						int maxNumberOfRows)
+{
+  theMinNumberOfRows = minNumberOfRows;
+  theMaxNumberOfRows = maxNumberOfRows;
+}
+
+void ossimDoubleGridProperty::setContraints(int minNumberOfRows,
+					    int maxNumberOfRows,
+					    int minNumberOfCols,
+					    int maxNumberOfCols)
+{
+  theMinNumberOfRows = minNumberOfRows;
+  theMaxNumberOfRows = maxNumberOfRows;
+  theMinNumberOfCols = minNumberOfCols;
+  theMaxNumberOfCols = maxNumberOfCols;
+}
+
+ossim_uint32 ossimDoubleGridProperty::getNumberOfRows()const
+{
+  return ((int)theValues.size());
+}
+
+ossim_uint32 ossimDoubleGridProperty::getNumberOfCols()const
+{
+  if(getNumberOfRows())
+    {
+      return (ossim_uint32)theValues[0].size();
+    }
+  return 0;
+}
+
+double ossimDoubleGridProperty::getValue(ossim_uint32 row, 
+					 ossim_uint32 col)const
+{
+  if((row < getNumberOfRows())&&
+     (col < getNumberOfCols()))
+    {
+      return theValues[(int)row][(int)col];
+    }
+
+  return 0.0;
+}
diff --git a/ossim/src/ossim/base/ossimDpt.cpp b/src/base/ossimDpt.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimDpt.cpp
rename to src/base/ossimDpt.cpp
diff --git a/src/base/ossimDpt3d.cpp b/src/base/ossimDpt3d.cpp
new file mode 100644
index 0000000..ab972c8
--- /dev/null
+++ b/src/base/ossimDpt3d.cpp
@@ -0,0 +1,206 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimDpt3d.cpp 22937 2014-11-01 11:30:13Z okramer $
+
+#include <sstream>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimString.h>
+
+
+ossimDpt3d::ossimDpt3d(const ossimDpt &aPt)
+   :x(aPt.x),
+    y(aPt.y),
+    z(0)
+{
+   if(aPt.isNan())
+   {
+      makeNan();
+   }
+}
+
+ossimDpt3d::ossimDpt3d(const ossimIpt &aPt)
+   :x(aPt.x),
+    y(aPt.y),
+    z(0)
+{
+   if(aPt.isNan())
+      makeNan();
+}
+
+ossimDpt3d::ossimDpt3d(const ossimGpt &gPt)
+{
+   if(gPt.hasNans())
+   {
+      makeNan();
+   }
+   else
+   {
+      ossimGpt wgs84Pt (gPt);
+      wgs84Pt.changeDatum(ossimDatumFactory::instance()->wgs84());
+      x = wgs84Pt.lon;
+      y = wgs84Pt.lat;
+      z = wgs84Pt.hgt;
+   }
+}
+
+
+std::string ossimDpt3d::toString(ossim_uint32 precision) const
+{
+   std::ostringstream os;
+   os <<  setprecision(precision);
+   
+   os << "(";
+   if ( ossim::isnan(x) == false)
+   {
+      os << x;
+   }
+   else
+   {
+      os << "nan";
+   }
+   os << ",";
+   if ( ossim::isnan(y) == false )
+   {
+      os << y;
+   }
+   else
+   {
+      os << "nan";
+   }
+   os << ",";
+   if ( ossim::isnan(z) == false )
+   {
+      os << z;
+   }
+   else
+   {
+      os << "nan";
+   }
+   os << ")";
+   
+   return os.str();
+}
+
+void ossimDpt3d::toPoint(const std::string& s)
+{
+   // Nan out the column vector for starters.
+   x = ossim::nan();
+   y = ossim::nan();
+   z = ossim::nan();
+  
+   std::istringstream is(s);
+
+   // Check the stream.
+   if (!is) return;
+
+   //---
+   // Expected input format:
+   // ( 0.0000000, 0.0000000, 0.00000000 )
+   //   -----x---- -----y---- -----z----
+   //---
+   
+   const int SZ = 64; // Handle real big number...
+   ossimString os;
+   char buf[SZ];
+   char c = 0;
+
+   //---
+   // X SECTION:
+   //---
+   
+   // Grab data up to the first comma.
+   is.get(buf, SZ, ',');
+
+   if (!is) return;
+
+   // Copy to ossim string.
+   os = buf;
+   
+   // Get rid of the '(' if there is any.
+   std::string::size_type pos = os.find('(');
+   if (pos != std::string::npos)
+   {
+      os.erase(pos, 1);
+   }   
+   
+   if (os.contains("nan") == false)
+   {
+      x = os.toFloat64();
+   }
+   else
+   {
+      x = ossim::nan();
+   }
+
+   // Eat the comma that we stopped at.
+   while (c != ',')
+   {
+      is.get(c);
+      if (!is) break;
+   }
+   
+   //---
+   // Y SECTION:
+   //---
+   
+   // Grab the data up to the next ','
+   is.get(buf, SZ, ',');
+
+   if (!is) return;
+   
+   // Copy to ossim string.
+   os = buf;
+   
+   if (os.contains("nan") == false)
+   {
+      y = os.toFloat64();
+   }
+   else
+   {
+      y = ossim::nan();
+   }
+   
+   // Eat the comma that we stopped at.
+   c = 0;
+   while (c != ',')
+   {
+      is.get(c);
+      if (!is) break;
+   }
+
+   //---
+   // Z SECTION:
+   //---
+   
+   // Grab the data up to the ')'
+   is.get(buf, SZ, ')');
+   
+   if (!is) return;
+   
+   // Copy to ossim string.
+   os = buf;
+   
+   if (os.contains("nan") == false)
+   {
+      z = os.toFloat64();
+   }
+   else
+   {
+      z = ossim::nan();
+   }
+}
+
+std::ostream& operator<< (std::ostream& out, const ossimDpt3d &rhs)
+{
+   std::string s = rhs.toString(15);
+   out << s;
+   return out;
+}
diff --git a/src/base/ossimDrect.cpp b/src/base/ossimDrect.cpp
new file mode 100644
index 0000000..6aae3f1
--- /dev/null
+++ b/src/base/ossimDrect.cpp
@@ -0,0 +1,858 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimDrect.
+//*******************************************************************
+//  $Id: ossimDrect.cpp 23372 2015-06-12 13:08:53Z gpotts $
+
+#include <iostream>
+#include <sstream>
+
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+// XXX not replaced with std::max since the test is backward here
+//     and will give a different answer in the case of nan.
+#define d_MAX(a,b)      (((a)>(b)) ? a : b)
+
+static int
+clip_1d (double *x0, 
+	 double *y0, 
+	 double *x1, 
+	 double *y1, 
+	 double maxdim)
+{
+   double m;			/* gradient of line */
+   if (*x0 < 0)
+   {				/* start of line is left of window */
+      if (*x1 < 0)		/* as is the end, so the line never cuts the window */
+         return 0;
+      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
+      /* adjust x0 to be on the left boundary (ie to be zero), and y0 to match */
+      *y0 -= m * *x0;
+      *x0 = 0;
+      /* now, perhaps, adjust the far end of the line as well */
+      if (*x1 > maxdim)
+      {
+         *y1 += m * (maxdim - *x1);
+         *x1 = maxdim;
+      }
+      return 1;
+   }
+   if (*x0 > maxdim)
+   {				/* start of line is right of window -
+				   complement of above */
+      if (*x1 > maxdim)		/* as is the end, so the line misses the window */
+         return 0;
+      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
+      *y0 += m * (maxdim - *x0);	/* adjust so point is on the right
+					   boundary */
+      *x0 = maxdim;
+      /* now, perhaps, adjust the end of the line */
+      if (*x1 < 0)
+      {
+         *y1 -= m * *x1;
+         *x1 = 0;
+      }
+      return 1;
+   }
+   /* the final case - the start of the line is inside the window */
+   if (*x1 > maxdim)
+   {				/* other end is outside to the right */
+      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
+      *y1 += m * (maxdim - *x1);
+      *x1 = maxdim;
+      return 1;
+   }
+   if (*x1 < 0)
+   {				/* other end is outside to the left */
+      m = (*y1 - *y0) / (double) (*x1 - *x0);	/* calculate the slope of the line */
+      *y1 -= m * *x1;
+      *x1 = 0;
+      return 1;
+   }
+   /* only get here if both points are inside the window */
+   return 1;
+}
+
+//*******************************************************************
+// Public Constructor: ossimDrect
+//
+//*******************************************************************
+ossimDrect::ossimDrect(const ossimIrect& rect)
+   :
+      theUlCorner(rect.ul()),
+      theUrCorner(rect.ur()),
+      theLrCorner(rect.lr()),
+      theLlCorner(rect.ll()),
+      theOrientMode(rect.orientMode())
+{
+   if(rect.isNan())
+   {
+      makeNan();
+   }
+}
+
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimDrect(const vector<ossimDpt>& points)
+//  
+//*****************************************************************************
+ossimDrect::ossimDrect(const ossimPolygon& polygon,
+                       ossimCoordSysOrientMode mode)
+   :
+      theOrientMode (mode)
+{
+   std::vector<ossimDpt> vertices;
+   ossimDpt point;
+   int index = 0;
+   while (polygon.vertex(index, point))
+   {
+      vertices.push_back(point);
+      index++;
+   }
+
+   initBoundingRect(vertices);
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimDrect(const vector<ossimDpt>& points)
+//  
+//*****************************************************************************
+ossimDrect::ossimDrect(const std::vector<ossimDpt>& points,
+                       ossimCoordSysOrientMode mode)
+   :
+      theOrientMode (mode)
+{
+  if(points.size())
+   {
+      unsigned long index;
+      double minx, miny;
+      double maxx, maxy;
+      
+      minx = points[0].x;
+      miny = points[0].y;
+      maxx = points[0].x;
+      maxy = points[0].y;
+            
+      // find the bounds
+      for(index = 1; index < points.size();index++)
+      {
+         
+         minx = std::min(minx, points[index].x);
+         miny = std::min(miny, points[index].y);
+         maxx = std::max(maxx, points[index].x);
+         maxy = std::max(maxy, points[index].y);
+         
+      }
+      if(theOrientMode == OSSIM_LEFT_HANDED)
+      {
+         *this = ossimDrect(minx, miny, maxx, maxy, mode);
+      }
+      else
+      {
+         *this = ossimDrect(minx,maxy, maxx, miny, mode);
+      }
+   }
+   else
+   {
+      makeNan();
+   }
+}
+ossimDrect::ossimDrect(const ossimDpt& p1,
+                       const ossimDpt& p2,
+                       const ossimDpt& p3,
+                       const ossimDpt& p4,
+                       ossimCoordSysOrientMode mode)
+: theOrientMode(mode)
+{
+   if(p1.hasNans()||p2.hasNans()||p3.hasNans()||p4.hasNans())
+   {
+      makeNan();
+   }
+   else
+   {
+      double minx, miny;
+      double maxx, maxy;
+      
+      minx = std::min( p1.x, std::min(p2.x, std::min(p3.x, p4.x)));
+      miny = std::min( p1.y, std::min(p2.y, std::min(p3.y, p4.y)));
+      maxx = std::max( p1.x, std::max(p2.x, std::max(p3.x, p4.x)));
+      maxy = std::max( p1.y, std::max(p2.y, std::max(p3.y, p4.y)));
+      
+      if(mode == OSSIM_LEFT_HANDED)
+      {
+         *this = ossimDrect(minx, miny, maxx, maxy, mode);
+      }
+      else
+      {            
+         *this = ossimDrect(minx,maxy, maxx, miny, mode);
+      }
+   }
+}
+
+
+//*******************************************************************
+//! Constructs an ossimDrect surrounding the specified point, and of specified size.
+//*******************************************************************
+ossimDrect::ossimDrect(const ossimDpt& center, 
+                       const double&   size_x, 
+                       const double&   size_y,
+                       ossimCoordSysOrientMode mode)
+: theOrientMode(mode)
+{
+   double dx = fabs(size_x);
+   double dy = fabs(size_y);
+
+   double minx = center.x - dx/2.0;
+   double maxx = minx + dx;
+
+   double miny = center.y - dy/2.0;
+   double maxy = miny + dy;
+
+   if(mode == OSSIM_LEFT_HANDED)
+      *this = ossimDrect(minx, miny, maxx, maxy, mode);
+   else
+      *this = ossimDrect(minx,maxy, maxx, miny, mode);
+}
+
+ossimDrect::~ossimDrect()
+{
+}
+
+void ossimDrect::initBoundingRect(const std::vector<ossimDpt>& points)
+{
+   unsigned long index;
+
+   // initialize everyone to the first point
+   if(points.size() > 0)
+   {
+      theUlCorner.x = points[0].x;
+      theUlCorner.y = points[0].y;
+      theLrCorner.x = theUlCorner.x;
+      theLrCorner.y = theUlCorner.y;
+   }
+   
+   // find the bounds
+   for(index = 1; index < points.size();index++)
+   {
+      // find left most
+      if(points[index].x < theUlCorner.x)
+         theUlCorner.x = points[index].x;
+
+      // find right most
+      else if(points[index].x > theLrCorner.x)
+         theLrCorner.x = points[index].x;
+
+      if (theOrientMode == OSSIM_LEFT_HANDED)
+      {
+         //find top most
+         if(points[index].y < theUlCorner.y)
+            theUlCorner.y = points[index].y;
+
+         // find bottom most
+         else if(points[index].y > theLrCorner.y)
+            theLrCorner.y = points[index].y;
+      }
+
+      else // right handed coord system
+      {
+         if(points[index].y > theUlCorner.y)
+            theUlCorner.y = points[index].y;
+
+         // find bottom most
+         else if(points[index].y < theLrCorner.y)
+            theLrCorner.y = points[index].y;
+      }
+   }
+
+   // now set the other points for the rect.
+   theUrCorner.x = theLrCorner.x;
+   theUrCorner.y = theUlCorner.y;
+   theLlCorner.x = theUlCorner.x;
+   theLlCorner.y = theLrCorner.y;
+}
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+bool ossimDrect::intersects(const ossimDrect& rect) const
+{
+   if(rect.hasNans() || hasNans())
+   {
+      return false;
+   }
+   if (theOrientMode != rect.theOrientMode)
+      return false;
+   
+   ossim_float64  ulx = ossim::max(rect.ul().x,ul().x);
+   ossim_float64  lrx = ossim::min(rect.lr().x,lr().x);
+   ossim_float64  uly, lry;
+   bool rtn=false;
+   if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      uly  = ossim::max(rect.ul().y,ul().y);
+      lry  = ossim::min(rect.lr().y,lr().y);
+      rtn = ((ulx <= lrx) && (uly <= lry));
+   }
+   else
+   {
+      uly  = ossim::max(rect.ll().y,ll().y);
+      lry  = ossim::min(rect.ur().y,ur().y);
+      rtn = ((ulx <= lrx) && (uly <= lry));
+   }
+      
+   return (rtn);
+}
+
+//*******************************************************************
+// Public Method: ossimDrect::completely_within
+//*******************************************************************
+bool ossimDrect::completely_within(const ossimDrect& rect) const
+{
+   if(hasNans() || rect.hasNans())
+   {
+      return false;
+   }
+   if (theOrientMode != rect.theOrientMode)
+      return false;
+   
+   /*  --------------
+       |     1      |
+       | ---------- |
+       | |        | |
+       | |        | |
+       | |   2    | |
+       | |        | |
+       | |        | |
+       | ---------- |
+       |            |
+       --------------  */
+
+   bool rtn = true;
+   if ((theUlCorner.x > rect.ur().x)||
+       (theUlCorner.x < rect.ul().x))
+      rtn = false;
+   
+   else if ((theLrCorner.x > rect.lr().x)||
+            (theLrCorner.x < rect.ll().x))
+      rtn = false;
+   
+   else if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      if ((theUlCorner.y < rect.ul().y)||
+          (theUlCorner.y > rect.lr().y))
+         rtn = false;
+   
+      else if ((theLrCorner.y > rect.lr().y)||
+               (theLrCorner.y < rect.ul().y))
+         rtn = false;
+   }
+   
+   else
+   {
+      if ( (theUlCorner.y > rect.ul().y)||
+           (theUlCorner.y < rect.lr().y))
+         rtn = false;
+   
+      else if ((theLrCorner.y < rect.lr().y)||
+               (theLrCorner.y > rect.ul().y))
+         rtn = false;
+   }
+
+   return rtn;
+}
+
+//*******************************************************************
+// Public Method: ossimDrect::stretchOut
+//*******************************************************************
+void ossimDrect::stretchOut()
+{
+   set_ulx(floor(theUlCorner.x));
+   set_lrx(ceil(theLrCorner.x));
+
+   if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      set_uly(floor(theUlCorner.y));
+      set_lry(ceil(theLrCorner.y));
+   }
+   else
+   {
+      set_uly(ceil(theUlCorner.y));
+      set_lry(floor(theLrCorner.y));
+   }
+}
+
+void ossimDrect::stretchToTileBoundary(const ossimDpt& widthHeight)
+{
+   ossimDpt ul;
+   ossimDpt lr;
+   ossim_int32 evenDivision=0;
+
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      ul.x = theUlCorner.x;
+      if( fmod(theUlCorner.x, widthHeight.x) != 0)
+      {
+         ul.x = ((long)(ul.x / widthHeight.x))*widthHeight.x;
+         if(ul.x > theUlCorner.x)
+         {
+            ul.x -= widthHeight.x;
+         }
+      }
+      ul.y = theUlCorner.y;
+      if( fmod(theUlCorner.y, widthHeight.y) != 0)
+      {
+         ul.y = ((long)(ul.y / widthHeight.y))*widthHeight.y;
+         if(ul.y > theUlCorner.y)
+         {
+            ul.y -= widthHeight.y;
+         }
+      }
+      
+      evenDivision = fmod(theLrCorner.x, widthHeight.x) == 0;
+      lr.x = theLrCorner.x;
+      if(!evenDivision)
+      {
+         lr.x = ((long)((lr.x)/widthHeight.x)) * widthHeight.x;
+         if(lr.x < theLrCorner.x)
+         {
+            lr.x += widthHeight.x;
+         }
+      }
+
+      evenDivision = fmod(theLrCorner.y, widthHeight.y) == 0;
+      lr.y = theLrCorner.y;
+      if(!evenDivision)
+      {
+         lr.y = ((long)(lr.y/widthHeight.y)) * widthHeight.y;
+         if(lr.y < theLrCorner.y)
+         {
+            lr.y += widthHeight.y;
+         }
+      }
+   }
+   else
+   {
+      ul.x = theUlCorner.x;
+      ul.y = theUlCorner.y;
+      if( !ossim::almostEqual(fmod(theUlCorner.x, widthHeight.x), 0.0))
+      {
+         ul.x = ((long)(ul.x/ widthHeight.x))*widthHeight.x;
+         if(ul.x > theUlCorner.x)
+         {
+            ul.x -= widthHeight.x;
+         }
+      }
+      if( !ossim::almostEqual((double)fmod(theUlCorner.y, widthHeight.y), 0.0) )
+      {
+         ul.y = ((long)(ul.y / widthHeight.y))*widthHeight.y;
+         if(ul.y < theUlCorner.y)
+         {
+            ul.y += widthHeight.y;
+         }
+      }
+      
+      evenDivision = ossim::almostEqual( fmod(theLrCorner.x, widthHeight.x), 0.0);
+      lr.x = theLrCorner.x;
+      if(!evenDivision)
+      {
+         lr.x = ((long)(lr.x/widthHeight.x)) * widthHeight.x;
+         if(lr.x < theLrCorner.x)
+         {
+            lr.x += widthHeight.x;
+         }
+      }
+
+      evenDivision = ossim::almostEqual(fmod(theLrCorner.y, widthHeight.y), 0.0);
+      lr.y = theLrCorner.y;
+      if(!evenDivision)
+      {
+         lr.y = ((long)(lr.y/widthHeight.y)) * widthHeight.y;
+
+         if(lr.y > theLrCorner.y)
+         {
+            lr.y -= widthHeight.y;
+         }
+      }
+  }
+
+   *this = ossimDrect(ul, lr, theOrientMode);
+}
+
+const ossimDrect& ossimDrect::expand(const ossimDpt& padding)
+{
+   theUlCorner.x -= padding.x;
+   theUrCorner.x += padding.x;
+   theLrCorner.x += padding.x;
+   theLlCorner.x -= padding.x;
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      theUlCorner.y -= padding.y;
+      theUrCorner.y -= padding.y;
+      theLrCorner.y += padding.y;
+      theLlCorner.y += padding.y;
+   }
+   else
+   {
+      theUlCorner.y += padding.y;
+      theUrCorner.y += padding.y;
+      theLrCorner.y -= padding.y;
+      theLlCorner.y -= padding.y;
+   }
+   
+   return *this;
+}
+ossimString ossimDrect::toString()const
+{
+   ossimString result="(";
+   
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      ossimDpt origin = ul();
+      result += (ossimString::toString(origin.x,20) + ",");
+      result += (ossimString::toString(origin.y,20) + ",");
+      result += (ossimString::toString(width(),20) + ",");
+      result += (ossimString::toString(height(),20) + ",");
+      result += "LH";
+   }
+   else 
+   {
+      ossimDpt origin = ll();
+      result += (ossimString::toString(origin.x,20) + ",");
+      result += (ossimString::toString(origin.y,20) + ",");
+      result += (ossimString::toString(width(),20) + ",");
+      result += (ossimString::toString(height(),20) + ",");
+      result += "RH";
+   }
+   
+   result += ")";
+   return result;
+}
+
+bool ossimDrect::toRect(const ossimString& rectString)
+{
+   bool result = false;
+   
+   
+   std::istringstream in(rectString);
+   ossim::skipws(in);
+   char charString[2];
+   charString[1] = '\0';
+   ossimString interior;
+   if(in.peek() == '(')
+   {
+      in.ignore();
+      while((in.peek() != ')')&&
+            (in.peek() != '\n') &&
+            in.good())
+      {
+         charString[0] = in.get();
+         interior += charString;
+      }
+      if(in.peek() == ')')
+      {
+         result = true;
+      }
+   }
+   if(result)
+   {
+      std::vector<ossimString> splitArray;
+      interior.split(splitArray, ",");
+      
+      // assume left handed
+      if(splitArray.size() >= 4)
+      {
+         ossim_float64 x = splitArray[0].toDouble();
+         ossim_float64 y = splitArray[1].toDouble();
+         ossim_float64 w = splitArray[2].toDouble();
+         ossim_float64 h = splitArray[3].toDouble();
+         ossimString orientation = "lh";
+         if(splitArray.size() == 5)
+         {
+            orientation = splitArray[4].downcase();
+         }
+         if(orientation == "lh")
+         {
+            // origin upper left
+            *this = ossimDrect(x,y,x + (w-1), y+h-1, OSSIM_LEFT_HANDED);
+         }
+         else 
+         {
+            // origin lower left so construct and make an upper left
+            *this = ossimDrect(x,y+(h-1),x + (w-1), y, OSSIM_RIGHT_HANDED);
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      
+   }
+   return result;
+}
+
+bool ossimDrect::saveState(ossimKeywordlist& kwl,
+                           const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           "ossimDrect",
+           true);
+
+   kwl.add(prefix, "rect", toString());
+
+   return true;
+}
+
+bool ossimDrect::loadState(const ossimKeywordlist& kwl,
+                           const char* prefix)
+{
+  const char* rect = kwl.find(prefix, "rect");
+  makeNan();
+
+  if(rect)
+  {
+      toRect(rect);
+  }
+   
+   return true;
+}
+
+//*******************************************************************
+// Public Method: ossimDrect::print
+//*******************************************************************
+void ossimDrect::print(std::ostream& os) const
+{
+   os << toString();
+}
+
+//*******************************************************************
+// friend function: operator<<
+//*******************************************************************
+std::ostream& operator<<(std::ostream& os, const ossimDrect& rect)
+{
+   rect.print(os);
+
+   return os;
+}
+
+//*******************************************************************
+// Public Method: ossimDrect::clip
+//*******************************************************************
+bool ossimDrect::clip(ossimDpt &p1, ossimDpt &p2)const
+{
+   if(p1.isNan() || p2.isNan())
+   {
+      return false;
+   }
+   ossimDpt shift(-theUlCorner.x,
+		  -theUlCorner.y);
+
+   ossimDpt tempShiftP1 = p1+shift;
+   ossimDpt tempShiftP2 = p2+shift;
+   double maxW = width()-1;
+   double maxH = height()-1;
+   if (clip_1d (&tempShiftP1.x, &tempShiftP1.y, 
+                &tempShiftP2.x, &tempShiftP2.y, 
+                maxW) == 0)
+   {
+      return false;
+   }
+   if(clip_1d (&tempShiftP1.y, 
+               &tempShiftP1.x, 
+               &tempShiftP2.y, 
+               &tempShiftP2.x, maxH) == 0)
+   {
+      return false;
+   }
+   p1 = tempShiftP1-shift;
+   p2 = tempShiftP2-shift;
+   return true;
+}
+
+//*******************************************************************
+// Public Method: ossimDrect::getCode
+//*******************************************************************
+long ossimDrect::getCode(const ossimDpt& aPoint,
+                         const ossimDrect& clipRect)
+{
+   long result=NONE; // initialize to inside rect
+   
+   if( (aPoint.x > clipRect.lr().x) )
+      result |= RIGHT;
+   else if( (aPoint.x < clipRect.ul().x) )
+      result |= LEFT;
+
+   if (clipRect.theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      if( (aPoint.y < clipRect.ul().y) )
+         result |= TOP;
+      else if( (aPoint.y > clipRect.lr().y) )
+         result |= BOTTOM;
+   }
+   else
+   {
+      if( (aPoint.y > clipRect.ul().y) )
+         result |= TOP;
+      else if( (aPoint.y < clipRect.lr().y) )
+         result |= BOTTOM;
+   }
+      
+   return result;
+}
+
+
+void ossimDrect::splitToQuad(ossimDrect& ulRect,
+                             ossimDrect& urRect,
+                             ossimDrect& lrRect,
+                             ossimDrect& llRect)
+{
+   ossimDpt ulPt  = this->ul();
+   ossimDpt urPt  = this->ur();
+   ossimDpt lrPt  = this->lr();
+   ossimDpt llPt  = this->ll();
+   ossimIpt midPt = this->midPoint();
+   
+   ulRect = ossimDrect(ulPt.x,
+                       ulPt.y,
+                       midPt.x,
+                       midPt.y,
+                       theOrientMode);
+   
+   urRect = ossimDrect(midPt.x,
+                       ulPt.y,
+                       urPt.x,
+                       midPt.y,
+                       theOrientMode);
+   
+   if(theOrientMode  == OSSIM_LEFT_HANDED)
+   {
+      lrRect = ossimDrect(midPt.x,
+                          midPt.y,
+                          lrPt.x,
+                          theOrientMode);
+      llRect = ossimDrect(ulPt.x,
+                          midPt.y,
+                          midPt.x,
+                          llPt.y,
+                          theOrientMode);
+   }
+   else
+   {       
+      lrRect = ossimDrect(midPt.x,
+                          midPt.y,
+                          lrPt.x,
+                          theOrientMode);
+      llRect = ossimDrect(ulPt.x,
+                          midPt.y,
+                          midPt.x,
+                          llPt.y,
+                          theOrientMode);       
+   }
+   
+}
+
+//*******************************************************************
+// Public Method: ossimDrect::clipToRect
+//*******************************************************************
+ossimDrect ossimDrect::clipToRect(const ossimDrect& rect)const
+{
+   ossimDrect result;
+   result.makeNan();
+   if(rect.hasNans() || hasNans())
+   {
+      return result;
+   }
+   
+   if (theOrientMode != rect.theOrientMode)
+      return (*this);
+
+   double x0 = ossim::max(rect.ul().x, ul().x);
+   double x1 = ossim::min(rect.lr().x, lr().x);
+   double y0, y1;
+
+   if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      y0 = ossim::max(rect.ul().y, ul().y);
+      y1 = ossim::min(rect.lr().y, lr().y);
+
+      if( (x1 < x0) || (y1 < y0) )
+      {
+         return result;
+      }
+      else
+      {
+         result = ossimDrect(x0, y0, x1, y1, theOrientMode);
+      }
+   }
+   else
+   {
+      y0 = ossim::max(rect.ll().y,ll().y);
+      y1 = ossim::min(rect.ur().y,ur().y);
+      if( (x1 < x0) || (y1 < y0) )
+      {
+         return result;
+      }
+      else
+      {
+         result = ossimDrect(x0, y1, x1, y0, theOrientMode);
+      }
+   }
+   return result;
+}
+
+const ossimDrect& ossimDrect::operator=(const ossimIrect& rect)
+{
+   if(rect.isNan())
+   {
+      makeNan();
+   }
+   else
+   {
+      theUlCorner   = rect.ul();
+      theUrCorner   = rect.ur();
+      theLrCorner   = rect.lr();
+      theLlCorner   = rect.ll();
+      theOrientMode = rect.orientMode();
+   }
+   
+   return *this;
+}
+
+//*************************************************************************************************
+// Finds the point on the rect boundary that is closest to the arg_point. Closest is defined as
+// the minimum perpendicular distance.
+//*************************************************************************************************
+ossimDpt ossimDrect::findClosestEdgePointTo(const ossimDpt& arg_point) const
+{
+   double dXleft  = theUlCorner.x - arg_point.x;
+   double dXright = theLrCorner.x - arg_point.x;
+   double dYupper = theUlCorner.y - arg_point.y;
+   double dYlower = theLrCorner.y - arg_point.y;
+
+   ossimDpt edge_point (theLrCorner);
+
+   if (dXleft*dXright < 0.0)
+      edge_point.x = arg_point.x;
+   else if (fabs(dXleft) < fabs(dXright))
+      edge_point.x = theUlCorner.x;
+
+   if (dYupper*dYlower < 0.0)
+      edge_point.y = arg_point.y;
+   else if (fabs(dYupper) < fabs(dYlower))
+      edge_point.y = theUlCorner.y;
+
+   return edge_point;
+}
+
diff --git a/src/base/ossimDuration.cpp b/src/base/ossimDuration.cpp
new file mode 100644
index 0000000..bb434cd
--- /dev/null
+++ b/src/base/ossimDuration.cpp
@@ -0,0 +1,269 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id$
+#include <ossim/base/ossimDuration.h>
+#include <ossim/base/ossimCommon.h>
+#include <sstream>
+#include <cctype>
+ossimDuration::ossimDuration(const ossimString& iso8601Duration)
+:theSign(1),
+theYears(0),
+theMonths(0),
+theWeeks(0),
+theDays(0),
+theHours(0),
+theMinutes(0),
+theSeconds(0)
+{
+   if(!iso8601Duration.empty())
+   {
+      setByIso8601DurationString(iso8601Duration);
+   }
+}
+
+void ossimDuration::clearFields()
+{
+   theSign = 1; 
+   theYears = 0;
+   theMonths = 0;
+   theWeeks = 0;
+   theDays = 0;
+   theHours = 0;
+   theMinutes = 0;
+   theSeconds = 0; 
+}
+
+static bool isWhiteSpace(int c)
+{
+   return ((c==' ') ||
+           (c=='\n')||
+           (c=='\r')||
+           (c=='\t'));
+}
+
+bool ossimDuration::readIso8601Encoding(std::istream& in)
+{
+   clearFields();
+   
+   if(in.peek()=='-')
+   {
+      theSign = -1;
+      in.ignore();
+   }
+   if(in.peek()!='P')
+   {
+      return false;
+   }
+   // skip the period indicater
+   in.ignore();
+   
+   // now we start parsing the date portion and the time portion
+   ossimString value;
+   bool doneFlag     = false;
+   bool badParseFlag = false;
+   bool doingTimeFlag = false;
+   while(!doneFlag)
+   {
+      int c = in.peek();
+      if(!in)
+      {
+         doneFlag = true;
+      }
+      else
+      {
+         if(isWhiteSpace(c))
+         {
+            doneFlag = true; // parse til blank character is met
+         }
+         else if(isalpha(c))
+         {
+            // we are done with current value 
+            //
+            // check to see if was a Time seaprator of value
+            // 'T'
+            if(c == 'T')
+            {
+               // then it was a time separator so do nothing
+               value = ""; // go ahead and null it out for now
+               doingTimeFlag = true; // now in time parsing portion
+            }
+            else
+            {
+               if(doingTimeFlag)
+               {
+                  // check time values
+                  if(c == 'H')
+                  {
+                     theHours = value.toUInt64();
+                  }
+                  else if(c == 'M')
+                  {
+                     theMinutes = value.toUInt64();
+                  }
+                  else if(c == 'S')
+                  {
+                     theSeconds = value.toFloat64();
+                  }
+                  else
+                  {
+                     doneFlag = true;
+                     badParseFlag = true;
+                  }
+                  value = ""; // reset the value
+               }
+               else // check date characters instead
+               {
+                  if(c == 'Y')
+                  {
+                     theYears = value.toUInt64();
+                  }
+                  else if(c == 'M')
+                  {
+                     theMonths = value.toUInt64();
+                  }
+                  else if(c == 'W')
+                  {
+                     theWeeks = value.toUInt64();
+                  }
+                  else if(c == 'D')
+                  {
+                     theDays = value.toUInt64();
+                  }
+                  else
+                  {
+                     doneFlag = true;
+                     badParseFlag = true;
+                  }
+                  value = ""; // reset the value
+               }
+            }
+         }
+         else if(isdigit(c)||(c=='.'))// not an alphabetic character so add it to the value string
+         {
+            value += static_cast<char>(c);
+         }
+         else
+         {
+            doneFlag = true;
+            badParseFlag = true;
+         }
+      }
+      if(!doneFlag)
+      {
+         in.ignore();
+      }
+   }
+   
+   return badParseFlag;
+}
+
+bool ossimDuration::setByIso8601DurationString(const ossimString& iso8601Duration)
+{
+   if(iso8601Duration.empty())
+   {
+      clearFields();
+      return true;
+   }
+   std::istringstream in(iso8601Duration);
+   return readIso8601Encoding(in);
+}
+
+void ossimDuration::toIso8601DurationString(ossimString& result)
+{
+   result = "";
+   bool hasDatePeriod = ((theYears!=0)||
+                         (theMonths!=0)||
+                         (theWeeks!=0)||
+                         (theDays!=0));
+   bool hasTimePeriod = ((theHours!=0)||
+                         (theMinutes!=0)||
+                         (!ossim::almostEqual(theSeconds, 0.0, .00000000001)));
+   // if no time or date period present then return empty
+   if(!(hasDatePeriod || hasTimePeriod))
+   {
+      return;
+   }
+   if(theSign < 0)
+   {
+      result += "-";
+   }
+   result += "P";
+   if(hasDatePeriod)
+   {
+      if(theYears > 0)
+      {
+         result+=ossimString::toString(theYears);
+         result+="Y";
+      }
+      if(theMonths>0)
+      {
+         result+=ossimString::toString(theMonths);
+         result+="M";
+      }
+      if(theWeeks>0)
+      {
+         result+=ossimString::toString(theWeeks);
+         result+="W";
+      }
+      if(theDays>0)
+      {
+         result+=ossimString::toString(theDays);
+         result+="D";
+      }
+   }
+   if(hasTimePeriod)
+   {
+      result+="T";
+      if(theHours>0)
+      {
+         result+=ossimString::toString(theHours);
+         result+="H";
+      }
+      if(theMinutes>0)
+      {
+         result+=ossimString::toString(theMinutes);
+         result+="M";
+      }
+      if(theSeconds>0)
+      {
+         result+=ossimString::toString(theSeconds, 15);
+         result+="S";
+      }
+   }
+}
+
+ossim_float64 ossimDuration::toSeconds()const
+{
+   ossim_float64 result = theSeconds;
+   
+   if(theMinutes > 0)
+   {
+      result += theMinutes*60.0;
+   }
+   if(theHours > 0)
+   {
+      result += theHours*3600.0;
+   }
+   if(theDays > 0)
+   {
+      result += theDays*86400.0;
+   }
+   if(theWeeks > 0)
+   {
+      result += theWeeks*604800;
+   }
+   if(theSign < 0)
+   {
+      result *= -1.0;
+   }
+   return result;
+}
+
+
diff --git a/ossim/src/ossim/base/ossimEbcdicToAscii.cpp b/src/base/ossimEbcdicToAscii.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimEbcdicToAscii.cpp
rename to src/base/ossimEbcdicToAscii.cpp
diff --git a/ossim/src/ossim/base/ossimEcefPoint.cpp b/src/base/ossimEcefPoint.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimEcefPoint.cpp
rename to src/base/ossimEcefPoint.cpp
diff --git a/ossim/src/ossim/base/ossimEcefRay.cpp b/src/base/ossimEcefRay.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimEcefRay.cpp
rename to src/base/ossimEcefRay.cpp
diff --git a/ossim/src/ossim/base/ossimEcefVector.cpp b/src/base/ossimEcefVector.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimEcefVector.cpp
rename to src/base/ossimEcefVector.cpp
diff --git a/ossim/src/ossim/base/ossimElevationManagerEvent.cpp b/src/base/ossimElevationManagerEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimElevationManagerEvent.cpp
rename to src/base/ossimElevationManagerEvent.cpp
diff --git a/src/base/ossimElevationManagerEventListener.cpp b/src/base/ossimElevationManagerEventListener.cpp
new file mode 100644
index 0000000..58d00b6
--- /dev/null
+++ b/src/base/ossimElevationManagerEventListener.cpp
@@ -0,0 +1,31 @@
+#include <ossim/base/ossimElevationManagerEventListener.h>
+#include <ossim/base/ossimElevationManagerEvent.h>
+
+RTTI_DEF1(ossimElevationManagerEventListener, "ossimElevationManagerEventListener",
+          ossimListener);
+
+ossimElevationManagerEventListener::ossimElevationManagerEventListener()
+      : ossimListener()
+{
+}
+
+
+ossimElevationManagerEventListener::~ossimElevationManagerEventListener()
+{
+}
+
+void ossimElevationManagerEventListener::processEvent( ossimEvent& event )
+{
+   ossimElevationManagerEvent* elevationManagerEvent =
+      dynamic_cast<ossimElevationManagerEvent*>( &event );
+
+   if ( elevationManagerEvent )
+   {
+      processEvent( *elevationManagerEvent );
+   }
+}
+
+void ossimElevationManagerEventListener::processEvent( ossimElevationManagerEvent& /* event */)
+{
+
+}
diff --git a/src/base/ossimEllipsoid.cpp b/src/base/ossimEllipsoid.cpp
new file mode 100644
index 0000000..13cf8d5
--- /dev/null
+++ b/src/base/ossimEllipsoid.cpp
@@ -0,0 +1,731 @@
+///*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// DESCRIPTION:
+//   Contains implementation of class ossimEllipsoid. The implementation is
+//   actually for an OBLATE SPHEROID (x.radius = y.radius) as Earth is
+//   considered.
+//
+// SOFTWARE HISTORY:
+//>
+//   06Aug2001  Garrett Potts, Oscar Kramer
+//              Initial coding.
+//<
+//*****************************************************************************
+//  $Id: ossimEllipsoid.cpp 22858 2014-08-05 17:24:50Z dburken $
+
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimEllipsoidFactory.h>
+#include <ossim/base/ossimEcefRay.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimEcefVector.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimMatrix4x4.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+#include <cmath>
+static ossimTrace traceExec  ("ossimEllipsoid:exec");
+static ossimTrace traceDebug ("ossimEllipsoid:debug");
+
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimEllipsoid #1 (COPY)
+//  
+//*****************************************************************************
+ossimEllipsoid::ossimEllipsoid(const ossimEllipsoid &ellipsoid)
+   :
+      theName(ellipsoid.theName),
+      theCode(ellipsoid.theCode),
+      theEpsgCode(ellipsoid.theEpsgCode),
+      theA(ellipsoid.theA),
+      theB(ellipsoid.theB),
+      theFlattening(ellipsoid.theFlattening),
+      theA_squared(ellipsoid.theA_squared),
+      theB_squared(ellipsoid.theB_squared),
+      theEccentricitySquared(ellipsoid.theEccentricitySquared)
+{
+   if ( theEpsgCode == 0 )
+   {
+      theEpsgCode = ossimEllipsoidFactory::instance()->findEpsgCode(theCode);
+   }
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimEllipsoid #2
+//  
+//*****************************************************************************
+ossimEllipsoid::ossimEllipsoid(const ossimString &name,
+                               const ossimString &code,
+                               const double &a,
+                               const double &b,
+                               ossim_uint32 epsg_code)
+   :
+      theName(name),
+      theCode(code),
+      theEpsgCode(epsg_code),
+      theA(a),
+      theB(b),
+      theA_squared(a*a),
+      theB_squared(b*b)
+{
+   if (theEpsgCode == 0)
+   {
+      theEpsgCode = ossimEllipsoidFactory::instance()->findEpsgCode(theCode);
+   }
+
+   computeFlattening();   
+   theEccentricitySquared = 2*theFlattening - theFlattening*theFlattening;
+}
+
+ossimEllipsoid::ossimEllipsoid()
+{
+   const ossimEllipsoid* ellipse = ossimEllipsoidFactory::instance()->wgs84();
+   
+   *this = *ellipse;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimEllipsoid #3
+//  
+//*****************************************************************************
+ossimEllipsoid::ossimEllipsoid(const double &a,
+                               const double &b)
+   :
+      theName(""), // initialize to empty
+      theCode(""),
+      theEpsgCode(0),
+      theA(a),
+      theB(b),
+      theA_squared(a*a),
+      theB_squared(b*b)
+{
+   // First check if this is just WGS84:
+   const ossimEllipsoid* wgs84 = ossimEllipsoidFactory::instance()->wgs84();
+   if ((theA == wgs84->theA) && (theB == wgs84->theB))
+   {
+      *this = *wgs84;
+   }
+   else
+   {
+      computeFlattening();
+      theEccentricitySquared = 2*theFlattening - theFlattening*theFlattening;
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::nearestIntersection
+//  
+//*****************************************************************************
+bool ossimEllipsoid::nearestIntersection(const ossimEcefRay &ray,
+                                         ossimEcefPoint& rtnPt) const
+{
+   return nearestIntersection(ray, 0.0, rtnPt);
+}
+
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::nearestIntersection
+//  
+//   geographic objects that are derive this class will assume that
+//   the reference datum is wgs84 and that the ray origin is a
+//   geocentric coordinate relative to the wgs84 datum.  Will return
+//   true if the object was intersected and false otherwise.
+//  
+//   The nearest intersection will use the ray sphere intersection
+//   found in most ray tracers.  We will take a Ray defined by the
+//   parametric equation:
+//  
+//     x = x0 + dxt
+//     y = y0 + dyt
+//     z = z0 + dzt
+//  
+//   and intersect this with the equation of a spheroid:
+//  
+//     x^2/theXRadius^2 + y^2/theYRadius^2 + z^2/theZRadius^2 = 1
+//  
+//   the intersection is achieved by substituting the parametric line
+//   into the equation of the spheroid.  By doing this you should
+//   get a quadratic in t and the equation should look like this:
+//  
+//    a*t^2 + b*t + c = 0
+//  
+//      let a = dx^2/theXRadius^2 + dy^2/theYRadius^2 + dz^2/theZRadius^2
+//      let b = 2*(x0*dx/theXRadius^2 +y0*dy/theYRadius^2 + z0*dz/theZRadius^2
+//      let c = x0^2/theXRadius^2 + y0^2/theYRadius^2 + z0^2/theZRadius^2 - 1
+//  
+//    Now solve the quadratic (-b +- sqrt(b^2 - 4ac) ) / 2a
+//  
+//    After solving for t, the parameter is applied to the ray to determine
+//    the 3D point position in X,Y,Z, passed back in rtnPt. The boolean
+//    "true" is returned if an intersection was found.
+//    
+//    ESH 1/14/2016: I noticed that the radii used for the spheroid are dependent
+//    on latitude and this was not taken into account, leading to small errors in 
+//    the results. The current point on the ray is now used to estimate latitude and 
+//    update the radii. Iterations stop when the intersection point has an elevation 
+//    value close to the ellipsoid 'offset'. This approach appears to converge very 
+//    fast (<=3 iterations). Before this fix, it was noticed that the rtnPt can be 
+//    off as the absolute value of 'offset' gets large. For example, at 10000 meters, 
+//    rtnPt can be off by almost 2 centimeters.
+//
+//*****************************************************************************
+bool ossimEllipsoid::nearestIntersection( const ossimEcefRay& ray,
+                                          const double&       offset,
+                                          ossimEcefPoint&     rtnPt ) const
+{
+   static const char MODULE[] = "ossimEllipsoid::nearestIntersection";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: " << MODULE << ", entering...\n";
+   }
+
+   bool success = false;
+
+   const double eccSqComp = 1.0 - theEccentricitySquared;
+   const double CONVERGENCE_THRESHOLD = 0.0001;
+   const int    MAX_NUM_ITERATIONS    = 10;
+
+   //***
+   // get the origin and direction of ray:
+   //***
+   ossimEcefPoint  start = ray.origin();   
+   ossimEcefVector direction = ray.direction();
+   
+   double start_x = start.x();
+   double start_y = start.y();
+   double start_z = start.z();
+
+   double direction_x = direction.x();
+   double direction_y = direction.y();
+   double direction_z = direction.z();
+
+   ossimGpt rayGpt( start );
+
+   int iterations = 0;
+   bool done = false;
+   do
+   {
+      double rayLat    = rayGpt.latd();
+      double raySinLat = ossim::sind( rayLat );
+      double rayScale  = 1.0 / sqrt( 1.0 - theEccentricitySquared * raySinLat * raySinLat );
+      double rayN      = theA * rayScale;
+
+      double A_offset = rayN + offset;
+      double B_offset = rayN * eccSqComp + offset;
+
+      double A_offset_inv = 1.0 / A_offset;
+      double B_offset_inv = 1.0 / B_offset;
+
+      double scaled_x = start_x * A_offset_inv;
+      double scaled_y = start_y * A_offset_inv;
+      double scaled_z = start_z * B_offset_inv;
+
+      double A_over_B = A_offset * B_offset_inv;
+
+      //***
+      // Solve the coefficients of the quadratic formula
+      //***
+
+      double a = (direction_x*direction_x + direction_y*direction_y) * A_offset_inv;
+      a += (direction_z*direction_z * B_offset_inv * A_over_B);
+
+      double b = 2.0 * ( scaled_x*direction_x + scaled_y*direction_y +
+                         scaled_z*direction_z*A_over_B );
+
+      double c = scaled_x*start_x + scaled_y*start_y;
+      c += (scaled_z*start_z * A_over_B);
+      c -= A_offset;
+
+      //***
+      // solve the quadratic
+      //***
+      double root = b*b - 4.0*a*c;
+      if ( root < 0.0 )
+      {
+         return false;
+      }
+
+      double squareRoot = sqrt(root);
+      double oneOver2a  = 1.0 / (2.0*a);
+
+      double t1 = (-b + squareRoot) * oneOver2a;
+      double t2 = (-b - squareRoot) * oneOver2a;
+      
+      //***
+      // sort t1 and t2 and take the nearest intersection if they
+      // are in front of the ray.
+      //***
+      if ( t2 < t1 )
+      {
+         double temp = t1;
+         t1 = t2;
+         t2 = temp;
+      }     
+
+      double tEstimate = ( t1 > 0.0 ) ? t1 : t2;
+
+      // Get estimated intersection point.
+      ossimEcefPoint rayEcef = ray.extend( tEstimate );
+
+      rayGpt = ossimGpt( rayEcef );
+      double offsetError = fabs( rayGpt.height() - offset );
+      if ( offsetError < CONVERGENCE_THRESHOLD )
+      {
+         done = true;
+         success = true;
+         rtnPt = rayEcef;
+      }
+
+   }  while ( (!done) && (iterations++ < MAX_NUM_ITERATIONS) );
+
+   if (iterations >= MAX_NUM_ITERATIONS)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING ossimEllipsoid::nearestIntersection: Max number of iterations reached"
+            << " solving for intersection point. Result is probably inaccurate." << std::endl;
+      }
+   }
+
+   return success; 
+}
+
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::evaluate(ossimColumnVector3d)
+//  
+//  Returns neg number if inside, 0 if on, and pos number if outside of
+//  ellipsoid.
+//  
+//*****************************************************************************
+double ossimEllipsoid::evaluate(const ossimEcefPoint &location)const
+{
+   //***
+   // get the axis
+   //***
+   return (((location.x() * location.x())/theA_squared) +
+           ((location.y() * location.y())/theA_squared) +
+           ((location.z() * location.z())/theB_squared) - 1.0);   
+}
+ 
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::gradient()  version A
+//  
+//  Returns vector normal to the ellipsoid at point specified.
+//  
+//*****************************************************************************
+void ossimEllipsoid::gradient(const ossimEcefPoint& location,
+                              ossimEcefVector&      result) const
+{
+   result.x() = (2.0*location.x())/theA_squared;
+   result.y() = (2.0*location.y())/theA_squared;
+   result.z() = (2.0*location.z())/theB_squared;
+}
+
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::gradient()  version B
+//  
+//  Returns vector normal to the ellipsoid at point specified.
+//  
+//*****************************************************************************
+ossimEcefVector
+ossimEllipsoid::gradient(const ossimEcefPoint &location)const
+{
+   ossimEcefVector result;
+   gradient(location, result);
+   return result;
+}
+   
+   
+bool ossimEllipsoid::loadState(const ossimKeywordlist& kwl,
+                               const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::ELLIPSE_CODE_KW);
+   bool foundCode = false;
+   if(lookup)
+   {
+      const ossimEllipsoid* ellipse = ossimEllipsoidFactory::instance()->create(ossimString(lookup));
+
+      if(ellipse)
+      {
+         foundCode = true;
+         *this = *ellipse;
+      }
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::ELLIPSE_EPSG_CODE_KW);
+   if (lookup)
+   {
+      theEpsgCode = ossimString(lookup).toUInt32();
+   }
+
+   if(!foundCode)
+   {     
+      const char* majorAxis = kwl.find(prefix,
+                                       ossimKeywordNames::MAJOR_AXIS_KW);
+      const char* minorAxis = kwl.find(prefix,
+                                       ossimKeywordNames::MAJOR_AXIS_KW);
+
+      theName = "";
+      theCode = "";
+      if(majorAxis && minorAxis)
+      {
+         theA = ossimString(majorAxis).toDouble();
+         theB = ossimString(minorAxis).toDouble();
+
+         computeFlattening();
+         theA_squared = theA*theA;
+         theB_squared = theB*theB;
+      }
+      else
+      {
+         const ossimEllipsoid* ellipse = ossimEllipsoidFactory::instance()->wgs84();
+         
+         *this = *ellipse;
+      }      
+   }
+
+   return true;
+}
+
+bool ossimEllipsoid::saveState(ossimKeywordlist& kwl,
+                               const char* prefix)const
+{
+   if(theCode != "")
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::ELLIPSE_CODE_KW,
+              theCode.c_str(),
+              true);
+
+      kwl.add(prefix,
+              ossimKeywordNames::ELLIPSE_NAME_KW,
+              theName.c_str(),
+              true);
+   }
+   if (theEpsgCode)
+   {
+      kwl.add(prefix, ossimKeywordNames::ELLIPSE_EPSG_CODE_KW, theEpsgCode, true);
+   }
+
+   kwl.add(prefix,
+           ossimKeywordNames::MAJOR_AXIS_KW,
+           theA,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::MINOR_AXIS_KW,
+           theB,
+           true);
+
+   return true;
+}
+
+ 
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::prinRadiiOfCurv()
+//  
+//  Computes the meridional radius and prime vertical at given point.
+//  
+//*****************************************************************************
+void ossimEllipsoid::prinRadiiOfCurv(const ossimEcefPoint& location,
+                                           double& merRadius,
+                                           double& primeVert) const
+{
+   double lat, lon, hgt;
+   XYZToLatLonHeight(location.x(), location.y(), location.z(), lat, lon, hgt);
+   
+   double sinPhi = sin(lat*RAD_PER_DEG);
+   double phiFac = 1.0 - theEccentricitySquared*sinPhi*sinPhi;
+   primeVert = theA / sqrt(phiFac);
+   merRadius = theA*(1.0-theEccentricitySquared) / sqrt(phiFac*phiFac*phiFac);
+}
+
+ 
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::jacobianWrtEcef()
+//  
+//  Forms Jacobian of partials of geodetic WRT ECF at given point.
+//           -                           -
+//           | pLat/pX  pLat/pY  pLat/pZ |
+//    jMat = | pLon/pX  pLon/pY  pLon/pZ |
+//           | pHgt/pX  pHgt/pY  pHgt/pZ |
+//           -                           -
+//  
+//*****************************************************************************
+void ossimEllipsoid::jacobianWrtEcef(const ossimEcefPoint& location,
+                                           NEWMAT::Matrix& jMat) const
+{
+   double primeVert;
+   double merRadius;
+   double lat, lon, hgt;
+   
+   XYZToLatLonHeight(location.x(), location.y(), location.z(), lat, lon, hgt);
+   prinRadiiOfCurv(location, merRadius, primeVert);
+   
+   double sinPhi = sin(lat*RAD_PER_DEG);
+   double cosPhi = cos(lat*RAD_PER_DEG);
+   double sinLam = sin(lon*RAD_PER_DEG);
+   double cosLam = cos(lon*RAD_PER_DEG);
+   double N_plus_h = primeVert + hgt;
+   double M_plus_h = merRadius + hgt;
+   
+   jMat(1,1) = -sinPhi * cosLam / M_plus_h;
+   jMat(2,1) = -sinLam / (cosPhi * N_plus_h);
+   jMat(3,1) = cosPhi * cosLam;
+   jMat(1,2) = -sinPhi * sinLam / M_plus_h;
+   jMat(2,2) =  cosLam / (cosPhi * N_plus_h);
+   jMat(3,2) = cosPhi * sinLam;
+   jMat(1,3) = cosPhi / M_plus_h;
+   jMat(2,3) = 0.0;
+   jMat(3,3) = sinPhi;
+}
+
+ 
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::jacobianWrtGeo()
+//  
+//  Forms Jacobian of partials of ECF WRT geodetic at given point.
+//           -                           -
+//           | pX/pLat  pX/pLon  pX/pHgt |
+//    jMat = | pY/pLat  pY/pLon  pY/pHgt |
+//           | pZ/pLat  pZ/pLon  pZ/pHgt |
+//           -                           -
+//  
+//*****************************************************************************
+void ossimEllipsoid::jacobianWrtGeo(const ossimEcefPoint& location,
+                                          NEWMAT::Matrix& jMat) const
+{
+   double primeVert;
+   double merRadius;
+   double lat, lon, hgt;
+   
+   XYZToLatLonHeight(location.x(), location.y(), location.z(), lat, lon, hgt);
+   prinRadiiOfCurv(location, merRadius, primeVert);
+   
+   double sinPhi = sin(lat*RAD_PER_DEG);
+   double cosPhi = cos(lat*RAD_PER_DEG);
+   double sinLam = sin(lon*RAD_PER_DEG);
+   double cosLam = cos(lon*RAD_PER_DEG);
+   double N_plus_h = primeVert + hgt;
+   double M_plus_h = merRadius + hgt;
+   
+   jMat(1,1) = -M_plus_h * sinPhi * cosLam;
+   jMat(2,1) = -M_plus_h * sinPhi * sinLam;
+   jMat(3,1) =  M_plus_h * cosPhi;
+   jMat(1,2) = -N_plus_h * cosPhi * sinLam;
+   jMat(2,2) =  N_plus_h * cosPhi * cosLam;
+   jMat(3,2) = 0.0;
+   jMat(1,3) = cosPhi * cosLam;
+   jMat(2,3) = cosPhi * sinLam;
+   jMat(3,3) = sinPhi;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimEllipsoid::geodeticRadius()
+//  
+//  Computes the "geodetic" radius for a given latitude in degrees
+//  
+//*****************************************************************************
+double ossimEllipsoid::geodeticRadius(const double& lat) const
+{
+   double cos_lat = ossim::cosd(lat);
+   double sin_lat = ossim::sind(lat);
+   double cos2_lat = cos_lat*cos_lat;
+   double sin2_lat = sin_lat*sin_lat;
+   double a2_cos = theA_squared*cos_lat;
+   double b2_sin = theB_squared*sin_lat;
+   
+   return sqrt( ( (a2_cos*a2_cos) + (b2_sin*b2_sin) )/ (theA_squared*cos2_lat + theB_squared*sin2_lat));
+}
+
+//*************************************************************************************************
+//  Computes the "geodetic" radius of curvature of the ellipsoid in the east-west (x) and
+//  north-south (y) directions for a given latitude in DEGREES.
+//  Taken from http://en.wikipedia.org/wiki/Earth_radius
+//*************************************************************************************************
+void ossimEllipsoid::geodeticRadii(const double& lat, ossimDpt& radii) const
+{
+   double cos_lat = ossim::cosd(lat);
+   double sin_lat = ossim::sind(lat);
+   double cos2_lat = cos_lat*cos_lat;
+   double sin2_lat = sin_lat*sin_lat;
+   double H = theA_squared*cos2_lat + theB_squared*sin2_lat;
+   double H3 = H*H*H;
+
+   radii.x = theA_squared/sqrt(H);
+   radii.y = theA_squared*theB_squared/sqrt(H3);
+}
+
+void ossimEllipsoid::latLonHeightToXYZ(double lat, double lon, double height,
+                                       double &x, double &y, double &z)const
+{
+    double sin_latitude = ossim::sind(lat);
+    double cos_latitude = ossim::cosd(lat);
+    double N = theA / sqrt( 1.0 - theEccentricitySquared*sin_latitude*sin_latitude);
+    x = (N+height)*cos_latitude*ossim::cosd(lon);
+    y = (N+height)*cos_latitude*ossim::sind(lon);
+    z = (N*(1-theEccentricitySquared)+height)*sin_latitude;
+}
+
+void ossimEllipsoid::XYZToLatLonHeight(double x, double y, double z,
+                                       double& lat, double& lon, double& height)const
+{
+
+#if 1
+  // Author: Norman J. Goldstein (ngoldstein at SystemSolutionsRD.com, 
+//                              normvcr at telus.net)
+
+  const double tol = 1e-15;
+  const double d = sqrt(x*x + y*y);
+  const int MAX_ITER = 10;
+
+  const double a2 = theA * theA;
+  const double b2 = theB * theB;
+  const double pa2 = d * d * a2;
+  const double qb2 = z * z * b2;
+  const double ae2 = a2 * eccentricitySquared();
+  const double ae4 = ae2 * ae2;
+
+  const double c3 = -( ae4/2 + pa2 + qb2 );          // s^2
+  const double c4 = ae2*( pa2 - qb2 );               // s^1
+  const double c5 = ae4/4 * ( ae4/4 - pa2 - qb2 );   // s^0
+
+  double s0 = 0.5 * (a2 + b2) * hypot( d/theA, z/theB );
+
+  for( int iterIdx = 0; iterIdx < MAX_ITER; ++iterIdx )
+  {
+    const double pol = c5 + s0 * ( c4 + s0 * ( c3 + s0 * s0 ) );
+    const double der = c4 + s0 * ( 2 * c3  + 4 * s0 * s0 );
+
+    const double ds = - pol / der;
+    s0 += ds;
+
+    if( fabs( ds ) < tol * s0 )
+    {
+      const double t = s0 - 0.5 * (a2 + b2);
+      const double x_ell = d / ( 1.0 + t/a2 );
+      const double y_ell = z / ( 1.0 + t/b2 );
+
+      height = ( d - x_ell ) * x_ell/a2 + ( z - y_ell ) * y_ell/b2;
+      height /= hypot( x_ell/a2 ,  y_ell/b2 );
+
+      lat = atan2( y_ell/b2, x_ell/a2 ) * DEG_PER_RAD;
+      lon = atan2( y, x ) * DEG_PER_RAD;
+
+      return;
+    }
+  }
+
+  #else
+   double d = sqrt(x*x + y*y);
+
+   double phi2 = z / ((1 - theEccentricitySquared) * d);
+   double p = 1.0;
+   double phi1 = 0.0;
+   double N1 = 0.0;
+   double height1 = 0.0;
+   int iterIdx = 0;
+   const int MAX_ITER = 10;
+   if (fabs(phi2) > 1e-16 )
+   {
+      while ( (p > 1e-17) && (iterIdx < MAX_ITER))
+      {
+         phi1 = phi2;
+         N1 = theA / sqrt(1.0 - (theEccentricitySquared * pow(sin(phi1), 2.0)));
+         height1 = (d / cos(phi1) - N1);
+         phi2 = atan((z / d) * (1.0 + (theEccentricitySquared * N1 * sin(phi1)) / z));
+         p = fabs(phi2 - phi1);
+         ++iterIdx;
+         /* printf("phi: %e   phi2: %e   p: %e  \n", phi1, phi2, p); */
+      }                                                                                           
+   }                                                                                                   
+   else
+   {                                                                                              
+      phi1 = phi2;                                                                                
+      N1 = theA / sqrt(1.0 - (theEccentricitySquared * pow(sin(phi1), 2.0)));                    
+      height1 = (d / cos(phi1)) - N1;                                                             
+   }                                                                                                   
+
+   /* *Latitude = phi2 * 180/PI; */
+   /* *Longitude = atan2(Y, X) * 180/PI; */
+   lat = phi2*DEG_PER_RAD; 
+   lon = atan2(y, x)*DEG_PER_RAD;                                                                
+   height = height1; 
+#endif
+}
+
+void ossimEllipsoid::computeLocalToWorldTransformFromXYZ(double x, double y, double z,
+                                                         ossimMatrix4x4& localToWorld)const
+{
+   localToWorld = ossimMatrix4x4::createIdentity();
+   NEWMAT::Matrix& m = localToWorld.getData();
+
+   // put in the translation
+   m[0][3] = x;
+   m[1][3] = y;
+   m[2][3] = z;
+   
+
+
+    // normalize X,Y,Z
+    double inverse_length = 1.0/sqrt(x*x + y*y + z*z);
+    
+    x *= inverse_length;
+    y *= inverse_length;
+    z *= inverse_length;
+
+    double length_XY = sqrt(x*x + y*y);
+    double inverse_length_XY = 1.0/length_XY;
+
+    // Vx = |(-Y,X,0)|
+    m[0][0] = -y*inverse_length_XY;
+    m[1][0] = x*inverse_length_XY;
+    m[2][0] = 0.0;
+
+    // Vy = /(-Z*X/(sqrt(X*X+Y*Y), -Z*Y/(sqrt(X*X+Y*Y),sqrt(X*X+Y*Y))| 
+    double Vy_x = -z*x*inverse_length_XY;
+    double Vy_y = -z*y*inverse_length_XY;
+    double Vy_z = length_XY;
+    inverse_length = 1.0/sqrt(Vy_x*Vy_x + Vy_y*Vy_y + Vy_z*Vy_z);            
+    m[0][1] = Vy_x*inverse_length;
+    m[1][1] = Vy_y*inverse_length;
+    m[2][1] = Vy_z*inverse_length;
+
+    // Vz = (X,Y,Z)
+    m[0][2] = x;
+    m[1][2] = y;
+    m[2][2] = z;
+   
+}
+
+ossim_uint32 ossimEllipsoid::getEpsgCode() const
+{
+   if (!theCode.empty() && (theEpsgCode == 0))
+      theEpsgCode = ossimEllipsoidFactory::instance()->findEpsgCode(theCode);
+   return theEpsgCode;
+}
+
+const ossimEllipsoid& ossimEllipsoid::operator=(const ossimEllipsoid& copy_me)
+{
+   if (this != &copy_me)
+   {
+      theName = copy_me.theName;
+      theCode = copy_me.theCode;
+      theEpsgCode = copy_me.theEpsgCode;
+      theA = copy_me.theA;  
+      theB = copy_me.theB;  
+      theFlattening = copy_me.theFlattening;
+      theA_squared = copy_me.theA_squared;
+      theB_squared = copy_me.theB_squared;
+      theEccentricitySquared = copy_me.theEccentricitySquared;
+   }
+   return *this;
+}
diff --git a/src/base/ossimEllipsoidFactory.cpp b/src/base/ossimEllipsoidFactory.cpp
new file mode 100644
index 0000000..f6bdbca
--- /dev/null
+++ b/src/base/ossimEllipsoidFactory.cpp
@@ -0,0 +1,242 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+// 
+//*******************************************************************
+//  $Id: ossimEllipsoidFactory.cpp 22905 2014-09-30 13:49:12Z dburken $
+
+#include <ossim/base/ossimEllipsoidFactory.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimString.h>
+
+ossimEllipsoidFactory* ossimEllipsoidFactory::instance()
+{
+   static ossimEllipsoidFactory inst;
+
+   //---
+   // Boolean test here is necessary to avoid infinite loop from Ellipsoid
+   // classes calling this factory's instance() method. Leave this convoluted
+   // code as is. (OLK 09/14)
+   //---
+   static bool testInst = false;
+   if(!testInst)
+   {
+      testInst = true;
+      inst.initializeTable();
+   }
+   
+   return &inst;
+} 
+
+ossimEllipsoidFactory::ossimEllipsoidFactory()
+{
+}
+
+ossimEllipsoidFactory::~ossimEllipsoidFactory()
+{
+   deleteAll();
+}
+
+const ossimEllipsoid* ossimEllipsoidFactory::create(const ossimString &code)const
+{
+   // Can be 2-letter code or EPSG integer code for ellipsoids (7000-series). Make sure it is alpha:
+   if ( code.empty() )
+   {
+      return 0;
+   }
+
+   const ossimEllipsoid* ellipsoid = 0;
+   ossimString alphaCode = code;
+
+   // Check if the code passed in was actually numeric EPSG (vs. two char alpha code):
+      ossim_uint32 epsg_code = code.toUInt32();
+      if (epsg_code)
+      {
+         // EPSG was specified, fetch the equivalent alpha code from the map:
+         EpsgTableType::const_iterator iter = theEpsgTable.find(epsg_code);
+         if (iter != theEpsgTable.end())
+            alphaCode = (*iter).second;
+         }
+
+      // Established two-letter code. Now fetch the ellipsoid instance:
+      TableType::const_iterator iter = theEllipsoidTable.find(alphaCode);
+      if(iter != theEllipsoidTable.end())
+         ellipsoid = iter->second;
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimEllipsoidFactory::create WARNING:"
+            << "\nDid not create ellipsoid for code: " << code << std::endl;
+      }
+   
+   return ellipsoid;
+}
+
+void ossimEllipsoidFactory::initializeTable()
+{
+   // Do nothing if tables were already initialized:
+   if (!theEllipsoidTable.empty())
+   {
+      return;
+   }
+
+   // This table bridges between EPSG 7000-series codes to two-letter code:
+   theEpsgTable.insert(std::make_pair(7001, std::string("AA")));   
+   theEpsgTable.insert(std::make_pair(7002, std::string("AM")));
+   theEpsgTable.insert(std::make_pair(7003, std::string("AN")));
+   theEpsgTable.insert(std::make_pair(7004, std::string("BR")));
+   theEpsgTable.insert(std::make_pair(7006, std::string("BN")));
+   theEpsgTable.insert(std::make_pair(7008, std::string("CC")));
+   theEpsgTable.insert(std::make_pair(7012, std::string("CD")));
+   theEpsgTable.insert(std::make_pair(7011, std::string("CE")));
+   theEpsgTable.insert(std::make_pair(7015, std::string("EA")));
+   theEpsgTable.insert(std::make_pair(7016, std::string("EB")));
+   theEpsgTable.insert(std::make_pair(7044, std::string("EC")));
+   theEpsgTable.insert(std::make_pair(7056, std::string("ED")));
+   theEpsgTable.insert(std::make_pair(7018, std::string("EE")));
+   theEpsgTable.insert(std::make_pair(7019, std::string("RF")));
+   theEpsgTable.insert(std::make_pair(7020, std::string("HE")));
+   theEpsgTable.insert(std::make_pair(7053, std::string("HO")));
+   theEpsgTable.insert(std::make_pair(7021, std::string("ID")));
+   theEpsgTable.insert(std::make_pair(7022, std::string("IN")));
+   theEpsgTable.insert(std::make_pair(7024, std::string("KA")));
+   theEpsgTable.insert(std::make_pair(7003, std::string("SA"))); // Same as "AN"
+   theEpsgTable.insert(std::make_pair(7043, std::string("WD")));
+   theEpsgTable.insert(std::make_pair(7030, std::string("WE")));
+   theEpsgTable.insert(std::make_pair(7059, std::string("PV")));
+
+   theEllipsoidTable.insert(std::make_pair(std::string("AA"),
+      new ossimEllipsoid(std::string("Airy"), std::string("AA"), 
+      6377563.396, 6356256.9090, 7001)));   
+   theEllipsoidTable.insert(std::make_pair(std::string("AM"),
+      new ossimEllipsoid(std::string("Modified Airy"), std::string("AM"), 
+      6377340.189, 6356034.448, 7002)));
+   theEllipsoidTable.insert(std::make_pair(std::string("AN"),
+      new ossimEllipsoid(std::string("Australian National"), std::string("AN"), 
+      6378160.000, 6356774.7190, 7003)));
+   theEllipsoidTable.insert(std::make_pair(std::string("BR"),
+      new ossimEllipsoid(std::string("Bessel 1841"), std::string("BR"), 
+      6377397.155, 6356078.9630, 7004)));
+   theEllipsoidTable.insert(std::make_pair(std::string("BN"),
+      new ossimEllipsoid(std::string("Bessel 1841(Namibia)"), std::string("BN"), 
+      6377483.865, 6356165.3830, 7006)));
+   theEllipsoidTable.insert(std::make_pair(std::string("CC"),
+      new ossimEllipsoid(std::string("Clarke 1866"), std::string("CC"), 
+      6378206.400, 6356583.8000, 7008)));
+   theEllipsoidTable.insert(std::make_pair(std::string("CD"),
+      new ossimEllipsoid(std::string("Clarke 1880"), std::string("CD"), 
+      6378249.145, 6356514.8700, 7012)));
+   theEllipsoidTable.insert(std::make_pair(std::string("CE"),
+      new ossimEllipsoid(std::string("Clarke 1880 (IGN)EPSG 7011"), std::string("CE"), 
+      6378249.200, 6356515.0000, 7011)));
+   theEllipsoidTable.insert(std::make_pair(std::string("EA"),
+      new ossimEllipsoid(std::string("Everest"), std::string("EA"), 
+      6377276.345, 6356075.4130, 7015)));
+   theEllipsoidTable.insert(std::make_pair(std::string("EB"),
+      new ossimEllipsoid(std::string("Everest (E. Malasia, Brunei)"), std::string("EB"), 
+      6377298.556, 6356097.55, 7016)));
+   theEllipsoidTable.insert(std::make_pair(std::string("EC"),
+      new ossimEllipsoid(std::string("Everest 1956 (India)"), std::string("EC"), 
+      6377301.243, 6356100.228, 7044)));
+   theEllipsoidTable.insert(std::make_pair(std::string("ED"),
+      new ossimEllipsoid(std::string("Everest 1969 (West Malasia)"), std::string("ED"), 
+      6377295.664, 6356094.668, 7056)));
+   theEllipsoidTable.insert(std::make_pair(std::string("EE"),
+      new ossimEllipsoid(std::string("Everest 1948(W.Mals. & Sing.)"), std::string("EE"), 
+      6377304.063, 6356103.039, 7018)));
+
+   // No codes for next two:
+   theEllipsoidTable.insert(std::make_pair(std::string("EF"),
+      new ossimEllipsoid(std::string("Everest (Pakistan)"), std::string("EF"), 
+                         6377309.613, 6356109.571, 0)));
+   theEllipsoidTable.insert(std::make_pair(std::string("FA"),
+      new ossimEllipsoid(std::string("Mod. Fischer 1960(South Asia)"), std::string("FA"), 
+                         6378155.0, 6356773.32, 0)));
+      
+   theEllipsoidTable.insert(std::make_pair(std::string("RF"),
+      new ossimEllipsoid(std::string("GRS 80"), std::string("RF"), 
+      6378137.0, 6356752.3141, 7019)));
+   theEllipsoidTable.insert(std::make_pair(std::string("HE"),
+      new ossimEllipsoid(std::string("Helmert 1906"), std::string("HE"), 
+      6378200.0, 6356818.17, 7020)));
+   theEllipsoidTable.insert(std::make_pair(std::string("HO"),
+      new ossimEllipsoid(std::string("Hough"), std::string("HO"), 
+      6378270.0, 6356794.3430, 7053)));
+   theEllipsoidTable.insert(std::make_pair(std::string("ID"),
+      new ossimEllipsoid(std::string("Indonesian 1974"), std::string("ID"), 
+      6378160.0, 6356774.504, 7021)));
+   theEllipsoidTable.insert(std::make_pair(std::string("IN"),
+      new ossimEllipsoid(std::string("International 1924"), std::string("IN"), 
+      6378388.0, 6356911.946, 7022)));
+   theEllipsoidTable.insert(std::make_pair(std::string("KA"),
+      new ossimEllipsoid(std::string("Krassovsky"), std::string("KA"), 
+      6378245.0, 6356863.0190, 7024)));
+   theEllipsoidTable.insert(std::make_pair(std::string("SA"),
+      new ossimEllipsoid(std::string("South American 1969"),std::string("SA"), 
+      6378160.0, 6356774.719, 7003)));
+   theEllipsoidTable.insert(std::make_pair(std::string("WD"),
+      new ossimEllipsoid(std::string("WGS 72"), std::string("WD"), 
+      6378135.000, 6356750.5200, 7043)));
+   theEllipsoidTable.insert(std::make_pair(std::string("WE"),
+      new ossimEllipsoid(std::string("WGS 84"), std::string("WE"), 
+      6378137.000, 6356752.3142, 7030)));
+   theEllipsoidTable.insert(std::make_pair(std::string("PV"),
+      new ossimEllipsoid(std::string("Popular Visualization Sphere"), std::string("7059"), 
+      6378137.000, 6378137.000, 7059)));
+
+   theWgs84Ellipsoid = new ossimEllipsoid(std::string("WGS 84"), std::string("WE"), 
+      6378137.000, 6356752.3142, 7030);
+   theWgs72Ellipsoid = new ossimEllipsoid(std::string("WGS 72"), std::string("WD"), 
+      6378135.000, 6356750.5200, 7043);
+}
+
+void ossimEllipsoidFactory::deleteAll()
+{
+   TableType::const_iterator ellipsoid = theEllipsoidTable.begin();
+   
+   while(ellipsoid != theEllipsoidTable.end())
+   {
+      delete (*ellipsoid).second;
+      ++ellipsoid;
+   }
+
+   theEllipsoidTable.clear();
+   theEpsgTable.clear();
+
+   if (theWgs84Ellipsoid)
+   {
+      delete theWgs84Ellipsoid;
+      theWgs84Ellipsoid = 0;
+   }
+   if (theWgs72Ellipsoid)
+   {
+      delete theWgs72Ellipsoid;
+      theWgs72Ellipsoid = 0;
+   }
+}
+
+//*************************************************************************************************
+// Given an alpha code (for example "WE" for WGS84), returns the corresponding EPSG code or 0
+// if not found.
+//*************************************************************************************************
+ossim_uint32 ossimEllipsoidFactory::findEpsgCode(const ossimString& alpha_code) const
+{
+   ossim_uint32 epsg_code = 0;
+   if (alpha_code.empty())
+      return 0;
+
+   EpsgTableType::const_iterator iter = theEpsgTable.begin();
+   while ((iter != theEpsgTable.end()) && (epsg_code == 0))
+   {
+      if (iter->second == alpha_code.string())
+      {
+         epsg_code = iter->first;
+      }
+      iter++;
+   }
+   return epsg_code;
+}
diff --git a/ossim/src/ossim/base/ossimEndian.cpp b/src/base/ossimEndian.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimEndian.cpp
rename to src/base/ossimEndian.cpp
diff --git a/src/base/ossimEnvironmentUtility.cpp b/src/base/ossimEnvironmentUtility.cpp
new file mode 100644
index 0000000..9667640
--- /dev/null
+++ b/src/base/ossimEnvironmentUtility.cpp
@@ -0,0 +1,318 @@
+#include <ossim/base/ossimEnvironmentUtility.h>
+#include <cstdlib>
+#include <sstream>
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#  define OSSIM_ENVIRONMENT_UTILITY_UNIX 0
+#  include <direct.h>
+#else
+#  define OSSIM_ENVIRONMENT_UTILITY_UNIX 1
+#endif
+
+using namespace std;
+
+ossimEnvironmentUtility* ossimEnvironmentUtility::theInstance=0;
+
+ossimEnvironmentUtility::ossimEnvironmentUtility()
+{
+   ossimFilename dir = getUserOssimPluginDir();
+   
+   if(!dir.empty())
+   {
+      thePluginSearchPath.push_back(dir);
+   }
+   
+   dir = getInstalledOssimPluginDir();
+   if(!dir.empty())
+   {   
+      thePluginSearchPath.push_back(dir);
+   }
+
+   
+}
+
+ossimEnvironmentUtility* ossimEnvironmentUtility::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimEnvironmentUtility;
+   }
+
+   return theInstance;
+}
+
+ossimString ossimEnvironmentUtility::getEnvironmentVariable(const ossimString& variable)const
+{
+   ossimString result;
+   char* lookup = std::getenv(variable.c_str());
+   // getenv returns NULL if not found.
+   if (lookup)
+   {
+      result = (const char*)lookup;
+   }
+   return result;
+}
+
+void ossimEnvironmentUtility::setEnvironmentVariable(const char* variable, const char* value) const
+{
+#if OSSIM_ENVIRONMENT_UTILITY_UNIX
+   setenv(variable,  value,    1); // For backwards compatiblity.
+#else
+   ostringstream arg;
+   arg<<variable<<"="<<value;
+   _putenv( arg.str().c_str() );
+#endif
+}
+
+ossimFilename ossimEnvironmentUtility::getUserOssimSupportDir()const
+{
+   ossimFilename result = getUserDir();
+   
+#if OSSIM_ENVIRONMENT_UTILITY_UNIX
+#   ifdef __APPLE__
+   result = result.dirCat("Library/Application Support/ossim");
+   
+#   else
+   result = result.dirCat(".ossim");
+#   endif
+#else
+   result = result.dirCat("Application Data\\ossim");
+#endif
+   
+   return result;
+}
+
+ossimString   ossimEnvironmentUtility::getUserName()const
+{
+#if OSSIM_ENVIRONMENT_UTILITY_UNIX
+   return getEnvironmentVariable("USER");
+#else
+   return getEnvironmentVariable("USERNAME");
+#endif
+}
+
+ossimFilename ossimEnvironmentUtility::getUserDir()const
+{
+   ossimFilename result;
+
+#if OSSIM_ENVIRONMENT_UTILITY_UNIX
+   result = ossimFilename(getEnvironmentVariable("HOME"));
+#else
+   result =ossimFilename(getEnvironmentVariable("USERPROFILE"));
+#endif
+
+   return result;
+}
+
+ossimFilename ossimEnvironmentUtility::getUserOssimPreferences()const
+{
+   ossimFilename result = getUserOssimSupportDir();
+
+   if(result == "")
+   {
+      return "";
+   }
+
+   result = result.dirCat("preferences");
+   
+   return result;
+}
+
+ossimFilename ossimEnvironmentUtility::getUserOssimPluginDir()const
+{
+   ossimFilename result = getUserOssimSupportDir();
+
+   if(result != "")
+   {
+      result = result.dirCat("plugins");
+   }
+   
+   return result;
+}
+
+ossimFilename ossimEnvironmentUtility::getInstalledOssimSupportDir()const
+{
+   ossimFilename result;
+#if OSSIM_ENVIRONMENT_UTILITY_UNIX
+#   ifdef __APPLE__
+   result = "/Library/Application Support/ossim";
+#   else
+   result = "/usr/share/ossim";
+   if(!result.exists())
+   {
+      result = "/usr/local/share/ossim";
+   }
+#   endif
+#else
+   // NEED the windows test here.
+#endif
+   if(result != "")
+   {
+      if(!result.exists())
+      {
+         result = "";
+      }
+   }
+
+   return result;
+}
+
+ossimFilename ossimEnvironmentUtility::getInstalledOssimPluginDir()const
+{
+   ossimFilename result = getInstalledOssimSupportDir();
+
+   //Need generic unix plugin location
+#if OSSIM_ENVIRONMENT_UTILITY_UNIX
+#   ifndef __APPLE__
+   return "";
+#   endif
+#endif
+   if((result!="")&&result.exists())
+   {
+      result = result.dirCat("plugins");
+   }
+   else
+   {
+      result = "";
+   }
+
+   return result;
+
+}
+
+ossimFilename ossimEnvironmentUtility::getInstalledOssimPreferences()const
+{
+   ossimFilename result = getInstalledOssimSupportDir();
+
+   
+   if((result!="")&&result.exists())
+   {
+      result = result.dirCat("preferences");
+   }
+   else
+   {
+      result = "";
+   }
+
+   if(!result.exists())
+   {
+      result = "";
+   }
+   
+   return result;
+   
+}
+
+ossimFilename ossimEnvironmentUtility::getCurrentWorkingDir()const
+{
+   ossimFilename result;
+
+#if OSSIM_ENVIRONMENT_UTILITY_UNIX
+   result = getEnvironmentVariable("PWD");
+#else
+   char buf[512];
+   _getcwd(buf, 512);
+   result = buf;
+#endif
+
+   return result;
+}
+
+ossimFilename ossimEnvironmentUtility::searchAllPaths(const ossimFilename& file)const
+{
+   ossimFilename result;
+
+   result = findPlugin(file);
+   if(!result.empty()) return result;
+
+   result = findData(file);
+
+
+   return result;
+}
+
+void ossimEnvironmentUtility::addDataSearchPath(const ossimFilename& path)
+{
+   theDataSearchPath.push_back(path);
+}
+
+void ossimEnvironmentUtility::addDataSearchPathToFront(const ossimFilename& path)
+{
+   theDataSearchPath.insert(theDataSearchPath.begin(), path);
+}
+
+void ossimEnvironmentUtility::addPluginSearchPath(const ossimFilename& path)
+{
+   thePluginSearchPath.push_back(path);
+}
+
+void ossimEnvironmentUtility::addPluginSearchPathToFront(const ossimFilename& path)
+{
+   thePluginSearchPath.insert(thePluginSearchPath.begin(), path);
+}
+
+ossimFilename ossimEnvironmentUtility::findPlugin(const ossimFilename& plugin)const
+{
+   for(ossimEnvironmentUtility::FilenameListType::const_iterator iter = thePluginSearchPath.begin();
+       iter != thePluginSearchPath.end();
+       ++iter)
+   {
+      ossimFilename temp = iter->dirCat(plugin);
+      if(temp.exists())
+      {
+         return temp;
+      }
+   }
+
+   return "";
+}
+
+ossimFilename ossimEnvironmentUtility::findData(const ossimFilename& data)const
+{
+   for(ossimEnvironmentUtility::FilenameListType::const_iterator iter = theDataSearchPath.begin();
+       iter != theDataSearchPath.end();
+       ++iter)
+   {
+      ossimFilename temp = iter->dirCat(data);
+      if(temp.exists())
+      {
+         return temp;
+      }
+   }
+
+   return "";
+}
+
+
+ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getPluginSearchPath()
+{
+   return thePluginSearchPath;
+}
+
+const ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getPluginSearchPath()const
+{
+   return thePluginSearchPath;
+}
+
+ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getDataSearchPath()
+{
+   return theDataSearchPath;
+}
+
+const ossimEnvironmentUtility::FilenameListType& ossimEnvironmentUtility::getDataSearchPath()const
+{
+   return theDataSearchPath;
+}
+
+// Hidden copy constructor.
+ossimEnvironmentUtility::ossimEnvironmentUtility(
+   const ossimEnvironmentUtility& /* obj */)
+{
+}
+
+// Hidden operator=
+const ossimEnvironmentUtility& ossimEnvironmentUtility::operator=(
+   const ossimEnvironmentUtility& /* rhs */)
+{
+   return *this;
+}
diff --git a/ossim/src/ossim/base/ossimEpsgDatumFactory.cpp b/src/base/ossimEpsgDatumFactory.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimEpsgDatumFactory.cpp
rename to src/base/ossimEpsgDatumFactory.cpp
diff --git a/src/base/ossimEquTokenizer.cpp b/src/base/ossimEquTokenizer.cpp
new file mode 100644
index 0000000..4ad5448
--- /dev/null
+++ b/src/base/ossimEquTokenizer.cpp
@@ -0,0 +1,1817 @@
+//#define yyFlexLexer ossimEquTokenizerFlexLexer
+//#define yywrap ossimEquTokenizerwrap
+#include <ossim/base/ossimEquTokenizer.h>
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header$
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <cstdio> /* for EOF */
+#include <cstdlib>
+#include <iostream>
+#include <fstream>
+using namespace std;
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif	/* __STDC__ */
+#endif	/* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ * 	if ( condition_holds )
+ *		yyless( 5 );
+ *	else
+ *		do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		*yy_cp = yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+	{
+	istream* yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+	};
+
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! yy_current_buffer ) \
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+	yy_current_buffer->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+#define yytext_ptr yytext
+#define YY_INTERACTIVE
+
+//#include <ossim/base/ossimFlexLexer.h>
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 52
+#define YY_END_OF_BUFFER 53
+static yyconst short int yy_accept[119] =
+    {   0,
+        0,    0,   53,   52,    1,   11,    7,   14,   15,    5,
+        9,    3,   10,   52,    4,    2,   49,   52,   47,   52,
+       12,   13,   16,   52,   52,   52,   52,   52,   52,   52,
+       52,   52,   52,    6,    8,    1,    2,    2,    2,    0,
+       50,   51,   46,   48,   19,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,   18,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    2,   35,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,   27,   22,   20,   38,
+       37,    0,   23,    0,   31,   17,    0,    2,   29,   25,
+        0,   33,   42,    0,    0,   44,   39,   28,    0,    0,
+
+       24,   36,   32,   30,   26,    0,   34,   41,   45,   21,
+       40,    0,    0,    0,    0,    0,   43,    0
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    1,    1,    1,    3,    4,    1,    5,
+        6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
+       15,   15,   15,   15,   15,   15,   15,    1,    1,   16,
+       17,   18,    1,    1,    1,    1,    1,    1,   19,    1,
+        1,    1,   20,    1,    1,    1,    1,    1,    1,   21,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+       22,    1,   23,   24,   25,    1,   26,   27,   28,   29,
+
+       30,   31,   32,   33,   34,    1,    1,   35,   36,   37,
+       38,   39,   40,   41,   42,   43,   44,   45,    1,   46,
+        1,    1,    1,   47,    1,   48,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[49] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1
+    } ;
+
+static yyconst short int yy_base[119] =
+    {   0,
+        0,    0,  170,  171,  167,  171,  171,  171,  171,  171,
+      171,  171,  171,   36,  171,   41,   40,  151,  150,  146,
+      171,  171,  171,   34,   33,   28,  119,  127,  125,   38,
+       40,  136,  123,  171,  171,  158,   68,   71,   78,   92,
+      171,  171,  171,  171,  171,  117,  120,   33,  131,  119,
+      111,   44,   57,  115,  171,  121,  106,  114,  116,  112,
+      107,  110,  105,  101,  104,  107,  171,  103,  107,  109,
+      105,  112,   99,  103,   99,   92,  107,  171,  121,  171,
+      171,  103,  104,   89,  102,  171,  110,  113,  101,  100,
+       81,   83,  171,   69,   65,  171,  171,  171,   90,   53,
+
+      171,  171,  171,  171,  171,   58,  171,  171,  171,  171,
+      171,   63,   52,   43,   28,   24,  171,  171
+    } ;
+
+static yyconst short int yy_def[119] =
+    {   0,
+      118,    1,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,    0
+    } ;
+
+static yyconst short int yy_nxt[220] =
+    {   0,
+        4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
+       14,   15,   16,   16,   16,   17,   18,   19,    4,    4,
+       20,   21,   22,   23,    4,   24,   25,   26,    4,   27,
+        4,    4,    4,   28,   29,   30,    4,    4,    4,    4,
+        4,   31,   32,    4,    4,   33,   34,   35,   37,   37,
+       37,   38,  117,   39,   39,   39,   41,   42,   50,   40,
+       46,   47,   52,   57,  116,   53,   69,   51,  115,   74,
+       40,   58,   59,   60,   70,   48,   49,   75,  114,   61,
+       37,   37,   37,   37,   37,   37,   64,  113,   38,   40,
+       39,   39,   39,   76,  112,  111,   40,   64,   77,   65,
+
+       40,   65,  110,  109,   66,   66,   66,   40,   87,  108,
+       87,  107,  106,   88,   88,   88,   66,   66,   66,   66,
+       66,   66,   88,   88,   88,   88,   88,   88,  105,  104,
+      103,  102,  101,  100,   99,   98,   97,   96,   95,   94,
+       93,   92,   91,   90,   89,   86,   85,   84,   83,   82,
+       81,   80,   79,   78,   73,   72,   71,   68,   67,   36,
+       63,   62,   56,   55,   54,   45,   44,   43,   36,  118,
+        3,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118
+    } ;
+
+static yyconst short int yy_chk[220] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,   14,   14,
+       14,   16,  116,   16,   16,   16,   17,   17,   25,   16,
+       24,   24,   26,   30,  115,   26,   48,   25,  114,   52,
+       16,   30,   31,   31,   48,   24,   24,   52,  113,   31,
+       37,   37,   37,   38,   38,   38,   37,  112,   39,   38,
+       39,   39,   39,   53,  106,  100,   39,   37,   53,   40,
+
+       38,   40,   99,   95,   40,   40,   40,   39,   64,   94,
+       64,   92,   91,   64,   64,   64,   65,   65,   65,   66,
+       66,   66,   87,   87,   87,   88,   88,   88,   90,   89,
+       85,   84,   83,   82,   79,   77,   76,   75,   74,   73,
+       72,   71,   70,   69,   68,   63,   62,   61,   60,   59,
+       58,   57,   56,   54,   51,   50,   49,   47,   46,   36,
+       33,   32,   29,   28,   27,   20,   19,   18,    5,    3,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+
+      118,  118,  118,  118,  118,  118,  118,  118,  118,  118,
+      118,  118,  118,  118,  118,  118,  118,  118,  118
+    } ;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+//#line 1 "ossimEquTokenizer.l"
+#define INITIAL 0
+//#line 2 "ossimEquTokenizer.l"
+#include <ossim/base/ossimEquTokenDefines.h>
+//#line 413 "lex.ossimEquTokenizer.cc"
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+#define ECHO LexerOutput( yytext, yyleng )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
+		YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) LexerError( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yyFlexLexer::yylex()
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+YY_DECL
+	{
+	yy_state_type yy_current_state;
+	char *yy_cp = NULL, *yy_bp = NULL;
+	int yy_act;
+
+//#line 15 "ossimEquTokenizer.l"
+
+
+//#line 543 "lex.ossimEquTokenizer.cc"
+
+	if ( yy_init )
+		{
+		yy_init = 0;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! yy_start )
+			yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = &cin;
+
+		if ( ! yyout )
+			yyout = &cout;
+
+		if ( ! yy_current_buffer )
+			yy_current_buffer =
+				yy_create_buffer( yyin, YY_BUF_SIZE );
+
+		yy_load_buffer_state();
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yy_start;
+yy_match:
+		do
+                {
+                   YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+                   if ( yy_accept[yy_current_state] )
+                   {
+                      yy_last_accepting_state = yy_current_state;
+                      yy_last_accepting_cpos = yy_cp;
+                   }
+                   
+                   // yy_chk size == 119
+                   // yy_base size == 119
+                   
+                   while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                   {
+                      yy_current_state = (int) yy_def[yy_current_state];
+                      if ( yy_current_state >= 119 )
+                      {
+                         yy_c = yy_meta[(unsigned int) yy_c];
+                      }
+                      
+                      //---
+                      // NOTE:
+                      // Need to test this!
+                      // Above condition yy_current_state >= 119  flaged by coverity scan
+                      // as an array out of bounds read. Both yy_chk and yy_base have
+                      // size of 119.  Added break to fix.
+                      // drb - 20150529
+                      //---
+                      if ( (yy_current_state >= 119) ||
+                           ( (yy_base[yy_current_state] + yy_c) >= 119 ) )
+                      {
+                         break;
+                      }
+                   }
+                   
+                   yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+                   ++yy_cp;
+                }
+		while ( yy_base[yy_current_state] != 171 );
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			yy_act = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yy_hold_char;
+			yy_cp = yy_last_accepting_cpos;
+			yy_current_state = yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+//#line 17 "ossimEquTokenizer.l"
+/* skip blanks and tabs */
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+//#line 19 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_CONSTANT;
+           }
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+//#line 22 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_COMMA;
+           }
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+//#line 25 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_DIV;
+           }
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+//#line 29 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_MULT;
+           }
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 33 "ossimEquTokenizer.l"
+{ 
+               return OSSIM_EQU_TOKEN_OR_BAR;
+           }
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 37 "ossimEquTokenizer.l"
+{ 
+               return OSSIM_EQU_TOKEN_AMPERSAND;
+           }
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 40 "ossimEquTokenizer.l"
+{ 
+               return OSSIM_EQU_TOKEN_TILDE;
+           }
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 44 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_PLUS;
+           }
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 47 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_MINUS;
+           }
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 50 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_MOD;
+           }
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 53 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_LEFT_ARRAY_BRACKET;
+           }
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 56 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_RIGHT_ARRAY_BRACKET;
+           }
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 59 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_LEFT_PAREN;
+        }
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 62 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_RIGHT_PAREN;
+           }
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 65 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_POWER;
+           }
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 68 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_XOR;
+        }
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 72 "ossimEquTokenizer.l"
+{
+             return OSSIM_EQU_TOKEN_IMAGE_VARIABLE;
+        }
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 75 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_PI;
+           }
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 78 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_LOG;
+           }
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 81 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_LOG10;
+           }
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 84 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_EXP;
+           } 
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 87 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_SIN;
+           }
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 90 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_SIND;
+           }
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 93 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ASIN;
+           }
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 96 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ASIND;
+           }
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 99 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_COS;
+           }
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 102 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_COSD;
+           }
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 105 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ACOS;
+           }
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 108 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ACOSD;
+           }
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 111 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_TAN;
+           }
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 114 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_TAND;
+           }
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 117 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ATAN;
+           }
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 120 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ATAND;
+           }
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 123 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ABS;
+           }
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 126 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_SQRT;
+           }
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 129 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_MIN;
+           }
+	YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 132 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_MAX;
+           }
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 135 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_CONV;
+           }
+	YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 138 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_SHIFT;
+           }
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 141 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BLURR;
+           }
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 144 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BAND;
+           }
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 147 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_ASSIGN_BAND;
+              }
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 150 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_CLIP;
+        }
+	YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 153 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_CLAMP;
+        }
+	YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 156 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BEQUAL;
+}
+	YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 159 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BGREATER;
+}
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 162 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BGREATEROREQUAL;
+}
+	YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 165 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BLESS;
+}
+	YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 168 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BLESSOREQUAL;
+}
+	YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 171 "ossimEquTokenizer.l"
+{
+               return OSSIM_EQU_TOKEN_BDIFFERENT;
+}
+	YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 175 "ossimEquTokenizer.l"
+ECHO;
+	YY_BREAK
+#line 986 "lex.ossimEquTokenizer.cc"
+case YY_STATE_EOF(INITIAL):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between yy_current_buffer and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yy_n_chars = yy_current_buffer->yy_n_chars;
+			yy_current_buffer->yy_input_file = yyin;
+			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state();
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer() )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap() )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yy_c_buf_p =
+					yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yy_c_buf_p =
+				&yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+				yy_current_state = yy_get_previous_state();
+
+				yy_cp = yy_c_buf_p;
+				yy_bp = yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of yylex */
+
+yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
+	{
+	yyin = arg_yyin;
+	yyout = arg_yyout;
+	yy_c_buf_p = 0;
+	yy_init = 1;
+	yy_start = 0;
+	yy_flex_debug = 0;
+	yylineno = 1;	// this will only get updated if %option yylineno
+
+	yy_did_buffer_switch_on_eof = 0;
+
+	yy_looking_for_trail_begin = 0;
+	yy_more_flag = 0;
+	yy_more_len = 0;
+	yy_more_offset = yy_prev_more_offset = 0;
+
+	yy_start_stack_ptr = yy_start_stack_depth = 0;
+	yy_start_stack = 0;
+
+	yy_current_buffer = 0;
+
+#ifdef YY_USES_REJECT
+	yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
+#else
+	yy_state_buf = 0;
+#endif
+	}
+
+yyFlexLexer::~yyFlexLexer()
+	{
+	delete yy_state_buf;
+	yy_delete_buffer( yy_current_buffer );
+	}
+
+void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
+	{
+	if ( new_in )
+		{
+		yy_delete_buffer( yy_current_buffer );
+		yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
+		}
+
+	if ( new_out )
+		yyout = new_out;
+	}
+
+#ifdef YY_INTERACTIVE
+int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
+#else
+int yyFlexLexer::LexerInput( char* buf, int max_size )
+#endif
+	{
+	if ( yyin->eof() || yyin->fail() )
+		return 0;
+
+#ifdef YY_INTERACTIVE
+	yyin->get( buf[0] );
+
+	if ( yyin->eof() )
+		return 0;
+
+	if ( yyin->bad() )
+		return -1;
+
+	return 1;
+
+#else
+	(void) yyin->read( buf, max_size );
+
+	if ( yyin->bad() )
+		return -1;
+	else
+		return yyin->gcount();
+#endif
+	}
+
+void yyFlexLexer::LexerOutput( const char* buf, int size )
+	{
+	(void) yyout->write( buf, size );
+	}
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+
+int yyFlexLexer::yy_get_next_buffer()
+	{
+	char *dest = yy_current_buffer->yy_ch_buf;
+	char *source = yytext_ptr;
+	int number_to_move, i;
+	int ret_val;
+
+	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( yy_current_buffer->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+	else
+		{
+		int num_to_read =
+			yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = yy_current_buffer;
+
+			int yy_c_buf_p_offset =
+				(int) (yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yy_flex_realloc( (void *) b->yy_ch_buf,
+							 b->yy_buf_size + 2 );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = yy_current_buffer->yy_buf_size -
+						number_to_move - 1;
+#endif
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+			yy_n_chars, num_to_read );
+
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	if ( yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			yy_current_buffer->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	yy_n_chars += number_to_move;
+	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+	return ret_val;
+	}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+yy_state_type yyFlexLexer::yy_get_previous_state()
+	{
+	yy_state_type yy_current_state;
+	char *yy_cp;
+
+	yy_current_state = yy_start;
+
+	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+		{
+		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yy_last_accepting_state = yy_current_state;
+			yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 119 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
+
+	return yy_current_state;
+	}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+
+yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
+	{
+	int yy_is_jam;
+	char *yy_cp = yy_c_buf_p;
+
+	YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yy_last_accepting_state = yy_current_state;
+		yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 119 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 118);
+
+	return yy_is_jam ? 0 : yy_current_state;
+	}
+
+
+void yyFlexLexer::yyunput( int c, char* yy_bp )
+	{
+	char *yy_cp = yy_c_buf_p;
+
+	/* undo effects of setting up yytext */
+	*yy_cp = yy_hold_char;
+
+	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		int number_to_move = yy_n_chars + 2;
+		char *dest = &yy_current_buffer->yy_ch_buf[
+					yy_current_buffer->yy_buf_size + 2];
+		char *source =
+				&yy_current_buffer->yy_ch_buf[number_to_move];
+
+		while ( source > yy_current_buffer->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		yy_current_buffer->yy_n_chars =
+			yy_n_chars = yy_current_buffer->yy_buf_size;
+
+		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+
+	yytext_ptr = yy_bp;
+	yy_hold_char = *yy_cp;
+	yy_c_buf_p = yy_cp;
+	}
+
+
+int yyFlexLexer::yyinput()
+	{
+	int c;
+
+	*yy_c_buf_p = yy_hold_char;
+
+	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+			/* This was really a NUL. */
+			*yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yy_c_buf_p - yytext_ptr;
+			++yy_c_buf_p;
+
+			switch ( yy_get_next_buffer() )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin );
+
+					/* fall through */
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap() )
+						return EOF;
+
+					if ( ! yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yy_c_buf_p = yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
+	*yy_c_buf_p = '\0';	/* preserve yytext */
+	yy_hold_char = *++yy_c_buf_p;
+
+
+	return c;
+	}
+
+void yyFlexLexer::yyrestart( istream* input_file )
+	{
+	if ( ! yy_current_buffer )
+		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+	yy_init_buffer( yy_current_buffer, input_file );
+	yy_load_buffer_state();
+	}
+
+
+void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+	{
+	if ( yy_current_buffer == new_buffer )
+		return;
+
+	if ( yy_current_buffer )
+		{
+		/* Flush out information for old buffer. */
+		*yy_c_buf_p = yy_hold_char;
+		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+		yy_current_buffer->yy_n_chars = yy_n_chars;
+		}
+
+	yy_current_buffer = new_buffer;
+	yy_load_buffer_state();
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yy_did_buffer_switch_on_eof = 1;
+	}
+
+
+void yyFlexLexer::yy_load_buffer_state()
+	{
+	yy_n_chars = yy_current_buffer->yy_n_chars;
+	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+	yyin = yy_current_buffer->yy_input_file;
+	yy_hold_char = *yy_c_buf_p;
+	}
+
+
+YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
+	{
+	YY_BUFFER_STATE b;
+
+	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file );
+
+	return b;
+	}
+
+
+void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
+	{
+	if ( ! b )
+		return;
+
+	if ( b == yy_current_buffer )
+		yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yy_flex_free( (void *) b->yy_ch_buf );
+
+	yy_flex_free( (void *) b );
+	}
+
+
+void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
+
+	{
+	yy_flush_buffer( b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+	b->yy_is_interactive = 0;
+	}
+
+
+void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
+	{
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == yy_current_buffer )
+		yy_load_buffer_state();
+	}
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+void yyFlexLexer::yy_push_state( int new_state )
+	{
+	if ( yy_start_stack_ptr >= yy_start_stack_depth )
+		{
+		yy_size_t new_size;
+
+		yy_start_stack_depth += YY_START_STACK_INCR;
+		new_size = yy_start_stack_depth * sizeof( int );
+
+		if ( ! yy_start_stack )
+			yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+		else
+			yy_start_stack = (int *) yy_flex_realloc(
+					(void *) yy_start_stack, new_size );
+
+		if ( ! yy_start_stack )
+			YY_FATAL_ERROR(
+			"out of memory expanding start-condition stack" );
+		}
+
+	yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+	BEGIN(new_state);
+	}
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+void yyFlexLexer::yy_pop_state()
+	{
+	if ( --yy_start_stack_ptr < 0 )
+		YY_FATAL_ERROR( "start-condition stack underflow" );
+
+	BEGIN(yy_start_stack[yy_start_stack_ptr]);
+	}
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+int yyFlexLexer::yy_top_state()
+	{
+	return yy_start_stack[yy_start_stack_ptr - 1];
+	}
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+
+void yyFlexLexer::LexerError( yyconst char msg[] )
+	{
+	cerr << msg << '\n';
+	exit( YY_EXIT_FAILURE );
+	}
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+		yytext[yyleng] = yy_hold_char; \
+		yy_c_buf_p = yytext + n; \
+		yy_hold_char = *yy_c_buf_p; \
+		*yy_c_buf_p = '\0'; \
+		yyleng = n; \
+		} \
+	while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+	{
+	int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+	}
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+	{
+	int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+	}
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+	{
+	return (void *) malloc( size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+	{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+	}
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+	{
+	free( ptr );
+	}
+
+#if YY_MAIN
+int main()
+	{
+	yylex();
+	return 0;
+	}
+#endif
+#line 175 "ossimEquTokenizer.l"
+
+int yywrap()
+{
+   return 1;
+}
diff --git a/ossim/src/ossim/base/ossimEquTokenizer.l b/src/base/ossimEquTokenizer.l
similarity index 100%
rename from ossim/src/ossim/base/ossimEquTokenizer.l
rename to src/base/ossimEquTokenizer.l
diff --git a/ossim/src/ossim/base/ossimErrorCodes.cpp b/src/base/ossimErrorCodes.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimErrorCodes.cpp
rename to src/base/ossimErrorCodes.cpp
diff --git a/ossim/src/ossim/base/ossimErrorStatusInterface.cpp b/src/base/ossimErrorStatusInterface.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimErrorStatusInterface.cpp
rename to src/base/ossimErrorStatusInterface.cpp
diff --git a/ossim/src/ossim/base/ossimEvent.cpp b/src/base/ossimEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimEvent.cpp
rename to src/base/ossimEvent.cpp
diff --git a/ossim/src/ossim/base/ossimException.cpp b/src/base/ossimException.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimException.cpp
rename to src/base/ossimException.cpp
diff --git a/ossim/src/ossim/base/ossimFactoryBaseTemplate.cpp b/src/base/ossimFactoryBaseTemplate.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimFactoryBaseTemplate.cpp
rename to src/base/ossimFactoryBaseTemplate.cpp
diff --git a/src/base/ossimFilename.cpp b/src/base/ossimFilename.cpp
new file mode 100644
index 0000000..440615d
--- /dev/null
+++ b/src/base/ossimFilename.cpp
@@ -0,0 +1,1457 @@
+//---
+//
+// License: MIT
+//
+// Description: This class provides manipulation of filenames.
+//
+//---
+// $Id$
+
+#include <ossim/ossimConfig.h>  /* to pick up platform defines */
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimDate.h>
+#include <ossim/base/ossimEnvironmentUtility.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <iostream>
+#include <fstream>
+using namespace std;
+
+#if defined(_WIN32)
+#  include <io.h>
+#  include <direct.h>
+#  include <sys/utime.h>
+#  include <windows.h>
+#else
+#  include <sys/types.h>
+#  include <utime.h>
+#  include <sys/stat.h>
+#  include <unistd.h>
+#  include <dirent.h>
+#  include <fcntl.h>
+#endif
+
+#include <sys/stat.h>
+
+#ifdef __BORLANDC__
+#  include <dir.h>
+#  include <direct.h>
+#  include <stdlib.h>
+#  include <io.h>
+#endif
+
+#if defined(_WIN32)
+const char ossimFilename::OSSIM_NATIVE_PATH_SEPARATOR = '\\';
+#else
+const char ossimFilename::OSSIM_NATIVE_PATH_SEPARATOR = '/';
+#endif
+
+// Internal ossimFilename separator.
+const char ossimFilename::OSSIM_FILENAME_PATH_SEPARATOR = '/';
+
+
+/**
+ * This was taken from Wx widgets for performing touch and access date stamps.
+ */ 
+#if defined(_WIN32)
+typedef WIN32_FIND_DATA FIND_STRUCT;
+typedef HANDLE FIND_DATA;
+typedef DWORD FIND_ATTR;
+
+class ossimFileHandle
+{
+public:
+   enum OpenMode
+   {
+      Read,
+      Write
+   };
+   
+   ossimFileHandle(const ossimString& filename, OpenMode mode)
+   {
+      m_hFile = ::CreateFile(
+         filename.c_str(),              // name
+         mode == Read ? GENERIC_READ    // access mask
+         : GENERIC_WRITE,
+         FILE_SHARE_READ |              // sharing mode
+         FILE_SHARE_WRITE,              // (allow everything)
+         NULL,                          // no secutity attr
+         OPEN_EXISTING,                 // creation disposition
+         0,                             // no flags
+         NULL                           // no template file
+         );
+      
+      if ( m_hFile == INVALID_HANDLE_VALUE )
+      {
+//             wxLogSysError(_("Failed to open '%s' for %s"),
+//                           filename.c_str(),
+//                           mode == Read ? _("reading") : _("writing"));
+      }
+   }
+   
+   ~ossimFileHandle()
+   {
+      if ( m_hFile != INVALID_HANDLE_VALUE )
+      {
+         if ( !::CloseHandle(m_hFile) )
+         {
+//                 wxLogSysError(_("Failed to close file handle"));
+         }
+      }
+   }
+   
+   // return true only if the file could be opened successfully
+   bool isOk() const { return m_hFile != INVALID_HANDLE_VALUE; }
+   
+   // get the handle
+   operator HANDLE() const { return m_hFile; }
+   
+private:
+   HANDLE m_hFile;
+};
+
+static void convertOssimToFileTime(FILETIME *ft, const ossimDate& dt)
+{
+   SYSTEMTIME st;
+   st.wDay = dt.getDay();
+   st.wMonth = (WORD)(dt.getMonth());
+   st.wYear = (WORD)dt.getYear();
+   st.wHour = dt.getHour();
+   st.wMinute = dt.getMin();
+   st.wSecond = dt.getSec();
+//     st.wMilliseconds = dt.GetMillisecond();
+
+   FILETIME ftLocal;
+   if ( !::SystemTimeToFileTime(&st, &ftLocal) )
+   {
+//         wxLogLastError(_T("SystemTimeToFileTime"));
+   }
+
+   if ( !::LocalFileTimeToFileTime(&ftLocal, ft) )
+   {
+//         wxLogLastError(_T("LocalFileTimeToFileTime"));
+   }
+}
+
+static void convertFileTimeToOssim(ossimLocalTm &dt, const FILETIME &ft)
+{
+   FILETIME ftcopy = ft;
+   FILETIME ftLocal;
+   if ( !::FileTimeToLocalFileTime(&ftcopy, &ftLocal) )
+   {
+//         wxLogLastError(_T("FileTimeToLocalFileTime"));
+   }
+
+   SYSTEMTIME st;
+   if ( !::FileTimeToSystemTime(&ftLocal, &st) )
+   {
+//         wxLogLastError(_T("FileTimeToSystemTime"));
+   }
+
+   dt.setDay(st.wDay);
+   dt.setMonth(st.wMonth);
+   dt.setYear(st.wYear);
+   dt.setHour(st.wHour);
+   dt.setMin(st.wMinute);
+   dt.setSec(st.wSecond);
+    
+//     dt->Set(st.wDay, wxDateTime::Month(st.wMonth - 1), st.wYear,
+//             st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
+}
+
+static inline bool IsFindDataOk(FIND_DATA fd)
+{
+   return fd != INVALID_HANDLE_VALUE;
+}
+
+static inline FIND_DATA FindFirst(const ossimString& spec,
+                                  FIND_STRUCT *finddata)
+{
+   return ::FindFirstFile(spec.c_str(), finddata);
+}
+
+static bool ossimGetDirectoryTimes(const ossimString& dirname,
+                                   FILETIME *ftAccess,
+                                   FILETIME *ftCreate,
+                                   FILETIME *ftMod)
+{
+
+   FIND_STRUCT fs;
+   FIND_DATA fd = FindFirst(dirname, &fs);
+   if ( !IsFindDataOk(fd) )
+   {
+      return false;
+   }
+
+   *ftAccess = fs.ftLastAccessTime;
+   *ftCreate = fs.ftCreationTime;
+   *ftMod = fs.ftLastWriteTime;
+
+   FindClose(fd);
+
+   return true;
+}
+#endif
+
+const ossimFilename ossimFilename::NIL=("");
+
+ossimFilename::ossimFilename()
+   : ossimString()
+{}
+
+ossimFilename::ossimFilename(const ossimFilename& src)
+   : ossimString(src)
+{
+}
+
+ossimFilename::ossimFilename(const ossimString& src)
+   : ossimString(src)
+{
+   if ( m_str.size() )
+   {
+      converPathSeparator();
+      // convertToNative();
+   }
+}
+
+ossimFilename::ossimFilename(const std::string& src)
+   : ossimString(src)
+{
+   if ( m_str.size() )
+   {
+      converPathSeparator();
+      // convertToNative();
+   }
+}
+
+ossimFilename::ossimFilename(const char* src)
+   : ossimString(src)
+{
+   if ( m_str.size() )
+   {
+      converPathSeparator();
+      // convertToNative();
+   }
+}
+
+const ossimFilename& ossimFilename::operator=(const ossimFilename& f)
+{
+   if ( this != &f )
+   {
+      m_str = f.m_str;
+   }
+   return *this;
+}
+
+template <class Iter> ossimFilename::ossimFilename(Iter s, Iter e)
+   : ossimString(s, e)
+{
+   if ( m_str.size() )
+   {
+      converPathSeparator();
+      // convertToNative();
+   }
+}
+
+bool ossimFilename::operator == (const ossimFilename& rhs)const
+{
+   return ossimString::operator==(rhs);
+}
+
+bool ossimFilename::operator == (const ossimString& rhs)const
+{
+   return ossimString::operator==(rhs);
+}
+
+bool ossimFilename::operator == (const char* rhs)const
+{
+   return ossimString::operator ==(rhs);
+}
+
+#if 0
+void ossimFilename::convertBackToForwardSlashes()
+{
+   std::string::iterator currentChar = this->begin();
+
+   while(currentChar != this->end())
+   {
+      if(*currentChar == '\\')
+      {
+         *currentChar = '/';
+      }
+      ++currentChar;
+   }
+}
+
+void ossimFilename::convertForwardToBackSlashes()
+{
+   std::string::iterator currentChar = this->begin();
+
+   while(currentChar != this->end())
+   {
+      if(*currentChar == '/')
+      {
+         *currentChar = '\\';
+      }
+      ++currentChar;
+   }
+   m_pathSeparator = '\\';
+}
+#endif
+
+bool ossimFilename::setTimes(ossimLocalTm* accessTime,
+                             ossimLocalTm* modTime,
+#if defined(_WIN32)                             
+                             ossimLocalTm* createTime)const
+#else
+                             ossimLocalTm* /* createTime */ )const
+#endif
+{
+#if defined(_WIN32)
+   if(isDir())
+   {
+      // need to implement this later
+      return false;
+   }
+   else
+   {
+      ossimFileHandle fh(this->expand(), ossimFileHandle::Write);
+      if(fh.isOk())
+      {
+         FILETIME ftAccess, ftCreate, ftWrite;
+         
+         if ( createTime )
+         {
+            convertOssimToFileTime(&ftCreate, *createTime);
+         }
+         if ( accessTime )
+         {
+            convertOssimToFileTime(&ftAccess, *accessTime);
+         }
+         if ( modTime )
+         {
+            convertOssimToFileTime(&ftWrite, *modTime);
+         }
+         if ( ::SetFileTime(fh,
+                            createTime ? &ftCreate : NULL,
+                            accessTime ? &ftAccess : NULL,
+                            modTime ? &ftWrite : NULL) )
+         {
+            return true;
+         }
+      }
+   }
+#else
+   if ( !accessTime && !modTime )
+   {
+      // can't modify the creation time anyhow, don't try
+      return true;
+   }
+   utimbuf utm;
+   utm.actime = accessTime ? accessTime->getTicks() : modTime->getTicks();
+   utm.modtime = modTime ? modTime->getTicks() : accessTime->getTicks();
+   if ( utime(expand().c_str(), &utm) == 0 )
+   {
+      return true;
+   }
+    
+#endif
+
+   return false;
+}
+
+bool ossimFilename::getTimes(ossimLocalTm *accessTime,
+                             ossimLocalTm *modTime,
+                             ossimLocalTm *createTime) const
+{
+   if(!expand().exists()) return false;
+   
+#if defined(_WIN32)
+   // we must use different methods for the files and directories under
+   // Windows as CreateFile(GENERIC_READ) doesn't work for the directories and
+   // CreateFile(FILE_FLAG_BACKUP_SEMANTICS) works -- but only under NT and
+   // not 9x
+   bool ok;
+   FILETIME ftAccess, ftCreate, ftWrite;
+   if ( isDir() )
+   {
+      ok = ossimGetDirectoryTimes(expand().c_str(),
+                                  &ftAccess, &ftCreate, &ftWrite);
+      ok = false;
+   }
+   else // file
+   {
+      ossimFileHandle fh(expand().c_str(), ossimFileHandle::Read);
+      if ( fh.isOk() )
+      {
+         ok = ::GetFileTime(fh,
+                            createTime ? &ftCreate : NULL,
+                            accessTime ? &ftAccess : NULL,
+                            modTime ? &ftWrite : NULL) != 0;
+      }
+      else
+      {
+         ok = false;
+      }
+   }
+
+   if ( ok )
+   {
+      if ( createTime )
+      {
+         convertFileTimeToOssim(*createTime, ftCreate);
+      }
+      if ( accessTime )
+      {
+         convertFileTimeToOssim(*accessTime, ftAccess);
+      }
+      if ( modTime )
+      {
+         convertFileTimeToOssim(*modTime, ftWrite);
+      }
+        
+      return true;
+   }
+#else
+   struct stat sbuf;
+   stat(c_str(), &sbuf);
+   if ( stat( expand().c_str(), &sbuf) == 0 )
+   {
+      if ( accessTime )
+      {
+         *accessTime = ossimLocalTm(sbuf.st_atime);
+      }
+      if ( modTime )
+      {
+         *modTime = ossimLocalTm(sbuf.st_mtime);
+      }
+      if ( createTime )
+      {
+         *createTime = ossimLocalTm(sbuf.st_ctime);
+      }
+      return true;
+   }
+#endif // platforms
+
+
+   return false;
+}
+
+// Time in seconds since last accessed.
+ossim_int64 ossimFilename::lastAccessed() const
+{
+   ossim_int64 result = -1;
+
+   if( expand().exists() )
+   {
+      ossim_int64 currentTime = ossim::getTime();
+      
+#if defined(_WIN32)
+      cerr << "ossimFilename::lastAccessed() not implemented for windows!" << endl;
+#else
+      struct stat sbuf;
+      stat(c_str(), &sbuf);
+      if ( stat( expand().c_str(), &sbuf) == 0 )
+      {
+         time_t atime = sbuf.st_atime; // This cast to seconds(time_t).
+         result = currentTime - (ossim_int64)atime;
+      }
+#endif // platforms
+   }
+
+   return result;
+}
+
+bool ossimFilename::touch()const
+{
+#if defined( _WIN32 )
+   ossimDate now;
+
+   return setTimes(&now, &now, 0);
+   
+#else
+   if ( utime(expand().c_str(), NULL) == 0 )
+   {
+      return true;
+   }
+   
+   return false;
+#endif   
+}
+
+ossimFilename ossimFilename::expand() const
+{
+   //---
+   // Note:  ossimEnvironmentUtility::getCurrentWorkingDir() is returning
+   // a blank string on windows with vs9.  This was resulting in seg faults
+   // in this method so added checks were added for size of returned result.
+   // (drb  20100113)
+   //---
+   ossimFilename result = "";
+   if ( size() )
+   {
+      result = *this;
+      
+      if ( needsExpansion() )
+      {
+
+//#if defined(_WIN32)
+//         result.convertBackToForwardSlashes();
+//#endif
+
+         bool addCwd = false;
+         
+         if ( (size() > 1) && (*(begin()) == '~') && (*(begin()+1) == OSSIM_FILENAME_PATH_SEPARATOR) )
+         {
+            ossimFilename homeDir =
+               ossimEnvironmentUtility::instance()->getUserDir();
+            
+            ossimFilename s( (result.begin()+2) , result.end());
+            result = homeDir.dirCat(s);
+         }
+         else if( (size() > 1) &&
+                  (*(begin()) == '.') && (*(begin()+1) == OSSIM_FILENAME_PATH_SEPARATOR) )
+         {
+            // dot slash i.e. ./foo
+            addCwd = true;
+         }
+         else if ( (size() > 2)  && (*(begin()) == '.')
+                   && (*(begin()+1) == '.') && (*(begin()+2) == OSSIM_FILENAME_PATH_SEPARATOR) )
+         {
+            // ../foo
+            addCwd = true;
+         }
+         else if (result == ".")
+         {
+            result = ossimEnvironmentUtility::instance()->
+               getCurrentWorkingDir();
+         }
+
+         if (addCwd)
+         {
+            ossimFilename cwd = ossimEnvironmentUtility::instance()->
+               getCurrentWorkingDir();
+            result = cwd.dirCat(result);
+         }
+         else if ( result.isRelative() )
+         {
+            if ( result.size() && ((*(result.begin())) != '$') )
+            {
+               ossimFilename cwd = ossimEnvironmentUtility::instance()->
+                  getCurrentWorkingDir();
+               result = cwd.dirCat(result);
+            }
+         }
+               
+         // Check result to see if we're finished.
+         if ( result.needsExpansion() )
+         {
+            // now expand any environment variable substitutions
+            
+            ossimFilename finalResult;
+            const char* tempPtr = result.c_str();
+            ossim_int32 startIdx = -1;
+            ossim_int32 resultSize = (ossim_uint32)result.size();
+            ossim_int32 scanIdx = 0;
+            while(scanIdx < resultSize)
+            {
+               // look for start of substitution pattern
+               if(tempPtr[scanIdx] == '$')
+               {
+                  if(tempPtr[scanIdx+1] == '(')
+                  {
+                     scanIdx += 2;
+                     startIdx = scanIdx;
+                  }
+                  else
+                  {
+                     //---
+                     // Infinite loop fix with below file on window:
+                     // "\\kiosk\x$\SourceImagery\foo.ntf" (drb 21 Nov. 2016)
+                     //---
+                     finalResult += tempPtr[scanIdx];
+                     ++scanIdx;
+                  }
+               }
+               // look for an end pattern and apply if we found a start pattern
+               else if(tempPtr[scanIdx] == ')')
+               {
+                  if(startIdx != -1)
+                  {
+                     ossimFilename value(
+                        ossimEnvironmentUtility::instance()->
+                        getEnvironmentVariable(ossimString(tempPtr+startIdx,
+                                                           tempPtr+scanIdx)));
+#if defined(_WIN32) // do windows style replacment
+                     //                    value.convertBackToForwardSlashes();
+#endif
+                     finalResult += value;
+                     // reset start idx indicator to not set so we are ready for next pattern
+                     //
+                     startIdx = -1;
+                  }
+                  else // if no start then tack on the )
+                  {
+                     finalResult += tempPtr[scanIdx];
+                  }
+                  ++scanIdx;
+               }
+               else if(startIdx == -1)
+               {
+                  finalResult += tempPtr[scanIdx];
+                  ++scanIdx;
+               }
+               else
+               {
+                  ++scanIdx;
+               }
+            }
+#if defined(_WIN32)
+
+#else        
+            finalResult.gsub("//", "/", true);
+#endif       
+            result = finalResult;
+         
+         } // matches:  if ( result.needsExpansion() )
+
+#if defined(_WIN32)
+         //        result.convertForwardToBackSlashes();
+#endif        
+
+      } // matches: if ( needsExpansion() )
+
+      //---
+      // If we had a size before "expand()" and now we don't something went
+      // wrong...
+      //---
+      if (!result.size())
+      {
+         result = *this;
+      }
+      
+   } // matches: if ( size() )
+   
+   return result;
+}
+
+bool ossimFilename::exists() const
+{
+   bool result = false;
+   if ( isUrl() == false )
+   {
+#if defined(_WIN32)
+      result = (_access(c_str(), ossimFilename::OSSIM_EXIST) == 0);
+#else
+      result = ((access(c_str(), ossimFilename::OSSIM_EXIST)) == 0);
+#endif
+   }
+   else
+   {
+      result = ossim::StreamFactoryRegistry::instance()->exists( this->string() );
+   }
+   return result;
+}
+
+bool ossimFilename::isFile() const
+{
+#if defined(_WIN32)
+   struct _stat sbuf;
+   if ( _stat(c_str(), &sbuf ) == -1)
+      return false;
+   return (_S_IFMT & sbuf.st_mode ? true : false);
+#else
+   struct stat sbuf;
+
+   stat(c_str(), &sbuf);
+   return ((sbuf.st_mode & S_IFMT) == S_IFREG);
+#endif
+}
+
+bool ossimFilename::isDir() const
+{
+   if ( empty() )
+   {
+      return false;
+   }
+   
+   ossimFilename temp = c_str();
+   const char& lastChar = temp[temp.size()-1];
+   if ( lastChar == '/' || lastChar == '\\' )
+   {
+      temp = temp.beforePos(temp.size() - 1);
+   }
+	
+#if defined(_WIN32)
+
+   struct _stat sbuf;
+   if ( _stat(temp.c_str(), &sbuf ) == -1)
+      return false;
+   return (_S_IFDIR & sbuf.st_mode ? true : false);
+#else
+   struct stat sbuf;
+   if (stat(temp.c_str(), &sbuf) == -1)
+      return false;
+   return (S_ISDIR(sbuf.st_mode));
+#endif
+}
+
+bool ossimFilename::isReadable() const
+{
+#if defined(_WIN32)
+   
+   struct _stat sbuf;
+   if ( _stat(c_str(), &sbuf ) == -1)
+      return false;
+   return (_S_IREAD & sbuf.st_mode ? true : false);
+#else
+   return (access(c_str(), ossimFilename::OSSIM_READ) == 0);
+#endif
+}
+
+bool ossimFilename::isUrl() const
+{
+   bool result = false;
+   if ( m_str.size() )
+   {
+      //---
+      // Must have at least room for a protocol and "://", e.g.
+      // "s3://my_bucket/data1/foo.tif
+      //---
+      std::size_t found = m_str.find( std::string("://") );
+      if ( ( found != std::string::npos ) && ( found > 1 ) )
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimFilename::isWriteable() const
+{
+#if defined(_WIN32)
+
+   struct _stat sbuf;
+   if ( _stat(c_str(), &sbuf ) == -1)
+      return false;
+   return (_S_IWRITE & sbuf.st_mode ? true : false);
+#else
+   return (access(c_str(), ossimFilename::OSSIM_WRITE) == 0);
+#endif
+}
+
+bool ossimFilename::isExecutable() const
+{
+#if defined(_WIN32)
+
+   struct _stat sbuf;
+   if ( _stat(c_str(), &sbuf ) == -1)
+      return false;
+   return (_S_IEXEC & sbuf.st_mode ? true : false);
+#else
+   return (access(c_str(), ossimFilename::OSSIM_EXE) == 0);
+#endif
+}
+
+ossimString ossimFilename::ext() const
+{
+   std::string::size_type pos = m_str.rfind('.');
+   if (pos == std::string::npos)
+   {
+      return ossimFilename::NIL;
+   }
+
+   return ossimFilename(m_str.substr(pos+1));
+}
+
+ossimFilename ossimFilename::file() const
+{
+   std::string::size_type pos = m_str.rfind(OSSIM_FILENAME_PATH_SEPARATOR);
+   if (pos == std::string::npos)
+      return *this;
+   else
+      return ossimFilename(m_str.substr(pos+1));
+}
+
+ossimFilename ossimFilename::path() const
+{
+   // finds the last occurrence of the given string; in this case '/';
+   std::string::size_type pos = m_str.rfind(OSSIM_FILENAME_PATH_SEPARATOR);
+
+   if (pos == 0)
+      return ossimFilename(ossimFilename(OSSIM_FILENAME_PATH_SEPARATOR));
+   if (pos == std::string::npos)
+   {
+      // We got to the end of the file and did not find a path separator.
+      return ossimFilename::NIL;
+   }
+
+   return ossimFilename(m_str.substr(0, pos));
+}
+
+ossimFilename ossimFilename::drive()const
+{
+   ossimFilename result;
+   ossimRegExp regEx("^([a-z|A-Z])+:");
+   if(regEx.find( m_str.c_str() ) )
+   {
+      result = ossimFilename(ossimString(this->begin() + regEx.start(),
+                                         this->begin() + regEx.end()));
+   }
+   else
+   {
+      result = "";
+   }
+
+   return result;
+}
+
+ossimFilename ossimFilename::fileNoExtension()const
+{
+   std::string::size_type dot_pos   = m_str.rfind('.');
+   std::string::size_type slash_pos = m_str.rfind(OSSIM_FILENAME_PATH_SEPARATOR);
+
+   if(dot_pos == std::string::npos)
+   {
+      if(slash_pos == std::string::npos)
+      {
+         return *this;
+      }
+      else
+      {
+         return ossimFilename(this->begin()+slash_pos+1,
+                              this->end());
+      }
+   }
+   else if(slash_pos == std::string::npos)
+   {
+      return ossimFilename(this->begin(), this->begin()+dot_pos);
+   }
+   else if(slash_pos < dot_pos)
+   {
+      return ossimFilename(this->begin()+slash_pos+1,
+                           this->begin() + dot_pos);
+   }
+
+   return ossimFilename(this->begin()+slash_pos+1,
+                        this->end());
+
+}
+ossimFilename ossimFilename::noExtension()const
+{
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+
+   split(drivePart, pathPart, filePart, extPart);
+
+   extPart.clear();
+
+   ossimFilename result;
+   
+   result.merge(drivePart, pathPart, filePart, extPart);
+   
+   return result;
+}
+
+ossimFilename& ossimFilename::setExtension(const ossimString& e)
+{
+   ossimString newExtPart = e;
+
+   //---
+   // If e has a dot "." in the front of it strip it off...
+   //---
+   if ( (e.begin() != e.end()) && ((*(e.begin())) == '.') )
+   {
+      newExtPart = ossimString(e.begin() + 1, e.end());
+   }
+
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+
+   split(drivePart,
+         pathPart,
+         filePart,
+         extPart);
+
+   merge(drivePart,
+         pathPart,
+         filePart,
+         newExtPart);
+
+   return *this;
+}
+
+ossimFilename& ossimFilename::setDrive(const ossimString& d)
+{
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+
+   split(drivePart,
+         pathPart,
+         filePart,
+         extPart);
+
+   merge(d,
+         pathPart,
+         filePart,
+         extPart);
+
+   return *this;
+}
+
+ossimFilename& ossimFilename::setPath(const ossimString& p)
+{
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+
+   split(drivePart,
+         pathPart,
+         filePart,
+         extPart);
+
+   merge(drivePart,
+         p,
+         filePart,
+         extPart);
+
+   return *this;
+}
+
+ossimFilename& ossimFilename::setFile(const ossimString& f)
+{
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+
+   split(drivePart,
+         pathPart,
+         filePart,
+         extPart);
+
+   merge(drivePart,
+         pathPart,
+         f,
+         extPart);
+
+   return *this;
+}
+
+
+void ossimFilename::split(ossimString& drivePart,
+                          ossimString& pathPart,
+                          ossimString& filePart,
+                          ossimString& extPart)const
+{
+   drivePart = drive();
+   pathPart  = path();
+   if(drivePart != "")
+   {
+      pathPart = pathPart.substitute(drivePart, "");
+   }
+   filePart  = fileNoExtension();
+   extPart   = ext();
+}
+
+void ossimFilename::merge(const ossimString& drivePart,
+                          const ossimString& pathPart,
+                          const ossimString& filePart,
+                          const ossimString& extPart)
+{
+   ossimFilename result = drivePart;
+
+   if(pathPart != "")
+   {
+      result = result.dirCat(ossimFilename(pathPart));
+   }
+
+   if(filePart!="")
+   {
+      result = result.dirCat(ossimFilename(filePart));
+   }
+
+   if(extPart != "")
+   {
+      result += ".";
+      result += extPart;
+   }
+
+   *this = result;
+}
+
+ossimFilename ossimFilename::dirCat(const ossimFilename& file) const
+{
+   // If this string is empty simply return the input file.
+   if (empty()) return file;
+   if (file.empty()) return *this;
+
+   ossimFilename dir      = *this;
+   ossimFilename tempFile = file;
+      
+   // Check the end and see if it already has a "/".
+   string::const_iterator i = dir.end();
+
+   --i; // decrement past the trailing null.
+
+   if ( (*i) != OSSIM_FILENAME_PATH_SEPARATOR)
+   {
+      dir += ossimString(OSSIM_FILENAME_PATH_SEPARATOR);
+   }
+
+   // check for dot slash or just slash: ./foo or /foo   
+   std::string::iterator iter = tempFile.begin();
+   if (iter != tempFile.end())
+   {
+      if ((*iter) == OSSIM_FILENAME_PATH_SEPARATOR)
+      {
+         ++iter; // skip slash
+      }
+      else if (tempFile.size() > 1)
+      {
+         if ( ((*iter) == '.') &&  ( *(iter + 1) == OSSIM_FILENAME_PATH_SEPARATOR) )
+         {
+            iter = iter + 2; // skip dot slash
+         }
+      }
+   }   
+
+   dir += std::string(iter, tempFile.end());
+
+   return dir;
+}
+
+ossim_int64 ossimFilename::fileSize() const
+{
+   struct stat sbuf;
+
+#ifndef __BORLANDC__
+   if (stat(c_str(), &sbuf) == 0)
+   {
+      return (ossim_int64)sbuf.st_size;
+   }
+   else
+   {
+      ifstream in(c_str());
+      if(in)
+      {
+         in.seekg(SEEK_END);
+         return (ossim_int64)in.tellg();
+      }
+   }
+#else
+   ifstream in(c_str());
+   if(in)
+   {
+      in.seekg(SEEK_END);
+      return (ossim_int64)in.tellg();
+   }
+#endif
+   return 0;
+}
+
+bool ossimFilename::createDirectory( bool recurseFlag,
+                                     int perm ) const
+{
+   if(exists()) return true;
+
+   if ( empty() ) return false;
+
+   if(recurseFlag)
+   {
+      ossimString tempString = this->expand().c_str();
+
+      vector<ossimString> result;
+      tempString.split(result,OSSIM_FILENAME_PATH_SEPARATOR);
+
+      if(result.size())
+      {
+         ossimString current = result[0];
+
+// Reconstruct UNC paths under Windows.
+#if defined(_WIN32)
+         bool bGotUNC = false;
+         if ( current.length() == 0 && tempString.length() > 2 )
+         {
+            const char* fstr = tempString.c_str();
+            const char fstar0 = fstr[0];
+            const char fstar1 = fstr[1];
+            if ( fstar0=='\\' && fstar1=='\\' )
+            {
+               bGotUNC = true;
+               current = OSSIM_FILENAME_PATH_SEPARATOR;
+            }
+         }
+#endif
+
+         for(ossim_uint32 i = 1; i < result.size(); ++i)
+         {
+            current += (OSSIM_FILENAME_PATH_SEPARATOR+result[i]);
+
+#if defined(_WIN32)
+            if ( bGotUNC == true && i==1 )
+            {
+               // The root of the UNC path is assumed to exist.
+               continue;
+            }
+#endif
+            
+            if(current != OSSIM_FILENAME_PATH_SEPARATOR)
+            {
+               if(!ossimFilename(current).exists())
+               {
+#if defined(__BORLANDC__)
+                  if ( _mkdir(current.c_str()) != 0 )
+#elif defined(_WIN32)
+                  if ( _mkdir(current.c_str()) != 0 )
+#else
+                  if ( mkdir(current.c_str(), perm) != 0 )
+#endif
+                  {
+                     return false;
+                  }
+               }
+            }
+         }
+      }
+   }
+   else
+   {
+#if defined (__BORLANDC__)
+      if ( _mkdir(c_str()) != 0 )
+#elif defined(_WIN32)
+      if ( _mkdir(c_str()) != 0 )
+#else
+      if ( mkdir(c_str(), perm) != 0 )
+#endif
+      {
+         return false;
+      }
+      else
+      {
+         return true;
+      }
+   }
+   return true;
+}
+
+bool ossimFilename::remove(const ossimFilename& pathname)
+{
+   bool result = true;
+
+#if defined(__VISUALC__)  || defined(__BORLANDC__) || defined(__WATCOMC__) || \
+   defined(__GNUWIN32__) || defined(_MSC_VER)
+
+   // Note: not sure if these work on all of the above flavors. drb - 14 Sep. 2011.
+   if(pathname.isDir())
+   {
+      // Note this only removes empty directories.
+      result = ( RemoveDirectory( pathname.c_str() ) != 0 );
+   }
+   else
+   {
+      result = ( DeleteFile( pathname.c_str() ) != 0 );
+   }
+#else /* Unix flavor from unistd.h. */
+   if(pathname.isDir())
+   {
+      result = ( rmdir( pathname.c_str() ) == 0 );
+   }
+   else
+   {
+      result = ( unlink( pathname.c_str() ) == 0 );
+   }
+#endif
+
+   return result;
+}
+
+bool ossimFilename::wildcardRemove(const ossimFilename& pathname)
+{
+   std::vector<ossimFilename> fileListToRemove;
+   ossimFilename tempPathname = pathname;
+   
+   if(!tempPathname.isDir())
+   {
+      ossimFilename file = tempPathname.file();
+      ossimFilename path = tempPathname.path();
+      if(path == "")
+      {
+         path = ".";
+      }
+      ossimDirectory dir;
+      if(dir.open(path))
+      {
+         dir.findAllFilesThatMatch(fileListToRemove,
+                                   file.c_str());
+      }
+      else
+      {
+      }
+   }
+   else
+   {
+      fileListToRemove.push_back(ossimFilename(pathname));
+   }
+   ossim_uint32 idx = 0;
+   bool result = true;
+   for(idx = 0; idx < fileListToRemove.size(); ++idx)
+   {
+#if defined(__VISUALC__)  || defined(__BORLANDC__) || defined(__WATCOMC__) || \
+   defined(__GNUWIN32__) || defined(_MSC_VER)
+      
+      if(remove(fileListToRemove[idx].c_str()) != 0)
+      {
+         result = false;
+      }
+#else
+      if (unlink(fileListToRemove[idx]) == -1)
+      {
+         result = false;
+      }
+#endif /* HAVE_UNISTD_H */
+   }
+   return result;
+}
+
+bool ossimFilename::rename(const ossimFilename& destFile, bool overwriteDestinationFlag)const
+{
+   bool result = true;
+   if ( this->string() != destFile.string() )
+   {
+      if ( overwriteDestinationFlag && destFile.exists() )
+      {
+         destFile.remove();
+      }
+
+      if ( destFile.exists() == false )
+      {
+         // std::rename from cstdio returns 0 on success.
+         if ( std::rename(this->c_str(), destFile.c_str()) != 0 )
+         {
+            result = false;
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimFilenam::rename WARNING:"
+            << "\nDestination File Exists: " << destFile << std::endl;
+         result = false;
+      }
+   }
+   return result;
+}
+   
+bool ossimFilename::remove()const
+{
+   return ossimFilename::remove(*this);
+}
+
+bool ossimFilename::wildcardRemove()const
+{
+   return ossimFilename::wildcardRemove(*this);
+}
+
+bool ossimFilename::copyFileTo(const ossimFilename& outputFile) const
+{
+   bool result = false;
+   
+   std::ifstream is(this->c_str(), std::ios::in|std::ios::binary);
+   if ( is.good() )
+   {
+      ossimFilename f = outputFile;
+      if ( f.isDir() )
+      {
+         f = f.dirCat( this->file() );
+      }
+
+      if ( f != *this )
+      {
+         std::ofstream os( f.c_str(), std::ios::out|std::ios::binary );
+         if ( os.good() )
+         {
+            // Copy the file:
+            char c;
+            while(is.get(c))
+            {
+               os.put(c);
+            }
+            
+            if ( is.eof() &&  !os.fail())
+            {
+               result = true;
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "WARNING: "
+                  << "ossimFilename::copyFileTo WARNING:"
+                  << "\nError detected writing from file "
+                  << this->c_str() << " to file " << f.c_str() << std::endl;
+            }
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "WARNING: "
+               << "ossimFilename::copyFileTo WARNING:"
+               << "\nCannot open: " << f.c_str() << std::endl;
+         }
+      } //  if ( f != *this )
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING: "
+            << "ossimFilename::copyFileTo WARNING:"
+            << "\nFiles the same!" << std::endl;
+      }
+      
+   } // if ( is.good() )
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "WARNING: "
+         << "ossimFilename::copyFileTo WARNING:"
+         << "\nCannot open: " << this->c_str() << std::endl;
+   }
+   
+   return result;
+}
+
+//---
+// We will only return false if we are absolutely sure absolutely sure we
+// are not relative. No pun intended:)
+//---
+bool ossimFilename::isRelative() const
+{
+   bool result = true;
+   if (size())
+   {
+      //---
+      // Look for unix "/"...
+      // ESH: Look for Windows "\" (with prepending escape character \)
+      //---
+      if ( (*(begin()) == '/') || (*(begin()) == '\\') )
+      {
+         result = false;
+      }
+      else
+      {
+         // Look for windows drive
+         ossimRegExp regEx("^([a-z|A-Z])+:");
+         if ( regEx.find(c_str()) == true)
+         {
+            result = false;
+         }
+      }
+   }
+   return result;
+}
+
+bool ossimFilename::needsExpansion() const
+{
+   bool result = false;
+   if ( m_str.size() )
+   {
+      // Do not expand URLs.
+      if ( isUrl() == false )
+      {
+         result = isRelative();
+         if (result == false)
+         {
+            // Check for '$'
+            std::string::size_type pos = m_str.find('$', 0);
+            {
+               if (pos != std::string::npos)
+               {
+                  // found '$'
+                  result = true;
+               }
+            }
+            
+         }
+      }
+   }
+   return result;
+}
+
+char ossimFilename::getPathSeparator() const
+{
+   return OSSIM_FILENAME_PATH_SEPARATOR;
+}
+
+ossimFilename& ossimFilename::appendTimestamp()
+{
+   const std::string format = "%Y%m%d-%H%Mh%Ss";
+   std::string timestamp;
+   ossim::getFormattedTime(format, true, timestamp);
+
+   return append(timestamp);
+}
+
+ossimFilename& ossimFilename::append(const ossimString& append_this)
+{
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+
+   split(drivePart, pathPart, filePart, extPart);
+   filePart += append_this;
+   merge(drivePart, pathPart, filePart, extPart);
+
+   return *this;
+}
+
+void ossimFilename::converPathSeparator()
+{
+   if ( m_str.size() )
+   {
+      std::replace( m_str.begin(), m_str.end(), '\\', OSSIM_FILENAME_PATH_SEPARATOR );
+   }
+}
+
+std::string ossimFilename::native() const
+{
+#if defined(_WIN32)
+   std::string s = m_str;
+   std::replace( s.begin(), s.end(),OSSIM_FILENAME_PATH_SEPARATOR, OSSIM_NATIVE_PATH_SEPARATOR );
+   return s;
+#else
+   return m_str;   
+#endif  
+}
+
+#if 0
+void ossimFilename::convertToNative()
+{
+#if defined(_WIN32)
+   if ( isUrl() == false )
+   {
+      convertForwardToBackSlashes();
+   }
+#else
+   convertBackToForwardSlashes();
+   
+#endif
+}
+#endif
diff --git a/src/base/ossimFilenameProperty.cpp b/src/base/ossimFilenameProperty.cpp
new file mode 100644
index 0000000..55fd048
--- /dev/null
+++ b/src/base/ossimFilenameProperty.cpp
@@ -0,0 +1,152 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+//*************************************************************************
+// $Id: ossimFilenameProperty.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+#include <ossim/base/ossimFilenameProperty.h>
+
+RTTI_DEF1(ossimFilenameProperty, "ossimFilenameProperty", ossimProperty);
+
+ossimFilenameProperty::ossimFilenameProperty(const ossimString& name,
+                                             const ossimFilename& value,
+                                             const std::vector<ossimString>& filterList)
+   :ossimProperty(name),
+    theValue(value),
+    theFilterList(filterList),
+    theIoType(ossimFilenamePropertyIoType_NOT_SPECIFIED)
+{
+}
+
+ossimFilenameProperty::ossimFilenameProperty(const ossimFilenameProperty& rhs)
+   :ossimProperty(rhs),
+    theValue(rhs.theValue),
+    theFilterList(rhs.theFilterList),
+    theIoType(rhs.theIoType)
+{
+}
+
+ossimFilenameProperty::~ossimFilenameProperty()
+{
+}
+
+ossimObject* ossimFilenameProperty::dup()const
+{
+   return new ossimFilenameProperty(*this);
+}
+
+void ossimFilenameProperty::valueToString(ossimString& valueResult)const
+{
+   valueResult = theValue;
+}
+
+bool ossimFilenameProperty::setValue(const ossimString& value)
+{
+   theValue = value;
+
+   return true;
+}
+
+const ossimFilenameProperty& ossimFilenameProperty::operator = (ossimFilenameProperty& rhs)
+{
+   assign(rhs);
+
+   return *this;
+}
+
+const ossimProperty& ossimFilenameProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+   theValue = rhs.valueToString();
+
+   const ossimFilenameProperty* rhsPtr = dynamic_cast<const ossimFilenameProperty*>(&rhs);
+   if(rhsPtr)
+   {
+      theFilterList = rhsPtr->theFilterList;
+      theIoType     = rhsPtr->theIoType;
+   }
+
+   return *this;
+}
+
+void ossimFilenameProperty::clearFilterList()
+{
+   theFilterList.clear();
+}
+
+ossim_uint32 ossimFilenameProperty::getNumberOfFilters()const
+{
+   return (ossim_uint32)theFilterList.size();
+}
+
+void ossimFilenameProperty::setFilter(ossim_uint32 idx,
+                                      const ossimString& filterValue)
+{
+   if(idx < getNumberOfFilters())
+   {
+      theFilterList[idx] = filterValue;
+   }
+}
+
+ossimString ossimFilenameProperty::getFilter(ossim_uint32 idx)const
+{
+   if(idx < getNumberOfFilters())
+   {
+      return theFilterList[idx];
+   }
+
+   return ossimString("");
+}
+
+
+ossimString ossimFilenameProperty::getFilterListAsString(const ossimString& separator)const
+{
+   ossimString result;
+   ossim_uint32 idx = 0;
+
+   if(getNumberOfFilters() > 0)
+   {
+      for(idx = 0; idx < getNumberOfFilters()-1;++idx)
+      {
+         result += getFilter(idx);
+         result += separator;
+      }
+      result += getFilter(getNumberOfFilters()-1);
+   }
+
+   return result;
+}
+
+
+const std::vector<ossimString>& ossimFilenameProperty::getFilterList()const
+{
+   return theFilterList;
+}
+
+void ossimFilenameProperty::addFilter(const ossimString& filter)
+{
+   theFilterList.push_back(filter);
+}
+
+
+void ossimFilenameProperty::setIoType(ossimFilenamePropertyIoType ioType)
+{
+   theIoType = ioType;
+}
+
+ossimFilenameProperty::ossimFilenamePropertyIoType ossimFilenameProperty::getIoType()const
+{
+   return theIoType;
+}
+
+bool ossimFilenameProperty::isIoTypeInput()const
+{
+   return (theIoType==ossimFilenamePropertyIoType_INPUT);
+}
+
+bool ossimFilenameProperty::isIoTypeOutput()const
+{
+   return (theIoType==ossimFilenamePropertyIoType_OUTPUT);
+}
diff --git a/ossim/src/ossim/base/ossimFontInformation.cpp b/src/base/ossimFontInformation.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimFontInformation.cpp
rename to src/base/ossimFontInformation.cpp
diff --git a/src/base/ossimFontProperty.cpp b/src/base/ossimFontProperty.cpp
new file mode 100644
index 0000000..f02f28a
--- /dev/null
+++ b/src/base/ossimFontProperty.cpp
@@ -0,0 +1,88 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimFontProperty.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <sstream>
+#include <ossim/base/ossimFontProperty.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+
+RTTI_DEF1(ossimFontProperty, "ossimFontProperty", ossimProperty);
+
+ossimFontProperty::ossimFontProperty(const ossimString& name,
+                                     const ossimFontInformation& value)
+   :ossimProperty(name),
+    theValue(value)
+{
+   
+}
+
+ossimFontProperty::ossimFontProperty(const ossimFontProperty& rhs)
+   :ossimProperty(rhs),
+    theValue(rhs.theValue)
+{
+}
+
+ossimFontProperty::~ossimFontProperty()
+{
+}
+
+ossimObject* ossimFontProperty::dup()const
+{
+   return new ossimFontProperty(*this);
+}
+
+const ossimProperty& ossimFontProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+
+   const ossimFontProperty* rhsPtr = dynamic_cast<const ossimFontProperty*>(&rhs);
+   if(rhsPtr)
+   {
+      theValue = rhsPtr->theValue;
+   }
+   
+   return *this;
+}
+
+bool ossimFontProperty::setValue(const ossimString& value)
+{
+   bool result = true;
+   ossimKeywordlist kwl;
+
+   std::istringstream in(value);
+
+   result = kwl.parseStream(in);
+   if(result)
+   {
+      theValue.loadState(kwl);
+   }
+
+   return result;
+}
+
+void ossimFontProperty::valueToString(ossimString& valueResult)const
+{
+   std::ostringstream out;
+   ossimKeywordlist kwl;
+
+   theValue.saveState(kwl);
+   
+   kwl.writeToStream(out);
+   valueResult = kwl.toString();
+}
+
+void ossimFontProperty::setFontInformation(ossimFontInformation& fontInfo)
+{
+   theValue = fontInfo;
+}
+
+const ossimFontInformation& ossimFontProperty::getFontInformation()const
+{
+   return theValue;
+}
diff --git a/ossim/src/ossim/base/ossimFpt.cpp b/src/base/ossimFpt.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimFpt.cpp
rename to src/base/ossimFpt.cpp
diff --git a/ossim/src/ossim/base/ossimFpt3d.cpp b/src/base/ossimFpt3d.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimFpt3d.cpp
rename to src/base/ossimFpt3d.cpp
diff --git a/ossim/src/ossim/base/ossimGeoPolygon.cpp b/src/base/ossimGeoPolygon.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeoPolygon.cpp
rename to src/base/ossimGeoPolygon.cpp
diff --git a/ossim/src/ossim/base/ossimGeoTiffCoordTransformsLut.cpp b/src/base/ossimGeoTiffCoordTransformsLut.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeoTiffCoordTransformsLut.cpp
rename to src/base/ossimGeoTiffCoordTransformsLut.cpp
diff --git a/src/base/ossimGeoTiffDatumLut.cpp b/src/base/ossimGeoTiffDatumLut.cpp
new file mode 100644
index 0000000..9afba5d
--- /dev/null
+++ b/src/base/ossimGeoTiffDatumLut.cpp
@@ -0,0 +1,120 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimGeoTiffDatumLut.
+//*******************************************************************
+//  $Id: ossimGeoTiffDatumLut.cpp 16472 2010-02-01 19:52:27Z gpotts $
+
+#include <ossim/base/ossimGeoTiffDatumLut.h>
+#include <ossim/base/ossimString.h>
+
+static const int TABLE_SIZE = 24;
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimGeoTiffDatumLut::ossimGeoTiffDatumLut()
+   :
+      ossimLookUpTable(TABLE_SIZE)
+{
+   //***
+   // Complete initialization of data member "theTable".
+   // Note:  Scalar types defined in constants.h file.
+   //***
+   theTable[0].theKey    = GCS_Adindan;
+   theTable[0].theValue  = "ADI-M";
+   
+   theTable[1].theKey    = GCS_Arc_1950;
+   theTable[1].theValue  = "ARF-M";
+   
+   theTable[2].theKey    = GCS_Arc_1960;
+   theTable[2].theValue  = "ARS-M";
+   
+   theTable[3].theKey    = GCS_ED50;
+   theTable[3].theValue  = "EUR-M";
+   
+   theTable[4].theKey    = GCS_NAD27;
+   theTable[4].theValue  = "NAS-C";
+   
+   theTable[5].theKey    = GCS_NAD83;
+   theTable[5].theValue  = "NAR-C";
+   
+   theTable[6].theKey    = GCS_OSGB_1936;
+   theTable[6].theValue  = "OGB-M";
+   
+   theTable[7].theKey    = GCS_WGS_72;
+   theTable[7].theValue  = "WGD";
+   
+   theTable[8].theKey    = GCS_WGS_84;
+   theTable[8].theValue  = "WGE";
+   
+   theTable[9].theKey    = GCS_Tokyo;
+   theTable[9].theValue  = "TOY-M";
+   
+   theTable[10].theKey   = DatumE_WGS84;
+   theTable[10].theValue = "WGE";
+   
+   theTable[11].theKey   = Datum_Adindan;
+   theTable[11].theValue = "ADI-M";
+   
+   theTable[12].theKey   = Datum_Arc_1950;
+   theTable[12].theValue = "ARF-M";
+   
+   theTable[13].theKey   = Datum_Arc_1960;
+   theTable[13].theValue = "ARS-M";
+   
+   theTable[14].theKey   = Datum_European_Datum_1950;
+   theTable[14].theValue = "EUR-M";
+   
+   theTable[15].theKey   = Datum_North_American_Datum_1927;
+   theTable[15].theValue = "NAS-C";
+   
+   theTable[16].theKey   = Datum_North_American_Datum_1983;
+   theTable[16].theValue = "NAR-C";
+   
+   theTable[17].theKey   = Datum_OSGB_1936;
+   theTable[17].theValue = "OGB-M";
+   
+   theTable[18].theKey   = Datum_Tokyo;
+   theTable[18].theValue = "TOY-M";
+   
+   theTable[19].theKey   = Datum_WGS72;
+   theTable[19].theValue = "WGD";
+   
+   theTable[20].theKey   = Datum_WGS84;
+   theTable[20].theValue = "WGE";
+
+   theTable[21].theKey   = Datum_NAD83_HARN;
+   theTable[21].theValue = "NAR";
+
+   theTable[22].theKey   = GCS_NAD83_HARN;
+   theTable[22].theValue = "NAR";
+
+   //---
+   // Note:  This code implies a Clark 1866 ellipse with no datum.
+   // NAS-C used as work around for poor tag setting out of Erdas Imagine.
+   //---
+   theTable[23].theKey   = GCS_Clark_1866;
+   theTable[23].theValue = "NAS-C";
+   theTable[23].theKey   = 3785;
+   theTable[23].theValue = "6055";
+   theTable[23].theKey   = 900913;
+   theTable[23].theValue = "6055";
+}
+
+ossimGeoTiffDatumLut::~ossimGeoTiffDatumLut()
+{
+}
+
+ossimKeyword ossimGeoTiffDatumLut::getKeyword() const
+{
+   return ossimKeyword("geotiff_datum_code", "");
+}
diff --git a/ossim/src/ossim/base/ossimGeocent.c b/src/base/ossimGeocent.c
similarity index 100%
rename from ossim/src/ossim/base/ossimGeocent.c
rename to src/base/ossimGeocent.c
diff --git a/ossim/src/ossim/base/ossimGeodeticEvaluator.cpp b/src/base/ossimGeodeticEvaluator.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeodeticEvaluator.cpp
rename to src/base/ossimGeodeticEvaluator.cpp
diff --git a/ossim/src/ossim/base/ossimGeoid.cpp b/src/base/ossimGeoid.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeoid.cpp
rename to src/base/ossimGeoid.cpp
diff --git a/ossim/src/ossim/base/ossimGeoidEgm96.cpp b/src/base/ossimGeoidEgm96.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeoidEgm96.cpp
rename to src/base/ossimGeoidEgm96.cpp
diff --git a/src/base/ossimGeoidImage.cpp b/src/base/ossimGeoidImage.cpp
new file mode 100644
index 0000000..aa1a75b
--- /dev/null
+++ b/src/base/ossimGeoidImage.cpp
@@ -0,0 +1,363 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Generic geoid source which uses an image handler for reading the grid.
+// 
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimGeoidImage.h>
+
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/projection/ossimProjection.h>
+#include <cmath>
+
+ossimGeoidImage::ossimGeoidImage()
+   : m_geom(0),
+     m_handler(0),
+     m_cacheTile(0),
+     m_geoidTypeName(),
+     m_memoryMapFlag(false),
+     m_enabledFlag(true),
+     m_imageRect()
+{
+}
+
+ossimGeoidImage::~ossimGeoidImage()
+{
+   m_geom = 0;
+   m_handler = 0;
+   m_cacheTile = 0;
+}
+
+bool ossimGeoidImage::open( const ossimFilename& file, ossimByteOrder /* byteOrder */ )
+{
+   static const char MODULE[] = "ossimGeoidImage::open";
+   
+   m_geom = 0;
+   m_cacheTile = 0;
+   if ( m_handler.valid() )
+   {
+      m_handler->close();
+   }
+
+   m_handler =
+      ossimImageHandlerRegistry::instance()->open(file,
+                                                  true, // try suffix 1st
+                                                  false); // open overview
+   if ( m_handler.valid() )
+   {
+      // Store the bounding rectangle:
+      m_imageRect = m_handler->getImageRectangle( 0 );
+
+      // Scalar type:
+      m_scalarType = m_handler->getOutputScalarType();
+      
+      // Get the geometry info.  Need this to compute grid indexes.
+      m_geom = m_handler->getImageGeometry();
+
+      if ( m_geom.valid() )
+      {
+         // Verify the geometry object has a good projection.
+         if ( m_geom->getProjection() )
+         {
+            if ( m_memoryMapFlag )
+            {
+               try
+               {
+                  m_cacheTile = m_handler->getTile( m_imageRect, 0 );
+                  
+                  if ( m_cacheTile.valid() )
+                  {
+                     // Close the image handler:
+                     m_handler->close();
+                     m_handler = 0;
+                  }
+               }
+               catch ( const ossimException& e )
+               {
+                  m_memoryMapFlag = false;
+                  m_cacheTile = 0;
+                  
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " ERROR: Caught Exception!"
+                     << "\n" << e.what()
+                     << "\nMemory mapping entire grid into memory has been disabled..."
+                     << std::endl;
+               }
+            }
+         }
+         else
+         {
+            m_handler = 0;
+            m_geom    = 0;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nGeometry object has null projection!"
+               << std::endl;
+         }
+      }
+         
+      else
+      {
+         m_handler = 0;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:"
+            << "\nCould not get geometry info!"
+            << std::endl;
+      }
+   }
+   
+   return ( m_geom.valid() && (m_handler.valid() || (m_memoryMapFlag && m_cacheTile.valid()) ));
+}
+
+ossimString ossimGeoidImage::getShortName() const
+{
+   return m_geoidTypeName;
+}
+
+void ossimGeoidImage::setShortName( const std::string& geoidTypeName )
+{
+   m_geoidTypeName = geoidTypeName;
+}
+
+bool ossimGeoidImage::getMemoryMapFlag() const
+{
+   return m_memoryMapFlag;
+}
+
+void ossimGeoidImage::setMemoryMapFlag( bool flag )
+{
+   m_memoryMapFlag = flag; 
+}
+   
+bool ossimGeoidImage::saveState( ossimKeywordlist& kwl,
+                                 const char* prefix ) const
+{
+   std::string myPrefix = ( prefix ? prefix : "" );
+
+   // Save the connection string:
+   std::string key = "connection_string";
+   kwl.addPair( myPrefix, key, m_connectionString, true );
+
+   // Save the geoid type name:
+   key = "geoid.type";
+   kwl.addPair( myPrefix, key, m_geoidTypeName.string(), true );
+
+   // Save the memory map flag:
+   key = "memory_map";
+   std::string value = (m_memoryMapFlag ? "true" : "false");
+   kwl.addPair( myPrefix, key, value, true );
+
+   // Save the enabledFlag:
+   key = ossimKeywordNames::ENABLED_KW;
+   value = m_enabledFlag ? "true" : "false";
+   kwl.addPair( myPrefix, key, value, true );
+
+   // Save the type:
+   key = ossimKeywordNames::TYPE_KW;
+   value = "geoid_image";
+   kwl.addPair( myPrefix, key, value, true );
+   
+   return true;
+}
+
+bool ossimGeoidImage::loadState( const ossimKeywordlist& kwl,
+                                 const char* prefix )
+{
+   bool result = false;
+   
+   std::string myPrefix = prefix ? prefix : "";
+   
+   // Check the type name:
+   std::string key = ossimKeywordNames::TYPE_KW;
+   std::string value = kwl.findKey( myPrefix, key );
+
+   if ( (value == "geoid_image" ) || ( value == "ossimGeoidImage" ) )
+   {
+      // Get the geoid type name:
+      key = "geoid.type";
+      m_geoidTypeName = kwl.findKey( myPrefix, key );
+
+      // Get the memory map flag:
+      key = "memory_map";
+      value = kwl.findKey( myPrefix, key );
+      m_memoryMapFlag = ossimString( value ).toBool();
+
+      // Get the enabled flag:
+      key = ossimKeywordNames::ENABLED_KW;
+      value = kwl.findKey( myPrefix, key );
+      m_enabledFlag = ossimString( value ).toBool();
+      
+      // Get the connection string:
+      std::string key = "connection_string";
+      m_connectionString = kwl.findKey( myPrefix, key );
+      if ( m_connectionString.size() )
+      {
+         result = open( ossimFilename( m_connectionString ) );
+      }
+   }
+   
+   return result;
+}
+
+
+double ossimGeoidImage::offsetFromEllipsoid( const ossimGpt& gpt )
+{
+   double offset = ossim::nan();
+
+   if ( m_enabledFlag )
+   {
+      if ( m_geom.valid() &&
+           ( m_handler.valid() ||
+             ( m_memoryMapFlag && m_cacheTile.valid() )
+             )
+           )
+      {
+         switch(m_scalarType)
+         {
+            case OSSIM_SINT16:
+            {
+               offset = offsetFromEllipsoidTemplate((ossim_sint16)0, gpt);
+               break;
+            }
+            case OSSIM_FLOAT32:
+            {
+               offset = offsetFromEllipsoidTemplate((ossim_float32)0, gpt);
+               break;
+            }
+            case OSSIM_FLOAT64:
+            {
+               offset = offsetFromEllipsoidTemplate((ossim_float64)0, gpt);
+               break;
+            }
+            default:
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimGeoidImage::offsetFromEllipsoid ERROR:\n"
+                  << "Unhandled scalar type: "
+                  << ossimScalarTypeLut::instance()->getEntryString( m_scalarType )
+                  << std::endl;
+               break;
+            }
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimGeoidImage::offsetFromEllipsoid ERROR: Object not initialized!\n"
+            << std::endl;
+      }
+      
+   } // Matches: if ( m_enabledFlag )
+   
+   return offset;
+}
+
+template <class T>
+double ossimGeoidImage::offsetFromEllipsoidTemplate(T /* dummy */,
+                                                    const ossimGpt& gpt)
+{
+   double geoidOffset = ossim::nan();
+
+   // Change the datum if needed:
+   ossimGpt copyGpt = gpt;
+   if(ossimDatumFactory::instance()->wgs84())
+   {
+      copyGpt.changeDatum(ossimDatumFactory::instance()->wgs84());
+   }
+   
+   // Fix wrap conditions:
+   copyGpt.wrap();
+   
+   // Get the local image point for the input ground point.
+   ossimDpt imgDpt;
+   m_geom->worldToLocal( copyGpt, imgDpt );
+
+   if ( m_imageRect.pointWithin( ossimIpt( imgDpt ) ) )
+   {
+      ossim_int32 x0 = static_cast<ossim_int32>( imgDpt.x );
+      ossim_int32 y0 = static_cast<ossim_int32>( imgDpt.y );
+      
+      ossim_int32 IW = static_cast<ossim_int32>(m_imageRect.width());
+      ossim_int32 IH = static_cast<ossim_int32>(m_imageRect.height());
+      
+      if ( x0 == (IW-1) )
+      {
+         --x0;  // Move over one point.
+      }
+      if ( y0 == (IH-1) )
+      {
+         --y0; // Move over one point.
+      }
+
+      if ( !m_memoryMapFlag )
+      {
+         // Get the four points from the image handler.
+         ossimIrect tileRect(ossimIpt(x0, y0), ossimIpt(x0+1, y0+1));
+         m_cacheTile = m_handler->getTile( tileRect, 0 );
+      }
+      
+      if ( m_cacheTile.valid() )
+      {
+         // Get a pointer to the buffer.
+         const T* buf = static_cast<const T*>(m_cacheTile->getBuf());
+         
+         if ( buf )
+         {
+            const ossim_float64 NP = m_cacheTile->getNullPix(0);
+            const ossim_int64 TW = static_cast<ossim_int64>(m_cacheTile->getWidth());
+            ossim_int64 offset = (y0 - m_cacheTile->getOrigin().y) * TW +
+               (x0 - m_cacheTile->getOrigin().x);
+            ossim_int64 offset2 = offset + TW;
+            
+            double p00 = buf[offset];
+            double p01 = buf[offset+1];
+            double p10 = buf[offset2];
+            double p11 = buf[offset2+1];
+            
+            double xt0 = imgDpt.x - x0;
+            double yt0 = imgDpt.y - y0;
+            double xt1 = 1-xt0;
+            double yt1 = 1-yt0;
+            
+            double w00 = xt1*yt1;
+            double w01 = xt0*yt1;
+            double w10 = xt1*yt0;
+            double w11 = xt0*yt0;
+            
+            //---
+            // Test for null posts and set the corresponding weights to 0:
+            //---
+            if (p00 == NP) w00 = 0.0;
+            if (p01 == NP) w01 = 0.0;
+            if (p10 == NP) w10 = 0.0;
+            if (p11 == NP) w11 = 0.0;                  
+            
+            double sum_weights = w00 + w01 + w10 + w11;
+            if (sum_weights)
+            {
+               geoidOffset = (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
+            }
+         }
+         
+      } // Matches: if ( m_cacheTile.valid() )
+      
+   } // Matches: if ( m_imageRect.pointWithin( imgPt ) )
+
+   return geoidOffset;
+}
+
diff --git a/src/base/ossimGeoidManager.cpp b/src/base/ossimGeoidManager.cpp
new file mode 100644
index 0000000..fdb6da9
--- /dev/null
+++ b/src/base/ossimGeoidManager.cpp
@@ -0,0 +1,358 @@
+//*****************************************************************************
+// FILE: ossimGeoidManager.cpp
+//
+// License:  See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class ossimGeoidManager
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimGeoidManager.cpp 22906 2014-09-30 17:28:52Z dburken $
+
+
+#include <ossim/base/ossimGeoidManager.h>
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEnvironmentUtility.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimGeoidNgs.h>
+#include <ossim/base/ossimGeoidEgm96.h>
+#include <ossim/base/ossimGeoidImage.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeyword.h>
+#include <ossim/base/ossimNotifyContext.h>
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimGeoidManager:exec");
+static ossimTrace traceDebug ("ossimGeoidManager:debug");
+
+RTTI_DEF1(ossimGeoidManager, "ossimGeoidManager", ossimGeoid);
+
+//ossimGeoidManager* ossimGeoidManager::theInstance = 0;
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimGeoidManager
+//  
+//*****************************************************************************
+ossimGeoidManager::ossimGeoidManager()
+{
+  // theInstance = this;
+   theIdentityGeoid = new ossimIdentityGeoid();
+}
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimGeoidManager
+//  
+//*****************************************************************************
+ossimGeoidManager::~ossimGeoidManager()
+{
+//    vector<ossimGeoid*>::iterator g = theGeoidList.begin();
+//    while (g != theGeoidList.end())
+//    {
+//       delete *g;
+//       ++g;
+//    }
+   clear();
+}
+
+//*****************************************************************************
+//  METHOD: ossimGeoidManager::clear()
+//
+//*****************************************************************************
+void ossimGeoidManager::clear()
+{
+   theGeoidList.clear();
+}
+
+//*****************************************************************************
+//  METHOD: ossimGeoidManager::instance()
+//  
+//*****************************************************************************
+ossimGeoidManager* ossimGeoidManager::instance()
+{
+   static ossimGeoidManager inst;
+//   if (!theInstance)
+//   {
+//      theInstance = new ossimGeoidManager();
+//   }
+   
+   //return theInstance;
+   return &inst;
+}
+
+//*****************************************************************************
+//  METHOD: ossimElevManager::addGeoidSource
+//  
+//*****************************************************************************
+void ossimGeoidManager::addGeoid(ossimRefPtr<ossimGeoid> geoid, bool toFrontFlag)
+{
+   if(!toFrontFlag)
+   {
+      theGeoidList.push_back(geoid);
+   }
+   else
+   {
+      theGeoidList.insert(theGeoidList.begin(), geoid);
+   }
+}
+
+bool ossimGeoidManager::saveState(ossimKeywordlist& /* kwl */,
+                                  const char* /* prefix */ ) const
+{
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimGeoidManager::loadState()
+//  
+//*****************************************************************************
+bool ossimGeoidManager::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix)
+{
+   static const char MODULE[] = "ossimGeoidManager::loadState()";
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: " << MODULE << ", entering...\n";
+
+   //---
+   // Look for geoid sources:
+   // Note: the ossimInit::initializeElevation() does not pass a prefix to us
+   // as it should...
+   //---
+   std::string geoidMgrPrefix = prefix ? prefix : "geoid.manager.";
+
+   ossimString regExpression =  ossimString("^(") + geoidMgrPrefix.c_str() +
+      "geoid_source[0-9]+.)";
+
+   vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
+   if ( keys.size() )
+   {
+      for ( ossim_uint32 idx = 0; idx < keys.size(); ++idx )
+      {
+         std::string newPrefix = keys[idx];
+
+         // See if enable flag is set to false.
+         bool enabled = true;
+         std::string key = ossimKeywordNames::ENABLED_KW;
+         std::string value = kwl.findKey( newPrefix, key );
+         if ( value.size() )
+         {
+            enabled = ossimString( value ).toBool();
+         }
+
+         if ( enabled )
+         {
+            // Get the type:
+            key = ossimKeywordNames::TYPE_KW;
+            value = kwl.findKey( newPrefix, key );
+
+            if ( (value == "geoid_image" ) || ( value == "ossimGeoidImage" ) )
+            {
+               ossimRefPtr<ossimGeoid> geoid = new ossimGeoidImage();
+               if ( geoid->loadState( kwl, newPrefix.c_str() ) )
+               {
+                  if (traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_DEBUG)
+                        << "DEBUG: " << MODULE
+                        << "\nAdded geoid:  " << geoid->getShortName() << "\n";
+                  }
+                  addGeoid(geoid.get());
+               }
+            }
+         }
+      }
+   }
+
+   // End of "geoid_sources" block.
+   
+   // Look for the ngs geoid directories
+   const char* lookup = kwl.find(prefix, "geoid_99_directory");
+   ossimByteOrder geoidNgsByteOrder = OSSIM_LITTLE_ENDIAN;
+   const char* byteOrder = kwl.find(prefix, "geoid_99_directory.byte_order");
+   if (!lookup)
+   {
+      lookup = kwl.find(prefix, "geoid_ngs_directory");
+      byteOrder = kwl.find(prefix, "geoid_ngs_directory.byte_order");
+   }
+   if(byteOrder)
+   {
+      if(ossimString(byteOrder).contains("little"))
+      {
+         geoidNgsByteOrder = OSSIM_LITTLE_ENDIAN;
+      }
+      else
+      {
+         geoidNgsByteOrder = OSSIM_BIG_ENDIAN;
+      }
+   }
+   if(lookup)
+   {
+      ossimFilename f = lookup;
+      if (f.isDir())
+      {
+         ossimRefPtr<ossimGeoid> geoid = new ossimGeoidNgs(f, geoidNgsByteOrder);
+
+         if (geoid->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG: " << MODULE
+                  << "\nAdded geoid dir:  " << f.c_str() << "\n";
+            }
+            addGeoid(geoid.get());
+         }
+         else
+         {
+            geoid = 0;
+         }
+      }
+   }
+
+   ossimFilename geoidGrid1996 = ossimEnvironmentUtility::instance()->getUserOssimSupportDir();
+   geoidGrid1996 = geoidGrid1996.dirCat("geoids");
+   geoidGrid1996 = geoidGrid1996.dirCat("geoid1996");
+   geoidGrid1996 = geoidGrid1996.dirCat("egm96.grd");
+
+   if(!geoidGrid1996.exists())
+   {
+      geoidGrid1996 = ossimEnvironmentUtility::instance()->getInstalledOssimSupportDir();
+      geoidGrid1996 = geoidGrid1996.dirCat("geoids");
+      geoidGrid1996 = geoidGrid1996.dirCat("geoid1996");
+      geoidGrid1996 = geoidGrid1996.dirCat("egm96.grd");
+   }
+
+   if( geoidGrid1996.exists() )
+   {
+      ossimRefPtr<ossimGeoid> geoid = new ossimGeoidEgm96(geoidGrid1996);
+      if (geoid->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG: " << MODULE
+               << "\nAdded geoid egm 96:  " << geoidGrid1996.c_str()
+               << "\n";
+         }
+         addGeoid(geoid.get());
+      }
+      else
+      {
+         geoid = 0;
+      }
+   }
+   else
+   {
+      // Look for the geoid Earth Gravity Model (EGM) 96 directory.
+      lookup = kwl.find(prefix, "geoid_egm_96_grid");
+      if (lookup)
+      {
+         ossimFilename f = lookup;
+         if (f.isDir() || f.isFile())
+         {
+            ossimRefPtr<ossimGeoid> geoid = new ossimGeoidEgm96(f);
+            
+            if (geoid->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+            {
+               if (traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "DEBUG: " << MODULE
+                     << "\nAdded geoid egm 96:  " << f.c_str()
+                     << "\n";
+               }
+               
+               addGeoid(geoid.get());
+            }
+            else
+            {
+               geoid = 0;
+            }
+         }
+      }
+   }
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: " << MODULE << ", returning...\n";
+   }
+   
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimGeoidManager::open()
+//  
+//*****************************************************************************
+bool ossimGeoidManager::open(const ossimFilename& dir, ossimByteOrder byteOrder)
+{
+   std::vector<ossimRefPtr<ossimGeoid> >::iterator g = theGeoidList.begin();
+   bool status = true;
+   while (g != theGeoidList.end())
+   {
+      status &= (*g)->open(dir, byteOrder);
+      ++g;
+   }
+
+   return status;
+}
+
+//*****************************************************************************
+//  METHOD: ossimGeoidManager::open()
+//  
+//*****************************************************************************
+double ossimGeoidManager::offsetFromEllipsoid(const ossimGpt& gpt)
+{
+   double offset = ossim::nan();
+   std::vector<ossimRefPtr<ossimGeoid> >::iterator geoid =
+      theGeoidList.begin();
+   
+   while ( ossim::isnan(offset) && (geoid != theGeoidList.end()))
+   {
+      offset = ((*geoid))->offsetFromEllipsoid(gpt);
+      ++geoid;
+   }
+   
+   return offset;
+}
+
+ossimGeoid* ossimGeoidManager::findGeoidByShortName(const ossimString& shortName, bool caseSensitive)
+{
+   ossim_uint32 idx=0;
+   ossimString testString = shortName;
+   if(shortName == "identity")
+   {
+      return theIdentityGeoid.get();
+   }
+   if(!caseSensitive)
+   {
+      testString  = testString.downcase();
+   }
+   for(idx = 0; idx < theGeoidList.size(); ++idx)
+   {
+      if(!caseSensitive)
+      {
+         if(theGeoidList[idx]->getShortName().downcase() == testString)
+         {
+            return theGeoidList[idx].get();
+         }
+      }
+      else
+      {
+         if(theGeoidList[idx]->getShortName() == testString)
+         {
+            return theGeoidList[idx].get();
+         }
+      }
+   }
+   return 0;
+}
diff --git a/ossim/src/ossim/base/ossimGeoidNgs.cpp b/src/base/ossimGeoidNgs.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeoidNgs.cpp
rename to src/base/ossimGeoidNgs.cpp
diff --git a/ossim/src/ossim/base/ossimGeoidNgsHeader.cpp b/src/base/ossimGeoidNgsHeader.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeoidNgsHeader.cpp
rename to src/base/ossimGeoidNgsHeader.cpp
diff --git a/ossim/src/ossim/base/ossimGeoref.cpp b/src/base/ossimGeoref.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGeoref.cpp
rename to src/base/ossimGeoref.cpp
diff --git a/ossim/src/ossim/base/ossimGpt.cpp b/src/base/ossimGpt.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGpt.cpp
rename to src/base/ossimGpt.cpp
diff --git a/src/base/ossimGrect.cpp b/src/base/ossimGrect.cpp
new file mode 100644
index 0000000..d6a4791
--- /dev/null
+++ b/src/base/ossimGrect.cpp
@@ -0,0 +1,323 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// Description:
+//
+//*************************************************************************
+// $Id: ossimGrect.cpp 23461 2015-08-05 20:20:20Z okramer $
+
+#include <ossim/base/ossimGrect.h>
+using namespace std;
+
+ostream& operator<<(ostream& os, const ossimGrect& rect)
+{
+   return os << rect.theUlCorner << ", " << rect.theLrCorner << endl;
+}
+
+ossimGrect::ossimGrect(vector<ossimGpt>& points)
+   :
+   theUlCorner(0.0, 0.0, 0.0),
+   theLrCorner(0.0, 0.0, 0.0)
+{
+   // initialize everyone to the first point
+   if(points.size() > 0)
+   {
+      double minHgt = 0.0;
+      double maxHgt = 0.0;
+      theUlCorner = points[0];
+      theLrCorner = theUlCorner;
+      minHgt = theUlCorner.hgt;
+      maxHgt = minHgt;
+      
+      // find the bounds
+      for(ossim_uint32 index = 1; index < points.size(); index++)
+      {
+         // find left most
+         if(theUlCorner.lond() > points[index].lond())
+         {
+            theUlCorner.lond(points[index].lond());
+         } // find right most
+         else if(theLrCorner.lond() < points[index].lond())
+         {
+            theLrCorner.lond(points[index].lond());
+         }
+         //find top most
+         if(points[index].latd() > theUlCorner.latd())
+         {
+            theUlCorner.latd(points[index].latd());
+         }// find bottom most
+         else if(points[index].latd() < theLrCorner.latd())
+         {
+            theLrCorner.latd(points[index].latd());
+         }
+         
+         if (points[index].hgt > maxHgt)
+         {
+            maxHgt = points[index].hgt;
+         }
+         else if (points[index].hgt < minHgt)
+         {
+            minHgt = points[index].hgt;
+         }
+      }
+      
+      theUlCorner.hgt = maxHgt;
+      theLrCorner.hgt = minHgt;
+   }
+}
+
+ossimGrect::ossimGrect(const ossimGpt& p1, const ossimGpt& p2)
+{
+   if(p1.lon < p2.lon)
+   {
+      theUlCorner.lon = p1.lon;
+      theLrCorner.lon = p2.lon;
+   }
+   else
+   {
+      theUlCorner.lon = p2.lon;
+      theLrCorner.lon = p1.lon;
+   }
+
+   if(p1.lat > p2.lat)
+   {
+      theUlCorner.lat = p1.lat;
+      theLrCorner.lat = p2.lat;
+   }
+   else
+   {
+      theUlCorner.lat = p2.lat;
+      theLrCorner.lat = p1.lat;
+   }
+
+   if(p1.hgt > p2.hgt)
+   {
+      theUlCorner.hgt = p1.hgt;
+      theLrCorner.hgt = p2.hgt;
+   }
+   else
+   {
+      theUlCorner.hgt = p2.hgt;
+      theLrCorner.hgt = p1.hgt;
+   }
+}
+
+ossimGrect::ossimGrect(const ossimGpt& p1,
+                       const ossimGpt& p2,
+                       const ossimGpt& p3,
+                       const ossimGpt& p4)
+{
+   unsigned long index;
+   double minHgt, maxHgt;
+
+   std::vector<ossimGpt> points(4);
+   points[0] = p1;
+   points[1] = p2;
+   points[2] = p3;
+   points[3] = p4;
+
+   // initialize everyone to the first point
+   theUlCorner = points[0];
+   theLrCorner = theUlCorner;
+   minHgt = theUlCorner.hgt;
+   maxHgt = minHgt;
+   
+   // find the bounds
+   for(index = 1; index < points.size(); index++)
+   {
+      // find left most
+      if(theUlCorner.lond() > points[index].lond())
+      {
+         theUlCorner.lond(points[index].lond());
+      } // find right most
+      else if(theLrCorner.lond() < points[index].lond())
+      {
+         theLrCorner.lond(points[index].lond());
+      }
+      //find top most
+      if(points[index].latd() > theUlCorner.latd())
+      {
+         theUlCorner.latd(points[index].latd());
+      }// find bottom most
+      else if(points[index].latd() < theLrCorner.latd())
+      {
+         theLrCorner.latd(points[index].latd());
+      }
+
+      if (points[index].hgt > maxHgt)
+         maxHgt = points[index].hgt;
+      else if (points[index].hgt < minHgt)
+         minHgt = points[index].hgt;
+   }
+   theUlCorner.hgt = maxHgt;
+   theLrCorner.hgt = minHgt;
+}
+
+ossimGrect ossimGrect::stretchToEvenBoundary(double latSpacingInDegrees,
+                                             double lonSpacingInDegrees)const
+{
+   double ulLat = ((long)ceil(theUlCorner.latd()/latSpacingInDegrees))*
+                  latSpacingInDegrees;
+   double ulLon = ((long)floor(theUlCorner.lond()/lonSpacingInDegrees))*
+                  lonSpacingInDegrees;
+   double lrLat = ((long)floor(theLrCorner.latd()/latSpacingInDegrees))*
+                  latSpacingInDegrees;
+   double lrLon = ((long)ceil(theLrCorner.lond()/lonSpacingInDegrees))*
+                  lonSpacingInDegrees;
+   
+   ossimGpt ul (ulLat, ulLon, theUlCorner.hgt, theUlCorner.datum());
+   ossimGpt lr (lrLat, lrLon, theLrCorner.hgt, theLrCorner.datum());
+
+   return ossimGrect(ul, lr);
+}
+
+void ossimGrect::computeEvenTiles(std::vector<ossimGrect>& result,
+                                  double latSpacingInDegrees,
+                                  double lonSpacingInDegrees,
+                                  bool clipToGeographicBounds)const
+{
+   ossimGrect clipRect = ossimGrect(90, -180, -90, 180);
+   result.clear();
+   ossimGrect temp = stretchToEvenBoundary(latSpacingInDegrees,
+                                           lonSpacingInDegrees);
+
+   ossimGpt point = temp.ul();
+   
+   while(temp.pointWithin(point))
+   {
+      while(temp.pointWithin(point))
+      {
+         ossimGrect rect(point.latd(),
+                         point.lond(),
+                         point.latd()-latSpacingInDegrees,
+                         point.lond()+lonSpacingInDegrees);
+
+         rect.theUlCorner.datum( theUlCorner.datum());
+         rect.theLrCorner.datum( theUlCorner.datum());
+         if(clipToGeographicBounds)
+         {
+            rect = rect.clipToRect(clipRect);
+         }
+         result.push_back(rect);
+
+         point.lond(point.lond()+lonSpacingInDegrees);
+      }
+      point.lond(temp.ul().lond());
+      point.latd(point.latd()-latSpacingInDegrees);
+   }
+}
+
+//*******************************************************************
+// Public Method: ossimGrect::completely_within
+//*******************************************************************
+bool ossimGrect::completely_within(const ossimGrect& rect) const
+{
+   if(rect.isLonLatNan() || isLonLatNan())
+   {
+      return false;
+   }
+   
+   /*  --------------
+       |     1      |
+       | ---------- |
+       | |        | |
+       | |        | |
+       | |   2    | |
+       | |        | |
+       | |        | |
+       | ---------- |
+       |            |
+       --------------  */
+
+   bool rtn = true;
+   
+   if ((theUlCorner.lon < rect.ul().lon)||
+       (theUlCorner.lon > rect.ur().lon))
+   {
+      rtn = false;
+   }
+   else if ((theLrCorner.lon > rect.lr().lon)||
+            (theLrCorner.lon < rect.ul().lon))
+   {
+      rtn = false;
+   }
+   else if ((theUlCorner.lat > rect.ul().lat)||
+            (theUlCorner.lat < rect.lr().lat))
+   {
+      rtn = false;
+   }
+   else if ((theLrCorner.lat < rect.lr().lat)||
+            (theLrCorner.lat > rect.ul().lat))
+   {
+      rtn = false;
+   }
+
+   return rtn;
+}
+
+//*******************************************************************
+// Public Method: ossimGrect::intersects
+//*******************************************************************
+bool ossimGrect::intersects(const ossimGrect& rect) const
+{
+		
+   if(rect.isLonLatNan() || isLonLatNan())
+   {
+      return false;
+   }
+   
+   ossim_float64  ulx = ossim::max(rect.ul().lon, ul().lon);
+   ossim_float64  lrx = ossim::min(rect.lr().lon, lr().lon);
+   ossim_float64  uly, lry;
+   bool rtn;
+   
+   uly  = ossim::min(rect.ul().lat, ul().lat);
+   lry  = ossim::max(rect.lr().lat, lr().lat);
+   rtn = ((ulx <= lrx) && (uly >= lry));
+   
+      return (rtn);
+}
+
+ossim_float64 ossimGrect::heightMeters() const
+{
+   ossimDpt scale (midPoint().metersPerDegree());
+   return height()*scale.y;
+}
+
+ossim_float64 ossimGrect::widthMeters()  const
+{
+   ossimDpt scale (midPoint().metersPerDegree());
+   return width()*scale.x;
+}
+
+
+void ossimGrect::expandToInclude(const ossimGpt& gpt)
+{
+   if (isLonLatNan())
+   {
+      theUlCorner = gpt;
+      theLrCorner = gpt;
+   }
+   else if (!pointWithin(gpt, false))
+   {
+      if (gpt.lat > theUlCorner.lat)
+         theUlCorner.lat = gpt.lat;
+      else if (gpt.lat < theLrCorner.lat)
+         theLrCorner.lat = gpt.lat;
+      if (gpt.lon < theUlCorner.lon)
+         theUlCorner.lon = gpt.lon;
+      else if (gpt.lon > theLrCorner.lon)
+         theLrCorner.lon = gpt.lon;
+   }
+}
+
+void ossimGrect::expandToInclude(const ossimGrect& rect)
+{
+   expandToInclude(rect.ul());
+   expandToInclude(rect.lr());
+}
diff --git a/ossim/src/ossim/base/ossimGzStream.cpp b/src/base/ossimGzStream.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimGzStream.cpp
rename to src/base/ossimGzStream.cpp
diff --git a/ossim/src/ossim/base/ossimHexString.cpp b/src/base/ossimHexString.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimHexString.cpp
rename to src/base/ossimHexString.cpp
diff --git a/src/base/ossimHistogram.cpp b/src/base/ossimHistogram.cpp
new file mode 100644
index 0000000..2632099
--- /dev/null
+++ b/src/base/ossimHistogram.cpp
@@ -0,0 +1,1696 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Ken Melero (kmelero at imagelinks.com)
+//         Orginally developed by:
+//                   Copyright (c) 1997 TargetJr Consortium
+//               GE Corporate Research and Development (GE CRD)
+//                             1 Research Circle
+//                            Niskayuna, NY 12309
+//         Adapted from:  IUE v4.1.2
+// Description: 
+//      A ossimHistogram contains an array of "buckets", which represent finite
+// segments of some value axis, along with a corresponding array of
+// frequency m_counts for each of these buckets.
+//
+//********************************************************************
+// $Id$
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimThinPlateSpline.h>
+#include <ossim/base/ossimDpt.h>
+#include <cmath>
+#include <cstdio>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+using namespace std;
+
+
+
+// nonstandard versions that use operator>, so they behave differently
+// than std:::min/max and ossim::min/max.  kept here for now for that
+// reason.
+#ifndef MAX
+#  define MAX(x,y) ((x)>(y)?(x):(y))
+#  define MIN(x,y) ((x)>(y)?(y):(x))
+#endif
+
+
+static const int MEAN_FLAG = 1, SD_FLAG = 2;
+RTTI_DEF1(ossimHistogram, "ossimHistogram", ossimObject);
+ossimHistogram::ossimHistogram()
+   :
+   m_statsConsistent(MEAN_FLAG | SD_FLAG),
+   m_vals(new float [1]),
+   m_counts(new float [1]),
+   m_num(0),
+   m_delta(0.0),
+   m_vmin(0),
+   m_vmax(0),
+   m_mean(0.0),
+   m_standardDev(0.0)
+{
+   m_vals[0] = 0.0;
+   m_counts[0] = 0.0;
+}
+
+ossimHistogram::ossimHistogram(int xres, float val1, float val2)
+   :
+   m_statsConsistent(MEAN_FLAG | SD_FLAG),
+   m_vals(new float [xres]),
+   m_counts(new float [xres]),
+   m_num(xres),
+   m_delta(0.0),
+   m_vmin(0),
+   m_vmax(0),
+   m_mean(0.0),
+   m_standardDev(0.0)
+{
+   m_vmax = MAX(val1, val2);
+   m_vmin = MIN(val1, val2);
+
+   //---
+   // Set the delta which is used to index the bins.
+   // Note: that using "(m_vmax - m_vmin) / xres" was dropping the
+   // last bin on integer data.
+   //---
+   if ( (m_vmax - m_vmin + 1) == xres )
+   {
+      m_delta = 1.0;
+   }
+   else
+   {
+      m_delta = (m_vmax - m_vmin) / xres;
+   }
+
+   m_mean = (float)((m_vmax + m_vmin)/2.0);
+   m_standardDev = (float)((m_vmax - m_vmin)/(2.0*sqrt(3.0)));
+   int i = 0;
+
+   if (m_vals == NULL || m_counts == NULL)
+   {
+      fprintf(stderr, "Histogram : Ran out of memory for arrays.\n");
+      m_vals = NULL;
+      m_counts = NULL;
+      m_num = 0;
+      m_vmin = 0;
+      m_vmax = 0;
+      m_delta = 0.0;
+   }
+   else
+   {
+      //std::cout << std::setprecision(15) << m_vmin << ", " << m_vmax <<  ", " <<m_delta <<", "<< xres << std::endl; 
+      for(i = 0; i < xres; i++)
+      {
+         m_vals[i] = m_vmin + m_delta * (float)(i + 0.5);
+         //std::cout << m_vals[i] << std::endl;
+         m_counts[i] = 0.0;
+      }
+   }
+}
+
+ossimHistogram::ossimHistogram(float* uvals, float* ucounts, int xres)
+   :
+   m_statsConsistent(MEAN_FLAG | SD_FLAG),
+   m_vals(uvals),
+   m_counts(ucounts),
+   m_num(xres),
+   m_delta(0.0),
+   m_vmin(0),
+   m_vmax(0),
+   m_mean(0.0),
+   m_standardDev(0.0)
+{
+   if ( ( xres >= 2 ) && uvals && ucounts )
+   {
+      m_delta = m_vals[1] - m_vals[0]; // Changed this from delta = 1.0
+      //  m_vmax = GetMaxVal();
+      //  m_vmin = GetMinVal(); JAF version
+      m_vmin = uvals[0] - .5f*m_delta;
+      m_vmax = uvals[m_num-1] + .5f*m_delta;
+      m_mean = GetMean();
+      m_standardDev = GetStandardDev();
+   }   
+}
+ossimHistogram::ossimHistogram(const double* data, ossim_uint32 size, ossim_uint32 xres)
+   :
+   m_statsConsistent(0),
+   m_vals(0),
+   m_counts(0),
+   m_num((int)xres),
+   m_delta(0.0),
+   m_vmin(0),
+   m_vmax(0),
+   m_mean(0.0),
+   m_standardDev(0.0)
+{
+   if ((size == 0) || (xres == 0))
+      return;
+
+   // scan the dataset for min/max:
+   m_vmin=(float)(data[0]);
+   m_vmax=(float)(data[0]);
+   for (ossim_uint32 i=1; i<size; ++i)
+   {
+      if ((float)(data[i]) < m_vmin)
+         m_vmin = (float)(data[i]);
+      else if ((float)(data[i]) > m_vmax)
+         m_vmax = (float)(data[i]);
+   }
+
+   // Allocate histogram:
+   m_delta = (m_vmax - m_vmin) / m_num;
+   m_vals = new float [m_num];
+   m_counts = new float [m_num];
+   for (ossim_int32 i=0; i<m_num; ++i)
+   {
+      m_vals[i] = m_vmin + m_delta * (i + 0.5);
+      m_counts[i] = 0.0;
+   }
+
+   // compute histogram:
+   for (ossim_uint32 i=0; i<size; i++)
+      UpCount((float)(data[i]));
+
+   GetMean();
+   GetStandardDev();
+}
+
+//-----------------------------------------------------------
+// -- Copy constructor
+ossimHistogram::ossimHistogram(const ossimHistogram& his)
+:
+m_statsConsistent(0),
+m_vals(0),
+m_counts(0),
+m_num(0),
+m_delta(0.0),
+m_vmin(0),
+m_vmax(0),
+m_mean(0.0),
+m_standardDev(0.0)
+{
+
+   int i = 0;
+   m_num = his.GetRes();
+
+   m_vals = new float[m_num];
+   const float* his_vals = his.GetVals();
+
+   m_counts = new float[m_num];
+   const float* his_counts = his.GetCounts();
+
+   if (m_vals == NULL || m_counts == NULL)
+   {
+      fprintf(stderr, "Histogram : Ran out of memory for arrays.\n");
+      m_vals = NULL;
+      m_counts = NULL;
+      m_num = 0;
+      m_vmin = 0;
+      m_vmax = 0;
+      m_delta = 0.0;
+      m_statsConsistent = 0;
+      return;
+   }
+
+   m_mean = his.GetMean();
+   m_standardDev = his.GetStandardDev();
+
+   for(i=0; i<m_num; i++)
+   {
+      m_vals[i] = his_vals[i];
+      m_counts[i] = his_counts[i];
+   }
+   m_vmax = his.GetMaxVal();
+   m_vmin = his.GetMinVal();
+   m_delta = his.GetBucketSize();
+
+   m_statsConsistent = 0;
+   m_statsConsistent |= (MEAN_FLAG | SD_FLAG);
+}
+
+
+//---------------------------------------
+// -- Resample a histogram
+
+ossimHistogram::ossimHistogram(const ossimHistogram* his, float width)
+:
+m_statsConsistent(0),
+m_vals(0),
+m_counts(0),
+m_num(0),
+m_delta(0.0),
+m_vmin(0),
+m_vmax(0),
+m_mean(0.0),
+m_standardDev(0.0)
+{
+
+   m_statsConsistent =0;
+
+// Attributes of original histogram
+
+   float del = his->GetBucketSize();
+   int max_index = his->GetRes() - 1;
+   float minvalue = his->GetVals()[0] - del*.5f;
+   float maxvalue = his->GetVals()[max_index] + del*.5f;
+
+
+// Intialize a new histogram
+   if(width == del) m_num = his->GetRes();
+   else if(!(width == 0.0))
+      m_num = (int)ceil((maxvalue - minvalue)/width);
+   else
+      m_num = 1; // This shouldn't happen anyway.
+
+   m_vals = new float [m_num];
+   m_counts = new float [m_num];
+   m_delta = width;
+   float mean_val = (maxvalue + minvalue)/2.0f;
+   float half_range = (m_num * m_delta)/2.0f;
+   m_vmax =  mean_val + half_range;
+   m_vmin =  mean_val - half_range;
+   int i = 0;
+
+   if (m_vals == NULL || m_counts == NULL)
+   {
+      fprintf(stderr,
+              "Histogram : Ran out of memory for arrays.\n");
+      m_vals = NULL;
+      m_counts = NULL;
+      m_num = 0;
+      m_vmin = 0;
+      m_vmax = 0;
+      m_delta = 0.0;
+      m_mean = 0.0;
+      m_standardDev = 0.0;
+      m_statsConsistent |= (MEAN_FLAG | SD_FLAG);
+      return;
+       
+   }
+   
+   else
+   {
+      for(i = 0; i < m_num; i++)
+      {
+         m_vals[i] = m_vmin + m_delta * (i + 0.5f);
+         m_counts[i] = 0.0;
+      }
+   }
+
+
+// Cases:
+
+
+   if(width == del)    // Then just copy his
+   {
+      const float* his_counts = his->GetCounts();
+      for(i=0; i<m_num; i++)
+         m_counts[i] = his_counts[i];
+      m_mean = GetMean();
+      m_standardDev = GetStandardDev();
+      m_statsConsistent |= (MEAN_FLAG | SD_FLAG);
+      return;
+   }
+
+
+   if(del > width)     // Then interpolate his m_counts.
+   {
+
+// Boundary conditions:
+//    Start
+      float his_start = minvalue + .5f*del;
+      float start = m_vmin + .5f*m_delta;
+      float c0 = his->GetCount(his_start);
+      float c1 = his->GetCount(his_start + del);
+      float s0 = (c1 - c0)/del;
+
+      for(float x = start; x <= (his_start + del + m_delta);)
+      {
+         float interp = s0 * (x - his_start) + c0;
+         if(interp < 0) interp = 0; //Can be negative
+         SetCount(x,interp);
+         x += width;
+      }
+//    End
+      float his_end = maxvalue - .5f*del;
+      float end = m_vmax - .5f*m_delta;
+      float cn = his->GetCount(his_end);
+      float cn_1 = his->GetCount(his_end - del);
+      float sn = (cn_1 - cn)/del;
+
+      for(float y = end; y >= (his_end - del + m_delta);)
+      {
+         float interp = sn * (his_end - y) + cn;
+         if(interp < 0) interp = 0; //Can be negative
+         SetCount(y, interp);
+         y -= m_delta;
+      }
+// Interior Loop
+
+      for(float z = his_start + del; z <= (his_end - del);)
+      {
+         float ci = his->GetCount(z);
+         float ci_1 = his->GetCount(z-del);
+         float cip1 = his->GetCount(z+del);
+         float deriv = (cip1 - ci_1)/(2.0f*del);
+         float second_drv =
+            ((cip1 + ci_1)/2.0f - ci)/(del*del);
+         int fine_x_index = GetIndex(z);
+         if (fine_x_index < 0)
+         {
+            if (z<m_vmin) fine_x_index = 0;
+            else fine_x_index = m_num-1;
+         }
+         float fine_x = m_vals[fine_x_index];
+         for(float xfine = fine_x; xfine < z + del;)
+         {
+            float interp = ci + deriv*(xfine -z) +
+               second_drv*(xfine - z)*(xfine - z);
+
+            if(interp < 0) interp = 0; //Can be negative
+            SetCount(xfine, interp);
+            xfine += width;
+         }
+         z += del;
+      }
+   }
+
+
+   if(del < width)    //Just accumulate samples from his into larger bins
+   {
+      if( del != 0.0){
+         float his_start = minvalue + .5f*del;
+         float his_end = maxvalue - .5f*del;
+         for(float x = his_start; x <= his_end;)
+         {
+            SetCount(x, (GetCount(x) + his->GetCount(x)));
+            x += del;
+         }
+      }
+   }
+   m_mean = GetMean();
+   m_standardDev = GetStandardDev();
+   m_statsConsistent =0;
+   m_statsConsistent |= (MEAN_FLAG | SD_FLAG);
+}
+
+void ossimHistogram::create(int xres, float val1, float val2)
+{
+   // clear all the data
+   deleteAll();
+
+   // now set it up and initialize;
+   xres = xres >0? xres:1;
+   
+   m_vals   = new float [xres];
+   m_counts = new float [xres];
+   m_num = xres;
+   m_vmax = MAX(val1, val2);
+   m_vmin = MIN(val1, val2);
+
+   m_delta = (m_vmax - m_vmin) / xres;
+   m_mean = (float)((m_vmax + m_vmin)/2.0);
+   m_standardDev = (float)((m_vmax - m_vmin)/(2.0*sqrt(3.0)));
+   m_statsConsistent = 0;
+   m_statsConsistent |= (MEAN_FLAG | SD_FLAG);
+   int i = 0;
+   if (m_vals == NULL || m_counts == NULL)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "Histogram : Ran out of memory for arrays.\n";
+      m_vals = NULL;
+      m_counts = NULL;
+      m_num = 0;
+      m_vmin = 0;
+      m_vmax = 0;
+      m_delta = 0.0;
+   }
+   else
+   {
+      for(i = 0; i < xres; i++)
+      {
+         m_vals[i] = m_vmin + m_delta * (float)(i + 0.5);
+         m_counts[i] = 0.0;
+      }
+   }   
+}
+ossimHistogram* ossimHistogram::fillInteriorEmptyBins(int type)const
+{
+   if(m_num < 1) return 0;
+   ossimHistogram* result = new ossimHistogram(*this);
+   switch(type)
+   {
+      case HISTOGRAM_FILL_THIN_PLATE:
+      case HISTOGRAM_FILL_DEFAULT:
+      {
+         ossimThinPlateSpline spline(1);
+         double pvars[1];
+         float* new_counts = result->GetCounts();
+         ossim_int32 idxLeft = 0;
+         ossim_int32 idxRight = m_num-1;
+         while((idxLeft < m_num) && (new_counts[idxLeft]  < 1))++idxLeft;
+         while((idxRight > -1) && (new_counts[idxRight] < 1))--idxRight;
+         if(idxLeft < idxRight)
+         {
+            ossim_int32 idx = idxLeft;
+            while(idx <= idxRight)
+            {
+               if(new_counts[idx]>0)
+               {
+                  pvars[0] = new_counts[idx];
+                  spline.addPoint(idx, 0, pvars);
+               }
+               ++idx;
+            }
+            if(spline.solve())
+            {
+               idx = idxLeft;
+               while(idx <= idxRight)
+               {
+                  if(spline.getPoint(idx, 0, pvars))
+                  {
+                     new_counts[idx] = pvars[0];
+                  }
+                  ++idx;
+               }
+               m_statsConsistent = 0;
+            }
+            else
+            {
+            }
+         }
+         
+         break;
+      }
+   }
+   
+   return result;
+}
+//--------------------------------------------------
+// -- Transform the value axis of a histogram by a
+//    translation, transl, and a scale factor, scale.
+//    The new histogram has the same resolution as his.
+
+ossimHistogram* ossimHistogram::Scale(float scale_factor)
+{
+
+// Extract attributes of self
+
+//    float lowvalue = m_vals[0];
+   float highvalue = m_vals[m_num-1];
+
+// Construct a new histogram
+
+   ossimHistogram* scaled_his = new ossimHistogram(this, m_delta);
+   float* new_counts = scaled_his->GetCounts();
+   int i = 0;
+   for(i=0; i < m_num; i++)  // Initialize
+      new_counts[i] = 0.0;
+
+// Compute scaled values
+// We assume that the new histogram is to be scaled down from his
+
+   float scale = scale_factor;
+   if(scale_factor > 1.0) scale = 1.0;
+
+   for(float x = highvalue; x > m_vmin;)
+   {
+      float trans_x = (x-m_vmin)*scale + m_vmin; // Scaled x.
+      int index = GetIndex(trans_x);
+      if (index < 0)
+      {
+         if (trans_x<m_vmin) index = 0;
+         else index = m_num-1;
+      }
+      float fraction = (trans_x - m_vals[index])/m_delta;
+      float abs_fraction = (float)fabs(fraction);
+      int x_index = GetIndex(x);
+      if (x_index < 0)
+      {
+         if (x<m_vmin) x_index = 0;
+         else x_index = m_num-1;
+      }
+
+// Distribute the m_counts in proportion
+
+      new_counts[index] += (1.0f - abs_fraction)*m_counts[x_index];
+      if(fraction > 0)
+         if(index < (m_num-1))
+            new_counts[index + 1] +=
+               abs_fraction*m_counts[x_index];
+         else
+            new_counts[index] +=
+               abs_fraction*m_counts[x_index];
+      else
+         if(index > 0)
+            new_counts[index - 1] +=
+               abs_fraction*m_counts[x_index];
+         else
+            new_counts[index] +=
+               abs_fraction*m_counts[x_index];
+      x -= m_delta;
+   }
+
+// Compute new Histogram attributes
+
+   m_mean = scaled_his->GetMean();
+   m_standardDev = scaled_his->GetStandardDev();
+   return scaled_his;
+}
+
+//---------------------------------------------------------------------
+// -- Assuming that "this" is a histogram of population density,
+//    construct a new histogram which is the cumulative distribution.
+//    Each bin, xi, in his is assumed to represent a density, i.e.,
+//            {x | (xi - .5*m_delta) < x <= (xi + .5*m_delta)}
+//    Each bin, xi, in the result represents a cumulative distribution, i.e.,
+//            {x | x <= (xi + .5*m_delta)}
+ossimHistogram* ossimHistogram::CumulativeGreaterThanEqual()const
+{
+   ossimHistogram* cum_his = new ossimHistogram(*this);
+   const float* density_counts = this->GetCounts();
+   int res = this->GetRes();
+
+   // Intitialize cumulative m_counts
+   float* cum_counts = cum_his->GetCounts();
+   int i = 0;
+   for(i=0; i < res; i++)
+      cum_counts[i] = 0;
+  
+   cum_counts[res-1] = density_counts[res-1];
+   for(i = res-2; i>=0; --i)
+   {
+      cum_counts[i] += (density_counts[i] + cum_counts[i+1]);
+   }
+
+   return cum_his;
+}
+
+ossimHistogram* ossimHistogram::CumulativeLessThanEqual()const
+{
+   ossimHistogram* cum_his = new ossimHistogram(*this);
+   const float* density_counts = this->GetCounts();
+   int res = this->GetRes();
+
+   // Intitialize cumulative m_counts
+   float* cum_counts = cum_his->GetCounts();
+   int i = 0;
+   for(i=0; i < res; i++)
+      cum_counts[i] = 0;
+
+   cum_counts[0] = density_counts[0];
+   for(i = 1; i < res; i++)
+   {
+      cum_counts[i] += (density_counts[i] + cum_counts[i-1]);
+   }
+  
+   return cum_his;
+}
+
+//Provides the correct values for histogram m_counts when the bin index 
+//extends outside the valid range of the m_counts array.  This function
+//permits easy array access logic for the NonMaximumSuppression algorithm.
+//The cyclic flag indicates that the m_counts array index is circular, i.e,
+//cnts[0] equivalent to cnts[n_bins-1]
+inline float GetExtendedCount(int bin, int n_bins, float* cnts, bool cyclic)
+{
+   int nbm = n_bins-1;
+   if(!cyclic)
+   {
+      if(bin < 0)
+         return cnts[0];
+      if(bin >= n_bins)
+         return cnts[nbm];
+   }
+   else
+   {
+      if(bin<0)
+         return cnts[nbm+bin];
+      if(bin >= n_bins)
+         return cnts[bin-n_bins];
+   }
+   return cnts[bin];
+}
+//Prune any sequences of more than one maxium value
+//That is, it is possible to have a "flat" top peak with an arbitarily
+//long sequence of equal, but maximum values. The cyclic flag indictates
+//that the sequence wraps around, i.e. cnts[0] equivalent to cnts[nbins-1]
+inline void RemoveFlatPeaks(int nbins, float* cnts, bool cyclic)
+{
+   int nbm = nbins-1;
+
+   //Here we define a small state machine - parsing for runs of peaks
+   //init is the state corresponding to an initial run (starting at i ==0)
+   bool init=(GetExtendedCount(0, nbins, cnts, cyclic) !=0 ) ? true : false;
+   int init_end =0;
+
+   //start is the state corresponding to any other run of peaks
+   bool start=false;  
+   int start_index=0; 
+   int i = 0;
+
+   //The scan of the state machine
+   for(i = 0; i < nbins; i++)
+   {
+      float v = GetExtendedCount(i, nbins, cnts, cyclic);
+
+      //State init: a string of non-zeroes at the begining.
+      if(init&&v!=0)
+         continue;
+
+      if(init&&v==0)
+      {
+         init_end = i;
+         init = false;
+         continue;
+      }
+
+      //State !init&&!start: a string of "0s"
+      if(!start&&v==0)
+         continue;
+
+      //State !init&&start: the first non-zero value
+      if(!start&&v!=0)
+      {
+         start_index = i;
+         start = true;
+         continue;
+      }
+      //State ending flat peak: encountered a subsequent zero after starting
+      if(start&&v==0)
+      {
+         int peak_location = (start_index+i-1)/2;//The middle of the run
+         int k = 0;
+         for(k = start_index; k<=(i-1); k++)
+	    if(k!=peak_location)
+               cnts[k] = 0;
+         start = false;
+      }
+   }
+   //Now handle the boundary conditions
+   //The non-cyclic case
+   if(!cyclic)
+   {
+      if(init_end!=0)  //Was there an initial run of peaks?
+      {
+         int init_location = (init_end-1)/2;
+         int k = 0;
+         for(k = 0; k<init_end; k++)
+	    if(k!=init_location)
+               cnts[k] = 0;
+      }
+      if(start)       // Did we reach the end of the array in a run of pks?
+      {
+         int end_location = (start_index + nbm)/2;
+         int k = 0;
+         for(k = start_index; k<nbins; k++)
+	    if(k!=end_location)
+               cnts[k] = 0;
+      }
+   }
+   else  //The cyclic case
+   {
+      if(init_end!=0)  //Is there a run which crosses the cyclic cut?
+      {
+         if(start)    
+         { //Yes, so define the peak location accordingly
+	    int peak_location = (start_index + init_end - nbm -1)/2;
+	    int k;
+	    if(peak_location < 0) //Is the peak to the left of the cut?
+            {// Yes, to the left
+               peak_location += nbm; 
+               for( k = 0; k< init_end; k++)
+		  cnts[k]=0;
+               for( k= start_index; k <nbins; k++)
+		  if(k!=peak_location)
+                     cnts[k] = 0;
+            }
+	    else   
+            {//No, on the right.
+               for( k = start_index; k< nbins; k++)
+		  cnts[k]=0;
+               for( k= 0; k < init_end; k++)
+		  if(k!=peak_location)
+                     cnts[k] = 0;
+            }
+         }
+         else  
+         {//There wasn't a final run so just clean up the initial run
+	    int init_location = (init_end-1)/2;
+	    int k = 0;
+	    for(k = start_index; k<init_end; k++)
+               if(k!=init_location)
+                  cnts[k] = 0;
+         }
+      }
+   }
+}
+
+//----------------------------------------------------------
+// -- Suppress values in the Histogram which are not locally 
+//    a maxium. The neighborhood for computing the local maximum
+//    is [radius X radius], e.g. for radius =1 the neighborhood
+//    is [-X-], for radius = 2, the neighborhood is [--X--], etc.
+//    If the cyclic flag is true then the index space is assumed to
+//    be equivalent to a circle. That is, elements "0" and (n_buckets-1)
+//    are in correspondence.
+ossimHistogram* ossimHistogram::NonMaximumSupress(int radius, bool cyclic)
+{
+   if((2*radius +1)> m_num/2)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimHistogram::NonMaximumSupress the radius is too large \n";
+      return NULL;
+   }
+   //Get the m_counts array of "this"
+   ossimHistogram* h_new = new ossimHistogram(*this);
+   int n_buckets = h_new->GetRes();
+   float* counts_old = this->GetCounts();
+
+   //Make a new Histogram for the suppressed version
+   float* counts_new = h_new->GetCounts();
+   int i;
+   for( i =0; i < n_buckets; i++)
+      counts_new[i] = 0;
+  
+   //Find local maxima
+   for( i = 0; i<  n_buckets; i++)
+   {
+      //find the maxium value in the current kernel
+      float max_count = counts_old[i];
+      int k = 0;
+      for(k = -radius; k <= radius ;k++)
+      {
+         int index = i+k;
+         float c = GetExtendedCount(index, n_buckets, counts_old, cyclic);
+         if( c > max_count)
+	    max_count = c;
+      }
+      //Is position i a local maxium?
+      if(max_count == counts_old[i])
+         counts_new[i] = max_count;//Yes. So set the m_counts to the max value
+   }
+   RemoveFlatPeaks(n_buckets, counts_new, cyclic);
+   return h_new;
+}
+//----------------------------------------------------------
+// -- Compute the m_mean of the histogram population
+float ossimHistogram::GetMean()const
+{
+   float xsum = 0.0;
+
+   if(MEAN_FLAG&m_statsConsistent)
+      return m_mean;
+   else
+   {
+      if( this->GetBucketSize() > 0.0){
+         for(float x=this->GetMinVal(); x<= this->GetMaxVal(); x +=this->GetBucketSize())
+            xsum += x*GetCount(x);
+      }
+
+      float area = ComputeArea(m_vmin, m_vmax);
+      if(area <= 0.0)
+      {
+         //	      fprintf(stderr, "Histogram : Area <= 0.0\n");
+         return 0.0;
+      }
+      else
+      {
+         m_statsConsistent |=1;
+         m_mean = xsum/area;
+         return m_mean;
+      }
+   }
+}
+
+
+
+float ossimHistogram::GetStandardDev()const
+{
+   float sum = 0.0;
+
+   if(SD_FLAG&m_statsConsistent)
+      return m_standardDev;
+   else
+   {
+      float xm = this -> GetMean(); // Force an Update of m_mean
+
+      if( this->GetBucketSize() > 0.0){
+         for(float x=this->GetMinVal();
+             x<= this->GetMaxVal();
+             x +=this->GetBucketSize())
+
+            sum += (x-xm)*(x-xm)*GetCount(x);
+      }
+
+      float area = ComputeArea(m_vmin, m_vmax);
+      if(area <= 0.0)
+      {
+         //	      fprintf(stderr, "Histogram : Area <= 0.0\n");
+         return 0.0;
+      }
+      else
+      {
+         m_statsConsistent |= 2;
+         m_standardDev = (float)sqrt(sum/area);
+         return m_standardDev;
+      }
+   }
+}
+
+int ossimHistogram::GetIndex(float pixelval)const
+{
+#if 1
+   if ((pixelval > m_vmax) || (pixelval < m_vmin) || (m_num==0) )
+   {
+      return -1;
+   }
+//   ossim_float32 d = m_vmax-m_vmin;
+   int bandIdx = (ossim_int32)((pixelval-m_vmin)/m_delta);
+   return bandIdx<GetRes()?bandIdx:-1;
+//    if(bandIdx == m_num)
+//    {
+//       return m_num-1;
+//    }
+//    else if(bandIdx < m_num)
+//    {
+//       return bandIdx;
+//    }
+//    return -1;
+#else
+   if ((pixelval > m_vmax) || (pixelval < m_vmin))
+      return -1;
+
+   int idx = 0;
+   int i = 0;
+
+   for(i = 0; i < m_num; i++)
+   {
+      //std::cout << std::setprecision(15) << m_vals[i] << std::endl;
+      // RWMC: This is very dangerous - might get an intermediate
+      // value which is between m_vals[i]+0.5*m_delta and
+      // m_vals[i+1]-0.5*m_delta, which would then return index of 0.
+      // Changed to check range one-sided, which is safe because of
+      // previous check on range.
+      //       if ((pixelval > (m_vals[i] - 0.5 * m_delta)) &&
+      //           (pixelval <= (m_vals[i] + 0.5 * m_delta)))
+      if (pixelval <= (m_vals[i] + 0.5 * m_delta))
+      {
+         idx = i;
+         break;
+      }
+   }
+//std::cout << idx << std::endl;
+   return idx;
+#endif
+}
+float ossimHistogram::GetMinValFromIndex(ossim_uint32 idx)const
+{
+   float result = 0.0;
+   
+   if((int)idx < m_num)
+   {
+      result = (m_vals[idx]-(0.5 * m_delta));
+      if(result < m_vmin) result = m_vmin;
+   }
+
+   return result;
+}
+
+float ossimHistogram::GetMaxValFromIndex(ossim_uint32 idx)const
+{
+   float result = 0.0;
+   
+   if((int)idx < m_num)
+   {
+      result = (m_vals[idx]+(0.5 * m_delta));
+      if(result > m_vmax) result = m_vmax;
+   }
+
+   return result;  
+}
+
+float ossimHistogram::GetValFromIndex(ossim_uint32 idx)const
+{
+   float result = 0.0;
+   if((int)idx < m_num)
+   {
+      result = m_vals[idx];
+   }
+
+   return result;
+}
+
+int ossimHistogram::GetValIndex(float pixelval)const
+{
+   if ((pixelval > m_vmax) || (pixelval < m_vmin))
+      return -1;
+
+   int idx = 0;
+   int i = 0;
+
+   for(i = 0; i < m_num; i++)
+   {
+      if ((pixelval > (m_vals[i] - 0.5 * m_delta)) &&
+          (pixelval <= (m_vals[i] + 0.5 * m_delta)))
+      {
+         idx = i;
+         break;
+      }
+   }
+
+   return idx;
+}
+
+
+
+float ossimHistogram::GetCount(float pixelval)const
+{
+   int index = GetIndex(pixelval);
+
+   if (index < 0)
+      return -1;
+   else
+      return m_counts[index];
+}
+
+
+
+float ossimHistogram::GetMinVal()const
+{
+   int i=0;
+
+   while (i<m_num-1 && !m_counts[i])
+      i++;
+
+   return m_vals[i];
+}
+
+
+
+
+float ossimHistogram::GetMaxVal()const
+{
+   int i=m_num-1;
+
+   while (i>0 && !m_counts[i])
+      i--;
+
+   if (i < 0)
+      return 0.0;
+
+   return m_vals[i];
+}
+
+
+float ossimHistogram::GetMaxCount()const
+{
+   int i=0;
+   float max;
+   max = 0.0;
+   for (i=0; i < m_num; i++)
+      if (m_counts[i] > max)
+         max = m_counts[i];
+   return max;
+}
+
+
+
+
+float ossimHistogram::SetCount(float pixelval, float count)
+{
+   m_statsConsistent = 0;
+
+   int index = GetIndex(pixelval);
+
+   if (index < 0)
+      return -1;
+   else
+   {
+      m_counts[index] = count;
+      return count;
+   }
+}
+
+
+void ossimHistogram::UpCount(float pixelval, float occurences)
+{
+
+   m_statsConsistent = 0;
+   int idx = GetIndex(pixelval);
+   if (idx >= 0)  // Originally (index > 0)
+   {
+      m_counts[idx] += occurences;
+   }
+}
+
+float ossimHistogram::ComputeArea(float low, float high)const
+{
+   float sum = 0.0;
+   float maxval = GetMaxVal();
+   float minval = GetMinVal();
+
+   if (low < minval) low = minval;
+   if (high > maxval) high = maxval;
+
+   if (low <= high)
+   {
+      int indexlow, indexhigh;
+      indexlow = (int) GetIndex(low);
+      if (indexlow < 0)
+      {
+         if (low<m_vmin) indexlow = 0;
+         else indexlow = m_num-1;
+      }
+      indexhigh = (int) GetIndex(high);
+      if (indexhigh < 0)
+      {
+         if (high<m_vmin) indexhigh = 0;
+         else indexhigh = m_num-1;
+      }
+      int i=indexlow;
+
+      while (i<=indexhigh)
+      {
+         sum+= m_counts[i];
+         i++;
+      }
+   }
+
+   return sum;
+}
+//----------------------------------------------------------------------
+// --Compute the total area under the histogram
+//
+float ossimHistogram::ComputeArea()const
+{
+   float m_vmin = this->GetMinVal();
+   float m_vmax = this->GetMaxVal();
+   if(m_vmin>m_vmax)
+   {
+      float temp = m_vmin;
+      m_vmin = m_vmax;
+      m_vmax = temp;
+   }
+   return this->ComputeArea(m_vmin, m_vmax);
+}
+
+float ossimHistogram::getLowFractionFromValue(float val) const
+{
+   // std::cout << "ossimHistogram::getLowFractionFromValue(float val)\n";
+//   float minValue = floor(GetMinVal());
+//   float maxValue = ceil(GetMaxVal());
+   float minValue = GetMinVal();
+   float maxValue = GetMaxVal();
+   if (val < minValue || val > maxValue)
+   {
+      return ossim::nan();
+   }
+// std::cout << "VAL: " << val << "\n"
+//           << "MIN: " << minValue << "\n"
+//           << "MAX: " << maxValue << "\n"; 
+   int total_buckets = GetRes();
+   int cutoff_bucket = GetValIndex(val);
+   float partial_sum = 0.0;
+   float total_sum   = 0.0;
+   // std::cout << "CUTOFF BUCKET ===" << cutoff_bucket << "\n";
+   for(int i = 0; i < total_buckets; ++i)
+   {
+      total_sum += m_counts[i];
+      if (i <= cutoff_bucket)
+      {
+         partial_sum += m_counts[i];
+      }
+   }
+   // std::cout << "FRACTION ==== " << (partial_sum/total_sum) << "\n";
+   return (partial_sum/total_sum);
+}
+
+float ossimHistogram::getHighFractionFromValue(float val) const
+{
+//   float min = floor(GetMinVal());
+//   float max = ceil(GetMaxVal());
+   float minValue = GetMinVal();
+   float maxValue = GetMaxVal();
+   if (val < minValue || val > maxValue)
+   {
+      return ossim::nan();
+   }
+
+   int total_buckets = GetRes();
+   int cutoff_bucket = GetValIndex(val);
+   float partial_sum = 0.0;
+   float total_sum   = 0.0;
+   
+   for(int i = (total_buckets-1); i >= 0; --i)
+   {
+      total_sum += m_counts[i];
+      if (i >= cutoff_bucket)
+      {
+         partial_sum += m_counts[i];
+      }
+   }
+
+   return (partial_sum/total_sum);
+}
+
+//----------------------------------------------------------------------
+//  -- Finds the lower bound value which elminates a given fraction of
+//     histogram area.
+//
+float ossimHistogram::LowClipVal(float clip_fraction)const
+{
+   if(clip_fraction<0) clip_fraction=0.0;
+   if(clip_fraction>1.0) clip_fraction=1.0;
+   float area = this->ComputeArea();
+   if(area==0.0) return this->GetMinVal();
+   if(clip_fraction==0.0) return this->GetMinVal();
+   if(clip_fraction==1.0) return this->GetMaxVal();
+   float clip_area = area*clip_fraction;
+   const float* m_counts = this->GetCounts();
+   const float* m_vals = this->GetVals();
+   int res = this->GetRes();
+   float sum = 0;
+   int i=0;
+
+   for(; i<res; i++)
+   {
+      sum+=m_counts[i];
+      if(sum>=clip_area)
+         break;
+   }
+
+   return m_vals[i];
+}
+
+//----------------------------------------------------------------------
+//  -- Finds the lower bound value which elminates a given fraction of
+//     histogram area.
+//
+float ossimHistogram::HighClipVal(float clip_fraction)const
+{
+   if(clip_fraction<0) clip_fraction=0.0;
+   if(clip_fraction>1.0) clip_fraction=1.0;
+   float area = this->ComputeArea();
+   if(area==0.0) return this->GetMaxVal();
+   if(clip_fraction==0.0) return this->GetMaxVal();
+   if(clip_fraction==1.0) return this->GetMinVal();
+   float clip_area = area*clip_fraction;
+   const float* m_counts = this->GetCounts();
+   const float* m_vals = this->GetVals();
+   int res = this->GetRes();
+   float sum = 0;
+   int i = (res-1);
+   for(; i>=0; i--)
+   {
+      sum+=m_counts[i];
+      if(sum>=clip_area)
+         break;
+   }
+   return m_vals[i];
+}
+
+//--------------------------------------------------------------------------
+// -- Prints histogram m_counts onto cout
+void ossimHistogram::Print()const
+{
+   ostream& out = ossimNotify(ossimNotifyLevel_INFO);
+   const float* m_vals = this->GetVals();
+   const float* m_counts = this->GetCounts();
+   int res = this->GetRes();
+   int width = 0;
+   int i = 0;
+   for(i =0; i < res; i++)
+   {
+      if(width++ > 5)
+      {
+         width = 0;
+         out << "\n";
+      }
+      out << m_vals[i] << " " << m_counts[i] << " | " ;
+   }
+   out << "\n MaxVal " << this->GetMaxVal() << "\n";
+   out << " MinVal " << this->GetMinVal() << "\n";
+   out << " BucketSize " << this->GetBucketSize() << "\n";
+   out << " Resolution " << this->GetRes() << "\n";
+   out << " Area "
+       << this->ComputeArea(this->GetMinVal(),this->GetMaxVal()) << "\n";
+   out << "------------------------------------------------\n\n";
+}
+
+//---------------------------------------------------------------------------
+// --- dumps histogram  values  to file.
+
+void ossimHistogram::Dump(char *dumpfile)const
+{
+   FILE *dumpfp = fopen(dumpfile, "w");
+
+   if (!dumpfp)
+   {
+      fprintf(stderr, "Error opening histogram data file.\n");
+      return;
+   }
+   int i = 0;
+
+   for(i = 0; i < m_num; i++)
+      fprintf(dumpfp, "%f %f\n", m_vals[i], m_counts[i]);
+  
+   fclose(dumpfp);
+   return;
+}
+
+//---------------------------------------------------------------------------
+// -- Writes histogram in format suitable for plotting tools like Gnuplot.
+
+int ossimHistogram::WritePlot(const char *fname)const
+{
+   FILE *fp = fopen(fname, "w");
+
+   if (!fp)
+   {
+      fprintf(stderr, "Error opening histogram plot file.\n");
+      return 0;
+   }
+
+   for(int j = 0; j < m_num; j++)
+      fprintf(fp, "%f %f\n", m_vals[j], m_counts[j]);
+
+   fclose(fp);
+   return 1;
+}
+
+void ossimHistogram::deleteAll()
+{
+   if (m_vals)
+   {
+      delete []m_vals;
+      m_vals = NULL;
+   }
+   if (m_counts)
+   {
+      delete []m_counts;
+      m_counts = NULL;
+   }  
+}
+
+ossimHistogram::~ossimHistogram()
+{
+   deleteAll();
+}
+
+
+bool ossimHistogram::importHistogram(istream& in)
+{
+   ossimProprietaryHeaderInformation header;
+   bool binsCreated = false;
+   
+   if(header.parseStream(in))
+   {
+      long numberOfBins = header.getNumberOfBins();
+      
+      if(numberOfBins)
+      {
+         create(numberOfBins, 0, numberOfBins - 1);
+         binsCreated = true;
+
+         if(binsCreated)
+         {
+            ossimString buffer;
+            ossimString binNumber;
+            ossimString count;
+
+            while(in.good() &&
+                  !in.eof() &&
+                  *binNumber.c_str() != '.')
+            {
+               
+               getline(in, buffer);
+
+               istringstream s(buffer);
+
+               s >> binNumber >> count;
+               if(*binNumber.c_str() != (char)'.')
+               {
+                  SetCount((float)binNumber.toDouble(),
+                           (float)count.toDouble());
+               }
+            }
+         }
+      }
+      else
+      {
+         return false;
+      }
+   }  
+   return true;
+}
+
+bool ossimHistogram::importHistogram(const ossimFilename& inputFile)
+{
+   if(inputFile.exists())
+   {
+      ifstream input(inputFile.c_str());
+
+      return importHistogram(input);
+   }
+
+   return false;  
+}
+
+
+bool ossimHistogram::ossimProprietaryHeaderInformation::parseStream(istream& in)
+{
+   ossimString inputLine;
+   
+   getline(in, inputLine);  
+   if(inputLine.find("File Type") != string::npos)
+   {
+      std::string::size_type index = inputLine.find(":");
+      if(index != std::string::npos)
+      {
+         m_fileType = inputLine.substr(index+1);
+         m_fileType = m_fileType.trim();
+      }
+      else
+      {
+         return false;
+      }
+
+   }
+   else
+   {
+      return false;
+   }
+
+   getline(in, inputLine);  
+   if(inputLine.find("Version") != string::npos)
+   {
+      std::string::size_type index = inputLine.find(":");
+      if(index != std::string::npos)
+      {
+         m_version = inputLine.substr(index+1);
+         m_version = m_version.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+
+   getline(in, inputLine);  
+   if(inputLine.find("Mapper Type") != string::npos)
+   {
+      std::string::size_type index = inputLine.find(":");
+      if(index != std::string::npos)
+      {
+         m_mapperType = inputLine.substr(index+1);
+         m_mapperType = m_mapperType.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+
+   getline(in, inputLine);  
+   if(inputLine.find("Number of Bins") != string::npos)
+   {
+      std::string::size_type index = inputLine.find(":");
+      if(index != std::string::npos)
+      {
+         m_numberOfBins = inputLine.substr(index+1);
+         m_numberOfBins = m_numberOfBins.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+   
+   return true;   
+}
+
+bool ossimHistogram::saveState(ossimKeywordlist& kwl,
+                               const char* prefix)const
+{
+   kwl.add(prefix,
+           "type",
+           "ossimHistogram",
+           true);
+   kwl.add(prefix,
+           "number_of_bins",
+           m_num,
+           true);
+   kwl.add(prefix,
+           "min_value",
+           m_vmin,
+           true);
+   kwl.add(prefix,
+           "max_value",
+           m_vmax,
+           true);
+   
+
+
+   ossimString binArrayList = "(";
+   bool firstValue = true;
+
+   for(ossim_int32 index = 0; index < m_num; ++index)
+   {
+      if(fabs(m_counts[index]) > FLT_EPSILON)
+      {
+
+         if(!firstValue)
+         {
+            binArrayList += ",";
+         }
+         else
+         {
+            firstValue = false;
+         }
+         binArrayList += "("+ossimString::toString(index)+","+ossimString::toString(m_counts[index])+")";
+     }
+   }
+
+   binArrayList += ")";
+
+   kwl.add(prefix, "bins", binArrayList, true);
+#if 0
+   ossimString binValue = "";
+   for(ossim_int32 index = 0; index < m_num; ++index)
+   {
+      if(fabs(m_counts[index]) > FLT_EPSILON)
+      {
+         //     binValue = prefix;
+         binValue = "bin";
+         binValue += ossimString::toString(index);
+         
+         kwl.add(prefix,
+                 binValue.c_str(),
+                 m_counts[index],
+                 true);
+      }
+   }
+#endif   
+   return true;
+}
+
+bool ossimHistogram::loadState(const ossimKeywordlist& kwl,
+                               const char* prefix)
+{
+//   std::cout << "ossimHistogram::loadState!!!!\n";
+   const char* number_of_bins = kwl.find(prefix, "number_of_bins");
+
+//   std::cout << "NBINS = " << number_of_bins << std::endl;
+   if(number_of_bins)
+   {
+      ossim_uint32 bins = ossimString(number_of_bins).toUInt32();
+
+//      std::cout << "BINS ======== " << bins << std::endl;
+      if(bins > 0)
+      {
+         // setup some defaults
+         float minValue = 0;
+         float maxValue = bins - 1;
+
+         // see if there is a range set for the data
+         const char* min_value = kwl.find(prefix, "min_value");
+         const char* max_value = kwl.find(prefix, "max_value");
+
+         if(min_value)
+         {
+            minValue = (ossim_float32)ossimString(min_value).toDouble();
+         }
+         if(max_value)
+         {
+            maxValue = (ossim_float32)ossimString(max_value).toDouble();
+         }
+
+         create((int)bins, minValue, maxValue);
+         float* countsPtr = GetCounts();
+         memset(countsPtr, '\0', bins*sizeof(float));
+         // this is new style histogram creation
+         //
+         ossimString binsString = kwl.find(prefix, "bins");
+         if(!binsString.empty())
+         {
+            std::vector<ossimDpt> result;
+            ossim::toVector(result, binsString);
+            if(!result.empty())
+            {
+               ossim_uint32 idx = 0;
+               for(idx = 0; idx < result.size();++idx)
+               {
+                  ossim_uint32 binIdx = static_cast<ossim_uint32>(result[idx].x);
+                  if(binIdx < bins)
+                  {
+                     countsPtr[binIdx] = result[idx].y;
+                  }
+               }
+            }
+         }
+         else
+         {
+            ossimKeywordlist binsKwl;
+            ossim_uint32 offset = (ossim_uint32)(ossimString(prefix)+"bin").size();
+            ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "bin[0-9]+)";
+            kwl.extractKeysThatMatch(binsKwl,regExpression);
+            const ossimKeywordlist::KeywordMap& kwlMap = binsKwl.getMap();
+            ossimKeywordlist::KeywordMap::const_iterator iter = kwlMap.begin();
+            while(iter != kwlMap.end())
+            {
+               ossimString numberStr(iter->first.begin() + offset,
+                                     iter->first.end());
+               countsPtr[numberStr.toUInt32()] = ossimString(iter->second).toDouble();
+               ++iter;
+            }
+         }
+
+//         ossimKeywordlist kwl;
+//         this->saveState(kwl);
+//         std::cout << kwl << std::endl;
+         
+         return true;
+#if 0
+         // create the bins
+         ossimString binNumber = "";
+         ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "bin[0-9]+)";
+         vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
+         ossim_uint32 numberOfBins = (ossim_uint32)keys.size();
+         ossim_uint32 offset = (ossim_uint32)(ossimString(prefix)+"bin").size();
+
+         std::vector<ossim_uint32> theNumberList(numberOfBins);
+         ossim_uint32 idx = 0;
+         for(idx = 0; idx < theNumberList.size();++idx)
+         {
+            ossimString numberStr(keys[idx].begin() + offset,
+                                  keys[idx].end());
+            theNumberList[idx] = numberStr.toUInt32();
+
+         }
+         
+         float* countsPtr = GetCounts();
+         memset(countsPtr, '\0', bins*sizeof(float));
+         for(idx = 0; idx < numberOfBins;++idx)
+         {
+            const char* binCount = kwl.find(prefix, ossimString("bin") + ossimString::toString(theNumberList[idx]));
+            countsPtr[theNumberList[idx]] = (float)ossimString(binCount).toDouble();
+         }
+#endif
+      }
+   }
+   return true;
+}
+
+bool ossimHistogram::loadState(const ossimRefPtr<ossimXmlNode> xmlNode)
+{
+   ossimRefPtr<ossimXmlNode> binValues =  xmlNode->findFirstNode("binValues");
+   ossimRefPtr<ossimXmlNode> minValueNode  =  xmlNode->findFirstNode("minValue");
+   ossimRefPtr<ossimXmlNode> maxValueNode  =  xmlNode->findFirstNode("maxValue");
+
+   if(binValues.valid())
+   {
+      ossim_uint32 count = 0;
+      float minValue = 0.0;
+      float maxValue = 0.0;
+      std::vector<float> floatValues;
+      std::istringstream in(binValues->getText());
+      ossimString vString;
+      while(!in.fail())
+      {
+         in>>vString;
+         if(!in.fail())
+         {
+            floatValues.push_back(vString.toFloat32());
+         }
+      }
+      count = (ossim_uint32)floatValues.size();
+     
+      if(count)
+      {
+         minValue = 0;
+         maxValue = count - 1;
+
+         if(minValueNode.valid())
+         {
+            minValue = minValueNode->getText().toFloat32();
+         }
+         if(maxValueNode.valid())
+         {
+            maxValue = maxValueNode->getText().toFloat32();
+         }
+
+         create(count, minValue, maxValue);
+         float* countsPtr = GetCounts();
+         ossim_uint32 idx = 0;
+         for(idx = 0; idx < count; ++idx)
+         {
+            countsPtr[idx] = floatValues[idx];
+         }
+         return true;
+      }
+   }
+
+   return false;
+}
+
+bool ossimHistogram::saveState(ossimRefPtr<ossimXmlNode> xmlNode)const
+{
+   ossimRefPtr<ossimXmlNode> binValues = new ossimXmlNode;
+   xmlNode->setTag("ossimHistogram");
+   xmlNode->addChildNode("minValue", ossimString::toString(m_vmin));
+   xmlNode->addChildNode("maxValue", ossimString::toString(m_vmax));
+   xmlNode->addChildNode("standardDeviation", ossimString::toString(m_standardDev));
+   xmlNode->addChildNode("m_mean", ossimString::toString(m_mean));
+   binValues->setTag("binValues");
+   std::ostringstream out;
+
+   ossim_int32 idx = 0;
+   if(m_num > 0)
+   {
+      for(idx = 0; idx < m_num;++idx)
+      {
+         out << ossimString::toString(m_counts[idx], 8) << " ";
+      }
+      binValues->setText(out.str());
+   }
+   xmlNode->addChildNode(binValues.get());
+   
+   return true;
+}
diff --git a/src/base/ossimHistogramSource.cpp b/src/base/ossimHistogramSource.cpp
new file mode 100644
index 0000000..d41879e
--- /dev/null
+++ b/src/base/ossimHistogramSource.cpp
@@ -0,0 +1,106 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHistogramSource.cpp 11721 2007-09-13 13:19:34Z gpotts $
+
+#include <ossim/base/ossimHistogramSource.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+
+RTTI_DEF1(ossimHistogramSource, "ossimHistogramSource", ossimSource);
+
+
+ossimHistogramSource::ossimHistogramSource(ossimObject* owner,
+                                           ossim_uint32 numberOfInputs,
+                                           ossim_uint32 numberOfOutputs,
+                                           bool inputListFixedFlag,
+                                           bool outputListFixedFlag)
+   : ossimSource(owner,
+                 numberOfInputs,
+                 numberOfOutputs,
+                 inputListFixedFlag,
+                 outputListFixedFlag),
+     theHistogram(0),
+     theFilename()
+{
+}
+
+ossimHistogramSource::~ossimHistogramSource()
+{
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimHistogramSource::getHistogram()
+{
+   return theHistogram;
+}
+
+bool ossimHistogramSource::loadState(const ossimKeywordlist& kwl,
+				     const char* prefix)
+{   
+   theHistogram = 0;
+   const char* externalFile = kwl.find(prefix,
+                                       ossimKeywordNames::FILENAME_KW);
+
+   theHistogram = new ossimMultiResLevelHistogram;
+   if(externalFile)
+   {
+      if(!theHistogram->importHistogram(ossimFilename(externalFile)))
+      {
+         theHistogram = 0;
+         theFilename = "";
+      }
+      theFilename = externalFile;
+   }
+   else
+   {
+      ossimString newPrefix = ossimString(prefix) + "histogram.";
+      if(!theHistogram->loadState(kwl, newPrefix))
+      {
+         theHistogram = 0;
+      }
+   }
+   
+   return ossimSource::loadState(kwl, prefix);
+}
+
+bool ossimHistogramSource::saveState(ossimKeywordlist& kwl,
+				     const char* prefix)const
+{
+   if(theHistogram.valid())
+   {
+      if(!theFilename.empty())      {
+         ossimKeywordlist kwl2;
+         
+         if(theHistogram->saveState(kwl2))
+         {
+            kwl2.write(theFilename.c_str());
+            kwl.add(prefix,
+                    ossimKeywordNames::FILENAME_KW,
+                    theFilename.c_str(),
+                    true);
+         }
+      }
+      else
+      {
+         ossimString newPrefix = ossimString(prefix) + "histogram.";
+         theHistogram->saveState(kwl, newPrefix);
+      }
+   }
+   
+   return ossimSource::saveState(kwl, prefix);
+}
+
+// Hidden from use.
+ossimHistogramSource::ossimHistogramSource(const ossimHistogramSource&)
+   :
+   theHistogram(0),
+   theFilename()
+{
+}
diff --git a/ossim/src/ossim/base/ossimHsiVector.cpp b/src/base/ossimHsiVector.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimHsiVector.cpp
rename to src/base/ossimHsiVector.cpp
diff --git a/ossim/src/ossim/base/ossimHsvVector.cpp b/src/base/ossimHsvVector.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimHsvVector.cpp
rename to src/base/ossimHsvVector.cpp
diff --git a/ossim/src/ossim/base/ossimHttpRequest.cpp b/src/base/ossimHttpRequest.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimHttpRequest.cpp
rename to src/base/ossimHttpRequest.cpp
diff --git a/src/base/ossimHttpResponse.cpp b/src/base/ossimHttpResponse.cpp
new file mode 100644
index 0000000..a9caad1
--- /dev/null
+++ b/src/base/ossimHttpResponse.cpp
@@ -0,0 +1,49 @@
+#include <ossim/base/ossimHttpResponse.h>
+
+RTTI_DEF1(ossimHttpResponse, "ossimHttpResponse", ossimWebResponse);
+
+void ossimHttpResponse::convertHeaderStreamToKeywordlist()
+{
+   m_headerKwl.clear();
+   ossimByteStreamBuffer buf(m_headerBuffer);
+   
+   std::istream in(&buf);
+   in.seekg(0); // make sure we are at the begining
+   // skip method type
+   //
+   std::string statusLine;
+   std::getline(in, statusLine);
+   m_statusLine = statusLine;
+   
+   m_headerKwl.parseStream(in);
+   std::vector<ossimString> statusLineArray;
+   m_statusLine.split(statusLineArray, " ");
+   if(statusLineArray.size() > 1)
+   {
+      m_statusCode = statusLineArray[1].toUInt32();
+   }
+   else
+   {
+      m_statusCode = 0;
+   }
+}
+
+ossimString ossimHttpResponse::getHeaderValue(const ossimString& headerName)const
+{
+   ossimString result = m_headerKwl.find(headerName);
+
+   return result;
+}
+
+ossim_int64 ossimHttpResponse::getContentLength()const
+{
+   ossim_float64 result = -1;
+   ossimString contentLength = m_headerKwl.find("Content-Length");
+   
+   if(!contentLength.empty())
+   {
+      result = contentLength.toInt64();
+   }
+
+   return result;
+}
diff --git a/ossim/src/ossim/base/ossimId.cpp b/src/base/ossimId.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimId.cpp
rename to src/base/ossimId.cpp
diff --git a/ossim/src/ossim/base/ossimIdManager.cpp b/src/base/ossimIdManager.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimIdManager.cpp
rename to src/base/ossimIdManager.cpp
diff --git a/ossim/src/ossim/base/ossimImageAoiListener.cpp b/src/base/ossimImageAoiListener.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimImageAoiListener.cpp
rename to src/base/ossimImageAoiListener.cpp
diff --git a/ossim/src/ossim/base/ossimImageGeometryEvent.cpp b/src/base/ossimImageGeometryEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimImageGeometryEvent.cpp
rename to src/base/ossimImageGeometryEvent.cpp
diff --git a/ossim/src/ossim/base/ossimImageGeometryEventListener.cpp b/src/base/ossimImageGeometryEventListener.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimImageGeometryEventListener.cpp
rename to src/base/ossimImageGeometryEventListener.cpp
diff --git a/src/base/ossimImageTypeLut.cpp b/src/base/ossimImageTypeLut.cpp
new file mode 100644
index 0000000..d40896f
--- /dev/null
+++ b/src/base/ossimImageTypeLut.cpp
@@ -0,0 +1,56 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ImageTypeLUT.  Currently has mapping of
+// output image writes from enumeration to string and string to
+// enumeration.
+//
+//*******************************************************************
+//  $Id: ossimImageTypeLut.cpp 22221 2013-04-11 15:30:08Z dburken $
+
+#include <ossim/base/ossimImageTypeLut.h>
+
+//***
+// Pixel type keyword to use for getState/saveState methods.
+//***
+const ossimKeyword ossimImageTypeLut::IMAGE_TYPE_KW("image_type",
+                                                    "Image type.\n\
+Valid types are:  ccf, tiff, tiled_tiff, jpeg, and general_raster.");
+
+static const int TABLE_SIZE = 9;
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimImageTypeLut::ossimImageTypeLut()
+   :
+      ossimLookUpTable(TABLE_SIZE)
+{
+   //***
+   // Complete initialization of data member "theImageTypeTable".
+   // Note:  Output type enumerations defined in constants.h file.
+   //***
+   theTable[0].theKey   = OSSIM_TIFF_STRIP;
+   theTable[0].theValue = "tiff_strip";
+   theTable[1].theKey   = OSSIM_TIFF_STRIP_BAND_SEPARATE;
+   theTable[1].theValue = "tiff_strip_band_separate";
+   theTable[2].theKey   = OSSIM_TIFF_TILED;
+   theTable[2].theValue = "tiff_tiled";
+   theTable[3].theKey   = OSSIM_TIFF_TILED_BAND_SEPARATE;
+   theTable[3].theValue = "tiff_tiled_band_separate";
+   theTable[4].theKey   = OSSIM_GENERAL_RASTER_BIP;
+   theTable[4].theValue = "general_raster_bip";
+   theTable[5].theKey   = OSSIM_GENERAL_RASTER_BIL;
+   theTable[5].theValue = "general_raster_bil";
+   theTable[6].theKey   = OSSIM_GENERAL_RASTER_BSQ;
+   theTable[6].theValue = "general_raster_bsq";
+   theTable[7].theKey   = OSSIM_JPEG;
+   theTable[7].theValue = "jpeg";
+   theTable[8].theKey   = OSSIM_PDF;
+   theTable[8].theValue = "ossim_pdf";
+}
diff --git a/ossim/src/ossim/base/ossimInterleaveTypeLut.cpp b/src/base/ossimInterleaveTypeLut.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimInterleaveTypeLut.cpp
rename to src/base/ossimInterleaveTypeLut.cpp
diff --git a/ossim/src/ossim/base/ossimIoStream.cpp b/src/base/ossimIoStream.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimIoStream.cpp
rename to src/base/ossimIoStream.cpp
diff --git a/ossim/src/ossim/base/ossimIpt.cpp b/src/base/ossimIpt.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimIpt.cpp
rename to src/base/ossimIpt.cpp
diff --git a/src/base/ossimIrect.cpp b/src/base/ossimIrect.cpp
new file mode 100644
index 0000000..6f71fe5
--- /dev/null
+++ b/src/base/ossimIrect.cpp
@@ -0,0 +1,685 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimIrect.
+// 
+//*******************************************************************
+//  $Id: ossimIrect.cpp 21560 2012-08-30 12:09:03Z gpotts $
+
+#include <ostream>
+#include <sstream>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+// nonstandard versions that use operator>, so they behave differently
+// than std:::min/max and ossim::min/max.  kept here for now for that
+// reason.
+#ifndef MAX
+#  define MAX(x,y) ((x)>(y)?(x):(y))
+#  define MIN(x,y) ((x)>(y)?(y):(x))
+#endif
+
+ossimIrect::ossimIrect(const ossimDrect& rect)
+   :
+      theUlCorner(rect.ul()),
+      theUrCorner(rect.ur()),
+      theLrCorner(rect.lr()),
+      theLlCorner(rect.ll()),
+      theOrientMode(rect.orientMode())
+{}
+
+ossimIrect::ossimIrect(const std::vector<ossimIpt>& points,
+                       ossimCoordSysOrientMode mode)
+   :
+      theOrientMode (mode)
+{
+   if(points.size())
+   {
+      ossim_uint32 index;
+      ossim_int32  minx = points[0].x;
+      ossim_int32  miny = points[0].y;
+      ossim_int32  maxx = points[0].x;
+      ossim_int32  maxy = points[0].y;
+            
+      // find the bounds
+      for(index = 1; index < points.size();index++)
+      {
+         minx = ossim::min(minx, points[index].x);
+         miny = ossim::min(miny, points[index].y);
+         maxx = ossim::max(maxx, points[index].x);
+         maxy = ossim::max(maxy, points[index].y);
+         
+      }
+      if(theOrientMode == OSSIM_LEFT_HANDED)
+      {
+         *this = ossimIrect(minx, miny, maxx, maxy, mode);
+      }
+      else
+      {
+         *this = ossimIrect(minx,maxy, maxx, miny, mode);
+      }
+   }
+   else
+   {
+      makeNan();
+   }
+}
+
+ossimIrect::ossimIrect(const ossimIpt& p1,
+                       const ossimIpt& p2,
+                       const ossimIpt& p3,
+                       const ossimIpt& p4,
+                       ossimCoordSysOrientMode mode)
+   :theOrientMode(mode)
+{
+   if(p1.hasNans()||p2.hasNans()||p3.hasNans()||p4.hasNans())
+   {
+      makeNan();
+   }
+   else
+   {
+      ossim_int32 minx, miny;
+      ossim_int32 maxx, maxy;
+      
+      minx = ossim::min( p1.x, ossim::min(p2.x, ossim::min(p3.x, p4.x)));
+      miny = ossim::min( p1.y, ossim::min(p2.y, ossim::min(p3.y, p4.y)));
+      maxx = ossim::max( p1.x, ossim::max(p2.x, ossim::max(p3.x, p4.x)));
+      maxy = ossim::max( p1.y, ossim::max(p2.y, ossim::max(p3.y, p4.y)));
+      
+      if(theOrientMode == OSSIM_LEFT_HANDED)
+      {
+         *this = ossimIrect(minx, miny, maxx, maxy, mode);
+      }
+      else
+      {
+         *this = ossimIrect(minx,maxy, maxx, miny, mode);
+      }
+   }
+}
+
+ossimIrect::~ossimIrect()
+{
+}
+
+//*******************************************************************
+//! Constructs an Irect surrounding the specified point, and of specified size.
+//*******************************************************************
+ossimIrect::ossimIrect(const ossimIpt& center, 
+                       ossim_uint32    size_x, 
+                       ossim_uint32    size_y,
+                       ossimCoordSysOrientMode mode)
+: theOrientMode (mode)
+{
+   ossim_int32 minx = center.x - size_x/2;
+   ossim_int32 maxx = minx + size_x - 1;
+
+   ossim_int32 miny = center.y - size_y/2;
+   ossim_int32 maxy = miny + size_y - 1;
+
+   if(mode == OSSIM_LEFT_HANDED)
+      *this = ossimIrect(minx, miny, maxx, maxy, mode);
+   else
+      *this = ossimIrect(minx,maxy, maxx, miny, mode);
+}
+
+
+//*************************************************************************************************
+//! Guarantees that this rect will be at least w X h big. If smaller than specified, the 
+//! corresponding side will be stretched equally in + and - direction to meet required size.
+//! Returns TRUE if resizing occurred.
+//*************************************************************************************************
+bool ossimIrect::insureMinimumSize(const ossimIpt& width_height)
+{
+   ossimIpt ul (theUlCorner);
+   ossimIpt lr (theLrCorner);
+   bool resized = false;
+
+   int dx = width_height.x - width();
+   int dy = width_height.y - height();
+
+   if (dx > 0)
+   {
+      dx = (int) ceil((double)dx/2.0);
+      ul.x -= dx;
+      lr.x += dx;
+      resized = true;
+   }
+
+   if (dy > 0)
+   {
+      resized = true;
+      if(theOrientMode == OSSIM_LEFT_HANDED)
+      {
+         dy = (int) ceil((double)dy/2.0);
+         ul.y -= dy;
+         lr.y += dy;
+      }
+      else
+      {
+         dy = (int) ceil((double)dy/2.0);
+         ul.y += dy;
+         lr.y -= dy;
+      }
+   }
+
+   if (resized)
+      *this = ossimIrect(ul, lr, theOrientMode);
+
+   return resized;
+}
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+bool ossimIrect::intersects(const ossimIrect& rect) const
+{
+   if(rect.hasNans() || hasNans())
+   {
+      return false;
+   }
+   if (theOrientMode != rect.theOrientMode)
+      return false;
+   
+   ossim_int32  ulx = ossim::max(rect.ul().x,ul().x);
+   ossim_int32  lrx = ossim::min(rect.lr().x,lr().x);
+   ossim_int32  uly, lry;
+   bool rtn=false;
+   if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      uly  = ossim::max(rect.ul().y,ul().y);
+      lry  = ossim::min(rect.lr().y,lr().y);
+      rtn = ((ulx <= lrx) && (uly <= lry));
+   }
+   else
+   {
+      uly  = ossim::max(rect.ll().y,ll().y);
+      lry  = ossim::min(rect.ur().y,ur().y);
+      rtn = ((ulx <= lrx) && (uly <= lry));
+   }
+   
+   return (rtn);
+}
+
+void ossimIrect::stretchToTileBoundary(const ossimIpt& tileWidthHeight)
+{
+   ossimIpt ul;
+   ossimIpt lr;
+
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      ul.x = theUlCorner.x;
+      if( (theUlCorner.x % tileWidthHeight.x) != 0)
+      {
+         ul.x = ((ul.x / tileWidthHeight.x))*tileWidthHeight.x;
+         if(ul.x > theUlCorner.x)
+         {
+            ul.x -= tileWidthHeight.x;
+         }
+      }
+      ul.y = theUlCorner.y;
+      if( (theUlCorner.y % tileWidthHeight.y) != 0)
+      {
+         ul.y = ((ul.y / tileWidthHeight.y))*tileWidthHeight.y;
+         if(ul.y > theUlCorner.y)
+         {
+            ul.y -= tileWidthHeight.y;
+         }
+      }
+      ossim_int32 w = (theLrCorner.x - ul.x) + 1;
+      ossim_int32 h = (theLrCorner.y - ul.y) + 1;
+      
+      ossim_int32 nw = (w / tileWidthHeight.x)*tileWidthHeight.x;
+      ossim_int32 nh = (h / tileWidthHeight.y)*tileWidthHeight.y;
+      
+      if(w%tileWidthHeight.x)
+      {
+         nw += tileWidthHeight.x;
+      }
+      if(h%tileWidthHeight.y)
+      {
+         nh += tileWidthHeight.y;
+      }
+           
+      lr.x = ul.x + (nw-1);
+      lr.y = ul.y + (nh-1);
+   }
+   else
+   {
+      ul.x = theUlCorner.x;
+      ul.y = theUlCorner.y;
+      if( (theUlCorner.x%tileWidthHeight.x)!= 0)
+      {
+         ul.x = ((ul.x/ tileWidthHeight.x))*tileWidthHeight.x;
+         if(ul.x > theUlCorner.x)
+         {
+            ul.x -= tileWidthHeight.x;
+         }
+      }
+      if( (theUlCorner.y%tileWidthHeight.y)!=0 )
+      {
+         ul.y = ((ul.y / tileWidthHeight.y))*tileWidthHeight.y;
+         if(ul.y < theUlCorner.y)
+         {
+            ul.y += tileWidthHeight.y;
+         }
+      }
+      ossim_int32 w = theLrCorner.x - ul.x;
+      if (w < 0)
+      {
+         w = -w;
+      }
+      w += 1;
+      ossim_int32 h = theLrCorner.y - ul.y;
+      if (h < 0)
+      {
+         h = -h;
+      }
+      h += 1;
+
+      ossim_int32 nw = (w / tileWidthHeight.x)*tileWidthHeight.x;
+      ossim_int32 nh = (h / tileWidthHeight.y)*tileWidthHeight.y;
+      
+      if(w%tileWidthHeight.x)
+      {
+         nw += tileWidthHeight.x;
+      }
+      if(h%tileWidthHeight.y)
+      {
+         nh += tileWidthHeight.y;
+      }
+           
+      lr.x = ul.x + (nw-1);
+      lr.y = ul.y - (nh-1);
+  }
+
+   *this = ossimIrect(ul, lr, theOrientMode);
+}
+
+
+const ossimIrect& ossimIrect::expand(const ossimIpt& padding)
+{
+   theUlCorner.x -= padding.x;
+   theUrCorner.x += padding.x;
+   theLrCorner.x += padding.x;
+   theLlCorner.x -= padding.x;
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      theUlCorner.y -= padding.y;
+      theUrCorner.y -= padding.y;
+      theLrCorner.y += padding.y;
+      theLlCorner.y += padding.y;
+   }
+   else
+   {
+      theUlCorner.y += padding.y;
+      theUrCorner.y += padding.y;
+      theLrCorner.y -= padding.y;
+      theLlCorner.y -= padding.y;
+   }
+   
+   return *this;
+}
+
+ossimString ossimIrect::toString()const
+{
+   ossimString result="(";
+   
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      ossimIpt origin = ul();
+      result += (ossimString::toString(origin.x) + ",");
+      result += (ossimString::toString(origin.y) + ",");
+      result += (ossimString::toString(width()) + ",");
+      result += (ossimString::toString(height()) + ",");
+      result += "LH";
+   }
+   else 
+   {
+      ossimIpt origin = ll();
+      result += (ossimString::toString(origin.x) + ",");
+      result += (ossimString::toString(origin.y) + ",");
+      result += (ossimString::toString(width()) + ",");
+      result += (ossimString::toString(height()) + ",");
+      result += "RH";
+   }
+
+   result += ")";
+   return result;
+}
+
+bool ossimIrect::toRect(const ossimString& rectString)
+{
+   bool result = false;
+   makeNan();
+   
+   std::istringstream in(rectString);
+   ossim::skipws(in);
+   char charString[2];
+   charString[1] = '\0';
+   ossimString interior;
+   if(in.peek() == '(')
+   {
+      in.ignore();
+      while((in.peek() != ')')&&
+            (in.peek() != '\n') &&
+            in.good())
+      {
+         charString[0] = in.get();
+         interior += charString;
+      }
+      if(in.peek() == ')')
+      {
+         result = true;
+      }
+   }
+   if(result)
+   {
+      std::vector<ossimString> splitArray;
+      interior.split(splitArray, ",");
+      
+      // assume left handed
+      if(splitArray.size() >= 4)
+      {
+         ossim_int64 x = splitArray[0].toInt64();
+         ossim_int64 y = splitArray[1].toInt64();
+         ossim_int64 w = splitArray[2].toInt64();
+         ossim_int64 h = splitArray[3].toInt64();
+         ossimString orientation = "lh";
+         if(splitArray.size() == 5)
+         {
+            orientation = splitArray[4].downcase();
+         }
+         if(orientation == "lh")
+         {
+            // origin upper left
+            *this = ossimIrect(x,y,x + (w-1), y+h-1, OSSIM_LEFT_HANDED);
+         }
+         else 
+         {
+            // origin lower left
+            *this = ossimIrect(x,y+(h-1),x + (w-1), y, OSSIM_RIGHT_HANDED);
+         }
+         
+      }
+      else
+      {
+         result = false;
+      }
+
+   }
+   return result;
+}
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+bool ossimIrect::completely_within(const ossimIrect& rect) const
+{
+   if(hasNans() || rect.hasNans())
+   {
+      return false;
+   }
+   if (theOrientMode != rect.theOrientMode)
+      return false;
+   
+   /*  --------------
+       |     1      |
+       | ---------- |
+       | |        | |
+       | |        | |
+       | |   2    | |
+       | |        | |
+       | |        | |
+       | ---------- |
+       |            |
+       --------------  */
+
+   bool rtn = true;
+   if ((theUlCorner.x > rect.ur().x)||
+       (theUlCorner.x < rect.ul().x))
+      rtn = false;
+   
+   else if ((theLrCorner.x > rect.lr().x)||
+            (theLrCorner.x < rect.ll().x))
+      rtn = false;
+   
+   else if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      if ((theUlCorner.y < rect.ul().y)||
+          (theUlCorner.y > rect.lr().y))
+         rtn = false;
+   
+      else if ((theLrCorner.y > rect.lr().y)||
+               (theLrCorner.y < rect.ul().y))
+         rtn = false;
+   }
+   
+   else
+   {
+      if ( (theUlCorner.y > rect.ul().y)||
+           (theUlCorner.y < rect.lr().y))
+         rtn = false;
+   
+      else if ((theLrCorner.y < rect.lr().y)||
+               (theLrCorner.y > rect.ul().y))
+         rtn = false;
+   }
+
+   return rtn;
+}
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+void ossimIrect::print(std::ostream& os) const
+{
+   os << toString();
+}
+
+//*******************************************************************
+// friend function: operator<<
+//*******************************************************************
+std::ostream& operator<<(std::ostream& os, const ossimIrect& rect)
+{
+   rect.print(os);
+
+   return os;
+}
+
+//*******************************************************************
+//  Method: ossimIrect::clipToRect
+//*******************************************************************
+ossimIrect ossimIrect::clipToRect(const ossimIrect& rect)const
+{   
+   if (theOrientMode != rect.theOrientMode)
+      return (*this);
+
+   int x0 = MAX(rect.ul().x, ul().x);
+   int x1 = MIN(rect.lr().x, lr().x);
+   int y0, y1;
+
+   if(!this->intersects(rect))
+   {
+      return ossimIrect(OSSIM_INT_NAN,
+         OSSIM_INT_NAN,
+         OSSIM_INT_NAN,
+         OSSIM_INT_NAN);
+
+   }
+   if (theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      y0 = MAX(rect.ul().y, ul().y);
+      y1 = MIN(rect.lr().y, lr().y);
+
+      if( (x1 < x0) || (y1 < y0) )
+         return ossimIrect(ossimIpt(0,0), ossimIpt(0,0), theOrientMode);
+      else
+         return ossimIrect(x0, y0, x1, y1, theOrientMode);
+   }
+   else
+   {
+      y1 = MIN(rect.ul().y,ul().y);
+      y0 = MAX(rect.lr().y,lr().y);
+
+      if((x1 < x0) || (y1 < y0))
+         return ossimIrect(ossimIpt(0,0), ossimIpt(0,0), theOrientMode);
+      else
+         return ossimIrect(x0, y1, x1, y0, theOrientMode);
+   }
+}
+
+//*******************************************************************
+//  Returns the minimum bounding rect that includes this and arg rect.
+//*******************************************************************
+ossimIrect ossimIrect::combine(const ossimIrect& rect) const
+{   
+   // If any rect has NANs, it is assumed uninitialized, so assign the result to just the other
+   if (hasNans()) 
+      return rect;
+   if(rect.hasNans())
+      return *this;
+
+   if (theOrientMode != rect.theOrientMode)
+      return(*this);
+
+   ossimIpt ulCombine;
+   ossimIpt lrCombine;
+
+   if(theOrientMode == OSSIM_LEFT_HANDED)
+   {
+      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
+      ulCombine.y = ((ul().y <= rect.ul().y)?ul().y:rect.ul().y);
+      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
+      lrCombine.y = ((lr().y >= rect.lr().y)?lr().y:rect.lr().y);
+   }
+   else
+   {
+      ulCombine.x = ((ul().x <= rect.ul().x)?ul().x:rect.ul().x);
+      ulCombine.y = ((ul().y >= rect.ul().y)?ul().y:rect.ul().y);
+      lrCombine.x = ((lr().x >= rect.lr().x)?lr().x:rect.lr().x);
+      lrCombine.y = ((lr().y <= rect.lr().y)?lr().y:rect.lr().y);
+   }
+
+   return ossimIrect(ulCombine, lrCombine, theOrientMode);
+}
+
+//*******************************************************************
+// Inline Method: ossimIrect::operator=(const ossimDrect& rect)
+//*******************************************************************
+const ossimIrect& ossimIrect::operator=(const ossimDrect& rect)
+{
+   theUlCorner   = rect.ul();
+   theUrCorner   = rect.ur();
+   theLrCorner   = rect.lr();
+   theLlCorner   = rect.ll();
+   theOrientMode = rect.orientMode();
+   
+   return *this;
+}
+
+bool ossimIrect::saveState(ossimKeywordlist& kwl,
+                           const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           "ossimIrect",
+           true);
+
+   kwl.add(prefix, "rect", toString());
+ #if 0  
+   if(hasNans())
+   {
+      kwl.add(prefix,
+              "ul_x",
+              "nan",
+              true);
+      kwl.add(prefix,
+              "ul_y",
+              "nan",
+              true);
+      kwl.add(prefix,
+              "lr_x",
+              "nan",
+              true);
+      kwl.add(prefix,
+              "lr_y",
+              "nan",
+              true);
+   }
+   else
+   {
+      kwl.add(prefix,
+              "ul_x",
+              theUlCorner.x,
+              true);
+      kwl.add(prefix,
+              "ul_y",
+              theUlCorner.y,
+              true);
+      kwl.add(prefix,
+              "lr_x",
+              theLrCorner.x,
+              true);
+      kwl.add(prefix,
+              "lr_y",
+              theLrCorner.y,
+              true);
+   }
+#endif
+   return true;
+}
+
+bool ossimIrect::loadState(const ossimKeywordlist& kwl,
+                           const char* prefix)
+{
+  makeNan();
+  const char* ulx = kwl.find(prefix, "ul_x");
+  const char* uly = kwl.find(prefix, "ul_y");
+  const char* lrx = kwl.find(prefix, "lr_x");
+  const char* lry = kwl.find(prefix, "lr_y");
+  const char* rect = kwl.find(prefix, "rect");
+
+  if(ulx&&uly&&lrx&&lry)
+  {
+    if( (ossimString(ulx).trim().upcase() != "NAN") &&
+        (ossimString(uly).trim().upcase() != "NAN") &&
+        (ossimString(lrx).trim().upcase() != "NAN") &&
+        (ossimString(lry).trim().upcase() != "NAN"))
+    {
+      *this = ossimIrect(ossimString(ulx).toInt32(),
+                         ossimString(uly).toInt32(),
+                         ossimString(lrx).toInt32(),
+                         ossimString(lry).toInt32());
+    }
+  }
+  else if(rect)
+  {
+      toRect(rect);
+  }
+   
+   return true;
+}
+
+void ossimIrect::getCenter(ossimDpt& center_point) const
+{
+   if (hasNans())
+   {
+      center_point.makeNan();
+      return;
+   }
+
+   double d = (theUlCorner.x + theUrCorner.x + theLrCorner.x + theLlCorner.x);
+   center_point.x = d / 4.0;
+
+   d = (theUlCorner.y + theUrCorner.y + theLrCorner.y + theLlCorner.y);
+   center_point.y = d / 4.0;
+}
diff --git a/ossim/src/ossim/base/ossimJpegYCbCrVector.cpp b/src/base/ossimJpegYCbCrVector.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimJpegYCbCrVector.cpp
rename to src/base/ossimJpegYCbCrVector.cpp
diff --git a/src/base/ossimKMeansClustering.cpp b/src/base/ossimKMeansClustering.cpp
new file mode 100644
index 0000000..2f22bac
--- /dev/null
+++ b/src/base/ossimKMeansClustering.cpp
@@ -0,0 +1,240 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/base/ossimKMeansClustering.h>
+#include <iostream>
+
+using namespace std;
+
+ossimKMeansClustering::ossimKMeansClustering()
+:  m_numEntries(0),
+   m_samples(0),
+   m_populations(0),
+   m_clustersValid(false),
+   m_verbose(false)
+{
+
+}
+
+ossimKMeansClustering::~ossimKMeansClustering()
+{
+   delete m_samples;
+   delete m_populations;
+   m_clusters.clear();
+}
+
+void ossimKMeansClustering::setNumClusters(ossim_uint32 K)
+{
+   m_clusters.clear();
+   m_clusters.resize(K);
+   m_clustersValid = false;
+}
+
+bool ossimKMeansClustering::computeKmeans()
+{
+   if ((m_numEntries == 0) || (m_samples == 0))
+         return false;
+
+   if (m_verbose)
+      std::cout.precision(6);
+
+   // If populations aren't provided, assume only 1 of each sample:
+   if (m_populations == 0)
+   {
+      m_populations = new double [m_numEntries];
+      for (ossim_uint32 i=0; i<m_numEntries; ++i)
+         m_populations[i] = 1.0;
+   }
+
+   // Scan for min and max:
+   double overall_min = OSSIM_DEFAULT_MAX_PIX_DOUBLE;
+   double overall_max = OSSIM_DEFAULT_MIN_PIX_DOUBLE;
+   for (ossim_uint32 i=0; i<m_numEntries; i++)
+   {
+      if (m_populations[i] == 0)
+         continue;
+
+      if (m_samples[i] < overall_min)
+         overall_min = m_samples[i];
+      else if (m_samples[i] > overall_max)
+         overall_max = m_samples[i];
+   }
+
+   double max_delta = overall_max - overall_min;
+   // double convergenceThreshold = 0.1*(max_delta)/m_numEntries;
+   ossim_uint32 numClusters = m_clusters.size();
+   double* variances = new double [numClusters];
+   ossim_uint32* priorCounts = new ossim_uint32 [numClusters];
+   double interm_samples = (overall_max - overall_min) / numClusters;
+   double mean_i = overall_min + interm_samples / 2.0;  // initial mean for cluster 0;
+   double bound = overall_min;
+   for (ossim_uint32 gid=0; gid<numClusters; ++gid)
+   {
+      //Initialize cluster with even spread and initial mean:
+      m_clusters[gid].min = bound;
+      bound += interm_samples;
+      m_clusters[gid].max = bound;
+      m_clusters[gid].mean = mean_i;
+      m_clusters[gid].new_mean = 0;
+      mean_i += interm_samples;
+      m_clusters[gid].n = 0;
+      m_clusters[gid].sigma = 1.0;
+      variances[gid] = 0.0;
+      priorCounts[gid] = 0;
+   }
+   double delta, min_delta;
+   // ossim_uint32 best_gid, np, iters = 0, max_iters = 20;
+   ossim_uint32 best_gid, iters = 0, max_iters = 20;
+   bool converged = false;
+
+   // Loop until converged on best solution:
+   while (!converged && (iters < max_iters))
+   {
+      converged = true; // prove otherwise
+      ++iters;
+
+      for (ossim_uint32 gid=0; gid<numClusters; ++gid)
+      {
+         m_clusters[gid].min = overall_max;
+         m_clusters[gid].max = overall_min;
+      }
+
+      for (ossim_uint32 i=0; i<m_numEntries; i++)
+      {
+         if ( m_populations[i] == 0)
+            continue;
+
+         // Find the current cluster:
+         best_gid = 0;
+         min_delta = OSSIM_DEFAULT_MAX_PIX_DOUBLE;
+         for (ossim_uint32 gid=0; gid<numClusters; ++gid)
+         {
+            delta = fabs((m_samples[i] - m_clusters[gid].mean));
+            if (delta < min_delta)
+            {
+               min_delta = delta;
+               best_gid = gid;
+            }
+         }
+
+         // Possible update of min/max for current cluster:
+         if (m_samples[i] < m_clusters[best_gid].min)
+            m_clusters[best_gid].min = m_samples[i];
+         else if (m_samples[i] > m_clusters[best_gid].max)
+            m_clusters[best_gid].max = m_samples[i];
+
+         // Accumulate sample for the new mean for this cluster:
+         m_clusters[best_gid].new_mean += m_populations[i]*m_samples[i];
+         m_clusters[best_gid].n += m_populations[i];
+
+         // Add this bin's contribution to the cluster stats. Use the sigma member as accumulator,
+         // normalize later:
+         delta = m_clusters[best_gid].mean - m_samples[i];
+         variances[best_gid] += m_populations[i]*delta*delta;
+
+      } // End loop over bins
+
+      // Finished processing all input pixels for this iteration. Update the means:
+      for (ossim_uint32 gid=0; gid<numClusters; ++gid)
+      {
+         // Compute new mean from accumulation:
+         if (m_clusters[gid].n)
+         {
+            m_clusters[gid].new_mean /= m_clusters[gid].n;
+            m_clusters[gid].sigma = sqrt(variances[gid] / m_clusters[gid].n);
+            variances[gid] = 0.0;
+         }
+
+         //if (fabs(m_clusters[gid].mean - m_clusters[gid].new_mean) > convergenceThreshold )
+         if (m_clusters[gid].n != priorCounts[gid])
+            converged = false;
+
+//         if (m_verbose)
+//         {
+//            cout<<"iteration: "<<iters<<endl;
+//            cout<<"cluster["<<gid<<"].mean     = "<<m_clusters[gid].mean<<endl;
+//            cout<<"cluster["<<gid<<"].new_mean = "<<m_clusters[gid].new_mean<<endl;
+//            cout<<"cluster["<<gid<<"].sigma    = "<<m_clusters[gid].sigma<<endl;
+//            cout<<"cluster["<<gid<<"].n        = "<<(int)m_clusters[gid].n<<"  prior: "<<priorCounts[gid]<<endl;
+//            cout<<"cluster["<<gid<<"].min      = "<<m_clusters[gid].min<<endl;
+//            cout<<"cluster["<<gid<<"].max      = "<<m_clusters[gid].max<<endl;
+//            cout << endl;
+//         }
+         if (m_clusters[gid].n)
+            m_clusters[gid].mean = m_clusters[gid].new_mean;
+
+         if (!converged)
+         {
+            priorCounts[gid] = m_clusters[gid].n;
+            m_clusters[gid].n = 0;
+            m_clusters[gid].new_mean = 0;
+         }
+      }
+   } // End overall loop for convergence:
+
+   if (m_verbose)
+   {
+      cout<<"\nossimKMeansClustering Summary ("<<iters<<" iterations):"<<endl;
+      for (ossim_uint32 gid=0; gid<numClusters; gid++)
+      {
+         cout<<"\n  cluster["<<gid<<"] n        = "<<(int)m_clusters[gid].n<<endl;
+         cout<<"             mean     = "<<m_clusters[gid].mean<<endl;
+         cout<<"             sigma    = "<<m_clusters[gid].sigma<<endl;
+         cout<<"             min      = "<<m_clusters[gid].min<<endl;
+         cout<<"             max      = "<<m_clusters[gid].max<<endl;
+      }
+      cout << endl;
+   }
+
+   delete [] variances;
+   delete [] priorCounts;
+   m_clustersValid = true;
+   return true;
+
+}
+
+double ossimKMeansClustering::getMean(ossim_uint32 clusterId) const
+{
+   if (clusterId >= m_clusters.size())
+      return ossim::nan();
+
+   return m_clusters[clusterId].mean;
+}
+
+double ossimKMeansClustering::getSigma(ossim_uint32 clusterId) const
+{
+   if (clusterId >= m_clusters.size())
+      return ossim::nan();
+
+   return m_clusters[clusterId].sigma;
+}
+
+double ossimKMeansClustering::getMinValue(ossim_uint32 clusterId) const
+{
+   if (clusterId >= m_clusters.size())
+      return ossim::nan();
+
+   return m_clusters[clusterId].min;
+}
+
+double ossimKMeansClustering::getMaxValue(ossim_uint32 clusterId) const
+{
+   if (clusterId >= m_clusters.size())
+      return ossim::nan();
+
+   return m_clusters[clusterId].max;
+}
+
+const ossimKMeansClustering::Cluster*
+ossimKMeansClustering::getCluster(ossim_uint32 i) const
+{
+   if (i >= m_clusters.size())
+      return 0;
+   return &(m_clusters[i]);
+}
+
+
diff --git a/ossim/src/ossim/base/ossimKeyword.cpp b/src/base/ossimKeyword.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimKeyword.cpp
rename to src/base/ossimKeyword.cpp
diff --git a/src/base/ossimKeywordNames.cpp b/src/base/ossimKeywordNames.cpp
new file mode 100644
index 0000000..86e9d46
--- /dev/null
+++ b/src/base/ossimKeywordNames.cpp
@@ -0,0 +1,199 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file
+//
+// Author: Ken Melero (kmelero at remotesensing.org)
+// 
+// Description: Common file for global Keywords.
+//
+//*************************************************************************
+// $Id: ossimKeywordNames.cpp 23037 2014-12-11 20:37:51Z okramer $
+
+#include <ossim/base/ossimKeywordNames.h>
+
+const char* ossimKeywordNames::AZIMUTH_ANGLE_KW = "azimuth_angle";
+const char* ossimKeywordNames::BAND_KW = "band";
+const char* ossimKeywordNames::BANDS_KW = "bands";
+const char* ossimKeywordNames::BORDER_SIZE_KW = "border_size";
+const char* ossimKeywordNames::BRUSH_COLOR_KW = "brush_color";
+const char* ossimKeywordNames::BYTE_ORDER_KW = "byte_order";
+const char* ossimKeywordNames::CE90_ABSOLUTE_KW = "ce90_absolute";
+const char* ossimKeywordNames::CE90_RELATIVE_KW = "ce90_relative";
+const char* ossimKeywordNames::CENTRAL_MERIDIAN_KW = "central_meridian";
+const char* ossimKeywordNames::CENTRAL_POINT1_LAT_KW = "central_point1_lat";
+const char* ossimKeywordNames::CENTRAL_POINT1_LON_KW = "central_point1_lon";
+const char* ossimKeywordNames::CENTRAL_POINT2_LAT_KW = "central_point2_lat";
+const char* ossimKeywordNames::CENTRAL_POINT2_LON_KW = "central_point2_lon";
+const char* ossimKeywordNames::CENTER_PIXEL_X_KW = "center_pixel_x";
+const char* ossimKeywordNames::CENTER_PIXEL_Y_KW = "center_pixel_y";
+const char* ossimKeywordNames::COMPRESS_KW = "compress";
+const char* ossimKeywordNames::COMPRESSION_QUALITY_KW = "compression_quality";
+const char* ossimKeywordNames::COMPRESSION_TYPE_KW = "compression_type";
+const char* ossimKeywordNames::CONVERGENCE_THRESHOLD_KW = "convergence_threshold";
+const char* ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW = "create_external_geometry";
+const char* ossimKeywordNames::CREATE_IMAGE_KW = "create_image";
+const char* ossimKeywordNames::CREATE_HISTOGRAM_KW = "create_histogram";
+const char* ossimKeywordNames::CREATE_OVERVIEW_KW = "create_overview";
+const char* ossimKeywordNames::DATA_FILE_KW = "data_file";
+const char* ossimKeywordNames::DATE_KW = "date";
+const char* ossimKeywordNames::DATE_YEAR_KW = "year";
+const char* ossimKeywordNames::DATE_MONTH_KW = "month";
+const char* ossimKeywordNames::DATE_DAY_KW = "day";
+const char* ossimKeywordNames::DATE_HOUR_KW = "hour";
+const char* ossimKeywordNames::DATE_MIN_KW = "min";
+const char* ossimKeywordNames::DATE_SEC_KW = "sec";
+const char* ossimKeywordNames::DATE_FRACT_SEC_KW = "fract_sec";
+const char* ossimKeywordNames::DATUM_KW = "datum";
+const char* ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT = "decimal_degrees_per_pixel_lat";
+const char* ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON = "decimal_degrees_per_pixel_lon";
+const char* ossimKeywordNames::DESCRIPTION_KW = "description";
+const char* ossimKeywordNames::ELEVATION_ANGLE_KW = "elevation_angle";
+const char* ossimKeywordNames::ELEVATION_CELL_KW = "elevation_cell";
+const char* ossimKeywordNames::ELEVATION_SOURCE_KW = "elevation_source";
+const char* ossimKeywordNames::ELEVATION_LOOKUP_FLAG_KW = "elevation_lookup_flag";
+const char* ossimKeywordNames::ELLIPSE_CODE_KW = "ellipse_code";
+const char* ossimKeywordNames::ELLIPSE_EPSG_CODE_KW = "ellipse_epsg_code";
+const char* ossimKeywordNames::ELLIPSE_NAME_KW = "ellipse_name";
+const char* ossimKeywordNames::ENABLED_KW = "enabled";
+const char* ossimKeywordNames::ENABLE_CACHE_KW = "enable_cache";
+const char* ossimKeywordNames::EXTRACT_VERTICES_KW = "extract_vertices";  
+const char* ossimKeywordNames::ENTRY_KW = "entry";
+const char* ossimKeywordNames::FALSE_EASTING_NORTHING_KW = "false_easting_northing";
+const char* ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW = "false_easting_northing_units";
+const char* ossimKeywordNames::FALSE_EASTING_KW = "false_easting";
+const char* ossimKeywordNames::FALSE_NORTHING_KW = "false_northing";
+const char* ossimKeywordNames::FEATURE_NAME_KW = "feature_name";
+const char* ossimKeywordNames::FILE_KW = "file";
+const char* ossimKeywordNames::FILENAME_KW = "filename";
+const char* ossimKeywordNames::FILEPATH_KW = "filepath";
+const char* ossimKeywordNames::FILL_FLAG_KW = "fill_flag";
+const char* ossimKeywordNames::FRAME_INDEX_KW = "frame_index";
+const char* ossimKeywordNames::GCS_CODE_KW = "gcs_code";
+const char* ossimKeywordNames::GEOM_FILE_KW = "geom_file";
+const char* ossimKeywordNames::HEMISPHERE_KW = "hemisphere";
+const char* ossimKeywordNames::HORIZONTAL_SIZE_KW = "horizontal_size";
+const char* ossimKeywordNames::ID_KW ="id";
+const char* ossimKeywordNames::IMAGE_CE90_KW  = "estimated_image_ce90";
+const char* ossimKeywordNames::IMAGE_FILE_KW = "image_file";
+const char* ossimKeywordNames::IMAGE_ID_KW = "image_id";
+const char* ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW = "image_model_transform_matrix";
+const char* ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW = "image_model_transform_unit";
+const char* ossimKeywordNames::IMAGE_PATH_KW = "image_path";
+const char* ossimKeywordNames::IMAGE_TYPE_KW = "image_type";
+const char* ossimKeywordNames::IMAGE_DATE_KW = "image_date";
+const char* ossimKeywordNames::IMAGE_FILE_SIZE_KW = "image_file_size";
+const char* ossimKeywordNames::INPUT_RR_LEVEL_KW = "input_rr_level";
+const char* ossimKeywordNames::INTERLEAVE_TYPE_KW = "interleave_type";
+const char* ossimKeywordNames::JULIAN_DAY_KW = "julian_day";
+const char* ossimKeywordNames::LAT_INCREMENT_KW = "lat_increment";
+const char* ossimKeywordNames::LL_LAT_KW = "ll_lat";
+const char* ossimKeywordNames::LL_LON_KW = "ll_lon";
+const char* ossimKeywordNames::LR_LAT_KW = "lr_lat";
+const char* ossimKeywordNames::LR_LON_KW = "lr_lon";
+const char* ossimKeywordNames::LL_X_KW = "ll_x";
+const char* ossimKeywordNames::LL_Y_KW = "ll_y";
+const char* ossimKeywordNames::LR_X_KW = "lr_x";
+const char* ossimKeywordNames::LR_Y_KW = "lr_y";
+const char* ossimKeywordNames::LON_INCREMENT_KW = "lon_increment";
+const char* ossimKeywordNames::MAJOR_AXIS_KW = "major_axis";
+const char* ossimKeywordNames::MAX_VALUE_KW = "max_value";
+const char* ossimKeywordNames::MAX_ITERATIONS_KW = "max_iterations";
+const char* ossimKeywordNames::MAX_QUADTREE_LEVELS_KW = "max_quadtree_levels";
+const char* ossimKeywordNames::METADATA_TYPE_KW = "metadata_type";
+const char* ossimKeywordNames::METERS_PER_PIXEL_KW = "meters_per_pixel";
+const char* ossimKeywordNames::METERS_PER_PIXEL_X_KW = "meters_per_pixel_x";
+const char* ossimKeywordNames::METERS_PER_PIXEL_Y_KW = "meters_per_pixel_y";
+const char* ossimKeywordNames::MINOR_AXIS_KW = "minor_axis";
+const char* ossimKeywordNames::MIN_VALUE_KW = "min_value";
+const char* ossimKeywordNames::NULL_VALUE_KW = "null_value";
+const char* ossimKeywordNames::NUMBER_BANDS_KW = "number_bands";
+const char* ossimKeywordNames::NUMBER_ENTRIES_KW = "number_entries";
+const char* ossimKeywordNames::NUMBER_INPUT_BANDS_KW = "number_input_bands";
+const char* ossimKeywordNames::NUMBER_INPUTS_KW = "number_inputs";
+const char* ossimKeywordNames::NUMBER_OUTPUTS_KW = "number_outputs";
+const char* ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW = "number_output_bands";
+const char* ossimKeywordNames::NUMBER_LINES_KW = "number_lines";
+const char* ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW = "number_reduced_res_sets";
+const char* ossimKeywordNames::NUMBER_SAMPLES_KW = "number_samples";
+const char* ossimKeywordNames::ORIGIN_X_KW = "origin_x";
+const char* ossimKeywordNames::ORIGIN_Y_KW = "origin_y";
+const char* ossimKeywordNames::ORIGIN_LATITUDE_KW = "origin_latitude";
+const char* ossimKeywordNames::ORIGINAL_MAP_UNITS_KW = "original_map_units";
+const char* ossimKeywordNames::OUTPUT_FILE_KW = "output_file";
+const char* ossimKeywordNames::OUTPUT_FILE_PREFIX_KW = "output_file_prefix";
+const char* ossimKeywordNames::OUTPUT_FILE_EXTENSION_KW = "output_file_extension";
+const char* ossimKeywordNames::OUTPUT_TILE_SIZE_KW = "output_tile_size";
+const char* ossimKeywordNames::OVERVIEW_COMPRESSION_QUALITY_KW = "overview_compression_quality";
+const char* ossimKeywordNames::OVERVIEW_COMPRESSION_TYPE_KW = "overview_compression_type";
+const char* ossimKeywordNames::OVERVIEW_FILE_KW  = "overview_file";
+const char* ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW = "overview_stop_dimension";
+const char* ossimKeywordNames::PCS_CODE_KW = "pcs_code";
+const char* ossimKeywordNames::PEN_COLOR_KW = "pen_color";
+const char* ossimKeywordNames::PHOTOMETRIC_KW    = "photometric";
+const char* ossimKeywordNames::PIXEL_SCALE_XY_KW = "pixel_scale_xy";
+const char* ossimKeywordNames::PIXEL_SCALE_UNITS_KW = "pixel_scale_units";
+const char* ossimKeywordNames::PIXEL_TYPE_KW  = "pixel_type";
+const char* ossimKeywordNames::PLANAR_CONFIG_KW  = "planar_config";
+const char* ossimKeywordNames::POINT_WIDTH_HEIGHT_KW = "point_width_height";
+const char* ossimKeywordNames::PROJECTION_KW     = "projection";
+const char* ossimKeywordNames::QUALITY_KW        = "quality";
+const char* ossimKeywordNames::QUERY_KW = "query";
+const char* ossimKeywordNames::RADIOMETRY_KW = "radiometry";
+const char* ossimKeywordNames::REDUCED_RES_LEVEL_KW = "reduced_res_level";
+const char* ossimKeywordNames::REF_GPT_LAT_KW  = "ref_point_lat";
+const char* ossimKeywordNames::REF_GPT_LON_KW  = "ref_point_lon";
+const char* ossimKeywordNames::REF_GPT_HGT_KW  = "ref_point_hgt";
+const char* ossimKeywordNames::REF_IPT_LINE_KW = "ref_point_line";
+const char* ossimKeywordNames::REF_IPT_SAMP_KW = "ref_point_samp";
+const char* ossimKeywordNames::ROTATION_KW = "rotation";
+const char* ossimKeywordNames::SCALE_PER_PIXEL_X_KW = "scale_per_pixel_x";
+const char* ossimKeywordNames::SCALE_PER_PIXEL_Y_KW = "scale_per_pixel_y";
+const char* ossimKeywordNames::SCALAR_TYPE_KW    = "scalar_type";
+const char* ossimKeywordNames::SCALE_FACTOR_KW   = "scale_factor";
+const char* ossimKeywordNames::SCALE_FACTOR_X_KW = "scale_factor_x";
+const char* ossimKeywordNames::SCALE_FACTOR_Y_KW = "scale_factor_y";
+const char* ossimKeywordNames::SCALE_X_KW = "scale_x";
+const char* ossimKeywordNames::SCALE_Y_KW = "scale_y";
+const char* ossimKeywordNames::SENSOR_ID_KW = "sensor";
+const char* ossimKeywordNames::SRS_NAME_KW = "srs_name";
+const char* ossimKeywordNames::STD_PARALLEL_1_KW = "std_parallel_1";
+const char* ossimKeywordNames::STD_PARALLEL_2_KW = "std_parallel_2";
+const char* ossimKeywordNames::THICKNESS_KW = "thickness";
+const char* ossimKeywordNames::THREADS_KW = "threads";
+const char* ossimKeywordNames::TIE_POINT_EASTING_KW = "tie_point_easting";  // ????
+const char* ossimKeywordNames::TIE_POINT_NORTHING_KW = "tie_point_northing";  // ????
+const char* ossimKeywordNames::TIE_POINT_XY_KW = "tie_point_xy";  // ????
+const char* ossimKeywordNames::TIE_POINT_UNITS_KW = "tie_point_units";
+const char* ossimKeywordNames::TIE_POINT_LAT_KW = "tie_point_lat";
+const char* ossimKeywordNames::TIE_POINT_LON_KW = "tie_point_lon";
+const char* ossimKeywordNames::TILE_SIZE_X_KW = "tile_size_x";
+const char* ossimKeywordNames::TILE_SIZE_Y_KW = "tile_size_y";
+const char* ossimKeywordNames::TILE_SOURCE_KW = "tile_source";
+const char* ossimKeywordNames::TILE_TYPE_KW = "tile_type";
+const char* ossimKeywordNames::TRANSLATION_X_KW = "translation_x";
+const char* ossimKeywordNames::TRANSLATION_Y_KW = "translation_y";
+const char* ossimKeywordNames::TYPE_KW = "type";
+const char* ossimKeywordNames::UL_LAT_KW = "ul_lat";
+const char* ossimKeywordNames::UL_LON_KW = "ul_lon";
+const char* ossimKeywordNames::UNITS_KW = "units";
+const char* ossimKeywordNames::UR_LAT_KW = "ur_lat";
+const char* ossimKeywordNames::UR_LON_KW = "ur_lon";
+const char* ossimKeywordNames::UL_X_KW = "ul_x";
+const char* ossimKeywordNames::UL_Y_KW = "ul_y";
+const char* ossimKeywordNames::UR_X_KW = "ur_x";
+const char* ossimKeywordNames::UR_Y_KW = "ur_y";
+const char* ossimKeywordNames::VALID_VERTICES_KW = "valid_vertices_file";
+const char* ossimKeywordNames::VERTICAL_SIZE_KW = "vertical_size";
+const char* ossimKeywordNames::ZONE_KW = "zone";
+
+ossimKeywordNames::ossimKeywordNames()
+{}
+
+ossimKeywordNames::ossimKeywordNames(const ossimKeywordNames& /* rhs */)
+{}
+
+const ossimKeywordNames& ossimKeywordNames::operator=(const ossimKeywordNames& /* rhs */)
+{
+   return *this;
+}
diff --git a/src/base/ossimKeywordlist.cpp b/src/base/ossimKeywordlist.cpp
new file mode 100755
index 0000000..43bc6ae
--- /dev/null
+++ b/src/base/ossimKeywordlist.cpp
@@ -0,0 +1,1440 @@
+//---
+//
+// License: MIT
+//
+// Description: This class provides capabilities for keywordlists.
+//
+//---
+// $Id$
+
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIoStream.h>
+
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimTrace.h>
+
+#include <algorithm>
+#include <fstream>
+#include <list>
+#include <sstream>
+#include <utility>
+
+static ossimTrace traceDebug("ossimKeywordlist:debug");
+
+#ifdef OSSIM_ID_ENABLED
+static const bool TRACE = false;
+static const char OSSIM_ID[] = "$Id: ossimKeywordlist.cpp 23632 2015-11-19 20:43:06Z dburken $";
+#endif
+
+const std::string ossimKeywordlist::NULL_KW = "";
+
+ossimKeywordlist::ossimKeywordlist(const ossimKeywordlist& src)
+:m_map(src.m_map),
+m_delimiter(src.m_delimiter),
+m_preserveKeyValues(src.m_preserveKeyValues),
+m_expandEnvVars(src.m_expandEnvVars)
+{
+}
+
+ossimKeywordlist::ossimKeywordlist(const std::map<std::string, std::string>& keywordMap)
+:m_map(keywordMap),
+m_delimiter(DEFAULT_DELIMITER),
+m_preserveKeyValues(true),
+m_expandEnvVars(true)
+{
+
+}
+
+ossimKeywordlist::ossimKeywordlist(char delimiter, 
+                                   bool expandEnvVars)
+:
+m_map(),
+m_delimiter(delimiter),
+m_preserveKeyValues(true),
+m_expandEnvVars(expandEnvVars)
+{
+#ifdef OSSIM_ID_ENABLED
+   if (TRACE) ossimNotify(ossimNotifyLevel_DEBUG) << OSSIM_ID << std::endl;
+#endif
+}
+
+ossimKeywordlist::ossimKeywordlist(const char* file,
+                                   char        delimiter,
+                                   bool        ignoreBinaryChars,
+                                   bool        expandEnvVars)
+:
+m_map(),
+m_delimiter(delimiter),
+m_preserveKeyValues(true),
+//m_lineContinuationCharacter('\\'),
+m_expandEnvVars(expandEnvVars)
+{
+   ossimFilename in_file(file);
+   
+   if (!parseFile(in_file, ignoreBinaryChars))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+   }
+}
+
+ossimKeywordlist::ossimKeywordlist(const ossimFilename& file,
+                                   char                 delimiter,
+                                   bool                 ignoreBinaryChars,
+                                   bool                 expandEnvVars)
+:
+m_map(),
+m_delimiter(delimiter),
+m_preserveKeyValues(true),
+m_expandEnvVars(expandEnvVars)
+
+{
+   if (!parseFile(file, ignoreBinaryChars))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+   }
+}
+
+ossimKeywordlist::~ossimKeywordlist()
+{
+   m_map.clear();
+}
+
+void ossimKeywordlist::setExpandEnvVarsFlag( bool flag )
+{
+   m_expandEnvVars = flag;
+}
+
+bool ossimKeywordlist::getExpandEnvVarsFlag( void ) const
+{
+   return m_expandEnvVars;
+}
+
+bool ossimKeywordlist::addFile(const char* file)
+{
+   ossimFilename in_file(file);
+   
+   return parseFile(in_file);
+}
+
+bool ossimKeywordlist::addFile(const ossimFilename& file)
+{
+   return parseFile(file);
+}
+
+void ossimKeywordlist::addList(const ossimKeywordlist &src, bool overwrite)
+{
+   KeywordMap::const_iterator i = src.m_map.begin();
+   
+   while (i != src.m_map.end())
+   {
+      addPair( (*i).first, (*i).second, overwrite );
+      i++;
+   }
+}
+
+void ossimKeywordlist::add(const ossimKeywordlist& kwl,
+                           const char* prefix,
+                           bool stripPrefix)
+{
+   std::map<std::string, std::string>::const_iterator iter = kwl.m_map.begin();
+   
+   ossimRegExp regExp;
+   
+   // Check for null prefix.
+   std::string tmpPrefix;
+   if (prefix) tmpPrefix = prefix;
+   
+   regExp.compile(("^("+tmpPrefix+")").c_str());
+   
+   while(iter != kwl.m_map.end())
+   {
+      ossimString newKey;
+      
+      if(regExp.find( (*iter).first.c_str()))
+      {
+         newKey = (*iter).first;
+         if(stripPrefix && prefix)
+         {
+            newKey = newKey.substitute(prefix, "");
+            
+         }
+         
+         addPair(newKey.string(), (*iter).second, true);
+      }
+      ++iter;
+   }
+}
+
+void ossimKeywordlist::add(const char* prefix,
+                           const ossimKeywordlist& kwl,
+                           bool overwrite)
+{
+   std::string p = prefix ? prefix : "";
+   std::map<std::string, std::string>::const_iterator iter = kwl.m_map.begin();
+   while(iter != kwl.m_map.end())
+   {
+      std::string k( p + (*iter).first );
+      addPair( k, (*iter).second, overwrite );
+      ++iter;
+   }
+}
+
+void ossimKeywordlist::addPair(const std::string& key,
+                               const std::string& value,
+                               bool               overwrite)
+{
+   if ( key.size() )
+   {
+      ossimString v = value;
+      if ( m_expandEnvVars == true )
+      {
+         v = v.expandEnvironmentVariable();
+      }
+      
+      KeywordMap::iterator i = getMapEntry(key);
+      
+      if (i == m_map.end())
+      {
+         m_map.insert(std::make_pair(key, v.string()));
+      }
+      else if (overwrite)
+      {
+         (*i).second = v.string();
+      }
+   }
+}
+
+void ossimKeywordlist::addPair(const std::string& prefix,
+                               const std::string& key,
+                               const std::string& value,
+                               bool               overwrite)
+{
+   std::string k(prefix + key);
+   addPair(k, value, overwrite);
+}
+
+void ossimKeywordlist::add(const char* key,
+                           const char* value,
+                           bool        overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v(value?value:"");
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* prefix,
+                           const char* key,
+                           const char* value,
+                           bool        overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v(value ? value : "");
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           char        value,
+                           bool        overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v(1, value);
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* prefix,
+                           const char* key,
+                           char        value,
+                           bool        overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v(1, value);
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_int16 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* prefix,
+                           const char* key,
+                           ossim_int16 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_uint16 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* prefix,
+                           const char* key,
+                           ossim_uint16 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_int32 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char*  prefix,
+                           const char*  key,
+                           ossim_int32 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_uint32 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char*  prefix,
+                           const char*  key,
+                           ossim_uint32 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_int64 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char*  prefix,
+                           const char*  key,
+                           ossim_int64 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_uint64 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char*  prefix,
+                           const char*  key,
+                           ossim_uint64 value,
+                           bool overwrite)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_float32 value,
+                           bool overwrite,
+                           int precision)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* prefix,
+                           const char* key,
+                           ossim_float32 value,
+                           bool overwrite,
+                           int precision)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* key,
+                           ossim_float64 value,
+                           bool overwrite,
+                           int precision)
+{
+   if ( key )
+   {
+      std::string k(key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+void ossimKeywordlist::add(const char* prefix,
+                           const char* key,
+                           ossim_float64 value,
+                           bool overwrite,
+                           int precision)
+{
+   if ( key )
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      std::string v = ossimString::toString(value, precision).string();
+      addPair(k, v, overwrite);
+   }
+}
+
+bool ossimKeywordlist::write(const char* file, 
+                             const char* comment) const
+{
+   std::ofstream filename(file);
+   if (!filename)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+      <<"ossimKeywordlist::write, Error opening file:  "
+      << file << std::endl;
+      return false;
+   }
+   
+   if ( comment != 0 )
+   {
+      ossimString commentStr("// ");
+      commentStr += comment;
+      
+      // Write out the input comment to the first line.
+      filename << commentStr.c_str() << std::endl;
+   }
+   
+   writeToStream(filename);
+   
+   filename.close();
+   
+   return true;
+}
+
+ossimString ossimKeywordlist::toString()const
+{
+   std::ostringstream out;
+   writeToStream(out);
+   
+#if 0
+   KeywordMap::const_iterator i;
+   ossimString result;
+   
+   for(i = m_map.begin(); i != m_map.end(); i++)
+   {
+      result += (*i).first;
+      result += delimiter_str().c_str();
+      result += " ";
+      result += (*i).second;
+      result += '\n';
+   }
+#endif
+   return ossimString(out.str());
+}
+
+void ossimKeywordlist::toString(ossimString& result)const
+{
+   std::ostringstream out;
+   writeToStream(out);
+   
+   result = out.str();
+#if 0
+   KeywordMap::const_iterator i;
+   
+   for(i = m_map.begin(); i != m_map.end(); i++)
+   {
+      result += (*i).first;
+      result += delimiter_str().c_str();
+      result += " ";
+      result += (*i).second;
+      result += '\n';
+   }
+#endif
+}
+
+void ossimKeywordlist::writeToStream(std::ostream& out) const
+{
+   KeywordMap::const_iterator i;
+   ossimString value;
+   ossimRegExp reg("\n|\r| $|^ ");
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      value = (*i).second;
+      if(!value.empty())
+      {
+         if(reg.find(value))
+         {
+            value = "\"\"\"" + value + "\"\"\"";
+         }
+      }
+      //      value = value.substitute('\n', "\\\n", true);
+      out << (*i).first  << delimiter_str().c_str() << "  "
+      << value << std::endl;
+   }
+}
+
+bool ossimKeywordlist::hasKey( const std::string& key ) const
+{
+   bool result = false;
+   KeywordMap::const_iterator i = m_map.find(key);
+   if (i != m_map.end())
+   {
+      result = true;
+   }
+   return result;
+}
+
+const std::string& ossimKeywordlist::findKey(const std::string& key) const
+{
+   // std::string result;
+   KeywordMap::const_iterator i = m_map.find(key);
+   if (i != m_map.end())
+   {
+      // result = (*i).second;
+      return (*i).second;
+   }
+   return ossimKeywordlist::NULL_KW;
+}
+
+const std::string& ossimKeywordlist::findKey(const std::string& prefix,
+                                             const std::string& key) const
+{
+   std::string k = prefix+key;
+   return findKey(k);
+}
+
+const char* ossimKeywordlist::find(const char* key) const
+{
+   const char* result = 0;
+   if (key)
+   {
+      std::string k = key;
+      KeywordMap::const_iterator i = m_map.find( k );
+      if (i != m_map.end())
+      {
+         result = (*i).second.c_str();
+      }
+   }
+   return result;
+}
+
+const char* ossimKeywordlist::find(const char* prefix,
+                                   const char* key) const
+{
+   const char* result = 0;
+   if (key)
+   {
+      std::string k;
+      if (prefix) k = prefix;
+      k += key;
+      KeywordMap::const_iterator i = m_map.find( k );
+      if (i != m_map.end())
+      {
+         result = (*i).second.c_str();
+      }
+   }
+   return result;
+}
+
+void ossimKeywordlist::remove(const char * key)
+{
+   ossimString k = key?key:"";
+   
+   KeywordMap::iterator i = m_map.find(k);
+   
+   if(i != m_map.end())
+   {
+      m_map.erase(i);
+   }
+}
+
+void ossimKeywordlist::remove(const char* prefix, const char * key)
+{
+   if (key)
+   {
+      ossimString k;
+      if (prefix) k = prefix;
+      k += key;
+      
+      KeywordMap::iterator i = m_map.find(k);
+      
+      if(i != m_map.end())
+      {
+         m_map.erase(i);
+      }
+   }
+}
+
+ossim_uint32 ossimKeywordlist::numberOf(const char* str) const
+{
+   ossim_uint32 count = 0;
+   
+   if (str)
+   {
+      KeywordMap::const_iterator i = m_map.begin();
+      
+      while (i != m_map.end())
+      {
+         if ( ossimString((*i).first).contains(str) )
+         {
+            ++count;
+         }
+         ++i;
+      }
+   }
+   
+   return count;
+}
+
+ossim_uint32 ossimKeywordlist::numberOf(const char* prefix,
+                                        const char* key) const
+{
+   if ( key ) // Must have key, sometimes no prefix.
+   {
+      std::string k(prefix ? (std::string(prefix)+std::string(key)) : key);
+      return numberOf(k.c_str());
+   }
+   return 0;
+}
+
+void ossimKeywordlist::clear()
+{
+   m_map.clear();
+}
+
+ossimKeywordlist::KeywordMap::iterator
+ossimKeywordlist::getMapEntry(const char* key)
+{
+   if (key)
+   {
+      std::string k = key;
+      return m_map.find(k);
+   }
+   else
+   {
+      return m_map.end();
+   }
+}
+
+ossimKeywordlist::KeywordMap::iterator
+ossimKeywordlist::getMapEntry(const std::string& key)
+{
+   return m_map.find(key);
+}
+
+ossimKeywordlist::KeywordMap::iterator
+ossimKeywordlist::getMapEntry(const ossimString& key)
+{
+   return m_map.find(key.string());
+}
+
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimKeywordlist::parseFile(const ossimFilename& file,
+                                 bool ignoreBinaryChars)
+{
+   if(!file.exists())
+      return false;
+
+   bool result = false;
+   std::ifstream is;
+   is.open(file.c_str(), std::ios::in | std::ios::binary);
+
+   if(!is.fail())
+   {
+      m_currentlyParsing = file;
+      result = parseStream(is, ignoreBinaryChars);
+   }
+
+   is.close();
+   return result;
+}
+
+bool ossimKeywordlist::parseStream(ossim::istream& is, bool /* ignoreBinaryChars */)
+{
+   return parseStream(is);
+}
+
+bool ossimKeywordlist::parseString(const std::string& inString)
+{
+   ossim::istringstream in(inString);
+   
+   return parseStream(in);
+}
+
+bool ossimKeywordlist::isValidKeywordlistCharacter(ossim_uint8 c)const
+{
+   if((c>=0x20&&c<=0x7e))
+   {
+      return true;
+   }
+   switch(c)
+   {
+      case '\n':
+      case '\r':
+      case '\t':
+         return true;
+   }
+   return false;
+}
+
+void ossimKeywordlist::skipWhitespace(ossim::istream& in)const
+{
+   int c = in.peek();
+   while( !in.fail() &&
+         ( (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') ) )
+   {
+      in.ignore(1);
+      c = in.peek();
+   }
+}
+
+ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readComments(ossimString& sequence, ossim::istream& in)const
+{
+   KeywordlistParseState result = KeywordlistParseState_FAIL;
+   char c = (char)in.peek();
+   if(c == '/')
+   {
+      sequence += (char)in.get();
+      c = in.peek();
+      if(c == '/')
+      {
+         result = KeywordlistParseState_OK;
+         sequence += c;
+         while(!in.bad()&&!in.eof())
+         {
+            c = (char)in.get();
+            if (in.bad() || in.eof())
+               break;
+
+            if(!isValidKeywordlistCharacter(c))
+            {
+               result = KeywordlistParseState_BAD_STREAM;
+               break;
+            }
+            if((c == '\n')|| (c == '\r'))
+               break;
+
+            sequence += c;
+         }
+      }
+   }
+   return result;
+}
+
+ossimKeywordlist::KeywordlistParseState
+ossimKeywordlist::readPreprocDirective(ossim::istream& in)
+{
+   KeywordlistParseState status = KeywordlistParseState_FAIL;
+
+   char c = (char)in.peek();
+   while (c == '#')
+   {
+      // Read the line as one big value:
+      ossimString sequence;
+      status = readValue(sequence, in);
+      if (status)
+         break;
+
+      ossimString directive = sequence.before(" ");
+
+      // Check for external KWL include file:
+      if (directive == "#include")
+      {
+         ossimFilename includeFile = sequence.after(" ");
+         if (includeFile.empty())
+            break; // ignore bogus preproc line
+         includeFile.trim("\"");
+         includeFile.expandEnvironmentVariable();
+
+         // The filename can be either relative to the current file being parsed or absolute:
+         if (includeFile.string()[0] != '/')
+            includeFile = m_currentlyParsing.path() + "/" + includeFile;
+
+         // Save the current path in case the new one contains it's own include directive!
+         ossimFilename savedCurrentPath = m_currentlyParsing;
+         addFile(includeFile); // Quietly ignore any errors loading external KWL.
+         m_currentlyParsing = savedCurrentPath;
+      }
+
+//      else if (directive == "#add_new_directive_here")
+//      {
+//         process directive
+//      }
+
+      status = KeywordlistParseState_OK;
+      break;
+   }
+   return status;
+}
+
+ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readKey(ossimString& sequence, ossim::istream& in)const
+{
+   KeywordlistParseState result = KeywordlistParseState_FAIL;
+   if(!sequence.empty())
+   {
+      if(*(sequence.begin()+(sequence.size()-1)) == m_delimiter)
+      {
+         sequence = ossimString(sequence.begin(), sequence.begin() + (sequence.size()-1));
+         return KeywordlistParseState_OK;
+      }
+   }
+   // not a comment so read til key delimeter
+   while(!in.eof() && in.good())
+   {
+      ossim_uint8 c = in.get();
+      if( isValidKeywordlistCharacter(c) )
+      {
+         if ( (c == '\n') || (c == '\r') ) 
+         {
+            // Hit end of line with no delimiter.
+            if ( in.peek() == EOF )
+            {
+               //---
+               // Allowing on last line only.
+               // Note the empty key will trigger parseStream to return true.
+               //---
+               sequence.clear();
+               result = KeywordlistParseState_OK;
+               break;
+            }
+            else // Line with no delimiter.
+            {
+               // mal formed input stream for keyword list specification
+               result = KeywordlistParseState_BAD_STREAM;
+               break;
+            }
+         }
+         else if(c != m_delimiter)
+         {
+            sequence += (char)c;
+         }
+         else // at m_delimiter
+         {
+            result = KeywordlistParseState_OK;
+            sequence = sequence.trim();
+            break;
+         }
+      }
+      else 
+      {
+         // mal formed input stream for keyword list specification
+         result = KeywordlistParseState_BAD_STREAM;
+         break;
+      }
+   }
+   // we never found a delimeter so we are mal formed
+   if(!sequence.empty()&&(result!=KeywordlistParseState_OK))
+   {
+      result = KeywordlistParseState_BAD_STREAM;
+   }
+   return result;
+}
+
+ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readValue(ossimString& sequence, ossim::istream& in)const
+{
+   KeywordlistParseState result = KeywordlistParseState_OK;
+   
+   ossim_int32 quoteCount = 0; // mark as not set
+   
+   // make sure we check for a blank value
+   while(!in.eof()&&!in.bad())
+   {
+      if(in.peek() == ' '||
+         in.peek() == '\t')
+      {
+         in.ignore();
+      }
+      else if(in.peek() == '\n' ||
+              in.peek() == '\r')
+      {
+         in.ignore();
+         return result;
+      }
+      else 
+      {
+         break;
+      }
+   }
+   // The ifstream object will end in '�' (character 255 or -1) if the end-of-file indicator 
+   // will not be set(e.g \n). In this case, end-of-file conditions would never be detected. 
+   // add EOF (which is actually the integer -1 or 255) check here.
+   // Reference link http://www.cplusplus.com/forum/general/33821/
+   while(!in.eof()&&!in.bad()&&in.peek()!=EOF)
+   {
+      ossim_uint8 c = in.get();
+      if(isValidKeywordlistCharacter(c))
+      {
+         if(((c == '\n'||c=='\r') && !quoteCount) || in.eof())
+         {
+            break;
+         }
+         sequence += (char)c;
+         if(sequence.size() >2)
+         {
+            if(quoteCount < 1)
+            {
+               //---
+               // If string has leading tripple quoted bump the "quoteCount" so
+               // we start skipping line breaks, preserving paragraph style strings.
+               //---
+               if(ossimString(sequence.begin(), sequence.begin()+3) == "\"\"\"")
+               {
+                  ++quoteCount;
+               }
+            }
+            else // check for ending quotes 
+            {
+               if(ossimString(sequence.begin() + sequence.size()-3, sequence.end()) == "\"\"\"")
+               {
+                  ++quoteCount;
+               }
+            }
+         }
+         if(quoteCount > 1)
+         {
+            //---
+            // Have leading and trailing tripple quotes. Some tiff writers, e.g. Space
+            // Imaging are using four quotes.  Below code strips all quotes from each end.
+            //---
+            char quote = '"';
+            std::string::size_type startPos = sequence.string().find_first_not_of(quote);
+            std::string::size_type stopPos  = sequence.string().find_last_not_of(quote);
+            if ( ( startPos != std::string::npos ) && (stopPos != std::string::npos) )
+            {
+               sequence = sequence.string().substr( startPos, stopPos-startPos+1 );
+            }
+            break;
+         }
+      }
+      else 
+      {
+         result = KeywordlistParseState_BAD_STREAM;
+         break;
+      }
+   }
+   return result;
+}
+
+ossimKeywordlist::KeywordlistParseState ossimKeywordlist::readKeyAndValuePair(ossimString& key, ossimString& value, ossim::istream& in)const
+{
+   ossimKeywordlist::KeywordlistParseState keyState   = readKey(key, in);
+   if(keyState & KeywordlistParseState_BAD_STREAM) return keyState;
+   ossimKeywordlist::KeywordlistParseState valueState = readValue(value, in);
+   return static_cast<ossimKeywordlist::KeywordlistParseState>( (static_cast<int>(keyState) |
+                                                                 static_cast<int>(valueState)) );
+}
+
+bool ossimKeywordlist::parseStream(ossim::istream& is)
+{
+   if (!is) // Check stream state.
+   {
+      return false;
+   }
+   ossimString key;
+   ossimString value;
+   ossimString sequence;
+   KeywordlistParseState state = KeywordlistParseState_OK;
+   while(!is.eof() && !is.bad())
+   {
+      skipWhitespace(is);
+      if(is.eof() || is.bad())
+         return true; // we skipped to end so valid keyword list
+
+      state = readPreprocDirective(is);
+      if(state & KeywordlistParseState_BAD_STREAM)
+         return false;
+
+      // if we failed a preprocessor directive parse then try comment parse.
+      if(state == KeywordlistParseState_FAIL)
+      {
+         state = readComments(sequence, is);
+         if(state & KeywordlistParseState_BAD_STREAM)
+            return false;
+      }
+
+      // if we failed a comment parse then try key value parse.
+      if(state == KeywordlistParseState_FAIL)
+      {
+         key = sequence; // just in case there is a 1 token look ahead residual for a single slash test.
+         ossimKeywordlist::KeywordlistParseState testKeyValueState = readKeyAndValuePair(key, value, is);
+         if(testKeyValueState == KeywordlistParseState_OK)
+         {
+            key = key.trim();
+            if(key.empty())
+               return true;
+
+            if ( m_expandEnvVars == true )
+               value = value.expandEnvironmentVariable();
+            m_map.insert(std::make_pair(key.string(), value.string()));
+         }
+         else if(testKeyValueState & KeywordlistParseState_BAD_STREAM)
+         {
+            return false;
+         }
+#if 0
+         // Commented out to allow an invalid line in keyword list without
+         // erroring out, effectively skipping bad line. drb - 01 Sep. 2001
+         else
+         {
+            return false;
+         }
+#endif
+      }
+      else if(state & KeywordlistParseState_BAD_STREAM)
+      {
+         return false;
+      }
+      sequence = key = value = "";
+   }   
+   
+   return true;
+}
+
+std::vector<ossimString> ossimKeywordlist::findAllKeysThatContains(const ossimString &searchString)const
+{
+   KeywordMap::const_iterator i;
+   std::vector<ossimString> result;
+   
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      if( ossimString((*i).first).contains(searchString))
+      {
+         result.push_back((*i).first);
+      }
+   }
+   
+   return result;
+}
+
+void ossimKeywordlist::findAllKeysThatMatch( std::vector<ossimString>& result,
+                                             const ossimString &regularExpression ) const
+{
+   KeywordMap::const_iterator i;
+   ossimRegExp regExp;
+   regExp.compile(regularExpression.c_str());
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      if(regExp.find( (*i).first.c_str()))
+      {
+         result.push_back((*i).first);
+      }
+   }
+}
+
+ossim_uint32  ossimKeywordlist::getNumberOfKeysThatMatch(
+   const ossimString &regularExpression ) const
+{
+   ossim_uint32 result = 0;
+   KeywordMap::const_iterator i;
+   ossimRegExp regExp;
+   regExp.compile(regularExpression.c_str());
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      if(regExp.find( (*i).first.c_str()))
+      {
+         ++result;
+      }
+   }
+   return result;
+}
+
+void ossimKeywordlist::extractKeysThatMatch(ossimKeywordlist& kwl,
+                                            const ossimString &regularExpression)const
+{
+   KeywordMap::const_iterator i;
+   std::vector<ossimString> result;
+   ossimRegExp regExp;
+   
+   regExp.compile(regularExpression.c_str());
+   
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      if(regExp.find( (*i).first.c_str()))
+      {
+         kwl.addPair((*i).first, (*i).second);
+      }
+   }
+}
+
+void ossimKeywordlist::removeKeysThatMatch(const ossimString &regularExpression)
+{
+   KeywordMap::const_iterator i;
+   std::vector<ossimString> result;
+   ossimRegExp regExp;
+   
+   regExp.compile(regularExpression.c_str());
+   
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      if(regExp.find( (*i).first.c_str()))
+      {
+         result.push_back((*i).first);
+      }
+   }
+   for(ossim_uint32 i2 = 0; i2 < result.size(); ++i2)
+   {
+      remove(result[i2]);
+   }
+}
+
+std::vector<ossimString> ossimKeywordlist::getSubstringKeyList(const ossimString& regularExpression)const
+{
+   std::vector<ossimString> result;
+   getSubstringKeyList(result, regularExpression);
+   return result;
+}
+
+void ossimKeywordlist::getSubstringKeyList(std::vector<ossimString>& result,
+                                           const ossimString& regularExpression)const
+{
+   KeywordMap::const_iterator i;
+   ossimRegExp regExp;
+   
+   regExp.compile(regularExpression.c_str());
+   
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      if(regExp.find( (*i).first.c_str()))
+      {
+         ossimString value = ossimString((*i).first.begin()+regExp.start(),
+                                         (*i).first.begin()+regExp.start()+regExp.end());
+         
+         if(std::find(result.begin(), result.end(), value) == result.end())
+         {
+            result.push_back(value);
+         }
+      }
+   }
+}
+
+ossim_uint32 ossimKeywordlist::getNumberOfSubstringKeys(const ossimString& regularExpression)const
+{
+   KeywordMap::const_iterator i;
+   std::vector<ossimString> currentList;
+   getSubstringKeyList(currentList, regularExpression);
+   return (ossim_uint32)currentList.size();
+}
+
+void ossimKeywordlist::addPrefixToAll(const ossimString& prefix)
+{
+   ossimKeywordlist tempKwl = *this;
+   
+   clear();
+   
+   KeywordMap::const_iterator values = tempKwl.m_map.begin();
+   
+   while(values != tempKwl.m_map.end())
+   {
+      std::string newKey = prefix.string() + (*values).first;
+      addPair(newKey, (*values).second, true);
+      ++values;
+   }
+}
+
+void ossimKeywordlist::addPrefixToKeysThatMatch(const ossimString& prefix,
+                                                const ossimString& regularExpression)
+{
+   ossimKeywordlist tempKwl = *this;
+   
+   clear();
+   
+   KeywordMap::const_iterator values = tempKwl.m_map.begin();
+   ossimRegExp regExp;
+   
+   regExp.compile(regularExpression.c_str());
+   
+   while(values != tempKwl.m_map.end())
+   {
+      std::string newKey = prefix.string()+(*values).first;
+      if(regExp.find( (*values).first.c_str()))
+      {
+         
+         addPair(newKey, (*values).second, true);
+      }
+      else
+      {
+         addPair((*values).first, (*values).second, true);
+      }
+      ++values;
+   }
+}
+
+void ossimKeywordlist::stripPrefixFromAll(const ossimString& regularExpression)
+{
+   ossimKeywordlist tempKwl = *this;
+   
+   clear();
+   
+   KeywordMap::const_iterator values = tempKwl.m_map.begin();
+   ossimRegExp regExp;
+   
+   regExp.compile(regularExpression.c_str());
+   
+   while(values != tempKwl.m_map.end())
+   {
+      std::string newKey = (*values).first;
+      if(regExp.find( (*values).first.c_str()))
+      {
+         newKey.erase(newKey.begin()+regExp.start(),
+                      newKey.begin()+regExp.start()+regExp.end());
+         
+         addPair(newKey, (*values).second, true);
+      }
+      else
+      {
+         addPair(newKey, (*values).second, true);
+      }
+      ++values;
+   }
+}
+
+ossim_uint32 ossimKeywordlist::getSize()const
+{
+   return (ossim_uint32)m_map.size();
+}
+
+const ossimKeywordlist::KeywordMap& ossimKeywordlist::getMap()const
+{
+   return m_map;
+}
+
+ossimKeywordlist::KeywordMap& ossimKeywordlist::getMap()
+{
+   return m_map;
+}
+
+void ossimKeywordlist::change_delimiter(char del)
+{
+   m_delimiter = del;
+}
+
+ossimString ossimKeywordlist::delimiter_str() const
+{
+   char tmp[2];
+   tmp[0] = m_delimiter;
+   tmp[1] = '\0';
+   return ossimString(tmp);
+}
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+std::ostream& ossimKeywordlist::print(std::ostream& os) const
+{
+   writeToStream(os);
+#if 0
+   KeywordMap::const_iterator i;
+   
+   for(i = m_map.begin(); i != m_map.end(); ++i)
+   {
+      os << (*i).first << delimiter_str().c_str() << "  "
+      << (*i).second << std::endl;
+   }
+#endif
+   return os;
+}
+
+//*******************************************************************
+// friend function:
+//*******************************************************************
+OSSIMDLLEXPORT std::ostream& operator<<(std::ostream& os,
+                                        const ossimKeywordlist& kwl)
+{
+   kwl.print(os);
+   
+   return os;
+}
+
+
+bool ossimKeywordlist::operator ==(ossimKeywordlist& kwl)const
+{
+   if(this==&kwl) return true;
+   std::map<std::string, std::string>::const_iterator iter = m_map.begin();
+   
+   while(iter != m_map.end())
+   {
+      const char* value = kwl.find((*iter).first.c_str());
+      
+      if(ossimString(value) != (*iter).second)
+      {
+         return false;
+      }
+      ++iter;
+   }
+   
+   return true;
+}
+
+ossimKeywordlist&  ossimKeywordlist::downcaseKeywords()
+{
+   KeywordMap tempMap;
+   KeywordMap::iterator iter = m_map.begin();
+   
+   while(iter != m_map.end())
+   {
+      ossimString k(iter->first);
+      tempMap.insert(std::make_pair(k.downcase().string(), iter->second));
+      ++iter;
+   }
+   m_map = tempMap;
+   
+   return *this;
+}
+
+ossimKeywordlist& ossimKeywordlist::upcaseKeywords()
+{
+   KeywordMap tempMap;
+   KeywordMap::iterator iter = m_map.begin();
+   
+   while(iter != m_map.end())
+   {
+      ossimString k(iter->first);
+      tempMap.insert(std::make_pair(k.upcase().string(), iter->second));
+      ++iter;
+   }
+   m_map = tempMap;
+   
+   return *this;
+}
+
+ossimKeywordlist& ossimKeywordlist::trimAllValues(const ossimString& valueToTrim)
+{
+   KeywordMap::iterator iter = m_map.begin();
+   
+   while(iter != m_map.end())
+   {
+      iter->second = ossimString(iter->second).trim(valueToTrim).string();
+      ++iter;
+   }
+   
+   return *this;
+}
+
+ossimKeywordlist ossimKeywordlist::trimAllValues(const ossimString& valueToTrim)const
+{
+   ossimKeywordlist result(*this);
+   result.trimAllValues(valueToTrim);
+   return result;
+}
+
+
+//*************************************************************************************************
+//! [OLK, Aug/2008]
+//! Sets the boolean destination arg depending on value associated with keyword for values = 
+//! (yes|no|true|false|1|0). Returns TRUE if keyword found, otherwise false. Also returns false
+//! if none of the above permitted values are specified (rtn_val left unchanged in this case).
+//*************************************************************************************************
+bool ossimKeywordlist::getBoolKeywordValue(bool& rtn_val, 
+                                           const char* keyword, 
+                                           const char* prefix) const
+{
+   bool found = true;
+   const char* val_str = find(prefix, keyword);
+   if (val_str) 
+   {
+      found = true;
+      ossimString yesno (val_str);
+      yesno.upcase();
+      if ((yesno == "YES") || (yesno == "TRUE") || (yesno == "1"))
+         rtn_val = true;
+      else if ((yesno == "NO") || (yesno == "FALSE") || (yesno == "0"))
+         rtn_val = false;
+      else
+         found = false;
+   }
+   else
+      found = false;
+   
+   return found;
+}
+
diff --git a/ossim/src/ossim/base/ossimLagrangeInterpolator.cpp b/src/base/ossimLagrangeInterpolator.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLagrangeInterpolator.cpp
rename to src/base/ossimLagrangeInterpolator.cpp
diff --git a/ossim/src/ossim/base/ossimLeastSquaresBilin.cpp b/src/base/ossimLeastSquaresBilin.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLeastSquaresBilin.cpp
rename to src/base/ossimLeastSquaresBilin.cpp
diff --git a/ossim/src/ossim/base/ossimLeastSquaresPlane.cpp b/src/base/ossimLeastSquaresPlane.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLeastSquaresPlane.cpp
rename to src/base/ossimLeastSquaresPlane.cpp
diff --git a/ossim/src/ossim/base/ossimLine.cpp b/src/base/ossimLine.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLine.cpp
rename to src/base/ossimLine.cpp
diff --git a/src/base/ossimListener.cpp b/src/base/ossimListener.cpp
new file mode 100644
index 0000000..2059aa4
--- /dev/null
+++ b/src/base/ossimListener.cpp
@@ -0,0 +1,51 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  Garrett Potts 
+//
+//*******************************************************************
+//  $Id: ossimListener.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/base/ossimListener.h>
+
+RTTI_DEF(ossimListener, "ossimListener");
+
+ossimListener::ossimListener()
+  :theListenerEnableFlag(true)
+{}
+
+ossimListener::~ossimListener()
+{
+}
+
+void ossimListener::processEvent(ossimEvent& /* event */)
+{
+}
+
+void ossimListener::enableListener()
+{
+  theListenerEnableFlag = true;
+}
+
+void ossimListener::disableListener()
+{
+  theListenerEnableFlag = false;
+}
+
+void ossimListener::setListenerEnableFlag(bool flag)
+{
+  theListenerEnableFlag = flag;
+}
+
+bool ossimListener::isListenerEnabled()const
+{
+  return theListenerEnableFlag;
+}
+
+bool ossimListener::getListenerEnableFlag()const
+{
+  return theListenerEnableFlag;
+}
diff --git a/src/base/ossimListenerManager.cpp b/src/base/ossimListenerManager.cpp
new file mode 100644
index 0000000..ed54914
--- /dev/null
+++ b/src/base/ossimListenerManager.cpp
@@ -0,0 +1,156 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See LICENSE.txt file in the top level directory.
+//
+// Author: Garrett Potts
+// 
+// Description: A brief description of the contents of the file.
+//
+//*************************************************************************
+// $Id: ossimListenerManager.cpp 17193 2010-04-23 14:59:44Z dburken $
+
+#include <algorithm>
+#include <ossim/base/ossimListenerManager.h>
+#include <ossim/base/ossimEvent.h>
+#include <ossim/base/ossimListener.h>
+
+RTTI_DEF(ossimListenerManager, "ossimListenerManager");
+
+ossimListenerManager::ossimListenerManager()
+{
+   theFireEventFlag = false;
+}
+
+ossimListenerManager::ossimListenerManager(const ossimListenerManager& /* rhs */)
+{
+//    replaceListeners(rhs.getListeners());
+}
+
+ossimListenerManager::~ossimListenerManager()
+{
+   theListenerList.clear();
+}
+
+void ossimListenerManager::fireEvent(ossimEvent& event)
+{
+   // only process the event if it has not been consumed.
+   event.setCurrentObject( dynamic_cast<ossimObject*>(this) );
+   if(event.isConsumed())
+   {
+      return;
+   }
+   theFireEventFlag = true;
+
+   std::list<ossimListener*>::iterator currentIterator = theListenerList.begin();
+   
+   while(currentIterator != theListenerList.end())
+   {
+      // only fire if the event is not consumed
+      if(!event.isConsumed())
+      {
+         if(*currentIterator)
+         {
+            if(theDelayedRemove.end()==std::find(theDelayedRemove.begin(),
+                                                 theDelayedRemove.end(),
+                                                 (*currentIterator)))
+            {
+               if((*currentIterator)->isListenerEnabled())
+               {
+                  (*currentIterator)->processEvent(event);
+               }
+            }
+         }
+      }
+      else
+      {
+         // the event is now consumed so stop propagating.
+         //
+         theFireEventFlag = false;
+         break;
+      }
+      ++currentIterator;
+   }
+   
+   theFireEventFlag = false;
+   
+   if(theDelayedAdd.size())
+   {
+      for(std::list<ossimListener*>::iterator current = theDelayedAdd.begin();
+          current != theDelayedAdd.end();++current)
+      {
+         addListener(*current);
+      }
+      theDelayedAdd.clear();
+   }
+   
+   if(theDelayedRemove.size())
+   {
+      for(std::list<ossimListener*>::iterator current = theDelayedRemove.begin();
+          current != theDelayedRemove.end();++current)
+      {
+         removeListener(*current);
+      }
+      theDelayedRemove.clear();
+   }
+}
+
+bool ossimListenerManager::addListener(ossimListener* listener)
+{
+   if(theFireEventFlag)
+   {
+      theDelayedAdd.push_back(listener);
+   }
+   else
+   {
+      
+      if(!findListener(listener))
+      {
+         theListenerList.push_back(listener);
+      }
+   }
+   
+   return true;
+}
+
+bool ossimListenerManager::removeListener(ossimListener* listener)
+{
+   
+   if(theFireEventFlag)
+   {
+      theDelayedRemove.push_back(listener);
+      return true;
+   }
+   
+   std::list<ossimListener*>::iterator current=theListenerList.begin();
+   while(current!=theListenerList.end())
+   {
+      if( (*current) == listener)
+      {
+         current = theListenerList.erase(current);
+         break; // Should only be in list once... (drb)
+      }
+      else
+      {
+         ++current;
+      }
+   }
+   
+   return true;
+}
+
+bool ossimListenerManager::findListener(ossimListener* listener)
+{
+   bool result = false;
+
+   if(listener)
+   {
+      std::list<ossimListener*>::iterator currentIter =
+         std::find(theListenerList.begin(),
+                   theListenerList.end(),
+                   listener);
+      result = (currentIter != theListenerList.end());
+   }
+   
+   return result;
+}
diff --git a/ossim/src/ossim/base/ossimLookUpTable.cpp b/src/base/ossimLookUpTable.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLookUpTable.cpp
rename to src/base/ossimLookUpTable.cpp
diff --git a/ossim/src/ossim/base/ossimLsrPoint.cpp b/src/base/ossimLsrPoint.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLsrPoint.cpp
rename to src/base/ossimLsrPoint.cpp
diff --git a/ossim/src/ossim/base/ossimLsrRay.cpp b/src/base/ossimLsrRay.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLsrRay.cpp
rename to src/base/ossimLsrRay.cpp
diff --git a/ossim/src/ossim/base/ossimLsrSpace.cpp b/src/base/ossimLsrSpace.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLsrSpace.cpp
rename to src/base/ossimLsrSpace.cpp
diff --git a/ossim/src/ossim/base/ossimLsrVector.cpp b/src/base/ossimLsrVector.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimLsrVector.cpp
rename to src/base/ossimLsrVector.cpp
diff --git a/ossim/src/ossim/base/ossimMatrix3x3.cpp b/src/base/ossimMatrix3x3.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimMatrix3x3.cpp
rename to src/base/ossimMatrix3x3.cpp
diff --git a/ossim/src/ossim/base/ossimMatrix4x4.cpp b/src/base/ossimMatrix4x4.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimMatrix4x4.cpp
rename to src/base/ossimMatrix4x4.cpp
diff --git a/src/base/ossimMatrixProperty.cpp b/src/base/ossimMatrixProperty.cpp
new file mode 100644
index 0000000..a536337
--- /dev/null
+++ b/src/base/ossimMatrixProperty.cpp
@@ -0,0 +1,316 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+//*************************************************************************
+// $Id: ossimMatrixProperty.cpp 17074 2010-04-14 18:49:11Z dburken $
+#include <sstream>
+#include <ossim/base/ossimMatrixProperty.h>
+#include <ossim/base/ossimCommon.h>
+
+RTTI_DEF1(ossimMatrixProperty, "ossimMatrixProperty", ossimProperty);
+
+ossimMatrixProperty::ossimMatrixProperty(const ossimString& name,
+                                         const std::vector<double>& values,
+                                         int numberOfRows,
+                                         int numberOfCols)
+   :ossimProperty(name),
+    theMinNumberOfCols(-1),
+    theMaxNumberOfCols(-1),
+    theMinNumberOfRows(-1),
+    theMaxNumberOfRows(-1)
+{
+   resize(numberOfRows, numberOfCols);
+
+   if((int)values.size() == numberOfRows*numberOfCols)
+   {
+      int rowIdx = 0;
+      int colIdx = 0;
+      int linearIdx = 0;
+      for(rowIdx = 0; rowIdx < getNumberOfRows(); ++rowIdx)
+      {
+         for(colIdx = 0; colIdx < getNumberOfCols(); ++colIdx)
+         {
+            theValueArray[rowIdx][colIdx] = values[linearIdx];
+            ++linearIdx;
+         }
+      }
+   }
+}
+
+
+ossimMatrixProperty::ossimMatrixProperty(const ossimMatrixProperty& rhs)
+   :ossimProperty(rhs),
+    theValueArray(rhs.theValueArray),
+    theMinNumberOfCols(rhs.theMinNumberOfCols),
+    theMaxNumberOfCols(rhs.theMaxNumberOfCols),
+    theMinNumberOfRows(rhs.theMaxNumberOfCols),
+    theMaxNumberOfRows(rhs.theMaxNumberOfRows)
+{
+}
+
+ossimMatrixProperty::~ossimMatrixProperty()
+{
+   
+}
+
+ossimObject* ossimMatrixProperty::dup()const
+{
+   return new ossimMatrixProperty(*this);
+}
+
+
+const ossimProperty& ossimMatrixProperty::assign(const ossimProperty& rhs)
+{
+   const ossimMatrixProperty* rhsPtr = dynamic_cast<const ossimMatrixProperty*>(&rhs);
+   if(rhsPtr)
+   {
+      theValueArray      = rhsPtr->theValueArray;
+      theMinNumberOfCols = rhsPtr->theMinNumberOfCols;
+      theMaxNumberOfCols = rhsPtr->theMaxNumberOfCols;
+      theMinNumberOfRows = rhsPtr->theMinNumberOfRows;
+      theMaxNumberOfRows = rhsPtr->theMaxNumberOfRows;
+   }
+
+   return ossimProperty::assign(rhs);
+}
+
+bool ossimMatrixProperty::setValue(const ossimString& value)
+{
+   std::istringstream in(value);
+   
+   ossimString numberOfRows;
+   ossimString numberOfCols;
+   ossimString tempValue;
+   
+   in>>numberOfRows >> numberOfCols;
+
+   if(!in.bad())
+   {
+      resize(numberOfRows.toInt32(), numberOfCols.toInt32());
+
+      int rowIdx = 0;
+      int colIdx = 0;
+      for(rowIdx = 0; ((rowIdx < getNumberOfRows())&&(!in.bad())); ++rowIdx)
+      {
+         for(colIdx = 0; ((colIdx < getNumberOfCols())&&(!in.bad()));++ colIdx)
+         {
+            in >> tempValue;
+            
+            theValueArray[rowIdx][colIdx] = tempValue.toDouble();
+         }
+      }
+   }
+
+   return !in.bad();
+}
+
+void ossimMatrixProperty::valueToString(ossimString& valueResult)const
+{
+   if(theValueArray.size()>0)
+   {
+      if(theValueArray[0].size() > 0)
+      {
+         valueResult = "";
+         
+         int rowIdx = 0;
+         int colIdx = 0;
+         valueResult += ossimString::toString(getNumberOfRows()) + " " +
+                        ossimString::toString(getNumberOfCols()) + " ";
+         for(rowIdx = 0; rowIdx < getNumberOfRows();++rowIdx)
+         {
+            for(colIdx = 0; colIdx < getNumberOfCols(); ++colIdx)
+            {
+               valueResult += ossimString::toString(theValueArray[rowIdx][colIdx]);
+               valueResult += " ";
+            }
+         }
+      }
+   }
+}
+
+void ossimMatrixProperty::resize(int numberOfRows,
+                                 int numberOfCols)
+{
+   int tempNumberOfRows = numberOfRows;
+   int tempNumberOfCols = numberOfCols;
+
+   if(theMinNumberOfCols > 0)
+   {
+      if(tempNumberOfCols < theMinNumberOfCols)
+      {
+         tempNumberOfCols = theMinNumberOfCols;
+      }
+   }
+   if(theMinNumberOfRows > 0)
+   {
+      if(tempNumberOfRows < theMinNumberOfRows)
+      {
+         tempNumberOfRows = theMinNumberOfRows;
+      }
+   }
+   if(theMaxNumberOfCols > 0)
+   {
+      if(tempNumberOfCols > theMaxNumberOfCols)
+      {
+         tempNumberOfCols = theMaxNumberOfCols;
+      }
+   }
+   if(theMaxNumberOfRows > 0)
+   {
+      if(tempNumberOfRows > theMaxNumberOfRows)
+      {
+         tempNumberOfRows = theMaxNumberOfRows;
+      }
+   }
+
+   int currentNumberOfRows = getNumberOfRows();
+   int currentNumberOfCols = getNumberOfCols();
+   
+   if((currentNumberOfRows != tempNumberOfRows) ||
+      (currentNumberOfCols != tempNumberOfCols))
+   {
+      std::vector< std::vector<double> > tempValue = theValueArray;
+      
+      theValueArray.resize(tempNumberOfRows);
+
+      int minCols = ossim::min((int)currentNumberOfCols,
+                             (int)tempNumberOfCols);
+      int rowIdx = 0;
+      int colIdx = 0;
+      
+      for(rowIdx = 0 ; rowIdx < tempNumberOfRows; ++rowIdx)
+      {
+         theValueArray[rowIdx].resize(tempNumberOfCols);
+         std::fill(theValueArray[rowIdx].begin(), theValueArray[rowIdx].end(), 0);
+
+         if(tempNumberOfRows < currentNumberOfRows)
+         {
+            for(colIdx = 0 ; colIdx < minCols; ++colIdx)
+            {
+               theValueArray[rowIdx][colIdx] = tempValue[rowIdx][colIdx];
+            }
+         }
+      }
+   }
+}
+
+double& ossimMatrixProperty::operator()(int rowIdx,
+                                        int colIdx)
+{
+   return theValueArray[rowIdx][colIdx];
+}
+
+const double& ossimMatrixProperty::operator()(int rowIdx,
+                                              int colIdx)const
+{
+   return theValueArray[rowIdx][colIdx];
+}
+
+int ossimMatrixProperty::getNumberOfRows()const
+{
+   return (int)theValueArray.size();
+}
+
+int ossimMatrixProperty::getNumberOfCols()const
+{
+   if(getNumberOfRows())
+   {
+      return (int)theValueArray[0].size();
+   }
+
+   return 0;
+}
+
+void ossimMatrixProperty::clearConstraints()
+{
+   theMinNumberOfCols = -1;
+   theMaxNumberOfCols = -1;
+   theMinNumberOfRows = -1;
+   theMaxNumberOfRows = -1;
+}
+
+void ossimMatrixProperty::setColConstraints(int minNumberOfCols,
+                                            int maxNumberOfCols)
+{
+   theMinNumberOfCols = minNumberOfCols;
+   theMaxNumberOfCols = maxNumberOfCols;
+}
+
+void ossimMatrixProperty::setRowConstraints(int minNumberOfRows,
+                                            int maxNumberOfRows)
+{
+   theMinNumberOfRows = minNumberOfRows;
+   theMaxNumberOfRows = maxNumberOfRows;
+}
+
+void ossimMatrixProperty::getColConstraints(int& minNumberOfCols,
+                                            int& maxNumberOfCols) const
+{
+   minNumberOfCols = theMinNumberOfCols;
+   maxNumberOfCols = theMaxNumberOfCols;
+}
+
+void ossimMatrixProperty::getRowConstraints(int& minNumberOfRows,
+                                            int& maxNumberOfRows) const
+{
+   minNumberOfRows = theMinNumberOfRows;
+   maxNumberOfRows = theMaxNumberOfRows;
+}
+
+void ossimMatrixProperty::normalize()
+{
+   double densityValue = density();
+
+   if(fabs(densityValue) <= DBL_EPSILON)
+   {
+      return;
+   }
+   int rowIdx = 0;
+   int colIdx = 0;
+   for(rowIdx = 0 ; rowIdx < (int)theValueArray.size(); ++rowIdx)
+   {
+      for(colIdx = 0 ; colIdx < (int)theValueArray[rowIdx].size(); ++colIdx)
+      {
+         theValueArray[rowIdx][colIdx]/=densityValue;
+      }
+   }
+   
+}
+
+void ossimMatrixProperty::zero()
+{
+   int rowIdx = 0;
+   int colIdx = 0;
+   for(rowIdx = 0 ; rowIdx < (int)theValueArray.size(); ++rowIdx)
+   {
+      for(colIdx = 0 ; colIdx < (int)theValueArray[rowIdx].size(); ++colIdx)
+      {
+         theValueArray[rowIdx][colIdx] = 0.0;
+      }
+   }
+}
+
+double ossimMatrixProperty::density()const
+{
+   double result = 0.0;
+
+   if((getNumberOfRows() > 0)&&
+      (getNumberOfCols() > 0))
+   {
+      int rowIdx = 0;
+      int colIdx = 0;
+      
+      for(rowIdx = 0 ; rowIdx < (int)theValueArray.size(); ++rowIdx)
+      {
+         for(colIdx = 0 ; colIdx < (int)theValueArray[rowIdx].size(); ++colIdx)
+         {
+            result += theValueArray[rowIdx][colIdx];
+         }
+      }
+   }
+
+   return result;
+}
diff --git a/ossim/src/ossim/base/ossimMouseEvent.cpp b/src/base/ossimMouseEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimMouseEvent.cpp
rename to src/base/ossimMouseEvent.cpp
diff --git a/src/base/ossimMouseListener.cpp b/src/base/ossimMouseListener.cpp
new file mode 100644
index 0000000..1838a8a
--- /dev/null
+++ b/src/base/ossimMouseListener.cpp
@@ -0,0 +1,39 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts (gpotts at imagelinks)
+//
+//*************************************************************************
+// $Id: ossimMouseListener.cpp 9963 2006-11-28 21:11:01Z gpotts $
+
+#include <ossim/base/ossimMouseListener.h>
+#include <ossim/base/ossimMouseEvent.h>
+
+RTTI_DEF1(ossimMouseListener,"ossimMouseListener",ossimListener);
+
+void ossimMouseListener::processEvent(ossimEvent& event)
+{
+   ossimMouseEvent* mEvent = dynamic_cast<ossimMouseEvent*>(&event);
+   if(mEvent)
+   {
+      mouseEvent(*mEvent);
+   }
+   else
+   {
+      ossimListener::processEvent(event);
+   }
+//    switch(event.getId())
+//    {
+//    case OSSIM_MOUSE_EVENT_ID:
+//    {
+//        = static_cast<ossimMouseEvent*>(&event);
+//       mouseEvent(*mEvent);
+//       break;
+//    }
+//    default:
+//    {
+//       ossimListener::processEvent(event);
+//    }
+//    }
+}
diff --git a/src/base/ossimMultiBandHistogram.cpp b/src/base/ossimMultiBandHistogram.cpp
new file mode 100644
index 0000000..7dd1c14
--- /dev/null
+++ b/src/base/ossimMultiBandHistogram.cpp
@@ -0,0 +1,542 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts
+//
+// Description: 
+//
+//*******************************************************************
+//  $Id: ossimMultiBandHistogram.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <fstream>
+
+ossimMultiBandHistogram::ossimMultiBandHistogram()
+{  
+}
+
+ossimMultiBandHistogram::~ossimMultiBandHistogram()
+{
+   deleteHistograms();
+}
+
+ossimMultiBandHistogram::ossimMultiBandHistogram(const ossimMultiBandHistogram& rhs)
+{
+   theHistogramList.resize(rhs.theHistogramList.size());
+
+   for(ossim_uint32 i = 0; i < theHistogramList.size(); ++i)
+   {
+      theHistogramList[i] =  rhs.theHistogramList[i].valid()?
+         new ossimHistogram(*rhs.theHistogramList[i].get()):(ossimHistogram*)0;
+   }
+}
+
+ossimMultiBandHistogram::ossimMultiBandHistogram(ossim_int32 numberOfBands,
+                                                 ossim_int32 numberOfBuckets,
+                                                 float minValue,
+                                                 float maxValue)
+{
+   if(numberOfBands > 0)
+   {
+      create(numberOfBands, numberOfBuckets, minValue, maxValue);
+   }
+}
+
+void ossimMultiBandHistogram::create(const ossimImageSource* input)
+{
+   if (input)
+   {
+      ossim_uint32 bands = input->getNumberOfOutputBands();;
+      ossim_uint32 numberOfBins = 0;
+      ossim_float64 minValue = 0.0;
+      ossim_float64 maxValue = 0.0;
+      
+      switch(input->getOutputScalarType())
+      {
+         case OSSIM_UINT8:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UCHAR;
+            numberOfBins = 256;
+            break;
+         }
+         case OSSIM_USHORT11:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT11;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT11 + 1;
+            break;
+         }
+         case OSSIM_USHORT12:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT12;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT12 + 1;
+            break;
+         }
+         case OSSIM_USHORT13:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT13;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT13 + 1;
+            break;
+         }
+         case OSSIM_USHORT14:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT14;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT14 + 1;
+            break;
+         }
+         case OSSIM_USHORT15:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT15;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT15 + 1;
+            break;
+         }
+         case OSSIM_UINT16:
+         case OSSIM_UINT32:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT16;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16 + 1;
+            break;
+         }
+         case OSSIM_SINT16:
+         case OSSIM_SINT32:
+         case OSSIM_FLOAT32:
+         case OSSIM_FLOAT64:
+         {
+            //---
+            // Special case to handle DTED which has a null of -32767 and SRTM
+            // which has null of -32768.  Set the min to -32766 which is OK for
+            // both types.  Basically we don't want to count the null values as
+            // a valid pixel. drb - 04 Feb. 2016
+            //
+            // NOTE: OSSIM_DEFAULT_MIN_PIX_SINT16 = -32767
+            //---
+            minValue     = OSSIM_DEFAULT_MIN_PIX_SINT16+1;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_SINT16;
+            numberOfBins = (OSSIM_DEFAULT_MAX_PIX_SINT16-OSSIM_DEFAULT_MIN_PIX_SINT16);
+            break;
+         }
+         case OSSIM_NORMALIZED_FLOAT:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            minValue     = 0;
+            maxValue     = 1.0;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
+            break;
+         }
+         default:
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Unsupported scalar type in ossimMultiBandHistogram::create()"
+               << std::endl;
+            return;
+         }
+         
+      }  // switch(input->getOutputScalarType())
+
+      create(bands, numberOfBins, minValue, maxValue);
+      
+   } // if (input)
+}
+
+void ossimMultiBandHistogram::create(ossim_int32 numberOfBands,
+                                     ossim_int32 numberOfBuckets,
+                                     float minValue,
+                                     float maxValue)
+{
+   // Make sure we clear our internal lists before we start.
+   deleteHistograms();
+
+   if(numberOfBands > 0)
+   {
+      numberOfBuckets = numberOfBuckets>0?numberOfBuckets:1;
+
+      for(ossim_int32 bands = 0; bands < numberOfBands; ++bands)
+      {
+         theHistogramList.push_back(new ossimHistogram(numberOfBuckets,
+                                                       minValue,
+                                                       maxValue));
+      }
+   }
+}
+
+void ossimMultiBandHistogram::create(ossim_int32 numberOfBands)
+{
+   deleteHistograms();
+   for(ossim_int32 bands = 0; bands < numberOfBands; ++bands)
+   {
+      theHistogramList.push_back(new ossimHistogram);
+   }
+}
+
+ossim_uint32 ossimMultiBandHistogram::getNumberOfBands() const
+{
+   return (ossim_uint32)theHistogramList.size();
+}
+
+ossimRefPtr<ossimHistogram> ossimMultiBandHistogram::getHistogram(ossim_int32 band)
+{
+   if((band >=0) && (band < (ossim_int32)theHistogramList.size()))
+   {
+      return theHistogramList[band];
+   }
+
+   return NULL;
+}
+
+const ossimRefPtr<ossimHistogram> ossimMultiBandHistogram::getHistogram(ossim_int32 band)const
+{
+   if((band >=0) && (band < (ossim_int32)theHistogramList.size()))
+   {
+      return theHistogramList[band];
+   }
+
+   return 0;
+}
+
+void ossimMultiBandHistogram::setBinCount(double binNumber, double count)
+{
+   if(theHistogramList.size() > 0)
+   {
+      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
+      {
+         if(theHistogramList[idx].valid())
+         {
+            theHistogramList[idx]->SetCount(binNumber, count);
+         }
+      }
+   }   
+}
+
+ossimRefPtr<ossimMultiBandHistogram> ossimMultiBandHistogram::createAccumulationLessThanEqual()const
+{
+   ossimRefPtr<ossimMultiBandHistogram> result = NULL;
+
+   if(theHistogramList.size() > 0)
+   {
+      result = new ossimMultiBandHistogram;
+      result->theHistogramList.resize(theHistogramList.size());
+      
+      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
+      {
+         if(theHistogramList[idx].valid())
+         {
+            result->theHistogramList[idx] = theHistogramList[idx]->CumulativeLessThanEqual();
+         }
+         else
+         {
+            result->theHistogramList[idx] = 0;
+         }     
+      }
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimMultiBandHistogram> ossimMultiBandHistogram::createAccumulationGreaterThanEqual()const
+{
+   ossimRefPtr<ossimMultiBandHistogram> result = NULL;
+
+   if(theHistogramList.size() > 0)
+   {
+      result = new ossimMultiBandHistogram;
+      
+      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
+      {
+         if(theHistogramList[idx].valid())
+         {
+            result->theHistogramList[idx] = theHistogramList[idx]->CumulativeGreaterThanEqual();
+         }
+         else
+         {
+            result->theHistogramList[idx] = 0;
+         }     
+      }
+   }
+
+   return result;
+}
+
+void ossimMultiBandHistogram::deleteHistograms()
+{
+   theHistogramList.clear();
+}
+
+
+bool ossimMultiBandHistogram::importHistogram(std::istream& in)
+{
+   ossimProprietaryHeaderInformation header;
+   deleteHistograms();
+   
+   if(header.parseStream(in))
+   {
+      ossim_int32 numberOfBands = header.getNumberOfBands();
+      
+      if(numberOfBands)
+      {
+         theHistogramList.resize(numberOfBands);
+
+         for(ossim_int32 counter = 0; counter < (ossim_int32)theHistogramList.size(); ++counter)
+         {
+            theHistogramList[counter] = 0;
+         }
+         ossimString bandBuffer;
+         ossimString buffer;
+         
+         for(ossim_int32 idx = 0; idx < numberOfBands; ++idx)
+         {
+            getline(in, buffer);
+            if(buffer.find("Band") != string::npos)
+            {
+				string::size_type offset = buffer.find(":");
+               if(offset != string::npos)
+               {
+                  bandBuffer = buffer.substr(offset+1);
+               }
+               else
+               {
+                  deleteHistograms();
+                  return false;
+               }
+            }
+            else
+            {
+               deleteHistograms();
+               return false;
+            }
+            ossim_uint32 bandIdx = bandBuffer.toUInt32();
+
+            if(bandIdx < theHistogramList.size())
+            {
+               if(!theHistogramList[bandIdx].valid())
+               {
+                  ossimRefPtr<ossimHistogram> histogram = new ossimHistogram;
+                  if(histogram->importHistogram(in))
+                  {
+                     theHistogramList[bandIdx] = histogram;
+                  }
+                  else
+                  {
+                     deleteHistograms();
+                     return false;
+                  }
+               }
+            }
+            else
+            {
+               deleteHistograms();
+               return false;
+            }
+         }
+      }
+      else
+      {
+         return false;
+      }
+   }  
+   return true;
+}
+
+bool ossimMultiBandHistogram::importHistogram(const ossimFilename& file)
+{
+   if(file.exists())
+   {
+      std::ifstream input(file.c_str());
+
+      return importHistogram(input);
+   }
+
+   return false;
+}
+
+bool ossimMultiBandHistogram::ossimProprietaryHeaderInformation::parseStream(std::istream& in)
+{
+   ossimString inputLine;
+
+   getline(in, inputLine);  
+   if(inputLine.find("File Type") != string::npos)
+   {
+      std::string::size_type idx = inputLine.find(":");
+      if(idx != string::npos)
+      {
+         theFileType = inputLine.substr(idx+1);
+         theFileType = theFileType.trim();
+      }
+      else
+      {
+         return false;
+      }
+
+   }
+   else
+   {
+      return false;
+   }
+
+   getline(in, inputLine);  
+   if(inputLine.find("Version") != string::npos)
+   {
+      std::string::size_type idx = inputLine.find(":");
+      if(idx != string::npos)
+      {
+         theVersion = inputLine.substr(idx+1);
+         theVersion = theVersion.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+
+   getline(in, inputLine);  
+   if(inputLine.find("Number of Bands") != string::npos)
+   {
+      std::string::size_type idx = inputLine.find(":");
+      if(idx != string::npos)
+      {
+         theNumberOfBands = inputLine.substr(idx+1);
+         theNumberOfBands = theNumberOfBands.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+   
+   return true;
+}
+
+ossim_uint32 ossimMultiBandHistogram::ossimProprietaryHeaderInformation::getNumberOfBands() const
+{
+   return theNumberOfBands.toUInt32();
+}
+
+void ossimMultiBandHistogram::ossimProprietaryHeaderInformation::clear()
+{
+   theFileType      = "";
+   theVersion       = "";
+   theNumberOfBands = "";
+}
+
+bool ossimMultiBandHistogram::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)const
+{
+   kwl.add(prefix,
+           "type",
+           "ossimMultiBandHistogram",
+           true);
+   kwl.add(prefix,
+           "number_of_bands",
+           static_cast<ossim_uint32>(theHistogramList.size()),
+           true);
+   
+   for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
+   {
+      ossimString band = ossimString(prefix) + "band";
+      band += (ossimString::toString(idx) + ".");
+      if(theHistogramList[idx].valid())
+      {
+         ossimString newPrefix = (ossimString(prefix) + ossimString::toString(idx) + ".");
+         
+         theHistogramList[idx]->saveState(kwl, band.c_str());
+      }
+   }
+   
+   return true;
+}
+
+bool ossimMultiBandHistogram::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   deleteHistograms();
+   const char* number_of_bands = kwl.find(prefix, "number_of_bands");
+   if(number_of_bands)
+   {
+      ossim_uint32 numberOfBands = ossimString(number_of_bands).toUInt32();
+
+      if(numberOfBands>0)
+      {
+         ossimString newPrefix;
+         for(ossim_uint32 idx = 0; idx < numberOfBands; ++idx)
+         {
+            ossimHistogram* histo = new ossimHistogram;
+
+            newPrefix = prefix;
+            newPrefix += "band";
+            newPrefix += ossimString::toString(idx);
+            newPrefix += ".";
+            
+            histo->loadState(kwl, newPrefix.c_str());
+            
+            theHistogramList.push_back(histo);
+         }
+      }
+   }
+   
+   return true;
+}
+
+bool ossimMultiBandHistogram::saveState(ossimRefPtr<ossimXmlNode> xmlNode)const
+{
+   xmlNode->setTag("ossimMutliBandHistogram");
+   for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
+   {
+      ossimRefPtr<ossimXmlNode> band = new ossimXmlNode;
+      ossimRefPtr<ossimXmlNode> newNode = new ossimXmlNode;
+
+      band->setTag("Band");
+      band->addAttribute("idx", ossimString::toString(idx));
+      band->addChildNode(newNode.get());
+      if(theHistogramList[idx].valid())
+      {         
+         theHistogramList[idx]->saveState(newNode);
+      }
+      else
+      {
+         newNode->setTag("ossimHistogram");
+      }
+      xmlNode->addChildNode(band.get());
+   }
+
+   return true;
+}
+
+bool ossimMultiBandHistogram::loadState(const ossimRefPtr<ossimXmlNode> xmlNode)
+{
+   theHistogramList.clear();
+   const vector<ossimRefPtr<ossimXmlNode> >& childNodes = xmlNode->getChildNodes();
+
+   ossim_uint32 idx = 0;
+   ossim_uint32 maxCount = (ossim_uint32)childNodes.size();
+   for(idx = 0; idx < maxCount; ++idx)
+   {
+      if(childNodes[idx]->getTag() == "Band")
+      {
+         if(childNodes[idx]->getChildNodes().size())
+         {
+            ossimRefPtr<ossimHistogram> histo = new ossimHistogram;
+            histo->loadState(childNodes[idx]->getChildNodes()[0]);
+            theHistogramList.push_back(histo);
+         }
+      }
+   }
+
+   return true;
+}
diff --git a/src/base/ossimMultiResLevelHistogram.cpp b/src/base/ossimMultiResLevelHistogram.cpp
new file mode 100644
index 0000000..6043f1c
--- /dev/null
+++ b/src/base/ossimMultiResLevelHistogram.cpp
@@ -0,0 +1,511 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts
+//
+// Description: 
+//
+//*******************************************************************
+//  $Id: ossimMultiResLevelHistogram.cpp 20610 2012-02-27 12:19:25Z gpotts $
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimKeyword.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <fstream>
+using namespace std;
+
+static const ossimKeyword NUMBER_OF_RES_LEVELS("number_of_res_levels",
+                                               "");
+
+ossimMultiResLevelHistogram::ossimMultiResLevelHistogram()
+   :
+      theHistogramList(),
+      theHistogramFile()
+{  
+}
+
+ossimMultiResLevelHistogram::ossimMultiResLevelHistogram(ossim_uint32 numberOfResLevels)
+   :
+      theHistogramList(),
+      theHistogramFile()
+{
+   create(numberOfResLevels);
+}
+
+ossimMultiResLevelHistogram::ossimMultiResLevelHistogram(const ossimMultiResLevelHistogram& rhs)
+   :
+      theHistogramList(),
+      theHistogramFile()
+{
+   
+   create(rhs.getNumberOfResLevels());
+   for(ossim_uint32 i = 0; i < theHistogramList.size(); ++i)
+   {
+      theHistogramList[i] = rhs.theHistogramList[i].valid()?
+                            new ossimMultiBandHistogram(*rhs.theHistogramList[i]):
+                            (ossimMultiBandHistogram*)NULL;
+   }
+}
+
+ossimMultiResLevelHistogram::~ossimMultiResLevelHistogram()
+{
+   deleteHistograms();
+}
+
+void ossimMultiResLevelHistogram::create(ossim_uint32 numberOfResLevels)
+{
+   deleteHistograms();
+
+   for(ossim_uint32 idx = 0; idx < numberOfResLevels; ++idx)
+   {
+      theHistogramList.push_back(new ossimMultiBandHistogram);      
+   }
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimMultiResLevelHistogram::createAccumulationLessThanEqual()const
+{
+   ossimRefPtr<ossimMultiResLevelHistogram> result = 0;
+
+   if(theHistogramList.size() > 0)
+   {
+      result = new ossimMultiResLevelHistogram((ossim_uint32)theHistogramList.size());
+
+      for(ossim_uint32 idx=0; idx < (ossim_uint32) theHistogramList.size(); ++ idx)
+      {
+         if(theHistogramList[idx].valid())
+         {
+            ossimRefPtr<ossimMultiBandHistogram> multiBandAccumulator = theHistogramList[idx]->createAccumulationLessThanEqual();
+            result->theHistogramList[idx] = multiBandAccumulator;
+         }
+         else
+         {
+            // we will push on a null since someone could
+            // turn off a band.  A null accumulation will
+            // indicate no histogram data.
+            //
+            result->theHistogramList[idx] = 0;
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimMultiResLevelHistogram::setBinCount(double binNumber, double count)
+{
+   if(theHistogramList.size() > 0)
+   {
+      for(ossim_uint32 idx=0; idx < (ossim_uint32) theHistogramList.size(); ++ idx)
+      {
+         if(theHistogramList[idx].valid())
+         {
+            theHistogramList[idx]->setBinCount(binNumber, count);
+         }
+      }
+   }   
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimMultiResLevelHistogram::createAccumulationGreaterThanEqual()const
+{
+   ossimRefPtr<ossimMultiResLevelHistogram> result = NULL;
+
+   if(theHistogramList.size() > 0)
+   {
+      result = new ossimMultiResLevelHistogram((ossim_uint32)theHistogramList.size());
+
+      for(ossim_uint32 idx=0; idx < (ossim_uint32) theHistogramList.size(); ++ idx)
+      {
+         if(theHistogramList[idx].valid())
+         {
+            ossimRefPtr<ossimMultiBandHistogram> multiBandAccumulator = theHistogramList[idx]->createAccumulationGreaterThanEqual();
+            result->theHistogramList[idx]=multiBandAccumulator;
+         }
+         else
+         {
+            // we will push on a null since someone could
+            // turn off a band.  A null accumulation will
+            // indicate no histogram data.
+            //
+            result->theHistogramList[idx] = 0;
+         }
+      }
+      result = 0;
+   }
+   
+   return result;
+}
+
+void ossimMultiResLevelHistogram::addHistogram(ossimMultiBandHistogram* histo)
+{
+   theHistogramList.push_back(histo);
+}
+
+ossimRefPtr<ossimMultiBandHistogram> ossimMultiResLevelHistogram::addHistogram()
+{
+   ossimRefPtr<ossimMultiBandHistogram> result = new ossimMultiBandHistogram;
+   theHistogramList.push_back(result);
+   return result;
+}
+
+bool ossimMultiResLevelHistogram::setHistogram(ossimRefPtr<ossimMultiBandHistogram> histo, 
+                                               ossim_uint32 resLevel)
+{
+   if(resLevel < getNumberOfResLevels())
+   {
+      theHistogramList[resLevel] = histo;
+      return true;
+   }
+   return false;
+}
+
+void ossimMultiResLevelHistogram::deleteHistograms()
+{
+   for(ossim_uint32 idx = 0; idx < (ossim_uint32)theHistogramList.size(); ++idx)
+   {
+      if(theHistogramList[idx].valid())
+      {
+         theHistogramList[idx] = NULL;
+      }
+   }
+   
+   theHistogramList.clear();
+}
+
+ossimRefPtr<ossimHistogram> ossimMultiResLevelHistogram::getHistogram(ossim_uint32 band,
+                                                          ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimMultiBandHistogram> temp = getMultiBandHistogram(resLevel);
+
+   if(temp.valid())
+   {
+      return temp->getHistogram(band);
+   }
+   
+   return (ossimHistogram*)0;
+}
+const ossimRefPtr<ossimHistogram> ossimMultiResLevelHistogram::getHistogram(ossim_uint32 band,
+                                                                            ossim_uint32 resLevel)const
+{
+   const ossimRefPtr<ossimMultiBandHistogram> temp = getMultiBandHistogram(resLevel);
+
+   if(temp.valid())
+   {
+      return temp->getHistogram(band);
+   }
+   
+   return (ossimHistogram*)0;
+}
+
+ossim_uint32 ossimMultiResLevelHistogram::getNumberOfResLevels()const
+{
+   return (ossim_uint32)theHistogramList.size();
+}
+
+ossim_uint32 ossimMultiResLevelHistogram::getNumberOfBands(ossim_uint32 resLevel) const
+{
+   const ossimRefPtr<ossimMultiBandHistogram> h = getMultiBandHistogram(resLevel);
+   if (h.valid())
+   {
+      return h->getNumberOfBands();
+   }
+
+   return 0;
+}  
+
+ossimRefPtr<ossimMultiBandHistogram> ossimMultiResLevelHistogram::getMultiBandHistogram(ossim_uint32 resLevel) const
+{
+   if(resLevel < (ossim_uint32)theHistogramList.size())
+   {
+      return theHistogramList[resLevel];
+   }
+
+   return NULL;
+}
+
+bool ossimMultiResLevelHistogram::importHistogram(std::istream& in)
+{
+   if (!in) // Check stream state.
+   {
+      return false;
+   }
+   
+   ossimString buffer;
+   getline(in, buffer);
+
+   if ( in.eof() ) // Zero byte files will hit here.
+   {
+      return false;
+   }
+
+   // check to see if it is a proprietary histogram file
+   // 
+   if((buffer =="") || (buffer.c_str()[0] != 'F' ||
+      buffer.c_str()[1] != 'i'))
+   {
+      in.seekg(0, ios::beg);
+      ossimKeywordlist kwl;
+      if (kwl.parseStream(in) == true)
+      {
+         return loadState(kwl);
+      }
+      else
+      {
+         return false;
+      }
+   }
+   
+   ossimProprietaryHeaderInformation header;
+   in.seekg(0, ios::beg);
+   deleteHistograms();
+   if(header.parseStream(in))
+   {
+      ossim_uint32 numberOfResLevels = header.getNumberOfResLevels();
+      
+      if(numberOfResLevels)
+      {
+         theHistogramList.resize(numberOfResLevels);
+
+         for(ossim_uint32 counter = 0; counter < (ossim_uint32)theHistogramList.size(); ++counter)
+         {
+            theHistogramList[counter] = NULL;
+         }
+         ossimString reslevelBuffer;
+         ossimString buffer;
+         
+         for(ossim_uint32 idx = 0; idx < numberOfResLevels; ++idx)
+         {
+            getline(in, buffer);
+            if(buffer.find("RR Level") != string::npos)
+            {
+               std::string::size_type offset = buffer.find(":");
+               if(offset != string::npos)
+               {
+                  reslevelBuffer = buffer.substr(offset+1);
+               }
+               else
+               {
+                  deleteHistograms();
+                  return false;
+               }
+            }
+            else
+            {
+               deleteHistograms();
+               return false;
+            }
+            ossim_uint32 resLevelIdx = reslevelBuffer.toUInt32();
+
+            if(resLevelIdx < (ossim_uint32)theHistogramList.size())
+            {
+               if(!theHistogramList[resLevelIdx])
+               {
+                  ossimRefPtr<ossimMultiBandHistogram> histogram = new ossimMultiBandHistogram;
+                  if(histogram->importHistogram(in))
+                  {
+                     theHistogramList[resLevelIdx] = histogram;
+                  }
+                  else
+                  {
+                     deleteHistograms();
+                     return false;
+                  }
+               }
+            }
+            else
+            {
+               deleteHistograms();
+               return false;
+            }
+            ossimString skipDot;
+            getline(in, skipDot);
+         }
+      }
+      else
+      {
+         return false;
+      }
+   }  
+
+   return true;
+}
+
+bool ossimMultiResLevelHistogram::importHistogram(const ossimFilename& file)
+{
+   //---
+   // File size check removed for s3
+   // if( file.fileSize() > 0 )
+   // {
+   //    theHistogramFile = file;
+   
+   bool result = false;
+   std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file, std::ios_base::in );
+   if ( in )
+   {
+      result = importHistogram( *in );
+      if ( result )
+      {
+         theHistogramFile = file;
+      }
+   }
+   return result;
+}
+
+bool ossimMultiResLevelHistogram::ossimProprietaryHeaderInformation::parseStream(std::istream& in)
+{
+   ossimString inputLine;
+
+   getline(in, inputLine);  
+   if(inputLine.find("File Type") != string::npos)
+   {
+      std::string::size_type idx = inputLine.find(":");
+      if(idx != string::npos)
+      {
+         theFileType = inputLine.substr(idx+1);
+         theFileType = theFileType.trim();
+      }
+      else
+      {
+         return false;
+      }
+
+   }
+   else
+   {
+      return false;
+   }
+
+   getline(in, inputLine);  
+   if(inputLine.find("Version") != string::npos)
+   {
+      std::string::size_type idx = inputLine.find(":");
+      if(idx != string::npos)
+      {
+         theVersion = inputLine.substr(idx+1);
+         theVersion = theVersion.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+
+   getline(in, inputLine);  
+   if(inputLine.find("Creator ID") != string::npos)
+   {
+      std::string::size_type idx = inputLine.find(":");
+      if(idx != string::npos)
+      {
+         theCreatorId = inputLine.substr(idx+1);
+         theCreatorId = theCreatorId.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+   
+   getline(in, inputLine);  
+   if(inputLine.find("RR Levels") != string::npos)
+   {
+      std::string::size_type idx = inputLine.find(":");
+      if(idx != string::npos)
+      {
+         theNumberOfResLevels = inputLine.substr(idx+1);
+         theNumberOfResLevels = theNumberOfResLevels.trim();
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+   
+   return true;
+}
+
+bool ossimMultiResLevelHistogram::saveState(ossimKeywordlist& kwl,
+                                            const char* prefix)const
+{
+   bool result = true;
+   if(theHistogramList.size() > 0)
+   {
+      ossimString s1 = prefix;
+      kwl.add(prefix,
+              ossimKeywordNames::TYPE_KW,
+              "ossimMultiResLevelHistogram",
+              true);
+      kwl.add(prefix,
+              NUMBER_OF_RES_LEVELS.key(),
+              static_cast<ossim_uint32>(theHistogramList.size()),
+              true);
+
+      for(ossim_uint32 idx = 0; idx < theHistogramList.size(); ++idx)
+      {
+         ossimString rr_level = ossimString(prefix) + "rr_level";
+         rr_level += ossimString::toString(idx)   + ".";
+         if(theHistogramList[idx].valid())
+         {
+            result = theHistogramList[idx]->saveState(kwl, rr_level.c_str());
+            
+            if(!result)
+            {
+               return result;
+            }
+         }
+      }    
+   }
+
+   return result;
+}
+
+bool ossimMultiResLevelHistogram::loadState(const ossimKeywordlist& kwl,
+                                            const char* prefix)
+{
+   deleteHistograms();
+   const char* number_of_res_levels = kwl.find(prefix, NUMBER_OF_RES_LEVELS.key());
+
+   if(number_of_res_levels)
+   {
+      ossim_uint32 numberOfResLevels = ossimString(number_of_res_levels).toUInt32();
+
+      if(numberOfResLevels)
+      {
+         ossimString newPrefix;
+         for(ossim_uint32 idx = 0; idx < numberOfResLevels; ++idx)
+         {
+            ossimRefPtr<ossimMultiBandHistogram> histo = new ossimMultiBandHistogram;
+
+            if (prefix) newPrefix = prefix;
+            
+            newPrefix += "rr_level";
+            newPrefix += ossimString::toString(idx);
+            newPrefix += ".";
+            
+            histo->loadState(kwl, newPrefix.c_str());
+            
+            theHistogramList.push_back(histo);
+         }
+      }
+   }
+   return true;
+}
+
+ossimFilename ossimMultiResLevelHistogram::getHistogramFile() const
+{
+   return theHistogramFile;
+}
diff --git a/ossim/src/ossim/base/ossimNBandLutDataObject.cpp b/src/base/ossimNBandLutDataObject.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimNBandLutDataObject.cpp
rename to src/base/ossimNBandLutDataObject.cpp
diff --git a/ossim/src/ossim/base/ossimNadconGridDatum.cpp b/src/base/ossimNadconGridDatum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimNadconGridDatum.cpp
rename to src/base/ossimNadconGridDatum.cpp
diff --git a/ossim/src/ossim/base/ossimNadconGridFile.cpp b/src/base/ossimNadconGridFile.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimNadconGridFile.cpp
rename to src/base/ossimNadconGridFile.cpp
diff --git a/ossim/src/ossim/base/ossimNadconGridHeader.cpp b/src/base/ossimNadconGridHeader.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimNadconGridHeader.cpp
rename to src/base/ossimNadconGridHeader.cpp
diff --git a/ossim/src/ossim/base/ossimNadconNarDatum.cpp b/src/base/ossimNadconNarDatum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimNadconNarDatum.cpp
rename to src/base/ossimNadconNarDatum.cpp
diff --git a/ossim/src/ossim/base/ossimNadconNasDatum.cpp b/src/base/ossimNadconNasDatum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimNadconNasDatum.cpp
rename to src/base/ossimNadconNasDatum.cpp
diff --git a/src/base/ossimNormRgbVector.cpp b/src/base/ossimNormRgbVector.cpp
new file mode 100644
index 0000000..30a8086
--- /dev/null
+++ b/src/base/ossimNormRgbVector.cpp
@@ -0,0 +1,183 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License: LGPL
+// Author: Garrett Potts 
+// Description:
+//
+//*************************************************************************
+// $Id: ossimNormRgbVector.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/base/ossimNormRgbVector.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimJpegYCbCrVector.h>
+#include <ossim/base/ossimHsiVector.h>
+#include <ossim/base/ossimHsvVector.h>
+#include <ossim/base/ossimCmyVector.h>
+#include <ossim/base/ossimCommon.h>
+#include <math.h>
+
+ossimNormRgbVector::ossimNormRgbVector(const ossimRgbVector& rgb)
+{
+   theBuf[0] = rgb.getR()/255.0;
+   theBuf[1] = rgb.getG()/255.0;
+   theBuf[2] = rgb.getB()/255.0;
+}
+
+ossimNormRgbVector::ossimNormRgbVector(const ossimJpegYCbCrVector& YCbCr)
+{
+   (*this) = YCbCr;
+   
+}
+
+ossimNormRgbVector::ossimNormRgbVector(const ossimHsiVector& hsi)
+{
+   (*this)=hsi;
+}
+
+ossimNormRgbVector::ossimNormRgbVector(const ossimHsvVector& hsv)
+{
+   (*this) = hsv;
+}
+
+ossimNormRgbVector::ossimNormRgbVector(const ossimCmyVector& cmy)
+{
+   theBuf[0] = 255 - cmy.getC();
+   theBuf[1] = 255 - cmy.getM();
+   theBuf[2] = 255 - cmy.getY();
+}
+
+const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimHsvVector& hsv)
+{
+   // H is given on [0, 6] or UNDEFINED. S and V are given on [0, 1]. 
+   // RGB are each returned on [0, 1]. 
+   float h = hsv.getH(), // unnormalize it
+         s = hsv.getS(),
+         v = hsv.getV();
+   float m, n, f; 
+   int i; 
+   if(h == ossimHsvVector::OSSIM_HSV_UNDEFINED)
+   {
+      theBuf[0] = clamp(v);
+      theBuf[1] = clamp(v);
+      theBuf[2] = clamp(v);
+   }
+   else
+   {
+      h*=6.0; // unnormalize h
+      i = (int)floor(h); 
+      f = h - i; 
+      if(!(i & 1)) f = 1 - f; // if i is even 
+      m = v * (1 - s); 
+      n = v * (1 - s * f); 
+      switch (i)
+      { 
+      case 6: 
+      case 0:
+      {
+         theBuf[0] = clamp(v);
+         theBuf[1] = clamp(n);
+         theBuf[2] = clamp(m);
+         break;
+      }
+      case 1:
+      {
+         theBuf[0] = clamp(n);
+         theBuf[1] = clamp(v);
+         theBuf[2] = clamp(m);
+         break;
+      }
+      case 2:
+      {
+         theBuf[0] = clamp(m);
+         theBuf[1] = clamp(v);
+         theBuf[2] = clamp(n);
+         break;
+      }
+      case 3: 
+      {
+         theBuf[0] = clamp(m);
+         theBuf[1] = clamp(n);
+         theBuf[2] = clamp(v);
+         break;
+      }
+      case 4:
+      {
+         theBuf[0] = clamp(n);
+         theBuf[1] = clamp(m);
+         theBuf[2] = clamp(v);
+         break;
+      }
+      case 5: 
+      {
+         theBuf[0] = clamp(v);
+         theBuf[1] = clamp(m);
+         theBuf[2] = clamp(n);
+         break;
+      }
+      }
+   }
+   return *this;
+}
+
+const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimJpegYCbCrVector& YCbCr)
+{
+   theBuf[0] = clamp((YCbCr.getY() +
+                      1.402 * (YCbCr.getCr()-128.0))/255.0);
+   theBuf[1] = clamp((YCbCr.getY() -
+                      0.34414 *(YCbCr.getCb()-128.0) -
+                      0.71414*(YCbCr.getCr()-128.0))/255.0);
+   theBuf[2] = clamp((YCbCr.getY() +
+                      1.772 * ( YCbCr.getCb()-128.0))/255.0);
+
+   return *this;
+}
+
+const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimHsiVector& hsi)
+{
+   ossim_float32 h = hsi.getH();
+   ossim_float32 s = hsi.getS();
+   ossim_float32 i = hsi.getI();
+
+   ossim_float32 r=0;
+   ossim_float32 g=0;
+   ossim_float32 b=0;
+   
+   if(h <= 120.0)
+   {
+      b = i*(1-s);
+
+      r = i*(1 + s*cos(RAD_PER_DEG*h)/cos((60-h)*RAD_PER_DEG));
+      g = 3*i - (r+b);
+   }
+    else if(h <= 240.0)
+    {
+       h-=120;
+
+       r = i*(1-s);
+       g = i*(1 + s*cos(RAD_PER_DEG*h)/cos((60-h)*RAD_PER_DEG));
+       b = 3*i - (r+g);
+    }
+    else if(h <= 360.0)
+    {
+       h-=240;
+
+       g = i*(1-s);
+       b = i*(1 + s*cos(RAD_PER_DEG*h)/cos((60-h)*RAD_PER_DEG));
+       r = 3*i - (g+b);      
+    }
+   
+   theBuf[0] = clamp(r);
+   theBuf[1] = clamp(g);
+   theBuf[2] = clamp(b);
+   
+   return *this;
+}
+
+const ossimNormRgbVector& ossimNormRgbVector::operator =(const ossimCmyVector& cmy)
+{
+   theBuf[0] = (255 - cmy.getC())/255.0;
+   theBuf[1] = (255 - cmy.getM())/255.0;
+   theBuf[2] = (255 - cmy.getY())/255.0;
+
+   return *this;
+}
diff --git a/ossim/src/ossim/base/ossimNotify.cpp b/src/base/ossimNotify.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimNotify.cpp
rename to src/base/ossimNotify.cpp
diff --git a/src/base/ossimNumericProperty.cpp b/src/base/ossimNumericProperty.cpp
new file mode 100644
index 0000000..efe86b3
--- /dev/null
+++ b/src/base/ossimNumericProperty.cpp
@@ -0,0 +1,209 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+//
+//*************************************************************************
+// $Id: ossimNumericProperty.cpp 9963 2006-11-28 21:11:01Z gpotts $
+#include <algorithm>
+#include <ossim/base/ossimNumericProperty.h>
+
+
+RTTI_DEF1(ossimNumericProperty, "ossimNumericProperty", ossimProperty);
+
+ossimNumericProperty::ossimNumericProperty(const ossimString& name,
+                                           const ossimString& value)
+   :ossimProperty(name),
+    theValue(value),
+    theType(ossimNumericPropertyType_FLOAT64)
+{
+}
+
+ossimNumericProperty::ossimNumericProperty(const ossimString& name,
+                                           const ossimString& value,
+                                           double minValue,
+                                           double maxValue)
+   :ossimProperty(name),
+    theValue(value),
+    theType(ossimNumericPropertyType_FLOAT64)
+{
+   setConstraints(minValue,
+                  maxValue);
+}
+
+ossimNumericProperty::ossimNumericProperty(const ossimNumericProperty& rhs)
+   :ossimProperty(rhs),
+    theValue(rhs.theValue),
+    theType(rhs.theType),
+    theRangeConstraint(rhs.theRangeConstraint)
+{
+}
+
+ossimObject* ossimNumericProperty::dup()const
+{
+   return new ossimNumericProperty(*this);
+}
+
+const ossimProperty& ossimNumericProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+
+   const ossimNumericProperty* numericProperty = dynamic_cast<const ossimNumericProperty*>(&rhs);
+   if(numericProperty)
+   {
+      theValue           = numericProperty->theValue;
+      theType            = numericProperty->theType;
+      theRangeConstraint = numericProperty->theRangeConstraint;
+   }
+   else
+   {
+      ossimString value;
+      rhs.valueToString(value);
+      setValue(value);
+   }
+   return *this;
+}
+
+bool ossimNumericProperty::hasConstraints()const
+{
+   return (theRangeConstraint.size() == 2);
+}
+
+double ossimNumericProperty::getMinValue()const
+{
+   if(hasConstraints())
+   {
+      return theRangeConstraint[0];
+   }
+
+   return 0.0;
+}
+
+double ossimNumericProperty::getMaxValue()const
+{
+   if(hasConstraints())
+   {
+      return theRangeConstraint[1];
+   }
+
+   return 0.0;
+}
+
+void ossimNumericProperty::clearConstraints()
+{
+   theRangeConstraint.clear();
+}
+
+void ossimNumericProperty::setConstraints(double minValue,
+                                          double maxValue)
+{
+   theRangeConstraint.resize(2);
+   theRangeConstraint[0] = minValue;
+   theRangeConstraint[1] = maxValue;
+
+   if(minValue > maxValue)
+   {
+      std::swap(theRangeConstraint[0],
+                theRangeConstraint[1]);
+   }
+}
+
+bool ossimNumericProperty::setValue(const ossimString& value)
+{
+   bool result = true;
+   if(hasConstraints())
+   {
+      ossim_float64 tempV = (ossim_float64)value.toDouble();
+      if((tempV >= theRangeConstraint[0])&&
+         (tempV <= theRangeConstraint[1]))
+      {
+         theValue = value;
+      }
+   }
+   else
+   {
+     theValue = value;
+   }
+
+   return result;
+}
+
+void ossimNumericProperty::valueToString(ossimString& valueResult)const
+{
+   switch(theType)
+   {
+   case ossimNumericPropertyType_INT:
+   {
+      valueResult = ossimString::toString(asInt32());
+      break;
+   }
+   case ossimNumericPropertyType_UINT:
+   {
+      valueResult = ossimString::toString(asUInt32());
+      break;
+   }
+   case ossimNumericPropertyType_FLOAT32:
+   {
+      valueResult = ossimString::toString(asFloat32());
+      
+      break;
+   }
+   case ossimNumericPropertyType_FLOAT64:
+   {
+      valueResult = ossimString::toString(asFloat64());
+      break;
+   }
+   };
+}
+
+
+ossimNumericProperty::ossimNumericPropertyType ossimNumericProperty::getNumericType()const
+{
+   return theType;
+}
+
+void ossimNumericProperty::setNumericType(ossimNumericPropertyType type)
+{
+   theType = type;
+}
+
+ossim_float64 ossimNumericProperty::asFloat64()const
+{
+   return (ossim_float64)theValue.toDouble();
+}
+
+ossim_float32 ossimNumericProperty::asFloat32()const
+{
+   return (ossim_float32)theValue.toDouble();
+}
+
+ossim_uint32  ossimNumericProperty::asUInt32()const
+{
+   return theValue.toUInt32();
+}
+
+ossim_uint16 ossimNumericProperty::asUInt16()const
+{
+   return (ossim_uint16)theValue.toUInt32();
+}
+
+ossim_uint8 ossimNumericProperty::asUInt8()const
+{
+   return (ossim_uint8)theValue.toUInt32();
+}
+
+ossim_sint32 ossimNumericProperty::asInt32()const
+{
+   return (ossim_int32)theValue.toInt32();
+}
+
+ossim_sint16 ossimNumericProperty::asInt16()const
+{
+   return (ossim_int16)theValue.toInt32();
+}
+
+ossim_sint8 ossimNumericProperty::asInt8()const
+{
+   return (ossim_int8)theValue.toInt32();
+}
diff --git a/src/base/ossimObject.cpp b/src/base/ossimObject.cpp
new file mode 100644
index 0000000..60843e6
--- /dev/null
+++ b/src/base/ossimObject.cpp
@@ -0,0 +1,132 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimObject.cpp 20070 2011-09-07 18:48:35Z dburken $
+#include <ossim/base/ossimObject.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimVisitor.h>
+
+RTTI_DEF(ossimObject, "ossimObject")
+
+ossimObject::ossimObject()
+{}
+
+ossimObject::~ossimObject()
+{
+}
+   
+ossimObject* ossimObject::dup()const
+{
+   ossimObject* result = NULL;
+   ossimKeywordlist kwl;
+
+   saveState(kwl);
+   
+   result = ossimObjectFactoryRegistry::instance()->createObject(kwl);
+
+   if(!result)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "dup() not implemented for object = "
+         << getClassName() << ". Please implement!\n";
+   }
+   
+   return result;
+}
+
+ossimString ossimObject::getShortName()const
+{
+   return getClassName();
+}
+
+ossimString ossimObject::getLongName()const
+{
+   return getClassName();
+}
+
+ossimString ossimObject::getDescription()const
+{
+   return getLongName();
+}
+
+
+ossimString ossimObject::getClassName()const
+{
+   return TYPE_NAME(this);
+}
+
+RTTItypeid ossimObject::getType()const
+{
+   return TYPE_INFO(this);
+}
+
+bool ossimObject::canCastTo(ossimObject* obj)const
+{
+   if(obj)
+   {
+      return obj->getType().can_cast(this->getType());
+   }
+   
+   return false;
+}
+
+bool ossimObject::canCastTo(const ossimString& parentClassName)const
+{
+   return (getType().find_baseclass(parentClassName.c_str()) !=
+           getType().null_type());
+}
+
+bool ossimObject::canCastTo(const RTTItypeid& id)const
+{
+   return id.can_cast(this->getType());
+}
+
+bool ossimObject::saveState(ossimKeywordlist& kwl,
+                            const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           getClassName(),
+           true);
+
+   return true;
+}
+
+bool ossimObject::isEqualTo(const ossimObject& obj, ossimCompareType /* compareType */)const
+{
+   return (getClassName() == obj.getClassName());
+}
+
+void ossimObject::accept(ossimVisitor& visitor)
+{
+   if(!visitor.stopTraversal()&&!visitor.hasVisited(this))
+   {
+      visitor.visit(this);
+   }
+}
+
+bool ossimObject::loadState(const ossimKeywordlist&, const char*)
+{
+   return true;
+}
+
+std::ostream& ossimObject::print(std::ostream& out) const
+{
+   return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimObject& obj)
+{
+   return obj.print(out);
+}
diff --git a/ossim/src/ossim/base/ossimObjectDestructingEvent.cpp b/src/base/ossimObjectDestructingEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimObjectDestructingEvent.cpp
rename to src/base/ossimObjectDestructingEvent.cpp
diff --git a/ossim/src/ossim/base/ossimObjectFactory.cpp b/src/base/ossimObjectFactory.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimObjectFactory.cpp
rename to src/base/ossimObjectFactory.cpp
diff --git a/ossim/src/ossim/base/ossimObjectFactoryRegistry.cpp b/src/base/ossimObjectFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimObjectFactoryRegistry.cpp
rename to src/base/ossimObjectFactoryRegistry.cpp
diff --git a/ossim/src/ossim/base/ossimObservationSet.cpp b/src/base/ossimObservationSet.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimObservationSet.cpp
rename to src/base/ossimObservationSet.cpp
diff --git a/ossim/src/ossim/base/ossimOutputSource.cpp b/src/base/ossimOutputSource.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimOutputSource.cpp
rename to src/base/ossimOutputSource.cpp
diff --git a/ossim/src/ossim/base/ossimPackedBits.cpp b/src/base/ossimPackedBits.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimPackedBits.cpp
rename to src/base/ossimPackedBits.cpp
diff --git a/ossim/src/ossim/base/ossimPointObservation.cpp b/src/base/ossimPointObservation.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimPointObservation.cpp
rename to src/base/ossimPointObservation.cpp
diff --git a/src/base/ossimPolyArea2d.cpp b/src/base/ossimPolyArea2d.cpp
new file mode 100644
index 0000000..eaaf643
--- /dev/null
+++ b/src/base/ossimPolyArea2d.cpp
@@ -0,0 +1,861 @@
+//---
+// License:  See top level LICENSE.txt file.
+//
+// $Id: ossimPolyArea2d.cpp 23623 2015-11-13 18:24:28Z gpotts $
+//---
+
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <geos/geom/Coordinate.h>
+#include <geos/geom/CoordinateArraySequence.h>
+#include <geos/geom/GeometryFactory.h>
+#include <geos/geom/LinearRing.h>
+#include <geos/opBuffer.h>
+#include <geos/geom/Point.h>
+#include <geos/geom/Polygon.h>
+#include <geos/geom/MultiPolygon.h>
+#include <geos/geom/PrecisionModel.h>
+#include <geos/io/WKTReader.h>
+#include <geos/io/WKTWriter.h>
+#include <geos/util/GEOSException.h>
+#include <geos/operation/valid/IsValidOp.h>
+#include <geos/opBuffer.h>
+#include <cstdlib>
+#include <exception>
+#include <vector>
+
+class MyGeomFactory : public geos::geom::GeometryFactory
+{
+public:
+   MyGeomFactory():
+   geos::geom::GeometryFactory(new geos::geom::PrecisionModel(geos::geom::PrecisionModel::FLOATING),
+                             -1)
+   {
+
+   }
+}; 
+class ossimGeometryFactoryWrapper : public ossimReferenced
+{
+public:
+   ossimGeometryFactoryWrapper()
+      : m_geomFactory(0)
+   {
+      //geos::geom::PrecisionModel *pm =
+      //   new geos::geom::PrecisionModel(geos::geom::PrecisionModel::FLOATING);
+      m_geomFactory = new MyGeomFactory();//new geos::geom::GeometryFactory(pm, -1); 
+   }
+   virtual ~ossimGeometryFactoryWrapper(){if(m_geomFactory) delete m_geomFactory;m_geomFactory=0;}
+   
+   MyGeomFactory* m_geomFactory;
+};
+
+class OssimPolyArea2dPrivate
+{
+public:
+   typedef geos::geom::Geometry* GeometryPtr;
+   typedef const geos::geom::Geometry* ConstGeometryPtr;
+   
+   OssimPolyArea2dPrivate(GeometryPtr geom=0);
+   ~OssimPolyArea2dPrivate();
+   
+   void deleteGeometry() { if(m_geometry) { delete m_geometry; m_geometry = 0; }}
+   void setGeometry(const ossimPolygon& polygon, const vector<ossimPolygon>& holes = vector<ossimPolygon>());
+   void setGeometry(GeometryPtr geom){deleteGeometry();m_geometry=geom;}
+   geos::geom::GeometryFactory* geomFactory(){{return m_globalFactory.valid()?m_globalFactory->m_geomFactory:0;}}
+   GeometryPtr m_geometry;
+   static ossimRefPtr<ossimGeometryFactoryWrapper> m_globalFactory; 
+};
+
+ossimRefPtr<ossimGeometryFactoryWrapper> OssimPolyArea2dPrivate::m_globalFactory;
+
+OssimPolyArea2dPrivate::OssimPolyArea2dPrivate(GeometryPtr geom)
+:m_geometry(geom)
+{
+   static OpenThreads::Mutex globalFactoryMutex;
+   
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(globalFactoryMutex);
+      if(!m_globalFactory.valid())
+      {
+         m_globalFactory = new ossimGeometryFactoryWrapper();
+      }    
+   }
+}
+
+OssimPolyArea2dPrivate::~OssimPolyArea2dPrivate()
+{
+   deleteGeometry();
+}
+
+void OssimPolyArea2dPrivate::setGeometry(
+   const ossimPolygon& exteriorRing, const vector<ossimPolygon>& interiorRings)
+{
+   deleteGeometry();
+   
+   geos::geom::CoordinateArraySequence *cas = new geos::geom::CoordinateArraySequence();
+   
+   const std::vector<ossimDpt>& pts = exteriorRing.getVertexList();
+
+   int idx = 0;
+   int n = (int)pts.size();
+   
+   if(n > 0)
+   {
+      //fill the exterior ring
+      for (idx = 0; idx < n; idx++)
+      {
+         cas->add(geos::geom::Coordinate(pts[idx].x, pts[idx].y));
+      }
+      
+      //if the original polygon didn't have the first and last point the same, make it so
+      if((pts[0].x != pts[n-1].x) || (pts[0].y!=pts[n-1].y))
+      {
+         cas->add(geos::geom::Coordinate(pts[0].x, pts[0].y));
+      }
+      
+      //fill the interior rings
+      vector<geos::geom::Geometry*> *holes = new vector<geos::geom::Geometry*>();
+      for (ossim_uint32 interiorRingIdx = 0; interiorRingIdx < interiorRings.size(); ++interiorRingIdx)
+      {
+         geos::geom::CoordinateArraySequence *interiorCas =
+            new geos::geom::CoordinateArraySequence();
+         const std::vector<ossimDpt>& vertexPts = interiorRings[interiorRingIdx].getVertexList();
+         for(ossim_uint32 vertexIndex=0; vertexIndex < vertexPts.size(); ++vertexIndex)
+         {
+            interiorCas->add(geos::geom::Coordinate(vertexPts[vertexIndex].x,
+                                                    vertexPts[vertexIndex].y));
+         }
+         
+         //if the original polygon didn't have the first and last point the same, make it so
+         if((vertexPts[0].x != vertexPts[vertexPts.size()-1].x) ||
+            (vertexPts[0].y!=vertexPts[vertexPts.size()-1].y))
+         {
+            interiorCas->add(geos::geom::Coordinate(vertexPts[0].x, vertexPts[0].y));
+         }
+         
+         geos::geom::LinearRing *hole = geomFactory()->createLinearRing(interiorCas);
+         holes->push_back(hole);
+      }
+      
+      geos::geom::LinearRing* shell = geomFactory()->createLinearRing(cas);
+      if ( shell )
+      {
+         m_geometry = geomFactory()->createPolygon(shell, holes);
+      }
+      else
+      {
+         m_geometry = 0;
+      }
+   }
+}
+
+void ossimPolyArea2d::recurseVisibleGeometries(
+   std::vector<ossimPolygon>& polyList, const geos::geom::Geometry* geom) const
+{
+   int nGeoms = (int)geom->getNumGeometries();
+   
+   if(nGeoms < 2 )
+   {
+      const geos::geom::Polygon* poly = dynamic_cast<const geos::geom::Polygon*> (geom);
+      
+      if (poly)
+      {
+         const geos::geom::LineString* lineString = dynamic_cast<const geos::geom::LineString*> (poly->getExteriorRing());
+         if (lineString)
+         {
+            int currentPolyIdx = (int)polyList.size();
+            int nPoints = (int)lineString->getNumPoints();
+            int idx = 0;
+            
+            polyList.push_back(ossimPolygon());
+            
+            for (idx=0; idx<nPoints; idx++)
+            {
+               std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
+               polyList[currentPolyIdx].addPoint(point->getX(), point->getY());
+            }
+         }
+      }
+   }
+   else
+   {
+      for (int idx=0; idx < nGeoms; ++idx)
+      {
+         recurseVisibleGeometries(polyList, geom->getGeometryN(idx));
+      }
+   }
+}
+
+void ossimPolyArea2d::recurseHoles(std::vector<ossimPolygon>& polyList,
+                                   const geos::geom::Geometry* geom) const
+{
+   int nGeoms = (int)geom->getNumGeometries();
+   
+   if(nGeoms < 2 )
+   {
+      const geos::geom::Polygon* poly = dynamic_cast<const geos::geom::Polygon*> (geom);
+
+      if (poly)
+      {
+         ossim_uint32 nInteriorRings = (ossim_uint32)poly->getNumInteriorRing();
+         ossim_uint32 idx = 0;
+         
+         for(idx = 0; idx < nInteriorRings; ++idx)
+         {
+            const geos::geom::LineString* lineString = poly->getInteriorRingN(idx);
+            if (lineString)
+            {
+               int currentPolyIdx = (int)polyList.size();
+               int nPoints = (int)lineString->getNumPoints();
+               int idx = 0;
+
+               polyList.push_back(ossimPolygon());
+
+               for (idx=0; idx<nPoints; idx++)
+               {
+                  std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
+                  polyList[currentPolyIdx].addPoint(point->getX(), point->getY());
+               }
+            }
+         }
+      }
+   }
+   else
+   {
+      int idx = 0;
+      
+      for (idx=0; idx < nGeoms; idx++)
+      {
+         recurseHoles(polyList, geom->getGeometryN(idx));
+      }
+   }
+}
+
+void ossimPolyArea2d::recurseCompleteGeometries(std::vector<ossimPolyArea2d>& polyList,
+                                                const geos::geom::Geometry* geom) const
+{
+   int nGeoms = (int)geom->getNumGeometries();
+   if(nGeoms < 2 )
+   {
+      const geos::geom::Polygon* poly = dynamic_cast<const geos::geom::Polygon*> (geom);
+
+      if (poly)
+      {
+         //get exterior shell for the geometry
+         ossimPolygon shell;
+         const geos::geom::LineString* lineString =
+            dynamic_cast<const geos::geom::LineString*> (poly->getExteriorRing());
+         if (lineString)
+         {
+            int nPoints = (int)lineString->getNumPoints();
+            for (int idx = 0; idx<nPoints; idx++)
+            {
+               std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
+               shell.addPoint(point->getX(), point->getY());
+            }
+         }
+         
+         // Get interior rings for the geometry.
+         std::size_t nInteriorRings = poly->getNumInteriorRing();
+         vector<ossimPolygon> holes(nInteriorRings);
+         for(std::size_t holeIdx = 0; holeIdx < nInteriorRings; ++holeIdx)
+         {
+            const geos::geom::LineString* lineString = poly->getInteriorRingN(holeIdx);
+            if (lineString)
+            {
+               std::size_t nPoints = lineString->getNumPoints();
+               for (std::size_t idx = 0; idx<nPoints; ++idx)
+               {
+                  std::auto_ptr<const geos::geom::Point> point(lineString->getPointN(idx));
+                  holes[holeIdx].addPoint(point->getX(), point->getY());
+               }
+            }
+         }
+         polyList.push_back(ossimPolyArea2d(shell, holes));
+      }
+   }
+   else
+   {
+      int idx = 0;
+      
+      for (idx=0; idx < nGeoms; idx++)
+      {
+         recurseCompleteGeometries(polyList, geom->getGeometryN(idx));
+      }
+   }
+}
+
+std::ostream& operator <<(std::ostream& out, const ossimPolyArea2d& rhs)
+{
+   if(rhs.m_privateData->m_geometry)
+   {
+      out << rhs.m_privateData->m_geometry->toString();
+   }
+   return out;
+}
+
+ossimPolyArea2d::ossimPolyArea2d()
+   :m_privateData(new OssimPolyArea2dPrivate)
+{
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const vector<ossimGpt>& polygon)
+   :m_privateData(new OssimPolyArea2dPrivate)
+{
+   (*this) = polygon;
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const vector<ossimDpt>& polygon)
+   :m_privateData(new OssimPolyArea2dPrivate)
+{
+   (*this) = polygon;
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const ossimIrect& rect)
+   :m_privateData(new OssimPolyArea2dPrivate)
+{
+   (*this) = rect;
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const ossimDrect& rect)
+   :m_privateData(new OssimPolyArea2dPrivate)
+{
+   (*this) = rect;
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const ossimPolygon& polygon)
+   :m_privateData(new OssimPolyArea2dPrivate)
+{
+   (*this) = polygon;
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const ossimPolygon& exteriorRing, const vector<ossimPolygon>& interiorRings)
+   :m_privateData(new OssimPolyArea2dPrivate)
+{	
+	m_privateData->setGeometry(exteriorRing, interiorRings);
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const ossimPolyArea2d& rhs)
+   :m_privateData(new OssimPolyArea2dPrivate) 
+{
+   *this = rhs;
+}
+
+ossimPolyArea2d::ossimPolyArea2d(const ossimDpt& p1,
+                                 const ossimDpt& p2,
+                                 const ossimDpt& p3,
+                                 const ossimDpt& p4)
+   :
+   m_privateData(new OssimPolyArea2dPrivate)
+{
+   ossimPolygon temp(p1,p2,p3,p4);
+   *this = temp;
+}
+
+ossimPolyArea2d::~ossimPolyArea2d()
+{
+   if(m_privateData)
+   {
+      delete m_privateData;
+      m_privateData = 0;
+   }
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimPolyArea2d& rhs)
+{ 
+   if(this != &rhs)
+   {
+      if(rhs.m_privateData->m_geometry)
+      {
+         m_privateData->setGeometry(rhs.m_privateData->m_geometry->clone());
+      }
+   }
+   return *this;
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimPolygon& polygon)
+{
+   m_privateData->setGeometry(polygon);
+
+   return *this;
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimIrect& rect)
+{
+   return (*this = ossimPolygon(rect));
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator =(const ossimDrect& rect)
+{
+   return (*this = ossimPolygon(rect));
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator =(const vector<ossimGpt>& polygon)
+{
+   std::vector<ossimDpt> pts;
+   int idx = 0;
+   int n = (int)polygon.size();
+   for(idx = 0; idx < n;++idx)
+   {
+      pts.push_back(polygon[idx]);
+   }
+  
+   return (*this = ossimPolygon(pts));
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator =(const vector<ossimDpt>& polygon)
+{
+   return (*this = ossimPolygon(polygon));
+}
+
+bool ossimPolyArea2d::intersects(const ossimPolyArea2d& rhs)const
+{
+   bool result = false;
+
+   if(m_privateData->m_geometry&&rhs.m_privateData->m_geometry)
+   {
+      result = m_privateData->m_geometry->intersects(rhs.m_privateData->m_geometry); 
+   }
+
+   return result;
+}
+
+ossimPolyArea2d ossimPolyArea2d::operator &(const ossimPolyArea2d& rhs)const
+{
+   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
+   {
+      ossimPolyArea2d result;
+      try // GEOS code throws exceptions...
+      {
+         result.m_privateData->setGeometry(m_privateData->m_geometry->intersection(
+                                              rhs.m_privateData->m_geometry));
+      }
+      catch( const std::exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator& Caught exception: " << e.what() << std::endl;
+         result.clearPolygons();
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator& Caught exception!" << std::endl;
+         result.clearPolygons();
+      }
+      return result;
+   }
+   return *this;
+}
+
+ossimPolyArea2d ossimPolyArea2d::operator +(const ossimPolyArea2d& rhs)const
+{
+   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
+   {
+      ossimPolyArea2d result;
+      try // GEOS code throws exceptions...
+      {
+         result.m_privateData->setGeometry(m_privateData->m_geometry->Union(
+                                              rhs.m_privateData->m_geometry));
+      }  
+      catch( const std::exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator+ Caught exception: " << e.what() << std::endl;
+         result.clearPolygons();
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator+ Caught exception!" << std::endl;
+         result.clearPolygons();
+      }
+      return result;
+   }
+   return *this;
+}
+ossimPolyArea2d ossimPolyArea2d::operator -(const ossimPolyArea2d& rhs)const
+{
+   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
+   {
+      ossimPolyArea2d result;
+      try // GEOS code throws exceptions...
+      {
+         result.m_privateData->setGeometry(m_privateData->m_geometry->difference(
+                                              rhs.m_privateData->m_geometry));
+      }
+      catch( const std::exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator- Caught exception: " << e.what() << std::endl;
+         result.clearPolygons();
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator- Caught exception!" << std::endl;
+         result.clearPolygons();
+      }
+      return result;
+   }
+   return *this;
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator &=(const ossimPolyArea2d& rhs)
+{
+   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
+   {
+      try // GEOS code throws exceptions...
+      {
+         m_privateData->setGeometry(m_privateData->m_geometry->intersection(
+                                       rhs.m_privateData->m_geometry));
+      }
+      catch( const std::exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator&= Caught exception: " << e.what() << std::endl;
+         this->clearPolygons();
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator&= Caught exception!" << std::endl;
+         this->clearPolygons();
+      }      
+   }
+   return *this;
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator +=(const ossimPolyArea2d& rhs)
+{
+   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
+   {
+      try // GEOS code throws exceptions...
+      {
+         m_privateData->setGeometry(m_privateData->m_geometry->Union(
+                                       rhs.m_privateData->m_geometry));
+      }
+      catch( const std::exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator+= Caught exception: " << e.what() << std::endl;
+         this->clearPolygons();
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator+= Caught exception!" << std::endl;
+         this->clearPolygons();
+      }      
+   }
+   return *this;
+}
+
+const ossimPolyArea2d& ossimPolyArea2d::operator -=(const ossimPolyArea2d& rhs)
+{
+   if((this!=&rhs) && m_privateData->m_geometry && rhs.m_privateData->m_geometry)
+   {
+      try // GEOS code throws exceptions...
+      {
+         m_privateData->setGeometry(m_privateData->m_geometry->difference(
+                                       rhs.m_privateData->m_geometry));
+      }
+      catch( const std::exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator-= Caught exception: " << e.what() << std::endl;
+         this->clearPolygons();
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPolyArea2d::operator-= Caught exception!" << std::endl;
+         this->clearPolygons();
+      }      
+   }
+   return *this;
+}
+
+void ossimPolyArea2d::add(const ossimPolyArea2d& rhs)
+{
+   if(isEmpty())
+   {
+      *this=rhs;
+   }
+   else
+   {
+      geos::geom::Geometry* geom = m_privateData->m_geometry->Union(rhs.m_privateData->m_geometry);
+      if(geom) m_privateData->setGeometry(geom);
+   }
+}
+
+void ossimPolyArea2d::clearPolygons()
+{
+   m_privateData->deleteGeometry();
+#if 0
+   clearEngine();
+#endif
+}
+
+bool ossimPolyArea2d::getVisiblePolygons(vector<ossimPolygon>& polyList)const
+{
+   bool foundPolys = false;
+   if(m_privateData->m_geometry)
+   {
+      ossim_uint32 sizeBefore = (ossim_uint32)polyList.size();
+      recurseVisibleGeometries(polyList, m_privateData->m_geometry);
+      foundPolys = (sizeBefore != polyList.size());
+   }
+
+   return foundPolys;
+}
+
+bool ossimPolyArea2d::getPolygonHoles(vector<ossimPolygon>& polyList)const
+{
+   bool foundPolys = false;
+   if(m_privateData->m_geometry)
+   {
+      ossim_uint32 sizeBefore = (ossim_uint32)polyList.size();
+      recurseHoles(polyList, m_privateData->m_geometry);
+      foundPolys = (sizeBefore != polyList.size());
+   }
+
+   return foundPolys;
+}
+
+bool ossimPolyArea2d::getCompletePolygons(vector<ossimPolyArea2d>& polyList)const
+{
+	bool foundPolys = false;
+	if(m_privateData->m_geometry){
+		ossim_uint32 sizeBefore = (ossim_uint32)polyList.size();
+		recurseCompleteGeometries(polyList, m_privateData->m_geometry);
+		foundPolys = (sizeBefore != polyList.size());
+	}
+	return foundPolys;
+}
+
+bool ossimPolyArea2d::isEmpty()const
+{
+   bool result = true;
+   if (m_privateData&&m_privateData->m_geometry)
+   {
+      result = m_privateData->m_geometry->isEmpty();
+   }
+
+   return result;
+}
+
+bool ossimPolyArea2d::isValid(bool displayValidationError)const
+{
+   bool result = false;
+   
+   if(m_privateData&&m_privateData->m_geometry)
+   {
+      if(displayValidationError)
+      {
+         geos::operation::valid::IsValidOp validityCheck(m_privateData->m_geometry);
+         geos::operation::valid::TopologyValidationError*
+            topologyValidationError(validityCheck.getValidationError());
+         // if(topologyValidationError == nullptr)
+         if(topologyValidationError == 0)
+         {
+            result = true;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_INFO)
+               << "ossimPolyArea2d::isValid: " << topologyValidationError->toString() << std::endl;
+         }
+      }
+      else
+      {
+         result = m_privateData->m_geometry->isValid();
+      }
+   }
+   
+   return result;
+}
+
+bool ossimPolyArea2d::isPointWithin(const ossimDpt& point)const
+{
+   return isPointWithin(point.x, point.y);
+}
+
+bool ossimPolyArea2d::isPointWithin(double x, double y)const
+{
+   bool result = false;
+
+   if(!isEmpty())
+   {
+      geos::geom::Coordinate c(x,y);
+      geos::geom::Geometry* geom = m_privateData->geomFactory()->createPoint(c);
+  
+      result = m_privateData->m_geometry->intersects(geom);
+
+      delete geom;
+   }
+
+   return result;
+}
+
+void ossimPolyArea2d::getBoundingRect(ossimDrect& rect)
+{
+   rect.makeNan();
+
+   if(!isEmpty())
+   {
+      const geos::geom::Envelope* envelope = m_privateData->m_geometry->getEnvelopeInternal();
+
+      rect = ossimDrect(envelope->getMinX(), envelope->getMinY(), envelope->getMaxX(), envelope->getMaxY());
+   }
+}
+
+std::string ossimPolyArea2d::toString()const
+{
+   std::string result = "";
+
+   if(m_privateData->m_geometry)
+   {
+      result = m_privateData->m_geometry->toString();
+   }
+
+   return result;
+}
+
+ossimPolyArea2d ossimPolyArea2d::getBufferedShape(double distance) const{
+	ossimPolyArea2d result;
+	try{
+		geos::operation::buffer::BufferOp buffer_operation(m_privateData->m_geometry);
+		result.m_privateData->setGeometry( buffer_operation.getResultGeometry(distance));
+	}catch( const std::exception& e ){
+		ossimNotify(ossimNotifyLevel_DEBUG)
+			<< "ossimPolyArea2d::getBufferedShape Caught exception: " << e.what() << std::endl;
+		result.clearPolygons();
+	}catch( ... ){
+		ossimNotify(ossimNotifyLevel_DEBUG)
+			<< "ossimPolyArea2d::getBufferedShape Caught exception!" << std::endl;
+		result.clearPolygons();
+	}
+	return result;
+}
+ossimPolyArea2d& ossimPolyArea2d::setToBufferedShape(double distance)
+{
+   try{
+      geos::operation::buffer::BufferOp buffer_operation(m_privateData->m_geometry);
+      m_privateData->setGeometry( buffer_operation.getResultGeometry(distance));
+   }catch( const std::exception& e ){
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPolyArea2d::getBufferedShape Caught exception: " << e.what() << std::endl;
+   }catch( ... ){
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPolyArea2d::getBufferedShape Caught exception!" << std::endl;
+   }
+   return *this;
+}
+
+ossimPolyArea2d& ossimPolyArea2d::toMultiPolygon()
+{
+
+
+   try{
+      if(m_privateData->m_geometry)
+      {
+         switch(m_privateData->m_geometry->getGeometryTypeId())
+         {
+            case geos::geom::GEOS_POLYGON:
+            {
+               std::vector<geos::geom::Geometry*> values;
+               values.push_back(m_privateData->m_geometry->clone());
+
+               m_privateData->setGeometry(m_privateData->m_geometry->getFactory()->createMultiPolygon(values));
+               break;
+            }
+            case geos::geom::GEOS_MULTIPOLYGON:
+            {
+               // intentionally left blank
+               break;
+            }
+            default:
+            {  
+               // might need an error at a later date
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimPolyArea2d::toMultiPolygon Geometry type can not be converted to a multi polygon: " <<m_privateData->m_geometry->getGeometryType()<< std::endl;
+
+               break;
+            }
+         }
+      }
+   }
+   catch(const std::exception& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimPolyArea2d::toMultiPolygon Caught exception: " << e.what() << std::endl;
+   }
+   catch(...)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimPolyArea2d::toMultiPolygon Caught exception!" << std::endl;
+   }
+
+   return *this;
+}
+
+bool ossimPolyArea2d::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           "ossimPolyArea2d",
+           true);
+
+   if(!isEmpty())
+   {
+      geos::io::WKTWriter writer;
+
+      kwl.add(prefix,
+              "wkt",
+              writer.write(m_privateData->m_geometry).c_str(),
+              true);
+   }
+   // else
+   // {
+   //
+   // }
+
+   return true;
+}
+
+bool ossimPolyArea2d::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   if(m_privateData)
+   {
+      ossimString wkt = kwl.find(prefix, "wkt");
+
+      if(!wkt.empty())
+      {
+         geos::io::WKTReader reader(m_privateData->geomFactory());
+         try
+         {
+            m_privateData->setGeometry(reader.read(wkt.c_str()));
+         }
+         catch( const std::exception& e )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimPolyArea2d::loadState Caught exception: " << e.what() << std::endl;
+            this->clearPolygons();
+         }
+         catch(...)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimPolyArea2d::loadState Caught exception!" << std::endl;
+            this->clearPolygons(); 
+         }
+      }
+   }
+   return true;
+}
diff --git a/ossim/src/ossim/base/ossimPolyLine.cpp b/src/base/ossimPolyLine.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimPolyLine.cpp
rename to src/base/ossimPolyLine.cpp
diff --git a/src/base/ossimPolygon.cpp b/src/base/ossimPolygon.cpp
new file mode 100644
index 0000000..c9a0435
--- /dev/null
+++ b/src/base/ossimPolygon.cpp
@@ -0,0 +1,1296 @@
+//*****************************************************************************
+// FILE: ossimPolygon.cpp
+//
+// License:  LGPL
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class 
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimPolygon.cpp 19682 2011-05-31 14:21:20Z dburken $
+
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimLine.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/base/ossimString.h>
+#include <algorithm>
+#include <iterator>
+#include <sstream>
+#include <iterator>
+
+static const char* NUMBER_VERTICES_KW = "number_vertices";
+static const char* VERTEX_ORDER_KW    = "order";
+
+static const int RECT_LEFT_EDGE   = 0;
+static const int RECT_TOP_EDGE    = 1;
+static const int RECT_RIGHT_EDGE  = 2;
+static const int RECT_BOTTOM_EDGE = 3;
+
+ossimPolygon::ossimPolygon()
+   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+    theVertexList(),
+    theCurrentVertex(0)
+   
+{}
+
+ossimPolygon::ossimPolygon(const vector<ossimIpt>& polygon)
+   :theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+   theVertexList(polygon.size()),
+   theCurrentVertex(0)
+   
+{
+   // Assign std::vector<ossimIpt> list to std::vector<ossimDpt> theVertexList.
+   for (std::vector<ossimIpt>::size_type i = 0; i < polygon.size(); ++i)
+   {
+      theVertexList[i] = polygon[i];
+   }
+}
+
+ossimPolygon::ossimPolygon(const vector<ossimGpt>& polygon)
+   :theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+   theVertexList(polygon.size()),
+   theCurrentVertex(0)
+   
+{
+   // Assign std::vector<ossimIpt> list to std::vector<ossimDpt> theVertexList.
+   for (std::vector<ossimGpt>::size_type i = 0; i < polygon.size(); ++i)
+   {
+      theVertexList[i] = polygon[i];
+   }
+}
+
+
+ossimPolygon::ossimPolygon(const vector<ossimDpt>& polygon)
+   :theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+   theVertexList(polygon),
+    theCurrentVertex(0)
+{
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimPolygon(int numVertices, const ossimDpt* vertex_array)
+//  
+//*****************************************************************************
+ossimPolygon::ossimPolygon(int numVertices, const ossimDpt* v)
+   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+     theCurrentVertex(0)
+     
+{
+   theVertexList.insert(theVertexList.begin(),
+                        v, v+numVertices);
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: ossimPolygon(ossimPolygon)
+//  
+//*****************************************************************************
+ossimPolygon::ossimPolygon(const ossimPolygon& polygon)
+   :theCurrentVertex(0)
+{
+   *this = polygon;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimPolygon(p1, p2, p3, p4)
+//  
+//  Provided for convenience. Does not imply the polygon is limited to four
+//  vertices
+//  
+//*****************************************************************************
+ossimPolygon::ossimPolygon(ossimDpt v1,
+                           ossimDpt v2,
+                           ossimDpt v3,
+                           ossimDpt v4)
+   : theOrderingType(OSSIM_VERTEX_ORDER_UNKNOWN),
+     theVertexList(4),
+     theCurrentVertex(0)
+     
+{
+   theVertexList[0] = v1;
+   theVertexList[1] = v2;
+   theVertexList[2] = v3;
+   theVertexList[3] = v4;
+}
+
+ossimPolygon::ossimPolygon(const ossimIrect& rect)
+: theOrderingType(OSSIM_CLOCKWISE_ORDER),
+  theVertexList(4),
+  theCurrentVertex(0)
+{
+   theVertexList[0] = rect.ul();
+   theVertexList[1] = rect.ur();
+   theVertexList[2] = rect.lr();
+   theVertexList[3] = rect.ll();
+}
+
+ossimPolygon::ossimPolygon(const ossimDrect& rect)
+: theOrderingType(OSSIM_CLOCKWISE_ORDER),
+theVertexList(4),
+theCurrentVertex(0)
+{
+   theVertexList[0] = rect.ul();
+   theVertexList[1] = rect.ur();
+   theVertexList[2] = rect.lr();
+   theVertexList[3] = rect.ll();
+}
+
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimPolygon
+//  
+//*****************************************************************************
+ossimPolygon::~ossimPolygon()
+{
+}
+
+
+//*************************************************************************************************
+//! Returns polygon area. Negative indicates CW ordering of vertices (in right-handed coordinates
+//*************************************************************************************************
+double ossimPolygon::area()const
+{
+   double area = 0;
+   ossim_uint32 i=0;
+   ossim_uint32 j=0;
+   ossim_uint32 size = (ossim_uint32)theVertexList.size();
+   
+   for (i=0;i<size;i++)
+   {
+      j = (i + 1) % (int)size;
+      area += theVertexList[i].x * theVertexList[j].y;
+      area -= theVertexList[i].y * theVertexList[j].x;
+   }
+
+   area /= 2;
+
+   return area;
+}
+
+void ossimPolygon::roundToIntegerBounds(bool compress)
+{
+   int i = 0;
+   for(i = 0; i < (int)theVertexList.size(); ++i)
+   {
+      theVertexList[i] = ossimIpt(theVertexList[i]);
+   }
+
+  if(compress&&theVertexList.size())
+   {
+      vector<ossimDpt> polyLine;
+      
+      polyLine.push_back(theVertexList[0]);
+      ossimDpt testPt = theVertexList[0];
+      for(i=1; i < (int)theVertexList.size(); ++i)
+      {
+         if(testPt!=theVertexList[i])
+         {
+            testPt = theVertexList[i];
+            polyLine.push_back(testPt);
+         }
+      }
+      if(polyLine.size() == 1)
+      {
+         polyLine.push_back(polyLine[0]);
+      }
+      
+      if(theVertexList.size() == 1)
+      {
+         polyLine.push_back(testPt);
+      }
+      theVertexList    = polyLine;
+      theCurrentVertex = 0;
+   }
+}
+
+ossimDpt ossimPolygon::midPoint()const
+{
+   int upper = (int)theVertexList.size();
+   ossimDpt result(0.0, 0.0);
+   int i = 0;
+
+   if(!upper)
+   {
+      result.makeNan();
+   }
+   else
+   {
+      for(i = 0; i < upper; ++i)
+      {
+         result.x+=theVertexList[i].x;
+         result.y+=theVertexList[i].y;
+      }
+      result.x/=(double)upper;
+      result.y/=(double)upper;
+   }
+   
+   return result;
+}
+
+bool ossimPolygon::hasNans()const
+{
+   int upper = (int)theVertexList.size();
+   int i = 0;
+
+   for(i = 0; i < upper; ++i)
+   {
+      if(theVertexList[i].hasNans())
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+void ossimPolygon::getIntegerBounds(ossim_int32& minX,
+   ossim_int32& minY,
+   ossim_int32& maxX,
+   ossim_int32& maxY)const
+{
+   ossim_int32 npoly = (ossim_int32)theVertexList.size();
+   int i = 0;
+
+   if(npoly)
+   {
+      minX = (ossim_int32)floor(theVertexList[0].x);
+      maxX = (ossim_int32)ceil(theVertexList[0].x);
+      minY = (ossim_int32)floor(theVertexList[0].y);
+      maxY = (ossim_int32)ceil(theVertexList[0].y);
+
+      for(i =1; i < npoly; ++i)
+      {
+         minX = std::min((ossim_int32)floor(theVertexList[i].x),
+            (ossim_int32)minX);
+         maxX = std::max((ossim_int32)ceil(theVertexList[i].x),
+            (ossim_int32)maxX);
+         minY = std::min((ossim_int32)floor(theVertexList[i].y),
+            (ossim_int32)minY);
+         maxY = std::max((ossim_int32)ceil(theVertexList[i].y),
+            (ossim_int32)maxY);
+      }
+   }
+   else
+   {
+      minX = OSSIM_INT_NAN;
+      minY = OSSIM_INT_NAN;
+      maxX = OSSIM_INT_NAN;
+      maxY = OSSIM_INT_NAN;
+   }
+}
+
+void ossimPolygon::getFloatBounds(ossim_float64& minX,
+                                  ossim_float64& minY,
+                                  ossim_float64& maxX,
+                                  ossim_float64& maxY) const
+{
+   ossim_int32 npoly = (ossim_int32)theVertexList.size();
+   int i = 0;
+
+   if(npoly)
+   {
+      minX = floor(theVertexList[0].x);
+      maxX = ceil(theVertexList[0].x);
+      minY = floor(theVertexList[0].y);
+      maxY = ceil(theVertexList[0].y);
+
+      for(i =1; i < npoly; ++i)
+      {
+         minX = std::min<double>(floor(theVertexList[i].x), minX);
+         maxX = std::max<double>(ceil(theVertexList[i].x),  maxX);
+         minY = std::min<double>(floor(theVertexList[i].y), minY);
+         maxY = std::max<double>(ceil(theVertexList[i].y),  maxY);
+      }
+   }
+   else
+   {
+      minX = ossim::nan();
+      minY = ossim::nan();
+      maxX = ossim::nan();
+      maxY = ossim::nan();
+   }
+}
+
+bool ossimPolygon::clipToRect(vector<ossimPolygon>& result,
+                              const ossimDrect& rect)const
+{
+   result.clear();
+   ossimPolyArea2d p1(*this);
+   ossimPolyArea2d p2(rect.ul(), rect.ur(), rect.lr(), rect.ll());
+   
+   p1&=p2;
+
+   p1.getVisiblePolygons(result);
+
+   return (result.size() > 0);
+}   
+
+//*****************************************************************************
+//  METHOD: ossimPolygon::clipLineSegment(p1, p2)
+//  
+//  Implements Cyrus-Beck clipping algorithm as described in:
+//  http://www.daimi.au.dk/~mbl/cgcourse/wiki/cyrus-beck_line-clipping_.html
+//
+//  Clips the line segment defined by the two endpoints provided. The
+//  endpoints are modified as needed to represent the clipped line. Returns
+//  true if intersection present.
+//  
+//*****************************************************************************
+bool ossimPolygon::clipLineSegment(ossimDpt& P, ossimDpt& Q) const
+{
+   ossimDpt PQ (Q - P);
+   double tE = 0.0;
+   double tL = 1.0;
+   ossimLine edge, edgeE, edgeL;
+   bool intersected=false;
+   double num, denom, t;
+   ossim_uint32 npol = (ossim_uint32)theVertexList.size();
+
+   checkOrdering();
+   //***
+   // clip the segment against each edge of the polygon
+   //***
+   ossim_uint32 i = 0;
+   ossim_uint32 j = 0;
+   for(i = 0, j = 1; i < npol;)
+   {
+      edge = ossimLine(theVertexList[i],
+                       theVertexList[j]);
+      
+      ossimDpt normal = edge.normal();
+
+      // Fix from CChuah at observera.com for counter clockwise polygons. (drb)
+      if (theOrderingType == OSSIM_COUNTERCLOCKWISE_ORDER)
+      {
+         normal.x = -normal.x;
+         normal.y = -normal.y;
+      }
+      
+      denom = normal.x*PQ.x + normal.y*PQ.y;
+      
+      num = normal.x*(edge.theP1.x - P.x) + normal.y*(edge.theP1.y - P.y);
+      
+      if (denom < 0)
+      {
+         //***
+         // Appears to be entering:
+         //***
+         t = num / denom;
+         if (t > tE)
+         {
+            tE = t; //+ FLT_EPSILON;
+            edgeE = edge;
+         }
+      }
+      else if (denom > 0)
+      {
+         //***
+         // Appears to be leaving:
+         //***
+         t = num / denom;
+         if (t < tL)
+         {
+            tL = t;// - FLT_EPSILON;
+            edgeL = edge;
+         }
+      }
+
+      ++i;
+      ++j;
+      j%=npol;
+   } 
+   
+   //***
+   // Compute clipped end points:
+   //***
+   if(tL >= tE)
+   {
+       Q.x = P.x + tL*PQ.x;
+       Q.y = P.y + tL*PQ.y;
+       P.x += tE*PQ.x;
+       P.y += tE*PQ.y;
+       intersected = true;
+   }
+   
+   return intersected;
+}
+
+/**
+* METHOD: isRectWithin()
+* Returns true if all the corner points of the given rect fit within.
+*/
+bool ossimPolygon::isRectWithin(const ossimIrect &rect) const 
+{
+    if(isPointWithin(rect.ul()) &&
+       isPointWithin(rect.ur()) &&
+       isPointWithin(rect.ll()) &&
+       isPointWithin(rect.lr())) {
+       	return true;
+    }
+    return false;
+}
+/**
+* METHOD: isPolyWithin()
+* Returns true if all the vertices of the given polygon fit within.
+*/
+bool ossimPolygon::isPolyWithin(const ossimPolygon &poly) const 
+{
+   bool ret=false;
+   int numvertex=poly.getNumberOfVertices();
+   if(getNumberOfVertices()>1 && numvertex) {
+      ret=true;
+      for(int v=0;v<numvertex;v++) {
+         if(!isPointWithin(poly[v])) {
+            ret=false;
+            break;
+         }
+      }
+   }
+   return ret;
+}
+
+//*****************************************************************************
+//  METHOD: ossimPolygon::pointWithin(const ossimDpt& point)
+//  
+//  Returns TRUE if point is inside polygon.
+//  
+//*****************************************************************************
+bool ossimPolygon::isPointWithin(const ossimDpt& point) const
+{
+
+   int i, j, c = 0;
+   int npol = (int)theVertexList.size();
+
+   for (i = 0, j = npol-1; i < npol; j = i++)
+   {
+      if ((((theVertexList[i].y <= point.y) && (point.y < theVertexList[j].y)) ||
+           ((theVertexList[j].y <= point.y) && (point.y < theVertexList[i].y))) &&
+          (point.x < (theVertexList[j].x - theVertexList[i].x) * (point.y - theVertexList[i].y) /
+           (theVertexList[j].y - theVertexList[i].y) + theVertexList[i].x))
+      {
+         c = !c;
+      }
+   }
+
+   if(!c) // check if on if not within
+   {
+      for (i = 0, j = npol-1; i < npol; j = i++)
+      {
+         if(ossimLine(theVertexList[i], theVertexList[j]).isPointWithin(point))
+         {
+            return true;
+         }
+      }
+   }
+
+   return (c!=0);
+}
+
+//*****************************************************************************
+//  METHOD: ossimPolygon::vertex(int)
+//  
+//  Returns the ossimDpt vertex given the index. Also initializes the current
+//  edge (theCurrentEdge) to the edge corresponding to the index.
+//  
+//*****************************************************************************
+bool ossimPolygon::vertex(int index, ossimDpt& tbd_vertex) const 
+{
+   if((index >= (int)theVertexList.size()) ||
+      (index < 0))
+   {
+      return false;
+   }
+
+   tbd_vertex = theVertexList[index];
+   theCurrentVertex = index;
+
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimPolygon::nextVertex()
+//  
+//  Assigns the ossimDpt tbd_vertex following the current vertex. The current
+//  vertex is initialized with a call to vertex(int), or after the last
+//  vertex is reached (initialized to theFirstEdge. Returns false if no vertex
+//  defined.
+//
+//*****************************************************************************
+bool ossimPolygon::nextVertex(ossimDpt& tbd_vertex) const 
+{
+   ++theCurrentVertex;
+   if(theCurrentVertex >= (ossim_int32)theVertexList.size())
+   {
+      return false;
+   }
+   tbd_vertex = theVertexList[theCurrentVertex];
+   
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: operator=()
+//  
+//*****************************************************************************
+const ossimPolygon& ossimPolygon::operator= (const ossimIrect& rect)
+{
+   theCurrentVertex = 0;
+   theVertexList.resize(4);
+   theVertexList[0] = rect.ul();
+   theVertexList[1] = rect.ur();
+   theVertexList[2] = rect.lr();
+   theVertexList[3] = rect.ll();
+
+   return *this;
+}
+
+const ossimPolygon& ossimPolygon::operator= (const ossimDrect& rect)
+{
+   theCurrentVertex = 0;
+   theVertexList.resize(4);
+   theVertexList[0] = rect.ul();
+   theVertexList[1] = rect.ur();
+   theVertexList[2] = rect.lr();
+   theVertexList[3] = rect.ll();
+
+   return *this;
+}
+
+const ossimPolygon&  ossimPolygon::operator=(const ossimPolygon& polygon)
+{
+   theVertexList    = polygon.theVertexList;
+   theCurrentVertex = polygon.theCurrentVertex;
+   theOrderingType  = polygon.theOrderingType;
+   
+   return *this;
+}
+
+const ossimPolygon& ossimPolygon::operator= (const vector<ossimDpt>& vertexList)
+{
+   theVertexList    = vertexList;
+   theCurrentVertex = 0;
+   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
+   
+   return *this;
+}
+
+const ossimPolygon& ossimPolygon::operator=(const vector<ossimIpt>& vertexList)
+{
+   theVertexList.resize(vertexList.size());
+   
+   // Assign std::vector<ossimIpt> list to std::vector<ossimDpt> theVertexList.
+   for (std::vector<ossimIpt>::size_type i = 0; i < vertexList.size(); ++i)
+   {
+      theVertexList[i] = vertexList[i];
+   }
+   
+   theCurrentVertex = 0;
+   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
+   
+   return *this;
+}
+
+const ossimPolygon& ossimPolygon::operator=(const vector<ossimGpt>& vertexList)
+{
+   theVertexList.resize(vertexList.size());
+   
+   // Assign std::vector<ossimIpt> list to std::vector<ossimDpt> theVertexList.
+   for (std::vector<ossimIpt>::size_type i = 0; i < vertexList.size(); ++i)
+   {
+      theVertexList[i] = vertexList[i];
+   }
+   
+   theCurrentVertex = 0;
+   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
+   
+   return *this;
+}
+
+//*****************************************************************************
+//  METHOD: operator==()
+//  
+//*****************************************************************************
+bool ossimPolygon::operator==(const ossimPolygon& polygon) const
+{
+   if( (theVertexList.size() != polygon.theVertexList.size()))
+   {
+      return false;
+   }
+   if(!theVertexList.size() && polygon.theVertexList.size())
+   {
+      return true;
+   }
+
+   return (theVertexList == polygon.theVertexList);
+}
+
+const ossimPolygon& ossimPolygon::operator *=(const ossimDpt& scale)
+{
+   ossim_uint32 upper = (ossim_uint32)theVertexList.size();
+   ossim_uint32 i = 0;
+   for(i = 0; i < upper; ++i)
+   {
+      theVertexList[i].x*=scale.x;
+      theVertexList[i].y*=scale.y;
+   }
+   
+   return *this;
+}
+
+ossimPolygon ossimPolygon::operator *(const ossimDpt& scale)const
+{
+   ossimPolygon result(*this);
+
+   ossim_uint32 upper = (ossim_uint32)theVertexList.size();
+   ossim_uint32 i = 0;
+   for(i = 0; i < upper; ++i)
+   {
+      result.theVertexList[i].x*=scale.x;
+      result.theVertexList[i].y*=scale.y;
+   }
+
+   return result;
+}
+
+
+void ossimPolygon::reverseOrder()
+{
+   std::reverse(theVertexList.begin(), theVertexList.end());
+   
+   if(theOrderingType == OSSIM_COUNTERCLOCKWISE_ORDER)
+   {
+      theOrderingType = OSSIM_CLOCKWISE_ORDER;
+   }
+   else if(theOrderingType == OSSIM_CLOCKWISE_ORDER)
+   {
+      theOrderingType =  OSSIM_COUNTERCLOCKWISE_ORDER;
+   }
+   
+}
+
+//*****************************************************************************
+//  METHOD: ossimPolygon::print(ostream)
+//  
+//*****************************************************************************
+void ossimPolygon::print(ostream& os) const
+{
+   copy(theVertexList.begin(),
+        theVertexList.end(),
+        ostream_iterator<ossimDpt>(os, "\n"));
+}
+
+
+ossimVertexOrdering ossimPolygon::checkOrdering()const
+{
+   if(theOrderingType == OSSIM_VERTEX_ORDER_UNKNOWN)
+   {
+      double areaValue = area();
+      if(areaValue > 0)
+      {
+         theOrderingType = OSSIM_COUNTERCLOCKWISE_ORDER;
+      }
+      else if(areaValue <= 0)
+      {
+         theOrderingType = OSSIM_CLOCKWISE_ORDER;
+      }
+   }
+
+   return theOrderingType;
+}
+
+void ossimPolygon::intersectEdge(ossimDpt& result,
+                                 const ossimLine& segment,
+                                 const ossimDrect& rect,
+                                 int edge)
+{
+   ossimLine edgeLine;
+   switch(edge)
+   {
+   case RECT_LEFT_EDGE:
+   {
+      edgeLine.theP1 = rect.ll();
+      edgeLine.theP2 = rect.ul();
+      break;
+   }
+   case RECT_TOP_EDGE:
+   {
+      edgeLine.theP1 = rect.ul();
+      edgeLine.theP2 = rect.ur();
+      break;
+   }
+   case RECT_RIGHT_EDGE:
+   {
+      edgeLine.theP1 = rect.ur();
+      edgeLine.theP2 = rect.lr();
+      break;
+   }
+   case RECT_BOTTOM_EDGE:
+   {
+      edgeLine.theP1 = rect.lr();
+      edgeLine.theP2 = rect.ll();
+      break;
+   }
+   }
+   
+   result = segment.intersectInfinite(edgeLine);
+}
+
+bool ossimPolygon::isInsideEdge(const ossimDpt& pt,
+                                const ossimDrect& rect,
+                                int edge)const
+{
+   switch(edge)
+   {
+   case RECT_LEFT_EDGE:
+   {
+      return (pt.x>rect.ul().x);
+      break;
+   }
+   case RECT_TOP_EDGE:
+   {
+      if(rect.orientMode() == OSSIM_LEFT_HANDED)
+      {
+         return (pt.y > rect.ul().y);
+      }
+      else
+      {
+         return (pt.y < rect.ul().y);
+      }
+      break;
+   }
+   case RECT_RIGHT_EDGE:
+   {
+      return (pt.x<rect.lr().x);
+      
+      break;
+   }
+   case RECT_BOTTOM_EDGE:
+   {
+      if(rect.orientMode() == OSSIM_LEFT_HANDED)
+      {
+         return (pt.y < rect.lr().y);
+      }
+      else
+      {
+         return (pt.y > rect.lr().y);
+      }
+      break;
+   }
+   }
+   return false;
+}
+
+
+bool ossimPolygon::saveState(ossimKeywordlist& kwl,
+                             const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           "ossimPolygon",
+           true);
+   kwl.add(prefix,
+           NUMBER_VERTICES_KW,
+           static_cast<ossim_uint32>(theVertexList.size()),
+           true);
+   int i = 0;
+   for(i = 0; i < (int)theVertexList.size();++i)
+   {
+      ossimString vert = "v"+ossimString::toString(i);;
+      ossimString value = (ossimString::toString(theVertexList[i].x) + " " +
+                           ossimString::toString(theVertexList[i].y) );
+      kwl.add(prefix,
+              vert.c_str(),
+              value.c_str(),
+              true);
+   }
+   ossimString order = "";
+   
+   switch(theOrderingType)
+   {
+   case OSSIM_VERTEX_ORDER_UNKNOWN:
+   {
+      order = "unknown";
+      break;
+   }
+   case OSSIM_CLOCKWISE_ORDER:
+   {
+      order = "clockwise";
+      break;
+   }
+   case OSSIM_COUNTERCLOCKWISE_ORDER:
+   {
+      order = "counter_clockwise";
+      break;
+   }
+   }
+   kwl.add(prefix,
+           VERTEX_ORDER_KW,
+           order,
+           true);
+
+   return true;
+}
+   
+bool ossimPolygon::loadState(const ossimKeywordlist& kwl,
+                             const char* prefix)
+{
+   ossimString order = kwl.find(prefix, VERTEX_ORDER_KW);
+   const char* number_vertices = kwl.find(prefix, NUMBER_VERTICES_KW);
+   ossimString x,y;
+   if(order=="unknown")
+   {
+      theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
+   }
+   else if(order =="clockwise")
+   {
+      theOrderingType = OSSIM_CLOCKWISE_ORDER;
+   }
+   else if(order =="counter_clockwise")
+   {
+      theOrderingType = OSSIM_COUNTERCLOCKWISE_ORDER;
+   }
+
+   theVertexList.clear();
+   int vertexCount = ossimString(number_vertices).toLong();
+   int i = 0;
+   for(i = 0; i < vertexCount; ++i)
+   {
+      ossimString v = kwl.find(prefix, (ossimString("v")+ossimString::toString(i)).c_str());
+      v = v.trim();
+
+      istringstream vStream(v.string());
+      vStream >> x.string() >> y.string();
+      theVertexList.push_back(ossimDpt(x.toDouble(),y.toDouble()));
+   }
+
+   return true;
+}
+
+void ossimPolygon::getMinimumBoundingRect(ossimPolygon& minRect) const
+{
+   static const double MIN_STEP = (0.5)*M_PI/180.0;
+   double angle_step = M_PI/8.0;  // initial rotation step size for min area search = 22.5 deg
+   double theta;
+   double best_theta = M_PI/4.0;  // Initial guess is 45 deg orientation
+   double center_theta;
+   double cos_theta, sin_theta;
+   ossimPolygon rotatedPolygon(*this);
+   ossimDpt xlatedVertex;
+   ossimDpt rotatedVertex(0.0, 0.0);
+   double min_x, min_y, max_x, max_y;
+   double area;
+   double min_area = 1.0/DBL_EPSILON;
+   rotatedPolygon.theVertexList[0] = ossimDpt(0, 0);  // first vertex always at origin
+   bool first_time = true;
+   ossimDrect best_rect;
+   static const bool TESTING = false;
+
+   //***
+   // Loop to converge on best orientation angle for bounding polygon:
+   //***
+   while (angle_step > MIN_STEP)
+   {
+      //***
+      // Try four different rotations evenly centered about the current best guess:
+      //***
+      center_theta = best_theta;
+      for (int i=0; i<5; i++)
+      {
+         //***
+         // Check for i=2 (center angle) since already computed quantities for this in last iteration
+         // unless this is first time through:
+         //***
+         if ((i != 2) || (first_time)) 
+         {
+            theta = center_theta + (i - 2.0)*angle_step;
+            cos_theta = cos(theta);
+            sin_theta = sin(theta);
+            min_x = rotatedPolygon.theVertexList[0].x;
+            min_y = rotatedPolygon.theVertexList[0].y;
+            max_x = min_x;
+            max_y = min_y;
+
+            //***
+            // Translate polygon to origin and rotate all vertices by current theta:
+            //***
+            for (unsigned int vertex=1; vertex < theVertexList.size(); vertex++)
+            {
+               xlatedVertex.x = theVertexList[vertex].x - theVertexList[0].x;
+               xlatedVertex.y = theVertexList[vertex].y - theVertexList[0].y;
+               rotatedVertex.x = cos_theta*xlatedVertex.x + sin_theta*xlatedVertex.y;
+               rotatedVertex.y = cos_theta*xlatedVertex.y - sin_theta*xlatedVertex.x;
+               rotatedPolygon.theVertexList[vertex] = rotatedVertex;
+
+               //***
+               // Latch max and mins of bounding rect:
+               //***
+               if (min_x > rotatedVertex.x) min_x = rotatedVertex.x;
+               if (min_y > rotatedVertex.y) min_y = rotatedVertex.y;
+               if (max_x < rotatedVertex.x) max_x = rotatedVertex.x;
+               if (max_y < rotatedVertex.y) max_y = rotatedVertex.y;
+            }
+
+            if (TESTING)
+            {
+               ossimDpt v1 (cos_theta*min_x - sin_theta*max_y + theVertexList[0].x,
+                            cos_theta*max_y + sin_theta*min_x + theVertexList[0].y);
+               ossimDpt v2 (cos_theta*max_x - sin_theta*max_y + theVertexList[0].x,
+                            cos_theta*max_y + sin_theta*max_x + theVertexList[0].y);
+               ossimDpt v3 (cos_theta*max_x - sin_theta*min_y + theVertexList[0].x,
+                            cos_theta*min_y + sin_theta*max_x + theVertexList[0].y);
+               ossimDpt v4 (cos_theta*min_x - sin_theta*min_y + theVertexList[0].x,
+                            cos_theta*min_y + sin_theta*min_x + theVertexList[0].y);
+               cout << v1.x << "\t" << v1.y << endl;
+               cout << v2.x << "\t" << v2.y << endl;
+               cout << v3.x << "\t" << v3.y << endl;
+               cout << v4.x << "\t" << v4.y << endl << endl;
+            }
+
+            //***
+            // Establish bounding rect and area about rotated polygon:
+            //***
+            area = (max_x - min_x) * (max_y - min_y);
+            if (area < min_area)
+            {
+               best_theta = theta;
+               min_area = area;
+               best_rect = ossimDrect(min_x, max_y, max_x, min_y, OSSIM_RIGHT_HANDED);
+            }
+         } // end if (i != 2 || first_time)
+      }  // end for-loop over surrounding rotations
+
+      //***
+      // Adjust step size by half to repeat process:
+      //***
+      angle_step /= 2.0;
+      first_time = false;
+
+   } // end while loop for convergence
+
+   //***
+   // best_theta now contains optimum rotation of bounding rect. Need to apply reverse
+   // rotation and translation of best_rect:
+   //***
+   cos_theta = cos(best_theta);
+   sin_theta = sin(best_theta);
+   ossimDpt v1 (cos_theta*best_rect.ul().x - sin_theta*best_rect.ul().y + theVertexList[0].x,
+                cos_theta*best_rect.ul().y + sin_theta*best_rect.ul().x + theVertexList[0].y);
+   ossimDpt v2 (cos_theta*best_rect.ur().x - sin_theta*best_rect.ur().y + theVertexList[0].x,
+                cos_theta*best_rect.ur().y + sin_theta*best_rect.ur().x + theVertexList[0].y);
+   ossimDpt v3 (cos_theta*best_rect.lr().x - sin_theta*best_rect.lr().y + theVertexList[0].x,
+                cos_theta*best_rect.lr().y + sin_theta*best_rect.lr().x + theVertexList[0].y);
+   ossimDpt v4 (cos_theta*best_rect.ll().x - sin_theta*best_rect.ll().y + theVertexList[0].x,
+                cos_theta*best_rect.ll().y + sin_theta*best_rect.ll().x + theVertexList[0].y);
+    
+   if (TESTING)
+   {
+      cout << v1.x << "\t" << v1.y << endl;
+      cout << v2.x << "\t" << v2.y << endl;
+      cout << v3.x << "\t" << v3.y << endl;
+      cout << v4.x << "\t" << v4.y << endl << endl;
+   }
+
+   //***
+   // Assign return value rect:
+   //***
+   minRect.clear();
+   minRect.addPoint(v1);
+   minRect.addPoint(v2);
+   minRect.addPoint(v3);
+   minRect.addPoint(v4);
+
+   // Make sure we are always returning a positive clockwise area.
+   minRect.checkOrdering();
+   if(minRect.getOrdering()==OSSIM_COUNTERCLOCKWISE_ORDER)
+      minRect.reverseOrder();
+   return;
+}
+
+/**
+* METHOD: remove() 
+* Removes the vertex from the polygon.
+*/
+void ossimPolygon::removeVertex(int vertex)
+{
+   int numvertices=getNumberOfVertices();
+   if(vertex>numvertices) {
+      return;
+   } else {
+      vector<ossimDpt>::iterator it;
+      int v=0;
+      for(it=theVertexList.begin();it!=theVertexList.end();it++) {
+         if(v++==vertex) {
+            theVertexList.erase(it);
+            break;
+         }
+      }
+   }
+}
+
+/**
+* METHOD: removeSmallestContributingVertex() 
+* Removes the vertex that contributes the smallest area to the polygon.
+*/
+void ossimPolygon::removeSmallestContributingVertex()
+{
+   unsigned int numvertices=getNumberOfVertices();
+   if (!numvertices)
+      return;
+
+   int smallest_vertex=-1,n1,n2;
+   double smallest_area=1.0/DBL_EPSILON;
+   ossimPolygon tmp;
+
+   for(unsigned int v=0;v<numvertices;v++) {
+      tmp.clear();
+      if(v==0) {
+         n1=numvertices-1;
+         n2=1;
+      } else if(v==numvertices-1) {
+         n1=numvertices-2;
+         n2=0;
+      } else {
+         n1=v-1;
+         n2=v+1;
+      }
+
+      tmp.addPoint(theVertexList[n1]);
+      tmp.addPoint(theVertexList[v]);
+      tmp.addPoint(theVertexList[n2]);
+
+      if(fabs(tmp.area())<smallest_area) {
+         smallest_area=fabs(tmp.area());
+         smallest_vertex=v;
+      }
+   }
+   removeVertex(smallest_vertex);
+}
+
+
+ossimDpt& ossimPolygon::operator[](int index)
+{
+   return theVertexList[index];
+}
+
+const ossimDpt& ossimPolygon::operator[](int index)const
+{
+   return theVertexList[index];
+}
+
+ossim_uint32 ossimPolygon::getVertexCount()const
+{
+   return getNumberOfVertices();
+}
+
+ossim_uint32 ossimPolygon::getNumberOfVertices()const
+{
+   return (ossim_uint32)theVertexList.size();
+}
+
+void ossimPolygon::getBoundingRect(ossimIrect& rect)const
+{
+   ossim_int32 minX;
+   ossim_int32 minY;
+   ossim_int32 maxX;
+   ossim_int32 maxY;
+   getIntegerBounds(minX, minY, maxX, maxY);
+   rect = ossimIrect(minX, minY, maxX, maxY);
+}
+
+void ossimPolygon::getBoundingRect(ossimDrect& rect)const
+{
+   ossim_float64 minX;
+   ossim_float64 minY;
+   ossim_float64 maxX;
+   ossim_float64 maxY;
+   getFloatBounds(minX, minY, maxX, maxY);
+   rect = ossimDrect(minX, minY, maxX, maxY);
+}
+
+void ossimPolygon::clear()
+{
+   theVertexList.clear();
+   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
+}
+
+void ossimPolygon::addPoint(const ossimDpt& pt)
+{
+   theVertexList.push_back(pt);
+   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
+}
+
+void ossimPolygon::addPoint(double x, double y)
+{
+   theVertexList.push_back(ossimDpt(x, y));
+   theOrderingType = OSSIM_VERTEX_ORDER_UNKNOWN;
+}
+
+const vector<ossimDpt>& ossimPolygon::getVertexList()const
+{
+   return theVertexList;
+}
+
+ bool ossimPolygon::pointWithin(const ossimDpt& point) const
+{
+   return isPointWithin(point);
+}
+
+const ossimPolygon& ossimPolygon::operator *=(double scale)
+{
+   return ((*this)*=ossimDpt(scale, scale));
+}
+
+ossimPolygon ossimPolygon::operator *(double scale)const
+{
+   return ((*this)*ossimDpt(scale, scale));
+}
+
+void ossimPolygon::resize(ossim_uint32 newSize)
+{
+   theVertexList.resize(newSize);
+   theOrderingType  = OSSIM_VERTEX_ORDER_UNKNOWN;
+   theCurrentVertex = 0;
+}
+
+ossimVertexOrdering ossimPolygon::getOrdering()const
+{
+   return theOrderingType;
+}
+
+bool ossimPolygon::operator!=(const ossimPolygon& compare_this) const
+{
+   return !(*this == compare_this);
+}
+
+ostream& operator<<(ostream& os, const ossimPolygon& polygon)
+{
+   polygon.print(os);
+   return os;
+}
+
+/**
+* METHOD: getCentroid() 
+* Assigns the ossimDpt centroid the polygon.
+* Warning: centroid is not guaranteed to be inside the polygon!
+*/
+void ossimPolygon::getCentroid(ossimDpt &centroid) const
+{
+   int numpts = (int)theVertexList.size();
+   unsigned int next;
+   double area=0,parea;
+
+   centroid=ossimDpt(0,0);
+   for(int i=0;i<numpts;i++) {
+      if(i<numpts-1) {
+         next=i+1;
+      } else {
+         next=0;
+      }
+      parea=theVertexList[i].x*theVertexList[next].y-theVertexList[next].x*theVertexList[i].y;
+      area+=parea;
+      centroid.x+=(theVertexList[i].x+theVertexList[next].x)*parea;
+      centroid.y+=(theVertexList[i].y+theVertexList[next].y)*parea;
+   }
+   area=area/2.0;
+   centroid=centroid/(area*6.0);
+}
+
+/**
+* METHOD: fitCircleInsideVertex() 
+* Assigns destPt the point that fits a circle of given radius inside the polygon vertex.
+* Warning: destPt is not guaranteed to be inside the polygon!
+* (you may not be able to fit a circle of the given radius inside the polygon)
+*/
+void ossimPolygon::fitCircleInsideVertex(ossimDpt &destPt, unsigned int vertex, double radius) const
+{
+   ossim_uint32 num_vertices=(int)theVertexList.size(),n1,n2;
+   ossimDpt side1,side2,bisection,currpt;
+   double length_out,side1_side2_cross;
+   bool concave=true;
+
+   // don't be doing that dude.
+   if(num_vertices<3 || vertex>=num_vertices) {
+      destPt=ossimDpt(0,0);
+      return;
+   }
+ 
+   if(vertex==0) {
+      n1=num_vertices-1;
+      n2=vertex+1;
+   } else if(vertex==num_vertices-1) {
+      n1=num_vertices-2;
+      n2=0;
+   } else {
+      n1=vertex-1;
+      n2=vertex+1;
+   }
+
+   currpt=theVertexList[vertex];
+   // get the side vectors
+   side1=theVertexList[n1]-currpt;
+   side2=theVertexList[n2]-currpt;
+
+   // normalize the sides
+   side1 = side1/side1.length();
+   side2 = side2/side2.length();
+
+   side1_side2_cross=side1.x*side2.y-side2.x*side1.y;
+
+   checkOrdering();
+   if(getOrdering()==OSSIM_COUNTERCLOCKWISE_ORDER) {
+      if(side1_side2_cross<0)
+         concave=false;
+   } else { //clockwise
+      if(side1_side2_cross>0)
+         concave=false;
+   }
+
+   bisection = side1+side2;
+   bisection = bisection/bisection.length();
+
+   if(concave) {
+      bisection=bisection*-1.0;
+      length_out=radius;
+   } else {
+      double cos_theta=(side1.x*bisection.x+side1.y*bisection.y);
+      length_out=radius/sqrt(1-cos_theta*cos_theta);
+   }
+   destPt=ossimDpt(currpt+bisection*length_out);
+   return;
+}
+
+
+/**
+//! Shrinks this polygon by radius. Effectively, circles of given radius are placed inside 
+//! the vertices just tangent to the polygon edges (via fitCircleInsideVertex()). The new
+//! polygon's vertices will be the center of these circles. Return true if success. 
+*/
+bool ossimPolygon::shrink(ossimPolygon &dest, double inset) const 
+{
+   int numpts = (int) theVertexList.size();
+   ossimDpt pt;
+   
+   //don't let people shrink themselves, that isn't going to work
+   if(&dest==this) return false;
+
+   dest.clear();
+   for(int i=0;i<numpts;i++) {
+      fitCircleInsideVertex(pt,i,inset);
+      dest.addPoint(pt);
+   }
+   if(isPolyWithin(dest)) {
+      return true;
+   } else {
+      //return an empty polygon
+      dest=ossimPolygon();
+      return false;
+   }
+}
+
+
+
diff --git a/src/base/ossimPreferences.cpp b/src/base/ossimPreferences.cpp
new file mode 100644
index 0000000..ef82f3e
--- /dev/null
+++ b/src/base/ossimPreferences.cpp
@@ -0,0 +1,260 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// DESCRIPTION:
+//   Contains implementation of class ossimPreferences. This class provides
+//   a static keywordlist for global preferences. Objects needing access to
+//   application-wide global parameters shall do so through this class.
+//
+// SOFTWARE HISTORY:
+//>
+//   23Apr2001  Oscar Kramer (okramer at imagelinks.com)
+//              Initial coding.
+//<
+//*****************************************************************************
+
+#include <cstdlib> /* for getenv() */
+
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimNotify.h>
+
+//RTTI_DEF1(ossimPreferences, "ossimPreferences" , ossimObject)
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimPreferences:exec");
+static ossimTrace traceDebug ("ossimPreferences:debug");
+
+static const char* PREF_FILE_ENV_VAR_NAME = "OSSIM_PREFS_FILE";
+
+ossimPreferences* ossimPreferences::theInstance = NULL;
+
+ossimPreferences::ossimPreferences()
+{
+   /*!
+    * If $(env_var_name) is found in the preferences file, 
+    * expand it in place.
+    */
+   theKWL.setExpandEnvVarsFlag( true );
+   loadPreferences();
+}
+
+ossimPreferences::~ossimPreferences()
+{
+        theInstance = NULL;
+}
+
+/*!****************************************************************************
+ * METHOD: ossimPreferences::instance()
+ *  
+ *  This is the method by which run-time objects access this singleton instance
+ *  
+ *****************************************************************************/
+ossimPreferences* ossimPreferences::instance()
+{
+   /*!
+    * Simply return the instance if already created:
+    */
+   if (theInstance)
+      return theInstance;
+
+   /*!
+    * Create the static instance of this class:
+    */
+   theInstance = new ossimPreferences();
+
+   return theInstance;
+}
+
+/*!****************************************************************************
+ * METHOD: loadPreferences()
+ *  
+ *  Loads the preferences file specified in the runtime environment.
+ *  
+ *****************************************************************************/
+bool ossimPreferences::loadPreferences()
+{
+   static const char MODULE[] = "ossimPreferences::loadPreferences()";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: " << MODULE << " entering...\n";
+   }
+
+   bool parsed_ok = false;
+   
+   /*!
+    * Fetch preferences file name from environment:
+    */
+   char* pref_filename = getenv(PREF_FILE_ENV_VAR_NAME);
+
+   //std::cout << "ossimPreferences::loadPreferences() ======== " << ossimString(pref_filename) << "\n";
+   if (pref_filename)
+   {
+      /*!
+       * Load the preferences file into the static keywordlist object:
+       */
+      thePrefFilename = pref_filename;
+      parsed_ok = theKWL.addFile(pref_filename);
+
+      /*!
+       * Check for error opening KWL:
+       */
+      if (!parsed_ok)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING: " << MODULE
+            << ", an error was encountered loading the prefererences "
+            << "file at \"" << thePrefFilename << "\" as specified by the "
+            << "environment variable \"" << PREF_FILE_ENV_VAR_NAME << "\"."
+            << "Preferences were not loaded.\n";
+      }
+   }
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: " << MODULE << "returning...\n";
+   }
+   return parsed_ok;
+}
+
+/*!****************************************************************************
+ * METHOD: loadPreferences(filename)
+ *  
+ *  Loads the preferences file specified in the arg.
+ *  
+ *****************************************************************************/
+bool ossimPreferences::loadPreferences(const ossimFilename& pathname)
+{
+   static const char MODULE[] = "ossimPreferences::loadPreferences(filename)";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: " << MODULE << ", entering...\n";
+   }
+
+   bool parsed_ok;
+
+   /*!
+    * First clear the existing KWL:
+    */
+   theKWL.clear();
+   theInstanceIsModified = true;
+   
+   /*!
+    * Load the preferences file into the static keywordlist object:
+    */
+   thePrefFilename = pathname;
+   parsed_ok = theKWL.addFile(pathname);
+
+   /*!
+    * Check for error opening KWL:
+    */
+   if (!parsed_ok)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "WARNING: " << MODULE
+         << ", an error was encountered loading the prefererences "
+         << "file at \"" << pathname << "\". Preferences were not "
+         << "loaded.\n";
+   }
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: " << MODULE<< ", returning...\n";
+   }
+   
+   return parsed_ok;
+}
+
+/*!****************************************************************************
+ * METHOD: ossimPreferences::savePreferences()
+ *  
+ *  Saves KWL to the current filename.
+ *  
+ *****************************************************************************/
+bool ossimPreferences::savePreferences() const
+{
+   static const char MODULE[] = "ossimPreferences::savePreferences()";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: " << MODULE << ", entering...\n";
+   }
+   
+   bool success = true;
+   
+   /*!
+    * Save the file to current preferences filename:
+    */
+   if (theInstanceIsModified)
+   {
+      theKWL.write(thePrefFilename);
+      theInstanceIsModified = false;
+   }
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG:" << MODULE << ", returning...\n";
+   }
+   
+   return success;
+}
+
+/*!****************************************************************************
+ * METHOD: ossimPreferences::savePreferences(filename)
+ *  
+ *  Saves KWL to the specified filename.
+ *  
+ *****************************************************************************/
+bool ossimPreferences::savePreferences(const ossimFilename& pathname)
+{
+   static const char MODULE[] = "ossimPreferences::savePreferences()";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: "<< MODULE << ", entering...\n";
+   }
+   
+   bool success = true;
+   
+   /*!
+    * Save the file to the specified preferences filename:
+    */
+   theKWL.write(pathname);
+
+   thePrefFilename = pathname;
+   theInstanceIsModified = false;
+   
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: " << MODULE << ", returning...\n";
+   }
+   
+   return success;
+}
+
+void ossimPreferences::addPreference(const char* key, const char* value)
+{
+   theKWL.add(key, value, true);
+   theInstanceIsModified = true;
+}
+
+void ossimPreferences::addPreferences(const ossimKeywordlist& kwl,
+                                      const char* prefix,
+                                      bool stripPrefix)
+{
+   theKWL.add(kwl, prefix, stripPrefix);
+   theInstanceIsModified = true;
+}
+
+ossimFilename ossimPreferences::getPreferencesFilename() const
+{
+   return thePrefFilename;
+}
diff --git a/src/base/ossimProcessInterface.cpp b/src/base/ossimProcessInterface.cpp
new file mode 100644
index 0000000..a342f2b
--- /dev/null
+++ b/src/base/ossimProcessInterface.cpp
@@ -0,0 +1,144 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimProcessInterface.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ostream>
+
+#include <ossim/base/ossimProcessInterface.h>
+#include <ossim/base/ossimListenerManager.h>
+
+RTTI_DEF(ossimProcessInterface, "ossimProcessInterface");
+
+ossimProcessInterface::ossimProcessInterface()
+   :thePercentComplete(0.0),
+    theProcessStatus(PROCESS_STATUS_NOT_EXECUTING),
+    theMessage(""),
+    theEventFlag(true)
+{
+}
+
+ossimProcessInterface::~ossimProcessInterface()
+{
+}
+
+void ossimProcessInterface::abort()
+{
+   if(theProcessStatus == PROCESS_STATUS_EXECUTING)
+   {
+      setProcessStatus(PROCESS_STATUS_ABORT_REQUEST);
+   }
+}
+
+bool ossimProcessInterface::needsAborting() const
+{
+   return ( isAborted()|| isAbortRequested() );
+}
+
+bool ossimProcessInterface::isAbortRequested()const
+{
+   return (theProcessStatus == PROCESS_STATUS_ABORT_REQUEST);
+}
+
+bool ossimProcessInterface::isAborted()const
+{
+   return (theProcessStatus==PROCESS_STATUS_ABORTED);
+}
+
+bool ossimProcessInterface::isExecuting()const
+{
+   return ((theProcessStatus==PROCESS_STATUS_EXECUTING)||
+           (theProcessStatus==PROCESS_STATUS_ABORT_REQUEST));
+}
+
+ossimProcessInterface::ossimProcessStatus ossimProcessInterface::getProcessStatus()const
+{
+   return theProcessStatus;
+}
+
+void ossimProcessInterface::setProcessStatus(ossimProcessStatus processStatus)
+{
+   theProcessStatus = processStatus;
+}
+
+double ossimProcessInterface::getPercentComplete()const
+{
+   return thePercentComplete;
+}
+
+void ossimProcessInterface::setPercentComplete(double percentComplete)
+{
+   thePercentComplete = percentComplete;
+
+   ossimListenerManager* manager = getManager();
+   if(theEventFlag&&manager)
+   {
+      ossimProcessProgressEvent event(getObject(),
+                                      thePercentComplete,
+                                      theMessage,
+                                      false);
+      manager->fireEvent(event);
+   }
+}
+
+ossimListenerManager* ossimProcessInterface::getManager()
+{
+   return PTR_CAST(ossimListenerManager, getObject());
+}
+
+void ossimProcessInterface::enableEvents()
+{
+   theEventFlag = true;
+}
+   
+void ossimProcessInterface::disableEvents()
+{
+   theEventFlag = false;
+}
+
+void ossimProcessInterface::setCurrentMessage(const ossimString& message)
+{
+   theMessage = message;
+
+   ossimListenerManager* manager = getManager();
+   if(theEventFlag&&manager)
+   {
+      ossimProcessProgressEvent event(getObject(),
+                                      thePercentComplete,
+                                      theMessage,
+                                      true);
+      manager->fireEvent(event);
+   }   
+}
+
+std::ostream& ossimProcessInterface::print(std::ostream& out) const
+{
+   out << "process status: ";
+   if(theProcessStatus == PROCESS_STATUS_EXECUTING)
+   {
+      out << "executing" << std::endl;
+   }
+   else if(theProcessStatus == PROCESS_STATUS_ABORTED)
+   {
+      out << "aborted" << std::endl;
+   }
+   else if(theProcessStatus == PROCESS_STATUS_NOT_EXECUTING)
+   {
+      out << "not executing" << std::endl;
+   }
+   out << "percent_complete: " << thePercentComplete;
+   
+   return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimProcessInterface& data)
+{
+   return data.print(out);
+}
diff --git a/src/base/ossimProcessListener.cpp b/src/base/ossimProcessListener.cpp
new file mode 100644
index 0000000..622ba64
--- /dev/null
+++ b/src/base/ossimProcessListener.cpp
@@ -0,0 +1,44 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// $Id: ossimProcessListener.cpp 9094 2006-06-13 19:12:40Z dburken $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimProcessListener.h>
+#include <ossim/base/ossimProcessProgressEvent.h>
+
+RTTI_DEF1(ossimProcessListener, "ossimProcessListener", ossimListener);
+
+ossimProcessListener::ossimProcessListener()
+   : ossimListener()
+{}
+
+ossimProcessListener::~ossimProcessListener()
+{}
+
+void ossimProcessListener::processEvent(ossimEvent& event)
+{
+   switch(event.getId())
+   {
+   case OSSIM_EVENT_PROCESS_PROGRESS_ID:
+   {
+      ossimProcessProgressEvent* eventCast = static_cast<ossimProcessProgressEvent*>(&event);
+      processProgressEvent(*eventCast);
+      break;
+   }
+   default:
+   {
+      ossimListener::processEvent(event);
+      break;
+   }
+   }
+}
+
+void ossimProcessListener::processProgressEvent(ossimProcessProgressEvent& /* event */ )
+{}
diff --git a/src/base/ossimProcessProgressEvent.cpp b/src/base/ossimProcessProgressEvent.cpp
new file mode 100644
index 0000000..f0438c4
--- /dev/null
+++ b/src/base/ossimProcessProgressEvent.cpp
@@ -0,0 +1,68 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description: Event for process progress.
+//
+// $Id: ossimProcessProgressEvent.cpp 9094 2006-06-13 19:12:40Z dburken $
+//----------------------------------------------------------------------------
+#include <ossim/base/ossimProcessProgressEvent.h>
+
+RTTI_DEF1(ossimProcessProgressEvent, "ossimProcessProgressEvent", ossimEvent);
+
+ossimProcessProgressEvent::ossimProcessProgressEvent(ossimObject* owner,
+                                                     double percentComplete,
+                                                     const ossimString message,
+                                                     bool outputMessageFlag)
+   :
+      ossimEvent(owner, OSSIM_EVENT_PROCESS_PROGRESS_ID),
+      thePercentComplete(percentComplete),
+      theMessage(message),
+      theOutputMessageFlag(outputMessageFlag)
+{
+}
+
+ossimObject* ossimProcessProgressEvent::dup()const
+{
+   return new ossimProcessProgressEvent(*this);
+}
+
+double ossimProcessProgressEvent::getPercentComplete()const
+{
+   return thePercentComplete;
+}
+   
+ossimString ossimProcessProgressEvent::getMessage()const
+{
+   return theMessage;
+}
+
+void ossimProcessProgressEvent::getMessage(ossimString& message)const
+{
+   message = theMessage;
+}
+   
+void ossimProcessProgressEvent::setPercentComplete(double percentComplete)
+{
+   thePercentComplete = percentComplete;
+}
+
+void ossimProcessProgressEvent::setMessage(const ossimString& message)
+{
+   theMessage = message;
+}
+
+void ossimProcessProgressEvent::setOutputMessageFlag(bool flag)
+{
+   theOutputMessageFlag = flag;
+}
+
+bool ossimProcessProgressEvent::getOutputMessageFlag() const
+{
+   return theOutputMessageFlag;
+}
diff --git a/ossim/src/ossim/base/ossimProperty.cpp b/src/base/ossimProperty.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimProperty.cpp
rename to src/base/ossimProperty.cpp
diff --git a/ossim/src/ossim/base/ossimPropertyInterface.cpp b/src/base/ossimPropertyInterface.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimPropertyInterface.cpp
rename to src/base/ossimPropertyInterface.cpp
diff --git a/ossim/src/ossim/base/ossimPropertyInterfaceFactory.cpp b/src/base/ossimPropertyInterfaceFactory.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimPropertyInterfaceFactory.cpp
rename to src/base/ossimPropertyInterfaceFactory.cpp
diff --git a/ossim/src/ossim/base/ossimPropertyInterfaceRegistry.cpp b/src/base/ossimPropertyInterfaceRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimPropertyInterfaceRegistry.cpp
rename to src/base/ossimPropertyInterfaceRegistry.cpp
diff --git a/ossim/src/ossim/base/ossimQuadTreeWarp.cpp b/src/base/ossimQuadTreeWarp.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimQuadTreeWarp.cpp
rename to src/base/ossimQuadTreeWarp.cpp
diff --git a/ossim/src/ossim/base/ossimQuadrilateralMap.cpp b/src/base/ossimQuadrilateralMap.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimQuadrilateralMap.cpp
rename to src/base/ossimQuadrilateralMap.cpp
diff --git a/ossim/src/ossim/base/ossimQuaternion.cpp b/src/base/ossimQuaternion.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimQuaternion.cpp
rename to src/base/ossimQuaternion.cpp
diff --git a/ossim/src/ossim/base/ossimROIEvent.cpp b/src/base/ossimROIEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimROIEvent.cpp
rename to src/base/ossimROIEvent.cpp
diff --git a/src/base/ossimROIEventListener.cpp b/src/base/ossimROIEventListener.cpp
new file mode 100644
index 0000000..70f0c54
--- /dev/null
+++ b/src/base/ossimROIEventListener.cpp
@@ -0,0 +1,47 @@
+#include <ossim/base/ossimROIEventListener.h>
+#include <ossim/base/ossimROIEvent.h>
+
+
+RTTI_DEF1(ossimROIEventListener, "ossimROIEventListener", ossimListener);
+
+void ossimROIEventListener::processEvent(ossimEvent& event)
+{
+   if(event.isConsumed()) return;
+   
+   ossimROIEvent* roiEvent = dynamic_cast<ossimROIEvent*>(&event);
+   if(roiEvent)
+   {
+      const int type = roiEvent->getEventType();
+      
+      switch ( type )
+      {
+      case ossimROIEvent::OSSIM_RECTANGLE_ROI:
+         handleRectangleROIEvent( *roiEvent );
+         break;
+
+      case ossimROIEvent::OSSIM_POLYGON_ROI:
+         handlePolygonROIEvent( *roiEvent );
+         break;
+
+
+      case ossimROIEvent::OSSIM_POLYLINE_ROI:
+         handlePolylineROIEvent( *roiEvent );
+         break;
+
+         default:
+         break;
+      }
+   }
+}
+
+void ossimROIEventListener::handleRectangleROIEvent( ossimROIEvent& /* event */)
+{
+}
+
+void ossimROIEventListener::handlePolygonROIEvent( ossimROIEvent& /* event */)
+{
+}
+
+void ossimROIEventListener::handlePolylineROIEvent( ossimROIEvent& /* event */)
+{
+}
diff --git a/ossim/src/ossim/base/ossimRationalNumber.cpp b/src/base/ossimRationalNumber.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimRationalNumber.cpp
rename to src/base/ossimRationalNumber.cpp
diff --git a/src/base/ossimRectanglePartitioner.cpp b/src/base/ossimRectanglePartitioner.cpp
new file mode 100644
index 0000000..6d168fe
--- /dev/null
+++ b/src/base/ossimRectanglePartitioner.cpp
@@ -0,0 +1,248 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2004 David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// Utility class to partition up a rectangle.
+//
+// $Id: ossimRectanglePartitioner.cpp 9094 2006-06-13 19:12:40Z dburken $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimRectanglePartitioner.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTrace.h>
+using namespace std;
+
+static ossimTrace traceDebug("ossimRectanglePartitioner:degug");
+
+ossimRectanglePartitioner::ossimRectanglePartitioner()
+{
+}
+
+ossimRectanglePartitioner::~ossimRectanglePartitioner()
+{
+}
+
+void ossimRectanglePartitioner::binaryPartition(
+   const ossimIrect& inputRectangle,
+   vector<ossimIrect>& result,
+   ossim_uint64 maxSizeInBytes,
+   ossim_uint32 bands,
+   ossim_uint32 bytesPerPixel,
+   ossim_uint32 internalOverlapPixels) const
+{
+   // Clear the result rect for starters.
+   result.clear();
+
+   // Some sanity checks.
+   if (maxSizeInBytes == 0)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Waning:  0 passed for max size in bytes.  Returning..."
+         << endl;
+      return;
+   }
+   if (bands == 0)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Waning:  0 passed for number of bands.  Returning..."
+         << endl;
+      return;
+   }
+   if (bytesPerPixel == 0)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Waning:  0 passed for bytes per pixel.  Returning..."
+         << endl;
+      return;
+   }
+   if (inputRectangle.hasNans())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Waning:  Input rectangle has nans in it!  Returning..."
+         << endl;
+      return;
+   }
+   if ( (maxSizeInBytes / (bands*bytesPerPixel)) < 4)
+   {
+      // Come on now you have to have at least four pixels.
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Waning:  Max size in bytes too small.  Returning..."
+         << endl;
+      return;
+   }
+   // End of sanity checks...
+
+   // Check the size... We could already be there.
+   if (getSize(inputRectangle, bands, bytesPerPixel) <= maxSizeInBytes)
+   {
+      result.push_back(inputRectangle);
+
+      if (traceDebug())
+      {
+         trace(inputRectangle, result, maxSizeInBytes, bands, bytesPerPixel);
+      }
+      
+      return;
+   }   
+
+   // OK, find the rectangle size that gets that will fit the max size.
+   ossimIrect tileRect = inputRectangle;
+   
+   splitUntilLessThanMax(tileRect,
+                         maxSizeInBytes,
+                         bands,
+                         bytesPerPixel,
+                         internalOverlapPixels);
+
+   ossim_int32 input_width  = static_cast<ossim_int32>(inputRectangle.width());
+   ossim_int32 input_height = static_cast<ossim_int32>(inputRectangle.height());
+
+   ossim_int32 tile_width   = static_cast<ossim_int32>(tileRect.width());
+   ossim_int32 tile_height  = static_cast<ossim_int32>(tileRect.height());
+
+   ossim_int32 tiles_wide   = (input_width % tile_width) ?
+      ( (input_width/tile_width)+1) : (input_width/tile_width);
+   ossim_int32 tiles_high   = (input_height % tile_height) ?
+      ( (input_height/tile_height)+1) : (input_height/tile_height);
+
+   ossim_int32 y_start = inputRectangle.ul().y;
+   ossim_int32 y_stop  = y_start + tile_height - 1 + internalOverlapPixels;
+
+   for (ossim_int32 y = 0; y < tiles_high; ++y)
+   {
+      // Clip to bottom if needed.
+      if (y_stop > inputRectangle.lr().y)
+      {
+         y_stop = inputRectangle.lr().y;
+      }
+      
+      ossim_int32 x_start = inputRectangle.ul().x;
+      ossim_int32 x_stop  = x_start + tile_width - 1 + internalOverlapPixels;
+      
+      for (ossim_int32 x = 0; x < tiles_wide; ++x)
+      {
+         // Clip to right edge is needed.
+         if (x_stop > inputRectangle.lr().x)
+         {
+            x_stop = inputRectangle.lr().x;
+         }
+
+         ossimIrect r(x_start, y_start, x_stop, y_stop);
+
+         // Add it to the result.
+         result.push_back(r);
+         
+         if( 0 == x )
+         {
+            x_start += tile_width - internalOverlapPixels;
+         }
+         else
+         {
+            x_start += tile_width;
+         }
+         x_stop  += tile_width;
+         
+      } // End of tiles_wide loop.
+      
+      if( 0 == y )
+      {
+         y_start += tile_height - internalOverlapPixels;
+      }
+      else
+      {
+         y_start += tile_height;
+      }
+      y_stop  += tile_height;
+      
+   } // End of tiles_high loop.
+   
+   if (traceDebug())
+   {
+      trace(inputRectangle, result, maxSizeInBytes, bands, bytesPerPixel);
+   }
+}
+
+void ossimRectanglePartitioner::splitUntilLessThanMax(
+   ossimIrect& rect,
+   ossim_uint64 maxSizeInBytes,
+   ossim_uint32 bands,
+   ossim_uint32 bytesPerPixel,
+   ossim_uint32 internalOverlapPixels) const
+{
+   do
+   {
+      splitRect(rect);
+
+   } while ( getSize(rect,
+                     bands,
+                     bytesPerPixel,
+                     internalOverlapPixels) > maxSizeInBytes );
+}
+
+void ossimRectanglePartitioner::splitRect(ossimIrect& rect) const
+{
+   ossim_int32 width  = static_cast<ossim_int32>(rect.width());
+   ossim_int32 height = static_cast<ossim_int32>(rect.height());
+   ossim_int32 new_width;
+   ossim_int32 new_height;
+   
+   if (height > width)
+   {
+      new_width  = width;
+      new_height = (height % 2) ? ( (height/2) + 1 ) : (height/2);
+   }
+   else
+   {
+      new_width  = (width % 2) ? ( (width/2) + 1) : (width/2);
+      new_height = height;
+   }
+   
+   rect = ossimIrect(0, 0, new_width-1, new_height-1);
+}
+
+ossim_uint64 ossimRectanglePartitioner::getSize(
+   const ossimIrect& rect,
+   ossim_uint32 bands,
+   ossim_uint32 bytesPerPixel,
+   ossim_uint32 internalOverlapPixels) const
+{
+   return( ( rect.width()  + 2 * internalOverlapPixels ) *
+           ( rect.height() + 2 * internalOverlapPixels ) *
+           bands * bytesPerPixel );
+}
+
+void ossimRectanglePartitioner::trace(const ossimIrect& r,
+                                      const std::vector<ossimIrect>& v,
+                                      ossim_uint64 maxSizeInBytes,
+                                      ossim_uint32 bands,
+                                      ossim_uint32 bytesPerPixel) const
+{
+   ossimNotify(ossimNotifyLevel_DEBUG)
+      << "ossimRectanglePartitioner DEBUG:"
+      << "\nInput rectangle:            " << r
+      << "\nInput rectangle byte size:  " << getSize(r, bands, bytesPerPixel)
+      << "\nTile max size in bytes:     " << maxSizeInBytes
+      << "\nbands:                      " << bands
+      << "\nbytesPerPixel:              " << bytesPerPixel
+      << "\nNumber of output tiles:     " << v.size()
+      << "\nTiled rectangles:\n";
+
+   int index = 0;
+   vector<ossimIrect>::const_iterator i = v.begin();
+   while(i != v.end())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "tile[" << index << "]:  " << *i
+         << "\nsize in bytes:  " << getSize(*i, bands, bytesPerPixel)
+         << endl;
+      ++i;
+      ++index;
+   }
+}
diff --git a/src/base/ossimRectilinearDataObject.cpp b/src/base/ossimRectilinearDataObject.cpp
new file mode 100644
index 0000000..ab34780
--- /dev/null
+++ b/src/base/ossimRectilinearDataObject.cpp
@@ -0,0 +1,308 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// Contributor: David A. Horner (DAH) - http://dave.thehorners.com
+//
+//*************************************************************************
+// $Id: ossimRectilinearDataObject.cpp 22828 2014-07-11 15:56:19Z dburken $
+
+#include <ossim/base/ossimRectilinearDataObject.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <sstream>
+
+RTTI_DEF1(ossimRectilinearDataObject, "ossimRectilinearDataObject", ossimDataObject);
+
+ossimRectilinearDataObject::ossimRectilinearDataObject()
+   : ossimDataObject(),
+     m_numberOfDataComponents(0),
+     m_scalarType(),
+     m_dataBuffer(),
+     m_spatialExtents()
+{
+}
+
+ossimRectilinearDataObject::ossimRectilinearDataObject(
+   const ossimRectilinearDataObject& rhs)
+   : ossimDataObject(rhs),
+     m_numberOfDataComponents(rhs.m_numberOfDataComponents),
+     m_scalarType(rhs.m_scalarType),
+     m_dataBuffer(rhs.m_dataBuffer),
+     m_spatialExtents(rhs.m_spatialExtents)
+{
+}
+
+ossimRectilinearDataObject::ossimRectilinearDataObject(
+   ossim_uint32 numberOfSpatialComponents,
+   ossimSource* owner,
+   ossim_uint32 numberOfDataComponents,
+   ossimScalarType   scalarType,
+   ossimDataObjectStatus /* status */)
+   :ossimDataObject(owner, OSSIM_NULL),
+    m_numberOfDataComponents(numberOfDataComponents),
+    m_scalarType(scalarType),
+    m_dataBuffer(0),
+    m_spatialExtents(numberOfSpatialComponents)
+{
+}
+
+ossimRectilinearDataObject::ossimRectilinearDataObject(
+   ossimSource* owner,
+   ossim_uint32 numberOfDataComponents,
+   ossim_uint32 length,
+   ossimScalarType   scalarType,
+   ossimDataObjectStatus /* status */ )
+   :ossimDataObject(owner, OSSIM_NULL),
+    m_numberOfDataComponents(numberOfDataComponents),
+    m_scalarType(scalarType),
+    m_dataBuffer(0),
+    m_spatialExtents(1)
+{
+   m_spatialExtents[0] = length;
+}
+
+ossimRectilinearDataObject::ossimRectilinearDataObject(
+   ossimSource* owner,
+   ossim_uint32 numberOfDataComponents,
+   ossim_uint32 width,
+   ossim_uint32 height,
+   ossimScalarType   scalarType,
+   ossimDataObjectStatus /* status */)
+   :ossimDataObject(owner, OSSIM_NULL),
+    m_numberOfDataComponents(numberOfDataComponents),
+    m_scalarType(scalarType),
+    m_dataBuffer(0),
+    m_spatialExtents(2)
+{
+   m_spatialExtents[0] = width;
+   m_spatialExtents[1] = height;
+}
+
+ossimRectilinearDataObject::ossimRectilinearDataObject(
+   ossimSource* owner,
+   ossim_uint32 numberOfDataComponents,
+   ossim_uint32 width,
+   ossim_uint32 height,
+   ossim_uint32 depth,
+   ossimScalarType   scalarType,
+   ossimDataObjectStatus /* status */)
+   :ossimDataObject(owner, OSSIM_NULL),
+    m_numberOfDataComponents(numberOfDataComponents),
+    m_scalarType(scalarType),
+    m_dataBuffer(0),
+    m_spatialExtents(3)
+{
+   m_spatialExtents[0] = width;
+   m_spatialExtents[1] = height;
+   m_spatialExtents[2] = depth;
+}
+
+ossimRectilinearDataObject::~ossimRectilinearDataObject()
+{
+}
+
+ossim_uint32 ossimRectilinearDataObject::computeSpatialProduct()const
+{
+   ossim_uint32 spatialProduct = 0;
+   for(ossim_uint32 index = 0; index < m_spatialExtents.size(); ++index)
+   {
+      spatialProduct *= m_spatialExtents[index];
+   }
+   return spatialProduct;
+}
+
+void ossimRectilinearDataObject::setNumberOfDataComponents(ossim_uint32 n)
+{
+   m_numberOfDataComponents = n;
+}
+
+void ossimRectilinearDataObject::setSpatialExtents(ossim_uint32* extents,
+                                                   ossim_uint32 size)
+{
+   if (extents)
+   {
+      m_spatialExtents.resize(size);
+      for(ossim_uint32 i =0; i < size; ++i)
+      {
+         m_spatialExtents[i] = extents[i];
+      }
+   }
+}
+
+void ossimRectilinearDataObject::setScalarType(ossimScalarType type)
+{
+   m_scalarType = type;
+}
+
+ossim_uint32 ossimRectilinearDataObject::getNumberOfDataComponents() const
+{
+   return m_numberOfDataComponents;
+}
+
+ossim_uint32 ossimRectilinearDataObject::getNumberOfSpatialComponents() const
+{
+   return (ossim_uint32)m_spatialExtents.size();
+}
+
+const ossim_uint32* ossimRectilinearDataObject::getSpatialExtents()const
+{
+   return &(m_spatialExtents.front());
+}
+
+ossimScalarType ossimRectilinearDataObject::getScalarType() const
+{
+   return m_scalarType;
+}
+
+ossim_uint32 ossimRectilinearDataObject::getScalarSizeInBytes() const
+{
+   return ossim::scalarSizeInBytes(getScalarType());
+}
+
+void* ossimRectilinearDataObject::getBuf()
+{
+   if (m_dataBuffer.size() > 0)
+   {
+      return static_cast<void*>(&m_dataBuffer.front());
+   }
+   return NULL;
+}
+
+const void* ossimRectilinearDataObject::getBuf()const
+{
+   if (m_dataBuffer.size() > 0)
+   {
+      return static_cast<const void*>(&m_dataBuffer.front());
+   }
+   return NULL;
+}
+
+void ossimRectilinearDataObject::assign(const ossimRectilinearDataObject* data)
+{
+   if(data)
+   {
+      if (this != data)
+      {
+         ossimDataObject::assign(data);
+         
+         m_numberOfDataComponents    = data->m_numberOfDataComponents;
+         m_scalarType                = data->m_scalarType;
+         m_dataBuffer                = data->m_dataBuffer;
+         m_spatialExtents            = data->m_spatialExtents;
+      }
+   }
+}
+
+void ossimRectilinearDataObject::initialize()
+{
+   if (m_dataBuffer.size() != getDataSizeInBytes())
+   {
+      // std::vector::resize can throw a std::bad_alloc so wrap it...
+      try
+      {
+         m_dataBuffer.resize( getDataSizeInBytes() );
+      }
+      catch( std::exception& e )
+      {
+         std::ostringstream errMsg;
+         errMsg << "ossimRectilinearDataObject::initialize caught exception on resize:\n"
+                << "Buffer size in bytes: " << getDataSizeInBytes()
+                << "\n" << e.what() << std::endl;
+         throw ossimException( errMsg.str() );
+      }
+      
+      setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+   }
+}
+
+ossim_uint32 ossimRectilinearDataObject::getDataSizeInBytes()const
+{
+   return (ossim_uint32)(getScalarSizeInBytes()*
+                         computeSpatialProduct()*
+                         m_numberOfDataComponents);
+}
+
+std::ostream& ossimRectilinearDataObject::print(std::ostream& out) const
+{
+   out << "ossimRectilinearDataObject::print:"
+       << "\nm_numberOfDataComponents:     " << m_numberOfDataComponents
+       << "\ntheNumberOfSpatialComponents:  " << m_spatialExtents.size()
+       << "\nm_scalarType:                 "
+       << (ossimScalarTypeLut::instance()->getEntryString(m_scalarType))
+       << endl;
+   
+   return ossimDataObject::print(out);
+}
+
+const ossimRectilinearDataObject& ossimRectilinearDataObject::operator=(
+   const ossimRectilinearDataObject& rhs)
+{
+   if (this != &rhs)
+   {
+      // ossimDataObject initialization:
+      ossimDataObject::operator=(rhs);
+
+      // ossimRectilinearDataObject (this) initialization:
+      m_numberOfDataComponents    = rhs.m_numberOfDataComponents;
+      m_scalarType                = rhs.m_scalarType;
+      m_dataBuffer                = rhs.m_dataBuffer;
+      m_spatialExtents            = rhs.m_spatialExtents;
+   }
+   return *this;
+}
+
+bool ossimRectilinearDataObject::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimString byteEncoded;
+   ossim::toSimpleStringList(byteEncoded, m_dataBuffer);
+   kwl.add(prefix, "data_buffer", byteEncoded, true);
+   ossim::toSimpleStringList(byteEncoded, m_spatialExtents);
+   kwl.add(prefix, "spatial_extents", byteEncoded, true);
+   kwl.add(prefix, ossimKeywordNames::SCALAR_TYPE_KW, ossimScalarTypeLut::instance()->getEntryString(m_scalarType));
+   
+   return ossimDataObject::saveState(kwl, prefix);
+}
+
+bool ossimRectilinearDataObject::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if(!ossimDataObject::loadState(kwl, prefix)) return false;
+   
+   const char* spatial_extents = kwl.find(prefix, "spatial_extents");
+   const char* data_buffer = kwl.find(prefix, "data_buffer");
+   const char* scalar_type = kwl.find(prefix, ossimKeywordNames::SCALAR_TYPE_KW);
+   m_spatialExtents.clear();
+   m_dataBuffer.clear();
+                                 
+   if(spatial_extents)
+   {
+      if(!ossim::toSimpleVector(m_spatialExtents, ossimString(spatial_extents)))
+      {
+         return false;
+      }
+   }
+   if(data_buffer)
+   {
+      if(!ossim::toSimpleVector(m_dataBuffer, ossimString(kwl.find(prefix, "data_buffer"))))
+      {
+         return false;
+      }
+   }
+   if(scalar_type)
+   {
+      ossimScalarTypeLut::instance()->getScalarTypeFromString(scalar_type);
+   }
+   else 
+   {
+      m_scalarType = OSSIM_SCALAR_UNKNOWN;
+   }
+
+   m_numberOfDataComponents = (ossim_uint32) m_spatialExtents.size();
+   
+   return true;
+   
+}                     
diff --git a/ossim/src/ossim/base/ossimReferenced.cpp b/src/base/ossimReferenced.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimReferenced.cpp
rename to src/base/ossimReferenced.cpp
diff --git a/ossim/src/ossim/base/ossimRefreshEvent.cpp b/src/base/ossimRefreshEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimRefreshEvent.cpp
rename to src/base/ossimRefreshEvent.cpp
diff --git a/src/base/ossimRegExp.cpp b/src/base/ossimRegExp.cpp
new file mode 100644
index 0000000..e0c0720
--- /dev/null
+++ b/src/base/ossimRegExp.cpp
@@ -0,0 +1,1299 @@
+ 
+//
+// Copyright (C) 1991 Texas Instruments Incorporated.
+//
+// Permission is granted to any individual or institution to use, copy, modify,
+// and distribute this software, provided that this complete copyright and
+// permission notice is maintained, intact, in all copies and supporting
+// documentation.
+//
+// Texas Instruments Incorporated provides this software "as is" without
+// express or implied warranty.
+//
+//
+// Created: MNF 06/13/89  Initial Design and Implementation
+// Updated: LGO 08/09/89  Inherit from Generic
+// Updated: MBN 09/07/89  Added conditional exception handling
+// Updated: MBN 12/15/89  Sprinkled "const" qualifiers all over the place!
+// Updated: DLS 03/22/91  New lite version
+//
+// This  is the header file  for the regular  expression class.   An object of
+// this class contains a regular expression,  in  a special "compiled" format.
+// This  compiled format consists  of  several slots   all kept as the objects
+// private data.  The  RegExp class  provides a convenient  way  to  represent
+// regular  expressions.  It makes it easy   to search  for  the  same regular
+// expression in many different strings without having to  compile a string to
+// regular expression format more than necessary.
+//
+// A regular  expression allows a programmer to  specify complex patterns that
+// can be searched for  and  matched against the  character string of a String
+// object.  In  its  simplest case, a   regular expression  is a  sequence  of
+// characters with which you can search for exact character matches.  However,
+// many times you may not know the exact sequence you want to find, or you may
+// only want to find a match at the beginning or end of  a String.  The RegExp
+// object  allows specification of  such patterns by  utilizing the  following
+// regular  expression  meta-characters   (note   that  more  one  of    these
+// meta-characters  can  be used in a single  regular  expression in  order to
+// create complex search patterns):
+//
+//         ^    Match at beginning of line
+//         $    Match at end of line
+//         .    Match any single character
+//         [ ]  Match any one character inside the brackets
+//         [^ ] Match any character NOT inside the brackets
+//         -    Match any character in range on either side of dash
+//         *    Match preceding pattern zero or more times
+//         +    Match preceding pattern one or more times
+//         ?    Match preceding pattern zero or once only
+//         ()   Save a matched expression and use it in a further match.
+//
+// There are three constructors for RegExp.  One  just creates an empty RegExp
+// object.  Another creates a RegExp object  and initializes it with a regular
+// expression  that is given  in  the form of a   char*.   The  third  takes a
+// reference  to  a RegExp  object    as an  argument    and creates an object
+// initialized with the information from the given RegExp object.
+//
+// The  find  member function  finds   the  first  occurence   of  the regualr
+// expression of that object in the string given to find as an argument.  Find
+// returns a boolean, and  if true,  mutates  the private  data appropriately.
+// Find sets pointers to the beginning and end of  the thing last  found, they
+// are pointers into the actual string  that was searched.   The start and end
+// member functions return indicies  into the searched string that  correspond
+// to the beginning   and  end pointers  respectively.   The    compile member
+// function takes a char* and puts the  compiled version of the char* argument
+// into the object's private data fields.  The == and  != operators only check
+// the  to see  if   the compiled  regular  expression   is the same, and  the
+// deep_equal functions also checks  to see if the  start and end pointers are
+// the same.  The is_valid  function returns false if  program is set to NULL,
+// (i.e. there is no valid compiled exression).  The set_invalid function sets
+// the  program to NULL  (Warning: this deletes the compiled  expression). The
+// following examples may help clarify regular expression usage:
+//
+//   *  The regular expression  "^hello" matches  a "hello"  only at  the
+//      beginning of a  line.  It would match "hello  there" but not "hi,
+//      hello there".
+//
+//   *  The regular expression "long$" matches a  "long"  only at the end
+//      of a line. It would match "so long\0", but not "long ago".
+//
+//   *  The regular expression "t..t..g"  will match anything that  has a
+//      "t" then any two characters, another "t", any  two characters and
+//      then a "g".   It will match  "testing", or "test again" but would
+//      not match "toasting"
+//
+//   *  The regular  expression "[1-9ab]" matches any  number one through
+//      nine, and the characters  "a" and  "b".  It would match "hello 1"
+//      or "begin", but would not match "no-match".
+//
+//   *  The  regular expression "[^1-9ab]"  matches any character that is
+//      not a number one  through nine, or  an "a" or "b".   It would NOT
+//      match "hello 1" or "begin", but would match "no-match".
+//
+//   *  The regular expression "br* " matches  something that begins with
+//      a "b", is followed by zero or more "r"s, and ends in a space.  It
+//      would match "brrrrr ", and "b ", but would not match "brrh ".
+//
+//   *  The regular expression "br+ " matches something  that begins with
+//      a "b", is followed by one or more "r"s, and ends in  a space.  It
+//      would match "brrrrr ",  and  "br ", but would not  match "b  " or
+//      "brrh ".
+//
+//   *  The regular expression "br? " matches  something that begins with
+//      a "b", is followed by zero or one "r"s, and ends in  a space.  It
+//      would  match  "br ", and "b  ", but would not match  "brrrr "  or
+//      "brrh ".
+//
+//   *  The regular expression "(..p)b" matches  something ending with pb
+//      and beginning with whatever the two characters before the first p
+//      encounterd in the line were.  It would find  "repb" in "rep drepa
+//      qrepb".  The regular expression "(..p)a"  would find "repa qrepb"
+//      in "rep drepa qrepb"
+//
+//   *  The regular expression "d(..p)" matches something ending  with p,
+//      beginning with d, and having  two characters  in between that are
+//      the same as the two characters before  the first p  encounterd in
+//      the line.  It would match "drepa qrepb" in "rep drepa qrepb".
+//
+
+#include <cstring>
+#include <cstdio>
+#include <ossim/base/ossimRegExp.h>
+#include <iostream>
+// ossimRegExp -- Copies the given regular expression.
+
+ossimRegExp::ossimRegExp (const ossimRegExp& rxp) :
+  regstart(0),     // Internal use only
+  reganch(0),      // Internal use only
+  regmust(0),      // Internal use only
+  regmlen(0),     // Internal use only
+  program(0),   
+  progsize(0),
+  searchstring(0),
+
+ // work variables
+  regparse(0),
+  regnpar(0),  // () count.
+  regdummy(0),
+  regcode(0),  // Code-emit pointer; &regdummy = don't.
+  regsize(0),  // Code size.
+  reginput(0),  // String-input pointer.
+  regbol(0),  // Beginning of input, for ^ check.
+  regstartp(0), // Pointer to startp array.
+  regendp(0) // Ditto for endp.
+{
+   if(rxp.program)
+   {
+      int ind = 0; 
+      this->progsize = rxp.progsize;		// Copy regular expression size
+      this->program = new char[this->progsize];	// Allocate storage
+      for(ind=this->progsize; ind-- != 0;)		// Copy regular expresion
+         this->program[ind] = rxp.program[ind];
+      this->startp[0] = rxp.startp[0];		// Copy pointers into last
+      this->endp[0] = rxp.endp[0];			// Successful "find" operation
+      this->regmust = rxp.regmust;			// Copy field
+      if (rxp.regmust != NULL) {
+         char* dum = rxp.program;
+         ind = 0;
+         while (dum != rxp.regmust) {
+            ++dum;
+            ++ind;
+         }
+         this->regmust = this->program + ind;
+      }
+      this->regstart = rxp.regstart;		// Copy starting index
+      this->reganch = rxp.reganch;			// Copy remaining private data
+      this->regmlen = rxp.regmlen;			// Copy remaining private data
+   }
+}
+
+
+// operator== -- Returns true if two regular expressions have the same
+// compiled program for pattern matching.
+
+bool ossimRegExp::operator== (const ossimRegExp& rxp) const {
+  if (this != &rxp) {				// Same address?
+    ossim_uint32 ind = this->progsize;		// Get regular expression size
+    if (ind != rxp.progsize)			// If different size regexp
+      return false;				// Return failure
+    while(ind-- != 0)				// Else while still characters
+      if(this->program[ind] != rxp.program[ind]) // If regexp are different    
+	return false;				 // Return failure             
+  }
+  return true;					// Else same, return success  
+}
+
+
+// deep_equal -- Returns true if have the same compiled regular expressions
+// and the same start and end pointers.
+
+bool ossimRegExp::deep_equal (const ossimRegExp& rxp) const {
+  ossim_uint32 ind = this->progsize;		// Get regular expression size
+  if (ind != rxp.progsize)			// If different size regexp
+    return false;				// Return failure
+  while(ind-- != 0)		 		// Else while still characters
+    if(this->program[ind] != rxp.program[ind])	// If regexp are different    
+      return false;				// Return failure             
+  return (this->startp[0] == rxp.startp[0] && 	// Else if same start/end ptrs,
+	  this->endp[0] == rxp.endp[0]);	// Return true
+}   
+
+// The remaining code in this file is derived from the  regular expression code
+// whose  copyright statement appears  below.  It has been  changed to work
+// with the class concepts of C++ and COOL.
+
+/*
+ * compile and find 
+ *
+ *	Copyright (c) 1986 by University of Toronto.
+ *	Written by Henry Spencer.  Not derived from licensed software.
+ *
+ *	Permission is granted to anyone to use this software for any
+ *	purpose on any computer system, and to redistribute it freely,
+ *	subject to the following restrictions:
+ *
+ *	1. The author is not responsible for the consequences of use of
+ *		this software, no matter how awful, even if they arise
+ *		from defects in it.
+ *
+ *	2. The origin of this software must not be misrepresented, either
+ *		by explicit claim or by omission.
+ *
+ *	3. Altered versions must be plainly marked as such, and must not
+ *		be misrepresented as being the original software.
+ *
+ * Beware that some of this code is subtly aware of the way operator
+ * precedence is structured in regular expressions.  Serious changes in
+ * regular-expression syntax might require a total rethink.
+ */
+
+/*
+ * The "internal use only" fields in regexp.h are present to pass info from
+ * compile to execute that permits the execute phase to run lots faster on
+ * simple cases.  They are:
+ *
+ * regstart	char that must begin a match; '\0' if none obvious
+ * reganch	is the match anchored (at beginning-of-line only)?
+ * regmust	string (pointer into program) that match must include, or NULL
+ * regmlen	length of regmust string
+ *
+ * Regstart and reganch permit very fast decisions on suitable starting points
+ * for a match, cutting down the work a lot.  Regmust permits fast rejection
+ * of lines that cannot possibly match.  The regmust tests are costly enough
+ * that compile() supplies a regmust only if the r.e. contains something
+ * potentially expensive (at present, the only such thing detected is * or +
+ * at the start of the r.e., which can involve a lot of backup).  Regmlen is
+ * supplied because the test in find() needs it and compile() is computing
+ * it anyway.
+ */
+
+/*
+ * Structure for regexp "program".  This is essentially a linear encoding
+ * of a nondeterministic finite-state machine (aka syntax charts or
+ * "railroad normal form" in parsing technology).  Each node is an opcode
+ * plus a "next" pointer, possibly plus an operand.  "Next" pointers of
+ * all nodes except BRANCH implement concatenation; a "next" pointer with
+ * a BRANCH on both ends of it is connecting two alternatives.  (Here we
+ * have one of the subtle syntax dependencies:  an individual BRANCH (as
+ * opposed to a collection of them) is never concatenated with anything
+ * because of operator precedence.)  The operand of some types of node is
+ * a literal string; for others, it is a node leading into a sub-FSM.  In
+ * particular, the operand of a BRANCH node is the first node of the branch.
+ * (NB this is *not* a tree structure:  the tail of the branch connects
+ * to the thing following the set of BRANCHes.)  The opcodes are:
+ */
+
+// definition	number	opnd?	meaning
+#define	END	0		// no	End of program.
+#define	BOL	1		// no	Match "" at beginning of line.
+#define	EOL	2		// no	Match "" at end of line.
+#define	ANY	3		// no	Match any one character.
+#define	ANYOF	4		// str	Match any character in this string.
+#define	ANYBUT	5		// str	Match any character not in this
+				// string.
+#define	BRANCH	6		// node	Match this alternative, or the
+				// next...
+#define	BACK	7		// no	Match "", "next" ptr points backward.
+#define	EXACTLY	8		// str	Match this string.
+#define	NOTHING	9		// no	Match empty string.
+#define	STAR	10		// node	Match this (simple) thing 0 or more
+				// times.
+#define	PLUS	11		// node	Match this (simple) thing 1 or more
+				// times.
+#define	OPEN	20		// no	Mark this point in input as start of
+				// #n.
+// OPEN+1 is number 1, etc.
+#define	CLOSE	30		// no	Analogous to OPEN.
+
+/*
+ * Opcode notes:
+ *
+ * BRANCH	The set of branches constituting a single choice are hooked
+ *		together with their "next" pointers, since precedence prevents
+ *		anything being concatenated to any individual branch.  The
+ *		"next" pointer of the last BRANCH in a choice points to the
+ *		thing following the whole choice.  This is also where the
+ *		final "next" pointer of each individual branch points; each
+ *		branch starts with the operand node of a BRANCH node.
+ *
+ * BACK		Normal "next" pointers all implicitly point forward; BACK
+ *		exists to make loop structures possible.
+ *
+ * STAR,PLUS	'?', and complex '*' and '+', are implemented as circular
+ *		BRANCH structures using BACK.  Simple cases (one character
+ *		per match) are implemented with STAR and PLUS for speed
+ *		and to minimize recursive plunges.
+ *
+ * OPEN,CLOSE	...are numbered at compile time.
+ */
+
+/*
+ * A node is one char of opcode followed by two chars of "next" pointer.
+ * "Next" pointers are stored as two 8-bit pieces, high order first.  The
+ * value is a positive offset from the opcode of the node containing it.
+ * An operand, if any, simply follows the node.  (Note that much of the
+ * code generation knows about this implicit relationship.)
+ *
+ * Using two bytes for the "next" pointer is vast overkill for most things,
+ * but allows patterns to get big without disasters.
+ */
+
+#define	OP(p)		(*(p))
+#define	NEXT(p)		(((*((p)+1)&0377)<<8) + (*((p)+2)&0377))
+#define	OPERAND(p)	((p) + 3)
+
+const unsigned char MAGIC = 0234;
+/*
+ * Utility definitions.
+ */
+
+#define	UCHARAT(p)	((const unsigned char*)(p))[0]
+
+
+#define	FAIL(m)	{ regerror(m); return(NULL); }
+#define	ISMULT(c)	((c) == '*' || (c) == '+' || (c) == '?')
+#define	META	"^$.[()|?+*\\"
+
+
+/*
+ * Flags to be passed up and down.
+ */
+#define	HASWIDTH	01	// Known never to match null string.
+#define	SIMPLE		02	// Simple enough to be STAR/PLUS operand.
+#define	SPSTART		04	// Starts with * or +.
+#define	WORST		0	// Worst case.
+
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+//  COMPILE AND ASSOCIATED FUNCTIONS
+//
+/////////////////////////////////////////////////////////////////////////
+
+
+/*
+ * Global work variables for compile().
+ */
+// static const char* regparse;	// Input-scan pointer.
+// static       int   regnpar;	// () count.
+// static       char  regdummy;
+// static       char* regcode;	// Code-emit pointer; &regdummy = don't.
+// static       long  regsize;	// Code size.
+
+/*
+ * Forward declarations for compile()'s friends.
+ */
+// #ifndef static
+// #define	static	static
+// #endif
+// static       char* reg (int, int*);
+// static       char* regbranch (int*);
+// static       char* regpiece (int*);
+// static       char* regatom (int*);
+// static       char* regnode (char);
+// static const char* regnext (const char*);
+// static       char* regnext (char*);
+// static void        regc (unsigned char);
+// static void        reginsert (char, char*);
+// static void        regtail (char*, const char*);
+// static void        regoptail (char*, const char*);
+
+// #ifdef STRCSPN
+// static int strcspn ();
+// #endif
+
+
+
+/*
+ * We can't allocate space until we know how big the compiled form will be,
+ * but we can't compile it (and thus know how big it is) until we've got a
+ * place to put the code.  So we cheat:  we compile it twice, once with code
+ * generation turned off and size counting turned on, and once "for real".
+ * This also means that we don't allocate space until we are sure that the
+ * thing really will compile successfully, and we never have to move the
+ * code and thus invalidate pointers into it.  (Note that it has to be in
+ * one piece because free() must be able to free it all.)
+ *
+ * Beware that the optimization-preparation code in here knows about some
+ * of the structure of the compiled regexp.
+ */
+
+
+// compile -- compile a regular expression into internal code
+// for later pattern matching.
+
+void ossimRegExp::compile (const char* exp) {
+    const char* scan;
+    const char* longest;
+    unsigned long len;
+             int         flags;
+
+    if (exp == NULL) {
+      //RAISE Error, SYM(ossimRegExp), SYM(No_Expr),
+      printf ("ossimRegExp::compile(): No expression supplied.\n");
+      return;
+    }
+
+    // First pass: determine size, legality.
+    regparse = exp;
+    regnpar = 1;
+    regsize = 0L;
+    regcode = ®dummy;
+    regc(MAGIC);
+    if(!reg(0, &flags))
+      {
+	printf ("ossimRegExp::compile(): Error in compile.\n");
+	return;
+      }
+    this->startp[0] = this->endp[0] = this->searchstring = NULL;
+
+    // Small enough for pointer-storage convention? 
+    if (regsize >= 32767L) {	// Probably could be 65535L. 
+      //RAISE Error, SYM(ossimRegExp), SYM(Expr_Too_Big),
+      printf ("ossimRegExp::compile(): Expression too big.\n");
+      return;
+    }
+
+    // Allocate space. 
+//#ifndef WIN32
+    if (this->program != NULL) delete [] this->program;  
+//#endif
+    this->program = new char[regsize];
+    this->progsize = (int) regsize;
+
+    if (this->program == NULL) {
+      //RAISE Error, SYM(ossimRegExp), SYM(Out_Of_Memory),
+      printf ("ossimRegExp::compile(): Out of memory.\n"); 
+      return;
+    }
+
+    // Second pass: emit code.
+    regparse = exp;
+    regnpar = 1;
+    regcode = this->program;
+    regc(MAGIC);
+    reg(0, &flags);
+
+    // Dig out information for optimizations.
+    this->regstart = '\0';		// Worst-case defaults.
+    this->reganch = 0;
+    this->regmust = NULL;
+    this->regmlen = 0;
+    scan = this->program + 1;	// First BRANCH.
+    if (OP(regnext(scan)) == END) {	// Only one top-level choice.
+	scan = OPERAND(scan);
+
+	// Starting-point info.
+	if (OP(scan) == EXACTLY)
+	    this->regstart = *OPERAND(scan);
+	else if (OP(scan) == BOL)
+	    this->reganch++;
+
+	 //
+	 // If there's something expensive in the r.e., find the longest
+	 // literal string that must appear and make it the regmust.  Resolve
+	 // ties in favor of later strings, since the regstart check works
+	 // with the beginning of the r.e. and avoiding duplication
+	 // strengthens checking.  Not a strong reason, but sufficient in the
+	 // absence of others. 
+	 //
+	if (flags & SPSTART) {
+	    longest = NULL;
+	    len = 0;
+	    for (; scan != NULL; scan = regnext(scan))
+		if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) {
+		    longest = OPERAND(scan);
+		    len = (unsigned long)strlen(OPERAND(scan));
+		}
+	    this->regmust = longest;
+	    this->regmlen = len;
+	}
+    }
+}
+
+
+/*
+ - reg - regular expression, i.e. main body or parenthesized thing
+ *
+ * Caller must absorb opening parenthesis.
+ *
+ * Combining parenthesis handling with the base level of regular expression
+ * is a trifle forced, but the need to tie the tails of the branches to what
+ * follows makes it hard to avoid.
+ */
+char* ossimRegExp::reg (int paren, int *flagp) {
+    char* ret;
+    char* br;
+    char* ender;
+    int   parno =0;
+             int   flags;
+
+    *flagp = HASWIDTH;		// Tentatively.
+
+    // Make an OPEN node, if parenthesized.
+    if (paren) {
+	if (regnpar >= NSUBEXP) {
+	  //RAISE Error, SYM(ossimRegExp), SYM(Too_Many_Parens),
+	  printf ("ossimRegExp::compile(): Too many parentheses.\n");
+	  return 0;
+        }
+	parno = regnpar;
+	regnpar++;
+	ret = regnode(OPEN + parno);
+    }
+    else
+	ret = NULL;
+
+    // Pick up the branches, linking them together.
+    br = regbranch(&flags);
+    if (br == NULL)
+	return (NULL);
+    if (ret != NULL)
+	regtail(ret, br);	// OPEN -> first.
+    else
+	ret = br;
+    if (!(flags & HASWIDTH))
+	*flagp &= ~HASWIDTH;
+    *flagp |= flags & SPSTART;
+    while (*regparse == '|') {
+	regparse++;
+	br = regbranch(&flags);
+	if (br == NULL)
+	    return (NULL);
+	regtail(ret, br);	// BRANCH -> BRANCH.
+	if (!(flags & HASWIDTH))
+	    *flagp &= ~HASWIDTH;
+	*flagp |= flags & SPSTART;
+      }
+
+    // Make a closing node, and hook it on the end.
+    ender = regnode((paren) ? CLOSE + parno : END);
+    regtail(ret, ender);
+
+    // Hook the tails of the branches to the closing node.
+    for (br = ret; br != NULL; br = regnext(br))
+	regoptail(br, ender);
+
+    // Check for proper termination.
+    if (paren && *regparse++ != ')') {
+        //RAISE Error, SYM(ossimRegExp), SYM(Unmatched_Parens),
+        printf ("ossimRegExp::compile(): Unmatched parentheses.\n");
+	return 0;
+    }
+    else if (!paren && *regparse != '\0') {
+        if (*regparse == ')') {
+            //RAISE Error, SYM(ossimRegExp), SYM(Unmatched_Parens),
+            printf ("ossimRegExp::compile(): Unmatched parentheses.\n");
+	    return 0;
+	}
+	else {
+	    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
+	    printf ("ossimRegExp::compile(): Internal error.\n");
+	    return 0;
+        }
+	// NOTREACHED
+    }
+    return (ret);
+}
+
+
+/*
+ - regbranch - one alternative of an | operator
+ *
+ * Implements the concatenation operator.
+ */
+char* ossimRegExp::regbranch (int *flagp) {
+    char* ret;
+    char* chain;
+    char* latest;
+    int                  flags;
+
+    *flagp = WORST;		// Tentatively.
+
+    ret = regnode(BRANCH);
+    chain = NULL;
+    while (*regparse != '\0' && *regparse != '|' && *regparse != ')') {
+	latest = regpiece(&flags);
+	if (latest == NULL)
+	    return (NULL);
+	*flagp |= flags & HASWIDTH;
+	if (chain == NULL)	// First piece.
+	    *flagp |= flags & SPSTART;
+	else
+	    regtail(chain, latest);
+	chain = latest;
+    }
+    if (chain == NULL)		// Loop ran zero times.
+	regnode(NOTHING);
+
+    return (ret);
+}
+
+
+/*
+ - regpiece - something followed by possible [*+?]
+ *
+ * Note that the branching code sequences used for ? and the general cases
+ * of * and + are somewhat optimized:  they use the same NOTHING node as
+ * both the endmarker for their branch list and the body of the last branch.
+ * It might seem that this node could be dispensed with entirely, but the
+ * endmarker role is not redundant.
+ */
+char* ossimRegExp::regpiece (int *flagp) {
+    char* ret;
+    char  op;
+    char* next;
+    int            flags;
+
+    ret = regatom(&flags);
+    if (ret == NULL)
+	return (NULL);
+
+    op = *regparse;
+    if (!ISMULT(op)) {
+	*flagp = flags;
+	return (ret);
+    }
+
+    if (!(flags & HASWIDTH) && op != '?') {
+        //RAISE Error, SYM(ossimRegExp), SYM(Empty_Operand),
+        printf ("ossimRegExp::compile() : *+ operand could be empty.\n");
+	return 0;
+    }
+    *flagp = (op != '+') ? (WORST | SPSTART) : (WORST | HASWIDTH);
+
+    if (op == '*' && (flags & SIMPLE))
+	reginsert(STAR, ret);
+    else if (op == '*') {
+	// Emit x* as (x&|), where & means "self".
+	reginsert(BRANCH, ret);	// Either x
+	regoptail(ret, regnode(BACK));	// and loop
+	regoptail(ret, ret);	// back
+	regtail(ret, regnode(BRANCH));	// or
+	regtail(ret, regnode(NOTHING));	// null.
+    }
+    else if (op == '+' && (flags & SIMPLE))
+	reginsert(PLUS, ret);
+    else if (op == '+') {
+	// Emit x+ as x(&|), where & means "self".
+	next = regnode(BRANCH);	// Either
+	regtail(ret, next);
+	regtail(regnode(BACK), ret);	// loop back
+	regtail(next, regnode(BRANCH));	// or
+	regtail(ret, regnode(NOTHING));	// null.
+    }
+    else if (op == '?') {
+	// Emit x? as (x|)
+	reginsert(BRANCH, ret);	// Either x
+	regtail(ret, regnode(BRANCH));	// or
+	next = regnode(NOTHING);// null.
+	regtail(ret, next);
+	regoptail(ret, next);
+    }
+    regparse++;
+    if (ISMULT(*regparse)) {
+        //RAISE Error, SYM(ossimRegExp), SYM(Nested_Operand),
+        printf ("ossimRegExp::compile(): Nested *?+.\n");
+	return 0;
+    }
+    return (ret);
+}
+
+
+/*
+ - regatom - the lowest level
+ *
+ * Optimization:  gobbles an entire sequence of ordinary characters so that
+ * it can turn them into a single node, which is smaller to store and
+ * faster to run.  Backslashed characters are exceptions, each becoming a
+ * separate node; the code is simpler that way and it's not worth fixing.
+ */
+char* ossimRegExp::regatom (int *flagp) {
+    char* ret;
+             int   flags;
+
+    *flagp = WORST;		// Tentatively.
+
+    switch (*regparse++) {
+	case '^':
+	    ret = regnode(BOL);
+	    break;
+	case '$':
+	    ret = regnode(EOL);
+	    break;
+	case '.':
+	    ret = regnode(ANY);
+	    *flagp |= HASWIDTH | SIMPLE;
+	    break;
+	case '[':{
+		int    rxpclass;
+		int    rxpclassend;
+
+		if (*regparse == '^') {	// Complement of range.
+		    ret = regnode(ANYBUT);
+		    regparse++;
+		}
+		else
+		    ret = regnode(ANYOF);
+		if (*regparse == ']' || *regparse == '-')
+		    regc(*regparse++);
+		while (*regparse != '\0' && *regparse != ']') {
+		    if (*regparse == '-') {
+			regparse++;
+			if (*regparse == ']' || *regparse == '\0')
+			    regc('-');
+			else {
+			    rxpclass = UCHARAT(regparse - 2) + 1;
+			    rxpclassend = UCHARAT(regparse);
+			    if (rxpclass > rxpclassend + 1) {
+			       //RAISE Error, SYM(ossimRegExp), SYM(Invalid_Range),
+			       printf ("ossimRegExp::compile(): Invalid range in [].\n");
+			       return 0;
+                            }
+			    for (; rxpclass <= rxpclassend; rxpclass++)
+				regc(rxpclass);
+			    regparse++;
+			}
+		    }
+		    else
+			regc(*regparse++);
+		}
+		regc('\0');
+		if (*regparse != ']') {
+                    //RAISE Error, SYM(ossimRegExp), SYM(Unmatched_Bracket),
+                    printf ("ossimRegExp::compile(): Unmatched [].\n");
+		    return 0;
+	        }
+		regparse++;
+		*flagp |= HASWIDTH | SIMPLE;
+	    }
+	    break;
+	case '(':
+	    ret = reg(1, &flags);
+	    if (ret == NULL)
+		return (NULL);
+	    *flagp |= flags & (HASWIDTH | SPSTART);
+	    break;
+	case '\0':
+	case '|':
+	case ')':
+	    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
+            printf ("ossimRegExp::compile(): Internal error.\n"); // Never here
+	    return 0;
+	case '?':
+	case '+':
+	case '*':
+	    //RAISE Error, SYM(ossimRegExp), SYM(No_Operand),
+            printf ("ossimRegExp::compile(): ?+* follows nothing.\n");
+	    return 0;
+	case '\\':
+	    if (*regparse == '\0') {
+	        //RAISE Error, SYM(ossimRegExp), SYM(Trailing_Backslash),
+                printf ("ossimRegExp::compile(): Trailing backslash.\n");
+		return 0;
+            }
+	    ret = regnode(EXACTLY);
+	    regc(*regparse++);
+	    regc('\0');
+	    *flagp |= HASWIDTH | SIMPLE;
+	    break;
+	default:{
+		int    len;
+		char   ender;
+
+		regparse--;
+		len = (int)strcspn(regparse, META);
+		if (len <= 0) {
+		    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
+                    printf ("ossimRegExp::compile(): Internal error.\n");
+		    return 0;
+                }
+		ender = *(regparse + len);
+		if (len > 1 && ISMULT(ender))
+		    len--;	// Back off clear of ?+* operand.
+		*flagp |= HASWIDTH;
+		if (len == 1)
+		    *flagp |= SIMPLE;
+		ret = regnode(EXACTLY);
+		while (len > 0) {
+		    regc(*regparse++);
+		    len--;
+		}
+		regc('\0');
+	    }
+	    break;
+    }
+    return (ret);
+}
+
+
+/*
+ - regnode - emit a node
+   Location.
+ */
+char* ossimRegExp::regnode (char op) {
+    char* ret;
+    char* ptr;
+
+    ret = regcode;
+    if (ret == &regdummy) {
+	regsize += 3;
+	return (ret);
+    }
+
+    ptr = ret;
+    *ptr++ = op;
+    *ptr++ = '\0';		// Null "next" pointer.
+    *ptr++ = '\0';
+    regcode = ptr;
+
+    return (ret);
+}
+
+
+/*
+ - regc - emit (if appropriate) a byte of code
+ */
+void ossimRegExp::regc (unsigned char b) {
+    if (regcode != &regdummy)
+	*regcode++ = b;
+    else
+	regsize++;
+}
+
+
+/*
+ - reginsert - insert an operator in front of already-emitted operand
+ *
+ * Means relocating the operand.
+ */
+void ossimRegExp::reginsert (char op, char* opnd) {
+    char* src;
+    char* dst;
+    char* place;
+
+    if (regcode == &regdummy) {
+	regsize += 3;
+	return;
+    }
+
+    src = regcode;
+    regcode += 3;
+    dst = regcode;
+    while (src > opnd)
+	*--dst = *--src;
+
+    place = opnd;		// Op node, where operand used to be.
+    *place++ = op;
+    *place++ = '\0';
+    *place++ = '\0';
+}
+
+
+/*
+ - regtail - set the next-pointer at the end of a node chain
+ */
+void ossimRegExp::regtail (char* p, const char* val) {
+    char* scan;
+    char* temp;
+    int   offset;
+
+    if (p == &regdummy)
+	return;
+
+    // Find last node.
+    scan = p;
+    for (;;) {
+	temp = regnext(scan);
+	if (temp == NULL)
+	    break;
+	scan = temp;
+    }
+
+    if (OP(scan) == BACK)
+	offset = (const char*)scan - val;
+    else
+	offset = val - scan;
+    *(scan + 1) = (offset >> 8) & 0377;
+    *(scan + 2) = offset & 0377;
+}
+
+
+/*
+ - regoptail - regtail on operand of first argument; nop if operandless
+ */
+void ossimRegExp::regoptail (char* p, const char* val) {
+    // "Operandless" and "op != BRANCH" are synonymous in practice.
+    if (p == NULL || p == &regdummy || OP(p) != BRANCH)
+	return;
+    regtail(OPERAND(p), val);
+}
+
+
+
+////////////////////////////////////////////////////////////////////////
+// 
+//  find and friends
+// 
+////////////////////////////////////////////////////////////////////////
+
+
+/*
+ * Global work variables for find().
+ */
+// static const char*  reginput;	// String-input pointer.
+// static const char*  regbol;	// Beginning of input, for ^ check.
+// static const char* *regstartp;	// Pointer to startp array.
+// static const char* *regendp;	// Ditto for endp.
+
+/*
+ * Forwards.
+ */
+// static int regtry (const char*, const char* *,
+// 		   const char* *, const char*);
+// static int regmatch (const char*);
+// static int regrepeat (const char*);
+
+// #ifdef DEBUG
+// int          regnarrate = 0;
+// void         regdump ();
+// static char* regprop ();
+// #endif
+
+
+
+// find -- Matches the regular expression to the given string.
+// Returns true if found, and sets start and end indexes accordingly.
+
+bool ossimRegExp::find (const char* string) {
+    const char* s = 0;
+
+	if(!string) return false;
+    this->searchstring = string;
+
+     // Check validity of program.
+    if (!this->program || UCHARAT(this->program) != MAGIC) {
+        //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
+        printf ("ossimRegExp::find(): Compiled regular expression corrupted.\n");
+        return 0;
+    }
+    
+    // If there is a "must appear" string, look for it.
+    if (this->regmust != NULL) {
+	s = string;
+	while ((s = strchr(s, this->regmust[0])) != NULL) {
+	    if (strncmp(s, this->regmust, this->regmlen) == 0)
+		break;		// Found it.
+	    s++;
+	}
+	if (s == NULL)		// Not present.
+	    return (0);
+    }
+     
+    // Mark beginning of line for ^ .
+    regbol = string;
+
+    // Simplest case:  anchored match need be tried only once.
+    if (this->reganch)
+	return (regtry(string, this->startp, this->endp, this->program));
+    
+    // Messy cases:  unanchored match.
+    s = string;
+    if (this->regstart != '\0')
+	// We know what char it must start with.
+	while ((s = strchr(s, this->regstart)) != NULL) {
+	    if (regtry(s, this->startp, this->endp, this->program))
+		return (1);
+	    s++;
+	  
+	}
+    else
+	// We don't -- general case.
+	do {
+	    if (regtry(s, this->startp, this->endp, this->program))
+		return (1);
+	} while (*s++ != '\0');
+    
+    // Failure.
+    return (0);
+}
+
+
+/*
+ - regtry - try match at specific point
+   0 failure, 1 success
+ */
+int ossimRegExp::regtry (const char* string, const char* *start,
+		   const char* *end, const char* prog) {
+          int    i;
+    const char* *sp1;
+    const char* *ep;
+
+    reginput = string;
+    regstartp = start;
+    regendp = end;
+
+    sp1 = start;
+    ep = end;
+    for (i = NSUBEXP; i > 0; i--) {
+	*sp1++ = NULL;
+	*ep++ = NULL;
+    }
+    if (regmatch(prog + 1)) {
+	start[0] = string;
+	end[0] = reginput;
+	return (1);
+    }
+    else
+	return (0);
+}
+
+
+/*
+ - regmatch - main matching routine
+ *
+ * Conceptually the strategy is simple:  check to see whether the current
+ * node matches, call self recursively to see whether the rest matches,
+ * and then act accordingly.  In practice we make some effort to avoid
+ * recursion, in particular by going through "ordinary" nodes (that don't
+ * need to know whether the rest of the match failed) by a loop instead of
+ * by recursion.
+ * 0 failure, 1 success
+ */
+int ossimRegExp::regmatch (const char* prog) {
+    const char* scan;	// Current node.
+             const char* next;	// Next node.
+
+    scan = prog;
+
+    while (scan != NULL) {
+
+	next = regnext(scan);
+
+	switch (OP(scan)) {
+	    case BOL:
+		if (reginput != regbol)
+		    return (0);
+		break;
+	    case EOL:
+		if (*reginput != '\0')
+		    return (0);
+		break;
+	    case ANY:
+		if (*reginput == '\0')
+		    return (0);
+		reginput++;
+		break;
+	    case EXACTLY:{
+		    int         len;
+		    const char* opnd;
+
+		    opnd = OPERAND(scan);
+		    // Inline the first character, for speed.
+		    if (*opnd != *reginput)
+			return (0);
+		    len = (int)strlen(opnd);
+		    if (len > 1 && strncmp(opnd, reginput, len) != 0)
+			return (0);
+		    reginput += len;
+		}
+		break;
+	    case ANYOF:
+		if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) == NULL)
+		    return (0);
+		reginput++;
+		break;
+	    case ANYBUT:
+		if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != NULL)
+		    return (0);
+		reginput++;
+		break;
+	    case NOTHING:
+		break;
+	    case BACK:
+		break;
+	    case OPEN + 1:
+	    case OPEN + 2:
+	    case OPEN + 3:
+	    case OPEN + 4:
+	    case OPEN + 5:
+	    case OPEN + 6:
+	    case OPEN + 7:
+	    case OPEN + 8:
+	    case OPEN + 9:{
+		          int    no;
+		    const char* save;
+
+		    no = OP(scan) - OPEN;
+		    save = reginput;
+
+		    if (regmatch(next)) {
+
+			//
+			// Don't set startp if some later invocation of the
+			// same parentheses already has. 
+			//
+			if (regstartp[no] == NULL)
+			    regstartp[no] = save;
+			return (1);
+		    }
+		    else
+			return (0);
+		}
+//		break;
+	    case CLOSE + 1:
+	    case CLOSE + 2:
+	    case CLOSE + 3:
+	    case CLOSE + 4:
+	    case CLOSE + 5:
+	    case CLOSE + 6:
+	    case CLOSE + 7:
+	    case CLOSE + 8:
+	    case CLOSE + 9:{
+		          int    no;
+		    const char* save;
+
+		    no = OP(scan) - CLOSE;
+		    save = reginput;
+
+		    if (regmatch(next)) {
+
+			//
+			// Don't set endp if some later invocation of the
+			// same parentheses already has. 
+			//
+			if (regendp[no] == NULL)
+			    regendp[no] = save;
+			return (1);
+		    }
+		    else
+			return (0);
+		}
+//		break;
+	    case BRANCH:{
+	      
+	      const char* save;
+
+		    if (OP(next) != BRANCH)	// No choice.
+			next = OPERAND(scan);	// Avoid recursion.
+		    else {
+			do {
+			    save = reginput;
+			    if (regmatch(OPERAND(scan)))
+				return (1);
+			    reginput = save;
+			    scan = regnext(scan);
+			} while (scan != NULL && OP(scan) == BRANCH);
+			return (0);
+			// NOTREACHED
+		    }
+		}
+		break;
+	    case STAR:
+	    case PLUS:{
+	      char   nextch;
+		    int        no;
+		    const char* save;
+		    int        min_no;
+
+		    //
+		    // Lookahead to avoid useless match attempts when we know
+		    // what character comes next. 
+		    //
+		    nextch = '\0';
+		    if (OP(next) == EXACTLY)
+			nextch = *OPERAND(next);
+		    min_no = (OP(scan) == STAR) ? 0 : 1;
+		    save = reginput;
+		    no = regrepeat(OPERAND(scan));
+		    while (no >= min_no) {
+			// If it could work, try it.
+			if (nextch == '\0' || *reginput == nextch)
+			    if (regmatch(next))
+				return (1);
+			// Couldn't or didn't -- back up.
+			no--;
+			reginput = save + no;
+		    }
+		    return (0);
+		}
+//		break;
+	    case END:
+ 		return (1);	// Success!
+
+	    default:
+	        //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
+                printf ("ossimRegExp::find(): Internal error -- memory corrupted.\n");
+		return 0;
+	}
+	scan = next;
+    }
+
+    // 
+    //  We get here only if there's trouble -- normally "case END" is the
+    //  terminating point. 
+    // 
+    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
+    printf ("ossimRegExp::find(): Internal error -- corrupted pointers.\n");
+    return (0);
+}
+
+
+/*
+ - regrepeat - repeatedly match something simple, report how many
+ */
+int ossimRegExp::regrepeat (const char* p) {
+          int   count = 0;
+    const char* scan;
+    const char* opnd;
+
+    scan = reginput;
+    opnd = OPERAND(p);
+    switch (OP(p)) {
+	case ANY:
+	    count = (int)strlen(scan);
+	    scan += count;
+	    break;
+	case EXACTLY:
+	    while (*opnd == *scan) {
+		count++;
+		scan++;
+	    }
+	    break;
+	case ANYOF:
+	    while (*scan != '\0' && strchr(opnd, *scan) != NULL) {
+		count++;
+		scan++;
+	    }
+	    break;
+	case ANYBUT:
+	    while (*scan != '\0' && strchr(opnd, *scan) == NULL) {
+		count++;
+		scan++;
+	    }
+	    break;
+	default:		// Oh dear.  Called inappropriately.
+	    //RAISE Error, SYM(ossimRegExp), SYM(Internal_Error),
+	    printf ("ossimRegExp::find(): Internal error.\n");
+	    return 0;
+    }
+    reginput = scan;
+    return (count);
+}
+
+
+/*
+ - regnext - dig the "next" pointer out of a node
+ */
+const char* ossimRegExp::regnext (const char* p) {
+    int offset;
+
+    if (p == &regdummy)
+	return (NULL);
+
+    offset = NEXT(p);
+    if (offset == 0)
+	return (NULL);
+
+    if (OP(p) == BACK)
+	return (p - offset);
+    else
+	return (p + offset);
+}
+
+
+char* ossimRegExp::regnext (char* p) {
+    int offset;
+
+    if (p == &regdummy)
+	return (NULL);
+
+    offset = NEXT(p);
+    if (offset == 0)
+	return (NULL);
+
+    if (OP(p) == BACK)
+	return (p - offset);
+    else
+	return (p + offset);
+}
diff --git a/src/base/ossimRgbLutDataObject.cpp b/src/base/ossimRgbLutDataObject.cpp
new file mode 100644
index 0000000..82df655
--- /dev/null
+++ b/src/base/ossimRgbLutDataObject.cpp
@@ -0,0 +1,279 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbLutDataObject.cpp 13710 2008-10-14 16:27:57Z gpotts $
+#include <ossim/base/ossimRgbLutDataObject.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimColumnVector3d.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+#include <sstream>
+using namespace std;
+
+RTTI_DEF1(ossimRgbLutDataObject, "ossimRgbLutDataObject", ossimObject);
+
+ostream& operator <<(ostream& out,
+                     const ossimRgbLutDataObject& lut)
+{
+   for(ossim_uint32 index = 0; index < lut.theNumberOfEntries; ++index)
+   {
+      out << "entry" << index << " " << lut[index] << endl;
+   }
+
+   return out;
+}
+
+ossimRgbLutDataObject::ossimRgbLutDataObject(unsigned long numberOfEntries)
+   :
+      theLut(NULL),
+      theNumberOfEntries(numberOfEntries)
+{
+   if(theNumberOfEntries > 0)
+   {
+      // allocate 256 entries for the data object;
+      theLut = new ossimRgbVector[theNumberOfEntries];
+   }
+      
+}
+
+ossimRgbLutDataObject::ossimRgbLutDataObject(const ossimRgbLutDataObject& lut)
+   :
+      theLut(NULL),
+      theNumberOfEntries(0)
+{
+   theNumberOfEntries = lut.theNumberOfEntries;
+   if(theNumberOfEntries > 0)
+   {
+      theLut = new ossimRgbVector[theNumberOfEntries];
+      for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
+      {
+         theLut[index] = lut.theLut[index];
+      }
+   }
+}
+
+ossimRgbLutDataObject::~ossimRgbLutDataObject()
+{
+   if(theLut)
+   {
+      delete [] theLut;
+      theLut = NULL;
+   }
+   theNumberOfEntries = 0;
+}
+
+int ossimRgbLutDataObject::findIndex(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
+{
+   ossim_uint32 distance = 0x7FFFFFFF; // max 4 byte signed
+   ossim_int32 result   = 0;
+
+   if(theNumberOfEntries > 0)
+   {
+      for(ossim_uint32 i = 0; i < theNumberOfEntries; ++i)
+      {
+         ossim_uint32 rDelta = r - theLut[i].getR();
+         ossim_uint32 gDelta = g - theLut[i].getG();
+         ossim_uint32 bDelta = b - theLut[i].getB();
+
+         ossim_uint32 deltaSumSquare = (rDelta*rDelta +
+                                        gDelta*gDelta +
+                                        bDelta*bDelta);
+         if(deltaSumSquare == 0)
+         {
+            return static_cast<int>(i);
+         }
+         else if( deltaSumSquare < distance)
+         {
+            result = static_cast<int>(i);
+            distance = deltaSumSquare;
+         }
+      }
+   }
+
+   return result;
+}
+
+ossimRgbLutDataObject ossimRgbLutDataObject::rotate(long numberOfElements)const
+{
+   if(numberOfElements < 0)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL: Negative rotation is not supported yet in ossimRgbLutDataObject::rotate" << endl;
+      return *this;
+   }
+   ossimRgbLutDataObject lut;
+   for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
+   {
+      int adjustedDestinationIndex = (index+numberOfElements)%theNumberOfEntries;
+      lut[adjustedDestinationIndex] = theLut[index] ;
+   }
+
+   return lut;
+}
+
+ossimRgbLutDataObject& ossimRgbLutDataObject::rotate(long numberOfElements)
+{
+   if(numberOfElements < 0)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL: Negative rotation is not supported yet in ossimRgbLutDataObject::rotate" << endl;
+      return *this;
+   }
+   const ossimRgbLutDataObject* temp = this;
+
+   *this = temp->rotate(numberOfElements);
+
+   return *this;
+}
+
+const ossimRgbLutDataObject& ossimRgbLutDataObject::operator =(const ossimRgbLutDataObject& lut)
+{
+   if(theNumberOfEntries != lut.theNumberOfEntries)
+   {
+      delete [] theLut;
+      theLut = NULL;
+   }
+
+   theNumberOfEntries = lut.theNumberOfEntries;
+   if(!theLut&&(theNumberOfEntries > 0))
+   {
+      theLut = new ossimRgbVector[theNumberOfEntries];
+   }
+   for(unsigned long index = 0; index < theNumberOfEntries; ++index)
+   {
+      theLut[index] = lut.theLut[index];
+   }
+
+   return *this;
+}
+
+bool ossimRgbLutDataObject::operator ==(const ossimRgbLutDataObject& lut)const
+{
+   if(theNumberOfEntries != lut.theNumberOfEntries)
+   {
+      return false;
+   }
+   for(unsigned long index = 0; index < theNumberOfEntries; ++index)
+   {
+      if(theLut[index] != lut.theLut[index])
+      {
+         return false;
+      }
+   }
+   return true;
+}
+
+bool ossimRgbLutDataObject::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix,
+           "type",
+           getClassName(),
+           true);
+   kwl.add(prefix,
+           "number_of_entries",
+           ossimString::toString(theNumberOfEntries).c_str(),
+           true);
+   for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
+   {
+      ossimString newPrefix = "entry";
+      newPrefix += ossimString::toString(index);
+      ostringstream ostr;
+      ostr << (int)(theLut[index].getR())
+           << " " << (int)(theLut[index].getG())
+           << " " << (int)(theLut[index].getB());
+      kwl.add(prefix,
+              newPrefix,
+              ostr.str().c_str(),
+              true);
+   }
+
+   return true;
+}
+
+bool ossimRgbLutDataObject::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lutFile = kwl.find(prefix, "lut_file");
+   ossimKeywordlist fileLut;
+   ossimKeywordlist* tempKwl = (const_cast<ossimKeywordlist*>(&kwl));
+   ossimString tempPrefix = prefix;
+
+   // this should have been used instead of lut_file.  We will still look
+   // for lut_file for backward compatibility.
+   //
+   if(!lutFile)
+   {
+      lutFile = kwl.find(prefix, "filename");
+   }
+   // check to see if we should open an external file
+   // if so point the fileLut to the one that we use
+   if(lutFile)
+   {
+      ossimFilename filename(lutFile);
+      if(filename.exists())
+      {
+         fileLut.addFile(filename.c_str());
+         tempKwl = &fileLut;
+         tempPrefix = "";
+      }
+   }
+ 
+   const char* numberOfEntries = tempKwl->find(tempPrefix, "number_of_entries");
+   if(!numberOfEntries)
+   {
+      numberOfEntries = tempKwl->find(tempPrefix, "number_entries");
+   }
+   if(!numberOfEntries) return false;
+   theNumberOfEntries = ossimString(numberOfEntries).toULong();
+
+   delete [] theLut;
+   theLut = new ossimRgbVector[theNumberOfEntries];
+
+   if(tempKwl->find(tempPrefix, "entry0"))
+   {
+      for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
+      {
+         ossimString newPrefix = "entry";
+         newPrefix += ossimString::toString(index);
+         ossimString v = tempKwl->find(tempPrefix, newPrefix.c_str());
+         istringstream istr(v);
+
+         ossimString r, g, b;
+         istr >> r >> g >> b;
+         theLut[index].setR((unsigned char)r.toInt32());
+         theLut[index].setG((unsigned char)g.toInt32());
+         theLut[index].setB((unsigned char)b.toInt32());
+      }
+   }
+   else
+   {
+      for(ossim_uint32 index = 0; index < theNumberOfEntries; ++index)
+      {
+         ossimString newPrefix = "entry";
+         newPrefix += ossimString::toString(index);
+         
+         const char* r = tempKwl->find(tempPrefix, (newPrefix+".r").c_str());
+         const char* g = tempKwl->find(tempPrefix, (newPrefix+".g").c_str());
+         const char* b = tempKwl->find(tempPrefix, (newPrefix+".b").c_str());
+         
+         if(r)
+         {
+            theLut[index].setR((unsigned char)ossimString(r).toLong());
+         }
+         if(g)
+         {
+            theLut[index].setG((unsigned char)ossimString(g).toLong());
+         }
+         if(b)
+         {
+            theLut[index].setB((unsigned char)ossimString(b).toLong());
+         }
+      }
+   }
+   return true;
+}
diff --git a/ossim/src/ossim/base/ossimRgbVector.cpp b/src/base/ossimRgbVector.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimRgbVector.cpp
rename to src/base/ossimRgbVector.cpp
diff --git a/src/base/ossimRtti.cpp b/src/base/ossimRtti.cpp
new file mode 100644
index 0000000..50591e1
--- /dev/null
+++ b/src/base/ossimRtti.cpp
@@ -0,0 +1,158 @@
+
+#include <iostream>
+#include <cstring>
+#include <cstdlib>
+#include <algorithm>
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimRtti.h>
+
+static const RTTITypeinfo* RTTI_base_null_type[] = { 0 };
+
+const RTTITypeinfo* RTTIdyntypeid::a[] = { 0 };
+
+const RTTITypeinfo RTTITypeinfo::null_type = RTTITypeinfo("NULL", RTTI_base_null_type,0,0);
+
+void RTTITypeinfo::add_subtype(const RTTITypeinfo* t)		//Adds t as last RTTITypeinfo in the
+{		
+  subtypes.push_back(t);
+  ns = subtypes.size();
+							//'subtypes' list. For this, the
+/*   const RTTITypeinfo** ptr = new const RTTITypeinfo*[ns+1];		//list is realloc'd with one extra entry.
+   int i; for(i=0;i<ns;i++) ptr[i] = subtypes[i];
+   ptr[i] = t;
+   ns++;
+   delete[] subtypes;
+   subtypes = ptr;
+   */
+}
+
+void RTTITypeinfo::del_subtype(const RTTITypeinfo* t) //Searches for t in the subtypes list
+{
+   if ( subtypes.size() > 0 )
+   {
+      SubtypesConstVector::iterator iter = std::find(subtypes.begin(), subtypes.end(), t);
+      if(iter != subtypes.end())
+      {
+         subtypes.erase(iter);
+
+         // "ns" is private member of RTTITypeinfo
+         ns = subtypes.size();
+      }
+   }
+
+ //of this and removes it, if found.
+
+//   int i; for(i=0;i<ns && subtypes[i]!=t;i++);
+//   if (i<ns)
+//     for(;i<ns-1;i++) subtypes[i] = subtypes[i+1];
+}
+
+RTTITypeinfo::RTTITypeinfo(const char* name,
+                           const RTTITypeinfo* bb[],
+                           void* (*f1)(int,void*),
+                           void* (*f2)())
+{
+  n = "";
+  if(name) n = name;
+  b = bb; //ns = 0; subtypes = 0;		//Create default RTTITypeinfo
+  cast    = f1;								//Attach casting func
+  new_obj = f2;								//Attach creation func
+  int i = 0;
+  for(i=0;b[i];i++)							//Add this as subtype to all its basetypes
+     ((RTTITypeinfo**)b)[i]->add_subtype(this);				//REMARK: Harmless const castaway
+}
+
+const char* RTTITypeinfo::getname() const
+{
+  return n.c_str();
+}
+
+
+RTTITypeinfo::~RTTITypeinfo()
+{
+//   if(n)
+//   {
+//      free(n);
+//      n = NULL;
+//   }
+   int i = 0;
+   for(i=0;b[i];i++)
+   {
+      //Del this subtype from all its basetypes
+      ((RTTITypeinfo**)b)[i]->del_subtype(this); //REMARK: Harmless const castaway
+   }
+}
+
+int RTTITypeinfo::has_base(const RTTITypeinfo* p) const
+{
+  int i = 0;
+   for(i=0;b[i];i++)							//for all bases of this...
+      if (p->same(b[i]) || b[i]->has_base(p)) return 1;				//match found, return 1 or no match, search deeper
+   return 0;									//no match at all, return 0
+}
+
+void* RTTITypeinfo::create(const RTTITypeinfo* bt, const char* c) const	//Tries to create an obj of type-name
+{										//given by char*. Searches for this type in the
+   void* p = 0; int i;								//type-DAG rooted by this, creates it and returns
+										//it as cast to 'bt', where bt is either this or a
+										//direct base of this.
+   if (!strcmp(c,getname()))								//Want to create an obj of this type ?
+      p = (new_obj)? new_obj() : 0;						//Yes, do it if this type is instantiable.
+   else										//No, try with subclasses...
+      for(i=0;i<ns && !((p=subtypes[i]->create(this,c)));i++);			//Succeeded creating on ith subclass branch ?
+   if (!p) return 0;								//Couldn't create it in any way, abort.
+   if (bt==this) i = -1;							//Must cast to this's own type (i==-1)
+   else for(i=0;b[i] && b[i]!=bt;i++);						//Search to which base of this we should cast
+									        //Found: cast to ith base of this
+   return cast(i,p);								//Cast to ith base of to this, return as void*
+}
+
+RTTItypeid RTTItypeid::find_baseclass(const char* name)const
+{
+   if(strcmp(name, getname())==0)
+   {
+      return *this;
+   }
+   else if(num_baseclasses() == 0)
+   {
+      if(strcmp(name, getname()) == 0)
+      {
+         return *this;
+      }
+      return null_type();
+   }
+   else
+   {
+      int index = 0;
+
+      while(index < num_baseclasses())
+      {
+         RTTItypeid typeId = baseclass(index);
+         if(typeId == *this)
+         {
+	   return *this;//null_type();
+         }
+         if(strcmp(name, typeId.getname()) == 0)
+         {
+            return *this;
+         }
+         ++index;
+      }
+      index = 0;
+      while(index < num_baseclasses())
+      {
+         RTTItypeid typeId = baseclass(index);
+         if(typeId.find_baseclass(name) == typeId.null_type())
+         {
+            ++index;
+         }
+         else
+         {
+            return typeId;
+         }
+      }
+   }
+   return null_type();
+}
diff --git a/src/base/ossimScalarTypeLut.cpp b/src/base/ossimScalarTypeLut.cpp
new file mode 100644
index 0000000..27e79c9
--- /dev/null
+++ b/src/base/ossimScalarTypeLut.cpp
@@ -0,0 +1,220 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimScalarTypeLUT.
+// 
+//*******************************************************************
+//  $Id: ossimScalarTypeLut.cpp 22072 2013-01-04 13:46:52Z dburken $
+
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimString.h>
+
+ossimScalarTypeLut* ossimScalarTypeLut::theInstance = NULL;
+
+ossimScalarTypeLut* ossimScalarTypeLut::instance()
+{
+   if (!theInstance)
+   {
+      theInstance = new ossimScalarTypeLut;
+   }
+   return theInstance;
+}
+
+ossimScalarTypeLut::ossimScalarTypeLut()
+{
+   //---
+   // Complete initialization of data member "theTable".
+   // Note:  Scalar types defined in constants.h file.
+   //---
+   ossimKeyValueMap entry;
+   entry.init(OSSIM_SCALAR_UNKNOWN, "unknown");
+   theTable.push_back(entry);
+   
+   entry.init(OSSIM_UINT8, "ossim_uint8");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SINT8, "ossim_sint8");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_UINT16, "ossim_uint16");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SINT16, "ossim_sint16");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_UINT32, "ossim_uint32");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SINT32, "ossim_sint32");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_UINT64, "ossim_uint64");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SINT64, "ossim_sint64");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_FLOAT32, "ossim_float32");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_FLOAT64, "ossim_float64");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_CINT16, "ossim_cint16");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_CINT32, "ossim_cint32");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_CFLOAT32, "ossim_cfloat32");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_CFLOAT64, "ossim_cfloat64");
+   theTable.push_back(entry);
+   
+   entry.init(OSSIM_UCHAR, "uchar");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT16, "ushort16");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SSHORT16, "sshort16");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT11, "ushort11");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT12, "ushort12");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT13, "ushort13");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT14, "ushort14");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT15, "ushort15");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_FLOAT, "float");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_NORMALIZED_FLOAT, "normalized_float");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_NORMALIZED_DOUBLE, "normalized_double");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_DOUBLE, "double");
+   theTable.push_back(entry);
+
+   // Short forms:
+
+   entry.init(OSSIM_UINT8, "U8");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SINT8, "S8");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT11, "U11");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT12, "U12");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT13, "U13");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT14, "U14");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT15, "U15");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_UINT16, "U16");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SINT16, "S16");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_FLOAT32, "F32");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_FLOAT64, "F64");
+   theTable.push_back(entry);
+   
+   entry.init(OSSIM_NORMALIZED_FLOAT, "N32");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_NORMALIZED_DOUBLE, "N64");
+   theTable.push_back(entry);
+
+   // Forms from old code "radiometry" key in ossimImageMetaData:
+   
+   entry.init(OSSIM_UINT8, "8-bit");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT11, "11-bit");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT12, "12-bit");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT13, "13-bit");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT14, "14-bit");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_USHORT15, "15-bit");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_UINT16, "16-bit unsigned");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_SINT16, "16-bit signed");
+   theTable.push_back(entry);
+   
+   entry.init(OSSIM_UINT32, "32-bit unsigned");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_FLOAT32, "float");
+   theTable.push_back(entry);
+   
+   entry.init(OSSIM_NORMALIZED_FLOAT, "normalized float");
+   theTable.push_back(entry);
+
+   entry.init(OSSIM_FLOAT64, "double");
+   theTable.push_back(entry);
+   
+   entry.init(OSSIM_NORMALIZED_DOUBLE, "normalized double");
+   theTable.push_back(entry);
+}
+
+ossimScalarTypeLut::~ossimScalarTypeLut()
+{
+   theInstance = NULL;
+}
+
+ossimScalarType
+ossimScalarTypeLut::getScalarTypeFromString(const ossimString& s) const
+{
+   int scalar_type = getEntryNumber(s.c_str());
+   
+   if (scalar_type == -1)
+   {
+      return OSSIM_SCALAR_UNKNOWN;
+   }
+   
+   return static_cast<ossimScalarType>(scalar_type);
+}   
+
+ossimKeyword ossimScalarTypeLut::getKeyword() const
+{
+   return ossimKeyword((ossimKeywordNames::SCALAR_TYPE_KW), "");
+}
diff --git a/ossim/src/ossim/base/ossimSevenParamDatum.cpp b/src/base/ossimSevenParamDatum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimSevenParamDatum.cpp
rename to src/base/ossimSevenParamDatum.cpp
diff --git a/src/base/ossimSource.cpp b/src/base/ossimSource.cpp
new file mode 100644
index 0000000..14b8cf9
--- /dev/null
+++ b/src/base/ossimSource.cpp
@@ -0,0 +1,167 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimSource.cpp 17195 2010-04-23 17:32:18Z dburken $
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimDataObject.h>
+#include <ossim/base/ossimIdManager.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimBooleanProperty.h>
+
+RTTI_DEF2(ossimSource, "ossimSource",
+          ossimConnectableObject, ossimErrorStatusInterface)
+
+
+ossimSource::ossimSource(ossimObject* owner)
+   :
+      ossimConnectableObject(owner),
+      theEnableFlag(true),
+      theInitializedFlag(false)
+{
+}
+
+ossimSource::ossimSource(const ossimSource &rhs)
+   :
+      ossimConnectableObject(rhs),
+      theEnableFlag(rhs.theEnableFlag),
+      theInitializedFlag(rhs.theInitializedFlag)
+{
+}
+
+ossimSource::ossimSource(ossimObject* owner,
+                         ossim_uint32 inputListSize,
+                         ossim_uint32 outputListSize,
+                         bool inputListIsFixedFlag,
+                         bool outputListIsFixedFlag)
+   :
+      ossimConnectableObject(owner, inputListSize, outputListSize,
+                             inputListIsFixedFlag, outputListIsFixedFlag),
+      theEnableFlag(true),
+      theInitializedFlag(false)
+{}
+
+ossimSource::~ossimSource()   
+{
+}
+
+bool ossimSource::saveState(ossimKeywordlist& kwl,
+                            const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::ENABLED_KW,
+           (int)theEnableFlag,
+           true);
+
+   return ossimConnectableObject::saveState(kwl, prefix);
+}
+
+bool ossimSource::loadState(const ossimKeywordlist& kwl,
+                            const char* prefix)
+{
+   const char* lookup = kwl.find(prefix,
+                                 ossimKeywordNames::ENABLED_KW);
+   if(lookup)
+   {
+      theEnableFlag = ossimString(lookup).toBool();
+   }
+
+   return ossimConnectableObject::loadState(kwl, prefix);
+}
+
+bool ossimSource::isSourceEnabled()const
+{
+   return theEnableFlag;
+}
+
+void ossimSource::enableSource()
+{
+   setEnableFlag(true);
+}
+
+void ossimSource::disableSource()
+{
+   setEnableFlag(false);
+}
+
+bool ossimSource::getEnableFlag() const
+{
+   return theEnableFlag;
+}
+
+void ossimSource::setEnableFlag(bool flag)
+{
+   theEnableFlag = flag;
+}
+
+bool ossimSource::isInitialized() const
+{
+   return theInitializedFlag;
+}
+
+void ossimSource::setInitializedFlag(bool flag)
+{
+   theInitializedFlag = flag;
+}
+
+void ossimSource::initialize()
+{
+}
+
+void ossimSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid()) return;
+
+   ossimString name = property->getName();
+   name = name.downcase();
+   
+   if(name == ossimKeywordNames::ENABLED_KW)
+   {
+      ossimString value;
+      
+      property->valueToString(value);
+      setEnableFlag(value.toBool());
+   }
+   else
+   {
+      ossimConnectableObject::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimSource::getProperty(const ossimString& name)const
+{
+   if( (name == "Enabled") || (name == ossimKeywordNames::ENABLED_KW) )
+   {
+      return new ossimBooleanProperty(ossimKeywordNames::ENABLED_KW,theEnableFlag);
+   }
+   return ossimConnectableObject::getProperty(name);
+}
+
+void ossimSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimConnectableObject::getPropertyNames(propertyNames);
+   
+   propertyNames.push_back(ossimKeywordNames::ENABLED_KW);
+}
+
+const ossimSource& ossimSource::operator=(const ossimSource& /* rhs */)
+{
+   return *this;
+}
+
+std::ostream& ossimSource::print(std::ostream& out) const
+{
+   out << "ossimSource::print:\n"
+      << "theEnableFlag:       " << theEnableFlag
+      << "\ntheInitializedFlag:  " << theInitializedFlag
+      << endl;
+
+   return ossimErrorStatusInterface::print(out);
+}
diff --git a/ossim/src/ossim/base/ossimStateChangedEvent.cpp b/src/base/ossimStateChangedEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimStateChangedEvent.cpp
rename to src/base/ossimStateChangedEvent.cpp
diff --git a/src/base/ossimStdOutProgress.cpp b/src/base/ossimStdOutProgress.cpp
new file mode 100644
index 0000000..278c3e5
--- /dev/null
+++ b/src/base/ossimStdOutProgress.cpp
@@ -0,0 +1,88 @@
+//---
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+//
+// Author: Garrett Potts
+//
+//---
+// $Id$
+
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimPreferences.h>
+#include <iomanip>
+
+#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
+   #include <io.h>
+   #define ISATTY _isatty
+   #define FILENO _fileno
+#else
+   #include <unistd.h>
+   #define ISATTY isatty
+   #define FILENO fileno
+#endif
+
+RTTI_DEF1(ossimStdOutProgress, "ossimStdOutProgress", ossimProcessListener);
+
+ossimStdOutProgress theStdOutProgress;
+
+ossimStdOutProgress::ossimStdOutProgress(ossim_uint32 precision,
+                                         bool flushStream)
+   :
+      ossimProcessListener(),
+      thePrecision(precision),
+      theFlushStreamFlag(flushStream),
+      theRunningInConsoleFlag(true)
+{
+   // Determine if running in a terminal window. Progress reports are only written to console if
+   // running in one.
+
+   ossimString stdOutConsole;
+   stdOutConsole = ossimPreferences::instance()->findPreference("ossim.std.out.progress");
+
+   if ( stdOutConsole.size() )
+   {
+      // Override auto detected console.
+      theRunningInConsoleFlag = stdOutConsole.toBool();
+   }
+   else if ( !ISATTY(FILENO(stdout) ) )
+   {
+      theRunningInConsoleFlag = false;
+   }
+}
+
+void ossimStdOutProgress::processProgressEvent(ossimProcessProgressEvent& event)
+{
+   if (!theRunningInConsoleFlag)
+      return;
+
+   if (event.getOutputMessageFlag())
+   {
+      ossimString s;
+      event.getMessage(s);
+      if (!s.empty())
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE) << s.c_str() << std::endl;
+      }
+      return; // Don't output percentage on a message update.
+   }
+   
+   double p = event.getPercentComplete();
+   ossimNotify(ossimNotifyLevel_NOTICE)
+      << std::setiosflags(std::ios::fixed)
+      << std::setprecision(thePrecision)
+      << p << "%\r";
+   
+   if(theFlushStreamFlag)
+   {
+      (p != 100.0) ?
+         ossimNotify(ossimNotifyLevel_NOTICE).flush() :
+         ossimNotify(ossimNotifyLevel_NOTICE) << "\n";
+   }
+}
+
+void ossimStdOutProgress::setFlushStreamFlag(bool flag)
+{
+   theFlushStreamFlag = flag;
+}
+
diff --git a/ossim/src/ossim/base/ossimStreamBase.cpp b/src/base/ossimStreamBase.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimStreamBase.cpp
rename to src/base/ossimStreamBase.cpp
diff --git a/src/base/ossimStreamFactory.cpp b/src/base/ossimStreamFactory.cpp
new file mode 100644
index 0000000..0e0b55a
--- /dev/null
+++ b/src/base/ossimStreamFactory.cpp
@@ -0,0 +1,234 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//
+//*******************************************************************
+// $Id$
+
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimStreamFactory.h>
+
+#if OSSIM_HAS_LIBZ
+#include <ossim/base/ossimGzStream.h>
+#endif
+
+#include <fstream>
+
+#if defined(_WIN32)
+#  include <io.h>     /* _access(...) */
+#else
+#  include <unistd.h> /* access(...) */
+#endif
+
+
+ossim::StreamFactory* ossim::StreamFactory::m_instance = 0;
+
+ossim::StreamFactory::~StreamFactory()
+{
+}
+
+ossim::StreamFactory* ossim::StreamFactory::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossim::StreamFactory();
+   }
+   return m_instance;
+}
+
+std::shared_ptr<ossim::istream> ossim::StreamFactory::createIstream(
+   const std::string& connectionString,
+   const ossimKeywordlist& /* options */,
+   std::ios_base::openmode mode ) const
+{
+   std::shared_ptr<ossim::istream> result(0);
+   ossimFilename f =  connectionString;
+   if ( f.exists() )
+   {
+      // there is a bug in gcc < 5.0 and we can't use constructors in the 
+      // C++11 build.  Will refactor to do a new ifstream then use open
+      //
+      std::shared_ptr<ossim::ifstream> testResult = 
+               std::make_shared<ossim::ifstream>();
+      testResult->open(connectionString.c_str(), mode);
+      if(!testResult->is_open())
+      {
+         testResult.reset();
+      }
+
+      result = testResult;
+   }
+   return result;
+}
+      
+std::shared_ptr<ossim::ostream> ossim::StreamFactory::createOstream(
+   const std::string& connectionString,
+   const ossimKeywordlist& /* options */,
+   std::ios_base::openmode mode) const
+{
+   std::shared_ptr<ossim::ostream> result(0);
+
+   std::shared_ptr<ossim::ofstream> testResult = 
+      std::make_shared<ossim::ofstream>();
+   testResult->open(connectionString.c_str(), mode);
+   if ( testResult->is_open() )
+   {
+      result = testResult;
+   }
+   else
+   {
+      testResult.reset();
+   }
+
+   return result;
+}
+
+std::shared_ptr<ossim::iostream> ossim::StreamFactory::createIOstream(
+   const std::string& /*connectionString*/,
+   const ossimKeywordlist& options,
+   std::ios_base::openmode /*mode*/) const
+{
+   return std::shared_ptr<ossim::iostream>(0);
+}
+
+bool ossim::StreamFactory::exists(const std::string& connectionString, bool& continueFlag) const
+{
+   bool result = false;
+   if ( connectionString.size() )
+   {
+      std::string file;
+      std::size_t pos = connectionString.find( "://" );
+      if ( pos != std::string::npos )
+      {
+         // is url:
+         ossimString protocol = connectionString.substr( 0, pos );
+         if ( (protocol.downcase() == "file") && ( connectionString.size() > pos+3) )
+         {
+            // Strip off "file://" for access(...) function:
+            file = connectionString.substr( pos+3 );
+         }
+      }
+      else // not a url
+      {
+         file = connectionString;
+      }
+
+      if ( file.size() )
+      {
+         // Set continueFlag to false to stop downstream factory exists checks.
+         continueFlag = false;
+#if defined(_WIN32)
+         result = (_access(file.c_str(), ossimFilename::OSSIM_EXIST) == 0);
+#else
+         result = ((access(file.c_str(), ossimFilename::OSSIM_EXIST)) == 0);
+#endif
+      }
+   }
+   return result;
+}
+
+// Hidden from use:
+ossim::StreamFactory::StreamFactory()
+{
+}
+
+// Hidden from use:
+ossim::StreamFactory::StreamFactory(const ossim::StreamFactory& )
+{
+}
+
+// Deprecated code...
+ossimStreamFactory* ossimStreamFactory::theInstance = 0;
+
+ossimStreamFactory::ossimStreamFactory(): ossimStreamFactoryBase()
+{
+}
+
+ossimStreamFactory::~ossimStreamFactory()
+{
+}
+
+ossimStreamFactory* ossimStreamFactory::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimStreamFactory();
+   }
+
+   return theInstance;
+}
+
+std::shared_ptr<ossim::ifstream> ossimStreamFactory::createIFStream(
+   const ossimFilename& file, std::ios_base::openmode openMode) const
+{
+   std::shared_ptr<ossim::ifstream> result(0);
+
+   if ( file.exists() )
+   {
+      // there is a bug in gcc < 5.0 and we can't use constructors in the 
+      // C++11 build.  Will refactor to do a new ifstream then use open
+      //
+      result = std::make_shared<ossim::ifstream>();
+      result->open(file.c_str(), openMode);
+      if ( result->is_open() == false )
+      {
+         result.reset();
+      }
+   }
+   return result;
+}
+
+ossimRefPtr<ossimIFStream> ossimStreamFactory::createNewIFStream(
+   const ossimFilename& file,
+   std::ios_base::openmode mode) const
+{
+   ossimRefPtr<ossimIFStream> result = 0;
+   
+#if OSSIM_HAS_LIBZ
+   ossimFilename copyFile = file;
+
+   if(!copyFile.exists())
+   {
+      ossimString ext = copyFile.ext();
+      copyFile.setExtension("gz");
+      if(!copyFile.exists())
+      {
+         copyFile.setExtension(ext);
+         copyFile += ".gz";
+
+         if(!copyFile.exists())
+         {
+            return result;
+         }
+      }
+   }
+   
+   std::ifstream in(copyFile.c_str(), std::ios::in|std::ios::binary);
+
+   if(!in) return result;
+
+   unsigned char buf[2];
+
+   in.read((char*)buf, 2);
+   in.close();
+   // check for gzip magic number
+   //
+   if((buf[0] == 0x1F) &&
+      (buf[1] == 0x8B))
+   {
+      result = new ossimIgzStream(copyFile.c_str(), mode);
+   }
+#endif
+   return result;
+}
+
+ossimStreamFactory::ossimStreamFactory(const ossimStreamFactory&)
+   : ossimStreamFactoryBase()
+{}
diff --git a/src/base/ossimStreamFactoryRegistry.cpp b/src/base/ossimStreamFactoryRegistry.cpp
new file mode 100644
index 0000000..cb0719b
--- /dev/null
+++ b/src/base/ossimStreamFactoryRegistry.cpp
@@ -0,0 +1,197 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// Author: Garrett Potts
+//
+//*******************************************************************
+// $Id$
+
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimStreamFactory.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimFilename.h>
+
+#include <fstream>
+#include <algorithm>
+
+ossim::StreamFactoryRegistry* ossim::StreamFactoryRegistry::m_instance = 0;
+
+ossim::StreamFactoryRegistry::StreamFactoryRegistry()
+{
+}
+
+ossim::StreamFactoryRegistry::~StreamFactoryRegistry()
+{
+}
+
+ossim::StreamFactoryRegistry* ossim::StreamFactoryRegistry::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossim::StreamFactoryRegistry();
+   }
+   return m_instance;
+}
+
+std::shared_ptr<ossim::istream> ossim::StreamFactoryRegistry::createIstream(
+   const std::string& connectionString,
+   const ossimKeywordlist& options,
+   std::ios_base::openmode openMode) const
+{
+   std::shared_ptr<ossim::istream> result(0);
+   ossim_uint32 i = 0;
+   for(i = 0; (i < m_factoryList.size())&&(!result); ++i)
+   {
+      result = m_factoryList[i]->createIstream(connectionString, options, openMode);
+   }
+   return result;
+}
+      
+std::shared_ptr<ossim::ostream> ossim::StreamFactoryRegistry::createOstream(
+   const std::string& /*connectionString*/,
+   const ossimKeywordlist& /* options */,
+   std::ios_base::openmode /*openMode*/) const
+{
+   std::shared_ptr<ossim::ostream> result(0);
+   return result;
+}
+
+std::shared_ptr<ossim::iostream> ossim::StreamFactoryRegistry::createIOstream(
+   const std::string& /*connectionString*/,
+   const ossimKeywordlist& /* options */,
+   std::ios_base::openmode /*openMode*/) const
+{
+   std::shared_ptr<ossim::iostream> result(0);
+   return result;
+}
+
+bool ossim::StreamFactoryRegistry::exists(const std::string& connectionString) const
+{
+   bool continueFlag = true;
+   return exists( connectionString, continueFlag );
+}
+
+bool ossim::StreamFactoryRegistry::exists(const std::string& connectionString,
+                                          bool& continueFlag) const
+{
+   bool result = false;
+   std::vector<ossim::StreamFactoryBase*>::const_iterator i = m_factoryList.begin();
+   while ( i != m_factoryList.end() )
+   {
+      result = (*i)->exists( connectionString, continueFlag );
+      if ( ( result == true ) || (continueFlag == false ) ) break;
+      ++i;
+   }
+   return result;
+}
+
+void ossim::StreamFactoryRegistry::registerFactory(ossim::StreamFactoryBase* factory)
+{
+   std::vector<ossim::StreamFactoryBase*>::iterator iter = std::find(
+      m_factoryList.begin(), m_factoryList.end(), factory);
+   if(iter == m_factoryList.end())
+   {
+      m_factoryList.push_back(factory);
+   }
+}
+
+void ossim::StreamFactoryRegistry::unregisterFactory(StreamFactoryBase* factory)
+{
+   // OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_factoryListMutex);
+   std::vector<ossim::StreamFactoryBase*>::iterator iter = std::find(
+      m_factoryList.begin(), m_factoryList.end(), factory);
+   if(iter != m_factoryList.end())
+   {
+      m_factoryList.erase( iter );
+   }
+}
+
+// Deprecated code:
+ossimStreamFactoryRegistry* ossimStreamFactoryRegistry::theInstance = 0;
+
+ossimStreamFactoryRegistry::ossimStreamFactoryRegistry()
+{
+}
+
+ossimStreamFactoryRegistry::~ossimStreamFactoryRegistry()
+{
+}
+
+ossimStreamFactoryRegistry* ossimStreamFactoryRegistry::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimStreamFactoryRegistry();
+   }
+   return theInstance;
+}
+
+std::shared_ptr<ossim::ifstream> ossimStreamFactoryRegistry::createIFStream(
+   const ossimFilename& file, std::ios_base::openmode openMode) const
+{
+   std::shared_ptr<ossim::ifstream>result(0);
+   
+   for(ossim_uint32 idx = 0; ((idx < theFactoryList.size())&&(!result)); ++idx)
+   {
+      result = theFactoryList[idx]->createIFStream(file, openMode);
+   }
+
+   if(!result)
+   {
+      if(file.exists())
+      {
+         // there is a bug in gcc < 5.0 and we can't use constructors in the 
+         // C++11 build.  Will refactor to do a new ifstream then use open
+         //
+
+         result = std::make_shared<ossim::ifstream>();
+         result->open(file.c_str(), openMode);
+         if(!result->is_open())
+         {
+            result.reset();
+         }
+      }
+   }
+   
+   return result; 
+   
+}
+
+ossimRefPtr<ossimIFStream>
+ossimStreamFactoryRegistry::createNewIFStream(
+   const ossimFilename& file,
+   std::ios_base::openmode openMode) const
+{
+   ossim_uint32 idx = 0;
+   ossimRefPtr<ossimIFStream> result = 0;
+   for(idx = 0; ((idx < theFactoryList.size())&&(!result)); ++idx)
+   {
+      result = theFactoryList[idx]->createNewIFStream(file, openMode);
+   }
+
+   if(!result)
+   {
+      result = new ossimIFStream(file.c_str(),
+                                 openMode);
+//       result = new std::ifstream(file.c_str(),
+//                                  openMode);
+   }
+   
+   return result;
+}
+
+
+void ossimStreamFactoryRegistry::registerFactory(ossimStreamFactoryBase* factory)
+{
+   std::vector<ossimStreamFactoryBase*>::iterator iter = std::find(theFactoryList.begin(),
+                                                                  theFactoryList.end(),
+                                                                  factory);
+   if(iter == theFactoryList.end())
+   {
+      theFactoryList.push_back(factory);
+   }
+}
+
+ossimStreamFactoryRegistry::ossimStreamFactoryRegistry(const ossimStreamFactoryRegistry&)
+{}
diff --git a/src/base/ossimString.cpp b/src/base/ossimString.cpp
new file mode 100644
index 0000000..14c8cd8
--- /dev/null
+++ b/src/base/ossimString.cpp
@@ -0,0 +1,1126 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: This class extends the stl's string class.
+// 
+//********************************************************************
+// $Id: ossimString.cpp 22160 2013-02-25 12:09:35Z gpotts $
+
+#include <cctype> /* for toupper */
+#include <cstdlib> /* for getenv() */
+#include <stack> 
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <stdlib.h>
+#include <algorithm>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimHexString.h>
+
+static ossimTrace traceDebug("ossimString:debug");
+
+#ifdef OSSIM_ID_ENABLED
+static char OSSIM_ID[] = "$Id: ossimString.cpp 22160 2013-02-25 12:09:35Z gpotts $";
+#endif
+
+ossimString ossimString::upcase(const ossimString& aString)
+{
+   std::string s = aString.string();
+   
+   std::string::iterator eachCharacter = s.begin();
+   while(eachCharacter != s.end())
+   {
+      *eachCharacter = toupper(*eachCharacter);
+      eachCharacter++;
+   }
+
+   return s;
+}
+
+ossimString ossimString::downcase(const ossimString& aString)
+{
+   std::string s = aString.m_str;
+
+   std::string::iterator eachCharacter = s.begin();
+   while(eachCharacter != s.end())
+   {
+      *eachCharacter = tolower(*eachCharacter);
+      ++eachCharacter;
+   }
+
+   return ossimString(s);
+}
+
+ossimString& ossimString::upcase()
+{
+   std::string::iterator eachCharacter = m_str.begin();
+   while(eachCharacter != m_str.end())
+   {
+      *eachCharacter = toupper(*eachCharacter);
+      ++eachCharacter;
+   }
+
+   return *this;
+}
+
+ossimString ossimString::upcase()const
+{
+   ossimString result(*this);
+   result.upcase();
+   return result;
+}
+
+ossimString& ossimString::downcase()
+{
+   std::string::iterator eachCharacter = m_str.begin();
+   while(eachCharacter != m_str.end())
+   {
+      *eachCharacter = tolower(*eachCharacter);
+      ++eachCharacter;
+   }
+   
+   return *this;
+}
+
+ossimString ossimString::downcase()const
+{
+   ossimString result(*this);
+   result.downcase();
+   return result;
+}
+
+char* ossimString::stringDup()const
+{
+   char *result = 0;
+
+   if(length() == 0)
+   {
+      result = new char[1];
+      result[0] = '\0';
+   }
+   else
+   {  
+      ossim_uint32 index = 0;
+      ossim_uint32 len = (ossim_uint32)m_str.length();
+      result = new char[len+1];
+      const char* sourceString = m_str.c_str();
+
+      while(index < len) 
+      {
+         result[index] = sourceString[index];
+         ++index;
+      }
+      result[len] = '\0';
+   }
+   return result;
+}
+
+ossimString ossimString::stripLeading(const ossimString &value, char characterToStrip)
+{
+   std::string s;
+   ossimString::const_iterator stringIter = value.m_str.begin();
+   
+   while((*stringIter == characterToStrip)&&(stringIter!=value.m_str.end()))
+   {
+      ++stringIter;
+   }
+
+   while(stringIter != value.m_str.end())
+   {
+      s += *stringIter;
+      ++stringIter;
+   }
+   
+   return ossimString(s);
+}
+
+ossimString ossimString::substitute(const ossimString &searchKey,
+                                    const ossimString &replacementValue,
+                                    bool replaceAll)const
+{
+   std::string result = m_str;
+
+   size_type pos = result.find(searchKey.m_str);
+   
+   if (pos == std::string::npos) return result;  // Search key not found.
+   
+   if(replaceAll)
+   {
+      while(pos != std::string::npos)
+      {
+         result.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
+         pos = result.find(searchKey.m_str, pos+replacementValue.m_str.size());
+      }
+   }
+   else  // Replace only the first instance.
+   {
+      result.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
+   }
+
+   return ossimString(result);
+}
+
+ossimString& ossimString::gsub(const ossimString &searchKey,
+                               const ossimString &replacementValue,
+                               bool replaceAll)
+{
+   size_type pos = m_str.find(searchKey.m_str);
+   
+   if (pos == std::string::npos) return *this;  // Search key not found.
+   
+   if(replaceAll)
+   {
+      while(pos < m_str.size())
+      {
+         m_str.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
+         pos = find(searchKey.m_str, pos+replacementValue.m_str.size());
+      }
+   }
+   else  // Replace only the first instance.
+   {
+      m_str.replace(pos, searchKey.m_str.size(), replacementValue.m_str.c_str());
+   }
+
+   return *this;
+}
+
+ossimString  ossimString::trim(const ossimString& valueToTrim) const
+{
+   ossimString tempString(*this);
+   
+   return tempString.trim(valueToTrim);
+}
+
+ossimString& ossimString::trim(const ossimString& valueToTrim)
+{
+   if(m_str.size() == 0) return *this;
+   if(valueToTrim.empty()) return *this;
+   iterator startPos = (*this).begin();
+   iterator endPos   = (*this).begin() + ((*this).size()-1);
+
+   while( ( startPos != (*this).end() ) &&
+          (std::find(valueToTrim.begin(),
+                     valueToTrim.end(),
+                     *startPos)!=valueToTrim.end()) ) ++startPos;
+
+   if(startPos == (*this).end())
+   {
+      *this = "";
+      return *this;
+   }
+   
+   while( (endPos!=startPos)&& (std::find(valueToTrim.begin(),
+                                          valueToTrim.end(),
+                                          *endPos)!=valueToTrim.end())) --endPos;
+
+   *this = ossimString(startPos, endPos+1);
+
+   return *this;
+}
+
+ossimString ossimString::beforePos(std::string::size_type pos)const
+{
+   return substr(0, pos);
+}
+
+ossimString ossimString::afterPos(std::string::size_type pos)const
+{
+   ossimString result = *this;
+
+   if(pos < length())
+   {
+      result.erase(0, pos+1);
+   }
+   else
+   {
+      return "";
+   }
+
+   return result;
+   
+}
+
+std::vector<ossimString> ossimString::explode(const ossimString& delimeter) const
+{
+   ossimString exp_str = *this;
+   std::vector<ossimString> result;
+   char* tokenPtr = strtok((char*)exp_str.c_str(), (char*)delimeter.c_str());
+
+   while(tokenPtr != NULL)
+   {
+      result.push_back(tokenPtr);
+      tokenPtr = strtok(NULL, delimeter.c_str());
+   }
+
+   return result;
+}
+
+ossimString ossimString::expandEnvironmentVariable() const
+{
+   ossimString result(*this);
+   std::stack<ossim_uint32> startChars;
+   ossimRegExp regExpStart("\\$\\(");
+
+   if(regExpStart.find(result.c_str()))
+   {
+      startChars.push(regExpStart.start());
+      while(!startChars.empty())
+      {
+         ossim_uint32 offset = startChars.top() + 2; // skip over the $(
+         
+         // We will replace like a stack by looking at the right most $(
+         //
+         if(regExpStart.find(result.c_str()+offset))
+         {
+            // maintain absolute offset to the original string
+            startChars.push(regExpStart.start()+offset);
+         }
+         else 
+         {
+            // now look for a closing ) for the stating $(
+            ossimRegExp regExpEnd("\\)");
+            if(regExpEnd.find(result.c_str()+startChars.top()))
+            {
+               ossimString envVarStr(result.begin()+startChars.top()+2,
+                                     result.begin()+startChars.top()+regExpEnd.start());
+               const char* lookup = getenv( envVarStr.c_str() );
+               if ( lookup )
+               {
+                  result.replace(result.begin()+startChars.top(),
+                                 result.begin()+startChars.top()+regExpEnd.start()+1,
+                                 ossimString(lookup));
+               }
+               else 
+               {
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                     << "In member function ossimString::expandEnvironmentVariable() "
+                     << "\n\tERROR: Environment variable("
+                     << envVarStr.c_str()
+                     << ") not found!"
+                     << std::endl;
+                  }
+                  result.replace(result.begin()+startChars.top(),
+                                 result.begin()+startChars.top()+regExpEnd.start()+1,
+                                 "");
+               }
+            }
+            startChars.pop();
+         }
+      }
+   }
+   
+   
+   return result;
+}
+
+//---
+// Regular expression pattern utilities
+//---
+
+ossimString ossimString::beforeRegExp(const char *regularExpressionPattern) const
+{   
+   ossimRegExp anExpression;
+   
+   anExpression.compile(regularExpressionPattern);
+
+   if(anExpression.find(c_str()))
+   {
+      if (anExpression.start() > 0)
+      {
+         return substr(0, anExpression.start());
+      }
+   }
+   
+   return ossimString("");
+}
+
+ossimString ossimString::fromRegExp(const char *regularExpressionPattern) const
+{   
+   ossimRegExp anExpression;
+   
+   anExpression.compile(regularExpressionPattern);
+
+   if(anExpression.find(c_str()))
+   {
+      if (anExpression.start() < size())
+      {
+         return substr(anExpression.start(), (size()-anExpression.start()));
+      }
+   }
+   
+   return ossimString("");
+}
+
+ossimString ossimString::afterRegExp(const char *regularExpressionPattern) const
+{   
+   ossimRegExp anExpression;
+   
+   anExpression.compile(regularExpressionPattern);
+
+   if(anExpression.find(c_str()))
+   {
+      if (anExpression.end() < size())
+      {
+         return substr(anExpression.end(), (size()-anExpression.end()));
+      }
+   }
+   
+   return ossimString("");
+}
+
+ossimString ossimString::match(const char *regularExpressionPattern) const
+{   
+   ossimRegExp anExpression;
+   
+   anExpression.compile(regularExpressionPattern);
+
+   if((anExpression.find(this->c_str())) &&
+      (anExpression.start() !=anExpression.end()))
+   {
+      return this->substr(anExpression.start(),
+                          anExpression.end() - anExpression.start() );
+   }
+
+   
+   return ossimString("");
+}
+
+ossimString ossimString::replaceAllThatMatch(const char *regularExpressionPattern,
+                                             const char *value) const
+{
+   ossimString result = *this;
+   ossimRegExp anExpression;
+   std::string::size_type offset     = 0;
+   std::string::size_type valueLength = ossimString(value).length();
+   anExpression.compile(regularExpressionPattern);
+   if(!anExpression.is_valid())
+   {
+      return *this;
+   }
+   while(anExpression.find(result.c_str()+offset))
+   {
+      if(anExpression.start() < anExpression.end())
+      {
+         result.replace(anExpression.start() + offset,
+                        anExpression.end()-anExpression.start(),
+                        value);
+         offset += anExpression.start() + valueLength;
+      }
+      else
+      {
+         break;
+      }
+   }
+
+   return result;
+}
+
+ossimString ossimString::replaceStrThatMatch(const char *regularExpressionPattern,
+                                             const char *value) const
+{
+   ossimString result = *this;
+   ossimRegExp anExpression;
+   anExpression.compile(regularExpressionPattern);
+   if(!anExpression.is_valid())
+   {
+      return *this;
+   }
+   if(anExpression.find(result.c_str()))
+   {
+      if(anExpression.start() < anExpression.end())
+      {
+         result.replace(anExpression.start(),
+                        anExpression.end()-anExpression.start(),
+                        value);
+      }
+   }
+
+   return result;
+}
+
+bool ossimString::toBool()const
+{
+   ossimString s = c_str();
+   s = s.trim();
+   if (s.empty())
+   {
+      return false;
+   }
+   
+   s = s.downcase();
+   if ( (s == "true") ||
+        (s == "yes")  ||
+        (s == "y")    ||
+        (s == "1") )
+   {
+      return true;
+   }
+   else if ( (s == "false") ||
+             (s == "no")    ||
+             (s == "n")     ||
+             (s == "0") )
+   {
+      return false;
+      
+   }
+   else if (toInt32())
+   {
+      return true;
+   }
+
+   return false;
+}
+
+bool ossimString::toBool(const ossimString& aString)
+{
+   // Check for true or false, yes or no, y or n, and 1 or 0...
+   ossimString s = aString;
+   if (s.empty())
+   {
+      return false;
+   }
+   s.downcase();
+   if ( (s == "true") ||
+        (s == "yes")  ||
+        (s == "y")    ||
+        (s == "1") )
+   {
+      return true;
+   }
+   else if ( (s == "false") ||
+             (s == "no")    ||
+             (s == "n")     ||
+             (s == "0") )
+   {
+      return false;
+      
+   }
+   else if (aString.toInt32())
+   {
+      return true;
+   }
+
+   return false;
+}
+
+ossim_uint8 ossimString::toUInt8()const
+{
+   // Note the std::istringstream::operator>> does not work with unsigned 8 bit.
+   ossim_uint16 i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return static_cast<ossim_uint8>(i);
+}
+
+ossim_uint8 ossimString::toUInt8(const ossimString& aString)
+{
+   return aString.toUInt8();
+}
+
+int ossimString::toInt()const
+{
+   int i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+int ossimString::toInt(const ossimString& aString)
+{
+   return aString.toInt();
+}
+
+ossim_int16 ossimString::toInt16()const
+{
+   ossim_int16 i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+ossim_int16 ossimString::toInt16(const ossimString& aString)
+{
+   return aString.toInt16();
+}
+
+ossim_uint16 ossimString::toUInt16()const
+{
+   ossim_uint16 i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+ossim_uint16 ossimString::toUInt16(const ossimString& aString)
+{
+   return aString.toUInt16();
+}
+
+ossim_int32 ossimString::toInt32()const
+{
+   ossim_int32 i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+ossim_int32 ossimString::toInt32(const ossimString& aString)
+{
+   return aString.toInt32();
+}
+
+ossim_uint32 ossimString::toUInt32()const
+{
+   ossim_uint32 i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+ossim_uint32 ossimString::toUInt32(const ossimString& aString)
+{
+   return aString.toUInt32();
+}
+
+ossim_int64 ossimString::toInt64()const
+{
+   ossim_int64 i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+ossim_int64 ossimString::toInt64(const ossimString& aString)
+{
+   return aString.toInt64();
+}
+
+ossim_uint64 ossimString::toUInt64()const
+{
+   ossim_uint64 i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+ossim_uint64 ossimString::toUInt64(const ossimString& aString)
+{
+   return aString.toUInt64();
+}
+
+long ossimString::toLong()const
+{
+  long i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+long ossimString::toLong(const ossimString& aString)
+{
+   return aString.toLong();
+}
+
+unsigned long  ossimString::toULong()const
+{
+   unsigned long i = 0;
+   if (!empty())
+   {
+      std::istringstream is(m_str);
+      is >> i;
+#if 0
+      // if extraction fails, value (0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  i = 0;
+      }
+#endif
+   }
+   return i;
+}
+
+unsigned long ossimString::toULong(const ossimString& aString)
+{
+   return aString.toULong();
+}
+
+ossim_float32 ossimString::toFloat32()const
+{
+   if(contains("nan"))
+   {
+      return ossim::nan();
+   }
+   ossim_float32 d = 0.0;
+   // this part is core dumping under mingw in ossimPlanet.
+   // There is a possibility that this isn't a thread safe implementation
+   // in mingw stl.  Let's resort back to atof for now
+
+#if 0
+   d = (ossim_float32)atof(c_str());
+#else
+   if (!empty())
+   {
+      std::istringstream is(m_str); // std::istringstream takes a basic_string
+      is >> d;
+#if 0
+      // if extraction fails, value (0.0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  d = 0.0;
+      }
+#endif
+   }
+#endif
+   return d;
+}
+
+ossim_float32 ossimString::toFloat32(const ossimString& aString)
+{
+   return aString.toFloat32();
+}
+
+ossim_float64 ossimString::toFloat64()const
+{
+   if(contains("nan"))
+   {
+      return ossim::nan();
+   }
+   ossim_float64 d = 0.0;
+   // this part is core dumping under mingw in ossimPlanet.
+   // There is a possibility that this isn't a thread safe implementation
+   // in mingw stl.  Let's resort back to atof for now
+
+#if 0
+   d = (ossim_float64)atof(c_str());
+#endif
+#if 1
+   if (!empty())
+   {
+      std::istringstream is(m_str); // std::istringstream takes a basic_string
+      is >> d;
+#if 0
+      // if extraction fails, value (0.0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  d = 0.0;
+      }
+#endif
+   }
+#endif
+   return d;
+}
+
+ossim_float64 ossimString::toFloat64(const ossimString& aString)
+{
+   return aString.toFloat64();
+}
+
+double ossimString::toDouble()const
+{
+   if(contains("nan"))
+   {
+      return ossim::nan();
+   }
+   double d = 0.0;
+
+   // this part is core dumping under mingw in ossimPlanet.
+   // There is a possibility that this isn't a thread safe implementation
+   // in mingw stl.  Let's resort back to atof for now
+
+   if (!empty())
+   {
+#if 0
+      d = atof(c_str());
+#else 
+      std::istringstream is(m_str); // std::istringstream takes a basic_string
+      is >> d;
+#if 0
+      // if extraction fails, value (0.0) is left unmodified until C++11, or
+      // is set to zero (C++11) => no test required!
+      if(is.fail())
+      {
+	  d = 0.0;
+      }
+#endif
+   }
+#endif
+   return d;
+}
+
+double ossimString::toDouble(const ossimString& aString)
+{
+   return aString.toDouble();
+}
+
+ossimString ossimString::toString(bool aValue)
+{
+   std::ostringstream s;
+   s << aValue;
+   ossimString result(s.str());
+   return result;
+}
+
+ossimString ossimString::toString(ossim_int16 aValue)
+{
+   std::ostringstream s;
+   s << aValue;
+   ossimString result(s.str());
+   return result;
+}
+
+ossimString ossimString::toString(ossim_uint16 aValue)
+{
+   std::ostringstream s;
+   s << aValue;
+   ossimString result(s.str());
+   return result;
+}
+
+ossimString ossimString::toString(ossim_int32 aValue)
+{
+   std::ostringstream s;
+   s << aValue;
+   ossimString result(s.str());
+   return result;
+}
+
+ossimString ossimString::toString(ossim_uint32 aValue)
+{
+   std::ostringstream s;
+   s << aValue;
+   ossimString result(s.str());
+   return result;
+}
+
+ossimString ossimString::toString(ossim_int64 aValue)
+{
+   std::ostringstream s;
+   s << aValue;
+   ossimString result(s.str());
+   return result;
+}
+
+ossimString ossimString::toString(ossim_uint64 aValue)
+{
+   std::ostringstream s;
+   s << aValue;
+   ossimString result(s.str());
+   return result;
+}
+
+ossimString ossimString::toString(ossim_float32 aValue,
+                                  ossim_int32 precision,
+                                  bool fixed)
+{
+   if ( ossim::isnan(aValue) )
+   {
+      return ossimString("nan");
+   }
+
+   std::ostringstream s;
+   s << std::setprecision(precision);
+   
+   if (fixed)
+   {
+      s << std::setiosflags(std::ios::fixed); 
+   }
+   
+   s << aValue;
+   
+   return ossimString(s.str());
+}
+
+ossimString ossimString::toString(ossim_float64 aValue,
+                                  ossim_int32 precision,
+                                  bool fixed)
+{
+   if ( ossim::isnan(aValue) )
+   {
+      return ossimString("nan");
+   }
+   
+   std::ostringstream s;
+   s << std::setprecision(precision);
+   
+   if (fixed)
+   {
+      s << std::setiosflags(std::ios::fixed); 
+   }
+   
+   s << aValue;
+   
+   return ossimString(s.str());
+}
+
+ossimString ossimString::before(const ossimString& str,
+                                std::string::size_type pos)const
+{
+   if(*this == "") return ossimString();
+
+   size_type last = find(str.c_str(), pos);
+   if(last >= std::string::npos) return *this;
+   
+   return ossimString( substr(0, last) );
+}
+
+ossimString ossimString::after(const ossimString& str,
+                               std::string::size_type pos)const
+{
+   size_type last = find(str.c_str(), pos);
+   if (last >= std::string::npos) return ossimString();
+   
+   return ossimString( substr(last+str.length()) );
+}
+
+//*************************************************************************************************
+// Splits this string into a vector of strings (fields) using the delimiter list specified.
+// If a delimiter is encountered at the beginning or the end of this, or two delimiters are 
+// contiguous, a blank field is inserted in the vector, unless skipBlankFields is true.
+//*************************************************************************************************
+void ossimString::split(std::vector<ossimString>& result,
+                        const ossimString& separatorList,
+                        bool skipBlankFields)const
+{
+	if(this->empty()) return;
+   
+   std::string::const_iterator iterStart = m_str.begin();
+   std::string::const_iterator iterCurrent = m_str.begin();
+   
+   while(iterCurrent != m_str.end())
+   {
+      if(std::find(separatorList.m_str.begin(), separatorList.m_str.end(), *iterCurrent) != separatorList.m_str.end())
+      {
+         if(iterStart == iterCurrent)
+         {
+            if(!skipBlankFields)
+            {
+               result.push_back(ossimString());
+            }
+         }
+         else 
+         {
+            result.push_back(ossimString(iterStart, iterCurrent));
+         }
+
+         ++iterCurrent;
+         iterStart = iterCurrent;
+      }
+      else 
+      {
+         ++iterCurrent;
+      }
+   }
+   if(iterStart!=iterCurrent)
+   {
+      result.push_back(ossimString(iterStart, iterCurrent));
+   }
+   
+#if 0   
+//   result = split(separatorList);
+   ossimString copyString = *this;
+
+   char* s = strtok(const_cast<char*>(copyString.c_str()),
+                    separatorList.c_str());
+
+   for(std::string::size_type i = 0; i < separatorList.size(); ++ i)
+   {
+      if (((*(this->begin())) == separatorList.c_str()[i]) && !skipBlankFields)
+         result.push_back("");
+   }
+   while(s)
+   {
+      result.push_back(ossimString(s));
+      if ((*s != 0) || !skipBlankFields)
+         s = strtok(NULL, separatorList.c_str());
+   }
+   for(std::string::size_type i = 0; i < separatorList.size(); ++ i)
+   {
+      if (((*(this->end()-1)) == separatorList.c_str()[i]) && !skipBlankFields)
+         result.push_back("");
+   }
+#endif
+}
+
+std::vector<ossimString> ossimString:: split(const ossimString& separatorList,
+                                             bool skipBlankFields)const
+{
+   std::vector<ossimString> result;
+
+   split(result, separatorList, skipBlankFields);
+   
+   return result;
+}
+
+const ossimString& ossimString::join(const std::vector<ossimString>& stringList,
+                                     const ossimString& separator)
+{
+   *this = "";
+   if(stringList.size())
+   {
+      for(long i = 0; i < ((long)stringList.size()-1); ++i)
+      {
+         *this += stringList[i];
+         *this += separator;
+      }
+      *this += stringList[stringList.size()-1];
+   }
+
+   return *this;
+}
+
+ossimString ossimString::urlEncode()const
+{
+   ossimString::const_iterator iter = begin();
+   ossimString result;
+   while(iter != end())
+   {
+      ossim_uint8 c = *iter;
+      
+      if(c > 47 && c < 58)
+      {
+         result += c;
+      }
+      else if(c > 64 && c < 91)
+      {
+         result += c;
+      }
+      else if(c > 96 && c < 123)
+      {
+         result+=c;
+      }
+      else if (c == 32)
+      {
+         result+="+";
+      }
+      else
+      {
+         result += ("%" + ossimHexString(c));
+      }
+      
+      ++iter;
+   }
+
+  return result;
+   
+}
+
+ossimString ossimString::getOssimId() const
+{
+#ifdef OSSIM_ID_ENABLED
+   return ossimString(OSSIM_ID);
+#endif
+   return ossimString("");
+}
+
diff --git a/src/base/ossimStringListProperty.cpp b/src/base/ossimStringListProperty.cpp
new file mode 100644
index 0000000..280f467
--- /dev/null
+++ b/src/base/ossimStringListProperty.cpp
@@ -0,0 +1,257 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimStringListProperty.cpp 19682 2011-05-31 14:21:20Z dburken $
+//
+#include <sstream>
+#include <algorithm>
+#include <ossim/base/ossimStringListProperty.h>
+#include <ossim/base/ossimKeywordlist.h>
+RTTI_DEF1(ossimStringListProperty, "ossimStringListProperty", ossimProperty);
+
+ossimStringListProperty::ossimStringListProperty(const ossimString& name,
+                                                 const std::vector<ossimString>& value)
+   :ossimProperty(name),
+    theValueList(value),
+    theUniqueFlag(false),
+    theOrderMattersFlag(false)
+{
+}
+
+ossimStringListProperty::ossimStringListProperty(const ossimStringListProperty& rhs)
+   :ossimProperty(rhs),
+    theValueList(rhs.theValueList),
+    theConstraintList(rhs.theConstraintList),
+    theUniqueFlag(rhs.theUniqueFlag),
+    theOrderMattersFlag(rhs.theOrderMattersFlag),
+    theMinNumberOfValues(rhs.theMinNumberOfValues),
+    theMaxNumberOfValues(rhs.theMaxNumberOfValues)
+{
+}
+   
+ossimObject* ossimStringListProperty::dup()const
+{
+   return new ossimStringListProperty(*this);
+}
+
+const ossimProperty& ossimStringListProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+
+   const ossimStringListProperty *rhsPtr = dynamic_cast<const ossimStringListProperty*>(&rhs);
+   if(rhsPtr)
+   {
+      theValueList         = rhsPtr->theValueList;
+      theConstraintList    = rhsPtr->theConstraintList;
+      theUniqueFlag        = rhsPtr->theUniqueFlag;
+      theOrderMattersFlag  = rhsPtr->theOrderMattersFlag;
+      theMinNumberOfValues = rhsPtr->theMinNumberOfValues;
+      theMaxNumberOfValues = rhsPtr->theMaxNumberOfValues;
+   }
+
+   return *this;
+}
+
+bool ossimStringListProperty::setValue(const ossimString& value)
+{
+   ossimKeywordlist kwl;
+   std::istringstream in(value);
+   bool result = true;
+   
+   if(kwl.parseStream(in))
+   {
+      int idx = 0;
+      std::vector<ossimString> keys =
+         kwl.getSubstringKeyList( "^([0-9]*" );
+      
+      std::vector<int> theNumberList(keys.size());
+      for(idx = 0; idx < (int)theNumberList.size();++idx)
+      {
+         theNumberList[idx] = keys[idx].toInt();
+      }
+      std::sort(theNumberList.begin(), theNumberList.end());
+      clearValueList();
+      for(idx = 0; idx < (int)theNumberList.size(); ++idx)
+      {
+         const char* temp = kwl.find(ossimString::toString(theNumberList[idx]));
+
+         if(temp)
+         {
+            addValue(temp);
+         }
+      }
+   }
+   else
+   {
+      result = false;
+   }
+
+   return result;
+}
+
+void ossimStringListProperty::valueToString(ossimString& valueResult)const
+{
+   ossimKeywordlist kwl;
+   int idx = 0;
+
+   for(idx = 0; idx < (int)theValueList.size(); ++idx)
+   {
+      kwl.add(ossimString::toString(idx).c_str(),
+              theValueList[idx],
+              true);
+   }
+   
+   valueResult = kwl.toString();
+}
+
+
+void ossimStringListProperty::clearValueList()
+{
+   theValueList.clear();
+}
+
+ossimString ossimStringListProperty::getValueAt(int idx)const
+{
+   if((idx >= 0)&&
+      (idx < (int)getNumberOfValues()))
+   {
+      return theValueList[idx];
+   }
+   
+   return ossimString("");;
+}
+
+bool ossimStringListProperty::setValueAt(int idx,
+                                         const ossimString& value)
+{
+   bool result = true;
+   
+   if(canAddValue(value))
+   {
+      if((idx < (int)getNumberOfValues())&&
+         (idx >= 0))
+      {
+         theValueList[idx] = value;
+      }
+   }
+   else
+   {
+      result = false;
+   }
+   return result;
+   
+}
+
+bool ossimStringListProperty::addValue(const ossimString& value)
+{
+   bool result = true;
+   
+   if(canAddValue(value))
+   {
+      theValueList.push_back(value);
+   }
+   else
+   {
+      result = false;
+   }
+
+   return result;
+}
+ 
+ossim_uint32 ossimStringListProperty::getNumberOfValues()const
+{
+   return (int)theValueList.size();
+}
+
+ossim_uint32 ossimStringListProperty::getNumberOfContraints()const
+{
+   return (ossim_uint32)theConstraintList.size();
+}
+
+ossimString ossimStringListProperty::getConstraintAt(ossim_uint32 idx)const
+{
+   if(idx < theConstraintList.size())
+   {
+      return theConstraintList[(int)idx];
+   }
+
+   return ossimString("");
+}
+
+void ossimStringListProperty::setConstraints(const std::vector<ossimString>& constraints)
+{
+   theConstraintList =  constraints;
+}
+
+bool ossimStringListProperty::hasConstraints()const
+{
+   return (theConstraintList.size()>0);
+}
+
+void ossimStringListProperty::setUniqueFlag(bool flag)
+{
+   theUniqueFlag = flag;
+}
+
+void ossimStringListProperty::setOrderMattersFlag(bool flag)
+{
+   theOrderMattersFlag = flag;
+}
+
+void ossimStringListProperty::setNumberOfValuesBounds(int minNumber,
+                                                      int maxNumber)
+{
+   theMinNumberOfValues = minNumber;
+   theMaxNumberOfValues = maxNumber;
+}
+
+void ossimStringListProperty::getNumberofValuesBounds(int& minNumber,
+                                                      int& maxNumber)const
+{
+   minNumber = theMinNumberOfValues;
+   maxNumber = theMaxNumberOfValues;
+}
+
+bool ossimStringListProperty::findValueInConstraintList(const ossimString& value)const
+{
+   return (std::find(theConstraintList.begin(),
+                     theConstraintList.end(),
+                     value)!=theConstraintList.end());
+}
+
+bool ossimStringListProperty::findValueInValueList(const ossimString& value)const
+{
+   return (std::find(theValueList.begin(),
+                     theValueList.end(),
+                     value)!=theConstraintList.end());
+}
+
+bool ossimStringListProperty::canAddValue(const ossimString& value)const
+{
+   bool result = true;
+
+   if(hasConstraints())
+   {
+      if(findValueInConstraintList(value))
+      {
+         if(theUniqueFlag)
+         {
+            if(findValueInValueList(value))
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+   }
+
+   return result;
+}
diff --git a/src/base/ossimStringProperty.cpp b/src/base/ossimStringProperty.cpp
new file mode 100644
index 0000000..010134c
--- /dev/null
+++ b/src/base/ossimStringProperty.cpp
@@ -0,0 +1,126 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// LICENSE: LGPL see top level license.txt
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimStringProperty.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/base/ossimStringProperty.h>
+#include <algorithm>
+RTTI_DEF1(ossimStringProperty, "ossimStringProperty", ossimProperty);
+
+ossimStringProperty::ossimStringProperty(const ossimString& name,
+                                         const ossimString& value,
+                                         bool editableFlag,
+                                         const std::vector<ossimString>& constraintList)
+   :ossimProperty(name),
+    theValue(value),
+    theEditableFlag(editableFlag),
+    theConstraints(constraintList)
+{
+}
+
+ossimStringProperty::ossimStringProperty(const ossimStringProperty& rhs)
+   :ossimProperty(rhs),
+    theValue(rhs.theValue),
+    theEditableFlag(rhs.theEditableFlag),
+    theConstraints(rhs.theConstraints)
+{
+}
+
+ossimObject* ossimStringProperty::dup()const
+{
+   return new ossimStringProperty(*this);
+}
+
+const ossimProperty& ossimStringProperty::assign(const ossimProperty& rhs)
+{
+   ossimProperty::assign(rhs);
+   
+   const ossimStringProperty* rhsPtr = dynamic_cast<const ossimStringProperty*>(&rhs);
+   
+   theValue = rhs.valueToString();
+   
+   if(rhsPtr)
+   {
+      theEditableFlag = rhsPtr->theEditableFlag;
+      theConstraints  = rhsPtr->theConstraints;
+   }
+   
+   return *this;
+}
+
+
+void ossimStringProperty::setEditableFlag(bool flag)
+{
+   theEditableFlag = flag;
+}
+
+bool ossimStringProperty::getEditableFlag()const
+{
+   return theEditableFlag;
+}
+
+bool ossimStringProperty::isEditable()const
+{
+   return (getEditableFlag() == true);
+}
+
+
+void ossimStringProperty::clearConstraints()
+{
+   theConstraints.clear();
+}
+
+void ossimStringProperty::setConstraints(const std::vector<ossimString>& constraintList)
+{
+   theConstraints = constraintList;
+}
+
+void ossimStringProperty::addConstraint(const ossimString& value)
+{
+   theConstraints.push_back(value);
+}
+
+const std::vector<ossimString>& ossimStringProperty::getConstraints()const
+{
+   return theConstraints;
+}
+
+bool ossimStringProperty::hasConstraints()const
+{
+   return (theConstraints.size() > 0);
+}
+
+bool ossimStringProperty::setValue(const ossimString& value)
+{
+   bool result = true;
+   
+   if(theConstraints.size() > 0)
+   {
+      if(std::find(theConstraints.begin(),
+                   theConstraints.end(),
+                   value)
+                    != theConstraints.end())
+      {
+         theValue = value;
+      }
+      else
+      {
+         result = false;
+      }
+   }
+   else
+   {
+      theValue = value;
+   }
+
+   return result;
+}
+
+void ossimStringProperty::valueToString(ossimString& valueResult)const
+{
+   valueResult = theValue;
+}
diff --git a/ossim/src/ossim/base/ossimTDpt.cpp b/src/base/ossimTDpt.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimTDpt.cpp
rename to src/base/ossimTDpt.cpp
diff --git a/src/base/ossimTempFilename.cpp b/src/base/ossimTempFilename.cpp
new file mode 100644
index 0000000..96b1b1c
--- /dev/null
+++ b/src/base/ossimTempFilename.cpp
@@ -0,0 +1,115 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// Description: This is a tmeporary filename class it will create a temporary
+//              file and will also delete it upon destruction
+//
+//*************************************************************************
+// $Id: ossimTempFilename.cpp 15524 2009-09-30 01:02:26Z dburken $
+#include <stdlib.h>
+#include <fstream>
+#include <ossim/base/ossimTempFilename.h>
+#include <ossim/base/ossimEnvironmentUtility.h>
+#include <time.h>
+
+ossimTempFilename::ossimTempFilename(const ossimString& tempDir,
+                                     const ossimString& prefix,
+                                     const ossimString& extension,
+                                     bool autodelete,
+                                     bool useWildcardDelete)
+   :theTempDir(tempDir),
+    thePrefix(prefix),
+    theExtension(extension),
+    theAutoDeleteFlag(autodelete),
+    theWildCardDeleteFlag(useWildcardDelete)
+{
+}
+
+ossimTempFilename::~ossimTempFilename()
+{
+   if(*((ossimFilename*)this) != "")
+   {
+      
+      if(theAutoDeleteFlag)
+      {
+         if(theWildCardDeleteFlag)
+         {
+            wildcardRemove(*this + ".*");
+         }
+         else
+         {
+            remove();
+         }
+      }
+   }
+}
+
+void  ossimTempFilename::generateRandomFile()
+{
+   generate(false);
+}
+
+void ossimTempFilename::generateRandomDir()
+{
+   generate(true);
+}
+
+void ossimTempFilename::generate(bool createAsDirectoryFlag)
+{
+   srand(time(0));
+   ossimString tempDirCopy = theTempDir;
+
+   if(tempDirCopy == "")
+   {
+      tempDirCopy = ossimEnvironmentUtility::instance()->getEnvironmentVariable("TEMP");
+      if(tempDirCopy=="")
+      {
+         tempDirCopy  = ossimEnvironmentUtility::instance()->getEnvironmentVariable("TMP");
+      }
+      if(tempDirCopy == "")
+      {
+         if(ossimFilename("/tmp").exists())
+         {
+            tempDirCopy = "/tmp";
+         }
+      }
+   }
+
+   int count = 0;
+   int randNumber1 = rand();
+   ossimFilename prefixDir = ossimFilename(tempDirCopy);
+   ossimFilename result = prefixDir.dirCat(thePrefix+
+                                           ossimString::toString(randNumber1));
+   
+   while((count < RAND_MAX)&&result.exists())
+   {
+      randNumber1 = rand();
+      result = prefixDir.dirCat(thePrefix+
+                                ossimString::toString(randNumber1));
+      
+      ++count;
+   }
+
+   if(theExtension != "")
+   {
+      result = result.setExtension(theExtension);
+   }
+   *((ossimFilename*)this) = result;
+   if(result != "")
+   {
+      if(createAsDirectoryFlag)
+      {
+         createDirectory();
+      }
+      else
+      {
+         std::ofstream out(result.c_str());
+         out.close();
+      }
+   }
+}
diff --git a/ossim/src/ossim/base/ossimTextProperty.cpp b/src/base/ossimTextProperty.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimTextProperty.cpp
rename to src/base/ossimTextProperty.cpp
diff --git a/ossim/src/ossim/base/ossimThinPlateSpline.cpp b/src/base/ossimThinPlateSpline.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimThinPlateSpline.cpp
rename to src/base/ossimThinPlateSpline.cpp
diff --git a/ossim/src/ossim/base/ossimThreeParamDatum.cpp b/src/base/ossimThreeParamDatum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimThreeParamDatum.cpp
rename to src/base/ossimThreeParamDatum.cpp
diff --git a/src/base/ossimTieGpt.cpp b/src/base/ossimTieGpt.cpp
new file mode 100644
index 0000000..9a4d141
--- /dev/null
+++ b/src/base/ossimTieGpt.cpp
@@ -0,0 +1,246 @@
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/base/ossimTieGpt.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+//*******************************************************************
+
+std::ostream& ossimTieGpt::print(std::ostream& os) const
+{
+   os << "( ";
+   os << dynamic_cast<const ossimGpt&>(*this);
+   os << ", ";
+   os << tie;
+   os << ", ";
+   if (ossim::isnan(score) == false)
+   {
+      os << std::setiosflags(std::ios::fixed) << std::setprecision(15);
+      os << score;
+   } else {
+      os << "nan";
+   }
+   os << " )";
+
+   return os;
+}
+
+std::ostream& ossimTieGpt::printTab(std::ostream& os) const
+{
+   os << std::setiosflags(std::ios::fixed) << std::setprecision(15);
+   os<< lond() ;
+   os<<"\t"<< latd();
+   os<<"\t"<< height();
+   os<<"\t"<< tie.x;
+   os<<"\t"<< tie.y;
+   os<<"\t"<< score;
+
+   return os;
+}
+
+std::ostream& operator<<(std::ostream& os, const ossimTieGpt& pt)
+{
+   return pt.print(os);
+}
+
+std::istream& operator>>(std::istream& is, ossimTieGpt& pt)
+{
+   //---
+   // Expected input format:
+   // ( (ossimDPt), (ossimDpt), score )
+   // score is real or nan
+   //---
+
+   // Start with a nan point.
+   pt.makeNan();
+   // Check the stream.
+   if (!is) return is;
+
+   ossimString tempString;
+
+   // Gobble the "(".
+   is >> tempString;
+
+   //get the first point
+   is>>dynamic_cast<ossimGpt&>(pt);
+
+   // Eat the ",".
+   char c;
+   is.get(c);
+
+   //get the second point
+   is>>pt.tie;
+
+   // Eat the second ",".
+   is.get(c);
+
+   // Get the score
+   const int SZ = 64; // real number buffer size
+   char tempChars[SZ];
+   is.get(tempChars, SZ, ',');
+   if (!is) return is;
+   tempChars[SZ-1] = '\0';
+   tempString = tempChars;
+   tempString.trim();
+   if (tempString == "nan")
+   {
+      pt.score = ossim::nan();
+   }
+   else
+   {
+      pt.score = tempString.toDouble();
+   }
+
+   // Gobble the trailing ")".
+   is >> tempString;
+   
+   // Finished
+   return is;
+}
+
+//constants for GML 2.1.2
+const char* GROUND_GML2      = "ground/gml:Point";
+const char* IMAGE_GML2       = "image/gml:Point";
+const char* SCORE_GML2       = "score";
+const char* COORD_GML2       = "gml:coord";
+const char* COORDINATES_GML2 = "gml:coordinates";
+
+ossimRefPtr<ossimXmlNode>
+ossimTieGpt::exportAsGmlNode(ossimString aGmlVersion)const
+{   
+   ossimRefPtr<ossimXmlNode> node(new ossimXmlNode);
+   // check datum to be WGS84
+   if ( !(datum()->operator==(*(ossimDatumFactory::instance()->wgs84()))) )
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode datum must be WGS84\n";
+      return node;
+   }
+   // check nans in lon/lat and in tie
+   if (isLatNan() || isLonNan() || tie.hasNans())
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode positions have nan\n";
+      return node;
+   }
+   if (aGmlVersion[static_cast<std::string::size_type>(0)] == '2')
+   {
+      node->setTag("SimpleTiePoint");
+      // note: no "fid" attribute (feature id")
+      //store Ground Point WGS84 + height above ellipsoid in meters
+      ossimRefPtr<ossimXmlNode> gcoord =  node->addNode(ossimString(GROUND_GML2) + "/" + COORD_GML2 );
+      gcoord->addChildNode("X",ossimString::toString(lond()));
+      gcoord->addChildNode("Y",ossimString::toString(latd()));
+      if (!isHgtNan())
+      {
+        gcoord->addChildNode("Z",ossimString::toString(height())); //above ellipsoid
+      }
+
+      // store image tie point
+      ossimRefPtr<ossimXmlNode> tcoord =  node->addNode(ossimString(IMAGE_GML2) + "/" + COORD_GML2);
+      tcoord->addChildNode("X",ossimString::toString(tie.x));
+      tcoord->addChildNode("Y",ossimString::toString(tie.y));
+
+      //store score (change name to confidence?)
+      node->addNode(SCORE_GML2,ossimString::toString(score));
+   } else {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode Unsupported GML version : " << aGmlVersion <<"\n";
+   }
+   return node;
+}
+
+bool
+ossimTieGpt::importFromGmlNode(ossimRefPtr<ossimXmlNode> aGmlNode, ossimString aGmlVersion)
+{
+   //assuming datum is EPSG:4326 (aka WGS84)
+   //feature has to be a SimpleTiePoint feature
+   //TBD : add support for coord instead of coordinates
+   //TBD : more robust type checks (for X,Y,Z and score) - create extra protected function
+
+   //clear data
+   makeNan();
+   tie.makeNan();
+   score = 0;
+
+   if (aGmlVersion[static_cast<std::string::size_type>(0)] == '2')
+   {
+      //read ground point
+      ossimRefPtr<ossimXmlNode> gn = aGmlNode->findFirstNode(GROUND_GML2);
+      ossimRefPtr<ossimXmlNode> gcoord = gn->findFirstNode(COORD_GML2);
+      if (gcoord.valid())
+      {
+         //read coord
+         ossimRefPtr<ossimXmlNode> gx = gcoord->findFirstNode("X");
+         if (gx.valid())
+         {
+            lond(ossimString(gx->getText()).toDouble());
+         } else {
+            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no ground X found in coord\n";
+            return false;
+         }
+         ossimRefPtr<ossimXmlNode> gy = gcoord->findFirstNode("Y");
+         if (gy.valid())
+         {
+            latd(ossimString(gy->getText()).toDouble());
+         } else {
+            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no ground Y found in coord\n";
+            return false;
+         }
+         ossimRefPtr<ossimXmlNode> gz = gcoord->findFirstNode("Z");
+         if (gz.valid())
+         {
+            height(ossimString(gz->getText()).toDouble());
+         } // no Z value is possible
+      }
+      else {
+         //try to read coordinates
+         //TBD
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode gml:coordinates not developed yet for ground\n";
+         return false;
+      }
+
+      //read image point
+      ossimRefPtr<ossimXmlNode> in = aGmlNode->findFirstNode(IMAGE_GML2);
+      ossimRefPtr<ossimXmlNode> icoord = in->findFirstNode(COORD_GML2);
+      if (icoord.valid())
+      {
+         //read coord
+         ossimRefPtr<ossimXmlNode> ix = icoord->findFirstNode("X");
+         if (ix.valid())
+         {
+            tie.x = ossimString(ix->getText()).toDouble();
+         } else {
+            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no image X found in coord\n";
+            return false;
+         }
+         ossimRefPtr<ossimXmlNode> iy = icoord->findFirstNode("Y");
+         if (iy.valid())
+         {
+            tie.y = ossimString(iy->getText()).toDouble();
+         } else {
+            ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no image Y found in coord\n";
+            return false;
+         }
+         //don't read Z value (shouldn't be any)
+      }
+      else {
+         //try to read coordinates
+         //TBD
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode gml:coordinates not developed yet for image\n";
+         return false;
+      }
+
+      //read score
+      ossimRefPtr<ossimXmlNode> scoren = aGmlNode->findFirstNode(SCORE_GML2);
+      if (scoren.valid())
+      {
+         score = ossimString(scoren->getText()).toDouble();
+      } else {
+         score = 0.0;
+      }
+      return true;
+   } else {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode Unsupported GML version : " << aGmlVersion <<"\n";
+      return false;
+   }
+}
diff --git a/ossim/src/ossim/base/ossimTieGptSet.cpp b/src/base/ossimTieGptSet.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimTieGptSet.cpp
rename to src/base/ossimTieGptSet.cpp
diff --git a/src/base/ossimTileHash.cpp b/src/base/ossimTileHash.cpp
new file mode 100644
index 0000000..2679d4d
--- /dev/null
+++ b/src/base/ossimTileHash.cpp
@@ -0,0 +1,123 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken Copied from TiledImageHash.
+//
+// Description: Hashing function for tiled rectangles.  WIll hash a
+//              dpt or a to a single index value.
+//
+// NOTE:  This works with rectangles that are positive in the line up
+//        (y) direction.
+//              
+//*******************************************************************
+//  $Id: ossimTileHash.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <cfloat> // for FLT_EPSILON
+
+#include <ossim/base/ossimTileHash.h>
+
+ossimTileHash::ossimTileHash(const ossimDrect& imageRect,
+                             double tileWidth,
+                             double tileHeight)
+   :
+      ossimPointHash(),
+      theImageRect(imageRect)
+{
+   // make sure that the width of the tile is not larger than
+   // the width of the image rectangle.
+   if(theImageRect.width() <= tileWidth)
+   {
+      theTileWidth = theImageRect.width();
+      theNumberOfHorizTiles = 1;
+   }
+   else
+   {
+      theTileWidth          = tileWidth;
+      double tempDiv        = theImageRect.width()/theTileWidth;
+      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
+      theNumberOfHorizTiles = static_cast<long>(tempDiv);
+      
+      if(fabs(overFlow) > FLT_EPSILON) // if the extent went beyond a tile
+      {
+         theNumberOfHorizTiles ++;      // we must say it has another tile
+      }
+   }
+
+   // make sure the height of the tile is not larger than the
+   // height of the image rectangle.
+   if(theImageRect.height() <= tileHeight)
+   {
+      theTileHeight = theImageRect.height();
+      theNumberOfVertTiles = 1;
+   }
+   else
+   {
+      theTileHeight         = tileHeight;
+      double tempDiv        = theImageRect.height()/theTileHeight;
+      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
+      theNumberOfVertTiles = static_cast<long>(tempDiv);
+
+      if(fabs(overFlow) > FLT_EPSILON) // if the extent went beyond a tile
+      {
+         theNumberOfVertTiles ++;      // we must say it has another tile
+      }
+   }
+}
+
+ossimTileHash::~ossimTileHash()
+{
+}
+
+long ossimTileHash::operator()(const ossimFpt& aPoint)
+{
+   if ( (aPoint.x >= theImageRect.ul().x) &&
+        (aPoint.x <= theImageRect.lr().x) &&
+        (aPoint.y <= theImageRect.ul().y) &&
+        (aPoint.y >= theImageRect.lr().y) )
+   {
+      // how far is the point horizontally  from the upper left corner
+      double deltaWidth  = aPoint.x - theImageRect.ul().x;
+
+      // how far is the point vertically from the upper left point
+      double deltaHeight = theImageRect.ul().y - aPoint.y;
+
+      // solve the horizontal and vertical index numbers
+      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
+      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
+
+      // Map to a linear array.
+      // Just like you would index a 2-D array in memory
+      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
+   }
+
+   return -1;
+}
+
+long ossimTileHash::operator()(const ossimDpt& aPoint)
+{
+   if ( (aPoint.x >= theImageRect.ul().x) &&
+        (aPoint.x <= theImageRect.lr().x) &&
+        (aPoint.y <= theImageRect.ul().y) &&
+        (aPoint.y >= theImageRect.lr().y) )
+   {
+      // how far is the point horizontally  from the upper left corner
+      double deltaWidth  = aPoint.x - theImageRect.ul().x;
+
+      // how far is the point vertically from the upper left point
+      double deltaHeight = theImageRect.ul().y - aPoint.y;
+
+      // solve the horizontal and vertical index numbers
+      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
+      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
+
+      // Map to a linear array.
+      // Just like you would index a 2-D array in memory
+      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
+   }
+
+   return -1;
+}
diff --git a/src/base/ossimTiledImageHash.cpp b/src/base/ossimTiledImageHash.cpp
new file mode 100644
index 0000000..3bba06b
--- /dev/null
+++ b/src/base/ossimTiledImageHash.cpp
@@ -0,0 +1,140 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description: Hashing function for tiled rectangles.  WIll hash a
+//              dpt to a single index value.
+//              
+//*******************************************************************
+//  $Id: ossimTiledImageHash.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <cfloat> // for FLT_EPSILON
+
+#include <ossim/base/ossimTiledImageHash.h>
+
+
+ossimTiledImageHash::ossimTiledImageHash(const ossimDrect &imageRect,
+                                         double tileWidth,
+                                         double tileHeight)
+   :ossimPointHash(),
+    theImageRect(imageRect)
+{
+   // make sure that the width of the tile is not larger than
+   // the width of the image rectangle.
+   if(theImageRect.width() < tileWidth)
+   {
+      theTileWidth = theImageRect.width();
+      theNumberOfHorizTiles = 1;
+   }
+   else
+   {
+      theTileWidth          = tileWidth;
+      double tempDiv        = theImageRect.width()/theTileWidth;
+      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
+      theNumberOfHorizTiles = static_cast<long>(tempDiv);
+      
+      if(fabs(overFlow) >= FLT_EPSILON) // if the extent went beyond a tile
+      {
+         theNumberOfHorizTiles ++;      // we must say it has another tile
+      }
+   }
+
+   // make sure the height of the tile is not larger than the
+   // height of the image rectangle.
+   if(theImageRect.height() < tileHeight)
+   {
+      theTileHeight = theImageRect.height();
+      theNumberOfVertTiles = 1;
+   }
+   else
+   {
+      theTileHeight         = tileHeight;
+      double tempDiv        = theImageRect.height()/theTileHeight;
+      double overFlow       = tempDiv  - static_cast<long>(tempDiv);
+      theNumberOfVertTiles = static_cast<long>(tempDiv);
+
+      if(fabs(overFlow) >= FLT_EPSILON) // if the extent went beyond a tile
+      {
+         theNumberOfVertTiles ++;      // we must say it has another tile
+      }
+   }
+
+}
+
+ossimTiledImageHash::~ossimTiledImageHash()
+{
+}
+
+long ossimTiledImageHash::operator()(const ossimDpt &aPoint)
+{
+   if(aPoint.x >= theImageRect.ul().x && aPoint.y >= theImageRect.ul().y)
+   {
+      // how far is the point horizontally  from the upper left corner
+      double deltaWidth  = aPoint.x - theImageRect.ul().x;
+
+      // how far is the point vertically from the upper left point
+      double deltaHeight = aPoint.y - theImageRect.ul().y;
+
+      // if deltas are negative then we are outside the
+      // bounds
+      if((deltaWidth < 0) || (deltaHeight < 0)) 
+      {
+         return -1;
+      }
+
+      // check if outside the rectangle
+      if( (deltaWidth > theNumberOfHorizTiles*theTileWidth)||
+          (deltaHeight > theNumberOfVertTiles*theTileHeight))
+      {
+         return -1;
+      }
+      // solve the horizontal and vertical index numbers
+      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
+      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
+
+      // map to a linear array.  Just like you would index a 2-D array in memory
+      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
+   }
+
+   return -1;
+}
+
+long ossimTiledImageHash::operator()(const ossimFpt &aPoint)
+{
+   if(aPoint.x >= theImageRect.ul().x && aPoint.y >= theImageRect.ul().y)
+   {
+      // how far is the point horizontally  from the upper left corner
+      double deltaWidth  = aPoint.x - theImageRect.ul().x;
+
+      // how far is the point vertically from the upper left point
+      double deltaHeight = aPoint.y - theImageRect.ul().y;
+
+      // if deltas are negative then we are outside the
+      // bounds
+      if((deltaWidth < 0) || (deltaHeight < 0)) 
+      {
+         return -1;
+      }
+
+      // check if outside the rectangle
+      if( (deltaWidth > theNumberOfHorizTiles*theTileWidth)||
+          (deltaHeight > theNumberOfVertTiles*theTileHeight))
+      {
+         return -1;
+      }
+      // solve the horizontal and vertical index numbers
+      long indexWidth  = static_cast<long>(deltaWidth  / theTileWidth);
+      long indexHeight = static_cast<long>(deltaHeight / theTileHeight);
+
+      // map to a linear array.  Just like you would index a 2-D array in memory
+      return static_cast<long>(theNumberOfHorizTiles*indexHeight + indexWidth);
+   }
+
+   return -1;
+}
+
diff --git a/src/base/ossimTimer.cpp b/src/base/ossimTimer.cpp
new file mode 100644
index 0000000..ca57410
--- /dev/null
+++ b/src/base/ossimTimer.cpp
@@ -0,0 +1,110 @@
+/* 
+ * This code was taken directly from the OpenSceneGraph
+ */
+//#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTimer.h>
+
+ossimTimer* ossimTimer::m_instance = 0;
+
+// follows are the constructors of the Timer class, once version
+// for each OS combination.  The order is WIN32, FreeBSD, Linux, IRIX,
+// and the rest of the world.
+//
+// all the rest of the timer methods are implemented within the header.
+
+
+ossimTimer* ossimTimer::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossimTimer;
+   }
+   return m_instance;
+}
+
+// ---
+// From:  http://msdn.microsoft.com/en-us/library/b0084kay.aspx
+// Defined for applications for Win32 and Win64. Always defined.
+// ---
+#if defined(_WIN32)
+
+#include <sys/types.h>
+#include <fcntl.h>
+#include <windows.h>
+#include <winbase.h>
+ossimTimer::ossimTimer()
+{
+   LARGE_INTEGER frequency;
+   if(QueryPerformanceFrequency(&frequency))
+   {
+      m_secsPerTick = 1.0/(double)frequency.QuadPart;
+   }
+   else
+   {
+      m_secsPerTick = 1.0;
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"Error: ossimTimer::ossimTimer() unable to use QueryPerformanceFrequency, "<<std::endl;
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"timing code will be wrong, Windows error code: "<<GetLastError()<<std::endl;
+   }
+   
+   setStartTick();        
+}
+
+ossimTimer::Timer_t ossimTimer::tick() const
+{
+   LARGE_INTEGER qpc;
+   if (QueryPerformanceCounter(&qpc))
+   {
+      return qpc.QuadPart;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"Error: ossimTimer::ossimTimer() unable to use QueryPerformanceCounter, "<<std::endl;
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"timing code will be wrong, Windows error code: "<<GetLastError()<<std::endl;
+      return 0;
+   }
+}
+
+#else
+
+
+#include <unistd.h>
+
+ossimTimer::ossimTimer(  )
+{
+   m_secsPerTick = (1.0 / (double) 1000000);
+   
+   setStartTick();        
+}
+
+
+ #if defined(_POSIX_TIMERS) && ( _POSIX_TIMERS > 0 ) && defined(_POSIX_MONOTONIC_CLOCK)
+     #include <time.h>
+
+     ossimTimer::Timer_t ossimTimer::tick() const
+     {
+         struct timespec ts;
+         clock_gettime(CLOCK_MONOTONIC, &ts);
+         return ((ossimTimer::Timer_t)ts.tv_sec)*1000000+(ossimTimer::Timer_t)ts.tv_nsec/1000;
+     }
+ #else
+     #include <sys/time.h>
+
+     ossimTimer::Timer_t ossimTimer::tick() const
+     {
+         struct timeval tv;
+         gettimeofday(&tv, NULL);
+         return ((ossimTimer::Timer_t)tv.tv_sec)*1000000+(ossimTimer::Timer_t)tv.tv_usec;
+     }
+ #endif
+
+// ossimTimer::Timer_t ossimTimer::tick() const
+// {
+//    struct timeval tv;
+//    gettimeofday(&tv, NULL);
+//    return ((ossimTimer::Timer_t)tv.tv_sec)*1000000+(ossimTimer::Timer_t)tv.tv_usec;
+// }
+
+#endif
diff --git a/src/base/ossimTrace.cpp b/src/base/ossimTrace.cpp
new file mode 100644
index 0000000..23e1f38
--- /dev/null
+++ b/src/base/ossimTrace.cpp
@@ -0,0 +1,40 @@
+//*****************************************************************************
+// FILE: ossimTrace.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimTrace
+//
+// SOFTWARE HISTORY:
+//>
+//   24Apr2001  Oscar Kramer
+//              Initial coding.
+//<
+//*****************************************************************************
+// $Id: ossimTrace.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimTraceManager.h>
+#include <ossim/base/ossimCommon.h>
+//*****************************************************************************
+//  CONSTRUCTOR: ossimTrace
+//  
+//*****************************************************************************
+ossimTrace::ossimTrace(const ossimString& trace_name)
+   :
+      theTraceName   (trace_name),
+      theEnabledFlag (false)
+{
+   ossimTraceManager::instance()->addTrace(this);
+}
+
+ossimTrace::~ossimTrace()
+{
+   ossimTraceManager::instance()->removeTrace(this);
+}
+
diff --git a/src/base/ossimTraceManager.cpp b/src/base/ossimTraceManager.cpp
new file mode 100644
index 0000000..3d46a63
--- /dev/null
+++ b/src/base/ossimTraceManager.cpp
@@ -0,0 +1,105 @@
+//*****************************************************************************
+// Copyright (C) 2005 Garrett Potts, all rights reserved.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+// 
+// DESCRIPTION:
+//   Contains declaration of class ossimTraceManager.
+//
+//*****************************************************************************
+// $Id: ossimTraceManager.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <algorithm>
+
+#include <ossim/base/ossimTraceManager.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimRegExp.h>
+
+ossimTraceManager* ossimTraceManager::theInstance = 0;
+
+ossimTraceManager::ossimTraceManager()
+{
+   theInstance = this;
+}
+
+ossimTraceManager* ossimTraceManager::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimTraceManager;
+   }
+   
+   return theInstance;
+}
+
+void ossimTraceManager::setTracePattern(const ossimString& pattern)
+{
+   thePattern = pattern;
+   setTraceFlags(true);
+}
+
+void ossimTraceManager::addTrace(ossimTrace* traceObj)
+{
+   if(!traceObj)
+   {
+      return;
+   }
+   
+   std::vector<ossimTrace*>::iterator iter = std::find(theTraceList.begin(),
+                                                       theTraceList.end(),
+                                                       traceObj);
+   if(iter == theTraceList.end())
+   {
+      theTraceList.push_back(traceObj);
+
+      if(thePattern.size())
+      {
+         ossimRegExp rxp;
+         rxp.compile(thePattern.c_str());
+         if(rxp.find(traceObj->getTraceName().c_str()))
+         {
+            // Found a match so set the flag and increment the counter.
+            traceObj->setTraceFlag(true);
+         }
+         else
+         {
+            traceObj->setTraceFlag(false);
+         }
+      }
+      else
+      {
+         traceObj->setTraceFlag(false);
+      } 
+   }
+}
+
+void ossimTraceManager::removeTrace(ossimTrace* traceObj)
+{
+   std::vector<ossimTrace*>::iterator iter = std::find(theTraceList.begin(),
+                                                       theTraceList.end(),
+                                                       traceObj);
+
+   if(iter !=  theTraceList.end())
+   {
+      theTraceList.erase(iter);
+   }
+}
+
+void ossimTraceManager::setTraceFlags(bool flag)
+{
+   ossimRegExp rxp;
+   rxp.compile(thePattern.c_str());
+   
+   for(ossim_uint32 idx = 0; idx < theTraceList.size(); ++idx)
+   {
+      if (rxp.find(theTraceList[idx]->getTraceName().c_str()))
+      {
+         // Found a match so set the flag and increment the counter.
+         theTraceList[idx]->setTraceFlag(flag);
+      }
+   }
+}
diff --git a/src/base/ossimUnitConversionTool.cpp b/src/base/ossimUnitConversionTool.cpp
new file mode 100644
index 0000000..c4c04b1
--- /dev/null
+++ b/src/base/ossimUnitConversionTool.cpp
@@ -0,0 +1,435 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimUnitConversionTool.cpp 17503 2010-06-02 11:18:49Z dburken $
+
+#include <iostream>
+#include <iomanip>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimGpt.h>
+
+std::ostream& operator<<(std::ostream& out,
+                         const ossimUnitConversionTool& data)
+{
+   out << std::setprecision(15) << std::setiosflags(std::ios::fixed)
+       << "Meters:           " << data.getMeters()
+       << "\nFeet:             " << data.getFeet()
+       << "\nU.S. Survey Feet: " << data.getUsSurveyFeet()
+       << "\nNautical miles:   " << data.getNauticalMiles()
+       << "\nDegrees:          " << data.getDegrees()
+       << "\nMinutes:          " << data.getMinutes()
+       << "\nSeconds:          " << data.getSeconds() << std::endl;
+   
+   return out;
+}
+
+ossimUnitConversionTool::ossimUnitConversionTool(double value,
+                                                 ossimUnitType unitType)
+   : theValue(value),
+     theUnitType(unitType),
+     theOrigin()
+{
+}
+
+ossimUnitConversionTool::ossimUnitConversionTool(const ossimGpt& origin,
+                                                 double value,
+                                                 ossimUnitType unitType)
+   : theValue(value),
+     theUnitType(unitType),
+     theOrigin(origin)
+{
+}
+
+void ossimUnitConversionTool::setOrigin(const ossimGpt& gpt)
+{
+   theOrigin = gpt;
+}
+
+ossimGpt ossimUnitConversionTool::getOrigin()const
+{
+   return theOrigin;
+}
+
+void ossimUnitConversionTool::getOrigin(ossimGpt& result)const
+{
+   result = theOrigin;
+}
+
+void ossimUnitConversionTool::setValue(double value,
+                                       ossimUnitType unitType)
+{
+   theValue    = value;
+   theUnitType = unitType;
+}
+
+double ossimUnitConversionTool::getValue(ossimUnitType unitType) const
+{
+   switch(unitType)
+   {
+      case OSSIM_METERS:
+      {
+         return getMeters();
+      }
+      case OSSIM_RADIANS:
+      {
+         return getRadians();
+      }
+      case OSSIM_DEGREES:
+      {
+         return getDegrees();
+      }
+      case OSSIM_US_SURVEY_FEET:
+      {
+         return getUsSurveyFeet();
+      }
+      case OSSIM_FEET:
+      {
+         return getFeet();
+      }
+      case OSSIM_SECONDS:
+      {
+         return getSeconds();
+      }
+      case OSSIM_MINUTES:
+      {
+         return getMinutes();
+      }
+      case OSSIM_NAUTICAL_MILES:
+      {
+         return getNauticalMiles();
+      }
+      case OSSIM_MILES:
+      {
+         return getMiles();
+      }
+      case OSSIM_MICRONS:
+      {
+         return getMicrons();
+      }
+      case OSSIM_CENTIMETERS:
+      {
+         return getCentimeters();
+      }
+      case OSSIM_MILLIMETERS:
+      {
+         return getMillimeters();
+      }
+      case OSSIM_YARDS:
+      {
+         return getYards();
+      }
+      case OSSIM_INCHES:
+      {
+         return getInches();
+      }
+      case OSSIM_KILOMETERS:
+      {
+         return getKilometers();
+      }
+      default:
+         break;
+   }
+
+   return ossim::nan();
+}
+
+void ossimUnitConversionTool::setMeters(double value)
+{
+   setValue(value, OSSIM_METERS);
+}
+
+void ossimUnitConversionTool::setRadians(double value)
+{
+   setValue(value, OSSIM_RADIANS);
+}
+
+void ossimUnitConversionTool::setDegrees(double value)
+{
+   setValue(value, OSSIM_DEGREES);
+}
+
+void ossimUnitConversionTool::setMinutes(double value)
+{
+   setValue(value, OSSIM_MINUTES);
+}
+
+void ossimUnitConversionTool::setSeconds(double value)
+{
+   setValue(value, OSSIM_SECONDS);
+}
+
+void ossimUnitConversionTool::setUsSurveyFeet(double value)
+{
+   setValue(value, OSSIM_US_SURVEY_FEET);
+}
+
+void ossimUnitConversionTool::setFeet(double value)
+{
+   setValue(value, OSSIM_FEET);
+}
+
+void ossimUnitConversionTool::setNauticalMiles(double value)
+{
+   setValue(value, OSSIM_NAUTICAL_MILES);
+}
+
+void ossimUnitConversionTool::setMiles(double value)
+{
+   setValue(value, OSSIM_MILES);
+}
+
+void ossimUnitConversionTool::setMillimeters(double value)
+{
+   setValue(value, OSSIM_MILLIMETERS);
+}
+
+void ossimUnitConversionTool::setMicrons(double value)
+{
+   setValue(value, OSSIM_MICRONS);
+}
+
+void ossimUnitConversionTool::setCentimeters(double value)
+{
+   setValue(value, OSSIM_CENTIMETERS);
+}
+
+void ossimUnitConversionTool::setYards(double value)
+{
+   setValue(value, OSSIM_YARDS);
+}
+
+void ossimUnitConversionTool::setInches(double value)
+{
+   setValue(value, OSSIM_INCHES);
+}
+
+void ossimUnitConversionTool::setKilometers(double value)
+{
+   setValue(value, OSSIM_KILOMETERS);
+}
+
+double ossimUnitConversionTool::getMeters()const
+{
+   if(theUnitType == OSSIM_METERS)
+   {
+      return theValue;
+   }
+   
+   return computeMeters();
+}
+
+double ossimUnitConversionTool::getRadians()const
+{
+   if(theUnitType == OSSIM_RADIANS)
+   {
+      return theValue;
+   }
+   return getDegrees()*RAD_PER_DEG;
+}
+
+double ossimUnitConversionTool::getDegrees()const
+{
+   switch (theUnitType)
+   {
+      case OSSIM_DEGREES:
+      {
+         return theValue;
+      }
+      case OSSIM_MINUTES:
+      {
+         return (theValue / 60.0);
+      }
+      case OSSIM_SECONDS:
+      {
+         return (theValue / 3600.0);
+      }
+      case OSSIM_RADIANS:
+      {
+         return (theValue * DEG_PER_RAD);
+      }
+      default:
+         break;
+   }
+   
+   ossimDpt pt = theOrigin.metersPerDegree();
+   return (computeMeters() /((pt.x+pt.y)*.5));
+}
+
+double ossimUnitConversionTool::getMinutes()const
+{
+   if(theUnitType == OSSIM_MINUTES)
+   {
+      return theValue;
+   }
+   return (getDegrees()*60.0);
+}
+
+double ossimUnitConversionTool::getSeconds()const
+{
+   if(theUnitType == OSSIM_SECONDS)
+   {
+      return theValue;
+   }
+   return (getDegrees()*3600.0);
+}
+
+double ossimUnitConversionTool::getUsSurveyFeet()const
+{
+   if(theUnitType == OSSIM_US_SURVEY_FEET)
+   {
+      return theValue;
+   }
+   return (computeMeters()/US_METERS_PER_FT);
+}
+
+double ossimUnitConversionTool::getFeet()const
+{
+   if(theUnitType == OSSIM_FEET)
+   {
+      return theValue;
+   }
+   return (computeMeters()*FT_PER_MTRS);
+}
+
+double ossimUnitConversionTool::getNauticalMiles()const
+{
+   if(theUnitType == OSSIM_NAUTICAL_MILES)
+   {
+      return theValue;
+   }
+   
+   return (computeMeters()/(theOrigin.metersPerDegree().y/60.0));
+}
+
+double ossimUnitConversionTool::getMiles()const
+{
+   if(theUnitType == OSSIM_MILES)
+   {
+      return theValue;
+   }
+   return ((computeMeters()*FT_PER_MTRS)/FT_PER_MILE);
+}
+
+double ossimUnitConversionTool::getMillimeters()const
+{
+   if(theUnitType == OSSIM_MILLIMETERS)
+   {
+      return theValue;
+   }
+   return ((computeMeters()*1e3));
+}
+
+double ossimUnitConversionTool::getMicrons()const
+{
+   if(theUnitType == OSSIM_MICRONS)
+   {
+      return theValue;
+   }
+   return ((computeMeters()*1e6));
+}
+
+double ossimUnitConversionTool::getCentimeters()const
+{
+   if(theUnitType == OSSIM_KILOMETERS)
+   {
+      return theValue;
+   }
+
+   return ((computeMeters()*1e2));   
+}
+
+double ossimUnitConversionTool::getYards()const
+{
+   if(theUnitType == OSSIM_INCHES)
+   {
+      return theValue;
+   }
+
+   return ((computeMeters()/0.914));   
+}
+
+double ossimUnitConversionTool::getInches()const
+{
+   if(theUnitType == OSSIM_INCHES)
+   {
+      return theValue;
+   }
+
+   return ((getFeet()*12.0));   
+}
+
+double ossimUnitConversionTool::getKilometers()const
+{
+   if(theUnitType == OSSIM_KILOMETERS)
+   {
+      return theValue;
+   }
+   return ((computeMeters()*1e-3));
+}
+
+double ossimUnitConversionTool::computeMeters()const
+{
+   switch(theUnitType)
+   {
+      case OSSIM_METERS:
+      {
+         return theValue;
+         break;
+      }
+      case OSSIM_RADIANS:
+      {
+         ossimDpt pt = theOrigin.metersPerDegree();
+         return (theValue*DEG_PER_RAD)*((pt.x+pt.y)*.5);
+      }
+      case OSSIM_DEGREES:
+      {
+         ossimDpt pt = theOrigin.metersPerDegree();
+         return theValue*((pt.x+pt.y)*.5);
+      }
+      case OSSIM_US_SURVEY_FEET:
+      {
+         return  US_METERS_PER_FT*theValue;
+      }
+      case OSSIM_FEET:
+      {
+         return MTRS_PER_FT*theValue;
+      }
+      case OSSIM_SECONDS:
+      {
+         ossimDpt pt = theOrigin.metersPerDegree();
+         return (theValue/3600.0)*((pt.x+pt.y)*.5);
+      }
+      case OSSIM_MINUTES:
+      {
+         ossimDpt pt = theOrigin.metersPerDegree();
+         return (theValue/60.0)*((pt.x+pt.y)*.5);
+      }
+      case OSSIM_NAUTICAL_MILES:
+      {
+         return (theOrigin.metersPerDegree().y/60.0)*theValue;
+      }
+      case OSSIM_MILES:
+      {
+         return MTRS_PER_FT*FT_PER_MILE*theValue;
+      }
+      case OSSIM_MILLIMETERS:
+      {
+         return (theValue/(1e3));
+      }
+      case OSSIM_MICRONS:
+      {
+         return (theValue/(1e6));
+      }
+      default:
+         break;
+   }
+
+   return ossim::nan();
+}
diff --git a/ossim/src/ossim/base/ossimUnitTypeLut.cpp b/src/base/ossimUnitTypeLut.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimUnitTypeLut.cpp
rename to src/base/ossimUnitTypeLut.cpp
diff --git a/ossim/src/ossim/base/ossimUrl.cpp b/src/base/ossimUrl.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimUrl.cpp
rename to src/base/ossimUrl.cpp
diff --git a/ossim/src/ossim/base/ossimUsgsQuad.cpp b/src/base/ossimUsgsQuad.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimUsgsQuad.cpp
rename to src/base/ossimUsgsQuad.cpp
diff --git a/ossim/src/ossim/base/ossimViewController.cpp b/src/base/ossimViewController.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimViewController.cpp
rename to src/base/ossimViewController.cpp
diff --git a/ossim/src/ossim/base/ossimViewEvent.cpp b/src/base/ossimViewEvent.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimViewEvent.cpp
rename to src/base/ossimViewEvent.cpp
diff --git a/ossim/src/ossim/base/ossimViewInterface.cpp b/src/base/ossimViewInterface.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimViewInterface.cpp
rename to src/base/ossimViewInterface.cpp
diff --git a/src/base/ossimViewListener.cpp b/src/base/ossimViewListener.cpp
new file mode 100644
index 0000000..72b9cd8
--- /dev/null
+++ b/src/base/ossimViewListener.cpp
@@ -0,0 +1,45 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+// Description: A brief description of the contents of the file.
+//
+//
+//*************************************************************************
+// $Id: ossimViewListener.cpp 9963 2006-11-28 21:11:01Z gpotts $
+#include <ossim/base/ossimViewListener.h>
+
+RTTI_DEF1(ossimViewListener, "ossimViewListener", ossimListener);
+void ossimViewListener::processEvent(ossimEvent& event)
+{
+   ossimViewEvent* evt = dynamic_cast<ossimViewEvent*>(&event);
+
+   if(evt)
+   {
+      switch(evt->getViewEventType())
+      {
+      case  ossimViewEvent::OSSIM_VIEW_EVENT_SCALE_CHANGE:
+      {
+         viewScaleChangeEvent(*evt);
+         break;
+      }
+      case  ossimViewEvent::OSSIM_VIEW_EVENT_TYPE_GENERIC:
+      {
+         viewEvent(*evt);
+         break;
+      }
+      case ossimViewEvent::OSSIM_VIEW_EVENT_TRANSFORM_CHANGE:
+      {
+         viewTransformChangeEvent(*evt);
+         break;
+      }
+      case ossimViewEvent::OSSIM_VIEW_EVENT_VIEW_TYPE_CHANGE:
+      {
+         viewTypeChangeEvent(*evt);
+         break;
+      }
+      }
+      allViewEvents(*evt);
+   }
+}
diff --git a/ossim/src/ossim/base/ossimVisitor.cpp b/src/base/ossimVisitor.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimVisitor.cpp
rename to src/base/ossimVisitor.cpp
diff --git a/src/base/ossimVrect.cpp b/src/base/ossimVrect.cpp
new file mode 100644
index 0000000..4117123
--- /dev/null
+++ b/src/base/ossimVrect.cpp
@@ -0,0 +1,41 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Contains class declaration for vrect.
+// Container class for four double points representing a rectangle
+// where y is up
+// 
+//*******************************************************************
+//  $Id: ossimVrect.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/base/ossimVrect.h>
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+void ossimVrect::print(std::ostream& os) const
+{
+   os << theUlCorner << theLrCorner;
+}
+
+//*******************************************************************
+// friend function:
+//*******************************************************************
+std::ostream& operator<<(std::ostream& os, const ossimVrect& rect)
+{
+   rect.print(os);
+
+   return os;
+}
+
+ossimVrect::~ossimVrect()
+{
+}
diff --git a/ossim/src/ossim/base/ossimWLSBundleSolution.cpp b/src/base/ossimWLSBundleSolution.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWLSBundleSolution.cpp
rename to src/base/ossimWLSBundleSolution.cpp
diff --git a/ossim/src/ossim/base/ossimWebRequest.cpp b/src/base/ossimWebRequest.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWebRequest.cpp
rename to src/base/ossimWebRequest.cpp
diff --git a/ossim/src/ossim/base/ossimWebRequestFactoryBase.cpp b/src/base/ossimWebRequestFactoryBase.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWebRequestFactoryBase.cpp
rename to src/base/ossimWebRequestFactoryBase.cpp
diff --git a/ossim/src/ossim/base/ossimWebRequestFactoryRegistry.cpp b/src/base/ossimWebRequestFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWebRequestFactoryRegistry.cpp
rename to src/base/ossimWebRequestFactoryRegistry.cpp
diff --git a/ossim/src/ossim/base/ossimWebResponse.cpp b/src/base/ossimWebResponse.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWebResponse.cpp
rename to src/base/ossimWebResponse.cpp
diff --git a/ossim/src/ossim/base/ossimWgs72Datum.cpp b/src/base/ossimWgs72Datum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWgs72Datum.cpp
rename to src/base/ossimWgs72Datum.cpp
diff --git a/ossim/src/ossim/base/ossimWgs84Datum.cpp b/src/base/ossimWgs84Datum.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWgs84Datum.cpp
rename to src/base/ossimWgs84Datum.cpp
diff --git a/ossim/src/ossim/base/ossimWms.cpp b/src/base/ossimWms.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimWms.cpp
rename to src/base/ossimWms.cpp
diff --git a/src/base/ossimXmlAttribute.cpp b/src/base/ossimXmlAttribute.cpp
new file mode 100644
index 0000000..8e2220b
--- /dev/null
+++ b/src/base/ossimXmlAttribute.cpp
@@ -0,0 +1,247 @@
+//*******************************************************************
+// Copyright (C) 2001 ImageLinks Inc.  All rights reserved.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer (ossim port by D. Burken)
+//
+// Description:
+//
+// Contains definition of class ossimXmlAttribute.
+//
+//*****************************************************************************
+// $Id: ossimXmlAttribute.cpp 23503 2015-09-08 07:07:51Z rashadkm $
+
+#include <iostream>
+#include <sstream>
+
+#include <ossim/base/ossimXmlAttribute.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+RTTI_DEF2(ossimXmlAttribute, "ossimXmlAttribute", ossimObject, ossimErrorStatusInterface)
+
+static std::istream& xmlskipws(std::istream& in)
+{
+   int c = in.peek();
+   while((!in.fail())&&
+         ((c == ' ') ||
+          (c == '\t') ||
+          (c == '\n')||
+          (c == '\r')))
+   {
+      in.ignore(1);
+      c = in.peek();
+   }
+
+   return in;
+}
+
+ossimXmlAttribute::ossimXmlAttribute(ossimString& spec)
+{
+   std::stringstream in(spec);
+
+   read(in);
+}
+
+ossimXmlAttribute::ossimXmlAttribute(const ossimXmlAttribute& src)
+   :theName(src.theName),
+    theValue(src.theValue)
+{
+}
+
+bool ossimXmlAttribute::read(std::istream& in)
+{
+   xmlskipws(in);
+   if(in.fail()) return false;
+   if(readName(in))
+   {
+      xmlskipws(in);
+      if((in.peek() != '=')||
+         (in.fail()))
+      {
+         setErrorStatus();
+         return false;
+      }
+      in.ignore(1);
+      if(readValue(in))
+      {
+         return true;
+      }
+      else
+      {
+         setErrorStatus();
+         return false;
+      }
+   }
+   return false;
+
+#if 0
+   //
+   // Pull out name:
+   //
+   theName = spec.before('=');
+   theName = theName.trim();
+   if (theName.empty())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "ossimXmlAttribute::ossimXmlAttribute \n"
+                                           << "Bad attribute format encountered near:\n\""<< spec<<"\"\n"
+                                           << "Parsing aborted...\n";
+      setErrorStatus();
+
+      return;
+   }
+   spec = spec.after('=');
+
+   //***
+   // Read value:
+   //***
+   char quote_char = spec[0];
+   spec = spec.after(quote_char);  // after first quote
+   theValue = spec.before(quote_char); // before second quote
+
+   //
+   // Reposition attribute specification to the start of next attribute or end
+   // of tag:
+   //
+   spec = spec.after(quote_char);  // after second quote
+   ossimString next_entry ("-?[+0-9A-Za-z<>]+");
+   spec = spec.fromRegExp(next_entry.c_str());
+#endif
+}
+
+ossimXmlAttribute::~ossimXmlAttribute()
+{
+}
+
+ossimXmlAttribute::ossimXmlAttribute()
+{
+}
+
+ossimXmlAttribute::ossimXmlAttribute(const ossimString& name,
+                                     const ossimString& value)
+{
+   setNameValue(name, value);
+}
+
+const ossimString& ossimXmlAttribute::getName()  const
+{
+   return theName;
+}
+
+const ossimString& ossimXmlAttribute::getValue() const
+{
+   return theValue;
+}
+
+void ossimXmlAttribute::setNameValue(const ossimString& name,
+                                     const ossimString& value)
+{
+   theName  = name;
+   theValue = value;
+}
+
+void ossimXmlAttribute::setName(const ossimString& name)
+{
+   theName = name;
+}
+
+void ossimXmlAttribute::setValue(const ossimString& value)
+{
+   theValue = value;
+}
+
+std::ostream& operator << (std::ostream& os, const ossimXmlAttribute* xml_attr)
+{
+   os << " " << xml_attr->theName << "=\"" << xml_attr->theValue << "\"";
+
+   return os;
+}
+
+
+bool ossimXmlAttribute::readName(std::istream& in)
+{
+   xmlskipws(in);
+   theName = "";
+   char c = in.peek();
+   while((c != ' ')&&
+         (c != '\n')&&
+	 (c != '\r')&&
+         (c != '\t')&&
+         (c != '=')&&
+         (c != '<')&&
+         (c != '/')&&
+         (c != '>')&&
+         (!in.fail()))
+   {
+      theName += (char)in.get();
+      c = in.peek();
+   }
+
+   return ((!in.fail())&&
+           (theName != ""));
+}
+
+bool ossimXmlAttribute::readValue(std::istream& in)
+{
+   xmlskipws(in);
+   if(in.fail()) return false;
+   theValue = "";
+   char c = in.peek();
+   bool done = false;
+	char startQuote = '\0';
+   if((c == '\'')||
+      (c == '"'))
+   {
+      startQuote = c;
+      theValue += in.get();
+    while(!done&&!in.fail())
+      {
+         c = in.peek();
+         if(c==startQuote)
+         {
+            theValue += c;
+            done = true;
+            in.ignore(1);
+         }
+         else if(c == '\n')
+         {
+            done = true;
+         }
+         else
+         {
+            theValue += in.get();
+         }
+      }
+   }
+
+   bool is_empty = false;
+   std::string::size_type p = 0;
+   //then this could be empty with two qoutes
+    if(theValue.size() == 2 && theValue[p] == startQuote && theValue[p+1] == startQuote)
+    {
+       theValue = "";
+       is_empty = true;
+    }
+   if(theValue != "")
+   {
+      std::string::iterator startIter = theValue.begin();
+      std::string::iterator endIter   = theValue.end();
+      --endIter;
+      if(*startIter == startQuote)
+      {
+         ++startIter;
+      }
+      else
+      {
+         return false;
+         setErrorStatus();
+      }
+      if(*endIter != startQuote)
+      {
+         return false;
+         setErrorStatus();
+      }
+      theValue = ossimString(startIter, endIter);
+   }
+   return ((!in.bad())&& (is_empty || theValue !=""));
+}
diff --git a/src/base/ossimXmlDocument.cpp b/src/base/ossimXmlDocument.cpp
new file mode 100644
index 0000000..bf5c975
--- /dev/null
+++ b/src/base/ossimXmlDocument.cpp
@@ -0,0 +1,430 @@
+//*******************************************************************
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer (ossim port by D. Burken)
+//
+// Description:  
+//
+// Contains definition of class ossimXmlDocument. This class provides read-only
+// parsing and accessing of an XML document file.
+//*****************************************************************************
+// $Id: ossimXmlDocument.cpp 23258 2015-04-15 15:54:10Z dburken $
+
+
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/base/ossimXmlAttribute.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <stack>
+#include <iostream>
+#include <fstream>
+
+
+// Static trace for debugging
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceDebug("ossimXmlDocument:debug");
+
+static std::istream& xmlskipws(std::istream& in)
+{
+   int c = in.peek();
+   while((!in.fail())&&
+         (( (c == ' ') || (c == '\t') || (c == '\n')|| (c == '\r') || (c<0x20) || (c>=0x7f) )))//|| (c<0x20) || (c >=0x2f) )))
+   {
+      in.ignore(1);
+      c = in.peek();
+   }
+   
+   return in;
+}
+
+static const int BUFFER_MAX_LEN = 1000;
+static const ossimString XPATH_DELIM ("/");
+
+RTTI_DEF1(ossimXmlDocument, "ossimXmlDocument", ossimObject)
+ossimXmlDocument::ossimXmlDocument(const ossimFilename& xmlFileName)
+   :
+   theRootNode  (0),
+   theXmlHeader("<?xml version='1.0'?>"),
+   theStrictCheckFlag(false)
+{
+   if(xmlFileName != "")
+   {
+      openFile(xmlFileName);
+   }
+}
+
+ossimXmlDocument::ossimXmlDocument(const ossimXmlDocument& src)
+:ossimObject(src),
+theRootNode(src.theRootNode.valid()?(ossimXmlNode*)src.theRootNode->dup():(ossimXmlNode*)0),
+theXmlHeader(src.theXmlHeader),
+theFilename(src.theFilename),
+theStrictCheckFlag(src.theStrictCheckFlag)
+{
+   
+}
+
+ossimXmlDocument::~ossimXmlDocument()
+{
+}
+
+bool ossimXmlDocument::write(const ossimFilename& file)
+{
+   std::ofstream out(file.c_str());
+
+   if(out)
+   {
+      out << *this << std::endl;
+   }
+   else
+   {
+      return false;
+   }
+
+   return true;
+}
+
+bool ossimXmlDocument::openFile(const ossimFilename& filename)
+{
+   
+   theFilename = filename;
+
+   if(theFilename == "")
+   {
+      return false;
+   }
+
+   //
+   // Open XML File:
+   // Note: Opening text document binary to overcome an apparent windows bug.
+   //
+   ifstream xml_stream (filename.c_str(), ios::binary);
+   if (!xml_stream)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG: ossimXmlDocument::ossimXmlDocument\n"
+            << "encountered opening file <" << filename << "> for "
+            << "reading. Aborting..." << endl;
+      }
+      return false;
+   }
+
+   return read(xml_stream);
+}
+
+bool ossimXmlDocument::read(std::istream& in)
+{
+//   char buffer[BUFFER_MAX_LEN];
+//   streampos file_pos;
+//   bool readingHeader = true;
+   bool startTagCharacterFound = false;
+   char c = in.peek();
+
+   // Initially we will do our own skipping to make sure we ar not binary.
+   while(!in.bad() && (c != '<') && (c >= 0x20) && (c <= 0x7e))
+   {
+      in.ignore(1);
+      c = in.peek();
+   }
+
+   if (in.bad() || (c!='<'))
+   {
+      setErrorStatus();
+      return false;
+   }
+   startTagCharacterFound = true;
+
+   if(readHeader(in))
+   {
+      if(theXmlHeader=="")
+      {
+         if(startTagCharacterFound)
+         {
+            theXmlHeader = "<?xml version='1.0'?>";
+         }
+      }
+   }
+   if((!theXmlHeader.contains("xml version")) && theStrictCheckFlag)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "FATAL: ossimXmlDocument::ossimXmlDocument"
+            << "encountered parsing XML file <" << theFilename
+            << ">. The file does not appear to be XML v1.0. \n"
+            << "Header = \n" << theXmlHeader <<"\n"
+            << endl;
+      }
+      setErrorStatus();
+      return false;
+   }
+   theRootNode = new ossimXmlNode(in, 0);
+   setErrorStatus(theRootNode->getErrorStatus());
+   return (getErrorStatus()==ossimErrorCodes::OSSIM_OK);
+}
+
+void ossimXmlDocument::findNodes(const ossimString& arg_xpath,
+                            vector<ossimRefPtr<ossimXmlNode> >& result) const
+{
+   //
+   // First verify the root node exists:
+   //
+   if (!theRootNode.valid())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "WARNING: ossimXmlDocument::findNodes,\n"
+            << "No root node has been instantiated. Returning null "
+            << "node list..." << endl;
+      }
+      return;
+   }
+
+   //
+   // Make a copy to manipulate:
+   //
+   ossimString xpath (arg_xpath);
+   if (xpath.empty())
+      return;
+   
+   //
+   // Check if absolute path:
+   //
+   if (xpath[static_cast<std::string::size_type>(0)] !=
+       XPATH_DELIM[static_cast<std::string::size_type>(0)])
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "WARNING: ossimXmlDocument::findNodes\n"
+            << "Only absolute XPaths are supported. Returning null "
+            << "node list..." << endl;
+      }
+      return;
+   }
+
+   //
+   // Check that root tag matches path root:
+   //
+   ossimString rel_xpath (xpath.after(XPATH_DELIM));
+   ossimString root_tag (rel_xpath);
+   if (root_tag.contains(XPATH_DELIM))
+       root_tag = rel_xpath.before(XPATH_DELIM);
+   
+   if (root_tag != theRootNode->getTag())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "WARNING: ossimXmlDocument::findNodes\n"
+            << "XPath's root node <"<<root_tag<<"> does not match the "
+            << "stored root node's tag <" << theRootNode->getTag() << ">. "
+            << "Returning null node list..." << endl;
+      }
+      return;
+   }
+
+   //
+   // If the root node was the requested node, return it alone:
+   //
+   rel_xpath = rel_xpath.after(XPATH_DELIM);
+   if (rel_xpath.empty())
+   {
+      result.push_back(theRootNode);
+      return;
+   }
+   
+   //
+   // Pass the node request on to the root node with the relative path:
+   //
+   theRootNode->findChildNodes(rel_xpath, result);
+}
+
+ostream& operator << (ostream& os, const ossimXmlDocument& xml_doc) 
+{
+   os << xml_doc.theXmlHeader << endl;
+   if (xml_doc.theRootNode.valid())
+   {
+      os << (xml_doc.theRootNode.get()) << endl;
+   }
+//    else
+//       os << "-- no root node assigned -- " << endl;
+   
+   return os;
+}
+
+void ossimXmlDocument::initRoot(ossimRefPtr<ossimXmlNode> node)
+{
+   theRootNode = node;
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlDocument::getRoot()
+{
+   return theRootNode;
+}
+
+const ossimRefPtr<ossimXmlNode> ossimXmlDocument::getRoot()const
+{
+   return theRootNode;
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlDocument::removeRoot()
+{
+   ossimRefPtr<ossimXmlNode> root = theRootNode;
+
+   theRootNode = 0;
+
+   return root;
+}
+
+
+void ossimXmlDocument::fromKwl(const ossimKeywordlist& kwlToConvert)
+{
+
+   ossimKeywordlist kwl = kwlToConvert;
+   theRootNode = 0;
+   theRootNode = new ossimXmlNode;
+
+   
+   ossimString prefix = "";
+   ossimKeywordlist::KeywordMap& map              = kwl.getMap();
+   ossimKeywordlist::KeywordMap::iterator mapIter = map.begin();
+
+   while(mapIter != map.end())
+   {
+      ossimString key = mapIter->first;
+      key = key.substitute(".", "/", true);
+      theRootNode->addNode(key, mapIter->second);
+      ++mapIter;
+   }
+
+   // now collapse all keywordlist styles to the XML style
+   //
+   std::stack<ossimRefPtr<ossimXmlNode> > tempStack;
+   tempStack.push(theRootNode);
+   while(!tempStack.empty())
+   {
+      
+      ossimRefPtr<ossimXmlNode> node = tempStack.top();
+      tempStack.pop();
+      vector<ossimRefPtr<ossimXmlNode> >& childNodes = node->getChildNodes();
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < childNodes.size(); ++idx)
+      {
+         tempStack.push(childNodes[idx]);
+      }
+      if(node->getChildNodes().size() > 0)
+      {
+         if(node->getTag()!="")
+         {
+            node->addAttribute("name", node->getTag());
+         }
+         node->setTag("object");
+      }
+      
+      if(node->getTag() == "type")
+      {
+         if(node->getParentNode())
+         {
+            node->getParentNode()->removeChild("type");
+            node->getParentNode()->addAttribute("type", node->getText());
+         }
+      }
+      else if(node->getChildNodes().size() < 1)
+      {
+         if(node->getTag()!="")
+         {
+            node->addAttribute("name", node->getTag());
+         }
+         if(!node->getText().contains("\n"))
+         {
+            if(node->getText()!="")
+            {
+               node->addAttribute("value", node->getText());
+               node->setText("");
+            }
+         }
+         node->setTag("property");
+      }
+   }
+}
+
+void ossimXmlDocument::toKwl(ossimKeywordlist& kwl ,
+                             const ossimString& prefix)const
+{
+   if(theRootNode.valid())
+   {
+      theRootNode->toKwl(kwl, prefix);
+   }
+//    const std::vector<ossimRefPtr<ossimXmlNode> >& children = theRootNode->getChildNodes();
+   
+//    ossim_uint32 idx = 0;
+   
+//    for(idx = 0; idx < children.size(); ++idx)
+//    {
+//       children[idx]->toKwl(kwl, prefix);
+//    }
+}
+
+bool ossimXmlDocument::readHeader(std::istream& in)
+{
+   //---
+   // Clear the existing header so we don't get double:
+   // <?xml version='1.0'?><?xml version='1.0'?>
+   //---
+   theXmlHeader.clear();
+   
+   char c;
+   in>>xmlskipws;
+
+   while(in.peek() == '<')
+   {
+      std::stack<char> theLessThanStack;
+      theLessThanStack.push('<');
+      in.ignore(1);
+      c = in.peek();
+      // we will for now skip things like !DOCTYPE and any other things in the header of the document that start with <? or <!
+      if((c == '?')||
+         (c == '!'))
+      {
+         theXmlHeader += "<";
+         theXmlHeader += (char)in.get();
+         
+         while(!theLessThanStack.empty()&&
+               (!in.bad()))
+         {
+            if(in.peek() == '<')
+            {
+               theLessThanStack.push('<');
+            }
+            else if(in.peek() == '>')
+            {
+               theLessThanStack.pop();
+            }
+            theXmlHeader += (char)in.get();
+         }
+         if(!in.bad())
+         {
+            if(in.peek()=='\n'||
+               in.peek()=='\r')
+            {
+               theXmlHeader += (char)in.get();
+            }
+         }
+//          if(!in.bad())
+//          {
+//             theXmlHeader += (char)in.get();
+//          }
+         in>>xmlskipws;
+      }
+   }
+
+   return (!in.bad());
+}
diff --git a/src/base/ossimXmlNode.cpp b/src/base/ossimXmlNode.cpp
new file mode 100644
index 0000000..2c6cbde
--- /dev/null
+++ b/src/base/ossimXmlNode.cpp
@@ -0,0 +1,1402 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  Oscar Kramer <okramer at imagelinks.com> (ossim port by D. Burken)
+//
+// Description:  
+//
+// Contains definition of class ossimXmlNode.
+// 
+//*****************************************************************************
+// $Id: ossimXmlNode.cpp 20747 2012-04-18 15:24:12Z gpotts $
+
+#include <iostream>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/base/ossimXmlAttribute.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTrace.h>
+
+namespace {// Anonymous namespace
+   // Constants
+   const char XPATH_DELIM ('/');
+   ossimRefPtr<ossimXmlNode> const nullNode(0);
+
+   // Globals
+   ossimTrace traceDebug("ossimXmlNode:debug");
+}// Anonymous namespace
+
+RTTI_DEF2(ossimXmlNode, "ossimXmlNode", ossimObject, ossimErrorStatusInterface);
+
+static std::istream& xmlskipws(std::istream& in)
+{
+   int c = in.peek();
+   while( !in.fail() &&
+         (( (c== ' ') || (c == '\t') || (c == '\n')|| (c == '\r') || (c<0x20) || (c>=0x7f) ))
+         )
+   {
+      in.ignore(1);
+      c = in.peek();
+   }
+   
+   return in;
+}
+
+ossimXmlNode::ossimXmlNode(istream& xml_stream, ossimXmlNode* parent)
+:
+theParentNode (parent),
+theCDataFlag(false)
+{
+   read(xml_stream);
+}
+
+ossimXmlNode::ossimXmlNode()
+:theParentNode(0),
+theCDataFlag(false)
+{
+}
+
+ossimXmlNode::ossimXmlNode(const ossimXmlNode& src)
+:theTag(src.theTag),
+theParentNode(0),
+theText(src.theText),
+theCDataFlag(src.theCDataFlag)
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < src.theChildNodes.size();++idx)
+   {
+      theChildNodes.push_back((ossimXmlNode*)(src.theChildNodes[idx]->dup()));
+   }
+   for(idx = 0; idx < src.theAttributes.size();++idx)
+   {
+      theAttributes.push_back((ossimXmlAttribute*)(src.theAttributes[idx]->dup()));
+   }
+}
+
+ossimXmlNode::~ossimXmlNode()
+{
+}
+
+void ossimXmlNode::duplicateAttributes(ossimXmlNode::AttributeListType result)const
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx<theAttributes.size();++idx)
+   {
+      result.push_back((ossimXmlAttribute*)theAttributes[idx]->dup());
+   }
+	
+}
+
+void ossimXmlNode::duplicateChildren(ossimXmlNode::ChildListType& result)const
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx<theChildNodes.size();++idx)
+   {
+      result.push_back((ossimXmlNode*)theChildNodes[idx]->dup());
+   }
+}
+
+void ossimXmlNode::setParent(ossimXmlNode* parent)
+{
+   theParentNode = parent;
+}
+
+void ossimXmlNode::skipCommentTag(std::istream& in)
+{
+   char c;
+   while(!in.fail())
+   {
+      c = in.get();
+      if(c == '-')
+      {
+         if(in.peek() == '-')
+         {
+            in.ignore();
+            if(in.peek() == '>')
+            {
+               in.ignore();
+               return;
+            }
+         }
+      }
+   }
+}
+
+bool ossimXmlNode::read(std::istream& in)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimXmlNode::read: entered ......\n";
+   }
+   char c;
+   xmlskipws(in);
+   if(in.fail())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+      }
+      return false;
+   }
+   if(in.peek() == '<')
+   {
+      in.ignore(1);
+   }
+   if(in.fail())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+      }
+      return false;
+   }
+
+   ossimString endTag;
+   
+   if(!readTag(in, theTag))
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+      }
+      return false;
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theTag = " << theTag << "\n";
+   }
+   
+   if((!in.fail())&&readEndTag(in, endTag))
+   {
+      if((endTag == "")||
+         (endTag == theTag))
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return true;
+      }
+      else
+      {
+         setErrorStatus();
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return false;
+      }
+   }
+   // now parse attributes
+   ossimRefPtr<ossimXmlAttribute> attribute = new ossimXmlAttribute;
+   while(attribute->read(in))
+   {
+      theAttributes.push_back(new ossimXmlAttribute(*attribute));
+   }
+   // skip white space characters
+   //
+   xmlskipws(in);
+   
+   if(!in.fail()&&readEndTag(in, endTag))
+   {
+      if((endTag == "")||
+         (endTag == theTag))
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return true;
+      }
+      else
+      {
+         setErrorStatus();
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return false;
+      }
+   }
+   c = in.peek();
+   // make sure the attribute is closed
+   //
+   if(c != '>')
+   {
+      setErrorStatus();
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+      }
+      return false;
+   }
+   
+   in.ignore(1);
+   c = in.peek();
+   
+   // now do the text portion
+   if(!readTextContent(in))
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+      }
+      return false;
+   }
+   xmlskipws(in);
+   c = in.peek();
+   
+   if(c != '<')
+   {
+      setErrorStatus();
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+      }
+      return false;
+   }
+   in.ignore(1);
+   if(readEndTag(in, endTag))
+   {
+      if((endTag == "")||
+         (endTag == theTag))
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return true;
+      }
+      else
+      {
+         setErrorStatus();
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return false;
+      }
+   }
+   c = in.peek();
+
+   //---
+   // now if it's not an endtag then it must be a tag starting the new child
+   // node
+   //---
+   ossimRefPtr<ossimXmlNode> childNode;
+   do
+   {
+      childNode = new ossimXmlNode;
+      childNode->setParent(this);
+      if(childNode->read(in))
+      {
+         theChildNodes.push_back(childNode);
+      }
+      else
+      {
+         setErrorStatus();
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return false;
+      }
+      xmlskipws(in);
+      
+      c = in.peek();
+      if(c != '<')
+      {
+         setErrorStatus();
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+         }
+         return false;
+      }
+      in.ignore(1);
+      if(readEndTag(in, endTag))
+      {
+         if((endTag == "")||
+            (endTag == theTag))
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+            }
+            return true;
+         }
+         else
+         {
+            setErrorStatus();
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimXmlNode::read: leaving ......\n"<<__LINE__ << "\n";
+            }
+            return false;
+         }
+      }
+   }while( !in.fail() );
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimXmlNode::read: leaving ......\n";
+   }
+   return true;
+}
+
+
+void ossimXmlNode::findChildNodes(const ossimString& xpath,
+                                  ossimXmlNode::ChildListType& result)const
+{
+   //***
+   // Scan for trivial result (no children owned):
+   //***
+   if (theChildNodes.empty())
+      return;
+   
+   if (xpath.empty())
+      return;
+   
+   //---
+   // First verify that this is not an absolute path:
+   //---
+   if (xpath[static_cast<std::string::size_type>(0)] == XPATH_DELIM)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING: ossimXmlNode::findChildNodes\n"
+            << "Only relative XPaths can be searched from a node. "
+            << "Returning null list...\n";
+         }
+      return;
+   }
+   
+   //***
+   // Read the desired tag from the relative xpath
+   //***
+   const std::string::size_type delim_pos = xpath.find(XPATH_DELIM);
+   // TODO: need string_view
+   const ossimString desired_tag = xpath.substr(0,delim_pos);
+   
+   //***
+   // Loop over all child nodes for match:
+   //***
+   ossimXmlNode::ChildListType::const_iterator child_iter = theChildNodes.begin();
+   ossimXmlNode::ChildListType::const_iterator child_end  = theChildNodes.end();
+
+
+   // No XPATH_DELIM character found, or XPATH_DELIM at the end of xpath
+   if (delim_pos==std::string::npos || delim_pos == xpath.size()-1) 
+   {
+      for ( ; child_iter != child_end ; ++ child_iter)
+      {
+         if ((*child_iter)->getTag() == desired_tag)
+            //***
+            // This was the final target node, simply append to the result:
+            //***
+            result.push_back(*child_iter);
+      }
+   }
+   else
+   {
+      const ossimString sub_xpath   = xpath.substr(delim_pos+1, std::string::npos);
+      for ( ; child_iter != child_end ; ++ child_iter)
+      {
+         if ((*child_iter)->getTag() == desired_tag)
+            //***
+            // This match identifies a possible tree to search given the
+            // remaining xpath (sub_xpath). Query this child node to search
+            // its tree for the remaining xpath:
+            //***
+            (*child_iter)->findChildNodes(sub_xpath, result);
+      }
+   }
+}
+
+const ossimRefPtr<ossimXmlNode>& ossimXmlNode::findFirstNode(const ossimString& xpath)const
+{
+   if(theChildNodes.size() < 1) return nullNode;
+   if (xpath.empty())
+      return nullNode;
+
+   //
+   // First verify that this is not an absolute path:
+   //
+   if (xpath[static_cast<std::string::size_type>(0)] == XPATH_DELIM)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING: ossimXmlNode::findFirstNode\n"
+            << "Only relative XPaths can be searched from a node. "
+            << "Returning null list...\n";
+      }
+      return nullNode;
+   }
+
+   //
+   // Read the desired tag from the relative xpath
+   //
+   const std::string::size_type delim_pos = xpath.find(XPATH_DELIM);
+   // TODO: need string_view
+   const ossimString desired_tag = xpath.substr(0,delim_pos);
+
+   //
+   // Loop over all child nodes for match:
+   //
+   ossimXmlNode::ChildListType::const_iterator child_iter = theChildNodes.begin();
+   ossimXmlNode::ChildListType::const_iterator child_end  = theChildNodes.end();
+
+   // No XPATH_DELIM character found, or XPATH_DELIM at the end of xpath
+   if (delim_pos==std::string::npos || delim_pos == xpath.size()-1) 
+   {
+      for ( ; child_iter != child_end ; ++ child_iter)
+      {
+         if ((*child_iter)->getTag() == desired_tag)
+            return *child_iter;
+      }
+   }
+   else
+   {
+      const ossimString sub_xpath   = xpath.substr(delim_pos+1, std::string::npos);
+      for ( ; child_iter != child_end ; ++ child_iter)
+      {
+         if ((*child_iter)->getTag() == desired_tag)
+         {
+            //
+            // This match identifies a possible tree to search given the
+            // remaining xpath (sub_xpath). Query this child node to search
+            // its tree for the remaining xpath:
+            //
+            const ossimRefPtr<ossimXmlNode>& result = (*child_iter)->findFirstNode(sub_xpath);
+            if (result.get())
+            {
+               return result;
+            }
+         }
+      }
+   }
+
+   return nullNode;
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlNode::findFirstNode(const ossimString& xpath)
+{
+   if(theChildNodes.size() < 1) return 0;
+   if (xpath.empty())
+      return 0;
+
+   //
+   // First verify that this is not an absolute path:
+   //
+   if (xpath[static_cast<std::string::size_type>(0)] == XPATH_DELIM)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING: ossimXmlNode::findFirstNode\n"
+            << "Only relative XPaths can be searched from a node. "
+            << "Returning null list...\n";
+      }
+      return 0;
+   }
+
+   //
+   // Read the desired tag from the relative xpath
+   //
+   const std::string::size_type delim_pos = xpath.find(XPATH_DELIM);
+   // TODO: need string_view
+   const ossimString desired_tag = xpath.substr(0,delim_pos);
+
+   ossimRefPtr<ossimXmlNode> result = 0;
+
+   //
+   // Loop over all child nodes for match:
+   //
+   ossimXmlNode::ChildListType::iterator child_iter = theChildNodes.begin();
+   ossimXmlNode::ChildListType::iterator child_end  = theChildNodes.end();
+
+   // No XPATH_DELIM character found, or XPATH_DELIM at the end of xpath
+   if (delim_pos==std::string::npos || delim_pos == xpath.size()-1) 
+   {
+      for ( ; child_iter != child_end ; ++ child_iter)
+      {
+         if ((*child_iter)->getTag() == desired_tag)
+            return *child_iter;
+      }
+   }
+   else
+   {
+      const ossimString sub_xpath   = xpath.substr(delim_pos+1, std::string::npos);
+      for ( ; child_iter != child_end ; ++ child_iter)
+      {
+         if ((*child_iter)->getTag() == desired_tag)
+         {
+            //
+            // This match identifies a possible tree to search given the
+            // remaining xpath (sub_xpath). Query this child node to search
+            // its tree for the remaining xpath:
+            //
+            ossimRefPtr<ossimXmlNode> result = (*child_iter)->findFirstNode(sub_xpath);
+            if (result.get())
+            {
+               return result;
+            }
+         }
+      }
+   }
+
+   return 0;
+}
+
+ossimRefPtr<ossimXmlAttribute> ossimXmlNode::findAttribute(const ossimString& name)
+{
+   ossim_uint32 idx = 0;
+   
+   for(idx = 0; idx < theAttributes.size();++idx)
+   {
+      if(theAttributes[idx]->getName() == name)
+      {
+         return theAttributes[idx];
+      }
+   }
+   
+   return 0;
+}
+
+const ossimRefPtr<ossimXmlAttribute> ossimXmlNode::findAttribute(const ossimString& name)const
+{
+   ossim_uint32 idx = 0;
+   
+   for(idx = 0; idx < theAttributes.size();++idx)
+   {
+      if(theAttributes[idx]->getName() == name)
+      {
+         return theAttributes[idx];
+      }
+   }
+   
+   return 0;
+}
+
+void ossimXmlNode::setTag(const ossimString& tag)
+{
+   theTag = tag;
+}
+
+const ossimXmlNode* ossimXmlNode::getParentNode() const
+{
+   return theParentNode;
+}
+
+ossimXmlNode* ossimXmlNode::getParentNode()
+{
+   return theParentNode;
+}
+
+const ossimXmlNode::ChildListType& ossimXmlNode::getChildNodes() const
+{
+   return theChildNodes;
+}
+
+ossimXmlNode::ChildListType& ossimXmlNode::getChildNodes()
+{
+   return theChildNodes;
+}
+
+const ossimXmlNode::AttributeListType& ossimXmlNode::getAttributes() const
+{
+   return theAttributes;
+}
+
+bool ossimXmlNode::getAttributeValue(ossimString& value, const ossimString& name)const
+{
+   ossimRefPtr<ossimXmlAttribute> attribute = findAttribute(name);
+   
+   if(attribute.valid())
+   {
+      value = attribute->getValue();
+   }
+   
+   return attribute.valid();
+}
+
+bool ossimXmlNode::getChildTextValue(ossimString& value,
+                                     const ossimString& relPath)const
+{
+   ossimRefPtr<ossimXmlNode> node = findFirstNode(relPath);
+   if(node.valid())
+   {
+      value = node->getText();
+   }
+   
+   return node.valid();
+}
+
+
+void ossimXmlNode::setText(const ossimString& text)
+{
+   theText = text;
+}
+
+bool ossimXmlNode::cdataFlag()const
+{
+   return theCDataFlag;
+}
+
+void ossimXmlNode::setCDataFlag(bool value)
+{
+   theCDataFlag = value;
+}
+
+ostream& operator << (ostream& os, const ossimXmlNode& xml_node)
+{
+   return operator <<(os, &xml_node);
+}
+
+//**************************************************************************
+//  FRIEND OPERATOR
+//**************************************************************************
+ostream& operator << (ostream& os, const ossimXmlNode* xml_node) 
+{
+   //
+   // Determine the indentation level:
+   //
+   ossimString indent ("");
+   const ossimXmlNode* parent = xml_node->theParentNode;
+   while (parent)
+   {
+      indent += "   ";
+      parent = parent->theParentNode;
+   }
+   
+   //
+   // Dump the tag opening:
+   //
+   os << "\n" << indent << "<" << xml_node->theTag;
+   
+   //
+   // Dump any attributes:
+   //
+   if (xml_node->theAttributes.size())
+   {
+      ossimXmlNode::AttributeListType::const_iterator attr =
+      xml_node->theAttributes.begin();
+      while (attr != xml_node->theAttributes.end())
+      {
+         os << attr->get();
+         attr++;
+      }
+   }
+   
+   if((xml_node->theChildNodes.size() == 0)&&
+      (xml_node->theText == ""))
+   {
+      os << "/>";
+   }
+   else
+   {
+      os << ">";
+      
+      if(xml_node->cdataFlag())
+      {
+         os << "<![CDATA[" <<xml_node->theText <<  "]]>";
+      }
+      else
+      {
+         //
+         // Dump any text:
+         //
+         os << xml_node->theText;
+      }
+      //
+      // Dump any child nodes:
+      //
+      if (xml_node->theChildNodes.size())
+      {
+         ossimXmlNode::ChildListType::const_iterator nodes = xml_node->theChildNodes.begin();
+         while (nodes != xml_node->theChildNodes.end())
+         {
+            os << (*nodes).get();
+            nodes++;
+         }
+         os << "\n" << indent;
+      }
+      
+      //
+      // Dump the tag closing:
+      // 
+      os << "</" << xml_node->theTag << ">";
+   }
+   
+   return os;
+}
+
+void ossimXmlNode::addAttribute(ossimRefPtr<ossimXmlAttribute> attribute)
+{
+   theAttributes.push_back(attribute.get());
+}
+
+void ossimXmlNode::addAttribute(const ossimString& name,
+                                const ossimString& value)
+{
+   theAttributes.push_back(new ossimXmlAttribute(name, value));
+}
+
+bool  ossimXmlNode::setAttribute(const ossimString& name,
+                                 const ossimString& value,
+                                 bool addIfNotPresentFlag)
+{
+   bool result = false;
+   ossimRefPtr<ossimXmlAttribute> attribute = findAttribute(name);
+   if(attribute.valid())
+   {
+      attribute->setValue(value);
+      result = true;
+   }
+   else
+   {
+      if(addIfNotPresentFlag)
+      {
+         addAttribute(name, value);
+         result = true;
+      }
+   }
+   
+   return result;
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlNode::addNode(const ossimString& relPath,
+                                                const ossimString& text)
+{
+   if (relPath.empty())
+      return 0;
+   
+   //
+   // First verify that this is not an absolute path:
+   //
+   if (relPath[static_cast<std::string::size_type>(0)] == XPATH_DELIM)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimXmlNode::addNode\n"
+         << "Only relative XPaths can be searched from a node. "
+         << "Returning null list...\n";
+      }
+      return 0;
+   }
+   
+   //
+   // Read the desired tag from the relative xpath
+   //
+   const std::string::size_type delim_pos = relPath.find(XPATH_DELIM);
+   const ossimString desiredTag = relPath.substr(0,delim_pos);
+   
+   ossimRefPtr<ossimXmlNode> node = findFirstNode(desiredTag);
+   
+   if(!node.valid())
+   {
+      // No XPATH_DELIM character found, or XPATH_DELIM at the end of xpath
+      if (delim_pos==std::string::npos || delim_pos == relPath.size()-1) 
+      {
+         node = addChildNode(desiredTag, text);
+      }
+      else
+      {
+         node = addChildNode(desiredTag, "");
+      }
+   }
+   if (delim_pos != std::string::npos && delim_pos != relPath.size()-1) // XPATH_DELIM character found!
+   {
+      const ossimString subPath   = relPath.substr(delim_pos+1, std::string::npos);
+      return node->addNode(subPath, text);
+   }
+   
+   return node;
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlNode::addOrSetNode(const ossimString& relPath,
+                                                     const ossimString& text)
+{
+   ossimRefPtr<ossimXmlNode> result = addNode(relPath, text);
+   
+   result->setText(text);
+   
+   return result;
+}
+
+void ossimXmlNode::addChildNode(ossimRefPtr<ossimXmlNode> node)
+{
+   if(node->theParentNode)
+   {
+      node->theParentNode->removeChild(node);
+   }
+   node->theParentNode = this;
+   theChildNodes.push_back(node.get());
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlNode::addChildNode(const ossimString& tagName,
+                                                     const ossimString& text)
+{
+   ossimRefPtr<ossimXmlNode> node = new ossimXmlNode();
+   node->setParent(this);
+   node->theTag = tagName;
+   node->theText = text;
+   theChildNodes.push_back(node);
+   
+   return node;
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlNode::removeChild(ossimRefPtr<ossimXmlNode> node)
+{
+   ossimXmlNode::ChildListType::iterator iter = theChildNodes.begin();
+   while(iter != theChildNodes.end())
+   {
+      
+      if(node == iter->get())
+      {
+         ossimRefPtr<ossimXmlNode> temp = *iter;
+         
+         theChildNodes.erase(iter);
+         
+         return temp;
+      }
+      ++iter;
+   }
+   
+   return 0;
+}
+
+ossimRefPtr<ossimXmlNode> ossimXmlNode::removeChild(const ossimString& tag)
+{
+   ossimXmlNode::ChildListType::iterator iter = theChildNodes.begin();
+   while(iter != theChildNodes.end())
+   {
+      if(tag == iter->get()->theTag)
+      {
+         ossimRefPtr<ossimXmlNode> temp = *iter;
+         
+         theChildNodes.erase(iter);
+         
+         return temp;
+      }
+      ++iter;
+   }
+   
+   return 0;
+}
+void ossimXmlNode::addChildren(ossimXmlNode::ChildListType& children)
+{
+   ossim_uint32 idx;
+   for(idx = 0; idx < children.size(); ++idx)
+   {
+      addChildNode(children[idx].get());
+   }
+}
+
+void ossimXmlNode::setChildren(ossimXmlNode::ChildListType& children)
+{
+   clearChildren();
+   addChildren(children);
+}
+
+void ossimXmlNode::addAttributes(ossimXmlNode::AttributeListType& children)
+{
+   ossim_uint32 idx;
+   
+   for(idx = 0; idx < children.size(); ++idx)
+   {
+      addAttribute(children[idx].get());
+   }
+}
+
+void ossimXmlNode::setAttributes(ossimXmlNode::AttributeListType& children)
+{
+   clearAttributes();
+   addAttributes(children);
+}
+
+void ossimXmlNode::clear()
+{
+   theChildNodes.clear();
+   theAttributes.clear();
+   theTag="";
+   theText="";
+   theCDataFlag=false;
+}
+
+void ossimXmlNode::clearChildren()
+{
+   theChildNodes.clear();
+}
+
+void ossimXmlNode::clearAttributes()
+{
+   theAttributes.clear();
+}
+
+void ossimXmlNode::toKwl(ossimKeywordlist& kwl,
+                         const ossimString& prefix)const
+{
+   ossimString name = getTag();
+   ossimString value = getText();
+   
+   ossimString copyPrefix = prefix;
+   
+   if(name != "")
+   {
+      copyPrefix += (name+".");
+   }
+   if(theChildNodes.size() < 1)
+   {
+      kwl.add(prefix+name,
+              value,
+              true);
+   }
+
+   ossimString attributePrefix = copyPrefix + "@";
+   ossim_uint32 attributeIdx = 0;
+   for(attributeIdx = 0; attributeIdx < theAttributes.size(); ++attributeIdx)
+   {
+      kwl.add(attributePrefix+theAttributes[attributeIdx]->getName(),
+              theAttributes[attributeIdx]->getValue(), 
+              true);
+   }
+
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theChildNodes.size();++idx)
+   {
+      theChildNodes[idx]->toKwl(kwl,
+                                copyPrefix);
+   }
+}
+
+bool ossimXmlNode::readTag(std::istream& in,
+                           ossimString& tag)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimXmlNode::readTag: entered ......\n";
+   }
+   xmlskipws(in);
+   
+   tag.clear();
+   int c = in.peek();
+   
+   // bool validTag = false;
+   //    while(!validTag)
+   {
+      while( (c != ' ')&&
+            (c != '\n')&&
+            (c != '\t')&&
+            (c != '\r')&&
+            (c != '<')&&
+            (c != '>')&&
+            (c != '/')&&
+            (!in.fail()))
+      {
+         tag += (char)c;
+         in.ignore(1);
+         c = in.peek();
+         if(tag == "!--") // ignore comment tags
+         {
+            tag = "--";
+            break;
+         }
+      }
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimXmlNode::readTag: leaving ......\n";
+   }
+  
+   return (!tag.empty())&&(!in.fail());
+}
+
+bool ossimXmlNode::readCDataContent(std::istream& in)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimXmlNode::readCDataContent: entered ...\n";
+   }   
+   
+   // Ignore up to "]]>"
+   
+   bool result = false;
+
+   char c;
+
+   while(!in.fail())
+   {
+      c = in.get();
+      if ( c != ']' )
+      {
+         theText += c;
+      }
+      else // at "]"
+      {
+         c = in.get();
+         if( c == ']' ) // at "]]"
+         {
+            c = in.get();
+            if( c == '>' )
+            {
+               //in >> xmlskipws;
+               result = true;
+               break;
+            }
+         }
+      }
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "theText: " << theText
+         << "\nexit status: " << (result?"true":"false")
+         << "\nossimXmlNode::readCDataContent: leaving ...\n";
+   }
+   
+   return result;
+}
+
+#if 0
+bool ossimXmlNode::readTextContent(std::istream& in)
+{
+   xmlskipws(in);
+   
+   theText = "";
+   theCDataFlag = false;
+   
+   char buf[9];
+   buf[8]='\0';
+   
+   std::streampos initialPos = in.tellg();
+   
+   in.read(buf,9);
+   ossimString ostrBuf(buf);
+   
+   if(ostrBuf == "<![CDATA[")
+   {
+	   if(readCDataContent(in))
+      {
+         theCDataFlag = true;
+         return true;
+      }
+	   else
+	   {
+         return false;
+	   }
+   }
+   else if(ostrBuf.substr(0,4) == "<!--")
+   {
+	   in.seekg(initialPos);
+	   char c = in.get();
+	   // Strip comment
+	   while(!in.fail()) // continue until we see a --> pattern
+	   {
+         c = in.get();
+         if(c == '-')
+         {
+            c = in.get();
+            if(c == '-')
+            {
+               c = in.get();
+               if(c == '>')
+               {
+                  break;
+               }
+            }
+         }
+	   }
+   }
+   else if(ostrBuf.substr(0,1) ==  "<")
+   {
+	   in.seekg(initialPos);
+   }
+   else
+   {
+      in.seekg(initialPos);
+	   char c = in.peek();
+	   while(!in.fail() && c != '<')
+	   {
+         theText += (char)in.get();
+         c = in.peek();
+	   }
+   }
+   return !in.fail();
+}
+#endif
+#if 0
+bool ossimXmlNode::readTextContent(std::istream& in)
+{
+   xmlskipws(in);
+   
+   theText = "";
+   theCDataFlag = false;
+   char c = in.peek();
+   
+   do
+   {
+      if(c == '<')
+      {
+         in.ignore();
+         
+         // we will check for comments or CDATA
+         if(in.peek()=='!')
+         {
+            char buf1[4];
+            buf1[3] = '\0';
+            in.read(buf1, 3);
+            if(ossimString(buf1) == "!--")
+            {
+               // special text read
+               theText += buf1;
+               bool done = false;
+               do
+               {
+                  if(in.peek() != '-')
+                  {
+                     in.ignore();
+                  }
+                  else
+                  {
+                     in.ignore();
+                     if(in.peek() == '-')
+                     {
+                        in.ignore();
+                        if(in.peek() == '>')
+                        {
+                           in.ignore();
+                           done = true;
+                           c = in.peek();
+                        }
+                     }
+                  }
+               }while(!done&&!in.fail());
+            }
+            else
+            {
+               
+               char buf2[6];
+               buf2[5] = '\0';
+               in.read(buf2, 5);
+               if(in.fail())
+               {
+                  return false;
+               }
+               if(ossimString(buf1)+ossimString(buf2) == "![CDATA[")
+               {
+                  if(readCDataContent(in))
+                  {
+                     theCDataFlag = true;
+                     return true;
+                  }
+               }
+            }
+         }
+         else
+         {
+            in.putback(c);
+            return true;
+         }
+      }
+      else
+      {
+         theText += (char)in.get();
+         c = in.peek();
+      }
+   }while(!in.fail());
+   
+   return !in.fail();
+}
+#endif
+
+bool ossimXmlNode::readTextContent(std::istream& in)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimXmlNode::readTextContent: entered ...\n";
+   }
+   
+   //---
+   // Parse the text string.  Do it with no peeks, ignores, or putbacks as
+   // those seem to have issues on Windows (vs9).
+   //---
+   bool result = false;
+
+   theText = "";
+   theCDataFlag = false;
+   
+   xmlskipws(in);
+
+   if ( !in.fail() )
+   {
+      std::streampos initialPos = in.tellg();
+
+      char c = in.get();
+      
+      if ( c != '<' )
+      {
+         do // Get the text up to the next '<'.
+         {
+            theText += c;
+            c = in.get();
+         } while ( (c != '<') && !in.fail() );
+         
+         in.unget(); // Put '<' back.
+         result = !in.fail();
+      }
+      else // At "<" see if comment
+      {
+         c = in.get();
+
+         if ( c != '!' )
+         {
+            in.seekg(initialPos);
+            result = !in.fail();
+         }
+         else // at "<!"
+         {
+            c = in.get();
+            if ( c == '-' )
+            {
+               // Comment section: <!-- some comment -->
+               c = in.get();
+               if ( c == '-' ) // at "<!--"
+               {
+                  // Strip comment
+                  while( !in.fail() ) // continue until we see a --> pattern
+                  {
+                     c = in.get();
+                     if(c == '-')
+                     {
+                        c = in.get();
+                        if(c == '-')
+                        {
+                           c = in.get();
+                           if(c == '>')
+                           {
+                              result = !in.fail();
+                              break;
+                           }
+                        }
+                     }
+                  }
+               }
+            }
+            else if ( c == '[' ) // at "<!["
+            {
+               // CDATA section: <![CDATA[something-here]]>
+               c = in.get();
+               if ( c == 'C') // at "<![C:"
+               {
+                  c = in.get();
+                  if ( c == 'D' )// at "<![CD"
+                  {
+                     c = in.get();
+                     if ( c == 'A' ) // at "<![CDA"
+                     {
+                        c = in.get();
+                        if ( c == 'T' ) // at "<![CDAT"
+                        {
+                           c = in.get();
+                           if ( c == 'A' ) // at "<![CDATA"
+                           {
+                              c = in.get();
+                              if ( c == '[' ) // at "<!CDATA["
+                              {
+                                 if (readCDataContent(in))
+                                 {
+                                    theCDataFlag = true;
+                                    result = true;
+                                 }
+                              }
+                           }
+                        }
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "theText: " << theText
+         << "\ntheCDataFlag: " << (theCDataFlag?"true":"false")
+         << "\nexit status: " << (result?"true":"false")
+         << "\nossimXmlNode::readTextContent: leaving ...\n";
+   }
+   
+   return result;
+}
+
+bool ossimXmlNode::readEndTag(std::istream& in,
+                              ossimString& endTag)
+{
+   bool result = false;
+   char c = in.peek();
+   endTag = "";
+   
+   if(theTag == "--")// this is a comment tag
+   {
+      skipCommentTag(in);
+      endTag = "--";
+      return (!in.fail());
+   }
+   // check end tag
+   //
+   if(c == '/')
+   {
+      in.ignore();
+      readTag(in, endTag);
+      if(in.fail()) return false;
+      xmlskipws(in);
+      c = in.peek();
+      result = true;
+   }
+   else
+   {
+      return false;
+   }
+   if(c != '>')
+   {
+      setErrorStatus();
+      return false;
+   }
+   else
+   {
+      in.ignore(1);
+   }
+   if(in.fail()) result = false;
+   
+   return result;
+}
diff --git a/ossim/src/ossim/base/ossimXmlString.cpp b/src/base/ossimXmlString.cpp
similarity index 100%
rename from ossim/src/ossim/base/ossimXmlString.cpp
rename to src/base/ossimXmlString.cpp
diff --git a/ossim/src/ossim/dll_main/Makefile b/src/dll_main/Makefile
similarity index 100%
rename from ossim/src/ossim/dll_main/Makefile
rename to src/dll_main/Makefile
diff --git a/ossim/src/ossim/dll_main/ossimDllMain.cpp b/src/dll_main/ossimDllMain.cpp
similarity index 100%
rename from ossim/src/ossim/dll_main/ossimDllMain.cpp
rename to src/dll_main/ossimDllMain.cpp
diff --git a/src/elevation/ossimDtedElevationDatabase.cpp b/src/elevation/ossimDtedElevationDatabase.cpp
new file mode 100644
index 0000000..22c5182
--- /dev/null
+++ b/src/elevation/ossimDtedElevationDatabase.cpp
@@ -0,0 +1,376 @@
+#include <ossim/elevation/ossimDtedElevationDatabase.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimTrace.h>
+#include <sstream>
+#include <iomanip>
+#include <cstdlib> /* for abs(int) */
+#include <OpenThreads/Thread> //### TODO: for debug, remove
+
+static ossimTrace traceDebug("ossimDtedElevationDatabase:debug");
+static OpenThreads::Mutex d_mutex; // for debug
+RTTI_DEF1(ossimDtedElevationDatabase, "ossimDtedElevationDatabase", ossimElevationCellDatabase);
+
+ossimDtedElevationDatabase::ossimDtedElevationDatabase()
+   : ossimElevationCellDatabase(),
+     m_extension(""),
+     m_upcase(false),
+     m_lastHandler(0),
+     m_mutex()
+{
+}
+
+ossimDtedElevationDatabase::ossimDtedElevationDatabase(const ossimDtedElevationDatabase& rhs)
+   : ossimElevationCellDatabase(rhs),
+     m_extension(rhs.m_extension),
+     m_upcase(rhs.m_upcase),
+     m_lastHandler(0), // Do not copy this to get a unique handler for thread.
+     m_mutex()
+{
+}
+
+ossimDtedElevationDatabase::~ossimDtedElevationDatabase()
+{
+}
+
+ossimObject* ossimDtedElevationDatabase::dup() const
+{
+   ossimDtedElevationDatabase* duped = new ossimDtedElevationDatabase(*this);
+   return duped;
+}
+
+double ossimDtedElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
+{
+   if(!isSourceEnabled())
+      return ossim::nan();
+
+   double result = ossim::nan();
+   m_mutex.lock();
+   if(m_lastHandler.valid() && m_lastHandler->pointHasCoverage(gpt))
+   {
+      result = m_lastHandler->getHeightAboveMSL(gpt);
+   }
+   else
+   {
+      m_lastHandler = getOrCreateCellHandler(gpt);
+      if(m_lastHandler.valid())
+         result = m_lastHandler->getHeightAboveMSL(gpt);
+   }
+
+#if 0
+   d_mutex.lock();
+   cout << "THREAD ID: "<<OpenThreads::Thread::CurrentThread()->getThreadId()<<"  "
+         <<"ossimDtedElevationDatabase @ "<<(unsigned long)this<<"  m_lastHandler @ "
+         <<(unsigned long)m_lastHandler.get()<<endl; //### TODO: for debug, remove
+   d_mutex.unlock();
+#endif
+
+   m_mutex.unlock();
+   return result;
+}
+
+double ossimDtedElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
+{
+   double h = getHeightAboveMSL(gpt);
+   if(h != ossim::nan())
+   {
+      double offset = getOffsetFromEllipsoid(gpt);
+      
+      h += offset;
+   }
+   
+   return h;
+}
+bool ossimDtedElevationDatabase::open(const ossimString& connectionString)
+{
+   bool result = false;
+   ossimFilename file = ossimFilename(connectionString);
+   
+   result = openDtedDirectory(file);
+
+   return result;
+}
+
+bool ossimDtedElevationDatabase::openDtedDirectory(const ossimFilename& dir)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimDtedElevationDatabase::open entered ...\n"
+         << "dir: " << dir << "\n";
+   }
+   
+   bool result = dir.isDir();
+   if(result)
+   {
+      if ( m_extension.size() == 0 )
+      {
+         //---
+         // This sets extension by doing a directory scan and is now depricated.
+         // Use "extension" key in preferences to avoid this.  Example:
+         // elevation_manager.elevation_source0.extension: dt2
+         //---
+         result = inititializeExtension( dir );
+         if ( !result && traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimDtedElevationDatabase::open: WARNING "
+               << "Scan for dted extension failed!\n"
+               << "Can be set in ossim preferences.  Example:\n"
+               << "elevation_manager.elevation_source0.extension: .dt2\n";
+         }
+      }
+      
+      // Set the geoid:
+      if( !m_geoid.valid() )
+      {
+         m_geoid = ossimGeoidManager::instance()->findGeoidByShortName("geoid1996", false);
+         if(!m_geoid.valid()&&traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimDtedElevationDatabase::open: WARNING "
+               << "Unable to load goeid grid 1996 for DTED database\n";
+         }
+      }
+
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimDtedElevationDatabase::open result:" << (result?"true":"false") << "\n";
+   }
+   return result;
+}
+
+bool ossimDtedElevationDatabase::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
+{
+   bool result = false;
+   
+   m_mutex.lock();
+   ossimDtedElevationDatabase* thisPtr = const_cast<ossimDtedElevationDatabase*>(this);
+   ossimRefPtr<ossimElevCellHandler> tempHandler = thisPtr->getOrCreateCellHandler(gpt);
+   m_mutex.unlock();
+
+   if(tempHandler.valid())
+   {
+      result = tempHandler->getAccuracyInfo(info, gpt);
+   }
+  return result;
+}
+
+void ossimDtedElevationDatabase::createRelativePath(ossimFilename& file, const ossimGpt& gpt)const
+{
+   ossimFilename lon, lat;
+   int ilon = static_cast<int>(floor(gpt.lond()));
+   
+   if (ilon < 0)
+   {
+      lon = m_upcase?"W":"w";
+   }
+   else
+   {
+      lon = m_upcase?"E":"e";
+   }
+   
+   ilon = abs(ilon);
+   std::ostringstream  s1;
+   s1 << std::setfill('0') << std::setw(3)<< ilon;
+   
+   lon += s1.str().c_str();//ossimString::toString(ilon);
+   
+   int ilat =  static_cast<int>(floor(gpt.latd()));
+   if (ilat < 0)
+   {
+      lat += m_upcase?"S":"s";
+   }
+   else
+   {
+      lat += m_upcase?"N":"n";
+   }
+   
+   ilat = abs(ilat);
+   std::ostringstream  s2;
+   
+   s2<< std::setfill('0') << std::setw(2)<< ilat;
+   
+   lat += s2.str().c_str();
+   
+   file = lon.dirCat(lat+m_extension);
+}
+
+ossimRefPtr<ossimElevCellHandler> ossimDtedElevationDatabase::createCell(const ossimGpt& gpt)
+{
+   ossimRefPtr<ossimElevCellHandler> result = 0;
+   ossimFilename f;
+   createFullPath(f, gpt);
+   if(f.exists())
+   {
+      ossimRefPtr<ossimDtedHandler> h = new ossimDtedHandler(f, m_memoryMapCellsFlag);
+      if (!(h->getErrorStatus()))
+      {
+         result = h.get();
+      }
+   }
+   return result;
+}
+
+bool ossimDtedElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix )
+{
+   bool result = ossimElevationCellDatabase::loadState(kwl, prefix);
+   if(result)
+   {
+      if(!m_connectionString.empty()&&ossimFilename(m_connectionString).exists())
+      {
+         // Look for "extension" keyword.
+         std::string pref = (prefix?prefix:"");
+         std::string key = "extension";
+         ossimString val = ossimPreferences::instance()->preferencesKWL().findKey( pref, key );
+         if ( val.size() )
+         {
+            if ( val.string()[0] != '.' )
+            {
+               m_extension = ".";
+               m_extension += val;
+               
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "\nossimDtedElevationDatabase::loadState: WARNING\n"
+                  << "Key value for \"extension\" does not start with a dot!\n"
+                  << "Consider changing \"" << val << "\" to \"" << m_extension << "\"\n"
+                  << std::endl;   
+            }
+            else
+            {
+               m_extension = val;
+            }
+         }
+         else if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "\nossimDtedElevationDatabase::loadState: NOTICE\n"
+               << "Key lookup for \"extension\" failed!\n"
+               << "Can be set in ossim preferences.  Example:\n"
+               << pref << key << ": .dt2\n\n";
+         }
+
+         key = "upcase";
+         val = ossimPreferences::instance()->preferencesKWL().findKey( pref, key );
+         if ( val.size() )
+         {
+            m_upcase = val.toBool();
+         }
+         else if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "\nossimDtedElevationDatabase::loadState: NOTICE\n"
+               << "Key lookup for \"upcase\" failed!\n"
+               << "Can be set in ossim preferences.  Example:\n"
+               << pref << key << ": false\n\n";
+         }
+         
+
+         result = open(m_connectionString);
+      }
+      else
+      {
+         // can't open the connection because it does not exists or empty
+         result = false;
+      }
+   }
+   
+   return result;
+}
+
+bool ossimDtedElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix, "extension", m_extension, true);
+   kwl.add(prefix, "upcase", m_upcase, true);
+   
+   bool result = ossimElevationCellDatabase::saveState(kwl, prefix);
+   
+   return result;
+}
+
+std::ostream& ossimDtedElevationDatabase::print(ostream& out) const
+{
+   ossimKeywordlist kwl;
+   saveState(kwl);
+   out << "\nossimDtedElevationDatabase @ "<< (ossim_uint64) this << "\n"
+         << kwl <<ends;
+   return out;
+}
+
+bool ossimDtedElevationDatabase::inititializeExtension( const ossimFilename& dir )
+{
+   ossim_uint32 count = 0;
+   ossim_uint32 maxCount = 10;
+   ossimDirectory od;
+   bool result = od.open(dir);
+   if(result)
+   {
+      result = false;
+      ossimFilename f;
+      // Get the first directory.
+      od.getFirst(f, ossimDirectory::OSSIM_DIR_DIRS);
+      
+      do
+      {
+         ++count;
+         // Must be a directory.
+         if (f.isDir())
+         {
+            // Discard any full path.
+            ossimFilename fileOnly = f.file();
+            
+            // Downcase it. Note have sites with upper case. (drb)
+            // fileOnly.downcase();
+
+            //---
+            // Longitude subdir check:
+            // Must start with 'e', 'E', 'w' or 'W'.
+            //---
+            bool foundCell = ( ( (fileOnly.c_str()[0] == 'e') ||
+                                 (fileOnly.c_str()[0] == 'w') ||
+                                 (fileOnly.c_str()[0] == 'E') ||
+                                 (fileOnly.c_str()[0] == 'W') ) &&
+                               (fileOnly.size() == 4));
+            if(foundCell)
+            {
+               ossim_uint32 maxCount2 = 10;
+               ossim_uint32 count2 = 0;
+               ossimDirectory d2;
+
+               // Open the longitude subdir:
+               if(d2.open(f))
+               {
+                  d2.getFirst(f, ossimDirectory::OSSIM_DIR_FILES);
+                  do
+                  {
+                     ossimRefPtr<ossimDtedHandler> dtedHandler = new ossimDtedHandler();
+                     if(dtedHandler->open(f, false))
+                     {
+                        if(traceDebug())
+                        {
+                           ossimNotify(ossimNotifyLevel_DEBUG)
+                              << "ossimDtedElevationDatabase::open: Found dted file " << f << "\n";
+                        }
+                        result = true;
+                        m_extension = "."+f.ext();
+                        m_connectionString = dir;
+                        m_meanSpacing = dtedHandler->getMeanSpacingMeters();
+                     }
+                     dtedHandler->close();
+                     dtedHandler = 0;
+                     ++count2;
+                  } while(!result&&d2.getNext(f)&&(count2 < maxCount2));
+               }
+            }
+         }
+      } while(!result&&(od.getNext(f))&&(count < maxCount));
+   }
+
+   return result;
+   
+} // End: ossimDtedElevationDatabase::inititializeExtension( dir )
diff --git a/ossim/src/ossim/elevation/ossimDtedFactory.cpp b/src/elevation/ossimDtedFactory.cpp
similarity index 100%
rename from ossim/src/ossim/elevation/ossimDtedFactory.cpp
rename to src/elevation/ossimDtedFactory.cpp
diff --git a/src/elevation/ossimDtedHandler.cpp b/src/elevation/ossimDtedHandler.cpp
new file mode 100644
index 0000000..139aabd
--- /dev/null
+++ b/src/elevation/ossimDtedHandler.cpp
@@ -0,0 +1,601 @@
+//*****************************************************************************
+// FILE: ossimDtedHandler.cc
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimDtedHandler. This class derives from
+//   ossimElevHandler. It is responsible for loading an individual DTED cell
+//   from disk. This elevation files are memory mapped.
+//
+//*****************************************************************************
+// $Id: ossimDtedHandler.cpp 21214 2012-07-03 16:20:11Z dburken $
+
+#include <cstdlib>
+#include <cstring> /* for memcpy */
+#include <ossim/elevation/ossimDtedHandler.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+RTTI_DEF1(ossimDtedHandler, "ossimDtedHandler" , ossimElevCellHandler)
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimDtedHandler:exec");
+static ossimTrace traceDebug ("ossimDtedHandler:debug");
+
+static const char ENABLE_STATS_KW[] = "elevation.compute_statistics.enabled";
+
+
+ossimDtedHandler::ossimDtedHandler(const ossimFilename& dted_file, bool memoryMapFlag)
+   :
+      ossimElevCellHandler(dted_file),
+      m_fileStr(),
+      m_numLonLines(0),
+      m_numLatPoints(0),
+      m_dtedRecordSizeInBytes(0),
+      m_edition(),
+      m_productLevel(),
+      m_compilationDate(),
+      m_offsetToFirstDataRecord(0),
+      m_latSpacing(0.0),
+      m_lonSpacing(0.0),
+      m_swCornerPost(),
+      m_swapBytesFlag(false)
+{
+
+   static const char MODULE[] = "ossimDtedHandler (Filename) Constructor";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG " << MODULE <<": entering..." << std::endl;
+   }
+   
+   m_swapBytesFlag = ossim::byteOrder() == OSSIM_LITTLE_ENDIAN ? true : false;
+   //---
+   //  Open the dted file for reading.
+   //---
+   if (!open(dted_file, memoryMapFlag))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL " << MODULE << ": "
+            << "\nCould not open file:  " << dted_file.c_str()
+            << "\nReturning..." << std::endl;
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG " << MODULE << ": returning with error..." << std::endl;
+      }
+      return;
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG " << MODULE <<": Loading dted file: " << dted_file
+            << std::endl;
+      }
+   }
+
+   // DTED is stored in big endian.
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG " << MODULE << ": returning..." << std::endl;
+   }
+}
+
+ossimDtedHandler::~ossimDtedHandler()
+{
+   close();
+}
+
+bool ossimDtedHandler::getAccuracyInfo(ossimElevationAccuracyInfo& info,
+                                       const ossimGpt& /* gpt */ ) const
+{
+  info.m_confidenceLevel = .9;
+  info.m_absoluteLE = m_acc->absLE();
+  info.m_absoluteCE = m_acc->absCE();
+  info.m_relativeLE = m_acc->relLE();
+  info.m_relativeCE = m_acc->relCE();
+
+  info.m_surfaceName = m_dsi->productLevel();
+
+  return info.hasValidAbsoluteError();
+}
+
+double ossimDtedHandler::getHeightAboveMSL(const ossimGpt& gpt)
+{
+   if(m_memoryMap.size())
+   {
+      return getHeightAboveMSL(gpt, false);
+   }
+   else if((m_fileStr)&&(m_fileStr->good()))
+   {
+      return getHeightAboveMSL(gpt, true);
+   }
+   
+   return ossim::nan();
+}
+
+bool ossimDtedHandler::open(const ossimFilename& file, bool memoryMapFlag)
+{
+  std::string connectionString = file.c_str();
+  std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+    createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
+  if(!str) return false;
+  return open(str, connectionString, memoryMapFlag);
+}
+
+bool ossimDtedHandler::open(std::shared_ptr<ossim::istream>& fileStr, 
+                            const std::string& connectionString, 
+                            bool memoryMapFlag)
+{
+   static const char* MODULE = "ossimDtedHandler::open";
+  close();
+  if(!fileStr) return false;
+
+  m_vol = std::make_shared<ossimDtedVol>();
+  m_hdr = std::make_shared<ossimDtedHdr>();
+  m_uhl = std::make_shared<ossimDtedUhl>();
+  m_dsi = std::make_shared<ossimDtedDsi>();
+  m_acc = std::make_shared<ossimDtedAcc>();
+
+  m_connectionString = connectionString;
+
+  m_fileStr = fileStr;
+  m_fileStr->clear();
+
+  m_numLonLines = 0;
+  m_numLatPoints = 0;
+  m_dtedRecordSizeInBytes = 0;
+
+  // Attempt to parse.
+  m_vol->parse(*m_fileStr);
+  m_hdr->parse(*m_fileStr);
+  m_uhl->parse(*m_fileStr);
+  m_dsi->parse(*m_fileStr);
+  m_acc->parse(*m_fileStr);
+
+  //***
+  // Check for errors.  Must have uhl, dsi and acc records.  vol and hdr
+  // are for magnetic tape only; hence, may or may not be there.
+  //***
+  if (m_uhl->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
+     m_dsi->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
+     m_acc->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+  {
+    if (traceDebug())
+    {
+       ossimNotify(ossimNotifyLevel_DEBUG)
+       << "DEBUG " << MODULE << ": "
+       << "\nError parsing file:  " << m_connectionString
+       << "\nPossibly not a dted file."
+       << std::endl;
+    }
+    
+    theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+    close();
+    return false;
+  }
+  if(memoryMapFlag)
+  {
+    ossim_int64 streamSize;
+    m_fileStr->clear();
+    m_fileStr->seekg(0, std::ios::end);
+    streamSize = m_fileStr->tellg();
+    m_fileStr->seekg(0, std::ios::beg);
+
+    m_memoryMap.resize(streamSize);//theFilename.fileSize());
+    m_fileStr->read((char*)(&m_memoryMap.front()), (std::streamsize)m_memoryMap.size());
+    m_fileStr.reset();
+  }
+
+  m_numLonLines  = m_uhl->numLonLines();
+  m_numLatPoints = m_uhl->numLatPoints();
+  m_latSpacing   = m_uhl->latInterval();
+  m_lonSpacing   = m_uhl->lonInterval();
+  m_dtedRecordSizeInBytes = m_numLatPoints*2+ossimDtedRecord::DATA_LENGTH;
+
+  m_edition  = m_dsi->edition();
+  m_productLevel = m_dsi->productLevel();
+  m_compilationDate = m_dsi->compilationDate();
+
+  m_offsetToFirstDataRecord = m_acc->stopOffset();
+
+  #if 0 /* Serious debug only... */
+  std::cout << m_numLonLines
+           << "\t" << m_numLatPoints
+           << "\t" << m_lonSpacing
+           << "\t" << m_latSpacing
+           << "\t" << m_dtedRecordSizeInBytes
+           << "\t" << theFilename.fileSize()
+           << "\t" << file
+           << "\t" << m_offsetToFirstDataRecord
+           << std::endl;
+  #endif
+
+  //***
+  //  initialize the bounding rectangle:
+  //***
+  double south_boundary = m_uhl->latOrigin();
+  double west_boundary  = m_uhl->lonOrigin();
+  double north_boundary = south_boundary + m_latSpacing*(m_numLatPoints-1);
+  double east_boundary  = west_boundary  + m_lonSpacing*(m_numLonLines-1);
+
+  // For ossimElevCellHandler::pointHasCoverage method.
+  theGroundRect = ossimGrect(ossimGpt(north_boundary, west_boundary, 0.0),
+                            ossimGpt(south_boundary, east_boundary, 0.0));
+
+  m_swCornerPost.lat = south_boundary;
+  m_swCornerPost.lon = west_boundary;
+
+  //***
+  //  Determine the mean spacing:
+  //***
+  double center_lat = (south_boundary + north_boundary)/2.0;
+  theMeanSpacing = (m_latSpacing + m_lonSpacing*ossim::cosd(center_lat))
+                   * ossimGpt().metersPerDegree().x / 2.0;
+
+  //  Initialize the accuracy values:
+  theAbsLE90 = m_acc->absLE();
+  theAbsCE90 = m_acc->absCE();
+
+  // Set the base class null height value.
+  theNullHeightValue = -32767.0;
+
+  //---
+  // Commented out as this writes an un-needed file.  (drb 20100611)
+  // Get the statistics.
+  // gatherStatistics();
+  //---
+
+  return true;
+
+}
+
+double ossimDtedHandler::getHeightAboveMSL(const ossimGpt& gpt, bool readFromFile)
+{
+   // Establish the grid indexes:
+   double xi = (gpt.lon - m_swCornerPost.lon) / m_lonSpacing;
+   double yi = (gpt.lat - m_swCornerPost.lat) / m_latSpacing;
+
+   // Check for right edge.
+   int x0 = static_cast<int>(xi);
+   int y0 = static_cast<int>(yi);
+
+   if(x0 == (m_numLonLines-1))
+   {
+      --x0; // Move over one post.
+   }
+   
+   // Check for top edge.
+   //    if (gpt.lat == theGroundRect.ul().lat)
+   if(y0 == (m_numLatPoints-1))
+   {
+      --y0; // Move down one post.
+   }
+
+   // Do some error checking.
+   if ( xi < 0.0 || yi < 0.0 ||
+        x0 > (m_numLonLines  - 2.0) ||
+        y0 > (m_numLatPoints - 2.0) )
+   {
+      return ossim::nan();
+   }
+
+   //***
+   // Grab the four points from the dted cell needed.  These are big endian,
+   // signed magnitude shorts so they must be interpreted accordingly.
+   //***
+   int offset = m_offsetToFirstDataRecord + x0 * m_dtedRecordSizeInBytes +
+                y0 * 2 + DATA_RECORD_OFFSET_TO_POST;
+
+   /// read the posts from the DTED file.
+   DtedHeight postData;
+   //
+   if ( readFromFile )
+   {
+     readPostsFromFile( postData, offset );
+   }
+   else
+   {
+     ossim_uint8* buf = &m_memoryMap.front();
+     {
+       ossim_uint16 us;
+
+       memcpy(&us, buf+offset, POST_SIZE);
+       postData.m_posts[0].m_height = convertSignedMagnitude(us);
+       postData.m_posts[0].m_status = true;
+       memcpy(&us, buf+offset+POST_SIZE, POST_SIZE);
+       postData.m_posts[1].m_height = convertSignedMagnitude(us);
+       postData.m_posts[1].m_status = true;
+
+       // Move over to the next column.
+       offset += m_dtedRecordSizeInBytes;
+       memcpy(&us, buf+offset, POST_SIZE);
+       postData.m_posts[2].m_height = convertSignedMagnitude(us);
+       postData.m_posts[2].m_status = true;
+       memcpy(&us, buf+offset+POST_SIZE, POST_SIZE);
+       postData.m_posts[3].m_height = convertSignedMagnitude(us);
+       postData.m_posts[3].m_status = true;
+     }
+   }
+   // Perform bilinear interpolation:
+   double wx1 = xi  - x0;
+   double wy1 = yi  - y0;
+   double wx0 = 1.0 - wx1;
+   double wy0 = 1.0 - wy1;
+   
+   postData.m_posts[0].m_weight = wx0*wy0;
+   postData.m_posts[1].m_weight = wx0*wy1;
+   postData.m_posts[2].m_weight = wx1*wy0;
+   postData.m_posts[3].m_weight = wx1*wy1;
+
+#if 0 /* Serious debug only... */
+   postData.debug();
+#endif
+
+   return postData.calcHeight();
+}
+
+void ossimDtedHandler::readPostsFromFile( DtedHeight &postData, int offset)
+{
+
+  OpenThreads::ScopedLock <OpenThreads::Mutex> lock( m_fileStrMutex );
+  ossim_sint16 ss;
+  ossim_uint16 us;
+  int postCount = 0;
+  // read the posts in blocks 2x2.
+  for ( int column = 0; column < NUM_POSTS_PER_BLOCK ; ++column )
+  {
+    m_fileStr->seekg( offset, std::ios::beg );
+    for ( int row = 0; row < NUM_POSTS_PER_BLOCK ; ++row )
+    {
+      if ( !m_fileStr->eof() )
+      {
+        us = 0;
+        m_fileStr->read( ( char* ) &us, POST_SIZE );
+        // check the read was ok
+        if ( m_fileStr->good() )
+        {
+          postData.m_posts[postCount].m_status = true;
+        }
+        else
+        {
+          // reset the goodbit
+          m_fileStr->clear();
+        }
+        ss = convertSignedMagnitude( us );
+        postData.m_posts[postCount].m_height = ss;
+      }
+      postCount++;
+    }
+    offset += m_dtedRecordSizeInBytes;
+  }
+}
+
+double ossimDtedHandler::getPostValue(const ossimIpt& gridPt) const
+{
+   static const char MODULE[] = "ossimDtedHandler::getPostValue";
+   
+   // Do some error checking.
+   if ( gridPt.x < 0.0 || gridPt.y < 0.0 ||
+        gridPt.x > (m_numLonLines  - 1) ||
+        gridPt.y > (m_numLatPoints - 1) )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING " << MODULE << ": No intersection..." << std::endl;
+      }
+      return ossim::nan();
+   }
+
+   if (!isOpen())
+   {
+      return ossim::nan();
+   }
+
+   int offset =
+      m_offsetToFirstDataRecord + gridPt.x * m_dtedRecordSizeInBytes +
+      gridPt.y * 2 + DATA_RECORD_OFFSET_TO_POST;
+   
+   // Put the file pointer at the start of the first elevation post.
+   m_fileStr->seekg(offset, std::ios::beg);
+
+   ossim_uint16 us;
+
+   // Get the post.
+   m_fileStr->read((char*)&us, POST_SIZE);
+   
+   return double(convertSignedMagnitude(us));
+}
+
+void ossimDtedHandler::gatherStatistics()
+{
+   //***
+   // Check to see if there is a statistics file already.  If so; do a lookup
+   // for the min and max values.
+   //***
+   ossimFilename stats_file = theFilename;//theFilename.path();
+   stats_file.setExtension("statistics");
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimDtedHandler::gatherStatistics(): Looking for "
+         << stats_file << " statistics file..." << std::endl;
+   }
+
+   ossimKeywordlist kwl;
+   const char* min_str = NULL;
+   const char* max_str = NULL;
+
+   if (stats_file.exists())
+   {
+      if (kwl.addFile(stats_file))
+      {
+         // Look for the min_pixel_value keyword.
+         min_str = kwl.find(ossimKeywordNames::MIN_VALUE_KW);
+         max_str = kwl.find(ossimKeywordNames::MAX_VALUE_KW);
+      }
+   }
+
+   if (min_str && max_str)
+   {
+      theMinHeightAboveMSL = atoi(min_str);
+      theMaxHeightAboveMSL = atoi(max_str);
+   }
+   else if (theComputeStatsFlag&&!m_memoryMap.size())  // Scan the cell and gather the statistics...
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "NOTICE ossimDtedHandler::gatherStatistics():"
+            << " scanning for min/max"
+            << "\nThis may take a while..." << std::endl;
+      }
+      // Start off with the min and max pegged.
+      theMinHeightAboveMSL =  32767;
+      theMaxHeightAboveMSL = -32767;
+      
+      // Put the file pointer at the start of the first elevation post.
+      m_fileStr->seekg(m_offsetToFirstDataRecord, std::ios::beg);
+      
+      //---
+      // Loop through all records and scan for lowest min and highest max.
+      // Each record contains a row of latitude points for a given longitude.
+      // There are eight bytes in front of the post and four checksum bytes at
+      // the end so ignore them.
+      //---
+      for (ossim_int32 i=0; i<m_numLonLines; ++i)  // longitude direction
+      {
+         m_fileStr->seekg(DATA_RECORD_OFFSET_TO_POST, std::ios::cur);
+         
+         for (ossim_int32 j=0; j<m_numLatPoints; ++j) // latitude direction
+         {
+            ossim_uint16 us;
+            ossim_sint16 ss;
+            m_fileStr->read((char*)&us, POST_SIZE);
+            ss = convertSignedMagnitude(us);
+            if (ss < theMinHeightAboveMSL && ss != NULL_POST)
+            {
+               theMinHeightAboveMSL = ss;
+            }
+            if (ss > theMaxHeightAboveMSL)
+            {
+               theMaxHeightAboveMSL = ss;
+            }
+         }
+         
+         m_fileStr->seekg(DATA_RECORD_CHECKSUM_SIZE, std::ios::cur);
+      }
+      
+      // Add the stats to the keyword list.
+      kwl.add(ossimKeywordNames::MIN_VALUE_KW, theMinHeightAboveMSL);
+      kwl.add(ossimKeywordNames::MAX_VALUE_KW, theMaxHeightAboveMSL);
+      
+      // Write out the statistics file.
+      kwl.write(stats_file.c_str());
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimDtedHandler::gatherStatistics:"
+         << "\ntheMinHeightAboveMSL:  " << theMinHeightAboveMSL
+         << "\ntheMaxHeightAboveMSL:  " << theMaxHeightAboveMSL
+         << std::endl;
+   }
+}
+
+ossimIpt ossimDtedHandler::getSizeOfElevCell() const
+{
+   return ossimIpt(m_numLonLines, m_numLatPoints);
+}
+
+ossimString  ossimDtedHandler::edition() const
+{
+   return m_edition;
+}
+
+ossimString  ossimDtedHandler::productLevel() const
+{
+   return m_productLevel;
+}
+
+ossimString  ossimDtedHandler::compilationDate() const
+{
+   return m_compilationDate;
+}
+
+const ossimDtedHandler& ossimDtedHandler::operator=(
+   const ossimDtedHandler& rhs)
+{
+   return rhs;
+}
+
+ossimDtedHandler::ossimDtedHandler(const ossimDtedHandler&)
+   :
+   ossimElevCellHandler()
+{}
+
+
+/// DtedPost methods
+ossimDtedHandler::DtedPost::~DtedPost(){}
+
+/// DtedHeight methods
+ossimDtedHandler::DtedHeight::DtedHeight() {}
+
+ossimDtedHandler::DtedHeight::~DtedHeight(){}
+
+double ossimDtedHandler::DtedHeight::calcHeight()
+{
+  double sum_weights = 0;
+  double sum_posts = 0;
+  for ( int i = 0; i < TOTAL_POSTS; ++i )
+  {
+    if ( m_posts[i].m_height == NULL_POST || !m_posts[i].m_status )
+    {
+      m_posts[i].m_weight = 0.0;
+    }
+  }
+
+  for ( int i = 0; i < TOTAL_POSTS; ++i )
+  {
+    sum_weights += m_posts[i].m_weight;
+    sum_posts += m_posts[i].m_height * m_posts[i].m_weight;
+  }
+  if ( sum_weights )
+  {
+    return sum_posts / sum_weights;
+  }
+  return ossim::nan();
+}
+
+void ossimDtedHandler::DtedHeight::debug()
+{
+  cout << "\np00:  " << m_posts[0].m_height
+       << "\np01:  " << m_posts[1].m_height
+       << "\np10:  " << m_posts[2].m_height
+       << "\np11:  " << m_posts[3].m_height
+       << "\nw00:  " << m_posts[0].m_weight
+       << "\nw01:  " << m_posts[1].m_weight
+       << "\nw10:  " << m_posts[2].m_weight
+       << "\nw11:  " << m_posts[3].m_weight
+       << "\ns00:  " << m_posts[0].m_status
+       << "\ns01:  " << m_posts[1].m_status
+       << "\ns10:  " << m_posts[2].m_status
+       << "\ns11:  " << m_posts[3].m_status
+       << std::endl;
+}
\ No newline at end of file
diff --git a/src/elevation/ossimElevCellHandler.cpp b/src/elevation/ossimElevCellHandler.cpp
new file mode 100644
index 0000000..8e1a225
--- /dev/null
+++ b/src/elevation/ossimElevCellHandler.cpp
@@ -0,0 +1,103 @@
+//*****************************************************************************
+// FILE: ossimElevCellHandler.cc
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimElevCellHandler. This is the base
+//   class for all DEM file readers including DTED. Each file shall have its
+//   corresponding ossimElevCellHandler. When more than one file is accessed,
+//   an ossimElevCombiner is used which owns multiple instances of this class.
+//
+// SOFTWARE HISTORY:
+//>
+//   19Apr2001  Oscar Kramer
+//              Initial coding.
+//<
+//*****************************************************************************
+// $Id: ossimElevCellHandler.cpp 23117 2015-01-29 22:33:13Z okramer $
+
+#include <ossim/elevation/ossimElevCellHandler.h>
+#include <ossim/base/ossimKeyword.h>
+#include <ossim/base/ossimGpt.h>
+
+RTTI_DEF1(ossimElevCellHandler, "ossimElevCellHandler" , ossimElevSource)
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimElevCellHandler:exec");
+static ossimTrace traceDebug ("ossimElevCellHandler:debug");
+
+static const ossimKeyword DEM_FILENAME_KW ("dem_filename",
+                                           "Name of DEM file to load.");
+static const ossimIpt ZERO_SIZE_IPT (0, 0);
+
+ossimElevCellHandler::ossimElevCellHandler ()
+   : ossimElevSource(),
+     theFilename(),
+     theMeanSpacing(0.0),
+     theAbsLE90(0.0),
+     theAbsCE90(0.0)
+{
+}
+
+ossimElevCellHandler::ossimElevCellHandler (const ossimElevCellHandler& src)
+   : ossimElevSource(src),
+     theFilename    (src.theFilename),
+     theMeanSpacing (src.theMeanSpacing),
+     theAbsLE90     (src.theAbsLE90),
+     theAbsCE90     (src.theAbsCE90)
+{
+}
+
+ossimElevCellHandler::ossimElevCellHandler(const char* filename)
+   : ossimElevSource(),
+     theFilename(filename),
+     theMeanSpacing(0.0),
+     theAbsLE90(0.0),
+     theAbsCE90(0.0)
+{}
+
+ossimElevCellHandler::~ossimElevCellHandler()
+{}
+
+const ossimFilename& ossimElevCellHandler::getFilename() const
+{
+   return theFilename;
+}
+
+double ossimElevCellHandler::getMeanSpacingMeters() const
+{
+   return theMeanSpacing;
+}
+
+bool ossimElevCellHandler::getAccuracyInfo(ossimElevationAccuracyInfo& info,
+                                           const ossimGpt& /* gpt*/ ) const
+{
+  info.m_confidenceLevel = .9;
+  info.m_absoluteLE = theAbsLE90;
+  info.m_absoluteCE = theAbsCE90;
+
+  return info.hasValidAbsoluteError();
+}
+
+bool ossimElevCellHandler::canConnectMyInputTo(
+   ossim_int32 /* inputIndex */,
+   const ossimConnectableObject* /* object */) const
+{         
+   return false;
+}
+
+std::ostream& ossimElevCellHandler::print(ostream& out) const
+{
+   out << "\nossimElevCellHandler @ "<< (ossim_uint64) this
+         << "\n theFilename = "<< theFilename
+         << "\n theMeanSpacing = "<< theMeanSpacing
+         << "\n theAbsLE90 = "<< theAbsLE90
+         << "\n theAbsCE90 = "<< theAbsCE90;
+         //<< ossimElevSource::print(out);
+   return out;
+}
+
diff --git a/src/elevation/ossimElevCellHandlerFactory.cpp b/src/elevation/ossimElevCellHandlerFactory.cpp
new file mode 100644
index 0000000..50a1bc0
--- /dev/null
+++ b/src/elevation/ossimElevCellHandlerFactory.cpp
@@ -0,0 +1,130 @@
+//*****************************************************************************
+// FILE: ossimElevCellHandlerFactory.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimElevCellHandlerFactory. This is
+//   a "super-factory" owning a list of subfactories for each particular DEM
+//   format class.
+//
+//   NOT CURRENTLY UTILIZED -- USE DTED MANAGER
+//
+// LIMITATIONS:
+//   The intention of this factory is to produce individual instances of
+//   elevation cell handlers. Presently this is not supported since DTED is
+//   the only elevation source being handled. DTED is loaded via the
+//   ossimDtedManager class as a DB interface, and not by accessing individual
+//   DTED handlers.
+//
+// SOFTWARE HISTORY:
+//>
+//   01Aug2001  Oscar Kramer (okramer at imagelinks.com)
+//              Initial coding.
+//<
+//*****************************************************************************
+//  $Id: ossimElevCellHandlerFactory.cpp 14800 2009-06-30 08:58:55Z dburken $
+
+#include <ossim/elevation/ossimElevCellHandlerFactory.h>
+#include <ossim/base/ossimString.h>
+
+ossimElevCellHandlerFactory* ossimElevCellHandlerFactory::theInstance = 0;
+
+//*****************************************************************************
+//  STATIC METHOD: instance()
+//  
+//*****************************************************************************
+ossimElevCellHandlerFactory* ossimElevCellHandlerFactory::instance()
+{
+   if(!theInstance)
+      theInstance = new ossimElevCellHandlerFactory;
+ 
+   return (ossimElevCellHandlerFactory*) theInstance; 
+} 
+
+//*****************************************************************************
+//  PROTECTED DEFAULT CONSTRUCTOR: ossimElevCellHandlerFactory
+//  
+//*****************************************************************************
+ossimElevCellHandlerFactory::ossimElevCellHandlerFactory()
+{
+   //***
+   // Add default sub factories to this factory's registry list:
+   // NOTE: DTED handlers are managed by their own ossimDtedManager so should
+   // never be created individually via a factory. This will be the typical
+   // pattern for all but custom DEM files.
+   //***
+//   registerFactory(ossimUsgsDemCellFactory::instance());
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimElevCellHandlerFactory::create(kwl, prefix)
+//  
+//*****************************************************************************
+ossimElevCellHandler*
+ossimElevCellHandlerFactory::create(const ossimKeywordlist &keywordList,
+                                    const char *prefix) const
+{
+   std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator
+      elevCellFactory;
+
+   ossimElevCellHandler* product = 0;
+   
+   elevCellFactory = theRegistry.begin();
+   while((elevCellFactory != theRegistry.end()) && (!product))
+   {
+      product = (*elevCellFactory)->create(keywordList, prefix);
+      elevCellFactory++;
+   }
+
+   return product;
+}
+
+//*****************************************************************************
+//  METHOD: ossimElevCellHandlerFactory::create(proj_name)
+//  
+//*****************************************************************************
+ossimElevCellHandler*
+ossimElevCellHandlerFactory::create(const ossimString &name) const 
+{
+   std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator
+      elevCellFactory;
+
+   ossimElevCellHandler* product = 0;
+   
+   elevCellFactory = theRegistry.begin();
+   while((elevCellFactory != theRegistry.end()) && (!product))
+   {
+      product = (*elevCellFactory)->create(name);
+      elevCellFactory++;
+   }
+
+   return product;
+}
+
+//*****************************************************************************
+//  METHOD: ossimElevCellHandlerFactory::getList()
+//  
+//*****************************************************************************
+std::list<ossimString> ossimElevCellHandlerFactory::getList() const 
+{
+   std::list<ossimString> rtn_list;
+   std::list<ossimString> sub_list;
+   std::list<ossimFactoryBase<ossimElevCellHandler>*>::const_iterator factory_iter;
+
+   factory_iter = theRegistry.begin();
+   while(factory_iter != theRegistry.end())
+   {
+      sub_list = (*factory_iter)->getList();
+      rtn_list.merge(sub_list);
+      factory_iter++;
+   }
+
+   return rtn_list;
+}
+
diff --git a/src/elevation/ossimElevManager.cpp b/src/elevation/ossimElevManager.cpp
new file mode 100644
index 0000000..f24ef14
--- /dev/null
+++ b/src/elevation/ossimElevManager.cpp
@@ -0,0 +1,673 @@
+//**************************************************************************
+// FILE: ossimElevManager.cpp
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimElevManager. This object 
+//   provides a single interface for accessing multiple elevation
+//   sources. This object owns one or more elevation sources in an ordered
+//   list. When queried for an elevation at a particular point, it searches
+//   the available sources for the best result, instantiating new sources if
+//   necessary.
+//
+// SOFTWARE HISTORY:
+//>
+//   23Apr2001  Oscar Kramer
+//              Initial coding.
+//<
+//**************************************************************************
+// $Id: ossimElevManager.cpp 23641 2015-12-02 20:32:06Z dburken $
+
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimEnvironmentUtility.h>
+#include <ossim/elevation/ossimElevationCellDatabase.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/elevation/ossimElevationDatabaseRegistry.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <algorithm>
+
+//ossimElevManager* ossimElevManager::m_instance = 0;
+static ossimTrace traceDebug("ossimElevManager:debug");
+
+//---
+// For std::sort of ElevationDatabaseListType
+// e.g.: std::sort( dbList.begin(), dbList.end(), dbSort );
+//---
+bool dbSort(ossimRefPtr<ossimElevationDatabase> a, ossimRefPtr<ossimElevationDatabase> b)
+{
+   bool result = false;
+   if ( a.valid() && b.valid() )
+   {
+      result = ( a->getMeanSpacingMeters() < b->getMeanSpacingMeters() );
+   }
+   return result;
+}
+
+ossimElevManager::ConnectionStringVisitor::ConnectionStringVisitor( const ossimString& value )
+   :
+   m_connectionString(value),
+   m_database(0)
+{}
+
+void ossimElevManager::ConnectionStringVisitor::visit(ossimObject* obj)
+{
+   if(!hasVisited(obj))
+   {
+      ossimElevationDatabase* databsase = dynamic_cast<ossimElevationDatabase*>(obj);
+      if(databsase)
+      {
+         if(m_connectionString == databsase->getConnectionString())
+         {
+            m_database = databsase;
+            m_stopTraversalFlag = true;
+         }
+      }
+   }
+}
+
+ossimElevManager* ossimElevManager::instance()
+{
+   static ossimElevManager inst;
+   return &inst;
+}
+
+ossimElevManager::ossimElevManager()
+   :ossimElevSource(),
+    m_maxRoundRobinSize(1),
+    m_defaultHeightAboveEllipsoid(ossim::nan()),
+    m_elevationOffset(ossim::nan()),
+    m_useGeoidIfNullFlag(false),
+    m_useStandardPaths(false),
+    m_currentDatabaseIdx(0),
+    m_mutex()
+{
+   //---
+   // Auto load removed to avoid un-wanted directory scanning.
+   // Use ossim preferences.  drb - 28 March 2016.
+   //---
+   // loadStandardElevationPaths();
+}
+
+ossimElevManager::~ossimElevManager()
+{
+   clear();
+}
+
+double ossimElevManager::getHeightAboveEllipsoid(const ossimGpt& gpt)
+{
+   double result = ossim::nan();
+
+   if (!isSourceEnabled())
+      return result;
+
+   ElevationDatabaseListType& elevDbList = getNextElevDbList();
+   for (ossim_uint32 idx = 0; (idx < elevDbList.size()) && ossim::isnan(result); ++idx)
+   {
+      result = elevDbList[idx]->getHeightAboveEllipsoid(gpt);
+   }
+
+   if (ossim::isnan(result))
+   {
+      // No elevation value was returned from the database, so try next best alternatives depending
+      // on ossim_preferences settings. Priority goes to default ellipsoid height if available:
+      if (!ossim::isnan(m_defaultHeightAboveEllipsoid))
+      {
+         result = m_defaultHeightAboveEllipsoid;
+      }
+      else if (m_useGeoidIfNullFlag)
+      {
+         result = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
+      }
+   }
+
+   // Next, ossim_preferences may have indicated an elevation offset to use (top of trees, error
+   // bias, etc):
+   if (!ossim::isnan(m_elevationOffset) && !ossim::isnan(result))
+      result += m_elevationOffset;
+
+   return result;
+}
+
+double ossimElevManager::getHeightAboveMSL(const ossimGpt& gpt)
+{
+   double result = ossim::nan();
+
+   if (!isSourceEnabled())
+      return result;
+
+   ElevationDatabaseListType& elevDbList = getNextElevDbList();
+   for (ossim_uint32 idx = 0; (idx < elevDbList.size()) && ossim::isnan(result); ++idx)
+   {
+      result = elevDbList[idx]->getHeightAboveMSL(gpt);
+   }
+
+   if (ossim::isnan(result) && m_useGeoidIfNullFlag)
+   {
+      // No elevation value was returned from the database, so try next best alternatives depending
+      // on ossim_preferences settings. First default to height at MSL itself:
+      result = 0.0; // MSL
+      if (!ossim::isnan(m_defaultHeightAboveEllipsoid))
+      {
+         // Use the default height above ellipsoid corrected for best guess of MSL above ellipsoid
+         // (i.e., the geoid):
+         double dh = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
+         if (!ossim::isnan(dh))
+            result = m_defaultHeightAboveEllipsoid - dh;
+      }
+   }
+
+   // ossim_preferences may have indicated an elevation offset to use (top of trees, error bias, etc)
+   if (!ossim::isnan(result) && (!ossim::isnan(m_elevationOffset)))
+      result += m_elevationOffset;
+
+   return result;
+}
+
+void ossimElevManager::loadStandardElevationPaths()
+{
+   if (!m_useStandardPaths)
+      return;
+
+   ossimFilename userDir    = ossimEnvironmentUtility::instance()->getUserOssimSupportDir();
+   ossimFilename installDir = ossimEnvironmentUtility::instance()->getInstalledOssimSupportDir();
+   
+   userDir = userDir.dirCat("elevation");
+   installDir = installDir.dirCat("elevation");
+   
+   loadElevationPath(userDir);
+   loadElevationPath(installDir);
+   
+   ossimString paths = ossimEnvironmentUtility::instance()->getEnvironmentVariable("OSSIM_ELEVATION_PATH");
+   std::vector<ossimString> pathArray;
+   ossimString pathSeparator = ":";
+#if defined(WIN32) && !defined(CYGWIN)
+   pathSeparator = ";";
+#endif
+   
+   if(!paths.empty())
+   {
+      paths.split(pathArray, pathSeparator);
+      if(!pathArray.empty())
+      {
+         ossim_uint32 idx = 0;
+         for(idx = 0; idx < pathArray.size(); ++idx)
+         {
+            ossimFilename file(pathArray[idx]);
+            
+            if(file.exists())
+            {
+               loadElevationPath(file);
+            }
+         }
+      }
+   }
+}
+
+bool ossimElevManager::loadElevationPath(const ossimFilename& path, bool set_as_first)
+{
+   bool result = false;
+   ossimElevationDatabase* database = ossimElevationDatabaseRegistry::instance()->open(path);
+   
+   if(!database && path.isDir())
+   {
+      ossimDirectory dir;
+      
+      if(dir.open(path))
+      {
+         ossimFilename file;
+         dir.getFirst(file, ossimDirectory::OSSIM_DIR_DIRS);
+         do
+         {
+            database = ossimElevationDatabaseRegistry::instance()->open(file);
+            if(database)
+            {
+               result = true;
+               addDatabase(database, set_as_first);
+            }
+         }while(dir.getNext(file));
+      }
+   }
+   else if(database)
+   {
+      result = true;
+      addDatabase(database, set_as_first);
+   }
+   
+   return result;
+}
+
+void ossimElevManager::getOpenCellList(std::vector<ossimFilename>& list) const
+{
+   if ( m_dbRoundRobin.size() )
+   {
+      ElevationDatabaseListType& elevDbList = m_dbRoundRobin[0];
+      for(ossim_uint32 idx = 0; idx < elevDbList.size(); ++idx)
+      {
+         // If this is a cell based database get the files:
+         ossimRefPtr<const ossimElevationCellDatabase> db =
+            dynamic_cast<const ossimElevationCellDatabase*>( elevDbList[idx].get() );
+         if ( db.valid() )
+         {
+            db->getOpenCellList(list);
+         }
+      }
+   }
+}
+
+void ossimElevManager::getCellsForBounds( const std::string& connectionString,
+                                          const ossim_float64& minLat,
+                                          const ossim_float64& minLon,
+                                          const ossim_float64& maxLat,
+                                          const ossim_float64& maxLon,
+                                          std::vector<ossimFilename>& cells,
+                                          ossim_uint32 maxNumberOfCells)
+{
+   ossimRefPtr<ossimElevationCellDatabase> cellDatabase = 0;
+
+   // See if the connectionString is already opened:
+   ossimString os = connectionString;
+   ossimElevManager::ConnectionStringVisitor visitor( os );
+   accept( visitor );
+   cellDatabase = dynamic_cast<ossimElevationCellDatabase*>( visitor.getElevationDatabase() );
+
+   if ( cellDatabase.valid() == false )
+   {
+      // Try to open it:
+      ossimRefPtr<ossimElevationDatabase> db =
+         ossimElevationDatabaseRegistry::instance()->open( ossimString(connectionString) );
+
+      if ( db.valid() )
+      {
+         cellDatabase = dynamic_cast<ossimElevationCellDatabase*>( db.get() );
+      }
+   }
+
+   // Lastly get the files:
+   if ( cellDatabase.valid() )
+   {
+      cellDatabase->getCellsForBounds( minLat, minLon, maxLat, maxLon, cells, maxNumberOfCells );
+   }
+   else
+   {
+      // Bummer:
+      cells.clear();
+   }
+}
+
+void ossimElevManager::getCellsForBounds( const ossim_float64& minLat,
+                                          const ossim_float64& minLon,
+                                          const ossim_float64& maxLat,
+                                          const ossim_float64& maxLon,
+                                          std::vector<ossimFilename>& cells,
+                                          ossim_uint32 maxNumberOfCells )
+{
+   //TODO: Presently incrementing by 0.1 deg. If an elev cell
+   // is smaller than this, it may be missed. Need to generalize to support arbitrary cell sizes.
+
+   //TODO: This method relies on the caching of open cells. If the bounds are too large too permit
+   // all cells to remain open, this method will incorrectly return a subset of all cells providing
+   // coverage.
+
+   // Ping the collection of databases for elevation values at regular intervals inside the bounds.
+   // This will autoload the best cells:
+   cells.clear();
+   const ossim_float64 DELTA_DEG = 0.1; // degree
+   ossimGpt gpt;
+   for (gpt.lat=minLat; gpt.lat<=maxLat; gpt.lat+=DELTA_DEG)
+   {
+      for (gpt.lon=minLon; gpt.lon<=maxLon; gpt.lon+=DELTA_DEG)
+      {
+         getHeightAboveMSL(gpt);
+      }
+   }
+
+   // Convert filename list to string list (why are they different)?
+   ossim_uint32 limitCells = maxNumberOfCells>0?maxNumberOfCells:static_cast<ossim_uint32>(9999999999);
+   std::vector<ossimFilename> open_cells;
+   getOpenCellList(open_cells);
+   std::vector<ossimFilename>::iterator iter = open_cells.begin();
+   while ((iter != open_cells.end()) && (cells.size() < limitCells))
+   {
+      cells.push_back(*iter);
+      ++iter;
+   }
+}
+
+
+void ossimElevManager::getCellsForBounds( const ossimGrect& bbox,
+                                          std::vector<ossimFilename>& cells,
+                                          ossim_uint32 maxCells)
+{
+   getCellsForBounds(bbox.lr().lat, bbox.ul().lon, bbox.ul().lat, bbox.lr().lon, cells, maxCells);
+}
+
+void ossimElevManager::clear()
+{
+   std::vector<ElevationDatabaseListType>::iterator i = m_dbRoundRobin.begin();
+   while ( i != m_dbRoundRobin.end() )
+   {
+      i->clear();
+      ++i;
+   }
+}
+
+void ossimElevManager::accept(ossimVisitor& visitor)
+{
+   std::vector<ElevationDatabaseListType>::iterator rri = m_dbRoundRobin.begin();
+   while ( rri != m_dbRoundRobin.end() )
+   {
+      ElevationDatabaseListType& elevDbList = *rri;
+
+      ossimElevManager::ElevationDatabaseListType::iterator i = elevDbList.begin();
+      while ( i != elevDbList.end() )
+      {
+         if ( (*i).valid() )
+         {
+            (*i)->accept( visitor );
+
+            if ( visitor.stopTraversal() )
+            {
+               break;
+            }
+         }
+         ++i;
+      }
+      ++rri;
+   }
+}
+
+bool ossimElevManager::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
+{
+   ElevationDatabaseListType& elevDbList = getNextElevDbList();
+   for(ossim_uint32 idx = 0;(idx < elevDbList.size()); ++idx)
+   {
+      if(elevDbList[idx]->getAccuracyInfo(info, gpt))
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+bool ossimElevManager::pointHasCoverage(const ossimGpt& gpt) const
+{
+   if ( m_dbRoundRobin.size() )
+   {
+      ElevationDatabaseListType& elevDbList = m_dbRoundRobin[0];
+      for(ossim_uint32 idx = 0;(idx < elevDbList.size()); ++idx)
+      {
+         if(elevDbList[idx]->pointHasCoverage(gpt))
+         {
+            return true;
+         }
+      }
+   }
+   return false;
+}
+
+bool ossimElevManager::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix, "elevation_offset", m_elevationOffset, true);
+   kwl.add(prefix, "default_height_above_ellipsoid", m_defaultHeightAboveEllipsoid, true);
+   kwl.add(prefix, "use_geoid_if_null", m_useGeoidIfNullFlag, true);
+   kwl.add(prefix, "use_standard_elev_paths", m_useStandardPaths, true);
+   kwl.add(prefix, "threads", ossimString::toString(m_maxRoundRobinSize), true);
+
+   return ossimElevSource::saveState(kwl, prefix);
+}
+
+/**
+ * Method to the load (recreate) the state of an object from a keyword
+ * list.  Return true if ok or false on error.
+ */
+bool ossimElevManager::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimElevManager::loadState: Entered..."
+      << std::endl;
+   }
+   if(!ossimElevSource::loadState(kwl, prefix))
+   {
+      return false;
+   }
+   ossimString copyPrefix(prefix);
+   ossimString elevationOffset = kwl.find(copyPrefix, "elevation_offset");
+   ossimString defaultHeightAboveEllipsoid = kwl.find(copyPrefix, "default_height_above_ellipsoid");
+   ossimString elevRndRbnSize = kwl.find(copyPrefix, "threads");
+
+   kwl.getBoolKeywordValue(m_useGeoidIfNullFlag, "use_geoid_if_null", copyPrefix.chars());
+   kwl.getBoolKeywordValue(m_useStandardPaths, "use_standard_elev_paths", copyPrefix.chars());
+
+   if(!elevationOffset.empty())
+      m_elevationOffset = elevationOffset.toDouble();
+
+   if(!defaultHeightAboveEllipsoid.empty())
+      m_defaultHeightAboveEllipsoid = defaultHeightAboveEllipsoid.toDouble();
+
+   ossim_uint32 numThreads = 1;
+   if(!elevRndRbnSize.empty())
+   {
+      if (elevRndRbnSize.contains("yes") || elevRndRbnSize.contains("true"))
+         numThreads = ossim::getNumberOfThreads();
+      else if (elevRndRbnSize.contains("no") || elevRndRbnSize.contains("false"))
+         numThreads = 1;
+      else
+      {
+         numThreads = elevRndRbnSize.toUInt32();
+         numThreads = numThreads > 0 ? numThreads : 1;
+      }
+   }
+   setRoundRobinMaxSize(numThreads);
+
+   ossimString regExpression =  ossimString("^(") + copyPrefix + "elevation_source[0-9]+.)";
+   vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
+   long numberOfSources = (long)keys.size();
+   ossim_uint32 offset = (ossim_uint32)(copyPrefix+"elevation_source").size();
+   ossim_uint32 idx = 0;
+   std::vector<int> theNumberList(numberOfSources);
+   for(idx = 0; idx < theNumberList.size();++idx)
+   {
+      ossimString numberStr(keys[idx].begin() + offset,
+                            keys[idx].end());
+      theNumberList[idx] = numberStr.toInt();
+   }
+   std::sort(theNumberList.begin(), theNumberList.end());
+   
+   for(idx=0;idx < theNumberList.size();++idx)
+   {
+      ossimString newPrefix = copyPrefix;
+      newPrefix += ossimString("elevation_source");
+      newPrefix += ossimString::toString(theNumberList[idx]);
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimElevManager::loadState:"
+         << "\nLooking for key:  " << newPrefix
+         << std::endl;
+      }
+
+      //---
+      // Check for enabled key first.  Default, if not found is true for
+      // legacy compatibility.
+      //---
+      bool enabled = true;
+      std::string key = newPrefix.string();
+      key += ".";
+      key += ossimKeywordNames::ENABLED_KW;
+      std::string value = kwl.findKey( key );
+      if ( value.size() )
+      {
+         enabled = ossimString(value).toBool();
+      }
+
+      if ( enabled )
+      {
+         // first check if new way is supported
+         ossimRefPtr<ossimElevationDatabase> database =
+            ossimElevationDatabaseRegistry::instance()->createDatabase(kwl, newPrefix+".");
+         if(database.valid())
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG ossimElevManager::loadState:"
+                  << "\nadding elevation database:  "
+                  << database->getClassName()
+                  << ": " << database->getConnectionString()
+                  << std::endl;
+            }  
+            addDatabase(database.get());
+         }
+         else
+         {
+            // if not new elevation load verify the old way by
+            // looking at the filename
+            //
+            ossimString fileKey = newPrefix;
+            fileKey += ".";
+            fileKey += ossimKeywordNames::FILENAME_KW;
+            ossimString lookup = kwl.find(prefix, fileKey.c_str());
+            if (!lookup.empty())
+            {
+               loadElevationPath(ossimFilename(lookup));
+            } // end if lookup
+         }
+      }
+
+   } // end for loop
+
+   return true;
+}
+
+void ossimElevManager::setRoundRobinMaxSize(ossim_uint32 new_size)
+{
+   m_maxRoundRobinSize = new_size;
+
+#ifdef DYNAMICALLY_ALLOCATE_ROUND_ROBIN
+   // Resize the round robin, preserves at least the first entry if any:
+   if (new_size < m_dbRoundRobin.size())
+      m_dbRoundRobin.resize(new_size);
+#else
+   // OLK 02/2015 -- Was hoping to dynamically allocate the round robin as needed but was running
+   // into issues, so just allocating full set here (containing empty lists at this point). The
+   // heavy lifting is in addDatabase() where copies are made for each entry in the round robin. It
+   // would have been best to keep the size of the round robin to an as-needed basis to avoid
+   // unnecessary duplicate lists. However, this is only relevant for small apps (like ossim-info)
+   // where minimal number of elevation look-ups are done. TODO: Figure out why MT run core dumps
+   // when dynamically sizing m_dbRoundRobin.
+   m_dbRoundRobin.resize(new_size);
+#endif
+
+}
+
+inline ossimElevManager::ElevationDatabaseListType& ossimElevManager::getNextElevDbList() const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock (m_mutex);
+
+   // Quickly grab the DB to be used by this thread and increment DB index to be used by next thread
+   // May need to grow the list round robin as it is dynamically set as needed):
+   if (m_currentDatabaseIdx >= m_dbRoundRobin.size())
+   {
+      ossim_uint32 index = m_dbRoundRobin.size();
+      m_dbRoundRobin.resize(index+1);
+
+      // An entry existed prior, duplicate its contents for all Db lists in the round robin. Only
+      // duplicate as needed beyond what already existed:
+      ElevationDatabaseListType::iterator iter = m_dbRoundRobin[0].begin();
+      while (iter != m_dbRoundRobin[0].end())
+      {
+         ossimRefPtr<ossimElevationDatabase> dupDb = (ossimElevationDatabase*) (*iter)->dup();
+         m_dbRoundRobin[index].push_back(dupDb);
+         ++iter;
+      }
+   }
+
+   ossim_uint32 index = m_currentDatabaseIdx++;
+   if (m_currentDatabaseIdx == m_maxRoundRobinSize)
+      m_currentDatabaseIdx = 0;
+
+   return m_dbRoundRobin[index];
+}
+
+void ossimElevManager::addDatabase(ossimElevationDatabase* database, bool set_as_first)
+{
+   if(!database)
+      return;
+
+   if (m_dbRoundRobin.empty())
+      m_dbRoundRobin.resize(1);
+
+   std::vector<ElevationDatabaseListType>::iterator rri = m_dbRoundRobin.begin();
+   if (std::find(rri->begin(), rri->end(), database) == rri->end())
+   {
+      if (set_as_first)
+         rri->insert(rri->begin(), database);
+      else
+         rri->push_back(database);
+
+      // Populate the parallel lists in the round-robin with duplicates:
+      ++rri;
+      while ( rri != m_dbRoundRobin.end() )
+      {
+         ossimRefPtr<ossimElevationDatabase> dupDb = (ossimElevationDatabase*) database->dup();
+         if (set_as_first)
+            rri->insert(rri->begin(), dupDb);
+         else
+            rri->push_back(dupDb);
+         ++rri;
+      }
+   }
+}
+
+double ossimElevManager::getMeanSpacingMeters() const
+{
+   double spacing = ossim::nan();
+   if ( m_dbRoundRobin.size() )
+   {
+       ElevationDatabaseListType& elevDbList = m_dbRoundRobin[0];
+      for(ossim_uint32 idx = 0;(idx < elevDbList.size()); ++idx)
+      {
+         double d_idx = elevDbList[idx]->getMeanSpacingMeters();
+         if (ossim::isnan(spacing) || (d_idx < spacing))
+         {
+            spacing = d_idx;
+         }
+      }
+   }
+   return spacing;
+}
+
+std::ostream& ossimElevManager::print(ostream& out) const
+{
+   out << "\nossimElevManager @ "<< (ossim_uint64) this
+         << "\nm_defaultHeightAboveEllipsoid = "<<m_defaultHeightAboveEllipsoid
+         << "\nm_elevationOffset = "<<m_elevationOffset
+         << "\nm_useGeoidIfNullFlag = "<<m_useGeoidIfNullFlag
+         << "\nm_currentDatabaseIdx = "<<m_currentDatabaseIdx
+         << "\nm_dbRoundRobin.size = "<<m_dbRoundRobin.size();
+   for (ossim_uint32 i=0; i<m_dbRoundRobin.size(); ++i)
+   {
+      out<<"\nm_dbRoundRobin["<<i<<"].size = "<<m_dbRoundRobin[i].size()<<endl;
+      for (ossim_uint32 j=0; j<m_dbRoundRobin[i].size(); ++j)
+      {
+         out<<"m_dbRoundRobin["<<i<<"]["<<j<<"] = ";
+         // GP: We have to separate this line.  On MS it will not compile
+         // otherwise
+         m_dbRoundRobin[i][j]->print(out);
+
+      }
+         out<<endl;
+   }
+   out<<"\n";
+   ossimElevSource::print(out);
+   return out;
+}
+
diff --git a/src/elevation/ossimElevSource.cpp b/src/elevation/ossimElevSource.cpp
new file mode 100644
index 0000000..4f968c7
--- /dev/null
+++ b/src/elevation/ossimElevSource.cpp
@@ -0,0 +1,277 @@
+//*****************************************************************************
+// FILE: ossimElevSource.cc
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimElevSource. This is the base class
+//   for all sources of elevation data. it maintains a single common static
+//   instance of the geoid for use by all instances of objects derived from
+//   this one. 
+//
+// SOFTWARE HISTORY:
+//>
+//   18Apr2001  Oscar Kramer
+//              Initial coding.
+//<
+//*****************************************************************************
+// $Id: ossimElevSource.cpp 23117 2015-01-29 22:33:13Z okramer $
+
+#include <ossim/elevation/ossimElevSource.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimEcefRay.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+RTTI_DEF1(ossimElevSource, "ossimElevSource" , ossimSource)
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimElevSource:exec");
+static ossimTrace traceDebug ("ossimElevSource:debug");
+
+
+static const char ENABLE_STATS_KW[] = "elevation.compute_statistics.enabled";
+
+ossimElevSource::ossimElevSource()
+   :
+      theMinHeightAboveMSL (0.0),
+      theMaxHeightAboveMSL (0.0),
+      theNullHeightValue   (ossim::nan()),
+      theSeaLevelValue     (OSSIM_DEFAULT_MEAN_SEA_LEVEL),
+      theGroundRect(),
+      theComputeStatsFlag(false)
+   
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimElevSource::ossimElevSource: entering..."
+         << std::endl;
+   }
+   
+   // User can turn on off with a keyword.
+   const char* lookup =
+      ossimPreferences::instance()->findPreference(ENABLE_STATS_KW);
+   if (lookup)
+   {
+     theComputeStatsFlag = ossimString(lookup).toBool();
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG:"
+         << "\ntheComputeStatsFlag:  "
+         << (theComputeStatsFlag?"true":"false")
+         << endl;
+   }
+
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimElevSource::ossimElevSource: returning..."
+         << std::endl;
+   }
+}
+
+ossimElevSource::ossimElevSource(const ossimElevSource& src)
+   :ossimSource(src),
+    theMinHeightAboveMSL(src.theMinHeightAboveMSL),
+    theMaxHeightAboveMSL(src.theMaxHeightAboveMSL),
+    theNullHeightValue(src.theNullHeightValue),
+    theSeaLevelValue(src.theSeaLevelValue),
+    theGroundRect(src.theGroundRect),
+    theComputeStatsFlag(src.theComputeStatsFlag)
+{
+}
+
+ossimElevSource::~ossimElevSource()
+{}
+
+double ossimElevSource::getHeightAboveEllipsoid(const ossimGpt& /* argGpt */)
+{
+   ossimNotify(ossimNotifyLevel_FATAL)
+      << "FATAL ossimElevSource::getHeightAboveEllipsoid Not implemented..."
+      << std::endl;
+   return theNullHeightValue;
+}
+
+//*****************************************************************************
+//  METHOD: intersectRay()
+//  
+//  Service method for intersecting a ray with the elevation surface to
+//  arrive at a ground point. The ray is expected to originate ABOVE the
+//  surface and pointing down.
+//
+//  NOTE: the gpt argument is expected to be initialized with the desired
+//  datum, including ellipsoid, for the proper intersection point to be
+//  computed.
+//
+//  LIMITATION: This release supports only single valued solutions, i.e., it
+//  is possible a ray passing through one side of a mountain and out the other
+//  will return an intersection with the far side. Eventually, a more robust
+//  algorithm will be employed.
+//
+//*****************************************************************************
+bool ossimElevSource::intersectRay(const ossimEcefRay& ray, ossimGpt& gpt, double defaultElevValue)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: entering..." << std::endl;
+
+   static const double CONVERGENCE_THRESHOLD = 0.001; // meters
+   static const int    MAX_NUM_ITERATIONS    = 50;
+   
+   double          h_ellips; // height above ellipsoid
+   bool            intersected;
+   ossimEcefPoint  prev_intersect_pt (ray.origin());
+   ossimEcefPoint  new_intersect_pt;
+   double          distance;
+   bool            done = false;
+   int             iteration_count = 0;
+
+   if(ray.hasNans()) 
+   {
+      gpt.makeNan();
+      return false;
+   }
+   //***
+   // Set the initial guess for horizontal intersect position as the ray's
+   // origin, and establish the datum and ellipsoid:
+   //***
+   const ossimDatum*     datum     = gpt.datum();
+   const ossimEllipsoid* ellipsoid = datum->ellipsoid();
+//    double lat, lon, h;
+
+//    ellipsoid->XYZToLatLonHeight(ray.origin().x(),
+//                                 ray.origin().y(),
+//                                 ray.origin().z(),
+//                                 lat, lon, h);
+//    ossimGpt nadirGpt(lat, lon, h);
+
+//    std::cout << "nadir pt = " << nadirGpt << std::endl;
+   
+   gpt = ossimGpt(prev_intersect_pt, datum);
+
+   //
+   // Loop to iterate on ray intersection with variable elevation surface:
+   //
+   do
+   {
+      //
+      // Intersect ray with ellipsoid inflated by h_ellips:
+      //
+      h_ellips = getHeightAboveEllipsoid(gpt);
+      if ( ossim::isnan(h_ellips) ) h_ellips = defaultElevValue;
+      
+      intersected = ellipsoid->nearestIntersection(ray,
+                                                   h_ellips,
+                                                   new_intersect_pt);
+      if (!intersected)
+      {
+         //
+         // No intersection (looking over the horizon), so set ground point
+         // to NaNs:
+         //
+         gpt.makeNan();
+         done = true;
+      }
+      else
+      {
+         //
+         // Assign the ground point to the latest iteration's intersection
+         // point:
+         //
+         gpt = ossimGpt(new_intersect_pt, datum);
+         
+         //
+         // Determine if convergence achieved:
+         //
+         distance = (new_intersect_pt - prev_intersect_pt).magnitude();
+         if (distance < CONVERGENCE_THRESHOLD)
+            done = true;
+         else
+         {
+            prev_intersect_pt = new_intersect_pt;
+         }
+      }
+
+      iteration_count++;
+
+   } while ((!done) && (iteration_count < MAX_NUM_ITERATIONS));
+
+   if (iteration_count == MAX_NUM_ITERATIONS)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimElevSource::intersectRay: Max number of iterations reached solving for ground "
+                                            << "point. Result is probably inaccurate." << std::endl;
+      }
+   }
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimElevSource::intersectRay: returning..." << std::endl;
+   return intersected;
+}
+
+double ossimElevSource::getMinHeightAboveMSL() const
+{
+   return theMinHeightAboveMSL;
+}
+
+double ossimElevSource::getMaxHeightAboveMSL() const
+{
+   return theMaxHeightAboveMSL;
+}
+
+double ossimElevSource::getNullHeightValue() const
+{
+   return theNullHeightValue;
+}
+
+double ossimElevSource::getSeaLevelValue() const
+{
+   return theSeaLevelValue;
+}
+
+const ossimGrect& ossimElevSource::getBoundingGndRect() const
+{
+   return theGroundRect;
+}
+
+bool ossimElevSource::canConnectMyInputTo(ossim_int32 /* inputIndex */,
+                                          const ossimConnectableObject* /* object */)const
+{
+   return false;
+}
+
+void ossimElevSource::initialize()
+{}
+
+
+bool ossimElevSource::getComputeStatisticsFlag() const
+{
+   return theComputeStatsFlag;
+}
+
+void ossimElevSource::setComputeStatisticsFlag(bool flag)
+{
+   theComputeStatsFlag = flag;
+}
+
+std::ostream& ossimElevSource::print(std::ostream& out) const
+{
+   out << "\nossimElevSource @ "<< (ossim_uint64) this
+         << "\ntheMinHeightAboveMSL = "<<theMinHeightAboveMSL
+         << "\ntheMaxHeightAboveMSL = "<<theMaxHeightAboveMSL
+         << "\ntheNullHeightValue = "<<theNullHeightValue
+         << "\ntheSeaLevelValue = "<<theSeaLevelValue
+         << "\ntheGroundRect = "<<theGroundRect;
+         // GP: need this by itself.  MS errors out
+         ossimSource::print(out);
+   return out;
+}
+
diff --git a/src/elevation/ossimElevSourceFactory.cpp b/src/elevation/ossimElevSourceFactory.cpp
new file mode 100644
index 0000000..62d7369
--- /dev/null
+++ b/src/elevation/ossimElevSourceFactory.cpp
@@ -0,0 +1,43 @@
+//----------------------------------------------------------------------------
+// FILE: ossimElevSourceFactory.cc
+//
+// Copyright (C) 2002 ImageLinks, Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class definition for ossimElevSourceFactory.
+//
+// This is the base class interface for elevation source factories.  Contains
+// pure virtual methods that all elevation source factories must implement.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimElevSourceFactory.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/elevation/ossimElevSourceFactory.h>
+
+RTTI_DEF1(ossimElevSourceFactory, "ossimElevSourceFactory" , ossimObject)
+
+ossimElevSourceFactory::ossimElevSourceFactory()
+   : theDirectory(ossimFilename::NIL)
+{
+}
+
+ossimElevSourceFactory::~ossimElevSourceFactory()
+{
+}
+
+ossimFilename ossimElevSourceFactory::getDirectory() const
+{
+   return theDirectory;
+}
+
+void ossimElevSourceFactory::setDirectory(const ossimFilename& directory)
+{
+   theDirectory = directory;
+}
diff --git a/src/elevation/ossimElevationCellDatabase.cpp b/src/elevation/ossimElevationCellDatabase.cpp
new file mode 100644
index 0000000..53c0ba8
--- /dev/null
+++ b/src/elevation/ossimElevationCellDatabase.cpp
@@ -0,0 +1,222 @@
+#include <ossim/elevation/ossimElevationCellDatabase.h>
+
+RTTI_DEF1(ossimElevationCellDatabase, "ossimElevationCellDatabase", ossimElevationDatabase);
+
+void ossimElevationCellDatabase::getOpenCellList(std::vector<ossimFilename>& list) const
+{
+   CellMap::const_iterator iter = m_cacheMap.begin();
+
+   while(iter!=m_cacheMap.end())
+   {
+      if ( iter->second->m_handler.valid() )
+      {
+         list.push_back(iter->second->m_handler->getFilename());
+      }
+      ++iter;
+   }
+
+}
+
+void ossimElevationCellDatabase::getCellsForBounds( const ossim_float64& minLat,
+                                                    const ossim_float64& minLon,
+                                                    const ossim_float64& maxLat,
+                                                    const ossim_float64& maxLon,
+                                                    std::vector<ossimFilename>& cells,
+                                                    ossim_uint32 maxNumberOfCells )
+{
+   const ossim_float64 SEARCH_SPACING = 0.1;
+   ossimGpt gpt(0.0, 0.0, 0.0);
+   ossimFilename f;
+   ossim_uint32 limitNumberOfCells = maxNumberOfCells>0?maxNumberOfCells:999999999;
+   // Latitude loop:
+   ossim_float64 lat = minLat;
+   while ( (lat <= maxLat) &&(cells.size() < limitNumberOfCells))
+   {
+      gpt.lat = lat;
+
+      // Longitude loop:
+      ossim_float64 lon = minLon;
+      while ( (lon <= maxLon ) &&(cells.size()< limitNumberOfCells))
+      {
+         gpt.lon = lon;
+
+         ossimRefPtr<ossimElevCellHandler> h = getOrCreateCellHandler( gpt );
+         if ( h.valid() )
+         {
+            // Get the file name:
+            f = h->getFilename();
+            
+            if ( f.size() )
+            {
+               // See if it's already in the list, i.e. duplicate:
+               std::vector<ossimFilename>::const_iterator i = cells.begin();
+               while ( i != cells.end() )
+               {
+                  if ( f == (*i) )
+                  {
+                     break;
+                  }
+                  ++i;
+               }
+               
+               if ( i == cells.end() )
+               {
+                  // Add it to the list:
+                  cells.push_back( f );
+               }
+            }
+         }
+
+         if ( lon < maxLon )
+         {
+            lon = ossim::min<ossim_float64>( (lon+SEARCH_SPACING), maxLon );
+         }
+         else
+         {
+            break;
+         }
+         
+      } // Matches: while ( lon <= maxLon )
+
+      if ( lat < maxLat )
+      {
+         lat = ossim::min<ossim_float64>( (lat+SEARCH_SPACING), maxLat );
+      }
+      else
+      {
+         break;
+      }
+      
+   } // Matches: while ( lat <= maxLat )
+   
+} // End: ossimElevationCellDatabase::getCellsForBounds( ... )
+
+/* 
+ * New code caches null handlers so that createCell() is not called
+ * unnecessarily. drb - 20170509
+ */
+#if 1 
+ossimRefPtr<ossimElevCellHandler> ossimElevationCellDatabase::getOrCreateCellHandler(
+   const ossimGpt& gpt)
+{
+   ossimRefPtr<ossimElevCellHandler> result = 0;
+
+   ossim_uint64 id = createId(gpt);
+
+   m_cacheMapMutex.lock();
+
+   CellMap::iterator iter = m_cacheMap.find(id);
+   if(iter != m_cacheMap.end())
+   {
+      iter->second->updateTimestamp();
+      result = iter->second->m_handler.get();
+   }
+   else
+   {
+      m_cacheMapMutex.unlock();                                                                  
+
+      result = createCell(gpt);
+
+      m_cacheMapMutex.lock();
+
+      //---
+      // Code speed up:
+      // Add it to the cache even if it's not valid so this database will not
+      // call createCell(...) again.
+      //--- 
+      m_cacheMap.insert(std::make_pair(id, new CellInfo(id, result.get())));
+      
+      // Check the map size and purge cells if needed.
+      if(m_cacheMap.size() > m_maxOpenCells)
+      {
+         flushCacheToMinOpenCells();
+      }
+   }
+
+   m_cacheMapMutex.unlock();
+              
+   return result;
+}
+#else
+ossimRefPtr<ossimElevCellHandler> ossimElevationCellDatabase::getOrCreateCellHandler(const ossimGpt& gpt)
+{
+  ossimRefPtr<ossimElevCellHandler> result = 0;
+  ossim_uint64 id = createId(gpt);
+  
+  {
+    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex);
+    CellMap::iterator iter = m_cacheMap.find(id);
+    if(iter != m_cacheMap.end())
+    {
+      iter->second->updateTimestamp();
+      result = iter->second->m_handler.get();
+      
+      return result.get();
+    }
+  }
+  
+  result = createCell(gpt);
+  
+  {
+    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex);
+    if(result.valid())
+    {
+      m_cacheMap.insert(std::make_pair(id, new CellInfo(id, result.get())));
+
+      // Check the map size and purge cells if needed.
+      if(m_cacheMap.size() > m_maxOpenCells)
+      {
+         flushCacheToMinOpenCells();
+      }
+    }
+  }
+
+  return result;
+}
+#endif
+
+bool ossimElevationCellDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   ossimString minOpenCells = kwl.find(prefix, "min_open_cells");
+   ossimString maxOpenCells = kwl.find(prefix, "max_open_cells");
+   if(!minOpenCells.empty()&&
+      !maxOpenCells.empty())
+   {
+      m_minOpenCells = minOpenCells.toUInt32();
+      m_maxOpenCells = maxOpenCells.toUInt32();
+      if(m_maxOpenCells < m_minOpenCells)
+      {
+         std::swap(m_minOpenCells, m_maxOpenCells);
+      }
+   }
+   ossimString memoryMapCellsFlag = kwl.find(prefix, "memory_map_cells");
+   if(!memoryMapCellsFlag.empty())
+   {
+      m_memoryMapCellsFlag = memoryMapCellsFlag.toBool();
+   }
+   return ossimElevationDatabase::loadState(kwl, prefix);
+}
+
+bool ossimElevationCellDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix, "memory_map_cells", m_memoryMapCellsFlag, true);
+   kwl.add(prefix, "min_open_cells", m_minOpenCells, true);
+   kwl.add(prefix, "max_open_cells", m_maxOpenCells, true);
+
+   if(m_geoid.valid())
+   {
+      kwl.add(prefix, "geoid.type", m_geoid->getShortName(), true);
+   }
+
+   return ossimElevationDatabase::saveState(kwl, prefix);
+}
+
+std::ostream& ossimElevationCellDatabase::print(ostream& out) const
+{
+   ossimKeywordlist kwl;
+   saveState(kwl);
+   out << "\nossimElevationCellDatabase @ "<< (ossim_uint64) this << kwl << ends;
+   return out;
+}
+
+
diff --git a/src/elevation/ossimElevationDatabase.cpp b/src/elevation/ossimElevationDatabase.cpp
new file mode 100644
index 0000000..9a40b43
--- /dev/null
+++ b/src/elevation/ossimElevationDatabase.cpp
@@ -0,0 +1,71 @@
+#include <ossim/elevation/ossimElevationDatabase.h>
+
+RTTI_DEF1(ossimElevationDatabase, "ossimElevationDatabase", ossimObject);
+
+double ossimElevationDatabase::getOffsetFromEllipsoid(const ossimGpt& gpt)
+{
+   double result = 0.0;
+   if(m_geoid.valid())
+   {
+      result = m_geoid->offsetFromEllipsoid(gpt);
+   }
+   else 
+   {
+      result = ossimGeoidManager::instance()->offsetFromEllipsoid(gpt);
+   }
+   
+   if(ossim::isnan(result))
+   {
+      result = 0.0;
+   }
+   
+   return result;
+}
+
+bool ossimElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // Connection string:
+   m_connectionString = kwl.find(prefix, "connection_string");
+   if(m_connectionString.empty())
+   {
+      // Try backward compatability to a filename:
+      m_connectionString = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   }
+
+   // Geoid:
+   ossimString value = kwl.find(prefix, "geoid.type");
+   if( value.size() )
+   {
+      m_geoid = ossimGeoidManager::instance()->findGeoidByShortName(value);
+   }
+   
+   // Mean spacing:
+   value = kwl.find(prefix, "mean_spacing");
+   if( value.size() )
+   {
+      m_meanSpacing = value.toFloat64();
+   }
+   
+   return ossimSource::loadState(kwl, prefix);
+}
+
+bool ossimElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix, "connection_string", m_connectionString, true);
+   
+   if(m_geoid.valid())
+   {
+      kwl.add(prefix, "geoid.type", m_geoid->getShortName(), true);
+   }
+   
+   return ossimSource::saveState(kwl, prefix);
+}
+
+std::ostream& ossimElevationDatabase::print(ostream& out) const
+{
+   ossimKeywordlist kwl;
+   saveState(kwl);
+   out << "\nossimElevationDatabase @ "<< (ossim_uint64) this
+         << kwl <<ends;
+   return out;
+}
diff --git a/src/elevation/ossimElevationDatabaseFactory.cpp b/src/elevation/ossimElevationDatabaseFactory.cpp
new file mode 100644
index 0000000..83cae12
--- /dev/null
+++ b/src/elevation/ossimElevationDatabaseFactory.cpp
@@ -0,0 +1,112 @@
+#include <ossim/elevation/ossimElevationDatabaseFactory.h>
+#include <ossim/elevation/ossimElevationDatabase.h>
+#include <ossim/elevation/ossimDtedElevationDatabase.h>
+#include <ossim/elevation/ossimSrtmElevationDatabase.h>
+#include <ossim/elevation/ossimGeneralRasterElevationDatabase.h>
+#include <ossim/elevation/ossimImageElevationDatabase.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+ossimElevationDatabaseFactory* ossimElevationDatabaseFactory::m_instance = 0;
+ossimElevationDatabaseFactory* ossimElevationDatabaseFactory::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossimElevationDatabaseFactory();
+   }
+   
+   return m_instance;
+}
+
+ossimElevationDatabase* ossimElevationDatabaseFactory::createDatabase(const ossimString& typeName)const
+{
+   if((typeName == STATIC_TYPE_NAME(ossimDtedElevationDatabase)) ||
+      (typeName == "dted")||
+      (typeName == "dted_directory"))
+      
+   {
+      return new ossimDtedElevationDatabase();
+   }
+   else if((typeName == STATIC_TYPE_NAME(ossimSrtmElevationDatabase)) ||
+           (typeName == "srtm")||
+           (typeName == "srtm_directory"))
+      
+   {
+      return new ossimSrtmElevationDatabase();
+   }
+   else if((typeName == STATIC_TYPE_NAME(ossimGeneralRasterElevationDatabase)) ||
+           (typeName == "general_raster")||
+           (typeName == "general_raster_directory"))
+      
+   {
+      return new ossimGeneralRasterElevationDatabase();
+   }
+   else if( (typeName == "ossimImageElevationDatabase") ||
+            (typeName == "image_directory"))
+      
+   {
+      return new ossimImageElevationDatabase();
+   }
+   
+   return 0;
+}
+
+ossimElevationDatabase* ossimElevationDatabaseFactory::createDatabase(const ossimKeywordlist& kwl,
+                                                                      const char* prefix)const
+{
+   ossimRefPtr<ossimElevationDatabase> result = 0;
+   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if(!type.empty())
+   {
+      result = createDatabase(type);
+      if(result.valid())
+      {
+         if(!result->loadState(kwl, prefix))
+         {
+            result = 0;
+         }
+      }
+   }
+   
+   return result.release();
+}
+
+ossimElevationDatabase* ossimElevationDatabaseFactory::open(const ossimString& connectionString)const
+{
+   ossimRefPtr<ossimElevationDatabase> result = 0;
+   do
+   {
+      result = new ossimDtedElevationDatabase();
+      if (result->open(connectionString))
+         break;
+
+      result = new ossimSrtmElevationDatabase;
+      if (result->open(connectionString))
+         break;
+
+      result = new ossimGeneralRasterElevationDatabase;
+      if (result->open(connectionString))
+         break;
+
+      // This method will only open individual image files for use as dems. It will not utilize the
+      // file walker to search over directories:
+      ossimFilename filename (connectionString);
+      if (filename.isFile())
+      {
+         result = new ossimImageElevationDatabase;
+         if (result->open(connectionString))
+            break;
+      }
+
+      result = 0;
+   } while (0);
+
+   return result.release();
+}
+
+void ossimElevationDatabaseFactory::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   typeList.push_back(STATIC_TYPE_NAME(ossimDtedElevationDatabase));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSrtmElevationDatabase));
+   typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterElevationDatabase));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageElevationDatabase));
+}
diff --git a/ossim/src/ossim/elevation/ossimElevationDatabaseRegistry.cpp b/src/elevation/ossimElevationDatabaseRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/elevation/ossimElevationDatabaseRegistry.cpp
rename to src/elevation/ossimElevationDatabaseRegistry.cpp
diff --git a/ossim/src/ossim/elevation/ossimGeneralRasterElevFactory.cpp b/src/elevation/ossimGeneralRasterElevFactory.cpp
similarity index 100%
rename from ossim/src/ossim/elevation/ossimGeneralRasterElevFactory.cpp
rename to src/elevation/ossimGeneralRasterElevFactory.cpp
diff --git a/ossim/src/ossim/elevation/ossimGeneralRasterElevHandler.cpp b/src/elevation/ossimGeneralRasterElevHandler.cpp
similarity index 100%
rename from ossim/src/ossim/elevation/ossimGeneralRasterElevHandler.cpp
rename to src/elevation/ossimGeneralRasterElevHandler.cpp
diff --git a/ossim/src/ossim/elevation/ossimGeneralRasterElevationDatabase.cpp b/src/elevation/ossimGeneralRasterElevationDatabase.cpp
similarity index 100%
rename from ossim/src/ossim/elevation/ossimGeneralRasterElevationDatabase.cpp
rename to src/elevation/ossimGeneralRasterElevationDatabase.cpp
diff --git a/ossim/src/ossim/elevation/ossimHgtRef.cpp b/src/elevation/ossimHgtRef.cpp
similarity index 100%
rename from ossim/src/ossim/elevation/ossimHgtRef.cpp
rename to src/elevation/ossimHgtRef.cpp
diff --git a/src/elevation/ossimImageElevationDatabase.cpp b/src/elevation/ossimImageElevationDatabase.cpp
new file mode 100644
index 0000000..a7b5626
--- /dev/null
+++ b/src/elevation/ossimImageElevationDatabase.cpp
@@ -0,0 +1,474 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimImageElevationDatabase.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  See class desciption in header file.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/elevation/ossimImageElevationDatabase.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/elevation/ossimImageElevationHandler.h>
+#include <ossim/util/ossimFileWalker.h>
+#include <cmath>
+
+static ossimTrace traceDebug(ossimString("ossimImageElevationDatabase:debug"));
+
+RTTI_DEF1(ossimImageElevationDatabase, "ossimImageElevationDatabase", ossimElevationCellDatabase);
+
+ossimImageElevationDatabase::ossimImageElevationDatabase()
+   :
+   ossimElevationCellDatabase(),
+   ossimFileProcessorInterface(),
+   m_entryMap(),
+   m_lastMapKey(0),
+   m_lastAccessedId(0)
+{
+}
+
+// Protected destructor as this is derived from ossimRefenced.
+ossimImageElevationDatabase::~ossimImageElevationDatabase()
+{
+}
+
+bool ossimImageElevationDatabase::open(const ossimString& connectionString)
+{
+   // return false; // tmp drb...
+   
+   static const char M[] = "ossimImageElevationDatabase::open";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n"
+         << "\nConnection string: " << connectionString << "\n";
+   }                   
+   
+   bool result = false;
+
+   close();
+
+   if ( connectionString.size() )
+   {
+      m_connectionString = connectionString.c_str();
+
+      loadFileMap();
+
+      if ( m_entryMap.size() )
+      {
+         result = true;
+      }
+      else
+      {
+         m_connectionString.clear();
+      }
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
+   }
+
+   return result;
+}
+
+void ossimImageElevationDatabase::close()
+{
+   m_meanSpacing = 0.0;
+   m_geoid = 0;
+   m_connectionString.clear();
+}
+
+double ossimImageElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
+{
+   double h = ossim::nan();
+   if(isSourceEnabled())
+   {
+      ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt);
+      if(handler.valid())
+      {
+         h = handler->getHeightAboveMSL(gpt); // still need to shift
+
+         // Save the elev source's post spacing as the database's mean spacing:
+         m_meanSpacing = handler->getMeanSpacingMeters();
+      }
+   }
+
+   return h;
+}
+
+double ossimImageElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
+{
+   double h = getHeightAboveMSL(gpt);
+   if(!ossim::isnan(h))
+   {
+      h += getOffsetFromEllipsoid(gpt);
+   }
+   return h;
+}
+
+ossimRefPtr<ossimElevCellHandler> ossimImageElevationDatabase::createCell(
+   const ossimGpt& gpt)
+{
+   ossimRefPtr<ossimElevCellHandler> result = 0;
+   
+   // Need to disable elevation while loading the DEM image to prevent recursion:
+   disableSource();
+
+   std::map<ossim_uint64, ossimImageElevationFileEntry>::iterator i = m_entryMap.begin();
+   while ( i != m_entryMap.end() )
+   {
+      if ( (*i).second.m_loadedFlag == false )
+      {
+         // not loaded
+         ossimRefPtr<ossimImageElevationHandler> h = new ossimImageElevationHandler();
+
+         if ( (*i).second.m_rect.isLonLatNan() )
+         {
+            if ( h->open( (*i).second.m_file ) )
+            {
+               // First time opened.  Capture the rectangle. for next time.
+               (*i).second.m_rect = h->getBoundingGndRect();
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimImageElevationDatabase::createCell WARN:\nCould not open: "
+                  << (*i).second.m_file << "\nRemoving file from map!" << std::endl;
+
+               // Get a copy of the iterator to delet.
+               std::map<ossim_uint64, ossimImageElevationFileEntry>::iterator badIter = i;
+               
+               ++i; // Go to next image.
+
+               // Must put lock around erase.
+               m_cacheMapMutex.lock();
+               m_entryMap.erase(badIter);
+               m_cacheMapMutex.unlock();
+               
+               continue; // Skip the rest of this loop.
+            }
+         }
+
+         // Check the North up bounding rectangle for intersect.
+         if ( (*i).second.m_rect.pointWithin(gpt) )
+         {
+            if ( h->isOpen() == false )
+            {
+               h->open( (*i).second.m_file );
+            }
+
+            if ( h->isOpen() )
+            {
+               //---
+               // Check point coverage again as image may not be geographic and pointHasCoverage
+               // has a check on worldToLocal point.
+               //---
+               if (  h->pointHasCoverage(gpt) )
+               {
+                  m_lastAccessedId = (*i).first;
+                  (*i).second.m_loadedFlag = true;
+                  result = h.get();
+                  break;
+               }
+               else
+               {
+                  h = 0;
+               }
+            }
+         }
+         else
+         {
+            h = 0;
+         }
+      }
+
+      ++i;
+   }
+   
+   enableSource();
+   return result;
+}
+
+ossimRefPtr<ossimElevCellHandler> ossimImageElevationDatabase::getOrCreateCellHandler(
+   const ossimGpt& gpt)
+{
+   ossimRefPtr<ossimElevCellHandler> result = 0;
+   
+   // Note: Must do mutex lock / unlock around any cach map access.
+   m_cacheMapMutex.lock();
+
+   if ( m_cacheMap.size() )
+   {
+      //---
+      // Look in existing map for handler.
+      //
+      // Note: Cannot key off of id from gpt as cells can be any arbituary dimensions.
+      //---
+
+      CellMap::iterator lastAccessedCellIter = m_cacheMap.find(m_lastAccessedId);
+      CellMap::iterator iter = lastAccessedCellIter;
+        
+      // Check from last accessed to end.
+      while ( iter != m_cacheMap.end() )
+      {
+         if ( iter->second->m_handler->pointHasCoverage(gpt) )
+         {
+            result = iter->second->m_handler.get();
+            break;
+         }
+         ++iter;
+      }
+     
+      if ( result.valid() == false )
+      {
+         iter = m_cacheMap.begin();
+              
+         // Beginning to last accessed.
+         while ( iter != lastAccessedCellIter)
+         {
+            if ( iter->second->m_handler->pointHasCoverage(gpt) )
+            {
+               result = iter->second->m_handler.get();
+               break;
+            }
+            ++iter;
+         }
+      }
+
+      if ( result.valid() )
+      {
+         m_lastAccessedId  = iter->second->m_id;
+         iter->second->updateTimestamp();
+      }
+   }
+   m_cacheMapMutex.unlock();
+  
+   if ( result.valid() == false )
+   {
+      // Not in m_cacheMap.  Create a new cell for point if we have coverage.
+      result = createCell(gpt);
+
+      if(result.valid())
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMapMutex);
+
+         //---
+         // Add the cell to map.
+         // NOTE: ossimImageElevationDatabase::createCell sets m_lastAccessedId to that of
+         // the entries map key.
+         //---
+         m_cacheMap.insert(std::make_pair(m_lastAccessedId,
+                                          new CellInfo(m_lastAccessedId, result.get())));
+
+         ++m_lastMapKey;
+
+         // Check the map size and purge cells if needed.
+         if(m_cacheMap.size() > m_maxOpenCells)
+         {
+            flushCacheToMinOpenCells();
+         }
+      }
+   }
+
+   return result;
+}
+
+bool ossimImageElevationDatabase::pointHasCoverage(const ossimGpt& gpt) const
+{
+   //---
+   // NOTE:
+   //
+   // The bounding rect is the North up rectangle.  So if the underlying image projection is not
+   // a geographic projection and there is a rotation this could return false positives.  Inside
+   // the ossimImageElevationDatabase::createCell there is a call to
+   // ossimImageElevationHandler::pointHasCoverage which does a real check from the
+   // ossimImageGeometry of the image.
+   //---
+   bool result = false;
+   std::map<ossim_uint64, ossimImageElevationFileEntry>::const_iterator i = m_entryMap.begin();
+   while ( i != m_entryMap.end() )
+   {
+      if ( (*i).second.m_rect.pointWithin(gpt) )
+      {
+         result = true;
+         break;
+      }
+      ++i;
+   }
+   return result;
+}
+
+
+void ossimImageElevationDatabase::getBoundingRect(ossimGrect& rect) const
+{
+   // The bounding rect is the North up rectangle.  So if the underlying image projection is not
+   // a geographic projection and there is a rotation this will include null coverage area.
+   rect.makeNan();
+   std::map<ossim_uint64, ossimImageElevationFileEntry>::const_iterator i = m_entryMap.begin();
+   ossimGrect subRect;
+   while ( i != m_entryMap.end() )
+   {
+      subRect = i->second.m_rect;
+      if (subRect.isLonLatNan())
+      {
+         // The DEM source was not yet initialized:
+         ossimRefPtr<ossimImageElevationHandler> h = new ossimImageElevationHandler();
+         if ( h->open( i->second.m_file ) )
+            subRect = h->getBoundingGndRect();
+         else
+         {
+            ++i;
+            continue;
+         }
+      }
+      if (rect.isLonLatNan())
+         rect = subRect;
+      else
+         rect = rect.combine(subRect);
+      ++i;
+   }
+}
+
+
+bool ossimImageElevationDatabase::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
+{
+   if(pointHasCoverage(gpt))
+   {
+     info.m_surfaceName = "Image Elevation";
+   }
+
+   return false;
+}
+
+bool ossimImageElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   static const char M[] = "ossimImageElevationDatabase::loadState";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered..." << "\nkwl:\n" << kwl << "\n";
+   }     
+   bool result = false;
+   const char* lookup = kwl.find(prefix, "type");
+   if ( lookup )
+   {
+      std::string type = lookup;
+      if ( ( type == "image_directory" ) || ( type == "ossimImageElevationDatabase" ) )
+      {
+         result = ossimElevationCellDatabase::loadState(kwl, prefix);
+
+         if ( result )
+         {
+            loadFileMap();
+         }
+      }
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
+   }
+
+   return result;
+}
+
+bool ossimImageElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimElevationCellDatabase::saveState(kwl, prefix);
+}
+
+void ossimImageElevationDatabase::processFile(const ossimFilename& file)
+{
+   static const char M[] = "ossimImageElevationDatabase::processFile";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "file: " << file << "\n";
+   }
+
+   // Add the file.
+   m_entryMap.insert( std::make_pair(m_lastMapKey++, ossimImageElevationFileEntry(file)) );
+
+   if(traceDebug())
+   {
+      // Since ossimFileWalker is threaded output the file so we know which job exited.
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
+   } 
+}
+
+void ossimImageElevationDatabase::loadFileMap()
+{
+   if ( m_connectionString.size() )
+   {
+      // Create a file walker which will find files we can load from the connection string.
+      ossimFileWalker* fw = new ossimFileWalker();
+      
+      fw->initializeDefaultFilterList();
+
+      // This links the file walker back to our "processFile" method.
+      fw->setFileProcessor( this );
+      
+      ossimFilename f = m_connectionString;
+
+      // ossimFileWalker::walk will in turn call back to processFile method for each file it finds.
+      fw->walk(f); 
+      
+      delete fw;
+      fw = 0;
+   }
+}
+
+// Hidden from use:
+ossimImageElevationDatabase::ossimImageElevationDatabase(const ossimImageElevationDatabase& copy)
+: ossimElevationCellDatabase(copy)
+{
+   m_entryMap = copy.m_entryMap;
+   m_lastMapKey = copy.m_lastMapKey;
+   m_lastAccessedId = copy.m_lastAccessedId;
+}
+
+// Private container class:
+ossimImageElevationDatabase::ossimImageElevationFileEntry::ossimImageElevationFileEntry()
+   : m_file(),
+     m_rect(),
+     m_loadedFlag(false)
+{
+   m_rect.makeNan();
+}
+
+// Private container class:
+ossimImageElevationDatabase::ossimImageElevationFileEntry::ossimImageElevationFileEntry(
+   const ossimFilename& file)
+   : m_file(file),
+     m_rect(),
+     m_loadedFlag(false)
+{
+   m_rect.makeNan();
+}
+
+ossimImageElevationDatabase::ossimImageElevationFileEntry::ossimImageElevationFileEntry
+(const ossimImageElevationFileEntry& copy_this)
+   : m_file(copy_this.m_file),
+     m_rect(copy_this.m_rect),
+     m_loadedFlag(copy_this.m_loadedFlag)
+{
+}
+
+std::ostream& ossimImageElevationDatabase::print(ostream& out) const
+{
+   ossimKeywordlist kwl;
+   saveState(kwl);
+   out << "\nossimImageElevationDatabase @ "<< (ossim_uint64) this << "\n"
+         << kwl <<ends;
+   return out;
+}
+
diff --git a/src/elevation/ossimImageElevationHandler.cpp b/src/elevation/ossimImageElevationHandler.cpp
new file mode 100644
index 0000000..c6bbd77
--- /dev/null
+++ b/src/elevation/ossimImageElevationHandler.cpp
@@ -0,0 +1,293 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimImageElevationHandler.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  See class desciption in header file.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/elevation/ossimImageElevationHandler.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <OpenThreads/ScopedLock>
+
+#include <iostream> // tmp drb
+using namespace std;
+
+#include <cmath>
+
+RTTI_DEF1(ossimImageElevationHandler, "ossimImageElevationHandler" , ossimElevCellHandler)
+
+// Define Trace flags for use within this file:
+static ossimTrace traceDebug ("ossimImageElevationHandler:debug");
+static const ossim_uint32 MAX_TILE_CACHE_SIZE = 32;
+
+ossimImageElevationHandler::ossimImageElevationHandler()
+   :
+   ossimElevCellHandler(),
+   m_rect(),
+   m_tileSize(256,256),
+   m_numTilesPerRow(0),
+   m_mutex()
+{
+   ossim::defaultTileSize(m_tileSize);
+}
+
+ossimImageElevationHandler::ossimImageElevationHandler(const ossimFilename& file)
+   :
+   ossimElevCellHandler(),
+   m_rect(),
+   m_tileSize(256,256),
+   m_numTilesPerRow(0),
+   m_mutex()
+{
+   ossim::defaultTileSize(m_tileSize);
+   open(file);
+}
+
+bool ossimImageElevationHandler::open(const ossimFilename& file)
+{
+   static const char M[] = "ossimImageElevationHandler::open";
+   
+   bool result = false;
+
+   if ( isOpen() ) close();
+   
+   if ( file.size() )
+   {
+      //---
+      // NOTE: The false passed to open is flag to NOT open overviews. If code is ever changed
+      // to go between reduced resolution levels this should be changed.
+      //---
+      m_ih = ossimImageHandlerRegistry::instance()->open(file, true, false);
+      if ( m_ih.valid() )
+      {
+         m_geom = m_ih->getImageGeometry();
+         if ( m_geom.valid() )
+         {
+            result = true;
+
+            // Image rect stored as a drect for ossimImageElevationHandler::pointHasCoverage
+            // method.
+            m_rect = ossimDrect(0.0, 0.0, m_ih->getNumberOfSamples()-1, m_ih->getNumberOfLines()-1);
+            m_numTilesPerRow = m_rect.width()/m_tileSize.x;
+            if (m_numTilesPerRow * m_tileSize.x != m_rect.width())
+               ++m_numTilesPerRow;
+
+            // Initialize base class stuff.
+            theFilename = file;
+
+            theMeanSpacing = (m_geom->getMetersPerPixel().x + m_geom->getMetersPerPixel().y) / 2.0;
+
+            // Set the ossimElevSource::theGroundRect
+            std::vector<ossimGpt> corner(4);
+            if ( m_geom->getCornerGpts(corner[0], corner[1], corner[2], corner[3]) )
+            {
+               ossimGpt ulGpt(corner[0]);
+               ossimGpt lrGpt(corner[0]);
+               for ( ossim_uint32 i = 1; i < 4; ++i )
+               {
+                  if ( corner[i].lon < ulGpt.lon ) ulGpt.lon = corner[i].lon;
+                  if ( corner[i].lat > ulGpt.lat ) ulGpt.lat = corner[i].lat;
+                  if ( corner[i].lon > lrGpt.lon ) lrGpt.lon = corner[i].lon;
+                  if ( corner[i].lat < lrGpt.lat ) lrGpt.lat = corner[i].lat;
+               }
+               theGroundRect = ossimGrect(ulGpt, lrGpt);
+            }
+            else
+            {
+               theGroundRect.makeNan();
+            }
+         }
+         // theAbsLE90 ???
+         // theAbsCE90 ???
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " DEBUG:"
+         << "\nmean spacing(meters): " << theMeanSpacing
+         << "\nunding rect: " << theGroundRect
+         << "\nreturn status: " << (result?"true\n":"false\n");
+   }
+         
+   return result;
+}
+
+
+ossimImageElevationHandler::~ossimImageElevationHandler()
+{
+   close();
+}
+
+double ossimImageElevationHandler::getHeightAboveMSL(const ossimGpt& gpt)
+{
+   double height = ossim::nan();
+
+   // Get the image point for the world point.
+   ossimDpt dpt;
+   m_geom->worldToLocal(gpt, dpt);
+
+   if  ( !m_rect.pointWithin(dpt) )
+      return height;
+
+   // Cast it to an int which will shift to nearest upper left post.
+   ossim_uint32 x0 = static_cast<ossim_uint32>(dpt.x);
+   ossim_uint32 y0 = static_cast<ossim_uint32>(dpt.y);
+
+   ossimRefPtr<ossimImageData> data = getTile(x0, y0);
+
+   // Check if we are at the bottom or right edge of the tile to move in one post:
+   ossimIpt data_lr = data->getImageRectangle().lr();
+   if (x0 == static_cast<ossim_uint32>(data_lr.x))
+      --x0;
+   if (y0 == static_cast<ossim_uint32>(data_lr.y))
+      --y0;
+
+   double p00 = data->getPix( ossimIpt(x0,   y0)   );
+   double p01 = data->getPix( ossimIpt(x0+1, y0)   );
+   double p10 = data->getPix( ossimIpt(x0,   y0+1) );
+   double p11 = data->getPix( ossimIpt(x0+1, y0+1) );
+
+   double xt0 = dpt.x - x0;
+   double yt0 = dpt.y - y0;
+   double xt1 = 1-xt0;
+   double yt1 = 1-yt0;
+
+   double w00 = xt1*yt1;
+   double w01 = xt0*yt1;
+   double w10 = xt1*yt0;
+   double w11 = xt0*yt0;
+
+   // Test for null posts and set the corresponding weights to 0:
+   const double NP = data->getNullPix(0);
+
+   if (p00 == NP)
+      w00 = 0.0;
+   if (p01 == NP)
+      w01 = 0.0;
+   if (p10 == NP)
+      w10 = 0.0;
+   if (p11 == NP)
+      w11 = 0.0;
+
+#if 0 /* Serious debug only... */
+   cout << "\np00:  " << p00
+         << "\np01:  " << p01
+         << "\np10:  " << p10
+         << "\np11:  " << p11
+         << "\nw00:  " << w00
+         << "\nw01:  " << w01
+         << "\nw10:  " << w10
+         << "\nw11:  " << w11
+         << endl;
+#endif
+
+   double sum_weights = w00 + w01 + w10 + w11;
+   if (sum_weights)
+      height = (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
+
+   return height;
+}
+
+ossimImageData* ossimImageElevationHandler::getTile(ossim_uint32 x, ossim_uint32 y) const
+{
+   // Establish the tile ID that this post belongs to:
+   ossim_uint32 u = x/m_tileSize.x;
+   ossim_uint32 v = y/m_tileSize.y;
+   ossim_uint32 tile_id = v*m_numTilesPerRow + u;
+
+   ossimRefPtr<ossimImageData> data = 0;
+
+   // Search for this tile in the cache:
+   OpenThreads::ScopedWriteLock lock (m_mutex);
+   vector<TileCacheEntry>::iterator iter = m_tileCache.begin();
+   while ((iter != m_tileCache.end()) && (iter->id != tile_id))
+      ++iter;
+
+   if (iter != m_tileCache.end())
+   {
+      // Found an entry in the cache:
+      data = iter->data;
+      if (iter != m_tileCache.begin())
+      {
+         // Need to move the entry to the top of the list (current most popular)
+         TileCacheEntry temp = *iter;
+         m_tileCache.erase(iter);
+         m_tileCache.insert(m_tileCache.begin(), temp);
+      }
+   }
+   else
+   {
+      // Didn't find the tile in the cache, read it from the handler and insert into the cache:
+      ossimIpt ul (u*m_tileSize.x, v*m_tileSize.y);
+      ossimIpt lr (ul.x + m_tileSize.x - 1, ul.y + m_tileSize.y - 1);
+      ossimIrect tileRect (ul, lr);
+      ossimRefPtr<ossimImageData> inData = m_ih->getTile(tileRect, 0 );
+      if (inData.valid())
+      {
+         // Always insert at beginning. Need to check for overflow:
+         data = (ossimImageData*) inData->dup();
+         data->assign(inData.get());
+         TileCacheEntry entry (tile_id, data.get());
+         if (m_tileCache.size() == MAX_TILE_CACHE_SIZE)
+            m_tileCache.pop_back();
+         m_tileCache.insert(m_tileCache.begin(), entry);
+      }
+   }
+
+   return data.get();
+}
+
+ossimIpt ossimImageElevationHandler::getSizeOfElevCell() const
+{
+   ossimIpt sz(0,0);
+   if ( m_ih.valid() )
+   {
+      sz.x = static_cast<ossim_int32>(m_ih->getNumberOfSamples(0));
+      sz.y = static_cast<ossim_int32>(m_ih->getNumberOfLines(0));
+   }
+   return sz;
+}
+
+double ossimImageElevationHandler::getPostValue(const ossimIpt& gridPt ) const
+{
+   double height = ossim::nan();
+   if ( m_rect.pointWithin(ossimDpt(gridPt)) )
+   {
+      ossimRefPtr<ossimImageData> data = getTile(gridPt.x, gridPt.y);
+      if ( data.valid() )
+      {
+         height = data->getPix(0, 0);
+         if (height == data->getNullPix(0))
+            height = ossim::nan();
+      }
+   }
+   return height;
+}
+
+ossimImageElevationHandler::ossimImageElevationHandler(const ossimImageElevationHandler& copy)
+{
+   *this = copy;
+}
+
+const ossimImageElevationHandler&
+ossimImageElevationHandler::operator=(const ossimImageElevationHandler& rhs)
+{
+   open(rhs.theFilename);
+   return *this;
+}
diff --git a/src/elevation/ossimSrtmElevationDatabase.cpp b/src/elevation/ossimSrtmElevationDatabase.cpp
new file mode 100644
index 0000000..70cd514
--- /dev/null
+++ b/src/elevation/ossimSrtmElevationDatabase.cpp
@@ -0,0 +1,264 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/elevation/ossimSrtmElevationDatabase.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimTrace.h>
+#include <sstream>
+#include <iomanip>
+#include <cstdlib> /* for abs(int) */
+
+static ossimTrace traceDebug("ossimSrtmElevationDatabase:debug");
+
+RTTI_DEF1(ossimSrtmElevationDatabase, "ossimSrtmElevationDatabase", ossimElevationCellDatabase);
+
+ossimSrtmElevationDatabase::ossimSrtmElevationDatabase()
+   :ossimElevationCellDatabase()
+{
+}
+
+ossimSrtmElevationDatabase::ossimSrtmElevationDatabase(const ossimSrtmElevationDatabase& rhs)
+   :ossimElevationCellDatabase(rhs)
+{
+}
+
+ossimSrtmElevationDatabase::~ossimSrtmElevationDatabase()
+{
+}
+
+ossimObject* ossimSrtmElevationDatabase::dup() const
+{
+   ossimSrtmElevationDatabase* duped = new ossimSrtmElevationDatabase( *this );
+   // duped->open(m_connectionString);
+   return duped;
+}
+
+double ossimSrtmElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
+{
+   if(isSourceEnabled())
+   {
+      ossimRefPtr<ossimElevCellHandler> handler = getOrCreateCellHandler(gpt);
+      if(handler.valid())
+      {
+         return handler->getHeightAboveMSL(gpt); // still need to shift
+      }
+   }
+   return ossim::nan();
+}
+
+double ossimSrtmElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
+{
+   double h = getHeightAboveMSL(gpt);
+   if(h != ossim::nan())
+   {
+      h += getOffsetFromEllipsoid(gpt);
+   }
+   
+   return h;
+}
+
+bool ossimSrtmElevationDatabase::open(const ossimString& connectionString)
+{
+   bool result = false;
+   ossimFilename file = ossimFilename(connectionString);
+   m_connectionString = connectionString;
+   result = openSrtmDirectory(file);
+   return result;
+}
+
+bool ossimSrtmElevationDatabase::getAccuracyInfo(ossimElevationAccuracyInfo& info, const ossimGpt& gpt) const
+{
+   bool result = false;
+   info.makeNan();
+
+   if(pointHasCoverage(gpt))
+   {
+      result = true;
+      if(m_meanSpacing > 100.0)
+      {
+         // 30 arc second
+         info.m_absoluteCE  = 20.0;
+         info.m_absoluteLE = 16.0;
+         info.m_surfaceName = "SRTM30";
+
+      }
+      else if (m_meanSpacing > 40.0)
+      {
+        // SRTM 3 arc
+         info.m_absoluteCE  = 20.0;
+         info.m_absoluteLE = 16.0;
+         info.m_surfaceName = "SRTM3";
+      }
+      else
+      {
+          // SRTM 1 arc
+         info.m_absoluteCE = 20.0;
+         info.m_absoluteLE = 10.0;
+         info.m_surfaceName = "SRTM1";
+       }
+   }
+
+   return result;
+}
+
+bool ossimSrtmElevationDatabase::openSrtmDirectory(const ossimFilename& dir)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Entered....\n";
+   }
+   if(!m_geoid.valid())
+   {
+      m_geoid = ossimGeoidManager::instance()->findGeoidByShortName("geoid1996", false);
+   }
+   
+   //---
+   // Sample format:
+   //            dir
+   //         |          |
+   //    N35W121.hgt N35W121.hgt
+   //---
+   ossim_uint32 count = 0;
+   ossim_uint32 maxCount = 25;
+   if (!dir.isDir())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Not a directory, leaving ... " << dir << "\n";
+      }
+      return false;
+   }
+   
+   ossimDirectory od(dir);
+   if (od.isOpened() == false)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Unable to open directory " << dir << ", Leaving ... \n";
+      }
+      return false;
+   }
+   
+   ossimFilename f;
+   //ossimSrtmSupportData sd;
+   ossimRefPtr<ossimSrtmHandler> handler = new ossimSrtmHandler;
+   if(od.getFirst(f, ossimDirectory::OSSIM_DIR_FILES))
+   {
+      do
+      {
+         ++count;
+         if(handler->open(f))
+         {
+            m_meanSpacing = handler->getMeanSpacingMeters(); 
+
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimSrtmElevationDatabase::open: Found file " << f << "\n";
+               if(!m_geoid.valid())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "ossimSrtmElevationDatabase::open: Unable to load goeid grid 1996 for SRTM database\n";
+               }
+            }
+            return true;
+         }
+      }while((od.getNext(f)) &&(count < maxCount));
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSrtmElevationDatabase::open: Leaving ... \n";
+   }
+   return false;
+}
+
+void ossimSrtmElevationDatabase::createRelativePath(ossimFilename& file, const ossimGpt& gpt)const
+{
+   int ilat =  static_cast<int>(floor(gpt.latd()));
+   if (ilat < 0)
+   {
+      file = "S";
+   }
+   else
+   {
+      file = "N";
+   }
+   
+   ilat = abs(ilat);
+   std::ostringstream  os1;
+   
+   os1 << std::setfill('0') << std::setw(2) <<ilat;
+   
+   file += os1.str().c_str();
+   
+   int ilon = static_cast<int>(floor(gpt.lond()));
+   
+   if (ilon < 0)
+   {
+      file += "W";
+   }
+   else
+   {
+      file += "E";
+   }
+   
+   ilon = abs(ilon);
+   std::ostringstream  os2;
+   os2 << std::setfill('0') << std::setw(3) << ilon;
+   
+   file += os2.str().c_str();
+   file.setExtension("hgt");
+}
+
+bool ossimSrtmElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix )
+{
+   return ossimElevationCellDatabase::loadState(kwl, prefix);
+
+#if 0 /* Avoid open which in turn opens files unnecessarily. (drb - 20170419) */
+   bool result = ossimElevationCellDatabase::loadState(kwl, prefix);
+   if(result)
+   {
+      if(!m_connectionString.empty()&&ossimFilename(m_connectionString).exists())
+      {
+         result = open(m_connectionString);
+      }
+      else
+      {
+         // can't open the connection because it does not exists or empty
+         result = false;
+      }
+   }
+   return result;
+#endif   
+}
+
+bool ossimSrtmElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   return ossimElevationCellDatabase::saveState(kwl, prefix);
+}
+
+ossimRefPtr<ossimElevCellHandler>
+ossimSrtmElevationDatabase::createCell(const ossimGpt& gpt)
+{
+   ossimRefPtr<ossimElevCellHandler> result = 0;
+   ossimFilename f;
+   createFullPath(f, gpt);
+   if(f.exists())
+   {
+      ossimRefPtr<ossimSrtmHandler> h = new ossimSrtmHandler();
+      if (h->open(f, m_memoryMapCellsFlag))
+      {
+         result = h.get();
+      }
+   }
+   return result;
+}
diff --git a/src/elevation/ossimSrtmFactory.cpp b/src/elevation/ossimSrtmFactory.cpp
new file mode 100644
index 0000000..32e8be1
--- /dev/null
+++ b/src/elevation/ossimSrtmFactory.cpp
@@ -0,0 +1,167 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Shuttle Radar Topography Mission (SRTM) factory to return an
+// ossimSrtmElevSource given a ground point.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimSrtmFactory.cpp 16123 2009-12-17 22:07:31Z dburken $
+
+#include <cstdlib> /* abs() */
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <ossim/elevation/ossimSrtmFactory.h>
+#include <ossim/elevation/ossimSrtmHandler.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/support_data/ossimSrtmFilename.h>
+#include <ossim/support_data/ossimSrtmSupportData.h>
+
+static ossimTrace traceDebug ("ossimSrtmFactory:debug");
+
+RTTI_DEF1(ossimSrtmFactory, "ossimSrtmFactory", ossimElevSourceFactory)
+
+ossimSrtmFactory::ossimSrtmFactory()
+   : ossimElevSourceFactory()
+{}
+
+ossimSrtmFactory::ossimSrtmFactory(const ossimFilename& dir)
+   : ossimElevSourceFactory()
+{
+   theDirectory = dir;
+}
+      
+ossimSrtmFactory::~ossimSrtmFactory()
+{}
+
+ossimElevSource* ossimSrtmFactory::getNewElevSource(const ossimGpt& gpt) const
+{
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimSrtmFactory::getNewElevSource: Entered..."
+         << std::endl;
+   }
+
+   ossimRefPtr<ossimElevCellHandler> srtmPtr;
+
+   if (theDirectory == ossimFilename::NIL)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "ossimSrtmFactory::getNewElevSource: "
+         << "SRTM directory has not been set!"
+         << "\nReturning null elevation source..."
+         << std::endl;
+      
+      return srtmPtr.release();
+   }
+
+   //---
+   // Build up a srtm file name.
+   //
+   // Standard for name is upper case 'N' and 'W' lower case "hgt" like:
+   // N27W081.hgt
+   //---
+   ossimFilename srtmFileBasename;
+
+   int ilat =  static_cast<int>(floor(gpt.latd()));
+   if (ilat < 0)
+   {
+      srtmFileBasename = "S";
+   }
+   else
+   {
+      srtmFileBasename = "N";
+   }
+
+   ilat = abs(ilat);
+   std::ostringstream  os1;
+   
+   os1 << std::setfill('0') << std::setw(2) <<ilat;
+   
+   srtmFileBasename += os1.str().c_str();
+
+   int ilon = static_cast<int>(floor(gpt.lond()));
+   
+   if (ilon < 0)
+   {
+      srtmFileBasename += "W";
+   }
+   else
+   {
+      srtmFileBasename += "E";
+   }
+
+   ilon = abs(ilon);
+   std::ostringstream  os2;
+   os2 << std::setfill('0') << std::setw(3) << ilon;
+   
+   srtmFileBasename += os2.str().c_str();
+   srtmFileBasename.setExtension(".hgt");
+
+   ossimFilename srtmFile = theDirectory.dirCat(srtmFileBasename);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimSrtmFactory::getNewElevSource:"
+         << "\nSearching for file:  " << srtmFile
+         << std::endl;
+   }
+
+   // ossimRefPtr<ossimIFStream> is = ossimStreamFactoryRegistry::instance()->
+   std::shared_ptr<ossim::ifstream> is = ossimStreamFactoryRegistry::instance()->
+      createIFStream(srtmFile, std::ios::in | std::ios::binary);
+
+   // Look for the file mix case, then all lower case, then all upper case.
+   if ( is )
+   {
+      if(is->fail())
+      {
+         // Try down casing the whole thing.
+         srtmFileBasename = srtmFileBasename.downcase();
+         srtmFile = theDirectory.dirCat(srtmFileBasename);
+         
+         is = ossimStreamFactoryRegistry::instance()->
+            createIFStream(srtmFile, std::ios::in | std::ios::binary);      
+         if ( is )
+         {
+            if(is->fail())
+            {
+               // OK, try upcasing the whole thing.
+               srtmFileBasename = srtmFileBasename.upcase();
+               srtmFile = theDirectory.dirCat(srtmFileBasename);
+               is =  ossimStreamFactoryRegistry::instance()->
+                  createIFStream(srtmFile, std::ios::in | std::ios::binary);
+            }
+         }
+      }
+   }
+
+   if ( is && (!is->fail()) )
+   {
+      // is->close();
+      is.reset();
+      srtmPtr = new ossimSrtmHandler();
+      if(srtmPtr->open(srtmFile)&&srtmPtr->pointHasCoverage(gpt) )
+      {
+         return srtmPtr.release();
+      }
+      else
+      {
+         srtmPtr = 0;
+      }
+   }
+   return srtmPtr.release();
+}
diff --git a/ossim/src/ossim/elevation/ossimSrtmHandler.cpp b/src/elevation/ossimSrtmHandler.cpp
similarity index 100%
rename from ossim/src/ossim/elevation/ossimSrtmHandler.cpp
rename to src/elevation/ossimSrtmHandler.cpp
diff --git a/src/elevation/ossimTiledElevationDatabase.cpp b/src/elevation/ossimTiledElevationDatabase.cpp
new file mode 100644
index 0000000..d642cea
--- /dev/null
+++ b/src/elevation/ossimTiledElevationDatabase.cpp
@@ -0,0 +1,659 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimTiledElevationDatabase.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: See class desciption in header file.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/elevation/ossimTiledElevationDatabase.h>
+#include <ossim/base/ossimDblGrid.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimOrthoImageMosaic.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/util/ossimFileWalker.h>
+#include <cmath>
+
+static ossimTrace traceDebug(ossimString("ossimTiledElevationDatabase:debug"));
+
+RTTI_DEF1(ossimTiledElevationDatabase, "ossimTiledElevationDatabase", ossimElevationDatabase);
+
+ossimTiledElevationDatabase::ossimTiledElevationDatabase()
+   :
+   ossimElevationDatabase(),
+   ossimFileProcessorInterface(), 
+   m_entries(0),
+   m_grid(0),
+   m_referenceProj(0),
+   m_requestedRect(),
+   m_entryListRect(),
+   m_fileWalker(0)
+{
+   m_requestedRect.makeNan();
+   m_entryListRect.makeNan();
+
+   //---
+   // Use the ossimElevSource::theGroundRect to hold the mapped rect expanded to even post
+   // boundaries.
+   //---
+   theGroundRect.makeNan();
+}
+
+// Protected destructor as this is derived from ossimRefenced.
+ossimTiledElevationDatabase::~ossimTiledElevationDatabase()
+{
+   m_referenceProj = 0;   
+   m_entries.clear();
+   if ( m_grid )
+   {
+      delete m_grid;
+      m_grid = 0;
+   }
+   if ( m_fileWalker )
+   {
+      delete m_fileWalker;
+      m_fileWalker = 0;
+   }
+}
+
+bool ossimTiledElevationDatabase::open(const ossimString& connectionString)
+{
+   static const char M[] = "ossimTiledElevationDatabase::open";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n"
+         << "\nConnection string: " << connectionString << "\n";
+   }                   
+   
+   bool result = false;
+
+   close();
+
+   if ( connectionString.size() )
+   {
+      m_connectionString = connectionString.c_str();
+      result = true;
+   }
+
+   if ( m_entries.size() ) result = true;
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
+   }
+
+   return result;
+}
+
+void ossimTiledElevationDatabase::close()
+{
+   m_entryListRect.makeNan();
+   m_requestedRect.makeNan();
+   theGroundRect.makeNan();
+   m_referenceProj = 0;
+   m_entries.clear();
+   if ( m_grid )
+   {
+      delete m_grid;
+      m_grid = 0;
+   }
+   m_meanSpacing = 0.0;
+   m_geoid = 0;
+   m_connectionString.clear();
+}
+
+void ossimTiledElevationDatabase::mapRegion(const ossimGrect& region)
+{
+   static const char M[] = "ossimTiledElevationDatabase::mapRegion";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "region: " << region << "\n";
+   }
+   
+   if ( m_connectionString.size() )
+   {
+      // Wrap in try catch block as excptions can be thrown under the hood.
+      try
+      {
+         m_requestedRect = region;
+         
+         ossimFilename f = m_connectionString;
+         if ( f.exists() )
+         {
+            if ( !m_fileWalker )
+            {
+               m_fileWalker = new ossimFileWalker();
+               m_fileWalker->initializeDefaultFilterList();
+
+               m_fileWalker->setNumberOfThreads( ossim::getNumberOfThreads() );
+
+               // Must set this so we can stop recursion on directory based images.
+               m_fileWalker->setWaitOnDirFlag( true );
+
+               // This links the file walker back to our "processFile" method.
+               m_fileWalker->setFileProcessor( this );
+            }
+
+            // Walk the directory:
+            m_fileWalker->walk(f);
+
+            mapRegion();
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << M << " ERROR: Connection string does not exists: "
+               << m_connectionString.c_str()  << endl;
+         }
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Caught exception: " << e.what() << endl;
+         m_entries. clear();
+      }
+
+      // cleanup:
+      if ( m_fileWalker )
+      {
+         delete m_fileWalker;
+         m_fileWalker = 0;
+      }
+}
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+}
+
+void ossimTiledElevationDatabase::processFile(const ossimFilename& file)
+{
+   static const char M[] = "ossimTiledElevationDatabase::processFile";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "file: " << file << "\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
+   if ( sic->open(file, false) ) // False for do not open overviews.
+   {
+      if ( isDirectoryBasedImage( sic->getImageHandler() ) )
+      {
+         // Tell the walker not to recurse this directory.
+         m_fileWalker->setRecurseFlag(false);
+      }
+     
+      ossimRefPtr<ossimImageHandler> ih = sic->getImageHandler();
+      if ( ih.valid() && (m_requestedRect.isLonLatNan() == false) )
+      {
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if ( geom.valid() == false )
+         {
+            std::string errMsg = M;
+            errMsg += " ERROR:\nNo image geometry for image: ";
+            errMsg += ih->getFilename().string();
+            throw ossimException(errMsg);
+         }
+         
+         ossimRefPtr<ossimProjection> proj = geom->getProjection();
+         if ( proj.valid() == false )
+         {
+            std::string errMsg = M;
+            errMsg += " ERROR:\nNo image projection for image: ";
+            errMsg += ih->getFilename().string();
+            throw ossimException(errMsg);
+         }
+         
+         // Get the bounding rect:
+         ossimGrect boundingRect;
+         getBoundingRect(geom, boundingRect);
+         
+         if ( boundingRect.isLonLatNan() )
+         {
+            std::string errMsg = M;
+            errMsg += " ERROR:\nBounding rect has nans for image: ";
+            errMsg += ih->getFilename().string();
+            throw ossimException(errMsg); 
+         }
+         
+         if ( boundingRect.intersects(m_requestedRect) )
+         {
+            bool addEntryToList = false;
+            
+            if ( m_entries.size() == 0 ) // First time through.
+            {
+               addEntryToList = true;
+               m_entryListRect = boundingRect;
+               m_referenceProj = proj;
+               m_meanSpacing = (geom->getMetersPerPixel().x + geom->getMetersPerPixel().y) / 2.0;
+            }
+            else 
+            {
+               addEntryToList = isCompatible( ih.get(), geom.get(), proj.get() );
+               if ( addEntryToList )
+               {
+                  // Expand the rectangle.
+                  m_entryListRect.combine(boundingRect);
+               }
+            }
+            
+            if ( addEntryToList )
+            {
+               // If we're keeping it add a cache to the chain.
+               sic->addCache();
+               
+               //---
+               // Create the entry and give to addEntry which checks for duplicates in case
+               // mapRegion was called consecutively.
+               //---
+               ossimTiledElevationEntry entry(boundingRect, sic);
+               addEntry(entry);
+
+               // Once the requested rect is filled abort the file walk.
+               if ( m_requestedRect.completely_within( m_entryListRect ) )
+               {
+                  m_fileWalker->setAbortFlag(true);
+               }
+            }
+         }
+      }
+      else
+      {
+         std::string errMsg = M;
+         errMsg += " ERROR:\nNo image geometry for image: ";
+         errMsg += ih->getFilename().string();
+         throw ossimException(errMsg);
+      }
+   }
+
+   if(traceDebug())
+   {
+      // Since ossimFileWalker is threaded output the file so we know which job exited.
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
+   }   
+}
+
+void ossimTiledElevationDatabase::addEntry(const ossimTiledElevationEntry& entry)
+{
+   bool result = true;
+   std::vector<ossimTiledElevationEntry>::const_iterator i = m_entries.begin();
+   while ( i != m_entries.end() )
+   {
+      if ( (*i).m_sic->getFilename() == entry.m_sic->getFilename() )
+      {
+         result = false; // In list already.
+         break;
+      }
+      ++i;
+   }
+   if ( result )
+   {
+      m_entries.push_back(entry); // Add to list.
+   }
+}
+
+void ossimTiledElevationDatabase::initializeReferenceProjection()
+{
+   if ( m_entries.size() )
+   {
+      ossimRefPtr<ossimImageHandler> ih = m_entries[0].m_sic->getImageHandler();
+      if ( ih.valid() )
+      {
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if ( geom.valid() )
+         {
+            m_referenceProj = geom->getProjection();
+         }
+         // else throw exception ??? (drb)
+      }
+   }
+}
+
+double ossimTiledElevationDatabase::getHeightAboveMSL(const ossimGpt& gpt)
+{
+   if ( m_grid )
+   {
+      return (*m_grid)(gpt.lon, gpt.lat);
+   }
+   return ossim::nan();
+}
+
+double ossimTiledElevationDatabase::getHeightAboveEllipsoid(const ossimGpt& gpt)
+{
+   double h = getHeightAboveMSL(gpt);
+   if(h != ossim::nan())
+   {
+      h += getOffsetFromEllipsoid(gpt);
+   }
+   return h;
+}
+ 
+bool ossimTiledElevationDatabase::pointHasCoverage(const ossimGpt& gpt) const
+{
+   if ( theGroundRect.isLonLatNan() == false)
+   {
+      return theGroundRect.pointWithin(gpt);
+   }
+   return false;
+}
+
+bool ossimTiledElevationDatabase::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   static const char M[] = "ossimTiledElevationDatabase::loadState";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered..." << "\nkwl:\n" << kwl << "\n";
+   }     
+   bool result = false;
+   const char* lookup = kwl.find(prefix, "type");
+   if ( lookup )
+   {
+      std::string type = lookup;
+      if ( ( type == "image_directory" ) || ( type == "ossimTiledElevationDatabase" ) )
+      {
+         result = ossimElevationDatabase::loadState(kwl, prefix);
+      }
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
+   }
+
+   return result;
+}
+
+bool ossimTiledElevationDatabase::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimElevationDatabase::saveState(kwl, prefix);
+}
+
+// Private method:
+bool ossimTiledElevationDatabase::isDirectoryBasedImage(ossimRefPtr<ossimImageHandler> ih)
+{
+   bool result = false;
+   if ( ih.valid() )
+   {
+      // Get the image handler name.
+      ossimString imageHandlerName = ih->getClassName();
+      if ( (imageHandlerName == "ossimAdrgTileSource") ||
+           (imageHandlerName == "ossimCibCadrgTileSource") )  
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimTiledElevationDatabase::isCompatible(ossimImageHandler* ih,
+                                               ossimImageGeometry* geom,
+                                               ossimProjection* proj) const
+{
+   //---
+   // Check for match of the following against the first entry:
+   // bands
+   // projection
+   // scalar type
+   // scale
+   //---
+   bool result = false;
+
+   if ( m_entries.size() && ih && geom && proj )
+   {
+      ossimRefPtr<const ossimImageHandler> entry0_ih = m_entries[0].m_sic->getImageHandler();
+      
+      // Check scalar type and bands.
+      if ( (entry0_ih->getOutputScalarType() == ih->getOutputScalarType()) &&
+           (entry0_ih->getNumberOfOutputBands() == ih->getNumberOfOutputBands()) )
+      {
+         // Check the scale.
+         ossimRefPtr<const ossimMapProjection> mapProj =
+            dynamic_cast<const ossimMapProjection*>(proj);
+         if ( mapProj.valid() )
+         {
+            ossimRefPtr<const ossimMapProjection> refMapProj =
+               dynamic_cast<const ossimMapProjection*>(m_referenceProj.get());
+            
+            if ( mapProj->isGeographic() )
+            {
+               if ( refMapProj->getDecimalDegreesPerPixel() ==
+                    mapProj->getDecimalDegreesPerPixel() )
+               {
+                  result = true;
+               }
+               else if ( refMapProj->getMetersPerPixel() ==
+                         mapProj->getMetersPerPixel() )
+               {
+                  result = true;
+               }
+            }
+         }
+         else // sensor model
+         {
+            if ( proj->getMetersPerPixel() == m_referenceProj->getMetersPerPixel() )
+            {
+               result = true;
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimTiledElevationDatabase::getBoundingRect(
+   ossimRefPtr<ossimImageGeometry> geom, ossimGrect& boundingRect) const
+{
+   if ( geom.valid() )
+   {
+      std::vector<ossimGpt> corner(4);
+      if ( geom->getCornerGpts(corner[0], corner[1], corner[2], corner[3]) )
+      {
+         ossimGpt ulGpt(corner[0]);
+         ossimGpt lrGpt(corner[0]);
+         for ( ossim_uint32 i = 1; i < 4; ++i )
+         {
+            if ( corner[i].lon < ulGpt.lon ) ulGpt.lon = corner[i].lon;
+            if ( corner[i].lat > ulGpt.lat ) ulGpt.lat = corner[i].lat;
+            if ( corner[i].lon > lrGpt.lon ) lrGpt.lon = corner[i].lon;
+            if ( corner[i].lat < lrGpt.lat ) lrGpt.lat = corner[i].lat;
+         }
+         boundingRect = ossimGrect(ulGpt, lrGpt);
+      }
+      else
+      {
+         boundingRect.makeNan();
+      }
+   }
+}
+void ossimTiledElevationDatabase::mapRegion()
+{
+   static const char M[] = "ossimTiledElevationDatabase::mapRegion";
+   
+   if ( m_entries.size() && ( m_requestedRect.isLonLatNan() == false ) )
+   {
+      ossimRefPtr<ossimOrthoImageMosaic> mosaic = new ossimOrthoImageMosaic();
+      std::vector<ossimTiledElevationEntry>::iterator i = m_entries.begin();
+      while ( i != m_entries.end() )
+      {
+         mosaic->connectMyInputTo( (*i).m_sic.get() );
+         ++i;
+      }
+
+      // Compute the requested rectangle in view space.
+      ossimRefPtr<ossimImageGeometry> geom = mosaic->getImageGeometry();
+      if ( geom.valid() )
+      {
+         ossimDpt ulDpt;
+         ossimDpt lrDpt;
+         geom->worldToLocal(m_requestedRect.ul(), ulDpt);
+         geom->worldToLocal(m_requestedRect.lr(), lrDpt);
+
+         // Expand out to fall on even view coordinates.
+         ulDpt.x = std::floor(ulDpt.x);
+         ulDpt.y = std::floor(ulDpt.y);
+         lrDpt.x = std::ceil(lrDpt.x);
+         lrDpt.y = std::floor(lrDpt.y);
+
+         // Get new(expanded) corners in ground space.
+         ossimGpt ulGpt;
+         ossimGpt lrGpt;
+         geom->localToWorld(ulDpt, ulGpt);
+         geom->localToWorld(lrDpt, lrGpt);
+         theGroundRect = ossimGrect(ulGpt, lrGpt);
+            
+         // Expanded requested rect in view space.
+         ossimIpt ulIpt = ulDpt;
+         ossimIpt lrIpt = lrDpt;
+         const ossimIrect VIEW_RECT(ulIpt, lrIpt);
+
+         // Get the data.
+         ossimRefPtr<ossimImageData> data = mosaic->getTile(VIEW_RECT, 0);
+         if ( data.valid() )
+         {
+            // Initialize the grid:
+            const ossimIpt SIZE( data->getWidth(), data->getHeight() );
+            const ossimDpt ORIGIN(ulGpt.lon, lrGpt.lat); // SouthWest corner
+            const ossimDpt SPACING( (lrGpt.lon-ulGpt.lon)/(SIZE.x-1),
+                                    (ulGpt.lat-lrGpt.lat)/(SIZE.y-1) );
+            if ( !m_grid ) m_grid = new ossimDblGrid();
+            m_grid->initialize(SIZE, ORIGIN, SPACING, ossim::nan());
+
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << M
+                  << "\nrequested view rect: " << VIEW_RECT
+                  << "\nexpanded ground rect: " << theGroundRect
+                  << "\norigin:  " << ORIGIN
+                  << "\nsize:    " << SIZE
+                  << "\nspacing: " << SPACING << std::endl;
+            }
+
+            // Fill the grid:
+            switch( data->getScalarType() )
+            {
+               case OSSIM_SINT16:
+               {
+                  fillGrid(ossim_sint16(0), data);
+                  break;
+               }
+               case OSSIM_SINT32:
+               {
+                  fillGrid(ossim_sint32(0), data);
+                  break;
+               }
+               case OSSIM_FLOAT32:
+               {
+                  fillGrid(ossim_float32(0), data);
+                  break;
+               }
+               case OSSIM_FLOAT64:
+               {
+                  fillGrid(ossim_float64(0), data);
+                  break;
+               }
+               case OSSIM_UINT8:
+               case OSSIM_SINT8:
+               case OSSIM_USHORT11:
+               case OSSIM_USHORT12:
+               case OSSIM_USHORT13:
+               case OSSIM_USHORT14:
+               case OSSIM_USHORT15:
+               case OSSIM_UINT16:
+               case OSSIM_UINT32:
+               case OSSIM_NORMALIZED_DOUBLE:
+               case OSSIM_NORMALIZED_FLOAT:
+               case OSSIM_SCALAR_UNKNOWN:
+               default:
+               {
+                  std::string errMsg = M;
+                  errMsg += " ERROR:\nUnhandled scalar type: ";
+                  errMsg += data->getScalarTypeAsString().string();
+                  throw ossimException(errMsg);
+               }
+            }
+            
+         } // if ( data.valid() )
+
+      } // if ( geom.valid() )
+
+   } // if ( m_entries.size() && ...
+}
+
+template <class T> void ossimTiledElevationDatabase::fillGrid(T /* dummyTemplate */,
+                                                              ossimRefPtr<ossimImageData> data)
+{
+   if ( data.valid() )
+   {
+      // Copy to grid reversing the lines as the ossimDblGrid's origin is the SW corner.
+      const ossim_float64 NP  = data->getNullPix(0);
+      const T* buf = static_cast<T*>(data->getBuf(0));
+      if ( buf )
+      {
+         const ossimIpt SIZE( data->getWidth(), data->getHeight() );
+         ossim_int32 bufIdx = (SIZE.y-1) * data->getWidth();
+         ossim_int32 grdY = 0;
+         for (ossim_int32 y = SIZE.y-1; y >= 0; --y)
+         {
+            for (ossim_int32 x = 0; x < SIZE.x; ++ x)
+            {
+               ossim_float64 v = static_cast<ossim_float64>(buf[bufIdx+x]);
+               m_grid->setNode(x, grdY, (v!=NP?v:ossim::nan()) );
+            }
+            bufIdx -= data->getWidth();
+            ++grdY;
+         }
+      }
+   }
+}
+
+// Hidden from use...
+ossimTiledElevationDatabase::ossimTiledElevationDatabase(
+   const ossimTiledElevationDatabase& /* copy_this */)
+{
+}
+
+// Private container class:
+ossimTiledElevationDatabase::ossimTiledElevationEntry::ossimTiledElevationEntry()
+   : m_rect(),
+     m_sic(0)
+{}
+                                                   
+ossimTiledElevationDatabase::ossimTiledElevationEntry::ossimTiledElevationEntry(
+   const ossimGrect& rect, ossimRefPtr<ossimSingleImageChain> sic )
+   : m_rect(rect),
+     m_sic(sic)
+{}
+
+std::ostream& ossimTiledElevationDatabase::print(ostream& out) const
+{
+   ossimKeywordlist kwl;
+   saveState(kwl,0);
+   out << "\nossimTiledElevationDatabase @ "<< (ossim_uint64) this << "\n"
+         << kwl <<ends;
+   return out;
+}
+
diff --git a/src/examples/tutorial/Makefile b/src/examples/tutorial/Makefile
new file mode 100644
index 0000000..e2b7c31
--- /dev/null
+++ b/src/examples/tutorial/Makefile
@@ -0,0 +1,40 @@
+
+include ../../../Makefile.common
+include ../../../makelib.mak
+LIBRARY   =
+INCLUDES  = $(BASE_INCLUDES)
+SRCS=$(wildcard *.cc)
+OBJECTS=$(patsubst %.cc,%.o,$(SRCS)) 
+
+.cc:
+	$(CXX) $(LIBRARY) $<  $(LIBRARY) -o $@
+
+.cc.o:
+	$(CXX) $(INCLUDES) $< -c
+
+all: $(OBJECTS) image_open$(EXEEXT) image_copy$(EXEEXT) \
+	image_copy_b1$(EXEEXT) reproject$(EXEEXT) kwl$(EXEEXT) \
+	image_data$(EXEEXT) band_average$(EXEEXT)
+#\
+#	shared_band_average$(EXEEXT)
+
+image_open$(EXEEXT): image_open.o
+	$(CXX) $(INCLUDES) $(CXXFLAGS) $(CDEBUGFLAGS) $(BASE_DEFINES) $(LDFLAGS_APP) image_open.o $(OSSIM_APP_LINK) -o $@
+
+image_copy$(EXEEXT): image_copy.o
+	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(BASE_DEFINES) $(LDFLAGS_APP) image_copy.o $(OSSIM_APP_LINK) -o $@
+
+image_copy_b1$(EXEEXT): image_copy_b1.o
+	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(BASE_DEFINES) $(LDFLAGS_APP) image_copy_b1.o $(OSSIM_APP_LINK) -o $@
+
+reproject$(EXEEXT): reproject.o
+	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(BASE_DEFINES) $(LDFLAGS_APP) reproject.o $(OSSIM_APP_LINK) -o $@
+
+kwl$(EXEEXT): kwl.o
+	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(BASE_DEFINES) $(LDFLAGS_APP) kwl.o $(OSSIM_APP_LINK) -o $@
+
+image_data$(EXEEXT): image_data.o
+	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(BASE_DEFINES) $(LDFLAGS_APP) image_data.o $(OSSIM_APP_LINK) -o $@
+
+band_average$(EXEEXT): band_average.o
+	$(CXX) $(CXXFLAGS) $(CDEBUGFLAGS) $(BASE_DEFINES) $(LDFLAGS_APP) band_average.o $(OSSIM_APP_LINK) -o $@
diff --git a/ossim/src/examples/tutorial/band_average.cpp b/src/examples/tutorial/band_average.cpp
similarity index 100%
rename from ossim/src/examples/tutorial/band_average.cpp
rename to src/examples/tutorial/band_average.cpp
diff --git a/ossim/src/examples/tutorial/image_copy.cpp b/src/examples/tutorial/image_copy.cpp
similarity index 100%
rename from ossim/src/examples/tutorial/image_copy.cpp
rename to src/examples/tutorial/image_copy.cpp
diff --git a/ossim/src/examples/tutorial/image_copy_b1.cpp b/src/examples/tutorial/image_copy_b1.cpp
similarity index 100%
rename from ossim/src/examples/tutorial/image_copy_b1.cpp
rename to src/examples/tutorial/image_copy_b1.cpp
diff --git a/ossim/src/examples/tutorial/image_data.cpp b/src/examples/tutorial/image_data.cpp
similarity index 100%
rename from ossim/src/examples/tutorial/image_data.cpp
rename to src/examples/tutorial/image_data.cpp
diff --git a/ossim/src/examples/tutorial/image_open.cpp b/src/examples/tutorial/image_open.cpp
similarity index 100%
rename from ossim/src/examples/tutorial/image_open.cpp
rename to src/examples/tutorial/image_open.cpp
diff --git a/ossim/src/examples/tutorial/kwl.cpp b/src/examples/tutorial/kwl.cpp
similarity index 100%
rename from ossim/src/examples/tutorial/kwl.cpp
rename to src/examples/tutorial/kwl.cpp
diff --git a/ossim/src/examples/tutorial/ossim_preferences b/src/examples/tutorial/ossim_preferences
similarity index 100%
rename from ossim/src/examples/tutorial/ossim_preferences
rename to src/examples/tutorial/ossim_preferences
diff --git a/ossim/src/examples/tutorial/reproject.cpp b/src/examples/tutorial/reproject.cpp
similarity index 100%
rename from ossim/src/examples/tutorial/reproject.cpp
rename to src/examples/tutorial/reproject.cpp
diff --git a/ossim/src/examples/tutorial/writing_your_own_image_processing_filter.html b/src/examples/tutorial/writing_your_own_image_processing_filter.html
similarity index 100%
rename from ossim/src/examples/tutorial/writing_your_own_image_processing_filter.html
rename to src/examples/tutorial/writing_your_own_image_processing_filter.html
diff --git a/ossim/src/ossim/font/ossimFont.cpp b/src/font/ossimFont.cpp
similarity index 100%
rename from ossim/src/ossim/font/ossimFont.cpp
rename to src/font/ossimFont.cpp
diff --git a/ossim/src/ossim/font/ossimFontFactoryRegistry.cpp b/src/font/ossimFontFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/font/ossimFontFactoryRegistry.cpp
rename to src/font/ossimFontFactoryRegistry.cpp
diff --git a/ossim/src/ossim/font/ossimFreeTypeFont.cpp b/src/font/ossimFreeTypeFont.cpp
similarity index 100%
rename from ossim/src/ossim/font/ossimFreeTypeFont.cpp
rename to src/font/ossimFreeTypeFont.cpp
diff --git a/ossim/src/ossim/font/ossimFreeTypeFontFactory.cpp b/src/font/ossimFreeTypeFontFactory.cpp
similarity index 100%
rename from ossim/src/ossim/font/ossimFreeTypeFontFactory.cpp
rename to src/font/ossimFreeTypeFontFactory.cpp
diff --git a/ossim/src/ossim/font/ossimGdBitmapFont.cpp b/src/font/ossimGdBitmapFont.cpp
similarity index 100%
rename from ossim/src/ossim/font/ossimGdBitmapFont.cpp
rename to src/font/ossimGdBitmapFont.cpp
diff --git a/src/hdf5/ossimHdf5.cpp b/src/hdf5/ossimHdf5.cpp
new file mode 100644
index 0000000..c8fb635
--- /dev/null
+++ b/src/hdf5/ossimHdf5.cpp
@@ -0,0 +1,776 @@
+//---
+//
+// License: MIT
+//
+// Description: OSSIM HDF5 utility class.
+//
+//---
+// $Id
+
+#include <ossim/hdf5/ossimHdf5.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimEndian.h>
+#include <string>
+
+using namespace H5;
+using namespace std;
+
+ossimHdf5::ossimHdf5()
+:  m_h5File (0)
+{  }
+
+ossimHdf5::~ossimHdf5()
+{
+   close();
+}
+
+bool ossimHdf5::open(const ossimFilename& fullname)
+{
+   // Check for empty filename.
+   if (fullname.empty())
+      return false;
+
+   m_filename = fullname;
+   if (m_h5File && !close())
+      return false;
+
+   // H5 lib throws exceptions:
+   bool success = false;
+   try
+   {
+      // Turn off the auto-printing when failure occurs so that we can handle the errors:
+      H5::Exception::dontPrint();
+      if ( H5File::isHdf5( m_filename.string() ) )
+      {
+         m_h5File = new H5File(m_filename.string(), H5F_ACC_RDONLY);
+         success  = true;
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      success = false;
+      ossimNotify(ossimNotifyLevel_WARN) <<e.getDetailMsg() << std::endl;
+   }
+   catch( ... )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<< "ossimH5Info::open WARNING Caught unhandled exception "
+         "for file <"<< fullname <<">"<< std::endl;
+      success = false;
+   }
+
+   if (!success)
+   {
+      delete m_h5File;
+      m_h5File = 0;
+   }
+
+   return success;
+}
+
+bool ossimHdf5::close()
+{
+   bool success = true;
+   if (m_h5File)
+   {
+      try
+      {
+         m_h5File->close();
+         delete m_h5File;
+         m_h5File = 0;
+      }
+      catch( const H5::Exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+         success = false;
+      }
+   }
+   return success;
+}
+
+
+bool ossimHdf5::getRoot(Group& root) const
+{
+   if (!m_h5File)
+      return false;
+
+   bool success = true;
+   try
+   {
+      root = m_h5File->openGroup("/");
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      success = false;
+   }
+   return success;
+
+}
+
+bool ossimHdf5::getChildGroups(H5::Group group, vector<Group>& groupList,
+                               bool recursive)
+{
+   bool success = true;
+
+   int numObjs = 0;
+
+   try
+   {
+      numObjs = group.getNumObjs();
+   }
+   catch( const H5::Exception& e )
+   {
+      e.getDetailMsg();
+      success = false;
+   }
+   for (int i=0; (i<numObjs) && success; ++i)
+   {
+      try
+      {
+         H5G_obj_t h5type = group.getObjTypeByIdx(i);
+         if (h5type == H5G_GROUP)
+         {
+            string name = group.getObjnameByIdx(i);
+            groupList.push_back(group.openGroup(name));
+            if (recursive)
+               success = getChildGroups(groupList.back(), groupList, true);
+         }
+      }
+      catch( const H5::Exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+         success = false;
+      }
+   }
+   return success;
+}
+
+bool ossimHdf5::getDatasets(H5::Group group, vector<DataSet>& datasetList,
+                            bool recursive)
+{
+   datasetList.clear();
+   vector<Group> groupList;
+   if (recursive)
+   {
+      getChildGroups(group, groupList, true);
+   }
+   groupList.insert(groupList.begin(), group);
+
+   bool success = true;
+   try
+   {
+      vector<Group>::iterator group_iter = groupList.begin();
+      while (group_iter != groupList.end())
+      {
+         int numObjs = group_iter->getNumObjs();
+         for (int i=0; i<numObjs; ++i)
+         {
+            H5G_obj_t h5type = group_iter->getObjTypeByIdx(i);
+            if (h5type == H5G_DATASET)
+            {
+               string name = group_iter->getObjnameByIdx(i);
+               datasetList.push_back(group_iter->openDataSet(name));
+            }
+         }
+         ++group_iter;
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      success = false;
+   }
+   return success;
+}
+
+bool ossimHdf5::getNdimDatasets(H5::Group group, vector<DataSet>& datasetList,
+                                bool recursive)
+{
+   datasetList.clear();
+   vector<Group> groupList;
+   if (recursive)
+      getChildGroups(group, groupList, true);
+   groupList.insert(groupList.begin(), group);
+
+   bool success = true;
+   try
+   {
+      vector<Group>::iterator group_iter = groupList.begin();
+      while (group_iter != groupList.end())
+      {
+         int numObjs = group_iter->getNumObjs();
+         for (int i=0; i<numObjs; ++i)
+         {
+            H5G_obj_t h5type = group_iter->getObjTypeByIdx(i);
+            if (h5type == H5G_DATASET)
+            {
+               string name = group_iter->getObjnameByIdx(i);
+               DataSet dataset (group_iter->openDataSet(name));
+               DataSpace dspace (dataset.getSpace());
+               if (dspace.getSimpleExtentNdims() > 1)
+                  datasetList.push_back(dataset);
+            }
+         }
+         ++group_iter;
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      success = false;
+   }
+   return success;
+}
+
+bool ossimHdf5::getAttributes(const H5Object& obj, vector<Attribute>& attrList)
+{
+   attrList.clear();
+
+   // Find the object:
+   bool success = true;
+   try
+   {
+      int numAttr = obj.getNumAttrs();
+      for (int i=0; i<numAttr; ++i)
+      {
+         attrList.push_back(obj.openAttribute(i));
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      success = false;
+   }
+
+   return success;
+}
+
+
+H5::Group* ossimHdf5::findGroupByName(const std::string& name, const H5::Group* parent, bool recursive)const
+{
+   if (name.empty())
+      return NULL;
+
+   H5::Group baseGroup;
+   if (parent == NULL)
+   {
+      if (!getRoot(baseGroup))
+         return NULL;
+   }
+   else
+   {
+      baseGroup = *parent;
+   }
+
+   H5::Group* named_group = 0;
+   vector<Group> groupList;
+   if (!getChildGroups(baseGroup, groupList, recursive))
+      return NULL;
+
+   try
+   {
+      std::vector<Group>::iterator group = groupList.begin();
+      while (group != groupList.end())
+      {
+         // bool found;
+         ossimString dsName = group->getObjName();
+         if (dsName.contains(name))
+         {
+            named_group = new Group(*group);
+            break;
+         }
+         ++group;
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   return named_group;
+}
+
+H5::DataSet* ossimHdf5::findDatasetByName(const std::string& name, const H5::Group* group,
+                                          bool recursive)const
+{
+   if (name.empty())
+      return NULL;
+
+   H5::Group baseGroup;
+   if (group == NULL)
+   {
+      if (!getRoot(baseGroup))
+         return NULL;
+   }
+   else
+   {
+      baseGroup = *group;
+   }
+   H5::DataSet* named_dataset = 0;
+   vector<DataSet> datasetList;
+   if (!getDatasets(baseGroup, datasetList, recursive))
+      return NULL;
+   try
+   {
+      std::vector<H5::DataSet>::iterator dataset = datasetList.begin();
+      while (dataset != datasetList.end())
+      {
+         // bool found;
+         ossimString dsName = dataset->getObjName();
+         if (dsName.contains(name))
+         {
+            named_dataset = new H5::DataSet(*dataset);
+            break;
+         }
+         ++dataset;
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+   return named_dataset;
+}
+
+ossimByteOrder ossimHdf5::getByteOrder( const H5::AbstractDs* obj )
+{
+   ossimByteOrder byteOrder = ossim::byteOrder();
+   if ( obj )
+   {
+      try
+      {
+
+         // Get the class of the datatype that is used by the dataset.
+         H5T_class_t typeClass = obj->getTypeClass();
+
+         H5T_order_t order = H5T_ORDER_NONE;
+
+         if ( typeClass == H5T_INTEGER )
+         {
+            H5::IntType intype = obj->getIntType();
+            order = intype.getOrder();
+         }
+         else if ( typeClass == H5T_FLOAT )
+         {
+            H5::FloatType floatType = obj->getFloatType();
+            order = floatType.getOrder();
+         }
+
+         if ( order == H5T_ORDER_LE )
+         {
+            byteOrder = OSSIM_LITTLE_ENDIAN;
+         }
+         else if ( order == H5T_ORDER_BE )
+         {
+            byteOrder = OSSIM_BIG_ENDIAN;
+         }
+      }
+      catch( const H5::Exception& e )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      }
+   }
+   return byteOrder;
+}
+
+ossimByteOrder ossimHdf5::getByteOrder( const H5::AtomType& obj )
+{
+   ossimByteOrder byteOrder = ossim::byteOrder();
+   H5T_order_t order = obj.getOrder();
+   if ( order == H5T_ORDER_LE )
+   {
+      byteOrder = OSSIM_LITTLE_ENDIAN;
+   }
+   else if ( order == H5T_ORDER_BE )
+   {
+      byteOrder = OSSIM_BIG_ENDIAN;
+   }
+
+   return byteOrder;
+}
+
+
+std::string ossimHdf5::getDatatypeClassType( ossim_int32 type )
+{
+   H5T_class_t classType = (H5T_class_t)type;
+
+   std::string result;
+   switch ( classType )
+   {
+   case H5T_INTEGER:
+      result = "H5T_INTEGER";
+      break;
+   case H5T_FLOAT:
+      result = "H5T_FLOAT";
+      break;
+   case H5T_TIME:
+      result = "H5T_TIME";
+      break;
+   case H5T_STRING:
+      result = "H5T_STRING";
+      break;
+   case H5T_BITFIELD:
+      result = "H5T_BITFIELD";
+      break;
+   case H5T_OPAQUE:
+      result = "H5T_OPAQUE";
+      break;
+   case H5T_COMPOUND:
+      result = "H5T_COMPOUND";
+      break;
+   case H5T_REFERENCE:
+      result = "H5T_REFERENCE";
+      break;
+   case H5T_ENUM:
+      result = "H5T_ENUM";
+      break;
+   case H5T_VLEN:
+      result = "H5T_VLEN";
+      break;
+   case H5T_ARRAY:
+      result = "H5T_ARRAY";
+      break;
+   case H5T_NO_CLASS:
+   default:
+      result = "H5T_NO_CLASS";
+      break;
+   }
+   return result;
+}
+
+
+void ossimHdf5::getExtents( const H5::DataSet& dataset, std::vector<ossim_uint32>& extents )
+{
+   extents.clear();
+
+   try
+   {
+      // Get dataspace of the dataset.
+      H5::DataSpace dataspace = dataset.getSpace();
+
+      // Number of dimensions:
+      int ndims = dataspace.getSimpleExtentNdims();
+      if ( ndims )
+      {
+         //hsize_t dims_out[ndims];
+         std::vector<hsize_t> dims_out(ndims);
+         dataspace.getSimpleExtentDims( &dims_out.front(), 0 );
+         for ( ossim_int32 i = 0; i < ndims; ++i )
+         {
+            extents.push_back(static_cast<ossim_uint32>(dims_out[i]));
+         }
+      }
+
+      dataspace.close();
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+}
+
+
+ossimScalarType ossimHdf5::getScalarType( const H5::DataSet& dataset )
+{
+   ossimScalarType scalar = OSSIM_SCALAR_UNKNOWN;
+
+   try
+   {
+
+      H5::DataType datatype =  dataset.getDataType();
+      ossim_int32 typeClass = datatype.getClass();
+      if ( ( typeClass != H5T_INTEGER ) && ( typeClass != H5T_FLOAT ) )
+         return scalar;
+
+      size_t size = 0;
+      hid_t mem_type_id = H5Dget_type( datatype.getId() );
+      if( mem_type_id > -1 )
+      {
+         hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
+
+         if( H5Tequal(H5T_NATIVE_CHAR, native_type) )
+            scalar = OSSIM_SINT8;
+         else if ( H5Tequal( H5T_NATIVE_UCHAR, native_type) )
+            scalar = OSSIM_UINT8;
+         else if( H5Tequal( H5T_NATIVE_SHORT, native_type) )
+            scalar = OSSIM_SINT16;
+         else if(H5Tequal(H5T_NATIVE_USHORT, native_type))
+            scalar = OSSIM_UINT16;
+         else if(H5Tequal( H5T_NATIVE_INT, native_type))
+            scalar = OSSIM_SINT32;
+         else if(H5Tequal( H5T_NATIVE_UINT, native_type ) )
+            scalar = OSSIM_UINT32;
+         else if(H5Tequal( H5T_NATIVE_LONG, native_type))
+            scalar = OSSIM_SINT32;
+         else if(H5Tequal( H5T_NATIVE_ULONG, native_type))
+            scalar = OSSIM_UINT32;
+         else if(H5Tequal( H5T_NATIVE_LLONG, native_type))
+            scalar = OSSIM_SINT64;
+         else if(H5Tequal( H5T_NATIVE_ULLONG, native_type))
+            scalar = OSSIM_UINT64;
+         else if(H5Tequal( H5T_NATIVE_FLOAT, native_type))
+            scalar = OSSIM_FLOAT32;
+         else if(H5Tequal( H5T_NATIVE_DOUBLE, native_type))
+            scalar = OSSIM_FLOAT64;
+      }
+      else if ( typeClass == H5T_INTEGER )
+      {
+         H5::IntType intType (dataset);
+         bool isSigned = intType.getSign() == H5T_SGN_NONE ? false : true;
+         size = intType.getSize();
+         switch (size)
+         {
+         case 1:
+            if (isSigned)
+               scalar = OSSIM_SINT8;
+            else
+               scalar = OSSIM_UINT8;
+            break;
+         case 2:
+            if (isSigned)
+               scalar = OSSIM_SINT16;
+            else
+               scalar = OSSIM_UINT16;
+            break;
+         case 4:
+            if (isSigned)
+               scalar = OSSIM_SINT32;
+            else
+               scalar = OSSIM_UINT32;
+            break;
+         case 8:
+            if (isSigned)
+               scalar = OSSIM_SINT64;
+            else
+               scalar = OSSIM_UINT64;
+            break;
+         default:
+            break;
+         }
+      }
+      else // float
+      {
+         size = datatype.getSize();
+         switch (size)
+         {
+         case 4:
+            scalar = OSSIM_FLOAT32;
+            break;
+         case 8:
+            scalar = OSSIM_FLOAT64;
+            break;
+         default:
+            break;
+         }
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   return scalar;
+}
+
+bool ossimHdf5::floatTypeToString(std::string& result,
+                                      const H5::FloatType& dataType,
+                                      const char* dataPtr)
+{
+   char* buf = const_cast<char*>(dataPtr);
+   ossim_uint32 dataSize = dataType.getSize();
+   ossimByteOrder order = getByteOrder(dataType);
+   ossimEndian endian;
+   bool swapOrder = (order!=ossim::byteOrder());
+   bool returnValue = true;
+   switch(dataSize)
+   {
+      case 4:
+      {
+         ossim_float32* float_value=0;
+         float_value = reinterpret_cast<ossim_float32*>(buf);
+         if (swapOrder)
+            endian.swap(*float_value);
+         result = ossimString::toString(*float_value).string();
+         break;
+      }
+      case 8:
+      {
+         ossim_float64* float_value=0;
+         float_value = reinterpret_cast<ossim_float64*>(buf);
+         if (swapOrder)
+            endian.swap(*float_value);
+         result = ossimString::toString(*float_value).string();
+         break;
+      }
+      default:
+      {
+         returnValue = false;
+         break;
+      }
+   }
+   return returnValue;
+}
+
+bool ossimHdf5::intTypeToString(std::string& result,
+                                    const H5::IntType& dataType,
+                                    const char* dataPtr)
+{
+   char* buf = const_cast<char*>(dataPtr);
+   ossim_uint32 signType = H5Tget_sign(dataType.getId());
+   ossim_uint32 dataSize = dataType.getSize();
+   ossimByteOrder order = getByteOrder(dataType);
+   ossimEndian endian;
+   bool swapOrder = (order!=ossim::byteOrder());
+   bool returnValue = true;
+   switch(dataSize)
+   {
+      case 1: // one byte integer
+      {
+         switch(signType)
+         {
+            case H5T_SGN_NONE:
+            {
+              ossim_uint8* intValue=0;
+              intValue = reinterpret_cast<ossim_uint8*>(buf);
+              result = ossimString::toString(*intValue).string();
+
+               break;
+            }
+            case H5T_SGN_2:
+            {
+              ossim_int8* intValue=0;
+              intValue = reinterpret_cast<ossim_int8*>(buf);
+              result = ossimString::toString(*intValue).string();
+
+              break;
+            }
+            default:
+            {
+               returnValue = false;
+               break;
+            }
+         }
+         break;
+      }
+      case 2:  // 2 byte integer
+      {
+         switch(signType)
+         {
+            case H5T_SGN_NONE: // unsigned
+            {
+              ossim_uint16* intValue=0;
+              intValue = reinterpret_cast<ossim_uint16*>(buf);
+              if (swapOrder)
+                 endian.swap(*intValue);
+              result = ossimString::toString(*intValue).string();
+
+               break;
+            }
+            case H5T_SGN_2: // Signed
+            {
+              ossim_int16* intValue=0;
+              intValue = reinterpret_cast<ossim_int16*>(buf);
+              if (swapOrder)
+                 endian.swap(*intValue);
+              result = ossimString::toString(*intValue).string();
+              break;
+            }
+            default:
+            {
+               returnValue = false;
+               break;
+            }
+
+         }
+         break;
+      }
+      case 4: // 4 byte integer
+      {
+         switch(signType)
+         {
+            case H5T_SGN_NONE:
+            {
+              ossim_uint32* intValue=0;
+              intValue = reinterpret_cast<ossim_uint32*>(buf);
+              if (swapOrder)
+                 endian.swap(*intValue);
+              result = ossimString::toString(*intValue).string();
+
+               break;
+            }
+            case H5T_SGN_2:
+            {
+              ossim_int32* intValue=0;
+              intValue = reinterpret_cast<ossim_int32*>(buf);
+              if (swapOrder)
+                 endian.swap(*intValue);
+              result = ossimString::toString(*intValue).string();
+              break;
+            }
+            default:
+            {
+               returnValue = false;
+               break;
+            }
+         }
+         break;
+      }
+      case 8: // 8 byte integer
+      {
+         switch(signType)
+         {
+            case H5T_SGN_NONE:
+            {
+              ossim_uint64* intValue=0;
+              intValue = reinterpret_cast<ossim_uint64*>(buf);
+              if (swapOrder)
+                 endian.swap(*intValue);
+              result = ossimString::toString(*intValue).string();
+
+               break;
+            }
+            case H5T_SGN_2:
+            {
+              ossim_int64* intValue=0;
+              intValue = reinterpret_cast<ossim_int64*>(buf);
+              if (swapOrder)
+                 endian.swap(*intValue);
+              result = ossimString::toString(*intValue).string();
+              break;
+            }
+            default:
+            {
+               returnValue = false;
+               break;
+            }
+         }
+         break;
+      }
+      default:
+      {
+         returnValue = false;
+      }
+   }
+
+   return returnValue;
+}
+
+bool ossimHdf5::stringTypeToString(std::string& result,
+                                    const H5::StrType& dataType,
+                                    const char* dataPtr)
+{
+   bool returnValue = false;
+   const char* startPtr = dataPtr;
+   const char* endPtr   = dataPtr;
+   const char* maxPtr   = dataPtr + dataType.getSize();
+   if(dataPtr)
+   {
+      while((endPtr != maxPtr)&&(*endPtr!='\0')) ++endPtr;
+      result = std::string(startPtr, endPtr);
+      bool returnValue = true;
+   }
+
+   return returnValue;
+}
\ No newline at end of file
diff --git a/src/hdf5/ossimHdf5GridModel.cpp b/src/hdf5/ossimHdf5GridModel.cpp
new file mode 100644
index 0000000..87d20f9
--- /dev/null
+++ b/src/hdf5/ossimHdf5GridModel.cpp
@@ -0,0 +1,449 @@
+//*****************************************************************************
+// FILE: ossimHdf5GridModel.cc
+//
+// License:  See LICENSE.txt file in the top level directory.
+//
+// AUTHOR: David Burken
+//
+// Copied from Mingjie Su's ossimHdfGridModel.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimHdf5GridModel. This is an
+//   implementation of an interpolation sensor model. 
+//
+//   IMPORTANT: The lat/lon grid is for ground points on the ellipsoid.
+//   The dLat/dHgt and dLon/dHgt partials therefore are used against
+//   elevations relative to the ellipsoid.
+//
+//*****************************************************************************
+//  $Id$
+
+#include <ossim/hdf5/ossimHdf5GridModel.h>
+#include <ossim/hdf5/ossimHdf5.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/hdf5/ossimHdf5ImageHandler.h>
+#include <sstream>
+#include <string>
+
+using namespace std;
+using namespace H5;
+
+static const int    GRID_SAMPLING_INTERVAL = 32;
+
+RTTI_DEF1(ossimHdf5GridModel, "ossimHdf5GridModel", ossimCoarseGridModel);
+
+
+ossimHdf5GridModel::ossimHdf5GridModel()
+: ossimCoarseGridModel()
+{
+   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
+}
+
+ossimHdf5GridModel::~ossimHdf5GridModel()
+{
+}
+
+bool ossimHdf5GridModel::initialize(ossimHdf5* hdf5, const ossimString& projDataPath)
+{
+   if (!hdf5)
+      return false;
+
+   m_hdf5 = hdf5;
+   m_projDataPath = projDataPath;
+   theHeightEnabledFlag = false;
+
+   try
+   {
+      initCoarseGrid("Latitude",  theLatGrid);
+      initCoarseGrid("Longitude", theLonGrid);
+   }
+   catch (ossimException& x)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<x.what();
+      return false;
+   }
+
+   theDlatDhGrid.initialize(theLatGrid.size(), theLatGrid.origin(), theLatGrid.spacing(), 0.0);
+   theDlonDhGrid.initialize(theLonGrid.size(), theLonGrid.origin(), theLonGrid.spacing(), 0.0);
+
+   // Check for dateline crossing among the longitude grid:
+   crossesDateline();
+
+   ossimGpt ulg (theLatGrid.maxValue(), theLonGrid.minValue());
+   ossimGpt urg (theLatGrid.maxValue(), theLonGrid.maxValue());
+   ossimGpt lrg (theLatGrid.minValue(), theLonGrid.maxValue());
+   ossimGpt llg (theLatGrid.minValue(), theLonGrid.minValue());
+   ossimDrect imageRect(0, 0, m_imageSize.x-1, m_imageSize.y-1);
+   theSeedFunction = new ossimBilinearProjection(imageRect.ul(), imageRect.ur(),
+                                                 imageRect.lr(), imageRect.ll(),
+                                                 ulg, urg, lrg, llg);
+
+   // Bileaner projection to handle
+   initializeModelParams(imageRect);
+
+   ossimIrect bounds (0, 0, theImageSize.u-1, theImageSize.v-1);
+   initializeModelParams(bounds);
+
+   return true;
+}
+
+bool ossimHdf5GridModel::initCoarseGrid(const char* datasetName, ossimDblGrid& coarseGrid)
+{
+   ostringstream xmsg;
+
+   // Convention used: (u,v) is file space, (x,y) is CG space
+   Group* group = m_hdf5->findGroupByName(m_projDataPath.chars(), 0, true);
+   DataSet* dataset  = m_hdf5->findDatasetByName(datasetName, group, true);
+   if (dataset == NULL)
+   {
+      xmsg  << "ossimHdf5GridModel:"<<__LINE__
+            <<" ERROR: Could not find dataset \""<<datasetName<<"\" in file.";
+      throw ossimException(xmsg.str());
+   }
+
+   // Get dataspace of the dataset.
+   DataSpace dataSpace = dataset->getSpace();
+   const ossim_int32 DIM_COUNT = dataSpace.getSimpleExtentNdims();
+   if ( DIM_COUNT != 2  )
+      return false;
+
+   // Get the extents. dimsOut[0] is height, dimsOut[1] is width:
+   std::vector<hsize_t> dimsOut(DIM_COUNT);
+   dataSpace.getSimpleExtentDims( &dimsOut.front(), 0 );
+   m_imageSize.y = dimsOut[0];
+   m_imageSize.x = dimsOut[1];
+
+   // Initialize the ossimDblGrid. Round up if size doesn't fall on end pixel.
+   ossimDpt dspacing (GRID_SAMPLING_INTERVAL, GRID_SAMPLING_INTERVAL);
+   ossim_uint32 gridRows = m_imageSize.y / GRID_SAMPLING_INTERVAL + 1;
+   ossim_uint32 gridCols = m_imageSize.x / GRID_SAMPLING_INTERVAL + 1;
+   if ( m_imageSize.y % GRID_SAMPLING_INTERVAL)
+      ++gridRows;
+   if ( m_imageSize.x % GRID_SAMPLING_INTERVAL)
+      ++gridCols;
+   ossimIpt gridSize (gridCols, gridRows);
+
+   // The grid as used in base class, has UV-space always at 0,0 origin
+   ossimDpt gridOrigin(0.0,0.0);
+   coarseGrid.setNullValue(ossim::nan());
+   coarseGrid.initialize(gridSize, gridOrigin, dspacing);
+
+   std::vector<hsize_t> inputCount(DIM_COUNT);
+   std::vector<hsize_t> inputOffset(DIM_COUNT);
+
+   inputOffset[0] = 0; // y_img is set below.
+   inputOffset[1] = 0;
+   inputCount[0] = 1; // y_img
+   inputCount[1] = (hsize_t)m_imageSize.x; // x_img
+
+   // Output dataspace dimensions. Reading a line at a time.
+   const ossim_int32 OUT_DIM_COUNT = 3;
+   std::vector<hsize_t> outputCount(OUT_DIM_COUNT);
+   outputCount[0] = 1;    // band
+   outputCount[1] = 1;    // y_img
+   outputCount[2] = m_imageSize.x; // x_img
+
+   // Output dataspace offset.
+   std::vector<hsize_t> outputOffset(OUT_DIM_COUNT);
+   outputOffset[0] = 0;
+   outputOffset[1] = 0;
+   outputOffset[2] = 0;
+
+   ossimScalarType scalar = m_hdf5->getScalarType( *dataset);
+   if ( scalar != OSSIM_FLOAT32 )
+      return false;
+
+   // See if we need to swap bytes:
+   ossimEndian endian;
+   bool needSwap = false;
+   if (m_hdf5->getByteOrder(dataset) != ossim::byteOrder())
+      needSwap = true;
+   DataType dataType = dataset->getDataType();
+
+   // Output dataspace always the same, width of one line.
+   DataSpace bufferDataSpace( OUT_DIM_COUNT, &outputCount.front());
+   bufferDataSpace.selectHyperslab( H5S_SELECT_SET,
+                                    &outputCount.front(),
+                                    &outputOffset.front() );
+
+   //  Arrays to hold a single line of latitude longitude values.
+   vector<ossim_float32> values(m_imageSize.x);
+   ossim_float32 val = 0;
+   hsize_t y_img = 0;
+
+   // Line loop:
+   for ( ossim_uint32 y = 0; y < gridRows; ++y )
+   {
+      // y_img = line in image space
+      y_img = y*GRID_SAMPLING_INTERVAL;
+      if ( y_img < (ossim_uint32) m_imageSize.y )
+      {
+         inputOffset[0] = y_img;
+         dataSpace.selectHyperslab( H5S_SELECT_SET, &inputCount.front(), &inputOffset.front() );
+
+         // Read data from file into the buffer.
+         dataset->read( &(values.front()), dataType, bufferDataSpace, dataSpace );
+         if ( needSwap )
+            endian.swap( &(values.front()), m_imageSize.x );
+
+         // Sample loop:
+         hsize_t x_img = 0;
+         for ( ossim_uint32 x = 0; x < gridCols; ++x )
+         {
+            // x_img = sample in image space
+            x_img = x*GRID_SAMPLING_INTERVAL;
+            if ( x_img < (ossim_uint32) m_imageSize.x )
+            {
+               val = values[x_img];
+               if (ossim::isnan(val)) // Nulls in grid!
+               {
+                  xmsg  << "ossimHdf5GridModel:"<<__LINE__<<" encountered nans!";
+                  throw ossimException(xmsg.str());
+               }
+            }
+            else // Last column is outside of image bounds.
+            {
+               // Delta between last two latitude grid values.
+               ossim_float32 val1 = coarseGrid.getNode( x-2, y );
+               ossim_float32 val2 = coarseGrid.getNode( x-1, y );
+               ossim_float32 spacing = val2 - val1;
+               val = val2 + spacing;
+
+#if 0 /* Please leave for debug. (drb) */
+               cout << "val1: " << val1 << " val2 " << val2<<endl;;
+#endif
+            }
+
+            coarseGrid.setNode( x, y, val );
+
+#if 0 /* Please leave for debug. (drb) */
+            cout << "x,y,x_img,y_img,val:" << x << "," << y << ","<< x_img << "," << y_img << ","
+                  << coarseGrid.getNode(x, y) << endl;
+#endif
+         } // End sample loop.
+      }
+      else // Row is outside of image bounds:
+      {
+         // Sample loop:
+         for ( ossim_uint32 x = 0; x < gridCols; ++x )
+         {
+            ossim_float32 val = ossim::nan();
+            ossim_float32 val1 = coarseGrid.getNode( x, y-2 );
+            ossim_float32 val2 = coarseGrid.getNode( x, y-1 );
+            ossim_float32 spacing = val2 - val1;
+            val = val2 + spacing;
+           coarseGrid.setNode( x, y, val );
+
+#if 0 /* Please leave for debug. (drb) */
+            hsize_t x_img = x*GRID_SPACING; // Sample in image space
+            cout << "val1: " << val1 << " val2 " << val2
+                  << "\nx,y,x_img,y_img,val:" << x << "," << y << ","
+                  << x_img << "," << y_img << "," << val << endl;
+#endif
+         } // End sample loop.
+      } // Matches if ( y_img < m_imageSize.y ){...}else{
+   } // End line loop.
+
+   dataSpace.close();
+
+   return true;
+
+#if 0
+   // Original refactor code ###############################################
+
+   // Verify dimensions:
+   DataSpace dataSpace = dataset->getSpace();
+   if (dataSpace.getSimpleExtentNdims() != 2)
+   {
+      xmsg << "ossimHdf5GridModel:"<<__LINE__<<" ERROR: lat/lon grid dataspace rank != 2.";
+      throw ossimException(xmsg.str());
+   }
+
+   // Fetch size of grid in file. Extents are assumed to be the same for both lat and lon grids:
+   hsize_t datExtents[2];
+   dataSpace.getSimpleExtentDims(datExtents);
+   if ((datExtents[0] < 2) || (datExtents[1] < 2))
+   {
+      xmsg << "ossimHdf5GridModel:"<<__LINE__<<" ERROR: lat/lon grid size is < 2.";
+      throw ossimException(xmsg.str());
+   }
+
+   // Initialize the base class coarse grids:
+   theImageSize  = ossimDpt(datExtents[0], datExtents[1]);
+   ossimDrect uvRect(0, 0, theImageSize.u-1, theImageSize.v-1);
+   ossimDpt cgSpacing(GRID_SAMPLING_INTERVAL, GRID_SAMPLING_INTERVAL);
+   coarseGrid.initialize(uvRect, cgSpacing, ossim::nan());
+
+   // Declare data of interest in file (the whole thing):
+   hsize_t offset[2] = { 0, 0 };
+   dataSpace.selectHyperslab( H5S_SELECT_SET, datExtents, offset );
+
+   // Initialize dataspace for memory buffer needed by dataset read operation:
+   hsize_t bufExtents[2] = { (hsize_t) theImageSize.u, 1 };
+   DataSpace bufSpace(2, bufExtents);
+   DataType dataType = dataset->getDataType();
+   string cname = dataType.fromClass();
+   cout << cname<<endl;
+   if (dataType.getClass() != H5T_FLOAT)
+   {
+      xmsg << "ossimHdf5GridModel:"<<__LINE__<<" ERROR: lat/lon grid datatype must be float.";
+      throw ossimException(xmsg.str());
+   }
+   ossim_float32* buffer = new ossim_float32 [bufExtents[0]]; // assumes float datatype
+
+   // See if we need to swap bytes:
+   ossimEndian* endian = 0;
+   AtomType* atomType = dynamic_cast<AtomType*>(&dataType);
+   if(atomType)
+   {
+      ossimByteOrder ossimByteOrder = ossim::byteOrder();
+      H5T_order_t h5order = atomType->getOrder();
+      if( ((h5order == H5T_ORDER_LE) && (ossimByteOrder != OSSIM_LITTLE_ENDIAN)) ||
+            ((h5order == H5T_ORDER_BE) && (ossimByteOrder != OSSIM_BIG_ENDIAN)))
+         endian = new ossimEndian();
+   }
+
+   // Loop over input grid rows, sampling according to desired interval to fill output
+   // coarse grid, for latitude:
+   ossimIpt cgGridSize (coarseGrid.size());
+   ossim_uint32 x=0, y=0, u=0, v=0;
+   for ( ; (y<cgGridSize.y) && (v<theImageSize.v); ++y, v+=GRID_SAMPLING_INTERVAL )
+   {
+      offset[1] = v; // offset[0] always = 0
+      dataSpace.selectHyperslab( H5S_SELECT_SET, bufExtents, offset);
+      dataset->read( buffer, dataType,  bufSpace, dataSpace );
+      if ( endian )
+         endian->swap( buffer, bufExtents[0] );
+
+      // Need to subsample the input row and save into coarse grid:
+      for ( x=0, u=0; (x<cgGridSize.x)&&(u<theImageSize.u); ++x, u+=GRID_SAMPLING_INTERVAL)
+      {
+         { // TODO REMOVE DEBUG BLOCK
+            cout<<datasetName<<" ("<<x<<", "<<y<<"): "<<buffer[u]<<endl;
+         }
+
+         if ( ossim::isnan(buffer[u]))
+         {
+            xmsg << "ossimHdf5GridModel:"<<__LINE__<<" ERROR: encountered nans in lat/lon grid.";
+            throw ossimException(xmsg.str());
+         }
+         coarseGrid.setNode( x, y, buffer[u] );
+      }
+
+      // Check if last column is outside of image bounds.
+      if (x < cgGridSize.x)
+         coarseGrid.setNode( x, y, coarseGrid.getNode( x-1, y ) );
+   }
+
+   // Check if last row is outside of image bounds.
+   if (y < cgGridSize.y)
+   {
+      for ( x=0; x<cgGridSize.x; ++x)
+         coarseGrid.setNode( x, y, coarseGrid.getNode( x, y-1 ) );
+   }
+
+   delete dataset;
+   delete buffer;
+   delete endian;
+
+   return true;
+#endif
+}
+
+
+bool ossimHdf5GridModel::crossesDateline()
+{
+   bool crossesDateline = false;
+
+   ossim_int32 longitude = 0;
+   bool found179 = false;
+   bool found181 = false;
+
+   ossimIpt size (theLonGrid.size());
+   //double left, right;
+   //int xr = size.x-1;
+
+   for (ossim_uint32 y=0; (y<(ossim_uint32)size.y) && !crossesDateline; ++y )
+   {
+#if 0
+      left  = theLonGrid.getNode(0,  y);
+      right = theLonGrid.getNode(xr, y);
+      if (left > right)
+         crossesDateline = true;
+#endif
+
+      for ( ossim_uint32 x = 0; x<(ossim_uint32)size.x; ++x)
+      {
+         longitude = (ossim_int32) theLonGrid.getNode(x,  y); // Cast to integer.
+
+         // look for 179 -> -179...
+         if ( !found179 )
+         {
+            if ( longitude == 179 )
+            {
+               found179 = true;
+               continue;
+            }
+         }
+         else // found179 == true
+         {
+            if ( longitude == 178 )
+            {
+               break; // Going West, 179 -> 178
+            }
+            else if ( longitude == -179 )
+            {
+               crossesDateline = true;
+               break;
+            }
+         }
+
+         // look for -179 -> 179...
+         if ( !found181 )
+         {
+            if ( longitude == -179 )
+            {
+               found181 = true;
+               continue;
+            }
+         }
+         else // found181 == true
+         {
+            if ( longitude == -178 )
+            {
+               break; // Going East -179 -> -178
+            }
+            else if ( longitude == 179 )
+            {
+               crossesDateline = true;
+               break;
+            }
+         }
+      }
+   }
+
+   if ( crossesDateline )
+      theLonGrid.setDomainType(ossimDblGrid::WRAP_360);
+   else
+      theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
+
+   return crossesDateline;
+}
+
+
+bool ossimHdf5GridModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   bool stat = ossimCoarseGridModel::saveState(kwl, prefix);
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimCoarseGridModel", true);
+
+   return stat;
+}
+
diff --git a/src/hdf5/ossimHdf5ImageDataset.cpp b/src/hdf5/ossimHdf5ImageDataset.cpp
new file mode 100644
index 0000000..20f9b60
--- /dev/null
+++ b/src/hdf5/ossimHdf5ImageDataset.cpp
@@ -0,0 +1,832 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: OSSIM HDF5 Image DataSet.
+//
+//----------------------------------------------------------------------------
+// $Id
+
+#include <ossim/hdf5/ossimHdf5ImageDataset.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/hdf5/ossimHdf5ImageHandler.h>
+
+//---
+// This includes everything!  Note the H5 includes are order dependent; hence,
+// the mongo include.
+//---
+#include <hdf5.h>
+#include <H5Cpp.h>
+
+#include <iostream>
+
+ossimHdf5ImageDataset::ossimHdf5ImageDataset(ossimHdf5ImageHandler* owner)
+:  m_handler(owner),
+   m_dataset(0),
+   m_scalar(OSSIM_SCALAR_UNKNOWN),
+   m_bands(1),
+   m_lines(0),
+   m_samples(0),
+   m_endian(0)
+{   
+   if (owner)
+      m_hdf5 = owner->m_hdf5;
+
+   m_validRect.makeNan();
+}
+
+ossimHdf5ImageDataset::ossimHdf5ImageDataset( const ossimHdf5ImageDataset& obj )
+:  m_handler(obj.m_handler),
+   m_hdf5 (obj.m_hdf5),
+   m_dataset(obj.m_dataset),
+   m_scalar(obj.m_scalar),
+   m_bands(obj.m_bands),
+   m_lines(obj.m_lines),
+   m_samples(obj.m_samples),
+   m_endian( obj.m_endian ? new ossimEndian() : 0 ),
+   m_validRect(obj.m_validRect)
+{
+}
+
+ossimHdf5ImageDataset::~ossimHdf5ImageDataset()
+{
+   close();
+}
+
+const ossimHdf5ImageDataset& ossimHdf5ImageDataset::operator=( const ossimHdf5ImageDataset& rhs )
+{
+   if ( this != &rhs )
+   {
+      m_dataset     = rhs.m_dataset;
+      m_dataSpace   = rhs.m_dataSpace;
+      m_scalar      = rhs.m_scalar;
+      m_bands       = rhs.m_bands;
+      m_lines       = rhs.m_lines;
+      m_samples     = rhs.m_samples;
+      m_validRect   = rhs.m_validRect;
+      m_endian      = ( rhs.m_endian ? new ossimEndian() : 0 );
+   }
+   return *this;
+}
+
+bool ossimHdf5ImageDataset::initialize( const H5::DataSet& dataset)
+{
+   close();
+
+   m_dataset = dataset;
+
+   determineScalarType();
+
+//   if (!determineExtents() || !scanForValidImageRect() || !scanForMinMax())
+   if (!determineExtents())// || !scanForMinMax())
+      return false;
+
+   return true;
+
+} // End: ossimH5ImageDataset::initialize
+
+bool ossimHdf5ImageDataset::determineExtents()
+{
+   try
+   {
+      // Find the valid image rect. dataset may have null padding:
+      H5::DataSpace imageDataspace = m_dataset.getSpace();
+      int rank = imageDataspace.getSimpleExtentNdims();
+      if (rank < 2)
+         return false;
+
+      // Get the extents. Assuming dimensions are same for lat lon dataset.
+      std::vector<hsize_t> inputSize(rank);
+      imageDataspace.getSimpleExtentDims( &inputSize.front(), 0 );
+      m_lines = inputSize[0];
+      m_samples = inputSize[1];
+      m_validRect = ossimDrect(ossimDpt(0,0),ossimDpt(m_samples-1,m_lines-1));
+      if ( rank >= 3 )
+         m_bands = inputSize[2];
+      else
+         m_bands = 1;
+
+      if ( (m_lines == 0) || (m_samples == 0) )
+         return false;
+   }
+   catch( const H5::Exception& e )
+   {
+      std::cout << "ERROR:" << e.getDetailMsg()<< " \n";
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      return false;
+   }
+
+   return true;
+}
+
+bool ossimHdf5ImageDataset::scanForValidImageRect()
+{
+#if 0
+   // THIS IS ORIGINAL BURKEN CODE -- SEEMS TO SCAN TOO MUCH BUT MAYBE NEEDED IN POLAR PROJECTION
+   // CASES SO KEEPING AROUND (OLK 09/2016)
+   bool result = false;
+   H5::DataSpace imageDataspace = m_dataset.getSpace();
+   const ossim_int32 IN_DIM_COUNT = imageDataspace.getSimpleExtentNdims();
+
+   if ( IN_DIM_COUNT == 2 )
+   {
+      // Get the extents. Assuming dimensions are same for lat lon dataset.
+      std::vector<hsize_t> dimsOut(IN_DIM_COUNT);
+      imageDataspace.getSimpleExtentDims( &dimsOut.front(), 0 );
+
+      if ( dimsOut[0] && dimsOut[1] )
+      {
+
+         //---
+         // Capture the rectangle:
+         // dimsOut[0] is height, dimsOut[1] is width:
+         //---
+         m_validRect = ossimIrect( 0, 0,
+                                   static_cast<ossim_int32>( dimsOut[1]-1 ),
+                                   static_cast<ossim_int32>( dimsOut[0]-1 ) );
+
+         const ossim_int32 WIDTH  = m_validRect.width();
+
+         std::vector<hsize_t> inputCount(IN_DIM_COUNT);
+         std::vector<hsize_t> inputOffset(IN_DIM_COUNT);
+
+         inputOffset[0] = 0;
+         inputOffset[1] = 0;
+
+         inputCount[0] = 1;
+         inputCount[1] = WIDTH;
+
+         // Output dataspace dimensions.
+         const ossim_int32 OUT_DIM_COUNT = 3;
+         std::vector<hsize_t> outputCount(OUT_DIM_COUNT);
+         outputCount[0] = 1;     // single band
+         outputCount[1] = 1;     // single line
+         outputCount[2] = WIDTH; // whole line
+
+         // Output dataspace offset.
+         std::vector<hsize_t> outputOffset(OUT_DIM_COUNT);
+         outputOffset[0] = 0;
+         outputOffset[1] = 0;
+         outputOffset[2] = 0;
+
+         ossimScalarType scalar = getScalarType();
+         if ( scalar == OSSIM_FLOAT32 )
+         {
+            // Native type:
+            H5::DataType datatype = m_dataset.getDataType();
+
+            // Output dataspace always the same one line.
+            H5::DataSpace bufferDataSpace( OUT_DIM_COUNT, &outputCount.front());
+            bufferDataSpace.selectHyperslab( H5S_SELECT_SET,
+                                             &outputCount.front(),
+                                             &outputOffset.front() );
+
+            //---
+            // Dataset sample has NULL lines at the end so scan for valid rect.
+            // Use "<= -999" for test as per NOAA as it seems the NULL value is
+            // fuzzy.  e.g. -999.3.
+            //---
+            const ossim_float32 NULL_VALUE = -999.0;
+
+            //---
+            // VIIRS Radiance data has a -1.5e-9 in the first column.
+            // Treat this as a null.
+            //---
+            ossimString name = m_dataset.getObjName();
+            const ossim_float32 NULL_VALUE2 = ( name == "/All_Data/VIIRS-DNB-SDR_All/Radiance" )
+                                 ? -1.5e-9 : NULL_VALUE;
+            const ossim_float32 TOLERANCE = 0.1e-9; // For ossim::almostEqual()
+
+            // Hold one line:
+            std::vector<ossim_float32> values( WIDTH );
+
+            // Find the ul pixel:
+            ossimIpt ulIpt = m_validRect.ul();
+            bool found = false;
+
+            // Line loop to find upper left pixel:
+            while ( ulIpt.y <= m_validRect.lr().y )
+            {
+               inputOffset[0] = static_cast<hsize_t>(ulIpt.y);
+               imageDataspace.selectHyperslab( H5S_SELECT_SET,
+                                               &inputCount.front(),
+                                               &inputOffset.front() );
+
+               // Read data from file into the buffer.
+               m_dataset.read( (void*)&values.front(), datatype, bufferDataSpace, imageDataspace );
+
+               if ( m_endian )
+               {
+                  // If the endian pointer is initialized(not zero) swap the bytes.
+                  m_endian->swap( scalar, (void*)&values.front(), WIDTH );
+               }
+
+               // Sample loop:
+               ulIpt.x = m_validRect.ul().x;
+               ossim_int32 index = 0;
+               while ( ulIpt.x <= m_validRect.lr().x )
+               {
+                  if ( !ossim::almostEqual(values[index], NULL_VALUE2, TOLERANCE) &&
+                        ( values[index] > NULL_VALUE ) )
+                  {
+                     found = true; // Found valid pixel.
+                     break;
+                  }
+                  ++ulIpt.x;
+                  ++index;
+
+               } // End: sample loop
+
+               if ( found )
+               {
+                  break;
+               }
+
+               ++ulIpt.y;
+
+            } // End line loop to find ul pixel:
+
+            // Find the lower right pixel:
+            ossimIpt lrIpt = m_validRect.lr();
+            found = false;
+
+            // Line loop to find last pixel:
+            while ( lrIpt.y >= m_validRect.ul().y )
+            {
+               inputOffset[0] = static_cast<hsize_t>(lrIpt.y);
+               imageDataspace.selectHyperslab( H5S_SELECT_SET,
+                                               &inputCount.front(),
+                                               &inputOffset.front() );
+
+               // Read data from file into the buffer.
+               m_dataset.read( (void*)&values.front(), datatype, bufferDataSpace, imageDataspace );
+
+               if ( m_endian )
+               {
+                  // If the endian pointer is initialized(not zero) swap the bytes.
+                  m_endian->swap( scalar, (void*)&values.front(), WIDTH );
+               }
+
+               // Sample loop:
+               lrIpt.x = m_validRect.lr().x;
+               ossim_int32 index = WIDTH-1;
+
+               while ( lrIpt.x >= m_validRect.ul().x )
+               {
+                  if ( !ossim::almostEqual(values[index], NULL_VALUE2, TOLERANCE) &&
+                        ( values[index] > NULL_VALUE ) )
+                  {
+                     found = true; // Found valid pixel.
+                     break;
+                  }
+                  --lrIpt.x;
+                  --index;
+
+               } // End: sample loop
+
+               if ( found )
+               {
+                  break;
+               }
+
+               --lrIpt.y;
+
+            } // End line loop to find lower right pixel.
+
+            m_validRect = ossimIrect( ulIpt, lrIpt );
+            result = true;
+
+         }
+         else // Matches: if ( scalar == OSSIM_FLOAT32 ){...}
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+                                 << "ossimHdf5ImageDataset:"<<__LINE__<<" WARNING!"
+                                 << "\nUnhandled scalar type: "
+                                 << ossimScalarTypeLut::instance()->getEntryString( scalar )
+                                 << std::endl;
+         }
+
+      } // Matches: if ( dimsOut...
+
+   } // Matches: if ( IN_DIM_COUNT == 2 )
+
+   //cout << "ossimHdf5ImageDataset:"<<__LINE__<<" m_validRect = "<<m_validRect<<endl;
+   return true;
+
+#else
+   // REFACTORED
+   try
+   {
+      // Find the valid image rect. dataset may have null padding:
+      H5::DataSpace imageDataspace = m_dataset.getSpace();
+      H5::DataType dataType = m_dataset.getDataType();
+      ossim_uint32 elem_size = (ossim_uint32)dataType.getSize();
+
+      // Get the extents. Assuming dimensions are same for lat lon dataset.
+      hsize_t rowSize[2]  = { 1, m_samples };
+      hsize_t imageOffset[2] = { 0, 0 };
+
+      // Allocate space for read buffer:
+      char *rowBuf = new char[elem_size*m_samples];
+      char *fill_value = new char[elem_size];
+
+      // Output dataspace always the same one line.
+      H5::DataSpace bufferDataSpace( 2, rowSize);
+      bufferDataSpace.selectHyperslab( H5S_SELECT_SET, rowSize, imageOffset ); // offset = (0,0) here
+
+      // Figure out the null pixel value (unswapped since doing byte compare below):
+      H5Pget_fill_value(m_dataset.getId(), dataType.getId(), fill_value);
+
+      // Find the ul pixel. Loop over rows:
+      ossimIpt ulIpt (0,0);
+      bool found_valid = false;
+      for (; (ulIpt.y<(int)m_lines) && !found_valid; ulIpt.y++)
+      {
+         imageOffset[0] = ulIpt.y;
+         imageDataspace.selectHyperslab( H5S_SELECT_SET, rowSize, imageOffset);
+         m_dataset.read(rowBuf, dataType, bufferDataSpace, imageDataspace );
+
+         // Scan row for valid pixel:
+         ossim_int64 rowOffset = 0;
+         for (ulIpt.x=0; (ulIpt.x<(int)m_samples) && !found_valid; ulIpt.x++, rowOffset+=elem_size)
+            found_valid = (memcmp(&rowBuf[rowOffset], fill_value, elem_size) != 0);
+      }
+      if (!found_valid)
+         ulIpt = ossimIpt(0,0);
+
+      // Find the lr pixel. Loop over rows:
+      ossimIpt lrIpt (m_samples-1, m_lines-1);
+      found_valid = false;
+      for (; (lrIpt.y>ulIpt.y) && !found_valid; lrIpt.y--)
+      {
+         imageOffset[0] = lrIpt.y;
+         imageDataspace.selectHyperslab( H5S_SELECT_SET, rowSize, imageOffset);
+         m_dataset.read(rowBuf, dataType, bufferDataSpace, imageDataspace );
+
+         // Scan row for valid pixel:
+         ossim_int64 rowOffset = m_samples*elem_size - 1;
+         for (lrIpt.x=m_samples-1; (lrIpt.x>ulIpt.x) && !found_valid; lrIpt.x-- , rowOffset-=elem_size)
+            found_valid = (memcmp(&rowBuf[rowOffset], fill_value, elem_size) != 0);
+      }
+      if (!found_valid)
+         lrIpt = ossimIpt (m_samples-1, m_lines-1);
+
+      m_validRect.set_ul(ulIpt);
+      m_validRect.set_lr(lrIpt);
+
+      imageDataspace.close();
+
+      delete [] rowBuf;
+      delete [] fill_value;
+      return true;
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      return false;
+   }
+
+#endif
+}
+
+bool ossimHdf5ImageDataset::scanForMinMax()
+{
+   // Create buffer to hold the clip rect for a single band.
+   ossimScalarType scalarType = getScalarType();
+
+   if((scalarType == OSSIM_SCALAR_UNKNOWN)||
+      (scalarType == OSSIM_UINT64) ||
+      (scalarType == OSSIM_SINT64)
+      )
+   {
+      return false;
+   }
+   // if ((scalarType != OSSIM_FLOAT32) && (scalarType != OSSIM_FLOAT64) &&
+   //       (scalarType != OSSIM_UINT32)  && (scalarType != OSSIM_SINT32)  &&
+   //       (scalarType != OSSIM_UINT8)   && (scalarType != OSSIM_SINT8)   &&
+   //       (scalarType != OSSIM_UINT16)  && (scalarType != OSSIM_SINT16))
+   // {
+   //    return false;
+   // }
+
+   ossim_uint32 bufSizeInBytes = m_validRect.width()*ossim::scalarSizeInBytes(scalarType);
+   vector<char> dataBuffer(bufSizeInBytes);
+
+   // Get the extents. Assuming dimensions are same for lat lon dataset.
+   ossimIpt ulIpt (m_validRect.ul());
+   ossimIpt lrIpt (m_validRect.lr());
+   const ossim_float32 nullpix = m_handler->getNullPixelValue();
+   ossim_float32 epsilon = (ossim_float32)0.1e-9; // For ossim::almostEqual()
+
+   if (nullpix == 0.0)
+      epsilon = 0;
+
+   m_minValue.clear();
+   m_maxValue.clear();
+
+   ossimIrect clipRect (m_validRect.ul(), m_validRect.ur());
+   for (ossim_uint32 band=0; band<m_bands; ++band)
+   {
+      m_minValue.push_back(OSSIM_DEFAULT_MAX_PIX_FLOAT);
+      m_maxValue.push_back(OSSIM_DEFAULT_MIN_PIX_FLOAT);
+
+      for (int y=ulIpt.y; y<=lrIpt.y; y++)
+      {
+         clipRect.set_uly(y);
+         clipRect.set_lry(y);
+
+         getTileBuf(&dataBuffer.front(), clipRect, band, false);
+
+         // Scan and fix non-standard null value:
+         ossim_float32 value = 0;
+         for ( ossim_uint32 x=0; x<m_validRect.width(); ++x )
+         {
+            switch (scalarType)
+            {
+            case OSSIM_FLOAT32:
+               value = ((ossim_float32*)&dataBuffer.front())[x];
+               break;
+            case OSSIM_FLOAT64:
+               value = (ossim_float32) ((ossim_float64*)&dataBuffer.front())[x];
+               break;
+            case OSSIM_UINT8:
+            case OSSIM_SINT8:
+               value = (ossim_float32) ((char*)&dataBuffer.front())[x];
+               break;
+            case OSSIM_UINT16:
+            case OSSIM_SINT16:
+               value = (ossim_float32) ((ossim_int16*)&dataBuffer.front())[x];
+               break;
+            case OSSIM_UINT32:
+            case OSSIM_SINT32:
+               value = (ossim_float32) ((ossim_int32*)&dataBuffer.front())[x];
+               break;
+            default:
+               break;
+            }
+
+            if (ossim::almostEqual<ossim_float32>(value, nullpix, epsilon))
+               continue;
+            if (value > m_maxValue[band])
+               m_maxValue[band] = value;
+            if (value < m_minValue[band])
+               m_minValue[band] = value;
+         }
+      }
+   }
+
+   //cout<<"ossimHdf5ImageDataset:"<<__LINE__<<"\n\tminValue="<<m_minValue[0]<<
+   //      "\n\tmaxValue="<<m_maxValue[0]<<"\n\tnullValue="<<m_handler->getNullPixelValue()<<endl; // TODO REMOVE
+
+   return true;
+}
+
+void ossimHdf5ImageDataset::close()
+{
+   m_dataset.close();
+   delete m_endian;
+}
+
+const H5::DataSet* ossimHdf5ImageDataset::getDataset() const
+{
+   return &m_dataset;
+}
+
+H5::DataSet* ossimHdf5ImageDataset::getDataset()
+{
+   return &m_dataset;
+}
+
+string ossimHdf5ImageDataset::getName() const
+{
+   return m_dataset.getObjName();
+}
+
+ossimScalarType ossimHdf5ImageDataset::getScalarType() const
+{
+   return m_scalar;
+}
+
+bool ossimHdf5ImageDataset::determineScalarType()
+{
+   m_scalar = OSSIM_SCALAR_UNKNOWN;
+
+   try
+   {
+      H5T_class_t typeClass = m_dataset.getTypeClass();
+      if ( ( typeClass != H5T_INTEGER ) && ( typeClass != H5T_FLOAT ) )
+         return false;
+
+      hid_t mem_type_id = H5Dget_type( m_dataset.getId() );
+      if( mem_type_id < 0 )
+         return false;
+
+      hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
+      if( H5Tequal(H5T_NATIVE_CHAR, native_type) )
+         m_scalar = OSSIM_SINT8;
+      else if ( H5Tequal( H5T_NATIVE_UCHAR, native_type) )
+         m_scalar = OSSIM_UINT8;
+      else if( H5Tequal( H5T_NATIVE_SHORT, native_type) )
+         m_scalar = OSSIM_SINT16;
+      else if(H5Tequal(H5T_NATIVE_USHORT, native_type))
+         m_scalar = OSSIM_UINT16;
+      else if(H5Tequal( H5T_NATIVE_INT, native_type))
+         m_scalar = OSSIM_SINT32;
+      else if(H5Tequal( H5T_NATIVE_UINT, native_type ) )
+         m_scalar = OSSIM_UINT32;
+      else if(H5Tequal( H5T_NATIVE_LONG, native_type))
+         m_scalar = OSSIM_SINT32;
+      else if(H5Tequal( H5T_NATIVE_ULONG, native_type))
+         m_scalar = OSSIM_UINT32;
+      else if(H5Tequal( H5T_NATIVE_LLONG, native_type))
+         m_scalar = OSSIM_SINT64;
+      else if(H5Tequal( H5T_NATIVE_ULLONG, native_type))
+         m_scalar = OSSIM_UINT64;
+      else if(H5Tequal( H5T_NATIVE_FLOAT, native_type))
+         m_scalar = OSSIM_FLOAT32;
+      else if(H5Tequal( H5T_NATIVE_DOUBLE, native_type))
+         m_scalar = OSSIM_FLOAT64;
+      // See if we need to swap bytes:
+      if (m_hdf5->getByteOrder(&m_dataset) != ossim::byteOrder())
+         m_endian = new ossimEndian();
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+      return false;
+   }
+
+   return true;
+}
+
+ossim_uint32 ossimHdf5ImageDataset::getNumberOfBands() const
+{
+   return m_bands;
+}
+
+ossim_uint32 ossimHdf5ImageDataset::getNumberOfLines() const
+{
+   return m_validRect.height();
+}
+
+ossim_uint32 ossimHdf5ImageDataset::getNumberOfSamples() const
+{
+   return m_validRect.width();
+}
+
+bool ossimHdf5ImageDataset::getSwapFlag() const
+{
+   return (m_endian ? true: false);
+}
+
+const ossimIpt& ossimHdf5ImageDataset::getSubImageOffset() const
+{
+   return m_validRect.ul();
+}
+
+const ossimIrect& ossimHdf5ImageDataset::getValidImageRect() const
+{
+   return m_validRect;
+}
+
+void ossimHdf5ImageDataset::getTileBuf(void* buffer, const ossimIrect& rect,
+                                       ossim_uint32 band, bool /* scale */)
+{
+   static const char MODULE[] = "ossimHdf5ImageDataset::getTileBuf";
+
+   if (band >= m_bands)
+      return;
+
+   // Shift rectangle by the sub image offse (if any) from the m_validRect.
+   // NOTE: The rect coming in seems to be alreadyt in image space so no need to offset (OLK 09/2016)
+   ossimIrect irect = rect;// + m_validRect.ul();
+
+   try
+   {
+      // Turn off the auto-printing when failure occurs so that we can
+      // handle the errors appropriately
+      // H5::Exception::dontPrint();
+
+      // Get dataspace of the dataset.
+      H5::DataSpace imageDataSpace = m_dataset.getSpace();
+
+      // Number of dimensions of the input dataspace.:
+      const ossim_int32 IN_DIM_COUNT = imageDataSpace.getSimpleExtentNdims();
+
+      // Native type:
+      H5::DataType dataType = m_dataset.getDataType();
+
+      std::vector<hsize_t> inputCount(IN_DIM_COUNT);
+      std::vector<hsize_t> inputOffset(IN_DIM_COUNT);
+
+      if ( IN_DIM_COUNT == 2 )
+      {
+         inputOffset[0] = irect.ul().y;
+         inputOffset[1] = irect.ul().x;
+
+         inputCount[0] = irect.height();
+         inputCount[1] = irect.width();
+      }
+      else
+      {
+         inputOffset[0] = band;
+         inputOffset[1] = irect.ul().y;
+         inputOffset[2] = irect.ul().x;
+
+         inputCount[0] = 1;
+         inputCount[1] = irect.height();
+         inputCount[2] = irect.width();
+      }
+
+      // Define hyperslab in the dataset; implicitly giving strike strike and block NULL.
+      imageDataSpace.selectHyperslab( H5S_SELECT_SET,
+                                      &inputCount.front(),
+                                      &inputOffset.front() );
+
+      // Output dataspace dimensions.
+      const ossim_int32 OUT_DIM_COUNT = 3;
+      std::vector<hsize_t> outputCount(OUT_DIM_COUNT);
+      outputCount[0] = 1;             // single band
+      outputCount[1] = irect.height(); // lines
+      outputCount[2] = irect.width();  // samples
+
+      // Output dataspace offset.
+      std::vector<hsize_t> outputOffset(OUT_DIM_COUNT);
+      outputOffset[0] = band;
+      outputOffset[1] = 0;
+      outputOffset[2] = 0;
+
+      // Output dataspace.
+      H5::DataSpace bufferDataSpace( OUT_DIM_COUNT, &outputCount.front());
+      bufferDataSpace.selectHyperslab( H5S_SELECT_SET,
+                                       &outputCount.front(),
+                                       &outputOffset.front() );
+
+      // Read data from file into the buffer.
+      m_dataset.read( buffer, dataType, bufferDataSpace, imageDataSpace );
+
+      if ( m_endian )
+      {
+         // If the m_endian pointer is initialized(not zero) swap the bytes.
+         m_endian->swap( m_scalar, buffer, irect.area() );
+      }
+
+
+      //#define NEVER
+#ifdef NEVER
+      if (scale)
+      {
+         const ossim_float32 TOLERANCE = 0.1e-9; // For ossim::almostEqual()
+         // Scale the data:
+#if 1
+         // Assumes float32 datatype:
+         double gain = 1.0/( m_maxValue[band] - m_minValue[band] );
+         ossim_float32 null_value = m_handler->getNullPixelValue(band);
+         ossim_float32 value;
+         for (ossim_uint32 i=0; i<irect.area(); ++i)
+         {
+            value = ((ossim_float32*)buffer)[i];
+
+            if (!ossim::almostEqual(value,null_value, TOLERANCE))
+            {
+               value = gain*(value - m_minValue[band]);
+               ((ossim_float32*)buffer)[i] =value;
+            }
+         }
+#else
+         // Does not assume float32:
+         ossimScalarType scalarType = getScalarType();
+         double null_value = m_handler->getNullPixelValue(band);
+         for (ossim_uint32 i=0; i<irect.area(); ++i)
+         {
+            switch (scalarType)
+            {
+            case OSSIM_FLOAT32:
+               if (!ossim::almostEqual(((ossim_float32*)buffer)[i], (ossim_float32)null_value))
+                  ((ossim_float32*)buffer)[i] =
+                        (ossim_float32)(gain*(((ossim_float32*)buffer)[i] - m_minValue[band]));
+               break;
+            case OSSIM_FLOAT64:
+               if (!ossim::almostEqual(((ossim_float64*)buffer)[i], null_value))
+                  ((ossim_float64*)buffer)[i] =
+                        (ossim_float64)(gain*(((ossim_float64*)buffer)[i] - m_minValue[band]));
+               break;
+            case OSSIM_UINT8:
+               if (((ossim_uint8*)buffer)[i] != (ossim_uint8)null_value)
+                  ((ossim_uint8*)buffer)[i] =
+                        (ossim_uint8)(gain*(((ossim_uint8*)buffer)[i] - m_minValue[band]));
+               break;
+            case OSSIM_SINT8:
+               if (((ossim_sint8*)buffer)[i] != (ossim_sint8)null_value)
+                  ((ossim_sint8*)buffer)[i] =
+                        (ossim_sint8)(gain*(((ossim_sint8*)buffer)[i] - m_minValue[band]));
+               break;
+            case OSSIM_UINT16:
+               if (((ossim_uint16*)buffer)[i] != (ossim_uint16)null_value)
+                  ((ossim_uint16*)buffer)[i] =
+                        (ossim_uint16)(gain*(((ossim_uint16*)buffer)[i] - m_minValue[band]));
+               break;
+            case OSSIM_SINT16:
+               if (((ossim_sint16*)buffer)[i] != (ossim_sint16)null_value)
+                  ((ossim_sint16*)buffer)[i] =
+                        (ossim_sint16)(gain*(((ossim_sint16*)buffer)[i] - m_minValue[band]));
+               break;
+            case OSSIM_UINT32:
+               if (((ossim_uint32*)buffer)[i] != (ossim_uint32)null_value)
+                  ((ossim_uint32*)buffer)[i] =
+                        (ossim_uint32)(gain*(((ossim_uint32*)buffer)[i] - m_minValue[band]));
+               break;
+            case OSSIM_SINT32:
+               if (((ossim_sint32*)buffer)[i] != (ossim_sint32)null_value)
+                  ((ossim_sint32*)buffer)[i] =
+                        (ossim_sint32)(gain*(((ossim_sint32*)buffer)[i] - m_minValue[band]));
+               break;
+            default:
+               break;
+            }
+         }
+#endif
+      }
+#endif
+
+      // Cleanup:
+      bufferDataSpace.close();
+      dataType.close();
+      imageDataSpace.close();
+   }
+   catch( const H5::Exception& error )
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " caught H5 Exception!" << std::endl;
+      error.printError();
+   }
+
+   catch( ... )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<< MODULE << " caught unknown exception !" << std::endl;
+   }
+
+} // End: ossimH5ImageDataset::getTileBuf
+
+
+double ossimHdf5ImageDataset::getMaxPixelValue(ossim_uint32 band) const
+{
+   if (band < m_maxValue.size())
+      return m_maxValue[band];
+
+   return  ossim::defaultMax(m_scalar);
+}
+
+double ossimHdf5ImageDataset::getMinPixelValue(ossim_uint32 band) const
+{
+   if (band < m_minValue.size())
+      return m_minValue[band];
+   return  ossim::defaultMin(m_scalar);
+}
+
+bool ossimHdf5ImageDataset::isMinPixelSet()const
+{
+   return (!m_minValue.empty());
+}
+
+bool ossimHdf5ImageDataset::isMaxPixelSet()const
+{
+   return (!m_maxValue.empty());
+}
+
+std::ostream& ossimHdf5ImageDataset::print( std::ostream& out ) const
+{
+   try
+   {
+      out << "ossimH5ImageDataset: "
+            << "\nH5::DataSet::id: " << m_dataset.getId()
+            << "\nname:            " << m_dataset.getObjName()
+            << "\nscalar:          " << ossimScalarTypeLut::instance()->getEntryString( m_scalar )
+            << "\nbands:           " << m_bands
+            << "\nlines:           " << m_lines
+            << "\nsamples:         " << m_samples
+            << "\nvalid rect:      " << m_validRect
+            << "\nswap_flage:      " << (m_endian?"true":"false")
+            << std::endl;
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   return out;
+}
+
+std::ostream& operator<<( std::ostream& out, const ossimHdf5ImageDataset& obj )
+{
+   return obj.print( out );
+}
+
diff --git a/src/hdf5/ossimHdf5ImageHandler.cpp b/src/hdf5/ossimHdf5ImageHandler.cpp
new file mode 100644
index 0000000..caf61a4
--- /dev/null
+++ b/src/hdf5/ossimHdf5ImageHandler.cpp
@@ -0,0 +1,583 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: OSSIM HDF5 Reader.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimHdf5ImageHandler.cpp 19878 2011-07-28 16:27:26Z dburken $
+
+//#include "ossimH5GridModel.h"
+
+#include <ossim/hdf5/ossimHdf5ImageHandler.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/hdf5/ossimHdf5GridModel.h>
+static const ossimTrace traceDebug("ossimHdf5ImageHandler:debug");
+
+RTTI_DEF1(ossimHdf5ImageHandler, "ossimHdf5ImageHandler", ossimImageHandler)
+
+using namespace std;
+using namespace H5;
+
+static const string LAYER_KW = "layer";
+
+ossimHdf5ImageHandler::ossimHdf5ImageHandler()
+:  ossimImageHandler(),
+   m_entries(),
+   m_currentEntry(0),
+   m_tile(0),
+   m_mutex()
+{
+}
+
+ossimHdf5ImageHandler::~ossimHdf5ImageHandler()
+{
+   if (isOpen())
+   {
+      close();
+   }
+}
+
+void ossimHdf5ImageHandler::allocate()
+{
+   m_mutex.lock();
+   m_tile = ossimImageDataFactory::instance()->create(this, this);
+   m_tile->initialize();
+   m_mutex.unlock();
+}
+
+ossimRefPtr<ossimImageData> ossimHdf5ImageHandler::getTile(const ossimIrect& rect,
+                                                           ossim_uint32 resLevel)
+{
+   if ( m_tile.valid() == false ) // First time through.
+   {
+      allocate();
+   }
+
+   if (m_tile.valid())
+   {
+      // Image rectangle must be set prior to calling getTile.
+      m_mutex.lock();
+      m_tile->setImageRectangle(rect);
+      m_mutex.unlock();
+
+      if ( getTile( m_tile.get(), resLevel ) == false )
+      {
+         m_mutex.lock();
+         if (m_tile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            m_tile->makeBlank();
+         }
+         m_mutex.unlock();
+      }
+   }
+
+   return m_tile;
+}
+
+bool ossimHdf5ImageHandler::getTile(ossimImageData* result, ossim_uint32 resLevel)
+{
+   bool status = false;
+
+   m_mutex.lock();
+
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+         result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
+   {
+      result->ref(); // Increment ref count.
+
+      //---
+      // Check for overview tile.  Some overviews can contain r0 so always
+      // call even if resLevel is 0.  Method returns true on success, false
+      // on error.
+      //---
+      status = getOverviewTile(resLevel, result);
+
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+
+         ossimIrect tile_rect = result->getImageRectangle();
+
+         if ( ! tile_rect.completely_within(getImageRectangle(0)) )
+         {
+            // We won't fill totally so make blank first.
+            result->makeBlank();
+         }
+
+         if (getImageRectangle(0).intersects(tile_rect))
+         {
+            // Make a clip rect.
+            ossimIrect clipRect = tile_rect.clipToRect(getImageRectangle(0));
+
+            if (tile_rect.completely_within( clipRect) == false)
+            {
+               // Not filling whole tile so blank it out first.
+               result->makeBlank();
+            }
+
+            // Create buffer to hold the clip rect for a single band.
+            ossim_uint32 clipRectSizeInBytes = clipRect.area() *
+                  ossim::scalarSizeInBytes( m_entries[m_currentEntry]->getScalarType() );
+            vector<char> dataBuffer(clipRectSizeInBytes);
+
+            // Get the data.
+            for (ossim_uint32 band = 0; band < getNumberOfInputBands(); ++band)
+            {
+               // Hdf5 file to buffer:
+               m_entries[m_currentEntry]->getTileBuf(&dataBuffer.front(), clipRect, band);
+#if 0
+               // Scan and fix non-standard null value:
+               if ( m_entries[m_currentEntry]->getScalarType() == OSSIM_FLOAT32 )
+               {
+                  const ossim_float32 NP = getNullPixelValue(band);
+                  const ossim_uint32 COUNT = clipRect.area();
+                  ossim_float32* float_buffer = (ossim_float32*)&dataBuffer.front();
+                  for ( ossim_uint32 i = 0; i < COUNT; ++i )
+                  {
+                     if ( float_buffer[i] < -999.0 )
+                        float_buffer[i] = NP;
+                  }
+               }
+#endif
+               // Buffer to tile:
+               result->loadBand((void*)&dataBuffer.front(), clipRect, band);
+            }
+
+            // Validate the tile, i.e. full, partial, empty.
+            result->validate();
+         }
+         else // No intersection...
+         {
+            result->makeBlank();
+         }
+      }
+
+      result->unref();  // Decrement ref count.
+   }
+
+   m_mutex.unlock();
+
+   return status;
+}
+
+ossimIrect
+ossimHdf5ImageHandler::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return ossimIrect(0,
+                     0,
+                     getNumberOfSamples(reduced_res_level) - 1,
+                     getNumberOfLines(reduced_res_level)   - 1);
+}
+
+bool ossimHdf5ImageHandler::saveState(ossimKeywordlist& kwl,
+                                      const char* prefix) const
+{
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+bool ossimHdf5ImageHandler::loadState(const ossimKeywordlist& kwl,
+                                      const char* prefix)
+{
+   if (ossimImageHandler::loadState(kwl, prefix))
+   {
+      return open();
+   }
+
+   return false;
+}
+
+void ossimHdf5ImageHandler::loadMetaData()
+{
+   m_tile = 0;
+   ossimImageHandler::loadMetaData();
+}
+
+bool ossimHdf5ImageHandler::open()
+{
+   static const char* M = "ossimHdf5ImageHandler::open(filename) -- ";
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" Entering..." << std::endl;
+
+   // Start with a clean slate.
+   if (isOpen())
+   {
+      close();
+   }
+
+   // Check for empty filename.
+   if (theImageFile.empty())
+      return false;
+
+   theImageFile = theImageFile.expand();
+   m_hdf5 = new ossimHdf5;
+   if (!m_hdf5->open(theImageFile))
+   {
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" Unable to open image Leaving..." << std::endl;
+      m_hdf5 = 0;
+      return false;
+   }
+
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" Opened Image..." << std::endl;
+
+   vector<H5::DataSet> datasetList;
+   H5::Group root;
+   m_hdf5->getRoot(root);
+   m_hdf5->getNdimDatasets(root, datasetList, true);
+
+   if ( datasetList.empty() )
+   {
+      return false;
+      m_hdf5->close();
+      m_hdf5 = 0;
+   }
+   // Filter for specified renderable datasets:
+   if (m_renderableNames.size())
+   {
+      std::vector<H5::DataSet>::iterator dataset = datasetList.begin();
+      while (dataset != datasetList.end())
+      {
+         bool found=false;
+         ossimString dsName = dataset->getObjName();
+         std::vector<ossimString>::iterator name = m_renderableNames.begin();
+         while (name != m_renderableNames.end())
+         {
+            if (dsName.contains(*name))
+            {
+               found = true;
+               break;
+            }
+            ++name;
+         }
+         if (!found)
+            datasetList.erase(dataset);
+         else
+            ++dataset;
+      }
+   }
+#if 0
+   ossimNotify(ossimNotifyLevel_DEBUG)<< "ossimHdf5ImageHandler:"<<__LINE__ << " DEBUG\nDataset names:\n";
+   for ( ossim_uint32 i = 0; i < datasetList.size(); ++i )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "dataset[" << i << "]: "
+            << datasetList[i].getObjName() << "\n";
+   }
+#endif
+   if ( datasetList.empty() )
+   {
+      m_hdf5 = 0;
+      return false;
+   }
+
+   // Add the image dataset entries.
+   std::vector<H5::DataSet>::iterator dataset = datasetList.begin();
+   while (dataset != datasetList.end())
+   {
+      ossimRefPtr<ossimHdf5ImageDataset> oimgset = new ossimHdf5ImageDataset(this);
+      oimgset->initialize(*dataset);
+      m_entries.push_back(oimgset);
+      ++dataset;
+   }
+
+   // Initialize the current entry to be 0:
+   m_currentEntry = 999; // Forces init on change of index
+   setCurrentEntry(0);
+
+   // Establish a common geometry for all entries. TODO: Need to verify if this is a kosher thing
+   // to do. It may be that multiple entries have different geometries associated.
+   getImageGeometry();
+   if (!theGeometry.valid())
+      return false;
+
+#if 0 /* Please leave for debug. (drb) */
+   std::vector<ossimHdf5ImageDataset>::const_iterator i = m_entries.begin();
+   while ( i != m_entries.end() )
+   {
+      std::cout << (*i) << endl;
+      ++i;
+   }
+#endif
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" Leaving..." << std::endl;
+
+   return true;
+}
+
+
+ossim_uint32 ossimHdf5ImageHandler::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   ossim_uint32 r = 0;
+   if (reduced_res_level == 0)
+   {
+      if (m_currentEntry < m_entries.size())
+         r = m_entries[m_currentEntry]->getNumberOfLines();
+   }
+   else if ( theOverview.valid() )
+   {
+      r = theOverview->getNumberOfLines(reduced_res_level);
+   }
+
+   return r;
+}
+
+ossim_uint32 ossimHdf5ImageHandler::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   ossim_uint32 r = 0;
+   if (reduced_res_level == 0)
+   {
+      if (m_currentEntry < m_entries.size())
+         r = m_entries[m_currentEntry]->getNumberOfSamples();
+   }
+   else if ( theOverview.valid() )
+   {
+      r = theOverview->getNumberOfSamples(reduced_res_level);
+   }
+
+   return r;
+}
+
+ossim_uint32 ossimHdf5ImageHandler::getImageTileWidth() const
+{
+   return 0; // Not tiled format.
+}
+
+ossim_uint32 ossimHdf5ImageHandler::getImageTileHeight() const
+{
+   return 0; // Not tiled format.
+}
+
+ossimString ossimHdf5ImageHandler::getShortName()const
+{
+   return ossimString("ossim_hdf5_reader");
+}
+
+ossimString ossimHdf5ImageHandler::getLongName()const
+{
+   return ossimString("ossim hdf5 reader");
+}
+
+ossimString  ossimHdf5ImageHandler::getClassName()const
+{
+   return ossimString("ossimHdf5ImageHandler");
+}
+
+ossim_uint32 ossimHdf5ImageHandler::getNumberOfInputBands() const
+{
+   ossim_uint32 result = 1;
+
+   if ( m_currentEntry < m_entries.size() )
+      result = m_entries[m_currentEntry]->getNumberOfBands();
+
+   return result;
+}
+
+ossim_uint32 ossimHdf5ImageHandler::getNumberOfOutputBands()const
+{
+   // Currently not band selectable.
+   return getNumberOfInputBands();
+}
+
+ossimScalarType ossimHdf5ImageHandler::getOutputScalarType() const
+{
+   ossimScalarType result = OSSIM_SCALAR_UNKNOWN;
+
+   if ( m_currentEntry < m_entries.size() )
+   {
+      result = m_entries[m_currentEntry]->getScalarType();
+   }
+
+   return result;
+}
+
+bool ossimHdf5ImageHandler::isOpen()const
+{
+   return ( m_hdf5.valid() &&  m_entries.size() && (m_currentEntry < m_entries.size()));
+}
+
+void ossimHdf5ImageHandler::close()
+{
+   // Close the datasets.
+   m_entries.clear();
+
+   // Then the file.
+   if ( m_hdf5.valid() )
+      m_hdf5 = 0;
+
+   // ossimRefPtr so assign to 0(unreferencing) will handle memory.
+   m_tile = 0;
+
+   ossimImageHandler::close();
+}
+
+ossim_uint32 ossimHdf5ImageHandler::getNumberOfEntries() const
+{
+   return (ossim_uint32)m_entries.size();
+}
+
+void ossimHdf5ImageHandler::getEntryNames(std::vector<ossimString>& entryNames) const
+{
+   entryNames.clear();
+   for (ossim_uint32 i=0; i<m_entries.size(); ++i )
+   {
+      entryNames.push_back(m_entries[i]->getName());
+   }
+}
+
+void ossimHdf5ImageHandler::getEntryList(std::vector<ossim_uint32>& entryList) const
+{
+   const ossim_uint32 SIZE = m_entries.size();
+   entryList.resize( SIZE );
+   for ( ossim_uint32 i = 0; i < SIZE; ++i )
+   {
+      entryList[i] = i; 
+   }
+}
+
+bool ossimHdf5ImageHandler::setCurrentEntry( ossim_uint32 entryIdx)
+{
+   bool result = true;
+   if (m_currentEntry != entryIdx)
+   {
+      // Entries always start at zero and increment sequentially..
+      if ( entryIdx < m_entries.size() )
+      {
+         theOverviewFile.clear();
+         m_currentEntry = entryIdx;
+         m_tile = 0;
+         ossimIrect validRect = m_entries[entryIdx]->getValidImageRect();
+         theValidImageVertices.clear();
+         theValidImageVertices.push_back(validRect.ul());
+         theValidImageVertices.push_back(validRect.ur());
+         theValidImageVertices.push_back(validRect.lr());
+         theValidImageVertices.push_back(validRect.ll());
+
+         if ( isOpen() )
+            completeOpen();
+      }
+      else
+      {
+         result = false; // Entry index out of range.
+      }
+   }
+
+   return result;
+}
+
+ossim_uint32 ossimHdf5ImageHandler::getCurrentEntry() const
+{
+   return m_currentEntry;
+}
+
+ossimRefPtr<ossimHdf5ImageDataset> ossimHdf5ImageHandler::getCurrentDataset()
+{
+   if ( m_currentEntry >= m_entries.size() )
+      return 0;
+
+   return m_entries[m_currentEntry];
+}
+
+double ossimHdf5ImageHandler::getNullPixelValue( ossim_uint32 band ) const
+{
+   return ossimImageHandler::getNullPixelValue( band );
+}
+
+double ossimHdf5ImageHandler::getMaxPixelValue( ossim_uint32 band ) const
+{
+   if ( m_currentEntry >= m_entries.size() )
+   {
+      if(m_entries[m_currentEntry]->isMaxPixelSet())
+      {
+         return m_entries[m_currentEntry]->getMaxPixelValue(band);
+      }
+   }
+   return ossimImageHandler::getMaxPixelValue( band );
+}
+
+double ossimHdf5ImageHandler::getMinPixelValue( ossim_uint32 band ) const
+{
+   if ( m_currentEntry >= m_entries.size() )
+   {
+      if(m_entries[m_currentEntry]->isMinPixelSet())
+      {
+         return m_entries[m_currentEntry]->getMinPixelValue(band);
+      }
+   }
+   return ossimImageHandler::getMinPixelValue( band );
+}
+
+void ossimHdf5ImageHandler::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if ( !property.valid() )
+      return;
+
+   if ( property->getName().string() == LAYER_KW )
+   {
+      ossimString s;
+      property->valueToString(s);
+      ossim_uint32 SIZE = (ossim_uint32)m_entries.size();
+      for ( ossim_uint32 i = 0; i < SIZE; ++i )
+      {
+         if ( m_entries[i]->getName() == s.string() )
+         {
+            setCurrentEntry( i );
+         }
+      }
+   }
+   else
+   {
+      ossimImageHandler::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimHdf5ImageHandler::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+   if ( name.string() == LAYER_KW )
+   {
+      if ( m_currentEntry < m_entries.size() )
+      {
+         ossimString value = m_entries[m_currentEntry]->getName();
+         prop = new ossimStringProperty(name, value);
+      }
+   }
+   else
+   {
+      prop = ossimImageHandler::getProperty(name);
+   }
+   return prop;
+}
+
+void ossimHdf5ImageHandler::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back( ossimString("layer") );
+   ossimImageHandler::getPropertyNames(propertyNames);
+}
+
diff --git a/src/hdf5/ossimHdf5Info.cpp b/src/hdf5/ossimHdf5Info.cpp
new file mode 100644
index 0000000..3406e90
--- /dev/null
+++ b/src/hdf5/ossimHdf5Info.cpp
@@ -0,0 +1,1371 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: HDF5 Info class.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/hdf5/ossimHdf5Info.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/hdf5/ossimHdf5.h>
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
+using namespace std;
+using namespace H5;
+
+ossimHdf5Info::ossimHdf5Info()
+: ossimInfoBase()
+{
+}
+
+ossimHdf5Info::ossimHdf5Info(ossimHdf5* hdf5)
+: ossimInfoBase(),
+  m_hdf5 (hdf5)
+{
+}
+
+ossimHdf5Info::~ossimHdf5Info()
+{
+   m_hdf5 = 0;
+}
+
+bool ossimHdf5Info::open(const ossimFilename& file)
+{
+   m_hdf5 = new ossimHdf5;
+   if (!m_hdf5->open(file))
+   {
+      m_hdf5 = 0;
+      return false;
+   }
+   return true;
+}
+
+// Top level print from root
+ostream& ossimHdf5Info::print(ostream& out) const
+{
+   if (!m_hdf5.valid())
+   {
+      out<<"ossimHdf5Info: No HDF5 file has been opened! Nothing to print."<<endl;
+      return out;
+   }
+
+   try
+   {
+      Group root;
+      if (!m_hdf5->getRoot(root))
+         return out;
+      print(out, root, "");
+      out<<endl;
+   }
+   catch (H5::Exception& h5x)
+   {
+      h5x.getDetailMsg();
+   }
+
+   return out;
+}
+
+// GROUP LIST
+ostream& ossimHdf5Info::printSubGroups(std::ostream& out, const H5::Group& group,
+                                       const ossimString& lm) const
+{
+   vector<Group> groups;
+   if (!m_hdf5->getChildGroups(group, groups))
+      return out;
+   if (!groups.empty())
+   {
+      for (ossim_uint32 i=0; i<groups.size(); ++i)
+         print(out, groups[i], lm);
+   }
+   return out;
+}
+
+// ATTRIBUTE LIST
+ostream& ossimHdf5Info::printAttributes(std::ostream& out, const H5::H5Object& obj,
+                                        const ossimString& lm) const
+{
+   vector<Attribute> attributes;
+   if (!m_hdf5->getAttributes(obj, attributes))
+      return out;
+
+   if (!attributes.empty())
+   {
+      for (ossim_uint32 i=0; i<attributes.size(); ++i)
+         print(out, attributes[i], lm);
+   }
+   return out;
+}
+
+// DATASET LIST
+ostream& ossimHdf5Info::printDatasets(std::ostream& out, const H5::Group& group,
+                                      const ossimString& lm) const
+{
+   vector<DataSet> datasets;
+   if (!m_hdf5->getDatasets(group, datasets))
+      return out;
+
+   if (!datasets.empty())
+   {
+      for (ossim_uint32 i=0; i<datasets.size(); ++i)
+         print(out, datasets[i], lm);
+   }
+   return out;
+}
+
+// GROUP
+ostream& ossimHdf5Info::print(ostream& out, const H5::Group& group, const ossimString& lm) const
+{
+   try
+   {
+      out<<lm<<"GROUP: "<<group.getObjName()<<endl;
+
+      // Set indent for children:
+      ossimString lm2 (lm + "  ");
+
+      // List attributes:
+      printAttributes(out, group, lm2);
+
+      // List Datasets:
+      printDatasets(out, group, lm2);
+
+      // List Child Groups:
+      printSubGroups(out, group, lm2);
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   return out;
+}
+
+// DATASET
+ostream& ossimHdf5Info::print(ostream& out, const H5::DataSet& dataset, const ossimString& lm) const
+{
+   try
+   {
+      out<<lm<<"DATASET: "<<dataset.getObjName()<<endl;
+
+      // Dump its components:
+      int set_size = dataset.getSpace().getSimpleExtentNpoints();
+      ossimString lm2 (lm + "  ");
+      print(out, dataset.getDataType(), lm2);
+      print(out, dataset.getSpace(), lm2);
+
+      // Dump dataset values for small datasets:
+      H5T_class_t class_type = dataset.getDataType().getClass();
+      if ((set_size < 11) && (class_type == H5T_STRING))
+      {
+         string values;
+         dataset.read(values, dataset.getDataType());
+         out<<lm<<"  values: "<<values<<endl;
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   return out;
+}
+
+// DATATYPE
+ostream& ossimHdf5Info::print(ostream& out, const H5::DataType& datatype, const ossimString& lm) const
+{
+   try
+   {
+      H5T_class_t class_type = datatype.getClass();
+      size_t size = datatype.getSize();
+      bool isAtomic = false;
+      switch (class_type)
+      {
+      case H5T_INTEGER:
+         isAtomic = true;
+         out<<lm<<"DATATYPE: integer, "<<size<<" bytes ";
+         break;
+      case H5T_FLOAT:
+         isAtomic = true;
+         out<<lm<<"DATATYPE: float, "<<size<<" bytes ";
+         break;
+      case H5T_TIME:
+         out<<lm<<"DATATYPE: date/time, "<<size<<" bytes "<<endl;
+         break;
+      case H5T_STRING:
+         out<<lm<<"DATATYPE: string, "<<size<<" bytes ";
+         break;
+      case H5T_BITFIELD:
+         out<<lm<<"DATATYPE: bit-field, "<<size<<" bytes "<<endl;
+         break;
+      case H5T_OPAQUE:
+         out<<lm<<"DATATYPE: opaque, "<<size<<" bytes "<<endl;
+         break;
+      case H5T_COMPOUND:
+         out<<lm<<"DATATYPE: compound, "<<size<<" bytes "<<endl;
+         break;
+      case H5T_REFERENCE:
+         out<<lm<<"DATATYPE: reference, "<<size<<" bytes "<<endl;
+         break;
+      case H5T_ENUM:
+         out<<lm<<"DATATYPE: enumeration, "<<size<<" bytes "<<endl;
+         break;
+      case H5T_VLEN:
+         out<<lm<<"DATATYPE: variable-length, "<<size<<" bytes "<<endl;
+         break;
+      case H5T_ARRAY:
+         out<<lm<<"DATATYPE: array, "<<size<<" bytes "<<endl;
+         break;
+      default:
+         out<<lm<<"DATATYPE: unknown, "<<size<<" bytes "<<endl;
+      }
+
+      if (isAtomic)
+      {
+         H5T_order_t order = ((AtomType&) datatype).getOrder();
+         switch (order)
+         {
+         case H5T_ORDER_LE:
+            out<<"(Little Endian)"<<endl;
+            break;
+         case H5T_ORDER_BE:
+            out<<"(Big Endian)"<<endl;
+            break;
+         default:
+            out<<endl;
+            break;
+         }
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+
+   return out;
+}
+
+// DATASPACE
+ostream& ossimHdf5Info::print(ostream& out, const H5::DataSpace& dataspace, const ossimString& lm) const
+{
+   int rank = 0;
+   hsize_t* dim_sizes = 0;
+
+   try
+   {
+      H5S_class_t classT = dataspace.getSimpleExtentType();
+      switch (classT)
+      {
+      case H5S_SCALAR:
+         out<<lm<<"DATASPACE: (scalar)"<<endl;
+         break;
+      case H5S_SIMPLE:
+         rank = dataspace.getSimpleExtentNdims();
+         dim_sizes = new hsize_t[rank];
+         dataspace.getSimpleExtentDims(dim_sizes);
+         out<<lm<<"DATASPACE: simple, rank: "<<rank<<"  size: ";
+         for (int i=0; i<rank; i++)
+         {
+            int dim_size = dim_sizes[i];
+            if (i > 0)
+               out<<" x ";
+            out<<dim_size;
+         }
+         out<<endl;
+         delete dim_sizes;
+         break;
+      case H5S_NULL:
+         out<<lm<<"DATASPACE: (NULL)"<<endl;
+         break;
+      default:
+         out<<lm<<"DATASPACE: (Unknown Type)"<<endl;
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   return out;
+}
+
+// ATTRIBUTE
+ostream& ossimHdf5Info::print(ostream& out, const H5::Attribute& attr, const ossimString& lm) const
+{
+   out<<lm<<"ATTRIBUTE: "<<attr.getName();
+
+   try
+   {
+      std::string str_value;
+      char buf[1024];
+      //int int_value = 0;
+      ossimString lm2 (lm + "  ");
+      ossimByteOrder order = m_hdf5->getByteOrder(&attr);
+      ossimEndian endian;
+      bool swapOrder = (order!=ossim::byteOrder());
+
+      H5T_class_t class_type = attr.getDataType().getClass();
+      ossim_uint32 dataSize = attr.getDataType().getSize();
+      switch (class_type)
+      {
+      case H5T_STRING:
+         attr.read(attr.getDataType(), str_value);
+         out <<" = "<<str_value<<endl;
+         break;
+      case H5T_INTEGER:
+      {
+         std::string strValue;
+         attr.read(attr.getDataType(), buf);
+         ossim_uint32 signType = H5Tget_sign(attr.getDataType().getId());
+         switch(dataSize)
+         {
+            case 1: // one byte integer
+            {
+               switch(signType)
+               {
+                  case H5T_SGN_NONE:
+                  {
+                    ossim_uint8* intValue=0;
+                    intValue = reinterpret_cast<ossim_uint8*>(buf);
+                    strValue = ossimString::toString(*intValue).string();
+
+                     break;
+                  }
+                  case H5T_SGN_2:
+                  {
+                    ossim_int8* intValue=0;
+                    intValue = reinterpret_cast<ossim_int8*>(buf);
+                    strValue = ossimString::toString(*intValue).string();
+
+                    break;
+                  }
+                  default:
+                  {
+                     break;
+                  }
+               }
+               break;
+            }
+            case 2:  // 2 byte integer
+            {
+               switch(signType)
+               {
+                  case H5T_SGN_NONE: // unsigned
+                  {
+                    ossim_uint16* intValue=0;
+                    intValue = reinterpret_cast<ossim_uint16*>(buf);
+                    if (swapOrder)
+                       endian.swap(*intValue);
+                    strValue = ossimString::toString(*intValue).string();
+
+                     break;
+                  }
+                  case H5T_SGN_2: // Signed
+                  {
+                    ossim_int16* intValue=0;
+                    intValue = reinterpret_cast<ossim_int16*>(buf);
+                    if (swapOrder)
+                       endian.swap(*intValue);
+                    strValue = ossimString::toString(*intValue).string();
+                    break;
+                  }
+                  default:
+                  {
+                     break;
+                  }
+
+               }
+               break;
+            }
+            case 4: // 4 byte integer
+            {
+               switch(signType)
+               {
+                  case H5T_SGN_NONE:
+                  {
+                    ossim_uint32* intValue=0;
+                    intValue = reinterpret_cast<ossim_uint32*>(buf);
+                    if (swapOrder)
+                       endian.swap(*intValue);
+                    strValue = ossimString::toString(*intValue).string();
+
+                     break;
+                  }
+                  case H5T_SGN_2:
+                  {
+                    ossim_int32* intValue=0;
+                    intValue = reinterpret_cast<ossim_int32*>(buf);
+                    if (swapOrder)
+                       endian.swap(*intValue);
+                    strValue = ossimString::toString(*intValue).string();
+                    break;
+                  }
+                  default:
+                  {
+                     break;
+                  }
+               }
+               break;
+            }
+            case 8: // 8 byte integer
+            {
+               switch(signType)
+               {
+                  case H5T_SGN_NONE:
+                  {
+                    ossim_uint64* intValue=0;
+                    intValue = reinterpret_cast<ossim_uint64*>(buf);
+                    if (swapOrder)
+                       endian.swap(*intValue);
+                    strValue = ossimString::toString(*intValue).string();
+
+                     break;
+                  }
+                  case H5T_SGN_2:
+                  {
+                    ossim_int64* intValue=0;
+                    intValue = reinterpret_cast<ossim_int64*>(buf);
+                    if (swapOrder)
+                       endian.swap(*intValue);
+                    strValue = ossimString::toString(*intValue).string();
+                    break;
+                  }
+               }
+               break;
+            }
+
+         }
+         out <<" = "<<strValue<<endl;
+         break;
+      }
+      case H5T_FLOAT:
+      {
+         std::string strValue;
+         attr.read(attr.getDataType(), buf);
+         switch(dataSize)
+         {
+            // we will use a buf pointer.  There is something going on with some datasets
+            // and the attribute reader core dumping when providing the address of a float
+            // To fix this we will use a char* buf and reinterpret the cast.
+            case 4:
+            {
+               ossim_float32* float_value=0;
+               float_value = reinterpret_cast<ossim_float32*>(buf);
+               if (swapOrder)
+                  endian.swap(*float_value);
+               strValue = ossimString::toString(*float_value).string();
+               break;
+            }
+            case 8:
+            {
+               ossim_float64* float_value=0;
+               float_value = reinterpret_cast<ossim_float64*>(buf);
+               if (swapOrder)
+                  endian.swap(*float_value);
+               strValue = ossimString::toString(*float_value).string();
+               break;
+            }
+         }
+         out <<" = "<<strValue<<endl;
+         break;
+      }
+      default:
+         out <<" (value not handled type) "<<endl;
+         print(out, attr.getDataType(), lm2);
+         print(out, attr.getSpace(), lm2);
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   return out;
+}
+
+bool ossimHdf5Info::getKeywordlist(ossimKeywordlist& kwl) const
+{
+   m_kwl.clear();
+
+   try
+   {
+      if (!m_hdf5.valid())
+         return false;
+
+      string groupName     = "/";
+      string prefix        = "hdf5.";
+
+      Group root;
+      if (!m_hdf5->getRoot(root))
+         return false;
+
+      ossim_uint32 recurseCount = 0;
+      dumpGroup(root, prefix, recurseCount);
+
+      // Dump daset names:
+      vector<DataSet> datasets;
+      vector<std::string> datasetNames;
+      m_hdf5->getDatasets(root, datasets, true );
+      ostringstream value;
+      value << "(";
+      for (ossim_uint32 i=0; i<datasets.size(); ++i)
+      {
+         if (i == 0)
+            value << datasets[i].getObjName();
+         else
+            value << ", "<< datasets[i].getObjName();
+      }
+      value<<")";
+      m_kwl.addPair(prefix, string("datasetnames"), value.str());
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+
+   kwl = m_kwl;
+   return true;
+}
+
+bool ossimHdf5Info::getKeywordlistDataset(ossimKeywordlist& kwl, const std::string& datasetName) const
+{
+  bool returnValue = false;
+  m_kwl.clear();
+  Group root;
+  if (m_hdf5->getRoot(root))
+  {
+     H5::DataSet* dataset = m_hdf5->findDatasetByName(datasetName, &root, true);
+     if(dataset)
+     {
+         try{
+            dumpDataset(*dataset, "");
+            returnValue = true;
+            kwl = m_kwl;
+
+         }
+         catch(...)
+         {
+
+         }
+        delete dataset;
+     }
+  }
+  return returnValue; 
+}
+
+bool ossimHdf5Info::getKeywordlistGroup(ossimKeywordlist& kwl, const std::string& groupName) const
+{
+  bool returnValue = false;
+  m_kwl.clear();
+  Group root;
+  ossim_uint32 recurseCount = 0;
+
+  if (m_hdf5->getRoot(root))
+  {
+     H5::Group* group = m_hdf5->findGroupByName(groupName, &root, true);
+     if(group)
+     {
+         try{
+            dumpGroup(*group, "", recurseCount);
+            returnValue = true;
+            kwl = m_kwl;
+
+         }
+         catch(...)
+         {
+
+         }
+        delete group;
+     }
+  }
+  return returnValue; 
+}
+
+void ossimHdf5Info::dumpGroup(const Group& group,
+                              const string& prefix,
+                              ossim_uint32& recursedCount) const
+{
+   ++recursedCount;
+
+   try
+   {
+      ossimString groupPrefix = getObjectPrefix(prefix, group.getObjName());
+      m_kwl.addPair(groupPrefix, string("type"), string("Group"));
+
+      // Dump all attributes for this group:
+      dumpAttributes(group, groupPrefix);
+
+      // Dump all datasets under this group:
+      vector<DataSet> datasets;
+      m_hdf5->getDatasets(group, datasets);
+      for (ossim_uint32 i=0; i<datasets.size(); ++i)
+      {
+         dumpDataset(datasets[i], groupPrefix);
+      }
+
+      // Dump child Groups:
+      vector<Group> childGroups;
+      m_hdf5->getChildGroups(group, childGroups, false);
+      for (ossim_uint32 i=0; i<childGroups.size(); ++i)
+      {
+         dumpGroup(childGroups[i], groupPrefix, recursedCount);
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+   --recursedCount;
+}
+
+ossimString ossimHdf5Info::getObjectPrefix(const ossimString& prefix,
+                                           const ossimString& fullPathName) const
+{
+   vector<ossimString> items;
+   fullPathName.split(items, "/");
+   ossimString objectName (items.back());
+
+   ostringstream objectPrefix;
+   if (objectName.empty())
+      objectPrefix << prefix;
+   else
+      objectPrefix << prefix << objectName<<".";
+
+   return objectPrefix.str();
+}
+
+void ossimHdf5Info::dumpAttributes(const H5Object& obj, const std::string& prefix) const
+{
+   try
+   {
+      vector<H5::Attribute> attrList;
+      m_hdf5->getAttributes(obj, attrList);
+      for ( ossim_uint32 i = 0; i < attrList.size(); ++i )
+      {
+         ostringstream attrPrefix;
+         attrPrefix << prefix;//<<"attribute"<<i<<".";
+         dumpAttribute( attrList[i], attrPrefix.str());
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+}
+
+void ossimHdf5Info::dumpAttribute(const H5::Attribute& attr,
+                                  const std::string& prefix) const
+{
+   std::string strValue;
+   char buf[1024];
+   try
+   {
+      ossimByteOrder order = m_hdf5->getByteOrder(&attr);
+      ossimEndian endian;
+      // bool swapOrder = (order!=ossim::byteOrder());
+
+      H5T_class_t class_type = attr.getDataType().getClass();
+      // ossim_uint32 dataSize = attr.getDataType().getSize();
+      switch (class_type)
+      {
+         case H5T_STRING:
+         {
+            attr.read(attr.getDataType(), strValue);
+            break;
+         }
+         case H5T_INTEGER:
+         {
+            H5::DataType  dataType = attr.getDataType();
+            H5::IntType*  dataTypePtr = (H5::IntType*)(&dataType);
+
+            attr.read(attr.getDataType(), buf);
+            ossimHdf5::intTypeToString(strValue, *dataTypePtr, buf);
+            break;
+         }
+         case H5T_FLOAT:
+         {
+            H5::DataType  dataType = attr.getDataType();
+            H5::FloatType*  dataTypePtr = (H5::FloatType*)(&dataType);
+
+            attr.read(attr.getDataType(), buf);
+            ossimHdf5::floatTypeToString(strValue, *dataTypePtr, buf);
+            break;
+         }
+         case H5T_COMPOUND:
+         {
+            //H5::DataType  dataType = attr.getDataType();
+            //H5::FloatType*  dataTypePtr = (H5::FloatType*)(&dataType);
+
+            //H5::CompType compType(dataset);
+            //dumpCompoundTypeInfo(compType, datasetPrefix);
+            //dumpCompound(dataset, compType, datasetPrefix);
+            // ostringstream tempOut;
+
+            // tempOut << "(" <<"H5T_COMPOUND not a handled type)";
+            // strValue = tempOut.str();
+           
+         }
+         default:
+         {
+            ostringstream tempOut;
+
+            tempOut << "(" << ossimHdf5::getDatatypeClassType(class_type) <<" not a handled type)";
+            strValue = tempOut.str();
+         }
+      }
+
+      ossimString attrKey (getObjectPrefix(prefix, attr.getName()));
+      m_kwl.addPair(prefix, attr.getName(), strValue);
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+}
+
+
+void ossimHdf5Info::dumpDataset(const H5::DataSet& dataset,
+                                const std::string& prefix) const
+{
+#if 0
+   std::cout << "printObject entered..."
+         << "\nobjectName: " << objectName
+         << "\nprefix: " << prefix
+         << std::endl;
+#endif
+
+   try
+   {
+      string datasetPrefix = getObjectPrefix(prefix, dataset.getObjName());
+      m_kwl.addPair(datasetPrefix, string("type"), string("DataSet"));
+
+      // Dump all attributes for this dataset:
+      dumpAttributes(dataset, datasetPrefix);
+
+      // Get the class of the datatype that is used by the dataset.
+      H5T_class_t type_class = dataset.getTypeClass();
+      m_kwl.addPair(datasetPrefix, "class_type", m_hdf5->getDatatypeClassType(type_class));
+
+      // Dump specific datatypes:
+      switch(type_class)
+      {
+         case H5T_COMPOUND:
+         {
+            H5::CompType compType(dataset);
+            dumpCompoundTypeInfo(compType, datasetPrefix);
+            dumpCompound(dataset, compType, datasetPrefix);
+            break;
+         }
+         case H5T_ENUM:
+         {
+           H5::EnumType enumType (dataset);
+           dumpEnumTypeInfo(enumType, datasetPrefix);
+            break;
+         }
+         case H5T_ARRAY:
+         {
+            H5::ArrayType arrayType (dataset.getId());
+            dumpArrayTypeInfo(arrayType, datasetPrefix);
+            break;
+         }
+         case H5T_INTEGER:
+         case H5T_FLOAT:
+         {
+            ossimByteOrder byteOrder = m_hdf5->getByteOrder( &dataset );
+            dumpNumericalTypeInfo(dataset, byteOrder, datasetPrefix);
+            break;
+         }
+         default:
+         {
+           m_kwl.addPair(datasetPrefix, string(ossimKeywordNames::SCALAR_TYPE_KW),
+                         string("OSSIM_SCALAR_UNKNOWN"));
+            break;
+         }
+      }
+
+//      Dump Extents:
+      vector<ossim_uint32> extents;
+      m_hdf5->getExtents( dataset, extents );
+      ostringstream value;
+      if(!extents.empty())
+      {
+         value <<extents[0];
+         for ( ossim_uint32 i = 1; i < extents.size(); ++i )
+         {
+            value << ", " << extents[i];
+         }
+         m_kwl.addPair(datasetPrefix, "extents", value.str());
+      }
+
+#if 0
+      // Attributes:
+      int numberOfAttrs = dataset.getNumAttrs();
+      cout << "numberOfAttrs: " << numberOfAttrs << endl;
+      for ( ossim_int32 attrIdx = 0; attrIdx < numberOfAttrs; ++attrIdx )
+      {
+         H5::Attribute attribute = dataset.openAttribute( attrIdx );
+         cout << "attribute.from class: " << attribute.fromClass() << endl;
+      }
+#endif
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+
+}
+
+void ossimHdf5Info::dumpCompound(const H5::DataSet& dataset,
+                                 const H5::CompType& compound,
+                                 const std::string& prefix)const
+{
+   H5::DataSpace dataspace = dataset.getSpace();
+   ossim_uint32 dimensions = dataspace.getSimpleExtentNdims();
+   ossim_uint32 nElements   = dataspace.getSimpleExtentNpoints();
+   ossim_int32 nMembers    = compound.getNmembers();
+   ossim_uint64 size       = compound.getSize();
+   ossim_int32 memberIdx   = 0;
+   ossim_int32 elementIdx   = 0;
+   H5::DataType compType = dataset.getDataType();
+   std::vector<char> compData(size*nElements);
+   dataset.read((void*)&compData.front(),compType);
+   char* compDataPtr = &compData.front();
+
+   if(dimensions!=1)
+   {
+      return;
+   }
+
+   for(;elementIdx<nElements;++elementIdx)
+   {
+      std::string elementPrefix = prefix;//+"."+"element"+ossimString::toString(elementIdx);
+      //std::cout << "ELEMENTS: " << elements << std::endl;
+      for(memberIdx=0;memberIdx < nMembers;++memberIdx)
+      {
+         H5::DataType dataType = compound.getMemberDataType(memberIdx);
+         H5std_string memberName = compound.getMemberName(memberIdx);
+         ossim_uint32 memberOffset = compound.getMemberOffset(memberIdx) ;
+         std::string newPrefix = elementPrefix + memberName;
+
+         switch(dataType.getClass())
+         {
+            case H5T_COMPOUND:
+            {
+              H5::CompType compoundType(dataset);
+             // dumpCompoundTypeInfo(compoundType, newPrefix);
+              dumpCompound(dataset, compoundType, newPrefix);
+              break;            
+            }
+            case H5T_INTEGER:
+            {
+               H5::IntType dataType = compound.getMemberIntType(memberIdx);
+               dumpIntType(dataType, &compDataPtr[memberOffset], newPrefix);
+               //ossim_hdf5::printIntType(dataset, dataType, &compDataPtr[memberOffset], newPrefix, out);
+               break;            
+            }
+            case H5T_FLOAT:
+            {
+               H5::FloatType dataType = compound.getMemberFloatType(memberIdx);
+               dumpFloatType(dataType, &compDataPtr[memberOffset], newPrefix);
+               break;            
+            }
+            case H5T_TIME:
+            case H5T_STRING:
+            {
+               H5::StrType dataType = compound.getMemberStrType(memberIdx);
+               dumpStringType(dataType, &compDataPtr[memberOffset], newPrefix);
+//               ossim_hdf5::printStrType(dataset, dataType, &compDataPtr[memberOffset], newPrefix, out);
+               break;            
+            }
+            case H5T_BITFIELD:
+            {
+//               out << newPrefix << ": <H5T_BITFIELD NOT HANDLED>\n"; 
+               break;            
+            }
+            case H5T_OPAQUE:
+            {
+//               out << newPrefix << ": <H5T_OPAQUE NOT HANDLED>\n"; 
+               break;            
+            }
+            case H5T_REFERENCE:
+            {
+//               out << newPrefix << ": <H5T_REFERENCE NOT HANDLED>\n"; 
+               break;            
+            }
+            case H5T_ENUM:
+            {
+               H5::EnumType dataType = compound.getMemberEnumType(memberIdx);
+               dumpEnumTypeInfo(dataType, newPrefix);
+//               ossim_hdf5::printEnumType(dataset, dataType, newPrefix, out);
+               break;            
+            }
+            case H5T_VLEN:
+            {
+//               out << newPrefix << ": <H5T_VLEN NOT HANDLED>\n"; 
+               break;            
+            }
+            case H5T_ARRAY:
+            {
+                H5::ArrayType dataType = compound.getMemberArrayType(memberIdx);
+                dumpArrayType(dataType, &compDataPtr[memberOffset], newPrefix);
+               break;            
+            }
+            case H5T_NO_CLASS:
+            default:
+            {
+               break;            
+            }
+         }
+      }
+      compDataPtr+=size;
+   }
+
+}
+
+void ossimHdf5Info::dumpCompoundTypeInfo(const H5::CompType& compound,
+                                         const std::string& prefix) const
+{
+   #if 0
+   try
+   {
+     // H5::CompType compound(dataset);
+      ossim_int32 nMembers    = compound.getNmembers();
+      ossim_int32 memberIdx   = 0;
+      ostringstream typePrefix;
+      typePrefix << prefix << "compound_type.";
+      m_kwl.addPair(prefix, string("type"), string("compound"));
+   
+      for(memberIdx=0;memberIdx < nMembers;++memberIdx)
+      {
+         H5::DataType dataType (compound.getMemberDataType(memberIdx));
+         H5std_string memberName (compound.getMemberName(memberIdx));
+         ostringstream newPrefix;
+         newPrefix<<typePrefix.str() <<memberName<< ".";
+
+         H5T_class_t class_type = dataType.getClass();
+         m_kwl.addPair(newPrefix.str(), string("class_type"), m_hdf5->getDatatypeClassType(class_type));
+
+         switch(class_type)
+         {
+            case H5T_INTEGER:
+            {
+               H5::IntType dataType = compound.getMemberIntType(memberIdx);
+               //dumpIntType(dataset, dataType, &compDataPtr[memberOffset], newPrefix, out);
+               
+               break;
+            }
+            case H5T_FLOAT:
+            {
+               H5::FloatType dataType = compound.getMemberFloatType(memberIdx);
+               break;
+            }
+            case H5T_ENUM:
+            {
+               H5::EnumType enudataType = compound.getMemberEnumType(memberIdx);
+               dumpEnumTypeInfo(enudataType, newPrefix.str());
+               break;
+            }
+            case H5T_ARRAY:
+            {
+               H5::ArrayType arrdataType = compound.getMemberArrayType(memberIdx);
+               dumpArrayTypeInfo(arrdataType, newPrefix.str());
+               break;
+            }
+            default:
+            {
+               break;
+            }
+         }
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+   #endif
+}
+
+void ossimHdf5Info::dumpEnumTypeInfo(H5::EnumType enumType,
+                                     const std::string& prefix) const
+{
+   try
+   {
+      ossim_int32 nEnumMembers = enumType.getNmembers();
+      ossim_int32 enumTypeSize = enumType.getSize();
+      if (!nEnumMembers || !enumTypeSize)
+         return;
+
+      char* enum_value = new char [enumTypeSize];
+      ostringstream kwl_value;
+
+      for(ossim_int32 i=0;i<nEnumMembers;++i)
+      {
+         enumType.getMemberValue(i, &enum_value);
+         H5std_string name = enumType.nameOf(&enum_value, enumTypeSize);
+         if (i==0)
+            kwl_value << name;
+         else
+            kwl_value << ", " << name;
+      }
+      m_kwl.addPair(prefix, string("enumerations"), kwl_value.str());
+      delete [] enum_value;
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+}
+
+
+void ossimHdf5Info::dumpArrayTypeInfo(H5::ArrayType arrayType,
+                                      const std::string& prefix) const
+{
+   try
+   {
+      ossim_uint32 arrayNdims = arrayType.getArrayNDims();
+      string ndimsstr = ossimString::toString(arrayNdims);
+      m_kwl.addPair(prefix, "rank", ndimsstr);
+
+      if (arrayNdims)
+      {
+         std::vector<hsize_t> dims(arrayNdims);
+         arrayType.getArrayDims(&dims.front());
+         ostringstream kwl_value;
+         for(ossim_uint32 i=0;i<arrayNdims;++i)
+         {
+            if (i==0)
+               kwl_value << dims[i];
+            else
+               kwl_value << ", " << dims[i];
+         }
+         m_kwl.addPair(prefix, string("dimensions"), kwl_value.str());
+      }
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+}
+
+void ossimHdf5Info::dumpNumericalTypeInfo(const H5::DataSet& dataset,
+                                          ossimByteOrder byteOrder,
+                                          const std::string& prefix) const
+{
+   try
+   {
+      ossimScalarType stype = m_hdf5->getScalarType(dataset);
+      ossimString sct = ossimScalarTypeLut::instance()->getEntryString(stype);
+      m_kwl.addPair(prefix, string(ossimKeywordNames::SCALAR_TYPE_KW), sct.string());
+
+      std::string byteOrderString = "little_endian";
+      if ( byteOrder == OSSIM_BIG_ENDIAN )
+         byteOrderString = "big_endian";
+      m_kwl.addPair(prefix, string(ossimKeywordNames::BYTE_ORDER_KW), byteOrderString);
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+}
+
+void ossimHdf5Info::dumpIntType(const H5::IntType& dataType,
+                                const char* dataPtr,
+                                const std::string& prefix)const
+{
+   std::string strValue;
+   if(ossimHdf5::intTypeToString(strValue, dataType, dataPtr))
+   {
+      m_kwl.addPair(prefix, strValue);
+   }
+
+}
+
+void ossimHdf5Info::dumpFloatType(const H5::FloatType& dataType,
+                                  const char* dataPtr,
+                                  const std::string& prefix)const
+{
+   std::string strValue;
+
+   if(ossimHdf5::floatTypeToString(strValue, dataType, dataPtr))
+   {
+      m_kwl.addPair(prefix, strValue);
+   }
+}
+
+void ossimHdf5Info::dumpStringType(const H5::StrType& dataType,
+                                   const char* dataPtr,
+                                   const std::string& prefix)const
+{
+   std::string strValue;
+   if(ossimHdf5::stringTypeToString(strValue, dataType, dataPtr))
+   {
+      m_kwl.addPair(prefix, strValue);
+   }
+}
+
+void ossimHdf5Info::dumpArrayType( H5::ArrayType& dataType,
+                                   const char* dataPtr,
+                                   const std::string& prefix)const
+{
+   ossim_uint32 arrayNdims = dataType.getArrayNDims();
+//   ossimByteOrder order = m_hdf5->getByteOrder(dataType);
+//   ossimEndian endian;
+//   bool swapOrder = (order!=ossim::byteOrder());
+   H5::DataType superType = dataType.getSuper();
+   //out << prefix<<".class_type: " << ossim_hdf5::getDatatypeClassType( dataType.getClass() ) << "\n";
+   if(arrayNdims)
+   {
+      std::vector<hsize_t> dims(arrayNdims);
+      dataType.getArrayDims(&dims.front());
+      if(dims.size() > 0)
+      {
+         std::stringstream dimOut;
+         ossimString dimString;
+         ossim_uint32 idx = 1;
+         ossim_uint32 nArrayElements = dims[0];
+         std::copy(dims.begin(), --dims.end(),
+            std::ostream_iterator<hsize_t>(dimOut,","));
+         for(;idx<dims.size();++idx)
+         {
+          nArrayElements*=dims[idx]; 
+         }
+
+         dimString = ossimString("(") + dimOut.str() + ossimString::toString(dims[dims.size()-1])+")";  
+         m_kwl.addPair(prefix+".dimensions", dimString);
+
+         ossim_uint32 typeSize = superType.getSize();
+         switch(superType.getClass())
+         {
+            case H5T_STRING:
+            {
+               std::ostringstream out;
+               ossimString newPrefix = prefix+".values";
+               out<<"(";
+               const char* startPtr = 0;
+               const char* endPtr = 0;
+               const char* mem = 0;
+               H5T_str_t       pad;
+               ossim_int32 strSize = 0;
+               for(idx=0;idx<nArrayElements;++idx)
+               {
+                  mem = ((const char*)dataPtr) + (idx * typeSize);
+                  if(superType.isVariableStr())
+                  {
+                     startPtr = *(char**) mem;
+                     if(startPtr) strSize = std::strlen(startPtr);
+                     else strSize = 0;
+                  }
+                  else
+                  {
+                     startPtr = mem;
+                  }
+                  if(startPtr)
+                  {
+                    ossim_uint32 charIdx = 0;
+                    endPtr = startPtr;
+                    for (; ((charIdx < strSize) && (*endPtr)); ++charIdx,++endPtr);
+
+                  }
+                  ossimString value = ossimString(startPtr, endPtr);
+                  if(idx == 0)
+                  {
+                     out << "\""<<value<< "\"";
+                  }
+                  else 
+                  {
+                     out << ", \""<<value<< "\"";
+                  }
+               }
+               out << ")";
+               //out<<prefix<<".array_type: H5T_STRING\n";
+//               out<<prefix<<".values: <NOT SUPPORTED>";
+               m_kwl.addPair(newPrefix, out.str());
+               m_kwl.addPair(prefix+".array_type", "H5T_STRING");
+
+               break;
+            }
+            case H5T_INTEGER:
+            {
+               ostringstream out;
+               H5::IntType* dataTypePtr = (H5::IntType*)(&superType);
+               ossimByteOrder order = m_hdf5->getByteOrder(*dataTypePtr);
+               ossimEndian endian;
+               bool swapOrder = (order!=ossim::byteOrder());
+               ossimString newPrefix = prefix+".values";
+               out<<"(";
+               for(idx=0;idx<nArrayElements;++idx)
+               {
+                  std::string value;
+                  ossimHdf5::intTypeToString(value, *dataTypePtr, dataPtr);
+                  if((idx + 1) <nArrayElements)
+                  {
+                     out << value << ", ";
+                  }
+                  else
+                  {
+                     out << value;
+                  }
+                  dataPtr+=typeSize;
+               }
+               out << ")";
+               m_kwl.addPair(newPrefix, out.str());
+               m_kwl.addPair(prefix+".array_type", "H5T_INTEGER");
+              break;
+            }
+            case H5T_FLOAT:
+            {
+               ostringstream out;
+               H5::FloatType* dataTypePtr = (H5::FloatType*)(&superType);
+               ossimByteOrder order = m_hdf5->getByteOrder(*dataTypePtr);
+               ossimEndian endian;
+               bool swapOrder = (order!=ossim::byteOrder());
+
+               //out<<prefix<<".array_type: H5T_INTEGER\n";
+               ossimString newPrefix = prefix+".values";
+               out<<"(";
+               for(idx=0;idx<nArrayElements;++idx)
+               {
+                  std::string value;
+                  ossimHdf5::floatTypeToString(value, *dataTypePtr, dataPtr);
+                  if((idx + 1) <nArrayElements)
+                  {
+                     out << value << ", ";
+                  }
+                  else
+                  {
+                     out << value;
+                  }
+                  dataPtr+=typeSize;
+               }
+               out << ")";
+               m_kwl.addPair(newPrefix, out.str());
+               m_kwl.addPair(prefix+".array_type", "H5T_FLOAT");
+               break;
+            }
+            default:
+            {
+               break;
+            }
+         }
+
+      }
+   }
+  
+}
+
+
+void ossimHdf5Info::dumpNumerical(const H5::DataSet& dataset,
+                                  const char* dataPtr,
+                                  const std::string& prefix) const
+{
+   try
+   {
+      H5::IntType dataType = dataset.getIntType();
+      ossimByteOrder order = m_hdf5->getByteOrder(&dataset);
+      ossimEndian endian;
+      bool swapOrder = (order!=ossim::byteOrder());
+
+      ossimString valueStr;
+      ossimScalarType scalarType = m_hdf5->getScalarType(dataset);
+      switch(scalarType)
+      {
+      case OSSIM_UINT8:
+      {
+         ossim_uint8 value = *reinterpret_cast<const ossim_uint8*>(dataPtr);
+         valueStr = ossimString::toString(value).string();
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         ossim_int8 value = *reinterpret_cast<const ossim_int8*>(dataPtr);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      case OSSIM_UINT16:
+      {
+         ossim_uint16 value = *reinterpret_cast<const ossim_uint16*>(dataPtr);
+         if(swapOrder)
+            endian.swap(value);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         ossim_int16 value = *reinterpret_cast<const ossim_int16*>(dataPtr);
+         if(swapOrder)
+            endian.swap(value);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         ossim_uint32 value = *reinterpret_cast<const ossim_uint32*>(dataPtr);
+         if(swapOrder)
+            endian.swap(value);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         ossim_int32 value = *reinterpret_cast<const ossim_int32*>(dataPtr);
+         if(swapOrder)
+            endian.swap(value);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      case OSSIM_UINT64:
+      {
+         ossim_uint64 value = *reinterpret_cast<const ossim_uint64*>(dataPtr);
+         if(swapOrder)
+            endian.swap(value);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      case OSSIM_FLOAT32:
+      {
+         ossim_float32 value = *reinterpret_cast<const ossim_int64*>(dataPtr);
+         if(swapOrder)
+            endian.swap(value);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      case OSSIM_FLOAT64:
+      {
+         ossim_float64 value = *reinterpret_cast<const ossim_int64*>(dataPtr);
+         if(swapOrder)
+            endian.swap(value);
+         valueStr = ossimString::toString(value);
+         break;
+      }
+      default:
+      {
+         valueStr = "<UNHANDLED SCALAR TYPE>";
+         break;
+      }
+      }
+
+      m_kwl.addPair(prefix, string("value"), valueStr.string());
+   }
+   catch( const H5::Exception& e )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<e.getDetailMsg();
+   }
+}
+
+
+
diff --git a/src/hdf5/ossimHdf5ProjectionFactory.cpp b/src/hdf5/ossimHdf5ProjectionFactory.cpp
new file mode 100644
index 0000000..32f0e5c
--- /dev/null
+++ b/src/hdf5/ossimHdf5ProjectionFactory.cpp
@@ -0,0 +1,91 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/hdf5/ossimHdf5ProjectionFactory.h>
+#include <ossim/hdf5/ossimHdf5GridModel.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/projection/ossimProjection.h>
+
+ossimHdf5ProjectionFactory* ossimHdf5ProjectionFactory::instance()
+{
+   static ossimHdf5ProjectionFactory* factoryInstance =
+      new ossimHdf5ProjectionFactory();
+
+   return factoryInstance;
+}
+   
+ossimProjection* ossimHdf5ProjectionFactory::createProjection(const ossimFilename& filename,
+                                                              ossim_uint32 entryIdx)const
+{
+   // Try external geom file first:
+   ossimRefPtr<ossimProjection> projection = createProjectionFromGeometryFile(filename, entryIdx);
+   if (!projection.valid())
+   {
+      // Try internal grid model. This may be specific to VIIRS. In any case, it is not very
+      // robust as this model simply looks for "Latitude" and "Longitude" dataset names, ignoring
+      // multiple entries with potentially different geometries for each. Eventually should
+      // provide for the specification of specific dataset names or at least path to parent group.
+      // This is not trivial with only an entry index available. (OLK 08/16)
+      ossimRefPtr<ossimHdf5> hdf5 = new ossimHdf5;
+      if (hdf5->open(filename))
+      {
+         ossimRefPtr<ossimHdf5GridModel> hdf5_grid = new ossimHdf5GridModel;
+         hdf5_grid->initialize(hdf5.get());
+      }
+   }
+
+   // Must release or pointer will self destruct when it goes out of scope.
+   return projection.release();
+}
+
+ossimProjection* ossimHdf5ProjectionFactory::createProjection(const ossimString& /*name*/) const
+{
+   return 0;
+}
+
+ossimProjection* ossimHdf5ProjectionFactory::createProjection(const ossimKeywordlist& kwl,
+                                                              const char* prefix) const
+{
+   ossimRefPtr<ossimProjection> result;
+   ossimString value = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if ((value != "ossimHdf5GridModel") && (value != "ossimH5GridModel"))
+      return 0;
+
+   // The HDF5 grid model is just an implementation of the coarse grid model, but the geom file
+   // is purely the latter, so trick the KWL to properly load an OCG model:
+   ossimKeywordlist new_kwl (kwl);
+   new_kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimCoarseGridModel", true);
+
+   result = new ossimHdf5GridModel;
+   if( !result->loadState(new_kwl, prefix) )
+      result = 0;
+
+   return result.release();
+}
+
+ossimObject* ossimHdf5ProjectionFactory::createObject(
+   const ossimString& typeName)const
+{
+   return createProjection(typeName);
+}
+
+ossimObject* ossimHdf5ProjectionFactory::createObject(
+   const ossimKeywordlist& kwl, const char* prefix)const
+{
+   return createProjection(kwl, prefix);
+}
+
+void ossimHdf5ProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   typeList.push_back(ossimString("ossimHdf5GridModel"));
+}
+
+ossimHdf5ProjectionFactory::ossimHdf5ProjectionFactory()
+{
+}
diff --git a/src/hdf5/ossimHdf5Tool.cpp b/src/hdf5/ossimHdf5Tool.cpp
new file mode 100644
index 0000000..5d9bf32
--- /dev/null
+++ b/src/hdf5/ossimHdf5Tool.cpp
@@ -0,0 +1,355 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/hdf5/ossimHdf5Tool.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimShiftFilter.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/hdf5/ossimHdf5.h>
+#include <ossim/hdf5/ossimHdf5ImageHandler.h>
+#include <ossim/hdf5/ossimHdf5Info.h>
+#include <ossim/hdf5/ossimHdf5GridModel.h>
+#include <iostream>
+
+using namespace std;
+using namespace H5;
+
+const char* ossimHdf5Tool::DESCRIPTION  = "Utility for parsing and extracting HDF5 image data.";
+
+static const string IMAGE_DATASET_KW = "image_dataset";
+static const string GEOM_DATASET_KW = "geom_dataset";
+static const string LIST_DATASETS_KW = "list_datasets";
+static const string LIST_NDIMS_KW = "list_ndims";
+static const string DUMP_INFO_KW = "dump_info";
+static const string DUMP_KWL_KW = "dump_kwl";
+
+ossimHdf5Tool::ossimHdf5Tool()
+:  m_dumpInfo (false),
+   m_dumpKwl (false),
+   m_listDatasets (false),
+   m_listNdimDatasets (false)
+{
+}
+
+ossimHdf5Tool::~ossimHdf5Tool()
+{
+}
+
+void ossimHdf5Tool::setUsage(ossimArgumentParser& ap)
+{
+   // Add options.
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " hdf5 [options] [--i <input-hdf5-file>] [-o <output-image>]";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->setDescription(DESCRIPTION);
+   au->addCommandLineOption("--geom-dataset","<path_to_dataset>"
+                            "Full HDF5-internal path to geometry dataset to use for image. ");
+   au->addCommandLineOption("--image-dataset","<path_to_dataset>"
+                            "Full HDF5-internal path to pixel dataset to extract. ");
+   au->addCommandLineOption("--list-datasets",
+                            "Lists all datasets with extents. ");
+   au->addCommandLineOption("--list-ndims",
+                            "Lists all datasets with extents that are of rank 2 or higher.");
+   au->addCommandLineOption("--geom", "[<geomfilename>]\n"
+                            "Dumps the geometry keyword-list to the specified file or the console if no filename specified.");
+   au->addCommandLineOption("--info",
+                            "Outputs human-readable dump of all objects in the file");
+   au->addCommandLineOption("--kwl",
+                            "Outputs keywordlist dump of all objects in the file");
+
+   // Base class has its own:
+   ossimChipProcTool::setUsage(ap);
+}
+
+bool ossimHdf5Tool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   std::string tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+   const string TRUE_STR ("true");
+
+   if ( ap.read("--geom-dataset", stringParam1) || ap.read("--gdata", stringParam1))
+      m_kwl.addPair(GEOM_DATASET_KW, tempString1);
+
+   if ( ap.read("--geom", stringParam1))
+      m_kwl.addPair(ossimKeywordNames::GEOM_FILE_KW, tempString1);
+
+   if ( ap.read("--image-dataset", stringParam1) || ap.read("--idata", stringParam1))
+      m_kwl.addPair(IMAGE_DATASET_KW, tempString1);
+
+   if ( ap.read("--list-datasets"))
+      m_kwl.addPair(LIST_DATASETS_KW, TRUE_STR);
+
+   if ( ap.read("--list-ndims") )
+      m_kwl.addPair(LIST_NDIMS_KW, TRUE_STR);
+
+   if ( ap.read("--info") )
+      m_kwl.addPair(DUMP_INFO_KW, TRUE_STR);
+
+   if ( ap.read("--kwl") )
+      m_kwl.addPair(DUMP_KWL_KW, TRUE_STR);
+
+   ap.reportRemainingOptionsAsUnrecognized();
+
+   if ( ap.argc() > 1 )
+   {
+      // If input file already specified, then remaining arg is output file:
+      if (m_kwl.numberOf(ossimKeywordNames::IMAGE_FILE_KW))
+         m_kwl.add( ossimKeywordNames::OUTPUT_FILE_KW, ap[1]);
+      else
+      {
+         // No input specified, so remaining args contains the input filename:
+         if (ap.argc() == 2)
+            m_kwl.add( ossimKeywordNames::IMAGE_FILE_KW, ap[1]);
+         else
+         {
+            m_kwl.add( ossimKeywordNames::IMAGE_FILE_KW, ap[1]);
+            m_kwl.add( ossimKeywordNames::OUTPUT_FILE_KW, ap[2]);
+         }
+      }
+   }
+
+   initialize(m_kwl);
+   return true;
+}
+
+void ossimHdf5Tool::initialize(const ossimKeywordlist& kwl)
+{
+   ostringstream xmsg;
+
+   // Don't copy KWL if member KWL passed in:
+   if (&kwl != &m_kwl)
+   {
+      // Start with clean options keyword list.
+      m_kwl.clear();
+      m_kwl.addList( kwl, true );
+   }
+
+   m_imageDataPath = m_kwl.findKey(IMAGE_DATASET_KW);
+   m_geomDataPath = m_kwl.findKey(GEOM_DATASET_KW);
+   m_geomFilename =  m_kwl.findKey(ossimKeywordNames::GEOM_FILE_KW);
+
+   m_kwl.getBoolKeywordValue(m_listDatasets, LIST_DATASETS_KW.c_str());
+   m_kwl.getBoolKeywordValue(m_listNdimDatasets, LIST_NDIMS_KW.c_str());
+   m_kwl.getBoolKeywordValue(m_dumpInfo, DUMP_INFO_KW.c_str());
+   m_kwl.getBoolKeywordValue(m_dumpKwl, DUMP_KWL_KW.c_str());
+
+   ossimFilename hdfFile = m_kwl.find(ossimKeywordNames::IMAGE_FILE_KW);
+   if (hdfFile.empty() )
+   {
+      xmsg<<"ERROR: ossimHdf5Tool:"<<__LINE__<<" -- No input filename was specified.";
+      throw ossimException(xmsg.str());
+   }
+
+   m_hdf5 = new ossimHdf5;
+   if (!m_hdf5->open(hdfFile))
+   {
+      xmsg<<"ERROR: ossimHdf5Tool:"<<__LINE__<<" -- Could not open <"<<hdfFile
+            <<"> as an HDF5 file.";
+      throw ossimException(xmsg.str());
+   }
+
+   if (m_listDatasets || m_listNdimDatasets || m_dumpInfo || m_dumpKwl)
+      return;
+
+   // Only if an output file is specified, do we need the services of ossimChipProcTool:
+   m_productFilename = m_kwl.findKey( std::string(ossimKeywordNames::OUTPUT_FILE_KW) );
+
+   ossimChipProcTool::initialize(kwl);
+   if (m_imgLayers.empty())
+   {
+      xmsg<<"ERROR: ossimHdf5Tool:"<<__LINE__<<" -- No input chain available. Make sure an HDF5"
+            " input file name is specified";
+      throw ossimException(xmsg.str());
+   }
+
+   // If dataset specified, then expect product filename:
+   if (!m_imageDataPath.empty() && m_productFilename.empty())
+   {
+      m_productFilename = hdfFile;
+      m_productFilename.setExtension("tif");
+   }
+}
+
+void ossimHdf5Tool::loadImageFiles()
+{
+   ostringstream errMsg;
+
+   // Special handling needed for loading HDF5 file:
+   ossimString value = m_kwl.find(ossimKeywordNames::IMAGE_FILE_KW);
+   if (value.empty())
+   {
+      errMsg<<"ERROR: ossimHdf5Tool:"<<__LINE__<<" -- No input HDF5 file name specified.";
+      throw ossimException(errMsg.str());
+   }
+   ossimFilename imageFilename (value);
+
+   // If explicit image data paths are specified, open the HDF5 handler directly, otherwise assume
+   // there is a plugin factory that will figure it out:
+   ossimRefPtr<ossimHdf5ImageHandler> handler;
+   if (m_imageDataPath.empty())
+   {
+      // Use the factory system to instantiate handler, then verify it is HDF5:
+      ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(imageFilename);
+      handler = dynamic_cast<ossimHdf5ImageHandler*>(ih.get());
+      if (!handler.valid())
+      {
+         errMsg<<"ERROR: ossimHdf5Tool:"<<__LINE__<<" -- No HDF5 dataset paths were specified"
+               " and no default HDF5-derived handlers were found. Don't know what dataset to "
+               "extract. Use \"--image-dataset\" option to specify.";
+         throw ossimException(errMsg.str());
+      }
+   }
+   else
+   {
+      // Use explicitely-provided dataset names:
+      handler = new ossimHdf5ImageHandler;
+      handler->addRenderable(m_imageDataPath);
+      handler->setFilename(ossimFilename(value));
+      if (!handler->open())
+      {
+         errMsg<<"ERROR: ossimHdf5Tool:"<<__LINE__<<" -- Could not open <"<<value<<"> as an HDF5 file.";
+         throw ossimException(errMsg.str());
+      }
+   }
+
+
+   // Init chain with handler:
+   ossimRefPtr<ossimSingleImageChain> chain = new ossimSingleImageChain;
+   chain->addLast(handler.get());
+
+   // Set up the remapper:
+   if ( ( m_productScalarType != OSSIM_SCALAR_UNKNOWN) &&
+         ( m_procChain->getOutputScalarType() != m_productScalarType ) )
+   {
+      ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper();
+      remapper->setOutputScalarType(m_productScalarType);
+      chain->add(remapper.get());
+   }
+
+   // Add geo polygon cutter if specifried:
+   ossimString param = m_kwl.findKey(string("clip_poly_lat_lon"));
+   if (!param.empty())
+   {
+      std::vector<ossimGpt> points;
+      ossim::toVector(points, param);
+      if(points.size() >= 3)
+      {
+         ossimGeoPolygon polygon(points);
+         chain->addGeoPolyCutterPolygon(polygon);
+      }
+   }
+
+   chain->initialize();
+   m_imgLayers.push_back(chain);
+}
+
+void ossimHdf5Tool::initProcessingChain()
+{
+   ossimRefPtr<ossimImageSource> input_mosaic = combineLayers(m_imgLayers);
+   m_procChain->add(input_mosaic.get());
+
+   ossimRefPtr<ossimShiftFilter> sf = new ossimShiftFilter();
+   sf->setNullPixelValue( 0.0 );
+   sf->setMinPixelValue( 1.0 );
+   sf->setMaxPixelValue( 65535.0 );
+   m_procChain->add( sf.get() );
+
+   // Cast it to uint16:
+   ossimRefPtr<ossimCastTileSourceFilter> cf = new ossimCastTileSourceFilter(0, OSSIM_UINT16 );
+   m_procChain->add( cf.get() );
+
+}
+
+bool ossimHdf5Tool::execute()
+{
+   // Need to fix output to tiff
+
+   ostringstream errMsg;
+   if (!m_hdf5.valid())
+      return false;
+
+   if (m_listDatasets || m_listNdimDatasets || m_dumpInfo || m_dumpKwl)
+   {
+      ossimHdf5Info info (m_hdf5.get());
+      if (m_dumpKwl)
+      {
+         ossimKeywordlist kwl;
+         info.getKeywordlist(kwl);
+         kwl.print(cout);
+      }
+      if (m_dumpInfo)
+      {
+         info.print(cout);
+      }
+
+      Group root;
+      m_hdf5->getRoot(root);
+      vector<DataSet> datasets;
+      if (m_listDatasets)
+         m_hdf5->getDatasets(root, datasets, true);
+      else if (m_listNdimDatasets)
+         m_hdf5->getNdimDatasets(root, datasets, true);
+      for (ossim_uint32 i=0; i<datasets.size(); ++i)
+      {
+         info.print(cout, datasets[i]);
+      }
+   }
+
+   if (m_imgLayers.empty())
+      return true;
+
+   if (!ossimChipProcTool::execute())
+      return false;
+
+   ossimRefPtr<ossimImageGeometry> geom = m_imgLayers[0]->getImageGeometry();
+   if (geom.valid())
+   {
+      ossimRefPtr<ossimProjection> proj = geom->getProjection();
+      if ( proj.valid() )
+      {
+         ossimFilename geomFile = m_productFilename.noExtension();
+         geomFile.string() += ".geom";
+
+         // Assume it is coarse grid (case for VIIRS):
+         ossimRefPtr<ossimHdf5GridModel> cg = dynamic_cast<ossimHdf5GridModel*>( proj.get() );
+         if ( cg.valid() )
+         {
+            // this saves geom file as well
+            cg->saveCoarseGrid( geomFile );
+            cout << "Wrote file: " << geomFile << endl;
+         }
+         else
+         {
+            // Save the state to keyword list.
+            ossimKeywordlist geomKwl;
+            geom->saveState(geomKwl);
+
+            // Write to file:
+            geomKwl.write( geomFile.c_str() );
+            cout << "Wrote file: " << geomFile << endl;
+         }
+      }
+   }
+
+   return true;
+}
diff --git a/src/hdf5/ossimViirsHandler.cpp b/src/hdf5/ossimViirsHandler.cpp
new file mode 100644
index 0000000..4652ee3
--- /dev/null
+++ b/src/hdf5/ossimViirsHandler.cpp
@@ -0,0 +1,49 @@
+/*****************************************************************************
+*                                                                            *
+*                                 O S S I M                                  *
+*            Open Source, Geospatial Image Processing Project                *
+*          License: MIT, see LICENSE at the top-level directory              *
+*                                                                            *
+*****************************************************************************/
+
+#include <ossim/hdf5/ossimViirsHandler.h>
+#include <ossim/hdf5/ossimHdf5GridModel.h>
+
+static const ossimString VIIRS_DATASET  ("/All_Data/VIIRS-DNB-SDR_All/Radiance");
+static const ossimString VIIRS_GEOMETRY ("/All_Data/VIIRS-DNB-GEO_All");
+
+ossimViirsHandler::ossimViirsHandler()
+{
+   m_renderableNames.push_back(VIIRS_DATASET);
+}
+
+ossimRefPtr<ossimImageGeometry> ossimViirsHandler::getImageGeometry()
+{
+   if (theGeometry.valid())
+      return theGeometry;
+
+   theGeometry = getExternalImageGeometry();
+   if (!theGeometry.valid() && isOpen())
+   {
+      theGeometry =  new ossimImageGeometry();
+
+      // Attempt to create an OSSIM coarse grid model from HDF5 lat lon grids:
+      ossimRefPtr<ossimHdf5GridModel> hdf5GridModel = new ossimHdf5GridModel;
+      if ( hdf5GridModel->initialize(m_hdf5.get(), VIIRS_GEOMETRY) )
+      {
+         theGeometry->setProjection(hdf5GridModel.get());
+         initImageParameters( theGeometry.get() );
+      }
+      else
+         theGeometry = 0;
+   }
+
+   return theGeometry;
+}
+
+
+double ossimViirsHandler::getNullPixelValue(ossim_uint32 /*band*/) const
+{
+   // NPP VIIRS data has null of "-999.3".
+   return -999.3;
+}
diff --git a/src/imaging/ossim3x3ConvolutionFilter.cpp b/src/imaging/ossim3x3ConvolutionFilter.cpp
new file mode 100644
index 0000000..45c0a50
--- /dev/null
+++ b/src/imaging/ossim3x3ConvolutionFilter.cpp
@@ -0,0 +1,637 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossim3x3ConvolutionFilter.cpp 12956 2008-06-02 01:38:50Z dburken $
+
+#include <cstdlib>
+#include <ossim/imaging/ossim3x3ConvolutionFilter.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimMatrixProperty.h>
+
+RTTI_DEF1(ossim3x3ConvolutionFilter, "ossim3x3ConvolutionFilter", ossimImageSourceFilter);
+
+ossim3x3ConvolutionFilter::ossim3x3ConvolutionFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theTile(NULL),
+    theNullPixValue(0),
+    theMinPixValue(0),
+    theMaxPixValue(0)
+{
+   theKernel[0][0] = 0.0; theKernel[0][1] = 0.0; theKernel[0][2] = 0.0;
+   theKernel[1][0] = 0.0; theKernel[1][1] = 1.0; theKernel[1][2] = 0.0;
+   theKernel[2][0] = 0.0; theKernel[2][1] = 0.0; theKernel[2][2] = 0.0;
+   
+}
+
+ossim3x3ConvolutionFilter::~ossim3x3ConvolutionFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossim3x3ConvolutionFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return theTile;
+   }
+
+   if(!isSourceEnabled())
+   {
+      return theInputConnection->getTile(tileRect, resLevel);
+   }
+
+   //---
+   // We have a 3x3 matrix so stretch the rect out to cover
+   // the required pixels.  We only need 1 pixel to the left
+   // and right of the center pixel.
+   //---
+   ossimIrect newRect(ossimIpt(tileRect.ul().x - 1,
+                               tileRect.ul().y - 1),
+                      ossimIpt(tileRect.lr().x + 1,
+                               tileRect.lr().y + 1));
+   
+   ossimRefPtr<ossimImageData> data = theInputConnection->getTile(newRect,
+                                                                  resLevel);
+
+   if(!data.valid() || !data->getBuf())
+   {
+      return data;
+   }
+
+    // First time through or after an initialize()...
+   if (!theTile.valid())
+   {
+      allocate();
+      if (!theTile.valid()) // Should never happen!
+      {
+         return data;
+      }
+   }
+
+   // First time through, after an initialize() or a setKernel()...
+   if (!theNullPixValue.size())
+   {
+      computeNullMinMax();
+      if (!theNullPixValue.size()) // Should never happen!
+      {
+         return data;
+      }
+   }
+
+   theTile->setImageRectangle(tileRect);
+   theTile->makeBlank();
+   
+   switch(data->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<ossim_uint8>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<ossim_uint8>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_FLOAT: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<float>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<float>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<ossim_uint16>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<ossim_uint16>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<ossim_sint16>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<ossim_sint16>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<double>(0), data, theTile);
+      }
+      else
+      {
+         convolvePartial(static_cast<double>(0), data, theTile);
+      }
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossim3x3ConvolutionFilter::getTile WARNING:\n"
+            << "Scalar type = " << theTile->getScalarType()
+            << " Not supported by ossim3x3ConvolutionFilter" << endl;
+         break;
+      }
+   }
+   theTile->validate();
+   
+   return theTile;
+}
+
+
+template<class T> void ossim3x3ConvolutionFilter::convolvePartial(
+   T,
+   ossimRefPtr<ossimImageData> inputData,
+   ossimRefPtr<ossimImageData> outputData)
+{
+   // let's set up some temporary variables so we don't
+   // have to call the functions in loops.  Iknow that compilers
+   // typically optimize this out but if we are in debug mode 
+   // with no optimization it will still run fast
+   //
+   double sum = 0.0;
+   ossim_int32 inputW          = (ossim_int32)inputData->getWidth();
+   ossim_int32 outputW         = (ossim_int32)outputData->getWidth();
+   ossim_int32 outputH         = (ossim_int32)outputData->getHeight();
+   ossim_int32 numberOfBands   = (ossim_int32)inputData->getNumberOfBands();
+   ossimIpt outputOrigin  = outputData->getOrigin();
+   ossimIpt inputOrigin   = inputData->getOrigin();
+   
+   ossim_int32 startInputOffset = std::abs(outputOrigin.y - inputOrigin.y)*
+      inputW + std::abs(outputOrigin.x - inputOrigin.x);
+   ossim_int32 ulKernelStart    = -inputW - 1;
+   ossim_int32 leftKernelStart  = -1;
+   ossim_int32 llKernelStart    = inputW  - 1;
+   
+   T* ulKernelStartBuf    = NULL;
+   T* leftKernelStartBuf  = NULL;
+   T* llKernelStartBuf    = NULL;
+   
+   for(ossim_int32 band = 0; band < numberOfBands; ++band)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(band))+startInputOffset;
+      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
+      T maxPix     = static_cast<T>(getMaxPixelValue(band));
+      T minPix     = static_cast<T>(getMinPixelValue(band));      
+      T nullPix    = static_cast<T>(inputData->getNullPix(band));
+      T oNullPix   = static_cast<T>(getNullPixelValue(band));
+      
+      if(inputBuf&&outputBuf)
+      {
+         for(ossim_int32 row = 0; row < outputW; ++row)
+         {
+            ossim_int32 rowOffset    = inputW*row;
+            ulKernelStartBuf   = inputBuf + (rowOffset + ulKernelStart);
+            leftKernelStartBuf = inputBuf + (rowOffset + leftKernelStart);
+            llKernelStartBuf   = inputBuf + (rowOffset + llKernelStart);
+            for(ossim_int32 col = 0; col < outputH; ++col)
+            {
+
+               if((ulKernelStartBuf[0]   != nullPix)&&
+                  (ulKernelStartBuf[1]   != nullPix)&&
+                  (ulKernelStartBuf[2]   != nullPix)&&
+                  (leftKernelStartBuf[0] != nullPix)&&
+                  (leftKernelStartBuf[1] != nullPix)&&
+                  (leftKernelStartBuf[2] != nullPix)&&
+                  (llKernelStartBuf[0]   != nullPix)&&
+                  (llKernelStartBuf[1]   != nullPix)&&
+                  (llKernelStartBuf[2]   != nullPix))
+               {
+                  sum = theKernel[0][0]*(double)ulKernelStartBuf[0] +
+                        theKernel[0][1]*(double)ulKernelStartBuf[1] +
+                        theKernel[0][2]*(double)ulKernelStartBuf[2] +
+                        theKernel[1][0]*(double)leftKernelStartBuf[0] +
+                        theKernel[1][1]*(double)leftKernelStartBuf[1] +
+                        theKernel[1][2]*(double)leftKernelStartBuf[2] +
+                        theKernel[2][0]*(double)llKernelStartBuf[0] +
+                        theKernel[2][1]*(double)llKernelStartBuf[1] +
+                        theKernel[2][2]*(double)llKernelStartBuf[2];
+                  
+                  if(sum > maxPix)
+                  {
+                     *outputBuf = maxPix;
+                  }
+                  else if(sum < minPix)
+                  {
+                     *outputBuf = minPix;
+                  }
+                  else
+                  {
+                     *outputBuf = static_cast<T>(sum);
+                  }
+               }
+               else {
+                  *outputBuf = oNullPix;
+               }
+               //
+               // Need to implement the convolution here
+               //
+               
+               ++ulKernelStartBuf;
+               ++leftKernelStartBuf;
+               ++llKernelStartBuf;
+               ++outputBuf;
+            }
+         }
+      }
+   }
+}
+
+template<class T> void ossim3x3ConvolutionFilter::convolveFull(
+   T,
+   ossimRefPtr<ossimImageData> inputData,
+   ossimRefPtr<ossimImageData> outputData)
+{
+   // let's set up some temporary variables so we don't
+   // have to call the functions in loops.  Iknow that compilers
+   // typically optimize this out but if we are in debug mode 
+   // with no optimization it will still run fast
+   //
+   double sum = 0.0;
+   ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
+   ossim_uint32 outputW       = outputData->getWidth();
+   ossim_uint32 outputH       = outputData->getHeight();
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   ossimIpt outputOrigin = outputData->getOrigin();
+   ossimIpt inputOrigin  = inputData->getOrigin();
+   
+   ossim_int32 startInputOffset = std::abs(outputOrigin.y - inputOrigin.y)*
+      inputW + std::abs(outputOrigin.x - inputOrigin.x);
+   ossim_int32 ulKernelStart    = -inputW - 1;
+   ossim_int32 leftKernelStart  = -1;
+   ossim_int32 llKernelStart    = inputW  - 1;
+   
+   T* ulKernelStartBuf   = NULL;
+   T* leftKernelStartBuf = NULL;
+   T* llKernelStartBuf   = NULL;
+   
+   for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(band))+startInputOffset;
+      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
+      T maxPix     = static_cast<T>(getMaxPixelValue(band));
+      T minPix     = static_cast<T>(getMinPixelValue(band));
+      
+      if(inputBuf&&outputBuf)
+      {
+         for(ossim_uint32 row = 0; row < outputW; ++row)
+         {
+            ossim_int32 rowOffset    = inputW*row;
+            ulKernelStartBuf   = inputBuf + (rowOffset + ulKernelStart);
+            leftKernelStartBuf = inputBuf + (rowOffset + leftKernelStart);
+            llKernelStartBuf   = inputBuf + (rowOffset + llKernelStart);
+            for(ossim_uint32 col = 0; col < outputH; ++col)
+            {
+               sum = theKernel[0][0]*(double)ulKernelStartBuf[0] +
+                     theKernel[0][1]*(double)ulKernelStartBuf[1] +
+                     theKernel[0][2]*(double)ulKernelStartBuf[2] +
+                     theKernel[1][0]*(double)leftKernelStartBuf[0] +
+                     theKernel[1][1]*(double)leftKernelStartBuf[1] +
+                     theKernel[1][2]*(double)leftKernelStartBuf[2] +
+                     theKernel[2][0]*(double)llKernelStartBuf[0] +
+                     theKernel[2][1]*(double)llKernelStartBuf[1] +
+                     theKernel[2][2]*(double)llKernelStartBuf[2];
+               
+               if(sum > maxPix)
+               {
+                  *outputBuf = maxPix;
+               }
+               else if(sum < minPix)
+               {
+                  *outputBuf = minPix;
+               }
+               else
+               {
+                  *outputBuf = static_cast<T>(sum);
+               }
+               //
+               // Need to implement the convolution here.
+               //
+
+               
+               ++ulKernelStartBuf;
+               ++leftKernelStartBuf;
+               ++llKernelStartBuf;
+               ++outputBuf;
+            }
+         }
+      }
+   }
+}
+
+void ossim3x3ConvolutionFilter::initialize()
+{
+   //---
+   // NOTE:
+   // Since initialize get called often sequentially we will wipe things slick
+   // but not reallocate to avoid multiple delete/allocates.
+   //
+   // On the first getTile call things will be reallocated/computed.
+   //---
+   theTile = NULL;
+   clearNullMinMax();
+}
+
+void ossim3x3ConvolutionFilter::allocate()
+{   
+   if(theInputConnection)
+   {
+      ossimImageDataFactory* idf = ossimImageDataFactory::instance();
+      
+      theTile = idf->create(this,
+                            this);
+      
+      theTile->initialize();
+   }
+}
+
+void ossim3x3ConvolutionFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+   if(property->getName() == "Kernel")
+   {
+      ossimMatrixProperty* matrixProperty = PTR_CAST(ossimMatrixProperty,
+                                                     property.get());
+      if(matrixProperty)
+      {
+         theKernel[0][0] = (*matrixProperty)(0,0);
+         theKernel[1][0] = (*matrixProperty)(1,0);
+         theKernel[2][0] = (*matrixProperty)(2,0);
+         theKernel[0][1] = (*matrixProperty)(0,1);
+         theKernel[1][1] = (*matrixProperty)(1,1);
+         theKernel[2][1] = (*matrixProperty)(2,1);
+         theKernel[0][2] = (*matrixProperty)(0,2);
+         theKernel[1][2] = (*matrixProperty)(1,2);
+         theKernel[2][2] = (*matrixProperty)(2,2);
+
+      }
+      else
+      {
+         ossimImageSourceFilter::setProperty(property);
+      }
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossim3x3ConvolutionFilter::getProperty(const ossimString& name)const
+{
+   if(name == "Kernel")
+   {
+      ossimMatrixProperty* property = new ossimMatrixProperty(name);
+      property->resize(3,3);
+      (*property)(0,0) = theKernel[0][0];
+      (*property)(1,0) = theKernel[1][0];
+      (*property)(2,0) = theKernel[2][0];
+      (*property)(0,1) = theKernel[0][1];
+      (*property)(1,1) = theKernel[1][1];
+      (*property)(2,1) = theKernel[2][1];
+      (*property)(0,2) = theKernel[0][2];
+      (*property)(1,2) = theKernel[1][2];
+      (*property)(2,2) = theKernel[2][2];
+      property->setCacheRefreshBit();
+
+      return property;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossim3x3ConvolutionFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back("Kernel");
+}
+
+bool ossim3x3ConvolutionFilter::saveState(ossimKeywordlist& kwl,
+                                          const char* prefix)const
+{   
+   kwl.add(prefix,
+           "rows",
+           3,
+           true);
+   
+   kwl.add(prefix,
+           "cols",
+           3,
+           true);
+   
+   for(ossim_int32 row = 0; row < 3; ++row)
+   {
+      for(ossim_int32 col =0; col < 3; ++col)
+      {
+         ossimString newPrefix = "m" +
+                                 ossimString::toString(row+1) + "_" +
+                                 ossimString::toString(col+1);
+         kwl.add(prefix,
+                 newPrefix,
+                 theKernel[row][col],
+                 true);          
+      }
+   }
+
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+
+bool ossim3x3ConvolutionFilter::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   ossimString newPrefix = prefix;
+   newPrefix += ossimString("m");
+   
+   for(ossim_int32 r = 0; r < 3; r++)
+   {
+      for(ossim_int32 c = 0; c < 3; c++)
+      {
+         theKernel[r][c] = 0.0;
+         
+         ossimString value = ossimString::toString(r+1);
+         value += "_";
+         value += ossimString::toString(c+1);
+         
+         const char* v = kwl.find(newPrefix.c_str(),
+                                  value.c_str());
+         if(v)
+         {
+            theKernel[r][c] = ossimString(v).toDouble();
+         }
+      }
+   }
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+void ossim3x3ConvolutionFilter::getKernel(double kernel[3][3])
+{
+   kernel[0][0] = theKernel[0][0];
+   kernel[0][1] = theKernel[0][1];
+   kernel[0][2] = theKernel[0][2];
+   kernel[1][0] = theKernel[1][0];
+   kernel[1][1] = theKernel[1][1];
+   kernel[1][2] = theKernel[1][2];
+   kernel[2][0] = theKernel[2][0];
+   kernel[2][1] = theKernel[2][1];
+   kernel[2][2] = theKernel[2][2];
+}
+
+void ossim3x3ConvolutionFilter::setKernel(double kernel[3][3])
+{
+   theKernel[0][0] = kernel[0][0];
+   theKernel[0][1] = kernel[0][1];
+   theKernel[0][2] = kernel[0][2];
+   theKernel[1][0] = kernel[1][0];
+   theKernel[1][1] = kernel[1][1];
+   theKernel[1][2] = kernel[1][2];
+   theKernel[2][0] = kernel[2][0];
+   theKernel[2][1] = kernel[2][1];
+   theKernel[2][2] = kernel[2][2];
+
+   // Will be recomputed first getTile call.
+   clearNullMinMax();
+}
+
+double ossim3x3ConvolutionFilter::getNullPixelValue(ossim_uint32 band)const
+{
+   if( isSourceEnabled() && (band < theNullPixValue.size()) )
+   {
+      return theNullPixValue[band];
+   }
+
+   return ossim::defaultNull(getOutputScalarType());
+}
+
+double ossim3x3ConvolutionFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   if( isSourceEnabled() && (band < theMinPixValue.size()) )
+   {
+      return theMinPixValue[band];
+   }
+   
+   return ossimImageSource::getMinPixelValue(band);
+}
+
+double ossim3x3ConvolutionFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   if( isSourceEnabled() && (band < theMaxPixValue.size()) )
+   {
+      return theMaxPixValue[band];
+   }
+
+   return ossimImageSource::getMaxPixelValue(band);
+}
+
+void ossim3x3ConvolutionFilter::clearNullMinMax()
+{
+   theNullPixValue.clear();
+   theMinPixValue.clear();
+   theMaxPixValue.clear();
+}
+
+void ossim3x3ConvolutionFilter::computeNullMinMax()
+{
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+
+   theNullPixValue.resize(BANDS);
+   theMinPixValue.resize(BANDS);
+   theMaxPixValue.resize(BANDS);
+
+   ossim_float64 defaultNull = ossim::defaultNull(getOutputScalarType());
+   ossim_float64 defaultMin = ossim::defaultMin(getOutputScalarType());
+   ossim_float64 defaultMax = ossim::defaultMax(getOutputScalarType());
+  
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      if(theInputConnection)
+      {
+         ossim_float64 inputNull = theInputConnection->getNullPixelValue(band);
+         ossim_float64 inputMin  = theInputConnection->getMinPixelValue(band);
+         ossim_float64 inputMax  = theInputConnection->getMaxPixelValue(band);
+         ossim_float64 tempMin   = 0.0;
+         ossim_float64 tempMax   = 0.0;
+         ossim_float64 k         = 0.0;
+         for(int i=0;i<3;++i)
+         {
+            for(int j=0;j<3;++j)
+            {
+               k=theKernel[i][j];
+               tempMin += (k<0.0) ? k*inputMax : k*inputMin;
+               tempMax += (k>0.0) ? k*inputMax : k*inputMin;
+            }
+         }
+
+         if((inputNull < getMinPixelValue(band)) ||
+            (inputNull > getMaxPixelValue(band)))
+         {
+            theNullPixValue[band] = inputNull;
+         }
+         else
+         {
+            theNullPixValue[band] = defaultNull;
+         }
+
+         if((tempMin >= defaultMin) && (tempMin <= defaultMax))
+         {
+            theMinPixValue[band] = tempMin;
+         }
+         else
+         {
+            theMinPixValue[band] = defaultMin;
+         }
+
+         if((tempMax >= defaultMin) && (tempMax <= defaultMax))
+         {
+            theMaxPixValue[band] = tempMax;
+         }
+         else
+         {
+            theMaxPixValue[band] = defaultMax;
+         }
+         
+      }
+      else // No input connection...
+      {
+         theNullPixValue[band] = defaultNull;
+         theMinPixValue[band]  = defaultMin;
+         theMaxPixValue[band]  = defaultMax;
+      }
+      
+   } // End of band loop.
+}
diff --git a/src/imaging/ossimAOD.cpp b/src/imaging/ossimAOD.cpp
new file mode 100644
index 0000000..3d9d781
--- /dev/null
+++ b/src/imaging/ossimAOD.cpp
@@ -0,0 +1,237 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kathy Minear
+//
+// Description:
+// 
+// Class to compute Aerosol Optical Depth (AOD) for with atmospheric
+// correction.
+// 
+//
+//*************************************************************************
+// $Id: ossimAOD.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <math.h>
+#include <ossim/imaging/ossimAOD.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+
+
+RTTI_DEF1(ossimAOD, "ossimAOD", ossimImageSourceFilter)
+
+static ossimTrace traceDebug("ossimAOD:debug");
+
+ossimAOD::ossimAOD(ossimObject* owner)
+   :
+      ossimImageSourceFilter  (owner),  // base class
+      theTile                 (NULL)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   disableSource();
+
+   // Construction not complete.
+}
+
+ossimAOD::ossimAOD(ossimImageSource* inputSource)
+   :
+      ossimImageSourceFilter  (NULL, inputSource),  // base class
+      theTile                 (NULL)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   disableSource();
+
+   if (inputSource == NULL)
+   {
+      setErrorStatus();
+      cerr << "ossimAOD::ossimAOD ERROR:"
+           << "\nNull input source passed to constructor!" << endl;
+      return;
+   }
+
+   initialize();
+}
+
+
+ossimAOD::ossimAOD(ossimObject* owner,
+                                         ossimImageSource* inputSource)
+   :
+      ossimImageSourceFilter  (owner, inputSource),  // base class     
+      theTile                 (NULL)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   disableSource();
+
+   if (inputSource == NULL)
+   {
+      setErrorStatus();
+      cerr << "ossimAOD::ossimAOD ERROR:"
+           << "\nNull input source passed to constructor!" << endl;
+      return;
+   }
+
+   initialize();
+}
+
+ossimAOD::~ossimAOD()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimAOD::getTile(const ossimIrect& tile_rect,
+                                              ossim_uint32 resLevel)
+{
+   if (!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+      
+   // Fetch tile from pointer from the input source.
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tile_rect,
+                                                                       resLevel);
+
+
+   if (!inputTile.valid())  // Just in case...
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimAOD::getTile ERROR:"
+         << "\nReceived null pointer to tile from input source!"
+         << "\nReturning blank tile."
+         << endl;
+      return inputTile;
+   }
+
+   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
+
+   if ( !theEnableFlag ||
+        (tile_status == OSSIM_NULL) ||
+        (tile_status == OSSIM_EMPTY) )
+   {
+      return inputTile;
+   }
+   
+   if (!theTile.valid())
+   {
+      allocate();
+      if (!theTile.valid())
+      {
+         return inputTile;
+      }
+   }
+
+   ossim_uint32 w     = tile_rect.width();
+   ossim_uint32 h     = tile_rect.height();
+   ossim_uint32 tw    = theTile->getWidth();
+   ossim_uint32 th    = theTile->getHeight();
+   // ossim_uint32 bands = theTile->getNumberOfBands();
+
+   // Set the origin of the output tile.
+   theTile->setOrigin(tile_rect.ul());
+
+   if(w*h != tw*th)
+   {
+      theTile->setWidthHeight(w, h);
+      theTile->initialize();
+   }
+   return theTile;
+}
+
+void ossimAOD::initialize()
+{
+   ossimImageSourceFilter::initialize();
+}
+
+void ossimAOD::allocate()
+{
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,
+                                                          theInputConnection);
+      theTile->initialize();
+      setInitializedFlag(true);
+      clearErrorStatus();
+   }
+   else
+   {
+      setInitializedFlag(false);
+      setErrorStatus();
+      cerr << "ossimAOD::initialize ERROR:"
+           << "\nCannot call method when input connection is NULL!"
+           << endl;
+   };
+
+   verifyEnabled();
+}
+
+bool ossimAOD::loadState(const ossimKeywordlist& /* kwl */, const char* /* prefix */)
+{
+   static const char MODULE[] = "ossimAOD::loadState()";
+
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   if (!theTile)
+   {
+      cerr << MODULE << " ERROR:"
+           << "Not initialized..." << endl;
+      return false;
+   }
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << *this
+           << "\nreturning..."
+           << endl;
+   }
+   
+   return true;
+}
+
+
+void ossimAOD::verifyEnabled()
+{
+   // Check all the pointers...
+   if ( !theInputConnection    || !theTile )
+   {
+      disableSource();
+      return;
+   }
+
+   enableSource();
+}
+
+ostream& ossimAOD::print(ostream& os) const
+{
+   os << "ossimAOD:"
+      << "\ntheEnableFlag:  " << (theEnableFlag?"enabled":"disabled")
+      << endl;
+
+   return os;
+}
+
+ostream& operator<<(ostream& os, const ossimAOD& hr)
+{
+   return hr.print(os);
+}
+
+void ossimAOD::writeTemplate(ostream& /* os */)
+{
+}
+
+ossimString ossimAOD::getShortName() const
+{
+   return ossimString("Aerosol Optical Depth");
+}
diff --git a/ossim/src/ossim/imaging/ossimAdrgHeader.cpp b/src/imaging/ossimAdrgHeader.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAdrgHeader.cpp
rename to src/imaging/ossimAdrgHeader.cpp
diff --git a/src/imaging/ossimAdrgTileSource.cpp b/src/imaging/ossimAdrgTileSource.cpp
new file mode 100644
index 0000000..ce7af52
--- /dev/null
+++ b/src/imaging/ossimAdrgTileSource.cpp
@@ -0,0 +1,682 @@
+//*******************************************************************
+//
+// See top level LICENSE.txt file.
+//
+// Author: Ken Melero
+// Contributor: David A. Horner (DAH) - http://dave.thehorners.com
+// 
+// Description: This class give the capability to access tiles from an
+//              ADRG file.
+//
+//********************************************************************
+// $Id: ossimAdrgTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimAdrgTileSource.h>
+#include <ossim/imaging/ossimAdrgHeader.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <iostream>
+
+RTTI_DEF1(ossimAdrgTileSource, "ossimAdrgTileSource", ossimImageHandler)
+
+//***
+// Static trace for debugging
+//***
+static ossimTrace traceDebug("ossimAdrgTileSource:debug");
+
+//***
+// NOTE:  Currently this tilesource is hard-coded to access tiles
+//        from the ZDR image file. This will change as I wrote support
+//        data classes for all the ADRG image files: ZDR, overview,
+//        and legend support data.  Next step in development will
+//        be to put in flags to access overview and legend image files.
+//***
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimAdrgTileSource::ossimAdrgTileSource()
+   :
+      ossimImageHandler(),
+      m_Tile(0),
+      m_TileBuffer(0),
+      m_FileStr(),
+      m_AdrgHeader(0)
+{
+   // Construction not complete.  Users should call "open" method.
+}
+
+ossimAdrgTileSource::~ossimAdrgTileSource()
+{
+   if(m_AdrgHeader)
+   {
+      delete m_AdrgHeader;
+      m_AdrgHeader = 0;
+   }
+   if (m_TileBuffer)
+   {
+      delete [] m_TileBuffer;
+      m_TileBuffer = 0;
+   }
+
+   close();
+}
+
+ossimRefPtr<ossimImageData> ossimAdrgTileSource::getTile(
+   const ossimIrect& rect,
+   ossim_uint32 resLevel)
+{
+   if (m_Tile.valid())
+   {
+      // Image rectangle must be set prior to calling getTile.
+      m_Tile->setImageRectangle(rect);
+      
+      if ( getTile( m_Tile.get(), resLevel ) == false )
+      {
+         if (m_Tile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            m_Tile->makeBlank();
+         }
+      }
+   }
+   
+   return m_Tile;
+}
+
+bool ossimAdrgTileSource::getTile(ossimImageData* result,
+                                  ossim_uint32 resLevel)
+{
+   bool status = false;
+
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
+   {
+      result->ref();  // Increment ref count.
+
+      //---
+      // Check for overview tile.  Some overviews can contain r0 so always
+      // call even if resLevel is 0.  Method returns true on success, false
+      // on error.
+      //---
+      status = getOverviewTile(resLevel, result);
+      
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+         
+         ossimIrect tile_rect = result->getImageRectangle();
+         
+         ossimIrect image_rect = getImageRectangle(resLevel);
+         
+         result->makeBlank();
+         
+         //---
+         // See if any point of the requested tile is in the image.
+         //---
+         if ( tile_rect.intersects(image_rect) )
+         {
+            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
+            
+            // Load the tile buffer with data from the adrg.
+            status = fillBuffer(tile_rect, clip_rect, result);
+
+            if (status)
+            {
+               result->validate();
+            }
+         }
+      }
+
+      result->unref();  // Decrement ref count.
+   }
+
+   return status;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimAdrgTileSource::fillBuffer(const ossimIrect& /* tile_rect */,
+                                     const ossimIrect& clip_rect,
+                                     ossimImageData* tile)
+{
+   //***
+   // Shift the upper left corner of the "clip_rect" to the an even chunk
+   // boundry.
+   //***
+   ossimIpt tileOrigin = clip_rect.ul();
+   adjustToStartOfTile(tileOrigin);
+
+   //***
+   // Calculate the number of tiles needed in the line/sample directions.
+   //***
+   ossim_int32 size_in_x = clip_rect.lr().x - tileOrigin.x + 1;
+   ossim_int32 size_in_y = clip_rect.lr().y - tileOrigin.y + 1;
+   
+   ossim_int32 tiles_in_x_dir = size_in_x / ADRG_TILE_WIDTH  +
+      (size_in_x % ADRG_TILE_WIDTH  ? 1 : 0);
+   ossim_int32 tiles_in_y_dir = size_in_y / ADRG_TILE_HEIGHT +
+      (size_in_y % ADRG_TILE_HEIGHT ? 1 : 0);
+
+
+   ossimIpt ulTilePt = tileOrigin;
+   
+   // Chunk loop in line direction.
+   for (ossim_int32 y=0; y<tiles_in_y_dir; y++)
+   {
+      ulTilePt.x = tileOrigin.x;
+
+      // Tile loop in sample direction.
+      for (ossim_int32 x=0; x<tiles_in_x_dir; x++)
+      {
+         ossimIrect adrg_tile_rect(ulTilePt.x,
+                                   ulTilePt.y,
+                                   ulTilePt.x + ADRG_TILE_WIDTH- 1,
+                                   ulTilePt.y + ADRG_TILE_HEIGHT - 1);
+
+         if (adrg_tile_rect.intersects(clip_rect))
+         {
+            ossimIrect tile_clip_rect = clip_rect.clipToRect(adrg_tile_rect);
+            
+            //---
+            // Some point in the chip intersect the tile so grab the
+            // data.
+            //---
+            ossim_int32 row = (ossim_int32) ulTilePt.y / ADRG_TILE_HEIGHT; 
+            ossim_int32 col = (ossim_int32) ulTilePt.x / ADRG_TILE_WIDTH;
+            ossim_int32 tileOffset = m_AdrgHeader->tim(row, col);
+
+            if(tileOffset != 0)
+            {
+               // Get the data.
+               int seek_position = (tileOffset - 1) * 49152 + 2048;
+               int band;
+
+               // seek to start of chip
+               m_FileStr.seekg(seek_position, ios::beg);
+               for (band=0; band<3; band++)
+               {
+                  //***
+                  // Read the chip from the ccf file into the chunk buffer.
+                  // This will get all the bands.  Bands are interleaved by
+                  // chip.
+                  //***
+                  if (!m_FileStr.read((char*)m_TileBuffer,
+                                       ADRG_TILE_SIZE))
+                  {
+                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+                     return false;
+                  }
+
+                  tile->loadBand(m_TileBuffer,
+                                 adrg_tile_rect,
+                                 tile_clip_rect,
+                                 band);
+
+               } // End of band loop.
+               
+            } // End of if (tileOffset != 0)
+            
+         } // End of if (adrg_tile_rect.intersects(clip_rect))
+         
+         ulTilePt.x += ADRG_TILE_WIDTH;
+         
+      }  // End of tile loop in the sample direction.
+
+      ulTilePt.y += ADRG_TILE_HEIGHT;
+      
+   }  // End of tile loop in the line direction.
+
+   return true;
+}
+
+ossim_uint32 ossimAdrgTileSource::getNumberOfOutputBands()const
+{
+   return getNumberOfInputBands();
+}
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+ossimIrect
+ossimAdrgTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return ossimIrect(0,                         // upper left x
+                     0,                         // upper left y
+                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
+                     getNumberOfLines(reduced_res_level)   - 1); // lower right y
+}
+
+void ossimAdrgTileSource::close()
+{
+   if(m_AdrgHeader)
+   {
+      delete m_AdrgHeader;
+      m_AdrgHeader = 0;
+   }
+   if(m_FileStr.is_open())
+   {
+      m_FileStr.close();
+   }
+   m_Tile = 0;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimAdrgTileSource::open()
+{
+   static const char MODULE[] = "ossimAdrgTileSource::open";
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << "Entered..."<<std::endl;
+   }
+   if(isOpen())
+   {
+      close();
+   }
+   if(m_AdrgHeader)
+   {
+      delete m_AdrgHeader;
+      m_AdrgHeader = 0;
+   }
+   // Instantiate support data class to parse header file.
+   m_AdrgHeader = new ossimAdrgHeader(theImageFile);
+
+   // Check for errors.
+   if (m_AdrgHeader->errorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " Error in ossimAdrg header detected." << std::endl;
+      }
+
+      close();
+      return false;
+   }
+
+   m_FileStr.open(m_AdrgHeader->imageFile().c_str(),
+                   ios::in | ios::binary);
+
+   // Check the file pointer.
+   if(!m_FileStr)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << MODULE << "\nCannot open:  "
+              << m_AdrgHeader->imageFile().c_str() << std::endl;
+      }
+      close();
+      
+      return false;
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE
+         << "File is opened -> "<< m_AdrgHeader->imageFile()<<std::endl;
+   }
+
+   // allow the base handler to check for other overrides
+   completeOpen();
+   // Allocate memory.
+   m_Tile      = ossimImageDataFactory::instance()->create(this, this);
+   m_Tile->initialize();
+   m_TileBuffer  = new ossim_uint8[ADRG_TILE_SIZE];
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nminLon:   " << m_AdrgHeader->minLon()
+         << "\nminLond:  " << m_AdrgHeader->minLongitude() 
+         << "\nminLat:   " << m_AdrgHeader->minLat()
+         << "\nminLatd:  " << m_AdrgHeader->minLatitude()
+         << "\nmaxLon:   " << m_AdrgHeader->maxLon()
+         << "\nmaxLond:  " << m_AdrgHeader->maxLongitude()
+         << "\nmaxLat:   " << m_AdrgHeader->maxLat()
+         << "\nmaxLatd:  " << m_AdrgHeader->maxLatitude()
+         << std::endl;
+   }
+   
+   return true;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimAdrgTileSource::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix) const
+{
+   // Currently nothing to do here.
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimAdrgTileSource::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   if (ossimImageHandler::loadState(kwl, prefix))
+   {
+      if (open())
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossimRefPtr<ossimImageGeometry> ossimAdrgTileSource::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      // Check for external geom:
+      theGeometry = getExternalImageGeometry();
+      
+      if ( !theGeometry )
+      {
+         // origin of latitude
+         ossim_float64 originLatitude = (m_AdrgHeader->maxLatitude() +
+                                         m_AdrgHeader->minLatitude()) / 2.0;
+         
+         // central meridian.
+         ossim_float64 centralMeridian = (m_AdrgHeader->maxLongitude() +
+                                          m_AdrgHeader->minLongitude()) / 2.0;
+         
+         //---
+         // Compute the pixel size in latitude and longitude direction.  This will
+         // be full image extents divided by full image lines and samples.
+         //---
+         
+         // Samples in full image (used to compute degPerPixelX).
+         ossim_float64 samples = m_AdrgHeader->samples();
+         
+         // Lines in full image (used to compute degPerPixelX).
+         ossim_float64 lines = m_AdrgHeader->lines();
+         
+         // Degrees in latitude direction of the full image.
+         ossim_float64 degrees_in_lat_dir = m_AdrgHeader->maxLatitude() -
+            m_AdrgHeader->minLatitude();
+         
+         // Degrees in longitude direction of the full image.
+         ossim_float64 degrees_in_lon_dir = m_AdrgHeader->maxLongitude() -
+            m_AdrgHeader->minLongitude();
+         
+         ossim_float64 degPerPixelY = degrees_in_lat_dir / lines;
+         ossim_float64 degPerPixelX = degrees_in_lon_dir / samples;
+         
+         //---
+         // The tie is determined with the following assumptions that need to be
+         // verified:
+         // 1) Rows and columns start at 1.
+         // 2) The min / max latitudes longitudes go to the edge of the pixel.
+         // 3) Latitude decreases by degPerPixelY with each line.
+         // 4) Longitude increases by degPerPixelX with each sample.
+         //---
+         ossim_float64 ul_lat = (m_AdrgHeader->maxLatitude() - 
+                                 ( (m_AdrgHeader->startRow() - 1) *
+                                   degPerPixelY ) - ( degPerPixelY * 0.5 ) );
+         ossim_float64 ul_lon = (m_AdrgHeader->minLongitude() +
+                                 ( (m_AdrgHeader->startCol() -1) *
+                                   degPerPixelX ) +  ( degPerPixelX * 0.5 ) );
+         
+         // projection type
+         ossimKeywordlist kwl;
+         const char* prefix = 0;
+         kwl.add(prefix,
+                 ossimKeywordNames::TYPE_KW,
+                 "ossimEquDistCylProjection",
+                 true);
+         
+         // datum.
+         kwl.add(prefix,
+                 ossimKeywordNames::DATUM_KW,
+                 "WGE",
+                 true);
+         
+         // origin latitude
+         kwl.add(prefix,
+                 ossimKeywordNames::ORIGIN_LATITUDE_KW,
+                 originLatitude,
+                 true);
+
+         // central meridin
+         kwl.add(prefix,
+                 ossimKeywordNames::CENTRAL_MERIDIAN_KW,
+                 centralMeridian,
+                 true);
+
+         // Save the tie point.
+         kwl.add(prefix,
+                 ossimKeywordNames::TIE_POINT_XY_KW,
+                 ossimDpt(ul_lon, ul_lat).toString().c_str(),
+                 true);
+         kwl.add(prefix,
+                 ossimKeywordNames::TIE_POINT_UNITS_KW,
+                 ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
+                 true);
+
+         // Save the scale.
+         kwl.add(prefix,
+                 ossimKeywordNames::TIE_POINT_LAT_KW,
+                 ul_lat,
+                 true);
+   
+         kwl.add(prefix,
+                 ossimKeywordNames::TIE_POINT_LON_KW,
+                 ul_lon,
+                 true);
+
+         // Save the scale.
+         kwl.add(prefix,
+                 ossimKeywordNames::PIXEL_SCALE_XY_KW,
+                 ossimDpt(degPerPixelX, degPerPixelY).toString().c_str(),
+                 true);
+         kwl.add(prefix,
+                 ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
+                 ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
+                 true);  
+
+         // lines
+         kwl.add(prefix,
+                 ossimKeywordNames::NUMBER_LINES_KW,
+                 getNumberOfLines());
+
+         // samples
+         kwl.add(prefix,
+                 ossimKeywordNames::NUMBER_SAMPLES_KW,
+                 getNumberOfSamples());
+
+         // res sets
+         kwl.add(prefix,
+                 ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW,
+                 getNumberOfDecimationLevels());
+
+         // bands
+         kwl.add(prefix,
+                 ossimKeywordNames::NUMBER_INPUT_BANDS_KW,
+                 getNumberOfInputBands());
+
+         // bands
+         kwl.add(prefix,
+                 ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
+                 getNumberOfOutputBands());
+   
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "\nminLon:             " << m_AdrgHeader->minLon()
+               << "\nminLond:            " << m_AdrgHeader->minLongitude() 
+               << "\nminLat:             " << m_AdrgHeader->minLat()
+               << "\nminLatd:            " << m_AdrgHeader->minLatitude()
+               << "\nmaxLon:             " << m_AdrgHeader->maxLon()
+               << "\nmaxLond:            " << m_AdrgHeader->maxLongitude()
+               << "\nmaxLat:             " << m_AdrgHeader->maxLat()
+               << "\nmaxLatd:            " << m_AdrgHeader->maxLatitude()
+               << "\nstartRow:           " << m_AdrgHeader->startRow()
+               << "\nstartCol:           " << m_AdrgHeader->startCol()
+               << "\nstopRow:            " << m_AdrgHeader->stopRow()
+               << "\nstopCol:            " << m_AdrgHeader->stopCol()
+               << "\nfull image lines:   " << lines
+               << "\nfull image samples: " << samples
+               << "\nkwl:\n"               << kwl
+               << std::endl;
+         }
+
+         ossimProjection* new_proj = ossimProjectionFactoryRegistry::instance()->createProjection(kwl);
+         theGeometry = new ossimImageGeometry;
+         theGeometry->setProjection(new_proj);  // assumes management of projection instance
+         
+      } // matches (after getExternalImageGeometry()):  if ( !theGeometry ) 
+      
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+      
+   } // matches: if ( !theGeometry )
+
+   return theGeometry;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossimScalarType ossimAdrgTileSource::getOutputScalarType() const
+{
+  return OSSIM_UCHAR;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimAdrgTileSource::getTileWidth() const
+{
+   return ( m_Tile.valid() ? m_Tile->getWidth() : 0 );
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimAdrgTileSource::getTileHeight() const
+{
+   return ( m_Tile.valid() ? m_Tile->getHeight() : 0 );
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimAdrgTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   if ( (reduced_res_level == 0) && m_AdrgHeader )
+   {
+      return (m_AdrgHeader->stopRow() - m_AdrgHeader->startRow()) + 1;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfLines(reduced_res_level);
+   }
+
+   return 0;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimAdrgTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   if ( (reduced_res_level == 0) && m_AdrgHeader )
+   {
+      return (m_AdrgHeader->stopCol() - m_AdrgHeader->startCol()) + 1;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfSamples(reduced_res_level);
+   }
+
+   return 0;
+}
+
+ossim_uint32 ossimAdrgTileSource::getImageTileWidth() const
+{
+   return ADRG_TILE_WIDTH;
+}
+
+ossim_uint32 ossimAdrgTileSource::getImageTileHeight() const
+{
+   return ADRG_TILE_HEIGHT;
+}
+
+ossimRefPtr<ossimProperty> ossimAdrgTileSource::getProperty(const ossimString& name)const
+{
+   if(name == "file_type")
+   {
+      return new ossimStringProperty(name, "ADRG");
+   }
+   
+   return ossimImageHandler::getProperty(name);
+}
+
+void ossimAdrgTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+	ossimImageHandler::getPropertyNames(propertyNames);
+	propertyNames.push_back("file_type");
+}
+
+ossimString ossimAdrgTileSource::getShortName()const
+{
+   return ossimString("adrg");
+}
+
+ossimString ossimAdrgTileSource::getLongName()const
+{
+   return ossimString("adrg reader");
+}
+
+ossim_uint32 ossimAdrgTileSource::getNumberOfInputBands() const
+{
+   ossim_uint32 bands = 1;
+   if ( m_AdrgHeader )
+   {
+      bands = m_AdrgHeader->numberOfBands();
+   }
+   return bands;
+}
+
+bool ossimAdrgTileSource::isOpen()const
+{
+   return (m_AdrgHeader!=0);
+}
+
+void ossimAdrgTileSource::adjustToStartOfTile(ossimIpt& pt) const
+{
+   pt.x &= 0xffffff80;
+   pt.y &= 0xffffff80;
+}
diff --git a/ossim/src/ossim/imaging/ossimAnnotationEllipseObject.cpp b/src/imaging/ossimAnnotationEllipseObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationEllipseObject.cpp
rename to src/imaging/ossimAnnotationEllipseObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimAnnotationFontObject.cpp b/src/imaging/ossimAnnotationFontObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationFontObject.cpp
rename to src/imaging/ossimAnnotationFontObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimAnnotationGdBitmapFont.cpp b/src/imaging/ossimAnnotationGdBitmapFont.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationGdBitmapFont.cpp
rename to src/imaging/ossimAnnotationGdBitmapFont.cpp
diff --git a/src/imaging/ossimAnnotationLineObject.cpp b/src/imaging/ossimAnnotationLineObject.cpp
new file mode 100644
index 0000000..466fabc
--- /dev/null
+++ b/src/imaging/ossimAnnotationLineObject.cpp
@@ -0,0 +1,184 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimAnnotationLineObject.cpp 13964 2009-01-14 16:30:07Z gpotts $
+
+#include <ossim/imaging/ossimAnnotationLineObject.h>
+#include <ossim/imaging/ossimRgbImage.h>
+
+RTTI_DEF1(ossimAnnotationLineObject,
+          "ossimAnnotationLineObject",
+          ossimAnnotationObject)
+
+ossimAnnotationLineObject::ossimAnnotationLineObject()
+   :ossimAnnotationObject(),
+    theStart(0,0),
+    theEnd(0,0),
+    theBoundingRect(0,0,0,0)
+{
+}
+
+ossimAnnotationLineObject::ossimAnnotationLineObject(const ossimIpt& start,
+                                                     const ossimIpt& end,
+                                                     unsigned char r,
+                                                     unsigned char g,
+                                                     unsigned char b,
+                                                     long thickness)
+   :ossimAnnotationObject(r, g, b, thickness),
+    theStart(start),
+    theEnd(end)
+{
+   computeBoundingRect();
+}
+
+ossimAnnotationLineObject::ossimAnnotationLineObject(long x1,
+                                                     long y1,
+                                                     long x2,
+                                                     long y2,
+                                                     unsigned char r,
+                                                     unsigned char g,
+                                                     unsigned char b,
+                                                     long thickness)
+   :ossimAnnotationObject(r, g, b, thickness),
+    theStart(x1, y1),
+    theEnd(x2, y2)
+{
+   computeBoundingRect();
+}
+
+ossimAnnotationLineObject::ossimAnnotationLineObject(const ossimAnnotationLineObject& rhs)
+      :ossimAnnotationObject(rhs),
+       theStart(rhs.theStart),
+       theEnd(rhs.theEnd),
+       theBoundingRect(rhs.theBoundingRect)
+{
+}
+
+ossimObject* ossimAnnotationLineObject::dup()const
+{
+   return new ossimAnnotationLineObject(*this);
+}
+
+void ossimAnnotationLineObject::applyScale(double x, double y)
+{
+   theStart.x = ossim::round<int>(theStart.x*x);
+   theStart.y = ossim::round<int>(theStart.y*y);
+   theEnd.x   = ossim::round<int>(theEnd.x*x);
+   theEnd.y   = ossim::round<int>(theEnd.y*y);
+   computeBoundingRect();
+}
+
+ossimAnnotationObject* ossimAnnotationLineObject::getNewClippedObject(const ossimDrect& rect)const
+{
+   ossimAnnotationLineObject* result = (ossimAnnotationLineObject*)NULL;
+   ossimDpt start = theStart;
+   ossimDpt end   = theEnd;
+   
+   if(rect.clip(start, end))
+   {
+      result = (ossimAnnotationLineObject*)dup();
+      result->setLine(start, end);
+   }
+   
+   return result;
+}
+
+bool ossimAnnotationLineObject::intersects(const ossimDrect& rect)const
+{
+   ossimDpt start = theStart;
+   ossimDpt end   = theEnd;
+   
+   return rect.clip(start, end);
+}
+
+void ossimAnnotationLineObject::draw(ossimRgbImage& anImage)const
+{
+   if(anImage.getImageData().valid())
+   {
+      anImage.setDrawColor(theRed, theGreen, theBlue);
+      anImage.setThickness(theThickness);
+      ossimDrect imageRect = anImage.getImageData()->getImageRectangle();
+      ossimDpt start = theStart;
+      ossimDpt end   = theEnd;
+      
+      if(anImage.getImageData().valid())
+      {
+         // we need to extend it by a couple of pixels since
+         // if a pixel lies on the edge and then another pixel is just off
+         // the edge we will get a stair step and so for several pixels
+         // the line might be inside the image rectangle but the clip
+         // algorithm will only draw 1 pixel since it thinks the first
+         // point is inside and the second point is outside and will
+         // execute the clip algorithm keeping only the first
+         // point.
+         ossimDrect clipRect(imageRect.ul().x - 10,
+                             imageRect.ul().y - 10,
+                             imageRect.lr().x + 10,
+                             imageRect.lr().y + 10);
+         // now we can draw.
+         if(clipRect.clip(start, end))
+         {
+            anImage.drawLine(ossimIpt((int)start.x,
+                                      (int)start.y),
+                             ossimIpt((int)end.x,
+                                      (int)end.y));
+         }
+      }
+   }
+}
+
+std::ostream& ossimAnnotationLineObject::print(std::ostream& out)const
+{
+   out << "line_start:    " << theStart << endl
+       << "line_end:      " << theEnd   << endl
+       << "bounding_rect: " << theBoundingRect << endl;
+   return out;
+}
+
+void ossimAnnotationLineObject::getBoundingRect(ossimDrect& rect)const
+{
+   rect = theBoundingRect;
+}
+
+void ossimAnnotationLineObject::computeBoundingRect()
+{
+   vector<ossimDpt> pts(2);
+      
+   pts[0] = theStart;
+   pts[1] = theEnd;
+
+   theBoundingRect = ossimDrect(pts);
+}
+
+void ossimAnnotationLineObject::setLine(const ossimDpt& start,
+                                        const ossimDpt& end)
+{
+   theStart = start;
+   theEnd   = end;
+   computeBoundingRect();
+}
+void ossimAnnotationLineObject::getLine(ossimDpt& start, ossimDpt& end)
+{
+   start = theStart;
+   end   = theEnd;
+}
+
+bool ossimAnnotationLineObject::isPointWithin(const ossimDpt& point)const
+{
+  if(theBoundingRect.pointWithin(point))
+  {
+    // we will use the implicit form of a line to determine if the point is
+    // on the line.  For now we will just return true if it is within the 
+    // bounding rect.
+    return true;
+  }
+
+  return false;
+}
diff --git a/ossim/src/ossim/imaging/ossimAnnotationMultiEllipseObject.cpp b/src/imaging/ossimAnnotationMultiEllipseObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationMultiEllipseObject.cpp
rename to src/imaging/ossimAnnotationMultiEllipseObject.cpp
diff --git a/src/imaging/ossimAnnotationMultiLineObject.cpp b/src/imaging/ossimAnnotationMultiLineObject.cpp
new file mode 100644
index 0000000..174a199
--- /dev/null
+++ b/src/imaging/ossimAnnotationMultiLineObject.cpp
@@ -0,0 +1,191 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimAnnotationMultiLineObject.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/imaging/ossimAnnotationMultiLineObject.h>
+
+RTTI_DEF1(ossimAnnotationMultiLineObject,
+          "ossimAnnotationMultiLineObject",
+          ossimAnnotationObject);
+
+void ossimAnnotationMultiLineObject::draw(ossimRgbImage& anImage)const
+{
+   if(anImage.getImageData().valid())
+   {
+      anImage.setDrawColor(theRed, theGreen, theBlue);
+      anImage.setThickness(theThickness);
+      ossimDrect imageRect = anImage.getImageData()->getImageRectangle();
+
+      
+      
+      if(theBoundingRect.intersects(imageRect))
+      {
+         // we need to extend it by a couple of pixels since
+         // if a pixel lies on the edge and then another pixel is just off
+         // the edge we will get a stair step and so for several pixels
+         // the line might be inside the image rectangle but the clip
+         // algorithm will only draw 1 pixel since it thinks the first
+         // point is inside and the second point is outside and will
+         // execute the clip algorithm keeping only the first
+         // point.
+         ossimDrect clipRect(imageRect.ul().x - 10,
+                             imageRect.ul().y - 10,
+                             imageRect.lr().x + 10,
+                             imageRect.lr().y + 10);
+         
+         for(ossim_uint32 i = 0; i < thePolyLineList.size(); ++i)
+         {
+            const vector<ossimDpt>& vList = thePolyLineList[i].getVertexList();
+            
+            if(vList.size() == 1)
+            {
+               anImage.drawLine(ossimIpt(vList[0]),
+                                ossimIpt(vList[0]));
+            }
+            else
+            {
+               for(ossim_uint32 i2 = 0; i2 < (vList.size()-1); ++i2)
+               {
+                  ossimDpt start = vList[i2];
+                  ossimDpt end   = vList[i2+1];
+                  // now we can draw.
+                  if(clipRect.clip(start, end))
+                  {
+                     anImage.drawLine(ossimIpt((int)start.x,
+                                               (int)start.y),
+                                      ossimIpt((int)end.x,
+                                               (int)end.y));
+                  }
+               }
+            }
+         }
+      }
+   }
+}
+
+bool ossimAnnotationMultiLineObject::intersects(const ossimDrect& rect)const
+{
+
+   for(ossim_uint32 i = 0; i < thePolyLineList.size(); ++i)
+   {
+      if(thePolyLineList[i].isWithin(rect))
+      {
+         return true;
+      }
+   }
+   return false;
+}
+
+
+void ossimAnnotationMultiLineObject::applyScale(double x,
+                                                double y)
+{
+   for(ossim_uint32 i=0; i < thePolyLineList.size(); ++i)
+   {
+      vector<ossimDpt>& vList = thePolyLineList[i].getVertexList();
+      
+      for(ossim_uint32 i2 = 0; i2 < vList.size(); ++i2)
+      {
+         vList[i].x *= x;
+         vList[i].y *= y;
+         vList[i].x *= x;
+         vList[i].y *= y;
+      }
+   }
+   theBoundingRect *= ossimDpt(x, y);
+}
+
+ossimAnnotationObject* ossimAnnotationMultiLineObject::getNewClippedObject(const ossimDrect& rect)const
+{
+   ossimAnnotationMultiLineObject* result = (ossimAnnotationMultiLineObject*)NULL;
+
+   if(intersects(rect))
+   {
+      vector<ossimPolyLine> lineList;
+      vector<ossimPolyLine> tempResult;
+      
+      ossimDrect clipRect(rect.ul().x - 10,
+                          rect.ul().y - 10,
+                          rect.lr().x + 10,
+                          rect.lr().y + 10);
+
+      for(ossim_uint32 i =0; i< thePolyLineList.size();++i)
+      {
+         if(thePolyLineList[i].clipToRect(tempResult, clipRect))
+         {
+            lineList.insert(lineList.end(),
+                            tempResult.begin(),
+                            tempResult.end());
+         }
+      }
+      
+      if(lineList.size() > 0)
+      {
+         result = new ossimAnnotationMultiLineObject(lineList,
+                                                     theRed,
+                                                     theGreen,
+                                                     theBlue,
+                                                     theThickness);
+      }
+   }
+   
+   return result;
+}
+
+bool ossimAnnotationMultiLineObject::isPointWithin(const ossimDpt& imagePoint)const
+{
+   for(ossim_uint32 i=0; i < thePolyLineList.size(); ++i)
+   {
+      if(thePolyLineList[i].isPointWithin(imagePoint))
+      {
+         return true;
+      }
+      
+   }
+
+   return false;
+}
+
+void ossimAnnotationMultiLineObject::computeBoundingRect()
+{
+   theBoundingRect.makeNan();
+   
+   if(thePolyLineList.size() == 1)
+   {
+      theBoundingRect = thePolyLineList[0].getBoundingRect();
+   }
+   else if(thePolyLineList.size() > 1)
+   {
+      for(ossim_uint32 i = 0; i < thePolyLineList.size(); ++i)
+      {
+         ossimDrect rect = thePolyLineList[i].getBoundingRect();
+         if(theBoundingRect.hasNans())
+         {
+            theBoundingRect = rect;
+         }
+         else if(!rect.hasNans())
+         {
+            theBoundingRect = theBoundingRect.combine(rect);
+         }
+      }
+   }
+}
+
+std::ostream& ossimAnnotationMultiLineObject::print(std::ostream& out)const
+{
+   ossimAnnotationObject::print(out);
+
+   for(ossim_uint32 i = 0; i < thePolyLineList.size();++i)
+   {
+      out << thePolyLineList[i] << endl
+          <<"______________________________________"<<endl;
+   }
+   return out;
+}
diff --git a/ossim/src/ossim/imaging/ossimAnnotationMultiPolyLineObject.cpp b/src/imaging/ossimAnnotationMultiPolyLineObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationMultiPolyLineObject.cpp
rename to src/imaging/ossimAnnotationMultiPolyLineObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimAnnotationMultiPolyObject.cpp b/src/imaging/ossimAnnotationMultiPolyObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationMultiPolyObject.cpp
rename to src/imaging/ossimAnnotationMultiPolyObject.cpp
diff --git a/src/imaging/ossimAnnotationObject.cpp b/src/imaging/ossimAnnotationObject.cpp
new file mode 100644
index 0000000..bb09dd5
--- /dev/null
+++ b/src/imaging/ossimAnnotationObject.cpp
@@ -0,0 +1,160 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See LICENSE.txt file in the top level directory.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimAnnotationObject.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/imaging/ossimAnnotationObject.h>
+
+RTTI_DEF1(ossimAnnotationObject, "ossimAnnotationObject", ossimObject)
+
+ossim_uint32 ossimAnnotationObject::theIdCounter = 0;
+
+ossimAnnotationObject::~ossimAnnotationObject()
+{}
+
+void ossimAnnotationObject::restIdCounter()
+{
+  theIdCounter = 0;
+}
+
+ossim_uint32 ossimAnnotationObject::getNextId()
+{
+  ossim_uint32 id = theIdCounter;
+  ++theIdCounter;
+  return id;
+}
+
+ossimAnnotationObject::ossimAnnotationObject(ossim_uint8 r,
+                                             ossim_uint8 g,
+                                             ossim_uint8 b,
+                                             ossim_uint8 thickness)
+   :theRed(r),
+    theGreen(g),
+    theBlue(b),
+    theThickness(thickness)
+{
+  theId = getNextId();
+}
+
+void ossimAnnotationObject::setColor(ossim_uint8 r,
+                                     ossim_uint8 g,
+                                     ossim_uint8 b)
+{
+   theRed    = r;
+   theGreen = g;
+   theBlue   = b;
+}
+
+void ossimAnnotationObject::setThickness(ossim_uint8 thickness)
+{
+   theThickness = thickness;
+}
+
+void ossimAnnotationObject::getColor(ossim_uint8 &r,
+                                     ossim_uint8 &g,
+                                     ossim_uint8 &b)const
+{
+   r = theRed;
+   g = theGreen;
+   b = theBlue;
+}
+
+ossim_uint8 ossimAnnotationObject::getThickness()const
+{
+   return theThickness;
+}
+
+ossim_uint32 ossimAnnotationObject::getId()const
+{
+  return theId;
+}
+
+ossim_uint32 ossimAnnotationObject::setId()
+{
+  theId = getNextId();
+  return getId();
+}
+
+bool ossimAnnotationObject::saveState(ossimKeywordlist& kwl,
+                                      const char* prefix) const
+{
+   kwl.add(prefix, "red",       theRed);
+   kwl.add(prefix, "green",     theGreen);
+   kwl.add(prefix, "blue",      theBlue);
+   kwl.add(prefix, "thickness", theThickness);
+   
+   return ossimObject::saveState(kwl, prefix);
+}
+
+bool ossimAnnotationObject::loadState(const ossimKeywordlist& kwl,
+                                      const char* prefix)
+{
+   const char* red       = kwl.find(prefix, "red");
+   const char* green     = kwl.find(prefix, "green");
+   const char* blue      = kwl.find(prefix, "blue");
+   const char* thickness = kwl.find(prefix, "thickness");
+
+   if(red)
+   {
+      theRed = (ossim_uint8)ossimString(red).toLong();
+   }
+   if(green)
+   {
+      theGreen = (ossim_uint8)ossimString(green).toLong();
+   }
+   if(blue)
+   {
+      theBlue = (ossim_uint8)ossimString(blue).toLong();
+   }
+   if(thickness)
+   {
+      theThickness = (ossim_uint8)ossimString(thickness).toLong();
+   }
+   
+   return ossimObject::loadState(kwl, prefix);
+}
+
+bool ossimAnnotationObject::isPointWithin(const ossimDpt& /* imagePoint */) const
+{
+   return false;
+}
+
+ossimString ossimAnnotationObject::getName()const
+{
+   return theName;
+}
+
+void ossimAnnotationObject::setName(const ossimString& name)
+{
+   theName = name;
+}
+
+ossimDrect ossimAnnotationObject::getBoundingRect()const
+{
+   ossimDrect rect;
+   getBoundingRect(rect);
+   return rect;
+}
+
+void ossimAnnotationObject::applyScale(const ossimDpt& scale)
+{
+   applyScale(scale.x,
+              scale.y);
+}
+
+std::ostream& ossimAnnotationObject::print(ostream& out) const
+{
+   out << setw(15)<<setiosflags(ios::left)<<"Red:" << (long)theRed
+       << setw(15)<<setiosflags(ios::left)<<"\nGreen:" << (long)theGreen
+       << setw(15)<<setiosflags(ios::left)<<"\nBlue:" << (long)theBlue
+       << setw(15)<<setiosflags(ios::left)<<"\nThickness:"<< (long)theThickness
+       << "\ncolor_red:   " << (long)theRed
+       << "\ncolor_green: " << (long)theGreen
+       << "\ncolor_blue:  " << (long)theBlue
+       << "\nthickness:   " << (long)theThickness << std::endl;
+   return out;
+}
diff --git a/ossim/src/ossim/imaging/ossimAnnotationObjectFactory.cpp b/src/imaging/ossimAnnotationObjectFactory.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationObjectFactory.cpp
rename to src/imaging/ossimAnnotationObjectFactory.cpp
diff --git a/ossim/src/ossim/imaging/ossimAnnotationPolyObject.cpp b/src/imaging/ossimAnnotationPolyObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationPolyObject.cpp
rename to src/imaging/ossimAnnotationPolyObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimAnnotationSource.cpp b/src/imaging/ossimAnnotationSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAnnotationSource.cpp
rename to src/imaging/ossimAnnotationSource.cpp
diff --git a/src/imaging/ossimAppFixedTileCache.cpp b/src/imaging/ossimAppFixedTileCache.cpp
new file mode 100644
index 0000000..6423b2f
--- /dev/null
+++ b/src/imaging/ossimAppFixedTileCache.cpp
@@ -0,0 +1,430 @@
+//******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: This file contains the Application cache algorithm
+//
+//***********************************
+// $Id: ossimAppFixedTileCache.cpp 20127 2011-10-12 11:27:10Z gpotts $
+#include <algorithm>
+#include <sstream>
+#include <ossim/imaging/ossimAppFixedTileCache.h>
+#include <ossim/imaging/ossimFixedTileCache.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimTrace.h>
+#include <OpenThreads/ScopedLock>
+
+ossimAppFixedTileCache* ossimAppFixedTileCache::theInstance = 0;
+ossimAppFixedTileCache::ossimAppFixedCacheId ossimAppFixedTileCache::theUniqueAppIdCounter = 0;
+const ossim_uint32 ossimAppFixedTileCache::DEFAULT_SIZE = 1024*1024*80;
+
+static const ossimTrace traceDebug("ossimAppFixedTileCache:debug");
+std::ostream& operator <<(std::ostream& out, const ossimAppFixedTileCache& rhs)
+{
+   std::map<ossimAppFixedTileCache::ossimAppFixedCacheId, ossimFixedTileCache*>::const_iterator iter = rhs.theAppCacheMap.begin();
+
+   if(iter == rhs.theAppCacheMap.end())
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "***** APP CACHE EMPTY *****" << endl;
+   }
+   else
+   {
+      while(iter != rhs.theAppCacheMap.end())
+      {
+         out << "Cache id = "<< (*iter).first << " size = " << (*iter).second->getCacheSize() << endl;
+         ++iter;
+      }
+   }
+
+   return out;
+}
+
+
+ossimAppFixedTileCache::ossimAppFixedTileCache()
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimAppFixedTileCache::ossimAppFixedTileCache() DEBUG: entered ..." << std::endl;
+   }
+   theInstance = this;
+   theTileSize = ossimIpt(64, 64);
+   theCurrentCacheSize = 0;
+
+   // ossim::defaultTileSize(theTileSize);
+   
+   ossim_uint32 cacheSize = ossimString(ossimPreferences::instance()->findPreference("cache_size")).toUInt32()*(1024*1024);
+   const char* tileSize = ossimPreferences::instance()->findPreference("tile_size");
+   if(tileSize)
+   {
+      ossimString tempString(tileSize);
+      std::vector<ossimString> splitString;
+      tempString = tempString.trim();
+      tempString.split(splitString, " ");
+      if(splitString.size() > 1)
+      {
+         theTileSize.x = splitString[0].toInt32();
+         theTileSize.y = splitString[1].toInt32();
+      }
+      else 
+      {
+         theTileSize = ossimIpt(64,64);
+      }
+         
+    }
+   if(cacheSize)
+   {
+      setMaxCacheSize(cacheSize);
+   }
+   else
+   {
+      setMaxCacheSize(DEFAULT_SIZE);
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG: cache tile size = " << theTileSize << std::endl
+         << "Cache size = " << cacheSize << " bytes" << std::endl;
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAppFixedTileCache::ossimAppFixedTileCache() DEBUG: leaving ..." << std::endl;
+   }
+}
+
+ossimAppFixedTileCache::~ossimAppFixedTileCache()
+{
+   deleteAll();
+}
+
+ossimAppFixedTileCache *ossimAppFixedTileCache::instance(ossim_uint32  maxSize)
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimAppFixedTileCache;
+      if(maxSize)
+	{
+	  theInstance->setMaxCacheSize(maxSize);
+	}
+   }
+   return theInstance;
+}
+
+void ossimAppFixedTileCache::setMaxCacheSize(ossim_uint32 cacheSize)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   theMaxGlobalCacheSize = cacheSize;
+   theMaxCacheSize = cacheSize;
+   //   theMaxCacheSize      = (ossim_uint32)(theMaxGlobalCacheSize*.2);
+}
+
+void ossimAppFixedTileCache::flush()
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator currentIter = theAppCacheMap.begin();
+   
+   while(currentIter != theAppCacheMap.end())
+   {
+      (*currentIter).second->flush();
+      ++currentIter;
+   }
+   theCurrentCacheSize = 0;
+}
+
+void ossimAppFixedTileCache::flush(ossimAppFixedCacheId cacheId)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimFixedTileCache* cache = getCache(cacheId);
+   {
+      if(cache)
+      {
+         theCurrentCacheSize -= cache->getCacheSize();
+         cache->flush();
+      }
+   }
+}
+
+void ossimAppFixedTileCache::deleteCache(ossimAppFixedCacheId cacheId)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimRefPtr<ossimFixedTileCache> cache = getCache(cacheId);
+   {
+      std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator iter = theAppCacheMap.find(cacheId);
+      
+      if(cache.valid())
+      {
+         theAppCacheMap.erase(iter);
+         theCurrentCacheSize -= cache->getCacheSize();
+      }
+      cache = 0;
+   }
+}
+
+ossimAppFixedTileCache::ossimAppFixedCacheId ossimAppFixedTileCache::newTileCache(const ossimIrect& tileBoundaryRect,
+                                                                                  const ossimIpt& tileSize)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimAppFixedCacheId result = -1; 
+   ossimFixedTileCache* newCache = new ossimFixedTileCache;
+   if(tileSize.x == 0 ||
+      tileSize.y == 0)
+   {
+      // newCache->setRect(tileBoundaryRect, theTileSize);
+      newCache->setRect(tileBoundaryRect,
+                        newCache->getTileSize());
+   }
+   else
+   {
+      newCache->setRect(tileBoundaryRect, tileSize);
+   }
+   result = theUniqueAppIdCounter;
+   theAppCacheMap.insert(std::make_pair(result, newCache));
+   ++theUniqueAppIdCounter;
+   
+   return result;
+}
+
+ossimAppFixedTileCache::ossimAppFixedCacheId ossimAppFixedTileCache::newTileCache()
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimAppFixedCacheId result = -1;
+   ossimFixedTileCache* newCache = new ossimFixedTileCache;
+   
+   {
+      result = theUniqueAppIdCounter;
+      theAppCacheMap.insert(std::make_pair(result, newCache));
+      ++theUniqueAppIdCounter;
+   }
+   
+   return result;
+   
+}
+
+void ossimAppFixedTileCache::setRect(ossimAppFixedCacheId cacheId,
+                                     const ossimIrect& boundaryTileRect)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimFixedTileCache* cache = getCache(cacheId);
+   if(cache)
+   {
+      
+      ossim_uint32 cacheSize = cache->getCacheSize();
+      // cache->setRect(boundaryTileRect, theTileSize);
+      cache->setRect(boundaryTileRect,
+                     cache->getTileSize());      
+      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
+   }
+}
+
+void ossimAppFixedTileCache::setTileSize(ossimAppFixedCacheId cacheId,
+                                         const ossimIpt& tileSize)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimFixedTileCache* cache = getCache(cacheId);
+   if(cache)
+   {
+      ossim_uint32 cacheSize = cache->getCacheSize();
+      cache->setRect(cache->getTileBoundaryRect(), tileSize);
+      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
+      theTileSize = cache->getTileSize();
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimAppFixedTileCache::getTile(
+   ossimAppFixedCacheId cacheId,
+   const ossimIpt& origin)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimRefPtr<ossimImageData> result = 0;
+   ossimFixedTileCache* cache = getCache(cacheId);
+   if(cache)
+   {
+      result = cache->getTile(origin);
+   }
+
+   return result;
+}
+
+
+ossimRefPtr<ossimImageData> ossimAppFixedTileCache::addTile(
+                                                            ossimAppFixedCacheId cacheId,
+                                                            ossimRefPtr<ossimImageData> data,
+                                                            bool duplicateData)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimRefPtr<ossimImageData> result = 0;
+   ossimFixedTileCache *aCache = this->getCache(cacheId);
+   if(!aCache)
+   {         
+      return result;
+   }
+   ossim_uint32 dataSize = data->getDataSizeInBytes();
+
+   if( (theCurrentCacheSize+dataSize) > theMaxGlobalCacheSize)
+   {
+      shrinkGlobalCacheSize((ossim_int32)(theMaxGlobalCacheSize*0.1));
+   }
+
+   ossim_uint32 cacheSize = 0;
+   {
+      cacheSize = aCache->getCacheSize();
+   }
+   if(cacheSize > theMaxCacheSize)
+   {
+//       shrinkCacheSize(aCache,
+//                       (ossim_int32)(aCache->getCacheSize()*.1));
+      shrinkCacheSize(aCache,
+                      (ossim_int32)(1024*1024));
+   }
+   {
+      cacheSize = aCache->getCacheSize();
+      result    = aCache->addTile(data, duplicateData);
+   
+      theCurrentCacheSize += (aCache->getCacheSize() - cacheSize);
+   }
+   
+   return result;
+}
+
+void ossimAppFixedTileCache::deleteAll()
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   theCurrentCacheSize = 0;
+   theAppCacheMap.clear();
+}
+
+ossimRefPtr<ossimImageData> ossimAppFixedTileCache::removeTile(
+   ossimAppFixedCacheId cacheId,
+   const ossimIpt& origin)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimRefPtr<ossimImageData> result = 0;
+   
+   ossimFixedTileCache* cache = getCache(cacheId);
+   if(cache)
+   {
+      ossim_uint32 cacheSize = cache->getCacheSize();
+      result = cache->removeTile(origin);
+      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
+   }
+
+   return result;
+}
+
+void ossimAppFixedTileCache::deleteTile(ossimAppFixedCacheId cacheId,
+                                        const ossimIpt& origin)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimFixedTileCache* cache = getCache(cacheId);
+   if(cache)
+   {
+      ossim_uint32 cacheSize = cache->getCacheSize();
+      cache->deleteTile(origin);
+      theCurrentCacheSize += (cache->getCacheSize() - cacheSize);
+   }
+}
+
+ossimFixedTileCache* ossimAppFixedTileCache::getCache(
+   ossimAppFixedCacheId cacheId)
+{   
+   std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::const_iterator
+      currentIter = theAppCacheMap.find(cacheId);
+   ossimFixedTileCache* result = 0;
+   
+   if(currentIter != theAppCacheMap.end())
+   {
+      result = (*currentIter).second;
+   }
+
+   return result;
+}
+
+void ossimAppFixedTileCache::shrinkGlobalCacheSize(ossim_int32 byteCount)
+{
+   if(static_cast<ossim_uint32>(byteCount) >= theCurrentCacheSize)
+   {
+      flush();
+   }
+   else
+   {
+      while(byteCount > 0)
+      {
+         std::map<ossimAppFixedCacheId, ossimFixedTileCache*>::iterator iter = theAppCacheMap.begin();
+         while( (iter != theAppCacheMap.end())&&(byteCount>0))
+         {
+            ossimFixedTileCache* cache = getCache((*iter).first);
+            if(cache)
+            {
+               ossim_uint32 before = cache->getCacheSize();
+               cache->deleteTile();
+               ossim_uint32 after = cache->getCacheSize();
+               ossim_uint32 delta = (before - after);
+               byteCount -= delta;
+               theCurrentCacheSize -= (delta);
+            }
+            ++iter;
+         }
+      }
+   }
+}
+
+void ossimAppFixedTileCache::shrinkCacheSize(ossimAppFixedCacheId id,
+                                             ossim_int32 byteCount)
+{
+   ossimFixedTileCache* cache = getCache(id);
+
+   if(cache)
+   {
+      shrinkCacheSize(cache, byteCount);
+   }
+}
+
+void ossimAppFixedTileCache::shrinkCacheSize(ossimFixedTileCache* cache,
+                                             ossim_int32 byteCount)
+{
+   if(cache)
+   {
+      ossim_int32 cacheSize = cache->getCacheSize();
+      if(cacheSize <= byteCount)
+      {
+         cache->flush();
+      }
+      else
+      {
+         while(byteCount > 0)
+         {
+            ossim_uint32 before = cache->getCacheSize();
+            cache->deleteTile();
+            ossim_uint32 after = cache->getCacheSize();
+            ossim_uint32 delta = std::abs((int)(before - after));
+            if(delta)
+            {
+               byteCount -= delta;
+               theCurrentCacheSize -= (delta);
+            }
+            else
+            {
+               byteCount = 0;
+            }
+         }
+      }
+   }
+}
+
+const ossimIpt& ossimAppFixedTileCache::getTileSize(ossimAppFixedCacheId cacheId)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+   ossimFixedTileCache* cache = getCache(cacheId);
+   if(cache)
+   {
+      return cache->getTileSize();
+   }
+   return theTileSize;
+}
diff --git a/src/imaging/ossimAppTileCache.cpp b/src/imaging/ossimAppTileCache.cpp
new file mode 100644
index 0000000..163da1c
--- /dev/null
+++ b/src/imaging/ossimAppTileCache.cpp
@@ -0,0 +1,302 @@
+//******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: This file contains the Application cache algorithm
+//
+//***********************************
+// $Id: ossimAppTileCache.cpp 15766 2009-10-20 12:37:09Z gpotts $
+
+#include <ossim/imaging/ossimAppTileCache.h>
+#include <ossim/imaging/ossimTileCache.h>
+#include <ossim/base/ossimDataObject.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+
+ossimAppTileCache* ossimAppTileCache::theInstance = 0;
+
+// we will need to grab this from the preferences
+const ossim_uint32 ossimAppTileCache::DEFAULT_SIZE          = 80*1024*1024;
+const ossim_uint32 ossimAppTileCache::DEFAULT_BUCKET_SIZE          = 293;
+ossimAppTileCache::ossimAppCacheId ossimAppTileCache::theUniqueAppIdCounter = 1;
+
+ossimAppTileCache *ossimAppTileCache::instance(ossim_uint32  maxSize)
+{
+   if(!theInstance)
+   {
+      if(maxSize < 1)
+      {
+         ossimString cacheSize = ossimPreferences::instance()->findPreference("cache_size");
+         if(cacheSize!="")
+         {
+            maxSize = cacheSize.toUInt32()*1024*1024;
+         }
+         else
+         {
+            maxSize = DEFAULT_SIZE;
+         }
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Setting SIZE----------------------- " << maxSize << std::endl;
+      }
+      theInstance = new ossimAppTileCache(maxSize);
+   }
+
+   return theInstance;
+}
+
+ossimAppTileCache::~ossimAppTileCache()
+{
+   deleteAll();
+}
+
+ossimAppTileCache::ossimAppCacheId ossimAppTileCache::newTileCache(ossim_uint32 bucketSize)
+{
+   ossimTileCache *aCache = 0;
+   ossimAppCacheId result = 0;
+
+   aCache = new ossimTileCache(bucketSize);
+
+   if(aCache)
+   {
+      theAppCache.insert(make_pair(theUniqueAppIdCounter, aCache));
+      result = theUniqueAppIdCounter;
+      ++theUniqueAppIdCounter;
+   }
+
+   return result;
+}
+
+/*!
+ * Will retrieve a tile from the cache.
+ */
+ossimDataObject *ossimAppTileCache::get(ossimAppCacheId id,
+                                        const ossimDpt3d &origin,
+                                        ossim_uint32 resLevel)
+{
+   ossimDataObject* result = 0;
+   if(id>0)
+   {
+      ossimTileCache *aCache = this->get(id);
+      if(aCache)
+      {
+         result = aCache->get(origin,
+                              resLevel);
+         if(result)
+         {
+            adjustQueue(id, origin, resLevel);
+         }
+      }
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimDataObject> ossimAppTileCache::removeTile(ossimAppCacheId id,
+                                              const ossimDpt3d &origin,
+                                              unsigned long resLevel)
+{
+   ossimRefPtr<ossimDataObject> result = 0;
+   if(id>0)
+   {
+      ossimTileCache *aCache = this->get(id);
+      if(aCache)
+      {
+         // remove from cache
+         result = aCache->remove(origin,
+                                 resLevel);
+         // adjust the byte count
+         if(result.valid())
+         {
+            theCurrentCacheSize -= result->getDataSizeInBytes();
+         }
+         removeTileFromQueue(id, origin, resLevel);
+      }
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimDataObject> ossimAppTileCache::insert(ossimAppCacheId appId,
+                                                       const ossimDpt3d &origin,
+                                                       const ossimDataObject* data,
+                                                       ossim_uint32 resLevel)
+{
+   static const char MODULE[] = "ossimAppTileCache::insert";
+   ossimDataObject *result = 0;
+
+   // find the cache and if it's not there then return NULL
+   ossimTileCache *aCache = this->get(appId);
+   if(!aCache)
+   {         
+      return result;
+   }
+   
+   ossimRefPtr<ossimDataObject> tileToInsert = 0;
+   long dataSize = data->getDataSizeInBytes();
+   
+   if( (theCurrentCacheSize+dataSize) > theMaxCacheSize)
+   {
+      do
+      {
+         ossimRefPtr<ossimDataObject> tile = removeTile();
+      }while((theCurrentCacheSize+dataSize) > theMaxCacheSize);
+   }
+
+   if(data)
+   {
+      tileToInsert = (ossimDataObject*)data->dup();
+
+      result = aCache->insert(origin,
+                              tileToInsert.get(),
+                              resLevel);
+      if(!result)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR: can't insert and should not happen"
+            << endl;
+
+         tileToInsert = 0;
+      }
+      else
+      {
+         theCurrentCacheSize += dataSize;
+         theUsedQueue.push_back(ossimAppCacheTileInfo(appId,
+                                                 origin,
+                                                 resLevel));
+      }
+   }
+
+   return result;
+}
+
+
+ossimTileCache* ossimAppTileCache::get(ossimAppCacheId id)
+{
+   ossimTileCache *result=0;
+   
+   AppIdIterator anIterator = theAppCache.find(id);
+   
+   if(anIterator != theAppCache.end())
+   {
+      result = (*anIterator).second;
+   }
+
+   return result;
+}
+
+void ossimAppTileCache::deleteCache(ossimAppCacheId appId)
+{
+   // first delete the cache
+   AppIdIterator anIterator = theAppCache.find(appId);
+   if(anIterator != theAppCache.end())
+   {
+      ossimTileCache *aCache = (*anIterator).second;
+      theCurrentCacheSize -= aCache->sizeInBytes();
+
+      delete aCache;
+
+      theAppCache.erase(anIterator);      
+   }
+   // now delete all occurences of the appCacheId in the queue
+   // used for LRU algorithm.
+   deleteAppCacheFromQueue(appId);
+}
+
+void ossimAppTileCache::deleteAll()
+{
+   AppIdIterator iter = theAppCache.begin();
+
+   while(iter != theAppCache.end())
+   {
+      delete (*iter).second;
+      ++iter;
+   }
+   
+   theAppCache.clear();
+}
+
+void ossimAppTileCache::removeTileFromQueue(ossimAppCacheId appId,
+                                       const ossimDpt3d &origin,
+                                       ossim_uint32 resLevel)
+{
+   list<ossimAppCacheTileInfo>::iterator anIterator;
+
+   anIterator = theUsedQueue.begin();
+   while(anIterator != theUsedQueue.end())
+   {
+      if( ((*anIterator).theAppCacheId == appId) &&
+          ((*anIterator).theOrigin     == origin)&&
+          ((*anIterator).theResLevel   == resLevel))
+      {
+         theUsedQueue.erase(anIterator);
+         return;
+      }
+      else
+      {
+         ++anIterator;
+      }
+   }
+}
+
+void ossimAppTileCache::deleteAppCacheFromQueue(ossimAppCacheId appId)
+{
+   list<ossimAppCacheTileInfo>::iterator anIterator;
+
+   anIterator = theUsedQueue.begin();
+   while(anIterator != theUsedQueue.end())
+   {
+      if( (*anIterator).theAppCacheId == appId)
+      {
+         anIterator = theUsedQueue.erase(anIterator);
+      }
+      else
+      {
+         ++anIterator;
+      }
+   }
+}
+
+ossimRefPtr<ossimDataObject> ossimAppTileCache::removeTile()
+{
+   ossimRefPtr<ossimDataObject> result;
+   if(!theUsedQueue.empty())
+   {
+      ossimAppCacheTileInfo &info = *(theUsedQueue.begin());
+
+      ossimTileCache *aCache = get(info.theAppCacheId);
+      if(aCache)
+      {
+         result            = aCache->remove(info.theOrigin,
+                                            info.theResLevel);
+         theCurrentCacheSize -= result->getDataSizeInBytes();
+      }
+      theUsedQueue.erase(theUsedQueue.begin());
+   }
+
+   return result;
+}
+
+void ossimAppTileCache::adjustQueue(ossimAppCacheId id,
+                                    const ossimDpt3d &origin,
+                                    ossim_uint32 resLevel)
+{
+   list<ossimAppCacheTileInfo>::iterator anIterator = theUsedQueue.begin();
+   ossimAppCacheTileInfo info(id, origin, resLevel);
+   
+   while(anIterator != theUsedQueue.end())
+   {
+     
+      if((*anIterator) == info)
+      {
+         theUsedQueue.erase(anIterator);
+         theUsedQueue.push_back(info);
+         return;
+      }
+      ++anIterator;
+   }              
+}
diff --git a/src/imaging/ossimArcInfoGridWriter.cpp b/src/imaging/ossimArcInfoGridWriter.cpp
new file mode 100644
index 0000000..e1b58de
--- /dev/null
+++ b/src/imaging/ossimArcInfoGridWriter.cpp
@@ -0,0 +1,374 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimArcInfoGridWriter.cpp 16081 2009-12-10 20:56:36Z eshirschorn $
+
+#include <cstring>
+#include <cstdio>
+#include <fstream>
+#include <iostream>
+
+#include <ossim/imaging/ossimArcInfoGridWriter.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+
+#include <ossim/support_data/ossimAigStatistics.h>
+#include <ossim/support_data/ossimAigHeader.h>
+#include <ossim/support_data/ossimAigBounds.h>
+#include <ossim/support_data/ossimAigIndexFileHeader.h>
+#include <ossim/support_data/ossimAigDataFileHeader.h>
+
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+
+static const ossimTrace traceDebug("ossimArcInfoGridWriter:debug");
+
+RTTI_DEF1(ossimArcInfoGridWriter,
+          "ossimArcInfoGridWriter",
+          ossimImageFileWriter);
+
+//*******************************************************************
+// Constructor:
+//*******************************************************************
+ossimArcInfoGridWriter::ossimArcInfoGridWriter()
+   : ossimImageFileWriter(),
+     theOutputTileSize(256, 4)
+{
+}
+
+ossimArcInfoGridWriter::ossimArcInfoGridWriter(ossimImageSource* inputSource,
+                                 const ossimFilename& filename)
+   :ossimImageFileWriter(filename, inputSource)
+{
+}
+
+//*******************************************************************
+// Destructor
+//*******************************************************************
+ossimArcInfoGridWriter::~ossimArcInfoGridWriter()
+{
+   close();
+}
+
+bool ossimArcInfoGridWriter::writeFile()
+{
+   const char* MODULE = "ossimArcInfoGridWriter::writeFile";
+   if(!theInputConnection)
+   {
+      return false;
+   }
+   
+   ossimRefPtr<ossimCastTileSourceFilter> filter = new ossimCastTileSourceFilter;
+   filter->setOutputScalarType(OSSIM_FLOAT);
+   filter->connectMyInputTo(theInputConnection.get());
+   filter->initialize();
+   
+   open();
+
+   // make sure we have a region of interest
+   if(theAreaOfInterest.hasNans())
+   {
+      theInputConnection->initialize();
+      theAreaOfInterest = theInputConnection->getAreaOfInterest();
+   }
+   else
+   {
+      theInputConnection->setAreaOfInterest(theAreaOfInterest);
+   }
+   
+   if(theAreaOfInterest.hasNans()) return false;   
+   
+   theInputConnection->setTileSize(theOutputTileSize);
+   theInputConnection->setToStartOfSequence();
+   
+   bool result = writeBinaryAigHeader()&&
+                 writeBinaryAigBounds()&&
+                 writeBinaryAigStats();
+   if(result)
+   {
+      ossimFilename indexFile=ossimFilename(theFilename+"/"+"w001001x.adf");
+      ossimFilename dataFile=ossimFilename(theFilename+"/"+"w001001.adf");
+      
+      std::ofstream indexFileStream(indexFile.c_str(),
+                               ios::out|ios::binary);
+      std::ofstream dataFileStream(dataFile.c_str(),
+                              ios::out|ios::binary);
+      ossimEndian endian;
+
+      if(indexFileStream&&dataFileStream)
+      {
+         ossimAigIndexFileHeader aigIndexHeader;
+         ossimAigDataFileHeader  aigDataFileHeader;
+         
+         ossimRefPtr<ossimImageData> currentTile =
+            theInputConnection->getNextTile();
+         long tileNumber = 0;
+         long totalNumberOfTiles = theInputConnection->getNumberOfTiles();
+         ossim_int32 tileOffsetShorts = 0;
+         ossim_int32 tileSizeShorts   = 0;
+
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Tile height  = " << theInputConnection->getTileHeight()
+            << std::endl
+            << "Tile width   = " << theInputConnection->getTileWidth()
+            << std::endl;
+         ossim_int32 tileSizeInShorts = 2*(theInputConnection->getTileHeight()*
+                                           theInputConnection->getTileWidth());
+         // Note: this is in shorts
+         //
+         aigIndexHeader.theFileSize += (4*totalNumberOfTiles);
+
+         // Note this is in shorts
+         //
+         
+         aigDataFileHeader.theFileSize = 50+
+                                         (tileSizeInShorts*totalNumberOfTiles) +
+                                         totalNumberOfTiles;
+         aigDataFileHeader.theTileSize = tileSizeInShorts;
+         
+         aigIndexHeader.writeStream(indexFileStream);
+         aigDataFileHeader.writeStream(dataFileStream);
+
+         if(traceDebug())
+         {
+            CLOG << "AIG INDEX HEADER = \n" << aigIndexHeader << std::endl;
+            CLOG << "AIG DATA FILE HEADER\n"
+                 << "file size = " << aigDataFileHeader.theFileSize
+                 << std::endl;
+         }
+         
+         while(currentTile.valid())
+         {
+            currentTile = filter->applyCast(currentTile);
+            
+            if(!currentTile->getBuf())
+            {
+               currentTile->initialize();
+            }
+
+            tileOffsetShorts = dataFileStream.tellp()/2;
+            tileSizeShorts   = 2*currentTile->getHeight()*currentTile->getWidth();
+            ossim_int16 tileSizeShorts16 = 2*currentTile->getHeight()*currentTile->getWidth();
+            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+            {
+               endian.swap(tileOffsetShorts);
+               endian.swap(tileSizeShorts);
+               endian.swap(tileSizeShorts16);
+               endian.swap((ossim_float32*)currentTile->getBuf(),
+                           currentTile->getWidth()*
+                           currentTile->getHeight());
+            }
+            
+            indexFileStream.write((char*)(&tileOffsetShorts), 4);
+            indexFileStream.write((char*)(&tileSizeShorts), 4);
+            dataFileStream.write((char*)(&tileSizeShorts16),
+                                 2);
+            dataFileStream.write((char*)(currentTile->getBuf()),
+                                 currentTile->getWidth()*currentTile->getHeight()*4);
+            
+            currentTile = theInputConnection->getNextTile();
+            ++tileNumber;
+         }
+      }
+   }
+   
+   close();
+   filter = 0;
+   return result;
+}
+
+bool ossimArcInfoGridWriter::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   return ossimImageFileWriter::saveState(kwl, prefix);
+}
+
+bool ossimArcInfoGridWriter::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   
+   return ossimImageFileWriter::loadState(kwl, prefix);
+}
+
+bool ossimArcInfoGridWriter::isOpen()const
+{
+   return (theFilename.isDir() && theFilename.exists());
+}
+
+bool ossimArcInfoGridWriter::open()
+{
+   if(theFilename.isDir()&&
+      theFilename.exists())
+   {
+      return true;
+   }
+   else
+   {
+      theFilename = theFilename.path();
+      if(theFilename.isDir()&&
+         theFilename.exists())
+      {
+         return true;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimArcInfoGridWriter::open(): Directory "
+            << theFilename << " doesn't exist" << std::endl;
+      }
+      
+   }
+   return false;   
+}
+
+void ossimArcInfoGridWriter::close()
+{
+}
+
+
+bool ossimArcInfoGridWriter::writeBinaryAigHeader()
+{
+   const char* MODULE = "ossimArcInfoGridWriter::writeBinaryAigHeader";
+   ossimAigHeader aigHeader;
+
+   ossimFilename file=ossimFilename(theFilename+"/"+"hdr.adf");
+
+   if(isOpen())
+   {
+      switch(theInputConnection->getOutputScalarType())
+      {
+         case OSSIM_UCHAR:
+         case OSSIM_SSHORT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         case OSSIM_USHORT16:
+//      {
+//         aigHeader.setIntCoverage();
+//         break;
+//      }
+         case OSSIM_DOUBLE:
+         case OSSIM_FLOAT:
+         case OSSIM_NORMALIZED_FLOAT:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            aigHeader.setFloatCoverage();
+            break;
+         }
+         default:
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimArcInfoGridWriter::writeBinaryAigHeader: "
+               << "unknown scalar type" << std::endl;
+         }
+      }
+      
+      // need to set pixel size
+      //
+
+      // code goes here
+      
+      // now setting number of tiles per row
+      aigHeader.theNumberOfTilesPerRow    = theInputConnection->getNumberOfTilesHorizontal();
+      aigHeader.theNumberOfTilesPerColumn = theInputConnection->getNumberOfTilesVertical();
+      aigHeader.theWidthOfTileInPixels    = theInputConnection->getTileWidth();
+      aigHeader.theHeightOfTileInPixels   = theInputConnection->getTileHeight();
+      
+      std::ofstream out;
+      out.open(file.c_str(), ios::out|ios::binary);
+
+      if(out)
+      {
+         if(traceDebug())
+         {
+            CLOG << "AIG_HEADER = \n" << aigHeader << std::endl;
+         }
+         return aigHeader.writeStream(out);
+      }
+   }
+   
+   return false;
+}
+
+bool ossimArcInfoGridWriter::writeBinaryAigBounds()
+{
+   const char* MODULE = "ossimArcInfoGridWriter::writeBinaryAigBounds";
+   ossimAigBounds aigBounds;
+   
+
+   // setup bounds
+   ossimIrect bounds = theInputConnection->getBoundingRect();
+   if(!bounds.hasNans())
+   {
+      aigBounds.ll_x = -.5;
+      aigBounds.ll_y = -.5;
+      aigBounds.ur_x = bounds.width()-.5;
+      aigBounds.ur_y = bounds.height()-.5;
+      
+      //
+      ossimFilename file=ossimFilename(theFilename+"/"+"dblbnd.adf");
+      
+      if(isOpen())
+      {
+         std::ofstream out;
+         out.open(file.c_str(), ios::out|ios::binary);
+         
+         if(out)
+         {
+            if(traceDebug())
+            {
+               CLOG << "AIG BOUNDS =\n" <<aigBounds << std::endl;
+            }
+            return aigBounds.writeStream(out);
+         }
+      }
+   }
+   
+   return false;
+}
+
+bool ossimArcInfoGridWriter::writeBinaryAigStats()
+{
+   ossimAigStatistics aigStats;
+
+
+   // setup bounds
+   aigStats.theMin  = theInputConnection->getMinPixelValue();
+   aigStats.theMax  = theInputConnection->getMaxPixelValue();
+   aigStats.theMean = (aigStats.theMax-aigStats.theMin)/2.0;
+
+   //
+   ossimFilename file=ossimFilename(theFilename+"/"+"sta.adf");
+
+   if(isOpen())
+   {
+      std::ofstream out;
+      out.open(file.c_str(), ios::out|ios::binary);
+      
+      if(out)
+      {
+         return aigStats.writeStream(out);
+      }
+   }
+
+   return false;
+}
+
+ossimString ossimArcInfoGridWriter::getExtension() const
+{
+   return ossimString("aig");
+}
diff --git a/ossim/src/ossim/imaging/ossimAtCorrGridRemapper.cpp b/src/imaging/ossimAtCorrGridRemapper.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAtCorrGridRemapper.cpp
rename to src/imaging/ossimAtCorrGridRemapper.cpp
diff --git a/src/imaging/ossimAtCorrRemapper.cpp b/src/imaging/ossimAtCorrRemapper.cpp
new file mode 100644
index 0000000..ff11f62
--- /dev/null
+++ b/src/imaging/ossimAtCorrRemapper.cpp
@@ -0,0 +1,730 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kathy Minear
+//
+// Description:
+// Takes in DNs for any number of bands
+// Converts DNs to Radiance at the satellite values Lsat
+// Converts Lsat to Surface Reflectance values
+//
+//*************************************************************************
+// $Id: ossimAtCorrRemapper.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <cstdlib>
+#include <cmath>
+
+#include <ossim/imaging/ossimAtCorrRemapper.h>
+#include <ossim/imaging/ossimAtCorrKeywords.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+
+RTTI_DEF1(ossimAtCorrRemapper, "ossimAtCorrRemapper", ossimImageSourceFilter);
+
+static ossimTrace traceDebug("ossimAtCorrRemapper:debug");
+
+ossimAtCorrRemapper::ossimAtCorrRemapper(ossimObject* owner,
+                                         ossimImageSource* inputSource,
+                                         const ossimString& sensorType)
+      :
+      ossimImageSourceFilter  (owner, inputSource),  // base class     
+      theTile                 (NULL),
+      theSurfaceReflectance   (NULL),
+      theUseInterpolationFlag(false),
+      theMinPixelValue        (0),  
+      theMaxPixelValue        (0),
+      theXaArray              (0),
+      theXbArray              (0),
+      theXcArray              (0),
+      theBiasArray            (0),
+      theGainArray            (0),
+      theCalCoefArray         (0),
+      theBandWidthArray       (0),
+      theSensorType(sensorType)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   disableSource();
+
+   initialize();
+}
+
+ossimAtCorrRemapper::~ossimAtCorrRemapper()
+{
+   if (theSurfaceReflectance)
+   {
+      delete [] theSurfaceReflectance;
+      theSurfaceReflectance = NULL;
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimAtCorrRemapper::getTile(
+   const ossimIrect& tile_rect,
+   ossim_uint32 resLevel)
+{
+#if 0
+   if (traceDebug())
+   {
+      cout << "ossimAtCorrRemapper::getTile DEBUG:"
+           << "\ntile_rect:  " << tile_rect << endl;
+   }
+#endif
+   
+   if (!isInitialized()||!theInputConnection)
+   {
+       cerr << "ossimAtCorrRemapper::getTile ERROR:"
+            << "\nNot initialized!"
+            << endl;
+       return ossimRefPtr<ossimImageData>();
+   }
+
+   if(!theTile.valid())
+   {
+      initialize();
+      if(!theTile)
+      {
+         return ossimRefPtr<ossimImageData>();
+      }
+   }
+   
+   // Fetch tile from pointer from the input source.
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tile_rect,
+                                                                       resLevel);
+
+   if (!inputTile.valid())  // Just in case...
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   // Check for remap bypass or empty / null input tile.
+   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
+   if (!theEnableFlag || tile_status == OSSIM_NULL ||
+       tile_status == OSSIM_EMPTY)
+   {
+      return inputTile;
+   }
+
+   ossim_uint32 w     = tile_rect.width();
+   ossim_uint32 h     = tile_rect.height();
+   ossim_uint32 tw    = theTile->getWidth();
+   ossim_uint32 th    = theTile->getHeight();
+   ossim_uint32 bands = theTile->getNumberOfBands();
+
+   // Set the origin of the output tile.
+   theTile->setOrigin(tile_rect.ul());
+
+   if(w*h != tw*th)
+   {
+      theTile->setWidthHeight(w, h);
+      theTile->initialize();
+      if(theSurfaceReflectance)
+      {
+         delete [] theSurfaceReflectance;
+         theSurfaceReflectance = NULL;
+      }
+   }
+   
+   if(!theSurfaceReflectance)
+   {
+      ossim_uint32 size  = tw*th*bands;
+#if 0
+      if (traceDebug())
+      {
+         cout << "ossimAtCorrRemapper::getTile DEBUG:"
+              << "\ntile_rect:    " << tile_rect
+              << "\ntile width:   " << tw
+              << "\ntile height:  " << th
+              << "\nbands:        " << bands
+              << "\nBuffer size:  " << size << endl;
+      }
+#endif
+      
+      theSurfaceReflectance = new double[size];
+   }
+
+   ossim_uint32 buffer_index = 0;
+   ossimIpt ul = tile_rect.ul();
+   ossimIpt lr = tile_rect.lr();
+   const double MP = theTile->getMinNormalizedPix(); // Minimum normalized pix.
+   double a, b, c;
+   buffer_index = 0;
+
+   cout << setprecision(6);
+   for (ossim_uint32 band=0; band < bands; ++band)
+   {
+      for(ossim_sint32 idxy = ul.y; idxy <= lr.y; ++idxy)
+      {
+         for(ossim_sint32 idxx = ul.x; idxx <= lr.x; ++idxx)
+         {
+            double p = inputTile->getPix(buffer_index);
+            
+            if (p>0.0)
+            {
+               if(!theUseInterpolationFlag)
+               {
+                  a = theXaArray[band];
+                  b = theXbArray[band];
+                  c = theXcArray[band];
+               }
+               else
+               {
+                  interpolate(ossimDpt(idxx, idxy),
+                              band,
+                              a,
+                              b,
+                              c);
+               }
+               if(theSensorType == "ls7ms")
+               {
+                  double radiance_at_satellite
+                     = (theGainArray[band] * p) + theBiasArray[band];
+                  
+                  double y =  (radiance_at_satellite * a) -  b;
+                  
+                  p = (y / (1.0 + (c * y)) );
+               }
+               else if(theSensorType == "qbms")
+               {
+                  double radiance_at_satellite
+                     = theCalCoefArray[band] * p / theBandWidthArray[band];
+                  
+                  double y =  (radiance_at_satellite * a) - b;
+                  
+                  p = (y / (1.0 + (c * y)) );
+               }
+               else if(theSensorType == "ikms")
+               {
+                  
+                 
+                  double radiance_at_satellite
+                     =   p  /((theCalCoefArray[band]/1.0)/ theBandWidthArray[band]);
+                  double y =  (radiance_at_satellite * a) -  b;
+    
+                  p = (y / (1.0 + (c * y)) );
+     
+               }  
+                   
+               // Note that "p" should now be normalized between 0.0 and 1.0;
+               
+               // ***
+               // Since it wasn't null to start with clip / clamp between minimum
+               // normalized pixel and one(max).
+               // ***
+               p =  ( p > MP ? ( p < 1.0 ? p : 1.0) : MP );
+               
+               // Scan the new tile and set the min / max.
+               if (p < theMinPixelValue[band])
+               {
+                  theMinPixelValue[band] = p;
+               }
+               else if (p > theMaxPixelValue[band])
+               {
+                  theMaxPixelValue[band] = p;
+               }
+               
+               theSurfaceReflectance[buffer_index] = p;
+            }
+            else
+            {
+               theSurfaceReflectance[buffer_index] = 0.0;  // pixel was null...
+            }
+            
+            ++buffer_index;
+            
+         }  // End of sample loop...
+         
+      } // End of line loop...
+      
+   } // End of band loop...
+
+   // Copy the buffer to the output tile at the same time unnormalizing it.
+   theTile->copyNormalizedBufferToTile(theSurfaceReflectance);
+   
+   // Validate the output to set the tile status.
+   theTile->validate();
+   
+   return theTile;
+}
+
+void ossimAtCorrRemapper::initialize()
+{
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,
+                                                          theInputConnection);
+      theTile->initialize();
+
+      if(theSurfaceReflectance)
+      {
+         delete []theSurfaceReflectance;
+         theSurfaceReflectance = NULL;
+      }
+      
+      ossim_uint32 tw    = theTile->getWidth();
+      ossim_uint32 th    = theTile->getHeight();
+      ossim_uint32 bands = theTile->getNumberOfBands();
+      ossim_uint32 size  = tw*th*bands;
+      if (traceDebug())
+      {
+         cout << "ossimAtCorrRemapper::initialize DEBUG:"
+              << "\ntile width:   " << tw
+              << "\ntile height:  " << th
+              << "\nbands:        " << bands
+              << "\nBuffer size:  " << size << endl;
+      }
+      
+      theSurfaceReflectance = new double[size];
+
+      setInitializedFlag(true);
+      clearErrorStatus();
+   }
+   else
+   {
+      setInitializedFlag(false);
+      setErrorStatus();
+   };
+
+   verifyEnabled();
+
+   if (traceDebug())
+   {
+      cout << "ossimAtCorrRemapper::initialize DEBUG:"
+           << *this
+           << endl;
+   }
+
+}
+
+bool ossimAtCorrRemapper::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   static const char MODULE[] = "ossimAtCorrRemapper::loadState()";
+
+   if (traceDebug())  CLOG << "entering..." << endl;
+
+   if (!theTile || !theSurfaceReflectance)
+   {
+      cerr << MODULE << " ERROR:"
+           << "Not initialized..." << endl;
+      return false;
+   }
+
+   ossim_uint32 bands = theTile->getNumberOfBands();
+
+   // Clear out the old values.
+   theMinPixelValue.clear();
+   theMaxPixelValue.clear();   
+   theXaArray.clear();
+   theXbArray.clear();
+   theXcArray.clear();
+   theBiasArray.clear();
+   theGainArray.clear();
+   theCalCoefArray.clear();
+   theBandWidthArray.clear();
+ 
+   
+   // Now resize them.
+
+   // Start with arbitrary big number.
+   theMinPixelValue.resize(bands, 1.0);
+
+   // Start with arbitrary small number.
+   theMaxPixelValue.resize(bands, 0.0);
+
+   
+   theXaArray.resize(bands, 1.0);
+   theXbArray.resize(bands, 1.0);
+   theXcArray.resize(bands, 1.0);
+   
+   theBiasArray.resize(bands, 0.0);
+   theGainArray.resize(bands, 1.0);
+   theCalCoefArray.resize(bands);
+   theBandWidthArray.resize(bands);
+   
+   for(ossim_uint32 band = 0; band < bands; ++band)
+   {
+      const char* lookup = NULL;
+      ossimString band_string = ".band";
+      band_string += ossimString::toString(band+1);
+      
+      ossimString kw = AT_CORR_XA_KW;
+      kw += band_string;
+      lookup = kwl.find(prefix, kw.c_str());
+      if (lookup)
+      {
+         theXaArray[band] = atof(lookup);
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            CLOG << "DEBUG:"
+                 << "\nlookup failed for keyword:  " << kw.c_str() << endl;
+         }
+      }
+      
+      kw = AT_CORR_XB_KW;
+      kw += band_string;
+      lookup = kwl.find(prefix, kw.c_str());
+      if (lookup)
+      {
+         theXbArray[band] = atof(lookup);
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            CLOG << "DEBUG:"
+                 << "\nlookup failed for keyword:  " << kw.c_str()
+                 << endl;
+         }
+      }
+      
+      kw = AT_CORR_XC_KW;
+      kw += band_string;
+      lookup = kwl.find(prefix, kw.c_str());
+      if (lookup)
+      {
+         theXcArray[band] = atof(lookup);
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            CLOG << "DEBUG:"
+                 << "\nlookup failed for keyword:  " << kw.c_str()
+                 << endl;
+         }
+      }
+      
+      if(theSensorType == "ls7ms")
+      {
+         kw = AT_CORR_BIAS_KW;
+         kw += band_string;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            theBiasArray[band] = atof(lookup);
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               CLOG << "DEBUG:"
+                    << "\nlookup failed for keyword:  " << kw.c_str()
+                    << endl;
+            }
+         }
+         
+         kw = AT_CORR_GAIN_KW;
+         kw += band_string;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            theGainArray[band] = atof(lookup);
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               CLOG << "DEBUG:"
+                    << "\nlookup failed for keyword:  " << kw.c_str()
+                    << endl;
+            }
+         }
+      }
+      
+      if(theSensorType == "qbms")
+      {
+         kw = AT_CORR_CALCOEF_KW;
+         kw += band_string;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            theCalCoefArray[band] = atof(lookup);
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               CLOG << "DEBUG:"
+                    << "\nlookup failed for keyword:  " << kw.c_str()
+                    << endl;
+            }
+         }
+         
+         kw = AT_CORR_BANDWIDTH_KW;
+         kw += band_string;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            theBandWidthArray[band] = atof(lookup);
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               CLOG << "DEBUG:"
+                    << "\nlookup failed for keyword:  " << kw.c_str()
+                    << endl;
+            }
+         }
+      }
+      if(theSensorType == "ikms")
+      {
+         kw = AT_CORR_CALCOEF_KW;
+         kw += band_string;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            theCalCoefArray[band] = atof(lookup);
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               CLOG << "DEBUG:"
+                    << "\nlookup failed for keyword:  " << kw.c_str()
+                    << endl;
+            }
+         }
+         
+         kw = AT_CORR_BANDWIDTH_KW;
+         kw += band_string;
+         lookup = kwl.find(prefix, kw.c_str());
+         if (lookup)
+         {
+            theBandWidthArray[band] = atof(lookup);
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               CLOG << "DEBUG:"
+                    << "\nlookup failed for keyword:  " << kw.c_str()
+                    << endl;
+            }
+         }
+      }
+   }
+   
+   verifyEnabled();
+
+   if (theEnableFlag)
+   {
+      //***
+      // Call the base class to pick up the enable flag.  Note that this
+      // can override the state set from verifyEnabled() method.
+      //***
+      ossimString pref;
+      if (prefix) pref += prefix;
+      pref += "atmospheric_correction.";
+
+   }
+   
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << *this
+           << "returning..."
+           << endl;
+   }
+   
+   return true;
+}
+
+void ossimAtCorrRemapper::verifyEnabled()
+{
+   // Check all the pointers...
+   if ( !theInputConnection    || !theTile ||
+        !theSurfaceReflectance )
+   {
+      disableSource();
+      return;
+   }
+
+   ossim_uint32 bands = theTile->getNumberOfBands();
+   if ( (theMinPixelValue.size() != bands) ||
+        (theMaxPixelValue.size() != bands) ||
+        (theXaArray.size()       != bands) ||
+        (theXbArray.size()       != bands) ||
+        (theXcArray.size()       != bands) ||
+        (theBiasArray.size()     != bands) ||
+        (theGainArray.size()     != bands) ||
+        (theCalCoefArray.size()  != bands) ||
+        (theBandWidthArray.size()!= bands))
+   {
+      disableSource(); 
+      return;
+   }
+
+   enableSource();
+}
+
+ossimString ossimAtCorrRemapper::getShortName() const
+{
+   return ossimString("Atmospheric Correction Remapper");
+}
+
+vector<double> ossimAtCorrRemapper::getNormMinPixelValues() const
+{
+   return theMinPixelValue;
+}
+
+vector<double> ossimAtCorrRemapper::getNormMaxPixelValues() const
+{
+   return theMaxPixelValue;
+}
+
+void ossimAtCorrRemapper::getNormMinPixelValues(vector<double>& v) const
+{
+   v = theMinPixelValue;
+}
+
+void ossimAtCorrRemapper::getNormMaxPixelValues(vector<double>& v) const
+{
+   v = theMaxPixelValue;
+}
+
+const ossimString& ossimAtCorrRemapper::getSensorType() const
+{
+   return theSensorType;
+}
+
+void ossimAtCorrRemapper::setSensorType(const ossimString& sensorType)
+{
+   theSensorType = sensorType;
+}
+
+void ossimAtCorrRemapper::interpolate(const ossimDpt& /* pt */,
+                                      int band,
+                                      double& a,
+                                      double& b,
+                                      double& c)const
+{
+   a = theXaArray[band];
+   b = theXbArray[band];
+   c = theXcArray[band];
+}
+
+ostream& ossimAtCorrRemapper::print(ostream& os) const
+{
+   os << "ossimAtCorrRemapper:"
+      << "\ntheEnableFlag:  " << (theEnableFlag?"enabled":"disabled")
+      << endl;
+
+   os << setprecision(15) << setiosflags(ios::fixed);
+
+   ossim_uint32 band = 1;
+   vector<double>::const_iterator i = theMinPixelValue.begin();
+   while (i != theMinPixelValue.end())
+   {
+      os << "band[" << band << "] min:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+
+   band = 1;
+   i = theMaxPixelValue.begin();
+   while (i != theMaxPixelValue.end())
+   {
+      os << "band[" << band << "] max:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+
+   band = 1;
+   i = theXaArray.begin();
+   while (i != theXaArray.end())
+   {
+      os << "band[" << band << "] xa:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+
+   band = 1;
+   i = theXbArray.begin();
+   while (i != theXbArray.end())
+   {
+      os << "band[" << band << "] xb:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+
+   band = 1;
+   i = theXcArray.begin();
+   while (i != theXcArray.end())
+   {
+      os << "band[" << band << "] xc:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+
+   if(theSensorType == "ls7ms")
+   {
+      band = 1;
+      i = theBiasArray.begin();
+      while (i != theBiasArray.end())
+      {
+         os << "band[" << band << "] bias:  " << (*i) << endl;
+         ++i;
+         ++band;
+      }
+      
+      band = 1;
+      i = theGainArray.begin();
+      while (i != theGainArray.end())
+      {
+         os << "band[" << band << "] gain:  " << (*i) << endl;
+         ++i;
+         ++band;
+      }
+   }
+   if(theSensorType == "qbms")
+   {
+      band = 1;
+      i = theCalCoefArray.begin();
+      while (i != theCalCoefArray.end())
+      {
+         os << "band[" << band << "] calcoef:  " << (*i) << endl;
+         ++i;
+         ++band;
+      }
+
+      band = 1;
+      i = theBandWidthArray.begin();
+      while (i != theBandWidthArray.end())
+      {
+         os << "band[" << band << "] bandwidth:  " << (*i) << endl;
+         ++i;
+         ++band;
+      }
+   }
+   if(theSensorType == "ikms")
+   {
+      band = 1;
+      i = theCalCoefArray.begin();
+      while (i != theCalCoefArray.end())
+      {
+         os << "band[" << band << "] calcoef:  " << (*i) << endl;
+         ++i;
+         ++band;
+      }
+
+   }
+   return os;
+}
+
+ostream& operator<<(ostream& os, const ossimAtCorrRemapper& hr)
+{
+   return hr.print(os);
+}
+
+
diff --git a/ossim/src/ossim/imaging/ossimAtbController.cpp b/src/imaging/ossimAtbController.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAtbController.cpp
rename to src/imaging/ossimAtbController.cpp
diff --git a/ossim/src/ossim/imaging/ossimAtbMatchPoint.cpp b/src/imaging/ossimAtbMatchPoint.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAtbMatchPoint.cpp
rename to src/imaging/ossimAtbMatchPoint.cpp
diff --git a/ossim/src/ossim/imaging/ossimAtbPointSource.cpp b/src/imaging/ossimAtbPointSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimAtbPointSource.cpp
rename to src/imaging/ossimAtbPointSource.cpp
diff --git a/src/imaging/ossimBandAverageFilter.cpp b/src/imaging/ossimBandAverageFilter.cpp
new file mode 100644
index 0000000..2af2151
--- /dev/null
+++ b/src/imaging/ossimBandAverageFilter.cpp
@@ -0,0 +1,398 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBandAverageFilter.cpp 17206 2010-04-25 23:20:40Z dburken $
+#include <ossim/imaging/ossimBandAverageFilter.h>
+
+// used for constructing and an ossimImageData object
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+// used for error reporting and for general info reporting such as warnings
+#include <ossim/base/ossimErrorContext.h>
+
+#include <sstream>
+#include <iterator>
+
+static const char* WEIGHTS_KW = "weights";
+
+RTTI_DEF1(ossimBandAverageFilter,
+          "ossimBandAverageFilter",
+          ossimImageSourceFilter);
+
+ossimBandAverageFilter::ossimBandAverageFilter()
+   :ossimImageSourceFilter(),
+    theTile(NULL)
+{
+}
+
+ossimBandAverageFilter::ossimBandAverageFilter(ossimImageSource* input,
+                                               const std::vector<double>& weights)
+   :ossimImageSourceFilter(input),
+    theTile(NULL),
+    theWeights(weights)
+{
+}
+
+ossimBandAverageFilter::~ossimBandAverageFilter()
+{
+}
+
+ossim_uint32 ossimBandAverageFilter::getNumberOfOutputBands()const
+{
+   if(isSourceEnabled())
+   {
+      return 1;
+   }
+   
+   return ossimImageSourceFilter::getNumberOfOutputBands();
+}
+
+ossimRefPtr<ossimImageData> ossimBandAverageFilter::getTile(const ossimIrect& rect, ossim_uint32 resLevel)
+{
+   // first we will check to see if we have an input connection
+   //
+   if(!theInputConnection)
+   {
+      // this will probably be null since we aren't initialized.
+      // we really need to creae a default blank tile in OSSIM that is returned
+      return theTile;
+   }
+
+   ossimRefPtr<ossimImageData> inputData =
+      theInputConnection->getTile(rect, resLevel);
+
+   if(!inputData.valid())
+   {
+      return inputData;
+   }
+   
+   // If we are disabled or if the data object is empty or NULL or
+   // not enough bands we don't need to run our algorithm so return the input
+   // tile.
+   if(!isSourceEnabled() ||
+      (inputData->getDataObjectStatus() == OSSIM_NULL)||
+      (inputData->getDataObjectStatus() == OSSIM_EMPTY)||
+      (inputData->getNumberOfBands() < 2))
+   {
+      return inputData;
+   }
+
+   // check to see if we are initialized
+   if(!theTile.valid())
+   {
+      initialize();
+   }
+   
+   theTile->setImageRectangle(rect);
+
+   // now lets set up the template method to operate in native type and run
+   // the algorithm
+   //
+   switch(inputData->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      averageInput((ossim_uint8)0, // setup template variable
+                   inputData);
+      break;
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_USHORT16:
+   {
+      averageInput((ossim_uint16)0, // setup template variable
+                   inputData);
+      break;
+   }
+   case OSSIM_SSHORT16:
+   {
+      averageInput((ossim_sint16)0, // setup template variable
+                   inputData);
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT:
+   {
+      averageInput((float)0, // setup template variable
+                   inputData);
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_DOUBLE:
+   {
+      averageInput((double)0, // setup template variable
+                   inputData);
+      break;
+   }
+   default:
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "Unsupported scalar type in file %d at line %d",
+                    __FILE__,
+                    __LINE__);
+
+      
+      theTile->makeBlank();
+      break;
+   }
+   }
+   
+   theTile->validate();
+
+   
+   return theTile;
+}
+
+
+
+void ossimBandAverageFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   
+   // theInputConnection is defined in ossimImageSourceFilter
+   // It is automatically set when an input is connected to this
+   // object
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+
+      // now initialize the tile
+      theTile->initialize();
+      checkWeights();
+   }
+}
+
+double ossimBandAverageFilter::getNullPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getNullPixelValue(band);
+   }
+   // lets use the first band's null value as our null
+   return ossimImageSourceFilter::getMinPixelValue(0);
+}
+
+double ossimBandAverageFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled()||!theInputConnection)
+   {
+      return ossimImageSourceFilter::getMinPixelValue(band);
+   }
+
+   // loop through each band and find the min pix value
+   ossim_uint32 bandIndex = 0;
+   ossim_uint32 inputBands = theInputConnection->getNumberOfOutputBands();
+   double minValue = ossim::defaultMax(OSSIM_DOUBLE);
+   for(bandIndex = 0; bandIndex < inputBands; ++bandIndex)
+   {
+      double minPix = theInputConnection->getMinPixelValue(bandIndex);
+
+      if(minPix < minValue)
+      {
+         minValue = minPix;
+      }
+   }
+
+   return minValue;
+}
+
+double ossimBandAverageFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getMaxPixelValue(band);
+   }
+   
+   // loop through each band and find the max pix value
+   ossim_uint32 bandIndex = 0;
+   ossim_uint32 inputBands = theInputConnection->getNumberOfOutputBands();
+   double maxValue = ossim::defaultMin(OSSIM_DOUBLE);
+   for(bandIndex = 0; bandIndex < inputBands; ++bandIndex)
+   {
+      double maxPix = theInputConnection->getMaxPixelValue(bandIndex);
+
+      if(maxPix > maxValue)
+      {
+         maxValue = maxPix;
+      }
+   }
+   
+   return maxValue;
+}
+
+void ossimBandAverageFilter::checkWeights()
+{
+   // we have not been initialzed yet
+   //
+   if(!theTile)
+   {
+      return;
+   }
+
+   // Check to see if the weights array is the same size as the input
+   // list.  If not then resize it and populate them with the same weight
+   // value.  It does not matter if they sum to one since we will perform
+   // a weighted average in the execution of the algorithm
+   //
+   if(theWeights.size() != theInputConnection->getNumberOfOutputBands())
+   {
+      theWeights.resize(theInputConnection->getNumberOfOutputBands());  
+
+      std::fill(theWeights.begin(), theWeights.end(), 1);
+   }
+}
+
+
+template<class T> void ossimBandAverageFilter::averageInput(
+   T /* dummyVariable */, // used only for template type, value ignored
+   ossimRefPtr<ossimImageData> inputDataObject)
+{
+   // since we have already checked the input for empty or
+   // null we will now execute the algorithm.  We will make
+   //
+   // 
+   std::vector<T*> inputBands(inputDataObject->getNumberOfBands());
+   std::vector<double> nullValues(inputDataObject->getNumberOfBands());
+   ossim_uint32 i = 0;
+
+   // for efficiency we will copy the band pointers and
+   // null values so we don't have extra function calls
+   // on a per band basis
+   //
+   for(i = 0; i < inputDataObject->getNumberOfBands(); ++i)
+   {
+      inputBands[i] = static_cast<T*>(inputDataObject->getBuf(i));
+      nullValues[i] = inputDataObject->getNullPix(i);
+   }
+
+   // store the output buffer pointer
+   T* outputBuf = static_cast<T*>(theTile->getBuf(0));
+
+   // setup index values and boundary values
+   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
+   ossim_uint32 bandIndex = 0;
+   ossim_uint32 numberOfBands = inputDataObject->getNumberOfBands();
+   double outputNullPix = theTile->getNullPix(0);
+   
+   for(i = 0; i < upperBound; ++i)
+   {
+      double value=0.0;
+      double sumWeights=0.0;
+
+      // loop over each band only using the valid pixel data
+      // in the weighted average.
+      //
+      for(bandIndex = 0; bandIndex < numberOfBands; ++bandIndex)
+      {
+         // if valid then muliply the value by the weight and add it to
+         // current pixel value
+         if(*inputBands[bandIndex] != nullValues[bandIndex])
+         {
+            value += theWeights[bandIndex]*((double)*inputBands[bandIndex]);
+            sumWeights += theWeights[bandIndex];
+         }
+         // increment to the next pixel for the next time around
+         ++inputBands[bandIndex];
+      }
+
+      // check to see if we had any valid data.  If we did the weight
+      // should be greater than 0
+      if(sumWeights != 0.0)
+      {
+         value /= sumWeights;
+      }
+      else
+      {
+         // else we set the pixel to the output null value
+         value = outputNullPix;
+      }
+      // store the result in the outputBuffer.
+      *outputBuf = static_cast<T>(value);
+
+      // advance the output buffer to the next pixel value
+      ++outputBuf;
+   }
+}
+
+
+bool ossimBandAverageFilter::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   // get the value of the stored keyword
+   ossimString weightString = kwl.find(prefix, WEIGHTS_KW);
+   weightString = weightString.trim();
+   
+
+   theWeights.clear();
+   if(weightString != "")
+   {
+      // split the string list into an array of strings
+      std::vector<ossimString> weightList = weightString.split(" ");
+
+      // resize the weights to the size of the weight list
+      //
+      theWeights.resize(weightList.size());
+      ossim_uint32 i = 0;
+
+      // now store the weights to the array
+      for(i = 0; i < theWeights.size(); ++i)
+      {
+         theWeights[i] = weightList[i].toDouble();
+      }
+   }
+
+   // call base class to continue the load state
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimBandAverageFilter::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix)const
+{
+   std::stringstream out;
+
+   // copy the weights  to a memory stream separated by space
+   std::copy(theWeights.begin(),
+             theWeights.end(),
+             ostream_iterator<double>(out, " "));
+
+   ossimString weightString = out.str();
+   weightString = weightString.trim();
+
+   
+   kwl.add(prefix, // prefix to help uniquely id or attributes
+           WEIGHTS_KW, // the keyword to identity our attribute
+           weightString.c_str(),     // the value 
+           true); // overwrite if already in the keywordlist
+   
+   // call base classes save to allow us to pass the information up
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+double ossimBandAverageFilter::getWeight(ossim_uint32 band)const
+{
+   if(band < theWeights.size())
+   {
+      return theWeights[band];
+   }
+   
+   return 0.0;
+}
+
+void ossimBandAverageFilter::setWeight(ossim_uint32 band, double weight)
+{
+   if(band < theWeights.size())
+   {
+      theWeights[band] = fabs(weight);
+   }
+}
diff --git a/src/imaging/ossimBandClipFilter.cpp b/src/imaging/ossimBandClipFilter.cpp
new file mode 100644
index 0000000..8ab31e0
--- /dev/null
+++ b/src/imaging/ossimBandClipFilter.cpp
@@ -0,0 +1,698 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBandClipFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimBandClipFilter.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/imaging/ossimImageData.h>
+
+RTTI_DEF1(ossimBandClipFilter, "ossimBandClipFilter", ossimImageSourceFilter);
+
+ossimBandClipFilter::ossimBandClipFilter()
+   :ossimImageSourceFilter(),
+    theClipType(ossimBandClipType_NONE),
+    theTile(NULL)
+{
+   theTile = new ossimImageData(this, // I am the owner,
+                                OSSIM_NORMALIZED_FLOAT,
+                                1);
+   theTile->initialize();
+}
+
+ossimBandClipFilter::ossimBandClipFilter(ossimImageSource* inputSource,
+                                           const vector<double>& minPix,
+                                           const vector<double>& maxPix,
+                                           ossimBandClipType clipType)
+   :ossimImageSourceFilter(inputSource),
+    theClipType(clipType),
+    theTile(NULL)
+{
+   theTile = new ossimImageData(this, // I am the owner,
+                                OSSIM_NORMALIZED_FLOAT,
+                                1);
+   theTile->initialize();
+   setMinMaxPix(minPix, maxPix);
+}
+
+ossimBandClipFilter::ossimBandClipFilter(ossimImageSource* inputSource,
+                                         double minPix,
+                                         double maxPix,
+                                         ossimBandClipType clipType)
+   :ossimImageSourceFilter(inputSource),
+    theClipType(clipType),
+    theTile(NULL)
+{
+   theTile = new ossimImageData(this, // I am the owner,
+                                OSSIM_NORMALIZED_FLOAT,
+                                1);
+   theTile->initialize();
+   
+   theMinPix.push_back(minPix);
+   theMaxPix.push_back(maxPix);
+}
+
+ossimBandClipFilter::~ossimBandClipFilter()
+{
+}
+
+void ossimBandClipFilter::setClipType(ossimBandClipType clipType)
+{
+   theClipType = clipType;
+}
+
+ossimBandClipFilter::ossimBandClipType ossimBandClipFilter::getClipType()const
+{
+   return theClipType;
+}
+
+ossim_uint32 ossimBandClipFilter::getNumberOfValues()const
+{
+   // We make sure that all arrays have the same number
+   // of elements so we can use the size of any of them.
+   return (ossim_uint32)theMinPix.size();
+}
+
+void ossimBandClipFilter::setNumberOfValues(ossim_uint32 size)
+{
+
+   // lets do a non destructive set.  That way we can
+   // grow or shrink the list without destroying
+   // the original values.
+   //
+   if(!size)
+   {
+      theMinPix.clear();
+      theMaxPix.clear();
+      theMedian.clear();
+      return;
+   }
+
+   
+   vector<double> tempMin    = theMinPix;
+   vector<double> tempMax    = theMaxPix;
+   
+   theMinPix.resize(size);
+   theMaxPix.resize(size);
+   theMedian.resize(size);
+    
+   ossim_uint32 upperBound = (ossim_uint32)min(theMinPix.size(), tempMin.size());
+   ossim_uint32 index = 0;
+
+   for(index = 0; index < upperBound; ++index)
+   {
+      theMinPix[index] = tempMin[index];
+      theMaxPix[index] = tempMax[index];
+      
+      theMinPix[index] = theMinPix[index]>1?1:theMinPix[index];
+      theMinPix[index] = theMinPix[index]<0?0:theMinPix[index];
+      theMaxPix[index] = theMaxPix[index]>1?1:theMaxPix[index];
+      theMaxPix[index] = theMaxPix[index]<0?0:theMaxPix[index];
+      
+      theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
+   }
+   
+   for(;index < theMinPix.size();++index)
+   {
+      theMinPix[index] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
+      theMaxPix[index] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
+      theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
+            
+      theMedian[index] = (theMaxPix[index] + theMinPix[index])/2.0;
+   }
+}
+
+void ossimBandClipFilter::setMinMaxPix(const vector<double>& minPix,
+                                       const vector<double>& maxPix)
+{
+   theMinPix = minPix;
+   theMaxPix = maxPix;
+
+   setNumberOfValues((ossim_uint32)max(theMinPix.size(), theMaxPix.size()));
+}
+
+const std::vector<double>& ossimBandClipFilter::getMinPixList()const
+{
+   return theMinPix;
+}
+
+const std::vector<double> ossimBandClipFilter::getMaxPixList()const
+{
+   return theMaxPix;
+}
+
+double ossimBandClipFilter::getMinPix(ossim_uint32 index)const
+{
+   return index<theMinPix.size()?theMinPix[index]:0;
+}
+
+double ossimBandClipFilter::getMaxPix(ossim_uint32 index)const
+{
+   return index<theMaxPix.size()?theMaxPix[index]:0;
+}
+
+ossimRefPtr<ossimImageData> ossimBandClipFilter::getTile(
+   const ossimIrect& rect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return NULL;
+   }
+   
+   ossimRefPtr<ossimImageData> data =
+      theInputConnection->getTile(rect, resLevel);
+   if(!data.get())
+   {
+      return data;
+   }
+   ossimDataObjectStatus status = data->getDataObjectStatus();
+   if((status != OSSIM_NULL) &&
+      (status != OSSIM_EMPTY))
+   {
+      ossim_uint32 dw = data->getWidth();
+      ossim_uint32 dh = data->getHeight();
+      ossim_uint32 db = data->getNumberOfBands();
+
+      ossim_uint32 tw = theTile->getWidth();
+      ossim_uint32 th = theTile->getHeight();
+      ossim_uint32 tb = theTile->getNumberOfBands();
+
+      if(((tw*th)!=(dw*dh))||
+         (tb != db))
+      {
+         theTile = new ossimImageData(this,
+                                      OSSIM_NORMALIZED_FLOAT,
+                                      db,
+                                      dw,
+                                      dh);
+         theTile->initialize();
+      }
+
+      if(getNumberOfValues() != theTile->getNumberOfBands())
+      {
+         // Should this go on??? (drb)
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimBandClipFilter::getTile\n"
+            << "getNumberOfValues() != theTile->getNumberOfBands"
+            << endl;
+      }
+      
+      data->copyTileToNormalizedBuffer(static_cast<float*>(theTile->getBuf()));
+      theTile->setDataObjectStatus(data->getDataObjectStatus());
+      
+      switch(theClipType)
+      {
+         case ossimBandClipType_CLIP:
+         {
+            runClip();
+            break;
+         }
+         case ossimBandClipType_CLAMP:
+         {
+            runClamp();
+            break;
+         }
+         case ossimBandClipType_LINEAR_STRETCH:
+         {
+            runLinearStretch();
+            break;
+         }
+         case ossimBandClipType_MEDIAN_STRETCH:
+         {
+            runMedianStretch();
+            break;
+         }
+         default:
+            break;
+      }
+      data->copyNormalizedBufferToTile(static_cast<float*>(theTile->getBuf()));
+   }
+   
+   return data;
+}
+
+void ossimBandClipFilter::runClip()
+{
+   ossim_uint32 offset = 0;
+   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
+   for(ossim_uint32 band =0; band < theTile->getNumberOfBands(); ++band)
+   {
+      float *buf     = static_cast<float*>(theTile->getBuf(band));
+      float  minPix  = theMinPix[band];
+      float  maxPix  = theMaxPix[band];
+      float  nullPix = theTile->getNullPix(band);
+      
+      if(buf)
+      {
+         for(offset = 0; offset < upperBound; ++offset)
+         {
+            if((*buf < minPix)||
+               (*buf > maxPix))
+            {
+               *buf = nullPix;
+            }
+            ++buf;
+         }
+      }
+   }
+   theTile->validate();
+}
+
+void ossimBandClipFilter::runClamp()
+{
+   ossim_uint32 offset = 0;
+   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
+   for(ossim_uint32 band =0; band < theTile->getNumberOfBands(); ++band)
+   {
+      float *buf     = static_cast<float*>(theTile->getBuf(band));
+      float  minPix  = theMinPix[band];
+      float  maxPix  = theMaxPix[band];
+      float  nullPix = theTile->getNullPix(band);
+      
+      if(buf)
+      {
+         if(theTile->getDataObjectStatus() == OSSIM_PARTIAL)
+         {
+            for(offset = 0; offset < upperBound; ++offset)
+            {
+               if(*buf != nullPix)
+               {
+                  if(*buf < minPix)
+                  {
+                     *buf = minPix;
+                  }
+                  else if(*buf > maxPix)
+                  {
+                     *buf = maxPix;
+                  }
+               }
+               ++buf;
+            }
+         }
+         else
+         {
+            for(offset = 0; offset < upperBound; ++offset)
+            {
+               if(*buf < minPix)
+               {
+                  *buf = minPix;
+               }
+               else if(*buf > maxPix)
+               {
+                  *buf = maxPix;
+               }
+               ++buf;
+            }
+         }
+      }
+   }
+}
+
+void ossimBandClipFilter::runLinearStretch()
+{   
+   ossim_uint32 bands = (ossim_uint32)min(theTile->getNumberOfBands(), (ossim_uint32)theMinPix.size());
+   ossim_uint32 w     = theTile->getWidth();
+   ossim_uint32 h     = theTile->getHeight();
+   ossim_uint32 upperBound = w*h;
+   const double* minPixArray = theTile->getMinPix();
+   const double* maxPixArray = theTile->getMaxPix();
+      
+   float* *bandArray = new float*[bands];
+   ossim_uint32 band = 0;
+   for(band = 0; band < bands; ++band)
+   {
+      bandArray[band] = static_cast<float*>(theTile->getBuf(band));
+   }
+   
+   if(theTile->getDataObjectStatus() == OSSIM_PARTIAL)
+   {
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         if(!theTile->isNull(offset))
+         {
+            for(band = 0; band < bands; ++band)
+            {
+               double delta = theMaxPix[band] - theMinPix[band];
+               double t     = (bandArray[band][offset] - theMinPix[band])/delta;
+               if(t < 0)
+               {
+                 bandArray[band][offset] = minPixArray[band];
+               }
+               else if(t > 1)
+               {
+                 bandArray[band][offset] = maxPixArray[band];
+               }
+               else
+               {
+                  bandArray[band][offset] = t;
+               }
+            }
+         }
+      }
+   }
+   else if(theTile->getDataObjectStatus() == OSSIM_FULL)
+   {
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+         {
+            for(band = 0; band < bands; ++band)
+            {
+               double delta = theMaxPix[band] - theMinPix[band];
+               double t     = (bandArray[band][offset] - theMinPix[band])/delta;
+               
+              if(t < 0)
+              {
+                 bandArray[band][offset] = minPixArray[band];
+              }
+              else if(t > 1)
+              {
+                 bandArray[band][offset] = maxPixArray[band];
+              }
+              else
+              {
+                 bandArray[band][offset] = t;
+              }
+            }
+         }
+   }
+   delete [] bandArray;
+   
+}
+
+void ossimBandClipFilter::runMedianStretch()
+{
+   ossim_uint32 bands = theTile->getNumberOfBands();
+   float* *bandArray = new float*[bands];
+   ossim_uint32 band = 0;
+
+   for(band = 0; band < bands; ++band)
+   {
+      bandArray[band] = static_cast<float*>(theTile->getBuf(band));
+   }
+   ossim_uint32 upperBound = theTile->getWidth()*theTile->getHeight();
+   
+   if(theTile->getDataObjectStatus() == OSSIM_PARTIAL)
+   {
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         if(!theTile->isNull(offset))
+         {
+            for(band = 0; band < bands; ++band)
+            {
+               double side = (theMedian[band] - (double)bandArray[band][offset]);
+               
+               if(side > 0) // on the left
+               {
+                  double delta = fabs(theMedian[band] - theMinPix[band]);
+                  double t     = ((double)bandArray[band][offset] - theMinPix[band])/delta;
+                  if(t < 0)
+                  {
+                     bandArray[band][offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
+                  }
+                  else if(t > 1)
+                  {
+                     bandArray[band][offset] = theMedian[band];
+                  }
+                  else
+                  {
+                     bandArray[band][offset] = theMedian[band]*t;
+                  }
+               }
+               else // on the right
+               {
+                  double delta = theMaxPix[band] - theMedian[band];
+                  double t = ((double)bandArray[band][offset] - theMedian[band])/delta;
+                  
+                  if(t < 0)
+                  {
+                     bandArray[band][offset] = theMedian[band];
+                  }
+                  else if(t > 1)
+                  {
+                     bandArray[band][offset] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
+                  }
+                  else
+                  {
+                     bandArray[band][offset] = theMedian[band]+delta*t;
+                  }
+               }
+            }
+         }
+      }
+   }
+   else if(theTile->getDataObjectStatus() == OSSIM_FULL)
+   {
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         for(band = 0; band < bands; ++band)
+         {
+            double side = (theMedian[band] - (double)bandArray[band][offset]);
+            
+            if(side > 0) // on the left
+            {
+               double delta = fabs(theMedian[band] - theMinPix[band]);
+               double t     = ((double)bandArray[band][offset] - theMinPix[band])/delta;
+               if(t < 0)
+               {
+                  bandArray[band][offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
+               }
+               else if(t > 1)
+               {
+                  bandArray[band][offset] = theMedian[band];
+               }
+               else
+               {
+                  bandArray[band][offset] = theMedian[band]*t;
+               }
+            }
+            else // on the right
+            {
+               double delta = theMaxPix[band] - theMedian[band];
+               double t = ((double)bandArray[band][offset] - theMedian[band])/delta;
+               
+               if(t < 0)
+               {
+                  bandArray[band][offset] = theMedian[band];
+               }
+               else if(t > 1)
+               {
+                  bandArray[band][offset] = OSSIM_DEFAULT_MAX_PIX_NORM_FLOAT;
+               }
+               else
+               {
+                  bandArray[band][offset] = theMedian[band]+delta*t;
+               }
+            }
+         }
+      }
+   }
+
+   delete [] bandArray;
+}   
+
+void ossimBandClipFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   
+   if(theInputConnection)
+   {
+      ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
+
+      if(bands)
+      {
+         if(theMinPix.size() != bands)
+         {
+            setNumberOfValues(bands);
+         }
+      }
+   }
+}
+
+bool ossimBandClipFilter::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
+
+   if(result)
+   {
+      ossimString minRegExpression    = ossimString("^(") +
+                                        ossimString(prefix) +
+                                        "min[0-9]+)";
+      ossimString maxRegExpression    = ossimString("^(") +
+                                        ossimString(prefix) +
+                                        "max[0-9]+)";
+      ossimString medianRegExpression = ossimString("^(") +
+                                        ossimString(prefix) +
+                                        "median[0-9]+)";
+      
+      ossim_uint32 numberOfMins    = kwl.getNumberOfSubstringKeys(minRegExpression);
+      ossim_uint32 numberOfMaxs    = kwl.getNumberOfSubstringKeys(maxRegExpression);
+      ossim_uint32 numberOfMedians = kwl.getNumberOfSubstringKeys(medianRegExpression);
+      theMinPix.clear();
+      theMaxPix.clear();
+      theMedian.clear();
+
+      if(numberOfMins != numberOfMaxs)
+      {
+         ossim_int32 temp = (ossim_int32)min(numberOfMins, numberOfMaxs);
+         numberOfMins = temp;
+         numberOfMaxs = temp;
+      }
+      if(numberOfMins> 0)
+      {
+         ossimString prefixMin    = ossimString(prefix) + "min";
+         ossimString prefixMax    = ossimString(prefix) + "max";
+         ossimString prefixMedian = ossimString(prefix) + "median";
+         
+         ossim_uint32 numberOfMatches = 0;
+         ossim_uint32 index = 0;
+         const char* value=(const char*)NULL;
+         
+         while(numberOfMatches < numberOfMins)
+         {
+            value = kwl.find(prefixMin.c_str(),
+                             ossimString::toString(index).c_str());
+            if(value)
+            {
+               theMinPix.push_back(ossimString(value).toDouble());
+               ++numberOfMatches;
+            }
+            ++index;
+         }
+         index = 0;
+         numberOfMatches = 0;
+         while(numberOfMatches < numberOfMaxs)
+         {
+            value = kwl.find(prefixMax.c_str(),
+                             ossimString::toString(index).c_str());
+            if(value)
+            {
+               theMaxPix.push_back(ossimString(value).toDouble());
+               ++numberOfMatches;
+            }
+            ++index;
+         }
+         if(numberOfMedians != numberOfMins)
+         {
+            for(index = 0; index <  theMaxPix.size(); ++index)
+            {
+               theMedian.push_back((theMinPix[index]+theMaxPix[index])/2.0);
+            }
+         }
+         else
+         {
+            index = 0;
+            numberOfMatches = 0;
+            while(numberOfMatches < numberOfMedians)
+            {
+               value = kwl.find(prefixMedian.c_str(),
+                                ossimString::toString(index).c_str());
+               if(value)
+               {
+                  theMedian.push_back(ossimString(value).toDouble());
+                  ++numberOfMatches;
+               }
+               ++index;
+            }
+         }
+      }
+   }
+   const char* clip_type = kwl.find(prefix, "clip_type");
+   if(clip_type)
+   {
+     ossimString clipType = clip_type;
+      clipType = clipType.upcase().trim();
+
+      if(clipType == "NONE")
+      {
+         theClipType = ossimBandClipType_NONE;
+      }
+      else if(clipType == "CLIP")
+      {
+         theClipType = ossimBandClipType_CLIP;
+      }
+      else if(clipType == "LINEAR_STRETCH")
+      {
+         theClipType = ossimBandClipType_LINEAR_STRETCH;
+      }
+      else if(clipType == "MEDIAN_STRETCH")
+      {
+         theClipType = ossimBandClipType_MEDIAN_STRETCH;
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "ossimBandClipFilter::loadState NOTICE:\n"
+         << "Clip type not given defaulting to NONE" << endl;
+      theClipType = ossimBandClipType_NONE;
+   }
+
+   return result;
+}
+
+bool ossimBandClipFilter::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix)const
+{
+   ossimString minPrefix    = ossimString("min");
+   ossimString maxPrefix    = ossimString("max");
+   ossimString medianPrefix = ossimString("median");
+
+   for(ossim_uint32 index = 1; index <= getNumberOfValues(); ++index)
+   {
+      ossimString value = (minPrefix+ossimString::toString(index));
+      kwl.add(prefix,
+              value.c_str(),
+              theMinPix[index-1],
+              true);
+      value = (maxPrefix+ossimString::toString(index));
+      kwl.add(prefix,
+              value.c_str(),
+              theMaxPix[index-1],
+              true);
+      value = (medianPrefix+ossimString::toString(index));
+      kwl.add(prefix,
+              value.c_str(),
+              theMedian[index-1],
+              true);
+   }
+   ossimString clipType;
+   switch(theClipType)
+   {
+      case ossimBandClipType_NONE:
+      {
+         clipType = "NONE";
+         break;
+      }
+      case ossimBandClipType_CLIP:
+      {
+         clipType = "CLIP";
+         break;
+      }
+      case ossimBandClipType_LINEAR_STRETCH:
+      {
+         clipType = "LINEAR_STRETCH";
+         break;
+      }
+      case ossimBandClipType_MEDIAN_STRETCH:
+      {
+         clipType = "MEDIAN_STRETCH";
+         break;
+      }
+      default:
+         break;
+   }
+   kwl.add(prefix,
+           "clip_type",
+           clipType.c_str(),
+           true);
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
diff --git a/src/imaging/ossimBandLutFilter.cpp b/src/imaging/ossimBandLutFilter.cpp
new file mode 100644
index 0000000..52727c6
--- /dev/null
+++ b/src/imaging/ossimBandLutFilter.cpp
@@ -0,0 +1,438 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************
+// $Id: ossimBandLutFilter.cpp 23242 2015-04-08 17:31:35Z dburken $
+#include <ossim/imaging/ossimBandLutFilter.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+RTTI_DEF1(ossimBandLutFilter, "ossimBandLutFilter", ossimImageSourceFilter);
+
+static const char* MODE_KW = "mode";
+static const char* LUT_FILE_KW = "lut_file";
+
+ossimBandLutFilter::ossimBandLutFilter()
+:ossimImageSourceFilter(),
+ theMode(INTERPOLATED),
+ theTile(0),
+ theLutFile(""),
+ theOutputScalarType(OSSIM_SCALAR_UNKNOWN)
+{
+   setDescription("Look-up-table remapper for band-independent remapping.");
+}
+
+ossimBandLutFilter::~ossimBandLutFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimBandLutFilter::getTile(const ossimIrect& tileRect,
+                                                              ossim_uint32 resLevel)
+{
+   if(!theInputConnection || (theLut.size() == 0))
+      return 0;
+
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect, resLevel);
+   if (!inputTile || !inputTile->getBuf())
+      return 0;
+
+   if(!theTile)
+   {
+      allocate();
+      if (!theTile)
+         return 0;
+   }
+
+   theTile->setImageRectangle(tileRect);
+   theTile->makeBlank();
+
+   // Quick handling special case of empty input tile:
+   if (inputTile->getDataObjectStatus() == OSSIM_EMPTY)
+      return theTile;
+
+   const double null_index = theInputConnection->getNullPixelValue();
+   const double null_value = theTile->getNullPix(0); // assuming same null for all bands
+   ossim_uint32 maxLength = inputTile->getWidth()*inputTile->getHeight();
+
+   double index, value;
+   double min_value=OSSIM_DEFAULT_MAX_PIX_DOUBLE;
+   double max_value=OSSIM_DEFAULT_MIN_PIX_DOUBLE;
+
+   ossim_uint32 numBands = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < numBands; ++band)
+   {
+      map<double, double>& bandMap = theLut[band];
+      std::map<double, double>::const_iterator lut_entry;
+      for (ossim_uint32 pixel=0; pixel<maxLength; ++pixel)
+      {
+         // Do not remap null pixels, leave the output pixel "blank" which is null-pixel value:
+         index = inputTile->getPix(pixel, band);
+         if (index == null_index)
+            continue;
+
+         // Now perform look-up depending on mode:
+         if (theMode == LITERAL)
+         {
+            lut_entry = bandMap.find(index);
+            if (lut_entry == bandMap.end())
+               value = null_value;
+            else
+               value = lut_entry->second;
+         }
+         else
+         {
+            // Interpolated mode performs interpolation here between the line segments vertices:
+            lut_entry = bandMap.find(index);
+            if (lut_entry != bandMap.end())
+            {
+               // Got exact match, no interpolation needed:
+               value = lut_entry->second;
+            }
+            else
+            {
+               lut_entry = bandMap.upper_bound(index);
+               if ((lut_entry == bandMap.end()) || (lut_entry == bandMap.begin()))
+                  value = null_value;
+               else
+               {
+                  // Need to linearly interpolate:
+                  double index_hi = lut_entry->first;
+                  double value_hi (lut_entry->second);
+                  --lut_entry;
+                  double index_lo = lut_entry->first;
+                  double value_lo (lut_entry->second);
+                  double w_lo = (index_hi - index)/(index_hi - index_lo);
+                  double w_hi = 1.0 - w_lo;
+                  value = value_hi*w_hi + value_lo*w_lo;
+               }
+            }
+         }
+
+         if (value < min_value)
+            min_value = value;
+         if (value > max_value)
+            max_value = value;
+
+         // Assign this output pixel according to desired scalar type:
+         switch(theOutputScalarType)
+         {
+         case OSSIM_DOUBLE:
+            theTile->getDoubleBuf(band)[pixel] = value;
+            theTile->setMinPix(min_value);
+            theTile->setMaxPix(max_value);
+            break;
+         case OSSIM_SSHORT16:
+            theTile->getSshortBuf(band)[pixel] = value;
+            break;
+         case OSSIM_FLOAT:
+            theTile->setMinPix(min_value);
+            theTile->setMaxPix(max_value);
+            theTile->getFloatBuf(band)[pixel] = value;
+            break;
+         case OSSIM_NORMALIZED_FLOAT:
+            theTile->getFloatBuf(band)[pixel] = value;
+            break;
+         case OSSIM_UCHAR:
+            theTile->getUcharBuf(band)[pixel] = value;
+            break;
+         case OSSIM_USHORT16:
+            theTile->getUshortBuf(band)[pixel] = value;
+            break;
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+            theTile->getUshortBuf(band)[pixel] = value;
+            break;
+         default:
+            break;
+         }
+      } // end loop over band's pixels
+   }  // end loop over tile's bands
+
+   theTile->validate();
+   return theTile;
+}
+
+void ossimBandLutFilter::allocate()
+{
+   if(!theInputConnection)
+      return;
+
+   theTile = ossimImageDataFactory::instance()->create(this, getNumberOfInputBands(), this);
+   if(!theTile.valid())
+      return;
+
+   switch(theOutputScalarType)
+   {
+   case OSSIM_SSHORT16:
+      theTile->setMinPix(-32768);
+      theTile->setMaxPix(32767);
+      break;
+   case OSSIM_NORMALIZED_FLOAT:
+      theTile->setMinPix(0.0);
+      theTile->setMaxPix(1.0);
+      break;
+   case OSSIM_UCHAR:
+      theTile->setMinPix(0);
+      theTile->setMaxPix(255);
+      break;
+   case OSSIM_USHORT16:
+      theTile->setMinPix(0);
+      theTile->setMaxPix(65535);
+      break;
+   case OSSIM_USHORT11:
+      theTile->setMinPix(0);
+      theTile->setMaxPix(2047);
+      break;
+   case OSSIM_USHORT12:
+      theTile->setMinPix(0);
+      theTile->setMaxPix(4095);
+      break;
+   case OSSIM_USHORT13:
+      theTile->setMinPix(0);
+      theTile->setMaxPix(8191);
+      break;
+   case OSSIM_USHORT14:
+      theTile->setMinPix(0);
+      theTile->setMaxPix(16383);
+      break;
+   case OSSIM_USHORT15:
+      theTile->setMinPix(0);
+      theTile->setMaxPix(32767);
+      break;
+   default:
+      break;
+   }
+
+   theTile->initialize();
+}
+
+void ossimBandLutFilter::initialize()
+{
+   // This assigns theInputConnection if one is there.
+   ossimImageSourceFilter::initialize();
+
+   // theTile will get allocated on first getTile call.
+   theTile = 0;
+   if ( theInputConnection )
+   {
+      // Initialize the chain on the left hand side of us.
+      theInputConnection->initialize();
+   }
+}
+
+bool ossimBandLutFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   if (theLut.empty())
+      return true;
+
+   ossimString value;
+   switch (theMode)
+   {
+   case LITERAL:
+      value = "literal";
+      break;
+   case INTERPOLATED:
+   default:
+      value = "interpolated";
+      break;
+   }
+   kwl.add(prefix, MODE_KW,  value.c_str(), true);
+
+   bool rtn_stat = true;
+
+   // Save the actual LUT:
+   int numBands = theLut.size();
+   for (int band=0; band<numBands; ++band)
+   {
+      ostringstream base_keyword;
+      if (numBands > 1)
+         base_keyword << "band" << band << ".";
+
+      std::map<double, double>::const_iterator iter =  theLut[band].begin();
+      ossim_uint32 entry = 0;
+      while (iter != theLut[band].end())
+      {
+         ostringstream inKey, outKey;
+         inKey  << base_keyword.str() << "entry" << entry <<".in";
+         outKey << base_keyword.str() << "entry" << entry <<".out";
+
+         ostringstream inVal, outVal;
+         inVal  << iter->first;
+         outVal << iter->second;
+
+         kwl.add(prefix,  inKey.str().c_str(),  inVal.str().c_str());
+         kwl.add(prefix, outKey.str().c_str(), outVal.str().c_str());
+         ++iter;
+         ++entry;
+      }
+   }
+   rtn_stat &= ossimImageSourceFilter::saveState(kwl, prefix);
+   return rtn_stat;
+}
+
+bool ossimBandLutFilter::loadState(const ossimKeywordlist& orig_kwl, const char* prefix)
+{
+   bool return_state = true;
+   ossimKeywordlist kwl (orig_kwl); // need non-const copy
+
+   // First look for a LUT filename, and add its contents to the original KWL:
+   theLutFile = kwl.find(prefix, LUT_FILE_KW);
+   if (!theLutFile.empty())
+   {
+      // Need new (non const) KWL to hold merged contents, maintaining proper prefix if any:
+      ossimKeywordlist lut_kwl;
+      if (lut_kwl.addFile(theLutFile))
+         kwl.add(prefix, lut_kwl, false); // appends all entries of lut_kwl with prefix before adding
+   }
+
+   theMode = INTERPOLATED;
+   ossimString lookup =  kwl.find(prefix, MODE_KW);
+   if (lookup.contains("literal"))
+      theMode = LITERAL;
+
+   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
+   if (scalar != ossimLookUpTable::NOT_FOUND)
+      setOutputScalarType(static_cast<ossimScalarType>(scalar));
+
+   return_state &= initializeLut(kwl, prefix);
+   return_state &= ossimImageSourceFilter::loadState(orig_kwl, prefix);
+
+   return return_state;
+}
+
+bool ossimBandLutFilter::initializeLut(const ossimKeywordlist& kwl, const char* prefix)
+{
+   theLut.clear();
+   ossim_uint32 numBands = getNumberOfInputBands();
+   bool usingBandPrefix = true;
+   if (numBands <= 1)
+   {
+      ossim_uint32 numEntries = kwl.numberOf(prefix, "band0.in");
+      if (numEntries == 0)
+      {
+         usingBandPrefix = false;
+         numBands = 1;
+      }
+   }
+
+   ossim_uint32 band = 0;
+   while (true)
+   {
+      ossim_uint32 entry = 0;
+      map<double,double> bandMap;
+      while (true)
+      {
+         ostringstream inKey, outKey;
+         if (usingBandPrefix)
+         {
+            inKey  << "band" << band << ".entry" << entry <<".in";
+            outKey << "band" << band << ".entry" << entry <<".out";
+         }
+         else
+         {
+            inKey  << "entry" << entry <<".in";
+            outKey << "entry" << entry <<".out";
+         }
+
+         ossimString inVal = kwl.find(prefix, inKey.str().c_str());
+         if (inVal.empty())
+            break;
+         ossimString outVal = kwl.find(prefix, outKey.str().c_str());
+         if (outVal.empty())
+            break;
+
+         bandMap.insert(std::pair<double,double>(inVal.toDouble(), outVal.toDouble()));
+         ++entry;
+      }
+
+      if (bandMap.empty())
+         break;
+
+      theLut.push_back(bandMap);
+
+      ++band;
+      if ((numBands == 1) || !usingBandPrefix)
+         break;
+
+   }
+
+   // Band still 0 would indicate a failure reading the first band entry:
+   if (band == 0)
+      return false;
+
+   // Check that the correct number of bands are represented:
+   if (theInputConnection && (numBands > band))
+   {
+      if (!usingBandPrefix)
+      {
+         // Use the same map for all bands
+         for (ossim_uint32 i=1; i<numBands; ++i)
+            theLut.push_back(theLut[0]);
+      }
+      else
+      {
+         // Not enough bands were specified in the KWL to represent all input bands. Set remaining
+         // bands to no entries:
+         map<double,double> nullBandMap;
+         for (; band<numBands; ++band)
+            theLut.push_back(nullBandMap);
+      }
+   }
+   return true;
+}
+
+void ossimBandLutFilter::setLut(const ossimFilename& file)
+{
+   theLutFile = file;
+   if(file.exists())
+   {
+      ossimKeywordlist kwl(theLutFile);
+      loadState(kwl);
+   }
+}
+
+void ossimBandLutFilter::setOutputScalarType(ossimScalarType scalarType)
+{
+   if (scalarType == OSSIM_SCALAR_UNKNOWN)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimScalarRemapper::setOutputScalarType WARN:\n"
+               << "OSSIM_SCALAR_UNKNOWN passed to method.  No action taken..."
+               << std::endl;
+      return;
+   }
+
+   theOutputScalarType = scalarType;
+   allocate();
+}
+
+void ossimBandLutFilter::setOutputScalarType(ossimString scalarType)
+{
+   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(scalarType.c_str());
+
+   if (scalar != ossimLookUpTable::NOT_FOUND)
+   {
+      setOutputScalarType(static_cast<ossimScalarType>(scalar));
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimScalarRemapper ERROR:"
+               << "\nUnknown scalar type:  " << scalarType.c_str() << std::endl;
+   }
+}
+
diff --git a/src/imaging/ossimBandMergeSource.cpp b/src/imaging/ossimBandMergeSource.cpp
new file mode 100644
index 0000000..3fd4e7f
--- /dev/null
+++ b/src/imaging/ossimBandMergeSource.cpp
@@ -0,0 +1,286 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBandMergeSource.cpp 23611 2015-11-06 19:37:12Z gpotts $
+#include <ossim/imaging/ossimBandMergeSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimIrect.h>
+
+RTTI_DEF1(ossimBandMergeSource, "ossimBandMergeSource", ossimImageCombiner)
+
+ossimBandMergeSource::ossimBandMergeSource()
+   :ossimImageCombiner(),
+    theNumberOfOutputBands(0),
+    theTile(NULL)
+{
+}
+
+ossimBandMergeSource::ossimBandMergeSource(ossimConnectableObject::ConnectableObjectList& inputSources)
+   :ossimImageCombiner(inputSources),
+    theNumberOfOutputBands(0),
+    theTile(NULL)
+{
+   initialize();
+}
+
+ossimBandMergeSource::~ossimBandMergeSource()
+{
+   theNumberOfOutputBands = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimBandMergeSource::getTile(const ossimIrect& tileRect,
+                                                          ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   if( ( getNumberOfInputs() == 1) || !isSourceEnabled() )
+   {
+      return getNextTile(layerIdx, 0, tileRect, resLevel);
+   }
+
+   // test if initialized
+   if(!theTile.get())
+   {
+      allocate();
+   }
+   
+   if(!theTile.get())
+   {
+      return getNextTile(layerIdx, 0, tileRect, resLevel);
+   }
+   
+   long w     = tileRect.width();
+   long h     = tileRect.height();
+   long tileW = theTile->getWidth();
+   long tileH = theTile->getHeight();
+   if ((w != tileW) || (h != tileH))
+   {
+      theTile->setWidth(w);
+      theTile->setHeight(h);
+      if((w*h)!=(tileW*tileH))
+      {
+         theTile->initialize();
+      }
+      else
+      {
+         theTile->makeBlank();
+      }
+   }
+   else
+   {
+      theTile->makeBlank();
+   }
+
+   theTile->setOrigin(tileRect.ul());
+   getTile(theTile.get(), resLevel);
+
+   return theTile;
+}
+
+bool ossimBandMergeSource::getTile(ossimImageData* tile, ossim_uint32 resLevel)
+{
+   if (!tile)
+      return false;
+
+   ossim_uint32 layerIdx = 0;
+   if( ( getNumberOfInputs() == 1) || !isSourceEnabled() )
+   {
+      return getNextTile(layerIdx, 0, tile, resLevel);
+   }
+
+   tile->makeBlank();
+   ossim_uint32 currentBand = 0;
+   ossim_uint32 maxBands = tile->getNumberOfBands();
+   ossim_uint32 inputIdx = 0;
+   ossimRefPtr<ossimImageData> currentTile;
+   for(inputIdx = 0; inputIdx < getNumberOfInputs(); ++inputIdx)
+   {
+      ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(inputIdx));
+      ossim_uint32 maxInputBands = 1;
+
+      if(input)
+      {
+         currentTile = input->getTile(tile->getImageRectangle(), resLevel);
+         if(currentTile.valid())
+         {
+            maxInputBands = currentTile->getNumberOfBands();
+            //std::cout << "MAX INPUT BANDS === " << maxInputBands << "\n";
+            if (maxInputBands == 0)
+               maxInputBands = 1;
+         }
+      }
+      else
+      {
+         currentTile = 0;
+      }
+
+      if(currentTile.valid()&&(currentTile->getBuf()))
+      {
+         for(ossim_uint32 band = 0; (band < maxInputBands) && (currentBand < maxBands); ++band)
+         {
+            //std::cout << "Actual Band, BAND == " << currentBand << ", " << band << "\n";
+            // clear the band with the actual NULL
+            tile->fill(currentBand, tile->getNullPix(band));
+
+            if(currentTile.valid())
+            {
+               if((currentTile->getDataObjectStatus() != OSSIM_NULL) &&
+                  (currentTile->getDataObjectStatus() != OSSIM_EMPTY))
+               {
+                  memmove(tile->getBuf(currentBand),
+                          currentTile->getBuf(band),
+                          currentTile->getSizePerBandInBytes());
+               }
+            }
+            ++currentBand;
+         }
+      }
+   }
+   tile->validate();
+   return true;
+}
+
+double ossimBandMergeSource::getNullPixelValue(ossim_uint32 band)const
+{
+   ossim_uint32 currentBandCount = 0;
+   ossim_uint32 idx              = 0;
+
+   ossim_uint32 maxBands = getNumberOfOutputBands();
+   if(!maxBands) return 0.0;
+   
+   while((currentBandCount < maxBands)&&
+	 (idx < getNumberOfInputs()))
+   {
+      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(idx));
+      if(temp)
+      {
+	ossim_uint32 previousCount = currentBandCount;
+	currentBandCount += temp->getNumberOfOutputBands();
+
+         if(band < currentBandCount)
+         {
+            return temp->getNullPixelValue(band - previousCount);
+         }
+      }
+      ++idx;
+   }
+   
+   return ossim::nan();
+}
+
+double ossimBandMergeSource::getMinPixelValue(ossim_uint32 band)const
+{
+   ossim_uint32 currentBandCount = 0;
+   ossim_uint32 idx              = 0;
+
+   ossim_uint32 maxBands = getNumberOfOutputBands();
+   if(!maxBands) return 0.0;
+   
+   while((currentBandCount < maxBands)&&
+	 (idx < getNumberOfInputs()))
+   {
+      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(idx));
+      if(temp)
+      {
+	ossim_uint32 previousCount = currentBandCount;
+	currentBandCount += temp->getNumberOfOutputBands();
+
+         if(band < currentBandCount)
+         {
+            return temp->getMinPixelValue(band - previousCount); 
+         }
+      }
+      ++idx;
+   }
+   
+   return 0.0;
+}
+
+double ossimBandMergeSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   ossim_uint32 currentBandCount = 0;
+   ossim_uint32 idx              = 0;
+
+   ossim_uint32 maxBands = getNumberOfOutputBands();
+   if(!maxBands) return 0.0;
+   
+   while((currentBandCount < maxBands)&&
+	 (idx < getNumberOfInputs()))
+   {
+      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(idx));
+      if(temp)
+      {
+	ossim_uint32 previousCount = currentBandCount;
+	currentBandCount += temp->getNumberOfOutputBands();
+
+         if(band < currentBandCount)
+         {
+            return temp->getMaxPixelValue(band - previousCount);
+         }
+      }
+      ++idx;
+   }
+   
+   return ossim::nan();
+}
+
+void ossimBandMergeSource::initialize()
+{
+   ossimImageCombiner::initialize();
+
+   if(theTile.get())
+   {
+      theTile = NULL;
+   }
+   
+   theNumberOfOutputBands = computeNumberOfInputBands();
+}
+
+void ossimBandMergeSource::allocate()
+{
+   if(theNumberOfOutputBands)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,
+                                                          this);
+      theTile->initialize();
+   }
+}
+
+ossim_uint32 ossimBandMergeSource::computeNumberOfInputBands()const
+{
+   ossim_uint32 result = 0;
+   ossim_uint32 size   = getNumberOfInputs();
+   for(ossim_uint32 index = 0; index < size; ++index)
+   {
+      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(index));
+      if(temp)
+      {
+         if(temp->getNumberOfOutputBands() == 0)
+         {
+            ++result;
+         }
+         else
+         {
+            result += temp->getNumberOfOutputBands();
+         }
+      }
+   }
+   return result;
+}
+
+ossim_uint32 ossimBandMergeSource::getNumberOfOutputBands() const
+{
+   if(!theNumberOfOutputBands)
+   {
+      return computeNumberOfInputBands();
+   }
+   
+   return theNumberOfOutputBands;
+}
diff --git a/src/imaging/ossimBandSelector.cpp b/src/imaging/ossimBandSelector.cpp
new file mode 100644
index 0000000..8fd4538
--- /dev/null
+++ b/src/imaging/ossimBandSelector.cpp
@@ -0,0 +1,722 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Contains class declaration for ossimBandSelector.
+// 
+//*******************************************************************
+//  $Id$
+
+#include <ossim/imaging/ossimBandSelector.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <iostream>
+#include <algorithm>
+
+static ossimTrace traceDebug("ossimBandSelector:debug");
+
+RTTI_DEF1(ossimBandSelector,"ossimBandSelector", ossimImageSourceFilter)
+
+ossimBandSelector::ossimBandSelector()
+   :
+      ossimImageSourceFilter(),
+      m_tile(0),
+      m_outputBandList(0),
+      m_withinRangeFlag(ossimBandSelectorWithinRangeFlagState_NOT_SET),
+      m_passThroughFlag(false),
+      m_delayLoadRgbFlag(false),
+      m_inputIsSelectable(false)
+{
+//   theEnableFlag = false; // Start off disabled.
+   theEnableFlag = true; 
+}
+
+ossimBandSelector::~ossimBandSelector()
+{
+   m_tile = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimBandSelector::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if (!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   // Get the tile from the source.
+   ossimRefPtr<ossimImageData> t = theInputConnection->getTile(tileRect, resLevel);
+
+
+   if (!isSourceEnabled()||m_passThroughFlag)
+   {
+      return t;  // This tile source bypassed, return the input tile source.
+   }
+
+   if(!m_tile.valid()) // First time through, might not be initialized...
+   {
+      allocate();
+      if (!m_tile.valid())
+      {
+         // Should never happen...
+         return t; // initialize failed.
+      }
+   }
+
+   m_tile->setImageRectangle(tileRect);
+   if(m_withinRangeFlag == ossimBandSelectorWithinRangeFlagState_NOT_SET)
+   {
+      m_withinRangeFlag = ((outputBandsWithinInputRange() == true) ?
+                            ossimBandSelectorWithinRangeFlagState_IN_RANGE:
+                            ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE);
+   }
+   if(m_withinRangeFlag == ossimBandSelectorWithinRangeFlagState_OUT_OF_RANGE)
+   {
+      m_tile->makeBlank();
+      return m_tile;
+   }
+
+   if ( !t.valid() ||
+        (t->getDataObjectStatus() == OSSIM_EMPTY) ||
+        (t->getDataObjectStatus() == OSSIM_NULL))
+   {
+      //---
+      // Since we're enabled, we must return our tile not "t" so the
+      // correct number of bands goes through the chain.
+      //---
+      m_tile->makeBlank();
+      return m_tile;
+   }
+
+   // Copy selected bands to our tile.
+   for ( ossim_uint32 i = 0; i < m_outputBandList.size(); ++i)
+   {
+      m_tile->assignBand(t.get(), m_outputBandList[i], i);
+   }
+   
+   m_tile->validate();
+
+   return m_tile;
+}
+
+void ossimBandSelector::setThreeBandRgb()
+{
+   m_outputBandList.clear();
+   m_delayLoadRgbFlag = true;
+   initialize();
+}
+
+void ossimBandSelector::setOutputBandList( const vector<ossim_uint32>& outputBandList,
+                                           bool disablePassThru)
+{
+   if ( outputBandList.size() )
+   {
+      m_outputBandList = outputBandList;  // Assign the new list.
+      if ( !disablePassThru )
+      {
+         bool setBands = false;
+         ossimRefPtr<ossimImageHandler> ih = getBandSelectableImageHandler();
+         if ( ih.valid() )
+         {
+            // Our input is a single image chain that can do band selection.
+            if ( ih->setOutputBandList( outputBandList ) )
+            {
+               m_passThroughFlag = true;
+               setBands = true;
+               m_tile = 0; // Don't need.
+            }
+         }
+
+         if ( setBands == false )
+         {
+            if ( m_tile.valid() )
+            {
+               // Check the tile band size and scalar.
+               if ( ( m_tile->getNumberOfBands() != outputBandList.size() ) ||
+                    ( m_tile->getScalarType() != theInputConnection->getOutputScalarType() ) )
+               {
+                  m_tile = 0;       // Force an allocate call next getTile.
+               }
+            }
+            m_withinRangeFlag = ossimBandSelectorWithinRangeFlagState_NOT_SET;
+            checkPassThrough();
+            //theOrderedCorrectlyFlag = isOrderedCorrectly();
+         }
+      }
+   }
+}
+
+ossim_uint32 ossimBandSelector::getNumberOfOutputBands() const
+{
+   ossim_uint32 bands;
+   
+   if(isSourceEnabled())
+   {
+      bands = static_cast<ossim_uint32>(m_outputBandList.size());
+   }
+   else
+   {
+      //---
+      // Note:
+      // This returns theInputConnection->getNumberOfOutputBands() which is our
+      // input.  Calling ossimBandSelector::getNumberOfInputBands() will produce
+      // an error if we are bypassed due to a band selectable image handler.
+      //---
+      bands = ossimImageSourceFilter::getNumberOfInputBands();
+   }
+
+   return bands;
+}
+
+ossim_uint32 ossimBandSelector::getNumberOfInputBands() const
+{
+   ossim_uint32 bands;
+
+   // See if we have a single image chain with band selectable image handler.
+   ossimRefPtr<ossimImageHandler> ih = getBandSelectableImageHandler();
+   if ( ih.valid() )
+   {
+      bands = ih->getNumberOfInputBands();
+   }
+   else
+   {
+      bands = ossimImageSourceFilter::getNumberOfInputBands();
+   }
+   
+   return bands;
+}
+
+
+void ossimBandSelector::initialize()
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimBandSelector::initialize() entered...\n";
+   }
+      
+   // Base class will recapture "theInputConnection".
+   ossimImageSourceFilter::initialize();
+
+   m_withinRangeFlag = ossimBandSelectorWithinRangeFlagState_NOT_SET;
+
+   if(theInputConnection)
+   {
+      if ( !m_outputBandList.size() ) 
+      {
+         // First time through...
+         if ( m_delayLoadRgbFlag )
+         {
+            //---
+            // "bands" key was set to "rgb" or "default" in loadState but there
+            // was not a connection to derive rgb bands from image handler.
+            //---
+            if ( getRgbBandList( m_outputBandList ) == false )
+            {
+               //---
+               // Could not derive from input. Assuming caller wanted three bands.
+               // Call to checkPassThrough()->outputBandsWithinInputRange()
+               // will check the range of output band list.
+               //---
+               if( theInputConnection->getNumberOfOutputBands() > 2 )
+               {
+                  m_outputBandList.resize(3);
+                  m_outputBandList[0] = 0;
+                  m_outputBandList[1] = 1;
+                  m_outputBandList[2] = 2;
+               }
+               else
+               {
+                 m_outputBandList.resize(1);
+                 m_outputBandList[0] = 0;
+               }
+            }
+            
+            m_delayLoadRgbFlag = false; // clear flag.
+         }
+
+         if ( !m_outputBandList.size() )
+         {
+            // Set the output band list to input if not set above.
+            theInputConnection->getOutputBandList( m_outputBandList );
+         }
+         
+         if( m_outputBandList.size() )
+         {
+            // Call to setOutputBandList configures band selector.
+            setOutputBandList(m_outputBandList); 
+         } 
+         
+      } // if ( !m_outputBandList.size() )
+      
+   } // if(theInputConnection)
+
+   if ( !isSourceEnabled() )
+   {
+      m_tile = 0;
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimBandSelector::initialize() exited...\n";
+   }
+}
+
+void ossimBandSelector::allocate()
+{
+   //initialize(); // Update the connection.
+   //theOrderedCorrectlyFlag = isOrderedCorrectly();
+   m_tile = ossimImageDataFactory::instance()->create(this, this);
+   m_tile->initialize();
+}
+
+bool ossimBandSelector::isSourceEnabled()const
+{
+   bool result = ossimImageSourceFilter::isSourceEnabled();
+   if(result)
+   {
+      // if I am not marked to pass information on through then enable me
+      result = !m_passThroughFlag;
+   }
+   
+   return result;
+}
+
+double ossimBandSelector::getMinPixelValue(ossim_uint32 band)const
+{
+   if(theInputConnection)
+   {
+      if (isSourceEnabled())
+      {
+         if(band < m_outputBandList.size())
+         {
+            return theInputConnection->
+               getMinPixelValue(m_outputBandList[band]);
+         }
+         else
+         {
+            return theInputConnection->getMinPixelValue(band);
+         }
+      }
+      else
+      {
+         return theInputConnection->getMinPixelValue(band);
+      }
+   }
+   return 0;
+}
+
+double ossimBandSelector::getNullPixelValue(ossim_uint32 band)const
+{
+   if(theInputConnection)
+   {
+      if (isSourceEnabled())
+      {
+         if(band < m_outputBandList.size())
+         {
+            return theInputConnection->
+               getNullPixelValue(m_outputBandList[band]);
+         }
+         else
+         {
+            return theInputConnection->getNullPixelValue(band);
+         }
+      }
+      else
+      {
+         return theInputConnection->getNullPixelValue(band);
+      }
+   }
+   
+   return 0;
+}
+
+double ossimBandSelector::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(theInputConnection)
+   {
+      if (isSourceEnabled())
+      {
+         if(band < m_outputBandList.size())
+         {
+            return theInputConnection->
+               getMaxPixelValue(m_outputBandList[band]);
+         }
+         else
+         {
+            return theInputConnection->getMaxPixelValue(band);
+         }
+      }
+      else
+      {
+        return theInputConnection->getMaxPixelValue(band);
+      }
+   }
+   return 1.0/DBL_EPSILON;
+}
+
+bool ossimBandSelector::saveState(ossimKeywordlist& kwl,
+                                  const char* prefix)const
+{
+   ossimString temp;
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
+           static_cast<int>(m_outputBandList.size()),
+           true);
+   
+   ossimString bandsString;
+   ossim::toSimpleStringList(bandsString,
+                             m_outputBandList);
+   kwl.add(prefix,
+           ossimKeywordNames::BANDS_KW,
+           bandsString,
+           true);
+/*   
+   for(ossim_uint32 counter = 0; counter < m_outputBandList.size();counter++)
+   {
+      temp  = ossimKeywordNames::BAND_KW;
+      temp += ossimString::toString(counter+1);
+      
+      kwl.add(prefix,
+              temp.c_str(),
+              ossimString::toString(m_outputBandList[counter]+1).c_str());
+   }
+*/   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimBandSelector::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix)
+{
+   bool result = false;
+   
+   ossimImageSourceFilter::loadState(kwl, prefix);
+
+   m_outputBandList.clear();
+   
+   ossimString copyPrefix = prefix;
+   
+   ossimString bands = kwl.find(prefix, ossimKeywordNames::BANDS_KW);
+   if(!bands.empty())
+   {
+      ossimString bs = bands;
+      bs.downcase();
+      if ( (bs == "rgb" ) || (bs == "default"))
+      {
+         // Flag initialize() to set the band list on first connection.
+         m_delayLoadRgbFlag = true;
+      }
+      else
+      {
+         // Load from key:value, e.g. bands:(2,1,0)
+         ossim::toSimpleVector(m_outputBandList, bands);
+         result = true;
+      }
+   }
+   else
+   {
+      ossimString regExpression =  ossimString("^(") + copyPrefix + "band[0-9]+)";
+      
+      vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
+      long numberOfBands = (long)keys.size();
+      ossim_uint32 offset = (ossim_uint32)(copyPrefix+"band").size();
+      std::vector<int>::size_type idx = 0;
+      std::vector<int> numberList(numberOfBands);
+      for(idx = 0; idx < keys.size();++idx)
+      {
+         ossimString numberStr(keys[idx].begin() + offset,
+                               keys[idx].end());
+         numberList[idx] = numberStr.toInt();
+      }
+      std::sort(numberList.begin(), numberList.end());
+      for(idx=0;idx < numberList.size();++idx)
+      {
+         const char* bandValue =
+         kwl.find(copyPrefix,
+                  ("band"+ossimString::toString(numberList[idx])).c_str());
+         m_outputBandList.push_back( ossimString(bandValue).toLong()-1);
+      }
+      result = true;
+   }
+
+   initialize();
+   
+   return result;
+}
+
+void ossimBandSelector::checkPassThrough()
+{
+   m_passThroughFlag = ((theInputConnection == 0)||!outputBandsWithinInputRange());
+   
+   // check if marked with improper bands
+   if(m_passThroughFlag) return;
+   
+   if(theInputConnection)
+   {
+      std::vector<ossim_uint32> inputList;
+      theInputConnection->getOutputBandList(inputList);
+
+      if ( inputList.size() == m_outputBandList.size() )
+      {
+         const std::vector<ossim_uint32>::size_type SIZE =
+            m_outputBandList.size();
+      
+         std::vector<ossim_uint32>::size_type i = 0;
+         while (i < SIZE)
+         {
+            if ( inputList[i] != m_outputBandList[i] )
+            {
+               break;
+            }
+            ++i;
+         }
+         if (i == SIZE)
+         {
+            m_passThroughFlag = true;
+         }
+      }
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimBandSelector::isOrderedCorrectly() ERROR:"
+         << "Method called prior to initialization!\n";
+      }
+   }
+
+}
+
+bool ossimBandSelector::outputBandsWithinInputRange() const
+{
+   bool result = false;
+   
+   if(theInputConnection)
+   {
+      result = true;
+      const ossim_uint32 HIGHEST_BAND = getNumberOfInputBands() - 1;
+      const ossim_uint32 OUTPUT_BANDS = (ossim_uint32)m_outputBandList.size();
+      for (ossim_uint32 i=0; i<OUTPUT_BANDS; ++i)
+      {
+         if (m_outputBandList[i] > HIGHEST_BAND)
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimBandSelector::outputBandsWithinInputRange() ERROR:"
+               << "Output band greater than highest input band. "
+               << m_outputBandList[i] << " > " << HIGHEST_BAND << "."
+               << std::endl;
+            }
+            result = false;
+            break;
+         }
+      }
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimBandSelector::outputBandsWithinInputRange() ERROR:"
+         << "Method called prior to initialization!" << std::endl;
+      }
+   }
+   return result;
+}
+
+void ossimBandSelector::getOutputBandList(std::vector<ossim_uint32>& bandList) const
+{
+   if ( isSourceEnabled()&&m_outputBandList.size() )
+   {
+      bandList = m_outputBandList;
+   }
+   else if (theInputConnection)
+   {
+      theInputConnection->getOutputBandList(bandList);
+   }
+   else
+   {
+      bandList.clear();
+   }
+}
+
+ossimString ossimBandSelector::getLongName()const
+{
+   return ossimString("Band Selector, maps an input band to the output band.");
+}
+
+ossimString ossimBandSelector::getShortName()const
+{
+   return ossimString("Band Selector");
+}
+
+void ossimBandSelector::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if( property.valid() )
+   {
+      if(property->getName() == "bands")
+      {
+         std::vector<ossim_uint32> selection;
+         if(ossim::toSimpleVector(selection, property->valueToString()))
+         {
+            m_outputBandList = selection;
+            setOutputBandList( m_outputBandList );
+         }
+      }
+      else if(property->getName() == "bandSelection")
+      {
+         ossimString str = property->valueToString();
+         std::vector<ossimString> str_vec;
+         std::vector<ossim_uint32> int_vec;
+         
+         str.split( str_vec, " " );
+         
+         for ( ossim_uint32 i = 0; i < str_vec.size(); ++i )
+         {
+            if(!str_vec[i].empty())
+            {
+               int_vec.push_back( str_vec[i].toUInt32() );
+            }
+         }
+         setOutputBandList( int_vec );
+      }
+      else
+      {
+         ossimImageSourceFilter::setProperty(property);
+      }
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimBandSelector::getProperty(const ossimString& name)const
+{
+   if( name == "bands" )
+   {
+      ossimString bandsString;
+      ossim::toSimpleStringList(bandsString,
+                                m_outputBandList);
+      ossimStringProperty* stringProp = new ossimStringProperty(name, bandsString);
+      
+      stringProp->clearChangeType();
+      stringProp->setReadOnlyFlag(false);
+      stringProp->setCacheRefreshBit();
+      
+      return stringProp;
+   }
+   else if( name == "bandSelection" )
+   {
+      std::vector<ossim_uint32> bands;
+	  
+      getOutputBandList( bands );
+      
+      std::vector<ossimString> bandNames;
+      
+      for(ossim_uint32 i = 0; i < bands.size(); i++)
+      {
+         bandNames.push_back( ossimString::toString( bands[i] ) );
+      }
+      
+      ossimString str;
+      
+      str.join( bandNames, " " );
+      
+      ossimStringProperty* stringProp = new ossimStringProperty(name, str);
+      
+      stringProp->clearChangeType();
+      stringProp->setReadOnlyFlag(false);
+      stringProp->setCacheRefreshBit();
+      
+      return stringProp;
+   }
+
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimBandSelector::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back("bands");
+}
+
+ossimRefPtr<ossimImageHandler> ossimBandSelector::getBandSelectableImageHandler() const
+{
+   ossimRefPtr<ossimImageHandler> ih = 0;
+
+   if ( theInputConnection )
+   {
+      /**
+       * GP: We will only allow the immediate input check for an image handler
+       * and if one is present then check if selectable
+       */
+      ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
+                                   true,
+                                   ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+      ossimTypeNameVisitor bandSelectorVisitor(ossimString("ossimBandSelector"),
+                                   true,
+                                   ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+      
+      theInputConnection->accept(visitor);
+      theInputConnection->accept(bandSelectorVisitor);
+      // if there is a band selector before us then do not 
+      // set the image handler
+      if(bandSelectorVisitor.getObjects().size() < 1)
+      {
+         // If there are multiple image handlers, e.g. a mosaic do not uses.
+         if ( visitor.getObjects().size() == 1 )
+         {
+            ih = visitor.getObjectAs<ossimImageHandler>( 0 );
+            if ( ih.valid() )
+            {
+               if ( ih->isBandSelector() == false )
+               {
+                  ih = 0;
+               }
+            }
+         }
+
+      }
+      
+   } // Matches: if ( theInputConnection )
+   return ih;
+   
+} // End: ossimBandSelector::getBandSelectableImageHandler()
+
+bool ossimBandSelector::getRgbBandList(std::vector<ossim_uint32>& bandList) const
+{
+   bool result = false;
+   
+   if ( theInputConnection )
+   {
+      ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
+                                   true,
+                                   ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+      
+      theInputConnection->accept(visitor);
+
+      // If there are multiple image handlers, e.g. a mosaic do not uses.
+      if ( visitor.getObjects().size() == 1 )
+      {
+         ossimRefPtr<ossimImageHandler> ih = visitor.getObjectAs<ossimImageHandler>( 0 );
+         if ( ih.valid() )
+         {
+            result = ih->getRgbBandList( bandList );
+         }
+      }
+      
+   } // Matches: if ( theInputConnection )
+
+   return result;
+   
+} // End: ossimBandSelector::getRgbBandList( ... )
diff --git a/src/imaging/ossimBandSeparateHandler.cpp b/src/imaging/ossimBandSeparateHandler.cpp
new file mode 100644
index 0000000..6d4c5be
--- /dev/null
+++ b/src/imaging/ossimBandSeparateHandler.cpp
@@ -0,0 +1,283 @@
+//*************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+// 
+// Image handler used when the multi-band image has each band represented by a different disk file.
+// This is the case for some Ikonos imagery. 
+//
+//*************************************************************************************************
+//  $Id: ossimBandSeparateHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#include <ossim/imaging/ossimBandSeparateHandler.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <algorithm>
+
+RTTI_DEF1(ossimBandSeparateHandler, "ossimBandSeparateHandler", ossimImageHandler)
+
+//*************************************************************************************************
+//!  Constructor (default):
+//*************************************************************************************************
+ossimBandSeparateHandler::ossimBandSeparateHandler()
+{ }
+
+//*************************************************************************************************
+//! Destructor:
+//*************************************************************************************************
+ossimBandSeparateHandler::~ossimBandSeparateHandler()
+{
+   close();
+}
+
+//*************************************************************************************************
+// Opens multiple band-files based on info in metadata file.
+//*************************************************************************************************
+bool ossimBandSeparateHandler::open()
+{
+   if (isOpen())
+      close();
+
+   // Fetch the list of band filenames:
+   vector<ossimFilename> file_names;
+   getBandFileNames(file_names);
+
+   // There should be a list of filenames populated:
+   if (file_names.size() == 0)
+      return false;
+
+   m_mergeSource = new ossimBandMergeSource;
+   ossimRefPtr<ossimImageHandler> handler = 0;
+   for (ossim_uint32 band=0; band<file_names.size(); ++band)
+   {
+      // Open input band file:
+      handler = ossimImageHandlerRegistry::instance()->open(file_names[band], true, false);
+      if (!handler.valid())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<"ossimBandSeparateHandler::open() -- "
+            "Expected to find band file at <"<<file_names[band]<<"> but could not open file."
+            " Image not opened."<<endl;
+         close();
+         return false;
+      }
+
+      // Add this band file to the merge source:
+      m_bandFiles.push_back(handler);
+      m_mergeSource->connectMyInputTo(band, handler.get());
+   }
+
+   completeOpen();
+   return true;
+}
+
+//*************************************************************************************************
+//! Deletes the overview and clears the valid image vertices.  Derived
+//! classes should implement.
+//*************************************************************************************************
+void ossimBandSeparateHandler::close()
+{
+   vector<ossimRefPtr<ossimImageHandler> >::iterator iter = m_bandFiles.begin();
+   while (iter != m_bandFiles.end())
+   {
+      (*iter)->close();
+      *iter = 0;
+      ++iter;
+   }
+   m_bandFiles.clear();
+   m_mergeSource = 0;
+}
+
+//*************************************************************************************************
+//! Derived classes must implement this method to be concrete.
+//! @return true if open, false if not.
+//*************************************************************************************************
+bool ossimBandSeparateHandler::isOpen()const
+{
+   if (m_bandFiles.size() > 0)
+      return true;
+
+   return false;
+}
+
+//*************************************************************************************************
+//! Fills the requested tile by pulling pixels from multiple file tiles as needed.
+//*************************************************************************************************
+ossimRefPtr<ossimImageData> ossimBandSeparateHandler::getTile(const ossimIrect& tile_rect, 
+                                                              ossim_uint32 resLevel)
+{
+   // First verify that there are band-files available:
+   if ((m_bandFiles.size() == 0) || !m_mergeSource.valid())
+      return ossimRefPtr<ossimImageData>();
+
+   // Check if res level represents data in the overview:
+   if (theOverview.valid() && (resLevel > 0))
+      return theOverview->getTile(tile_rect, resLevel);
+
+   // Just pass getTile call on to contained bandMergeSource:
+   return m_mergeSource->getTile(tile_rect, resLevel);
+}
+
+//*************************************************************************************************
+//! @param resLevel Reduced resolution level to return lines of.
+//! Default = 0
+//! @return The number of lines for specified reduced resolution level.
+//*************************************************************************************************
+ossim_uint32 ossimBandSeparateHandler::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   if ((m_bandFiles.size() == 0))
+      return 0;
+
+   // Using simple decimation by powers of 2:
+   ossim_uint32 numlines = m_bandFiles[0]->getNumberOfLines() >> resLevel;
+   return numlines;
+}
+
+//*************************************************************************************************
+//! @param resLevel Reduced resolution level to return samples of.
+//! Default = 0
+//! @return The number of samples for specified reduced resolution level.
+//*************************************************************************************************
+ossim_uint32 ossimBandSeparateHandler::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   if ((m_bandFiles.size() == 0))
+      return 0;
+
+   // Using simple decimation by powers of 2:
+   ossim_uint32 numsamps = m_bandFiles[0]->getNumberOfSamples() >> resLevel;
+   return numsamps;
+}
+
+//*************************************************************************************************
+//! Method to save the state of an object to a keyword list.
+//! Return true if ok or false on error.
+//*************************************************************************************************
+bool ossimBandSeparateHandler::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+//*************************************************************************************************
+//! Method to the load (recreate) the state of an object from a keyword
+//! list.  Return true if ok or false on error.
+//*************************************************************************************************
+bool ossimBandSeparateHandler::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (!ossimImageHandler::loadState(kwl, prefix))
+      return false;
+
+   return open();
+}
+
+//*************************************************************************************************
+// Returns the number of bands of the first tile since all tiles need to have the same pixel type.
+//*************************************************************************************************
+ossim_uint32 ossimBandSeparateHandler::getNumberOfInputBands() const
+{
+   return (ossim_uint32) m_bandFiles.size();
+}
+
+//*************************************************************************************************
+//! Returns scalar type of first tile (should be the same for all tiles)
+//*************************************************************************************************
+ossimScalarType ossimBandSeparateHandler::getOutputScalarType() const
+{
+   if ((m_bandFiles.size() == 0) || (!m_bandFiles[0].valid()))
+      return OSSIM_SCALAR_UNKNOWN;
+
+   return m_bandFiles[0]->getOutputScalarType();
+}
+
+//*************************************************************************************************
+//! Overrides base connection method to connect output of merge source.
+// Returns TRUE if connection possible
+//*************************************************************************************************
+bool ossimBandSeparateHandler::canConnectMyOutputTo(ossim_int32 index, 
+                                                    const ossimConnectableObject* obj)
+{
+   if (!m_mergeSource.valid())
+      return false;
+
+   return m_mergeSource->canConnectMyOutputTo(index, obj);
+}
+
+//*************************************************************************************************
+//! Fetches the list of band file names from the header file. The header file name is contained
+//! in ossimImageHandler::theImageFile.
+//! NOTE TO PROGRAMMER: This class is presently tailored to the Ikonos metadata file specifying
+//! the individual band files. If other "metadata" formats are to be supported, then this class
+//! should be derived from. This method would therefore be pure virtual in this base-class and only 
+//! this method would need to be implemented in the derived classes.
+//*************************************************************************************************
+void ossimBandSeparateHandler::getBandFileNames(vector<ossimFilename>& file_names)
+{
+   file_names.clear();
+
+   // Ikonos expects metadata file with text extension:
+   if (theImageFile.ext() != "txt")
+      return;
+
+   // Attempt to open the metadata file:
+   ifstream is (theImageFile.chars());
+   if (is.fail())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimBandSeparateHandler::open() -- "
+         "Cannot open text file at <"<<theImageFile<<">. Image not opened."<<endl;
+      return;
+   }
+
+   vector<ossimString> fname_list;
+   const ossimString separator (" ");
+   char line_buf[4096];
+   while (!is.eof())
+   {
+      is.getline(line_buf, 4096);
+      ossimString line_str (line_buf);
+
+      // Look for mention of multiple band files. It must indicate "separate files". This comes 
+      // before the list of band files:
+      if (line_str.contains("Multispectral Files:"))
+      {
+         if (!line_str.contains("Separate Files"))
+            return;
+      }
+
+      // Look for list of band files:
+      if (line_str.contains("Tile File Name:"))
+      {
+         ossimString file_list_str = line_str.after(":");
+         file_list_str.split(fname_list, separator, true);
+         break;
+      }
+   }
+   is.close();
+
+   // Set the path of individual band files to match metadata file path:
+   ossimFilename pathName (theImageFile.path());
+   for (size_t i=0; i<fname_list.size(); ++i)
+   {
+      ossimFilename fname (fname_list[i]);
+      fname.setPath(pathName);
+      file_names.push_back(fname);
+   }
+}
+
+//*************************************************************************************************
+//! Returns the geometry of the first band.
+//*************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimBandSeparateHandler::getImageGeometry()
+{
+   if ((m_bandFiles.size() == 0) || (!m_bandFiles[0].valid()))
+      return 0;
+
+   return m_bandFiles[0]->getImageGeometry();
+}
diff --git a/src/imaging/ossimBitMaskTileSource.cpp b/src/imaging/ossimBitMaskTileSource.cpp
new file mode 100644
index 0000000..d2ba39b
--- /dev/null
+++ b/src/imaging/ossimBitMaskTileSource.cpp
@@ -0,0 +1,385 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+//
+// Contains class definition for ossimBitMaskTileSource.
+//*******************************************************************
+//  $Id: ossimBitMaskTileSource.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#include <ossim/imaging/ossimBitMaskTileSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimInterleaveTypeLut.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimBitMaskWriter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <cmath>
+
+RTTI_DEF1_INST(ossimBitMaskTileSource, "ossimBitMaskTileSource", ossimImageHandler);
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimBitMaskTileSource::ossimBitMaskTileSource()
+   :
+   ossimImageHandler(),
+   m_tile(NULL)
+{
+}
+
+//*************************************************************************************************
+// Destructor must free the buffers for each res level
+//*************************************************************************************************
+ossimBitMaskTileSource::~ossimBitMaskTileSource()
+{
+   close();
+}
+
+//*************************************************************************************************
+// Reset
+//*************************************************************************************************
+void ossimBitMaskTileSource::close()
+{
+   ossimImageHandler::close();  // base class
+
+   // Wipe the mask buffers:
+   vector<ossim_uint8*>::iterator iter = m_buffers.begin();
+   while (iter != m_buffers.end())
+   {
+      delete [] (*iter);
+      iter++;
+   }
+   m_buffers.clear();
+   m_bufferSizes.clear();
+   m_tile = NULL;
+}
+
+//*************************************************************************************************
+// Opens an OSSIM Bit Mask raster file. This is a custom formatted file with header info
+//**************************************************************************************************
+bool ossimBitMaskTileSource::open()
+{
+   static const char MODULE[] = "ossimBitMaskTileSource::open()";
+
+   if (!isSupportedExtension())
+   {
+      close();
+      return false;
+   }
+
+   close();
+
+   // Open the mask file and verify magic number, read header info as well and verify good values:
+   std::ifstream fileStream(theImageFile.chars(), ios::in|ios::binary);
+   if (!fileStream.good())
+      return false;
+   ossimString magic_number;
+   int num_res_levels = 0;
+   char space;
+   fileStream >> magic_number;
+   if (magic_number == ossimBitMaskWriter::MASK_FILE_MAGIC_NUMBER)
+   {
+      // This is a next-generation mask file with header:
+      fileStream >> theStartingResLevel >> num_res_levels;
+      for (int r=0; r<num_res_levels; r++)
+      {
+         ossimIpt buffer_size;
+         fileStream >> buffer_size.x >> buffer_size.y;
+         m_bufferSizes.push_back(buffer_size);
+      }
+      fileStream >> space;
+   }
+   else
+   {
+      // This is the old headerless "Ming mask" format. Need to query the source image for image size.
+      // This format implies a starting res level of 1:
+      if (!m_handler.valid())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << MODULE << " ERROR:\nInput file <"<<theImageFile<<"> has no header information and "
+            "no valid source image has been provided. Cannot process mask" << std::endl;
+         fileStream.close();
+         close();
+         return false;
+      }
+      theStartingResLevel = 1;
+      num_res_levels = m_handler->getNumberOfDecimationLevels() - 1;
+      fileStream.seekg(0);
+
+      // Need to compute buffer sizes since they are not available in the mask header:
+      ossimIpt image_size = m_handler->getBoundingRect(1).size();
+      ossimIpt buffer_size ((image_size.x+7)/8, image_size.y);
+      for (int r=0; r<num_res_levels; r++)
+      {
+          m_bufferSizes.push_back(buffer_size);
+          buffer_size.x = (buffer_size.x+1)/2;
+          buffer_size.y = (buffer_size.y+1)/2;
+      }
+   }
+
+   if (m_bufferSizes.empty())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << MODULE << " ERROR:\nInput file <"<<theImageFile<<"> is not recognized or has invalid "
+         "header information." << std::endl;
+      fileStream.close();
+      close();
+      return false;
+   }
+
+   // Good to go, Need to now establish sizes for and offsets to each res level:
+   for (int r=0; r<num_res_levels; ++r)
+   {
+      // Allocate buffer for this res level:
+      ossim_uint32 size = m_bufferSizes[r].x * m_bufferSizes[r].y; 
+      ossim_uint8* buffer = new ossim_uint8[size];
+      m_buffers.push_back((ossim_uint8*) buffer);
+
+      // Read from disk:
+      fileStream.read((char*)buffer, size);
+      if (fileStream.fail())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << MODULE << " ERROR:"
+            << "\nError encountered reading mask file <" << theImageFile << ">"<<std::endl;
+         fileStream.close();
+         close();
+         return false;
+      }
+   }
+
+   fileStream.close();
+
+   // Allocate the mask tile. This will be 8-bits per pixel (i.e., decompressed):
+   m_tile = ossimImageDataFactory::instance()->create(this, this);
+   m_tile->initialize();
+
+   // Computes decimation factors for additional reduced res sets:
+   establishDecimationFactors();
+
+   return true;
+}
+
+//**************************************************************************************************
+// "Open" here means only that the mask buffers are valid and ready for access
+//**************************************************************************************************
+bool ossimBitMaskTileSource::isOpen() const
+{
+   return ((m_buffers.size() != 0) || (m_maskWriter.valid()));
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimBitMaskTileSource::isSupportedExtension()
+{
+   ossimString ext = theImageFile.ext();
+   if (ext == "mask")
+      return true;
+
+   return false;
+}
+
+//*************************************************************************************************
+// Unpacks the mask data into a destination tile
+//*************************************************************************************************
+ossimRefPtr<ossimImageData> ossimBitMaskTileSource::getTile(const ossimIrect& tile_rect, 
+                                                            ossim_uint32 resLevel)
+{
+   static const ossim_uint8 MASK_BITS[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
+
+   // Allocate the mask tile. This will be 8-bits per pixel (i.e., decompressed):
+   if (!m_tile.valid())
+   {
+      m_tile = ossimImageDataFactory::instance()->create(this, this);
+      m_tile->initialize();
+   }
+
+   // Initial screening:
+   if (!(isOpen() && isSourceEnabled() && isValidRLevel(resLevel)))
+      return NULL;
+
+   // Check if requested rect falls inside valid mask area:
+   if (!getImageRectangle(resLevel).intersects(tile_rect))
+      return NULL;
+
+   // Check if tile size matches requested size:
+   if ((m_tile->getWidth() != tile_rect.width()) || (m_tile->getHeight() != tile_rect.height()))
+   {
+      m_tile->setWidthHeight(tile_rect.width(), tile_rect.height());
+      m_tile->initialize();
+   }
+   m_tile->setImageRectangle(tile_rect);
+
+   // Start with blank tile if rect partially intersects defined mask area:
+   ossimIrect image_rect (getImageRectangle(resLevel));
+   if (!tile_rect.completely_within(image_rect))
+      m_tile->makeBlank();
+   
+   //##### START DEBUG CODE #########################
+   // This else if identifies unassigned mask pixels being returned by this method incorrectly.
+   // See ossimMaskFilter::executeMaskFilterSelection() (OLK 2/11)
+   //m_tile->fill(128.0);//###
+   //##### END DEBUG CODE #########################
+
+   ossimIpt image_size (image_rect.size());
+   ossim_uint32 num_mask_cols = (image_size.x+7)/8; 
+   ossim_uint8* tilebuf = (ossim_uint8*) m_tile->getBuf(0);
+   ossim_uint32 tile_index = 0, mask_index = 0, start_bit=0;
+   ossimIpt ul (tile_rect.ul());
+   ossimIpt lr (tile_rect.lr());
+
+   // Decide if we use our own mask buffer (read from file) or borrow tha active mask writer's
+   // buffer:
+   ossim_uint8* maskbuf;
+   if (m_maskWriter.valid())
+      maskbuf = m_maskWriter->m_buffers[resLevel-theStartingResLevel];
+   else
+      maskbuf = m_buffers[resLevel-theStartingResLevel];
+
+   // Nested loop to fill tile:
+   for (int y=ul.y; (y<=lr.y)&&(y<image_size.y); y++)
+   {
+      mask_index = y*num_mask_cols + ul.x/8;
+      start_bit = ul.x % 8; // may not start on even mask byte boundary
+      for (int x=ul.x; x<=lr.x;)
+      {
+         if (x < image_size.x)
+         {
+            // fetch mask pixel and isolate bit of interest:
+            for (ossim_uint32 mask_bit=start_bit; mask_bit<8; ++mask_bit)
+            {
+               if (maskbuf[mask_index] & MASK_BITS[mask_bit])
+                  tilebuf[tile_index++] = 255;
+               else
+                  tilebuf[tile_index++] = 0;
+
+               // Advance the pixel column and check for end of image rect:
+               ++x;
+               if ((x >= image_size.x) || (x>lr.x))
+                  break;
+            }
+
+            ++mask_index; // advance the mask buffer index 1 after processing 8 tile samples
+            start_bit = 0;
+         }
+         else
+         {
+            // Tile buffer extends beyond valid mask rect, so assume it is masked (0):
+            tilebuf[tile_index++] = 0;
+            ++x;
+         }
+      }
+   }
+   
+   m_tile->validate();
+   return m_tile;
+}
+
+//*******************************************************************
+// Argument res_Level is relative to the full image
+//*******************************************************************
+bool ossimBitMaskTileSource::isValidRLevel(ossim_uint32 res_Level) const
+{
+   ossim_uint32 num_rlevels;
+   if (m_maskWriter.valid())
+      num_rlevels = (ossim_uint32) m_maskWriter->m_buffers.size();
+   else
+      num_rlevels = (ossim_uint32) m_buffers.size();
+
+   return ((res_Level >= theStartingResLevel) && 
+           ((res_Level-theStartingResLevel) < num_rlevels));
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimBitMaskTileSource::getNumberOfLines(ossim_uint32 res_Level) const
+{
+   if (!isValidRLevel(res_Level))
+      return 0;
+
+   if (m_maskWriter.valid())
+      return m_maskWriter->m_bufferSizes[res_Level-theStartingResLevel].y;
+
+   return m_bufferSizes[res_Level-theStartingResLevel].y;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimBitMaskTileSource::getNumberOfSamples(ossim_uint32 res_Level) const
+{
+   if (!isValidRLevel(res_Level))
+      return 0;
+
+   ossim_uint32 n = 0;
+   if (m_maskWriter.valid())
+      n = m_maskWriter->m_bufferSizes[res_Level-theStartingResLevel].x;
+   else
+      n = m_bufferSizes[res_Level-theStartingResLevel].x;
+
+   return n*8; // 8 pixels represented in one mask byte entry
+}
+
+ossimRefPtr<ossimImageGeometry> ossimBitMaskTileSource::getImageGeometry()
+{
+   return 0;
+}
+
+//*******************************************************************
+//! Overrides base class implementation.
+//*******************************************************************
+ossim_uint32 ossimBitMaskTileSource::getNumberOfDecimationLevels() const
+{
+   return (ossim_uint32) theDecimationFactors.size();
+}
+
+//*******************************************************************
+//! Overrides base class implementation.
+//*******************************************************************
+void ossimBitMaskTileSource::establishDecimationFactors()
+{
+   theDecimationFactors.clear();
+   ossim_uint32 num_res_levels = (ossim_uint32) m_buffers.size();
+   ossimDpt decimation(1, 1);
+   for (ossim_uint32 r=0; r<num_res_levels; r++)
+   {
+      theDecimationFactors.push_back(decimation);
+      decimation = decimation/2.0;
+   }
+}
+
+//*************************************************************************************************
+//! This class can be used during overview generation, in which case there will be a simultaneous
+//! mask writing. Instead of accessing a mask file (which may not yet exist), the mask buffer
+//! of the writer will be accessed directly instead of our own buffer.
+//*************************************************************************************************
+void ossimBitMaskTileSource::setAssociatedMaskWriter(ossimBitMaskWriter* maskWriter)
+{ 
+   m_maskWriter = maskWriter; 
+   if (m_maskWriter.valid())
+      theStartingResLevel = m_maskWriter->m_startingResLevel;
+}
+
+//*************************************************************************************************
+//! For backward compatibility with older mask format ("Ming Mask"), provide for associating
+//! the mask with an image handler:
+//*************************************************************************************************
+void ossimBitMaskTileSource::setAssociatedImageHandler(ossimImageHandler* handler)
+{
+   m_handler = handler;
+}
+
diff --git a/src/imaging/ossimBitMaskWriter.cpp b/src/imaging/ossimBitMaskWriter.cpp
new file mode 100644
index 0000000..854afef
--- /dev/null
+++ b/src/imaging/ossimBitMaskWriter.cpp
@@ -0,0 +1,485 @@
+//*************************************************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+// Description: Contains implementation of class for computing a mask from an input image.
+//   The mask is stored in a compressed format where one byte represents 8 bit-masks for masking
+//   8 image pixels. 
+//*************************************************************************************************
+//  $Id: ossimBitMaskWriter.cpp 3081 2011-12-22 16:34:12Z oscar.kramer $
+
+#include <ossim/imaging/ossimBitMaskWriter.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+
+const char* ossimBitMaskWriter::MASK_FILE_MAGIC_NUMBER = "OSSIM_BIT_MASK";
+const char* ossimBitMaskWriter::BM_STARTING_RLEVEL_KW = "starting_rlevel";
+
+//*************************************************************************************************
+// Constructor accepts handler to the source imagery being used to compute the mask.
+//*************************************************************************************************
+ossimBitMaskWriter::ossimBitMaskWriter()
+   :
+   m_flipper(0),
+   m_startingResLevel(0)
+{
+}
+
+//*************************************************************************************************
+// Destructor
+//*************************************************************************************************
+ossimBitMaskWriter::~ossimBitMaskWriter()
+{
+   // Make sure the mask file was written out before disappearing:
+   if (isOpen())
+      close();
+}
+
+//*************************************************************************************************
+// Returns true if buffers allocated:
+//*************************************************************************************************
+bool ossimBitMaskWriter::isOpen() const
+{
+   return (m_buffers.size() != 0);
+}
+
+//*************************************************************************************************
+// Returns true if buffers allocated:
+//*************************************************************************************************
+bool ossimBitMaskWriter::open()
+{
+   // Nothing to do yet. Eventually want to open the output stream here and write the buffer after
+   // each R-level is completed, so we don't need to keep vector of buffers in memory.
+   return true; 
+}
+
+//*************************************************************************************************
+// Reset
+//*************************************************************************************************
+void ossimBitMaskWriter::reset()
+{
+   // Wipe the mask buffers:
+   vector<ossim_uint8*>::iterator iter = m_buffers.begin();
+   while (iter != m_buffers.end())
+   {
+      delete [] (*iter);
+      iter++;
+   }
+   m_buffers.clear();
+   m_bufferSizes.clear();
+}
+
+//*************************************************************************************************
+//! Sets the NULL pixel value to consider when computing mask:
+//*************************************************************************************************
+void ossimBitMaskWriter::setBogusPixel(double pixel_value)
+{
+   if (!m_flipper.valid())
+      initializeFlipper();
+
+   m_flipper->setTargetValue(pixel_value);
+}
+
+//*************************************************************************************************
+//! Sets the range of pixels (inclusive) to be regarded as NULL pixels when computing mask
+//*************************************************************************************************
+void ossimBitMaskWriter::setBogusPixelRange(double min, double max)
+{
+   if (!m_flipper.valid())
+      initializeFlipper();
+
+   m_flipper->setTargetRange(min, max);
+}
+
+//*************************************************************************************************
+// Given a source's tile, derives the alpha mask and saves it in buffer for later writing to disk.
+//*************************************************************************************************
+void ossimBitMaskWriter::generateMask(ossimRefPtr<ossimImageData> tile, ossim_uint32 rLevel)
+{
+   static const ossim_uint8 MASK_BITS_0[] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE};
+   static const ossim_uint8 MASK_BITS_1[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
+
+   // We don't start doing anything until starting res or higher requested:
+   ossim_uint32 mask_rlevel = rLevel - m_startingResLevel;
+   if (!tile.valid())
+      return;
+
+   // We should have had this done by now, but just in case:
+   if (!m_flipper.valid())
+      initializeFlipper();
+
+   // The flipper is used to identify null pixels since it has more sophisticated filtering 
+   // than available from the tile object:
+   switch (tile->getScalarType())
+   {
+   case OSSIM_UCHAR:
+      m_flipper->flipPixels(ossim_uint8(0), tile.get(), rLevel);
+      break;
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      m_flipper->flipPixels(ossim_uint16(0), tile.get(), rLevel);
+      break;
+   case OSSIM_SSHORT16:
+      m_flipper->flipPixels(ossim_sint16(0), tile.get(), rLevel);
+      break;
+   case OSSIM_UINT32:
+      m_flipper->flipPixels(ossim_uint32(0), tile.get(), rLevel);
+      break;
+   case OSSIM_SINT32:
+      m_flipper->flipPixels(ossim_sint32(0), tile.get(), rLevel);
+      break;
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+      m_flipper->flipPixels(float(0), tile.get(), rLevel);
+      break;
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      m_flipper->flipPixels(ossim_float64(0), tile.get(), rLevel);
+      break;
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimBitMaskWriter::generateMask()-- "
+         "Unsupported scalar type!" << endl;
+      break;
+   }
+
+   ossimIpt image_size = computeImageSize(rLevel, tile.get());
+   ossim_uint32 num_mask_cols = (image_size.x+7)/8; // size of mask buffer after compression
+   ossim_uint32 num_mask_rows = image_size.y;
+   ossim_uint8* maskbuf = 0;
+
+   // Check if mask buffer for this R-level has already been allocated:
+   if (m_buffers.size() <= mask_rlevel)
+   {
+      ossim_uint32 size_of_maskbuf = num_mask_rows * num_mask_cols;
+      maskbuf = new ossim_uint8[size_of_maskbuf];
+      memset(maskbuf, 0, size_of_maskbuf);
+      m_buffers.push_back(maskbuf);
+      m_bufferSizes.push_back(ossimIpt(num_mask_cols, num_mask_rows));
+   }
+   else
+      maskbuf = m_buffers[mask_rlevel];
+
+   ossim_uint32 mask_index=0, tile_index=0, start_bit=0;
+   ossimIrect tile_rect (tile->getImageRectangle());
+   ossimIpt ul (tile_rect.ul());
+   ossimIpt lr (tile_rect.lr());
+
+   // Scan each pixel in the source tile and decide on mask value:
+   for (int y=ul.y; (y<=lr.y)&&(y<image_size.y); y++)
+   {
+      mask_index = y*num_mask_cols + ul.x/8;
+      start_bit = ul.x % 8; // may not start on even mask byte boundary
+
+      for (int x=ul.x; (x<=lr.x); /* incremented in bit loop below */ )         
+      {
+         if ( x < image_size.x )
+         {
+            // Process 8 samples and pack resultant mask into one byte:
+            maskbuf[mask_index] = 0;
+            for (ossim_uint32 mask_bit=start_bit; mask_bit<8; ++mask_bit)
+            {
+               // Decide whether to mask depending on pixel flipper outputting a NULL pixel. 
+               // if (tile->isNull(tile_index++))
+               if (tile->isNull(tile_index++))                  
+                  maskbuf[mask_index] &=  MASK_BITS_0[mask_bit];
+               else
+                  maskbuf[mask_index] |= MASK_BITS_1[mask_bit];
+               
+               // Advance the pixel column and check for end of image rect:
+               ++x;
+               if ((x >= image_size.x) || (x > lr.x))
+                  break;
+            }
+            ++mask_index; // advance the mask buffer index 1 after processing 8 tile samples
+            start_bit = 0;
+         }
+         else
+         {
+            ++x;
+            
+            ++tile_index;
+         }
+      }
+   } // Finished looping over all pixels in input tile
+
+   return;
+}
+
+//*************************************************************************************************
+//! Writes the mask file to path specified. Returns TRUE if successful.
+//*************************************************************************************************
+void ossimBitMaskWriter::close()
+{
+   static const char* MODULE = "ossimBitMaskWriter::writeMask()";
+   static const ossimString MASK_EXTENSION ("mask");
+
+   // Open the output file. Use default name if none provided.
+   if (theOutputName.empty()) // Couldn't figure out the name
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<" -- Error encountered trying to create mask file" 
+         " for writing because output file name was never initialized.";
+      return;
+   }
+
+   ofstream maskFileStream (theOutputName.chars(), ios::out|ios::binary);
+   if (!maskFileStream.is_open())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<" -- Error encountered trying to create mask file" 
+         "<"<<theOutputName<<"> for writing. Cannot write mask.";
+      return;
+   }
+
+   // Write the header info:
+   ossim_uint32 num_rlevels = (ossim_uint32) m_buffers.size();
+   maskFileStream << MASK_FILE_MAGIC_NUMBER <<" "<< m_startingResLevel <<" "<< num_rlevels<<" ";
+   for (ossim_uint32 r=0; r<num_rlevels; r++)
+      maskFileStream << m_bufferSizes[r].x <<" "<< m_bufferSizes[r].y <<" "; 
+   maskFileStream << ends;
+
+   // Loop over each res level and write buffers to disk:
+   for (ossim_uint32 rlevel = 0; rlevel<num_rlevels; ++rlevel)
+   {
+      ossim_uint32 bufsize = m_bufferSizes[rlevel].x * m_bufferSizes[rlevel].y;
+      maskFileStream.write((char*)(m_buffers[rlevel]), bufsize);
+   }
+
+   maskFileStream.close();
+   reset();
+
+   return;
+}
+
+//*************************************************************************************************
+//! Constructor accepts keywordlist with all info necessary to compute a mask. The caller will
+//! still need to call writeMask().
+//*************************************************************************************************
+bool ossimBitMaskWriter::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // static const char* MODULE = "ossimBitMaskWriter::writeMask(kwl)";
+
+   initializeFlipper();
+
+   // Fetch optional output filename:
+   theOutputName = kwl.find(prefix, ossimKeywordNames::OUTPUT_FILE_KW);
+
+   // Initialize the pixel flipper. This filter is used to identify pixels targeted for masking by
+   // remapping them to the null pixel:
+   m_flipper->loadState(kwl, prefix);
+
+   // Read Starting res level:
+   m_startingResLevel = 0;
+   ossimString kw_value = kwl.find(prefix, BM_STARTING_RLEVEL_KW);
+   if (!kw_value.empty())
+      m_startingResLevel = kw_value.toUInt32();
+
+   return true;
+}
+
+//*************************************************************************************************
+// 
+//*************************************************************************************************
+void ossimBitMaskWriter::initializeFlipper()
+{
+   if (!m_flipper.valid())
+   {
+      m_flipper = new ossimPixelFlipper();
+      m_flipper->setReplacementMode(ossimPixelFlipper::REPLACE_ONLY_FULL_TARGETS);
+      m_flipper->setTargetValue(0);
+      m_flipper->setReplacementValue(0);
+   }
+
+   // This method gets called when an input connection is made as well as other times, so keep an
+   // eye out for valid input connection:
+   if (theInputObjectList.size() != 0)
+   {
+      m_flipper->connectMyInputTo(theInputObjectList[0].get());
+   }
+}
+
+//*************************************************************************************************
+// 
+//*************************************************************************************************
+bool ossimBitMaskWriter::canConnectMyInputTo(ossim_int32 /*myInputIndex*/, 
+                                             const ossimConnectableObject* object) const
+{
+   const ossimImageSource* ois = dynamic_cast<const ossimImageSource*>(object);
+   return (ois != NULL);
+}
+
+//*************************************************************************************************
+// 
+//*************************************************************************************************
+ossim_int32 ossimBitMaskWriter::connectMyInputTo (ossimConnectableObject *inputObject, 
+                                                  bool makeOutputConnection, 
+                                                  bool createEventFlag)
+{
+   ossimImageSource* input_source = dynamic_cast<ossimImageSource*>(inputObject);
+   if (input_source == NULL)
+      return -1;
+
+   // Base class takes care of connection with this object:
+   ossimConnectableObject::connectMyInputTo(input_source, makeOutputConnection, createEventFlag);
+
+   // This input should be an image handler, but may need to search the objects inputs in case
+   // it is chained:
+   ossimImageHandler* handler = dynamic_cast<ossimImageHandler*>(input_source);
+   if (handler == NULL)
+   {
+      // Need to search:
+      ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
+                                   true,
+                                   ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+      
+      input_source->accept(visitor);
+      ossimRefPtr<ossimObject> obj = visitor.getObject();
+      if ( obj.valid() )
+      {
+         handler = dynamic_cast<ossimImageHandler*>( obj.get() );
+      }
+   }
+
+   // Should have a handler:
+   if (!handler)
+   { 
+      disconnectAllInputs();
+      return -1;
+   }
+
+   // A handler has been identified. Need the filename:
+   ossimFilename imageFile =  handler->getFilename();
+   if (imageFile.contains("ovr.tmp"))
+   {
+      // The handler is actually an overview, need some massaging to work since the overview may
+      // not have an R0 entry and R1 rect must be requested instead:
+      m_imageSize = handler->getBoundingRect(1).size() * 2; 
+      imageFile = imageFile.noExtension();
+   }
+   else
+   {
+      // This is normal image handler so it is OK to request R0 rect:
+      m_imageSize = handler->getBoundingRect(0).size(); 
+   }
+   if (theOutputName.empty())
+      theOutputName = imageFile.setExtension("mask");
+
+   // Check if the pixel flipper was initialized:
+   if (m_flipper.valid())
+      m_flipper->connectMyInputTo(input_source);
+   else
+      initializeFlipper();
+
+   return 0;
+}
+
+//*************************************************************************************************
+//! Since overviews may not yet exist when the mask is being written, we must compute the
+//! size of the mask buffer based on the original R0 image size.
+//*************************************************************************************************
+ossimIpt ossimBitMaskWriter::computeImageSize(ossim_uint32 rlevel, ossimImageData* tile) const
+{
+   if (rlevel == 0)
+      return m_imageSize;
+
+   ossimIpt isize (m_imageSize);
+   for (ossim_uint32 r=1; r<=rlevel; r++)
+   {
+      isize.x = (isize.x + 1) / 2;
+      isize.y = (isize.y + 1) / 2;
+   }
+
+   // Adjust size n X direction to even mask boundary:
+   ossimIpt tile_size (tile->getWidth(), tile->getHeight());
+   isize.x = ((int)(isize.x+7)/8) * 8;
+
+   return isize;
+}
+
+//*************************************************************************************************
+// For imagery that already has overviews built, but with artifact edge pixels (such as JP2-
+// compressed data), it is preferred to build the mask overviews directly from the R0 mask.
+// This method will build the specified number of R-levels (including R0) from the last defined
+// mask buffer. Returns TRUE if successful.
+// disk.
+//*************************************************************************************************
+bool ossimBitMaskWriter::buildOverviews(ossim_uint32 total_num_rlevels)
+{
+   // First establish the remaining number of R-levels to generate, and the last valid R-level
+   // currently in memory:
+   if (m_buffers.size() == 0)
+      return false;
+   if (m_buffers.size() == total_num_rlevels)
+      return true; // nothing to do
+   ossim_uint32 ref_rlevel = m_startingResLevel + (ossim_uint32) m_buffers.size() - 1;
+   ossim_uint32 ovr_rlevel = ref_rlevel + 1;
+
+   ossimIpt ref_size (m_bufferSizes[ref_rlevel-m_startingResLevel]);
+   ossim_uint8 *ref_buf = m_buffers[ref_rlevel-m_startingResLevel];
+   ossim_uint32 ref_index = 0, ovr_index = 0;
+   ossim_uint8 *ovr_buf = 0;
+   ossim_uint32 size_of_refbuf = ref_size.x * ref_size.y;
+
+   // Loop over all remaining res levels:
+   while (ovr_rlevel != total_num_rlevels)
+   {
+      // Allocate the buffer at this R-level:
+      ossimIpt ovr_size ((ref_size.x+1)/2, (ref_size.y+1)/2);
+      ossim_uint32 size_of_ovrbuf = ovr_size.x * ovr_size.y;
+      if (size_of_ovrbuf == 0)
+         return false;
+      ovr_buf = new ossim_uint8[size_of_ovrbuf];
+      memset(ovr_buf, 0, size_of_ovrbuf);
+      m_buffers.push_back(ovr_buf);
+      m_bufferSizes.push_back(ovr_size);
+
+      // Loop over each output overview pixel, considering the underlying rlevel (equivalent to
+      // nearest-neighbor resampling for overview at 2X decimation):
+      for (int y=0; y<ovr_size.y; y++)
+      {
+         ref_index = 2*y*ref_size.x;
+         ovr_index = y*ovr_size.x;
+
+         for (int x=0; x<ovr_size.x; x++)
+         {
+            ossim_uint8 a = 0;
+            ossim_uint8 b = 0;
+            if (ref_index < size_of_refbuf)
+            {
+               a = ref_buf[ref_index++];
+               if ((x < (ovr_size.x-1)) || !(ref_size.x & 1))
+                  b = ref_buf[ref_index++];
+            }
+            ovr_buf[ovr_index++] = ( (a & 0x80)       |
+                                    ((a & 0x20) << 1) |
+                                    ((a & 0x08) << 2) |
+                                    ((a & 0x02) << 3) |
+                                    ((b & 0x80) >> 4) |
+                                    ((b & 0x20) >> 3) |
+                                    ((b & 0x08) >> 2) |
+                                    ((b & 0x02) >> 1));
+
+         }
+      }
+
+      // Advance to next rlevel:
+      ref_buf = ovr_buf;
+      ref_size = ovr_size;
+      size_of_refbuf = size_of_ovrbuf;
+      ++ovr_rlevel;
+   }
+
+   return true;
+}
+
diff --git a/src/imaging/ossimBlendMosaic.cpp b/src/imaging/ossimBlendMosaic.cpp
new file mode 100644
index 0000000..243431b
--- /dev/null
+++ b/src/imaging/ossimBlendMosaic.cpp
@@ -0,0 +1,597 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBlendMosaic.cpp 20696 2012-03-19 12:36:40Z dburken $
+
+#include <ossim/imaging/ossimBlendMosaic.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimBlendMosaic, "ossimBlendMosaic", ossimImageMosaic)
+
+ossimBlendMosaic::ossimBlendMosaic()
+   : ossimImageMosaic(),
+     theNormResult(NULL)
+{
+}
+
+ossimBlendMosaic::ossimBlendMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
+   : ossimImageMosaic(inputSources),
+     theNormResult(NULL)
+{
+   initialize();
+}
+
+ossimBlendMosaic::~ossimBlendMosaic()
+{
+}
+
+void ossimBlendMosaic::initialize()
+{   
+   ossimImageMosaic::initialize();
+
+   allocate();
+
+   // only allocate this space if we have to
+   if(hasDifferentInputs())
+   {
+      theNormResult = new ossimImageData(this,
+                                         OSSIM_NORMALIZED_FLOAT,
+                                         theLargestNumberOfInputBands);
+      theNormResult->initialize();
+   }
+      
+   if(theWeights.size() < theInputObjectList.size())
+   {
+      for(ossim_uint32 index =(ossim_uint32)theWeights.size();
+          index < theInputObjectList.size();
+          ++index)
+      {
+         theWeights.push_back(1.0);
+      }
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimBlendMosaic::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{   
+   // ossimIpt origin = tileRect.ul();
+   if(!isSourceEnabled())
+   {
+      return ossimImageMosaic::getTile(tileRect, resLevel);
+   }
+   
+   ossim_uint32 size = getNumberOfInputs();
+   if(!theTile.get())
+   {
+      // try to initialize
+      initialize();
+
+      // if we still don't have a buffer
+      // then we will leave
+      if(!theTile.get())
+      {
+         return theTile;
+      }
+   }
+
+   if(size == 0)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+   if(size == 1)
+   {
+      return ossimImageMosaic::getTile(tileRect, resLevel);
+   }
+
+   theTile->setImageRectangle(tileRect);
+   theTile->makeBlank();
+   if(theNormResult.valid())
+   {
+      theNormResult->setImageRectangle(tileRect);
+      theNormResult->makeBlank();
+   }
+   
+   switch(theTile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint8>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint8>(0), tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT8:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint8>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint8>(0), tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_FLOAT32: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<float>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<float>(0), tileRect, resLevel);
+         }
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint16>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint16>(0), tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT16:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint16>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint16>(0), tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint32>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint32>(0), tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_UINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint32>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint32>(0), tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<double>(0), tileRect, resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<double>(0), tileRect, resLevel);
+         }
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimBlendMosaic::getTile NOTICE:\n"
+            << "Scalar type = " << theTile->getScalarType()
+            << " Not supported by ossimImageMosaic" << endl;
+       }
+   }
+
+   return ossimRefPtr<ossimImageData>();   
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combine(
+   T,
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+  ossimRefPtr<ossimImageData> currentImageData=NULL;
+  ossim_uint32 band;
+  double currentWeight = 1.0;
+  double previousWeight = 1.0;
+  // double sumOfWeights   = 1;
+  long offset = 0;
+  long row    = 0;
+  long col    = 0;
+  ossim_uint32 layerIdx = 0;
+  currentImageData = getNextTile(layerIdx, 0, tileRect, resLevel);
+  
+  if(!currentImageData.get()) // if we don't have one then return theTile
+  {
+     return theTile;
+  }
+  
+  T** srcBands  = new T*[theLargestNumberOfInputBands];
+  T** destBands = new T*[theLargestNumberOfInputBands];
+  T*  nullPix   = new T[theTile->getNumberOfBands()];
+  
+  previousWeight = theWeights[layerIdx];
+  //    // now get the previous weight and then combine the two into one.
+	 // let's assign the bands
+  for(band = 0; band < theLargestNumberOfInputBands; ++band)
+  {
+     destBands[band] = static_cast<T*>(theTile->getBuf(band));
+     nullPix[band]   = static_cast<T>(theTile->getNullPix(band));
+  }
+  while(currentImageData.get())
+  {
+      ossimDataObjectStatus currentStatus =
+         currentImageData->getDataObjectStatus();
+      
+      // set the current weight for the current tile.
+      currentWeight = theWeights[layerIdx];
+
+      // sumOfWeights = previousWeight+currentWeight;
+      if( (currentStatus != OSSIM_EMPTY) &&
+	  (currentStatus != OSSIM_NULL))
+       {	 
+	 long h = (long)currentImageData->getHeight();
+	 long w = (long)currentImageData->getWidth();
+	 offset = 0;
+	 ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+	 
+	 // let's assign the bands
+	 for(band = 0; band < minNumberOfBands; ++band)
+	   {
+	     srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
+	   }
+	 for(;band < theLargestNumberOfInputBands; ++band)
+	   {
+	     srcBands[band]  = srcBands[minNumberOfBands - 1];
+	   }
+
+ 	 if(currentStatus == OSSIM_PARTIAL)
+         {
+            for(row = 0; row < h; ++row)
+            {
+               for(col = 0; col < w; ++col)
+               {
+                  if(!currentImageData->isNull(offset))
+                  {
+                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
+                     {
+                        if(destBands[band][offset] != nullPix[band])
+                        {
+//                            destBands[band][offset] = static_cast<T>((destBands[band][offset]*(1.0-currentWeight) +  
+//                                                                      srcBands[band][offset]*currentWeight));
+                           destBands[band][offset] = static_cast<T>((destBands[band][offset]*previousWeight + 
+                                                                     srcBands[band][offset]*currentWeight)/(previousWeight+currentWeight));
+                        }
+                        else
+                        {
+                           destBands[band][offset] = srcBands[band][offset];
+                        }
+                     }	 
+                  }
+                  ++offset;
+               }
+            }
+         }
+	 else
+         {
+            for(row = 0; row < h; ++row)
+            {
+               for(col = 0; col < w; ++col)
+               {
+                  for(band = 0; band < theLargestNumberOfInputBands; ++band)
+                  {			
+                     if(destBands[band][offset] != nullPix[band])
+                     {
+                        destBands[band][offset] = static_cast<T>((destBands[band][offset]*previousWeight+ 
+                                                                  srcBands[band][offset]*currentWeight)/(previousWeight + currentWeight));
+                     }
+                     else
+                     {
+                        destBands[band][offset] = srcBands[band][offset];
+                     }
+                  }
+                  ++offset;
+               }
+            }
+         }
+       }
+      currentImageData = getNextTile(layerIdx, tileRect, resLevel);
+      previousWeight   = (previousWeight+currentWeight)/2.0;
+    }
+  delete [] srcBands;
+  delete [] destBands;
+  delete [] nullPix;
+  theTile->validate();
+
+  return theTile;   
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimBlendMosaic::combineNorm(
+   T, const ossimIrect& tileRect, ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> currentImageData=NULL;
+   ossim_uint32 band;
+   double currentWeight = 1.0;
+   double previousWeight = 1.0;
+   // double sumOfWeights   = 1;
+   long offset = 0;
+   long row    = 0;
+   long col    = 0;
+   ossim_uint32 layerIdx = 0;
+   currentImageData = getNextNormTile(layerIdx, 0, tileRect, resLevel);
+  
+   if(!currentImageData.get()) // if we don't have one then return theTile
+   {
+      return theTile;
+   }
+   theNormResult->makeBlank();
+   float** srcBands  = new float*[theLargestNumberOfInputBands];
+   float** destBands = new float*[theLargestNumberOfInputBands];
+   float*  nullPix   = new float[theTile->getNumberOfBands()];
+  
+   previousWeight = theWeights[layerIdx];
+   //    // now get the previous weight and then combine the two into one.
+   // let's assign the bands
+   for(band = 0; band < theLargestNumberOfInputBands; ++band)
+   {
+      destBands[band] = static_cast<float*>(theNormResult->getBuf(band));
+      nullPix[band]   = static_cast<float>(theNormResult->getNullPix(band));
+   }
+   while(currentImageData.get())
+   {
+      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
+     
+      // set the current weight for the current tile.
+      currentWeight = theWeights[layerIdx];
+     
+      // sumOfWeights = previousWeight+currentWeight;
+      if( (currentStatus != OSSIM_EMPTY) &&
+          (currentStatus != OSSIM_NULL))
+      {	 
+         long h = (long)currentImageData->getHeight();
+         long w = (long)currentImageData->getWidth();
+         offset = 0;
+         ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+        
+         // let's assign the bands
+         for(band = 0; band < minNumberOfBands; ++band)
+         {
+            srcBands[band]  = static_cast<float*>(currentImageData->getBuf(band));
+         }
+         for(;band < theLargestNumberOfInputBands; ++band)
+         {
+            srcBands[band]  = srcBands[minNumberOfBands - 1];
+         }
+        
+         if(currentStatus == OSSIM_PARTIAL)
+         {
+            for(row = 0; row < h; ++row)
+            {
+               for(col = 0; col < w; ++col)
+               {
+                  if(!currentImageData->isNull(offset))
+                  {
+                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
+                     {
+                        if(destBands[band][offset] != nullPix[band])
+                        {
+                           destBands[band][offset] = static_cast<float>((destBands[band][offset]*previousWeight + 
+                                                                         srcBands[band][offset]*currentWeight)/(previousWeight+currentWeight));
+                        }
+                        else
+                        {
+                           destBands[band][offset] = srcBands[band][offset];
+                        }
+                     }	 
+                  }
+                  ++offset;
+               }
+            }
+         }
+         else
+         {
+            for(row = 0; row < h; ++row)
+            {
+               for(col = 0; col < w; ++col)
+               {
+                  for(band = 0; band < theLargestNumberOfInputBands; ++band)
+                  {			
+                     if(destBands[band][offset] != nullPix[band])
+                     {
+                        destBands[band][offset] = static_cast<float>((destBands[band][offset]*previousWeight+ 
+                                                                      srcBands[band][offset]*currentWeight)/(previousWeight + currentWeight));
+                     }
+                     else
+                     {
+                        destBands[band][offset] = srcBands[band][offset];
+                     }
+                  }
+                  ++offset;
+               }
+            }
+         }
+      }
+      currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+      previousWeight   = (previousWeight+currentWeight)/2.0;
+   }
+   theNormResult->validate();
+   theTile->copyNormalizedBufferToTile((float*)theNormResult->getBuf());
+   delete [] srcBands;
+   delete [] destBands;
+   delete [] nullPix;
+   theTile->validate();
+
+   return theTile;   
+}
+
+bool ossimBlendMosaic::saveState(ossimKeywordlist& kwl,
+                                 const char* prefix)const
+{
+   bool result = ossimImageMosaic::saveState(kwl, prefix);
+
+   ossimString copyPrefix    = prefix;
+   for(ossim_uint32 index = 0; index < theWeights.size(); ++index)
+   {
+      ossimString weightStr = ossimString("weight") +
+                              ossimString::toString(index);
+      kwl.add(copyPrefix.c_str(),
+              weightStr.c_str(),
+              theWeights[index],
+              true);
+   }
+   
+   return result;
+}
+
+bool ossimBlendMosaic::loadState(const ossimKeywordlist& kwl,
+                                 const char* prefix)
+{
+   bool result = ossimImageMosaic::loadState(kwl, prefix);
+   ossim_uint32 count = 0;
+   theWeights.clear();
+   if(result)
+   {
+      ossimString copyPrefix    = prefix;
+      ossimString regExpression =  ossimString("^(") + copyPrefix + "weight[0-9]+)";
+      ossim_uint32 result = kwl.getNumberOfSubstringKeys(regExpression);
+            
+      ossim_uint32 numberOfMatches = 0;
+      while(numberOfMatches < result)
+      {
+         ossimString value = ossimString("weight") + ossimString::toString(count);
+
+         const char* lookup = kwl.find(copyPrefix.c_str(),
+                                       value.c_str());
+         
+         if(lookup)
+         {
+            ++numberOfMatches;
+            theWeights.push_back(ossimString(lookup).toDouble());
+         }
+
+         ++count;
+      }
+   }
+   
+   return result;
+}
+
+
+void ossimBlendMosaic::setNumberOfWeights(ossim_uint32 numberOfWeights)
+{
+   if(numberOfWeights > theWeights.size())
+   {
+      ossim_uint32 length = numberOfWeights - (ossim_uint32) theWeights.size();
+      for(ossim_uint32 index= 0; index < length; ++ index)
+      {
+         theWeights.push_back(1.0);
+      }
+   }
+   else if(numberOfWeights < theWeights.size())
+   {
+      // copy the list
+      vector<double> temp(theWeights.begin(),
+                          theWeights.begin()+numberOfWeights);
+      // now shrink
+      theWeights = temp;
+   }
+}
+
+void ossimBlendMosaic::setAllWeightsTo(double value)
+{
+   for(ossim_uint32 index = 0; index < theWeights.size(); ++index)
+   {
+      theWeights[index] = value;
+   }
+}
+
+void ossimBlendMosaic::normalizeWeights()
+{
+  double sumWeights=0.0;
+  ossim_uint32 index = 0;
+  for(index = 0; index < theWeights.size(); ++index)
+    {
+      sumWeights+=theWeights[index];
+    }
+  if(sumWeights > 0.0)
+    {
+      for(index = 0; index < theWeights.size(); ++index)
+	{
+	  theWeights[index] /= sumWeights;
+	}
+    }
+}
+
+void ossimBlendMosaic::findMinMax(double& minValue, double& maxValue)const
+{
+   if(theWeights.size() > 0)
+   {
+      minValue = maxValue = theWeights[0];
+
+      for(ossim_uint32 index = 1; index < theWeights.size(); ++index)
+      {
+         minValue = minValue < theWeights[index]?minValue:theWeights[index];
+         maxValue = maxValue > theWeights[index]?maxValue:theWeights[index];
+      }
+   }
+}
+
+void ossimBlendMosaic::setWeight(ossim_uint32 index, double weight)
+{
+   if(index < theWeights.size())
+   {
+      theWeights[index] = weight;
+   }
+}
+
+void ossimBlendMosaic::setWeights(const std::vector<double>& weights)
+{
+   theWeights = weights;
+}
+
+const vector<double>& ossimBlendMosaic::getWeights()const
+{
+   return theWeights;
+}
+
+double ossimBlendMosaic::getWeight(ossim_uint32 index) const
+{
+   if(index < theWeights.size())
+   {
+      return theWeights[index];
+   }
+   if(theWeights.size())
+   {
+      return theWeights[theWeights.size()-1];
+   }
+   return 0;
+}
diff --git a/ossim/src/ossim/imaging/ossimBrightnessContrastSource.cpp b/src/imaging/ossimBrightnessContrastSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimBrightnessContrastSource.cpp
rename to src/imaging/ossimBrightnessContrastSource.cpp
diff --git a/src/imaging/ossimBrightnessMatch.cpp b/src/imaging/ossimBrightnessMatch.cpp
new file mode 100644
index 0000000..3a0874c
--- /dev/null
+++ b/src/imaging/ossimBrightnessMatch.cpp
@@ -0,0 +1,247 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: A brief description of the contents of the file.
+//
+//*************************************************************************
+// $Id: ossimBrightnessMatch.cpp 11955 2007-10-31 16:10:22Z gpotts $
+
+#include <ossim/imaging/ossimBrightnessMatch.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNormRgbVector.h>
+#include <ossim/base/ossimHsiVector.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+RTTI_DEF1(ossimBrightnessMatch,
+          "ossimBrightnessMatch",
+          ossimImageSourceFilter)
+   
+ossimBrightnessMatch::ossimBrightnessMatch()
+   :ossimImageSourceFilter(),
+    theTargetBrightness(0.5),
+    theInputBrightness(0.5)
+{
+   theInputBrightness = ossim::nan();
+   theBrightnessContrastSource = new ossimBrightnessContrastSource;
+}
+
+
+ossimBrightnessMatch::~ossimBrightnessMatch()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimBrightnessMatch::getTile(
+   const ossimIrect& tileRect, ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getTile(tileRect, resLevel);
+   }
+   if(theInputConnection)
+   {
+      if(ossim::isnan(theInputBrightness))
+      {
+         computeInputBrightness();
+      }
+      return theBrightnessContrastSource->getTile(tileRect, resLevel);
+   }
+   return 0;
+}
+
+void ossimBrightnessMatch::initialize()
+{
+   theBrightnessContrastSource->connectMyInputTo(0, getInput());
+   theNormTile = 0;
+}
+
+void ossimBrightnessMatch::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property)
+   {
+      return;
+   }
+   ossimString name = property->getName();
+   if(name == "input_brightness")
+   {
+      theInputBrightness = property->valueToString().toDouble();
+      theBrightnessContrastSource->setBrightness(theTargetBrightness-theInputBrightness);
+   }
+   else if(name == "target_brightness")
+   {
+      theTargetBrightness = property->valueToString().toDouble();
+      theBrightnessContrastSource->setBrightness(theTargetBrightness-theInputBrightness);
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimBrightnessMatch::getProperty(const ossimString& name)const
+{
+   if(name == "target_brightness")
+   {
+      ossimNumericProperty* numeric = new ossimNumericProperty(name,
+                                                               ossimString::toString(theTargetBrightness),
+                                                               0.0, 1.0);
+      numeric->setNumericType(ossimNumericProperty::ossimNumericPropertyType_FLOAT64);
+      numeric->setCacheRefreshBit();
+      return numeric;
+   }
+   else if(name == "input_brightness")
+   {
+      ossimNumericProperty* numeric = new ossimNumericProperty(name,
+                                                               ossimString::toString(theInputBrightness),
+                                                               0.0, 1.0);
+      numeric->setNumericType(ossimNumericProperty::ossimNumericPropertyType_FLOAT64);
+      numeric->setCacheRefreshBit();
+      return numeric;
+   }
+
+    return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimBrightnessMatch::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   
+   propertyNames.push_back("input_brightness");
+   propertyNames.push_back("target_brightness");
+}
+
+
+bool ossimBrightnessMatch::loadState(const ossimKeywordlist& kwl,
+                                              const char* prefix)
+{
+   const char* input_brightness = kwl.find(prefix, "input_brightness");
+   const char* target_brightness = kwl.find(prefix, "target_brightness");
+
+   if(input_brightness)
+   {
+      theInputBrightness = ossimString(input_brightness).toDouble();
+   }
+   if(target_brightness)
+   {
+      theTargetBrightness = ossimString(target_brightness).toDouble();
+   }
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimBrightnessMatch::saveState(ossimKeywordlist& kwl,
+                                              const char* prefix)const
+{
+   kwl.add(prefix,
+           "input_brightness",
+           theInputBrightness,
+           true);
+   kwl.add(prefix,
+           "target_brightness",
+           theTargetBrightness,
+            true);
+
+   return ossimImageSourceFilter::saveState(kwl, prefix);   
+}
+
+
+void ossimBrightnessMatch::computeInputBrightness()
+{
+   if(theInputConnection)
+   {
+      ossimIrect inputRect = getBoundingRect();
+      ossim_uint32 rlevel = 0;
+      ossim_uint32 nlevels = getNumberOfDecimationLevels();
+      if(nlevels>1)
+      {
+         while((ossim::max(inputRect.width(), inputRect.height()) > 2048)&&
+               (rlevel < nlevels))
+         {
+            ++rlevel;
+            inputRect = getBoundingRect(rlevel);
+         }
+      }
+      ossimIpt centerPt = inputRect.midPoint();
+      centerPt.x -= 1024;
+      centerPt.y -= 1024;
+      ossimIrect reqRect(centerPt.x,
+                         centerPt.y,
+                         centerPt.x + 2047,
+                         centerPt.x + 2047);
+      reqRect = reqRect.clipToRect(inputRect);
+      ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(reqRect, rlevel);
+
+      if(inputTile.valid())
+      {
+         theNormTile = new ossimImageData(0,
+                                          OSSIM_FLOAT32,
+                                          inputTile->getNumberOfBands());
+         theNormTile->initialize();
+         theNormTile->setImageRectangle(reqRect);
+         inputTile->copyTileToNormalizedBuffer((ossim_float32*)theNormTile->getBuf());
+         theNormTile->setDataObjectStatus(inputTile->getDataObjectStatus());
+         ossim_uint32 maxIdx = theNormTile->getWidth()*theNormTile->getHeight();
+         ossim_float32* bands[3];
+         double averageI = 0.0;
+         double count = 0.0;
+         ossim_uint32 offset = 0;
+         
+         bands[0] = (ossim_float32*)theNormTile->getBuf();
+         if(theNormTile->getNumberOfBands()>2)
+         {
+            bands[1] = (ossim_float32*)theNormTile->getBuf(1);
+            bands[2] = (ossim_float32*)theNormTile->getBuf(2);
+         }
+         else
+         {
+            bands[1] = bands[0];
+            bands[2] = bands[0];
+         }
+         ossimHsiVector hsi;
+         if(theNormTile->getDataObjectStatus() == OSSIM_FULL)
+         {
+            count = maxIdx;
+            
+            for(offset = 0; offset < maxIdx; ++offset)
+            {
+               hsi = ossimNormRgbVector(bands[0][offset], bands[1][offset], bands[2][offset]);
+               
+               averageI += hsi.getI();
+            }
+         }
+         else
+         {
+            for(offset = 0; offset < maxIdx; ++offset)
+            {
+               if((bands[0][offset] != 0.0)&&
+                  (bands[1][offset] != 0.0)&&
+                  (bands[2][offset] != 0.0))
+               {
+                  hsi = ossimNormRgbVector(bands[0][offset], bands[1][offset], bands[2][offset]);
+                  averageI += hsi.getI();
+                  
+                  ++count;
+               }
+            }
+         }
+         theInputBrightness = averageI / count;
+         theBrightnessContrastSource->setBrightness(theTargetBrightness-theInputBrightness);
+      }
+      else
+      {
+         theInputBrightness = .5;
+      }
+   }
+   theNormTile = 0;
+}
diff --git a/src/imaging/ossimBumpShadeTileSource.cpp b/src/imaging/ossimBumpShadeTileSource.cpp
new file mode 100644
index 0000000..67a2395
--- /dev/null
+++ b/src/imaging/ossimBumpShadeTileSource.cpp
@@ -0,0 +1,538 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimBumpShadeTileSource.cpp 23165 2015-02-24 18:01:52Z dburken $
+
+#include <ossim/imaging/ossimBumpShadeTileSource.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimTilePatch.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimColumnVector3d.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeyword.h>
+#include <ossim/base/ossimMatrix3x3.h>
+#include <ossim/base/ossimRgbVector.h>
+
+static const char COLOR_RED_KW[]   = "color_red";
+static const char COLOR_GREEN_KW[] = "color_green";
+static const char COLOR_BLUE_KW[]  = "color_blue";
+
+RTTI_DEF1(ossimBumpShadeTileSource,
+          "ossimBumpShadeTileSource",
+          ossimImageCombiner);
+
+
+ossimBumpShadeTileSource::ossimBumpShadeTileSource()
+   :ossimImageCombiner(0, 2, 0, true, false),
+    m_tile(0),
+    m_lightSourceElevationAngle(45.0),
+    m_lightSourceAzimuthAngle(45.0),
+    m_lightDirection(3),
+    m_r(255),
+    m_g(255),
+    m_b(255)
+{
+   initialize();
+}
+
+ossimBumpShadeTileSource::~ossimBumpShadeTileSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimBumpShadeTileSource::getTile(
+   const  ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if (!getInput(0))
+      return 0;
+
+   if(!m_tile.get())
+   {
+      allocate();
+   }
+   if(!m_tile.valid())
+   {
+      return m_tile;
+   }
+
+   m_tile->setImageRectangle(tileRect);
+   m_tile->initialize();
+   getTile(m_tile.get(), resLevel);
+   return m_tile;
+   
+}
+
+bool ossimBumpShadeTileSource::getTile(ossimImageData* tile, ossim_uint32 resLevel)
+{
+   if (!getInput(0) || !tile) return false;
+   if(!isSourceEnabled()) return true;
+   
+   tile->makeBlank();
+   
+   ossimIrect tileRect = tile->getImageRectangle();
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(1));
+   ossimRefPtr<ossimImageData> colorData = 0;
+   if(colorSource)
+   {
+      colorData = new ossimImageData(colorSource, colorSource->getOutputScalarType(),
+                                     colorSource->getNumberOfOutputBands(),
+                                     tile->getWidth(), tile->getHeight());
+
+      // Caution: Must set rect prior to getTile:
+      colorData->setImageRectangle(tileRect);
+      
+      colorSource->getTile(colorData.get(), resLevel);
+   }
+
+   ossimImageSource* normalSource = PTR_CAST(ossimImageSource, getInput(0));
+   ossimRefPtr<ossimImageData> normalData =
+         new ossimImageData(normalSource, normalSource->getOutputScalarType(),
+                            normalSource->getNumberOfOutputBands(),
+                            tile->getWidth(), tile->getHeight());
+
+   // Caution: Must set rect prior to getTile:
+   normalData->setImageRectangle(tileRect);
+
+   normalSource->getTile(normalData.get(), resLevel);
+   ossimDataObjectStatus status = normalData->getDataObjectStatus();
+   if ((status == OSSIM_NULL) || (status == OSSIM_EMPTY) ||
+       (normalData->getNumberOfBands() != 3) ||
+       (normalData->getScalarType() != OSSIM_DOUBLE))
+   {
+      return false;
+   }
+
+   ossim_float64* normalBuf[3];
+   normalBuf[0] = static_cast<ossim_float64*>(normalData->getBuf(0));
+   normalBuf[1] = static_cast<ossim_float64*>(normalData->getBuf(1));
+   normalBuf[2] = static_cast<ossim_float64*>(normalData->getBuf(2));
+   ossim_float64 normalNp = normalData->getNullPix(0);
+
+   //---
+   // If we have some color data then use it for the bump
+   // else we will default to a grey scale bump shade.
+   //---
+   if ( colorData.get() &&
+        (colorData->getDataObjectStatus() != OSSIM_EMPTY) &&
+        (colorData->getDataObjectStatus() != OSSIM_NULL) )
+   {
+      switch(colorData->getScalarType())
+      {
+         case OSSIM_UCHAR:
+         {
+            ossim_uint8* resultBuf[3];
+            ossim_uint8* colorBuf[3];
+            resultBuf[0] = static_cast<ossim_uint8*>(tile->getBuf(0));
+            resultBuf[1] = static_cast<ossim_uint8*>(tile->getBuf(1));
+            resultBuf[2] = static_cast<ossim_uint8*>(tile->getBuf(2));
+            colorBuf[0]  = static_cast<ossim_uint8*>(colorData->getBuf(0));
+            if(colorData->getBuf(1))
+            {
+               colorBuf[1] = static_cast<ossim_uint8*>(colorData->getBuf(1));
+            }
+            else
+            {
+               colorBuf[1] = colorBuf[0];
+            }
+            if(colorData->getBuf(2))
+            {
+               colorBuf[2] = static_cast<ossim_uint8*>(colorData->getBuf(2));
+            }
+            else
+            {
+               colorBuf[2] = colorBuf[0];
+            }
+
+            long h = m_tile->getHeight();
+            long w = m_tile->getWidth();
+            for(long y = 0; y < h; ++y)
+            {
+               for(long x = 0; x < w; ++x)
+               {
+                  if((*normalBuf[0] != normalNp) &&
+                     (*normalBuf[1] != normalNp) &&
+                     (*normalBuf[2] != normalNp) )
+                  {
+                     if((*colorBuf[0])||(*colorBuf[1])||(*colorBuf[2]))
+                     {
+                        computeColor(*resultBuf[0],
+                                     *resultBuf[1],
+                                     *resultBuf[2],
+                                     *normalBuf[0],
+                                     *normalBuf[1],
+                                     *normalBuf[2],
+                                     *colorBuf[0],
+                                     *colorBuf[1],
+                                     *colorBuf[2]);
+                     }
+                     else
+                     {
+                        computeColor(*resultBuf[0],
+                                     *resultBuf[1],
+                                     *resultBuf[2],
+                                     *normalBuf[0],
+                                     *normalBuf[1],
+                                     *normalBuf[2],
+                                     m_r,
+                                     m_g,
+                                     m_b);
+                     }
+                  }
+                  else
+                  {
+                     *resultBuf[0] = *colorBuf[0];
+                     *resultBuf[1] = *colorBuf[1];
+                     *resultBuf[2] = *colorBuf[2];
+                  }
+                  resultBuf[0]++;
+                  resultBuf[1]++;
+                  resultBuf[2]++;
+                  colorBuf[0]++;
+                  colorBuf[1]++;
+                  colorBuf[2]++;
+                  normalBuf[0]++;
+                  normalBuf[1]++;
+                  normalBuf[2]++;
+               }
+            }
+            break;
+         }
+         default:
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "ossimBumpShadeTileSource::getTile NOTICE:\n"
+               << "only 8-bit unsigned char is supported." << endl;
+         }
+      }
+   }
+   else
+   {
+      ossim_uint8* resultBuf[3];
+      resultBuf[0] = static_cast<ossim_uint8*>(tile->getBuf(0));
+      resultBuf[1] = static_cast<ossim_uint8*>(tile->getBuf(1));
+      resultBuf[2] = static_cast<ossim_uint8*>(tile->getBuf(2));
+      long h = tile->getHeight();
+      long w = tile->getWidth();
+      for(long y = 0; y < h; ++y)
+      {
+         for(long x = 0; x < w; ++x)
+         {
+            if((*normalBuf[0] != normalNp) &&
+                  (*normalBuf[1] != normalNp) &&
+                  (*normalBuf[2] != normalNp) )
+            {
+               computeColor(*resultBuf[0],
+                            *resultBuf[1],
+                            *resultBuf[2],
+                            *normalBuf[0],
+                            *normalBuf[1],
+                            *normalBuf[2],
+                            m_r,
+                            m_g,
+                            m_b);
+            }
+            else
+            {
+               *resultBuf[0] = 0;
+               *resultBuf[1] = 0;
+               *resultBuf[2] = 0;
+            }
+            resultBuf[0]++;
+            resultBuf[1]++;
+            resultBuf[2]++;
+            normalBuf[0]++;
+            normalBuf[1]++;
+            normalBuf[2]++;
+         }
+      }
+   }
+
+   tile->validate();
+   return true;
+}
+
+void ossimBumpShadeTileSource::computeColor(ossim_uint8& r,
+                                            ossim_uint8& g,
+                                            ossim_uint8& b,
+                                            ossim_float64 normalX,
+                                            ossim_float64 normalY,
+                                            ossim_float64 normalZ,
+                                            ossim_uint8 dr,
+                                            ossim_uint8 dg,
+                                            ossim_uint8 db)const
+{
+   double c = /*fabs*/(normalX*m_lightDirection[0] +
+                   normalY*m_lightDirection[1] +
+                   normalZ*m_lightDirection[2]);
+   
+   r = ossimRgbVector::clamp(ossim::round<int>(c*dr), 1, 255);
+   g = ossimRgbVector::clamp(ossim::round<int>(c*dg), 1, 255);
+   b = ossimRgbVector::clamp(ossim::round<int>(c*db), 1, 255);
+}
+
+void ossimBumpShadeTileSource::initialize()
+{
+   ossimImageCombiner::initialize();
+
+   ossimImageSource* normalSource = dynamic_cast<ossimImageSource*>( getInput(0) );
+   if ( normalSource )
+   {
+      normalSource->initialize();
+   }
+   
+   ossimImageSource* colorSource = dynamic_cast<ossimImageSource*>( getInput(1) );
+   if ( colorSource )
+   {
+      colorSource->initialize();
+   }
+   
+   m_tile = 0;
+   
+   computeLightDirection();
+}
+
+void ossimBumpShadeTileSource::allocate()
+{
+   m_tile = ossimImageDataFactory::instance()->create(this, this);
+   m_tile->initialize();
+}
+
+void ossimBumpShadeTileSource::computeLightDirection()
+{
+   NEWMAT::Matrix m = ossimMatrix3x3::createRotationMatrix(m_lightSourceElevationAngle,
+                                                           0.0,
+                                                           -m_lightSourceAzimuthAngle); // make positive rotation clockwise for azimuth
+   NEWMAT::ColumnVector v(3);
+   v[0] = 0;
+   v[1] = 1;
+   v[2] = 0;
+   v = m*v;
+   // reflect Z.  We need the Z pointing up from the surface and not into it.
+   //
+   ossimColumnVector3d d(v[0], v[1], -v[2]);
+   d = d.unit();
+   m_lightDirection[0] = d[0];
+   m_lightDirection[1] = d[1];
+   m_lightDirection[2] = d[2];
+}
+
+bool ossimBumpShadeTileSource::loadState(const ossimKeywordlist& kwl,
+                                         const char* prefix)
+{
+   const char* elevationAngle = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
+   const char* azimuthAngle   = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
+   
+   
+   if(elevationAngle)
+   {
+      m_lightSourceElevationAngle = ossimString(elevationAngle).toDouble();
+   }
+
+   if(azimuthAngle)
+   {
+      m_lightSourceAzimuthAngle = ossimString(azimuthAngle).toDouble();
+   }
+
+   const char* lookup = kwl.find(prefix, COLOR_RED_KW);
+   if (lookup)
+   {
+      m_r = ossimString(lookup).toUInt8();
+   }
+   
+   lookup = kwl.find(prefix, COLOR_GREEN_KW);
+   if (lookup)
+   {
+      m_g = ossimString(lookup).toUInt8();
+   }
+   
+   lookup = kwl.find(prefix, COLOR_BLUE_KW);
+   if (lookup)
+   {
+      m_b = ossimString(lookup).toUInt8();
+   }
+    
+
+   computeLightDirection();
+
+   bool result = ossimImageSource::loadState(kwl, prefix);
+
+   theInputListIsFixedFlag  = true;
+   theOutputListIsFixedFlag = false;
+   if(!getNumberOfInputs()) setNumberOfInputs(2);
+   
+   return result;
+}
+
+bool ossimBumpShadeTileSource::saveState(ossimKeywordlist& kwl,
+                                         const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::ELEVATION_ANGLE_KW,
+           m_lightSourceElevationAngle,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::AZIMUTH_ANGLE_KW,
+           m_lightSourceAzimuthAngle,
+           true);
+
+   kwl.add(prefix, COLOR_RED_KW,   m_r, true);
+   kwl.add(prefix, COLOR_GREEN_KW, m_g, true);
+   kwl.add(prefix, COLOR_BLUE_KW,  m_b, true);
+   
+   return ossimImageSource::saveState(kwl, prefix);
+}
+
+ossimString ossimBumpShadeTileSource::getShortName()const
+{
+   return ossimString("bump shader");
+}
+
+ossimString ossimBumpShadeTileSource::getLongName()const
+{
+   return ossimString("Blinn's bump map filter");
+}
+
+ossim_uint32 ossimBumpShadeTileSource::getNumberOfOutputBands() const
+{
+   return 3;
+}
+
+ossimScalarType ossimBumpShadeTileSource::getOutputScalarType() const
+{
+   return OSSIM_UCHAR;
+}
+
+double ossimBumpShadeTileSource::getNullPixelValue()const
+{
+   return 0.0;
+}
+
+double ossimBumpShadeTileSource::getMinPixelValue(ossim_uint32 /* band */)const
+{
+   return 1.0;
+}
+
+double ossimBumpShadeTileSource::getMaxPixelValue(ossim_uint32 /* band */)const
+{
+   return 255.0;
+}
+
+double ossimBumpShadeTileSource::getAzimuthAngle()const
+{
+   return m_lightSourceAzimuthAngle;
+}
+
+double ossimBumpShadeTileSource::getElevationAngle()const
+{
+   return m_lightSourceElevationAngle;
+}
+
+void ossimBumpShadeTileSource::setAzimuthAngle(double angle)
+{
+   m_lightSourceAzimuthAngle = angle;
+}
+
+void ossimBumpShadeTileSource::setElevationAngle(double angle)
+{
+   m_lightSourceElevationAngle = angle;
+}
+
+bool ossimBumpShadeTileSource::canConnectMyInputTo(ossim_int32 inputIndex,
+                                                   const ossimConnectableObject* object)const
+{
+   return (object&&
+           ( (inputIndex>=0) && inputIndex < 2)&&
+           PTR_CAST(ossimImageSource, object));
+   
+}
+
+void ossimBumpShadeTileSource::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimBumpShadeTileSource::disconnectInputEvent(ossimConnectionEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimBumpShadeTileSource::propertyEvent(ossimPropertyEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimBumpShadeTileSource::refreshEvent(ossimRefreshEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimBumpShadeTileSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimString name = property->getName();
+   if(name == "lightSourceElevationAngle")
+   {
+      m_lightSourceElevationAngle = property->valueToString().toDouble();
+   }
+   else if(name == "lightSourceAzimuthAngle")
+   {
+      m_lightSourceAzimuthAngle = property->valueToString().toDouble();
+   }
+   else
+   {
+      ossimImageCombiner::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimBumpShadeTileSource::getProperty(const ossimString& name)const
+{
+   if(name == "lightSourceElevationAngle")
+   {
+      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(m_lightSourceElevationAngle), 0.0, 90.0);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   else if(name == "lightSourceAzimuthAngle")
+   {
+      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(m_lightSourceAzimuthAngle), 0, 360);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   
+   return ossimImageCombiner::getProperty(name);
+}
+
+void ossimBumpShadeTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageCombiner::getPropertyNames(propertyNames);
+   propertyNames.push_back("lightSourceElevationAngle");
+   propertyNames.push_back("lightSourceAzimuthAngle");
+}
+
+void ossimBumpShadeTileSource::setRgbColorSource(ossim_uint8 r,
+                                                 ossim_uint8 g,
+                                                 ossim_uint8 b)
+{
+   m_r = r;
+   m_g = g;
+   m_b = b;
+}
+
+void ossimBumpShadeTileSource::getRgbColorSource(ossim_uint8& r,
+                                                 ossim_uint8& g,
+                                                 ossim_uint8& b) const
+{
+   r = m_r;
+   g = m_g;
+   b = m_b;
+}
diff --git a/src/imaging/ossimCacheTileSource.cpp b/src/imaging/ossimCacheTileSource.cpp
new file mode 100644
index 0000000..e64c1f0
--- /dev/null
+++ b/src/imaging/ossimCacheTileSource.cpp
@@ -0,0 +1,671 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// Author:  Garrett Potts 
+//
+// Description:  ossimCacheTileSource
+// 
+//*******************************************************************
+// $Id$
+
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/imaging/ossimCacheTileSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+static ossimTrace traceDebug("ossimCacheTileSource:debug");
+
+static const ossimString TILE_SIZE_XY_KW("tile_size_xy");
+static const ossimString USE_INPUT_TILE_SIZE_KW("use_input_tile_size");
+
+RTTI_DEF1(ossimCacheTileSource, "ossimCacheTileSource", ossimImageSourceFilter);
+   
+ossimCacheTileSource::ossimCacheTileSource()
+   : ossimImageSourceFilter(),
+     //theCacheId(ossimAppFixedTileCache::instance()->newTileCache()),
+     theTile(0),
+     theFixedTileSize(),
+     theCachingEnabled(true),
+     theEventProgressFlag(false),
+     theUseInputTileSizeFlag(false),
+     theTileSizeXY()
+{
+   ossim::defaultTileSize(theFixedTileSize);
+   ossim::defaultTileSize(theTileSizeXY);
+}
+
+ossimCacheTileSource::~ossimCacheTileSource()
+{
+   deleteRlevelCache();
+   //ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
+   
+   //theCacheId = -1;
+  // theBoundingRect.makeNan();
+}
+
+void ossimCacheTileSource::flush()
+{
+   //ossimAppFixedTileCache::instance()->flush(theCacheId);
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theRLevelCacheList.size();++idx)
+   {
+      ossimAppFixedTileCache::instance()->flush(theRLevelCacheList[idx]);
+   }
+
+}
+
+void ossimCacheTileSource::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   flush();
+   theTile = 0;
+}
+   
+void ossimCacheTileSource::allocate()
+{
+   theTile = 0;
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimCacheTileSource::getTile(
+   const ossimIrect& tileRect, ossim_uint32 resLevel)
+{
+   if(traceDebug())
+   {
+      std::cout << "CACHE TILE START: " << tileRect << std::endl;
+   }
+   ossimRefPtr<ossimImageData> result = 0;
+   
+   if ( theInputConnection )
+   {
+      if ( isSourceEnabled() )
+      {
+         if(!theTile.valid())
+         {
+            allocate();
+         }
+         
+         if (theTile.valid())
+         {
+            // theTile->setImageRectangle(tileRect);
+            // theTile->makeBlank();
+            
+            // see if we can get a valid cache at the given resolution level
+            ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = getCacheId(resLevel);
+            if( cacheId < 0)
+            {
+               return theInputConnection->getTile(tileRect, resLevel);
+            }
+            result = fillTile(tileRect, resLevel, cacheId);
+         }
+      }
+      else // Not enabled...
+      {
+         result = theInputConnection->getTile(tileRect, resLevel);
+      }
+
+   } // End:  if ( theInputConnection )
+   if(traceDebug())
+   {
+     std::cout << "CACHE TILE END: " << tileRect << std::endl;
+   }
+
+   return result;
+}
+
+#if 0
+ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> tempTile = 0;
+   fireProgressEvent(0.0);
+   ossimIrect boundingRect = getBoundingRect(resLevel);
+   ossimIrect tileRect = theTile->getImageRectangle();
+   ossimIrect allignedRect = tileRect.clipToRect(boundingRect);
+   ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = getCacheId(resLevel); 
+   ossimIpt cacheTileSize =  ossimAppFixedTileCache::instance()->getTileSize(cacheId);
+   if ( !allignedRect.hasNans() )
+   {
+      allignedRect.stretchToTileBoundary(cacheTileSize);
+     // ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = theCacheId;
+      
+      // check to see if we need to loop
+      if((allignedRect == tileRect)&&
+         (static_cast<ossim_int32>(tileRect.width())  == cacheTileSize.x)&&
+         (static_cast<ossim_int32>(tileRect.height()) == cacheTileSize.y))
+      {
+         ossimIpt origin = tileRect.ul();
+         if(theCachingEnabled)
+         {
+            tempTile = ossimAppFixedTileCache::instance()->getTile(cacheId,
+                                                                   origin);
+         }
+         if(!tempTile.valid())
+         {
+            tempTile = theInputConnection->getTile(tileRect, resLevel);
+            
+            if(tempTile.valid())
+            {
+               if((tempTile->getBuf())&&
+                  (tempTile->getDataObjectStatus()!=OSSIM_EMPTY)&&
+                  theCachingEnabled)
+               {
+                  ossimAppFixedTileCache::instance()->addTile(cacheId,
+                                                              tempTile);
+               }
+            }
+         }
+//         else
+//         {
+//            std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n";
+//         }
+         
+         if(tempTile.valid())
+         {
+            if((tempTile->getDataObjectStatus() != OSSIM_NULL)&&
+               (tempTile->getDataObjectStatus() != OSSIM_EMPTY))
+            {
+               theTile->setDataObjectStatus(tempTile->getDataObjectStatus());
+               theTile->loadTile(tempTile.get());
+            }
+         }
+         fireProgressEvent(100.0);
+      }
+      else
+      {
+         
+         ossim_int32 boundaryHeight = allignedRect.height();
+         ossim_int32 boundaryWidth  = allignedRect.width();
+         ossimIpt origin(allignedRect.ul());
+         ossim_int32 totalTiles  = (boundaryHeight/cacheTileSize.y)*
+            (boundaryWidth/theFixedTileSize.x);
+         ossim_int32 currentTile = 0;
+         for(ossim_int32 row = 0;
+             row < boundaryHeight;
+             row+=theFixedTileSize.y)
+         {
+            origin.x  =  allignedRect.ul().x;
+            for(ossim_int32 col = 0;
+                col < boundaryWidth;
+                col+=theFixedTileSize.x)
+            {
+               ++currentTile;
+               if(theCachingEnabled)
+               {
+                  tempTile =
+                     ossimAppFixedTileCache::instance()->getTile(cacheId,
+                                                                 origin);
+               }
+               else
+               {
+                  tempTile = 0;
+               }
+               if(!tempTile.valid())
+               {
+                  ossimIrect rect(origin.x,
+                                  origin.y,
+                                  origin.x + cacheTileSize.x-1,
+                                  origin.y + cacheTileSize.y-1);
+                  
+                  tempTile = theInputConnection->getTile(rect, resLevel);
+                  
+                  if(tempTile.valid())
+                  {
+                     // drb if(theTile->getBuf()&&
+                     if(tempTile->getBuf()&&                        
+                        (tempTile->getDataObjectStatus()!=OSSIM_EMPTY)&&
+                        theCachingEnabled)
+                     {
+                        ossimAppFixedTileCache::instance()->
+                           addTile(cacheId, tempTile);
+                     }
+                  }
+               }
+             //  else
+             //  {
+             //     std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n";
+             // }
+               
+               if(tempTile.valid())
+               {
+                  if(tempTile->getBuf()&&
+                     (tempTile->getDataObjectStatus()!=OSSIM_EMPTY))
+                  {
+                     theTile->loadTile(tempTile.get());
+                  }
+               }
+               double percent = 100.0*((double)currentTile/(double)totalTiles);
+               fireProgressEvent(percent);
+               origin.x   += theFixedTileSize.x;
+            }
+            origin.y += theFixedTileSize.y;
+         }
+         theTile->validate();
+         fireProgressEvent(100);
+      }
+      
+   } // End of:  if ( !allignedRect.hasNans() )
+   
+   return theTile;
+}
+#endif
+
+ossimRefPtr<ossimImageData> ossimCacheTileSource::fillTile(
+   const ossimIrect& tileRect, ossim_uint32 resLevel,
+   ossimAppFixedTileCache::ossimAppFixedCacheId cacheId )
+{
+   ossimRefPtr<ossimImageData> result = 0;
+   ossimRefPtr<ossimImageData> tempTile = 0;
+   fireProgressEvent(0.0);
+   ossimIrect boundingRect = getBoundingRect(resLevel);
+   ossimIrect allignedRect = tileRect.clipToRect(boundingRect);
+   ossimIpt cacheTileSize =  ossimAppFixedTileCache::instance()->getTileSize(cacheId);
+
+   if ( !allignedRect.hasNans() )
+   {
+      allignedRect.stretchToTileBoundary(cacheTileSize);
+     // ossimAppFixedTileCache::ossimAppFixedCacheId cacheId = theCacheId;
+      
+      // check to see if we need to loop
+      if((allignedRect == tileRect)&&
+         (static_cast<ossim_int32>(tileRect.width())  == cacheTileSize.x)&&
+         (static_cast<ossim_int32>(tileRect.height()) == cacheTileSize.y))
+      {
+         // Grabbing whole tile either from cache or input.
+         ossimIpt origin = tileRect.ul();
+         if(theCachingEnabled)
+         {
+            result = ossimAppFixedTileCache::instance()->getTile(cacheId, origin);
+         }
+         if(!result.valid())
+         {
+            result = theInputConnection->getTile(tileRect, resLevel);
+            
+            if(result.valid())
+            {
+               if((result->getBuf())&&
+                  (result->getDataObjectStatus()!=OSSIM_EMPTY)&&
+                  theCachingEnabled)
+               {
+                  ossimAppFixedTileCache::instance()->addTile(cacheId, result);
+               }
+            }
+         }
+//         else
+//         {
+//            std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n";
+//         }
+
+#if 0
+         if(tempTile.valid())
+         {
+            if((tempTile->getDataObjectStatus() != OSSIM_NULL)&&
+               (tempTile->getDataObjectStatus() != OSSIM_EMPTY))
+            {
+               theTile->setDataObjectStatus(tempTile->getDataObjectStatus());
+               theTile->loadTile(tempTile.get());
+            }
+         }
+#endif
+         fireProgressEvent(100.0);
+      }
+      else
+      {
+         theTile->setImageRectangle(tileRect);
+         theTile->makeBlank();
+
+         ossim_int32 boundaryHeight = allignedRect.height();
+         ossim_int32 boundaryWidth  = allignedRect.width();
+         ossimIpt origin(allignedRect.ul());
+         ossim_int32 totalTiles  = (boundaryHeight/cacheTileSize.y)*
+            (boundaryWidth/theFixedTileSize.x);
+         ossim_int32 currentTile = 0;
+         for(ossim_int32 row = 0;
+             row < boundaryHeight;
+             row+=theFixedTileSize.y)
+         {
+            origin.x  =  allignedRect.ul().x;
+            for(ossim_int32 col = 0;
+                col < boundaryWidth;
+                col+=theFixedTileSize.x)
+            {
+               ++currentTile;
+               if(theCachingEnabled)
+               {
+                  tempTile =
+                     ossimAppFixedTileCache::instance()->getTile(cacheId,
+                                                                 origin);
+               }
+               else
+               {
+                  tempTile = 0;
+               }
+               if(!tempTile.valid())
+               {
+                  ossimIrect rect(origin.x,
+                                  origin.y,
+                                  origin.x + cacheTileSize.x-1,
+                                  origin.y + cacheTileSize.y-1);
+                  
+                  tempTile = theInputConnection->getTile(rect, resLevel);
+                  
+                  if(tempTile.valid())
+                  {
+                     // drb if(theTile->getBuf()&&
+                     if(tempTile->getBuf()&&                        
+                        (tempTile->getDataObjectStatus()!=OSSIM_EMPTY)&&
+                        theCachingEnabled)
+                     {
+                        ossimAppFixedTileCache::instance()->
+                           addTile(cacheId, tempTile);
+                     }
+                  }
+               }
+             //  else
+             //  {
+             //     std::cout << "FOUND IN CACHE AT RES " << resLevel << "\n";
+             // }
+               
+               if(tempTile.valid())
+               {
+                  if(tempTile->getBuf()&&
+                     (tempTile->getDataObjectStatus()!=OSSIM_EMPTY))
+                  {
+                     theTile->loadTile(tempTile.get());
+                  }
+               }
+               double percent = 100.0*((double)currentTile/(double)totalTiles);
+               fireProgressEvent(percent);
+               origin.x   += theFixedTileSize.x;
+            }
+            origin.y += theFixedTileSize.y;
+         }
+         theTile->validate();
+         result = theTile;
+         fireProgressEvent(100);
+      }
+      
+   } // End of:  if ( !allignedRect.hasNans() )
+   else
+   {
+      theTile->setImageRectangle(tileRect);
+      theTile->makeBlank();
+      result = theTile;
+   }
+   
+   return result;
+}
+
+ossim_uint32 ossimCacheTileSource::getTileWidth() const
+{
+   return theFixedTileSize.x;
+}
+
+ossim_uint32 ossimCacheTileSource::getTileHeight() const
+{
+   return theFixedTileSize.y;  
+}
+
+bool ossimCacheTileSource::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   //ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
+   
+   //theCacheId = ossimAppFixedTileCache::instance()->newTileCache();
+   
+   deleteRlevelCache();
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::ENABLE_CACHE_KW);
+   if(lookup)
+   {
+      theCachingEnabled = ossimString(lookup).toBool();
+   }
+   lookup = kwl.find(prefix, USE_INPUT_TILE_SIZE_KW);
+   if(lookup)
+   {
+      theUseInputTileSizeFlag = ossimString(lookup).toBool();
+   }
+
+   lookup = kwl.find(prefix, TILE_SIZE_XY_KW);
+   if (lookup)
+   {
+      ossimIpt pt;
+      pt.toPoint(std::string(lookup));
+      setTileSize(pt);
+      theTileSizeXY = pt;
+   }
+   
+   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
+
+   initialize();
+
+   return result;
+}
+
+bool ossimCacheTileSource::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::ENABLE_CACHE_KW,
+           theCachingEnabled,
+           true);
+   kwl.add(prefix,
+           USE_INPUT_TILE_SIZE_KW,
+           theUseInputTileSizeFlag,
+           true);
+   
+   kwl.add(prefix,
+           TILE_SIZE_XY_KW,
+           theFixedTileSize.toString().c_str());
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+ossimRefPtr<ossimProperty> ossimCacheTileSource::getProperty(
+   const ossimString& name)const
+{
+   // Lock for the length of this method.
+   
+   if (name == TILE_SIZE_XY_KW)
+   {
+      ossimRefPtr<ossimProperty> result =
+         new ossimStringProperty(name, theFixedTileSize.toString());
+      result->setCacheRefreshBit();
+      return result;
+   }
+   else if(name == ossimKeywordNames::ENABLE_CACHE_KW)
+   {
+      ossimRefPtr<ossimProperty> result = new ossimBooleanProperty(name,
+                                                                   theCachingEnabled);
+      result->setCacheRefreshBit();
+      return result;
+   }
+   else if(name == USE_INPUT_TILE_SIZE_KW)
+   {
+      ossimRefPtr<ossimProperty> result = new ossimBooleanProperty(name,
+                                                                   theUseInputTileSizeFlag);
+      result->setCacheRefreshBit();
+      return result;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimCacheTileSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property) return;
+
+   ossimString name = property->getName();
+   if (name == TILE_SIZE_XY_KW)
+   {
+      ossimIpt pt;
+      pt.toPoint(property->valueToString());
+
+      if ( (pt.x > 7) && (pt.y > 7) )
+      {
+         setTileSize(pt);
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimCacheTileSource::setProperty NOTICE:"
+            << "\nTile dimensions must be at least 8!"
+            << "\nFormat = ( x, y )"
+            << std::endl;
+      }
+   }
+   else if(name == ossimKeywordNames::ENABLE_CACHE_KW)
+   {
+      setCachingEnabledFlag(property->valueToString().toBool());
+   }
+   else if(name == USE_INPUT_TILE_SIZE_KW)
+   {
+      theUseInputTileSizeFlag = property->valueToString().toBool();
+      if(theUseInputTileSizeFlag)
+      {
+         deleteRlevelCache();
+      }
+     // setCachingEnabledFlag(property->valueToString().toBool());
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+void ossimCacheTileSource::getPropertyNames(
+   std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(TILE_SIZE_XY_KW);
+   propertyNames.push_back(ossimKeywordNames::ENABLE_CACHE_KW);
+   propertyNames.push_back(USE_INPUT_TILE_SIZE_KW);
+   
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+}
+
+ossimString ossimCacheTileSource::getLongName()const
+{
+   return ossimString("Tile Cache , cache for ossimImageData objects.");
+}
+
+ossimString ossimCacheTileSource::getShortName()const
+{
+   return ossimString("Tile Cache");
+}
+
+void ossimCacheTileSource::setCachingEnabledFlag(bool value)
+{
+   if(!value && theCachingEnabled)
+   {
+      flush();
+   }
+   theCachingEnabled = value;
+}
+
+void ossimCacheTileSource::setEventProgressFlag(bool value)
+{
+   theEventProgressFlag = value;
+}
+
+void ossimCacheTileSource::getTileSize(ossimIpt& size) const
+{
+   size = theFixedTileSize;
+}
+
+void ossimCacheTileSource::setTileSize(const ossimIpt& size)
+{
+   if (size != theFixedTileSize)
+   {
+      theTile = 0; // Force an allocate of new tile.
+      theFixedTileSize = size;
+      initializeRlevelCache();
+     // ossimAppFixedTileCache::instance()->setTileSize(theCacheId, size);
+   }
+}
+
+void ossimCacheTileSource::fireProgressEvent(double percentComplete)
+{
+   if(theEventProgressFlag)
+   {
+      ossimProcessProgressEvent event(this, percentComplete);
+      fireEvent(event);
+   }
+}
+
+ossimAppFixedTileCache::ossimAppFixedCacheId ossimCacheTileSource::getCacheId(ossim_uint32 resLevel)
+{
+   ossimAppFixedTileCache::ossimAppFixedCacheId result = -1;
+   if(theRLevelCacheList.empty())
+   {
+      initializeRlevelCache();
+   }
+   if(resLevel < theRLevelCacheList.size())
+   {
+      if(theRLevelCacheList[resLevel] <0)
+      {
+         ossimIpt cacheTileSize(theFixedTileSize);
+         if(theUseInputTileSizeFlag)
+         {
+            cacheTileSize = ossimIpt(ossim::min(static_cast<ossim_int32>(theInputConnection->getTileWidth()),
+                                                static_cast<ossim_int32>(1024)), 
+                                     ossim::min(static_cast<ossim_int32>(theInputConnection->getTileHeight()),
+                                                static_cast<ossim_int32>(1024)));
+            
+         }
+
+         //std::cout << cacheTileSize << std::endl;
+         ossimIrect rect = getBoundingRect(resLevel);
+         
+         if((cacheTileSize.x > static_cast<ossim_int64>(rect.width()))&&
+            (cacheTileSize.y > static_cast<ossim_int64>(rect.height())))
+         {
+            cacheTileSize.x = ossim::max(static_cast<ossim_int64>(rect.width()), 
+                                         static_cast<ossim_int64>(theTileSizeXY.x));
+            cacheTileSize.y = ossim::max(static_cast<ossim_int64>(rect.height()), 
+                                         static_cast<ossim_int64>(theTileSizeXY.y));
+         }
+
+         rect.stretchToTileBoundary(theFixedTileSize);
+         theRLevelCacheList[resLevel] = ossimAppFixedTileCache::instance()->newTileCache(rect, cacheTileSize); 
+      }
+      result = theRLevelCacheList[resLevel];
+   }
+   
+   return result;
+}
+
+void ossimCacheTileSource::deleteRlevelCache()
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theRLevelCacheList.size();++idx)
+   {
+      ossimAppFixedTileCache::instance()->deleteCache(theRLevelCacheList[idx]);
+   }
+   theRLevelCacheList.clear();
+}
+
+void ossimCacheTileSource::initializeRlevelCache()
+{
+   ossim_uint32 nLevels = getNumberOfDecimationLevels();
+   deleteRlevelCache();
+   
+   if(nLevels > 0)
+   {
+      ossim_uint32 idx = 0;
+      theRLevelCacheList.resize(nLevels);
+      for(idx= 0; idx < theRLevelCacheList.size(); ++idx)
+      {
+         theRLevelCacheList[idx] = -1;
+      }
+   }
+}
+
diff --git a/src/imaging/ossimCastTileSourceFilter.cpp b/src/imaging/ossimCastTileSourceFilter.cpp
new file mode 100644
index 0000000..b9e70b5
--- /dev/null
+++ b/src/imaging/ossimCastTileSourceFilter.cpp
@@ -0,0 +1,696 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimCastTileSourceFilter.cpp 17195 2010-04-23 17:32:18Z dburken $
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStringProperty.h>
+
+RTTI_DEF1( ossimCastTileSourceFilter,
+           "ossimCastTileSourceFilter",
+           ossimImageSourceFilter );
+
+ossimCastTileSourceFilter::ossimCastTileSourceFilter(ossimImageSource* input,
+						     ossimScalarType scalarType)
+   :ossimImageSourceFilter(NULL,input),
+    theTile(NULL),
+    theOutputScalarType(scalarType)
+{
+}
+
+ossimCastTileSourceFilter::~ossimCastTileSourceFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimCastTileSourceFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> inputTile;
+   
+   if(theInputConnection)
+   {
+      inputTile = theInputConnection->getTile(tileRect, resLevel);
+   }
+   return applyCast(inputTile);
+}
+
+ossimScalarType ossimCastTileSourceFilter::getOutputScalarType() const
+{
+   if(isSourceEnabled())
+   {
+      return theOutputScalarType;
+   }
+   else if(theInputConnection)
+   {
+      return theInputConnection->getOutputScalarType();
+   }
+
+   return OSSIM_SCALAR_UNKNOWN;
+}
+
+double ossimCastTileSourceFilter::getNullPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      if(theInputConnection)
+      {
+         return theInputConnection->getNullPixelValue(band);
+      }
+   }
+   return ossim::defaultNull(getOutputScalarType());
+}
+
+double ossimCastTileSourceFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      if(theInputConnection)
+      {
+         return theInputConnection->getMinPixelValue(band);
+      }
+   }
+
+   if(theInputConnection)
+   {
+      double tempMin    = theInputConnection->getMinPixelValue(band);
+      
+      double defaultMin = ossim::defaultMin(theOutputScalarType);
+      double defaultMax = ossim::defaultMax(theOutputScalarType);
+
+      if((tempMin >= defaultMin) && (tempMin <= defaultMax))
+      {
+         defaultMin = tempMin;
+      }
+
+      return defaultMin;
+   }
+   
+   return ossimImageSource::getMinPixelValue(band);
+}
+
+double ossimCastTileSourceFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      if(theInputConnection)
+      {
+         return theInputConnection->getMaxPixelValue(band);
+      }
+   }
+   if(theInputConnection)
+   {
+      double tempMax    = theInputConnection->getMaxPixelValue(band);
+      
+      double defaultMax = ossim::defaultMax(theOutputScalarType);
+      double defaultMin = ossim::defaultMin(theOutputScalarType);
+
+      if((tempMax >= defaultMin) && (tempMax <= defaultMax))
+      {
+         defaultMax = tempMax;
+      }
+
+      return defaultMax;
+   }
+   return ossimImageSource::getMaxPixelValue(band);
+}
+
+ossimRefPtr<ossimImageData> ossimCastTileSourceFilter::applyCast(
+   ossimRefPtr<ossimImageData> inputTile)
+{
+   if(!inputTile.valid())
+   {
+      return inputTile;
+   }
+   
+   if(!theTile.valid() ||
+      (theTile->getNumberOfBands() != inputTile->getNumberOfBands()))
+   {
+      allocate(inputTile);
+   }
+   else
+   {
+      ossim_int32 tw =inputTile->getWidth(); 
+      ossim_int32 th =inputTile->getHeight(); 
+      ossim_int32 w = theTile->getWidth();
+      ossim_int32 h = theTile->getHeight();
+      theTile->setWidthHeight(tw, th);
+      
+      if((w*h != tw*th))
+      {
+         theTile->initialize();
+      }
+      else
+      {
+         theTile->makeBlank();
+      }
+      theTile->setOrigin(inputTile->getOrigin());
+   }
+   
+   if( (inputTile->getDataObjectStatus()==OSSIM_EMPTY) ||
+       (inputTile->getDataObjectStatus()==OSSIM_NULL))
+   {
+      return theTile;
+   }
+   
+   switch(inputTile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         ossim_uint8** bands = new ossim_uint8*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<ossim_uint8*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         ossim_sint8** bands = new ossim_sint8*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<ossim_sint8*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         ossim_uint16** bands =
+            new ossim_uint16*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<ossim_uint16*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         ossim_sint16** bands =
+            new ossim_sint16*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<ossim_sint16*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         ossim_sint32** bands =
+            new ossim_sint32*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<ossim_sint32*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         ossim_uint32** bands =
+            new ossim_uint32*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<ossim_uint32*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_FLOAT32: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         float** bands = new float*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<float*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         double** bands = new double*[inputTile->getNumberOfBands()];
+         
+         for(ossim_uint32 band = 0;
+             band < inputTile->getNumberOfBands();
+             ++band)
+         {
+            bands[band] = static_cast<double*>(inputTile->getBuf(band));
+         }
+         castInputToOutput(bands,
+                           inputTile->getNullPix(),
+                           inputTile->getDataObjectStatus()==OSSIM_PARTIAL);
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         break;
+      }
+   }
+
+//   theTile->setDataObjectStatus(inputTile->getDataObjectStatus());
+   theTile->validate();
+   return theTile;
+}
+
+void ossimCastTileSourceFilter::setOutputScalarType(ossimScalarType scalarType)
+{
+   ossimScalarType old_type = theOutputScalarType;
+   theOutputScalarType = scalarType;
+
+   if ( (theOutputScalarType != old_type))
+   {
+      // must reinitialize...
+      theTile = NULL;
+      initialize();
+   }
+}
+
+void ossimCastTileSourceFilter::setOutputScalarType(ossimString scalarType)
+{
+   int scalar =
+      ossimScalarTypeLut::instance()->getEntryNumber(scalarType.c_str());
+   
+   if (scalar != ossimLookUpTable::NOT_FOUND)
+   {
+      setOutputScalarType(static_cast<ossimScalarType>(scalar));
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimCastTileSourceFilter::setOutputScalarType WARN:"
+         << "\nUnknown scalar type:  " << scalarType.c_str() << endl;
+   }
+}
+
+ossimString ossimCastTileSourceFilter::getOutputScalarTypeString()const
+{
+   return ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType);
+}
+
+void ossimCastTileSourceFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   if (theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
+   {
+      // default to OSSIM_UCHAR
+      theOutputScalarType = OSSIM_UCHAR;
+   }
+}
+
+bool ossimCastTileSourceFilter::saveState(ossimKeywordlist& kwl,
+                                          const char* prefix) const
+{
+   ossimImageSourceFilter::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           ossimKeywordNames::SCALAR_TYPE_KW,
+           ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType),
+           true);
+
+   return true;
+}
+
+bool ossimCastTileSourceFilter::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   ossimImageSourceFilter::loadState(kwl, prefix);
+
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimScalarRemapper::loadState WARN:\n"
+         << " ERROR detected in keyword list!  State not loaded."
+         << endl;
+      return false;
+   }
+
+   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
+
+   if (scalar != ossimLookUpTable::NOT_FOUND)
+   {
+      theOutputScalarType = static_cast<ossimScalarType>(scalar);
+   }
+
+   return true;
+}
+
+template<class inType>
+void ossimCastTileSourceFilter::castInputToOutput(inType **inBuffer,
+                                                  const double  *nullPix,
+                                                  bool   inPartialFlag)
+{
+   switch(theTile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         ossim_uint8** bands = new ossim_uint8*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<ossim_uint8*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         ossim_sint8** bands = new ossim_sint8*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<ossim_sint8*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         ossim_sint16** bands = new ossim_sint16*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<ossim_sint16*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         ossim_uint16** bands = new ossim_uint16*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<ossim_uint16*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         ossim_uint32** bands = new ossim_uint32*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<ossim_uint32*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         ossim_sint32** bands = new ossim_sint32*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<ossim_sint32*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      
+      case OSSIM_FLOAT32: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         float** bands = new float*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<float*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         double** bands = new double*[theTile->getNumberOfBands()];
+
+         for(ossim_uint32 band = 0; band < theTile->getNumberOfBands(); ++band)
+         {
+            bands[band] = static_cast<double*>(theTile->getBuf(band));
+         }
+      
+         castInputToOutput(inBuffer,
+                           nullPix,
+                           inPartialFlag,
+                           bands,
+                           theTile->getNullPix(),
+                           theTile->getNumberOfBands());
+         delete [] bands;
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimCastTileSourceFilter::castInputToOutput WARN:\n"
+            << "Scalar not set in ossimCastTileSourceFilter" << endl;
+         break;
+      }
+   }
+}
+
+template<class inType, class outType>
+void ossimCastTileSourceFilter::castInputToOutput(inType *inBuffer[],
+                                                  const double  *nullInPix,
+                                                  bool   inPartialFlag,
+                                                  outType *outBuffer[],
+                                                  const double  *nullOutPix,
+                                                  ossim_uint32   numberOfBands)
+{
+   ossim_uint32 size = theTile->getWidth()*theTile->getHeight();
+   if(!inPartialFlag)
+   {
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         outType outMin = static_cast<outType>(theTile->getMinPix(band));
+         outType outMax = static_cast<outType>(theTile->getMaxPix(band));
+         
+         for(ossim_uint32 offset = 0; offset < size; ++offset)
+         {
+            double temp = inBuffer[band][offset];
+            if(temp < outMin) temp = outMin;
+            if(temp > outMax) temp = outMax;
+            outBuffer[band][offset] = static_cast<outType>(temp);
+         }
+      }
+   }
+   else
+   {
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         inType np      = static_cast<inType>(nullInPix[band]);
+	     outType outNp  = static_cast<outType>(nullOutPix[band]);
+         outType outMin = static_cast<outType>(theTile->getMinPix(band));
+         outType outMax = static_cast<outType>(theTile->getMaxPix(band));
+         
+         for(ossim_uint32 offset = 0; offset < size; ++offset)
+         {
+            if(inBuffer[band][offset] != np)
+            {
+               double temp = inBuffer[band][offset];
+               if(temp < outMin) temp = outMin;
+               if(temp > outMax) temp = outMax;
+               outBuffer[band][offset] = static_cast<outType>(temp);
+            }
+	    else
+	    {
+		outBuffer[band][offset] = static_cast<outType>(outNp);
+		
+	    }
+         }
+      }
+   }
+}
+
+void ossimCastTileSourceFilter::allocate(const ossimRefPtr<ossimImageData> inputTile)
+{
+   theTile = ossimImageDataFactory::instance()->create(
+      this,
+      getOutputScalarType(),
+      inputTile->getNumberOfBands(),
+      inputTile->getWidth(),
+      inputTile->getHeight());
+   theTile->initialize();
+   theTile->setOrigin(inputTile->getOrigin());
+}
+
+void ossimCastTileSourceFilter::propertyEvent(ossimPropertyEvent& /* event */)
+{
+}
+
+void ossimCastTileSourceFilter::refreshEvent(ossimRefreshEvent& /* event */)
+{
+}
+
+void ossimCastTileSourceFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(property->getName() == ossimKeywordNames::SCALAR_TYPE_KW)
+   {
+      int scalar = ossimScalarTypeLut::instance()->getEntryNumber(property->valueToString());
+      
+      if (scalar != ossimLookUpTable::NOT_FOUND)
+      {
+         setOutputScalarType(static_cast<ossimScalarType>(scalar));
+      }
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimCastTileSourceFilter::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> resultProperty;
+   if(name == ossimKeywordNames::SCALAR_TYPE_KW)
+   {
+      ossimStringProperty* stringProperty = new ossimStringProperty(name,
+                                                                    ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType),
+                                                                    false);
+
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_UINT8));
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_SINT8));
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_UINT16));
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_SINT16));
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_UINT32));
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_SINT32));
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_FLOAT32));
+      stringProperty->addConstraint(ossimScalarTypeLut::instance()->getEntryString(OSSIM_FLOAT64));
+
+      stringProperty->setCacheRefreshBit();
+      resultProperty = stringProperty;
+   }
+   else
+   {
+      resultProperty = ossimImageSourceFilter::getProperty(name);
+   }
+   return resultProperty;
+}
+
+void ossimCastTileSourceFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   
+   propertyNames.push_back(ossimKeywordNames::SCALAR_TYPE_KW);
+}
+   
diff --git a/src/imaging/ossimCcfHead.cpp b/src/imaging/ossimCcfHead.cpp
new file mode 100644
index 0000000..fc3a591
--- /dev/null
+++ b/src/imaging/ossimCcfHead.cpp
@@ -0,0 +1,822 @@
+//---
+//
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for CcfHead.
+// 
+//---
+//  $Id$
+
+#include <ossim/imaging/ossimCcfHead.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimTrace.h>
+
+#include <sstream>
+#include <iostream>
+#include <fstream>
+
+static ossimTrace traceDebug("ossimCcfHead:debug");
+
+ossimCcfHead::ossimCcfHead()
+   :
+      m_connectionString(),
+      theNumberOfBands(1),
+      thePixelType(OSSIM_UCHAR),
+      theFileType(),
+      theVersionNumber(0),
+      theLinesPerChip(0),
+      theSamplesPerChip(0),
+      theLineChipsPerChunk(0),
+      theSampleChipsPerChunk(0),
+      theRectInFullImageStartLine(0),
+      theRectInFuleImageStartSample(0),
+      theRectInFullImageStopLine(0),
+      theRectInFuleImageStopSample(0),
+      theNumberOfValidImageVertices(0),
+      theValidImageVertices(1),
+      theFirstBandHeaderPointer(0),
+      theRadiometryString(),
+      theBytesPerPixel(0),
+      theBytesPerChip(0),
+      theBytesPerChunk(0),
+      theCompressionType(),
+      theNumberOfRLevels(0),
+      theOccupiedFlag(1),
+      theStartOfData(1),
+      theNumberOfLines(1),
+      theNumberOfSamples(1),
+      theChunksInLineDir(1),
+      theChunksInSampleDir(1)
+{}
+
+//***************************************************************************
+// Public Constructor:
+//***************************************************************************
+ossimCcfHead::ossimCcfHead(const char* ccf_file)
+   :
+      m_connectionString(ccf_file),
+      theNumberOfBands(1),
+      thePixelType(OSSIM_UCHAR),
+      theFileType(),
+      theVersionNumber(0),
+      theLinesPerChip(0),
+      theSamplesPerChip(0),
+      theLineChipsPerChunk(0),
+      theSampleChipsPerChunk(0),
+      theRectInFullImageStartLine(0),
+      theRectInFuleImageStartSample(0),
+      theRectInFullImageStopLine(0),
+      theRectInFuleImageStopSample(0),
+      theNumberOfValidImageVertices(0),
+      theValidImageVertices(1),
+      theFirstBandHeaderPointer(0),
+      theRadiometryString(""),
+      theBytesPerPixel(0),
+      theBytesPerChip(0),
+      theBytesPerChunk(0),
+      theCompressionType(),
+      theNumberOfRLevels(0),
+      theOccupiedFlag(1),
+      theStartOfData(1),
+      theNumberOfLines(1),
+      theNumberOfSamples(1),
+      theChunksInLineDir(1),
+      theChunksInSampleDir(1)
+{
+   static const char MODULE[] = "ossimCcfHead::ossimCcfHead";
+   
+   if (!parseCcfHeader(ccf_file))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " ERROR!"
+            << "\nError initializing from ccf_file:  " << ccf_file
+            << "\nReturning...\n";
+      }
+   }
+}
+
+ossimCcfHead::ossimCcfHead(std::shared_ptr<ossim::istream>& str, 
+                           const std::string& connectionString)
+{
+   static const char MODULE[] = "ossimCcfHead::ossimCcfHead";
+   if(!str)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+   }
+   else if (!parseCcfHeader(str, connectionString))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " ERROR!"
+            << "\nError initializing from ccf_file:  " << connectionString
+            << "\nReturning...\n";
+      }
+   }
+
+}
+//***************************************************************************
+// Destructor:
+//***************************************************************************
+ossimCcfHead::~ossimCcfHead()
+{}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+bool ossimCcfHead::parseCcfHeader(const char* ccf_file)
+{
+   static const char MODULE[] = "ossimCcfHead::parseCcfHeader";
+   bool result = false;
+
+   std::string connectionString = ccf_file;
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( connectionString, std::ios_base::in|std::ios_base::binary);
+   if ( str )
+   {
+      result = parseCcfHeader(str, connectionString);
+   }
+   else
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " ERROR!"
+            << "\nCannot open file:  " << m_connectionString << "\n";
+      }
+   }
+   return result;
+}
+
+bool ossimCcfHead::parseCcfHeader(std::shared_ptr<ossim::istream>& str, 
+                                  const std::string& connectionString)
+{
+   static const char MODULE[] = "ossimCcfHead::parseossimCcfHeader";
+
+   bool result = false;
+
+   if ( str )
+   {
+      str->clear();
+      str->seekg(0);
+      
+      const ossim_uint32 MAX_LEN = 256;
+      char tmp[MAX_LEN];
+
+      // Check the first string should be "CCF" else get out...
+      // this might hang so I changed it to not use the
+      // >> operator unless it is a ccf file.  If it is another
+      // file we might not be guranteed a whitespace or \n character
+      // will exist and therefore the entrie file could have
+      // been read in.
+      //
+      char type[4];
+      str->read(type, 3);
+      type[3] = '\0';
+      theFileType = type;
+      if (theFileType == "CCF")
+      {
+         m_ccfStr = str;
+         m_connectionString = connectionString;
+   
+         // Check the version number.
+         (*m_ccfStr) >> tmp >> theVersionNumber;
+
+         //---
+         // Call the appropriate method for the version.  Currently only version 6
+         // supported as that was all I had in-house.  Feel free to add your own
+         // version reader!
+         //---
+         switch(theVersionNumber)
+         {
+            case 5:
+            {
+               result = parseV5CcfHeader(*m_ccfStr);
+               break;
+            }
+            case 6:
+            {
+               result = parseV6CcfHeader(*m_ccfStr);
+               break;
+            }
+            default:
+            {
+               m_ccfStr = 0;
+               // Version type not supported...
+               if (traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << MODULE << " ERROR!"
+                     << "\nUsupported version:  " << theVersionNumber
+                     << "  Returning...\n";
+               }
+            }
+            break;
+         }
+      }
+
+      if ( result )
+      {
+         //---
+         // Parse the radiometry string.  This will initialize "theNumberOfBands"
+         // and the pixel type.
+         //---
+         parseRadString();
+      }
+      else
+      {
+         str->clear();
+         str->seekg(0);
+      }
+   }
+   
+   return result;
+}
+
+//***************************************************************************
+// Private Method:
+//***************************************************************************
+bool ossimCcfHead::parseV5CcfHeader(ossim::istream& is)
+{
+   static const char MODULE[] = "CcfHead::parseV5CcfHeader";
+
+   // Check the stream.
+   if ( !is )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " Bad Stream passed to method!"
+            << "\nReturning...\n";
+      }
+      
+      return false;
+   }
+   
+   const ossim_uint32 MAX_LEN = 256;
+   char tmp[MAX_LEN];
+   
+   //---
+   // These are all fixed/not used so just skip...
+   //---
+   is.read(tmp, 1);                   // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ccf_maker"
+
+   is >> tmp // "LinesPerChip"
+      >> theLinesPerChip
+      >> tmp // "SamplesPerChip"
+      >> theSamplesPerChip
+      >> tmp // "LineChipsPerChunk"
+      >> theLineChipsPerChunk
+      >> tmp // "SampleChipsPerChunk"   
+      >> theSampleChipsPerChunk;
+
+   is.read(tmp, 1);                   // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NumberOfBands"
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "RectInFullImageSpace"
+
+   is >> tmp // skip "StartLine"
+      >> theRectInFullImageStartLine
+      >> tmp // skip "StartSample"
+      >> theRectInFuleImageStartSample
+      >> tmp // skip "StopLine"
+      >> theRectInFullImageStopLine
+      >> tmp // skip "StopSample"
+      >> theRectInFuleImageStopSample;
+
+   // No valid image vertices in this version.
+   theNumberOfValidImageVertices = 0;
+   theValidImageVertices[0] = ossimIpt(0,0);
+   
+   is.read(tmp, 1);                   // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip blank line
+
+   is >> tmp                         // skip "FirstBandHeaderPointer"
+      >> theFirstBandHeaderPointer;  // Offset to band header.
+
+   // Seek to the band header record.
+   is.seekg(theFirstBandHeaderPointer, std::ios_base::beg);
+
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "BAND" line
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NextBandHeaderPointer" line
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ChunkMapPointer" line
+
+   is >> tmp;  // skip "Radiometry"
+
+   is.getline(tmp, MAX_LEN-1, '\n'); // Get the radiometry string.
+   const char* rad = tmp;
+   while ( *rad && (*rad == ' ')) rad++;  // Eat the whitespaces...
+   theRadiometryString = rad;
+
+   is >> tmp // skip "BytesPerPixel"
+      >> theBytesPerPixel
+      >> tmp // skip "BytesPerChip"
+      >> theBytesPerChip
+      >> tmp // skip "BytesPerChunk"
+      >> theBytesPerChunk
+      >> tmp // skip "CompressionType"
+      >> theCompressionType
+      >> tmp // skip "NumberOfRLevels"
+      >> theNumberOfRLevels;
+
+   if ((ossim_uint32)theNumberOfRLevels > theOccupiedFlag.size())
+   {
+      // Resize all the vectors.
+      theOccupiedFlag.resize(theNumberOfRLevels);
+      theStartOfData.resize(theNumberOfRLevels);
+      theNumberOfLines.resize(theNumberOfRLevels);
+      theNumberOfSamples.resize(theNumberOfRLevels);
+      theChunksInLineDir.resize(theNumberOfRLevels);
+      theChunksInSampleDir.resize(theNumberOfRLevels);
+   }
+
+   is.read(tmp, 1);                  // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
+   
+   ossim_uint32 i;
+   for (i=0; i<theNumberOfRLevels; i++)
+   {
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip the Rlevel line
+
+      ossim_uint32 tmp_long;
+      
+      is >> tmp // skip "Occupied"
+         >> tmp_long;
+
+      theOccupiedFlag[i] = tmp_long;
+
+      is >> tmp // skip "StartOfData"
+         >> tmp_long;
+
+      theStartOfData[i] = tmp_long;
+      
+      is >> tmp // skip "NumberOfLines"
+         >> tmp_long;
+
+      theNumberOfLines[i] = tmp_long;
+
+      is >> tmp // skip "NumberOfSamples"
+         >> tmp_long;
+
+      theNumberOfSamples[i] = tmp_long;
+
+      is >> tmp // skip "ChunksInLineDir"
+         >> tmp_long;
+
+      theChunksInLineDir[i] = tmp_long;
+
+      is >> tmp // skip "ChunksInSampleDir"
+         >> tmp_long;
+
+      theChunksInSampleDir[i] = tmp_long;
+
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineOffset" line
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineDecimation" line
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleOffset" line
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleDecimation" line
+      is.read(tmp, 1);                  // Eat the '\n'
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
+      is.read(tmp, 1);                  // Eat the '\n'
+   }
+
+   // Note:  The caller will close the stream.
+   
+   return true;
+}
+
+//***************************************************************************
+// Private Method:
+//***************************************************************************
+bool ossimCcfHead::parseV6CcfHeader(std::istream& is)
+{
+   static const char MODULE[] = "CcfHead::parseV6CcfHeader";
+
+   // Check the stream.
+   if (!is)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " Bad Stream passed to method!"
+            << "\nReturning...\n";
+      }
+
+      return false;
+   }
+
+   const ossim_uint32 MAX_LEN = 256;
+   char tmp[MAX_LEN];
+   
+   //***
+   // These are all fixed/not used so just skip...
+   //***
+   is.read(tmp, 1);                   // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ccf_maker"
+
+   is >> tmp // "LinesPerChip"
+      >> theLinesPerChip
+      >> tmp // "SamplesPerChip"
+      >> theSamplesPerChip
+      >> tmp // "LineChipsPerChunk"
+      >> theLineChipsPerChunk
+      >> tmp // "SampleChipsPerChunk"
+      >> theSampleChipsPerChunk;
+
+   is.read(tmp, 1);                   // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NumberOfBands"
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "RectInFullImageSpace"
+
+   is >> tmp // skip "StartLine"
+      >> theRectInFullImageStartLine
+      >> tmp // skip "StartSample"
+      >> theRectInFuleImageStartSample
+      >> tmp // skip "StopLine"
+      >> theRectInFullImageStopLine
+      >> tmp // skip "StopSample"
+      >> theRectInFuleImageStopSample
+      >> tmp // skip "ValidImageVertices"
+      >> theNumberOfValidImageVertices;
+
+   // Get the valid image vertices.
+   ossim_uint32 i;
+
+   if (theNumberOfValidImageVertices != theValidImageVertices.size())
+   {
+      theValidImageVertices.resize(theNumberOfValidImageVertices);
+   }
+
+   for (i=0; i<theNumberOfValidImageVertices; i++)
+   {
+      ossimString tmp_dbl;  // Can be doubles in header.
+      
+      is >> tmp      // skip "Vertex"
+         >> tmp      // skip Vertex number
+         >> tmp_dbl; // line
+
+      theValidImageVertices[i].y = static_cast<int>(tmp_dbl.toDouble());
+      tmp_dbl = "";
+      is >> tmp_dbl; // sample
+
+      theValidImageVertices[i].x = static_cast<int>(tmp_dbl.toDouble());
+   }
+
+   is.read(tmp, 1);                   // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip blank line
+
+   is >> tmp                         // skip "FirstBandHeaderPointer"
+      >> theFirstBandHeaderPointer;  // Offset to band header.
+
+   // Seek to the band header record.
+   is.seekg(theFirstBandHeaderPointer, std::ios_base::beg);
+
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "BAND" line
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "NextBandHeaderPointer" line
+   is.getline(tmp, MAX_LEN-1, '\n');  // skip "ChunkMapPointer" line
+
+   is >> tmp;  // skip "Radiometry"
+
+   is.getline(tmp, MAX_LEN-1, '\n'); // Get the radiometry string.
+   
+   const char* rad = tmp;
+   while ( *rad && (*rad == ' ')) rad++;  // Eat the whitespaces...
+   theRadiometryString = rad;
+
+   is >> tmp // skip "BytesPerPixel"
+      >> theBytesPerPixel
+      >> tmp // skip "BytesPerChip"
+      >> theBytesPerChip
+      >> tmp // skip "BytesPerChunk"
+      >> theBytesPerChunk
+      >> tmp // skip "CompressionType"
+      >> theCompressionType
+      >> tmp // skip "NumberOfRLevels"
+      >> theNumberOfRLevels;
+
+   if (theNumberOfRLevels > theOccupiedFlag.size())
+   {
+      // Resize all the vectors.
+      theOccupiedFlag.resize(theNumberOfRLevels);
+      theStartOfData.resize(theNumberOfRLevels);
+      theNumberOfLines.resize(theNumberOfRLevels);
+      theNumberOfSamples.resize(theNumberOfRLevels);
+      theChunksInLineDir.resize(theNumberOfRLevels);
+      theChunksInSampleDir.resize(theNumberOfRLevels);
+   }
+
+   is.read(tmp, 1);                  // eat the '\n'
+   is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
+   
+   for (i=0; i<theNumberOfRLevels; i++)
+   {
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip the Rlevel line
+
+      ossim_uint32 tmp_long;
+      
+      is >> tmp // skip "Occupied"
+         >> tmp_long;
+
+      theOccupiedFlag[i] = tmp_long;
+
+      is >> tmp // skip "StartOfData"
+         >> tmp_long;
+
+      theStartOfData[i] = tmp_long;
+      
+      is >> tmp // skip "NumberOfLines"
+         >> tmp_long;
+
+      theNumberOfLines[i] = tmp_long;
+
+      is >> tmp // skip "NumberOfSamples"
+         >> tmp_long;
+
+      theNumberOfSamples[i] = tmp_long;
+
+      is >> tmp // skip "ChunksInLineDir"
+         >> tmp_long;
+
+      theChunksInLineDir[i] = tmp_long;
+
+      is >> tmp // skip "ChunksInSampleDir"
+         >> tmp_long;
+
+      theChunksInSampleDir[i] = tmp_long;      
+
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineOffset" line
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "LineDecimation" line
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleOffset" line
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip "SampleDecimation" line
+      is.read(tmp, 1);                  // Eat the '\n'
+      is.getline(tmp, MAX_LEN-1, '\n'); // skip blank line
+      is.read(tmp, 1);                  // Eat the '\n'
+   }
+
+   // Note:  The caller will close the stream.
+   
+   return true;
+}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+std::ostream& ossimCcfHead::print(std::ostream& out) const
+{
+   static const char MODULE[] = "ossimCcfHead::print";
+
+   out << MODULE
+       << "\ntheErrorStatus:                 " << theErrorStatus
+       << "\ntheCcfFile:                     " << m_connectionString
+       << "\ntheNumberOfBands:               " << theNumberOfBands
+       << "\nthePixelType:                   "
+       << (ossimScalarTypeLut::instance()->getEntryString(thePixelType))
+       << "\ntheFileType:                    " << theFileType
+       << "\ntheVersionNumber:               " << theVersionNumber
+       << "\ntheLinesPerChip:                " << theLinesPerChip
+       << "\ntheSamplesPerChip:              " << theSamplesPerChip
+       << "\ntheLineChipsPerChunk:           " << theLineChipsPerChunk
+       << "\ntheSampleChipsPerChunk:         " << theSampleChipsPerChunk
+       << "\ntheRectInFullImageStartLine:    " << theRectInFullImageStartLine
+       << "\ntheRectInFuleImageStartSample:  " << theRectInFuleImageStartSample
+       << "\ntheRectInFullImageStopLine:     " << theRectInFullImageStopLine
+       << "\ntheRectInFuleImageStopSample:   " << theRectInFuleImageStopSample
+       << "\ntheNumberOfValidImageVertices:  "
+       << theNumberOfValidImageVertices;
+   
+   ossim_uint32 i;
+   
+   for (i=0; i<theNumberOfValidImageVertices; i++)
+   {
+      out << "\ntheValidImageVertices[" << i << "]:  "
+          << theValidImageVertices[i];
+   }
+   
+   out << "\ntheFirstBandHeaderPointer:  " << theFirstBandHeaderPointer
+       << "\ntheRadiometryString:        " << theRadiometryString
+       << "\ntheBytesPerPixel:           " << theBytesPerPixel
+       << "\ntheBytestPerChip:           " << theBytesPerChip
+       << "\ntheBytesPerChunk:           " << theBytesPerChunk
+       << "\ntheCompressionType:         " << theCompressionType
+       << "\ntheNumberOfRLevels:         " << theNumberOfRLevels;
+   
+   for (i=0; i<theNumberOfRLevels; i++)
+   {
+      out << "\ntheOccupiedFlag[" << i << "]:       " << theOccupiedFlag[i]
+          << "\ntheStartOfData[" << i << "]:        " << theStartOfData[i]
+          << "\ntheNumberOfLines[" << i << "]:      " << theNumberOfLines[i]
+          << "\ntheNumberOfSamples[" << i << "]:    " << theNumberOfSamples[i]
+          << "\ntheChunksInLineDir[" << i << "]:    " << theChunksInLineDir[i]
+          << "\ntheChunksInSampleDir[" << i << "]:  "
+          << theChunksInSampleDir[i];
+   }
+   
+   out << std::endl;
+
+   return ossimErrorStatusInterface::print(out);
+}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+ossim_uint32 ossimCcfHead::numberOfLines(ossim_uint32 reduced_res_level) const
+{
+   static const char MODULE[] = "ossimCcfHead::numberOfLines";
+
+   if (reduced_res_level > highestReducedResSet() )
+   {
+       ossimNotify(ossimNotifyLevel_WARN)
+          << MODULE << " ERROR!"
+          << "\nInvalid reduced res level:  " << reduced_res_level
+          << "\nHighest reduced res level available:  "
+          << highestReducedResSet() << std::endl;   
+       return 0;
+   }
+
+   return theNumberOfLines[reduced_res_level];
+}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+ossim_uint32 ossimCcfHead::numberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   static const char MODULE[] = "ossimCcfHead::numberOfSamples";
+
+   if (reduced_res_level > highestReducedResSet() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " ERROR!"
+         << "\nInvalid reduced res level:  " << reduced_res_level
+         << "\nHighest reduced res level available:  "
+         << highestReducedResSet() << std::endl;   
+      return 0;
+   }
+   
+   return theNumberOfSamples[reduced_res_level];
+}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+ossim_uint32 ossimCcfHead::chunksInLineDir(ossim_uint32 reduced_res_level) const
+{
+   static const char MODULE[] = "ossimCcfHead::chunksInLineDir";
+
+   if (reduced_res_level > highestReducedResSet() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " ERROR!"
+         << "\nInvalid reduced res level:  " << reduced_res_level
+         << "\nHighest reduced res level available:  "
+         << highestReducedResSet() << std::endl;   
+      return 0;
+   }
+   
+   return theChunksInLineDir[reduced_res_level];
+}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+ossim_uint32 ossimCcfHead::chunksInSampleDir(ossim_uint32 reduced_res_level) const
+{
+   static const char MODULE[] = "ossimCcfHead::chunksInSampleDir";
+
+   if (reduced_res_level > highestReducedResSet() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " ERROR!"
+         << "\nInvalid reduced res level:  " << reduced_res_level
+         << "\nHighest reduced res level available:  "
+         << highestReducedResSet() << std::endl;   
+      return 0;
+   }
+   
+   return theChunksInSampleDir[reduced_res_level];
+}
+
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+std::streampos ossimCcfHead::startOfData(ossim_uint32 reduced_res_level) const
+{
+   static const char MODULE[] = "ossimCcfHead::startOfData";
+
+   if (reduced_res_level > highestReducedResSet() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " ERROR!"
+           << "\nInvalid reduced res level:  " << reduced_res_level
+           << "\nHighest reduced res level available:  "
+           << highestReducedResSet() << std::endl;   
+      return 0;
+   }
+   
+   return theStartOfData[reduced_res_level];
+}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+ossimIrect ossimCcfHead::imageRect(ossim_uint32 reduced_res_level) const
+{
+   static const char MODULE[] = "ossimCcfHead::imageRect";
+   
+   if (reduced_res_level > highestReducedResSet() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " ERROR!"
+           << "\nInvalid reduced res level:  " << reduced_res_level
+           << "\nHighest reduced res level available:  "
+           << highestReducedResSet() << std::endl;
+      return ossimIrect(0,0,0,0);
+   }
+
+   return ossimIrect(0,
+                     0,
+                     numberOfSamples(reduced_res_level) - 1,
+                     numberOfLines(reduced_res_level)   - 1);
+}
+
+//***************************************************************************
+// Public Method:
+//***************************************************************************
+void ossimCcfHead::parseRadString()
+{
+   static const char MODULE[] = "ossimCcfHead::parseRadString";
+   
+   if (theRadiometryString.contains("RadiomNBand"))
+   {
+      //***
+      // Complex string, must parse. Should look like:
+      // "RadiomNBand (3 3 Linear8 )"
+      //***
+      char tmp[80];
+      std::istringstream is(theRadiometryString);
+
+      is >> tmp;               // Skip the "RadiomNBand" string.
+      is.get(tmp, 3);          // Eat the space and the '('.
+      is >> theNumberOfBands;  // Get the number of bands.
+   }
+
+   if (theRadiometryString.contains("8"))
+   {
+      thePixelType = OSSIM_UCHAR;
+   }
+   else if(theRadiometryString.contains("16"))
+   {
+      thePixelType = OSSIM_USHORT16;
+   }
+   else if (theRadiometryString.contains("11"))
+   {
+      thePixelType = OSSIM_USHORT11;
+   }
+   else if (theRadiometryString.contains("12"))
+   {
+      thePixelType = OSSIM_USHORT12;
+   }
+   else if (theRadiometryString.contains("13"))
+   {
+      thePixelType = OSSIM_USHORT13;
+   }
+   else if (theRadiometryString.contains("14"))
+   {
+      thePixelType = OSSIM_USHORT14;
+   }
+   else if (theRadiometryString.contains("15"))
+   {
+      thePixelType = OSSIM_USHORT15;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " Unknown radiometry!"
+         << "\ntheRadiometryString:  " << theRadiometryString << std::endl;
+   }
+
+   if (traceDebug())
+   {
+       ossimNotify(ossimNotifyLevel_DEBUG)
+          << MODULE
+          << "\ntheRadiometryString:  " << theRadiometryString
+          << "\ntheNumberOfBands:     " << theNumberOfBands
+          << "\nthePixelType:         "
+          << (ossimScalarTypeLut::instance()->getEntryString(thePixelType))
+          << "\n";
+   }
+}
diff --git a/src/imaging/ossimCcfTileSource.cpp b/src/imaging/ossimCcfTileSource.cpp
new file mode 100644
index 0000000..867d248
--- /dev/null
+++ b/src/imaging/ossimCcfTileSource.cpp
@@ -0,0 +1,905 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimCcfTileSource.
+//*******************************************************************
+//  $Id: ossimCcfTileSource.cpp 17195 2010-04-23 17:32:18Z dburken $
+
+#include <algorithm>
+#include <ossim/imaging/ossimCcfTileSource.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimInterleaveTypeLut.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+using namespace std;
+
+RTTI_DEF1(ossimCcfTileSource, "ossimCcfTileSource", ossimImageHandler);
+
+//***
+// Define Trace flags for use within this file:
+//***
+
+static ossimTrace traceExec  ("ossimCcfTileSource:exec");
+static ossimTrace traceDebug ("ossimCcfTileSource:debug");
+
+// For interleave type enum to string conversions.
+static const ossimInterleaveTypeLut ILUT;
+
+ossimCcfTileSource::ossimCcfTileSource()
+   :
+      ossimImageHandler(),
+      theCcfHead(),
+      theTile(NULL),
+      theChipBuffer(NULL),
+      theFileStr(NULL),
+      theOutputBandList(1),
+      theByteOrder(ossim::byteOrder())
+{}
+
+ossimCcfTileSource::~ossimCcfTileSource()
+{
+  close();
+}
+
+ossimRefPtr<ossimImageData> ossimCcfTileSource::getTile(
+   const  ossimIrect& rect, ossim_uint32 resLevel)
+{
+   if (theTile.valid())
+   {
+      // Image rectangle must be set prior to calling getTile.
+      theTile->setImageRectangle(rect);
+      
+      if ( getTile( theTile.get(), resLevel ) == false )
+      {
+         if (theTile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            theTile->makeBlank();
+         }
+      }
+   }
+
+   return theTile;
+}
+
+bool ossimCcfTileSource::getTile(ossimImageData* result,
+                                 ossim_uint32 resLevel)
+{
+   bool status = false;
+
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
+   {
+      result->ref();  // Increment ref count.
+
+      //---
+      // Check for overview tile.  Some overviews can contain r0 so always
+      // call even if resLevel is 0.  Method returns true on success, false
+      // on error.
+      //---
+      status = getOverviewTile(resLevel, result);
+      
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+         
+         ossimIrect tile_rect = result->getImageRectangle();
+         
+         ossimIrect image_rect = theCcfHead.imageRect(resLevel);
+   
+         //---
+         // See if any point of the requested tile is in the image.
+         //---
+         if ( tile_rect.intersects(image_rect) )
+         {
+            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
+            
+            if ( !tile_rect.completely_within(clip_rect) )
+            {
+               // Start with a blank tile.
+               result->makeBlank();
+            }
+            
+            // Load the tile buffer with data from the ccf.
+            status = fillBuffer(tile_rect,
+                                clip_rect,
+                                image_rect,
+                                resLevel,
+                                result);
+            if (status)
+            {
+               result->validate();
+            }
+         }
+      }
+      
+      result->unref();  // Decrement ref count.
+   }
+
+   return status;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimCcfTileSource::fillBuffer(const ossimIrect& tile_rect,
+                                    const ossimIrect& clip_rect,
+                                    const ossimIrect& image_rect,
+                                    ossim_uint32 reduced_res_level,
+                                    ossimImageData* tile)
+{
+   bool status = false;
+   
+   //***
+   // Determine the pixel type and make the appropriate tiles.
+   //***
+   switch (theCcfHead.pixelType())
+   {
+      case OSSIM_UCHAR:
+         status = fillUcharBuffer(tile_rect,
+                                  clip_rect,
+                                  image_rect,
+                                  reduced_res_level,
+                                  tile);
+         break;
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_USHORT16:
+         status = fillUshortBuffer(tile_rect,
+                                   clip_rect,
+                                   image_rect,
+                                   reduced_res_level,
+                                   tile);
+         break;
+      default:
+         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimCcfTileSource fillBuffer ERROR:"
+            << "\nUnsupported pixel type!"
+            << "\nBuffer not filled.  Returning error." << endl;
+         break;
+   }
+
+   return status;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimCcfTileSource::fillUcharBuffer(const ossimIrect& tile_rect,
+                                         const ossimIrect& clip_rect,
+                                         const ossimIrect& /* image_rect */,
+                                         ossim_uint32 reduced_res_level,
+                                         ossimImageData* tile)
+{
+   if(!isOpen()) return false;
+      
+   const ossim_uint32 TILE_SIZE_PER_BAND     = tile->getSizePerBand();
+   const ossim_uint32 CHIP_SIZE_PER_BAND     = theCcfHead.chipSizePerBand();
+   const ossim_uint32 SAMPLES_PER_CHIP       = theCcfHead.samplesPerChip();
+   const ossim_uint32 LINES_PER_CHIP         = theCcfHead.linesPerChip();
+   const ossim_uint32 BYTES_PER_CHUNK        = theCcfHead.bytesPerChunk();
+   const ossim_uint32 BYTES_PER_CHIP         = theCcfHead.bytesPerChip();
+   const ossim_uint32 CHIPS_IN_SAMPLE_DIR    = theCcfHead.sampleChipsPerChunk();
+   const ossim_uint32 CHIPS_IN_LINE_DIR      = theCcfHead.lineChipsPerChunk();
+   const ossim_uint32 NUMBER_OF_INPUT_BANDS  = theCcfHead.numberOfBands();
+   const ossim_uint32 CHUNKS_IN_SAMPLE_DIR   = theCcfHead.chunksInSampleDir(reduced_res_level);
+   const ossim_uint32 CHUNK_SIDE_SIZE        = SAMPLES_PER_CHIP *
+                                        CHIPS_IN_SAMPLE_DIR;
+   const ossim_uint32 CHIP_OFFSET_TO_END     = SAMPLES_PER_CHIP - 1;
+
+   //***
+   // Shift the upper left corner of the "clip_rect" to the an even chunk
+   // boundry.
+   //***
+   ossimIpt chunkOrigin = clip_rect.ul();
+   adjustToStartOfChunk(chunkOrigin);
+
+   //***
+   // Calculate the number of chunks needed in the line/sample directions.
+   //***
+   ossim_uint32 size_in_x
+      = static_cast<ossim_uint32>(clip_rect.lr().x - chunkOrigin.x + 1);
+   ossim_uint32 size_in_y
+      = static_cast<ossim_uint32>(clip_rect.lr().y - chunkOrigin.y + 1);
+   ossim_uint32 w = (CHIPS_IN_SAMPLE_DIR*SAMPLES_PER_CHIP);
+   ossim_uint32 h = (CHIPS_IN_LINE_DIR*LINES_PER_CHIP);
+   ossim_uint32 chunks_in_x_dir = size_in_x / w  + (size_in_x % w  ? 1 : 0);
+   ossim_uint32 chunks_in_y_dir = size_in_y / h + (size_in_y % h ? 1 : 0);
+   
+   
+   //***
+   // Get the start of data for the "reduced_res_level" passed in.
+   //***
+   streampos startOfData = theCcfHead.startOfData(reduced_res_level);
+   ossimIpt ulChunkPt = chunkOrigin;
+
+   // Chunk loop in line direction.
+   for (ossim_uint32 y=0; y<chunks_in_y_dir; ++y)
+   {
+      ulChunkPt.x = chunkOrigin.x;
+
+      // Chunk loop in sample direction.
+      for (ossim_uint32 x=0; x<chunks_in_x_dir; ++x)
+      {
+         //***
+         // Sequence through the chips in the chunk.
+         // Grab the ccf data and stuff the tile buffer.
+         //***
+         ossimIpt chip_pt = ulChunkPt;
+
+         // Chip loop in line direction.
+         for (ossim_uint32 y_chip=0; y_chip<CHIPS_IN_LINE_DIR; ++y_chip) 
+         {
+            chip_pt.x = ulChunkPt.x;  // Reset x back to front of chunk.
+
+            // Chip loop in sample direction.
+            for (ossim_uint32 x_chip=0; x_chip<CHIPS_IN_SAMPLE_DIR; ++x_chip)
+            {
+               ossimIrect chip_rect(chip_pt.x,
+                               chip_pt.y,
+                               chip_pt.x + CHIP_OFFSET_TO_END,
+                               chip_pt.y + CHIP_OFFSET_TO_END);
+               
+               if (chip_rect.intersects(clip_rect))
+               {
+                  //***
+                  // Some point in the chip intersect the tile so grab the
+                  // data.
+                  //***
+
+                  //***
+                  // Get the seek position for the chunk.
+                  //***
+                  streampos tmp_offset
+                     = ( ulChunkPt.y / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK *
+                         CHUNKS_IN_SAMPLE_DIR ) +
+                     ( ulChunkPt.x / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK );
+
+                  streampos seek_position = startOfData + tmp_offset;
+
+                  // Now move it to the chip.
+                  tmp_offset
+                     = ( y_chip *  BYTES_PER_CHIP * CHIPS_IN_SAMPLE_DIR ) +
+                     (x_chip * BYTES_PER_CHIP);
+
+                  seek_position += tmp_offset;
+
+                  // Seek to the chip
+                  theFileStr->seekg(seek_position, ios::beg);
+
+                  //***
+                  // Read the chip from the ccf file into the chip buffer.
+                  // This will get all the bands.  Bands are interleaved by
+                  // chip.
+                  //***
+                  if (!theFileStr->read((char*)theChipBuffer, BYTES_PER_CHIP))
+                  {
+                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+                     cerr << "ossimCcfTileSource fillUchBuffer READ ERROR!"
+                          << "\nReturning from method." << endl;
+                     return false;
+                  }
+                  
+                  ossimIrect chip_clip_rect = clip_rect.clipToRect(chip_rect);
+
+                  //***
+                  // Band loop in sample direction.  Bands are interleaved by
+                  // chip.
+                  //***
+                  for (ossim_uint32 band=0; band<NUMBER_OF_INPUT_BANDS; ++band)
+                  {
+                     //***
+                     // Get a pointer positioned at the first valid pixel in
+                     // the chip.
+                     //***
+                     ossim_uint8* s
+                        = theChipBuffer +
+                        band * CHIP_SIZE_PER_BAND + 
+                        (chip_clip_rect.ul().y - chip_rect.ul().y) *
+                        SAMPLES_PER_CHIP + chip_clip_rect.ul().x -
+                        chip_rect.ul().x;
+                                
+                     //***
+                     // Get a pointer positioned at the first valid pixel in
+                     // the tile.
+                     //***
+                     ossim_uint8* d
+                        = (ossim_uint8*)tile->getBuf() +
+                        band * TILE_SIZE_PER_BAND +
+                        (chip_clip_rect.ul().y - tile_rect.ul().y) *
+                        tile->getWidth() + chip_clip_rect.ul().x -
+                        tile_rect.ul().x;      
+
+                     // Line loop through a chip.
+                     for (ossim_int32 chip_line = chip_clip_rect.ul().y;
+                          chip_line <= chip_clip_rect.lr().y;
+                          chip_line++)
+                     {
+                        // Sample loop through a chip.
+                        ossim_uint32 i=0;
+                        for (ossim_int32 chip_sample = chip_clip_rect.ul().x;
+                             chip_sample <= chip_clip_rect.lr().x;
+                             chip_sample++)
+                        {
+                           d[i] = s[i];
+                           i++;
+                        }
+
+                        // Increment the pointers by one line.
+                        s += SAMPLES_PER_CHIP;
+                        d += tile->getWidth();
+                     }
+                     
+                  } // End of band loop.
+                  
+               } // End of if (chip_rect.intersects(clip_rect))
+               
+               chip_pt.x += SAMPLES_PER_CHIP;
+               
+            } // End of chip loop in the sample direction.
+
+           chip_pt.y += LINES_PER_CHIP; 
+            
+         } // End of chip loop in the line direction.
+         
+         ulChunkPt.x += CHUNK_SIDE_SIZE;
+         
+      }  // End of chunk loop in the sample direction.
+
+      ulChunkPt.y += CHUNK_SIDE_SIZE;
+      
+   }  // End of chunk loop in the line direction.
+
+   return true;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimCcfTileSource::fillUshortBuffer(const ossimIrect& tile_rect,
+                                          const ossimIrect& clip_rect,
+                                          const ossimIrect& /* image_rect */,
+                                          ossim_uint32 reduced_res_level,
+                                          ossimImageData* tile)
+{
+   const ossim_uint32 TILE_SIZE_PER_BAND     = tile->getSizePerBand();
+   const ossim_uint32 CHIP_SIZE_PER_BAND     = theCcfHead.chipSizePerBand();
+   const ossim_uint32 SAMPLES_PER_CHIP       = theCcfHead.samplesPerChip();
+   const ossim_uint32 LINES_PER_CHIP         = theCcfHead.linesPerChip();
+   const ossim_uint32 BYTES_PER_CHUNK        = theCcfHead.bytesPerChunk();
+   const ossim_uint32 BYTES_PER_CHIP         = theCcfHead.bytesPerChip();
+   const ossim_uint32 CHIPS_IN_SAMPLE_DIR    = theCcfHead.sampleChipsPerChunk();
+   const ossim_uint32 CHIPS_IN_LINE_DIR      = theCcfHead.lineChipsPerChunk();
+   const ossim_uint32 NUMBER_OF_INPUT_BANDS  = theCcfHead.numberOfBands();
+   const ossim_uint32 CHUNKS_IN_SAMPLE_DIR   = theCcfHead.
+                                        chunksInSampleDir(reduced_res_level);
+   const ossim_uint32 CHUNK_SIDE_SIZE        = SAMPLES_PER_CHIP *
+                                        CHIPS_IN_SAMPLE_DIR;
+   const ossim_uint32 CHIP_OFFSET_TO_END     = SAMPLES_PER_CHIP - 1;
+   
+   //***
+   // Shift the upper left corner of the "clip_rect" to the an even chunk
+   // boundry.
+   //***
+   ossimIpt chunkOrigin = clip_rect.ul();
+   adjustToStartOfChunk(chunkOrigin);
+
+   //***
+   // Calculate the number of chunks needed in the line/sample directions.
+   //***
+   
+   ossim_uint32 size_in_x = clip_rect.lr().x - chunkOrigin.x + 1;
+   ossim_uint32 size_in_y = clip_rect.lr().y - chunkOrigin.y + 1;
+   ossim_uint32 w = (CHIPS_IN_SAMPLE_DIR*SAMPLES_PER_CHIP);
+   ossim_uint32 h = (CHIPS_IN_LINE_DIR*LINES_PER_CHIP);
+   ossim_uint32 chunks_in_x_dir = size_in_x / w  + (size_in_x % w  ? 1 : 0);
+   ossim_uint32 chunks_in_y_dir = size_in_y / h + (size_in_y % h ? 1 : 0);
+   //***
+   // Get the start of data for the "reduced_res_level" passed in.
+   //***
+   streampos startOfData = theCcfHead.startOfData(reduced_res_level);
+   ossimIpt ulChunkPt = chunkOrigin;
+
+   // Chunk loop in line direction.
+   for (ossim_uint32 y=0; y<chunks_in_y_dir; ++y)
+   {
+      ulChunkPt.x = chunkOrigin.x;
+
+      // Chunk loop in sample direction.
+      for (ossim_uint32 x=0; x<chunks_in_x_dir; ++x)
+      {
+         //***
+         // Sequence through the chips in the chunk.
+         // Grab the ccf data and stuff the tile buffer.
+         //***
+         ossimIpt chip_pt = ulChunkPt;
+
+         // Chip loop in line direction.
+         for (ossim_uint32 y_chip=0; y_chip<CHIPS_IN_LINE_DIR; ++y_chip) 
+         {
+            chip_pt.x = ulChunkPt.x;  // Reset x back to front of chunk.
+
+            // Chip loop in sample direction.
+            for (ossim_uint32 x_chip=0; x_chip<CHIPS_IN_SAMPLE_DIR; ++x_chip)
+            {
+               ossimIrect chip_rect(chip_pt.x,
+                               chip_pt.y,
+                               chip_pt.x + CHIP_OFFSET_TO_END,
+                               chip_pt.y + CHIP_OFFSET_TO_END);
+               
+               if (chip_rect.intersects(clip_rect))
+               {
+                  //***
+                  // Some point in the chip intersect the tile so grab the
+                  // data.
+                  //***
+
+                  //***
+                  // Get the seek position for the chunk.
+                  //***
+                  streampos tmp_offset
+                     = ( ulChunkPt.y / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK *
+                         CHUNKS_IN_SAMPLE_DIR ) +
+                     ( ulChunkPt.x / CHUNK_SIDE_SIZE * BYTES_PER_CHUNK );
+
+                  streampos seek_position = startOfData + tmp_offset;
+
+                  // Now move it to the chip.
+                  tmp_offset
+                     = ( y_chip *  BYTES_PER_CHIP * CHIPS_IN_SAMPLE_DIR ) +
+                     (x_chip * BYTES_PER_CHIP);
+
+                  seek_position += tmp_offset;
+
+                  // Seek to the chip
+                  theFileStr->seekg(seek_position, ios::beg);
+
+                  //***
+                  // Read the chip from the ccf file into the chip buffer.
+                  // This will get all the bands.  Bands are interleaved by
+                  // chip.
+                  //***
+                  if (!theFileStr->read((char*)theChipBuffer, BYTES_PER_CHIP))
+                  {
+                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+                     cerr << "ossimCcfTileSource fillUshortBuffer READ ERROR!"
+                          << "Returning from method." << endl;
+                     return false;
+                  }
+                  
+                  ossimIrect chip_clip_rect = clip_rect.clipToRect(chip_rect);
+
+                  //***
+                  // Band loop in sample direction.  Bands are interleaved by
+                  // chip.
+                  //***
+                  for (ossim_uint32 band=0; band<NUMBER_OF_INPUT_BANDS; band++)
+                  {
+                     //***
+                     // Get a pointer positioned at the first valid pixel in
+                     // the chip.
+                     //***
+                     ossim_uint16* s
+                        = (ossim_uint16*)theChipBuffer +
+                        band * CHIP_SIZE_PER_BAND + 
+                        (chip_clip_rect.ul().y - chip_rect.ul().y) *
+                        SAMPLES_PER_CHIP + chip_clip_rect.ul().x -
+                        chip_rect.ul().x;       
+                     
+                     //***
+                     // Get a pointer positioned at the first valid pixel in
+                     // the tile.
+                     //***
+                     ossim_uint16* d
+                        = (ossim_uint16*)tile->getBuf() +
+                        band * TILE_SIZE_PER_BAND +
+                        (chip_clip_rect.ul().y - tile_rect.ul().y) *
+                        tile->getWidth() + chip_clip_rect.ul().x -
+                        tile_rect.ul().x;
+                     
+                     // Line loop through a chip.
+                     for (ossim_int32 chip_line = chip_clip_rect.ul().y;
+                          chip_line <= chip_clip_rect.lr().y;
+                          ++chip_line)
+                     {
+                        // Sample loop through a chip.
+                        ossim_uint32 i=0;
+                        for (ossim_int32 chip_sample = chip_clip_rect.ul().x;
+                             chip_sample <= chip_clip_rect.lr().x;
+                             ++chip_sample)
+                        {
+                           if (theByteOrder == OSSIM_LITTLE_ENDIAN)
+                           {
+                              //***
+                              // CCF data alway stored in big endian byte
+                              // order so swap the bytes.
+                              //***
+                              d[i] = (s[i] << 8) | (s[i] >> 8);
+                           }
+                           else
+                           {
+                              d[i] = s[i];
+                           }
+                           
+                           ++i;
+                        }
+
+                        // Increment the pointers by one line.
+                        s += SAMPLES_PER_CHIP;
+                        d += tile->getWidth();
+                     }
+                     
+                  } // End of band loop.
+                  
+               } // End of if (chip_rect.intersects(clip_rect))
+               
+               chip_pt.x += SAMPLES_PER_CHIP;
+               
+            } // End of chip loop in the sample direction.
+
+           chip_pt.y += LINES_PER_CHIP; 
+            
+         } // End of chip loop in the line direction.
+         
+         ulChunkPt.x += CHUNK_SIDE_SIZE;
+         
+      }  // End of chunk loop in the sample direction.
+
+      ulChunkPt.y += CHUNK_SIDE_SIZE;
+      
+   }  // End of chunk loop in the line direction.
+
+   return true;
+}
+   
+            
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+ossimIrect
+ossimCcfTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return theCcfHead.imageRect(reduced_res_level);
+}
+
+//*******************************************************************
+// Public Method:
+//*******************************************************************
+bool ossimCcfTileSource::setOutputBandList(const vector<ossim_uint32>& outputBandList)
+{
+   static const char MODULE[] = "ossimCcfTileSource::setOutputBandList";
+   if (traceExec())  CLOG << "entering..." << endl;
+   
+   if (outputBandList.size() != theOutputBandList.size())
+   {
+      //***
+      // Verify that each individual band does not bust the range of input
+      // bands.
+      //***
+      for (ossim_uint32 i=0; i<outputBandList.size(); i++)
+      {
+         if (outputBandList[i] > (getNumberOfInputBands() - 1))
+         {
+            setErrorStatus();
+
+            cerr << MODULE << " ERROR:"
+                 << "\nOutput band number in list is greater than the "
+                 << "number of bands in the image source!"
+                 << "\noutputBandList[" << i << "]:  "
+                 << "\nHighest availabe band:  "
+                 << (getNumberOfInputBands() - 1)
+                 << "\nError status has been set!  Returning..."
+                 << endl;
+            return false;            
+         }
+      }
+
+      // Remove the old tiles and reallocate with the new size.
+      theTile = NULL;
+   }
+
+   theOutputBandList = outputBandList;  // Assign the new list.
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return true;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimCcfTileSource::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix) const
+{
+   // Currently nothing to do here.
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimCcfTileSource::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   if (ossimImageHandler::loadState(kwl, prefix))
+   {
+      if (open())
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimCcfTileSource::open()
+{
+   static const char MODULE[] = "ossimCcfTileSource::open";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   if(isOpen())
+   {
+      close();
+   }
+   
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t theImageFile: " << theImageFile << endl;
+   }
+   
+   if (theCcfHead.parseCcfHeader(theImageFile.c_str()) == false)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      if (traceExec())  CLOG << "returning with error..." << endl;
+      return false;
+   }
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t theImageFile: " << theImageFile
+           << "\n\t theCcfHead: " << theCcfHead
+           << endl;
+   }
+
+   theFileStr = new std::ifstream;
+   // Open up the file for reading.
+   theFileStr->open(theImageFile.c_str(), ios::in | ios::binary);
+   
+   if (!(*theFileStr))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      
+      cerr << MODULE << " ERROR!"
+           << "\nCould not open file:  " << theImageFile.c_str()
+           << "\nReturning..." << endl;
+      if (traceExec())  CLOG << "returning with error..." << endl;
+
+      delete theFileStr;
+      theFileStr = NULL;
+      return false;
+   }
+
+   theTile = ossimImageDataFactory::instance()->create(this, this);
+   theTile->initialize();
+     
+   theChipBuffer  = new ossim_uint8[theCcfHead.bytesPerChip()];
+   
+   // Initialize the output band list.
+   if (getNumberOfInputBands() > theOutputBandList.size())
+   {
+      theOutputBandList.resize(getNumberOfInputBands());
+   }
+   
+   for (ossim_uint32 i=0; i<getNumberOfInputBands(); ++i)
+   {
+      theOutputBandList[i] = i; // One to one for initial setup.
+   }
+   
+   completeOpen();
+   
+   if (traceDebug() && theTile.valid())
+   {
+      CLOG << "DEBUG:"
+           << "\ntheTile:\n" << *theTile << endl;
+   }
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return true;
+}
+
+void ossimCcfTileSource::close()
+{
+   theTile = NULL;
+   if (theChipBuffer)
+   {
+      delete [] theChipBuffer;
+      theChipBuffer = NULL;
+   }
+   if(theFileStr)
+   {
+      theFileStr->close();
+      theFileStr->clear();
+      delete theFileStr;
+      theFileStr = NULL;
+   }
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossimScalarType ossimCcfTileSource::getOutputScalarType() const
+{
+   return theCcfHead.pixelType();
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimCcfTileSource::getTileWidth() const
+{
+   return ( theTile.valid() ? theTile->getWidth() : 0 );
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimCcfTileSource::getTileHeight() const
+{
+   return ( theTile.valid() ? theTile->getHeight() : 0 );
+}
+
+ossim_uint32 ossimCcfTileSource::getImageTileWidth() const
+{
+   return 32;
+}
+
+ossim_uint32 ossimCcfTileSource::getImageTileHeight() const
+{
+   return 32;
+}
+
+void ossimCcfTileSource::initVerticesFromHeader()
+{
+   theValidImageVertices.clear();
+   
+   const vector<ossimIpt>& validImageVertices
+      = theCcfHead.getValidImageVertices();
+   
+   ossim_uint32 upper = (ossim_uint32)validImageVertices.size();
+   if(!upper) return;
+   for(ossim_uint32 index = 0; index < upper; ++index)
+   {
+      theValidImageVertices.push_back(validImageVertices[index]);
+   }
+
+   if (traceDebug())
+   {
+      cout << "ossimCcfTileSource::initVerticesFromHeader DEBUG:"
+           << "\nValid image vertices:"
+           << endl;
+      for (ossim_uint32 i=0; i<upper; ++i)
+      {
+         cout << "\npoint[" << i << "]:  " << theValidImageVertices[i];
+      }
+      cout << endl;
+   }
+}
+
+bool ossimCcfTileSource::isEcgGeom(const ossimFilename& filename)const
+{
+   ossimFilename file = filename;
+   file.setExtension("geom");
+   
+   if(file.exists())
+   {
+      char bytes[3];
+      ifstream in(file.c_str());
+      
+      in.read((char*)bytes, 3);
+      ossimString testEcg(bytes,
+                          bytes + 3);
+      testEcg = testEcg.downcase();
+      if(in&&(testEcg == "ecg"))
+      {
+         return true;
+      }
+   }
+   return false;
+}
+
+ossimString ossimCcfTileSource::getShortName()const
+{
+   return ossimString("ccf");
+}
+
+ossimString ossimCcfTileSource::getLongName()const
+{
+   return ossimString("ccf reader");
+}
+
+ossim_uint32 ossimCcfTileSource::getNumberOfInputBands() const
+{
+   return theCcfHead.numberOfBands();
+}
+
+ossim_uint32 ossimCcfTileSource::getNumberOfOutputBands()const
+{
+   return getNumberOfInputBands();
+}
+
+ossim_uint32 ossimCcfTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   return theCcfHead.numberOfLines(reduced_res_level);
+}
+
+ossim_uint32 ossimCcfTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   return theCcfHead.numberOfSamples(reduced_res_level);
+}
+
+ossim_uint32 ossimCcfTileSource::getNumberOfDecimationLevels() const
+{
+   return theCcfHead.numberOfReducedResSets();
+}
+
+bool ossimCcfTileSource::isOpen()const
+{
+   return (theFileStr != NULL);
+}
+
+ossimRefPtr<ossimProperty> ossimCcfTileSource::getProperty(const ossimString& name)const
+{
+	if(name == "file_type")
+	{
+		
+		return new ossimStringProperty(name, "CCF");
+	}
+	return ossimImageHandler::getProperty(name);
+}
+
+void ossimCcfTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+	ossimImageHandler::getPropertyNames(propertyNames);
+	propertyNames.push_back("file_type");
+}
+
+void ossimCcfTileSource::adjustToStartOfChunk(ossimIpt& pt) const
+{
+   pt.x &= 0xffffff00;
+   pt.y &= 0xffffff00;
+}
+
+void ossimCcfTileSource::adjustToStartOfChip(ossimIpt& pt) const
+{
+   pt.x &= 0xffffffe0;
+   pt.y &= 0xffffffe0;
+}
diff --git a/src/imaging/ossimCibCadrgTileSource.cpp b/src/imaging/ossimCibCadrgTileSource.cpp
new file mode 100644
index 0000000..b2256bb
--- /dev/null
+++ b/src/imaging/ossimCibCadrgTileSource.cpp
@@ -0,0 +1,1361 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//********************************************************************
+// $Id: ossimCibCadrgTileSource.cpp 23021 2014-12-04 20:57:16Z dburken $
+#include <algorithm>
+
+#include <ossim/imaging/ossimCibCadrgTileSource.h>
+
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimNBandLutDataObject.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimRpfFrame.h>
+#include <ossim/support_data/ossimRpfHeader.h>
+#include <ossim/support_data/ossimRpfToc.h>
+#include <ossim/support_data/ossimRpfTocEntry.h>
+#include <ossim/support_data/ossimRpfCompressionSection.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimCylEquAreaProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceDebug = ossimTrace("ossimCibCadrgTileSource:debug");
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimCibCadrgTileSource.cpp 23021 2014-12-04 20:57:16Z dburken $";
+#endif
+
+RTTI_DEF1(ossimCibCadrgTileSource, "ossimCibCadrgTileSource", ossimImageHandler)
+
+const ossim_uint32 ossimCibCadrgTileSource::CIBCADRG_FRAME_WIDTH  = 1536;
+const ossim_uint32 ossimCibCadrgTileSource::CIBCADRG_FRAME_HEIGHT = 1536;
+
+ossimCibCadrgTileSource::ossimCibCadrgTileSource()
+   :ossimImageHandler(),
+    theCompressedBuffer(0),
+    theUncompressedBuffer(0),
+    theNumberOfLines(0),
+    theNumberOfSamples(0),
+    theTile(0),
+    theTableOfContents(0),
+    theEntryToRender(0),
+    theEntryNumberToRender(1),
+    theProductType(OSSIM_PRODUCT_TYPE_UNKNOWN),
+    theWorkFrame(0),
+    theSkipEmptyCheck(false)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimCibCadrgTileSource::ossimCibCadrgTileSource entered...\n";
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << "\n";
+#endif      
+   }
+
+   // Moved memory allocation to happen in first get tile. drb
+   
+   // theWorkFrame = new ossimRpfFrame;
+   
+   // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
+   // convert to bytes
+   // theCompressedBuffer   = new ossim_uint8[(64*64*12)/8];
+
+   // whether CIB or CADRG we will alocate the buffer
+   // to the larger of the 2 (CADRG is 3 bands)
+   // theUncompressedBuffer = new ossim_uint8[256*256*3];
+                           
+}
+
+ossimCibCadrgTileSource::~ossimCibCadrgTileSource()
+{
+   if(theCompressedBuffer)
+   {
+      delete [] theCompressedBuffer;
+      theCompressedBuffer = 0;
+   }
+   if(theUncompressedBuffer)
+   {
+      delete [] theUncompressedBuffer;
+      theUncompressedBuffer = 0;
+   }
+   if(theWorkFrame)
+   {
+      delete theWorkFrame;
+      theWorkFrame = 0;
+   }
+   close();
+}
+
+ossimString ossimCibCadrgTileSource::getShortName()const
+{
+   return ossimString("CIB/CADRG");
+}
+
+ossimString ossimCibCadrgTileSource::getLongName()const
+{
+   return ossimString("CIB/CADRG reader");
+}
+
+
+void ossimCibCadrgTileSource::close()
+{
+   deleteAll();
+   ossimImageHandler::close();
+}
+
+bool ossimCibCadrgTileSource::isOpen()const
+{
+   return (theTableOfContents!=0);
+}
+
+bool ossimCibCadrgTileSource::open()
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimCibCadrgTileSource::open(): Entered....."
+         << "\ntheImageFile: " << theImageFile << std::endl;
+   }
+
+   bool result = false;
+   
+   if(isOpen())
+   {
+      close();
+   }
+
+   theTableOfContents = new ossimRpfToc;
+   
+   if(theTableOfContents)
+   {      
+      if(theTableOfContents->parseFile(theImageFile) == ossimErrorCodes::OSSIM_OK)
+      {
+         if(theTableOfContents->getNumberOfEntries() > 0)
+         {
+            vector<ossimString> scaleList = getProductScaleList();
+            if(scaleList.size() > 0)
+            {
+               std::vector<ossim_uint32> entryList;
+               getEntryList(entryList);
+               if(entryList.size() > 0)
+               {
+                  setCurrentEntry(entryList[0]);
+                  
+                  if(theEntryToRender)
+                  {
+                     // a CADRG is 1536x1536 per frame.
+                     theNumberOfLines   = theEntryToRender->getNumberOfLines();
+                     theNumberOfSamples = theEntryToRender->getNumberOfSamples();
+                  }
+
+                  if(theEntryToRender->getProductType().trim().upcase() == "CADRG")
+                  {
+                     theProductType = OSSIM_PRODUCT_TYPE_CADRG;
+                     result = true;
+                  }
+                  else if(theEntryToRender->getProductType().trim().upcase() == "CIB")
+                  {
+                     theProductType = OSSIM_PRODUCT_TYPE_CIB;
+                     result = true;
+                  }
+
+                  // Moved this code to be called on first get tile. drb
+                  // if ( result )
+                  // {
+                  // This initializes tiles and buffers.
+                  // allocateForProduct();
+                  // }
+               }
+            }
+         }
+      }
+   }
+
+   if(!result)
+   {
+      theImageFile.clear();
+      close();
+   }
+
+#if 0 /* 20100414 - drb */
+   else
+   {
+      //---
+      // Adjust image rect so not to go over the -180 to 180 and -90 to 90
+      // bounds.
+      //---
+      // Note this did not do any boundary checking and was in conflict with setTocEntryToRender
+      // method calculation of lines and samps.
+      // setActualImageRect();
+
+      std::ifstream in(theImageFile.c_str(), std::ios::in|std::ios::binary);
+      if(in.good()&&theTableOfContents->getRpfHeader())
+      {
+      }
+      completeOpen();
+
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+   }
+#endif
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimCibCadrgTileSource::open(): Leaving at line " << __LINE__
+         << " result=" << (result?"true":"false") << std::endl;
+   }
+
+   return result;
+}
+
+void ossimCibCadrgTileSource::setSkipEmptyCheck( bool bSkipEmptyCheck )
+{
+   theSkipEmptyCheck = bSkipEmptyCheck;
+}
+
+ossimRefPtr<ossimImageData> ossimCibCadrgTileSource::getTile(
+   const  ossimIrect& rect, ossim_uint32 resLevel)
+{
+   if ( theTile.valid() == false )
+   {
+      // First time through.
+      allocateForProduct();
+   }
+   
+   if (theTile.valid())
+   {
+      // Image rectangle must be set prior to calling getTile.
+      theTile->setImageRectangle(rect);
+      
+      if ( getTile( theTile.get(), resLevel ) == false )
+      {
+         if (theTile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            theTile->makeBlank();
+         }
+      }
+   }
+   
+   return theTile;
+}
+
+bool ossimCibCadrgTileSource::getTile(ossimImageData* result,
+                                      ossim_uint32 resLevel)
+{
+   bool status = false;
+
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) &&
+       (theProductType != OSSIM_PRODUCT_TYPE_UNKNOWN) )
+   {
+      if ( resLevel > 0 )
+      {
+         //---
+         // Check for overview tile.  Some overviews can contain r0 so always
+         // call even if resLevel is 0 (if overview is not virtual).  Method 
+         // returns true on success, false on error.
+         //---
+         status = getOverviewTile(resLevel, result);
+      }
+
+      if (!status) // Did not get an overview tile.
+      {
+         if ( !theCompressedBuffer )
+         {
+            // First time through.
+            allocateForProduct(); 
+         }
+
+         if ( theCompressedBuffer )
+         {
+            status = true;
+            
+            ossimIrect rect = result->getImageRectangle();
+            
+            ossimIrect imageRect = getImageRectangle();
+            
+            if ( rect.intersects(imageRect) )
+            {
+               //---
+               // Start with a blank tile in case there is not total coverage
+               // for rect.
+               //---
+               result->makeBlank();
+               
+               vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
+               if(frames.size() > 0)
+               {
+                  //---
+                  // Now lets render each frame.  Note we will have to find
+                  // subframes
+                  // that intersect the rectangle of interest for each frame.
+                  //---
+                  fillTile(rect, frames, result);
+                  
+                  // Revalidate tile status.
+                  result->validate();
+               }
+            }
+            else
+            {
+               result->makeBlank();
+            }
+         }
+      }
+   }
+   
+   return status;
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getNumberOfInputBands()const
+{
+   switch(theProductType)
+   {
+      case  OSSIM_PRODUCT_TYPE_UNKNOWN:
+      {
+         return 0;
+      }
+      case OSSIM_PRODUCT_TYPE_CIB:
+      {
+         return 1;
+      }
+      case OSSIM_PRODUCT_TYPE_CADRG:
+      {
+         return 3;
+      }
+   }
+   
+   return 0;
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getNumberOfOutputBands()const
+{
+   switch(theProductType)
+   {
+      case  OSSIM_PRODUCT_TYPE_UNKNOWN:
+      {
+         return 0;
+      }
+      case OSSIM_PRODUCT_TYPE_CIB:
+      {
+         return 1;
+      }
+      case OSSIM_PRODUCT_TYPE_CADRG:
+      {
+         return 3;
+      }
+   }
+   
+   return 0;
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return theNumberOfLines;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfLines(reduced_res_level);
+   }
+
+   return 0;
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return theNumberOfSamples;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfSamples(reduced_res_level);
+   }
+
+   return 0;
+}
+
+ossimIrect ossimCibCadrgTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return ossimIrect(0,                         // upper left x
+                     0,                         // upper left y
+                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
+                     getNumberOfLines(reduced_res_level)   - 1); // lower right y                     
+}
+   
+ossimRefPtr<ossimImageGeometry> ossimCibCadrgTileSource::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      // Check for external geom:
+      theGeometry = getExternalImageGeometry();
+      
+      if ( !theGeometry && theEntryToRender )
+      {
+         theGeometry = theEntryToRender->getImageGeometry();
+      }
+
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+   }
+
+   return theGeometry;
+}
+   
+ossimScalarType ossimCibCadrgTileSource::getOutputScalarType() const
+{
+   return OSSIM_UCHAR;
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getTileWidth() const
+{
+   return getImageTileWidth();
+}
+   
+ossim_uint32 ossimCibCadrgTileSource::getTileHeight() const
+{
+   return getImageTileHeight();
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getCurrentEntry()const
+{
+   return (ossim_uint32)theEntryNumberToRender;
+}
+
+bool ossimCibCadrgTileSource::setCurrentEntry(ossim_uint32 entryIdx)
+{
+   bool result = false;
+
+   theDecimationFactors.clear();
+   
+   // Clear the geometry.
+   theGeometry = 0;
+   
+   // Must clear or openOverview will use last entries.
+   theOverviewFile.clear();
+   
+   if(setEntryToRender(entryIdx))
+   {
+      completeOpen();
+      result = true;
+   }
+
+   return result;
+}
+
+void ossimCibCadrgTileSource::getEntryList(std::vector<ossim_uint32>& entryList)const
+{
+   std::vector<ossimString> scaleList = getProductScaleList();
+   ossim_uint32 scaleIdx = 0;
+   ossim_uint32 entryIdx = 0;
+   for(scaleIdx = 0; scaleIdx < scaleList.size(); ++scaleIdx)
+   {
+      std::vector<ossim_int32> eList = getProductEntryList(scaleList[scaleIdx]);
+      
+      for(entryIdx = 0; entryIdx < eList.size(); ++entryIdx)
+      {
+         entryList.push_back(eList[entryIdx]);
+      }
+   }
+
+}
+
+bool ossimCibCadrgTileSource::setEntryToRender(ossim_uint32 index)
+{
+   if(isOpen())
+   {
+      const ossimRpfTocEntry *temp = theTableOfContents->getTocEntry(index);
+
+      if(temp)
+      {
+         if(!(temp->getBoundaryInformation().getCoverage().isGeographicRectNull()))
+         {
+            setTocEntryToRender(temp);
+            theEntryNumberToRender = index;
+            if(theEntryToRender)
+            {
+               if(theEntryToRender->getProductType().trim().upcase() == "CADRG")
+               {
+                  theProductType = OSSIM_PRODUCT_TYPE_CADRG;
+               }
+               else if(theEntryToRender->getProductType().trim().upcase() == "CIB")
+               {
+                  theProductType = OSSIM_PRODUCT_TYPE_CIB;
+               }
+               else
+               {
+                  theProductType = OSSIM_PRODUCT_TYPE_UNKNOWN;
+               }
+            }
+            
+            populateLut();
+            
+            return true;
+         }
+      }
+   }
+   
+   return false;
+}
+
+void ossimCibCadrgTileSource::setTocEntryToRender(const ossimRpfTocEntry* entry)
+{
+   if(isOpen()&&entry)
+   {
+      theEntryToRender = entry;
+      theNumberOfLines   = theEntryToRender->getNumberOfLines();
+      theNumberOfSamples = theEntryToRender->getNumberOfSamples();
+      theEntryNumberToRender = theTableOfContents->getTocEntryIndex(entry);
+   }
+}
+
+ossim_int32 ossimCibCadrgTileSource::getCurrentEntryIndex()const
+{
+   return theEntryNumberToRender;
+}
+
+const ossimRpfTocEntry* ossimCibCadrgTileSource::getCurrentTocEntry()const
+{
+   return theEntryToRender;
+}
+
+const ossimRpfToc*  ossimCibCadrgTileSource::getToc()const
+{
+   return theTableOfContents;
+}
+
+bool ossimCibCadrgTileSource::isValidRLevel(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return true;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->isValidRLevel(reduced_res_level);
+   }
+   else
+   {
+      return false;
+   }
+}
+
+vector<ossimString> ossimCibCadrgTileSource::getProductScaleList()const
+{
+   vector<ossimString> result;
+   
+   if(isOpen())
+   {
+      ossim_int32 upperBound = theTableOfContents->getNumberOfEntries();
+
+      for(ossim_int32 index = 0; index < upperBound; ++index)
+      {
+         const ossimRpfTocEntry* entry = theTableOfContents->getTocEntry(index);
+         ossimString scale = entry->getBoundaryInformation().getScale();
+
+         scale = scale.trim().upcase();
+         if(scale!="")
+         {
+            // CIB will have product scales like 5M or 10M
+            // and CADRG's will have product scales like
+            // 1:50K and 1:250K ...
+            // So if these patterns exist then add it to
+            // the product list.
+            if( ( std::find(scale.begin(), scale.end(), ':') != scale.end() )
+                ||
+                (scale[scale.size()-1]=='M'))
+            {
+               // only add it if it doesn't already exist
+               // on the list.
+               if(find(result.begin(), result.end(), scale) == result.end())
+               {
+                  result.push_back(scale);
+               }
+            }
+         }
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimCibCadrgTileSource::getProductScaleList DEBUG:"
+         << endl;
+
+      std::vector<ossimString>::const_iterator i = result.begin();
+      ossim_uint32 index = 0;
+      while (i != result.end())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "scale[" << index << "]:  " << (*i) << endl;
+         ++index;
+         ++i;
+      }
+   }
+   
+   return result;
+}
+
+vector<ossim_int32> ossimCibCadrgTileSource::getProductEntryList(const ossimString& productScale)const
+{
+   vector<ossim_int32> result;
+   
+   if(isOpen())
+   {
+      ossim_int32 upperBound = theTableOfContents->getNumberOfEntries();
+
+      for(ossim_int32 index = 0; index < upperBound; ++index)
+      {
+         const ossimRpfTocEntry* entry = theTableOfContents->getTocEntry(index);
+
+         if(entry)
+         {
+            // If the "skip empty check" is true, we don't check to see if the
+            // actual frame images exist. Otherwise the check is carried out,
+            // which is the default situation.
+            bool bIsEmpty = (theSkipEmptyCheck==false) ? entry->isEmpty() : false;
+
+            // if the entry is not empty then add it to the list.
+            if( bIsEmpty == false )
+            {
+               ossimString scale = entry->getBoundaryInformation().getScale();
+               scale = scale.trim().upcase();
+               if(scale==productScale)
+               {
+                  result.push_back(index);
+               }
+            }
+         }
+      }
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimCibCadrgTileSource::getProductEntryList DEBUG:"
+         << endl;
+
+      std::vector<ossim_int32>::const_iterator i = result.begin();
+      ossim_uint32 index = 0;
+      while (i != result.end())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "scale[" << index << "]:  " << (*i) << endl;
+         ++index;
+         ++i;
+      }
+   }
+   
+   return result;
+   
+}
+
+vector<ossimCibCadrgTileSource::ossimFrameEntryData> ossimCibCadrgTileSource::getIntersectingEntries(const ossimIrect& rect)
+{
+   vector<ossimFrameEntryData> result;
+
+   // make sure we have the Toc entry to render
+   if(!isOpen()) return result;
+   
+   ossimIrect imageRect = getImageRectangle();
+   if(rect.intersects(imageRect))
+   {
+      ossimIrect clipRect  = rect.clipToRect(imageRect);
+      ossimIrect frameRect(clipRect.ul().x/CIBCADRG_FRAME_WIDTH,
+                           clipRect.ul().y/CIBCADRG_FRAME_HEIGHT,
+                           clipRect.lr().x/CIBCADRG_FRAME_WIDTH,
+                           clipRect.lr().y/CIBCADRG_FRAME_HEIGHT);
+
+      ossimRpfFrameEntry tempEntry;
+
+      
+     for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
+      {
+         for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
+         {
+            if(theEntryToRender->getEntry((theEntryToRender->getNumberOfFramesVertical()-1) - row,
+                                          col,
+                                          tempEntry))
+            {
+               if(tempEntry.exists())
+               {
+                   result.push_back(ossimFrameEntryData(row,
+                                                        col,
+                                                        row*CIBCADRG_FRAME_HEIGHT,
+                                                        col*CIBCADRG_FRAME_WIDTH,
+                                                        tempEntry));
+               }
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimCibCadrgTileSource::fillTile(
+   const ossimIrect& tileRect,
+   const vector<ossimFrameEntryData>& framesInvolved,
+   ossimImageData* tile)
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0;
+       idx < framesInvolved.size();
+       ++idx)
+   {
+
+      if(theWorkFrame->parseFile(framesInvolved[idx].theFrameEntry.getFullPath())
+         == ossimErrorCodes::OSSIM_OK)
+      {
+         // we will fill a subtile.  We pass in which frame it is and the position of the frame.
+         // the actual pixel will be 1536*row and 1536 *col.
+         if(theProductType == OSSIM_PRODUCT_TYPE_CIB)
+         {
+            fillSubTileCib(*theWorkFrame,
+                           tileRect,
+                           framesInvolved[idx],
+                           tile);
+         }
+         else
+         {
+            fillSubTileCadrg(*theWorkFrame,
+                             tileRect,
+                             framesInvolved[idx],
+                             tile);
+         }
+      }
+   }
+}
+
+void ossimCibCadrgTileSource::fillSubTileCadrg(
+   const ossimRpfFrame&  aFrame,
+   const ossimIrect& tileRect,
+   const ossimFrameEntryData& frameEntryData,
+   ossimImageData* tile)
+{
+   // first let's grab the absolute position of the frame rectangle in pixel space
+   ossimIrect frameRect(frameEntryData.thePixelCol,
+                        frameEntryData.thePixelRow,
+                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
+                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
+
+   
+   // now clip it to the tile
+   ossimIrect clipRect = tileRect.clipToRect(frameRect);
+   
+   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
+   
+   if(!compressionSection)
+   {
+      return;
+   }
+
+   const vector<ossimRpfColorGrayscaleTable>& colorTable =
+      aFrame.getColorGrayscaleTable();
+
+   // ESH 03/2009 -- Partial fix for ticket #646.
+   // Crash fix on reading RPFs: Make sure the colorTable vector 
+   // has entries before trying to make use of them. 
+   int numTables = (int)colorTable.size();
+   if ( numTables <= 0 )
+   {
+      return;
+   }
+
+   ossim_uint8 *tempRows[3];
+   
+   tempRows[0] = theUncompressedBuffer;
+   tempRows[1] = (theUncompressedBuffer + 256*256);
+   tempRows[2] = (tempRows[1] + 256*256);
+   
+   // find the shift to 0,0
+   ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
+                      clipRect.ul().y - frameEntryData.thePixelRow);
+   
+   
+   // In order to compute the subframe we will need the corner offsets of
+   // the upper left of the frame and the upper left of the clip rect.  The
+   // clip rect should be completely within the frame.  This just translates the value
+   // to make the upper left of the frame be 0,0.
+   //
+   ossimIrect offsetRect(tempDelta.x,
+                         tempDelta.y,
+                         tempDelta.x + clipRect.width()-1,
+                         tempDelta.y + clipRect.height()-1);
+   
+   // each subframe is 64x64.  We will actually use 256x256 since
+   // we will be uncompressing them.  Note CADRG is a 256x256 tile
+   // compressed to 64x64x12 bit data
+   //
+    ossimIrect subFrameRect(offsetRect.ul().x/256,
+                            offsetRect.ul().y/256,
+                            (offsetRect.lr().x)/256,
+                            (offsetRect.lr().y)/256);
+   
+   ossim_uint32 readPtr  = 0;
+
+   ossim_int32 row = 0;
+   ossim_int32 col = 0;
+   ossim_uint32 i = 0;
+   ossim_uint32 j = 0;
+   ossim_int32 upperY = subFrameRect.lr().y;
+   ossim_int32 upperX = subFrameRect.lr().x;
+   ossim_int32 lowerY = subFrameRect.ul().y;
+   ossim_int32 lowerX = subFrameRect.ul().x; 
+   for(row = lowerY; row <= upperY; ++row)
+   {
+      for(col = lowerX; col <= upperX; ++col)
+      {
+         readPtr = 0;
+         if(aFrame.fillSubFrameBuffer(theCompressedBuffer, 0, row, col))
+         {
+            for (i = 0; i < 256; i += 4)
+            {
+               for (j = 0; j < 256; j += 8)
+               {
+                  ossim_uint16 firstByte  = theCompressedBuffer[readPtr++] & 0xff;
+                  ossim_uint16 secondByte = theCompressedBuffer[readPtr++] & 0xff;
+                  ossim_uint16 thirdByte  = theCompressedBuffer[readPtr++] & 0xff;
+                  
+                  //because dealing with half-bytes is hard, we
+                  //uncompress two 4x4 tiles at the same time. (a
+                  //4x4 tile compressed is 12 bits )
+                  // this little code was grabbed from openmap software.
+                  
+                  /* Get first 12-bit value as index into VQ table */
+                  // I think we need to swap
+                  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
+                  
+                  /* Get second 12-bit value as index into VQ table*/
+                  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
+                  
+                  for (ossim_uint32 t = 0; t < 4; ++t)
+                  {
+                     for (ossim_uint32 e = 0; e < 4; ++e)
+                     {
+                        ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
+                        ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
+
+                        ossim_uint32 pixindex = ((i+t)*256) +
+                                                 (j + e);
+                        const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
+                        const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
+                        
+                        
+                        tempRows[0][pixindex] = color1[0];
+                        tempRows[1][pixindex] = color1[1];
+                        tempRows[2][pixindex] = color1[2];
+                        
+                        tempRows[0][pixindex+4] = color2[0];
+                        tempRows[1][pixindex+4] = color2[1];
+                        tempRows[2][pixindex+4] = color2[2];
+                     } //for e
+                  } //for t
+               }  /* for j */
+            } //for i
+         }
+         else
+         {
+            memset(theUncompressedBuffer, 0, 256*256*3);
+         }
+         ossim_int32 tempCol = col*256;
+         ossim_int32 tempRow = row*256;
+         ossimIrect subRectToFill(frameRect.ul().x + tempCol,
+                                  frameRect.ul().y + tempRow,
+                                  frameRect.ul().x + tempCol + 255,
+                                  frameRect.ul().y + tempRow + 255);
+         tile->loadTile(theUncompressedBuffer,
+                        subRectToFill,
+                        OSSIM_BSQ);
+      }
+   }
+}
+
+void ossimCibCadrgTileSource::fillSubTileCib(
+   const ossimRpfFrame&  aFrame,
+   const ossimIrect& tileRect,
+   const ossimFrameEntryData& frameEntryData,
+   ossimImageData* tile)
+{
+   // first let's grab the absolute position of the frame rectangle in pixel
+   // space
+   ossimIrect frameRect(frameEntryData.thePixelCol,
+                        frameEntryData.thePixelRow,
+                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
+                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
+
+   
+   // now clip it to the tile
+   ossimIrect clipRect = tileRect.clipToRect(frameRect);
+
+   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
+   
+   if(!compressionSection)
+   {
+      return;
+   }
+
+   const vector<ossimRpfColorGrayscaleTable>& colorTable =
+      aFrame.getColorGrayscaleTable();
+
+   // ESH 03/2009 -- Partial fix for ticket #646.
+   // Crash fix on reading RPFs: Make sure the colorTable vector 
+   // has entries before trying to make use of them. 
+   int numTables = (int)colorTable.size();
+   if ( numTables <= 0 )
+   {
+      return;
+   }
+
+   // check to see if it does overlap.  If it doesn't then the width and height
+   // will be a single point
+   {
+      ossim_uint8 *tempRow;
+
+      tempRow = theUncompressedBuffer;
+      
+      // find the shift to 0,0
+      ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
+                         clipRect.ul().y - frameEntryData.thePixelRow);
+      
+      // In order to compute the subframe we will need the corner offsets of
+      // the upper left of the frame and the upper left of the clip rect.  The
+      // clip rect should be completely within the frame.  This just translates the value
+      // to make the upper left of the frame be 0,0.
+      //
+      ossimIrect offsetRect(tempDelta.x,
+                            tempDelta.y,
+                            tempDelta.x + clipRect.width()-1,
+                            tempDelta.y + clipRect.height()-1);
+
+      // each subframe is 64x64.  We will actually use 256x256 since
+      // we will be uncompressing them.  Note CADRG is a 256x256 tile
+      // compressed to 64x64x12 bit data
+      //
+      ossimIrect subFrameRect(offsetRect.ul().x/256,
+                              offsetRect.ul().y/256,
+                              (offsetRect.lr().x)/256,
+                              (offsetRect.lr().y)/256);
+
+      ossim_int32 row = 0;
+      ossim_int32 col = 0;
+      ossim_uint32 i = 0;
+      ossim_uint32 j = 0;
+      ossim_uint32 readPtr = 0;
+      for(row = subFrameRect.ul().y; row <= subFrameRect.lr().y; ++row)
+      {
+         for(col = subFrameRect.ul().x; col <= subFrameRect.lr().x; ++col)
+         {
+            readPtr = 0;
+            if(aFrame.fillSubFrameBuffer(theCompressedBuffer, 0, row, col))
+            {
+               for (i = 0; i < 256; i += 4)
+               {
+                  for (j = 0; j < 256; j += 8)
+                  {
+                     ossim_uint16 firstByte  = theCompressedBuffer[readPtr++] & 0xff;
+                     ossim_uint16 secondByte = theCompressedBuffer[readPtr++] & 0xff;
+                     ossim_uint16 thirdByte  = theCompressedBuffer[readPtr++] & 0xff;
+                     
+                     //because dealing with half-bytes is hard, we
+                     //uncompress two 4x4 tiles at the same time. (a
+                     //4x4 tile compressed is 12 bits )
+                     // this little code was grabbed from openmap software.
+                     
+                     /* Get first 12-bit value as index into VQ table */
+                     // I think we need to swap
+                     ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
+                     
+                     /* Get second 12-bit value as index into VQ table*/
+                     ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
+
+                     for (ossim_uint32 t = 0; t < 4; ++t)
+                     {
+                        for (ossim_uint32 e = 0; e < 4; ++e)
+                        {
+                           ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
+                           ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
+
+                           ossim_uint32 pixindex = ((i+t)*256) + (j + e);
+                           const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
+                           const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
+
+                           
+                           tempRow[pixindex]      = color1[0];
+                           tempRow[pixindex + 4]  = color2[0];
+                        } //for e
+                     } //for t
+                  }  /* for j */
+               } //for i
+            }
+            else
+            {
+               memset(theUncompressedBuffer, 0, 256*256);
+            }
+            ossim_int32 tCol = col*256;
+            ossim_int32 tRow = row*256;
+            ossimIrect subRectToFill(frameRect.ul().x + tCol,
+                                     frameRect.ul().y + tRow,
+                                     frameRect.ul().x + tCol + 255,
+                                     frameRect.ul().y + tRow + 255);
+            tile->loadTile(theUncompressedBuffer,
+                           subRectToFill,
+                           OSSIM_BSQ);
+         }
+      }
+   }  
+}
+
+void ossimCibCadrgTileSource::allocateForProduct()
+{
+   if(theProductType ==  OSSIM_PRODUCT_TYPE_UNKNOWN)
+   {
+      return;
+   }
+
+   if ( theWorkFrame )
+   {
+      delete theWorkFrame;
+   }  
+   theWorkFrame = new ossimRpfFrame;
+
+   if(theCompressedBuffer)
+   {
+      delete [] theCompressedBuffer;
+   }
+
+   //---
+   // A CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to convert
+   // to bytes.
+   //---
+   theCompressedBuffer   = new ossim_uint8[(64*64*12)/8];
+   
+   if(theUncompressedBuffer)
+   {
+      delete [] theUncompressedBuffer;
+   }
+   if(theProductType == OSSIM_PRODUCT_TYPE_CIB)
+   {
+      theUncompressedBuffer = new ossim_uint8[256*256];
+   }
+   else
+   {
+      theUncompressedBuffer = new ossim_uint8[256*256*3];
+   }   
+   
+   theTile = ossimImageDataFactory::instance()->create(this, this);
+   theTile->initialize();
+}
+
+const ossimRpfTocEntry* ossimCibCadrgTileSource::findFirstFrame()
+{
+   vector<ossimString> products = getProductScaleList();
+   vector<ossim_int32> indexProducts;
+
+   if(products.size() > 0)
+   {
+      indexProducts = getProductEntryList(products[0]);
+
+      if(indexProducts.size()>0)
+      {
+         theEntryNumberToRender = indexProducts[0];
+         
+         return theTableOfContents->getTocEntry(indexProducts[0]);
+      }
+   }
+   
+   return 0;
+}
+
+
+void ossimCibCadrgTileSource::deleteAll()
+{
+   theOverview = 0;
+   if(theTableOfContents)
+   {
+      delete theTableOfContents;
+      theTableOfContents = 0;
+   }
+}
+
+bool ossimCibCadrgTileSource::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix)const
+{
+   bool result = ossimImageHandler::saveState(kwl, prefix);
+
+   kwl.add(prefix, 
+	   "entry",
+	   theEntryNumberToRender,
+	   true);
+
+   return result;
+}
+   
+bool ossimCibCadrgTileSource::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   const char* MODULE = "ossimCibCadrgTileSource::loadState";
+
+   if(traceDebug())
+   {
+      CLOG << "Entering..." << endl;
+   }
+   bool result = ossimImageHandler::loadState(kwl, prefix);
+
+   if(!result)
+   {
+	   if(traceDebug())
+	   {
+          CLOG << "Leaving..." << endl;
+       }
+      return false;
+   }
+   const char* lookup = 0;
+   lookup = kwl.find(ossimString(prefix), "entry");
+   ossim_int32 entry = ossimString(lookup).toInt32();
+
+   // if an entry is specified then
+   // call the open with an entry number
+   if(lookup)
+   {
+      if(traceDebug())
+      {
+         CLOG << "Leaving..." << endl;
+      }
+      result = ossimImageHandler::open(theImageFile);
+      setCurrentEntry(entry);
+      return result;
+   }
+
+   result = ossimImageHandler::open(theImageFile);
+   
+   return result;
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getImageTileWidth() const
+{
+   return 256; // ??? drb
+}
+
+ossim_uint32 ossimCibCadrgTileSource::getImageTileHeight() const
+{
+   return 256; // ??? drb
+}
+
+bool ossimCibCadrgTileSource::isCib() const
+{
+   return (theProductType==OSSIM_PRODUCT_TYPE_CIB);
+}
+
+bool ossimCibCadrgTileSource::isCadrg() const
+{
+   return (theProductType==OSSIM_PRODUCT_TYPE_CADRG);
+}
+
+ossimString ossimCibCadrgTileSource::getProductScale() const
+{
+   ossimString result;
+   
+   const ossimRpfTocEntry* entry =
+      theTableOfContents->getTocEntry(theEntryNumberToRender);
+
+   if (entry)
+   {
+      result = entry->getBoundaryInformation().getScale();
+   }
+
+   return result;
+}
+
+ossimString ossimCibCadrgTileSource::getSecurityClassification()const
+{
+   ossimString result;
+   
+   const ossimRpfHeader* header =
+      theTableOfContents->getRpfHeader();
+
+   if (header)
+   {
+      result = header->getSecurityClassification();
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimProperty> ossimCibCadrgTileSource::getProperty(const ossimString& name)const
+{
+   if(name == "file_type")
+   {
+      if(theProductType == OSSIM_PRODUCT_TYPE_CIB)
+      {
+         return new ossimStringProperty("file_type", "CIB");
+      }
+      else if(theProductType == OSSIM_PRODUCT_TYPE_CADRG)
+      {
+         return new ossimStringProperty("file_type", "CADRG");
+      }
+      return 0;
+   }
+   return ossimImageHandler::getProperty(name);
+}
+
+void ossimCibCadrgTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageHandler::getPropertyNames(propertyNames);
+   propertyNames.push_back("file_type");
+
+   /**
+    * This code is crashing and not sure why in here. Looks like a bad GeoEye
+    * baseline merge.
+    */
+#if 0 
+   const ossimRpfHeader* header =
+      theTableOfContents->getRpfHeader();
+   if(header)
+   {
+      std::ifstream in(theImageFile.c_str(), std::ios::in|std::ios::binary);
+   }
+#endif
+}
+
+void ossimCibCadrgTileSource::populateLut()
+{
+   theLut = 0;
+   if(theEntryToRender)
+   {
+      ossim_uint32 w = theEntryToRender->getNumberOfFramesHorizontal();
+      ossim_uint32 h = theEntryToRender->getNumberOfFramesVertical();
+      ossim_uint32 wi, hi;
+      bool found = false;
+      ossimRpfFrameEntry tempEntry;
+      ossimRpfFrame aFrame;
+      for(wi = 0; ((wi < w)&&(!found)); ++wi)
+      {
+         for(hi = 0; ((hi < h)&&(!found)); ++hi)
+         {
+            theEntryToRender->getEntry(hi,
+                                       wi,
+                                       tempEntry);
+            if(tempEntry.getFullPath().exists())
+            {
+               found = true;
+            }
+         }
+      }
+      if(aFrame.parseFile(tempEntry.getFullPath())
+         == ossimErrorCodes::OSSIM_OK)
+      {
+         const vector<ossimRpfColorGrayscaleTable>& colorTable =
+            aFrame.getColorGrayscaleTable();
+
+         // ESH 03/2009 -- Partial fix for ticket #646.
+         // Crash fix on reading RPFs: Make sure the colorTable vector 
+         // has entries before trying to make use of them. 
+         int numTables = (int)colorTable.size();
+
+         ossim_uint32 numElements = (numTables > 0) ? colorTable[0].getNumberOfElements() : 0;
+         if(numElements > 0)
+         {
+            if((theProductType == OSSIM_PRODUCT_TYPE_CIB)||
+               (theProductType == OSSIM_PRODUCT_TYPE_CADRG))
+            {
+               theLut = new ossimNBandLutDataObject(numElements,
+                                                    3,
+                                                    OSSIM_UINT8);
+            }
+            else
+            {
+               theLut = 0;
+               return;
+            }
+            ossim_uint32 idx = 0;
+
+            for(idx = 0; idx < numElements;++idx)
+            {
+               const ossim_uint8* startOfData = colorTable[0].getStartOfData(idx);
+               switch(theProductType)
+               {
+                  case OSSIM_PRODUCT_TYPE_CIB:
+                  {
+                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     break;
+                  }
+                  case OSSIM_PRODUCT_TYPE_CADRG:
+                  {
+                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[1]);
+                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[2]);
+                     break;
+                  }
+                  default:
+                  {
+                     break;
+                  }
+               }
+            }
+         }
+      }
+   }
+}
+
+void ossimCibCadrgTileSource::updatePropertiesToFirstValidFrame()
+{
+   if(theEntryToRender)
+   {
+      ossim_uint32 w = theEntryToRender->getNumberOfFramesHorizontal();
+      ossim_uint32 h = theEntryToRender->getNumberOfFramesVertical();
+      ossim_uint32 wi, hi;
+      bool found = false;
+      ossimRpfFrameEntry tempEntry;
+      ossimRpfFrame aFrame;
+      for(wi = 0; ((wi < w)&&(!found)); ++wi)
+      {
+         for(hi = 0; ((hi < h)&&(!found)); ++hi)
+         {
+            theEntryToRender->getEntry(hi,
+                                       wi,
+                                       tempEntry);
+            if(tempEntry.getFullPath().exists())
+            {
+               found = true;
+            }
+         }
+      }
+      if(found)
+      {
+         if(aFrame.parseFile(tempEntry.getFullPath()) == ossimErrorCodes::OSSIM_OK)
+         {
+            
+         }
+      }	
+   }
+}
diff --git a/src/imaging/ossimClosestToCenterCombiner.cpp b/src/imaging/ossimClosestToCenterCombiner.cpp
new file mode 100644
index 0000000..722c83a
--- /dev/null
+++ b/src/imaging/ossimClosestToCenterCombiner.cpp
@@ -0,0 +1,146 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimClosestToCenterCombiner.cpp 11955 2007-10-31 16:10:22Z gpotts $
+#include <ossim/imaging/ossimClosestToCenterCombiner.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimClosestToCenterCombiner, "ossimClosestToCenterCombiner", ossimImageMosaic);
+
+ossimClosestToCenterCombiner::ossimClosestToCenterCombiner()
+   :ossimImageMosaic()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimClosestToCenterCombiner::getTile(const ossimIrect& rect,
+                                                                  ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   if(!isSourceEnabled())
+   {
+      return ossimImageMosaic::getTile(rect, resLevel);
+   }
+   if(!theTile.valid())
+   {
+      allocate();
+      if(!theTile.valid())
+      {
+         return 0;
+      }
+   }
+   theTile->setImageRectangle(rect);
+   theTile->makeBlank();
+   std::vector<ossimClosestToCenterCombinerInfo > normTileList;
+   ossimRefPtr<ossimImageData> currentTile = getNextNormTile(layerIdx, 0, rect);
+   while(currentTile.valid())
+   {
+      normTileList.push_back(ossimClosestToCenterCombinerInfo((ossimImageData*)currentTile->dup(),
+                                                              layerIdx));
+      currentTile = getNextNormTile(layerIdx, rect, resLevel);
+   }
+
+   
+   if(normTileList.size() == 1)
+   {
+      theTile->copyNormalizedBufferToTile((ossim_float32*)normTileList[0].theTile->getBuf());
+   }
+   else if(normTileList.size() > 1)
+   {
+      ossimRefPtr<ossimImageData> copyTile    = ossimImageDataFactory::instance()->create(0,
+                                                                                          OSSIM_NORMALIZED_FLOAT);
+      copyTile->setImageRectangleAndBands(rect,
+                                          getNumberOfOutputBands());
+      copyTile->initialize();
+                                                                                          
+      ossim_int32 idx   = 0;
+      ossim_uint32 w     = rect.width();
+      ossim_uint32 h     = rect.height();
+      ossim_uint32 idxW  = 0;
+      ossim_uint32 idxH  = 0;
+      ossimIpt origin    = rect.ul();
+      ossimIpt ulPt      = rect.ul();
+      ossim_uint32 band  = 0;
+      ossim_uint32 bands = copyTile->getNumberOfBands();
+      ossim_uint32 srcBandIdx = 0;
+      std::vector<ossim_float32*> bandList(bands);
+
+      for(band = 0; band < bands; ++band)
+      {
+         bandList[band] = (ossim_float32*)copyTile->getBuf(band);
+      }
+      ossim_uint32 offset   = 0;
+      origin.y = ulPt.y;
+      for(idxH = 0; idxH < h; ++idxH)
+      {
+         origin.x = ulPt.x;
+         for(idxW = 0; idxW < w;++idxW)
+         {
+            idx = findIdx(normTileList, origin, offset);
+
+            if(idx >=0)
+            {
+               ossim_uint32 tileBands = normTileList[idx].theTile->getNumberOfBands();
+               if (tileBands > 0)
+               {
+                  tileBands -= 1;
+                  for(band = 0; band < bands; ++band)
+                  {
+                     srcBandIdx = ossim::min( tileBands, band );
+                     bandList[band][offset] = *(((ossim_float32*)normTileList[idx].theTile->getBuf(srcBandIdx))+offset);
+                  }
+               }
+            }
+            ++offset;
+            ++origin.x;
+         }
+         ++origin.y;
+      }
+      theTile->copyNormalizedBufferToTile((ossim_float32*)copyTile->getBuf());
+   }
+
+   theTile->validate();
+   
+   return theTile;
+
+}
+
+ossim_int32 ossimClosestToCenterCombiner::findIdx(const std::vector<ossimClosestToCenterCombinerInfo >& normTileList,
+                                                  const ossimIpt& pt, ossim_uint32 offset)const
+{
+   ossim_float32 distance = 1000000;
+   ossim_int32 returnIdx = -1;
+   ossim_float32 tempDistance;
+   ossim_int32 idx = 0;
+   ossim_int32 maxIdx = (ossim_int32)normTileList.size();
+   ossimIpt midPt;
+   ossimIrect rect;
+   for(idx = 0; idx < maxIdx; ++ idx)
+   {
+      rect = theFullResBounds[ normTileList[idx].theIndex ];
+      midPt = rect.midPoint();
+      
+      tempDistance = (pt-midPt).length();
+      if(tempDistance < distance)
+      {
+         if(normTileList[idx].theTile->getDataObjectStatus() == OSSIM_FULL)
+         {
+            distance = tempDistance;
+            returnIdx = idx;
+         }
+         else if(!normTileList[idx].theTile->isNull(offset))
+         {
+            distance = tempDistance;
+            returnIdx = idx;
+         }
+      }
+   }
+
+   return returnIdx;
+}
diff --git a/ossim/src/ossim/imaging/ossimCodecBase.cpp b/src/imaging/ossimCodecBase.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimCodecBase.cpp
rename to src/imaging/ossimCodecBase.cpp
diff --git a/src/imaging/ossimCodecFactory.cpp b/src/imaging/ossimCodecFactory.cpp
new file mode 100644
index 0000000..5e085d4
--- /dev/null
+++ b/src/imaging/ossimCodecFactory.cpp
@@ -0,0 +1,83 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  Factory class definition for codec(encoder/decoder).
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/imaging/ossimCodecFactory.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+
+#include <ossim/imaging/ossimJpegCodec.h>
+
+#include <string>
+
+ossimCodecFactory* ossimCodecFactory::theInstance = 0;
+
+static const std::string TYPE_KW    = "type";
+
+ossimCodecFactory::~ossimCodecFactory()
+{}
+
+ossimCodecFactory* ossimCodecFactory::instance()
+{
+   if ( !theInstance )
+   {
+      theInstance = new ossimCodecFactory();
+   }
+   return theInstance;
+}
+ossimCodecBase* ossimCodecFactory::createCodec(const ossimString& type)const
+{
+   ossimRefPtr<ossimCodecBase> result;
+
+   if((type.downcase() == "jpeg") ||
+      (type == "ossimJpegCodec"))
+   {
+      result =  new ossimJpegCodec();
+   }
+
+   return result.release();
+}
+
+ossimCodecBase* ossimCodecFactory::createCodec(const ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   ossimCodecBase* result = 0;
+   if(!type.empty())
+   {
+      result = this->createCodec(type);
+      if(result)
+      {
+         result->loadState(kwl, prefix);
+      }
+   }
+
+   return result;
+}
+
+void ossimCodecFactory::getTypeNameList(std::vector<ossimString>& typeNames)const
+{
+   typeNames.push_back("jpeg");
+}
+
+ossimCodecFactory::ossimCodecFactory()
+{}
+
+ossimCodecFactory::ossimCodecFactory(const ossimCodecFactory& /* obj */ )
+{}
+
+const ossimCodecFactory& ossimCodecFactory::operator=(
+   const ossimCodecFactory& /* rhs */)
+{
+   return *this;
+}
diff --git a/ossim/src/ossim/imaging/ossimCodecFactoryInterface.cpp b/src/imaging/ossimCodecFactoryInterface.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimCodecFactoryInterface.cpp
rename to src/imaging/ossimCodecFactoryInterface.cpp
diff --git a/ossim/src/ossim/imaging/ossimCodecFactoryRegistry.cpp b/src/imaging/ossimCodecFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimCodecFactoryRegistry.cpp
rename to src/imaging/ossimCodecFactoryRegistry.cpp
diff --git a/src/imaging/ossimColorNormalizedFusion.cpp b/src/imaging/ossimColorNormalizedFusion.cpp
new file mode 100644
index 0000000..a8c5184
--- /dev/null
+++ b/src/imaging/ossimColorNormalizedFusion.cpp
@@ -0,0 +1,145 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Color normalized fusion
+//
+//*************************************************************************
+// $Id: ossimColorNormalizedFusion.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimColorNormalizedFusion.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/imaging/ossimImageData.h>
+
+RTTI_DEF1(ossimColorNormalizedFusion,
+          "ossimColorNormalizedFusion",
+          ossimFusionCombiner);
+
+ossimColorNormalizedFusion::ossimColorNormalizedFusion()
+   : ossimFusionCombiner()
+{
+}
+
+ossimColorNormalizedFusion::ossimColorNormalizedFusion(ossimObject* owner)
+   : ossimFusionCombiner(owner)
+{
+}
+
+ossimColorNormalizedFusion::~ossimColorNormalizedFusion()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimColorNormalizedFusion::getTile(
+   const ossimIrect& rect,
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> inputTile = getNormTile(rect, resLevel);
+
+   if(!inputTile.valid())
+   {
+      return NULL;
+   }
+   if(!theInputConnection||!theIntensityConnection)
+   {
+      return NULL;
+   }
+   
+   if((inputTile->getDataObjectStatus() == OSSIM_NULL)||
+      (inputTile->getDataObjectStatus() == OSSIM_EMPTY))
+   {
+      return NULL;
+   }
+
+   if(theTile.valid())
+   {
+      theTile->setImageRectangleAndBands(rect, inputTile->getNumberOfBands());
+   }
+
+   
+   ossim_float32* redBuff = (ossim_float32*)inputTile->getBuf(0);
+   ossim_float32* grnBuff = (ossim_float32*)inputTile->getBuf(1);
+   ossim_float32* bluBuff = (ossim_float32*)inputTile->getBuf(2);
+
+   if(!redBuff||!grnBuff||!bluBuff)
+   {
+      return 0;
+   }
+   ossimRefPtr<ossimImageData> inputIntensity = getNormIntensity(rect, resLevel);
+
+   if((!inputIntensity.valid()) ||
+      (!inputIntensity->getBuf()) ||
+      (inputIntensity->getDataObjectStatus() == OSSIM_EMPTY))
+   {
+      return 0;
+   }
+   
+   ossim_float32* mono_buff = (ossim_float32*)inputIntensity->getBuf(0);
+
+   // Since NULL_PIX_VALUE is only used for Pix8 comparisons cast it now.
+   const float NULL_PIX_VALUE = (ossim_float32)inputIntensity->getNullPix(0);
+   const float MIN_PIX_VALUE = (ossim_float32)inputIntensity->getMinPix(0);
+   const float MAX_PIX_VALUE = (ossim_float32)inputIntensity->getMaxPix(0);
+
+   float  rgb_sum;
+   float  r_wt; // Weight of red to rgb_sum.
+   float  g_wt; // Weight of green to rgb_sum.
+   float  b_wt; // Weight of blue to rgb_sum.
+   float  iVal;
+   float  redVal;
+   float  greenVal;
+   float  blueVal;
+
+   int size = theTile->getWidth()*theTile->getHeight();
+   
+   for (int i = 0; i < size;  i++)
+   {
+      //***
+      // If no intensity source, or, no rgb source make output pixels null.
+      //***
+      if ( (mono_buff[i] == NULL_PIX_VALUE) ||
+           (redBuff[i]   == NULL_PIX_VALUE &&
+            grnBuff[i]   == NULL_PIX_VALUE &&
+            bluBuff[i]   == NULL_PIX_VALUE) )
+           
+      {
+         redBuff[i] = NULL_PIX_VALUE;
+         grnBuff[i] = NULL_PIX_VALUE;
+         bluBuff[i] = NULL_PIX_VALUE;
+      }
+      else
+      {
+         redVal    = redBuff[i];
+         greenVal  = grnBuff[i];
+         blueVal   = bluBuff[i];
+         rgb_sum   = redVal + greenVal + blueVal + 3;
+	 r_wt      = 3 * (redVal + 1)   / rgb_sum;
+	 g_wt      = 3 * (greenVal + 1) / rgb_sum;
+	 b_wt      = 3 * (blueVal + 1)  / rgb_sum;
+         iVal      = mono_buff[i] + 1;
+	 
+	 redVal    = r_wt * iVal - 1;
+         greenVal  = g_wt * iVal - 1;
+	 blueVal   = b_wt * iVal - 1;
+
+         // Clip to max pixel value of radiometry.
+         if (redVal   > MAX_PIX_VALUE) redVal   = MAX_PIX_VALUE;
+         if (greenVal > MAX_PIX_VALUE) greenVal = MAX_PIX_VALUE;
+         if (blueVal  > MAX_PIX_VALUE) blueVal  = MAX_PIX_VALUE;
+
+         // Assign chip value, clamp to min pixel value of radiometry if zero.
+         redBuff[i] = (float)(redVal>0.0 ? redVal : MIN_PIX_VALUE);
+         grnBuff[i] = (float)(greenVal>0.0 ? greenVal : MIN_PIX_VALUE);
+         bluBuff[i] = (float)(blueVal>0.0 ? blueVal : MIN_PIX_VALUE);
+      }
+   } // End of loop through pixels in chip.
+   theTile->copyNormalizedBufferToTile((float*)inputTile->getBuf());
+   theTile->validate();
+
+   return theTile;
+}
diff --git a/src/imaging/ossimConvolutionFilter1D.cpp b/src/imaging/ossimConvolutionFilter1D.cpp
new file mode 100644
index 0000000..f8c4fde
--- /dev/null
+++ b/src/imaging/ossimConvolutionFilter1D.cpp
@@ -0,0 +1,672 @@
+//*******************************************************************
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//*************************************************************************
+// $Id: ossimConvolutionFilter1D.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+
+
+#include <ossim/imaging/ossimConvolutionFilter1D.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimMatrixProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+RTTI_DEF1(ossimConvolutionFilter1D, "ossimConvolutionFilter1D", ossimImageSourceFilter);
+
+#define PROPNAME_KERNELSIZE "KernelSize"
+#define PROPNAME_KERNEL "Kernel"
+#define PROPNAME_ISHZ   "Horizontal"
+#define PROPNAME_CENTEROFFSET "CenterOffset"
+#define PROPNAME_STRICTNODATA "StrictNoData"
+
+ossimConvolutionFilter1D::ossimConvolutionFilter1D(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theCenterOffset(0),
+    theTile(NULL),
+    theIsHz(true),
+    theStrictNoData(true),
+    theNullPixValue(0),
+    theMinPixValue(0),
+    theMaxPixValue(0)
+{
+   //sets up an identity convolution
+   theKernel.push_back(1.0);
+}
+
+ossimConvolutionFilter1D::~ossimConvolutionFilter1D()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimConvolutionFilter1D::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return theTile;
+   }
+
+   if(!isSourceEnabled())
+   {
+      return theInputConnection->getTile(tileRect, resLevel);
+   }
+
+   //---
+   // We have a 1xn or nx1 matrix, + a center offset
+   // so stretch the input rect out to cover the required pixels
+   //---
+   ossimIrect  newRect;
+   ossim_uint32 kl = (ossim_uint32)theKernel.size(); //kernel length
+   if (theIsHz)
+   {
+      //horizontal kernel (row kernel)
+      newRect = ossimIrect(ossimIpt(tileRect.ul().x - theCenterOffset,
+                                    tileRect.ul().y),
+                           ossimIpt(tileRect.lr().x - theCenterOffset + kl -1,
+                                    tileRect.lr().y));
+   } else {
+      //vertical kernel
+      newRect = ossimIrect(ossimIpt(tileRect.ul().x,
+                                    tileRect.ul().y - theCenterOffset),
+                           ossimIpt(tileRect.lr().x,
+                                    tileRect.lr().y - theCenterOffset + kl -1));
+   }
+   ossimRefPtr<ossimImageData> data = theInputConnection->getTile(newRect,
+                                                                  resLevel);
+
+   if(!data.valid() || !data->getBuf())
+   {
+      return data;
+   }
+
+    // First time through or after an initialize()...
+   if (!theTile.valid())
+   {
+      allocate();
+      if (!theTile.valid()) // Should never happen!
+      {
+         return data;
+      }
+   }
+
+   // First time through, after an initialize() or a setKernel()...
+   if (!theNullPixValue.size())
+   {
+      computeNullMinMax();
+      if (!theNullPixValue.size()) // Should never happen!
+      {
+         return data;
+      }
+   }
+
+   theTile->setImageRectangle(tileRect);
+   theTile->makeBlank();
+   
+   switch(data->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<ossim_uint8>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<ossim_uint8>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_FLOAT: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<float>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<float>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<ossim_uint16>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<ossim_uint16>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<ossim_sint16>(0), data, theTile);
+         }
+         else
+         {
+            convolvePartial(static_cast<ossim_sint16>(0), data, theTile);
+         }
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         if(data->getDataObjectStatus() == OSSIM_FULL)
+         {
+            convolveFull(static_cast<double>(0), data, theTile);
+      }
+      else
+      {
+         convolvePartial(static_cast<double>(0), data, theTile);
+      }
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimConvolutionFilter1D::getTile WARNING:\n"
+            << "Scalar type = " << theTile->getScalarType()
+            << " Not supported by ossimConvolutionFilter1D" << endl;
+         break;
+      }
+   }
+   theTile->validate();
+   
+   return theTile;
+}
+
+
+template<class T> void ossimConvolutionFilter1D::convolvePartial(
+   T,
+   ossimRefPtr<ossimImageData> inputData,
+   ossimRefPtr<ossimImageData> outputData)
+{
+   // there may be NULL pixels in the input
+   ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
+   ossim_uint32 outputW       = outputData->getWidth();
+   ossim_uint32 outputH       = outputData->getHeight();
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   
+   ossim_uint32 klength=(ossim_uint32)theKernel.size(),k;
+   ossim_int32 incrK = theIsHz ? 1 : inputW; //kernel increment in input : one col or one row
+   ossim_int32 iRow  = inputW - outputW; //jump to go to next row
+
+   double sum=0.0;
+   T* iKP; //kernel covered input pointer
+
+   ossim_int32 iCo = incrK*theCenterOffset; //center  pixel offset within the input buffer
+
+   for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(band));
+      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
+      T maxPix     = static_cast<T>(getMaxPixelValue(band));
+      T minPix     = static_cast<T>(getMinPixelValue(band));
+      T nullPix    = static_cast<T>(inputData->getNullPix(band));
+      T oNullPix   = static_cast<T>(getNullPixelValue(band));
+      
+      if(inputBuf&&outputBuf)
+      {
+         for(ossim_uint32 row = 0; row < outputH; ++row)
+         {
+            for(ossim_uint32 col = 0; col < outputW; ++col)
+            {
+               //center pixel may not be NULL
+               if (inputBuf[iCo] != nullPix)
+               {
+                  iKP = inputBuf; 
+                  sum = 0.0;
+                  for(k=0;k<klength;++k)
+                  {
+                     if (*iKP != nullPix) //just sum on non-NULL pixels (potential normailzation issue)
+                     {
+                        sum += theKernel[k] * (double)(*iKP);                   
+                     } else if (theStrictNoData)
+                     {
+                        break;
+                     }                     
+                     iKP += incrK;
+                  }
+                  if (k==klength)
+                  {
+                     if(sum > maxPix)
+                     {
+                        *outputBuf = maxPix;
+                     }
+                     else if(sum < minPix)
+                     {
+                        *outputBuf = minPix;
+                     }
+                     else
+                     {
+                        *outputBuf = static_cast<T>(sum);
+                     }
+                  } else {
+                     //theStrictNoData
+                     *outputBuf = oNullPix;
+                  }
+               } else {
+                  *outputBuf = oNullPix;
+               }
+               // move curent center position
+               inputBuf  += 1;
+               outputBuf += 1;
+            }
+            //move current center position
+            inputBuf  += iRow;
+            //outputBuf += 0;
+         }
+      }
+   }
+    
+   
+}
+
+template<class T> void ossimConvolutionFilter1D::convolveFull(
+   T,
+   ossimRefPtr<ossimImageData> inputData,
+   ossimRefPtr<ossimImageData> outputData)
+{
+   //inputData must be displaced according to the Kernel size and theCenterOffset +isHz
+   ossim_int32 inputW = static_cast<ossim_int32>(inputData->getWidth());
+   ossim_uint32 outputW       = outputData->getWidth();
+   ossim_uint32 outputH       = outputData->getHeight();
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   
+   ossim_uint32 klength=(ossim_uint32)theKernel.size(), k;
+   ossim_int32 incrK = theIsHz ? 1 : inputW; //kernel increment in input : one col or one row
+   ossim_int32 iRow  = inputW - outputW; //jump to go to next row
+
+   double sum=0.0;
+   T* iKP; //kernel covered input pointer
+
+   for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(band));
+      T* outputBuf = static_cast<T*>(outputData->getBuf(band));
+      T maxPix     = static_cast<T>(getMaxPixelValue(band));
+      T minPix     = static_cast<T>(getMinPixelValue(band));
+      
+      if(inputBuf&&outputBuf)
+      {
+         for(ossim_uint32 row = 0; row < outputH; ++row)
+         {
+            for(ossim_uint32 col = 0; col < outputW; ++col)
+            {
+               sum = 0.0;
+               iKP = inputBuf;
+               for(k=0;k<klength;++k)
+               {
+                  sum += theKernel[k] * (double)(*iKP);
+                  iKP += incrK;
+               }
+               
+               if(sum > maxPix)
+               {
+                  *outputBuf = maxPix;
+               }
+               else if(sum < minPix)
+               {
+                  *outputBuf = minPix;
+               }
+               else
+               {
+                  *outputBuf = static_cast<T>(sum);
+               }
+               // move curent center position
+               inputBuf  += 1;
+               outputBuf += 1;
+            }
+            //move current center position
+            inputBuf  += iRow;
+            //outputBuf += 0;
+         }
+      }
+   }
+}
+
+void ossimConvolutionFilter1D::initialize()
+{
+   //---
+   // NOTE:
+   // Since initialize get called often sequentially we will wipe things slick
+   // but not reallocate to avoid multiple delete/allocates.
+   //
+   // On the first getTile call things will be reallocated/computed.
+   //---
+   theTile = NULL;
+   clearNullMinMax();
+}
+
+void ossimConvolutionFilter1D::allocate()
+{   
+   if(theInputConnection)
+   {
+      ossimImageDataFactory* idf = ossimImageDataFactory::instance();
+      
+      theTile = idf->create(this,
+                            this);
+      
+      theTile->initialize();
+   }
+}
+
+void ossimConvolutionFilter1D::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+
+   if(property->getName() == PROPNAME_KERNEL)
+   {
+      ossimMatrixProperty* matrixProperty = PTR_CAST(ossimMatrixProperty,
+                                                     property.get());
+      if(matrixProperty)
+      {
+         ossim_uint32 nc=matrixProperty->getNumberOfCols();
+         theKernel.resize(nc);
+         for(ossim_uint32 i=0;i<nc;++i)
+         {
+             theKernel[i] = (*matrixProperty)(0,i);
+         }
+         clearNullMinMax();
+      }
+      else
+      {
+         ossimImageSourceFilter::setProperty(property);
+      }
+   } else if (property->getName() == PROPNAME_ISHZ)  {
+      ossimBooleanProperty* booleanProperty = PTR_CAST(ossimBooleanProperty,
+                                                     property.get());
+      if(booleanProperty)
+      {
+         theIsHz = booleanProperty->getBoolean();
+      }
+   } else if (property->getName() == PROPNAME_STRICTNODATA)  {
+      ossimBooleanProperty* booleanProperty = PTR_CAST(ossimBooleanProperty,
+                                                     property.get());
+      if(booleanProperty)
+      {
+         theStrictNoData = booleanProperty->getBoolean();
+      }
+   } else if (property->getName() == PROPNAME_CENTEROFFSET)  {
+      ossimNumericProperty* numProperty = PTR_CAST(ossimNumericProperty,
+                                                     property.get());
+      if(numProperty)
+      {
+         theCenterOffset = numProperty->asInt32();
+      }
+   } else if (property->getName() == PROPNAME_KERNELSIZE)  {
+      ossimNumericProperty* numProperty = PTR_CAST(ossimNumericProperty,
+                                                     property.get());
+      if(numProperty)
+      {
+         theKernel.resize(numProperty->asUInt32());
+         clearNullMinMax();
+      }
+   } else {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimConvolutionFilter1D::getProperty(const ossimString& name)const
+{
+   if(name == PROPNAME_KERNEL)
+   {
+      ossimMatrixProperty* property = new ossimMatrixProperty(name);
+      property->resize(1,(int)theKernel.size());
+      for(ossim_uint32 i=0;i<theKernel.size();++i)
+      {
+        (*property)(0,i) = theKernel[i];
+      }
+      property->setCacheRefreshBit();
+      return property;
+   } else if (name==PROPNAME_ISHZ) {
+      ossimBooleanProperty* property = new ossimBooleanProperty(name,theIsHz);
+      property->setCacheRefreshBit();
+      return property;
+   } else if (name==PROPNAME_STRICTNODATA) {
+      ossimBooleanProperty* property = new ossimBooleanProperty(name,theStrictNoData);
+      property->setCacheRefreshBit();
+      return property;
+   } else if (name==PROPNAME_CENTEROFFSET) {
+      ossimNumericProperty* property = new ossimNumericProperty(name,ossimString::toString(theCenterOffset));
+      property->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT); //restrict to int type
+      property->setCacheRefreshBit();
+      return property;
+   } else if (name == PROPNAME_KERNELSIZE) {
+      ossimNumericProperty* property = new ossimNumericProperty(name,ossimString::toString((ossim_uint32)theKernel.size()),1.0,100.0);
+      property->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT); //restrict to int type
+      property->setCacheRefreshBit();
+      return property;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimConvolutionFilter1D::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back(PROPNAME_KERNELSIZE);
+   propertyNames.push_back(PROPNAME_KERNEL);
+   propertyNames.push_back(PROPNAME_CENTEROFFSET);
+   propertyNames.push_back(PROPNAME_ISHZ);
+   propertyNames.push_back(PROPNAME_STRICTNODATA);
+}
+
+bool ossimConvolutionFilter1D::saveState(ossimKeywordlist& kwl,
+                                         const char* prefix)const
+{   
+   kwl.add(prefix,
+           PROPNAME_KERNELSIZE,
+           static_cast<ossim_uint32>(theKernel.size()),
+           true);
+   kwl.add(prefix,
+          PROPNAME_CENTEROFFSET,
+           theCenterOffset,
+           true);
+   kwl.add(prefix,
+          PROPNAME_ISHZ,
+           theIsHz?"true":"false", //use string instead of boolean
+           true);
+   kwl.add(prefix,
+          PROPNAME_STRICTNODATA,
+           theStrictNoData?"true":"false", //use string instead of boolean
+           true);
+
+   for(ossim_uint32 row = 0; row < theKernel.size(); ++row)
+   {
+         ossimString newPrefix = "k" + ossimString::toString(row);
+         kwl.add(prefix,
+                 newPrefix,
+                 theKernel[row],
+                 true);          
+   }
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+
+bool ossimConvolutionFilter1D::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   //find kernel size
+   ossim_uint32 iks=0;
+   const char* ks = kwl.find(prefix, PROPNAME_KERNELSIZE);
+   if(ks)
+   {
+      iks = ossimString(ks).toUInt32();
+      if (iks<1)
+      {
+         cerr<<"ossimConvolutionFilter1D : warning bad "<< PROPNAME_KERNELSIZE <<" in state"<<endl;
+         iks=0;
+      }
+   } else {
+      iks=0;
+      cerr<<"ossimConvolutionFilter1D : warning no "<< PROPNAME_KERNELSIZE <<" in state"<<endl;
+   }
+
+   //load other props
+   const char* co = kwl.find(prefix, PROPNAME_CENTEROFFSET);
+   if(co)
+   {      
+      setCenterOffset(ossimString(co).toUInt32());
+   } else {
+      cerr<<"ossimConvolutionFilter1D : warning no "<< PROPNAME_CENTEROFFSET<<" in state"<<endl;
+   }
+   const char* ih = kwl.find(prefix, PROPNAME_ISHZ);
+   if(ih)
+   {      
+      setIsHorizontal(ossimString(ih).toBool());
+   } else {
+      cerr<<"ossimConvolutionFilter1D : warning no "<<PROPNAME_ISHZ<<" in state"<<endl;
+   }
+   const char* sn = kwl.find(prefix, PROPNAME_STRICTNODATA);
+   if(sn)
+   {      
+      setStrictNoData(ossimString(sn).toBool());
+   } else {
+      cerr<<"ossimConvolutionFilter1D : warning no "<<PROPNAME_STRICTNODATA<<" in state"<<endl;
+   }
+   //load kernel values
+   ossimString newPrefix = prefix;
+   newPrefix += ossimString("k");
+   theKernel.resize(iks);
+   for(ossim_uint32 r=0; r<iks; ++r)
+   {      
+      ossimString value = ossimString::toString(r);
+      
+      const char* v = kwl.find(newPrefix.c_str(),
+                               value.c_str());
+      if(v)
+      {
+         theKernel[r] = ossimString(v).toDouble();
+      } else {
+         cerr<<"ossimConvolutionFilter1D : warning no value for "<<newPrefix<<" in state"<<endl;
+         theKernel[r] = 0.0;
+      }
+   }
+   clearNullMinMax();
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+void ossimConvolutionFilter1D::setKernel(const std::vector<ossim_float64>& aKernel)
+{
+   theKernel = aKernel;
+   // Will be recomputed first getTile call.
+   clearNullMinMax();
+}
+
+double ossimConvolutionFilter1D::getNullPixelValue(ossim_uint32 band)const
+{
+   if( isSourceEnabled() && (band < theNullPixValue.size()) )
+   {
+      return theNullPixValue[band];
+   }
+
+   return ossim::defaultNull(getOutputScalarType());
+}
+
+double ossimConvolutionFilter1D::getMinPixelValue(ossim_uint32 band)const
+{
+   if( isSourceEnabled() && (band < theMinPixValue.size()) )
+   {
+      return theMinPixValue[band];
+   }
+   
+   return ossimImageSource::getMinPixelValue(band);
+}
+
+double ossimConvolutionFilter1D::getMaxPixelValue(ossim_uint32 band)const
+{
+   if( isSourceEnabled() && (band < theMaxPixValue.size()) )
+   {
+      return theMaxPixValue[band];
+   }
+
+   return ossimImageSource::getMaxPixelValue(band);
+}
+
+void ossimConvolutionFilter1D::clearNullMinMax()
+{
+   theNullPixValue.clear();
+   theMinPixValue.clear();
+   theMaxPixValue.clear();
+}
+
+void ossimConvolutionFilter1D::computeNullMinMax()
+{
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+
+   theNullPixValue.resize(BANDS);
+   theMinPixValue.resize(BANDS);
+   theMaxPixValue.resize(BANDS);
+
+   ossim_float64 defaultNull = ossim::defaultNull(getOutputScalarType());
+   ossim_float64 defaultMin = ossim::defaultMin(getOutputScalarType());
+   ossim_float64 defaultMax = ossim::defaultMax(getOutputScalarType());
+  
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      if(theInputConnection)
+      {
+         ossim_float64 inputNull = theInputConnection->getNullPixelValue(band);
+         ossim_float64 inputMin  = theInputConnection->getMinPixelValue(band);
+         ossim_float64 inputMax  = theInputConnection->getMaxPixelValue(band);
+         ossim_float64 tempMin   = 0.0;
+         ossim_float64 tempMax   = 0.0;
+         ossim_float64 k         = 0.0;
+         for(ossim_uint32 i=0;i<theKernel.size();++i)
+         {          
+               k=theKernel[i];
+               tempMin += (k<0.0) ? k*inputMax : k*inputMin;
+               tempMax += (k>0.0) ? k*inputMax : k*inputMin;          
+         }
+         
+         if((tempMin >= defaultMin) && (tempMin <= defaultMax))
+         {
+            theMinPixValue[band] = tempMin;
+         }
+         else
+         {
+            theMinPixValue[band] = defaultMin;
+         }
+
+         if((tempMax >= defaultMin) && (tempMax <= defaultMax))
+         {
+            theMaxPixValue[band] = tempMax;
+         }
+         else
+         {
+            theMaxPixValue[band] = defaultMax;
+         }
+         if((inputNull < theMinPixValue[band]) ||
+            (inputNull > theMaxPixValue[band]))
+         {
+            theNullPixValue[band] = inputNull;
+         }
+         else
+         {
+            theNullPixValue[band] = defaultNull;
+         }
+         
+      }
+      else // No input connection...
+      {
+         theNullPixValue[band] = defaultNull;
+         theMinPixValue[band]  = defaultMin;
+         theMaxPixValue[band]  = defaultMax;
+      }
+      
+   } // End of band loop.
+}
diff --git a/src/imaging/ossimConvolutionSource.cpp b/src/imaging/ossimConvolutionSource.cpp
new file mode 100644
index 0000000..2a4d156
--- /dev/null
+++ b/src/imaging/ossimConvolutionSource.cpp
@@ -0,0 +1,530 @@
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimConvolutionSource.cpp 18602 2010-12-28 05:49:36Z gpotts $
+
+#include <ossim/imaging/ossimConvolutionSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimDiscreteConvolutionKernel.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeyword.h>
+
+static const ossimKeyword NUMBER_OF_MATRICES = ossimKeyword("number_of_matrices", "");
+static const ossimKeyword NUMBER_OF_ROWS = ossimKeyword("rows", "");
+static const ossimKeyword NUMBER_OF_COLS = ossimKeyword("cols", "");
+
+RTTI_DEF1(ossimConvolutionSource, "ossimConvolutionSource", ossimImageSourceFilter);
+
+ossimConvolutionSource::ossimConvolutionSource()
+   : ossimImageSourceFilter(),
+     theTile(NULL)
+{
+}
+
+ossimConvolutionSource::ossimConvolutionSource(ossimImageSource* inputSource,
+                                               const NEWMAT::Matrix& convolutionMatrix)
+   : ossimImageSourceFilter(inputSource),
+     theTile(NULL)
+{
+   theConvolutionKernelList.push_back(new ossimDiscreteConvolutionKernel(convolutionMatrix));
+   setKernelInformation();
+   initialize();
+}
+
+ossimConvolutionSource::ossimConvolutionSource(ossimImageSource* inputSource,
+                                               const vector<NEWMAT::Matrix>& convolutionList)
+   : ossimImageSourceFilter(inputSource),
+     theTile(NULL)
+{
+   setConvolutionList(convolutionList);
+}
+
+ossimConvolutionSource::~ossimConvolutionSource()
+{
+   deleteConvolutionList();
+}
+
+void ossimConvolutionSource::setConvolution(const double* kernel,
+                                            int nrows,
+                                            int ncols,
+                                            bool doWeightedAverage)
+{
+   NEWMAT::Matrix m(nrows, ncols);
+   const double* tempPtr = kernel;
+   for(int row = 0; row < nrows; ++row)
+   {
+      for(int col = 0; col < ncols; ++col)
+      {
+         m[row][col] =*tempPtr;
+         ++tempPtr;
+      }
+   }
+   
+   setConvolution(m, doWeightedAverage);
+}
+
+void ossimConvolutionSource::setConvolutionList(const vector<NEWMAT::Matrix>& convolutionList,
+                                                bool doWeightedAverage)
+{
+   deleteConvolutionList();
+   ossim_uint32 idx;
+   for(idx = 0; idx < convolutionList.size(); ++idx)
+   {
+      theConvolutionKernelList.push_back(new ossimDiscreteConvolutionKernel(convolutionList[idx],
+                                                                            doWeightedAverage));
+   }
+
+   setKernelInformation();
+}
+
+ossimRefPtr<ossimImageData> ossimConvolutionSource::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection) return ossimRefPtr<ossimImageData>();
+
+   if((!isSourceEnabled())||
+      (theConvolutionKernelList.size() < 1))
+   {
+      return theInputConnection->getTile(tileRect, resLevel);
+   }
+   
+   if(!theTile.valid())
+   {
+      allocate();
+      if(!theTile.valid())  // Throw exception???
+      {
+         return theInputConnection->getTile(tileRect, resLevel);
+      }
+   }
+   
+   ossim_uint32 w  = tileRect.width();
+   ossim_uint32 h  = tileRect.height();
+   ossim_uint32 tw = theTile->getWidth();
+   ossim_uint32 th = theTile->getHeight();
+   theTile->setWidth(w);
+   theTile->setHeight(h);
+   if((w*h)!=(tw*th))
+   {
+      theTile->initialize();
+      theTile->makeBlank();
+   }
+   else
+   {
+      theTile->makeBlank();
+   }
+   theTile->setOrigin(tileRect.ul());
+   long offsetX = (theMaxKernelWidth)/2;
+   long offsetY = (theMaxKernelHeight)/2;
+   ossimIrect requestRect(tileRect.ul().x - offsetX,
+                          tileRect.ul().y - offsetY,
+                          tileRect.lr().x + offsetX,
+                          tileRect.lr().y + offsetY);
+   
+   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(requestRect,
+                                                                   resLevel);
+
+   if(!input.valid() ||
+      (input->getDataObjectStatus() == OSSIM_NULL)||
+      (input->getDataObjectStatus() == OSSIM_EMPTY))
+   {
+      return input;
+   }
+   switch(theTile->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      if(theConvolutionKernelList.size() == 1)
+      {
+         convolve(static_cast<ossim_uint8>(0),
+                  input,
+                  theConvolutionKernelList[0]);
+      }
+      else
+      {
+         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
+         ossim_uint32 idx;
+         for(idx = 0; idx < upperBound; ++idx)
+         {
+            convolve(static_cast<ossim_uint8>(0),
+                     input,
+                     theConvolutionKernelList[idx]);
+            input->loadTile(theTile.get());
+         }
+      }
+      break;
+   }
+   case OSSIM_USHORT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      if(theConvolutionKernelList.size() == 1)
+      {
+         convolve(static_cast<ossim_uint16>(0),
+                  input,
+                  theConvolutionKernelList[0]);
+      }
+      else
+      {
+         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
+         ossim_uint32 idx;
+         for(idx = 0; idx < upperBound; ++idx)
+         {
+            convolve(static_cast<ossim_uint16>(0),
+                     input,
+                     theConvolutionKernelList[idx]);
+            input->loadTile(theTile.get());
+         }
+      }
+      break;
+   }
+   case OSSIM_SSHORT16:
+   {
+      if(theConvolutionKernelList.size() == 1)
+      {
+         convolve(static_cast<ossim_sint16>(0),
+                  input,
+                  theConvolutionKernelList[0]);
+      }
+      else
+      {
+         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
+         ossim_uint32 idx;
+         for(idx = 0; idx < upperBound; ++idx)
+         {
+            convolve(static_cast<ossim_sint16>(0),
+                     input,
+                     theConvolutionKernelList[idx]);
+            input->loadTile(theTile.get());
+         }
+      }
+      break;
+   }
+   case OSSIM_FLOAT:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      if(theConvolutionKernelList.size() == 1)
+      {
+         convolve(static_cast<float>(0),
+                  input,
+                  theConvolutionKernelList[0]);
+      }
+      else
+      {
+         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
+         ossim_uint32 idx;
+         for(idx = 0; idx < upperBound; ++idx)
+         {
+            convolve(static_cast<float>(0),
+                     input,
+                     theConvolutionKernelList[idx]);
+            input->loadTile(theTile.get());
+         }
+      }
+      break;
+   }
+   case OSSIM_DOUBLE:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      if(theConvolutionKernelList.size() == 1)
+      {
+         convolve(static_cast<double>(0),
+                  input,
+                  theConvolutionKernelList[0]);
+      }
+      else
+      {
+         ossim_uint32 upperBound = (ossim_uint32)theConvolutionKernelList.size();
+         ossim_uint32 idx;
+         for(idx = 0; idx < upperBound; ++idx)
+         {
+            convolve(static_cast<double>(0),
+                     input,
+                     theConvolutionKernelList[idx]);
+            input->loadTile(theTile.get());
+         }
+      }
+      break;
+   }
+   default:
+   {
+      theTile->loadTile(input.get());
+   }
+   }
+   theTile->validate();
+   return theTile;
+}
+   
+template <class T>
+void ossimConvolutionSource::convolve(T /* dummyVariable */,
+                                      ossimRefPtr<ossimImageData> inputTile,
+                                      ossimDiscreteConvolutionKernel* kernel)
+{
+   ossimIpt startOrigin   = theTile->getOrigin();
+
+   // Make sure that the patch is not empty or NULL
+   //
+   ossimIpt startDelta(startOrigin.x - inputTile->getOrigin().x,
+                       startOrigin.y - inputTile->getOrigin().y);
+
+   ossimDataObjectStatus status = inputTile->getDataObjectStatus();
+   // let's setup some variables that we will need to do the
+   // convolution algorithm.
+   //
+   ossimIrect patchRect   = inputTile->getImageRectangle();
+   long tileHeight        = theTile->getHeight();
+   long tileWidth         = theTile->getWidth();
+   long outputBands       = theTile->getNumberOfBands();
+   long convolutionWidth  = kernel->getWidth();
+   long convolutionHeight = kernel->getHeight();
+   long convolutionOffsetX= convolutionWidth/2;
+   long convolutionOffsetY= convolutionHeight/2;
+   long patchWidth        = patchRect.width();
+   long convolutionTopLeftOffset = 0;
+   long convolutionCenterOffset  = 0;
+   
+   long outputOffset          = 0;
+   T np = 0;
+   
+   const double minPix  = ossim::defaultMin(getOutputScalarType());
+   const double maxPix  = ossim::defaultMax(getOutputScalarType());
+//   const double* maxPix  = inputTile->getMaxPix();
+   const double* nullPix = inputTile->getNullPix();
+   double convolveResult = 0;
+   
+   if(status == OSSIM_PARTIAL) // must check for NULLS
+   {
+      for(long y = 0; y <tileHeight; y++)
+      {
+         convolutionCenterOffset  = patchWidth*(startDelta.y + y) + startDelta.x;
+         convolutionTopLeftOffset = patchWidth*(startDelta.y + y - convolutionOffsetY) + startDelta.x-convolutionOffsetX;
+         
+         for(long x =0; x < tileWidth; x++)
+         {
+            if(!inputTile->isNull(convolutionCenterOffset))
+            {
+               for(long b = 0; b < outputBands; ++b)
+               {
+                  T* buf    = (T*)(inputTile->getBuf(b)) + convolutionTopLeftOffset;
+                  T* outBuf = (T*)(theTile->getBuf(b));
+                  kernel->convolveSubImage(buf,
+                                           patchWidth,
+                                           convolveResult,
+                                           (T)nullPix[b]);
+
+                  convolveResult = convolveResult < minPix? minPix:convolveResult;
+                  convolveResult = convolveResult > maxPix? maxPix:convolveResult;
+                  
+                  outBuf[outputOffset] = (T)convolveResult;
+               }
+            }
+            else
+            {
+               theTile->setNull(outputOffset);
+               
+            }
+            ++convolutionCenterOffset;
+            ++convolutionTopLeftOffset;
+            ++outputOffset;
+         }
+      }
+   }
+   else  // do not need to check for nulls here.
+   {
+      for(long b = 0; b < outputBands; ++b)
+      {                  
+         double convolveResult = 0;
+         const T* buf = (const T*)inputTile->getBuf(b);
+         T* outBuf    = (T*)(theTile->getBuf(b));
+         np =(T)nullPix[b];
+         outputOffset = 0;
+         
+         for(long y = 0; y <tileHeight; y++)
+         {
+            convolutionTopLeftOffset = patchWidth*(startDelta.y + y - convolutionOffsetY) + startDelta.x-convolutionOffsetX;
+            
+            for(long x =0; x < tileWidth; x++)
+            {
+               kernel->convolveSubImage(&buf[convolutionTopLeftOffset],
+                                        patchWidth,
+                                        convolveResult,
+                                        np);
+// NOT SURE IF I WANT TO CLAMP IN A CONVOLUTION SOURCE  
+// seems better to clamp to a scalar range instead of an input min max
+               convolveResult = convolveResult < minPix? (T)minPix:convolveResult;
+               convolveResult = convolveResult > maxPix?(T)maxPix:convolveResult;
+               outBuf[outputOffset] = (T)convolveResult;
+               ++outputOffset;
+               ++convolutionTopLeftOffset;
+            }
+         }
+      }
+   }
+}
+
+void ossimConvolutionSource::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   theTile = NULL;
+}
+
+void ossimConvolutionSource::allocate()
+{
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,
+                                                          theInputConnection);
+      theTile->initialize();
+   }
+}
+
+bool ossimConvolutionSource::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix)const
+{
+   ossim_uint32 numberOfMatrices = 0;
+   for(ossim_uint32 m = 0; m < theConvolutionKernelList.size();++m)
+   {
+      if(theConvolutionKernelList[m])
+      {
+         ++numberOfMatrices;
+         const NEWMAT::Matrix& kernel = theConvolutionKernelList[m]->getKernel();
+         ossimString mPrefix = "m" +
+                               ossimString::toString(numberOfMatrices) +
+                               ".";
+         kwl.add(prefix,
+                 (mPrefix + "rows").c_str(),
+                 kernel.Nrows(),
+                 true);
+         
+         kwl.add(prefix,
+                 (mPrefix + "cols").c_str(),
+                 kernel.Ncols(),
+                 true);
+         
+         for(ossim_int32 row = 0; row < kernel.Nrows(); ++row)
+         {
+            for(ossim_int32 col =0; col < kernel.Ncols(); ++col)
+            {
+               ossimString newPrefix = mPrefix +
+                                       ossimString::toString(row+1) + "_" +
+                                       ossimString::toString(col+1);
+               kwl.add(prefix,
+                       newPrefix,
+                       kernel[row][col],
+                       true);          
+            }
+         }
+      }
+   }
+
+   
+   kwl.add(prefix,
+           NUMBER_OF_MATRICES,
+           numberOfMatrices,
+           true);
+      
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+
+bool ossimConvolutionSource::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   deleteConvolutionList();
+
+   const char* numberOfMatrices = kwl.find(prefix, NUMBER_OF_MATRICES);
+
+   ossim_int32 matrixCount = ossimString(numberOfMatrices).toLong();
+   ossim_int32 numberOfMatches = 0;
+   ossim_int32 index = 0;
+   while(numberOfMatches < matrixCount)
+   {
+      ossimString newPrefix = prefix;
+      newPrefix += ossimString("m");
+      newPrefix += ossimString::toString(index);
+      newPrefix += ossimString(".");
+
+      const char* rows = kwl.find((newPrefix+NUMBER_OF_ROWS.key()).c_str());
+      const char* cols = kwl.find((newPrefix+NUMBER_OF_COLS.key()).c_str());
+
+      if(rows&&cols)
+      {
+         ++numberOfMatches;
+         ossim_int32 numberOfRows = ossimString(rows).toLong();
+         ossim_int32 numberOfCols = ossimString(cols).toLong();
+         NEWMAT::Matrix convolutionMatrix(numberOfRows, numberOfCols);
+         
+         
+         for(ossim_int32 r = 1; r <= numberOfRows; r++)
+         {
+            for(ossim_int32 c = 1; c <= numberOfCols; c++)
+            {
+               convolutionMatrix[r-1][c-1] = 0.0;
+               
+               ossimString value = ossimString::toString(r);
+               value += "_";
+               value += ossimString::toString(c);
+
+               const char* v = kwl.find(newPrefix.c_str(),
+                                        value.c_str());
+               if(v)
+               {
+                  convolutionMatrix[r-1][c-1] = ossimString(v).toDouble();
+               }
+            }
+         }
+         theConvolutionKernelList.push_back(new ossimDiscreteConvolutionKernel(convolutionMatrix));
+      }
+      ++index;
+   }
+   setKernelInformation();
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+void ossimConvolutionSource::setKernelInformation()
+{
+   ossim_uint32 index;
+   
+   if(theConvolutionKernelList.size() > 0)
+   {
+      theMaxKernelWidth  = theConvolutionKernelList[0]->getWidth();
+      theMaxKernelHeight = theConvolutionKernelList[0]->getHeight();
+      
+      for(index = 1; index < theConvolutionKernelList.size(); ++index)
+      {
+         ossim_int32 w = theConvolutionKernelList[index]->getWidth();
+         ossim_int32 h = theConvolutionKernelList[index]->getHeight();
+         theMaxKernelWidth  = theMaxKernelWidth < w?w:theMaxKernelWidth;
+         theMaxKernelHeight = theMaxKernelHeight < h?h:theMaxKernelHeight;
+      }
+   }
+}
+
+void ossimConvolutionSource::deleteConvolutionList()
+{
+   for(ossim_int32 index = 0; index < (ossim_int32)theConvolutionKernelList.size(); ++index)
+   {
+      delete theConvolutionKernelList[index];
+   }
+
+   theConvolutionKernelList.clear();
+}
+
+void ossimConvolutionSource::setConvolution(const NEWMAT::Matrix& convolutionMatrix, bool doWeightedAverage)
+{
+   std::vector<NEWMAT::Matrix> m;
+   
+   m.push_back(convolutionMatrix);
+   
+   setConvolutionList(m, doWeightedAverage);
+}
diff --git a/ossim/src/ossim/imaging/ossimDdffield.cpp b/src/imaging/ossimDdffield.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDdffield.cpp
rename to src/imaging/ossimDdffield.cpp
diff --git a/ossim/src/ossim/imaging/ossimDdffielddefn.cpp b/src/imaging/ossimDdffielddefn.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDdffielddefn.cpp
rename to src/imaging/ossimDdffielddefn.cpp
diff --git a/ossim/src/ossim/imaging/ossimDdfmodule.cpp b/src/imaging/ossimDdfmodule.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDdfmodule.cpp
rename to src/imaging/ossimDdfmodule.cpp
diff --git a/ossim/src/ossim/imaging/ossimDdfrecord.cpp b/src/imaging/ossimDdfrecord.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDdfrecord.cpp
rename to src/imaging/ossimDdfrecord.cpp
diff --git a/ossim/src/ossim/imaging/ossimDdfsubfielddefn.cpp b/src/imaging/ossimDdfsubfielddefn.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDdfsubfielddefn.cpp
rename to src/imaging/ossimDdfsubfielddefn.cpp
diff --git a/ossim/src/ossim/imaging/ossimDdfutils.cpp b/src/imaging/ossimDdfutils.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDdfutils.cpp
rename to src/imaging/ossimDdfutils.cpp
diff --git a/src/imaging/ossimDespeckleFilter.cpp b/src/imaging/ossimDespeckleFilter.cpp
new file mode 100644
index 0000000..38f03dd
--- /dev/null
+++ b/src/imaging/ossimDespeckleFilter.cpp
@@ -0,0 +1,240 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+//*******************************************************************
+//  $Id: ossimDespeckleFilter.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#include <ossim/imaging/ossimDespeckleFilter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeyword.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+static const ossimKeyword FILTER_RADIUS_KW = ossimKeyword("filter_radius", "");
+
+RTTI_DEF1(ossimDespeckleFilter, "ossimDespeckleFilter", ossimImageSourceFilter);
+
+ossimDespeckleFilter::ossimDespeckleFilter()
+   : ossimImageSourceFilter(),
+     theTile(NULL),
+     theFilterRadius(1)
+{
+}
+
+ossimDespeckleFilter::ossimDespeckleFilter(ossimImageSource* inputSource, ossim_uint32 filter_radius)
+   : ossimImageSourceFilter(inputSource),
+     theTile(NULL),
+     theFilterRadius(filter_radius)
+{
+   initialize();
+}
+
+ossimDespeckleFilter::~ossimDespeckleFilter()
+{
+   theTile = 0;
+}
+
+ossimRefPtr<ossimImageData> 
+ossimDespeckleFilter::getTile(const ossimIrect& tileRect,ossim_uint32 resLevel)
+{
+   if (!theInputConnection) 
+      return NULL;
+
+   if (!isSourceEnabled())
+      return theInputConnection->getTile(tileRect, resLevel);
+   
+   if (!theTile.valid())
+   {
+      allocate();
+      if (!theTile.valid())  // Throw exception???
+         return theInputConnection->getTile(tileRect, resLevel);
+   }
+   
+   // Fetch input tile with kernel margins:
+   ossimIrect requestRect(tileRect.ul().x - theFilterRadius,
+                          tileRect.ul().y - theFilterRadius,
+                          tileRect.lr().x + theFilterRadius,
+                          tileRect.lr().y + theFilterRadius);
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(requestRect, resLevel);
+   if (!inputTile.valid())
+      return NULL;
+
+   ossim_uint32 w  = tileRect.width();
+   ossim_uint32 h  = tileRect.height();
+   ossim_uint32 tw = theTile->getWidth();
+   ossim_uint32 th = theTile->getHeight();
+   theTile->setWidth(w);
+   theTile->setHeight(h);
+   if((w*h)!=(tw*th))
+      theTile->initialize();
+      
+   theTile->makeBlank();
+   theTile->setOrigin(tileRect.ul());
+   
+   ossimDataObjectStatus status = inputTile->getDataObjectStatus();
+   if ((status == OSSIM_NULL) || (status == OSSIM_EMPTY))
+      return inputTile;
+
+   switch(inputTile->getScalarType())
+   {
+   case OSSIM_UCHAR:
+      despeckle(static_cast<ossim_uint8>(0), inputTile);
+      break;
+   
+   case OSSIM_USHORT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      despeckle(static_cast<ossim_uint16>(0), inputTile);
+      break;
+
+   case OSSIM_SSHORT16:
+      despeckle(static_cast<ossim_sint16>(0), inputTile);
+      break;
+
+   case OSSIM_FLOAT:
+   case OSSIM_NORMALIZED_FLOAT:
+      despeckle(static_cast<float>(0), inputTile);
+      break;
+
+   case OSSIM_DOUBLE:
+   case OSSIM_NORMALIZED_DOUBLE:
+      despeckle(static_cast<double>(0), inputTile);
+      break;
+
+   default:
+      theTile->loadTile(inputTile.get());
+   }
+   
+   theTile->validate();
+   return theTile;
+}
+   
+template <class T>
+void ossimDespeckleFilter::despeckle(T /* dummyVariable */, ossimRefPtr<ossimImageData> inputTile)
+{
+   ossimIpt inUL  (inputTile->getImageRectangle().ul());
+   ossimIpt inLR  (inputTile->getImageRectangle().lr());
+   ossimIpt outUL (theTile->getImageRectangle().ul());
+   ossimIpt outLR (theTile->getImageRectangle().lr());
+   long inWidth   = inputTile->getWidth();
+   long outWidth  = theTile->getWidth();
+   long num_bands = theTile->getNumberOfBands();
+   
+      // Loop over all bands first:
+   for(long b = 0; b < num_bands; ++b)
+   {                  
+      const T* inbuf = (const T*) inputTile->getBuf(b);
+      T* outBuf = (T*) theTile->getBuf(b);
+      T null_pixel = (T) inputTile->getNullPix(b);
+
+      for (long y=outUL.y; y<=outLR.y; y++)
+      {
+         for (long x=outUL.x; x<=outLR.x; x++)
+         {
+            bool found_valid = false;
+            long idx = (y - inUL.y)*inWidth + x - inUL.x; // index to input buffer
+            long odx = (y-outUL.y)*outWidth + x - outUL.x;// index to output buffer
+          
+            T pixel = inbuf[idx];
+            if (pixel != null_pixel)
+            {
+               // Inside loop over input "kernel" pixels centered at x, y:
+               for (long iy=-theFilterRadius; (iy<=theFilterRadius) && !found_valid; iy++)
+               {
+                  // Compute row number in image space and skip this row if outside input tile:
+                  long row = y + iy;
+                  if ((row < inUL.y) || (row > inLR.y))
+                     continue;
+
+                  for (long ix=-theFilterRadius; (ix<=theFilterRadius) && !found_valid; ix++)
+                  {
+                     // Compute column number in image space and skip this col if outside input tile:
+                     long col = x + ix;
+                     if ((col < inUL.x) || (col > inLR.x))
+                        continue;
+
+                     // Compute offset into input buffer for the neighbor pixel. If we aren't at the 
+                     // kernel center, consider if valid neighbor was found:
+                     idx = (row - inUL.y)*inWidth + col - inUL.x;
+                     if ( ((iy != 0) || (ix != 0)) && (inbuf[idx] != null_pixel) )
+                        found_valid = true;
+                  }
+               }
+            }
+
+            // Finished scanning neighborhood. Save output to tile buffer:
+            if (found_valid)
+               outBuf[odx] = pixel;
+            else
+               outBuf[odx] = null_pixel;
+         }
+      }
+   }
+}
+
+void ossimDespeckleFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   theTile = NULL;
+}
+
+void ossimDespeckleFilter::allocate()
+{
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this, theInputConnection);
+      theTile->initialize();
+   }
+}
+
+bool ossimDespeckleFilter::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix, FILTER_RADIUS_KW, theFilterRadius, true);
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+
+bool ossimDespeckleFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, FILTER_RADIUS_KW);
+   if (lookup)
+      theFilterRadius = ossimString(lookup).toInt32();
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+void ossimDespeckleFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimString name = property->getName();
+   if(name == "Filter Radius")
+      theFilterRadius = property->valueToString().toInt32();
+   else
+      ossimImageSourceFilter::setProperty(property);
+}
+
+ossimRefPtr<ossimProperty> ossimDespeckleFilter::getProperty(const ossimString& name)const
+{
+   if(name == "Filter Radius")
+   {
+      ossimProperty* prop = new ossimNumericProperty(name, ossimString::toString(theFilterRadius), 1, 16.0);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimDespeckleFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back("Filter Radius");
+}
+
diff --git a/src/imaging/ossimDilationFilter.cpp b/src/imaging/ossimDilationFilter.cpp
new file mode 100644
index 0000000..8a5a68e
--- /dev/null
+++ b/src/imaging/ossimDilationFilter.cpp
@@ -0,0 +1,311 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimDilationFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimDilationFilter.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <vector>
+#include <numeric>
+
+using namespace std;
+
+RTTI_DEF1(ossimDilationFilter, "ossimDilationFilter", ossimImageSourceFilter);
+
+// Keywords used throughout.
+static const ossimString WINDOW_SIZE_KW = "window_size";
+static const ossimString RECURSIVE_DILATION_KW = "recursive_dilation";
+
+ossimDilationFilter::ossimDilationFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theTile(0),
+    theTempTile(0),
+    theWindowSize(15),
+    theRecursiveFlag(false),
+    theNullFoundFlag(false)
+{
+   setDescription(ossimString("Dilation Filter"));
+}
+
+ossimDilationFilter::~ossimDilationFilter()
+{
+}
+
+void ossimDilationFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   theTile = NULL;
+}
+
+ossimRefPtr<ossimImageData> ossimDilationFilter::getTile(const ossimIrect& rect,
+                                                         ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled())
+      return ossimImageSourceFilter::getTile(rect, resLevel);
+
+   ossimRefPtr<ossimImageData> inputData;
+   if (theRecursiveFlag)
+      inputData =  ossimImageSourceFilter::getTile(rect, resLevel);
+   else
+   {
+      ossim_uint32 halfSize = getWindowSize()>>1;
+      ossimIrect requestRect(rect.ul().x - halfSize,
+                             rect.ul().y - halfSize,
+                             rect.lr().x + halfSize,
+                             rect.lr().y + halfSize);
+
+      inputData =  ossimImageSourceFilter::getTile(requestRect, resLevel);
+   }
+
+   if(!inputData.valid() || !inputData->getBuf())
+      return inputData;
+
+   vector<ossimIpt> viv;
+   ossimImageSourceFilter::getValidImageVertices(viv, OSSIM_CLOCKWISE_ORDER, resLevel);
+   theValidImagePoly = ossimPolygon(viv);
+
+   if(!theTile.valid())
+   {
+      theTile = (ossimImageData*)inputData->dup();
+      theTile->setImageRectangle(rect);
+   }
+   else
+   {
+      theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
+   }
+
+   theNullFoundFlag = false;
+   switch(inputData->getScalarType())
+   {
+      case OSSIM_UINT8:
+         doDilation(ossim_uint8(0), inputData);
+         break;
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+         doDilation(ossim_uint16(0), inputData);
+         break;
+      case OSSIM_SINT16:
+         doDilation(ossim_sint16(0), inputData);
+         break;
+      case OSSIM_UINT32:
+         doDilation(ossim_uint32(0), inputData);
+         break;
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+         doDilation(ossim_float32(0), inputData);
+         break;
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+         doDilation(ossim_float64(0), inputData);
+         break;
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimDilationFilter::applyFilter WARNING:\n"
+            << "Unhandled scalar type!" << endl;
+      }
+   }
+   return theTile;
+}
+
+template <class T>
+void ossimDilationFilter::doDilation(T scalarType , ossimRefPtr<ossimImageData>& inputData)
+{
+   ossimDataObjectStatus status = inputData->getDataObjectStatus();
+
+   if ((status == OSSIM_FULL) || (status == OSSIM_EMPTY))
+   {
+      // Nothing to do just copy the tile.
+      theTile->loadTile(inputData.get());
+      return;
+   }
+
+   ossim_int32 halfWindow = (ossim_int32)(theWindowSize >> 1);
+   ossim_int32 x, y, kernelX, kernelY;   
+   ossim_int32 iw = (ossim_int32)inputData->getWidth();
+   ossim_int32 ih = (ossim_int32)inputData->getHeight();
+   ossim_int32 ow = (ossim_int32)theTile->getWidth();
+   ossim_int32 oh = (ossim_int32)theTile->getHeight();
+   ossim_uint32 numBands = ossim::min(theTile->getNumberOfBands(), inputData->getNumberOfBands());
+
+   // It may be that the input rect is the same size as the output (i.e., the tile bounds aren't
+   // expanded in the input's request to permit full kernels for output edge pixels:
+   ossim_uint32 i_offset = 0;
+   ossim_int32 delta = (ossim_int32)((iw - ow) >> 1);
+   ossim_int32 xi, yi;
+   if (delta > 0)
+      i_offset = (ossim_uint32) halfWindow*(iw + 1);
+
+   ossimIpt tile_ul (theTile->getImageRectangle().ul());
+   vector<double> values;
+   for(ossim_uint32 bandIdx = 0; bandIdx < numBands; ++bandIdx)
+   {
+      T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+      T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+      if (!inputBuf || !outputBuf)
+      {
+         return; // Shouldn't happen...
+      }
+
+      const T NP = (T)inputData->getNullPix(bandIdx);
+
+      for(y = 0; y < oh; ++y)
+      {
+         for(x = 0; x < ow; ++x)
+         {
+            // Get the center input pixel. Only process those points inside the valid image
+            // (to avoid dilation beyond valid image)
+            const T CP = *(inputBuf+i_offset);
+            ossimDpt ipt (tile_ul.x+x, tile_ul.y+y);
+            if ((CP == NP) && theValidImagePoly.isPointWithin(ipt))
+            {
+               theNullFoundFlag = true; // Needed for recursion
+               values.clear();
+               for(kernelY = -halfWindow; kernelY <= halfWindow; ++kernelY)
+               {
+                  yi = y + kernelY + delta;
+                  if ((yi < 0) || (y > ih))
+                     continue;
+
+                  for(kernelX = -halfWindow; kernelX <= halfWindow; ++kernelX)
+                  {
+                     xi = x + kernelX + delta;
+                     if ((xi < 0) || (x > iw))
+                        continue;
+
+                     T tempValue = *(inputBuf+kernelX+delta + (kernelY+delta)*iw);
+                     if(tempValue != NP)
+                        values.push_back((double)tempValue);
+                  }
+               }
+
+               if(values.size() > 0)
+               {
+                  double accum = accumulate(values.begin(), values.end(), 0.0);
+                  double average = accum/(double)values.size();
+                  (*outputBuf) = (T)average;
+               }
+               else
+               {
+                  (*outputBuf) = NP;
+               }
+
+            }
+            else // Center pixel (CP) not null.
+            {
+               (*outputBuf) = CP;
+            }
+
+            // Move over...
+            ++inputBuf;
+            ++outputBuf;
+
+         } // End of loop in x direction.
+
+         // Move down...
+         inputBuf += iw - ow;
+
+      }  // End of loop in y direction.
+
+   }  // End of band loop.
+
+   theTile->validate();
+
+   // Set up recursion for "dilation fill mode", we'll keep calling this getTile until all pixels
+   // are filled with non-null values:
+   if (theRecursiveFlag)
+   {
+      //cout << "Percent Full: "<<theTile->percentFull()<<endl; //###
+      //theTile->write("filtered.ras"); //###
+
+      status = theTile->getDataObjectStatus();
+      if (theNullFoundFlag)
+      {
+         theNullFoundFlag = false; // assume will fill, set true in next recursion if null found
+         theTempTile = new ossimImageData(*theTile.get());
+         doDilation(scalarType, theTempTile);
+      }
+   }
+}
+
+void ossimDilationFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property.valid())
+      return;
+
+   ossimString name = property->getName();
+
+   if (name == WINDOW_SIZE_KW)
+   {
+      theWindowSize = property->valueToString().toUInt32();
+   }
+   else if (name == RECURSIVE_DILATION_KW)
+   {
+      ossimString value;
+      property->valueToString(value);
+      setRecursiveFlag(value.toBool());
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimDilationFilter::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+   if (name == WINDOW_SIZE_KW)
+   {
+      prop = new ossimNumericProperty(WINDOW_SIZE_KW, ossimString::toString(theWindowSize), 3, 25);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   else if (name == RECURSIVE_DILATION_KW)
+   {
+      prop = new ossimBooleanProperty(RECURSIVE_DILATION_KW, getRecursiveFlag());
+      prop->setFullRefreshBit();
+      return prop;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimDilationFilter::getPropertyNames(vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(WINDOW_SIZE_KW);
+   propertyNames.push_back(RECURSIVE_DILATION_KW);
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+}
+
+bool ossimDilationFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix, WINDOW_SIZE_KW.c_str(), theWindowSize, true);
+   kwl.add(prefix, RECURSIVE_DILATION_KW.c_str(), (theRecursiveFlag?"true":"false"), true);
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimDilationFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, WINDOW_SIZE_KW.c_str());
+   if (lookup)
+      theWindowSize = ossimString(lookup).toUInt32();
+   
+   lookup = kwl.find(prefix, RECURSIVE_DILATION_KW.c_str());
+   if (lookup)
+      setRecursiveFlag(ossimString(lookup).toBool());
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
diff --git a/ossim/src/ossim/imaging/ossimDiscrete3x3HatFilter.cpp b/src/imaging/ossimDiscrete3x3HatFilter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDiscrete3x3HatFilter.cpp
rename to src/imaging/ossimDiscrete3x3HatFilter.cpp
diff --git a/ossim/src/ossim/imaging/ossimDiscreteConvolutionKernel.cpp b/src/imaging/ossimDiscreteConvolutionKernel.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimDiscreteConvolutionKernel.cpp
rename to src/imaging/ossimDiscreteConvolutionKernel.cpp
diff --git a/src/imaging/ossimDoqqTileSource.cpp b/src/imaging/ossimDoqqTileSource.cpp
new file mode 100644
index 0000000..542233b
--- /dev/null
+++ b/src/imaging/ossimDoqqTileSource.cpp
@@ -0,0 +1,260 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimDoqqTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
+#include <ossim/imaging/ossimDoqqTileSource.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/imaging/ossimGeneralRasterInfo.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/support_data/ossimDoqq.h>
+
+RTTI_DEF1(ossimDoqqTileSource,
+          "ossimDoqqTileSource",
+          ossimGeneralRasterTileSource);
+
+ossimDoqqTileSource::ossimDoqqTileSource()
+   :theHeaderInformation(0)
+{
+}
+
+ossimDoqqTileSource::~ossimDoqqTileSource()
+{
+   theHeaderInformation = 0;
+}
+
+bool ossimDoqqTileSource::open(const ossimFilename& filename)
+{
+   bool result = false;
+   
+   theHeaderInformation = new ossimDoqq(filename);
+   if(theHeaderInformation->errorStatus() == ossimDoqq::OSSIM_ERROR)
+   {
+      theHeaderInformation = 0;
+      
+      return result;
+   }
+   else
+   {
+     // Set the Acquisition Date
+     theAcqDate = theHeaderInformation->theAcqYear;
+     theAcqDate += "-";
+     theAcqDate += theHeaderInformation->theAcqMonth;
+     theAcqDate += "-";
+     theAcqDate += theHeaderInformation->theAcqDay;
+
+     vector<ossimFilename> f;
+     f.push_back(filename);
+     ossimGeneralRasterInfo genRasterInfo(f,
+					  OSSIM_UCHAR,
+					  OSSIM_BIP,
+					  theHeaderInformation->theRgb,
+					  theHeaderInformation->theLine,
+					  theHeaderInformation->theSample,
+					  theHeaderInformation->theHeaderSize,
+					  ossimGeneralRasterInfo::NONE,
+					  0);
+     
+     result = ossimGeneralRasterTileSource::open(genRasterInfo);
+   }
+
+   return result;
+} 
+
+//**************************************************************************************************
+//! Returns the image geometry object associated with this tile source or NULL if non defined.
+//! The geometry contains full-to-local image transform as well as projection (image-to-world)
+//**************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimDoqqTileSource::getImageGeometry()
+{
+   if (theGeometry.valid()) return theGeometry;
+   
+   if(theHeaderInformation.valid())
+   {
+      ossimKeywordlist kwl;
+      const char* prefix = 0; // legacy
+
+      ossimString proj  = theHeaderInformation->theProjection.trim().upcase();
+      ossimString datum = theHeaderInformation->theDatum.trim().upcase();
+
+      if(proj == ossimString("UTM") || proj == ossimString("1"))
+      {
+         kwl.add(prefix,
+                 ossimKeywordNames::TYPE_KW,
+                 "ossimUtmProjection",
+                 true);
+         kwl.add(prefix,
+                 ossimKeywordNames::ZONE_KW,
+                 theHeaderInformation->theUtmZone,
+                 true);
+      }
+      else
+      {
+         return ossimRefPtr<ossimImageGeometry>();
+      }
+
+      if(datum == ossimString("NAR") || datum == ossimString("4"))
+      {
+         kwl.add(prefix,
+                 ossimKeywordNames::DATUM_KW,
+                 "NAR-C", // North American Conus 1983
+                 true);
+      }
+      else if(datum == ossimString("NAS") || datum == ossimString("1"))
+      {
+         kwl.add(prefix,
+                 ossimKeywordNames::DATUM_KW,
+                 "NAS-C", // North American Conus 1927
+                 true);
+      }
+      else if(datum == ossimString("2"))
+      {
+         kwl.add(prefix,
+                 ossimKeywordNames::DATUM_KW,
+                 "WGD", // WGS 72
+                 true);
+      }
+      else if(datum == ossimString("3"))
+      {
+         kwl.add(prefix,
+                 ossimKeywordNames::DATUM_KW,
+                 "WGE", // WGS 84
+                 true);
+      }
+      else
+      {
+         return ossimRefPtr<ossimImageGeometry>();
+      }
+
+      kwl.add(prefix,
+              ossimKeywordNames::METERS_PER_PIXEL_X_KW,
+              theHeaderInformation->theGsd.x,
+              true);
+
+      kwl.add(prefix,
+              ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
+              theHeaderInformation->theGsd.y,
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_EASTING_KW,
+//            theHeaderInformation->theUE + (theHeaderInformation->theGsd/2.0),
+	      theHeaderInformation->theEasting,
+              true);
+
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_NORTHING_KW,
+//            theHeaderInformation->theUN - (theHeaderInformation->theGsd/2.0),
+	      theHeaderInformation->theNorthing,
+              true);
+
+      // Capture this for next time.
+      theGeometry = new ossimImageGeometry;
+      theGeometry->loadState(kwl, prefix);
+
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+      
+      return theGeometry;
+   }
+   return ossimRefPtr<ossimImageGeometry>();
+}
+
+ossimRefPtr<ossimProperty> ossimDoqqTileSource::getProperty(const ossimString& name)const
+{
+	if(name == "acquisition_date")
+	{
+		if(theHeaderInformation.valid())
+		{
+			std::stringstream out;
+			out << std::setw(4) << std::setfill(' ') << theHeaderInformation->theAcqYear.c_str()
+			<< std::setw(2) << setfill('0') << theHeaderInformation->theAcqMonth.c_str()
+			<< std::setw(2) << setfill('0') << theHeaderInformation->theAcqDay.c_str();
+			return new ossimStringProperty("acquisition_date", out.str());
+		}
+		return 0;
+	}
+	else if(name == "file_type")
+	{
+		return new ossimStringProperty("file_type", "DOQQ");
+	}
+	return ossimImageHandler::getProperty(name);
+}
+
+void ossimDoqqTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+	ossimImageHandler::getPropertyNames(propertyNames);
+	propertyNames.push_back("acquisition_date");
+	propertyNames.push_back("file_type");
+	
+}
+
+bool ossimDoqqTileSource::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   if(!ossimImageHandler::loadState(kwl, prefix))
+   {
+      return false;
+   }
+
+   if(lookup)
+   {
+      theHeaderInformation = new ossimDoqq(ossimFilename(lookup));
+      if(theHeaderInformation->errorStatus() != ossimDoqq::OSSIM_OK)
+      {
+         theHeaderInformation = 0;
+         return false;
+      }
+      else
+      {
+         ossimFilename filename(lookup);
+         vector<ossimFilename> f;
+         f.push_back(filename);
+         ossimGeneralRasterInfo genRasterInfo(f,
+                                              OSSIM_UCHAR,
+                                              OSSIM_BIP,
+                                              theHeaderInformation->theRgb,
+                                              theHeaderInformation->theLine,
+                                              theHeaderInformation->theSample,
+                                              theHeaderInformation->theHeaderSize,
+                                              ossimGeneralRasterInfo::NONE,
+                                              0);
+         return open(genRasterInfo);
+      }
+   }
+   else
+   {
+      return false;
+   }
+   
+   return true;
+}
+
+ossimString ossimDoqqTileSource::getShortName()const
+{
+   return ossimString("doqq");
+}
+
+ossimString ossimDoqqTileSource::getLongName()const
+{
+   return ossimString("doqq handler");
+}
+
+bool ossimDoqqTileSource::open(const ossimGeneralRasterInfo& info)
+{
+   return ossimGeneralRasterTileSource::open(info);
+}
+
+ossimString ossimDoqqTileSource::acqdate() const
+{
+   return theAcqDate;
+}
diff --git a/src/imaging/ossimDtedTileSource.cpp b/src/imaging/ossimDtedTileSource.cpp
new file mode 100644
index 0000000..47d0a19
--- /dev/null
+++ b/src/imaging/ossimDtedTileSource.cpp
@@ -0,0 +1,688 @@
+//---
+//
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class declaration for ossimDtedTileSource.
+//
+//---
+// $Id$
+
+#include <ossim/imaging/ossimDtedTileSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/support_data/ossimDtedInfo.h>
+#include <cstdlib>
+#include <iostream>
+using namespace std;
+
+RTTI_DEF1(ossimDtedTileSource, "ossimDtedTileSource", ossimImageHandler)
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimDtedTileSource:debug");
+
+
+ossimDtedTileSource::ossimDtedTileSource()
+   :
+      ossimImageHandler(),
+      theTile(0),
+      m_fileStr(0),
+      m_dtedInfo(0),
+      theTileWidth(0),
+      theTileHeight(0),
+      theNumberOfLines(0),
+      theNumberOfSamps(0),
+      theOffsetToFirstDataRecord(0),
+      theDataRecordSize(0),
+      theMinHeight(0),
+      theMaxHeight(0),
+      thePostSpacing(0.0, 0.0),
+      theSwapBytesFlag(false)
+{
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      theSwapBytesFlag = true;
+   }
+
+   // Set the tile size to the default.
+   ossimIpt defaultTileSize;
+   ossim::defaultTileSize(defaultTileSize);
+   theTileWidth  = static_cast<ossim_uint32>(defaultTileSize.x);
+   theTileHeight = static_cast<ossim_uint32>(defaultTileSize.y);
+
+   // Construction not complete.  Users should call "open" method.
+}
+
+ossimDtedTileSource::~ossimDtedTileSource()
+{
+   close();
+}
+
+ossimString ossimDtedTileSource::getShortName()const
+{
+   return ossimString("dted");
+}
+
+ossimString ossimDtedTileSource::getLongName()const
+{
+   return ossimString("dted reader");
+}
+
+ossimRefPtr<ossimImageData> ossimDtedTileSource::getTile(
+   const  ossimIrect& tile_rect, ossim_uint32 resLevel)
+{
+   if (!theTile.valid())
+   {
+      allocate(); // First getTile call or after changeTileSize.
+      if (!theTile.valid())
+      {
+         return ossimRefPtr<ossimImageData>(); // Throw exception???
+      }
+   }
+
+   // Image rectangle must be set prior to calling getTile.
+   theTile->setImageRectangle(tile_rect);
+
+   if ( getTile( theTile.get(), resLevel ) == false )
+   {
+      if (theTile->getDataObjectStatus() != OSSIM_NULL)
+      {
+         theTile->makeBlank();
+      }
+   }
+
+   return theTile;
+}
+
+bool ossimDtedTileSource::getTile(ossimImageData* result,
+                                  ossim_uint32 resLevel)
+{
+   bool status = false;
+
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
+   {
+      result->ref(); // Increment ref count.
+
+      //---
+      // Check for overview tile.  Some overviews can contain r0 so always
+      // call even if resLevel is 0.  Method returns true on success, false
+      // on error.
+      //---
+      status = getOverviewTile(resLevel, result);
+
+      if ( !status )  // Did not get an overview tile.
+      {
+         ossimIrect image_rect = getImageRectangle(resLevel);
+
+         ossimIrect tile_rect = result->getImageRectangle();
+
+         //---
+         // See if any point of the requested tile is in the image.
+         //---
+         if ( tile_rect.intersects(image_rect) )
+         {
+            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
+
+            if ( !tile_rect.completely_within(clip_rect) )
+            {
+               // Start with a blank tile.
+               result->makeBlank();
+            }
+
+            // Load the tile buffer with data from the dted cell.
+            status = fillBuffer(tile_rect, clip_rect, result);
+
+         } // End of if ( tile_rect.intersects(image_rect) )
+      }
+
+       result->unref(); // Decrement ref count.
+   }
+
+   return status;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimDtedTileSource::fillBuffer(const ossimIrect& tile_rect,
+                                     const ossimIrect& clip_rect,
+                                     ossimImageData* tile)
+{
+   //***
+   // NOTE:
+   // Elevation posts are organized positive line up.
+   // The "tile_rect" and "clip_rect" is organized positive line down.
+   //***
+
+   const ossim_int32 TILE_WIDTH = tile->getWidth();
+
+   //***
+   // Position the file pointer to the first record needed.
+   // Posts are organized positive line up so we're going to start at
+   // the lower left side of the cell so all reads are going forward in
+   // the file.
+   //***
+   ossim_int32 seek_position = theOffsetToFirstDataRecord +
+                         (clip_rect.ul().x * theDataRecordSize);
+   seek_position += DATA_RECORD_OFFSET_TO_POST +
+                    (theNumberOfLines - 1 - clip_rect.lr().y) * 2;
+
+   //***
+   // Get a pointer positioned at the first valid pixel in
+   // the tile.  Tiles are organized positive line down.
+   //***
+   ossim_sint16* d = static_cast<ossim_sint16*>(tile->getBuf());
+
+   // Loop in the longitude or sample direction.
+   for (ossim_int32 samp = clip_rect.ul().x; samp <= clip_rect.lr().x; samp++)
+   {
+      ossim_int32 d_offset = (clip_rect.lr().y - tile_rect.ul().y) *
+                       TILE_WIDTH +
+                       (samp - tile_rect.ul().x);
+
+      m_fileStr->seekg(seek_position, ios::beg); // Seek to the first post.
+
+      for (ossim_int32 line = clip_rect.lr().y; line >= clip_rect.ul().y; line--)
+      {
+         // Grab all the post needed from the column.
+         ossim_uint16 temp;
+         ossim_sint16 s;
+         m_fileStr->read((char*)&temp, POST_SIZE);
+         s = convertSignedMagnitude(temp);
+         d[d_offset] = s;
+         d_offset -= TILE_WIDTH;
+      }
+      seek_position += theDataRecordSize;
+   }
+
+   tile->validate();
+
+   return true;
+}
+
+ossim_uint32 ossimDtedTileSource::getNumberOfOutputBands()const
+{
+   return getNumberOfInputBands();
+}
+
+ossimIrect
+ossimDtedTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return ossimIrect(0,
+                     0,
+                     getNumberOfSamples(reduced_res_level) - 1,
+                     getNumberOfLines(reduced_res_level)   - 1);
+}
+
+bool ossimDtedTileSource::isOpen()const
+{
+   return (m_fileStr!=0);
+}
+
+void ossimDtedTileSource::close()
+{
+   m_fileStr.reset();
+}
+
+bool ossimDtedTileSource::open()
+{
+   static const char MODULE[] = "ossimDtedTileSource::open";
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nAttempting to parse file:  " << theImageFile.c_str()
+           << endl;
+   }
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( theImageFile.c_str(), std::ios_base::in|std::ios_base::binary);
+
+   // Open up the file for reading.
+   if (!str)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+
+	  if(traceDebug())
+	  {
+		  ossimNotify(ossimNotifyLevel_WARN) << MODULE << " ERROR!"
+											 << "\nCould not open file:  " << theImageFile.c_str()
+											 << "\nReturning..." << endl;
+		  CLOG << "returning with error..." << endl;
+	  }
+      return false;
+   }
+
+   if(!str)
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nCannot open:  " << theImageFile.c_str()
+              << endl;
+      }
+      str.reset();
+      return false;
+   }
+   std::string connectionString = theImageFile.c_str();
+   m_dtedInfo = std::make_shared<ossimDtedInfo>();
+   if(!m_dtedInfo->open(str, connectionString))
+   {
+      close();
+      return false;
+   }
+   m_fileStr = str;
+   m_fileStr->clear();
+   m_fileStr->seekg(0);
+
+   m_vol.parse(*str);
+   m_hdr.parse(*str);
+   m_uhl.parse(*str);
+   m_dsi.parse(*str);
+   m_acc.parse(*str);
+
+   //***
+   // Check for errors.  Must have uhl, dsi and acc records.  vol and hdr
+   // are for magnetic tape only; hence, may or may not be there.
+   //***
+   if (m_uhl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
+       m_dsi.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR ||
+       m_acc.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nError parsing file:  " << theImageFile.c_str()
+              << "\nPossibly not a dted file.\n";
+      }
+
+      str.reset();
+      return false;
+   }
+   m_fileStr = str;
+
+   // Get the cell specific info needed for later.
+   theNumberOfLines = m_uhl.numLatPoints();
+   theNumberOfSamps = m_uhl.numLonLines();
+   thePostSpacing.x = m_uhl.lonInterval();
+   thePostSpacing.y = m_uhl.latInterval();
+   theOffsetToFirstDataRecord = m_acc.stopOffset();
+   theDataRecordSize = DATA_RECORD_OFFSET_TO_POST +
+                       (theNumberOfLines * sizeof(ossim_sint16)) +
+                       DATA_RECORD_CHECKSUM_SIZE;
+
+   //---
+   // Note:
+   // Complete open calls loadMetaData which we have overriden to check for
+   // dot omd or dot statistics file.  If not there it will call
+   // gatherStatistics which will scan the file for min/max values.
+   //---
+   completeOpen();
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nNull pix:  " << getNullPixelValue(0)
+           << "\nMin  pix:  " << getMinPixelValue(0)
+           << "\nMax  pix:  " << getMaxPixelValue(0)
+           << "\ntheNumberOfLines:  " << theNumberOfLines
+           << "\ntheNumberOfSamps:  " << theNumberOfSamps
+           << "\ntheOffsetToFirstDataRecord:  " << theOffsetToFirstDataRecord
+           << "\ntheDataRecordSize:  " << theDataRecordSize << "\n";
+   }
+
+   return true;
+}
+
+void ossimDtedTileSource::allocate()
+{
+   //---
+   // Set up the tiles.  Note the blank tile will not get initialized to save
+   // memory.  This includes setting the min and max pixel value gathered
+   // from the statistics.
+   //---
+   theTile = ossimImageDataFactory::instance()->create(this, this);
+   if(theTile.valid())
+   {
+      theTile->initialize();
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG:"
+         << "\ntheTile:\n" << *theTile << "\n";
+   }
+}
+
+bool ossimDtedTileSource::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix) const
+{
+   // Currently nothing to do here.
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+bool ossimDtedTileSource::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   if (ossimImageHandler::loadState(kwl, prefix))
+   {
+      if (ossimImageHandler::open(theImageFile))
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+//**************************************************************************************************
+// Returns the image geometry object associated with this tile source or NULL if not defined.
+// The geometry contains full-to-local image transform as well as projection (image-to-world)
+//**************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimDtedTileSource::getImageGeometry()
+{
+   if ( theGeometry.valid() )
+      return theGeometry;
+
+   // Compute the projection tie point (UL corner of dted cell). The UHL supplies the SW (LL) corner
+   // coordinates, so need to compute the UL lat from the cell spacing:
+   const ossimDatum* datum = ossimDatumFactory::instance()->wgs84();
+   ossim_float64 ul_lat = m_uhl.latOrigin() + (m_uhl.latInterval() * (m_uhl.numLatPoints()-1.0));
+   ossim_float64 ul_lon = m_uhl.lonOrigin();
+   ossimGpt tie(ul_lat, ul_lon, 0.0, datum);
+
+   //---
+   // This code is backed out as it affects the corner.
+   // E.g.: image0.ur_lon:  -88.999999999995
+   // Should be -89.0
+   // Used ossimImageGeometry::::getMetersPerPixel for a center of the image gsd. (drb)
+   //
+   // We also need to define an origin for the projection as the center of the cell for proper GSD
+   // calculation (OLK 01/11: Used to set origin at 0,0 causing incorrect meters GSD to be
+   // computed)
+   // ossim_float64 mid_lat = m_uhl.latOrigin() + (m_uhl.latInterval()*m_uhl.numLatPoints()/2.0);
+   // ossim_float64 mid_lon = m_uhl.lonOrigin() + (m_uhl.lonInterval()*m_uhl.numLonLines()/2.0);
+   // ossimGpt origin (mid_lat, mid_lon, 0.0, datum);
+   //---
+   ossimGpt origin (0.0, 0.0, 0.0, datum);
+
+   // Make an Equidistant Cylindrical projection.
+   ossimRefPtr<ossimEquDistCylProjection> eq =
+      new ossimEquDistCylProjection(*(datum->ellipsoid()));
+
+      // Set the scale:
+   eq->setOrigin(origin);
+   eq->setUlTiePoints(tie);
+   ossimDpt gsd(m_uhl.lonInterval(), m_uhl.latInterval());
+   eq->setDecimalDegreesPerPixel(gsd);
+
+   // Give it to the geometry object.
+   ossimRefPtr<ossimProjection> proj = eq.get();
+
+   // Make the geometry:
+   theGeometry = new ossimImageGeometry;
+
+   // Set the projection.
+   theGeometry->setProjection( proj.get() );
+
+   // Set image things the geometry object should know about.
+   initImageParameters( theGeometry.get() );
+
+   return theGeometry;
+}
+
+ossimScalarType ossimDtedTileSource::getOutputScalarType() const
+{
+   return OSSIM_SSHORT16;  // Always signed 16 bit.
+}
+
+ossim_uint32 ossimDtedTileSource::getTileWidth() const
+{
+   return theTileWidth;
+}
+
+ossim_uint32 ossimDtedTileSource::getTileHeight() const
+{
+   return theTileHeight;
+}
+
+ossim_uint32 ossimDtedTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return theNumberOfLines;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfLines(reduced_res_level);
+   }
+
+   return 0;
+}
+
+ossim_uint32 ossimDtedTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return theNumberOfSamps;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfSamples(reduced_res_level);
+   }
+
+   return 0;
+}
+
+void ossimDtedTileSource::loadMetaData()
+{
+   ossimKeywordlist kwl;
+   const char* min_str = 0;
+   const char* max_str = 0;
+
+   ossimFilename f = theImageFile.fileNoExtension();
+
+   // Check for omd file.
+   f.setExtension("omd");
+   if ( f.exists() )
+   {
+      kwl.addFile(f);
+      min_str = kwl.find("band1.min_value");
+      max_str = kwl.find("band1.max_value");
+   }
+
+   if ( !min_str || !max_str )
+   {
+      f.setExtension("statistics");
+      if ( f.exists() )
+      {
+         kwl.addFile(f);
+         min_str = kwl.find(ossimKeywordNames::MIN_VALUE_KW);
+         max_str = kwl.find(ossimKeywordNames::MAX_VALUE_KW);
+      }
+   }
+
+   if ( min_str || max_str )
+   {
+      theMinHeight = atoi(min_str);
+      theMaxHeight = atoi(max_str);
+   }
+   else
+   {
+      gatherStatistics(false);
+   }
+}
+
+void ossimDtedTileSource::gatherStatistics(bool writeStatsFile)
+{
+   // Scan the cell and gather the statistics...
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimDtedTileSource::gatherStatistics() scanning for min/max"
+         << "\nThis may take a while...\n";
+   }
+
+   // Start off with the min and max pegged.
+   theMinHeight =  32767;
+   theMaxHeight = -32767;
+
+   // Put the file pointer at the start of the first elevation post.
+   m_fileStr->seekg(theOffsetToFirstDataRecord, ios::beg);
+
+   //---
+   // Loop through all records and scan for lowest min and highest max.
+   // Each record contains a row of latitude points for a given longitude.
+   // There are eight bytes in front of the post and four checksum bytes at
+   // the end so ignore them.
+   //---
+   for (ossim_uint32 i=0; i<theNumberOfSamps; i++)  // longitude direction
+   {
+      m_fileStr->seekg(DATA_RECORD_OFFSET_TO_POST, ios::cur);
+
+      for (ossim_uint32 j=0; j<theNumberOfLines; j++) // latitude direction
+      {
+         ossim_uint16 temp;
+         ossim_sint16 s;
+         m_fileStr->read((char*)&temp, POST_SIZE);
+         s = convertSignedMagnitude(temp);
+         if (s < theMinHeight && s != NULL_PIXEL) theMinHeight = s;
+         if (s > theMaxHeight) theMaxHeight = s;
+      }
+
+      m_fileStr->seekg(DATA_RECORD_CHECKSUM_SIZE, ios::cur);
+   }
+
+   if ( writeStatsFile )
+   {
+      // Add the stats to the keyword list.
+      ossimKeywordlist kwl;
+      kwl.add(ossimKeywordNames::MIN_VALUE_KW, theMinHeight);
+      kwl.add(ossimKeywordNames::MAX_VALUE_KW, theMaxHeight);
+
+      // Write out the statistics file.
+      ossimFilename f = theImageFile.fileNoExtension();
+      f.setExtension("statistics");
+      kwl.write( f.c_str() );
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimDtedTileSource::gatherStatistics DEBUG:"
+         << "\ntheMinHeight:  " << theMinHeight
+         << "\ntheMaxHeight:  " << theMaxHeight
+         << "\n";
+   }
+}
+
+ossim_uint32 ossimDtedTileSource::getImageTileWidth() const
+{
+   return 0;
+}
+
+ossim_uint32 ossimDtedTileSource::getImageTileHeight() const
+{
+   return 0;
+}
+
+ossim_uint32 ossimDtedTileSource::getNumberOfInputBands() const
+{
+   return 1;
+}
+
+double ossimDtedTileSource::getNullPixelValue(ossim_uint32 /* band */)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getNullPix(0);
+   }
+   return -32767.0;
+}
+double ossimDtedTileSource::getMinPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getMinPix(band);
+   }
+   return theMinHeight;
+}
+
+ double ossimDtedTileSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getMaxPix(band);
+   }
+   return theMaxHeight;
+}
+
+void ossimDtedTileSource::getPostSpacing(ossimDpt& postSpacing) const
+{
+   postSpacing.x = thePostSpacing.x;
+   postSpacing.y = thePostSpacing.y;
+}
+
+ossimRefPtr<ossimProperty> ossimDtedTileSource::getProperty(
+   const ossimString& name)const
+{
+   // look in base class.
+   ossimRefPtr<ossimProperty> result = ossimImageHandler::getProperty(name);
+
+   if (result.valid() == false)
+   {
+//      ossimDtedInfo info;
+//      std::string connectionString = theImageFile.c_str();
+      if (m_dtedInfo)
+      {
+         result = m_dtedInfo->getProperty(name);
+      }
+   }
+
+   return result;
+}
+
+void ossimDtedTileSource::getPropertyNames(
+   std::vector<ossimString>& propertyNames) const
+{
+   ossimImageHandler::getPropertyNames(propertyNames);
+
+   if (m_dtedInfo)
+   {
+      m_dtedInfo->getPropertyNames(propertyNames);
+   }
+//   ossimDtedInfo info;
+//   if (info.open(theImageFile))
+//   {
+//      info.getPropertyNames(propertyNames);
+//   }
+}
+
+const ossimDtedTileSource& ossimDtedTileSource::operator=(const  ossimDtedTileSource& rhs)
+{
+   return rhs;
+}
+
+ossimDtedTileSource::ossimDtedTileSource(const ossimDtedTileSource&)
+{
+}
diff --git a/ossim/src/ossim/imaging/ossimERSFileWriter.cpp b/src/imaging/ossimERSFileWriter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimERSFileWriter.cpp
rename to src/imaging/ossimERSFileWriter.cpp
diff --git a/src/imaging/ossimERSTileSource.cpp b/src/imaging/ossimERSTileSource.cpp
new file mode 100644
index 0000000..b022ac9
--- /dev/null
+++ b/src/imaging/ossimERSTileSource.cpp
@@ -0,0 +1,219 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Chong-Ket Chuah
+//
+// Description:
+//
+// Implementation for the class "ossimERSTileSource".  ossimERSTileSource
+// is used for reading ER Mapper raster file format.  The format consists
+// of a raster file with no extension and a header file with the same name 
+// as the raster file but with an .ers extension.
+//
+//*******************************************************************
+//  $Id: ossimERSTileSource.cpp 21512 2012-08-22 11:53:57Z dburken $
+
+#include <ossim/imaging/ossimERSTileSource.h>
+#include <ossim/support_data/ossimERS.h>
+
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+
+RTTI_DEF1(ossimERSTileSource, "ossimERSTileSource", ossimGeneralRasterTileSource);
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimERSTileSource::ossimERSTileSource()
+   :  ossimGeneralRasterTileSource(),
+      theHdr(NULL)
+{
+}
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimERSTileSource::ossimERSTileSource(const ossimKeywordlist& kwl,
+                                               const char* prefix)
+   :  ossimGeneralRasterTileSource(),
+      theHdr(NULL)
+{
+   if (loadState(kwl, prefix) == false)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+   }
+}
+
+//*******************************************************************
+// Destructor:
+//*******************************************************************
+ossimERSTileSource::~ossimERSTileSource()
+{
+   if (theHdr)
+   {
+      delete theHdr;
+      theHdr = NULL;
+   }
+}
+
+bool ossimERSTileSource::open(const ossimFilename& fileName)
+{
+   // Open and parse the header file
+   theHdr = new ossimERS(fileName);
+   
+//   theHdr->dump(cout);
+   
+   if(theHdr->errorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      delete theHdr;
+      theHdr = NULL;
+      return false;
+   }
+   else
+   {
+      vector<ossimFilename> f;
+	  ossimFilename fne;
+	  ossimFilename fpath = fileName.path();
+	  if (fpath.empty())
+		fne = fileName.fileNoExtension();
+	  else
+		fne = fpath+"/"+fileName.fileNoExtension();
+      f.push_back(fne);
+      ossimGeneralRasterInfo genRasterInfo(f,
+                                           theHdr->theCelltype,
+                                           OSSIM_BIL,
+                                           theHdr->theBands,
+                                           theHdr->theLine,
+                                           theHdr->theSample,
+                                           0,
+                                           ossimGeneralRasterInfo::NONE,
+                                           0);
+      if(theHdr->theHasNullCells)
+      {
+         ossim_uint32 i = 0;
+         ossim_uint32 bands = static_cast<ossim_uint32>(theHdr->theBands);
+         for(i = 0; i < bands; ++i)
+         {
+            genRasterInfo.getImageMetaData().setNullPix(i, theHdr->theNullCell);
+         }
+      }
+      ossimFilename metadataFile = fne;
+      metadataFile = metadataFile + ".omd";
+
+      if(metadataFile.exists())
+      {
+         ossimKeywordlist kwl;
+      
+         kwl.addFile(metadataFile.c_str());
+      
+         theMetaData.loadState(kwl);
+         ossim_uint32 i = 0;
+         ossim_uint32 bands = static_cast<ossim_uint32>(theHdr->theBands);
+         for(i = 0; i < bands; ++i)
+         {
+            if(theMetaData.getMinValuesValidFlag())
+            {
+               genRasterInfo.getImageMetaData().setMinPix(i, theMetaData.getMinPix(i));
+            }
+            if(theMetaData.getMaxValuesValidFlag())
+            {
+               genRasterInfo.getImageMetaData().setMaxPix(i, theMetaData.getMaxPix(i));
+            }
+            if(theMetaData.getNullValuesValidFlag())
+            {
+               genRasterInfo.getImageMetaData().setNullPix(i, theMetaData.getNullPix(i));
+            }
+         }
+      }
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "general raster info is\n";
+      genRasterInfo.print(ossimNotify(ossimNotifyLevel_INFO));
+      ossimGeneralRasterTileSource::open(genRasterInfo);
+   }
+	   
+   return true;
+}
+   
+
+ossimRefPtr<ossimImageGeometry> ossimERSTileSource::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      // Check for external geom:
+      theGeometry = getExternalImageGeometry();
+      
+      if ( !theGeometry )
+      {
+         
+         theGeometry = new ossimImageGeometry;
+
+         if(theHdr)
+         {
+            ossimKeywordlist kwl;
+            if ( theHdr->toOssimProjectionGeom(kwl) )
+            {
+               theGeometry->loadState(kwl);  
+            }
+         }
+
+         // At this point it is assured theGeometry is set.
+         
+         //---
+         // WARNING:
+         // Must create/set the geometry at this point or the next call to
+         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
+         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
+         //---         
+         
+         // Check for set projection.
+         if ( !theGeometry->getProjection() )
+         {
+            // Try factories for projection.
+            ossimImageGeometryRegistry::instance()->extendGeometry(this);
+         }
+      }
+
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+   }
+   return theGeometry;
+}
+
+bool ossimERSTileSource::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+
+   if (lookup)
+   {
+      ossimFilename fileName = lookup;
+
+      bool result =  open(fileName);
+      ossimImageSource::loadState(kwl, prefix);
+      return result;
+   }
+      
+   return ossimGeneralRasterTileSource::loadState(kwl, prefix);
+}
+
+ossimString ossimERSTileSource::getShortName() const
+{
+   return ossimString("ERS");
+}
+
+ossimString ossimERSTileSource::getLongName() const
+{
+   return ossimString("ER Mapper Raster");
+}
+
+ossimString  ossimERSTileSource::className() const
+{
+   return ossimString("ossimERSTileSource");
+}
+
diff --git a/src/imaging/ossimEastingNorthingCutter.cpp b/src/imaging/ossimEastingNorthingCutter.cpp
new file mode 100644
index 0000000..d9f6630
--- /dev/null
+++ b/src/imaging/ossimEastingNorthingCutter.cpp
@@ -0,0 +1,202 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// $Id: ossimEastingNorthingCutter.cpp 15766 2009-10-20 12:37:09Z gpotts $
+//----------------------------------------------------------------------------
+
+#include <sstream>
+#include <ossim/imaging/ossimEastingNorthingCutter.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+
+RTTI_DEF2(ossimEastingNorthingCutter, "ossimEastingNorthingCutter", ossimRectangleCutFilter, ossimViewInterface);
+
+static ossimTrace traceDebug(ossimString("ossimEastingNorthingCutter:debug"));
+
+
+ossimEastingNorthingCutter::ossimEastingNorthingCutter(ossimObject* owner,
+                                                       ossimImageSource* inputSource)
+   :ossimRectangleCutFilter(owner,
+                            inputSource),
+    ossimViewInterface(0),
+    theViewProjection(0)
+{
+   theUlEastingNorthing.makeNan();
+   theLrEastingNorthing.makeNan();
+   theCutType = OSSIM_RECTANGLE_NULL_OUTSIDE;
+}
+
+ossimEastingNorthingCutter::ossimEastingNorthingCutter(ossimImageSource* inputSource)
+   :ossimRectangleCutFilter(inputSource),
+    ossimViewInterface(0),
+    theViewProjection(0)
+{
+   theUlEastingNorthing.makeNan();
+   theLrEastingNorthing.makeNan();
+   theCutType = OSSIM_RECTANGLE_NULL_OUTSIDE;
+}
+
+ossimEastingNorthingCutter::~ossimEastingNorthingCutter()
+{
+}
+
+void ossimEastingNorthingCutter::setEastingNorthingRectangle(const ossimDpt& ul,
+                                                             const ossimDpt& lr)
+{
+   theUlEastingNorthing = ul;
+   theLrEastingNorthing = lr;
+
+   transformVertices();
+}
+
+ossimDpt ossimEastingNorthingCutter::getUlEastingNorthing()const
+{
+   return theUlEastingNorthing;
+}
+
+ossimDpt ossimEastingNorthingCutter::getLrEastingNorthing()const
+{
+   return theLrEastingNorthing;
+}
+
+
+void ossimEastingNorthingCutter::initialize()
+{
+   ossimRectangleCutFilter::initialize();
+   transformVertices();
+}
+
+bool ossimEastingNorthingCutter::saveState(ossimKeywordlist& kwl,
+                                           const char* prefix)const
+{
+   kwl.add(prefix,
+           "ul_en",
+           ossimString::toString(theUlEastingNorthing.x) + " " +
+           ossimString::toString(theUlEastingNorthing.y),
+           true);
+   kwl.add(prefix,
+           "lr_en",
+           ossimString::toString(theLrEastingNorthing.x) + " " +
+           ossimString::toString(theLrEastingNorthing.y),
+           true);
+
+   return ossimRectangleCutFilter::saveState(kwl, prefix);
+}
+
+bool ossimEastingNorthingCutter::loadState(const ossimKeywordlist& kwl,
+                                           const char* prefix)
+{
+   const char *ul = kwl.find(prefix,
+                             "ul_en");
+   const char *lr = kwl.find(prefix,
+                             "lr_en");
+
+   theUlEastingNorthing.makeNan();
+   theLrEastingNorthing.makeNan();
+   
+   if(ul)
+   {
+      istringstream in(ul);
+      ossimString x;
+      ossimString y;
+      
+      in >> x >> y;
+      
+      theUlEastingNorthing.x = x.toDouble();
+      theUlEastingNorthing.y = y.toDouble();
+      
+   }
+   
+   if(lr)
+   {
+      istringstream in(lr);
+      ossimString x;
+      ossimString y;
+      
+      in >> x >> y;
+      
+      theLrEastingNorthing.x = x.toDouble();
+      theLrEastingNorthing.y = y.toDouble();
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimEastingNorthingCutter::loadState DEBUG:"
+         << "\ntheUlEastingNorthing:  " << theUlEastingNorthing
+         << "\ntheLrEastingNorthing:  " << theLrEastingNorthing
+         << endl;
+   }
+
+   return ossimRectangleCutFilter::loadState(kwl, prefix);
+}
+
+bool ossimEastingNorthingCutter::setView(ossimObject* baseObject)
+{
+   ossimProjection* tempProj = PTR_CAST(ossimProjection,
+                                        baseObject);
+   if(!tempProj)
+   {
+      return false;
+   }
+   
+
+   theViewProjection = tempProj;
+
+   transformVertices();
+
+   return true;
+}
+
+ossimObject* ossimEastingNorthingCutter::getView()
+{
+   return theViewProjection.get();
+}
+
+const ossimObject* ossimEastingNorthingCutter::getView()const
+{
+   return theViewProjection.get();
+}
+
+void ossimEastingNorthingCutter::transformVertices()
+{
+   theRectangle.makeNan();
+
+   if(theUlEastingNorthing.hasNans()||
+      theLrEastingNorthing.hasNans()||
+      (!theViewProjection))
+   {
+      return;
+   }
+
+   ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection,
+                                          theViewProjection.get());
+   ossimDpt ul;
+   ossimDpt lr;
+   ossimDpt easting;
+   ossimDpt northing;
+   if(mapProj)
+   {
+      mapProj->eastingNorthingToLineSample(theUlEastingNorthing, ul);
+      mapProj->eastingNorthingToLineSample(theLrEastingNorthing, lr);
+
+      ossimDrect drect(ul.x, ul.y, lr.x, lr.y);
+
+      theRectangle = drect;
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimEastingNorthingCutter::transformVertices DEBUG:"
+            << "original drect:  " << drect
+            << "\ntheRectangle:  " << theRectangle
+            << endl;
+      }
+   }
+}
diff --git a/src/imaging/ossimEdgeFilter.cpp b/src/imaging/ossimEdgeFilter.cpp
new file mode 100644
index 0000000..6e598da
--- /dev/null
+++ b/src/imaging/ossimEdgeFilter.cpp
@@ -0,0 +1,720 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimEdgeFilter.cpp 19956 2011-08-16 00:36:25Z gpotts $
+#include <ossim/imaging/ossimEdgeFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimStringProperty.h>
+
+RTTI_DEF1(ossimEdgeFilter, "ossimEdgeFilter", ossimImageSourceFilter);
+
+#define PROP_EDGE_FILTER "Edge type"
+
+ossimEdgeFilter::ossimEdgeFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theTile(NULL),
+    theFilterType("Sobel")
+{
+}
+
+ossimEdgeFilter::ossimEdgeFilter(ossimImageSource* inputSource)
+   :ossimImageSourceFilter(inputSource),
+    theTile(NULL),
+    theFilterType("Sobel")
+{
+}
+
+ossimEdgeFilter::ossimEdgeFilter(ossimObject* owner,
+                                   ossimImageSource* inputSource)
+   :ossimImageSourceFilter(owner, inputSource),
+    theTile(NULL),
+    theFilterType("Sobel")
+{
+}
+
+ossimRefPtr<ossimImageData> ossimEdgeFilter::getTile(const ossimIrect& rect,
+                                                     ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getTile(rect, resLevel);
+   }
+
+   // expand the rect out to cver the 3x3 horizontal and vertical
+   // kernel.
+   //
+   ossimIrect requestRect = rect;
+
+   adjustRequestRect(requestRect);
+   
+   ossimRefPtr<ossimImageData> inputData =
+      ossimImageSourceFilter::getTile(requestRect, resLevel);
+
+   if(!inputData.valid() || (!inputData->getBuf()))
+   {
+      return inputData;
+   }
+
+   if(!theTile.valid()) initialize();
+   if(!theTile.valid()) return theTile;
+      
+   theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
+   
+   switch(theTile->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      runFilter((ossim_uint8)0,
+                inputData);
+      break;
+   }
+   case OSSIM_FLOAT:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      runFilter((ossim_float32)0,
+                inputData);
+      break;
+   }
+   case OSSIM_USHORT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      runFilter((ossim_uint16)0,
+                inputData);
+      break;
+   }
+   case OSSIM_SSHORT16:
+   {
+      runFilter((ossim_sint16)0,
+                inputData);
+      break;
+   }
+   case OSSIM_DOUBLE:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      runFilter((ossim_float64)0,
+                inputData);
+      break;
+   }
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimEdgeFilter::getTile WARN: Scalar type = " << theTile->getScalarType()
+                                         << " Not supported by ossimEdgeFilter" << std::endl;
+      break;
+   }
+   }
+
+   return theTile;
+}
+
+void ossimEdgeFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   theTile = NULL;
+
+   if(!isSourceEnabled())
+   {
+      return;
+   }
+   
+   theTile = ossimImageDataFactory::instance()->create(this, this);
+   if(theTile.valid())
+   {
+      theTile->initialize();
+   }
+
+}
+
+
+void ossimEdgeFilter::getFilterTypeNames(
+   std::vector<ossimString>& filterNames)const
+{
+   filterNames.push_back("Laplacian");
+   filterNames.push_back("Prewitt");
+   filterNames.push_back("Roberts");
+   filterNames.push_back("Simple");
+   filterNames.push_back("Sobel");
+   filterNames.push_back("LocalMax8");
+}
+
+ossimString ossimEdgeFilter::getFilterType()const
+{
+   return theFilterType;
+}
+
+void ossimEdgeFilter::setFilterType(const ossimString& filterType)
+{
+   ossimString tempFilterType = filterType;
+   tempFilterType = tempFilterType.downcase();
+   
+   if(tempFilterType.contains("sob"))
+   {
+      theFilterType = "Sobel";
+   }
+   else if(tempFilterType.contains("lap"))
+   {
+      theFilterType = "Laplacian";
+   }
+   else if(tempFilterType.contains("prew"))
+   {
+      theFilterType = "Prewitt";
+   }
+   else if(tempFilterType.contains("rob"))
+   {
+      theFilterType = "Roberts";
+   }
+   else if(tempFilterType.contains("sim"))
+   {
+      theFilterType = "Simple";
+   }
+   else if(tempFilterType.contains("localmax"))
+   {
+      theFilterType = "LocalMax8";
+   }
+   else
+   {
+      theFilterType = "Sobel";
+   }
+}
+
+void ossimEdgeFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+   
+   if(property->getName() == PROP_EDGE_FILTER)
+   {
+      theFilterType = property->valueToString();
+   }
+   else 
+   {
+      ossimImageSourceFilter::setProperty(property.get());
+   }
+
+}
+
+ossimRefPtr<ossimProperty> ossimEdgeFilter::getProperty(const ossimString& name)const
+{
+   if(name == PROP_EDGE_FILTER)
+   {
+      std::vector<ossimString> filterNames;
+      
+      getFilterTypeNames(filterNames);
+      ossimStringProperty* stringProp = new ossimStringProperty(PROP_EDGE_FILTER,
+								theFilterType,
+								false,
+								filterNames);
+      stringProp->clearChangeType();
+      stringProp->setReadOnlyFlag(false);
+      stringProp->setCacheRefreshBit();
+
+      return stringProp;
+   }
+
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimEdgeFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   
+   propertyNames.push_back(PROP_EDGE_FILTER);
+}
+
+
+void ossimEdgeFilter::adjustRequestRect(ossimIrect& requestRect)const
+{
+   ossimString filterType = theFilterType;
+   filterType = filterType.downcase();
+   ossimIrect rect = requestRect;
+   if(filterType.contains("sob")||
+      filterType.contains("lap")||
+      filterType.contains("pre")||
+      filterType.contains("localmax"))
+   {
+      requestRect = ossimIrect(rect.ul().x - 1,
+                               rect.ul().y - 1,
+                               rect.lr().x + 1,
+                               rect.lr().y + 1);
+   }
+   else if (filterType.contains("rob") || filterType.contains("sim"))
+   {
+      requestRect = ossimIrect(rect.ul().x,
+                               rect.ul().y,
+                               rect.lr().x + 1,
+                               rect.lr().y + 1);
+   }
+   else
+   {
+      requestRect = ossimIrect(rect.ul().x - 1,
+                               rect.ul().y - 1,
+                               rect.lr().x + 1,
+                               rect.lr().y + 1);
+   }
+}
+
+template <class T>
+void ossimEdgeFilter::runFilter(T dummyVariable,
+                                ossimRefPtr<ossimImageData> inputData)
+{
+   ossimString filterType = theFilterType;
+   filterType = filterType.downcase();
+   
+   if(filterType.contains("sobel"))
+   {
+      runSobelFilter(dummyVariable, inputData);
+   }
+   else if(filterType.contains("lap"))
+   {
+      runLaplacianFilter(dummyVariable, inputData);
+   }
+   else if(filterType.contains("pre"))
+   {
+      runPrewittFilter(dummyVariable, inputData);
+   }
+   else if(filterType.contains("rob"))
+   {
+      runRobertsFilter(dummyVariable, inputData);
+   }
+   else if(filterType.contains("sim"))
+   {
+      runSimpleFilter(dummyVariable, inputData);
+   }
+   else if(filterType.contains("localmax"))
+   {
+      runLocalMax8Filter(dummyVariable, inputData);
+   }
+   else 
+   {
+      theTile->makeBlank();
+   }
+}
+
+template <class T>
+void ossimEdgeFilter::runSobelFilter(T /* dummyVariable */,
+                                     ossimRefPtr<ossimImageData> inputData)
+{
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   double horizontalValue = 0.0;
+   double verticalValue = 0.0;
+   double value = 0.0;
+   // ossim_uint32 valueIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 width  = theTile->getWidth();
+   ossim_uint32 height = theTile->getHeight();
+   ossim_int32 rowIncrement  = inputData->getWidth();
+   ossim_int32 rowIncrement2 = 2*inputData->getWidth();
+   
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
+      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
+      T np         = static_cast<T>(inputData->getNullPix(bandIdx));
+      T minP       = static_cast<T>(inputData->getMinPix(bandIdx));
+      T maxP       = static_cast<T>(inputData->getMaxPix(bandIdx));
+
+      if(inputBuf&&outputBuf)
+      {
+         for(y = 0; y < height; ++y)
+         {
+            for(x = 0; x < width; ++x)
+            {
+               if( (*(inputBuf + rowIncrement + 1) != np))
+               {
+                  horizontalValue = ((double)inputBuf[0] - (double)inputBuf[rowIncrement2]) +
+                                    ((double)(inputBuf[1]*2.0) - (double)( inputBuf[rowIncrement2+1]*2.0)) +
+                                    ((double)(inputBuf[2]) - (double)(inputBuf[rowIncrement2+2]));
+
+                   verticalValue   = ((double)(inputBuf[2]) + (double)inputBuf[rowIncrement+2]*2.0 + (double)inputBuf[rowIncrement2+2]) -
+                                     (double)(inputBuf[0] + 2.0*(double)inputBuf[rowIncrement] + (double)inputBuf[rowIncrement2]);
+                  
+                  value = sqrt(horizontalValue*horizontalValue +  verticalValue*verticalValue);
+
+                  if((value == np) ||
+                     (value < minP))
+                  {
+                     *outputBuf = (static_cast<T>(minP));
+                  }
+                  else if(value > maxP)
+                  {
+                     *outputBuf = (static_cast<T>(maxP));
+                  }
+                  else
+                  {
+                     *outputBuf = (static_cast<T>(value));
+                  }
+                  
+               }
+               else
+               {
+                  *outputBuf = np;
+               }
+               ++outputBuf;
+               ++inputBuf;
+            }
+            inputBuf+=2;
+         }
+      }
+   }
+   theTile->validate();
+}
+
+template <class T>
+void ossimEdgeFilter::runPrewittFilter(T /* dummyVariable */,
+                                       ossimRefPtr<ossimImageData> inputData)
+{
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   double horizontalValue = 0.0;
+   double verticalValue = 0.0;
+   double value = 0.0;
+   // ossim_uint32 valueIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 width  = theTile->getWidth();
+   ossim_uint32 height = theTile->getHeight();
+   ossim_int32 rowIncrement  = inputData->getWidth();
+   ossim_int32 rowIncrement2 = 2*inputData->getWidth();
+   
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
+      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
+      T np         = static_cast<T>(inputData->getNullPix(bandIdx));
+      T minP       = static_cast<T>(inputData->getMinPix(bandIdx));
+      T maxP       = static_cast<T>(inputData->getMaxPix(bandIdx));
+
+      if(inputBuf&&outputBuf)
+      {
+         for(y = 0; y < height; ++y)
+         {
+            for(x = 0; x < width; ++x)
+            {
+               if( (*(inputBuf + rowIncrement + 1) != np))
+               {
+                  horizontalValue = ((double)inputBuf[0] - (double)inputBuf[rowIncrement2]) +
+                                    ((double)(inputBuf[1]) - (double)( inputBuf[rowIncrement2+1])) +
+                                    ((double)(inputBuf[2]) - (double)(inputBuf[rowIncrement2+2]));
+
+                   verticalValue   = ((double)(inputBuf[2]) + (double)inputBuf[rowIncrement+2] + (double)inputBuf[rowIncrement2+2]) -
+                                     ((double)inputBuf[0] + (double)inputBuf[rowIncrement] + (double)inputBuf[rowIncrement2]);
+                  
+                  value = sqrt(horizontalValue*horizontalValue +  verticalValue*verticalValue);
+
+                  if((value == np) ||
+                     (value < minP))
+                  {
+                     *outputBuf = (static_cast<T>(minP));
+                  }
+                  else if(value > maxP)
+                  {
+                     *outputBuf = (static_cast<T>(maxP));
+                  }
+                  else
+                  {
+                     *outputBuf = (static_cast<T>(value));
+                  }
+                  
+               }
+               else
+               {
+                  *outputBuf = np;
+               }
+               ++outputBuf;
+               ++inputBuf;
+            }
+            inputBuf+=2;
+         }
+      }
+   }
+   theTile->validate();
+}
+
+template <class T>
+void ossimEdgeFilter::runRobertsFilter(T /* dummyVariable */,
+                                       ossimRefPtr<ossimImageData> inputData)
+{
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   double v1 = 0.0;
+   double v2 = 0.0;
+   double value = 0.0;
+   // ossim_uint32 valueIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 width  = theTile->getWidth();
+   ossim_uint32 height = theTile->getHeight();
+   ossim_int32 rowIncrement  = inputData->getWidth();
+   
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
+      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
+      T np         = static_cast<T>(inputData->getNullPix(bandIdx));
+      T minP       = static_cast<T>(inputData->getMinPix(bandIdx));
+      T maxP       = static_cast<T>(inputData->getMaxPix(bandIdx));
+
+      if(inputBuf&&outputBuf)
+      {
+         for(y = 0; y < height; ++y)
+         {
+            for(x = 0; x < width; ++x)
+            {
+               if( (*inputBuf) != np)
+               {
+                  v1 = (double)inputBuf[0] - (double)(inputBuf[rowIncrement+1]);
+                  v1 = (double)inputBuf[0] - (double)(inputBuf[1]);
+
+                  v2   = (double)inputBuf[1] - (double)inputBuf[rowIncrement];
+                  v2   = (double)inputBuf[0] - (double)inputBuf[rowIncrement];
+
+                  value = sqrt(v1*v1 +  v2*v2);
+
+                  if((value == np) ||
+                     (value < minP))
+                  {
+                     *outputBuf = (static_cast<T>(minP));
+                  }
+                  else if(value > maxP)
+                  {
+                     *outputBuf = (static_cast<T>(maxP));
+                  }
+                  else
+                  {
+                     *outputBuf = (static_cast<T>(value));
+                  }
+
+               }
+               else
+               {
+                  *outputBuf = np;
+               }
+               ++outputBuf;
+               ++inputBuf;
+            }
+            ++inputBuf;
+         }
+      }
+   }
+   theTile->validate();
+}
+
+template <class T>
+void ossimEdgeFilter::runSimpleFilter(T /* dummyVariable */, ossimRefPtr<ossimImageData> inputData)
+{
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   double v1 = 0.0;
+   double v2 = 0.0;
+   double value = 0.0;
+   // ossim_uint32 valueIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 width  = theTile->getWidth();
+   ossim_uint32 height = theTile->getHeight();
+   ossim_int32 rowIncrement  = inputData->getWidth();
+
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
+      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
+      T np         = static_cast<T>(inputData->getNullPix(bandIdx));
+      T minP       = static_cast<T>(inputData->getMinPix(bandIdx));
+      T maxP       = static_cast<T>(inputData->getMaxPix(bandIdx));
+
+      if(inputBuf&&outputBuf)
+      {
+         for(y = 0; y < height; ++y)
+         {
+            for(x = 0; x < width; ++x)
+            {
+               if( (*inputBuf) != np)
+               {
+                  v1 = (double)inputBuf[0] - (double)(inputBuf[1]);
+                  v2   = (double)inputBuf[0] - (double)inputBuf[rowIncrement];
+                  value = sqrt(v1*v1 +  v2*v2);
+
+                  if((value == np) || (value < minP))
+                     *outputBuf = (static_cast<T>(minP));
+                  else if(value > maxP)
+                     *outputBuf = (static_cast<T>(maxP));
+                  else
+                     *outputBuf = (static_cast<T>(value));
+               }
+               else
+               {
+                  *outputBuf = np;
+               }
+               ++outputBuf;
+               ++inputBuf;
+            }
+            ++inputBuf;
+         }
+      }
+   }
+   theTile->validate();
+}
+
+template <class T>
+void ossimEdgeFilter::runLaplacianFilter(T /* dummyVariable */,
+                                         ossimRefPtr<ossimImageData> inputData)
+{
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+   // double horizontalValue = 0.0;
+   // double verticalValue = 0.0;
+   double value = 0.0;
+   // ossim_uint32 valueIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 width  = theTile->getWidth();
+   ossim_uint32 height = theTile->getHeight();
+   ossim_int32 rowIncrement  = inputData->getWidth();
+   ossim_int32 rowIncrement2 = 2*inputData->getWidth();
+   
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
+      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
+      T np         = static_cast<T>(inputData->getNullPix(bandIdx));
+      T minP       = static_cast<T>(inputData->getMinPix(bandIdx));
+      T maxP       = static_cast<T>(inputData->getMaxPix(bandIdx));
+
+      if(inputBuf&&outputBuf)
+      {
+         for(y = 0; y < height; ++y)
+         {
+            for(x = 0; x < width; ++x)
+            {
+               if( (*(inputBuf + rowIncrement + 1) != np))
+               {
+                  
+                  value = fabs(((double)inputBuf[rowIncrement + 1]*4.0) -
+                               ((double)inputBuf[1] + (double)inputBuf[rowIncrement] + (double)inputBuf[rowIncrement + 2] + (double)inputBuf[rowIncrement2+1]));
+
+                  if((value == np) ||
+                     (value < minP))
+                  {
+                     *outputBuf = (static_cast<T>(minP));
+                  }
+                  else if(value > maxP)
+                  {
+                     *outputBuf = (static_cast<T>(maxP));
+                  }
+                  else
+                  {
+                     *outputBuf = (static_cast<T>(value));
+                  }
+                  
+               }
+               else
+               {
+                  *outputBuf = np;
+               }
+               ++outputBuf;
+               ++inputBuf;
+            }
+            inputBuf+=2;
+         }
+      }
+   }
+   theTile->validate();
+}
+
+template <class T>
+void ossimEdgeFilter::runLocalMax8Filter(T /* dummyVariable */,
+                                         ossimRefPtr<ossimImageData> inputData)
+{
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 numberOfBands = inputData->getNumberOfBands();
+  
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 width  = theTile->getWidth();
+   ossim_uint32 height = theTile->getHeight();
+   ossim_int32 rowIncrement  = inputData->getWidth();
+   ossim_int32 rowIncrement2 = 2*inputData->getWidth(); 
+         
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      //inputBuf has a 1 pixel edge compared to outputBuf
+      T* inputBuf  = static_cast<T*>(inputData->getBuf(bandIdx));
+      T* outputBuf = static_cast<T*>(theTile->getBuf(bandIdx));
+      T np         = static_cast<T>(inputData->getNullPix(bandIdx)); //changed to input Null            
+
+      if(inputBuf&&outputBuf)
+      {
+         //one pass: maybe faster if changed to two passes
+         T* outB;
+         T* inB;
+         
+      	outB = outputBuf;         
+         inB  = inputBuf;         
+         for(y = 0; y < height; ++y)
+         {
+            for(x = 0; x < width; ++x)
+            {
+               if (inB[1+rowIncrement] != np)
+               {
+                  *outB = max<T>(
+                           max<T>(
+                            max<T>(inB[0],inB[1]),
+                            max<T>(inB[2],inB[rowIncrement])),
+                           max<T>(
+                            max<T>(inB[rowIncrement+2],inB[rowIncrement2]),
+                            max<T>(inB[rowIncrement2+1],inB[rowIncrement2+2])
+                            ));
+               }
+               else
+               {
+                  *outB = np;
+               }
+               ++outB;
+               ++inB;
+            }
+            inB+=2; //go to next line, jump due to edge
+         }       
+      }      
+   }
+   theTile->validate();
+}
+
+bool ossimEdgeFilter::saveState(ossimKeywordlist& kwl,
+                                          const char* prefix)const
+{   
+   kwl.add(prefix,
+           PROP_EDGE_FILTER,
+           getFilterType(),
+           true);
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+
+bool ossimEdgeFilter::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   const char* value = kwl.find(prefix,
+                                PROP_EDGE_FILTER );
+   if(value)
+   {
+      setFilterType(ossimString(value));
+   } else {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimEdgeFilter::loadState WARN: no filter type found" << std::endl;
+   }
+         
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
diff --git a/src/imaging/ossimElevImageSource.cpp b/src/imaging/ossimElevImageSource.cpp
new file mode 100644
index 0000000..2be5c1a
--- /dev/null
+++ b/src/imaging/ossimElevImageSource.cpp
@@ -0,0 +1,821 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  Class provides an elevation image source from the elevation
+// manager.
+// 
+//*******************************************************************
+//  $Id: ossimElevImageSource.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimElevImageSource.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/projection/ossimLlxyProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ctime>
+
+RTTI_DEF1(ossimElevImageSource, "ossimElevImageSource", ossimImageSource)
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimElevImage:debug");
+   
+ossimElevImageSource::ossimElevImageSource()
+   :
+      ossimImageSource(NULL,
+                       0,
+                       0,
+                       true,
+                       false),// output list is not fixed
+      theElevManager(NULL),
+      theTile(NULL),
+      theTiePoint(),
+      theLatSpacing(0.0),
+      theLonSpacing(0.0),
+      theNumberOfLines(0),
+      theNumberOfSamps(0)
+{}
+
+ossimElevImageSource::ossimElevImageSource(ossimObject* owner)
+   :
+      ossimImageSource(owner,
+                       0,
+                       0,
+                       true,
+                       false),// output list is not fixed
+      theElevManager(NULL),
+      theTile(NULL),
+      theTiePoint(),
+      theLatSpacing(0.0),
+      theLonSpacing(0.0),
+      theNumberOfLines(0),
+      theNumberOfSamps(0)
+{}
+
+ossimElevImageSource::ossimElevImageSource(ossimObject* owner,
+                                           const ossimGpt& tie,
+                                           double latSpacing,
+                                           double lonSpacing,
+                                           ossim_uint32 numberLines,
+                                           ossim_uint32 numberSamples)
+   :
+      ossimImageSource(owner,
+                       0,
+                       0,
+                       true,
+                       false),// output list is not fixed
+      theElevManager(NULL),
+      theTile(NULL),
+      theTiePoint(tie),
+      theLatSpacing(latSpacing),
+      theLonSpacing(lonSpacing),
+      theNumberOfLines(numberLines),
+      theNumberOfSamps(numberSamples)
+{
+   initialize();
+}
+
+ossimElevImageSource::ossimElevImageSource(ossimObject* owner,
+                                           const ossimKeywordlist& kwl,
+                                           const char* prefix)
+   :
+      ossimImageSource(owner,
+                       0,
+                       0,
+                       true,
+                       false),
+      theElevManager(NULL),
+      theTile(NULL),
+      theTiePoint(),
+      theLatSpacing(0),
+      theLonSpacing(0),
+      theNumberOfLines(0),
+      theNumberOfSamps(0)
+{
+   if (loadState(kwl, prefix) == false)
+   {
+      setErrorStatus();
+   }
+}
+
+ossimElevImageSource::~ossimElevImageSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimElevImageSource::getTile(
+   const  ossimIrect& tile_rect,
+   ossim_uint32 resLevel)
+{
+   if (!theTile.get())
+   {
+      return theTile;
+   }
+   
+   // First make sure our tile is the right size.
+   ossim_int32 w = tile_rect.width();
+   ossim_int32 h = tile_rect.height();
+   ossim_int32 tileW = theTile->getWidth();
+   ossim_int32 tileH = theTile->getHeight();
+   if( (w != tileW) || (h != tileH) )
+   {
+      theTile->setWidth(w);
+      theTile->setHeight(h);
+      if((w*h)!=(tileW*tileH))
+      {
+         theTile->initialize();
+
+         //***
+         // Initialize can reset the min max to defaults if the min happens
+         // to be "0" so reset it just in case.
+         // NOTE:  We need to fix initialize!
+         //***
+         theTile->setMinPix(theElevManager->getMinHeightAboveMSL(), 0);
+         theTile->setMaxPix(theElevManager->getMaxHeightAboveMSL(), 0);
+      }
+   }
+
+   // Set the origin.
+   theTile->setOrigin(tile_rect.ul());
+      
+   
+   if(!isSourceEnabled())
+   {
+      // This tile source bypassed.
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   //***
+   // No overview support yet...
+   //***
+   if (resLevel)
+   {
+      // NOTE:  Need to add overview support.
+      cerr << "ossimElevImageSource::getTile ERROR:\nOverviews not supported!"
+           << endl;
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   ossimIrect image_rect = getImageRectangle(0);
+
+   if ( !tile_rect.intersects(image_rect) )
+   {
+      // No point in the tile falls within the set boundaries of this source.
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   // Ok fill the tile with the data from the post...
+   ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
+
+   if ( !tile_rect.completely_within(clip_rect) )
+   {
+      // Start with a blank tile since it won't be filled all the way.
+      theTile->makeBlank();
+   }
+
+
+   // Move the buffer pointer to the first valid pixel.
+   ossim_uint32 tile_width = theTile->getWidth();
+   
+   ossim_int32 start_offset = (clip_rect.lr().y - tile_rect.ul().y) * tile_width +
+      clip_rect.ul().x - tile_rect.ul().x;
+
+   //***
+   // Since most elevation formats have posts organized positive line up,
+   // start at the lower left side of the cell so all reads are going
+   // forward in the file.
+   //***
+   double start_lat = theTiePoint.latd() - theLatSpacing *
+      (clip_rect.lr().y - image_rect.ul().y);
+   if (start_lat < -90.0)
+   {
+      start_lat = -(start_lat + 180.0);  // Wrapped around the south poll.
+   }
+
+   double lon = theTiePoint.lond() + theLonSpacing *
+      (clip_rect.ul().x  - image_rect.ul().x);
+   if (lon > 180.0)
+   {
+      lon -= 360.0; // Went across the central meridian.
+   }
+
+   // Copy the data.
+   ossim_uint32 clipHeight = clip_rect.height();
+   ossim_uint32 clipWidth  = clip_rect.width();
+
+   // Get a pointer to the tile buffer.
+   ossim_float32* buf = static_cast<ossim_float32*>(theTile->getBuf());
+
+   for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+   {
+      double lat = start_lat;
+      ossim_int32 offset = start_offset;
+      for (ossim_uint32 line = 0; line < clipHeight; ++line)
+      {
+         ossimGpt gpt(lat, lon);
+         buf[offset+sample] = theElevManager->getHeightAboveMSL(gpt);
+         
+         lat += theLatSpacing;
+         if (lat > 90) lat = 180.0 - lat;
+
+         offset -= tile_width;
+      }
+      
+      lon += theLonSpacing;
+      if (lon > 180.0) lon = lon - 360.0; // Went across the central meridian.
+   }
+   
+#if 0   
+   for (ossim_uint32 line = 0; line < clipHeight; ++line)
+   {
+      double lon = start_lon;
+      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+      {
+         ossimGpt gpt(lat, lon);
+         buf[sample] = theElevManager->getHeightAboveMSL(gpt);
+         lon += theLonSpacing;
+         if (start_lon > 180.0)
+         {
+            start_lon -= 360.0; // Went across the central meridian.
+         }
+      }
+
+      buf += tile_width;
+      lat -= theLatSpacing;
+      if (lat < -90.0) lat = -(lat + 180.0);// Wrapped around the south poll.
+   }
+#endif
+   
+   theTile->validate();
+   return theTile;
+}
+
+bool ossimElevImageSource::saveState(ossimKeywordlist& kwl,
+                                  const char* prefix) const
+{
+   static const char MODULE[] = "ossimElevImageSource::saveState";
+
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      cerr << MODULE
+           << " ERROR detected in keyword list!  State not saved."
+           << endl;
+      return false;
+   }
+
+   // Save the state of the base class.
+   ossimImageSource::saveState(kwl, prefix);
+
+   // Save the tie point.
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LAT_KW,
+           theTiePoint.latd(),
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LON_KW,
+           theTiePoint.lond(),
+           true);
+
+   // Save the post spacing.
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+           theLatSpacing,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+           theLonSpacing,
+           true);
+
+   // Save the image size
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_LINES_KW,
+           theNumberOfLines,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_SAMPLES_KW,
+           theNumberOfSamps,
+           true);
+
+   // Save the min / max pixel values.
+   kwl.add(prefix,
+           ossimKeywordNames::MIN_VALUE_KW,
+           getMinPixelValue(0),
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::MAX_VALUE_KW,
+           getMaxPixelValue(0),
+           true);
+
+   return true;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimElevImageSource::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   static const char MODULE[] = "ossimElevImageSource::loadState";
+
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      cerr << MODULE
+           << " ERROR detected in keyword list!  State not load."
+           << endl;
+      return false;
+   }
+
+   // Base class...
+   ossimImageSource::loadState(kwl, prefix);
+   
+   const char* lookup;
+
+   // Get the tie point.
+   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LAT_KW);
+   if (lookup)
+   {
+      theTiePoint.latd(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nRequired keyword not found:  "
+              << ossimKeywordNames::TIE_POINT_LAT_KW
+              << "\nReturning false"
+              << endl;
+      }
+
+      return false;
+   }
+   
+   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LON_KW);
+   if (lookup)
+   {
+      theTiePoint.lond(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nRequired keyword not found:  "
+              << ossimKeywordNames::TIE_POINT_LON_KW
+              << "\nReturning false"
+              << endl;
+      }
+
+      return false;
+   }
+
+   // Get the post spacing.
+   lookup = kwl.find(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT);
+   if (lookup)
+   {
+      theLatSpacing = ossimString(lookup).toDouble();
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nRequired keyword not found:  "
+              << ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT
+              << "\nReturning false"
+              << endl;
+      }
+
+      return false;
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON);
+   if (lookup)
+   {
+      theLonSpacing = ossimString(lookup).toDouble();
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nRequired keyword not found:  "
+              << ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON
+              << "\nReturning false"
+              << endl;
+      }
+
+      return false;
+   }
+
+   // Get the image size.
+   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_LINES_KW);
+   if (lookup)
+   {
+      theNumberOfLines = ossimString(lookup).toULong();
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nRequired keyword not found:  "
+              << ossimKeywordNames::NUMBER_LINES_KW
+              << "\nReturning false"
+              << endl;
+      }
+
+      return false;
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_SAMPLES_KW);
+   if (lookup)
+   {
+      theNumberOfSamps = ossimString(lookup).toULong();
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nRequired keyword not found:  "
+              << ossimKeywordNames::NUMBER_SAMPLES_KW
+              << "\nReturning false"
+              << endl;
+      }
+
+      return false;
+   }
+
+   initialize();
+
+   //***
+   // See if the min / max keyword was set and reset it.
+   // Note this must be done after initialize since it sets the min / max from
+   // the elevation manager.
+   //***
+   lookup = kwl.find(prefix, ossimKeywordNames::MIN_VALUE_KW);
+   if (lookup)
+   {
+      setMinPixelValue(ossimString(lookup).toDouble());
+   }
+   lookup = kwl.find(prefix, ossimKeywordNames::MAX_VALUE_KW);
+   if (lookup)
+   {
+      setMaxPixelValue(ossimString(lookup).toDouble());
+   }
+
+   if (getErrorStatus() != ossimErrorCodes::OSSIM_OK)
+   {
+      return false;
+   }
+
+   //***
+   // Reset the base class to have a fixed input list of "0" size.
+   // Note:  To not do this will result in a core dump destroying objects
+   // connected to this output.
+   //***
+   theInputObjectList.clear();
+   theInputListIsFixedFlag = true;
+   theOutputListIsFixedFlag = false;
+  
+   return true;
+}
+
+void ossimElevImageSource::initialize()
+{
+   static const char MODULE[] = "ossimElevImageSource::initialize";
+   
+   if (traceDebug()) CLOG << " Entered..." << endl;
+   
+   //***
+   // First see if the manager pointer has been captured.
+   //***
+   if (!theElevManager) theElevManager = ossimElevManager::instance();
+
+   if (!theElevManager)
+   {
+      setErrorStatus();
+      cerr << MODULE << "ERROR:\nNULL elevation manager pointer!"
+           << "\nObject not initialized!" << endl;
+      return;
+   }
+
+   // Basic sanity checks.
+   if (!theLatSpacing || !theLonSpacing ||
+       !theNumberOfLines || !theNumberOfSamps)
+   {
+      setErrorStatus();
+      cerr << MODULE << "ERROR:"
+           << "\nMust set latitude/longitude spacing and number of line and"
+           << " samples."
+           << "Object not initialized!" << endl;
+      return;
+      
+   }
+
+   // Check the ground point.
+   if ( theTiePoint.latd() > 90.0  || theTiePoint.latd() < -90.0  ||
+        theTiePoint.lond() > 180.0 || theTiePoint.lond() < -180.0 )
+   {
+      setErrorStatus();
+      cerr << MODULE << "ERROR:\nBogus tie point."
+           << "\nObject not initialized!" << endl;
+      return;
+   }
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nTie point:  " << theTiePoint
+           << "\nLatitude spacing:  " << theLatSpacing
+           << "\nLongitude spacing:  " << theLonSpacing
+           << "\nLines:              " << theNumberOfLines
+           << "\nSamples:            " << theNumberOfSamps
+           << endl;
+   }
+   
+   //***
+   // Since this will return float data we need to set the min / max values
+   // of the data so that anybody who remaps it to eight bit will do it
+   // properly.  So scan the entire image rectangle using the manager.
+   // This will do two things, force the elevation manager to load all the
+   // cells, and at the same time the min / max elevation value will be set.
+   // NOTE:
+   // ??? Should the elevation manager clear the list of sources prior to
+   // the code segment so that the min / max is only from the cells we
+   // need!
+   //***
+
+   cout << "Initializing elevation manager..." << endl;
+
+#if 0
+   // Loop in the longitude or sample direction.
+   time_t start_t = time(NULL);
+   double lon = theTiePoint.lond();
+   for (ossim_uint32 samp = 0; samp < theNumberOfSamps; ++samp)
+   {
+      double lat = theTiePoint.latd() - theLatSpacing * (theNumberOfLines - 1);
+      if (lat < -90.0) lat = -(lat + 180.0); // Wrapped around the south poll.
+      
+      for (ossim_uint32 line = 0; line < theNumberOfLines; ++line)
+      {
+         ossimGpt gpt(lat, lon);
+         theElevManager->getHeightAboveMSL(gpt);
+
+         lat += theLatSpacing;
+         if (lat > 90) lat = 180 - lat; // Went across poll.
+      }
+      
+      lon += theLonSpacing;
+      if (lon > 180.0) lon -= 360.0; // Went across the central meridian.
+   }
+   time_t stop_t = time(NULL);
+   cout << "Finished loop two..." << endl;
+   cout << "Elapsed time for loop two:  " << (stop_t - start_t) << endl;
+#endif
+   
+   theTile = new ossimImageData(this,
+                                OSSIM_FLOAT);
+   theTile->initialize();
+
+   // Set the min / max for any normalization down the chain...
+   theTile->setMinPix(theElevManager->getMinHeightAboveMSL(), 0);
+   theTile->setMaxPix(theElevManager->getMaxHeightAboveMSL(), 0);
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nMin pix:            " << theTile->getMinPix(0)
+           << "\nMax pix:            " << theTile->getMaxPix(0)
+           << endl;
+   }
+}
+
+ossimIrect ossimElevImageSource::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   ossimIrect result(0, 0, theNumberOfSamps-1, theNumberOfLines-1);
+   
+   if (reduced_res_level != 0)
+   {
+      cerr << "ossimElevImageSource::getImageRectangle ERROR:"
+           << "\nOnly R0 is supported." << endl;
+   }
+
+   return result;
+}
+
+bool ossimElevImageSource::getImageGeometry(ossimKeywordlist& kwl,
+                                            const char* prefix)
+{
+   // Save off the image dimensions.
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_LINES_KW,
+           theNumberOfLines,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_SAMPLES_KW,
+           theNumberOfLines,
+           true);
+
+   // Save off the projection info (tie and post spacing).
+   ossimLlxyProjection proj(theTiePoint, theLatSpacing, theLonSpacing);
+   return proj.saveState(kwl, prefix);
+}
+
+void ossimElevImageSource::getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const
+{
+   if (resLevel)
+   {
+      cerr << "ossimElevImageSource::getDecimationFactor ERROR:"
+           << "\nReduced res sets currently not supported!"
+           << endl;
+   }
+
+   result.line = 1.0;
+   result.samp = 1.0;
+}
+
+void ossimElevImageSource::getDecimationFactors(vector<ossimDpt>& decimations) const
+{
+   ossimDpt pt(1.0, 1.0);
+   decimations.clear();
+   decimations.push_back(pt);
+}
+
+ossim_uint32 ossimElevImageSource::getNumberOfDecimationLevels()const
+{
+   return 1;
+}
+
+ossim_uint32 ossimElevImageSource::getNumberOfInputBands() const
+{
+   return 1;
+}
+
+ossimScalarType ossimElevImageSource::getOutputScalarType() const
+{
+   return OSSIM_FLOAT;
+}
+
+ossim_uint32 ossimElevImageSource::getTileWidth() const
+{
+   if (theTile.get()) return theTile->getWidth();
+
+   return 0;
+}
+
+ossim_uint32 ossimElevImageSource::getTileHeight() const
+{
+   if (theTile.get()) return theTile->getHeight();
+
+   return 0;
+}
+
+void ossimElevImageSource::changeTileSize(const ossimIpt& size)
+{
+   if (traceDebug())
+   {
+      cout << "ossimElevImageSource::changeTileSize DEBUG:"
+           << "\nx size:  " << size.x
+           << "\ny size:  " << size.y
+           << endl;
+   }
+
+   if (!theTile)
+   {
+      cerr << "ossimElevImageSource::changeTileSize ERROR:"
+           << "\nObject not initialized!  Returning..." << endl;
+      return;
+   }
+
+   theTile = new ossimImageData(this,
+                                OSSIM_FLOAT,
+                                1,
+                                size.x,
+                                size.y);
+   theTile->initialize();
+   
+   // Set the min / max for any normalization down the chain...
+   theTile->setMinPix(theElevManager->getMinHeightAboveMSL(), 0);
+   theTile->setMaxPix(theElevManager->getMaxHeightAboveMSL(), 0);
+}
+
+ossim_uint32 ossimElevImageSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level)
+   {
+      cerr << "ossimElevImageSource::getNumberOfLines ERROR:"
+           << "\nReduced res sets currently not supported!"
+           << endl;
+      return 0;
+   }
+
+   return theNumberOfLines;
+}
+
+ossim_uint32 ossimElevImageSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level)
+   {
+      cerr << "ossimElevImageSource::getNumberOfSamples ERROR:"
+           << "\nReduced res sets currently not supported!"
+           << endl;
+      return 0;
+   }
+
+   return theNumberOfSamps;
+}
+
+double ossimElevImageSource::getMinPixelValue(ossim_uint32 band) const
+{
+   if (band)
+   {
+      cerr << "ossimElevImageSource::getMinPixelValue ERROR:"
+           << "\nReduced res sets currently not supported!"
+           << endl;
+      return 0.0;
+   }
+
+   if (theTile.get())
+   {
+      return theTile->getMinPix(0);
+   }
+   else if (theElevManager)
+   {
+      return theElevManager->getMinHeightAboveMSL();
+   }
+
+   return 0.0;
+}
+
+double ossimElevImageSource::getMaxPixelValue(ossim_uint32 band) const
+{
+   if (band)
+   {
+      cerr << "ossimElevImageSource::getMaxPixelValue ERROR:"
+           << "\nReduced res sets currently not supported!"
+           << endl;
+      return 0.0;
+   }
+
+   if (theTile.get())
+   {
+      return theTile->getMaxPix(0);
+   }
+   else if (theElevManager)
+   {
+      return theElevManager->getMaxHeightAboveMSL();
+   }
+
+   return 0.0;
+}
+
+void ossimElevImageSource::setMinPixelValue(ossim_float64 min_pix)
+{
+   if (theTile.get()) 
+   {
+      theTile->setMinPix(min_pix, 0);
+      if (traceDebug())
+      {
+         cout << "ossimElevImageSource::setMinPixelValue DEBUG:"
+              << "\nMin pixel value:  " << min_pix
+              << endl;
+      }
+   }
+   else
+   {
+      cerr << "ossimElevImageSource::setMinPixelValue ERROR:"
+           << "\nObject not initialized!"
+           << endl;
+   }
+}
+
+void ossimElevImageSource::setMaxPixelValue(ossim_float64 max_pix)
+{
+   if (theTile.get()) 
+   {
+      theTile->setMaxPix(max_pix, 0);
+      if (traceDebug())
+      {
+         cout << "ossimElevImageSource::setMaxPixelValue DEBUG:"
+              << "\nMax pixel value:  " << max_pix
+              << endl;
+      }
+   }
+   else
+   {
+      cerr << "ossimElevImageSource::setMinPixelValue ERROR:"
+           << "\nObject not initialized!"
+           << endl;
+   }
+}      
diff --git a/src/imaging/ossimElevRemapper.cpp b/src/imaging/ossimElevRemapper.cpp
new file mode 100644
index 0000000..34ed42a
--- /dev/null
+++ b/src/imaging/ossimElevRemapper.cpp
@@ -0,0 +1,284 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  RP
+//
+// Description:
+//
+// 
+//*******************************************************************
+//  $Id$
+#include <ossim/imaging/ossimElevRemapper.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/base/ossimTrace.h>
+
+RTTI_DEF1(ossimElevRemapper, "ossimElevRemapper", ossimImageSourceFilter);
+static ossimTrace traceDebug("ossimElevRemapper::debug");
+
+const char ossimElevRemapper::REMAP_MODE_KW[]  = "remap_mode";
+
+ossimElevRemapper::ossimElevRemapper()
+:m_replacementType(ReplacementType_ELLIPSOID)
+{
+}
+
+ossimElevRemapper::~ossimElevRemapper()
+{
+  m_imageGeometry = 0;
+}
+
+void ossimElevRemapper::initialize()
+{
+   if (theInputConnection && (!m_imageGeometry.valid() || !m_imageGeometry->getProjection())) 
+   {
+     m_imageGeometry = theInputConnection->getImageGeometry();
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimElevRemapper::getTile(const ossimIrect& tile_rect,
+                                                        ossim_uint32 resLevel)
+{
+   if (traceDebug())
+   {
+     ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimElevRemapper::getTile entered..." << endl;
+   }
+
+   ossimRefPtr<ossimImageData> result = ossimImageSourceFilter::getTile(tile_rect, resLevel);
+   if(!isSourceEnabled()||!result.valid())
+   {
+      return result.get();
+   }
+   ossimDataObjectStatus status =  result->getDataObjectStatus();
+   
+   if(status == OSSIM_NULL)
+   { 
+	return result.get();
+   }
+   // Call the appropriate load method.
+   switch (result->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         elevRemap(ossim_uint8(0), result.get(), resLevel);
+         break;
+      }
+         
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         elevRemap(ossim_uint16(0), result.get(), resLevel);
+         break;
+      }
+         
+      case OSSIM_SSHORT16:
+      {
+         elevRemap(ossim_sint16(0), result.get(), resLevel);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         elevRemap(ossim_uint32(0), result.get(), resLevel);
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         elevRemap(ossim_sint32(0), result.get(), resLevel);
+         break;
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         elevRemap(ossim_float32(0), result.get(), resLevel);
+         break; } case OSSIM_NORMALIZED_DOUBLE: case OSSIM_FLOAT64:
+      {
+         elevRemap(ossim_float64(0), result.get(), resLevel);
+         break;
+      }
+         
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimElevRemapper::getTile Unsupported scalar type!" << endl;
+         break;
+      }
+   }
+   if (traceDebug())
+   {
+     ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimElevRemapper::getTile leaving..." << endl;
+   }
+   
+   return result;
+}
+
+template <class T>
+void ossimElevRemapper::elevRemap(T /* dummy */,
+                                   ossimImageData* inputTile,
+                                   ossim_uint32 resLevel)
+{
+   if (!inputTile) return;
+   ossimIrect rect = inputTile->getImageRectangle();
+   ossimIrect imageBounds = getBoundingRect(resLevel);
+   ossimIrect clipRect;
+   if(!rect.intersects(imageBounds))
+   {
+      return;
+   }
+   clipRect = rect.clipToRect(imageBounds);
+
+   if (m_imageGeometry.valid() && m_imageGeometry->getProjection())
+   {
+      ossimGpt ul, ll, lr, ur;
+      ossim_float32 hul, hll, hlr, hur;
+      ossim_float32 height = 0.0, xpercent, ypercent, uppery, lowery;
+
+      m_imageGeometry->rnToWorld(clipRect.ul(), resLevel, ul);
+      m_imageGeometry->rnToWorld(clipRect.ur(), resLevel, ur);
+      m_imageGeometry->rnToWorld(clipRect.ll(), resLevel, ll);
+      m_imageGeometry->rnToWorld(clipRect.lr(), resLevel, lr);
+
+      //std::cout << "UL: " << clipRect.ul() << " RES: " << ossimString::toString(resLevel) << " ULGROUND: " << ul << "\n";
+
+      hul = ossimGeoidManager::instance()->offsetFromEllipsoid(ul);
+      hll = ossimGeoidManager::instance()->offsetFromEllipsoid(ll);
+      hlr = ossimGeoidManager::instance()->offsetFromEllipsoid(lr);
+      hur = ossimGeoidManager::instance()->offsetFromEllipsoid(ur);
+
+//	std::cout << "HUL: " << ossimString::toString(hul) << " HUR: " << ossimString::toString(hur) << " HLR: " << ossimString::toString(hlr) << " HUR: " << ossimString::toString(hur) << "\n";
+
+     if(!rect.completely_within(imageBounds))
+     {
+        ossim_uint32 bands = inputTile->getNumberOfBands();
+        ossimIpt origin = clipRect.ul() - rect.ul();
+        ossim_uint32 bandIdx = 0;
+        ossim_uint32 inputW = inputTile->getWidth();
+        ossim_uint32 originOffset = origin.y*inputW + origin.x;
+        ossim_uint32 w = clipRect.width();
+        ossim_uint32 h = clipRect.height();
+        ossim_uint32 x = 0;
+        ossim_uint32 y = 0;
+        ossim_float32 height = 0.0, xpercent, ypercent, uppery, lowery;
+        for(bandIdx = 0; bandIdx < bands; ++bandIdx)
+        {
+           T* bandPtr = static_cast<T*>(inputTile->getBuf(bandIdx)) + originOffset;
+           for(y = 0; y < h; ++y)
+           {
+              for(x = 0; x < w; ++x)
+              {
+	         xpercent = x / clipRect.width();
+	         ypercent = y / clipRect.height();
+	         uppery = hul + xpercent * ( hur - hul);
+	         lowery = hll + xpercent * ( hlr - hll);
+	         height = uppery + ypercent * ( lowery - uppery );
+		 if (m_replacementType==ReplacementType_GEOID) height*=-1.0;
+
+	         bandPtr[x] += height;
+              }
+              bandPtr += inputW;
+           }
+        }
+     }
+     else
+     {
+        ossim_uint32 bands = inputTile->getNumberOfBands();
+        ossim_uint32 bandIdx = 0;
+        ossim_uint32 size = inputTile->getWidth()*inputTile->getHeight();
+        ossim_float32 height = 0.0;
+        for(bandIdx = 0; bandIdx < bands; ++bandIdx)
+        {
+           T* bandPtr = static_cast<T*>(inputTile->getBuf(bandIdx));
+                               
+           ossim_uint32 idx = 0;
+           for(idx = 0; idx < size;++idx)
+           {
+	      ossim_uint32 y = idx / rect.width();
+              ossim_uint32 x = idx % rect.width();
+	      xpercent = x / clipRect.width();
+              ypercent = y / clipRect.height();
+              uppery = hul + xpercent * ( hur - hul);
+              lowery = hll + xpercent * ( hlr - hll);
+              height = uppery + ypercent * ( lowery - uppery );
+	      if (m_replacementType==ReplacementType_GEOID) height*=-1.0;
+
+	      (*bandPtr) += height;
+	      ++bandPtr;
+           }
+        }
+     }
+   }
+}
+
+bool ossimElevRemapper::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix)const
+{
+   bool result = ossimImageSourceFilter::saveState(kwl, prefix);
+   ossimString remapMode = "";
+   switch(m_replacementType)
+   {
+      case ReplacementType_ELLIPSOID:
+         remapMode = "ellipsoid"; 
+	 break;
+      case ReplacementType_GEOID:
+         remapMode = "geoid";
+	 break;
+      default:
+	 remapMode = "ellipsoid";
+         break;
+   }
+   kwl.add(prefix, REMAP_MODE_KW,  remapMode.c_str());
+
+   ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
+
+   if(m_imageGeometry.valid())
+   {
+      m_imageGeometry->saveState(kwl, imagePrefix.c_str());
+   }
+   //std::cout << kwl << " SAVESTATE\n";
+   return result;
+}
+
+bool ossimElevRemapper::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   //std::cout << kwl << " LOADSTATE\n";
+   if (traceDebug())
+   {
+     ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimElevRemapper::loadState entered..." << endl;
+   }
+   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
+
+   const char* lookup;
+   lookup = kwl.find(prefix, REMAP_MODE_KW);
+   if(lookup)
+   {
+      ossimString mode = lookup;
+      mode.upcase();
+      if (mode == "ELLIPSOID")
+      {
+         m_replacementType = ReplacementType_ELLIPSOID;
+      }
+      else if (mode == "GEOID")
+      {
+	 m_replacementType = ReplacementType_GEOID;
+      }
+   }
+
+   ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
+   if(kwl.numberOf(imagePrefix.c_str())>0)
+   {
+      m_imageGeometry = new ossimImageGeometry();
+      m_imageGeometry->loadState(kwl, imagePrefix.c_str());
+      //setImageGeometry(m_igeometry.get());
+   }
+
+   return result;
+}
diff --git a/src/imaging/ossimElevationMosaic.cpp b/src/imaging/ossimElevationMosaic.cpp
new file mode 100644
index 0000000..b93c8e0
--- /dev/null
+++ b/src/imaging/ossimElevationMosaic.cpp
@@ -0,0 +1,541 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: 
+// 
+// Description: implementation for image mosaic
+//
+//*************************************************************************
+// $Id: ossimElevationMosaic.cpp 15766 2009-10-20 12:37:09Z gpotts $
+
+#include <ossim/imaging/ossimElevationMosaic.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimTrace.h>
+static const ossimTrace traceDebug("ossimElevationMosaic:debug");
+static const ossim_float32 MIN_ELEVATION = -500.0;
+static const ossim_float32 MAX_ELEVATION = 32000.0;
+
+using namespace std;
+
+RTTI_DEF1(ossimElevationMosaic, "ossimElevationMosaic", ossimImageCombiner)
+ossimElevationMosaic::ossimElevationMosaic()
+   :ossimImageCombiner(),
+    theTile(NULL)
+{
+
+}
+
+ossimElevationMosaic::ossimElevationMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
+    : ossimImageCombiner(inputSources),
+      theTile(NULL)
+{
+}
+
+
+ossimElevationMosaic::~ossimElevationMosaic()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimElevationMosaic::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   long size = getNumberOfInputs();
+   ossim_uint32 layerIdx = 0;
+   // If there is only one in the mosaic then just return it.
+   if(size == 1)
+   {
+      return getNextTile(layerIdx, 0, tileRect, resLevel);
+   }
+   
+   ossimIpt origin = tileRect.ul();
+   ossim_uint32 w = tileRect.width();
+   ossim_uint32 h = tileRect.height();
+   
+   if(!theTile.valid())
+   {
+      // try to initialize
+      allocate();
+
+      // if we still don't have a buffer
+      // then we will leave
+      if(!theTile.valid())
+      {
+         return ossimRefPtr<ossimImageData>();
+      }
+   }
+   
+   ossim_uint32 tileW = theTile->getWidth();
+   ossim_uint32 tileH = theTile->getHeight();
+   if((w != tileW)||
+      (h != tileH))
+   {
+      theTile->setWidth(w);
+      theTile->setHeight(h);
+      if((w*h)!=(tileW*tileH))
+      {
+         theTile->initialize();
+      }
+   }
+   theTile->setOrigin(origin);
+
+   //---
+   // General Note:
+   //
+   // Note: I will not check for disabled or enabled since we have
+   // no clear way to handle this within a mosaic. The default will be
+   // to do a simple a A over B type mosaic.  Derived classes should
+   // check for the enabled and disabled and always
+   // use this default implementation if they are disabled.
+   //---
+
+   theTile->setOrigin(origin);
+   theTile->makeBlank();
+   switch(theTile->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint8>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint8>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT8:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint8>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint8>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_FLOAT: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<float>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<float>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint16>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint16>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SSHORT16:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint16>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint16>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint32>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint32>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_UINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint32>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint32>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<double>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<double>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Scalar type = " << theTile->getScalarType()
+            << " Not supported by ossimElevationMosaic" << endl;
+      }
+   }
+
+   return ossimRefPtr<ossimImageData>();
+}
+
+void ossimElevationMosaic::initialize()
+{
+  ossimImageCombiner::initialize();
+  theTile = NULL;
+}
+
+void ossimElevationMosaic::allocate()
+{
+   theTile = NULL;
+   
+   if( (getNumberOfInputs() > 0) && getInput(0) )
+   {
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+   }
+}
+
+bool ossimElevationMosaic::saveState(ossimKeywordlist& kwl,
+                                 const char* prefix)const
+{
+   return ossimImageCombiner::saveState(kwl, prefix);
+}
+
+bool ossimElevationMosaic::loadState(const ossimKeywordlist& kwl,
+                                 const char* prefix)
+{
+   return ossimImageCombiner::loadState(kwl, prefix);
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimElevationMosaic::combineNorm(
+   T,// dummy template variable 
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   //---
+   // Get the first tile from the input sources.  If this(index 0) is blank
+   // that means there are no layers so go no further.
+   //---
+   ossimRefPtr<ossimImageData> currentImageData =
+      getNextNormTile(layerIdx, 0, tileRect, resLevel);
+   if(!currentImageData)
+   {
+      return theTile;
+   }
+   
+   ossimRefPtr<ossimImageData> destination = theTile;
+   ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
+
+   
+   float** srcBands         = new float*[theLargestNumberOfInputBands];
+   float*  srcBandsNullPix  = new float[theLargestNumberOfInputBands];
+   T**     destBands        = new T*[theLargestNumberOfInputBands];
+   T*      destBandsNullPix = new T[theLargestNumberOfInputBands];
+   T*      destBandsMinPix  = new T[theLargestNumberOfInputBands];
+   T*      destBandsMaxPix  = new T[theLargestNumberOfInputBands];
+   
+   ossim_uint32 band;
+   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      srcBands[band]  = static_cast<float*>(currentImageData->getBuf(band));
+      srcBandsNullPix[band]  = static_cast<float>(currentImageData->getNullPix(band));
+      
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
+      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
+   }
+   
+   // if the src is smaller than the destination in number
+   // of bands we will just duplicate the last band.
+   for(;band < theLargestNumberOfInputBands; ++band)
+   {
+      srcBands[band]  = static_cast<float*>(srcBands[minNumberOfBands - 1]);
+      srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(minNumberOfBands - 1));
+      
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
+      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
+   }
+
+   // Loop to copy from layers to output tile.
+   while(currentImageData.valid())
+   {
+      //---
+      // Check the status of the source tile.  If empty get the next source
+      // tile and loop back.
+      //---
+       ossimDataObjectStatus currentStatus =
+         currentImageData->getDataObjectStatus();
+      if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
+      {
+         currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+         continue;
+      }
+      
+      ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+      
+      for(band = 0; band < minNumberOfBands; ++band)
+      {
+         srcBands[band] = static_cast<float*>(currentImageData->getBuf(band));
+         srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
+      }
+      // if the src is smaller than the destination in number
+      // of bands we will just duplicate the last band.
+      for(;band < theLargestNumberOfInputBands; ++band)
+      {
+         srcBands[band] = srcBands[minNumberOfBands - 1];
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      }
+      
+      if ( (currentStatus == OSSIM_FULL) &&
+           (destinationStatus == OSSIM_EMPTY) )
+      {
+         // Copy full tile to empty tile.
+         for(band=0; band < theLargestNumberOfInputBands; ++band)
+         {
+            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
+            float minP  = destBandsMinPix[band];
+            
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               destBands[band][offset] =
+                  (T)( minP + delta*srcBands[band][offset]);
+            }
+         }
+      }
+      else // Copy tile checking all the pixels...
+      {
+         for(band = 0; band < theLargestNumberOfInputBands; ++band)
+         {
+            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
+            float minP  = destBandsMinPix[band];
+            
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (destBands[band][offset] < MIN_ELEVATION || destBands[band][offset] > MAX_ELEVATION) //== destBandsNullPix[band])
+               {
+                  if (srcBands[band][offset] > MIN_ELEVATION && srcBands[band][offset] < MAX_ELEVATION) //!= srcBandsNullPix[band])
+                  {
+                     destBands[band][offset] =
+                        (T)(minP + delta*srcBands[band][offset]);
+                  }
+               }
+            }
+         }
+      }
+
+      // Validate output tile and return if full.
+      destinationStatus = destination->validate();
+      if (destinationStatus == OSSIM_FULL)
+      {
+         
+         break;//return destination;
+      }
+
+      // If we get here we're are still not full.  Get a tile from next layer.
+      currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+   }
+
+   // Cleanup...
+   delete [] srcBands;
+   delete [] destBands;
+   delete [] srcBandsNullPix;
+   delete [] destBandsNullPix;
+   delete [] destBandsMinPix;
+   delete [] destBandsMaxPix;
+
+   return destination;
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimElevationMosaic::combine(
+   T,// dummy template variable 
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   bool hasInvalidElevations = false;
+   //---
+   // Get the first tile from the input sources.  If this(index 0) is blank
+   // that means there are no layers so go no further.
+   //---
+   ossimRefPtr<ossimImageData> currentImageData =
+      getNextTile(layerIdx, 0, tileRect, resLevel);
+   if (!currentImageData)
+   {
+      return theTile;
+   }
+
+   ossimRefPtr<ossimImageData> destination = theTile;
+   ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
+
+   T** srcBands         = new T*[theLargestNumberOfInputBands];
+   T*  srcBandsNullPix  = new T[theLargestNumberOfInputBands];
+   T** destBands        = new T*[theLargestNumberOfInputBands];
+   T*  destBandsNullPix = new T[theLargestNumberOfInputBands];
+      
+   ossim_uint32 band;
+   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      srcBandsNullPix[band]  = static_cast<T>(currentImageData->getNullPix(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+   }
+   // if the src is smaller than the destination in number
+   // of bands we will just duplicate the last band.
+   for(;band < theLargestNumberOfInputBands; ++band)
+   {
+      srcBands[band]  = static_cast<T*>(srcBands[minNumberOfBands - 1]);
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+   }
+
+   // Loop to copy from layers to output tile.
+   while(currentImageData.valid())
+   {
+      //---
+      // Check the status of the source tile.  If empty get the next source
+      // tile and loop back.
+      //---
+      ossimDataObjectStatus currentStatus =
+         currentImageData->getDataObjectStatus();
+      if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
+      {
+         currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+         continue;
+      }
+      
+      ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+
+      for(band = 0; band < minNumberOfBands; ++band)
+      {
+         srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
+      }
+      // if the src is smaller than the destination in number
+      // of bands we will just duplicate the last band.
+      for(;band < theLargestNumberOfInputBands; ++band)
+      {
+         srcBands[band] = srcBands[minNumberOfBands - 1];
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      }
+
+      if ( (currentStatus == OSSIM_FULL) &&
+           (destinationStatus == OSSIM_EMPTY) )
+      {
+         // Copy full tile to empty tile.
+         for(ossim_uint32 band=0; band < theLargestNumberOfInputBands; ++band)
+         {
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               destBands[band][offset] = srcBands[band][offset];
+	       if(destBands[band][offset] < MIN_ELEVATION || destBands[band][offset] > MAX_ELEVATION)
+	       {
+		 hasInvalidElevations = true;
+	       }
+            }
+         }
+      }
+      else // Copy tile checking all the pixels...
+      {
+         for(band = 0; band < theLargestNumberOfInputBands; ++band)
+         {
+            
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if(destBands[band][offset] < MIN_ELEVATION || destBands[band][offset] > MAX_ELEVATION) //== destBandsNullPix[band])
+               {
+		  hasInvalidElevations = true;
+                  destBands[band][offset] = srcBands[band][offset];
+               }
+            }
+         }
+      }
+
+      // Validate output tile and return if full.
+      destinationStatus = destination->validate();
+      if (!hasInvalidElevations)
+      {
+	 break;
+      }
+      //if (destinationStatus == OSSIM_FULL)
+      //{
+      //   break;//return destination;
+      //}
+
+      // If we get here we're are still not full.  Get a tile from next layer.
+      currentImageData = getNextTile(layerIdx, tileRect, resLevel);
+   }
+   
+   // Cleanup...
+   delete [] srcBands;
+   delete [] destBands;
+   delete [] srcBandsNullPix;
+   delete [] destBandsNullPix;
+   
+   return destination;
+}
diff --git a/src/imaging/ossimEnviHeaderFileWriter.cpp b/src/imaging/ossimEnviHeaderFileWriter.cpp
new file mode 100644
index 0000000..90f6207
--- /dev/null
+++ b/src/imaging/ossimEnviHeaderFileWriter.cpp
@@ -0,0 +1,101 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Class definition for ossimEnviHeaderFileWriter.  Meta data class for
+// writing an ENVI (The Environment for Visualizing Images) header file.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimEnviHeaderFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimEnviHeaderFileWriter.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+
+
+RTTI_DEF1(ossimEnviHeaderFileWriter,
+          "ossimEnviHeaderFileWriter",
+          ossimMetadataFileWriter)
+
+ossimEnviHeaderFileWriter::ossimEnviHeaderFileWriter()
+   :
+   ossimMetadataFileWriter(),
+   theHdr()
+{
+}
+
+ossimEnviHeaderFileWriter::~ossimEnviHeaderFileWriter()
+{
+}
+
+bool ossimEnviHeaderFileWriter::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   bool result = false;
+   
+   if (ossimMetadataFileWriter::loadState(kwl, prefix))
+   {
+      result = theHdr.loadState(kwl, prefix);
+   }
+   
+   return result;
+}
+
+bool writeFile()
+{
+   bool result = true;
+
+   return result;
+}
+
+bool ossimEnviHeaderFileWriter::writeFile()
+{
+   theHdr.setLines(theAreaOfInterest.height());
+   theHdr.setSamples(theAreaOfInterest.width());
+   theHdr.setBands(theInputConnection->getNumberOfOutputBands());
+   
+   // Get the geometry from the input.
+   // Get the geometry from the input.
+   ossimMapProjection* mapProj = 0;
+   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
+   if ( inputGeom.valid() ) mapProj = PTR_CAST(ossimMapProjection, inputGeom->getProjection());
+   if (mapProj)
+   {
+      // Create the projection info.
+      ossimRefPtr<ossimMapProjectionInfo> projectionInfo
+         = new ossimMapProjectionInfo(mapProj, theAreaOfInterest);
+
+      // Set the tie points in the keyword list.
+      ossimKeywordlist kwl;
+      projectionInfo->getGeom(kwl);
+
+      // Pass it on to envi header to set the map info string from geometry.
+      theHdr.setMapInfo(kwl);
+   }
+
+   return theHdr.writeFile(theFilename);
+}
+
+void ossimEnviHeaderFileWriter::getMetadatatypeList(
+   std::vector<ossimString>& metadatatypeList) const
+{
+   metadatatypeList.push_back(ossimString("envi_header")); 
+}
+
+bool ossimEnviHeaderFileWriter::hasMetadataType(
+   const ossimString& metadataType)const
+{
+   return (metadataType == "envi_header");
+}
diff --git a/src/imaging/ossimEnviTileSource.cpp b/src/imaging/ossimEnviTileSource.cpp
new file mode 100644
index 0000000..a866b4a
--- /dev/null
+++ b/src/imaging/ossimEnviTileSource.cpp
@@ -0,0 +1,298 @@
+//---
+//
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Image handler class for a raster files with an ENVI header file.
+//
+//---
+// $Id$
+
+#include <ossim/imaging/ossimEnviTileSource.h>
+#include <ossim/base/ossimAffineTransform.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/projection/ossimAlphaSensorHRI.h>
+#include <ossim/projection/ossimAlphaSensorHSI.h>
+#include <ossim/support_data/ossimAlphaSensorSupportData.h>
+#include <ossim/support_data/ossimWavelength.h>
+
+
+RTTI_DEF1(ossimEnviTileSource,
+          "ossimEnviTileSource",
+          ossimGeneralRasterTileSource)
+
+static ossimTrace traceDebug("ossimEnviTileSource:debug");
+
+ossimEnviTileSource::ossimEnviTileSource()
+   :
+   ossimGeneralRasterTileSource(),
+   m_enviHdr()
+{
+}
+
+ossimEnviTileSource::~ossimEnviTileSource()
+{
+}
+
+bool ossimEnviTileSource::open()
+{
+   static const char MODULE[] = "ossimEnviTileSource::open";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..."
+         << "\nimage file: " << theImageFile << std::endl;
+   }
+
+   bool result = false;
+   
+   if(isOpen())
+   {
+      close();
+   }
+
+   // Look for a header file:
+   ossimFilename hdr = theImageFile;
+   hdr.setExtension("hdr"); // image.hdr
+   if ( !hdr.exists() )
+   {
+      hdr = theImageFile;
+      hdr.string() += ".hdr"; // image.ras.hdr
+   }
+
+   if ( hdr.exists() )
+   {
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "header file: " << hdr << std::endl;
+      }
+
+      if ( m_enviHdr.open( hdr ) )
+      {
+         if ( m_rasterInfo.initializeFromEnviHdr( m_enviHdr ) )
+         {
+            // Set image file for initializeHandler method.
+            m_rasterInfo.setImageFile( theImageFile );
+            
+            // Look for an omd file:
+            ossimFilename omd = theImageFile;
+            omd.setExtension("omd"); // image.omd
+            if ( !omd.exists() )
+            {
+               omd.setExtension("kwl"); // image.kwl
+            }
+            
+            if ( omd.exists() )
+            {
+               if ( traceDebug() )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG) << "omd file: " << omd << std::endl;
+               }
+
+               // Pick up adjusted min / max values if present.
+               ossimKeywordlist kwl( omd );
+               m_rasterInfo.getImageMetaData().updateMetaData( kwl, std::string("") );
+            }
+           
+            theMetaData = m_rasterInfo.getImageMetaData();
+            
+            result = initializeHandler();
+            if ( result )
+            {
+               completeOpen();
+               
+               //---
+               // This will set default output band list if we are a band selector and 
+               // "default bands" key is found in the envi header.  If "default bands"
+               // is not found it will set to identity(input = output).
+               //---
+               setDefaultBandList();
+            }
+         }
+      }
+   }
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
+   }
+   
+   return result;
+}
+   
+//************************************************************************************************
+//! Returns the image geometry object associated with this tile source or NULL if non defined.
+//! The geometry contains full-to-local image transform as well as projection (image-to-world)
+//************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimEnviTileSource::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      // Check for external geom:
+      theGeometry = getExternalImageGeometry();
+      
+      if ( !theGeometry )
+      {
+         // Check the internal geometry first to avoid a factory call.
+         theGeometry = getInternalImageGeometry();
+
+         // At this point it is assured theGeometry is set.
+
+         //---
+         // WARNING:
+         // Must create/set theGeometry at this point or the next call to
+         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
+         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
+         //---         
+
+         // Check for set projection.
+         if ( theGeometry.valid()&&!theGeometry->getProjection() )
+         {
+            // Try factories for projection.
+            ossimImageGeometryRegistry::instance()->extendGeometry(this);
+         }
+      }
+      
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+   }
+   
+   return theGeometry;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimEnviTileSource::getInternalImageGeometry() const
+{
+   static const char MODULE[] = "ossimEnviTileSource::getInternalImageGeometry";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+   ossimRefPtr<ossimImageGeometry> geom;
+
+// debugging to turn off model load
+//   return geom;
+
+   geom  = new ossimImageGeometry();
+
+    ossimRefPtr<ossimAlphaSensorSupportData> supData = new ossimAlphaSensorSupportData();
+    if ( supData->readSupportFiles( m_enviHdr ) )
+    {
+       if (supData->isHSI())
+       {
+          ossimRefPtr<ossimAlphaSensorHSI> sensor = new ossimAlphaSensorHSI();
+          if ( sensor->initialize( *(supData.get()) ) )
+          {
+             geom->setProjection( sensor.get() );
+          }
+       }
+       else
+       {
+          ossimRefPtr<ossimAlphaSensorHRI> sensor = new ossimAlphaSensorHRI();
+          if ( sensor->initialize( *(supData.get()) ) )
+          {
+             geom->setProjection( sensor.get() );
+          }
+       }
+       
+    } // Matches: if ( supData->readSupportFiles( m_enviHdr ) )
+    else
+    {
+      geom = 0;
+    }
+
+    return geom;
+}
+
+bool ossimEnviTileSource::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix)const
+{
+   return ossimGeneralRasterTileSource::saveState(kwl,prefix);
+}
+
+bool ossimEnviTileSource::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   return ossimGeneralRasterTileSource::loadState(kwl, prefix);
+}
+
+ossimRefPtr<ossimProperty> ossimEnviTileSource::getProperty(
+   const ossimString& name)const
+{
+   if(name == "file_type")
+   {
+      return new ossimStringProperty(name, getShortName());
+   }
+   
+   return ossimImageHandler::getProperty(name);
+}
+
+void ossimEnviTileSource::getPropertyNames(
+   std::vector<ossimString>& propertyNames)const
+{
+   ossimImageHandler::getPropertyNames(propertyNames);
+   propertyNames.push_back("file_type");
+}
+
+ossimString ossimEnviTileSource::getShortName() const
+{
+   return ossimString("ENVI");
+}
+   
+ossimString ossimEnviTileSource::getLongName() const
+{
+   return ossimString("ENVI reader");
+}
+
+bool ossimEnviTileSource::getRgbBandList(std::vector<ossim_uint32>& bandList) const
+{
+   bool result = false;
+
+   bandList.clear();
+   
+   // Look in ENVI header for "default bands":
+   result = m_enviHdr.getDefaultBands( bandList );
+
+   if ( !result && ( getNumberOfInputBands() > 2 ) )
+   {
+      // Try to derive RGB from wavelengths if found in ENVI header.
+      ossimWavelength wl;
+      if ( wl.initialize( m_enviHdr ) )
+      {
+         result = wl.getRgbBands( bandList );
+      }
+   }
+   
+   if ( bandList.size() != 3 )
+   {
+      result = false;
+   }
+   
+   return result;
+}
+
+void ossimEnviTileSource::setDefaultBandList()
+{
+   if ( isBandSelector() )
+   {
+      std::vector<ossim_uint32> bandList;
+      if ( getRgbBandList( bandList ) )
+      {
+         if ( bandList.size() )
+         {            
+            ossimImageHandler::setOutputBandList(bandList, m_outputBandList);
+         }
+      }
+   }
+   
+   if ( m_outputBandList.empty() )
+   {
+      // Initialized to identity (input = output):
+      ossimImageSource::getOutputBandList( m_outputBandList );
+   }
+}
diff --git a/src/imaging/ossimEquationCombiner.cpp b/src/imaging/ossimEquationCombiner.cpp
new file mode 100644
index 0000000..06ced82
--- /dev/null
+++ b/src/imaging/ossimEquationCombiner.cpp
@@ -0,0 +1,3576 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimEquationCombiner.cpp 23407 2015-07-06 15:59:23Z okramer $
+
+#include <cstdlib>
+#include <sstream>
+using namespace std;
+
+#include <ossim/imaging/ossimEquationCombiner.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimConvolutionSource.h>
+#include <ossim/imaging/ossimSubImageTileSource.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/matrix/newmatio.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+RTTI_DEF1(ossimEquationCombiner, "ossimEquationCombiner", ossimImageCombiner);
+
+static const char* EQUATION_KW = "equation";
+
+
+class ossimBinaryOpAdd : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return v1 + v2;
+      }
+};
+
+class ossimBinaryOpAnd : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (double)(((ossim_uint32)v1) & ((ossim_uint32)v2));
+      }
+};
+
+class ossimBinaryOpOr : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (double)(((ossim_uint32)v1) | ((ossim_uint32)v2));
+      }
+};
+
+class ossimBinaryOpXor : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (double)(((ossim_uint32)v1) ^ ((ossim_uint32)v2));
+      }
+};
+
+class ossimBinaryOpSub : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return v1 - v2;
+      }
+};
+
+class ossimBinaryOpMax : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return std::max(v1, v2);
+      }
+};
+
+class ossimBinaryOpMin : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return std::min(v1, v2);
+      }
+};
+
+class ossimBinaryOpMul : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return v1 * v2;
+      }
+};
+
+class ossimBinaryOpDiv : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         if(fabs(v2)>FLT_EPSILON)
+            return v1 / v2;
+         
+         return 1.0/FLT_EPSILON;
+      }
+};
+
+class ossimBinaryOpMod : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         if(fabs(v2)>FLT_EPSILON)
+            return fmod(v1,v2);
+         
+         return 1.0/FLT_EPSILON;
+      }
+};
+
+class ossimBinaryOpPow : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return pow(v1, v2);
+      }
+};
+// boolean operators
+class ossimBinaryOpEqual : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (v1==v2)?1.0:0.0;
+      }
+};
+class ossimBinaryOpGreater : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (v1>v2)?1.0:0.0;
+      }
+};
+class ossimBinaryOpGreaterOrEqual : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (v1>=v2)?1.0:0.0;
+      }
+};
+class ossimBinaryOpLess : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (v1<v2)?1.0:0.0;
+      }
+};
+class ossimBinaryOpLessOrEqual : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (v1<=v2)?1.0:0.0;
+      }
+};
+class ossimBinaryOpDifferent : public ossimEquationCombiner::ossimBinaryOp
+{
+public:
+   virtual double apply(double v1, double v2)const
+      {
+         return (v1!=v2)?1.0:0.0;
+      }
+};
+class ossimUnaryOpNot : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return 1-v;
+      }
+};
+
+class ossimUnaryOpAbs : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return fabs(v);
+      }
+};
+
+class ossimUnaryOpOnesComplement : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return (double)((ossim_uint8)~((ossim_uint8)v));
+      }
+};
+
+class ossimUnaryOpLog : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return log(v);
+      }
+};
+
+class ossimUnaryOpLog10 : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return log10(v);
+      }
+};
+
+class ossimUnaryOpNeg : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return -v;
+      }
+};
+
+class ossimUnaryOpSqrt : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         if(v >= 0)
+         {
+            return sqrt(v);
+         }
+         
+         return -1;
+      }
+};
+
+class ossimUnaryOpExp : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return exp(v);
+      }
+};
+
+class ossimUnaryOpSin : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return sin(v);
+      }
+};
+
+class ossimUnaryOpSind : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return sin(v*M_PI/180.0);
+      }
+};
+
+class ossimUnaryOpASin : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         if(v > 1) v = 1;
+         if(v < -1) v = -1;
+         return asin(v);
+      }
+};
+
+class ossimUnaryOpASind : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         if(v > 1) v = 1;
+         if(v < -1) v = -1;
+         return (180/M_PI)*asin(v);
+      }
+};
+
+class ossimUnaryOpACos : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         if(v > 1) v = 1;
+         if(v < -1) v = -1;
+         return acos(v);
+      }
+};
+
+class ossimUnaryOpACosd : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         if(v > 1) v = 1;
+         if(v < -1) v = -1;
+         return (180/M_PI)*acos(v);
+      }
+};
+
+class ossimUnaryOpCos : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return cos(v);
+      }
+};
+
+class ossimUnaryOpCosd : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return cos(v*M_PI/180.0);
+      }
+};
+
+class ossimUnaryOpTan : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return tan(v);
+      }
+};
+
+class ossimUnaryOpTand : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return tan(v*M_PI/180.0);
+      }
+};
+
+class ossimUnaryOpATan : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return atan(v);
+      }
+};
+
+class ossimUnaryOpATand : public ossimEquationCombiner::ossimUnaryOp
+{
+public:
+   virtual double apply(double v)const
+      {
+         return (180/M_PI)*atan(v);
+      }
+};
+
+
+ossimEquationCombiner::ossimEquationCombiner()
+   :ossimImageCombiner(),
+    theOutputScalarType(OSSIM_FLOAT64),
+    theEquation(""),
+    theLexer(NULL),
+    theTile(NULL),
+    theCastFilter(NULL),
+    theCastOutputFilter(NULL),
+    theCurrentId(0),
+    theCurrentResLevel(0)
+{
+   theLexer      = new ossimEquTokenizer;
+   theCastFilter = new ossimCastTileSourceFilter;
+   theCastFilter->setOutputScalarType(OSSIM_FLOAT64);
+}
+
+ossimEquationCombiner::ossimEquationCombiner(ossimConnectableObject::ConnectableObjectList& inputs)
+   :ossimImageCombiner(inputs),
+    theOutputScalarType(OSSIM_FLOAT64),
+    theEquation(""),
+    theLexer(NULL),
+    theTile(NULL),
+    theCastFilter(NULL),
+    theCastOutputFilter(NULL),
+    theCurrentId(0),
+    theCurrentResLevel(0)
+{
+   theLexer      = new ossimEquTokenizer;
+   theCastFilter = new ossimCastTileSourceFilter;
+   theCastFilter->setOutputScalarType(OSSIM_FLOAT64);
+}
+
+ossimEquationCombiner::~ossimEquationCombiner()
+{
+   if(theLexer)
+   {
+      delete theLexer;
+      theLexer = NULL;
+   }
+
+   if(theCastFilter.valid())
+   {
+      theCastFilter->disconnect();
+      theCastFilter = 0;
+   }
+
+   if(theCastOutputFilter.valid())
+   {
+      theCastOutputFilter->disconnect();
+      theCastOutputFilter = 0;
+   }
+   // make sure they are cleared
+   clearStacks();
+}
+
+double ossimEquationCombiner::getNullPixelValue(ossim_uint32 band)const
+{
+   
+   if(theEquation == "")
+   {
+      if(getInput())
+      {
+         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
+         if(inter)
+         {
+            return inter->getNullPixelValue(band);
+         }
+      }
+   }
+   return ossim::defaultNull(getOutputScalarType());
+}   
+
+double ossimEquationCombiner::getMinPixelValue(ossim_uint32 band)const
+{
+   if(theEquation == "")
+   {
+      if(getInput())
+      {
+         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
+         if(inter)
+         {
+            return inter->getMinPixelValue(band);
+         }
+      }
+   }
+   return ossim::defaultMin(getOutputScalarType());
+}
+
+double ossimEquationCombiner::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(theEquation == "")
+   {
+      if(getInput())
+      {
+         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
+         if(inter)
+         {
+            return inter->getMaxPixelValue(band);
+         }
+      }
+   }
+   return ossim::defaultMax(getOutputScalarType());         
+}
+
+ossimScalarType ossimEquationCombiner::getOutputScalarType() const
+{
+
+   if(theEquation == "")
+   {
+      if(getInput())
+      {
+         ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput());
+         if(inter)
+         {
+            return inter->getOutputScalarType();
+         }
+      }
+   }
+   
+   return theOutputScalarType;
+}
+
+
+ossimRefPtr<ossimImageData> ossimEquationCombiner::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theTile)
+   {
+      initialize();
+   }
+   long w = tileRect.width();
+   long h = tileRect.height();
+   long tw = theTile->getWidth();
+   long th = theTile->getHeight();
+   
+   if(theEquation != "")
+   {
+      theTile->setImageRectangle(tileRect);
+      
+      if(w*h != tw*th)
+      {
+         theTile->initialize();
+      }
+      else
+      {
+         theTile->makeBlank();
+      }
+      theCurrentResLevel = resLevel;
+      
+      ossimRefPtr<ossimImageData> outputTile =  parseEquation();
+
+      if(theCastOutputFilter.valid())
+      {
+         outputTile = theCastOutputFilter->applyCast(outputTile);
+      }
+      
+      return outputTile;
+   }
+   else
+   {
+      if(getInput())
+      {
+         ossimImageSource* inter =
+            PTR_CAST(ossimImageSource, getInput());
+         if(inter)
+         {
+            return inter->getTile(tileRect, resLevel);
+         }
+      }
+   }
+
+   return ossimRefPtr<ossimImageData>();
+}
+
+void ossimEquationCombiner::setOutputScalarType(ossimScalarType scalarType)
+{
+   if(theOutputScalarType != scalarType)
+   {
+      theOutputScalarType = scalarType;
+
+      if(theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
+      {
+         theOutputScalarType = OSSIM_FLOAT64;
+      }
+      if(theCastOutputFilter.valid())
+      {
+         theCastOutputFilter = 0;
+      }
+
+      if(theOutputScalarType != OSSIM_FLOAT64)
+      {
+         theCastOutputFilter = new ossimCastTileSourceFilter;
+         theCastOutputFilter->setOutputScalarType(theOutputScalarType);
+         theCastOutputFilter->connectMyInputTo(0, this);
+         theCastOutputFilter->initialize();
+      }
+   }
+}
+
+void ossimEquationCombiner::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+   
+   if(property->getName() == "Equation")
+   {
+      theEquation = property->valueToString();
+   }
+   else if(property->getName() == "Output scalar type")
+   {
+      setOutputScalarType(ossimScalarTypeLut::instance()->
+                          getScalarTypeFromString(property->valueToString()));
+   }
+   else
+   {
+      ossimImageCombiner::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimEquationCombiner::getProperty(const ossimString& name)const
+{
+   if(name == "Equation")
+   {
+      ossimStringProperty* stringProp = new ossimStringProperty("Equation",
+								theEquation,
+								false);
+      stringProp->clearChangeType();
+      stringProp->setReadOnlyFlag(false);
+      stringProp->setCacheRefreshBit();
+      
+      return stringProp;
+   }
+   else if(name == "Output scalar type")
+   {
+      ossimScalarTypeLut* sl = ossimScalarTypeLut::instance();
+      
+      std::vector<ossimString> scalarNames;
+
+      ossim_int32 tableSize = (ossim_int32)sl->getTableSize();
+      ossim_int32 idx;
+
+      for(idx = 0; idx < tableSize; ++idx)
+      {
+         scalarNames.push_back(sl->getEntryString(idx));
+      }
+      ossimStringProperty* stringProp = new ossimStringProperty("Output scalar type",
+								sl->getEntryString((ossim_int32)theOutputScalarType),
+								false,
+								scalarNames);
+      stringProp->clearChangeType();
+      stringProp->setReadOnlyFlag(false);
+      stringProp->setCacheRefreshBit();
+      
+      return stringProp;
+      
+   }
+
+   return ossimImageCombiner::getProperty(name);
+}
+
+void ossimEquationCombiner::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageCombiner::getPropertyNames(propertyNames);
+   propertyNames.push_back("Equation");
+   propertyNames.push_back("Output scalar type");
+}
+
+
+void ossimEquationCombiner::initialize()
+{
+   ossimImageCombiner::initialize();
+
+   theTile = ossimImageDataFactory::instance()->create(this, OSSIM_FLOAT64, getNumberOfOutputBands(), getTileWidth(), getTileHeight());
+   theTile->initialize();
+   if(theCastOutputFilter.valid())
+   {
+      theCastOutputFilter->initialize();
+   }
+}
+
+void ossimEquationCombiner::assignValue()
+{
+   if(!theValueStack.empty())
+   {
+      if(theValueStack.top().type == OSSIM_EQU_IMAGE_DATA_TYPE)
+      {
+         ossimImageData* topData = theValueStack.top().d.imageDataValue;
+         ossim_uint32 minBands = std::min(theTile->getNumberOfBands(),
+                                    topData->getNumberOfBands());
+         ossim_uint32 maxBands = theTile->getNumberOfBands();
+         ossim_uint32 band   = 0;
+         ossim_uint32 offset = 0;
+         ossim_uint32 size = theTile->getWidth()*theTile->getHeight();
+
+         if(topData->getDataObjectStatus() == OSSIM_PARTIAL)
+         {
+            for(band = 0; band < minBands; ++band)
+            {
+               double* inBuf  = (double*)topData->getBuf(band);
+               double* outBuf = (double*)theTile->getBuf(band);
+               double np      = topData->getNullPix(band);
+               if(outBuf && inBuf)
+               {
+                  for(offset = 0; offset < size; ++offset)
+                  {
+                     if(*inBuf != np)
+                     {
+                        *outBuf = *inBuf;
+                     }
+                     ++outBuf;
+                     ++inBuf;
+                  }
+               }
+            }
+            for(;band < maxBands; ++band)
+            {
+               double* inBuf  = (double*)topData->getBuf(minBands-1);
+               double* outBuf = (double*)theTile->getBuf(band);
+               double np      = topData->getNullPix(band);
+               
+               if(outBuf && inBuf)
+               {
+                  for(offset = 0; offset < size; ++offset)
+                  {
+                     if(*inBuf != np)
+                     {
+                        *outBuf = *inBuf;
+                     }
+                     ++outBuf;
+                     ++inBuf;
+                  }
+               }
+            }
+
+         }
+         else if(topData->getDataObjectStatus() == OSSIM_FULL)
+         {
+            for(band = 0; band < minBands; ++band)
+            {
+               double* inBuf  = (double*)theValueStack.top().d.imageDataValue->getBuf(band);
+               double* outBuf = (double*)theTile->getBuf(band);
+               if(outBuf && inBuf)
+               {
+                  for(offset = 0; offset < size; ++offset)
+                  {
+                     *outBuf = *inBuf;
+                     ++outBuf;
+                     ++inBuf;
+                  }
+               }
+            }
+            for(;band < maxBands; ++band)
+            {
+               double* inBuf  = (double*)theValueStack.top().d.imageDataValue->getBuf(minBands-1);
+               double* outBuf = (double*)theTile->getBuf(band);
+               
+               if(outBuf && inBuf)
+               {
+                  for(offset = 0; offset < size; ++offset)
+                  {
+                     *outBuf = *inBuf;
+                     ++outBuf;
+                     ++inBuf;
+                  }
+               }
+            }
+         }
+         
+         // Delete the object indirectly through an ossimRefPtr.
+         ossimRefPtr<ossimImageData> id = theValueStack.top().d.imageDataValue;
+         id = NULL;
+      }
+      else
+      {
+         double* buf  = static_cast<double*>(theTile->getBuf());
+         ossim_uint32 size = theTile->getSize();
+         double value = (double)theValueStack.top().d.doubleValue;
+         
+         for(ossim_uint32 offset = 0; offset < size; ++offset)
+         {
+            *buf = value;
+            ++buf;
+         }
+      }
+      
+      theValueStack.pop();
+   }
+}
+
+void ossimEquationCombiner::clearStacks()
+{
+
+   while(!theValueStack.empty())
+   {
+      if(theValueStack.top().type == OSSIM_EQU_IMAGE_DATA_TYPE)
+      {
+         // Delete the object indirectly through an ossimRefPtr.
+         ossimRefPtr<ossimImageData> id = theValueStack.top().d.imageDataValue;
+         id = NULL;
+      }
+
+      theValueStack.pop();
+   }
+}
+
+void ossimEquationCombiner::clearArgList(vector<ossimEquValue>& argList)
+{
+   for(ossim_uint32 i = 0; i < argList.size(); ++i)
+   {
+      if(argList[i].type == OSSIM_EQU_IMAGE_DATA_TYPE)
+      {
+         if(argList[i].d.imageDataValue)
+         {
+            // Delete the object indirectly through an ossimRefPtr.
+            ossimRefPtr<ossimImageData> id = argList[i].d.imageDataValue;
+            id = NULL;
+            argList[i].d.imageDataValue = (ossimImageData*)NULL;
+         }
+      }
+   }
+   argList.clear();
+}
+
+void ossimEquationCombiner::deleteArgList(vector<ossimEquValue>& args)
+{
+   int i = 0;
+
+   for(i = 0; i < (int)args.size(); ++i)
+   {
+      if(args[i].type == OSSIM_EQU_IMAGE_DATA_TYPE)
+      {
+         if(args[i].d.imageDataValue)
+         {
+            // Delete the object indirectly through an ossimRefPtr.
+            ossimRefPtr<ossimImageData> id = args[i].d.imageDataValue;
+            id = NULL;
+            args[i].d.imageDataValue = NULL;
+         }
+      }
+   }
+   
+   args.clear();
+}
+
+bool ossimEquationCombiner::parseArgList(vector<ossimEquValue>& args,
+                                         bool popValueStack)
+{
+   bool result = true;
+   
+   if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+   {
+      theCurrentId = theLexer->yylex();
+      do
+      {
+         if(parseExpression())
+         {
+            if(!theValueStack.empty())
+            {
+               args.push_back(theValueStack.top());
+               if(popValueStack)
+               {
+                  theValueStack.pop();
+               }
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "The expression at  arg " << (args.size()+1)
+                  << " is empty" << endl;
+               
+               result = false;
+            }
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               <<"Unable to parse expression" << endl;
+            result = false;
+         }
+         
+         if(theCurrentId == OSSIM_EQU_TOKEN_COMMA)
+         {
+            theCurrentId = theLexer->yylex();
+         }
+         else if(theCurrentId != OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               <<"Missing comma in argument list" << endl;
+            result = false;
+         }
+         
+      }while(result&&(theCurrentId != OSSIM_EQU_TOKEN_RIGHT_PAREN));
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Starting left parenthesis missing from arg list" << endl;
+      result = false;
+   }
+   
+   if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+   {
+      theCurrentId = theLexer->yylex(); // skip past right parenthesis
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         <<"No matching right parenthesis for arg list" << endl;
+      result = false;
+   }
+
+   if(!result && popValueStack)
+   {
+      clearArgList(args);
+   }
+   return result;
+}
+
+bool ossimEquationCombiner::parseAssignBand()
+{
+   bool result = true;
+   
+   vector<ossimEquValue> argList;
+
+   if(parseArgList(argList))
+   {
+      if((argList.size() == 3) ||
+         (argList.size() == 4))
+      {
+         ossimEquValue v3 = argList[2];
+         ossimEquValue v2 = argList[1];
+         ossimEquValue v1 = argList[0];
+         
+         if(argList.size() == 3)
+         {
+            if((v1.type == OSSIM_EQU_IMAGE_DATA_TYPE) &&
+               (v2.type == OSSIM_EQU_DOUBLE_TYPE))
+            {
+               ossimImageData *data = (ossimImageData*)v1.d.imageDataValue->dup();
+               ossimEquValue v;
+               
+               if(v3.type == OSSIM_EQU_IMAGE_DATA_TYPE)
+               {
+                  if(data->getBuf()&&
+                     v3.d.imageDataValue->getBuf())
+                  {
+                     if((ossim_uint32)(v2.d.doubleValue) < data->getNumberOfBands())
+                     {
+                        data->assignBand(v3.d.imageDataValue,
+                                         0,
+                                         (ossim_uint32)v2.d.doubleValue);
+                        
+                     }
+                  }
+               }
+               else
+               {
+                  if(data->getBuf()&&
+                     (ossim_uint32)v2.d.doubleValue < data->getNumberOfBands())
+                  {  
+                     ossim_uint32 upper = data->getWidth()*data->getHeight();
+                     double* buf = (double*)data->getBuf((ossim_uint32)v2.d.doubleValue);
+                     double value = v3.d.doubleValue;
+                     if(buf)
+                     {
+                        for(ossim_uint32 i = 0; i < upper; ++i)
+                        {
+                           *buf = value;
+                           ++buf;
+                        }  
+                     }
+                     else
+                     {
+                        result = false;
+                     }
+                  }
+               }
+               if(result)
+               {
+                  data->validate();
+                  v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+                  v.d.imageDataValue = data;
+                  theValueStack.push(v);
+               }
+            }
+            else
+            {
+               result = false;
+            }
+         }
+         else 
+         {
+            ossimEquValue v4 = argList[3];
+            if((v1.type == OSSIM_EQU_IMAGE_DATA_TYPE) &&
+               (v2.type == OSSIM_EQU_DOUBLE_TYPE)&&
+               (v3.type == OSSIM_EQU_IMAGE_DATA_TYPE)&&
+               (v4.type == OSSIM_EQU_DOUBLE_TYPE))
+            {
+               ossimImageData *data = (ossimImageData*)v1.d.imageDataValue->dup();
+               ossimEquValue v;
+               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+               v.d.imageDataValue = data;
+               if(data->getBuf()&&v3.d.imageDataValue->getBuf())
+               {
+                  
+                  ossim_uint32 index1 = (ossim_uint32)v4.d.doubleValue;
+                  ossim_uint32 index2 = (ossim_uint32)v2.d.doubleValue;
+                  
+                  if((index1 > data->getNumberOfBands()) ||
+                     (index1 > v3.d.imageDataValue->getNumberOfBands()))
+                  {
+                     result = false;
+                  }
+                  else
+                  {     
+                     data->assignBand(v3.d.imageDataValue,
+                                      index1,
+                                      index2);
+                     data->validate();
+                  }
+                  
+               }
+               
+               theValueStack.push(v);
+            }
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Invalid number of arguments to assign_band" << endl;
+         result = false;
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "unable to parse arguments for assign band" << endl;
+      result = false;
+   }
+
+   clearArgList(argList);
+
+   return result;
+}
+
+bool ossimEquationCombiner::parseStdFuncs()
+{
+   bool result = true;
+
+   switch(theCurrentId)
+   {
+   case OSSIM_EQU_TOKEN_ASSIGN_BAND:
+   {
+      theCurrentId = theLexer->yylex();
+      if(!parseAssignBand())
+      {
+         result = false;
+      }
+      
+      break;
+   }
+   case OSSIM_EQU_TOKEN_CONV:
+   {
+      theCurrentId = theLexer->yylex();
+      vector<ossimEquValue> args;
+      if(parseArgList(args))
+      {
+         ossimImageData* resultImage = (ossimImageData*)NULL;
+         if(applyConvolution(resultImage,
+                              args))
+         {
+            if(resultImage)
+            {
+               ossimEquValue v;
+               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+               v.d.imageDataValue = resultImage;
+               
+               theValueStack.push(v);
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "function conv error: resulting image is NULL" << endl;
+               result = false;
+            }
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Unable to apply convolution" << endl;
+            result = false;
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      
+      break;
+   }
+   case OSSIM_EQU_TOKEN_CLAMP:
+   {
+      theCurrentId = theLexer->yylex();
+      vector<ossimEquValue> args;
+      if(parseArgList(args))
+      {
+         ossimImageData* resultImage = (ossimImageData*)NULL;
+         if(applyClamp(resultImage,
+                       args))
+         {
+            if(resultImage)
+            {
+               ossimEquValue v;
+               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+               v.d.imageDataValue = resultImage;
+               
+               theValueStack.push(v);
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "function clamp error: resulting image is NULL" << endl;
+               result = false;
+            }
+            
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Unable to apply clamp" << endl;
+            result = false;
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      
+      break;
+   }
+   case OSSIM_EQU_TOKEN_BAND:
+   {
+    // need to parse the following rule for blurr function
+      //
+      // band(image data, number)
+      theCurrentId = theLexer->yylex();
+
+
+      vector<ossimEquValue> argList;
+
+      if(parseArgList(argList))
+      {
+         if(argList.size() == 2)
+         {
+            ossimEquValue v1 = argList[0];
+            ossimEquValue v2 = argList[1];
+            ossimImageData* tempData = NULL;
+            ossim_uint32 bandNumber           = 0;
+            if(v1.type == OSSIM_EQU_IMAGE_DATA_TYPE)
+            {
+               tempData = v1.d.imageDataValue;
+            }
+            else
+            {
+               result = false;
+            }
+            if(v2.type == OSSIM_EQU_DOUBLE_TYPE)
+            {
+               bandNumber = (ossim_uint32)(v2.d.doubleValue);
+            }
+            else
+            {
+               result = false;
+            }
+            if(bandNumber > tempData->getNumberOfBands())
+            {
+               result = false;
+            }
+            if(result)
+            {
+               ossimImageData* data = new ossimImageData(this,
+                                                         OSSIM_FLOAT64,
+                                                         1);
+               data->setWidthHeight(tempData->getWidth(),
+                                    tempData->getHeight());
+               data->setOrigin(tempData->getOrigin());
+               data->setNullPix(tempData->getNullPix(bandNumber),
+                                0);
+               data->setMinPix(tempData->getMinPix(bandNumber),
+                               0);
+               data->setMaxPix(tempData->getMaxPix(bandNumber),
+                               0);
+               data->initialize();
+               
+               if((tempData->getBuf())&&
+                  (bandNumber < tempData->getNumberOfBands()))
+               {
+                  data->assignBand(tempData,
+                                   bandNumber,
+                                   0);                           
+                  data->validate();
+               }
+               ossimEquValue v;
+               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+               v.d.imageDataValue = data;
+               theValueStack.push(v);
+            }
+            
+            if(tempData)
+            {
+               // Delete the object indirectly through an ossimRefPtr.
+               ossimRefPtr<ossimImageData> id = tempData;
+               tempData = NULL;
+            }
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Invalid number of args in function band" << endl;
+            
+            result = false;
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      
+      break;
+   }
+   case OSSIM_EQU_TOKEN_BLURR:
+   {
+      theCurrentId = theLexer->yylex();
+      vector<ossimEquValue> args;
+      if(parseArgList(args))
+      {
+         ossimImageData* resultImage = (ossimImageData*)NULL;
+         if(applyBlurr(resultImage,
+                       args))
+         {
+            if(resultImage)
+            {
+               ossimEquValue v;
+               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+               v.d.imageDataValue = resultImage;
+               
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+         else
+         {
+            result = false;
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      
+      break;
+   }
+   case OSSIM_EQU_TOKEN_SHIFT:
+   {
+      theCurrentId = theLexer->yylex();
+      vector<ossimEquValue> args;
+      if(parseArgList(args))
+      {
+         ossimImageData* resultImage = (ossimImageData*)NULL;
+         if(applyShift(resultImage,
+                       args))
+         {
+            if(resultImage)
+            {
+               ossimEquValue v;
+               v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+               v.d.imageDataValue = resultImage;
+               
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+         else
+         {
+            result = false;
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      
+      break;
+   }
+   case OSSIM_EQU_TOKEN_MAX:
+   case OSSIM_EQU_TOKEN_MIN:
+   {
+      ossimBinaryOp* op = NULL;
+      if(theCurrentId == OSSIM_EQU_TOKEN_MIN) op = new ossimBinaryOpMin;
+      else op = new ossimBinaryOpMax;
+      
+      int argCount = 0;
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         bool done = false;
+         while(!done)
+         {
+            if(parseExpression())
+            {
+               
+               ++argCount;
+               if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+               {
+                  theCurrentId = theLexer->yylex();
+                  
+                  done = true;
+               }
+               else if(theCurrentId == OSSIM_EQU_TOKEN_COMMA)
+               {
+                  theCurrentId = theLexer->yylex();
+               }
+               else
+               {
+                  result = false;
+                  done = true;
+               }
+            }
+            else
+            {
+               done = true;
+               result = false;
+            }
+         }
+         if((argCount > 1)&&result)
+         {
+            result = true;
+            
+            ossimEquValue v;
+            ossimEquValue v1;
+            ossimEquValue v2;
+
+            v2 = theValueStack.top();
+            theValueStack.pop();
+            v1 = theValueStack.top();
+            theValueStack.pop();
+            argCount -=2;
+
+            do
+            {
+               if(applyOp(*op,
+                          v,
+                          v1,
+                          v2))
+               {
+                  theValueStack.push(v);
+               }
+               else
+               {
+                  result = false;
+                  argCount = 0;
+                  
+               }
+               --argCount;
+               
+               if((argCount>0)&&result)
+               {
+                  v2 = theValueStack.top();
+                  theValueStack.pop();
+                  v1 = theValueStack.top();
+                  theValueStack.pop();
+               }
+               
+            }while((argCount > 0)&&(result));
+         }
+         else
+         {
+            result = false;
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      if(op)
+      {
+         delete op;
+         op = NULL;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_ABS:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpAbs(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_SIN:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpSin(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_SIND:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpSind(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_ASIN:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpASin(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_ASIND:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpASind(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_COS:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpCos(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_COSD:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpCosd(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_ACOS:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpACos(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_ACOSD:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpACosd(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_TAN:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpTan(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_TAND:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpTand(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_ATAN:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpATan(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_ATAND:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpATand(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_LOG:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpLog(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_LOG10:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpLog10(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_SQRT:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpSqrt(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   case OSSIM_EQU_TOKEN_EXP:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_PAREN)
+      {
+         theCurrentId = theLexer->yylex();
+         result = parseExpression();
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            if(theValueStack.size() > 0)
+            {
+               theCurrentId = theLexer->yylex();
+               ossimEquValue v;
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+               
+               applyOp(ossimUnaryOpExp(),
+                       v,
+                       v1);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      break;
+   }
+   default:
+   {
+      result = false;
+   }
+   }
+
+   return result;
+}
+
+bool ossimEquationCombiner::parseUnaryFactor()
+{
+   bool result = false;
+
+   
+   if(theCurrentId == OSSIM_EQU_TOKEN_MINUS)
+   {
+      theCurrentId = theLexer->yylex();
+
+      if(parseFactor())
+      {
+         if(theValueStack.size() > 0)
+         {
+            ossimEquValue v;
+            ossimEquValue v1 = theValueStack.top();
+            theValueStack.pop();
+            
+            applyOp(ossimUnaryOpNeg(),
+                    v,
+                    v1);
+            
+            theValueStack.push(v);
+         }
+         else
+         {
+            result = false;
+         }
+
+         result = true;
+      }
+      else
+      {
+         result = false;
+      }
+   }
+   else if(theCurrentId == OSSIM_EQU_TOKEN_TILDE)
+   {
+      theCurrentId = theLexer->yylex();
+
+      if(parseFactor())
+      {
+         if(theValueStack.size() > 0)
+         {
+            ossimEquValue v;
+            ossimEquValue v1 = theValueStack.top();
+            theValueStack.pop();
+            
+            applyOp(ossimUnaryOpOnesComplement(),
+                    v,
+                    v1);
+            
+            theValueStack.push(v);
+         }
+         else
+         {
+            result = false;
+         }
+
+         result = true;
+      }
+      else
+      {
+         result = false;
+      }
+   }
+   return result;
+}
+
+bool ossimEquationCombiner::parseFactor()
+{
+   bool result = false;
+
+   switch(theCurrentId)
+   {
+   case OSSIM_EQU_TOKEN_CONSTANT:
+   {
+      ossimEquValue v;
+
+      v.type = OSSIM_EQU_DOUBLE_TYPE;
+      v.d.doubleValue = atof(theLexer->YYText());
+      theValueStack.push(v);
+      
+      theCurrentId = theLexer->yylex();
+      
+      result =  true;
+      break;
+   }
+   case OSSIM_EQU_TOKEN_PI:
+   {
+      ossimEquValue v;
+
+      v.type = OSSIM_EQU_DOUBLE_TYPE;
+      v.d.doubleValue = M_PI;
+      theValueStack.push(v);
+      
+      theCurrentId = theLexer->yylex();
+      
+      result =  true;
+      break;      
+   }
+   case OSSIM_EQU_TOKEN_IMAGE_VARIABLE:
+   {
+      theCurrentId = theLexer->yylex();
+      if(theCurrentId == OSSIM_EQU_TOKEN_LEFT_ARRAY_BRACKET)
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseExpression())
+         {
+            if(!theValueStack.empty())
+            {
+               if(theValueStack.top().type == OSSIM_EQU_DOUBLE_TYPE)
+               {
+                  if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_ARRAY_BRACKET)
+                  {
+                     theCurrentId = theLexer->yylex();
+                     ossim_uint32 index = (ossim_uint32)theValueStack.top().d.doubleValue;
+                     theValueStack.pop();
+                     ossimRefPtr<ossimImageData> data = getNewImageData(index);
+                     result = true;
+                     if(data.valid())
+                     {
+                        ossimEquValue v;
+                        v.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+                        v.d.imageDataValue = data.release();
+                        theValueStack.push(v);
+
+                     }
+                     else
+                     {
+                        ossimNotify(ossimNotifyLevel_WARN)
+                           <<"Data is NULL for array operation" << endl;
+                     }
+                     result = true;
+                  }
+                  else
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "Mismatched Right array bracket" << endl;
+                  }
+               }
+               else
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << "Expression between array brackets is not a number"
+                     << endl;
+               }
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "no expression within array brackets" << endl;
+            }
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Unabel to parse expression"<<endl;
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            <<"Need left array brackets to access an input source"<<endl;
+      }
+      
+      break;
+   }
+   case OSSIM_EQU_TOKEN_LEFT_PAREN:
+   {
+      theCurrentId = theLexer->yylex();
+      if(parseExpression())
+      {
+         if(theCurrentId == OSSIM_EQU_TOKEN_RIGHT_PAREN)
+         {
+            result       =  true;
+            theCurrentId = theLexer->yylex();
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Right parenthesis missing" << endl;
+            result = false;
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Unable to parse expression within parenthesis" << endl;
+         result = false;
+      }
+      
+      break;
+   }
+   }
+   if(!result) result = parseUnaryFactor();
+   
+   if(!result) result = parseStdFuncs();
+   
+   return result;
+}
+
+bool ossimEquationCombiner::parseRestOfTerm()
+{
+   //---
+   // Parse the following rule:
+   // RestOfTerm: * Factor RestOfTerm | / Factor RestOfTerm |
+   // ^ Factor RestOfTerm
+   //---
+   bool result = true;
+   
+   switch(theCurrentId)
+   {
+      case OSSIM_EQU_TOKEN_MULT:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpMul(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "Multiplication requires two arguments" << endl;
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+         break;
+      }
+      case OSSIM_EQU_TOKEN_DIV:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpDiv(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_XOR:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpXor(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_AMPERSAND:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpAnd(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_OR_BAR:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpOr(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_MOD:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpMod(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_POWER:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpPow(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+         break;
+      }
+      case OSSIM_EQU_TOKEN_BEQUAL:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpEqual(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_BGREATER:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpGreater(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_BGREATEROREQUAL:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpGreaterOrEqual(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_BLESS:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpLess(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_BLESSOREQUAL:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpLessOrEqual(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+      case OSSIM_EQU_TOKEN_BDIFFERENT:
+      {
+         theCurrentId = theLexer->yylex();
+         if(parseFactor())
+         {
+            if(theValueStack.size() > 1)
+            {
+               ossimEquValue v;
+            
+               ossimEquValue v2 = theValueStack.top();
+               theValueStack.pop();
+               ossimEquValue v1 = theValueStack.top();
+               theValueStack.pop();
+            
+               applyOp(ossimBinaryOpDifferent(),
+                       v,
+                       v1,
+                       v2);
+            
+               theValueStack.push(v);
+            }
+            else
+            {
+               result = false;
+            }
+            if(result)
+            {
+               result = parseRestOfTerm();
+            }
+         }
+         else
+         {
+            result = false;
+         }
+
+         break;
+      }
+
+   }
+   
+   return result;
+}
+
+bool ossimEquationCombiner::parseTerm()
+{
+   // parse the following rule:
+   //
+   // Term : Factor RestOfTerm
+   
+   bool result = false;
+
+   result = parseFactor();
+   
+   if(result)
+   {
+      result = parseRestOfTerm();
+   }
+   
+   return result;
+}
+
+bool ossimEquationCombiner::parseRestOfExp()
+{
+   // parse the following rule:
+   // RestOfExpression : + Term RestOfExpression | - Term RestOfExpression | epsilon
+   //
+   bool result = true;
+   
+   if(theCurrentId == OSSIM_EQU_TOKEN_PLUS)
+   {
+      theCurrentId = theLexer->yylex();
+      if(parseTerm())
+      {
+
+         if(theValueStack.size() > 1)
+         {
+            ossimEquValue v;
+            
+            ossimEquValue v2 = theValueStack.top();
+            theValueStack.pop();
+            ossimEquValue v1 = theValueStack.top();
+            theValueStack.pop();
+            
+            
+            applyOp(ossimBinaryOpAdd(),
+                    v,
+                    v1,
+                    v2);              
+            
+            theValueStack.push(v);
+         }
+         else
+         {
+            result = false;
+         }
+         if(result)
+         {
+            result = parseRestOfExp();
+         }
+      }
+      else
+      {
+        result =  false;
+      }
+   }
+   else if(theCurrentId == OSSIM_EQU_TOKEN_MINUS)
+   {
+      theCurrentId = theLexer->yylex();
+      if(parseTerm())
+      {
+         if(theValueStack.size() > 1)
+         {
+            ossimEquValue v;
+            
+            ossimEquValue v2 = theValueStack.top();
+            theValueStack.pop();
+            ossimEquValue v1 = theValueStack.top();
+            theValueStack.pop();
+            
+            applyOp(ossimBinaryOpSub(),
+                    v,
+                    v1,
+                    v2);
+            
+            theValueStack.push(v);
+         }
+         else
+         {
+            result = false;
+         }
+         if(result)
+         {
+            result = parseRestOfExp();
+         }
+      }
+      else
+      {
+         result =  false;
+      }
+   }
+   
+   return result;
+}
+
+ossimRefPtr<ossimImageData> ossimEquationCombiner::getImageData(ossim_uint32 index)
+{
+   ossimRefPtr<ossimImageData> result;
+   ossimConnectableObject* obj = getInput(index);
+   
+   if(obj)
+   {
+      theCastFilter->connectMyInputTo(0, obj);
+      result= (theCastFilter->getTile(theTile->getImageRectangle(),
+                                      theCurrentResLevel));
+      
+      if(result.valid())
+      {
+         result->setMinPix(theTile->getMinPix(), theTile->getNumberOfBands());
+         result->setMaxPix(theTile->getMaxPix(), theTile->getNumberOfBands());
+      }
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimImageData> ossimEquationCombiner::getNewImageData(
+   ossim_uint32 index)
+{
+   ossimRefPtr<ossimImageData> result = getImageData(index);
+
+   if(result.valid())
+   {
+      if(result->getBuf())
+      {
+         result = (ossimImageData*)result->dup();
+      }
+   }
+
+   return result;
+}
+
+bool ossimEquationCombiner::parseExpression()
+{
+   // parse the following rule:
+   // expression : Term ResOfExpression
+   //
+   
+   bool result = false;
+   
+   if(parseTerm())
+   {
+      result =  parseRestOfExp();
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimImageData> ossimEquationCombiner::parseEquation()
+{
+   ostringstream s;
+
+   s << theEquation;
+
+   istringstream inS(s.str());
+   theLexer->switch_streams(&inS, &ossimNotify(ossimNotifyLevel_WARN));
+
+   theCurrentId = theLexer->yylex();
+
+   while(theCurrentId)
+   {
+      if(!parseExpression())
+      {
+         break;
+      }
+   }
+
+   if(!theValueStack.empty())
+   {
+      assignValue();
+      theTile->validate();
+      clearStacks();
+   }
+   
+   return theTile;
+}    
+
+bool ossimEquationCombiner::applyClamp(ossimImageData* &result,
+                                       const vector<ossimEquValue>& argList)
+{
+   if(result)
+   {
+      // Delete the object indirectly through an ossimRefPtr.
+      ossimRefPtr<ossimImageData> id = result;
+      id = NULL;
+      result = (ossimImageData*) NULL;
+   }
+   if(argList.size() <3)
+   {
+      return false;
+   }
+
+   if(argList[0].type == OSSIM_EQU_DOUBLE_TYPE)
+   {
+      return false;
+   }
+   else if( (argList[1].type == OSSIM_EQU_DOUBLE_TYPE)&&
+            (argList[2].type == OSSIM_EQU_DOUBLE_TYPE))
+   {
+      result = argList[0].d.imageDataValue;
+      
+      if(argList[0].d.imageDataValue)
+      {
+         ossimDataObjectStatus status = result->getDataObjectStatus();
+         if((status != OSSIM_NULL) &&
+            (status != OSSIM_EMPTY))
+         {
+            double minValue = argList[1].d.doubleValue;
+            double maxValue = argList[2].d.doubleValue;
+            
+            if(minValue > maxValue)
+            {
+               std::swap(minValue, maxValue);
+            }
+            
+            int band   = 0;
+            int offset = 0;
+            
+            int upperBoundBand   = result->getNumberOfBands();
+            int offsetUpperBound = result->getWidth()*result->getHeight();
+
+            if(status == OSSIM_PARTIAL)
+            {
+               for(band = 0; band < upperBoundBand; ++band)
+               {
+                  double np = static_cast<double>(result->getNullPix(band));
+                  double *buf = static_cast<double*>(result->getBuf(band));
+                  for(offset = 0; offset < offsetUpperBound; ++ offset)
+                  {
+                     if( *buf != np )
+                     {
+                        if( (*buf) < minValue) *buf = minValue;
+                        else if( (*buf) >maxValue) *buf = maxValue;
+                     }
+                     ++buf;
+                  }
+               }
+            }
+            else
+            {
+               for(band = 0; band < upperBoundBand; ++band)
+               {
+                  double *buf = static_cast<double*>(result->getBuf(band));
+                  for(offset = 0; offset < offsetUpperBound; ++ offset)
+                  {
+                     if( (*buf) < minValue) *buf = minValue;
+                     else if( (*buf) >maxValue) *buf = maxValue;
+                     ++buf;
+                  }
+               }
+            }
+         }
+      }
+         
+      return true;
+   }
+   return false;
+}
+
+bool ossimEquationCombiner::applyConvolution(ossimImageData* &result,
+                                             const vector<ossimEquValue>& argList)
+{
+   if(result)
+   {
+      // Delete the object indirectly through an ossimRefPtr.
+      ossimRefPtr<ossimImageData> id = result;
+      id = NULL;
+      result = (ossimImageData*) NULL;
+   }
+   if(argList.size() <4) return false;
+   
+   for(ossim_uint32 i = 0; i < argList.size(); ++i)
+   {
+      if(argList[i].type != OSSIM_EQU_DOUBLE_TYPE)
+      {
+         return false;
+      }
+   }
+
+   ossim_uint32 index = (ossim_uint32)argList[0].d.doubleValue;
+   int rows = (int)argList[1].d.doubleValue;
+   int cols = (int)argList[2].d.doubleValue;
+   
+   if((rows*cols) != (int)(argList.size()-3))
+   {
+      return false;
+   }
+   
+   NEWMAT::Matrix m(rows,cols);
+
+    int count = 3;
+    for(int r = 0; r< rows;++r)
+    {
+       for(int c=0;c<cols;++c)
+       {
+          m[r][c] = argList[count].d.doubleValue;
+          ++count;
+       }
+    }
+   ossimConnectableObject* obj = getInput(index);
+   if(obj)
+   {
+      ossimRefPtr<ossimConvolutionSource> conv = new ossimConvolutionSource(NULL, m);
+
+      conv->connectMyInputTo(0, obj);
+      theCastFilter->connectMyInputTo(0, conv.get());
+      
+      ossimRefPtr<ossimImageData> tempData =
+         theCastFilter->getTile(theTile->getImageRectangle(),
+                                theCurrentResLevel);
+      if(tempData.valid())
+      {
+         result = (ossimImageData*)tempData->dup();
+      }
+      else
+      {
+         result = (ossimImageData*)theTile->dup();
+      }
+      conv->disconnect();
+      conv = 0;
+   }
+   if(result)
+   {
+      return true;
+   }
+
+   return false;
+}
+
+bool ossimEquationCombiner::applyBlurr(ossimImageData* &result,
+                                       const vector<ossimEquValue>& argList)
+{
+   if(result)
+   {
+      // Delete the object indirectly through an ossimRefPtr.
+      ossimRefPtr<ossimImageData> id = result;
+      id = NULL;
+      result = (ossimImageData*) NULL;
+   }
+   if(argList.size() !=3) return false;
+   
+   for(ossim_uint32 i = 0; i < argList.size(); ++i)
+   {
+      if(argList[i].type != OSSIM_EQU_DOUBLE_TYPE)
+      {
+         return false;
+      }
+   }
+
+   ossim_uint32 index = (ossim_uint32)argList[0].d.doubleValue;
+   int rows = (int)argList[1].d.doubleValue;
+   int cols = (int)argList[2].d.doubleValue;
+   
+   NEWMAT::Matrix m(rows, cols);
+
+   m = 1.0/(rows*cols);
+
+   ossimConnectableObject* obj = getInput(index);
+   if(obj)
+   {
+      ossimRefPtr<ossimConvolutionSource> conv = new ossimConvolutionSource(NULL,
+                                                                m);
+
+      conv->connectMyInputTo(0, obj);
+      theCastFilter->connectMyInputTo(0, conv.get());
+      theCastFilter->initialize();
+
+      ossimRefPtr<ossimImageData> tempData =
+         theCastFilter->getTile(theTile->getImageRectangle(),
+                                theCurrentResLevel);
+      if(tempData.valid())
+      {
+         result = (ossimImageData*)tempData->dup();
+      }
+      conv->disconnect();
+      conv = 0;
+   }
+
+   if(result)
+   {
+      return true;
+   }
+
+   return false;
+}
+
+bool ossimEquationCombiner::applyShift(ossimImageData* &result,
+                                       const vector<ossimEquValue>& argList)
+{
+   if(result)
+   {
+      // Delete the object indirectly through an ossimRefPtr.
+      ossimRefPtr<ossimImageData> id = result;
+      id = NULL;
+      result = (ossimImageData*) NULL;
+   }
+   if(argList.size() !=3) return false;
+   
+   for(ossim_uint32 i = 0; i < argList.size(); ++i)
+   {
+      if(argList[i].type != OSSIM_EQU_DOUBLE_TYPE)
+      {
+         return false;
+      }
+   }
+
+   ossim_uint32 index = (ossim_uint32)argList[0].d.doubleValue;
+   int x = (int)argList[1].d.doubleValue;
+   int y = (int)argList[2].d.doubleValue;
+
+   ossimConnectableObject* obj = getInput(index);
+   if(obj)
+   {
+      ossimRefPtr<ossimSubImageTileSource> shiftSource =
+         new ossimSubImageTileSource(NULL, ossimIpt(x, y));
+
+      shiftSource->connectMyInputTo(0, obj);
+      theCastFilter->connectMyInputTo(0, shiftSource.get());
+
+       ossimRefPtr<ossimImageData> tempData =
+          theCastFilter->getTile(theTile->getImageRectangle(),
+                                 theCurrentResLevel);
+       if(tempData.valid())
+       {
+          result = (ossimImageData*)tempData->dup();
+       }
+      shiftSource->disconnect();
+      shiftSource = 0;
+   }
+
+   if(result)
+   {
+      return true;
+   }
+
+   return false;
+}
+
+bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
+                                    ossimEquValue& result,
+                                    ossimEquValue& v1,
+                                    ossimEquValue& v2)
+{
+   bool returnValue = true;
+   
+   if(v1.type == OSSIM_EQU_DOUBLE_TYPE)
+   {
+      if(v2.type == OSSIM_EQU_DOUBLE_TYPE)
+      {
+         result.type = OSSIM_EQU_DOUBLE_TYPE;
+         result.d.doubleValue = op.apply(v1.d.doubleValue, v2.d.doubleValue);
+      }
+      else if(v2.type == OSSIM_EQU_IMAGE_DATA_TYPE)
+      {
+         returnValue = applyOp(op,
+                               v1.d.doubleValue,
+                               v2.d.imageDataValue);
+         
+         result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+         result.d.imageDataValue = v2.d.imageDataValue;
+      }
+      else
+      {
+         returnValue = false;
+      }
+   }
+   else if(v1.type == OSSIM_EQU_IMAGE_DATA_TYPE)
+   {
+      if(v2.type == OSSIM_EQU_DOUBLE_TYPE)
+      {
+         
+         returnValue = applyOp(op,
+                               v1.d.imageDataValue,
+                               v2.d.doubleValue);
+         
+         result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+         result.d.imageDataValue = v1.d.imageDataValue;
+         returnValue = true;
+      }
+      else if(v2.type == OSSIM_EQU_IMAGE_DATA_TYPE)
+      {
+         returnValue = applyOp(op,
+                               v1.d.imageDataValue,
+                               v2.d.imageDataValue);
+         result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+         result.d.imageDataValue = v1.d.imageDataValue;
+
+         // Delete the object indirectly through an ossimRefPtr.
+         ossimRefPtr<ossimImageData> id = v2.d.imageDataValue;
+         id = NULL;
+         v2.d.imageDataValue = (ossimImageData*)NULL;
+         returnValue = true;
+      }
+      else
+      {
+         returnValue = false;
+      }
+   }
+   else
+   {
+      returnValue = false;
+   }
+   
+   return returnValue;
+}
+
+bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
+                                    ossimImageData* v1,
+                                    double          v2)
+{   
+   double* buf = static_cast<double*>(v1->getBuf());
+   if(!buf) return true;
+   ossimDataObjectStatus status = v1->getDataObjectStatus();
+
+   if(status == OSSIM_EMPTY || status == OSSIM_NULL)
+   {
+      return true;
+   }
+
+   if(status == OSSIM_FULL )
+   {
+      ossim_uint32 size = v1->getSize();
+      double value = (static_cast<double>(v2));
+     
+      for(ossim_uint32 i = 0; i < size; ++i)
+      {
+         *buf = (double)op.apply(*buf, value);
+         ++buf;
+      }
+   }
+   else
+   {
+      ossim_uint32 sizePerBand = v1->getSizePerBand();
+      ossim_uint32 numberOfBands = v1->getNumberOfBands();
+
+      if(numberOfBands)
+      {
+         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+         {
+            double* buf = static_cast<double*>(v1->getBuf(band));
+
+            if(buf)
+            {
+               double  np  = static_cast<double>(v1->getNullPix()[band]);
+               
+               for(ossim_uint32 offset = 0; offset < sizePerBand;++offset)
+               {
+                  if(*buf != np)
+                  {
+                     *buf = (double)op.apply(*buf, v2);
+                  }
+                  ++buf;
+               }
+            }
+         }
+      }
+   }
+   return true;
+}
+
+bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
+                                    double          v1,
+                                    ossimImageData* v2)
+{   
+   double* buf = static_cast<double*>(v2->getBuf());
+   if(!buf) return true;
+   ossimDataObjectStatus status = v2->getDataObjectStatus();
+
+   if(status == OSSIM_EMPTY || status == OSSIM_NULL)
+   {
+      return true;
+   }
+
+   if(status == OSSIM_FULL )
+   {
+      ossim_uint32 size = v2->getSize();
+      double value = (static_cast<double>(v1));
+     
+      for(ossim_uint32 i = 0; i < size; ++i)
+      {
+         *buf = (double)op.apply(value, *buf);
+         ++buf;
+      }
+   }
+   else
+   {
+      ossim_uint32 sizePerBand = v2->getSizePerBand();
+      ossim_uint32 numberOfBands = v2->getNumberOfBands();
+
+      if(numberOfBands)
+      {
+         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+         {
+            double* buf = static_cast<double*>(v2->getBuf(band));
+
+            if(buf)
+            {
+               double  np  = static_cast<double>(v2->getNullPix()[band]);
+               
+               for(ossim_uint32 offset = 0; offset < sizePerBand; ++offset)
+               {
+                  if(*buf != np)
+                  {
+                     *buf = (double)op.apply((double)v1, *buf);
+                  }
+                  ++buf;
+               }
+            }
+         }
+      }
+   }
+   
+   return true;
+}
+
+bool ossimEquationCombiner::applyOp(const ossimBinaryOp& op,
+                                    ossimImageData* v1,
+                                    ossimImageData* v2)
+{
+   ossim_uint32 minNumberOfBands = std::min(v1->getNumberOfBands(), v2->getNumberOfBands());
+   ossim_uint32 maxNumberOfBands = std::max(v1->getNumberOfBands(), v2->getNumberOfBands());
+   
+   ossim_uint32 size = v1->getWidth()*v1->getHeight();
+   ossimDataObjectStatus status1 = v1->getDataObjectStatus();
+   ossimDataObjectStatus status2 = v2->getDataObjectStatus();
+
+   double** bandV1   = new double*[maxNumberOfBands];
+   double** bandV2   = new double*[maxNumberOfBands];
+   double* bandV1Np  = new double[maxNumberOfBands];
+   double* bandV2Np  = new double[maxNumberOfBands];
+   ossim_uint32 band = 0;
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      bandV1[band]   = (double*)v1->getBuf(band);
+      bandV2[band]   = (double*)v2->getBuf(band);
+      bandV1Np[band] = (double)v1->getNullPix(band);
+      bandV2Np[band] = (double)v2->getNullPix(band);
+   }
+   if(v1->getNumberOfBands() < v2->getNumberOfBands())
+   {
+      for(band = 0; band < maxNumberOfBands; ++band)
+      {
+         bandV1[band]   = (double*)v1->getBuf(minNumberOfBands-1);
+         bandV2[band]   = (double*)v2->getBuf(band);
+         bandV1Np[band] = (double)v1->getNullPix(minNumberOfBands-1);
+         bandV2Np[band] = (double)v2->getNullPix(band);
+      }
+   }
+   else if(v2->getNumberOfBands() < v1->getNumberOfBands())
+   {
+      for(band = 0; band < maxNumberOfBands; ++band)
+      {
+         bandV1[band]   = (double*)v1->getBuf(band);
+         bandV2[band]   = (double*)v2->getBuf(minNumberOfBands-1);
+         bandV1Np[band] = (double)v1->getNullPix(band);
+         bandV2Np[band] = (double)v2->getNullPix(minNumberOfBands-1);
+      }
+   }
+
+   if(status1 == OSSIM_EMPTY)
+   {
+      if(status2 == OSSIM_FULL)
+      {
+         for(band = 0; band < maxNumberOfBands; ++band)
+         {
+            double* buf1 = bandV1[band];
+            double* buf2 = bandV2[band];
+            
+            for(ossim_uint32 i = 0; i < size; ++i)
+            {
+               *buf1 = *buf2;
+               ++buf1;
+               ++buf2;
+            }
+         }
+      }
+      else if(status2 == OSSIM_PARTIAL)
+      {
+         for(band = 0; band < maxNumberOfBands; ++band)
+         {
+            double* buf1 = bandV1[band];
+            double* buf2 = bandV2[band];
+            double  nullPix2 = bandV2Np[band];
+            for(ossim_uint32 i = 0; i < size; ++i)
+            {
+               if(*buf2 != nullPix2)
+               {
+                  *buf1 = *buf2;
+               }
+               ++buf1;
+               ++buf2;
+            }
+         }
+      }
+      v1->setDataObjectStatus(status2);
+   }
+   else if((status1 == OSSIM_FULL)&&
+           (status2 == OSSIM_FULL))
+   { 
+      for(band = 0; band < maxNumberOfBands; ++band)
+      {
+         double* buf1 = bandV1[band];
+         double* buf2 = bandV2[band];
+         
+         for(ossim_uint32 i = 0; i < size; ++i)
+         {
+            *buf1 = op.apply(*buf1, *buf2);
+            ++buf1;
+            ++buf2;
+         }
+      }
+   }
+   else if((status1 == OSSIM_FULL)&&
+           (status2 == OSSIM_PARTIAL))
+   {
+      for(band = 0; band < maxNumberOfBands; ++band)
+      {
+         double* buf1 = bandV1[band];
+         double* buf2 = bandV2[band];
+         double  nullPix2 = bandV2Np[band];
+         for(ossim_uint32 i = 0; i < size; ++i)
+         {
+            if(*buf2 != nullPix2)
+            {
+               *buf1 = op.apply(*buf1, *buf2);
+            }
+               
+            ++buf1;
+            ++buf2;
+         }
+      }
+   }
+   else if((status1 == OSSIM_PARTIAL)&&
+           (status2 == OSSIM_FULL))
+   {
+      for(band = 0; band < maxNumberOfBands; ++band)
+      {
+         double* buf1 = bandV1[band];
+         double* buf2 = bandV2[band];
+         double  nullPix1 = bandV1Np[band];
+         for(ossim_uint32 i = 0; i < size; ++i)
+         {
+            if(*buf1 != nullPix1)
+            {
+               *buf1 = op.apply(*buf1, *buf2);
+            }
+               
+            ++buf1;
+            ++buf2;
+         }
+      }
+   }
+   else if((status1 == OSSIM_PARTIAL)&&
+           (status2 == OSSIM_PARTIAL))
+   {
+      for(band = 0; band < maxNumberOfBands; ++band)
+      {
+         double* buf1 = bandV1[band];
+         double* buf2 = bandV2[band];
+         double  nullPix1 = bandV1Np[band];
+         double  nullPix2 = bandV2Np[band];
+         for(ossim_uint32 i = 0; i < size; ++i)
+         {
+            if((*buf1 != nullPix1)&&
+               (*buf2 != nullPix2))
+            {
+               *buf1 = op.apply(*buf1, *buf2);
+            }
+               
+            ++buf1;
+            ++buf2;
+         }
+      }
+   }
+
+   delete [] bandV1;
+   delete [] bandV2;
+   delete [] bandV1Np;
+   delete [] bandV2Np;
+   
+   return true;
+}
+
+
+bool ossimEquationCombiner::applyOp(const ossimUnaryOp& op,
+                                    ossimEquValue& result,
+                                    ossimEquValue& v)
+{
+   bool returnValue = true;
+   
+   if(v.type == OSSIM_EQU_DOUBLE_TYPE)
+   {
+      result.type = OSSIM_EQU_DOUBLE_TYPE;
+      result.d.doubleValue = op.apply(v.d.doubleValue);
+   }
+   else if(v.type == OSSIM_EQU_IMAGE_DATA_TYPE)
+   {
+      returnValue = applyOp(op,
+                            v.d.imageDataValue);
+      result.type = OSSIM_EQU_IMAGE_DATA_TYPE;
+      result.d.imageDataValue = v.d.imageDataValue;
+      returnValue = true;
+   }
+   else
+   {
+      returnValue = false;
+   }
+   
+   return returnValue;
+}
+
+bool ossimEquationCombiner::applyOp(const ossimUnaryOp& op,
+                                    ossimImageData* v)
+{   
+   double* buf = static_cast<double*>(v->getBuf());
+   if(!buf) return true;
+   ossimDataObjectStatus status = v->getDataObjectStatus();
+
+   if(status == OSSIM_EMPTY || status == OSSIM_NULL)
+   {
+      return true;
+   }
+
+   if(status == OSSIM_FULL )
+   {
+      ossim_uint32 size = v->getSize();
+     
+      for(ossim_uint32 i = 0; i < size; ++i)
+      {
+         *buf = (double)op.apply(*buf);
+         ++buf;
+      }
+   }
+   else
+   {
+      ossim_uint32 sizePerBand   = v->getSizePerBand();
+      ossim_uint32 numberOfBands = v->getNumberOfBands();
+
+      if(numberOfBands)
+      {
+         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+         {
+            double* buf = static_cast<double*>(v->getBuf(band));
+
+            if(buf)
+            {
+               double  np  = static_cast<double>(v->getNullPix()[band]);
+               
+               for(ossim_uint32 offset = 0; offset < sizePerBand;++offset)
+               {
+                  if(*buf != np)
+                  {
+                     *buf = (double)op.apply(*buf);
+                  }
+                  ++buf;
+               }
+            }
+         }
+      }
+   }
+   
+   return true;
+}
+
+bool ossimEquationCombiner::saveState(ossimKeywordlist& kwl,
+                                      const char* prefix)const
+{
+   ossimString outputScalarType =
+      ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType);
+   
+   kwl.add(prefix,
+           EQUATION_KW,
+           theEquation.c_str(),
+           true);
+
+   kwl.add(prefix,
+           "output_scalar_type",
+           outputScalarType.c_str(),
+           true);
+   
+   return ossimImageCombiner::saveState(kwl,
+                                        prefix);
+}
+
+bool ossimEquationCombiner::loadState(const ossimKeywordlist& kwl,
+                                      const char* prefix)
+{
+   const char* equ    = kwl.find(prefix, EQUATION_KW);
+   const char* scalar = kwl.find(prefix, "output_scalar_type");
+   
+   bool result = ossimImageCombiner::loadState(kwl,
+                                               prefix);
+   
+   if(equ)
+   {
+      theEquation = equ;
+   }
+
+   if(scalar)
+   {      
+      setOutputScalarType(ossimScalarTypeLut::instance()->
+                          getScalarTypeFromString(scalar));
+   }
+
+   return result;
+}
+
diff --git a/src/imaging/ossimErosionFilter.cpp b/src/imaging/ossimErosionFilter.cpp
new file mode 100644
index 0000000..2882caf
--- /dev/null
+++ b/src/imaging/ossimErosionFilter.cpp
@@ -0,0 +1,258 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/imaging/ossimErosionFilter.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <vector>
+#include <numeric>
+
+using namespace std;
+
+RTTI_DEF1(ossimErosionFilter, "ossimErosionFilter", ossimImageSourceFilter);
+
+// Keywords used throughout.
+static const ossimString WINDOW_SIZE_KW = "window_size";
+
+ossimErosionFilter::ossimErosionFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theTile(0),
+    theTempTile(0),
+    theWindowSize(3)
+{
+   setDescription(ossimString("Dilation Filter"));
+}
+
+ossimErosionFilter::~ossimErosionFilter()
+{
+}
+
+void ossimErosionFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   theTile = NULL;
+}
+
+ossimRefPtr<ossimImageData> ossimErosionFilter::getTile(const ossimIrect& rect,
+                                                        ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled())
+      return ossimImageSourceFilter::getTile(rect, resLevel);
+
+   ossimRefPtr<ossimImageData> inputData;
+   ossim_uint32 halfSize = getWindowSize()>>1;
+   ossimIrect requestRect(rect.ul().x - halfSize,
+                          rect.ul().y - halfSize,
+                          rect.lr().x + halfSize,
+                          rect.lr().y + halfSize);
+
+   inputData =  ossimImageSourceFilter::getTile(requestRect, resLevel);
+
+   if(!inputData.valid() || !inputData->getBuf())
+      return inputData;
+
+   vector<ossimIpt> viv;
+   ossimImageSourceFilter::getValidImageVertices(viv, OSSIM_CLOCKWISE_ORDER, resLevel);
+   theValidImagePoly = ossimPolygon(viv);
+
+   if(!theTile.valid())
+   {
+      theTile = (ossimImageData*)inputData->dup();
+      theTile->setImageRectangle(rect);
+   }
+   else
+   {
+      theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
+   }
+
+   switch(inputData->getScalarType())
+   {
+      case OSSIM_UINT8:
+         doErosion(ossim_uint8(0), inputData);
+         break;
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+         doErosion(ossim_uint16(0), inputData);
+         break;
+      case OSSIM_SINT16:
+         doErosion(ossim_sint16(0), inputData);
+         break;
+      case OSSIM_UINT32:
+         doErosion(ossim_uint32(0), inputData);
+         break;
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+         doErosion(ossim_float32(0), inputData);
+         break;
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+         doErosion(ossim_float64(0), inputData);
+         break;
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimErosionFilter::applyFilter WARNING:\n"
+            << "Unhandled scalar type!" << endl;
+      }
+   }
+   return theTile;
+}
+
+template <class T>
+void ossimErosionFilter::doErosion(T /* scalarType */, ossimRefPtr<ossimImageData>& inputData)
+{
+   ossimDataObjectStatus status = inputData->getDataObjectStatus();
+
+   if ((status == OSSIM_FULL) || (status == OSSIM_EMPTY))
+   {
+      // Nothing to do just copy the tile.
+      theTile->loadTile(inputData.get());
+      return;
+   }
+
+   ossim_int32 halfWindow = (ossim_int32)(theWindowSize >> 1);
+   ossim_int32 x, y, kernelX, kernelY;   
+   ossim_int32 iw = (ossim_int32)inputData->getWidth();
+   ossim_int32 ih = (ossim_int32)inputData->getHeight();
+   ossim_int32 ow = (ossim_int32)theTile->getWidth();
+   ossim_int32 oh = (ossim_int32)theTile->getHeight();
+   ossim_uint32 numBands = ossim::min(theTile->getNumberOfBands(), inputData->getNumberOfBands());
+
+   // It may be that the input rect is the same size as the output (i.e., the tile bounds aren't
+   // expanded in the input's request to permit full kernels for output edge pixels:
+   ossim_uint32 i_offset = 0;
+   ossim_int32 delta = (ossim_int32)((iw - ow) >> 1);
+   ossim_int32 xi, yi;
+   if (delta > 0)
+      i_offset = (ossim_uint32) halfWindow*(iw + 1);
+
+   ossimIpt tile_ul (theTile->getImageRectangle().ul());
+   vector<double> values;
+   for(ossim_uint32 bandIdx = 0; bandIdx < numBands; ++bandIdx)
+   {
+      T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+      T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+      if (!inputBuf || !outputBuf)
+      {
+         return; // Shouldn't happen...
+      }
+
+      const T NP = (T)inputData->getNullPix(bandIdx);
+
+      for(y = 0; y < oh; ++y)
+      {
+         for(x = 0; x < ow; ++x)
+         {
+            bool null_found = true;
+            const T CP = *(inputBuf+i_offset);
+            ossimDpt ipt (tile_ul.x+x, tile_ul.y+y);
+
+            if ((CP != NP) && theValidImagePoly.isPointWithin(ipt))
+            {
+               // Valid pixel found, need to check neighbors for null:
+               null_found = false;
+               values.clear();
+               for(kernelY = -halfWindow; (kernelY<=halfWindow) && !null_found; ++kernelY)
+               {
+                  yi = y + kernelY + delta;
+                  if ((yi < 0) || (y > ih))
+                     continue;
+
+                  for(kernelX = -halfWindow; (kernelX<=halfWindow) && !null_found; ++kernelX)
+                  {
+                     xi = x + kernelX + delta;
+                     if ((xi < 0) || (x > iw))
+                        continue;
+
+                     T neighborPixel = *(inputBuf+kernelX+delta + (kernelY+delta)*iw);
+                     if(neighborPixel == NP)
+                     {
+                        // Found a NULL pixel:
+                        (*outputBuf) = NP;
+                        null_found = true;
+                     }
+                  }
+               }
+            }
+
+            if (null_found)
+               (*outputBuf) = NP;
+            else
+               (*outputBuf) = CP;
+
+            // Move over...
+            ++inputBuf;
+            ++outputBuf;
+
+         } // End of loop in x direction.
+
+         // Move down...
+         inputBuf += iw - ow;
+
+      }  // End of loop in y direction.
+
+   }  // End of band loop.
+
+   theTile->validate();
+
+}
+
+void ossimErosionFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property.valid())
+      return;
+
+   ossimString name = property->getName();
+
+   if (name == WINDOW_SIZE_KW)
+   {
+      theWindowSize = property->valueToString().toUInt32();
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimErosionFilter::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+   if (name == WINDOW_SIZE_KW)
+   {
+      prop = new ossimNumericProperty(WINDOW_SIZE_KW, ossimString::toString(theWindowSize), 3, 25);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimErosionFilter::getPropertyNames(vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(WINDOW_SIZE_KW);
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+}
+
+bool ossimErosionFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix, WINDOW_SIZE_KW.c_str(), theWindowSize, true);
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimErosionFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, WINDOW_SIZE_KW.c_str());
+   if (lookup)
+      theWindowSize = ossimString(lookup).toUInt32();
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
diff --git a/ossim/src/ossim/imaging/ossimEsriShapeFileInterface.cpp b/src/imaging/ossimEsriShapeFileInterface.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimEsriShapeFileInterface.cpp
rename to src/imaging/ossimEsriShapeFileInterface.cpp
diff --git a/src/imaging/ossimFeatherMosaic.cpp b/src/imaging/ossimFeatherMosaic.cpp
new file mode 100644
index 0000000..226f6d8
--- /dev/null
+++ b/src/imaging/ossimFeatherMosaic.cpp
@@ -0,0 +1,479 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimFeatherMosaic.cpp 15766 2009-10-20 12:37:09Z gpotts $
+
+#include <ossim/imaging/ossimFeatherMosaic.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimLine.h>
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceDebug("ossimFeatherMosaic:debug");
+
+RTTI_DEF1(ossimFeatherMosaic, "ossimFeatherMosaic", ossimImageMosaic);
+
+ossimFeatherMosaic::ossimFeatherMosaic()
+   :ossimImageMosaic(),
+    theInputFeatherInformation(NULL),
+    theAlphaSum(NULL),
+    theResult(NULL),
+    theFeatherInfoSize(0)
+{
+}
+
+ossimFeatherMosaic::ossimFeatherMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
+   :ossimImageMosaic(inputSources),
+    theInputFeatherInformation(NULL),
+    theAlphaSum(NULL),
+    theResult(NULL),
+    theFeatherInfoSize(0)
+{
+   initialize();
+}
+
+ossimFeatherMosaic::~ossimFeatherMosaic()
+{
+   if(theInputFeatherInformation)
+   {
+      delete [] theInputFeatherInformation;
+      theInputFeatherInformation = NULL;
+   }
+   theFeatherInfoSize = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimFeatherMosaic::getTile(const ossimIrect& tileRect,
+                                            ossim_uint32 resLevel)
+{
+   long w = tileRect.width();
+   long h = tileRect.height();
+   ossimIpt origin = tileRect.ul();
+   
+   if(!isSourceEnabled())
+   {
+      return ossimImageMosaic::getTile(tileRect, resLevel);
+   }
+   if(!theTile||!theAlphaSum||!theResult||!theInputFeatherInformation)
+   {
+      initialize();
+
+      if(!theTile||!theAlphaSum||!theResult||!theInputFeatherInformation)
+      {
+         return ossimImageMosaic::getTile(tileRect, resLevel);
+      }
+   }
+   ossim_uint32 size = getNumberOfInputs();
+   theAlphaSum->setImageRectangle(tileRect);
+   theResult->setImageRectangle(tileRect);
+   
+   if(size == 0)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   if(size == 1)
+   {
+      return ossimImageMosaic::getTile(tileRect, resLevel);
+   }
+
+   long tileW = theTile->getWidth();
+   long tileH = theTile->getHeight();
+   if((w != tileW)||
+      (h != tileH))
+   {
+      theTile->setWidth(w);
+      theTile->setHeight(h);
+      if((w*h)!=(tileW*tileH))
+      {
+         theTile->initialize();
+      }
+   }
+   theTile->setOrigin(origin);
+   theTile->makeBlank();
+      
+   switch(theTile->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         return combine(static_cast<ossim_uint8>(0),
+                        tileRect, resLevel);
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         return combine(static_cast<ossim_uint16>(0),
+                        tileRect, resLevel);
+      }
+      case OSSIM_SSHORT16:
+      {
+         return combine(static_cast<ossim_sint16>(0),
+                        tileRect, resLevel);
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         return combine(static_cast<double>(0),
+                        tileRect, resLevel);
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         return combine(static_cast<float>(0),
+                        tileRect, resLevel);
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimFeatherMosaic::getTile: error, unknown scalar type!!!"
+            << std::endl;
+      }
+   }
+   return ossimRefPtr<ossimImageData>();
+}
+
+
+template <class T> ossimRefPtr<ossimImageData> ossimFeatherMosaic::combine(
+   T,
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> currentImageData;
+   ossim_uint32 band;
+   long upperBound = theTile->getWidth()*theTile->getHeight();
+   long offset = 0;
+   long row    = 0;
+   long col    = 0;
+   long numberOfTilesProcessed = 0;
+   float *sumBand       = static_cast<float*>(theAlphaSum->getBuf());
+   float         *bandRes = NULL;
+   ossimIpt point;
+   
+   theAlphaSum->fill(0.0);
+   theResult->fill(0.0);
+   
+   T** srcBands  = new T*[theLargestNumberOfInputBands];
+   T** destBands = new T*[theLargestNumberOfInputBands];
+   ossim_uint32 layerIdx = 0;
+   currentImageData  = getNextTile(layerIdx,
+                                   0,
+                                   tileRect,
+                                   resLevel);
+   if(!currentImageData.valid())
+   {
+      delete [] srcBands;
+      delete [] destBands;
+      return currentImageData;
+   }
+   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+   }
+   // if the src is smaller than the destination in number
+   // of bands we will just duplicate the last band.
+   for(;band < theLargestNumberOfInputBands; ++band)
+   {
+      srcBands[band]  = srcBands[minNumberOfBands - 1];
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+   }
+
+   // most of the time we will not overlap so let's
+   // copy the first tile into destination and check later.
+   //
+   for(band = 0; band < theTile->getNumberOfBands();++band)
+   {
+      T* destBand = destBands[band];
+      T* srcBand  = srcBands[band];
+      if(destBand&&srcBand)
+      {
+         for(offset = 0; offset < upperBound;++offset)
+         {
+            *destBand = *srcBand;
+            ++srcBand; ++destBand;
+         }
+      }
+   }
+   theTile->setDataObjectStatus(currentImageData->getDataObjectStatus());
+
+   while(currentImageData.valid())
+   {
+      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
+      point = currentImageData->getOrigin();
+      long h = (long)currentImageData->getHeight();
+      long w = (long)currentImageData->getWidth();
+      if( (currentStatus != OSSIM_EMPTY) &&
+          (currentStatus != OSSIM_NULL))
+      {
+         ++numberOfTilesProcessed;
+         offset = 0;
+         minNumberOfBands = currentImageData->getNumberOfBands();
+         for(band = 0; band < minNumberOfBands; ++band)
+         {
+            srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
+         }
+         // if the src is smaller than the destination in number
+         // of bands we will just duplicate the last band.
+         for(;band < theLargestNumberOfInputBands; ++band)
+         {
+            srcBands[band]  = srcBands[minNumberOfBands - 1];
+         }
+          if(currentStatus == OSSIM_PARTIAL)
+          {
+            for(row = 0; row < h; ++row)
+            {
+               for(col = 0; col < w; ++col)
+               {
+                  if(!currentImageData->isNull(offset))
+                  {
+                     double weight = computeWeight(layerIdx,
+                                                   ossimDpt(point.x+col,
+                                                            point.y+row));
+                     
+                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
+                     {
+                        bandRes = static_cast<float*>(theResult->getBuf(band));
+                        bandRes[offset] += (srcBands[band][offset]*weight);
+                     }
+                     sumBand[offset] += weight;
+                  }
+                  ++offset;
+               }
+            }
+         }
+         else
+         {
+            offset = 0;
+            
+            for(row = 0; row < h; ++row)
+            {
+               for(col = 0; col < w; ++col)
+               {
+                     double weight = computeWeight(layerIdx,
+                                                   ossimDpt(point.x+col,
+                                                            point.y+row));
+                     
+                     for(band = 0; band < theLargestNumberOfInputBands; ++band)
+                     {
+                        bandRes     = static_cast<float*>(theResult->getBuf(band));
+                        
+                        bandRes[offset] += (srcBands[band][offset]*weight);
+                     }
+                     sumBand[offset] += weight;
+                     ++offset;
+               }
+            }
+         }
+      }
+      currentImageData = getNextTile(layerIdx, tileRect, resLevel);
+   }
+   upperBound = theTile->getWidth()*theTile->getHeight();
+
+   if(numberOfTilesProcessed > 1)
+   {
+      const double* minPix = theTile->getMinPix();
+      const double* maxPix = theTile->getMaxPix();
+      const double* nullPix= theTile->getNullPix();
+      for(offset = 0; offset < upperBound;++offset)
+      {
+         for(band = 0; band < theTile->getNumberOfBands();++band)
+         {
+            T* destBand      = static_cast<T*>(theTile->getBuf(band));
+            float* weightedBand = static_cast<float*>(theResult->getBuf(band));
+
+            // this should be ok to test 0.0 instead of
+            // FLT_EPSILON range for 0 since we set it.
+            if(sumBand[offset] != 0.0)
+            {            
+               weightedBand[offset] = (weightedBand[offset])/sumBand[offset];
+               if(weightedBand[offset]<minPix[band])
+               {
+                  weightedBand[offset] = minPix[band];   
+               }
+               else if(weightedBand[offset] > maxPix[band])
+               {
+                  weightedBand[offset] = maxPix[band];                   
+               }
+            }
+            else
+            {
+               weightedBand[offset] = nullPix[band];
+            }
+            destBand[offset] = static_cast<T>(weightedBand[offset]);
+         }
+      }
+      theTile->validate();
+   }
+
+   delete [] srcBands;
+   delete [] destBands;
+
+   return theTile;
+}
+
+double ossimFeatherMosaic::computeWeight(long index,
+                                         const ossimDpt& point)const
+{
+   ossimFeatherInputInformation& info = theInputFeatherInformation[index];
+   double result = 0.0;
+   ossimDpt delta = point-info.theCenter;
+   
+   double length1 = fabs(delta.x*info.theAxis1.x + delta.y*info.theAxis1.y)/info.theAxis1Length;
+   double length2 = fabs(delta.x*info.theAxis2.x + delta.y*info.theAxis2.y)/info.theAxis2Length;
+
+   if(length1 > length2)
+   {
+      result = (1.0 - length1);
+   }
+   else
+   {
+      result = (1.0 - length2);
+   }
+   if(result < 0) result = 0;
+   
+   return result;
+}
+
+void ossimFeatherMosaic::initialize()
+{
+   ossimImageMosaic::initialize();
+
+   allocate();
+   if(theTile.valid())
+   {
+      theAlphaSum = new ossimImageData(this,
+                                       OSSIM_FLOAT,
+                                       1,
+                                       theTile->getWidth(),
+                                       theTile->getHeight());
+      theResult = new ossimImageData(this,
+                                     OSSIM_FLOAT,
+                                     theLargestNumberOfInputBands,
+                                     theTile->getWidth(),
+                                     theTile->getHeight());
+      theAlphaSum->initialize();
+      theResult->initialize();
+   }
+   std::vector<ossimIpt> validVertices;
+   if(!getNumberOfInputs()) return;
+
+   if(theInputFeatherInformation)
+   {
+      delete [] theInputFeatherInformation;
+      theInputFeatherInformation = NULL;
+   }
+   theFeatherInfoSize = getNumberOfInputs();
+   theInputFeatherInformation = new ossimFeatherInputInformation[theFeatherInfoSize];
+   for(long index = 0; index < theFeatherInfoSize; ++ index)
+   {
+      validVertices.clear();
+      ossimImageSource* temp = PTR_CAST(ossimImageSource, getInput(index));
+      if(temp)
+      {
+         temp->getValidImageVertices(validVertices, OSSIM_CLOCKWISE_ORDER);
+         theInputFeatherInformation[index].setVertexList(validVertices);
+      }
+   }
+}
+
+
+ossimFeatherMosaic::ossimFeatherInputInformation::ossimFeatherInputInformation(const std::vector<ossimIpt>& validVertices)
+{
+   setVertexList(validVertices);
+}
+
+
+void ossimFeatherMosaic::ossimFeatherInputInformation::setVertexList(const std::vector<ossimIpt>& validVertices)
+{
+   const char* MODULE = "ossimFeatherMosaic::ossimFeatherInputInformation::setVertexList()";
+   
+   theValidVertices = validVertices;
+
+   theCenter       = ossimDpt(0,0);
+   theAxis1        = ossimDpt(1, 0);
+   theAxis2        = ossimDpt(0, 1);
+   theAxis1Length  = 1;
+   theAxis2Length  = 1;
+
+   double xSum=0.0, ySum=0.0;
+   ossim_uint32 upperBound = (ossim_uint32)validVertices.size();
+   if(upperBound)
+   {
+      for(ossim_uint32 index = 0; index < upperBound; ++index)
+      {
+         xSum += validVertices[index].x;
+         ySum += validVertices[index].y;
+      }
+
+      theCenter.x = xSum/upperBound;
+      theCenter.y = ySum/upperBound;
+
+      // for now we just want a quick implementation of something
+      // and we know that we have 4 vertices for the bounding valid
+      // vertices.
+      //
+      if(upperBound == 4)
+      {
+         ossimDpt edgeDirection1 = validVertices[1] - validVertices[0];
+         ossimDpt edgeDirection2 = validVertices[2] - validVertices[1];
+
+         theAxis1 = ossimDpt(-edgeDirection1.y, edgeDirection1.x);
+         
+         theAxis2 = ossimDpt(-edgeDirection2.y, edgeDirection2.x);
+
+         theAxis1 = theAxis1/theAxis1.length();
+         theAxis2 = theAxis2/theAxis2.length();
+
+         ossimLine line1(theCenter,
+                         theCenter + theAxis1*2);
+         ossimLine line2(validVertices[1],
+                         validVertices[0]);
+         ossimLine line3(theCenter,
+                         theCenter + theAxis2*2);
+         ossimLine line4(validVertices[2],
+                         validVertices[1]);
+         
+         ossimDpt intersectionPoint1 = line1.intersectInfinite(line2);
+         ossimDpt intersectionPoint2 = line3.intersectInfinite(line4);
+
+         
+         theAxis1Length = ossim::round<int>((theCenter-intersectionPoint1).length());
+         theAxis2Length = ossim::round<int>((theCenter-intersectionPoint2).length());
+
+          if(traceDebug())
+          {
+             CLOG << "theAxis1Length:       " << theAxis1Length << endl
+                  << "theAxis2Length:       " << theAxis2Length << endl
+                  << "center:               " << theCenter      << endl;
+          }
+      }
+   }
+}
+
+ostream& operator<<(ostream& out,
+                    const ossimFeatherMosaic::ossimFeatherInputInformation& data)
+{
+   out << "center: " << data.theCenter << endl
+       << "axis1:  " << data.theAxis1  << endl
+       << "axis2:  " << data.theAxis2  << endl
+       << "axis1_length: " << data.theAxis1Length << endl
+       << "axis2_length: " << data.theAxis2Length << endl
+       << "valid vertices: " << endl;
+   std::copy(data.theValidVertices.begin(),
+             data.theValidVertices.end(),
+             std::ostream_iterator<ossimDpt>(out, "\n"));
+   return out;
+}
diff --git a/src/imaging/ossimFftFilter.cpp b/src/imaging/ossimFftFilter.cpp
new file mode 100644
index 0000000..4cd273c
--- /dev/null
+++ b/src/imaging/ossimFftFilter.cpp
@@ -0,0 +1,447 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimFftFilter.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <ossim/imaging/ossimFftFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/matrix/newmatap.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/base/ossimStringProperty.h>
+
+RTTI_DEF1(ossimFftFilter, "ossimFftFilter", ossimImageSourceFilter);
+
+ossimFftFilter::ossimFftFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theTile(0),
+    theDirectionType(FORWARD),
+    theScalarRemapper(new ossimScalarRemapper())
+{
+   theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
+}
+
+ossimFftFilter::ossimFftFilter(ossimImageSource* inputSource)
+   :ossimImageSourceFilter(inputSource),
+    theTile(0),
+    theDirectionType(FORWARD),
+    theScalarRemapper(new ossimScalarRemapper())
+{
+   theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
+}
+
+ossimFftFilter::ossimFftFilter(ossimObject* owner,
+                               ossimImageSource* inputSource)
+   :ossimImageSourceFilter(owner, inputSource),
+    theTile(0),
+    theDirectionType(FORWARD),
+    theScalarRemapper(new ossimScalarRemapper())
+{
+   theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
+}
+
+ossimFftFilter::~ossimFftFilter()
+{
+   if(theScalarRemapper.valid())
+   {
+      theScalarRemapper->disconnect();
+      theScalarRemapper = 0;
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimFftFilter::getTile(const ossimIrect& rect,
+                                                    ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled())
+      return ossimImageSourceFilter::getTile(rect, resLevel);
+   
+   ossimIrect tempRequest = rect;
+
+   ossim_uint32 w = rect.width();
+   ossim_uint32 h = rect.height();
+   
+   if(w & 1)
+      ++w;
+   if(h&1)
+      ++h;
+
+   tempRequest = ossimIrect(rect.ul().x,         rect.ul().y,
+                            rect.ul().x + (w-1), rect.ul().y + (h-1));
+   
+   ossimRefPtr<ossimImageData> inTile = theScalarRemapper->getTile(tempRequest, resLevel);
+   if(!inTile.valid())
+      return inTile;
+   if(!theTile.valid())
+      initialize();
+   if(!theTile.valid() || !inTile->getBuf())
+      return theTile;
+   
+   theTile->setImageRectangle(rect);
+   ossimRefPtr<ossimImageData> tempTile = theTile;
+   
+   if(rect != tempRequest)
+   {
+      tempTile = (ossimImageData*)theTile->dup();
+      tempTile->setImageRectangle(tempRequest);
+   }
+
+   runFft(inTile, tempTile);
+          
+   if(tempTile != theTile)
+   {
+      theTile->loadTile(tempTile.get());
+   }
+   
+   theTile->validate();
+   return theTile;
+}
+
+void ossimFftFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   theTile = ossimImageDataFactory::instance()->create(this, this);
+   
+   if(theTile.valid())
+   {
+      theTile->initialize();
+   }
+   if(theDirectionType == FORWARD)
+   {
+      theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
+   }
+   else
+   {
+      theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
+   }
+   theScalarRemapper->connectMyInputTo(0, getInput());
+}
+
+ossimScalarType ossimFftFilter::getOutputScalarType() const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getOutputScalarType();
+   }
+   
+   if(theDirectionType == FORWARD)
+   {
+      return OSSIM_NORMALIZED_DOUBLE;
+   }
+   
+   return OSSIM_NORMALIZED_DOUBLE;
+}
+
+double ossimFftFilter::getNullPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getNullPixelValue(band);
+   }
+   if(theDirectionType == FORWARD)
+   {
+      return ossim::nan();
+   }
+
+   // it will invert to a normalized float output
+   return 0.0;
+}
+
+double ossimFftFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getMinPixelValue(band);
+   }
+      return 0.0;
+}
+
+double ossimFftFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getMaxPixelValue(band);
+   }
+   return 1.0;
+}
+
+ossim_uint32 ossimFftFilter::getNumberOfOutputBands() const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getNumberOfOutputBands();
+   }
+   ossim_uint32 bands = ossimImageSourceFilter::getNumberOfOutputBands();
+   
+   if(theDirectionType == FORWARD)
+   {
+      bands *=2;
+   }
+   else 
+   {
+      bands /=2;
+   }
+
+   return bands;
+}
+
+void ossimFftFilter::setForward()
+{
+   theDirectionType = FORWARD;
+}
+
+void ossimFftFilter::setInverse()
+{
+   theDirectionType = INVERSE;
+}
+
+ossimString ossimFftFilter::getDirectionTypeAsString()const
+{
+   if(theDirectionType == FORWARD)
+   {
+      return "Forward";
+   }
+
+   return "Inverse";
+}
+
+void ossimFftFilter::setDirectionType(const ossimString& directionType)
+{
+   ossimString tempDirectionType = directionType;
+   tempDirectionType = tempDirectionType.downcase();
+   
+   if(tempDirectionType.contains("forward"))
+   {
+      setDirectionType(FORWARD);
+   }
+   else
+   {
+      setDirectionType(INVERSE);
+   }
+}
+
+void ossimFftFilter::setDirectionType(ossimFftFilterDirectionType directionType)
+{
+   theDirectionType = directionType;
+   if(theTile.valid())
+   {
+      theTile = NULL;
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimFftFilter::getProperty(const ossimString& name)const
+{
+   if(name == "FFT Direction")
+   {
+      std::vector<ossimString> filterNames;
+      filterNames.push_back("Forward");
+      filterNames.push_back("Inverse");
+      ossimStringProperty* stringProp = new ossimStringProperty("FFT Direction",
+								getDirectionTypeAsString(),
+								false,
+								filterNames);
+      stringProp->setCacheRefreshBit();
+
+      return stringProp;
+   }
+
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimFftFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+   
+   if(property->getName() == "FFT Direction")
+   {
+      if(theTile.valid())
+      {
+         theTile = NULL;
+      }
+      setDirectionType(property->valueToString());
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+void ossimFftFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back("FFT Direction");
+}
+
+
+void ossimFftFilter::runFft(ossimRefPtr<ossimImageData>& input,
+                            ossimRefPtr<ossimImageData>& output)
+{
+
+   NEWMAT::Matrix* realIn = new NEWMAT::Matrix(input->getHeight(),
+                                               input->getWidth());
+   NEWMAT::Matrix* imgIn = new NEWMAT::Matrix(input->getHeight(),
+                                              input->getWidth());
+   NEWMAT::Matrix* realOut = new NEWMAT::Matrix(input->getHeight(),
+                                                input->getWidth());
+   NEWMAT::Matrix* imgOut = new NEWMAT::Matrix(input->getHeight(),
+                                               input->getWidth());
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 w = input->getWidth();
+   ossim_uint32 h = input->getHeight();
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   if(theDirectionType == FORWARD)
+   {
+      ossim_uint32 bands = input->getNumberOfBands();
+      for(bandIdx = 0; bandIdx < bands; ++bandIdx)
+      {
+         ossim_float64* bandReal = 0;
+         ossim_float64* bandImg  = 0;
+         fillMatrixForward((ossim_float64*)input->getBuf(bandIdx),
+                           (ossim_float64)input->getNullPix(bandIdx),
+                           *realIn,
+                           *imgIn);
+         NEWMAT::FFT2(*realIn, *imgIn, *realOut, *imgOut);
+         bandReal = (ossim_float64*)output->getBuf(2*bandIdx);
+         bandImg  = (ossim_float64*)output->getBuf(2*bandIdx + 1);
+         if(bandReal&&bandImg)
+         {
+            for(y = 0; y < h; ++y)
+            {
+               for(x = 0; x < w; ++x)
+               {
+                  *bandReal = (ossim_float64)((*realOut)[y][x]);
+                  *bandImg  = (ossim_float64)((*imgOut)[y][x]);
+                  ++bandReal;
+                  ++bandImg;
+               }
+            }
+         }
+      }
+   }
+   else
+   {
+      ossim_float64* bandReal = 0;
+      ossim_uint32 bands = input->getNumberOfBands();
+      for(bandIdx = 0; bandIdx < bands; bandIdx+=2)
+      {
+         bandReal = (ossim_float64*)output->getBuf(bandIdx/2);
+         if(input->getBuf(bandIdx)&&
+            input->getBuf(bandIdx+1))
+         {
+            fillMatrixInverse((double*)input->getBuf(bandIdx),
+                              (double*)input->getBuf(bandIdx+1),
+                              *realIn,
+                              *imgIn);
+            NEWMAT::FFT2I(*realIn, *imgIn, *realOut, *imgOut);
+            for(y = 0; y < h; ++y)
+            {
+               for(x = 0; x < w; ++x)
+               {
+                  *bandReal = (ossim_float64)((*realOut)[y][x]);
+//                  if(*bandReal > 1.0)
+//                  {
+//                     *bandReal = 1.0;
+//                  }
+//                  if(*bandReal < 0.0)
+//                  {
+//                     *bandReal = 0.0;
+//                  }
+                  ++bandReal;
+               }
+            }
+         }
+      }
+   }
+   
+   delete realIn;
+   delete imgIn;
+   delete realOut;
+   delete imgOut;
+}
+
+template <class T>
+void ossimFftFilter::fillMatrixForward(T *realPart,
+                                       T nullPix,
+                                       NEWMAT::Matrix& real,
+                                       NEWMAT::Matrix& img)const
+{
+   ossim_uint32 w = real.Ncols();
+   ossim_uint32 h = real.Nrows();
+   ossim_uint32 yIdx = 0;
+   ossim_uint32 xIdx = 0;
+   
+   for(yIdx = 0; yIdx < h; ++yIdx)
+   {
+      for(xIdx = 0; xIdx < w; ++xIdx)
+      {
+         if((double)(*realPart) != nullPix)
+         {
+            real[yIdx][xIdx] = (double)(*realPart);
+         }
+         else
+         {
+            real[yIdx][xIdx] = 0.0;
+         }
+         
+         img[yIdx][xIdx]  = 0.0;
+         
+         ++realPart;
+      }
+   }
+}
+
+template <class T>
+void ossimFftFilter::fillMatrixInverse(T *realPart,
+                                       T *imgPart,
+                                       NEWMAT::Matrix& real,
+                                       NEWMAT::Matrix& img)const
+{
+   ossim_uint32 w = real.Ncols();
+   ossim_uint32 h = real.Nrows();
+   ossim_uint32 yIdx = 0;
+   ossim_uint32 xIdx = 0;
+   
+   for(yIdx = 0; yIdx < h; ++yIdx)
+   {
+      for(xIdx = 0; xIdx < w; ++xIdx)
+      {
+         real[yIdx][xIdx] = (double)(*realPart);
+         img[yIdx][xIdx]  = (double)(*imgPart);
+         
+         ++realPart;
+         ++imgPart;
+      }
+   }
+}
+
+
+bool ossimFftFilter::loadState(const ossimKeywordlist& kwl,
+                               const char* prefix)
+{
+   const char* direction = kwl.find(prefix, "fft_direction");
+   if(direction)
+   {
+      setDirectionType(ossimString(direction));
+   }
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimFftFilter::saveState(ossimKeywordlist& kwl,
+                               const char* prefix)const
+{
+   kwl.add(prefix,
+           "fft_direction",
+           getDirectionTypeAsString(),
+           true);
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
diff --git a/src/imaging/ossimFgdcFileWriter.cpp b/src/imaging/ossimFgdcFileWriter.cpp
new file mode 100644
index 0000000..db68c03
--- /dev/null
+++ b/src/imaging/ossimFgdcFileWriter.cpp
@@ -0,0 +1,955 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class to write out meta data in a Federal Geographic Data
+// Committe (FGDC) format.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimFgdcFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+
+#include <ossim/imaging/ossimFgdcFileWriter.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <fstream>
+using namespace std;
+
+RTTI_DEF1(ossimFgdcFileWriter, "ossimFgdcFileWriter", ossimMetadataFileWriter)
+
+static ossimTrace traceDebug("ossimFgdcFileWriter:debug");
+
+   
+ossimFgdcFileWriter::ossimFgdcFileWriter()
+   :
+   theIndentionLevel(0),
+   theTabString("\t"),
+   theTemplate(),
+   theSourceImageFilename()
+{
+}
+
+ossimFgdcFileWriter::~ossimFgdcFileWriter()
+{
+}
+
+bool ossimFgdcFileWriter::writeFile()
+{
+   if(theFilename == ossimFilename::NIL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimFgdcFileWriter::writeFile no filename set!" << endl;
+      return false;
+   }
+   
+   if( !theInputConnection )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimFgdcFileWriter::writeFile no input connection!" << endl;
+      return false;
+   }
+
+   ofstream os(theFilename.c_str());
+   if (!os)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimFgdcFileWriter::writeFile no input connection!" << endl;
+      return false;
+   }
+
+   // Get the geometry from the input.
+   ossimMapProjection* mapProj = 0;
+   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
+   if ( inputGeom.valid() ) mapProj = PTR_CAST(ossimMapProjection, inputGeom->getProjection());
+   if (!mapProj)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimFgdcFileWriter::writeFile Not map projected."
+         << endl;
+      return false;
+   }
+
+   ossimMapProjectionInfo mpi(mapProj, theInputConnection->getBoundingRect());
+
+   os << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"
+      << "<?xml-stylesheet type=\"text/xsl\" href=\"/common/fgdc_classic.xsl\" ?>\n";
+   openTag(os, ossimString("metadata"),  true);
+   openTag(os, ossimString("idinfo"),    true);
+   openTag(os, ossimString("citation"),  true);
+   openTag(os, ossimString("citeinfo"),  true);
+   
+   openTag(os, ossimString("origin"),    false);
+   os << find(ossimString("/metadata/idinfo/citation/citeinfo/origin"));
+   closeTag(os, ossimString("origin"),   false);
+   
+   openTag(os, ossimString("pubdate"),    false);
+   os << find(ossimString("/metadata/idinfo/citation/citeinfo/pubdate"));
+   closeTag(os, ossimString("pubdate"),   false);
+
+   openTag(os, ossimString("title"),    false);
+   // os << find(ossimString("/metadata/idinfo/citation/citeinfo/title"));
+   os << theSourceImageFilename.c_str();
+   closeTag(os, ossimString("title"),   false);
+
+   openTag(os, ossimString("edition"),    false);
+   os << find(ossimString("/metadata/idinfo/citation/citeinfo/edition"));
+   closeTag(os, ossimString("edition"),   false);
+
+   openTag(os, ossimString("geoform"),    false);
+   os << find(ossimString("/metadata/idinfo/citation/citeinfo/geoform"));
+   closeTag(os, ossimString("geoform"),   false);
+
+   openTag(os, ossimString("serinfo"),  true);
+   openTag(os, ossimString("sername"),    false);
+   os << find(ossimString("/metadata/idinfo/citation/citeinfo/serinfo/sername"));
+   closeTag(os, ossimString("sername"),   false);
+
+   openTag(os, ossimString("issue"),    false);
+   os << theSourceImageFilename.c_str();
+   closeTag(os, ossimString("issue"),   false);
+
+   closeTag(os, ossimString("serinfo"),  true);
+
+   openTag(os, ossimString("pubinfo"),  true);
+
+   openTag(os, ossimString("pubplace"),    false);
+   os << find(ossimString("/metadata/idinfo/citation/citeinfo/pubinfo/pubplace"));
+   closeTag(os, ossimString("pubplace"),   false);
+
+   openTag(os, ossimString("publish"),    false);
+   os << find(ossimString("/metadata/idinfo/citation/citeinfo/pubinfo/publish"));
+   closeTag(os, ossimString("publish"),   false);
+
+   closeTag(os, ossimString("pubinfo"),  true);
+   closeTag(os, ossimString("citeinfo"),  true);
+   closeTag(os, ossimString("citation"),  true);
+
+   openTag(os, ossimString("descript"),  true);
+
+   openTag(os, ossimString("abstract"),    false);
+   os << find(ossimString("/metadata/idinfo/descript/abstract"));
+   closeTag(os, ossimString("abstract"),   false);
+
+   openTag(os, ossimString("purpose"),    false);
+   os << find(ossimString("/metadata/idinfo/descript/purpose"));
+   closeTag(os, ossimString("purpose"),   false);
+
+   openTag(os, ossimString("supplinf"),    false);
+   os << find(ossimString("/metadata/idinfo/descript/supplinf"));
+   closeTag(os, ossimString("supplinf"),   false);
+
+   closeTag(os, ossimString("descript"),  true);
+
+   openTag(os, ossimString("timeperd"),  true);
+   openTag(os, ossimString("timeinfo"),  true);
+   openTag(os, ossimString("sngdate"),  true);
+
+   openTag(os, ossimString("caldate"),    false);
+   os << find(ossimString("/metadata/idinfo/timeperd/timeinfo/sngdate/caldate"));
+   closeTag(os, ossimString("caldate"),   false);
+   
+   closeTag(os, ossimString("sngdate"),  true);
+   closeTag(os, ossimString("timeinfo"),  true);
+
+   
+   openTag(os, ossimString("current"),    false);
+   os << find(ossimString("/metadata/idinfo/timeperd/current"));
+   closeTag(os, ossimString("current"),   false);
+
+   closeTag(os, ossimString("timeperd"),  true);
+
+   openTag(os, ossimString("status"),  true);
+
+   openTag(os, ossimString("progress"),    false);
+   os << find(ossimString("/metadata/idinfo/status/progress"));
+   closeTag(os, ossimString("progress"),   false);
+
+   openTag(os, ossimString("update"),    false);
+   os << find(ossimString("/metadata/idinfo/status/update"));
+   closeTag(os, ossimString("update"),   false);
+
+   closeTag(os, ossimString("status"),  true);
+
+   openTag(os, ossimString("spdom"),  true);
+   openTag(os, ossimString("bounding"),  true);
+
+   if (mapProj->isGeographic())
+   {
+      openTag(os, ossimString("westbc"),    false);
+      os << ossimString::toString(mpi.ulGroundPt().lon);
+      closeTag(os, ossimString("westbc"),   false);
+      
+      openTag(os, ossimString("eastbc"),    false);
+      os << ossimString::toString(mpi.lrGroundPt().lon);
+      closeTag(os, ossimString("eastbc"),   false);
+      
+      openTag(os, ossimString("northbc"),    false);
+      os << ossimString::toString(mpi.ulGroundPt().lat);
+      closeTag(os, ossimString("northbc"),   false);
+      
+      openTag(os, ossimString("southbc"),    false);
+      os << ossimString::toString(mpi.lrGroundPt().lat);
+      closeTag(os, ossimString("southbc"),   false);
+   }
+   else
+   {
+      openTag(os, ossimString("westbc"),    false);
+      os << ossimString::toString(mpi.ulEastingNorthingPt().x);
+      closeTag(os, ossimString("westbc"),   false);
+      
+      openTag(os, ossimString("eastbc"),    false);
+      os << ossimString::toString(mpi.lrEastingNorthingPt().x);
+      closeTag(os, ossimString("eastbc"),   false);
+      
+      openTag(os, ossimString("northbc"),    false);
+      os << ossimString::toString(mpi.ulEastingNorthingPt().y);
+      closeTag(os, ossimString("northbc"),   false);
+      
+      openTag(os, ossimString("southbc"),    false);
+      os << ossimString::toString(mpi.ulEastingNorthingPt().y);
+      closeTag(os, ossimString("southbc"),   false);
+   }
+   
+   closeTag(os, ossimString("bounding"),  true);
+   closeTag(os, ossimString("spdom"),    true);
+
+   openTag(os, ossimString("keywords"), true);
+
+   openTag(os, ossimString("theme"), true);
+
+   openTag(os, ossimString("themekt"), false);
+   os << find(ossimString("/metadata/idinfo/keywords/theme/themekt"));
+   closeTag(os, ossimString("themekt"), false);
+
+   openTag(os, ossimString("themekey"), false);
+   os << find(ossimString("/metadata/idinfo/keywords/theme/themekey"));
+   closeTag(os, ossimString("themekey"), false);
+   
+   closeTag(os, ossimString("theme"), true);
+
+   closeTag(os, ossimString("keywords"), true);
+
+   openTag(os, ossimString("accconst"), false);
+   os << find(ossimString("/metadata/idinfo/accconst"));
+   closeTag(os, ossimString("accconst"), false);
+
+   openTag(os, ossimString("useconst"), false);
+   os << find(ossimString("/metadata/idinfo/useconst"));
+   closeTag(os, ossimString("useconst"), false);
+
+   openTag(os, ossimString("ptcontac"), true);
+   
+   openTag(os, ossimString("cntinfo"), true);
+   
+   openTag(os, ossimString("cntperp"), true);
+   openTag(os, ossimString("cntper"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntperp/cntper"));
+   closeTag(os, ossimString("cntper"), false);
+   closeTag(os, ossimString("cntperp"), true);
+
+   openTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("addrtype"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/addrtype"));
+   closeTag(os, ossimString("addrtype"), false);
+
+   openTag(os, ossimString("address"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/address"));
+   closeTag(os, ossimString("address"), false);
+
+   openTag(os, ossimString("city"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/city"));
+   closeTag(os, ossimString("city"), false);
+
+   openTag(os, ossimString("state"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/state"));
+   closeTag(os, ossimString("state"), false);
+
+   openTag(os, ossimString("postal"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/postal"));
+   closeTag(os, ossimString("postal"), false);
+
+   openTag(os, ossimString("country"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntaddr/country"));
+   closeTag(os, ossimString("country"), false);
+
+   closeTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("cntvoice"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntvoice"));
+   closeTag(os, ossimString("cntvoice"), false);
+  
+   openTag(os, ossimString("cntfax"), false);
+
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntfax"));
+   closeTag(os, ossimString("cntfax"), false);
+  
+   openTag(os, ossimString("cntemail"), false);
+   os << find(ossimString("/metadata/idinfo/ptcontac/cntinfo/cntemail"));
+   closeTag(os, ossimString("cntemail"), false);
+   
+   closeTag(os, ossimString("cntinfo"), true);
+   closeTag(os, ossimString("ptcontac"), true);
+
+   openTag(os, ossimString("secinfo"), true);
+
+   openTag(os, ossimString("secclass"), false);
+   os << find(ossimString("/metadata/idinfo/secinfo/secclass"));
+   closeTag(os, ossimString("secclass"), false);
+
+   openTag(os, ossimString("secsys"), false);
+   os << find(ossimString("/metadata/idinfo/secinfo/secsys"));
+   closeTag(os, ossimString("secsys"), false);
+
+   openTag(os, ossimString("sechandl"), false);
+   os << find(ossimString("/metadata/idinfo/secinfo/sechandl"));
+   closeTag(os, ossimString("sechandl"), false);
+
+   closeTag(os, ossimString("secinfo"), true);
+   closeTag(os, ossimString("idinfo"), true);
+   
+   openTag(os, ossimString("distinfo"), true);
+   openTag(os, ossimString("distrib"), true);
+   openTag(os, ossimString("cntinfo"), true);
+   openTag(os, ossimString("cntperp"), true);
+   openTag(os, ossimString("cntper"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntperp/cntper"));
+
+   closeTag(os, ossimString("cntper"), false);
+   closeTag(os, ossimString("cntperp"), true);
+
+   openTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("addrtype"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/addrtype"));
+   closeTag(os, ossimString("addrtype"), false);
+
+   openTag(os, ossimString("address"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/address"));
+   closeTag(os, ossimString("address"), false);
+
+   openTag(os, ossimString("city"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/city"));
+   closeTag(os, ossimString("city"), false);
+
+   openTag(os, ossimString("state"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/state"));
+   closeTag(os, ossimString("state"), false);
+
+   openTag(os, ossimString("postal"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/postal"));
+   closeTag(os, ossimString("postal"), false);
+
+   openTag(os, ossimString("country"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntaddr/country"));
+   closeTag(os, ossimString("country"), false);
+
+   closeTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("cntvoice"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntvoice"));
+   closeTag(os, ossimString("cntvoice"), false);
+  
+   openTag(os, ossimString("cntfax"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntfax"));
+   closeTag(os, ossimString("cntfax"), false);
+  
+   openTag(os, ossimString("cntemail"), false);
+   os << find(ossimString("/metadata/distinfo/distrib/cntinfo/cntemail"));
+   closeTag(os, ossimString("cntemail"), false);
+   
+   closeTag(os, ossimString("cntinfo"), true);
+   closeTag(os, ossimString("distrib"), true);
+
+   openTag(os, ossimString("resdesc"), false);
+   os << find(ossimString("/metadata/distinfo/resdesc"));
+   closeTag(os, ossimString("resdesc"), false);
+
+   openTag(os, ossimString("distliab"), false);
+   os << find(ossimString("/metadata/distinfo/distliab"));
+   closeTag(os, ossimString("distliab"), false);
+
+   openTag(os, ossimString("stdorder"), true);
+   openTag(os, ossimString("digform"), true);
+   openTag(os, ossimString("digtinfo"), true);
+   
+   openTag(os, ossimString("formname"), false);
+   os << find(ossimString("/metadata/distinfo/stdorder/digform/digtinfo/formname"));
+   closeTag(os, ossimString("formname"), false);
+
+   closeTag(os, ossimString("digtinfo"), true);
+
+   openTag(os, ossimString("digtopt"), true);
+   openTag(os, ossimString("onlinopt"), true);   
+   openTag(os, ossimString("computer"), true);
+   openTag(os, ossimString("networka"), true);
+
+   openTag(os, ossimString("networkr"), false);
+   os << find(ossimString("/metadata/distinfo/stdorder/digform/digtopt/onlinopt/computer/networka/networkr"));
+   closeTag(os, ossimString("networkr"), false);
+
+   closeTag(os, ossimString("networka"), true);
+   closeTag(os, ossimString("computer"), true);
+   closeTag(os, ossimString("onlinopt"), true);
+   closeTag(os, ossimString("digtopt"), true);
+   closeTag(os, ossimString("digform"), true);
+
+   openTag(os, ossimString("fees"), false);
+   os << find(ossimString("/metadata/distinfo/stdorder/fees"));
+   closeTag(os, ossimString("fees"), false);
+
+   closeTag(os, ossimString("stdorder"), true);
+   closeTag(os, ossimString("distinfo"), true);
+
+   openTag(os, ossimString("metainfo"), true);
+
+   openTag(os, ossimString("metd"), false);
+   os << find(ossimString("/metadata/metainfo/metd"));
+   closeTag(os, ossimString("metd"), false);
+
+   openTag(os, ossimString("metc"), true);
+   openTag(os, ossimString("cntinfo"), true);
+   openTag(os, ossimString("cntperp"), true);
+   
+   openTag(os, ossimString("cntper"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntperp/cntper"));
+   closeTag(os, ossimString("cntper"), false);
+
+   closeTag(os, ossimString("cntperp"), true);
+   
+   openTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("addrtype"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/addrtype"));
+   closeTag(os, ossimString("addrtype"), false);
+
+   openTag(os, ossimString("address"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/address"));
+   closeTag(os, ossimString("address"), false);
+
+   openTag(os, ossimString("city"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/city"));
+   closeTag(os, ossimString("city"), false);
+
+   openTag(os, ossimString("state"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/state"));
+   closeTag(os, ossimString("state"), false);
+
+   openTag(os, ossimString("postal"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/postal"));
+   closeTag(os, ossimString("postal"), false);
+
+   openTag(os, ossimString("country"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntaddr/country"));
+   closeTag(os, ossimString("country"), false);
+
+   closeTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("cntvoice"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntvoice"));
+   closeTag(os, ossimString("cntvoice"), false);
+  
+   openTag(os, ossimString("cntfax"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntfax"));
+   closeTag(os, ossimString("cntfax"), false);
+  
+   openTag(os, ossimString("cntemail"), false);
+   os << find(ossimString("/metadata/metainfo/metc/cntinfo/cntemail"));
+   closeTag(os, ossimString("cntemail"), false);
+   
+   closeTag(os, ossimString("cntinfo"), true);
+   closeTag(os, ossimString("metc"), true);
+
+   openTag(os, ossimString("metstdn"), false);
+   os << find(ossimString("/metadata/metainfo/metstdn"));
+   closeTag(os, ossimString("metstdn"), false);
+
+   openTag(os, ossimString("metstdv"), false);
+   os << find(ossimString("/metadata/metainfo/metstdv"));
+   closeTag(os, ossimString("metstdv"), false);
+
+   closeTag(os, ossimString("metainfo"), true);
+   closeTag(os, ossimString("metadata"), true);
+
+   os.close();
+
+   return true;
+}
+
+bool ossimFgdcFileWriter::writeTemplate(const ossimFilename& file) const
+{
+   ofstream os(file.c_str());
+   if (!os)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimFgdcFileWriter::writeTemplate Could not open: " << file
+         << endl;
+      return false;
+   }
+
+   os << "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"
+      << "<?xml-stylesheet type=\"text/xsl\" href=\"/common/fgdc_classic.xsl\" ?>\n";
+   openTag(os, ossimString("metadata"),  true);
+   openTag(os, ossimString("idinfo"),    true);
+   openTag(os, ossimString("citation"),  true);
+   openTag(os, ossimString("citeinfo"),  true);
+   
+   openTag(os, ossimString("origin"),    false);
+   closeTag(os, ossimString("origin"),   false);
+   
+   openTag(os, ossimString("pubdate"),    false);
+   closeTag(os, ossimString("pubdate"),   false);
+
+   openTag(os, ossimString("title"),    false);
+   closeTag(os, ossimString("title"),   false);
+
+   openTag(os, ossimString("edition"),    false);
+   closeTag(os, ossimString("edition"),   false);
+
+   openTag(os, ossimString("geoform"),    false);
+   closeTag(os, ossimString("geoform"),   false);
+
+   openTag(os, ossimString("serinfo"),  true);
+   openTag(os, ossimString("sername"),    false);
+
+   closeTag(os, ossimString("sername"),   false);
+
+   openTag(os, ossimString("issue"),    false);
+   closeTag(os, ossimString("issue"),   false);
+
+   closeTag(os, ossimString("serinfo"),  true);
+
+   openTag(os, ossimString("pubinfo"),  true);
+
+   openTag(os, ossimString("pubplace"),    false);
+
+   closeTag(os, ossimString("pubplace"),   false);
+
+   openTag(os, ossimString("publish"),    false);
+   closeTag(os, ossimString("publish"),   false);
+
+   closeTag(os, ossimString("pubinfo"),  true);
+   closeTag(os, ossimString("citeinfo"),  true);
+   closeTag(os, ossimString("citation"),  true);
+
+   openTag(os, ossimString("descript"),  true);
+
+   openTag(os, ossimString("abstract"),    false);
+   closeTag(os, ossimString("abstract"),   false);
+
+   openTag(os, ossimString("purpose"),    false);
+   closeTag(os, ossimString("purpose"),   false);
+
+   openTag(os, ossimString("supplinf"),    false);
+   closeTag(os, ossimString("supplinf"),   false);
+
+   closeTag(os, ossimString("descript"),  true);
+
+   openTag(os, ossimString("timeperd"),  true);
+   openTag(os, ossimString("timeinfo"),  true);
+   openTag(os, ossimString("sngdate"),  true);
+
+   openTag(os, ossimString("caldate"),    false);
+   closeTag(os, ossimString("caldate"),   false);
+   
+   closeTag(os, ossimString("sngdate"),  true);
+   closeTag(os, ossimString("timeinfo"),  true);
+
+   
+   openTag(os, ossimString("current"),    false);
+   closeTag(os, ossimString("current"),   false);
+
+   closeTag(os, ossimString("timeperd"),  true);
+
+   openTag(os, ossimString("status"),  true);
+
+   openTag(os, ossimString("progress"),    false);
+   closeTag(os, ossimString("progress"),   false);
+
+   openTag(os, ossimString("update"),    false);
+   closeTag(os, ossimString("update"),   false);
+
+   closeTag(os, ossimString("status"),  true);
+
+   openTag(os, ossimString("spdom"),  true);
+   openTag(os, ossimString("bounding"),  true);
+
+   openTag(os, ossimString("westbc"),    false);
+   closeTag(os, ossimString("westbc"),   false);
+   openTag(os, ossimString("eastbc"),    false);
+
+   closeTag(os, ossimString("eastbc"),   false);
+   openTag(os, ossimString("northbc"),    false);
+
+   closeTag(os, ossimString("northbc"),   false);
+   openTag(os, ossimString("southbc"),    false);
+
+   closeTag(os, ossimString("southbc"),   false);
+
+   closeTag(os, ossimString("bounding"),  true);
+   closeTag(os, ossimString("spdom"),    true);
+
+   openTag(os, ossimString("keywords"), true);
+
+   openTag(os, ossimString("theme"), true);
+
+   openTag(os, ossimString("themekt"), false);
+   closeTag(os, ossimString("themekt"), false);
+
+   openTag(os, ossimString("themekey"), false);
+   closeTag(os, ossimString("themekey"), false);
+   
+   closeTag(os, ossimString("theme"), true);
+
+   closeTag(os, ossimString("keywords"), true);
+
+   openTag(os, ossimString("accconst"), false);
+   closeTag(os, ossimString("accconst"), false);
+
+   openTag(os, ossimString("useconst"), false);
+   closeTag(os, ossimString("useconst"), false);
+
+   openTag(os, ossimString("ptcontac"), true);
+   
+   openTag(os, ossimString("cntinfo"), true);
+   
+   openTag(os, ossimString("cntperp"), true);
+   openTag(os, ossimString("cntper"), false);
+   closeTag(os, ossimString("cntper"), false);
+   closeTag(os, ossimString("cntperp"), true);
+
+   openTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("addrtype"), false);
+   closeTag(os, ossimString("addrtype"), false);
+
+   openTag(os, ossimString("address"), false);
+   closeTag(os, ossimString("address"), false);
+
+   openTag(os, ossimString("city"), false);
+   closeTag(os, ossimString("city"), false);
+
+   openTag(os, ossimString("state"), false);
+   closeTag(os, ossimString("state"), false);
+
+   openTag(os, ossimString("postal"), false);
+   closeTag(os, ossimString("postal"), false);
+
+   openTag(os, ossimString("country"), false);
+   closeTag(os, ossimString("country"), false);
+
+   closeTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("cntvoice"), false);
+   closeTag(os, ossimString("cntvoice"), false);
+  
+   openTag(os, ossimString("cntfax"), false);
+   closeTag(os, ossimString("cntfax"), false);
+  
+   openTag(os, ossimString("cntemail"), false);
+   closeTag(os, ossimString("cntemail"), false);
+   
+   closeTag(os, ossimString("cntinfo"), true);
+   
+   closeTag(os, ossimString("ptcontac"), true);
+
+   openTag(os, ossimString("secinfo"), true);
+   openTag(os, ossimString("secclass"), false);
+   closeTag(os, ossimString("secclass"), false);
+   openTag(os, ossimString("secsys"), false);
+   closeTag(os, ossimString("secsys"), false);
+   openTag(os, ossimString("sechandl"), false);
+   closeTag(os, ossimString("sechandl"), false);
+   closeTag(os, ossimString("secinfo"), true);
+
+   closeTag(os, ossimString("idinfo"), true);
+
+   openTag(os, ossimString("distinfo"), true);
+   openTag(os, ossimString("distrib"), true);
+   openTag(os, ossimString("cntinfo"), true);
+   openTag(os, ossimString("cntperp"), true);
+   openTag(os, ossimString("cntper"), false);
+   closeTag(os, ossimString("cntper"), false);
+   closeTag(os, ossimString("cntperp"), true);
+
+   openTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("addrtype"), false);
+   closeTag(os, ossimString("addrtype"), false);
+
+   openTag(os, ossimString("address"), false);
+   closeTag(os, ossimString("address"), false);
+
+   openTag(os, ossimString("city"), false);
+   closeTag(os, ossimString("city"), false);
+
+   openTag(os, ossimString("state"), false);
+   closeTag(os, ossimString("state"), false);
+
+   openTag(os, ossimString("postal"), false);
+   closeTag(os, ossimString("postal"), false);
+
+   openTag(os, ossimString("country"), false);
+   closeTag(os, ossimString("country"), false);
+
+   closeTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("cntvoice"), false);
+   closeTag(os, ossimString("cntvoice"), false);
+  
+   openTag(os, ossimString("cntfax"), false);
+   closeTag(os, ossimString("cntfax"), false);
+  
+   openTag(os, ossimString("cntemail"), false);
+   closeTag(os, ossimString("cntemail"), false);
+   
+   closeTag(os, ossimString("cntinfo"), true);
+   closeTag(os, ossimString("distrib"), true);
+
+   openTag(os, ossimString("resdesc"), false);
+   closeTag(os, ossimString("resdesc"), false);
+
+   openTag(os, ossimString("distliab"), false);
+   closeTag(os, ossimString("distliab"), false);
+
+   openTag(os, ossimString("stdorder"), true);
+   openTag(os, ossimString("digform"), true);
+   openTag(os, ossimString("digtinfo"), true);
+   
+   openTag(os, ossimString("formname"), false);
+   closeTag(os, ossimString("formname"), false);
+
+   closeTag(os, ossimString("digtinfo"), true);
+
+   openTag(os, ossimString("digtopt"), true);
+   openTag(os, ossimString("onlinopt"), true);   
+   openTag(os, ossimString("computer"), true);
+   openTag(os, ossimString("networka"), true);
+
+   openTag(os, ossimString("networkr"), false);
+   closeTag(os, ossimString("networkr"), false);
+
+   closeTag(os, ossimString("networka"), true);
+   closeTag(os, ossimString("computer"), true);
+   closeTag(os, ossimString("onlinopt"), true);
+   closeTag(os, ossimString("digtopt"), true);
+   closeTag(os, ossimString("digform"), true);
+
+   openTag(os, ossimString("fees"), false);
+   closeTag(os, ossimString("fees"), false);
+
+   closeTag(os, ossimString("stdorder"), true);
+   closeTag(os, ossimString("distinfo"), true);
+
+   openTag(os, ossimString("metainfo"), true);
+
+   openTag(os, ossimString("metd"), false);
+   closeTag(os, ossimString("metd"), false);
+
+   openTag(os, ossimString("metc"), true);
+   openTag(os, ossimString("cntinfo"), true);
+   openTag(os, ossimString("cntperp"), true);
+   
+   openTag(os, ossimString("cntper"), false);
+   closeTag(os, ossimString("cntper"), false);
+
+   closeTag(os, ossimString("cntperp"), true);
+   
+   openTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("addrtype"), false);
+   closeTag(os, ossimString("addrtype"), false);
+
+   openTag(os, ossimString("address"), false);
+   closeTag(os, ossimString("address"), false);
+
+   openTag(os, ossimString("city"), false);
+   closeTag(os, ossimString("city"), false);
+
+   openTag(os, ossimString("state"), false);
+   closeTag(os, ossimString("state"), false);
+
+   openTag(os, ossimString("postal"), false);
+   closeTag(os, ossimString("postal"), false);
+
+   openTag(os, ossimString("country"), false);
+   closeTag(os, ossimString("country"), false);
+
+   closeTag(os, ossimString("cntaddr"), true);
+
+   openTag(os, ossimString("cntvoice"), false);
+   closeTag(os, ossimString("cntvoice"), false);
+  
+   openTag(os, ossimString("cntfax"), false);
+   closeTag(os, ossimString("cntfax"), false);
+  
+   openTag(os, ossimString("cntemail"), false);
+   closeTag(os, ossimString("cntemail"), false);
+   
+   closeTag(os, ossimString("cntinfo"), true);
+   closeTag(os, ossimString("metc"), true);
+
+   openTag(os, ossimString("metstdn"), false);
+   closeTag(os, ossimString("metstdn"), false);
+
+   openTag(os, ossimString("metstdv"), false);
+   closeTag(os, ossimString("metstdv"), false);
+
+   closeTag(os, ossimString("metainfo"), true);
+   closeTag(os, ossimString("metadata"), true);
+
+   os.close();
+
+	if(traceDebug())
+	{
+		ossimNotify(ossimNotifyLevel_NOTICE)
+      << "Wrote file:  " << file.c_str() << endl;
+	}
+   
+   return true;
+}
+   
+bool ossimFgdcFileWriter::loadState (const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, "template");
+   if (lookup)
+   {
+      setTemplate(ossimFilename(lookup));
+   }
+   lookup = kwl.find(prefix, "source_image_filename");
+   if (lookup)
+   {
+      theSourceImageFilename = lookup;
+   }
+   lookup = kwl.find(prefix, "tab_string");
+   if (lookup)
+   {
+      theTabString = lookup;
+   }
+   lookup = kwl.find(prefix, "fgdc_template_doc");
+   if (lookup)
+   {
+      setTemplate(ossimFilename(lookup));
+   }
+   
+   return ossimMetadataFileWriter::loadState(kwl, prefix);
+}
+
+ossim_uint32 ossimFgdcFileWriter::getIndentionLevel() const
+{
+   return theIndentionLevel;
+}
+
+void ossimFgdcFileWriter::setIndentionLevel(ossim_uint32 level)
+{
+   theIndentionLevel = level;
+}
+
+ossimString ossimFgdcFileWriter::getTabString() const
+{
+   return theTabString;
+}
+
+void ossimFgdcFileWriter::setTabString(const ossimString& tabString)
+{
+   theTabString = tabString;
+}
+
+void ossimFgdcFileWriter::openTag(std::ostream& os,
+                                  const ossimString& tag,
+                                  bool newLine) const
+{
+   if ( theIndentionLevel && theTabString.size() )
+   {
+      ossimString tab;
+      for (ossim_uint32 i = 0; i < theIndentionLevel; ++i)
+      {
+         tab += theTabString;
+      }
+
+      os << tab.c_str();
+   }
+   
+   os << "<" << tag.c_str() << ">";
+
+   if (newLine)
+   {
+      os << "\n";
+      ++theIndentionLevel;
+   }
+}
+
+void ossimFgdcFileWriter::closeTag(std::ostream& os,
+                                   const ossimString& tag,
+                                   bool decrementLevel) const
+{
+   if ( decrementLevel && (theIndentionLevel > 1) && theTabString.size() )
+   {
+      ossimString tab;
+      for (ossim_uint32 i = 0; i < theIndentionLevel-1; ++i)
+      {
+         tab += theTabString;
+      }
+
+      os << tab.c_str();
+   }
+   
+   os << "</" << tag.c_str() << ">\n";
+
+   if (theIndentionLevel && decrementLevel)
+   {
+      --theIndentionLevel;
+   }
+}
+
+void ossimFgdcFileWriter::setTemplate(const ossimFilename& xmlTemplateFile)
+{
+   theTemplate.openFile(xmlTemplateFile);
+}
+
+ossimString ossimFgdcFileWriter::find(const ossimString& xpath) const
+{
+   ossimString result;
+
+   if (theTemplate.getErrorStatus())
+   {
+      return result;
+   }
+   
+   vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
+   theTemplate.findNodes(xpath, xml_nodes);
+
+   if (xml_nodes.size())
+   {
+      if (xml_nodes[0].valid())
+      {
+         result = xml_nodes[0]->getText();
+      }
+   }
+   return result;
+}
+
+void ossimFgdcFileWriter::getMetadatatypeList(
+   std::vector<ossimString>& metadatatypeList) const
+{
+   metadatatypeList.push_back(ossimString("ossim_fgdc")); 
+}
+
+bool ossimFgdcFileWriter::hasMetadataType(
+   const ossimString& metadataType)const
+{
+   return (metadataType == "ossim_fgdc");
+}
diff --git a/src/imaging/ossimFilter.cpp b/src/imaging/ossimFilter.cpp
new file mode 100644
index 0000000..7ec2bd4
--- /dev/null
+++ b/src/imaging/ossimFilter.cpp
@@ -0,0 +1,330 @@
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%                        ZZZZZ   OOO    OOO   M   M                           %
+%                           ZZ  O   O  O   O  MM MM                           %
+%                         ZZZ   O   O  O   O  M M M                           %
+%                        ZZ     O   O  O   O  M   M                           %
+%                        ZZZZZ   OOO    OOO   M   M                           %
+%                                                                             %
+%                                                                             %
+%                      ImageMagick Image Zoom Methods                         %
+%                                                                             %
+%                                                                             %
+%                              Software Design                                %
+%                                John Cristy                                  %
+%                                 July 1992                                   %
+%                                                                             %
+%                                                                             %
+%  Copyright (C) 2000 ImageMagick Studio, a non-profit organization dedicated %
+%  to making software imaging solutions freely available.                     %
+%                                                                             %
+%  Permission is hereby granted, free of charge, to any person obtaining a    %
+%  copy of this software and associated documentation files ("ImageMagick"),  %
+%  to deal in ImageMagick without restriction, including without limitation   %
+%  the rights to use, copy, modify, merge, publish, distribute, sublicense,   %
+%  and/or sell copies of ImageMagick, and to permit persons to whom the       %
+%  ImageMagick is furnished to do so, subject to the following conditions:    %
+%                                                                             %
+%  The above copyright notice and this permission notice shall be included in %
+%  all copies or substantial portions of ImageMagick.                         %
+%                                                                             %
+%  The software is provided "as is", without warranty of any kind, express or %
+%  implied, including but not limited to the warranties of merchantability,   %
+%  fitness for a particular purpose and noninfringement.  In no event shall   %
+%  ImageMagick Studio be liable for any claim, damages or other liability,    %
+%  whether in an action of contract, tort or otherwise, arising from, out of  %
+%  or in connection with ImageMagick or the use or other dealings in          %
+%  ImageMagick.                                                               %
+%                                                                             %
+%  Except as contained in this notice, the name of the ImageMagick Studio     %
+%  shall not be used in advertising or otherwise to promote the sale, use or  %
+%  other dealings in ImageMagick without prior written authorization from the %
+%  ImageMagick Studio.                                                        %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+%
+*/
+#include <ossim/base/ossimConstants.h>
+#include <ossim/imaging/ossimFilter.h>
+#include <ossim/matrix/newmat.h>
+#include <iostream>
+
+
+RTTI_DEF(ossimFilter, "ossimFilter");
+RTTI_DEF1(ossimBoxFilter, "ossimBoxFilter",ossimFilter);
+RTTI_DEF1(ossimSincFilter, "ossimSincFilter",ossimFilter);
+RTTI_DEF1(ossimBellFilter, "ossimBellFilter",ossimFilter);
+RTTI_DEF1(ossimNearestNeighborFilter, "ossimNearestNeighborFilter",ossimFilter);
+RTTI_DEF1(ossimBesselFilter, "ossimBesselFilter",ossimFilter);
+RTTI_DEF1(ossimBesselOrderOneFilter, "ossimBesselOrderOneFilter",ossimFilter);
+RTTI_DEF1(ossimBlackmanFilter, "ossimBlackmanFilter",ossimFilter);
+RTTI_DEF1(ossimBlackmanSincFilter, "ossimBlackmanSincFilter",ossimFilter);
+RTTI_DEF1(ossimBlackmanBesselFilter, "ossimBlackmanBesselFilter",ossimFilter);
+RTTI_DEF1(ossimCatromFilter, "ossimCatromFilter",ossimFilter);
+RTTI_DEF1(ossimCubicFilter, "ossimCubicFilter",ossimFilter);
+RTTI_DEF1(ossimBSplineFilter, "ossimBSplineFilter",ossimFilter);
+RTTI_DEF1(ossimGaussianFilter, "ossimGaussianFilter",ossimFilter);
+RTTI_DEF1(ossimHanningFilter, "ossimHanningFilter",ossimFilter);
+RTTI_DEF1(ossimHammingFilter, "ossimHammingFilter",ossimFilter);
+RTTI_DEF1(ossimHermiteFilter, "ossimHermiteFilter",ossimFilter);
+RTTI_DEF1(ossimLanczosFilter, "ossimLanczosFilter",ossimFilter);
+RTTI_DEF1(ossimMitchellFilter, "ossimMitchellFilter",ossimFilter);
+RTTI_DEF1(ossimQuadraticFilter, "ossimQuadraticFilter",ossimFilter);
+RTTI_DEF1(ossimTriangleFilter, "ossimTriangleFilter",ossimFilter);
+RTTI_DEF1(ossimMagicFilter, "ossimMagicFilter",ossimFilter);
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
++   B e s s e l O r d e r O n e                                               %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  Method BesselOrderOne computes the Bessel function of x of the first kind
+%  of order 0:
+%
+%    Reduce x to |x| since j1(x)= -j1(-x), and for x in (0,8]
+%
+%       j1(x) = x*j1(x);
+%
+%    For x in (8,inf)
+%
+%       j1(x) = sqrt(2/(pi*x))*(p1(x)*cos(x1)-q1(x)*sin(x1))
+%
+%    where x1 = x-3*pi/4. Compute sin(x1) and cos(x1) as follow:
+%
+%       cos(x1) =  cos(x)cos(3pi/4)+sin(x)sin(3pi/4)
+%               =  1/sqrt(2) * (sin(x) - cos(x))
+%       sin(x1) =  sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
+%               = -1/sqrt(2) * (sin(x) + cos(x))
+%
+%  The format of the BesselOrderOne method is:
+%
+%      double BesselOrderOne(double x)
+%
+%  A description of each parameter follows:
+%
+%    o value: Method BesselOrderOne returns the Bessel function of x of the
+%      first kind of orders 1.
+%
+%    o x: double value.
+%
+%
+*/
+
+static double J1(double x)
+{
+  double
+    p,
+    q;
+
+  int
+    i;
+
+  static const double
+    Pone[] =
+    {
+       0.581199354001606143928050809e+21,
+      -0.6672106568924916298020941484e+20,
+       0.2316433580634002297931815435e+19,
+      -0.3588817569910106050743641413e+17,
+       0.2908795263834775409737601689e+15,
+      -0.1322983480332126453125473247e+13,
+       0.3413234182301700539091292655e+10,
+      -0.4695753530642995859767162166e+7,
+       0.270112271089232341485679099e+4
+    },
+    Qone[] =
+    {
+      0.11623987080032122878585294e+22,
+      0.1185770712190320999837113348e+20,
+      0.6092061398917521746105196863e+17,
+      0.2081661221307607351240184229e+15,
+      0.5243710262167649715406728642e+12,
+      0.1013863514358673989967045588e+10,
+      0.1501793594998585505921097578e+7,
+      0.1606931573481487801970916749e+4,
+      0.1e+1
+    };
+
+  p=Pone[8];
+  q=Qone[8];
+  for (i=7; i >= 0; i--)
+  {
+    p=p*x*x+Pone[i];
+    q=q*x*x+Qone[i];
+  }
+  return(p/q);
+}
+
+static double P1(double x)
+{
+  double
+    p,
+    q;
+
+  int
+    i;
+
+  static const double
+    Pone[] =
+    {
+      0.352246649133679798341724373e+5,
+      0.62758845247161281269005675e+5,
+      0.313539631109159574238669888e+5,
+      0.49854832060594338434500455e+4,
+      0.2111529182853962382105718e+3,
+      0.12571716929145341558495e+1
+    },
+    Qone[] =
+    {
+      0.352246649133679798068390431e+5,
+      0.626943469593560511888833731e+5,
+      0.312404063819041039923015703e+5,
+      0.4930396490181088979386097e+4,
+      0.2030775189134759322293574e+3,
+      0.1e+1
+    };
+
+  p=Pone[5];
+  q=Qone[5];
+  for (i=4; i >= 0; i--)
+  {
+    p=p*(8.0/x)*(8.0/x)+Pone[i];
+    q=q*(8.0/x)*(8.0/x)+Qone[i];
+  }
+  return(p/q);
+}
+
+static double Q1(double x)
+{
+   double p, q;
+   int i;
+   
+   static const double
+      Pone[] =
+   {
+      0.3511751914303552822533318e+3,
+      0.7210391804904475039280863e+3,
+      0.4259873011654442389886993e+3,
+      0.831898957673850827325226e+2,
+      0.45681716295512267064405e+1,
+      0.3532840052740123642735e-1
+   },
+      Qone[] =
+      {
+         0.74917374171809127714519505e+4,
+         0.154141773392650970499848051e+5,
+         0.91522317015169922705904727e+4,
+         0.18111867005523513506724158e+4,
+         0.1038187585462133728776636e+3,
+         0.1e+1
+      };
+      
+      p=Pone[5];
+      q=Qone[5];
+      for (i=4; i >= 0; i--)
+      {
+         p=p*(8.0/x)*(8.0/x)+Pone[i];
+         q=q*(8.0/x)*(8.0/x)+Qone[i];
+      }
+      return(p/q);
+}
+
+double ossimBesselOrderOneFilter::filter(double x, double /* support */)const
+{
+   double
+      p,
+      q;
+   
+   if (x == 0.0)
+      return(0.0);
+   p=x;
+   if (x < 0.0)
+      x=(-x);
+   if (x < 8.0)
+      return(p*J1(x));
+   q=sqrt(2.0/(M_PI*x))*(P1(x)*(1.0/sqrt(2.0)*(sin(x)-cos(x)))-8.0/x*Q1(x)*
+                         (-1.0/sqrt(2.0)*(sin(x)+cos(x))));
+   if (p < 0.0)
+      q=(-q);
+   return(q);
+
+}
+
+void ossimFilter::createMatrix(NEWMAT::Matrix& m,
+                               long width,
+                               double middle,
+                               double scale)const
+{
+   NEWMAT::ColumnVector colVec(width);
+   NEWMAT::RowVector    rowVec(width);
+
+   double t = 0.0;
+   double val = 0.0;
+   if(width == 1)
+   {
+      t = 0;
+      val = filter(t, getSupport());
+      colVec[0] = val;
+      rowVec[0] = val;
+   }
+   else
+   {
+      for(long index = 0; index < width; index++)
+      {
+         t = (double)index/(double)(width-1);
+         t = middle + (t - .5)*scale;
+         val = filter(t, getSupport());
+         colVec[index] = val;
+         rowVec[index] = val;
+      }
+   }
+
+   // do the outer product to construct the
+   // filter matrix
+   m = colVec * rowVec;
+}
+
+
+NEWMAT::Matrix *ossimFilter::newMatrix(long width,
+                                       double middle,
+                                       double scale)const
+{
+   NEWMAT::Matrix *result = new NEWMAT::Matrix(width, width);
+
+   createMatrix(*result,
+                width,
+                middle,
+                scale);
+
+   return result;
+}
+
+NEWMAT::RowVector *ossimFilter::newVector(long width,
+                                          double middle,
+                                          double scale)const
+{
+   NEWMAT::RowVector *result = new NEWMAT::RowVector(width);
+
+
+   double t = 0.0;
+   double val = 0.0;
+   for(long index = 0; index < width; index++)
+   {
+      t = (double)index/(double)(width-1);
+      t = middle + (t- .5)*scale;
+      val = filter(t, getSupport());
+      (*result)[index] = val;
+   }
+
+   return result;
+}
diff --git a/src/imaging/ossimFilterResampler.cpp b/src/imaging/ossimFilterResampler.cpp
new file mode 100644
index 0000000..81ef61e
--- /dev/null
+++ b/src/imaging/ossimFilterResampler.cpp
@@ -0,0 +1,954 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+
+// Contributor:
+//         David A. Horner (DAH) http://dave.thehorners.com
+//
+//*************************************************************************
+// $Id: ossimFilterResampler.cpp 23586 2015-10-19 10:45:22Z gpotts $
+
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/imaging/ossimFilterTable.h>
+ossimFilterResampler::ossimFilterResampler()
+   :theMinifyFilter(new ossimNearestNeighborFilter()),
+    theMagnifyFilter(new ossimNearestNeighborFilter()),
+    theMinifyFilterType(ossimFilterResampler_NEAREST_NEIGHBOR),
+    theMagnifyFilterType(ossimFilterResampler_NEAREST_NEIGHBOR),
+    theScaleFactor(1.0, 1.0),
+    theInverseScaleFactor(1.0, 1.0),
+    theBlurFactor(1.0)
+{
+   setScaleFactor(ossimDpt(1.0, 1.0));
+   loadState(ossimPreferences::instance()->preferencesKWL(),"resampler.");
+
+}
+
+ossimFilterResampler::~ossimFilterResampler()
+{
+   if(theMinifyFilter)
+   {
+      delete theMinifyFilter;
+      theMinifyFilter = NULL;
+   }
+   if(theMagnifyFilter)
+   {
+      delete theMagnifyFilter;
+      theMagnifyFilter = NULL;
+   }
+}
+
+
+void ossimFilterResampler::resample(const ossimRefPtr<ossimImageData>& input,
+				    ossimRefPtr<ossimImageData>& output,
+				    const ossimDpt& ul,
+				    const ossimDpt& ur,
+				    const ossimDpt& deltaUl,
+				    const ossimDpt& deltaUr,
+				    const ossimDpt& length)
+{
+   resample(input,
+            output,
+            output->getImageRectangle(),
+            ul,
+            ur,
+            deltaUl,
+            deltaUr,
+            length);
+}
+
+void ossimFilterResampler::resample(const ossimRefPtr<ossimImageData>& input,
+				    ossimRefPtr<ossimImageData>& output,
+				    const ossimIrect& outputSubRect,
+				    const ossimDpt& ul,
+				    const ossimDpt& ur,
+				    const ossimDpt& deltaUl,
+				    const ossimDpt& deltaUr,
+				    const ossimDpt& length)
+{
+   if(!input.valid()   ||
+      !output.valid()  ||
+      !input->getBuf() ||
+      !output->getBuf())
+   {
+      return;
+   }
+   
+   ossimScalarType scalarType = input->getScalarType();
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      {
+         resampleBilinearTile(ossim_uint8(0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+			      ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         resampleBilinearTile(ossim_sint8(0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+			      ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+	 resampleBilinearTile(ossim_uint16(0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+			      ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+	 break;
+      }
+      case OSSIM_SINT16:
+      {
+	 resampleBilinearTile(ossim_sint16(0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+			      ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+	 break;
+      }      
+      case OSSIM_UINT32:
+      {
+	 resampleBilinearTile(ossim_uint32(0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+			      ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+	 break;
+      }      
+      case OSSIM_SINT32:
+      {
+	 resampleBilinearTile(ossim_sint32(0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+			      ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+	 break;
+      }      
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+	 resampleBilinearTile(ossim_float32(0.0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+               ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+	 break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+	 resampleBilinearTile(ossim_float64(0.0), // dummy template variable
+			      input,
+			      output,
+			      outputSubRect,
+			      ul,
+			      ur,
+			      deltaUl,
+			      deltaUr,
+			      length);
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimFilterResampler::resample error: unknown scalar type:  "
+            << scalarType << endl;
+      }
+   }
+}
+
+
+ossimFilter* ossimFilterResampler::createNewFilter(
+   ossimFilterResamplerType filterType,
+   ossimFilterResamplerType& result)
+{
+   switch(filterType)
+   {
+      case ossimFilterResampler_NEAREST_NEIGHBOR:
+      {
+         return new ossimNearestNeighborFilter();
+      }
+      case ossimFilterResampler_BOX:
+      {
+         return new ossimBoxFilter();
+      }
+      case ossimFilterResampler_GAUSSIAN:
+      {
+         return new ossimGaussianFilter();
+      }
+      case ossimFilterResampler_CUBIC:
+      {
+         return new ossimCubicFilter();
+      }
+      case ossimFilterResampler_HANNING:
+      {
+         return new ossimHanningFilter();
+      }
+      case ossimFilterResampler_HAMMING:
+      {
+         return new ossimHammingFilter();
+      }
+      case ossimFilterResampler_LANCZOS:
+      {
+         return new ossimLanczosFilter();
+      }
+      case ossimFilterResampler_CATROM:
+      {
+         return new ossimCatromFilter();
+      }
+      case ossimFilterResampler_MITCHELL:
+      {
+         return new ossimMitchellFilter();
+      }
+      case ossimFilterResampler_BLACKMAN:
+      {
+         return new ossimBlackmanFilter();
+      }
+      case ossimFilterResampler_BLACKMAN_SINC:
+      {
+         return new ossimBlackmanSincFilter();
+      }
+      case ossimFilterResampler_BLACKMAN_BESSEL:
+      {
+         return new ossimBlackmanBesselFilter();
+      }
+      case ossimFilterResampler_QUADRATIC:
+      {
+         return new ossimQuadraticFilter();
+      }
+      case ossimFilterResampler_TRIANGLE:
+      {
+         return new ossimTriangleFilter();
+      }
+      case ossimFilterResampler_HERMITE:
+      {
+         return new ossimHermiteFilter();
+      }
+      case ossimFilterResampler_BELL:
+      {
+         return new ossimGaussianFilter();
+      }
+      case ossimFilterResampler_BSPLINE:
+      {
+         return new ossimBSplineFilter();
+      }
+      case ossimFilterResampler_MAGIC:
+      {
+         return new ossimBSplineFilter();
+      }
+   }
+
+   result = ossimFilterResampler_NEAREST_NEIGHBOR;
+   return new ossimNearestNeighborFilter();
+}
+
+void ossimFilterResampler::setScaleFactor(const ossimDpt& scale)
+{
+   theScaleFactor = scale;
+   if(fabs(theScaleFactor.x) <= FLT_EPSILON)
+   {
+      theScaleFactor.x = 1.0;
+   }
+   if(fabs(theScaleFactor.y) <= FLT_EPSILON)
+   {
+      theScaleFactor.y = 1.0;
+   }
+
+   theInverseScaleFactor.x = 1.0/theScaleFactor.x;
+   theInverseScaleFactor.y = 1.0/theScaleFactor.y;
+}
+
+template <class T> void ossimFilterResampler::resampleBilinearTile(
+   T /* dummy */,
+   const ossimRefPtr<ossimImageData>& input,
+   ossimRefPtr<ossimImageData>& output,
+   const ossimIrect& outputSubRect,
+   const ossimDpt& inputUl,
+   const ossimDpt& inputUr,
+   const ossimDpt& deltaUl,
+   const ossimDpt& deltaUr,
+   const ossimDpt& outLength)
+{
+#if 0 /* Please leave for debug. */
+   std::cout << "INPUT  = \n" << *input << std::endl
+             << "OUTPUT = \n" << *output << std::endl
+             << "inputUL= " << inputUl << std::endl
+             << "inputUR= " << inputUr << std::endl
+             << "deltaUL= " << deltaUl << std::endl
+             << "deltaUr= " << deltaUr << std::endl
+             << "outlength= " << outLength << std::endl;
+#endif
+   
+   ossim_uint32  band, centerOffset;
+   ossim_float64 tmpFlt64, stepSizeWidth;
+
+   if(outLength.x>1) {
+      stepSizeWidth  = 1.0/(outLength.x-1.0);
+   } else {
+      stepSizeWidth   = 1.0;
+   }
+
+   // INPUT INFORMATION
+   ossim_uint32       inWidth      = input->getWidth();
+   ossim_uint32       inBandSize   = input->getSizePerBand();  // fix for out-of-bounds check OLK 06/2005
+   ossim_uint32       BANDS        = input->getNumberOfBands();
+   ossimIrect         inputRect    = input->getImageRectangle();
+
+   // OUTPUT INFORMATION
+   const ossim_float64* NULL_PIX      = output->getNullPix(); 
+   const ossim_float64* MIN_PIX       = output->getMinPix(); 
+   const ossim_float64* MAX_PIX       = output->getMaxPix(); 
+   ossimIrect           outputRect    = output->getImageRectangle();
+   ossim_uint32         resultRectH   = outputSubRect.height();
+   ossim_uint32         resultRectW   = outputSubRect.width();
+   ossim_uint32         outputRectW   = outputRect.width();
+
+   // calculate the offset into the data so we can refer to it at 0 index.
+   ossim_uint32 resultOffset=(outputSubRect.ul().y - outputRect.ul().y)*outputRectW +
+                             (outputSubRect.ul().x - outputRect.ul().x);
+
+   // make a local copy of the band pointers (at resultOffset)
+   ossim_float64 *densityvals=new ossim_float64[BANDS];
+   ossim_float64 *pixelvals=new ossim_float64[BANDS];
+   const T* *inputBuf  = new const T*[BANDS];
+   T* *resultBuf = new T*[BANDS];
+   if(!pixelvals||!inputBuf||!resultBuf)
+   {
+      return;
+   }
+   
+   for(band = 0; band < BANDS; ++band)
+   {
+      inputBuf[band] = static_cast<const T*>(input->getBuf(band));
+      resultBuf[band] = static_cast<T*>(output->getBuf(band))+resultOffset;
+   }
+
+   // FILTER INFORMAION
+   ossim_uint32 xkernel_width  = theFilterTable.getWidth();;
+   ossim_uint32 ykernel_height = theFilterTable.getHeight();
+   double xkernel_half_width   = theFilterTable.getXSupport();
+   double ykernel_half_height  = theFilterTable.getYSupport();
+
+   double initialx  = inputUl.x-inputRect.ul().x;
+   double initialy  = inputUl.y-inputRect.ul().y;
+   double terminalx = inputUr.x-inputRect.ul().x;
+   double terminaly = inputUr.y-inputRect.ul().y;
+   double pointx,pointy,deltaX,deltaY;
+   ossim_int32 starty,startx; 
+
+   if(xkernel_width==0 || ykernel_height==0)
+   {
+      // USING NEAREST NEIGHBOR
+      for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
+      {
+//          deltaX = (terminalx-initialx) * stepSizeWidth;
+//          deltaY = (terminaly-initialy) * stepSizeHeight;
+         // this should be stepsize width for both since we are traversing horizontal
+         deltaX = (terminalx-initialx) * stepSizeWidth;
+         deltaY = (terminaly-initialy) * stepSizeWidth;
+         pointx = initialx;
+         pointy = initialy;
+         for(ossim_uint32 resultX = 0; resultX < resultRectW; ++resultX)
+         {
+            // just sample center in input space.
+            centerOffset = ossim::round<int>(pointy)*inWidth + ossim::round<int>(pointx);
+            for(band=0;band<BANDS;++band)
+            {
+               resultBuf[band][resultX] = inputBuf[band][centerOffset];
+            }
+            pointy += deltaY;
+            pointx += deltaX;
+         } // End of loop in x direction.
+         
+         // increment pointers to where we are now.
+         for(band=0;band<BANDS;++band)
+         {
+            resultBuf[band] += outputRectW;
+         }
+         initialx += deltaUl.x;
+         initialy += deltaUl.y;
+         terminalx  += deltaUr.x;
+         terminaly  += deltaUr.y;
+      } // End of loop in y direction.
+      
+   }
+   else
+   {
+      // USING A KERNEL
+      const double* kernel;
+      ossim_uint32 iy,ix,sourceIndex,nullCount;
+      for(ossim_uint32 resultY = 0; resultY < resultRectH; ++resultY)
+      {
+         deltaX = (terminalx-initialx) * stepSizeWidth;
+         deltaY = (terminaly-initialy) * stepSizeWidth;
+         pointx = initialx;
+         pointy = initialy;
+         for(ossim_uint32 resultX = 0; resultX < resultRectW; ++resultX)
+         {
+            starty  = ossim::round<int>(pointy - ykernel_half_height + .5);
+            startx  = ossim::round<int>(pointx - xkernel_half_width + .5);
+            centerOffset = ossim::round<int>(pointy)*inWidth + ossim::round<int>(pointx);
+            sourceIndex = starty*inWidth+startx;
+
+            // look at center pixel, make sure they aren't all null.
+            nullCount=0;
+            if(centerOffset<inBandSize)
+            {
+               for (band=0;band<BANDS;++band)
+               {
+                  if(inputBuf[band][centerOffset]==static_cast<T>(NULL_PIX[band]))
+                  {
+                     ++nullCount;
+                  }
+               }
+               // the center of the kernel is outside the input space, just set null.
+            }
+            else
+            {
+               nullCount=BANDS;
+            }
+
+            // make sure we have non-null data and we fit within the inputBuf.
+            if ( nullCount==BANDS || (sourceIndex>=inBandSize))
+            {
+               // we don't need to continue, just assign null!
+               for (band=0;band<BANDS;++band)
+               {
+                  resultBuf[band][resultX] = static_cast<T>(NULL_PIX[band]);
+               }
+            }
+            else
+            {  
+               kernel = theFilterTable.getClosestWeights(pointx,pointy);
+               if(kernel)
+               {
+                  // reset the pixel/density sums for each band to zero.
+                  memset(densityvals,'\0',sizeof(ossim_float64)*BANDS);
+                  memset(pixelvals,'\0',sizeof(ossim_float64)*BANDS);
+
+                  // apply kernel to input space.
+                  for (iy=0;((iy<ykernel_height)&&(sourceIndex<inBandSize));++iy)
+                  {
+                     for (ix = 0;((ix<xkernel_width)&&(sourceIndex<inBandSize));++ix)
+                     {
+                        tmpFlt64=*kernel; // pixel weight;
+                        for(band=0;band<BANDS;++band)
+                        {
+                           if(inputBuf[band][sourceIndex]!=NULL_PIX[band])
+                           {
+                              densityvals[band] += tmpFlt64;
+                              pixelvals[band] += (inputBuf[band][sourceIndex]*tmpFlt64);
+                           }
+                        }
+                        ++sourceIndex;
+                        ++kernel;
+                        if(sourceIndex>=inBandSize)
+                        {
+                           break;
+                        }
+                     }
+                     sourceIndex+=(inWidth-xkernel_width);
+                  }
+
+                  // actually assign the value to the output
+                  for (band = 0; band < BANDS; ++band)
+                  {
+                     if(densityvals[band]<=FLT_EPSILON)
+                     {
+                        //---
+                        // Setting tempFlt64 to pixelvals[band] causing 0's where -32768
+                        // should be when null check was skipped above.
+                        // tmpFlt64 = pixelvals[band];
+                        //---
+                        tmpFlt64 = NULL_PIX[band];
+                     }
+                     else
+                     {
+                        // normalize
+                        tmpFlt64 = pixelvals[band]/densityvals[band];
+                     }
+                     
+                     // clamp
+                     tmpFlt64 = (tmpFlt64>=MIN_PIX[band]?(tmpFlt64<MAX_PIX[band]?tmpFlt64:MAX_PIX[band]):MIN_PIX[band]); 
+                     // set resultant pixel value.
+                     resultBuf[band][resultX] = static_cast<T>(tmpFlt64);
+                  }
+
+                  // we didn't get a filter kernel, just set NULL in this disaster.
+               }
+               else
+               {
+                  for (band=0;band<BANDS;++band)
+                  {
+                     resultBuf[band][resultX] = static_cast<T>(NULL_PIX[band]);
+                  }
+               }                  
+            }
+            pointy += deltaY;
+            pointx += deltaX;
+         } // End of loop in x direction.
+
+         // increment pointers to where we are now.
+         for(band=0;band<BANDS;++band)
+         {
+            resultBuf[band] += outputRectW;
+         }
+         initialx += deltaUl.x;
+         initialy += deltaUl.y;
+         terminalx  += deltaUr.x;
+         terminaly  += deltaUr.y;
+      } // End of loop in y direction.
+   } // USING A KERNEL END
+
+   delete [] densityvals;
+   delete [] pixelvals;
+   delete [] resultBuf;
+   delete [] inputBuf;
+}
+
+ossimString ossimFilterResampler::getFilterTypeAsString(ossimFilterResamplerType type)const
+{
+   switch(type)
+   {
+      case ossimFilterResampler_NEAREST_NEIGHBOR:
+      {
+         return "nearest neighbor";
+      }
+      case ossimFilterResampler_BOX:
+      {
+         return "box";
+      }
+      case ossimFilterResampler_GAUSSIAN:
+      {
+         return "gaussian";
+      }
+      case ossimFilterResampler_CUBIC:
+      {
+         return "cubic";
+      }
+      case ossimFilterResampler_HANNING:
+      {
+         return "hanning";
+      }
+      case ossimFilterResampler_HAMMING:
+      {
+         return "hamming";
+      }
+      case ossimFilterResampler_LANCZOS:
+      {
+         return "lanczos";
+      }
+      case ossimFilterResampler_MITCHELL:
+      {
+         return "mitchell";
+      }
+      case ossimFilterResampler_CATROM:
+      {
+         return "catrom";
+      }
+      case ossimFilterResampler_BLACKMAN:
+      {
+         return "blackman";
+      }
+      case ossimFilterResampler_BLACKMAN_SINC:
+      {
+         return "sinc";
+      }
+      case ossimFilterResampler_BLACKMAN_BESSEL:
+      {
+         return "bessel";
+      }
+      case ossimFilterResampler_QUADRATIC:
+      {
+         return "quadratic";
+      }
+      case ossimFilterResampler_TRIANGLE:
+      {
+         return "bilinear";
+      }
+      case ossimFilterResampler_HERMITE:
+      {
+         return "hermite";
+      }
+      case ossimFilterResampler_BELL:
+      {
+         return "gaussian";
+      }
+      case ossimFilterResampler_BSPLINE:
+      {
+         return "bspline";
+      }
+      case ossimFilterResampler_MAGIC:
+      {
+         return "magic";
+      }
+   }
+
+   return "nearest neighbor";
+}
+
+void ossimFilterResampler::getFilterTypes(std::vector<ossimString>& filterTypes)const
+{
+  filterTypes.push_back("nearest neighbor");
+  filterTypes.push_back("bilinear");
+  filterTypes.push_back("cubic");
+//  filterTypes.push_back("bell");
+  filterTypes.push_back("bessel");
+  filterTypes.push_back("blackman");
+  filterTypes.push_back("box");
+  filterTypes.push_back("bspline");
+  filterTypes.push_back("catrom");
+  filterTypes.push_back("gaussian");
+  filterTypes.push_back("hanning");
+  filterTypes.push_back("hamming");
+  filterTypes.push_back("hermite");
+  filterTypes.push_back("lanczos");
+  filterTypes.push_back("mitchell");
+  filterTypes.push_back("quadratic");
+  filterTypes.push_back("sinc");
+  filterTypes.push_back("magic");
+}
+
+
+ossimFilterResampler::ossimFilterResamplerType ossimFilterResampler::getFilterType(const ossimString& type)const
+{
+   ossimString typeUpper = type;
+   typeUpper = typeUpper.upcase();
+
+   if(typeUpper.contains("BOX"))
+   {
+      return ossimFilterResampler_BOX;
+   }
+   else if(typeUpper.contains("NEAREST"))
+   {
+      return ossimFilterResampler_NEAREST_NEIGHBOR;
+   }
+   else if(typeUpper.contains("GAUSSIAN"))
+   {
+      return ossimFilterResampler_GAUSSIAN;
+   }
+   else if(typeUpper.contains("HANNING"))
+   {
+      return ossimFilterResampler_HANNING;
+   }
+   else if(typeUpper.contains("HAMMING"))
+   {
+      return ossimFilterResampler_HAMMING;
+   }
+   else if(typeUpper.contains("LANCZOS"))
+   {
+      return ossimFilterResampler_LANCZOS;
+   }
+   else if(typeUpper.contains("MITCHELL"))
+   {
+      return ossimFilterResampler_MITCHELL;
+   }
+   else if(typeUpper.contains("CATROM"))
+   {
+      return ossimFilterResampler_CATROM;
+   }
+   else if(typeUpper.contains("CUBIC"))
+   {
+      return ossimFilterResampler_CUBIC;
+   }
+   else if(typeUpper.contains("BESSEL"))
+   {
+      return ossimFilterResampler_BLACKMAN_BESSEL;
+   }
+   else if(typeUpper.contains("SINC"))
+   {
+      return ossimFilterResampler_BLACKMAN_SINC;
+   }
+   else if(typeUpper.contains("BLACKMAN"))
+   {
+      return ossimFilterResampler_BLACKMAN;
+   }
+   else if(typeUpper.contains("QUADRATIC"))
+   {
+      return ossimFilterResampler_QUADRATIC;
+   }
+   else if(typeUpper.contains("TRIANGLE"))
+   {
+      return ossimFilterResampler_TRIANGLE;
+   }
+   else if(typeUpper.contains("BILINEAR"))
+   {
+      return ossimFilterResampler_TRIANGLE;
+   }
+   else if(typeUpper.contains("HERMITE"))
+   {
+      return ossimFilterResampler_HERMITE;
+   }
+//    else if(typeUpper.contains("BELL"))
+//    {
+//       return ossimFilterResampler_BELL;
+//    }
+   else if(typeUpper.contains("BSPLINE"))
+   {
+      return ossimFilterResampler_BSPLINE;
+   }
+   else if(typeUpper.contains("MAGIC"))
+   {
+      return ossimFilterResampler_MAGIC;
+   }
+   
+   return ossimFilterResampler_NEAREST_NEIGHBOR;
+}
+
+void ossimFilterResampler::getKernelSupport(double& x, double& y)const
+{
+   const ossimFilter* horizontalFilter = getHorizontalFilter();
+   const ossimFilter* verticalFilter   = getVerticalFilter();
+
+   if(!horizontalFilter)
+   {
+      x = 0.0;
+   }
+   else
+   {
+//       x = theBlurFactor*ossim::max(1.0/theScaleFactor.x, 1.0)*
+//           horizontalFilter->getSupport();
+      x = horizontalFilter->getSupport();
+   }
+
+   if(!verticalFilter)
+   {
+      y = 0.0;
+   }
+   else
+   {
+//       y = theBlurFactor*ossim::max(1.0/theScaleFactor.y, 1.0)*
+//           verticalFilter->getSupport();
+      y = verticalFilter->getSupport();
+   }
+}
+
+const ossimFilter* ossimFilterResampler::getHorizontalFilter()const
+{
+   if(theScaleFactor.x < 1)
+   {
+      return theMinifyFilter;
+   }
+
+   return theMagnifyFilter;
+}
+
+const ossimFilter* ossimFilterResampler::getVerticalFilter()const
+{
+   if(theScaleFactor.y < 1)
+   {
+      return theMinifyFilter;
+   }
+
+   return theMagnifyFilter;
+}
+
+void ossimFilterResampler::setFilterType(const ossimString& type)
+{
+   setFilterType(type, type);
+}
+
+void ossimFilterResampler::setFilterType(ossimFilterResamplerType filterType)
+{
+   setFilterType(filterType, filterType);
+}
+void ossimFilterResampler::setFilterType(const ossimString& minifyType,
+                                         const ossimString& magnifyType)
+{
+   setFilterType(getFilterType(minifyType),
+                 getFilterType(magnifyType));
+}
+
+void ossimFilterResampler::setMinifyFilterType(const ossimString& minifyType)
+{
+   setMinifyFilterType(getFilterType(minifyType));
+}
+
+void ossimFilterResampler::setMagnifyFilterType(const ossimString& magnifyType)
+{
+   setMagnifyFilterType(getFilterType(magnifyType));
+}
+
+void ossimFilterResampler::setMinifyFilterType(ossimFilterResamplerType filterType)
+{
+   setFilterType(filterType,
+                 theMagnifyFilterType);
+}
+
+void ossimFilterResampler::setMagnifyFilterType(ossimFilterResamplerType filterType)
+{
+   setFilterType(theMinifyFilterType,filterType);
+}
+
+ossimString ossimFilterResampler::getMinifyFilterTypeAsString()const
+{
+   return getFilterTypeAsString(theMinifyFilterType);
+}
+
+ossimString ossimFilterResampler::getMagnifyFilterTypeAsString()const
+{
+   return getFilterTypeAsString(theMagnifyFilterType);
+}
+
+void ossimFilterResampler::setFilterType(
+   ossimFilterResamplerType minifyFilterType,
+   ossimFilterResamplerType magnifyFilterType)
+{
+   if(theMinifyFilter)
+   {
+      delete theMinifyFilter;
+      theMinifyFilter = NULL;
+   }
+   if(theMagnifyFilter)
+   {
+      delete theMagnifyFilter;
+      theMagnifyFilter = NULL;
+   }
+   
+   theMinifyFilterType  = minifyFilterType;
+   theMagnifyFilterType = magnifyFilterType;
+   
+   theMinifyFilter  = createNewFilter(minifyFilterType, theMinifyFilterType);
+   theMagnifyFilter = createNewFilter(magnifyFilterType, theMagnifyFilterType);
+   computeTable();
+}
+
+ossim_float64 ossimFilterResampler::getBlurFactor()const
+{
+   return theBlurFactor;
+}
+
+void ossimFilterResampler::setBlurFactor(ossim_float64 blur)
+{
+   theBlurFactor = blur;
+}
+
+bool ossimFilterResampler::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_X_KW,
+           theScaleFactor.x,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_Y_KW,
+           theScaleFactor.y,
+           true);
+   kwl.add(prefix,
+           "minify_type",
+           getFilterTypeAsString(theMinifyFilterType),
+           true);
+   kwl.add(prefix,
+           "magnify_type",
+           getFilterTypeAsString(theMagnifyFilterType),
+           true);
+
+   return true;
+}
+
+bool ossimFilterResampler::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   const char* lookup = 0;
+
+   lookup = kwl.find(prefix, ossimKeywordNames::SCALE_X_KW);
+   if (lookup)
+   {
+      theScaleFactor.x = ossimString(lookup).toDouble();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::SCALE_Y_KW);
+   if (lookup)
+   {
+      theScaleFactor.y = ossimString(lookup).toDouble();
+   }
+
+   ossimString minify;
+   lookup = kwl.find(prefix, "minify_type");
+   if (lookup)
+   {
+      minify = lookup;
+   }
+
+   ossimString magnify;
+   lookup = kwl.find(prefix, "magnify_type");
+   if (lookup)
+   {
+      magnify = lookup;
+   }
+
+   if(fabs(theScaleFactor.x) <= FLT_EPSILON)
+   {
+      theScaleFactor.x = 1.0;
+   }
+   if(fabs(theScaleFactor.y) <= FLT_EPSILON)
+   {
+      theScaleFactor.y = 1.0;
+   }
+
+   theInverseScaleFactor.x = 1.0/theScaleFactor.x;
+   theInverseScaleFactor.y = 1.0/theScaleFactor.y;
+   
+   setFilterType(getFilterType(minify),
+                 getFilterType(magnify));
+
+   return true;
+}
+
+void ossimFilterResampler::computeTable()
+{
+  theFilterTable.buildTable(32, *theMagnifyFilter);
+}
+
diff --git a/src/imaging/ossimFilterTable.cpp b/src/imaging/ossimFilterTable.cpp
new file mode 100644
index 0000000..c8c537d
--- /dev/null
+++ b/src/imaging/ossimFilterTable.cpp
@@ -0,0 +1,148 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimFilterTable.cpp 23604 2015-10-28 13:40:09Z gpotts $
+#include <iostream>
+#include <ossim/imaging/ossimFilterTable.h>
+#include <ossim/imaging/ossimFilter.h>
+
+ossimFilterTable::ossimFilterTable()
+   :theWeights(0),
+    theWidth(0),
+    theHeight(0),
+    theWidthHeight(0),
+    theXSupport(0),
+    theYSupport(0),
+    theFilterSteps(0)
+{
+   
+}
+
+ossimFilterTable::~ossimFilterTable()
+{
+   if(theWeights)
+   {
+      delete [] theWeights;
+      theWeights = 0;
+   }
+}
+
+void ossimFilterTable::buildTable(ossim_uint32  filterSteps,
+                                  const ossimFilter& filter)
+{
+   buildTable(filterSteps, filter, filter);
+}
+
+void ossimFilterTable::buildTable(ossim_uint32  filterSteps,
+                                  const ossimFilter& xFilter,
+                                  const ossimFilter& yFilter)
+{
+   ossim_int32 subpixelSample=0;
+   ossim_int32 subpixelLine=0;
+   double dx   = 0.0;
+   double dy   = 0.0;
+   double kernelH   = 0.0;
+   double kernelV   = 0.0;
+   double x = 0;
+   double y = 0;
+
+   double xsupport = ceil(xFilter.getSupport());
+   double ysupport = ceil(yFilter.getSupport());
+   double left    = 0;
+   double right   = 0;
+   double top     = 0;
+   double bottom  = 0;
+
+   theXSupport = (ossim_uint32)xsupport;
+   theYSupport = (ossim_uint32)ysupport;
+   theFilterSteps = filterSteps;
+   theWidth  = (2*theXSupport);
+   theHeight = (2*theYSupport);
+   theWidthHeight = theWidth*theHeight;
+   
+   allocateWeights();
+   left   = -(xsupport-1);
+   right  = xsupport;
+   top    = -(ysupport-1);
+   bottom = ysupport;
+   ossim_uint32 idx = 0;
+      
+   for (subpixelLine = 0; subpixelLine < (int)filterSteps; 
+        subpixelLine++)
+   {
+     
+     // Calculate subpixel sample step.
+     // ---------------------------------- 
+       dy = subpixelLine / (double)(filterSteps);
+       for (subpixelSample = 0; subpixelSample < (int)filterSteps; subpixelSample++)
+       {
+        
+         // Calculate subpixel sample step.
+         // ---------------------------------- 
+         dx = subpixelSample / (double)(filterSteps);
+         
+         for (kernelV=top; kernelV<=bottom;
+              kernelV++)
+         {
+             y = kernelV - dy;
+             double tempWeight = yFilter.filter(y, yFilter.getSupport());
+             for(kernelH=left; kernelH<=right;++kernelH)
+             {
+               x = kernelH - dx;
+                   
+               // Get the weight for the current pixel.
+               //   ----------------------------------------
+               theWeights[idx] = tempWeight*xFilter.filter(x, xFilter.getSupport());
+               ++idx;
+             }
+          }
+        }
+     }
+}
+
+ossim_uint32 ossimFilterTable::getWidthByHeight()const
+{
+   return theWidthHeight;
+}
+
+ossim_uint32 ossimFilterTable::getXSupport()const
+{
+   return theXSupport;
+}
+
+ossim_uint32 ossimFilterTable::getYSupport()const
+{
+   return theYSupport;
+}
+
+ossim_uint32 ossimFilterTable::getWidth()const
+{
+   return theWidth;
+}
+
+ossim_uint32 ossimFilterTable::getHeight()const
+{
+   return theHeight;
+}
+
+void ossimFilterTable::allocateWeights()
+{
+   if(theWeights)
+   {
+      delete [] theWeights;
+      theWeights = 0;
+   }
+
+   ossim_uint32 size = (theWidthHeight*(theFilterSteps*theFilterSteps));
+
+   if(size)
+   {
+      theWeights = new double[size];
+   }
+}
\ No newline at end of file
diff --git a/ossim/src/ossim/imaging/ossimFixedTileCache.cpp b/src/imaging/ossimFixedTileCache.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimFixedTileCache.cpp
rename to src/imaging/ossimFixedTileCache.cpp
diff --git a/ossim/src/ossim/imaging/ossimFusionCombiner.cpp b/src/imaging/ossimFusionCombiner.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimFusionCombiner.cpp
rename to src/imaging/ossimFusionCombiner.cpp
diff --git a/src/imaging/ossimGammaRemapper.cpp b/src/imaging/ossimGammaRemapper.cpp
new file mode 100644
index 0000000..5fe987d
--- /dev/null
+++ b/src/imaging/ossimGammaRemapper.cpp
@@ -0,0 +1,434 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kathy Minear
+//
+// Description: Takes in DNs for any number of bands
+// Converts DNs to Radiance at the satellite values Lsat
+// Converts Lsat to Surface Reflectance values
+//
+//*************************************************************************
+// $Id: ossimGammaRemapper.cpp 12980 2008-06-04 00:50:33Z dburken $
+
+#include <cstdlib>
+#include <cmath>
+
+#include <ossim/imaging/ossimGammaRemapper.h>
+#include <ossim/imaging/ossimAtCorrKeywords.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+
+RTTI_DEF1(ossimGammaRemapper, "ossimGammaRemapper", ossimImageSourceFilter)
+
+static const double DEFAULT_GAMMA = 1.0;
+
+
+static ossimTrace traceDebug("ossimGammaRemapper:debug");
+
+ossimGammaRemapper::ossimGammaRemapper(ossimObject* owner)
+   :
+      ossimImageSourceFilter  (owner),  // base class
+      theTile                 (NULL),
+      theBuffer               (NULL), 
+      theMinPixelValue        (0),
+      theMaxPixelValue        (0),
+      theGamma                (0),
+      theUserDisabledFlag     (false)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   disableSource();
+
+   // Construction not complete.
+}
+
+
+ossimGammaRemapper::ossimGammaRemapper(ossimImageSource* inputSource)
+   :
+      ossimImageSourceFilter  (NULL, inputSource),  // base class
+      theTile                 (NULL),
+      theBuffer               (NULL),
+      theMinPixelValue        (0),
+      theMaxPixelValue        (0),
+      theGamma                (0),
+      theUserDisabledFlag     (false)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   disableSource();
+
+   if (inputSource == NULL)
+   {
+      setErrorStatus();
+      cerr << "ossimGammaRemapper::ossimGammaRemapper ERROR:"
+           << "\nNull input source passed to constructor!" << endl;
+      return;
+   }
+
+   initialize();
+}
+
+
+ossimGammaRemapper::ossimGammaRemapper(ossimObject* owner,
+                                         ossimImageSource* inputSource)
+   :
+      ossimImageSourceFilter  (owner, inputSource),  // base class     
+      theTile                 (NULL),
+      theBuffer               (NULL),
+      theMinPixelValue        (0),
+      theMaxPixelValue        (0),
+      theGamma                (0)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   disableSource();
+
+   if (inputSource == NULL)
+   {
+      setErrorStatus();
+      cerr << "ossimGammaRemapper::ossimGammaRemapper ERROR:"
+           << "\nNull input source passed to constructor!" << endl;
+      return;
+   }
+
+   initialize();
+}
+
+ossimGammaRemapper::~ossimGammaRemapper()
+{
+   if (theBuffer)
+   {
+      delete [] theBuffer;
+      theBuffer = NULL;
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimGammaRemapper::getTile(const ossimIrect& tile_rect,
+                                            ossim_uint32 resLevel)
+{
+   if (!isInitialized())
+   {
+      cerr << "ossimGammaRemapper::getTile ERROR:"
+           << "\nNot initialized!"
+           << endl;
+      return ossimRefPtr<ossimImageData>();
+   }
+      
+   // Fetch tile from pointer from the input source.
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(
+      tile_rect, resLevel);
+
+   if (!inputTile.valid())  // Just in case...
+   {
+      cerr << "ossimGammaRemapper::getTile ERROR:"
+           << "\nReceived null pointer to tile from input source!"
+           << "\nReturning blank tile."
+           << endl;
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   // Get its status.
+   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
+   
+   //---
+   // Check for remap bypass:
+   //---
+   if (!theEnableFlag || tile_status == OSSIM_NULL ||!theTile.valid() ||
+       tile_status == OSSIM_EMPTY)
+   {
+      return inputTile;
+   }
+
+   ossim_uint32 w     = tile_rect.width();
+   ossim_uint32 h     = tile_rect.height();
+   ossim_uint32 tw    = theTile->getWidth();
+   ossim_uint32 th    = theTile->getHeight();
+   ossim_uint32 bands = theTile->getNumberOfBands();
+
+   // Set the origin of the output tile.
+   theTile->setOrigin(tile_rect.ul());
+
+   if(w*h != tw*th)
+   {
+      theTile->setWidthHeight(w, h);
+      theTile->initialize();
+      if(theBuffer)
+      {
+         delete [] theBuffer;
+         theBuffer = NULL;
+      }
+   }   
+   
+   if(!theBuffer)
+   {
+      theBuffer = new double[w*h*bands];
+   }
+   
+   // Copy the source tile into the buffer at the same time normalizing it.
+   inputTile->copyTileToNormalizedBuffer(theBuffer);
+   
+   // for each band, get the radiance value
+
+   ossim_uint32 buffer_index = 0;
+   const double MP = theTile->getMinNormalizedPix(); // Minimum normalized pix.
+   const ossim_uint32 PPTB = theTile->getSizePerBand();  // Pixels Per Tile Band
+
+   for (ossim_uint32 band=0; band<bands; ++band)
+   {
+      for (ossim_uint32 i=0; i<PPTB; ++i)
+      {
+         double p = theBuffer[buffer_index]; // input pixel
+         // double p = getPix(buffer_index);
+
+         if (p)
+         {
+            // cout<<"p before:  "<<p<<endl;
+            // Stretch it...
+            p = (p - theMinPixelValue[band]) /
+               (theMaxPixelValue[band] -
+                theMinPixelValue[band]);
+            
+            p = pow(p, theGamma[band]);
+           
+            
+            //***
+            // Since it wasn't null to start with clip / clamp between minimum
+            // normalized pixel and one(max).
+            //*** 
+            p =  ( p > MP ? ( p < 1.0 ? p : 1.0) : MP );  
+
+            theBuffer[buffer_index] = p;
+         }
+         else
+         {
+            theBuffer[buffer_index] = 0.0;
+         }
+         
+         ++buffer_index;
+      }
+   }
+   
+   // Copy the buffer to the output tile at the same time unnormalizing it.
+   theTile->copyNormalizedBufferToTile(theBuffer);
+   
+   // Set the status to that of the input tile.
+   theTile->setDataObjectStatus(tile_status);
+
+   return theTile;
+}
+
+void ossimGammaRemapper::initialize()
+{
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,
+                                                          theInputConnection);
+      theTile->initialize();
+
+      if(theBuffer)
+      {
+         delete []theBuffer;
+         theBuffer = NULL;
+      }
+      
+      ossim_uint32 tw    = theTile->getWidth();
+      ossim_uint32 th    = theTile->getHeight();
+      ossim_uint32 bands = theTile->getNumberOfBands();
+      
+      theBuffer = new double[tw*th*bands];
+      memset(theBuffer, '\0', tw*th*bands);
+
+      setInitializedFlag(true);
+      clearErrorStatus();
+   }
+   else
+   {
+      setInitializedFlag(false);
+      setErrorStatus();
+      cerr << "ossimGammaRemapper::initialize ERROR:"
+           << "\nCannot call method when input connection is NULL!"
+           << endl;
+   };
+
+   verifyEnabled();
+}
+
+void ossimGammaRemapper::setMinMaxPixelValues(const vector<double>& v_min,
+                                              const vector<double>& v_max)
+{
+   theMinPixelValue = v_min;
+   theMaxPixelValue = v_max;
+   verifyEnabled();
+}
+
+void ossimGammaRemapper::verifyEnabled()
+{
+   // Check all the pointers...
+   if ( !theInputConnection || !theTile || !theBuffer )
+   {
+      disableSource();
+      return;
+   }
+
+   ossim_uint32 bands = theTile->getNumberOfBands();
+   if ( (theMinPixelValue.size() != bands) ||
+        (theMaxPixelValue.size() != bands) )
+   {
+      disableSource(); 
+      return;
+   }
+
+   if (theUserDisabledFlag == false)
+   {
+      enableSource();
+   }
+
+   if (traceDebug())
+   {
+      cout << *this << endl;
+   }
+}
+
+bool ossimGammaRemapper::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   //***
+   // Call the base class to pick up the enable flag.  Note that the
+   // verifyEnabled flag can override this.
+   //***
+   ossimString pref;
+   if (prefix) pref += prefix;
+   pref += "gamma_remapper.";
+
+   if (!theTile)
+   {
+      cerr << "ossimGammaRemapper::loadState:  ERROR"
+           << "Not initialized yet!" << endl;
+      return false;
+   }
+
+   //---
+   // NOTE:
+   // base class seems to call initialize which in turn errors if you don't
+   // have a connection yet, so check for the enable keyword here...
+   // ossimSource::loadState(kwl, pref.c_str());
+   //---
+   cout << "pref:  " << pref
+        << "kw:  " << ossimKeywordNames::ENABLED_KW    << endl;
+   
+   const char* lookup = kwl.find(pref, ossimKeywordNames::ENABLED_KW);
+   if(lookup)
+   {
+      theEnableFlag = ossimString(lookup).toBool();
+      if (theEnableFlag == false)
+      {
+         // User want filter disabled...
+         theUserDisabledFlag = true;
+      }
+   }
+
+   ossim_uint32 bands = theTile->getNumberOfBands();
+
+   theGamma.clear();
+   theGamma.resize(bands, 1.0);
+
+   for(ossim_uint32 band = 0; band < bands; ++band)
+   {
+      ossimString band_string = ".band";
+      band_string += ossimString::toString(band+1);  // Start at one.
+
+      ossimString kw = GAMMA_REMAPPER_GAMMA_KW;
+      kw += band_string;
+      lookup = kwl.find(prefix, kw.c_str());
+      if (lookup)
+      {
+         theGamma[band] = atof(lookup);
+      }
+      else
+      {
+         cout << "MODULE NOTICE:"
+              << "\nlookup failed for keyword:  " << kw.c_str()
+              << "\nGamma set to " << DEFAULT_GAMMA << " for band:  "
+              << (band+1) << endl;
+         theGamma[band] = DEFAULT_GAMMA;
+      }
+   }
+
+   if (traceDebug())
+   {
+      cout << "ossimGammaRemapper DEBUG:"
+           << *this
+           << endl;
+   }
+   
+   return true;
+}
+
+ostream& ossimGammaRemapper::print(ostream& os) const
+{
+   os << setprecision(15) << setiosflags(ios::fixed)
+      << "ossimGammaRemapper:"
+      << "\ntheEnableFlag:  " << (theEnableFlag?"enabled":"disabled")
+      << endl;
+
+   ossim_uint32 band = 1;
+   vector<double>::const_iterator i = theMinPixelValue.begin();
+   while (i != theMinPixelValue.end())
+   {
+      os << "band[" << band << "] min:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+
+   band = 1;
+   i = theMaxPixelValue.begin();
+   while (i != theMaxPixelValue.end())
+   {
+      os << "band[" << band << "] max:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+   
+   band = 1;
+   i = theGamma.begin();
+   while (i != theGamma.end())
+   {
+      os << "band[" << band << "] gamma:  " << (*i) << endl;
+      ++i;
+      ++band;
+   }
+
+   return os;
+}
+
+void ossimGammaRemapper::enableSource()
+{
+   // Clear the flag...
+   theUserDisabledFlag = false;
+   ossimSource::enableSource();
+}
+
+ossimString ossimGammaRemapper::getShortName() const
+{
+   return ossimString("Gamma Remapper");
+}
+
+ostream& operator<<(ostream& os, const ossimGammaRemapper& hr)
+{
+   return hr.print(os);
+}
diff --git a/src/imaging/ossimGeneralRasterInfo.cpp b/src/imaging/ossimGeneralRasterInfo.cpp
new file mode 100644
index 0000000..57f68bd
--- /dev/null
+++ b/src/imaging/ossimGeneralRasterInfo.cpp
@@ -0,0 +1,1298 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// Contains class definition for ossimGeneralRasterInfo
+//*******************************************************************
+// $Id: ossimGeneralRasterInfo.cpp 23645 2015-12-04 13:17:34Z gpotts $
+
+#include <ossim/imaging/ossimGeneralRasterInfo.h>
+#include <ossim/base/ossimInterleaveTypeLut.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageMetaData.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+#include <ossim/support_data/ossimFgdcXmlDoc.h>
+
+#include <iostream>
+#include <iomanip>
+
+static const ossimKeyword
+NUMBER_LINES("number_lines",
+             "Number of lines in the raster image.");
+
+static const ossimKeyword
+NUMBER_SAMPLES("number_samples",
+               "Number of samples in the raster image.");
+
+static const ossimKeyword
+VALID_START_LINE("valid_start_line",
+                 "First valid line of raster image(zero based).");
+
+static const ossimKeyword
+VALID_STOP_LINE("valid_stop_line",
+                "Last valid line of raster image(zero based).");
+
+static const ossimKeyword
+VALID_START_SAMPLE("valid_start_sample",
+                   "First valid sample of raster image(zero based).");
+
+static const ossimKeyword
+VALID_STOP_SAMPLE("valid_stop_sample",
+                  "Last valid sample of raster image(zero based).");
+
+static const ossimKeyword
+SUB_IMAGE_OFFSET_LINE(
+   "sub_image_offset_line",
+   "Pixel line offset of sub-image in the full-image pixel space.");
+
+static const ossimKeyword
+SUB_IMAGE_OFFSET_SAMP(
+   "sub_image_offset_samp",
+   "Pixel sample offset of sub-image in the full-image pixel space."); 
+
+static const ossimKeyword
+HEADER_SIZE("header_size",
+            "Header size in bytes.");
+
+static const ossimKeyword
+SET_NULLS("set_fill_to_nulls_mode",
+          "0 = do nothing to pixels,\n1 = all zeroes to min values,\
+\n2 = zeroes to null on edges only.");
+
+static const ossimKeyword
+PIXELS_TO_CHOP("pixels_to_chop",
+               "Ammount of pixels to chop from edge.");
+
+static const ossimInterleaveTypeLut INTERLEAVE_TYPE_LUT;
+
+static ossimTrace traceDebug("ossimGeneralRasterInfo:debug");
+
+ossimGeneralRasterInfo::ossimGeneralRasterInfo()
+   :
+   theMetaData(),
+   theImageFileList(),
+   theInterleaveType(OSSIM_BIL),
+   theRawImageRect(),
+   theValidImageRect(),
+   theImageRect(),
+   theSubImageOffset(0,0),
+   theHeaderSize(0),
+   theSetNullsMode(NONE),
+   thePixelsToChop(0),
+   theImageDataByteOrder(OSSIM_LITTLE_ENDIAN)
+{
+   theRawImageRect.makeNan();
+   theValidImageRect.makeNan();
+   theImageRect.makeNan();
+}
+
+ossimGeneralRasterInfo::ossimGeneralRasterInfo(const std::vector<ossimFilename>& imageFileList,
+                                               ossimScalarType     pixelType,
+                                               ossimInterleaveType il_type,
+                                               ossim_int32         numberOfBands,
+                                               ossim_int32         lines,
+                                               ossim_int32         samples,
+                                               ossim_int32         headerSize,
+                                               ossimFillMode       nullsMode,
+                                               ossim_int32         pixelsToChop)
+   :
+   theMetaData(pixelType, numberOfBands),
+   theImageFileList(imageFileList),
+   theInterleaveType(il_type),
+   theRawImageRect(0,0,0,0),
+   theValidImageRect(0,0,0,0),
+   theImageRect(0,0,0,0),
+   theSubImageOffset(0,0),
+   theHeaderSize(headerSize),
+   theSetNullsMode(nullsMode),
+   thePixelsToChop(pixelsToChop),
+   theImageDataByteOrder(OSSIM_LITTLE_ENDIAN)
+{
+   theRawImageRect.set_lry(lines - 1);
+   theRawImageRect.set_lrx(samples - 1);
+   theValidImageRect = theRawImageRect;
+   theImageRect = theRawImageRect;
+}
+
+ossimGeneralRasterInfo::ossimGeneralRasterInfo(const ossimKeywordlist& kwl,
+                     const char* prefix)
+   :
+   theImageFileList(),
+   theInterleaveType(OSSIM_BIL),
+   theRawImageRect(0,0,0,0),
+   theValidImageRect(0,0,0,0),
+   theImageRect(0,0,0,0),
+   theSubImageOffset(0,0),
+   theHeaderSize(0),
+   theSetNullsMode(NONE),
+   thePixelsToChop(0),
+   theImageDataByteOrder(OSSIM_LITTLE_ENDIAN)
+{
+   theRawImageRect.makeNan();
+   theValidImageRect.makeNan();
+   theImageRect.makeNan();
+   
+   loadState(kwl, prefix);
+}
+
+ossimGeneralRasterInfo::ossimGeneralRasterInfo( const ossimGeneralRasterInfo& obj )
+   :
+   theMetaData           ( obj.theMetaData ),
+   theImageFileList      ( obj.theImageFileList ),
+   theInterleaveType     ( obj.theInterleaveType ),
+   theRawImageRect       ( obj.theRawImageRect ),
+   theValidImageRect     ( obj.theValidImageRect ),
+   theImageRect          ( obj.theImageRect ),
+   theSubImageOffset     ( obj.theSubImageOffset ),
+   theHeaderSize         ( obj.theHeaderSize ),
+   theSetNullsMode       ( obj.theSetNullsMode ),
+   thePixelsToChop       ( obj.thePixelsToChop ),
+   theImageDataByteOrder ( obj.theImageDataByteOrder )
+{
+}
+
+const ossimGeneralRasterInfo& ossimGeneralRasterInfo::operator=(
+   const ossimGeneralRasterInfo& rhs )
+{
+   if ( this != &rhs )
+   {
+      theMetaData           = rhs.theMetaData;
+      theImageFileList      = rhs.theImageFileList;
+      theInterleaveType     = rhs.theInterleaveType;
+      theRawImageRect       = rhs.theRawImageRect;
+      theValidImageRect     = rhs.theValidImageRect;
+      theImageRect          = rhs.theImageRect;
+      theSubImageOffset     = rhs.theSubImageOffset;
+      theHeaderSize         = rhs.theHeaderSize;
+      theSetNullsMode       = rhs.theSetNullsMode;
+      thePixelsToChop       = rhs.thePixelsToChop;
+      theImageDataByteOrder = rhs.theImageDataByteOrder;
+   }
+   return *this;
+}
+
+ossimGeneralRasterInfo::~ossimGeneralRasterInfo()
+{
+}
+
+void ossimGeneralRasterInfo::clear()
+{
+   theMetaData.clear();
+   theImageFileList.clear();
+   theInterleaveType = OSSIM_BIL;
+   theRawImageRect.makeNan();
+   theValidImageRect.makeNan();
+   theImageRect.makeNan();
+   theSubImageOffset.x = 0;
+   theSubImageOffset.y = 0;
+   theHeaderSize = 0;
+   theSetNullsMode = NONE;
+   thePixelsToChop = 0;
+   theImageDataByteOrder = OSSIM_LITTLE_ENDIAN;
+}
+
+const ossimIrect& ossimGeneralRasterInfo::imageRect() const
+{
+   return theImageRect;
+}
+
+const ossimIrect& ossimGeneralRasterInfo::validImageRect() const
+{
+   return theValidImageRect;
+}
+
+const ossimIrect& ossimGeneralRasterInfo::rawImageRect() const
+{
+   return theRawImageRect;
+}
+
+const ossimIpt& ossimGeneralRasterInfo::subImageOffset() const
+{
+   return theSubImageOffset;
+}
+
+ossim_int32 ossimGeneralRasterInfo::headerSize() const
+{
+   return theHeaderSize;
+}
+
+ossim_uint32 ossimGeneralRasterInfo::fillToNullsMode() const
+{
+   return theSetNullsMode;
+}
+  
+std::ostream& ossimGeneralRasterInfo::print(std::ostream& out) const
+{
+   //---
+   // This will print in a keyword format that can be read by the constructor.
+   // that takes a keyword list.
+   //---
+   ossimKeywordlist kwl;
+   saveState( kwl, 0 );
+   out << kwl << std::endl;
+   return out;
+}
+
+void ossimGeneralRasterInfo::setFillToNullsMode(ossim_uint32 mode)
+{
+   static const char MODULE[] = "ossimGeneralRasterInfo::setFillToNullMode";
+   if(mode < 3)
+   {
+      theSetNullsMode = (ossimFillMode)mode;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " ERROR:"
+         << "\nmode out of bounds(0 - 2):  " << mode << std::endl
+         << "\nmode has not been changed." << std::endl;
+   }
+}
+
+ossim_int32 ossimGeneralRasterInfo::pixelsToChop() const
+{
+   return thePixelsToChop;
+} 
+
+ossimInterleaveType ossimGeneralRasterInfo::interleaveType() const
+{
+   return theInterleaveType;
+}
+
+const std::vector<ossimFilename>& ossimGeneralRasterInfo::getImageFileList() const
+{
+   return theImageFileList;
+}
+
+void ossimGeneralRasterInfo::setImageFileList(const std::vector<ossimFilename>& list)
+{
+   theImageFileList = list;
+}
+
+void ossimGeneralRasterInfo::setImageFile(const ossimFilename& file)
+{
+   theImageFileList.clear();
+   theImageFileList.push_back( file );
+}   
+
+void ossimGeneralRasterInfo::setImageDataByteOrder(ossimByteOrder byteOrder)
+{
+   theImageDataByteOrder = byteOrder;
+}
+
+void ossimGeneralRasterInfo::setHeaderSize(ossim_int32 headerSize)
+{
+   theHeaderSize = headerSize;
+}
+
+void ossimGeneralRasterInfo::setInterleaveType(ossimInterleaveType il_type)
+{
+   theInterleaveType = il_type;
+}
+
+void ossimGeneralRasterInfo::setImageRect(const ossimIrect& imageRect)
+{
+   theImageRect = imageRect;
+}
+
+void ossimGeneralRasterInfo::setValidImageRect(const ossimIrect &imageRect)
+{
+   theValidImageRect = imageRect;
+}
+
+void ossimGeneralRasterInfo::setRawImageRect(const ossimIrect &imageRect)
+{
+   theRawImageRect = imageRect;
+}
+
+void ossimGeneralRasterInfo::setSubImageOffset(const ossimIpt& d)
+{
+   theSubImageOffset = d;
+}
+
+ossimByteOrder ossimGeneralRasterInfo::getImageDataByteOrder() const
+{
+   return theImageDataByteOrder;
+}  
+
+bool ossimGeneralRasterInfo::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix) const
+{
+   for (ossim_uint32 i=0; i<theImageFileList.size(); ++i)
+   {
+      ossimString kw = ossimKeywordNames::FILENAME_KW;
+      kw += ossimString::toString(i+1);
+      kwl.add(prefix, theImageFileList[i].c_str());
+   }
+
+   theMetaData.saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           NUMBER_LINES,
+           ossimString::toString( rawLines() ), true);
+   kwl.add(prefix,
+           NUMBER_SAMPLES,
+           ossimString::toString( rawSamples() ),
+           true);
+   kwl.add(prefix,
+           HEADER_SIZE,
+           ossimString::toString(theHeaderSize),
+           true);
+   kwl.add(prefix,
+           SUB_IMAGE_OFFSET_LINE,
+           theSubImageOffset.line,
+           true);
+   kwl.add(prefix,
+           SUB_IMAGE_OFFSET_SAMP,
+           theSubImageOffset.samp,
+           true);
+   kwl.add(prefix,
+           VALID_START_LINE,
+           theValidImageRect.ul().y,
+           true);
+   kwl.add(prefix,
+           VALID_STOP_LINE,
+           theValidImageRect.lr().y,
+           true);
+   kwl.add(prefix,
+           VALID_START_SAMPLE,
+           theValidImageRect.ul().x,
+           true);
+   kwl.add(prefix,
+           VALID_STOP_SAMPLE,
+           theValidImageRect.ur().x,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::INTERLEAVE_TYPE_KW,
+           INTERLEAVE_TYPE_LUT.getEntryString(theInterleaveType),
+           true);
+
+   kwl.add(prefix,
+           PIXELS_TO_CHOP,
+           thePixelsToChop,
+           true);
+
+   kwl.add(prefix,
+           SET_NULLS,
+           theSetNullsMode,
+           true);
+
+
+   if (bytesPerPixel() > 1)
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::BYTE_ORDER_KW,
+              (theImageDataByteOrder == OSSIM_LITTLE_ENDIAN ? "little_endian" :
+               "big_endian"),
+              true);
+   }
+
+   return true;
+}
+
+bool ossimGeneralRasterInfo::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   static const char MODULE[] = "ossimGeneralRasterInfo::loadState";
+   if ( traceDebug() )
+   {
+      CLOG << "DEBUG: entered..."
+           << "\nprefix:  " << (prefix ? prefix : "")
+           << "\nInput keyword list:\n"
+           << kwl
+           << std::endl;
+   }   
+
+   bool result = false;
+
+   //---
+   // Look for required and option keyword.  Break from loop if required
+   // keyword is not found.
+   //---
+   while( 1 )
+   {
+      // Check for errors in the ossimKeywordlist.
+      if(kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+      {
+        if(traceDebug())
+        {
+          ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << "Detected an error in the keywordlist:  " << kwl
+            << std::endl;
+        }
+         break;
+      }
+
+      std::string key;
+      ossimString value; // Use for keyword list lookups.
+      ossim_int32 lines = 0;
+      ossim_int32 samples = 0;
+
+      // Lines (required):
+      key = NUMBER_LINES;
+      value.string() = kwl.findKey( key );  // Required to have this.
+      if ( value.size() )
+      {
+         lines = value.toInt32();
+         if ( !lines )
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << " ERROR:\n"
+                  << "Required number of lines is 0!" << std::endl;
+            }
+            break;
+         } 
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << " ERROR:\n"
+               << "Required keyword not found:  " << key << std::endl;
+         }
+         break;
+      }
+
+      // Samples (required):
+      key = NUMBER_SAMPLES;
+      value.string() = kwl.findKey( key );  // Required to have this.
+      if ( value.size() )
+      {
+         samples = value.toInt32();
+         if ( !samples )
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << " ERROR:\n"
+                  << "Required number of samples is 0!" << std::endl;
+            }
+            break;
+         }          
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << " ERROR:\n"
+               << "Required keyword not found:  " << key << std::endl;
+         }
+         break;
+      }
+      
+      // Bands ossimImageMetaData::loadState checks for required bands:
+      if(!theMetaData.loadState(kwl, prefix))
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << " Error loading meta data!\n" << std::endl;
+         }
+         break;
+      }
+
+      // If we get here assign the rectangles:
+      theRawImageRect   = ossimIrect( 0, 0, samples - 1, lines - 1 );
+      theValidImageRect = theRawImageRect;
+      theImageRect      = theRawImageRect;
+
+      int tmp = INTERLEAVE_TYPE_LUT.getEntryNumber(kwl);
+      if (tmp == ossimLookUpTable::NOT_FOUND)
+      {
+         theInterleaveType = OSSIM_BIL;
+      }
+      else
+      {
+         theInterleaveType = static_cast<ossimInterleaveType>(tmp);
+      }
+      
+      // Get the image files.
+      if (theInterleaveType != OSSIM_BSQ_MULTI_FILE)
+      {
+         // Look for "filename" first, then deprecated "image_file".
+         key = ossimKeywordNames::FILENAME_KW;
+         value.string() = kwl.findKey( key );
+         if ( value.empty() )
+         {
+            // deprecated keyword...
+            key = ossimKeywordNames::IMAGE_FILE_KW;
+            value.string() = kwl.findKey( key );
+         }
+         
+         if ( value.size() )
+         {
+            //---
+            // omd (ossim metadata) files can have just the base filename, e.g. image.ras,
+            // in which case open will fail if not in the image dir.  So only put it in
+            // the list if it doesn't exits.
+            //---
+            ossimFilename f = value;
+            if ( f.exists() )
+            {
+               theImageFileList.clear();
+               theImageFileList.push_back(ossimFilename(value));
+            }
+         }
+
+         if ( theImageFileList.empty() )
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ERROR:\n"
+                  << "Required keyword not found:  "
+                  << ossimKeywordNames::FILENAME_KW << std::endl;
+            }
+            break;
+         }
+      }
+      else
+      {
+         // multiple file names.
+         ossim_int32 count = 0;
+         
+         // look for image file key word with no number.
+         // Required to have this.
+         key = ossimKeywordNames::FILENAME_KW;
+         value.string() = kwl.findKey( key );
+         if ( value.empty() )
+         {
+            // deprecated keyword...
+            key = ossimKeywordNames::IMAGE_FILE_KW;
+            value.string() = kwl.findKey( key );
+         }
+         
+         if ( value.size() )
+         {
+            theImageFileList.push_back(ossimFilename(value));
+            ++count;
+         }
+         
+         ossim_int32 i = 0;
+         while ( (count < numberOfBands()) && (i < 1000) )
+         {
+            key = ossimKeywordNames::FILENAME_KW;
+            key += ossimString::toString(i).string();
+            value.string() = kwl.findKey( key );
+            if ( value.empty() )
+            {
+               // Lookup for deprecated keyword.
+               key = ossimKeywordNames::IMAGE_FILE_KW;
+               key += ossimString::toString(i).string();
+               value.string() = kwl.findKey( key );
+            }
+            
+            if ( value.size() )
+            {
+               theImageFileList.push_back(ossimFilename(value));
+               ++count;
+            }
+            ++i;
+         }
+         
+         if (count != numberOfBands())  // Error, count should equal bands!
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << " ERROR:\n"
+                  << "Required keyword not found:  "
+                  << ossimKeywordNames::FILENAME_KW
+                  << "\nInterleave type is multi file; however,"
+                  << " not enough were pick up!"  << std::endl;
+            }
+            break;
+         }
+      }
+
+      key = VALID_START_LINE;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
+      {
+         theValidImageRect.set_uly( value.toInt32() );
+      }
+
+      key = VALID_STOP_LINE;
+      value.string() = kwl.findKey( key ); // Default is last line.
+      if ( value.size() )
+      {
+         theValidImageRect.set_lry( value.toInt32() );
+      }
+      
+      if (theValidImageRect.lr().y < theValidImageRect.ul().y)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << " ERROR:"
+            << "\nValid stop line < start line."
+            << "\nValid start line:  " << theValidImageRect.ul().y
+            << "\nValid stop line:   " << theValidImageRect.lr().y
+            << "\nError status has been set.  Returning." << std::endl;
+         break;
+      }
+
+      key = VALID_START_SAMPLE;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
+      {
+         theValidImageRect.set_ulx( value.toInt32() );
+      }
+
+      key = VALID_STOP_SAMPLE;
+      value.string() = kwl.findKey( key ); // Default is last sample.
+      if ( value.size() ) 
+      {
+         theValidImageRect.set_lrx( value.toInt32() );
+      }
+      
+      if (theValidImageRect.lr().x < theValidImageRect.ul().x)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << " ERROR:"
+            << "\nValid stop samp < start samp."
+            << "\nValid start samp:  " << theValidImageRect.ul().x
+            << "\nValid stop samp:   " << theValidImageRect.lr().x
+            << "\nError status has been set.  Returning." << std::endl;
+         break;
+      }
+      
+      theImageRect.set_lry(theValidImageRect.lr().y -
+                           theValidImageRect.ul().y);
+      theImageRect.set_lrx(theValidImageRect.lr().x -
+                           theValidImageRect.ul().x);
+      
+      key = SUB_IMAGE_OFFSET_LINE;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
+      {
+         theSubImageOffset.line = value.toInt32();
+      }
+
+      key = SUB_IMAGE_OFFSET_SAMP;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
+      {
+         theSubImageOffset.samp = atoi(value);
+      }
+
+      key = HEADER_SIZE;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
+      {
+         theHeaderSize = value.toInt32();
+      }
+
+      key = SET_NULLS;
+      value.string() = kwl.findKey( key ); // Default is 2.
+      if ( value.size() )
+      {
+         int tmp;
+         tmp = atoi(value);
+         if ((tmp < 3) && (tmp > -1))
+         {
+            theSetNullsMode = (ossimFillMode)tmp;
+         }
+         else
+         {
+            theSetNullsMode = ZEROES_TO_NULL_EDGES_ONLY;  // 2
+            ossimNotify(ossimNotifyLevel_WARN)
+               << " WARNING:"
+               << "\nset_fill_to_nulls_mode value out of range."
+               << "\nDefaulted to 2" << std::endl;
+         }
+      }
+
+      key = PIXELS_TO_CHOP;
+      value.string() = kwl.findKey( key ); // Default is zero.
+      if ( value.size() )
+      {
+         thePixelsToChop = value.toInt32();
+      }
+      
+      if (bytesPerPixel() > 1)
+      {
+         // get the byte order of the data.
+         key = ossimKeywordNames::BYTE_ORDER_KW;
+         value.string() = kwl.findKey( key );
+         if ( value.size() )
+         {
+            ossimString s(value);
+            if (s.trim() != "")  // Check for empty string.
+            {
+               s.downcase();
+               if (s.contains("big"))
+               {
+                  theImageDataByteOrder = OSSIM_BIG_ENDIAN;
+               }
+               else if(s.contains("little"))
+               {
+                  theImageDataByteOrder = OSSIM_LITTLE_ENDIAN;
+               }
+            }
+         }
+      }
+
+      // End of while forever loop.
+      result = true;
+      break;
+
+   } // Matches: while (1)
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE  << " Exit status: " << (result?"true":"false") << std::endl;
+   }      
+   
+   return result;
+   
+} // End: bool ossimGeneralRasterInfo::loadState
+
+bool ossimGeneralRasterInfo::open( const ossimFilename& imageFile )
+{
+   static const char MODULE[] = "ossimGeneralRasterInfo::open";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..." << "\nimageFile: " << imageFile << std::endl;
+   }
+
+   bool result = false;
+
+   // Wipe any previous state slick.
+   clear();
+
+   ossimFilename copyFile = imageFile;
+   if ( !imageFile.exists() )
+   {
+      copyFile = imageFile.expand();
+   }
+
+   // Look for the headrer of omd file as they are written out by img2rr.
+   ossimFilename hdr = copyFile;
+   hdr.setExtension("hdr"); // image.hdr
+   if ( !hdr.exists() )
+   {
+      hdr = imageFile;
+      hdr.string() += ".hdr"; // image.ras.hdr
+      if ( ! hdr.exists() )
+      {
+         hdr = imageFile;
+         hdr.setExtension("xml"); // image.xml
+      }
+   }
+
+   if ( hdr.exists() )
+   {
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "header file: " << hdr << std::endl;
+      }
+      
+      ossimString ext = hdr.ext().downcase();
+      
+      if ( ext == "hdr" )
+      {
+         if ( ossimEnviHeader::isEnviHeader( hdr ) )
+         {
+            result = initializeFromEnviHdr( hdr );
+         }
+         else
+         {
+            result = initializeFromHdr( imageFile, hdr );
+         }
+
+         if ( !result )
+         {
+            // Could be an ossim meta data file:
+            ossimKeywordlist kwl( hdr );
+            result = loadState( kwl, 0 );
+         }
+      }
+      else if ( ext == "xml" )
+      {
+         result = initializeFromXml( imageFile, hdr );
+      }
+   }
+   
+   //---
+   // Set the file name.  Needed for ossimGeneralRasterTileSource::open.
+   // Note set here above loadState call to stop loadState from returning
+   // false if no image file found.
+   //---
+   if ( theImageFileList.empty() )
+   {
+      setImageFile( imageFile );
+   }
+   
+   ossimFilename omd = imageFile;
+   omd.setExtension("omd"); // image.omd
+   if ( !omd.exists() )
+   {
+      omd.setExtension("kwl"); // image.kwl
+   }
+
+   if ( omd.exists() )
+   {
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "omd file: " << omd << std::endl;
+      }
+
+      ossimKeywordlist kwl( omd );
+
+      if ( result && theMetaData.getNumberOfBands() )
+      {
+         //---
+         // Just update the band info in case it has min/max values from
+         // a compute min/max scan.
+         //---
+         theMetaData.updateMetaData( kwl, std::string("") );
+      }
+      else
+      {
+         // We're not initialized yet so do a loadState:
+         result = loadState( kwl, 0 );
+      }
+   }
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE  << " Exit status: " << (result?"true":"false") << std::endl;
+   }
+   
+   return result;
+}
+
+bool ossimGeneralRasterInfo::initializeFromHdr( const ossimFilename& imageFile,
+                                                const ossimFilename& headerFile )
+{
+   bool result = false;
+
+   ossimKeywordlist kwl;
+   char delimeter = ' ';
+   kwl.change_delimiter(delimeter);
+
+   if ( kwl.addFile(headerFile) )
+   {
+      kwl.downcaseKeywords();
+      ossimString value;
+   
+      while( 1 ) 
+      {
+         //---
+         // Go through the data members in order.
+         // If a required item is not found break from loop.
+         //--
+         theMetaData.clear();
+
+         // scalar ( default ) - adjusted below :
+         theMetaData.setScalarType( OSSIM_UINT8 );
+
+         // Image file name:
+         theImageFileList.clear();
+         theImageFileList.push_back( imageFile );
+         
+         // interleave ( not required - default=BIL)
+         theInterleaveType = OSSIM_BIL;
+         value.string() = kwl.findKey( std::string("layout") );
+         if ( value.size() )
+         {
+            ossimInterleaveTypeLut lut;
+            ossim_int32 intrlv = lut.getEntryNumber( value.string().c_str(), true );
+            if ( intrlv != ossimLookUpTable::NOT_FOUND )
+            {
+               theInterleaveType = static_cast<ossimInterleaveType>(intrlv);
+            }
+         }
+
+         // bands ( required ):
+         ossim_uint32 bands = 0;
+         value.string() = kwl.findKey( std::string("nbands") );
+         if ( value.size() )
+         {
+            bands = value.toUInt32();
+         }
+         if ( !bands )
+         {
+            break;
+         }
+         theMetaData.setNumberOfBands( bands );
+
+         // lines ( required ):
+         ossim_int32 lines = 0;
+         value.string() = kwl.findKey( std::string("nrows") );
+         if ( value.size() )
+         {
+            lines = value.toInt32();
+         }
+         if ( !lines )
+         {
+            break;
+         }
+         
+         // samples ( required ):
+         ossim_int32 samples = 0;
+         value.string() = kwl.findKey( std::string("ncols") );
+         if ( value.size() )
+         {
+            samples = value.toInt32();
+         }
+         if ( !samples )
+         {
+            break;
+         }
+
+         // nodata or null value ( not required )
+         value.string() = kwl.findKey( std::string("nodata") );
+         if ( value.empty() )
+         {
+            value.string() = kwl.findKey( std::string("nodata_value") );
+         }
+         if ( value.size() )
+         {
+            ossim_float64 nullValue = value.toUInt32();
+            for ( ossim_uint32 band = 0; band < theMetaData.getNumberOfBands(); ++band )
+            {
+               theMetaData.setNullPix( band, nullValue );
+            }
+            theMetaData.setNullValuesValid(true);
+         }
+
+         // Set the rectangles:
+         theRawImageRect   = ossimIrect( 0, 0, samples - 1, lines - 1 );
+         theValidImageRect = theRawImageRect;
+         theImageRect      = theRawImageRect;         
+
+         // sample start ( not required ):
+         theSubImageOffset.x = 0;
+
+         // line start ( not required ):
+         theSubImageOffset.y = 0;
+
+         // header offset ( not required ):
+         theHeaderSize = 0;
+
+         // null mode:
+         theSetNullsMode = ossimGeneralRasterInfo::NONE;
+
+         // pixels to chop:
+         thePixelsToChop = 0; 
+
+         // Byte order, ( not required - defaulted to system if not found.
+         theImageDataByteOrder = ossim::byteOrder();
+         value.string() = kwl.findKey( std::string("byteorder") );
+         if ( value.size() )
+         {
+            ossim_uint32 i = value.toUInt32();
+            if ( i == 0 )
+            {
+               theImageDataByteOrder = OSSIM_LITTLE_ENDIAN;
+            }
+            else
+            {
+               theImageDataByteOrder = OSSIM_BIG_ENDIAN;
+            }
+         }
+
+         // Pixel type used for scalar below:
+         std::string pixelType = "N"; // not defined
+         value.string() = kwl.findKey( std::string("pixeltype") );
+         if ( value.size() )
+         {
+            pixelType = value.string();
+         }
+         
+         ossim_int32 nbits = -1;
+         value.string() = kwl.findKey( std::string("nbits") );
+         if ( value.size() )
+         {
+            nbits = value.toInt32();
+         }
+         else
+         {
+            nbits = getBitsPerPixel( imageFile );
+         }
+
+         switch( nbits )
+         {
+            case 8:
+            {
+               theMetaData.setScalarType( OSSIM_UINT8 );
+               break;
+            }
+            case 16:
+            {
+               if (pixelType == "S")
+               {
+                  theMetaData.setScalarType( OSSIM_SINT16 );
+               }
+               else
+               {
+                  theMetaData.setScalarType( OSSIM_UINT16 );
+               }
+               break;
+            }
+            case 32:
+            {
+               if( pixelType == "S")
+               {
+                  theMetaData.setScalarType( OSSIM_SINT32 );
+               }
+               else if( pixelType == "F")
+               {
+                  theMetaData.setScalarType( OSSIM_FLOAT32 );
+               }
+               else
+               {
+                  theMetaData.setScalarType( OSSIM_UINT32 );
+               }
+               break;
+            }
+            default:
+            {
+               if( (nbits < 8) && (nbits >= 1 ) )
+               {
+                  theMetaData.setScalarType( OSSIM_UINT8 );
+               }
+               break;
+            }
+         }
+
+         result = true;
+         break; // Trailing break to get out.
+      }
+   }
+
+   return result;
+   
+} // End: ossimGeneralRasterInfo::initializeFromHdr
+
+
+bool ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimFilename& headerFile )
+{
+   bool result = false;
+   ossimEnviHeader hdr;
+   if( hdr.open( headerFile ) )
+   {
+      result = initializeFromEnviHdr( hdr );
+   }
+   return result;
+}
+
+bool ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimEnviHeader& enviHdr )
+{
+   bool result = false;
+
+   while( 1 ) 
+   {
+      //---
+      // Go through the data members in order.
+      // If a required item is not found break from loop.
+      //--
+      theMetaData.clear();
+      
+      // scalar ( required ) :
+      if( enviHdr.getOssimScalarType() != OSSIM_SCALAR_UNKNOWN )
+      {
+         theMetaData.setScalarType( enviHdr.getOssimScalarType() );
+      }
+      else
+      {
+         break;
+      }
+      
+      theImageFileList.clear();
+      
+      // interleave ( required ):
+      theInterleaveType = enviHdr.getOssimInterleaveType();
+      if ( theInterleaveType == OSSIM_INTERLEAVE_UNKNOWN )
+      {
+         break;
+      }
+      
+      // bands ( required ):
+      if ( !enviHdr.getBands() )
+      {
+         break;
+      }
+      theMetaData.setNumberOfBands( enviHdr.getBands() );
+      
+      // lines ( required ):
+      ossim_uint32 lines = enviHdr.getLines();
+      if ( !lines )
+      {
+         break;
+      }
+      
+      // samples ( required ):
+      ossim_uint32 samples = enviHdr.getSamples();
+      if ( !samples )
+      {
+         break;
+      }
+      
+      // Set the rectangles:
+      theRawImageRect   = ossimIrect( 0, 0, samples - 1, lines - 1 );
+      theValidImageRect = theRawImageRect;
+      theImageRect      = theRawImageRect;         
+
+      // sample start ( not required ):
+      theSubImageOffset.x = enviHdr.getXStart();
+      
+      // line start ( not required ):
+      theSubImageOffset.y = enviHdr.getYStart();
+      
+      // header offset ( not required ):
+      theHeaderSize = enviHdr.getHeaderOffset();
+      
+      // null mode:
+      theSetNullsMode = ossimGeneralRasterInfo::NONE;
+      
+      // pixels to chop:
+      thePixelsToChop = 0; 
+      
+      // Byte order, this will be system if not found.
+      theImageDataByteOrder = enviHdr.getByteOrder();
+      
+      result = true;
+      break; // Trailing break to get out.
+   }
+   return result;
+   
+} // End: ossimGeneralRasterInfo::initializeFromEnviHdr( const ossimEnviHeader& )
+
+bool ossimGeneralRasterInfo::initializeFromXml( const ossimFilename& imageFile,
+                                                const ossimFilename& headerFile )
+{
+   bool result = false;
+
+   ossimFgdcXmlDoc file;
+   if (file.open( headerFile ))
+   {
+      while( 1 ) 
+      {
+         //---
+         // Go through the data members in order.
+         // If a required item is not found break from loop.
+         //--
+         theMetaData.clear();
+
+         // scalar ( default ) - adjusted below :
+         theMetaData.setScalarType( OSSIM_UINT8 );
+
+         // Image file name:
+         theImageFileList.clear();
+         theImageFileList.push_back( imageFile );
+
+         // interleave ( defaulted ):
+         theInterleaveType = OSSIM_BIL;
+
+         // bands ( required ):
+         if ( !file.getNumberOfBands() )
+         {
+            break;
+         }
+         theMetaData.setNumberOfBands( file.getNumberOfBands() );
+         
+         ossimIpt size;
+         if ( file.getImageSize(size) ) // Lines, samples not image file size.
+         {
+            // lines, samples ( required ):
+            if ( !size.x || !size.y )
+            {
+               break;
+            }
+         }
+         else
+         {
+            break;
+         }
+
+         // Set the rectangles:
+         theRawImageRect   = ossimIrect( 0, 0, size.x - 1, size.y - 1 );
+         theValidImageRect = theRawImageRect;
+         theImageRect      = theRawImageRect;         
+
+         // sample start ( not required ):
+         theSubImageOffset.x = 0;
+
+         // line start ( not required ):
+         theSubImageOffset.y = 0;
+
+         // header offset ( not required ):
+         theHeaderSize = 0;
+
+         // null mode:
+         theSetNullsMode = ossimGeneralRasterInfo::NONE;
+
+         // pixels to chop:
+         thePixelsToChop = 0; 
+
+         // Byte order *** need this ***, defaulting to system for now:
+         theImageDataByteOrder = ossim::byteOrder();
+
+         // Adjust scalar if needed, note defaulted to 8 bit above:
+         ossimString eainfo;
+         file.getPath("/metadata/eainfo/detailed/enttyp/enttypd", eainfo);
+         ossim_int32 numBits = 0;
+         ossim_int64 fileSize = imageFile.fileSize(); // Image file size.
+         ossim_int32 numBytes = fileSize / size.x / size.y / numberOfBands();
+         if( numBytes > 0 && numBytes != 3 )
+         {
+            numBits = numBytes*8;
+         }
+         if( numBits == 16 )
+         {
+            theMetaData.setScalarType( OSSIM_UINT16 );
+         }
+         else if( numBits == 32 )
+         {
+            if(eainfo.contains("float"))
+            {
+               theMetaData.setScalarType( OSSIM_FLOAT32 );
+            }
+            else
+            {
+               theMetaData.setScalarType( OSSIM_UINT32 );
+            }
+         }
+
+         result = true;
+         break; // Trailing break to get out.
+      }
+   }
+
+   return result;
+   
+} // End: ossimGeneralRasterInfo::initializeFromXml
+
+ossim_int32 ossimGeneralRasterInfo::getBitsPerPixel( const ossimFilename& imageFile ) const
+{
+   // Note currently does not consider header size.
+   ossim_int32 result = 0;
+   
+   ossim_int64 fileSize = imageFile.size();
+   ossimIpt rectSize = theRawImageRect.size();
+   if ( fileSize && rectSize.x && rectSize.y && numberOfBands() )
+   {
+      result = ( fileSize / rectSize.x / rectSize.y / numberOfBands() ) * 8;
+   }
+   return result;
+}
+
diff --git a/src/imaging/ossimGeneralRasterTileSource.cpp b/src/imaging/ossimGeneralRasterTileSource.cpp
new file mode 100644
index 0000000..1b2ab31
--- /dev/null
+++ b/src/imaging/ossimGeneralRasterTileSource.cpp
@@ -0,0 +1,1616 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimGeneralRasterTileSource.
+//*******************************************************************
+//  $Id: ossimGeneralRasterTileSource.cpp 22763 2014-05-06 14:07:51Z dburken $
+
+#include <ossim/imaging/ossimGeneralRasterTileSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimInterleaveTypeLut.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/projection/ossimMapProjectionFactory.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/support_data/ossimFgdcXmlDoc.h>
+
+RTTI_DEF1_INST(ossimGeneralRasterTileSource,
+               "ossimGeneralRasterTileSource",
+               ossimImageHandler)
+
+static ossimTrace traceDebug("ossimGeneralRasterTileSource:debug");
+
+// For interleave type enum to string conversions.
+static const ossimInterleaveTypeLut ILUT;
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimGeneralRasterTileSource::ossimGeneralRasterTileSource()
+   :
+      ossimImageHandler(),
+      m_tile(0),
+      m_buffer(0),
+      m_lineBuffer(0),
+      m_bufferInterleave(OSSIM_BIL),
+      m_fileStrList(0),
+      m_rasterInfo(),
+      m_bufferRect(0, 0, 0, 0),
+      m_swapBytesFlag(false),
+      m_bufferSizeInPixels(0),
+      m_outputBandList(0)
+{}
+
+ossimGeneralRasterTileSource::~ossimGeneralRasterTileSource()
+{
+   close();
+}
+
+ossimRefPtr<ossimImageData> ossimGeneralRasterTileSource::getTile(
+   const ossimIrect& tile_rect, ossim_uint32 resLevel)
+{
+   if ( m_tile.valid() == false )
+   {
+      allocateTile(); // First time through...
+   }
+   
+   if (m_tile.valid())
+   {
+      // Image rectangle must be set prior to calling getTile.
+      m_tile->setImageRectangle(tile_rect);
+      
+      if ( getTile( m_tile.get(), resLevel ) == false )
+      {
+         if (m_tile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            m_tile->makeBlank();
+         }
+      }
+   }
+   
+   return m_tile;
+}
+
+bool ossimGeneralRasterTileSource::getTile(ossimImageData* result,
+                                           ossim_uint32 resLevel)
+{
+   bool status = false;
+   
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel)  &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
+   {
+      //---
+      // Check for overview tile.  Some overviews can contain r0 so always
+      // call even if resLevel is 0.  Method returns true on success, false
+      // on error.
+      //---
+      status = getOverviewTile(resLevel, result);
+      if (status)
+      {
+         if(getOutputScalarType() == OSSIM_USHORT11)
+         {
+            //---
+            // Temp fix:
+            // The overview handler could return a tile of OSSIM_UINT16 if
+            // the max sample value was not set to 2047.
+            //---
+            result->setScalarType(OSSIM_USHORT11);
+         }
+         else if(getOutputScalarType() == OSSIM_USHORT12)
+         {
+            result->setScalarType(OSSIM_USHORT12);
+         }
+         else if(getOutputScalarType() == OSSIM_USHORT13)
+         {
+            result->setScalarType(OSSIM_USHORT13);
+         }
+         else if(getOutputScalarType() == OSSIM_USHORT14)
+         {
+            result->setScalarType(OSSIM_USHORT14);
+         }
+         else if(getOutputScalarType() == OSSIM_USHORT15)
+         {
+            result->setScalarType(OSSIM_USHORT15);
+         }
+      }
+      
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+         
+         //---
+         // Subtract any sub image offset to get the zero based image space
+         // rectangle.
+         //---
+         ossimIrect tile_rect = result->getImageRectangle();
+         
+         // This should be the zero base image rectangle for this res level.
+         ossimIrect image_rect = getImageRectangle(resLevel);
+         
+         //---
+         // See if any point of the requested tile is in the image.
+         //---
+         if ( tile_rect.intersects(image_rect) )
+         {
+            // Make the tile rectangle zero base.
+            result->setImageRectangle(tile_rect);
+
+            // Initialize the tile if needed as we're going to stuff it.
+            if (result->getDataObjectStatus() == OSSIM_NULL)
+            {
+               result->initialize();
+            }
+
+            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
+
+            if ( ! tile_rect.completely_within(m_bufferRect) )
+            {
+               // A new buffer must be loaded.
+               if ( !tile_rect.completely_within(clip_rect) )
+               {
+                  //---
+                  // Start with a blank tile since the whole tile buffer will
+                  // not be
+                  // filled.
+                  //---
+                  result->makeBlank();
+               }
+
+               // Reallocate the buffer if needed.
+               if ( m_bufferSizeInPixels != result->getSize() )
+               {
+                  allocateBuffer( result );
+               }
+
+               ossimIpt size(static_cast<ossim_int32>(result->getWidth()),
+                             static_cast<ossim_int32>(result->getHeight()));
+
+               if( !fillBuffer(clip_rect.ul(), size) )
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << "Error from fill buffer..."
+                     << std::endl;
+                  //---
+                  // Error in filling buffer.
+                  //---
+                  setErrorStatus();
+                  status = false;
+               }
+            }
+            
+            result->loadTile(m_buffer,
+                             m_bufferRect,
+                             clip_rect,
+                             m_bufferInterleave);
+            result->validate();
+
+            // Set the rectangle back.
+            result->setImageRectangle(tile_rect);
+            
+         }
+         else // No intersection.
+         {
+            result->makeBlank();
+         }
+      }
+   }
+   return status;
+}
+
+bool ossimGeneralRasterTileSource::fillBuffer(const ossimIpt& origin, const ossimIpt& size)
+{
+
+   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBuffer";
+
+   // Note:  InterleaveType enumerations in "constants.h" file.
+   bool status = false;
+   switch ( m_rasterInfo.interleaveType() )
+   {
+      case OSSIM_BIP:
+      {
+         status = fillBIP(origin, size);
+         break;
+      }
+      case OSSIM_BIL:
+      {
+         status = fillBIL(origin, size);
+         break;
+      }
+      case OSSIM_BSQ:
+      {
+         status = fillBSQ(origin, size);
+         break;
+      }
+      case OSSIM_BSQ_MULTI_FILE:
+      {
+         status = fillBsqMultiFile(origin, size);
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << " Unsupported interleave type:  "
+            << ILUT.getEntryString(m_rasterInfo.interleaveType())
+            << std::endl;
+      }
+   }
+   
+   if (status && m_swapBytesFlag)
+   {
+      ossimEndian oe;
+      oe.swap(m_rasterInfo.getImageMetaData().getScalarType(),
+              m_buffer,
+              m_bufferSizeInPixels);
+   }
+
+   return status;
+}
+
+bool ossimGeneralRasterTileSource::fillBIP(const ossimIpt& origin, const ossimIpt& size )
+{
+   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBIP ";
+
+   m_bufferRect.set_ul(origin);
+   m_bufferRect.set_lry(min( (origin.y + size.y -1),
+                              m_rasterInfo.imageRect().lr().y));
+   m_bufferRect.set_lrx(min( (origin.x + size.x -1),
+                              m_rasterInfo.imageRect().lr().x));
+
+   const ossim_int32 WIDTH                  = static_cast<ossim_int32>( m_bufferRect.width() ); 
+   const ossim_int32 HEIGHT                 = static_cast<ossim_int32>( m_bufferRect.height() ); 
+   const ossim_int32 INPUT_BANDS            = m_rasterInfo.numberOfBands();
+   const ossim_int32 OUTPUT_BANDS           = static_cast<ossim_int32>( m_outputBandList.size() );
+   const ossim_int32 BYTES_PER_PIXEL        = m_rasterInfo.bytesPerPixel();
+   const ossim_int32 INPUT_BYTES_PER_SAMPLE = BYTES_PER_PIXEL * INPUT_BANDS;
+   const ossim_int32 OUTPUT_BYTES_PER_SAMPLE = BYTES_PER_PIXEL * OUTPUT_BANDS;
+   
+   // Seek position.
+   std::streamoff rasterOffset = m_rasterInfo.offsetToFirstValidSample() +
+        origin.y * m_rasterInfo.bytesPerRawLine() +
+        origin.x * INPUT_BYTES_PER_SAMPLE;
+
+    // Input line buffer, all bands.
+   std::streamsize inputLineBufferWidth = WIDTH * INPUT_BYTES_PER_SAMPLE;
+  
+   // Output buffer width:
+   std::streamsize outputLineBufferWidth = WIDTH * OUTPUT_BYTES_PER_SAMPLE;
+
+#if 0 /* Please keep for debug. (drb) */
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nDEBUG:"
+         << "\norigin:                 " << origin
+         << "\nSeek position:          " << rasterOffset
+         << "\ninputLineBufferWidth:   " << inputLineBufferWidth
+         << "\noutputLineBufferWidth:  " << outputLineBufferWidth
+         << "\nINPUT_BANDS:            " << INPUT_BANDS
+         << "\nOUTPUT_BANDS:           " << OUTPUT_BANDS
+         << std::endl;
+#endif
+   
+   ossim_int32 bufferOffset = 0;   
+   
+   // Line loop:
+   ossim_int32 currentLine = 0;
+   while ( currentLine < HEIGHT )
+   {
+      // Seek to line.
+      m_fileStrList[0]->seekg(rasterOffset, ios::beg);
+      if  (!(*m_fileStrList[0]))
+      {
+         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << " Seek error!  Returning with error..." << std::endl;
+         return false;
+      }
+
+      // Read image data from line for all bands into line buffer.   
+      m_fileStrList[0]->read( (char*)m_lineBuffer, inputLineBufferWidth );
+      if ( m_fileStrList[0]->gcount() != inputLineBufferWidth ) 
+      {
+         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << "\nERROR:  Reading image line." << std::endl;
+         return false;
+      }
+      
+      // Sample loop:
+      for ( ossim_int32 sample = 0; sample < WIDTH; ++sample )
+      {
+         // Band loop:
+         for ( ossim_int32 band = 0; band < OUTPUT_BANDS; ++band )
+         {
+            ossim_int32 selectedBand = static_cast<ossim_int32>(m_outputBandList[band]);
+            memcpy( (void*)(m_buffer + bufferOffset +
+                            sample * OUTPUT_BYTES_PER_SAMPLE +
+                            band * BYTES_PER_PIXEL),
+                    (void*)(m_lineBuffer +
+                            sample * INPUT_BYTES_PER_SAMPLE + 
+                            selectedBand * BYTES_PER_PIXEL),
+                    BYTES_PER_PIXEL );
+         }
+      }
+               
+      ++currentLine;
+      bufferOffset += outputLineBufferWidth;
+      rasterOffset += m_rasterInfo.bytesPerRawLine();
+   }
+   
+   return true;
+   
+} // End: bool ossimGeneralRasterTileSource::fillBipBandSelect(...
+
+bool ossimGeneralRasterTileSource::fillBIL(const ossimIpt& origin,
+                                           const ossimIpt& size)
+{
+   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBIL";
+   
+   //***
+   // This will fill a buffer the full width of valid samples * tileHeight().
+   //***
+   m_bufferRect.set_ul(origin);
+   m_bufferRect.set_lry(min((origin.y + size.y - 1),
+                             m_rasterInfo.imageRect().lr().y));
+   m_bufferRect.set_lrx(min((origin.x + size.x - 1),
+                             m_rasterInfo.imageRect().lr().x));
+   
+   ossim_sint64 currentLine = origin.y;
+
+   // Bytes in one line all bands.
+   const std::streamoff LINE_OFFSET =
+      m_rasterInfo.bytesPerRawLine() * m_rasterInfo.numberOfBands();
+
+   // Start seek position.
+   std::streamoff offset = ( m_rasterInfo.offsetToFirstValidSample() +
+                             currentLine * LINE_OFFSET +
+                             origin.x * m_rasterInfo.bytesPerPixel() );
+
+   //---
+   // Loop through and process lines. 
+   //---
+   ossim_int32 linesProcessed = 0;
+   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
+   ossim_uint8* buf = m_buffer;
+
+#if 0 /* Please leave for debug.  (drb) */
+   ossimNotify(ossimNotifyLevel_DEBUG)
+      << "\nDEBUG:"
+      << "\norigin:                 " << origin
+      << "\nSeek position:          " << offset
+      << "\nStarting line number:   " << currentLine
+      << "\nbuffer_width:           " << buffer_width << std::endl;
+#endif
+
+   // Line loop:
+   while ((currentLine <= static_cast<ossim_sint64>(m_rasterInfo.imageRect().lr().y)) &&
+          linesProcessed < size.y)
+   {
+      // Band loop:
+      std::vector<ossim_uint32>::const_iterator i = m_outputBandList.begin();
+      while ( i != m_outputBandList.end() )
+      {
+         ossim_int64 band = static_cast<ossim_sint64>( (*i) );
+         const std::streamoff bandOffset = band * m_rasterInfo.bytesPerRawLine();
+         
+         // Seek to line.
+         m_fileStrList[0]->seekg(offset + bandOffset, ios::beg);
+         if (!m_fileStrList[0])
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:\n"
+               << " Seek error!  Returning with error..." << std::endl;
+            return false;
+         }
+         
+         // Read the line of image data.   
+         m_fileStrList[0]->read( (char*)buf, buffer_width );
+
+         if ( m_fileStrList[0]->gcount() != buffer_width ) 
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nERROR:  Reading image line."
+               << "\ncurrentLine:  " << currentLine << std::endl;
+            return false;
+         }
+         
+         buf += buffer_width;
+         ++i;
+
+      } // End of band loop.
+      
+      ++linesProcessed;
+      ++currentLine;
+      offset += LINE_OFFSET;
+      
+   } // End: line loop
+   
+   return true;
+}
+   
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimGeneralRasterTileSource::fillBSQ(const ossimIpt& origin,
+                                           const ossimIpt& size)
+{
+   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBSQ";
+
+   // This will fill a buffer the full width of valid samples * tileHeight().
+
+   m_bufferRect.set_ul(origin);
+   
+   m_bufferRect.set_lry(min((origin.y + size.y -1),
+                             m_rasterInfo.imageRect().lr().y));
+   m_bufferRect.set_lrx(min((origin.x + size.x - 1),
+                             m_rasterInfo.imageRect().lr().x));
+   
+   // Start seek position.
+   std::streamoff startSeekPosition
+      = m_rasterInfo.offsetToFirstValidSample() +
+        origin.y * m_rasterInfo.bytesPerRawLine() +
+        origin.x * m_rasterInfo.bytesPerPixel();
+
+   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
+   
+   ossim_uint8* buf = (ossim_uint8*)m_buffer;
+
+   std::streamoff bandOffset
+      = m_rasterInfo.bytesPerRawLine() * m_rasterInfo.rawLines();
+
+#if 0 /* Please leave for debug. (drb) */
+   ossimNotify(ossimNotifyLevel_DEBUG)
+      << "\nDEBUG:"
+      << "\norigin:                 " << origin
+      << "\nSeek position:          " << startSeekPosition
+      << "\nStarting line number:   " << origin.y
+      << "\nbuffer_width:           " << buffer_width
+      << "\nbytesPerRawLine():      "
+      << m_rasterInfo.bytesPerRawLine()
+      << "\nm_rasterInfo.offsetToFirstValidSample():  "
+      << m_rasterInfo.offsetToFirstValidSample()
+      << "\nbandOffset: " << bandOffset << std::endl;
+#endif
+
+   ossim_int32 num_bands = m_rasterInfo.numberOfBands();
+   ossim_int32 height    = size.y;
+
+   // Band loop:
+   for (ossim_int32 band = 0; band < num_bands; ++band)
+   {
+      ossim_sint64 currentLine    = origin.y;
+      ossim_sint64 linesProcessed = 0;
+
+      std::streamoff offset = startSeekPosition + (band * bandOffset);
+
+      // Line loop:
+      while (currentLine <= m_rasterInfo.imageRect().lr().y &&
+             linesProcessed < height)
+      {
+         // Seek to line.
+         m_fileStrList[0]->seekg(offset, ios::beg);
+         if (!m_fileStrList[0])
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:\n"
+               << " Seek error!  Returning with error..." << std::endl;
+            return false;
+         }
+         
+         // Read the line of image data.   
+         m_fileStrList[0]->read( (char*)buf, buffer_width );
+         if ( m_fileStrList[0]->gcount() != buffer_width ) 
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nERROR:  Reading image line."
+               << "\ncurrentLine:  " << currentLine << std::endl;
+            return false;
+         }
+
+         // Increment everybody accordingly.
+         buf += buffer_width;
+         offset += m_rasterInfo.bytesPerRawLine();
+         ++linesProcessed;
+         ++currentLine;
+
+      } // End of line loop.
+
+   } // End of band loop.
+   
+   return true;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimGeneralRasterTileSource::fillBsqMultiFile(const ossimIpt& origin, const ossimIpt& size)
+{
+   static const char MODULE[] = "ossimGeneralRasterTileSource::fillBsqMultiFile";
+
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
+   
+
+   // This will fill a buffer the full width of valid samples * tileHeight().
+   m_bufferRect.set_ul(origin);
+   
+   m_bufferRect.set_lry(min((origin.y + size.y -1),
+                             m_rasterInfo.imageRect().lr().y));
+   m_bufferRect.set_lrx(min((origin.x + size.x - 1),
+                             m_rasterInfo.imageRect().lr().x));
+   
+   //---
+   // Start seek position.
+   //---
+   std::streamoff startSeekPosition = m_rasterInfo.offsetToFirstValidSample() +
+      origin.y * m_rasterInfo.bytesPerRawLine() +
+      origin.x * m_rasterInfo.bytesPerPixel();
+   
+   //---
+   // Loop through and process lines. 
+   //---
+   std::streamsize buffer_width = m_bufferRect.width() * m_rasterInfo.bytesPerPixel();
+   
+   ossim_uint8* buf = (ossim_uint8*)m_buffer;
+
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nDEBUG:"
+         << "\norigin:                 " << origin
+         << "\nSeek position:          " << startSeekPosition
+         << "\nStarting line number:   " << origin.y
+         << "\nbuffer_width:           " << buffer_width
+         << "\nbuffer_rect:            " << m_bufferRect
+         << "\nbytesPerRawLine():      "
+         << m_rasterInfo.bytesPerRawLine()
+         << "\nm_rasterInfo.offsetToFirstValidSample():  "
+         << m_rasterInfo.offsetToFirstValidSample() << std::endl;
+   }
+#endif
+
+   // ossim_int32 num_bands = m_rasterInfo.numberOfBands();
+   std::vector<ossim_uint32>::const_iterator bandIter = m_outputBandList.begin();
+   while ( bandIter != m_outputBandList.end() )
+   {
+      ossim_int32 currentLine    = origin.y;
+      ossim_int32 linesProcessed = 0;
+      ossim_int64 offset         = startSeekPosition;
+      
+      while (currentLine <= m_rasterInfo.imageRect().lr().y && linesProcessed < size.y)
+      {
+         //---
+         // Seek to line.
+         //---
+         m_fileStrList[ *bandIter ]->seekg(offset, ios::beg);
+
+         if ( !m_fileStrList[ *bandIter ] )
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:\n"
+               << " Seek error!  Returning with error..." << std::endl;
+            return false;
+         }
+         
+         //---
+         // Read the line of image data.   
+         //---
+         m_fileStrList[ *bandIter ]->read((char*)buf, buffer_width);
+         
+         if ( m_fileStrList[ *bandIter ]->gcount() != buffer_width) 
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nERROR:  Reading image line."
+               << "\ncurrentLine:  " << currentLine << std::endl;
+            return false;
+         }
+
+         // Increment everybody accordingly.
+         buf += buffer_width;
+         offset += m_rasterInfo.bytesPerRawLine();
+         ++linesProcessed;
+         ++currentLine;
+         
+      } // End of line loop.
+
+      ++bandIter; // Next band...
+
+   } // End: while ( bandIter ! = m_outputBandList.end() )
+   
+   return true;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimGeneralRasterTileSource::saveState(ossimKeywordlist& kwl,
+                                             const char* prefix) const
+{   
+   // Our stuff:
+   m_rasterInfo.saveState(kwl, prefix);
+
+   // Base class:
+   bool result = ossimImageHandler::saveState(kwl, prefix);
+   
+   if ( result && isBandSelector() && m_outputBandList.size() )
+   {
+      if ( isIdentityBandList( m_outputBandList ) == false )
+      {
+         // If we're not identity output the bands.
+         ossimString bandsString;
+         ossim::toSimpleStringList(bandsString, m_outputBandList);
+         kwl.add(prefix,
+                 ossimKeywordNames::BANDS_KW,
+                 bandsString,
+                 true);
+      }
+   }
+   
+   return result;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimGeneralRasterTileSource::loadState(const ossimKeywordlist& kwl,
+                                             const char* prefix)
+{
+   bool result = false;
+   m_outputBandList.clear();
+
+   if ( ossimImageHandler::loadState(kwl, prefix) )
+   {  
+      // Set the band list if key is present.
+      std::string pfx = ( prefix ? prefix : "" );
+      std::string key = ossimKeywordNames::BANDS_KW;
+      ossimString value;
+      value.string() = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         ossim::toSimpleVector( m_outputBandList, value );
+      }
+      result = open();
+   }
+   return result;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossimScalarType ossimGeneralRasterTileSource::getOutputScalarType() const
+{
+   return m_rasterInfo.getImageMetaData().getScalarType();
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimGeneralRasterTileSource::getTileWidth() const
+{
+   ossim_uint32 result = 0;
+   if ( m_tile.valid() )
+   {
+      m_tile->getWidth();
+   }
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = tileSize.x;
+   }
+   return result;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimGeneralRasterTileSource::getTileHeight() const
+{
+   ossim_uint32 result = 0;
+   if ( m_tile.valid() )
+   {
+      m_tile->getHeight();
+   }
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = tileSize.y;
+   }
+   return result;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool
+ossimGeneralRasterTileSource::isValidRLevel(ossim_uint32 reduced_res_level) const
+{
+   static const char MODULE[] = "ossimGeneralRasterTileSource::isValidRLevel";
+   
+   if (reduced_res_level == 0)
+   {
+      return true;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->isValidRLevel(reduced_res_level);
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " Invalid reduced_res_level:  " << reduced_res_level
+         << "\nHighest available:  " << (getNumberOfDecimationLevels() - 1)
+         << std::endl;
+      return false;
+   }
+}
+
+
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32
+ossimGeneralRasterTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return m_rasterInfo.validLines();
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfLines(reduced_res_level);
+   }
+
+   return 0;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossim_uint32 ossimGeneralRasterTileSource::getNumberOfSamples(
+   ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return m_rasterInfo.validSamples();
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfSamples(reduced_res_level);
+   }
+
+   return 0;
+}
+
+double ossimGeneralRasterTileSource::getNullPixelValue(ossim_uint32 band) const
+{
+   return m_rasterInfo.getImageMetaData().getNullPix(band);
+}
+
+double ossimGeneralRasterTileSource::getMinPixelValue(ossim_uint32 band)const
+{
+   return m_rasterInfo.getImageMetaData().getMinPix(band);
+}
+
+double ossimGeneralRasterTileSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   return m_rasterInfo.getImageMetaData().getMaxPix(band);
+}
+
+bool ossimGeneralRasterTileSource::open()
+{
+   static const char MODULE[] = "ossimGeneralRasterTileSource::open";
+
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
+   
+   bool result = false;
+   
+   if(isOpen())
+   {
+      close();
+   }
+   
+   //---
+   // Find the header file:
+   //
+   // We need lines, samples, bands, scalar and interleave at a minimum:
+   // 
+   // A general raster image requires a keyword list to get essential image
+   // information or meta data as its sometimes called.  The meta data file
+   // can have four types of extensions: ".omd", ".hdr", ".kwl" and xml.
+   // Look for them in that order.
+   // Note that the ".omd" extension is for "Ossim Meta Data" and was made
+   // up to avoid conflicting with other software packages ".hdr" files.
+   //---
+   if ( m_rasterInfo.open( theImageFile ) )
+   {
+      theMetaData = m_rasterInfo.getImageMetaData();
+      
+      result = initializeHandler();
+      if ( result )
+      {
+         completeOpen();
+
+         if ( isBandSelector() && m_outputBandList.size() &&
+              ( isIdentityBandList( m_outputBandList ) == false ) )
+         {
+            // This does range checking and will pass to overview if open.
+            setOutputBandList( m_outputBandList );
+         }
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " Exit status: " << (result?"true":"false") << std::endl;
+   }
+   return result;
+}
+                                             
+bool ossimGeneralRasterTileSource::open( const ossimGeneralRasterInfo& info )
+{
+   if( isOpen() )
+   {
+      close();
+   }
+   
+   m_rasterInfo = info;
+
+   bool result = initializeHandler();
+
+   if ( result )
+   {
+      completeOpen();  
+
+      if ( isBandSelector() && m_outputBandList.size() &&
+           ( isIdentityBandList( m_outputBandList ) == false ) )
+      { 
+         // This does range checking and will pass to overview if open.
+         setOutputBandList( m_outputBandList );
+      }
+   }
+   
+   return result;
+}
+
+bool ossimGeneralRasterTileSource::initializeHandler()
+{
+   //---
+   // This private method assumes that "m_rasterInfo" object has been
+   // initialized.  Note that "close() should have already been called if
+   // there was an open file prior to this.
+   //---
+   std::vector<ossimFilename> aList = m_rasterInfo.getImageFileList();
+
+   for (ossim_uint32 i=0; i<aList.size(); ++i)
+   {
+      ossimFilename f = aList[i];
+      
+      // open it...
+      std::shared_ptr<ossim::ifstream> is = ossimStreamFactoryRegistry::instance()->
+         createIFStream(f, std::ios::in|std::ios::binary);
+
+      // check the stream...
+      if( is )
+      {
+         // Check the file stream.
+         if ( is->fail() )
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimGeneralRasterTileSource::open" << " ERROR:\n"
+               << "Cannot open:  " << f.c_str() << std::endl;
+            is = 0;
+            return false;
+         }
+      }
+
+      // Check the file size (removed).
+
+      m_fileStrList.push_back(is); // Add it to the list...
+   }
+
+   if ((aList.size()==1) && theImageFile.empty())
+   {
+      theImageFile = aList[0];
+   }
+
+   // Set the buffer interleave type.
+   m_bufferInterleave = m_rasterInfo.interleaveType();
+   if (m_bufferInterleave == OSSIM_BSQ_MULTI_FILE)
+   {
+      m_bufferInterleave = OSSIM_BSQ;
+   }
+
+   if ( m_outputBandList.empty() )
+   {
+      // Set starting output band list to identity.
+      ossimImageSource::getOutputBandList( m_outputBandList );
+   }
+
+   //---
+   // Get the byte order of the image data and host machine.  If different,
+   // set the swap bytes flag...
+   //---
+   if (m_rasterInfo.getImageDataByteOrder() != ossim::byteOrder())
+   {
+      m_swapBytesFlag = true;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimGeneralRasterTileSource::initializeHandler()" << " DEBUG:"
+         << "\nScalar type:  "
+         << ossimScalarTypeLut::instance()->
+         getEntryString(m_rasterInfo.getImageMetaData().getScalarType())
+         << "\nByte swapping is "
+         << (m_swapBytesFlag?"enabled.":"not enabled.")
+         // << "\nm_bufferSizeInPixels:  " << m_bufferSizeInPixels
+         // << "\nbuffer size:  " << buffer_size
+         << "\nRasterInfo:\n";
+      m_rasterInfo.print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+   
+   return true;
+}
+
+bool ossimGeneralRasterTileSource::isOpen() const
+{
+   bool result = false;
+   if (m_fileStrList.size() > 0)
+   {
+      if( m_fileStrList[0] )
+      {
+         result = !(m_fileStrList[0]->fail());
+      }
+   }
+   return result;
+}
+
+void ossimGeneralRasterTileSource::close()
+{
+   ossimImageHandler::close();  // base class
+
+   m_tile = 0; // Not a leak, ref ptr.
+   
+   if ( m_buffer )
+   {
+      delete [] m_buffer;
+      m_buffer = 0;
+      m_bufferSizeInPixels = 0; // Must zero out for check in getTile method.
+   }
+
+   if ( m_lineBuffer )
+   {
+      delete [] m_lineBuffer;
+      m_lineBuffer = 0;
+   }
+
+   std::vector< shared_ptr<ossim::ifstream> >::iterator is = m_fileStrList.begin();
+   while (is != m_fileStrList.end())
+   {
+      (*is)->close();
+      // delete (*is);
+      // (*is) = 0;
+      ++is;
+   }
+   m_fileStrList.clear();
+}
+
+ossim_uint32 ossimGeneralRasterTileSource::getImageTileWidth() const
+{
+   return 0;
+}
+
+ossim_uint32 ossimGeneralRasterTileSource::getImageTileHeight() const
+{
+   return 0;
+}
+
+ossimString ossimGeneralRasterTileSource::getShortName()const
+{
+   return ossimString("ossim_raster");
+}
+
+ossimString ossimGeneralRasterTileSource::getLongName()const
+{
+   return ossimString("general raster reader");
+}
+
+ossim_uint32 ossimGeneralRasterTileSource::getNumberOfInputBands() const
+{
+   return m_rasterInfo.getImageMetaData().getNumberOfBands();
+}
+
+ossim_uint32 ossimGeneralRasterTileSource::getNumberOfOutputBands() const
+{
+   ossim_uint32 result = 0;
+   if ( isBandSelector() && m_outputBandList.size() )
+   {
+      result = (ossim_uint32)m_outputBandList.size();
+   }
+   else
+   {
+      result = m_rasterInfo.getImageMetaData().getNumberOfBands();
+   }  
+   return result;
+}
+
+ossimKeywordlist ossimGeneralRasterTileSource::getHdrInfo(ossimFilename hdrFile)
+{
+   ossimKeywordlist kwl;
+   char delimeter = ' ';
+   kwl.change_delimiter(delimeter);
+   kwl.addFile(hdrFile);
+   kwl.downcaseKeywords();
+
+   ossimKeywordlist geoKwl;
+   ossim_uint32 lines = 0;
+   ossim_uint32 samples = 0;
+   ossim_float32 noData = -9999;
+   ossimString scalarType = "ossim_uint8";
+   ossim_int32 numBands = 1;
+   // ossim_int32 skipBytes = 0;
+   ossim_int32 numBits = -1; 
+   ossimString chPixelType = "N"; // not defined
+   ossimString interleaveType = "BIL";
+   ossimString byteOrder;
+   bool noDataFound = false;
+
+   const char* lookup = kwl.find("ncols");
+   if (lookup)
+   {
+      samples = ossimString(lookup).toUInt32();
+      geoKwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
+   }
+
+   lookup = kwl.find("nrows");
+   if (lookup)
+   {
+      lines = ossimString(lookup).toUInt32();
+      geoKwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
+   }
+
+   // lookup = kwl.find("skipbytes");
+   // if (lookup)
+   // {
+   //    skipBytes = ossimString(lookup).toInt();
+   // }
+
+   lookup = kwl.find("nbands");
+   if (lookup)
+   {
+      numBands = ossimString(lookup).toInt();
+   }
+
+   lookup = kwl.find("nodata");
+   if (lookup)
+   {
+      noData = ossimString(lookup).toFloat32();
+      noDataFound = true;
+   }
+   lookup = kwl.find("nodata_value");
+   if (lookup)
+   {
+      noData = ossimString(lookup).toFloat32();
+      noDataFound = true;
+   }
+
+   lookup = kwl.find("nbits");
+   if (lookup)
+   {
+      numBits = ossimString(lookup).toInt();
+   }
+
+   lookup = kwl.find("pixeltype");
+   if (lookup)
+   {
+      chPixelType = ossimString(lookup);
+   }
+
+   lookup = kwl.find("layout");
+   if (lookup)
+   {
+      interleaveType = ossimString(lookup);
+   }
+
+   lookup = kwl.find("byteorder");
+   if (lookup)
+   {
+      byteOrder = ossimString(lookup);
+   }
+
+   if (numBits == -1)
+   {
+      FILE* fp;
+      ossim_int64 size = 0;
+      fp = fopen(theImageFile.c_str(), "r");
+      if (fp != 0)
+      {
+         fseek(fp, 0, SEEK_END);
+         size = ftell(fp);
+      }
+      fclose(fp);
+
+      if (lines > 0 && samples > 0)
+      {
+         ossim_int32 numBytes = size/samples/lines/numBands;
+         if( numBytes > 0 && numBytes != 3 )
+         {
+            numBits = numBytes*8;
+
+            if( numBytes == 4 )
+            {
+               chPixelType = "F";
+            }
+         }
+      }
+   }
+
+   if( numBits == 16 )
+   {
+      if (chPixelType == "S")
+      {
+         scalarType = "ossim_sint16";
+      }
+      else
+      {
+         scalarType = "ossim_uint16"; // default
+      }
+   }
+   else if( numBits == 32 )
+   {
+      if( chPixelType == "S")
+      {
+         scalarType = "ossim_sint32";
+      }
+      else if( chPixelType == "F")
+      {
+         scalarType = "ossim_float32";
+      }
+      else
+      {
+         scalarType = "ossim_uint32"; // default 
+      }
+   }
+   else if( numBits == 8 )
+   {
+      scalarType = "ossim_uint8";
+      numBits = 8;
+   }
+   else if( numBits < 8 && numBits >= 1 )
+   {
+      scalarType = "ossim_uint8";
+   }
+   else if(numBits == -1)
+   {
+      if( chPixelType == "F")
+      {
+         scalarType = "ossim_float32";
+         numBits = 32;
+      }
+      else
+      {
+         scalarType = "ossim_uint8";
+         numBits = 8;
+      }
+   }
+
+   if (noDataFound)
+   {
+      for (ossim_int32 i = 0; i < numBands; i++)
+      {
+         ossimString prefix = "band" + ossimString::toString(i+1) + ": ";
+         geoKwl.add(prefix, ossimKeywordNames::NULL_VALUE_KW, noData);
+      }
+   }
+
+   geoKwl.add(ossimKeywordNames::NUMBER_BANDS_KW, numBands);
+   geoKwl.add(ossimKeywordNames::SCALAR_TYPE_KW, scalarType);
+   geoKwl.add(ossimKeywordNames::INTERLEAVE_TYPE_KW, interleaveType);
+
+   return geoKwl;
+}
+
+ossimKeywordlist ossimGeneralRasterTileSource::getXmlInfo(ossimFilename xmlFile)
+{
+   ossimKeywordlist kwl;
+   ossimFgdcXmlDoc file;
+   if (file.open(xmlFile))
+   {
+
+      ossimString scalarType = "ossim_uint8";
+      ossim_int32 numBits = -1; 
+      ossimString interleaveType = "BIL";
+
+      ossimIpt size;
+      ossim_int32 samples = 0;
+      ossim_int32 lines = 0;
+      if (file.getImageSize(size))
+      {
+         samples = size.x;
+         lines = size.y;
+      }
+      if (samples > 0)
+      {
+         kwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
+      }
+      if (lines > 0)
+      {
+         kwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
+      }
+
+      ossim_int32 bands = file.getNumberOfBands();
+      if (bands > 0)
+      {
+         kwl.add(ossimKeywordNames::NUMBER_BANDS_KW, bands);
+      }
+      else
+      {
+         if (samples > 0 && lines > 0)//if there is no bands info but samples and lines info, default number of bands to 1
+         {
+            bands = 1;
+            kwl.add(ossimKeywordNames::NUMBER_BANDS_KW, bands);
+         }
+      }
+
+      ossimString eainfo;
+      file.getPath("/metadata/eainfo/detailed/enttyp/enttypd", eainfo);
+
+      if (numBits == -1)
+      {
+         if ( (lines > 0) && (samples > 0) && (bands > 0) )
+         {
+            ossim_int64 size = theImageFile.fileSize();            
+            ossim_int32 numBytes = size/samples/lines/bands;
+            if( numBytes > 0 && numBytes != 3 )
+            {
+               numBits = numBytes*8;
+            }
+         }
+      }
+
+      if( numBits == 16 )
+      {
+         scalarType = "ossim_uint16"; // default
+      }
+      else if( numBits == 32 )
+      {
+         if(eainfo.contains("float"))
+         {
+            scalarType = "ossim_float32";
+         }
+         else
+         {
+            scalarType = "ossim_uint32"; // default 
+         }
+      }
+      else if( numBits == 8 )
+      {
+         scalarType = "ossim_uint8";
+         numBits = 8;
+      }
+      else if( numBits < 8 && numBits >= 1 )
+      {
+         scalarType = "ossim_uint8";
+      }
+
+      kwl.add(ossimKeywordNames::SCALAR_TYPE_KW, scalarType);
+      kwl.add(ossimKeywordNames::INTERLEAVE_TYPE_KW, interleaveType);
+   }
+   return kwl;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimGeneralRasterTileSource::getImageGeometry()
+{
+   if ( !theGeometry.valid() )
+   {
+      // Check for external geom:
+      theGeometry = getExternalImageGeometry();
+
+      if ( !theGeometry.valid() )
+      {
+         theGeometry = new ossimImageGeometry();
+         
+         ossimString ext = theImageFile.ext();
+         ossimFilename hdrFile = theImageFile;
+         ossimFilename xmlFile = theImageFile;
+         hdrFile = hdrFile.setExtension("hdr");
+         xmlFile = xmlFile.setExtension("xml");
+         if (hdrFile.exists())
+         {
+            ossimKeywordlist geoKwl;
+            ossimKeywordlist kwl(hdrFile, ' ');
+            kwl.downcaseKeywords();
+            
+            ossim_uint32 lines = 0;
+            ossim_uint32 samples = 0;
+            ossim_float32 ll_lon = 0.0;
+            ossim_float32 ll_lat = 0.0;
+            ossim_float32 xCellSize = 1.0;
+            ossim_float32 yCellSize = 1.0;
+            
+            const char* lookup = kwl.find("ncols");
+            if (lookup)
+            {
+               samples = ossimString(lookup).toUInt32();
+               geoKwl.add(ossimKeywordNames::NUMBER_SAMPLES_KW, samples);
+            }
+            
+            lookup = kwl.find("nrows");
+            if (lookup)
+            {
+               lines = ossimString(lookup).toUInt32();
+               geoKwl.add(ossimKeywordNames::NUMBER_LINES_KW, lines);
+            }
+            
+            lookup = kwl.find("cellsize");
+            if (lookup)
+            {
+               xCellSize = ossimString(lookup).toFloat32();
+               yCellSize = xCellSize;
+               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, yCellSize);
+               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, xCellSize);
+            }
+            
+            lookup = kwl.find("xdim");
+            if (lookup)
+            {
+               xCellSize = ossimString(lookup).toFloat32();
+               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON, xCellSize);
+            }
+            
+            lookup = kwl.find("ydim");
+            if (lookup)
+            {
+               yCellSize = ossimString(lookup).toFloat32();
+               geoKwl.add(ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT, yCellSize);
+            }
+            
+            lookup = kwl.find("xllcenter");
+            if (lookup)
+            {
+               ossim_float32 centerX = ossimString(lookup).toFloat32();
+               ll_lon = centerX + xCellSize * 0.5;
+               geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
+            }
+            
+            lookup = kwl.find("yllcenter");
+            if (lookup)
+            {
+               ossim_float32 centerY = ossimString(lookup).toFloat32();
+               ll_lat = (centerY + (lines - 1) * yCellSize) + yCellSize * 0.5;
+               geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
+            }
+            
+            lookup = kwl.find("xllcorner");
+            if (lookup)
+            {
+               ll_lon = ossimString(lookup).toFloat32();
+               geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
+            }
+            
+            lookup = kwl.find("yllcorner");
+            if (lookup)
+            {
+               ossim_uint32 centerY = ossimString(lookup).toFloat32();
+               ll_lat = centerY + lines * yCellSize;
+               geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
+            }
+            
+            lookup = kwl.find("ulxmap");
+            if (lookup)
+            {
+               ll_lon = ossimString(lookup).toFloat32();
+               geoKwl.add(ossimKeywordNames::TIE_POINT_LON_KW, ll_lon);
+            }
+            
+            lookup = kwl.find("ulymap");
+            if (lookup)
+            {
+               ossim_uint32 centerY = ossimString(lookup).toFloat32();
+               ll_lat = centerY + lines * yCellSize;
+               geoKwl.add(ossimKeywordNames::TIE_POINT_LAT_KW, ll_lat);
+            }
+            
+            kwl.add(ossimKeywordNames::ORIGIN_LATITUDE_KW, ll_lat);
+            
+            geoKwl.add(ossimKeywordNames::TYPE_KW, "ossimEquDistCylProjection");
+            
+            geoKwl.add(ossimKeywordNames::DATUM_KW, ossimDatumFactory::instance()->wgs84()->
+                       code());
+            
+            ossimRefPtr<ossimProjection> proj = ossimMapProjectionFactory::instance()->
+               createProjection(geoKwl);
+
+            if ( proj.valid() )
+            {
+               theGeometry->setProjection(proj.get());
+            }
+         }
+         else if (xmlFile.exists())
+         {
+            ossimFgdcXmlDoc file;
+            if ( file.open(xmlFile) )
+            {
+               ossimRefPtr<ossimProjection> proj = file.getProjection();
+               if ( !proj.valid() )
+               {
+                  proj = file.getGridCoordSysProjection();
+               }
+               if ( proj.valid() )
+               {
+                  theGeometry->setProjection(proj.get());
+               }
+            }
+            
+         } // xml file exist...
+
+      } // Matches second if ( !theGeometry.valid() )
+
+      //---
+      // WARNING:
+      // Must have theGeometry at this point or the next call to
+      // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
+      // as it does a recursive call back to ossimImageHandler::getImageGeometry().
+      //---         
+      
+      // Check for set projection.
+      if ( !theGeometry->getProjection() )
+      {
+         // Try factories for projection.
+         ossimImageGeometryRegistry::instance()->extendGeometry(this);
+      }
+
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+      
+   } // Matches first if ( !theGeometry.valid() )
+
+   return theGeometry;
+}
+
+bool ossimGeneralRasterTileSource::isBandSelector() const
+{
+   bool result = false;
+   if ( ( m_rasterInfo.interleaveType() == OSSIM_BSQ_MULTI_FILE ) ||
+        ( m_rasterInfo.interleaveType() == OSSIM_BIP ) ||
+        ( m_rasterInfo.interleaveType() == OSSIM_BIL ) )
+   {
+      result = true;
+   }
+
+   if ( result && theOverview.valid() )
+   {
+      result = theOverview->isBandSelector();
+   }   
+   return result;
+}
+
+bool ossimGeneralRasterTileSource::setOutputBandList(const std::vector<ossim_uint32>& band_list)
+{
+   bool result = false;
+   if ( isBandSelector() )
+   {
+      // Making a copy as passed in list could be our m_outputBandList.
+      std::vector<ossim_uint32> inputList = band_list;
+      result = ossimImageHandler::setOutputBandList( inputList, m_outputBandList );
+      if ( result && m_tile.valid() )
+      {
+         if ( m_tile->getNumberOfBands() != m_outputBandList.size() )
+         {
+            m_tile = 0; // Force a reinitialize on next getTile.
+         }
+      }
+   }
+   return result;
+}
+
+void ossimGeneralRasterTileSource::getOutputBandList(std::vector<ossim_uint32>& bandList) const
+{
+   bandList = m_outputBandList;
+}
+
+void ossimGeneralRasterTileSource::allocateTile()
+{
+   m_tile = 0;
+   ossim_uint32 bands = 0;
+   if ( m_outputBandList.empty() )
+   {
+      bands = m_rasterInfo.numberOfBands();
+   }
+   else
+   {
+      bands = (ossim_uint32)m_outputBandList.size();
+   }
+   
+   if ( bands )
+   {
+      m_tile = ossimImageDataFactory::instance()->create(
+         this, m_rasterInfo.getImageMetaData().getScalarType(), bands );
+      
+      if ( m_tile.valid() )
+      {
+         // These values can be overridden by loadState...
+         for(ossim_uint32 band = 0; band < bands; ++ band)
+         {
+            m_tile->setNullPix(m_rasterInfo.getImageMetaData().getNullPix(band), band);
+            m_tile->setMinPix(m_rasterInfo.getImageMetaData().getMinPix(band), band);
+            m_tile->setMaxPix(m_rasterInfo.getImageMetaData().getMaxPix(band), band);
+         }
+         m_tile->initialize(); // This does a makeBlank().
+      }
+   }
+}
+
+void ossimGeneralRasterTileSource::allocateBuffer( const ossimImageData* tile )
+{
+   if( m_buffer )
+   {
+      delete [] m_buffer;
+      m_buffer = 0;
+      m_bufferSizeInPixels = 0; // Must zero out for check in getTile method.
+   }
+   if ( m_lineBuffer )
+   {
+      delete [] m_lineBuffer;
+      m_lineBuffer = 0;
+   }
+   
+   if ( tile )
+   {
+      // Store the size of the buffer in pixels for swapping bytes.
+      m_bufferSizeInPixels = tile->getSize();
+      if ( m_bufferSizeInPixels )
+      {
+         // Initialize buffer. This is bytes, not pixels.
+         m_buffer = new ossim_uint8[ tile->getSizeInBytes() ];
+         
+         // Zero out the buffer rect.
+         m_bufferRect = ossimIrect(0, 0, 0, 0);
+      }
+
+      if ( m_rasterInfo.interleaveType() == OSSIM_BIP )
+      {
+         // Big enough to hold a whole line all bands.
+         ossim_uint32 widthInBytes =
+            tile->getWidth() * m_rasterInfo.getImageMetaData().getNumberOfBands() *
+            m_rasterInfo.getImageMetaData().getBytesPerPixel();
+         
+         m_lineBuffer = new ossim_uint8[ widthInBytes ];
+      }
+   }
+}
diff --git a/ossim/src/ossim/imaging/ossimGeneralRasterWriter.cpp b/src/imaging/ossimGeneralRasterWriter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeneralRasterWriter.cpp
rename to src/imaging/ossimGeneralRasterWriter.cpp
diff --git a/src/imaging/ossimGeoAnnotationBitmap.cpp b/src/imaging/ossimGeoAnnotationBitmap.cpp
new file mode 100644
index 0000000..9f6752e
--- /dev/null
+++ b/src/imaging/ossimGeoAnnotationBitmap.cpp
@@ -0,0 +1,204 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimGeoAnnotationBitmap.cpp 22519 2013-12-16 15:18:29Z dburken $
+
+#include <ossim/imaging/ossimGeoAnnotationBitmap.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimImageProjectionModel.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimIrect.h>
+
+RTTI_DEF1(ossimGeoAnnotationBitmap,
+          "ossimGeoAnnotationBitmap",
+          ossimGeoAnnotationObject)
+   
+ossimGeoAnnotationBitmap::ossimGeoAnnotationBitmap(
+   const ossimGpt& center,
+   ossimRefPtr<ossimImageData> imageData,
+   unsigned char r,
+   unsigned char g,
+   unsigned char b)
+   :ossimGeoAnnotationObject(r, g, b),
+    theCenterPoint(center),
+    theProjectedPoint(0,0),
+    theImageData(NULL)
+{
+   if(imageData.valid() &&
+      (imageData->getScalarType()==OSSIM_UCHAR))
+   {
+      theImageData = imageData;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimGeoAnnotationBitmap::ossimGeoAnnotationBitmap\n"
+         << "Invalid image data passed to ossimGeoAnnotationBitmap "
+         << "constructor" << endl;
+   }
+}
+
+ossimGeoAnnotationBitmap::ossimGeoAnnotationBitmap(
+   const ossimGeoAnnotationBitmap& rhs)
+   :
+   ossimGeoAnnotationObject(rhs),
+   theCenterPoint(rhs.theCenterPoint),
+   theProjectedPoint(rhs.theProjectedPoint),
+   theImageData(rhs.theImageData)
+{
+}
+
+ossimGeoAnnotationBitmap::~ossimGeoAnnotationBitmap()
+{
+}
+
+ossimObject* ossimGeoAnnotationBitmap::dup()const
+{
+   return new ossimGeoAnnotationBitmap(*this);
+}
+
+bool ossimGeoAnnotationBitmap::intersects(const ossimDrect& rect) const
+{
+   if(theImageData.valid())
+   {
+      return theImageData->getImageRectangle().intersects(rect);
+   }
+   
+   return false;
+}
+
+ossimGeoAnnotationBitmap* ossimGeoAnnotationBitmap::getNewClippedObject(
+   const ossimDrect& /* rect */)const
+{
+   ossimGeoAnnotationBitmap* result = (ossimGeoAnnotationBitmap*)dup();
+   
+   ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimGeoAnnotationBitmap::getNewClippedObject WRNING: "
+      << "not implemented" << std::endl;
+   
+   return result;
+}
+
+void ossimGeoAnnotationBitmap::applyScale(double /* x */, double /* y */)
+{
+     ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimGeoAnnotationBitmap::applyScale WRNING: not implemented"
+      << std::endl; 
+}
+
+
+std::ostream& ossimGeoAnnotationBitmap::print(std::ostream& out)const
+{
+   out << "center:    " << theCenterPoint << endl;
+   return out;
+}
+
+void ossimGeoAnnotationBitmap::draw(ossimRgbImage& anImage)const
+{
+   ossimRefPtr<ossimImageData> destination = anImage.getImageData();
+
+   if(!destination)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimGeoAnnotationBitmap::draw\n"
+         << "ERROR: can't draw annotation bitmap to NULL buffer" << endl;
+      
+      return;
+   }
+   ossimIrect destinationRect = destination->getImageRectangle();
+   ossimIrect srcRect         = theImageData->getImageRectangle();
+   if(!srcRect.intersects(destinationRect))
+   {
+      return;
+   }
+   ossimIrect clipRect        = srcRect.clipToRect(destinationRect);
+   
+   long clipHeight = (long)clipRect.height();
+   long clipWidth  = (long)clipRect.width();
+
+
+   if(clipRect.width() != 1.0 &&
+      clipRect.height() != 1.0)
+   {         
+      long destinationOffset   = (long)(((clipRect.ul().y - destinationRect.ul().y)* destinationRect.width()) +
+                                        (clipRect.ul().x - destinationRect.ul().x));
+      long srcOffset   = (long)(((clipRect.ul().y - srcRect.ul().y)*srcRect.width()) +
+                         (clipRect.ul().x - srcRect.ul().x));
+      long destinationIndex = destinationOffset;
+      long srcIndex         = srcOffset;
+      long num_bands        = destination->getNumberOfBands();
+      ossim_int32 s_width = (ossim_int32)srcRect.width();
+      ossim_int32 d_width = (ossim_int32)destinationRect.width();
+      
+      num_bands = num_bands > 3? 3:num_bands;
+      
+      const ossim_uint8* imageDataBuf = static_cast<const ossim_uint8*>(theImageData->getBuf());
+      unsigned char colorArray[3];
+      colorArray[0] = theRed;
+      colorArray[1] = theGreen;
+      colorArray[2] = theBlue;
+      for (long band=0; band<num_bands; ++band)
+      {
+         ossim_uint8* destinationBand = static_cast<ossim_uint8*>(destination->getBuf(band));
+         destinationIndex       = destinationOffset;
+         srcIndex               = srcOffset;
+         for(long line = 0; line < clipHeight; ++line)
+         {
+            for(long col = 0; col < clipWidth; ++col)
+            {
+               if(imageDataBuf[srcIndex + col])
+               {
+                  destinationBand[destinationIndex + col] = colorArray[band];
+               }
+            }
+            srcIndex += s_width;
+            destinationIndex += d_width;
+         }
+      } 
+   }
+}
+
+void ossimGeoAnnotationBitmap::getBoundingRect(ossimDrect& rect)const
+{
+   rect = ossimDrect(0,0,0,0);
+
+   if(theImageData.valid())
+   {
+      rect = theImageData->getImageRectangle();
+   }
+}
+
+void ossimGeoAnnotationBitmap::transform(ossimImageGeometry* projection)
+{
+   if(projection)
+   {
+      projection->worldToLocal(theCenterPoint, theProjectedPoint);
+      theProjectedPoint = ossimIpt(theProjectedPoint);
+      if(theImageData.valid())
+      {
+         ossimDpt origin(theProjectedPoint.x - theImageData->getWidth()/2.0,
+                         theProjectedPoint.y - theImageData->getHeight()/2.0);
+         
+         theImageData->setOrigin(origin);
+      }
+   }
+}
+
+void ossimGeoAnnotationBitmap::setImageData(
+   ossimRefPtr<ossimImageData>& imageData)
+{
+   theImageData = imageData;
+}
+
+void ossimGeoAnnotationBitmap::computeBoundingRect()
+{
+   // nothing to be done since we don't support
+   // rotated bitmaps yet.
+}
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationEllipseObject.cpp b/src/imaging/ossimGeoAnnotationEllipseObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationEllipseObject.cpp
rename to src/imaging/ossimGeoAnnotationEllipseObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationFontObject.cpp b/src/imaging/ossimGeoAnnotationFontObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationFontObject.cpp
rename to src/imaging/ossimGeoAnnotationFontObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationGdBitmapFont.cpp b/src/imaging/ossimGeoAnnotationGdBitmapFont.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationGdBitmapFont.cpp
rename to src/imaging/ossimGeoAnnotationGdBitmapFont.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationLineObject.cpp b/src/imaging/ossimGeoAnnotationLineObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationLineObject.cpp
rename to src/imaging/ossimGeoAnnotationLineObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationMultiEllipseObject.cpp b/src/imaging/ossimGeoAnnotationMultiEllipseObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationMultiEllipseObject.cpp
rename to src/imaging/ossimGeoAnnotationMultiEllipseObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationMultiPolyLineObject.cpp b/src/imaging/ossimGeoAnnotationMultiPolyLineObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationMultiPolyLineObject.cpp
rename to src/imaging/ossimGeoAnnotationMultiPolyLineObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationMultiPolyObject.cpp b/src/imaging/ossimGeoAnnotationMultiPolyObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationMultiPolyObject.cpp
rename to src/imaging/ossimGeoAnnotationMultiPolyObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationObject.cpp b/src/imaging/ossimGeoAnnotationObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationObject.cpp
rename to src/imaging/ossimGeoAnnotationObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationPolyLineObject.cpp b/src/imaging/ossimGeoAnnotationPolyLineObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationPolyLineObject.cpp
rename to src/imaging/ossimGeoAnnotationPolyLineObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationPolyObject.cpp b/src/imaging/ossimGeoAnnotationPolyObject.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationPolyObject.cpp
rename to src/imaging/ossimGeoAnnotationPolyObject.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoAnnotationSource.cpp b/src/imaging/ossimGeoAnnotationSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoAnnotationSource.cpp
rename to src/imaging/ossimGeoAnnotationSource.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeoPolyCutter.cpp b/src/imaging/ossimGeoPolyCutter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeoPolyCutter.cpp
rename to src/imaging/ossimGeoPolyCutter.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeographicAnnotationGrid.cpp b/src/imaging/ossimGeographicAnnotationGrid.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeographicAnnotationGrid.cpp
rename to src/imaging/ossimGeographicAnnotationGrid.cpp
diff --git a/ossim/src/ossim/imaging/ossimGeomFileWriter.cpp b/src/imaging/ossimGeomFileWriter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGeomFileWriter.cpp
rename to src/imaging/ossimGeomFileWriter.cpp
diff --git a/src/imaging/ossimGpkgWriterInterface.cpp b/src/imaging/ossimGpkgWriterInterface.cpp
new file mode 100644
index 0000000..f3c60fe
--- /dev/null
+++ b/src/imaging/ossimGpkgWriterInterface.cpp
@@ -0,0 +1,22 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Interface for GeoPackage(gpkg) writers.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/imaging/ossimGpkgWriterInterface.h>
+
+//---
+// Explicit constructor.  Fix for undefine in sqlite plugin, windows vs14 debug
+// configuration.
+//---
+ossimGpkgWriterInterface::ossimGpkgWriterInterface()
+{
+}
diff --git a/ossim/src/ossim/imaging/ossimGridRemapEngine.cpp b/src/imaging/ossimGridRemapEngine.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGridRemapEngine.cpp
rename to src/imaging/ossimGridRemapEngine.cpp
diff --git a/src/imaging/ossimGridRemapEngineFactory.cpp b/src/imaging/ossimGridRemapEngineFactory.cpp
new file mode 100644
index 0000000..c725a8d
--- /dev/null
+++ b/src/imaging/ossimGridRemapEngineFactory.cpp
@@ -0,0 +1,44 @@
+//*****************************************************************************
+// FILE: ossimGridRemapEngineFactory.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class ossimGridRemapEngineFactory
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimGridRemapEngineFactory.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/imaging/ossimGridRemapEngineFactory.h>
+#include <ossim/imaging/ossimHsvGridRemapEngine.h>
+#include <ossim/imaging/ossimRgbGridRemapEngine.h>
+#include <ossim/imaging/ossimMonoGridRemapEngine.h>
+
+//*****************************************************************************
+//  STATIC METHOD: ossimGridRemapEngineFactory::create()
+//  
+//*****************************************************************************
+ossimGridRemapEngine* ossimGridRemapEngineFactory::create(const char* s)
+{
+   if (!s)
+      return 0;
+   
+   if (strcmp(s, "ossimHsvGridRemapEngine") == 0)
+      return new ossimHsvGridRemapEngine;
+
+   else  if (strcmp(s, "ossimRgbGridRemapEngine") == 0)
+      return new ossimRgbGridRemapEngine;
+
+   else  if (strcmp(s, "ossimMonoGridRemapEngine") == 0)
+      return new ossimMonoGridRemapEngine;
+
+   return 0;
+}
+
diff --git a/ossim/src/ossim/imaging/ossimGridRemapSource.cpp b/src/imaging/ossimGridRemapSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimGridRemapSource.cpp
rename to src/imaging/ossimGridRemapSource.cpp
diff --git a/src/imaging/ossimHistoMatchRemapper.cpp b/src/imaging/ossimHistoMatchRemapper.cpp
new file mode 100644
index 0000000..2a4448f
--- /dev/null
+++ b/src/imaging/ossimHistoMatchRemapper.cpp
@@ -0,0 +1,349 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimHistoMatchRemapper.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+#include <ossim/imaging/ossimHistoMatchRemapper.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+ossimHistoMatchRemapper::ossimHistoMatchRemapper()
+   : ossimImageSourceFilter()
+{
+   theBlankTile = NULL;
+}
+
+ossimHistoMatchRemapper::ossimHistoMatchRemapper(ossimImageSource* inputSource,
+                                                 const vector<double>& targetMeanPerBand,
+                                                 const vector<double>& targetSigmaPerBand,
+                                                 const vector<double>& inputMeanPerBand,
+                                                 const vector<double>& inputSigmaPerBand)
+   : ossimImageSourceFilter(inputSource),
+     theTargetMeanPerBand(targetMeanPerBand),
+     theTargetSigmaPerBand(targetSigmaPerBand),
+     theInputMeanPerBand(inputMeanPerBand),
+     theInputSigmaPerBand(inputSigmaPerBand)
+{
+   theBlankTile = NULL;
+}
+
+
+ossimHistoMatchRemapper::~ossimHistoMatchRemapper()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimHistoMatchRemapper::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> tile;
+   if(theInputConnection)
+   {
+      tile = theInputConnection->getTile(tileRect, resLevel);
+   }
+   if(!tile.valid())
+   {
+      return NULL;
+   }
+   if((tile.valid() &&
+       ((tile->getDataObjectStatus()==OSSIM_NULL) ||
+        (tile->getDataObjectStatus()==OSSIM_EMPTY))))
+      
+   {
+      return tile;
+   }
+
+   theBlankTile->setOrigin(tileRect.ul());
+   ossim_uint32 numberOfBands = (ossim_uint32)theInputMeanPerBand.size();
+
+   numberOfBands = numberOfBands>tile->getNumberOfBands()?tile->getNumberOfBands():numberOfBands;
+   double result = 0;
+   if(isSourceEnabled())
+   {
+      long offsetBound = (long)(tile->getWidth()*tile->getHeight());
+      if(tile->getScalarType() == OSSIM_UCHAR)
+      {
+         for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+         {
+            unsigned char* buf = static_cast<unsigned char*>(tile->getBuf(band));
+            for(long offset=0; offset < offsetBound;++offset)
+            {
+               // if the input has no deviation we will just
+               // do a shift to the target mean
+               if(fabs(theInputSigmaPerBand[band]) < FLT_EPSILON)
+               {
+                  result = transLean(buf[offset],
+                                     theInputMeanPerBand[band],
+                                     theTargetMeanPerBand[band],
+                                     0,
+                                     255);
+               }
+               else
+               {
+                  result = transLeanStretch(buf[offset],
+                                            theInputMeanPerBand[band],
+                                            theInputSigmaPerBand[band],
+                                            theTargetMeanPerBand[band],
+                                            theTargetSigmaPerBand[band],
+                                            0,
+                                            255);
+               }
+               result = ((result>255)?255:result);
+               result = ((result<0)?0:result);
+               
+               buf[offset] = (unsigned char)result;
+            }
+         }
+      }
+   }
+
+   return tile;
+}
+
+void ossimHistoMatchRemapper::initialize()
+{
+   if(!theInputConnection)
+   {
+      return;
+   }
+   theBlankTile = new ossimImageData(this,
+                                     theInputConnection->getOutputScalarType(),
+                                     theInputConnection->getNumberOfOutputBands());
+}
+
+const vector<double>& ossimHistoMatchRemapper::getInputMeanValues()const
+{
+   return theInputMeanPerBand;
+}
+
+const vector<double>& ossimHistoMatchRemapper::getInputSigmaValues()const
+{
+   return theInputSigmaPerBand;
+}
+
+const vector<double>& ossimHistoMatchRemapper::getTargetMeanValues()const
+{
+   return theTargetMeanPerBand;
+}
+
+const vector<double>& ossimHistoMatchRemapper::getTargetSigmaValues()const
+{
+   return theTargetSigmaPerBand;
+}
+
+void ossimHistoMatchRemapper::setInputMeanValues(const vector<double>& newValues)
+{
+   theInputMeanPerBand = newValues;
+}
+
+void ossimHistoMatchRemapper::setInputSigmaValues(const vector<double>& newValues)
+{
+   theInputSigmaPerBand = newValues;
+}
+
+void ossimHistoMatchRemapper::setTargetMeanValues(const vector<double>& newValues)
+{
+   theTargetMeanPerBand = newValues;
+}
+
+void ossimHistoMatchRemapper::setTargetSigmaValues(const vector<double>& newValues)
+{
+   theTargetSigmaPerBand = newValues;
+}
+
+double  ossimHistoMatchRemapper::transLean   // returns vOut
+(
+   double vIn         //!< input value to be transformed
+   , double vBias       //!< bias value to be removed
+   , double vTarget     //!< value that will replace bias
+   , double vMin        //!< minimum valid value of vIn (inclusive)
+   , double vMax        //!< maximum valid value of vIn (inclusive)
+)
+{
+   // max change
+   const double vDelta = vTarget - vBias;
+   double weight=0.0;
+   
+   // weight max change dependend on proximity to end points
+   if (vIn <= vBias)
+   {
+      weight = fabs((vIn - vMin) / (vBias - vMin));
+   }
+   else
+   {
+      weight = fabs((vMax - vIn) / (vMax - vBias));
+   }
+   return  (vIn + (vDelta * weight));
+};
+
+double  ossimHistoMatchRemapper::transLeanStretch   // returns vOut
+        (
+          double vIn              //!< input value to be transformed
+        , double vBias            //!< bias value to be removed
+        , double vBiasStretch     //!< dispersion (+/-) about vBias
+        , double vTarget          //!< value that will replace bias
+        , double vTargetStretch   //!< dispersion (+/-) about vTarget
+        , double vMin             //!< minimum valid value of vIn (inclusive)
+        , double vMax             //!< maximum valid value of vIn (inclusive)
+        )
+{
+
+        // line segment end points
+        const double x1 = vMin;
+        const double x2 = vBias - vBiasStretch;
+        const double x3 = vBias + vBiasStretch;
+        const double x4 = vMax;
+        const double y1 = 0.0;
+        const double y2 = (vTarget + vTargetStretch) - (vBias + vBiasStretch);
+        const double y3 = (vTarget - vTargetStretch) - (vBias - vBiasStretch);
+        const double y4 = 0.0;
+
+
+        // perform appropriate linear lookup operation based on input value
+        double vOut = vIn;
+        if (vIn <= x2)
+        {
+                vOut = (vIn - x1) * (y2-y1)/(x2-x1) + y1 + vIn;
+        }
+        else
+        if (vIn <= x3)
+        {
+                vOut = (vIn - x2) * (y3-y2)/(x3-x2) + y2 + vIn;
+        }
+        else
+        {
+                vOut = (vIn - x3) * (y4-y3)/(x4-x3) + y3 + vIn;
+        }
+        
+        return vOut;
+}
+
+bool ossimHistoMatchRemapper::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   theTargetMeanPerBand.clear();
+   theTargetSigmaPerBand.clear();
+   theInputMeanPerBand.clear();
+   theInputSigmaPerBand.clear();
+   ossim_uint32 result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "target_mean[0-9]");
+   ossim_uint32 numberOfMatches=0;
+   ossim_uint32 index=0;
+
+   // load target mean
+   while(numberOfMatches < result)
+   {
+      ossimString key = prefix;
+      key += ossimString("target_mean");
+      key += ossimString::toString(index);
+      const char* lookup = kwl.find(key.c_str());
+      if(lookup)
+      {
+         theTargetMeanPerBand.push_back(ossimString(lookup).toDouble());
+         ++numberOfMatches;
+      }
+      ++index;
+   }
+   numberOfMatches = 0;
+   index = 0;
+   result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "target_sigma[0-9]");
+   // load target sigma
+   while(numberOfMatches < result)
+   {
+      ossimString key = prefix;
+      key += ossimString("target_sigma");
+      key += ossimString::toString(index);
+      const char* lookup = kwl.find(key.c_str());
+      if(lookup)
+      {
+         theTargetSigmaPerBand.push_back(ossimString(lookup).toDouble());
+         ++numberOfMatches;
+      }
+      ++index;
+   }
+
+   numberOfMatches = 0;
+   index = 0;
+   result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "input_mean[0-9]");
+   // load input mean
+   while(numberOfMatches < result)
+   {
+      ossimString key = prefix;
+      key += ossimString("input_mean");
+      key += ossimString::toString(index);
+      const char* lookup = kwl.find(key.c_str());
+      if(lookup)
+      {
+         theInputMeanPerBand.push_back(ossimString(lookup).toDouble());
+         ++numberOfMatches;
+      }
+      ++index;
+   }
+   
+   numberOfMatches = 0;
+   index = 0;
+   result = kwl.getNumberOfSubstringKeys(ossimString(prefix) + "input_sigma[0-9]");
+   // load input sigma
+   while(numberOfMatches < result)
+   {
+      ossimString key = prefix;
+      key += ossimString("input_sigma");
+      key += ossimString::toString(index);
+      const char* lookup = kwl.find(key.c_str());
+      if(lookup)
+      {
+         theInputSigmaPerBand.push_back(ossimString(lookup).toDouble());
+         ++numberOfMatches;
+      }
+      ++index;
+   }
+   
+   return true;
+}
+
+bool ossimHistoMatchRemapper::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   ossim_uint32 index = 1;
+   for(index=1;index <= theTargetMeanPerBand.size();++index)
+   {
+      ossimString key = ossimString("target_mean") + ossimString::toString(index);
+      kwl.add(prefix,
+              key.c_str(),
+              theTargetMeanPerBand[index-1],
+              true);
+   }
+   for(index=1;index <= theTargetSigmaPerBand.size();++index)
+   {
+      ossimString key = ossimString("target_sigma") + ossimString::toString(index);
+      kwl.add(prefix,
+              key.c_str(),
+              theTargetSigmaPerBand[index-1],
+              true);
+   }
+   for(index=1;index <= theInputMeanPerBand.size();++index)
+   {
+      ossimString key = ossimString("input_mean") + ossimString::toString(index);
+      kwl.add(prefix,
+              key.c_str(),
+              theInputMeanPerBand[index-1],
+              true);
+   }
+   for(index=1;index <= theInputSigmaPerBand.size();++index)
+   {
+      ossimString key = ossimString("input_sigma") + ossimString::toString(index);
+      kwl.add(prefix,
+              key.c_str(),
+              theInputSigmaPerBand[index-1],
+              true);
+   }
+   return true;  
+}
+                       
diff --git a/src/imaging/ossimHistogramEqualization.cpp b/src/imaging/ossimHistogramEqualization.cpp
new file mode 100644
index 0000000..acea9b8
--- /dev/null
+++ b/src/imaging/ossimHistogramEqualization.cpp
@@ -0,0 +1,542 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHistogramEqualization.cpp 14110 2009-03-14 15:46:40Z dburken $
+#include <ossim/imaging/ossimHistogramEqualization.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeyword.h>
+
+RTTI_DEF1(ossimHistogramEqualization, "ossimHistogramEqualization", ossimImageSourceHistogramFilter)
+   
+static const ossimKeyword HISTOGRAM_INVERSE_FLAG_KW("inverse_flag",
+                                                    "specifies whether the inverse should be done for the getTile");
+
+static ossimTrace traceDebug("ossimHistogramEqualization:debug");
+
+ossimHistogramEqualization::ossimHistogramEqualization()
+   : ossimImageSourceHistogramFilter(),
+     theTile(NULL),
+     theAccumulationHistogram(NULL),
+     theInverseFlag(false)
+{
+}
+
+ossimHistogramEqualization::ossimHistogramEqualization(ossimImageSource* inputSource,
+                                                       ossimRefPtr<ossimMultiResLevelHistogram> histogram)
+   : ossimImageSourceHistogramFilter(inputSource, histogram),
+     theTile(0),
+     theAccumulationHistogram(0),
+     theInverseFlag(false)
+{
+   if(getHistogram().valid())
+   {
+      theAccumulationHistogram = getHistogram()->createAccumulationLessThanEqual();
+      initializeLuts();
+   }
+}
+
+ossimHistogramEqualization::ossimHistogramEqualization(ossimImageSource* inputSource,
+                                                       ossimRefPtr<ossimMultiResLevelHistogram> histogram,
+                                                       bool inverseFlag)
+   : ossimImageSourceHistogramFilter(inputSource, histogram),
+     theTile(NULL),
+     theAccumulationHistogram(0),
+     theInverseFlag(inverseFlag)
+{
+   if(getHistogram().valid())
+   {
+      theAccumulationHistogram = getHistogram()->createAccumulationLessThanEqual();
+      initializeLuts();
+   }
+}
+
+ossimHistogramEqualization::~ossimHistogramEqualization()
+{
+   deleteLuts();
+}
+
+ossimRefPtr<ossimImageData> ossimHistogramEqualization::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return NULL;
+   }
+   
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
+                                                                       resLevel);
+
+   if(!inputTile.valid()) return inputTile;
+   
+   if (!isSourceEnabled())
+   {
+      return inputTile;
+   }
+   
+   if(!theTile.valid())
+   {
+      allocate(); // First time through...
+   }
+   
+   // if (!theTile) throw exception!
+   
+   // Set the origin, resize if needed of the output tile.
+   theTile->setImageRectangleAndBands(inputTile->getImageRectangle(),
+				      inputTile->getNumberOfBands());
+   
+   if( !inputTile.valid() ||
+       inputTile->getDataObjectStatus() == OSSIM_NULL ||
+       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
+   {
+      return theTile;
+   }
+
+   if(!theAccumulationHistogram)
+   {
+      computeAccumulationHistogram();
+   }
+   if(theForwardLut.size() == 0 ||
+      theInverseLut.size() == 0)
+   {
+      initializeLuts();
+   }
+   if((theForwardLut.size() == 0) ||
+      (theInverseLut.size() == 0))
+   {
+      return inputTile;
+   }
+   
+   switch(inputTile->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         return runEqualizationAlgorithm(static_cast<ossim_uint8>(0),
+                                         inputTile);
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         return runEqualizationAlgorithm(static_cast<ossim_uint16>(0),
+                                         inputTile);
+      }
+      case OSSIM_SINT16:
+      {
+         return runEqualizationAlgorithm(static_cast<ossim_sint16>(0),
+                                         inputTile);
+      }
+      case OSSIM_UINT32:
+      {
+         return runEqualizationAlgorithm(static_cast<ossim_uint32>(0),
+                                         inputTile);
+      }
+      case OSSIM_SINT32:
+      {
+         return runEqualizationAlgorithm(static_cast<ossim_sint32>(0),
+                                         inputTile);
+      }
+      case OSSIM_FLOAT32:
+      {
+         return runEqualizationAlgorithm(static_cast<ossim_float32>(0),
+                                         inputTile);
+      }
+      case OSSIM_FLOAT64:
+      {
+         return runEqualizationAlgorithm(static_cast<ossim_float64>(0),
+                                         inputTile);
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramEqualization::getTile WARNING: Unsupported scalar type."
+            << endl;
+         break;
+      }
+   }
+   
+   return inputTile;
+}
+
+void ossimHistogramEqualization::setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram)
+{
+   ossimImageSourceHistogramFilter::setHistogram(histogram);
+   computeAccumulationHistogram();
+   initializeLuts();
+}
+
+bool ossimHistogramEqualization::saveState(ossimKeywordlist& kwl,
+                                           const char* prefix)const
+{
+   bool result = ossimImageSourceHistogramFilter::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           HISTOGRAM_INVERSE_FLAG_KW,
+           theInverseFlag,
+           true);
+   
+   return result;
+}
+
+bool ossimHistogramEqualization::loadState(const ossimKeywordlist& kwl,
+                                           const char* prefix)
+{
+   static const char MODULE[] = "ossimHistogramEqualization::loadState";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << " Entered..."
+         << "\nprefix:  " << prefix << endl;
+   }
+
+   const char* lookup = kwl.find(prefix,
+                                 HISTOGRAM_INVERSE_FLAG_KW);
+   if(lookup)
+   {
+      theInverseFlag = ossimString(lookup).toBool();
+   }
+   if(ossimImageSourceHistogramFilter::loadState(kwl, prefix))
+   {
+//      computeAccumulationHistogram();
+//      initializeLuts();
+   }
+   else
+   {
+      return false;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:" << MODULE;
+      this->print(ossimNotify(ossimNotifyLevel_DEBUG));
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\nExited..." << endl;
+   }
+   
+   return true;
+}
+
+void ossimHistogramEqualization::computeAccumulationHistogram()
+{
+   if(getHistogram().valid())
+   {
+      theAccumulationHistogram = getHistogram()->createAccumulationLessThanEqual();
+   }
+}
+
+template <class T>
+ossimRefPtr<ossimImageData> ossimHistogramEqualization::runEqualizationAlgorithm(T, ossimRefPtr<ossimImageData> tile)
+{
+   
+   if(!theAccumulationHistogram ||
+      !getHistogram())
+   {
+      return tile;
+   }
+
+   // for now we will always pull from res 0 information
+   ossimRefPtr<ossimMultiBandHistogram> histo = getHistogram()->getMultiBandHistogram(0);
+
+   if(histo.valid())
+   {
+      ossim_uint32 maxBands = ( (histo->getNumberOfBands() >
+                                 tile->getNumberOfBands())?
+                                tile->getNumberOfBands():
+                                histo->getNumberOfBands());
+      
+      long offsetUpperBound = tile->getHeight()*tile->getWidth();
+
+      for(ossim_uint32 band = 0; band < maxBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> bandHisto = histo->getHistogram(band);
+         T* buf = static_cast<T*>(tile->getBuf(band));
+         double *histoLut = band<theForwardLut.size()?theForwardLut[band]:NULL;
+         ossim_uint32 actualBand = theBandList[band];
+         if(bandHisto.valid())
+         {
+            if(buf&&histoLut&&(actualBand <  histo->getNumberOfBands()))
+            {
+               if(theInverseFlag)
+               {
+                  histoLut = theInverseLut[actualBand];
+               }
+               if(histoLut)
+               {
+                  if(tile->getDataObjectStatus() == OSSIM_FULL)
+                  {
+                     T minPix = (T)tile->getMinPix(actualBand);
+                     T maxPix = (T)tile->getMaxPix(actualBand);
+                     for(long offset = 0; offset < offsetUpperBound; ++offset)
+                     {
+                        ossim_int32 idx = bandHisto->GetIndex(buf[offset]);
+                           
+                        if(idx>=0)
+                        {
+                           T value = (T)(histoLut[idx]);
+
+                           //---
+                           // Assign clamping to min max.
+                           // 
+                           // ESH 03/2009 -- Clamping to within min-max fixed
+                           //--- 
+                           buf[offset] = value < minPix ? minPix :
+                              (value > maxPix ? maxPix : value);
+                        }
+                     }
+                  }
+                  else
+                  {
+                     T minPix  = (T)tile->getMinPix(actualBand);
+                     T maxPix  = (T)tile->getMaxPix(actualBand);
+                     T nullPix = (T)tile->getNullPix(actualBand);
+                     for(long offset = 0; offset < offsetUpperBound; ++offset)
+                     {
+                        ossim_int32 idx = bandHisto->GetIndex(buf[offset]);
+                        
+                        if((buf[offset]!=nullPix)&&(idx>=0))
+                        {
+                           T value = (T)(histoLut[idx]);
+
+                           //---
+                           // Assign clamping to min max.
+                           // 
+                           // ESH 03/2009 -- Clamping to within min-max fixed
+                           //--- 
+                           buf[offset] = value < minPix ? minPix :
+                              (value > maxPix ? maxPix : value);
+                        }
+                        else
+                        {
+                           buf[offset] = nullPix;
+                        }
+                     }
+                  }
+               }
+            }
+         }
+      }
+      
+      tile->validate();
+   }
+   
+   return tile;
+}
+
+void ossimHistogramEqualization::initialize()
+{
+   // Base class will recapture "theInputConnection".
+   ossimImageSourceHistogramFilter::initialize();
+   if(theTile.valid())
+   {
+      theTile = NULL;
+   }
+}
+
+void ossimHistogramEqualization::allocate()
+{
+   theBandList.clear();
+   
+   if(theTile.valid())
+   {
+      theTile = NULL;
+   }
+   
+   if(theInputConnection)
+   {
+      theInputConnection->getOutputBandList(theBandList);
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      if(theTile.valid())
+      {
+         theTile->initialize();
+      }
+   }
+}
+
+void ossimHistogramEqualization::initializeLuts()
+{
+   if(theForwardLut.size() != 0 ||
+      theInverseLut.size() != 0)
+   {
+      deleteLuts();
+   }
+   if(!theAccumulationHistogram||!getHistogram())
+   {
+      return;
+   }
+   ossimRefPtr<ossimMultiBandHistogram> accumHisto = theAccumulationHistogram->getMultiBandHistogram(0);
+   ossimRefPtr<ossimMultiBandHistogram> histogram  = getHistogram()->getMultiBandHistogram(0);
+   ossimKeywordlist kwl;
+   theAccumulationHistogram->saveState(kwl);
+
+   if(accumHisto.valid()&&histogram.valid())
+   {
+      long maxBands = accumHisto->getNumberOfBands();
+      
+      for(long band = 0; band < maxBands; ++band)
+      {
+         // first we grab pointers to the histogram and the accumulation
+         // histogram
+         ossimRefPtr<ossimHistogram> h  = accumHisto->getHistogram(band);
+         ossimRefPtr<ossimHistogram> h2 = histogram->getHistogram(band);
+
+         if(h.valid()&&h2.valid())
+         {
+            // lets get the number of indices.
+            ossim_uint32 numberOfIndices = (ossim_uint32)h2->GetRes();
+            vector<double> countForInverse(numberOfIndices);
+            
+            theForwardLut.push_back(new double[numberOfIndices]);
+            theInverseLut.push_back(new double[numberOfIndices]);
+            
+            // let's grab the counts array
+            const float* histoCounts = h->GetCounts();
+
+//         double maxIntensity      = h2->GetMaxVal();
+            double maxIntensity      = h2->GetRangeMax();
+            double maxCount          = h->GetMaxCount();
+            
+            // now pre compute the transforms
+            double *forwardLut = theForwardLut[band];
+            double *inverseLut = theInverseLut[band];
+            
+//         double minIntensity  = h2->GetMinVal();
+            double minIntensity  = h2->GetRangeMin();
+            double delta = maxIntensity-minIntensity;
+            ossim_uint32 idx = 0;
+            
+            // clear out the inverse
+            //
+            for(idx = 0; idx < numberOfIndices; ++ idx)
+            {
+               inverseLut[idx] = ossim::nan();
+            }
+            for(idx = 0; idx < numberOfIndices; ++ idx)
+            {
+               forwardLut[idx]   = minIntensity + (histoCounts[idx]/maxCount)*delta;
+               
+               ossim_int32 inverseIdx = h2->GetIndex(forwardLut[idx]);
+               if(inverseIdx >= 0)
+               {
+                  inverseLut[inverseIdx]   = minIntensity + delta*(idx/(ossim_float32)numberOfIndices);
+               }
+            }
+            
+            // now solve the inverse lut
+            //
+            ossim_uint32 idxStart = 0;
+            ossim_uint32 idxEnd = 0;
+            
+            while((ossim::isnan(inverseLut[idxEnd]))&&(idxEnd <numberOfIndices)){ ++idxEnd;}
+            if((idxStart!=idxEnd)&&(idxEnd<numberOfIndices))
+            {
+               std::fill(inverseLut,
+                         inverseLut+idxEnd,
+                         inverseLut[idxEnd]);
+            }
+            idxStart = numberOfIndices-1;
+            while((ossim::isnan(inverseLut[idxStart]))&&(idxStart > 0)){ --idxStart;}
+            if(idxStart !=0)
+            {
+               std::fill(inverseLut+idxStart,
+                         inverseLut+numberOfIndices,
+                         inverseLut[idxStart]);
+            }
+            
+            idxStart = 0;
+            idxEnd   = 0;
+            ossim_float32 valueStart = 0.0;
+            ossim_float32 valueEnd = 0.0;
+            
+            while(idxStart < numberOfIndices)
+            {
+               idxEnd = idxStart;
+               if(ossim::isnan(inverseLut[idxStart]))
+               {
+                  while(ossim::isnan(inverseLut[idxEnd])&&(idxEnd < (numberOfIndices-1))) ++idxEnd;
+                  double length = (idxEnd-idxStart)+1;
+                  valueEnd = inverseLut[idxEnd];
+                  double deltaVal = (valueEnd-valueStart);
+                  ossim_uint32 tempIdx = idxStart;
+                  ossim_float32 count = 1.0;
+                  double t = 0.0;
+                  while(tempIdx < idxEnd)
+                  {
+                     t = (count/length);
+                     t = t>1.0?1.0:t;
+                     inverseLut[tempIdx] = valueStart + deltaVal*t;
+                     ++count;
+                     ++tempIdx;
+                  }
+                  idxStart = idxEnd;
+                  valueStart = valueEnd;
+               }
+               else
+               {
+                  valueStart = inverseLut[idxStart];
+                  ++idxStart;
+               }
+            }
+         }
+      }
+   }
+}
+
+bool ossimHistogramEqualization::setHistogram(const ossimFilename& filename)
+{
+   return ossimImageSourceHistogramFilter::setHistogram(filename);
+}
+
+bool ossimHistogramEqualization::getInverseFlag()const
+{
+   return theInverseFlag;
+}
+
+void ossimHistogramEqualization::setInverseFlag(bool inverseFlag)
+{
+   theInverseFlag = inverseFlag;
+}
+
+void ossimHistogramEqualization::deleteLuts()
+{
+   long band = 0;
+   
+   for(band = 0; band < (long)theForwardLut.size(); ++band)
+   {
+      delete [] theForwardLut[band];
+   }
+   theForwardLut.clear();
+   
+   for(band = 0; band < (long)theInverseLut.size(); ++band)
+   {
+      delete [] theInverseLut[band];      
+   }
+   
+   theInverseLut.clear();
+}
+
+const ossimFilename& ossimImageSourceHistogramFilter::getHistogramFilename() const
+{
+   return theFilename;
+}
+
+std::ostream& ossimHistogramEqualization::print(std::ostream& out) const
+{
+   // Base class...
+   return ossimImageSourceHistogramFilter::print(out);
+}
diff --git a/ossim/src/ossim/imaging/ossimHistogramMatchFilter.cpp b/src/imaging/ossimHistogramMatchFilter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimHistogramMatchFilter.cpp
rename to src/imaging/ossimHistogramMatchFilter.cpp
diff --git a/src/imaging/ossimHistogramRemapper.cpp b/src/imaging/ossimHistogramRemapper.cpp
new file mode 100644
index 0000000..3fa8ef8
--- /dev/null
+++ b/src/imaging/ossimHistogramRemapper.cpp
@@ -0,0 +1,2307 @@
+//*******************************************************************
+// 
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Histogram remapper class declaration.  Derived from ossimTableRemapper.
+//
+// Remaps a tile based on mode and histogram clip points.
+//
+//*************************************************************************
+// $Id$
+
+#include <ossim/imaging/ossimHistogramRemapper.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimHistogramSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <cstdlib>
+#include <iomanip>
+
+RTTI_DEF1(ossimHistogramRemapper, "ossimHistogramRemapper", ossimTableRemapper)
+
+static ossimTrace traceDebug("ossimHistogramRemapper:debug");
+
+static const char* STRETCH_MODE[] = { "linear_one_piece",
+                                      "linear_1std_from_mean",
+                                      "linear_2std_from_mean",
+                                      "linear_3std_from_mean",
+                                      "linear_auto_min_max",
+                                      "linear_auto_percentile",
+                                      "stretch_unknown" };
+
+static const char NORMALIZED_LOW_CLIP_POINT_KW[] = "normalized_low_clip_point";
+static const char NORMALIZED_HIGH_CLIP_POINT_KW[]="normalized_high_clip_point";
+static const char MID_POINT_KW[] = "mid_point";
+static const char MIN_OUTPUT_VALUE_KW[] = "min_output_value";
+static const char MAX_OUTPUT_VALUE_KW[] = "max_output_value";
+static const char STRETCH_MODE_KW[] = "stretch_mode";
+static const char HISTOGRAM_FILENAME_KW[] = "histogram_filename";
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimHistogramRemapper.cpp 23182 2015-03-09 14:30:52Z okramer $";
+#endif
+
+ossimHistogramRemapper::ossimHistogramRemapper()
+   :
+   ossimTableRemapper(),  // base class
+   theStretchMode(ossimHistogramRemapper::LINEAR_ONE_PIECE),
+   theDirtyFlag(false),
+   theHistogram(0),
+   theNormalizedLowClipPoint(),
+   theNormalizedHighClipPoint(),
+   theMidPoint(),
+   theMinOutputValue(),
+   theMaxOutputValue(),
+   theBandList(),
+   theBypassFlag(true),
+   theResetBandIndicesFlag(false)
+{
+   setNumberOfInputs(2);
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimHistogramRemapper::ossimHistogramRemapper entered...\n";
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << "\n";
+#endif      
+   }
+}
+
+ossimHistogramRemapper::~ossimHistogramRemapper()
+{
+}
+
+void ossimHistogramRemapper::initialize()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimHistogramRemapper::initialize entered..." << endl;
+   }
+
+   theResetBandIndicesFlag = (dynamic_cast<const ossimHistogramSource*>(getInput(1))!=0);
+
+   //---
+   // Call the base class initialize.
+   // Note:  This will reset "theInputConnection" if it changed...
+   //---
+   ossimTableRemapper::initialize();
+   
+   // Check the band list to see if it's changes.
+   vector<ossim_uint32> bandList;
+   getOutputBandList(bandList);
+   ossim_uint32 idx = 0;
+   // bool emptyOutput = theBandList.empty();
+
+   if(theResetBandIndicesFlag)
+   {
+      for(idx = 0; idx < bandList.size();++idx)
+      {
+         bandList[idx] = idx;
+      }
+   }
+   if (theBandList.size() != 0 && bandList.size())
+   {
+      if (theBandList.size() != bandList.size())
+      {
+         // Somethings changed.  Set everthing back.
+         initializeClips();
+         setNullCount();
+         theTable.clear();
+         theDirtyFlag = true;
+      }
+      else
+      {
+         // Sizes same check the order.
+         for(ossim_uint32 band = 0; band < theBandList.size(); ++band)
+         {
+            if (theBandList[band] != bandList[band])
+            {
+               //initializeClips();
+               //setNullCount();
+               theDirtyFlag = true;
+               break;
+            }            
+         }
+      }
+   }
+   else
+   {
+      initializeMinMaxOutput();
+   }
+
+   // Update the band list with the latest.
+   theBandList = bandList;
+
+   verifyEnabled();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimHistogramRemapper::initialize exited..." << endl;
+   }
+}
+
+void ossimHistogramRemapper::reset()
+{
+   // We could delete theTable to free up memory???
+   setStretchMode(LINEAR_ONE_PIECE, false);
+   initializeClips();
+   verifyEnabled();
+}
+
+void ossimHistogramRemapper::setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histogram)
+{
+   theHistogram = histogram;
+   setNullCount();
+   
+   // Note: initializeClips before setNullCount since it relies on clips.
+   initializeClips();
+   theTable.clear();
+   theDirtyFlag = true;
+}
+
+bool ossimHistogramRemapper::openHistogram(const ossimFilename& histogram_file)
+{
+   ossimRefPtr<ossimMultiResLevelHistogram> h = new ossimMultiResLevelHistogram();
+   if (h->importHistogram(histogram_file))
+   {
+      setHistogram(h);
+      return true;
+   }
+   
+   // Import failed if here!
+   return false;
+}
+
+bool ossimHistogramRemapper::computeHistogram(const ossimIrect& roi)
+{
+   bool result = false;
+   if ( theInputConnection )
+   {
+      ossimRefPtr<ossimImageData> tile = theInputConnection->getTile(roi, 0);
+      if ( tile.valid() )
+      {
+         ossimDataObjectStatus tile_status = tile->getDataObjectStatus();
+         if ( (tile_status != OSSIM_NULL) && (tile_status != OSSIM_EMPTY) )
+         {
+            ossimRefPtr<ossimMultiBandHistogram> h = new ossimMultiBandHistogram;
+            h->create( theInputConnection );
+
+            tile->populateHistogram(h);
+
+            ossimRefPtr<ossimMultiResLevelHistogram> histo = new ossimMultiResLevelHistogram();
+
+            histo->addHistogram( h.get() );
+
+            setHistogram( histo );
+            result = true;
+         }
+      }
+   }
+   return result;
+}
+
+ossimRefPtr<ossimImageData> ossimHistogramRemapper::getTile(
+   const ossimIrect& tile_rect,
+   ossim_uint32 resLevel)
+{
+   
+#if 0 /* Please leave for debug. (drb) */
+   cout << "\ntheEnableFlag: " << theEnableFlag
+        << "\ntheBypassFlag: " << theBypassFlag
+        << "\ntheDirtyFlag:  " << theDirtyFlag
+        << endl;
+#endif
+   
+   if ( !theInputConnection )
+      return 0;
+
+   // Rebuild the table if dirty flag set:
+   if ( theDirtyFlag )
+      makeClean();
+
+   if ( !theEnableFlag || theBypassFlag )
+      return theInputConnection->getTile(tile_rect, resLevel);
+
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tile_rect, resLevel);
+   if(!inputTile.valid())
+      return 0;
+
+   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
+   if ( (tile_status == OSSIM_NULL) || (tile_status == OSSIM_EMPTY) )
+      return inputTile;
+
+   if (!theTile)
+      allocate(tile_rect);
+
+   theTile->setImageRectangle(tile_rect);
+   theTile->makeBlank();
+   switch (theOutputScalarType)
+   {
+   case OSSIM_UINT8:
+      applyLinearStretch(ossim_uint8(0), inputTile);
+      break;
+
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+      applyLinearStretch(ossim_uint16(0), inputTile);
+      break;
+
+   case OSSIM_SSHORT16:
+      applyLinearStretch(ossim_sint16(0), inputTile);
+      //remapFromNativeTable(ossim_sint16(0), inputTile);
+      break;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT:
+      applyLinearStretch(ossim_float32(0), inputTile);
+      //remapFromNativeTable(ossim_float32(0), inputTile);
+      break;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_DOUBLE:
+      applyLinearStretch(ossim_float64(0), inputTile);
+      //remapFromNativeTable(ossim_float64(0), inputTile);
+      break;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      // Shouldn't hit this.
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimHistogramRemapper::getTile"
+         << "\nOutput scalar type is OSSIM_SCALAR_UNKNOWN!\n";
+      }
+   } // End of "switch (theTableType)"
+
+   theTile->validate();
+   return theTile;
+}
+
+template <class T> void ossimHistogramRemapper::applyLinearStretch(
+   T /* dummy */,
+   ossimRefPtr<ossimImageData>& inputTile)
+{
+   const ossim_uint32 BANDS = inputTile->getNumberOfBands();
+
+   // Sanity check.
+   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::buildTable ERROR!"
+            << " Line:  " << __LINE__ << endl;
+      }
+      return;
+   }
+
+
+   
+//   T* table = reinterpret_cast<T*>(&theTable.front());
+//   ossim_uint32 index = 0;
+   
+   // Finally, build the table...
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      ossimRefPtr<ossimHistogram> h  = getHistogram(band);
+      T* bandPtr = static_cast<T*>(inputTile->getBuf(band));
+      T* outputPtr = static_cast<T*>(theTile->getBuf(band));
+      if (h.get()&&bandPtr&&outputPtr)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimHistogramRemapper::buildLinearTable DEBUG:"
+               << "\nband:  " << band
+               << "\nmean:  " << h->GetMean()
+               << "\nstddev:  " << h->GetStandardDev()
+               << endl;
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::buildTable ERROR!"
+            << " Line:  " << __LINE__ << endl;
+         }
+         return; 
+      }
+      //std::cout << "MIN OUTPUT ==== " << theMinOutputValue[band] << std::endl;
+      const T NULL_PIX = static_cast<T>(getNullPixelValue(band));
+      const T MIN_PIX  = static_cast<T>(theMinOutputValue[band]);
+      const T MAX_PIX  = static_cast<T>(theMaxOutputValue[band]);
+//std::cout <<"theMinOutputValue[band]: " << theMinOutputValue[band] << "\n";
+//std::cout <<"theMaxOutputValue[band]: " << theMaxOutputValue[band] << "\n";
+//std::cout <<"theNormalizedLowClipPoint[band]: " << theNormalizedLowClipPoint[band] << "\n";
+//std::cout <<"theNormalizedHighClipPoint[band]: " << theNormalizedHighClipPoint[band] << "\n";
+//std::cout <<"MIN_PIX: " << MIN_PIX << "\n";
+//std::cout <<"MAX_PIX: " << MAX_PIX << "\n";
+      ossim_float64 min_clip_value =
+         h->LowClipVal(theNormalizedLowClipPoint[band]);
+      ossim_float64 max_clip_value =
+         h->HighClipVal(1.0-theNormalizedHighClipPoint[band]);
+
+      if(theTableType == ossimTableRemapper::NATIVE)
+      {
+         min_clip_value = floor(min_clip_value);
+         max_clip_value = ceil(max_clip_value); 
+      }
+      //ossim_float64 gain = (MAX_PIX-MIN_PIX+1)/(max_clip_value-min_clip_value);
+      ossim_float64 gain = 1.0;
+
+      if(theTableType == ossimTableRemapper::NATIVE)
+      {
+         gain = (MAX_PIX-MIN_PIX+1)/(max_clip_value-min_clip_value);
+      }
+      else
+      {
+         gain = (MAX_PIX-MIN_PIX)/(max_clip_value-min_clip_value);         
+      }
+      const ossim_uint32 PPB   = inputTile->getSizePerBand(); // pixels per band
+
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < PPB;++idx)
+      {
+         if ( bandPtr[idx] != NULL_PIX )
+         {
+            ossim_float64 p = bandPtr[idx];
+            if (p < min_clip_value)
+            {
+               p = MIN_PIX;
+            }
+            else if (p > max_clip_value)
+            {
+               p = MAX_PIX;
+            }
+            else
+            {
+               p = ((p - min_clip_value) * gain) + MIN_PIX;// - 1.0;
+            }
+            // Final range check:
+            outputPtr[idx] =
+               static_cast<T>( p >= MIN_PIX ? ( p <= MAX_PIX ? p : MAX_PIX ) : MIN_PIX );
+         }
+         else
+         {
+            outputPtr[idx] = NULL_PIX;
+         }
+      }
+
+   } // End of band loop.
+
+}
+
+void ossimHistogramRemapper::setLowNormalizedClipPoint(const ossim_float64& clip)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      setLowNormalizedClipPoint(clip, band);
+   }
+}
+
+void ossimHistogramRemapper::makeClean()
+{
+   if (theEnableFlag && theDirtyFlag) // Enabled and dirty.
+   {
+      // Always rebuild table if dirty.
+      buildTable();
+      
+      // Check for internal bypass.
+      verifyEnabled();
+
+      // Always clear the dirty flag.
+      theDirtyFlag = false;
+   }
+}
+
+void ossimHistogramRemapper::setLowNormalizedClipPoint(const ossim_float64& clip,
+                                                  ossim_uint32 zero_based_band)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   
+   if (zero_based_band >= BANDS)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::setLowNormalizedClipPoint ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (BANDS-1) << endl;
+   }
+   
+   if (theNormalizedLowClipPoint.size() != BANDS)
+   {
+      initializeClips();
+   }
+   
+   if ( clip != theNormalizedLowClipPoint[zero_based_band] &&
+        clip < theNormalizedHighClipPoint[zero_based_band] )
+   {
+      theDirtyFlag = true;
+      theNormalizedLowClipPoint[zero_based_band] = clip;
+   }
+}
+
+void
+ossimHistogramRemapper::setHighNormalizedClipPoint(const ossim_float64& clip)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      setHighNormalizedClipPoint(clip, band);
+   }
+}
+
+void ossimHistogramRemapper::setHighNormalizedClipPoint(
+   const ossim_float64& clip, ossim_uint32 zero_based_band)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   
+   if (zero_based_band >= BANDS)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::setHighNormalizedClipPoint ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (BANDS-1) << endl;
+   }
+   
+   if (theNormalizedHighClipPoint.size() != BANDS)
+   {
+      initializeClips();
+   }
+   
+   if ( clip != theNormalizedHighClipPoint[zero_based_band] &&
+        clip > theNormalizedLowClipPoint[zero_based_band] )
+   {
+      theDirtyFlag = true;
+      theNormalizedHighClipPoint[zero_based_band] = clip;
+   }
+}
+
+void ossimHistogramRemapper::setLowClipPoint(const ossim_float64& clip)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      setLowClipPoint(clip, band);
+   }
+}
+
+void ossimHistogramRemapper::setLowClipPoint(const ossim_float64& clip,
+                                             ossim_uint32 zero_based_band)
+{
+   // allow the call to getHistogram to happen this way we can calculate a histogram if 
+   // a histosource is connected to this object
+   //
+   //   if (!theHistogram) return;
+   
+   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
+   if (h.valid())
+   {
+      ossim_float64 d = h->getLowFractionFromValue(clip);
+      if (ossim::isnan(d) == false)
+      {
+         setLowNormalizedClipPoint(d, zero_based_band);
+      }
+   }
+}
+
+void ossimHistogramRemapper::setHighClipPoint(const ossim_float64& clip)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      setHighClipPoint(clip, band);
+   }
+}
+
+void ossimHistogramRemapper::setHighClipPoint(const ossim_float64& clip,
+                                              ossim_uint32 zero_based_band)
+{
+   // allow the call to getHistogram to happen this way we can calculate a histogram if 
+   // a histosource is connected to this object
+   //
+   //   if (!theHistogram) return;
+   
+   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
+   if (h.valid())
+   {
+      ossim_float64 d = h->getHighFractionFromValue(clip);
+      if (ossim::isnan(d) == false)
+      {
+         d = 1.0-d;
+         setHighNormalizedClipPoint(d, zero_based_band);
+      }
+   }
+}
+
+void ossimHistogramRemapper::setMidPoint(const ossim_float64& value)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      setMidPoint(value, band);
+   }
+}
+
+void ossimHistogramRemapper::setMidPoint(const ossim_float64& value,
+                                         ossim_uint32 zero_based_band)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   
+   if (zero_based_band >= BANDS)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::setMidPoint ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (BANDS-1) << endl;
+   }
+   
+   if (theMidPoint.size() != BANDS)
+   {
+      initializeClips();
+   }
+   
+   if (theMidPoint[zero_based_band] != value)
+   {
+      theDirtyFlag = true;
+      theMidPoint[zero_based_band] = value;
+   }
+}
+
+void ossimHistogramRemapper::setMinOutputValue(const ossim_float64& value)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      setMinOutputValue(value, band);
+   }
+}
+
+void ossimHistogramRemapper::setMinOutputValue(const ossim_float64& value,
+                                               ossim_uint32 zero_based_band)
+{
+   if (theInputConnection)
+   {
+      const ossim_uint32 BANDS = getNumberOfInputBands();
+      
+      if (zero_based_band >= BANDS)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::setMinOutputValue ERROR:"
+            << "\nband " << zero_based_band << " is out of range!"
+            << "\nhighest band:  " << (BANDS-1) << endl;
+      }
+      
+      if (theMinOutputValue.size() != BANDS)
+      {
+         initializeClips();
+      }
+      
+      if ( value != theMinOutputValue[zero_based_band] &&
+           value >= theInputConnection->getMinPixelValue(zero_based_band) &&
+           value < theMaxOutputValue[zero_based_band] )
+      {
+         theDirtyFlag = true;
+         theMinOutputValue[zero_based_band] = value;
+      }
+   }
+}
+
+void ossimHistogramRemapper::setMaxOutputValue(const ossim_float64& value)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      setMaxOutputValue(value, band);
+   }
+}
+
+void ossimHistogramRemapper::setMaxOutputValue(const ossim_float64& value,
+                                               ossim_uint32 zero_based_band)
+{
+   if (theInputConnection)
+   {
+      const ossim_uint32 BANDS = getNumberOfInputBands();
+      
+      if (zero_based_band >= BANDS)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::setMidPoint ERROR:"
+            << "\nband " << zero_based_band << " is out of range!"
+            << "\nhighest band:  " << (BANDS-1) << endl;
+      }
+      
+      if (theMaxOutputValue.size() != BANDS)
+      {
+         initializeClips();
+      }
+      
+      if ( value != theMaxOutputValue[zero_based_band] &&
+           value <= theInputConnection->getMaxPixelValue(zero_based_band) &&
+           value >  theMinOutputValue[zero_based_band] )
+      {
+         theDirtyFlag = true;
+         theMaxOutputValue[zero_based_band] = value;
+      }
+   }
+}
+
+ossim_float64 ossimHistogramRemapper::getLowNormalizedClipPoint(ossim_uint32 zero_based_band) const
+{
+   if (theNormalizedLowClipPoint.size() == 0 ||
+       zero_based_band >= getNumberOfInputBands())
+   {
+      return ossim::nan();
+   }
+   
+   if (zero_based_band >= theNormalizedLowClipPoint.size())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::getLowNormalizedClipPoint ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (theNormalizedLowClipPoint.size()-1)
+         << endl;
+      return ossim::nan();
+   }
+   
+   return theNormalizedLowClipPoint[zero_based_band];
+}
+
+ossim_float64 ossimHistogramRemapper::getLowNormalizedClipPoint() const
+{
+   if (theNormalizedLowClipPoint.size() == 0)
+   {
+      return ossim::nan();
+   }
+   
+   ossim_float64 d = 0.0;
+   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedLowClipPoint.size();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      d += getLowNormalizedClipPoint(band);
+   }
+   
+   return (d / BANDS);
+}
+
+ossim_float64 ossimHistogramRemapper::getHighNormalizedClipPoint(ossim_uint32 zero_based_band) const
+{
+   if (theNormalizedHighClipPoint.size() == 0 ||
+       zero_based_band >= getNumberOfInputBands())
+   {
+      return ossim::nan();
+   }
+   
+   if (zero_based_band >= theNormalizedHighClipPoint.size())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::getHighNormalizedClipPoint ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (theNormalizedHighClipPoint.size()-1)
+         << endl;
+      return ossim::nan();
+   }
+   
+   return theNormalizedHighClipPoint[zero_based_band];
+}
+
+ossim_float64 ossimHistogramRemapper::getHighNormalizedClipPoint() const
+{
+   if (theNormalizedHighClipPoint.size() == 0)
+   {
+      return ossim::nan();
+   }
+   
+   ossim_float64 d = 0.0;
+   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedHighClipPoint.size();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      d += getHighNormalizedClipPoint(band);
+   }
+   
+   return (d / BANDS);
+}
+
+ossim_float64 ossimHistogramRemapper::getLowClipPoint(ossim_uint32 zero_based_band) const
+{
+   if(zero_based_band >= getNumberOfInputBands() ||
+      !theHistogram || zero_based_band >= theNormalizedLowClipPoint.size())
+   {
+      return ossim::nan();
+   }
+   
+   if (theNormalizedLowClipPoint[zero_based_band] == 0.0)
+   {
+      return getMinPixelValue(zero_based_band);
+   }   
+   
+   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
+   if (h.valid())
+   {
+      ossim_float64 d =
+         h->LowClipVal(theNormalizedLowClipPoint[zero_based_band]);
+      
+      return d;//floor(d);
+   }
+   
+   return ossim::nan();
+}
+
+ossim_float64 ossimHistogramRemapper::getLowClipPoint() const
+{
+   if (theNormalizedLowClipPoint.size() == 0 || !theHistogram)
+   {
+      return ossim::nan();
+   }
+   
+   ossim_float64 d = 0.0;
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      d += getLowClipPoint(band);
+   }
+   
+   return (d / BANDS);
+}
+
+ossim_float64 ossimHistogramRemapper::getHighClipPoint(ossim_uint32 zero_based_band) const
+{
+   if(zero_based_band >= getNumberOfInputBands() ||
+      !theHistogram || zero_based_band >= theNormalizedHighClipPoint.size())
+   {
+      return ossim::nan();
+   }
+   
+   if (theNormalizedHighClipPoint[zero_based_band] == 1.0)
+   {
+      return getMaxPixelValue(zero_based_band);
+   }
+   
+   ossimRefPtr<ossimHistogram> h = getHistogram(zero_based_band);
+   if (h.valid())
+   {
+      ossim_float64 d =
+         h->HighClipVal(1.0-theNormalizedHighClipPoint[zero_based_band]);
+      return (d);//ceil(d);
+   }
+   
+   return ossim::nan();
+}
+
+ossim_float64 ossimHistogramRemapper::getHighClipPoint() const
+{
+   if (theNormalizedHighClipPoint.size() == 0 || !theHistogram)
+   {
+      return ossim::nan();
+   }
+   
+   ossim_float64 d = 0.0;
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      d += getHighClipPoint(band);
+   }
+   
+   return (d / BANDS);
+}
+
+ossim_float64 ossimHistogramRemapper::getMidPoint(ossim_uint32 zero_based_band) const
+{
+   if (theMidPoint.size() == 0 ||
+       zero_based_band >= getNumberOfInputBands())
+   {
+      return ossim::nan();
+   }
+   
+   if (zero_based_band >= theMidPoint.size())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::getMidPoint ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (theMidPoint.size()-1)
+         << endl;
+      return ossim::nan();
+   }
+   
+   return theMidPoint[zero_based_band];
+}
+
+ossim_float64 ossimHistogramRemapper::getMidPoint() const
+{
+   if (theMidPoint.size() == 0)
+   {
+      return ossim::nan();
+   }
+   
+   ossim_float64 d = 0.0;
+   const ossim_uint32 BANDS = (ossim_uint32)theMidPoint.size();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      d += getMidPoint(band);
+   }
+   
+   return (d / BANDS);
+}
+
+ossim_float64 ossimHistogramRemapper::getMinOutputValue(ossim_uint32 zero_based_band) const
+{
+   if (theMinOutputValue.size() == 0 ||
+       zero_based_band >= getNumberOfInputBands())
+   {
+      return ossim::nan();
+   }
+   
+   if (zero_based_band >= theMinOutputValue.size())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::getMinOutputValue ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (theMinOutputValue.size()-1)
+         << endl;
+      return ossim::nan();
+   }
+   
+   return theMinOutputValue[zero_based_band];
+}
+
+ossim_float64 ossimHistogramRemapper::getMinOutputValue() const
+{
+   if (theMinOutputValue.size() == 0)
+   {
+      return ossim::nan();
+   }
+   
+   ossim_float64 d = 0.0;
+   const ossim_uint32 BANDS = (ossim_uint32)theMinOutputValue.size();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      d += getMinOutputValue(band);
+   }
+   
+   return (d / BANDS);
+}
+
+ossim_float64 ossimHistogramRemapper::getMaxOutputValue(ossim_uint32 zero_based_band) const
+{
+   if (theMaxOutputValue.size() == 0 ||
+       zero_based_band >= getNumberOfInputBands())
+   {
+      return ossim::nan();
+   }
+   
+   if (zero_based_band >= theMaxOutputValue.size())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHistogramRemapper::getMaxOutputValue ERROR:"
+         << "\nband " << zero_based_band << " is out of range!"
+         << "\nhighest band:  " << (theMaxOutputValue.size()-1)
+         << endl;
+      return ossim::nan();
+   }
+   
+   return theMaxOutputValue[zero_based_band];
+}
+
+ossim_float64 ossimHistogramRemapper::getMaxOutputValue() const
+{
+   if (theMaxOutputValue.size() == 0)
+   {
+      return ossim::nan();
+   }
+   
+   ossim_float64 d = 0.0;
+   const ossim_uint32 BANDS = (ossim_uint32)theMaxOutputValue.size();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      d += getMaxOutputValue(band);
+   }
+   
+   return (d / BANDS); 
+}
+
+bool ossimHistogramRemapper::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   static const char MODULE[] = "ossimHistogramRemapper::loadState";
+   if (traceDebug())
+   {
+      CLOG << " Entered..."
+           << "\nprefix:  " << prefix << endl;
+   }
+   // Load the base class states...
+   bool status = ossimTableRemapper::loadState(kwl, prefix);
+   if (status)
+   {
+      const char* lookup = 0;
+      ossimString keyword;
+      
+      lookup = kwl.find(prefix, HISTOGRAM_FILENAME_KW);
+      if (lookup)
+      {
+         if ( !openHistogram(ossimFilename(lookup)) )
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimHistogramRemapper::loadState ERROR!"
+               << "\nCould not open file:  " << lookup
+               << "\nReturning..." << endl;
+            return false;
+         }
+      }
+     
+      //---
+      // Get the band specific keywords.
+      // NOTES:
+      // -  This loadState assumes the all keywords will have the same number
+      //    of bands.
+      // -  The set methods cannot be used here as there may not be a connection
+      //    yet that they need.
+      //---
+      ossim_uint32 bands = 0;
+      lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
+      if (lookup)
+      {
+         bands = ossimString::toUInt32(lookup);
+      }
+      else  // For backwards compatibility.
+      {
+         // Use the low clip to find number of bands...
+         keyword = NORMALIZED_LOW_CLIP_POINT_KW;
+         bands = kwl.numberOf(prefix, keyword);
+      }
+      //if(!bands&&theHistogram.valid())
+     // {
+     //    bands = theHistogram->getNumberOfBands();
+     // }
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimHistogramRemapper::loadState DEBUG:"
+            << "\nBands:  " << bands
+            << endl;
+      }
+      if (bands)
+      {
+         // Start with fresh clips.
+         initializeClips(bands);
+        for (ossim_uint32 band = 0; band < bands; ++band)
+         {
+            // Get the low clip.
+            keyword = NORMALIZED_LOW_CLIP_POINT_KW;
+            keyword += ".";
+            keyword += ossimKeywordNames::BAND_KW;
+            keyword += ossimString::toString(band+1);
+            lookup = kwl.find(prefix, keyword);
+            if(lookup)
+            {
+               theNormalizedLowClipPoint[band] = atof(lookup);
+            }
+            
+            // Get the high clip.
+            keyword = NORMALIZED_HIGH_CLIP_POINT_KW;
+            keyword += ".";
+            keyword += ossimKeywordNames::BAND_KW;
+            keyword += ossimString::toString(band+1);
+            lookup = kwl.find(prefix, keyword);
+            if(lookup)
+            {
+               theNormalizedHighClipPoint[band] = atof(lookup);
+            }
+            
+            // Get the mid point.
+            keyword = MID_POINT_KW;
+            keyword += ".";
+            keyword += ossimKeywordNames::BAND_KW;
+            keyword += ossimString::toString(band+1);
+            lookup = kwl.find(prefix, keyword);
+            if(lookup)
+            {
+               theMidPoint[band] = atof(lookup);
+            }
+            
+            // Get the min output value.
+            keyword = MIN_OUTPUT_VALUE_KW;
+            keyword += ".";
+            keyword += ossimKeywordNames::BAND_KW;
+            keyword += ossimString::toString(band+1);
+            lookup = kwl.find(prefix, keyword);
+            if(lookup)
+            {
+               theMinOutputValue[band] = atof(lookup);
+            }
+            
+            // Get the max output value.
+            keyword = MAX_OUTPUT_VALUE_KW;
+            keyword += ".";
+            keyword += ossimKeywordNames::BAND_KW;
+            keyword += ossimString::toString(band+1);
+            lookup = kwl.find(prefix, keyword);
+            if(lookup)
+            {
+               theMaxOutputValue[band] = atof(lookup);
+            }      
+         }
+     }
+     
+      lookup = kwl.find(prefix, STRETCH_MODE_KW);
+      if (lookup)
+      {
+         ossimString s = lookup;
+         s.downcase();
+         if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_ONE_PIECE])
+         {
+            theStretchMode = ossimHistogramRemapper::LINEAR_ONE_PIECE;
+         }
+         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN])
+         {
+            theStretchMode = ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN;
+         }
+         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN])
+         {
+            theStretchMode = ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN;
+         }
+         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN])
+         {
+            theStretchMode = ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN;
+         }
+         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX])
+         {
+            theStretchMode = ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX;
+         }
+         else if (s == STRETCH_MODE[ossimHistogramRemapper::LINEAR_AUTO_PERCENTILE])
+         {
+            theStretchMode = ossimHistogramRemapper::LINEAR_AUTO_PERCENTILE;
+         }
+         else
+         {
+            theStretchMode = ossimHistogramRemapper::STRETCH_UNKNOWN;
+         }
+      }
+
+      // Always set the dirty flag.
+      theDirtyFlag = true;
+   }
+   verifyEnabled();
+
+   if (traceDebug())
+   {
+      CLOG << "ossimHistogramRemapper::loadState DEBUG:"
+           << *this
+           << "\nExited..." << endl;
+   }
+   return status;
+}
+
+bool ossimHistogramRemapper::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix) const
+{
+   if (theHistogram.valid())
+   {
+      kwl.add(prefix,
+              HISTOGRAM_FILENAME_KW,
+              theHistogram->getHistogramFile().c_str(),
+              true);
+   }
+   kwl.add(prefix,
+           STRETCH_MODE_KW,
+           getStretchModeString().c_str(),
+           true);
+   
+   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedLowClipPoint.size();
+   
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_BANDS_KW,
+           BANDS,
+           true);
+   
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      ossimString keyword;
+      
+      // Save the low clip.
+      keyword = NORMALIZED_LOW_CLIP_POINT_KW;
+      keyword += ".";
+      keyword += ossimKeywordNames::BAND_KW;
+      keyword += ossimString::toString(band+1);
+      kwl.add(prefix,
+              keyword,
+              theNormalizedLowClipPoint[band],
+              true);
+      
+      // Save the high clip.
+      keyword = NORMALIZED_HIGH_CLIP_POINT_KW;
+      keyword += ".";
+      keyword += ossimKeywordNames::BAND_KW;
+      keyword += ossimString::toString(band+1);
+      kwl.add(prefix,
+              keyword,
+              theNormalizedHighClipPoint[band],
+              true);
+      
+      // Save the mid point.
+      keyword = MID_POINT_KW;
+      keyword += ".";
+      keyword += ossimKeywordNames::BAND_KW;
+      keyword += ossimString::toString(band+1);
+      kwl.add(prefix,
+              keyword,
+              theMidPoint[band],
+              true);
+      
+      // Save the min output value.
+
+      keyword = MIN_OUTPUT_VALUE_KW;
+      keyword += ".";
+      keyword += ossimKeywordNames::BAND_KW;
+      keyword += ossimString::toString(band+1);
+      kwl.add(prefix,
+              keyword,
+              theMinOutputValue[band],
+              true);
+      
+      // Save the max output value.
+      keyword = MAX_OUTPUT_VALUE_KW;
+      keyword += ".";
+      keyword += ossimKeywordNames::BAND_KW;
+      keyword += ossimString::toString(band+1);
+
+      kwl.add(prefix,
+              keyword,
+              theMaxOutputValue[band],
+              true);
+   }
+
+   return ossimTableRemapper::saveState(kwl, prefix);
+}
+
+void ossimHistogramRemapper::setStretchMode(StretchMode mode,
+                                            bool rebuildTable)
+{
+   if (theStretchMode != mode)
+   {
+      theStretchMode = mode;
+
+      if (rebuildTable)
+      {
+         buildTable();
+
+         // Check for internal bypass.
+         verifyEnabled();
+
+         // Clear the dirty flag.
+         theDirtyFlag = false;
+      }
+      else
+      {
+         theDirtyFlag = true;
+      }
+   }
+}
+
+void ossimHistogramRemapper::setStretchModeAsString(const ossimString& mode,
+                                                    bool rebuildTable)
+{
+   if( mode == "linear_one_piece")
+   {
+      setStretchMode(LINEAR_ONE_PIECE, rebuildTable);
+   }
+   else if(mode == "linear_1std_from_mean")
+   {
+      setStretchMode(LINEAR_1STD_FROM_MEAN, rebuildTable);
+   }
+   else if(mode == "linear_2std_from_mean")
+   {
+      setStretchMode(LINEAR_2STD_FROM_MEAN, rebuildTable);
+   }
+   else if(mode == "linear_3std_from_mean")
+   {
+      setStretchMode(LINEAR_3STD_FROM_MEAN, rebuildTable);
+   }
+   else if(mode == "linear_auto_min_max")
+   {
+      setStretchMode(LINEAR_AUTO_MIN_MAX, rebuildTable);
+   }
+   else if(mode == "linear_auto_percentile")
+   {
+      setStretchMode(LINEAR_AUTO_PERCENTILE, rebuildTable);
+   }
+   else
+   {
+      setStretchMode(STRETCH_UNKNOWN, false);
+   }   
+}
+
+void ossimHistogramRemapper::buildTable()
+{
+   setupTable();
+   switch(theStretchMode)
+   {
+      case ossimHistogramRemapper::LINEAR_ONE_PIECE:
+      {
+         buildLinearTable();
+         break;
+      }
+      case ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX:
+      {
+         buildAutoLinearMinMaxTable();
+         break;
+      }
+      case ossimHistogramRemapper::LINEAR_AUTO_PERCENTILE:
+      {
+         buildAutoLinearPercentileTable();
+         break;
+      }
+      case ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN:
+      case ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN:
+      case ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN:
+         buildLinearTableStdFromMean();
+         break;
+         
+      default:
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimHistogramRemapper::buildTable ERROR!"
+               << "\nUnknown stretch type!" << endl;
+         }
+         break;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimHistogramRemapper::buildTable DEBUG:\n" << endl;
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+}
+
+void ossimHistogramRemapper::buildLinearTable()
+{
+   switch (getOutputScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         buildLinearTable(ossim_uint8(0));
+         break;
+      }
+         
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         buildLinearTable(ossim_uint16(0));
+         break;
+      }
+         
+      case OSSIM_SINT16:
+      {
+         buildLinearTable(ossim_sint16(0));
+         break;
+      }
+
+      case OSSIM_UINT32:
+      {
+         buildLinearTable(ossim_uint32(0));
+         break;
+      }
+         
+      case OSSIM_SINT32:
+      {
+         buildLinearTable(ossim_sint32(0));
+         break;
+      }
+         
+      case OSSIM_NORMALIZED_FLOAT:      
+      case OSSIM_FLOAT:
+      {
+         buildLinearTable(ossim_float32(0));
+         break;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_DOUBLE:
+      {
+         buildLinearTable(ossim_float64(0));
+         break;
+      }
+         
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+            // Shouldn't hit this.
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimHistogramRemapper::buildLinearTable OSSIM_SCALAR_UNKNOWN!" << endl;
+         }
+         break;
+      }
+         
+   } // End of "switch (theTableType)"
+}
+
+void ossimHistogramRemapper::buildAutoLinearMinMaxTable()
+{
+   switch (getOutputScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         buildAutoLinearMinMaxTableTemplate(ossim_uint8(0));
+         break;
+      }
+         
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         buildAutoLinearMinMaxTableTemplate(ossim_uint16(0));
+         break;
+      }
+         
+      case OSSIM_SINT16:
+      {
+         buildAutoLinearMinMaxTableTemplate(ossim_sint16(0));
+         break;
+      }
+         
+      case OSSIM_NORMALIZED_FLOAT:      
+      case OSSIM_FLOAT:
+      {
+         buildAutoLinearMinMaxTableTemplate(ossim_float32(0));
+         break;
+      }
+         
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_DOUBLE:
+      {
+         buildAutoLinearMinMaxTableTemplate(ossim_float64(0));
+         break;
+      }
+         
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+         // Shouldn't hit this.
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimTableRemapper::buildTable OSSIM_SCALAR_UNKNOWN!"
+               << endl;
+         }
+         break;
+      }
+         
+   } // End of "switch (theTableType)"
+}
+
+void ossimHistogramRemapper::buildAutoLinearPercentileTable()
+{
+   switch (getOutputScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         buildAutoLinearPercentileTableTemplate(ossim_uint8(0));
+         break;
+      }
+         
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         buildAutoLinearPercentileTableTemplate(ossim_uint16(0));
+         break;
+      }
+         
+      case OSSIM_SINT16:
+      {
+         buildAutoLinearPercentileTableTemplate(ossim_sint16(0));
+         break;
+      }
+         
+      case OSSIM_NORMALIZED_FLOAT:      
+      case OSSIM_FLOAT:
+      {
+         buildAutoLinearPercentileTableTemplate(ossim_float32(0));
+         break;
+      }
+         
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_DOUBLE:
+      {
+         buildAutoLinearPercentileTableTemplate(ossim_float64(0));
+         break;
+      }
+         
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+         // Shouldn't hit this.
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimHistogramRemapper::buildAutoLinearPercentileTableTemplate OSSIM_SCALAR_UNKNOWN!"
+               << endl;
+         }
+         break;
+      }
+         
+   } // End of "switch (theTableType)"
+}
+
+template <class T> void ossimHistogramRemapper::buildLinearTable(T /* dummy */)
+{
+   #if 1
+   // for now we are not using the lookup
+      theDirtyFlag = false;
+      return;
+#else
+
+   // This builds a native table.
+   //theTableType = ossimTableRemapper::NATIVE;
+   
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+
+   // Sanity check.
+   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::buildTable ERROR!"
+            << " Line:  " << __LINE__ << endl;
+      }
+      return;
+   }
+   
+   T* table = reinterpret_cast<T*>(&theTable.front());
+   ossim_uint32 index = 0;
+   
+   // Finally, build the table...
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      ossimRefPtr<ossimHistogram> h  = getHistogram(band);
+      if (h.get())
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimHistogramRemapper::buildLinearTable DEBUG:"
+               << "\nband:  " << band
+               << "\nmean:  " << h->GetMean()
+               << "\nstddev:  " << h->GetStandardDev()
+               << endl;
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::buildTable ERROR!"
+            << " Line:  " << __LINE__ << endl;
+         }
+         return; 
+      }
+      //std::cout << "MIN OUTPUT ==== " << theMinOutputValue[band] << std::endl;
+      const T NULL_PIX = static_cast<T>(getNullPixelValue(band));
+      const T MIN_PIX  = static_cast<T>(theMinOutputValue[band]);
+      const T MAX_PIX  = static_cast<T>(theMaxOutputValue[band]);
+      ossim_float64 min_clip_value =
+      h->LowClipVal(theNormalizedLowClipPoint[band]);
+      ossim_float64 max_clip_value =
+      h->HighClipVal(1.0-theNormalizedHighClipPoint[band]);
+      ossim_float64 gain = 1.0;
+      if(theTableType == ossimTableRemapper::NATIVE)
+      {
+         min_clip_value = floor(min_clip_value);
+         max_clip_value = ceil(max_clip_value);
+         gain = (MAX_PIX-MIN_PIX)/(max_clip_value-min_clip_value);
+        // gain = (MAX_PIX-MIN_PIX+1)/(max_clip_value-min_clip_value);
+
+      }
+      else
+      {
+         gain = ((MAX_PIX-MIN_PIX)+1)/(max_clip_value-min_clip_value);
+      }
+      
+      table[index] = NULL_PIX;
+      ++index;
+// std::cout  << "min_clip_value === " << min_clip_value << "\n";
+// std::cout  << "max_clip_value === " << max_clip_value << "\n";
+// std::cout  << "MIN_PIX === " << MIN_PIX << "\n";
+// std::cout  << "MAX_PIX === " << MAX_PIX << "\n";
+// std::cout  << "GAIN === " << gain << "\n";
+      for (ossim_uint32 pix = 1; pix < theTableBinCount; ++pix)
+      {
+         ossim_float64 p = pix;
+         if (p <= min_clip_value)
+         {
+            p = MIN_PIX;
+         }
+         else if (p >= max_clip_value)
+         {
+            p = MAX_PIX;
+         }
+         else
+         {
+            p = ((p - min_clip_value) * gain) + MIN_PIX - 1.0;
+         }
+
+         if(p == NULL_PIX)
+         {
+            p = MIN_PIX;
+         }
+         table[index] = static_cast<T>(p+0.5);
+         
+         ++index;
+      }
+   } // End of band loop.
+
+   // Clear the dirty flag so the table's not rebuilt on the next getTile.
+   theDirtyFlag = false;
+#endif
+}
+
+template <class T> void ossimHistogramRemapper::buildAutoLinearMinMaxTableTemplate(T /* dummy */)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+
+   // Sanity check.
+   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::buildAutoLinearMinMaxTableTemplate ERROR!"
+            << " Line:  " << __LINE__ << endl;
+      }
+      return;
+   }
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      ossimRefPtr<ossimHistogram> h  = getHistogram(band);
+      T nullPix = static_cast<T>(getNullPixelValue(band));
+      //h->fillInteriorEmptyBins();
+      // std::cout << "************************\n";
+
+      if(h.valid())
+      {
+
+         ossim_uint32 n     = h->GetRes();
+         ossim_float64 low  = h->GetIndex(h->GetMinVal());
+         ossim_float64 high = h->GetIndex(h->GetMaxVal());
+         double bias = .006;//.006;
+         if(n > 0)
+         {
+            double newCount       = 0.0;
+            double nextPercentage = 0.0;
+            double percentage = 0.0;
+            int idx = 0;
+            const float * counts = h->GetCounts();
+            double count   = h->ComputeArea();
+            for(idx = 0; idx < (ossim_int32)(n-1); ++idx)
+            {
+               bool hasValue = (counts[idx] > 0)&&(counts[idx+1]);
+               if(nullPix != idx)
+               {
+                  newCount += counts[idx];
+               }
+               percentage = newCount / count;
+               nextPercentage = (newCount + counts[idx+1]) / count;
+//               if (std::fabs(percentage - 0.006) <
+//                   std::fabs(nextPercentage - 0.006))
+               if (hasValue &&((std::fabs(percentage - bias) <
+                   std::fabs(nextPercentage - bias))))
+               {
+                  low = idx+1;
+                  break;
+               }
+               
+            }
+            newCount = 0.0;
+            for (idx = n-1; idx > 0; idx--)
+            {
+               bool hasValue = (counts[idx] > 0)&&(counts[idx-1]);
+               newCount += counts[idx];
+               percentage = newCount / count;
+               nextPercentage = (newCount + counts[idx-1]) / count;
+               if (hasValue && ((std::fabs(percentage - bias) <
+                   std::fabs(nextPercentage - bias))))
+               {
+                  high=idx-1;
+                  break;
+               }
+            }
+            if(low > high)
+            {
+               low = 0;
+               high = n - 1;
+            }
+
+            if(theTableType == ossimTableRemapper::NATIVE)
+            {
+               setLowClipPoint(low, band);
+               setHighClipPoint(high, band);
+            }
+            else
+            {
+               setLowClipPoint(h->GetMinValFromIndex(low), band);
+               setHighClipPoint(h->GetMaxValFromIndex(high), band);
+            }
+        }
+      }
+   }
+   
+   buildLinearTable();
+}
+
+void ossimHistogramRemapper::buildLinearTableStdFromMean()
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   
+   // Sanity check.
+   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::buildTable ERROR!"
+            << " Line:  " << __LINE__ << endl;
+      }
+      return;
+   }
+   
+   ossim_float64 multiplier = 1.0;
+   if (theStretchMode == LINEAR_2STD_FROM_MEAN)
+   {
+      multiplier =  2.0;
+   }
+   else if (theStretchMode == LINEAR_3STD_FROM_MEAN)
+   {
+      multiplier =  3.0;
+   }
+   
+   // Finally, build the table...
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      ossimRefPtr<ossimHistogram> h      = getHistogram(band);
+      ossim_float64 mean = 0.0;
+      ossim_float64 stdDev = 0.0;
+      if(h.valid())
+      {
+         mean     = h->GetMean();
+         stdDev   = h->GetStandardDev();
+      }
+      ossim_float64 lowClip  = mean - (stdDev * multiplier);
+      ossim_float64 highClip = mean + (stdDev * multiplier);
+      
+      // Clamp to min/max.
+      if (lowClip < theMinOutputValue[band])
+      {
+         lowClip = theMinOutputValue[band];
+      }
+      if (highClip > theMaxOutputValue[band])
+      {
+         highClip = theMaxOutputValue[band];
+      }
+      
+      setLowClipPoint(lowClip, band);
+      setMidPoint(mean, band);
+      setHighClipPoint(highClip, band);
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimHistogramRemapper::buildLinearStdFromMean DEBUG:"
+            << "\nband:       " << band
+            << "\nmean:       " << mean
+            << "\nstddev:     " << stdDev
+            << "\nlow clip:   " << lowClip
+            << "\nhigh clip:  " << highClip
+            << endl;
+      }
+   }
+   
+   buildLinearTable();
+}
+
+template <class T> void ossimHistogramRemapper::buildAutoLinearPercentileTableTemplate(T /* dummy */)
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+
+   // Sanity check.
+   if (theNormalizedLowClipPoint.size() != BANDS || !getHistogram(0).valid())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHistogramRemapper::buildAutoLinearMinMaxTableTemplate ERROR!"
+            << " Line:  " << __LINE__ << endl;
+      }
+      return;
+   }
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      ossimRefPtr<ossimHistogram> h  = getHistogram(band);
+      // T nullPix = static_cast<T>(getNullPixelValue(band));
+      // h->fillInteriorEmptyBins();
+      if(h.valid())
+      {
+         ossim_uint32 n     = h->GetRes();
+         ossim_float64 low  = h->GetIndex(h->LowClipVal(0.05));
+         ossim_float64 high = h->GetIndex(h->HighClipVal(0.05));
+         if(low > high)
+         {
+            low = 0;
+            high = n - 1;
+         }
+         if(low < 0) low = 0;
+         if(high < 0) high = n-1;
+
+         if(theTableType == ossimTableRemapper::NATIVE)
+         {
+            setLowClipPoint(low, band);
+            setHighClipPoint(high, band);
+         }
+         else
+         {
+            setLowClipPoint(h->GetValFromIndex(static_cast<ossim_uint32>(low)), band);
+            setHighClipPoint(h->GetValFromIndex(static_cast<ossim_uint32>(high)), band);
+         }
+      }
+   }
+   
+   buildLinearTable();
+}
+
+void ossimHistogramRemapper::initializeClips()
+{
+   initializeClips(getNumberOfInputBands());
+}
+
+void ossimHistogramRemapper::initializeClips(ossim_uint32 bands)
+{
+   //---
+   // NOTE: This method deoes not set theDirtyFlag by design.
+   //---
+   if (bands)
+   {
+      theNormalizedLowClipPoint.resize(bands);
+      theNormalizedHighClipPoint.resize(bands);
+      theMidPoint.resize(bands);
+      theMinOutputValue.resize(bands);
+      theMaxOutputValue.resize(bands);
+      
+      for (ossim_uint32 band = 0; band < bands; ++band)
+      {
+         theNormalizedLowClipPoint[band]  = 0.0;
+         theNormalizedHighClipPoint[band] = 1.0;
+         theMidPoint[band] = 0.0;
+         
+         switch(theOutputScalarType)
+         {
+            case OSSIM_FLOAT32:
+            case OSSIM_FLOAT64:
+            {
+               theMinOutputValue[band] = getMinPixelValue(band);
+               theMaxOutputValue[band] = getMaxPixelValue(band);
+               break;
+            }
+            case OSSIM_SCALAR_UNKNOWN:
+            {
+               theMinOutputValue[band] = 0.0;
+               theMaxOutputValue[band] = 0.0;
+            }
+            default:
+            {
+               theMinOutputValue[band] = ossim::defaultMin(theOutputScalarType);//getMinPixelValue(band);
+               theMaxOutputValue[band] = ossim::defaultMax(theOutputScalarType);//getMaxPixelValue(band);
+               break;
+            }
+         }
+      }
+   }
+}
+
+void ossimHistogramRemapper::initializeMinMaxOutput()
+{
+   ossim_uint32 nBands = getNumberOfInputBands();
+   theMinOutputValue.resize(nBands);
+   theMaxOutputValue.resize(nBands);
+   for (ossim_uint32 band = 0; band < nBands; ++band)
+   {
+         // Must have an output scalar type for getMin/Max call.
+         if (theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
+         {
+            theMinOutputValue[band] = ossim::defaultMin(theOutputScalarType);//getMinPixelValue(band);
+            theMaxOutputValue[band] = ossim::defaultMax(theOutputScalarType);//getMaxPixelValue(band);
+         }
+         else
+         {
+            theMinOutputValue[band] = 0.0;
+            theMaxOutputValue[band] = 0.0;
+         }
+  }
+
+}
+
+void ossimHistogramRemapper::setNullCount()
+{
+   // This will set the null bucket for all res zero bands to zero!
+   if (getHistogram(0).valid())
+   {
+      const ossim_uint32 BANDS = theHistogram->getNumberOfBands();
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         ossimRefPtr<ossimHistogram> h = theHistogram->getHistogram(band);
+         if (h.valid())
+         {
+            h->SetCount(0, 0);
+         }
+      }
+   }
+}
+
+ossimHistogramRemapper::StretchMode ossimHistogramRemapper::getStretchMode() const
+{
+   return theStretchMode;
+}
+
+ossimString ossimHistogramRemapper::getStretchModeString() const
+{
+   return ossimString(STRETCH_MODE[theStretchMode]);
+}
+
+ossim_uint32 ossimHistogramRemapper::getNumberOfStretchModes() const
+{
+   return ossimHistogramRemapper::STRETCH_UNKNOWN; // last index
+}
+
+ossimString
+ossimHistogramRemapper::getStretchModeString(ossim_uint32 index) const
+{
+   if (index < ossimHistogramRemapper::STRETCH_UNKNOWN)
+   {
+      return ossimString(STRETCH_MODE[index]);
+   }
+   
+   return ossimString(STRETCH_MODE[ossimHistogramRemapper::STRETCH_UNKNOWN]);
+   
+}
+
+ostream& ossimHistogramRemapper::print(ostream& os) const
+{
+   os << setiosflags(ios::fixed) << setprecision(15)
+      << "\nossimHistogramRemapper::print:"
+      << "\ntheStretchMode:         " << getStretchModeString().c_str()
+      << "\ntheDirtyFlag:           " << (theDirtyFlag?"true":"false")
+      << "\ntheBypassFlag:          " << (theBypassFlag?"true":"false")
+      
+      << "\ntheHistogram:           " << (theHistogram.valid()?"initialized":"null")
+      << "\ntheTableSizeInBytes:    " << theTable.size()
+      << endl;
+   
+   const ossim_uint32 BANDS = (ossim_uint32)theNormalizedLowClipPoint.size();
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      os << "\ntheNormalizedLowClipPoint[" << band << "]:   "
+         << theNormalizedLowClipPoint[band]
+         << "\ntheNormalizedHighClipPoint[" << band << "]:  "
+         << theNormalizedHighClipPoint[band]
+         << "\ntheMidPoint[" << band << "]:                 "
+         << theMidPoint[band]
+         << "\ntheMinOutputValue[" << band << "]:           "
+         << theMinOutputValue[band]
+         << "\ntheMaxOutputValue[" << band << "]:           "
+         << theMaxOutputValue[band]
+         << endl;
+   }
+   
+   for (ossim_uint32 i = 0; i < theBandList.size(); ++i)
+   {
+      os << "theBandList[" << i << "]:  " << theBandList[i] << endl;
+   }
+
+   // Note: To set table call ossimTableRemapper::print or turn trace on
+   // for "ossimTableRemapper:debug"
+   
+   return os;
+}
+
+void ossimHistogramRemapper::setupTable()
+{
+   const ossim_uint32 BANDS = getNumberOfInputBands();
+   
+   
+   ossim_uint32 values_per_band = 0;
+   ossim_uint32 bytes_per_pixel = 0;
+   
+   switch (theOutputScalarType)
+   {
+      case OSSIM_UINT8:
+         values_per_band = 256;  // 2 ^ 8
+         bytes_per_pixel = 1;
+         theTableType = ossimTableRemapper::NATIVE;
+         break;
+         
+      case OSSIM_USHORT11:
+         values_per_band = 2048; // 2 ^ 11
+         bytes_per_pixel = 2;
+         theTableType = ossimTableRemapper::NATIVE;
+         break;
+      case OSSIM_USHORT12:
+          values_per_band = 4096; // 2 ^ 12
+          bytes_per_pixel = 2;
+          theTableType = ossimTableRemapper::NATIVE;
+          break;
+      case OSSIM_USHORT13:
+          values_per_band = 8192; // 2 ^ 13
+          bytes_per_pixel = 2;
+          theTableType = ossimTableRemapper::NATIVE;
+          break;
+      case OSSIM_USHORT14:
+          values_per_band = 16384; // 2 ^ 14
+          bytes_per_pixel = 2;
+          theTableType = ossimTableRemapper::NATIVE;
+          break;
+      case OSSIM_USHORT15:
+          values_per_band = 32768; // 2 ^ 15
+          bytes_per_pixel = 2;
+          theTableType = ossimTableRemapper::NATIVE;
+          break;
+         
+      case OSSIM_UINT16:
+      case OSSIM_SINT16:
+         values_per_band = 65536; // 2 ^ 16
+         bytes_per_pixel = 2;
+         theTableType = ossimTableRemapper::NATIVE;
+         break;
+         
+      case OSSIM_UINT32:
+      case OSSIM_SINT32:
+         values_per_band = 65536; // 2 ^ 16
+         bytes_per_pixel = 4;
+         theTableType = ossimTableRemapper::MIN_MAX;
+         break;
+         
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         bytes_per_pixel = 4;
+         theTableType = ossimTableRemapper::NORMALIZED;
+         break;
+      }
+      case OSSIM_FLOAT:
+         bytes_per_pixel = 4;
+         values_per_band = 65536; // 2 ^ 16
+         theTableType = ossimTableRemapper::MIN_MAX;
+         break;
+         
+      case OSSIM_NORMALIZED_DOUBLE:  
+      {
+         bytes_per_pixel = 8;
+         values_per_band = 65536; // 2 ^ 16
+         theTableType = ossimTableRemapper::NORMALIZED;
+         break;         
+      }       
+      case OSSIM_DOUBLE:
+         bytes_per_pixel = 8;
+         values_per_band = 65536; // 2 ^ 16
+         theTableType = ossimTableRemapper::MIN_MAX;
+         break;
+         
+      default:
+         break;
+   }
+
+   if (theNormalizedLowClipPoint.size() == 0)
+   {
+      initializeClips(BANDS);
+   }
+
+   if ( theOutputScalarType == OSSIM_FLOAT ||
+        theOutputScalarType == OSSIM_DOUBLE ||
+        theOutputScalarType == OSSIM_NORMALIZED_FLOAT ||
+        theOutputScalarType == OSSIM_NORMALIZED_DOUBLE )
+   {
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         ossimRefPtr<ossimHistogram> h  = getHistogram(band);
+         
+         if (h.valid())
+         {
+            if (h->GetRes() > static_cast<ossim_int32>(values_per_band))
+            {
+               values_per_band = h->GetRes();
+            }
+         }
+      }
+   }      
+   
+   theTableBinCount  = values_per_band;
+   theTableBandCount = BANDS;
+
+   ossim_uint32 size_in_bytes = values_per_band * BANDS * bytes_per_pixel;
+   theTable.resize(size_in_bytes);
+
+   ossimImageSource* input = dynamic_cast<ossimImageSource*>(getInput());
+   double minPix = ossim::defaultMin(getOutputScalarType());
+   double maxPix = ossim::defaultMax(getOutputScalarType());
+   
+   if(input)
+   {
+      //---
+      // Last check for NaNs in key data members and set to some default if so.
+      // This could occur if someone stripped a keyword list down to a minimal
+      // set of keywords.
+      //---
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         minPix = input->getMinPixelValue(band);
+         maxPix = input->getMaxPixelValue(band);
+         if ( ossim::isnan(theMinOutputValue[band]) )
+         {
+            theMinOutputValue[band] = minPix;
+         }
+         if ( ossim::isnan(theMaxOutputValue[band]) )
+         {
+            theMaxOutputValue[band] = maxPix;
+         }
+      }   
+   }
+   else
+   {
+      //---
+      // Last check for NaNs in key data members and set to some default if so.
+      // This could occur if someone stripped a keyword list down to a minimal
+      // set of keywords.
+      //---
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         if ( ossim::isnan(theMinOutputValue[band]) )
+         {
+            theMinOutputValue[band] = minPix;
+         }
+         if ( ossim::isnan(theMaxOutputValue[band]) )
+         {
+            theMaxOutputValue[band] = maxPix;
+         }
+      }   
+   }
+}
+
+void ossimHistogramRemapper::verifyEnabled()
+{
+   //---
+   // Since this filter can be constructed with no input connection do not
+   // output and error, simply return.
+   //--- 
+   setBypassFlag(true);
+   //if (theInputConnection)
+   {
+
+#if 1     
+      // Start off bypassed.
+
+      if (theStretchMode != STRETCH_UNKNOWN)
+      {
+         if(theHistogram.valid())
+         {
+            setBypassFlag(false);
+         }
+/*         
+         const ossim_uint32 BANDS =
+            (ossim_uint32)theNormalizedLowClipPoint.size();
+         for (ossim_uint32 band = 0; band < BANDS; ++band)
+         {
+            //const double MIN = ossimTableRemapper::getMinPixelValue(band);
+            //const double MAX = ossimTableRemapper::getMaxPixelValue(band);
+            if ( theNormalizedLowClipPoint[band]  != 0.0   ||
+                 theNormalizedHighClipPoint[band] != 1.0 )
+                // theMinOutputValue[band] != MIN ||
+                 //theMaxOutputValue[band] != MAX )
+            {
+               // Need to turn filter on.
+               setBypassFlag(false);
+               break;
+            }
+         }
+         */
+      }
+#endif
+   }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimHistogramRemapper::verifyEnabled theBypassFlag: "
+         << (theBypassFlag ? "true" : "false") << endl;
+   }
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimHistogramRemapper::getHistogram()
+{
+   return ossimRefPtr<ossimMultiResLevelHistogram>(theHistogram.get());
+}
+
+ossimRefPtr<const ossimMultiResLevelHistogram> ossimHistogramRemapper::getHistogram()const
+{
+   return ossimRefPtr<const ossimMultiResLevelHistogram>(theHistogram.get());
+}
+
+ossimRefPtr<ossimHistogram>
+ossimHistogramRemapper::getHistogram(ossim_uint32 zero_based_band,
+                                     ossim_uint32 res_level) const
+{
+   ossim_uint32 histogram_band = getHistogramBand(zero_based_band);
+   
+   if(!theHistogram.valid())
+   {
+      const ossimHistogramSource* source = dynamic_cast<const ossimHistogramSource*>(getInput(1));
+      if(source)
+      {
+         theHistogram = const_cast<ossimHistogramSource*>(source)->getHistogram();
+      }      
+   }
+   
+   if (theHistogram.valid())
+   {
+      if (histogram_band < theHistogram->getNumberOfBands())
+      {
+         return theHistogram->getHistogram(histogram_band, res_level);
+      }
+   }
+   
+   return 0;
+}
+
+ossimFilename ossimHistogramRemapper::getHistogramFile() const
+{
+   if (theHistogram.valid())
+   {
+      return theHistogram->getHistogramFile();
+   }
+   
+   return ossimFilename::NIL;
+}
+
+ossim_uint32
+ossimHistogramRemapper::getHistogramBand(ossim_uint32 input_band) const
+{
+   if(theResetBandIndicesFlag) return input_band;
+   vector<ossim_uint32> bandList;
+   getOutputBandList(bandList);
+   
+   const ossim_uint32 BANDS = (ossim_uint32)bandList.size();
+   
+   if (BANDS == 0)
+   {
+      return 0;
+   }
+   
+   return bandList[input_band];
+}
+
+ossimString ossimHistogramRemapper::getLongName()const
+{
+   return ossimString("Histogram Remapper, filter with controls for histogram stretching.");
+}
+
+ossimString ossimHistogramRemapper::getShortName()const
+{
+   return ossimString("Histogram Remapper");
+}
+
+// Private to disallow use...
+ossimHistogramRemapper::ossimHistogramRemapper(const ossimHistogramRemapper&)
+{
+}
+
+// Private to disallow use...
+ossimHistogramRemapper& ossimHistogramRemapper::operator=(const ossimHistogramRemapper&)
+{
+   return *this;
+}
+
+void ossimHistogramRemapper::setBypassFlag(bool flag)
+{
+   if (theBypassFlag != flag)
+   {
+      //---
+      // If switching from bypassed to enabled set
+      // the dirty flag.  We don't care about going the other way.
+      //---
+      if ( theBypassFlag && !flag )
+      {
+         theDirtyFlag = true;
+      }
+      theBypassFlag = flag;
+   }
+}
+
+double ossimHistogramRemapper::getMinPixelValue(ossim_uint32 band)const
+{
+   double result = ossimTableRemapper::getMinPixelValue(band);
+   if(theEnableFlag&&!theBypassFlag &&(band < theMinOutputValue.size()))
+   {
+      result = theMinOutputValue[band];
+   }
+  // if(theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
+  // {
+  //    return ossim::defaultMin(theOutputScalarType);
+  // }
+
+   return result;
+}
+
+double ossimHistogramRemapper::getMaxPixelValue(ossim_uint32 band)const
+{
+   double result = ossimTableRemapper::getMaxPixelValue(band);
+
+   if(theEnableFlag&&!theBypassFlag &&(band < theMaxOutputValue.size()))
+   {
+      result = theMaxOutputValue[band];
+   }
+   //if(theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
+  // {
+  //    result = ossim::defaultMax(theOutputScalarType);
+  // }
+
+   return result;
+}
+
+bool ossimHistogramRemapper::canConnectMyInputTo(ossim_int32 inputIndex,
+                                                 const ossimConnectableObject* object)const
+{
+   // we will alloe the histogram source only to be connected to input slot 2 and
+   // the first slot will be reserved for the ossimImageSource.
+   //
+   bool result = false;
+   if(inputIndex == 0) result = dynamic_cast<const ossimImageSource*>(object)!=0;
+   if(inputIndex == 1) result = dynamic_cast<const ossimHistogramSource*>(object)!=0;
+   
+   return result;
+}
diff --git a/src/imaging/ossimHistogramThreshholdFilter.cpp b/src/imaging/ossimHistogramThreshholdFilter.cpp
new file mode 100644
index 0000000..b716f01
--- /dev/null
+++ b/src/imaging/ossimHistogramThreshholdFilter.cpp
@@ -0,0 +1,265 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHistogramThreshholdFilter.cpp 17195 2010-04-23 17:32:18Z dburken $
+#include <ossim/imaging/ossimHistogramThreshholdFilter.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeyword.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimErrorContext.h>
+
+static const ossimKeyword MIN_VALUE_PERCENT_KW("min_percent",
+                                               "min percentage clip");
+
+static const ossimKeyword MAX_VALUE_PERCENT_KW("max_percent",
+                                               "max percentage value");
+
+
+RTTI_DEF1(ossimHistogramThreshholdFilter, "ossimHistogramThreshholdFilter", ossimImageSourceHistogramFilter)
+   
+ossimHistogramThreshholdFilter::ossimHistogramThreshholdFilter()
+   : ossimImageSourceHistogramFilter(),
+     theMinValuePercent(0.0),
+     theMaxValuePercent(0.0)
+{
+}
+
+ossimHistogramThreshholdFilter::ossimHistogramThreshholdFilter(double minValuePercent,
+                                                               double maxValuePercent,
+                                                               ossimImageSource* inputSource,
+                                                               ossimMultiResLevelHistogram* histogram)
+   : ossimImageSourceHistogramFilter(inputSource, histogram),
+     theMinValuePercent(minValuePercent),
+     theMaxValuePercent(maxValuePercent)
+{
+}
+
+ossimHistogramThreshholdFilter::~ossimHistogramThreshholdFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimHistogramThreshholdFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection) return NULL;
+   
+   ossimRefPtr<ossimImageData> inputTile =
+      theInputConnection->getTile(tileRect, resLevel);
+
+   if(!isSourceEnabled())
+   {
+      return inputTile;
+   }
+   if(inputTile.valid()  &&
+      inputTile->getBuf() &&
+      (inputTile->getDataObjectStatus()!=OSSIM_EMPTY))
+   {
+      switch(inputTile->getScalarType())
+      {
+         case OSSIM_UCHAR:
+         {
+            return runThreshholdStretchAlgorithm((ossim_uint8)0,
+                                                 inputTile);
+         }
+         case OSSIM_USHORT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         {
+            return runThreshholdStretchAlgorithm((ossim_uint16)0,
+                                                 inputTile);
+         }
+         case OSSIM_SSHORT16:
+         {
+            return runThreshholdStretchAlgorithm(static_cast<ossim_sint16>(0),
+                                                 inputTile);
+         }
+         case OSSIM_DOUBLE:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            return runThreshholdStretchAlgorithm(static_cast<double>(0),
+                                                 inputTile);
+         }
+         case OSSIM_FLOAT:
+         case OSSIM_NORMALIZED_FLOAT:
+         {
+            return runThreshholdStretchAlgorithm(static_cast<float>(0),
+                                                 inputTile);
+         }
+         case OSSIM_SCALAR_UNKNOWN:
+         default:
+         {
+            ossimSetError("ossimHistogramThreshholdFilter",
+                          ossimErrorCodes::OSSIM_ERROR,
+                          "Unknown scalar type");
+            break;
+         }
+      }
+   }
+
+   return inputTile;
+}
+
+
+bool ossimHistogramThreshholdFilter::loadState(const ossimKeywordlist& kwl,
+                                           const char* prefix)
+{
+   if(ossimImageSourceHistogramFilter::loadState(kwl, prefix))
+   {
+      const char* minPercent = kwl.find(prefix, MIN_VALUE_PERCENT_KW);
+      const char* maxPercent = kwl.find(prefix, MAX_VALUE_PERCENT_KW);
+
+      if(minPercent)
+      {
+         theMinValuePercent = ossimString(minPercent).toDouble();
+      }
+      else
+      {
+         theMinValuePercent = 0.0;
+      }
+      if(maxPercent)
+      {
+         theMaxValuePercent = ossimString(maxPercent).toDouble();
+      }
+      else
+      {
+         theMaxValuePercent = 0.0;
+      }
+   }
+   else
+   {
+      return false;
+   }
+
+   return true;
+}
+
+bool ossimHistogramThreshholdFilter::saveState(ossimKeywordlist& kwl,
+                                           const char* prefix)const
+{
+   if(ossimImageSourceHistogramFilter::saveState(kwl, prefix))
+   {
+      kwl.add(prefix,
+              MIN_VALUE_PERCENT_KW,
+              theMinValuePercent,
+              true);
+      kwl.add(prefix,
+              MAX_VALUE_PERCENT_KW,
+              theMaxValuePercent,
+              true);
+   }
+   else
+   {
+      return false;
+   }
+
+   return true;
+}
+
+void ossimHistogramThreshholdFilter::initialize()
+{
+   ossimImageSourceHistogramFilter::initialize();
+}
+
+template <class T>
+ossimRefPtr<ossimImageData> ossimHistogramThreshholdFilter::runThreshholdStretchAlgorithm(
+   T /* dummyVariable */,
+   ossimRefPtr<ossimImageData>& tile)
+{
+   if(!getHistogram())
+   {
+      return tile;
+   }
+   
+   ossimRefPtr<ossimMultiBandHistogram> histo    = getHistogram()->getMultiBandHistogram(0);
+   if(histo.valid())
+   {
+      ossim_uint32 maxBands = ( (histo->getNumberOfBands() >
+                                 tile->getNumberOfBands())?
+                                tile->getNumberOfBands():
+                                histo->getNumberOfBands());
+      
+      long offsetUpperBound = tile->getHeight()*tile->getWidth();
+
+      for(ossim_uint32 band = 0; band < maxBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> h  = histo->getHistogram(band);
+         T* buf   = static_cast<T*>(tile->getBuf(band));
+         
+         if(h.valid()&&buf)
+         {
+            T np     = static_cast<T>(tile->getNullPix(band));
+            T minPix = static_cast<T>(tile->getMinPix(band));
+            T maxPix = static_cast<T>(tile->getMaxPix(band));
+            double range  = (maxPix - minPix);
+            double res = h->GetRes();
+            double maxClip = (h->HighClipVal(theMaxValuePercent/100.0)/res);
+            double minClip = (h->LowClipVal(theMinValuePercent/100.0)/res);
+            ossim_float64 normPix;
+            double delta   = fabs(maxClip - minClip);
+            if(delta > 0.0)
+            {
+               for(long offset = 0; offset < offsetUpperBound; ++offset)
+               {
+                  if(buf[offset] != np)
+                  {
+                     normPix = ((double)buf[offset]-minPix)/range;
+                     if(normPix <= minClip)
+                     {
+                        buf[offset] = minPix;
+                     }
+                     else if(normPix >= maxClip)
+                     {
+                        buf[offset] = maxPix;
+                     }
+                     else 
+                     {
+                        double t = (normPix - minClip)/delta;
+                        T value = static_cast<T>(minPix + range*t);
+                        buf[offset] = value;
+                     }
+                  }
+               }
+            }
+         }
+      }
+
+      tile->validate();
+   }
+   
+   return tile;
+}
+
+void ossimHistogramThreshholdFilter::setMinValuePercent(double minValue)
+{
+   theMinValuePercent = minValue;
+}
+
+void ossimHistogramThreshholdFilter::setMaxValuePercent(double maxValue)
+{
+   theMaxValuePercent = maxValue;
+}
+
+double ossimHistogramThreshholdFilter::getMinValuePercent()const
+{
+   return theMinValuePercent;
+}
+
+double ossimHistogramThreshholdFilter::getMaxValuePercent()const
+{
+   return theMaxValuePercent;
+}
diff --git a/src/imaging/ossimHistogramWriter.cpp b/src/imaging/ossimHistogramWriter.cpp
new file mode 100644
index 0000000..28e6490
--- /dev/null
+++ b/src/imaging/ossimHistogramWriter.cpp
@@ -0,0 +1,309 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHistogramWriter.cpp 20118 2011-10-05 13:50:55Z dburken $
+#include <ossim/base/ossimProcessListener.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceDebug("ossimHistogramWriter:debug");
+class ossimHistogramWriterProcessListener : public ossimProcessListener
+{
+public:
+   ossimHistogramWriterProcessListener(ossimConnectableObject* passon)
+      :thePassonTo(passon)
+      {
+      }
+   virtual void processProgressEvent(ossimProcessProgressEvent& event)
+      {
+         if(thePassonTo)
+         {
+            event.setObject(thePassonTo);
+            thePassonTo->fireEvent(event);
+         }
+      }
+
+   ossimConnectableObject* thePassonTo;  
+   
+};
+
+RTTI_DEF3(ossimHistogramWriter,
+          "ossimHistogramWriter",
+          ossimOutputSource,
+          ossimProcessInterface,
+          ossimConnectableObjectListener);
+
+ossimHistogramWriter::ossimHistogramWriter(ossimImageSource* inputSource,
+                                           ossimObject* owner)
+   : ossimOutputSource(owner,
+                       1,
+                       0,
+                       true,
+                       false),
+     theAreaOfInterest(),
+     theFilename(),
+     theFileStream(0),
+     theProcessListener(0),
+     theHistogramSource(0)
+{
+   theProcessListener = new ossimHistogramWriterProcessListener(this);
+   
+   theAreaOfInterest.makeNan();
+   connectMyInputTo(0, inputSource);
+}
+
+ossimHistogramWriter::~ossimHistogramWriter()
+{
+   if(isOpen())
+   {
+      close();
+   }
+   if(theProcessListener)
+   {
+      delete theProcessListener;
+      theProcessListener = 0;
+   }
+
+   // This does not need to be deleted here.  Simply stored for abort.
+   if (theHistogramSource)
+   {
+      theHistogramSource = 0;
+   }
+}
+
+void ossimHistogramWriter::setAreaOfInterest(const ossimIrect& rect)
+{
+   theAreaOfInterest = rect;
+}
+
+ossimObject* ossimHistogramWriter::getObject()
+{
+   return this;
+}
+
+bool ossimHistogramWriter::isOpen()const
+{
+   return (theFileStream != 0);
+}
+
+bool ossimHistogramWriter::open()
+{
+   if(isOpen())
+   {
+      close();
+   }
+   
+   theFileStream = new std::ofstream(theFilename.c_str());
+   
+   return theFileStream->good();
+}
+
+bool ossimHistogramWriter::open(const ossimFilename& filename)
+{
+   return ossimOutputSource::open(filename);
+}
+
+void ossimHistogramWriter::close()
+{
+   delete theFileStream;
+   theFileStream = 0;
+}
+
+void ossimHistogramWriter::setOutputName(const ossimString& outputName)
+{
+   ossimOutputSource::setOutputName(outputName);
+   setFilename(outputName);
+}
+
+void ossimHistogramWriter::setFilename(const ossimFilename& filename)
+{
+   theFilename = filename;
+}
+   
+bool ossimHistogramWriter::canConnectMyInputTo(
+   ossim_int32 inputIndex, const ossimConnectableObject* object)const
+{
+   return (object&&(inputIndex == 0)&& 
+           (PTR_CAST(ossimHistogramSource, object)||
+            PTR_CAST(ossimImageSource, object)));
+}
+
+const ossimObject* ossimHistogramWriter::getObject()const
+{
+   return this;
+}
+
+void ossimHistogramWriter::processProgressEvent(
+   ossimProcessProgressEvent& event)
+{
+   // we will raise the event if its coming from our
+   // input.  This means that we are connected to a
+   // ossimHistogramSource.
+   //
+   if(event.getObject() != this)
+   {
+      ossimProcessInterface::setCurrentMessage(event.getMessage());
+      setPercentComplete(event.getPercentComplete());
+   }
+}
+
+void ossimHistogramWriter::connectInputEvent(
+   ossimConnectionEvent& event)
+{
+   if(event.getObject() == this)
+   {
+      if(event.getOldObject())
+      {
+         event.getOldObject()->removeListener((ossimProcessListener*)this);
+      }
+      if(getInput(0)&&
+         PTR_CAST(ossimHistogramSource, getInput(0)))
+      {
+         getInput(0)->addListener( (ossimProcessListener*)this);
+      }
+   }
+}
+
+void ossimHistogramWriter::disconnectInputEvent(
+   ossimConnectionEvent& event)
+{
+   if(event.getOldObject()&&
+      PTR_CAST(ossimHistogramSource, getInput(0)))
+   {
+      event.getOldObject()->removeListener((ossimProcessListener*)this);
+   }
+}
+
+bool ossimHistogramWriter::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix)const
+{
+   bool result = ossimOutputSource::saveState(kwl, prefix);
+
+
+   return result;
+}
+
+bool ossimHistogramWriter::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   bool result = ossimOutputSource::loadState(kwl, prefix);
+
+   if(result)
+   {
+      if(!getNumberOfInputs())
+      {
+         setNumberOfInputs(1);
+      }
+   }
+
+   return result;
+}
+
+bool ossimHistogramWriter::execute()
+{
+   writeHistogram();
+   
+   return true;
+}
+
+void ossimHistogramWriter::writeHistogram()
+{
+   if(!getInput(0))
+   {
+      cerr << "ossimHistogramWriter::writeHistogram is not connected" << endl;
+      return;
+   }
+   ossimHistogramSource* histoSource = PTR_CAST(ossimHistogramSource, getInput(0));
+   bool deleteHistoSource = false;
+   if(!histoSource)
+   {
+      histoSource = new ossimImageHistogramSource;
+      histoSource->connectMyInputTo(0, getInput(0));
+      histoSource->enableSource();
+      deleteHistoSource = true;
+
+      //---
+      // Capture the pointer for abort call.  Note a ossimHistogramSource has
+      // no abort so the abort will only work through the
+      // ossimImageHistogramSource pointer.
+      //---
+      theHistogramSource = (ossimImageHistogramSource*)histoSource;
+   }
+
+   // Capture the pointer for abort call.
+   theHistogramSource = histoSource;
+   
+   histoSource->addListener( theProcessListener);
+   
+   ossimRefPtr<ossimMultiResLevelHistogram> histo = histoSource->getHistogram();
+
+   // Don't write histogram if abort flag was set...
+   if(histo.valid() && !isAborted() )
+   {
+      ossimKeywordlist kwl;
+      histo->saveState(kwl);
+      if(!isOpen())
+      {
+         open();
+         if(!isOpen())
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN) << "unable to open file " << theFilename << endl;
+            }
+         }
+      }
+      if( isOpen() )
+      {
+         kwl.writeToStream(*theFileStream);
+      }
+   }
+   histoSource->removeListener(theProcessListener);
+   
+   if(deleteHistoSource)
+   {
+      delete histoSource;
+      histoSource = 0;
+   }
+   theHistogramSource = 0;
+   
+   close();
+}
+
+void ossimHistogramWriter::abort()
+{
+   //---
+   // Call base abort. This sets the status to PROCESS_STATUS_ABORT_REQUEST so the processor
+   // knows to abort.
+   //---
+   ossimProcessInterface::abort();
+
+   // Propagate to histo source.
+   if (theHistogramSource)
+   {
+      ossimImageHistogramSource* histoSource =
+         PTR_CAST(ossimImageHistogramSource, theHistogramSource);
+      if (histoSource)
+      {
+         histoSource->abort();
+      }
+   }
+
+   //---
+   // Now set status to "ABORTED" so ossimProcessInterface::isAborted returns true so the
+   // writeHistogram method doesn't write the file if the process was aborted.
+   //---
+   setProcessStatus(PROCESS_STATUS_ABORTED);
+}
diff --git a/src/imaging/ossimHsiRemapper.cpp b/src/imaging/ossimHsiRemapper.cpp
new file mode 100644
index 0000000..eea773c
--- /dev/null
+++ b/src/imaging/ossimHsiRemapper.cpp
@@ -0,0 +1,3192 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Remapper to adjust hue, saturation and intensity.
+//
+//*************************************************************************
+// $Id: ossimHsiRemapper.cpp 19714 2011-06-03 17:23:45Z gpotts $
+
+#include <cstdlib>
+#include <ossim/imaging/ossimHsiRemapper.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNormRgbVector.h>
+#include <ossim/base/ossimHsiVector.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+RTTI_DEF1(ossimHsiRemapper, "ossimHsiRemapper", ossimImageSourceFilter)
+
+static ossimTrace traceDebug("ossimHsiRemapper:debug");
+
+//***
+// State keywords:
+//***
+static const char MASTER_HUE_OFFSET_KW[] = "hsi_master_hue_offset";
+static const char MASTER_SATURATION_OFFSET_KW[] = "hsi_master_saturation_offset";
+static const char MASTER_INTENSITY_OFFSET_KW[] = "hsi_master_intensity_offset";
+static const char MASTER_INTENSITY_LOW_CLIP_KW[] = "hsi_master_intensity_low_clip";
+static const char MASTER_INTENSITY_HIGH_CLIP_KW[] = "hsi_master_intensity_high_clip";
+
+static const char RED_HUE_OFFSET_KW[] = "hsi_red_hue_offset";
+static const char RED_HUE_LOW_RANGE_KW[] = "hsi_red_hue_low_range";
+static const char RED_HUE_HIGH_RANGE_KW[] = "hsi_red_hue_high_range";
+static const char RED_HUE_BLEND_RANGE_KW[] = "hsi_red_hue_blend_range";
+static const char RED_SATURATION_OFFSET_KW[] = "hsi_red_saturation_offset";
+static const char RED_INTENSITY_OFFSET_KW[] = "hsi_red_intensity_offset";
+
+static const char YELLOW_HUE_OFFSET_KW[] = "hsi_yellow_hue_offset";
+static const char YELLOW_HUE_LOW_RANGE_KW[] = "hsi_yellow_hue_low_range";
+static const char YELLOW_HUE_HIGH_RANGE_KW[] = "hsi_yellow_hue_high_range";
+static const char YELLOW_HUE_BLEND_RANGE_KW[] = "hsi_yellow_hue_blend_range";
+static const char YELLOW_SATURATION_OFFSET_KW[] = "hsi_yellow_saturation_offset";
+static const char YELLOW_INTENSITY_OFFSET_KW[] = "hsi_yellow_intensity_offset";
+
+static const char GREEN_HUE_OFFSET_KW[] = "hsi_green_hue_offset";
+static const char GREEN_HUE_LOW_RANGE_KW[] = "hsi_green_hue_low_range";
+static const char GREEN_HUE_HIGH_RANGE_KW[] = "hsi_green_hue_high_range";
+static const char GREEN_HUE_BLEND_RANGE_KW[] = "hsi_green_hue_blend_range";
+static const char GREEN_SATURATION_OFFSET_KW[] = "hsi_green_saturation_offset";
+static const char GREEN_INTENSITY_OFFSET_KW[] = "hsi_green_intensity_offset";
+
+static const char CYAN_HUE_OFFSET_KW[] = "hsi_cyan_hue_offset";
+static const char CYAN_HUE_LOW_RANGE_KW[] = "hsi_cyan_hue_low_range";
+static const char CYAN_HUE_HIGH_RANGE_KW[] = "hsi_cyan_hue_high_range";
+static const char CYAN_HUE_BLEND_RANGE_KW[] = "hsi_cyan_hue_blend_range";
+static const char CYAN_SATURATION_OFFSET_KW[] = "hsi_cyan_saturation_offset";
+static const char CYAN_INTENSITY_OFFSET_KW[] = "hsi_cyan_intensity_offset";
+
+static const char BLUE_HUE_OFFSET_KW[] = "hsi_blue_hue_offset";
+static const char BLUE_HUE_LOW_RANGE_KW[] = "hsi_blue_hue_low_range";
+static const char BLUE_HUE_HIGH_RANGE_KW[] = "hsi_blue_hue_high_range";
+static const char BLUE_HUE_BLEND_RANGE_KW[] = "hsi_blue_hue_blend_range";
+static const char BLUE_SATURATION_OFFSET_KW[] = "hsi_blue_saturation_offset";
+static const char BLUE_INTENSITY_OFFSET_KW[] = "hsi_blue_intensity_offset";
+
+static const char MAGENTA_HUE_OFFSET_KW[] = "hsi_magenta_hue_offset";
+static const char MAGENTA_HUE_LOW_RANGE_KW[] = "hsi_magenta_hue_low_range";
+static const char MAGENTA_HUE_HIGH_RANGE_KW[] = "hsi_magenta_hue_high_range";
+static const char MAGENTA_HUE_BLEND_RANGE_KW[] = "hsi_magenta_hue_blend_range";
+static const char MAGENTA_SATURATION_OFFSET_KW[] = "hsi_magenta_saturation_offset";
+static const char MAGENTA_INTENSITY_OFFSET_KW[] = "hsi_magenta_intensity_offset";
+
+static const char WHITE_OBJECT_CLIP_KW[] = "hsi_white_object_clip";
+
+static const double DEFAULT_BLEND = 15.0;
+static const double MAX_BLEND     = 30.0;
+
+ossimHsiRemapper::ossimHsiRemapper()
+   :
+      ossimImageSourceFilter      (),  // base class
+      
+      theTile                     (NULL),
+      theBuffer                   (NULL),
+      theNormalizedMinPix         (0.0),
+
+      theMasterHueOffset          (0.0),
+      theMasterSaturationOffset   (0.0),
+      theMasterIntensityOffset    (0.0),
+      theMasterIntensityLowClip   (0.0),
+      theMasterIntensityHighClip  (1.0),
+      
+      theRedHueOffset             (0.0),
+      theRedHueLowRange           (-30.0),
+      theRedHueHighRange          (30.0),
+      theRedHueBlendRange         (DEFAULT_BLEND),
+      theRedSaturationOffset      (0.0),
+      theRedIntensityOffset       (0.0),
+      
+      theYellowHueOffset          (0.0),
+      theYellowHueLowRange        (30.0),
+      theYellowHueHighRange       (90.0),
+      theYellowHueBlendRange      (DEFAULT_BLEND),
+      theYellowSaturationOffset   (0.0),
+      theYellowIntensityOffset    (0.0),
+      
+      theGreenHueOffset           (0.0),
+      theGreenHueLowRange         (90.0),
+      theGreenHueHighRange        (150.0),
+      theGreenHueBlendRange       (DEFAULT_BLEND),
+      theGreenSaturationOffset    (0.0),
+      theGreenIntensityOffset     (0.0),
+      
+      theCyanHueOffset            (0.0),
+      theCyanHueLowRange          (150.0),
+      theCyanHueHighRange         (210.0),
+      theCyanHueBlendRange        (DEFAULT_BLEND),
+      theCyanSaturationOffset     (0.0),
+      theCyanIntensityOffset      (0.0),
+      
+      theBlueHueOffset            (0.0),
+      theBlueHueLowRange          (210.0),
+      theBlueHueHighRange         (270.0),
+      theBlueHueBlendRange        (DEFAULT_BLEND),
+      theBlueSaturationOffset     (0.0),
+      theBlueIntensityOffset      (0.0),
+      
+      theMagentaHueOffset         (0.0),
+      theMagentaHueLowRange       (270.0),
+      theMagentaHueHighRange      (330.0),
+      theMagentaHueBlendRange     (DEFAULT_BLEND),
+      theMagentaSaturationOffset  (0.0),
+      theMagentaIntensityOffset   (0.0),
+
+      theWhiteObjectClip          (1.0)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   //disableSource();
+   theValidFlag = false;
+   // Construction not complete.
+}
+
+ossimHsiRemapper::~ossimHsiRemapper()
+{
+   theTile = NULL;
+   if (theBuffer)
+   {
+      delete [] theBuffer;
+      theBuffer = NULL;
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimHsiRemapper::getTile(
+   const ossimIrect& tile_rect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   // Fetch tile from pointer from the input source.
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(
+      tile_rect, resLevel);
+
+   // Check for remap bypass or a null tile return from input:
+   if (!isSourceEnabled() || !inputTile||!theValidFlag)
+   {
+      return inputTile;
+   }
+
+   // Check for first time through or size change.
+   if ( !theTile.valid() ||  
+        tile_rect.height() != theTile->getHeight() ||
+        tile_rect.width()  != theTile->getWidth() )
+   {
+      allocate(tile_rect);
+   }
+
+   //---
+   // Set the image rectangle of the tile.
+   // Note that this will resize the tiles buffers if 
+   theTile->setImageRectangle(tile_rect);
+
+   // Get its status.
+   ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
+   if ( (tile_status == OSSIM_NULL) || (tile_status == OSSIM_EMPTY) )
+   {
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   double* rgbBuf[3];
+   const ossim_uint32 PPT = theTile->getSizePerBand();  // Pixels Per Tile
+
+   rgbBuf[0] = theBuffer;
+   rgbBuf[1] = &(theBuffer[PPT]);
+   rgbBuf[2] = &(rgbBuf[1][PPT]);
+   
+   switch(inputTile->getNumberOfBands())
+   {
+      case 1:
+      case 2:
+      {
+         // Copy the first band only.
+         inputTile->copyTileBandToNormalizedBuffer(0, rgbBuf[0]);
+         memcpy(rgbBuf[1], rgbBuf[0], PPT*sizeof(double));
+         memcpy(rgbBuf[2], rgbBuf[0], PPT*sizeof(double));
+	 break;
+      }
+      case 3:
+      {
+         inputTile->copyTileToNormalizedBuffer(theBuffer);
+         break;
+      }
+      default:
+      {
+         inputTile->copyTileBandToNormalizedBuffer(0, rgbBuf[0]);
+         inputTile->copyTileBandToNormalizedBuffer(1, rgbBuf[1]);
+         inputTile->copyTileBandToNormalizedBuffer(2, rgbBuf[2]);
+	 break;
+      }
+   }   
+
+   ossimNormRgbVector rgb;
+   ossimHsiVector     hsi;
+   double r = 0.0;
+   double g = 0.0;
+   double b = 0.0;
+   double h = 0.0;
+   double s = 0.0;
+   double i = 0.0;
+   ossim_uint32 idx;
+   // Convert the rgb value to hsi and adjust values.
+   for (idx=0; idx<PPT; ++idx)
+   {
+      r = rgbBuf[0][idx];
+      g = rgbBuf[1][idx];
+      b = rgbBuf[2][idx];
+      
+      rgb = ossimNormRgbVector(r,g,b);
+      hsi = rgb;
+
+      h   = hsi.getH();
+      s   = hsi.getS();
+      i   = hsi.getI();
+      
+      if(i > FLT_EPSILON)
+      {
+         double h_offset = theMasterHueOffset;
+         double s_offset = theMasterSaturationOffset;
+         double i_offset = theMasterIntensityOffset;
+
+         //***
+         // Note:  For the purpose of checking to see if in the red range,
+         //        make the hue negative if it's >= 315.0 and < 360.0.
+         //        The red low and high ranges are stored in the same manner.
+         //***
+         double red_hue  = h;
+         if (red_hue  >= 315.0 && red_hue  < 360.0) red_hue  = red_hue - 360.0;
+                          
+         if ( red_hue >= theRedHueLowRange && red_hue <= theRedHueHighRange)
+         {
+            // Adjust the reds.
+            
+            double bf = 1.0; // blend factor
+            if ( red_hue < (theRedHueLowRange + theRedHueBlendRange) )
+            {
+               bf = (red_hue - theRedHueLowRange) / theRedHueBlendRange;
+            }
+            else if ( red_hue > (theRedHueHighRange - theRedHueBlendRange) )
+            {
+               bf = (theRedHueHighRange - red_hue) / theRedHueBlendRange;
+            }
+            
+            h_offset += (theRedHueOffset        * bf);
+            s_offset += (theRedSaturationOffset * bf);
+            i_offset += (theRedIntensityOffset  * bf);
+         }
+            
+         if (h >= theYellowHueLowRange && h <= theYellowHueHighRange) 
+         {
+            // Adjust the yellows.
+            
+            double bf = 1.0; // blend factor
+            if ( h < (theYellowHueLowRange + theYellowHueBlendRange) )
+            {
+               bf = (h - theYellowHueLowRange) / theYellowHueBlendRange;
+            }
+            else if ( h > (theYellowHueHighRange - theYellowHueBlendRange) )
+            {
+               bf = (theYellowHueHighRange - h) / theYellowHueBlendRange;
+            }
+            
+            h_offset += (theYellowHueOffset        * bf);
+            s_offset += (theYellowSaturationOffset * bf);
+            i_offset += (theYellowIntensityOffset  * bf);
+         }
+         
+         if (h >= theGreenHueLowRange && h <= theGreenHueHighRange) 
+         {
+            // Adjust the greens. 
+
+            double bf = 1.0; // blend factor
+            if ( h < (theGreenHueLowRange + theGreenHueBlendRange) )
+            {
+               bf = (h - theGreenHueLowRange) / theGreenHueBlendRange;
+            }
+            else if ( h > (theGreenHueHighRange - theGreenHueBlendRange) )
+            {
+               bf = (theGreenHueHighRange - h) / theGreenHueBlendRange;
+            }
+            
+            h_offset += (theGreenHueOffset        * bf);
+            s_offset += (theGreenSaturationOffset * bf);
+            i_offset += (theGreenIntensityOffset  * bf);
+         }
+
+         if (h >= theCyanHueLowRange && h <= theCyanHueHighRange) 
+         {
+            // Adjust the cyans.
+            
+            double bf = 1.0; // blend factor
+            if ( h < (theCyanHueLowRange + theCyanHueBlendRange) )
+            {
+               bf = (h - theCyanHueLowRange) / theCyanHueBlendRange;
+            }
+            else if ( h > (theCyanHueHighRange - theCyanHueBlendRange) )
+            {
+               bf = (theCyanHueHighRange - h) / theCyanHueBlendRange;
+            }
+            
+            h_offset += (theCyanHueOffset        * bf);
+            s_offset += (theCyanSaturationOffset * bf);
+            i_offset += (theCyanIntensityOffset  * bf);
+         }
+
+         if (h >= theBlueHueLowRange && h <= theBlueHueHighRange) 
+         {
+            // Adjust the blues.
+            
+            double bf = 1.0; // blend factor
+            if ( h < (theBlueHueLowRange + theBlueHueBlendRange) )
+            {
+               bf = (h - theBlueHueLowRange) / theBlueHueBlendRange;
+            }
+            else if ( h > (theBlueHueHighRange - theBlueHueBlendRange) )
+            {
+               bf = (theBlueHueHighRange - h) / theBlueHueBlendRange;
+            }
+            
+            h_offset += (theBlueHueOffset        * bf);
+            s_offset += (theBlueSaturationOffset * bf);
+            i_offset += (theBlueIntensityOffset  * bf);
+         }
+
+         if (h >= theMagentaHueLowRange && h <= theMagentaHueHighRange) 
+         {
+            // Adjust the magentas.
+            
+            double bf = 1.0; // blend factor
+            if ( h < (theMagentaHueLowRange + theMagentaHueBlendRange) )
+            {
+               bf = (h - theMagentaHueLowRange) / theMagentaHueBlendRange;
+            }
+            else if ( h > (theMagentaHueHighRange - theMagentaHueBlendRange) )
+            {
+               bf = (theMagentaHueHighRange - h) / theMagentaHueBlendRange;
+            }
+            
+            h_offset += (theMagentaHueOffset        * bf);
+            s_offset += (theMagentaSaturationOffset * bf);
+            i_offset += (theMagentaIntensityOffset  * bf);
+         }
+         
+         // Apply the hue offset.
+         h += h_offset;
+
+         // Make sure the hue is between 0 and 360...
+         if (h < 0.0) h += 360.0;
+         else if (h >= 360) h -= 360.0;
+
+         // Apply the saturation offset clamping/clipping to 0.0/1.0.
+         s += s_offset;
+         s = (s > 0.0 ? (s < 1.0 ? s : 1.0) : 0.0);
+         
+         // Apply the intensity offset clamping/clipping to 0.0/1.0.
+         i += i_offset;
+         i = (i > 0.0 ? (i < 1.0 ? i : 1.0) : 0.0);
+
+         // Stretch the intensity channel.
+//          i = (i - theMasterIntensityLowClip) *
+//              ( 1.0 / (theMasterIntensityHighClip -
+//                       theMasterIntensityLowClip) );
+         i = (i - theMasterIntensityLowClip)/(theMasterIntensityHighClip -
+                                              theMasterIntensityLowClip);
+         
+         hsi.setH(h);
+         hsi.setS(s);
+         hsi.setI(i);
+
+         rgb = hsi;
+         
+         r = rgb.getR();
+         g = rgb.getG();
+         b = rgb.getB();
+         if ( (theWhiteObjectClip < 1.0) &&
+              (r > theWhiteObjectClip)   &&
+              (g > theWhiteObjectClip)   &&
+              (b > theWhiteObjectClip) )
+         {
+            r = theWhiteObjectClip;
+            g = theWhiteObjectClip;
+            b = theWhiteObjectClip;
+         }
+         // Do min/max range check and assign back to buffer.
+         rgbBuf[0][idx] = r > theNormalizedMinPix ? (r < 1.0 ? r : 1.0) :
+            theNormalizedMinPix;
+         rgbBuf[1][idx] = g > theNormalizedMinPix ? (g < 1.0 ? g : 1.0) :
+            theNormalizedMinPix;
+         rgbBuf[2][idx] = b > theNormalizedMinPix ? (b < 1.0 ? b : 1.0) :
+            theNormalizedMinPix;
+      } // End of "if(i > FLT_EPSILON)"
+      else
+      {
+         rgbBuf[0][idx] = 0.0;
+         rgbBuf[1][idx] = 0.0;
+         rgbBuf[2][idx] = 0.0;
+      }
+         
+   }  // End of loop through pixels in a tile.
+   // Copy the buffer to the output tile.
+   theTile->copyNormalizedBufferToTile(theBuffer);
+   
+   // Update the tile status.
+   theTile->validate();
+
+   return theTile;
+}
+
+void ossimHsiRemapper::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   if (theTile.valid())
+   {
+      theTile = NULL;
+      if(theBuffer)
+      {
+         delete []theBuffer;
+         theBuffer = NULL;
+      }
+   }
+}
+
+void ossimHsiRemapper::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid()) return;
+   ossimString name = property->getName();
+   if(name == MASTER_HUE_OFFSET_KW)
+   {
+      setMasterHueOffset(property->valueToString().toDouble());
+   }
+   else if(name == MASTER_SATURATION_OFFSET_KW)
+   {
+      setMasterSaturationOffset(property->valueToString().toDouble());
+   }
+   else if(name == MASTER_INTENSITY_OFFSET_KW)
+   {
+      setMasterIntensityOffset(property->valueToString().toDouble());
+   }
+   else if(name == MASTER_INTENSITY_LOW_CLIP_KW)
+   {
+      setMasterIntensityLowClip(property->valueToString().toDouble());
+   }
+   else if(name == MASTER_INTENSITY_HIGH_CLIP_KW)
+   {
+      setMasterIntensityHighClip(property->valueToString().toDouble());
+   }
+   else if(name == RED_HUE_OFFSET_KW)
+   {
+      setRedHueOffset(property->valueToString().toDouble());
+   }
+   else if(name == RED_HUE_LOW_RANGE_KW)
+   {
+      setRedHueLowRange(property->valueToString().toDouble());
+   }
+   else if(name == RED_HUE_HIGH_RANGE_KW)
+   {
+      setRedHueHighRange(property->valueToString().toDouble());
+   }
+   else if(name == RED_HUE_BLEND_RANGE_KW)
+   {
+      setRedHueBlendRange(property->valueToString().toDouble());
+   }
+   else if(name == RED_SATURATION_OFFSET_KW)
+   {
+      setRedSaturationOffset(property->valueToString().toDouble());
+   }
+   else if(name == RED_INTENSITY_OFFSET_KW)
+   {
+      setRedIntensityOffset(property->valueToString().toDouble());
+  }
+   else if(name == YELLOW_HUE_OFFSET_KW)
+   {
+      setYellowHueOffset(property->valueToString().toDouble());
+   }
+   else if(name == YELLOW_HUE_LOW_RANGE_KW)
+   {
+      setYellowHueLowRange(property->valueToString().toDouble());
+   }
+   else if(name == YELLOW_HUE_HIGH_RANGE_KW)
+   {
+      setYellowHueHighRange(property->valueToString().toDouble());
+   }
+   else if(name == YELLOW_HUE_BLEND_RANGE_KW)
+   {
+      setYellowHueBlendRange(property->valueToString().toDouble());
+   }
+   else if(name == YELLOW_SATURATION_OFFSET_KW)
+   {
+      setYellowSaturationOffset(property->valueToString().toDouble());
+   }
+   else if(name == YELLOW_INTENSITY_OFFSET_KW)
+   {
+      setYellowIntensityOffset(property->valueToString().toDouble());
+   }
+   else if(name == GREEN_HUE_OFFSET_KW)
+   {
+      setGreenHueOffset(property->valueToString().toDouble());
+   }
+   else if(name == GREEN_HUE_LOW_RANGE_KW)
+   {
+      setGreenHueLowRange(property->valueToString().toDouble());
+   }
+   else if(name == GREEN_HUE_HIGH_RANGE_KW)
+   {
+      setGreenHueHighRange(property->valueToString().toDouble());
+   }
+   else if(name == GREEN_HUE_BLEND_RANGE_KW)
+   {
+      setGreenHueBlendRange(property->valueToString().toDouble());
+   }
+   else if(name == GREEN_SATURATION_OFFSET_KW)
+   {
+      setGreenSaturationOffset(property->valueToString().toDouble());
+   }
+   else if(name == GREEN_INTENSITY_OFFSET_KW)
+   {
+      setGreenIntensityOffset(property->valueToString().toDouble());
+   }
+   else if(name == CYAN_HUE_OFFSET_KW)
+   {
+      setCyanHueOffset(property->valueToString().toDouble());
+   }
+   else if(name == CYAN_HUE_LOW_RANGE_KW)
+   {
+      setCyanHueLowRange(property->valueToString().toDouble());
+   }
+   else if(name == CYAN_HUE_HIGH_RANGE_KW)
+   {
+      setCyanHueHighRange(property->valueToString().toDouble());
+   }
+   else if(name == CYAN_HUE_BLEND_RANGE_KW)
+   {
+      setCyanHueBlendRange(property->valueToString().toDouble());
+   }
+   else if(name == CYAN_SATURATION_OFFSET_KW)
+   {
+      setCyanSaturationOffset(property->valueToString().toDouble());
+   }
+   else if(name == CYAN_INTENSITY_OFFSET_KW)
+   {
+      setCyanIntensityOffset(property->valueToString().toDouble());
+   }
+   else if(name == BLUE_HUE_OFFSET_KW)
+   {
+      setBlueHueOffset(property->valueToString().toDouble());
+   }
+   else if(name == BLUE_HUE_LOW_RANGE_KW)
+   {
+      setBlueHueLowRange(property->valueToString().toDouble());
+   }
+   else if(name == BLUE_HUE_HIGH_RANGE_KW)
+   {
+      setBlueHueHighRange(property->valueToString().toDouble());
+   }
+   else if(name == BLUE_HUE_BLEND_RANGE_KW)
+   {
+      setBlueHueBlendRange(property->valueToString().toDouble());
+   }
+   else if(name == BLUE_SATURATION_OFFSET_KW)
+   {
+      setBlueSaturationOffset(property->valueToString().toDouble());
+   }
+   else if(name == BLUE_INTENSITY_OFFSET_KW)
+   {
+      setBlueIntensityOffset(property->valueToString().toDouble());
+   }
+   else if(name == MAGENTA_HUE_OFFSET_KW)
+   {
+      setMagentaHueOffset(property->valueToString().toDouble());
+   }
+   else if(name == MAGENTA_HUE_LOW_RANGE_KW)
+   {
+      setMagentaHueLowRange(property->valueToString().toDouble());
+   }
+   else if(name == MAGENTA_HUE_HIGH_RANGE_KW)
+   {
+      setMagentaHueHighRange(property->valueToString().toDouble());
+   }
+   else if(name == MAGENTA_HUE_BLEND_RANGE_KW)
+   {
+      setMagentaHueBlendRange(property->valueToString().toDouble());
+   }
+   else if(name == MAGENTA_SATURATION_OFFSET_KW)
+   {
+      setMagentaSaturationOffset(property->valueToString().toDouble());
+   }
+   else if(name == MAGENTA_INTENSITY_OFFSET_KW)
+   {
+      setMagentaIntensityOffset(property->valueToString().toDouble());
+   }
+   else if(name == WHITE_OBJECT_CLIP_KW)
+   {
+      setWhiteObjectClip(property->valueToString().toDouble());
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimHsiRemapper::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result;
+   if(name == MASTER_HUE_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMasterHueOffset), -180, 180);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MASTER_SATURATION_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMasterSaturationOffset), -1, 1);
+      result->setCacheRefreshBit();
+  }
+   else if(name == MASTER_INTENSITY_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMasterIntensityOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MASTER_INTENSITY_LOW_CLIP_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMasterIntensityLowClip), 0, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MASTER_INTENSITY_HIGH_CLIP_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMasterIntensityHighClip), 0, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == RED_HUE_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theRedHueOffset), -180, 180);
+      result->setCacheRefreshBit();
+   }
+   else if(name == RED_HUE_LOW_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theRedHueLowRange), -30, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == RED_HUE_HIGH_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theRedHueHighRange), -30, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == RED_HUE_BLEND_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theRedHueBlendRange), 0, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == RED_SATURATION_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theRedSaturationOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == RED_INTENSITY_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theRedIntensityOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == YELLOW_HUE_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueOffset), -180, 180);
+      result->setCacheRefreshBit();
+   }
+   else if(name == YELLOW_HUE_LOW_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueLowRange), 30, 90);
+      result->setCacheRefreshBit();
+   }
+   else if(name == YELLOW_HUE_HIGH_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueHighRange), 30, 90);
+      result->setCacheRefreshBit();
+   }
+   else if(name == YELLOW_HUE_BLEND_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theYellowHueBlendRange), 0, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == YELLOW_SATURATION_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theYellowSaturationOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == YELLOW_INTENSITY_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theYellowIntensityOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == GREEN_HUE_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueOffset), -180, 180);
+      result->setCacheRefreshBit();
+   }
+   else if(name == GREEN_HUE_LOW_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueLowRange), 90, 150);
+      result->setCacheRefreshBit();
+   }
+   else if(name == GREEN_HUE_HIGH_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueHighRange), 90, 150);
+      result->setCacheRefreshBit();
+   }
+   else if(name == GREEN_HUE_BLEND_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theGreenHueBlendRange), 0, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == GREEN_SATURATION_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theGreenSaturationOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == GREEN_INTENSITY_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theGreenIntensityOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == CYAN_HUE_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueOffset), -180, 180);
+      result->setCacheRefreshBit();
+   }
+   else if(name == CYAN_HUE_LOW_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueLowRange), 150, 210);
+      result->setCacheRefreshBit();
+   }
+   else if(name == CYAN_HUE_HIGH_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueHighRange), 150, 210);
+      result->setCacheRefreshBit();
+   }
+   else if(name == CYAN_HUE_BLEND_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theCyanHueBlendRange), 0, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == CYAN_SATURATION_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theCyanSaturationOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == CYAN_INTENSITY_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theCyanIntensityOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == BLUE_HUE_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueOffset), -180, 180);
+      result->setCacheRefreshBit();
+   }
+   else if(name == BLUE_HUE_LOW_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueLowRange), 210, 270);
+      result->setCacheRefreshBit();
+   }
+   else if(name == BLUE_HUE_HIGH_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueHighRange), 210, 270);
+      result->setCacheRefreshBit();
+   }
+   else if(name == BLUE_HUE_BLEND_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theBlueHueBlendRange), 0, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == BLUE_SATURATION_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theBlueSaturationOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == BLUE_INTENSITY_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theBlueIntensityOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MAGENTA_HUE_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueOffset), -180, 180);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MAGENTA_HUE_LOW_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueLowRange), 270, 330);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MAGENTA_HUE_HIGH_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueHighRange), 270, 330);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MAGENTA_HUE_BLEND_RANGE_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMagentaHueBlendRange), 0, 30);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MAGENTA_SATURATION_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMagentaSaturationOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == MAGENTA_INTENSITY_OFFSET_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theMagentaIntensityOffset), -1, 1);
+      result->setCacheRefreshBit();
+   }
+   else if(name == WHITE_OBJECT_CLIP_KW)
+   {
+      result = new ossimNumericProperty(name, ossimString::toString(theWhiteObjectClip), 0.8, 1.0);
+      result->setCacheRefreshBit();
+   }
+   else
+   {
+     result = ossimImageSourceFilter::getProperty(name);
+   }
+   
+   return result;
+}
+
+void ossimHsiRemapper::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back(MASTER_HUE_OFFSET_KW);
+   propertyNames.push_back(MASTER_SATURATION_OFFSET_KW);
+   propertyNames.push_back(MASTER_INTENSITY_OFFSET_KW);
+   propertyNames.push_back(MASTER_INTENSITY_LOW_CLIP_KW);
+   propertyNames.push_back(MASTER_INTENSITY_HIGH_CLIP_KW);
+   propertyNames.push_back(RED_HUE_OFFSET_KW);
+   propertyNames.push_back(RED_HUE_LOW_RANGE_KW);
+   propertyNames.push_back(RED_HUE_HIGH_RANGE_KW);
+   propertyNames.push_back(RED_HUE_BLEND_RANGE_KW);
+   propertyNames.push_back(RED_SATURATION_OFFSET_KW);
+   propertyNames.push_back(RED_INTENSITY_OFFSET_KW);
+   propertyNames.push_back(YELLOW_HUE_OFFSET_KW);
+   propertyNames.push_back(YELLOW_HUE_LOW_RANGE_KW);
+   propertyNames.push_back(YELLOW_HUE_HIGH_RANGE_KW);
+   propertyNames.push_back(YELLOW_HUE_BLEND_RANGE_KW);
+   propertyNames.push_back(YELLOW_SATURATION_OFFSET_KW);
+   propertyNames.push_back(YELLOW_INTENSITY_OFFSET_KW);
+   propertyNames.push_back(GREEN_HUE_OFFSET_KW);
+   propertyNames.push_back(GREEN_HUE_LOW_RANGE_KW);
+   propertyNames.push_back(GREEN_HUE_HIGH_RANGE_KW);
+   propertyNames.push_back(GREEN_HUE_BLEND_RANGE_KW);
+   propertyNames.push_back(GREEN_SATURATION_OFFSET_KW);
+   propertyNames.push_back(GREEN_INTENSITY_OFFSET_KW);
+   propertyNames.push_back(CYAN_HUE_OFFSET_KW);
+   propertyNames.push_back(CYAN_HUE_LOW_RANGE_KW);
+   propertyNames.push_back(CYAN_HUE_HIGH_RANGE_KW);
+   propertyNames.push_back(CYAN_HUE_BLEND_RANGE_KW);
+   propertyNames.push_back(CYAN_SATURATION_OFFSET_KW);
+   propertyNames.push_back(CYAN_INTENSITY_OFFSET_KW);
+   propertyNames.push_back(BLUE_HUE_OFFSET_KW);
+   propertyNames.push_back(BLUE_HUE_LOW_RANGE_KW);
+   propertyNames.push_back(BLUE_HUE_HIGH_RANGE_KW);
+   propertyNames.push_back(BLUE_HUE_BLEND_RANGE_KW);
+   propertyNames.push_back(BLUE_SATURATION_OFFSET_KW);
+   propertyNames.push_back(BLUE_INTENSITY_OFFSET_KW);
+   propertyNames.push_back(MAGENTA_HUE_OFFSET_KW);
+   propertyNames.push_back(MAGENTA_HUE_LOW_RANGE_KW);
+   propertyNames.push_back(MAGENTA_HUE_HIGH_RANGE_KW);
+   propertyNames.push_back(MAGENTA_HUE_BLEND_RANGE_KW);
+   propertyNames.push_back(MAGENTA_SATURATION_OFFSET_KW);
+   propertyNames.push_back(MAGENTA_INTENSITY_OFFSET_KW);
+   propertyNames.push_back(WHITE_OBJECT_CLIP_KW);
+}
+
+
+void ossimHsiRemapper::allocate(const ossimIrect& rect)
+{
+   
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,this);
+      theTile->initialize();
+
+      ossim_uint32 width  = rect.width();
+      ossim_uint32 height = rect.height();
+      if(theBuffer)
+      {
+         delete [] theBuffer;
+         theBuffer = 0;
+      }
+      ossim_uint32 size = width * height * 3; // Buffer always 3 bands.
+      theBuffer = new double[size];
+      memset(theBuffer, '\0', sizeof(double) * size);
+      
+      // Get the minimum normalized pixel value.
+      theNormalizedMinPix = calculateMinNormValue();
+   }
+}
+
+bool ossimHsiRemapper::loadState(const ossimKeywordlist& kwl,
+                                 const char* prefix)
+{
+   static const char MODULE[] = "ossimHsiRemapper::loadState()";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entering..." << endl;
+   }
+
+   // Make a prefix.
+   ossimString tmpPrefix;
+   if (prefix) tmpPrefix += prefix;
+   
+   const char* lookupReturn;
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_HUE_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setMasterHueOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_SATURATION_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setMasterSaturationOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setMasterIntensityOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_LOW_CLIP_KW);
+   if(lookupReturn)
+   {
+      setMasterIntensityLowClip(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MASTER_INTENSITY_HIGH_CLIP_KW);
+   if(lookupReturn)
+   {
+      setMasterIntensityHighClip(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setRedHueOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_LOW_RANGE_KW);
+   if(lookupReturn)
+   {
+      setRedHueLowRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_HIGH_RANGE_KW);
+   if(lookupReturn)
+   {
+      setRedHueHighRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_HUE_BLEND_RANGE_KW);
+   if(lookupReturn)
+   {
+      setRedHueBlendRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_SATURATION_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setRedSaturationOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), RED_INTENSITY_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setRedIntensityOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setYellowHueOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_LOW_RANGE_KW);
+   if(lookupReturn)
+   {
+      setYellowHueLowRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_HIGH_RANGE_KW);
+   if(lookupReturn)
+   {
+      setYellowHueHighRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_HUE_BLEND_RANGE_KW);
+   if(lookupReturn)
+   {
+      setYellowHueBlendRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_SATURATION_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setYellowSaturationOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), YELLOW_INTENSITY_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setYellowIntensityOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setGreenHueOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_LOW_RANGE_KW);
+   if(lookupReturn)
+   {
+      setGreenHueLowRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_HIGH_RANGE_KW);
+   if(lookupReturn)
+   {
+      setGreenHueHighRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_HUE_BLEND_RANGE_KW);
+   if(lookupReturn)
+   {
+      setGreenHueBlendRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_SATURATION_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setGreenSaturationOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), GREEN_INTENSITY_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setGreenIntensityOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setCyanHueOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_LOW_RANGE_KW);
+   if(lookupReturn)
+   {
+      setCyanHueLowRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_HIGH_RANGE_KW);
+   if(lookupReturn)
+   {
+      setCyanHueHighRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_HUE_BLEND_RANGE_KW);
+   if(lookupReturn)
+   {
+      setCyanHueBlendRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_SATURATION_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setCyanSaturationOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), CYAN_INTENSITY_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setCyanIntensityOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setBlueHueOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_LOW_RANGE_KW);
+   if(lookupReturn)
+   {
+      setBlueHueLowRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_HIGH_RANGE_KW);
+   if(lookupReturn)
+   {
+      setBlueHueHighRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_HUE_BLEND_RANGE_KW);
+   if(lookupReturn)
+   {
+      setBlueHueBlendRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_SATURATION_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setBlueSaturationOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), BLUE_INTENSITY_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setBlueIntensityOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setMagentaHueOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_LOW_RANGE_KW);
+   if(lookupReturn)
+   {
+      setMagentaHueLowRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_HIGH_RANGE_KW);
+   if(lookupReturn)
+   {
+      setMagentaHueHighRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_HUE_BLEND_RANGE_KW);
+   if(lookupReturn)
+   {
+      setMagentaHueBlendRange(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_SATURATION_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setMagentaSaturationOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), MAGENTA_INTENSITY_OFFSET_KW);
+   if(lookupReturn)
+   {
+      setMagentaIntensityOffset(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(tmpPrefix.c_str(), WHITE_OBJECT_CLIP_KW);
+   if(lookupReturn)
+   {
+      setWhiteObjectClip(atof(lookupReturn));
+   }
+
+   //***
+   // Initialize the base class.  Do this last so that the enable/disable
+   // doesn't get overridden by the "set*" methods.
+   //***
+   ossimImageSourceFilter::loadState(kwl, tmpPrefix.c_str());
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << ""
+         << *this
+         << "\nreturning..."
+         << endl;
+   }
+
+   return true;
+}
+
+bool ossimHsiRemapper::saveState(ossimKeywordlist& kwl,
+                                 const char* prefix) const
+{
+   static const char MODULE[] = "ossimHsiRemapper::saveStateTo()";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << "entering..." << endl;
+   }
+
+   // Call the base class getStateFrom.
+   ossimImageSourceFilter::saveState(kwl, prefix);
+
+   kwl.add(prefix, MASTER_HUE_OFFSET_KW, theMasterHueOffset);
+
+   kwl.add(prefix, MASTER_SATURATION_OFFSET_KW, theMasterSaturationOffset);
+
+   kwl.add(prefix, MASTER_INTENSITY_OFFSET_KW, theMasterIntensityOffset);
+
+   kwl.add(prefix, MASTER_INTENSITY_LOW_CLIP_KW, theMasterIntensityLowClip);
+
+   kwl.add(prefix, MASTER_INTENSITY_HIGH_CLIP_KW, theMasterIntensityHighClip);
+
+   kwl.add(prefix, RED_HUE_OFFSET_KW, theRedHueOffset);
+
+   kwl.add(prefix, RED_HUE_LOW_RANGE_KW, theRedHueLowRange);
+
+   kwl.add(prefix, RED_HUE_HIGH_RANGE_KW, theRedHueHighRange);
+
+   kwl.add(prefix, RED_HUE_BLEND_RANGE_KW, theRedHueBlendRange);
+
+   kwl.add(prefix, RED_SATURATION_OFFSET_KW, theRedSaturationOffset);
+           
+   kwl.add(prefix, RED_INTENSITY_OFFSET_KW, theRedIntensityOffset);
+
+   kwl.add(prefix, YELLOW_HUE_OFFSET_KW, theYellowHueOffset);
+
+   kwl.add(prefix, YELLOW_HUE_LOW_RANGE_KW, theYellowHueLowRange);
+
+   kwl.add(prefix, YELLOW_HUE_HIGH_RANGE_KW, theYellowHueHighRange);
+           
+   kwl.add(prefix, YELLOW_HUE_BLEND_RANGE_KW, theYellowHueBlendRange);
+
+   kwl.add(prefix, YELLOW_SATURATION_OFFSET_KW, theYellowSaturationOffset);
+
+   kwl.add(prefix, YELLOW_INTENSITY_OFFSET_KW, theYellowIntensityOffset);
+
+   kwl.add(prefix, GREEN_HUE_OFFSET_KW, theGreenHueOffset);
+
+   kwl.add(prefix, GREEN_HUE_LOW_RANGE_KW, theGreenHueLowRange);
+
+   kwl.add(prefix, GREEN_HUE_HIGH_RANGE_KW, theGreenHueHighRange);
+
+   kwl.add(prefix, GREEN_HUE_BLEND_RANGE_KW, theGreenHueBlendRange);
+           
+   kwl.add(prefix, GREEN_SATURATION_OFFSET_KW, theGreenSaturationOffset);
+           
+   kwl.add(prefix, GREEN_INTENSITY_OFFSET_KW, theGreenIntensityOffset);
+
+   kwl.add(prefix, CYAN_HUE_OFFSET_KW, theCyanHueOffset);
+
+   kwl.add(prefix, CYAN_HUE_LOW_RANGE_KW, theCyanHueLowRange);
+
+   kwl.add(prefix, CYAN_HUE_HIGH_RANGE_KW, theCyanHueHighRange);
+           
+   kwl.add(prefix, CYAN_HUE_BLEND_RANGE_KW, theCyanHueBlendRange);
+           
+   kwl.add(prefix, CYAN_SATURATION_OFFSET_KW, theCyanSaturationOffset);
+           
+   kwl.add(prefix, CYAN_INTENSITY_OFFSET_KW, theCyanIntensityOffset);
+
+   kwl.add(prefix, BLUE_HUE_OFFSET_KW, theBlueHueOffset);
+
+   kwl.add(prefix, BLUE_HUE_LOW_RANGE_KW, theBlueHueLowRange);
+
+   kwl.add(prefix, BLUE_HUE_HIGH_RANGE_KW, theBlueHueHighRange);
+
+   kwl.add(prefix, BLUE_HUE_BLEND_RANGE_KW, theBlueHueBlendRange);
+
+   kwl.add(prefix, BLUE_SATURATION_OFFSET_KW, theBlueSaturationOffset);
+           
+   kwl.add(prefix, BLUE_INTENSITY_OFFSET_KW, theBlueIntensityOffset);
+           
+   kwl.add(prefix, MAGENTA_HUE_OFFSET_KW, theMagentaHueOffset);
+           
+   kwl.add(prefix, MAGENTA_HUE_LOW_RANGE_KW, theMagentaHueLowRange);
+           
+   kwl.add(prefix, MAGENTA_HUE_HIGH_RANGE_KW, theMagentaHueHighRange);
+           
+   kwl.add(prefix, MAGENTA_HUE_BLEND_RANGE_KW, theMagentaHueBlendRange);
+           
+   kwl.add(prefix, MAGENTA_SATURATION_OFFSET_KW, theMagentaSaturationOffset);
+
+   kwl.add(prefix, MAGENTA_INTENSITY_OFFSET_KW, theMagentaIntensityOffset);
+
+   kwl.add(prefix, WHITE_OBJECT_CLIP_KW, theWhiteObjectClip);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "returning..." << endl;
+   }
+
+   return true;
+}
+
+void ossimHsiRemapper::resetGroup(int color_group)
+{
+   switch (color_group)
+   {
+      case RED:
+         resetRed();
+         break;
+      case YELLOW:
+         resetYellow();
+         break;
+      case GREEN:
+         resetGreen();
+         break;
+      case CYAN:
+         resetCyan();
+         break;
+      case BLUE:
+         resetBlue();
+         break;
+      case MAGENTA:
+         resetMagenta();
+         break;
+      case ALL:
+         resetMaster();
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::setSaturationOffset NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::resetAll()
+{
+   theMasterHueOffset          = 0.0;
+   theMasterSaturationOffset   = 0.0;
+   theMasterIntensityOffset    = 0.0;
+   theMasterIntensityLowClip   = 0.0;
+   theMasterIntensityHighClip  = 1.0;
+   
+   theRedHueOffset             = 0.0;
+   theRedHueLowRange           = -30.0;
+   theRedHueHighRange          = 30.0;
+   theRedHueBlendRange         = DEFAULT_BLEND;
+   theRedSaturationOffset      = 0.0;
+   theRedIntensityOffset       = 0.0;
+   
+   theYellowHueOffset          = 0.0;
+   theYellowHueLowRange        = 30.0;
+   theYellowHueHighRange       = 90.0;
+   theYellowHueBlendRange      = DEFAULT_BLEND;
+   theYellowSaturationOffset   = 0.0;
+   theYellowIntensityOffset    = 0.0;
+   
+   theGreenHueOffset           = 0.0;
+   theGreenHueLowRange         = 90.0;
+   theGreenHueHighRange        = 150.0;
+   theGreenHueBlendRange       = DEFAULT_BLEND;
+   theGreenSaturationOffset    = 0.0;
+   theGreenIntensityOffset     = 0.0;
+   
+   theCyanHueOffset            = 0.0;
+   theCyanHueLowRange          = 150.0;
+   theCyanHueHighRange         = 210.0;
+   theCyanHueBlendRange        = DEFAULT_BLEND;
+   theCyanSaturationOffset     = 0.0;
+   theCyanIntensityOffset      = 0.0;
+   
+   theBlueHueOffset            = 0.0;
+   theBlueHueLowRange          = 210.0;
+   theBlueHueHighRange         = 270.0;
+   theBlueHueBlendRange        = DEFAULT_BLEND;
+   theBlueSaturationOffset     = 0.0;
+   theBlueIntensityOffset      = 0.0;
+   
+   theMagentaHueOffset         = 0.0;
+   theMagentaHueLowRange       = 270.0;
+   theMagentaHueHighRange      = 330.0;
+   theMagentaHueBlendRange     = DEFAULT_BLEND;
+   theMagentaSaturationOffset  = 0.0;
+   theMagentaIntensityOffset   = 0.0;
+
+   theWhiteObjectClip          = 1.0;
+   theValidFlag = false;
+   //disableSource();
+}
+
+void ossimHsiRemapper::resetMaster()
+{
+   theMasterHueOffset          = 0.0;
+   theMasterSaturationOffset   = 0.0;
+   theMasterIntensityOffset    = 0.0;
+   theMasterIntensityLowClip   = 0.0;
+   theMasterIntensityHighClip  = 1.0;
+
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::resetRed()
+{
+   theRedHueOffset             = 0.0;
+   theRedHueLowRange           = -30.0;
+   theRedHueHighRange          = 30.0;
+   theRedHueBlendRange         = DEFAULT_BLEND;
+   theRedSaturationOffset      = 0.0;
+   theRedIntensityOffset       = 0.0;
+
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::resetYellow()
+{
+   theYellowHueOffset          = 0.0;
+   theYellowHueLowRange        = 30.0;
+   theYellowHueHighRange       = 90.0;
+   theYellowHueBlendRange      = DEFAULT_BLEND;
+   theYellowSaturationOffset   = 0.0;
+   theYellowIntensityOffset    = 0.0;
+
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::resetGreen()
+{
+   theGreenHueOffset           = 0.0;
+   theGreenHueLowRange         = 90.0;
+   theGreenHueHighRange        = 150.0;
+   theGreenHueBlendRange       = DEFAULT_BLEND;
+   theGreenSaturationOffset    = 0.0;
+   theGreenIntensityOffset     = 0.0;
+
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::resetCyan()
+{
+   theCyanHueOffset            = 0.0;
+   theCyanHueLowRange          = 150.0;
+   theCyanHueHighRange         = 210.0;
+   theCyanHueBlendRange        = DEFAULT_BLEND;
+   theCyanSaturationOffset     = 0.0;
+   theCyanIntensityOffset      = 0.0;
+
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::resetBlue()
+{
+   theBlueHueOffset            = 0.0;
+   theBlueHueLowRange          = 210.0;
+   theBlueHueHighRange         = 270.0;
+   theBlueHueBlendRange        = DEFAULT_BLEND;
+   theBlueSaturationOffset     = 0.0;
+   theBlueIntensityOffset      = 0.0;
+
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::resetMagenta()
+{
+   theMagentaHueOffset         = 0.0;
+   theMagentaHueLowRange       = 270.0;
+   theMagentaHueHighRange      = 330.0;
+   theMagentaHueBlendRange     = DEFAULT_BLEND;
+   theMagentaSaturationOffset  = 0.0;
+   theMagentaIntensityOffset   = 0.0;
+
+   verifyEnabled();
+}
+
+void ossimHsiRemapper::verifyEnabled()
+{
+   // Start off disabled...
+   //disableSource();
+   theValidFlag = false;
+   if (!theInputConnection)
+   {
+      //***
+      // Since this filter can be constructed with no input connection do not
+      // output and error, simply return.
+      //***
+      return;
+   }
+   
+   //***
+   // Add all the offsets and the low clips.
+   // If greater than zero enable getTile method.
+   //***
+   double d = theMasterHueOffset         +
+           theMasterSaturationOffset  +
+           theMasterIntensityOffset   +
+           theMasterIntensityLowClip  +
+           theRedHueOffset            +
+           theRedSaturationOffset     +
+           theRedIntensityOffset      +
+           theYellowHueOffset         +
+           theYellowSaturationOffset  +
+           theYellowIntensityOffset   +
+           theGreenHueOffset          +
+           theGreenSaturationOffset   +
+           theGreenIntensityOffset    +
+           theCyanHueOffset           +
+           theCyanSaturationOffset    +
+           theCyanIntensityOffset     +
+           theBlueHueOffset           +
+           theBlueSaturationOffset    +
+           theBlueIntensityOffset     +
+           theMagentaHueOffset        +
+           theMagentaSaturationOffset +
+           theMagentaIntensityOffset;
+   
+   if ( d != 0.0 ||
+        theMasterIntensityHighClip != 1.0 ||
+        theWhiteObjectClip != 1.0 )
+   {
+      theValidFlag = true;
+     // enableSource();
+   }
+}
+
+void ossimHsiRemapper::setMasterHueOffset(double offset)
+{
+   if (offset >= -180.0 && offset <= 180.0)
+   {
+      theMasterHueOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMasterHueOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -180.0 and less than"
+         << "\nor equal to 180.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMasterSaturationOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theMasterSaturationOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMasterSaturationOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMasterIntensityOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theMasterIntensityOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMasterIntensityOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMasterIntensityLowClip(double clip)
+{
+   if (clip >= 0.0 && clip < theMasterIntensityHighClip)
+   {
+      theMasterIntensityLowClip = clip;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMasterIntensityClip range error:"
+         << "\nLow clip of " << clip << " is out of range!"
+         << "\nMust be equal to or greater than 0.0 and less than"
+         << "\nthe high clip of " << theMasterIntensityHighClip
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMasterIntensityHighClip(double clip)
+{
+   if (clip <= 1.0 && clip > theMasterIntensityLowClip)
+   {
+      theMasterIntensityHighClip = clip;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMasterIntensityHighClip range error:"
+         << "\nHigh clip of " << clip << " is out of range!"
+         << "\nMust be greater than low clip of "
+         << theMasterIntensityLowClip << " and less than 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setRedHueOffset(double offset)
+{
+   if (offset >= -180.0 && offset <= 180.0)
+   {
+      theRedHueOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setRedHueOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -180.0 and less than"
+         << "\nor equal to 180.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setRedHueLowRange(double range)
+{
+   //***
+   // Default red range: 330 - 30
+   // Allow 315 to 15 as long as it's less than the high range.
+   // Note:  Store the range as a negative if it's between 315 and 360.
+   //***
+   double r  = range;
+   double h  = theRedHueHighRange;
+
+   if (r >= 315.0 && r < 360.0) r = r - 360.0;
+   if (h >= 315.0 && h < 360.0) h = h - 360.0;
+
+   if (r >= -45.0 && r <= 15.0 && r < h)
+   {
+      theRedHueLowRange = r;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setRedHueLow range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setRedHueHighRange(double range)
+{
+   if (range == 360.0) range = 0.0;
+   
+   //***
+   // Default red range: 330 - 30
+   // Allow 345 to 45 as long as it's greater than the low range.
+   // Note:  Store the range as a negative if it's between 345 and 360.
+   //***
+
+   double r = range;
+   double l = theRedHueLowRange;
+
+   if (r >= 315.0 && r < 360.0) r = r - 360.0;
+   if (l >= 315.0 && l < 360.0) l = l - 360.0;
+
+   if (r >= -15.0 && r <= 45 && l < r)
+   {
+      theRedHueHighRange = r;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setRedHueHigh range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setRedHueBlendRange(double range)
+{
+   //***
+   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
+   // half range.  If so snap it to half range.
+   //***
+   if ( range >= 0.0  &&
+        range <= MAX_BLEND )
+   {
+      double half_range = (theRedHueHighRange - theRedHueLowRange) / 2.0;
+
+      if (range <= half_range)
+      {
+         theRedHueBlendRange = range;
+      }
+      else
+      {
+         // Put it in the middle of the range.
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHsiRemapper::setRedHueBlendRange range error:"
+            << "\nRange of " << range << " is greater than the full range"
+            << "\ndivided by 2!"
+            << endl;
+         
+         theRedHueBlendRange = half_range;
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setRedHueBlendRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setRedSaturationOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theRedSaturationOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setRedSaturationOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setRedIntensityOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theRedIntensityOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setRedIntensityOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setYellowHueOffset(double offset)
+{
+   if (offset >= -180.0 && offset <= 180.0)
+   {
+      theYellowHueOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setYellowHueOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -180.0 and less than"
+         << "\nor equal to 180.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setYellowHueLowRange(double range)
+{
+   //***
+   // Default yellow range: 30 - 90
+   // Allow 15 to 75 as long as it's less than the high range.
+   //***
+   if ( range >= 15.0 &&
+        range <= 75.0 &&
+        range < theYellowHueHighRange )
+   {
+      theYellowHueLowRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setYellowHueLowRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setYellowHueHighRange(double range)
+{
+   //***
+   // Default yellow range: 30 - 90
+   // Allow 45 to 105 as long as it's greater than the low range.
+   //***
+   if ( range >= 45.0  &&
+        range <= 105.0 &&
+        range > theYellowHueLowRange )
+   {
+      theYellowHueHighRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setYellowHueHighRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setYellowHueBlendRange(double range)
+{
+   //***
+   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
+   // half range.  If so snap it to half range.
+   //***
+   if ( range >= 0.0  &&
+        range <= MAX_BLEND )
+   {
+      double half_range = (theYellowHueHighRange - theYellowHueLowRange) / 2.0;
+      
+      if (range <= half_range)
+      {
+         theYellowHueBlendRange = range;
+      }
+      else
+      {
+         // Put it in the middle of the range.
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHsiRemapper::setYellowHueBlendRange range error:"
+            << "\nRange of " << range << " is greater than the full range"
+            << "\ndivided by 2!"
+            << endl;
+         
+         theYellowHueBlendRange = half_range;
+      } 
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setYellowHueBlendRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setYellowSaturationOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theYellowSaturationOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setYellowSaturationOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setYellowIntensityOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theYellowIntensityOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setYellowIntensityOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setGreenHueOffset(double offset)
+{
+   if (offset >= -180.0 && offset <= 180.0)
+   {
+      theGreenHueOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setGreenHueOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -180.0 and less than"
+         << "\nor equal to 180.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setGreenHueLowRange(double range)
+{
+   //***
+   // Default green range:  90 - 150
+   // Allow 75 to 135 as long as it's less than the high range.
+   //***
+
+   if ( range >= 75.0 &&
+        range <= 135.0 &&
+        range < theGreenHueHighRange )
+   {
+      theGreenHueLowRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setGreenHueLowRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setGreenHueHighRange(double range)
+{
+   //***
+   // Default green range:  90 - 150
+   // Allow 105 to 165 as long as it's greater than the low range.
+   //***
+
+   if ( range >= 105.0  &&
+        range <= 165.0 &&
+        range > theGreenHueLowRange )
+   {
+      theGreenHueHighRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setGreenHueHighRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setGreenHueBlendRange(double range)
+{
+   //***
+   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
+   // half range.  If so snap it to half range.
+   //***
+   if ( range >= 0.0  &&
+        range <= MAX_BLEND )
+   {
+      double half_range = (theGreenHueHighRange - theGreenHueLowRange) / 2.0;
+
+      if (range <= half_range)
+      {
+         theGreenHueBlendRange = range;
+      }
+      else
+      {
+         // Put it in the middle of the range.
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHsiRemapper::setGreenHueBlendRange range error:"
+            << "\nRange of " << range << " is greater than the full range"
+            << "\ndivided by 2!"
+            << endl;
+         
+         theGreenHueBlendRange = half_range;
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setGreenHueBlendRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setGreenSaturationOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theGreenSaturationOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setGreenSaturationOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setGreenIntensityOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theGreenIntensityOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setGreenIntensityOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setCyanHueOffset(double offset)
+{
+   if (offset >= -180.0 && offset <= 180.0)
+   {
+      theCyanHueOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setCyanHueOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -180.0 and less than"
+         << "\nor equal to 180.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setCyanHueLowRange(double range)
+{
+   //***
+   // Default cyan range: 150 - 210
+   // Allow 135 to 195 as long as it's less than the high range.
+   //***
+   
+   if ( range >= 135.0 &&
+        range <= 195.0 &&
+        range < theCyanHueHighRange )
+   {
+      theCyanHueLowRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setCyanHueLowRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setCyanHueHighRange(double range)
+{
+   //***
+   // Default cyan range: 150 - 210
+   // Allow 165 to 225 as long as it's greater than the low range.
+   //***
+   
+   if ( range >= 165.0 &&
+        range <= 225.0 &&
+        range > theCyanHueLowRange )
+   {
+      theCyanHueHighRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setCyanHueHighRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setCyanHueBlendRange(double range)
+{
+   //***
+   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
+   // half range.  If so snap it to half range.
+   //***
+   if ( range >= 0.0  &&
+        range <= MAX_BLEND )
+   {
+      double half_range = (theCyanHueHighRange - theCyanHueLowRange) / 2.0;
+      
+      if (range <= half_range)
+      {
+         theCyanHueBlendRange = range;
+      }
+      else
+      {
+         // Put it in the middle of the range.
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHsiRemapper::setCyanHueBlendRange range error:"
+            << "\nRange of " << range << " is greater than the full range"
+            << "\ndivided by 2!"
+            << endl;
+         
+         theCyanHueBlendRange = half_range;
+      } 
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setCyanHueBlendRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setCyanSaturationOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theCyanSaturationOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setCyanSaturationOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setCyanIntensityOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theCyanIntensityOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setCyanIntensityOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setBlueHueOffset(double offset)
+{
+   if (offset >= -180.0 && offset <= 180.0)
+   {
+      theBlueHueOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setBlueHueOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -180.0 and less than"
+         << "\nor equal to 180.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setBlueHueLowRange(double range)
+{
+   //***
+   // Default blue range: 210 - 270
+   // Allow 195 to 255 as long as it's less than the high range.
+   //***
+   if ( range >= 195.0 &&
+        range <= 255.0 &&
+        range < theBlueHueHighRange )
+   {
+      theBlueHueLowRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setBlueHueLowRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setBlueHueHighRange(double range)
+{
+   //***
+   // Default blue range: 210 - 270
+   // Allow 225 to 285 as long as it's greater than the low range.
+   //***
+   if ( range >= 225.0  &&
+        range <= 285.0 &&
+        range > theBlueHueLowRange )
+   {
+      theBlueHueHighRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setBlueHueHighRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setBlueHueBlendRange(double range)
+{
+   //***
+   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
+   // half range.  If so snap it to half range.
+   //***
+   if ( range >= 0.0  &&
+        range <= MAX_BLEND )
+   {
+      double half_range = (theBlueHueHighRange - theBlueHueLowRange) / 2.0;
+
+      if (range <= half_range)
+      {
+         theBlueHueBlendRange = range;
+      }
+      else
+      {
+         // Put it in the middle of the range.
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHsiRemapper::setBlueHueBlendRange range error:"
+            << "\nRange of " << range << " is greater than the full range"
+            << "\ndivided by 2!"
+            << endl;
+         
+         theBlueHueBlendRange = half_range;
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setBlueHueBlendRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setBlueSaturationOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theBlueSaturationOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setBlueSaturationOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setBlueIntensityOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theBlueIntensityOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setBlueIntensityOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMagentaHueOffset(double offset)
+{
+   if (offset >= -180.0 && offset <= 180.0)
+   {
+      theMagentaHueOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMagentaHueOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -180.0 and less than"
+         << "\nor equal to 180.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMagentaHueLowRange(double range)
+{
+   //***
+   // Default magenta range:  270 - 330
+   // Allow 255 to 315 as long as it's less than the high range.
+   //***
+   if ( range >= 255.0 &&
+        range <= 315.0 &&
+        range < theMagentaHueHighRange )
+   {
+      theMagentaHueLowRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMagentaHueLowRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMagentaHueHighRange(double range)
+{
+   //***
+   // Default magenta range:  270 - 330
+   // Allow 285 to 345 as long as it's greater than the low range.
+   //***
+   if ( range >= 285.0  &&
+        range <= 345.0 &&
+        range > theMagentaHueLowRange )
+   {
+      theMagentaHueHighRange = range;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMagentaHueHighRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMagentaHueBlendRange(double range)
+{
+   //***
+   // Allowable range: 0.0 to 30.0 as long as it's not greater than the
+   // half range.  If so snap it to half range.
+   //***
+   if ( range >= 0.0  &&
+        range <= MAX_BLEND )
+   {
+      double half_range = (theMagentaHueHighRange-theMagentaHueLowRange)/2.0;
+
+      if (range <= half_range)
+      {
+         theMagentaHueBlendRange = range;
+      }
+      else
+      {
+         // Put it in the middle of the range.
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimHsiRemapper::setMagentaHueBlendRange range error:"
+            << "\nRange of " << range << " is greater than the full range"
+            << "\ndivided by 2!"
+            << endl;
+         
+         theMagentaHueBlendRange = half_range;
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMagentaHueBlendRange range error:"
+         << "\nRange of " << range << " is out of range!"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMagentaSaturationOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theMagentaSaturationOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMagentaSaturationOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+void ossimHsiRemapper::setMagentaIntensityOffset(double offset)
+{
+   if (offset >= -1.0 && offset <= 1.0)
+   {
+      theMagentaIntensityOffset = offset;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimHsiRemapper::setMagentaIntensityOffset range error:"
+         << "\nOffset of " << offset << " is out of range!"
+         << "\nMust be equal to or greater than -1.0 and less than"
+         << "\nor equal to 1.0"
+         << endl;
+   }
+}
+
+double ossimHsiRemapper::calculateMinNormValue()
+{
+   static const char MODULE[] = "ossimHsiRemapper::calculateMinNormValue";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " Entered..." << endl;
+   }
+   
+   if (!theTile)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " ERROR:"
+         << "\nClass not initialized!"
+         << endl;
+      return 0.0;
+   }
+
+   double min_pix = theTile->getMinPix(0);
+   double max_pix = theTile->getMaxPix(0);
+
+   for (ossim_uint32 band=1; band<theTile->getNumberOfBands(); ++band)
+   {
+      if (min_pix != theTile->getMinPix(band))
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " Warning:"
+            << "\nMixed minimum values for bands..."
+            << endl;
+      }
+      if (max_pix != theTile->getMaxPix(band))
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << " Warning:"
+              << "\nMixed maximum values for bands..."
+              << endl;
+      }
+   }
+
+   if (min_pix < 0.0)
+   {
+      //
+      // Assigning some arbituary number for float data.
+      // This should really come from the normalizer (ossimImageData) of
+      // the data.
+      //
+      return OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
+   }
+
+   return (min_pix / max_pix);
+}
+
+ossim_uint32 ossimHsiRemapper::getNumberOfOutputBands() const
+{
+   if (isSourceEnabled()&&theValidFlag) // Always rgb tile out...
+   {
+      return 3;
+   }
+
+   // Filter bypassed so getTile will return input tile.
+   return ossimImageSourceFilter::getNumberOfInputBands();
+}
+
+
+double ossimHsiRemapper::getMasterHueOffset () const
+{
+   return theMasterHueOffset;
+}
+
+double ossimHsiRemapper::getMasterSaturationOffset() const
+{
+   return theMasterSaturationOffset;
+}
+
+double ossimHsiRemapper::getMasterIntensityOffset() const
+{
+   return theMasterIntensityOffset;
+}
+
+double ossimHsiRemapper::getMasterIntensityLowClip() const
+{
+   return theMasterIntensityLowClip;
+}
+
+double ossimHsiRemapper::getMasterIntensityHighClip() const
+{
+   return theMasterIntensityHighClip;
+}
+
+double ossimHsiRemapper::getRedHueOffset() const
+{
+   return theRedHueOffset;
+}
+
+double ossimHsiRemapper::getRedHueLowRange() const
+{
+   return theRedHueLowRange;
+}
+
+double ossimHsiRemapper::getRedHueHighRange() const
+{
+   return theRedHueHighRange;
+}
+
+double ossimHsiRemapper::getRedHueBlendRange() const
+{
+   return theRedHueBlendRange;
+}
+
+double ossimHsiRemapper::getRedSaturationOffset() const
+{
+   return theRedSaturationOffset;
+}
+
+double ossimHsiRemapper::getRedIntensityOffset() const
+{
+   return theRedIntensityOffset;
+}
+
+double ossimHsiRemapper::getYellowHueOffset () const
+{
+   return theYellowHueOffset;
+}
+
+double ossimHsiRemapper::getYellowHueLowRange() const
+{
+   return theYellowHueLowRange;
+}
+
+double ossimHsiRemapper::getYellowHueHighRange() const
+{
+   return theYellowHueHighRange;
+}
+
+double ossimHsiRemapper::getYellowHueBlendRange() const
+{
+   return theYellowHueBlendRange;
+}
+
+double ossimHsiRemapper::getYellowSaturationOffset() const
+{
+   return theYellowSaturationOffset;
+}
+
+double ossimHsiRemapper::getYellowIntensityOffset() const
+{
+   return theYellowIntensityOffset;
+}
+
+double ossimHsiRemapper::getGreenHueOffset () const
+{
+   return theGreenHueOffset;
+}
+
+double ossimHsiRemapper::getGreenHueLowRange() const
+{
+   return theGreenHueLowRange;
+}
+
+double ossimHsiRemapper::getGreenHueHighRange() const
+{
+   return theGreenHueHighRange;
+}
+
+double ossimHsiRemapper::getGreenHueBlendRange() const
+{
+   return theGreenHueBlendRange;
+}
+
+double ossimHsiRemapper::getGreenSaturationOffset() const
+{
+   return theGreenSaturationOffset;
+}
+
+double ossimHsiRemapper::getGreenIntensityOffset() const
+{
+   return theGreenIntensityOffset;
+}
+
+double ossimHsiRemapper::getCyanHueOffset () const
+{
+   return theCyanHueOffset;
+}
+
+double ossimHsiRemapper::getCyanHueLowRange() const
+{
+   return theCyanHueLowRange;
+}
+
+double ossimHsiRemapper::getCyanHueHighRange() const
+{
+   return theCyanHueHighRange;
+}
+
+double ossimHsiRemapper::getCyanHueBlendRange() const
+{
+   return theCyanHueBlendRange;
+}
+
+double ossimHsiRemapper::getCyanSaturationOffset() const
+{
+   return theCyanSaturationOffset;
+}
+
+double ossimHsiRemapper::getCyanIntensityOffset() const
+{
+   return theCyanIntensityOffset;
+}
+
+double ossimHsiRemapper::getBlueHueOffset () const
+{
+   return theBlueHueOffset;
+}
+
+double ossimHsiRemapper::getBlueHueLowRange() const
+{
+   return theBlueHueLowRange;
+}
+
+double ossimHsiRemapper::getBlueHueHighRange() const
+{
+   return theBlueHueHighRange;
+}
+
+double ossimHsiRemapper::getBlueHueBlendRange() const
+{
+   return theBlueHueBlendRange;
+}
+
+double ossimHsiRemapper::getBlueSaturationOffset() const
+{
+   return theBlueSaturationOffset;
+}
+
+double ossimHsiRemapper::getBlueIntensityOffset() const
+{
+   return theBlueIntensityOffset;
+}
+
+double ossimHsiRemapper::getMagentaHueOffset () const
+{
+   return theMagentaHueOffset;
+}
+
+double ossimHsiRemapper::getMagentaHueLowRange() const
+{
+   return theMagentaHueLowRange;
+}
+
+double ossimHsiRemapper::getMagentaHueHighRange() const
+{
+   return theMagentaHueHighRange;
+}
+
+double ossimHsiRemapper::getMagentaHueBlendRange() const
+{
+   return theMagentaHueBlendRange;
+}
+
+double ossimHsiRemapper::getMagentaSaturationOffset() const
+{
+   return theMagentaSaturationOffset;
+}
+
+double ossimHsiRemapper::getMagentaIntensityOffset() const
+{
+   return theMagentaIntensityOffset;
+}
+
+void ossimHsiRemapper::setHueOffset(int color_group, double offset)
+{
+   switch (color_group)
+   {
+      case RED:
+         setRedHueOffset(offset);
+         break;
+      case YELLOW:
+         setYellowHueOffset(offset);
+         break;
+      case GREEN:
+         setGreenHueOffset(offset);
+         break;
+      case CYAN:
+         setCyanHueOffset(offset);
+         break;
+      case BLUE:
+         setBlueHueOffset(offset);
+         break;
+      case MAGENTA:
+         setMagentaHueOffset(offset);
+         break;
+      case ALL:
+         setMasterHueOffset(offset);
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::setHueOffset NOTICE:  Range error!" << endl;
+   }
+}
+
+void ossimHsiRemapper::setHueLowRange(int color_group, double range)
+{
+   switch (color_group)
+   {
+      case RED:
+         setRedHueLowRange(range);
+         break;
+      case YELLOW:
+         setYellowHueLowRange(range);
+         break;
+      case GREEN:
+         setGreenHueLowRange(range);
+         break;
+      case CYAN:
+         setCyanHueLowRange(range);
+         break;
+      case BLUE:
+         setBlueHueLowRange(range);
+         break;
+      case MAGENTA:
+         setMagentaHueLowRange(range);
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::setHueLowRange NOTICE:  Range error!"
+            << endl;
+   }
+}
+
+void ossimHsiRemapper::setHueHighRange(int color_group, double range)
+{
+   switch (color_group)
+   {
+      case RED:
+         setRedHueHighRange(range);
+         break;
+      case YELLOW:
+         setYellowHueHighRange(range);
+         break;
+      case GREEN:
+         setGreenHueHighRange(range);
+         break;
+      case CYAN:
+         setCyanHueHighRange(range);
+         break;
+      case BLUE:
+         setBlueHueHighRange(range);
+         break;
+      case MAGENTA:
+         setMagentaHueHighRange(range);
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::setHueHighRange NOTICE:  Range error!"
+            << endl;
+   }
+}
+
+void ossimHsiRemapper::setHueBlendRange(int color_group, double range)
+{
+   switch (color_group)
+   {
+      case RED:
+         setRedHueBlendRange(range);
+         break;
+      case YELLOW:
+         setYellowHueBlendRange(range);
+         break;
+      case GREEN:
+         setGreenHueBlendRange(range);
+         break;
+      case CYAN:
+         setCyanHueBlendRange(range);
+         break;
+      case BLUE:
+         setBlueHueBlendRange(range);
+         break;
+      case MAGENTA:
+         setMagentaHueBlendRange(range);
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::setHueBlendRange NOTICE:  Range error!"
+            << endl;
+   }
+}
+
+void ossimHsiRemapper::setSaturationOffset(int color_group, double offset)
+{
+   switch (color_group)
+   {
+      case RED:
+         setRedSaturationOffset(offset);
+         break;
+      case YELLOW:
+         setYellowSaturationOffset(offset);
+         break;
+      case GREEN:
+         setGreenSaturationOffset(offset);
+         break;
+      case CYAN:
+         setCyanSaturationOffset(offset);
+         break;
+      case BLUE:
+         setBlueSaturationOffset(offset);
+         break;
+      case MAGENTA:
+         setMagentaSaturationOffset(offset);
+         break;
+      case ALL:
+         setMasterSaturationOffset(offset);
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::setSaturationOffset NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+}
+
+void ossimHsiRemapper::setIntensityOffset(int color_group, double offset)
+{
+   switch (color_group)
+   {
+      case RED:
+         setRedIntensityOffset(offset);
+         break;
+      case YELLOW:
+         setYellowIntensityOffset(offset);
+         break;
+      case GREEN:
+         setGreenIntensityOffset(offset);
+         break;
+      case CYAN:
+         setCyanIntensityOffset(offset);
+         break;
+      case BLUE:
+         setBlueIntensityOffset(offset);
+         break;
+      case MAGENTA:
+         setMagentaIntensityOffset(offset);
+         break;
+      case ALL:
+         setMasterIntensityOffset(offset);
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::setIntensityOffset NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+}
+
+double ossimHsiRemapper::getHueOffset(int color_group) const
+{
+   switch (color_group)
+   {
+      case RED:
+         return getRedHueOffset();
+         break;
+      case YELLOW:
+         return getYellowHueOffset();
+         break;
+      case GREEN:
+         return getGreenHueOffset();
+         break;
+      case CYAN:
+         return getCyanHueOffset();
+         break;
+      case BLUE:
+         return getBlueHueOffset();
+         break;
+      case MAGENTA:
+         return getMagentaHueOffset();
+         break;
+      case ALL:
+         return getMasterHueOffset();
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::getHueOffset NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+   return 0.0;
+}
+
+double ossimHsiRemapper::getHueLowRange(int color_group) const
+{
+   switch (color_group)
+   {
+      case RED:
+         return getRedHueLowRange();
+         break;
+      case YELLOW:
+         return getYellowHueLowRange();
+         break;
+      case GREEN:
+         return getGreenHueLowRange();
+         break;
+      case CYAN:
+         return getCyanHueLowRange();
+         break;
+      case BLUE:
+         return getBlueHueLowRange();
+         break;
+      case MAGENTA:
+         return getMagentaHueLowRange();
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::getHueLowRange NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+   return 0.0;
+}
+
+double ossimHsiRemapper::getHueHighRange(int color_group) const
+{
+   switch (color_group)
+   {
+      case RED:
+         return getRedHueHighRange();
+         break;
+      case YELLOW:
+         return getYellowHueHighRange();
+         break;
+      case GREEN:
+         return getGreenHueHighRange();
+         break;
+      case CYAN:
+         return getCyanHueHighRange();
+         break;
+      case BLUE:
+         return getBlueHueHighRange();
+         break;
+      case MAGENTA:
+         return getMagentaHueHighRange();
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::getHueHighRange NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+   return 0.0;
+}
+
+double ossimHsiRemapper::getHueBlendRange(int color_group) const
+{
+   switch (color_group)
+   {
+      case RED:
+         return getRedHueBlendRange();
+         break;
+      case YELLOW:
+         return getYellowHueBlendRange();
+         break;
+      case GREEN:
+         return getGreenHueBlendRange();
+         break;
+      case CYAN:
+         return getCyanHueBlendRange();
+         break;
+      case BLUE:
+         return getBlueHueBlendRange();
+         break;
+      case MAGENTA:
+         return getMagentaHueBlendRange();
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::getHueBlendRange NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+   return 0.0;
+}
+
+double ossimHsiRemapper::getSaturationOffset(int color_group) const
+{
+   switch (color_group)
+   {
+      case RED:
+         return getRedSaturationOffset();
+         break;
+      case YELLOW:
+         return getYellowSaturationOffset();
+         break;
+      case GREEN:
+         return getGreenSaturationOffset();
+         break;
+      case CYAN:
+         return getCyanSaturationOffset();
+         break;
+      case BLUE:
+         return getBlueSaturationOffset();
+         break;
+      case MAGENTA:
+         return getMagentaSaturationOffset();
+         break;
+      case ALL:
+         return getMasterSaturationOffset();
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::getSaturationOffset NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+   return 0.0;
+}
+
+double ossimHsiRemapper::getIntensityOffset(int color_group) const
+{
+   switch (color_group)
+   {
+      case RED:
+         return getRedIntensityOffset();
+         break;
+      case YELLOW:
+         return getYellowIntensityOffset();
+         break;
+      case GREEN:
+         return getGreenIntensityOffset();
+         break;
+      case CYAN:
+         return getCyanIntensityOffset();
+         break;
+      case BLUE:
+         return getBlueIntensityOffset();
+         break;
+      case MAGENTA:
+         return getMagentaIntensityOffset();
+         break;
+      case ALL:
+         return getMasterIntensityOffset();
+         break;
+      default:
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "ossimHsiRemapper::getIntensityOffset NOTICE:  Range error!"
+            << endl;
+         break;
+   }
+   return 0.0;
+}
+
+void ossimHsiRemapper::setWhiteObjectClip(double clip)
+{
+   if ( (clip >= .8) && (clip <= 1.0) )
+   {
+      theWhiteObjectClip = clip;
+      verifyEnabled();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "HsiRemapper::setWhiteObjectClip range error:"
+         << "\nClip of " << clip << " is out of range!"
+         << "\nMust be between .8 and 1.0"
+         << endl;
+   }
+}
+
+double ossimHsiRemapper::getWhiteObjectClip() const
+{
+   return theWhiteObjectClip;
+}
+
+void ossimHsiRemapper::resetWhiteObjectClip()
+{
+   theWhiteObjectClip = 1.0;
+   verifyEnabled();
+}
+
+ossimString ossimHsiRemapper::getLongName()const
+{
+   return ossimString("HSI Remapper, filter with controls for all HSI(Hue, Saturation, and Intensity) adjustments.");
+}
+
+ossimString ossimHsiRemapper::getShortName()const
+{
+   return ossimString("HSI Remapper");
+}
+
+ostream& ossimHsiRemapper::print(ostream& os) const
+{
+   os << setiosflags(ios::fixed) << setprecision(2)
+      << "\nossimHsiRemapper:"
+      << "\ntheEnableFlag:                " << theEnableFlag
+
+      << "\ntheMasterHueOffset:           " << theMasterHueOffset
+      << "\ntheMasterSaturationOffset:    " << theMasterSaturationOffset
+      << "\ntheMasterIntensityOffset:     " << theMasterIntensityOffset
+      << "\ntheMasterIntensityLowClip:    " << theMasterIntensityLowClip
+      << "\ntheMasterIntensityHighClip:   " << theMasterIntensityHighClip
+      
+      << "\ntheRedHueOffset:              " << theRedHueOffset
+      << "\ntheRedHueLowRange:            " << theRedHueLowRange
+      << "\ntheRedHueHighRange:           " << theRedHueHighRange
+      << "\ntheRedSaturationOffset:       " << theRedSaturationOffset
+      << "\ntheRedIntensityOffset:        " << theRedIntensityOffset
+      
+      << "\ntheYellowHueOffset:           " << theYellowHueOffset
+      << "\ntheYellowHueLowRange:         " << theYellowHueLowRange
+      << "\ntheYellowHueHighRange:        " << theYellowHueHighRange
+      << "\ntheYellowSaturationOffset:    " << theYellowSaturationOffset
+      << "\ntheYellowIntensityOffset:     " << theYellowIntensityOffset
+      
+      << "\ntheGreenHueOffset:            " << theGreenHueOffset
+      << "\ntheGreenHueLowRange:          " << theGreenHueLowRange
+      << "\ntheGreenHueHighRange:         " << theGreenHueHighRange
+      << "\ntheGreenSaturationOffset:     " << theGreenSaturationOffset
+      << "\ntheGreenIntensityOffset:      " << theGreenIntensityOffset
+      
+      << "\ntheCyanHueOffset:             " << theCyanHueOffset
+      << "\ntheCyanHueLowRange:           " << theCyanHueLowRange
+      << "\ntheCyanHueHighRange:          " << theCyanHueHighRange
+      << "\ntheCyanSaturationOffset:      " << theCyanSaturationOffset
+      << "\ntheCyanIntensityOffset:       " << theCyanIntensityOffset
+      
+      << "\ntheBlueHueOffset:             " << theBlueHueOffset
+      << "\ntheBlueHueLowRange:           " << theBlueHueLowRange
+      << "\ntheBlueHueHighRange:          " << theBlueHueHighRange
+      << "\ntheBlueSaturationOffset:      " << theBlueSaturationOffset
+      << "\ntheBlueIntensityOffset:       " << theBlueIntensityOffset
+      
+      << "\ntheMagentaHueOffset:          " << theMagentaHueOffset
+      << "\ntheMagentaHueLowRange:        " << theMagentaHueLowRange
+      << "\ntheMagentaHueHighRange:       " << theMagentaHueHighRange
+      << "\ntheMagentaSaturationOffset:   " << theMagentaSaturationOffset
+      << "\ntheMagentaIntensityOffset:    " << theMagentaIntensityOffset
+
+      << "\ntheWhiteObjectClip:           " << theWhiteObjectClip
+      << endl;
+   
+   return os;
+}
+
+ostream& operator<<(ostream& os, const ossimHsiRemapper& hr)
+{
+   return hr.print(os);
+}
diff --git a/src/imaging/ossimHsiToRgbSource.cpp b/src/imaging/ossimHsiToRgbSource.cpp
new file mode 100644
index 0000000..43a4e21
--- /dev/null
+++ b/src/imaging/ossimHsiToRgbSource.cpp
@@ -0,0 +1,147 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHsiToRgbSource.cpp 17206 2010-04-25 23:20:40Z dburken $
+#include <ossim/imaging/ossimHsiToRgbSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimHsiVector.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimHsiToRgbSource, "ossimHsiToRgbSource", ossimImageSourceFilter)
+
+ossimHsiToRgbSource::ossimHsiToRgbSource()
+   :ossimImageSourceFilter(),
+    theBlankTile(NULL),
+    theTile(NULL)
+{
+}
+
+ossimHsiToRgbSource::ossimHsiToRgbSource(ossimImageSource* inputSource)
+   : ossimImageSourceFilter(inputSource),
+    theBlankTile(NULL),
+    theTile(NULL)
+{
+}
+
+ossimHsiToRgbSource::~ossimHsiToRgbSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimHsiToRgbSource::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return NULL;  // This filter requires an input.
+   }
+   
+   ossimRefPtr<ossimImageData> inputTile =
+      theInputConnection->getTile(tileRect, resLevel);   
+   if(!isSourceEnabled())
+   {
+      return inputTile;
+   }
+   
+   if(!theTile.valid())
+   {
+      allocate(); // First time through...
+   }
+   
+   if( !inputTile.valid() ||
+       inputTile->getDataObjectStatus() == OSSIM_NULL ||
+       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
+   {
+      theBlankTile->setImageRectangle(tileRect);
+      return theBlankTile;
+   }
+
+   if((inputTile->getNumberOfBands()==3)&&
+      (inputTile->getScalarType()==OSSIM_NORMALIZED_FLOAT)&&
+      (inputTile->getDataObjectStatus()!=OSSIM_NULL))
+   {
+      // Set the origin, resize if needed of the output tile.
+      theTile->setImageRectangle(tileRect);
+      
+      ossim_uint8* outputBands[3];
+      float* inputBands[3];
+      outputBands[0] = static_cast<ossim_uint8*>(theTile->getBuf(0));
+      outputBands[1] = static_cast<ossim_uint8*>(theTile->getBuf(1));
+      outputBands[2] = static_cast<ossim_uint8*>(theTile->getBuf(2));
+      inputBands[0] = static_cast<float*>(inputTile->getBuf(0));
+      inputBands[1] = static_cast<float*>(inputTile->getBuf(1));
+      inputBands[2] = static_cast<float*>(inputTile->getBuf(2));
+      
+      long height = inputTile->getHeight();
+      long width  = inputTile->getWidth();
+      long offset = 0;
+      for(long row = 0; row < height; ++row)
+      {
+         for(long col = 0; col < width; ++col)
+         {
+            ossimHsiVector hsi(inputBands[0][offset],
+                               inputBands[1][offset],
+                               inputBands[2][offset]);
+            
+            ossimRgbVector rgb(hsi);
+            
+            
+            outputBands[0][offset] = rgb.getR();
+            outputBands[1][offset] = rgb.getG();
+            outputBands[2][offset] = rgb.getB();
+            
+            ++offset;
+         }
+      }
+   }
+   else
+   {
+      return inputTile;
+   }
+
+   theTile->validate();
+
+   return theTile;
+}
+
+void ossimHsiToRgbSource::initialize()
+{
+   ossimImageSourceFilter::initialize();
+}
+
+void ossimHsiToRgbSource::allocate()
+{
+   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
+   theTile = (ossimImageData*)theBlankTile->dup();
+   theTile->initialize();
+}
+
+ossimScalarType ossimHsiToRgbSource::getOutputScalarType() const
+{
+   return OSSIM_UCHAR;
+}
+
+double ossimHsiToRgbSource::getNullPixelValue()const
+{
+   return 0.0;
+}
+
+double ossimHsiToRgbSource::getMinPixelValue(ossim_uint32 /* band */)const
+{
+   return OSSIM_DEFAULT_MIN_PIX_UCHAR;
+}
+
+double ossimHsiToRgbSource::getMaxPixelValue(ossim_uint32 /* band */)const
+{
+   return OSSIM_DEFAULT_MAX_PIX_UCHAR;
+}
diff --git a/src/imaging/ossimHsvGridRemapEngine.cpp b/src/imaging/ossimHsvGridRemapEngine.cpp
new file mode 100644
index 0000000..5c6ed04
--- /dev/null
+++ b/src/imaging/ossimHsvGridRemapEngine.cpp
@@ -0,0 +1,280 @@
+//*****************************************************************************
+// FILE: ossimHsvGridRemapEngine.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class 
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimHsvGridRemapEngine.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+
+#include <ossim/imaging/ossimHsvGridRemapEngine.h>
+
+RTTI_DEF1(ossimHsvGridRemapEngine, "ossimHsvGridRemapEngine",
+          ossimGridRemapEngine);
+
+#include <ossim/imaging/ossimGridRemapSource.h>
+#include <ossim/imaging/ossimAtbPointSource.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDblGrid.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimHsvVector.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimHsvGridRemapEngine:exec");
+static ossimTrace traceDebug ("ossimHsvGridRemapEngine:debug");
+
+//*****************************************************************************
+//  METHOD: ossimHsvGridRemapEngine::remapTile
+//  
+//*****************************************************************************
+ossimObject* ossimHsvGridRemapEngine::dup() const
+{
+   return new ossimHsvGridRemapEngine;
+}
+
+//*****************************************************************************
+//  METHOD: ossimHsvGridRemapEngine::remapTile
+//  
+//*****************************************************************************
+void ossimHsvGridRemapEngine::remapTile(const ossimDpt&       origin,
+                                        ossimGridRemapSource* remapper,
+                                        ossimRefPtr<ossimImageData>& tile)
+{
+   static const char MODULE[] = "ossimHsvGridRemapEngine::remapTile";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // Fetch tile size and NULL pixel value:
+   //***
+   int    width         = tile->getWidth();
+   int    height        = tile->getHeight();
+   int    offset        = 0;
+   
+   void* red_buf = tile->getBuf(0);
+   void* grn_buf = tile->getBuf(1);
+   void* blu_buf = tile->getBuf(2);
+
+   ossimDblGrid& gridH = *(remapper->getGrid(0));
+   ossimDblGrid& gridS = *(remapper->getGrid(1));
+   ossimDblGrid& gridV = *(remapper->getGrid(2));
+      
+   //---
+   // Remap according to pixel type:
+   //---
+   switch(tile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         for (double line=origin.line; line<origin.line+height; line+=1.0)
+         {
+            for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+            {
+               //---
+               // Fetch pixel from the input tile band buffers and convert
+               // to HSV:
+               //---
+               ossimRgbVector rgb_pixel (((ossim_uint8*)red_buf)[offset],
+                                         ((ossim_uint8*)grn_buf)[offset],
+                                         ((ossim_uint8*)blu_buf)[offset]);
+               ossimHsvVector hsv_pixel (rgb_pixel);
+               
+               //---
+               // Remap pixel HSV  with spatially variant bias value:
+               //---
+               hsv_pixel.setH(hsv_pixel.getH() + gridH(samp,line));
+               hsv_pixel.setS(hsv_pixel.getS() + gridS(samp,line));
+               hsv_pixel.setV(hsv_pixel.getV() + gridV(samp,line));
+               
+               //---
+               // Convert back to RGB and write to the tile:
+               //---
+               rgb_pixel = hsv_pixel;  // auto-clamped
+               ((ossim_uint8*)red_buf)[offset] = rgb_pixel.getR();
+               ((ossim_uint8*)grn_buf)[offset] = rgb_pixel.getG();
+               ((ossim_uint8*)blu_buf)[offset] = rgb_pixel.getB();
+               
+               offset++;
+            }
+         }
+         break;
+      }
+      
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+         break;
+         
+      case OSSIM_UINT16:
+         break;
+         
+      case OSSIM_SINT16:
+         break;	
+
+      case OSSIM_FLOAT64:
+         break;	
+
+      case OSSIM_NORMALIZED_DOUBLE:
+         break;	
+
+      case OSSIM_FLOAT32:
+         break;	
+
+      case OSSIM_NORMALIZED_FLOAT:
+         break;	
+
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+         break;
+
+   }   // end switch statement
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+};
+
+//*****************************************************************************
+//  METHOD: ossimHsvGridRemapEngine::assignRemapValues
+//
+//  This engine defines the target value as an HSV vector of doubles, computed
+//  as the mean of all contributor HSV values.
+//  
+//*****************************************************************************
+void ossimHsvGridRemapEngine::assignRemapValues (
+   vector<ossimAtbPointSource*>& sources_list)
+{
+   static const char MODULE[] = "ossimHsvGridRemapEngine::assignRemapValues";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   int i; // index to individual sources
+
+   //***
+   // Declare a 2D array that will contain all of the contributing sources'
+   // HSV mean values. Also declare the accumulator target vector.
+   //***
+   int num_contributors = (int)sources_list.size();
+   double** contributor_pixel = new double* [num_contributors];
+   for (i=0; i<num_contributors; i++)
+      contributor_pixel[i] = new double[3];
+   double target_pixel[3] = {0.0, 0.0, 0.0};
+
+   //***
+   // Now loop over each remaining contributor and sum in its contribution:
+   //***
+   vector<ossimAtbPointSource*>::iterator source;
+   i = 0;
+   for(source  = sources_list.begin();
+       source != sources_list.end();
+       source++)
+   {
+      (*source)->getSourceValue(contributor_pixel[i]);
+
+      target_pixel[0] += contributor_pixel[i][0]/(double)num_contributors;
+      target_pixel[1] += contributor_pixel[i][1]/(double)num_contributors;
+      target_pixel[2] += contributor_pixel[i][2]/(double)num_contributors;
+
+      i++;
+   }
+
+   //***
+   // The target pixel has been established. Now need to compute the actual
+   // remap quantities that will be written to the appropriate remap grids:
+   //***
+   i = 0;
+   for(source  = sources_list.begin();
+       source != sources_list.end();
+       source++)
+   {
+      computeRemapNode(*source, contributor_pixel[i], target_pixel);
+      i++;
+   }
+
+   //***
+   // Delete locally allocated memory:
+   //***
+   for (i=0; i<num_contributors; i++)
+      delete [] contributor_pixel[i];
+   delete [] contributor_pixel;
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimHsvGridRemapEngine::computeSourceValue
+//  
+//*****************************************************************************
+void ossimHsvGridRemapEngine::computeSourceValue(
+   ossimRefPtr<ossimImageData>& source, void* result)
+{
+   static const char MODULE[]="ossimHsvGridRemapEngine::computeSourceValue";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // This engine defines "value" as the HSV vector corresponding to the mean
+   // RGB pixel value of the source data:
+   //***
+   ossimRgbVector rgb_vector;
+   rgb_vector.setR((unsigned char) source->computeAverageBandValue(0));
+   rgb_vector.setG((unsigned char) source->computeAverageBandValue(1));
+   rgb_vector.setB((unsigned char) source->computeAverageBandValue(2));
+
+   //***
+   // Assign the HSV components to the result vector:
+   //***
+   ossimHsvVector hsv_vector (rgb_vector);
+   ((double*)result)[0] = (double) hsv_vector.getH();
+   ((double*)result)[1] = (double) hsv_vector.getS();
+   ((double*)result)[2] = (double) hsv_vector.getV();
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimHsvGridRemapEngine::computeRemapNode
+//
+//  This engine defines the remap value as the difference between the target
+//  HSV vector and the individual point source's value vector.
+//
+//*****************************************************************************
+void ossimHsvGridRemapEngine::computeRemapNode(ossimAtbPointSource* ps,
+                                              void* source_value,
+                                              void* target_value)
+{
+   static const char MODULE[] = "ossimHsvGridRemapEngine::computeRemapNode";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // Compute the remap grid node value specific to this HSV implementation:
+   //***
+   double node[3];
+   node[0] = ((double*)target_value)[0] - ((double*)source_value)[0];
+   node[1] = ((double*)target_value)[1] - ((double*)source_value)[1];
+   node[2] = ((double*)target_value)[2] - ((double*)source_value)[2];
+
+   //***
+   // Fetch a pointer to the remapper feeding this point source in order to
+   // pass it the node value:
+   //***
+   ossimGridRemapSource* remapper = ps->getRemapSource();
+   remapper->setGridNode(ps->getViewPoint(), node);
+                         
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
diff --git a/src/imaging/ossimHsvToRgbSource.cpp b/src/imaging/ossimHsvToRgbSource.cpp
new file mode 100644
index 0000000..f8b5f90
--- /dev/null
+++ b/src/imaging/ossimHsvToRgbSource.cpp
@@ -0,0 +1,159 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimHsvToRgbSource.cpp 17195 2010-04-23 17:32:18Z dburken $
+#include <ossim/imaging/ossimHsvToRgbSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimHsvVector.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimHsvToRgbSource, "ossimHsvToRgbSource", ossimImageSourceFilter)
+
+ossimHsvToRgbSource::ossimHsvToRgbSource()
+   :ossimImageSourceFilter(),
+    theBlankTile(NULL),
+    theTile(NULL)
+{
+}
+
+ossimHsvToRgbSource::ossimHsvToRgbSource(ossimImageSource* inputSource)
+   : ossimImageSourceFilter(inputSource),
+     theBlankTile(NULL),
+     theTile(NULL)
+{
+}
+
+ossimHsvToRgbSource::~ossimHsvToRgbSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimHsvToRgbSource::getTile(
+   const  ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(theInputConnection)
+   {
+      ossimRefPtr<ossimImageData> imageData =
+         theInputConnection->getTile(tileRect, resLevel);
+
+      if(!imageData.valid()) return theBlankTile;
+      
+      if(!isSourceEnabled())
+      {
+         return imageData;
+      }
+
+      if(!theTile.valid()) allocate();
+      if(!theTile.valid())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Unable to initialize ossimHsvToRgbSource in getTile"
+            << std::endl;
+         return ossimRefPtr<ossimImageData>();
+      }
+      
+      long w  = tileRect.width();
+      long h  = tileRect.height();
+      long tw = theTile->getWidth();
+      long th = theTile->getHeight();
+      
+      theBlankTile->setOrigin(tileRect.ul());
+      theBlankTile->setWidthHeight(w, h);
+      theTile->setWidthHeight(w, h);
+      theTile->setOrigin(tileRect.ul());
+      if( (tw*th) != (w*h))
+      {
+         theTile->initialize();
+      }
+      else
+      {
+         theTile->makeBlank();
+      }
+      
+      if((imageData->getNumberOfBands()==3)&&
+         (imageData->getScalarType()==OSSIM_NORMALIZED_FLOAT)&&
+         (imageData->getDataObjectStatus()!=OSSIM_NULL))
+      {
+         ossim_uint8* outputBands[3];
+         float* inputBands[3];
+         outputBands[0] = static_cast<ossim_uint8*>(theTile->getBuf(0));
+         outputBands[1] = static_cast<ossim_uint8*>(theTile->getBuf(1));
+         outputBands[2] = static_cast<ossim_uint8*>(theTile->getBuf(2));
+         inputBands[0] = static_cast<float*>(imageData->getBuf(0));
+         inputBands[1] = static_cast<float*>(imageData->getBuf(1));
+         inputBands[2] = static_cast<float*>(imageData->getBuf(2));
+         
+         long height = imageData->getHeight();
+         long width  = imageData->getWidth();
+         long offset = 0;
+         for(long row = 0; row < height; ++row)
+         {
+            for(long col = 0; col < width; ++col)
+            {
+               ossimHsvVector hsv(inputBands[0][offset],
+                                  inputBands[1][offset],
+                                  inputBands[2][offset]);
+               
+               ossimRgbVector rgb(hsv);
+
+               outputBands[0][offset] = rgb.getR();
+               outputBands[1][offset] = rgb.getG();
+               outputBands[2][offset] = rgb.getB();
+
+               ++offset;
+            }
+         }
+      }
+      else
+      {
+         return imageData;
+      }
+      theTile->validate();
+      return theTile;
+   }
+   
+   return theBlankTile;
+}
+
+void ossimHsvToRgbSource::initialize()
+{
+   theBlankTile = NULL;
+   theTile      = NULL;
+}
+
+void ossimHsvToRgbSource::allocate()
+{
+   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
+   theTile = (ossimImageData*)theBlankTile->dup();
+   theTile->initialize();
+}
+
+ossimScalarType ossimHsvToRgbSource::getOutputScalarType() const
+{
+   return OSSIM_UINT8;
+}
+
+double ossimHsvToRgbSource::getNullPixelValue()const
+{
+   return 0;
+}
+
+double ossimHsvToRgbSource::getMinPixelValue(ossim_uint32 /* band */)const
+{
+   return OSSIM_DEFAULT_MIN_PIX_UCHAR;
+}
+
+double ossimHsvToRgbSource::getMaxPixelValue(ossim_uint32 /* band */)const
+{
+   return OSSIM_DEFAULT_MAX_PIX_UCHAR;
+}  
diff --git a/src/imaging/ossimIgenGenerator.cpp b/src/imaging/ossimIgenGenerator.cpp
new file mode 100644
index 0000000..61da6b0
--- /dev/null
+++ b/src/imaging/ossimIgenGenerator.cpp
@@ -0,0 +1,681 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimIgenGenerator.cpp 20206 2011-11-04 15:16:31Z dburken $
+#include <ossim/imaging/ossimIgenGenerator.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/imaging/ossimGeoPolyCutter.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimUsgsQuad.h>
+
+void ossimIgenGenerator::generateSpecList(bool outputToFileFlag)
+{
+   if(theTilingFlag&&
+      (theTileSpacingUnits!=OSSIM_UNIT_UNKNOWN)&&
+      (!theTileSpacing.hasNans()))
+   {
+      generateTiledSpecList(outputToFileFlag);
+   }
+   else
+   {
+      generateNoTiledSpecList(outputToFileFlag);
+   }
+   
+}
+
+void ossimIgenGenerator::getImageFilenamesFromSpecList(std::vector<ossimFilename>& filenameList)
+{
+   if(!theSpecList.size())
+   {
+      generateSpecList();
+   }
+   if(theSpecList.size())
+   {
+      filenameList.clear();
+      for(ossim_uint32 i = 0; i < theSpecList.size(); ++i)
+      {
+         const char* filename = theSpecList[i].find("object2.",  ossimKeywordNames::FILENAME_KW);
+
+         if(filename)
+         {
+            filenameList.push_back(ossimFilename(filename));
+         }
+         else
+         {
+            filenameList.clear();
+            return;
+         }
+      }
+   }
+   
+}
+
+ossimGrect ossimIgenGenerator::getBoundingGround()const
+{
+   return ossimGrect(theOutputGeoPolygon[0],
+                     theOutputGeoPolygon[1],
+                     theOutputGeoPolygon[2],
+                     theOutputGeoPolygon[3]);
+}
+
+void ossimIgenGenerator::executeSpecList()
+{
+}
+
+void ossimIgenGenerator::setInput(ossimConnectableObject* input)
+{
+   theSpecList.clear();
+   generateInputKwl(input);
+   ossimImageSource* inputInterface = PTR_CAST(ossimImageSource,
+                                                        input);
+   if(inputInterface)
+   {
+      theInputBoundingRect = inputInterface->getBoundingRect();
+   }
+}
+
+
+void ossimIgenGenerator::generateChainForMultiInput(ossimConnectableObject* connectable)
+{
+   std::stack<ossimConnectableObject*> aStack;
+
+   generateChainForMultiInputRecurse(aStack, connectable);
+
+   ossim_int32 objectIndex = 1;
+   while(!aStack.empty())
+   {
+      ossimConnectableObject* current = aStack.top();
+      aStack.pop();
+      ossimString prefix = ossimString("object") + ossimString::toString(objectIndex) + ".";
+
+      current->saveState(theInputKwl, prefix.c_str());
+
+      ++objectIndex;
+   }
+   theInputKwl.add("type",
+                   "ossimImageChain",
+                   true);
+   
+}
+
+void ossimIgenGenerator::generateChainForMultiInputRecurse(std::stack<ossimConnectableObject*>& aStack,
+                                                           ossimConnectableObject* connectable)
+{
+   
+
+   if(connectable)
+   {
+      aStack.push(connectable);
+      for(ossim_uint32 i = 0; i < connectable->getNumberOfInputs(); ++i)
+      {
+         generateChainForMultiInputRecurse(aStack,
+                                           connectable->getInput(i));
+      }
+   }   
+}
+
+
+ossimProjection* ossimIgenGenerator::createProductProjection()const
+{
+   return ossimProjectionFactoryRegistry::instance()->createProjection(theViewKwl);
+}
+
+ossimObject* ossimIgenGenerator::createOutput()const
+{
+   return ossimObjectFactoryRegistry::instance()->createObject(theOutputKwl);
+}
+
+ossimObject* ossimIgenGenerator::createInput()const
+{
+   return ossimObjectFactoryRegistry::instance()->createObject(theInputKwl);
+}
+
+void ossimIgenGenerator::generateInputKwl(ossimConnectableObject* connectable)
+{
+   theInputKwl.clear();
+   if(connectable)
+   {
+      // if it has at least one non null input
+      // then  we must build a chain and save it out
+      if(connectable->getInput())
+      {
+         generateChainForMultiInput(connectable);
+      }
+      else // it is a single input
+      {
+         connectable->saveState(theInputKwl);
+      }
+   }
+}
+
+void ossimIgenGenerator::generateOutputKwl(ossimConnectableObject* connectable)
+{
+   theOutputKwl.clear();
+   if(connectable)
+   {
+      connectable->saveState(theOutputKwl);
+   }
+}
+
+void ossimIgenGenerator::generateViewKwl(ossimObject* view)
+{
+   theViewKwl.clear();
+   if(view)
+   {
+      view->saveState(theViewKwl);
+   }
+}
+   
+void ossimIgenGenerator::setDefaultOutput()
+{
+   
+}
+
+void ossimIgenGenerator::generateTiledSpecList(bool outputToFileFlag)
+{
+   theSpecList.clear();
+   theSpecFileList.clear();
+   ossimDpt spacing = theTileSpacing;
+
+   switch(theTileSpacingUnits)
+   {
+      case OSSIM_MINUTES:
+      {
+         spacing.x /= 60;
+         spacing.y /= 60;
+         generateGeoTiledSpecList(spacing, outputToFileFlag);
+         break;
+      }
+      case OSSIM_SECONDS:
+      {
+         spacing.x /= 3600;
+         spacing.y /= 3600;
+         generateGeoTiledSpecList(spacing, outputToFileFlag);
+         break;
+      }
+      case OSSIM_DEGREES:
+      {
+         generateGeoTiledSpecList(spacing, outputToFileFlag);
+         break;
+      }
+      case OSSIM_PIXEL:
+      {
+         generatePixelTiledSpecList(outputToFileFlag);
+         break;
+      }
+      default:
+         break;
+   }
+}
+
+void ossimIgenGenerator::generatePixelTiledSpecList(bool outputToFileFlag)
+{
+   ossimRefPtr<ossimProjection> proj = createProductProjection();
+
+   if((!proj)||(theOutputGeoPolygon.size() != 4))
+   {
+      return;
+   }
+   
+   ossimIrect inputRect = getInputBoundingRect();
+   inputRect.stretchToTileBoundary(theTileSpacing);
+   ossimGeoPolygon tempPoly;
+   ossimObject* obj = createInput();
+   ossimImageChain* chain = PTR_CAST(ossimImageChain,
+                                     obj);
+   ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
+   chain->add(cutter);
+   
+   ossimKeywordlist kwl;
+   ossimFilename outfile = theOutputKwl.find(ossimKeywordNames::FILENAME_KW);
+   
+   if(outfile == "")
+   {
+      cerr << "Valid filename not given, returning!" << endl;
+   }
+   
+   kwl.add("object2.", theOutputKwl, true);
+   kwl.add("product.projection.",theViewKwl, true);
+   addPixelType(kwl, "product.");   
+   ossimDpt p1;
+   ossimDpt p2;
+   ossimDpt p3;
+   ossimDpt p4;
+
+   
+   proj->worldToLineSample(theOutputGeoPolygon[0], p1);
+   proj->worldToLineSample(theOutputGeoPolygon[1], p2);
+   proj->worldToLineSample(theOutputGeoPolygon[2], p3);
+   proj->worldToLineSample(theOutputGeoPolygon[3], p4);
+
+   ossimIrect bounds(p1, p2, p3, p4);
+   if(inputRect.completely_within(bounds))
+   {
+      inputRect = bounds;
+   }
+
+   bounds.stretchToTileBoundary(theTileSpacing);
+   
+   ossim_sint32 i = 1;
+   for(ossim_sint32 ulY = bounds.ul().y; ulY < bounds.lr().y; ulY+=(ossim_sint32)theTileSpacing.y)
+   {
+      for(ossim_sint32 ulX = bounds.ul().x; ulX < bounds.lr().x; ulX+=(ossim_sint32)theTileSpacing.x)
+      {
+         ossimDrect rect(ulX,
+                         ulY,
+                         ulX + (theTileSpacing.x - 1),
+                         ulY + (theTileSpacing.y - 1));
+         ossimGpt gpt1;
+         ossimGpt gpt2;
+         ossimGpt gpt3;
+         ossimGpt gpt4;
+
+         proj->lineSampleToWorld(rect.ul(), gpt1);
+         proj->lineSampleToWorld(rect.ur(), gpt2);
+         proj->lineSampleToWorld(rect.lr(), gpt3);
+         proj->lineSampleToWorld(rect.ll(), gpt4);
+         
+         tempPoly.clear();
+         tempPoly.addPoint(gpt1);
+         tempPoly.addPoint(gpt2);
+         tempPoly.addPoint(gpt3);
+         tempPoly.addPoint(gpt4);
+         addPadding(tempPoly, tempPoly);
+         cutter->setPolygon(tempPoly);
+         chain->saveState(kwl, "object1.");
+         
+         ossimFilename specName(theSpecFileLocation);
+         specName = specName.dirCat(ossimFilename("igen" + ossimString::toString(i) + ".spec"));
+         ossimFilename tilename = outfile.path();
+         if(theTileNamingConvention == "id")
+         {
+            int tileId = getTileId(inputRect, ossimDpt(ulX+theTileSpacing.x/2, ulY+theTileSpacing.y/2), theTileSpacing);
+            tilename = tilename.dirCat(ossimFilename(outfile.fileNoExtension() + "_" +
+                                                     ossimString::toString(tileId)));
+            tilename.setExtension(outfile.ext());
+         }
+         
+         kwl.add("object2.",
+                 ossimKeywordNames::FILENAME_KW,
+                 tilename,
+                 true);
+         kwl.add("object2.input_connection1",
+                 kwl.find("object1.id"),
+                 true);
+         theSpecFileList.push_back(specName);
+         if(outputToFileFlag)
+         {
+            kwl.write(specName.c_str());
+         }
+         else
+         {
+            theSpecList.push_back(kwl);
+         }
+         i++;
+      }
+   }
+}
+
+void ossimIgenGenerator::generateGeoTiledSpecList(const ossimDpt& spacing, bool outputToFileFlag)
+{
+   ossimRefPtr<ossimProjection> proj = createProductProjection();
+   if((proj.valid())&&(theOutputGeoPolygon.size() == 4))
+   {
+      ossimDrect rect;
+
+      ossimIrect inputRect = getInputBoundingRect();
+      ossimGpt gpt1;
+      ossimGpt gpt2;
+      ossimGpt gpt3;
+      ossimGpt gpt4;
+      proj->lineSampleToWorld(inputRect.ul(), gpt1);
+      proj->lineSampleToWorld(inputRect.ur(), gpt2);
+      proj->lineSampleToWorld(inputRect.lr(), gpt3);
+      proj->lineSampleToWorld(inputRect.ll(), gpt4);
+
+      ossimDrect inputGroundRect(gpt1,
+                                 gpt2,
+                                 gpt3,
+                                 gpt4,
+                                 OSSIM_RIGHT_HANDED);
+      
+      rect = ossimDrect(theOutputGeoPolygon[0],
+                        theOutputGeoPolygon[1],
+                        theOutputGeoPolygon[2],
+                        theOutputGeoPolygon[3],
+                        OSSIM_RIGHT_HANDED);
+
+      rect.stretchToTileBoundary(spacing);
+      inputGroundRect.stretchToTileBoundary(spacing);
+      double ulLat = rect.ul().lat;
+      double ulLon = rect.ul().lon;
+      ossimGeoPolygon tempPoly;
+      ossimObject* obj = createInput();
+      ossimImageChain* chain = PTR_CAST(ossimImageChain,
+                                        obj);
+      ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
+      chain->add(cutter);
+      
+      ossimKeywordlist kwl;
+      ossimFilename outfile = theOutputKwl.find(ossimKeywordNames::FILENAME_KW);
+
+      if(outfile == "")
+      {
+         cerr << "Valid filename not given, returning!" << endl;
+      }
+      
+      kwl.add("object2.", theOutputKwl, true);
+      kwl.add("object2.input_connection1",
+              kwl.find("object1.id"),
+              true);
+      kwl.add("product.projection.",theViewKwl, true);
+      addPixelType(kwl, "product.");   
+      int i = 1;
+      int row = 0;
+      int col = 0;
+      //      int tileId = 0;
+      while(ulLat > rect.ll().lat)
+      {
+         ulLon = rect.ul().lon;
+         col = 0;
+         while(ulLon < rect.ur().lon)
+         {
+            tempPoly.clear();
+            tempPoly.addPoint(ulLat, ulLon, ossim::nan(), theOutputGeoPolygon[0].datum());
+            tempPoly.addPoint(ulLat, ulLon+spacing.lon, ossim::nan(), theOutputGeoPolygon[0].datum());
+            tempPoly.addPoint(ulLat-spacing.lat, ulLon+spacing.lon, ossim::nan(), theOutputGeoPolygon[0].datum());
+            tempPoly.addPoint(ulLat-spacing.lat, ulLon, ossim::nan(), theOutputGeoPolygon[0].datum());
+            
+            addPadding(tempPoly, tempPoly);
+            cutter->setPolygon(tempPoly);
+            chain->saveState(kwl, "object1.");
+
+            ossimFilename specName(theSpecFileLocation);
+            specName = specName.dirCat(ossimFilename("igen" + ossimString::toString(i) + ".spec"));
+	    ossimFilename tilename = outfile.path();
+	    if(theTileNamingConvention == "id")
+	      {
+		int tileId = getTileId(inputGroundRect, ossimDpt(ulLon, ulLat), spacing);
+		tilename = tilename.dirCat(ossimFilename(outfile.fileNoExtension() + "_" +
+							 ossimString::toString(tileId)));
+		tilename.setExtension(outfile.ext());
+	      }
+	    else
+	      {
+                 ossimUsgsQuad quad(ossimGpt(ulLat - (spacing.x), ulLon+(spacing.x), 0.0));
+                 if(spacing.x == 7.5/60.0)
+                 {
+                    tilename = tilename.dirCat(ossimFilename(quad.quarterQuadName().downcase().trim()));
+                 }
+                 else
+                 {
+                    tilename = tilename.dirCat(ossimFilename(quad.quarterQuadSegName().downcase().trim()));
+                 }
+                 
+                 tilename.setExtension(outfile.ext());
+	      }
+
+	    kwl.add("object2.",
+		    ossimKeywordNames::FILENAME_KW,
+		    tilename,
+		    true);
+            kwl.add("object2.input_connection1",
+                    kwl.find("object1.id"),
+                    true);
+            theSpecFileList.push_back(specName);
+            if(outputToFileFlag)
+            {
+               kwl.write(specName.c_str());
+            }
+            else
+            {
+               theSpecList.push_back(kwl);
+            }
+            ulLon += spacing.lon;
+            ++i;
+            ++col;
+         }
+         ++row;
+         ulLat -= spacing.lat;
+      }
+
+   }   
+}
+
+
+void ossimIgenGenerator::generateNoTiledSpecList(bool outputToFileFlag)
+{
+   theSpecList.clear();
+   theSpecFileList.clear();
+   
+   if(theViewKwl.getSize()&&
+      theInputKwl.getSize()&&
+      theOutputKwl.getSize())
+   {
+      ossimKeywordlist kwl;
+      if(theOutputGeoPolygon.size())
+      {
+         ossimRefPtr<ossimObject> obj = createInput();
+         ossimRefPtr<ossimImageChain> chain = PTR_CAST(ossimImageChain,
+                                                       obj.get());
+         if(chain.valid())
+         {
+            ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
+            
+            cutter->setPolygon(theOutputGeoPolygon);
+            
+            chain->add(cutter);
+            chain->saveState(kwl, "object1.");
+         }
+         else
+         {
+            kwl.add("object1.",theInputKwl, true);
+         }
+         obj = 0;
+      }
+      else
+      {
+         kwl.add("object1.",theInputKwl, true);
+      }
+      kwl.add("object2.", theOutputKwl, true);
+      kwl.add("object2.input_connection1",
+              kwl.find("object1.id"),
+              true);
+      kwl.add("product.projection.",theViewKwl, true);
+      addPixelType(kwl, "product.");   
+
+      ossimFilename specName(theSpecFileLocation +
+                             "/"+
+                             "igen1.spec");
+      
+      theSpecFileList.push_back(specName);
+      if(outputToFileFlag)
+      {
+         kwl.write(specName.c_str());
+      }
+      else
+      {
+         theSpecList.push_back(kwl);
+      }
+      
+      kwl.clear();
+   }
+}
+
+int ossimIgenGenerator::getTileId(const ossimDrect& rect,
+				  const ossimDpt& currentPt,
+				  const ossimDpt& spacing)const
+{
+   ossimDpt ul(rect.ul());
+   
+   double relY = fabs(ul.y - currentPt.y);
+   double relX = fabs(ul.x - currentPt.x);
+   
+   
+   ossim_int32 spacingY           = (ossim_int32)(relY/spacing.y);
+   ossim_int32 spacingX           = (ossim_int32)(relX/spacing.x);
+   ossim_int32 maxHorizontalTiles = (ossim_int32)( (rect.width()-1)/spacing.x);
+   
+   return spacingY*maxHorizontalTiles + spacingX;
+}
+
+
+ossimIrect ossimIgenGenerator::getInputBoundingRect()const
+{
+   ossimRefPtr<ossimObject> obj = createInput();
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, obj.get());
+   ossimIrect result;
+
+   result.makeNan();
+   if(inter)
+   {
+      result = inter->getBoundingRect();
+   }
+   return result;
+}
+
+void ossimIgenGenerator::addPadding(ossimGeoPolygon& output,
+                                    const ossimGeoPolygon& input)const
+{
+   output = input;
+   switch(theTilePaddingUnits)
+   {
+      case OSSIM_PIXEL:
+      {
+         ossimRefPtr<ossimProjection> proj = createProductProjection();
+         if(proj.valid())
+         {
+            ossimDpt ul;
+            ossimDpt ur;
+            ossimDpt lr;
+            ossimDpt ll;
+
+            if(input.getOrdering() == OSSIM_CLOCKWISE_ORDER)
+            {
+               proj->worldToLineSample(input[0], ul);
+               proj->worldToLineSample(input[1], ur);
+               proj->worldToLineSample(input[2], lr);
+               proj->worldToLineSample(input[3], ll);
+            }
+            else
+            {
+               proj->worldToLineSample(input[0], ul);
+               proj->worldToLineSample(input[1], ll);
+               proj->worldToLineSample(input[2], lr);
+               proj->worldToLineSample(input[3], ur);
+            
+            }
+            
+            ul -= theTilePadding;
+            ur += ossimDpt(theTilePadding.x,
+                           -theTilePadding.y);
+            lr += theTilePadding;
+            ll += ossimDpt(-theTilePadding.x,
+                           theTilePadding.y);
+
+            proj->lineSampleToWorld(ul, output[0]);
+            proj->lineSampleToWorld(ur, output[1]);
+            proj->lineSampleToWorld(lr, output[2]);
+            proj->lineSampleToWorld(ll, output[3]);
+
+            output.setOrdering(OSSIM_CLOCKWISE_ORDER);
+         
+         }
+         break;
+      }
+      case OSSIM_DEGREES:
+      case OSSIM_MINUTES:
+      case OSSIM_SECONDS:
+      {
+         ossimGpt ul;
+         ossimGpt ur;
+         ossimGpt lr;
+         ossimGpt ll;
+         ossimDpt spacing = theTilePadding;
+
+         if(theTilePaddingUnits==OSSIM_MINUTES)
+         {
+            spacing.x /= 60;
+            spacing.y /= 60;
+         }
+         else if(theTilePaddingUnits==OSSIM_MINUTES)
+         {
+            spacing.x /= 3600;
+            spacing.y /= 3600;
+         }
+      
+         if(input.getOrdering() == OSSIM_CLOCKWISE_ORDER)
+         {
+            ul = input[0];
+            ur = input[1];
+            lr = input[2];
+            ll = input[3];
+         }
+         else
+         {
+            ul = input[0];
+            ll = input[1];
+            lr = input[2];
+            ur = input[3];
+         }
+         ul.lat += spacing.lat;
+         ul.lon -= spacing.lon;
+         ur.lat += spacing.lat;
+         ur.lon += spacing.lon;
+         lr.lat -= spacing.lat;
+         lr.lon += spacing.lon;
+         ll.lat -= spacing.lat;
+         ll.lon -= spacing.lon;
+
+         output[0] = ul;
+         output[1] = ur;
+         output[2] = lr;
+         output[3] = ll;
+         output.setOrdering(OSSIM_CLOCKWISE_ORDER);
+      
+         break;
+      }
+      case OSSIM_METERS:
+      {
+         break;
+      }
+      default:
+         break;
+   }
+}
+
+void ossimIgenGenerator::addPixelType(ossimKeywordlist& kwl, const char* prefix)
+{
+   if(thePixelType == OSSIM_PIXEL_IS_POINT)
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::PIXEL_TYPE_KW,
+              "PIXEL_IS_POINT",
+              true);
+   }
+   else
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::PIXEL_TYPE_KW,
+              "PIXEL_IS_AREA",
+              true);
+   }
+}
+
+void ossimIgenGenerator::setOutput(const ossimKeywordlist& kwl)
+{
+   theOutputKwl.clear();
+
+   theOutputKwl = kwl;
+}
diff --git a/src/imaging/ossimImageCacheBase.cpp b/src/imaging/ossimImageCacheBase.cpp
new file mode 100644
index 0000000..bb25c55
--- /dev/null
+++ b/src/imaging/ossimImageCacheBase.cpp
@@ -0,0 +1,661 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Mingjie Su
+//
+//********************************************************************
+// $Id: ossimImageCacheBase.cpp 2685 2011-06-07 16:24:41Z david.burken $
+#include <algorithm>
+using namespace std;
+
+#include <ossim/imaging/ossimImageCacheBase.h>
+
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimNBandLutDataObject.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimRpfFrame.h>
+#include <ossim/support_data/ossimRpfToc.h>
+#include <ossim/support_data/ossimRpfTocEntry.h>
+#include <ossim/support_data/ossimRpfCompressionSection.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimCylEquAreaProjection.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimPolygon.h>
+
+static ossimTrace traceDebug = ossimTrace("ossimImageCacheBase:debug");
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimImageCacheBase.cpp 2685 2011-06-07 16:24:41Z david.burken $";
+#endif
+
+RTTI_DEF1(ossimImageCacheBase, "ossimImageCacheBase", ossimImageHandler)
+
+ossimImageCacheBase::ossimImageCacheBase()
+   :
+   ossimImageHandler(),
+   m_actualImageRect(),
+   m_numberOfLines(0),
+   m_numberOfSamples(0),
+   m_numberOfBands(0),
+   m_fileNames(),
+   m_tileSize(128, 128),
+   m_workFrame(new ossimRpfFrame),
+   m_bBox_LL_Lon(0.0),
+   m_bBox_LL_Lat(0.0),
+   m_bBox_UR_Lon(0.0),
+   m_bBox_UR_Lat(0.0),
+   m_numOfFramesVertical(0),
+   m_numOfFramesHorizontal(0),
+   m_frame_width(0),
+   m_frame_height(0),
+   m_frameEntryArray()
+{
+  if (traceDebug())
+  {
+    ossimNotify(ossimNotifyLevel_DEBUG)
+      << "ossimImageCacheBase::ossimImageCacheBase entered...\n";
+#ifdef OSSIM_ID_ENABLED
+    ossimNotify(ossimNotifyLevel_DEBUG)
+      << "OSSIM_ID:  " << OSSIM_ID << "\n";
+#endif      
+  }
+
+  m_actualImageRect.makeNan();
+
+}
+
+ossimImageCacheBase::~ossimImageCacheBase()
+{
+  if(m_workFrame)
+  {
+    delete m_workFrame;
+    m_workFrame = 0;
+  }
+  close();
+}
+
+void ossimImageCacheBase::close()
+{
+  deleteAll();
+}
+
+bool ossimImageCacheBase::isOpen()const
+{
+  //return (theTableOfContents!=0);
+  ossimString ext = theImageFile.ext().downcase();
+
+  if(ext == "rpf")
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool ossimImageCacheBase::buildFrameEntryArray(ossimFilename imageFile, 
+                                               ossim_uint32 frameWidth, 
+                                               ossim_uint32 frameHeight)
+{
+   static const char MODULE[] = "ossimImageCacheBase::buildFrameEntryArray";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
+   }
+
+   // use to check if tiles have overlap pixels
+   ossim_float64 avgLat = 0.0;
+   ossim_float64 avgLon = 0.0;
+
+   m_frame_width = frameWidth;
+   m_frame_height = frameHeight;
+
+   std::ifstream in((imageFile).c_str() );
+   
+   std::string line;
+   ossim_uint32 index = 0; // used throughout
+   while( in.good() )
+   {
+      // Read in a line.
+      std::getline(in, line);
+
+      ossimString tmpStr = ossimString(line);
+      if (!tmpStr.empty())
+      {
+         if (index == 0)
+         {
+            std::vector<ossimString> box_lat_lon;
+            tmpStr.split(box_lat_lon, "|");
+            
+            if (box_lat_lon.size() > 2)
+            {
+               std::vector<ossimString> ll;
+               std::vector<ossimString> ur;
+               
+               box_lat_lon[0].split(ll, ",");
+               box_lat_lon[1].split(ur, ",");
+               ossimString bandStr = box_lat_lon[2];
+               
+               m_bBox_LL_Lon = ll[0].toFloat64();
+               m_bBox_LL_Lat = ll[1].toFloat64();
+               m_bBox_UR_Lon = ur[0].toFloat64();
+               m_bBox_UR_Lat = ur[1].toFloat64();
+               
+               checkLongitude(m_bBox_LL_Lon, m_bBox_UR_Lon);
+               
+               m_numberOfBands = ossimString(bandStr).toInt32();
+            }
+            else
+            {
+               return false;
+            }
+         }
+         else if (index == 1)
+         {
+            m_fileNames.push_back(tmpStr);
+            std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
+            if (frame_lat_lon.size() > 2)
+            {
+               ossimString ll_lon_lat = frame_lat_lon[1];
+               ossimString ur_lon_lat = frame_lat_lon[2];
+               ossim_float64 ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
+               ossim_float64 ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
+               ossim_float64 ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
+               ossim_float64 ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
+
+               checkLongitude(ll_lon, ur_lon);
+               
+               ossim_float64 bBox_lat_diff = std::fabs(m_bBox_UR_Lat - m_bBox_LL_Lat);
+               ossim_float64 bBox_lon_diff = std::fabs(m_bBox_UR_Lon - m_bBox_LL_Lon);
+               
+               ossim_float64 lat_diff = std::fabs(ur_lat - ll_lat);
+               ossim_float64 lon_diff = std::fabs(ur_lon - ll_lon);
+               
+               m_numOfFramesVertical   = static_cast<ossim_uint32>(bBox_lat_diff/lat_diff + 0.5);
+               m_numOfFramesHorizontal = static_cast<ossim_uint32>(bBox_lon_diff/lon_diff + 0.5);
+
+               avgLon = std::fabs(bBox_lon_diff/m_numOfFramesHorizontal);
+               avgLat = std::fabs(bBox_lat_diff/m_numOfFramesVertical);
+               
+               m_numberOfLines   = m_numOfFramesVertical*m_frame_height;
+               m_numberOfSamples = m_numOfFramesHorizontal*m_frame_width;
+
+               if ( traceDebug() )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "\nscene height in degrees: " << bBox_lat_diff
+                     << "\nscene width in degrees:  " << bBox_lon_diff
+                     << "\nframe height in degrees: " << lat_diff
+                     << "\nframe width in degrees:  " << lon_diff
+                     << "\nframes vertical:         " << m_numOfFramesVertical
+                     << "\nframes horizontal:       " << m_numOfFramesHorizontal
+                     << "\nlines:                   " << m_numberOfLines
+                     << "\nsamples:                 " << m_numberOfSamples << "\n";
+               }
+            }
+            else
+            {
+               return false;
+            }
+         }
+         else
+         {
+            m_fileNames.push_back(tmpStr);
+         }
+         
+      } // matches: if (!tmpStr.empty())
+      
+      ++index;
+      
+   } // matches: while( in.good() )
+   in.close();
+
+   m_frameEntryArray.resize(m_numOfFramesVertical);
+   for(index = 0; index < m_frameEntryArray.size(); ++index)
+   {
+      m_frameEntryArray[index].resize(m_numOfFramesHorizontal);
+   }
+
+   for(index = 0; index < m_fileNames.size(); ++index)
+   {
+      ossimString tmpStr = m_fileNames[index];
+      std::vector<ossimString> frameInfos = tmpStr.split("|");
+      if (frameInfos.size() > 1)
+      {
+         ossimString fileName = frameInfos[0];
+         ossimString ll_lon_lat = frameInfos[1];
+         ossimString ur_lon_lat = frameInfos[2];
+         double ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
+         double ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
+         double ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
+         double ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
+         
+         checkLongitude(ll_lon, ur_lon);
+         
+         ossim_float64 tmpColPostion = std::fabs(ll_lon - m_bBox_LL_Lon);
+         ossim_float64 tmpFrameLon = std::fabs(ur_lon - ll_lon);
+
+         if (std::fabs(tmpFrameLon - avgLon) > 0.002)
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << fileName << " has overlap pixels with other image." << std::endl;
+            return false;
+         }
+         
+         ossim_float64 tmpRowPostion = std::fabs(m_bBox_UR_Lat - ur_lat);
+         ossim_float64 tmpFrameLat = std::fabs(ur_lat - ll_lat);
+
+         if (std::fabs(tmpFrameLat - avgLat) > 0.002)
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << fileName << " has overlap pixels with other image." << std::endl;
+            return false;
+         }
+         
+         ossim_uint32 colNum = static_cast<ossim_uint32>(tmpColPostion/tmpFrameLon + 0.5);
+         ossim_uint32 rowNum = static_cast<ossim_uint32>(tmpRowPostion/tmpFrameLat + 0.5);
+         
+         if (colNum >= m_numOfFramesHorizontal)
+         {
+            colNum = m_numOfFramesHorizontal-1; // Clamp to last column.
+         }
+         
+         if (rowNum >= m_numOfFramesVertical)
+         {
+            rowNum = m_numOfFramesVertical-1; // Clamp to last row.
+         }
+
+         ossimRpfFrameEntry tempEntry;
+         tempEntry.setEntry(ossimFilename(""), fileName);
+         m_frameEntryArray[rowNum][colNum] = tempEntry;
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+void ossimImageCacheBase::checkLongitude(ossim_float64& leftLon,
+                                             const ossim_float64& rightLon) const
+{
+   //---
+   // Test for scene coordinates being 180 to 180 and adjust leftLon to -180
+   // if so.
+   //
+   // NOTE:
+   // Setting tolerance to 1/7200 about 15 meters.
+   // Not sure if this is too loose or not. (drb)
+   //---
+   const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
+
+   if ( ossim::almostEqual(leftLon, 180.0, TOLERANCE) )
+   {
+      if ( ossim::almostEqual(rightLon, 180.0, TOLERANCE) )
+      {
+         leftLon = -180.0;
+      }
+   }
+}
+
+ossim_uint32 ossimImageCacheBase::getNumberOfInputBands()const
+{
+   return m_numberOfBands;
+}
+
+ossim_uint32 ossimImageCacheBase::getNumberOfOutputBands()const
+{
+  return m_numberOfBands;
+}
+
+ossim_uint32 ossimImageCacheBase::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return m_numberOfLines;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfLines(reduced_res_level);
+   }
+   
+   return 0;
+}
+
+ossim_uint32 ossimImageCacheBase::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return m_numberOfSamples;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfSamples(reduced_res_level);
+   }
+   
+   return 0;
+}
+
+void ossimImageCacheBase::setActualImageRect()
+{
+   m_actualImageRect = ossimIrect(0,0,m_numberOfLines, m_numberOfSamples);
+}
+
+ossimIrect ossimImageCacheBase::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return ossimIrect(0,                         // upper left x
+                     0,                         // upper left y
+                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
+                     getNumberOfLines(reduced_res_level)   - 1); // lower right y                     
+}
+
+
+
+ossim_uint32 ossimImageCacheBase::getTileWidth() const
+{
+   return m_tileSize.x;
+}
+
+ossim_uint32 ossimImageCacheBase::getTileHeight() const
+{
+   return m_tileSize.y;
+}
+
+void ossimImageCacheBase::getEntryList(std::vector<ossim_uint32>& entryList)const
+{
+   entryList.push_back(0);
+}
+
+bool ossimImageCacheBase::isValidRLevel(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return true;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->isValidRLevel(reduced_res_level);
+   }
+   else
+   {
+      return false;
+   }
+}
+
+vector<ossimImageCacheBase::ossimFrameEntryData> ossimImageCacheBase::getIntersectingEntries(const ossimIrect& rect)
+{
+   vector<ossimFrameEntryData> result;
+
+   // make sure we have the Toc entry to render
+   if(!isOpen()) return result;
+
+   ossimIrect imageRect = getImageRectangle();
+   if(rect.intersects(imageRect))
+   {
+      ossimIrect clipRect  = rect.clipToRect(imageRect);
+      ossimIrect frameRect(clipRect.ul().x/m_frame_width,
+                           clipRect.ul().y/m_frame_height,
+                           clipRect.lr().x/m_frame_width,
+                           clipRect.lr().y/m_frame_height);
+
+      for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
+      {
+         for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
+         {
+            ossimRpfFrameEntry tempEntry = m_frameEntryArray[row][col];
+            if(tempEntry.exists())
+            {
+               result.push_back(ossimFrameEntryData(row,
+                                                    col,
+                                                    row*m_frame_height,
+                                                    col*m_frame_width,
+                                                    tempEntry));
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+void ossimImageCacheBase::deleteAll()
+{
+   theOverview = 0;
+}
+
+bool ossimImageCacheBase::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)const
+{
+   bool result = ossimImageHandler::saveState(kwl, prefix);
+
+   return result;
+}
+
+bool ossimImageCacheBase::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   const char* MODULE = "ossimImageCacheBase::loadState";
+
+   if(traceDebug())
+   {
+      CLOG << "Entering..." << endl;
+   }
+   bool result = ossimImageHandler::loadState(kwl, prefix);
+
+   if(!result)
+   {
+      if(traceDebug())
+      {
+         CLOG << "Leaving..." << endl;
+      }
+      return false;
+   }
+   const char* lookup = 0;
+   lookup = kwl.find(ossimString(prefix), "entry");
+   ossim_int32 entry = ossimString(lookup).toInt32();
+
+   // if an entry is specified then
+   // call the open with an entry number
+   if(lookup)
+   {
+      if(traceDebug())
+      {
+         CLOG << "Leaving..." << endl;
+      }
+      result = ossimImageHandler::open(theImageFile);
+      setCurrentEntry(entry);
+      return result;
+   }
+
+   result = ossimImageHandler::open(theImageFile);
+
+   return result;
+}
+
+ossim_uint32 ossimImageCacheBase::getImageTileWidth() const
+{
+   return 256;
+}
+
+ossim_uint32 ossimImageCacheBase::getImageTileHeight() const
+{
+   return 256;
+}
+
+void ossimImageCacheBase::establishDecimationFactors()
+{
+   theDecimationFactors.clear();
+   
+   // Just needed to set the first R level here, the base class can do the rest:
+   ossimImageHandler::establishDecimationFactors();
+}
+
+ossimRefPtr<ossimImageGeometry> ossimImageCacheBase::getImageGeometry()
+{
+   if (theGeometry.valid()) return theGeometry;
+
+   // datum
+   // WGS 84
+   ossimKeywordlist kwl;
+   const char* prefix = 0; // legacy
+   kwl.add(prefix,
+      ossimKeywordNames::DATUM_KW,
+      "WGE",
+      true);   
+
+   ossimGpt ul(m_bBox_UR_Lat,m_bBox_LL_Lon);
+   ossimGpt ll(m_bBox_LL_Lat,m_bBox_LL_Lon);
+   ossimGpt ur(m_bBox_UR_Lat,m_bBox_UR_Lon);
+   ossimGpt lr(m_bBox_LL_Lat,m_bBox_UR_Lon);
+
+   double latInterval = fabs(ul.latd() - lr.latd())/ getNumberOfLines();
+   double lonInterval = fabs(ul.lond() - ur.lond())/ getNumberOfSamples();
+
+   kwl.add(prefix,
+      ossimKeywordNames::UL_LAT_KW,
+      ul.latd(),//-(latInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::UL_LON_KW,
+      ul.lond(),//+(lonInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::LL_LAT_KW,
+      ll.latd(),//+(latInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::LL_LON_KW,
+      ll.lond(),//+(lonInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::LR_LAT_KW,
+      lr.latd(),//+(latInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::LR_LON_KW,
+      lr.lond(),//-(lonInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::UR_LAT_KW,
+      ur.latd(),//-(latInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::UR_LON_KW,
+      ur.lond(),//-(latInterval/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::NUMBER_INPUT_BANDS_KW,
+      getNumberOfInputBands(),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
+      getNumberOfOutputBands(),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::NUMBER_LINES_KW,
+      getNumberOfLines(),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::NUMBER_SAMPLES_KW,
+      getNumberOfSamples(),
+      true);
+
+
+   //---
+   // Make a projection to get the easting / northing of the tie point and
+   // the scale in meters.  This will only be used by the CIB.
+   //---
+   kwl.add(prefix,
+      ossimKeywordNames::DATUM_KW,
+      "WGE",
+      true);
+
+   ossimGpt origin((ul.latd()+lr.latd())*.5,
+      (ul.lond()+lr.lond())*.5,
+      0.0);
+
+   double deltaLatPerPixel = latInterval;
+   double deltaLonPerPixel = lonInterval;
+
+   ossimDpt tie;
+
+   tie.lat = ul.latd() - deltaLatPerPixel/2.0;
+   tie.lon = ul.lond() + deltaLonPerPixel/2.0;
+
+   kwl.add(prefix, 
+      ossimKeywordNames::TIE_POINT_XY_KW,
+      tie.toString(),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+      deltaLatPerPixel,
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+      deltaLonPerPixel,
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::ORIGIN_LATITUDE_KW,
+      origin.latd(),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::CENTRAL_MERIDIAN_KW,
+      origin.lond(),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::TIE_POINT_LAT_KW,
+      ul.latd()-(deltaLatPerPixel/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::TIE_POINT_LON_KW,
+      ul.lond()+(deltaLonPerPixel/2.0),
+      true);
+
+   kwl.add(prefix,
+      ossimKeywordNames::TYPE_KW,
+      "ossimEquDistCylProjection",
+      true);
+
+   // Capture this for next time.
+   theGeometry = new ossimImageGeometry;
+   theGeometry->loadState(kwl, prefix);
+
+   // Set image things the geometry object should know about.
+   initImageParameters( theGeometry.get() ); 
+
+   return theGeometry;
+}
+
diff --git a/src/imaging/ossimImageCacheTileSource.cpp b/src/imaging/ossimImageCacheTileSource.cpp
new file mode 100644
index 0000000..0449bef
--- /dev/null
+++ b/src/imaging/ossimImageCacheTileSource.cpp
@@ -0,0 +1,437 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Mingjie Su   
+//
+//********************************************************************
+// $Id: ossimImageCacheTileSource.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+#include <algorithm>
+using namespace std;
+
+#include <ossim/imaging/ossimImageCacheTileSource.h>
+
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimNBandLutDataObject.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimRpfFrame.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimPolygon.h>
+
+static ossimTrace traceDebug = ossimTrace("ossimImageCacheTileSource:debug");
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimImageCacheTileSource.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $";
+#endif
+
+RTTI_DEF1(ossimImageCacheTileSource, "ossimImageCacheTileSource", ossimImageCacheBase)
+
+ossimImageCacheTileSource::ossimImageCacheTileSource()
+   :
+   ossimImageCacheBase(),
+   m_tile(0),
+   m_imageHandler(0),
+   m_minPixelValue(ossim::nan()),
+   m_maxPixelValue(ossim::nan()),
+   m_nullPixelValue(ossim::nan())
+{
+}
+
+ossimImageCacheTileSource::~ossimImageCacheTileSource()
+{
+   if(m_imageHandler.valid())
+   {
+      m_imageHandler = 0;
+   }
+  close();
+}
+
+ossimString ossimImageCacheTileSource::getShortName()const
+{
+  return ossimString("ImageCache");
+}
+
+ossimString ossimImageCacheTileSource::getLongName()const
+{
+  return ossimString("ImageCache reader");
+}
+
+
+void ossimImageCacheTileSource::close()
+{
+  deleteAll();
+}
+
+bool ossimImageCacheTileSource::open()
+{
+  if(traceDebug())
+  {
+    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageCacheTileSource::open(): Entered....." << std::endl;
+  }
+
+  ossimFilename imageFile = theImageFile;
+  bool result = true;
+
+  if(isOpen() == false)
+  {
+    close();
+    result = false;
+  }
+
+  if(result)
+  {
+    if (m_fileNames.size() == 0 && m_frameEntryArray.size() == 0)
+    {
+      if (buildFrameEntryArray(imageFile) == false)
+      {
+        return false;
+      }
+    }
+
+    //---
+    // Adjust image rect so not to go over the -180 to 180 and -90 to 90
+    // bounds.
+    //---
+    setActualImageRect();
+
+    // Set the base class image file name.
+    theImageFile = imageFile;
+    m_tile = ossimImageDataFactory::instance()->create(this, this);
+    m_tile->initialize();
+    completeOpen();
+  }
+
+  if(traceDebug())
+  {
+    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageCacheTileSource::open(): Leaving at line" << __LINE__ << std::endl;
+  }
+
+  return result;
+}
+
+bool ossimImageCacheTileSource::buildFrameEntryArray(ossimFilename imageFile)
+{
+   static const char MODULE[] = "ossimImageCacheTileSource::buildFrameEntryArray";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
+   }
+
+   std::ifstream in((imageFile).c_str() );
+   std::string line;
+   ossim_uint32 index = 0; // used throughout
+   ossim_uint32 frameWidth = 0;
+   ossim_uint32 frameHeight = 0;
+   while( in.good() )
+   {
+      // Read in a line.
+      std::getline(in, line);
+      ossimString tmpStr = ossimString(line);
+      if (index == 0)
+      {
+         std::vector<ossimString> box_lat_lon;
+         tmpStr.split(box_lat_lon, "|");
+         if (box_lat_lon.size() == 4)
+         {
+            std::vector<ossimString> pixelInfos = box_lat_lon[3].split(",");
+            if (pixelInfos.size() == 3)
+            {
+               m_minPixelValue = ossimString::toFloat64(pixelInfos[0]);
+               m_maxPixelValue = ossimString::toFloat64(pixelInfos[1]);
+               m_nullPixelValue = ossimString::toFloat64(pixelInfos[2]);
+            }
+         }
+      }
+      else if (index == 1)
+      {
+         std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
+         ossimFilename firstFile = frame_lat_lon[0];
+         if(m_workFrame->parseFile(firstFile) == ossimErrorCodes::OSSIM_ERROR)
+         {
+            m_imageHandler = ossimImageHandlerRegistry::instance()->open(firstFile);
+            if (m_imageHandler.valid())
+            {
+               frameWidth = m_imageHandler->getBoundingRect().width();
+               frameHeight = m_imageHandler->getBoundingRect().height();
+               break;
+            }
+         }
+         else
+         {
+            return false;
+         }
+      }
+      ++index;
+   }
+   in.close();
+
+   return ossimImageCacheBase::buildFrameEntryArray(imageFile, frameWidth, frameHeight);
+}
+
+ossimRefPtr<ossimImageData> ossimImageCacheTileSource::getTile(
+  const  ossimIrect& rect, ossim_uint32 resLevel)
+{
+  if (m_tile.valid())
+  {
+    // Image rectangle must be set prior to calling getTile.
+    m_tile->setImageRectangle(rect);
+
+    if ( getTile( m_tile.get(), resLevel ) == false )
+    {
+      if (m_tile->getDataObjectStatus() != OSSIM_NULL)
+      {
+        m_tile->makeBlank();
+      }
+    }
+  }
+
+  return m_tile;
+}
+
+bool ossimImageCacheTileSource::getTile(ossimImageData* result,
+                                      ossim_uint32 resLevel)
+{
+   bool status = false;
+   
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()))
+   {
+      if ( resLevel > 0 )
+      {
+         status = getOverviewTile(resLevel, result);
+      }
+      
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+         
+         ossimIrect rect = result->getImageRectangle();
+         
+         ossimIrect imageRect = getImageRectangle();
+         
+         if ( rect.intersects(imageRect) )
+         {
+            //---
+            // Start with a blank tile in case there is not total coverage
+            // for rect.
+            //---
+            result->makeBlank();
+            
+            vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
+            if(frames.size() > 0)
+            {
+               //---
+               // Now lets render each frame.  Note we will have to find
+               // subframes
+               // that intersect the rectangle of interest for each frame.
+               //---
+               fillTile(rect, frames, result);
+               
+               // Revalidate tile status.
+               result->validate();
+            }
+         }
+         else
+         {
+            result->makeBlank();
+         }
+      }
+   }
+   return status;
+}
+
+void ossimImageCacheTileSource::fillTile(
+   const ossimIrect& tileRect,
+   const vector<ossimFrameEntryData>& framesInvolved,
+   ossimImageData* tile)
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < framesInvolved.size(); ++idx)
+   {
+      if (m_imageHandler.valid())
+      {
+         if (m_imageHandler->getFilename() != framesInvolved[idx].theFrameEntry.getFullPath())
+         {
+            m_imageHandler = 0;
+            m_imageHandler = ossimImageHandlerRegistry::instance()->open(framesInvolved[idx].theFrameEntry.getFullPath());
+         }
+      }
+      else
+      {
+         m_imageHandler = ossimImageHandlerRegistry::instance()->open(framesInvolved[idx].theFrameEntry.getFullPath());
+      }
+
+      if (m_imageHandler.valid())
+      {
+         if (m_imageHandler->isOpen() == false)
+         {
+            m_imageHandler->open(framesInvolved[idx].theFrameEntry.getFullPath());
+         }
+
+         ossimIrect frameRect(framesInvolved[idx].thePixelCol,
+            framesInvolved[idx].thePixelRow,
+            framesInvolved[idx].thePixelCol + m_frame_width  - 1,
+            framesInvolved[idx].thePixelRow + m_frame_height - 1);
+
+         ossimIrect clipRect = tileRect.clipToRect(frameRect);
+
+         ossimIpt tempDelta(clipRect.ul().x - framesInvolved[idx].thePixelCol,
+            clipRect.ul().y - framesInvolved[idx].thePixelRow);
+
+         ossimIrect offsetRect(tempDelta.x,
+            tempDelta.y,
+            tempDelta.x + clipRect.width()-1,
+            tempDelta.y + clipRect.height()-1);
+
+         //if the current image size is different from the default size, resample the image data
+         if ( ( m_imageHandler->getBoundingRect().width() != m_frame_width ) ||
+              ( m_imageHandler->getBoundingRect().height() != m_frame_height ) )
+         {
+
+            //calculate the ratio
+            ossim_float64 widthRatio = static_cast<ossim_float64>(m_imageHandler->getBoundingRect().width())/static_cast<ossim_float64>(m_frame_width);
+            ossim_float64 heightRatio = static_cast<ossim_float64>(m_imageHandler->getBoundingRect().height())/static_cast<ossim_float64>(m_frame_height);
+
+            //initialize the rect bounding for getting image data from image handler
+            ossimDpt ul(offsetRect.ul().x*widthRatio, offsetRect.ul().y*heightRatio);
+            ossimDpt lr(offsetRect.lr().x*widthRatio, offsetRect.lr().y*heightRatio);
+
+            //---
+            // Floor, ceil to avoid rect size of zero from ul, lr, delta being only fractional
+            // resulting in size of 0 if cast to an int or passed to ossim<int>::round().
+            //---
+            ossimIrect actualOffsetRect(static_cast<ossim_int32>(std::floor(ul.x)),
+                                        static_cast<ossim_int32>(std::floor(ul.y)),
+                                        static_cast<ossim_int32>(std::ceil(lr.x)),
+                                        static_cast<ossim_int32>(std::ceil(lr.y)));
+
+            //get accurate rect in case the actual rect is larger than the rect of image 
+            actualOffsetRect = actualOffsetRect.clipToRect(m_imageHandler->getBoundingRect());
+            
+            ossimRefPtr<ossimImageData> imageData = m_imageHandler->getTile(actualOffsetRect);
+            if (imageData.valid())
+            {
+               ossimFilterResampler* resampler = new ossimFilterResampler();
+               
+               double denominatorY = 1.0;
+               double denominatorX = 1.0;
+               if(clipRect.height() > 2) // Cannot be zero.
+               {
+                  denominatorY = clipRect.height()-1.0;
+               }
+               if(clipRect.width() > 2) // Cannot be zero.
+               {
+                  denominatorX = clipRect.width()-1.0;
+               }
+
+               //create a tile and set the rect size
+               ossimRefPtr<ossimImageData> tmpTile = (ossimImageData*)imageData->dup();
+               tmpTile->setImageRectangle(offsetRect);
+               tmpTile->makeBlank();
+
+               ossimDpt deltaUl(((actualOffsetRect.ll().x - actualOffsetRect.ul().x)/denominatorX),
+                                ((actualOffsetRect.ll().y - actualOffsetRect.ul().y)/denominatorY));
+               ossimDpt deltaUr(((actualOffsetRect.lr().x - actualOffsetRect.ur().x)/denominatorX),
+                                ((actualOffsetRect.lr().y - actualOffsetRect.ur().y)/denominatorY));
+               ossimDpt length(offsetRect.width(),offsetRect.height());
+               
+               //resample the image data
+               resampler->resample(imageData, 
+                                   tmpTile,
+                                   actualOffsetRect.ul(),
+                                   actualOffsetRect.ur(),
+                                   deltaUl,
+                                   deltaUr,
+                                   length);
+
+               tile->loadTile(tmpTile->getBuf(), clipRect, OSSIM_BSQ);
+
+               tmpTile = 0;
+               delete resampler;
+               resampler = 0;
+            }
+         }
+         else
+         {
+            ossimRefPtr<ossimImageData> imageData = m_imageHandler->getTile(offsetRect);
+            if (imageData.valid())
+            {
+               tile->loadTile(imageData->getBuf(), clipRect, OSSIM_BSQ);
+            }
+         }
+      }
+   }
+}
+
+ossimScalarType ossimImageCacheTileSource::getOutputScalarType() const
+{
+   if (m_imageHandler.valid())
+   {
+      return m_imageHandler->getOutputScalarType();
+   }
+   return OSSIM_UCHAR;
+}
+
+double ossimImageCacheTileSource::getMinPixelValue(ossim_uint32 band)const
+{
+   if (ossim::isnan(m_minPixelValue))
+   {
+      return ossimImageHandler::getMinPixelValue(band);
+   }
+   return m_minPixelValue;
+}
+
+double ossimImageCacheTileSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   if (ossim::isnan(m_maxPixelValue))
+   {
+      return ossimImageHandler::getMaxPixelValue(band);
+   }
+   return m_maxPixelValue;
+}
+
+double ossimImageCacheTileSource::getNullPixelValue(ossim_uint32 band)const
+{
+   if (ossim::isnan(m_nullPixelValue))
+   {
+      return ossimImageHandler::getNullPixelValue(band);
+   }
+   return m_nullPixelValue;
+}
+
+ossim_uint32 ossimImageCacheTileSource::getNumberOfInputBands()const
+{
+   if (m_imageHandler.valid())
+   {
+      return m_imageHandler->getNumberOfInputBands();
+   }
+   return m_numberOfBands;
+}
+
+ossim_uint32 ossimImageCacheTileSource::getNumberOfOutputBands()const
+{
+   if (m_imageHandler.valid())
+   {
+      return m_imageHandler->getNumberOfInputBands();
+   }
+   return m_numberOfBands;
+}
diff --git a/src/imaging/ossimImageChain.cpp b/src/imaging/ossimImageChain.cpp
new file mode 100644
index 0000000..2c4f900
--- /dev/null
+++ b/src/imaging/ossimImageChain.cpp
@@ -0,0 +1,1835 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageChain.cpp 21850 2012-10-21 20:09:55Z dburken $
+
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimConnectableContainer.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimEventIds.h>
+#include <ossim/base/ossimObjectEvents.h>
+#include <ossim/base/ossimIdManager.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <algorithm>
+#include <iostream>
+#include <iterator>
+
+static ossimTrace traceDebug("ossimImageChain");
+
+
+RTTI_DEF3(ossimImageChain, "ossimImageChain", ossimImageSource,
+          ossimConnectableObjectListener, ossimConnectableContainerInterface);
+
+void ossimImageChain::processEvent(ossimEvent& event)
+{
+   ossimConnectableObjectListener::processEvent(event);
+   ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject, event.getCurrentObject());
+   
+   if((ossimConnectableObject*)getFirstSource() == obj)
+   {
+      if(event.isPropagatingToOutputs())
+      {
+         ossimConnectableObject::ConnectableObjectList& outputList = getOutputList();
+         ossim_uint32 idx = 0;
+         for(idx = 0; idx < outputList.size();++idx)
+         {
+            if(outputList[idx].valid())
+            {
+               outputList[idx]->fireEvent(event);
+               outputList[idx]->propagateEventToOutputs(event);
+            }
+         }
+      }
+   }
+}
+
+ossimImageChain::ossimImageChain()
+:ossimImageSource(0,
+                  0, // number of inputs
+                  0, // number of outputs
+                  false, // input's fixed
+                  false), // outputs are not fixed
+    ossimConnectableContainerInterface((ossimObject*)NULL),
+    theBlankTile(NULL),
+    theLoadStateFlag(false)
+{
+   ossimConnectableContainerInterface::theBaseObject = this;
+   //thePropagateEventFlag = false;
+   addListener((ossimConnectableObjectListener*)this);
+}
+
+ossimImageChain::~ossimImageChain()
+{
+   removeListener((ossimConnectableObjectListener*)this);
+   deleteList();
+}
+
+bool ossimImageChain::addFirst(ossimConnectableObject* obj)
+{
+   ossimConnectableObject* rightOfThisObj =
+      (ossimConnectableObject*)getFirstObject();
+
+   return insertRight(obj, rightOfThisObj);
+}
+
+bool ossimImageChain::addLast(ossimConnectableObject* obj)
+{
+   if(imageChainList().size() > 0)
+   {
+      ossimConnectableObject* lastSource = imageChainList()[ imageChainList().size() -1].get();
+//      if(dynamic_cast<ossimImageSource*>(obj)&&lastSource)
+      if(lastSource)
+      {
+//         obj->disconnect();
+         ossimConnectableObject::ConnectableObjectList tempIn = getInputList();
+         lastSource->disconnectAllInputs();
+         lastSource->connectMyInputTo(obj);
+         obj->changeOwner(this);
+         obj->connectInputList(tempIn);
+
+         tempIn = obj->getInputList();
+         theInputListIsFixedFlag = obj->getInputListIsFixedFlag();
+         setNumberOfInputs(obj->getNumberOfInputs());
+         imageChainList().push_back(obj);
+         
+         obj->addListener((ossimConnectableObjectListener*)this);
+         // Send an event to any listeners.
+         ossimContainerEvent event((ossimObject*)this,
+                                   OSSIM_EVENT_ADD_OBJECT_ID);
+         event.setObjectList(obj);
+         fireEvent(event);
+         return true;
+      }
+   }
+   else
+   {
+      return add(obj);
+   }
+
+   return false;;
+}
+
+ossimImageSource* ossimImageChain::getFirstSource()
+{
+   if(imageChainList().size()>0)
+   {
+      return dynamic_cast<ossimImageSource*>(imageChainList()[0].get());
+   }
+
+   return 0;
+}
+
+const ossimImageSource* ossimImageChain::getFirstSource() const
+{
+   if(imageChainList().size()>0)
+      return dynamic_cast<const ossimImageSource*>(imageChainList()[0].get());
+
+   return 0;
+}
+
+ossimObject* ossimImageChain::getFirstObject()
+{
+   if(imageChainList().size()>0)
+   {
+      return dynamic_cast<ossimImageSource*>(imageChainList()[0].get());
+   }
+
+   return 0;
+}
+
+ossimImageSource* ossimImageChain::getLastSource()
+{
+   if(imageChainList().size()>0)
+   {
+      return dynamic_cast<ossimImageSource*>((*(imageChainList().end()-1)).get());
+   }
+
+   return NULL;
+}
+
+const ossimImageSource* ossimImageChain::getLastSource() const
+{
+   if(imageChainList().size()>0)
+      return dynamic_cast<const ossimImageSource*>((*(imageChainList().end()-1)).get());
+
+   return NULL;
+}
+
+ossimObject* ossimImageChain::getLastObject()
+{
+   if(imageChainList().size()>0)
+   {
+      return dynamic_cast<ossimImageSource*>((*(imageChainList().end()-1)).get());
+   }
+
+   return 0;
+}
+
+ossimConnectableObject* ossimImageChain::findObject(const ossimId& id,
+                                                    bool /* recurse */)
+{
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      if((*current).get())
+      {
+         if(id == (*current)->getId())
+         {
+            return (*current).get();
+         }
+      }
+      
+      ++current;
+   }
+   
+   current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface,
+                                                         (*current).get());
+      
+      if(child)
+      {
+         ossimConnectableObject* object = child->findObject(id, true);
+
+         if(object) return object;
+      }
+      ++current;
+   }
+   
+   return NULL;
+}
+
+ossimConnectableObject* ossimImageChain::findObject(const ossimConnectableObject* obj,
+                                                    bool /* recurse */)
+{
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      if((*current).valid())
+      {
+         if(obj == (*current).get())
+         {
+            return (*current).get();
+         }
+      }
+      
+      ++current;
+   }
+   
+   current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
+      
+      if(child)
+      {
+         ossimConnectableObject* object = child->findObject(obj, true);
+
+         if(object) return object;
+      }
+      ++current;
+   }
+   
+   return 0;
+}
+
+ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const RTTItypeid& typeInfo,
+                                                               bool recurse)
+{
+   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      if((*current).valid()&&
+         (*current)->canCastTo(typeInfo))
+      {
+         return (*current).get();
+      }
+      ++current;
+   }
+
+   if(recurse)
+   {
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
+      {
+         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, 
+                                                            (*current).get());
+         
+         if(child)
+         {
+            ossimConnectableObject* temp = child->findFirstObjectOfType(typeInfo, recurse);
+            if(temp)
+            {
+               return temp;
+            }
+         }
+         ++current;
+      }
+   }
+   
+   return (ossimConnectableObject*)NULL;   
+}
+
+ossimConnectableObject* ossimImageChain::findFirstObjectOfType(const ossimString& className,
+                                                               bool recurse)
+{
+   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      if((*current).valid()&&
+         (*current)->canCastTo(className) )
+      {
+         return (*current).get();
+      }
+      ++current;
+   }
+
+   if(recurse)
+   {
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
+      {
+         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
+         
+         if(child)
+         {
+            ossimConnectableObject* temp = child->findFirstObjectOfType(className, recurse);
+            if(temp)
+            {
+               return temp;
+            }
+         }
+         ++current;
+      }
+   }
+   
+   return (ossimConnectableObject*)0;   
+}
+
+ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfType(const RTTItypeid& typeInfo,
+                                                                           bool recurse)
+{
+   ossimConnectableObject::ConnectableObjectList result;
+   ossimConnectableObject::ConnectableObjectList::iterator current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      if((*current).valid()&&
+         (*current)->canCastTo(typeInfo))
+      {
+         ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), 
+                                                                                      result.end(), 
+                                                                                      (*current).get());
+         if(iter == result.end())
+         {
+            result.push_back((*current).get());
+         }
+      }
+      ++current;
+   }
+
+   if(recurse)
+   {
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
+      {
+         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
+         
+         if(child)
+         {
+            ossimConnectableObject::ConnectableObjectList temp;
+            temp = child->findAllObjectsOfType(typeInfo, recurse);
+            for(long index=0; index < (long)temp.size();++index)
+            {
+               ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), temp[index]);
+               if(iter == result.end())
+               {
+                  result.push_back(temp[index]);
+               }
+            }
+         }
+         ++current;
+      }
+   }
+   
+   return result;
+   
+}
+
+ossimConnectableObject::ConnectableObjectList ossimImageChain::findAllObjectsOfType(const ossimString& className,
+                                                                           bool recurse)
+{
+   ossimConnectableObject::ConnectableObjectList result;
+   ossimConnectableObject::ConnectableObjectList::iterator current =  imageChainList().begin();
+   
+   while(current != imageChainList().end())
+   {
+      if((*current).valid()&&
+         (*current)->canCastTo(className))
+      {
+         ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), 
+                                                                         result.end(), 
+                                                                         (*current).get());
+         if(iter == result.end())
+         {
+            result.push_back((*current).get());
+         }
+      }
+      ++current;
+   }
+
+   if(recurse)
+   {
+      current =  imageChainList().begin();
+      while(current != imageChainList().end())
+      {
+         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, (*current).get());
+         
+         if(child)
+         {
+            ossimConnectableObject::ConnectableObjectList temp;
+            temp = child->findAllObjectsOfType(className, recurse);
+            for(long index=0; index < (long)temp.size();++index)
+            {
+               ossimConnectableObject::ConnectableObjectList::iterator iter = std::find(result.begin(), result.end(), temp[index]);
+               if(iter == result.end())
+               {
+                  result.push_back(temp[index]);
+               }
+            }
+         }
+         ++current;
+      }
+   }
+   
+   return result;
+   
+}
+
+void ossimImageChain::makeUniqueIds()
+{
+   setId(ossimIdManager::instance()->generateId());
+   for(long index = 0; index < (long)imageChainList().size(); ++index)
+   {
+      ossimConnectableContainerInterface* container = PTR_CAST(ossimConnectableContainerInterface,
+                                                               imageChainList()[index].get());
+      if(container)
+      {
+         container->makeUniqueIds();
+      }
+      else
+      {
+         if(imageChainList()[index].valid())
+         {
+            imageChainList()[index]->setId(ossimIdManager::instance()->generateId());
+         }
+      }
+   }
+}
+
+ossim_uint32 ossimImageChain::getNumberOfObjects(bool recurse)const
+{
+   ossim_uint32 result = (ossim_uint32)imageChainList().size();
+   
+   if(recurse)
+   {
+      for(ossim_uint32 i = 0; i < imageChainList().size(); ++i)
+      {
+         ossimConnectableContainerInterface* child=PTR_CAST(ossimConnectableContainerInterface, imageChainList()[i].get());
+         if(child)
+         {
+            result += child->getNumberOfObjects(true);
+         }
+      }
+   }
+   
+   return result;   
+}
+
+ossim_uint32 ossimImageChain::getNumberOfSources() const
+{
+   ossimNotify(ossimNotifyLevel_NOTICE)
+      << "ossimImageChain::getNumberOfSources is deprecated!"
+      << "\nUse: ossimImageChain::getNumberOfObjects(false)"
+      << std::endl;
+   return getNumberOfObjects(false);
+}
+
+bool ossimImageChain::addChild(ossimConnectableObject* object)
+{
+   return add(object);
+}
+
+bool ossimImageChain::removeChild(ossimConnectableObject* object)
+{
+   bool result = false;
+   vector<ossimRefPtr<ossimConnectableObject> >::iterator current =  std::find(imageChainList().begin(), imageChainList().end(), object);
+   
+   
+   if(current!=imageChainList().end())
+   {
+      result = true;
+      object->removeListener((ossimConnectableObjectListener*)this);
+      if(current == imageChainList().begin())
+      {
+         object->removeListener((ossimConnectableObjectListener*)this);
+      }
+      if(imageChainList().size() == 1)
+      {
+         object->changeOwner(0);
+         current = imageChainList().erase(current);
+      }
+      else 
+      {
+         ossimConnectableObject::ConnectableObjectList input  = object->getInputList();
+         ossimConnectableObject::ConnectableObjectList output = object->getOutputList();
+         object->changeOwner(0);// set the owner to 0
+         bool erasingBeginning = (current == imageChainList().begin());
+         // bool erasingEnd = (current+1) == imageChainList().end();
+         current = imageChainList().erase(current);
+         object->disconnect();
+         
+         if(!imageChainList().empty())
+         {
+            if(erasingBeginning) // the one that receives the first getTile
+            {
+               (*imageChainList().begin())->addListener(this);
+            }
+            
+            else if(current==imageChainList().end()) // one that receives the last getTIle
+            {
+               current = imageChainList().begin()+(imageChainList().size()-1);
+               (*current)->connectInputList(input);
+               theInputObjectList = (*current)->getInputList();
+               theInputListIsFixedFlag = (*current)->getInputListIsFixedFlag();
+            }
+            else
+            {
+               // prepare interior setup and removal and connect surrounding nodes
+               // take the  outputs of the node we are removing and connect them to the old inputs 
+               ossim_uint32 outIndex = 0;
+               for(outIndex = 0; outIndex < output.size();++outIndex)
+               {
+                  output[outIndex]->connectInputList(input);
+               }
+            }
+         }
+      }
+
+      // Send an event to any listeners.
+      ossimContainerEvent event((ossimObject*)this,
+                                OSSIM_EVENT_REMOVE_OBJECT_ID);
+      event.setObjectList(object);
+      fireEvent(event);
+   }
+   
+   return result;
+}
+
+ossimConnectableObject* ossimImageChain::removeChild(const ossimId& id)
+{
+   ossimIdVisitor visitor( id,
+                           (ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS ) );
+   accept( visitor );
+   ossimConnectableObject* obj = visitor.getObject();
+   if ( obj )
+   {
+      removeChild(obj);
+   }
+   return obj;
+}
+
+void ossimImageChain::getChildren(vector<ossimConnectableObject*>& children,
+                                  bool immediateChildrenOnlyFlag)
+{
+   ossim_uint32 i = 0;
+   
+   vector<ossimConnectableObject*> temp;
+   for(i = 0; i < imageChainList().size();++i)
+   {
+      temp.push_back(imageChainList()[i].get());
+   }
+
+   for(i = 0; i < temp.size();++i)
+   {
+      ossimConnectableContainerInterface* interface = PTR_CAST(ossimConnectableContainerInterface,
+                                                               temp[i]);
+      if(immediateChildrenOnlyFlag)
+      {
+         children.push_back(temp[i]);
+      }
+      else if(!interface)
+      {
+         children.push_back(temp[i]);         
+      }
+   }
+   
+   if(!immediateChildrenOnlyFlag)
+   {
+      for(i = 0; i < temp.size();++i)
+      {
+         ossimConnectableContainerInterface* interface = PTR_CAST(ossimConnectableContainerInterface,
+                                                                  temp[i]);
+         if(interface)
+         {
+            interface->getChildren(children, false);
+         }
+      }
+   }
+}
+
+bool ossimImageChain::add(ossimConnectableObject* source)
+{
+   bool result = false;
+//   if(PTR_CAST(ossimImageSource, source))
+   {
+     source->changeOwner(this);
+     if(imageChainList().size() > 0)
+     {
+        source->disconnectAllOutputs();
+        theOutputListIsFixedFlag = source->getOutputListIsFixedFlag();
+        imageChainList()[0]->removeListener(this);
+        imageChainList().insert(imageChainList().begin(), source);
+        imageChainList()[0]->addListener(this);
+        source->addListener((ossimConnectableObjectListener*)this);
+        imageChainList()[0]->connectMyInputTo(imageChainList()[1].get());
+        result = true;
+     }
+     else
+     {
+        theInputListIsFixedFlag = false;
+        theOutputListIsFixedFlag = false;
+        
+        if(!theInputObjectList.empty())
+        {
+           source->connectInputList(getInputList());
+        }
+        theInputObjectList = source->getInputList();
+        theInputListIsFixedFlag = source->getInputListIsFixedFlag();
+     //   theOutputObjectList     = source->getOutputList();
+     //   theOutputListIsFixedFlag= source->getOutputListIsFixedFlag();
+        imageChainList().push_back(source);
+        source->addListener((ossimConnectableObjectListener*)this);
+        source->addListener(this);
+        result = true;
+     }
+   }
+
+   if (result && source)
+   {
+      ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
+      event.setObjectList(source);
+      fireEvent(event);
+   }
+   
+   return result;
+}
+
+bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
+                                  ossimConnectableObject* rightOfThisObj)
+{
+   if(!newObj&&!rightOfThisObj) return false;
+   if(!imageChainList().size())
+   {
+      return add(newObj);
+   }
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(imageChainList().begin(), imageChainList().end(), rightOfThisObj);
+   
+   if(iter!=imageChainList().end())
+   {
+      if(iter == imageChainList().begin())
+      {
+         return add(newObj);
+      }
+      else //if(PTR_CAST(ossimImageSource, newObj))
+      {
+         ossimConnectableObject::ConnectableObjectList outputList = rightOfThisObj->getOutputList();
+         rightOfThisObj->disconnectAllOutputs();
+
+         // Core dump fix.  Connect input prior to outputs. (drb)
+         newObj->connectMyInputTo(rightOfThisObj); 
+         newObj->connectOutputList(outputList);
+         newObj->changeOwner(this);
+         newObj->addListener((ossimConnectableObjectListener*)this);
+         imageChainList().insert(iter, newObj);
+         // Send event to any listeners.
+         ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
+         event.setObjectList(newObj);
+         fireEvent(event);
+         return true;
+      }
+   }
+
+   return false;
+}
+
+bool ossimImageChain::insertRight(ossimConnectableObject* newObj,
+                                  const ossimId& id)
+{
+
+#if 1
+   ossimIdVisitor visitor( id, ossimVisitor::VISIT_CHILDREN );
+   accept( visitor );
+   ossimConnectableObject* obj = visitor.getObject();
+   if ( obj )
+   {
+      return insertRight(newObj, obj);
+   }
+   return false;
+#else
+   ossimConnectableObject* obj = findObject(id, false);
+   if(obj)
+   {
+      return insertRight(newObj, obj);
+   }
+
+   return false;
+#endif
+}
+
+bool ossimImageChain::insertLeft(ossimConnectableObject* newObj,
+                                 ossimConnectableObject* leftOfThisObj)
+{
+   if(!newObj&&!leftOfThisObj) return false;
+   if(!imageChainList().size())
+   {
+      return add(newObj);
+   }
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator iter = std::find(imageChainList().begin(), imageChainList().end(), leftOfThisObj);
+   if(iter!=imageChainList().end())
+   {
+      if((iter+1)==imageChainList().end())
+      {
+         return addLast(newObj);
+      }
+      else
+      {
+         ossimConnectableObject::ConnectableObjectList inputList = leftOfThisObj->getInputList();
+         
+         newObj->connectInputList(inputList);
+         
+         leftOfThisObj->disconnectAllInputs();
+         leftOfThisObj->connectMyInputTo(newObj);
+         newObj->changeOwner(this);
+         newObj->addListener((ossimConnectableObjectListener*)this);
+         imageChainList().insert(iter+1, newObj);
+         // Send an event to any listeners.
+         ossimContainerEvent event(this, OSSIM_EVENT_ADD_OBJECT_ID);
+         event.setObjectList(newObj);
+         fireEvent(event);
+         return true;
+      }
+   }
+
+   return false;
+}
+
+bool ossimImageChain::insertLeft(ossimConnectableObject* newObj,
+                                 const ossimId& id)
+{
+#if 1
+   ossimIdVisitor visitor( id,
+                           ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+   accept( visitor );
+   ossimConnectableObject* obj = visitor.getObject();
+   if ( obj )
+   {
+      return insertLeft(newObj, obj);
+   }
+   return false;
+#else
+   ossimConnectableObject* obj = findObject(id, false);
+   if(obj)
+   {
+      return insertLeft(newObj, obj);
+   }
+   return false;
+#endif   
+}
+
+bool ossimImageChain::replace(ossimConnectableObject* newObj,
+                              ossimConnectableObject* oldObj)
+{
+   ossim_int32 idx = indexOf(oldObj);
+   if(idx >= 0)
+   {
+      ossimConnectableObject::ConnectableObjectList& inputList  = oldObj->getInputList();
+      ossimConnectableObject::ConnectableObjectList& outputList = oldObj->getOutputList();
+      oldObj->removeListener((ossimConnectableObjectListener*)this);
+      oldObj->removeListener(this);
+      oldObj->changeOwner(0);
+      imageChainList()[idx] = newObj;
+      newObj->connectInputList(inputList);
+      newObj->connectOutputList(outputList);
+      newObj->changeOwner(this);
+      newObj->addListener((ossimConnectableObjectListener*)this);
+      if(idx == 0)
+      {
+         newObj->addListener(this);
+      }
+   }
+   
+   return (idx >= 0);
+}
+
+ossimRefPtr<ossimImageData> ossimImageChain::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* inputSource = PTR_CAST(ossimImageSource,
+                                             imageChainList()[0].get());
+      
+      if(inputSource)
+      {
+         // make sure we initialize in reverse order.
+         // some source may depend on the initialization of
+         // its inputs
+         return inputSource->getTile(tileRect, resLevel);
+      }  
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* inputSource = PTR_CAST(ossimImageSource, getInput(0));
+         if(inputSource)
+         {
+            ossimRefPtr<ossimImageData> inputTile = inputSource->getTile(tileRect, resLevel);
+//            if(inputTile.valid())
+//            {
+//               std::cout << *(inputTile.get()) << std::endl;
+//            }
+            return inputTile.get();
+         }
+      }
+   }
+//   std::cout << "RETURNING A BLANK TILE!!!!" << std::endl;
+/*
+   if(theBlankTile.get())
+   {
+      theBlankTile->setImageRectangle(tileRect);
+   }
+   return theBlankTile;
+ */
+   return 0;
+}
+
+ossim_uint32 ossimImageChain::getNumberOfInputBands() const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+      if(interface)
+      {
+         return interface->getNumberOfOutputBands();
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getNumberOfOutputBands();
+         }
+      }
+   }
+
+   return 0;
+}
+
+double ossimImageChain::getNullPixelValue(ossim_uint32 band)const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+      if(interface)
+      {
+         return interface->getNullPixelValue(band);
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getNullPixelValue(band);
+         }
+      }
+   }
+   
+   return ossim::defaultNull(getOutputScalarType());
+}
+
+double ossimImageChain::getMinPixelValue(ossim_uint32 band)const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+      if(interface)
+      {
+         return interface->getMinPixelValue(band);
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getMinPixelValue(band);
+         }
+      }
+   }
+
+   return ossim::defaultMin(getOutputScalarType());
+}
+
+double ossimImageChain::getMaxPixelValue(ossim_uint32 band)const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                                  imageChainList()[0].get());
+      if(inter)
+      {
+         return inter->getMaxPixelValue(band);
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getMaxPixelValue(band);
+         }
+      }
+   }
+
+   return ossim::defaultMax(getOutputScalarType());
+}
+
+void ossimImageChain::getOutputBandList(std::vector<ossim_uint32>& bandList) const
+{
+   if( (imageChainList().size() > 0) && isSourceEnabled() )
+   {
+      ossimRefPtr<const ossimImageSource> inter =
+         dynamic_cast<const ossimImageSource*>( imageChainList()[0].get() );
+      if( inter.valid() )
+      {
+         // cout << "cn: " << inter->getClassName() << endl;
+         inter->getOutputBandList(bandList);
+      }
+   }
+}
+   
+ossimScalarType ossimImageChain::getOutputScalarType() const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+      if(interface)
+      {
+         return interface->getOutputScalarType();
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getOutputScalarType();
+         }
+      }
+   }
+   
+   return OSSIM_SCALAR_UNKNOWN;
+}
+
+ossim_uint32 ossimImageChain::getTileWidth()const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         imageChainList()[0].get());
+         if(interface)
+         {
+            return interface->getTileWidth();;
+         }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getTileWidth();
+         }
+      }
+   }
+   
+   return 0;   
+}
+
+ossim_uint32 ossimImageChain::getTileHeight()const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         imageChainList()[0].get());
+         if(interface)
+         {
+            return interface->getTileHeight();
+         }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getTileHeight();
+         }
+      }
+   }
+   
+   return 0;   
+}
+   
+ossimIrect ossimImageChain::getBoundingRect(ossim_uint32 resLevel)const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+
+      if(interface)
+      {
+         return interface->getBoundingRect(resLevel);
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getBoundingRect();
+         }
+      }
+   }
+   ossimDrect rect;
+   rect.makeNan();
+   
+   return rect;
+   
+}
+
+void ossimImageChain::getValidImageVertices(vector<ossimIpt>& validVertices,
+                                            ossimVertexOrdering ordering,
+                                            ossim_uint32 resLevel)const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface =PTR_CAST(ossimImageSource,
+                                                     imageChainList()[0].get());
+
+      if(interface)
+      {
+         interface->getValidImageVertices(validVertices,
+                                          ordering,
+                                          resLevel);
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            interface->getValidImageVertices(validVertices,
+                                             ordering,
+                                             resLevel);
+         }
+      }
+   }
+}
+
+ossimRefPtr<ossimImageGeometry> ossimImageChain::getImageGeometry()
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource, imageChainList()[0].get());
+      if( interface )
+      {
+         return interface->getImageGeometry();
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource, getInput(0));
+         if(interface)
+         {
+            return interface->getImageGeometry();
+         }
+      }
+   }
+   return ossimRefPtr<ossimImageGeometry>();
+}
+
+void ossimImageChain::getDecimationFactor(ossim_uint32 resLevel,
+                                          ossimDpt& result) const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+      if(interface)
+      {
+         interface->getDecimationFactor(resLevel,
+                                        result);
+         return;
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            interface->getDecimationFactor(resLevel, result);
+            return;
+         }
+      }
+   }
+
+   result.makeNan();
+}
+
+void ossimImageChain::getDecimationFactors(vector<ossimDpt>& decimations) const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+      if(interface)
+      {
+         interface->getDecimationFactors(decimations);
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            interface->getDecimationFactors(decimations);
+            return;
+         }
+      }
+   }
+}
+
+ossim_uint32 ossimImageChain::getNumberOfDecimationLevels()const
+{
+   if((imageChainList().size() > 0)&&(isSourceEnabled()))
+   {
+      ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                      imageChainList()[0].get());
+
+      if(interface)
+      {
+         return interface->getNumberOfDecimationLevels();
+      }
+   }
+   else
+   {
+      if(getInput(0))
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource,
+                                                         getInput(0));
+         if(interface)
+         {
+            return interface->getNumberOfDecimationLevels();
+         }
+      }
+   }
+
+   return 1;
+}
+
+bool ossimImageChain::addAllSources(map<ossimId, vector<ossimId> >& idMapping,
+                                    const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   static const char* MODULE = "ossimImageChain::addAllSources";
+   ossimString copyPrefix = prefix;
+   bool result =  ossimImageSource::loadState(kwl, copyPrefix.c_str());
+
+   if(!result)
+   {
+      return result;
+   }
+   long index = 0;
+
+//   ossimSource* source = NULL;
+
+   vector<ossimId> inputConnectionIds;
+   ossimString regExpression =  ossimString("^(") + copyPrefix + "object[0-9]+.)";
+   vector<ossimString> keys =
+      kwl.getSubstringKeyList( regExpression );
+   long numberOfSources = (long)keys.size();//kwl.getNumberOfSubstringKeys(regExpression);
+
+   int offset = (int)(copyPrefix+"object").size();
+   int idx = 0;
+   std::vector<int> theNumberList(numberOfSources);
+   for(idx = 0; idx < (int)theNumberList.size();++idx)
+     {
+       ossimString numberStr(keys[idx].begin() + offset,
+			     keys[idx].end());
+       theNumberList[idx] = numberStr.toInt();
+     }
+   std::sort(theNumberList.begin(), theNumberList.end());
+   for(idx=0;idx < (int)theNumberList.size();++idx)
+   {
+      ossimString newPrefix = copyPrefix;
+      newPrefix += ossimString("object");
+      newPrefix += ossimString::toString(theNumberList[idx]);
+      newPrefix += ossimString(".");
+
+      if(traceDebug())
+      {
+         CLOG << "trying to create source with prefix: " << newPrefix
+              << std::endl;
+      }
+      ossimRefPtr<ossimObject> object = ossimObjectFactoryRegistry::instance()->createObject(kwl,
+                                                                                 newPrefix.c_str());
+      ossimConnectableObject* source = PTR_CAST(ossimConnectableObject, object.get());
+      
+      if(source)
+      {
+         // we did find a source so include it in the count
+         if(traceDebug())
+         {
+            CLOG << "Created source with prefix: " << newPrefix << std::endl;
+         }
+         //if(PTR_CAST(ossimImageSource, source))
+         {
+            ossimId id = source->getId();
+            inputConnectionIds.clear();
+            
+            findInputConnectionIds(inputConnectionIds,
+                                   kwl,
+                                   newPrefix);
+            if(inputConnectionIds.size() == 0)
+            {
+               // we will try to do a default connection
+               //
+               
+               if(imageChainList().size())
+               {
+                  if(traceDebug())
+                  {
+                     CLOG << "connecting " << source->getClassName() << " to "
+                          << imageChainList()[0]->getClassName() << std::endl;
+                  }
+                  source->connectMyInputTo(0, imageChainList()[0].get());
+               }
+            }
+            else
+            {
+               // we remember the connection id's so we can connect this later.
+               // this way we make sure all sources were actually
+               // allocated.
+               //
+               idMapping.insert(std::make_pair(id, inputConnectionIds));
+            }
+            add(source);
+         }
+      //   else
+      //   {
+            source = 0;
+      //   }
+      }
+      else
+      {
+         object = 0;
+         source = 0;
+      }
+      
+      ++index;
+   }
+   if(imageChainList().size())
+   {
+     ossimConnectableObject* obj = imageChainList()[(ossim_int32)imageChainList().size()-1].get();
+     if(obj)
+     {
+        setNumberOfInputs(obj->getNumberOfInputs());
+     }
+   }
+   
+   return result;
+}
+
+void ossimImageChain::findInputConnectionIds(vector<ossimId>& result,
+                                             const ossimKeywordlist& kwl,
+                                             const char* prefix)
+{
+   ossimString copyPrefix = prefix;
+   ossim_uint32 idx = 0;
+   
+   ossimString regExpression =  ossimString("^") + ossimString(prefix) + "input_connection[0-9]+";
+   vector<ossimString> keys =
+      kwl.getSubstringKeyList( regExpression );
+   
+   ossim_int32 offset = (ossim_int32)(copyPrefix+"input_connection").size();
+   ossim_uint32 numberOfKeys = (ossim_uint32)keys.size();
+   std::vector<int> theNumberList(numberOfKeys);
+   for(idx = 0; idx < theNumberList.size();++idx)
+   {
+      ossimString numberStr(keys[idx].begin() + offset,
+                            keys[idx].end());
+      theNumberList[idx] = numberStr.toInt();
+   }
+   std::sort(theNumberList.begin(), theNumberList.end());
+   copyPrefix += ossimString("input_connection");
+   for(idx=0;idx < theNumberList.size();++idx)
+   {
+      const char* lookup = kwl.find(copyPrefix,ossimString::toString(theNumberList[idx]));
+      if(lookup)
+      {
+         long id = ossimString(lookup).toLong();
+         result.push_back(ossimId(id));
+      }
+   }
+}
+                    
+
+bool ossimImageChain::connectAllSources(const map<ossimId, vector<ossimId> >& idMapping)
+{
+   // cout << "this->getId(): " << this->getId() << endl;
+   
+   if(idMapping.size())
+   {
+      map<ossimId, vector<ossimId> >::const_iterator iter = idMapping.begin();
+
+      
+      while(iter != idMapping.end())
+      {
+         // cout << "(*iter).first): " << (*iter).first << endl;
+#if 0
+         ossimConnectableObject* currentSource = findObject((*iter).first);
+#else
+         ossimIdVisitor visitor( (*iter).first,
+                                 (ossimVisitor::VISIT_CHILDREN ) );
+                                  // ossimVisitor::VISIT_INPUTS ) );
+         accept( visitor );
+         ossimConnectableObject* currentSource = visitor.getObject();
+#endif
+
+         if(currentSource)
+         {
+            // cout << "currentSource->getClassName: " << currentSource->getClassName() << endl;
+            long upperBound = (long)(*iter).second.size();
+            for(long index = 0; index < upperBound; ++index)
+            {
+               //cout << "(*iter).second[index]: " << (*iter).second[index] << endl;
+               
+               if((*iter).second[index].getId() > -1)
+               {
+#if 0
+                  ossimConnectableObject* inputSource =
+                      PTR_CAST(ossimConnectableObject, findObject((*iter).second[index]));
+#else
+                  visitor.reset();
+                  visitor.setId( (*iter).second[index] );
+                  accept( visitor );
+                  ossimConnectableObject* inputSource = visitor.getObject();
+#endif
+                  // cout << "inputSource is " << (inputSource?"good...":"null...") << endl;
+                  if ( inputSource )
+                  {
+                     // cout << "inputSource->getClassName(): " << inputSource->getClassName() << endl;
+ 
+                     // Check for connection to self.
+                     if ( this != inputSource )
+                     {
+                        currentSource->connectMyInputTo(index, inputSource);
+                     }
+                     // else warning???
+                  }
+               }
+               else // -1 id
+               {
+                  currentSource->disconnectMyInput((ossim_int32)index);
+               }
+            }
+         }
+         else
+         {
+            cerr << "Could not find " << (*iter).first << " for source: ";
+            return false;
+         }
+         ++iter;
+      }
+   }
+
+   // abort();
+   return true;
+}
+
+bool ossimImageChain::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   bool result = true;
+   
+   result = ossimImageSource::saveState(kwl, prefix);
+
+   if(!result)
+   {
+      return result;
+   }
+   ossim_uint32 upper = (ossim_uint32)imageChainList().size();
+   ossim_uint32 counter = 1;
+
+   if (upper)
+   {
+      ossim_int32 idx = upper-1;
+      // start with the tail and go to the head fo the list.
+      for(;((idx >= 0)&&result);--idx, ++counter)
+      {
+         ossimString newPrefix = prefix;
+         
+         newPrefix += (ossimString("object") +
+                       ossimString::toString(counter) +
+                       ossimString("."));
+         result = imageChainList()[idx]->saveState(kwl, newPrefix.c_str());
+      }
+   }
+
+   return result;
+}
+
+bool ossimImageChain::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   static const char* MODULE = "ossimImageChain::loadState(kwl, prefix)";
+   deleteList();
+
+   ossimImageSource::loadState(kwl, prefix);
+   
+   
+   theLoadStateFlag = true;
+   bool result = true;
+   
+   map<ossimId, vector<ossimId> > idMapping;
+   result = addAllSources(idMapping, kwl, prefix);
+   if(!result)
+   {
+      CLOG << "problems adding sources" << std::endl;
+   }
+   result = connectAllSources(idMapping);
+   if(!result)
+   {
+      CLOG << "problems connecting sources" << std::endl;
+   }
+   
+   theLoadStateFlag = false;
+   return result;
+}
+
+
+void ossimImageChain::initialize()
+{
+   static const char* MODULE = "ossimImageChain::initialize()";
+   if (traceDebug()) CLOG << " Entered..." << std::endl;
+   
+   long upper = (ossim_uint32)imageChainList().size();
+   
+   for(long index = upper - 1; index >= 0; --index)
+   {
+      if(traceDebug())
+      {
+         CLOG << "initilizing source: "
+              << imageChainList()[index]->getClassName()
+              << std::endl;
+      }
+      if(imageChainList()[index].valid())
+      {
+         ossimSource* interface =
+            PTR_CAST(ossimSource, imageChainList()[index].get());
+
+         if(interface)
+         {
+            // make sure we initialize in reverse order.
+            // some source may depend on the initialization of
+            // its inputs
+            interface->initialize();
+         }
+      }
+   }
+   if (traceDebug()) CLOG << " Exited..." << std::endl;
+}
+
+void ossimImageChain::enableSource()
+{
+   ossim_int32 upper = static_cast<ossim_int32>(imageChainList().size());
+   ossim_int32 index = 0;
+   for(index = upper - 1; index >= 0; --index)
+   {
+      // make sure we initialize in reverse order.
+      // some source may depend on the initialization of
+      // its inputs
+     ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
+     if(source)
+     {
+        source->enableSource();
+     }
+   }
+   
+   theEnableFlag = true;
+}
+
+void ossimImageChain::disableSource()
+{
+   long upper = (ossim_uint32)imageChainList().size();
+   
+   for(long index = upper - 1; index >= 0; --index)
+   {
+      // make sure we initialize in reverse order.
+      // some source may depend on the initialization of
+      // its inputs
+     ossimSource* source = PTR_CAST(ossimSource, imageChainList()[index].get());
+     if(source)
+     {
+        source->disableSource();
+     }
+   }
+   
+   theEnableFlag = false;
+}
+
+void ossimImageChain::prepareForRemoval(ossimConnectableObject* connectableObject)
+{
+   if(connectableObject)
+   {
+      connectableObject->removeListener((ossimConnectableObjectListener*)this);
+      connectableObject->changeOwner(0);
+      connectableObject->disconnect();   
+   }
+}
+
+bool ossimImageChain::deleteFirst()
+{
+   if (imageChainList().size() == 0) return false;
+
+   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
+   prepareForRemoval(imageChainList()[0].get());
+   // Clear any listeners, memory.
+   event.setObjectList(imageChainList()[0].get());
+   imageChainList()[0] = 0;
+   // Remove from the vector.
+   std::vector<ossimRefPtr<ossimConnectableObject> >::iterator i = imageChainList().begin();
+   imageChainList().erase(i);
+   fireEvent(event);
+   return true;
+}
+
+bool ossimImageChain::deleteLast()
+{
+   if (imageChainList().size() == 0) return false;
+
+   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
+  // Clear any listeners, memory.
+   ossim_uint32 idx = (ossim_uint32)imageChainList().size() - 1;
+   prepareForRemoval(imageChainList()[idx].get());
+   event.setObjectList(imageChainList()[idx].get());
+   imageChainList()[idx] = 0;
+   // Remove from the vector.
+   imageChainList().pop_back();
+   fireEvent(event);
+   return true; 
+}
+
+void ossimImageChain::deleteList()
+{
+   ossim_uint32 upper = (ossim_uint32) imageChainList().size();
+   ossim_uint32 idx = 0;
+   ossimContainerEvent event(this, OSSIM_EVENT_REMOVE_OBJECT_ID);
+   for(; idx < upper; ++idx)
+   {
+      if(imageChainList()[idx].valid())
+      {
+         event.getObjectList().push_back(imageChainList()[idx].get());
+         prepareForRemoval(imageChainList()[idx].get());
+         imageChainList()[idx] = 0;
+      }
+   }
+  
+   imageChainList().clear();
+   fireEvent(event);
+}
+
+
+void ossimImageChain::disconnectInputEvent(ossimConnectionEvent& event)
+{
+   if(imageChainList().size())
+   {
+      if(event.getObject()==this)
+      {
+         if(imageChainList()[imageChainList().size()-1].valid())
+         {
+            for(ossim_uint32 i = 0; i < event.getNumberOfOldObjects(); ++i)
+            {
+               imageChainList()[imageChainList().size()-1]->disconnectMyInput(event.getOldObject(i));
+            }
+         }
+      }
+   }
+}
+
+void ossimImageChain::disconnectOutputEvent(ossimConnectionEvent& /* event */)
+{
+}
+
+void ossimImageChain::connectInputEvent(ossimConnectionEvent& event)
+{
+   if(imageChainList().size())
+   {
+      if(event.getObject()==this)
+      {
+         if(imageChainList()[imageChainList().size()-1].valid())
+         {
+            for(ossim_uint32 i = 0; i < event.getNumberOfNewObjects(); ++i)
+            {
+               ossimConnectableObject* obj = event.getNewObject(i);
+               imageChainList()[imageChainList().size()-1]->connectMyInputTo(findInputIndex(obj),
+                                                                               obj,
+                                                                               false);
+            }
+         }
+      }
+      else if(event.getObject() == imageChainList()[0].get())
+      {
+         if(!theLoadStateFlag)
+         {
+//            theInputObjectList = imageChainList()[0]->getInputList();
+         }
+      }
+      initialize();
+   }
+}
+
+void ossimImageChain::connectOutputEvent(ossimConnectionEvent& /* event */)
+{
+} 
+
+// void ossimImageChain::propertyEvent(ossimPropertyEvent& event)
+// {
+//    if(imageChainList().size())
+//    {
+//       ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
+//                                              event.getObject());
+      
+//       if(obj)
+//       {
+//          ossimImageSource* interface = findSource(obj->getId());
+         
+//          if(interface)
+//          {
+//             ossimConnectableObject* obj = PTR_CAST(ossimConnectableObject,
+//                                                    interface.getObject());
+//             if(obj)
+//             {
+               
+//             }
+//          }
+//       }
+//    }
+// }
+
+void ossimImageChain::objectDestructingEvent(ossimObjectDestructingEvent& event)
+{
+   if(!event.getObject()) return;
+
+   if(imageChainList().size()&&(event.getObject()!=this))
+   {
+      removeChild(PTR_CAST(ossimConnectableObject,
+                           event.getObject()));
+   }
+}
+void ossimImageChain::propagateEventToOutputs(ossimEvent& event)
+{
+   //if(thePropagateEventFlag) return;
+
+   //thePropagateEventFlag = true;
+   if(imageChainList().size())
+   {
+      if(imageChainList()[imageChainList().size()-1].valid())
+      {
+         imageChainList()[imageChainList().size()-1]->fireEvent(event);
+         imageChainList()[imageChainList().size()-1]->propagateEventToOutputs(event);
+      }
+   }
+   //ossimConnectableObject::propagateEventToOutputs(event);
+  // thePropagateEventFlag = false;
+}
+void ossimImageChain::propagateEventToInputs(ossimEvent& event)
+{
+//   if(thePropagateEventFlag) return;
+
+//   thePropagateEventFlag = true;
+   if(imageChainList().size())
+   {
+      if(imageChainList()[0].valid())
+      {
+         imageChainList()[0]->fireEvent(event);
+         imageChainList()[0]->propagateEventToInputs(event);
+      }
+   }
+//   thePropagateEventFlag = false;
+}
+
+ossimConnectableObject* ossimImageChain::operator[](ossim_uint32 index)
+{
+   return getConnectableObject(index);
+}
+
+ossimConnectableObject* ossimImageChain::getConnectableObject(
+   ossim_uint32 index)
+{
+   if(imageChainList().size() && (index < imageChainList().size()))
+   {
+      return imageChainList()[index].get();
+   }
+   
+   return 0; 
+}
+
+ossim_int32 ossimImageChain::indexOf(ossimConnectableObject* obj)const
+{
+   ossim_uint32 idx = 0;
+   
+   for(idx = 0; idx < imageChainList().size();++idx)
+   {
+      if(imageChainList()[idx] == obj)
+      {
+         return (ossim_int32)idx;
+      }
+   }
+   
+   return -1;
+}
+
+void ossimImageChain::accept(ossimVisitor& visitor)
+{
+   if(!visitor.hasVisited(this))
+   {
+      visitor.visit(this);
+      ossimVisitor::VisitorType currentType = visitor.getVisitorType();
+      //---
+      // Lets make sure inputs and outputs are turned off for we are traversing all children
+      // and we should not have to have that enabled.
+      //---
+      visitor.turnOffVisitorType(ossimVisitor::VISIT_INPUTS|ossimVisitor::VISIT_OUTPUTS);
+      if(visitor.getVisitorType() & ossimVisitor::VISIT_CHILDREN)
+      {
+         ConnectableObjectList::reverse_iterator current = imageChainList().rbegin();
+         while((current != imageChainList().rend())&&!visitor.stopTraversal())
+         {
+            ossimRefPtr<ossimConnectableObject> currentObject = (*current);
+            if(currentObject.get() && !visitor.hasVisited(currentObject.get())) currentObject->accept(visitor);
+            ++current;
+         }
+      }
+      visitor.setVisitorType(currentType);
+      ossimConnectableObject::accept(visitor);
+   }
+}
+
+//**************************************************************************************************
+// Inserts all of its children and inputs into the container provided. Since ossimImageChain is
+// itself a form of container, this method will consolidate this chain with the argument
+// container. Therefore this chain object will not be represented in the container (but its
+// children will be, with correct input and output connections to external objects).
+// Returns TRUE if successful.
+//**************************************************************************************************
+#if 0
+bool ossimImageChain::fillContainer(ossimConnectableContainer& container)
+{
+   // Grab the first source in the chain and let it fill the container with itself and inputs. This
+   // will traverse down the chain and will even pick up external sources that feed this chain:
+   ossimRefPtr<ossimConnectableObject> first_source = getFirstSource();
+   if (!first_source.valid())
+      return false;
+   first_source->fillContainer(container);
+
+   // Instead of adding ourselves, make sure my first source is properly connected to my output,
+   // thus obviating the need for this image chain (my chain items become part of 'container':
+   ConnectableObjectList& obj_list = getOutputList();
+   ossimRefPtr<ossimConnectableObject> output_connection = 0;
+   while (!obj_list.empty())
+   {
+      // Always pick off the beginning of the list since it is shrinking with each disconnect:
+      output_connection = obj_list[0];
+      disconnectMyOutput(output_connection.get(), true, false);
+      first_source->connectMyOutputTo(output_connection.get());
+   }
+   return true;
+}
+#endif
diff --git a/ossim/src/ossim/imaging/ossimImageCombiner.cpp b/src/imaging/ossimImageCombiner.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageCombiner.cpp
rename to src/imaging/ossimImageCombiner.cpp
diff --git a/src/imaging/ossimImageData.cpp b/src/imaging/ossimImageData.cpp
new file mode 100644
index 0000000..502d868
--- /dev/null
+++ b/src/imaging/ossimImageData.cpp
@@ -0,0 +1,7556 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id$
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimErrorCodes.h>
+//#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimHistogram.h>
+//#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+//#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <algorithm>
+#include <cstring>
+#include <fstream>
+#include <iostream>
+#include <iterator>
+//#include <ostream>
+
+
+RTTI_DEF1(ossimImageData, "ossimImageData", ossimRectilinearDataObject)
+
+ossimImageData::ossimImageData()
+: ossimRectilinearDataObject(2,            // 2d
+                             0,         // owner
+                             1,            // bands
+                             OSSIM_UINT8), // scalar
+                             m_nullPixelValue(0),
+                             m_minPixelValue(0),
+                             m_maxPixelValue(0),
+                             m_alpha(0),
+                             m_origin(0, 0),
+                             m_indexedFlag(false),
+			     m_histogram(NULL)
+{
+   ossimIpt tileSize;
+   ossim::defaultTileSize(tileSize);
+   m_spatialExtents[0] = tileSize.x;
+   m_spatialExtents[1] = tileSize.y;
+   initializeDefaults();
+}
+
+ossimImageData::ossimImageData(ossimSource*    owner,
+                               ossimScalarType scalar,
+                               ossim_uint32    bands)
+: ossimRectilinearDataObject(2,
+                             owner,
+                             bands,
+                             scalar),
+                             m_nullPixelValue(0),
+                             m_minPixelValue(0),
+                             m_maxPixelValue(0),
+                             m_alpha(0),
+                             m_origin(0, 0),
+                             m_indexedFlag(false),
+			     m_histogram(NULL)
+{
+   ossimIpt tileSize;
+   ossim::defaultTileSize(tileSize);
+   m_spatialExtents[0] = tileSize.x;
+   m_spatialExtents[1] = tileSize.y;
+   initializeDefaults();
+}
+
+ossimImageData::ossimImageData(ossimSource* owner,
+                               ossimScalarType scalar,
+                               ossim_uint32 bands,
+                               ossim_uint32 width,
+                               ossim_uint32 height)
+: ossimRectilinearDataObject(owner,
+                             bands,
+                             width, // 2-D array
+                             height,
+                             scalar),
+                             m_nullPixelValue(0),
+                             m_minPixelValue(0),
+                             m_maxPixelValue(0),
+                             m_alpha(0),
+                             m_origin(0, 0),
+                             m_indexedFlag(false),
+			     m_histogram(NULL),
+                             m_percentFull(0)
+{   
+   m_spatialExtents[0] = width;
+   m_spatialExtents[1] = height;
+   initializeDefaults();
+}
+
+ossimImageData::ossimImageData(const ossimImageData &rhs)
+: ossimRectilinearDataObject(rhs),
+  m_nullPixelValue(rhs.m_nullPixelValue),
+  m_minPixelValue(rhs.m_minPixelValue),
+  m_maxPixelValue(rhs.m_maxPixelValue),
+  m_alpha(rhs.m_alpha),
+  m_origin(rhs.m_origin),
+  m_indexedFlag(rhs.m_indexedFlag),
+  m_percentFull(0)
+{
+}
+
+const ossimImageData& ossimImageData::operator=(const ossimImageData& rhs)
+{
+   if (this != &rhs)
+   {
+      // ossimRectilinearDataObject initialization:
+      ossimRectilinearDataObject::operator=(rhs);
+
+      // ossimImageData (this) members:
+      m_nullPixelValue = rhs.m_nullPixelValue;
+      m_minPixelValue  = rhs.m_minPixelValue;
+      m_maxPixelValue  = rhs.m_maxPixelValue;
+      m_alpha          = rhs.m_alpha;
+      m_origin         = rhs.m_origin;
+      m_indexedFlag    = rhs.m_indexedFlag;
+   }
+   return *this;
+}
+
+ossimImageData::~ossimImageData()
+{
+}
+
+bool ossimImageData::isValidBand(ossim_uint32 band) const
+{
+   return (band<getNumberOfDataComponents());
+}
+
+ossim_uint32 ossimImageData::getSize() const
+{
+   return (getSizePerBand() * getNumberOfDataComponents());
+}
+
+ossim_uint32 ossimImageData::getSizePerBand() const
+{
+   return (getHeight() * getWidth());
+}
+
+ossim_uint32 ossimImageData::getSizeInBytes() const
+{
+   return (getSizePerBandInBytes() * getNumberOfDataComponents());
+}
+
+ossim_uint32 ossimImageData::getSizePerBandInBytes() const
+{
+   return (getHeight() * getWidth() * getScalarSizeInBytes());
+}
+
+const ossim_uint8* ossimImageData::getAlphaBuf() const
+{
+   if (m_alpha.size() > 0)
+   {
+      return &m_alpha.front();
+   }
+   return 0;
+}
+
+ossim_uint8* ossimImageData::getAlphaBuf()
+{
+   if (m_alpha.size() > 0)
+   {
+      return &m_alpha.front();
+   }
+   return 0;
+}
+
+const void* ossimImageData::getBuf() const
+{
+   if (m_dataBuffer.size() > 0)
+   {
+      return static_cast<const void*>(&m_dataBuffer.front());
+   }
+   return 0;
+}
+
+void* ossimImageData::getBuf()
+{
+   if (m_dataBuffer.size() > 0)
+   {
+      return static_cast<void*>(&m_dataBuffer.front());
+   }
+   return 0;
+}
+
+const void* ossimImageData::getBuf(ossim_uint32 band) const
+{
+   const ossim_uint8* b = static_cast<const ossim_uint8*>(getBuf());
+
+   if (isValidBand(band) && b != 0)
+   {
+      b += (band * getSizePerBandInBytes());
+      return static_cast<const void*>(b);
+   }
+   return 0;
+}
+
+void* ossimImageData::getBuf(ossim_uint32 band)
+{
+   ossim_uint8* b = static_cast<ossim_uint8*>(getBuf());
+
+   if (isValidBand(band) && b != 0)
+   {
+      b += (band * getSizePerBandInBytes());
+      return static_cast<void*>(b);
+   }
+   return 0;
+}
+
+const ossim_uint8* ossimImageData::getUcharBuf() const
+{
+   if (m_scalarType == OSSIM_UINT8)
+   {
+      return static_cast<const ossim_uint8*>(getBuf());
+   }
+   return 0;
+}
+
+const ossim_uint16* ossimImageData::getUshortBuf() const
+{
+   if (m_scalarType == OSSIM_UINT16 ||
+         m_scalarType == OSSIM_USHORT11 ||
+	 m_scalarType == OSSIM_USHORT12 ||
+	 m_scalarType == OSSIM_USHORT13 ||
+	 m_scalarType == OSSIM_USHORT14 ||
+	 m_scalarType == OSSIM_USHORT15)
+   {
+      return static_cast<const ossim_uint16*>(getBuf());
+   }
+   return 0;
+}
+
+const ossim_sint16* ossimImageData::getSshortBuf() const
+{
+   if (m_scalarType == OSSIM_SINT16)
+   {
+      return static_cast<const ossim_sint16*>(getBuf());
+   }
+   return 0;
+}
+
+const ossim_float32* ossimImageData::getFloatBuf() const
+{
+   if (m_scalarType == OSSIM_FLOAT32 ||
+         m_scalarType == OSSIM_NORMALIZED_FLOAT)
+   {
+      return static_cast<const ossim_float32*>(getBuf());
+   }
+   return 0;
+}
+
+const ossim_float64* ossimImageData::getDoubleBuf() const
+{
+   if (m_scalarType == OSSIM_FLOAT64 ||
+         m_scalarType == OSSIM_NORMALIZED_DOUBLE)
+   {
+      return static_cast<const ossim_float64*>(getBuf());
+   }
+   return 0;
+}
+
+ossim_uint8* ossimImageData::getUcharBuf() 
+{
+   if (m_scalarType == OSSIM_UINT8)
+   {
+      return static_cast<ossim_uint8*>(getBuf());
+   }
+   return 0;
+}
+
+ossim_uint16* ossimImageData::getUshortBuf() 
+{
+   if (m_scalarType == OSSIM_UINT16 ||
+         m_scalarType == OSSIM_USHORT11 ||
+	 m_scalarType == OSSIM_USHORT12 ||
+	 m_scalarType == OSSIM_USHORT13 ||
+	 m_scalarType == OSSIM_USHORT14 ||
+	 m_scalarType == OSSIM_USHORT15)
+   {
+      return static_cast<ossim_uint16*>(getBuf());
+   }
+   return 0;
+}
+
+ossim_sint16* ossimImageData::getSshortBuf() 
+{
+   if (m_scalarType == OSSIM_SINT16)
+   {
+      return static_cast<ossim_sint16*>(getBuf());
+   }
+   return 0;
+}
+
+ossim_float32* ossimImageData::getFloatBuf() 
+{
+   if (m_scalarType == OSSIM_FLOAT32 ||
+         m_scalarType == OSSIM_NORMALIZED_FLOAT)
+   {
+      return static_cast<ossim_float32*>(getBuf());
+   }
+   return 0;
+}
+
+ossim_float64* ossimImageData::getDoubleBuf() 
+{
+   if (m_scalarType == OSSIM_FLOAT64 ||
+         m_scalarType == OSSIM_NORMALIZED_DOUBLE)
+   {
+      return static_cast<ossim_float64*>(getBuf());
+   }
+   return 0;
+}
+
+const ossim_uint8* ossimImageData::getUcharBuf(ossim_uint32 band) const
+{
+   if (m_scalarType == OSSIM_UINT8)
+   {
+      return static_cast<const ossim_uint8*>(getBuf(band));
+   }
+   return 0;
+}
+
+const ossim_uint16* ossimImageData::getUshortBuf(ossim_uint32 band) const
+{
+   if (m_scalarType == OSSIM_UINT16 ||
+         m_scalarType == OSSIM_USHORT11 ||
+	 m_scalarType == OSSIM_USHORT12 ||
+	 m_scalarType == OSSIM_USHORT13 ||
+	 m_scalarType == OSSIM_USHORT14 ||
+	 m_scalarType == OSSIM_USHORT15)
+   {
+      return static_cast<const ossim_uint16*>(getBuf(band));
+   }
+   return 0;
+}
+
+const ossim_sint16* ossimImageData::getSshortBuf(ossim_uint32 band) const
+{
+   if (m_scalarType == OSSIM_SINT16)
+   {
+      return static_cast<const ossim_sint16*>(getBuf(band));
+   }
+   return 0;
+}
+
+const ossim_float32* ossimImageData::getFloatBuf(ossim_uint32 band) const
+{
+   if (m_scalarType == OSSIM_FLOAT32 ||
+         m_scalarType == OSSIM_NORMALIZED_FLOAT)
+   {
+      return static_cast<const ossim_float32*>(getBuf(band));
+   }
+   return 0;
+}
+
+const ossim_float64* ossimImageData::getDoubleBuf(ossim_uint32 band) const
+{
+   if (m_scalarType == OSSIM_FLOAT64 ||
+         m_scalarType == OSSIM_NORMALIZED_DOUBLE)
+   {
+      return static_cast<const ossim_float64*>(getBuf(band));
+   }
+   return 0;
+}
+
+ossim_uint8* ossimImageData::getUcharBuf(ossim_uint32 band) 
+{
+   if (m_scalarType == OSSIM_UINT8)
+   {
+      return static_cast<ossim_uint8*>(getBuf(band));
+   }
+   return 0;
+}
+
+ossim_uint16* ossimImageData::getUshortBuf(ossim_uint32 band) 
+{
+   if (m_scalarType == OSSIM_UINT16 ||
+         m_scalarType == OSSIM_USHORT11 ||
+	 m_scalarType == OSSIM_USHORT12 ||
+	 m_scalarType == OSSIM_USHORT13 ||
+	 m_scalarType == OSSIM_USHORT14 ||
+	 m_scalarType == OSSIM_USHORT15)
+   {
+      return static_cast<ossim_uint16*>(getBuf(band));
+   }
+   return 0;
+}
+
+ossim_sint16* ossimImageData::getSshortBuf(ossim_uint32 band) 
+{
+   if (m_scalarType == OSSIM_SINT16)
+   {
+      return static_cast<ossim_sint16*>(getBuf(band));
+   }
+   return 0;
+}
+
+ossim_float32* ossimImageData::getFloatBuf(ossim_uint32 band) 
+{
+   if (m_scalarType == OSSIM_FLOAT32 ||
+         m_scalarType == OSSIM_NORMALIZED_FLOAT)
+   {
+      return static_cast<ossim_float32*>(getBuf(band));
+   }
+   return 0;
+}
+
+ossim_float64* ossimImageData::getDoubleBuf(ossim_uint32 band) 
+{
+   if (m_scalarType == OSSIM_FLOAT64 ||
+         m_scalarType == OSSIM_NORMALIZED_DOUBLE)
+   {
+      return static_cast<ossim_float64*>(getBuf(band));
+   }
+   return 0;
+}
+
+void ossimImageData::getNormalizedFloat(ossim_uint32 offset,
+                                        ossim_uint32 bandNumber,
+                                        ossim_float32& result)const
+{
+   // Make sure that the types and width and height are good.
+   if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
+   {
+      ossim_float32 p = 0.0;
+
+      switch (getScalarType())
+      {
+      case OSSIM_UINT8:
+      {
+         const unsigned char* sourceBuf = getUcharBuf(bandNumber);
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         const ossim_sint8* sourceBuf = static_cast<const ossim_sint8*>(getBuf(bandNumber));
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         const ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         const ossim_uint32* sourceBuf =
+               static_cast<const ossim_uint32*>(getBuf(bandNumber));
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         const ossim_sint32* sourceBuf = static_cast<const ossim_sint32*>(getBuf(bandNumber));
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_FLOAT32:
+      {
+         const ossim_float32* sourceBuf = getFloatBuf(bandNumber);
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         const ossim_float64* sourceBuf = getDoubleBuf(bandNumber);
+         p = sourceBuf[offset];
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         // Shouldn't hit this.
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
+         << std::endl;
+      }
+
+      } // Matches: switch (getScalarType())
+
+      if ( p != m_nullPixelValue[bandNumber] )
+      {
+         const ossim_float32 DELTA = m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber] - 1;
+         const ossim_float32 OFFSET_TO_ONE = 1 - m_minPixelValue[bandNumber];
+
+         result = ( p <= m_maxPixelValue[bandNumber] ) ?
+               ( ( p >= m_minPixelValue[bandNumber] ) ? ( p + OFFSET_TO_ONE ) / DELTA : 0.0 ) : 1.0;
+      }
+      else
+      {
+         result = 0.0;
+      }
+
+   } // Matches: if( (getDataObjectStatus() ...
+
+} // End: ossimImageData::getNormalizedFloat
+
+void ossimImageData::setNormalizedFloat(ossim_uint32 offset,
+                                        ossim_uint32 bandNumber,
+                                        ossim_float32 inputValue)
+{
+   // Make sure that the types and width and height are good.
+   if( (getDataObjectStatus() != OSSIM_NULL) && (bandNumber < getNumberOfDataComponents()) )
+   {
+
+      ossim_float32 p = 0.0;
+
+      if ( inputValue )
+      {
+         const ossim_float32 DELTA = m_maxPixelValue[bandNumber] - m_minPixelValue[bandNumber] - 1;
+         const ossim_float32 OFFSET_TO_MIN = m_minPixelValue[bandNumber] - 1;
+         p = inputValue * DELTA + OFFSET_TO_MIN + 0.5;
+         if ( p > m_maxPixelValue[bandNumber] )
+         {
+            p = m_maxPixelValue[bandNumber];
+         }
+      }
+      else
+      {
+         p = m_nullPixelValue[bandNumber];
+      }
+
+      switch (getScalarType())
+      {
+      case OSSIM_UINT8:
+      {
+         unsigned char* sourceBuf = getUcharBuf(bandNumber);
+         sourceBuf[offset] = static_cast<ossim_uint8>( p );
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         ossim_sint8* sourceBuf = static_cast<ossim_sint8*>(getBuf(bandNumber));
+         sourceBuf[offset] = static_cast<ossim_sint8>( p );
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+         sourceBuf[offset] = static_cast<ossim_uint16>( p );
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         ossim_sint16* sourceBuf = getSshortBuf(bandNumber);
+         sourceBuf[offset] = static_cast<ossim_sint16>( p );
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         ossim_uint32* sourceBuf = static_cast<ossim_uint32*>(getBuf(bandNumber));
+         sourceBuf[offset] = static_cast<ossim_uint32>( p );
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         ossim_sint32* sourceBuf = static_cast<ossim_sint32*>(getBuf(bandNumber));
+         sourceBuf[offset] = static_cast<ossim_sint32>( p );
+         break;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_FLOAT32:
+      {
+         ossim_float32* sourceBuf = getFloatBuf(bandNumber);
+         sourceBuf[offset] = p;
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         ossim_float64* sourceBuf = getDoubleBuf(bandNumber);
+         sourceBuf[offset] = p;
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+         // Shouldn't hit this.
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimImageData::setNormalizedFloat Unsupported scalar type!"
+         << std::endl;
+
+      } // Matches: switch (getScalarType())
+
+   } // Matches: if( (getDataObjectStatus() ...
+
+} // End: ossimImageData::setNormalizedFloat
+
+void ossimImageData::convertToNormalizedFloat(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+         (result->getNumberOfBands() != this->getNumberOfBands())||
+         (result->getWidth() != this->getWidth()) ||
+         (result->getHeight() != this->getHeight())||
+         (result->getDataObjectStatus() == OSSIM_NULL) ||
+         (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   copyTileToNormalizedBuffer((ossim_float32*)result->getBuf());
+   result->setDataObjectStatus(getDataObjectStatus());
+}
+
+ossimRefPtr<ossimImageData> ossimImageData::newNormalizedFloat()const
+{
+   ossimRefPtr<ossimImageData> result =
+         new ossimImageData(0,
+                            OSSIM_NORMALIZED_FLOAT,
+                            this->getNumberOfBands(),
+                            this->getWidth(),
+                            this->getHeight());
+
+   result->initialize();
+
+   convertToNormalizedFloat(result.get());
+
+   return result;
+}
+
+void ossimImageData::convertToNormalizedDouble(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_DOUBLE) ||
+         (result->getNumberOfBands() != this->getNumberOfBands())||
+         (result->getWidth() != this->getWidth()) ||
+         (result->getHeight() != this->getHeight())||
+         (result->getDataObjectStatus() == OSSIM_NULL) ||
+         (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   copyTileToNormalizedBuffer((ossim_float64*)result->getBuf());
+   result->setDataObjectStatus(getDataObjectStatus());
+}
+
+ossimImageData* ossimImageData::newNormalizedDouble()const
+{
+   ossimImageData* result = new ossimImageData(0,
+                                               OSSIM_NORMALIZED_DOUBLE,
+                                               this->getNumberOfBands(),
+                                               this->getWidth(),
+                                               this->getHeight());
+   result->initialize();
+
+   convertToNormalizedDouble(result);
+
+   return result;   
+}
+
+
+void ossimImageData::unnormalizeInput(ossimImageData* normalizedInput)
+{
+   if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
+         (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
+   {
+      //ERROR
+      return;
+   }
+
+   if(normalizedInput->getScalarType() == OSSIM_NORMALIZED_DOUBLE)
+   {
+      copyNormalizedBufferToTile((ossim_float64*)normalizedInput->getBuf());
+   }
+   else
+   {
+      copyNormalizedBufferToTile((ossim_float32*)normalizedInput->getBuf());
+   }
+}
+
+ossim_float64 ossimImageData::computeMeanSquaredError(
+      ossim_float64 meanValue,
+      ossim_uint32 bandNumber) const
+{
+   ossim_float64 result = -1; // invalid MSE
+
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      result = computeMeanSquaredError(ossim_uint8(0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      result = computeMeanSquaredError(ossim_sint8(0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      result = computeMeanSquaredError(ossim_uint16(0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      result = computeMeanSquaredError(ossim_sint16(0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      result = computeMeanSquaredError(ossim_uint32(0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      result = computeMeanSquaredError(ossim_sint32(0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      result = computeMeanSquaredError(ossim_float32(0.0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      result = computeMeanSquaredError(ossim_float64(0.0),
+                                       meanValue,
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::computeMeanSquaredError File %s line %d\n\
+Invalid scalar type:  %d",
+__FILE__,
+__LINE__,
+getScalarType());
+      break;
+   }
+   }
+
+   return result;
+}
+
+template <class T> ossim_float64 ossimImageData::computeMeanSquaredError(
+      T, /* dummyTemplate */
+      ossim_float64 meanValue,
+      ossim_uint32 bandNumber) const
+{
+   ossim_float64  result               = -1.0; // invalid MSE
+
+   if ( (getDataObjectStatus() == OSSIM_NULL) ||
+         (getDataObjectStatus() == OSSIM_EMPTY) )
+   {
+      return result;
+   }
+
+   ossim_uint32  index           = 0;
+   ossim_float64 delta           = 0.0;
+   ossim_uint32  validPixelCount = 0;
+
+   const T* BUFFER = static_cast<const T*>(getBuf(bandNumber));
+   if(BUFFER)
+   {
+      const ossim_uint32 BOUNDS = getSizePerBand();
+      for(index = 0; index < BOUNDS; ++index)
+      {
+         if(!isNull(index))
+         {
+            delta = BUFFER[index] - meanValue;
+            result += (delta*delta);
+            ++validPixelCount;
+         }
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+
+//******************************************************************
+//
+// NOTE: I was checking for null and not adding it to the histogram.
+//       this was messing up the equalization algorithms since the
+//       accumulation histogram did not represent the area of the
+//       image.  For now I will leave out the check for "is null" and
+//       add this to the count so that the total accumulation is the
+//       area of the image.
+//
+//******************************************************************
+void ossimImageData::populateHistogram(ossimRefPtr<ossimMultiBandHistogram> histo)
+{
+   ossim_uint32 numberOfBands = getNumberOfBands();
+
+   if( (getDataObjectStatus() == OSSIM_NULL) ||
+         (getDataObjectStatus() == OSSIM_EMPTY)||
+         (!histo))
+   {
+      return;
+   }
+   switch(getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
+         if(currentHisto.valid())
+         {
+            ossim_uint8 nullpix = (ossim_uint8)getNullPix(band);
+            float* histoBins = currentHisto->GetCounts();
+            int binCount = currentHisto->GetRes();
+            ossim_uint8* buffer = (ossim_uint8*)getBuf(band);
+            ossim_uint32 upperBound = getWidth()*getHeight();
+            if ( binCount == 256 )
+            {
+               for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+               {
+                  if (buffer[offset] != nullpix)
+                     ++histoBins[ buffer[offset] ];
+               }
+            }
+            else
+            {
+               for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+               {
+                  if (buffer[offset] != nullpix)
+                     currentHisto->UpCount((float)buffer[offset]);
+               }
+            }
+         }
+      }
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
+         if(currentHisto.valid())
+         {
+            ossim_uint16 nullpix = (ossim_uint16)getNullPix(band);
+            ossim_uint16* buffer = (ossim_uint16*)getBuf(band);
+            ossim_uint32 upperBound = getWidth()*getHeight();
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (buffer[offset] != nullpix)
+                  currentHisto->UpCount((float)buffer[offset]);
+            }
+         }
+      }
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
+         if(currentHisto.valid())
+         {
+            ossim_sint16 nullpix = (ossim_sint16)getNullPix(band);
+            ossim_sint16* buffer = (ossim_sint16*)getBuf(band);
+            ossim_uint32 upperBound = getWidth()*getHeight();
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (buffer[offset] != nullpix)
+                  currentHisto->UpCount((float)buffer[offset]);
+            }
+         }
+      }
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
+         if(currentHisto.valid())
+         {
+            ossim_sint32 nullpix = (ossim_sint32)getNullPix(band);
+            ossim_sint32* buffer = (ossim_sint32*)getBuf(band);
+            ossim_uint32 upperBound = getWidth()*getHeight();
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (buffer[offset] != nullpix)
+                  currentHisto->UpCount((float)buffer[offset]);
+            }
+         }
+      }
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
+         if(currentHisto.valid())
+         {
+            ossim_uint32 nullpix = (ossim_uint32)getNullPix(band);
+            ossim_uint32* buffer = (ossim_uint32*)getBuf(band);
+            ossim_uint32 upperBound = getWidth()*getHeight();
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (buffer[offset] != nullpix)
+                  currentHisto->UpCount((float)buffer[offset]);
+            }
+         }
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      ossim_float64 epsilon = 2*DBL_EPSILON;
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
+         if(currentHisto.valid())
+         {
+            ossim_float64 nullpix = (ossim_float64)getNullPix(band);
+            if (nullpix == 0.0)
+               epsilon = 0;
+            ossim_float64* buffer = (ossim_float64*)getBuf(band);
+            ossim_uint32 upperBound = getWidth()*getHeight();
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (!ossim::almostEqual<ossim_float64>(buffer[offset], nullpix, epsilon))
+                  currentHisto->UpCount((float)buffer[offset]);
+            }
+         }
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      ossim_float32 epsilon = 2*FLT_EPSILON;
+      for(ossim_uint32 band = 0; band < numberOfBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> currentHisto = histo->getHistogram(band);
+         if(currentHisto.valid())
+         {
+            ossim_float32 nullpix = (ossim_float32)getNullPix(band);
+            if (nullpix == 0.0)
+               epsilon = 0;
+            ossim_float32* buffer = (ossim_float32*)getBuf(band);
+            ossim_uint32 upperBound = getWidth()*getHeight();
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (!ossim::almostEqual<ossim_float32>(buffer[offset], nullpix, epsilon))
+                  currentHisto->UpCount((float)buffer[offset]);
+            }
+         }
+      }
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      //ERROR
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::populateHistogram\n"
+      << "Unknown scalar type." << std::endl;
+   }
+   }  // end of switch
+}
+
+ossim_float64 ossimImageData::computeAverageBandValue(ossim_uint32 bandNumber) const
+{
+   ossim_float64 result = 0.0;
+
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      result = computeAverageBandValue(ossim_uint8(0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      result = computeAverageBandValue(ossim_sint8(0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      result = computeAverageBandValue(ossim_uint16(0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      result = computeAverageBandValue(ossim_sint16(0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      result = computeAverageBandValue(ossim_uint32(0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      result = computeAverageBandValue(ossim_sint32(0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      result = computeAverageBandValue(ossim_float32(0.0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      result = computeAverageBandValue(ossim_float64(0.0),
+                                       bandNumber);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::computeAverageBandValue File %s line %d\n\
+Invalid scalar type:  %d",
+__FILE__,
+__LINE__,
+getScalarType());
+      break;
+   }
+   }
+
+   return result;
+}
+
+template <class T> ossim_float64 ossimImageData::computeAverageBandValue(
+      T, /* dummy */
+      ossim_uint32 bandNumber) const
+{
+   ossim_float64  result = 0.0;
+
+   if ( (getDataObjectStatus() == OSSIM_NULL) ||
+         (getDataObjectStatus() == OSSIM_EMPTY) )
+   {
+      return result;
+   }
+
+   ossim_uint32 index = 0;
+   ossim_uint32 validPixelCount = 0;
+
+   const T* BUFFER = static_cast<const T*>(getBuf(bandNumber));
+   if(BUFFER)
+   {
+      const ossim_uint32 BOUNDS = getSizePerBand();
+      for(index = 0; index < BOUNDS; ++index)
+      {
+         if(!isNull(index))
+         {
+            result += BUFFER[index];
+            ++validPixelCount;
+         }
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+ossimDataObjectStatus ossimImageData::validate() const
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      return validate(ossim_uint8(0));
+   }
+   case OSSIM_SINT8:
+   {
+      return validate(ossim_sint8(0));
+   }
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      return validate(ossim_uint16(0));
+   }
+   case OSSIM_SINT16:
+   {
+      return validate(ossim_sint16(0));
+   }
+
+   case OSSIM_UINT32:
+   {
+      return validate(ossim_uint32(0));
+   }
+   case OSSIM_SINT32:
+   {
+      return validate(ossim_sint32(0));
+   }
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      return validate(ossim_float32(0.0));
+   }
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      return validate(ossim_float64(0.0));
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+      break;
+   }
+   }
+
+   return OSSIM_STATUS_UNKNOWN;
+}
+
+template <class T>
+ossimDataObjectStatus ossimImageData::validate(T /* dummyTemplate */ ) const
+{
+   if (m_dataBuffer.size() == 0)
+   {
+      setDataObjectStatus(OSSIM_NULL);
+      m_percentFull = 0;
+      return OSSIM_NULL;
+   }
+
+   ossim_uint32       count           = 0;
+   const ossim_uint32 SIZE            = getSize();
+   const ossim_uint32 BOUNDS          = getSizePerBand();
+   const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
+
+   for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
+   {
+      const T NP = static_cast<T>(m_nullPixelValue[band]);
+      const T* p = static_cast<const T*>(getBuf(band));
+
+      for (ossim_uint32 i = 0; i < BOUNDS; ++i)
+      {
+         // check if the band is null
+         if (p[i] != NP) ++count;         
+      }
+   }
+
+   if (!count)
+   {
+      setDataObjectStatus(OSSIM_EMPTY);
+      m_percentFull = 0;
+   }
+   else if (count == SIZE)
+   {
+      setDataObjectStatus(OSSIM_FULL);
+      m_percentFull = 100;
+   }
+   else
+   {
+      setDataObjectStatus(OSSIM_PARTIAL);
+      m_percentFull = 100.0 * count / SIZE;
+   }
+   return getDataObjectStatus();
+}
+
+void ossimImageData::makeBlank()
+{
+   if ( (m_dataBuffer.size() == 0) || (getDataObjectStatus() == OSSIM_EMPTY) )
+   {
+      return; // nothing to do...
+   }
+
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      makeBlank(ossim_uint8(0));
+      return;
+   }
+   case OSSIM_SINT8:
+   {
+      makeBlank(ossim_sint8(0));
+      return;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      makeBlank(ossim_uint16(0));
+      return;
+   }
+   case OSSIM_SINT16:
+   {
+      makeBlank(ossim_sint16(0));
+      return;
+   }
+   case OSSIM_UINT32:
+   {
+      makeBlank(ossim_uint32(0));
+      return;
+   }
+   case OSSIM_SINT32:
+   {
+      makeBlank(ossim_sint32(0));
+      return;
+   }
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      makeBlank(ossim_float32(0.0));
+      return;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      makeBlank(ossim_float64(0.0));
+      return;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::makeBlank File %s line %d\n\
+Invalid scalar type:  %d",
+__FILE__,
+__LINE__,
+getScalarType());
+      break;
+   }
+   }
+}
+
+template <class T> void ossimImageData::makeBlank(T /* dummyTemplate */ )
+{
+   // Note: Empty buffer or already OSSIM_EMPTY checked in public method.
+
+   const ossim_uint32 BANDS = getNumberOfBands();
+   const ossim_uint32 SPB   = getSizePerBand();
+   ossim_uint32 sizePerBandInBytes = getSizePerBandInBytes();
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const T NP = static_cast<T>(m_nullPixelValue[band]);
+      if(NP == 0.0)
+      {
+         // do an optimize byte fill
+         memset(getBuf(band), '\0', sizePerBandInBytes);
+      }
+      else
+      {
+         // slower assign call
+         T* p = static_cast<T*>(getBuf(band));
+         for (ossim_uint32 i = 0; i < SPB; ++i)
+         {
+            p[i] = NP;
+         }
+      }
+   }
+
+   setDataObjectStatus(OSSIM_EMPTY);
+}
+
+void ossimImageData::initialize()
+{
+   // let the base class allocate a buffer
+   ossimRectilinearDataObject::initialize();
+
+   if (m_dataBuffer.size() > 0)
+   {
+      makeBlank();  // Make blank will set the status.
+   }
+}
+
+// Write the tile out to disk with a general raster header file.
+bool ossimImageData::write(const ossimFilename& f) const
+{
+   bool result = false;
+
+   std::ofstream os;
+   os.open(f.c_str(), ios::out | ios::binary);
+   if (os.good())
+   {
+      // Write the tile out.
+      os.write(static_cast<const char*>(getBuf()),
+               static_cast<std::streamsize>(getSizeInBytes()));
+
+      result = os.good();
+      if (result)
+      {
+         // Write a header file that we can use to read the tile.
+         os.close();
+         ossimFilename hdrFile = f;
+         hdrFile.setExtension("hdr");
+         os.open(hdrFile.c_str(), ios::out);
+         result = os.good();
+         if (result)
+         {
+            os << "filename: " << f.c_str()
+                     << "\nimage_type:  general_raster_bsq"
+                     << "\nindexed: " << m_indexedFlag
+                     << "\ninterleave_type:  bsq"
+                     << "\norigin: " << m_origin
+                     << "\nnumber_bands: " << ossimString::toString(getNumberOfBands())
+            << "\nnumber_lines: " << ossimString::toString(getHeight())
+            << "\nnumber_samples: " << ossimString::toString(getWidth())
+            << "\nscalar_type: "
+            << ossimScalarTypeLut::instance()->getEntryString(getScalarType())
+            << "\n";
+            for(ossim_uint32 band=0; band < getNumberOfBands(); ++band)
+            {
+               ossimString bs = "band";
+               bs += ossimString::toString(band+1); 
+               os << bs.c_str() << ".min_value: " << m_minPixelValue[band] << "\n"
+                     << bs.c_str() << ".max_value: " << m_maxPixelValue[band] << "\n"
+                     << bs.c_str() << ".null_value: " << m_nullPixelValue[band]
+                                                                          << std::endl;
+            }
+         }
+      }
+   }
+   os.close();
+
+   return result;
+}
+
+bool ossimImageData::isWithin(ossim_int32 x, ossim_int32 y)
+{
+   return ((x >= m_origin.x) &&
+         (x <  m_origin.x + static_cast<ossim_int32>(m_spatialExtents[0])) &&
+         (y >= m_origin.y) &&
+         (y <  m_origin.y + static_cast<ossim_int32>(m_spatialExtents[1])));
+
+}
+
+void ossimImageData::setValue(ossim_int32 x, ossim_int32 y, ossim_float64 color)
+{
+   if(m_dataBuffer.size() > 0 && isWithin(x, y))
+   {
+      ossim_uint32 band=0;
+
+      //***
+      // Compute the offset into the buffer for (x,y).  This should always
+      // come out positive.
+      //***
+      ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
+      ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
+
+      ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
+
+      switch (getScalarType())
+      {
+      case OSSIM_UINT8:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            unsigned char* buf = static_cast<unsigned char*>(getBuf(band))+
+                  offset;
+            *buf = (unsigned char)color;
+         }
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+
+                  offset;
+            *buf = (ossim_sint8)color;
+         }
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+
+                  offset;
+            *buf = (ossim_uint16)color;
+         }
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            signed short* buf = static_cast<signed short*>(getBuf(band))+
+                  offset;
+            *buf = (signed short)color;
+         }
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+
+                  offset;
+            *buf = (ossim_uint32)color;
+         }
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+
+                  offset;
+            *buf = (ossim_sint32)color;
+         }
+         break;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_FLOAT32:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
+            *buf = (ossim_float32)color;
+         }
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         for(band = 0; band < m_numberOfDataComponents; band++)
+         {
+            ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
+            *buf = color;
+         }
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         //ERROR
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimImageData::setValue Unsupported scalar type!"
+         << std::endl;
+
+      }
+
+      } // End of:  switch (getScalarType())
+   }
+}
+
+void ossimImageData::initializeDefaults()
+{
+   initializeMinDefault();
+   initializeMaxDefault();
+   initializeNullDefault();
+}
+
+void ossimImageData::initializeMinDefault()
+{
+   if(!m_numberOfDataComponents)
+   {
+      return;
+   }
+
+   m_minPixelValue.resize(m_numberOfDataComponents);
+
+   ossim_float64 value = ossim::defaultMin( getScalarType() );
+
+   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
+   {
+      m_minPixelValue[band]  = value;
+   }
+}
+
+void ossimImageData::initializeMaxDefault()
+{
+   if(!m_numberOfDataComponents)
+   {
+      return;
+   }
+
+   m_maxPixelValue.resize(m_numberOfDataComponents);
+
+   ossim_float64 value = ossim::defaultMax( getScalarType() );
+
+   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
+   {
+      m_maxPixelValue[band]  = value;
+   }
+}
+
+void ossimImageData::initializeNullDefault()
+{
+   if(!m_numberOfDataComponents)
+   {
+      return;
+   }
+
+   m_nullPixelValue.resize(m_numberOfDataComponents);
+
+   ossim_float64 value = ossim::defaultNull( getScalarType() );
+
+   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
+   {
+      m_nullPixelValue[band]  = value;
+   }
+}
+
+bool ossimImageData::isEqualTo(const ossimDataObject& rhs,
+                               bool deepTest)const
+{
+   const ossimImageData* rhsPtr = dynamic_cast<const ossimImageData*>(&rhs);
+   if(!rhsPtr) return false;
+   bool result = ( (m_scalarType == rhsPtr->m_scalarType)&&
+                   (m_numberOfDataComponents == rhsPtr->m_numberOfDataComponents)&&
+                   (m_origin    == rhsPtr->m_origin)&&
+                   (getWidth()  == rhsPtr->getWidth())&&
+                   (getHeight() == rhsPtr->getHeight()));
+
+   if(result)
+   {
+      bool test=true;
+      for(ossim_uint32 index = 0; index < m_numberOfDataComponents; ++index)
+      {
+         if(m_minPixelValue[index] != rhsPtr->m_minPixelValue[index])
+         {
+            test = false;
+            break;
+         }
+         if(m_maxPixelValue[index] != rhsPtr->m_maxPixelValue[index])
+         {
+            test = false;
+            break;
+         }
+         if(m_nullPixelValue[index] != rhsPtr->m_nullPixelValue[index])
+         {
+            test = false;
+            break;
+         }
+      }
+      result = test;
+   }
+   if(deepTest&&result)
+   {
+      if(getBuf() != 0 && rhsPtr->getBuf() != 0)
+      {
+         if(memcmp(getBuf(), rhsPtr->getBuf(), getSizeInBytes()) != 0)
+         {
+            result = false;
+         }
+      }
+      else if(getBuf() == 0 && rhsPtr->getBuf() == 0)
+      {
+         // nothing both are null so don't change the result.
+      }
+      else // one is null so not equal.
+      {
+         result = false;
+      }
+   }
+
+   return result;
+}
+
+ossimString ossimImageData::getScalarTypeAsString() const
+{
+   return ossimScalarTypeLut::instance()->getEntryString(getScalarType());
+}
+
+ossim_uint32 ossimImageData::getNumberOfBands() const
+{
+   return getNumberOfDataComponents();
+}
+
+ossim_float64 ossimImageData::getPix(const ossimIpt& position,
+                                     ossim_uint32 band) const
+{
+   ossimIpt relative( position.x - m_origin.x,
+                      position.y - m_origin.y);
+   if((relative.x < 0) || (relative.x >= (ossim_int32)m_spatialExtents[0])) return 0.0;
+   if((relative.y < 0) || (relative.y >= (ossim_int32)m_spatialExtents[1])) return 0.0;
+   return getPix((m_spatialExtents[0])*relative.y + relative.x, band);
+}
+
+ossim_float64 ossimImageData::getPix(ossim_uint32 offset, ossim_uint32 band) const
+{
+   switch(m_scalarType)
+   {
+   case OSSIM_UINT8:
+   {
+      const ossim_uint8* buf = getUcharBuf(band);
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      const ossim_sint8* buf = static_cast<const ossim_sint8*>(getBuf(band));
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      const ossim_uint16* buf = getUshortBuf(band);
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      const ossim_sint16* buf = getSshortBuf(band);
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      const ossim_sint32* buf = static_cast<const ossim_sint32*>(getBuf(band));
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      const ossim_uint32* buf = static_cast<const ossim_uint32*>(getBuf(band));
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      const ossim_float64* buf = getDoubleBuf(band);
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      const ossim_float32* buf = getFloatBuf(band);
+      if(buf)
+      {
+         return (ossim_float64)buf[offset];
+      }
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      // Shouldn't hit this.
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::fill Unsupported scalar type!"
+      << std::endl;
+   }
+
+   return 0.0;
+}
+
+void ossimImageData::fill(ossim_uint32 band, ossim_float64 value)
+{
+   void* s         = getBuf(band);
+
+   if (s == 0) return; // nothing to do...
+
+   ossim_uint32 size_in_pixels = getWidth()*getHeight();
+
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      ossim_uint8* p = getUcharBuf(band);
+      ossim_uint8 np = static_cast<ossim_uint8>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      ossim_sint8* p = static_cast<ossim_sint8*>(getBuf(band));
+      ossim_sint8 np = static_cast<ossim_sint8>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      ossim_uint16* p = getUshortBuf(band);
+      ossim_uint16 np = static_cast<ossim_uint16>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      ossim_sint16* p = getSshortBuf(band);
+      ossim_sint16 np = static_cast<ossim_sint16>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      ossim_uint32* p = static_cast<ossim_uint32*>(getBuf(band));
+      ossim_uint32 np = static_cast<ossim_uint32>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      ossim_sint32* p = static_cast<ossim_sint32*>(getBuf(band));
+      ossim_sint32 np = static_cast<ossim_sint32>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      ossim_float32* p = getFloatBuf(band);
+      ossim_float32 np = static_cast<ossim_float32>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      ossim_float64* p = getDoubleBuf(band);
+      ossim_float64 np = static_cast<ossim_float64>(value);
+      for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::makeBlank File %s line %d\n\
+Invalid scalar type:  %d",
+__FILE__,
+__LINE__,
+getScalarType());
+      return;
+   }
+
+   setDataObjectStatus(OSSIM_EMPTY);
+
+}
+
+void ossimImageData::fill(ossim_float64 value)
+{
+   ossim_uint32 valueNullCount= 0;
+   for(ossim_uint32 band=0; band < getNumberOfBands(); ++band)
+   {
+      if (value == m_nullPixelValue[band])
+      {
+         ++valueNullCount;
+      }
+
+      fill(band, value);
+   }
+
+   if (valueNullCount==0)
+   {
+      setDataObjectStatus(OSSIM_FULL);
+   }
+   else if(valueNullCount==getNumberOfBands())
+   {
+      setDataObjectStatus(OSSIM_EMPTY);
+   }
+   else
+   {
+      setDataObjectStatus(OSSIM_PARTIAL);
+   }
+}
+
+
+void ossimImageData::createTestTile()
+{
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      initialize();
+   }
+
+   if ( getDataObjectStatus() != OSSIM_NULL )
+   {
+      switch (getScalarType())
+      {
+      case OSSIM_UINT8:
+      {
+         createTestTile(ossim_uint8(0));
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         createTestTile(ossim_sint8(0));
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         createTestTile(ossim_uint16(0));
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         createTestTile(ossim_sint16(0));
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         createTestTile(ossim_uint32(0));
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         createTestTile(ossim_sint32(0));
+         break;
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         createTestTile(ossim_float32(0));
+         break;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_FLOAT64:
+      {
+         createTestTile(ossim_float64(0));
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+         ossimSetError(getClassName(),
+                       ossimErrorCodes::OSSIM_ERROR,
+                       "ossimImageData::createTestTile File %s line %d\nInvalid or unhandled scalar type:  %d",
+                       __FILE__,
+                       __LINE__,
+                       getScalarType());
+      }
+   }
+   else
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::createTestTile File %s line %d\nTile must be initialed!",
+                    __FILE__,
+                    __LINE__,
+                    getScalarType());
+   }
+
+} // End: ossimImageData::createTestTile()
+
+
+template <class T> void ossimImageData::createTestTile(T)
+{
+   if (getDataObjectStatus() != OSSIM_NULL)
+   {
+      const ossim_uint32  BANDS   = getNumberOfBands();
+      const ossim_uint32  LINES   = getHeight();
+      const ossim_uint32  SAMPS   = getWidth();
+      const ossim_float64 NP      = getNullPix(0);
+      const ossim_float64 MAX_PIX = getMaxPix(0);
+
+      const T STEP = static_cast<T>( (MAX_PIX-NP) / (LINES-1) );
+
+      for(ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         T* s = (T*)getBuf(band);
+         T p = (T)NP;
+
+         for ( ossim_uint32 line = 0; line < LINES; ++line )
+         {
+            for ( ossim_uint32 samp = 0; samp < SAMPS; ++samp )
+            {
+               s[samp] = p;
+            }
+            p += STEP;
+            s += SAMPS;
+
+         }
+      }
+
+      validate();
+   }
+
+} // End: ossimImageData::createTestTile() template implementation.
+
+bool ossimImageData::isNull(ossim_uint32 offset)const
+{
+   ossim_uint32 numberOfBands = getNumberOfBands();
+   ossim_uint32 band=0;
+   if(!getBuf())
+   {
+      return true;
+   }
+
+   switch(getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      for(band = 0; band < numberOfBands; ++band)
+      {
+         const ossim_uint8* buf = static_cast<const ossim_uint8*>(getBuf(band))+offset;
+         if((*buf) != (ossim_uint8)getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      for(band = 0; band < numberOfBands; ++band)
+      {
+         const ossim_sint8* buf = static_cast<const ossim_sint8*>(getBuf(band))+offset;
+         if((*buf) != (ossim_uint8)getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_uint16* buf = static_cast<const ossim_uint16*>(getBuf(band))+offset;
+         if((*buf) != (ossim_uint16)getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_sint16* buf = static_cast<const ossim_sint16*>(getBuf(band))+offset;
+         if((*buf) != (ossim_sint16)getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_uint32* buf = static_cast<const ossim_uint32*>(getBuf(band))+offset;
+         if((*buf) != (ossim_uint32)getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_sint32* buf = static_cast<const ossim_sint32*>(getBuf(band))+offset;
+         if((*buf) != (ossim_sint32)getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
+         if((*buf) != 0.0)
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
+         if((*buf) != (ossim_float32)getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
+         if((*buf) != 0.0)
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
+         if((*buf) != getNullPix(band))
+         {
+            return false;
+         }
+      }
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      //ERROR
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::isNull Unsupported scalar type!"
+      << std::endl;
+   }
+   }
+   return true;
+}
+
+bool ossimImageData::isNull(ossim_uint32 offset, ossim_uint32 band)const
+{
+   switch(getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      const ossim_uint8* buf =
+            static_cast<const ossim_uint8*>(getBuf(band))+offset;
+
+      if((*buf) != (ossim_uint8)getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      const ossim_sint8* buf =
+            static_cast<const ossim_sint8*>(getBuf(band))+offset;
+
+      if((*buf) != (ossim_sint8)getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      const ossim_uint16* buf =
+            static_cast<const ossim_uint16*>(getBuf(band))+offset;
+      if((*buf) != (ossim_uint16)getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      const ossim_sint16* buf =
+            static_cast<const ossim_sint16*>(getBuf(band))+offset;
+      if((*buf) != (ossim_sint16)getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      const ossim_uint32* buf =
+            static_cast<const ossim_uint32*>(getBuf(band))+offset;
+      if((*buf) != (ossim_uint32)getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      const ossim_sint32* buf =
+            static_cast<const ossim_sint32*>(getBuf(band))+offset;
+      if((*buf) != (ossim_sint32)getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      const ossim_float32* buf = static_cast<const ossim_float32*>(getBuf(band))+offset;
+      if((*buf) != (ossim_float32)getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_FLOAT64:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      const ossim_float64* buf = static_cast<const ossim_float64*>(getBuf(band))+offset;
+      if((*buf) != getNullPix(band))
+      {
+         return false;
+      }
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      //ERROR
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::isNull Unsupported scalar type!"
+      << std::endl;
+   }
+   }
+   return true;
+}
+
+bool ossimImageData::isNull(const ossimIpt& pt)const
+{
+   ossim_int32 xNew = (pt.x - m_origin.x);
+   ossim_int32 yNew = (pt.y - m_origin.y);
+   if(xNew < 0 || xNew >= static_cast<ossim_int32>(m_spatialExtents[0]) ||
+         yNew < 0 || yNew >= static_cast<ossim_int32>(m_spatialExtents[1]) )
+   {
+      return true;
+   }
+   ossim_uint32 offset = getWidth()*yNew + xNew;
+
+   return isNull(offset);
+}
+
+bool ossimImageData::isNull(const ossimIpt& pt, ossim_uint32 band)const
+{
+   ossim_int32 xNew = (pt.x - m_origin.x);
+   ossim_int32 yNew = (pt.y - m_origin.y);
+   if(xNew < 0 || xNew >= static_cast<ossim_int32>(m_spatialExtents[0]) ||
+         yNew < 0 || yNew >= static_cast<ossim_int32>(m_spatialExtents[1]) )
+   {
+      return true;
+   }
+   ossim_uint32 offset = getWidth()*yNew + xNew;
+
+   return isNull(offset, band);
+}
+
+void ossimImageData::setNull(ossim_uint32 offset)
+{
+   ossim_uint32 numberOfBands = getNumberOfBands();
+   ossim_uint32 band=0;
+   switch(getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      for(band = 0; band < numberOfBands; ++band)
+      {
+         ossim_uint8* buf = static_cast<ossim_uint8*>(getBuf(band))+offset;
+         *buf       = (ossim_uint8)getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      for(band = 0; band < numberOfBands; ++band)
+      {
+         ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+offset;
+         *buf       = (ossim_sint8)getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+
+               offset;
+         *buf = (ossim_uint16)getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         ossim_sint16* buf = static_cast<ossim_sint16*>(getBuf(band))+
+               offset;
+         *buf = (ossim_sint16)getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+
+               offset;
+         *buf = (ossim_uint32)getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+
+               offset;
+         *buf = (ossim_sint32)getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
+         *buf = (ossim_float32)getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_FLOAT64:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      for(band = 0; band < numberOfBands; band++)
+      {
+         ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
+         *buf = getNullPix(band);
+      }
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      //ERROR
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::isNull Unsupported scalar type!"
+      << std::endl;
+   }
+   }
+}
+
+void ossimImageData::setNull(ossim_uint32 offset, ossim_uint32 band)
+{
+   switch(getScalarType())
+   {
+   case OSSIM_UINT8:
+   {
+      ossim_uint8* buf = static_cast<ossim_uint8*>(getBuf(band))+offset;
+      *buf       = (ossim_uint8)getNullPix(band);
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      ossim_sint8* buf = static_cast<ossim_sint8*>(getBuf(band))+offset;
+      *buf       = (ossim_sint8)getNullPix(band);
+      break;
+   }
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   {
+      ossim_uint16* buf = static_cast<ossim_uint16*>(getBuf(band))+offset;
+      *buf = (ossim_uint16)getNullPix(band);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      ossim_sint16* buf = static_cast<ossim_sint16*>(getBuf(band))+offset;
+      *buf = (ossim_sint16)getNullPix(band);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      ossim_uint32* buf = static_cast<ossim_uint32*>(getBuf(band))+offset;
+      *buf       = (ossim_uint32)getNullPix(band);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      ossim_sint32* buf = static_cast<ossim_sint32*>(getBuf(band))+offset;
+      *buf       = (ossim_sint32)getNullPix(band);
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      ossim_float32* buf = static_cast<ossim_float32*>(getBuf(band))+offset;
+      *buf = (ossim_float32)getNullPix(band);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      ossim_float64* buf = static_cast<ossim_float64*>(getBuf(band))+offset;
+      *buf = getNullPix(band);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      //ERROR
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::isNull Unsupported scalar type!"
+      << std::endl;
+   }
+   }
+}
+
+void ossimImageData::setNull(const ossimIpt& pt)
+{
+   ossim_int32 xNew = (pt.x - m_origin.x);
+   ossim_int32 yNew = (pt.y - m_origin.y);
+
+   if(xNew < 0 || xNew >= (int)m_spatialExtents[0] ||
+         yNew < 0 || yNew >= (int)m_spatialExtents[1])
+   {
+      return;
+   }
+   ossim_uint32 offset = ((int)getWidth())*yNew + xNew;
+
+   setNull(offset);
+}
+
+void ossimImageData::setNull(const ossimIpt& pt, ossim_uint32 band)
+{
+   ossim_int32 xNew = (pt.x - m_origin.x);
+   ossim_int32 yNew = (pt.y - m_origin.y);
+
+   if(xNew < 0 || xNew >= (int)m_spatialExtents[0] ||
+         yNew < 0 || yNew >= (int)m_spatialExtents[1])
+   {
+      return;
+   }
+   ossim_uint32 offset = ((int)getWidth())*yNew + xNew;
+
+   setNull(offset, band);
+}
+
+void ossimImageData::setNullPix(ossim_float64 null_pix)
+{
+   if(!m_numberOfDataComponents)
+   {
+      return;
+   }
+   m_nullPixelValue.resize(m_numberOfDataComponents);
+   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
+   {
+      m_nullPixelValue[band] = null_pix;
+   }
+}
+
+void ossimImageData::setNullPix(ossim_float64 null_pix, ossim_uint32 band)
+{
+   if( !m_numberOfDataComponents || (band >= m_numberOfDataComponents) )
+   {
+      return;
+   }
+   if (m_nullPixelValue.size() != m_numberOfDataComponents)
+   {
+      initializeNullDefault();
+   }
+   m_nullPixelValue[band] = null_pix;
+}
+
+void ossimImageData::setNullPix(const ossim_float64* nullPixArray,
+                                ossim_uint32 numberOfValues)
+{
+   if(!nullPixArray || !m_numberOfDataComponents)
+   {
+      return;
+   }
+
+   if (m_nullPixelValue.size() != m_numberOfDataComponents)
+   {
+      initializeNullDefault();
+   }
+
+   for(ossim_uint32 band = 0;
+         (band < numberOfValues) && (band < m_numberOfDataComponents);
+         ++band)
+   {
+      m_nullPixelValue[band] = nullPixArray[band];
+   }
+}
+
+void ossimImageData::setMinPix(ossim_float64 min_pix)
+{
+   if(!m_numberOfDataComponents)
+   {
+      return;
+   }
+   m_minPixelValue.resize(m_numberOfDataComponents);
+   for(ossim_uint32 band = 0; band < m_minPixelValue.size(); ++band)
+   {
+      m_minPixelValue[band] = min_pix;
+   }
+}
+
+void ossimImageData::setMinPix(ossim_float64 min_pix, ossim_uint32 band)
+{
+   if( !m_numberOfDataComponents || (band >= m_numberOfDataComponents) )
+   {
+      return;
+   }
+   if (m_minPixelValue.size() != m_numberOfDataComponents)
+   {
+      initializeMinDefault();
+   }
+   m_minPixelValue[band] = min_pix;
+}
+
+void ossimImageData::setMinPix(const ossim_float64* minPixArray,
+                               ossim_uint32 numberOfValues)
+{
+   if( !minPixArray || !m_numberOfDataComponents )
+   {
+      return;
+   }
+
+   if (m_minPixelValue.size() != m_numberOfDataComponents)
+   {
+      initializeMinDefault();
+   }
+
+   for(ossim_uint32 band = 0;
+         (band < numberOfValues) && (band < m_numberOfDataComponents);
+         ++band)
+   {
+      m_minPixelValue[band] = minPixArray[band];
+   }
+}
+
+void ossimImageData::setMaxPix(ossim_float64 max_pix)
+{
+   if(!m_numberOfDataComponents)
+   {
+      return;
+   }
+   m_maxPixelValue.resize(m_numberOfDataComponents);
+   for(ossim_uint32 band = 0; band < m_numberOfDataComponents; ++band)
+   {
+      m_maxPixelValue[band] = max_pix;
+   }
+}
+
+void ossimImageData::setMaxPix(ossim_float64 max_pix, ossim_uint32 band)
+{
+   if( !m_numberOfDataComponents || (band >= m_numberOfDataComponents) )
+   {
+      return;
+   }
+   if (m_maxPixelValue.size() != m_numberOfDataComponents)
+   {
+      initializeMaxDefault();
+   }
+   m_maxPixelValue[band] = max_pix;
+}
+
+void ossimImageData::setMaxPix(const ossim_float64* maxPixArray,
+                               ossim_uint32 /* numberOfValues */)
+{
+   if(!maxPixArray || !m_numberOfDataComponents )
+   {
+      return;
+   }
+
+   if (m_maxPixelValue.size() != m_numberOfDataComponents)
+   {
+      initializeMaxDefault();
+   }
+
+   for(ossim_uint32 band = 0;
+         (band < m_numberOfDataComponents) &&
+               (band < m_numberOfDataComponents);
+         ++band)
+   {
+      m_maxPixelValue[band] = maxPixArray[band];
+   }
+}
+
+void ossimImageData::setNumberOfBands(ossim_uint32 bands,
+                                      bool reallocate)
+{
+   ossim_uint32 b  = getNumberOfBands();
+   if(bands && (b != bands))
+   {
+      setNumberOfDataComponents(bands);
+      if(reallocate)
+      {
+         ossimRectilinearDataObject::initialize();
+      }
+
+      ossim_uint32 minBands = ossim::min(b, bands);
+
+
+      vector<ossim_float64> newNull(bands);
+      vector<ossim_float64> newMin(bands);
+      vector<ossim_float64> newMax(bands);
+
+      ossim_uint32 i = 0;
+      while (i < minBands)
+      {
+         newNull[i] = m_nullPixelValue[i];
+         newMin[i]  = m_minPixelValue[i];
+         newMax[i]  = m_maxPixelValue[i];
+         ++i;
+      }
+
+      if(b)
+      {
+         while (i < bands)
+         {
+            newNull[i] = m_nullPixelValue[b-1];
+            newMin[i]  = m_minPixelValue[b-1];
+            newMax[i]  = m_maxPixelValue[b-1];
+            ++i;
+         }
+      }
+
+      m_nullPixelValue = newNull;
+      m_minPixelValue  = newMin;
+      m_maxPixelValue  = newMax;
+   }
+}
+
+void ossimImageData::setImageRectangleAndBands(const ossimIrect& rect,
+                                               ossim_uint32 numberOfBands)
+{
+   if(rect.hasNans())
+   {
+      return;
+   }
+
+   ossim_uint32 bands   = getNumberOfBands();
+   ossim_uint32 w       = getWidth();
+   ossim_uint32 h       = getHeight();
+   ossim_uint32 nw      = rect.width();
+   ossim_uint32 nh      = rect.height();
+
+   setOrigin(rect.ul());
+   setWidthHeight(nw, nh);
+   setNumberOfBands(numberOfBands, false);
+
+   // we will try to be non destructive on the resize of the number of bands
+   if( ( (w*h != nw*nh)  || ( bands != numberOfBands) ) &&
+         (theDataObjectStatus != OSSIM_NULL) )
+   {
+      initialize();
+   }
+}
+
+void ossimImageData::setImageRectangle(const ossimIrect& rect)
+{
+   if(rect.hasNans())
+   {
+      return;
+   }
+
+   ossim_uint32 w  = getWidth();
+   ossim_uint32 h  = getHeight();
+   ossim_uint32 nw = rect.width();
+   ossim_uint32 nh = rect.height();
+
+   setOrigin(rect.ul());
+   setWidthHeight(nw, nh);
+
+   // we will try to be non destructive on the resize of the number of bands
+   if ( (w*h != nw*nh) && (theDataObjectStatus != OSSIM_NULL) )
+   {
+      initialize();
+   }
+}
+
+void ossimImageData::assign(const ossimDataObject* data)
+{
+   if(data)
+   {
+      const ossimImageData* d = dynamic_cast<const ossimImageData*>(data);
+      if(d)
+      {
+         assign(d);
+      }
+   }
+}
+
+void ossimImageData::assign(const ossimImageData* data)
+{
+   ossimSource* tmp_owner = getOwner();
+
+   ossimRectilinearDataObject::assign(data);
+
+   //***
+   // The data member "theSource" will be overwritten so capture it and then
+   // set it back.
+   //***
+   setOwner(tmp_owner);
+
+   if(this != data)
+   {
+      ossim_uint32 numberOfBands = getNumberOfBands();
+      if(!numberOfBands)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimImageData::assign\n"
+                  << "Number of components is 0, can't assign" << std::endl;
+         return;
+      }
+      m_origin = data->m_origin;
+
+      m_minPixelValue  = data->m_minPixelValue;
+      m_maxPixelValue  = data->m_maxPixelValue;
+      m_nullPixelValue = data->m_nullPixelValue;
+
+      if (m_minPixelValue.size() == 0 ||
+            m_maxPixelValue.size() == 0 ||
+            m_nullPixelValue.size() == 0)
+      {
+         initializeDefaults();
+      }
+
+      ossim_uint32 source_size = data->getSizeInBytes();
+      const void*  s = data->getBuf();
+      void*        d = getBuf();
+      if (s && d)
+         memcpy(d, s, source_size);
+
+   }
+}
+
+void ossimImageData::assignBand(const ossimImageData* data,
+                                ossim_uint32 source_band,
+                                ossim_uint32 output_band)
+{
+   //***
+   // This method requires this image data to be initialized to the same
+   // size as the source data being copied.
+   //***
+
+   // Some basic error checking...
+   if ( !data->isValidBand(source_band) )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::assignBand ERROR:"
+               << "\nInvalid source band!" << std::endl;
+      return;
+   }
+   if ( !isValidBand(output_band) )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::assignBand ERROR:"
+               << "\nInvalid output band!" << std::endl;
+      return;
+   }
+   if (data->getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::assignBand ERROR:"
+               << "\nSource data status is null!" << std::endl;
+      return;
+   }
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::assignBand ERROR:"
+               << "\nThis status is null!" << std::endl;
+      return;
+   }
+
+   //***
+   // Make sure this buffer is the same size; if not, return.
+   //***
+   ossim_uint32 source_size = data->getSizePerBandInBytes();
+
+   if ( source_size != getSizePerBandInBytes() )
+   {
+      return;
+   }
+
+   // Get the pointers to the bands.
+   const void*  s = data->getBuf(source_band);
+   void*        d = getBuf(output_band);
+
+   // One last check.
+   if (s == 0 || d == 0)
+   {
+      return;
+   }
+
+   // Ok copy the image data...
+   memcpy(d, s, source_size);
+}
+
+void ossimImageData::loadBand(const void* src,
+                              const ossimIrect& src_rect,
+                              ossim_uint32 band)
+{
+   // Call the appropriate load method.
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadBandTemplate(ossim_uint8(0), src, src_rect, band);
+      return;
+
+   case OSSIM_SINT8:
+      loadBandTemplate(ossim_sint8(0), src, src_rect, band);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadBandTemplate(ossim_uint16(0), src, src_rect, band);
+      return;
+
+   case OSSIM_SINT16:
+      loadBandTemplate(ossim_sint16(0), src, src_rect, band);
+      return;
+
+   case OSSIM_UINT32:
+      loadBandTemplate(ossim_uint32(0), src, src_rect, band);
+      return;
+
+   case OSSIM_SINT32:
+      loadBandTemplate(ossim_sint32(0), src, src_rect, band);
+      return;
+
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+      loadBandTemplate(ossim_float32(0), src, src_rect, band);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadBandTemplate(ossim_float64(0), src, src_rect, band);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadBand\n\
+File %s line %d\nUnknown scalar type!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::loadBand(const void* src,
+                              const ossimIrect& src_rect,
+                              const ossimIrect& clip_rect,
+                              ossim_uint32 band)
+{
+   // Call the appropriate load method.
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadBandTemplate(ossim_uint8(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SINT8:
+      loadBandTemplate(ossim_sint8(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadBandTemplate(ossim_uint16(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SINT16:
+      loadBandTemplate(ossim_sint16(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_UINT32:
+      loadBandTemplate(ossim_uint32(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SINT32:
+      loadBandTemplate(ossim_sint32(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+      loadBandTemplate(ossim_float32(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadBandTemplate(ossim_float64(0), src, src_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadBand\n\
+File %s line %d\nUnknown scalar type!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+template <class T> void ossimImageData::loadBandTemplate(T, // dummy template variable
+                                                         const void* src,
+                                                         const ossimIrect& src_rect,
+                                                         ossim_uint32 band)
+{
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Get the clip rect.
+   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+
+   loadBandTemplate(T(0), src, src_rect, clip_rect, band);
+}
+
+template <class T> void ossimImageData::loadBandTemplate(T, // dummy template variable
+                                                         const void* src,
+                                                         const ossimIrect& src_rect,
+                                                         const ossimIrect& clip_rect,
+                                                         ossim_uint32 band)
+{
+   static const char  MODULE[] = "ossimImageData::loadBand";
+
+   // Check the pointer.
+   if (!src)
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nNULL pointer passed to method!",
+                    MODULE,
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+
+   // Check the band.
+   if (!isValidBand(band))
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nInvalid band:  %d",
+                    MODULE,
+                    __FILE__,
+                    __LINE__,
+                    band);
+      return;
+   }
+
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Check for intersect.
+   if ( ! img_rect.intersects(src_rect) )
+   {
+      return; // Nothing to do here.
+   }
+
+   // Check the clip rect.
+   if (!clip_rect.completely_within(img_rect))
+   {
+      return;
+   }
+
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+   // Get the width of the buffers.
+   ossim_uint32 s_width = src_rect.width();
+   ossim_uint32 d_width = getWidth();
+
+   const T* s = static_cast<const T*>(src);
+   T* d = static_cast<T*>(getBuf(band));
+
+   // Move the pointers to the first valid pixel.
+   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
+         clip_rect.ul().x - src_rect.ul().x;
+
+   d += (clip_rect.ul().y - img_rect.ul().y) * d_width +
+         clip_rect.ul().x - img_rect.ul().x;
+
+   // Copy the data.
+   ossim_uint32 clipHeight = clip_rect.height();
+   ossim_uint32 clipWidth  = clip_rect.width();
+
+   for (ossim_uint32 line = 0; line < clipHeight; ++line)
+   {
+      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+      {
+         d[sample] = s[sample];
+      }
+
+      s += s_width;
+      d += d_width;
+   }
+}
+
+void ossimImageData::loadTile(const ossimImageData* src)
+{
+   if (!src)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::loadTile ERROR:"
+               << "Null tile passed to method!" << std::endl;
+      return;
+   }
+
+   if (!src->getBuf())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::loadTile ERROR:"
+               << "Source tile buff is null!" << std::endl;
+      return;
+   }
+
+   if (!this->getBuf())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::loadTile ERROR:"
+               << "This tile not initialized!" << std::endl;
+      return;
+   }
+
+   if (src->getNumberOfBands() != this->getNumberOfBands())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::loadTile ERROR:"
+               << "Tiles do not have same number of bands!" << std::endl;
+      return;
+   }
+
+   //***
+   // Set the status of this tile to the status of the source tile.
+   // Do this in place of validate.
+   //***
+   setDataObjectStatus(src->getDataObjectStatus());
+
+   if(getScalarType() == src->getScalarType())
+   {      
+      loadTile((void*)(src->getBuf()),
+               src->getImageRectangle(),
+               OSSIM_BSQ);
+      setNullPix(src->getNullPix(), src->getNumberOfBands());
+   }
+   else // do a slow generic normalize to unnormalize copy
+   {
+      // Check the pointer.
+      ossimIrect src_rect = src->getImageRectangle();
+      const ossimIrect img_rect = getImageRectangle();
+
+      // Check for intersect.
+      if ( !img_rect.intersects(src_rect) )
+      {
+         return; // Nothing to do here.
+      }
+
+      // Get the clip rect.
+      const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+      // Check the status and allocate memory if needed.
+      if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+      // Get the width of the buffers.
+      ossim_uint32 num_bands     = getNumberOfBands();
+      ossim_uint32 s_width       = src_rect.width();
+      ossim_uint32 d_width       = getWidth();
+
+      ossim_uint32 band;
+
+      ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) *
+            s_width + (clip_rect.ul().x - src_rect.ul().x);
+
+      ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) *
+            d_width + (clip_rect.ul().x - img_rect.ul().x);
+
+      ossim_uint32 clipHeight = clip_rect.height();
+      ossim_uint32 clipWidth  = clip_rect.width();
+
+      // Copy the data.
+      for (band=0; band<num_bands; ++band)
+      {
+         ossim_uint32 sourceIndex      = sourceOffset;
+         ossim_uint32 destinationIndex = destinationOffset;
+         ossim_float32 tempResult      = 0.0;
+
+         for (ossim_uint32 line = 0; line < clipHeight; ++line)
+         {
+            for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+            {
+               src->getNormalizedFloat(sourceIndex + sample,
+                                       band,
+                                       tempResult);
+
+               this->setNormalizedFloat(destinationIndex + sample,
+                                        band,
+                                        tempResult);
+            }
+            sourceIndex      += s_width;
+            destinationIndex += d_width;
+         }
+      }
+   }
+}
+
+void ossimImageData::loadTile(const void* src,
+                              const ossimIrect& src_rect,
+                              ossimInterleaveType il_type)
+{
+   switch (il_type)
+   {
+   case OSSIM_BIP:
+      loadTileFromBip(src, src_rect);
+      return;
+   case OSSIM_BIL:
+      loadTileFromBil(src, src_rect);
+      return;
+   case OSSIM_BSQ:
+      loadTileFromBsq(src, src_rect);
+      return;
+   default:
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::loadTile ERROR:  unsupported interleave type!"
+      << std::endl;
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTile\n\
+File %s line %d\nUnknown interleave type!",
+__FILE__,
+__LINE__);
+      return;
+   } // End of "switch (type)"
+}
+
+void ossimImageData::loadTileWithAlpha(const void* src,
+                                       const ossimIrect& src_rect,
+                                       ossimInterleaveType il_type)
+{
+   switch (il_type)
+   {
+   case OSSIM_BIP:
+      loadTileFromBipAlpha(src, src_rect);
+      return;
+      /*   case OSSIM_BIL:
+      loadTileFromBil(src, src_rect);
+      return;
+   case OSSIM_BSQ:
+      loadTileFromBsq(src, src_rect);
+      return;
+       */
+   default:
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::loadTileWithAlpha ERROR:  unsupported interleave type!"
+      << std::endl;
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTile\n\
+File %s line %d\nUnknown interleave type!",
+__FILE__,
+__LINE__);
+      return;
+   } // End of "switch (type)"
+}
+
+void ossimImageData::loadTile(const void* src,
+                              const ossimIrect& src_rect,
+                              const ossimIrect& clip_rect,
+                              ossimInterleaveType il_type)
+{
+   switch (il_type)
+   {
+   case OSSIM_BIP:
+      loadTileFromBip(src, src_rect, clip_rect);
+      return;
+   case OSSIM_BIL:
+      loadTileFromBil(src, src_rect, clip_rect);
+      return;
+   case OSSIM_BSQ:
+      loadTileFromBsq(src, src_rect, clip_rect);
+      return;
+   default:
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::loadTile ERROR:  unsupported interleave type!"
+      << std::endl;
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTile\n\
+File %s line %d\nUnknown interleave type!",
+__FILE__,
+__LINE__);
+      return;
+   } // End of "switch (type)"
+}
+
+
+void ossimImageData::nullTileAlpha(const ossim_uint8* src,
+                                   const ossimIrect& src_rect,
+                                   bool multiplyAlphaFlag)
+{
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Get the clip rect.
+   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+   nullTileAlpha(src, src_rect, clip_rect, multiplyAlphaFlag);
+}
+
+void ossimImageData::nullTileAlpha(const ossim_uint8* src,
+                                   const ossimIrect& src_rect,
+                                   const ossimIrect& clip_rect,
+                                   bool multiplyAlphaFlag)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      nullTileAlphaTemplate(ossim_uint8(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_SINT8:
+      nullTileAlphaTemplate(ossim_sint8(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      nullTileAlphaTemplate(ossim_uint16(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_SINT16:
+      nullTileAlphaTemplate(ossim_sint16(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_UINT32:
+      nullTileAlphaTemplate(ossim_uint32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_SINT32:
+      nullTileAlphaTemplate(ossim_sint32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      nullTileAlphaTemplate(ossim_float32(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      nullTileAlphaTemplate(ossim_float64(0), src, src_rect, clip_rect, multiplyAlphaFlag);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::nullTileAlpha\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+
+}
+
+void ossimImageData::loadTileFromBip(const void* src,
+                                     const ossimIrect& src_rect)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadTileFromBipTemplate(ossim_uint8(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT8:
+      loadTileFromBipTemplate(ossim_sint8(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadTileFromBipTemplate(ossim_uint16(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT16:
+      loadTileFromBipTemplate(ossim_sint16(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT32:
+      loadTileFromBipTemplate(ossim_uint32(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT32:
+      loadTileFromBipTemplate(ossim_sint32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      loadTileFromBipTemplate(ossim_float32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadTileFromBipTemplate(ossim_float64(0), src, src_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTileFromBip\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::loadTileFromBipAlpha(const void* src,
+                                          const ossimIrect& src_rect)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadTileFromBipAlphaTemplate(ossim_uint8(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT8:
+      loadTileFromBipAlphaTemplate(ossim_sint8(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadTileFromBipAlphaTemplate(ossim_uint16(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT16:
+      loadTileFromBipAlphaTemplate(ossim_sint16(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT32:
+      loadTileFromBipAlphaTemplate(ossim_uint32(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT32:
+      loadTileFromBipAlphaTemplate(ossim_sint32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      loadTileFromBipAlphaTemplate(ossim_float32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadTileFromBipAlphaTemplate(ossim_float64(0), src, src_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTileFromBip\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::loadTileFromBip(const void* src,
+                                     const ossimIrect& src_rect,
+                                     const ossimIrect& clip_rect)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadTileFromBipTemplate(ossim_uint8(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT8:
+      loadTileFromBipTemplate(ossim_sint8(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadTileFromBipTemplate(ossim_uint16(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT16:
+      loadTileFromBipTemplate(ossim_sint16(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT32:
+      loadTileFromBipTemplate(ossim_uint32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT32:
+      loadTileFromBipTemplate(ossim_sint32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      loadTileFromBipTemplate(ossim_float32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadTileFromBipTemplate(ossim_float64(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTileFromBip\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::loadTileFromBil(const void* src,
+                                     const ossimIrect& src_rect)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadTileFromBilTemplate(ossim_uint8(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT8:
+      loadTileFromBilTemplate(ossim_sint8(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadTileFromBilTemplate(ossim_uint16(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT16:
+      loadTileFromBilTemplate(ossim_sint16(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT32:
+      loadTileFromBilTemplate(ossim_uint32(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT32:
+      loadTileFromBilTemplate(ossim_sint32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      loadTileFromBilTemplate(ossim_float32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadTileFromBilTemplate(ossim_float64(0), src, src_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTileFromBil\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::loadTileFromBil(const void* src,
+                                     const ossimIrect& src_rect,
+                                     const ossimIrect& clip_rect)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadTileFromBilTemplate(ossim_uint8(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT8:
+      loadTileFromBilTemplate(ossim_sint8(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadTileFromBilTemplate(ossim_uint16(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT16:
+      loadTileFromBilTemplate(ossim_sint16(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT32:
+      loadTileFromBilTemplate(ossim_uint32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT32:
+      loadTileFromBilTemplate(ossim_sint32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      loadTileFromBilTemplate(ossim_float32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadTileFromBilTemplate(ossim_float64(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTileFromBil\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::loadTileFromBsq(const void* src,
+                                     const ossimIrect& src_rect)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadTileFromBsqTemplate(ossim_uint8(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT8:
+      loadTileFromBsqTemplate(ossim_sint8(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadTileFromBsqTemplate(ossim_uint16(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT16:
+      loadTileFromBsqTemplate(ossim_sint16(0), src, src_rect);
+      return;
+
+   case OSSIM_UINT32:
+      loadTileFromBsqTemplate(ossim_uint32(0), src, src_rect);
+      return;
+
+   case OSSIM_SINT32:
+      loadTileFromBsqTemplate(ossim_sint32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      loadTileFromBsqTemplate(ossim_float32(0), src, src_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadTileFromBsqTemplate(ossim_float64(0), src, src_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTileFromBsq\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::loadTileFromBsq(const void* src,
+                                     const ossimIrect& src_rect,
+                                     const ossimIrect& clip_rect)
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      loadTileFromBsqTemplate(ossim_uint8(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT8:
+      loadTileFromBsqTemplate(ossim_sint8(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      loadTileFromBsqTemplate(ossim_uint16(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT16:
+      loadTileFromBsqTemplate(ossim_sint16(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT32:
+      loadTileFromBsqTemplate(ossim_uint32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT32:
+      loadTileFromBsqTemplate(ossim_sint32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      loadTileFromBsqTemplate(ossim_float32(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      loadTileFromBsqTemplate(ossim_float64(0), src, src_rect, clip_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::loadTileFromBsq\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::computeMinMaxPix(vector<ossim_float64>& minBands,
+                                      vector<ossim_float64>& maxBands) const
+{
+   if ( (getDataObjectStatus() == OSSIM_NULL) || 
+         (getDataObjectStatus() == OSSIM_EMPTY) )
+   {
+      return;
+   }
+
+   switch(m_scalarType)
+   {
+   case OSSIM_UINT8:
+   {
+      computeMinMaxPix((ossim_uint8)0,
+                       minBands,
+                       maxBands);
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      computeMinMaxPix((ossim_sint8)0,
+                       minBands,
+                       maxBands);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      computeMinMaxPix((ossim_uint16)0,
+                       minBands,
+                       maxBands);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      computeMinMaxPix((ossim_sint16)0,
+                       minBands,
+                       maxBands);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      computeMinMaxPix((ossim_uint32)0,
+                       minBands,
+                       maxBands);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      computeMinMaxPix((ossim_sint32)0,
+                       minBands,
+                       maxBands);
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      computeMinMaxPix((ossim_float32)0.0,
+                       minBands,
+                       maxBands);
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      computeMinMaxPix((ossim_float64)0.0,
+                       minBands,
+                       maxBands);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      // Shouldn't hit this.
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::computeMinPix Unsupported scalar type!"
+      << std::endl;
+      break;
+   }
+   }
+}
+
+template <class T>
+void ossimImageData::computeMinMaxPix(T /* dummyValue */,
+                                      vector<ossim_float64>& minBands,
+                                      vector<ossim_float64>& maxBands) const
+{
+   const ossim_uint32 BANDS = getNumberOfBands();
+   const ossim_uint32 SPB   = getSizePerBand(); 
+
+   if( minBands.size() != BANDS ||
+         maxBands.size() != BANDS )
+   {
+      minBands.resize(BANDS);
+      maxBands.resize(BANDS);
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         // Set min to max and max to min for starters.
+         minBands[band] = getMaxPix(band);
+         maxBands[band] = getMinPix(band);
+      }
+   }
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const T* bandBuffer = (const T*)getBuf(band);
+      if(bandBuffer)
+      {
+         const T NP   = static_cast<T>(getNullPix(band));
+         ossim_float64 currentMin = minBands[band];
+         ossim_float64 currentMax = maxBands[band];
+         for(ossim_uint32 offset = 0; offset < SPB; ++offset)
+         {
+            T p = bandBuffer[offset];
+            if(p != NP)
+            {
+               if(p < currentMin)
+               {
+                  currentMin = p;
+               }
+               else if(p > currentMax)
+               {
+                  currentMax = p;
+               }
+            }
+         }
+         minBands[band] = currentMin;
+         maxBands[band] = currentMax;
+      }
+   }
+}
+
+void ossimImageData::computeMinMaxNulPix(vector<ossim_float64>& minBands,
+                                         vector<ossim_float64>& maxBands,
+                                         vector<ossim_float64>& nulBands) const
+{
+   if ( getDataObjectStatus() == OSSIM_NULL )
+   {
+      return;
+   }
+
+   switch(m_scalarType)
+   {
+   case OSSIM_UINT8:
+   {
+      computeMinMaxNulPix((ossim_uint8)0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      computeMinMaxNulPix((ossim_sint8)0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      computeMinMaxNulPix((ossim_uint16)0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      computeMinMaxNulPix((ossim_sint16)0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      computeMinMaxNulPix((ossim_uint32)0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      computeMinMaxNulPix((ossim_sint32)0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      computeMinMaxNulPix((ossim_float32)0.0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      computeMinMaxNulPix((ossim_float64)0.0,
+                          minBands,
+                          maxBands,
+                          nulBands);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      // Shouldn't hit this.
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::computeMinNulPix Unsupported scalar type!"
+      << std::endl;
+      break;
+   }
+   }
+}
+
+template <class T>
+void ossimImageData::computeMinMaxNulPix(T /* dummyValue */,
+                                         vector<ossim_float64>& minBands,
+                                         vector<ossim_float64>& maxBands,
+                                         vector<ossim_float64>& nulBands) const
+{
+   const ossim_uint32 BANDS = getNumberOfBands();
+   const ossim_uint32 SPB   = getSizePerBand(); 
+   T DEFAULT_NULL = static_cast<T>(ossim::defaultNull(getScalarType()));   
+
+   if( minBands.size() != BANDS ||
+         maxBands.size() != BANDS ||
+         nulBands.size() != BANDS )
+   {
+      // First time through.
+      minBands.resize(BANDS);
+      maxBands.resize(BANDS);
+      nulBands.resize(BANDS);
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         // Set min to max and max to min for starters.
+         minBands[band] = getMaxPix(band);
+         maxBands[band] = getMinPix(band);
+         nulBands[band] = getMaxPix(band);
+      }
+   }
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const T* bandBuffer = (const T*)getBuf(band);
+      if(bandBuffer)
+      {
+         ossim_float64 currentMin = minBands[band];
+         ossim_float64 currentMax = maxBands[band];
+         ossim_float64 currentNul = nulBands[band];
+         for(ossim_uint32 offset = 0; offset < SPB; ++offset)
+         {
+            T p = bandBuffer[offset];
+
+            // Since we are scanning for nulls this is making an assumption that the default
+            // null is incorrect and should be ignored in this scan as it could have been
+            // introduced by a make blank on a partial tile so ignore it.
+            // NOTE (OLK 03/2015): It is a bad idea to ignore pixels with default nulls, as it may
+            // be the actual null value being used. By ignoring it, a new null will be latched
+            // corresponding to actual, non-null, minimum value. Unfortunately, when tiles are
+            // initialized, they are filled with default nulls since (with float-data), the
+            // null (if any exists) is not yet known -- effectively creating two null pixel values.
+            // The recommendation (if you're looking at this code, then you're probably having the
+            // problem that your nulls aren't being recognized), is to turn off the flag in your
+            // ossim prefs file with: overview_builder.scan_for_min_max_null_if_float: false
+            // (or just delete that line)
+            if ( p != DEFAULT_NULL )
+            {
+               // Must do null first as min depends on null.
+               if ( p < currentNul )
+               {
+                  currentNul = p;
+               }
+               if( ( p < currentMin ) && ( p > currentNul ) )
+               {
+                  currentMin = p;
+               }
+               else if( p > currentMax )
+               {
+                  currentMax = p;
+               }
+            }
+         }
+         minBands[band] = currentMin;
+         maxBands[band] = currentMax;
+         nulBands[band] = currentNul;
+      }
+   }
+}
+
+template <class T>
+void ossimImageData::loadTileFromBipTemplate(T, // dummy template variable
+                                             const void* src,
+                                             const ossimIrect& src_rect)
+{
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Get the clip rect.
+   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+   loadTileFromBipTemplate(T(0), src, src_rect, clip_rect);
+}
+template <class T>
+void ossimImageData::loadTileFromBipAlphaTemplate(T, // dummy template variable
+                                                  const void* src,
+                                                  const ossimIrect& src_rect)
+{
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Get the clip rect.
+   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+   loadTileFromBipAlphaTemplate(T(0), src, src_rect, clip_rect);
+}
+
+template <class T>
+void ossimImageData::loadTileFromBipTemplate(T, // dummy template variable
+                                             const void* src,
+                                             const ossimIrect& src_rect,
+                                             const ossimIrect& clip_rect)
+{
+   static const char  MODULE[] = "ossimImageData::loadTileFromBip";
+
+   // Check the pointer.
+   if (!src)
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nNULL pointer passed to method!",
+                    MODULE,
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Check for intersect.
+   if ( ! img_rect.intersects(src_rect) )
+   {
+      return; // Nothing to do here.
+   }
+
+   // Check the clip rect.
+   if (!clip_rect.completely_within(img_rect))
+   {
+      return;
+   }
+
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+   // Get the width of the buffers.
+   ossim_uint32 num_bands  = getNumberOfBands();
+   ossim_uint32 s_width    = (src_rect.width()) * num_bands;
+   ossim_uint32 d_width    = getWidth();
+   ossim_uint32 band       = 0;
+   const T* s        = static_cast<const T*>(src);
+   T** d             = new T*[num_bands];
+
+   // Make destination pointers to each one.
+   for (band=0; band<num_bands; band++)
+   {
+      d[band] = static_cast<T*>(getBuf(band));
+
+      // Move the pointers to the first valid pixel.
+      d[band] += (clip_rect.ul().y - img_rect.ul().y) * d_width +
+            clip_rect.ul().x - img_rect.ul().x;
+   }
+
+   // Move the source pointer to the first valid pixel.
+   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
+         (clip_rect.ul().x - src_rect.ul().x) * num_bands;
+
+   // Copy the data.
+   ossim_uint32 clipHeight = clip_rect.height();
+   ossim_uint32 clipWidth  = clip_rect.width();
+
+   for (ossim_uint32 line = 0; line < clipHeight; ++line)
+   {
+      ossim_uint32 j = 0;
+      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+      {
+         for (band=0; band<num_bands; band++)
+         {
+            d[band][sample] = s[j+band];
+         }
+         j += num_bands;
+      }
+
+      s += s_width;
+      for (band=0; band<num_bands; band++)
+      {
+         d[band] += d_width;
+      }
+   }
+
+   delete [] d;
+}
+
+template <class T>
+void ossimImageData::loadTileFromBipAlphaTemplate(T, // dummy template variable
+                                                  const void* src,
+                                                  const ossimIrect& src_rect,
+                                                  const ossimIrect& clip_rect)
+{
+   static const char  MODULE[] = "ossimImageData::loadTileFromBip";
+
+   // Check the pointer.
+   if (!src)
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nNULL pointer passed to method!",
+                    MODULE,
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Check for intersect.
+   if ( ! img_rect.intersects(src_rect) )
+   {
+      return; // Nothing to do here.
+   }
+
+   // Check the clip rect.
+   if (!clip_rect.completely_within(img_rect))
+   {
+      return;
+   }
+
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+   // Get the width of the buffers.
+   ossim_uint32 num_bands  = getNumberOfBands();
+   ossim_uint32 s_width    = (src_rect.width()) * (num_bands+1);
+   ossim_uint32 d_width    = getWidth();
+   ossim_uint32 band       = 0;
+   const T* s        = static_cast<const T*>(src);
+   T** d             = new T*[num_bands];
+
+   // Make destination pointers to each one.
+   for (band=0; band<num_bands; band++)
+   {
+      d[band] = static_cast<T*>(getBuf(band));
+
+      // Move the pointers to the first valid pixel.
+      d[band] += (clip_rect.ul().y - img_rect.ul().y) * d_width +
+            clip_rect.ul().x - img_rect.ul().x;
+   }
+
+   // Move the source pointer to the first valid pixel. 
+   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
+         (clip_rect.ul().x - src_rect.ul().x) * (num_bands+1); // +1 for the alpha
+
+   // Copy the data.
+   ossim_uint32 clipHeight = clip_rect.height();
+   ossim_uint32 clipWidth  = clip_rect.width();
+
+   for (ossim_uint32 line = 0; line < clipHeight; ++line)
+   {
+      ossim_uint32 j = 0;
+      for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+      {
+         for (band=0; band<num_bands; band++)
+         {
+            d[band][sample] = s[j+band];
+         }
+         j += (num_bands+1); // need to offset by the alpha channel
+      }
+
+      s += s_width;
+      for (band=0; band<num_bands; band++)
+      {
+         d[band] += d_width;
+      }
+   }
+
+   delete [] d;
+}
+
+template <class T>
+void ossimImageData::loadTileFromBilTemplate(T, // dummy template variable
+                                             const void* src,
+                                             const ossimIrect& src_rect)
+{
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Get the clip rect.
+   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+   loadTileFromBilTemplate(T(0), src, src_rect, clip_rect);
+}
+
+template <class T>
+void ossimImageData::loadTileFromBilTemplate(T, // dummy template variable
+                                             const void* src,
+                                             const ossimIrect& src_rect,
+                                             const ossimIrect& clip_rect)
+{
+   static const char  MODULE[] = "ossimImageData::loadTileFromBil";
+
+   // Check the pointer.
+   if (!src)
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nNULL pointer passed to method!",
+                    MODULE,
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Check for intersect.
+   if ( ! img_rect.intersects(src_rect) )
+   {
+      return; // Nothing to do here.
+   }
+
+   // Check the clip rect.
+   if (!clip_rect.completely_within(img_rect))
+   {
+      return;
+   }
+
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+   // Get the width of the buffers.
+   ossim_uint32 num_bands = getNumberOfBands();
+   ossim_uint32 s_width = (src_rect.lr().x - src_rect.ul().x + 1);
+   ossim_uint32 d_width = getWidth();
+   ossim_uint32 band = 0;
+   ossim_uint32 d_offset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
+         clip_rect.ul().x - img_rect.ul().x;
+
+   const T* s = static_cast<const T*>(src);
+
+   // Get the number of bands and make destination pointers to each one.
+   T** d = new T*[num_bands];
+
+   for (band=0; band<num_bands; band++)
+   {
+      d[band] = static_cast<T*>(getBuf(band));
+
+      // Move the pointers to the first valid pixel.
+      d[band] += d_offset;
+   }
+
+   // Move the source pointer to the first valid pixel.
+   s += (clip_rect.ul().y - src_rect.ul().y) * s_width * num_bands +
+         clip_rect.ul().x - src_rect.ul().x;
+
+   // Copy the data.
+   ossim_uint32 clipHeight = clip_rect.height();
+   ossim_uint32 clipWidth  = clip_rect.width();
+
+   for (ossim_uint32 line = 0; line < clipHeight; ++line)
+   {
+      for (band = 0; band < num_bands; ++band)
+      {
+         for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+         {
+            d[band][sample] = s[sample];
+         }
+         s       += s_width;
+         d[band] += d_width;
+      }
+   }
+
+   delete [] d;
+}
+
+template <class T>
+void ossimImageData::loadTileFromBsqTemplate(T, // dummy template variable
+                                             const void* src,
+                                             const ossimIrect& src_rect)
+{
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Get the clip rect.
+   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+   loadTileFromBsqTemplate(T(0), src, src_rect, clip_rect);
+}
+
+template <class T>
+void ossimImageData::loadTileFromBsqTemplate(T, // dummy template variable
+                                             const void* src,
+                                             const ossimIrect& src_rect,
+                                             const ossimIrect& clip_rect)
+{
+   static const char  MODULE[] = "ossimImageData::loadTileFromBsq";
+
+   // Check the pointer.
+   if (!src)
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nNULL pointer passed to method!",
+                    MODULE,
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Check for intersect.
+   if ( ! img_rect.intersects(src_rect) )
+   {
+      return; // Nothing to do here.
+   }
+
+   // Check the clip rect.
+   if (!clip_rect.completely_within(img_rect))
+   {
+      return;
+   }
+
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+   // Get the width of the buffers.
+   ossim_uint32 num_bands = getNumberOfBands();
+   ossim_uint32 s_width = src_rect.width();
+   ossim_uint32 d_width = getWidth();
+   ossim_uint32 s_band_offset = s_width * src_rect.height();
+
+   const T* s = static_cast<const T*>(src);
+
+   ossim_uint32 band;
+   ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
+         (clip_rect.ul().x - img_rect.ul().x);
+   ossim_uint32 destinationIndex = destinationOffset;
+   ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) * s_width +
+         (clip_rect.ul().x - src_rect.ul().x);
+   ossim_uint32 sourceIndex = sourceOffset;
+   ossim_uint32 clipHeight = clip_rect.height();
+   ossim_uint32 clipWidth = clip_rect.width();
+
+   // Copy the data.
+   for (band=0; band<num_bands; band++)
+   {
+      T* destinationBand = static_cast<T*>(getBuf(band));
+      destinationIndex = destinationOffset;
+      sourceIndex = sourceOffset + s_band_offset*band;
+
+      for (ossim_uint32 line = 0; line < clipHeight; ++line)
+      {
+         for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+         {
+            destinationBand[destinationIndex + sample]
+                            = s[sourceIndex+sample];
+         }
+         sourceIndex += s_width;
+         destinationIndex += d_width;
+      }
+   }
+}
+
+void ossimImageData::loadTileFrom1Band(const void* src,
+                                       const ossimIrect& src_rect)
+{
+   ossim_uint32 bands = getNumberOfBands();
+   for(ossim_uint32 band = 0; band < bands; ++band)
+   {
+      loadBand(src, src_rect, band);
+   }
+}
+
+void ossimImageData::loadTileFrom1Band(const ossimImageData* src)
+{
+   if(!src) return;
+   loadTileFrom1Band((const void*)src->getBuf(),
+                     src->getImageRectangle());
+}
+
+void ossimImageData::loadShortBand(const void* src,
+                                   const ossimIrect& src_rect,
+                                   ossim_uint32 band,
+                                   bool swap_bytes)
+{
+   static const char  MODULE[] = "ossimImageData::loadShortBand";
+
+   // Check the pointer.
+   if (!src)
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nNULL pointer passed to method!",
+                    MODULE,
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+
+   // Check the band.
+   if (!isValidBand(band))
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nInvalid band:  %d",
+                    MODULE,
+                    __FILE__,
+                    __LINE__,
+                    band);
+      return;
+   }
+
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Check for intersect.
+   if ( ! img_rect.intersects(src_rect) )
+   {
+      return; // Nothing to do here.
+   }
+
+   // Get the clip rect.
+   const ossimIrect clip_rect = img_rect.clipToRect(src_rect);
+
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+   // Get the width of the buffers.
+   ossim_uint32 s_width = src_rect.width();
+   ossim_uint32 d_width = getWidth();
+
+   const ossim_uint16* s = static_cast<const ossim_uint16*>(src);
+   ossim_uint16* d = getUshortBuf(band);
+
+   // Move the pointers to the first valid pixel.
+   s += (clip_rect.ul().y - src_rect.ul().y) * s_width +
+         clip_rect.ul().x - src_rect.ul().x;
+
+   d += (clip_rect.ul().y - img_rect.ul().y) * d_width +
+         clip_rect.ul().x - img_rect.ul().x;
+
+   // Copy the data.
+   for (ossim_int32 line=clip_rect.ul().y; line<=clip_rect.lr().y; line++)
+   {
+      ossim_uint32 i = 0;
+      for (ossim_int32 sample=clip_rect.ul().x; sample<=clip_rect.lr().x; sample++)
+      {
+         d[i] = (swap_bytes ? ( (s[i] << 8) | (s[i] >> 8) ) :
+               s[i]);
+         ++i;
+      }
+
+      s += s_width;
+      d += d_width;
+   }
+
+   validate();
+}
+
+bool ossimImageData::isPointWithin(const ossimIpt& point)const
+{
+   return ((point.x >= m_origin.x)&&
+         (point.y >= m_origin.y)&&
+         ((point.x - m_origin.x)<static_cast<ossim_int32>(m_spatialExtents[0]))&&
+         ((point.y - m_origin.y)<static_cast<ossim_int32>(m_spatialExtents[1])));
+}
+
+bool ossimImageData::isPointWithin(ossim_int32 x, ossim_int32 y)const
+{
+   return ((x >= m_origin.x)&&
+         (y >= m_origin.y)&&
+         ((x - m_origin.x) < static_cast<ossim_int32>(m_spatialExtents[0]))&&
+         ((y - m_origin.y) < static_cast<ossim_int32>(m_spatialExtents[1])));
+}
+
+void ossimImageData::unloadTile(void* dest,
+                                const ossimIrect& dest_rect,
+                                ossimInterleaveType type) const
+{
+   unloadTile(dest, dest_rect, getImageRectangle(), type);
+}
+
+void ossimImageData::unloadTile(void* dest,
+                                const ossimIrect& dest_rect,
+                                const ossimIrect& clip_rect,
+                                ossimInterleaveType type) const
+{
+   switch (type)
+   {
+   case OSSIM_BIP:
+      unloadTileToBip(dest, dest_rect, clip_rect);
+      return;
+   case OSSIM_BIL:
+      unloadTileToBil(dest, dest_rect, clip_rect);
+      return;
+   case OSSIM_BSQ:
+      unloadTileToBsq(dest, dest_rect, clip_rect);
+      return;
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::unloadTile\n\
+File %s line %d\nUnknown scalar type!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::unloadTileToBip(void* dest,
+                                     const ossimIrect& dest_rect,
+                                     const ossimIrect& clip_rect) const
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      unloadTileToBipTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT8:
+      unloadTileToBipTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      unloadTileToBipTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT16:
+      unloadTileToBipTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT32:
+      unloadTileToBipTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT32:
+      unloadTileToBipTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      unloadTileToBipTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      unloadTileToBipTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::unloadTileToBip\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::unloadTileToBipAlpha(void* dest,
+                                          const ossimIrect& dest_rect,
+                                          const ossimIrect& clip_rect) const
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      unloadTileToBipAlphaTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT8:
+      unloadTileToBipAlphaTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      unloadTileToBipAlphaTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT16:
+      unloadTileToBipAlphaTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT32:
+      unloadTileToBipAlphaTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT32:
+      unloadTileToBipAlphaTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      unloadTileToBipAlphaTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      unloadTileToBipAlphaTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::unloadTileToBipAlpha\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::unloadTileToBil(void* dest,
+                                     const ossimIrect& dest_rect,
+                                     const ossimIrect& clip_rect) const
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      unloadTileToBilTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT8:
+      unloadTileToBilTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      unloadTileToBilTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT16:
+      unloadTileToBilTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT32:
+      unloadTileToBilTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT32:
+      unloadTileToBilTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      unloadTileToBilTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      unloadTileToBilTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::unloadTileToBil\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::unloadTileToBsq(void* dest,
+                                     const ossimIrect& dest_rect,
+                                     const ossimIrect& clip_rect) const
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      unloadTileToBsqTemplate(ossim_uint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT8:
+      unloadTileToBsqTemplate(ossim_sint8(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      unloadTileToBsqTemplate(ossim_uint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT16:
+      unloadTileToBsqTemplate(ossim_sint16(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_UINT32:
+      unloadTileToBsqTemplate(ossim_uint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SINT32:
+      unloadTileToBsqTemplate(ossim_sint32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      unloadTileToBsqTemplate(ossim_float32(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      unloadTileToBsqTemplate(ossim_float64(0), dest, dest_rect, clip_rect);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::unloadTileToBsq\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::unloadBand(void* dest,
+                                const ossimIrect& dest_rect,
+                                ossim_uint32 band) const
+{
+   unloadBand(dest, dest_rect, getImageRectangle(), band);
+}
+
+void ossimImageData::unloadBand(void* dest,
+                                const ossimIrect& dest_rect,
+                                const ossimIrect& clip_rect,
+                                ossim_uint32 band) const
+{
+   // Call the appropriate load method.
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      unloadBandTemplate(ossim_uint8(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SINT8:
+      unloadBandTemplate(ossim_sint8(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      unloadBandTemplate(ossim_uint16(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SINT16:
+      unloadBandTemplate(ossim_sint16(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_UINT32:
+      unloadBandTemplate(ossim_uint32(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SINT32:
+      unloadBandTemplate(ossim_sint32(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      unloadBandTemplate(ossim_float32(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      unloadBandTemplate(ossim_float64(0), dest, dest_rect, clip_rect, band);
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::unloadBand\n\
+File %s line %d\nUnsupported scalar type for method!",
+__FILE__,
+__LINE__);
+      return;
+   }
+}
+
+void ossimImageData::unloadBand( void* dest,
+                                 ossim_uint32 src_band,
+                                 ossim_uint32 dest_band,
+                                 const ossimIrect& dest_rect,
+                                 ossimInterleaveType il_type,
+                                 OverwriteBandRule ow_type ) const
+{
+   unloadBand( dest, src_band, dest_band, dest_rect, getImageRectangle(), il_type, ow_type );
+}
+
+void ossimImageData::unloadBand( void* dest,
+                                 ossim_uint32 src_band,
+                                 ossim_uint32 dest_band,
+                                 const ossimIrect& dest_rect,
+                                 const ossimIrect& clip_rect,
+                                 ossimInterleaveType il_type,
+                                 OverwriteBandRule ow_type ) const
+{
+   static const char  MODULE[] = "ossimImageData::unloadBand";
+
+   if ( il_type == OSSIM_BSQ )
+   {
+      unloadBandToBsq( dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " NOTICE:"
+               << "\nUnsupported interleave type:  " << il_type << "  Returning..."
+               << std::endl;
+   }
+}
+
+void ossimImageData::unloadBandToBsq( void* dest,
+                                      ossim_uint32 src_band,
+                                      ossim_uint32 dest_band,
+                                      const ossimIrect& dest_rect,
+                                      const ossimIrect& clip_rect,
+                                      OverwriteBandRule ow_type ) const
+{
+   switch (getScalarType())
+   {
+   case OSSIM_UINT8:
+      unloadBandToBsqTemplate(ossim_uint8(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_SINT8:
+      unloadBandToBsqTemplate(ossim_sint8(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      unloadBandToBsqTemplate(ossim_uint16(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_SINT16:
+      unloadBandToBsqTemplate(ossim_sint16(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_UINT32:
+      unloadBandToBsqTemplate(ossim_uint32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_SINT32:
+      unloadBandToBsqTemplate(ossim_sint32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+      unloadBandToBsqTemplate(ossim_float32(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      unloadBandToBsqTemplate(ossim_float64(0), dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
+      return;
+
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimImageData::unloadBandToBsq\n\
+            File %s line %d\nUnsupported scalar type for method!",
+            __FILE__,
+            __LINE__);      
+      return;
+   }
+}
+
+template <class T>
+void ossimImageData::unloadBandTemplate(T, // dummy template variable
+                                        void* dest,
+                                        const ossimIrect& dest_rect,
+                                        const ossimIrect& clip_rect,
+                                        ossim_uint32 band) const
+{
+   static const char  MODULE[] = "ossimImageData::unloadBand";
+
+   // Check the pointers.
+   if (!dest)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nNULL pointer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   ossimIrect img_rect = getImageRectangle();
+
+   // Clip the clip_rect to the tile rect.
+   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
+
+   // Clip it again to the destination rect.
+   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
+
+   // Check the output clip rect for intersection.
+   if (!output_clip_rect.intersects(img_rect))
+   {
+      return;
+   }
+   if ( !(output_clip_rect.intersects(dest_rect)) )
+   {
+      return;
+   }
+
+   // Check for valid band.
+   if (!isValidBand(band))
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " NOTICE:"
+               << "\nInvalid band:  " << band << "  Returning..."
+               << std::endl;
+      return;
+   }
+
+   ossim_uint32 buf_width = dest_rect.lr().x - dest_rect.ul().x + 1;
+
+   // Get a pointer to the source band buffer.
+   const T* s = reinterpret_cast<const T*>(getBuf(band));
+
+   // Get the offset for each source band.
+   ossim_uint32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
+         getWidth() + output_clip_rect.ul().x - img_rect.ul().x;
+
+   // Move the pointers to the start.
+   T* d = reinterpret_cast<T*>(dest);
+
+   ossim_uint32 dest_offset = (output_clip_rect.ul().y - dest_rect.ul().y) *
+         buf_width + output_clip_rect.ul().x - dest_rect.ul().x;
+
+   d += dest_offset;
+   s += src_offset;
+
+   for (ossim_int32 line=output_clip_rect.ul().y;
+         line<=output_clip_rect.lr().y; ++line)
+   {
+      ossim_uint32 i=0;
+      for (ossim_int32 samp=clip_rect.ul().x;
+            samp<=output_clip_rect.lr().x; ++samp)
+      {
+         d[i] = s[i];
+         ++i;
+      }
+      d += buf_width;
+      s += getWidth();
+   }
+}
+
+template <class T> void
+ossimImageData::unloadTileToBipTemplate(T, // dummy template variable
+                                        void* dest,
+                                        const ossimIrect& dest_rect,
+                                        const ossimIrect& clip_rect) const
+{
+   static const char  MODULE[] = "ossimImageData::unloadTileToBip";
+
+   // Check the pointer.
+   if (!dest)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nNULL pointer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   bool  dataIsNull = false;
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      dataIsNull = true;
+   }
+
+   ossimIrect img_rect = getImageRectangle();
+
+   // Clip the clip_rect to the tile rect.
+   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
+
+   // Clip it again to the destination rect.
+   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
+
+   // Check the output clip rect for intersection.
+   if (output_clip_rect.hasNans())
+   {
+      return;
+   }
+   if ( !(output_clip_rect.intersects(dest_rect)) )
+   {
+      return;
+   }
+
+   ossim_int32 num_bands = getNumberOfBands();
+
+   ossim_int32 buf_width = dest_rect.width() * num_bands;
+
+   if(!dataIsNull)
+   {
+      // Get the number of bands and grab a pointers to each one.
+      const T** s = new const T*[num_bands];
+
+      ossim_int32 band;
+      ossim_int32 s_width = getWidth();
+
+      for (band=0; band<num_bands; band++)
+      {
+         s[band] = reinterpret_cast<const T*>(getBuf(band));
+      }
+
+      // Move the pointers to the start.
+      T* d = reinterpret_cast<T*>(dest);      
+
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) * buf_width +
+            (output_clip_rect.ul().x - dest_rect.ul().x) * num_bands;
+
+      // Get the offset for each source band.
+      ossim_int32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
+            s_width + (output_clip_rect.ul().x - img_rect.ul().x);
+
+      ossim_int32 output_clip_width  = output_clip_rect.width();
+      ossim_int32 output_clip_height = output_clip_rect.height();
+
+      for (band=0; band<(ossim_int32)getNumberOfBands(); band++)
+      {
+         s[band] += src_offset;
+      }
+
+      ossim_int32 j;
+      for (ossim_int32 line=0; line<output_clip_height; ++line)
+      {
+         j = 0;
+         for (ossim_int32 samp=0; samp<output_clip_width; ++samp, j+=num_bands)
+         {
+            for (band=0; band<num_bands; ++band)
+            {
+               d[j+band] = s[band][samp];
+            }
+         }
+
+         // increment to next line...
+         d += buf_width;
+         for (band=0; band<num_bands; ++band)
+         {
+            s[band] += s_width;
+         }
+
+      }
+      delete [] s;
+   }
+   else
+   {
+      ossim_int32 band = 0;
+      T* nulls = new T[num_bands];
+      for(band = 0; band < num_bands; ++band)
+      {
+         nulls[band] = static_cast<T>(m_nullPixelValue[band]);
+      }
+      // Move the pointers to the start.
+      T* d = reinterpret_cast<T*>(dest);
+
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) * buf_width +
+            (output_clip_rect.ul().x - dest_rect.ul().x) * num_bands;
+
+      for (ossim_int32 line=output_clip_rect.ul().y;
+            line<=output_clip_rect.lr().y; ++line)
+      {
+         ossim_int32 i=0;
+         ossim_int32 j=0;
+         for (ossim_int32 samp=output_clip_rect.ul().x;
+               samp<=output_clip_rect.lr().x; ++samp)
+         {
+            for (band=0; band<num_bands; ++band)
+            {
+               d[j+band] = nulls[band];
+            }
+            ++i;  // increment to next pixel...
+            j+= num_bands;
+         }
+
+         // increment to next line...
+         d += buf_width;
+      }
+      delete [] nulls;
+      nulls = 0;
+   }
+}
+
+template <class T> void
+ossimImageData::unloadTileToBipAlphaTemplate(T, // dummy template variable
+                                             void* dest,
+                                             const ossimIrect& dest_rect,
+                                             const ossimIrect& clip_rect) const
+{
+   static const char  M[] = "ossimImageData::unloadTileToBipAlphaTemplate";
+
+   // Sanity checks:
+
+   // Are we null:
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << M << " ERROR:"
+               << "\nAttempting to copy null tile!  Returning..." << std::endl;
+      return;
+   }
+
+   // Check the pointer.
+   if (!dest)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << M << " ERROR:"
+               << "\nNULL pointer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if ( !hasAlpha() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << M << " ERROR:"
+               << "\nTile has no alpha!  Returning..." << std::endl;
+      return; 
+   }
+
+   ossimIrect img_rect = getImageRectangle();
+
+   // Clip the clip_rect to the tile rect.
+   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
+
+   // Clip it again to the destination rect.
+   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
+
+   // Check the output clip rect for intersection.
+   if (output_clip_rect.hasNans())
+   {
+      return;
+   }
+   if ( !(output_clip_rect.intersects(dest_rect)) )
+   {
+      return;
+   }
+
+   const ossim_int32 NUM_DATA_BANDS = getNumberOfBands();
+   const ossim_int32 BANDS = NUM_DATA_BANDS + 1; // Has data plus alpha.
+   const ossim_float64 MAX_PIX = static_cast<T>(getMaxPix(0));
+   const ossim_float64 ALPHA_MAX_PIX = 255.00;
+   const ossim_int32 S_WIDTH = getWidth();
+   const ossim_int32 D_WIDTH = dest_rect.width() * BANDS;
+   const ossim_int32 OUTPUT_CLIP_WIDTH  = output_clip_rect.width();
+   const ossim_int32 OUTPUT_CLIP_HEIGHT = output_clip_rect.height();
+
+   bool uint8Flag = ( getScalarType() == OSSIM_UINT8 );
+
+   // Get the offset for each source band relative to start of clip rect.
+   const ossim_int32 SRC_OFFSET = (output_clip_rect.ul().y - img_rect.ul().y) *
+         S_WIDTH + (output_clip_rect.ul().x - img_rect.ul().x);
+
+   // Get pointers to each one band of image data.
+   std::vector<const T*> s(NUM_DATA_BANDS);
+   ossim_int32 band;
+   for (band = 0; band < NUM_DATA_BANDS; ++band)
+   {
+      s[band] = reinterpret_cast<const T*>(getBuf(band));
+
+      // Move to start of clip rect.
+      s[band] += SRC_OFFSET;
+   }
+
+   // Get pointer to the alpha channel:
+   const ossim_uint8* a = getAlphaBuf();
+
+   // Move to start of clip rect.
+   a += SRC_OFFSET;
+
+   // Pointer to the destination buffer.
+   T* d = reinterpret_cast<T*>(dest); 
+
+   // Move to start of clip rect.
+   d += (output_clip_rect.ul().y - dest_rect.ul().y) * D_WIDTH +
+         (output_clip_rect.ul().x - dest_rect.ul().x) * BANDS;
+
+
+   // Loop to copy data:
+   for (ossim_int32 line = 0; line < OUTPUT_CLIP_HEIGHT; ++line)
+   {
+      ossim_int32 j = 0;
+      ossim_int32 alphaIdx = 0;
+      for (ossim_int32 samp = 0; samp < OUTPUT_CLIP_WIDTH; ++samp, j +=BANDS)
+      {
+         // Copy the pixels:
+         for (band = 0; band < NUM_DATA_BANDS; ++band)
+         {
+            d[j+band] = s[band][samp];
+         }
+
+         // Copy alpha channel converting to scalar type.
+         if ( uint8Flag )
+         {
+            d[j+NUM_DATA_BANDS] = a[alphaIdx++];
+         }
+         else
+         {
+            d[j+NUM_DATA_BANDS] =
+                  static_cast<T>( (a[alphaIdx++]/ALPHA_MAX_PIX) * MAX_PIX );
+         }
+      }
+
+      // Increment pointers to next line...
+      d += D_WIDTH;
+      for (band = 0; band < NUM_DATA_BANDS; ++band)
+      {
+         s[band] += S_WIDTH;
+      }
+      a += S_WIDTH;
+   }
+}
+
+template <class T> void
+ossimImageData::unloadTileToBilTemplate(T,  // dummy template arg...
+                                        void* dest,
+                                        const ossimIrect& dest_rect,
+                                        const ossimIrect& clip_rect) const
+{
+   static const char  MODULE[] = "ossimImageData::unloadTileToBil";
+
+   // Check the pointers.
+   if (!dest)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nNULL pointer passed to method!  Returning..." << std::endl;
+      return;
+   }
+   bool dataIsNull = false;
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      dataIsNull = true;
+   }
+
+   ossimIrect img_rect = getImageRectangle();
+
+   // Clip the clip_rect to the tile rect.
+   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
+
+   // Clip it again to the destination rect.
+   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
+
+   // Check the output clip rect for intersection.
+   if (output_clip_rect.hasNans())
+   {
+      return;
+   }
+   if ( !(output_clip_rect.intersects(dest_rect)) )
+   {
+      return;
+   }
+
+   ossim_uint32 num_bands = getNumberOfBands();
+
+   ossim_uint32 buf_width = dest_rect.width();
+
+   if(!dataIsNull)
+   {
+      // Get the number of bands and grab a pointers to each one.
+      const T** s = new const T*[num_bands];
+
+      ossim_uint32 band;
+
+      for (band=0; band<num_bands; band++)
+      {
+         s[band] = reinterpret_cast<const T*>(getBuf(band));
+      }
+
+      // Get the offset for each source band.
+      ossim_uint32 src_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
+            getWidth() + (output_clip_rect.ul().x - img_rect.ul().x);
+
+      // Move the pointers to the start.
+      T* d = reinterpret_cast<T*>(dest);
+
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) *
+            buf_width * num_bands +
+            (output_clip_rect.ul().x-dest_rect.ul().x);
+
+      for (band=0; band<num_bands; ++band)
+      {
+         s[band] += src_offset;
+      }
+
+      for (ossim_int32 line=output_clip_rect.ul().y;
+            line<=output_clip_rect.lr().y; ++line)
+      {
+         for (band=0; band<num_bands; ++band)
+         {
+            ossim_uint32 i=0;
+            for (ossim_int32 samp=output_clip_rect.ul().x;
+                  samp<=output_clip_rect.lr().x; ++samp)
+            {
+               d[i] = s[band][i];
+               ++i;
+            }
+            d       += buf_width;
+            s[band] += getWidth();
+         }
+      }
+      // Free up memory allocated for pointers.
+      delete [] s;
+   }
+   else
+   {
+      ossim_uint32 band = 0;
+      T* nulls = new T[num_bands];
+      for(band = 0; band < num_bands; ++band)
+      {
+         nulls[band] = static_cast<T>(m_nullPixelValue[band]);
+      }
+
+      // Move the pointers to the start.
+      T* d = reinterpret_cast<T*>(dest);
+
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) *
+            buf_width * num_bands + (output_clip_rect.ul().x - dest_rect.ul().x);
+
+      for (ossim_int32 line=output_clip_rect.ul().y;
+            line<=output_clip_rect.lr().y; ++line)
+      {
+         for (band=0; band<num_bands; ++band)
+         {
+            ossim_uint32 i=0;
+            for (ossim_int32 samp=output_clip_rect.ul().x;
+                  samp<=output_clip_rect.lr().x; ++samp)
+            {
+               d[i] = nulls[band];
+               ++i;
+            }
+            d += buf_width;
+         }
+      }
+      delete [] nulls;
+   }
+}
+
+template <class T> void ossimImageData::nullTileAlphaTemplate(
+      T,
+      const ossim_uint8* src,
+      const ossimIrect& src_rect,
+      const ossimIrect& clip_rect,
+      bool multiplyAlphaFlag)
+{
+   static const char  MODULE[] = "ossimImageData::nullTileAlphaTemplate";
+
+   // Check the pointer.
+   if (!src)
+   {
+      // Set the error...
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "%s File %s line %d\nNULL pointer passed to method!",
+                    MODULE,
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+
+   const ossimIrect img_rect = getImageRectangle();
+
+   // Check for intersect.
+   if ( ! img_rect.intersects(src_rect) )
+   {
+      return; // Nothing to do here.
+   }
+
+   // Check the clip rect.
+   if (!clip_rect.completely_within(img_rect))
+   {
+      return;
+   }
+
+   // Check the status and allocate memory if needed.
+   if (getDataObjectStatus() == OSSIM_NULL) initialize();
+
+   // Get the width of the buffers.
+   ossim_uint32 num_bands = getNumberOfBands();
+   ossim_uint32 s_width = src_rect.width();
+   ossim_uint32 d_width = getWidth();
+   ossim_uint32 band;
+   ossim_uint32 destinationOffset = (clip_rect.ul().y - img_rect.ul().y) * d_width +
+         (clip_rect.ul().x - img_rect.ul().x);
+   ossim_uint32 destinationIndex = destinationOffset;
+   ossim_uint32 sourceOffset = (clip_rect.ul().y - src_rect.ul().y) * s_width +
+         (clip_rect.ul().x - src_rect.ul().x);
+   ossim_uint32 sourceIndex = sourceOffset;
+   ossim_uint32 clipHeight = clip_rect.height();
+   ossim_uint32 clipWidth = clip_rect.width();
+
+   if(!multiplyAlphaFlag)
+   {
+      // Copy the data.
+      for (band=0; band<num_bands; band++)
+      {
+         T* destinationBand = static_cast<T*>(getBuf(band));
+         destinationIndex = destinationOffset;
+         sourceIndex = sourceOffset;
+         T nullPix = (T)getNullPix(band);
+         T minPix = (T)getMinPix(band);
+         for (ossim_uint32 line = 0; line < clipHeight; ++line)
+         {
+            for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+            {
+               if(src[sourceIndex+sample] == 0)
+               {
+                  destinationBand[destinationIndex + sample] = nullPix;
+               }
+               else if(destinationBand[destinationIndex + sample] == nullPix)
+               {
+                  destinationBand[destinationIndex + sample] = minPix;
+               }
+            }
+            sourceIndex += s_width;
+            destinationIndex += d_width;
+         }
+      }
+   }
+   else
+   {
+      ossim_float64 normalizer = 1.0/255.0;
+      // Copy the data.
+      for (band=0; band<num_bands; band++)
+      {
+         T* destinationBand = static_cast<T*>(getBuf(band));
+         destinationIndex = destinationOffset;
+         sourceIndex = sourceOffset;
+         T nullPix = (T)getNullPix(band);
+         T minPix = (T)getMinPix(band);
+         for (ossim_uint32 line = 0; line < clipHeight; ++line)
+         {
+            for (ossim_uint32 sample = 0; sample < clipWidth; ++sample)
+            {
+               if(src[sourceIndex+sample] != 255)
+               {
+                  if(src[sourceIndex+sample] != 0)
+                  {
+                     destinationBand[destinationIndex + sample] = (T)(destinationBand[destinationIndex + sample]*
+                           (src[sourceIndex+sample]*normalizer));
+                     if(destinationBand[destinationIndex + sample] == nullPix)
+                     {
+                        destinationBand[destinationIndex + sample] = minPix;
+                     }
+                  }
+                  else
+                  {
+                     destinationBand[destinationIndex + sample] = nullPix;
+                  }
+               }
+               else if(destinationBand[destinationIndex + sample] == nullPix)
+               {
+                  destinationBand[destinationIndex + sample] = minPix;
+               }
+            }
+            sourceIndex += s_width;
+            destinationIndex += d_width;
+         }
+      }
+
+   }
+}
+
+template <class T> void
+ossimImageData::unloadTileToBsqTemplate(T,  // dummy template arg...
+                                        void* dest,
+                                        const ossimIrect& dest_rect,
+                                        const ossimIrect& clip_rect) const
+{
+   static const char  MODULE[] = "ossimImageData::unloadTileToBsq";
+
+   // Check the pointers.
+   if (!dest)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nNULL pointer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   bool dataIsNull = false;
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      dataIsNull = true;
+   }
+
+   ossimIrect img_rect = getImageRectangle();
+
+   // Clip the clip_rect to the tile rect.
+   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
+
+   // Clip it again to the destination rect.
+   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
+
+   // Check the output clip rect for intersection.
+   if (output_clip_rect.hasNans())
+   {
+      return;
+   }
+   if ( !(output_clip_rect.intersects(dest_rect)) )
+   {
+      return;
+   }
+
+   ossim_uint32 num_bands = getNumberOfBands();
+   ossim_uint32 band      = 0;
+   if(!dataIsNull)
+   {
+      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
+      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
+      ossim_uint32 s_width       = getWidth();
+      ossim_uint32 s_offset      = (output_clip_rect.ul().y - img_rect.ul().y) *
+            s_width + (output_clip_rect.ul().x - img_rect.ul().x);
+
+      T* d        = static_cast<T*>(dest);
+      const T** s = new const T*[num_bands];
+
+      // Grab a pointers to each one.
+      for (band=0; band<num_bands; ++band)
+      {
+         s[band] = reinterpret_cast<const T*>(getBuf(band));
+
+         // Move to first valid pixel.
+         s[band] += s_offset;
+      }
+
+      // Move to first valid pixel.
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
+            (output_clip_rect.ul().x - dest_rect.ul().x);
+
+      for (band=0; band<num_bands; ++band)
+      {
+         ossim_uint32 d_buf_offset = 0;
+
+         for (ossim_int32 line=output_clip_rect.ul().y;
+               line<=output_clip_rect.lr().y; ++line)
+         {
+            ossim_int32 i=0;
+            for (ossim_int32 samp=output_clip_rect.ul().x;
+                  samp<=output_clip_rect.lr().x; ++samp)
+            {
+               d[d_buf_offset+i] = s[band][i];
+               ++i;
+            }
+
+            d_buf_offset += d_width;
+            s[band]      += s_width;
+         }
+         d += d_band_offset;
+      }
+
+      // Free up memory allocated for pointers.
+      delete [] s;
+   }
+   else
+   {
+      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
+      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
+
+      ossim_uint8* d = static_cast<ossim_uint8*>(dest);
+
+      // Move to first valid pixel.
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
+            (output_clip_rect.ul().x - dest_rect.ul().x);
+
+      for (band=0; band<num_bands; ++band)
+      {
+         ossim_uint8 np = static_cast<ossim_uint8>(m_nullPixelValue[band]);
+         ossim_uint32 d_buf_offset = 0;
+
+         for (ossim_int32 line=output_clip_rect.ul().y;
+               line<=output_clip_rect.lr().y; ++line)
+         {
+            ossim_int32 i=0;
+            for (ossim_int32 samp=output_clip_rect.ul().x;
+                  samp<=output_clip_rect.lr().x; ++samp)
+            {
+               d[d_buf_offset+i] = np;
+               ++i;
+            }
+
+            d_buf_offset += d_width;
+         }
+         d += d_band_offset;
+      }
+   }
+}
+
+template <class T> void
+ossimImageData::unloadBandToBsqTemplate(T,  // dummy template arg...
+                                        void* dest,
+                                        ossim_uint32 src_band,
+                                        ossim_uint32 dest_band,
+                                        const ossimIrect& dest_rect,
+                                        const ossimIrect& clip_rect,
+                                        OverwriteBandRule ow_type) const
+{
+   static const char  MODULE[] = "ossimImageData::unloadBandToBsq";
+
+   // Check the pointers.
+   if (!dest)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nNULL pointer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   bool dataIsNull = false;
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      dataIsNull = true;
+   }
+
+   ossimIrect img_rect = getImageRectangle();
+
+   // Clip the clip_rect to the tile rect.
+   ossimIrect output_clip_rect = clip_rect.clipToRect(img_rect);
+
+   // Clip it again to the destination rect.
+   output_clip_rect = dest_rect.clipToRect(output_clip_rect);
+
+   // Check the output clip rect for intersection.
+   if (output_clip_rect.hasNans())
+   {
+      return;
+   }
+   if ( !(output_clip_rect.intersects(dest_rect)) )
+   {
+      return;
+   }
+
+   ossim_uint32 num_bands = getNumberOfBands();
+   ossim_uint32 band      = 0;
+   if(!dataIsNull)
+   {
+      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
+      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
+      ossim_uint32 s_width  = getWidth();
+      ossim_uint32 s_offset = (output_clip_rect.ul().y - img_rect.ul().y) *
+            s_width + (output_clip_rect.ul().x - img_rect.ul().x);
+
+      T* d        = static_cast<T*>(dest);
+      const T** s = new const T*[num_bands];
+
+      // Grab a pointers to each one.
+      for (band=0; band<num_bands; ++band)
+      {
+         s[band] = reinterpret_cast<const T*>(getBuf(band));
+
+         // Move to first valid pixel.
+         s[band] += s_offset;
+      }
+
+      // Move to first valid pixel.
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
+            (output_clip_rect.ul().x - dest_rect.ul().x);
+
+      ossim_uint32 d_dest_band_offset = dest_band * d_band_offset;
+      ossim_uint32 d_buf_offset = 0;
+
+      for (ossim_int32 line=output_clip_rect.ul().y;
+            line<=output_clip_rect.lr().y; ++line)
+      {
+         ossim_int32 i=0;
+         for (ossim_int32 samp=output_clip_rect.ul().x;
+               samp<=output_clip_rect.lr().x; ++samp)
+         {
+            ossim_uint32 d_pixel_offset = d_buf_offset+i;
+            ossim_uint32 d_dest_band_pixel_offset = d_pixel_offset + d_dest_band_offset;
+
+            switch( ow_type )
+            {
+            case COLOR_DISCREPANCY:
+            case COLOR_DISCREPANCY_OF_ANY_FROM_DEST:
+            {
+               T d_dest_band = d[d_dest_band_pixel_offset];
+
+               for ( band=0; band<num_bands && band!=dest_band; ++band )
+               {
+                  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
+
+                  // test for color discrepancy
+                  if ( d_other_band != d_dest_band )
+                  {
+                     d[d_dest_band_pixel_offset] = s[src_band][i];
+                     break;
+                  }
+               }
+            }
+            break;
+
+            case COLOR_DISCREPANCY_OF_ALL_FROM_DEST:
+            {
+               T d_dest_band = d[d_dest_band_pixel_offset];
+
+               bool bFoundSameValue = false;
+               for ( band=0; band<num_bands && band!=dest_band; ++band )
+               {
+                  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
+
+                  // test for color sameness
+                  if ( d_other_band == d_dest_band )
+                  {
+                     bFoundSameValue = true;
+                     break;
+                  }
+               }
+               if ( bFoundSameValue == false )
+               {
+                  d[d_dest_band_pixel_offset] = s[src_band][i];
+               }
+            }
+            break;
+
+            case COLOR_EQUALITY_OF_ANY_TO_SRC:
+            {
+               T d_src_band = s[src_band][i];
+
+               for ( band=0; band<num_bands && band!=dest_band; ++band )
+               {
+                  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
+
+                  // test for color discrepancy
+                  if ( d_other_band == d_src_band )
+                  {
+                     d[d_dest_band_pixel_offset] = s[src_band][i];
+                     break;
+                  }
+               }
+            }
+            break;
+
+            case COLOR_EQUALITY_OF_ALL_TO_SRC:
+            {
+               T d_src_band = s[src_band][i];
+
+               bool bFoundDifferentValue = false;
+               for ( band=0; band<num_bands && band!=dest_band; ++band )
+               {
+                  T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
+
+                  // test for color discrepancy
+                  if ( d_other_band != d_src_band )
+                  {
+                     bFoundDifferentValue = true;
+                     break;
+                  }
+               }
+               if ( bFoundDifferentValue == false )
+               {
+                  d[d_dest_band_pixel_offset] = s[src_band][i];
+               }
+            }
+            break;
+
+            case NULL_RULE:
+            default:
+            {
+               d[d_dest_band_pixel_offset] = s[src_band][i];
+            }
+            break;
+            }
+
+            ++i;
+         }
+
+         d_buf_offset += d_width;
+         s[src_band]  += s_width;
+      }
+
+      // Free up memory allocated for pointers.
+      delete [] s;
+   }
+   else
+   {
+      ossim_uint32 d_width       = dest_rect.lr().x - dest_rect.ul().x + 1;
+      ossim_uint32 d_band_offset = d_width * (dest_rect.lr().y-dest_rect.ul().y+1);
+
+      ossim_uint8* d = static_cast<ossim_uint8*>(dest);
+
+      // Move to first valid pixel.
+      d += (output_clip_rect.ul().y - dest_rect.ul().y) * d_width +
+            (output_clip_rect.ul().x - dest_rect.ul().x);
+
+      for (band=0; band<num_bands; ++band)
+      {
+         ossim_uint8 np = static_cast<ossim_uint8>(m_nullPixelValue[band]);
+         ossim_uint32 d_buf_offset = 0;
+
+         for (ossim_int32 line=output_clip_rect.ul().y;
+               line<=output_clip_rect.lr().y; ++line)
+         {
+            ossim_int32 i=0;
+            for (ossim_int32 samp=output_clip_rect.ul().x;
+                  samp<=output_clip_rect.lr().x; ++samp)
+            {
+               d[d_buf_offset+i] = np;
+               ++i;
+            }
+
+            d_buf_offset += d_width;
+         }
+         d += d_band_offset;
+      }
+   }
+}
+
+ossimObject* ossimImageData::dup() const
+{
+   return new ossimImageData(*this);
+}
+
+void ossimImageData::copyTileToNormalizedBuffer(ossim_float64* buf)const
+{
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   switch(getScalarType())
+   {
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      memmove(buf, getBuf(), getDataSizeInBytes());
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
+      const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf());
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         buf[offset] = inputBuf[offset];
+      }
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      copyTileToNormalizedBuffer((ossim_float32)0, buf);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      copyTileToNormalizedBuffer((ossim_float64)0, buf);
+      break;
+   }
+   case OSSIM_UINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_uint8)0, buf);
+      break;
+
+   }
+   case OSSIM_SINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_sint8)0, buf);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_uint16)0, buf);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_sint16)0, buf);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_uint32)0, buf);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_sint32)0, buf);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                  << "NOTICE:  copyTileToNormalizedBuffer not implemented yet"
+                  << std::endl;
+   }
+
+   }  // End of "switch(getScalarType())"
+}
+
+template <class T>
+void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
+                                                ossim_float64* buf) const
+{
+   const ossim_uint32 SIZE  = getSizePerBand();
+   const ossim_uint32 BANDS = getNumberOfBands();
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const ossim_float64 MIN_PIX = getMinPix(band);
+      const ossim_float64 MAX_PIX = getMaxPix(band);
+      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+      const ossim_float64 NP      = getNullPix(band);
+
+      const T* s = (T*)getBuf(band);  // source
+      ossim_float64* d = (ossim_float64*)(buf + (band*SIZE));  // destination
+
+      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+      {
+         ossim_float64 p = s[offset];
+         if(p != NP)
+         {
+            if( p == MIN_PIX)
+            {
+               d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
+            }
+            else
+            {
+               d[offset] = (p-MIN_PIX)/RANGE;
+            }
+         }
+         else
+         {
+            d[offset] = 0.0;
+         }
+      }
+   }   
+}
+
+template <class T>
+void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
+                                                ossim_float32* buf) const
+{
+   const ossim_uint32 SIZE  = getSizePerBand();
+   const ossim_uint32 BANDS = getNumberOfBands();
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const ossim_float64 MIN_PIX = getMinPix(band);
+      const ossim_float64 MAX_PIX = getMaxPix(band);
+      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+      const ossim_float64 NP      = getNullPix(band);
+
+      const T* s = (T*)getBuf(band);  // source
+      ossim_float32* d = (ossim_float32*)(buf + (band*SIZE));  // destination
+
+      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+      {
+         ossim_float64 p = s[offset];
+         if(p != NP)
+         {
+            if( p == MIN_PIX)
+            {
+               d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
+            }
+            else
+            {
+               d[offset] = (p-MIN_PIX)/RANGE;
+            }
+         }
+         else
+         {
+            d[offset] = 0.0;
+         }
+      }
+   }   
+}
+
+template <class T>
+void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
+                                                ossim_uint32 band,
+                                                ossim_float64* buf) const
+{
+   const ossim_uint32  SIZE    = getSizePerBand();
+   const ossim_float64 MIN_PIX = getMinPix(band);
+   const ossim_float64 MAX_PIX = getMaxPix(band);
+   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+   const ossim_float64 NP      = getNullPix(band);
+
+   const T* s = (T*)getBuf(band);  // source
+   ossim_float64* d = (ossim_float64*)(buf);  // destination
+
+   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+   {
+      ossim_float64 p = s[offset];
+      if(p != NP)
+      {
+         if( p == MIN_PIX)
+         {
+            d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE;
+         }
+         else
+         {
+            d[offset] = (p-MIN_PIX)/RANGE;
+         }
+      }
+      else
+      {
+         d[offset] = 0.0;
+      }
+   }   
+}
+
+template <class T>
+void ossimImageData::copyTileToNormalizedBuffer(T /* dummyTemplate */,
+                                                ossim_uint32 band,
+                                                ossim_float32* buf) const
+{
+   const ossim_uint32  SIZE    = getSizePerBand();
+   const ossim_float64 MIN_PIX = getMinPix(band);
+   const ossim_float64 MAX_PIX = getMaxPix(band);
+   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+   const ossim_float64 NP      = getNullPix(band);
+
+   const T* s = (T*)getBuf(band);  // source
+   ossim_float32* d     = (ossim_float32*)(buf);  // destination
+
+   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+   {
+      ossim_float64 p = s[offset];
+      if(p != NP)
+      {
+         if( p == MIN_PIX)
+         {
+            d[offset] = OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT;
+         }
+         else
+         {
+            d[offset] = (p-MIN_PIX)/RANGE;
+         }
+      }
+      else
+      {
+         d[offset] = 0.0;
+      }
+   }   
+}
+
+template <class T>
+void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
+                                                ossim_float64* buf)
+{
+   const ossim_uint32 SIZE  = getSizePerBand();
+   const ossim_uint32 BANDS = getNumberOfBands();
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const ossim_float64 MIN_PIX = getMinPix(band);
+      const ossim_float64 MAX_PIX = getMaxPix(band);
+      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+      const T NP                  = (T)getNullPix(band);
+
+      ossim_float64* s = buf + (band*SIZE); // source
+      T* d   = (T*)getBuf(band); // destination
+
+      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+      {
+         const ossim_float64 P = s[offset];
+         if(P != 0.0)
+         {
+            d[offset] = (T)(MIN_PIX + RANGE*P);
+         }
+         else
+         {
+            d[offset] = NP;
+         }
+      }
+   }
+}
+
+template <class T>
+void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
+                                                ossim_float32* buf)
+{
+   const ossim_uint32 SIZE  = getSizePerBand();
+   const ossim_uint32 BANDS = getNumberOfBands();
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const ossim_float64 MIN_PIX = getMinPix(band);
+      const ossim_float64 MAX_PIX = getMaxPix(band);
+      const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+      const T             NP      = (T)getNullPix(band);
+
+      ossim_float32* s = buf + (band*SIZE); // source
+      T* d   = (T*)getBuf(band); // destination
+
+      for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+      {
+         const ossim_float64 P = s[offset];
+         if(P != 0.0)
+         {
+            ossim_float64 test = MIN_PIX + RANGE*P;
+            if(test > MAX_PIX) test = MAX_PIX;
+            d[offset] = (T)test;
+         }
+         else
+         {
+            d[offset] = NP;
+         }
+      }
+   }
+}
+
+template <class T>
+void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
+                                                ossim_uint32 band,
+                                                ossim_float64* buf)
+{
+   const ossim_uint32  SIZE    = getSizePerBand();
+   const ossim_float64 MIN_PIX = getMinPix(band);
+   const ossim_float64 MAX_PIX = getMaxPix(band);
+   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+   const T             NP      = (T)getNullPix(band);
+
+   ossim_float64* s = buf; // source
+   T* d   = (T*)getBuf(band); // destination
+
+   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+   {
+      const ossim_float64 P = s[offset];
+      if(P != 0.0)
+      {
+         ossim_float64 test = MIN_PIX + RANGE*P;
+         if(test > MAX_PIX) test = MAX_PIX;
+         d[offset] = (T)test;
+      }
+      else
+      {
+         d[offset] = NP;
+      }
+   }
+}
+
+template <class T>
+void ossimImageData::copyNormalizedBufferToTile(T /* dummyTemplate */,
+                                                ossim_uint32 band,
+                                                ossim_float32* buf)
+{
+   const ossim_uint32 SIZE     = getSizePerBand();
+   const ossim_float64 MIN_PIX = getMinPix(band);
+   const ossim_float64 MAX_PIX = getMaxPix(band);
+   const ossim_float64 RANGE   = (MAX_PIX-MIN_PIX);
+   const T NP                  = (T)getNullPix(band);
+
+   ossim_float32* s = buf; // source
+   T* d   = (T*)getBuf(band); // destination
+
+   for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
+   {
+      const ossim_float64 P = s[offset];
+      if(P != 0.0)
+      {
+         ossim_float64 test = MIN_PIX + RANGE*P;
+         if(test > MAX_PIX) test = MAX_PIX;
+         d[offset] = (T)test;
+      }
+      else
+      {
+         d[offset] = NP;
+      }
+   }
+}
+
+void ossimImageData::copyTileBandToNormalizedBuffer(ossim_uint32 band,
+                                                    ossim_float64* buf) const
+{
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   if(!getBuf(band)) return;
+
+   switch(getScalarType())
+   {
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      memmove(buf, getBuf(band), getDataSizeInBytes());
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      ossim_uint32 upperBound = getWidth()*getHeight();
+      const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf(band));
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         buf[offset] = inputBuf[offset];
+      }
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      copyTileToNormalizedBuffer((ossim_float32)0, band, buf);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      copyTileToNormalizedBuffer((ossim_float64)0, band, buf);
+      break;
+   }
+   case OSSIM_UINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_uint8)0, band, buf);
+      break;
+
+   }
+   case OSSIM_SINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_sint8)0, band, buf);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_uint16)0, band, buf);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_sint16)0, band, buf);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_uint32)0, band, buf);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_sint32)0, band, buf);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
+                  << " Unknown scalar type!"
+                  << std::endl;
+   }
+
+   }  // End of "switch(getScalarType())"
+
+}
+
+void ossimImageData::copyTileToNormalizedBuffer(ossim_float32* buf)const
+{
+
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileToNormalizedBuffer ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   switch(getScalarType())
+   {
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
+      const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf());
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         buf[offset] = inputBuf[offset];
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      memmove(buf, getBuf(), getDataSizeInBytes());
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      copyTileToNormalizedBuffer((ossim_float32)0, buf);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      copyTileToNormalizedBuffer((ossim_float64)0, buf);
+      break;
+   }
+   case OSSIM_UINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_uint8)0, buf);
+      break;
+
+   }
+   case OSSIM_SINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_sint8)0, buf);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_uint16)0, buf);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_sint16)0, buf);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_uint32)0, buf);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_sint32)0, buf);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                  << "NOTICE:  copyTileToNormalizedBuffer not implemented yet"
+                  << std::endl;
+   }
+
+   }  // End of "switch(getScalarType())"
+}
+
+void ossimImageData::copyTileBandToNormalizedBuffer(ossim_uint32 band,
+                                                    ossim_float32* buf)const
+{
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   switch(getScalarType())
+   {
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      ossim_uint32 upperBound = getWidth()*getHeight();
+      const ossim_float32* inputBuf = static_cast<const ossim_float32*>(getBuf(band));
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         buf[offset] = inputBuf[offset];
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      memmove(buf, getBuf(band), getSizePerBandInBytes());
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      copyTileToNormalizedBuffer((ossim_float32)0, band, buf);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      copyTileToNormalizedBuffer((ossim_float64)0, band, buf);
+      break;
+   }
+   case OSSIM_UINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_uint8)0, band, buf);
+      break;
+
+   }
+   case OSSIM_SINT8:
+   {
+      copyTileToNormalizedBuffer((ossim_sint8)0, band, buf);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_uint16)0, band, buf);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyTileToNormalizedBuffer((ossim_sint16)0, band, buf);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_uint32)0, band, buf);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyTileToNormalizedBuffer((ossim_sint32)0, band, buf);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimImageData::copyTileBandToNormalizedBuffer ERROR:"
+                  << " Unknown scalar type"
+                  << std::endl;
+   }
+
+   }  // End of "switch(getScalarType())"
+}
+
+
+void ossimImageData::copyNormalizedBufferToTile(ossim_float64* buf)
+{
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   switch(getScalarType())
+   {
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      memmove(getBuf(), buf, getDataSizeInBytes());
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
+      ossim_float32* inputBuf = static_cast<ossim_float32*>(getBuf());
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         inputBuf[offset] = static_cast<ossim_float32>(buf[offset]);
+      }
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      copyNormalizedBufferToTile((ossim_float32)0, buf);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      copyNormalizedBufferToTile((ossim_float64)0, buf);
+      break;
+   }
+   case OSSIM_UINT8:
+   {
+      copyNormalizedBufferToTile((ossim_uint8)0, buf);
+      break;
+
+   }
+   case OSSIM_SINT8:
+   {
+      copyNormalizedBufferToTile((ossim_sint8)0, buf);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyNormalizedBufferToTile((ossim_uint16)0, buf);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyNormalizedBufferToTile((ossim_sint16)0, buf);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyNormalizedBufferToTile((ossim_uint32)0, buf);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyNormalizedBufferToTile((ossim_sint32)0, buf);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimImageData::copyNormalizedBufferToTile\n"
+                  << "Unknown scalar type!" << std::endl;
+   }
+
+   } // End of "switch(getScalarType())".
+}
+
+void ossimImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                ossim_float64* buf)
+{
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   if(band < getNumberOfBands())
+   {
+      switch(getScalarType())
+      {
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         memmove(getBuf(band), buf, getSizePerBandInBytes());
+         break;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         ossim_uint32 upperBound = getWidth()*getHeight();
+         ossim_float32* inputBuf = static_cast<ossim_float32*>(getBuf(band));
+         for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+         {
+            inputBuf[offset] = static_cast<ossim_float32>(buf[offset]);
+         }
+         break;
+      }
+      case OSSIM_FLOAT32:
+      {
+         copyNormalizedBufferToTile((ossim_float32)0, band, buf);
+         break;
+      }
+      case OSSIM_FLOAT64:
+      {
+         copyNormalizedBufferToTile((ossim_float64)0, band, buf);
+         break;
+      }
+      case OSSIM_UINT8:
+      {
+         copyNormalizedBufferToTile((ossim_uint8)0, band, buf);
+         break;
+
+      }
+      case OSSIM_SINT8:
+      {
+         copyNormalizedBufferToTile((ossim_sint8)0, band, buf);
+         break;
+
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         copyNormalizedBufferToTile((ossim_uint16)0, band, buf);
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         copyNormalizedBufferToTile((ossim_sint16)0, band, buf);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         copyNormalizedBufferToTile((ossim_uint32)0, band, buf);
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         copyNormalizedBufferToTile((ossim_sint32)0, band, buf);
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                     << "ossimImageData::copyNormalizedBufferToTile\n"
+                     << "Unknown scalar type." << std::endl;
+      }
+
+      } // End of "switch(getScalarType())".
+   }
+}
+
+void ossimImageData::copyNormalizedBufferToTile(ossim_float32* buf)
+{
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   switch(getScalarType())
+   {
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      ossim_uint32 upperBound = getWidth()*getHeight()*getNumberOfBands();
+      ossim_float64* inputBuf = static_cast<ossim_float64*>(getBuf());
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         inputBuf[offset] = buf[offset];
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      memmove(getBuf(), buf, getDataSizeInBytes());
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      copyNormalizedBufferToTile((ossim_float32)0, buf);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      copyNormalizedBufferToTile((ossim_float64)0, buf);
+      break;
+   }
+   case OSSIM_UINT8:
+   {
+      copyNormalizedBufferToTile((ossim_uint8)0, buf);
+      break;
+
+   }
+   case OSSIM_SINT8:
+   {
+      copyNormalizedBufferToTile((ossim_sint8)0, buf);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyNormalizedBufferToTile((ossim_uint16)0, buf);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyNormalizedBufferToTile((ossim_sint16)0, buf);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyNormalizedBufferToTile((ossim_uint32)0, buf);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyNormalizedBufferToTile((ossim_sint32)0, buf);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimImageDatacopyNormalizedBufferToTile\n"
+                  << "Unknown scalar type!" << std::endl;
+   }
+
+   }  // End of "switch(getScalarType())".
+}
+
+void ossimImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                ossim_float32* buf)
+{
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nNull buffer passed to method!  Returning..." << std::endl;
+      return;
+   }
+
+   if (getDataObjectStatus() == OSSIM_NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageData::copyNormalizedBufferToTile ERROR:"
+               << "\nThis object is null! Returning..." << std::endl;
+      return;
+   }
+
+   switch(getScalarType())
+   {
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      ossim_uint32 upperBound = getWidth()*getHeight();
+      ossim_float64* inputBuf = static_cast<ossim_float64*>(getBuf(band));
+      for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+      {
+         inputBuf[offset] = buf[offset];
+      }
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      memmove(getBuf(band), buf, getSizePerBandInBytes());
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      copyNormalizedBufferToTile((ossim_float32)0, band, buf);
+      break;
+   }
+   case OSSIM_FLOAT64:
+   {
+      copyNormalizedBufferToTile((ossim_float64)0, band, buf);
+      break;
+   }
+   case OSSIM_UINT8:
+   {
+      copyNormalizedBufferToTile((ossim_uint8)0, band, buf);
+      break;
+
+   }
+   case OSSIM_SINT8:
+   {
+      copyNormalizedBufferToTile((ossim_sint8)0, band, buf);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyNormalizedBufferToTile((ossim_uint16)0, band, buf);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyNormalizedBufferToTile((ossim_sint16)0, band, buf);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyNormalizedBufferToTile((ossim_uint32)0, band, buf);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyNormalizedBufferToTile((ossim_sint32)0, band, buf);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimImageData::copyNormalizedBufferToTile\n"
+                  << "Unknown scalar type!" << std::endl;
+   }
+
+   }  // End of "switch(getScalarType())".
+}
+
+ossim_float64 ossimImageData::getMinNormalizedPix() const
+{
+   if (m_scalarType == OSSIM_NORMALIZED_DOUBLE ||
+         m_scalarType == OSSIM_NORMALIZED_FLOAT)
+   {
+      return m_minPixelValue[0];  // Already normalized.
+   }
+   return (1.0 / (m_maxPixelValue[0] - m_minPixelValue[0] + 1.0));
+}
+
+std::ostream& ossimImageData::print(std::ostream& out) const
+{
+   out << getClassName() << "::print:"
+         << "\nm_origin:  " << m_origin << "\n";
+   if(m_nullPixelValue.size())
+   {
+      out << "Null values: ";
+
+      copy(m_nullPixelValue.begin(),
+           m_nullPixelValue.begin() + getNumberOfBands(),
+           std::ostream_iterator<ossim_float64>(out, " "));
+      out << "\n";
+   }
+   if(m_minPixelValue.size())
+   {
+      out << "Min values:  ";
+
+      copy(m_minPixelValue.begin(),
+           m_minPixelValue.begin() + getNumberOfBands(),
+           std::ostream_iterator<ossim_float64>(out, " "));
+      out << "\n";
+   }
+   if(m_maxPixelValue.size())
+   {
+      out << "Max values:  ";
+
+      copy(m_maxPixelValue.begin(),
+           m_maxPixelValue.begin() + getNumberOfBands(),
+           std::ostream_iterator<ossim_float64>(out, " "));
+      out << "\n";
+   }
+   out << "width:            " << getWidth()
+             << "\nheight:           " << getHeight()
+             << "\nimage rectangle:  " << getImageRectangle()
+             << "\nindexed:          " << m_indexedFlag
+             << "\nalpha size:       " << m_alpha.size()
+             << std::endl;
+
+   return ossimRectilinearDataObject::print(out);
+}
+
+void ossimImageData::stretchMinMax()
+{
+   if ( (getDataObjectStatus() != OSSIM_NULL) &&
+         (getDataObjectStatus() != OSSIM_EMPTY) )
+   {
+      switch (getScalarType())
+      {
+      case OSSIM_UINT8:
+      {
+         stretchMinMax(ossim_uint8(0));
+         return;
+      }
+      case OSSIM_SINT8:
+      {
+         stretchMinMax(ossim_sint8(0));
+         return;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         stretchMinMax(ossim_uint16(0));
+         return;
+      }
+      case OSSIM_SINT16:
+      {
+         stretchMinMax(ossim_sint16(0));
+         return;
+      }
+      case OSSIM_UINT32:
+      {
+         stretchMinMax(ossim_uint32(0));
+         return;
+      }
+      case OSSIM_SINT32:
+      {
+         stretchMinMax(ossim_sint32(0));
+         return;
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         stretchMinMax(ossim_float32(0.0));
+         return;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_FLOAT64:
+      {
+         stretchMinMax(ossim_float64(0.0));
+         return;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+         ossimSetError(getClassName(),
+                       ossimErrorCodes::OSSIM_ERROR,
+                       "ossimImageData::stretchMinMax File %s line %d\n\
+Invalid scalar type:  %d",
+__FILE__,
+__LINE__,
+getScalarType());
+         break;
+      }
+      }
+   }
+}
+
+template <class T> void ossimImageData::stretchMinMax(T /* dummyTemplate */)
+{
+   const ossim_uint32 BANDS  = getNumberOfBands();
+   const ossim_uint32 SPB    = getSizePerBand();
+
+   // scalar min
+   const ossim_float64 S_MIN = ossim::defaultMin(getScalarType());
+
+   // scalar max
+   const ossim_float64 S_MAX = ossim::defaultMax(getScalarType());
+
+   // scalar null
+   const ossim_float64 S_NUL = ossim::defaultNull(getScalarType());
+
+   // scalar range
+   const ossim_float64 S_RNG = S_MAX-S_MIN+1.0;
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      T* s = static_cast<T*>(getBuf(band));
+
+      if (s)
+      {
+         const ossim_float64 T_NUL = m_nullPixelValue[band]; // tile null
+         const ossim_float64 T_MIN = m_minPixelValue[band];  // tile min
+         const ossim_float64 T_MAX = m_maxPixelValue[band];  // tile max
+         const ossim_float64 T_RNG = (T_MAX-T_MIN)+1;           // tile range
+         const ossim_float64 SPP = S_RNG / T_RNG; // stretch per pixel
+
+         for(ossim_uint32 i = 0; i < SPB; ++i)
+         {
+            ossim_float64 p = s[i];
+            if ( p == T_NUL )
+            {
+               p = S_NUL;
+            }
+            else if (p <= T_MIN)
+            {
+               p = S_MIN;
+            }
+            else if (p >= T_MAX)
+            {
+               p = S_MAX;
+            }
+            else
+            {
+               // Stretch...
+               p = (p - T_MIN + 1.0) * SPP + S_MIN - 1.0;
+            }
+            s[i] = ossim::round<T>(p);
+         }
+
+         // Set the min, max, null:
+         m_minPixelValue[band]  = S_MIN;
+         m_maxPixelValue[band]  = S_MAX;
+         m_nullPixelValue[band] = S_NUL;
+
+      }
+   } 
+}
+
+void ossimImageData::computeAlphaChannel()
+{
+   if ( getDataObjectStatus() != OSSIM_NULL )
+   {
+      switch (getScalarType())
+      {
+      case OSSIM_UINT8:
+      {
+         computeAlphaChannel(ossim_uint8(0));
+         return;
+      }
+      case OSSIM_SINT8:
+      {
+         computeAlphaChannel(ossim_sint8(0));
+         return;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         computeAlphaChannel(ossim_uint16(0));
+         return;
+      }
+      case OSSIM_SINT16:
+      {
+         computeAlphaChannel(ossim_sint16(0));
+         return;
+      }
+      case OSSIM_UINT32:
+      {
+         computeAlphaChannel(ossim_uint32(0));
+         return;
+      }
+      case OSSIM_SINT32:
+      {
+         computeAlphaChannel(ossim_sint32(0));
+         return;
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         computeAlphaChannel(ossim_float32(0.0));
+         return;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_FLOAT64:
+      {
+         computeAlphaChannel(ossim_float64(0.0));
+         return;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+         ossimSetError(getClassName(),
+                       ossimErrorCodes::OSSIM_ERROR,
+                       "ossimImageData::computeAlphaChannel File %s line %d\n\
+Invalid scalar type:  %d",
+__FILE__,
+__LINE__,
+getScalarType());
+         break;
+      }
+      }
+   }
+}
+
+template <class T> void ossimImageData::computeAlphaChannel(T /* dummyTemplate */)
+{
+   const ossim_uint32 SPB = getSizePerBand();
+   const ossim_uint8  ANP = 0;   // Alpha Null Pixel
+   const ossim_uint8  AVP = 255; // Alpha Valid Pixel
+
+   // Allocate the alpha channel if not already.
+   if (m_alpha.size() != SPB)
+   {
+      m_alpha.resize(SPB);
+   }
+
+   if (getDataObjectStatus() == OSSIM_FULL)
+   {
+      memset( static_cast<void*>(&m_alpha.front()),
+              static_cast<int>(AVP),
+              static_cast<int>(SPB) );
+   }
+   else if (getDataObjectStatus() == OSSIM_EMPTY)
+   {
+      // Start with alpha being set to 0.  
+      memset( static_cast<void*>(&m_alpha.front()),
+              static_cast<int>(ANP),
+              static_cast<int>(SPB) );
+   }
+   else // Partial must check each pixel.
+   {
+      const ossim_uint32 BANDS = getNumberOfBands();
+
+      std::vector<T> null_pix(BANDS);
+      std::vector<const T*> buf(BANDS); // Pointer to pixel data.
+      ossim_uint32 band;
+      for(band = 0; band < BANDS; ++band)
+      {
+         buf[band] = static_cast<const T*>(getBuf(band));
+         null_pix[band] = static_cast<T>(m_nullPixelValue[band]);
+      }
+
+      for(ossim_uint32 i = 0; i < SPB; ++i)
+      {
+         //---
+         // Start with alpha being set to 0.  If any band has a valid pixel set
+         // to 255 and break from band loop.
+         //---
+         m_alpha[i] = ANP;
+         for(band = 0; band < BANDS; ++band)
+         {
+            if (buf[band][i] != null_pix[band])
+            {
+               m_alpha[i] = AVP;
+               break;
+            }
+         }
+      }
+   }
+
+}  //  End: template <class T> void ossimImageData::computeAlphaChannel
+
+ossim_uint32 ossimImageData::getWidth()const
+{
+   return m_spatialExtents[0];
+}
+
+ossim_uint32 ossimImageData::getHeight()const
+{
+   return m_spatialExtents[1];
+}
+
+void ossimImageData::getWidthHeight(ossim_uint32& w, ossim_uint32& h)
+{
+   w = m_spatialExtents[0];
+   h = m_spatialExtents[1];
+}
+
+void ossimImageData::setWidth(ossim_uint32 width)
+{
+   m_spatialExtents[0] = width;
+}
+
+void ossimImageData::setHeight(ossim_uint32 height)
+{
+   m_spatialExtents[1] = height;
+}
+
+void ossimImageData::setWidthHeight(ossim_uint32 w, ossim_uint32 h)
+{
+   m_spatialExtents[0] = w;
+   m_spatialExtents[1] = h;
+}
+
+void ossimImageData::setOrigin(const ossimIpt& origin)
+{
+   m_origin = origin;
+}
+
+ossim_uint32 ossimImageData::getDataSizeInBytes()const
+{
+   return getSizeInBytes();
+}
+
+void ossimImageData::copyLine(const void* src,
+                              ossim_int32 lineNumber,
+                              ossim_int32 lineStartSample,
+                              ossim_int32 lineStopSample,
+                              ossimInterleaveType lineInterleave)
+{
+   switch(m_scalarType)
+   {
+   case OSSIM_UINT8:
+   {
+      copyLineTemplate((ossim_uint8)0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+   }
+   case OSSIM_SINT8:
+   {
+      copyLineTemplate((ossim_sint8)0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_UINT16:
+   {
+      copyLineTemplate((ossim_uint16)0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      copyLineTemplate((ossim_sint16)0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      copyLineTemplate((ossim_uint32)0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      copyLineTemplate((ossim_sint32)0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   case OSSIM_FLOAT32:
+   {
+      copyLineTemplate((ossim_float32)0.0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+   {
+      copyLineTemplate((ossim_float64)0.0, src, lineNumber, lineStartSample,
+                       lineStopSample, lineInterleave);
+      break;
+   }
+   case OSSIM_SCALAR_UNKNOWN:
+   default:
+   {
+      // Shouldn't hit this.
+      ossimNotify(ossimNotifyLevel_WARN)
+      << "ossimImageData::copyLine Unsupported scalar type!"
+      << std::endl;
+      break;
+   }
+   }
+
+} // End: void ossimImageData::copyLine
+
+template <class T>
+void ossimImageData::copyLineTemplate(T /* dummyTemplate */,
+                                      const void* src,
+                                      ossim_int32 lineNumber,
+                                      ossim_int32 lineStartSample,
+                                      ossim_int32 lineStopSample,
+                                      ossimInterleaveType lineInterleave)
+{
+   if (src)
+   {
+      const ossimIrect RECT = getImageRectangle();
+
+      // Check for intersect:
+      if ( ( lineNumber       >= RECT.ul().y)     &&
+            ( lineNumber       <= RECT.lr().y)     &&
+            ( lineStartSample  <  lineStopSample)  &&
+            ( lineStartSample  <= RECT.lr().x)     &&
+            ( lineStopSample   >= RECT.ul().x) )
+      {
+         const ossim_int32 BANDS = static_cast<ossim_int32>(m_numberOfDataComponents);
+         const ossim_int32 START_SAMP =
+               (lineStartSample > RECT.ul().x)?lineStartSample:RECT.ul().x;
+         const ossim_int32 STOP_SAMP  =
+               (lineStopSample  < RECT.lr().x)?lineStopSample:RECT.lr().x;
+         const ossim_int32 SAMPS = STOP_SAMP - START_SAMP + 1;
+
+         std::vector<T*> d(BANDS);
+
+         ossim_int32 band;
+         for (band = 0; band < BANDS; ++band)
+         {
+            d[band] = static_cast<T*>(getBuf(band));
+
+            // Position at start sample.
+            d[band] +=  (lineNumber - RECT.ul().y) * RECT.width() + (START_SAMP - RECT.ul().x);
+         }
+
+         if (lineInterleave == OSSIM_BIP)
+         {
+            const T* S = static_cast<const T*>(src); // Source buffer:
+
+            // Position at start sample.
+            S += (START_SAMP - lineStartSample) * BANDS;
+
+            ossim_int32 srcOffset = 0;
+            for (ossim_int32 samp = 0; samp < SAMPS; ++samp)
+            {
+               for (band = 0; band < BANDS; ++band)
+               {
+                  d[band][samp] = S[srcOffset++];
+               }
+            }
+         }
+         else
+         {
+            const ossim_int32 W = lineStopSample - lineStartSample + 1;
+            std::vector<const T*> S(BANDS);
+            for (band = 0; band < BANDS; ++band)
+            {
+               S[band] = static_cast<const T*>(src) + (START_SAMP - lineStartSample);
+               if (band)
+               {
+                  S[band] += band * W; // Move to line.
+               }
+            }
+
+            for (band = 0; band < BANDS; ++band)
+            {
+               for (ossim_int32 samp = 0; samp < SAMPS; ++samp)
+               {
+                  d[band][samp] = S[band][samp];
+               }
+            }
+         }
+
+      } // intersect check
+
+   } // if (src)
+
+} // End: template <class T> void ossimImageData::copyLineTemplate
+
+void ossimImageData::setIndexedFlag(bool flag)
+{
+   m_indexedFlag = flag;
+}
+
+bool ossimImageData::getIndexedFlag() const
+{
+   return m_indexedFlag;
+}
+
+bool ossimImageData::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   bool result = ossimRectilinearDataObject::saveState(kwl, prefix);
+   ossimString null_pixels;
+   ossimString min_pixels;
+   ossimString max_pixels;
+   ossim::toSimpleStringList(null_pixels, m_nullPixelValue);
+   ossim::toSimpleStringList(min_pixels, m_minPixelValue);
+   ossim::toSimpleStringList(max_pixels, m_maxPixelValue);
+
+   kwl.add(prefix, "null_pixels", null_pixels, true);
+   kwl.add(prefix, "min_pixels", min_pixels, true);
+   kwl.add(prefix, "max_pixels", max_pixels, true);
+
+   ossimString alpha;
+   ossim::toSimpleStringList(alpha, m_alpha);
+   kwl.add(prefix, "alpha", alpha, true);
+   kwl.add(prefix, "indexed", m_indexedFlag, true);
+   kwl.add(prefix, "origin", m_origin.toString(), true);
+   return result;
+
+}
+
+bool ossimImageData::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool result = ossimRectilinearDataObject::loadState(kwl, prefix);
+   m_spatialExtents.resize(2);
+   if(result)
+   {
+      const char* null_pixels = kwl.find(prefix, "null_pixels");
+      const char* min_pixels = kwl.find(prefix, "min_pixels");
+      const char* max_pixels = kwl.find(prefix, "max_pixels");
+      const char* alpha = kwl.find(prefix, "alpha");
+      const char* origin = kwl.find(prefix, "origin");
+      const char* indexed = kwl.find(prefix, "indexed");
+      ossimString rectString = kwl.find(prefix, "rect");
+      const char* numberOfBands = kwl.find(prefix, "number_bands");
+      m_nullPixelValue.clear();
+      m_minPixelValue.clear();
+      m_maxPixelValue.clear();
+      m_alpha.clear();
+      if(null_pixels)
+      {
+         if(!ossim::toSimpleVector(m_nullPixelValue, ossimString(null_pixels)))
+         {
+            return false;
+         }
+      }
+      if(min_pixels)
+      {
+         if(!ossim::toSimpleVector(m_minPixelValue, ossimString(min_pixels)))
+         {
+            return false;
+         }
+      }
+      if(max_pixels)
+      {
+         if(!ossim::toSimpleVector(m_maxPixelValue, ossimString(max_pixels)))
+         {
+            return false;
+         }
+      }
+      if(alpha)
+      {
+         if(!ossim::toSimpleVector(m_alpha, ossimString(alpha)))
+         {
+            return false;
+         }
+      }
+      if(origin)
+      {
+         m_origin.toPoint(origin);
+      }
+      m_indexedFlag = false;
+      if(indexed)
+      {
+         m_indexedFlag = ossimString(indexed).toBool();
+      }
+      if(!rectString.empty())
+      {
+         ossimIrect rect;
+
+         if(rect.toRect(rectString))
+         {
+            setImageRectangle(rect);
+         }
+      }
+      if(numberOfBands)
+      {
+         ossim_uint32 nBands = ossimString(numberOfBands).toUInt32();
+         setNumberOfDataComponents(nBands);
+         if(m_nullPixelValue.empty()||
+               m_minPixelValue.empty()||
+               m_maxPixelValue.empty())
+         {
+            initializeDefaults();
+         }
+      }
+   }
+
+   return result;
+}                     
+
+void ossimImageData::setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histo)
+{
+  m_histogram = histo;
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimImageData::getHistogram()
+{
+  return m_histogram;
+}
diff --git a/src/imaging/ossimImageDataFactory.cpp b/src/imaging/ossimImageDataFactory.cpp
new file mode 100644
index 0000000..f1e2773
--- /dev/null
+++ b/src/imaging/ossimImageDataFactory.cpp
@@ -0,0 +1,303 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// Contributor: David A. Horner (DAH) - http://dave.thehorners.com
+// 
+//*************************************************************************
+// $Id: ossimImageDataFactory.cpp 22135 2013-02-02 16:27:24Z dburken $
+
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/imaging/ossimU11ImageData.h>
+#include <ossim/imaging/ossimU12ImageData.h>
+#include <ossim/imaging/ossimU13ImageData.h>
+#include <ossim/imaging/ossimU14ImageData.h>
+#include <ossim/imaging/ossimU15ImageData.h>
+#include <ossim/imaging/ossimU16ImageData.h>
+#include <ossim/imaging/ossimS16ImageData.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimImageDataFactory:debug");
+
+ossimImageDataFactory* ossimImageDataFactory::theInstance = 0;
+OpenThreads::Mutex ossimImageDataFactory::theInstanceMutex;
+ossimImageDataFactory::ossimImageDataFactory() 
+{
+   theInstance = 0;
+}
+
+ossimImageDataFactory::~ossimImageDataFactory()
+{
+   if(theInstance)
+   {
+      //delete theInstance;
+      theInstance = 0;
+   }
+}
+
+ossimImageDataFactory* ossimImageDataFactory::instance()
+{
+   theInstanceMutex.lock();
+   if(!theInstance)
+   {
+      theInstance = new ossimImageDataFactory;
+   }
+   theInstanceMutex.unlock();
+   return theInstance;
+}
+
+ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
+   ossimSource* owner,
+   ossimScalarType scalar,
+   ossim_uint32 bands)const
+{
+   ossimIpt tileSize;
+   ossim::defaultTileSize(tileSize);
+   ossim_uint32 width  = tileSize.x;
+   ossim_uint32 height = tileSize.y;
+   
+   // do some bounds checking and initialize to a default
+   bands  = (bands>0)?bands:1;
+   scalar = scalar != OSSIM_SCALAR_UNKNOWN?scalar:OSSIM_UINT8;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageDataFactory::create DEBUG:"
+         << "\nCaller:  "
+         << (owner ? owner->getClassName().c_str() : "unknown")
+         << "\nbands:   " << bands
+         << "\nwidth:   " << width
+         << "\nheight:  " << height
+         << "\nScalar type:  "
+         << (ossimScalarTypeLut::instance()->getEntryString(scalar))
+         << std::endl;
+   }
+   
+   ossimRefPtr<ossimImageData> result = 0;
+   switch(scalar)
+   {
+      case OSSIM_UINT8:
+      {
+         result = new ossimU8ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT11:
+      {
+         result = new ossimU11ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT12:
+      {
+         result = new ossimU12ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT13:
+      {
+         result = new ossimU13ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT14:
+      {
+         result = new ossimU14ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT15:
+      {
+         result = new ossimU15ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_UINT16:
+      {
+         result = new ossimU16ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         result = new ossimS16ImageData(owner, bands, width, height);
+         break;
+      }
+      default:
+      {
+         // create a generic image data implementation.
+         result = new ossimImageData(owner, scalar, bands, width, height);
+
+         // Set the scalar type for stretching.
+         ossimImageSource* inputSource = dynamic_cast<ossimImageSource*>(owner);
+         if( inputSource )
+         {
+            for(ossim_uint32 band = 0; band < bands; ++band)
+            {
+               result->setMinPix(inputSource->getMinPixelValue(band), band);
+               result->setMaxPix(inputSource->getMaxPixelValue(band), band);
+               result->setNullPix(inputSource->getNullPixelValue(band), band);
+            }
+         }
+         break;
+      }
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
+   ossimSource* owner,
+   ossimScalarType scalar,
+   ossim_uint32 bands,
+   ossim_uint32 width,
+   ossim_uint32 height)const
+{
+   ossimIpt tileSize;
+   ossim::defaultTileSize(tileSize);
+   // do some bounds checking and initialize to a default
+   bands  = bands  > 0?bands:1;
+   width  = width  > 0?width:tileSize.x;
+   height = height > 0?height:tileSize.y;
+   scalar = scalar != OSSIM_SCALAR_UNKNOWN?scalar:OSSIM_UINT8;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageDataFactory::create DEBUG:"
+         << "\nCaller:  "
+         << (owner ? owner->getClassName().c_str() : "unknown")
+         << "\nbands:   " << bands
+         << "\nwidth:   " << width
+         << "\nheight:  " << height
+         << "\nScalar type:  "
+         << (ossimScalarTypeLut::instance()->getEntryString(scalar))
+         << std::endl;
+   }
+   
+   ossimRefPtr<ossimImageData> result = 0;
+   switch(scalar)
+   {
+      case OSSIM_UINT8:
+      {
+         result = new ossimU8ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT11:
+      {
+         result = new ossimU11ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT12:
+      {
+         result = new ossimU12ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT13:
+      {
+         result = new ossimU13ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT14:
+      {
+         result = new ossimU14ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_USHORT15:
+      {
+         result = new ossimU15ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_UINT16:
+      {
+         result = new ossimU16ImageData(owner, bands, width, height);
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         result = new ossimS16ImageData(owner, bands, width, height);
+         break;
+      }
+      default:
+      {
+         // create a generic image data implementation.
+         result = new ossimImageData(owner, scalar, bands, width, height);
+         break;
+      }
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
+   ossimSource* owner,
+   ossim_uint32 bands,
+   ossimImageSource* inputSource)const
+{
+   ossimRefPtr<ossimImageData> result = 0;
+
+   if(inputSource)
+   {
+      ossimScalarType scalar = inputSource->getOutputScalarType();
+      ossim_uint32 width  = inputSource->getTileWidth();
+      ossim_uint32 height = inputSource->getTileHeight();
+
+      result = create(owner, scalar, bands, width, height);
+      if ( result.valid() )
+      {
+         for(ossim_uint32 band = 0; band < bands; ++band)
+         {
+            result->setMinPix(inputSource->getMinPixelValue(band),   band);
+            result->setMaxPix(inputSource->getMaxPixelValue(band),   band);
+            result->setNullPix(inputSource->getNullPixelValue(band), band);
+         }
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimImageDataFactory::create ERROR:"
+         << "\nNULL input source!" << std::endl;
+   }
+   
+   return result;
+}
+
+
+ossimRefPtr<ossimImageData> ossimImageDataFactory::create(
+   ossimSource* owner,
+   ossimImageSource* inputSource)const
+{
+   ossimRefPtr<ossimImageData> result = 0;
+
+   if(inputSource)
+   {
+      ossimScalarType scalar = inputSource->getOutputScalarType();
+      ossim_uint32 bands  = inputSource->getNumberOfOutputBands();
+      ossim_uint32 width  = inputSource->getTileWidth();
+      ossim_uint32 height = inputSource->getTileHeight();
+
+      result = create(owner, scalar, bands, width, height);
+      if ( result.valid() )
+      {
+         for(ossim_uint32 band = 0; band < bands; ++band)
+         {
+            result->setMinPix(inputSource->getMinPixelValue(band),   band);
+            result->setMaxPix(inputSource->getMaxPixelValue(band),   band);
+            result->setNullPix(inputSource->getNullPixelValue(band), band);
+         }
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimImageDataFactory::create ERROR:"
+         << "\nNULL input source!" << std::endl;
+   }
+
+   return result;
+}
diff --git a/src/imaging/ossimImageDataHelper.cpp b/src/imaging/ossimImageDataHelper.cpp
new file mode 100644
index 0000000..eb036f6
--- /dev/null
+++ b/src/imaging/ossimImageDataHelper.cpp
@@ -0,0 +1,627 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageDataHelper.cpp 23162 2015-02-21 14:46:31Z dburken $
+#include <ossim/imaging/ossimImageDataHelper.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/base/ossimLine.h>
+#include <vector>
+#include <algorithm>
+
+ossimImageDataHelper::ossimImageDataHelper(ossimImageData* imageData)
+{
+   setImageData(imageData);
+}
+
+
+void ossimImageDataHelper::setImageData(ossimImageData* imageData)
+{
+   theImageData = imageData;
+   if(theImageData)
+   {
+      theImageRectangle     = theImageData->getImageRectangle();
+      thePolyImageRectangle = theImageRectangle;
+//       thePolyImageRectangle = ossimPolyArea2d(theImageRectangle.ul(),
+//                                               theImageRectangle.ur(),
+//                                               theImageRectangle.lr(),
+//                                               theImageRectangle.ll());
+      theOrigin = theImageRectangle.ul();
+   }
+}
+
+void ossimImageDataHelper::copyInputToThis(const void* input,
+                                           const ossimPolygon& region,
+                                           bool clipPoly)
+{
+   if(!theImageData) return;
+   switch(theImageData->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         copyInputToThis(reinterpret_cast<const ossim_uint8*>(input),
+                         region,
+                         clipPoly);
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         copyInputToThis(reinterpret_cast<const ossim_uint16*>(input),
+                         region,
+                         clipPoly);
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         copyInputToThis(reinterpret_cast<const ossim_sint16*>(input),
+                         region,
+                         clipPoly);
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+          copyInputToThis(reinterpret_cast<const ossim_sint32*>(input),
+                          region,
+                          clipPoly);
+          break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         copyInputToThis(reinterpret_cast<const float*>(input),
+                         region,
+                         clipPoly);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         copyInputToThis(reinterpret_cast<const double*>(input),
+                         region,
+                         clipPoly);
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         break;
+      }
+   }   
+}
+
+void ossimImageDataHelper::fill(const ossimRgbVector& color,
+                                std::vector<ossimPolygon>& regionList,
+                                bool clipPoly)
+{
+   int i = 0;
+
+   for(i = 0; i < (int)regionList.size();++i)
+   {
+      fill(color,
+           regionList[i],
+           clipPoly);
+   }
+}
+
+
+void ossimImageDataHelper::fill(const double* values,
+                                std::vector<ossimPolygon>& regionList,
+                                bool clipPoly)
+{
+   int i = 0;
+
+   for(i = 0; i < (int)regionList.size();++i)
+   {
+      fill(values,
+           regionList[i],
+           clipPoly);
+   }
+}
+
+void ossimImageDataHelper::fill(const ossimRgbVector& color,
+                                const ossimPolygon& region,
+                                bool clipPoly)
+{
+   double colorArray[3];
+
+   colorArray[0] = color.getR();
+   colorArray[1] = color.getG();
+   colorArray[2] = color.getB();
+   switch(theImageData->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         if(theImageData->getNumberOfBands() <= 3)
+         {
+            fill(static_cast<ossim_uint8>(0),
+                 (const double*)colorArray,
+                 region,
+                 clipPoly);
+            
+         }
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_SSHORT16:
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      default:
+      {
+         break;
+      }
+   }
+}
+
+void ossimImageDataHelper::fill(const ossimRgbVector& color,
+                                const ossimIrect& region,
+                                bool clipPoly)
+{
+   double colorArray[3];
+
+   colorArray[0] = color.getR();
+   colorArray[1] = color.getG();
+   colorArray[2] = color.getB();
+
+   switch(theImageData->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         if(theImageData->getNumberOfBands() <= 3)
+         {
+            fill(static_cast<ossim_uint8>(0),
+                 colorArray,
+                 region,
+                 clipPoly);
+            
+         }
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_SSHORT16:
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         break;
+      }
+      default:
+         break;
+   }
+}
+
+void ossimImageDataHelper::fill(const double*  values,
+                                const ossimPolygon& region,
+                                bool clipPoly)
+{
+   switch(theImageData->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         fill(static_cast<ossim_uint8>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         fill(static_cast<ossim_uint16>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         fill(static_cast<ossim_sint16>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         fill(static_cast<float>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         fill(static_cast<double>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         break;
+      }
+   }
+}
+
+void ossimImageDataHelper::fill(const double*  values,
+                                const ossimIrect& region,
+                                bool clipPoly)
+{
+   switch(theImageData->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         fill(static_cast<ossim_uint8>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         fill(static_cast<ossim_uint16>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         fill(static_cast<ossim_sint16>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         fill(static_cast<float>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         fill(static_cast<double>(0),
+              values,
+              region,
+              clipPoly);
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         break;
+      }
+   }
+}
+
+
+
+template <class T>
+void ossimImageDataHelper::copyInputToThis(const T* inputBuf,
+                                           const ossimPolygon& region,
+                                           bool clipPoly)
+{
+   if(clipPoly)
+   {
+      ossimPolyArea2d polyArea(region);
+      ossimPolyArea2d clipArea = polyArea&thePolyImageRectangle;
+      
+      vector<ossimPolygon> clipList;
+      //      clipArea.getAllVisiblePolygons(clipList);
+      clipArea.getVisiblePolygons(clipList);
+
+      for(ossim_uint32 i = 0; i < clipList.size();++i)
+      {
+         copyInputToThis( inputBuf, clipList[i] );
+      }
+   }
+   else
+   {
+      copyInputToThis( inputBuf, region );
+   }
+}
+
+template <class T>
+void ossimImageDataHelper::copyInputToThis(const T* inputBuf,
+                                           const ossimPolygon& region)
+{ 
+   int n;
+   int i;
+   int y;
+   ossim_int32 miny, maxy, minx, maxx;
+   int x1, y1;
+   int x2, y2;
+   int ind1, ind2;
+   // int ints;
+   vector<int> polyInts;
+   T* buf = reinterpret_cast<T*>(theImageData->getBuf());
+   
+   ossim_int32 blockLength=theImageData->getWidth()*theImageData->getHeight();
+   ossim_int32 bandOffset = 0;
+   
+   region.getIntegerBounds(minx, miny, maxx, maxy);
+   ossim_int32 rowOffset = (miny-theOrigin.y)*theImageData->getWidth();
+   n = region.getVertexCount();
+   /* Fix in 1.3: count a vertex only once */
+   for (y = miny; (y <= maxy); y++)
+   {
+      polyInts.clear();
+      // ints = 0;
+      for (i = 0; (i < n); i++)
+      {
+         if (!i)
+         {
+            ind1 = n - 1;
+            ind2 = 0;
+         }
+         else
+         {
+            ind1 = i - 1;
+            ind2 = i;
+         }
+         y1 = ossim::round<int>(region[ind1].y);
+         y2 = ossim::round<int>(region[ind2].y);
+         if (y1 < y2)
+         {
+            x1 = ossim::round<int>(region[ind1].x);
+            x2 = ossim::round<int>(region[ind2].x);
+         }
+         else if (y1 > y2)
+         {
+            y2 = ossim::round<int>(region[ind1].y);
+            y1 = ossim::round<int>(region[ind2].y);
+            x2 = ossim::round<int>(region[ind1].x);
+            x1 = ossim::round<int>(region[ind2].x);
+         }
+         else
+         {
+            continue;
+         }
+         if ((y >= y1) && (y < y2))
+         {
+            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
+         }
+         else if ((y == maxy) && (y > y1) && (y <= y2))
+         {
+            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
+         }
+      }
+      std::sort(polyInts.begin(), polyInts.end());
+      
+      for (i = 0; (i < (int)polyInts.size()); i += 2)
+      {
+         ossim_int32 startX = polyInts[i]-theOrigin.x;
+         ossim_int32 endX   = polyInts[i+1]-theOrigin.x;
+         while(startX <= endX)
+         {
+            bandOffset = 0;
+	    int band;
+            for(band = 0; band < (ossim_int32)theImageData->getNumberOfBands();++band)
+            {
+               buf[rowOffset+bandOffset+startX] = (inputBuf[rowOffset+bandOffset+startX]);
+               bandOffset += blockLength;
+            }
+            ++startX;
+         }
+      }
+      rowOffset += theImageData->getWidth();
+   }
+}
+
+template <class T>
+void ossimImageDataHelper::fill(T dummyVariable,
+                                const double* values,
+                                const ossimPolygon& region,
+                                bool clipPoly)
+{
+   if(clipPoly)
+   {
+      ossimPolyArea2d polyArea(region);
+      ossimPolyArea2d clipArea = polyArea&thePolyImageRectangle;
+      
+      vector<ossimPolygon> clipList;
+      
+      clipArea.getVisiblePolygons(clipList);
+      
+      for(ossim_uint32 i = 0; i < clipList.size();++i)
+      {
+         fill( dummyVariable, values, clipList[i] );
+      }
+   }
+   else
+   {
+      fill( dummyVariable, values, region );
+   }
+}
+
+template <class T>
+void ossimImageDataHelper::fill(T dummyVariable,
+                                const double* values,
+                                const ossimIrect& region,
+                                bool clipPoly)
+{
+   if(clipPoly)
+   {
+      fill(dummyVariable,
+           values,
+           region.clipToRect(theImageData->getImageRectangle()));
+   }
+   else
+   {
+      fill(dummyVariable,
+           values,
+           region);
+   }
+}
+
+template <class T>
+void ossimImageDataHelper::fill(T /* dummyVariable */,
+                                const double* values,
+                                const ossimPolygon& region)
+{
+   int n;
+   int i;
+   int y;
+   ossim_int32 miny, maxy, minx, maxx;
+   int x1, y1;
+   int x2, y2;
+   int ind1, ind2;
+   // int ints;
+   vector<int> polyInts;
+   T* buf = reinterpret_cast<T*>(theImageData->getBuf());
+   
+   ossim_int32 blockLength=theImageData->getWidth()*theImageData->getHeight();
+   ossim_int32 bandOffset = 0;
+   
+   region.getIntegerBounds(minx, miny, maxx, maxy);
+   ossim_int32 rowOffset = (miny-theOrigin.y)*theImageData->getWidth();
+   n = region.getVertexCount();
+   /* Fix in 1.3: count a vertex only once */
+   for (y = miny; (y <= maxy); y++)
+   {
+      polyInts.clear();
+      // ints = 0;
+      for (i = 0; (i < n); i++)
+      {
+         if (!i)
+         {
+            ind1 = n - 1;
+            ind2 = 0;
+         }
+         else
+         {
+            ind1 = i - 1;
+            ind2 = i;
+         }
+         y1 = ossim::round<int>(region[ind1].y);
+         y2 = ossim::round<int>(region[ind2].y);
+         if (y1 < y2)
+         {
+            x1 = ossim::round<int>(region[ind1].x);
+            x2 = ossim::round<int>(region[ind2].x);
+         }
+            else if (y1 > y2)
+            {
+               y2 = ossim::round<int>(region[ind1].y);
+               y1 = ossim::round<int>(region[ind2].y);
+               x2 = ossim::round<int>(region[ind1].x);
+               x1 = ossim::round<int>(region[ind2].x);
+            }
+         else
+         {
+            continue;
+         }
+         if ((y >= y1) && (y < y2))
+         {
+            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
+         }
+         else if ((y == maxy) && (y > y1) && (y <= y2))
+         {
+            polyInts.push_back((y - y1) * (x2 - x1) / (y2 - y1) + x1);
+         }
+      }
+      std::sort(polyInts.begin(), polyInts.end());
+      
+      for (i = 0; (i < (int)polyInts.size()); i += 2)
+      {
+         ossim_int32 startX = std::abs(polyInts[i]-theOrigin.x);
+         ossim_int32 endX   = std::abs(polyInts[i+1]-theOrigin.x);
+         while(startX <= endX)
+         {
+            bandOffset = 0;
+	    int band;
+            for(band = 0; band < (int)theImageData->getNumberOfBands();++band)
+            {
+               buf[rowOffset+bandOffset+startX] = (T)(values[band]);
+               bandOffset += blockLength;
+            }
+            ++startX;
+         }
+      }
+      rowOffset += theImageData->getWidth();
+   }
+}
+
+template <class T>
+void ossimImageDataHelper::fill(T /* dummyVariable */,
+                                const double* values,
+                                const ossimIrect& region)
+{
+   T* buf = reinterpret_cast<T*>(theImageData->getBuf());
+   
+   ossim_int32 blockLength=theImageData->getWidth()*theImageData->getHeight();
+   ossim_int32 bandOffset = 0;
+   ossim_int32 miny,maxy;
+   ossim_int32 minx, maxx;
+   ossim_int32 y = 0;
+   miny = region.ul().y-theOrigin.y;
+   maxy = region.lr().y-theOrigin.y;
+   minx = region.ul().x-theOrigin.x;
+   maxx = region.lr().x-theOrigin.x;
+   
+   ossim_int32 rowOffset = (miny)*theImageData->getWidth();
+   ossim_int32 startX = minx;
+   ossim_int32 endX   = maxx;
+   ossim_int32 bands  = (ossim_int32)theImageData->getNumberOfBands();
+
+   for (y = miny; (y <= maxy); ++y)
+   {
+      startX=minx;
+      while(startX <= endX)
+      {
+         bandOffset = 0;
+	 int band = 0;
+         for(band = 0; band < bands;++band)
+         {
+            buf[rowOffset+bandOffset+startX] = (T)(values[band]);
+            bandOffset += blockLength;
+         }
+         ++startX;
+      }
+      rowOffset += theImageData->getWidth();
+   }
+}
+ 
diff --git a/ossim/src/ossim/imaging/ossimImageDisplayWriter.cpp b/src/imaging/ossimImageDisplayWriter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageDisplayWriter.cpp
rename to src/imaging/ossimImageDisplayWriter.cpp
diff --git a/src/imaging/ossimImageFileWriter.cpp b/src/imaging/ossimImageFileWriter.cpp
new file mode 100644
index 0000000..e30f763
--- /dev/null
+++ b/src/imaging/ossimImageFileWriter.cpp
@@ -0,0 +1,1653 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Frank Warmerdam (warmerdam at pobox.com)
+//
+// Description:
+//
+// Contains class declaration for ossimImageFileWriter.
+//*******************************************************************
+//  $Id: ossimImageFileWriter.cpp 23068 2015-01-07 23:08:29Z okramer $
+
+
+#include <tiff.h> /* for tiff compression defines */
+
+#include <ossim/ossimConfig.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimImageTypeLut.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/imaging/ossimTiffOverviewBuilder.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+#include <ossim/imaging/ossimGeomFileWriter.h>
+#include <ossim/imaging/ossimEnviHeaderFileWriter.h>
+#include <ossim/imaging/ossimERSFileWriter.h>
+#include <ossim/imaging/ossimFgdcFileWriter.h>
+#include <ossim/imaging/ossimReadmeFileWriter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimWorldFileWriter.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+
+static ossimTrace traceDebug("ossimImageFileWriter:debug");
+static const ossimString AUTO_CREATE_DIRECTORY_KW("auto_create_directory");
+
+#if OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimImageFileWriter.cpp 23068 2015-01-07 23:08:29Z okramer $";
+#endif
+
+RTTI_DEF3(ossimImageFileWriter,
+          "ossimImageFileWriter",
+          ossimImageWriter,
+          ossimProcessInterface,
+          ossimConnectableObjectListener)
+
+static const char SCALE_TO_EIGHT_BIT_KW[] = "scale_to_eight_bit";
+
+ossimImageFileWriter::ossimImageFileWriter(const ossimFilename& file,
+                                           ossimImageSource* inputSource,
+                                           ossimObject* owner)
+   : ossimImageWriter(owner,
+                      1,
+                      0,
+                      true,
+                      false),
+     ossimProcessInterface(),
+     ossimConnectableObjectListener(),
+     theViewController(NULL),
+     theProgressListener(NULL),
+     theFilename(file),
+     theOutputImageType(ossimImageTypeLut().getEntryString(OSSIM_IMAGE_TYPE_UNKNOWN)),
+     theWriteImageFlag(true),
+     theWriteOverviewFlag(false),
+     theWriteHistogramFlag(false),
+     theScaleToEightBitFlag(false),
+     theOverviewCompressType(COMPRESSION_NONE),
+     theOverviewJpegCompressQuality(75),
+     theWriteEnviHeaderFlag(false),
+     theWriteErsHeaderFlag(false),     
+     theWriteExternalGeometryFlag(false),
+     theWriteFgdcFlag(false),
+     theWriteJpegWorldFileFlag(false),
+     theWriteReadmeFlag(false),
+     theWriteTiffWorldFileFlag(false),
+     theWriteWorldFileFlag(false),
+     theAutoCreateDirectoryFlag(true),
+     theLinearUnits(OSSIM_UNIT_UNKNOWN),
+     thePixelType(OSSIM_PIXEL_IS_POINT)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageFileWriter::ossimImageFileWriter entered..."
+         << std::endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << std::endl;
+#endif
+   }
+
+   theInputConnection = new ossimImageSourceSequencer(inputSource);
+
+   // now map the sequencer to the same input
+   connectMyInputTo(0, inputSource);
+   initialize();
+
+   // make sure we listen to our input changes so we can change
+   // it for the sequencer as well.
+   ossimImageWriter::addListener((ossimConnectableObjectListener*)this);
+
+   theInputConnection->connectMyInputTo(0, inputSource, false);
+   theAreaOfInterest.makeNan();
+}
+
+ossimImageFileWriter::~ossimImageFileWriter()
+{
+   theInputConnection = 0;
+   theProgressListener = NULL;
+   removeListener((ossimConnectableObjectListener*)this);
+}
+
+void ossimImageFileWriter::initialize()
+{
+   if(theInputConnection.valid())
+   {
+      theInputConnection->initialize();
+
+      //---
+      // Area Of Interest(AOI):
+      // There are two AOIs to keep in sync.
+      // One owned by this base: ossimImageWriter::theAreaOfInterest
+      // One owned by the theInputConntion: ossimImageSourceSequencer::theAreaOfInterest
+      //---
+      if ( theAreaOfInterest.hasNans() == false )
+      {
+         //---
+         // ossimImageSourceSequencer::setAreaOfInterest does more than just set the
+         // variable, so only call if out of sync to avoid wasted cycles.
+         //--- 
+         if ( theAreaOfInterest != theInputConnection->getBoundingRect() )
+         {
+            theInputConnection->setAreaOfInterest( theAreaOfInterest );
+         }
+      }
+      else
+      {
+         // Set this AOI to bounding rect of input.
+         theAreaOfInterest = theInputConnection->getBoundingRect();
+      }
+   }
+}
+
+void ossimImageFileWriter::changeSequencer(ossimImageSourceSequencer* sequencer)
+{
+   if( sequencer )
+   {
+      theInputConnection = sequencer;
+      theInputConnection->connectMyInputTo(0, getInput(0));
+   }
+}
+
+bool ossimImageFileWriter::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           getClassName(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::FILENAME_KW,
+           theFilename.c_str(),
+           true);
+
+   kwl.add(prefix,
+           "create_envi_hdr",
+           (ossim_uint32)theWriteEnviHeaderFlag,
+           true);
+
+   kwl.add(prefix,
+           "create_ers_hdr",
+           (ossim_uint32)theWriteErsHeaderFlag,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW,
+           (ossim_uint32)theWriteExternalGeometryFlag,
+           true);
+
+   kwl.add(prefix,
+           "create_fgdc",
+           (ossim_uint32)theWriteFgdcFlag,
+           true);
+   
+   kwl.add(prefix,
+           "create_jpeg_world_file",
+           (ossim_uint32)theWriteJpegWorldFileFlag,
+           true);
+
+   kwl.add(prefix,
+           "create_readme",
+           (ossim_uint32)theWriteReadmeFlag,
+           true);
+   
+   kwl.add(prefix,
+           "create_tiff_world_file",
+           (ossim_uint32)theWriteTiffWorldFileFlag,
+           true);
+
+   kwl.add(prefix,
+           "create_world_file",
+           (ossim_uint32)theWriteWorldFileFlag,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CREATE_IMAGE_KW,
+           (ossim_uint32)theWriteImageFlag,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CREATE_OVERVIEW_KW,
+           (ossim_uint32)theWriteOverviewFlag,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CREATE_HISTOGRAM_KW,
+           (ossim_uint32)theWriteHistogramFlag,
+           true);
+
+   kwl.add(prefix,
+           SCALE_TO_EIGHT_BIT_KW,
+           (ossim_uint32)theScaleToEightBitFlag,
+           true);
+   kwl.add(prefix,
+           AUTO_CREATE_DIRECTORY_KW,
+           theAutoCreateDirectoryFlag,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::OVERVIEW_COMPRESSION_TYPE_KW,
+           theOverviewCompressType,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::OVERVIEW_COMPRESSION_QUALITY_KW,
+           theOverviewJpegCompressQuality,
+           true);
+
+   ossimImageTypeLut lut;
+   kwl.add(prefix,
+           ossimKeywordNames::IMAGE_TYPE_KW,
+           theOutputImageType,
+           true);
+
+   //---
+   // When "theLinearUnits" == "unknown" that is a key to the writer to just
+   // use whatever units makes sense for the projection.  Since "unknown"
+   // doesn't look good to the average user in a spec file, change to
+   // "default" if "unknown".  When read back in by the lookup table since
+   // "default" is not a valid "string" theLinearUnits will remain "unknown".
+   // Kind of a hack but it works:)  (drb)
+   //---
+   ossimString os = ossimUnitTypeLut::instance()->
+      getEntryString(theLinearUnits);
+   if (os == "unknown")
+   {
+      os = "default";  // Avoid saving as unknown for user readability.
+   }
+   kwl.add(prefix, "linear_units", os, true);
+
+   // Set the pixel type.
+   ossimString pixelType;
+   getPixelTypeString(pixelType);
+   kwl.add(prefix,
+           ossimKeywordNames::PIXEL_TYPE_KW,
+           pixelType.c_str(),
+           true);
+
+   return ossimSource::saveState(kwl, prefix);
+}
+
+bool ossimImageFileWriter::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   // Load the state of the base class.
+   bool result = ossimSource::loadState(kwl, prefix);
+
+   // Get the filename...
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   if(lookup)
+   {
+      ossimString filename = lookup;
+
+      lookup =  kwl.find(prefix, ossimKeywordNames::FILEPATH_KW);
+      if(lookup)
+      {
+         filename = ossimString(lookup) + filename;
+      }
+
+      setFilename(filename);
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
+   if(lookup)
+   {
+      if(ossimString(lookup).downcase().contains("area"))
+      {
+         thePixelType = OSSIM_PIXEL_IS_AREA;
+      }
+      else
+      {
+         thePixelType = OSSIM_PIXEL_IS_POINT;
+      }
+   }
+
+   lookup = kwl.find(prefix, "linear_units");
+   if(lookup)
+   {
+      ossimUnitType units = (ossimUnitType)ossimUnitTypeLut::instance()->
+         getEntryNumber(lookup, true);
+      if ( (units == OSSIM_METERS) ||
+           (units == OSSIM_FEET)   ||
+           (units == OSSIM_US_SURVEY_FEET) )
+      {
+         theLinearUnits = units;
+      }
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW);
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteExternalGeometryFlag = s.toBool();
+   }
+   
+   lookup = kwl.find(prefix, "create_envi_hdr");
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteEnviHeaderFlag = s.toBool();
+   }
+   
+   lookup = kwl.find(prefix, "create_ers_hdr");
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteErsHeaderFlag = s.toBool();
+   }
+
+   lookup = kwl.find(prefix, "create_fgdc");
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteFgdcFlag = s.toBool();
+   }
+   
+   lookup = kwl.find(prefix, "create_jpeg_world_file");
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteJpegWorldFileFlag = s.toBool();
+   }
+   
+   lookup = kwl.find(prefix, "create_readme");
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteReadmeFlag = s.toBool();
+   }
+   
+   lookup = kwl.find(prefix, "create_tiff_world_file");
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteTiffWorldFileFlag = s.toBool();
+   }
+
+   lookup = kwl.find(prefix, "create_world_file");
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteWorldFileFlag = s.toBool();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_IMAGE_KW);
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteImageFlag = s.toBool();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_OVERVIEW_KW);
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteOverviewFlag = s.toBool();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::CREATE_HISTOGRAM_KW);
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theWriteHistogramFlag = s.toBool();
+   }
+
+   lookup = kwl.find(prefix, SCALE_TO_EIGHT_BIT_KW);
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theScaleToEightBitFlag = s.toBool();
+   }
+
+   lookup = kwl.find(prefix, AUTO_CREATE_DIRECTORY_KW);
+   if(lookup)
+   {
+      theAutoCreateDirectoryFlag = ossimString(lookup).toBool();
+   }
+   lookup = kwl.find(prefix, ossimKeywordNames::OVERVIEW_COMPRESSION_TYPE_KW);
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theOverviewCompressType = static_cast<ossim_uint16>(s.toUInt32());
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::OVERVIEW_COMPRESSION_QUALITY_KW);
+   if(lookup)
+   {
+      ossimString s = lookup;
+      theOverviewJpegCompressQuality = s.toInt32();
+   }
+
+   const char* outputImageType = kwl.find(prefix, ossimKeywordNames::IMAGE_TYPE_KW);
+   if(outputImageType)
+   {
+      theOutputImageType = outputImageType;
+   }
+
+   if(theInputObjectList.size() != 2)
+   {
+      theInputObjectList.resize(2);
+      theInputListIsFixedFlag = true;
+   }
+
+   theOutputListIsFixedFlag = false;
+
+   return result;
+}
+
+bool ossimImageFileWriter::writeOverviewFile(ossim_uint16 tiff_compress_type,
+                                             ossim_int32 jpeg_compress_quality, 
+                                             bool includeR0) 
+{
+   if(theFilename == "") return false;
+
+   // Get an image handler for the source file.
+   ossimRefPtr<ossimImageHandler> ih
+      = ossimImageHandlerRegistry::instance()->open(theFilename);
+
+   if (ih.valid() == false)
+   {
+      // Set the error...
+      return false;
+   }
+
+   ossimRefPtr<ossimTiffOverviewBuilder> ob = new ossimTiffOverviewBuilder();
+   
+   if ( ob->setInputSource(ih.get()) )
+   {
+      // Give the listener to the overview builder if set.
+      if (theProgressListener)
+      {
+         ob->addListener(theProgressListener);
+      }
+      
+      // Build a new file name for the overview.
+      ossimFilename overview_file = theFilename;
+      overview_file.setExtension(ossimString("ovr"));
+      ob->setCompressionType(tiff_compress_type);
+      ob->setJpegCompressionQuality(jpeg_compress_quality);
+      ob->setOutputFile(overview_file);
+      ob->setCopyAllFlag(includeR0);
+      ob->execute();
+
+      // Remove the listener from the overview builder.
+      if (theProgressListener)
+      {
+         ob->removeListener(theProgressListener);
+      }
+   }
+
+   return true;
+}
+
+bool ossimImageFileWriter::writeEnviHeaderFile() 
+{
+   if( (theFilename == "") || !theInputConnection ||
+       theAreaOfInterest.hasNans())
+   {
+      return false;
+   }
+
+   // Make the file name.
+   ossimFilename outputFile = theFilename;
+   outputFile.setExtension(ossimString("hdr"));
+
+   // Make the writer.
+   ossimRefPtr<ossimMetadataFileWriter> writer =
+      new ossimEnviHeaderFileWriter();
+   
+   // Set things up.
+   writer->connectMyInputTo(0, theInputConnection.get());
+   writer->initialize();
+   writer->setFilename(outputFile);
+   writer->setPixelType(thePixelType);
+   writer->setAreaOfInterest(theAreaOfInterest);
+   
+   // Write it to disk.
+   return writer->execute();
+}
+
+bool ossimImageFileWriter::writeErsHeaderFile() 
+{
+   if( (theFilename == "") || !theInputConnection ||
+       theAreaOfInterest.hasNans())
+   {
+      return false;
+   }
+   
+   // Make the file name.
+   ossimFilename outputFile = theFilename;
+   outputFile.setExtension(ossimString("ers"));
+
+   // Make the writer.
+   ossimRefPtr<ossimMetadataFileWriter> writer =
+	   new ossimERSFileWriter();
+   
+   // Set things up.
+   writer->connectMyInputTo(0, theInputConnection.get());
+   writer->initialize();
+   writer->setFilename(outputFile);
+   writer->setPixelType(thePixelType);
+   writer->setAreaOfInterest(theAreaOfInterest);
+   
+   // Write it to disk.
+   return writer->execute();
+}
+
+bool ossimImageFileWriter::writeExternalGeometryFile() 
+{
+   if( (theFilename == "") || !theInputConnection ||
+       theAreaOfInterest.hasNans())
+   {
+      return false;
+   }
+
+   // Make the file name.
+   ossimFilename geomFile = theFilename;
+   geomFile.setExtension(ossimString("geom"));
+
+   // Make the writer.
+   ossimRefPtr<ossimMetadataFileWriter> writer = new ossimGeomFileWriter();
+
+   // Set things up.
+//   writer->connectMyInputTo(0, theInputConnection.get());
+   writer->connectMyInputTo(0, theInputConnection.get());
+   writer->setFilename(geomFile);
+   writer->initialize();
+   writer->setPixelType(thePixelType);
+   writer->setAreaOfInterest(theAreaOfInterest);
+
+   // Write it to disk.
+   return writer->execute();
+}
+
+bool ossimImageFileWriter::writeFgdcFile() 
+{
+   if( (theFilename == "") || !theInputConnection ||
+       theAreaOfInterest.hasNans())
+   {
+      return false;
+   }
+
+   // Make the file name.
+   ossimFilename outputFile = theFilename;
+   outputFile.setExtension(ossimString("xml"));
+
+   // Make the writer.
+   ossimRefPtr<ossimMetadataFileWriter> writer = new ossimFgdcFileWriter();
+   
+   // Set things up.
+   writer->connectMyInputTo(0, theInputConnection.get());
+   writer->initialize();
+   writer->setFilename(outputFile);
+   writer->setPixelType(thePixelType);
+   writer->setAreaOfInterest(theAreaOfInterest);
+   
+   // Write it to disk.
+   return writer->execute();
+}
+
+bool ossimImageFileWriter::writeJpegWorldFile() 
+{
+   if(theFilename == "")
+   {
+      return false;
+   }
+   
+   // Make the file name.
+   ossimFilename file = theFilename;
+   file.setExtension(ossimString("jpw")); // jpw???
+
+   return writeWorldFile(file);
+}
+
+bool ossimImageFileWriter::writeReadmeFile() 
+{
+   if( (theFilename == "") || !theInputConnection ||
+       theAreaOfInterest.hasNans())
+   {
+      return false;
+   }
+
+   // Make the file name.
+   ossimFilename outputFile = theFilename.noExtension();
+   
+   outputFile += "_readme.txt";
+
+   // Make the writer.
+   ossimRefPtr<ossimMetadataFileWriter> writer =
+      new ossimReadmeFileWriter();
+   
+   // Set things up.
+   writer->connectMyInputTo(0, theInputConnection.get());
+   writer->initialize();
+   writer->setFilename(outputFile);
+   writer->setPixelType(thePixelType);
+   writer->setAreaOfInterest(theAreaOfInterest);
+   
+   // Write it to disk.
+   return writer->execute();
+}
+
+bool ossimImageFileWriter::writeTiffWorldFile() 
+{
+   if(theFilename == "")
+   {
+      return false;
+   }
+   
+   // Make the file name.
+   ossimFilename file = theFilename;
+   file.setExtension(ossimString("tfw"));
+
+   return writeWorldFile(file);
+}
+
+bool ossimImageFileWriter::writeMetaDataFiles() 
+{
+   bool status = true;
+   
+   if(theWriteEnviHeaderFlag&&!needsAborting())
+   {
+      if(writeEnviHeaderFile() == false)
+      {
+         status = false;
+
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of envi header file failed!" << endl;
+      }
+   }
+
+   if(theWriteErsHeaderFlag&&!needsAborting())
+   {
+      if(writeErsHeaderFile() == false)
+      {
+         status = false;
+
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of ers header file failed!" << endl;
+      }
+   }
+
+   if (theWriteExternalGeometryFlag&&!needsAborting())
+   {
+      if( writeExternalGeometryFile() == false)
+      {
+         status = false;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of geometry file failed!" << endl;
+         }
+      }
+   }
+   if(theWriteFgdcFlag&&!needsAborting())
+   {
+      if(writeFgdcFile() == false)
+      {
+         status = false;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of fgdc file failed!" << endl;
+         }
+      }
+   }
+   if(theWriteJpegWorldFileFlag&&!needsAborting())
+   {
+      if(writeJpegWorldFile() == false)
+      {
+         status = false;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of jpeg world file failed!" << endl;
+         }
+      }
+   }
+   if(theWriteReadmeFlag&&!needsAborting())
+   {
+      if(writeReadmeFile() == false)
+      {
+         status = false;
+         
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of readme file failed!" << endl;
+         }
+      }
+   }
+   if(theWriteTiffWorldFileFlag&&!needsAborting())
+   {
+      if(writeTiffWorldFile() == false)
+      {
+         status = false;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of tiff world file failed!" << endl;
+         }
+      }
+   }
+
+   if(theWriteWorldFileFlag&&!needsAborting())
+   {
+      if(writeWorldFile() == false)
+      {
+         status = false;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of world file failed!" << endl;
+         }
+      }
+   }
+   
+   if (theWriteHistogramFlag&&!needsAborting())
+   {
+      if (!writeHistogramFile())
+      {
+         status = false;
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of histogram file failed!" << endl;
+         }
+      }
+   }
+
+   return status;
+}
+
+bool ossimImageFileWriter::writeHistogramFile() 
+{
+   if(needsAborting()) return false;
+   if(theFilename == "") return false;
+
+   ossimFilename histogram_file = theFilename;
+   histogram_file.setExtension(ossimString("his"));
+
+   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->
+      open(theFilename);
+
+   if (!handler)
+   {
+      return false;
+   }
+
+   ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
+
+   ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
+   histoSource->setMaxNumberOfRLevels(1); // Only compute for r0.
+   histoSource->connectMyInputTo(0, handler.get());
+   histoSource->enableSource();
+   writer->connectMyInputTo(0, histoSource.get());
+   writer->setFilename(histogram_file);
+   writer->addListener(&theStdOutProgress);
+   writer->execute();
+   writer->disconnect();
+   histoSource->disconnect();
+   handler->disconnect();
+   writer = 0; histoSource = 0; handler = 0;
+   return true;
+}
+
+void ossimImageFileWriter::disconnectInputEvent(ossimConnectionEvent& /* event */)
+{
+   if(!getInput(0))
+   {
+      theInputConnection->disconnectMyInput((ossim_int32)0, false);
+   }
+   theViewController = PTR_CAST(ossimViewController, getInput(1));
+
+   initialize();
+}
+
+void ossimImageFileWriter::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+   theInputConnection->connectMyInputTo((ossim_int32)0,
+                                        getInput(0),
+                                        false);
+   theViewController = PTR_CAST(ossimViewController, getInput(1));
+   initialize();
+}
+
+void ossimImageFileWriter::propertyEvent(ossimPropertyEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimImageFileWriter::setOutputImageType(const ossimString& type)
+{
+   theOutputImageType = type;
+}
+
+void ossimImageFileWriter::setOutputImageType(ossim_int32 type)
+{
+   ossimImageTypeLut lut;
+   theOutputImageType = lut.getEntryString(type);
+}
+
+ossimString ossimImageFileWriter::getOutputImageTypeString() const
+{
+   return theOutputImageType;
+
+}
+
+ossim_int32 ossimImageFileWriter::getOutputImageType() const
+{
+   ossimImageTypeLut lut;
+   return lut.getEntryNumber(theOutputImageType);
+}
+
+
+bool ossimImageFileWriter::getWriteImageFlag() const
+{
+   return theWriteImageFlag;
+}
+
+bool ossimImageFileWriter::getWriteHistogramFlag() const
+{
+   return theWriteHistogramFlag;
+}
+
+bool ossimImageFileWriter::getWriteOverviewFlag() const
+{
+   return theWriteOverviewFlag;
+}
+
+bool ossimImageFileWriter::getScaleToEightBitFlag() const
+{
+   return theScaleToEightBitFlag;
+}
+
+bool ossimImageFileWriter::getWriteEnviHeaderFlag() const
+{
+   return theWriteEnviHeaderFlag;
+}
+
+bool ossimImageFileWriter::getWriteErsHeaderFlag() const
+{
+   return theWriteErsHeaderFlag;
+}
+
+bool ossimImageFileWriter::getWriteExternalGeometryFlag() const
+{
+   return theWriteExternalGeometryFlag;
+}
+
+bool ossimImageFileWriter::getWriteFgdcFlag() const
+{
+   return theWriteFgdcFlag;
+}
+
+bool ossimImageFileWriter::getWriteJpegWorldFileFlag() const
+{
+   return theWriteJpegWorldFileFlag;
+}
+
+bool ossimImageFileWriter::getWriteReadmeFlag() const
+{
+   return theWriteReadmeFlag;
+}
+
+bool ossimImageFileWriter::getWriteTiffWorldFileFlag() const
+{
+   return theWriteTiffWorldFileFlag;
+}
+
+bool ossimImageFileWriter::getWriteWorldFileFlag() const
+{
+   return theWriteWorldFileFlag;
+}
+
+void ossimImageFileWriter::setWriteOverviewFlag(bool flag)
+{
+   theWriteOverviewFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteImageFlag(bool flag)
+{
+   theWriteImageFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteHistogramFlag(bool flag)
+{
+   theWriteHistogramFlag = flag;
+}
+
+void ossimImageFileWriter::setScaleToEightBitFlag(bool flag)
+{
+   theScaleToEightBitFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteEnviHeaderFlag(bool flag)
+{
+   theWriteEnviHeaderFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteErsHeaderFlag(bool flag)
+{
+   theWriteErsHeaderFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteExternalGeometryFlag(bool flag)
+{
+   theWriteExternalGeometryFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteFgdcFlag(bool flag)
+{
+   theWriteFgdcFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteJpegWorldFile(bool flag)
+{
+   theWriteJpegWorldFileFlag  = flag;
+}
+
+void ossimImageFileWriter::setWriteReadme(bool flag)
+{
+   theWriteReadmeFlag = flag;
+}
+
+void ossimImageFileWriter::setWriteTiffWorldFile(bool flag)
+{
+   theWriteTiffWorldFileFlag  = flag;
+}
+
+void ossimImageFileWriter::setWriteWorldFile(bool flag)
+{
+   theWriteWorldFileFlag  = flag;
+}
+
+ossimObject* ossimImageFileWriter::getObject()
+{
+   return this;
+}
+
+const ossimObject* ossimImageFileWriter::getObject() const
+{
+   return this;
+}
+
+void ossimImageFileWriter::setAreaOfInterest(const ossimIrect& inputRect)
+{
+   // This sets "theAreaOfInterest".
+   ossimImageWriter::setAreaOfInterest(inputRect);
+   
+   if( theInputConnection.valid() )
+   {
+      //---
+      // ossimImageSourceSequencer::setAreaOfInterest does more than just set the
+      // variable, so only call if out of sync to avoid wasted cycles.
+      //--- 
+      if ( theAreaOfInterest != theInputConnection->getBoundingRect() )
+      {
+         // Set the sequencer area of interest.
+         theInputConnection->setAreaOfInterest(inputRect);
+      }
+   }
+}
+
+ossimImageSourceSequencer* ossimImageFileWriter::getSequencer()
+{
+   return theInputConnection.get();
+}
+
+bool ossimImageFileWriter::execute()
+{
+   static const char MODULE[] = "ossimImageFileWriter::execute";
+   
+   if (!theInputConnection) // Must have a sequencer...
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG:\ntheInputConnection is NULL!" << endl;
+      }
+      return false;
+   }
+   
+   if (theFilename == "") // Must have a filename...
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG:\ntheFilename is empty!" << endl;
+      }
+      return false;
+   }
+   
+   
+   // make sure we have a region of interest
+   if(theAreaOfInterest.hasNans())
+   {
+      theInputConnection->initialize();
+      theAreaOfInterest = theInputConnection->getAreaOfInterest();
+   }
+   else
+   {
+      theInputConnection->setAreaOfInterest(theAreaOfInterest);
+   }
+
+   if(theAreaOfInterest.hasNans()) // Must have an area of interest...
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " ERROR:  Area of interest has nans!"
+            << "Area of interest:  "
+            << theAreaOfInterest
+            << "\nReturning..." << endl;
+      }
+
+      return false;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG:\n"
+         << "Area of interest:  " << theAreaOfInterest << endl;
+   }
+   
+   ossimRefPtr<ossimImageSource> savedInput;
+   if (theScaleToEightBitFlag)
+   {
+      if(theInputConnection->getOutputScalarType() != OSSIM_UINT8)
+      {
+         savedInput = new ossimScalarRemapper;
+         
+         savedInput->connectMyInputTo(0, theInputConnection->getInput(0));
+         theInputConnection->connectMyInputTo(0, savedInput.get());
+         theInputConnection->initialize();
+      }
+   }
+
+   ossimFilename path = theFilename.path();
+   if (!path.empty() && !path.exists() )
+   {
+      path.createDirectory(true);
+   }
+   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
+   //setPercentComplete(0.0); let writeFile set the precent complete
+   bool wroteFile = true;
+   bool result    = true;
+   if (theWriteImageFlag)
+   {
+      wroteFile = writeFile();
+   }
+  
+   /*
+   if(needsAborting())
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_ABORTED);
+   }
+   else
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
+   }
+   */
+   if (theWriteOverviewFlag&&!needsAborting())
+   {
+      // Writing overviews has been mpi'd so do on all processes.
+      if (!writeOverviewFile(theOverviewCompressType,
+                             theOverviewJpegCompressQuality))
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "Write of overview file failed!" << endl;
+         }
+      }
+   }
+
+   if(!needsAborting())
+   {
+      // Do these only on the master process. Note left to right precedence!
+      if (getSequencer() && getSequencer()->isMaster())
+      {
+         if (wroteFile)
+         {
+            if (writeMetaDataFiles() == false)
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                  << "Write of metadata file failed!" << endl;
+               }
+               result = false;
+            }
+         }
+         
+      } // End of "if (getSequencer() && getSequencer()->isMaster()))
+   }
+
+   if(savedInput.valid())
+   {
+      ossimConnectableObject* obj = theInputConnection->getInput(0);
+      if(obj)
+      {
+         theInputConnection->connectMyInputTo(0, obj->getInput(0));
+      }
+   }
+   if(!needsAborting())
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
+   }
+   else 
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_ABORTED);   
+   }
+
+   savedInput = 0;
+   return result;
+}
+
+bool ossimImageFileWriter::writeStream()
+{
+   //---
+   // Not implemented in this class. Derived classed should implement if
+   // they can write to a stream.
+   //--- 
+   return false;
+}
+
+ossimRefPtr<ossimOStream> ossimImageFileWriter::getOutputStream() const
+{
+   //---
+   // Not implemented in this class. Derived classed should implement if
+   // they can write to a stream.
+   //--- 
+   return ossimRefPtr<ossimOStream>();  
+}
+
+bool ossimImageFileWriter::setOutputStream(
+   ossimRefPtr<ossimOStream> /* stream */ )
+{
+   //---
+   // Not implemented in this class. Derived classed should implement if
+   // they can write to a stream.
+   //---
+   return false;
+}
+
+bool ossimImageFileWriter::setOutputStream(std::ostream& /* str */)
+{
+   //---
+   // Not implemented in this class. Derived classed should implement if
+   // they can write to a stream.
+   //---
+   return false;
+}
+
+
+void ossimImageFileWriter::setPercentComplete(double percentComplete)
+{
+   ossimProcessInterface::setPercentComplete(percentComplete);
+   ossimProcessProgressEvent event(this, percentComplete);
+   fireEvent(event);
+}
+
+void ossimImageFileWriter::setOutputName(const ossimString& outputName)
+{
+   ossimImageWriter::setOutputName(outputName);
+   setFilename(ossimFilename(outputName));
+}
+
+void ossimImageFileWriter::setFilename(const ossimFilename& file)
+{
+   theFilename = file;
+}
+
+const ossimFilename& ossimImageFileWriter::getFilename()const
+{
+   return theFilename;
+}
+
+bool ossimImageFileWriter::canConnectMyInputTo(ossim_int32 inputIndex,
+                                               const ossimConnectableObject* object)const
+{
+   return (object&&
+           ( (PTR_CAST(ossimImageSource, object)&&inputIndex == 0)||
+             (PTR_CAST(ossimViewController, object)&&inputIndex == 1)) );
+}
+
+ossim_uint16 ossimImageFileWriter::getOverviewCompressType() const
+{
+   return theOverviewCompressType;
+}
+
+ossim_int32  ossimImageFileWriter::getOverviewJpegCompressQuality() const
+{
+   return theOverviewJpegCompressQuality;
+}
+
+void ossimImageFileWriter::setOverviewCompressType(ossim_uint16 type)
+{
+   theOverviewCompressType = type;
+}
+
+void ossimImageFileWriter::setOverviewJpegCompressQuality(ossim_int32 quality)
+{
+   theOverviewJpegCompressQuality = quality;
+}
+
+void ossimImageFileWriter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+   
+   if(property->getName() == ossimKeywordNames::FILENAME_KW)
+   {
+      theFilename = property->valueToString();
+   }
+   else if (property->getName() == "create_envi_hdr")
+   {
+      theWriteEnviHeaderFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == "create_ers_hdr")
+   {
+      theWriteErsHeaderFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() ==
+            ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW)
+   {
+      theWriteExternalGeometryFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == "create_fgdc")
+   {
+      theWriteFgdcFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == "create_jpeg_world_file")
+   {
+      theWriteJpegWorldFileFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == "create_readme")
+   {
+      theWriteReadmeFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == "create_tiff_world_file")
+   {
+      theWriteTiffWorldFileFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == "create_world_file")
+   {
+      theWriteWorldFileFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == ossimKeywordNames::CREATE_IMAGE_KW)
+   {
+      theWriteImageFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == ossimKeywordNames::CREATE_OVERVIEW_KW)
+   {
+      theWriteOverviewFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == ossimKeywordNames::CREATE_HISTOGRAM_KW)
+   {
+      theWriteHistogramFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == SCALE_TO_EIGHT_BIT_KW)
+   {
+      theScaleToEightBitFlag = property->valueToString().toBool();
+   }
+   else if(property->getName() == AUTO_CREATE_DIRECTORY_KW)
+   {
+      theAutoCreateDirectoryFlag = property->valueToString().toBool();
+   }
+   else if (property->getName() == "linear_units")
+   {
+      theLinearUnits = (ossimUnitType)
+         (ossimUnitTypeLut::instance()->
+          getEntryNumber(property->valueToString()));
+   }
+   else if(property->getName() == ossimKeywordNames::IMAGE_TYPE_KW)
+   {
+      setOutputImageType(property->valueToString());
+   }
+   else if(property->getName() == ossimKeywordNames::PIXEL_TYPE_KW)
+   {
+      ossimStringProperty* stringProperty = PTR_CAST(ossimStringProperty,
+                                                     property.get());
+      if (stringProperty)
+      {
+         ossimString s;
+         stringProperty->valueToString(s);
+         setPixelType(s);
+      }
+   }
+   else
+   {
+      ossimImageWriter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimImageFileWriter::getProperty(const ossimString& name)const
+{
+   if(name == ossimKeywordNames::FILENAME_KW)
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, theFilename);
+
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_OUTPUT);
+
+      return filenameProp;
+   }
+   else if(name == ossimKeywordNames::IMAGE_TYPE_KW)
+   {
+      ossimStringProperty* prop =  new ossimStringProperty(name, theOutputImageType, false);
+      std::vector<ossimString> typeList;
+      getImageTypeList(typeList);
+      if(typeList.size() > 1)
+      {
+         prop->setReadOnlyFlag(false);
+         prop->setConstraints(typeList);
+         prop->setChangeType(ossimProperty::ossimPropertyChangeType_AFFECTS_OTHERS);
+      }
+      else
+      {
+         prop->setReadOnlyFlag(true);
+      }
+      return prop;
+   }
+   else if(name == AUTO_CREATE_DIRECTORY_KW)
+   {
+      return new ossimBooleanProperty(name, theAutoCreateDirectoryFlag);
+   }
+   else if (name == "create_envi_hdr")
+   {
+      return new ossimBooleanProperty(name, theWriteEnviHeaderFlag);
+   }
+   else if (name == "create_ers_hdr")
+   {
+      return new ossimBooleanProperty(name, theWriteErsHeaderFlag);
+   }
+   else if (name == ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW)
+   {
+      return new ossimBooleanProperty(name, theWriteExternalGeometryFlag);
+   }
+   else if (name == "create_fgdc")
+   {
+      return new ossimBooleanProperty(name, theWriteFgdcFlag);
+   }
+   else if (name == "create_jpeg_world_file")
+   {
+      return new ossimBooleanProperty(name, theWriteJpegWorldFileFlag);
+   }
+   else if (name == "create_readme")
+   {
+      return new ossimBooleanProperty(name, theWriteReadmeFlag);
+   }
+   else if (name == "create_tiff_world_file")
+   {
+      return new ossimBooleanProperty(name, theWriteTiffWorldFileFlag);
+   }
+   else if (name == "create_world_file")
+   {
+      return new ossimBooleanProperty(name, theWriteWorldFileFlag);
+   }
+   else if (name == ossimKeywordNames::CREATE_IMAGE_KW)
+   {
+      return new ossimBooleanProperty(name, theWriteImageFlag);
+   }
+   else if (name == ossimKeywordNames::CREATE_OVERVIEW_KW)
+   {
+      return new ossimBooleanProperty(name, theWriteOverviewFlag);
+   }
+   else if (name == ossimKeywordNames::CREATE_HISTOGRAM_KW)
+   {
+      return new ossimBooleanProperty(name, theWriteHistogramFlag);
+   }
+   else if (name == SCALE_TO_EIGHT_BIT_KW)
+   {
+      return new ossimBooleanProperty(name, theScaleToEightBitFlag);
+   }
+   else if (name == "linear_units")
+   {
+      // property value
+      ossimString value = ossimUnitTypeLut::instance()->
+         getEntryString(theLinearUnits);
+      
+      //---
+      // theLinearUnits is set to unknown as a default.  This keys the
+      // writer to use whatever makes sense for the given output.
+      // Since "unknown" is a bad name to present to users, we will
+      // use "default" if theLinearUnits is == "unknown".
+      //---
+      if (value == "unknown")
+      {
+         value = "default";
+      }
+      
+      // constraint list
+      vector<ossimString> constraintList;
+      constraintList.push_back(ossimString("default"));
+      constraintList.push_back(ossimString("meters"));
+      constraintList.push_back(ossimString("feet"));
+      constraintList.push_back(ossimString("us_survey_feet"));
+      
+      return new ossimStringProperty(name,
+                                     value,
+                                     false, // not editable
+                                     constraintList);
+   }
+   else if (name == ossimKeywordNames::PIXEL_TYPE_KW)
+   {
+      ossimString value;
+      getPixelTypeString(value);
+      ossimStringProperty* stringProp =
+         new ossimStringProperty(name,
+                                 value,
+                                 false); // editable flag
+      stringProp->addConstraint(ossimString("point"));
+      stringProp->addConstraint(ossimString("area"));
+      return stringProp;
+   }
+
+   return ossimImageWriter::getProperty(name);
+}
+
+void ossimImageFileWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageWriter::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(ossimString(ossimKeywordNames::FILENAME_KW));
+   propertyNames.push_back(ossimString("create_envi_hdr"));  
+   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_EXTERNAL_GEOMETRY_KW));
+   propertyNames.push_back(ossimString("create_fgdc"));
+   propertyNames.push_back(ossimString("create_jpeg_world_file"));
+   propertyNames.push_back(ossimString("create_readme"));
+   propertyNames.push_back(ossimString("create_tiff_world_file"));
+   propertyNames.push_back(ossimString("create_world_file"));   
+   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_IMAGE_KW));
+   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_OVERVIEW_KW));
+   propertyNames.push_back(ossimString(ossimKeywordNames::CREATE_HISTOGRAM_KW));
+   propertyNames.push_back(ossimString(AUTO_CREATE_DIRECTORY_KW));
+   propertyNames.push_back(ossimString(SCALE_TO_EIGHT_BIT_KW));
+   propertyNames.push_back(ossimString("linear_units"));
+   propertyNames.push_back(ossimString(ossimKeywordNames::PIXEL_TYPE_KW));
+   propertyNames.push_back(ossimString(ossimKeywordNames::IMAGE_TYPE_KW));
+
+}
+
+ossimString ossimImageFileWriter::getExtension() const
+{
+   // default unknown file extension
+   return ossimString("ext");
+}
+
+bool ossimImageFileWriter::getOutputHasInternalOverviews( void ) const
+{
+   // default value: don't assume internal overviews will
+   // be generated by image writers.
+   return false;
+}
+
+bool ossimImageFileWriter::hasImageType(const ossimString& imageType) const
+{
+   std::vector<ossimString> imageTypeList;
+   getImageTypeList(imageTypeList);
+
+   std::vector<ossimString>::const_iterator i = imageTypeList.begin();
+
+   while (i != imageTypeList.end())
+   {
+      if ( (*i) == imageType )
+      {
+         return true;
+      }
+      ++i;
+   }
+
+   return false; // not found...
+}
+
+bool ossimImageFileWriter::addListener(ossimListener* listener)
+{
+   theProgressListener = listener;
+   return ossimImageWriter::addListener(listener);
+}
+
+bool ossimImageFileWriter::removeListener(ossimListener* listener)
+{
+   if (listener == theProgressListener)
+   {
+      theProgressListener = NULL;
+   }
+   return ossimImageWriter::removeListener(listener);
+}
+
+void ossimImageFileWriter::setPixelType(ossimPixelType type)
+{
+   thePixelType = type;
+}
+
+void ossimImageFileWriter::setPixelType(const ossimString& type)
+{
+   ossimString s = type;
+   s.downcase();
+   if (s == "point")
+   {
+      setPixelType(OSSIM_PIXEL_IS_POINT);
+   }
+   else if (s == "area")
+   {
+      setPixelType(OSSIM_PIXEL_IS_AREA);
+   }
+}
+
+ossimPixelType ossimImageFileWriter::getPixelType() const
+{
+   return thePixelType;
+}
+
+void ossimImageFileWriter::getPixelTypeString(ossimString& type) const
+{
+   if (thePixelType == OSSIM_PIXEL_IS_POINT)
+   {
+      type = "point";
+   }
+   else
+   {
+      type = "area";
+   }
+}
+
+void ossimImageFileWriter::setTileSize(const ossimIpt& tileSize)
+{
+   if (theInputConnection.valid())
+   {
+      theInputConnection->setTileSize(tileSize);
+   }
+}
+
+bool ossimImageFileWriter::writeWorldFile() 
+{
+   bool result = false;
+   
+   if( theFilename.size() )
+   {
+      // Make the file name.
+      ossimFilename file = theFilename;
+      ossimString ext = file.ext().downcase();
+      
+      ossimString wfExt = ""; // World file extension.
+      
+      if ( ( ext == "tif" ) || ( ext == "tiff" ) )
+      {
+         wfExt = "tfw";
+      }
+      else if ( ( ext == "jpg" ) || ( ext == "jpeg" ) )
+      {
+         wfExt = "jpw";
+      }
+      else if ( ext == "png" )
+      {
+         wfExt = "pgw";
+      }
+      else if ( ext == "sid" )
+      {
+         wfExt = "sdw";
+      }
+      
+      if ( ext.size() )
+      {
+         file.setExtension(wfExt);
+         
+         result = writeWorldFile(file);
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Could not derive world file extension for: " << theFilename << "\n"; 
+      }
+   }
+   
+   if ( !result )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Write of world file failed!\n";
+   }   
+   
+   return result;
+}
+
+bool ossimImageFileWriter::writeWorldFile(const ossimFilename& file) 
+{
+   if( !theInputConnection || theAreaOfInterest.hasNans())
+   {
+      return false;
+   }
+
+   // Make the writer.
+   ossimRefPtr<ossimWorldFileWriter> writer = new ossimWorldFileWriter();
+   
+   // Set things up.
+   writer->connectMyInputTo(0, theInputConnection.get());
+   writer->initialize();
+   writer->setFilename(file);
+   writer->setAreaOfInterest(theAreaOfInterest);
+   writer->setLinearUnits(theLinearUnits);
+   writer->setPixelType(thePixelType);
+   
+   // Write it to disk.
+   return writer->execute(); 
+}
diff --git a/src/imaging/ossimImageGaussianFilter.cpp b/src/imaging/ossimImageGaussianFilter.cpp
new file mode 100644
index 0000000..dc5dca4
--- /dev/null
+++ b/src/imaging/ossimImageGaussianFilter.cpp
@@ -0,0 +1,245 @@
+//*******************************************************************
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// class ossimImageGaussianFilter : tile source
+//*******************************************************************
+// $Id: ossimImageGaussianFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimImageGaussianFilter.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <cmath>
+
+RTTI_DEF1(ossimImageGaussianFilter, "ossimImageGaussianFilter", ossimImageSourceFilter);
+
+/** 
+ * property names
+ */
+static const char* PROPERTYNAME_GAUSSSTD     = "GaussStd";
+static const char* PROPERTYNAME_STRICTNODATA = "StrictNoData";
+
+ossimImageGaussianFilter::ossimImageGaussianFilter()
+   : ossimImageSourceFilter(),
+     theGaussStd(0.5),
+     theStrictNoData(true)
+{
+   // ingredients: 
+   // 2x  ConvolutionFilter1D
+   theHF=new ossimConvolutionFilter1D();
+   theVF=new ossimConvolutionFilter1D();
+
+   theHF->setIsHorizontal(true);
+   theVF->setIsHorizontal(false);
+   updateKernels();
+
+   theHF->setStrictNoData(theStrictNoData);
+   theVF->setStrictNoData(theStrictNoData);
+
+   //tie them up
+   theVF->connectMyInputTo(0,theHF.get());
+}
+
+ossimImageGaussianFilter::~ossimImageGaussianFilter()
+{
+   if(theHF.valid())
+   {
+      theHF->disconnect();
+      theHF = 0;
+   }
+   if(theVF.valid())
+   {
+      theVF->disconnect();
+      theVF = 0;
+   }
+}
+
+void ossimImageGaussianFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+
+   if (property->getName() == PROPERTYNAME_GAUSSSTD) {
+      ossimNumericProperty* sProperty = PTR_CAST(ossimNumericProperty,
+                                                     property.get());
+      if(sProperty)
+      {
+         setGaussStd(sProperty->asFloat64());
+      }
+   } else if (property->getName() == PROPERTYNAME_STRICTNODATA) {
+      ossimBooleanProperty* booleanProperty = PTR_CAST(ossimBooleanProperty,
+                                                     property.get());
+      if(booleanProperty)
+      {
+         setStrictNoData(booleanProperty->getBoolean());
+      }
+   } else {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimImageGaussianFilter::getProperty(const ossimString& name)const
+{
+   if (name == PROPERTYNAME_GAUSSSTD) {
+      ossimNumericProperty* property = new ossimNumericProperty(name,ossimString::toString(getGaussStd()),1e-13,100.0);
+      property->setCacheRefreshBit();
+      return property;
+   } else if (name == PROPERTYNAME_STRICTNODATA) {
+      ossimBooleanProperty* property = new ossimBooleanProperty(name,isStrictNoData());
+      property->setCacheRefreshBit();
+      return property;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimImageGaussianFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back(PROPERTYNAME_GAUSSSTD);
+   propertyNames.push_back(PROPERTYNAME_STRICTNODATA);
+}
+
+bool ossimImageGaussianFilter::saveState(ossimKeywordlist& kwl,
+                                          const char* prefix)const
+{   
+   kwl.add(prefix,
+           PROPERTYNAME_GAUSSSTD,
+           theGaussStd,
+           true);
+   kwl.add(prefix,
+           PROPERTYNAME_STRICTNODATA,
+           isStrictNoData()?"true":"false", //use string instead of boolean
+           true);
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+
+bool ossimImageGaussianFilter::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   const char* gs = kwl.find(prefix, PROPERTYNAME_GAUSSSTD);
+   if(gs)
+   {      
+      setGaussStd(ossimString(gs).toDouble());
+   } else {
+      cerr<<"ossimImageGaussianFilter : warning no "<< PROPERTYNAME_GAUSSSTD<<" in loadState"<<endl;
+   }
+   const char* sn = kwl.find(prefix, PROPERTYNAME_STRICTNODATA);
+   if(sn)
+   {      
+      setStrictNoData(ossimString(sn).toBool());
+   } else {
+      cerr<<"ossimConvolutionFilter1D : warning no "<<PROPERTYNAME_STRICTNODATA<<" in state"<<endl;
+   }
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+void ossimImageGaussianFilter::setGaussStd(const ossim_float64& v)
+{
+   theGaussStd = v;
+   updateKernels();
+}
+
+void ossimImageGaussianFilter::setStrictNoData(bool aStrict)
+{
+   theStrictNoData = aStrict;
+   theHF->setStrictNoData(aStrict);
+   theVF->setStrictNoData(aStrict);
+}
+
+void
+ossimImageGaussianFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   initializeProcesses();
+}
+
+ossimRefPtr<ossimImageData>
+ossimImageGaussianFilter::getTile(const ossimIrect &tileRect,ossim_uint32 resLevel)
+{
+    if(isSourceEnabled())
+    {
+       return theVF->getTile(tileRect, resLevel);
+    }
+    if(theInputConnection)
+    {
+       return theInputConnection->getTile(tileRect, resLevel);
+    }
+
+    return 0;
+}
+
+void
+ossimImageGaussianFilter::initializeProcesses()
+{
+   theHF->initialize();
+   theVF->initialize();
+}
+
+void
+ossimImageGaussianFilter::connectInputEvent(ossimConnectionEvent &event)
+{
+    ossimImageSourceFilter::connectInputEvent(event);
+    if(getInput())
+    {
+       theHF->connectMyInputTo(0, getInput());
+       initializeProcesses();
+    }
+    else
+    {
+       theHF->disconnectMyInput(0, false, false);
+       initializeProcesses();
+    }
+}
+
+void
+ossimImageGaussianFilter::disconnectInputEvent(ossimConnectionEvent &event)
+{
+    ossimImageSourceFilter::disconnectInputEvent(event);
+    if(getInput())
+    {
+       theHF->connectMyInputTo(0, getInput());
+       initializeProcesses();
+    }
+    else
+    {
+       theHF->disconnectMyInput(0, false, false);
+       initializeProcesses();
+    }
+}
+void
+ossimImageGaussianFilter::updateKernels()
+{
+   //update kernels based on GaussStd value :2.5 sigma on each side
+   // symetric kernel
+   static const ossim_float64 sigmaN = 2.5;
+   ossim_float64 sig22   = getGaussStd()*getGaussStd()*2.0;
+
+   ossim_uint32 halfw   = (ossim_uint32)(std::floor(getGaussStd() * sigmaN + 0.5));
+   ossim_uint32 supsize = 2*halfw + 1;
+
+   //fill with sym. gaussian (unnormalized)
+   vector<ossim_float64> newk(supsize);
+   ossim_float64 sum=1.0;
+   ossim_float64 v;
+   newk[halfw] = 1.0;
+   for(ossim_int32 i=(ossim_int32)halfw; i>0 ;--i) //reverse for summing
+   {
+      newk[halfw + i] = newk[halfw - i] = v = std::exp(-i*i/sig22);
+      sum += 2.0 * v;
+   }
+
+   //normalize
+   ossim_float64   invsum=1.0/sum;
+   for(ossim_uint32 i=0; i<supsize ;++i)
+   {
+      newk[i] *= invsum;
+   }
+
+   //send to 1d conv filters
+   theHF->setKernel(newk);
+   theVF->setKernel(newk);
+   theHF->setCenterOffset(halfw);
+   theVF->setCenterOffset(halfw);
+}
diff --git a/src/imaging/ossimImageGeometry.cpp b/src/imaging/ossimImageGeometry.cpp
new file mode 100644
index 0000000..1be6b76
--- /dev/null
+++ b/src/imaging/ossimImageGeometry.cpp
@@ -0,0 +1,1640 @@
+//**************************************************************************************************
+//
+// License: MIT
+// 
+// Author:  Oscar Kramer
+//
+// Description: Class implementation of ossimImageGeometry. See .h file for class documentation.
+//
+//**************************************************************************************************
+// $Id$
+
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossim2dTo2dTransformRegistry.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <cmath>
+
+RTTI_DEF1(ossimImageGeometry, "ossimImageGeometry", ossimObject);
+
+//**************************************************************************************************
+// Default constructor defaults to unity transform with no projection  
+//**************************************************************************************************
+ossimImageGeometry::ossimImageGeometry()
+:   
+m_transform (0),
+m_projection(0),
+m_decimationFactors(0),
+m_imageSize(),
+m_targetRrds(0)
+{
+   m_imageSize.makeNan();
+}
+
+//**************************************************************************************************
+// Copy constructor -- performs a deep copy. This is needed when an imageSource in the chain
+// needs to modify the image geometry at that point in the chain. The image geometry to the left
+// of that imageSource must remain unchanged. This constructor permits that imageSource to 
+// maintain its own geometry based on the input geometry. All objects in the chain and to the right
+// would see this alternate geometry. See ossimScaleFilter for an example of this case.
+//**************************************************************************************************
+ossimImageGeometry::ossimImageGeometry(const ossimImageGeometry& copy_this)
+:
+ossimObject(copy_this),
+m_transform(copy_this.m_transform.valid()?(ossim2dTo2dTransform*)copy_this.m_transform->dup():((ossim2dTo2dTransform*)0)),
+m_projection(copy_this.m_projection.valid()?(ossimProjection*)copy_this.m_projection->dup():(ossimProjection*)0),
+m_decimationFactors(copy_this.m_decimationFactors),
+m_imageSize(copy_this.m_imageSize),
+m_targetRrds(copy_this.m_targetRrds)
+{
+}
+
+//**************************************************************************************************
+//! Constructs with projection and transform objects available for referencing. Either pointer
+//! can be NULL -- the associated mapping would be identity.
+//**************************************************************************************************
+ossimImageGeometry::ossimImageGeometry(ossim2dTo2dTransform* transform, ossimProjection* proj)
+:
+ossimObject(),
+m_transform(transform),
+m_projection(proj),
+m_decimationFactors(0),
+m_imageSize(),
+m_targetRrds(0)   
+{
+   m_imageSize.makeNan();
+}
+
+//**************************************************************************************************
+// Destructor is hidden. Only accessible via ossimRefPtr centrally managed
+//**************************************************************************************************
+ossimImageGeometry::~ossimImageGeometry()
+{
+   // Nothing to do
+}
+
+bool ossimImageGeometry::open(const ossimFilename& image)
+{
+   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(image);
+   if (!handler.valid())
+      return false;
+
+   ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+   if (!geom.valid())
+      return false;
+
+   *this = *geom;
+   return true;
+}
+
+void ossimImageGeometry::rnToRn(const ossimDpt& inRnPt, ossim_uint32 inResolutionLevel,
+                                ossim_uint32 outResolutionLevel, ossimDpt& outRnPt) const
+{
+   if (inResolutionLevel != outResolutionLevel)
+   {
+      // Back out the decimation.
+      ossimDpt pt;
+      undecimatePoint(inRnPt, inResolutionLevel, pt);
+
+      // Decimate to new level.
+      decimatePoint(pt, outResolutionLevel, outRnPt);
+   }
+   else
+   {
+      outRnPt = inRnPt; // No transform required.
+   }
+}
+
+void ossimImageGeometry::rnToFull(const ossimDpt& rnPt,
+                                  ossim_uint32 resolutionLevel,
+                                  ossimDpt& fullPt) const
+{
+   // Back out the decimation.
+   ossimDpt localPt;
+   undecimatePoint(rnPt, resolutionLevel, localPt);
+
+   // Remove any shift/rotation.
+   if ( m_transform.valid() && !localPt.hasNans() )
+   {
+      m_transform->forward(localPt, fullPt);
+   }
+   else
+   {
+      fullPt = localPt; // No transform (shift/rotation)
+   }
+}
+
+void ossimImageGeometry::fullToRn(const ossimDpt& fullPt,
+                                  ossim_uint32 resolutionLevel,
+                                  ossimDpt& rnPt) const
+{
+   // Apply shift/rotation.
+   ossimDpt localPt;
+   if (m_transform.valid())
+   {
+      m_transform->inverse(fullPt, localPt);
+   }
+   else
+   {
+      localPt = fullPt; // No transform (shift/rotation)
+   }
+
+   // Apply the decimation.
+   decimatePoint(localPt, resolutionLevel, rnPt);
+}
+
+void ossimImageGeometry::rnToWorld(const ossimDpt& rnPt,
+                                   ossim_uint32 resolutionLevel,
+                                   ossimGpt& wpt) const
+{
+   ossimDpt localPt;
+   rnToRn(rnPt, resolutionLevel, m_targetRrds, localPt);
+   localToWorld(localPt, wpt);
+}
+
+void ossimImageGeometry::worldToRn(const ossimGpt& wpt,
+                                   ossim_uint32 resolutionLevel,
+                                   ossimDpt& rnPt) const
+{   
+   ossimDpt localPt;
+   worldToLocal(wpt, localPt);
+   rnToRn(localPt, m_targetRrds, resolutionLevel, rnPt);
+}
+
+//**************************************************************************************************
+//! Exposes the 3D projection from image to world coordinates. The caller should verify that
+//! a valid projection exists before calling this method. Returns TRUE if a valid ground point
+//! is available in the ground_pt argument. This method depends on the existence of elevation
+//! information. If no DEM is available, the results will be incorrect or inaccurate.
+//**************************************************************************************************
+bool ossimImageGeometry::localToWorld(const ossimDpt& local_pt, ossimGpt& world_pt) const
+{
+   //! Return a NAN point of no projection is defined:
+   if (!m_projection.valid())
+   {
+      world_pt.makeNan();
+      return false;
+   }
+
+   // First transform local pixel to full-image pixel:
+   ossimDpt full_image_pt;
+   rnToFull(local_pt, m_targetRrds, full_image_pt);
+
+   // Perform projection to world coordinates:
+   m_projection->lineSampleToWorld(full_image_pt, world_pt);
+
+
+    // Put longitude between -180 and +180 and latitude between -90 and +90 if not so. 
+   // world_pt.wrap();
+    
+   return true;
+}
+
+bool ossimImageGeometry::localToWorld(const ossimDrect& local_rect, ossimGrect& world_rect) const
+{
+   ossimGpt gp1, gp2, gp3, gp4;
+   if (  localToWorld(local_rect.ul(), gp1) && localToWorld(local_rect.ur(), gp2) &&
+         localToWorld(local_rect.lr(), gp3) && localToWorld(local_rect.ll(), gp4))
+   {
+      world_rect = ossimGrect(gp1, gp2, gp3, gp4);
+      return true;
+   }
+   return false;
+}
+
+//**************************************************************************************************
+//! Exposes the 3D projection from image to world coordinates given a constant height above 
+//! ellipsoid. The caller should verify that a valid projection exists before calling this
+//! method. Returns TRUE if a valid ground point is available in the ground_pt argument.
+//**************************************************************************************************
+bool ossimImageGeometry::localToWorld(const ossimDpt& local_pt, 
+                                      const double& h_ellipsoid, 
+                                      ossimGpt& world_pt) const
+{
+   //! Return a NAN point of no projection is defined:
+   if (!m_projection.valid())
+   {
+      world_pt.makeNan();
+      return false;
+   }
+
+   // First transform local pixel to full-image pixel:
+   ossimDpt full_image_pt;
+   rnToFull(local_pt, m_targetRrds, full_image_pt);
+
+   // Perform projection to world coordinates:
+   m_projection->lineSampleHeightToWorld(full_image_pt, h_ellipsoid, world_pt);
+
+   // Put longitude between -180 and +180 and latitude between -90 and +90 if not so. 
+   world_pt.wrap();
+    
+   return true;
+}
+
+//**************************************************************************************************
+//! Exposes the 3D world-to-local image coordinate reverse projection. The caller should verify 
+//! that a valid projection exists before calling this method. Returns TRUE if a valid image 
+//! point is available in the local_pt argument.
+//**************************************************************************************************
+bool ossimImageGeometry::worldToLocal(const ossimGpt& world_pt, ossimDpt& local_pt) const
+{
+   bool result = true;
+   
+   if ( m_projection.valid() )
+   {
+      //const ossimEquDistCylProjection* eqProj =
+      //   dynamic_cast<const ossimEquDistCylProjection*>( m_projection.get() );
+      
+      ossimDpt full_image_pt;
+
+      //***** GCP
+      // I am having major problems with the call and is messing up on Image that are edge to edge -180 to 180.
+      // It appears to wrap and think that the image is onl 1 pixel wide.  I am commenting out for now
+      // until a better solution can be done for points that wrap.  We need a general implementation that will work
+      // with any projector
+      //
+
+      //if ( eqProj && (m_imageSize.hasNans() == false) )
+     // {
+         // Call specialized method to handle wrapping...
+     //    eqProj->worldToLineSample( world_pt, m_imageSize, full_image_pt );
+     // }
+     // else if( isAffectedByElevation() )
+      if( isAffectedByElevation() )
+      {
+         ossimGpt copyPt( world_pt );
+         if(world_pt.isHgtNan())
+         {
+            copyPt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(copyPt);
+         }     
+
+         // Perform projection from world coordinates to full-image space:
+         m_projection->worldToLineSample(copyPt, full_image_pt);
+      }
+      else
+      {
+         // Perform projection from world coordinates to full-image space:
+         m_projection->worldToLineSample(world_pt, full_image_pt);
+      }
+      
+      // Transform to local space:
+      fullToRn(full_image_pt, m_targetRrds, local_pt);
+   }
+   else // No projection set:
+   {
+      local_pt.makeNan();
+      result = false;  
+   }
+   
+   return result;
+   
+} // End: ossimImageGeometry::worldToLocal(const ossimGpt&, ossimDpt&)
+
+bool ossimImageGeometry::worldToLocal(const ossimGrect& world_rect, ossimDrect& local_rect) const
+{
+   ossimDpt dp1, dp2, dp3, dp4;
+   if (  worldToLocal(world_rect.ul(), dp1) && worldToLocal(world_rect.ur(), dp2) &&
+         worldToLocal(world_rect.lr(), dp3) && worldToLocal(world_rect.ll(), dp4))
+   {
+      local_rect = ossimDrect(dp1, dp2, dp3, dp4);
+      return true;
+   }
+   return false;
+}
+
+//**************************************************************************************************
+//! Sets the transform to be used for local-to-full-image coordinate transformation
+//**************************************************************************************************
+void ossimImageGeometry::setTransform(ossim2dTo2dTransform* transform) 
+{ 
+   m_transform = transform; 
+}
+
+//**************************************************************************************************
+//! Sets the projection to be used for local-to-world coordinate transformation
+//**************************************************************************************************
+void ossimImageGeometry::setProjection(ossimProjection* projection) 
+{ 
+   m_projection = projection; 
+}
+
+//**************************************************************************************************
+//! Returns TRUE if this geometry is sensitive to elevation
+//**************************************************************************************************
+bool ossimImageGeometry::isAffectedByElevation() const
+{
+    if (m_projection.valid())
+        return m_projection->isAffectedByElevation();
+    return false;
+}
+
+//*************************************************************************************************
+//! Returns  GSD in meters in x- and y-directions. This may not be the same as the member 
+//! projection's stated resolution since a transform may be involved.
+//*************************************************************************************************
+ossimDpt ossimImageGeometry::getMetersPerPixel() const
+{
+   ossimDpt gsd;
+   getMetersPerPixel(gsd);
+   return gsd;
+}
+
+//*************************************************************************************************
+//! Computes GSD in meters in x- and y-directions. This may not be the same as the member 
+//! projection's stated resolution since a transform may be involved.
+//*************************************************************************************************
+void ossimImageGeometry::getMetersPerPixel( ossimDpt& gsd ) const
+{
+   if (m_projection.valid() && !m_transform.valid())
+   {
+      // No transform present, so simply query the projection for GSD:
+      gsd = m_projection->getMetersPerPixel();
+   }
+   else if (m_projection.valid() && (m_imageSize.hasNans() == false))
+   {
+      // A transform is involved, so need to use localToWorld call below:
+      ossimDpt pL0 (m_imageSize/2);
+      ossimDpt pLx (pL0.x+1, pL0.y);
+      ossimDpt pLy (pL0.x, pL0.y+1);
+      ossimGpt g0, gx, gy;
+
+      localToWorld(pL0, g0);
+      localToWorld(pLx, g0.height(), gx);
+      localToWorld(pLy, g0.height(), gy);
+
+      // Compute horizontal distance for one pixel:
+      gsd.x = g0.distanceTo(gx);
+      gsd.y = g0.distanceTo(gy);
+   }
+   else
+   {
+      // This object is not fully initialized:
+      gsd.makeNan();
+   }
+}
+
+//*************************************************************************************************
+// Returns the resolution of this image in degrees/pixel. Note that this only
+// makes sense if there is a projection associated with the image. Returns NaNs if no 
+// projection defined.
+//*************************************************************************************************
+ossimDpt ossimImageGeometry::getDegreesPerPixel() const
+{
+   ossimDpt dpp;
+   getDegreesPerPixel(dpp);
+   return dpp;
+}
+
+//*************************************************************************************************
+// Computes the resolution of this image in degrees/pixel. Note that this only
+// makes sense if there is a projection associated with the image. Returns NaNs if no 
+// projection defined.
+//*************************************************************************************************
+void ossimImageGeometry::getDegreesPerPixel( ossimDpt& dpp ) const
+{
+   const ossimMapProjection *map_proj = dynamic_cast<const ossimMapProjection *>(m_projection.get());
+   if (map_proj && !m_transform.valid())
+   {
+      // No transform present, so simply query the projection for resolution:
+      dpp = map_proj->getDecimalDegreesPerPixel();
+   }
+   else if (m_projection.valid() && (m_imageSize.hasNans() == false))
+   {
+      // A transform is involved, so need to use localToWorld call below:
+      ossimDpt pL0 (m_imageSize/2);
+      ossimDpt pLx (pL0.x+1, pL0.y);
+      ossimDpt pLy (pL0.x, pL0.y+1);
+      ossimGpt g0, gx, gy;
+
+      localToWorld(pL0, g0);
+      localToWorld(pLx, g0.height(), gx);
+      localToWorld(pLy, g0.height(), gy);
+
+      // Compute horizontal distance for one pixel:
+      double dlatx = std::fabs(g0.lat - gx.lat);
+      double dlaty = std::fabs(g0.lat - gy.lat);
+      double dlonx = std::fabs(g0.lon - gx.lon);
+      double dlony = std::fabs(g0.lon - gy.lon);
+      dpp.lat = sqrt(dlatx*dlatx + dlaty*dlaty);
+      dpp.lon = sqrt(dlonx*dlonx + dlony*dlony);
+   }
+   else
+   {
+      // This object is not fully initialized:
+      dpp.makeNan();
+   }
+}
+
+//**************************************************************************************************
+//! Prints contents to output stream.
+//**************************************************************************************************
+std::ostream& ossimImageGeometry::print(std::ostream& out) const
+{
+   out << "type: ossimImageGeometry" << std::endl;
+   if(m_transform.valid())
+   {
+      out << "  m_transform: ";
+      m_transform->print(out);
+   }
+   else
+   {
+      out << "  No transform defined. Using identity transform.\n";
+   }
+   
+   if(m_projection.valid())
+   {
+      out << "  m_projection: ";
+      m_projection->print(out);
+   }
+   else
+   {
+      out << "  No projection defined. ";
+   }
+
+   for ( std::vector<ossimDpt>::size_type i = 0; i < m_decimationFactors.size(); ++i )
+   {
+      cout << "m_decimationFactors[" << i << "]: " << m_decimationFactors[i] << "\n";
+   }
+
+   out << "m_imageSize: " << m_imageSize
+       << "\nm_targetRrds: " << m_targetRrds << "\n";
+
+   return out;
+}
+
+//**************************************************************************************************
+//! Returns TRUE if argument geometry has exactly the same instances for transform and 
+//! m_projection. This may need to be expanded to permit different instances of same transforms
+//**************************************************************************************************
+bool ossimImageGeometry::operator==(const ossimImageGeometry& other) const
+{
+    return ((m_transform == other.m_transform) && (m_projection == other.m_projection) &&
+            (decimationFactor(0) == other.decimationFactor(0)) );
+}
+
+//**************************************************************************************************
+//! Returns the decimation factor from R0 for the resolution level specified. For r_index=0, the 
+//! decimation factor is by definition 1.0. For the non-discrete case, r_index=1 returns a 
+//! decimation of 0.5. If the vector of discrete decimation factors (m_decimationFactors) is 
+//! empty, the factor will be computed as f=1/2^n
+//**************************************************************************************************
+ossimDpt ossimImageGeometry::decimationFactor(ossim_uint32 r_index) const
+{
+   ossim_uint32 size = (ossim_uint32)m_decimationFactors.size();
+   if (size)
+   {
+      if (r_index < size)
+      {
+         return m_decimationFactors[r_index];
+      }
+      
+      // Return the last defined decimation if the index requested exceeds list size:
+      return m_decimationFactors[size-1];
+   }
+
+   // Compute the decimation factor:
+   ossim_float64 factor = 1.0/(ossim_float64)(1 << r_index);
+   
+   return ossimDpt(factor, factor);
+}
+
+void ossimImageGeometry::decimationFactor(ossim_uint32 r_index,
+                                          ossimDpt& result) const
+{
+   const ossim_uint32 SIZE = (ossim_uint32)m_decimationFactors.size();
+   if (SIZE)
+   {
+      if (r_index < SIZE)
+      {
+         result = m_decimationFactors[r_index];
+      }
+      else
+      {
+         //---
+         // Return the last defined decimation if the index requested
+         // exceeds list size:
+         //---
+         result = m_decimationFactors[SIZE-1];
+      }
+   }
+   else
+   {
+      // Compute the decimation factor:
+      ossim_float64 factor = 1.0/(ossim_float64)(1 << r_index);
+      result.x = factor;
+      result.y = factor;
+   }
+}
+
+void ossimImageGeometry::decimationFactors(
+   std::vector<ossimDpt>& decimations) const
+{
+   decimations = m_decimationFactors;
+}
+
+//*****************************************************************************
+//! Attempts to initialize a transform and a projection given the KWL.
+//! Returns TRUE if no error encountered.
+//*****************************************************************************
+bool ossimImageGeometry::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if (lookup)
+   {
+      if ( ossimString(lookup) == STATIC_TYPE_NAME(ossimImageGeometry) )
+      {
+         ossimObject::loadState(kwl, prefix);
+
+         // m_transform
+         ossimString transformPrefix = ossimString(prefix) + "transform.";
+         ossimRefPtr<ossim2dTo2dTransform> transform = ossim2dTo2dTransformRegistry::instance()->
+            createNativeObjectFromRegistry(kwl, transformPrefix.c_str());
+         if( transform.valid() )
+         {
+            m_transform = transform;
+         }
+
+         // m_projection:
+         ossimString projectionPrefix = ossimString(prefix) + "projection.";
+         ossimRefPtr<ossimProjection> projection = ossimProjectionFactoryRegistry::instance()->
+            createProjection(kwl, projectionPrefix.c_str());
+         if( projection.valid() )
+         {
+            m_projection = projection;
+         }
+
+         // m_decimationFactors:
+         ossimString decimations = kwl.find(prefix, "decimations");
+         if( decimations.size() )
+         {
+            m_decimationFactors.clear();
+            ossim::toVector(m_decimationFactors, decimations);
+         }
+
+         // m_imageSize:
+         ossimString imageSize = kwl.find(prefix, "image_size");
+         if( imageSize.size() )
+         {
+            m_imageSize.toPoint(imageSize);
+         }
+
+         // m_targetRrds:
+         ossimString targetRrds = kwl.find(prefix, "target_rrds");
+         if ( targetRrds.size() )
+         {
+            m_targetRrds = ossimString(targetRrds).toUInt32();
+         }
+      }
+      else
+      {
+         // Now look for projection spec (for backwards compatibility):
+         ossimProjection* projection = ossimProjectionFactoryRegistry::instance()->
+            createProjection(kwl, prefix);
+         if (projection)
+         {
+            setProjection(projection);
+         }
+      }
+   }
+   else
+   {
+      //---
+      // Old geometry file with no type keyword:
+      //---
+      ossimProjection* projection = ossimProjectionFactoryRegistry::instance()->
+         createProjection(kwl, prefix);
+      if (projection)
+      {
+         setProjection(projection);
+      } 
+   }
+   
+   return true;
+}
+
+//**************************************************************************************************
+//! Saves the transform (if any) and projection (if any) states to the KWL.
+//**************************************************************************************************
+bool ossimImageGeometry::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   bool good_save = true;
+
+   // m_transform:
+   if (m_transform.valid())
+   {
+      ossimString transformPrefix = ossimString(prefix) + "transform.";
+      good_save = m_transform->saveState(kwl, transformPrefix.c_str());
+   }
+
+   // m_projection:
+   if (m_projection.valid())
+   {
+      ossimString projectionPrefix = ossimString(prefix) + "projection.";
+      good_save &= m_projection->saveState(kwl, projectionPrefix.c_str());
+   }
+
+   // m_gsd:
+   ossimDpt gsd;
+   getMetersPerPixel(gsd);
+   kwl.add(prefix, "gsd", gsd.toString(), true);
+
+   // m_decimationFactors:
+   if(m_decimationFactors.size())
+   {
+      ossimString resultPoints;
+      ossim::toStringList(resultPoints, m_decimationFactors);
+      kwl.add(prefix, "decimations", resultPoints, true);
+   }
+   else
+   {
+      kwl.add(prefix, "decimations", "", true);
+   }
+
+   // m_imageSize:
+   kwl.add(prefix, "image_size", m_imageSize.toString(), true);
+
+   // m_targetRrds;
+   kwl.add(prefix, "target_rrds", m_targetRrds, true);
+
+   // Base class:
+   good_save &= ossimObject::saveState(kwl, prefix);
+   
+   return good_save;
+}
+
+void ossimImageGeometry::setTargetRrds(ossim_uint32 rrds)
+{
+   m_targetRrds = rrds;
+}
+
+ossim_uint32 ossimImageGeometry::getTargetRrds() const
+{
+   return m_targetRrds;
+}
+
+//**************************************************************************************************
+//! Replaces any existing transform and projection with those in the copy_this object
+//**************************************************************************************************
+const ossimImageGeometry& ossimImageGeometry::operator=(const ossimImageGeometry& copy_this)
+{
+   if (this != &copy_this)
+   {
+      // Get deep copy of 2D transform if one exists:
+      if (copy_this.m_transform.valid())
+      {
+         m_transform = (ossim2dTo2dTransform*) copy_this.m_transform->dup();
+      }
+      
+      // Now establish a deep copy of the projection, if any:
+      if (copy_this.m_projection.valid())
+      {
+         m_projection = (ossimProjection*) copy_this.m_projection->dup();
+      }
+      
+      // the Gsd should already be solved from the source we are copying from
+      m_imageSize         = copy_this.m_imageSize;
+      m_decimationFactors = copy_this.m_decimationFactors;
+      m_targetRrds        = copy_this.m_targetRrds;
+   }
+   return *this;
+}
+
+//**************************************************************************************************
+//! Returns the ossimGpts for the four image corner points
+//**************************************************************************************************
+bool ossimImageGeometry::getCornerGpts(ossimGpt& gul, ossimGpt& gur, 
+                                       ossimGpt& glr, ossimGpt& gll) const
+{
+   ossimDpt iul (0,0);
+   ossimDpt iur (m_imageSize.x-1, 0);
+   ossimDpt ilr (m_imageSize.x-1, m_imageSize.y-1);
+   ossimDpt ill (0, m_imageSize.y-1);
+
+   bool status = true;
+
+   status &= localToWorld(iul, gul);
+   status &= localToWorld(iur, gur);
+   status &= localToWorld(ilr, glr);
+   status &= localToWorld(ill, gll);
+
+   return status;
+}
+
+void ossimImageGeometry::getTiePoint(ossimGpt& tie, bool edge) const
+{
+   ossimGrect grect;
+   getBoundingGroundRect(grect);
+   if ( m_projection.valid() && (m_imageSize.hasNans() == false) )
+   {
+      // Use the easting/northing version of this method if underlying projection is meters:
+      const ossimMapProjection* map_proj = 
+         dynamic_cast<const ossimMapProjection*>(m_projection.get());
+      if (map_proj)
+      {
+         if(!map_proj->isGeographic())
+         {
+            ossimDpt enTie;
+            getTiePoint(enTie, edge);
+            if (!enTie.hasNans())
+               tie = m_projection->inverse(enTie);
+            else
+               tie.makeNan();
+         }
+         else
+         {
+            tie = grect.ul();
+            if(edge)
+            {
+               ossimDpt half_pixel_shift =  map_proj->getDecimalDegreesPerPixel() * 0.5;
+               tie.lat += half_pixel_shift.y;
+               tie.lon -= half_pixel_shift.x;
+            }
+         }
+      }
+      else
+      {
+
+         // must be a sensor model so we will set to the upper left bounds of the image
+         tie = grect.ul();
+//         std::cout << "GRECT ======= " << grect << "\n";
+//         std::cout << m_projection->getClassName() << std::endl;
+//         ossimDpt pt = m_projection->forward( tie );
+//         std::cout << "FORWARD:" <<pt << std::endl;
+      }
+   }
+
+
+#if 0
+  // std::cout << "GRECT ======= " << grect << "\n";
+   if ( m_projection.valid() && (m_imageSize.hasNans() == false) )
+   {
+      // Use the easting/northing version of this method if underlying projection is meters:
+      const ossimMapProjection* map_proj = 
+         dynamic_cast<const ossimMapProjection*>(m_projection.get());
+      if (map_proj && !map_proj->isGeographic())
+      {
+         ossimDpt enTie;
+         getTiePoint(enTie, edge);
+         if (!enTie.hasNans())
+            tie = m_projection->inverse(enTie);
+         else
+            tie.makeNan();
+         return; // return here only because it bugs Dave
+      }
+
+      // Use projection to ground to establish UL extreme of image:
+      ossimDpt iul (0,0);
+      ossimDpt iur (m_imageSize.x-1, 0);
+      ossimDpt ilr (m_imageSize.x-1, m_imageSize.y-1);
+      ossimDpt ill (0, m_imageSize.y-1);
+      ossimDpt iRight(1, 0);
+      ossimDpt iDown(0, 1);
+      
+      ossimGpt gul;
+      ossimGpt gur; 
+      ossimGpt glr;
+      ossimGpt gll;
+      ossimGpt gRight;
+      ossimGpt gDown;
+      
+      localToWorld(iul, gul);
+      localToWorld(iur, gur);
+      localToWorld(ilr, glr);
+      localToWorld(ill, gll);
+      localToWorld(iRight, gRight);
+      localToWorld(iDown, gDown);
+      
+      std::cout << "gul: " << gul << "\n"
+                << "gur: " << gur << "\n"
+                << "glr: " << glr << "\n"
+                << "gll: " << gll << "\n"
+                << "gRight: " << gRight << "\n"
+                << "gDown:  " << gDown << "\n";
+      // Determine the direction of the image:
+      if ( gul.lat > gDown.lat ) // oriented north up
+      {
+         if ( gul.lat >= gRight.lat ) // straight up or leaning right
+         {
+            std::cout << "ONE\n";
+            tie.lat = gul.lat;
+            tie.lon = gll.lon;
+         }
+         else // leaning left
+         {
+            std::cout << "TWO\n";
+            tie.lat = gur.lat;
+            tie.lon = gul.lon;
+         }
+      }
+      else // south or on side
+      {
+         if ( gRight.lat >= gul.lat ) // straight down or leaning right
+         {
+            std::cout << "THREE\n";
+            tie.lat = glr.lat;
+            tie.lon = gur.lon;
+         }
+         else // leaning left
+         {
+            std::cout << "FOUR\n";
+            tie.lat = gll.lat;
+            tie.lon = glr.lon;
+         }   
+      }
+      std::cout << "TIE BEFORE ==== " << tie << "\n";
+
+      if ( edge )
+      {
+         ossimDpt pt = m_projection->forward( tie );
+         ossimDpt half_pixel_shift = m_projection->getMetersPerPixel() * 0.5;
+         pt.y += half_pixel_shift.y;
+         pt.x -= half_pixel_shift.x;
+         tie = m_projection->inverse( pt );
+      }
+      
+      std::cout << "TIE ==== " << tie << "\n";
+   } // if ( (m_imageSize.hasNans() == false) && m_projection.valid() )
+   else
+   { 
+      tie.lat = ossim::nan();
+      tie.lon = ossim::nan();
+   }
+#endif
+}
+
+//**************************************************************************************************
+// Assigns tie to the UL easting northing of the image. If edge is true, the E/N will be for the 
+// pixel-is-area representation
+//**************************************************************************************************
+void ossimImageGeometry::getTiePoint(ossimDpt& tie, bool edge) const
+{
+   if (!m_projection.valid() || m_imageSize.hasNans())
+   {
+      tie.makeNan();
+      return; // return here only because it bugs Dave
+   }
+
+   // Use the geographic version of this method if underlying projection is NOT map in meters:
+   const ossimMapProjection* map_proj = dynamic_cast<const ossimMapProjection*>(m_projection.get());
+   if (!map_proj || map_proj->isGeographic())
+   {
+      // Use the geographic version of this method to establish UL:
+      ossimGpt gTie;
+      gTie.hgt = 0.0;
+      getTiePoint(gTie, edge);
+      if (!gTie.hasNans())
+         tie = m_projection->forward( gTie );
+      else
+         tie.makeNan();
+      return; // return here only because it bugs Dave
+   }
+
+   // The underlying projection is a proper map projection in meters. Use easting northing 
+   // directly to avoid shifting the UL tiepoint because of skewed edge in geographic. Note:
+   // assume the image is North up:
+   ossimDpt iul (0,0);
+   ossimDpt ful;
+   rnToFull(iul, 0, ful);
+   map_proj->lineSampleToEastingNorthing(ful, tie);
+   if (edge && !tie.hasNans())
+   {
+      // Shift from pixel-is-point to pixel-is-area
+      ossimDpt half_pixel_shift = map_proj->getMetersPerPixel() * 0.5;
+      tie.y += half_pixel_shift.y;
+      tie.x -= half_pixel_shift.x;
+   }
+}
+
+//**************************************************************************************************
+void ossimImageGeometry::undecimatePoint(const ossimDpt& rnPt,
+                                         ossim_uint32 resolutionLevel,
+                                         ossimDpt& outPt) const
+{
+   // Back out the decimation.
+   ossimDpt decimation = decimationFactor(resolutionLevel);
+   
+   //---
+   // If no nans and one or both of the factors is not 1.0 decimation should
+   // be applied.
+   //---
+   if ( (decimation.x != 1.0) || (decimation.y != 1.0) ) 
+   {
+      if ( !decimation.hasNans() && !rnPt.hasNans() )
+      {
+         outPt.x = rnPt.x * (1.0/decimation.x);
+         outPt.y = rnPt.y * (1.0/decimation.y);
+      }
+      else
+      {
+         outPt.makeNan();
+      }
+   }
+   else
+   {
+      outPt = rnPt; // No decimation.
+   }
+}
+
+//**************************************************************************************************
+void ossimImageGeometry::decimatePoint(const ossimDpt& inPt,
+                                       ossim_uint32 resolutionLevel,
+                                       ossimDpt& rnPt) const
+{
+   
+   // Apply the decimation.
+   ossimDpt decimation = decimationFactor(resolutionLevel);
+
+   //---
+   // If no nans and one or both of the factors is not 1.0 decimation should
+   // be applied.
+   //---
+   if ( (decimation.x != 1.0) || (decimation.y != 1.0) ) 
+   {
+      if ( !decimation.hasNans() && !inPt.hasNans() )
+      {
+         rnPt.x = inPt.x * decimation.x;
+         rnPt.y = inPt.y * decimation.y;
+      }
+      else
+      {
+        rnPt.makeNan(); 
+      }
+   }
+   else
+   {
+      rnPt = inPt; // No decimation.
+   }
+}
+
+bool ossimImageGeometry::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
+{
+   bool result = ossimObject::isEqualTo(obj, compareType);
+   const ossimImageGeometry* rhs = dynamic_cast<const ossimImageGeometry*> (&obj);
+   if(rhs&&result) // we know the types are the same
+   {
+      result = ((m_decimationFactors.size() == rhs->m_decimationFactors.size())&&
+                m_imageSize.isEqualTo(rhs->m_imageSize)&& 
+                (m_targetRrds == rhs->m_targetRrds)); 
+      
+      if(result)
+      {
+         ossim_uint32 decimationIdx = 0;
+         for(decimationIdx = 0; result&&(decimationIdx < m_decimationFactors.size());++decimationIdx)
+         {
+            result = m_decimationFactors[decimationIdx].isEqualTo(rhs->m_decimationFactors[decimationIdx]);
+         }
+      }
+      
+      if(result && compareType==OSSIM_COMPARE_IMMEDIATE)
+      {
+         result = ((m_transform.get()  == rhs->m_transform.get())&& 
+                   (m_projection.get() == rhs->m_projection.get()));  //!< Maintains full_image-to-world_space transformation
+         
+      }
+      else
+      {
+         if(m_transform.valid()&&rhs->m_transform.valid())
+         {
+            result = m_transform->isEqualTo(*rhs->m_transform.get());
+         }
+         else if(reinterpret_cast<ossim_uint64>(m_transform.get()) | reinterpret_cast<ossim_uint64>(rhs->m_transform.get())) // one is null
+         {
+            result = false;
+         }
+         if(m_projection.valid()&&rhs->m_projection.valid())
+         {
+            result = m_projection->isEqualTo(*rhs->m_projection.get());
+         }
+         else if(reinterpret_cast<ossim_uint64>(m_projection.get()) | reinterpret_cast<ossim_uint64>(rhs->m_projection.get())) // one is null
+         {
+            result = false;
+         }
+         
+      }
+   }
+   return result;
+}
+
+bool ossimImageGeometry::getCrossesDateline()const
+{
+   bool result = false;
+   ossimIrect rect;
+   ossimGpt ul;
+   ossimGpt ur;
+   ossimGpt lr;
+   ossimGpt ll;
+   ossimGpt center;
+   ossimGpt wgs84;
+
+   getBoundingRect(rect);
+
+   localToWorld(rect.ul(), ul);
+   localToWorld(rect.ur(), ur);
+   localToWorld(rect.lr(), lr);
+   localToWorld(rect.ll(), ll);
+   localToWorld(rect.midPoint(), center);
+
+   if(ul.isLonNan()||ur.isLonNan()||lr.isLonNan()||ll.isLonNan()||center.isLonNan())
+   {
+      return result;
+   }
+   else
+   {
+      ul.changeDatum(wgs84.datum());
+      ur.changeDatum(wgs84.datum());
+      lr.changeDatum(wgs84.datum());
+      ll.changeDatum(wgs84.datum());
+      center.changeDatum(wgs84.datum());
+      result = ( (fabs(center.lond()-ul.lond()) > 180.0) ||
+                 (fabs(center.lond()-ur.lond()) > 180.0) ||
+                 (fabs(center.lond()-lr.lond()) > 180.0) ||
+                 (fabs(center.lond()-ll.lond()) > 180.0) ||
+                 (fabs(ul.lond()) > 180.0) ||
+                 (fabs(ur.lond()) > 180.0) ||
+                 (fabs(lr.lond()) > 180.0) ||
+                 (fabs(ll.lond()) > 180.0)
+
+                 );
+   }
+
+   return result; 
+}
+
+void ossimImageGeometry::getImageEdgePoints(std::vector<ossimDpt>& result, ossim_uint32 partitions)const
+{
+
+   ossimDrect imageRect;
+   getBoundingRect(imageRect);
+   if(imageRect.hasNans())
+   {
+      // error out
+      return;
+   }
+   result.clear();
+   // First get the image points we will be transforming
+   if(partitions > 2)
+   {
+      ossimDpt uli = imageRect.ul();
+      ossimDpt uri = imageRect.ur();
+      ossimDpt lri = imageRect.lr();
+      ossimDpt lli = imageRect.ll();
+
+      ossim_float32 stepSize = partitions;
+      ossimDpt deltaUpper = (uri-uli)*(1.0/stepSize);
+      ossimDpt deltaRight = (lri-uri)*(1.0/stepSize);
+      ossimDpt deltaLower = (lli-lri)*(1.0/stepSize);
+      ossimDpt deltaLeft  = (uli-lli)*(1.0/stepSize);
+
+      ossimDpt p;
+      ossim_int32 idx = 0;
+      ossimDpt initialPoint= uli;
+      for(idx = 0; idx < stepSize;++idx)
+      {
+         result.push_back(initialPoint);
+         initialPoint.x+=deltaUpper.x;
+         initialPoint.y+=deltaUpper.y;
+      }
+      initialPoint= uri;
+      for(idx = 0; idx < stepSize;++idx)
+      {
+         result.push_back(initialPoint);
+         initialPoint.x+=deltaRight.x;
+         initialPoint.y+=deltaRight.y;
+      }
+
+      initialPoint= lri;
+      for(idx = 0; idx < stepSize;++idx)
+      {
+         result.push_back(initialPoint);
+         initialPoint.x+=deltaLower.x;
+         initialPoint.y+=deltaLower.y;
+      }
+
+      initialPoint= lli;
+      for(idx = 0; idx < stepSize;++idx)
+      {
+         result.push_back(initialPoint);
+         initialPoint.x+=deltaLeft.x;
+         initialPoint.y+=deltaLeft.y;
+      }
+   }
+   else // If not enough partitions then we will just use the corners
+   {
+      result.resize(4);
+
+      result[0] = imageRect.ul();
+      result[1] = imageRect.ur();
+      result[2] = imageRect.lr();
+      result[3] = imageRect.ll();
+   }   
+
+}
+
+void ossimImageGeometry::calculatePolyBounds(ossimPolyArea2d& result, ossim_uint32 partitions)const
+{
+   std::vector<ossimDpt> points;
+   std::vector<ossimGpt> gPoints;
+   std::vector<ossimPolygon> polyList;
+   ossimDrect imageRect;
+   ossimGpt cg;
+   ossimDrect worldRect(ossimDpt(-180,-90),
+                        ossimDpt(-180,90),
+                        ossimDpt(180,90),
+                        ossimDpt(180,-90));
+   getBoundingRect(imageRect);
+   bool affectedByElevation = isAffectedByElevation();
+   bool crossesDateline     = getCrossesDateline();
+   result.clear();
+   if(imageRect.hasNans())
+   {
+      // error out
+      return;
+   }
+   localToWorld(imageRect.midPoint(), cg);
+   if(cg.isLatNan() || cg.isLonNan())
+   {
+      return;
+   }
+   ossim_int32 sgn = static_cast<ossim_int32>(
+                                ossim::sgn(cg.lond()));
+
+   getImageEdgePoints(points, partitions);
+   if(points.empty())
+   {
+      return;
+   }
+
+   if(crossesDateline)
+   {
+      for(std::vector<ossimDpt>::const_iterator iter=points.begin(); 
+          iter != points.end();
+          ++iter)
+      {
+         ossimGpt testGpt;
+         localToWorld(*iter, testGpt); 
+
+         if(!testGpt.isLatNan()&&!testGpt.isLonNan())
+         {
+            bool needToShift =( (std::fabs(testGpt.lond()-cg.lond()) > 180.0)||
+                                (std::fabs(testGpt.lond()>180.0)) ); 
+            if(needToShift)
+            {
+               testGpt.lond(testGpt.lond()+sgn*360);
+            }
+            gPoints.push_back(testGpt);        
+         }
+      }
+      // now clip the ground list to the full ground rect
+      //
+      ossimPolygon tempPoly(gPoints);
+      tempPoly.clipToRect(polyList, worldRect);
+      for(std::vector<ossimPolygon>::const_iterator iter = polyList.begin();
+         iter!=polyList.end();++iter)
+      {
+         result.add(ossimPolyArea2d(*iter));
+      }
+      // now shift gpoints to the other side
+      //
+      for(std::vector<ossimGpt>::iterator iter = gPoints.begin();
+          iter != gPoints.end();
+          ++iter)
+      {
+        (*iter).lond((*iter).lond()+(-sgn*360));
+      }
+      tempPoly = gPoints;
+      polyList.clear();
+      tempPoly.clipToRect(polyList, worldRect);
+      for(std::vector<ossimPolygon>::const_iterator iter = polyList.begin();
+         iter!=polyList.end();++iter)
+      {
+         result.add(ossimPolyArea2d(*iter));
+      }
+   }
+   else
+   {
+      ossim_uint32 idx=0;
+      for(std::vector<ossimDpt>::const_iterator iter=points.begin(); 
+          iter != points.end();++iter)
+      {
+         ossimGpt testGpt;
+         localToWorld(*iter, testGpt); 
+
+         if(!testGpt.isLatNan()&&!testGpt.isLonNan())
+         {
+            gPoints.push_back(testGpt);        
+         }
+      }
+      result.add(ossimPolygon(gPoints));
+   }
+   if(!result.isValid()) result.setToBufferedShape();
+}
+
+
+void ossimImageGeometry::getBoundingRect(ossimIrect& bounding_rect) const
+{
+   if (m_imageSize.hasNans())
+   {
+      bounding_rect.makeNan();
+   }
+   else
+   {
+      bounding_rect.set_ulx(0);
+      bounding_rect.set_uly(0);
+      bounding_rect.set_lrx(m_imageSize.x-1);
+      bounding_rect.set_lry(m_imageSize.y-1);
+   }
+}
+
+void ossimImageGeometry::getBoundingRect(ossimDrect& bounding_rect) const
+{
+   if (m_imageSize.hasNans())
+   {
+      bounding_rect.makeNan();
+   }
+   else
+   {
+      bounding_rect.set_ulx(0);
+      bounding_rect.set_uly(0);
+      bounding_rect.set_lrx(m_imageSize.x-1);
+      bounding_rect.set_lry(m_imageSize.y-1);
+   }
+}
+
+void ossimImageGeometry::getBoundingGroundRect(ossimGrect& bounding_grect) const
+{
+   ossimGpt ul, ur, lr, ll;
+   getCornerGpts(ul, ur, lr, ll);
+   bounding_grect.ul().lat = ul.lat > ur.lat ? ul.lat : ur.lat;
+   bounding_grect.ul().lon = ul.lon < ll.lon ? ul.lon : ll.lon;
+   bounding_grect.lr().lat = ll.lat < lr.lat ? ll.lat : lr.lat;
+   bounding_grect.lr().lon = ur.lon > lr.lon ? ur.lon : lr.lon;
+}
+
+void ossimImageGeometry::applyScale(const ossimDpt& scale, bool recenterTiePoint)
+{
+   if ((scale.x != 0.0) && (scale.y != 0.0))
+   {
+      ossimMapProjection* map_Proj = dynamic_cast<ossimMapProjection*>(m_projection.get());
+      if ( map_Proj )
+      {
+         m_imageSize.x = ossim::round<ossim_int32>(m_imageSize.x / scale.x);
+         m_imageSize.y = ossim::round<ossim_int32>(m_imageSize.y / scale.y);
+         map_Proj->applyScale(scale, recenterTiePoint);
+      }
+   }
+}
+
+ossimAdjustableParameterInterface* ossimImageGeometry::getAdjustableParameterInterface()
+{
+   return PTR_CAST(ossimAdjustableParameterInterface, getProjection());
+}
+
+const ossimAdjustableParameterInterface* ossimImageGeometry::getAdjustableParameterInterface()const
+{
+   return dynamic_cast<const ossimAdjustableParameterInterface*>(getProjection());
+
+}
+
+bool ossimImageGeometry::computeImageToGroundPartialsWRTAdjParam(ossimDpt& result,
+                                                                           const ossimGpt& gpt,
+                                                                           ossim_uint32 idx,
+                                                                           ossim_float64 paramDelta)
+{
+   double den = 0.5/paramDelta; // this is the same as dividing by 2*delta
+   
+   result = ossimDpt(0.0,0.0);
+   ossimAdjustableParameterInterface* adjustableParamInterface = getAdjustableParameterInterface();
+   
+   if(!adjustableParamInterface) return false;
+   if(idx >= adjustableParamInterface->getNumberOfAdjustableParameters()) return false;
+   
+   ossimDpt p1, p2;
+   // double middle = adjustableParamInterface->getAdjustableParameter(idx);
+   double middle = adjustableParamInterface->getParameterCenter(idx);
+   
+   //set parm to high value
+   // adjustableParamInterface->setAdjustableParameter(idx, middle + paramDelta, true);
+   adjustableParamInterface->setParameterCenter(idx, middle + paramDelta, true);
+   worldToLocal(gpt, p1);
+   
+   //set parm to low value and gte difference
+   // adjustableParamInterface->setAdjustableParameter(idx, middle - paramDelta, true);
+   adjustableParamInterface->setParameterCenter(idx, middle - paramDelta, true);
+   worldToLocal(gpt, p2);
+   
+   //get partial derivative
+   result = (p2-p1)*den;
+   
+   //reset param
+   // adjustableParamInterface->setAdjustableParameter(idx, middle, true);
+   adjustableParamInterface->setParameterCenter(idx, middle, true);
+   
+   return !result.hasNans();
+}
+                         
+bool ossimImageGeometry::computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result, 
+                                                                            const ossimGpt& gpt,
+                                                                            ossim_float64 paramDelta)
+{
+   ossimAdjustableParameterInterface* adjustableParamInterface = getAdjustableParameterInterface();
+   
+   ossim_uint32 nAdjustables = adjustableParamInterface->getNumberOfAdjustableParameters();
+   
+   ossim_uint32 idx = 0;
+   
+   result = NEWMAT::Matrix(nAdjustables, 2);
+   for(;idx < nAdjustables; ++idx)
+   {
+      ossimDpt paramResResult;
+      computeImageToGroundPartialsWRTAdjParam(paramResResult,
+                                                        gpt,
+                                                        idx,
+                                                        paramDelta);
+      result[idx][0] = paramResResult.x;
+      result[idx][1] = paramResResult.y;
+   }
+   
+   return true;
+}
+
+bool ossimImageGeometry::computeImageToGroundPartialsWRTAdjParams(NEWMAT::Matrix& result,
+                                                                            const ossimGpt& gpt,
+                                                                            const DeltaParamList& deltas)
+{
+   
+   ossimAdjustableParameterInterface* adjustableParamInterface = getAdjustableParameterInterface();
+   
+   ossim_uint32 nAdjustables = adjustableParamInterface->getNumberOfAdjustableParameters();
+   
+   if(nAdjustables != deltas.size()) return false;
+   ossim_uint32 idx = 0;
+   
+   result = NEWMAT::Matrix(nAdjustables, 2);
+   for(;idx < nAdjustables; ++idx)
+   {
+      ossimDpt paramResResult;
+      computeImageToGroundPartialsWRTAdjParam(paramResResult,
+                                                        gpt,
+                                                        idx,
+                                                        deltas[idx]);
+      // ROWxCOL
+      result[idx][0] = paramResResult.x;
+      result[idx][1] = paramResResult.y;
+   }
+   
+   return true;
+}
+
+bool ossimImageGeometry::computeGroundToImagePartials(NEWMAT::Matrix& result,
+                                                      const ossimGpt& gpt,
+                                                      const ossimDpt3d& deltaLlh)
+{
+   if(!getProjection()) return false;
+   ossimDpt p1;
+   ossimDpt p2;
+   
+   ossimDpt deltaWithRespectToLon;
+   ossimDpt deltaWithRespectToLat;
+   ossimDpt deltaWithRespectToH;
+   ossim_float64 h = ossim::isnan(gpt.height())?0.0:gpt.height();
+
+   // do the change in lon first for the dx, dy
+   //
+   worldToLocal(ossimGpt(gpt.latd(), gpt.lond()+deltaLlh.x, h, gpt.datum()), p1);
+   worldToLocal(ossimGpt(gpt.latd(), gpt.lond()-deltaLlh.x, h, gpt.datum()), p2);
+   
+   double den = 0.5/deltaLlh.x; // this is the same as dividing by 2*delta
+   deltaWithRespectToLon = (p2-p1)*den;
+   
+    
+   // do the change in lat for the dx, dy
+   //
+   worldToLocal(ossimGpt(gpt.latd()+deltaLlh.y, gpt.lond(), h, gpt.datum()), p1);
+   worldToLocal(ossimGpt(gpt.latd()-deltaLlh.y, gpt.lond(), h, gpt.datum()), p2);
+   
+   den = 0.5/deltaLlh.y; // this is the same as dividing by 2*delta
+   deltaWithRespectToLat = (p2-p1)*den;
+
+   
+   // do the change in height first for the dx, dy
+   //
+   worldToLocal(ossimGpt(gpt.latd(), gpt.lond(), h+deltaLlh.z, gpt.datum()), p1);
+   worldToLocal(ossimGpt(gpt.latd(), gpt.lond(), h-deltaLlh.z, gpt.datum()), p2);
+   
+   den = 0.5/deltaLlh.z; // this is the same as dividing by 2*delta
+   deltaWithRespectToH = (p2-p1)*den;
+   
+   
+   result = NEWMAT::Matrix(3,2);
+   
+   // set the matrix
+   //
+   result[1][0] = deltaWithRespectToLon.x*DEG_PER_RAD; 
+   result[1][1] = deltaWithRespectToLon.y*DEG_PER_RAD; 
+   result[0][0] = deltaWithRespectToLat.x*DEG_PER_RAD; 
+   result[0][1] = deltaWithRespectToLat.y*DEG_PER_RAD; 
+   result[2][0] = deltaWithRespectToH.x; 
+   result[2][1] = deltaWithRespectToH.y; 
+   
+   
+   return true; 
+}
+
+bool ossimImageGeometry::computeGroundToImagePartials(NEWMAT::Matrix& result,
+                                                      const ossimGpt& gpt)
+{
+   ossimDpt mpp = getMetersPerPixel();
+   ossimGpt originPoint;
+   ossim_float64 len = mpp.length();
+   
+   if(len > FLT_EPSILON)
+   {
+      ossim_float64 delta = originPoint.metersPerDegree().length();
+   
+      delta = len/delta;
+      
+      return computeGroundToImagePartials(result, 
+                                          gpt, 
+                                          ossimDpt3d(delta,
+                                                     delta,
+                                                     len));
+   }
+   
+   return false;
+}
+
+ossim_float64 ossimImageGeometry::upIsUpAngle() const
+{
+   ossim_float64 result = ossim::nan();
+
+   if ( m_projection.valid() )
+   {
+      if ( m_projection->isAffectedByElevation() )
+      {
+         const int NUMBER_OF_SAMPLES = 9;
+         
+         // In meters.  This is about a height of a 6 to 7 story building.
+         const double ELEVATION_DISPLACEMENT = 20;
+         
+         ossimDrect bounds;
+         getBoundingRect( bounds );
+         
+         if( !bounds.hasNans() )
+         {
+            ossim_float64 widthPercent  = bounds.width()*.1;
+            ossim_float64 heightPercent = bounds.height()*.1;
+            
+            //---
+            // Sanity check to make sure that taking 10 percent out on the image
+            // gets us to at least 1 pixel away.
+            //---
+            if(widthPercent < 1.0) widthPercent = 1.0;
+            if(heightPercent < 1.0) heightPercent = 1.0;
+            
+            // set up some work variables to help calculate the average partial
+            //
+            std::vector<ossimDpt> ipts(NUMBER_OF_SAMPLES);
+            std::vector<ossimGpt> gpts(NUMBER_OF_SAMPLES);
+            std::vector<ossimDpt> iptsDisplacement(NUMBER_OF_SAMPLES);
+            std::vector<ossimDpt> partials(NUMBER_OF_SAMPLES);
+            ossimDpt averageDelta(0.0,0.0);
+            
+            ossimDpt centerIpt = bounds.midPoint();
+            
+            //---
+            // Lets take an average displacement about the center point (3x3 grid)
+            // we will go 10 percent out of the width and height of the image and
+            // look at the displacement at those points and average them we will
+            // use the average displacement to compute the up is up rotation.
+            //---
+            
+            // top row:
+
+            // 45 degree left quadrant
+            // RP - FIX POINTS IN FIRST ROW
+            ipts[0] = centerIpt + ossimDpt(-widthPercent, -heightPercent);
+            // 45 degree middle top 
+            ipts[1] = centerIpt + ossimDpt(0.0,heightPercent);
+            // 45 degree right quadrant
+            ipts[2] = centerIpt + ossimDpt(widthPercent, -heightPercent);
+            
+            // middle row
+            ipts[3] = centerIpt + ossimDpt(-widthPercent, 0.0); // left middle
+            ipts[4] = centerIpt;
+            ipts[5] = centerIpt + ossimDpt(widthPercent, 0.0);
+            
+            // bottom row
+            ipts[6] = centerIpt + ossimDpt(-widthPercent, heightPercent);
+            ipts[7] = centerIpt + ossimDpt(0.0, heightPercent);
+            ipts[8] = centerIpt + ossimDpt(widthPercent, heightPercent);
+            
+            ossim_uint32 idx = 0;
+            for(idx = 0; idx < ipts.size(); ++idx)
+            {
+               double h = 0.0;
+               localToWorld(ipts[idx], gpts[idx]);
+               h = gpts[idx].height();
+               if(ossim::isnan(h)) h = 0.0;
+               gpts[idx].height(h + ELEVATION_DISPLACEMENT);
+               worldToLocal(gpts[idx], iptsDisplacement[idx]);
+               averageDelta = averageDelta + (iptsDisplacement[idx] - ipts[idx]);
+            }
+            
+            ossim_float64 averageLength = averageDelta.length();
+            if(averageLength < 1) return false;
+            
+            if(!ossim::almostEqual((double)0.0, (double)averageLength))
+            {
+               averageDelta = averageDelta/averageLength;
+            }
+            // RP - the rest of this calculation seems to be leading to less accurate results.  
+            // We already have the average image space displacement from raising the height for 9 points in the image 
+            // Just rotate based on this displacement, 
+            // scaling based on the image size distorts the direction of the up vector, leading to inaccurate results for non-square images
+            //
+            //ossimDpt averageLocation =  (ossimDpt(averageDelta.x*bounds.width(), 
+            //                                      averageDelta.y*bounds.height())+centerIpt) ;
+            //ossimGpt averageLocationGpt;
+            //ossimGpt centerGpt;
+            
+            //localToWorld(averageLocation, averageLocationGpt);
+            //localToWorld(ipts[0], centerGpt);
+            
+            ossimDpt deltaPt = averageDelta; //averageLocation - centerIpt; 
+            ossimDpt deltaUnitPt = deltaPt;
+            double len = deltaPt.length();
+            if(len > FLT_EPSILON)
+            {
+               deltaUnitPt  = deltaUnitPt/len;
+            }
+            
+            // Image space model positive y is down.  Let's reflect to positve y up.
+            deltaUnitPt.y *= -1.0; // Reflect y to be right handed.
+            
+            result = ossim::atan2d(deltaUnitPt.x, deltaUnitPt.y);
+            
+            //---
+            // We are essentially simulating camera rotation so negate the rotation
+            // value.
+            //---
+            result *= -1;
+            
+            if(result < 0) result += 360.0;
+            
+         }  // Matches: if( bounds.hasNans() == false )
+      }
+      else
+      {
+         result = 0;
+      }
+      
+   } // Matches: if ( m_projection.valid() && m_projection->isAffectedByElevation() )
+
+   return result;
+   
+} // End: ossimImageGeometry::upIsUpAngle()
+
+ossim_float64 ossimImageGeometry::northUpAngle()const
+{
+   ossim_float64 result = ossim::nan();
+
+   if ( m_projection.valid() )
+   {
+      ossimDrect bounds;
+      getBoundingRect( bounds );
+      
+      if( !bounds.hasNans() )
+      {
+         ossimDpt centerIpt = bounds.midPoint();
+
+         ossimDpt midBottomIpt( centerIpt.x, bounds.lr().y );
+         ossimDpt midTopIpt( centerIpt.x, bounds.ul().y );
+
+         ossimGpt midBottomGpt;
+         ossimGpt midTopGpt;
+         
+         localToWorld( midBottomIpt, midBottomGpt );
+         localToWorld( midTopIpt, midTopGpt );
+
+         if ( !midBottomGpt.hasNans() && !midTopGpt.hasNans() )
+         {
+            result = midBottomGpt.azimuthTo( midTopGpt );
+
+            if(result < 0) result += 360.0;
+         }
+      }
+      
+   } // Matches: if ( m_projection.valid() )
+
+   return result;
+   
+} // End: ossimImageGeometry::northUpAngle()
diff --git a/src/imaging/ossimImageGeometryFactory.cpp b/src/imaging/ossimImageGeometryFactory.cpp
new file mode 100644
index 0000000..d7351da
--- /dev/null
+++ b/src/imaging/ossimImageGeometryFactory.cpp
@@ -0,0 +1,227 @@
+//*****************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class implementation of ossimImageGeometryFactory.
+// See .h file for class documentation.
+//
+//*****************************************************************************
+// $Id$
+#include <ossim/imaging/ossimImageGeometryFactory.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossim2dTo2dShiftTransform.h>
+#include <ossim/imaging/ossimNitfTileSource.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/support_data/ossimNitfIchipbTag.h>
+#include <ossim/support_data/ossimNitfStdidcTag.h>
+#include <ossim/projection/ossimSensorModel.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossim2dTo2dTransformRegistry.h>
+
+ossimImageGeometryFactory* ossimImageGeometryFactory::m_instance = 0;
+
+ossimImageGeometryFactory::ossimImageGeometryFactory()
+{
+   m_instance = this;
+}
+
+ossimImageGeometryFactory* ossimImageGeometryFactory::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossimImageGeometryFactory();
+   }
+   
+   return m_instance;
+}
+
+ossimImageGeometry* ossimImageGeometryFactory::createGeometry(
+   const ossimString& typeName)const
+{
+   if(typeName == "ossimImageGeometry")
+   {
+      return new ossimImageGeometry();
+   }
+   
+   return 0;
+}
+
+ossimImageGeometry* ossimImageGeometryFactory::createGeometry(
+   const ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimRefPtr<ossimImageGeometry> result = 0;
+   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if(!type.empty())
+   {
+      result = createGeometry(type);
+      if(result.valid()&&!result->loadState(kwl, prefix))
+      {
+         result = 0;
+      }
+   }
+   
+   return result.release();
+}
+
+ossimImageGeometry* ossimImageGeometryFactory::createGeometry(
+   const ossimFilename& /* filename */, ossim_uint32 /* entryIdx */)const
+{
+   // currently don't support this option just yet by this factory
+   return 0;
+}
+
+bool ossimImageGeometryFactory::extendGeometry(ossimImageHandler* handler)const
+{
+   bool result = false;
+   if (handler)
+   {
+      bool add2D = true;
+      ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+      if(geom.valid())
+      {
+         if(!geom->getProjection())
+         {
+            geom->setProjection(createProjection(handler));
+            result = geom->hasProjection();
+         }
+         if(geom->getProjection())
+         {
+            if( !(dynamic_cast<ossimSensorModel*>(geom->getProjection())))
+            {
+               add2D = false;
+            }
+         }
+         if(!geom->getTransform()&&add2D)
+         {
+            geom->setTransform(createTransform(handler));
+            result |= geom->hasTransform();
+        }
+      }
+   }
+   return result;
+}
+
+void ossimImageGeometryFactory::getTypeNameList(
+   std::vector<ossimString>& typeList)const
+{
+   typeList.push_back("ossimImageGeometry");
+}
+
+ossim2dTo2dTransform* ossimImageGeometryFactory::createTransform(
+   ossimImageHandler* handler)const
+{
+   // Currently nothing to do...
+   
+   ossimRefPtr<ossim2dTo2dTransform> result = 0;
+   
+   ossimNitfTileSource* nitf = dynamic_cast<ossimNitfTileSource*> (handler);
+   
+   if(nitf)
+   {
+      result = createTransformFromNitf(nitf);
+   }
+   
+   return result.release();
+}
+
+ossimProjection* ossimImageGeometryFactory::createProjection(
+   ossimImageHandler* handler) const
+{
+   ossimRefPtr<ossimProjection> result =
+      ossimProjectionFactoryRegistry::instance()->createProjection(handler);
+
+   return result.release();
+}
+
+ossim2dTo2dTransform* ossimImageGeometryFactory::createTransformFromNitf(ossimNitfTileSource* nitf)const
+{
+   ossim2dTo2dTransform* result = 0;
+   
+   ossimRefPtr<ossimNitfImageHeader> hdr = nitf->getCurrentImageHeader();
+   if (!hdr)
+   {
+      return result;
+   }
+   
+   //---
+   // Test for the ichipb tag and set the sub image if needed.
+   // 
+   // NOTE # 1:
+   // 
+   // There are nitf writers that set the ichipb offsets and only have
+   // IGEOLO field present.  For these it has been determined
+   // (but still in question) that we should not apply the sub image offset.
+   //
+   // See trac # 1578
+   // http://trac.osgeo.org/ossim/ticket/1578
+   //
+   // NOTE # 2:
+   //
+   // Let the ICHIPB have precedence over the STDIDC tag as we could have a
+   // chip of a segment.
+   //---
+   ossimRefPtr<ossimNitfRegisteredTag> tag =
+   hdr->getTagData(ossimString("ICHIPB"));
+   if (tag.valid())
+   {
+      ossimNitfIchipbTag* ichipb = PTR_CAST(ossimNitfIchipbTag, tag.get());
+      if (ichipb)
+      {
+//         const ossimRefPtr<ossimNitfRegisteredTag> blocka =
+//         hdr->getTagData(ossimString("BLOCKA"));
+//         const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
+//         hdr->getTagData(ossimString("RPC00A"));              
+//         const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
+//         hdr->getTagData(ossimString("RPC00B"));
+         
+         //---
+         // If any of these tags are present we will use the sub image from
+         // the ichipb tag.
+         //---
+//         if ( blocka.get() || rpc00a.get() || rpc00b.get() )
+         
+         // ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE.  GO AHEAD AND ALWAYS INIT THE SHIFT
+         {
+            result = ichipb->newTransform();
+         }
+      }
+   }
+   
+   if ( !result)
+   {
+      //---
+      // Look for the STDIDC tag for a sub image (segment) offset.
+      //
+      // See: STDI-002 Table 7.3 for documentation.
+      //---
+      tag = hdr->getTagData(ossimString("STDIDC"));
+      if (tag.valid() && (hdr->getIMode() == "B") )
+      {
+         ossimDpt shift;
+         ossimNitfStdidcTag* stdidc = PTR_CAST(ossimNitfStdidcTag, tag.get());
+         if (stdidc)
+         {
+            ossim_int32 startCol = stdidc->getStartColumn().toInt32();
+            ossim_int32 startRow = stdidc->getStartRow().toInt32();
+            if ( (startCol > 0) && (startRow > 0) )
+            {
+               
+               // field are one based; hence, the - 1.
+               shift.x = (startCol-1) * hdr->getNumberOfPixelsPerBlockHoriz();
+               shift.y = (startRow-1) * hdr->getNumberOfPixelsPerBlockVert();
+            }
+            if(shift.x > 0 ||
+               shift.y > 0)
+            {
+               result = new ossim2dTo2dShiftTransform(shift);
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
diff --git a/src/imaging/ossimImageGeometryRegistry.cpp b/src/imaging/ossimImageGeometryRegistry.cpp
new file mode 100644
index 0000000..19d8354
--- /dev/null
+++ b/src/imaging/ossimImageGeometryRegistry.cpp
@@ -0,0 +1,74 @@
+//**************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Class implementation of ossimImageGeometryRegistry. See .h file for class documentation.
+//
+//**************************************************************************************************
+// $Id$
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/imaging/ossimImageGeometryFactory.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+ossimImageGeometryRegistry* ossimImageGeometryRegistry::m_instance = 0;
+RTTI_DEF1(ossimImageGeometryRegistry, "ossimImageGeometryRegistry", ossimImageGeometryFactoryBase);
+ossimImageGeometryRegistry* ossimImageGeometryRegistry::instance()
+{
+   if(!m_instance)
+   {
+      m_instance = new ossimImageGeometryRegistry();
+      m_instance->registerFactory(ossimImageGeometryFactory::instance());
+      ossimObjectFactoryRegistry::instance()->registerFactory(m_instance);
+   }
+   
+   return m_instance;
+}
+
+bool ossimImageGeometryRegistry::extendGeometry(ossimImageHandler* handler)const
+{
+   bool result = false;
+   ossim_uint32 idx = 0;
+   for(;((idx < m_factoryList.size())&&!result); ++idx)
+   {
+      result = m_factoryList[idx]->extendGeometry(handler);
+   }
+   
+   return result;
+}
+
+ossimImageGeometry* ossimImageGeometryRegistry::createGeometry(const ossimString& typeName)const
+{
+   ossimRefPtr<ossimObject> obj = createObjectFromRegistry(typeName);
+   
+   ossimRefPtr<ossimImageGeometry> geomResult = dynamic_cast<ossimImageGeometry*>(obj.get());
+   
+   obj = 0;
+   
+   return geomResult.release();
+}
+
+ossimImageGeometry* ossimImageGeometryRegistry::createGeometry(const ossimKeywordlist& kwl,
+                                                               const char* prefix)const
+{
+   ossimRefPtr<ossimObject> obj = createObjectFromRegistry(kwl, prefix);
+   
+   ossimRefPtr<ossimImageGeometry> geomResult = dynamic_cast<ossimImageGeometry*>(obj.get());
+   
+   obj = 0;
+   
+   return geomResult.release();
+}
+
+ossimImageGeometry* ossimImageGeometryRegistry::createGeometry(const ossimFilename& filename,
+                                                                       ossim_uint32 entryIdx)const
+{
+   ossimImageGeometry* result = 0;
+   ossim_uint32 idx = 0;
+   for(;((idx < m_factoryList.size())&&!result); ++idx)
+   {
+      result = m_factoryList[idx]->createGeometry(filename, entryIdx);
+   }
+   
+   return result;
+}
diff --git a/src/imaging/ossimImageHandler.cpp b/src/imaging/ossimImageHandler.cpp
new file mode 100755
index 0000000..d117b39
--- /dev/null
+++ b/src/imaging/ossimImageHandler.cpp
@@ -0,0 +1,1807 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// This class defines an abstract image handler which all loaders should
+// derive from.
+//
+//*******************************************************************
+//  $Id: ossimImageHandler.cpp 23013 2014-12-02 19:21:56Z okramer $
+
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimContainerEvent.h>
+#include <ossim/base/ossimEventIds.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimTiffOverviewBuilder.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <algorithm>
+
+RTTI_DEF1(ossimImageHandler, "ossimImageHandler", ossimImageSource)
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimImageHandler:debug");
+
+// Property keywords.
+static const char HAS_LUT_KW[]                 = "has_lut";
+static const char OPEN_OVERVIEW_FLAG_KW[]      = "open_overview_flag";
+static const char START_RES_LEVEL_KW[]         = "start_res_level";
+static const char SUPPLEMENTARY_DIRECTORY_KW[] = "supplementary_directory";
+static const char VALID_VERTICES_FILE_KW[]     = "valid_vertices_file";
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimImageHandler.cpp 23013 2014-12-02 19:21:56Z okramer $";
+#endif
+
+// GARRETT! All of the decimation factors are scattered throughout. We want to fold that into 
+// the image geometry object. The code is ready in ossimImageGeometry for this (more or less), but
+// the ossimImageGeometry::m_decimationFactors is not being set nor referenced. Can you do this?
+// I'm a little foggy on how we want to incorporate R-level scaling into the geometry object.
+   
+ossimImageHandler::ossimImageHandler()
+:
+ossimImageSource(0, 0, 0, true, false /* output list is not fixed */ ),
+theImageFile(ossimFilename::NIL),
+theOverviewFile(ossimFilename::NIL),
+theSupplementaryDirectory(ossimFilename::NIL),
+theOverview(0),
+theValidImageVertices(0),
+theMetaData(),
+theGeometry(),
+theLut(0),
+theDecimationFactors(0),
+theImageID(""),
+theStartingResLevel(0),
+theOpenOverviewFlag(true),
+thePixelType(OSSIM_PIXEL_IS_POINT)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageHandler::ossimImageHandler() DEBUG:" << std::endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  "
+         << OSSIM_ID
+         << std::endl;
+#endif      
+   }
+
+   // Check for global preference supplementary dir.
+   theSupplementaryDirectory.string() = ossimPreferences::instance()->
+      preferencesKWL().findKey( std::string("ossim_supplementary_directory") );
+}
+
+ossimImageHandler::~ossimImageHandler()
+{
+   theOverview = 0;
+}
+
+void ossimImageHandler::initialize()
+{
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimImageHandler::saveState(ossimKeywordlist& kwl,
+                                  const char* prefix) const
+{
+   static const char MODULE[] = "ossimImageHandler::saveState";
+
+   ossimImageSource::saveState(kwl, prefix);
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " ERROR detected in keyword list!  State not saved."
+         << std::endl;
+      return false;
+   }
+
+   kwl.add(prefix, ossimKeywordNames::FILENAME_KW, theImageFile.c_str(), true);
+   kwl.add(prefix, HAS_LUT_KW, (theLut.valid()?"true":"false"), true);
+   kwl.add(prefix, ossimKeywordNames::IMAGE_ID_KW, theImageID, true);
+   kwl.add(prefix, ossimKeywordNames::OVERVIEW_FILE_KW, theOverviewFile.c_str(), true);
+   kwl.add(prefix, SUPPLEMENTARY_DIRECTORY_KW, theSupplementaryDirectory.c_str(), true);
+   kwl.add(prefix, START_RES_LEVEL_KW, theStartingResLevel, true);
+   kwl.add(prefix, OPEN_OVERVIEW_FLAG_KW, (theOpenOverviewFlag?"1":"0"), true);
+   kwl.add(prefix, ossimKeywordNames::PIXEL_TYPE_KW, (ossim_uint16) thePixelType, true);
+
+   return true;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimImageHandler::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix)
+{
+   static const char MODULE[] = "ossimImageHandler::loadState(kwl, prefix)";
+   theDecimationFactors.clear();
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: entered ..."
+         << std::endl;
+   }
+   
+   ossimImageSource::loadState(kwl, prefix);
+   
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << "WARNING: error detected in keyword list!  State not load."
+         << std::endl;
+      
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG: "
+            << "leaving with error in kwl ..." << std::endl;
+      }
+      return false;
+   }
+   
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   if (!lookup)
+   {
+      // Deprecated...
+      lookup = kwl.find(prefix, ossimKeywordNames::IMAGE_FILE_KW);
+   }
+   
+   if (lookup)
+   {
+      theImageFile = lookup;
+   }
+   
+   lookup = kwl.find(prefix, ossimKeywordNames::OVERVIEW_FILE_KW);
+   if(lookup)
+   {
+      theOverviewFile = ossimFilename(lookup);
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG:\n"
+         << "filename = " << theImageFile << std::endl;
+   }
+   
+   // Check for an external geometry file to initialize our image geometry object:
+   lookup = kwl.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
+   if (lookup)
+   {
+      ossimKeywordlist geomKwl;
+      if (geomKwl.addFile(lookup) == true)
+      {
+         theGeometry = new ossimImageGeometry;
+         theGeometry->loadState(geomKwl);
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << MODULE << " DEBUG:"
+               << "Loaded external geometry file:  "
+               << lookup
+               << "\n" << geomKwl << std::endl;
+         }
+      }
+   }
+   
+   // Check for an valid image vetices file.
+   lookup = kwl.find(prefix, VALID_VERTICES_FILE_KW);
+   if (lookup)
+   {
+      initVertices(lookup);
+   }
+
+   // Starting resolution level.
+   lookup = kwl.find(prefix, START_RES_LEVEL_KW);
+   if (lookup)
+   {
+      theStartingResLevel = ossimString(lookup).toUInt32();
+   }
+
+   // Open overview flag.
+   lookup = kwl.find(prefix, OPEN_OVERVIEW_FLAG_KW);
+   if (lookup)
+   {
+      setOpenOverviewFlag( ossimString(lookup).toBool() );
+   }
+
+   // The supplementary directory for finding the overview
+   lookup = kwl.find(prefix, SUPPLEMENTARY_DIRECTORY_KW);
+   if (lookup)
+   {
+      theSupplementaryDirectory = ossimFilename(lookup);
+   }
+
+   if(getNumberOfInputs())
+   {
+      theInputObjectList.clear();
+   }
+   theInputListIsFixedFlag = true;
+   
+   // Read image id if present:
+   theImageID = kwl.find(prefix, ossimKeywordNames::IMAGE_ID_KW);
+
+   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
+   if (lookup)
+   {
+      thePixelType = (ossimPixelType) atoi(lookup);
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: Leaving Ok ..."
+         << std::endl;
+   }
+   return true;
+}
+
+bool ossimImageHandler::initVertices(const char* file)
+{
+   static const char MODULE[] = "ossimImageHandler::initVertices";
+
+   ossimFilename f = file;
+   if (!f.exists()) return false;
+
+   ossimKeywordlist kwl(file);
+   
+   if (kwl.getErrorStatus() != ossimErrorCodes::OSSIM_OK)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimImageHandler::initVertices NOTICE:"
+            << "\nError reading valid vertice file:  " << file << std::endl;
+      }
+      return false;
+   }
+
+   // Clean out any old vertices...
+   theValidImageVertices.clear();
+
+   ossim_uint32 number_of_points = kwl.numberOf("point", "x");
+
+   for (ossim_uint32 i=0; i<number_of_points; ++i)
+   {
+      ossimIpt pt;
+      const char* lookup;
+      ossimString p = "point";
+      p += ossimString::toString(i);
+      
+      ossimString px = p + ".x";
+      lookup = kwl.find(px.c_str());
+      if (lookup)
+      {
+         pt.x = atoi(lookup);
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            CLOG << " ERROR:"
+                 << "\nlookup failed for:  " << px.c_str()
+                 << "\nReturning..."
+                 << std::endl;
+         }
+         return false;
+      }
+         
+      ossimString py = p + ".y";
+      lookup = kwl.find(py.c_str());
+      if (lookup)
+      {
+         pt.y = atoi(lookup);
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            CLOG << " ERROR:"
+                 << "\nLookup failed for:  " << py.c_str()
+                 << "\nReturning..."
+                 << std::endl;
+         }
+         return false;
+      }
+
+      theValidImageVertices.push_back(pt);
+   }
+
+   
+   if (traceDebug())
+   {
+      CLOG << " DEBUG:"
+           << "\nVertices file:  " << f
+           << "\nValid image vertices:"
+           << std::endl;
+      for (ossim_uint32 i=0; i<theValidImageVertices.size(); ++i)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "\npoint[" << i << "]:  " << theValidImageVertices[i];
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG) << std::endl;
+   }
+   
+   return true;
+}
+
+ossim_uint32 ossimImageHandler::getNumberOfDecimationLevels() const
+{
+   ossim_uint32 result = 1; // Add r0
+   if (theOverview.valid())
+   {
+      result += theOverview->getNumberOfDecimationLevels();
+   }
+   return result;
+}
+
+ossim_uint32 ossimImageHandler::getNumberOfReducedResSets() const
+{
+   return getNumberOfDecimationLevels();
+}
+
+ossimIrect ossimImageHandler::getImageRectangle(ossim_uint32 resLevel) const
+{
+   ossimIrect result;
+   
+   if( isOpen() && isValidRLevel(resLevel) )
+   {
+      ossim_int32 lines   = getNumberOfLines(resLevel);
+      ossim_int32 samples = getNumberOfSamples(resLevel);
+      if( !lines || !samples )
+      {
+         result.makeNan();
+      }
+      else
+      {
+         result = ossimIrect(0, 0, samples-1, lines-1);
+      }
+   }
+   else
+   {
+      result.makeNan();
+   }
+
+   return result;
+}
+
+ossimIrect ossimImageHandler::getBoundingRect(ossim_uint32 resLevel) const
+{
+   return getImageRectangle(resLevel);
+}
+
+
+void ossimImageHandler::getDecimationFactor(ossim_uint32 resLevel, ossimDpt& result) const
+{
+   if (resLevel < theDecimationFactors.size())
+      result = theDecimationFactors[resLevel];
+   else
+      result.makeNan();
+}
+
+void ossimImageHandler::getDecimationFactors(vector<ossimDpt>& decimations) const
+{
+   decimations = theDecimationFactors;
+}
+
+//*************************************************************************************************
+// Method determines the decimation factors at each resolution level. This
+// base class implementation computes the decimation by considering the ratios in image size
+// between resolution levels, with fuzzy logic for rounding ratios to the nearest power of 2
+// if possible. Derived classes need to override this method if the decimations are provided
+// as part of the image metadata. In some cases (cf. ossimNitfTileSource), the derived class can
+// set the first R-level (R0) decimation in the case that it is not unity, and then invoke this
+// base class implementation to compute remaining R-levels, respecting the R0 decimation previously
+// set by derived class.
+//*************************************************************************************************
+void ossimImageHandler::establishDecimationFactors() 
+{
+   double line_decimation, samp_decimation, decimation, ratio;
+   ossim_uint32 num_lines, num_samps;
+   
+   // The error margin here is effectively the percent error tolerated between ideal number of 
+   // pixels for given power-of-2 decimation, and the actual number of pixels found at this 
+   // decimation level. Typically, the last level will have fewer pixels than expected, hence the 
+   // need for this logic...
+   static const double ERROR_MARGIN = 1.1;  // 10% allowance
+
+   // NOTE -- Until the end of this method, all decimation values are actually inverse quantities,
+   // i.e., a decimation of 0.5 typical for rlevel 1 is represented here as 2. This facilitates the
+   // fuzzy logic for recognizing powers of 2 (as integers)
+
+   // Default implementation assumes R0 is not decimated. Check for R0 defined by derived class
+   // however, in case this is not the case:
+   ossimDpt decimation_r0 (1.0, 1.0);
+   if (theDecimationFactors.size() > 0)
+   {
+      decimation_r0.x = 1.0/theDecimationFactors[0].x; // note use of inverse decimation
+      decimation_r0.y = 1.0/theDecimationFactors[0].y; 
+   }
+   else
+      theDecimationFactors.push_back(decimation_r0);
+
+   // Variables used in loop below:
+   ossim_uint32 num_lines_r0 = getNumberOfLines(0);
+   ossim_uint32 num_samps_r0 = getNumberOfSamples(0);
+   ossim_uint32 power_of_2_decimation = (ossim_uint32) decimation_r0.x;
+
+   // Remaining res levels are computed as a ratio of image size at R0 to image size at Rn:
+   ossim_uint32 nRlevels = getNumberOfDecimationLevels();
+   for(ossim_uint32 res_level = 1; res_level < nRlevels; ++res_level)
+   {
+      num_lines = getNumberOfLines(res_level);
+      num_samps = getNumberOfSamples(res_level);
+      
+      if ((num_lines < 2) || (num_samps < 2)) 
+         break;
+
+      line_decimation = decimation_r0.y * num_lines_r0 / (double)num_lines;
+      samp_decimation = decimation_r0.x * num_samps_r0 / (double)num_samps;
+      decimation = line_decimation<samp_decimation ? line_decimation:samp_decimation;
+
+      // Check for possible error due to inexact ratios.
+      // Loop until reasonable effort was made to establish the corresponding power-of-2 decimation.
+      // If close match is found, the exact integer value is assigned:
+      do 
+      {
+         power_of_2_decimation *= 2;
+         ratio = (double)power_of_2_decimation / decimation;
+         if (ratio < 1.0)
+            ratio = 1.0/ratio;
+         if (ratio < ERROR_MARGIN)
+            decimation = (double) power_of_2_decimation;
+
+      } while ((double) power_of_2_decimation < decimation);
+
+      // Convert the computed decimation back to fractional form before saving in the factors list:
+      decimation = 1.0/decimation;
+      theDecimationFactors.push_back(ossimDpt(decimation, decimation));
+   }
+}
+
+bool ossimImageHandler::buildHistogram( int numberOfRLevels,
+                                        ossimHistogramMode mode )
+{
+   if(isOpen())
+   {
+      ossimFilename file =
+         getFilenameWithThisExtension(ossimString(".his"));
+      
+      ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
+      ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
+      
+      if(numberOfRLevels)
+      {
+         histoSource->setMaxNumberOfRLevels(numberOfRLevels);
+      }
+      else
+      {
+         histoSource->setMaxNumberOfRLevels(getNumberOfDecimationLevels());
+      }
+      
+      //---
+      // Note if mode==OSSIM_HISTO_MODE_UNKNOWN the histoSource defaults to
+      // normal mode.
+      //---
+      histoSource->setComputationMode( mode );
+
+      histoSource->connectMyInputTo(0, this);
+      histoSource->enableSource();
+      writer->connectMyInputTo(0, histoSource.get());
+      writer->setFilename(file);
+      writer->addListener(&theStdOutProgress);
+      writer->execute();
+      histoSource->disconnect();
+      writer->disconnect();
+      histoSource = 0;
+      writer = 0;
+   }
+   else
+   {
+      return false;
+   }
+   
+   return true;
+}
+
+bool ossimImageHandler::buildAllHistograms( int numberOfRLevels,
+                                            ossimHistogramMode mode )
+{
+   ossim_uint32 currentEntry = getCurrentEntry();
+   std::vector<ossim_uint32> entryList;
+   getEntryList(entryList);
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < entryList.size(); ++idx)
+   {
+      setCurrentEntry(entryList[idx]);
+      if(!buildHistogram( numberOfRLevels, mode ))
+      {
+         setCurrentEntry(currentEntry);
+         return false;
+      }
+   }
+   
+   setCurrentEntry(currentEntry);
+   return true;
+}
+
+bool ossimImageHandler::buildOverview(ossimImageHandlerOverviewCompressionType compressionType,
+                                      ossim_uint32 quality,
+                                      ossimFilterResampler::ossimFilterResamplerType resampleType,
+                                      bool includeFullResFlag)
+{
+   ossimFilename file = getFilenameWithThisExtension(ossimString(".ovr"));
+
+   theOverviewFile = file;
+   if(buildOverview(file, compressionType, quality, resampleType, includeFullResFlag))
+   {
+      openOverview();
+   }
+
+   return true;
+}
+
+bool ossimImageHandler::buildAllOverviews(ossimImageHandlerOverviewCompressionType compressionType,
+                                          ossim_uint32 quality,
+                                          ossimFilterResampler::ossimFilterResamplerType resampleType,
+                                          bool includeFullResFlag)
+{
+   ossim_uint32 currentEntry = getCurrentEntry();
+   std::vector<ossim_uint32> entryList;
+   getEntryList(entryList);
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < entryList.size(); ++idx)
+   {
+      setCurrentEntry(entryList[idx]);
+      if(!buildOverview(compressionType, quality, resampleType, includeFullResFlag))
+      {
+         setCurrentEntry(currentEntry);
+         return false;
+      }
+   }
+   
+   setCurrentEntry(currentEntry);
+   return true;
+}
+
+
+bool ossimImageHandler::buildOverview(const ossimFilename& filename,
+                                      ossimImageHandlerOverviewCompressionType compressionType,
+                                      ossim_uint32 quality,
+                                      ossimFilterResampler::ossimFilterResamplerType resampleType,
+                                      bool includeFullResFlag)
+{
+   closeOverview();
+   if(!isOpen())
+   {
+      return false;
+   }
+
+   theOverviewFile = filename;
+   ossimTiffOverviewBuilder tiffBuilder;
+   if ( tiffBuilder.setInputSource(this) == false )
+   {
+      return false;
+   }
+   
+   ossim_uint16 cType = COMPRESSION_NONE;
+   switch(compressionType)
+   {
+      case OSSIM_OVERVIEW_COMPRESSION_NONE:
+      {
+         cType = COMPRESSION_NONE;
+         break;
+      }
+      case OSSIM_OVERVIEW_COMPRESSION_JPEG:
+      {
+         cType = COMPRESSION_JPEG;
+         break;
+      }
+      case OSSIM_OVERVIEW_COMPRESSION_LZW:
+      {
+         cType = COMPRESSION_LZW;
+         break;
+      }
+      case OSSIM_OVERVIEW_COMPRESSION_DEFLATE:
+      {
+
+         cType = COMPRESSION_DEFLATE;
+         break;
+      }
+      case OSSIM_OVERVIEW_COMPRESSION_PACKBITS:
+      {
+         cType = COMPRESSION_PACKBITS;
+         break;
+      }
+   }
+   tiffBuilder.setJpegCompressionQuality(quality);
+   tiffBuilder.setCompressionType(cType);
+   tiffBuilder.setResampleType(resampleType);
+   tiffBuilder.buildOverview(filename, includeFullResFlag);
+
+   return true;
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimImageHandler::getImageHistogram() const
+{
+   ossimRefPtr<ossimMultiResLevelHistogram> histogram = 0;
+   if ( isOpen() )
+   {
+      ossimFilename histoFile = getFilenameWithThisExtension(ossimString(".his"));
+      histogram = new ossimMultiResLevelHistogram();
+      if ( histogram->importHistogram(histoFile) == false )
+      {
+         histogram = 0;
+      }
+   }
+   return histogram;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimImageHandler::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      //---
+      // Check factory for external geom:
+      //---
+      theGeometry = getExternalImageGeometry();
+
+      if ( !theGeometry )
+      {
+         //---
+         // WARNING:
+         // Must create/set the geometry at this point or the next call to
+         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
+         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
+         //---
+         theGeometry = new ossimImageGeometry();
+         initImageParameters( theGeometry.get() );
+
+         //---
+         // And finally allow factories to extend the internal geometry.
+         // This allows plugins for tagged formats with tags not know in the base
+         // to extend the internal geometry.
+         //
+         // Plugins can do handler->getImageGeometry() then modify/extend.
+         //---
+         if(!ossimImageGeometryRegistry::instance()->extendGeometry( this ))
+         {
+            //---
+            // Check for internal, for geotiff, nitf and so on as last resort for getting some
+            // kind of geometry loaded
+            //---
+            theGeometry = getInternalImageGeometry();
+            initImageParameters( theGeometry.get() );
+         }
+      }
+   }
+   return theGeometry;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimImageHandler::getExternalImageGeometry() const
+{
+   ossimRefPtr<ossimImageGeometry> geom = 0;
+
+   // No geometry object has been set up yet. Check for external geometry file.
+   // Try "foo.geom" if image is "foo.tif":
+   ossimFilename filename;
+   getFilenameWithThisExt( ossimString(".geom"), filename );
+
+   if(!filename.exists())
+   {
+      // Try "foo_e0.tif" if image is "foo.tif" where "e0" is entry index.
+      filename = getFilenameWithThisExtension(ossimString(".geom"), true);
+   }
+
+#if 0 /* getgetFilenameWithThisExt... methods tack on sup dir if set. drb */
+   if(!filename.exists())
+   {
+      // Try supplementary data directory for remote geometry:
+      filename = getFilenameWithThisExtension(ossimString(".geom"), false);
+      filename = theSupplementaryDirectory.dirCat(filename.file());
+   }
+   if(!filename.exists())
+   {
+      // Try supplementary data directory for remote geometry with entry index:
+      filename = getFilenameWithThisExtension(ossimString(".geom"), true);
+      filename = theSupplementaryDirectory.dirCat(filename.file());
+   }
+#endif
+
+   if(filename.exists())
+   {
+      // Open the geom file as a KWL and initialize our geometry object:
+      filename = filename.expand();
+      ossimKeywordlist geomKwl(filename);
+
+      // Try loadState with no prefix.
+      std::string prefix = "";
+      std::string key = ossimKeywordNames::TYPE_KW;
+      std::string value = geomKwl.findKey(prefix, key);
+
+      if ( value.empty() || (value != "ossimImageGeometry") )
+      {
+         // Try with "image0." type prefix.
+         prefix += std::string("image") + ossimString::toString(getCurrentEntry()).string() +
+            std::string(".");
+         value = geomKwl.findKey(prefix, key);
+         
+         if ( value.empty() || (value != "ossimImageGeometry") )
+         {
+            // Try with "image0.geometry." prefix.
+            prefix += std::string( "geometry." );
+            value = geomKwl.findKey(prefix, key);
+            
+            if ( value.empty() || (value != "ossimImageGeometry") )
+            {
+               // Try with "geometry." prefix.
+               prefix = std::string( "geometry." );
+               value = geomKwl.findKey(prefix, key);
+            }
+         }
+      }
+      
+      if ( value == "ossimImageGeometry" )
+      {
+         geom = new ossimImageGeometry;
+         if( !geom->loadState(geomKwl, prefix.c_str()) )
+         {
+            geom = 0;
+         }
+      }
+   }
+   
+   return geom;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimImageHandler::getInternalImageGeometry() const
+{
+   // Default, derived classes should override.
+   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
+   return geom;
+}
+
+void ossimImageHandler::setImageGeometry( ossimImageGeometry* geom)
+{
+   theGeometry = geom;
+}
+
+void ossimImageHandler::saveImageGeometry() const
+{
+   ossimFilename geometryFile = getFilenameWithThisExtension(ossimString(".geom"));
+   saveImageGeometry(geometryFile);
+}
+
+void ossimImageHandler::saveImageGeometry(const ossimFilename& geometry_file) const
+{
+   if (theGeometry.valid())
+   {
+      ossimKeywordlist kwl;
+      theGeometry->saveState(kwl);
+      kwl.write(geometry_file.chars());
+   }
+}
+
+void ossimImageHandler::closeOverview()
+{
+   theOverview = 0;
+}
+
+const ossimImageHandler* ossimImageHandler::getOverview() const
+{
+   return theOverview.get();
+}
+
+bool ossimImageHandler::hasOverviews() const
+{
+   return (getNumberOfDecimationLevels() > 1);
+}
+
+bool ossimImageHandler::openOverview(const ossimFilename& overview_file)
+{
+   bool result = false;
+   
+   closeOverview();
+
+   if (overview_file != theImageFile) // Make sure we don't open ourselves.
+   {
+      //---
+      // Get the number of level before the call to opening the overview so
+      // the overview can be told what it's starting res level is.
+      //---
+      ossim_uint32 overviewStartingResLevel = getNumberOfDecimationLevels();
+
+
+      // Try to open:
+      theOverview = ossimImageHandlerRegistry::instance()->openOverview( overview_file );
+
+      if (theOverview.valid())
+      {
+         result = true;
+         
+         //---
+         // Set the owner in case the overview reader needs to get something
+         // from the it like min/max/null.
+         //---
+         theOverview->changeOwner(this);
+         
+         // Set the starting res level of the overview.
+         theOverview->setStartingResLevel(overviewStartingResLevel);
+         
+         // Capture the file name.
+         theOverviewFile = overview_file;
+
+         //---
+         // Some overview handlers cannot store what the null is.  Like dted
+         // null is -32767 not default -32768 so this allows passing this to the
+         // overview reader provided it overrides setMin/Max/NullPixel value
+         // methods. (drb)
+         //---
+         const ossim_uint32 BANDS = getNumberOfOutputBands();
+         for (ossim_uint32 band = 0; band < BANDS; ++band)
+         {
+            theOverview->setMinPixelValue(band, getMinPixelValue(band));
+            theOverview->setMaxPixelValue(band, getMaxPixelValue(band));
+            theOverview->setNullPixelValue(band, getNullPixelValue(band));
+         }
+
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "overview starting res level: " << overviewStartingResLevel
+               << "\noverview levels: "
+               << theOverview->getNumberOfDecimationLevels()
+               << "\nlevels: " << getNumberOfDecimationLevels()
+               << endl;
+         }
+         
+         //---
+         // This is not really a container event; however, using for now.
+         //---
+         ossimContainerEvent event(this,
+                                   OSSIM_EVENT_ADD_OBJECT_ID);
+         event.setObjectList(theOverview.get());
+         fireEvent(event);
+      }
+   }
+   
+   return result;
+}
+
+bool ossimImageHandler::openOverview()
+{
+   static const char MODULE[] = "ossimImageHandler::openOverview()";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+   
+   bool result = false;
+   
+   closeOverview();
+   
+   // 1) ESH 03/2009 -- Use the overview file set e.g. using a .spec file.
+   ossimFilename overviewFilename = getOverviewFile();
+
+   // ossimFilename::exists() currently does not work with s3 url's.
+   if ( overviewFilename.empty() ) // || (overviewFilename.exists() == false) )
+   {
+      // 2) Generate the name from image name.
+      overviewFilename = createDefaultOverviewFilename();
+   }
+
+   // ossimFilename::exists() currently does not work with s3 url's.
+   if ( overviewFilename.size() ) 
+   {
+      result = openOverview( overviewFilename );
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << (result?"Opened ":"Could not open ") << "overview: " << overviewFilename
+            << "\n";
+      }
+   }
+
+   if ( !result )
+   {
+      if (overviewFilename.empty() || (overviewFilename.exists() == false) )
+      {  
+         // 3) For backward compatibility check if single entry and _e0.ovr
+         overviewFilename = getFilenameWithThisExtension(ossimString(".ovr"), true);
+
+         if (overviewFilename.empty() || (overviewFilename.exists() == false) )
+         {
+            //---
+            // 4) For overviews built with gdal.
+            // Examples:
+            // Single entry: foo.tif.ovr
+            // Multi-entry: foo.tif.x.ovr where "x" == one based entry number.
+            // 
+            // Note: Take into account a supplementary dir if any.
+            //---
+            if ( theSupplementaryDirectory.empty() )
+            {
+               overviewFilename = getFilename();
+            }
+            else
+            {
+               overviewFilename = theSupplementaryDirectory;
+               overviewFilename = overviewFilename.dirCat( getFilename().file() );
+            }
+
+            if ( getNumberOfEntries() > 1 )
+            {
+               overviewFilename += ".";
+               // Sample multi-entry data "one" based; hence, the + 1.
+               overviewFilename += ossimString::toString( getCurrentEntry()+1 );
+            }
+            overviewFilename += ".ovr";
+         }
+      }
+   
+      if ( overviewFilename.exists() )
+      {
+         result = openOverview( overviewFilename );
+
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << (result?"Opened ":"Could not open ") << "overview: " << overviewFilename
+               << "\n";
+         }
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit result: " << (result?"true":"false") << "\n";
+   }
+
+   return result;
+}
+
+
+bool ossimImageHandler::writeValidImageVertices(const std::vector<ossimIpt>& vertices, const ossimFilename& file)
+{
+   ossimFilename tempFile = file;
+   if(tempFile == "")
+   {
+      tempFile = createDefaultValidVerticesFilename();
+   }
+   ossim_uint32 i = 0;
+   ossimKeywordlist tempKwl;
+   ossimPolygon poly(vertices);
+   
+   poly.checkOrdering();
+
+   // Capture the vertices.
+   theValidImageVertices = vertices;
+   
+   if(poly.getOrdering() == OSSIM_COUNTERCLOCKWISE_ORDER)
+   {
+      std::reverse(theValidImageVertices.begin(), theValidImageVertices.end());
+   }
+   
+   if(theValidImageVertices.size())
+   {
+      for(i = 0; i < theValidImageVertices.size(); ++i)
+      {
+         ossimString prefix = ossimString("point") + ossimString::toString(i) + ".";
+         tempKwl.add(prefix.c_str(),
+                     "x",
+                     theValidImageVertices[i].x,
+                     true);
+	 tempKwl.add(prefix.c_str(),
+                     "y",
+                     theValidImageVertices[i].y,
+                     true);
+      }
+      
+      tempKwl.write(tempFile.c_str());
+   }
+
+   if ( tempFile.exists() )
+   {
+      return true;
+   }
+
+   return false; // Write of file failed.
+}
+
+bool ossimImageHandler::openValidVertices(const ossimFilename& vertices_file)
+{
+   return initVertices(vertices_file);
+}
+
+bool ossimImageHandler::openValidVertices()
+{
+   ossimFilename vertices_file;
+   vertices_file = theImageFile.path();
+   vertices_file = vertices_file.dirCat(theImageFile.fileNoExtension());
+   if(getNumberOfEntries() > 1)
+   {
+      vertices_file += ossimString("_vertices") + "_e" + ossimString::toString(getCurrentEntry()) + ".kwl";
+   }
+   else
+   {
+      vertices_file += "_vertices.kwl";
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "Looking for " << vertices_file
+         << " vertices file..." << std::endl;
+   }
+
+   return openValidVertices(vertices_file);
+}
+
+bool ossimImageHandler::open(const ossimFilename& imageFile)
+{
+   if(isOpen())
+   {
+      close();
+   }
+
+   setFilename(imageFile);
+   
+   return open();
+}
+
+bool ossimImageHandler::open(const ossimFilename& imageFile,
+                             ossim_uint32 entryIndex)
+{
+   if(isOpen())
+   {
+      close();
+   }
+   setFilename(imageFile);
+   
+   bool result = open();
+
+   if(result)
+   {
+      return setCurrentEntry(entryIndex);
+   }
+
+   return result;
+}
+
+bool ossimImageHandler::isValidRLevel(ossim_uint32 resLevel) const
+{
+   bool result = false;
+   
+   const ossim_uint32 LEVELS = getNumberOfDecimationLevels();
+   
+   if ( !theStartingResLevel) // Not an overview.
+   {
+      result = (resLevel < LEVELS);
+   }
+   else  // Used as overview.
+   {
+      if (resLevel >= theStartingResLevel)
+      {
+         //---
+         // Adjust the res level to be zero based for this overview before
+         // checking.
+         //---
+         result = ( (resLevel - theStartingResLevel) < LEVELS);
+      }
+   }
+   
+   return result;
+}
+
+void ossimImageHandler::getValidImageVertices(vector<ossimIpt>& validVertices,
+                                              ossimVertexOrdering ordering,
+                                              ossim_uint32 resLevel) const
+{
+   ossimDpt decimation;
+   getDecimationFactor(resLevel, decimation);
+   if(decimation.hasNans())
+   {
+      return;
+   }
+   if (theValidImageVertices.size() != 0)
+   {
+      validVertices.clear();
+      for (ossim_uint32 i=0; i<theValidImageVertices.size(); ++i)
+      {
+         ossimIpt pt(ossim::round<int>(theValidImageVertices[i].x*decimation.x),
+                     ossim::round<int>(theValidImageVertices[i].y*decimation.y));
+         validVertices.push_back(pt);
+      }
+
+      if(ordering == OSSIM_COUNTERCLOCKWISE_ORDER)
+      {
+         std::reverse(validVertices.begin()+1, validVertices.end());
+      }
+   }
+   else
+   {
+      // Call the base class method which will set to bounding rectangle.
+      ossimImageSource::getValidImageVertices(validVertices, ordering, resLevel);
+   }
+}
+
+void ossimImageHandler::close()
+{
+   theOverview = 0;
+   theGeometry = 0;
+   theValidImageVertices.clear();
+   theDecimationFactors.clear();
+}
+
+bool ossimImageHandler::isBandSelector() const
+{
+   return false;
+}
+
+bool ossimImageHandler::setOutputBandList(const std::vector<ossim_uint32>& /* band_list */)
+{
+   return false;
+}
+
+bool ossimImageHandler::getRgbBandList( std::vector<ossim_uint32>& bandList ) const
+{
+   // Looks for "rgb_bands" key in dot omd file.  E.g. "rgb_bands: (2,1,0)"
+   return theMetaData.getRgbBands( bandList );
+}
+
+bool ossimImageHandler::setOutputToInputBandList()
+{
+   bool result = false;
+   if ( isBandSelector() )
+   {
+      std::vector<ossim_uint32> bandList;
+      ossimImageSource::getOutputBandList( bandList );
+      result = setOutputBandList( bandList );
+   }
+   return result;
+}
+
+bool ossimImageHandler::isIdentityBandList( const std::vector<ossim_uint32>& bandList ) const
+{
+   bool result = false;
+   const ossim_uint32 BANDS = (ossim_uint32)bandList.size();
+   if ( BANDS )
+   {
+      std::vector<ossim_uint32> inputList;
+      ossimImageSource::getOutputBandList( inputList ); // This populates an identity band list.
+
+      if ( inputList.size() == BANDS )
+      {
+         ossim_uint32 band = 0;
+         while ( band < BANDS )
+         {
+            if ( inputList[band] != bandList[band] )
+            {
+               break;
+            }
+            ++band;
+         }
+         if ( band == BANDS )
+         {
+            result = true;
+         }
+      }
+   }
+   return result;
+}
+
+// Protected convenience method:
+bool ossimImageHandler::setOutputBandList(const std::vector<ossim_uint32>& inBandList,
+                                          std::vector<ossim_uint32>& outBandList)
+{
+   bool result = false;
+
+   const ossim_uint32 INPUT_BANDS  = getNumberOfInputBands();
+   const ossim_uint32 OUTPUT_BANDS = (ossim_uint32)inBandList.size();
+
+   if ( INPUT_BANDS && OUTPUT_BANDS )
+   {
+      result = true;
+      outBandList.resize( OUTPUT_BANDS );
+      for ( ossim_uint32 band = 0; band < OUTPUT_BANDS; ++band )
+      {
+         if ( inBandList[band] < INPUT_BANDS )
+         {
+            outBandList[band] = inBandList[band];
+         }
+         else // Out of range...
+         {
+            result = false;
+            break;
+         }
+      }
+      if ( result && theOverview.valid() )
+      {
+         result = theOverview->setOutputBandList( inBandList );
+      }
+   }
+
+   if ( result == false )
+   {
+      ossimImageSource::getOutputBandList( outBandList ); // Set to identity.
+   }
+
+   return result;
+}
+
+bool ossimImageHandler::isImageTiled() const
+{
+   return (getImageTileWidth() && getImageTileHeight());
+}
+
+void ossimImageHandler::loadMetaData()
+{
+   ossimFilename filename = getFilenameWithThisExtension(ossimString(".omd"), false);
+   theMetaData.clear();
+
+   std::shared_ptr<ossim::istream> instream = ossim::StreamFactoryRegistry::instance()->createIstream(filename.c_str());
+
+   if(!instream)
+   {
+      filename = getFilenameWithThisExtension(ossimString(".omd"), true);
+      instream = ossim::StreamFactoryRegistry::instance()->createIstream(filename.c_str());
+   }
+
+   if(instream)
+   {
+     ossimKeywordlist kwl;
+     
+     kwl.parseStream(*instream);
+     
+     theMetaData.loadState(kwl);
+   }
+   else
+   {
+     theMetaData.setScalarType(getOutputScalarType());
+   }
+/*
+  ossimFilename filename = getFilenameWithThisExtension(ossimString(".omd"), false);
+  if ( filename.exists() == false )
+  {
+     filename = getFilenameWithThisExtension(ossimString(".omd"), true);
+  }
+  if(filename.exists())
+  {
+     ossimKeywordlist kwl;
+     
+     kwl.addFile(filename.c_str());
+     
+     theMetaData.loadState(kwl);
+  }
+  else
+  {
+     theMetaData.setScalarType(getOutputScalarType());
+  }
+  */
+}
+
+double ossimImageHandler::getMinPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getMinPix(band);
+   }
+   return ossim::defaultMin(getOutputScalarType());
+}
+
+double ossimImageHandler::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getMaxPix(band);
+   }
+   return ossim::defaultMax(getOutputScalarType());
+}
+
+double ossimImageHandler::getNullPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getNullPix(band);
+   }
+   
+   return ossim::defaultNull(getOutputScalarType());
+}
+
+void ossimImageHandler::setMinPixelValue(ossim_uint32 band,
+                                         const ossim_float64& pix)
+{
+   theMetaData.setMinPix(band, pix);
+}
+
+void ossimImageHandler::setMaxPixelValue(ossim_uint32 band,
+                                         const ossim_float64& pix)
+{
+   theMetaData.setMaxPix(band, pix); 
+}
+
+void ossimImageHandler::setNullPixelValue(ossim_uint32 band,
+                                          const ossim_float64& pix)
+{
+   theMetaData.setNullPix(band, pix);  
+}
+
+ossim_uint32 ossimImageHandler::getCurrentEntry()const
+{
+   return 0;
+}
+
+bool ossimImageHandler::setCurrentEntry(ossim_uint32 /* entryIdx */)
+{
+   return true;
+}
+
+ossimFilename ossimImageHandler::getOverviewFile()const
+{
+   return theOverviewFile;
+}
+
+void ossimImageHandler::getEntryList(std::vector<ossim_uint32>& entryList)const
+{
+   entryList.push_back(0);
+}
+
+bool ossimImageHandler::useEntryIndex() const
+{
+   bool result = false;
+   if ( isOpen() )
+   {
+      std::vector<ossim_uint32> entryList;
+      getEntryList(entryList);
+
+      if ( entryList.size() )
+      {
+         if ( (entryList.size() > 1) || (entryList[0] != 0) ) result = true;
+      }
+   }
+   return result;
+}
+
+ossim_uint32 ossimImageHandler::getNumberOfEntries()const
+{
+   std::vector<ossim_uint32> tempList;
+   getEntryList(tempList);
+   
+   return (ossim_uint32)tempList.size();
+}
+
+void ossimImageHandler::getEntryNames(std::vector<ossimString>& entryStringList) const
+{
+   entryStringList.clear();
+}
+
+void ossimImageHandler::getEntryName( ossim_uint32 entryIdx, std::string& name ) const
+{
+   name = "";
+   std::vector<ossimString> entryNames;
+   getEntryNames(entryNames);
+   if (entryIdx < entryNames.size())
+      name = entryNames[entryIdx].string();
+}
+
+void ossimImageHandler::completeOpen()
+{
+   loadMetaData();
+   if ( theOpenOverviewFlag )
+   {
+      openOverview();
+   }
+   establishDecimationFactors();
+   openValidVertices();
+}
+
+bool ossimImageHandler::canConnectMyInputTo(ossim_int32 /* inputIndex */,
+                                            const ossimConnectableObject* /* object */)const
+{      
+   return false;
+}
+
+bool ossimImageHandler::hasMetaData()const
+{
+   return theMetaData.isValid();
+}
+
+void ossimImageHandler::setFilename(const ossimFilename& filename)
+{
+   theImageFile = filename;
+}
+
+const ossimFilename& ossimImageHandler::getFilename()const
+{
+   return theImageFile;
+}
+
+void ossimImageHandler::setSupplementaryDirectory(const ossimFilename& dir)
+{
+   if (dir.isDir())
+      theSupplementaryDirectory = dir;
+   else
+      theSupplementaryDirectory = dir.path();
+
+   // A change in supplementary directory presents an opportunity to find the OVR that could not be
+   // opened previously, as well as other support data items:
+   if (!theOverview.valid())
+   {
+      if (theDecimationFactors.size() > 0)
+      {
+        theDecimationFactors.clear();
+      }
+      completeOpen();
+   }
+}
+
+const ossimFilename& ossimImageHandler::getSupplementaryDirectory()const
+{
+   return theSupplementaryDirectory;
+}
+
+void ossimImageHandler::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if ( property.valid() )
+   {
+      if(property->getName() == ossimKeywordNames::ENTRY_KW)
+      {
+         setCurrentEntry(property->valueToString().toUInt32());
+      }
+      else if ( property->getName() == OPEN_OVERVIEW_FLAG_KW )
+      {
+         setOpenOverviewFlag( property->valueToString().toBool() );
+      }
+      else
+      {
+         ossimImageSource::setProperty(property);
+      }
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimImageHandler::getProperty(const ossimString& name)const
+{
+
+   if(name == ossimKeywordNames::ENTRY_KW)
+   {
+      std::vector<ossim_uint32> entryList;
+      getEntryList(entryList);
+      
+      ossimStringProperty* stringProperty = new ossimStringProperty(name,
+                                                                    ossimString::toString(getCurrentEntry()));
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < entryList.size(); ++idx)
+      {
+         stringProperty->addConstraint(ossimString::toString(entryList[idx]));
+      }
+      stringProperty->setFullRefreshBit();
+      stringProperty->setEditableFlag(false);
+
+      return stringProperty;
+   }
+   else if(name == ossimKeywordNames::NUMBER_SAMPLES_KW)
+   {
+      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfSamples()));
+      prop->setReadOnlyFlag(true);
+      
+      return prop;
+   }
+   else if(name == ossimKeywordNames::NUMBER_LINES_KW)
+   {
+      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfLines()));
+      prop->setReadOnlyFlag(true);
+      
+      return prop;
+   }
+   else if(name == ossimKeywordNames::NUMBER_BANDS_KW)
+   {
+      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfInputBands()));
+      prop->setReadOnlyFlag(true);
+      
+      return prop;
+   }
+   else if(name == ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW)
+   {
+      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(getNumberOfDecimationLevels()));
+      prop->setReadOnlyFlag(true);
+      
+      return prop;
+   }
+   else if(name == ossimKeywordNames::SCALAR_TYPE_KW)
+   {
+      ossimStringProperty* prop = new ossimStringProperty(name, ossimScalarTypeLut::instance()->getEntryString(getOutputScalarType()));
+      prop->setReadOnlyFlag(true);
+      
+      return prop;
+   }
+   else if(name == "histogram_filename")
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, createDefaultHistogramFilename());
+      
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      filenameProp->setCacheRefreshBit();
+      
+      return filenameProp;
+      
+   }
+   else if(name == "geometry_filename")
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, createDefaultGeometryFilename());
+      
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      filenameProp->setCacheRefreshBit();
+      
+      return filenameProp;
+      
+   }
+   else if(name == "valid_vertices_filename")
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, createDefaultValidVerticesFilename());
+      
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      filenameProp->setCacheRefreshBit();
+      
+      return filenameProp;
+   }
+   else if(name == "metadata_filename")
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, createDefaultMetadataFilename());
+      
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      filenameProp->setCacheRefreshBit();
+      
+      return filenameProp;
+   }
+   else if(name == "overview_filename")
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, createDefaultOverviewFilename());
+      
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      filenameProp->setCacheRefreshBit();
+      
+      return filenameProp;
+   }
+   else if(name == "filename")
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, getFilename());
+      
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      filenameProp->setFullRefreshBit();
+      
+      return filenameProp;
+   }
+   else if ( name == OPEN_OVERVIEW_FLAG_KW)
+   {
+      ossimRefPtr<ossimProperty> result =
+         new ossimBooleanProperty(ossimString(OPEN_OVERVIEW_FLAG_KW), theOpenOverviewFlag); 
+      return result;
+   }
+   
+   return ossimImageSource::getProperty(name);
+}
+
+void ossimImageHandler::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSource::getPropertyNames(propertyNames);
+   propertyNames.push_back(ossimKeywordNames::ENTRY_KW);
+   propertyNames.push_back(ossimKeywordNames::NUMBER_SAMPLES_KW);
+   propertyNames.push_back(ossimKeywordNames::NUMBER_LINES_KW);
+   propertyNames.push_back(ossimKeywordNames::NUMBER_BANDS_KW);
+   propertyNames.push_back(ossimKeywordNames::NUMBER_REDUCED_RES_SETS_KW);
+   propertyNames.push_back(ossimKeywordNames::SCALAR_TYPE_KW);
+   propertyNames.push_back(OPEN_OVERVIEW_FLAG_KW);
+}
+
+ossimFilename ossimImageHandler::getFilenameWithThisExtension(
+   const ossimString& ext,
+   bool set_e0_prefix) const
+{
+   // Get the image file.
+   ossimFilename f = getFilename();
+
+   getFilenameWithNoExtension( f );
+
+   if (set_e0_prefix || (getNumberOfEntries() > 1))
+   {
+      f += "_e";
+      f += ossimString::toString(getCurrentEntry());
+   }
+   
+   if (ext.size())
+   {
+      if (ext.string()[0] != '.')
+      {
+         f += ".";
+      }
+      f += ext;
+   }
+   return f;
+}
+
+void ossimImageHandler::getFilenameWithThisExt( const ossimString& ext,
+                                                ossimFilename& f ) const
+{
+   // Get the image file.
+   f = getFilename();
+
+   getFilenameWithNoExtension( f );
+
+   if (ext.size())
+   {
+      if (ext.string()[0] != '.')
+      {
+         f += ".";
+      }
+      f += ext;
+   } 
+}
+
+void ossimImageHandler::getFilenameWithNoExtension( ossimFilename& f ) const
+{
+   //---
+   // If the supplementary directory is set, find the extension at that
+   // location instead of at the default.
+   //---
+   if ( theSupplementaryDirectory.size() )
+   {
+      ossimString drivePart;
+      ossimString pathPart;
+      ossimString filePart;
+      ossimString extPart;
+
+      f.split(drivePart,
+              pathPart,
+              filePart,
+              extPart);
+
+      ossimFilename newDrivePart = theSupplementaryDirectory.drive();
+      ossimFilename newPathPart  = theSupplementaryDirectory.after(newDrivePart);
+
+      f.merge( newDrivePart, newPathPart, filePart, extPart );
+   }
+
+   // Wipe out the extension.
+   f.setExtension("");
+}
+
+bool ossimImageHandler::getOverviewTile(ossim_uint32 resLevel,
+                                        ossimImageData* result)
+{
+   bool status = false;
+   
+   if (theOverview.valid())
+   {
+      if (theOverview->isValidRLevel(resLevel) && result &&
+          (result->getNumberOfBands() == getNumberOfOutputBands()) )
+      {
+         status = theOverview->getTile(result, resLevel);
+      }
+   }
+   
+   return status;
+}
+
+ossimRefPtr<ossimNBandLutDataObject> ossimImageHandler::getLut()const
+{
+   return theLut;
+}
+
+bool ossimImageHandler::hasLut() const
+{
+   return theLut.valid();
+}
+
+ossimFilename ossimImageHandler::createDefaultOverviewFilename() const
+{
+   return getFilenameWithThisExtension("ovr");
+}
+   
+ossimFilename ossimImageHandler::createDefaultGeometryFilename() const
+{
+   return getFilenameWithThisExtension("geom");
+}
+
+ossimFilename ossimImageHandler::createDefaultMetadataFilename() const
+{
+   return getFilenameWithThisExtension("omd");
+}
+
+ossimFilename ossimImageHandler::createDefaultHistogramFilename() const
+{
+   return getFilenameWithThisExtension("his");
+}
+
+ossimFilename ossimImageHandler::createDefaultValidVerticesFilename() const
+{
+   ossimFilename result;
+   
+   result = theImageFile.path();
+   result = result.dirCat(theImageFile.fileNoExtension());
+   result += "_vertices";
+   if(getNumberOfEntries() > 1)
+   {
+      result += "_e";
+      result += ossimString::toString(getCurrentEntry());
+   }
+   result += ".kwl";
+   
+   return result;
+}
+
+ossim_uint32 ossimImageHandler::getStartingResLevel() const
+{
+   return theStartingResLevel;
+}
+
+void ossimImageHandler::setStartingResLevel(ossim_uint32 level)
+{
+   theStartingResLevel = level;
+}
+
+bool ossimImageHandler::getOpenOverviewFlag() const
+{
+   return theOpenOverviewFlag;
+}
+   
+void ossimImageHandler::setOpenOverviewFlag(bool flag)
+{
+   theOpenOverviewFlag = flag;
+
+   // If false close overview if open??? (drb)
+}
+
+void ossimImageHandler::initImageParameters(ossimImageGeometry* geom) const
+{
+   if ( geom )
+   {
+      // Set decimation levels
+      ossim_uint32 num_levels = getNumberOfDecimationLevels();
+      if ((num_levels > 0) && (num_levels != geom->getNumberOfDecimations()))
+      {
+         geom->setDiscreteDecimation(theDecimationFactors);
+      }
+
+      // Set image size.
+      if(geom->getImageSize().hasNans())
+      {
+         ossimIrect rect = getBoundingRect();
+         geom->setImageSize(ossimIpt(rect.width(), rect.height()));
+      } 
+   }
+}
diff --git a/src/imaging/ossimImageHandlerFactory.cpp b/src/imaging/ossimImageHandlerFactory.cpp
new file mode 100644
index 0000000..02f3a15
--- /dev/null
+++ b/src/imaging/ossimImageHandlerFactory.cpp
@@ -0,0 +1,1103 @@
+//---
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//---
+// $Id$
+
+#include <ossim/imaging/ossimImageHandlerFactory.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimAdrgTileSource.h>
+#include <ossim/imaging/ossimCcfTileSource.h>
+#include <ossim/imaging/ossimCibCadrgTileSource.h>
+#include <ossim/imaging/ossimDoqqTileSource.h>
+#include <ossim/imaging/ossimDtedTileSource.h>
+#include <ossim/imaging/ossimEnviTileSource.h>
+#include <ossim/imaging/ossimLasReader.h>
+#include <ossim/imaging/ossimNitfTileSource.h>
+// #include <ossim/imaging/ossimPdfReader.h>
+#include <ossim/imaging/ossimQuickbirdNitfTileSource.h>
+#include <ossim/imaging/ossimSrtmTileSource.h>
+#include <ossim/imaging/ossimQuickbirdTiffTileSource.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimUsgsDemTileSource.h>
+#include <ossim/imaging/ossimLandsatTileSource.h>
+#include <ossim/imaging/ossimGeneralRasterTileSource.h>
+#include <ossim/imaging/ossimERSTileSource.h>
+#include <ossim/imaging/ossimVpfTileSource.h>
+#include <ossim/imaging/ossimJpegTileSource.h>
+#include <ossim/imaging/ossimRpfCacheTileSource.h>
+#include <ossim/imaging/ossimImageCacheTileSource.h>
+#include <ossim/imaging/ossimQbTileFilesHandler.h>
+#include <ossim/imaging/ossimBitMaskTileSource.h>
+#include <ossim/imaging/ossimBandSeparateHandler.h>
+#include <ossim/imaging/ossimRangeDomeTileSource.h>
+#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
+#include <ossim/point_cloud/ossimPointCloudImageHandler.h>
+#include <ossim/support_data/ossimSrcRecord.h>
+#include <tiffio.h>
+
+#if OSSIM_HAS_HDF5
+#include <ossim/hdf5/ossimViirsHandler.h>
+#endif
+
+static const ossimTrace traceDebug("ossimImageHandlerFactory:debug");
+
+RTTI_DEF1(ossimImageHandlerFactory, "ossimImageHandlerFactory", ossimImageHandlerFactoryBase);
+
+ossimImageHandlerFactory* ossimImageHandlerFactory::theInstance = 0;
+
+ossimImageHandlerFactory::~ossimImageHandlerFactory()
+{
+   theInstance = (ossimImageHandlerFactory*)0;
+}
+
+ossimImageHandlerFactory* ossimImageHandlerFactory::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimImageHandlerFactory;
+
+      // let's turn off tiff error reporting
+      TIFFSetErrorHandler(0);
+      TIFFSetWarningHandler(0);
+   }
+
+   return theInstance;
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactory::open(
+   std::shared_ptr<ossim::istream>& str,
+   const std::string& connectionString,
+   bool openOverview ) const
+{
+   ossimRefPtr<ossimImageHandler> result(0);
+
+   // NITF:
+   ossimRefPtr<ossimNitfTileSource> ih = new ossimNitfTileSource();
+   ih->setOpenOverviewFlag(openOverview);
+   if ( ih->open( str, connectionString ) )
+   {
+      result = ih.get();
+   }
+      
+   if( !result )
+   {
+      // Reset the stream for downstream code.
+      str->seekg(0, std::ios_base::beg);
+      str->clear();
+      
+      // TIFF:
+      ossimRefPtr<ossimTiffTileSource> ihTiff = new ossimTiffTileSource();
+      ihTiff->setOpenOverviewFlag(openOverview);
+      if ( ihTiff->open( str, connectionString ) )
+      {
+         result = ihTiff.get();
+      }
+
+      if(!result)
+      {
+         // Reset the stream for downstream code.
+         str->seekg(0, std::ios_base::beg);
+         str->clear();
+
+         // ossim dot.src file:
+         result = openSrcRecord( str, connectionString, openOverview );  
+
+         if ( !result )
+         {
+            // Reset the stream for downstream code.
+            str->seekg(0, std::ios_base::beg);
+            str->clear();
+         }
+      }
+   }
+   
+   return result;
+}
+
+ossimImageHandler* ossimImageHandlerFactory::open(const ossimFilename& fileName,
+                                                  bool openOverview) const
+{
+   static const char* M = "ossimImageHandlerFactory::open(filename) -- ";
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" Entering..." << std::endl;
+
+   ossimFilename copyFilename = fileName;
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "Attempting to open file: " << fileName.c_str()
+         << "\nopen overview flag: " << (openOverview?"true":"false") << "\n";
+   }
+
+   ossimRefPtr<ossimImageHandler> result = 0;
+   while (true)
+   {
+      // Check for empty file.
+      copyFilename.trim();
+      if (copyFilename.empty()) break;
+
+      // for all of our imagehandlers the filename must exist.
+      // if we have any imagehandlers that require an encoded string and is contrlled in this factory then
+      // we need to move this.
+      if (!copyFilename.exists())  break;
+
+      ossimString ext = copyFilename.ext().downcase();
+      if(ext == "gz")
+         copyFilename = copyFilename.setExtension("");
+
+      // Try opening from extension logic first (this is faster than instantiating each type).
+//      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying via extension...";
+//      result = openFromExtension(copyFilename);
+//      if (result.valid())  break;
+
+      //---
+      // If here do it the brute force way by going down the list of available
+      // readers...
+      //---
+
+      //---
+      // NITF at top of list.
+      // 
+      // This must be checked first before the NITF raw handler.
+      //---
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Quickbird Nitf...\n";
+      result = new ossimQuickbirdNitfTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying NITF...\n";
+      result = new ossimNitfTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+      
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying RPF Cache Image...\n";
+      result = new ossimRpfCacheTileSource;
+      result->setOpenOverviewFlag(openOverview);
+      if (result->open(copyFilename)) break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying RPF Image Cache Image...\n";
+      result = new ossimImageCacheTileSource;
+      result->setOpenOverviewFlag(openOverview);
+      if (result->open(copyFilename)) break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying JPEG...\n";
+      result = new ossimJpegTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename)) break;
+
+      // this must be checked first before the TIFF handler
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Quickbird TIFF...\n";
+      result = new ossimQuickbirdTiffTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename)) break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying TIFF...\n";
+      result = new ossimTiffTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying CIB/CADRG...\n";
+      result = new ossimCibCadrgTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying DOQQ...\n";
+      result = new ossimDoqqTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying DTED...\n";
+      result = new ossimDtedTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying USGS Dem...\n";
+      result = new ossimUsgsDemTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Landsat...\n";
+      result = new ossimLandsatTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying VPF...\n";
+      result = new ossimVpfTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ERS...\n";
+      result = new ossimERSTileSource;
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      //---
+      // The srtm and general raser readers were picking up j2k overviews because the
+      // matching base file has an "omd" file that the raster reader can load
+      // so added extension check.  (drb - 20100709)
+      //---
+      if (copyFilename.ext() != "ovr")
+      {
+         // Note:  ENVI should be in front of general raster..
+         if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ENVI...\n";
+         result = new ossimEnviTileSource;
+         result->setOpenOverviewFlag(openOverview);         
+         if (result->open(copyFilename))  break;
+
+         // Note:  SRTM should be in front of general raster..
+         if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying SRTM...\n";
+         result = new ossimSrtmTileSource;
+         result->setOpenOverviewFlag(openOverview);         
+         if (result->open(copyFilename))  break;
+
+         if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying General Raster...\n";
+         result = new ossimGeneralRasterTileSource; 
+         result->setOpenOverviewFlag(openOverview);        
+         if (result->open(copyFilename))  break;
+      }
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ADRG...\n";
+      result = new ossimAdrgTileSource();
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ossimQbTileFilesHandler...\n";
+      result = new ossimQbTileFilesHandler();
+      result->setOpenOverviewFlag(openOverview);
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Bit Mask...\n";
+      result = new ossimBitMaskTileSource();
+      result->setOpenOverviewFlag(openOverview);
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying band-separated files...\n";
+      result = new ossimBandSeparateHandler();
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying CCF...\n";
+      result = new ossimCcfTileSource();
+      result->setOpenOverviewFlag(openOverview);      
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying OSSIM Range Domes...\n";
+      result = new ossimRangeDomeTileSource();
+      result->setOpenOverviewFlag(openOverview);
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Point Cloud...\n";
+      result = new ossimPointCloudImageHandler();
+      result->setOpenOverviewFlag(openOverview);
+      if (result->open(copyFilename))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying LAS Reader...\n";
+      result->setOpenOverviewFlag(openOverview);
+      result = new ossimLasReader();
+      if (result->open(copyFilename))  break;
+
+#if OSSIM_HAS_HDF5
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying VIIRS...\n";
+      result = new ossimViirsHandler();
+      result->setOpenOverviewFlag(openOverview);
+      if (result->open(copyFilename))  break;
+#endif
+
+      result = 0;
+      break;
+   }
+
+   if (traceDebug())
+   {
+      if (result.valid())
+         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   SUCCESS" << std::endl;
+      else
+         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   Open FAILED" << std::endl;
+   }
+
+   return result.release();
+}
+
+ossimImageHandler* ossimImageHandlerFactory::open(const ossimKeywordlist& kwl,
+                                                  const char* prefix)const
+{
+   static const char* M = "ossimImageHandlerFactory::open(kwl,prefix) -- ";
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M <<" entered..." << std::endl;
+
+   ossimRefPtr<ossimImageHandler> result = 0;
+   while (true)
+   {
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying adrg...\n";
+      result = new ossimAdrgTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ccf...\n";
+      result  = new ossimCcfTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying CIB/CADRG...\n";
+      result  = new ossimCibCadrgTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "trying RpfCache...\n";
+      result  = new ossimRpfCacheTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "trying Rpf ImageCache...\n";
+      result  = new ossimImageCacheTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying DOQQ...\n";
+      result  = new ossimDoqqTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying DTED...\n";
+      result  = new ossimDtedTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying jpeg...\n";
+      result  = new ossimJpegTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Quickbird NITF...\n";
+      result = new ossimQuickbirdNitfTileSource;
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying Nitf...\n";
+      result  = new ossimNitfTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      // Must be before tiff...
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Quickbird TIFF...\n";
+      result = new ossimQuickbirdTiffTileSource;
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying tiff...\n";
+      result  = new ossimTiffTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying USGS Dem...\n";
+      result  = new ossimUsgsDemTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying Landsat...\n";
+      result  = new ossimLandsatTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying VPF...\n";
+      result = new ossimVpfTileSource;
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ERS...\n";
+      result = new ossimERSTileSource;
+      if (result->loadState(kwl, prefix))  break;
+
+      // Note:  ENVI should be in front of general raster...
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying ENVI...\n"<< std::endl;
+      result  = new ossimEnviTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      // Note:  SRTM should be in front of general raster...
+      if(traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << M<< "trying SRTM...\n"<< std::endl;
+      result  = new ossimSrtmTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << "trying General Raster...\n"<< std::endl;
+      result  = new ossimGeneralRasterTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"trying ossimQbTileFilesHandler...\n"<<std::endl;
+      result = new ossimQbTileFilesHandler;
+      if (result->loadState(kwl, prefix))  break;
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"trying ossimQbTileFilesHandler...\n"<<std::endl;
+      result = new ossimQbTileFilesHandler;
+      if (result->loadState(kwl, prefix))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying band-separated files...\n";
+      result = new ossimBandSeparateHandler();
+      if (result->loadState(kwl, prefix))  break;
+
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying Range Domes CSV...\n";
+      result = new ossimRangeDomeTileSource();
+      if (result->loadState(kwl, prefix))  break;
+
+#if OSSIM_HAS_HDF5
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying VIIRS...\n";
+      result = new ossimViirsHandler();
+      if (result->loadState(kwl, prefix))  break;
+#endif
+
+#ifdef ENABLE_POINT_CLOUD_HANDLER
+      if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "Trying ossimPointCloudImageHandler...\n";
+      result = new ossimPointCloudImageHandler();
+      if (result->loadState(kwl, prefix))  break;
+#endif
+      result = 0;
+      break;
+   }
+
+   if (traceDebug())
+   {
+      if (result.valid())
+         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   SUCCESS" << std::endl;
+      else
+         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   Open FAILED" << std::endl;
+   }
+
+   return result.release();
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactory::openOverview(
+   const ossimFilename& file ) const
+{
+   ossimRefPtr<ossimImageHandler> result = 0;
+   if ( file.size() )
+   {
+      result = new ossimTiffTileSource;
+      
+      result->setOpenOverviewFlag( false ); // Always false.
+
+      if ( result->open( file ) == false )
+      {
+         result = 0;
+      }
+   }
+   return result;
+}
+
+#if 0
+ossimImageHandler* ossimImageHandlerFactory::openFromExtension(const ossimFilename& fileName) const
+{
+   
+   static const char* M = "ossimImageHandlerFactory::openFromExtension() -- ";
+   if(traceDebug()) 
+      ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Attempting to open <"<<fileName<<">"<<std::endl;
+
+   ossimString ext = fileName.ext().downcase();
+   ossimRefPtr<ossimImageHandler> result = 0;
+   
+   
+   while (true)
+   {
+      // OVR can be combined with "tif" once we get rid of ossimQuickbirdTiffTileSource
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying OVR...\n";
+      if (ext == "ovr")
+      {
+         result = new ossimTiffTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying TIF or TIFF...\n";
+      if ( (ext == "tif") || (ext == "tiff") )
+      {
+         // this must be checked first before the TIFF handler
+         result = new ossimQuickbirdTiffTileSource;
+         if(result->open(fileName)) break;
+         result = new ossimTiffTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying NTF or NITF...\n";
+      if ( (ext == "ntf") || (ext == "nitf") )
+      {
+         // this must be checked first before the NITF raw handler
+         result = new ossimQuickbirdNitfTileSource;
+         if(result->open(fileName)) break;
+         result = new ossimNitfTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying RPF...\n";
+      if ( (fileName == "rpf"))
+      {
+         result = new ossimRpfCacheTileSource;
+         if(result->open(fileName)) break;
+
+         result = new ossimImagefCacheTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying TOC...\n";
+      if ( (fileName == "a.toc") || (ext == "toc"))
+      {
+         result = new ossimCibCadrgTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying JPG or JPEG...\n";
+      if ( (ext == "jpg") || (ext == "jpeg") )
+      {
+         result = new ossimJpegTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying DOQ or DOQQ...\n";
+      if ( (ext == "doq") || (ext == "doqq") )
+      {
+         result = new ossimDoqqTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying DTn...\n";
+      if ( (ext == "dt2") || (ext == "dt1") || (ext == "dt3") ||
+         (ext == "dt4") || (ext == "dt5") || (ext == "dt0") )
+      {
+         result = new ossimDtedTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying HGT...\n";
+      if (ext == "hgt")
+      {
+         result = new ossimSrtmTileSource;
+         if(result->open(fileName)) break;
+      }  
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying HRI,HSI\n";
+      if ( (ext == "hri") || (ext == "hsi") )
+      {
+         result = new ossimEnviTileSource;
+         if(result->open(fileName)) break;
+      }  
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying DEM...\n";
+      if (ext == "dem")
+      {
+         result = new ossimUsgsDemTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying FST...\n";
+      if (ext == "fst")
+      {
+         result = new ossimLandsatTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying RAS or RAW...\n";
+      if ( (ext == "ras") || (ext == "raw") )
+      {
+         result = new ossimGeneralRasterTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying IMG...\n";
+      if (ext == "img")
+      {
+         result  = new ossimAdrgTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying CCF...\n";
+      if (ext == "ccf")
+      {
+         result = new ossimCcfTileSource;
+         if(result->open(fileName)) break;
+      }
+
+      result = 0;
+      break;
+   }
+   if (traceDebug())
+   {
+      if (result.valid())
+         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   SUCCESS" << std::endl;
+      else
+         ossimNotify(ossimNotifyLevel_DEBUG)<<M<< "   Open FAILED" << std::endl;
+   }
+   return result.release();
+}
+#endif
+ossimObject* ossimImageHandlerFactory::createObject(const ossimString& typeName)const
+{
+   if(STATIC_TYPE_NAME(ossimAdrgTileSource) == typeName)
+   {
+      return new ossimAdrgTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimCcfTileSource) == typeName)
+   {
+      return new ossimCcfTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimCibCadrgTileSource) == typeName)
+   {
+      return new ossimCibCadrgTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimRpfCacheTileSource) == typeName)
+   {
+     return new ossimRpfCacheTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimImageCacheTileSource) == typeName)
+   {
+      return new ossimImageCacheTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimDoqqTileSource) == typeName)
+   {
+      return new ossimDoqqTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimDtedTileSource) == typeName)
+   {
+      return new ossimDtedTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimEnviTileSource) == typeName)
+   {
+      return new ossimEnviTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimJpegTileSource) == typeName)
+   {
+      return new ossimJpegTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimNitfTileSource) == typeName)
+   {
+      return new ossimNitfTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimTiffTileSource) == typeName)
+   {
+      return new ossimTiffTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimUsgsDemTileSource) == typeName)
+   {
+      return new ossimUsgsDemTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimLandsatTileSource) == typeName)
+   {
+      return new ossimLandsatTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimERSTileSource) == typeName)
+   {
+      return new ossimERSTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimSrtmTileSource) == typeName)
+   {
+      return new ossimSrtmTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimGeneralRasterTileSource) == typeName)
+   {
+      return new ossimGeneralRasterTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimQuickbirdNitfTileSource) == typeName)
+   {
+      return new ossimQuickbirdNitfTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimQbTileFilesHandler) == typeName)
+   {
+      return new ossimQbTileFilesHandler();
+   }
+   if(STATIC_TYPE_NAME(ossimBitMaskTileSource) == typeName)
+   {
+      return new ossimBitMaskTileSource();
+   }
+   if(STATIC_TYPE_NAME(ossimBandSeparateHandler) == typeName)
+   {
+      return new ossimBandSeparateHandler();
+   }
+   if(STATIC_TYPE_NAME(ossimRangeDomeTileSource) == typeName)
+   {
+      return new ossimRangeDomeTileSource();
+   }
+#if OSSIM_HAS_HDF5
+   if(STATIC_TYPE_NAME(ossimViirsHandler) == typeName)
+   {
+      return new ossimViirsHandler();
+   }
+#endif
+
+   #ifdef ENABLE_POINT_CLOUD_HANDLER
+   if(STATIC_TYPE_NAME(ossimPointCloudImageHandler) == typeName)
+   {
+      return new ossimPointCloudImageHandler();
+   }
+#endif
+   if(STATIC_TYPE_NAME(ossimImageHandlerMtAdaptor) == typeName)
+   {
+      return new ossimImageHandlerMtAdaptor();
+   }
+   
+   return (ossimObject*)0;
+}
+
+void ossimImageHandlerFactory::getSupportedExtensions(ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const
+{
+   extensionList.push_back("img");
+   extensionList.push_back("ccf"); 
+   extensionList.push_back("toc");
+   extensionList.push_back("tif");
+   extensionList.push_back("tiff");
+   extensionList.push_back("doq");
+   extensionList.push_back("doqq");
+   extensionList.push_back("dt0");
+   extensionList.push_back("dt1");
+   extensionList.push_back("dt2");
+   extensionList.push_back("dt3");
+   extensionList.push_back("jpg");
+   extensionList.push_back("jpeg");
+   extensionList.push_back("dem");
+   extensionList.push_back("fst");
+   extensionList.push_back("hdr");
+   extensionList.push_back("ras");
+   extensionList.push_back("hgt");
+   extensionList.push_back("nsf");
+   extensionList.push_back("nitf");
+   extensionList.push_back("ntf");
+   extensionList.push_back("til");
+   extensionList.push_back("mask");
+   extensionList.push_back("txt");
+   extensionList.push_back("csv");
+#if OSSIM_HAS_HDF5
+   extensionList.push_back("h5");
+#endif
+}
+
+void ossimImageHandlerFactory::getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& ext)const
+{
+   static const char* M = "ossimImageHandlerFactory::getImageHandlersBySuffix() -- ";
+   // OVR can be combined with "tif" once we get rid of ossimQuickbirdTiffTileSource
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Trying OVR...\n";
+   ossimString testExt = ext.downcase();
+   if (testExt == "ovr")
+   {
+      result.push_back(new ossimTiffTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TIF or TIFF...\n";
+   if ( (testExt == "tif") || (testExt == "tiff") )
+   {
+      // this must be checked first before the TIFF handler
+      result.push_back(new ossimQuickbirdTiffTileSource);
+      result.push_back(new ossimTiffTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing NTF or NITF...\n";
+   if ( (testExt == "ntf") || (testExt == "nitf") )
+   {
+      // this must be checked first before the NITF raw handler
+      result.push_back(new ossimQuickbirdNitfTileSource);
+      result.push_back(new ossimNitfTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing RPF...\n";
+   if ( (testExt == "rpf"))
+   {
+      result.push_back(new ossimRpfCacheTileSource);
+      result.push_back(new ossimImageCacheTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TOC...\n";
+   if ( testExt == "toc")
+   {
+      result.push_back(new ossimCibCadrgTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing JPG or JPEG...\n";
+   if ( (testExt == "jpg") || (testExt == "jpeg") )
+   {
+      result.push_back(new ossimJpegTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DOQ or DOQQ...\n";
+   if ( (testExt == "doq") || (testExt == "doqq") )
+   {
+      result.push_back(new ossimDoqqTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DTn...\n";
+   ossimString regExpStr = "dt[0-9]";
+   ossimRegExp regExp(regExpStr);
+   if(regExp.find(testExt))
+   {
+      result.push_back(new ossimDtedTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing HGT...\n";
+   if (testExt == "hgt")
+   {
+      result.push_back(new ossimSrtmTileSource);
+      return;
+   }  
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing HRI,HSI...\n";
+   if ( (testExt == "hri") || (testExt == "hsi") )
+   {
+      result.push_back(new ossimEnviTileSource);
+      return;
+   }  
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing DEM...\n";
+   if (testExt == "dem")
+   {
+      result.push_back(new ossimUsgsDemTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing FST...\n";
+   if (testExt == "fst")
+   {
+      result.push_back(new ossimLandsatTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing RAS or RAW or General Raster...\n";
+   if ( (testExt == "ras") || (testExt == "raw") || (testExt == "bil"))
+   {
+      result.push_back(new ossimGeneralRasterTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing IMG...\n";
+   if (testExt == "img")
+   {
+      result.push_back(new ossimAdrgTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing CCF...\n";
+   if (testExt == "ccf")
+   {
+      result.push_back(new ossimCcfTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TIL...\n";
+   if (testExt == "til")
+   {
+      result.push_back(new ossimQbTileFilesHandler);
+      return;
+   }
+
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing MASK...\n";
+   if (testExt == "mask")
+   {
+      result.push_back(new ossimBitMaskTileSource);
+      return;
+   }
+   
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing TXT...\n";
+   if (testExt == "txt")
+   {
+      result.push_back(new ossimBandSeparateHandler);
+      return;
+   }
+
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing CSV...\n";
+   if (testExt == "csv")
+   {
+      result.push_back(new ossimRangeDomeTileSource);
+      return;
+   }
+
+#if OSSIM_HAS_HDF5
+   if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)<<M<<"Testing VIIRS...\n";
+   if (testExt == "h5")
+   {
+      result.push_back(new ossimViirsHandler);
+      return;
+   }
+#endif
+
+}
+
+void ossimImageHandlerFactory::getImageHandlersByMimeType(ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const
+{
+   ossimString test(mimeType.begin(), mimeType.begin()+6);
+   if(test == "image/")
+   {
+      ossimString mimeTypeTest(mimeType.begin() + 6, mimeType.end());
+      getImageHandlersBySuffix(result, mimeTypeTest);
+      if(mimeTypeTest == "dted")
+      {
+         result.push_back(new ossimDtedTileSource);
+      }
+   }
+}
+
+ossimObject* ossimImageHandlerFactory::createObject(const ossimKeywordlist& kwl,
+                                                    const char* prefix)const
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageHandlerFactory::createObject(kwl, prefix) DEBUG:"
+         << " entering ..." << std::endl;
+   }
+   ossimObject* result = (ossimObject*)0;
+   const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+
+   if(type)
+   {
+      if (ossimString(type).trim() == STATIC_TYPE_NAME(ossimImageHandler))
+      {
+         const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+
+         if (lookup)
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG) << "BEBUG: filename " << lookup << std::endl;
+            }
+            // Call the open that takes a filename...
+            result = this->open(kwl, prefix);//ossimFilename(lookup));
+         }
+      }
+      else
+      {
+         result = createObject(ossimString(type));
+         if(result)
+         {
+            result->loadState(kwl, prefix);
+         }
+      }
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageHandlerFactory::createObject(kwl, prefix) DEBUG: returning result ..." << std::endl;
+   }
+   return result;
+}
+
+void ossimImageHandlerFactory::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   typeList.push_back(STATIC_TYPE_NAME(ossimAdrgTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimCcfTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimCibCadrgTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimEnviTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRpfCacheTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageCacheTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimDoqqTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimDtedTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimJpegTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimNitfTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimTiffTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimUsgsDemTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimLandsatTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimERSTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSrtmTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdNitfTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdTiffTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimQbTileFilesHandler));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBitMaskTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRangeDomeTileSource));
+
+#if OSSIM_HAS_HDF5
+   typeList.push_back(STATIC_TYPE_NAME(ossimViirsHandler));
+#endif
+
+#ifdef ENABLE_POINT_CLOUD_HANDLER
+   typeList.push_back(STATIC_TYPE_NAME(ossimPointCloudImageHandler));
+#endif
+
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageHandlerMtAdaptor));
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactory::openSrcRecord(
+   std::shared_ptr<ossim::istream>& str,
+   const std::string& connectionString,
+   bool openOverview ) const
+{
+   ossimRefPtr<ossimImageHandler> result = 0;
+   if(!str) return result;
+   // Check the extension for ".src" before going any further:
+   std::size_t found = connectionString.find( std::string(".src") );
+   if ( found != std::string::npos && ( found == (connectionString.size() - 4) ) )
+   {
+      ossimKeywordlist kwl;
+      if ( kwl.parseStream( *str ) )
+      {
+         // Right now only concidering one image, i.e. "image0":
+         std::string prefix = "image0.";
+         ossimSrcRecord src;
+         if ( src.loadState(kwl, prefix.c_str() ) )
+         {
+            if ( src.getFilename().string().size() )
+            {
+               // Avoid recursive loop:
+               if (src.getFilename().string() != connectionString )
+               {
+                  result = ossimImageHandlerRegistry::instance()->
+                     openConnection( src.getFilename(), false );
+                  
+                  if ( result.valid() )
+                  {
+                     ossimFilename supportDir = src.getSupportDir();
+                     if ( supportDir.empty() )
+                     {
+                        if ( src.getOverviewPath().size() )
+                        {
+                           if ( src.getOverviewPath().isDir() )
+                           {
+                              supportDir = src.getOverviewPath();
+                           }
+                           else
+                           {
+                              supportDir = src.getOverviewPath().path();
+                           }
+                        }
+                        else if ( src.getHistogramPath().size() )
+                        {
+                           if ( src.getHistogramPath().isDir() )
+                           {
+                              supportDir = src.getHistogramPath();
+                           }
+                           else
+                           {
+                              supportDir = src.getHistogramPath().path();
+                           }
+                        }
+                     }
+                     
+                     if ( supportDir.size() && (src.getFilename().path() != supportDir) )
+                     {
+                        result->setSupplementaryDirectory( supportDir );
+                     }
+
+                     if ( src.getEntryIndex() > 0 ) // defaulted to -1.
+                     {
+                        result->setCurrentEntry(
+                           static_cast<ossim_uint32>( src.getEntryIndex() ) );
+                     }
+                     
+                     if ( openOverview && ( result->getOverview() == 0 ) )
+                     {
+                        if ( src.getOverviewPath().size() )
+                        {
+                           result->openOverview( src.getOverviewPath() );
+                        }
+                        else
+                        {
+                           ossimFilename ovrFile = result->
+                              getFilenameWithThisExtension(ossimString(".ovr"));
+                           result->openOverview( ovrFile ); 
+                        }
+                     }
+                  }
+               }
+            }
+         }
+         
+      } // Matches: if ( kwl.parseStream( str ) )
+
+      if ( !result )
+      {
+         // Reset the stream for downstream code.
+         str->seekg(0, std::ios_base::beg);
+         str->clear();
+      }
+   }
+   return result;
+}
diff --git a/src/imaging/ossimImageHandlerFactoryBase.cpp b/src/imaging/ossimImageHandlerFactoryBase.cpp
new file mode 100644
index 0000000..25ff652
--- /dev/null
+++ b/src/imaging/ossimImageHandlerFactoryBase.cpp
@@ -0,0 +1,53 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  Garrett Potts (gpotts at imagelinks.com)
+//
+//*******************************************************************
+// $Id$
+
+#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
+
+RTTI_DEF1(ossimImageHandlerFactoryBase, "ossimImageHandlerFactoryBase", ossimObjectFactory);
+
+void ossimImageHandlerFactoryBase::getImageHandlersBySuffix(ImageHandlerList& /*result*/,
+                                                            const ossimString& /*ext*/)const
+{
+}
+
+void ossimImageHandlerFactoryBase::getImageHandlersByMimeType(ImageHandlerList& /*result*/,
+                                                              const ossimString& /*mimeType*/)const
+{
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactoryBase::openOverview(
+   const ossimFilename& /* file */ ) const
+{
+   return ossimRefPtr<ossimImageHandler>(0);
+}
+
+#if 0
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactoryBase::open(
+   ossim::istream* /* str */,
+   std::streamoff /* restartPosition */,
+   bool /* youOwnIt */ ) const
+{
+   return ossimRefPtr<ossimImageHandler>(0);
+}
+#endif
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactoryBase::open(
+   std::shared_ptr<ossim::istream>& /*str */,
+   const std::string& /* connectionString */,
+   bool /* openOverview */ ) const
+{
+   return ossimRefPtr<ossimImageHandler>(0);
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerFactoryBase::openOverview(
+   std::shared_ptr<ossim::istream>& /* str */,
+   const ossimString& /* connectionString */ ) const
+{
+   return ossimRefPtr<ossimImageHandler>(0);
+}
diff --git a/src/imaging/ossimImageHandlerRegistry.cpp b/src/imaging/ossimImageHandlerRegistry.cpp
new file mode 100644
index 0000000..774ebf0
--- /dev/null
+++ b/src/imaging/ossimImageHandlerRegistry.cpp
@@ -0,0 +1,391 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Contains class definition for ImageHandlerRegistry.
+//
+//*******************************************************************
+// $Id$
+
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerFactory.h>
+#include <ossim/imaging/ossimImageHandlerFactoryBase.h>
+#include <algorithm>
+
+RTTI_DEF1(ossimImageHandlerRegistry, "ossimImageHandlerRegistry", ossimObjectFactory);
+
+//ossimImageHandlerRegistry* ossimImageHandlerRegistry::theInstance = 0;
+
+ossimImageHandlerRegistry::ossimImageHandlerRegistry()
+{
+   ossimObjectFactoryRegistry::instance()->registerFactory(this);
+   registerFactory(ossimImageHandlerFactory::instance());
+}
+
+ossimImageHandlerRegistry* ossimImageHandlerRegistry::instance()
+{
+   static ossimImageHandlerRegistry sharedInstance;
+   
+   return &sharedInstance;
+}
+
+ossimImageHandlerRegistry::~ossimImageHandlerRegistry()
+{
+   unregisterAllFactories();
+}
+
+
+ossimObject* ossimImageHandlerRegistry::createObject(const ossimKeywordlist& kwl,
+                                                     const char* prefix)const
+{
+   ossimObject* result = createObjectFromRegistry(kwl, prefix);
+   if(!result)
+   {
+      result = open(kwl, prefix);
+   }
+   return result;
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::openBySuffix(const ossimFilename& file,
+                                                                       bool openOverview)const
+{
+   std::vector<ossimRefPtr<ossimImageHandler> > handlers;
+   
+   getImageHandlersBySuffix(handlers, file.ext());
+   ossim_uint32 idx = 0;
+   ossim_uint32 size = (ossim_uint32) handlers.size();
+   
+   for(idx = 0; idx < size; ++idx)
+   {
+      handlers[idx]->setOpenOverviewFlag(openOverview);
+      if(handlers[idx]->open(file))
+      {
+         return handlers[idx];
+      }
+   }
+   
+   return ossimRefPtr<ossimImageHandler>(0);
+}
+
+void ossimImageHandlerRegistry::getImageHandlersBySuffix(ossimImageHandlerFactoryBase::ImageHandlerList& result,
+                                                         const ossimString& ext)const
+{
+   vector<ossimImageHandlerFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   ossimImageHandlerFactoryBase::ImageHandlerList temp;
+   while(iter != m_factoryList.end())
+   {
+      temp.clear();
+      (*iter)->getImageHandlersBySuffix(temp, ext);
+      
+      if(!temp.empty())
+      {
+         
+         // now append to the end of the typeList.
+         result.insert(result.end(),
+                       temp.begin(),
+                       temp.end());
+      }
+      ++iter;
+   }
+}
+
+void ossimImageHandlerRegistry::getImageHandlersByMimeType(
+   ossimImageHandlerFactoryBase::ImageHandlerList& result, const ossimString& mimeType)const
+{
+   vector<ossimImageHandlerFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   ossimImageHandlerFactoryBase::ImageHandlerList temp;
+   while(iter != m_factoryList.end())
+   {
+      temp.clear();
+      (*iter)->getImageHandlersByMimeType(temp, mimeType);
+      
+      if(!temp.empty())
+      {
+         
+         // now append to the end of the typeList.
+         result.insert(result.end(),
+                       temp.begin(),
+                       temp.end());
+      }
+      ++iter;
+   }
+}
+
+void ossimImageHandlerRegistry::getTypeNameList( std::vector<ossimString>& typeList ) const
+{
+   getAllTypeNamesFromRegistry(typeList);
+}
+
+void ossimImageHandlerRegistry::getSupportedExtensions(
+   ossimImageHandlerFactoryBase::UniqueStringList& extensionList)const
+{
+   vector<ossimString> result;
+   vector<ossimImageHandlerFactoryBase*>::const_iterator iter = m_factoryList.begin();
+
+   while(iter != m_factoryList.end())
+   {
+      (*iter)->getSupportedExtensions(extensionList);
+
+      ++iter;
+   }
+   
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::openConnection(
+   const ossimString& connectionString, bool openOverview )const
+{
+   ossimRefPtr<ossimImageHandler> result(0);
+
+   std::string myConnectionString = connectionString.downcase().string();
+   std::string fileStr = "file://";
+   std::size_t found = myConnectionString.find( fileStr );
+   if ( found == 0 )
+   {
+      myConnectionString = connectionString.string().substr( fileStr.size() );
+   }
+   else
+   {
+      myConnectionString = connectionString.string();
+   }
+   
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( myConnectionString, std::ios_base::in|std::ios_base::binary);
+
+   if ( str )
+   {
+      result = open( str, myConnectionString, openOverview );
+   }
+
+   if ( result.valid() == false )
+   {
+      ossimFilename f = myConnectionString;
+      if ( f.exists() )
+      {
+         result = this->open( f, true, openOverview );
+      }
+   }
+   
+   return result;
+}
+
+ossimImageHandler* ossimImageHandlerRegistry::open(const ossimFilename& fileName,
+                                                   bool trySuffixFirst,
+                                                   bool openOverview)const
+{
+   if(trySuffixFirst)
+   {
+      ossimRefPtr<ossimImageHandler> h = openBySuffix(fileName, openOverview);
+      if(h.valid())
+      {
+         return h.release();
+      }
+   }
+   
+   // now try magic number opens
+   //
+   ossimImageHandler*                   result = NULL;
+   vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
+   while((factory != m_factoryList.end()) && !result)
+   {
+      result = (*factory)->open(fileName, openOverview);
+      ++factory;
+   }
+   
+   return result;
+}
+
+ossimImageHandler* ossimImageHandlerRegistry::open(const ossimKeywordlist& kwl,
+                                                   const char* prefix)const
+{
+   ossimImageHandler*                   result = NULL;
+   vector<ossimImageHandlerFactoryBase*>::const_iterator factory;
+   
+   factory = m_factoryList.begin();
+   while((factory != m_factoryList.end()) && !result)
+   {
+      result = (*factory)->open(kwl, prefix);
+      ++factory;
+   }
+   
+   return result;
+}
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::open(
+   std::shared_ptr<ossim::istream>& str,
+   const std::string& connectionString,
+   bool openOverview ) const
+{
+   ossimRefPtr<ossimImageHandler> result = 0;
+   if ( str )
+   {
+      vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
+      while( factory != m_factoryList.end() )
+      {
+         result = (*factory)->open( str, connectionString, openOverview );
+         if ( result.valid() )
+         {
+            break;
+         }
+         ++factory;
+      }
+   }
+   return result; 
+}
+
+#if 0
+ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::open( ossim::istream* str,
+                                                                std::streamoff restartPosition,
+                                                                bool youOwnIt ) const
+{
+   ossimRefPtr<ossimImageHandler> result = 0;
+   vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
+   while( factory != m_factoryList.end() )
+   {
+      result = (*factory)->open( str, restartPosition, youOwnIt );
+      if ( result.valid() )
+      {
+         break;
+      }
+      ++factory;
+   }  
+   return result; 
+}
+#endif
+
+ossimRefPtr<ossimImageHandler> ossimImageHandlerRegistry::openOverview(
+   const ossimFilename& file ) const
+{
+   ossimRefPtr<ossimImageHandler> result = 0;
+
+   // See if we can open via the stream interface:
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file, std::ios_base::in|std::ios_base::binary);
+   
+   if ( str )
+   {
+      std::vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
+      while( factory != m_factoryList.end() )
+      {
+         result = (*factory)->openOverview( str, file );
+         if ( result.valid() )
+         {
+            break;
+         }
+         ++factory;
+      }
+
+      str = 0;
+   }
+
+   if ( (result.valid() == false) && file.exists() )
+   {  
+      vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
+      while( factory != m_factoryList.end() )
+      {
+         result = (*factory)->openOverview( file );
+         if ( result.valid() )
+         {
+            break;
+         }
+         ++factory;
+      }
+   }
+   return result;
+}
+
+ossimObject* ossimImageHandlerRegistry::createObject(const ossimString& typeName) const
+{
+   return createObjectFromRegistry(typeName);
+}
+
+std::ostream& ossimImageHandlerRegistry::printReaderProps(std::ostream& out) const
+{
+   // Loop through factories:
+   vector<ossimImageHandlerFactoryBase*>::const_iterator factory = m_factoryList.begin();
+   while( factory != m_factoryList.end() )
+   {
+      out << "factory: " << (*factory)->getClassName() << "\n";
+      
+      // Loop through factory image handlers:
+      std::vector<ossimString> readerList;
+      (*factory)->getTypeNameList(readerList);
+
+      std::vector<ossimString>::const_iterator i = readerList.begin();
+      while ( i != readerList.end() )
+      {
+         ossimRefPtr<ossimImageHandler> ih =
+            dynamic_cast<ossimImageHandler*>( (*factory)->createObject( (*i) ) );
+         if ( ih.valid() )
+         {
+            out << "reader: " << ih->getClassName() << "\n";
+
+            // Loop through image handler properties:
+            std::vector<ossimString> propNames;
+            ih->getPropertyNames(propNames);
+            if ( propNames.size() )
+            {
+               out << "\nproperties:\n";
+               ossimRefPtr<ossimProperty> prop = 0;
+               std::vector<ossimString>::const_iterator p = propNames.begin();
+               while ( p != propNames.end() )
+               {
+                  out << "   " << (*p) << "\n";
+                  prop = ih->getProperty( *p );
+                  if ( prop.valid() )
+                  {
+                     ossimStringProperty* stringProp =
+                        dynamic_cast<ossimStringProperty*>(prop.get());
+                     if ( stringProp )
+                     {
+                        if ( stringProp->getConstraints().size() )
+                        {
+                           out << "      constraints:\n";
+                           std::vector<ossimString>::const_iterator strPropIter =
+                              stringProp->getConstraints().begin();
+                           while( strPropIter != stringProp->getConstraints().end() )
+                           {
+                              out << "         " << (*strPropIter) << "\n";
+                              ++strPropIter;
+                           }
+                        }
+                     }
+                  }
+                  
+                  ++p;
+               }
+               out << "\n";
+            }
+         }
+         ++i;
+      }
+      ++factory;
+   }
+   out << std::endl;
+   return out;
+}
+
+ossimImageHandlerRegistry::ossimImageHandlerRegistry(const ossimImageHandlerRegistry& /* rhs */)
+   :  ossimObjectFactory()
+{}
+
+const ossimImageHandlerRegistry&
+ossimImageHandlerRegistry::operator=(const ossimImageHandlerRegistry& rhs)
+{ return rhs; }
+
+extern "C"
+{
+  void* ossimImageHandlerRegistryGetInstance()
+  {
+    return ossimImageHandlerRegistry::instance();
+  }
+}
diff --git a/src/imaging/ossimImageHistogramSource.cpp b/src/imaging/ossimImageHistogramSource.cpp
new file mode 100644
index 0000000..1a5b40e
--- /dev/null
+++ b/src/imaging/ossimImageHistogramSource.cpp
@@ -0,0 +1,659 @@
+//*******************************************************************
+//
+// License:  See LICENSE.txt file in the top level directory.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageHistogramSource.cpp 22737 2014-04-16 18:53:57Z gpotts $
+
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceDebug("ossimImageHistogramSource:debug");
+
+  RTTI_DEF3(ossimImageHistogramSource, "ossimImageHistogramSource", ossimHistogramSource, ossimConnectableObjectListener, ossimProcessInterface);
+
+ossimImageHistogramSource::ossimImageHistogramSource(ossimObject* owner)
+   :ossimHistogramSource(owner,
+                         1,     // one input
+                         0,     // no outputs
+                         true,  // input list is fixed
+                         false),// output can still grow though
+    theHistogramRecomputeFlag(true),
+    theMaxNumberOfResLevels(1),
+    theComputationMode(OSSIM_HISTO_MODE_NORMAL)
+    // theNumberOfTilesToUseInFastMode(100)
+{
+   theAreaOfInterest.makeNan();
+   addListener((ossimConnectableObjectListener*)this);
+	
+   theMinValueOverride     = ossim::nan();
+   theMaxValueOverride     = ossim::nan();
+   theNumberOfBinsOverride = -1;
+}
+
+ossimImageHistogramSource::~ossimImageHistogramSource()
+{
+   removeListener((ossimConnectableObjectListener*)this);
+}
+
+ossimObject* ossimImageHistogramSource::getObject()
+{
+   return this;
+}
+
+const ossimObject* ossimImageHistogramSource::getObject()const
+{
+   return this;
+}
+
+void ossimImageHistogramSource::setAreaOfInterest(const ossimIrect& rect)
+{
+   if(rect != theAreaOfInterest)
+   {
+      theHistogramRecomputeFlag = true;
+   }
+   theAreaOfInterest = rect;
+}
+
+ossimIrect ossimImageHistogramSource::getAreaOfInterest()const
+{
+   return theAreaOfInterest;
+}
+
+void ossimImageHistogramSource::getAreaOfInterest(ossimIrect& rect)const
+{
+   rect = theAreaOfInterest;
+}
+
+ossim_uint32 ossimImageHistogramSource::getMaxNumberOfRLevels()const
+{
+   return theMaxNumberOfResLevels;
+}
+
+void ossimImageHistogramSource::setMaxNumberOfRLevels(ossim_uint32 number)
+{
+   if(number != theMaxNumberOfResLevels)
+   {
+      theHistogramRecomputeFlag = true;
+   }
+   theMaxNumberOfResLevels = number;
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimImageHistogramSource::getHistogram(const ossimIrect& rect)
+{
+   if((theAreaOfInterest != rect)||
+      (theAreaOfInterest.hasNans()))
+   {
+      theAreaOfInterest = rect;
+      theHistogramRecomputeFlag = true;
+   }
+	
+   return getHistogram();
+}
+
+bool ossimImageHistogramSource::execute()
+{
+   if(!isSourceEnabled())
+   {
+      return theHistogram.valid();
+   }
+   
+   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
+   if(theHistogramRecomputeFlag)
+   {
+      if(theAreaOfInterest.hasNans())
+      {
+         ossimImageSource* interface = PTR_CAST(ossimImageSource, getInput(0));
+         if(interface)
+         {
+            theAreaOfInterest = interface->getBoundingRect();
+         }
+      }
+
+      switch(theComputationMode)
+      {
+         case OSSIM_HISTO_MODE_FAST:
+         {
+            computeFastModeHistogram();
+            break;
+         }
+         case OSSIM_HISTO_MODE_NORMAL:
+         default:
+         {
+            computeNormalModeHistogram();
+            break;
+         }
+      }
+   }
+   
+   if (needsAborting())
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_ABORTED);
+      theHistogramRecomputeFlag = false;
+   }
+   else
+   {
+      setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
+   }
+   
+   return true;
+}
+
+bool ossimImageHistogramSource::canConnectMyInputTo(ossim_int32 myInputIndex,
+                                                    const ossimConnectableObject* object)const
+{
+   return ((myInputIndex==0)&&PTR_CAST(ossimImageSource,
+                                       object));
+}
+
+void ossimImageHistogramSource::setNumberOfBinsOverride(ossim_int32 numberOfBinsOverride)
+{
+   theNumberOfBinsOverride = numberOfBinsOverride;
+}
+
+void ossimImageHistogramSource::setMinValueOverride(ossim_float32 minValueOverride)
+{
+   theMinValueOverride = minValueOverride;
+}
+void ossimImageHistogramSource::setMaxValueOverride(ossim_float32 maxValueOverride)
+{
+   theMaxValueOverride = maxValueOverride;
+}
+
+ossimHistogramMode ossimImageHistogramSource::getComputationMode()const
+{
+   return theComputationMode;
+}
+
+void ossimImageHistogramSource::setComputationMode(ossimHistogramMode mode)
+{
+   theComputationMode = mode;
+}
+
+void ossimImageHistogramSource::propertyEvent(ossimPropertyEvent& /* event */)
+{
+   theHistogramRecomputeFlag = true;
+}
+
+void ossimImageHistogramSource::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+   theHistogramRecomputeFlag = true;
+}
+
+ossimRefPtr<ossimMultiResLevelHistogram> ossimImageHistogramSource::getHistogram()
+{
+   execute();
+   return theHistogram;
+}
+
+void ossimImageHistogramSource::getBinInformation(ossim_uint32& numberOfBins,
+                                                  ossim_float64& minValue,
+                                                  ossim_float64& maxValue,
+                                                  ossim_uint32 band)const
+{
+   numberOfBins = 0;
+   minValue     = 0;
+   maxValue     = 0;
+	
+   ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(0));
+   if(input)
+   {
+      minValue = input->getMinPixelValue(band);
+      maxValue = input->getMaxPixelValue(band);
+      switch(input->getOutputScalarType())
+      {
+         case OSSIM_UINT8:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UCHAR;
+            numberOfBins = 256;
+				
+            break;
+         }
+         case OSSIM_USHORT11:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT11;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT11 + 1;
+				
+            break;
+         }
+         case OSSIM_USHORT12:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT12;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT12 + 1;
+
+            break;
+         }
+         case OSSIM_USHORT13:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT13;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT13 + 1;
+
+            break;
+         }
+         case OSSIM_USHORT14:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT14;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT14 + 1;
+
+            break;
+         }
+         case OSSIM_USHORT15:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT15;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT15 + 1;
+
+            break;
+         }
+         case OSSIM_UINT16:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT16;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16 + 1;
+				
+            break;
+         }
+         case OSSIM_SINT16:
+         {
+            minValue     = OSSIM_DEFAULT_MIN_PIX_SINT16;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_SINT16;
+            numberOfBins = (OSSIM_DEFAULT_MAX_PIX_SINT16-OSSIM_DEFAULT_MIN_PIX_SINT16) + 1;
+            break;
+         }
+         case OSSIM_SINT32:
+         case OSSIM_UINT32:
+         {
+           numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
+           break;
+         }
+         case OSSIM_FLOAT32:
+         case OSSIM_FLOAT64:
+         {
+				numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
+            break;
+         }
+         case OSSIM_NORMALIZED_FLOAT:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            minValue     = 0;
+            maxValue     = 1.0;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
+            break;
+         }
+         default:
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "Unsupported scalar type in ossimImageHistogramSource::computeHistogram()" << endl;
+            }
+            return;
+         }
+      }
+   }
+	
+   if(ossim::isnan(theMinValueOverride) == false)
+   {
+      minValue = (float)theMinValueOverride;
+   }
+   if(ossim::isnan(theMaxValueOverride) == false)
+   {
+      maxValue = (float)theMaxValueOverride;
+   }
+   if(theNumberOfBinsOverride > 0)
+   {
+      numberOfBins = theNumberOfBinsOverride;
+   }
+}
+
+void ossimImageHistogramSource::computeNormalModeHistogram()
+{
+   // ref ptr, not a leak.
+   theHistogram = new ossimMultiResLevelHistogram;
+	
+   ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(0));
+   if(!input)
+   {
+      setPercentComplete(100.0);
+      return;
+   }
+   
+   if(getInput(0))
+   {
+      // sum up all tiles needing processing.  We will use the sequencer.
+      //      ossim_uint32 numberOfResLevels = input->getNumberOfDecimationLevels();
+      ossim_uint32 index = 0;
+      double tileCount   = 0.0;
+      double totalTiles  = 0.0;
+      ossim_uint32 numberOfBands = input->getNumberOfOutputBands();
+      ossim_uint32 numberOfBins  = 0;
+      ossim_float64 minValue     = 0;
+      ossim_float64 maxValue     = 0;
+      getBinInformation(numberOfBins, minValue, maxValue, 0);
+		
+      ossimRefPtr<ossimImageSourceSequencer> sequencer = new ossimImageSourceSequencer;
+      sequencer->connectMyInputTo(0, getInput(0));
+      sequencer->initialize();
+      
+      vector<ossimDpt> decimationFactors;
+      input->getDecimationFactors(decimationFactors);
+      if ( !decimationFactors.size() )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimImageHistogramSource::computeNormalModeHistogram WARNING:"
+            << "\nNo decimation factors from input.  returning..." << std::endl;
+         return;
+      }
+      
+      ossim_uint32 resLevelsToCompute = ossim::min((ossim_uint32)theMaxNumberOfResLevels,
+                                                   (ossim_uint32)decimationFactors.size());
+         
+      if( decimationFactors.size() < theMaxNumberOfResLevels)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "Number Decimations is smaller than the request number of r-levels defaulting to the smallest of the 2 numbers" << endl;
+      }
+
+      theHistogram->create(resLevelsToCompute);
+      for(index = 0; index < resLevelsToCompute; ++index)
+      {
+         sequencer->setAreaOfInterest(theAreaOfInterest*decimationFactors[index]);
+         
+         totalTiles += sequencer->getNumberOfTiles();
+      }
+      
+      
+      if(numberOfBins > 0)
+      {
+         setPercentComplete(0.0);
+         for(index = 0;
+             (index < resLevelsToCompute);
+             ++index)
+         {
+            // Check for abort request.
+            if (needsAborting())
+            {
+               setPercentComplete(100);
+               break;
+            }
+            
+            //sequencer->setAreaOfInterest(input->getBoundingRect(index));
+            sequencer->setAreaOfInterest(theAreaOfInterest*decimationFactors[index]);
+            
+            sequencer->setToStartOfSequence();
+            
+            theHistogram->getMultiBandHistogram(index)->create(numberOfBands,
+                                                               numberOfBins,
+                                                               minValue,
+                                                               maxValue);
+            
+            ossimRefPtr<ossimImageData> data = sequencer->getNextTile(index);
+            ++tileCount;
+            setPercentComplete((100.0*(tileCount/totalTiles)));
+            
+            ossim_uint32 resLevelTotalTiles = sequencer->getNumberOfTiles();
+            for (ossim_uint32 resLevelTileCount = 0;
+                 resLevelTileCount < resLevelTotalTiles;
+                 ++resLevelTileCount)
+            {
+               if(data.valid()&&data->getBuf()&&(data->getDataObjectStatus() != OSSIM_EMPTY))
+               {
+                  data->populateHistogram(theHistogram->getMultiBandHistogram(index));
+               }
+               
+               // Check for abort request.
+               if (needsAborting())
+               {
+                  setPercentComplete(100);
+                  break;
+               }
+               
+               
+               data = sequencer->getNextTile(index);
+               ++tileCount;
+               setPercentComplete((100.0*(tileCount/totalTiles)));
+            }
+         }
+      }
+      sequencer->disconnect();
+      sequencer = 0;
+   }
+}
+
+void ossimImageHistogramSource::computeFastModeHistogram()
+{
+   // Compute at most 9 x 9 tiles of 16 x 16 tile size. 
+
+   ossim_uint32 resLevelsToCompute = 1;
+	
+   // ref ptr, not a leak.
+   theHistogram = new ossimMultiResLevelHistogram;
+   theHistogram->create(resLevelsToCompute);
+   ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(0));
+   if(!input)
+   {
+      setPercentComplete(100.0);
+      return;
+   }
+   // sum up all tiles needing processing.  We will use the sequencer.
+   //      ossim_uint32 numberOfResLevels = input->getNumberOfDecimationLevels();
+   double tileCount   = 0.0;
+   double totalTiles  = 0.0;
+   ossim_uint32 numberOfBands = input->getNumberOfOutputBands();
+   ossim_uint32 numberOfBins  = 0;
+   ossim_float64 minValue     = 0;
+   ossim_float64 maxValue     = 0;
+   getBinInformation(numberOfBins, minValue, maxValue, 0);
+
+   // Fixed 16 x 16 tile size:
+   ossimIpt tileSize( 16, 16 );
+
+   ossimIrect tileBoundary = theAreaOfInterest;
+   tileBoundary.stretchToTileBoundary(tileSize);
+
+   // Max of 9 x 9 tiles accross the image.
+   const ossim_uint32 MAX_TILES_WIDE = 9;
+
+   ossim_uint32 tilesWide = ossim::min( (ossim_uint32)(tileBoundary.width()/tileSize.x),
+                                        MAX_TILES_WIDE);
+   ossim_uint32 tilesHigh = ossim::min( (ossim_uint32)(tileBoundary.height()/tileSize.y),
+                                        MAX_TILES_WIDE);
+
+   totalTiles = tilesWide*tilesHigh;
+
+   if(numberOfBins > 0)
+   {
+      ossimIpt origin = theAreaOfInterest.ul();
+		
+      ossim_uint32 xTileOffset = tileBoundary.width()  / tilesWide;
+      ossim_uint32 yTileOffset = tileBoundary.height() / tilesHigh;
+
+      theHistogram->getMultiBandHistogram(0)->create(numberOfBands,
+                                                     numberOfBins,
+                                                     minValue,
+                                                     maxValue);	
+      ossim_uint32 x = 0;
+      ossim_uint32 y = 0;
+      tileCount = 0;
+      totalTiles = tilesWide*tilesHigh;
+      
+      for(y = 0; y < tilesHigh; ++y)
+      {
+         for(x = 0; x < tilesWide; ++x)
+         {
+            ossimIpt ul( origin.x + (x*xTileOffset), origin.y + (y*yTileOffset) );
+            ossimIrect tileRect(ul.x, ul.y, ul.x + tileSize.x-1, ul.y + tileSize.y-1);
+
+            ossimRefPtr<ossimImageData> data = input->getTile(tileRect);
+				
+            if(data.valid()&&data->getBuf()&&(data->getDataObjectStatus() != OSSIM_EMPTY))
+            {
+               data->populateHistogram(theHistogram->getMultiBandHistogram(0));
+            }
+
+            // Check for abort request.
+            if (needsAborting())
+            {
+               break;
+            }
+            
+            ++tileCount;
+         }
+
+         // Check for abort request.
+         if (needsAborting())
+         {
+            setPercentComplete(100);
+            break; 
+         }
+         
+         setPercentComplete((100.0*(tileCount/totalTiles)));
+      }
+   }
+
+#if 0  /* drb - old code was not working... */
+   
+   // We will only compute a full res histogram in fast mode.  and will only do a MAX of 100 tiles.
+   //
+   ossim_uint32 resLevelsToCompute = 1;
+	
+   // ref ptr, not a leak.
+   theHistogram = new ossimMultiResLevelHistogram;
+   theHistogram->create(resLevelsToCompute);
+   ossimImageSource* input = PTR_CAST(ossimImageSource, getInput(0));
+   if(!input)
+   {
+      setPercentComplete(100.0);
+      return;
+   }
+   // sum up all tiles needing processing.  We will use the sequencer.
+   //      ossim_uint32 numberOfResLevels = input->getNumberOfDecimationLevels();
+   double tileCount   = 0.0;
+   double totalTiles  = 0.0;
+   ossim_uint32 numberOfBands = input->getNumberOfOutputBands();
+   ossim_uint32 numberOfBins  = 0;
+   ossim_float64 minValue     = 0;
+   ossim_float64 maxValue     = 0;
+   getBinInformation(numberOfBins, minValue, maxValue, 0);
+	
+   ossimIrect tileBoundary = theAreaOfInterest;
+   // ossimIpt tileSize(ossim::max((ossim_uint32)input->getTileWidth(), (ossim_uint32)64),
+   //                   ossim::max((ossim_uint32)input->getTileHeight(), (ossim_uint32)64));
+
+   ossimIpt tileSize(ossim::max<ossim_uint32>(input->getTileWidth(), (ossim_uint32)64),
+                     ossim::max((ossim_uint32)input->getTileHeight(), (ossim_uint32)64));
+	
+   tileBoundary.stretchToTileBoundary(tileSize);
+   ossim_uint32 tilesWide = (tileBoundary.width()/tileSize.x);
+   ossim_uint32 tilesHigh = (tileBoundary.height()/tileSize.y);
+   totalTiles = tilesWide*tilesHigh;
+   
+   if(totalTiles > theNumberOfTilesToUseInFastMode)
+   {
+      ossim_uint32 testTiles = (ossim_uint32) (std::sqrt((double)theNumberOfTilesToUseInFastMode)+.5);
+      tilesWide = testTiles>tilesWide?tilesWide:testTiles;
+      tilesHigh = testTiles>tilesHigh?tilesHigh:testTiles;
+   }
+   if(numberOfBins > 0)
+   {
+      ossimIpt origin = theAreaOfInterest.ul();
+		
+      ossim_uint32 widthWithExcess  = (ossim_uint32)(((ossim_float64)tileBoundary.width()/(tilesWide*tileSize.x))*tileSize.x);
+      ossim_uint32 heightWithExcess = ((ossim_uint32)((ossim_float64)tileBoundary.height()/(tilesHigh*tileSize.y))*tileSize.y);
+      theHistogram->getMultiBandHistogram(0)->create(numberOfBands,
+                                                     numberOfBins,
+                                                     minValue,
+                                                     maxValue);
+		
+      ossim_uint32 x = 0;
+      ossim_uint32 y = 0;
+      tileCount = 0;
+      totalTiles = tilesWide*tilesHigh;
+      for(y = 0; y < tilesHigh; ++y)
+      {
+         for(x = 0; x < tilesWide; ++x)
+         {
+            ossimIpt ul(origin.x + (x*widthWithExcess),
+                        origin.y + (y*heightWithExcess));
+            ossimIrect tileRect(ul.x, ul.y, ul.x + tileSize.x-1, ul.y + tileSize.y-1);
+            ossimRefPtr<ossimImageData> data = input->getTile(tileRect);
+				
+            if(data.valid()&&data->getBuf()&&(data->getDataObjectStatus() != OSSIM_EMPTY))
+            {
+               data->populateHistogram(theHistogram->getMultiBandHistogram(0));
+            }
+            ++tileCount;
+            setPercentComplete((100.0*(tileCount/totalTiles)));
+         }
+      }
+   }
+
+#endif
+}
+
+bool ossimImageHistogramSource::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   ossimHistogramSource::loadState(kwl, prefix);  
+   setNumberOfInputs(2);
+   ossimString rect = kwl.find(prefix, "rect");
+
+   if(!rect.empty())
+   {
+      loadState(kwl, prefix);
+   }
+   else 
+   {
+      ossimString newPrefix = ossimString(prefix) + "area_of_interest.";
+      theAreaOfInterest.loadState(kwl, newPrefix);
+   }
+   
+   ossimString mode = kwl.find(prefix, "mode");
+   mode = mode.downcase();
+   if(mode == "normal")
+   {
+      theComputationMode = OSSIM_HISTO_MODE_NORMAL;
+   }
+   else if(mode == "fast")
+   {
+      theComputationMode = OSSIM_HISTO_MODE_FAST;
+   }
+   if(getNumberOfInputs()!=1)
+   {
+      setNumberOfInputs(1);
+   }
+   
+   // ossimString numberOfTiles = kwl.find(prefix, "number_of_tiles");
+   // if(!numberOfTiles.empty())
+   // {
+   //    theNumberOfTilesToUseInFastMode = numberOfTiles.toUInt32();
+   // }
+
+   theInputListIsFixedFlag = true;
+   theOutputListIsFixedFlag = false;
+	
+   return true;
+}
+
+bool ossimImageHistogramSource::saveState(ossimKeywordlist& kwl,
+                                          const char* prefix)const
+{
+   bool result = ossimHistogramSource::saveState(kwl, prefix);
+   if(result)
+   {
+      ossimString newPrefix = ossimString(prefix) + "area_of_interest.";
+      theAreaOfInterest.saveState(kwl, newPrefix);
+   }
+   return result;
+}
diff --git a/src/imaging/ossimImageMetaData.cpp b/src/imaging/ossimImageMetaData.cpp
new file mode 100644
index 0000000..87fc1e5
--- /dev/null
+++ b/src/imaging/ossimImageMetaData.cpp
@@ -0,0 +1,571 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file.
+// 
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Contains class definition for ossimImageMetaData.
+// 
+//*******************************************************************
+//  $Id: ossimImageMetaData.cpp 21745 2012-09-16 15:21:53Z dburken $
+
+#include <ossim/imaging/ossimImageMetaData.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimTrace.h>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+static ossimTrace traceDebug("ossimImageMetaData:debug");
+
+ossimImageMetaData::ossimImageMetaData()
+   :theNullPixelArray(0),
+    theMinPixelArray(0),
+    theMaxPixelArray(0),
+    theMinValuesValidFlag(false),
+    theMaxValuesValidFlag(false),
+    theNullValuesValidFlag(false),
+    theScalarType(OSSIM_SCALAR_UNKNOWN),
+    theBytesPerPixel(0),
+    theNumberOfBands(0),
+    theRgbBands()
+{
+}
+
+ossimImageMetaData::ossimImageMetaData(ossimScalarType aType,
+				       ossim_uint32 numberOfBands)
+   :theNullPixelArray(0),
+    theMinPixelArray(0),
+    theMaxPixelArray(0),
+    theMinValuesValidFlag(false),
+    theMaxValuesValidFlag(false),
+    theNullValuesValidFlag(false),
+    theScalarType(aType),
+    theBytesPerPixel(0),
+    theNumberOfBands(numberOfBands),
+    theRgbBands()
+{
+   if(theNumberOfBands)
+   {
+      theNullPixelArray = new double[theNumberOfBands];
+      theMinPixelArray  = new double[theNumberOfBands];
+      theMaxPixelArray  = new double[theNumberOfBands];
+      
+      setDefaultsForArrays();
+   }
+   theBytesPerPixel = ossim::scalarSizeInBytes( aType );
+}
+
+ossimImageMetaData::ossimImageMetaData(const ossimImageMetaData& rhs)
+   :
+   theNullPixelArray(0),
+   theMinPixelArray(0),
+   theMaxPixelArray(0),
+   theMinValuesValidFlag(rhs.theMinValuesValidFlag),
+   theMaxValuesValidFlag(rhs.theMaxValuesValidFlag),
+   theNullValuesValidFlag(rhs.theNullValuesValidFlag),
+   theScalarType(rhs.theScalarType),
+   theBytesPerPixel(rhs.theBytesPerPixel),
+   theNumberOfBands(rhs.theNumberOfBands),
+   theRgbBands(rhs.theRgbBands)
+{
+   if(theNumberOfBands)
+   {
+      theNullPixelArray = new double[theNumberOfBands];
+      theMinPixelArray  = new double[theNumberOfBands];
+      theMaxPixelArray  = new double[theNumberOfBands];
+      
+      std::copy(rhs.theNullPixelArray,
+                rhs.theNullPixelArray+theNumberOfBands,
+                theNullPixelArray);
+      std::copy(rhs.theMinPixelArray,
+                rhs.theMinPixelArray+theNumberOfBands,
+                theMinPixelArray);
+      std::copy(rhs.theMaxPixelArray,
+                rhs.theMaxPixelArray+theNumberOfBands,
+                theMaxPixelArray);
+   }
+}
+
+const ossimImageMetaData& ossimImageMetaData::operator=( const ossimImageMetaData& rhs )
+{
+   if( this != &rhs )
+   {
+      clear();
+      theMinValuesValidFlag  = rhs.theMinValuesValidFlag;
+      theMaxValuesValidFlag  = rhs.theMaxValuesValidFlag;
+      theNullValuesValidFlag = rhs.theNullValuesValidFlag;
+      theNumberOfBands       = rhs.theNumberOfBands;
+      theScalarType          = rhs.theScalarType;
+      theBytesPerPixel       = rhs.theBytesPerPixel;
+      if(theNumberOfBands)
+      {
+         theNullPixelArray = new double[theNumberOfBands];
+         theMinPixelArray  = new double[theNumberOfBands];
+         theMaxPixelArray  = new double[theNumberOfBands];
+         
+         std::copy(rhs.theNullPixelArray,
+                   rhs.theNullPixelArray+theNumberOfBands,
+                   theNullPixelArray);
+         std::copy(rhs.theMinPixelArray,
+                   rhs.theMinPixelArray+theNumberOfBands,
+                   theMinPixelArray);
+         std::copy(rhs.theMaxPixelArray,
+                   rhs.theMaxPixelArray+theNumberOfBands,
+                   theMaxPixelArray);
+      }
+      theRgbBands = rhs.theRgbBands;
+   }
+   return *this;
+}
+
+ossimImageMetaData::~ossimImageMetaData()
+{
+  clear();
+}
+
+void ossimImageMetaData::clear()
+{
+   if(theNullPixelArray)
+   {
+      delete [] theNullPixelArray;
+      theNullPixelArray = 0;
+   }
+   if(theMinPixelArray)
+   {
+      delete [] theMinPixelArray;
+      theMinPixelArray = 0;
+   }
+   if(theMaxPixelArray)
+   {
+      delete [] theMaxPixelArray;
+      theMaxPixelArray = 0;
+   }
+   theScalarType    = OSSIM_SCALAR_UNKNOWN;
+   theBytesPerPixel = 0;
+   theNumberOfBands = 0;
+   theRgbBands.clear();
+}
+
+void ossimImageMetaData::setDefaultsForArrays()
+{
+   ossim_uint32 i=0;
+   
+   for(i = 0; i < theNumberOfBands; ++i)
+   {
+      theNullPixelArray[i] = ossim::defaultNull(theScalarType);
+      theMinPixelArray[i]  = ossim::defaultMin(theScalarType);
+      theMaxPixelArray[i]  = ossim::defaultMax(theScalarType);
+   }
+}
+
+void ossimImageMetaData::setNumberOfBands(ossim_uint32 numberOfBands)
+{
+   if(theNullPixelArray)
+   {
+      delete [] theNullPixelArray;
+      theNullPixelArray = 0;
+   }
+   if(theMinPixelArray)
+   {
+      delete [] theMinPixelArray;
+      theMinPixelArray = 0;
+   }
+   if(theMaxPixelArray)
+   {
+      delete [] theMaxPixelArray;
+      theMaxPixelArray = 0;
+   }
+   
+   theNumberOfBands = numberOfBands;
+
+   if(theNumberOfBands)
+   {
+      theNullPixelArray = new double[theNumberOfBands];
+      theMinPixelArray  = new double[theNumberOfBands];
+      theMaxPixelArray  = new double[theNumberOfBands];
+   
+      setDefaultsForArrays();
+   }
+}
+
+bool ossimImageMetaData::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool result = false; // return status
+   
+   // Clear the object:
+   clear();
+
+   std::string pfx = ( prefix ? prefix : "" );
+   
+   theRgbBands = kwl.findKey( pfx, std::string("rgb_bands") );
+   
+   ossim_uint32 bands = getBandCount( kwl, pfx );
+   if ( bands )
+   {
+      result = true;
+      
+      setNumberOfBands( bands );
+      
+      theMinValuesValidFlag  = true;
+      theMaxValuesValidFlag  = true;
+      theNullValuesValidFlag = true;
+
+      updateMetaData( kwl, pfx ); // Initializes the rest of object.
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << " ERROR:\n"
+            << "Required keyword not found:  " << ossimKeywordNames::NUMBER_BANDS_KW << std::endl;
+      }
+   }
+   
+   if (traceDebug())
+   {
+      print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+
+   return result;
+}
+
+bool ossimImageMetaData::saveState(ossimKeywordlist& kwl,
+				   const char* prefix)const
+{
+   if ( theNumberOfBands )
+   {
+      ossim_uint32 band = 0;
+      
+      for (band=0; band < theNumberOfBands; ++band)
+      {
+         ossimString kwMin = (ossimKeywordNames::BAND_KW +
+                              ossimString::toString(band+1) + "." +
+                              ossimKeywordNames::MIN_VALUE_KW);
+         ossimString kwMax = (ossimKeywordNames::BAND_KW +
+                              ossimString::toString(band+1) + "." +
+                              ossimKeywordNames::MAX_VALUE_KW);
+         ossimString kwNull = (ossimKeywordNames::BAND_KW +
+                               ossimString::toString(band+1) + "." +
+                               ossimKeywordNames::NULL_VALUE_KW);
+         
+         kwl.add(prefix,
+                 kwMin.c_str(),
+                 theMinPixelArray[band],
+                 true);
+         kwl.add(prefix,
+                 kwMax.c_str(),
+                 theMaxPixelArray[band],
+                 true);
+         kwl.add(prefix,
+                 kwNull.c_str(),
+                 theNullPixelArray[band],
+                 true);
+      }
+      // std::cout << "added bands ******************" << std::endl;
+      kwl.add(prefix,
+	      ossimKeywordNames::NUMBER_BANDS_KW,
+	      theNumberOfBands,
+	      true);
+      kwl.add(prefix,
+	      ossimKeywordNames::SCALAR_TYPE_KW,
+	      (ossimScalarTypeLut::instance()->getEntryString(theScalarType)),
+	      true);
+
+      kwl.add( prefix, "bytes_per_pixel", theBytesPerPixel, true );
+   }
+
+   if ( theRgbBands.size() )
+   {
+      kwl.add( prefix, "rgb_bands", theRgbBands.c_str(), true );
+   }   
+
+   return true;
+}
+
+ossim_uint32 ossimImageMetaData::getNumberOfBands()const
+{
+   return theNumberOfBands;
+}
+
+const std::string& ossimImageMetaData::getRgbBands() const
+{
+   return theRgbBands;
+}
+
+bool ossimImageMetaData::getRgbBands(std::vector<ossim_uint32>& bandList) const
+{
+   bool result = false;
+   if ( ( theNumberOfBands > 2) && theRgbBands.size() )
+   {
+      ossim::toSimpleVector( bandList, ossimString(theRgbBands) );
+      if ( bandList.size() == 3 )
+      {
+         result = true;
+      }
+      else
+      {
+         bandList.clear();
+      }
+   }
+   return result;
+}
+
+void ossimImageMetaData::setScalarType(ossimScalarType aType)
+{
+   theScalarType    = aType;
+   theBytesPerPixel = ossim::scalarSizeInBytes( aType );
+}
+
+ossimScalarType ossimImageMetaData::getScalarType()const
+{
+   return theScalarType;
+}
+
+ossim_uint32 ossimImageMetaData::getBytesPerPixel() const
+{
+   return theBytesPerPixel;
+}
+
+void ossimImageMetaData::setMinPix(ossim_uint32 band, double pix)
+{
+   if((band < theNumberOfBands)&&(theMinPixelArray))
+   {
+      theMinPixelArray[band] = pix;
+   }
+}
+
+void ossimImageMetaData::setMaxPix(ossim_uint32 band, double pix)
+{
+   if((band < theNumberOfBands) && theMaxPixelArray)
+   {
+      theMaxPixelArray[band] = pix;
+   }
+}
+
+void ossimImageMetaData::setNullPix(ossim_uint32 band, double pix)
+{
+   if((band < theNumberOfBands)&&(theNullPixelArray))
+   {
+      theNullPixelArray[band] = pix;
+   }
+}
+
+double ossimImageMetaData::getMinPix(ossim_uint32 band)const
+{
+   if(theNumberOfBands&&theMinPixelArray)
+   {
+      ossim_uint32 i = ossim::min(band, (ossim_uint32)(theNumberOfBands-1));
+      
+      return theMinPixelArray[i];
+   }
+   return ossim::defaultMin(theScalarType);
+}
+
+double ossimImageMetaData::getMaxPix(ossim_uint32 band)const
+{
+   if(theNumberOfBands&&theMaxPixelArray)
+   {
+      ossim_uint32 i = ossim::min(band, (ossim_uint32)(theNumberOfBands-1));
+      
+      return theMaxPixelArray[i];
+   }
+   return ossim::defaultMax(theScalarType);
+}
+
+double ossimImageMetaData::getNullPix(ossim_uint32 band)const
+{
+   if(theNumberOfBands&&theNullPixelArray)
+   {
+      ossim_uint32 i = ossim::min(band, (ossim_uint32)(theNumberOfBands-1));
+      
+      return theNullPixelArray[i];
+   }
+   return ossim::defaultNull(theScalarType);
+}
+
+const double* ossimImageMetaData::getMinPixelArray()const
+{
+   return theMinPixelArray;
+}
+const double* ossimImageMetaData::getMaxPixelArray()const
+{
+   return theMaxPixelArray;
+}
+
+const double* ossimImageMetaData::getNullPixelArray()const
+{
+   return theNullPixelArray;
+}
+
+void ossimImageMetaData::setMinValuesValid(bool flag)
+{
+   theMinValuesValidFlag = flag;
+}
+
+void ossimImageMetaData::setMaxValuesValid(bool flag)
+{
+   theMaxValuesValidFlag = flag;
+}
+
+void ossimImageMetaData::setNullValuesValid(bool flag)
+{
+   theNullValuesValidFlag = flag;
+}
+
+bool ossimImageMetaData::getMinValuesValidFlag()const
+{
+   return theMinValuesValidFlag;
+}
+
+bool ossimImageMetaData::getMaxValuesValidFlag()const
+{
+   return theMaxValuesValidFlag;
+}
+
+bool ossimImageMetaData::getNullValuesValidFlag()const
+{
+   return theNullValuesValidFlag;
+}
+
+bool ossimImageMetaData::isValid()const
+{
+   return (theNumberOfBands > 0);
+//    return ((theNumberOfBands>0)&&
+//            (theScalarType != OSSIM_SCALAR_UNKNOWN));
+}
+
+void ossimImageMetaData::updateMetaData(
+   const ossimKeywordlist& kwl, const std::string& prefix )
+{
+   ossimString value;
+   std::string key;
+   
+   // Get the bands:
+   if ( !theNumberOfBands )
+   {
+      ossim_uint32 bands = getBandCount( kwl, prefix );
+      if ( bands )
+      {
+         setNumberOfBands( bands );
+      }
+   }
+
+   if ( theNumberOfBands )
+   {
+      //---
+      // See if bands are zero or one based.  Bands are ONE based in the "omd"
+      // file! If band0 is present assume zero based.
+      //---
+
+      ossimString regExpression = std::string("^(") + prefix + std::string("band0+.)");
+      std::vector<ossimString> keys = kwl.getSubstringKeyList( regExpression );
+
+      ossim_uint32 startBand = (keys.size() ? 0 : 1);
+
+      ossim_uint32 limit = theNumberOfBands+startBand; // For for loop:
+      
+      std::string bs = "band"; // band sting
+      std::string base;
+      
+      for ( ossim_uint32 band = startBand; band < limit; ++band )
+      {
+         base = bs + ossimString::toString( band ).string() + std::string(".") ;
+
+         // Min:
+         key = base + std::string(ossimKeywordNames::MIN_VALUE_KW);
+         value =  kwl.findKey( prefix, key );
+         
+         if ( value.size() )
+         {
+            theMinPixelArray[ band - startBand  ] = value.toFloat64();
+         }
+
+         // Max:
+         key = base + std::string(ossimKeywordNames::MAX_VALUE_KW);
+         value =  kwl.findKey( prefix, key );
+         if ( value.size() )
+         {
+            theMaxPixelArray[ band - startBand ] = value.toFloat64();
+         }
+
+         // Null:
+         key = base + std::string(ossimKeywordNames::NULL_VALUE_KW);
+         value =  kwl.findKey( prefix, key );
+         if ( value.size() )
+         {
+            theNullPixelArray[ band - startBand ] = value.toFloat64();
+         }
+      }
+   }
+
+   
+   // Scalar, only look for if not set.
+   if ( theScalarType == OSSIM_SCALAR_UNKNOWN )
+   {
+      key = ossimKeywordNames::SCALAR_TYPE_KW; // "scalar_type"
+      value.string() = kwl.findKey( prefix, key );
+      if ( value.empty() )
+      {
+         key = "radiometry";
+         value.string() = kwl.findKey( prefix, key );
+      }
+      if ( value.size() )
+      {
+         theScalarType = ossimScalarTypeLut::instance()->getScalarTypeFromString( value );
+      }
+      
+      if ( theScalarType != OSSIM_SCALAR_UNKNOWN )
+      {
+         theBytesPerPixel = ossim::scalarSizeInBytes( theScalarType );
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageMetaData::updateMetaData DEBUG"
+         << *this << std::endl;
+   }
+}
+
+std::ostream& ossimImageMetaData::print(std::ostream& out) const
+{
+   ossimKeywordlist kwl;
+   saveState( kwl, 0 );
+   out << kwl << std::endl;
+   return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimImageMetaData& obj)
+{
+   return obj.print( out );
+}
+
+ossim_uint32 ossimImageMetaData::getBandCount(const ossimKeywordlist& kwl,
+                                              const std::string& prefix) const
+{
+   ossim_uint32 result = 0;
+
+   ossimString value;
+   value.string() = kwl.findKey( prefix, std::string(ossimKeywordNames::NUMBER_BANDS_KW) );
+   if ( value.size() )
+   {
+      result = value.toUInt32();
+   }
+   else
+   {
+      value.string() = std::string("^(") + prefix + std::string("band[0-9]+.)");
+      std::vector<ossimString> keys = kwl.getSubstringKeyList( value );
+      result = static_cast<ossim_uint32>( keys.size() );
+   }
+   return result;   
+}
diff --git a/ossim/src/ossim/imaging/ossimImageMetaDataWriterFactory.cpp b/src/imaging/ossimImageMetaDataWriterFactory.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageMetaDataWriterFactory.cpp
rename to src/imaging/ossimImageMetaDataWriterFactory.cpp
diff --git a/src/imaging/ossimImageMetaDataWriterFactoryBase.cpp b/src/imaging/ossimImageMetaDataWriterFactoryBase.cpp
new file mode 100644
index 0000000..cab67cd
--- /dev/null
+++ b/src/imaging/ossimImageMetaDataWriterFactoryBase.cpp
@@ -0,0 +1,28 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//----------------------------------------------------------------------------
+// $Id: ossimImageMetaDataWriterFactoryBase.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/imaging/ossimImageMetaDataWriterFactoryBase.h>
+
+RTTI_DEF1(ossimImageMetaDataWriterFactoryBase,
+          "ossimImageMetaDataWriterFactoryBase",
+          ossimObjectFactory);
+
+ossimImageMetaDataWriterFactoryBase::ossimImageMetaDataWriterFactoryBase()
+{
+}
+
+ossimImageMetaDataWriterFactoryBase::ossimImageMetaDataWriterFactoryBase(
+   const ossimImageMetaDataWriterFactoryBase&)
+{
+}
+
+const ossimImageMetaDataWriterFactoryBase&
+ossimImageMetaDataWriterFactoryBase::operator=(
+   const ossimImageMetaDataWriterFactoryBase&)
+{
+   return *this;
+}
diff --git a/src/imaging/ossimImageMetaDataWriterRegistry.cpp b/src/imaging/ossimImageMetaDataWriterRegistry.cpp
new file mode 100644
index 0000000..f064e2a
--- /dev/null
+++ b/src/imaging/ossimImageMetaDataWriterRegistry.cpp
@@ -0,0 +1,171 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//----------------------------------------------------------------------------
+// $Id: ossimImageMetaDataWriterRegistry.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+
+#include <ossim/imaging/ossimImageMetaDataWriterRegistry.h>
+#include <ossim/imaging/ossimImageMetaDataWriterFactory.h>
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <algorithm>
+
+//ossimImageMetaDataWriterRegistry*
+//ossimImageMetaDataWriterRegistry::theInstance= NULL;
+
+ossimImageMetaDataWriterRegistry::ossimImageMetaDataWriterRegistry()
+{
+   registerFactory(ossimImageMetaDataWriterFactory::instance());
+   ossimObjectFactoryRegistry::instance()->registerFactory(this);
+}
+
+ossimImageMetaDataWriterRegistry::~ossimImageMetaDataWriterRegistry()
+{
+   ossimObjectFactoryRegistry::instance()->unregisterFactory(this);
+}
+
+ossimImageMetaDataWriterRegistry* ossimImageMetaDataWriterRegistry::instance()
+{
+   static ossimImageMetaDataWriterRegistry sharedInstance;
+
+   return &sharedInstance;
+}
+
+void ossimImageMetaDataWriterRegistry::registerFactory(
+   ossimImageMetaDataWriterFactoryBase* factory)
+{
+   if(factory&&!findFactory(factory))
+   {
+      theFactoryList.push_back(factory);
+   }
+}
+
+void ossimImageMetaDataWriterRegistry::unregisterFactory(
+   ossimImageMetaDataWriterFactoryBase* factory)
+{
+   std::vector<ossimImageMetaDataWriterFactoryBase*>::iterator iter =
+      std::find(theFactoryList.begin(),
+                theFactoryList.end(),
+                factory);
+   if(iter != theFactoryList.end())
+   {
+      theFactoryList.erase(iter);
+   }
+}
+
+bool ossimImageMetaDataWriterRegistry::findFactory(
+   ossimImageMetaDataWriterFactoryBase* factory)const
+{
+   return (std::find(theFactoryList.begin(),
+                     theFactoryList.end(),
+                     factory)!=theFactoryList.end());
+}
+
+
+ossimObject* ossimImageMetaDataWriterRegistry::createObject(
+   const ossimString& typeName) const
+{
+   ossimObject* result = NULL;
+   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator factory;
+   
+   factory = theFactoryList.begin();
+   while((factory != theFactoryList.end()) && !result)
+   {
+      result = (*factory)->createObject(typeName);
+      ++factory;
+   }
+   
+   return result;
+}
+
+ossimObject* ossimImageMetaDataWriterRegistry::createObject(
+   const ossimKeywordlist& kwl,
+   const char* prefix) const
+{
+   ossimObject* result = NULL;
+   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator factory;
+
+   factory = theFactoryList.begin();
+   while((factory != theFactoryList.end()) && !result)
+   {
+     result = (*factory)->createObject(kwl, prefix);
+     ++factory;
+   }
+   return result;
+}
+
+ossimRefPtr<ossimMetadataFileWriter>
+ossimImageMetaDataWriterRegistry::createWriter(const ossimString& type) const
+{
+   ossimRefPtr<ossimMetadataFileWriter> result = NULL;
+   
+   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator factory;
+   factory = theFactoryList.begin();
+   while((factory != theFactoryList.end()) && !result)
+   {
+     result = (*factory)->createWriter(type);
+     ++factory;
+   }
+   return result;
+}
+
+void ossimImageMetaDataWriterRegistry::getTypeNameList(
+   std::vector<ossimString>& typeList) const
+{
+   std::vector<ossimString> result;
+   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator iter =
+      theFactoryList.begin();
+
+   while(iter != theFactoryList.end())
+   {
+      result.clear();
+      (*iter)->getTypeNameList(result);
+
+      // now append to the end of the typeList.
+      typeList.insert(typeList.end(),
+                      result.begin(),
+                      result.end());
+      ++iter;
+   }
+}
+
+void ossimImageMetaDataWriterRegistry::getMetadatatypeList(
+   std::vector<ossimString>& metadatatypeList) const
+{
+   //---
+   // Since this is the master registry for all meta data writer factories
+   // we will start with a cleared list.
+   //---
+   metadatatypeList.clear();
+   
+   std::vector<ossimImageMetaDataWriterFactoryBase*>::const_iterator iter =
+      theFactoryList.begin();
+   
+   while(iter != theFactoryList.end())
+   {
+      (*iter)->getMetadatatypeList(metadatatypeList);
+      ++iter;
+   } 
+}
+
+ossimImageMetaDataWriterRegistry::ossimImageMetaDataWriterRegistry(
+   const ossimImageMetaDataWriterRegistry& /* rhs */)
+{
+}
+
+const ossimImageMetaDataWriterRegistry&
+ossimImageMetaDataWriterRegistry::operator=(
+   const ossimImageMetaDataWriterRegistry& /* rhs */)
+{
+   return *this;
+}
+
+extern "C"
+{
+   void* ossimImageMetaDataWriterRegistryGetInstance()
+   {
+      return ossimImageMetaDataWriterRegistry::instance();
+   }
+}
diff --git a/src/imaging/ossimImageModel.cpp b/src/imaging/ossimImageModel.cpp
new file mode 100644
index 0000000..00e01ea
--- /dev/null
+++ b/src/imaging/ossimImageModel.cpp
@@ -0,0 +1,154 @@
+//-----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class definition of ossimImageModel.
+//
+//-----------------------------------------------------------------------------
+// $Id$
+
+#include <string>
+
+#include <ossim/imaging/ossimImageModel.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/imaging/ossimImageHandler.h>
+
+RTTI_DEF1(ossimImageModel, "ossimImageModel", ossimObject);
+
+ossimImageModel::ossimImageModel()
+   : ossimObject(),
+     theSubImageOffset(),
+     theDecimationFactors(),
+     theLines(0),
+     theSamples(0),
+     theTargetRrds(0)
+{
+}
+
+ossimImageModel::~ossimImageModel()
+{
+}
+
+void ossimImageModel::initialize(const ossimImageHandler& ih)
+{
+   theSubImageOffset = ossimDpt();
+   theLines          = ih.getNumberOfLines(0);
+   theSamples        = ih.getNumberOfSamples(0);
+   ih.getDecimationFactors(theDecimationFactors);
+}
+
+void ossimImageModel::rnToR0(ossim_uint32 rrds,
+                             const ossimDpt& rnPt,
+                             ossimDpt& r0Pt) const
+{
+   if ( rrds < theDecimationFactors.size() )
+   {
+      r0Pt.x = rnPt.x / theDecimationFactors[rrds].x;
+      r0Pt.y = rnPt.y / theDecimationFactors[rrds].y;
+   }
+   else
+   {
+      std::string e = "ossimImageModel::rnToR0 rrds out of range!";
+      throw ossimException(e);
+   }
+}
+void ossimImageModel::rnToR0(const ossimDpt& rnPt, ossimDpt& r0Pt) const
+{
+   rnToR0(theTargetRrds, rnPt, r0Pt);
+}
+   
+void ossimImageModel::r0ToRn(ossim_uint32 rrds,
+                             const ossimDpt& r0Pt,
+                             ossimDpt& rnPt) const
+{
+   if ( rrds < theDecimationFactors.size() )
+   {
+      rnPt.x = r0Pt.x * theDecimationFactors[rrds].x;
+      rnPt.y = r0Pt.y * theDecimationFactors[rrds].y;
+   }
+   else
+   {
+      std::string e = "ossimImageModel::r0ToRn rrds out of range!";
+      throw ossimException(e);
+   }
+}
+
+void ossimImageModel::r0ToRn(const ossimDpt& r0Pt, ossimDpt& rnPt) const
+{
+   r0ToRn(theTargetRrds, r0Pt, rnPt);
+}
+
+void ossimImageModel::getSubImageOffset(ossim_uint32 rrds,
+                                        ossimDpt& offset) const
+{
+   if ( rrds < theDecimationFactors.size() )
+   {
+      offset.x = theSubImageOffset.x * theDecimationFactors[rrds].x;
+      offset.y = theSubImageOffset.y * theDecimationFactors[rrds].y;
+   }
+   else
+   {
+      std::string e = "ossimImageModel::getSubImageOffset rrds out of range!";
+      throw ossimException(e);
+   } 
+}
+
+void ossimImageModel::getImageRectangle(ossim_uint32 rrds,
+                                        ossimDrect& rect) const
+{
+   if ( rrds < theDecimationFactors.size() )
+   {
+      ossim_float64 lrX = theSamples * theDecimationFactors[rrds].x - 1.0;
+      ossim_float64 lrY = theLines   * theDecimationFactors[rrds].y - 1.0;
+      ossimDrect r(0.0, 0.0, lrX, lrY);
+      rect = r;
+   }
+   else
+   {
+      std::string e = "ossimImageModel::getImageRectangle rrds out of range!";
+      throw ossimException(e);
+   } 
+}
+
+void ossimImageModel::getBoundingRectangle(ossim_uint32 rrds,
+                                           ossimDrect& rect) const
+{
+   if ( rrds < theDecimationFactors.size() )
+   {
+      ossim_float64 urX = theSubImageOffset.x * theDecimationFactors[rrds].x;
+      ossim_float64 urY = theSubImageOffset.y * theDecimationFactors[rrds].y;
+      
+      ossim_float64 lrX = urX + theSamples*theDecimationFactors[rrds].x - 1.0;
+      ossim_float64 lrY = urY + theLines  *theDecimationFactors[rrds].y - 1.0;
+      ossimDrect r(0, 0, lrX, lrY);
+      rect = r;
+   }
+   else
+   {
+      std::string e =
+         "ossimImageModel::getBoundingRectangle rrds out of range!";
+      throw ossimException(e);
+   }  
+}
+ossim_uint32 ossimImageModel::getNumberOfDecimationLevels()const
+{
+   return (ossim_uint32)theDecimationFactors.size();
+}
+
+void ossimImageModel::setTargetRrds(ossim_uint32 rrds)
+{
+   theTargetRrds = rrds;
+}
+
+ossim_uint32 ossimImageModel::getTargetRrds() const
+{
+   return theTargetRrds;
+}
+
+   
+
diff --git a/src/imaging/ossimImageMosaic.cpp b/src/imaging/ossimImageMosaic.cpp
new file mode 100644
index 0000000..2b433ea
--- /dev/null
+++ b/src/imaging/ossimImageMosaic.cpp
@@ -0,0 +1,529 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+// 
+// Description: implementation for image mosaic
+//
+//*************************************************************************
+// $Id: ossimImageMosaic.cpp 15766 2009-10-20 12:37:09Z gpotts $
+
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimTrace.h>
+static const ossimTrace traceDebug("ossimImageMosaic:debug");
+
+using namespace std;
+
+RTTI_DEF1(ossimImageMosaic, "ossimImageMosaic", ossimImageCombiner)
+ossimImageMosaic::ossimImageMosaic()
+   :ossimImageCombiner(),
+    theTile(NULL)
+{
+
+}
+
+ossimImageMosaic::ossimImageMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
+    : ossimImageCombiner(inputSources),
+      theTile(NULL)
+{
+}
+
+
+ossimImageMosaic::~ossimImageMosaic()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimImageMosaic::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   long size = getNumberOfInputs();
+   ossim_uint32 layerIdx = 0;
+   // If there is only one in the mosaic then just return it.
+   if(size == 1)
+   {
+      return getNextTile(layerIdx, 0, tileRect, resLevel);
+   }
+   
+   ossimIpt origin = tileRect.ul();
+   ossim_uint32 w = tileRect.width();
+   ossim_uint32 h = tileRect.height();
+   
+   if(!theTile.valid())
+   {
+      // try to initialize
+      allocate();
+
+      // if we still don't have a buffer
+      // then we will leave
+      if(!theTile.valid())
+      {
+         return ossimRefPtr<ossimImageData>();
+      }
+   }
+   
+   ossim_uint32 tileW = theTile->getWidth();
+   ossim_uint32 tileH = theTile->getHeight();
+   if((w != tileW)||
+      (h != tileH))
+   {
+      theTile->setWidth(w);
+      theTile->setHeight(h);
+      if((w*h)!=(tileW*tileH))
+      {
+         theTile->initialize();
+      }
+   }
+   theTile->setOrigin(origin);
+
+   //---
+   // General Note:
+   //
+   // Note: I will not check for disabled or enabled since we have
+   // no clear way to handle this within a mosaic. The default will be
+   // to do a simple a A over B type mosaic.  Derived classes should
+   // check for the enabled and disabled and always
+   // use this default implementation if they are disabled.
+   //---
+
+   theTile->setOrigin(origin);
+   theTile->makeBlank();
+   switch(theTile->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint8>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint8>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT8:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint8>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint8>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_FLOAT: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<float>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<float>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint16>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint16>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SSHORT16:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint16>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint16>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint32>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint32>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_UINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint32>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint32>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<double>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<double>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Scalar type = " << theTile->getScalarType()
+            << " Not supported by ossimImageMosaic" << endl;
+      }
+   }
+
+   return ossimRefPtr<ossimImageData>();
+}
+
+void ossimImageMosaic::initialize()
+{
+  ossimImageCombiner::initialize();
+  theTile = NULL;
+}
+
+void ossimImageMosaic::allocate()
+{
+   theTile = NULL;
+   
+   if( (getNumberOfInputs() > 0) && getInput(0) )
+   {
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+   }
+}
+
+bool ossimImageMosaic::saveState(ossimKeywordlist& kwl,
+                                 const char* prefix)const
+{
+   return ossimImageCombiner::saveState(kwl, prefix);
+}
+
+bool ossimImageMosaic::loadState(const ossimKeywordlist& kwl,
+                                 const char* prefix)
+{
+   return ossimImageCombiner::loadState(kwl, prefix);
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimImageMosaic::combineNorm(
+   T,// dummy template variable 
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   //---
+   // Get the first tile from the input sources.  If this(index 0) is blank
+   // that means there are no layers so go no further.
+   //---
+   ossimRefPtr<ossimImageData> currentImageData =
+      getNextNormTile(layerIdx, 0, tileRect, resLevel);
+   if(!currentImageData)
+   {
+      return theTile;
+   }
+   
+   ossimRefPtr<ossimImageData> destination = theTile;
+   ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
+
+   
+   float** srcBands         = new float*[theLargestNumberOfInputBands];
+   float*  srcBandsNullPix  = new float[theLargestNumberOfInputBands];
+   T**     destBands        = new T*[theLargestNumberOfInputBands];
+   T*      destBandsNullPix = new T[theLargestNumberOfInputBands];
+   T*      destBandsMinPix  = new T[theLargestNumberOfInputBands];
+   T*      destBandsMaxPix  = new T[theLargestNumberOfInputBands];
+   
+   ossim_uint32 band;
+   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      srcBands[band]  = static_cast<float*>(currentImageData->getBuf(band));
+      srcBandsNullPix[band]  = static_cast<float>(currentImageData->getNullPix(band));
+      
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
+      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
+   }
+   
+   // if the src is smaller than the destination in number
+   // of bands we will just duplicate the last band.
+   for(;band < theLargestNumberOfInputBands; ++band)
+   {
+      srcBands[band]  = static_cast<float*>(srcBands[minNumberOfBands - 1]);
+      srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(minNumberOfBands - 1));
+      
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
+      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
+   }
+
+   // Loop to copy from layers to output tile.
+   while(currentImageData.valid())
+   {
+      //---
+      // Check the status of the source tile.  If empty get the next source
+      // tile and loop back.
+      //---
+       ossimDataObjectStatus currentStatus =
+         currentImageData->getDataObjectStatus();
+      if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
+      {
+         currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+         continue;
+      }
+      
+      ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+      
+      for(band = 0; band < minNumberOfBands; ++band)
+      {
+         srcBands[band] = static_cast<float*>(currentImageData->getBuf(band));
+         srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
+      }
+      // if the src is smaller than the destination in number
+      // of bands we will just duplicate the last band.
+      for(;band < theLargestNumberOfInputBands; ++band)
+      {
+         srcBands[band] = srcBands[minNumberOfBands - 1];
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      }
+      
+      if ( (currentStatus == OSSIM_FULL) &&
+           (destinationStatus == OSSIM_EMPTY) )
+      {
+         // Copy full tile to empty tile.
+         for(band=0; band < theLargestNumberOfInputBands; ++band)
+         {
+            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
+            float minP  = destBandsMinPix[band];
+            
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               destBands[band][offset] =
+                  (T)( minP + delta*srcBands[band][offset]);
+            }
+         }
+      }
+      else // Copy tile checking all the pixels...
+      {
+         for(band = 0; band < theLargestNumberOfInputBands; ++band)
+         {
+            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
+            float minP  = destBandsMinPix[band];
+            
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if (destBands[band][offset] == destBandsNullPix[band])
+               {
+                  if (srcBands[band][offset] != srcBandsNullPix[band])
+                  {
+                     destBands[band][offset] =
+                        (T)(minP + delta*srcBands[band][offset]);
+                  }
+               }
+            }
+         }
+      }
+
+      // Validate output tile and return if full.
+      destinationStatus = destination->validate();
+      if (destinationStatus == OSSIM_FULL)
+      {
+         
+         break;//return destination;
+      }
+
+      // If we get here we're are still not full.  Get a tile from next layer.
+      currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+   }
+
+   // Cleanup...
+   delete [] srcBands;
+   delete [] destBands;
+   delete [] srcBandsNullPix;
+   delete [] destBandsNullPix;
+   delete [] destBandsMinPix;
+   delete [] destBandsMaxPix;
+
+   return destination;
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimImageMosaic::combine(
+   T,// dummy template variable 
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   //---
+   // Get the first tile from the input sources.  If this(index 0) is blank
+   // that means there are no layers so go no further.
+   //---
+   ossimRefPtr<ossimImageData> currentImageData =
+      getNextTile(layerIdx, 0, tileRect, resLevel);
+   if (!currentImageData)
+   {
+      return theTile;
+   }
+
+   ossimRefPtr<ossimImageData> destination = theTile;
+   ossimDataObjectStatus destinationStatus = theTile->getDataObjectStatus();
+
+   T** srcBands         = new T*[theLargestNumberOfInputBands];
+   T*  srcBandsNullPix  = new T[theLargestNumberOfInputBands];
+   T** destBands        = new T*[theLargestNumberOfInputBands];
+   T*  destBandsNullPix = new T[theLargestNumberOfInputBands];
+      
+   ossim_uint32 band;
+   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      srcBandsNullPix[band]  = static_cast<T>(currentImageData->getNullPix(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+   }
+   // if the src is smaller than the destination in number
+   // of bands we will just duplicate the last band.
+   for(;band < theLargestNumberOfInputBands; ++band)
+   {
+      srcBands[band]  = static_cast<T*>(srcBands[minNumberOfBands - 1]);
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+   }
+
+   // Loop to copy from layers to output tile.
+   while(currentImageData.valid())
+   {
+      //---
+      // Check the status of the source tile.  If empty get the next source
+      // tile and loop back.
+      //---
+      ossimDataObjectStatus currentStatus =
+         currentImageData->getDataObjectStatus();
+      if ( (currentStatus == OSSIM_EMPTY) || (currentStatus == OSSIM_NULL) )
+      {
+         currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+         continue;
+      }
+      
+      ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+
+      for(band = 0; band < minNumberOfBands; ++band)
+      {
+         srcBands[band] = static_cast<T*>(currentImageData->getBuf(band));
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
+      }
+      // if the src is smaller than the destination in number
+      // of bands we will just duplicate the last band.
+      for(;band < theLargestNumberOfInputBands; ++band)
+      {
+         srcBands[band] = srcBands[minNumberOfBands - 1];
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      }
+
+      if ( (currentStatus == OSSIM_FULL) &&
+           (destinationStatus == OSSIM_EMPTY) )
+      {
+         // Copy full tile to empty tile.
+         for(ossim_uint32 band=0; band < theLargestNumberOfInputBands; ++band)
+         {
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               destBands[band][offset] = srcBands[band][offset];
+            }
+         }
+      }
+      else // Copy tile checking all the pixels...
+      {
+         for(band = 0; band < theLargestNumberOfInputBands; ++band)
+         {
+            
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if(destBands[band][offset] == destBandsNullPix[band])
+               {
+                  destBands[band][offset] = srcBands[band][offset];
+               }
+            }
+         }
+      }
+
+      // Validate output tile and return if full.
+      destinationStatus = destination->validate();
+      if (destinationStatus == OSSIM_FULL)
+      {
+         break;//return destination;
+      }
+
+      // If we get here we're are still not full.  Get a tile from next layer.
+      currentImageData = getNextTile(layerIdx, tileRect, resLevel);
+   }
+   
+   // Cleanup...
+   delete [] srcBands;
+   delete [] destBands;
+   delete [] srcBandsNullPix;
+   delete [] destBandsNullPix;
+   
+   return destination;
+}
diff --git a/ossim/src/ossim/imaging/ossimImageReconstructionFilterFactory.cpp b/src/imaging/ossimImageReconstructionFilterFactory.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageReconstructionFilterFactory.cpp
rename to src/imaging/ossimImageReconstructionFilterFactory.cpp
diff --git a/ossim/src/ossim/imaging/ossimImageReconstructionFilterRegistry.cpp b/src/imaging/ossimImageReconstructionFilterRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageReconstructionFilterRegistry.cpp
rename to src/imaging/ossimImageReconstructionFilterRegistry.cpp
diff --git a/src/imaging/ossimImageRenderer.cpp b/src/imaging/ossimImageRenderer.cpp
new file mode 100644
index 0000000..f89595d
--- /dev/null
+++ b/src/imaging/ossimImageRenderer.cpp
@@ -0,0 +1,2512 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimImageRenderer.cpp 23663 2015-12-11 21:10:54Z dburken $
+
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossim2dBilinearTransform.h>
+#include <ossim/base/ossimProcessProgressEvent.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimConnectableContainerInterface.h>
+#include <ossim/base/ossimViewController.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimDiscrete3x3HatFilter.h>
+#include <ossim/imaging/ossimDiscreteNearestNeighbor.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimImageViewTransformFactory.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <iostream>
+#include <stack>
+// using namespace std;
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimImageRenderer.cpp 23663 2015-12-11 21:10:54Z dburken $";
+#endif
+
+static ossimTrace traceDebug("ossimImageRenderer:debug");
+
+RTTI_DEF2(ossimImageRenderer, "ossimImageRenderer", ossimImageSourceFilter, ossimViewInterface);
+
+
+
+void ossimImageRenderer::ossimRendererSubRectInfo::splitHorizontal(std::vector<ossimRendererSubRectInfo>& result)const
+{
+   ossimIrect vrect(m_Vul,
+                    m_Vur,
+                    m_Vlr,
+                    m_Vll);
+   ossim_int32 w  = vrect.width();
+   // ossim_int32 h  = vrect.height();
+   ossim_int32 w2 = w>>1;
+   ossimIrect tempLeftRect(m_Vul.x, 
+                           m_Vul.y, 
+                           m_Vul.x+w2-1, 
+                           m_Vlr.y);
+   ossimIrect tempRightRect(tempLeftRect.ur().x+1, 
+                            m_Vul.y, 
+                            m_Vur.x, 
+                            m_Vlr.y);
+
+
+   ossimRendererSubRectInfo left(m_transform.get());
+   ossimRendererSubRectInfo right(m_transform.get());
+
+   left.m_viewBounds = m_viewBounds;
+   right.m_viewBounds = m_viewBounds;
+
+   left.m_Vul = tempLeftRect.ul();
+   left.m_Vur = tempLeftRect.ur();
+   left.m_Vlr = tempLeftRect.lr();
+   left.m_Vll = tempLeftRect.ll();
+
+   right.m_Vul = tempRightRect.ul();
+   right.m_Vur = tempRightRect.ur();
+   right.m_Vlr = tempRightRect.lr();
+   right.m_Vll = tempRightRect.ll();
+
+   left.transformViewToImage();
+   right.transformViewToImage();
+
+   if(left.imageIsNan())
+   {
+      if(left.m_viewBounds->intersects(left.getViewRect()))
+      {
+         result.push_back(left);
+      }
+   }
+   else
+   {
+      result.push_back(left);
+   }
+   if(right.imageIsNan())
+   {
+      if(right.m_viewBounds->intersects(right.getViewRect()))
+      {
+         result.push_back(right);
+      }
+   }
+   else
+   {
+      result.push_back(right);
+   }
+}
+
+void ossimImageRenderer::ossimRendererSubRectInfo::splitVertical(std::vector<ossimRendererSubRectInfo>& result)const
+{
+   ossimIrect vrect(m_Vul,
+                    m_Vur,
+                    m_Vlr,
+                    m_Vll);
+   // ossim_int32 w  = vrect.width();
+   ossim_int32 h  = vrect.height();
+   ossim_int32 h2 = h>>1;
+   ossimIrect tempTopRect(m_Vul.x, 
+                          m_Vul.y, 
+                          m_Vlr.x, 
+                          m_Vul.y+h2-1);
+   ossimIrect tempBottomRect(m_Vul.x, 
+                             tempTopRect.lr().y+1, 
+                             m_Vlr.x, 
+                             m_Vlr.y);
+
+   ossimRendererSubRectInfo top(m_transform.get());
+   ossimRendererSubRectInfo bottom(m_transform.get());
+
+   top.m_viewBounds    = m_viewBounds;
+   bottom.m_viewBounds = m_viewBounds;
+
+   top.m_Vul = tempTopRect.ul();
+   top.m_Vur = tempTopRect.ur();
+   top.m_Vlr = tempTopRect.lr();
+   top.m_Vll = tempTopRect.ll();
+
+   bottom.m_Vul = tempBottomRect.ul();
+   bottom.m_Vur = tempBottomRect.ur();
+   bottom.m_Vlr = tempBottomRect.lr();
+   bottom.m_Vll = tempBottomRect.ll();
+
+   top.transformViewToImage();
+   bottom.transformViewToImage();
+
+   if(top.imageIsNan())
+   {
+      if(top.m_viewBounds->intersects(top.getViewRect()))
+      {
+         result.push_back(top);
+      }
+   }
+   else
+   {
+      result.push_back(top);
+   }
+   if(bottom.imageIsNan())
+   {
+      if(bottom.m_viewBounds->intersects(bottom.getViewRect()))
+      {
+         result.push_back(bottom);
+      }
+   }
+   else
+   {
+      result.push_back(bottom);
+   }
+}
+
+void ossimImageRenderer::ossimRendererSubRectInfo::splitAll(std::vector<ossimRendererSubRectInfo>& result)const
+{
+   //std::cout << "FULL Split\n" << std::endl;
+   // let splitAll for now.  We can still optimize but will do that later
+   ossimIrect tempUlRect;
+   ossimIrect tempUrRect;
+   ossimIrect tempLrRect;
+   ossimIrect tempLlRect;
+   ossimIrect vrect(m_Vul,
+                    m_Vur,
+                    m_Vlr,
+                    m_Vll);
+   ossim_int32 w  = vrect.width();
+   ossim_int32 h  = vrect.height();
+   ossim_int32 w2 = w>>1;
+   ossim_int32 h2 = h>>1;
+
+   tempUlRect = ossimIrect(m_Vul.x,
+                           m_Vul.y,
+                           m_Vul.x + (w2 - 1),
+                           m_Vul.y + (h2 - 1));
+  
+   tempUrRect = ossimIrect(tempUlRect.ur().x+1,
+                           m_Vul.y,
+                           m_Vur.x,
+                           m_Vul.y + (h2 - 1));
+  
+   tempLrRect = ossimIrect(tempUlRect.lr().x,
+                           tempUlRect.lr().y+1,
+                           m_Vlr.x,
+                           m_Vlr.y);
+  
+   tempLlRect = ossimIrect(m_Vul.x,
+                           tempUlRect.ll().y+1,
+                           tempLrRect.ul().x,
+                           tempLrRect.ll().y);
+
+//  std::cout << "VR: " << vrect.width() << ", " << vrect.height() << "\n"
+//            << "UL: " << tempUlRect.width() << ", " << tempUlRect.height() << "\n"
+//            << "UR: " << tempUrRect.width() << ", " << tempUrRect.height() << "\n"
+//            << "LR: " << tempLrRect.width() << ", " << tempLrRect.height() << "\n"
+//            << "LL: " << tempLlRect.width() << ", " << tempLlRect.height() << "\n";
+
+   ossimRendererSubRectInfo ul(m_transform.get(),tempUlRect.ul(), tempUlRect.ur(),tempUlRect.lr(), tempUlRect.ll());
+   ossimRendererSubRectInfo ur(m_transform.get(),tempUrRect.ul(), tempUrRect.ur(),tempUrRect.lr(), tempUrRect.ll());
+   ossimRendererSubRectInfo lr(m_transform.get(),tempLrRect.ul(), tempLrRect.ur(),tempLrRect.lr(), tempLrRect.ll());
+   ossimRendererSubRectInfo ll(m_transform.get(),tempLlRect.ul(), tempLlRect.ur(),tempLlRect.lr(), tempLlRect.ll());
+
+   ul.m_viewBounds = m_viewBounds;
+   ur.m_viewBounds = m_viewBounds;
+   lr.m_viewBounds = m_viewBounds;
+   ll.m_viewBounds = m_viewBounds;
+
+   ul.transformViewToImage();
+   ur.transformViewToImage();
+   lr.transformViewToImage();
+   ll.transformViewToImage();
+
+   if(ul.imageIsNan())
+   {
+      if(ul.m_viewBounds->intersects(ul.getViewRect()))
+      {
+         result.push_back(ul);
+      }
+   }
+   else
+   {
+      result.push_back(ul);
+   }
+   if(ur.imageIsNan())
+   {
+      if(ur.m_viewBounds->intersects(ur.getViewRect()))
+      {
+         result.push_back(ur);
+      }
+   }
+   else
+   {
+      result.push_back(ur);
+   }
+   if(lr.imageIsNan())
+   {
+      if(lr.m_viewBounds->intersects(lr.getViewRect()))
+      {
+         result.push_back(lr);
+      }
+   }
+   else
+   {
+      result.push_back(lr);
+   }
+   if(ll.imageIsNan())
+   {
+      if(ll.m_viewBounds->intersects(ll.getViewRect()))
+      {
+         result.push_back(ll);
+      }
+   }
+   else
+   {
+      result.push_back(ll);
+   }
+}
+
+void ossimImageRenderer::ossimRendererSubRectInfo::splitView(std::vector<ossimRendererSubRectInfo>& result)const
+{
+  ossim_uint16 splitFlags = getSplitFlags();
+  // just do horizontal split for test
+
+  ossimIrect vrect(m_Vul,
+                  m_Vur,
+                  m_Vlr,
+                  m_Vll);
+  ossim_int32 w  = vrect.width();
+  ossim_int32 h  = vrect.height();
+  ossim_int32 w2 = w>>1;
+  ossim_int32 h2 = h>>1;
+  if(!splitFlags)
+  {
+    return;
+  }
+  else if((w2 <2)&&(h2<2))
+  {
+    if(splitFlags)
+    {
+      ossimRendererSubRectInfo rect(m_transform.get(),m_Vul, 
+                              m_Vul, 
+                              m_Vul, 
+                              m_Vul);
+      rect.m_viewBounds = m_viewBounds;
+      rect.transformViewToImage();
+
+      if(rect.imageHasNans())
+      {
+        if(rect.m_viewBounds->intersects(rect.getViewRect()))
+        {
+          result.push_back(rect);
+        }
+      }
+      // if(rect.imageIsNan())
+      // {
+      //   if(rect.m_viewBounds->intersects(rect.getViewRect()))
+      //   {
+      //     result.push_back(rect);
+      //   }
+      // }
+      // else
+      // {
+      //   result.push_back(rect);
+      // }
+    }
+  }
+  // horizontal split if only the upper left and lower left 
+  // vertices need splitting 
+  else if((splitFlags==(UPPER_LEFT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG))||
+          (splitFlags==(UPPER_RIGHT_SPLIT_FLAG|LOWER_RIGHT_SPLIT_FLAG)))
+  {
+   // std::cout << "Horizontal Split\n" << std::endl;    
+    if(w > 1)
+    {
+      splitHorizontal(result);
+    }
+  }  
+  // check vertical only split
+  else if((splitFlags==(UPPER_LEFT_SPLIT_FLAG|UPPER_RIGHT_SPLIT_FLAG))||
+          (splitFlags==(LOWER_RIGHT_SPLIT_FLAG|LOWER_LEFT_SPLIT_FLAG)))
+  {
+    //std::cout << "Vertical Split\n" << std::endl;
+
+    if(h>1)
+    {
+      splitVertical(result);
+    }
+  }
+  else//if((w>1)&&(h>1)&&(splitFlags))
+  {
+    if((w<2)&&(h>1))
+    {
+      splitVertical(result);
+    }
+    else if((w>1)&&(h<2))
+    {
+      splitHorizontal(result);
+    }
+    else
+    {
+      splitAll(result);
+    }
+  }
+}
+void ossimImageRenderer::ossimRendererSubRectInfo::transformImageToView()
+{
+   ossimDpt vul;
+   ossimDpt vur;
+   ossimDpt vlr;
+   ossimDpt vll;
+   m_transform->imageToView(m_Iul,
+                          vul);
+   m_transform->imageToView(m_Iur,
+                          vur);
+   m_transform->imageToView(m_Ilr,
+                          vlr);
+   m_transform->imageToView(m_Ill,
+                          vll);
+   
+   m_Vul = vul;
+   m_Vur = vur;
+   m_Vlr = vlr;
+   m_Vll = vll;
+}
+
+bool ossimImageRenderer::ossimRendererSubRectInfo::tooBig()const
+{
+  ossimDrect vRect = getViewRect();
+
+  return ((vRect.width() > 32) || (vRect.height() > 32));
+}
+
+ossim_uint16 ossimImageRenderer::ossimRendererSubRectInfo::getSplitFlags()const
+{
+  ossim_uint16 result = SPLIT_NONE;
+  ossimDrect vRect = getViewRect();
+
+  if(imageHasNans())
+  {
+    if(m_viewBounds->intersects(getViewRect()))
+    {
+      result = SPLIT_ALL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+  /*
+  if(result != SPLIT_ALL)
+  {
+    if(m_ulRoundTripError.hasNans()&&m_urRoundTripError.hasNans()&&
+        m_lrRoundTripError.hasNans()&&m_llRoundTripError.hasNans())
+    {
+      if(m_viewBounds->intersects(getViewRect()))
+      {
+        result = SPLIT_ALL;
+      }
+      return result;
+    }
+    else if(tooBig())
+    {
+      result = SPLIT_ALL;
+    }
+  }
+
+  if(result != SPLIT_ALL)
+  {
+    if(m_ulRoundTripError.hasNans()) result |= UPPER_LEFT_SPLIT_FLAG;
+    if(m_urRoundTripError.hasNans()) result |= UPPER_RIGHT_SPLIT_FLAG;
+    if(m_lrRoundTripError.hasNans()) result |= LOWER_RIGHT_SPLIT_FLAG;
+    if(m_llRoundTripError.hasNans()) result |= LOWER_LEFT_SPLIT_FLAG;
+  }
+*/
+  if(result != SPLIT_ALL)
+  {
+    ossim_float64 bias = m_ImageToViewScale.length();
+    if(bias < 1.0) bias = 1.0/bias;
+    bias = std::sqrt(bias);
+
+    if(bias < 1) bias = 1.0;
+
+     // if((m_ulRoundTripError.length() > bias)||
+     //    (m_urRoundTripError.length() > bias)||
+     //    (m_lrRoundTripError.length() > bias)||
+     //    (m_llRoundTripError.length() > bias))
+     // {
+       // std::cout << "________________\n";
+
+       // std::cout << "Bias:  " << bias << "\n"
+       //           << "View:  " << getViewRect() << "\n"
+       //           << "UL:    " << m_ulRoundTripError.length() << "\n"
+       //           << "UR:   " << m_urRoundTripError.length() << "\n"
+       //           << "LR:   " << m_lrRoundTripError.length() << "\n"
+       //           << "LL:   " << m_llRoundTripError.length() << "\n";
+//     }
+   // if(m_ulRoundTripError.length() > sensitivityScale) result |= UPPER_LEFT_SPLIT_FLAG;
+   // if(m_urRoundTripError.length() > sensitivityScale) result |= UPPER_RIGHT_SPLIT_FLAG;
+   // if(m_lrRoundTripError.length() > sensitivityScale) result |= LOWER_RIGHT_SPLIT_FLAG;
+   // if(m_llRoundTripError.length() > sensitivityScale) result |= LOWER_LEFT_SPLIT_FLAG;
+       // std::cout << result << " == " << SPLIT_ALL << "\n";
+
+    if((result!=SPLIT_ALL)&&!canBilinearInterpolate(bias))
+    {
+      // std::cout << "TESTING BILINEAR!!!!\n";
+      result = SPLIT_ALL;
+
+    }
+    else
+    {
+      // std::cout << "CAN BILINEAR!!!!\n";
+    }
+  }
+
+  return result;
+}
+
+void ossimImageRenderer::ossimRendererSubRectInfo::transformViewToImage()
+{
+//  std::cout << "TRANSFORM VIEW TO IMAGE!!!!!!!!!!!!!!\n";
+
+   ossimDrect vrect = getViewRect();
+   ossim_float64 w = vrect.width() - 1; // subtract 1 to prevent core dump in full-earth view rect
+   ossim_float64 h = vrect.height();
+
+   m_transform->viewToImage(m_Vul, m_Iul);
+   m_transform->viewToImage(m_Vur, m_Iur);
+   m_transform->viewToImage(m_Vlr, m_Ilr);
+   m_transform->viewToImage(m_Vll, m_Ill);
+
+//  m_ulRoundTripError = m_transform->getRoundTripErrorView(m_Vul);
+//  m_urRoundTripError = m_transform->getRoundTripErrorView(m_Vur);
+//  m_lrRoundTripError = m_transform->getRoundTripErrorView(m_Vlr);
+//  m_llRoundTripError = m_transform->getRoundTripErrorView(m_Vll);
+
+#if 1
+   m_VulScale = computeViewToImageScale(m_Vul, ossimDpt( w, h));
+   m_VurScale = computeViewToImageScale(m_Vur, ossimDpt(-w, h));
+   m_VlrScale = computeViewToImageScale(m_Vlr, ossimDpt(-w,-h));
+   m_VllScale = computeViewToImageScale(m_Vll, ossimDpt( w,-h));
+
+   ossim_int32 n = 0;
+   m_ViewToImageScale.x = 0.0;
+   m_ViewToImageScale.y = 0.0;
+
+   if(!m_VulScale.hasNans())
+   {
+      m_ViewToImageScale += m_VulScale; 
+      ++n;
+   }
+   if(!m_VurScale.hasNans())
+   {
+      m_ViewToImageScale += m_VurScale; 
+      ++n;
+   }
+   if(!m_VlrScale.hasNans())
+   {
+      m_ViewToImageScale += m_VlrScale; 
+      ++n;
+   }
+   if(!m_VllScale.hasNans())
+   {
+      m_ViewToImageScale += m_VllScale; 
+      ++n;
+   }
+   if(!n)
+   {
+      m_ViewToImageScale.makeNan();
+   }
+   else
+   {
+      m_ViewToImageScale.x/=n;
+      m_ViewToImageScale.y/=n;
+   }
+
+#else
+   {
+      m_ViewToImageScale = ossimDpt(1.0, 1.0);
+      
+      ossimDpt topDelta    = m_Iur - m_Iul;
+      ossimDpt rightDelta  = m_Ilr - m_Iur;
+      ossimDpt bottomDelta = m_Ill - m_Ilr;
+      ossimDpt leftDelta   = m_Iul - m_Ill;
+      
+      double topLen    = topDelta.length();
+      double bottomLen = bottomDelta.length();
+      double rightLen  = rightDelta.length();
+      double leftLen   = leftDelta.length();
+      
+      double averageHoriz = ((topLen)  + (bottomLen))*.5;
+      double averageVert  = ((leftLen) + (rightLen))*.5;
+      
+      ossimDpt deltaViewP1P2 = m_Vul - m_Vur;
+      ossimDpt deltaViewP1P3 = m_Vul - m_Vll;
+      
+      double lengthViewP1P2 = deltaViewP1P2.length();//+1;
+      double lengthViewP1P3 = deltaViewP1P3.length();//+1;
+
+      if(lengthViewP1P2 > FLT_EPSILON)
+         m_ViewToImageScale.x = averageHoriz/lengthViewP1P2;
+      else
+         m_ViewToImageScale.makeNan();
+      if(lengthViewP1P3 > FLT_EPSILON)
+         m_ViewToImageScale.y = averageVert/lengthViewP1P3;
+      else
+         m_ViewToImageScale.makeNan();
+   }
+#endif
+
+   //std::cout << m_ViewToImageScale << std::endl;
+   if(!m_ViewToImageScale.hasNans())
+   {
+      m_ImageToViewScale.x = 1.0/m_ViewToImageScale.x;
+      m_ImageToViewScale.y = 1.0/m_ViewToImageScale.y;
+   }
+   else
+   {
+      m_ImageToViewScale.makeNan();
+   }
+}
+
+ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::computeViewToImageScale(const ossimDpt& viewPt,
+                           const ossimDpt& delta)const
+{
+  ossimDpt result;
+  result.makeNan();
+  if(viewPt.hasNans()) return result; 
+  ossimDpt ipt;
+  m_transform->viewToImage(viewPt, ipt);
+
+  if(!ipt.isNan())
+  {
+//    ossimDpt delta;
+//    transform->viewToImage(viewPt+ossimDpt(0.5,0.5), delta);
+
+//    delta = delta-ipt;
+//    result.x = delta.length()/std::sqrt(2);
+ //   result.y = result.x;
+
+    ossimDpt dx;
+    ossimDpt dy;
+
+    m_transform->viewToImage(viewPt + ossimDpt(delta.x,0.0), dx);
+    m_transform->viewToImage(viewPt + ossimDpt(0.0,delta.y), dy);
+    dx = dx-ipt;
+    dy = dy-ipt;
+
+    result.x = dx.length()/fabs(delta.x);
+    result.y = dy.length()/fabs(delta.y);
+  }
+
+  return result;
+}
+
+void ossimImageRenderer::ossimRendererSubRectInfo::stretchImageOut(bool enableRound)
+{
+   ossimDpt topDelta    = m_Iur - m_Iul;
+   ossimDpt rightDelta  = m_Ilr - m_Iur;
+   ossimDpt bottomDelta = m_Ill - m_Ilr;
+   ossimDpt leftDelta   = m_Iul - m_Ill;
+
+   topDelta = topDelta*(1.0/topDelta.length());
+   rightDelta = rightDelta*(1.0/rightDelta.length());
+   bottomDelta = bottomDelta*(1.0/bottomDelta.length());
+   leftDelta = leftDelta*(1.0/leftDelta.length());
+
+   m_Iul = m_Iul + ((leftDelta - topDelta)*.5);
+   m_Iur = m_Iur + ((topDelta - rightDelta)*.5);
+   m_Ilr = m_Ilr + ((rightDelta - bottomDelta)*.5);
+   m_Ill = m_Ill + ((bottomDelta - leftDelta)*.5);
+
+   if(enableRound)
+   {
+      m_Iul = ossimIpt(ossim::round<int>(m_Iul.x),
+                        ossim::round<int>(m_Iul.y));
+      m_Iur = ossimIpt(ossim::round<int>(m_Iur.x),
+                        ossim::round<int>(m_Iur.y));
+      m_Ilr = ossimIpt(ossim::round<int>(m_Ilr.x),
+                        ossim::round<int>(m_Ilr.y));
+      m_Ill = ossimIpt(ossim::round<int>(m_Ill.x),
+                        ossim::round<int>(m_Ill.y));
+   }
+}
+
+bool ossimImageRenderer::ossimRendererSubRectInfo::isIdentity()const
+{
+//    ossimDpt deltaP1P2 = m_Iul - m_Iur;
+//    ossimDpt deltaP1P3 = m_Iul - m_Ill;
+   
+//    ossimDpt deltaViewP1P2 = m_Vul - m_Vur;
+//    ossimDpt deltaViewP1P3 = m_Vul - m_Vll;
+   
+//    bool horizontalSigns = ossimGetSign(deltaP1P2.x)==ossimGetSign(deltaViewP1P2.x);
+//    bool verticalSigns   = ossimGetSign(deltaP1P3.y)==ossimGetSign(deltaViewP1P3.y);
+
+//    // check first to see if any horizontal or vertical flipping
+//    //
+//    if(horizontalSigns && verticalSigns)
+//    {
+//       // check scales to see if they are 1
+//       if(fabs(1-m_ViewToImageScale.x) <= FLT_EPSILON &&
+//          fabs(1-m_ViewToImageScale.y) <= FLT_EPSILON)
+//       {
+//          return true;
+//       }
+//    }
+
+    double iulDelta = (m_Iul-m_Vul).length();
+    double iurDelta = (m_Iur-m_Vur).length();
+    double ilrDelta = (m_Ilr-m_Vlr).length();
+    double illDelta = (m_Ill-m_Vll).length();
+
+    return ((iulDelta <= FLT_EPSILON)&&
+            (iurDelta <= FLT_EPSILON)&&
+            (ilrDelta <= FLT_EPSILON)&&
+            (illDelta <= FLT_EPSILON));
+}
+
+
+bool ossimImageRenderer::ossimRendererSubRectInfo::canBilinearInterpolate(double error)const
+{
+  bool result = false;
+
+      // now check point placement
+  ossimDpt imageToViewScale = getAbsValueImageToViewScales();
+
+  double testScale = imageToViewScale.length();
+
+//  ossimDpt errorUl = transform->getRoundTripErrorView(m_Vul);
+//  ossimDpt errorUr = transform->getRoundTripErrorView(m_Vur);
+//  ossimDpt errorLr = transform->getRoundTripErrorView(m_Vlr);
+//  ossimDpt errorLl = transform->getRoundTripErrorView(m_Vll);
+
+//  if((errorUl.length() > 2 )||
+//     (errorUr.length() > 2 )||
+//     (errorLr.length() > 2 )||
+//     (errorLl.length() > 2))
+//     {
+//        return result;
+//     }
+//  std::cout << "_______________________\n"
+//            << "errorUl: " << errorUl << "\n"
+//            << "errorUr: " << errorUr << "\n"
+//            << "errorLr: " << errorLr << "\n"
+//            << "errorLl: " << errorLl << "\n";
+
+  // if there is a large shrink or expansion then just return true.
+  // You are probably not worried about error in bilinear interpolation
+  //
+  if((testScale > 256)||
+     (testScale < 1.0/256.0))
+  {
+     return true;
+  }
+
+  if(m_VulScale.hasNans()||
+     m_VurScale.hasNans()||
+     m_VlrScale.hasNans()||
+     m_VllScale.hasNans())
+  {
+    return result;
+  }
+
+//  std::cout << "ulScale: " << m_VulScale << "\n"
+//            << "urScale: " << m_VurScale << "\n"
+//            << "lrScale: " << m_VlrScale << "\n"
+//            << "llScale: " << m_VllScale << "\n";
+
+
+  // check overage power of 2 variance
+  // If there is a variance of 1 resolution level
+  // then we must split further
+  //
+  ossim_float64 averageUlScale = m_VulScale.length();
+  ossim_float64 averageUrScale = m_VurScale.length();
+  ossim_float64 averageLrScale = m_VlrScale.length();
+  ossim_float64 averageLlScale = m_VllScale.length();
+
+  // std::cout << "_________________________\n";
+  // std::cout << log(averageUlScale)/(log(2)) << "\n";
+  // std::cout << log(averageUrScale)/(log(2)) << "\n";
+  // std::cout << log(averageLrScale)/(log(2)) << "\n";
+  // std::cout << log(averageLlScale)/(log(2)) << "\n";
+
+
+  ossim_float64 ratio1 = averageUlScale/averageUrScale;
+  ossim_float64 ratio2 = averageUlScale/averageLrScale;
+  ossim_float64 ratio3 = averageUlScale/averageLlScale;
+
+  // std::cout << "_________________________\n";
+  // std::cout << "ratio1: " << ratio1 << "\n";
+  // std::cout << "ratio2: " << ratio2 << "\n";
+  // std::cout << "ratio3: " << ratio3 << "\n";
+
+  
+  // make sure all are within a power of 2 shrink or expand
+  // which means the range of each ratio should be 
+  // between .5 and 2
+  result = (((ratio1 < 2) && (ratio1 > 0.5))&&
+            ((ratio2 < 2) && (ratio2 > 0.5))&&
+            ((ratio3 < 2) && (ratio3 > 0.5))); 
+
+  //result = ((diff1<=2)&&(diff2<=2)&&(diff3<=2));
+  //std::cout << "DIFF1: " << diff1 << std::endl;
+  //std::cout << "DIFF2: " << diff2 << std::endl;
+  //std::cout << "DIFF3: " << diff3 << std::endl;
+
+
+  if(result)
+  {
+#if 1
+    ossimDpt vUpper, vRight, vBottom, vLeft, vCenter;
+    ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
+    ossimDpt testUpper, testRight, testBottom, testLeft, testCenter;
+
+    ossim2dBilinearTransform viewToImageTransform(m_Vul, m_Vur, m_Vlr, m_Vll
+                                                 ,m_Iul, m_Iur, m_Ilr, m_Ill);
+
+//    std::cout << "vMid:  " << testMid << "\n";
+//    std::cout << "testMid:  " << testMid << "\n";
+//    std::cout << "testCenter:  " << testCenter << "\n";
+    
+    getViewMids(vUpper, vRight, vBottom, vLeft, vCenter);
+    
+    // do a bilinear transform of some test points
+    viewToImageTransform.forward(vUpper, iUpper);
+    viewToImageTransform.forward(vRight, iRight);
+    viewToImageTransform.forward(vBottom, iBottom);
+    viewToImageTransform.forward(vLeft, iLeft);
+    viewToImageTransform.forward(vCenter, iCenter);
+
+
+   // viewToImageTransform.forward(vMid, iTestMid);
+    //m_transform->viewToImage(vMid, testCenter);
+
+    //getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
+    
+    // get the model centers for the mid upper left right bottom
+    m_transform->viewToImage(vCenter, testCenter);
+
+    if(testCenter.hasNans())
+    {
+       return false;
+    }
+
+    m_transform->viewToImage(vUpper, testUpper);
+    if(testCenter.hasNans())
+    {
+       return false;
+    }
+    m_transform->viewToImage(vRight, testRight);
+    if(testRight.hasNans())
+    {
+       return false;
+    }
+    m_transform->viewToImage(vBottom, testBottom);
+    if(testBottom.hasNans())
+    {
+       return false;
+    }
+    m_transform->viewToImage(vLeft, testLeft);
+    if(testLeft.hasNans())
+    {
+       return false;
+    }
+
+    // now get the model error to bilinear estimate of those points
+    double errorCheck1 = (testCenter - iCenter).length();
+    double errorCheck2 = (testUpper - iUpper).length();
+    double errorCheck3 = (testRight - iRight).length();
+    double errorCheck4 = (testBottom - iBottom).length();
+    double errorCheck5 = (testLeft - iLeft).length();
+    result = ((errorCheck1 < error)&&
+              (errorCheck2 < error)&&
+              (errorCheck3 < error)&&
+              (errorCheck4 < error)&&
+              (errorCheck5 < error));
+    // if(!result)
+    // {
+       // std::cout <<"__________________________\n"
+       //       << "ERROR1:" <<errorCheck1 << "\n" 
+       //       << "ERROR2:" <<errorCheck2 << "\n" 
+       //       << "ERROR3:" <<errorCheck3 << "\n" 
+       //       << "ERROR4:" <<errorCheck4 << "\n" 
+       //       << "ERROR5:" <<errorCheck5 << "\n"
+       //       << "SENS:  " << error <<  "\n"; 
+
+    //   std::cout << "Can't bilinear!!\n";
+    // }
+
+#else
+    ossimDpt vUpper, vRight, vBottom, vLeft, vCenter;
+    ossimDpt iUpper, iRight, iBottom, iLeft, iCenter;
+
+    ossimDpt testCenter;
+    getViewMids(vUpper, vRight, vBottom, vLeft, vCenter);
+    getImageMids(iUpper, iRight, iBottom, iLeft, iCenter);
+
+    ossimDpt iFullRes(iCenter.x*imageToViewScale.x,
+          iCenter.y*imageToViewScale.y);
+
+    m_transform->viewToImage(vCenter, testCenter);
+
+    if(testCenter.hasNans())
+    {
+       return false;
+    }
+    ossimDpt testFullRes(testCenter.x*imageToViewScale.x,
+             testCenter.y*imageToViewScale.y);
+
+    double errorCheck1 = (testFullRes - iFullRes).length();
+
+    iFullRes = ossimDpt(iUpper.x*imageToViewScale.x,
+            iUpper.y*imageToViewScale.y);
+
+    m_transform->viewToImage(vUpper, testCenter);
+    if(testCenter.hasNans())
+    {
+       return false;
+    }
+    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
+         testCenter.y*imageToViewScale.y);
+    double errorCheck2 = (testFullRes - iFullRes).length();
+
+    iFullRes = ossimDpt(iRight.x*imageToViewScale.x,
+            iRight.y*imageToViewScale.y);
+
+    m_transform->viewToImage(vRight, testCenter);
+    if(testCenter.hasNans())
+    {
+       return false;
+    }
+    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
+         testCenter.y*imageToViewScale.y);
+    double errorCheck3 = (testFullRes - iFullRes).length();
+
+    iFullRes = ossimDpt(iBottom.x*imageToViewScale.x,
+            iBottom.y*imageToViewScale.y);
+
+    m_transform->viewToImage(vBottom, testCenter);
+    if(testCenter.hasNans())
+    {
+       return false;
+    }
+    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
+         testCenter.y*imageToViewScale.y);
+    double errorCheck4 = (testFullRes - iFullRes).length();
+
+    iFullRes = ossimDpt(iLeft.x*imageToViewScale.x,
+            iLeft.y*imageToViewScale.y);
+
+    m_transform->viewToImage(vLeft, testCenter);
+    testFullRes = ossimDpt(testCenter.x*imageToViewScale.x,
+         testCenter.y*imageToViewScale.y);
+    double errorCheck5 = (testFullRes - iFullRes).length();
+
+   std::cout <<"__________________________\n"
+         << "ERROR1:" <<errorCheck1 << "\n" 
+         << "ERROR2:" <<errorCheck2 << "\n" 
+         << "ERROR3:" <<errorCheck3 << "\n" 
+         << "ERROR4:" <<errorCheck4 << "\n" 
+         << "ERROR5:" <<errorCheck5 << "\n"
+         << "SENS:  " << error <<  "\n"; 
+
+    result = ((errorCheck1 < error)&&
+      (errorCheck2 < error)&&
+      (errorCheck3 < error)&&
+      (errorCheck4 < error)&&
+      (errorCheck5 < error));
+    // std::cout << "CAN INTERPOLATE? " << result <<"\n";
+#endif
+  }
+  return result;
+
+}
+
+void ossimImageRenderer::ossimRendererSubRectInfo::getViewMids(ossimDpt& upperMid,
+                 ossimDpt& rightMid,
+                 ossimDpt& bottomMid,
+                 ossimDpt& leftMid,
+                 ossimDpt& center)const
+{
+  
+  upperMid  = (m_Vul + m_Vur)*.5;
+  rightMid  = (m_Vur + m_Vlr)*.5;
+  bottomMid = (m_Vlr + m_Vll)*.5;
+  leftMid   = (m_Vul + m_Vll)*.5;
+  center    = (m_Vul + m_Vur + m_Vlr + m_Vll)*.25;
+}
+
+void ossimImageRenderer::ossimRendererSubRectInfo::getImageMids(ossimDpt& upperMid,
+                  ossimDpt& rightMid,
+                  ossimDpt& bottomMid,
+                  ossimDpt& leftMid,
+                  ossimDpt& center)const
+{
+  if(imageHasNans())
+  {
+    upperMid.makeNan();
+    rightMid.makeNan();
+    bottomMid.makeNan();
+    leftMid.makeNan();
+    center.makeNan();
+  }
+  else
+  {
+    upperMid  = (m_Iul + m_Iur)*.5;
+    rightMid  = (m_Iur + m_Ilr)*.5;
+    bottomMid = (m_Ilr + m_Ill)*.5;
+    leftMid   = (m_Iul + m_Ill)*.5;
+    center    = (m_Iul + m_Iur + m_Ilr + m_Ill)*.25;
+  }
+}
+
+ossimDpt ossimImageRenderer::ossimRendererSubRectInfo::getParametricCenter(const ossimDpt& ul, const ossimDpt& ur, 
+                              const ossimDpt& lr, const ossimDpt& ll)const
+{
+  ossimDpt top    = ur - ul;
+  ossimDpt bottom = lr - ll;
+  
+  ossimDpt centerTop = ul + top * .5;
+  ossimDpt centerBottom = ll + bottom * .5;
+
+  return centerBottom + (centerBottom - centerTop)*.5;
+}
+
+ossimImageRenderer::ossimImageRenderer()
+:
+ossimImageSourceFilter(),
+ossimViewInterface(0),
+m_Resampler(0),
+m_BlankTile(0),
+m_Tile(0),
+m_TemporaryBuffer(0),
+m_StartingResLevel(0),
+m_ImageViewTransform(0),
+m_inputR0Rect(),
+m_viewRect(),
+m_rectsDirty(true),
+m_MaxRecursionLevel(5),
+m_AutoUpdateInputTransform(true),
+m_MaxLevelsToCompute(999999) // something large so it will always compute
+{
+   ossimViewInterface::theObject = this;
+   m_Resampler = new ossimFilterResampler();
+   m_ImageViewTransform = new ossimImageViewProjectionTransform;
+}
+
+ossimImageRenderer::ossimImageRenderer(ossimImageSource* inputSource,
+                                       ossimImageViewTransform* imageViewTrans)
+   : ossimImageSourceFilter(inputSource),
+     ossimViewInterface(0),
+     m_Resampler(0),
+     m_BlankTile(0),
+     m_Tile(0),
+     m_TemporaryBuffer(0),
+     m_StartingResLevel(0),
+     m_ImageViewTransform(imageViewTrans),
+     m_inputR0Rect(),
+     m_viewRect(),
+     m_rectsDirty(true),
+     m_MaxRecursionLevel(5),
+     m_AutoUpdateInputTransform(true),
+     m_MaxLevelsToCompute(999999) // something large so it will always compute
+{
+   ossimViewInterface::theObject = this;
+   m_Resampler = new ossimFilterResampler();
+   if(!m_ImageViewTransform.valid())
+   {
+      m_ImageViewTransform = new ossimImageViewProjectionTransform;
+   }
+}
+
+ossimImageRenderer::~ossimImageRenderer()
+{
+  m_ImageViewTransform = 0;
+
+   if(m_Resampler)
+   {
+      delete m_Resampler;
+      m_Resampler = 0;
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimImageRenderer::getTile(
+   const  ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   // std::cout << "_________________________\n";
+   static const char MODULE[] = "ossimImageRenderer::getTile";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " Requesting view rect = "
+         << tileRect << endl;
+   }
+
+   // long w = tileRect.width();
+   // long h = tileRect.height();
+   // ossimIpt origin = tileRect.ul();
+   
+   if( !m_BlankTile.valid() || !m_Tile.valid() )
+   {
+      allocate();
+      if ( !m_BlankTile.valid() || !m_Tile.valid() )
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimImageRenderer::getTile tile allocation failure!\n"
+               << endl;
+         }
+         return ossimImageSourceFilter::getTile(tileRect, resLevel);
+      }
+   }
+
+   m_BlankTile->setImageRectangle(tileRect);
+   
+   if(!theInputConnection)
+   {
+      return m_BlankTile;
+   }
+   
+   if ( !isSourceEnabled()||(!m_ImageViewTransform.valid())||
+        (!m_ImageViewTransform->isValid()) )
+   {
+      // This tile source bypassed, return the input tile source.
+      return theInputConnection->getTile(tileRect, resLevel);  
+   }
+
+   if( m_rectsDirty )
+   {
+      initializeBoundingRects();
+
+      // We can't go on without these...
+      if ( m_rectsDirty )
+      {
+         return m_BlankTile;
+      }
+   }
+   
+   if(m_viewRect.width() < 4 && m_viewRect.height() < 4)
+   {
+      return m_BlankTile;
+   }
+
+   if( !theInputConnection || 
+       !m_viewRect.intersects(tileRect) ||
+       !m_viewArea.intersects(tileRect) )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << "No intersection, Returning...." << endl;
+      }
+      return m_BlankTile;
+   }
+   
+   // drb - handled above...
+   // if(!m_Tile)
+   // {
+   //    return theInputConnection->getTile(tileRect, resLevel);
+   // }
+
+   // Check for identity transform:
+   if( m_ImageViewTransform->isIdentity() == true )
+   {
+      return theInputConnection->getTile(tileRect, resLevel);
+   }
+   
+   // long tw = m_Tile->getWidth();
+   // long th = m_Tile->getHeight();
+   
+   m_Tile->setImageRectangle(tileRect);
+   m_Tile->makeBlank();
+ 
+
+  //if(!(m_viewArea.intersects(ossimPolyArea2d(tileRect))))
+  //{
+  //  return m_BlankTile;
+  //} 
+
+#if 0
+   // expand a small patch just to alleviate errors in the size of the rect when resampling
+     // ossimIrect viewRectClip = tileRect.clipToRect(ossimIrect(m_viewRect.ul() + ossimIpt(-8,-8),
+     //                                                          m_viewRect.lr() + ossimIpt(8,8)));
+   ossimIrect viewRectClip = tileRect.clipToRect(m_viewRect);
+   std::cout << "_____________________" << std::endl;
+   std::cout << "viewRectClip = " <<  viewRectClip << std::endl;
+//   std::cout << "tileRect = " <<  tileRect << std::endl;
+//   std::cout << "m_viewRect = " <<  m_viewRect << std::endl;
+   ossimRendererSubRectInfo subRectInfo(viewRectClip.ul(),
+                                        viewRectClip.ur(),
+                                        viewRectClip.lr(),
+                                        viewRectClip.ll());
+#else
+   ossimRendererSubRectInfo subRectInfo(m_ImageViewTransform.get(),
+                                        tileRect.ul(),
+                                        tileRect.ur(),
+                                        tileRect.lr(),
+                                        tileRect.ll());
+
+
+#endif
+   subRectInfo.m_viewBounds = &m_viewArea;
+   subRectInfo.transformViewToImage();
+
+   if((!m_viewArea.intersects(subRectInfo.getViewRect())))
+//   if((!m_viewRect.intersects(subRectInfo.getViewRect())))
+   {
+     return m_BlankTile;
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " image rect = " << subRectInfo.getImageRect() << std::endl;
+   }
+
+   // If the image rect is completely outside of the valid image, there is no need to resample:
+   // (OLK 11/18)
+//   if ((!subRectInfo.imageHasNans())&&!m_inputR0Rect.intersects(subRectInfo.getImageRect()))
+//   {
+//      return m_Tile;
+//   }
+   recursiveResample(m_Tile, subRectInfo, 1);
+  
+   if(m_Tile.valid())
+   {
+      m_Tile->validate();
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << "Returning...." << endl;
+   }
+   return m_Tile;
+}
+
+void ossimImageRenderer::recursiveResample(ossimRefPtr<ossimImageData> outputData,
+                                           const ossimRendererSubRectInfo& rectInfo,
+                                           ossim_uint32 /* level */)
+{
+  // Removed recursion and just use the std::stack.
+  //
+  std::stack<ossimRendererSubRectInfo> rectStack;
+  rectStack.push(rectInfo);
+
+  while(!rectStack.empty())
+  {
+    ossimRendererSubRectInfo currentRectInfo = rectStack.top();
+    ossimIrect tempViewRect = currentRectInfo.getViewRect();
+    rectStack.pop();
+    if(m_viewArea.intersects(tempViewRect))
+    {
+      if(tempViewRect.width() <2 ||
+          tempViewRect.height() <2)
+      {
+          if(!currentRectInfo.imageHasNans())
+          {
+             fillTile(outputData,
+                      currentRectInfo);
+          }
+      }
+      else
+      {
+        ossim_uint32 idx = 0;
+        std::vector<ossimRendererSubRectInfo> splitRects;
+        currentRectInfo.splitView(splitRects);
+        if(!splitRects.empty())
+        {
+          for(idx = 0; idx < splitRects.size();++idx)
+          {
+            if(m_viewArea.intersects(splitRects[idx].getViewRect()))
+            {
+              rectStack.push(splitRects[idx]);
+            }
+            // recursiveResample(outputData,
+            //                   splitRects[idx],
+            //                   level + 1);
+          }
+        }
+        else
+        {
+          if(!currentRectInfo.imageHasNans())
+          {
+            fillTile(outputData,
+                    currentRectInfo);
+          }
+        }
+      }
+
+    }
+  }
+  #if 0
+   ossimIrect tempViewRect = rectInfo.getViewRect();
+   if(rectInfo.imageIsNan())
+   {
+      return;
+   } 
+
+  if(tempViewRect.width() <2 ||
+      tempViewRect.height() <2)
+  {
+      if(!rectInfo.imageHasNans())
+      {
+         fillTile(outputData,
+                  rectInfo);
+      }
+      return;
+  }
+  //
+  std::vector<ossimRendererSubRectInfo> splitRects;
+  rectInfo.splitView(splitRects);
+
+//std::cout << "SHOULD BE SPLITTING: " << splitRects.size() <<"\n";
+  ossim_uint32 idx = 0;
+  if(!splitRects.empty())
+  {
+   // std::cout << "SPLITTING " << level << ", " << tempViewRect << "\n";
+    for(idx = 0; idx < splitRects.size();++idx)
+    {
+      recursiveResample(outputData,
+                        splitRects[idx],
+                        level + 1);
+    }
+  }
+  else if(!rectInfo.imageHasNans())
+  {
+    fillTile(outputData,
+            rectInfo);
+  }
+  #endif
+}
+
+#define RSET_SEARCH_THRESHHOLD 0.1
+
+void ossimImageRenderer::fillTile(ossimRefPtr<ossimImageData> outputData,
+                                  const ossimRendererSubRectInfo& rectInfo)
+{
+   if(!outputData.valid() || !outputData->getBuf() || rectInfo.imageHasNans())
+   {
+      return;
+   }
+   ossimDrect vrect = rectInfo.getViewRect();
+   
+   ossimDpt imageToViewScale = rectInfo.getAbsValueImageToViewScales();
+   
+   if(imageToViewScale.hasNans()) return;
+   
+   ossimDpt tile_size = ossimDpt(vrect.width(), vrect.height());
+   double kernelSupportX, kernelSupportY;
+   
+   double resLevelX = log( 1.0 / imageToViewScale.x )/ log( 2.0 );
+   double resLevelY = log( 1.0 / imageToViewScale.y )/ log( 2.0 );
+   double resLevel0 = resLevelX < resLevelY ? resLevelX : resLevelY;
+   long closestFitResLevel = (long)floor( resLevel0 );
+   
+   //double averageScale = (imageToViewScale.x + imageToViewScale.y) / 2.0;
+   //long closestFitResLevel = (long)floor( log( 1.0 / averageScale )/ log( 2.0 ) );
+   
+   ossim_uint32 resLevel = closestFitResLevel<0 ? 0:closestFitResLevel;
+   resLevel += m_StartingResLevel;
+
+   //---
+   // ESH 02/2009: If requested resLevel is too high, let's lower it to one
+   // that is ok.
+   //---
+#if 0
+   const ossim_uint32 NUM_LEVELS = theInputConnection->getNumberOfDecimationLevels();
+   if ( (NUM_LEVELS > 0) && (resLevel >=  NUM_LEVELS) )
+   {
+      resLevel = NUM_LEVELS - 1;
+   }
+#endif
+   //---
+   // ESH 11/2008: Check the rset at the calculated resLevel to see
+   // if it has the expected decimation factor. It it does, we can 
+   // use this rset and assume it is at resLevel.
+   //--- 
+   ossimDpt decimation;
+   decimation.makeNan(); // initialize to nan.
+   theInputConnection->getDecimationFactor(resLevel, decimation);
+   double requestScale = 1.0 / (1<<resLevel);
+   double closestScale = decimation.hasNans() ? requestScale : decimation.x;
+
+#if 0
+   double differenceTest = 0.0;
+   if (closestScale != 0.0)
+   {
+      differenceTest = (1.0/closestScale) - (1.0/requestScale);
+   }
+
+   //---
+   // ESH 11/2008: Add in threshold test so search only happens when 
+   //              necessary.
+   // We do an rset search if 1 of 2 conditions is met: either
+   //   1) the rset is really different in size from the requested size, or
+   //   2) they're similar in size, and the actual rset is smaller than 
+   //      the requested size.
+   //---
+   if ( (fabs(differenceTest) > RSET_SEARCH_THRESHHOLD) || 
+        ((fabs(differenceTest) < RSET_SEARCH_THRESHHOLD) &&
+         (differenceTest < 0.0) ) )
+   {
+      //---
+      // ESH 11/2008: We test for the best rset. We assume 
+      // that decimation level always decreases as resLevel increases, so 
+      // the search can end before testing all rsets.
+      //---
+      ossim_uint32 savedResLevel = resLevel;
+      closestScale = 1.0; // resLevel 0
+      resLevel = 0;
+      ossim_uint32 i;
+      for( i=1; i<NUM_LEVELS; ++i )
+      {
+         theInputConnection->getDecimationFactor(i, decimation);
+         if(decimation.hasNans() == false )
+         {
+            double testDiscrepancy = decimation.x - requestScale;
+            if ( testDiscrepancy < 0.0 ) // we're done
+            {
+               break;
+            }
+            else
+            {
+               closestScale = decimation.x;
+               resLevel = i;
+            }
+         }
+         else // use the default value
+         {
+            closestScale = requestScale;
+            resLevel = savedResLevel;
+            break;
+         }
+      }
+   }
+#endif
+   ossimDpt nul(rectInfo.m_Iul.x*closestScale,
+                rectInfo.m_Iul.y*closestScale);
+   ossimDpt nll(rectInfo.m_Ill.x*closestScale,
+                rectInfo.m_Ill.y*closestScale);
+   ossimDpt nlr(rectInfo.m_Ilr.x*closestScale,
+                rectInfo.m_Ilr.y*closestScale);
+   ossimDpt nur(rectInfo.m_Iur.x*closestScale,
+                rectInfo.m_Iur.y*closestScale);
+   
+   m_Resampler->getKernelSupport( kernelSupportX, kernelSupportY );
+   
+   ossimDrect boundingRect = ossimDrect( nul, nll, nlr, nur );
+   
+
+   boundingRect = ossimIrect((ossim_int32)floor(boundingRect.ul().x - (kernelSupportX)-.5),
+                             (ossim_int32)floor(boundingRect.ul().y - (kernelSupportY)-.5),
+                             (ossim_int32)ceil (boundingRect.lr().x + (kernelSupportX)+.5),
+                             (ossim_int32)ceil (boundingRect.lr().y + (kernelSupportY)+.5));
+   
+   ossimDrect requestRect = boundingRect;
+   
+   ossimRefPtr<ossimImageData> data = getTileAtResLevel(requestRect, resLevel);
+   
+   ossimDataObjectStatus status = OSSIM_NULL;
+   if( data.valid() )
+   {
+      status = data->getDataObjectStatus();
+   }
+   if( (status == OSSIM_NULL) || (status == OSSIM_EMPTY) )
+   {
+      return;
+   }
+   
+   if((boundingRect.width() <2)&&(boundingRect.height()<2))
+   {
+              
+//    return;
+   }// std::cout << "SMALL RECT!!!!!!\n";
+   else
+   {
+     ossimDrect inputRect = m_inputR0Rect;
+     inputRect = inputRect*ossimDpt(closestScale, closestScale);
+     m_Resampler->setBoundingInputRect(inputRect);
+     
+     double denominatorY = 1.0;
+     if(tile_size.y > 2)
+     {
+        denominatorY = tile_size.y-1.0;
+     }
+     
+     ossimDpt newScale( imageToViewScale.x / closestScale,
+                       imageToViewScale.y / closestScale );
+     m_Resampler->setScaleFactor(newScale);
+     
+
+  //std::cout << "SPLIT VIEW RECT: " << vrect << std::endl;
+  //std::cout << "VIEW RECT: " << outputData->getImageRectangle() << std::endl;
+
+
+     m_Resampler->resample(data,
+                           outputData,
+                           vrect,
+                           nul,
+                           nur,
+                           ossimDpt( ( (nll.x - nul.x)/denominatorY ),
+                                     ( (nll.y - nul.y)/denominatorY ) ),
+                           ossimDpt( ( (nlr.x - nur.x)/denominatorY ),
+                                     ( (nlr.y - nur.y)/denominatorY ) ),
+                           tile_size);
+   }
+   
+}
+
+long ossimImageRenderer::computeClosestResLevel(const std::vector<ossimDpt>& decimationFactors,
+                                                double scale)const
+{
+   long result = 0;
+   long upper  = (long)decimationFactors.size();
+   bool done   = false;
+   
+   if(upper > 1)
+   {
+      while((result < upper)&&!done)
+      {
+         if(scale < decimationFactors[result].x)
+         {
+            ++result;
+         }
+         else
+         {
+            done = true;
+         }
+      }
+      
+      // now use the higher res level and resample down
+      //
+      if(result)
+      {
+         --result;
+      }
+   }
+   return result;
+}
+
+ossimIrect ossimImageRenderer::getBoundingRect(ossim_uint32 resLevel)const
+{
+   //---
+   // 01 November 2011:
+   // Backed out expand code as the ossimImageViewProjectionTransform::getImageToViewBounds
+   // does not handle image on the edge of international date line. D. Burken
+   //---
+   
+   // The input bounding rect as returned here corresponds to "pixel-is-point", i.e., the center
+   // of the pixel area for the corners and not the edges which extend 1/2 pixel in all 
+   // directions. Because the view is probably a different GSD, first expand the input
+   // bounding rect to the edge before transforming to a view rect. Then shrink the view rect by
+   // 1/2 pixel to get it to the pixel center (OSSIM convention for bounding rect -- this may 
+   // need to be revisited in light of the need to match edges, not pixel centers, OLK 09/11).
+
+   // Code functionality moved to below method. (drb - 08 Nov. 2011)
+   
+   ossimIrect result;
+   getBoundingRect( result, resLevel );
+   return result;
+}
+
+void ossimImageRenderer::getBoundingRect(ossimIrect& rect, ossim_uint32 resLevel) const
+{
+   if ( isSourceEnabled() )
+   {
+      rect = m_viewRect;
+   }
+   else if ( theInputConnection )
+   {
+      rect = theInputConnection->getBoundingRect(resLevel);
+   }
+   else
+   {
+      rect.makeNan();
+   }
+#if 0 /* Please leave for debug. */
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageRenderer::getBoundingRect(rect, resLevel) debug:\nbounds  = "
+         << rect << "\n";
+   }
+#endif  
+}
+
+void ossimImageRenderer::initializeBoundingRects()
+{
+   m_rectsDirty      = true;
+   ossimImageViewProjectionTransform* ivpt = 
+                   dynamic_cast<ossimImageViewProjectionTransform*>(m_ImageViewTransform.get()); 
+   if(!theInputConnection||!m_ImageViewTransform.valid()) return;
+   m_inputR0Rect = theInputConnection->getBoundingRect(0);
+   if (!m_inputR0Rect.hasNans() )
+   {
+     if(ivpt&&ivpt->getImageGeometry()&&ivpt->getViewGeometry())
+     {
+         // Little complicated but instead of always setting the edge walk
+         // to a high number like 50 points per edge
+         // we will look at the image to view scale change
+         // and use that as a factor.  So as the image zooms out we
+         // need fewer points to estimate the edge.
+         //
+         // ossim_uint32 idx;
+         std::vector<ossimDrect> boundList;
+         ossimImageGeometry* igeom = ivpt->getImageGeometry(); // look at projected meters
+         ossimImageGeometry* vgeom = ivpt->getViewGeometry(); // look at projected meters
+         ossimDrect testRect;
+         igeom->getBoundingRect(testRect);
+         ossimDpt mpp = igeom->getMetersPerPixel();
+         ossimDpt vmpp = vgeom->getMetersPerPixel();
+         ossim_float64 scale = 1.0;
+         ossim_uint32 maxLen = ossim::max(testRect.width(), testRect.height());
+
+         // (GP March 2, 2017) determine goodMatch : test if we have either enough samples to closely match the post spacing 
+         //  or if we have at least half the number of pixels along the edge of an image
+         //
+         // This is hopefully to help avoid when using the polygon for intersection to not have
+         // bad intersection tests when zooming.  We might have to rethink it and implement
+         // this as a windowed edge walker.  So when zooming we create a polygon that 
+         // is denser for only what the view can see and not the entire image.  Basically interatively
+         // tesselate the input image model based on bounding volumes and then create a dense edge walker
+         // for what lies in the view at the given scale.  Too much to implement right now so we will cheet
+         // and take an easy way out for now.
+         // 
+
+         if(!mpp.hasNans()&&!vmpp.hasNans())
+         {
+            scale = mpp.y/vmpp.y;
+            if(scale > 1.0) scale = 1.0; 
+         }  
+         ossim_float64 mppTest = mpp.y;
+         ossim_float64 divisor = mppTest; // default to 30 meter elevation
+         if(mppTest < 500 )
+         {
+            if(mppTest >= 45 )
+            {
+               divisor = 90; // 90 meters
+            }
+         }
+         else
+         {
+            divisor = 1000; // 1 kilometer
+         }
+         if(divisor < 30) divisor = 30.0;
+
+
+         // now test to see if our edge walk is close to matching enough
+         // points for a good match.
+         //
+         ossim_uint32 maxEdgeSample = ossim::min(static_cast<ossim_uint32>(50), maxLen); 
+         if(maxEdgeSample < 1) maxEdgeSample = 1;
+         ossim_uint32 testEdgeSample = ossim::round<ossim_uint32>((maxLen*scale*mpp.y)/divisor);
+
+         bool goodMatch = (testEdgeSample<=maxEdgeSample)||(testEdgeSample>=(maxLen>>1));
+         ossim_float64 steps = ossim::min(testEdgeSample, maxEdgeSample); 
+
+         ossim_uint32 finalSteps = ossim::round<ossim_uint32>(steps);
+         if(finalSteps<1) finalSteps=1;
+         if(igeom->getCrossesDateline())
+         {
+            if(finalSteps < maxEdgeSample) finalSteps = maxEdgeSample;
+         }
+
+         ivpt->getViewSegments(boundList, m_viewArea, finalSteps);
+         if(boundList.size())
+         {
+            m_viewRect   = boundList[0];
+            ossim_uint32 idx = 0;
+
+            if(goodMatch)
+            {
+               m_viewArea = boundList[idx];
+            }
+            else
+            {
+               m_viewArea = m_viewRect;
+            }
+            for(idx=1;idx<boundList.size();++idx)
+            {
+               ossimIrect rectBounds = ossimIrect(boundList[idx]);
+               m_viewRect = m_viewRect.combine(rectBounds);
+               if(goodMatch)
+               {
+                  m_viewArea.add(ossimPolygon(boundList[idx]));
+               }
+               else
+               {
+                  m_viewArea.add(rectBounds);
+               }
+            } //
+            if(!m_viewRect.hasNans())
+            {
+               m_rectsDirty = false;
+            } 
+        } //END if boundList.size()
+     }
+     else if(m_ImageViewTransform.valid())
+     {
+       m_viewRect = m_ImageViewTransform->getImageToViewBounds(m_inputR0Rect);
+
+       if(!m_viewRect.hasNans())
+       {
+          m_rectsDirty = false;
+       } 
+
+       m_viewArea = m_viewRect;
+     }
+   }
+   if ( m_rectsDirty )
+   {
+      m_viewRect.makeNan();
+   }
+#if 0 /* Please leave for debug. */
+   ossimNotify(ossimNotifyLevel_DEBUG)
+      << "ossimImageRenderer::initializeBoundingRects() debug:\n"
+      << "\ninput rect: " << m_inputR0Rect
+      << "\nview rect:  " << m_viewRect << endl;
+#endif
+}
+
+void ossimImageRenderer::initialize()
+{
+   // Call the base class initialize.
+   // Note:  This will reset "theInputConnection" if it changed...
+   ossimImageSourceFilter::initialize();
+
+   deallocate();
+
+   m_rectsDirty = true;
+
+   // we will only do this if we are enabled for this could be expensive
+   if (m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid() && isSourceEnabled())
+   {
+      checkIVT(); // This can initialize bounding rects and clear dirty flag.
+   }
+
+   if ( m_rectsDirty )
+   {
+      initializeBoundingRects();
+   }
+}
+
+void ossimImageRenderer::deallocate()
+{
+   m_Tile            = 0;
+   m_BlankTile       = 0;
+   m_TemporaryBuffer = 0;
+}
+
+void ossimImageRenderer::allocate()
+{
+   deallocate();
+
+   if(theInputConnection)
+   {
+      m_Tile = ossimImageDataFactory::instance()->create(this, this);
+      m_BlankTile  = ossimImageDataFactory::instance()->create(this, this);
+      
+      m_Tile->initialize();
+   }
+}
+
+bool ossimImageRenderer::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix)const
+{
+   if(m_ImageViewTransform.valid())
+   {
+      ossimString newPrefix = ossimString(prefix) + ossimString("image_view_trans.");
+      
+      m_ImageViewTransform->saveState(kwl, newPrefix.c_str());
+   }
+   if(m_Resampler)
+   {
+      m_Resampler->saveState(kwl,
+                              (ossimString(prefix)+"resampler.").c_str());
+   }
+   kwl.add(prefix,
+           "max_levels_to_compute",
+           m_MaxLevelsToCompute);
+   
+   return ossimImageSource::saveState(kwl, prefix);
+}
+
+bool ossimImageRenderer::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimImageRenderer::loadState entered..." << endl;
+      
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << endl;
+#endif      
+   }
+   
+   ossimString newPrefix = ossimString(prefix) + ossimString("image_view_trans.");
+   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
+   
+   if(m_Resampler)
+   {
+      m_Resampler->loadState(kwl,
+                              (ossimString(prefix)+"resampler.").c_str());
+   }
+   m_ImageViewTransform = 0;
+   m_ImageViewTransform = ossimImageViewTransformFactory::instance()->createTransform(kwl, newPrefix.c_str());
+   if(!m_ImageViewTransform)
+   {
+      m_ImageViewTransform = new ossimImageViewProjectionTransform;
+   }
+   const char* maxLevelsToCompute = kwl.find(prefix,
+                                             "max_levels_to_compute");
+   if(maxLevelsToCompute)
+   {
+      m_MaxLevelsToCompute = ossimString(maxLevelsToCompute).toUInt32();
+   }
+   
+   return result;
+}
+
+void ossimImageRenderer::setImageViewTransform(ossimImageViewTransform* ivt)
+{
+   m_ImageViewTransform = ivt;
+   
+   m_rectsDirty = true; // Want to recompute bounding rects.
+   
+   if ( m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid() && isSourceEnabled() )
+   {
+      checkIVT(); // This can initialize bounding rects and clear dirty flag.
+   }
+   
+   if ( m_rectsDirty ) 
+   {
+      initializeBoundingRects();
+   }
+}
+
+bool ossimImageRenderer::setView(ossimObject* baseObject)
+{
+   bool new_view_set = false;
+   if(m_ImageViewTransform.valid())
+   {
+      new_view_set = m_ImageViewTransform->setView(baseObject);
+
+      // If view changes reset the bounding rects.
+      initializeBoundingRects();
+   }
+   return new_view_set;
+}
+
+ossimObject* ossimImageRenderer::getView()
+{
+   if(m_ImageViewTransform.valid())
+   {
+      return m_ImageViewTransform->getView();
+   }
+   return 0;
+}
+
+const ossimObject* ossimImageRenderer::getView()const
+{
+   if(m_ImageViewTransform.valid())
+   {
+      return m_ImageViewTransform->getView();
+   }
+   return 0;
+}
+
+void ossimImageRenderer::getValidImageVertices(vector<ossimIpt>& validVertices,
+                                               ossimVertexOrdering ordering,
+                                               ossim_uint32 resLevel)const
+{
+   if(theInputConnection&&m_ImageViewTransform.valid()&&m_ImageViewTransform->isValid())
+   {
+      theInputConnection->getValidImageVertices(validVertices, ordering, resLevel);
+      if(isSourceEnabled())
+      {
+         ossim_uint32 inputSize = (ossim_uint32)validVertices.size();
+         if(inputSize)
+         {
+            ossimDpt viewPt;
+            ossim_uint32 idx = 0;
+            // transform each point to the view
+            for(idx = 0; idx < inputSize; ++idx)
+            {
+               m_ImageViewTransform->imageToView(validVertices[idx], viewPt);
+               
+               // round it to the nearest pixel
+               //
+               validVertices[idx] = ossimIpt(viewPt);
+            }
+         }
+      }
+   }
+}
+
+//*************************************************************************************************
+// Returns the geometry associated with the image being served out of the renderer. This
+// corresponds to the view geometry defined in theIVT.
+//*************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimImageRenderer::getImageGeometry()
+{
+   // Make sure the IVT was properly initialized
+   if (m_ImageViewTransform.valid() && !m_ImageViewTransform->isValid())
+      checkIVT();
+
+   ossimImageViewProjectionTransform* ivpt = 
+                   dynamic_cast<ossimImageViewProjectionTransform*>(m_ImageViewTransform.get()); 
+   if (ivpt)
+   {
+      // we need to return the right side since the geometry changed to a view geometry
+      return ivpt->getViewGeometry();
+   }
+
+   return ossimRefPtr<ossimImageGeometry>();
+}
+
+void ossimImageRenderer::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
+   if(!m_ImageViewTransform.valid())
+      m_ImageViewTransform  = new ossimImageViewProjectionTransform;
+   
+   checkIVT();
+   initialize();
+}
+
+void ossimImageRenderer::disconnectInputEvent(ossimConnectionEvent& /* event */)
+{
+   ossimImageViewProjectionTransform* ivpt = 
+                   dynamic_cast<ossimImageViewProjectionTransform*>(m_ImageViewTransform.get()); 
+   if(ivpt)
+      ivpt->setImageGeometry(0);
+   
+   theInputConnection = 0;
+}
+
+void ossimImageRenderer::propertyEvent(ossimPropertyEvent& /* event */)
+{
+   checkIVT();
+   initialize();
+}
+
+void ossimImageRenderer::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimString tempName = property->getName();
+   
+   if((tempName == "Filter type")||
+      (tempName == "filter_type"))
+   {
+      if(m_Resampler)
+      {
+         m_Resampler->setFilterType(property->valueToString());
+      }
+   }
+   //   else if(tempName == "Blur factor")
+   //     {
+   //       if(m_Resampler)
+   //    {
+   //      m_Resampler->setBlurFactor(property->valueToString().toDouble());
+   //    }
+   //     }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+      
+ossimRefPtr<ossimProperty> ossimImageRenderer::getProperty(const ossimString& name)const
+{
+   ossimString tempName = name;
+   
+   if((tempName == "Filter type")||
+      (tempName == "filter_type"))
+   {
+      std::vector<ossimString> filterNames;
+      m_Resampler->getFilterTypes(filterNames);
+      
+      ossimStringProperty* stringProp = new ossimStringProperty("filter_type",
+                        m_Resampler->getMinifyFilterTypeAsString(),
+                        false,
+                        filterNames);
+      stringProp->clearChangeType();
+      stringProp->setReadOnlyFlag(false);
+      stringProp->setCacheRefreshBit();
+      
+      return stringProp;
+   }
+//   else if(tempName == "Blur factor")
+//   {
+//      ossimNumericProperty* numericProperty = new ossimNumericProperty("Blur factor",
+//                                                                       ossimString::toString((double)m_Resampler->getBlurFactor()));
+   
+//      numericProperty->setConstraints(0.0, 50.0);
+//      numericProperty->setNumericType(ossimNumericProperty::ossimNumericPropertyType_FLOAT64);
+//      numericProperty->setCacheRefreshBit();
+   
+//      return numericProperty;
+//   }
+   
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimImageRenderer::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+  ossimImageSourceFilter::getPropertyNames(propertyNames);
+
+  propertyNames.push_back("Filter type");
+//  propertyNames.push_back("Blur factor");
+}
+
+//*************************************************************************************************
+// Insures that a proper IVT is established.
+//*************************************************************************************************
+void ossimImageRenderer::checkIVT()
+{
+   if(!isSourceEnabled())
+      return;
+
+   // Check validity of the IVT:
+   if (m_ImageViewTransform->isValid())
+      return;
+
+   // Detected uninitialized IVT. We are only concerned with projection IVTs (IVPTs) so 
+   // make sure that's what we're working with:
+   ossimImageViewProjectionTransform* ivpt = 
+                   dynamic_cast<ossimImageViewProjectionTransform*>(m_ImageViewTransform.get()); 
+   ossimImageSource* inputSrc = PTR_CAST(ossimImageSource, getInput(0));
+
+   if(!ivpt || !inputSrc) 
+      return; // nothing to do here yet.
+
+   // Fetch the input image geometry from the IVPT to see if one needs to be established:
+   ossimRefPtr<ossimImageGeometry> inputGeom = ivpt->getImageGeometry();
+   if ( !inputGeom )
+   {
+      // Ask the input source for a geometry:
+      inputGeom = inputSrc->getImageGeometry();
+      if ( !inputGeom )
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)<<"ossimImageRenderer::checkTransform() -- "
+            "No input image geometry could be established for this renderer."<<endl;
+         }
+         return;
+      }
+      ivpt->setImageGeometry( inputGeom.get() );
+      m_rectsDirty = true;
+   }
+
+   // Now check the output view geometry:
+   ossimRefPtr<ossimImageGeometry> outputGeom = ivpt->getViewGeometry();
+   if (!outputGeom)
+   {
+      ossimRefPtr<ossimImageGeometry> myOutGeom = new ossimImageGeometry;
+
+      //---
+      // If the input geometry sports a map projection instead of a 3D
+      // projector, use the same map projection for the view.
+      // 
+      // Note: Don't use map projections with model transforms as they don't
+      // allow for changing resolution.
+      //---
+      const ossimProjection*  inputProj = inputGeom->getProjection();
+      const ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, inputProj);
+      if (mapProj && !mapProj->hasModelTransform() )
+      {
+         ossimProjection* my_proj = PTR_CAST(ossimProjection, mapProj->dup());
+         myOutGeom->setProjection(my_proj);
+      }
+      else 
+      {
+         // The input geometry uses a 3D projection, so let's default here to a
+         // ossimEquDistCylProjection for the view:
+         ossimMapProjection* myMapProj = new ossimEquDistCylProjection;
+         ossimDpt meters = inputGeom->getMetersPerPixel();
+         double GSD = (meters.x + meters.y)/2.0;
+         meters.x = GSD;
+         meters.y = GSD;
+         if(inputProj)
+         {
+            //---
+            // Update the map projection.  Since ossimMapProjection::setOrigin calls
+            // ossimMapProjection::update we do that before setUlTiePoints as it in
+            // turn calls setUlEastingNorthing(forward(gpt)) which depends on the orgin.
+            //---
+            myMapProj->setOrigin(inputProj->origin());
+            myMapProj->setUlTiePoints( inputProj->origin() );
+
+         }
+         myMapProj->setMetersPerPixel(meters);
+         myOutGeom->setProjection(myMapProj);
+      }
+      
+      // Set up our IVT with the new output geometry:
+      ivpt->setViewGeometry(myOutGeom.get());
+
+      // Must reinitialize bounding rects before calling ossimImageGeometry::setImageSize().
+      initializeBoundingRects();
+
+      // Set the size on the ossimImageGeometry.
+      ossimIrect rect;
+      getBoundingRect(rect, 0);
+      myOutGeom->setImageSize( rect.size() );
+   }
+
+   if ( m_rectsDirty )
+   {
+      initializeBoundingRects();
+   }
+}
+
+void ossimImageRenderer::getDecimationFactor(ossim_uint32 resLevel,
+                    ossimDpt& result)const
+{
+   if(isSourceEnabled())
+   {
+      result = ossimDpt(1,1);
+   }
+   else
+   {
+      ossimImageSourceFilter::getDecimationFactor(resLevel,
+                    result);
+   }
+}
+
+void ossimImageRenderer::getDecimationFactors(vector<ossimDpt>& decimations)const
+{
+   if(isSourceEnabled())
+   {
+      decimations.push_back(ossimDpt(1,1));
+   }
+   else
+   {
+      ossimImageSourceFilter::getDecimationFactors(decimations);
+   }
+}
+
+ossim_uint32 ossimImageRenderer::getNumberOfDecimationLevels()const
+{
+   if(isSourceEnabled())
+   {
+      return 1;
+   }
+   
+   return ossimImageSourceFilter::getNumberOfDecimationLevels();
+}
+
+void ossimImageRenderer::stretchQuadOut(const ossimDpt& amount,
+                                        ossimDpt& ul,
+                                        ossimDpt& ur,
+                                        ossimDpt& lr,
+                                        ossimDpt& ll)
+{
+   ossimDpt upper  = ur - ul;
+   ossimDpt right  = lr - ur;
+   ossimDpt bottom = ll - lr;
+   ossimDpt left   = ul - ll;
+   
+   upper = (upper*(1.0 / upper.length()));
+   upper.x *= amount.x;
+   upper.y *= amount.y;
+   right = (right*(1.0 / right.length()));
+   right.x *= amount.x;
+   right.y *= amount.y;
+   bottom = (bottom*(1.0 / bottom.length()));
+   bottom.x *= amount.x;
+   bottom.y *= amount.y;
+   left = (left*(1.0 / left.length()));
+   left.x *= amount.x;
+   left.y *= amount.y;
+   
+   
+   ul = ul - upper + left;
+   ur = ur + upper - right;
+   lr = lr + left - bottom;
+   ll = ll - left + bottom;
+}
+
+ossimRefPtr<ossimImageData>  ossimImageRenderer::getTileAtResLevel(const ossimIrect& boundingRect,
+                                                       ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      m_BlankTile->setImageRectangle(boundingRect);
+      
+      return m_BlankTile;
+   }
+   
+   ossim_uint32 levels = theInputConnection->getNumberOfDecimationLevels();
+   
+   // ossim_uint32 maxValue = (ossim_uint32)ossim::max((ossim_uint32)m_BoundingRect.width(),
+   //                                            (ossim_uint32)m_BoundingRect.height());
+   if(resLevel == 0)
+   {
+      return theInputConnection->getTile(boundingRect);
+   }
+   if(resLevel < levels)
+   {
+      if(theInputConnection)
+      {
+         return theInputConnection->getTile(boundingRect,
+                                            resLevel);
+      }
+      else
+      {
+         return m_BlankTile;
+      }
+   }
+   else if((resLevel - levels) < m_MaxLevelsToCompute)
+   {
+      // check to see how many decimations we must achiev for the
+      // request
+      //
+      int decimations = (resLevel - (levels-1));
+      ossimIpt tileSize(theInputConnection->getTileWidth(),
+                        theInputConnection->getTileHeight());
+      
+      ossim_int32 multiplier = (1 << decimations);
+      
+      ossim_int32 xIndex = 0;
+      ossim_int32 yIndex = 0;
+      
+      // adjust the tilesize so it at least will cover the multiplier
+      // We will probably come up with something better later but for now
+      // this will do.
+      if(multiplier > tileSize.x)
+      {
+         tileSize.x = multiplier;
+      }
+      if(multiplier > tileSize.y)
+      {
+         tileSize.y = multiplier;
+      }
+      
+      // set the rect that covers the requested RLevel to the valid RLevel. 
+      // the valid RLevel is what is available on the input side.
+      //
+      ossimIrect requestedRectAtValidRLevel = boundingRect;
+      requestedRectAtValidRLevel.stretchToTileBoundary(tileSize);
+      ossimIrect mappedRequestedRect = requestedRectAtValidRLevel;
+      requestedRectAtValidRLevel  = requestedRectAtValidRLevel*((double)multiplier);
+      
+      if(!m_TemporaryBuffer)
+      {
+         m_TemporaryBuffer = (ossimImageData*)m_BlankTile->dup();
+         m_TemporaryBuffer->setImageRectangle(mappedRequestedRect);
+         m_TemporaryBuffer->initialize();
+      }
+      else
+      {
+         m_TemporaryBuffer->setImageRectangle(mappedRequestedRect);
+         m_TemporaryBuffer->makeBlank();
+      }
+      
+     // ossim_uint32 totalCount   = ((requestedRectAtValidRLevel.lr().y-requestedRectAtValidRLevel.ul().y)*
+   //                                (requestedRectAtValidRLevel.lr().x-requestedRectAtValidRLevel.ul().x));
+      ossim_uint32 currentCount = 0;
+      ossimIrect boundingRect = theInputConnection->getBoundingRect(levels-1);
+      for(yIndex = requestedRectAtValidRLevel.ul().y;yIndex < requestedRectAtValidRLevel.lr().y; yIndex += tileSize.y)
+      {
+         for(xIndex = requestedRectAtValidRLevel.ul().x; xIndex < requestedRectAtValidRLevel.lr().x; xIndex+=tileSize.x)
+         {
+            ossimIrect request(xIndex,
+                               yIndex,
+                               xIndex + (tileSize.x-1),
+                               yIndex + (tileSize.y-1));
+            ossimRefPtr<ossimImageData> data = theInputConnection->getTile(request, levels-1);
+            
+            if(data.valid() && (data->getDataObjectStatus()!=OSSIM_EMPTY)&&
+               data->getBuf()&&
+               boundingRect.intersects(request))
+            {
+               switch(data->getScalarType())
+               {
+                  case OSSIM_UINT8:
+                  {
+                     resampleTileToDecimation((ossim_uint8)0,
+                                              m_TemporaryBuffer,
+                                              data,
+                                              multiplier);
+                     break;
+                  }
+                  case OSSIM_SINT16:
+                  {
+                     resampleTileToDecimation((ossim_sint16)0,
+                                              m_TemporaryBuffer,
+                                              data,
+                                              multiplier);
+                     break;
+                  }
+                  case OSSIM_UINT16:
+                  case OSSIM_USHORT11:
+                  case OSSIM_USHORT12:
+                  case OSSIM_USHORT13:
+                  case OSSIM_USHORT14:
+                  case OSSIM_USHORT15:
+                  {
+                     resampleTileToDecimation((ossim_uint16)0,
+                                              m_TemporaryBuffer,
+                                              data,
+                                              multiplier);
+                     break;
+                  }
+                  case OSSIM_FLOAT32:
+                  case OSSIM_NORMALIZED_FLOAT:
+                  {
+                     resampleTileToDecimation((ossim_float32)0,
+                                              m_TemporaryBuffer,
+                                              data,
+                                              multiplier);
+                     break;
+                  }
+                  case OSSIM_FLOAT64:
+                  case OSSIM_NORMALIZED_DOUBLE:
+                  {
+                     resampleTileToDecimation((ossim_float64)0,
+                                              m_TemporaryBuffer,
+                                              data,
+                                              multiplier);
+                     break;
+                  }
+                  case OSSIM_SCALAR_UNKNOWN:
+                  default:
+                  {
+                     break;
+                  }
+               }
+            }
+            ++currentCount;
+         }
+      }
+      m_TemporaryBuffer->validate();
+      return m_TemporaryBuffer;
+   }
+
+   return 0;
+}
+
+void ossimImageRenderer::setMaxLevelsToCompute(ossim_uint32 maxLevels)
+{
+   m_MaxLevelsToCompute = maxLevels;
+}
+
+ossim_uint32 ossimImageRenderer::getMaxLevelsToCompute()const
+{
+   return m_MaxLevelsToCompute;
+}
+
+template <class T>
+void ossimImageRenderer::resampleTileToDecimation(T /* dummyVariable */,
+                    ossimRefPtr<ossimImageData> result,
+                    ossimRefPtr<ossimImageData> tile,
+                    ossim_uint32 multiplier)
+{
+   if(tile->getDataObjectStatus() == OSSIM_EMPTY ||
+      !tile->getBuf())
+   {
+      return;
+   }
+   
+   ossim_int32 maxX     = (ossim_int32)tile->getWidth();
+   ossim_int32 maxY     = (ossim_int32)tile->getHeight();
+   ossim_int32 resultHeight = result->getHeight();
+   ossim_int32* offsetX = new ossim_int32[maxX];
+   ossim_int32* offsetY = new ossim_int32[maxY];
+   ossim_int32 i        = 0;
+   ossim_int32 resultWidth     = (ossim_int32)result->getWidth();
+   ossimIpt tileOrigin   = tile->getOrigin();
+   ossimIpt resultOrigin = result->getOrigin();
+   
+   // create a lookup table. that maps the tile to the result
+   for(i = 0; i < maxX; ++i)
+   {
+      offsetX[i] = (i+tileOrigin.x)/(ossim_int32)multiplier - resultOrigin.x;
+      if(offsetX[i] < 0 )
+      {
+         offsetX[i] = 0;
+      }
+      else if(offsetX[i] >= resultWidth)
+      {
+         offsetX[i] = resultWidth-1;
+      }
+   }
+   for(i = 0; i < maxY; ++i)
+   {
+      offsetY[i] = ( ((i+tileOrigin.y)/(ossim_int32)multiplier) - resultOrigin.y);
+      if(offsetY[i] < 0 )
+      {
+         offsetY[i] = 0;
+      }
+      else if(offsetY[i] >= resultHeight)
+      {
+         offsetY[i] = resultHeight-1;
+      }
+      offsetY[i] *= resultWidth;
+   }
+   
+   if(tile->getDataObjectStatus() == OSSIM_FULL)
+   {
+      ossim_int32 numberOfBands = (ossim_int32)std::min(result->getNumberOfBands(),
+                                                        tile->getNumberOfBands());
+      ossim_int32 band = 0;
+      for(band = 0; band < numberOfBands; ++band)
+      {
+         T* tileBuf   = static_cast<T*>(tile->getBuf(band));
+         T* resultBuf = static_cast<T*>(result->getBuf(band));
+         ossim_int32 dx = 0;
+         ossim_int32 dy = 0;
+         ossim_int32 boxAverageX = 0;
+         ossim_int32 boxAverageY = 0;
+         for(dy = 0; dy < maxY; dy+=multiplier)
+         {
+            for(dx = 0; dx < maxX; dx+=multiplier)
+            {
+               double sum = 0.0;
+               for(boxAverageY = 0; 
+                   ((boxAverageY < (ossim_int32)multiplier)&& 
+                    ((boxAverageY+dy)<maxY)); ++boxAverageY)
+               {
+                  for(boxAverageX = 0; 
+                      ((boxAverageX < (ossim_int32)multiplier)&& 
+                       ((boxAverageX+dx)<maxX)); ++boxAverageX)
+                  {
+                     sum += tileBuf[((boxAverageY+dy)*maxX + boxAverageX + dx)];
+                  }
+               }
+               sum /= (double)(multiplier*multiplier);
+               resultBuf[ offsetX[dx] + offsetY[dy] ] = (T)sum;
+            }
+         }
+      }
+   }
+   else
+   {
+      ossim_int32 numberOfBands = (ossim_int32)std::min(result->getNumberOfBands(),
+                                                        tile->getNumberOfBands());
+      ossim_int32 band = 0;
+      for(band = 0; band < numberOfBands; ++band)
+      {
+         T* tileBuf   = static_cast<T*>(tile->getBuf(band));
+         T* resultBuf = static_cast<T*>(result->getBuf(band));
+         T tileBufNp  = static_cast<T>(tile->getNullPix(band));
+         ossim_int32 dx = 0;
+         ossim_int32 dy = 0;
+         ossim_int32 boxAverageX = 0;
+         ossim_int32 boxAverageY = 0;
+         for(dy = 0; dy < maxY; dy+=multiplier)
+         {
+            for(dx = 0; dx < maxX; dx+=multiplier)
+            {
+               double sum = 0.0;
+               if(tileBuf[((dy+(multiplier>>1))*maxX + dx+(multiplier>>1))] != tileBufNp)
+               {
+                  ossim_uint32 nullCount = 0;
+                  for(boxAverageY = 0; 
+                      ((boxAverageY < (ossim_int32)multiplier)&& 
+                       ((boxAverageY+dy)<maxY)); ++boxAverageY)
+                  {
+                     for(boxAverageX = 0; 
+                         ((boxAverageX < (ossim_int32)multiplier)&& 
+                          ((boxAverageX+dx)<maxX)); ++boxAverageX)
+                     {
+                        T value = tileBuf[((boxAverageY+dy)*maxX + boxAverageX + dx)];
+                        if(value != tileBufNp)
+                        {
+                           sum += value;
+                        }
+                        else
+                        {
+                           ++nullCount;
+                        }
+                     }
+                  }
+                  ossim_uint32 area = multiplier*multiplier;
+                  sum /= (double)(area);
+                  if(nullCount!= area)
+                  {
+                     resultBuf[ offsetX[dx] + offsetY[dy] ] = (T)sum;
+                  }
+               }
+            }
+         }
+      }
+      
+   }
+   
+  delete [] offsetX;
+  delete [] offsetY;
+}
+
+ossimString ossimImageRenderer::getLongName() const
+{
+   return ossimString("Image Renderer");
+}
+
+ossimString ossimImageRenderer::getShortName() const
+{
+   return ossimString("Image Renderer"); 
+}
+
+void ossimImageRenderer::refreshEvent(ossimRefreshEvent& event)
+{
+   ossimImageSourceFilter::refreshEvent(event);
+   ossimImageSourceFilter::initialize(); // init connections
+   if((event.getObject()!=this)&&
+      (event.getRefreshType() & ossimRefreshEvent::REFRESH_GEOMETRY))
+   {
+      ossimRefPtr<ossimImageGeometry> inputGeom =
+         theInputConnection?theInputConnection->getImageGeometry():0;
+      if(inputGeom.valid())
+      {
+         ossimImageViewProjectionTransform* ivpt = 
+                         dynamic_cast<ossimImageViewProjectionTransform*>(m_ImageViewTransform.get()); 
+         if(ivpt)
+         {
+            ivpt->setImageGeometry(inputGeom.get());
+         }
+      }
+   }
+   initialize();
+}
+
+void ossimImageRenderer::enableSource()
+{
+   if ( isSourceEnabled() == false )
+   {
+      setEnableFlag( true );
+   }
+}
+
+void ossimImageRenderer::disableSource()
+{
+   if ( isSourceEnabled() )
+   {
+      setEnableFlag( false );
+   }
+}
+
+void ossimImageRenderer::setEnableFlag(bool flag)
+{
+   if ( getEnableFlag() != flag )
+   {
+      ossimImageSourceFilter::setEnableFlag( flag );
+      checkIVT();
+      initialize();
+   }
+}
diff --git a/src/imaging/ossimImageSharpenFilter.cpp b/src/imaging/ossimImageSharpenFilter.cpp
new file mode 100644
index 0000000..1ce4b9d
--- /dev/null
+++ b/src/imaging/ossimImageSharpenFilter.cpp
@@ -0,0 +1,225 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageSharpenFilter.cpp 18021 2010-09-01 12:11:05Z gpotts $
+#include <cstdlib> /* for abs() */
+#include <ossim/imaging/ossimImageSharpenFilter.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+RTTI_DEF1(ossimImageSharpenFilter, "ossimImageSharpenFilter", ossimImageSourceFilter);
+
+static const char* KERNEL_WIDTH_KW = "kernel_width";
+static const char* KERNEL_SIGMA_KW = "kernel_sigma";
+
+ossimImageSharpenFilter::ossimImageSharpenFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+   theWidth(3),
+   theSigma(.5)
+{
+   theConvolutionSource = new ossimConvolutionSource;
+}
+
+ossimImageSharpenFilter::~ossimImageSharpenFilter()
+{
+}
+
+void ossimImageSharpenFilter::setWidthAndSigma(ossim_uint32 w, ossim_float64 sigma)
+{
+   theWidth = w;
+   theWidth |= 1;
+   if(theWidth < 3) theWidth = 3;
+   theSigma = sigma;
+   buildConvolutionMatrix();
+}
+
+ossimRefPtr<ossimImageData> ossimImageSharpenFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return NULL;
+   }
+   if(!isSourceEnabled())
+   {
+      return theInputConnection->getTile(tileRect, resLevel);
+   }
+   return theConvolutionSource->getTile(tileRect, resLevel);   
+}
+
+void ossimImageSharpenFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+   if(theConvolutionSource->getInput()!=getInput())
+   {
+      theConvolutionSource->disconnectAllInputs();
+      theConvolutionSource->connectMyInputTo(0, getInput());
+   }
+   buildConvolutionMatrix();   
+}
+
+void ossimImageSharpenFilter::buildConvolutionMatrix()
+{
+   std::vector<double> theKernel(theWidth*theWidth);
+   double* kernel = &theKernel.front();
+   //width = findWidth(sigma);
+   ossim_int32 i = 0 ;
+   ossim_int32 u = 0 ;
+   ossim_int32 v = 0 ;
+   double normalize = 0.0 ;
+   ossim_int32 w2 = theWidth>>1;
+   for (v = -w2; v <= w2; ++v)
+   {
+      for (u = -w2; u <= w2; ++u)
+      {
+         double value = laplacianOfGaussian(u, v, theSigma);
+         kernel[i] = value;
+         normalize += kernel[i] ;
+         ++i ;
+      }
+   }
+   if (fabs(normalize) <= 1e-6)
+   {
+      normalize = 1.0;
+   }
+   normalize=(1.0/normalize);
+   ossim_int32 size = static_cast<ossim_int32>(theWidth*theWidth);
+   for (i = 0; i < size; ++i)
+   {
+      kernel[i]=kernel[i]*normalize;
+   } 
+      
+#if 0
+   // print the kernel
+   for (i = 0; i < theWidth*theWidth; ++i)
+   {
+      if((i%theWidth)==0)
+      {
+         std::cout << std::endl;
+      }
+      std::cout << kernel[i] <<", ";
+   } 
+   std::cout << std::endl;
+#endif
+   theConvolutionSource->setConvolution(kernel, theWidth, theWidth, false);
+}
+
+void ossimImageSharpenFilter::connectInputEvent(ossimConnectionEvent &event)
+{
+   ossimImageSourceFilter::connectInputEvent(event);
+   theConvolutionSource->connectMyInputTo(0, getInput());
+   buildConvolutionMatrix();
+}
+
+void ossimImageSharpenFilter::disconnectInputEvent(ossimConnectionEvent &event)
+{
+   ossimImageSourceFilter::disconnectInputEvent(event);
+   theConvolutionSource->connectMyInputTo(0, getInput());
+}
+
+ossimString ossimImageSharpenFilter::getShortName() const
+{
+   return ossimString("Sharpen");
+}
+
+ossimString ossimImageSharpenFilter::getLongName() const
+{
+   return ossimString("Sharpens the input");
+}
+
+void ossimImageSharpenFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   //std::cout << "ossimImageSharpenFilter::setProperty with name = " << property->getName() << std::endl;
+   if(!property) return;
+   if(property->getName() == KERNEL_WIDTH_KW)
+   {
+      theWidth = property->valueToString().toUInt32();
+      theWidth |=1;
+      if(theWidth < 3) theWidth = 3;
+      initialize();
+   }
+   else if(property->getName() == KERNEL_SIGMA_KW)
+   {
+      theSigma = property->valueToString().toDouble();
+      if(theSigma < .1) theSigma = .1;
+      initialize();
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property.get());
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimImageSharpenFilter::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> property = 0;
+   if(name == KERNEL_WIDTH_KW)
+   {
+      property = new ossimNumericProperty(name,
+                                          ossimString::toString(theWidth),
+                                          3.0,
+                                          64.0);
+      property->setCacheRefreshBit();
+      
+   }
+   else if(name == KERNEL_SIGMA_KW)
+   {
+      property = new ossimNumericProperty(name,
+                                          ossimString::toString(theSigma),
+                                          .1,
+                                          32);
+      property->setCacheRefreshBit();
+   }
+   else 
+   {
+      property = ossimImageSourceFilter::getProperty(name);
+   }
+   
+   return property.get();
+}
+
+void ossimImageSharpenFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back(KERNEL_WIDTH_KW);
+   propertyNames.push_back(KERNEL_SIGMA_KW);
+}
+
+bool ossimImageSharpenFilter::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   bool result = ossimImageSourceFilter::loadState(kwl, prefix);
+   ossimString kernelWidth = kwl.find(prefix, KERNEL_WIDTH_KW);
+   ossimString kernelSigma = kwl.find(prefix, KERNEL_SIGMA_KW);
+   kernelWidth = kernelWidth.trim();
+   kernelSigma = kernelSigma.trim();
+   if(!kernelWidth.empty())
+   {
+      theWidth = kernelWidth.toUInt32();
+      theWidth |= 1; // make it odd and check for size
+      if(theWidth < 3) theWidth = 3;
+   }
+   if(!kernelSigma.empty())
+   {
+      theSigma = kernelSigma.toFloat64();
+   }
+   buildConvolutionMatrix();
+   return result;
+}
+
+bool ossimImageSharpenFilter::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)const
+{
+   kwl.add(prefix, KERNEL_WIDTH_KW, theWidth, true);
+   kwl.add(prefix, KERNEL_SIGMA_KW, theSigma, true);
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
diff --git a/src/imaging/ossimImageSource.cpp b/src/imaging/ossimImageSource.cpp
new file mode 100644
index 0000000..d7f92e2
--- /dev/null
+++ b/src/imaging/ossimImageSource.cpp
@@ -0,0 +1,378 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageSource.cpp 23100 2015-01-26 19:43:08Z okramer $
+
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimImageSource,
+          "ossimImageSource" ,
+          ossimSource)
+
+ossimImageSource::ossimImageSource(ossimObject* owner)
+   :ossimSource(owner, 0,0,false,false)
+{
+}
+
+ossimImageSource::ossimImageSource(ossimObject* owner,
+                                   ossim_uint32 inputListSize,
+                                   ossim_uint32 outputListSize,
+                                   bool inputListIsFixedFlag,
+                                   bool outputListIsFixedFlag)
+   :
+      ossimSource(owner, inputListSize, outputListSize,
+                  inputListIsFixedFlag, outputListIsFixedFlag)
+{
+}
+
+ossimImageSource::~ossimImageSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimImageSource::getTile(const ossimIpt& origin,
+                                                      ossim_uint32 resLevel)
+{
+   ossimIrect tileRect(origin.x,
+                       origin.y,
+                       origin.x + getTileWidth()  - 1,
+                       origin.y + getTileHeight() - 1);
+   
+   return getTile(tileRect, resLevel);
+}
+
+ossimRefPtr<ossimImageData> ossimImageSource::getTile(const ossimIrect& rect,
+                                                      ossim_uint32 resLevel)
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                      getInput(0));
+   if(inter)
+   {
+      return inter->getTile(rect, resLevel);
+   }
+   return NULL;
+}
+
+
+bool ossimImageSource::getTile(ossimImageData* result, ossim_uint32 resLevel)
+{
+   // This is the default implementation that is not thread-friendly as it uses the object's tile
+   // then simply assigns its buffer to the provided tile. Eventually, all image sources should
+   // override this method.
+   bool status = true;
+   if (result)
+   {
+      ossimIrect tileRect = result->getImageRectangle();
+      ossimRefPtr<ossimImageData> id = getTile(tileRect, resLevel);
+      if (id.valid())
+      {
+         *result = *(id.get());
+         result->loadTile(id.get()); // Deep copy
+      }
+      else
+      {
+         status = false;
+      }
+   }
+
+   return status;
+}
+
+void ossimImageSource::getDecimationFactor(ossim_uint32 resLevel,
+                                           ossimDpt& result)const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      inter->getDecimationFactor(resLevel, result);
+   }
+}
+
+void ossimImageSource::getDecimationFactors(std::vector<ossimDpt>& decimations)const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      inter->getDecimationFactors(decimations);
+   }
+}
+
+ossim_uint32 ossimImageSource::getNumberOfDecimationLevels() const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      return inter->getNumberOfDecimationLevels();
+   }
+   return 0;
+}
+
+ossimScalarType ossimImageSource::getOutputScalarType() const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      return inter->getOutputScalarType();
+   }
+   
+   return OSSIM_SCALAR_UNKNOWN;
+}
+
+ossim_uint32 ossimImageSource::getTileWidth()  const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      return inter->getTileWidth();
+   }
+   ossimIpt tileSize;
+   ossim::defaultTileSize(tileSize);
+   
+   return tileSize.x;
+}
+
+ossim_uint32 ossimImageSource::getTileHeight() const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
+   if(inter)
+   {
+      return inter->getTileHeight();
+   }
+   
+   ossimIpt tileSize;
+   ossim::defaultTileSize(tileSize);
+   
+   return tileSize.y;
+}
+
+ossimIrect ossimImageSource::getBoundingRect(ossim_uint32 resLevel)const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
+   if(inter)
+   {
+      return inter->getBoundingRect(resLevel);
+   }
+   ossimIrect rect;
+   rect.makeNan();
+   return rect;
+}
+
+void ossimImageSource::getBoundingRect(ossimIrect& rect, ossim_uint32 resLevel) const
+{
+   rect = getBoundingRect( resLevel );
+}
+
+bool ossimImageSource::saveState(ossimKeywordlist& kwl,
+                                 const char* prefix)const
+{
+   return ossimSource::saveState(kwl, prefix);
+}
+
+bool ossimImageSource::loadState(const ossimKeywordlist& kwl,
+                                 const char* prefix)
+{
+   return ossimSource::loadState(kwl, prefix);
+}
+
+//*****************************************************************************
+//  METHOD: ossimImageSource::getValidImageVertices()
+//*****************************************************************************
+void ossimImageSource::getValidImageVertices(std::vector<ossimIpt>& validVertices,
+                                             ossimVertexOrdering ordering,
+                                             ossim_uint32 resLevel)const
+{
+  ossimImageSource* inter = PTR_CAST(ossimImageSource,
+					      getInput(0));
+  if(inter)
+    {
+      return inter->getValidImageVertices(validVertices,
+					  ordering,
+                                          resLevel);
+    }
+   ossimIrect boundingRect = getBoundingRect(resLevel);
+   validVertices.clear();
+   
+   if(ordering == OSSIM_CLOCKWISE_ORDER)
+   {
+      validVertices.push_back(boundingRect.ul());
+      validVertices.push_back(boundingRect.ur());
+      validVertices.push_back(boundingRect.lr());
+      validVertices.push_back(boundingRect.ll());
+   }
+   else
+   {
+      validVertices.push_back(boundingRect.ul());
+      validVertices.push_back(boundingRect.ll());
+      validVertices.push_back(boundingRect.lr());
+      validVertices.push_back(boundingRect.ur());
+   }
+}
+
+double ossimImageSource::getNullPixelValue(ossim_uint32 band)const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      return inter->getNullPixelValue(band);
+   }
+   
+   return ossim::defaultNull(getOutputScalarType());
+}
+
+double ossimImageSource::getMinPixelValue(ossim_uint32 band)const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      return inter->getMinPixelValue(band);
+   }
+   return ossim::defaultMin(getOutputScalarType());
+}
+
+double ossimImageSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource,
+                                               getInput(0));
+   if(inter)
+   {
+      return inter->getMaxPixelValue(band);
+   }
+   
+   return ossim::defaultMax(getOutputScalarType());
+}
+
+//**************************************************************************************************
+// Default implementation returns the image geometry object associated with the first input source 
+// (if any) connected to this source, or NULL.
+//**************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimImageSource::getImageGeometry()
+{
+   ossimRefPtr<ossimImageGeometry> result = 0;
+   if ( getInput(0) )
+   {
+      ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
+      if( inter )
+      {
+         result = inter->getImageGeometry();
+      }
+   }
+   return result;
+}
+
+//**************************************************************************************************
+//! Default implementation sets geometry of the first input to the geometry specified.
+//**************************************************************************************************
+void ossimImageSource::setImageGeometry(const ossimImageGeometry* geom)
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
+   if (inter)
+   {
+      inter->setImageGeometry(geom);
+   }
+}
+
+void ossimImageSource::saveImageGeometry() const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
+   if (inter)
+   {
+      inter->saveImageGeometry();
+   }
+}
+
+void ossimImageSource::saveImageGeometry(const ossimFilename& geometry_file) const
+{
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
+   if (inter)
+   {
+      inter->saveImageGeometry(geometry_file);
+   }
+}
+
+void ossimImageSource::getOutputBandList(std::vector<ossim_uint32>& bandList) const
+{
+   const ossim_uint32 INPUT_BANDS = getNumberOfInputBands();
+   if ( INPUT_BANDS )
+   {
+      bandList.resize( INPUT_BANDS );
+      for ( ossim_uint32 band = 0; band < INPUT_BANDS; ++band )
+      {
+         bandList[band] = band;
+      }
+   }
+   else
+   {
+      bandList.clear();
+   }
+}
+
+ossim_uint32 ossimImageSource::getNumberOfOutputBands() const
+{
+   return getNumberOfInputBands();
+}
+
+ossimRefPtr<ossimProperty> ossimImageSource::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result = ossimSource::getProperty(name);
+
+   ossimString tempName = name;
+   if(result.valid())
+   {
+      if(tempName.downcase() == ossimKeywordNames::ENABLED_KW)
+      {
+         result->clearChangeType();
+         
+         // we will at least say its a radiometric change
+         //
+         result->setFullRefreshBit();
+      }
+   }
+
+   return result;
+}
+
+void ossimImageSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimSource::setProperty(property);
+}
+
+void ossimImageSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimSource::getPropertyNames(propertyNames);
+}
+
+bool ossimImageSource::isIndexedData() const
+{
+   bool result = false;
+   ossimImageSource* inter = PTR_CAST(ossimImageSource, getInput(0));
+   if (inter)
+   {
+      result = inter->isIndexedData();
+   }
+   return result;
+}
+
+// Protected to hide from use...
+ossimImageSource::ossimImageSource (const ossimImageSource& /* rhs */)
+   :ossimSource() 
+{}
+
+// Protected to hide from use...
+const ossimImageSource& ossimImageSource::operator=(const ossimImageSource&)
+{
+   return *this;
+}
diff --git a/src/imaging/ossimImageSourceFactory.cpp b/src/imaging/ossimImageSourceFactory.cpp
new file mode 100644
index 0000000..495392a
--- /dev/null
+++ b/src/imaging/ossimImageSourceFactory.cpp
@@ -0,0 +1,625 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: This is the image source factory.
+//              It will try to create image filters
+//              first then it will try the image writers
+//              and image handlers (image readers)
+//
+//*************************************************************************
+// $Id: ossimImageSourceFactory.cpp 22981 2014-11-13 22:08:39Z okramer $
+
+#include <ossim/imaging/ossimImageSourceFactory.h>
+#include <ossim/imaging/ossimConvolutionFilter1D.h>
+#include <ossim/imaging/ossimImageGaussianFilter.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimCacheTileSource.h>
+#include <ossim/imaging/ossimFeatherMosaic.h>
+#include <ossim/imaging/ossimHistogramRemapper.h>
+#include <ossim/imaging/ossimNullPixelFlip.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimElevationMosaic.h>
+#include <ossim/imaging/ossimClosestToCenterCombiner.h>
+#include <ossim/imaging/ossimBlendMosaic.h>
+#include <ossim/imaging/ossimMaxMosaic.h>
+#include <ossim/imaging/ossimOrthoImageMosaic.h>
+#include <ossim/imaging/ossimPiecewiseRemapper.h>
+#include <ossim/imaging/ossimColorNormalizedFusion.h>
+#include <ossim/imaging/ossimLocalCorrelationFusion.h>
+#include <ossim/imaging/ossimSFIMFusion.h>
+#include <ossim/imaging/ossimTopographicCorrectionFilter.h>
+#include <ossim/imaging/ossimBandSelector.h>
+#include <ossim/imaging/ossimNBandToIndexFilter.h>
+#include <ossim/imaging/ossimRgbToGreyFilter.h>
+#include <ossim/imaging/ossimRgbToJpegYCbCrSource.h>
+#include <ossim/imaging/ossimRgbToHsvSource.h>
+#include <ossim/imaging/ossimRgbToHsiSource.h>
+#include <ossim/imaging/ossimHsiToRgbSource.h>
+#include <ossim/imaging/ossimHsvToRgbSource.h>
+#include <ossim/imaging/ossimHsiRemapper.h>
+#include <ossim/imaging/ossimJpegYCbCrToRgbSource.h>
+#include <ossim/imaging/ossimPolyCutter.h>
+#include <ossim/imaging/ossimGeoPolyCutter.h>
+#include <ossim/imaging/ossimHistogramEqualization.h>
+#include <ossim/imaging/ossimHistogramMatchFilter.h>
+#include <ossim/imaging/ossimHistogramThreshholdFilter.h>
+#include <ossim/imaging/ossimConvolutionSource.h>
+#include <ossim/imaging/ossimSICDToDetectedImage.h>
+#include <ossim/imaging/ossimBrightnessContrastSource.h>
+#include <ossim/imaging/ossimBrightnessMatch.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimBandMergeSource.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimBumpShadeTileSource.h>
+#include <ossim/imaging/ossimSubImageTileSource.h>
+#include <ossim/imaging/ossimRLevelFilter.h>
+#include <ossim/imaging/ossimBandClipFilter.h>
+#include <ossim/imaging/ossimValueAssignImageSourceFilter.h>
+#include <ossim/imaging/ossimImageSharpenFilter.h>
+#include <ossim/imaging/ossim3x3ConvolutionFilter.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/imaging/ossimEquationCombiner.h>
+#include <ossim/imaging/ossimImageGaussianFilter.h>
+#include <ossim/imaging/ossimMaskFilter.h>
+#include <ossim/imaging/ossimPixelFlipper.h>
+#include <ossim/imaging/ossimElevImageSource.h>
+#include <ossim/imaging/ossimLandsatTopoCorrectionFilter.h>
+#include <ossim/imaging/ossimGeoAnnotationSource.h>
+#include <ossim/imaging/ossimMapCompositionSource.h>
+#include <ossim/imaging/ossimScaleFilter.h>
+#include <ossim/imaging/ossimEastingNorthingCutter.h>
+#include <ossim/imaging/ossimEdgeFilter.h>
+#include <ossim/imaging/ossimFftFilter.h>
+#include <ossim/imaging/ossimWatermarkFilter.h>
+#include <ossim/imaging/ossimTrimFilter.h>
+#include <ossim/imaging/ossimTwoColorView.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimGridRemapSource.h>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimMultiBandHistogramTileSource.h>
+#include <ossim/imaging/ossimBandAverageFilter.h>
+#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
+#include <ossim/imaging/ossimAtCorrGridRemapper.h>
+#include <ossim/imaging/ossimAtCorrRemapper.h>
+#include <ossim/imaging/ossimDilationFilter.h>
+#include <ossim/imaging/ossimErosionFilter.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/imaging/ossimElevRemapper.h>
+#include <ossim/parallel/ossimMultiThreadSequencer.h>
+
+// Not sure if we want to keep this here
+#include <ossim/imaging/ossimAtbController.h>
+
+#include <ossim/base/ossimTrace.h>
+
+RTTI_DEF1(ossimImageSourceFactory, "ossimImageSourceFactory", ossimImageSourceFactoryBase);
+
+static ossimTrace traceDebug("ossimImageSourceFactory:debug");
+
+ossimImageSourceFactory* ossimImageSourceFactory::theInstance=NULL;
+
+ossimImageSourceFactory::~ossimImageSourceFactory()
+{
+   theInstance = NULL;
+   ossimObjectFactoryRegistry::instance()->unregisterFactory(this);
+}
+ossimImageSourceFactory* ossimImageSourceFactory::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimImageSourceFactory;
+   }
+
+   return theInstance;
+}
+
+ossimObject* ossimImageSourceFactory::createObject(const ossimString& name)const
+{
+
+   // lets do the filters first
+   if( name == STATIC_TYPE_NAME(ossimBandSelector) ||
+       name == "ossimNativeBandSelectorTileSource" ) 
+   {
+      //---
+      // For backwards compatibility check old name:
+      // "ossimNativeBandSelectorTileSource"
+      //---
+      return new ossimBandSelector;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimMultiThreadSequencer) || name == "ossimMultiThreadSequencer")
+   {
+      return new ossimMultiThreadSequencer;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimNullPixelFlip))
+   {
+      return new ossimNullPixelFlip;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimElevRemapper))
+   {
+      return new ossimElevRemapper;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageRenderer))
+   {
+      return new ossimImageRenderer;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimCacheTileSource))
+   {
+      return new ossimCacheTileSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimColorNormalizedFusion))
+   {
+      return new ossimColorNormalizedFusion;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimLocalCorrelationFusion))
+   {
+      return new ossimLocalCorrelationFusion;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimSFIMFusion))
+   {
+      return new ossimSFIMFusion;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimBlendMosaic))
+   {
+      return new ossimBlendMosaic;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimMaxMosaic))
+   {
+      return new ossimMaxMosaic;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimHistogramRemapper))
+   {
+      return new ossimHistogramRemapper;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageMosaic))
+   {
+      return new ossimImageMosaic;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimElevationMosaic))
+   {
+      return new ossimElevationMosaic;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimPiecewiseRemapper))
+   {
+      return new ossimPiecewiseRemapper;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageSourceSequencer))
+   {
+      return new ossimImageSourceSequencer;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimClosestToCenterCombiner))
+   {
+      return new ossimClosestToCenterCombiner;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimRgbToGreyFilter))
+   {
+      return new ossimRgbToGreyFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimNBandToIndexFilter))
+   {
+      return new ossimNBandToIndexFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageChain))
+   {
+      return new ossimImageChain;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimPolyCutter))
+   {
+      return new ossimPolyCutter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimGeoPolyCutter))
+   {
+      return new ossimGeoPolyCutter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimJpegYCbCrToRgbSource))
+   {
+      return new ossimJpegYCbCrToRgbSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimRgbToJpegYCbCrSource))
+   {
+      return new ossimRgbToJpegYCbCrSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimHsiToRgbSource))
+   {
+      return new ossimHsiToRgbSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimRgbToHsiSource))
+   {
+      return new ossimRgbToHsiSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimHsvToRgbSource))
+   {
+      return new ossimHsvToRgbSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimRgbToHsvSource))
+   {
+      return new ossimRgbToHsvSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimHistogramEqualization))
+   {
+      return new ossimHistogramEqualization;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimHistogramMatchFilter))
+   {
+      return new ossimHistogramMatchFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimHistogramThreshholdFilter))
+   {
+      return new ossimHistogramThreshholdFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimGeoAnnotationSource))
+   {
+      return new ossimGeoAnnotationSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimConvolutionSource))
+   {
+      return new ossimConvolutionSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimSICDToDetectedImage))
+   {
+	   return new ossimSICDToDetectedImage;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimBrightnessContrastSource))
+   {
+      return new ossimBrightnessContrastSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimBrightnessMatch))
+   {
+      return new ossimBrightnessMatch;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimScalarRemapper))
+   {
+      return new ossimScalarRemapper;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimBandMergeSource))
+   {
+      return new ossimBandMergeSource;
+   }  
+   else if(name == STATIC_TYPE_NAME(ossimFeatherMosaic))
+   {
+      return new ossimFeatherMosaic;
+   }  
+   else if(name == STATIC_TYPE_NAME(ossimGridRemapSource))
+   {
+      return new ossimGridRemapSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimEquationCombiner))
+   {
+      return new ossimEquationCombiner;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimConvolutionFilter1D))
+   {
+      return new ossimConvolutionFilter1D;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageGaussianFilter))
+   {
+      return new ossimImageGaussianFilter;
+   }
+   // Not sure if we want to keep this here
+   else if(name == STATIC_TYPE_NAME(ossimAtbController))
+   {
+      return new ossimAtbController;
+   }  
+   else if(name == STATIC_TYPE_NAME(ossimIndexToRgbLutFilter))
+   {
+      return new ossimIndexToRgbLutFilter;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimBumpShadeTileSource))
+   {
+      return new ossimBumpShadeTileSource;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimSubImageTileSource))
+   {
+      return new ossimSubImageTileSource;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimRLevelFilter))
+   {
+      return new ossimRLevelFilter;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimBandClipFilter))
+   {
+      return new ossimBandClipFilter;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimHsiRemapper))
+   {
+      return new ossimHsiRemapper;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimHistogramWriter))
+   {
+      return new ossimHistogramWriter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageHistogramSource))
+   {
+      return new ossimImageHistogramSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimRectangleCutFilter))
+   {
+      return new ossimRectangleCutFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimCastTileSourceFilter))
+   {
+      return new ossimCastTileSourceFilter;
+   }
+   // all the image handlers
+   else if(name == STATIC_TYPE_NAME(ossimValueAssignImageSourceFilter))
+   {
+      return new ossimValueAssignImageSourceFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageSharpenFilter))
+   {
+      return new ossimImageSharpenFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossim3x3ConvolutionFilter))
+   {
+      return new ossim3x3ConvolutionFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimOrthoImageMosaic))
+   {
+      return new ossimOrthoImageMosaic;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimPiecewiseRemapper))
+   {
+      return new ossimPiecewiseRemapper;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimMapCompositionSource))
+   {
+      return new ossimMapCompositionSource;
+   }
+   else if(name ==  STATIC_TYPE_NAME(ossimElevImageSource))
+   {
+      return new ossimElevImageSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimMaskFilter))
+   {
+      return new ossimMaskFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimMultiBandHistogramTileSource))
+   {
+      return new ossimMultiBandHistogramTileSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimBandAverageFilter))
+   {
+      return new ossimBandAverageFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimPixelFlipper))
+   {
+      return new ossimPixelFlipper();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimScaleFilter))
+   {
+      return new ossimScaleFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageToPlaneNormalFilter))
+   {
+      return new ossimImageToPlaneNormalFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimTopographicCorrectionFilter))
+   {
+      return new ossimTopographicCorrectionFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimLandsatTopoCorrectionFilter))
+   {
+      return new ossimLandsatTopoCorrectionFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimAtCorrRemapper))
+   {
+      return new ossimAtCorrRemapper();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimAtCorrGridRemapper))
+   {
+      return new ossimAtCorrGridRemapper();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimEastingNorthingCutter))
+   {
+      return new ossimEastingNorthingCutter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimEdgeFilter))
+   {
+      return new ossimEdgeFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimFftFilter))
+   {
+      return new ossimFftFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimWatermarkFilter))
+   {
+      return new ossimWatermarkFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageGaussianFilter))
+   {
+      return new ossimImageGaussianFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimTrimFilter))
+   {
+      return new ossimTrimFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimTwoColorView))
+   {
+      return new ossimTwoColorView;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageHistogramSource))
+   {
+      return new ossimImageHistogramSource();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimImageSourceFilter))
+   {
+      // this is just a pass through source
+      return new ossimImageSourceFilter;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimMemoryImageSource))
+   {
+      // this is just a pass through source
+      return new ossimMemoryImageSource;
+   }
+   else if(name == STATIC_TYPE_NAME(ossimDilationFilter))
+   {
+      return new ossimDilationFilter();
+   }
+   else if(name == STATIC_TYPE_NAME(ossimErosionFilter))
+   {
+      return new ossimErosionFilter();
+   }
+   return NULL;
+}
+
+ossimObject* ossimImageSourceFactory::createObject(const ossimKeywordlist& kwl,
+                                                   const char* prefix)const
+{
+   static const char* MODULE = "ossimImageSourceFactory::createSource";
+   
+   ossimString copyPrefix;
+   if (prefix)
+   {
+      copyPrefix = prefix;
+   }
+   
+   ossimObject* result = NULL;
+   
+   if(traceDebug())
+   {
+      CLOG << "looking up type keyword for prefix = " << copyPrefix << endl;
+   }
+
+   const char* lookup = kwl.find(copyPrefix, "type");
+   if(lookup)
+   {
+      ossimString name = lookup;
+      result           = createObject(name);
+      
+      if(result)
+      {
+         if(traceDebug())
+         {
+            CLOG << "found source " << result->getClassName() << " now loading state" << endl;
+         }
+         result->loadState(kwl, copyPrefix.c_str());
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            CLOG << "type not found " << lookup << endl;
+         }
+      }
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         CLOG << "type keyword not found" << endl;
+      }
+   }
+   return result;
+}
+
+void ossimImageSourceFactory::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   typeList.push_back(STATIC_TYPE_NAME(ossimBandSelector));
+   typeList.push_back(STATIC_TYPE_NAME(ossimMultiThreadSequencer));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageRenderer));
+   typeList.push_back(STATIC_TYPE_NAME(ossimCacheTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBlendMosaic));
+   typeList.push_back(STATIC_TYPE_NAME(ossimMaxMosaic));   
+   typeList.push_back(STATIC_TYPE_NAME(ossimNullPixelFlip));
+   typeList.push_back(STATIC_TYPE_NAME(ossimElevRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimColorNormalizedFusion));
+   typeList.push_back(STATIC_TYPE_NAME(ossimLocalCorrelationFusion));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSFIMFusion));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageMosaic));
+   typeList.push_back(STATIC_TYPE_NAME(ossimElevationMosaic));
+   typeList.push_back(STATIC_TYPE_NAME(ossimClosestToCenterCombiner));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToGreyFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimNBandToIndexFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageChain));
+   typeList.push_back(STATIC_TYPE_NAME(ossimPolyCutter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimGeoPolyCutter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimJpegYCbCrToRgbSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToJpegYCbCrSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHsiToRgbSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToHsiSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHsvToRgbSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRgbToHsvSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramEqualization));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramMatchFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramThreshholdFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimGeoAnnotationSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimConvolutionSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSICDToDetectedImage));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBrightnessContrastSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBrightnessMatch));
+   typeList.push_back(STATIC_TYPE_NAME(ossimScalarRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBandMergeSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimFeatherMosaic));
+   typeList.push_back(STATIC_TYPE_NAME(ossimGridRemapSource));
+   // Not sure if we want to keep this here
+   typeList.push_back(STATIC_TYPE_NAME(ossimAtbController));
+   typeList.push_back(STATIC_TYPE_NAME(ossimIndexToRgbLutFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBumpShadeTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSubImageTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRLevelFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBandClipFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHsiRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimHistogramWriter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageHistogramSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRectangleCutFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimElevImageSource));
+   
+   typeList.push_back(STATIC_TYPE_NAME(ossimValueAssignImageSourceFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageSharpenFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossim3x3ConvolutionFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimOrthoImageMosaic));
+   typeList.push_back(STATIC_TYPE_NAME(ossimPiecewiseRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimMapCompositionSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimCastTileSourceFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimEquationCombiner));
+   typeList.push_back(STATIC_TYPE_NAME(ossimConvolutionFilter1D));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageGaussianFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimMaskFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimMultiBandHistogramTileSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBandAverageFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimPixelFlipper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimScaleFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageToPlaneNormalFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimTopographicCorrectionFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimLandsatTopoCorrectionFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimAtCorrRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimAtCorrGridRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimEastingNorthingCutter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimEdgeFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimFftFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimWatermarkFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageGaussianFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimTrimFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimTwoColorView));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageHistogramSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageSourceFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimMemoryImageSource));
+   typeList.push_back(STATIC_TYPE_NAME(ossimPiecewiseRemapper));
+   typeList.push_back(STATIC_TYPE_NAME(ossimImageSourceSequencer));
+   typeList.push_back(STATIC_TYPE_NAME(ossimDilationFilter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimErosionFilter));
+}
+
+// Hide from use...
+ossimImageSourceFactory::ossimImageSourceFactory()
+   :ossimImageSourceFactoryBase()
+{}
+
+ossimImageSourceFactory::ossimImageSourceFactory(const ossimImageSourceFactory&)
+   :ossimImageSourceFactoryBase()
+{}
+
+const ossimImageSourceFactory& ossimImageSourceFactory::operator=(ossimImageSourceFactory&)
+{
+   return *this;
+}
diff --git a/ossim/src/ossim/imaging/ossimImageSourceFactoryBase.cpp b/src/imaging/ossimImageSourceFactoryBase.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageSourceFactoryBase.cpp
rename to src/imaging/ossimImageSourceFactoryBase.cpp
diff --git a/ossim/src/ossim/imaging/ossimImageSourceFactoryRegistry.cpp b/src/imaging/ossimImageSourceFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageSourceFactoryRegistry.cpp
rename to src/imaging/ossimImageSourceFactoryRegistry.cpp
diff --git a/src/imaging/ossimImageSourceFilter.cpp b/src/imaging/ossimImageSourceFilter.cpp
new file mode 100644
index 0000000..b4ba37f
--- /dev/null
+++ b/src/imaging/ossimImageSourceFilter.cpp
@@ -0,0 +1,215 @@
+
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+//*******************************************************************
+//  $Id: ossimImageSourceFilter.cpp 18920 2011-02-18 20:06:11Z gpotts $
+
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimProperty.h>
+ 
+static ossimTrace traceDebug("ossimImageSourceFilter:degug");
+
+RTTI_DEF2(ossimImageSourceFilter, "ossimImageSourceFilter", ossimImageSource, ossimConnectableObjectListener)
+
+ossimImageSourceFilter::ossimImageSourceFilter(ossimObject* owner)
+   : ossimImageSource(owner,
+                      1, // number of inputs
+                      0, // number of outputs
+                      true, // input's fixed
+                      false), // outputs ar not fixed
+     theInputConnection(NULL)
+{
+   addListener((ossimConnectableObjectListener*)this);
+}
+
+ossimImageSourceFilter::ossimImageSourceFilter(ossimImageSource* inputSource)
+   : ossimImageSource(NULL,
+                      1,
+                      0,
+                      true,
+                      false),
+     theInputConnection(inputSource)
+{
+   if(inputSource)
+   {
+     connectMyInputTo(0, inputSource);
+   }
+   addListener((ossimConnectableObjectListener*)this);
+}
+
+ossimImageSourceFilter::ossimImageSourceFilter(ossimObject* owner,
+                                               ossimImageSource* inputSource)
+   : ossimImageSource(owner,
+                      1,
+                      0,
+                      true,
+                      false),
+     theInputConnection(inputSource)
+{
+   if(inputSource)
+   {
+      theInputObjectList[0] = inputSource;
+      inputSource->connectMyOutputTo(this, false);
+   }
+   addListener((ossimConnectableObjectListener*)this);
+}
+
+
+ossimImageSourceFilter::~ossimImageSourceFilter()
+{
+   removeListener((ossimConnectableObjectListener*)this);
+   theInputConnection = NULL;
+}
+
+ossim_uint32 ossimImageSourceFilter::getNumberOfInputBands()const
+{
+   if(theInputConnection)
+   {
+      return theInputConnection->getNumberOfOutputBands();
+   }
+
+   return 0;
+}
+
+void ossimImageSourceFilter::initialize()
+{
+   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
+}
+
+bool ossimImageSourceFilter::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   bool result = ossimImageSource::loadState(kwl, prefix);
+
+   // make sure we have 1 input.
+   //setNumberOfInputs(1);
+
+   // we will fix the input
+   //if(!theInputListIsFixedFlag)
+  // {
+  //    theInputListIsFixedFlag = true;
+  // }
+   
+   return result;
+}
+
+bool ossimImageSourceFilter::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix)const
+{
+   return ossimImageSource::saveState(kwl, prefix);
+}
+
+
+bool ossimImageSourceFilter::canConnectMyInputTo(ossim_int32 inputIndex,
+						 const ossimConnectableObject* object)const
+{
+  
+  return ((PTR_CAST(ossimImageSource, object)||!object) && ( inputIndex == 0 ) );
+}
+
+void ossimImageSourceFilter::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+  if(traceDebug())
+    {
+       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::connectInputEvent: ";
+
+       if(getInput())
+       {
+          ossimNotify(ossimNotifyLevel_DEBUG) << "to" <<  getInput()->getClassName() << std::endl;
+       }
+       else
+       {
+          ossimNotify(ossimNotifyLevel_DEBUG) << "to NULL" << std::endl;
+       }
+    }
+  theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
+  initialize();
+  if(traceDebug())
+  {
+     if(theInputConnection)
+     {
+        ossimNotify(ossimNotifyLevel_DEBUG) << "theInputConnection was set to " << getInput()->getClassName() << std::endl;
+     }
+     else
+     {
+        ossimNotify(ossimNotifyLevel_DEBUG) << "theInputConnection was set to NULL" <<  std::endl;
+     }
+     ossimNotify(ossimNotifyLevel_DEBUG) << "Leaving ossimImageSourceFilter::connectInput" << std::endl;
+  }
+}
+void ossimImageSourceFilter::disconnectInputEvent(ossimConnectionEvent& /* event */)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::disconnectInputEvent" << std::endl;
+   }
+   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
+   initialize();
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "Leaving ossimImageSourceFilter::disconnectInput" << std::endl;
+   }
+}
+void ossimImageSourceFilter::propertyEvent(ossimPropertyEvent& /* event */)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::propertyEvent DEBUG: Entering..." << std::endl;
+   }
+   initialize();
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::propertyEvent DEBUG: Leaving..." << std::endl;
+   }
+}
+
+void ossimImageSourceFilter::refreshEvent(ossimRefreshEvent& /* event */)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::refreshEvent " << std::endl;
+   }
+   initialize();
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimImageSourceFilter::refreshEvent " << std::endl;
+   }
+}
+
+void ossimImageSourceFilter::getOutputBandList(std::vector<ossim_uint32>& bandList) const
+{
+   if(theInputConnection)
+   {
+      return theInputConnection->getOutputBandList(bandList);
+   }
+
+   return ossimImageSource::getOutputBandList(bandList);
+}
+
+void ossimImageSourceFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimImageSource::setProperty(property);
+}
+
+ossimRefPtr<ossimProperty> ossimImageSourceFilter::getProperty(const ossimString& name)const
+{
+   return ossimImageSource::getProperty(name);
+   
+}
+
+void ossimImageSourceFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSource::getPropertyNames(propertyNames);
+}
diff --git a/ossim/src/ossim/imaging/ossimImageSourceHistogramFilter.cpp b/src/imaging/ossimImageSourceHistogramFilter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageSourceHistogramFilter.cpp
rename to src/imaging/ossimImageSourceHistogramFilter.cpp
diff --git a/src/imaging/ossimImageSourceSequencer.cpp b/src/imaging/ossimImageSourceSequencer.cpp
new file mode 100644
index 0000000..acd260d
--- /dev/null
+++ b/src/imaging/ossimImageSourceSequencer.cpp
@@ -0,0 +1,621 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+//*******************************************************************
+// $Id$
+
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageWriter.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+
+RTTI_DEF2(ossimImageSourceSequencer, "ossimImageSourceSequencer",
+          ossimImageSource, ossimConnectableObjectListener);
+
+static ossimTrace traceDebug("ossimImageSourceSequencer:debug");
+   
+ossimImageSourceSequencer::ossimImageSourceSequencer(ossimImageSource* inputSource,
+                                                     ossimObject* owner)
+:ossimImageSource(owner,
+                  1,
+                  1,
+                  true,
+                  false),
+    theBlankTile(NULL),
+    theAreaOfInterest(0,0,0,0),
+    theTileSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT),
+    theNumberOfTilesHorizontal(0),
+    theNumberOfTilesVertical(0),
+    theCurrentTileNumber(0),
+    theCreateHistogram(false)
+{
+   ossim::defaultTileSize(theTileSize);
+   theAreaOfInterest.makeNan();
+   theInputConnection    = inputSource;
+   if(inputSource)
+   {
+     connectMyInputTo(0, inputSource);
+     initialize(); // Derived class depends on this initialization to happen now. DO NOT MOVE.
+   }
+   addListener( (ossimConnectableObjectListener*)this);
+}
+
+ossimImageSourceSequencer::~ossimImageSourceSequencer()
+{
+   removeListener((ossimConnectableObjectListener*)this);
+}
+
+ossim_int64 ossimImageSourceSequencer::getNumberOfTiles()const
+{
+   return (theNumberOfTilesHorizontal*theNumberOfTilesVertical);
+}
+
+
+ossim_int64 ossimImageSourceSequencer::getNumberOfTilesHorizontal()const
+{
+   return theNumberOfTilesHorizontal;
+}
+
+ossim_int64 ossimImageSourceSequencer::getNumberOfTilesVertical()const
+{
+   return theNumberOfTilesVertical;
+}
+
+ossimScalarType ossimImageSourceSequencer::getOutputScalarType() const
+{
+   if(theInputConnection)
+   {
+      return theInputConnection->getOutputScalarType();
+   }
+   
+   return OSSIM_SCALAR_UNKNOWN;
+}
+
+ossimIpt ossimImageSourceSequencer::getTileSize()const
+{
+   return theTileSize;
+}
+
+void ossimImageSourceSequencer::setTileSize(const ossimIpt& tileSize)
+{
+   theTileSize = tileSize;
+   updateTileDimensions();
+//   initialize();
+}
+
+void ossimImageSourceSequencer::setTileSize(ossim_int32 width, ossim_int32 height)
+{
+   setTileSize(ossimIpt(width, height));
+}
+
+void ossimImageSourceSequencer::updateTileDimensions()
+{
+   bool status = false;
+   if( !theAreaOfInterest.hasNans() && !theTileSize.hasNans() )
+   {
+      ossim_float64 aoiWidth   = theAreaOfInterest.width();
+      ossim_float64 aoiHeight  = theAreaOfInterest.height();
+      ossim_float64 tileWidth  = theTileSize.x;
+      ossim_float64 tileHeight = theTileSize.y;
+      
+      if ( (aoiWidth > 0.0) && (aoiHeight > 0.0) &&
+           (tileWidth > 0.0) && (tileHeight > 0.0) )
+      {
+         theNumberOfTilesHorizontal
+            = static_cast<ossim_int64>(std::ceil(aoiWidth/tileWidth));
+         theNumberOfTilesVertical
+            = static_cast<ossim_int64>(std::ceil(aoiHeight/tileHeight));
+         status = true;
+      }
+   }
+
+   if ( !status )
+   {
+      theNumberOfTilesHorizontal = 0;
+      theNumberOfTilesVertical   = 0;
+   }
+}
+
+void ossimImageSourceSequencer::initialize()
+{
+   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
+
+   if(theInputConnection)
+   {
+      if(theTileSize.hasNans())
+      {
+         theTileSize.x = theInputConnection->getTileWidth();
+         theTileSize.y = theInputConnection->getTileHeight();
+      }
+
+      ossimDrect rect = theInputConnection->getBoundingRect();
+      if(rect.hasNans())
+      {
+         theAreaOfInterest.makeNan();
+      }
+      else
+      {
+         rect.stretchOut();
+         setAreaOfInterest(rect);
+      }
+      updateTileDimensions();
+      
+      theBlankTile  = ossimImageDataFactory::instance()->create(this,
+                                                                this);
+      if(theBlankTile.valid())
+      {
+         theBlankTile->initialize();
+      }
+   }
+}
+
+bool ossimImageSourceSequencer::canConnectMyInputTo(ossim_int32 /* inputIndex */,
+						    const ossimConnectableObject* object)const
+{      
+   return (object&& PTR_CAST(ossimImageSource, object));
+}
+
+void ossimImageSourceSequencer::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimImageSourceSequencer::disconnectInputEvent(ossimConnectionEvent& /* event */)
+{
+   theInputConnection = PTR_CAST(ossimImageSource, getInput(0));
+}
+
+ossimIrect ossimImageSourceSequencer::getBoundingRect(ossim_uint32 resLevel)const
+{
+   ossimDrect temp;
+   temp.makeNan();
+   
+   if(!theInputConnection) return temp;
+   
+   if(theAreaOfInterest.hasNans())
+   {
+      return theInputConnection->getBoundingRect(resLevel);
+   }
+   
+   return theAreaOfInterest;
+}
+
+void ossimImageSourceSequencer::getDecimationFactor(ossim_uint32 resLevel,
+                                                    ossimDpt& result) const
+{
+   if(theInputConnection)
+   {
+      theInputConnection->getDecimationFactor(resLevel, result);
+   }
+   result.makeNan();
+}
+
+void ossimImageSourceSequencer::getDecimationFactors(vector<ossimDpt>& decimations) const
+{
+   if(theInputConnection)
+   {
+      theInputConnection->getDecimationFactors(decimations);
+   }   
+}
+
+ossim_uint32 ossimImageSourceSequencer::getNumberOfDecimationLevels()const
+{
+   ossim_uint32 result = 0;
+   if(theInputConnection)
+   {
+      result = theInputConnection->getNumberOfDecimationLevels();
+   }
+   return result;
+}
+
+void ossimImageSourceSequencer::setAreaOfInterest(const ossimIrect& areaOfInterest)
+{
+   if(areaOfInterest.hasNans())
+   {
+      theAreaOfInterest.makeNan();
+      theNumberOfTilesHorizontal = 0;
+      theNumberOfTilesVertical   = 0;
+   }
+
+   // let's round it to the nearest pixel value before setting it.
+   theAreaOfInterest = areaOfInterest;
+   updateTileDimensions();
+}
+
+const ossimIrect& ossimImageSourceSequencer::getAreaOfInterest()const
+{
+   return theAreaOfInterest;
+}
+
+void ossimImageSourceSequencer::setToStartOfSequence()
+{
+   theCurrentTileNumber = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
+   const ossimIrect& rect, ossim_uint32 /* resLevel */ )
+{
+   if(theInputConnection)
+   {
+      /*
+      ossimRefPtr<ossimImageData> tile =
+         theInputConnection->getTile(rect, resLevel);
+      if (tile.valid()&&tile->getBuf())
+      {
+         return tile;
+      }
+      else
+      {
+         // We should return a valid tile for the writers.
+         theBlankTile->setImageRectangle(rect);
+         return theBlankTile;
+      }
+      */
+      // For Use with multithreaded sequencer
+      ossimRefPtr<ossimImageData> tile = ossimImageDataFactory::instance()->create(this, this);
+      tile->setImageRectangle(rect);
+      tile->initialize();
+      tile->makeBlank();
+      setToStartOfSequence();
+      ossim_uint32 num_tiles = getNumberOfTiles();
+      // bool hasHistoOutput = true;
+      ossim_uint32 numberOfBands = 1;
+      ossim_uint32 numberOfBins  = 0;
+      ossim_float64 minValue     = 0;
+      ossim_float64 maxValue     = 0;
+      ossimScalarType stype;
+      ossimRefPtr<ossimMultiResLevelHistogram> histogram = 0;
+
+      if (theCreateHistogram)
+      {
+       stype = tile->getScalarType();
+       histogram = new ossimMultiResLevelHistogram;
+       histogram->create(1);
+       numberOfBands = tile->getNumberOfBands();
+
+       getBinInformation(numberOfBins, minValue, maxValue, stype);
+       histogram->getMultiBandHistogram(0)->create(numberOfBands, numberOfBins, minValue, maxValue);
+
+      }
+      for (ossim_uint32 tile_idx=0; tile_idx<num_tiles; ++tile_idx)
+      {
+       ossimRefPtr<ossimImageData> imagedata = getNextTile();
+       //tile->setDataObjectStatus(imagedata->getDataObjectStatus());
+       if(imagedata->getBuf() && (imagedata->getDataObjectStatus()!=OSSIM_EMPTY))
+       {
+         tile->loadTile(imagedata.get());
+         if (theCreateHistogram)
+         {
+           imagedata->populateHistogram(histogram->getMultiBandHistogram(0));
+         }
+       }
+       if (traceDebug())
+       {
+       ossimNotify(ossimNotifyLevel_WARN)<< "BASE SEQUENCER TILE " << tile_idx << " RECT: " << rect << std::endl;;
+       }
+      }
+      tile->validate();
+      if (theCreateHistogram) tile->setHistogram(histogram);
+      return tile;
+   }
+
+   return 0;
+}
+
+ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getNextTile( ossim_uint32 resLevel )
+{
+   ossimRefPtr<ossimImageData> result = 0;
+   if ( theInputConnection )
+   {
+      ossimIrect tileRect;
+      if ( getTileRect( theCurrentTileNumber, tileRect ) )
+      {
+         ++theCurrentTileNumber;
+         result = theInputConnection->getTile(tileRect, resLevel);
+         if( !result.valid() || !result->getBuf() )
+         {	 
+            theBlankTile->setImageRectangle(tileRect);
+            result = theBlankTile;
+         }
+      }
+   }
+   return result;
+}
+
+bool ossimImageSourceSequencer::getNextTileStream(std::ostream& /* bos */)
+{
+  return false;
+}
+
+ossimRefPtr<ossimImageData> ossimImageSourceSequencer::getTile(
+   ossim_int64 id, ossim_uint32 resLevel)
+{
+   static const char* MODULE= "ossimImageSourceSequencer::getTile(id, resLevel)";
+   if(traceDebug())
+   {
+      CLOG << "entering.."<<endl;
+   }
+
+   ossimRefPtr<ossimImageData> result = 0;
+
+   if(theInputConnection)
+   {
+      // if we have no tiles try to initialize.
+      if(getNumberOfTiles() == 0)
+      {
+         initialize();
+      }
+
+      ossimIrect tileRect;
+      if ( getTileRect( id, tileRect ) )
+      {
+         result = theInputConnection->getTile(tileRect, resLevel);
+         if( !result.valid() || !result->getBuf() )
+         {	 
+            theBlankTile->setImageRectangle(tileRect);
+            result = theBlankTile;
+         }
+      }
+      else // getTileRect failed...
+      {
+         if(traceDebug())
+         {
+            CLOG << "was not able to get an origin for id = " << id << endl;
+         }
+      }
+   }
+   else // no connection...
+   {
+      if(traceDebug())
+      {
+         CLOG << "No input connection so returing NULL" << endl;
+      }
+   }
+   if(traceDebug())
+   {
+      CLOG << "leaving.."<<endl;
+   }
+   
+   return result;
+}
+
+bool ossimImageSourceSequencer::getTileOrigin(ossim_int64 id, ossimIpt& origin) const
+{
+   bool result = false;
+   if( id >= 0 )
+   {
+      if( (theNumberOfTilesHorizontal > 0) && (theCurrentTileNumber < getNumberOfTiles()) )
+      {
+         ossim_int64 y = id / theNumberOfTilesHorizontal;
+         ossim_int64 x = id % theNumberOfTilesHorizontal;
+         if( (x < theNumberOfTilesHorizontal) && (y < theNumberOfTilesVertical) )
+         {
+            ossim_int64 ulx = theAreaOfInterest.ul().x;
+            ossim_int64 uly = theAreaOfInterest.ul().y;
+            ossim_int64 tx  = theTileSize.x;
+            ossim_int64 ty  = theTileSize.y; 
+            x = ulx + x * tx;
+            y = uly + y * ty;
+
+            //---
+            // ossimIpt currently signed 32 bit so make sure we didn't bust the
+            // bounds.
+            //---
+            if ( (x <= OSSIM_DEFAULT_MAX_PIX_SINT32) && ( y <= OSSIM_DEFAULT_MAX_PIX_SINT32) )
+            {
+               origin.x = (ossim_int32)x;
+               origin.y = (ossim_int32)y;
+               result = true;
+            }
+         }
+      }
+   }
+   return result;
+}
+
+bool ossimImageSourceSequencer::getTileRect(ossim_int64 tile_id, ossimIrect& tileRect) const
+{
+   // Fetch tile origin for this tile:
+   ossimIpt origin;
+   bool result = getTileOrigin(tile_id, origin);
+   if ( result )
+   {
+      // Establish the tile rect of interest for this tile:
+      tileRect.set_ul (origin);
+      tileRect.set_lrx(origin.x + theTileSize.x - 1);
+      tileRect.set_lry(origin.y + theTileSize.y - 1);
+   }
+   return result;
+}
+
+double ossimImageSourceSequencer::getNullPixelValue(ossim_uint32 band)const
+{
+   if (theInputConnection)
+   {
+      return theInputConnection->getNullPixelValue(band);
+   }
+
+   return ossimImageSource::getNullPixelValue(band);
+}
+
+double ossimImageSourceSequencer::getMinPixelValue(ossim_uint32 band)const
+{
+   if (theInputConnection)
+   {
+      return theInputConnection->getMinPixelValue(band);
+   }
+   
+   return ossimImageSource::getMinPixelValue(band);  
+}
+
+double ossimImageSourceSequencer::getMaxPixelValue(ossim_uint32 band)const
+{
+   if (theInputConnection)
+   {
+      return theInputConnection->getMaxPixelValue(band);
+   }
+   
+   return ossimImageSource::getMaxPixelValue(band);  
+}
+
+ossim_uint32 ossimImageSourceSequencer::getNumberOfInputBands()const
+{
+   if(theInputConnection)
+   {
+      return theInputConnection->getNumberOfOutputBands();
+   }
+
+   return 0;
+}
+
+ossim_uint32 ossimImageSourceSequencer::getTileWidth() const
+{
+   return theTileSize.x;
+}
+
+ossim_uint32 ossimImageSourceSequencer::getTileHeight()const
+{
+   return theTileSize.y;
+}
+
+void ossimImageSourceSequencer::slaveProcessTiles()
+{
+}
+
+bool ossimImageSourceSequencer::isMaster() const
+{
+   return true;
+}
+
+void ossimImageSourceSequencer::getBinInformation(ossim_uint32& numberOfBins,
+                                                  ossim_float64& minValue,
+                                                  ossim_float64& maxValue,
+                                                 ossimScalarType stype)const
+{
+   numberOfBins = 0;
+   minValue     = 0;
+   maxValue     = 0;
+
+      switch(stype)
+      {
+         case OSSIM_UINT8:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UCHAR;
+            numberOfBins = 256;
+
+            break;
+         }
+         case OSSIM_USHORT11:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT11;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT11 + 1;
+
+            break;
+         }
+         case OSSIM_USHORT12:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT12;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT12 + 1;
+
+            break;
+         }
+         case OSSIM_USHORT13:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT13;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT13 + 1;
+
+            break;
+         }
+         case OSSIM_USHORT14:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT14;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT14 + 1;
+
+            break;
+         }
+         case OSSIM_USHORT15:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT15;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT15 + 1;
+
+            break;
+         }
+         case OSSIM_UINT16:
+         case OSSIM_UINT32:
+         {
+            minValue     = 0;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_UINT16;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16 + 1;
+
+            break;
+         }
+         case OSSIM_SINT16:
+         case OSSIM_SINT32:
+         case OSSIM_FLOAT32:
+         case OSSIM_FLOAT64:
+         {
+            minValue     = OSSIM_DEFAULT_MIN_PIX_SINT16;
+            maxValue     = OSSIM_DEFAULT_MAX_PIX_SINT16;
+            numberOfBins = (OSSIM_DEFAULT_MAX_PIX_SINT16-OSSIM_DEFAULT_MIN_PIX_SINT16) + 1;
+
+            break;
+         }
+         case OSSIM_NORMALIZED_FLOAT:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            minValue     = 0;
+            maxValue     = 1.0;
+            numberOfBins = OSSIM_DEFAULT_MAX_PIX_UINT16+1;
+            break;
+         }
+         default:
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "Unsupported scalar type in ossimImageHistogramSource::computeHistogram()" << endl;
+            }
+            return;
+         }
+      }
+
+}
+
+bool ossimImageSourceSequencer::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup;
+   lookup = kwl.find(prefix, "create_histogram");
+   if(lookup)
+   {
+      bool create_histogram = ossimString(lookup).toBool();
+      setCreateHistogram(create_histogram);
+   }
+   bool status = ossimImageSource::loadState(kwl, prefix);
+
+   return status;
+}
+
+void ossimImageSourceSequencer::setCreateHistogram(bool create_histogram)
+{
+   theCreateHistogram = create_histogram;
+}
+
diff --git a/src/imaging/ossimImageStatisticsSource.cpp b/src/imaging/ossimImageStatisticsSource.cpp
new file mode 100644
index 0000000..b0d210e
--- /dev/null
+++ b/src/imaging/ossimImageStatisticsSource.cpp
@@ -0,0 +1,183 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+#include <ossim/imaging/ossimImageStatisticsSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+
+ossimImageStatisticsSource::ossimImageStatisticsSource()
+      :ossimSource(0,
+                   1,
+                   0,
+                   true,
+                   false)
+{
+}
+
+ossimImageStatisticsSource::~ossimImageStatisticsSource()
+{
+   
+}
+
+void ossimImageStatisticsSource::computeStatistics()
+{
+   ossimImageSource* anInterface = PTR_CAST(ossimImageSource,
+                                                     getInput());
+
+   if(anInterface&&isSourceEnabled())
+   {
+      clearStatistics();
+      ossimScalarType outputScalarType = anInterface->getOutputScalarType();
+
+      switch(outputScalarType)
+      {
+         case OSSIM_UCHAR:
+         {
+            computeStatisticsTemplate((ossim_uint8)0);
+            break;
+         }
+         case OSSIM_USHORT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         {
+            computeStatisticsTemplate((ossim_uint16)0);
+            break;
+         }
+         case OSSIM_SSHORT16:
+         {
+            computeStatisticsTemplate((ossim_sint16)0);
+            break;
+         }
+         case OSSIM_DOUBLE:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            computeStatisticsTemplate((ossim_float64)0);
+            break;
+         }
+         case OSSIM_FLOAT:
+         case OSSIM_NORMALIZED_FLOAT:
+         {
+            computeStatisticsTemplate((ossim_float32)0);
+            break;
+         }
+		 default :
+		 {
+			 break;
+		 }
+      }
+   }
+}
+
+bool ossimImageStatisticsSource::canConnectMyInputTo(ossim_int32 inputIndex,
+                                                     const ossimConnectableObject* object)const
+{
+   return (PTR_CAST(ossimImageSource, object)&&(inputIndex < 1));
+}
+
+template <class T>
+void ossimImageStatisticsSource::computeStatisticsTemplate(T /* dummyVariable */)
+{
+   ossimRefPtr<ossimImageSourceSequencer> sequencer = new ossimImageSourceSequencer;
+
+   sequencer->connectMyInputTo(getInput());
+   sequencer->setToStartOfSequence();
+   ossim_uint32 bands = sequencer->getNumberOfOutputBands();
+
+   if(bands)
+   {
+      setStatsSize(bands);
+      ossimRefPtr<ossimImageData> dataObject;
+      
+      while( (dataObject=sequencer->getNextTile()).valid() )
+      {
+         ossim_uint32 bandIdx = 0;
+         bands = dataObject->getNumberOfBands();
+         ossimDataObjectStatus status = dataObject->getDataObjectStatus();
+         if((status != OSSIM_EMPTY)&&
+            (dataObject->getBuf()))
+         {
+            ossim_uint32 offsetMax = dataObject->getWidth()*dataObject->getHeight();
+            for(bandIdx = 0; bandIdx < bands; ++bandIdx)
+            {
+               ossim_float64 pixelCount = 0.0;
+               ossim_uint32 offset = 0;
+               T* dataPtr   = static_cast<T*>(dataObject->getBuf(bandIdx));
+               T nullPixel = static_cast<T>(dataObject->getNullPix(bandIdx)); 
+               for(offset = 0; offset < offsetMax; ++offset)
+               {
+                  if((*dataPtr) != nullPixel)
+                  {
+                     theMean[bandIdx] += *dataPtr;
+                     if((*dataPtr) < theMin[bandIdx])
+                     {
+                        theMin[bandIdx] = (*dataPtr);
+                     }
+                     if((*dataPtr) > theMax[bandIdx])
+                     {
+                        theMax[bandIdx] = (*dataPtr);
+                     }
+                     ++pixelCount;
+                  }
+                  ++dataPtr;
+               }
+               if(pixelCount > 0)
+               {
+                  theMean[bandIdx] /= pixelCount;
+               }
+            }
+         }
+      }
+   }
+   
+   sequencer->disconnect();
+   sequencer = 0;
+}
+
+const std::vector<ossim_float64>& ossimImageStatisticsSource::getMean()const
+{
+   return theMean;
+}
+
+const std::vector<ossim_float64>& ossimImageStatisticsSource::getMin()const
+{
+   return theMin;
+}
+
+const std::vector<ossim_float64>& ossimImageStatisticsSource::getMax()const
+{
+   return theMax;
+}
+
+void ossimImageStatisticsSource::clearStatistics()
+{
+   theMean.clear();
+   theMin.clear();
+   theMax.clear();
+}
+
+void ossimImageStatisticsSource::setStatsSize(ossim_uint32 size)
+{
+   theMean.resize(size);
+   theMin.resize(size);
+   theMax.resize(size);
+
+   std::fill(theMean.begin(),
+             theMean.end(),
+             (ossim_float64)0.0);
+   std::fill(theMin.begin(),
+             theMin.end(),
+             OSSIM_DEFAULT_MAX_PIX_DOUBLE);
+   std::fill(theMax.begin(),
+             theMax.end(),
+             (ossim_float64)OSSIM_DEFAULT_MIN_PIX_DOUBLE);
+}
diff --git a/src/imaging/ossimImageToPlaneNormalFilter.cpp b/src/imaging/ossimImageToPlaneNormalFilter.cpp
new file mode 100644
index 0000000..55c327e
--- /dev/null
+++ b/src/imaging/ossimImageToPlaneNormalFilter.cpp
@@ -0,0 +1,492 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimImageToPlaneNormalFilter.cpp 23451 2015-07-27 15:42:17Z okramer $
+#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+
+static const char* SMOOTHNESS_FACTOR_KW="smoothness_factor";
+
+RTTI_DEF1(ossimImageToPlaneNormalFilter, "ossimImageToPlaneNormalFilter", ossimImageSourceFilter);
+
+ossimImageToPlaneNormalFilter::ossimImageToPlaneNormalFilter()
+   :ossimImageSourceFilter(),
+    theTile(NULL),
+    theBlankTile(NULL),
+    theTrackScaleFlag(true),
+    theXScale(1.0),
+    theYScale(1.0),
+    theSmoothnessFactor(1.0)
+{
+}
+
+ossimImageToPlaneNormalFilter::ossimImageToPlaneNormalFilter(ossimImageSource* inputSource)
+   :ossimImageSourceFilter(inputSource),
+    theTile(NULL),
+    theBlankTile(NULL),
+    theTrackScaleFlag(true),
+    theXScale(1.0),
+    theYScale(1.0),
+    theSmoothnessFactor(1.0)
+{
+}
+
+ossimRefPtr<ossimImageData> ossimImageToPlaneNormalFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled()||!theInputConnection)
+   {
+      return ossimImageSourceFilter::getTile(tileRect, resLevel);
+   }
+
+   if(!theTile.valid())
+   {
+      initialize();
+   }
+
+   if(!theTile.valid())
+   {
+      return ossimImageSourceFilter::getTile(tileRect, resLevel);
+   }
+
+   theTile->setImageRectangle(tileRect);
+
+   ossimIrect requestRect(tileRect.ul().x - 1,
+                          tileRect.ul().y - 1,
+                          tileRect.lr().x + 1,
+                          tileRect.lr().y + 1);
+
+   ossimRefPtr<ossimImageData> input =
+      theInputConnection->getTile(requestRect, resLevel);
+
+   if(!input||(input->getDataObjectStatus()==OSSIM_EMPTY)||!input->getBuf())
+   {
+      if(tileRect.completely_within(theInputBounds))
+      {
+         initializeTile();
+         theTile->validate();
+         return theTile.get();
+      }
+      theBlankTile->setImageRectangle(tileRect);
+      return theBlankTile;
+   }
+
+   double oldScaleX = theXScale;
+   double oldScaleY = theYScale;
+
+   if(resLevel > 0)
+   {
+      ossimDpt scaleFactor;
+      theInputConnection->getDecimationFactor(resLevel, scaleFactor);
+
+      if(!scaleFactor.hasNans())
+      {
+         theXScale *= scaleFactor.x;
+         theYScale *= scaleFactor.y;
+      }
+   }
+
+   computeNormals(input, theTile);
+
+   theXScale = oldScaleX;
+   theYScale = oldScaleY;
+
+   theTile->validate();
+
+   return theTile;
+}
+
+void ossimImageToPlaneNormalFilter::initializeTile()
+{
+   double* x = static_cast<double*>(theTile->getBuf(0));
+   double* y = static_cast<double*>(theTile->getBuf(1));
+   double* z = static_cast<double*>(theTile->getBuf(2));
+   
+   if(x) std::fill(x, x+theTile->getSizePerBand(), 0.0);
+   if(y) std::fill(y, y+theTile->getSizePerBand(), 0.0);
+   if(z) std::fill(z, z+theTile->getSizePerBand(), 1.0);
+}
+
+void ossimImageToPlaneNormalFilter::initialize()
+{
+   if(theInputConnection)
+   {
+      theInputConnection->initialize();
+      
+      theInputBounds = theInputConnection->getBoundingRect();
+      theTile      = ossimImageDataFactory::instance()->create(this, this);
+      theBlankTile = (ossimImageData*)(theTile->dup());
+      theTile->initialize();
+
+      if(theTrackScaleFlag)
+      {
+         ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();
+         if( geom.valid() )
+         {
+            ossimDpt pt = geom->getMetersPerPixel();
+            if(!pt.hasNans())
+            {
+               theXScale = 1.0/pt.x;
+               theYScale = 1.0/pt.y;
+            }
+         }
+      }
+   }
+}
+
+void ossimImageToPlaneNormalFilter::computeNormals(
+   ossimRefPtr<ossimImageData>& inputTile,
+   ossimRefPtr<ossimImageData>& outputTile)
+{
+   switch(inputTile->getScalarType())
+   {
+      case OSSIM_SSHORT16:
+      {
+         computeNormalsTemplate((ossim_sint16)0,
+                                inputTile,
+                                outputTile);
+         break;
+      }
+      case OSSIM_UCHAR:
+      {
+         computeNormalsTemplate((ossim_uint8)0,
+                                inputTile,
+                                outputTile);
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_USHORT16:
+      {
+         computeNormalsTemplate((ossim_uint16)0,
+                                inputTile,
+                                outputTile);
+         break;
+      }
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_DOUBLE:
+      {
+         computeNormalsTemplate((ossim_float64)0,
+                                inputTile,
+                                outputTile);
+         break;
+      }
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_FLOAT:
+      {
+         computeNormalsTemplate((ossim_float32)0,
+                                inputTile,
+                                outputTile);
+         break;
+      }
+      default:
+         break;
+   }
+}
+
+template <class T> void ossimImageToPlaneNormalFilter::computeNormalsTemplate(
+   T /* inputScalarTypeDummy */,
+   ossimRefPtr<ossimImageData>& inputTile,
+   ossimRefPtr<ossimImageData>& outputTile)
+{
+   T inputNull = (T) inputTile->getNullPix(0);
+   T* inbuf = (T*) inputTile->getBuf();
+   T outputNull = (T) outputTile->getNullPix(0);
+   double* normX = (double*)outputTile->getBuf(0);
+   double* normY = (double*)outputTile->getBuf(1);
+   double* normZ = (double*)outputTile->getBuf(2);
+   ossim_int32 inbuf_width = inputTile->getWidth();
+   ossim_int32 normbuf_width = outputTile->getWidth();
+   ossim_int32 normbuf_height = outputTile->getHeight();
+   ossimColumnVector3d normal;
+   bool valid_component = true;
+   for (ossim_int32 y=0; y<normbuf_height; y++)
+   {
+      // Establish offsets into the image and output normals buffers given row:
+      ossim_uint32 n = y*normbuf_width;
+      ossim_uint32 i = (y+1)*inbuf_width + 1;
+      
+      // Loop to compute the gradient (normal) vector [dh/dx, dh/dy, 1]:
+      for (ossim_int32 x=0; x<normbuf_width; x++)
+      {
+         // Default in case of null inputs is a flat earth:
+         normal[0] = 0;
+         normal[1] = 0;
+         normal[2] = 1.0;
+
+         // Compute the x-direction differential:
+         if (inbuf[i+1] != inputNull)
+         {
+            if (inbuf[i-1] != inputNull)
+               normal[0] = theXScale*theSmoothnessFactor*(inbuf[i+1] - inbuf[i-1]) / 2.0;
+            else if (inbuf[i] != inputNull)
+               normal[0] = theXScale*theSmoothnessFactor*(inbuf[i+1] - inbuf[i]);
+         }
+         else if ((inbuf[i] != inputNull) && (inbuf[i-1] != inputNull))
+         {
+            normal[0] = theXScale*theSmoothnessFactor*(inbuf[i] - inbuf[i-1]);
+         }
+         else
+         {
+            valid_component = false;
+         }
+
+         // Compute the y-direction differential:
+         if (valid_component)
+         {
+            if (inbuf[i+inbuf_width] != inputNull)
+            {
+               if (inbuf[i-inbuf_width] != inputNull)
+                  normal[1] = theYScale*theSmoothnessFactor*(inbuf[i+inbuf_width] - inbuf[i-inbuf_width]) / 2.0;
+               else if (inbuf[i] != inputNull)
+                  normal[1] = theYScale*theSmoothnessFactor*(inbuf[i+inbuf_width] - inbuf[i]);
+            }
+            else if ((inbuf[i] != inputNull) && (inbuf[i-inbuf_width] != inputNull))
+            {
+               normal[1] = theYScale*theSmoothnessFactor*(inbuf[i] - inbuf[i-inbuf_width]);
+            }
+            else
+            {
+               valid_component = false;
+            }
+         }
+
+         // Stuff the normalized gradient vector into the output buffers:
+         if (valid_component)
+         {
+            normal = normal.unit();
+            normX[n] = normal[0];
+            normY[n] = normal[1];
+            normZ[n] = normal[2];
+         }
+         else
+         {
+            normX[n] = outputNull;
+            normY[n] = outputNull;
+            normZ[n] = outputNull;
+         }
+         
+         ++n;
+         ++i;
+         valid_component = true;
+      }
+   }
+}
+
+bool ossimImageToPlaneNormalFilter::loadState(const ossimKeywordlist& kwl,
+                                              const char* prefix)
+{
+   ossimString scaleX     = kwl.find(prefix, ossimKeywordNames::SCALE_PER_PIXEL_X_KW);
+   ossimString scaleY     = kwl.find(prefix, ossimKeywordNames::SCALE_PER_PIXEL_Y_KW);
+   ossimString trackFlag  = kwl.find(prefix, "track_scale_flag");
+   ossimString smoothness = kwl.find(prefix, SMOOTHNESS_FACTOR_KW);
+
+   if(scaleX != "")
+   {
+      theXScale = scaleX.toDouble();
+   }
+   if(scaleY != "")
+   {
+      theYScale = scaleY.toDouble();
+   }
+   if(trackFlag != "")
+   {
+      theTrackScaleFlag = trackFlag.toBool();
+   }
+   if(smoothness!="")
+   {
+      theSmoothnessFactor = smoothness.toDouble();
+   }
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimImageToPlaneNormalFilter::saveState(ossimKeywordlist& kwl,
+                                              const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_PER_PIXEL_X_KW,
+           theXScale,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_PER_PIXEL_Y_KW,
+           theXScale,
+           true);
+
+   kwl.add(prefix,
+           "track_scale_flag",
+           (ossim_uint32)theTrackScaleFlag,
+           true);
+
+   kwl.add(prefix,
+           SMOOTHNESS_FACTOR_KW,
+           theSmoothnessFactor,
+           true);
+
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+double ossimImageToPlaneNormalFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getMinPixelValue(band);
+   }
+   return -1;
+}
+
+double ossimImageToPlaneNormalFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getMaxPixelValue(band);
+   }
+   return 1.0;
+}
+
+ossimScalarType ossimImageToPlaneNormalFilter::getOutputScalarType() const
+{
+   if(isSourceEnabled())
+   {
+      return OSSIM_DOUBLE;
+   }
+   
+   return ossimImageSourceFilter::getOutputScalarType();
+}
+
+ossim_uint32 ossimImageToPlaneNormalFilter::getNumberOfOutputBands() const
+{
+   if(isSourceEnabled())
+   {
+      return 3;
+   }
+   return ossimImageSourceFilter::getNumberOfOutputBands();
+}
+
+void ossimImageToPlaneNormalFilter::setXScale(const double& scale)
+{
+   theXScale = scale;
+}
+
+double ossimImageToPlaneNormalFilter::getXScale()const
+{
+   return theXScale;
+}
+
+double ossimImageToPlaneNormalFilter::getYScale()const
+{
+   return theYScale;
+}
+
+void ossimImageToPlaneNormalFilter::setYScale(const double& scale)
+{
+   theYScale = scale;
+}
+
+void ossimImageToPlaneNormalFilter::setTrackScaleFlag(bool flag)
+{
+   theTrackScaleFlag = flag;
+}
+
+bool ossimImageToPlaneNormalFilter::getTrackScaleFlag()const
+{
+   return theTrackScaleFlag;
+}
+
+void ossimImageToPlaneNormalFilter::setSmoothnessFactor(double value)
+{
+   theSmoothnessFactor = value;
+}
+
+double ossimImageToPlaneNormalFilter::getSmoothnessFactor()const
+{
+   return theSmoothnessFactor;
+}
+
+void ossimImageToPlaneNormalFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimString name = property->getName();
+   if((name == "smoothnessFactor")||
+      (name == "gain"))
+   {
+      theSmoothnessFactor = property->valueToString().toDouble();
+      initialize();
+   }
+   else if(name == "xscale")
+   {
+      theXScale = property->valueToString().toDouble();
+      initialize();
+   }
+   else if(name == "yscale")
+   {
+      theYScale = property->valueToString().toDouble();
+      initialize();
+   }
+   else if(name == "autoTrackScaleFlag")
+   {
+      theTrackScaleFlag = property->valueToString().toDouble();
+      initialize();
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimImageToPlaneNormalFilter::getProperty(const ossimString& name)const
+{
+   if((name == "smoothnessFactor")||
+      (name == "gain"))
+   {
+      ossimNumericProperty* prop = new ossimNumericProperty("gain", ossimString::toString(theSmoothnessFactor), .0001, 40);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   else if(name == "xscale")
+   {
+      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(theXScale), .0001, 50000);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   else if(name == "yscale")
+   {
+      ossimNumericProperty* prop = new ossimNumericProperty(name, ossimString::toString(theYScale), .0001, 50000);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   else if(name == "autoTrackScaleFlag")
+   {
+      ossimBooleanProperty* prop = new ossimBooleanProperty(name, theTrackScaleFlag);
+      prop->setCacheRefreshBit();
+      return prop;
+   }
+   
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimImageToPlaneNormalFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back("gain");
+   propertyNames.push_back("xscale");
+   propertyNames.push_back("yscale");
+   propertyNames.push_back("autoTrackScaleFlag");
+}
diff --git a/ossim/src/ossim/imaging/ossimImageWriter.cpp b/src/imaging/ossimImageWriter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageWriter.cpp
rename to src/imaging/ossimImageWriter.cpp
diff --git a/src/imaging/ossimImageWriterFactory.cpp b/src/imaging/ossimImageWriterFactory.cpp
new file mode 100644
index 0000000..2a00960
--- /dev/null
+++ b/src/imaging/ossimImageWriterFactory.cpp
@@ -0,0 +1,393 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+// $Id: ossimImageWriterFactory.cpp 22242 2013-04-20 02:16:06Z gpotts $
+
+#include <ossim/imaging/ossimImageWriterFactory.h>
+#include <ossim/base/ossimImageTypeLut.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/imaging/ossimGeneralRasterWriter.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimJpegWriter.h>
+#include <ossim/imaging/ossimNitfWriter.h>
+#include <ossim/imaging/ossimNitf20Writer.h>
+#include <ossim/imaging/ossimPdfWriter.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimWriter.h>
+
+ossimImageWriterFactory* ossimImageWriterFactory::theInstance = (ossimImageWriterFactory*)NULL;
+
+
+ossimImageWriterFactory* ossimImageWriterFactory::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimImageWriterFactory;
+      ossimImageWriterFactoryRegistry::instance()->registerFactory(theInstance);
+   }
+
+   return theInstance;
+}
+
+ossimImageWriterFactory::~ossimImageWriterFactory()
+{
+   theInstance = (ossimImageWriterFactory*)NULL;
+}
+
+ossimImageFileWriter *ossimImageWriterFactory::createWriterFromExtension(
+   const ossimString& fileExtension)const
+{
+   ossimImageFileWriter* result = 0;
+
+   ossimString ext = fileExtension;
+   ext.downcase();
+   
+   if( (ext == "tif")|| (ext == "tiff") )
+   {
+      result = new ossimTiffWriter;
+   }
+   else if( (ext == "jpg")|| (ext == "jpeg") )
+   {
+      result = new ossimJpegWriter;
+   }
+   else if( (ext == "ras") || (ext == "bsq") )
+   {
+      // Default is OSSIM_GENERAL_RASTER_BSQ
+      result = new ossimGeneralRasterWriter;
+   }
+   else if(ext == "bil")
+   {
+      result = new ossimGeneralRasterWriter;
+      result->setOutputImageType(OSSIM_GENERAL_RASTER_BIL);
+   }
+   else if(ext == "bip")
+   {
+      result = new ossimGeneralRasterWriter;
+      result->setOutputImageType(OSSIM_GENERAL_RASTER_BIP);
+   }
+   else if((ext == "ntf")||
+           (ext == "nitf"))
+   {
+      result = new ossimNitfWriter;
+   }
+   else if( ext == "pdf" )
+   {
+      result = new ossimPdfWriter;
+   }
+   
+   return result;
+}
+
+ossimImageFileWriter*
+ossimImageWriterFactory::createWriter(const ossimKeywordlist& kwl,
+                                      const char *prefix)const
+{
+   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   ossimImageFileWriter* result = (ossimImageFileWriter*)NULL;
+   
+   if(type != "")
+   {
+      result = createWriter(type);
+      if (result)
+      {
+         if (result->hasImageType(type))
+         {
+            ossimKeywordlist kwl2(kwl);
+            kwl2.add(prefix,
+                     ossimKeywordNames::IMAGE_TYPE_KW,
+                     type,
+                     true);
+         
+            result->loadState(kwl2, prefix);
+         }
+         else
+         {
+            result->loadState(kwl, prefix);
+         }
+      }
+   }
+
+   return result;
+}
+
+ossimImageFileWriter*
+ossimImageWriterFactory::createWriter(const ossimString& typeName)const
+{
+   ossimString mimeType = typeName;
+   mimeType = mimeType.downcase();
+	
+   // Check for tiff writer.
+   ossimRefPtr<ossimImageFileWriter> writer = createFromMimeType(mimeType);
+	
+   if(writer.valid())
+   {
+      return writer.release();
+   }
+ 
+   // Check for generic ossim writer.
+   writer = new ossimWriter;
+   if ( writer->getClassName() == typeName )
+   {
+      return writer.release();
+   }
+   else
+   {
+      // See if the type name is supported by the writer.
+      if ( writer->hasImageType(typeName) )
+      {
+         writer->setOutputImageType(typeName);
+         return writer.release();
+      }
+   }
+
+   writer = new ossimTiffWriter;
+   
+   if (STATIC_TYPE_NAME(ossimTiffWriter) == typeName )
+   {
+      return writer.release();
+   }
+   else
+   {
+      // See if the type name is supported by the writer.
+      if ( writer->hasImageType(typeName) )
+      {
+         writer->setOutputImageType(typeName);
+         return writer.release();
+      }
+   }
+
+   // Check for jpeg writer.
+   writer = new ossimJpegWriter;
+   if ( writer->getClassName() == typeName )
+   {
+      return writer.release();
+   }
+   else
+   {
+      // See if the type name is supported by the writer.
+      if ( writer->hasImageType(typeName) )
+      {
+         writer->setOutputImageType(typeName);
+         return writer.release();
+      }
+   }
+	
+   // Check for general raster writer.
+   writer = new ossimGeneralRasterWriter;
+   if ( writer->getClassName() == typeName )
+   {
+      return writer.release();
+   }
+   else
+   {
+      // See if the type name is supported by the writer.
+      if ( writer->hasImageType(typeName) )
+      {
+         writer->setOutputImageType(typeName);
+         return writer.release();
+      }
+   }
+
+   // Check for nitf writer.
+   writer = new ossimNitfWriter;
+   if ( writer->getClassName() == typeName )
+   {
+      return writer.release();
+   }
+   else
+   {
+      // See if the type name is supported by the writer.
+      if ( writer->hasImageType(typeName) )
+      {
+         writer->setOutputImageType(typeName);
+         return writer.release();
+      }
+   }
+
+   // Check for nitf writer.
+   writer = new ossimNitf20Writer;
+   if ( writer->getClassName() == typeName )
+   {
+      return writer.release();
+   }
+   else
+   {
+      // See if the type name is supported by the writer.
+      if ( writer->hasImageType(typeName) )
+      {
+         writer->setOutputImageType(typeName);
+         return writer.release();
+      }
+   }
+
+   // Check for pdf writer.
+   writer = new ossimPdfWriter;
+   if ( writer->getClassName() == typeName )
+   {
+      return writer.release();
+   }
+   else
+   {
+      // See if the type name is supported by the writer.
+      if ( writer->hasImageType(typeName) )
+      {
+         writer->setOutputImageType(typeName);
+         return writer.release();
+      }
+   }
+   
+   writer = 0; // Not a nitf writer.   
+
+   return writer.release(); // Return a null writer.
+}
+
+ossimImageFileWriter* ossimImageWriterFactory::createFromMimeType(
+   const ossimString& mimeType)const
+{
+   if((mimeType == "image/jpeg")||
+      (mimeType == "image/jpg"))
+   {
+      ossimJpegWriter* writer = new ossimJpegWriter;
+      writer->setOutputImageType("jpeg");
+      return writer;
+   }
+   else if((mimeType == "image/tiff")||
+           (mimeType == "image/tif")||
+           (mimeType == "image/gtif")||
+           (mimeType == "image/gtiff"))
+   {
+      ossimTiffWriter* writer = new ossimTiffWriter;
+      writer->setOutputImageType("tiff_tiled_band_separate");
+      return writer;
+   }
+   else if((mimeType == "image/nitf") ||
+           (mimeType == "image/ntf"))
+   {
+      ossimNitfWriter* writer = new ossimNitfWriter;
+      writer->setOutputImageType("nitf_block_band_separate");
+      return writer;
+   }
+   else if((mimeType == "image/ras"))
+   {
+      ossimGeneralRasterWriter* writer = new ossimGeneralRasterWriter;
+      writer->setOutputImageType("general_raster_bsq");
+      return writer;
+   }
+   else if((mimeType == "application/pdf")||
+           (mimeType == "image/pdf"))
+   {
+      ossimPdfWriter* writer = new ossimPdfWriter;
+      writer->setOutputImageType("ossim_pdf");
+      return writer;
+   }
+   return 0;
+}
+
+ossimObject* ossimImageWriterFactory::createObject(const ossimKeywordlist& kwl,
+                                                   const char *prefix)const
+{
+   return createWriter(kwl, prefix);
+}
+
+ossimObject* ossimImageWriterFactory::createObject(const ossimString& typeName)const
+{
+   return createWriter(typeName);
+}
+
+void ossimImageWriterFactory::getExtensions(std::vector<ossimString>& result)const
+{
+   result.push_back("ras");
+   result.push_back("bsq");
+   result.push_back("bil");
+   result.push_back("bip");
+   result.push_back("tif");
+   result.push_back("jpg");
+   result.push_back("ntf");
+   result.push_back("pdf");
+}
+
+void ossimImageWriterFactory::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   typeList.push_back(STATIC_TYPE_NAME(ossimTiffWriter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimJpegWriter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimGeneralRasterWriter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimNitfWriter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimNitf20Writer));
+   typeList.push_back(STATIC_TYPE_NAME(ossimPdfWriter));
+   typeList.push_back(STATIC_TYPE_NAME(ossimWriter));
+}
+
+void ossimImageWriterFactory::getImageFileWritersBySuffix(
+   ossimImageWriterFactoryBase::ImageFileWriterList& result, const ossimString& ext)const
+{
+   ossimString testExt = ext.downcase();
+   if(testExt == "tiff" || testExt == "tif")
+   {
+      result.push_back(new ossimTiffWriter);
+   }
+   else if(testExt == "ntf" || testExt == "nitf")
+   {
+      result.push_back(new ossimNitfWriter);
+   }
+   else if(testExt == "jpg" || testExt == "jpeg")
+   {
+      result.push_back(new ossimJpegWriter);
+   }
+   else if(testExt == "ras" || testExt == "bsq" || testExt == "bil" || testExt == "bip")
+   {
+      result.push_back(new ossimGeneralRasterWriter);
+   }
+   else if( testExt == "pdf" )
+   {
+      result.push_back( new ossimPdfWriter );
+   }
+}
+
+void ossimImageWriterFactory::getImageFileWritersByMimeType(
+   ossimImageWriterFactoryBase::ImageFileWriterList& result, const ossimString& mimeType ) const
+{
+   ossimString testExt = mimeType.downcase();
+   testExt = ossimString(testExt.begin()+6, testExt.end());
+   
+   getImageFileWritersBySuffix(result, testExt);
+}
+
+void ossimImageWriterFactory::getImageTypeList( std::vector<ossimString>& imageTypeList ) const
+{
+   // Add the tiff writer types.
+   ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter;
+   writer->getImageTypeList(imageTypeList);
+
+   // Add the jpeg writer types.
+   writer = new ossimJpegWriter;
+   writer->getImageTypeList(imageTypeList);
+
+   // Add the general raster writer types.
+   writer = new ossimGeneralRasterWriter;
+   writer->getImageTypeList(imageTypeList);
+
+   // Add the nitf writer types.
+   writer = new ossimNitfWriter;
+   writer->getImageTypeList(imageTypeList);
+   
+   // Add the nitf writer types.
+   writer = new ossimNitf20Writer;
+   writer->getImageTypeList(imageTypeList);
+   
+   // Add the pdf writer types.
+   writer = new ossimPdfWriter;
+   writer->getImageTypeList(imageTypeList);
+   
+   // Add the generic ossim writer types.
+   writer = new ossimWriter;
+   writer->getImageTypeList(imageTypeList);
+   
+   writer = 0;
+}
diff --git a/ossim/src/ossim/imaging/ossimImageWriterFactoryBase.cpp b/src/imaging/ossimImageWriterFactoryBase.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimImageWriterFactoryBase.cpp
rename to src/imaging/ossimImageWriterFactoryBase.cpp
diff --git a/src/imaging/ossimImageWriterFactoryRegistry.cpp b/src/imaging/ossimImageWriterFactoryRegistry.cpp
new file mode 100644
index 0000000..ca4a896
--- /dev/null
+++ b/src/imaging/ossimImageWriterFactoryRegistry.cpp
@@ -0,0 +1,317 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Frank Warmerdam (warmerda at home.com)
+//
+//*******************************************************************
+//  $Id: ossimImageWriterFactoryRegistry.cpp 22865 2014-08-06 11:17:03Z gpotts $
+
+#include <ossim/imaging/ossimImageWriterFactory.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <algorithm>
+#include <iterator>
+#include <ostream>
+
+//ossimImageWriterFactoryRegistry* ossimImageWriterFactoryRegistry::theInstance = NULL;
+
+ossimImageWriterFactoryRegistry::ossimImageWriterFactoryRegistry()
+{
+}
+
+ossimImageWriterFactoryRegistry* ossimImageWriterFactoryRegistry::instance()
+{
+   static ossimImageWriterFactoryRegistry inst;
+   static bool initInst = false;
+   if(!initInst)
+   {
+      ossimObjectFactoryRegistry::instance()->registerFactory(&inst);
+      ossimImageWriterFactory::instance();
+      initInst = true;
+   }
+
+   return &inst;
+//   if(!theInstance)
+//   {
+//      theInstance = new ossimImageWriterFactoryRegistry;
+//   }
+
+//   return theInstance;
+}
+
+
+ossimImageFileWriter* ossimImageWriterFactoryRegistry::createWriter(const ossimFilename& filename)const
+{
+   ossimImageFileWriter * writer = createWriterFromExtension(filename.ext().downcase());
+   if(writer)
+   {
+      writer->setFilename(filename);
+   }
+   
+   return writer;
+}
+
+ossimObject* ossimImageWriterFactoryRegistry::createObject(const ossimKeywordlist &kwl,
+                                                           const char *prefix)const
+{
+   return createObjectFromRegistry(kwl, prefix);
+}
+
+ossimObject* ossimImageWriterFactoryRegistry::createObject(const ossimString& typeName)const
+{
+   return createObjectFromRegistry(typeName);
+}
+
+void ossimImageWriterFactoryRegistry::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   getAllTypeNamesFromRegistry(typeList);
+}
+
+ossimImageFileWriter *ossimImageWriterFactoryRegistry::createWriterFromExtension(const ossimString& fileExtension)const
+{
+   ossimImageFileWriter *writer = NULL;
+   ossimImageWriterFactoryBase::ImageFileWriterList result;
+   getImageFileWritersBySuffix(result, fileExtension);
+   if(!result.empty())
+   {
+      writer = result[0].release();
+      result.clear();
+   }
+   return writer;
+}
+
+ossimImageFileWriter *ossimImageWriterFactoryRegistry::createWriter(const ossimKeywordlist &kwl,
+                                                                const char *prefix)const
+{
+   // let's see if we ned to return an object based on extension.
+   // this is specified by the type to be a generic
+   // ossimImageFileWriter
+   //
+   ossimString type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+
+   if(type == "ossimImageFileWriter")
+   {
+      ossimFilename filename = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+
+      if((filename != "")&&
+         (filename.ext() != ""))
+      {
+         ossimImageFileWriter* writer = createWriterFromExtension(filename.ext());
+
+         if(writer)
+         {
+            writer->setFilename(filename);
+         }
+         return writer;
+      }
+   }
+   
+   vector<ossimImageWriterFactoryBase*>::const_iterator factories;
+   ossimImageFileWriter *result = NULL;
+
+   factories = m_factoryList.begin();
+   while(factories != m_factoryList.end())
+   {
+      result = (*factories)->createWriter(kwl, prefix);
+      if(result)
+      {
+         return result;
+      }
+      ++factories;
+   }
+
+   return result;
+}
+
+ossimImageFileWriter *ossimImageWriterFactoryRegistry::createWriter(const ossimString& typeName)const
+{
+   vector<ossimImageWriterFactoryBase*>::const_iterator factories;
+   ossimImageFileWriter *result = NULL;
+
+   factories = m_factoryList.begin();
+   while(factories != m_factoryList.end())
+   {
+      result = (*factories)->createWriter(typeName);
+      if(result)
+      {
+         return result;
+      }
+      ++factories;
+   }
+
+   return result;
+}
+
+
+void ossimImageWriterFactoryRegistry::getImageTypeList(std::vector<ossimString>& typeList)const
+{
+   vector<ossimString> result;
+   vector<ossimImageWriterFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   
+   while(iter != m_factoryList.end())
+   {
+      result.clear();
+      (*iter)->getImageTypeList(result);
+      
+      // now append to the end of the typeList.
+      typeList.insert(typeList.end(),
+                      result.begin(),
+                      result.end());
+      ++iter;
+   }  
+}
+
+void ossimImageWriterFactoryRegistry::getImageFileWritersBySuffix(ossimImageWriterFactoryBase::ImageFileWriterList& result,
+                                                                  const ossimString& ext)const
+{
+   ossimImageWriterFactoryBase::ImageFileWriterList tempResult;
+   vector<ossimImageWriterFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   
+   while(iter != m_factoryList.end())
+   {
+      result.clear();
+      (*iter)->getImageFileWritersBySuffix(tempResult, ext);
+      
+      // now append to the end of the typeList.
+      result.insert(result.end(),
+                      tempResult.begin(),
+                      tempResult.end());
+      ++iter;
+   }  
+   
+}
+
+void ossimImageWriterFactoryRegistry::getImageFileWritersByMimeType(ossimImageWriterFactoryBase::ImageFileWriterList& result,
+                                                                    const ossimString& mimeType)const
+{
+   ossimImageWriterFactoryBase::ImageFileWriterList tempResult;
+   vector<ossimImageWriterFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   
+   while(iter != m_factoryList.end())
+   {
+      result.clear();
+      (*iter)->getImageFileWritersByMimeType(tempResult, mimeType);
+      
+      // now append to the end of the typeList.
+      result.insert(result.end(),
+                    tempResult.begin(),
+                    tempResult.end());
+      ++iter;
+   }  
+}
+
+std::ostream& ossimImageWriterFactoryRegistry::printImageTypeList(
+   std::ostream& out)const
+{
+   std::vector<ossimString> outputType;
+   
+   this->getImageTypeList(outputType);
+   std::copy(outputType.begin(),
+             outputType.end(),
+             std::ostream_iterator<ossimString>(out, "\n"));
+   out << std::endl;
+   return out;
+}
+
+std::ostream& ossimImageWriterFactoryRegistry::printWriterProps(std::ostream& out)const
+{
+   // Loop through factories:
+   vector<ossimImageWriterFactoryBase*>::const_iterator factoryIter = m_factoryList.begin();
+   while( factoryIter != m_factoryList.end() )
+   {
+      out << "factory: " << (*factoryIter)->getClassName() << "\n\n";
+
+      // Loop through writer classes in factory.
+      std::vector<ossimString> typeNames;
+      (*factoryIter)->getTypeNameList(typeNames);
+      std::vector<ossimString>::const_iterator typeNamesIter = typeNames.begin();
+      while (typeNamesIter != typeNames.end())
+      {
+         ossimRefPtr<ossimImageFileWriter> writer = (*factoryIter)->createWriter(*typeNamesIter);
+         if ( writer.valid() )
+         {
+            out << "writer:\n" << writer->getClassName() << "\n";
+
+            // Loop through writer types, e.g. tiff_tiled_band_separate
+            std::vector<ossimString> imageTypeList;
+            writer->getImageTypeList(imageTypeList);
+            std::vector<ossimString>::const_iterator imageTypeListIter = imageTypeList.begin();
+            out << "\ntypes:\n";
+            while ( imageTypeListIter != imageTypeList.end() )
+            {
+               out << (*imageTypeListIter) << "\n";
+               ++imageTypeListIter;
+            }
+
+            // Loop through writer properties:
+            std::vector<ossimString> propNames;
+            writer->getPropertyNames(propNames);
+            if ( propNames.size() )
+            {
+               out << "\nproperties:\n";
+               ossimRefPtr<ossimProperty> prop = 0;
+               std::vector<ossimString>::const_iterator p = propNames.begin();
+               while ( p != propNames.end() )
+               {
+                  out << "   " << (*p) << "\n";
+                  prop = writer->getProperty( *p );
+                  if ( prop.valid() )
+                  {
+                     ossimStringProperty* stringProp =
+                        dynamic_cast<ossimStringProperty*>(prop.get());
+                     if ( stringProp )
+                     {
+                        if ( stringProp->getConstraints().size() )
+                        {
+                           out << "      constraints:\n";
+                           std::vector<ossimString>::const_iterator strPropIter =
+                              stringProp->getConstraints().begin();
+                           while( strPropIter != stringProp->getConstraints().end() )
+                           {
+                              out << "         " << (*strPropIter) << "\n";
+                              ++strPropIter;
+                           }
+                        }
+                     }
+                  }
+                  
+                  ++p;
+               }
+               out << "\n";
+            }
+         }
+         ++typeNamesIter;
+      }
+      
+      ++factoryIter;
+   }
+   return out;
+}
+
+extern "C"
+{
+  void* ossimImageWriterFactoryRegistryGetInstance()
+  {
+    return ossimImageWriterFactoryRegistry::instance();
+  }
+}
+
+ossimImageWriterFactoryRegistry::ossimImageWriterFactoryRegistry(const ossimImageWriterFactoryRegistry&)
+   :
+      ossimObjectFactory()
+{
+}
+
+void ossimImageWriterFactoryRegistry::operator=(const ossimImageWriterFactoryRegistry&)
+{
+}
diff --git a/src/imaging/ossimIndexToRgbLutFilter.cpp b/src/imaging/ossimIndexToRgbLutFilter.cpp
new file mode 100644
index 0000000..26b3fb6
--- /dev/null
+++ b/src/imaging/ossimIndexToRgbLutFilter.cpp
@@ -0,0 +1,472 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************
+// $Id: ossimIndexToRgbLutFilter.cpp 23242 2015-04-08 17:31:35Z dburken $
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+RTTI_DEF1(ossimIndexToRgbLutFilter, "ossimIndexToRgbLutFilter", ossimImageSourceFilter);
+
+static const char* MIN_VALUE_KW = "min_value";
+static const char* MAX_VALUE_KW = "max_value";
+static const char* MODE_KW = "mode";
+static const char* LUT_FILE_KW = "lut_file";
+
+ossimIndexToRgbLutFilter::ossimIndexToRgbLutFilter()
+:ossimImageSourceFilter(),
+ theMinValue(ossim::nan()),
+ theMaxValue(ossim::nan()),
+ theMinValueOverride(false),
+ theMaxValueOverride(false),
+ theMode(REGULAR),
+ theTile(0),
+ theLutFile("")
+{
+   setDescription("Look-up-table remapper from single-band index image to 24-bit RGB.");
+}
+
+ossimIndexToRgbLutFilter::~ossimIndexToRgbLutFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimIndexToRgbLutFilter::getTile(const ossimIrect& tileRect,
+                                                              ossim_uint32 resLevel)
+{
+   if(!theInputConnection || (theLut.size() == 0))
+      return 0;
+
+   ossimRefPtr<ossimImageData> tile = theInputConnection->getTile(tileRect, resLevel);
+   if (!tile || !tile->getBuf())
+      return 0;
+   if(!theTile)
+   {
+      allocate();
+      if (!theTile)
+         return 0;
+   }
+
+   theTile->setImageRectangle(tileRect);
+   theTile->makeBlank();
+
+   // Quick handling special case of empty input tile:
+   if (tile->getDataObjectStatus() == OSSIM_EMPTY)
+      return theTile;
+
+   ossim_uint8* outBuf[3];
+   outBuf[0] = (ossim_uint8*)(theTile->getBuf(0));
+   outBuf[1] = (ossim_uint8*)(theTile->getBuf(1));
+   outBuf[2] = (ossim_uint8*)(theTile->getBuf(2));
+
+   ossim_uint32 maxLength = tile->getWidth()*tile->getHeight();
+   ossimRgbVector color;
+   const ossimRgbVector null_color (theTile->getNullPix(0), theTile->getNullPix(1), theTile->getNullPix(2));
+   double index;
+   std::map<double, ossimRgbVector>::const_iterator lut_entry;
+   double null_index = theInputConnection->getNullPixelValue();
+
+   for (ossim_uint32 pixel=0; pixel<maxLength; ++pixel)
+   {
+      // Convert input pixel to a double index value:
+      switch(tile->getScalarType())
+      {
+      case OSSIM_DOUBLE:
+         index = ((double*) tile->getBuf())[pixel];
+         break;
+      case OSSIM_SSHORT16:
+         index = (double)(((ossim_sint16*) tile->getBuf())[pixel]);
+         break;
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+         index = (double)(((float*) tile->getBuf())[pixel]);
+         break;
+      case OSSIM_UCHAR:
+         index = (double)(((ossim_uint8*) tile->getBuf())[pixel]);
+         break;
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+         index = (double)(((ossim_uint16*) tile->getBuf())[pixel]);
+         break;
+      default:
+         break;
+      }
+
+      // Do not remap null pixels, leave the output pixel "blank" which is null-pixel value:
+      if (index == null_index)
+         continue;
+
+      // REGULAR mode needs to clamp the indices to min max for non-null pixels:
+      if (theMode == REGULAR)
+      {
+         if (index < theMinValue)
+            index = theMinValue;
+         else if (index > theMaxValue)
+            index = theMaxValue;
+      }
+
+      // Now perform look-up depending on mode:
+      if (theMode == LITERAL)
+      {
+         lut_entry = theLut.find(index);
+         if (lut_entry == theLut.end())
+            color = null_color;
+         else
+            color = lut_entry->second;
+      }
+      else
+      {
+         // Vertices and Regular mode perform same interpolation here between the line segments
+         // vertices:
+         lut_entry = theLut.find(index);
+         if (lut_entry != theLut.end())
+         {
+            // Got exact match, no interpolation needed:
+            color = lut_entry->second;
+         }
+         else
+         {
+            lut_entry = theLut.upper_bound(index);
+            if ((lut_entry == theLut.end()) || (lut_entry == theLut.begin()))
+               color = null_color;
+            else
+            {
+               // Need to linearly interpolate:
+               double index_hi = lut_entry->first;
+               ossimRgbVector color_hi (lut_entry->second);
+               --lut_entry;
+               double index_lo = lut_entry->first;
+               ossimRgbVector color_lo (lut_entry->second);
+               double w_lo = (index_hi - index)/(index_hi - index_lo);
+               double w_hi = 1.0 - w_lo;
+               color.setR(ossim::round<ossim_uint8, double>( color_hi.getR()*w_hi + color_lo.getR()*w_lo ));
+               color.setG(ossim::round<ossim_uint8, double>( color_hi.getG()*w_hi + color_lo.getG()*w_lo ));
+               color.setB(ossim::round<ossim_uint8, double>( color_hi.getB()*w_hi + color_lo.getB()*w_lo ));
+            }
+         }
+      }
+
+      // Assign this output pixel:
+      outBuf[0][pixel]  = color.getR();
+      outBuf[1][pixel]  = color.getG();
+      outBuf[2][pixel]  = color.getB();
+
+   } // end loop over tile's pixels
+
+   theTile->validate();
+   return theTile;
+}
+
+void ossimIndexToRgbLutFilter::allocate()
+{
+   if(!theInputConnection) return;
+
+   theTile = ossimImageDataFactory::instance()->create(this, 3, this);
+   if(theTile.valid())
+   {
+      theTile->initialize();
+   }
+}
+
+void ossimIndexToRgbLutFilter::initialize()
+{
+   // This assigns theInputConnection if one is there.
+   ossimImageSourceFilter::initialize();
+
+   // theTile will get allocated on first getTile call.
+   theTile = 0;
+
+   if ( theInputConnection )
+   {
+      // Initialize the chain on the left hand side of us.
+      theInputConnection->initialize();
+      if(!theMinValueOverride)
+         theMinValue = theInputConnection->getMinPixelValue(0);
+      if(!theMaxValueOverride)
+         theMaxValue = theInputConnection->getMaxPixelValue(0);
+      if(theMinValue > theMaxValue)
+         swap(theMinValue, theMaxValue);
+   }
+}
+
+bool ossimIndexToRgbLutFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   if (theMinValueOverride)
+      kwl.add(prefix, MIN_VALUE_KW, theMinValue, true);
+
+   if (theMaxValueOverride)
+      kwl.add(prefix, MAX_VALUE_KW, theMaxValue, true);
+
+   ossimString value;
+   switch (theMode)
+   {
+   case LITERAL:
+      value = "literal";
+      break;
+   case VERTICES:
+      value = "vertices";
+      break;
+   default:
+      value = "regular";
+   }
+   kwl.add(prefix, MODE_KW,  value.c_str(), true);
+
+   bool rtn_stat = true;
+
+   // Save the actual LUT:
+   const ossimString entry_kw ("entry");
+   ossimString color_keyword, base_keyword;
+   ossimRgbVector rgbVector;
+   ossimString blank(" ");
+
+   ossim_uint32 entry = 0;
+   std::map<double, ossimRgbVector>::const_iterator iter =  theLut.begin();
+   while (iter != theLut.end())
+   {
+      base_keyword = entry_kw + ossimString::toString(entry);
+      if ((theMode == LITERAL) || (theMode == VERTICES))
+      {
+         // Index and color are sub-entries for these modes:
+         kwl.add(prefix, (base_keyword+".index").chars(), iter->first);
+         color_keyword = base_keyword + ".color";
+      }
+      else
+      {
+         color_keyword = base_keyword;
+      }
+
+      rgbVector = iter->second;
+      value = ossimString::toString((int)rgbVector.getR()) + blank +
+            ossimString::toString((int)rgbVector.getG()) + blank +
+            ossimString::toString((int)rgbVector.getB());
+      kwl.add(prefix, color_keyword.chars(), value.chars());
+      ++iter;
+      ++entry;
+   }
+
+   rtn_stat &= ossimImageSourceFilter::saveState(kwl, prefix);
+   return rtn_stat;
+}
+
+bool ossimIndexToRgbLutFilter::loadState(const ossimKeywordlist& orig_kwl, const char* prefix)
+{
+   bool return_state = true;
+   ossimKeywordlist* kwl = new ossimKeywordlist(orig_kwl); // need non-const copy
+
+   // First look for a LUT filename, and add its contents to the original KWL:
+   theLutFile = kwl->find(prefix, LUT_FILE_KW);
+   if (!theLutFile.empty())
+   {
+      // Need new (non const) KWL to hold merged contents, maintaining proper prefix if any:
+      ossimKeywordlist lut_kwl;
+      if (lut_kwl.addFile(theLutFile))
+         kwl->add(prefix, lut_kwl, false); // appends all entries of lut_kwl with prefix before adding
+   }
+
+   theMinValueOverride = false;
+   ossimString lookup = kwl->find(prefix, MIN_VALUE_KW);
+   if(!lookup.empty())
+   {
+      theMinValue =lookup.toDouble();
+      theMinValueOverride = true;
+   }
+
+   theMaxValueOverride = false;
+   lookup = kwl->find(prefix, MAX_VALUE_KW);
+   if(!lookup.empty())
+   {
+      theMaxValue = lookup.toDouble();
+      theMaxValueOverride = true;
+   }
+
+   lookup =  kwl->find(prefix, MODE_KW);
+   if (lookup.contains("literal"))
+      theMode = LITERAL;
+   else if (lookup.contains("vertices"))
+      theMode = VERTICES;
+   else
+      theMode = REGULAR;
+
+   return_state &= initializeLut(kwl, prefix);
+   return_state &= ossimImageSourceFilter::loadState(orig_kwl, prefix);
+
+   delete kwl;
+   return return_state;
+}
+
+bool ossimIndexToRgbLutFilter::initializeLut(const ossimKeywordlist* kwl, const char* prefix)
+{
+   theLut.clear();
+
+   const ossimString entry_kw ("entry");
+   ossimString keyword, base_keyword;
+   ossimString indexStr, rgbStr;
+   ossimString blank(" ");
+   std::vector<ossimString> rgbList;
+   double index;
+   ossimRgbVector rgbVector (0,0,0);
+   bool rtn_state = true;
+
+   ossim_uint32 numEntries=0;
+   while (true)
+   {
+      base_keyword = entry_kw + ossimString::toString(numEntries);
+      if ((theMode == LITERAL) || (theMode == VERTICES))
+      {
+         // Index and color are subentries for this mode:
+         keyword = base_keyword + ".index";
+         indexStr = kwl->find(prefix, keyword.chars());
+         if (indexStr.empty())
+            break;
+
+         index = indexStr.toDouble();
+         keyword = base_keyword + ".color";
+         rgbStr = kwl->find(prefix, keyword.chars());
+      }
+      else
+      {
+         // REGULAR mode: index is computed later to arrive at equally-spaced vertices. For now,
+         // just store entry number as index:
+         index = (double) numEntries;
+         keyword = base_keyword;
+         rgbStr = kwl->find(prefix, keyword.chars());
+         if (rgbStr.empty())
+         {
+            // Perhaps old bloated form with separate keywords for R, G, B
+            rgbStr = kwl->find(prefix, (keyword + ".r").chars());
+            rgbStr += " ";
+            rgbStr += kwl->find(prefix, (keyword + ".g").chars());
+            rgbStr += " ";
+            rgbStr += kwl->find(prefix, (keyword + ".b").chars());
+            if (rgbStr.length() < 5)
+               break;
+         }
+      }
+
+      rgbStr.split(rgbList, blank, true);
+      if (rgbList.size() != 3)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<"ossimIndexToRgbLutFilter::initializeLut() -- "
+               "Bad color specification in LUT KWL. LUT is not properly initialized."<<endl;
+         return false;
+      }
+
+      rgbVector.setR(rgbList[0].toUInt8());
+      rgbVector.setG(rgbList[1].toUInt8());
+      rgbVector.setB(rgbList[2].toUInt8());
+      theLut.insert(std::pair<double, ossimRgbVector>(index, rgbVector));
+      rgbList.clear();
+      ++numEntries;
+   }
+
+   // For REGULAR mode, need to adjust the indices to reflect a piecewise linear LUT with equally
+   // spaced vertices:
+   if (theMode == REGULAR)
+   {
+      std::map<double, ossimRgbVector> orig_lut = theLut;
+      std::map<double, ossimRgbVector>::iterator iter =  orig_lut.begin();
+      theLut.clear();
+
+      if (numEntries == 1)
+      {
+         // Insert the implied start index at black and endpoint at specified color:
+         theLut.insert(std::pair<double, ossimRgbVector>(theMinValue, ossimRgbVector (1, 1, 1)));
+         theLut.insert(std::pair<double, ossimRgbVector>(theMaxValue, iter->second));
+      }
+      else
+      {
+         // Loop to create equally-spaced vertices between min and max index values:
+         double interval = (theMaxValue - theMinValue) / (numEntries - 1);
+         while (iter != orig_lut.end())
+         {
+            index = theMinValue + iter->first*interval;
+            theLut.insert(std::pair<double, ossimRgbVector>(index, iter->second));
+            ++iter;
+         }
+      }
+   }
+
+   return rtn_state;
+}
+
+ossim_uint32 ossimIndexToRgbLutFilter::getNumberOfOutputBands() const
+{
+   if(isSourceEnabled())
+   {
+      return 3;
+   }
+   return ossimImageSourceFilter::getNumberOfOutputBands();
+}
+
+ossimScalarType ossimIndexToRgbLutFilter::getOutputScalarType() const
+{
+   if(isSourceEnabled())
+   {
+      return OSSIM_UCHAR;
+   }
+
+   return ossimImageSourceFilter::getOutputScalarType();
+}
+
+void ossimIndexToRgbLutFilter::setLut(const ossimFilename& file)
+{
+   theLutFile = file;
+   if(file.exists())
+   {
+      ossimKeywordlist kwl(theLutFile);
+      loadState(kwl);
+   }
+}
+
+double ossimIndexToRgbLutFilter::getMinValue()const
+{
+   return theMinValue;
+}
+
+double ossimIndexToRgbLutFilter::getMaxValue()const
+{
+   return theMaxValue;
+}
+
+void ossimIndexToRgbLutFilter::setMinValue(double value)
+{
+   theMinValue = value;
+}
+
+void ossimIndexToRgbLutFilter::setMaxValue(double value)
+{
+   theMaxValue = value;
+}
+
+double ossimIndexToRgbLutFilter::getNullPixelValue(ossim_uint32 /* band */ )const
+{
+   return 0.0;
+}
+
+double ossimIndexToRgbLutFilter::getMinPixelValue(ossim_uint32 /* band */)const
+{
+   return 1.0;
+}
+
+double ossimIndexToRgbLutFilter::getMaxPixelValue(ossim_uint32 /* band */)const
+{
+   return 255.0;
+}
+
+
diff --git a/src/imaging/ossimIntensityAdjustmentFilter.cpp b/src/imaging/ossimIntensityAdjustmentFilter.cpp
new file mode 100644
index 0000000..ad25eeb
--- /dev/null
+++ b/src/imaging/ossimIntensityAdjustmentFilter.cpp
@@ -0,0 +1,288 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+// $Id: ossimIntensityAdjustmentFilter.cpp 13330 2008-07-28 18:04:40Z dburken $
+#include <ossim/imaging/ossimIntensityAdjustmentFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimHsvVector.h>
+#include <ossim/base/ossimRgbVector.h>
+
+RTTI_DEF1(ossimIntensityAdjustmentFilter, "ossimIntensityAdjustmentFilter", ossimImageSourceFilter);
+
+ossimIntensityAdjustmentFilter::ossimIntensityAdjustmentFilter()
+   :ossimImageSourceFilter(),
+    theMeanIntensityTarget(ossim::nan()),
+    theNormTile(NULL),
+    theTile(NULL),
+    theBlankTile(NULL)
+{
+   theGridBounds.makeNan();
+}
+
+ossimIntensityAdjustmentFilter::~ossimIntensityAdjustmentFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimIntensityAdjustmentFilter::getTile(
+   const ossimIrect& rect,
+   ossim_uint32 resLevel)
+{
+   if (!theTile.valid())
+   {
+      allocate(); // first time through.
+   }
+   
+   if(theBlankTile.valid())
+   {
+      theBlankTile->setImageRectangle(rect);
+   }
+   if(!theInputConnection)
+   {
+      return theBlankTile;
+   }
+   ossimRefPtr<ossimImageData> data =
+      theInputConnection->getTile(rect, resLevel);
+   
+   if(!isSourceEnabled())
+   {
+      return data;
+   }
+   theTile->setImageRectangle(rect);
+   theNormTile->setImageRectangle(rect);
+   loadNormTile(data);
+
+   if(ossim::isnan(theMeanIntensityTarget))
+   {
+      theMeanIntensityTarget = theMeanIntensityGrid.meanValue();
+   }
+
+   loadNormTile(data);
+   
+   if((theNormTile->getDataObjectStatus()!=OSSIM_NULL)&&
+      (theNormTile->getDataObjectStatus()!=OSSIM_EMPTY))
+   {
+      float* buf[3];
+      if(data->getNumberOfBands() == 3)
+      {
+         buf[0] = (float*)theNormTile->getBuf(0);
+         buf[1] = (float*)theNormTile->getBuf(1);
+         buf[2] = (float*)theNormTile->getBuf(2);
+      }
+      else
+      {
+         buf[0] = (float*)theNormTile->getBuf(0);
+         buf[1] = (float*)theNormTile->getBuf(0);
+         buf[2] = (float*)theNormTile->getBuf(0);
+         
+      }
+      ossim_int32 y = 0;
+      ossim_int32 x = 0;
+      ossim_int32 upperY = theNormTile->getHeight();
+      ossim_int32 upperX = theNormTile->getWidth();
+      ossimIpt origin = rect.ul();
+      
+      for(y = 0; y < upperY; ++y)
+      {
+         for(x = 0; x < upperX; ++x)
+         {
+            ossimIpt pt = ossimIpt(origin.x + x,
+                                   origin.y + y) - theGridBounds.ul();
+
+            if((buf[0] != 0) &&
+               (buf[1] != 0) &&
+               (buf[2] != 0))
+            {
+               
+               ossimRgbVector rgb((ossim_uint8)(*(buf[0])*255.0),
+                                  (ossim_uint8)(*(buf[1])*255.0),
+                                  (ossim_uint8)(*(buf[2])*255.0));
+               ossimHsvVector hsv(rgb);
+               
+               hsv.setV(matchTargetMean(hsv.getV(),
+                                        theMeanIntensityGrid(pt.x, pt.y),
+                                        theMeanIntensityTarget,
+                                        theNormTile->getMinPix(0),
+                                        theNormTile->getMaxPix(0)));
+               ossimRgbVector result(hsv);
+               
+               *buf[0] = result.getR()/255.0;
+               *buf[1] = result.getG()/255.0;
+               *buf[2] = result.getB()/255.0;
+            }
+            
+            ++buf[0];
+            ++buf[1];
+            ++buf[2];
+         }
+      }
+   }
+   theTile->copyNormalizedBufferToTile((float*)theNormTile->getBuf());
+   theTile->validate();
+   
+   return theTile;
+}
+
+void ossimIntensityAdjustmentFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   theNormTile = NULL;
+   theBlankTile = NULL;
+   
+   if(theInputConnection)
+   {
+      theGridBounds = theInputConnection->getBoundingRect();
+   }
+   else
+   {
+      theGridBounds.makeNan();
+   }
+}
+
+void ossimIntensityAdjustmentFilter::allocate()
+{
+   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
+   theTile = (ossimImageData*)theBlankTile->dup();
+   theTile->initialize();
+}
+
+void ossimIntensityAdjustmentFilter::createAndPopulateGrid(const ossimIpt& spacing,
+                                                           double targetMean)
+{
+   if(theInputConnection)
+   {
+      ossim_uint32 x = 0;
+      ossim_uint32 y = 0;
+
+      theGridBounds        = theInputConnection->getBoundingRect();
+
+      ossimDrect rect(0,
+                      0,
+                      theGridBounds.width()-1,
+                      theGridBounds.height()-1);
+                      
+      theMeanIntensityGrid = ossimDblGrid(rect,
+                                          ossimDpt(spacing),
+                                          0);
+
+      for(y = 0; y <= theGridBounds.height(); y+=spacing.y)
+      {
+         for(x = 0; x <= theGridBounds.width(); x+=spacing.x)
+         {
+            ossimIpt ul(x - 16,
+                        y - 16);
+            
+            ossimIrect sampleRect(ul.x,
+                                  ul.y,
+                                  ul.x + 31,
+                                  ul.y + 31);
+            ossimRefPtr<ossimImageData> data = theInputConnection->getTile(sampleRect);
+            double mean = computeMeanIntensity(data);
+            theMeanIntensityGrid.setNearestNode(ossimDpt(x, y), mean);
+         }
+      }
+//      theMeanIntensityGrid.interpolateNullValuedNodes();
+   }
+   theMeanIntensityTarget = targetMean;
+}
+
+double ossimIntensityAdjustmentFilter::computeMeanIntensity(
+   ossimRefPtr<ossimImageData>& data)
+{
+   double result  = 0;
+   double divisor = 0;
+
+   if(data.valid() &&
+      (data->getDataObjectStatus()!=OSSIM_NULL)&&
+      (data->getDataObjectStatus()!=OSSIM_EMPTY))
+   {
+      loadNormTile(data);
+
+      int i = 0;
+      int upper = data->getWidth()*data->getHeight();
+      float* buf[3];
+      if(data->getNumberOfBands() == 3)
+      {
+         buf[0] = (float*)theNormTile->getBuf(0);
+         buf[1] = (float*)theNormTile->getBuf(1);
+         buf[2] = (float*)theNormTile->getBuf(2);
+      }
+      else
+      {
+         buf[0] = (float*)theNormTile->getBuf();
+         buf[1] = (float*)theNormTile->getBuf();
+         buf[2] = (float*)theNormTile->getBuf();
+      }
+      for(i = 0; i < upper; ++i)
+      {
+         ossimRgbVector rgb((ossim_uint8)(*(buf[0])*255.0),
+                            (ossim_uint8)(*(buf[1])*255.0),
+                            (ossim_uint8)(*(buf[2])*255.0));
+         ossimHsvVector hsv(rgb);
+         if(hsv.getV() > 0.0)
+         {
+            result += hsv.getV();
+            divisor += 1.0;
+         }
+         ++buf[0];
+         ++buf[1];
+         ++buf[2];
+      }
+   }
+
+   if(divisor > 0.0)
+   {
+      result /= divisor;
+   }
+   return result;
+}
+
+void ossimIntensityAdjustmentFilter::loadNormTile(ossimRefPtr<ossimImageData>& data)
+{
+   if(!theNormTile)
+   {
+      theNormTile = ossimImageDataFactory::instance()->create(this,
+                                                              OSSIM_NORMALIZED_FLOAT,
+                                                              data->getNumberOfBands(),
+                                                              data->getWidth(),
+                                                              data->getHeight());
+      theNormTile->initialize();
+   }
+   else
+   {
+      theNormTile->setImageRectangle(data->getImageRectangle());
+   }
+   data->copyTileToNormalizedBuffer((float*)theNormTile->getBuf());
+   theNormTile->validate();
+}
+
+double ossimIntensityAdjustmentFilter::matchTargetMean(double inputValue,
+                                                       double meanValue,
+                                                       double targetMean,
+                                                       double minValue,
+                                                       double maxValue)
+{
+    // max change
+   const double delta = targetMean - meanValue;
+   double weight=0.0;
+   
+   // weight max change dependend on proximity to end points
+   if (inputValue <= meanValue)
+   {
+      weight = fabs((inputValue - minValue) / (meanValue - minValue));
+   }
+   else
+   {
+      weight = fabs((maxValue - inputValue) / (maxValue - meanValue));
+   }
+
+   return  (inputValue + (delta * weight));
+}
diff --git a/src/imaging/ossimJpegCodec.cpp b/src/imaging/ossimJpegCodec.cpp
new file mode 100644
index 0000000..edf1f47
--- /dev/null
+++ b/src/imaging/ossimJpegCodec.cpp
@@ -0,0 +1,532 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: class declaration for base codec(encoder/decoder).
+// 
+//----------------------------------------------------------------------------
+// $Id$
+#include <ossim/imaging/ossimJpegCodec.h>
+
+// we need to get rid of the jpedlib include in this header
+#include <ossim/imaging/ossimJpegMemSrc.h>
+// same for here
+#include <ossim/imaging/ossimJpegMemDest.h>
+
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNumericProperty.h>
+
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <csetjmp>     /** for jmp_buf */
+#include <jpeglib.h>   /** for jpeg stuff */
+
+RTTI_DEF1(ossimJpegCodec, "ossimJpegCodec", ossimCodecBase);
+
+/** @brief Extended error handler struct. */
+struct ossimJpegErrorMgr
+{
+   struct jpeg_error_mgr pub;	/* "public" fields */
+   jmp_buf setjmp_buffer;	/* for return to caller */
+};
+typedef struct ossimJpegErrorMgr* ossimJpegErrorPtr;
+   
+void ossimJpegErrorExit (jpeg_common_struct* cinfo)
+{
+   /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
+   ossimJpegErrorPtr myerr = (ossimJpegErrorPtr) cinfo->err;
+   
+   /* Always display the message. */
+   /* We could postpone this until after returning, if we chose. */
+   (*cinfo->err->output_message) (cinfo);
+   
+   /* Return control to the setjmp point */
+   longjmp(myerr->setjmp_buffer, 1);
+}
+
+ossimJpegCodec::ossimJpegCodec()
+:m_quality(100)
+{
+}
+
+ossimJpegCodec::~ossimJpegCodec()
+{
+}
+
+ossimString ossimJpegCodec::getCodecType()const
+{
+	return ossimString("jpeg");
+}
+
+bool ossimJpegCodec::encode( const ossimRefPtr<ossimImageData>& in,
+                             std::vector<ossim_uint8>& out )const
+{
+   bool result = false;
+   if ( in.valid() && (in->getDataObjectStatus() != OSSIM_NULL) )
+   {
+      if ( in->getScalarType() == OSSIM_UINT8 )
+      {
+         // Open a memory stream up to put the jpeg image in memory:
+         std::stringstream jpegStreamBuf;
+         
+         //---
+         // Initialize JPEG compression library:
+         // NOTE: JDIMENSION is an "unsigned int"
+         //---
+         struct jpeg_compress_struct cinfo;
+         struct jpeg_error_mgr jerr;
+         cinfo.err = jpeg_std_error( &jerr );
+         jpeg_create_compress(&cinfo);
+      
+         // Define a custom stream destination manager for jpeglib to write compressed block:
+         jpeg_cpp_stream_dest(&cinfo, jpegStreamBuf);
+      
+         /* Setting the parameters of the output file here */
+         cinfo.image_width = in->getWidth();
+         cinfo.image_height = in->getHeight();
+   
+         // Bands must be one or three for this writer.
+         const ossim_uint32 INPUT_BANDS = in->getNumberOfBands();
+         if ( (INPUT_BANDS == 1) || (INPUT_BANDS == 3) )
+         {
+            cinfo.input_components = INPUT_BANDS;
+         }
+         else
+         {
+            if ( INPUT_BANDS < 3 )
+            {
+               cinfo.input_components = 1; // Use first band.
+            }
+            else
+            {
+               cinfo.input_components = 3; // Use the first 3 bands.
+            }
+         }
+      
+         // colorspace of input image 
+         if ( cinfo.input_components == 3)
+         {
+            cinfo.in_color_space = JCS_RGB;
+         }
+         else
+         {
+            cinfo.in_color_space = JCS_GRAYSCALE;
+         }
+      
+         // Default compression parameters, we shouldn't be worried about these.
+         jpeg_set_defaults( &cinfo );
+      
+         jpeg_set_quality(&cinfo, m_quality, TRUE); //limit to baseline-JPEG values
+      
+         // Now do the compression...
+         jpeg_start_compress( &cinfo, TRUE );
+      
+         // Line buffer:
+         ossim_uint32 buf_size = cinfo.input_components*cinfo.image_width;
+         std::vector<ossim_uint8> buf(buf_size);
+      
+         // Compress the tile on line at a time:
+      
+         JSAMPROW row_pointer[1]; // Pointer to a single row.
+         row_pointer[0] = (JSAMPLE*)&buf.front();
+
+         // Get pointers to the input data:
+         std::vector<const ossim_uint8*> inBuf(cinfo.input_components);
+         for ( ossim_int32 band = 0; band < cinfo.input_components; ++band )
+         {
+            inBuf[band] = in->getUcharBuf(band);
+         }
+
+         ossim_uint32 inIdx = 0;
+         for (ossim_uint32 line=0; line< cinfo.image_height; ++line)
+         {
+            // Convert from band sequential to band interleaved by pixel.
+            ossim_uint32 outIdx = 0;
+            for ( ossim_uint32 p = 0; p < cinfo.image_width; ++p )
+            {
+               for ( ossim_int32 band = 0; band < cinfo.input_components; ++band )
+               {
+                  buf[outIdx++] = inBuf[band][inIdx];
+               }
+               ++inIdx;
+            }
+
+            // Write it...
+            jpeg_write_scanlines( &cinfo, row_pointer, 1 );
+         }
+      
+         // Similar to read file, clean up after we're done compressing.
+         jpeg_finish_compress( &cinfo );
+         jpeg_destroy_compress( &cinfo );
+
+         // Copy the memory stream to output vector.
+         out.resize(jpegStreamBuf.str().size());
+         jpegStreamBuf.seekg(0, std::ios_base::beg);
+         jpegStreamBuf.read((char*)&out.front(), jpegStreamBuf.str().size());
+
+         result = true;
+      }
+      else // Scalar type check...
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimCodecFactory::encodeJpeg ERROR:"
+            << "\nPassing non-eight bit data to eight bit encoder!" << std::endl;
+      }
+      
+   } // Matches: if ( in.valid() ... )
+   
+   return result;
+
+}
+
+bool ossimJpegCodec::decode( const std::vector<ossim_uint8>& in,
+                             ossimRefPtr<ossimImageData>& out ) const
+{
+   bool result = false;
+
+   // Check for jpeg signature:
+   if ( in.size() > 3 )
+   {
+      if ( (in[0] == 0xff) &&
+           (in[1] == 0xd8) &&
+           (in[2] == 0xff) )
+      {
+         if (in[3] == 0xe0)
+         {
+            result = decodeJpeg( in, out );
+         }
+         else if (in[3] == 0xdb)
+         {
+            result = decodeJpegToRgb( in, out );
+         }
+      }
+   }
+   
+   return result;	
+}
+
+bool ossimJpegCodec::decodeJpeg( const std::vector<ossim_uint8>& in,
+                                    ossimRefPtr<ossimImageData>& out ) const
+{
+   bool result = false;
+
+   /* This struct contains the JPEG decompression parameters and pointers
+    * to working space (which is allocated as needed by the JPEG library).
+    */
+   jpeg_decompress_struct cinfo;
+   
+   /* We use our private extension JPEG error handler.
+    * Note that this struct must live as long as the main JPEG parameter
+    * struct, to avoid dangling-pointer problems.
+    */
+   ossimJpegErrorMgr jerr;
+   
+   /* Step 1: allocate and initialize JPEG decompression object */
+   
+   /* We set up the normal JPEG error routines, then override error_exit. */
+   cinfo.err = jpeg_std_error(&jerr.pub);
+   
+   jerr.pub.error_exit = ossimJpegErrorExit;
+   
+   /* Establish the setjmp return context for my_error_exit to use. */
+   if (setjmp(jerr.setjmp_buffer) == 0)
+   {
+      result = true;
+      
+      /* Now we can initialize the JPEG decompression object. */
+      jpeg_CreateDecompress(&cinfo, JPEG_LIB_VERSION, sizeof(cinfo));
+      
+      //---
+      // Step 2: specify data source.  In this case we will uncompress from
+      // memory so we will use "ossimJpegMemorySrc" in place of " jpeg_stdio_src".
+      //---
+      ossimJpegMemorySrc ( &cinfo, &(in.front()), (size_t)(in.size()) );
+      
+      /* Step 3: read file parameters with jpeg_read_header() */
+      jpeg_read_header(&cinfo, TRUE);
+      
+      /* Step 4: set parameters for decompression */
+      
+      /* Step 5: Start decompressor */
+      jpeg_start_decompress(&cinfo);
+
+      const ossim_uint32 SAMPLES = cinfo.output_width;
+      const ossim_uint32 LINES   = cinfo.output_height;
+      const ossim_uint32 BANDS   = cinfo.output_components;
+
+#if 0       /* Please leave for debug. (drb) */
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "jpeg cinfo.output_width:  " << cinfo.output_width
+            << "\njpeg cinfo.output_height: " << cinfo.output_height
+            << "\njpeg cinfo.out_color_space: " << cinfo.out_color_space
+            << "\n";
+      }
+#endif
+
+      if ( out.valid() )
+      {
+         // This will resize tile if not correct.
+         out->setImageRectangleAndBands(
+            ossimIrect(0,0,(ossim_int32)SAMPLES-1,(ossim_int32)LINES-1), BANDS );
+      }
+      else
+      {
+         out = new ossimU8ImageData( 0, BANDS, SAMPLES, LINES );
+         out->initialize();
+      }
+      
+      // Get pointers to the cache tile buffers.
+      std::vector<ossim_uint8*> destinationBuffer(BANDS);
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         destinationBuffer[band] = out->getUcharBuf(band);
+      }
+      
+      std::vector<ossim_uint8> lineBuffer(SAMPLES * cinfo.output_components);
+      JSAMPROW jbuf[1];
+      jbuf[0] = (JSAMPROW) &(lineBuffer.front());
+      
+      while (cinfo.output_scanline < LINES)
+      {
+         // Read a line from the jpeg file.
+         jpeg_read_scanlines(&cinfo, jbuf, 1);
+         
+         //---
+         // Copy the line which if band interleaved by pixel the the band
+         // separate buffers.
+         //---
+         ossim_uint32 index = 0;
+         for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)         
+         {
+            for (ossim_uint32 band = 0; band < BANDS; ++band)
+            {
+               destinationBuffer[band][sample] = lineBuffer[index];
+               ++index;
+            }
+         }
+         
+         for (ossim_uint32 band = 0; band < BANDS; ++band)
+         {
+            destinationBuffer[band] += SAMPLES;
+         }
+      }
+
+      // Set the tile status:
+      out->validate();
+
+      // clean up...
+      
+      jpeg_finish_decompress(&cinfo);
+      
+   } // Matches: if (setjmp(jerr.setjmp_buffer) == 0)
+
+   jpeg_destroy_decompress(&cinfo);
+   
+   return result;
+}
+
+bool ossimJpegCodec::decodeJpegToRgb(const std::vector<ossim_uint8>& in,
+                                     ossimRefPtr<ossimImageData>& out ) const
+   
+{   
+   bool result = false;
+   
+   ossim_int32 jpegColorSpace = getColorSpace( in );
+
+   if ( jpegColorSpace == JCS_CMYK )
+   {
+      ossimRefPtr<ossimImageData> cmykTile = 0;
+
+      result = decodeJpeg( in, cmykTile ); // Decode to CMYK tile.
+      if ( result )
+      {
+         if ( cmykTile.valid() )
+         {
+            const ossim_uint32 INPUT_BANDS = cmykTile->getNumberOfBands();
+            if ( INPUT_BANDS == 4 )
+            {
+               const ossim_uint32 OUTPUT_BANDS = 3;
+               const ossimIrect   RECT         = cmykTile->getImageRectangle();
+               const ossim_uint32 LINES        = RECT.height();
+               const ossim_uint32 SAMPLES      = RECT.width();
+               ossim_uint32 band = 0;
+               
+               // Set or create output tile:
+               if ( out.valid() )
+               {
+                  // This will resize tile if not correct.
+                  out->setImageRectangleAndBands( RECT, OUTPUT_BANDS );
+               }
+               else
+               {
+                  out = new ossimU8ImageData( 0, OUTPUT_BANDS, SAMPLES, LINES );
+                  out->initialize();
+               }
+               
+               // Assign pointers to bands.
+               std::vector<const ossim_uint8*> inBands(INPUT_BANDS);
+               for ( band = 0; band < INPUT_BANDS; ++band )
+               {
+                  inBands[band] = cmykTile->getUcharBuf( band );
+               }
+               std::vector<ossim_uint8*> outBands(INPUT_BANDS);
+               for ( band = 0; band < OUTPUT_BANDS; ++band )
+               {
+                  outBands[band] = out->getUcharBuf( band );
+               }
+               
+               const ossim_uint8 NP   = 0;   // null pixel
+               const ossim_uint8 MAXP = 255; // max pixel
+               
+               std::vector<ossim_float32> cmyk(INPUT_BANDS, 0.0);
+               std::vector<ossim_float32> rgb(OUTPUT_BANDS, 0.0);
+               
+               for ( ossim_uint32 line = 0; line < LINES; ++line )
+               {
+                  for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)
+                  {
+                     //---
+                     // NOTE:
+                     // This current does NOT work, colors come out wrong, with
+                     // the one dataset that I have:
+                     // "2015_05_05_Whitehorse_3857.gpkg"
+                     // (drb - 03 June 2015)
+                     //---
+                     
+                     cmyk[0] = inBands[0][sample]; // C
+                     cmyk[1] = inBands[1][sample]; // M
+                     cmyk[2] = inBands[2][sample]; // Y
+                     cmyk[3] = inBands[3][sample]; // K
+
+                     //---
+                     // The red (R) color is calculated from the cyan (C) and black (K) colors.
+                     // The green color (G) is calculated from the magenta (M) and black (K) colors.
+                     // The blue color (B) is calculated from the yellow (Y) and black (K) colors.
+                     //---
+                     // rgb[0] = (255.0-cmyk[0]) * 255.0-cmyk[3];
+                     // rgb[1] = (255.0-cmyk[1]) * 255.0-cmyk[3];
+                     // rgb[2] = (255.0-cmyk[2]) * 255.0-cmyk[3];
+                     rgb[0] = (cmyk[0]) * cmyk[3]/255.0;
+                     rgb[1] = (cmyk[1]) * cmyk[3]/255.0;
+                     rgb[2] = (cmyk[2]) * cmyk[3]/255.0;
+                     
+                     outBands[0][sample] =
+                        ( (rgb[0] >= 0.0) ? ( (rgb[0] <= 255.0) ?
+                                              (ossim_uint8)rgb[0] : MAXP ) : NP );
+                     outBands[1][sample] =
+                        ( (rgb[1] >= 0.0) ? ( (rgb[1] <= 255.0) ?
+                                              (ossim_uint8)rgb[1] : MAXP ) : NP );
+                     outBands[2][sample] =
+                        ( (rgb[2] >= 0.0) ? ( (rgb[2] <= 255.0) ?
+                                              (ossim_uint8)rgb[2] : MAXP ) : NP );
+                     
+                  } // End sample loop.
+                  
+                  // Increment pointers.
+                  for (ossim_uint32 band = 0; band < OUTPUT_BANDS; ++band)
+                  {
+                     inBands[band]  += SAMPLES;
+                     outBands[band] += SAMPLES;
+                  }
+                  inBands[3] += SAMPLES; // Last band of input.
+                  
+               } // End of line loop.
+               
+               // Set the tile status:
+               out->validate();
+               
+            } // Matches sanity check: if ( INPUT_BANDS == 4 )
+
+         }  // Matches: if ( cmykTile.valid() )
+         
+      } // Matches: if ( decodeJpeg( in, cmykTile ) )
+      
+   } // Matches: if ( jpegColorSpace == JCS_CMYK )
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimJpegCodec::decodeJpegRgb: WARNING: "
+            << "Unhandled jpeg output color space!" << std::endl;
+   }
+
+   return result;
+   
+} // End: ossimJpegCodec::decodeJpegRgb( ... )
+
+ossim_int32 ossimJpegCodec::getColorSpace( const std::vector<ossim_uint8>& in ) const
+{
+   J_COLOR_SPACE result = JCS_UNKNOWN;
+
+   if ( in.size() )
+   {
+      jpeg_decompress_struct cinfo;
+      ossimJpegErrorMgr jerr;
+      cinfo.err = jpeg_std_error(&jerr.pub);
+      jerr.pub.error_exit = ossimJpegErrorExit;
+      
+      /* Establish the setjmp return context for my_error_exit to use. */
+      if (setjmp(jerr.setjmp_buffer) == 0)
+      {
+         jpeg_CreateDecompress(&cinfo, JPEG_LIB_VERSION, sizeof(cinfo));
+         ossimJpegMemorySrc ( &cinfo, &(in.front()), (size_t)(in.size()) );
+         jpeg_read_header(&cinfo, TRUE);
+         result = cinfo.out_color_space;
+         jpeg_destroy_decompress(&cinfo);
+      }
+   }
+   return result;
+}
+
+void ossimJpegCodec::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(property->getName() == ossimKeywordNames::QUALITY_KW)
+   {
+      m_quality = property->valueToString().toUInt32();
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimJpegCodec::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result;
+
+   if(name == ossimKeywordNames::QUALITY_KW)
+   {
+      result = new ossimNumericProperty(ossimKeywordNames::QUALITY_KW,
+                           ossimString::toString(m_quality),
+                           0,
+                           100);
+   }
+   else
+   {
+      result = ossimCodecBase::getProperty(name);
+   }
+   return result;
+}
+void ossimJpegCodec::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimCodecBase::getPropertyNames(propertyNames);
+   propertyNames.push_back(ossimKeywordNames::QUALITY_KW);
+}
+
+bool ossimJpegCodec::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+	const char* quality = kwl.find(prefix, ossimKeywordNames::QUALITY_KW);
+
+	if(quality)
+	{
+		m_quality = ossimString(quality).toUInt32();
+	}
+
+	return ossimCodecBase::loadState(kwl, prefix);
+}
+
+bool ossimJpegCodec::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+	kwl.add(prefix, ossimKeywordNames::QUALITY_KW, m_quality);
+
+	return ossimCodecBase::saveState(kwl, prefix);
+}
+
diff --git a/src/imaging/ossimJpegMemDest.cpp b/src/imaging/ossimJpegMemDest.cpp
new file mode 100644
index 0000000..e21c8dd
--- /dev/null
+++ b/src/imaging/ossimJpegMemDest.cpp
@@ -0,0 +1,82 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file
+//
+// Most of code and comments below are from jpeg-6b "example.c" file. See 
+// http://www4.cs.fau.de/Services/Doc/graphics/doc/jpeg/libjpeg.html
+//
+// Author:  Oscar Kramer (From example by Thomas Lane)
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/imaging/ossimJpegMemDest.h>
+#include <cstdlib> /* free, malloc, size_t */
+#include <cstdio>  /* FILE* */
+#include <csetjmp> /** for jmp_buf */
+#include <ostream>
+#include <jpeglib.h> /** for jpeg stuff */
+
+
+/* *** Custom destination manager for JPEG writer *** */
+
+typedef struct 
+{
+   struct jpeg_destination_mgr pub; /* public fields */
+   std::ostream* stream;		/* target stream */
+   JOCTET* buffer;		/* start of buffer */
+} cpp_dest_mgr;
+
+#define OUTPUT_BUF_SIZE  4096	/* choose an efficiently fwrite'able size */
+
+void init_destination (j_compress_ptr cinfo)
+{
+   cpp_dest_mgr* dest = (cpp_dest_mgr*) cinfo->dest;
+
+   /* Allocate the output buffer --- it will be released when done with image */
+   dest->buffer = (JOCTET *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * sizeof(JOCTET));
+
+   dest->pub.next_output_byte = dest->buffer;
+   dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
+}
+
+boolean empty_output_buffer (j_compress_ptr cinfo)
+{
+   cpp_dest_mgr* dest = (cpp_dest_mgr*) cinfo->dest;
+   dest->stream->write ((char*)dest->buffer, OUTPUT_BUF_SIZE);
+
+   dest->pub.next_output_byte = dest->buffer;
+   dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
+
+   return TRUE;
+}
+
+
+void term_destination (j_compress_ptr cinfo)
+{
+   cpp_dest_mgr* dest = (cpp_dest_mgr*) cinfo->dest;
+   size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
+
+   /* Write any data remaining in the buffer */
+   if (datacount > 0) 
+      dest->stream->write ((char*)dest->buffer, datacount);
+
+   dest->stream->flush();
+   free (cinfo->dest);
+}
+
+// void jpeg_cpp_stream_dest (j_compress_ptr cinfo, std::ostream& stream)
+void jpeg_cpp_stream_dest(jpeg_compress_struct* cinfo, std::ostream& stream)   
+{
+   cpp_dest_mgr* dest;
+
+   /* first time for this JPEG object? */
+   if (cinfo->dest == NULL) 
+      cinfo->dest = (struct jpeg_destination_mgr *) malloc (sizeof(cpp_dest_mgr));
+
+   dest = (cpp_dest_mgr*) cinfo->dest;
+   dest->pub.init_destination = init_destination;
+   dest->pub.empty_output_buffer = empty_output_buffer;
+   dest->pub.term_destination = term_destination;
+   dest->stream = &stream;
+}
diff --git a/src/imaging/ossimJpegMemSrc.cpp b/src/imaging/ossimJpegMemSrc.cpp
new file mode 100644
index 0000000..80ad32e
--- /dev/null
+++ b/src/imaging/ossimJpegMemSrc.cpp
@@ -0,0 +1,177 @@
+//----------------------------------------------------------------------------
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken, original code from Thomas G. Lane (memsrc.c)
+//
+// Description:
+// Code to use jpeg-6b library to read jpeg image from memory.
+//----------------------------------------------------------------------------
+// $Id$
+
+//---
+// Original code from Thomas G. Lane, header comment follows.
+//---
+
+/*
+ * memsrc.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains decompression data source routines for the case of
+ * reading JPEG data from a memory buffer that is preloaded with the entire
+ * JPEG file.  This would not seem especially useful at first sight, but
+ * a number of people have asked for it.
+ * This is really just a stripped-down version of jdatasrc.c.  Comparison
+ * of this code with jdatasrc.c may be helpful in seeing how to make
+ * custom source managers for other purposes.
+ */
+
+/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+/* #include <jinclude.h> */
+
+#include <ossim/imaging/ossimJpegMemSrc.h>
+#include <cstdio>  /* FILE* */
+#include <csetjmp> /** for jmp_buf */
+#include <jpeglib.h> /** for jpeg stuff */
+#include <jerror.h>
+
+extern "C"
+{
+
+/* Expanded data source object for memory input */
+
+struct ossimJpegSourceMgr
+{
+   struct jpeg_source_mgr pub;	/* public fields */
+   JOCTET eoi_buffer[2];	/* a place to put a dummy EOI */
+};
+typedef ossimJpegSourceMgr* ossimJpegSourceMgrPtr;
+
+
+/*
+ * Initialize source --- called by jpeg_read_header
+ * before any data is actually read.
+ */
+
+void init_source (j_decompress_ptr /* cinfo */)
+{
+  /* No work, since jpeg_memory_src set up the buffer pointer and count.
+   * Indeed, if we want to read multiple JPEG images from one buffer,
+   * this *must* not do anything to the pointer.
+   */
+}
+
+
+/*
+ * Fill the input buffer --- called whenever buffer is emptied.
+ *
+ * In this application, this routine should never be called; if it is called,
+ * the decompressor has overrun the end of the input buffer, implying we
+ * supplied an incomplete or corrupt JPEG datastream.  A simple error exit
+ * might be the most appropriate response.
+ *
+ * But what we choose to do in this code is to supply dummy EOI markers
+ * in order to force the decompressor to finish processing and supply
+ * some sort of output image, no matter how corrupted.
+ */
+boolean fill_input_buffer (j_decompress_ptr cinfo)
+{
+  ossimJpegSourceMgrPtr src = (ossimJpegSourceMgrPtr) cinfo->src;
+
+  WARNMS(cinfo, JWRN_JPEG_EOF);
+
+  /* Create a fake EOI marker */
+  src->eoi_buffer[0] = (JOCTET) 0xFF;
+  src->eoi_buffer[1] = (JOCTET) JPEG_EOI;
+  src->pub.next_input_byte = src->eoi_buffer;
+  src->pub.bytes_in_buffer = 2;
+
+  return TRUE;
+}
+
+
+/*
+ * Skip data --- used to skip over a potentially large amount of
+ * uninteresting data (such as an APPn marker).
+ *
+ * If we overrun the end of the buffer, we let fill_input_buffer deal with
+ * it.  An extremely large skip could cause some time-wasting here, but
+ * it really isn't supposed to happen ... and the decompressor will never
+ * skip more than 64K anyway.
+ */
+void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+{
+  ossimJpegSourceMgrPtr src = (ossimJpegSourceMgrPtr) cinfo->src;
+
+  if (num_bytes > 0) {
+    while (num_bytes > (long) src->pub.bytes_in_buffer) {
+      num_bytes -= (long) src->pub.bytes_in_buffer;
+      (void) fill_input_buffer(cinfo);
+      /* note we assume that fill_input_buffer will never return FALSE,
+       * so suspension need not be handled.
+       */
+    }
+    src->pub.next_input_byte += (size_t) num_bytes;
+    src->pub.bytes_in_buffer -= (size_t) num_bytes;
+  }
+}
+
+
+/*
+ * An additional method that can be provided by data source modules is the
+ * resync_to_restart method for error recovery in the presence of RST markers.
+ * For the moment, this source module just uses the default resync method
+ * provided by the JPEG library.  That method assumes that no backtracking
+ * is possible.
+ */
+
+
+/*
+ * Terminate source --- called by jpeg_finish_decompress
+ * after all data has been read.  Often a no-op.
+ *
+ * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
+ * application must deal with any cleanup that should happen even
+ * for error exit.
+ */
+void term_source (j_decompress_ptr /* cinfo */)
+{
+  /* no work necessary here */
+}
+
+
+/*
+ * Prepare for input from a memory buffer.
+ */
+void ossimJpegMemorySrc (jpeg_decompress_struct* cinfo,
+                         const ossim_uint8* buffer,
+                         std::size_t bufsize)
+{
+  ossimJpegSourceMgrPtr src;
+
+  /* The source object is made permanent so that a series of JPEG images
+   * can be read from a single buffer by calling jpeg_memory_src
+   * only before the first one.
+   * This makes it unsafe to use this manager and a different source
+   * manager serially with the same JPEG object.  Caveat programmer.
+   */
+  if (cinfo->src == NULL) {	/* first time for this JPEG object? */
+    cinfo->src = (struct jpeg_source_mgr *)
+      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+				  sizeof(ossimJpegSourceMgr));
+  }
+
+  src = (ossimJpegSourceMgrPtr) cinfo->src;
+  src->pub.init_source = init_source;
+  src->pub.fill_input_buffer = fill_input_buffer;
+  src->pub.skip_input_data = skip_input_data;
+  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
+  src->pub.term_source = term_source;
+
+  src->pub.next_input_byte = buffer;
+  src->pub.bytes_in_buffer = bufsize;
+}
+}
+
diff --git a/src/imaging/ossimJpegStdIOSrc.cpp b/src/imaging/ossimJpegStdIOSrc.cpp
new file mode 100644
index 0000000..330e534
--- /dev/null
+++ b/src/imaging/ossimJpegStdIOSrc.cpp
@@ -0,0 +1,250 @@
+/*=========================================================================
+ 
+ Program:   ORFEO Toolbox
+ Language:  C++
+ Date:      $Date$
+ Version:   $Revision$
+ 
+ 
+ Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
+ See OTBCopyright.txt for details.
+ 
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE.  See the above copyright notices for more information.
+ 
+ =========================================================================*/
+
+/*
+ * jdatasrc.c
+ *
+ * Copyright (C) 1994-1996, Thomas G. Lane.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains decompression data source routines for the case of
+ * reading JPEG data from a file (or any stdio stream).  While these routines
+ * are sufficient for most applications, some will want to use a different
+ * source manager.
+ * IMPORTANT: we assume that fread() will correctly transcribe an array of
+ * JOCTETs from 8-bit-wide elements on external storage.  If char is wider
+ * than 8 bits on your machine, you may need to do some tweaking.
+ */
+
+/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
+
+#include <ossim/imaging/ossimJpegStdIOSrc.h>
+
+#include <csetjmp>                     /** for jmp_buf */
+#include <jpeglib.h>                   /** for jpeg stuff */
+#include <jerror.h>
+
+
+#define INPUT_BUF_SIZE  4096  /* choose an efficiently fread'able size */
+
+#define JFREAD(file,buf,sizeofbuf)  \
+((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
+
+/*
+ * In ANSI C, and indeed any rational implementation, size_t is also the
+ * type returned by sizeof().  However, it seems there are some irrational
+ * implementations out there, in which sizeof() returns an int even though
+ * size_t is defined as long or unsigned long.  To ensure consistent results
+ * we always use this SIZEOF() macro in place of using sizeof() directly.
+ */
+
+#define SIZEOF(object)  ((size_t) sizeof(object))
+
+extern "C"
+{
+   
+   /* Expanded data source object for stdio input */
+   
+   typedef struct {
+      struct jpeg_source_mgr pub;  /* public fields */
+      
+      FILE * infile;    /* source stream */
+      JOCTET * buffer;    /* start of buffer */
+      boolean start_of_file;  /* have we gotten any data yet? */
+   } ossimJpegStdIOSourceMgr;
+   
+   typedef ossimJpegStdIOSourceMgr * ossimJpegStdIOSourceMgrPtr;
+   
+   
+   
+   /*
+    * Initialize source --- called by jpeg_read_header
+    * before any data is actually read.
+    */
+   
+   void ossimJpegStdIOSrc_init_source (j_decompress_ptr cinfo)
+   {
+      ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
+      
+      /* We reset the empty-input-file flag for each image,
+       * but we don't clear the input buffer.
+       * This is correct behavior for reading a series of images from one source.
+       */
+      src->start_of_file = TRUE;
+   }
+   
+   
+   /*
+    * Fill the input buffer --- called whenever buffer is emptied.
+    *
+    * In typical applications, this should read fresh data into the buffer
+    * (ignoring the current state of next_input_byte & bytes_in_buffer),
+    * reset the pointer & count to the start of the buffer, and return TRUE
+    * indicating that the buffer has been reloaded.  It is not necessary to
+    * fill the buffer entirely, only to obtain at least one more byte.
+    *
+    * There is no such thing as an EOF return.  If the end of the file has been
+    * reached, the routine has a choice of ERREXIT() or inserting fake data into
+    * the buffer.  In most cases, generating a warning message and inserting a
+    * fake EOI marker is the best course of action --- this will allow the
+    * decompressor to output however much of the image is there.  However,
+    * the resulting error message is misleading if the real problem is an empty
+    * input file, so we handle that case specially.
+    *
+    * In applications that need to be able to suspend compression due to input
+    * not being available yet, a FALSE return indicates that no more data can be
+    * obtained right now, but more may be forthcoming later.  In this situation,
+    * the decompressor will return to its caller (with an indication of the
+    * number of scanlines it has read, if any).  The application should resume
+    * decompression after it has loaded more data into the input buffer.  Note
+    * that there are substantial restrictions on the use of suspension --- see
+    * the documentation.
+    *
+    * When suspending, the decompressor will back up to a convenient restart point
+    * (typically the start of the current MCU). next_input_byte & bytes_in_buffer
+    * indicate where the restart point will be if the current call returns FALSE.
+    * Data beyond this point must be rescanned after resumption, so move it to
+    * the front of the buffer rather than discarding it.
+    */
+   
+   boolean
+   ossimJpegStdIOSrc_fill_input_buffer (j_decompress_ptr cinfo)
+   {
+      ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
+      size_t nbytes;
+      
+      nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);
+      
+      if (nbytes <= 0) {
+         if (src->start_of_file)  /* Treat empty input file as fatal error */
+            ERREXIT(cinfo, JERR_INPUT_EMPTY);
+         WARNMS(cinfo, JWRN_JPEG_EOF);
+         /* Insert a fake EOI marker */
+         src->buffer[0] = (JOCTET) 0xFF;
+         src->buffer[1] = (JOCTET) JPEG_EOI;
+         nbytes = 2;
+      }
+      
+      src->pub.next_input_byte = src->buffer;
+      src->pub.bytes_in_buffer = nbytes;
+      src->start_of_file = FALSE;
+      
+      return TRUE;
+   }
+   
+   
+   /*
+    * Skip data --- used to skip over a potentially large amount of
+    * uninteresting data (such as an APPn marker).
+    *
+    * Writers of suspendable-input applications must note that skip_input_data
+    * is not granted the right to give a suspension return.  If the skip extends
+    * beyond the data currently in the buffer, the buffer can be marked empty so
+    * that the next read will cause a fill_input_buffer call that can suspend.
+    * Arranging for additional bytes to be discarded before reloading the input
+    * buffer is the application writer's problem.
+    */
+   
+   void
+   ossimJpegStdIOSrc_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
+   {
+      ossimJpegStdIOSourceMgrPtr src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
+      
+      /* Just a dumb implementation for now.  Could use fseek() except
+       * it doesn't work on pipes.  Not clear that being smart is worth
+       * any trouble anyway --- large skips are infrequent.
+       */
+      if (num_bytes > 0) {
+         while (num_bytes > (long) src->pub.bytes_in_buffer) {
+            num_bytes -= (long) src->pub.bytes_in_buffer;
+            (void) ossimJpegStdIOSrc_fill_input_buffer(cinfo);
+            /* note we assume that fill_input_buffer will never return FALSE,
+             * so suspension need not be handled.
+             */
+         }
+         src->pub.next_input_byte += (size_t) num_bytes;
+         src->pub.bytes_in_buffer -= (size_t) num_bytes;
+      }
+   }
+   
+   
+   /*
+    * An additional method that can be provided by data source modules is the
+    * resync_to_restart method for error recovery in the presence of RST markers.
+    * For the moment, this source module just uses the default resync method
+    * provided by the JPEG library.  That method assumes that no backtracking
+    * is possible.
+    */
+   
+   
+   /*
+    * Terminate source --- called by jpeg_finish_decompress
+    * after all data has been read.  Often a no-op.
+    *
+    * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
+    * application must deal with any cleanup that should happen even
+    * for error exit.
+    */
+   
+   void
+   ossimJpegStdIOSrc_term_source (j_decompress_ptr cinfo)
+   {
+      (void)cinfo;
+      /* no work necessary here */
+   }
+   
+   
+   /*
+    * Prepare for input from a stdio stream.
+    * The caller must have already opened the stream, and is responsible
+    * for closing it after finishing decompression.
+    */
+   
+   /* void ossimJpegStdIOSrc (j_decompress_ptr cinfo, FILE * infile) */
+   void ossimJpegStdIOSrc (jpeg_decompress_struct* cinfo, FILE * infile)      
+   {
+      ossimJpegStdIOSourceMgrPtr src;
+      
+      /* The source object and input buffer are made permanent so that a series
+       * of JPEG images can be read from the same file by calling jpeg_stdio_src
+       * only before the first one.  (If we discarded the buffer at the end of
+       * one image, we'd likely lose the start of the next one.)
+       * This makes it unsafe to use this manager and a different source
+       * manager serially with the same JPEG object.  Caveat programmer.
+       */
+      if (cinfo->src == NULL) {  /* first time for this JPEG object? */
+         cinfo->src = (struct jpeg_source_mgr *)
+         (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+                                     SIZEOF(ossimJpegStdIOSourceMgr));
+         src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
+         src->buffer = (JOCTET *)
+         (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
+                                     INPUT_BUF_SIZE * SIZEOF(JOCTET));
+      }
+      
+      src = (ossimJpegStdIOSourceMgrPtr) cinfo->src;
+      src->pub.init_source = ossimJpegStdIOSrc_init_source;
+      src->pub.fill_input_buffer = ossimJpegStdIOSrc_fill_input_buffer;
+      src->pub.skip_input_data = ossimJpegStdIOSrc_skip_input_data;
+      src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
+      src->pub.term_source = ossimJpegStdIOSrc_term_source;
+      src->infile = infile;
+      src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
+      src->pub.next_input_byte = NULL; /* until buffer loaded */
+   }
+}
diff --git a/ossim/src/ossim/imaging/ossimJpegTileSource.cpp b/src/imaging/ossimJpegTileSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimJpegTileSource.cpp
rename to src/imaging/ossimJpegTileSource.cpp
diff --git a/ossim/src/ossim/imaging/ossimJpegWriter.cpp b/src/imaging/ossimJpegWriter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimJpegWriter.cpp
rename to src/imaging/ossimJpegWriter.cpp
diff --git a/src/imaging/ossimJpegYCbCrToRgbSource.cpp b/src/imaging/ossimJpegYCbCrToRgbSource.cpp
new file mode 100644
index 0000000..2ed46ca
--- /dev/null
+++ b/src/imaging/ossimJpegYCbCrToRgbSource.cpp
@@ -0,0 +1,114 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimJpegYCbCrToRgbSource.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/imaging/ossimJpegYCbCrToRgbSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimJpegYCbCrVector.h>
+#include <ossim/base/ossimRgbVector.h>
+
+RTTI_DEF1(ossimJpegYCbCrToRgbSource,
+          "ossimJpegYCbCrToRgbSource" ,
+          ossimImageSourceFilter)
+
+ossimJpegYCbCrToRgbSource::ossimJpegYCbCrToRgbSource()
+   :ossimImageSourceFilter(),
+    theBlankTile()
+{
+}
+
+ossimJpegYCbCrToRgbSource::ossimJpegYCbCrToRgbSource(ossimImageSource* inputSource)
+   : ossimImageSourceFilter(inputSource),
+     theBlankTile()
+{
+}
+
+ossimJpegYCbCrToRgbSource::~ossimJpegYCbCrToRgbSource()
+{
+}
+
+void ossimJpegYCbCrToRgbSource::initialize()
+{
+   ossimImageSourceFilter::initialize();
+}
+
+void ossimJpegYCbCrToRgbSource::allocate()
+{
+   theBlankTile = new ossimImageData(this,
+                                     OSSIM_UCHAR,
+                                     3);
+}
+
+ossimRefPtr<ossimImageData> ossimJpegYCbCrToRgbSource::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if (!theBlankTile.valid())
+   {
+      allocate(); // first time through.
+   }
+   
+   if(theBlankTile.valid())
+   {
+      theBlankTile->setOrigin(tileRect.ul());
+      theBlankTile->setWidthHeight(tileRect.width(), tileRect.height());
+   }
+   
+   if(theInputConnection)
+   {
+      ossimRefPtr<ossimImageData> imageData =
+         theInputConnection->getTile(tileRect, resLevel);
+
+      if(!imageData.valid())
+      {
+         return theBlankTile;
+      }
+      if((isSourceEnabled())&&
+         (imageData->getNumberOfBands()==3)&&
+         (imageData->getScalarType()==OSSIM_UCHAR)&&
+         (imageData->getDataObjectStatus()!=OSSIM_NULL)&&
+         (imageData->getDataObjectStatus()!=OSSIM_EMPTY))
+      {
+         ossim_uint8* bands[3];
+         
+         bands[0] = static_cast<ossim_uint8*>(imageData->getBuf(0));
+         bands[1] = static_cast<ossim_uint8*>(imageData->getBuf(1));
+         bands[2] = static_cast<ossim_uint8*>(imageData->getBuf(2));
+         
+         long height = imageData->getHeight();
+         long width  = imageData->getWidth();
+         long offset = 0;
+         for(long row = 0; row < height; ++row)
+         {
+            for(long col = 0; col < width; ++col)
+            {
+               
+               ossimJpegYCbCrVector ycbcr(bands[0][offset],
+                                          bands[1][offset],
+                                          bands[2][offset]);
+               ossimRgbVector rgb(ycbcr);
+               
+               
+               bands[0][offset] = rgb.getR();
+               bands[1][offset] = rgb.getG();
+               bands[2][offset] = rgb.getB();
+               
+               ++offset;
+            }
+         }
+         imageData->validate();
+      }
+      return imageData;
+   }
+   
+   return theBlankTile;
+}  
diff --git a/src/imaging/ossimKMeansFilter.cpp b/src/imaging/ossimKMeansFilter.cpp
new file mode 100644
index 0000000..f7e3c54
--- /dev/null
+++ b/src/imaging/ossimKMeansFilter.cpp
@@ -0,0 +1,421 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/imaging/ossimKMeansFilter.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/imaging/ossimImageStatisticsSource.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+
+RTTI_DEF1(ossimKMeansFilter, "ossimKMeansFilter", ossimImageSourceFilter);
+
+ossimKMeansFilter::ossimKMeansFilter()
+:   ossimImageSourceFilter(),
+    m_numClusters(0),
+    m_tile(0),
+    m_outputScalarType(OSSIM_SCALAR_UNKNOWN),
+    m_initialized(false),
+    m_thresholdMode(NONE)
+{
+   setDescription("K-Means pixel classification filter.");
+}
+
+ossimKMeansFilter::ossimKMeansFilter(ossimImageSource* input_source,
+                                     ossimMultiBandHistogram* histogram)
+:   ossimImageSourceFilter(input_source),
+    m_histogram (histogram),
+    m_numClusters(0),
+    m_tile(0),
+    m_outputScalarType(OSSIM_SCALAR_UNKNOWN),
+    m_initialized(false),
+    m_thresholdMode(NONE)
+{
+   setDescription("K-Means pixel classification filter.");
+}
+
+ossimKMeansFilter::~ossimKMeansFilter()
+{
+}
+
+void ossimKMeansFilter::setInputHistogram(ossimMultiBandHistogram* histo)
+{
+   m_histogram = histo;
+   m_initialized = 0;
+   m_thresholds.clear();
+}
+
+ossimRefPtr<ossimImageData> ossimKMeansFilter::getTile(const ossimIrect& tileRect,
+                                                       ossim_uint32 resLevel)
+{
+   if(!theInputConnection || (m_numClusters == 0))
+      return 0;
+
+   if (!m_initialized)
+   {
+      initialize();
+      if (!m_initialized)
+         return 0;
+   }
+   if (m_classifiers.empty() && !computeKMeans())
+      return 0;
+
+   ossimRefPtr<ossimImageData> inTile = theInputConnection->getTile(tileRect, resLevel);
+   if (!inTile || !inTile->getBuf())
+      return 0;
+
+   if(!m_tile)
+   {
+      allocate();
+      if (!m_tile)
+         return 0;
+   }
+
+   m_tile->setImageRectangle(tileRect);
+   m_tile->makeBlank();
+
+   // Quick handling special case of empty input tile:
+   if (inTile->getDataObjectStatus() == OSSIM_EMPTY)
+      return m_tile;
+
+   // Since a histogram is being used, the bin value reflects a range:
+   ossimKMeansClustering* bandClusters = 0;
+   const ossimKMeansClustering::Cluster* cluster = 0;
+   ossim_uint8* outBuf; // TODO: Only K < 256 is currently supported
+   double null_pixel = theInputConnection->getNullPixelValue();
+   double pixel;
+   ossimIpt ipt;
+   ossim_uint32 offset = 0;
+   ossim_uint32 numBands = getNumberOfInputBands();
+   for (ossim_uint32 band=0; band<numBands; ++band)
+   {
+      // Need bin size of histogram since only center values were used in clustering:
+      double delta = m_histogram->getHistogram(band)->GetBucketSize() / 2.0;
+      bandClusters = m_classifiers[band].get();
+      outBuf = (ossim_uint8*)(m_tile->getBuf(band));
+      for (ipt.y=tileRect.ul().y; ipt.y<=tileRect.lr().y; ++ipt.y)
+      {
+         for (ipt.x=tileRect.ul().x; ipt.x<=tileRect.lr().x; ++ipt.x)
+         {
+            pixel = inTile->getPix(ipt, band);
+            if (pixel != null_pixel)
+            {
+               // if thresholding, only interested in the threshold point, not the cluster:
+               if (m_thresholds.size() > band)
+               {
+                  if (pixel <= m_thresholds[band])
+                     outBuf[offset] = (ossim_uint8) m_pixelValues[0];
+                  else
+                     outBuf[offset] = (ossim_uint8) m_pixelValues[1];
+               }
+               else
+               {
+                  // Determine its group and remap it using the group's DN:
+                  for (ossim_uint32 gid=0; gid<m_numClusters; ++gid)
+                  {
+                     cluster = bandClusters->getCluster(gid);
+                     if (!cluster)
+                        continue;
+                     if ((pixel >= (cluster->min-delta)) && (pixel <= (cluster->max+delta)))
+                     {
+                        outBuf[offset] = (ossim_uint8) m_pixelValues[gid];
+                        break;
+                     }
+                  }
+               }
+            }
+            ++offset;
+         }
+      }
+   } // end loop over bands
+
+   m_tile->validate();
+   return m_tile;
+}
+
+void ossimKMeansFilter::allocate()
+{
+   if (!m_initialized)
+   {
+      initialize();
+      if (!m_initialized)
+         return;
+   }
+
+   m_tile = ossimImageDataFactory::instance()->create(this, getNumberOfInputBands(), this);
+   if(!m_tile.valid())
+      return;
+
+   ossim_uint32 numBands = getNumberOfInputBands();
+   if (m_numClusters && (m_classifiers.size() == numBands))
+   {
+      for (ossim_uint32 band=0; band<numBands; band++)
+      {
+         double min = m_classifiers[band]->getCluster(0)->min;
+         double max = m_classifiers[band]->getCluster(0)->max;
+
+         for (ossim_uint32 gid=1; gid<m_numClusters; gid++)
+         {
+            if (m_classifiers[band]->getCluster(gid)->min < min)
+               min = m_classifiers[band]->getCluster(gid)->min;
+            if (m_classifiers[band]->getCluster(gid)->max > max)
+               max = m_classifiers[band]->getCluster(gid)->max;
+         }
+         m_tile->setMinPix(min, band);
+         m_tile->setMaxPix(max, band);
+      }
+   }
+   m_tile->initialize();
+}
+
+void ossimKMeansFilter::initialize()
+{
+   // This assigns theInputConnection if one is there.
+   m_initialized = false;
+   ossimImageSourceFilter::initialize();
+   m_tile = 0;
+
+   if ( !theInputConnection )
+      return;
+
+   // If an input histogram was provided, use it. Otherwise compute one:
+   if (!m_histogram.valid())
+   {
+      ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
+      histoSource->connectMyInputTo(theInputConnection);
+      histoSource->setComputationMode(OSSIM_HISTO_MODE_FAST);
+      histoSource->setMaxNumberOfRLevels(1);
+      histoSource->execute();
+      m_histogram = histoSource->getHistogram()->getMultiBandHistogram(0);
+   }
+
+   if (!m_histogram.valid())
+   {
+      ostringstream xmsg;
+      xmsg<<"ossimKMeansFilter:"<<__LINE__<<"  Could not establish a histogram. Cannot "
+            "initialize filter";
+      throw ossimException(xmsg.str());
+   }
+
+   ossim_uint32 numBands = getNumberOfInputBands();
+   for (ossim_uint32 band=0; band<numBands; band++)
+   {
+      ossimRefPtr<ossimHistogram> h = m_histogram->getHistogram(band);
+      m_minPixelValue.push_back(h->GetRangeMin());
+      m_maxPixelValue.push_back(h->GetRangeMax());
+   }
+   m_initialized = true;
+}
+
+bool ossimKMeansFilter::computeKMeans()
+{
+   m_classifiers.clear();
+   m_thresholds.clear();
+
+   ostringstream xmsg;
+   if (m_numClusters == 0)
+   {
+      xmsg<<"ossimKMeansFilter:"<<__LINE__<<"  Number of groups has not been initialized!";
+      throw ossimException(xmsg.str());
+   }
+
+   if (!m_initialized)
+      initialize();
+
+   ossim_uint32 numBands = getNumberOfInputBands();
+   for (ossim_uint32 band=0; band<numBands; band++)
+   {
+      ossimRefPtr<ossimHistogram> band_histo = m_histogram->getHistogram(band);
+      if (!band_histo.valid())
+      {
+         xmsg<<"ossimKMeansFilter:"<<__LINE__<<"  Null band histogram returned!";
+         throw ossimException(xmsg.str());
+      }
+
+      ossimRefPtr<ossimKMeansClustering> classifier = new ossimKMeansClustering;
+      classifier->setVerbose();
+      classifier->setNumClusters(m_numClusters);
+      classifier->setSamples(band_histo->GetVals(), band_histo->GetRes());
+      classifier->setPopulations(band_histo->GetCounts(), band_histo->GetRes());
+      if (!classifier->computeKmeans())
+      {
+         cout<<"ossimKMeansFilter:"<<__LINE__<<" No K-means clustering data available."<<endl;
+         break;
+      }
+      m_classifiers.push_back(classifier);
+
+      if ((m_thresholdMode != NONE) && (classifier->getNumClusters() == 2))
+      {
+         double mean0 = classifier->getMean(0);
+         double mean1 = classifier->getMean(1);
+         double sigma0 = classifier->getSigma(0);
+         double sigma1 = classifier->getSigma(1);
+         double threshold = 0;
+         switch (m_thresholdMode)
+         {
+         case MEAN:
+            threshold = (mean0 + mean1)/2.0;
+            break;
+         case SIGMA_WEIGHTED:
+            threshold = (sigma1*mean0 + sigma0*mean1)/(sigma0 + sigma1);
+            break;
+         case VARIANCE_WEIGHTED:
+            threshold = (sigma1*sigma1*mean0 + sigma0*sigma0*mean1)/(sigma0*sigma0 + sigma1*sigma1);
+            break;
+         default:
+            break;
+         }
+         m_thresholds.push_back(threshold);
+         cout<<"ossimKMeansFilter:"<<__LINE__<<" Using threshold = "<<threshold<<endl;
+      }
+   }
+
+   return (m_classifiers.size() == numBands);
+}
+
+void ossimKMeansFilter::clear()
+{
+   m_classifiers.clear();
+   m_numClusters = 0;
+   m_initialized = false;
+}
+
+void ossimKMeansFilter::setThresholdMode(ThresholdMode mode)
+{
+   m_thresholdMode = mode;
+}
+
+void ossimKMeansFilter::setNumClusters(ossim_uint32 K)
+{
+   if (K > 255)
+   {
+      ostringstream xmsg;
+      xmsg << "ossimKMeansFilter:"<<__LINE__<<" Requested K="<<K<<" but only max 255 supported!";
+      throw ossimException(xmsg.str());
+   }
+   clear();
+
+   // Define default replacement pixel values (unless already done):
+   m_numClusters = K;
+   if (m_pixelValues.size() != m_numClusters)
+   {
+      m_pixelValues.clear();
+      for (ossim_uint32 i=1; i<=m_numClusters; ++i)
+         m_pixelValues.push_back(i);
+   }
+}
+
+void ossimKMeansFilter::setClusterPixelValues(const ossim_uint32* dns, ossim_uint32 K)
+{
+   if (dns == 0)
+      return;
+
+   if (K != m_numClusters)
+      setNumClusters(K);
+
+   m_pixelValues.clear();
+   for (ossim_uint32 i=0; i<m_numClusters; ++i)
+      m_pixelValues.push_back(dns[i]);
+}
+
+const ossimKMeansClustering* ossimKMeansFilter::getBandClassifier(ossim_uint32 band) const
+{
+   if (band < m_classifiers.size())
+      return m_classifiers[band].get();
+   return 0;
+}
+
+bool ossimKMeansFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   if (m_numClusters == 0)
+      return true;
+
+   ossim_uint32 numBands = getNumberOfInputBands();
+   kwl.add(prefix, "num_bands", numBands);
+   kwl.add(prefix, "num_clusters", m_numClusters);
+
+   ossimString key;
+   ossimString keybase1;
+   ossimString keybase2;
+   const ossimKMeansClustering* bandClusters = 0;
+   const ossimKMeansClustering::Cluster* cluster = 0;
+   for (ossim_uint32 band=0; band<numBands; band++)
+   {
+      if (numBands > 1)
+      {
+         keybase1 = "band";
+         keybase1 += ossimString::toString(band) + ".";
+      }
+
+      // Need bin size of histogram since only center values were used in clustering:
+      bandClusters = m_classifiers[band].get();
+      for (ossim_uint32 gid=0; gid < m_numClusters; ++gid)
+      {
+         keybase2 = keybase1;
+         keybase2 += "cluster";
+         keybase2 += ossimString::toString(gid);
+         cluster = bandClusters->getCluster(gid);
+         key = keybase2 + ".mean";
+         kwl.add(prefix, key.chars(), cluster->mean);
+         key = keybase2 + ".sigma";
+         kwl.add(prefix, key.chars(), cluster->sigma);
+         key = keybase2 + ".min";
+         kwl.add(prefix, key.chars(), cluster->min);
+         key = keybase2 + ".max";
+         kwl.add(prefix, key.chars(), cluster->max);
+      }
+   }
+
+   bool rtn_stat = ossimImageSourceFilter::saveState(kwl, prefix);
+   return rtn_stat;
+}
+
+bool ossimKMeansFilter::loadState(const ossimKeywordlist& orig_kwl, const char* prefix)
+{
+   bool return_state = true;
+   //ossimKeywordlist kwl (orig_kwl); // need non-const copy
+
+   // TODO: Need to implement
+
+   return_state &= ossimImageSourceFilter::loadState(orig_kwl, prefix);
+
+   return return_state;
+}
+
+ossimScalarType ossimKMeansFilter::getOutputScalarType() const
+{
+   ossimScalarType myType = OSSIM_SCALAR_UNKNOWN;
+
+   if (m_numClusters > 255)
+      myType = OSSIM_UINT16; // Can't have more than 65535 groups! NOT YET SUPPORTED
+   else if (m_numClusters > 0)
+         myType = OSSIM_UINT8;
+
+   return myType;
+}
+
+double ossimKMeansFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   if (band < m_minPixelValue.size())
+      return m_minPixelValue[band];
+   return 1;
+}
+
+double ossimKMeansFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   if (band < m_maxPixelValue.size())
+      return m_maxPixelValue[band];
+   return 255.0;
+}
+
+
diff --git a/src/imaging/ossimKakaduCompressorInterface.cpp b/src/imaging/ossimKakaduCompressorInterface.cpp
new file mode 100644
index 0000000..1f23868
--- /dev/null
+++ b/src/imaging/ossimKakaduCompressorInterface.cpp
@@ -0,0 +1,21 @@
+//---
+//
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description: Interface for Kakadu compressor.
+// 
+//---
+// $Id$
+
+#include <ossim/imaging/ossimKakaduCompressorInterface.h>
+
+//---
+// Explicit constructor.  Fix for undefine in kakadu plugin, windows vs14 debug
+// configuration.
+//---
+ossimKakaduCompressorInterface::ossimKakaduCompressorInterface()
+{
+}
+
diff --git a/ossim/src/ossim/imaging/ossimLandsatTileSource.cpp b/src/imaging/ossimLandsatTileSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimLandsatTileSource.cpp
rename to src/imaging/ossimLandsatTileSource.cpp
diff --git a/src/imaging/ossimLandsatTopoCorrectionFilter.cpp b/src/imaging/ossimLandsatTopoCorrectionFilter.cpp
new file mode 100644
index 0000000..9fe6a40
--- /dev/null
+++ b/src/imaging/ossimLandsatTopoCorrectionFilter.cpp
@@ -0,0 +1,360 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimLandsatTopoCorrectionFilter.cpp 21850 2012-10-21 20:09:55Z dburken $
+#include <ossim/imaging/ossimLandsatTopoCorrectionFilter.h>
+#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
+#include <ossim/support_data/ossimFfL7.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossim2dLinearRegression.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimVisitor.h>
+#include <iostream>
+
+RTTI_DEF1(ossimLandsatTopoCorrectionFilter, "ossimLandsatTopoCorrectionFilter",ossimTopographicCorrectionFilter);
+ossimLandsatTopoCorrectionFilter::ossimLandsatTopoCorrectionFilter()
+   :ossimTopographicCorrectionFilter(),
+    theLandsatHeader("")
+{
+}
+
+ossimLandsatTopoCorrectionFilter::~ossimLandsatTopoCorrectionFilter()
+{
+}
+
+ossimLandsatTopoCorrectionFilter::ossimLandsatTopoCorrectionFilter(ossimImageSource* colorSource,
+                                                                   ossimImageSource* elevSource,
+                                                                   const ossimFilename& landsatFileName)
+   :ossimTopographicCorrectionFilter(colorSource,
+                                     elevSource),
+    theLandsatHeader(landsatFileName)
+{
+}
+
+void ossimLandsatTopoCorrectionFilter::initialize()
+{
+   
+   ossimTopographicCorrectionFilter::initialize();
+   if(theLandsatHeader == "")
+   {
+      setLandsatHeader(findLandsatHeader());
+   }
+   else
+   {
+      setLandsatHeader(theLandsatHeader);
+   }
+}
+
+void ossimLandsatTopoCorrectionFilter::setLandsatHeader(const ossimFilename& header)
+{
+   if(header != "")
+   {
+      theLandsatHeader = header;
+      ossimRefPtr<ossimFfL7> headerL7 = new ossimFfL7(header.c_str());
+      headerL7->getGain(theGain);
+      headerL7->getBias(theBias);
+      headerL7->getSunElevation(theLightSourceElevationAngle);
+      headerL7->getSunAzimuth(theLightSourceAzimuthAngle);
+      computeLightDirection();
+      theJulianDay = headerL7->getJulianDay();
+   }
+}
+
+ossimFilename ossimLandsatTopoCorrectionFilter::findLandsatHeader()
+{
+   ossimFilename result;
+
+   if(!getInput(0))
+   {
+      return result;
+   }
+
+   ossimTypeNameVisitor visitor(ossimString("ossimImageHandler"),
+                                true,
+                                ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS);
+   getInput(0)->accept(visitor);
+   
+   // If there are multiple image handlers, e.g. a mosaic do not uses.
+   ossimRefPtr<ossimImageHandler> handler = 0;   
+   if ( visitor.getObjects().size() == 1 )
+   {
+      handler = visitor.getObjectAs<ossimImageHandler>( 0 );
+   }
+
+   if( handler.valid() )
+   {
+      ossimFilename imageFile = handler->getFilename();
+      imageFile.setExtension("fst");
+      if(imageFile.exists())
+      {
+         result = imageFile;
+      }
+      else
+      {
+         imageFile.setExtension("FST");
+         if(imageFile.exists())
+         {
+            result = imageFile;
+         }
+         else
+         {
+            ossimDirectory dir;
+
+            if(dir.open(imageFile.path()))
+            {
+               vector<ossimFilename> fileList;
+
+               dir.findAllFilesThatMatch(fileList,
+                                         ".*.fst");
+               if(fileList.size() <1)
+               {
+                  dir.findAllFilesThatMatch(fileList,
+                                            ".*.FST");
+               }
+               for(int i = 0; i < (int)fileList.size(); ++i)
+               {
+                  if(fileList[i].contains("_hpn")||
+                     fileList[i].contains("_hrf")||
+                     fileList[i].contains("_htm"))
+                  {
+                     result = fileList[i];
+                     break;
+                  }
+               }
+            }
+         }
+      }
+   }
+   return result;
+}
+
+// void ossimLandsatTopoCorrectionFilter::addRegressionPoints(std::vector<ossim2dLinearRegression>& regressionPoints,
+//                                                            ossimImageData* colorData,
+//                                                            ossimImageData* normalData)
+// {
+//    ossim_uint32 b = 0;
+   
+//    for(b = 0; b < colorData->getNumberOfBands(); ++b)
+//    {
+//       ossim_float64* normalBands[3];
+//       normalBands[0] = normalData->getBuf(0);
+//       normalBands[1] = normalData->getBuf(1);
+//       normalBands[2] = normalData->getBuf(2);
+//       ossim_float64* colorData = 
+// }
+
+#if 0
+void ossimLandsatTopoCorrectionFilter::computeC()
+{
+   theCComputedFlag = false;
+   ossim_uint32 totalNumberOfPixelsUsed = 0;
+   if(getInput(0)&&getInput(1))
+   {
+      std::vector<ossim2dLinearRegression> linearRegression(6);
+      
+      ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+      ossimImageSource* normalSource  = PTR_CAST(ossimImageSource, getInput(1));
+      ossimFfL7 headerL7(theLandsatHeader.c_str());
+
+      if(theLandsatHeader == "")
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "No landsat header found " << std::endl;
+         return;
+      }
+      if(colorSource->getNumberOfOutputBands() < 6)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "The color source needs all the vir bands from the landsat" << std::endl
+                                            << "Not enough bands to process the request" << std::endl;
+         return;
+      }
+      
+      ossimIrect normalRect = normalSource->getBoundingRect();
+      ossimIrect colorRect  = colorSource->getBoundingRect();
+      ossimIrect clipRect   = normalRect.clipToRect(colorRect);
+      ossimIpt ul = clipRect.ul();
+      ossimIpt lr = clipRect.lr();
+      long julianDay = headerL7.getJulianDay();
+      double d2 =pow( (double)(1 - 0.01674 * ossim::cosd(0.9856*(julianDay-4)) ), 2.0);
+      ossim_uint32 numberOfPixelsUsedForTile = 0;
+      for(int y = ul.y; ((y < lr.y)&&(totalNumberOfPixelsUsed<1000));++y)
+      {
+         for(int x = ul.x; ((x < lr.x)&&(totalNumberOfPixelsUsed<1000)); ++x)
+         {
+            ossimIrect reqRect(x,
+                               y,
+                               x + 127,
+                               y + 127);
+            ossimIrect reqClip = reqRect.clipToRect(clipRect);
+            ossimImageData* colorData  = colorSource->getTile(reqClip, 0);
+            ossimImageData* normalData = normalSource->getTile(reqClip, 0);
+            ossim_uint8* colorBands[6];
+            double* normalBands[3];
+            double normalBandsNp[3];
+            ossim_uint8 colorBandsNp[6];
+            colorBands[0] = (ossim_uint8*)colorData->getBuf(0);
+            colorBands[1] = (ossim_uint8*)colorData->getBuf(1);
+            colorBands[2] = (ossim_uint8*)colorData->getBuf(2);
+            colorBands[3] = (ossim_uint8*)colorData->getBuf(3);
+            colorBands[4] = (ossim_uint8*)colorData->getBuf(4);
+            colorBands[5] = (ossim_uint8*)colorData->getBuf(5);
+            colorBandsNp[0] = (ossim_uint8)colorData->getNullPix(0);
+            colorBandsNp[1] = (ossim_uint8)colorData->getNullPix(1);
+            colorBandsNp[2] = (ossim_uint8)colorData->getNullPix(2);
+            colorBandsNp[3] = (ossim_uint8)colorData->getNullPix(3);
+            colorBandsNp[4] = (ossim_uint8)colorData->getNullPix(4);
+            colorBandsNp[5] = (ossim_uint8)colorData->getNullPix(5);
+            normalBands[0] = (double*)normalData->getBuf(0);
+            normalBands[1] = (double*)normalData->getBuf(1);
+            normalBands[2] = (double*)normalData->getBuf(2);
+            normalBandsNp[0] = normalData->getNullPix(0);
+            normalBandsNp[1] = normalData->getNullPix(1);
+            normalBandsNp[2] = normalData->getNullPix(2);
+            ossim_uint32 offset = 0;
+            ossim_uint32 numberOfPixels = reqClip.width()*reqClip.height();
+            numberOfPixelsUsedForTile = 0;
+            for(offset = 0; ((offset < numberOfPixels)&&(numberOfPixelsUsedForTile < 10)); ++offset)
+            {
+               if((*colorBands[0] != colorBandsNp[0])&&
+                  (*colorBands[1] != colorBandsNp[1])&&
+                  (*colorBands[2] != colorBandsNp[2])&&
+                  (*colorBands[3] != colorBandsNp[3])&&
+                  (*colorBands[4] != colorBandsNp[4])&&
+                  (*colorBands[5] != colorBandsNp[5])&&
+                  (*normalBands[0] != normalBandsNp[0])&&
+                  (*normalBands[1] != normalBandsNp[1])&&
+                  (*normalBands[2] != normalBandsNp[2]))
+               {
+                  double ndviTest = (((double)*colorBands[3] - (double)*colorBands[2])/
+                                     ((double)*colorBands[3] + (double)*colorBands[2]));
+                  if(ndviTest > 0.0)
+                  {
+                     double radiance5 = theBias[5]+(*colorBands[5]*theGain[5]);
+//                     double p = (M_PI*radiance5*d2)/(esun[5]*cosd(90-theLightSourceAzimuthAngle));
+
+//                    if(p < .05)
+                     {
+                        double cosineI = ((*normalBands[0])*theLightDirection[0] +
+                                          (*normalBands[1])*theLightDirection[1] +
+                                          (*normalBands[2])*theLightDirection[2]);
+
+                        double radiance0 = theBias[0]+(*colorBands[0]*theGain[0]);
+                        double radiance1 = theBias[1]+(*colorBands[1]*theGain[1]);
+                        double radiance2 = theBias[2]+(*colorBands[2]*theGain[2]);
+                        double radiance3 = theBias[3]+(*colorBands[3]*theGain[3]);
+                        double radiance4 = theBias[4]+(*colorBands[4]*theGain[4]);
+                        cosineI = fabs(cosineI);
+                        if(cosineI > 1.0) cosineI = 1.0;
+                        if(cosineI < 0.0) cosineI = 0.0;
+                       cosineI = acos(cosineI);
+// //                         linearRegression[0].addPoint(ossimDpt( cosineI,(double)(*colorBands[0])));
+// //                         linearRegression[1].addPoint(ossimDpt( cosineI,(double)(*colorBands[1])));
+// //                         linearRegression[2].addPoint(ossimDpt( cosineI,(double)(*colorBands[2])));
+// //                         linearRegression[3].addPoint(ossimDpt( cosineI,(double)(*colorBands[3])));
+// //                         linearRegression[4].addPoint(ossimDpt( cosineI,(double)(*colorBands[4])));
+// //                         linearRegression[5].addPoint(ossimDpt( cosineI,(double)(*colorBands[5])));
+
+                        linearRegression[0].addPoint(ossimDpt( cosineI,radiance0));
+                        linearRegression[1].addPoint(ossimDpt( cosineI,radiance1));
+                        linearRegression[2].addPoint(ossimDpt( cosineI,radiance2));
+                        linearRegression[3].addPoint(ossimDpt( cosineI,radiance3));
+                        linearRegression[4].addPoint(ossimDpt( cosineI,radiance4));
+                        linearRegression[5].addPoint(ossimDpt( cosineI,radiance5));
+                        
+                        ++numberOfPixelsUsedForTile;
+                        ++totalNumberOfPixelsUsed;
+                     }
+                  }
+               }
+               ++colorBands[0];
+               ++colorBands[1];
+               ++colorBands[2];
+               ++colorBands[3];
+               ++colorBands[4];
+               ++colorBands[5];
+               ++normalBands[0];
+               ++normalBands[1];
+               ++normalBands[2];
+            }
+         }
+      }
+      if(totalNumberOfPixelsUsed > 2)
+      {
+         linearRegression[0].solve();
+         linearRegression[1].solve();
+         linearRegression[2].solve();
+         linearRegression[3].solve();
+         linearRegression[4].solve();
+         linearRegression[5].solve();
+         
+         ossimNotify(ossimNotifyLevel_INFO) << "linear regression results = " << endl
+                                             << linearRegression[0] << endl
+                                             << linearRegression[1] << endl
+                                             << linearRegression[2] << endl
+                                             << linearRegression[3] << endl
+                                             << linearRegression[4] << endl
+                                             << linearRegression[5] << endl;
+         double b,m;
+         linearRegression[0].getEquation(m, b);
+         theC[0] = b/m;
+         linearRegression[1].getEquation(m, b);
+         theC[1] = b/m;
+         linearRegression[2].getEquation(m, b);
+         theC[2] = b/m;
+         linearRegression[3].getEquation(m, b);
+         theC[3] = b/m;
+         linearRegression[4].getEquation(m, b);
+         theC[4] = b/m;
+         linearRegression[5].getEquation(m, b);
+         theC[5] = b/m;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_INFO) << "No points found in regression test" << endl;
+      }
+               
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "No input connected to the ossimLandsatTopoCorrectionFilter" << std::endl;
+      return;
+   }
+   
+   theCComputedFlag = true;
+}
+#endif
+
+bool ossimLandsatTopoCorrectionFilter::loadState(const ossimKeywordlist& kwl,
+                                                 const char* prefix)
+{
+   ossimTopographicCorrectionFilter::loadState(kwl, prefix);
+   const char* filename = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+
+   if(filename)
+   {
+      setLandsatHeader(filename);
+   }
+
+   return true;
+}
+
+bool ossimLandsatTopoCorrectionFilter::saveState(ossimKeywordlist& kwl,
+                                                 const char* prefix)const
+{
+   ossimTopographicCorrectionFilter::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           ossimKeywordNames::FILENAME_KW,
+           theLandsatHeader.c_str(),
+           true);
+   
+   return true;
+}
diff --git a/src/imaging/ossimLasReader.cpp b/src/imaging/ossimLasReader.cpp
new file mode 100644
index 0000000..de8e68d
--- /dev/null
+++ b/src/imaging/ossimLasReader.cpp
@@ -0,0 +1,1290 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasReader.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: OSSIM LAS LIDAR reader.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/imaging/ossimLasReader.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/support_data/ossimFgdcTxtDoc.h>
+#include <ossim/support_data/ossimLasHdr.h>
+#include <ossim/support_data/ossimLasPointRecordInterface.h>
+#include <ossim/support_data/ossimLasPointRecord0.h>
+#include <ossim/support_data/ossimLasPointRecord1.h>
+#include <ossim/support_data/ossimLasPointRecord2.h>
+#include <ossim/support_data/ossimLasPointRecord3.h>
+#include <ossim/support_data/ossimLasPointRecord4.h>
+#include <ossim/base/ossimConstants.h>
+
+#include <ossim/support_data/ossimTiffInfo.h>
+
+#include <fstream>
+#include <limits>
+#include <sstream>
+
+RTTI_DEF1(ossimLasReader, "ossimLasReader", ossimImageHandler)
+
+static ossimTrace traceDebug("ossimLasReader:debug");
+
+static const char GSD_KW[]  = "gsd";
+static const char SCAN_KW[] = "scan"; // boolean
+
+ossimLasReader::ossimLasReader()
+   : ossimImageHandler(),
+     m_str(),
+     m_hdr(0),
+     m_proj(0),
+     m_ul(),
+     m_lr(),
+     m_maxZ(0.0),
+     m_minZ(0.0),
+     m_gsd(),
+     m_tile(0),
+     m_entry(0),
+     m_mutex(),
+     m_scan(false), // ???
+     m_units(OSSIM_METERS),
+     m_unitConverter(0)   
+{
+   //---
+   // Nan out as can be set in several places, i.e. setProperty,
+   // loadState and initProjection.
+   //---
+   m_gsd.makeNan();
+}
+
+ossimLasReader::~ossimLasReader()
+{
+   close();
+}
+
+bool ossimLasReader::open()
+{
+   static const char M[] = "ossimLasReader::open";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\nfile: " << theImageFile << "\n";
+   }
+   
+   bool result = false;
+
+   close();
+
+   m_str.open(theImageFile.c_str(), std::ios_base::in | std::ios_base::binary);
+   if ( m_str.good() )
+   {
+      m_hdr = new ossimLasHdr();
+      if ( m_hdr->checkSignature( m_str ) )
+      {
+         m_str.seekg(0, std::ios_base::beg);
+         m_hdr->readStream(m_str);
+         ossim_uint32 dataFormatId = m_hdr->getPointDataFormatId();
+
+         if ( (dataFormatId == 0) || (dataFormatId == 1) || (dataFormatId == 2) ||
+              (dataFormatId == 3) || (dataFormatId == 4) )
+         {
+            result = init();
+            
+            if ( result )
+            {
+               establishDecimationFactors();
+               
+               if ( traceDebug() )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG) << *m_hdr << "\n";
+               }
+            }
+         }
+         else
+         {
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "Unhandled point type: " << int(m_hdr->getPointDataFormatId()) << "\n";
+            }
+         }
+      
+         if ( traceDebug() && result )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << *m_hdr << "\n";
+         }
+         
+      } // if ( m_hdr->checkSignature( m_str ) )
+      
+   } // if ( m_str.good() )
+
+   if ( !result ) close();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exit status = " << (result?"true\n":"false\n");
+   }
+   
+   return result;
+}
+
+void ossimLasReader::completeOpen()
+{
+   establishDecimationFactors();
+}
+
+void ossimLasReader::close()
+{
+   if ( isOpen() )
+   {
+      m_str.close();
+      delete m_hdr;
+      m_hdr = 0;
+      m_entry = 0;
+      m_tile  = 0;
+      m_proj  = 0;
+      ossimImageHandler::close();
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimLasReader::getTile(
+   const  ossimIrect& tile_rect, ossim_uint32 resLevel)
+{
+   if ( m_tile.valid() == false )
+   {
+      initTile(); // First time through.
+   }
+   
+   if ( m_tile.valid() )
+   {
+      // Image rectangle must be set prior to calling getTile.
+      m_tile->setImageRectangle(tile_rect);
+
+      if ( getTile( m_tile.get(), resLevel ) == false )
+      {
+         if (m_tile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            m_tile->makeBlank();
+         }
+      }
+   }
+
+   return m_tile;
+}
+
+bool ossimLasReader::getTile(ossimImageData* result, ossim_uint32 resLevel)
+{
+   // static const char MODULE[] = "ossimLibLasReader::getTile(ossimImageData*, level)";
+
+   bool status = false;
+
+
+   if ( m_hdr && result && (result->getScalarType() == OSSIM_FLOAT32||result->getScalarType() == OSSIM_UINT16) &&
+        (result->getDataObjectStatus() != OSSIM_NULL) &&
+        !m_ul.hasNans() && !m_gsd.hasNans() )
+   {
+      status = true;
+      
+      const ossimIrect  TILE_RECT   = result->getImageRectangle();
+      const ossim_int32 TILE_HEIGHT = static_cast<ossim_int32>(TILE_RECT.height());
+      const ossim_int32 TILE_WIDTH  = static_cast<ossim_int32>(TILE_RECT.width());
+      const ossim_int32 TILE_SIZE   = static_cast<ossim_int32>(TILE_RECT.area());
+
+      const ossim_uint16 ENTRY = m_entry;
+
+      // Get the scale for this resLevel:
+      ossimDpt scale;
+      getScale(scale, resLevel);
+      
+      // Set the starting upper left of upper left pixel for this tile.
+      const ossimDpt UL_PROG_PT( m_ul.x - scale.x / 2.0 + TILE_RECT.ul().x * scale.x,
+                                 m_ul.y + scale.y / 2.0 - TILE_RECT.ul().y * scale.y);
+      //const ossimDpt UL_PROG_PT( m_ul.x + TILE_RECT.ul().x * scale.x,
+      //                           m_ul.y + scale.y / 2.0 - TILE_RECT.ul().y * scale.y);
+
+      //---
+      // Set the lower right to the edge of the tile boundary.  This looks like an
+      // "off by one" error but it's not.  We want the ossimDrect::pointWithin to
+      // catch any points in the last line sample.
+      //---
+      const ossimDpt LR_PROG_PT( UL_PROG_PT.x + TILE_WIDTH  * scale.x,
+                                 UL_PROG_PT.y - TILE_HEIGHT * scale.y);
+      
+      const ossimDrect PROJ_RECT(UL_PROG_PT, LR_PROG_PT, OSSIM_RIGHT_HANDED);
+
+#if 0  /* Please leave for debug. (drb) */
+      cout << "m_ul: " << m_ul
+           << "\nm_gsd: " << m_gsd
+           << "\nscale:   " << scale
+           << "\nresult->getScalarType(): " << result->getScalarType()
+           << "\nresult->getDataObjectStatus(): " << result->getDataObjectStatus()
+           << "\nPROJ_RECT: " << PROJ_RECT
+           << "\nTILE_RECT: " << TILE_RECT
+           << "\nUL_PROG_PT: " << UL_PROG_PT << endl;
+#endif
+
+      const ossim_float64 SCALE_X  = m_hdr->getScaleFactorX();
+      const ossim_float64 SCALE_Y  = m_hdr->getScaleFactorY();
+      const ossim_float64 SCALE_Z  = m_hdr->getScaleFactorZ();
+      const ossim_float64 OFFSET_X = m_hdr->getOffsetX();
+      const ossim_float64 OFFSET_Y = m_hdr->getOffsetY();
+      const ossim_float64 OFFSET_Z = m_hdr->getOffsetZ();
+
+      // Create array of buckets.
+      std::vector<ossimLasReader::Bucket> bucket( TILE_SIZE );
+
+      // Loop through the point data.
+      ossimLasPointRecordInterface* lasPtRec = getNewPointRecord();
+      ossimDpt lasPt;
+
+      m_str.clear();
+      m_str.seekg(m_hdr->getOffsetToPointData());
+
+      while ( m_str.good() )
+      {
+         // m_str.read((char*)lasPtRec, 28);
+         lasPtRec->readStream( m_str );
+
+         //if ( lasPtRec->getReturnNumber() == ENTRY )
+         //{
+            lasPt.x = lasPtRec->getX() * SCALE_X + OFFSET_X;
+            lasPt.y = lasPtRec->getY() * SCALE_Y + OFFSET_Y;
+            if ( m_unitConverter )
+            {
+               convertToMeters(lasPt.x);
+               convertToMeters(lasPt.y);
+            }
+            if ( PROJ_RECT.pointWithin( lasPt ) )
+            {
+               // Compute the bucket index:
+               ossim_int32 line = static_cast<ossim_int32>((UL_PROG_PT.y - lasPt.y) / scale.y);
+               ossim_int32 samp = static_cast<ossim_int32>((lasPt.x - UL_PROG_PT.x) / scale.x );
+               ossim_int32 bucketIndex = line * TILE_WIDTH + samp;
+               
+               // Range check and add if in there.
+               if ( ( bucketIndex >= 0 ) && ( bucketIndex < TILE_SIZE ) )
+               {
+                  ossim_float64 z = lasPtRec->getZ() * SCALE_Z + OFFSET_Z;
+                  if (  m_unitConverter ) convertToMeters(z);
+                  bucket[bucketIndex].add( z ); 
+        bucket[bucketIndex].setRed(lasPtRec->getRed());
+        bucket[bucketIndex].setGreen(lasPtRec->getGreen());
+        bucket[bucketIndex].setBlue(lasPtRec->getBlue());
+        bucket[bucketIndex].setIntensity(lasPtRec->getIntensity());
+
+               }
+            }
+         //}
+         if ( m_str.eof() ) break;
+      }
+      delete lasPtRec;
+      lasPtRec = 0;
+
+      //---
+      // We must always blank out the tile as we may not have a point for every
+      // point.
+      //---
+      result->makeBlank();
+
+      //ossim_float32* buf = result->getFloatBuf(); // Tile buffer to fill.
+      if(m_entry == 1)
+      {
+        ossim_uint32 BANDS = getNumberOfOutputBands();
+        std::vector<ossim_uint16> tempBuf(TILE_SIZE * BANDS);
+   ossim_uint16* buffer = &tempBuf.front();
+   for (ossim_int32 band = 0; band < BANDS; ++band)
+   {
+     for (ossim_int32 i = 0; i < TILE_SIZE; ++i)
+     {
+       if(band == 0) buffer[i] = bucket[i].getRed();
+       if(band == 1) buffer[i] = bucket[i].getGreen();
+       if(band == 2) buffer[i] = bucket[i].getBlue();
+     }
+        }
+   result->loadTile(buffer, TILE_RECT, TILE_RECT, OSSIM_BIP);
+      }
+      else if (m_entry == 2)
+      {
+   ossim_uint16* buf = result->getUshortBuf();
+   for (ossim_int32 i = 0; i < TILE_SIZE; ++i)
+   {
+     buf[i] = bucket[i].getIntensity();
+   }
+      }
+      else
+      {
+   ossim_float32* buf = result->getFloatBuf();
+      
+        // Fill the tile.  Currently no band loop:
+        for (ossim_int32 i = 0; i < TILE_SIZE; ++i)
+        {
+           buf[i] = bucket[i].getValue();
+        }
+      }
+
+      // Revalidate.
+      result->validate();
+   }
+
+   return status;
+   
+} // End: bool ossimLibLasReader::getTile(ossimImageData* result, ossim_uint32 resLevel)
+
+ossim_uint32 ossimLasReader::getNumberOfInputBands() const
+{
+   return 1; // tmp
+}
+
+ossim_uint32 ossimLasReader::getNumberOfOutputBands() const
+{
+  if(m_entry == 1) return 3;
+  return 1;
+}
+
+ossim_uint32 ossimLasReader::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   ossim_uint32 result = 0;
+   if ( isOpen() )
+   {
+      result = static_cast<ossim_uint32>(ceil((m_ul.y - m_lr.y) / m_gsd.y));
+      if (resLevel) result = (result>>resLevel);
+   }
+   return result;
+}
+
+ossim_uint32 ossimLasReader::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   ossim_uint32 result = 0;
+   if ( isOpen() )
+   {
+      result = static_cast<ossim_uint32>(ceil((m_lr.x - m_ul.x) / m_gsd.x));
+      if (resLevel) result = (result>>resLevel);
+   }
+   return result;
+}
+
+ossim_uint32 ossimLasReader::getImageTileWidth() const
+{
+   return 0;
+}
+
+ossim_uint32 ossimLasReader::getImageTileHeight() const
+{
+   return 0;
+}
+
+ossim_uint32 ossimLasReader::getTileWidth() const
+{
+   ossimIpt ipt;
+   ossim::defaultTileSize(ipt);
+   return ipt.x;
+}
+
+ossim_uint32 ossimLasReader::getTileHeight() const
+{
+   ossimIpt ipt;
+   ossim::defaultTileSize(ipt);
+   return ipt.y; 
+}
+
+ossimScalarType ossimLasReader::getOutputScalarType() const
+{
+   //return OSSIM_FLOAT32;
+   ossimScalarType stype = OSSIM_FLOAT32;
+   if(m_entry == 1 || m_entry == 2) stype = OSSIM_UINT16;
+   return stype;
+}
+
+void ossimLasReader::getEntryList(std::vector<ossim_uint32>& entryList)const
+{
+   if ( isOpen() )
+   {
+      entryList.push_back(0);
+      entryList.push_back(1);
+      entryList.push_back(2);
+      //for ( ossim_uint32 entry = 0; entry < 15; ++entry )
+      //{
+      //   if ( m_hdr->getNumberOfPoints(entry) ) entryList.push_back(entry);
+      //}
+   }
+   else
+   {
+      entryList.clear();
+   }
+}
+
+ossim_uint32 ossimLasReader::getCurrentEntry() const
+{
+   return static_cast<ossim_uint32>(m_entry);
+}
+
+bool ossimLasReader::setCurrentEntry(ossim_uint32 entryIdx)
+{
+   bool result = false;
+   if ( isOpen() )
+   {
+      std::vector<ossim_uint32> entryList;
+      getEntryList( entryList );
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         if ( (*i) == entryIdx )
+         {
+            m_entry = entryIdx;
+            result = true;
+         }
+         ++i;
+      }
+   }
+   if(result) initTile();
+   return result;
+}
+
+ossimString ossimLasReader::getShortName() const
+{
+   return ossimString("las");
+}
+   
+ossimString ossimLasReader::getLongName()  const
+{
+   return ossimString("ossim las reader");
+}
+
+ossimRefPtr<ossimImageGeometry> ossimLasReader::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      // Check for external geom:
+      theGeometry = getExternalImageGeometry();
+      if ( theGeometry.valid() == true )
+      {
+         // Picked up an external geometry file(dot.geom).
+         m_proj = theGeometry->getProjection();
+
+         ossimRefPtr<ossimMapProjection> proj = dynamic_cast<ossimMapProjection*>( m_proj.get() );
+         if ( proj.valid() == true )
+         {
+            // Set the units:
+            if ( proj->isGeographic() )
+            {
+               m_units = OSSIM_DEGREES;
+            }
+            else
+            {
+               // Currently hard coding to meters. May need to add property to override this.
+               m_units = OSSIM_METERS;
+            }
+
+            // Call initValues to set the tie point / bounds:
+            initValues();
+
+            // Set the tie and gsd:
+            if ( proj->isGeographic() )
+            {
+               m_units = OSSIM_DEGREES;
+               ossimGpt gpt(m_ul.y, m_ul.x, 0.0, proj->getDatum() );
+               proj->setUlTiePoints( gpt );
+               theGeometry->getDegreesPerPixel( m_gsd );
+            }
+            else
+            {
+               // Currently hard coding to meters. May need to add property to override this.
+               m_units = OSSIM_METERS;
+               proj->setUlTiePoints(m_ul);
+               theGeometry->getMetersPerPixel( m_gsd );
+            }
+
+            ossimIpt imgSize;
+            imgSize.x = (ossim_int32)getNumberOfSamples(0);
+            imgSize.y = (ossim_int32)getNumberOfLines(0);
+
+            theGeometry->setImageSize( imgSize );
+         }
+      }
+
+      if ( !theGeometry )
+      {
+         theGeometry = new ossimImageGeometry();
+         if ( m_proj.valid() )
+         {
+            theGeometry->setProjection( m_proj.get() );
+         }
+         else
+         {
+            //---
+            // WARNING:
+            // Must create/set theGeometry at this point or the next call to 
+            // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
+            // as it does a recursive call back to ossimImageHandler::getImageGeometry().
+            //---         
+
+            // Try factories for projection.
+            ossimImageGeometryRegistry::instance()->extendGeometry(this);
+         }
+      }
+      
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+   }
+   
+   return theGeometry;
+}
+
+double ossimLasReader::getMinPixelValue(ossim_uint32 /* band */) const
+{
+   return m_minZ;
+}
+
+double ossimLasReader::getMaxPixelValue(ossim_uint32 /* band */) const
+{
+   return m_maxZ;
+}
+
+double ossimLasReader::getNullPixelValue(ossim_uint32 /* band */) const
+{
+   return -99999.0;
+}
+
+ossim_uint32 ossimLasReader::getNumberOfDecimationLevels() const
+{
+   // Can support any number of rlevels.
+   ossim_uint32 result = 1;
+   const ossim_uint32 STOP_DIMENSION = 16;
+   ossim_uint32 largestImageDimension = getNumberOfSamples(0) > getNumberOfLines(0) ?
+      getNumberOfSamples(0) : getNumberOfLines(0);
+   while(largestImageDimension > STOP_DIMENSION)
+   {
+      largestImageDimension /= 2;
+      ++result;
+   }
+   return result; 
+}
+
+bool ossimLasReader::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add( prefix, GSD_KW, m_gsd.toString().c_str(), true );
+   kwl.add( prefix, SCAN_KW,  ossimString::toString(m_scan).c_str(), true );
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+bool ossimLasReader::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool result = false;
+   if ( ossimImageHandler::loadState(kwl, prefix) )
+   {
+      result = open();
+      if ( result )
+      {
+         // Get our keywords:
+         const char* lookup = kwl.find(prefix, GSD_KW);
+         if ( lookup )
+         {
+            m_gsd.toPoint( ossimString(lookup) );
+         }
+         lookup = kwl.find(prefix, SCAN_KW);
+         if ( lookup )
+         {
+            ossimString s = lookup;
+            m_scan = s.toBool();
+         }
+      }
+   }
+   return result;
+}
+
+void ossimLasReader::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if ( property.valid() )
+   {
+      if ( property->getName() == GSD_KW )
+      {
+         ossimString s;
+         property->valueToString(s);
+         ossim_float64 d = s.toFloat64();
+         if ( ossim::isnan(d) == false )
+         {
+            setGsd( d );
+         }
+      }
+      else if ( property->getName() == SCAN_KW )
+      {
+         ossimString s;
+         property->valueToString(s);
+         m_scan = s.toBool();
+      }
+      else
+      {
+         ossimImageHandler::setProperty(property);
+      }
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimLasReader::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+   if ( name == GSD_KW )
+   {
+      ossimString value = ossimString::toString(m_gsd.x);
+      prop = new ossimStringProperty(name, value);
+   }
+   else if ( name == SCAN_KW )
+   {
+      prop = new ossimBooleanProperty(name, m_scan);
+   }
+   else
+   {
+      prop = ossimImageHandler::getProperty(name);
+   }
+   return prop;
+}
+
+void ossimLasReader::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back( ossimString(GSD_KW) );
+   propertyNames.push_back( ossimString(SCAN_KW) );
+   ossimImageHandler::getPropertyNames(propertyNames);
+}
+
+bool ossimLasReader::init()
+{
+   bool result = false;
+
+   if ( isOpen() )
+   {
+      // Check for external geometry file for projection stuff.
+      ossimFilename geomFile;
+      getFilenameWithThisExt( ossimString(".geom" ), geomFile );
+      if ( geomFile.exists() == true )
+      {
+         // Call get image geometry to initialize ourself.
+         ossimRefPtr<ossimImageGeometry> geom = getImageGeometry();
+         if ( geom.valid() == true )
+         {
+            // Check for map projection.
+            ossimRefPtr<ossimProjection> proj = geom->getProjection();
+            if ( proj.valid() == true )
+            {
+               if ( dynamic_cast<ossimMapProjection*>( proj.get() ) )
+               {
+                  result = true;
+               }
+            }
+         }
+      }
+
+      // There is nothing we can do if parseVarRecords fails.
+      // VAR record is optional, so guess the projection
+      // Moved to setCurrentEntry
+      //if ( result )
+      //{
+      //   initTile();
+      //}
+   }
+   
+   return result;
+}
+
+bool ossimLasReader::initProjection()
+{
+   bool result = true;
+   
+   ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>( m_proj.get() );
+   if ( proj )
+   {
+      //---
+      // Set the tie and scale:
+      // Note the scale can be set in other places so only set here if it
+      // has nans.
+      //---
+      if ( proj->isGeographic() )
+      {
+         ossimGpt gpt(m_ul.y, m_ul.x, 0.0, proj->getDatum() );
+         proj->setUlTiePoints( gpt );
+
+         if ( m_gsd.hasNans() )
+         {
+            m_gsd = proj->getDecimalDegreesPerPixel();
+            if ( m_gsd.hasNans() || !m_gsd.x || !m_gsd.y )
+            {
+               // Set to some default:
+               m_gsd.x = 0.000008983; // About 1 meter at the Equator.
+               m_gsd.y = m_gsd.x;
+               proj->setDecimalDegreesPerPixel( m_gsd );
+            }
+            
+         }
+      }
+      else
+      {
+         proj->setUlTiePoints(m_ul);
+
+         if ( m_gsd.hasNans() )
+         {
+            m_gsd = proj->getMetersPerPixel();
+            if ( m_gsd.hasNans() || !m_gsd.x || !m_gsd.y )
+            {
+               // Set to some default:
+               m_gsd.x = 1.0;
+               m_gsd.y = 1.0;
+               proj->setMetersPerPixel( m_gsd );
+            }
+         }
+      }
+   }
+   else
+   {
+      result = false;
+      m_ul.makeNan();
+      m_lr.makeNan();
+      m_gsd.makeNan();
+      
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimLasReader::initProjection WARN Could not cast to map projection!"
+         << std::endl;
+   }
+
+   return result;
+   
+} // bool ossimLasReader::initProjection()
+
+void ossimLasReader::initTile()
+{
+   ossim_uint32 BANDS = getNumberOfOutputBands();
+
+   m_tile = new ossimImageData(this,
+                               getOutputScalarType(),
+                               BANDS,
+                               getTileWidth(),
+                               getTileHeight());
+
+   for(ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      if (m_entry == 0 || m_entry == 1)
+      {
+        m_tile->setMinPix(getMinPixelValue(band),   band);
+        m_tile->setMaxPix(getMaxPixelValue(band),   band);
+        m_tile->setNullPix(getNullPixelValue(band), band);
+      }
+   }
+
+   m_tile->initialize();
+}
+
+void ossimLasReader::initUnits(const ossimKeywordlist& geomKwl)
+{
+   ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>( m_proj.get() );
+   if ( proj )
+   {
+      if ( proj->isGeographic() )
+      {
+         m_units = OSSIM_DEGREES;
+      }
+      else
+      {
+         const char* lookup = geomKwl.find("image0.linear_units");
+         if ( lookup )
+         {
+            std::string units = lookup;
+            if ( units == "meters" )
+            {
+               m_units = OSSIM_METERS;
+            }  
+            else if ( units == "feet" )
+            {
+               m_units = OSSIM_FEET;
+            }
+            else if ( units == "us_survey_feet" )
+            {
+               m_units = OSSIM_US_SURVEY_FEET;
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimLibLasReader::initUnits WARN:\n"
+                  << "Unhandled linear units code: " << units << std::endl;
+            }
+         }
+      }
+   }
+
+   // Don't make a unit converter for decimal degrees...
+   if ( (m_units != OSSIM_DEGREES) && (m_units != OSSIM_METERS) && !m_unitConverter )
+   {
+      m_unitConverter = new ossimUnitConversionTool();
+   }
+}
+
+void ossimLasReader::initValues()
+{
+   static const char M[] = "ossimLasReader::initValues";
+
+   if ( m_scan )
+   {
+      // Set to bogus values to start.
+      m_ul.x = numeric_limits<ossim_float64>::max();
+      m_ul.y = numeric_limits<ossim_float64>::min();
+      m_lr.x = numeric_limits<ossim_float64>::min();
+      m_lr.y = numeric_limits<ossim_float64>::max();
+      m_maxZ = numeric_limits<ossim_float64>::min();
+      m_minZ = numeric_limits<ossim_float64>::max();
+      
+      const ossim_float64 SCALE_X  = m_hdr->getScaleFactorX();
+      const ossim_float64 SCALE_Y  = m_hdr->getScaleFactorY();
+      const ossim_float64 SCALE_Z  = m_hdr->getScaleFactorZ();
+      const ossim_float64 OFFSET_X = m_hdr->getOffsetX();
+      const ossim_float64 OFFSET_Y = m_hdr->getOffsetY();
+      const ossim_float64 OFFSET_Z = m_hdr->getOffsetZ();
+      
+      ossimLasPointRecordInterface* lasPtRec = getNewPointRecord();
+      
+      m_str.clear();
+      m_str.seekg(m_hdr->getOffsetToPointData());
+      
+      ossim_float64 x;
+      ossim_float64 y;
+      ossim_float64 z;
+      
+      while ( m_str.good() )
+      {
+         lasPtRec->readStream( m_str );
+         
+#if 0 /* Please leave for debug. (drb) */
+         lasPtRec->print( ossimNotify(ossimNotifyLevel_DEBUG) );
+#endif
+         
+         x = lasPtRec->getX() * SCALE_X + OFFSET_X;
+         y = lasPtRec->getY() * SCALE_Y + OFFSET_Y;
+         z = lasPtRec->getZ() * SCALE_Z + OFFSET_Z;
+
+    //std::cout << "X: " << lasPtRec->getX() << " SCALE: " << SCALE_X << " OFFSET: " << OFFSET_X << " XNORM: " << x << std::endl;
+    //std::cout << "Y: " << lasPtRec->getY() << " SCALE: " << SCALE_Y << " OFFSET: " << OFFSET_Y << " YNORM: " << y << std::endl;
+    //std::cout << "Z: " << lasPtRec->getZ() << " SCALE: " << SCALE_Z << " OFFSET: " << OFFSET_Z << " ZNORM: " << z << std::endl;
+         
+         if ( x < m_ul.x ) m_ul.x = x;
+         if ( x > m_lr.x ) m_lr.x = x;
+         if ( y > m_ul.y ) m_ul.y = y;
+         if ( y < m_lr.y ) m_lr.y = y;
+         if ( z > m_maxZ ) m_maxZ = z;
+         if ( z < m_minZ ) m_minZ = z;
+         
+         if ( m_str.eof() ) break;
+      }
+      delete lasPtRec;
+      lasPtRec = 0;
+   }
+   else
+   {
+      // Set the upper left (tie).
+      m_ul.x = m_hdr->getMinX();
+      m_ul.y = m_hdr->getMaxY();
+      
+      // Set the lower right.
+      m_lr.x = m_hdr->getMaxX();
+      m_lr.y = m_hdr->getMinY();
+      
+      // Set the min/max:
+      m_minZ = m_hdr->getMinZ();
+      m_maxZ = m_hdr->getMaxZ();
+   }
+
+   if ( m_unitConverter ) // Need to convert to meters.
+   {
+      convertToMeters(m_ul.x);
+      convertToMeters(m_ul.y);
+      
+      convertToMeters(m_lr.x);
+      convertToMeters(m_lr.y);
+      
+      convertToMeters(m_maxZ);
+      convertToMeters(m_minZ);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " DEBUG:\nBounds from header:";
+      ossimDpt pt;
+      pt.x = m_hdr->getMinX();
+      pt.y = m_hdr->getMaxY();
+      if ( m_unitConverter )
+      {
+         convertToMeters(pt.x);
+         convertToMeters(pt.y);
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\nul:   " << pt;
+      pt.x = m_hdr->getMaxX();
+      pt.y = m_hdr->getMinY();
+
+      if ( m_unitConverter )
+      {
+         convertToMeters(pt.x);
+         convertToMeters(pt.y); 
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\nlr:   " << pt;
+      pt.x = m_hdr->getMinZ();
+      pt.y = m_hdr->getMaxZ();
+      if ( m_unitConverter )
+      {
+         convertToMeters(pt.x);
+         convertToMeters(pt.y); 
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nminZ: " << pt.x
+         << "\nmaxZ: " << pt.y << "\n";
+      if ( m_scan )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "Bounds from scan:"
+            << "\nul:   " << m_ul
+            << "\nlr:   " << m_lr
+            << "\nminZ: " << m_minZ
+            << "\nmaxZ: " << m_maxZ << "\n";
+      }
+   }
+}
+
+bool ossimLasReader::parseVarRecords()
+{
+   static const char M[] = "ossimLasReader::parseVarRecords";
+   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   
+   bool result = false;
+
+   if ( isOpen() )
+   {
+      std::streampos origPos = m_str.tellg();
+      std::streamoff pos = static_cast<std::streamoff>(m_hdr->getHeaderSize());
+
+      m_str.clear();
+      m_str.seekg(pos, std::ios_base::beg);
+
+      ossim_uint32 vlrCount = m_hdr->getNumberOfVlrs();
+      ossim_uint16 reserved;
+      char uid[17];
+      uid[16]='\n';
+      ossim_uint16 recordId;
+      ossim_uint16 length;
+      char des[33];
+      des[32] = '\n';
+
+      //---
+      // Things we need to save for printGeoKeys:
+      //---
+      ossim_uint16*  geoKeyBlock     = 0;
+      ossim_uint64   geoKeyLength    = 0;
+      ossim_float64* geoDoubleBlock  = 0;
+      ossim_uint64   geoDoubleLength = 0;
+      ossim_int8*    geoAsciiBlock   = 0;
+      ossim_uint64   geoAsciiLength  = 0;
+     
+      ossimEndian* endian = 0;
+      // LAS LITTLE ENDIAN:
+      if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+      {
+         endian = new ossimEndian;
+      }
+      
+      for ( ossim_uint32 i = 0; i < vlrCount; ++i )
+      {
+         m_str.read((char*)&reserved, 2);
+         m_str.read(uid, 16);
+         m_str.read((char*)&recordId, 2);
+         m_str.read((char*)&length, 2);
+         m_str.read(des, 32);
+
+         // LAS LITTLE ENDIAN:
+         if ( endian )
+         {
+            endian->swap(recordId);
+            endian->swap(length);
+         }
+ 
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "uid:      " << uid
+               << "\nrecordId: " << recordId
+               << "\nlength:   " << length
+               << "\ndes:      " << des
+               << std::endl;
+         }
+         
+         if (recordId == 34735) // GeoTiff projection keys.
+         {
+            geoKeyLength = length/2;
+            if ( geoKeyBlock )
+            {
+               delete [] geoKeyBlock;
+            }
+            geoKeyBlock = new ossim_uint16[geoKeyLength];
+            m_str.read((char*)geoKeyBlock, length);
+            if ( endian )
+            {
+               endian->swap(geoKeyBlock, geoKeyLength);
+            }
+         }
+         else if (recordId == 34736) // GeoTiff double parameters.
+         {
+            geoDoubleLength = length/8;
+            if ( geoDoubleBlock )
+            {
+               delete [] geoDoubleBlock;
+            }
+            geoDoubleBlock = new ossim_float64[geoDoubleLength];
+            m_str.read((char*)geoDoubleBlock, length);
+            if ( endian )
+            {
+               endian->swap(geoDoubleBlock, geoDoubleLength);
+            }
+         }
+         else if (recordId == 34737) // GeoTiff ascii block.
+         {
+            geoAsciiLength = length;
+            if (geoAsciiBlock)
+            {
+               delete [] geoAsciiBlock;
+            }
+            geoAsciiBlock = new ossim_int8[length];
+            m_str.read((char*)geoAsciiBlock, length);
+         }
+         else
+         {
+            m_str.seekg(length, ios_base::cur);
+         }
+      }
+
+      //---
+      // Must have at mimimum the geoKeyBlock for a projection.
+      // Note the geoDoubleBlock is needed for some.
+      // Note the geoAsciiBlock is not needed, i.e. only informational.
+      //---
+      if ( geoKeyBlock )
+      {       
+         //---
+         // Give the geokeys to ossimTiffInfo to get back a keyword list that can be fed to
+         // ossimProjectionFactoryRegistry::createProjection
+         //---
+         ossimTiffInfo info;
+         ossimKeywordlist geomKwl;
+         info.getImageGeometry(geoKeyLength, geoKeyBlock,
+                               geoDoubleLength,geoDoubleBlock,
+                               geoAsciiLength,geoAsciiBlock,
+                               geomKwl);
+         
+         // Create the projection.
+         m_proj = ossimProjectionFactoryRegistry::instance()->createProjection(geomKwl);
+         if (m_proj.valid())
+         {
+            // Units must be set before initValues and initProjection.
+            initUnits(geomKwl);
+            
+            // Must be called before initProjection.
+            initValues();
+            
+            result = initProjection();  // Sets the ties and scale...
+            
+            if (traceDebug())
+            {
+               m_proj->print(ossimNotify(ossimNotifyLevel_DEBUG));
+            }
+         }
+      }
+      else
+      {
+   /*  Current data samples appear to be UTM but not sure where to find the zone
+      const char* prefix = "image0.";
+           // Build a default projection
+           ossimKeywordlist geomKwl;
+           geomKwl.add(prefix, "datum", "WGE", true);
+           geomKwl.add(prefix, "pixel_type", "pixel_is_area",  true);
+           geomKwl.add(prefix, "type", "ossimEquDistCylProjection", true);
+           m_proj = ossimProjectionFactoryRegistry::instance()->createProjection(geomKwl);
+           if(m_proj.valid())
+           {
+             initUnits(geomKwl);
+             initValues();
+             result = initProjection(); // Sets the ties and scale...
+             if (traceDebug())
+             {
+               m_proj->print(ossimNotify(ossimNotifyLevel_DEBUG));
+             }
+           }
+   */
+      }
+
+      if ( geoKeyBlock )
+      {
+         delete [] geoKeyBlock;
+         geoKeyBlock = 0;
+      }
+      if (geoDoubleBlock)
+      {
+         delete [] geoDoubleBlock;
+         geoDoubleBlock = 0;
+      }
+      if (geoAsciiBlock)
+      {
+         delete [] geoAsciiBlock;
+         geoAsciiBlock = 0;
+      }
+
+      m_str.seekg(origPos);
+
+      if ( endian )
+      {
+         delete endian;
+         endian = 0;
+      }
+   }  
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exit status = " << (result?"true\n":"false\n");
+   }   
+   return result;
+}
+
+bool ossimLasReader::initFromExternalMetadata()
+{
+   static const char M[] = "ossimLasReader::initFromExternalMetadata";
+   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   
+   bool result = false;
+
+   ossimFilename fgdcFile = theImageFile;
+   fgdcFile.setExtension("txt");
+   if ( fgdcFile.exists() == false )
+   {
+      fgdcFile.setExtension("TXT");
+   }
+
+   if ( fgdcFile.exists() )
+   {
+      ossimRefPtr<ossimFgdcTxtDoc> fgdcDoc = new ossimFgdcTxtDoc();
+      if ( fgdcDoc->open( fgdcFile ) )
+      {
+         fgdcDoc->getProjection( m_proj );
+         if ( m_proj.valid() )
+         {
+            // Units must be set before initValues and initProjection.
+            std::string units;
+            fgdcDoc->getAltitudeDistanceUnits(units);
+            if ( ( units == "feet" ) || ( units == "international feet" ) )
+            {
+               m_units = OSSIM_FEET;
+            }
+            else if ( units == "survey feet" )
+            {
+               m_units = OSSIM_US_SURVEY_FEET;
+            }
+            else
+            {
+               m_units = OSSIM_METERS;
+            }
+            
+            // Must be called before initProjection.
+            initValues();
+            
+            result = initProjection();  // Sets the ties and scale...
+            
+            if (traceDebug())
+            {
+               m_proj->print(ossimNotify(ossimNotifyLevel_DEBUG));
+            }
+         }
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exit status = " << (result?"true\n":"false\n");
+   }   
+   return result;
+}
+
+ossimLasPointRecordInterface* ossimLasReader::getNewPointRecord() const
+{
+   ossimLasPointRecordInterface* result = 0;
+
+   switch(m_hdr->getPointDataFormatId())
+   {
+      case 0:
+      {
+         result = new ossimLasPointRecord0();
+         break;
+      }
+      case 1:
+      {
+         result = new ossimLasPointRecord1();
+         break;
+      }
+      case 2:
+      {
+         result = new ossimLasPointRecord2();
+         break;
+      }
+      case 3:
+      {
+         result = new ossimLasPointRecord3();
+         break;
+      }
+      case 4:
+      {
+         result = new ossimLasPointRecord4();
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+
+   return result;
+}
+
+void ossimLasReader::getScale(ossimDpt& scale, ossim_uint32 resLevel) const
+{
+   // std::pow(2.0, 0) returns 1.
+   ossim_float64 d = std::pow(2.0, static_cast<double>(resLevel));
+   scale.x = m_gsd.x * d;
+   scale.y = m_gsd.y * d;
+}
+
+void ossimLasReader::setGsd( const ossim_float64& gsd )
+{
+   m_gsd.x = gsd;
+   m_gsd.y = m_gsd.x;
+
+   if ( m_proj.valid() && ( m_gsd.hasNans() == false ) )
+   {
+      ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>( m_proj.get() );
+      if ( proj && ( m_gsd.hasNans() == false ) )
+      {
+         if ( proj->isGeographic() )
+         {
+            proj->setDecimalDegreesPerPixel( m_gsd );
+         }
+         else
+         {
+            proj->setMetersPerPixel( m_gsd );
+         }
+      }
+   }
+}
\ No newline at end of file
diff --git a/src/imaging/ossimLinearStretchRemapper.cpp b/src/imaging/ossimLinearStretchRemapper.cpp
new file mode 100644
index 0000000..5bba2b2
--- /dev/null
+++ b/src/imaging/ossimLinearStretchRemapper.cpp
@@ -0,0 +1,237 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+//*************************************************************************
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/imaging/ossimLinearStretchRemapper.h>
+
+RTTI_DEF1(ossimLinearStretchRemapper, "ossimLinearRemapper", ossimImageSourceFilter);
+
+static const char* MIN_VALUE_KW = "min_value";
+static const char* MAX_VALUE_KW = "max_value";
+
+ossimLinearStretchRemapper::ossimLinearStretchRemapper()
+{
+   setDescription("Remaps input from min-max to full range (0-1) of normalized float..");
+}
+
+ossimLinearStretchRemapper::~ossimLinearStretchRemapper()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimLinearStretchRemapper::getTile(const ossimIrect& tileRect,
+                                                              ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+      return 0;
+
+   ossimRefPtr<ossimImageData> tile = theInputConnection->getTile(tileRect, resLevel);
+   if ( !theEnableFlag )
+      return tile;
+
+   if (!tile || !tile->getBuf())
+      return 0;
+   if(!m_tile)
+   {
+      initialize();
+      if (!m_tile)
+         return 0;
+   }
+
+   m_tile->setImageRectangle(tileRect);
+   m_tile->makeBlank();
+
+   // Quick handling special case of empty input tile:
+   if (tile->getDataObjectStatus() == OSSIM_EMPTY)
+      return m_tile;
+
+   ossim_uint32 maxLength = tile->getWidth()*tile->getHeight();
+   double pixel;
+   double null_pixel = theInputConnection->getNullPixelValue();
+
+   ossim_uint32 numBands = theInputConnection->getNumberOfOutputBands();
+   for (int i=0; i<numBands; ++i)
+   {
+      double delta = m_maxValues[i] - m_minValues[i];
+      if (delta == 0)
+         continue;
+      double* outBuf = m_tile->getDoubleBuf(i);
+      for (ossim_uint32 offset=0; offset<maxLength; ++offset)
+      {
+         // Convert input pixel to a double index value:
+         switch(tile->getScalarType())
+         {
+         case OSSIM_DOUBLE:
+         case OSSIM_NORMALIZED_DOUBLE:
+            pixel = tile->getDoubleBuf(i)[offset];
+            break;
+         case OSSIM_SSHORT16:
+            pixel = (double)(tile->getSshortBuf(i)[offset]);
+            break;
+         case OSSIM_FLOAT:
+         case OSSIM_NORMALIZED_FLOAT:
+            pixel = (double)(tile->getFloatBuf(i)[offset]);
+            break;
+         case OSSIM_UCHAR:
+            pixel = (double)(tile->getUcharBuf(i)[offset]);
+            break;
+         case OSSIM_USHORT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+            pixel = (double)(tile->getUshortBuf(i)[offset]);
+            break;
+         default:
+            break;
+         }
+
+         // Do not remap null pixels, leave the output pixel "blank" which is null-pixel value:
+         if (pixel == null_pixel)
+            continue;
+
+         // Do linear remap:
+         pixel = (pixel-m_minValues[i])/delta;
+         if (pixel < 0.0)
+            pixel = 0.0;
+         if (pixel > 1.0)
+            pixel = 1.0;
+         outBuf[offset] = pixel;
+      }
+   }
+   m_tile->validate();
+   return m_tile;
+}
+
+void ossimLinearStretchRemapper::allocate()
+{
+   if(!theInputConnection)
+      return;
+
+   m_tile = ossimImageDataFactory::instance()->create(this,
+                                                      OSSIM_NORMALIZED_DOUBLE,
+                                                      theInputConnection->getNumberOfOutputBands(),
+                                                      theInputConnection->getTileWidth(),
+                                                      theInputConnection->getTileHeight());
+   if(m_tile.valid())
+   {
+      m_tile->initialize();
+   }
+}
+
+void ossimLinearStretchRemapper::initialize()
+{
+   // This assigns theInputConnection if one is there.
+   ossimImageSourceFilter::initialize();
+
+   m_tile = 0;
+   if ( theInputConnection )
+   {
+      // Initialize the chain on the left hand side of us.
+      //theInputConnection->initialize(); This is done by base class
+      int numBands = theInputConnection->getNumberOfOutputBands();
+      if ((m_minValues.size() != numBands) && (m_maxValues.size() != numBands))
+      {
+         m_minValues.resize(numBands);
+         m_maxValues.resize(numBands);
+         for (int i=0; i<numBands; ++i)
+         {
+            m_minValues[i] = theInputConnection->getMinPixelValue(i);
+            m_maxValues[i] = theInputConnection->getMaxPixelValue(i);
+         }
+      }
+      allocate();
+   }
+}
+
+bool ossimLinearStretchRemapper::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   bool rtn_stat = true;
+   ostringstream minstr, maxstr;
+   int numBands = m_minValues.size();
+   if ((numBands == 0) || (numBands != m_maxValues.size()))
+      rtn_stat = false;
+
+   for (int i=0; i<numBands; ++i)
+   {
+      minstr << " " << m_minValues[i];
+      maxstr << " " << m_maxValues[i];
+   }
+
+   kwl.add(prefix, MIN_VALUE_KW, minstr.str().c_str(), true);
+   kwl.add(prefix, MAX_VALUE_KW, maxstr.str().c_str(), true);
+
+   rtn_stat &= ossimImageSourceFilter::saveState(kwl, prefix);
+   return rtn_stat;
+}
+
+bool ossimLinearStretchRemapper::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool return_state = true;
+   m_minValues.clear();
+   m_maxValues.clear();
+
+   vector<ossimString> minimums;
+   vector<ossimString> maximums;
+   ossimString minVals = kwl.find(prefix, MIN_VALUE_KW);
+   ossimString maxVals = kwl.find(prefix, MAX_VALUE_KW);
+   if(!minVals.empty() && !maxVals.empty())
+   {
+      minimums = minVals.split(" ");
+      maximums = maxVals.split(" ");
+      if (minimums.size() != maximums.size())
+         return false;
+
+      for (int i=0; i<minimums.size(); ++i)
+      {
+         m_minValues[i] = minimums[i].toDouble();
+         m_maxValues[i] = maximums[i].toDouble();
+      }
+   }
+   return true;
+}
+
+double ossimLinearStretchRemapper::getMinPixelValue(ossim_uint32 band)const
+{
+   if (band< m_minValues.size())
+      return m_minValues[band];
+   return ossim::nan();
+}
+
+double ossimLinearStretchRemapper::getMaxPixelValue(ossim_uint32 band)const
+{
+   if (band< m_maxValues.size())
+      return m_maxValues[band];
+   return ossim::nan();
+}
+
+void ossimLinearStretchRemapper::setMinPixelValue(double value, ossim_uint32 band)
+{
+   if (m_minValues.size() <= band)
+      m_minValues.resize(band+1);
+   m_minValues[band] = value;
+}
+
+void ossimLinearStretchRemapper::setMaxPixelValue(double value, ossim_uint32 band)
+{
+   if (m_maxValues.size() <= band)
+      m_maxValues.resize(band+1);
+   m_maxValues[band] = value;
+}
+
+
+
diff --git a/ossim/src/ossim/imaging/ossimLocalCorrelationFusion.cpp b/src/imaging/ossimLocalCorrelationFusion.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimLocalCorrelationFusion.cpp
rename to src/imaging/ossimLocalCorrelationFusion.cpp
diff --git a/src/imaging/ossimMapCompositionSource.cpp b/src/imaging/ossimMapCompositionSource.cpp
new file mode 100644
index 0000000..4b08e56
--- /dev/null
+++ b/src/imaging/ossimMapCompositionSource.cpp
@@ -0,0 +1,3800 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimMapCompositionSource.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimMapCompositionSource.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/imaging/ossimImageDataHelper.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/imaging/ossimAnnotationFontObject.h>
+#include <ossim/imaging/ossimAnnotationLineObject.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/font/ossimFontFactoryRegistry.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimDms.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimColorProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimFontProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimTextProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <sstream>
+
+using namespace std;
+
+static const char* GRID_TYPE_ENUM_NAMES[]     = {"none", "line", "reseaux"};
+static const char* VIEW_WIDTH_KW              = "view_width";
+static const char* VIEW_HEIGHT_KW             = "view_height";
+static const char* METER_GRID_SPACING_X_KW    = "meter_grid_spacing_x";
+static const char* METER_GRID_SPACING_Y_KW    = "meter_grid_spacing_y";
+static const char* GEO_GRID_SPACING_LON_KW    = "geo_grid_spacing_lon";
+static const char* GEO_GRID_SPACING_LAT_KW    = "geo_grid_spacing_lat";
+static const char* METER_GRID_TYPE_KW         = "meter_grid_type";
+static const char* GEO_GRID_TYPE_KW           = "geo_grid_type";
+static const char* TOP_BORDER_LENGTH_KW       = "top_border_length";
+static const char* BOTTOM_BORDER_LENGTH_KW    = "bottom_border_length";
+static const char* LEFT_BORDER_LENGTH_KW      = "top_border_length";
+static const char* RIGHT_BORDER_LENGTH_KW     = "right_border_length";
+static const char* BORDER_COLOR_KW            = "border_color";
+static const char* GEO_GRID_COLOR_KW          = "geo_grid_color";
+static const char* METER_GRID_COLOR_KW        = "meter_grid_color";
+static const char* TITLE_STRING_KW            = "title_string";
+static const char* TITLE_COLOR_KW             = "title_color";
+
+static const char* TOP_GEO_LABEL_COLOR_KW     = "top_geo_label_color";
+static const char* BOTTOM_GEO_LABEL_COLOR_KW  = "bottom_geo_label_color";
+static const char* LEFT_GEO_LABEL_COLOR_KW    = "left_geo_label_color";
+static const char* RIGHT_GEO_LABEL_COLOR_KW   = "right_geo_label_color";
+
+static const char* TOP_METER_LABEL_COLOR_KW     = "top_meter_label_color";
+static const char* BOTTOM_METER_LABEL_COLOR_KW  = "bottom_meter_label_color";
+static const char* LEFT_METER_LABEL_COLOR_KW    = "left_meter_label_color";
+static const char* RIGHT_METER_LABEL_COLOR_KW   = "right_meter_label_color";
+
+static const char* TOP_GEO_LABEL_FORMAT_KW    = "top_geo_label_format";
+static const char* BOTTOM_GEO_LABEL_FORMAT_KW = "bottom_geo_label_format";
+static const char* LEFT_GEO_LABEL_FORMAT_KW   = "left_geo_label_format";
+static const char* RIGHT_GEO_LABEL_FORMAT_KW  = "right_geo_label_format";
+
+static const char* TOP_GEO_LABEL_FLAG_KW      = "top_geo_label_flag";
+static const char* BOTTOM_GEO_LABEL_FLAG_KW   = "bottom_geo_label_flag";
+static const char* LEFT_GEO_LABEL_FLAG_KW     = "left_geo_label_flag";
+static const char* RIGHT_GEO_LABEL_FLAG_KW    = "right_geo_label_flag";
+
+static const char* TOP_METER_LABEL_FLAG_KW    = "top_meter_label_flag";
+static const char* BOTTOM_METER_LABEL_FLAG_KW = "bottom_meter_label_flag";
+static const char* LEFT_METER_LABEL_FLAG_KW   = "left_meter_label_flag";
+static const char* RIGHT_METER_LABEL_FLAG_KW  = "right_meter_label_flag";
+
+static const char* TOP_GEO_LABEL_FONT_KW      = "top_geo_label_font";
+static const char* BOTTOM_GEO_LABEL_FONT_KW   = "bottom_geo_label_font";
+static const char* LEFT_GEO_LABEL_FONT_KW     = "left_geo_label_font";
+static const char* RIGHT_GEO_LABEL_FONT_KW    = "right_geo_label_font";
+static const char* TOP_METER_LABEL_FONT_KW    = "top_meter_label_font";
+static const char* BOTTOM_METER_LABEL_FONT_KW = "bottom_meter_label_font";
+static const char* LEFT_METER_LABEL_FONT_KW   = "left_meter_label_font";
+static const char* RIGHT_METER_LABEL_FONT_KW  = "right_meter_label_font";
+static const char* TITLE_FONT_KW              = "title_font";
+
+static ossimTrace traceDebug("ossimMapCompositionSource:debug");
+
+RTTI_DEF1(ossimMapCompositionSource, "ossimMapCompositionSource", ossimAnnotationSource);
+ossimMapCompositionSource::ossimMapCompositionSource()
+   :ossimAnnotationSource(),
+    theMeterGridType(OSSIM_GRID_NONE),
+    theGeographicGridType(OSSIM_GRID_LINE),
+    theTopBorderLength(200),
+    theBottomBorderLength(200),
+    theLeftBorderLength(300),
+    theRightBorderLength(300),
+    theBorderColor(255,255,255),
+    theGeographicGridColor(255,255,255),
+    theMeterGridColor(255,255,255),
+    theTitleString(""),
+    theTitleFont(NULL),
+    theTitleColor(1, 1, 1),
+    theTopGeographicLabelColor(1, 1, 1),
+    theBottomGeographicLabelColor(1, 1, 1),
+    theLeftGeographicLabelColor(1, 1, 1),
+    theRightGeographicLabelColor(1, 1, 1),
+    theTopMeterLabelColor(1, 1, 1),
+    theBottomMeterLabelColor(1, 1, 1),
+    theLeftMeterLabelColor(1, 1, 1),
+    theRightMeterLabelColor(1, 1, 1),
+    theGeographicTopLabelFont(NULL),
+    theGeographicBottomLabelFont(NULL),
+    theGeographicLeftLabelFont(NULL),
+    theGeographicRightLabelFont(NULL),
+    theMeterTopLabelFont(NULL),
+    theMeterBottomLabelFont(NULL),
+    theMeterLeftLabelFont(NULL),
+    theMeterRightLabelFont(NULL),
+    theTopGeographicFormat("dd at mm'ss\".ssssC"),
+    theBottomGeographicFormat("dd at mm'ss\".ssssC"),
+    theLeftGeographicFormat("dd at mm'ss\".ssssC"),
+    theRightGeographicFormat("dd at mm'ss\".ssssC"),
+    theTopGeographicLabelFlag(true),
+    theBottomGeographicLabelFlag(true),
+    theLeftGeographicLabelFlag(true),
+    theRightGeographicLabelFlag(true),
+    theTopGeographicTickFlag(true),
+    theBottomGeographicTickFlag(true),
+    theLeftGeographicTickFlag(true),
+    theRightGeographicTickFlag(true),
+    theTopMeterLabelFlag(false),
+    theBottomMeterLabelFlag(false),
+    theLeftMeterLabelFlag(false),
+    theRightMeterLabelFlag(false),
+    theTopMeterTickFlag(false),
+    theBottomMeterTickFlag(false),
+    theLeftMeterTickFlag(false),
+    theRightMeterTickFlag(false),
+    theGeographicSpacing(1.0, 1.0),
+    theMeterSpacing(3600*30, 3600*30)
+{
+   theViewWidthHeight = ossimIpt(-1,-1);
+   vector<ossimFontInformation> info;
+   ossimFontFactoryRegistry::instance()->getFontInformation(info);
+
+   if(info.size())
+   {
+      theGeographicTopLabelFont = ossimFontFactoryRegistry::instance()->createFont(info[0]);
+      theGeographicTopLabelFontInfo = info[0];
+      theGeographicTopLabelFontInfo.thePointSize = ossimIpt(12,12);
+
+      if(theGeographicTopLabelFont.valid())
+      {
+         theGeographicBottomLabelFont     = (ossimFont*)theGeographicTopLabelFont->dup();
+         theGeographicBottomLabelFontInfo = theGeographicTopLabelFontInfo;
+         theGeographicLeftLabelFont       = (ossimFont*)theGeographicTopLabelFont->dup();
+         theGeographicLeftLabelFontInfo   = theGeographicTopLabelFontInfo;
+         theGeographicRightLabelFont      = (ossimFont*)theGeographicTopLabelFont->dup();
+         theGeographicRightLabelFontInfo  = theGeographicTopLabelFontInfo;
+
+         theMeterTopLabelFont             = (ossimFont*)theGeographicTopLabelFont->dup();
+         theMeterTopLabelFontInfo         = theGeographicTopLabelFontInfo;
+         theMeterBottomLabelFont          = (ossimFont*)theGeographicTopLabelFont->dup();
+         theMeterBottomLabelFontInfo      = theGeographicTopLabelFontInfo;
+         theMeterLeftLabelFont            = (ossimFont*)theGeographicTopLabelFont->dup();
+         theMeterLeftLabelFontInfo        = theGeographicTopLabelFontInfo;
+         theMeterRightLabelFont           = (ossimFont*)theGeographicTopLabelFont->dup();
+         theMeterRightLabelFontInfo       = theGeographicTopLabelFontInfo;
+         
+         theTitleFont                     = (ossimFont*)theGeographicTopLabelFont->dup();
+         theTitleFontInfo                 = theGeographicTopLabelFontInfo;
+         theTitleFontInfo.thePointSize    = ossimIpt(48, 48);
+      }
+   }
+}
+
+ossimMapCompositionSource::~ossimMapCompositionSource()
+{
+   theGeographicTopLabelFont = 0;
+   theGeographicBottomLabelFont = 0;
+   theGeographicLeftLabelFont = 0;
+   theGeographicRightLabelFont = 0;
+   theMeterTopLabelFont = 0;
+   theMeterBottomLabelFont = 0;
+   theMeterLeftLabelFont = 0;
+
+   theMeterRightLabelFont = 0;
+   theTitleFont = 0;
+   deleteFixedAnnotations();
+}
+
+ossimRefPtr<ossimImageData> ossimMapCompositionSource::getTile(const ossimIrect& tileRect,
+                                                               ossim_uint32 resLevel)
+{
+   if(!theTile)
+   {
+      allocate(tileRect);
+      if(!theTile)
+      {
+         if(theInputConnection)
+         {
+            return theInputConnection->getTile(tileRect, resLevel);
+         }
+      }
+   }
+   theTile->setImageRectangle(tileRect);
+   theTile->makeBlank();
+   
+   if(theInputConnection)
+   {
+      ossimRefPtr<ossimImageData> tile = theInputConnection->getTile(tileRect,
+                                                                     resLevel);
+
+      if(tile.valid())
+      {
+         if(tile->getScalarType() != OSSIM_UCHAR)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimMapCompositionSource::getTile\n"
+               << "Error input is not uchar" << endl;
+            return tile;
+         }
+         else
+         {
+            if(tile->getBuf()&&(tile->getDataObjectStatus() != OSSIM_EMPTY))
+            {
+               int band = 0;
+               int outBands = theTile->getNumberOfBands();
+               int minBand = std::min((long)theTile->getNumberOfBands(),
+                                      (long)tile->getNumberOfBands());
+               for(band = 0; band < minBand; ++band)
+               {
+                  theTile->loadBand(tile->getBuf(band),
+                                    tile->getImageRectangle(),
+                                    band);
+               }
+               // copy last band of input tile to all output
+               // bands if the input tile did not have enough bands.
+               //
+               for(;band < outBands;++band)
+               {
+                  theTile->loadBand(tile->getBuf(minBand-1),
+                                    tile->getImageRectangle(),
+                                    band);
+               }
+            }
+	    drawBorders();
+	    drawAnnotations(theTile);
+         }
+      }
+   }
+   theTile->validate();
+   return theTile;
+}
+
+void ossimMapCompositionSource::setGeographicLabelFormat(const ossimString format)
+{
+   if( (format == theTopGeographicFormat)&&
+       (format == theBottomGeographicFormat)&&
+       (format == theLeftGeographicFormat)&&
+       (format == theRightGeographicFormat))
+   {
+      return;
+   }
+   theTopGeographicFormat    = format;
+   theBottomGeographicFormat = format;
+   theLeftGeographicFormat   = format;
+   theRightGeographicFormat  = format;
+}
+
+void ossimMapCompositionSource::setTopGeographicLabelFormat(const ossimString& format)
+{
+   if(format == theTopGeographicFormat)
+   {
+      return;
+   }
+   theTopGeographicFormat = format;
+}
+
+void ossimMapCompositionSource::setBottomGeographicLabelFormat(const ossimString& format)
+{
+   if(format == theBottomGeographicFormat)
+   {
+      return;
+   }
+   theBottomGeographicFormat = format;
+
+   // need to reset the fonts
+//   layoutAnnotations();
+}
+
+void ossimMapCompositionSource::setLeftGeographicLabelFormat(const ossimString& format)
+{
+   if(format == theLeftGeographicFormat)
+   {
+      return;
+   }
+   theLeftGeographicFormat = format;
+
+   // need to reset the fonts
+//   layoutAnnotations();
+}
+
+void ossimMapCompositionSource::setRightGeographicLabelFormat(const ossimString& format)
+{
+   if(format == theRightGeographicFormat)
+   {
+      return;
+   }
+   theRightGeographicFormat = format;
+
+}
+
+void ossimMapCompositionSource::setTitleFont(const ossimFontInformation& fontInfo)
+{
+   if(theTitleFontInfo == fontInfo)
+   {
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+   if(font)
+   {
+ 
+      theTitleFont     = font;
+      theTitleFontInfo = fontInfo;      
+   }
+}
+
+void ossimMapCompositionSource::setGeographicTopLabelFont(const ossimFontInformation& fontInfo)
+{
+   const char* MODULE = "ossimMapCompositionSource::setGeographicTopLabelFont";
+   
+   if(traceDebug())
+   {
+      CLOG << "Entering...." <<endl;
+   }
+   if(theGeographicTopLabelFontInfo == fontInfo)
+   {
+      if(traceDebug())
+      {
+         CLOG << "Font info the same exiting...." <<endl
+              << theGeographicTopLabelFontInfo << endl;
+      }
+      
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      if(traceDebug())
+      {
+         CLOG << "Previous font info " <<endl
+              << theGeographicTopLabelFont.get() << endl;
+      }
+      theGeographicTopLabelFont = font;
+      theGeographicTopLabelFontInfo = fontInfo;
+
+      if(traceDebug())
+      {
+         CLOG << "New font info " <<endl
+              << theGeographicTopLabelFont.get() << endl;
+      }      
+   }
+}
+
+void ossimMapCompositionSource::setGeographicBottomLabelFont(const ossimFontInformation& fontInfo)
+{
+   if(theGeographicBottomLabelFontInfo == fontInfo)
+   {
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      theGeographicBottomLabelFont     = font;
+      theGeographicBottomLabelFontInfo = fontInfo;
+
+   }
+}
+
+void ossimMapCompositionSource::setGeographicLeftLabelFont(const ossimFontInformation& fontInfo)
+{
+   if(theGeographicRightLabelFontInfo == fontInfo)
+   {
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      theGeographicLeftLabelFont     = font;
+      theGeographicLeftLabelFontInfo = fontInfo;
+
+   }
+}
+
+void ossimMapCompositionSource::setGeographicRightLabelFont(const ossimFontInformation& fontInfo)
+{
+   if(theGeographicRightLabelFontInfo == fontInfo)
+   {
+      return;
+   }
+   
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      theGeographicRightLabelFont = font;
+      theGeographicRightLabelFontInfo = fontInfo;
+   }
+}
+
+
+void ossimMapCompositionSource::setMeterTopLabelFont(const ossimFontInformation& fontInfo)
+{
+   if(theMeterTopLabelFontInfo == fontInfo)
+   {
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      theMeterTopLabelFont     = font;
+      theMeterTopLabelFontInfo = fontInfo;
+   }
+}
+
+void ossimMapCompositionSource::setMeterBottomLabelFont(const ossimFontInformation& fontInfo)
+{
+   if(theMeterBottomLabelFontInfo == fontInfo)
+   {
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      theMeterBottomLabelFont     = font;
+      theMeterBottomLabelFontInfo = fontInfo;
+   }
+}
+
+void ossimMapCompositionSource::setMeterLeftLabelFont(const ossimFontInformation& fontInfo)
+{
+   if(theMeterLeftLabelFontInfo == fontInfo)
+   {
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      theMeterLeftLabelFont     = font;
+      theMeterLeftLabelFontInfo = fontInfo;
+   }
+}
+
+void ossimMapCompositionSource::setMeterRightLabelFont(const ossimFontInformation& fontInfo)
+{
+   if(theMeterRightLabelFontInfo == fontInfo)
+   {
+      return;
+   }
+   ossimFont* font = ossimFontFactoryRegistry::instance()->createFont(fontInfo);
+
+   if(font)
+   {
+      theMeterRightLabelFont     = font;
+      theMeterRightLabelFontInfo = fontInfo;
+   }
+}
+
+ossimIrect ossimMapCompositionSource::getBoundingRect(ossim_uint32 resLevel)const
+{
+   ossimIrect result;
+
+   result.makeNan();
+   if(theInputConnection)
+   {
+      ossimIrect inputRect  = getViewingRect();
+
+      if(!inputRect.hasNans())
+      {
+         ossimDpt decimation;
+         getDecimationFactor(resLevel,
+                             decimation);
+         int leftBorderLength   = theLeftBorderLength;
+         int rightBorderLength  = theRightBorderLength;
+         int topBorderLength    = theTopBorderLength;
+         int bottomBorderLength = theBottomBorderLength;
+
+         ossimIpt p1(inputRect.ul().x - leftBorderLength,
+                     inputRect.ul().y - topBorderLength);
+         
+         ossimIpt p2(inputRect.ur().x + rightBorderLength,
+                     inputRect.ur().y - topBorderLength);
+         
+         ossimIpt p3(inputRect.lr().x + rightBorderLength,
+                     inputRect.lr().y + bottomBorderLength);
+         
+         ossimIpt p4(inputRect.ll().x - leftBorderLength,
+                     inputRect.ll().y + bottomBorderLength);
+
+         result = ossimIrect(p1, p2, p3, p4);
+         
+         if(!decimation.hasNans())
+         {
+            result*=decimation;
+         }
+      }
+   }
+   return result;
+}
+
+void ossimMapCompositionSource::layoutAnnotations()
+{
+   deleteFixedAnnotations();
+
+   addTitle();
+   addGridLabels();
+   if(theGeographicGridType == OSSIM_GRID_LINE)
+   {
+      addGeographicGridLines();
+   }
+   else if(theGeographicGridType == OSSIM_GRID_RESEAUX)
+   {
+      addGeographicGridReseaux();
+   }
+   
+   if(theMeterGridType == OSSIM_GRID_LINE)
+   {
+      addMeterGridLines();
+   }
+   else if(theMeterGridType == OSSIM_GRID_RESEAUX)
+   {
+      addMeterGridReseaux();
+   }
+}
+
+
+void ossimMapCompositionSource::initialize()
+{
+   ossimAnnotationSource::initialize();   
+
+   theTile = 0;
+   if(theInputConnection)
+   {
+      computeBorderRects();
+      layoutAnnotations();
+   }
+   else 
+   {
+      deleteFixedAnnotations();
+   }
+}
+
+void ossimMapCompositionSource::computeBorderRects()
+{
+   if(theInputConnection)
+   {
+      ossimIrect inputRect = getViewingRect();;
+      
+      theTopBorder = ossimIrect(inputRect.ul().x - theLeftBorderLength,
+                                inputRect.ul().y - theTopBorderLength,
+                                inputRect.ur().x + theRightBorderLength,
+                                inputRect.ur().y);
+      
+      theBottomBorder = ossimIrect(inputRect.ll().x - theLeftBorderLength,
+                                   inputRect.ll().y,
+                                   inputRect.lr().x + theRightBorderLength,
+                                   inputRect.lr().y + theBottomBorderLength);
+      
+      theLeftBorder   = ossimIrect(theTopBorder.ul().x,
+                                   theTopBorder.ll().y,
+                                   inputRect.ll().x,
+                                   inputRect.ll().y);
+      
+      theRightBorder   = ossimIrect(inputRect.ur().x,
+                                    inputRect.ur().y,
+                                    theBottomBorder.lr().x,
+                                    inputRect.lr().y);
+   }
+   else
+   {
+      theTopBorder.makeNan();
+      theBottomBorder.makeNan();
+      theLeftBorder.makeNan();
+      theRightBorder.makeNan();
+   }
+      
+}
+
+void ossimMapCompositionSource::drawBorders()
+{
+   if(theTile.valid())
+   {
+      ossimIrect top    = theTopBorder;
+      ossimIrect bottom = theBottomBorder;
+      ossimIrect left   = theLeftBorder;
+      ossimIrect right  = theRightBorder;
+
+//       if(resLevel)
+//       {
+//          ossimDpt decimation;
+//          getDecimationFactor(resLevel,
+//                              decimation);
+
+//          if(!decimation.hasNans())
+//          {
+//             top*=decimation;
+//             bottom*=decimation;
+//             left*=decimation;
+//             right*=decimation;            
+//          }
+//       }
+      ossimIrect tileRect = theTile->getImageRectangle();
+      
+      ossimImageDataHelper helper(theTile.get());
+      
+      if(top.intersects(tileRect))
+      {
+         helper.fill(theBorderColor,
+                     top.clipToRect(tileRect),false);
+      }
+      if(bottom.intersects(tileRect))
+      {
+         helper.fill(theBorderColor,
+                     bottom.clipToRect(tileRect),false);
+      }
+      if(left.intersects(tileRect))
+      {
+         helper.fill(theBorderColor,
+                     left.clipToRect(tileRect),false);
+      }
+      if(right.intersects(tileRect))
+      {
+         helper.fill(theBorderColor,
+                     right.clipToRect(tileRect),false);
+      }
+   }
+}
+
+void ossimMapCompositionSource::addGridLabels()
+{
+   addGeographicTopGridLabels();
+   addGeographicBottomGridLabels();
+   addGeographicLeftGridLabels();
+   addGeographicRightGridLabels();
+
+   addMeterGridLabels();
+}
+
+void ossimMapCompositionSource::addGeographicTopGridLabels()
+{
+   const char* MODULE = "ossimMapCompositionSource::addGeographicTopGridLabels";
+   if(traceDebug())
+   {
+      CLOG << "Entering...." << endl;
+   }
+   if((!theTopGeographicLabelFlag)&&(!theTopGeographicTickFlag))
+   {
+      if(traceDebug())
+      {
+         CLOG << "Exiting, flags are false...." << endl;
+      }
+      return;
+   }
+   
+   if(theInputConnection)
+   { 
+      const ossimMapProjection* mapProj = inputMapProjection();
+      ossimGpt gpt[4];
+      ossimDrect rect = getViewingRect();
+
+      if(rect.hasNans()) return;
+      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
+      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
+      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
+      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
+      
+      ossimDrect grect(gpt[0], gpt[1], gpt[2], gpt[3], OSSIM_RIGHT_HANDED);
+
+      if(grect.hasNans()) return;
+      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+      
+      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+
+      while(ulLatLon.lat > 90)
+      {
+         ulLatLon.lat -= theGeographicSpacing.lat;
+      }
+      while(ulLatLon.lon < -180)
+      {
+         ulLatLon.lon += theGeographicSpacing.lon;
+      }
+      while(lrLatLon.lat < -90)
+      {
+         ulLatLon.lat += theGeographicSpacing.lat;
+      }
+      while(lrLatLon.lon > 180)
+      {
+         ulLatLon.lon -= theGeographicSpacing.lon;
+      }
+      
+      ossimDrect latLonSpacing(ulLatLon,
+                               lrLatLon,
+                               OSSIM_RIGHT_HANDED);
+
+      if(traceDebug())
+      {
+         CLOG << "labeling bounding geo rect = " << latLonSpacing << endl;
+      }
+      // do the top side labels.
+      for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
+      {
+         ossimDpt tipt; // top
+         ossimDpt bipt; // bottom
+         
+         ossimGpt tgpt(latLonSpacing.ul().y,
+                       lon,
+                       0.0,
+                       gpt[0].datum());
+
+         ossimGpt bgpt(latLonSpacing.lr().y,
+                       lon,
+                       0.0,
+                       gpt[0].datum());
+         
+         mapProj->worldToLineSample(tgpt, tipt);
+         mapProj->worldToLineSample(bgpt, bipt);
+
+         
+         if((!tipt.hasNans()&& !bipt.hasNans()) && rect.clip(tipt, bipt))
+         {
+            ossimIpt rounded(tipt);
+            if( (rounded.x >= rect.ul().x)&&
+                (rounded.x <= rect.lr().x))
+            {
+               if(theTopGeographicLabelFlag)
+               {
+                  ossimDms dms(tgpt.lond(), false);
+               
+                  ossimString dmsString = dms.toString(theTopGeographicFormat.c_str());
+                  ossimAnnotationFontObject* lonLabel = 
+                     new ossimAnnotationFontObject(ossimIpt(0,0), dmsString);
+                  lonLabel->setFont(theGeographicTopLabelFont.get());
+                  lonLabel->setGeometryInformation(theGeographicTopLabelFontInfo);
+                  lonLabel->computeBoundingRect();
+                  ossimDrect boundsD;
+                  lonLabel->getBoundingRect(boundsD);
+                  
+                  ossimIpt center( rounded.x, ossim::round<int>(rect.ul().y-(boundsD.height()/2)));
+               
+                  lonLabel->setColor(theTopGeographicLabelColor.getR(), theTopGeographicLabelColor.getG(), theTopGeographicLabelColor.getB());
+                  lonLabel->setCenterPosition(center);
+                  lonLabel->computeBoundingRect();
+
+                  ossimDrect labelRect;
+                  lonLabel->getBoundingRect(labelRect);
+                  
+                  if(rect.intersects(labelRect))
+                  {
+                     ossimIrect intersection = rect.clipToRect(labelRect);
+                     center.y -= ossim::round<int>(rect.ul().y - intersection.lr().y);
+                  }
+
+                  center.y -= 24; // this will need to be the tick height later;
+                  lonLabel->setCenterPosition(center);
+                  lonLabel->computeBoundingRect();
+                  
+                  addFixedAnnotation(lonLabel);
+               }
+               if(theTopGeographicTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject
+                     (ossimIpt(rounded.x,ossim::round<int>(rect.ul().y-24)),
+                      ossimIpt(rounded.x, ossim::round<int>(rect.ul().y)));
+                  lineLabel->setColor(theTopGeographicLabelColor.getR(), theTopGeographicLabelColor.getG(), theTopGeographicLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+            }
+         }
+      }
+   }
+   if(traceDebug())
+   {
+      CLOG << "Exiting...." << endl;
+   }
+}
+
+void ossimMapCompositionSource::addGeographicBottomGridLabels()
+{
+   if((!theBottomGeographicLabelFlag)&&(!theBottomGeographicTickFlag))
+   {
+      return;
+   }
+
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   { 
+      ossimGpt gpt[4];
+      ossimDrect rect = getViewingRect();
+
+      if(rect.hasNans()) return;
+      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
+      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
+      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
+      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
+      
+      ossimDrect grect(gpt[0], gpt[1], gpt[2], gpt[3], OSSIM_RIGHT_HANDED);
+
+      if(grect.hasNans()) return;
+      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+      
+      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+
+      while(ulLatLon.lat > 90)
+      {
+         ulLatLon.lat -= theGeographicSpacing.lat;
+      }
+      while(ulLatLon.lon < -180)
+      {
+         ulLatLon.lon += theGeographicSpacing.lon;
+      }
+      while(lrLatLon.lat < -90)
+      {
+         ulLatLon.lat += theGeographicSpacing.lat;
+      }
+      while(lrLatLon.lon > 180)
+      {
+         ulLatLon.lon -= theGeographicSpacing.lon;
+      }
+      
+      ossimDrect latLonSpacing(ulLatLon,
+                               lrLatLon,
+                               OSSIM_RIGHT_HANDED);
+
+      // do the top side labels.
+      for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
+      {
+         ossimDpt tipt; // top
+         ossimDpt bipt; // bottom
+         
+         ossimGpt tgpt(latLonSpacing.ul().y,
+                       lon,
+                       0.0,
+                       gpt[0].datum());
+
+         ossimGpt bgpt(latLonSpacing.lr().y,
+                       lon,
+                       0.0,
+                       gpt[0].datum());
+         
+         mapProj->worldToLineSample(tgpt, tipt);
+         mapProj->worldToLineSample(bgpt, bipt);
+
+         if(rect.clip(tipt, bipt))
+         {
+            ossimIpt rounded(bipt);
+            if( (rounded.x >= rect.ul().x)&&
+                (rounded.x <= rect.lr().x))
+            {
+               if(theBottomGeographicLabelFlag)
+               {
+                  ossimDms dms(bgpt.lond(), false);
+                  
+                  ossimString dmsString = dms.toString(theBottomGeographicFormat.c_str());
+                  ossimAnnotationFontObject* lonLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                                      dmsString);
+                  lonLabel->setGeometryInformation(theGeographicBottomLabelFontInfo);
+                  lonLabel->setFont(theGeographicBottomLabelFont.get());
+//                  lonLabel->setFont(theGeographicBottomLabelFont->dup());
+                  
+                  lonLabel->computeBoundingRect();
+                  ossimDrect boundsD;
+                  lonLabel->getBoundingRect(boundsD);
+                  ossimIrect bounds = boundsD;
+                  
+                  ossimIpt center( rounded.x,
+                                   ossim::round<int>(rect.lr().y+(bounds.height()/2)));
+                  
+                  lonLabel->setColor(theBottomGeographicLabelColor.getR(), theBottomGeographicLabelColor.getG(), theBottomGeographicLabelColor.getB());
+                  lonLabel->setCenterPosition(center);
+                  lonLabel->computeBoundingRect();
+                  lonLabel->getBoundingRect(boundsD);
+                  bounds = boundsD;
+
+                  ossimDrect labelRect;
+                  lonLabel->getBoundingRect(labelRect);
+                  
+                  if(rect.intersects(labelRect))
+                  {
+                     ossimIrect intersection = rect.clipToRect(labelRect);
+                     center.y += ossim::round<int>(rect.lr().y - intersection.ul().y);
+                  }
+
+                  center.y += 24; // this will need to be the tick height later;
+                  lonLabel->setCenterPosition(center);
+                  lonLabel->computeBoundingRect();
+
+
+                  addFixedAnnotation(lonLabel);
+               }
+               if(theBottomGeographicTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(rounded.x,
+                                                                                                ossim::round<int>(rect.lr().y+24)),
+                                                                                       ossimIpt(rounded.x,
+                                                                                                ossim::round<int>(rect.lr().y)));
+                  lineLabel->setColor(theBottomGeographicLabelColor.getR(), theBottomGeographicLabelColor.getG(), theBottomGeographicLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+            }         
+         }
+      }
+   }   
+}
+
+void ossimMapCompositionSource::addGeographicLeftGridLabels()
+{
+   if((!theLeftGeographicLabelFlag)&&(!theLeftGeographicTickFlag))
+   {
+      return;
+   }
+   
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   { 
+      ossimGpt gpt[4];
+      ossimDrect rect = getViewingRect();
+
+      if(rect.hasNans()) return;
+      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
+      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
+      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
+      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
+      
+      ossimDrect grect(gpt[0],
+                       gpt[1],
+                       gpt[2],
+                       gpt[3],
+                       OSSIM_RIGHT_HANDED);
+
+      if(grect.hasNans()) return;
+      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+      
+      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+
+      while(ulLatLon.lat > 90)
+      {
+         ulLatLon.lat -= theGeographicSpacing.lat;
+      }
+      while(ulLatLon.lon < -180)
+      {
+         ulLatLon.lon += theGeographicSpacing.lon;
+      }
+      while(lrLatLon.lat < -90)
+      {
+         ulLatLon.lat += theGeographicSpacing.lat;
+      }
+      while(lrLatLon.lon > 180)
+      {
+         ulLatLon.lon -= theGeographicSpacing.lon;
+      }
+      
+      ossimDrect latLonSpacing(ulLatLon,
+                               lrLatLon,
+                               OSSIM_RIGHT_HANDED);
+      // do the left side labels
+      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
+      {
+         ossimDpt lipt;
+         ossimDpt ript;
+         ossimGpt lgpt(lat,
+                       latLonSpacing.ul().x,
+                       0.0,
+                       gpt[0].datum());
+         ossimGpt rgpt(lat,
+                       latLonSpacing.ur().x,
+                       0.0,
+                       gpt[0].datum());
+
+         
+         mapProj->worldToLineSample(lgpt, lipt);
+         mapProj->worldToLineSample(rgpt, ript);
+         if(rect.clip(lipt, ript))
+         {
+            ossimIpt rounded(lipt);
+            if( (rounded.y >= rect.ul().y)&&
+                (rounded.y <= rect.lr().y))
+            {
+               if(theLeftGeographicLabelFlag)
+               {
+                  ossimDms dms(lgpt.latd());
+                  
+                  ossimString dmsString = dms.toString(theLeftGeographicFormat.c_str());
+                  ossimAnnotationFontObject* latLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                                      dmsString);
+                  latLabel->setGeometryInformation(theGeographicLeftLabelFontInfo);
+                  latLabel->setFont(theGeographicLeftLabelFont.get());
+//                  latLabel->setFont(theGeographicLeftLabelFont->dup());
+                  
+                  latLabel->computeBoundingRect();
+                  ossimDrect boundsD;
+                  latLabel->getBoundingRect(boundsD);
+                  ossimIrect bounds = boundsD;
+                  
+                  ossimIpt center( ossim::round<int>((rect.ul().x - (bounds.width()/2))),
+                                   rounded.y);
+                  
+                  latLabel->setColor(theLeftGeographicLabelColor.getR(), theLeftGeographicLabelColor.getG(), theLeftGeographicLabelColor.getB());
+                  latLabel->setCenterPosition(center);
+                  latLabel->computeBoundingRect();
+                  latLabel->getBoundingRect(boundsD);
+                  bounds = boundsD;
+
+                  ossimDrect labelRect;
+                  latLabel->getBoundingRect(labelRect);
+                  
+                  if(rect.intersects(labelRect))
+                  {
+                     ossimIrect intersection = rect.clipToRect(labelRect);
+                     center.x -= ossim::round<int>(rect.ul().x - intersection.ur().x);
+                  }
+
+                  center.x -= 24; // this will need to be the tick height later;
+                  latLabel->setCenterPosition(center);
+                  latLabel->computeBoundingRect();
+
+
+                  
+                  addFixedAnnotation(latLabel);
+               }
+               
+               if(theLeftGeographicTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(rect.ul().x),
+                                                                                                rounded.y),
+                                                                                       ossimIpt(ossim::round<int>(rect.ul().x-23),
+                                                                                                rounded.y));
+                  lineLabel->setColor(theLeftGeographicLabelColor.getR(), theLeftGeographicLabelColor.getG(), theLeftGeographicLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+            }
+         }
+      }
+   }
+}
+
+void ossimMapCompositionSource::addGeographicRightGridLabels()
+{
+   if((!theRightGeographicLabelFlag)&&(!theRightGeographicTickFlag))
+   {
+      return;
+   }
+
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   { 
+      ossimGpt gpt[4];
+      ossimDrect rect = getViewingRect();
+
+      if(rect.hasNans()) return;
+      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
+      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
+      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
+      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
+      
+      ossimDrect grect(gpt[0],
+                       gpt[1],
+                       gpt[2],
+                       gpt[3],
+                       OSSIM_RIGHT_HANDED);
+
+      if(grect.hasNans()) return;
+      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+      
+      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+
+      while(ulLatLon.lat > 90)
+      {
+         ulLatLon.lat -= theGeographicSpacing.lat;
+      }
+      while(ulLatLon.lon < -180)
+      {
+         ulLatLon.lon += theGeographicSpacing.lon;
+      }
+      while(lrLatLon.lat < -90)
+      {
+         ulLatLon.lat += theGeographicSpacing.lat;
+      }
+      while(lrLatLon.lon > 180)
+      {
+         ulLatLon.lon -= theGeographicSpacing.lon;
+      }
+      
+      ossimDrect latLonSpacing(ulLatLon,
+                               lrLatLon,
+                               OSSIM_RIGHT_HANDED);
+      // do the left side labels
+      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
+      {
+         ossimDpt lipt;
+         ossimDpt ript;
+         ossimGpt lgpt(lat,
+                       latLonSpacing.ul().x,
+                       0.0,
+                       gpt[0].datum());
+         ossimGpt rgpt(lat,
+                       latLonSpacing.ur().x,
+                       0.0,
+                       gpt[0].datum());
+         
+         
+         mapProj->worldToLineSample(lgpt, lipt);
+         mapProj->worldToLineSample(rgpt, ript);
+         
+         if(rect.clip(lipt, ript))
+         {
+            ossimIpt rounded(ript);
+            if( (rounded.y >= rect.ul().y)&&
+                (rounded.y <= rect.lr().y))
+            {
+               if(theRightGeographicLabelFlag)
+               {
+                  ossimDms dms(rgpt.latd());
+                  
+                  ossimString dmsString = dms.toString(theRightGeographicFormat.c_str());
+                  ossimAnnotationFontObject* latLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                                      dmsString);
+                  latLabel->setGeometryInformation(theGeographicRightLabelFontInfo);
+                  latLabel->setFont(theGeographicRightLabelFont.get());
+//                  latLabel->setFont(theGeographicRightLabelFont->dup());
+                  latLabel->computeBoundingRect();
+                  ossimDrect boundsD;
+                  latLabel->getBoundingRect(boundsD);
+                  ossimIrect bounds = boundsD;
+                  
+                  ossimIpt center( ossim::round<int>((rect.ur().x + (bounds.width()/2))),
+                                   rounded.y);
+               
+                  latLabel->setColor(theRightGeographicLabelColor.getR(), theRightGeographicLabelColor.getG(), theRightGeographicLabelColor.getB());
+                  latLabel->setCenterPosition(center);
+                  latLabel->computeBoundingRect();
+                  latLabel->getBoundingRect(boundsD);
+                  bounds = boundsD;
+
+                  ossimDrect labelRect;
+                  latLabel->getBoundingRect(labelRect);
+                  
+                  if(rect.intersects(labelRect))
+                  {
+                     ossimIrect intersection = rect.clipToRect(labelRect);
+                     center.x -= ossim::round<int>(rect.ur().x - intersection.ul().x);
+                  }
+
+                  center.x += 24; // this will need to be the tick height later;
+                  latLabel->setCenterPosition(center);
+                  latLabel->computeBoundingRect();
+                  
+
+                  addFixedAnnotation(latLabel);
+               }
+               
+               if(theRightGeographicTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(rect.lr().x),
+                                                                                                rounded.y),
+                                                                                       ossimIpt(ossim::round<int>(rect.lr().x+23),
+                                                                                                rounded.y));
+                  
+                  lineLabel->setColor(theRightGeographicLabelColor.getR(), theRightGeographicLabelColor.getG(), theRightGeographicLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+            }
+         }
+      }
+   }
+}
+
+void ossimMapCompositionSource::addGeographicGridLines()
+{
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   { 
+      ossimGpt gpt[4];
+      ossimDrect rect = getViewingRect();
+
+      if(rect.hasNans()) return;
+      mapProj->lineSampleToWorld(rect.ul(), gpt[0]);
+      mapProj->lineSampleToWorld(rect.ur(), gpt[1]);
+      mapProj->lineSampleToWorld(rect.lr(), gpt[2]);
+      mapProj->lineSampleToWorld(rect.ll(), gpt[3]);
+      
+      ossimDrect grect(gpt[0],
+                       gpt[1],
+                       gpt[2],
+                       gpt[3],
+                       OSSIM_RIGHT_HANDED);
+
+      if(grect.hasNans()) return;
+      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+      
+      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+
+      while(ulLatLon.lat > 90)
+      {
+         ulLatLon.lat -= theGeographicSpacing.lat;
+      }
+      while(ulLatLon.lon < -180)
+      {
+         ulLatLon.lon += theGeographicSpacing.lon;
+      }
+      while(lrLatLon.lat < -90)
+      {
+         ulLatLon.lat += theGeographicSpacing.lat;
+      }
+      while(lrLatLon.lon > 180)
+      {
+         ulLatLon.lon -= theGeographicSpacing.lon;
+      }
+      
+      ossimDrect latLonSpacing(ulLatLon,
+                               lrLatLon,
+                               OSSIM_RIGHT_HANDED);
+
+
+      for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
+      {
+         ossimDpt tipt; // top
+         ossimDpt bipt; // bottom
+         
+         ossimGpt tgpt(latLonSpacing.ul().y,
+                       lon,
+                       0.0,
+                       gpt[0].datum());
+
+         ossimGpt bgpt(latLonSpacing.lr().y,
+                       lon,
+                       0.0,
+                       gpt[0].datum());
+         
+         mapProj->worldToLineSample(tgpt, tipt);
+         mapProj->worldToLineSample(bgpt, bipt);
+
+         if(rect.clip(tipt, bipt))
+         {
+            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(tipt, bipt);
+            line->setColor(theGeographicGridColor.getR(),
+                           theGeographicGridColor.getG(),
+                           theGeographicGridColor.getB());
+            addFixedAnnotation(line);
+         }
+      }
+      // do the left side labels
+      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
+      {
+         ossimDpt lipt;
+         ossimDpt ript;
+         ossimGpt lgpt(lat,
+                       latLonSpacing.ul().x,
+                       0.0,
+                       gpt[0].datum());
+         ossimGpt rgpt(lat,
+                       latLonSpacing.ur().x,
+                       0.0,
+                       gpt[0].datum());
+
+         mapProj->worldToLineSample(lgpt, lipt);
+         mapProj->worldToLineSample(rgpt, ript);
+         
+         if(rect.clip(lipt, ript))
+         {
+            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(lipt,
+                                                                            ript);
+         
+            line->setColor(theGeographicGridColor.getR(),
+                                theGeographicGridColor.getG(),
+                                theGeographicGridColor.getB());
+         
+            addFixedAnnotation(line);
+         }
+      }
+   }   
+}
+
+void ossimMapCompositionSource::addGeographicGridReseaux()
+{
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   { 
+      ossimGpt gptArray[4];
+      ossimDrect rect = getViewingRect();
+      
+      mapProj->lineSampleToWorld(rect.ul(), gptArray[0]);
+      mapProj->lineSampleToWorld(rect.ur(), gptArray[1]);
+      mapProj->lineSampleToWorld(rect.lr(), gptArray[2]);
+      mapProj->lineSampleToWorld(rect.ll(), gptArray[3]);
+      
+      ossimDrect grect(gptArray[0],
+                       gptArray[1],
+                       gptArray[2],
+                       gptArray[3],
+                       OSSIM_RIGHT_HANDED);
+
+      ossimDpt ulLatLon(((int)((grect.ul().x-theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.ul().y+theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+      
+      ossimDpt lrLatLon(((int)((grect.lr().x+theGeographicSpacing.x)/theGeographicSpacing.x))*theGeographicSpacing.x,
+                        ((int)((grect.lr().y-theGeographicSpacing.y)/theGeographicSpacing.y))*theGeographicSpacing.y);
+      
+      ossimDrect latLonSpacing(ulLatLon,
+                               lrLatLon,
+                               OSSIM_RIGHT_HANDED);
+
+      ossimDpt ipt; // top
+      for(double lat = latLonSpacing.ul().y; lat >= latLonSpacing.lr().y; lat-=theGeographicSpacing.y)
+      {
+         for(double lon = latLonSpacing.ul().x; lon <= latLonSpacing.lr().x; lon+=theGeographicSpacing.x)
+         {
+            
+            ossimGpt gpt(lat,
+                         lon,
+                         0.0,
+                         gptArray[0].datum());
+            
+            mapProj->worldToLineSample(gpt, ipt);
+
+            ossimIpt rounded(ipt);
+            if(rect.pointWithin(ossimDpt(rounded)))
+            {
+               ossimIpt horizontalStart(rounded.x-10, rounded.y);
+               ossimIpt horizontalEnd(rounded.x+10, rounded.y);
+
+               ossimIpt verticalStart(rounded.x, rounded.y-10);
+               ossimIpt verticalEnd(rounded.x, rounded.y+10);
+               
+               ossimAnnotationLineObject* line1 = new ossimAnnotationLineObject(horizontalStart, horizontalEnd);
+               ossimAnnotationLineObject* line2 = new ossimAnnotationLineObject(verticalStart,verticalEnd);
+
+               line1->setColor(theGeographicGridColor.getR(),
+                               theGeographicGridColor.getG(),
+                               theGeographicGridColor.getB());
+               line2->setColor(theGeographicGridColor.getR(),
+                               theGeographicGridColor.getG(),
+                               theGeographicGridColor.getB());
+               addFixedAnnotation(line1);
+               addFixedAnnotation(line2);
+            }  
+         }
+      }
+   }   
+}
+
+void ossimMapCompositionSource::addMeterGridLines()
+{
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   { 
+      ossimDpt dptArray[4];
+      ossimDrect rect = getViewingRect();
+      
+      mapProj->lineSampleToEastingNorthing(rect.ul(), dptArray[0]);
+      mapProj->lineSampleToEastingNorthing(rect.ur(), dptArray[1]);
+      mapProj->lineSampleToEastingNorthing(rect.lr(), dptArray[2]);
+      mapProj->lineSampleToEastingNorthing(rect.ll(), dptArray[3]);
+      
+      ossimDrect drect(dptArray[0], dptArray[1], dptArray[2], dptArray[3], OSSIM_RIGHT_HANDED);
+      
+      ossimDpt ulMeter(((int)((drect.ul().x-theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
+                       ((int)((drect.ul().y+theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
+      
+      ossimDpt lrMeter(((int)((drect.lr().x+theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
+                        ((int)((drect.lr().y-theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
+      
+      ossimDrect meterSpacing(ulMeter,
+                              lrMeter,
+                              OSSIM_RIGHT_HANDED);
+
+      for(double horizontal = meterSpacing.ul().x;
+          horizontal <= meterSpacing.lr().x;
+          horizontal+=theMeterSpacing.x)
+      {
+         ossimDpt tipt; // top
+         ossimDpt bipt; // bottom
+
+         ossimDpt tdpt(horizontal, meterSpacing.ul().y);
+
+         ossimDpt bdpt(horizontal, meterSpacing.lr().y);
+         
+         mapProj->eastingNorthingToLineSample(tdpt, tipt);
+         mapProj->eastingNorthingToLineSample(bdpt, bipt);
+         
+         if(rect.clip(tipt, bipt))
+         {
+            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(tipt, bipt);
+            line->setColor(theMeterGridColor.getR(),
+                           theMeterGridColor.getG(),
+                           theMeterGridColor.getB());
+            addFixedAnnotation(line);
+         }
+      }
+      // do the left side labels
+      for(double vertical = meterSpacing.ul().y;
+          vertical >= meterSpacing.lr().y;
+          vertical-=theMeterSpacing.y)
+      {
+         ossimDpt lipt;
+         ossimDpt ript;
+         ossimDpt ldpt(meterSpacing.ul().x, vertical);
+         ossimDpt rdpt(meterSpacing.ur().x, vertical);
+
+         mapProj->eastingNorthingToLineSample(ldpt,  lipt);
+         mapProj->eastingNorthingToLineSample(rdpt,  ript);
+         
+         if(rect.clip(lipt, ript))
+         {
+            ossimAnnotationLineObject* line = new ossimAnnotationLineObject(lipt, ript);
+         
+            line->setColor(theMeterGridColor.getR(),
+                           theMeterGridColor.getG(),
+                           theMeterGridColor.getB());
+            
+            addFixedAnnotation(line);
+         }
+      }
+   }
+}
+
+void ossimMapCompositionSource::addMeterGridLabels()
+{
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   {
+      ossimDpt dptArray[4];
+      ossimDrect rect = getViewingRect();
+      
+      mapProj->lineSampleToEastingNorthing(rect.ul(), dptArray[0]);
+      mapProj->lineSampleToEastingNorthing(rect.ur(), dptArray[1]);
+      mapProj->lineSampleToEastingNorthing(rect.lr(), dptArray[2]);
+      mapProj->lineSampleToEastingNorthing(rect.ll(), dptArray[3]);
+      
+      ossimDrect drect(dptArray[0],
+                       dptArray[1],
+                       dptArray[2],
+                       dptArray[3],
+                       OSSIM_RIGHT_HANDED);
+      
+      ossimDpt ulMeter(((int)((drect.ul().x-theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
+                       ((int)((drect.ul().y+theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
+      
+      ossimDpt lrMeter(((int)((drect.lr().x+theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
+                        ((int)((drect.lr().y-theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
+      
+      ossimDrect meterSpacing(ulMeter,
+                              lrMeter,
+                              OSSIM_RIGHT_HANDED);
+      
+      ossimDrect labelRect;
+
+      // Since we support overlapping grid lables.  We will shift
+      // the meter label if there exists a gegraphic label.  To
+      // do this we need to compute an extra shift length based
+      // on the font type on each of the sides.  We could actually make this
+      // shift adjustable later????
+      //
+      long extraTopDelta     = 0;
+      long extraBottomDelta  = 0;
+      long extraLeftDelta    = 0;
+      long extraRightDelta   = 0;
+         
+      if(theTopGeographicLabelFlag&&theGeographicTopLabelFont.valid())
+      {  
+         ossimDms dms(180, false);
+         ossimString dmsString = dms.toString(theTopGeographicFormat.c_str());
+         
+         theGeographicTopLabelFont->setString(dmsString);
+         ossimIrect box;
+         
+         theGeographicTopLabelFont->getBoundingBox(box);
+         extraTopDelta = box.height();
+      }
+      if(theBottomGeographicLabelFlag&&theGeographicBottomLabelFont.valid())
+      {  
+         ossimDms dms(180, false);
+         ossimString dmsString = dms.toString(theBottomGeographicFormat.c_str());
+         theGeographicBottomLabelFont->setString(dmsString);
+         ossimIrect box;
+         
+         theGeographicBottomLabelFont->getBoundingBox(box);
+         extraBottomDelta = box.height();
+      }
+      if(theLeftGeographicLabelFlag&&theGeographicLeftLabelFont.valid())
+      {  
+         ossimDms dms(90.0, true);
+         ossimString dmsString = dms.toString(theLeftGeographicFormat.c_str());
+         theGeographicLeftLabelFont->setString(dmsString);
+         ossimIrect box;
+         
+         theGeographicLeftLabelFont->getBoundingBox(box);
+         extraLeftDelta = box.width();
+      }
+      if(theRightGeographicLabelFlag&&theGeographicRightLabelFont.valid())
+      {  
+         ossimDms dms(90.0, true);
+         ossimString dmsString = dms.toString(theRightGeographicFormat.c_str());
+         
+         theGeographicRightLabelFont->setString(dmsString);
+         ossimIrect box;
+         
+         theGeographicRightLabelFont->getBoundingBox(box);
+         extraRightDelta = box.width();
+      }
+
+      if(theTopMeterLabelFlag || theBottomMeterLabelFlag)
+      {
+         for(double horizontal = meterSpacing.ul().x;
+             horizontal <= meterSpacing.lr().x;
+             horizontal+=theMeterSpacing.x)
+         {
+            ossimDpt tipt; // top
+            ossimDpt bipt; // bottom
+            
+            ossimDpt tdpt(horizontal,
+                          meterSpacing.ul().y);
+            
+            ossimDpt bdpt(horizontal,
+                          meterSpacing.lr().y);
+            
+            mapProj->eastingNorthingToLineSample(tdpt, tipt);
+            mapProj->eastingNorthingToLineSample(bdpt, bipt);
+            
+            rect.clip(tipt, bipt);
+            
+            tipt = ossimIpt(tipt);
+            bipt = ossimIpt(bipt);
+            
+            if(theTopMeterLabelFlag&&rect.clip(tipt, bipt))
+            {
+               ossimAnnotationFontObject* topLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                                   ossimString::toString(horizontal).c_str());
+               
+               
+               topLabel->setFont(theMeterTopLabelFont.get());
+               
+               topLabel->setGeometryInformation(theMeterTopLabelFontInfo);
+               topLabel->computeBoundingRect();
+               ossimDrect boundsTop;
+               topLabel->getBoundingRect(boundsTop);
+               
+               ossimIpt centerTop(ossim::round<int>(tipt.x),
+                                  ossim::round<int>(rect.ul().y-(boundsTop.height()/2)));
+               
+               topLabel->setColor(theTopMeterLabelColor.getR(),
+                                  theTopMeterLabelColor.getG(),
+                                  theTopMeterLabelColor.getB());
+               
+               
+               topLabel->setCenterPosition(centerTop);
+               topLabel->computeBoundingRect();
+               
+               topLabel->getBoundingRect(labelRect);
+               
+               if(rect.intersects(labelRect))
+               {
+                  ossimIrect intersection = rect.clipToRect(labelRect);
+                  centerTop.y -= ossim::round<int>(rect.ul().y - intersection.lr().y);
+               }
+               
+               centerTop.y -= (24+extraTopDelta); // this will need to be the tick height later;
+               topLabel->setCenterPosition(centerTop);
+               topLabel->computeBoundingRect();
+               addFixedAnnotation(topLabel);
+
+               if(theTopMeterTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(tipt.x),
+                                                                                                ossim::round<int>(tipt.y-24)),
+                                                                                       ossimIpt(ossim::round<int>(tipt.x),
+                                                                                                ossim::round<int>(tipt.y)));
+                  
+                  lineLabel->setColor(theTopMeterLabelColor.getR(), theTopMeterLabelColor.getG(), theTopMeterLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+            }
+         // ------------------------- BOTTOM ----------------------------
+            
+            if(theBottomMeterLabelFlag&&rect.pointWithin(bipt))
+            {
+               ossimAnnotationFontObject* bottomLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                                      ossimString::toString(horizontal).c_str());
+               
+               
+               bottomLabel->setFont(theMeterBottomLabelFont.get());
+               
+               bottomLabel->setGeometryInformation(theMeterBottomLabelFontInfo);
+               bottomLabel->computeBoundingRect();
+               ossimDrect boundsBottom;
+               bottomLabel->getBoundingRect(boundsBottom);
+               
+               ossimIpt centerBottom(ossim::round<int>(bipt.x),
+                                     ossim::round<int>(rect.lr().y+(boundsBottom.height()/2)));
+               
+               bottomLabel->setColor(theBottomMeterLabelColor.getR(),
+                                     theBottomMeterLabelColor.getG(),
+                                     theBottomMeterLabelColor.getB());
+               
+               
+               bottomLabel->setCenterPosition(centerBottom);
+               bottomLabel->computeBoundingRect();
+               
+               bottomLabel->getBoundingRect(labelRect);
+               
+               if(rect.intersects(labelRect))
+               {
+                  ossimIrect intersection = rect.clipToRect(labelRect);
+                  centerBottom.y += ossim::round<int>(rect.lr().y - intersection.ul().y);
+               }
+               
+               centerBottom.y += (24+extraBottomDelta); // this will need to be the tick height later;
+               bottomLabel->setCenterPosition(centerBottom);
+               bottomLabel->computeBoundingRect();
+               addFixedAnnotation(bottomLabel);
+               if(theBottomMeterTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(bipt.x),
+                                                                                                ossim::round<int>(bipt.y+24)),
+                                                                                       ossimIpt(ossim::round<int>(bipt.x),
+                                                                                                ossim::round<int>(bipt.y)));
+                  
+                  lineLabel->setColor(theBottomMeterLabelColor.getR(), theBottomMeterLabelColor.getG(), theBottomMeterLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+            }            
+         }
+      }
+      if(theLeftMeterLabelFlag || theRightMeterLabelFlag)
+      {
+         for(double vertical = meterSpacing.ul().y;
+             vertical >= meterSpacing.lr().y;
+             vertical-=theMeterSpacing.y)
+         {
+            ossimDpt lipt;
+            ossimDpt ript;
+            ossimDpt ldpt(meterSpacing.ul().x,
+                          vertical);
+            ossimDpt rdpt(meterSpacing.ur().x,
+                          vertical);
+            
+            mapProj->eastingNorthingToLineSample(ldpt, lipt);
+            mapProj->eastingNorthingToLineSample(rdpt, ript);
+            
+            if(rect.clip(lipt, ript))
+            {
+               //------------------------------------------------ Left label ----------------------------------------------
+               ossimAnnotationFontObject* leftLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                                    ossimString::toString(vertical).c_str());
+               
+               
+               leftLabel->setFont(theMeterLeftLabelFont.get());
+               
+               leftLabel->setGeometryInformation(theMeterLeftLabelFontInfo);
+               leftLabel->computeBoundingRect();
+               ossimDrect boundsLeft;
+               leftLabel->getBoundingRect(boundsLeft);
+               
+               ossimIpt centerLeft(ossim::round<int>(rect.ul().x-(boundsLeft.width()/2)),
+                                   ossim::round<int>(lipt.y));
+                                  
+               
+               leftLabel->setColor(theLeftMeterLabelColor.getR(),
+                                   theLeftMeterLabelColor.getG(),
+                                   theLeftMeterLabelColor.getB());
+               
+               
+               leftLabel->setCenterPosition(centerLeft);
+               leftLabel->computeBoundingRect();
+               
+               leftLabel->getBoundingRect(labelRect);
+               
+               if(rect.intersects(labelRect))
+               {
+                  ossimIrect intersection = rect.clipToRect(labelRect);
+                  centerLeft.x -= ossim::round<int>(intersection.lr().x - rect.ul().x);
+               }
+               
+               centerLeft.x -= (24+extraLeftDelta); // this will need to be the tick height later;
+               leftLabel->setCenterPosition(centerLeft);
+               leftLabel->computeBoundingRect();
+               addFixedAnnotation(leftLabel);
+               if(theLeftMeterTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(lipt.x-24),
+                                                                                                ossim::round<int>(lipt.y)),
+                                                                                       ossimIpt(ossim::round<int>(lipt.x),
+                                                                                                ossim::round<int>(lipt.y)));
+                  
+                  lineLabel->setColor(theLeftMeterLabelColor.getR(), theLeftMeterLabelColor.getG(), theLeftMeterLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+
+               
+               //--------------------------------RIGHT-----------------------------------------------------------
+               ossimAnnotationFontObject* rightLabel = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                                     ossimString::toString(vertical).c_str());
+               
+               
+               rightLabel->setFont(theMeterRightLabelFont.get());
+               
+               rightLabel->setGeometryInformation(theMeterRightLabelFontInfo);
+               rightLabel->computeBoundingRect();
+               ossimDrect boundsRight;
+               rightLabel->getBoundingRect(boundsRight);
+               
+               ossimIpt centerRight(ossim::round<int>(rect.ur().x+(boundsRight.width()/2)),
+                                    ossim::round<int>(ript.y));
+                                  
+               
+               rightLabel->setColor(theRightMeterLabelColor.getR(),
+                                    theRightMeterLabelColor.getG(),
+                                    theRightMeterLabelColor.getB());
+               
+               
+               rightLabel->setCenterPosition(centerRight);
+               rightLabel->computeBoundingRect();
+               
+               rightLabel->getBoundingRect(labelRect);
+               
+               if(rect.intersects(labelRect))
+               {
+                  ossimIrect intersection = rect.clipToRect(labelRect);
+                  centerRight.x += ossim::round<int>(intersection.ul().x - rect.ur().x);
+               }
+               
+               centerRight.x += (24+extraRightDelta); // this will need to be the tick height later;
+               rightLabel->setCenterPosition(centerRight);
+               rightLabel->computeBoundingRect();
+               addFixedAnnotation(rightLabel);
+               if(theRightMeterTickFlag)
+               {
+                  ossimAnnotationLineObject* lineLabel = new ossimAnnotationLineObject(ossimIpt(ossim::round<int>(ript.x+24),
+                                                                                                ossim::round<int>(ript.y)),
+                                                                                       ossimIpt(ossim::round<int>(ript.x),
+                                                                                                ossim::round<int>(ript.y)));
+                  
+                  lineLabel->setColor(theRightMeterLabelColor.getR(), theRightMeterLabelColor.getG(), theRightMeterLabelColor.getB());
+                  addFixedAnnotation(lineLabel);
+               }
+            }
+         }
+      }
+   }
+}
+
+
+void ossimMapCompositionSource::addMeterGridReseaux()
+{
+   const ossimMapProjection* mapProj = inputMapProjection();
+   if(mapProj)
+   { 
+      ossimDpt dpt[4];
+      ossimDrect rect = getViewingRect();
+      
+      mapProj->lineSampleToEastingNorthing(rect.ul(), dpt[0]);
+      mapProj->lineSampleToEastingNorthing(rect.ur(), dpt[1]);
+      mapProj->lineSampleToEastingNorthing(rect.lr(), dpt[2]);
+      mapProj->lineSampleToEastingNorthing(rect.ll(), dpt[3]);
+      
+      ossimDrect drect(dpt[0],
+                       dpt[1],
+                       dpt[2],
+                       dpt[3],
+                       OSSIM_RIGHT_HANDED);
+
+      ossimDpt ulMeter(((int)((drect.ul().x-theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
+                       ((int)((drect.ul().y+theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
+      
+      ossimDpt lrMeter(((int)((drect.lr().x+theMeterSpacing.x)/theMeterSpacing.x))*theMeterSpacing.x,
+                        ((int)((drect.lr().y-theMeterSpacing.y)/theMeterSpacing.y))*theMeterSpacing.y);
+
+      ossimDrect meterSpacing(ulMeter,
+                              lrMeter,
+                              OSSIM_RIGHT_HANDED);
+
+      ossimDpt ipt; // top
+
+      for(double vertical = meterSpacing.ul().y; vertical >= meterSpacing.lr().y; vertical-=theMeterSpacing.y)
+      {
+         for(double horizontal = meterSpacing.ul().x;  horizontal <= meterSpacing.lr().x; horizontal+=theMeterSpacing.x)
+         {            
+            ossimDpt dpt(horizontal,
+                         vertical);
+            
+            mapProj->eastingNorthingToLineSample(dpt, ipt);
+
+            ossimIpt rounded(ipt);
+            if(rect.pointWithin(ossimDpt(rounded)))
+            {
+               ossimIpt horizontalStart(rounded.x-10, rounded.y);
+               ossimIpt horizontalEnd(rounded.x+10, rounded.y);
+
+               ossimIpt verticalStart(rounded.x, rounded.y-10);
+               ossimIpt verticalEnd(rounded.x, rounded.y+10);
+               
+               ossimAnnotationLineObject* line1 = new ossimAnnotationLineObject(horizontalStart, horizontalEnd);
+               ossimAnnotationLineObject* line2 = new ossimAnnotationLineObject(verticalStart,verticalEnd);
+
+               line1->setColor(theMeterGridColor.getR(),
+                               theMeterGridColor.getG(),
+                               theMeterGridColor.getB());
+
+               line2->setColor(theMeterGridColor.getR(),
+                               theMeterGridColor.getG(),
+                               theMeterGridColor.getB());
+               addFixedAnnotation(line1);
+               addFixedAnnotation(line2);
+            }  
+         }
+      }
+   }   
+}
+
+void ossimMapCompositionSource::addTitle()
+{
+   ossimAnnotationFontObject* title = new ossimAnnotationFontObject(ossimIpt(0,0),
+                                                                    theTitleString);
+   title->setGeometryInformation(theTitleFontInfo);
+   title->setFont(theTitleFont.get());
+   title->setColor(theTitleColor.getR(),
+                   theTitleColor.getG(),
+                   theTitleColor.getB());
+   title->setCenterPosition(theTopBorder.midPoint());
+   title->computeBoundingRect();
+
+   addFixedAnnotation(title);
+}
+
+ossimIrect ossimMapCompositionSource::getViewingRect()const
+{
+   ossimIrect result;
+   result.makeNan();
+
+   if(theInputConnection)
+   {
+      result = theInputConnection->getBoundingRect();
+
+      if(!result.hasNans())
+      {
+         ossimIpt mid = result.midPoint();
+         ossim_int32 w = result.width();
+         ossim_int32 h = result.width();
+
+         if(theViewWidthHeight.x >-1)
+         {
+            w = theViewWidthHeight.x;
+         }
+         if(theViewWidthHeight.y >-1)
+         {
+            h = theViewWidthHeight.y;
+         }
+         ossimIpt ul(mid.x - w/2,
+                     mid.y - h/2);
+         
+         result = ossimIrect(ul.x,
+                             ul.y,
+                             ul.x + w-1,
+                             ul.y + h -1);
+      }
+   }
+
+   return result;
+}
+
+void ossimMapCompositionSource::drawAnnotations(
+   ossimRefPtr<ossimImageData> tile)
+{
+   if (!theImage)
+   {
+      return;
+   }
+      
+   theImage->setCurrentImageData(theTile);
+   
+   if(theImage->getImageData().valid())
+   {
+      ossimAnnotationSource::AnnotationObjectListType::iterator object = theFixedAnnotationList.begin();
+      while(object != theFixedAnnotationList.end())
+      {
+         if((*object).valid())
+         {
+            (*object)->draw(*theImage);
+         }
+         ++object;
+      }      
+   }
+   
+   ossimAnnotationSource::drawAnnotations(tile);
+}
+
+void ossimMapCompositionSource::deleteFixedAnnotations()
+{
+   theFixedAnnotationList.clear();
+}
+
+
+void ossimMapCompositionSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid()) return;
+   
+   ossimRefPtr<ossimProperty>        tempProp     = 0;
+   ossimFontProperty*    fontProp     = 0;
+   ossimColorProperty*   colorProp    = 0;
+   ossimBooleanProperty* booleanProp  = 0;
+   
+   if(property->getName() == "Geographic label properties")
+   {
+      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
+                                                       property.get());
+      if(containerProp)
+      {
+         // first set the font format
+         //
+         tempProp = containerProp->getProperty("Top font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setGeographicTopLabelFont(fontProp->getFontInformation());
+         }
+         tempProp = containerProp->getProperty("Bottom font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setGeographicBottomLabelFont(fontProp->getFontInformation());
+         }
+         tempProp = containerProp->getProperty("Left font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setGeographicLeftLabelFont(fontProp->getFontInformation());
+         }
+         tempProp = containerProp->getProperty("Right font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setGeographicRightLabelFont(fontProp->getFontInformation());
+         }
+
+         // set color property
+         tempProp = containerProp->getProperty("Top color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setTopGeographicLabelColor(colorProp->getColor());
+         }
+         tempProp = containerProp->getProperty("Bottom color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setBottomGeographicLabelColor(colorProp->getColor());
+         }
+         tempProp = containerProp->getProperty("Left color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setLeftGeographicLabelColor(colorProp->getColor());
+         }
+         tempProp = containerProp->getProperty("Right color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setRightGeographicLabelColor(colorProp->getColor());
+         }
+
+         // set enable flags
+         tempProp = containerProp->getProperty("Top enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setTopGeographicLabelFlag(booleanProp->getBoolean());
+         }
+
+         tempProp = containerProp->getProperty("Bottom enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setBottomGeographicLabelFlag(booleanProp->getBoolean());
+         }
+
+         tempProp = containerProp->getProperty("Left enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setLeftGeographicLabelFlag(booleanProp->getBoolean());
+         }
+
+         tempProp = containerProp->getProperty("Right enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setRightGeographicLabelFlag(booleanProp->getBoolean());
+         }
+         
+         tempProp = containerProp->getProperty("Top tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setTopGeographicTickMarkFlag(booleanProp->getBoolean());
+         }
+         tempProp = containerProp->getProperty("Bottom tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setBottomGeographicTickMarkFlag(booleanProp->getBoolean());
+         }
+         tempProp = containerProp->getProperty("Left tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setLeftGeographicTickMarkFlag(booleanProp->getBoolean());
+         }
+         tempProp = containerProp->getProperty("Right tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setRightGeographicTickMarkFlag(booleanProp->getBoolean());
+         }
+      }
+   }
+   else if(property->getName() == "Geographic grid properties")
+   {
+      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
+                                                       property.get());
+      if(containerProp)
+      {
+         tempProp = containerProp->getProperty("Grid type");
+         if(tempProp.valid())
+         {
+            ossimString value = tempProp->valueToString();
+
+            if(value == "none")
+            {
+               setGeographicGridType(OSSIM_GRID_NONE);
+            }
+            else if(value == "line")
+            {
+               setGeographicGridType(OSSIM_GRID_LINE);
+            }
+            else if(value == "reseaux")
+            {
+               setGeographicGridType(OSSIM_GRID_RESEAUX);
+            }
+         }
+         tempProp = containerProp->getProperty("Horizontal spacing");
+         if(tempProp.valid())
+         {
+            setGeographicSpacingLon(tempProp->valueToString().toDouble());
+         }
+
+         tempProp = containerProp->getProperty("Vertical spacing");
+         if(tempProp.valid())
+         {
+            setGeographicSpacingLat(tempProp->valueToString().toDouble());
+         }
+
+         tempProp = containerProp->getProperty("Color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(tempProp.valid())
+         {
+            setGeographicGridColor(colorProp->getColor());
+         }
+      }
+   }
+   else if(property->getName() == "Meter label properties")
+   {
+      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
+                                                       property.get());
+      if(containerProp)
+      {
+         // first set the font format
+         //
+         tempProp = containerProp->getProperty("Top font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setMeterTopLabelFont(fontProp->getFontInformation());
+         }
+         tempProp = containerProp->getProperty("Bottom font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setMeterBottomLabelFont(fontProp->getFontInformation());
+         }
+         tempProp = containerProp->getProperty("Left font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setMeterLeftLabelFont(fontProp->getFontInformation());
+         }
+         tempProp = containerProp->getProperty("Right font");
+         fontProp = PTR_CAST(ossimFontProperty, tempProp.get());
+         if(fontProp)
+         {
+            setMeterRightLabelFont(fontProp->getFontInformation());
+         }
+
+         // set color property
+         tempProp = containerProp->getProperty("Top color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setTopMeterLabelColor(colorProp->getColor());
+         }
+         tempProp = containerProp->getProperty("Bottom color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setBottomMeterLabelColor(colorProp->getColor());
+         }
+         tempProp = containerProp->getProperty("Left color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setLeftMeterLabelColor(colorProp->getColor());
+         }
+         tempProp = containerProp->getProperty("Right color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(colorProp)
+         {
+            setRightMeterLabelColor(colorProp->getColor());
+         }
+
+         // set enable flags
+         tempProp = containerProp->getProperty("Top enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setTopMeterLabelFlag(booleanProp->getBoolean());
+         }
+
+         tempProp = containerProp->getProperty("Bottom enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setBottomMeterLabelFlag(booleanProp->getBoolean());
+         }
+
+         tempProp = containerProp->getProperty("Left enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setLeftMeterLabelFlag(booleanProp->getBoolean());
+         }
+
+         tempProp = containerProp->getProperty("Right enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setRightMeterLabelFlag(booleanProp->getBoolean());
+         }
+         
+         tempProp = containerProp->getProperty("Top tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setTopMeterTickMarkFlag(booleanProp->getBoolean());
+         }
+         tempProp = containerProp->getProperty("Bottom tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setBottomMeterTickMarkFlag(booleanProp->getBoolean());
+         }
+         tempProp = containerProp->getProperty("Left tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setLeftMeterTickMarkFlag(booleanProp->getBoolean());
+         }
+         tempProp = containerProp->getProperty("Right tick enabled");
+         booleanProp = PTR_CAST(ossimBooleanProperty,
+                                tempProp.get());
+         if(booleanProp)
+         {
+            setRightMeterTickMarkFlag(booleanProp->getBoolean());
+         }
+      }
+   }
+   else if(property->getName() == "Meter grid properties")
+   {
+      ossimContainerProperty* containerProp = PTR_CAST(ossimContainerProperty,
+                                                       property.get());
+      if(containerProp)
+      {
+         tempProp = containerProp->getProperty("Grid type");
+         if(tempProp.valid())
+         {
+            ossimString value = tempProp->valueToString();
+
+            if(value == "none")
+            {
+               setMeterGridType(OSSIM_GRID_NONE);
+            }
+            else if(value == "line")
+            {
+               setMeterGridType(OSSIM_GRID_LINE);
+            }
+            else if(value == "reseaux")
+            {
+               setMeterGridType(OSSIM_GRID_RESEAUX);
+            }
+         }
+         tempProp = containerProp->getProperty("Horizontal spacing");
+         if(tempProp.valid())
+         {
+            setMeterSpacingX(tempProp->valueToString().toDouble());
+         }
+
+         tempProp = containerProp->getProperty("Vertical spacing");
+         if(tempProp.valid())
+         {
+            setMeterSpacingY(tempProp->valueToString().toDouble());
+         }
+
+         tempProp = containerProp->getProperty("Color");
+         colorProp = PTR_CAST(ossimColorProperty, tempProp.get());
+         if(tempProp.valid())
+         {
+            setMeterGridColor(colorProp->getColor());
+         }
+      }
+   }
+   else if(property->getName() == "Title properties")
+   {
+      ossimContainerProperty* container = PTR_CAST(ossimContainerProperty,
+                                                   property.get());
+      if(container)
+      {
+         ossimProperty* titleProp = container->getProperty("Title").get();
+         if(titleProp)
+         {
+            setTitle(titleProp->valueToString());
+         }
+         ossimFontProperty* fontProp = PTR_CAST(ossimFontProperty,
+                                                container->getProperty("Font").get());
+         ossimColorProperty* colorProp = PTR_CAST(ossimColorProperty,
+                                                  container->getProperty("Color").get());
+
+         if(fontProp)
+         {
+            setTitleFont(fontProp->getFontInformation());
+         }
+         if(colorProp)
+         {
+            setTitleColor(colorProp->getColor());
+         }
+      }
+   }
+   else if(property->getName() == "Viewport properties")
+   {
+      ossimContainerProperty* container = PTR_CAST(ossimContainerProperty,
+                                                   property.get());
+      if(container)
+      {
+         int w = -1;
+         int h = -1;
+         tempProp = container->getProperty("Width");
+         if(tempProp.valid())
+         {
+            w = tempProp->valueToString().toInt32();
+         }
+         tempProp = container->getProperty("Height");
+         if(tempProp.valid())
+         {
+            h = tempProp->valueToString().toInt32();
+         }
+         setViewWidthHeight(ossimIpt(w, h));
+      }
+   }
+   else if(property->getName() == "Border color")
+   {
+      colorProp = PTR_CAST(ossimColorProperty,
+                           property.get());
+      if(colorProp)
+      {
+         setBorderColor(colorProp->getColor());
+      }
+   }
+   else if(property->getName() == "Border size")
+   {
+      ossimContainerProperty* container = PTR_CAST(ossimContainerProperty,
+                                                   property.get());
+      if(container)
+      {
+         tempProp = container->getProperty("Top");
+         if(tempProp.valid())
+         {
+            setTopBorderLength(tempProp->valueToString().toInt32());
+            
+         }
+         tempProp = container->getProperty("Bottom");
+         if(tempProp.valid())
+         {
+            setBottomBorderLength(tempProp->valueToString().toInt32());
+            
+         }
+         tempProp = container->getProperty("Left");
+         if(tempProp.valid())
+         {
+            setLeftBorderLength(tempProp->valueToString().toInt32());
+            
+         }
+         tempProp = container->getProperty("Right");
+         if(tempProp.valid())
+         {
+            setRightBorderLength(tempProp->valueToString().toInt32());
+         }
+      }
+   }
+   else
+   {
+      ossimAnnotationSource::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimMapCompositionSource::getProperty(const ossimString& name)const
+{
+   if(name == "Viewport properties")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+
+      container->addChild(new ossimNumericProperty("Width",
+                                                   ossimString::toString(theViewWidthHeight.x),
+                                                   -1,1.0/DBL_EPSILON));
+      container->addChild(new ossimNumericProperty("Height",
+                                                   ossimString::toString(theViewWidthHeight.y),
+                                                   -1,1.0/DBL_EPSILON));
+      container->setCacheRefreshBit();
+      return container;
+   }
+   else if(name == "Geographic label properties")
+   {
+
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      
+      container->addChild(new ossimFontProperty("Top font",
+                                                theGeographicTopLabelFontInfo));
+      container->addChild(new ossimColorProperty("Top color",
+                                                 theTopGeographicLabelColor));
+      container->addChild(new ossimBooleanProperty("Top enabled",
+                                                   theTopGeographicLabelFlag));
+      container->addChild(new ossimBooleanProperty("Top tick enabled",
+                                                   theTopGeographicTickFlag));
+      
+      container->addChild(new ossimFontProperty("Bottom font",
+                                                theGeographicBottomLabelFontInfo));
+      container->addChild(new ossimColorProperty("Bottom color",
+                                                 theBottomGeographicLabelColor));
+      container->addChild(new ossimBooleanProperty("Bottom enabled",
+                                                   theBottomGeographicLabelFlag));
+      container->addChild(new ossimBooleanProperty("Bottom tick enabled",
+                                                   theBottomGeographicTickFlag));
+      
+      container->addChild(new ossimFontProperty("Left font",
+                                                theGeographicLeftLabelFontInfo));
+      container->addChild(new ossimColorProperty("Left color",
+                                                 theLeftGeographicLabelColor));
+      container->addChild(new ossimBooleanProperty("Left enabled",
+                                                   theLeftGeographicLabelFlag));
+      container->addChild(new ossimBooleanProperty("Left tick enabled",
+                                                   theLeftGeographicTickFlag));
+      
+      container->addChild(new ossimFontProperty("Right font",
+                                                theGeographicRightLabelFontInfo));
+      container->addChild(new ossimColorProperty("Right color",
+                                                 theRightGeographicLabelColor));
+      container->addChild(new ossimBooleanProperty("Right enabled",
+                                                   theRightGeographicLabelFlag));
+      container->addChild(new ossimBooleanProperty("Right tick enabled",
+                                                   theRightGeographicTickFlag));
+      container->setCacheRefreshBit();
+      return container;
+   }
+   else if(name == "Geographic grid properties")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      std::vector<ossimString> gridTypeConstraints;
+      ossimString value = GRID_TYPE_ENUM_NAMES[(int)theGeographicGridType];
+
+      gridTypeConstraints.push_back("none");
+      gridTypeConstraints.push_back("line");
+      gridTypeConstraints.push_back("reseaux");
+      
+      container->addChild(new ossimStringProperty("Grid type",
+                                                  value,
+                                                  false,
+                                                  gridTypeConstraints));
+      container->addChild(new ossimColorProperty("Color",
+                                                 theGeographicGridColor));
+
+      container->addChild(new ossimNumericProperty("Horizontal spacing",
+                                                   ossimString::toString(theGeographicSpacing.x),
+                                                   0.0, 180.0));
+
+      container->addChild(new ossimNumericProperty("Vertical spacing",
+                                                   ossimString::toString(theGeographicSpacing.y),
+                                                   0.0, 180.0));
+                                                   
+      container->setCacheRefreshBit();
+      return container;
+   }
+   else if(name == "Meter label properties")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      
+      container->addChild(new ossimFontProperty("Top font",
+                                                theMeterTopLabelFontInfo));
+      container->addChild(new ossimColorProperty("Top color",
+                                                 theTopMeterLabelColor));
+      container->addChild(new ossimBooleanProperty("Top enabled",
+                                                   theTopMeterLabelFlag));
+      container->addChild(new ossimBooleanProperty("Top tick enabled",
+                                                   theTopMeterTickFlag));
+      
+      container->addChild(new ossimFontProperty("Bottom font",
+                                                theMeterBottomLabelFontInfo));
+      container->addChild(new ossimColorProperty("Bottom color",
+                                                 theBottomMeterLabelColor));
+      container->addChild(new ossimBooleanProperty("Bottom enabled",
+                                                   theBottomMeterLabelFlag));
+      container->addChild(new ossimBooleanProperty("Bottom tick enabled",
+                                                   theBottomMeterTickFlag));
+      
+      container->addChild(new ossimFontProperty("Left font",
+                                                theMeterLeftLabelFontInfo));
+      container->addChild(new ossimColorProperty("Left color",
+                                                 theLeftMeterLabelColor));
+      container->addChild(new ossimBooleanProperty("Left enabled",
+                                                   theLeftMeterLabelFlag));
+      container->addChild(new ossimBooleanProperty("Left tick enabled",
+                                                   theLeftMeterTickFlag));
+      
+      container->addChild(new ossimFontProperty("Right font",
+                                                theMeterRightLabelFontInfo));
+      container->addChild(new ossimColorProperty("Right color",
+                                                 theRightMeterLabelColor));
+      container->addChild(new ossimBooleanProperty("Right enabled",
+                                                   theRightMeterLabelFlag));
+      container->addChild(new ossimBooleanProperty("Right tick enabled",
+                                                   theRightMeterTickFlag));
+      
+      container->setCacheRefreshBit();
+      return container;
+   }
+   else if(name == "Meter grid properties")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      std::vector<ossimString> gridTypeConstraints;
+      ossimString value = GRID_TYPE_ENUM_NAMES[(int)theMeterGridType];
+
+      gridTypeConstraints.push_back("none");
+      gridTypeConstraints.push_back("line");
+      gridTypeConstraints.push_back("reseaux");
+      
+      container->addChild(new ossimStringProperty("Grid type",
+                                                  value,
+                                                  false,
+                                                  gridTypeConstraints));
+      container->addChild(new ossimColorProperty("Color",
+                                                 theMeterGridColor));
+      
+      container->addChild(new ossimNumericProperty("Horizontal spacing",
+                                                   ossimString::toString(theMeterSpacing.x),
+                                                   0.0, 1.0/DBL_EPSILON));
+
+      container->addChild(new ossimNumericProperty("Vertical spacing",
+                                                   ossimString::toString(theMeterSpacing.y),
+                                                   0.0, 1.0/DBL_EPSILON));
+      container->setCacheRefreshBit();
+      return container;
+   }
+   else if(name == "Title properties")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      container->addChild(new ossimTextProperty("Title",
+                                                theTitleString));
+      container->addChild(new ossimFontProperty("Font",
+                                                theTitleFontInfo));
+      container->addChild(new ossimColorProperty("Color",
+                                                 theTitleColor));
+      
+      container->setCacheRefreshBit();
+      return container;
+   }
+   else if(name == "Border size")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      
+      container->addChild(new ossimNumericProperty("Top",
+                                                   ossimString::toString(theTopBorderLength),
+                                                   0,10000));
+      container->addChild(new ossimNumericProperty("Bottom",
+                                                   ossimString::toString(theBottomBorderLength),
+                                                   0,10000));
+      container->addChild(new ossimNumericProperty("Left",
+                                                   ossimString::toString(theLeftBorderLength),
+                                                   0,10000));
+      container->addChild(new ossimNumericProperty("Right",
+                                                   ossimString::toString(theRightBorderLength),
+                                                   0,10000));
+      container->setCacheRefreshBit();
+      return container;
+   }
+   else if(name == "Border color")
+   {
+      ossimColorProperty* colorProp = new ossimColorProperty(name,
+                                                             theBorderColor);
+      colorProp->setCacheRefreshBit();
+      
+      return colorProp;
+   }
+   else if(name == "Viewport properties")
+   {
+      
+   }
+   return ossimAnnotationSource::getProperty(name);
+}
+
+void ossimMapCompositionSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimAnnotationSource::getPropertyNames(propertyNames);
+
+   
+   propertyNames.push_back("Title properties");
+   propertyNames.push_back("Border size");
+   propertyNames.push_back("Border color");
+   propertyNames.push_back("Viewport properties");
+   propertyNames.push_back("Geographic label properties");
+   propertyNames.push_back("Geographic grid properties");
+   propertyNames.push_back("Meter label properties");
+   propertyNames.push_back("Meter grid properties");
+}
+
+bool ossimMapCompositionSource::saveState(ossimKeywordlist& kwl,
+                                          const char* prefix)const
+{
+   kwl.add(prefix,
+           VIEW_WIDTH_KW,
+           theViewWidthHeight.x,
+           true);
+   
+   kwl.add(prefix,
+           VIEW_HEIGHT_KW,
+           theViewWidthHeight.x,
+           true);
+   
+   kwl.add(prefix,
+           METER_GRID_SPACING_X_KW,
+           theMeterSpacing.x,
+           true);
+
+   kwl.add(prefix,
+           METER_GRID_SPACING_Y_KW,
+           theMeterSpacing.y,
+           true);
+   
+   kwl.add(prefix,
+           GEO_GRID_SPACING_LON_KW,
+           theGeographicSpacing.lon,
+           true);
+
+   kwl.add(prefix,
+           GEO_GRID_SPACING_LAT_KW,
+           theGeographicSpacing.lat,
+           true);
+
+   ossimString meterGridType = "line";
+   if(theMeterGridType == OSSIM_GRID_NONE)
+   {
+      meterGridType = "none";
+   }
+   else if(theMeterGridType == OSSIM_GRID_RESEAUX)
+   {
+      meterGridType = "reseaux";
+   }
+   
+   kwl.add(prefix,
+           METER_GRID_TYPE_KW,
+           meterGridType.c_str(),
+           true);
+
+   ossimString geoGridType = "line";
+   if(theGeographicGridType == OSSIM_GRID_NONE)
+   {
+      geoGridType = "none";
+   }
+   else if(theGeographicGridType == OSSIM_GRID_RESEAUX)
+   {
+      geoGridType = "reseaux";
+   }
+
+   kwl.add(prefix,
+           GEO_GRID_TYPE_KW,
+           geoGridType.c_str(),
+           true);
+
+   kwl.add(prefix,
+           TOP_BORDER_LENGTH_KW,
+           theTopBorderLength,
+           true);
+   
+   kwl.add(prefix,
+           BOTTOM_BORDER_LENGTH_KW,
+           theBottomBorderLength,
+           true);
+
+   kwl.add(prefix,
+           LEFT_BORDER_LENGTH_KW,
+           theLeftBorderLength,
+           true);
+
+   kwl.add(prefix,
+           RIGHT_BORDER_LENGTH_KW,
+           theRightBorderLength,
+           true);
+
+   kwl.add(prefix,
+           BORDER_COLOR_KW,
+           (ossimString::toString(theBorderColor.getR()) +" "+
+            ossimString::toString(theBorderColor.getG()) +" "+
+            ossimString::toString(theBorderColor.getB())).c_str(),
+           true);
+
+   kwl.add(prefix,
+           GEO_GRID_COLOR_KW,
+           (ossimString::toString(theGeographicGridColor.getR()) +" "+
+            ossimString::toString(theGeographicGridColor.getG()) +" "+
+            ossimString::toString(theGeographicGridColor.getB())).c_str(),
+           true);
+
+   kwl.add(prefix,
+           METER_GRID_COLOR_KW,
+           (ossimString::toString(theMeterGridColor.getR()) +" "+
+            ossimString::toString(theMeterGridColor.getG()) +" "+
+            ossimString::toString(theMeterGridColor.getB())).c_str(),
+           true);
+
+   kwl.add(prefix,
+           TITLE_STRING_KW,
+           theTitleString.c_str(),
+           true);
+   
+   kwl.add(prefix,
+           TITLE_COLOR_KW,
+           (ossimString::toString(theTitleColor.getR()) +" "+
+            ossimString::toString(theTitleColor.getG()) +" "+
+            ossimString::toString(theTitleColor.getB())).c_str(),
+           true);
+
+   kwl.add(prefix,
+           TOP_GEO_LABEL_COLOR_KW,
+           (ossimString::toString(theTopGeographicLabelColor.getR()) +" "+
+            ossimString::toString(theTopGeographicLabelColor.getG()) +" "+
+            ossimString::toString(theTopGeographicLabelColor.getB())).c_str(),
+           true);
+
+   kwl.add(prefix,
+           BOTTOM_GEO_LABEL_COLOR_KW,
+           (ossimString::toString(theBottomGeographicLabelColor.getR()) +" "+
+            ossimString::toString(theBottomGeographicLabelColor.getG()) +" "+
+            ossimString::toString(theBottomGeographicLabelColor.getB())).c_str(),
+           true);
+   kwl.add(prefix,
+           LEFT_GEO_LABEL_COLOR_KW,
+           (ossimString::toString(theLeftGeographicLabelColor.getR()) +" "+
+            ossimString::toString(theLeftGeographicLabelColor.getG()) +" "+
+            ossimString::toString(theLeftGeographicLabelColor.getB())).c_str(),
+           true);
+   kwl.add(prefix,
+           RIGHT_GEO_LABEL_COLOR_KW,
+           (ossimString::toString(theRightGeographicLabelColor.getR()) +" "+
+            ossimString::toString(theRightGeographicLabelColor.getG()) +" "+
+            ossimString::toString(theRightGeographicLabelColor.getB())).c_str(),
+           true);
+
+   kwl.add(prefix,
+           TOP_GEO_LABEL_FORMAT_KW,
+           theTopGeographicFormat,
+           true);
+
+   kwl.add(prefix,
+           BOTTOM_GEO_LABEL_FORMAT_KW,
+           theBottomGeographicFormat,
+           true);
+   kwl.add(prefix,
+           LEFT_GEO_LABEL_FORMAT_KW,
+           theLeftGeographicFormat,
+           true);
+   kwl.add(prefix,
+           RIGHT_GEO_LABEL_FORMAT_KW,
+           theRightGeographicFormat,
+           true);
+
+   kwl.add(prefix,
+           TOP_GEO_LABEL_FLAG_KW,
+           (int)theTopGeographicLabelFlag,
+           true);
+
+   kwl.add(prefix,
+           BOTTOM_GEO_LABEL_FLAG_KW,
+           (int)theBottomGeographicLabelFlag,
+           true);
+
+   kwl.add(prefix,
+           LEFT_GEO_LABEL_FLAG_KW,
+           (int)theLeftGeographicLabelFlag,
+           true);
+
+   kwl.add(prefix,
+           RIGHT_GEO_LABEL_FLAG_KW,
+           (int)theRightGeographicLabelFlag,
+           true);
+
+   kwl.add(prefix,
+           TOP_METER_LABEL_COLOR_KW,
+           (ossimString::toString(theTopMeterLabelColor.getR()) +" "+
+            ossimString::toString(theTopMeterLabelColor.getG()) +" "+
+            ossimString::toString(theTopMeterLabelColor.getB())).c_str(),
+           true);
+
+   kwl.add(prefix,
+           BOTTOM_METER_LABEL_COLOR_KW,
+           (ossimString::toString(theBottomMeterLabelColor.getR()) +" "+
+            ossimString::toString(theBottomMeterLabelColor.getG()) +" "+
+            ossimString::toString(theBottomMeterLabelColor.getB())).c_str(),
+           true);
+   kwl.add(prefix,
+           LEFT_METER_LABEL_COLOR_KW,
+           (ossimString::toString(theLeftMeterLabelColor.getR()) +" "+
+            ossimString::toString(theLeftMeterLabelColor.getG()) +" "+
+            ossimString::toString(theLeftMeterLabelColor.getB())).c_str(),
+           true);
+   kwl.add(prefix,
+           RIGHT_METER_LABEL_COLOR_KW,
+           (ossimString::toString(theRightMeterLabelColor.getR()) +" "+
+            ossimString::toString(theRightMeterLabelColor.getG()) +" "+
+            ossimString::toString(theRightMeterLabelColor.getB())).c_str(),
+           true);
+
+
+   kwl.add(prefix,
+           TOP_METER_LABEL_FLAG_KW,
+           (int)theTopMeterLabelFlag,
+           true);
+
+   kwl.add(prefix,
+           BOTTOM_METER_LABEL_FLAG_KW,
+           (int)theBottomMeterLabelFlag,
+           true);
+
+   kwl.add(prefix,
+           LEFT_METER_LABEL_FLAG_KW,
+           (int)theLeftMeterLabelFlag,
+           true);
+
+   kwl.add(prefix,
+           RIGHT_METER_LABEL_FLAG_KW,
+           (int)theRightMeterLabelFlag,
+           true);
+   
+   theGeographicTopLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(TOP_GEO_LABEL_FONT_KW) + ".").c_str());
+   theGeographicBottomLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(BOTTOM_GEO_LABEL_FONT_KW) + ".").c_str());
+   theGeographicLeftLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(LEFT_GEO_LABEL_FONT_KW) + ".").c_str());
+   theGeographicRightLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(RIGHT_GEO_LABEL_FONT_KW) + ".").c_str());
+
+   theMeterTopLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(TOP_METER_LABEL_FONT_KW) + ".").c_str());
+   theMeterBottomLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(BOTTOM_METER_LABEL_FONT_KW) + ".").c_str());
+   theMeterLeftLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(LEFT_METER_LABEL_FONT_KW) + ".").c_str());
+   theMeterRightLabelFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(RIGHT_METER_LABEL_FONT_KW) + ".").c_str());
+   
+   theTitleFontInfo.saveState(kwl, (ossimString(prefix) + ossimString(TITLE_FONT_KW) + ".").c_str());
+   
+           
+   return ossimImageSource::saveState(kwl, prefix);
+   
+}
+
+bool ossimMapCompositionSource::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   const char* viewWidth            = kwl.find(prefix, VIEW_WIDTH_KW);
+   const char* viewHeight           = kwl.find(prefix, VIEW_HEIGHT_KW);
+   const char* meterGridSpacingX    = kwl.find(prefix, METER_GRID_SPACING_X_KW);
+   const char* meterGridSpacingY    = kwl.find(prefix, METER_GRID_SPACING_Y_KW);
+   const char* geoGridSpacingLon    = kwl.find(prefix, GEO_GRID_SPACING_LON_KW);
+   const char* geoGridSpacingLat    = kwl.find(prefix, GEO_GRID_SPACING_LAT_KW);
+   const char* meterGridType        = kwl.find(prefix, METER_GRID_TYPE_KW);
+   const char* geoGridType          = kwl.find(prefix, GEO_GRID_TYPE_KW);
+   const char* topBorderLength      = kwl.find(prefix, TOP_BORDER_LENGTH_KW);
+   const char* bottomBorderLength   = kwl.find(prefix, BOTTOM_BORDER_LENGTH_KW);
+   const char* leftBorderLength     = kwl.find(prefix, LEFT_BORDER_LENGTH_KW);
+   const char* rightBorderLength    = kwl.find(prefix, RIGHT_BORDER_LENGTH_KW);
+   
+   const char* borderColor          = kwl.find(prefix, BORDER_COLOR_KW);
+   const char* geoGridColor         = kwl.find(prefix, GEO_GRID_COLOR_KW);
+   const char* meterGridColor       = kwl.find(prefix, METER_GRID_COLOR_KW);
+   const char* titleString          = kwl.find(prefix, TITLE_STRING_KW);
+   const char* titleColor           = kwl.find(prefix, TITLE_COLOR_KW);
+
+   const char* topGeoLabelColor     = kwl.find(prefix, TOP_GEO_LABEL_COLOR_KW);
+   const char* bottomGeoLabelColor  = kwl.find(prefix, BOTTOM_GEO_LABEL_COLOR_KW);
+   const char* leftGeoLabelColor    = kwl.find(prefix, LEFT_GEO_LABEL_COLOR_KW);
+   const char* rightGeoLabelColor   = kwl.find(prefix, RIGHT_GEO_LABEL_COLOR_KW);
+
+   const char* topMeterLabelColor     = kwl.find(prefix, TOP_METER_LABEL_COLOR_KW);
+   const char* bottomMeterLabelColor  = kwl.find(prefix, BOTTOM_METER_LABEL_COLOR_KW);
+   const char* leftMeterLabelColor    = kwl.find(prefix, LEFT_METER_LABEL_COLOR_KW);
+   const char* rightMeterLabelColor   = kwl.find(prefix, RIGHT_METER_LABEL_COLOR_KW);
+   
+   const char* topGeoLabelFormat    = kwl.find(prefix, TOP_GEO_LABEL_FORMAT_KW);
+   const char* bottomGeoLabelFormat = kwl.find(prefix, BOTTOM_GEO_LABEL_FORMAT_KW);
+   const char* leftGeoLabelFormat   = kwl.find(prefix, LEFT_GEO_LABEL_FORMAT_KW);
+   const char* rightGeoLabelFormat  = kwl.find(prefix, RIGHT_GEO_LABEL_FORMAT_KW);
+
+   const char* topGeoLabelFlag      = kwl.find(prefix, TOP_GEO_LABEL_FLAG_KW);
+   const char* bottomGeoLabelFlag   = kwl.find(prefix, BOTTOM_GEO_LABEL_FLAG_KW);
+   const char* leftGeoLabelFlag     = kwl.find(prefix, LEFT_GEO_LABEL_FLAG_KW);
+   const char* rightGeoLabelFlag    = kwl.find(prefix, RIGHT_GEO_LABEL_FLAG_KW);
+
+   const char* topMeterLabelFlag    = kwl.find(prefix, TOP_METER_LABEL_FLAG_KW);
+   const char* bottomMeterLabelFlag = kwl.find(prefix, BOTTOM_METER_LABEL_FLAG_KW);
+   const char* leftMeterLabelFlag   = kwl.find(prefix, LEFT_METER_LABEL_FLAG_KW);
+   const char* rightMeterLabelFlag  = kwl.find(prefix, RIGHT_METER_LABEL_FLAG_KW);
+
+   deleteFixedAnnotations();
+   theViewWidthHeight.makeNan();
+   
+   if(viewWidth)
+   {
+      theViewWidthHeight.x = ossimString(viewWidth).toLong();
+   }
+   if(viewHeight)
+   {
+      theViewWidthHeight.y = ossimString(viewHeight).toLong();
+   }
+   
+   if(meterGridSpacingX)
+   {
+      theMeterSpacing.x = ossimString(meterGridSpacingX).toDouble();
+   }
+
+   if(meterGridSpacingY)
+   {
+      theMeterSpacing.y = ossimString(meterGridSpacingY).toDouble();
+   }
+   if(geoGridSpacingLon)
+   {
+      theGeographicSpacing.lon = ossimString(geoGridSpacingLon).toDouble();
+   }
+   if(geoGridSpacingLat)
+   {
+      theGeographicSpacing.lat = ossimString(geoGridSpacingLat).toDouble();
+   }
+   if(meterGridType)
+   {
+      ossimString type = ossimString(meterGridType).trim().downcase();
+      if(type == "reseaux")
+      {
+         theMeterGridType = OSSIM_GRID_RESEAUX;
+      }
+      else if(type == "line")
+      {
+         theMeterGridType = OSSIM_GRID_LINE;
+      }
+      else
+      {
+         theMeterGridType = OSSIM_GRID_NONE;
+      }
+   }
+
+   if(geoGridType)
+   {
+      ossimString type = ossimString(geoGridType).trim().downcase();
+      if(type == "reseaux")
+      {
+         theGeographicGridType = OSSIM_GRID_RESEAUX;
+      }
+      else if(type == "line")
+      {
+         theGeographicGridType = OSSIM_GRID_LINE;
+      }
+      else
+      {
+         theGeographicGridType = OSSIM_GRID_NONE;
+      }
+   }
+
+   if(topBorderLength)
+   {
+      theTopBorderLength = ossimString(topBorderLength).toULong();
+   }
+
+   if(bottomBorderLength)
+   {
+      theBottomBorderLength = ossimString(bottomBorderLength).toULong();
+   }
+   if(leftBorderLength)
+   {
+      theLeftBorderLength = ossimString(leftBorderLength).toULong();
+   }
+   if(rightBorderLength)
+   {
+      theRightBorderLength = ossimString(rightBorderLength).toULong();
+   }
+
+   if(borderColor)
+   {
+      istringstream in(borderColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+
+      theBorderColor = ossimRgbVector((ossim_uint8)r.toUInt32(), 
+                                      (ossim_uint8)g.toUInt32(), 
+                                      (ossim_uint8)b.toUInt32());
+   }
+
+   if(geoGridColor)
+   {
+      istringstream in(geoGridColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theGeographicGridColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(meterGridColor)
+   {
+      istringstream in(meterGridColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theMeterGridColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());      
+   }
+
+   if(titleString)
+   {
+      theTitleString = titleString;
+   }
+   
+   if(titleColor)
+   {
+      istringstream in(titleColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      
+      theTitleColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(topGeoLabelColor)
+   {
+      istringstream in(topGeoLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theTopGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(bottomGeoLabelColor)
+   {
+      istringstream in(bottomGeoLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theBottomGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(leftGeoLabelColor)
+   {
+      istringstream in(leftGeoLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+
+      theLeftGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(rightGeoLabelColor)
+   {
+      istringstream in(rightGeoLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theRightGeographicLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+
+/////
+   if(topMeterLabelColor)
+   {
+      istringstream in(topMeterLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theTopMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(bottomMeterLabelColor)
+   {
+      istringstream in(bottomMeterLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theBottomMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(leftMeterLabelColor)
+   {
+      istringstream in(leftMeterLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theLeftMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(rightMeterLabelColor)
+   {
+      istringstream in(rightMeterLabelColor);
+
+      ossimString r;
+      ossimString g;
+      ossimString b;
+      in >> r >> g >> b;
+      
+      theRightMeterLabelColor = ossimRgbVector((ossim_uint8)r.toUInt32(), (ossim_uint8)g.toUInt32(), (ossim_uint8)b.toUInt32());
+   }
+
+   if(topGeoLabelFormat)
+   {
+      theTopGeographicFormat = topGeoLabelFormat;
+   }
+   
+   if(bottomGeoLabelFormat)
+   {
+      theBottomGeographicFormat = bottomGeoLabelFormat;
+   }
+   
+   if(leftGeoLabelFormat)
+   {
+      theLeftGeographicFormat = leftGeoLabelFormat;
+   }
+   
+   if(rightGeoLabelFormat)
+   {
+      theRightGeographicFormat = rightGeoLabelFormat;
+   }
+
+   if(topGeoLabelFlag)
+   {
+      theTopGeographicLabelFlag = ossimString(topGeoLabelFlag).toBool();
+   }
+   if(bottomGeoLabelFlag)
+   {
+      theBottomGeographicLabelFlag = ossimString(bottomGeoLabelFlag).toBool();
+   }
+   if(leftGeoLabelFlag)
+   {
+      theLeftGeographicLabelFlag = ossimString(leftGeoLabelFlag).toBool();
+   }
+   if(rightGeoLabelFlag)
+   {
+      theRightGeographicLabelFlag = ossimString(rightGeoLabelFlag).toBool();
+   }
+
+   if(topMeterLabelFlag)
+   {
+      theTopMeterLabelFlag = ossimString(topMeterLabelFlag).toBool();
+   }
+   if(bottomMeterLabelFlag)
+   {
+      theBottomMeterLabelFlag = ossimString(bottomMeterLabelFlag).toBool();
+   }
+   if(leftMeterLabelFlag)
+   {
+      theLeftMeterLabelFlag = ossimString(leftMeterLabelFlag).toBool();
+   }
+   if(rightMeterLabelFlag)
+   {
+      theRightMeterLabelFlag = ossimString(rightMeterLabelFlag).toBool();
+   }
+   
+   theGeographicTopLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(TOP_GEO_LABEL_FONT_KW) + ".").c_str());
+   theGeographicBottomLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(BOTTOM_GEO_LABEL_FONT_KW) + ".").c_str());
+   theGeographicLeftLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(LEFT_GEO_LABEL_FONT_KW) + ".").c_str());
+   theGeographicRightLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(RIGHT_GEO_LABEL_FONT_KW) + ".").c_str());
+
+   theMeterTopLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(TOP_METER_LABEL_FONT_KW) + ".").c_str());
+   theMeterBottomLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(BOTTOM_METER_LABEL_FONT_KW) + ".").c_str());
+   theMeterLeftLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(LEFT_METER_LABEL_FONT_KW) + ".").c_str());
+   theMeterRightLabelFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(RIGHT_METER_LABEL_FONT_KW) + ".").c_str());
+   
+   theTitleFontInfo.loadState(kwl, (ossimString(prefix) + ossimString(TITLE_FONT_KW) + ".").c_str());
+   theTitleFont = ossimFontFactoryRegistry::instance()->createFont(theTitleFontInfo);
+   theGeographicTopLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicTopLabelFontInfo);
+   theGeographicBottomLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicBottomLabelFontInfo);
+   theGeographicLeftLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicLeftLabelFontInfo);
+   theGeographicRightLabelFont = ossimFontFactoryRegistry::instance()->createFont(theGeographicRightLabelFontInfo);
+
+   theMeterTopLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterTopLabelFontInfo);
+   theMeterBottomLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterBottomLabelFontInfo);
+   theMeterLeftLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterLeftLabelFontInfo);
+   theMeterRightLabelFont = ossimFontFactoryRegistry::instance()->createFont(theMeterRightLabelFontInfo);
+   
+   vector<ossimFontInformation> info;
+
+   
+   if(!theTitleFont)
+   {
+      theTitleFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theTitleFont->getFontInformation(info);
+      theTitleFontInfo = info[0];
+   }
+   if(!theGeographicTopLabelFont)
+   {
+      info.clear();
+      theGeographicTopLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theGeographicTopLabelFont->getFontInformation(info);
+      theGeographicTopLabelFontInfo = info[0];
+   }
+   if(!theGeographicBottomLabelFont)
+   {
+      info.clear();
+      theGeographicBottomLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theGeographicBottomLabelFont->getFontInformation(info);
+      theGeographicBottomLabelFontInfo = info[0];
+   }
+   if(!theGeographicLeftLabelFont)
+   {
+      info.clear();
+      theGeographicLeftLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theGeographicLeftLabelFont->getFontInformation(info);
+      theGeographicLeftLabelFontInfo = info[0];
+   }
+   if(!theGeographicRightLabelFont)
+   {
+      info.clear();
+      theGeographicRightLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theGeographicRightLabelFont->getFontInformation(info);
+      theGeographicRightLabelFontInfo = info[0];
+   }
+
+   if(!theMeterTopLabelFont)
+   {
+      info.clear();
+      theMeterTopLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theMeterTopLabelFont->getFontInformation(info);
+      theMeterTopLabelFontInfo = info[0];
+   }
+   if(!theMeterBottomLabelFont)
+   {
+      info.clear();
+      theMeterBottomLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theMeterBottomLabelFont->getFontInformation(info);
+      theMeterBottomLabelFontInfo = info[0];
+   }
+   if(!theMeterLeftLabelFont)
+   {
+      info.clear();
+      theMeterLeftLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theMeterLeftLabelFont->getFontInformation(info);
+      theMeterLeftLabelFontInfo = info[0];
+   }
+   if(!theMeterRightLabelFont)
+   {
+      info.clear();
+      theMeterRightLabelFont = (ossimFont*)ossimFontFactoryRegistry::instance()->getDefaultFont()->dup();
+      theMeterRightLabelFont->getFontInformation(info);
+      theMeterRightLabelFontInfo = info[0];
+   }
+
+   bool result =  ossimAnnotationSource::loadState(kwl,
+                                                   prefix);
+   layoutAnnotations();
+
+   return result;
+}
+
+ossimScalarType ossimMapCompositionSource::getOutputScalarType() const
+{
+   return OSSIM_UCHAR;
+}
+
+ossim_uint32 ossimMapCompositionSource::getNumberOfOutputBands() const
+{
+   return 3;
+}
+
+ossimIpt ossimMapCompositionSource::getViewWidthHeight()const
+{
+   return theViewWidthHeight;
+}
+
+void ossimMapCompositionSource::getViewWidthHeight(ossimIpt& widthHeight)const
+{
+   widthHeight = theViewWidthHeight;
+}
+
+void ossimMapCompositionSource::setViewWidthHeight(const ossimIpt& widthHeight)
+{
+   theViewWidthHeight = widthHeight;
+}
+
+ossim_int32 ossimMapCompositionSource::getTopBorderLength()const
+{
+   return theTopBorderLength;
+}
+
+ossim_int32 ossimMapCompositionSource::getBottomBorderLength()const
+{
+   return theBottomBorderLength;
+}
+
+ossim_int32 ossimMapCompositionSource::getLeftBorderLength()const
+{
+   return theLeftBorderLength;
+}
+
+ossim_int32 ossimMapCompositionSource::getRightBorderLength()const
+{
+   return theRightBorderLength;
+}
+
+void ossimMapCompositionSource::setTopBorderLength(ossim_int32 length)
+{
+   theTopBorderLength = length;
+}
+
+void ossimMapCompositionSource::setBottomBorderLength(ossim_int32 length)
+{
+   theBottomBorderLength = length;
+}
+
+void ossimMapCompositionSource::setLeftBorderLength(ossim_int32 length)
+{
+   theLeftBorderLength = length;
+}
+
+void ossimMapCompositionSource::setRightBorderLength(ossim_int32 length)
+{
+   theRightBorderLength = length;
+}
+
+void ossimMapCompositionSource::setGeographicSpacingLat(double value)
+{
+   theGeographicSpacing.lat = value;
+}
+
+void ossimMapCompositionSource::setGeographicSpacingLon(double value)
+{
+   theGeographicSpacing.lon = value;
+}
+
+void ossimMapCompositionSource::setMeterSpacingX(double value)
+{
+   theMeterSpacing.x = value;
+}
+
+void ossimMapCompositionSource::setMeterSpacingY(double value)
+{
+   theMeterSpacing.y = value;
+}
+
+void ossimMapCompositionSource::setMeterSpacing(double x, double y)
+{
+   theMeterSpacing.x = x;
+   theMeterSpacing.y = y;
+}
+
+void ossimMapCompositionSource::setGeographicSpacing(double lat, double lon)
+{
+   theGeographicSpacing.lat = lat;
+   theGeographicSpacing.lon = lon;
+}
+
+ossimDpt ossimMapCompositionSource::getGeographicSpacing()const
+{
+   return theGeographicSpacing;
+}
+
+ossimDpt ossimMapCompositionSource::getMeterSpacing()const
+{
+   return theMeterSpacing;
+}
+
+ossimString ossimMapCompositionSource::getTopGeographicLabelFormat()const
+{
+   return theTopGeographicFormat;
+}
+
+ossimString ossimMapCompositionSource::getBottomGeographicLabelFormat()const
+{
+   return theBottomGeographicFormat;
+}
+
+ossimString ossimMapCompositionSource::getLeftGeographicLabelFormat()const
+{
+   return theLeftGeographicFormat;
+}
+
+ossimString ossimMapCompositionSource::getRightGeographicLabelFormat()const
+{
+   return theRightGeographicFormat;
+}
+
+ossimString ossimMapCompositionSource::getTitle()const
+{
+   return theTitleString;
+}
+
+ossimRgbVector ossimMapCompositionSource::getTitleColor()const
+{
+   return theTitleColor;
+}
+
+void ossimMapCompositionSource::setTitleColor(const ossimRgbVector& color)
+{
+   if(theTitleColor != color)
+   {
+      theTitleColor = color;
+   }
+}
+
+void ossimMapCompositionSource::setTitle(const ossimString& s)
+{
+   if(theTitleString != s)
+   {
+      theTitleString = s;
+   }
+         
+}
+
+ossimFontInformation ossimMapCompositionSource::getTitleFont()const
+{
+   return theTitleFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getGeographicTopLabelFontInfo()const
+{
+   return theGeographicTopLabelFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getGeographicBottomLabelFontInfo()const
+{
+   return theGeographicBottomLabelFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getGeographicLeftLabelFontInfo()const
+{
+   return theGeographicLeftLabelFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getGeographicRightLabelFontInfo()const
+{
+   return theGeographicRightLabelFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getMeterTopLabelFontInfo()const
+{
+   return theMeterTopLabelFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getMeterBottomLabelFontInfo()const
+{
+   return theMeterBottomLabelFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getMeterLeftLabelFontInfo()const
+{
+   return theMeterLeftLabelFontInfo;
+}
+
+ossimFontInformation ossimMapCompositionSource::getMeterRightLabelFontInfo()const
+{
+   return theMeterRightLabelFontInfo;
+}
+   
+ossimRgbVector ossimMapCompositionSource::getBorderColor()const
+{
+   return theBorderColor;
+}
+
+void ossimMapCompositionSource::setBorderColor(const ossimRgbVector& color)
+{
+   theBorderColor=color;
+}
+
+ossimRgbVector ossimMapCompositionSource::getGeographicGridColor()const
+{
+   return theGeographicGridColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getMeterGridColor()const
+{
+   return theMeterGridColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getTopGeographicLabelColor()const
+{
+   return theTopGeographicLabelColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getBottomGeographicLabelColor()const
+{
+   return theBottomGeographicLabelColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getLeftGeographicLabelColor()const
+{
+   return theLeftGeographicLabelColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getRightGeographicLabelColor()const
+{
+   return theRightGeographicLabelColor;
+}
+
+void ossimMapCompositionSource::setGeographicGridColor(const ossimRgbVector& color)
+{
+   theGeographicGridColor = color;
+}
+
+void ossimMapCompositionSource::setTopGeographicLabelColor(const ossimRgbVector& color)
+{
+   theTopGeographicLabelColor = color;
+}
+
+void ossimMapCompositionSource::setBottomGeographicLabelColor(const ossimRgbVector& color)
+{
+   theBottomGeographicLabelColor = color;
+}
+
+void ossimMapCompositionSource::setLeftGeographicLabelColor(const ossimRgbVector& color)
+{
+   theLeftGeographicLabelColor = color;
+}
+
+void ossimMapCompositionSource::setRightGeographicLabelColor(const ossimRgbVector& color)
+{
+   theRightGeographicLabelColor = color;
+}
+
+void ossimMapCompositionSource::setGeographicLabelColor(const ossimRgbVector& color)
+{
+   setTopGeographicLabelColor(color);
+   setBottomGeographicLabelColor(color);
+   setLeftGeographicLabelColor(color);
+   setRightGeographicLabelColor(color);
+}
+
+ossimRgbVector ossimMapCompositionSource::getTopMeterLabelColor()const
+{
+   return theTopMeterLabelColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getBottomMeterLabelColor()const
+{
+   return theBottomMeterLabelColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getLeftMeterLabelColor()const
+{
+   return theLeftMeterLabelColor;
+}
+
+ossimRgbVector ossimMapCompositionSource::getRightMeterLabelColor()const
+{
+   return theRightMeterLabelColor;
+}
+   
+void ossimMapCompositionSource::setTopMeterLabelColor(const ossimRgbVector& color)
+{
+   theTopMeterLabelColor = color;
+}
+
+void ossimMapCompositionSource::setBottomMeterLabelColor(const ossimRgbVector& color)
+{
+   theBottomMeterLabelColor = color;
+}
+
+void ossimMapCompositionSource::setLeftMeterLabelColor(const ossimRgbVector& color)
+{
+   theLeftMeterLabelColor = color;
+}
+
+void ossimMapCompositionSource::setRightMeterLabelColor(const ossimRgbVector& color)
+{
+   theRightMeterLabelColor = color;
+}
+
+void ossimMapCompositionSource::setMeterLabelColor(const ossimRgbVector& color)
+{
+   setTopMeterLabelColor(color);
+   setBottomMeterLabelColor(color);
+   setLeftMeterLabelColor(color);
+   setRightMeterLabelColor(color);
+}
+   
+void ossimMapCompositionSource::setMeterGridColor(const ossimRgbVector& color)
+{
+   theMeterGridColor = color;
+}
+
+void ossimMapCompositionSource::setMeterGridType(ossimGridLineType gridType)
+{
+   theMeterGridType = gridType;
+}
+
+void ossimMapCompositionSource::setGeographicGridType(ossimGridLineType gridType)
+{
+   theGeographicGridType = gridType;
+}
+
+void ossimMapCompositionSource::setBorderColor(ossimRgbVector& color)
+{
+   theBorderColor = color;
+}
+
+ossimMapCompositionSource::ossimGridLineType ossimMapCompositionSource::getGeographicGridType()const
+{
+   return theGeographicGridType;
+}
+
+ossimMapCompositionSource::ossimGridLineType ossimMapCompositionSource::getMeterGridType()const
+{
+   return theMeterGridType;
+}
+ 
+void ossimMapCompositionSource::setGeographicTickMarkFlag(bool flag)
+{
+   setTopGeographicTickMarkFlag(flag);
+   setBottomGeographicTickMarkFlag(flag);
+   setLeftGeographicTickMarkFlag(flag);
+   setRightGeographicTickMarkFlag(flag);
+}
+
+void ossimMapCompositionSource::setTopGeographicTickMarkFlag(bool flag)
+{
+   theTopGeographicTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setBottomGeographicTickMarkFlag(bool flag)
+{
+   theBottomGeographicTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setLeftGeographicTickMarkFlag(bool flag)
+{
+   theLeftGeographicTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setRightGeographicTickMarkFlag(bool flag)
+{
+   theRightGeographicTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setTopGeographicLabelFlag(bool flag)
+{
+   theTopGeographicLabelFlag = flag;
+}
+
+void ossimMapCompositionSource::setBottomGeographicLabelFlag(bool flag)
+{
+   theBottomGeographicLabelFlag = flag;
+}
+
+void ossimMapCompositionSource::setLeftGeographicLabelFlag(bool flag)
+{
+   theLeftGeographicLabelFlag = flag;
+}
+
+void ossimMapCompositionSource::setRightGeographicLabelFlag(bool flag)
+{
+   theRightGeographicLabelFlag = flag;
+}
+
+bool ossimMapCompositionSource::getTopGeographicTickMarkFlag()const
+{
+   return theTopGeographicTickFlag;
+}
+
+bool ossimMapCompositionSource::getBottomGeographicTickMarkFlag()const
+{
+   return theBottomGeographicTickFlag;
+}
+
+bool ossimMapCompositionSource::getLeftGeographicTickMarkFlag()const
+{
+   return theLeftGeographicTickFlag;
+}
+
+bool ossimMapCompositionSource::getRightGeographicTickMarkFlag()const
+{
+   return theRightGeographicTickFlag;
+}
+
+bool ossimMapCompositionSource::getTopGeographicLabelFlag()const
+{
+   return theTopGeographicLabelFlag;
+}
+
+bool ossimMapCompositionSource::getBottomGeographicLabelFlag()const
+{
+   return theBottomGeographicLabelFlag;
+}
+
+bool ossimMapCompositionSource::getLeftGeographicLabelFlag()const
+{
+   return theLeftGeographicLabelFlag;
+}
+
+bool ossimMapCompositionSource::getRightGeographicLabelFlag()const
+{
+   return theRightGeographicLabelFlag;
+}
+
+void ossimMapCompositionSource::setMeterTickMarkFlag(bool flag)
+{
+   setTopMeterTickMarkFlag(flag);
+   setBottomMeterTickMarkFlag(flag);
+   setLeftMeterTickMarkFlag(flag);
+   setRightMeterTickMarkFlag(flag);
+}
+
+void ossimMapCompositionSource::setTopMeterTickMarkFlag(bool flag)
+{
+   theTopMeterTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setBottomMeterTickMarkFlag(bool flag)
+{
+   theBottomMeterTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setLeftMeterTickMarkFlag(bool flag)
+{
+   theLeftMeterTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setRightMeterTickMarkFlag(bool flag)
+{
+   theRightMeterTickFlag = flag;
+}
+
+void ossimMapCompositionSource::setTopMeterLabelFlag(bool flag)
+{
+   theTopMeterLabelFlag = flag;
+}
+
+void ossimMapCompositionSource::setBottomMeterLabelFlag(bool flag)
+{
+   theBottomMeterLabelFlag = flag;
+}
+
+void ossimMapCompositionSource::setLeftMeterLabelFlag(bool flag)
+{
+   theLeftMeterLabelFlag = flag;
+}
+
+void ossimMapCompositionSource::setRightMeterLabelFlag(bool flag)
+{
+   theRightMeterLabelFlag = flag;
+}
+   
+bool ossimMapCompositionSource::getTopMeterTickMarkFlag()const
+{
+   return theTopMeterTickFlag;
+}
+
+bool ossimMapCompositionSource::getBottomMeterTickMarkFlag()const
+{
+   return theBottomMeterTickFlag;
+}
+
+bool ossimMapCompositionSource::getLeftMeterTickMarkFlag()const
+{
+   return theLeftMeterTickFlag;
+}
+
+bool ossimMapCompositionSource::getRightMeterTickMarkFlag()const
+{
+   return theRightMeterTickFlag;
+}
+
+bool ossimMapCompositionSource::getTopMeterLabelFlag()const
+{
+   return theTopMeterLabelFlag;
+}
+
+bool ossimMapCompositionSource::getBottomMeterLabelFlag()const
+{
+   return theBottomMeterLabelFlag;
+}
+
+bool ossimMapCompositionSource::getLeftMeterLabelFlag()const
+{
+   return theLeftMeterLabelFlag;
+}
+
+bool ossimMapCompositionSource::getRightMeterLabelFlag()const
+{
+   return theRightMeterLabelFlag;
+}
+
+void ossimMapCompositionSource::addFixedAnnotation(ossimAnnotationObject* obj)
+{
+   if(obj)
+   {
+      theFixedAnnotationList.push_back(obj);
+   }
+}
+
+//**************************************************************************************************
+//! Fetches the input connection's image geometry and verifies that it is a map projection.
+//! Returns NULL if no valid projection found.
+//**************************************************************************************************
+const ossimMapProjection* ossimMapCompositionSource::inputMapProjection() const
+{
+   if (!theInputConnection)
+      return 0;
+
+   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
+   if (!inputGeom)
+      return 0;
+
+   return PTR_CAST(ossimMapProjection, inputGeom->getProjection());
+}
+
diff --git a/src/imaging/ossimMaskFilter.cpp b/src/imaging/ossimMaskFilter.cpp
new file mode 100644
index 0000000..ab46a60
--- /dev/null
+++ b/src/imaging/ossimMaskFilter.cpp
@@ -0,0 +1,878 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// Modified by: Elan Sharghi (1/20/2009)
+// Description: Class definition for ossimMaskFilter.
+//
+//*************************************************************************
+// $Id: ossimMaskFilter.cpp 20409 2011-12-22 16:57:05Z dburken $
+
+#include <ossim/imaging/ossimMaskFilter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+
+static const char * MASK_FILTER_MASK_TYPE_KW = "mask_type";
+
+RTTI_DEF1(ossimMaskFilter, "ossimMaskFilter", ossimImageSource);
+
+ossimMaskFilter::ossimMaskFilter(ossimObject* owner)
+   :
+   ossimImageSource(owner, 1, 1, true, false),
+   theMaskType(OSSIM_MASK_TYPE_SELECT),
+   theTile(0)
+{
+}
+
+ossimMaskFilter::~ossimMaskFilter()
+{
+}
+
+//*************************************************************************************************
+void ossimMaskFilter::setMaskSource(ossimImageSource* maskSource)
+{
+   theMaskSource = maskSource;
+}
+
+ossimRefPtr<ossimImageData> ossimMaskFilter::getTile(const ossimIrect& rect,
+                                                     ossim_uint32 resLevel)
+{
+   ossimImageSource* imageSource = PTR_CAST(ossimImageSource, getInput(0));
+   if (!imageSource || !theMaskSource.valid())
+   {
+      ossimRefPtr<ossimImageData>();
+      return theTile;
+   }
+
+   ossimRefPtr<ossimImageData> imageSourceData;
+   ossimRefPtr<ossimImageData> maskSourceData;
+   
+   imageSourceData = imageSource->getTile(rect, resLevel);
+   if(!isSourceEnabled())
+      return imageSourceData;
+   
+   if (!theTile.valid())
+      allocate();
+
+   maskSourceData = theMaskSource->getTile(rect, resLevel);
+   if(!imageSourceData.valid() || !theTile.valid())
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+   
+   theTile->setOrigin(rect.ul());
+   if(theTile->getImageRectangle() != rect)
+   {
+      theTile->setImageRectangle(rect);
+      theTile->initialize();
+   }
+   if(!imageSourceData.valid())
+   {
+      return theTile;
+   }
+   if(!maskSourceData.valid()) 
+   {
+      return imageSourceData;
+   }
+   
+   if(imageSourceData->getDataObjectStatus() != OSSIM_NULL)
+   {
+      return executeMaskFilter(imageSourceData, maskSourceData);  
+   }
+   
+   return theTile;
+}
+
+bool ossimMaskFilter::canConnectMyInputTo(ossim_int32 /* index */,
+                                          const ossimConnectableObject* object)const
+{
+   return (PTR_CAST(ossimImageSource, object)!= 0);
+}
+
+void ossimMaskFilter::initialize()
+{
+   if(getInput(0))
+   {
+      // Force an allocate on the next getTile.
+      theTile = 0;
+   }
+}
+
+void ossimMaskFilter::allocate()
+{
+   if(getInput())
+   {
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilter(
+   ossimRefPtr<ossimImageData> imageSourceData,
+   ossimRefPtr<ossimImageData> maskSourceData)
+{
+   if(!theTile)
+   {
+      theTile = (ossimImageData*)imageSourceData->dup();
+      if(!theTile->getBuf())
+      {
+         theTile->initialize();
+      }
+   }
+   else
+   {
+      ossim_uint32 tw = theTile->getWidth();
+      ossim_uint32 th = theTile->getHeight();
+      ossim_uint32 dw = imageSourceData->getWidth();
+      ossim_uint32 dh = imageSourceData->getHeight();
+      
+      theTile->setWidthHeight(imageSourceData->getWidth(),
+			      imageSourceData->getHeight());
+      theTile->setOrigin(imageSourceData->getOrigin());
+      if((tw*th) != (dw*dh))
+      {
+         theTile->initialize();
+      }
+      theTile->setDataObjectStatus(imageSourceData->getDataObjectStatus());
+   }
+   theTile->loadTile(imageSourceData.get());
+   theTile->setDataObjectStatus(imageSourceData->getDataObjectStatus());
+   switch(theMaskType)
+   {
+      case OSSIM_MASK_TYPE_SELECT:
+      case OSSIM_MASK_TYPE_SELECT_CLAMP_MIN:
+      {
+         return executeMaskFilterSelect(theTile, maskSourceData);
+      }
+      case OSSIM_MASK_TYPE_INVERT:
+      {
+         return executeMaskFilterInvertSelect(theTile, maskSourceData);
+      }
+      case OSSIM_MASK_TYPE_WEIGHTED:
+      {
+         return executeMaskFilterWeighted(theTile, maskSourceData);
+      }
+      case OSSIM_MASK_TYPE_BINARY:
+      case OSSIM_MASK_TYPE_BINARY_INVERSE:
+      {
+         return executeMaskFilterBinary(theTile, maskSourceData);
+      }
+   }
+   
+   return imageSourceData;
+}
+
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelect(
+   ossimRefPtr<ossimImageData> imageSourceData,
+   ossimRefPtr<ossimImageData> maskSourceData)
+{
+   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
+      return imageSourceData;
+   }
+
+   switch(imageSourceData->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      executeMaskFilterSelection((ossim_uint8)0,
+                                 (ossim_uint8)0,
+                                 imageSourceData,
+                                 maskSourceData);
+      break;
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_USHORT16:
+   {
+      executeMaskFilterSelection((ossim_uint16)0,
+                                 (ossim_uint8)0,
+                                 imageSourceData,
+                                 maskSourceData);
+      break;
+   }
+   case OSSIM_SSHORT16:
+   {
+      executeMaskFilterSelection((ossim_sint16)0,
+                                 (ossim_uint8)0,
+                                 imageSourceData,
+                                 maskSourceData);
+      break;
+   }
+   case OSSIM_FLOAT:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      executeMaskFilterSelection((float)0,
+                                 (ossim_uint8)0,
+                                 imageSourceData,
+                                 maskSourceData);
+      break;
+   }
+   case OSSIM_DOUBLE:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      executeMaskFilterSelection((double)0,
+                                 (ossim_uint8)0,
+                                 imageSourceData,
+                                 maskSourceData);
+      break;
+   }
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
+      break;
+   }   
+   }
+
+   return theTile;
+}
+
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterInvertSelect(ossimRefPtr<ossimImageData> imageSourceData,
+                                                                           ossimRefPtr<ossimImageData> maskSourceData)
+{
+   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
+      return imageSourceData;
+   }
+
+   switch(imageSourceData->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      executeMaskFilterInvertSelection((ossim_uint8)0,
+                                       (ossim_uint8)0,
+                                       imageSourceData,
+                                       maskSourceData);
+      break;
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_USHORT16:
+   {
+      executeMaskFilterInvertSelection((ossim_uint16)0,
+                                       (ossim_uint8)0,
+                                       imageSourceData,
+                                       maskSourceData);
+      break;
+   }
+   case OSSIM_SSHORT16:
+   {
+      executeMaskFilterInvertSelection((ossim_sint16)0,
+                                       (ossim_uint8)0,
+                                       imageSourceData,
+                                       maskSourceData);
+      break;
+   }
+   case OSSIM_FLOAT:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      executeMaskFilterInvertSelection((float)0,
+                                       (ossim_uint8)0,
+                                       imageSourceData,
+                                       maskSourceData);
+      break;
+   }
+   case OSSIM_DOUBLE:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      executeMaskFilterInvertSelection((double)0,
+                                       (ossim_uint8)0,
+                                       imageSourceData,
+                                       maskSourceData);
+      break;
+   }
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
+      break;
+   }   
+   }
+
+   return theTile;
+}
+
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterWeighted(ossimRefPtr<ossimImageData> imageSourceData,
+                                                                       ossimRefPtr<ossimImageData> maskSourceData)
+{
+   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Only uchar masks are supported" << endl;
+      return imageSourceData;
+   }
+
+   switch(imageSourceData->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      executeMaskFilterWeighted((ossim_uint8)0,
+                                (ossim_uint8)0,
+                                imageSourceData,
+                                maskSourceData);
+      break;
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_USHORT16:
+   {
+      executeMaskFilterWeighted((ossim_uint16)0,
+                                (ossim_uint8)0,
+                                imageSourceData,
+                                maskSourceData);
+      break;
+   }
+   case OSSIM_SSHORT16:
+   {
+      executeMaskFilterWeighted((ossim_sint16)0,
+                                (ossim_uint8)0,
+                                imageSourceData,
+                                maskSourceData);
+      break;
+   }
+   case OSSIM_FLOAT:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      executeMaskFilterWeighted((float)0,
+                                (ossim_uint8)0,
+                                imageSourceData,
+                                maskSourceData);
+      break;
+   }
+   case OSSIM_DOUBLE:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      executeMaskFilterWeighted((double)0,
+                                (ossim_uint8)0,
+                                imageSourceData,
+                                maskSourceData);
+      break;
+   }
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterSelect WARNING: Unknown scalar type" << endl;
+      break;
+   }   
+   }
+
+   return theTile;
+}
+
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterBinary(
+   ossimRefPtr<ossimImageData> imageSourceData, ossimRefPtr<ossimImageData> maskSourceData)
+{
+   if(maskSourceData->getScalarType() != OSSIM_UCHAR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterBinary WARNING: Only uchar masks are supported" << endl;
+      return imageSourceData;
+   }
+   
+   switch(imageSourceData->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         executeMaskFilterBinarySelection((ossim_uint8)0,
+                                          (ossim_uint8)0,
+                                          imageSourceData,
+                                          maskSourceData);
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_USHORT16:
+      {
+         executeMaskFilterBinarySelection((ossim_uint16)0,
+                                          (ossim_uint8)0,
+                                          imageSourceData,
+                                          maskSourceData);
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         executeMaskFilterBinarySelection((ossim_sint16)0,
+                                          (ossim_uint8)0,
+                                          imageSourceData,
+                                          maskSourceData);
+         break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         executeMaskFilterBinarySelection((float)0,
+                                          (ossim_uint8)0,
+                                          imageSourceData,
+                                          maskSourceData);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         executeMaskFilterBinarySelection((double)0,
+                                          (ossim_uint8)0,
+                                          imageSourceData,
+                                          maskSourceData);
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimMaskFilter::executeMaskFilterBinary WARNING: Unknown scalar type" << endl;
+         break;
+      }
+   }
+
+   return theTile;
+}
+
+template <class inputT, class maskT>
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterSelection(
+   inputT /* dummyInput */,
+   maskT  /* dummyMask */,
+   ossimRefPtr<ossimImageData> imageSourceData,
+   ossimRefPtr<ossimImageData> maskSourceData)
+{
+   ossimDataObjectStatus maskDataStatus  = maskSourceData->getDataObjectStatus();
+   ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
+
+   // First just check if mask is full, which means pass the image source along untouched:
+   if (maskDataStatus == OSSIM_FULL)
+   {
+      theTile = imageSourceData;
+      return theTile;
+   }
+
+   // Then check for a total mask (all mask values are 0) and return empty tile if so:
+   if( (maskDataStatus == OSSIM_NULL) || (maskDataStatus == OSSIM_EMPTY))
+   {
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   // Finally check for blank source tile and return it if so:
+   if( (inputDataStatus == OSSIM_NULL) || (inputDataStatus == OSSIM_EMPTY))
+   {
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
+   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
+   if(maskBands&&inputBands)
+   {
+      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
+      for(ossim_uint32 band = 0; band < inputBands; ++band)
+      {
+         maskT*  bufMask = static_cast<maskT*> ( maskSourceData->getBuf() );
+         inputT* bufIn   = static_cast<inputT*>( imageSourceData->getBuf(band) );
+         inputT* bufOut  = static_cast<inputT*>( theTile->getBuf(band) );
+         inputT  nullPix = static_cast<inputT> ( theTile->getNullPix(band) );
+         inputT  minPix  = static_cast<inputT> ( theTile->getMinPix(band) );
+         ossim_uint32 offset = 0;
+         for(offset = 0; offset < maxOffset; ++offset)
+         {
+            if(*bufMask)
+            {
+               if ( theMaskType == OSSIM_MASK_TYPE_SELECT )
+               {
+                  *bufOut = *bufIn;
+               }
+               else
+               {
+                  //---
+                  // OSSIM_MASK_TYPE_SELECT_CLAMP_MIN
+                  // Use input pixel clamping any nulls to min.
+                  //---
+                  *bufOut = *bufIn != nullPix ? *bufIn : minPix;
+               }
+            }
+            else
+            {
+               *bufOut = nullPix;
+            }
+            ++bufOut;
+            ++bufIn;
+            ++bufMask;
+         }
+      }
+      theTile->validate();
+   }
+   
+   return theTile;
+}
+
+template <class inputT, class maskT>
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterInvertSelection(
+   inputT /* dummyInput */,
+   maskT  /* dummyMask */,
+   ossimRefPtr<ossimImageData> imageSourceData,
+   ossimRefPtr<ossimImageData> maskSourceData)
+{
+   ossimDataObjectStatus maskDataStatus  = maskSourceData->getDataObjectStatus();
+   ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
+
+   // First just check if mask is empty, which means pass the image source along untouched:
+   if( (maskDataStatus == OSSIM_NULL) || (maskDataStatus == OSSIM_EMPTY))
+   {
+      theTile = imageSourceData;
+      return theTile;
+   }
+
+   // Then check for a total mask (all mask values are 1) and return empty tile if so:
+   if (maskDataStatus == OSSIM_FULL)
+   {
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   // Finally check for blank source tile and return it if so:
+   if( (inputDataStatus == OSSIM_NULL) || (inputDataStatus == OSSIM_EMPTY))
+   {
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
+   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
+   if(maskBands&&inputBands)
+   {
+      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
+      for(ossim_uint32 band = 0; band < inputBands; ++band)
+      {
+         maskT*    bufMask = (maskT*)maskSourceData->getBuf();
+         inputT* bufIn     = (inputT*)imageSourceData->getBuf(band);
+         inputT* bufOut    = (inputT*)theTile->getBuf(band);
+         inputT  np        = (inputT)theTile->getNullPix(band);
+         ossim_uint32 offset = 0;
+         for(offset = 0; offset < maxOffset; ++offset)
+         {
+            if(!*bufMask)
+            {
+               *bufOut = *bufIn;
+            }
+            else
+            {
+               *bufOut = np;
+            }
+            ++bufOut;
+            ++bufIn;
+            ++bufMask;
+         }
+      }
+      theTile->validate();
+   }
+   
+   return theTile;
+}
+
+template <class inputT, class maskT>
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterWeighted(
+   inputT /* dummyInput */,
+   maskT  /* dummyMask */,
+   ossimRefPtr<ossimImageData> imageSourceData,
+   ossimRefPtr<ossimImageData> maskSourceData)
+{
+   ossimDataObjectStatus maskDataStatus  = maskSourceData->getDataObjectStatus();
+   ossimDataObjectStatus inputDataStatus = imageSourceData->getDataObjectStatus();
+
+   if( (maskDataStatus == OSSIM_NULL)||
+       (maskDataStatus == OSSIM_EMPTY))
+   {
+      theTile->makeBlank();
+      return theTile;
+   }
+   if( (inputDataStatus == OSSIM_NULL)||
+       (inputDataStatus == OSSIM_EMPTY))
+   {
+      return theTile;
+   }
+   
+   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
+   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
+   if(maskBands&&inputBands)
+   {
+      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
+      for(ossim_uint32 band = 0; band < inputBands; ++band)
+      {
+         maskT*    bufMask = (maskT*)maskSourceData->getBuf();
+         inputT* bufIn     = (inputT*)imageSourceData->getBuf(band);
+         inputT* bufOut    = (inputT*)theTile->getBuf(band);
+         inputT  np        = (inputT)theTile->getNullPix(band);
+         inputT  minp      = (inputT)theTile->getMinPix(band);
+         ossim_uint32 offset = 0;
+
+         if(inputDataStatus == OSSIM_PARTIAL)
+         {
+            for(offset = 0; offset < maxOffset; ++offset)
+            {
+               if(*bufIn != np)
+               {
+                  *bufOut = (inputT)((*bufIn)*((double)(*bufMask)/255.0));
+                  if((*bufOut != np)&&
+                     (*bufOut < minp))
+                  {
+                     *bufOut = minp;
+                  }
+               }
+               else
+               {
+                  *bufOut = np;
+               }
+               ++bufOut;
+               ++bufIn;
+               ++bufMask;
+            }
+         }
+         else
+         {
+            for(offset = 0; offset < maxOffset; ++offset)
+            {
+               *bufOut = (inputT)((*bufIn)*((double)(*bufMask)/255.0));
+               if((*bufOut != np)&&
+                  (*bufOut < minp))
+               {
+                  *bufOut = minp;
+               }
+               ++bufOut;
+               ++bufIn;
+               ++bufMask;
+            }
+         }
+      }
+      theTile->validate();
+   }
+   
+   return theTile;
+}
+
+template <class inputT, class maskT>
+ossimRefPtr<ossimImageData> ossimMaskFilter::executeMaskFilterBinarySelection(
+   inputT /* dummyInput */,
+   maskT  /* dummyMask  */ ,
+   ossimRefPtr<ossimImageData> imageSourceData,
+   ossimRefPtr<ossimImageData> maskSourceData)
+{
+   ossim_uint32 maskBands  = maskSourceData->getNumberOfBands();
+   ossim_uint32 inputBands = imageSourceData->getNumberOfBands();
+   if(maskBands&&inputBands)
+   {
+      ossim_uint32 maxOffset = theTile->getWidth()*theTile->getHeight();
+      for(ossim_uint32 band = 0; band < inputBands; ++band)
+      {
+         maskT*  bufMask   = (maskT*)maskSourceData->getBuf();
+         inputT* bufOut    = (inputT*)theTile->getBuf(band);
+         const inputT  NP  = (inputT)theTile->getNullPix(band);
+         const inputT  MP  = (inputT)theTile->getMaxPix(band);
+         ossim_uint32 offset = 0;
+         for(offset = 0; offset < maxOffset; ++offset)
+         {
+            if (theMaskType == OSSIM_MASK_TYPE_BINARY_INVERSE)
+            {
+               if(*bufMask)      // if mask == 1
+                  *bufOut = MP;  // set to max pix
+               else              // if mask == 0
+                  *bufOut = NP;  // set to null pix
+            }
+            else
+            {
+               if(*bufMask)      // if mask == 1
+                  *bufOut = NP;  // set to null pix
+               else              // if mask == 0
+                  *bufOut = MP;  // set to max pix
+            }
+            ++bufOut;
+            ++bufMask;
+         }
+      }
+      theTile->validate();
+   }
+   
+   return theTile;
+}
+
+void ossimMaskFilter::setMaskType(ossimFileSelectionMaskType type)
+{
+   theMaskType = type;
+}
+
+void ossimMaskFilter::setMaskType(const ossimString& type)
+{
+   if(type != "")
+   {
+      ossimString maskType = type;
+      maskType.downcase();
+
+      if(maskType == "select")
+      {
+         theMaskType = OSSIM_MASK_TYPE_SELECT;
+      }
+      else if(maskType == "invert")
+      {
+         theMaskType = OSSIM_MASK_TYPE_INVERT;
+      }
+      else if(maskType == "weighted")
+      {
+         theMaskType = OSSIM_MASK_TYPE_WEIGHTED;
+      }
+      else if(maskType == "binary")
+      {
+         theMaskType = OSSIM_MASK_TYPE_BINARY;
+      }
+      else if(maskType == "binary_inverse")
+      {
+         theMaskType = OSSIM_MASK_TYPE_BINARY_INVERSE;
+      }
+      else if(maskType == "select_clamp_min")
+      {
+         theMaskType = OSSIM_MASK_TYPE_SELECT_CLAMP_MIN;
+      } 
+   }
+}
+
+ossimMaskFilter::ossimFileSelectionMaskType ossimMaskFilter::getMaskType()const
+{
+   return theMaskType;
+}
+
+ossimString ossimMaskFilter::getMaskTypeString() const
+{
+   ossimString maskType;
+   
+   switch(theMaskType)
+   {
+      case OSSIM_MASK_TYPE_SELECT:
+      {
+         maskType = "select";
+         break;
+      }
+      case OSSIM_MASK_TYPE_INVERT:
+      {
+         maskType = "invert";
+         break;
+      }
+      case OSSIM_MASK_TYPE_WEIGHTED:
+      {
+         maskType = "weighted";
+         break;
+      }
+      case OSSIM_MASK_TYPE_BINARY:
+      {
+         maskType = "binary";
+         break;
+      }
+      case OSSIM_MASK_TYPE_BINARY_INVERSE:
+      {
+         maskType = "binary_inverse";
+         break;
+      }
+      case OSSIM_MASK_TYPE_SELECT_CLAMP_MIN:
+      {
+         maskType = "select_clamp_min";
+         break;
+      }
+   }
+
+   return maskType;
+}
+
+bool ossimMaskFilter::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   bool result = ossimImageSource::loadState(kwl, prefix);
+   
+   theInputListIsFixedFlag  = true;
+   theOutputListIsFixedFlag = false;
+   setNumberOfInputs(2);
+
+   const char* lookup = kwl.find(prefix, MASK_FILTER_MASK_TYPE_KW);
+   if (lookup)
+   {
+      setMaskType(ossimString(lookup));
+   }
+
+   return result;
+}
+
+bool ossimMaskFilter::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   kwl.add(prefix,
+           MASK_FILTER_MASK_TYPE_KW,
+           getMaskTypeString().c_str(),
+           true);
+   
+   return ossimImageSource::saveState(kwl, prefix);
+}
+
+void ossimMaskFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if( property.valid() )
+   {
+      if(property->getName() == MASK_FILTER_MASK_TYPE_KW)
+      {
+         setMaskType(property->valueToString());
+      }
+      else
+      {
+         ossimImageSource::setProperty(property);
+      }
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimMaskFilter::getProperty(
+   const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   
+   if(name == MASK_FILTER_MASK_TYPE_KW)
+   {
+      std::vector<ossimString> constraintList;
+      constraintList.push_back(ossimString("select"));
+      constraintList.push_back(ossimString("invert"));
+      constraintList.push_back(ossimString("weighted"));
+      
+      result = new ossimStringProperty(MASK_FILTER_MASK_TYPE_KW,
+                                       getMaskTypeString(),
+                                       false,
+                                       constraintList);
+   }
+   else
+   {
+      result = ossimImageSource::getProperty(name);
+   }
+   return result;
+}
+
+void ossimMaskFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSource::getPropertyNames(propertyNames);
+   propertyNames.push_back(MASK_FILTER_MASK_TYPE_KW);
+}
+
+ossim_uint32 ossimMaskFilter::getNumberOfInputBands() const
+{
+   ossimImageSource* img_source = PTR_CAST(ossimImageSource, getInput());
+   if (img_source)
+      return img_source->getNumberOfInputBands();
+   return 0;
+}
+
diff --git a/src/imaging/ossimMaxMosaic.cpp b/src/imaging/ossimMaxMosaic.cpp
new file mode 100644
index 0000000..573723d
--- /dev/null
+++ b/src/imaging/ossimMaxMosaic.cpp
@@ -0,0 +1,559 @@
+//*******************************************************************
+// Copyright (C) 2005 SANZ Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Kenneth Melero (kmelero at sanz.com)
+//
+// Description: This combiner is designed to "float" the maximum pixel value
+//              of all inputs to top of the mosaic output. 
+//
+//*************************************************************************
+// $Id: ossimMaxMosaic.cpp 23257 2015-04-13 16:57:14Z dburken $
+
+#include <ossim/imaging/ossimMaxMosaic.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimTrace.h>
+
+static const ossimTrace traceDebug("ossimMaxMosaic:debug");
+
+using namespace std;
+
+RTTI_DEF1(ossimMaxMosaic, "ossimMaxMosaic", ossimImageCombiner)
+ossimMaxMosaic::ossimMaxMosaic()
+   :ossimImageCombiner(),
+    theTile(NULL)
+{
+}
+
+ossimMaxMosaic::ossimMaxMosaic(ossimConnectableObject::ConnectableObjectList& inputSources)
+    : ossimImageCombiner(inputSources),
+      theTile(NULL)
+{
+}
+
+
+ossimMaxMosaic::~ossimMaxMosaic()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimMaxMosaic::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   long size = getNumberOfInputs();
+   ossim_uint32 layerIdx = 0;
+   // If there is only one in the mosaic then just return it.
+   if(size == 1)
+   {
+      return getNextTile(layerIdx, 0, tileRect, resLevel);
+   }
+   
+   ossimIpt origin = tileRect.ul();
+   ossim_uint32 w = tileRect.width();
+   ossim_uint32 h = tileRect.height();
+   
+   if(!theTile.valid())
+   {
+      // First time through...
+      allocate();
+
+      // If we still don't have a buffer then we will leave.
+      if(!theTile.valid())
+      {
+         return ossimRefPtr<ossimImageData>();
+      }
+   }
+   
+   ossim_uint32 tileW = theTile->getWidth();
+   ossim_uint32 tileH = theTile->getHeight();
+   if((w != tileW)||
+      (h != tileH))
+   {
+      theTile->setWidth(w);
+      theTile->setHeight(h);
+      if((w*h)!=(tileW*tileH))
+      {
+         theTile->initialize();
+      }
+   }
+   theTile->setOrigin(origin);
+
+   //---
+   // General Note:
+   //
+   // Note: I will not check for disabled or enabled since we have
+   // no clear way to handle this within a mosaic. The default will be
+   // to do a simple a A over B type mosaic.  Derived classes should
+   // check for the enabled and disabled and always
+   // use this default implementation if they are disabled.
+   //---
+   theTile->setOrigin(origin);
+   theTile->makeBlank();
+   switch(theTile->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint8>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint8>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT8:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint8>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint8>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_FLOAT: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<float>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<float>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint16>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint16>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SSHORT16:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint16>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint16>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_sint32>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_sint32>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_UINT32:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<ossim_uint32>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<ossim_uint32>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         if(!hasDifferentInputs())
+         {
+            return combine(static_cast<double>(0),
+                           tileRect,
+                           resLevel);
+         }
+         else
+         {
+            return combineNorm(static_cast<double>(0),
+                               tileRect,
+                               resLevel);
+         }
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Scalar type = " << theTile->getScalarType()
+            << " Not supported by ossimMaxMosaic" << endl;
+      }
+   }
+
+   return ossimRefPtr<ossimImageData>();
+}
+
+void ossimMaxMosaic::initialize()
+{
+  ossimImageCombiner::initialize();
+  theTile = NULL;
+}
+
+void ossimMaxMosaic::allocate()
+{
+   theTile = NULL;
+   
+   if( (getNumberOfInputs() > 0) && getInput(0) )
+   {
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+   }
+}
+
+bool ossimMaxMosaic::saveState(ossimKeywordlist& kwl,
+                                 const char* prefix)const
+{
+   return ossimImageCombiner::saveState(kwl, prefix);
+}
+
+bool ossimMaxMosaic::loadState(const ossimKeywordlist& kwl,
+                                 const char* prefix)
+{
+   return ossimImageCombiner::loadState(kwl, prefix);
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimMaxMosaic::combineNorm(
+   T,// dummy template variable 
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   ossimRefPtr<ossimImageData> destination = theTile;
+   
+   ossimRefPtr<ossimImageData> currentImageData =
+      getNextNormTile(layerIdx, 0, tileRect, resLevel);
+      
+   if(!currentImageData)
+   {
+      return currentImageData;
+   }
+   
+   std::vector<float*> srcBands(theLargestNumberOfInputBands); 
+   std::vector<float> srcBandsNullPix(theLargestNumberOfInputBands); 
+   std::vector<T*> destBands(theLargestNumberOfInputBands);
+   std::vector<T> destBandsNullPix(theLargestNumberOfInputBands);
+   std::vector<T> destBandsMinPix(theLargestNumberOfInputBands);
+   std::vector<T> destBandsMaxPix(theLargestNumberOfInputBands);
+   //float** srcBands        = new float*[theLargestNumberOfInputBands];
+   //float* srcBandsNullPix  = new float[theLargestNumberOfInputBands];
+   //T** destBands = new T*[theLargestNumberOfInputBands];
+   //T* destBandsNullPix = new T[theLargestNumberOfInputBands];
+   //T* destBandsMinPix = new T[theLargestNumberOfInputBands];
+   //T* destBandsMaxPix = new T[theLargestNumberOfInputBands];
+      
+   ossim_uint32 band;
+   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      srcBands[band]  = static_cast<float*>(currentImageData->getBuf(band));
+      srcBandsNullPix[band]  = static_cast<float>(currentImageData->getNullPix(band));
+      
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
+      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
+   }
+   // if the src is smaller than the destination in number
+   // of bands we will just duplicate the last band.
+   for(;band < theLargestNumberOfInputBands; ++band)
+   {
+      srcBands[band]  = static_cast<float*>(srcBands[minNumberOfBands - 1]);
+      srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(minNumberOfBands - 1));
+      
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+      destBandsMinPix[band] = static_cast<T>(theTile->getMinPix(band));
+      destBandsMaxPix[band] = static_cast<T>(theTile->getMaxPix(band));
+   }
+   // most of the time we will not overlap so let's
+   // copy the first tile into destination and check later.
+   //
+   ossim_uint32 tempBandIdx = 0;
+   for(band = 0; band < theTile->getNumberOfBands();++band)
+   {
+      if(band < currentImageData->getNumberOfBands())
+      {
+         theTile->copyNormalizedBufferToTile(band,
+                                             (float*)currentImageData->getBuf(band));
+         ++tempBandIdx;
+      }
+      else
+      {
+         if(tempBandIdx)
+         {
+            theTile->copyNormalizedBufferToTile(band,
+                                                (float*)currentImageData->getBuf(tempBandIdx-1));
+         }
+      }
+   }
+   destination->validate();
+   
+   currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+
+   while(currentImageData.valid())
+   {  
+      ossim_uint32 minNumberOfBands           = currentImageData->getNumberOfBands();
+      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
+      ossimDataObjectStatus destinationStatus = destination->getDataObjectStatus();
+      
+      if(destinationStatus == OSSIM_FULL)
+      {
+         return destination;
+      }
+      for(band = 0; band < minNumberOfBands; ++band)
+      {
+         srcBands[band]        = static_cast<float*>(currentImageData->getBuf(band));
+         srcBandsNullPix[band] = static_cast<float>(currentImageData->getNullPix(band));
+      }
+      // if the src is smaller than the destination in number
+      // of bands we will just duplicate the last band.
+      for(;band < theLargestNumberOfInputBands; ++band)
+      {
+         srcBands[band] = srcBands[minNumberOfBands - 1];
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      }
+
+      if((destinationStatus == OSSIM_EMPTY)&&
+         (currentStatus     != OSSIM_EMPTY)&&
+         (currentStatus     != OSSIM_NULL))
+      {
+         ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+         for(band=0; band < theLargestNumberOfInputBands; ++band)
+         {
+            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
+            float minP  = destBandsMinPix[band];
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               destBands[band][offset] = (T)( minP + delta*srcBands[band][offset]);
+            }
+         }
+      }
+      else if((destinationStatus == OSSIM_PARTIAL)&&
+              (currentStatus     != OSSIM_EMPTY)&&
+              (currentStatus     != OSSIM_NULL))
+      {
+         for(band = 0; band < theLargestNumberOfInputBands; ++band)
+         {
+            
+            float delta = destBandsMaxPix[band] - destBandsMinPix[band];
+            float minP  = destBandsMinPix[band];
+            for(ossim_uint32 offset = 0;
+                offset < upperBound;
+                ++offset)
+            {
+               
+               if(destBands[band][offset] == destBandsNullPix[band])
+               {
+                  destBands[band][offset] = (T)(minP + delta*srcBands[band][offset]);
+               }
+            }
+         }
+      }
+      destination->validate();
+      
+      currentImageData = getNextNormTile(layerIdx, tileRect, resLevel);
+   }
+   // Cleanup...
+  // delete [] srcBands;
+  // delete [] srcBandsNullPix;
+  // delete [] destBands;
+  // delete [] destBandsNullPix;
+  // delete [] destBandsMinPix;
+  // delete [] destBandsMaxPix;
+
+   return destination;
+}
+
+template <class T> ossimRefPtr<ossimImageData> ossimMaxMosaic::combine(
+   T,// dummy template variable 
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossim_uint32 layerIdx = 0;
+   ossimRefPtr<ossimImageData> destination = theTile;
+   
+   ossimRefPtr<ossimImageData> currentImageData = getNextTile(layerIdx, 0, tileRect, resLevel);
+   if(!currentImageData)
+   {   
+      return currentImageData;
+   }  
+
+   T** srcBands         = new T*[theLargestNumberOfInputBands];
+   T*  srcBandsNullPix  = new T[theLargestNumberOfInputBands];
+   T** destBands        = new T*[theLargestNumberOfInputBands];
+   T*  destBandsNullPix = new T[theLargestNumberOfInputBands];
+      
+   ossim_uint32 band;
+   ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+   ossim_uint32 bandIndex  = 0;
+
+   ossim_uint32 offset=0;
+   ossim_uint32 minNumberOfBands = currentImageData->getNumberOfBands();
+   for(band = 0; band < minNumberOfBands; ++band)
+   {
+      srcBands[band]  = static_cast<T*>(currentImageData->getBuf(band));
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      srcBandsNullPix[band]  = static_cast<T>(currentImageData->getNullPix(band));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+   }
+   // if the src is smaller than the destination in number
+   // of bands we will just duplicate the last band.
+   for(;band < theLargestNumberOfInputBands; ++band)
+   {
+      srcBands[band]  = static_cast<T*>(srcBands[minNumberOfBands - 1]);
+      destBands[band] = static_cast<T*>(theTile->getBuf(band));
+      srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      destBandsNullPix[band] = static_cast<T>(theTile->getNullPix(band));
+   }
+   // most of the time we will not overlap so let's
+   // copy the first tile into destination and check later.
+   //
+   for(band = 0; band < theTile->getNumberOfBands();++band)
+   {
+      T* destBand = destBands[band];
+      T* srcBand  = srcBands[band];
+      if(destBand&&srcBand)
+      {
+         for(offset = 0; offset < upperBound;++offset)
+         {
+            *destBand = *srcBand;
+            ++srcBand; ++destBand;
+         }
+      }
+   }
+   destination->setDataObjectStatus(currentImageData->getDataObjectStatus());
+
+   currentImageData = getNextTile(layerIdx,
+                                  tileRect,
+                                  resLevel);
+
+   while(currentImageData.valid())
+   {  
+      ossim_uint32 minNumberOfBands           = currentImageData->getNumberOfBands();
+      ossimDataObjectStatus currentStatus     = currentImageData->getDataObjectStatus();
+      ossimDataObjectStatus destinationStatus = destination->getDataObjectStatus();
+      
+      for(band = 0; band < minNumberOfBands; ++band)
+      {
+         srcBands[band]        = static_cast<T*>(currentImageData->getBuf(band));
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(band));
+      }
+      // if the src is smaller than the destination in number
+      // of bands we will just duplicate the last band.
+      for(;band < theLargestNumberOfInputBands; ++band)
+      {
+         srcBands[band] = srcBands[minNumberOfBands - 1];
+         srcBandsNullPix[band] = static_cast<T>(currentImageData->getNullPix(minNumberOfBands - 1));
+      }
+
+      if((destinationStatus == OSSIM_PARTIAL)&&
+	 (currentStatus     != OSSIM_EMPTY)&&
+	 (currentStatus     != OSSIM_NULL))
+      {
+         for(bandIndex = 0; bandIndex < theLargestNumberOfInputBands; ++bandIndex)
+         {
+	      
+            for(ossim_uint32 offset = 0;
+                offset < upperBound;
+                ++offset)
+            {
+               if(srcBands[bandIndex][offset] > destBands[bandIndex][offset])
+               {
+                  destBands[bandIndex][offset] = srcBands[bandIndex][offset];
+               }
+            }
+         }
+      }
+      else
+      {
+         ossim_uint32 upperBound = destination->getWidth()*destination->getHeight();
+         for(ossim_uint32 band=0; band < theLargestNumberOfInputBands; ++band)
+         {
+            for(ossim_uint32 offset = 0; offset < upperBound; ++offset)
+            {
+               if(srcBands[band][offset] > destBands[band][offset])
+               {
+                  destBands[band][offset] = srcBands[band][offset];
+               }
+            }
+         }
+      }
+      
+      destination->validate();
+      
+      currentImageData = getNextTile(layerIdx,tileRect, resLevel);
+   }
+   // Cleanup...
+   delete [] srcBands;
+   delete [] srcBandsNullPix;
+   delete [] destBands;
+   delete [] destBandsNullPix;
+   return destination;
+}
+
+ossimString ossimMaxMosaic::getShortName()const
+{
+   return ossimString("ossimMaxMosaic");
+}
+
+ossimString ossimMaxMosaic::getLongName()const
+{
+   return ossimString("Max Mosaic");
+}
+
+ossimString ossimMaxMosaic::getDescription()const
+{
+   return ossimString("Combiner which puts maximum dn value on image.");
+}
diff --git a/src/imaging/ossimMeanMedianFilter.cpp b/src/imaging/ossimMeanMedianFilter.cpp
new file mode 100644
index 0000000..e80e328
--- /dev/null
+++ b/src/imaging/ossimMeanMedianFilter.cpp
@@ -0,0 +1,934 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimMeanMedianFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimMeanMedianFilter.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <vector>
+#include <algorithm>
+#include <numeric>
+using namespace std;
+
+
+RTTI_DEF1(ossimMeanMedianFilter,
+          "ossimMeanMedianFilter",
+          ossimImageSourceFilter);
+
+// Keywords used throughout.
+static const ossimString WINDOW_SIZE_KW = "window_size";
+static const ossimString FILTER_TYPE_KW = "filter_type";
+static const ossimString AUTO_GROW_KW   = "auto_grow_rectangle_flag";
+
+ossimMeanMedianFilter::ossimMeanMedianFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theTile(0),
+    theFilterType(OSSIM_MEDIAN),
+    theWindowSize(3),
+    theEnableFillNullFlag(false),
+    theAutoGrowRectFlag(false)
+{
+   setDescription(ossimString("Mean Median Filter"));
+}
+
+ossimMeanMedianFilter::~ossimMeanMedianFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimMeanMedianFilter::getTile(
+   const ossimIrect& rect, ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getTile(rect, resLevel);
+   }
+
+   ossim_uint32 halfSize = getWindowSize()>>1;
+
+   ossimIrect requestRect(rect.ul().x - halfSize,
+                          rect.ul().y - halfSize,
+                          rect.lr().x + halfSize,
+                          rect.lr().y + halfSize);
+
+   ossimRefPtr<ossimImageData> inputData =
+      ossimImageSourceFilter::getTile(requestRect, resLevel);
+   if(!inputData.valid() || !inputData->getBuf())
+   {
+      return inputData;
+   }
+
+   if(!theTile.valid())
+   {
+      theTile = (ossimImageData*)inputData->dup();
+      theTile->setImageRectangle(rect);
+   }
+   else
+   {
+      theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
+   }
+
+   applyFilter(inputData);
+
+   theTile->setDataObjectStatus(inputData->getDataObjectStatus());
+   if(theEnableFillNullFlag)
+   {
+      theTile->validate();
+   }
+
+   return theTile;
+}
+
+void ossimMeanMedianFilter::setWindowSize(ossim_uint32 windowSize)
+{
+   theWindowSize = windowSize;
+}
+
+ossim_uint32 ossimMeanMedianFilter::getWindowSize()const
+{
+   return theWindowSize;
+}
+
+void ossimMeanMedianFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   theTile = NULL;
+}
+
+void ossimMeanMedianFilter::applyFilter(ossimRefPtr<ossimImageData>& input)
+{
+   switch(input->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         switch (theFilterType)
+         {
+            case OSSIM_MEDIAN:
+            case OSSIM_MEDIAN_FILL_NULLS:
+               applyMedian(ossim_uint8(0), input);
+               break;
+               
+            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
+               applyMedianNullCenterOnly(ossim_uint8(0), input);
+               break;
+               
+            case OSSIM_MEAN:
+            case OSSIM_MEAN_FILL_NULLS:
+               applyMean(ossim_uint8(0), input);
+               break;
+
+            case OSSIM_MEAN_NULL_CENTER_ONLY:
+               applyMeanNullCenterOnly(ossim_uint8(0), input);
+               
+            default:
+               break;
+         }
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         switch (theFilterType)
+         {
+            case OSSIM_MEDIAN:
+            case OSSIM_MEDIAN_FILL_NULLS:
+               applyMedian(ossim_uint16(0), input);
+               break;
+               
+            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
+               applyMedianNullCenterOnly(ossim_uint16(0), input);
+               break;
+               
+            case OSSIM_MEAN:
+            case OSSIM_MEAN_FILL_NULLS:
+               applyMean(ossim_uint16(0), input);
+               break;
+
+            case OSSIM_MEAN_NULL_CENTER_ONLY:
+               applyMeanNullCenterOnly(ossim_uint16(0), input);
+               break;
+               
+            default:
+               break;
+         }
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         switch (theFilterType)
+         {
+            case OSSIM_MEDIAN:
+            case OSSIM_MEDIAN_FILL_NULLS:
+               applyMedian(ossim_sint16(0), input);
+               break;
+               
+            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
+               applyMedianNullCenterOnly(ossim_sint16(0), input);
+               break;
+               
+            case OSSIM_MEAN:
+            case OSSIM_MEAN_FILL_NULLS:
+               applyMean(ossim_sint16(0), input);
+               break;
+
+            case OSSIM_MEAN_NULL_CENTER_ONLY:
+               applyMeanNullCenterOnly(ossim_sint16(0), input);
+               break;
+               
+            default:
+               break;
+         }
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         switch (theFilterType)
+         {
+            case OSSIM_MEDIAN:
+            case OSSIM_MEDIAN_FILL_NULLS:
+               applyMedian(ossim_uint32(0), input);
+               break;
+               
+            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
+               applyMedianNullCenterOnly(ossim_uint32(0), input);
+               break;
+               
+            case OSSIM_MEAN:
+            case OSSIM_MEAN_FILL_NULLS:
+               applyMean(ossim_uint32(0), input);
+               break;
+
+            case OSSIM_MEAN_NULL_CENTER_ONLY:
+               applyMeanNullCenterOnly(ossim_uint32(0), input);
+               break;
+               
+            default:
+               break;
+         }
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         switch (theFilterType)
+         {
+            case OSSIM_MEDIAN:
+            case OSSIM_MEDIAN_FILL_NULLS:
+               applyMedian(ossim_float32(0.0), input);
+               break;
+               
+            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
+               applyMedianNullCenterOnly(ossim_float32(0.0), input);
+               break;
+               
+            case OSSIM_MEAN:
+            case OSSIM_MEAN_FILL_NULLS:
+               applyMean(ossim_float32(0.0), input);
+               break;
+
+            case OSSIM_MEAN_NULL_CENTER_ONLY:
+               applyMeanNullCenterOnly(ossim_float32(0.0), input);
+               break;
+               
+            default:
+               break;
+         }
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         switch (theFilterType)
+         {
+            case OSSIM_MEDIAN:
+            case OSSIM_MEDIAN_FILL_NULLS:
+               applyMedian(ossim_float64(0.0), input);
+               break;
+               
+            case OSSIM_MEDIAN_NULL_CENTER_ONLY:
+               applyMedianNullCenterOnly(ossim_float64(0.0), input);
+               break;
+               
+            case OSSIM_MEAN:
+            case OSSIM_MEAN_FILL_NULLS:
+               applyMean(ossim_float64(0.0), input);
+               break;
+
+            case OSSIM_MEAN_NULL_CENTER_ONLY:
+               applyMeanNullCenterOnly(ossim_float64(0.0), input);
+               break;
+               
+            default:
+               break;
+         }
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimMeanMedianFilter::applyFilter WARNING:\n"
+            << "Unhandled scalar type!" << endl;
+      }
+   }
+}
+
+template <class T>
+void ossimMeanMedianFilter::applyMean(T /* dummyVariable */,
+                                      ossimRefPtr<ossimImageData>& inputData)
+{
+   ossim_uint32 halfWindow = (theWindowSize >> 1);
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 kernelX   = 0;
+   ossim_uint32 kernelY   = 0;
+   ossim_uint32 kernelIdx = 0;
+   ossim_uint32 iw  = inputData->getWidth();
+   ossim_uint32 ow  = theTile->getWidth();
+   ossim_uint32 oh = theTile->getHeight();
+   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
+                                         inputData->getNumberOfBands());
+   ossimDataObjectStatus status = inputData->getDataObjectStatus();
+   std::vector<double> values(theWindowSize*theWindowSize);
+
+   if(status == OSSIM_FULL)
+   {
+      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+      {
+         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+
+         if(inputBuf&&outputBuf)
+         {
+            for(y = 0; y < oh; ++y)
+            {
+               for(x = 0; x < ow; ++x)
+               {
+                  kernelIdx = 0;
+                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
+                  {
+                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
+                     {
+                        values[kernelIdx] = *(inputBuf+kernelX + kernelY*iw);
+                        ++kernelIdx;
+                     }
+                  }
+
+
+                  if(values.size() > 0)
+                  {
+                     double sum = std::accumulate(values.begin(),
+                                                  values.end(),
+                                                  0.0);
+                     double average = sum/(double)values.size();
+                     (*outputBuf) = (T)average;
+                  }
+                  ++inputBuf;
+                  ++outputBuf;
+               }
+
+               inputBuf+=(halfWindow<<1);
+            }
+         }
+      }
+   }
+   else
+   {
+      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+      {
+         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+         T np            = (T)inputData->getNullPix(bandIdx);
+         if(inputBuf&&outputBuf)
+         {
+            for(y = 0; y < oh; ++y)
+            {
+               for(x = 0; x < ow; ++x)
+               {
+                  values.clear();
+                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
+                  {
+                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
+                     {
+                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
+
+                        if(tempValue != np)
+                        {
+                           values.push_back((double)tempValue);
+                        }
+                     }
+                  }
+
+
+                  if(values.size() > 0)
+                  {
+                     double accumulate = std::accumulate(values.begin(),
+                                                         values.end(),
+                                                         0.0);
+                     double average = accumulate/(double)values.size();
+                     if(*(inputBuf+halfWindow + halfWindow*iw) == np)
+                     {
+                        if(theEnableFillNullFlag)
+                        {
+                           (*outputBuf) = (T)average;
+                        }
+                        else
+                        {
+                           (*outputBuf) = np;
+                        }
+                     }
+                     else
+                     {
+                        (*outputBuf) = (T)average;
+                     }
+                  }
+                  else
+                  {
+                     *outputBuf = np;
+                  }
+                  ++inputBuf;
+                  ++outputBuf;
+               }
+
+               inputBuf+=(halfWindow<<1);
+            }
+         }
+      }
+   }
+}
+
+template <class T> void ossimMeanMedianFilter::applyMeanNullCenterOnly(
+   T /* dummyVariable */,
+   ossimRefPtr<ossimImageData>& inputData)
+{
+   ossim_uint32 halfWindow = (theWindowSize >> 1);
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 kernelX   = 0;
+   ossim_uint32 kernelY   = 0;
+   ossim_uint32 iw  = inputData->getWidth();
+   ossim_uint32 ow  = theTile->getWidth();
+   ossim_uint32 oh = theTile->getHeight();
+   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
+                                         inputData->getNumberOfBands());
+   ossimDataObjectStatus status = inputData->getDataObjectStatus();
+   std::vector<double> values;
+
+   if(status == OSSIM_FULL)
+   {
+      // Nothing to do just copy the tile.
+      theTile->loadTile(inputData.get());
+   }
+   else
+   {
+      // Partial tile with nulls in it.
+      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+      {
+         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+         if (!inputBuf || !outputBuf)
+         {
+            return; // Shouldn't happen...
+         }
+         
+         const T NP = (T)inputData->getNullPix(bandIdx);
+
+         for(y = 0; y < oh; ++y)
+         {
+            for(x = 0; x < ow; ++x)
+            {
+               // Get the center input pixel.
+               const T CP = *(inputBuf+halfWindow + halfWindow*iw);
+               if (CP == NP)
+               {
+                  values.clear();
+                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
+                  {
+                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
+                     {
+                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
+                        
+                        if(tempValue != NP)
+                        {
+                           values.push_back((double)tempValue);
+                        }
+                     }
+                  }
+                  
+                  if(values.size() > 0)
+                  {
+                     double accumulate = std::accumulate(values.begin(),
+                                                         values.end(),
+                                                         0.0);
+                     double average = accumulate/(double)values.size();
+                     (*outputBuf) = (T)average;
+                  }
+                  else
+                  {
+                     (*outputBuf) = NP;
+                  }
+                  
+               }
+               else // Center pixel (CP) not null.
+               {
+                  (*outputBuf) = CP;
+               }
+               
+               // Move over...
+               ++inputBuf;
+               ++outputBuf;
+               
+            } // End of loop in x direction.
+
+            // Move down...
+            inputBuf+=(halfWindow<<1);
+            
+         }  // End of loop in y direction.
+         
+      }  // End of band loop.
+      
+   }  // End of else "partial tile" block.
+}
+
+template <class T>
+void ossimMeanMedianFilter::applyMedian(T /* dummyVariable */,
+                                        ossimRefPtr<ossimImageData>& inputData)
+{
+   ossim_uint32 halfWindow = (theWindowSize >> 1);
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 kernelX   = 0;
+   ossim_uint32 kernelY   = 0;
+   ossim_uint32 kernelIdx = 0;
+   ossim_uint32 iw  = inputData->getWidth();
+   ossim_uint32 ow  = theTile->getWidth();
+   ossim_uint32 oh = theTile->getHeight();
+   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
+                                         inputData->getNumberOfBands());
+   ossimDataObjectStatus status = inputData->getDataObjectStatus();
+   std::vector<T> values(theWindowSize*theWindowSize);
+
+   if(status == OSSIM_FULL)
+   {
+      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+      {
+         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+
+         if(inputBuf&&outputBuf)
+         {
+            for(y = 0; y < oh; ++y)
+            {
+               for(x = 0; x < ow; ++x)
+               {
+                  kernelIdx = 0;
+                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
+                  {
+                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
+                     {
+                        values[kernelIdx] = *(inputBuf+kernelX + kernelY*iw);
+                        ++kernelIdx;
+                     }
+                  }
+
+                  std::sort(values.begin(),
+                            values.end());
+
+                  if(values.size() > 0)
+                  {
+                     (*outputBuf) = values[values.size()>>1];
+                  }
+                  ++inputBuf;
+                  ++outputBuf;
+               }
+
+               inputBuf+=(halfWindow<<1);
+            }
+         }
+      }
+   }
+   else
+   {
+      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+      {
+         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+         T np            = (T)inputData->getNullPix(bandIdx);
+         if(inputBuf&&outputBuf)
+         {
+            for(y = 0; y < oh; ++y)
+            {
+               for(x = 0; x < ow; ++x)
+               {
+                  values.clear();
+                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
+                  {
+                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
+                     {
+                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
+
+                        if(tempValue != np)
+                        {
+                           values.push_back(tempValue);
+                        }
+                     }
+                  }
+
+                  std::sort(values.begin(),
+                            values.end());
+
+                  if(values.size() > 0)
+                  {
+                     if(*(inputBuf+halfWindow + halfWindow*iw) == np)
+                     {
+                        if(theEnableFillNullFlag)
+                        {
+                           (*outputBuf) = values[values.size()>>1];
+                        }
+                        else
+                        {
+                           (*outputBuf) = np;
+                        }
+                     }
+                     else
+                     {
+                        (*outputBuf) = values[values.size()>>1];
+                     }
+                  }
+                  else
+                  {
+                     *outputBuf = np;
+                  }
+                  ++inputBuf;
+                  ++outputBuf;
+               }
+
+               inputBuf+=(halfWindow<<1);
+            }
+         }
+      }
+   }
+}
+
+template <class T> void ossimMeanMedianFilter::applyMedianNullCenterOnly (
+   T /* dummyVariable */,
+   ossimRefPtr<ossimImageData>& inputData)
+{
+   ossim_uint32 halfWindow = (theWindowSize >> 1);
+   ossim_uint32 bandIdx = 0;
+   ossim_uint32 x = 0;
+   ossim_uint32 y = 0;
+   ossim_uint32 kernelX   = 0;
+   ossim_uint32 kernelY   = 0;
+   ossim_uint32 iw  = inputData->getWidth();
+   ossim_uint32 ow  = theTile->getWidth();
+   ossim_uint32 oh = theTile->getHeight();
+   ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
+                                         inputData->getNumberOfBands());
+   ossimDataObjectStatus status = inputData->getDataObjectStatus();
+   std::vector<T> values;
+
+   if(status == OSSIM_FULL)
+   {
+      // Nothing to do just copy the tile.
+      theTile->loadTile(inputData.get());
+   }
+   else
+   {
+       // Partial tile with nulls in it.
+      for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+      {
+         T* inputBuf     = (T*)inputData->getBuf(bandIdx);
+         T* outputBuf    = (T*)theTile->getBuf(bandIdx);
+         if (!inputBuf || !outputBuf)
+         {
+            return; // Shouldn't happen...
+         }
+         
+         const T NP = (T)inputData->getNullPix(bandIdx);
+
+         for(y = 0; y < oh; ++y)
+         {
+            for(x = 0; x < ow; ++x)
+            {
+               // Get the center input pixel.
+               const T CP = *(inputBuf+halfWindow + halfWindow*iw);
+               if (CP == NP)
+               {
+                  values.clear();
+                  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
+                  {
+                     for(kernelX = 0; kernelX < theWindowSize;++kernelX)
+                     {
+                        T tempValue = *(inputBuf+kernelX + kernelY*iw);
+                        
+                        if(tempValue != NP)
+                        {
+                           values.push_back(tempValue);
+                        }
+                     }
+                  }
+
+                  std::sort(values.begin(),
+                            values.end());
+                  
+                  if(values.size() > 0)
+                  {
+                     (*outputBuf) = values[values.size()>>1];
+                  }
+                  else
+                  {
+                     (*outputBuf) = NP;
+                  }
+               }
+               else // Center pixel (CP) not null.
+               {
+                  (*outputBuf) = CP;
+               }
+
+               // Move over...
+               ++inputBuf;
+               ++outputBuf;
+               
+            }  // End of loop in x direction.
+
+            // Move down...
+            inputBuf+=(halfWindow<<1);
+            
+         }  // End of loop in y direction.
+         
+      }  // End of band loop.
+      
+   }  // End of else "partial tile" block.
+}
+
+void ossimMeanMedianFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid())
+   {
+      return;
+   }
+
+   ossimString name = property->getName();
+
+   if (name == WINDOW_SIZE_KW)
+   {
+      theWindowSize = property->valueToString().toUInt32();
+   }
+   else if (name == FILTER_TYPE_KW)
+   {
+      ossimString value = property->valueToString();
+      setFilterType(value);
+   }
+   else if (name == AUTO_GROW_KW)
+   {
+      ossimString value;
+      property->valueToString(value);
+      setAutoGrowRectFlag(value.toBool());
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimMeanMedianFilter::getProperty(const ossimString& name)const
+{
+   if (name == WINDOW_SIZE_KW)
+   {
+      ossimProperty* prop =
+         new ossimNumericProperty(WINDOW_SIZE_KW,
+                                  ossimString::toString(theWindowSize),
+                                  3,
+                                  25);
+      prop->setCacheRefreshBit();
+
+      return prop;
+   }
+   else if (name == FILTER_TYPE_KW)
+   {
+      std::vector<ossimString> constraintList;
+      getFilterTypeList(constraintList);
+      ossimString value = getFilterTypeString();
+      ossimProperty* prop = new ossimStringProperty(FILTER_TYPE_KW,
+                                                    value,
+                                                    false,
+                                                    constraintList);
+      prop->setCacheRefreshBit();
+      
+      return prop;
+   }
+   else if (name == AUTO_GROW_KW)
+   {
+      ossimRefPtr<ossimProperty> p = new ossimBooleanProperty(
+         AUTO_GROW_KW, getAutoGrowRectFlag());
+      p->setFullRefreshBit();
+      return p;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimMeanMedianFilter::getPropertyNames(
+   std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(WINDOW_SIZE_KW);
+   propertyNames.push_back(FILTER_TYPE_KW);
+   propertyNames.push_back(AUTO_GROW_KW);
+
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+}
+
+bool ossimMeanMedianFilter::saveState(ossimKeywordlist& kwl,
+                                      const char* prefix)const
+{
+   kwl.add(prefix,
+           WINDOW_SIZE_KW.c_str(),
+           theWindowSize,
+           true);
+   kwl.add(prefix,
+           FILTER_TYPE_KW.c_str(),
+           getFilterTypeString(),
+           true);
+   kwl.add(prefix,
+           AUTO_GROW_KW.c_str(),
+           (theAutoGrowRectFlag?"true":"false"),
+           true);   
+
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimMeanMedianFilter::loadState(const ossimKeywordlist& kwl,
+                                      const char* prefix)
+{
+   const char* lookup = NULL;
+   
+   lookup = kwl.find(prefix, WINDOW_SIZE_KW.c_str());
+   if(lookup)
+   {
+      theWindowSize = ossimString(lookup).toUInt32();
+   }
+   
+   lookup = kwl.find(prefix, FILTER_TYPE_KW.c_str());
+   if(lookup)
+   {
+      ossimString type = lookup;
+      setFilterType(type);
+   }
+
+   lookup = kwl.find(prefix, AUTO_GROW_KW.c_str());
+   if(lookup)
+   {
+      ossimString flag = lookup;
+      setAutoGrowRectFlag(flag.toBool());
+   }
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+void ossimMeanMedianFilter::setFilterType(ossimMeanMedianFilterType type)
+{
+   theFilterType = type;
+}
+
+void ossimMeanMedianFilter::setFilterType(const ossimString& type)
+{
+   ossimString s = type;
+   s.downcase();
+
+   std::vector<ossimString> list;
+   getFilterTypeList(list);
+   
+   for (ossim_uint32 i = 0; i < list.size(); ++i)
+   {
+      if (s == list[i])
+      {
+         theFilterType = static_cast<ossimMeanMedianFilterType>(i);
+      }
+   }
+
+   if ( (theFilterType == OSSIM_MEDIAN_FILL_NULLS) ||
+        (theFilterType == OSSIM_MEAN_FILL_NULLS) )
+   {
+      theEnableFillNullFlag = true;
+   }
+   else
+   {
+      theEnableFillNullFlag = false;
+   }
+}
+
+void ossimMeanMedianFilter::setAutoGrowRectFlag(bool flag)
+{
+   theAutoGrowRectFlag = flag;
+}
+
+bool ossimMeanMedianFilter::getAutoGrowRectFlag() const
+{
+   return theAutoGrowRectFlag;
+}
+
+ossimString ossimMeanMedianFilter::getFilterTypeString() const
+{
+   std::vector<ossimString> list;
+   getFilterTypeList(list);
+   return list[theFilterType];
+}
+
+void ossimMeanMedianFilter::getFilterTypeList(
+   std::vector<ossimString>& list) const
+{
+   list.resize(OSSIM_MEAN_NULL_CENTER_ONLY+1);
+
+   list[0] = ossimString("median");
+   list[1] = ossimString("median_fill_nulls");
+   list[2] = ossimString("median_null_center_only");
+   list[3] = ossimString("mean");
+   list[4] = ossimString("mean_fill_nulls");
+   list[5] = ossimString("mean_null_center_only");
+}
+
+ossimIrect ossimMeanMedianFilter::getBoundingRect(ossim_uint32 resLevel)const
+{
+   // Get the input rectangle.
+   ossimIrect rect = ossimImageSourceFilter::getBoundingRect(resLevel);
+   if (!theAutoGrowRectFlag || rect.hasNans())
+   {
+      return rect; // Not in autogrow mode or no input connection yet...
+   }
+
+   if ( (theFilterType == OSSIM_MEDIAN_FILL_NULLS)       ||
+        (theFilterType == OSSIM_MEDIAN_NULL_CENTER_ONLY) ||
+        (theFilterType == OSSIM_MEAN_FILL_NULLS)         ||
+        (theFilterType == OSSIM_MEAN_NULL_CENTER_ONLY) )
+   {
+      ossimIpt pt = rect.ul();
+      const ossim_int32 HW = (theWindowSize >> 1); // half window size.
+
+      // Adjust the upper left.
+      pt.x = pt.x-HW;
+      pt.y = pt.y-HW;
+      rect.set_ul(pt);
+
+      // Adjust the lower right.
+      pt = rect.lr();
+      pt.x = pt.x+HW;
+      pt.y = pt.y+HW;
+      rect.set_lr(pt);
+   }
+
+   return rect;
+}
diff --git a/src/imaging/ossimMemoryImageSource.cpp b/src/imaging/ossimMemoryImageSource.cpp
new file mode 100644
index 0000000..7ca4de8
--- /dev/null
+++ b/src/imaging/ossimMemoryImageSource.cpp
@@ -0,0 +1,245 @@
+//*******************************************************************. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+//
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+RTTI_DEF1(ossimMemoryImageSource, "ossimMemoryImageSource", ossimImageSource);
+
+ossimMemoryImageSource::ossimMemoryImageSource()
+   :ossimImageSource(0, 0, 1, true, false)
+{
+   m_boundingRect.makeNan();
+}
+
+void ossimMemoryImageSource::setImage(ossimRefPtr<ossimImageData> image)
+{
+   m_image = image.get();
+	if(m_image.valid())
+	{
+		m_boundingRect = m_image->getImageRectangle();
+	}
+	else
+	{
+		m_boundingRect.makeNan();
+	}
+   m_result = 0;
+}
+
+void ossimMemoryImageSource::setImage(ossimScalarType scalarType,
+                                      ossim_uint32 numberOfBands,
+                                      ossim_uint32 width,
+                                      ossim_uint32 height)
+{
+   m_image = new ossimImageData(0,
+                                 scalarType,
+                                 numberOfBands,
+                                 width,
+                                 height);
+   m_image->initialize();
+   
+   m_boundingRect = m_image->getImageRectangle();
+   m_result = 0;
+}
+
+void ossimMemoryImageSource::setRect(ossim_uint32 ulx,
+                                     ossim_uint32 uly,
+                                     ossim_uint32 width,
+                                     ossim_uint32 height)
+{
+   if(m_image.valid())
+   {
+      m_image->setImageRectangle(ossimIrect(ulx, uly,
+                                             ulx + (width-1),
+                                             uly + (height-1)));
+      m_boundingRect = m_image->getImageRectangle();
+   }
+}
+
+ossim_uint32 ossimMemoryImageSource::getNumberOfInputBands() const
+{
+   if(m_image.valid())
+   {
+      return m_image->getNumberOfBands();
+   }
+   return 0;;
+}
+
+ossim_uint32 ossimMemoryImageSource::getNumberOfOutputBands() const
+{
+   return getNumberOfInputBands();
+}
+
+ossimScalarType ossimMemoryImageSource::getOutputScalarType() const
+{
+   if(m_image.valid())
+   {
+      return m_image->getScalarType();
+   }
+   
+   return ossimImageSource::getOutputScalarType();
+}
+
+double ossimMemoryImageSource::getNullPixelValue(ossim_uint32 band)const
+{
+   if(m_image.valid())
+   {
+      if(band < getNumberOfInputBands())
+      {
+         return m_image->getNullPix(band);
+      }
+   }
+   return ossimImageSource::getNullPixelValue(band);
+}
+
+double ossimMemoryImageSource::getMinPixelValue(ossim_uint32 band)const
+{
+   if(m_image.valid())
+   {
+      if(band < getNumberOfInputBands())
+      {
+         return m_image->getMinPix(band);
+      }
+   }
+   return ossimImageSource::getMinPixelValue(band);
+}
+
+double ossimMemoryImageSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(m_image.valid())
+   {
+      if(band < getNumberOfInputBands())
+      {
+         return m_image->getMaxPix(band);
+      }
+   }
+   return ossimImageSource::getMaxPixelValue(band);
+}
+
+ossimIrect ossimMemoryImageSource::getBoundingRect(ossim_uint32 resLevel)const
+{
+   if(resLevel == 0)
+   {
+      if(m_image.valid())
+      {
+         return m_boundingRect;
+      }
+   }
+
+   return ossimImageSource::getBoundingRect(resLevel);
+}
+
+ossimRefPtr<ossimImageData> ossimMemoryImageSource::getTile(const ossimIrect& rect,
+                                                            ossim_uint32 /* resLevel */)
+{
+   if(!isSourceEnabled()||!m_image.valid()||m_boundingRect.hasNans()) return 0;
+   if(!m_result.valid())
+   {
+      m_result = new ossimImageData(0, getOutputScalarType(), getNumberOfOutputBands(), rect.width(), rect.height());
+      m_result->initialize();       
+   }
+
+   m_result->setImageRectangle(rect);
+   m_result->makeBlank();
+   ossimIrect clampRect = m_image->getImageRectangle().clipToRect(rect);
+	
+   m_result->loadTile(m_image->getBuf(),
+	                    m_boundingRect,
+	                    OSSIM_BSQ);
+
+	m_result->validate();
+   return m_result;
+}
+
+
+bool ossimMemoryImageSource::canConnectMyInputTo(ossim_int32 /* myInputIndex */,
+                                                 const ossimConnectableObject* /* object */)const
+{
+   return false;
+}
+   
+void ossimMemoryImageSource::initialize()
+{
+   m_result = 0;
+}
+
+ossim_uint32 ossimMemoryImageSource::getNumberOfDecimationLevels() const
+{
+   return 1;
+}
+
+void ossimMemoryImageSource::getDecimationFactor(ossim_uint32 resLevel,
+                                                 ossimDpt& result) const
+{
+   if (resLevel == 0)
+   {
+      result.x = 1.0;
+      result.y = 1.0;
+   }
+   else
+   {
+      result.x = 1.0 / (1<<resLevel);
+      result.y = result.x;
+   }
+}
+
+void ossimMemoryImageSource::getDecimationFactors(std::vector<ossimDpt>& decimations)const
+{
+   decimations.push_back(ossimDpt(1.0,1.0));
+}
+
+
+bool ossimMemoryImageSource::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   
+   ossimString imagePrefix = ossimString(prefix) + "image.";
+   ossimString geomPrefix = ossimString(prefix) + "geom.";
+   if(m_image.valid())
+   {
+      m_image->saveState(kwl, imagePrefix);
+   }
+   if(m_geometry.valid())
+   {
+      m_geometry->saveState(kwl, geomPrefix);
+   }
+   return ossimImageSource::saveState(kwl, prefix);
+}
+
+bool ossimMemoryImageSource::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool returnResult =  ossimImageSource::loadState(kwl, prefix);
+   m_geometry = 0;
+   if(returnResult)
+   {
+      ossimString imagePrefix = ossimString(prefix) + "image.";
+      ossimString geomPrefix = ossimString(prefix) + "geom.";
+      
+      ossimString type = kwl.find(imagePrefix, "type");
+      if(!type.empty())
+      {
+         m_image = new ossimImageData();
+         returnResult = m_image->loadState(kwl, imagePrefix.c_str());
+         m_image->initialize();
+         m_boundingRect = m_image->getImageRectangle();
+      }
+      
+      if(returnResult)
+      {
+         type = kwl.find(geomPrefix, "type");
+         if(!type.empty())
+         {
+            m_geometry = new ossimImageGeometry();
+            returnResult = m_geometry->loadState(kwl, geomPrefix.c_str());
+         }
+      }
+   }
+   m_result = 0;
+   return returnResult;
+}
diff --git a/src/imaging/ossimMetadataFileWriter.cpp b/src/imaging/ossimMetadataFileWriter.cpp
new file mode 100644
index 0000000..6368020
--- /dev/null
+++ b/src/imaging/ossimMetadataFileWriter.cpp
@@ -0,0 +1,277 @@
+//*******************************************************************
+// Copyright (C) 2003 Stroage Area Networks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kenneth Melero (kmelero at sanz.com)
+//
+//*******************************************************************
+//  $Id: ossimMetadataFileWriter.cpp 17195 2010-04-23 17:32:18Z dburken $
+
+#include <ossim/imaging/ossimMetadataFileWriter.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimViewController.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimFilenameProperty.h>
+
+RTTI_DEF3(ossimMetadataFileWriter,
+          "ossimMetadataFileWriter",
+          ossimConnectableObject,
+          ossimProcessInterface,
+          ossimConnectableObjectListener);
+
+static ossimTrace traceDebug("ossimMetadataFileWriter:degug");
+
+ossimMetadataFileWriter::ossimMetadataFileWriter()
+   :ossimConnectableObject(0),
+      ossimProcessInterface(),
+      ossimConnectableObjectListener(),
+      theInputConnection(NULL),
+      theFilename(),
+      thePixelType(OSSIM_PIXEL_IS_POINT),
+      theAreaOfInterest()
+{
+   addListener((ossimConnectableObjectListener*)this);
+   theAreaOfInterest.makeNan();
+}
+
+ossimMetadataFileWriter::~ossimMetadataFileWriter()
+{
+   removeListener((ossimConnectableObjectListener*)this);
+}
+
+void ossimMetadataFileWriter::initialize()
+{
+   theInputConnection = dynamic_cast<ossimImageSource*> (getInput(0));
+}
+
+bool ossimMetadataFileWriter::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   bool result = ossimConnectableObject::loadState(kwl, prefix);
+
+   // Get the filename...
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   if(lookup)
+   {
+      ossimString filename = lookup;
+
+      setFilename(filename);
+   }
+
+   // Note: Defaulted to point in constructor.
+   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
+   if (lookup)
+   {
+      ossimString s = lookup;
+      s.downcase();
+      if (s.contains("area"))
+      {
+         thePixelType = OSSIM_PIXEL_IS_AREA;
+      }
+      else if (s.contains("point"))
+      {
+         thePixelType = OSSIM_PIXEL_IS_POINT;
+      }
+   }
+   
+   if(theInputObjectList.size() != 1)
+   {
+      theInputObjectList.resize(1);
+      theInputListIsFixedFlag = true;
+   }
+   
+   theOutputListIsFixedFlag = false;
+      
+   return result;
+}
+
+void ossimMetadataFileWriter::disconnectInputEvent(ossimConnectionEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimMetadataFileWriter::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimMetadataFileWriter::propertyEvent(ossimPropertyEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimMetadataFileWriter::setPixelType(ossimPixelType pixelType)
+{
+   thePixelType = pixelType;
+}
+
+ossimPixelType ossimMetadataFileWriter::getPixelType()const
+{
+   return thePixelType;
+}
+
+ossimObject* ossimMetadataFileWriter::getObject()
+{
+   return this;
+}
+
+const ossimObject* ossimMetadataFileWriter::getObject() const
+{
+   return this;
+}
+
+bool ossimMetadataFileWriter::execute()
+{
+   bool result = false;
+   if (!theInputConnection)
+   {
+      initialize();
+      if (!theInputConnection)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimMetadataFileWriter::execute DEBUG:\n"
+               << "theInputConnection is null!"
+               << endl;
+         }
+         return result;
+      }
+   }
+   
+   if(theFilename == ossimFilename::NIL)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimMetadataFileWriter::execute DEBUG:\n"
+            << "theFilename is not set!"
+            << endl;
+      }
+      return result;
+   }
+   
+   //---
+   // If theAreaOfInterest hasNans then it was probably not set so use
+   // the bounding rectangle of the input source.
+   //---
+   if (theAreaOfInterest.hasNans())
+   {
+      theAreaOfInterest = theInputConnection->getBoundingRect();
+      if (theAreaOfInterest.hasNans())
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimMetadataFileWriter::execute DEBUG:\n"
+               << "theAreaOfInterest is not set!"
+               << endl;
+         }
+         return result;
+      }
+   }
+
+   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
+
+   setPercentComplete(0.0);
+
+   result = writeFile();
+
+   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_NOT_EXECUTING);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimMetadataFileWriter::execute DEBUG:\n"
+         << (result?"successful":"unsuccessful") << " write of file:  "
+         << theFilename
+         << endl;
+   }
+   
+   return result;
+}
+
+void ossimMetadataFileWriter::setPercentComplete(double percentComplete)
+{
+   ossimProcessInterface::setPercentComplete(percentComplete);
+   ossimProcessProgressEvent event(this,
+                                   percentComplete);
+   fireEvent(event);      
+}
+
+void ossimMetadataFileWriter::setFilename(const ossimFilename& file)
+{
+   theFilename = file;
+}
+
+const ossimFilename& ossimMetadataFileWriter::getFilename() const
+{
+   return theFilename;
+}
+
+bool ossimMetadataFileWriter::canConnectMyInputTo(ossim_int32 inputIndex,
+                                                  const ossimConnectableObject* object) const
+{
+   return (object &&
+           ((PTR_CAST(ossimImageSource, object) &&
+             inputIndex == 0)||
+            (PTR_CAST(ossimViewController, object) &&
+             inputIndex == 1)));
+}
+
+void ossimMetadataFileWriter::setAreaOfInterest(
+   const ossimIrect& areaOfInterest)
+{
+   theAreaOfInterest = areaOfInterest;
+}
+
+ossimIrect ossimMetadataFileWriter::getAreaOfInterest() const
+{
+   return theAreaOfInterest;
+}
+
+void ossimMetadataFileWriter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid())return;
+   
+   ossimString name = property->getName();
+
+   if(name == ossimKeywordNames::FILENAME_KW)
+   {
+      setFilename(property->valueToString());
+   }
+   else
+   {
+      ossimConnectableObject::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimMetadataFileWriter::getProperty(const ossimString& name)const
+{
+   if(name == ossimKeywordNames::FILENAME_KW)
+   {
+      ossimFilenameProperty* filenameProp =
+         new ossimFilenameProperty(name, theFilename);
+      
+      filenameProp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_OUTPUT);
+      
+      return filenameProp;
+      
+   }
+
+   return ossimConnectableObject::getProperty(name);
+}
+
+void ossimMetadataFileWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimConnectableObject::getPropertyNames(propertyNames);
+   propertyNames.push_back(ossimKeywordNames::FILENAME_KW);
+}
diff --git a/src/imaging/ossimMonoGridRemapEngine.cpp b/src/imaging/ossimMonoGridRemapEngine.cpp
new file mode 100644
index 0000000..3f14abc
--- /dev/null
+++ b/src/imaging/ossimMonoGridRemapEngine.cpp
@@ -0,0 +1,520 @@
+//*****************************************************************************
+// FILE: ossimMonoGridRemapEngine.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// See the GPL in the COPYING.GPL file for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class 
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimMonoGridRemapEngine.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+
+#include <ossim/imaging/ossimMonoGridRemapEngine.h>
+
+RTTI_DEF1(ossimMonoGridRemapEngine, "ossimMonoGridRemapEngine",
+          ossimGridRemapEngine);
+
+#include <ossim/imaging/ossimGridRemapSource.h>
+#include <ossim/imaging/ossimAtbPointSource.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDblGrid.h>
+#include <ossim/imaging/ossimImageData.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimMonoGridRemapEngine:exec");
+static ossimTrace traceDebug ("ossimMonoGridRemapEngine:debug");
+static bool TRACE_FLAG = true;
+
+//*****************************************************************************
+//  METHOD: ossimMonoGridRemapEngine::dup
+//  
+//*****************************************************************************
+ossimObject* ossimMonoGridRemapEngine::dup() const
+{
+   return new ossimMonoGridRemapEngine;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMonoGridRemapEngine::remapTile
+//  
+//*****************************************************************************
+void ossimMonoGridRemapEngine::remapTile(const ossimDpt&       origin,
+                                        ossimGridRemapSource* remapper,
+                                        ossimRefPtr<ossimImageData>& tile)
+{
+   static const char MODULE[] = "ossimMonoGridRemapEngine::remapTile";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // Fetch tile size and NULL pixel value:
+   //***
+   int    width         = tile->getWidth();
+   int    height        = tile->getHeight();
+   int    offset        = 0;
+   double null;
+
+   //***
+   // Determine null pixel values so that we can recognize a null coming in and
+   // not remap it:
+   //***
+   null = tile->getNullPix(0);
+   ossimDblGrid& grid = *(remapper->getGrid(0));
+   
+   //***
+   // Remap according to pixel type:
+   //***
+   switch(tile->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      ossim_uint8* tile_buf  = (ossim_uint8*)tile->getBuf(0);
+      short  pixel;
+      
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (ossim_uint8) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (short) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<0)   tile_buf[offset] = 0;
+               else if (pixel>255) tile_buf[offset] = 255;
+               else                tile_buf[offset] = pixel;
+               
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (ossim_uint8) null) tile_buf[offset]++;
+            }
+            
+            offset++;
+         }
+      }
+      break;
+   }
+   
+   case OSSIM_USHORT11:
+   {
+      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
+      int  pixel;
+      
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (ossim_uint16) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (int) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<0)    tile_buf[offset] = 0;
+               else if (pixel>2047) tile_buf[offset] = 2047;
+               else                 tile_buf[offset] = pixel;
+               
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
+            }
+            
+            offset++;
+         }
+      }
+      break;
+   }
+
+   case OSSIM_USHORT12:
+   {
+      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
+      int  pixel;
+
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (ossim_uint16) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (int) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<0)    tile_buf[offset] = 0;
+               else if (pixel>4095) tile_buf[offset] = 4095;
+               else                 tile_buf[offset] = pixel;
+
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
+            }
+
+            offset++;
+         }
+      }
+      break;
+   }
+
+   case OSSIM_USHORT13:
+   {
+      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
+      int  pixel;
+
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (ossim_uint16) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (int) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<0)    tile_buf[offset] = 0;
+               else if (pixel>8191) tile_buf[offset] = 8191;
+               else                 tile_buf[offset] = pixel;
+
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
+            }
+
+            offset++;
+         }
+      }
+      break;
+   }
+
+   case OSSIM_USHORT14:
+   {
+      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
+      int  pixel;
+
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (ossim_uint16) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (int) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<0)    tile_buf[offset] = 0;
+               else if (pixel>16383) tile_buf[offset] = 16383;
+               else                 tile_buf[offset] = pixel;
+
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
+            }
+
+            offset++;
+         }
+      }
+      break;
+   }
+
+   case OSSIM_USHORT15:
+   {
+      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
+      int  pixel;
+
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (ossim_uint16) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (int) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<0)    tile_buf[offset] = 0;
+               else if (pixel>32767) tile_buf[offset] = 32767;
+               else                 tile_buf[offset] = pixel;
+
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
+            }
+
+            offset++;
+         }
+      }
+      break;
+   }
+   
+   case OSSIM_USHORT16:
+   {
+      ossim_uint16* tile_buf  = (ossim_uint16*)tile->getBuf(0);
+      int  pixel;
+      
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (ossim_uint16) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (int) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<0)     tile_buf[offset] = 0;
+               else if (pixel>65535) tile_buf[offset] = 65535;
+               else                  tile_buf[offset] = pixel;
+               
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (ossim_uint16) null) tile_buf[offset]++;
+            }
+            
+            offset++;
+         }
+      }
+      break;
+   }
+   
+   case OSSIM_SSHORT16:
+   {
+      short* tile_buf  = (short*)tile->getBuf(0);
+      int  pixel;
+      
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if (tile_buf[offset] != (short) null)
+            {
+               //***
+               // Remap MONO pixel with spatially variant bias value:
+               //***
+               pixel = tile_buf[offset] + (short) grid(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel<-32766) tile_buf[offset] = -32766;
+               else if (pixel> 32767) tile_buf[offset] = 32767;
+               else                   tile_buf[offset] = pixel;
+               
+               //***
+               // Avoid NULLS:
+               //***
+               if (tile_buf[offset] == (short) null) tile_buf[offset]++;
+            }
+            
+            offset++;
+         }
+      }
+      break;
+   }
+   default:
+   {
+	   ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimMonoGridRemapEngine::remapTile: Scalar type not handled" << std::endl;
+	   break;
+   }
+	   
+   }   // end switch statement
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+};
+
+//*****************************************************************************
+//  METHOD: ossimMonoGridRemapEngine::assignRemapValues
+//
+//  This engine defines the target value as an MONO vector of doubles, computed
+//  as the mean of all contributor MONO values.
+//  
+//*****************************************************************************
+void ossimMonoGridRemapEngine::assignRemapValues (
+   vector<ossimAtbPointSource*>& sources_list)
+{
+   static const char MODULE[] = "ossimMonoGridRemapEngine::assignRemapValues";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   int i; // index to individual sources
+
+   //***
+   // Declare a 2D array that will contain all of the contributing sources'
+   // MONO mean values. Also declare the accumulator target vector.
+   //***
+   int num_contributors = (int)sources_list.size();
+   double** contributor_pixel = new double* [num_contributors];
+   for (i=0; i<num_contributors; i++)
+      contributor_pixel[i] = new double[1];
+   double target_pixel = 0.0;
+
+   //***
+   // Now loop over each remaining contributor and sum in its contribution:
+   //***
+   vector<ossimAtbPointSource*>::iterator source;
+   i = 0;
+   for(source=sources_list.begin();
+       source!=sources_list.end();
+       source++)
+   {
+      (*source)->getSourceValue(contributor_pixel[i]);
+      target_pixel += contributor_pixel[i][0]/(double)num_contributors;
+      ++i;
+   }
+
+   //***
+   // The target pixel has been established. Now need to compute the actual
+   // remap quantities that will be written to the appropriate remap grids:
+   //***
+   i = 0;
+   for(source=sources_list.begin();
+       source!=sources_list.end();
+       source++)
+   {
+      computeRemapNode(*source, contributor_pixel[i], &target_pixel);
+      ++i;
+   }
+
+   // ***
+   // Delete locally allocated memory:
+   // ***
+   for (i=0; i<num_contributors; ++i)
+   {
+      delete [] contributor_pixel[i];
+   }
+   delete [] contributor_pixel;
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMonoGridRemapEngine::computeSourceValue
+//  
+//*****************************************************************************
+void ossimMonoGridRemapEngine::computeSourceValue(
+   ossimRefPtr<ossimImageData>& source, void* result)
+{
+   static const char MODULE[]="ossimMonoGridRemapEngine::computeSourceValue";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // This engine defines "value" as the MONO vector corresponding to the mean
+   // MONO pixel value of the source data:
+   //***
+   ((double*)result)[0] = source->computeAverageBandValue(0);
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMonoGridRemapEngine::computeRemapNode
+//
+//  This engine defines the remap value as the difference between the target
+//  MONO vector and the individual point source's value vector.
+//
+//*****************************************************************************
+void ossimMonoGridRemapEngine::computeRemapNode(ossimAtbPointSource* ps,
+                                              void* source_value,
+                                              void* target_value)
+{
+   static const char MODULE[] = "ossimMonoGridRemapEngine::computeRemapNode";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // Compute the remap grid node value specific to this MONO implementation:
+   //***
+   double node;
+   node = ((double*)target_value)[0] - ((double*)source_value)[0];
+
+   //***
+   // Fetch a pointer to the remapper feeding this point source in order to
+   // pass it the node value:
+   //***
+   ossimGridRemapSource* remapper = ps->getRemapSource();
+   remapper->setGridNode(ps->getViewPoint(), &node);
+                         
+   if (traceDebug() || TRACE_FLAG)
+   {
+      CLOG << "DEBUG -- "
+           << "\n\t ps->getViewPoint() = "<<ps->getViewPoint()
+           << "\n\t source_value = "<<((double*)source_value)[0]
+           << "\n\t target_value = "<<((double*)target_value)[0]
+           << "\n\t node = "<<node
+           << "\n\t remapper at "<<remapper<<endl;
+   }
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
diff --git a/src/imaging/ossimMultiBandHistogramTileSource.cpp b/src/imaging/ossimMultiBandHistogramTileSource.cpp
new file mode 100644
index 0000000..b42f5ac
--- /dev/null
+++ b/src/imaging/ossimMultiBandHistogramTileSource.cpp
@@ -0,0 +1,373 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimMultiBandHistogramTileSource.cpp 17195 2010-04-23 17:32:18Z dburken $
+#include <ossim/imaging/ossimMultiBandHistogramTileSource.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeyword.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <algorithm>
+
+static const char* MIN_VALUE_PERCENT_KW = "min_percent";
+static const char* MAX_VALUE_PERCENT_KW = "max_percent";
+static const char* ALGORITHM_KW         = "algorithm";
+
+RTTI_DEF1(ossimMultiBandHistogramTileSource,
+          "ossimMultiBandHistogramTileSource",
+          ossimImageSourceHistogramFilter)
+   
+ossimMultiBandHistogramTileSource::ossimMultiBandHistogramTileSource()
+   : ossimImageSourceHistogramFilter(),
+     theTile(0),
+     theAlgorithm(OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM)
+{
+   disableSource();
+}
+
+ossimMultiBandHistogramTileSource::ossimMultiBandHistogramTileSource(
+   double /* minValuePercent */,
+   double /* maxValuePercent */,
+   ossimImageSource* inputSource,
+   ossimMultiResLevelHistogram* histogram)
+   : ossimImageSourceHistogramFilter(inputSource, histogram),
+     theTile(0),
+     theAlgorithm(OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM)
+{
+   disableSource();
+}
+
+ossimMultiBandHistogramTileSource::~ossimMultiBandHistogramTileSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimMultiBandHistogramTileSource::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection) return 0;
+   
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
+                                                                       resLevel);
+   
+   if(!isSourceEnabled() || !inputTile.valid())
+   {
+      return inputTile;
+   }
+
+   if(!theTile.valid())
+   {
+      allocate(); // First time through...
+   }
+   
+   if( !theTile.valid() ||
+       !theMinValuePercentArray.size() ||
+       !theMaxValuePercentArray.size() )
+   {
+      return inputTile;
+   }
+   
+   theTile->setImageRectangle(tileRect);
+   if(inputTile->getBuf()&&
+      (inputTile->getDataObjectStatus()!=OSSIM_EMPTY))
+   {
+      theTile->loadTile(inputTile.get());
+      switch(inputTile->getScalarType())
+      {
+         case OSSIM_UCHAR:
+         {
+            return runLinearStretchAlgorithm((ossim_uint8)0,
+                                             theTile);
+         }
+         case OSSIM_USHORT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         {
+            return runLinearStretchAlgorithm((ossim_uint16)0,
+                                             theTile);
+         }
+         case OSSIM_SSHORT16:
+         {
+            return runLinearStretchAlgorithm(static_cast<ossim_sint16>(0),
+                                             theTile);
+         }
+         case OSSIM_DOUBLE:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            return runLinearStretchAlgorithm(static_cast<double>(0),
+                                             theTile);
+         }
+         case OSSIM_FLOAT:
+         case OSSIM_NORMALIZED_FLOAT:
+         {
+            return runLinearStretchAlgorithm(static_cast<float>(0),
+                                             theTile);
+         }
+         case OSSIM_SCALAR_UNKNOWN:
+         default:
+         {
+            ossimSetError("ossimMultiBandHistogramTileSource",
+                          ossimErrorCodes::OSSIM_ERROR,
+                          "Unknown scalar type");
+            break;
+         }
+      }
+      theTile->validate();
+      return theTile;
+   }
+   
+   return inputTile;
+}
+
+void ossimMultiBandHistogramTileSource::initialize()
+{
+   ossimImageSourceHistogramFilter::initialize();
+
+   // Force an allocate on the next getTile.
+   theTile = 0;
+}
+
+void ossimMultiBandHistogramTileSource::allocate()
+{
+   theTile = ossimImageDataFactory::instance()->create(this, this);
+
+   if(theTile.valid())
+   {
+      theTile->initialize();
+
+      ossim_uint32 numberOfBands = theTile->getNumberOfBands();
+      ossim_uint32 i = 0;
+      if(numberOfBands)
+      {
+         std::vector<double> copyArray;
+         
+         if(numberOfBands > theMinValuePercentArray.size())
+         {
+            copyArray = theMinValuePercentArray;
+            theMinValuePercentArray.resize(numberOfBands);
+            if(numberOfBands < copyArray.size())
+            {
+               std::copy(copyArray.begin(),
+                         copyArray.end(),
+                         theMinValuePercentArray.begin());
+            }
+            else
+            {
+               std::copy(copyArray.begin(),
+                         copyArray.begin() + copyArray.size(),
+                         theMinValuePercentArray.begin());
+            }
+         }
+         if(numberOfBands != theMaxValuePercentArray.size())
+         {
+            copyArray = theMaxValuePercentArray;
+            theMaxValuePercentArray.resize(numberOfBands);
+            if(numberOfBands < copyArray.size())
+            {
+               std::copy(copyArray.begin(),
+                         copyArray.end(),
+                         theMaxValuePercentArray.begin());
+            }
+            else
+            {
+               std::copy(copyArray.begin(),
+                         copyArray.begin() + copyArray.size(),
+                         theMaxValuePercentArray.begin());
+            }
+         }
+         if(numberOfBands > theMinValuePercentArray.size())
+         {
+            for(i = (ossim_uint32)theMinValuePercentArray.size(); i < numberOfBands; ++i)
+            {
+               theMinValuePercentArray[i] = 0.0;
+               theMaxValuePercentArray[i] = 0.0;
+            }
+         }
+      }
+   }
+}
+
+bool ossimMultiBandHistogramTileSource::loadState(const ossimKeywordlist& kwl,
+                                           const char* prefix)
+{
+   theMinValuePercentArray.clear();
+   theMaxValuePercentArray.clear();
+   if(ossimImageSourceHistogramFilter::loadState(kwl, prefix))
+   {
+      ossimNotify(ossimNotifyLevel_INFO) << "ossimMultiBandHistogramTileSource::loadState INFO: histogram filter was loaded" << std::endl;
+      ossimString regExpression = ossimString("^(") + ossimString(prefix) + ossimString(MIN_VALUE_PERCENT_KW) + ossimString("[0-9]+)");
+
+      long numberOfSources = kwl.getNumberOfSubstringKeys(regExpression);
+      
+      unsigned long numberOfMatches = 0;
+      ossim_uint32 i = 0;
+      while(numberOfMatches < static_cast<unsigned long>(numberOfSources))
+      {
+         ossimString key = ossimString(MIN_VALUE_PERCENT_KW) + ossimString::toString(i);
+         const char* value = kwl.find(prefix, key); 
+         if(value)
+         {
+            theMinValuePercentArray.push_back(ossimString(value).toDouble());
+            ++numberOfMatches;
+         }      
+         ++i;
+      }
+
+      numberOfMatches = 0;
+      i               = 0;
+      regExpression = ossimString("^(") + ossimString(prefix) + ossimString(MAX_VALUE_PERCENT_KW) + ossimString("[0-9]+)");
+      numberOfSources = kwl.getNumberOfSubstringKeys(regExpression);
+      while(numberOfMatches < static_cast<unsigned long>(numberOfSources))
+      {
+         ossimString key = ossimString(MAX_VALUE_PERCENT_KW) + ossimString::toString(i);
+         const char* value = kwl.find(prefix, key); 
+
+         if(value)
+         {
+            theMaxValuePercentArray.push_back(ossimString(value).toDouble());
+            ++numberOfMatches;
+         }      
+         ++i;
+      }
+
+      ossimString algorithm = kwl.find(prefix,
+                                       ALGORITHM_KW);
+      algorithm = algorithm.downcase();
+      theAlgorithm = OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM;
+      if(algorithm != "")
+      {
+         if(algorithm.contains("linear"))
+         {
+           theAlgorithm = OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM;
+         }
+      }
+   }
+   return true;
+}
+
+bool ossimMultiBandHistogramTileSource::saveState(ossimKeywordlist& kwl,
+                                           const char* prefix)const
+{
+   ossimImageSourceHistogramFilter::saveState(kwl, prefix);
+   ossim_int32 i = 0;
+
+   for(i = 0; i< (ossim_int32)theMinValuePercentArray.size();++i)
+   {
+      kwl.add(prefix,
+              ossimString(MIN_VALUE_PERCENT_KW) + ossimString::toString(i),
+              theMinValuePercentArray[i],
+              true);
+   }
+   for(i = 0; i< (ossim_int32)theMaxValuePercentArray.size();++i)
+   {
+      kwl.add(prefix,
+              ossimString(MAX_VALUE_PERCENT_KW) + ossimString::toString(i),
+              theMaxValuePercentArray[i],
+              true);
+   }
+   ossimString algorithmString;
+
+   switch(theAlgorithm)
+   {
+   case OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM:
+   {
+      algorithmString = "linear_stretch";
+      break;
+   }
+   case OSSIM_HISTOGRAM_NO_ALGORITHM:
+   {
+      algorithmString = "none";
+      break;
+   }
+   default:
+   {
+      algorithmString = "none";
+      break;
+   }
+   }
+
+   kwl.add(prefix,
+           ALGORITHM_KW,
+           algorithmString.c_str(),
+           true);
+   
+   return true;
+}
+
+template <class T>
+ossimRefPtr<ossimImageData> ossimMultiBandHistogramTileSource::runLinearStretchAlgorithm(
+   T /* dummyVariable */, ossimRefPtr<ossimImageData>& tile)
+{
+   if(!getHistogram())
+   {
+      return tile;
+   }
+
+   ossimRefPtr<ossimMultiBandHistogram> histo    = getHistogram()->getMultiBandHistogram(theCurrentResLevel);
+   if(histo.valid())
+   {
+      ossim_uint32 maxBands = ( (histo->getNumberOfBands() >
+                           tile->getNumberOfBands())?
+                          tile->getNumberOfBands():
+                          histo->getNumberOfBands());
+
+      long offsetUpperBound = tile->getHeight()*tile->getWidth();
+
+      for(ossim_uint32 band = 0; band < maxBands; ++band)
+      {
+         ossimRefPtr<ossimHistogram> h  = histo->getHistogram(band);
+         
+         T* buf   = static_cast<T*>(tile->getBuf(band));
+         T np     = static_cast<T>(tile->getNullPix(band));
+         T minPix = static_cast<T>(tile->getMinPix(band));
+         T maxPix = static_cast<T>(tile->getMaxPix(band));
+         T range  = (maxPix - minPix);
+         if(h.valid()&&buf)
+         {
+            
+            double maxClip = minPix + (h->HighClipVal(theMaxValuePercentArray[band])/(double)h->GetRes())*range;
+            double minClip = minPix + (h->LowClipVal(theMinValuePercentArray[band])/(double)h->GetRes())*range;
+            double delta   = (maxClip - minClip);
+            
+            if(fabs(delta) > 0.0)
+            {
+               for(long offset = 0; offset < offsetUpperBound; ++offset)
+               {
+                  if(buf[offset] != np)
+                  {
+                     if(buf[offset] < minClip)
+                     {
+                        buf[offset] = minPix;
+                     }
+                     else if(buf[offset] > maxClip)
+                     {
+                        buf[offset] = maxPix;
+                     }
+                     else
+                     {
+                        T value = static_cast<T>(minPix + ((buf[offset] - minClip)/delta)*range);
+                        buf[offset] = value>maxPix?maxPix:value;
+                     }
+                  }
+               }
+            }
+         }
+      }
+
+      tile->validate();
+   }
+   
+   return tile;
+}
diff --git a/src/imaging/ossimNBandToIndexFilter.cpp b/src/imaging/ossimNBandToIndexFilter.cpp
new file mode 100644
index 0000000..e096a74
--- /dev/null
+++ b/src/imaging/ossimNBandToIndexFilter.cpp
@@ -0,0 +1,565 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimNBandToIndexFilter.cpp 23325 2015-05-27 13:03:38Z gpotts $
+
+#include <ossim/imaging/ossimNBandToIndexFilter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+
+static const char* KEEP_QUANTIZED_VALUE_FLAG_KW = "keep_quantized_value_flag";
+
+RTTI_DEF1(ossimNBandToIndexFilter,
+          "ossimNBandToIndexFilter",
+          ossimImageSourceFilter);
+
+ossimNBandToIndexFilter::ossimNBandToIndexFilter()
+   :ossimImageSourceFilter(),
+    theLut(0),
+    theTile(0),
+    theKeepQuantizedValueFlag(false)
+{
+}
+
+ossimNBandToIndexFilter::~ossimNBandToIndexFilter()
+{
+}
+
+void ossimNBandToIndexFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   // Force allocate on next getTile.
+   theTile      = 0;
+   if(theLut.valid())
+   {
+      if(theKeepQuantizedValueFlag)
+      {
+         ossimNBandLutDataObject::LUT_ENTRY_TYPE minValue;
+         ossimNBandLutDataObject::LUT_ENTRY_TYPE maxValue;
+         ossim_uint32 bands = theLut->getNumberOfBands();
+         ossim_uint32 idx   = 0;
+         if(theMinValues.size() != bands)
+         {
+            theMinValues.resize(bands);
+            theMaxValues.resize(bands);
+            theNullValues.resize(bands);
+         }
+         std::fill(theNullValues.begin(),
+                   theNullValues.end(), 0);
+         for(idx = 0; idx < bands; ++idx)
+         {
+            theLut->getMinMax(idx, minValue, maxValue);
+            theMinValues[idx] = minValue;
+            theMaxValues[idx] = maxValue;
+            theNullValues[idx] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(ossimImageSourceFilter::getNullPixelValue(idx));
+         }
+      }
+      else
+      {
+         if(theMinValues.size() != 1)
+         {
+            theMinValues.resize(1);
+            theMaxValues.resize(1);
+            theNullValues.resize(1);
+         }
+         theMinValues[0]  = 0;
+         theMaxValues[0]  = theLut->getNumberOfEntries()-1;
+         theNullValues[0] = theLut->getNullPixelIndex();
+      }
+   }
+}
+
+void ossimNBandToIndexFilter::allocate()
+{
+   theTile      = 0;
+   
+   if(isSourceEnabled()&&theInputConnection)
+   {
+      theTile      = ossimImageDataFactory::instance()->create(this, this);
+      if(theTile.valid())
+      {
+         theTile->initialize();
+      }
+   }
+}
+
+void ossimNBandToIndexFilter::disableSource()
+{
+   ossimImageSourceFilter::disableSource();
+   theTile = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::getTile(const ossimIrect& origin,
+                                                             ossim_uint32 resLevel)
+{
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getTile(origin, resLevel);
+   }
+   if(!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   if(!theTile.valid())
+   {
+      allocate();
+   }
+   
+   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(origin,
+                                                                   resLevel);
+
+   if(!theTile.valid() || !input.valid())
+   {
+      return input;
+   }
+
+   theTile->setImageRectangle(origin);
+   theTile->setDataObjectStatus(OSSIM_FULL);
+   theTile->makeBlank();
+
+   return convertInputTile(input.get());
+}
+
+ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertInputTile(ossimImageData* tile)
+{
+   switch(getOutputScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         return convertOutputTileTemplate((ossim_uint8)0,
+                                          tile);
+         break;
+      }
+      case OSSIM_UINT16:
+      {
+         return convertOutputTileTemplate((ossim_uint16)0,
+                                          tile);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         return convertOutputTileTemplate((ossim_uint32)0,
+                                         tile);
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimNBandToIndexFilter::convertInputTile: Unsupported scalar type for conversion" << std::endl;
+      }
+   }
+
+   return theTile;
+}
+
+template <class T>
+ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertOutputTileTemplate(T outputDummy,
+                                                                               ossimImageData* inputTile)
+{
+   switch(inputTile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         return convertInputTileToOutputTemplate((ossim_uint8)0,
+                                                 outputDummy,
+                                                 inputTile);
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         return convertInputTileToOutputTemplate((ossim_sint8)0,
+                                                 outputDummy,
+                                                 inputTile);
+      }
+      case OSSIM_UINT16:
+      {
+         return convertInputTileToOutputTemplate((ossim_uint16)0,
+                                                 outputDummy,
+                                                 inputTile);
+      }
+      case OSSIM_SINT32:
+      {
+         return convertInputTileToOutputTemplate((ossim_sint32)0,
+                                                 outputDummy,
+                                                 inputTile);
+      }
+      case OSSIM_UINT32:
+      {
+         return convertInputTileToOutputTemplate((ossim_uint32)0,
+                                                 outputDummy,
+                                                 inputTile);
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "convertInputTileToOutputTemplate::convertOutputTileTemplate: Unsupported scalar type for conversion." << std::endl;
+      }
+   }
+
+   return theTile;
+}
+
+template <class T1, class T2>
+ossimRefPtr<ossimImageData> ossimNBandToIndexFilter::convertInputTileToOutputTemplate(
+   T1 /* inputDummy */,
+   T2 /* outputDummy */,
+   ossimImageData* inputTile)
+{
+   if (!inputTile)
+   {
+      return theTile;
+   }
+   
+   const ossim_uint32 BANDS = inputTile->getNumberOfBands();
+
+   if (!BANDS)
+   {
+      return theTile;
+   }
+//   T2** outBand = (T2*)theTile->getBuf();
+
+   ossim_uint32 numberOfBands = theLut->getNumberOfBands();
+   
+   std::vector<ossimNBandLutDataObject::LUT_ENTRY_TYPE> bandValuesTemplate(numberOfBands);
+
+   ossimNBandLutDataObject::LUT_ENTRY_TYPE* bandValues = &bandValuesTemplate.front();//new ossimNBandLutDataObject::LUT_ENTRY_TYPE[numberOfBands];
+
+   std::fill(bandValuesTemplate.begin(), bandValuesTemplate.end(), 0);
+   numberOfBands = ossim::min(BANDS,
+                            numberOfBands);
+   if(!numberOfBands) return theTile;
+   std::vector<T1*> band(numberOfBands);
+   std::vector<T2*> outBand(numberOfBands);
+  // T1** band = new T1*[numberOfBands];
+   //T2** outBand = new T2*[numberOfBands];
+   ossim_int32 idx   = 0;
+
+   for(idx = 0; idx < (ossim_int32)numberOfBands; ++idx)
+   {
+      band[idx] = (T1*)inputTile->getBuf(idx);
+      outBand[idx] = (T2*)theTile->getBuf(idx);
+   }
+   if(band[0])
+   {
+      if(inputTile->getDataObjectStatus() == OSSIM_FULL)
+      {
+         ossim_uint32 upper = inputTile->getWidth()*inputTile->getHeight();
+         ossim_uint32 idx2=0;
+         for(ossim_uint32 offset = 0; offset < upper; ++offset)
+         {
+            for(idx2 = 0; idx2 < numberOfBands; ++idx2)
+            {
+               bandValues[idx2] = *band[idx2];
+               ++band[idx2];
+            }
+            //---
+            // Note call the ossimNBandLutDataObject::findIndex that takes a size as the input
+            // data may have dropped the alpha channel.
+            //---
+            idx = theLut->findIndex(bandValues, numberOfBands);
+
+            if(!theKeepQuantizedValueFlag)
+            {
+               *outBand[0] = (T2)idx;
+               ++outBand[0];
+            }
+            else
+            {
+               for(idx2 = 0; idx2 < numberOfBands; ++idx2)
+               {
+                  if(idx >=0)
+                  {
+                     *outBand[idx2] = (T2)(*theLut)[idx][idx2];
+                     ++outBand[idx2];
+                  }
+               }
+            }
+         }
+      }
+      else if(inputTile->getDataObjectStatus() == OSSIM_PARTIAL)
+      {
+         ossim_uint32 upper = inputTile->getWidth()*inputTile->getHeight();
+         ossim_uint32 idx2=0;
+         for(ossim_uint32 offset = 0; offset < upper; ++offset)
+         {
+            for(idx2 = 0; idx2 < numberOfBands; ++idx2)
+            {
+               bandValues[idx2] = *band[idx2];
+               ++band[idx2];
+            }
+            idx = -1;
+            if(!inputTile->isNull(offset))
+            {
+               //---
+               // Note call the ossimNBandLutDataObject::findIndex that takes a size as the input
+               // data may have dropped the alpha channel.
+               //---
+               idx = theLut->findIndex(bandValues, numberOfBands);
+            }
+            if(!theKeepQuantizedValueFlag)
+            {
+               if(idx>=0)
+               {
+                  *outBand[0] = (T2)idx;
+               }
+               ++outBand[0];
+            }
+            else
+            {
+               for(idx2 = 0; idx2 < numberOfBands; ++idx2)
+               {
+                  if(idx >=0)
+                  {
+                     if(idx>=0)
+                     {
+                        *outBand[idx2] = (T2)(*theLut)[idx][idx2];
+                     }
+                  }
+                  ++outBand[idx2];
+               }
+            }
+         }
+      }
+   }
+   if(theKeepQuantizedValueFlag)
+   {
+      theTile->validate();
+   }
+   else
+   {
+      theTile->setDataObjectStatus(OSSIM_FULL);
+   }
+
+  
+   return theTile;
+}
+
+bool ossimNBandToIndexFilter::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)const
+{
+   ossimString newPrefix = prefix;
+   newPrefix = newPrefix + "lut.";
+
+   if(theLut.valid())
+   {
+      theLut->saveState(kwl, newPrefix.c_str());
+   }
+
+   kwl.add(prefix,
+           KEEP_QUANTIZED_VALUE_FLAG_KW,
+           theKeepQuantizedValueFlag?"true":"false",
+           true);
+           
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimNBandToIndexFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   ossimString newPrefix = prefix;
+   newPrefix = newPrefix + "lut.";
+
+   if(!theLut.valid())
+   {
+      theLut = new ossimNBandLutDataObject;
+   }
+   theLut->loadState(kwl, newPrefix.c_str());
+
+   const char* flag = kwl.find(prefix, KEEP_QUANTIZED_VALUE_FLAG_KW);
+   if(flag)
+   {
+      theKeepQuantizedValueFlag = ossimString(flag).toBool();
+   }
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimNBandToIndexFilter::isSourceEnabled()const
+{
+   bool result = ossimSource::isSourceEnabled()&&theInputConnection;
+
+   // only support 3 band integral values, no floating point for now.
+   //
+   if(result)
+   {
+      
+      ossimScalarType inputScalarType = theInputConnection->getOutputScalarType();
+      if(!theLut.valid() ||
+         (theLut->getNumberOfEntries()<1)||
+         (inputScalarType==OSSIM_FLOAT32)||
+         (inputScalarType==OSSIM_FLOAT64)||
+         (theInputConnection->getNumberOfOutputBands()!=3))
+      {
+         result = false;
+      }
+   }
+   
+   return result;
+}
+
+ossim_uint32 ossimNBandToIndexFilter::getNumberOfOutputBands() const
+{
+   if(isSourceEnabled())
+   {
+      if(theKeepQuantizedValueFlag)
+      {
+         if(theLut.valid())
+         {
+            return theLut->getNumberOfBands();
+         }
+      }
+      else
+      {
+         return 1;
+      }
+   }
+   
+   return ossimImageSourceFilter::getNumberOfOutputBands();
+}
+   
+ossimScalarType ossimNBandToIndexFilter::getOutputScalarType() const
+{
+   if(isSourceEnabled())
+   {
+      
+      ossim_uint32 numberOfEntries = theLut->getNumberOfEntries();
+      
+      if(numberOfEntries < 257)
+      {
+         return OSSIM_UCHAR;
+      }
+      else if(numberOfEntries < 65537)
+      {
+         return OSSIM_UINT16;
+      }
+      else
+      {
+         return OSSIM_UINT32;
+      }
+   }
+   
+   return ossimImageSourceFilter::getOutputScalarType();
+}
+
+void ossimNBandToIndexFilter::setLut(ossimNBandLutDataObject& lut)
+{
+   theLut = new ossimNBandLutDataObject(lut);
+}
+
+double ossimNBandToIndexFilter::getNullPixelValue(ossim_uint32 band)const
+{
+   if(isSourceEnabled())
+   {
+      if(theLut->getNullPixelIndex() >= 0)
+      {
+         return theLut->getNullPixelIndex();
+      }
+   }
+   
+   return ossimImageSourceFilter::getNullPixelValue(band);
+}
+
+double ossimNBandToIndexFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   if(isSourceEnabled())
+   {
+      if(band < theMinValues.size())
+      {
+         return (double)theMinValues[band];
+      }
+   }
+//    if(isSourceEnabled())
+//    {
+//       if(getNullPixelValue() != 0)
+//       {
+//          return 0;
+//       }
+//       else
+//       {
+//          return 1;
+//       }
+//       return 0;
+//    }
+   
+   return ossimImageSourceFilter::getMinPixelValue();
+}
+
+double ossimNBandToIndexFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(isSourceEnabled())
+   {
+      if(band < theMaxValues.size())
+      {
+         return (double)theMaxValues[band];
+      }
+//       if(theLut->getNullPixelIndex() != ((ossim_int32)(theLut->getNumberOfEntries())-1))
+//       {
+//          return theLut->getNumberOfEntries();
+//       }
+//       else
+//       {
+//          return (theLut->getNumberOfEntries()-1);
+//       }
+   }
+   
+   return ossimImageSourceFilter::getMaxPixelValue();
+}
+
+void ossimNBandToIndexFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(property->getName() == ossimKeywordNames::FILENAME_KW)
+   {
+      ossimKeywordlist kwl;
+      if(kwl.addFile(ossimFilename(property->valueToString())))
+      {
+         theLut = new ossimNBandLutDataObject;
+         theLut->loadState(kwl);
+      }
+   }
+   else if(property->getName() == KEEP_QUANTIZED_VALUE_FLAG_KW)
+   {
+      theKeepQuantizedValueFlag = property->valueToString().toBool();
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNBandToIndexFilter::getProperty(const ossimString& name)const
+{
+   if(name == ossimKeywordNames::FILENAME_KW)
+   {
+      ossimFilenameProperty* property = new ossimFilenameProperty(name, theLutFilename);
+      property->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      property->setCacheRefreshBit();
+      
+      return property;
+   }
+   else if(name == KEEP_QUANTIZED_VALUE_FLAG_KW)
+   {
+      ossimBooleanProperty* property = new ossimBooleanProperty(name, theKeepQuantizedValueFlag);
+      property->setCacheRefreshBit();
+
+      return property;
+   }
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimNBandToIndexFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(ossimKeywordNames::FILENAME_KW);
+   propertyNames.push_back(KEEP_QUANTIZED_VALUE_FLAG_KW);
+}
diff --git a/src/imaging/ossimNitf20Writer.cpp b/src/imaging/ossimNitf20Writer.cpp
new file mode 100644
index 0000000..925cd15
--- /dev/null
+++ b/src/imaging/ossimNitf20Writer.cpp
@@ -0,0 +1,840 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimNitf20Writer.cpp 2982 2011-10-10 21:28:55Z david.burken $
+
+
+#include <ossim/imaging/ossimNitf20Writer.h>
+#include <ossim/imaging/ossimNitfTileSource.h>
+#include <ossim/base/ossimDate.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimRpcSolver.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
+#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
+#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
+#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
+#include <ossim/support_data/ossimNitfNameConversionTables.h>
+#include <ossim/support_data/ossimNitfBlockaTag.h>
+#include <tiffio.h>
+#include <fstream>
+#include <algorithm>
+#include <sstream>
+#include <iomanip>
+
+RTTI_DEF1(ossimNitf20Writer, "ossimNitf20Writer", ossimNitfWriterBase);
+
+static ossimTrace traceDebug(ossimString("ossimNitfWriter:debug"));
+     
+static ossimString monthConversionTable[] = {"   ", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
+
+ossimNitf20Writer::ossimNitf20Writer(const ossimFilename& filename,
+                                     ossimImageSource* inputSource)
+   : ossimNitfWriterBase(filename, inputSource),
+     theOutputStream(0),
+     theFileHeader(),
+     theImageHeader(),
+     theEnableRpcbTagFlag(false),
+     theEnableBlockaTagFlag(true),
+     theCopyFieldsFlag(false)
+{
+   //---
+   // Since the internal nitf tags are not very accurate, write an external
+   // geometry out as default behavior.  Users can disable this via the
+   // property interface or keyword list.
+   //---
+   setWriteExternalGeometryFlag(true);
+   
+   theFileHeader      = new ossimNitfFileHeaderV2_0;
+   theImageHeader     = new ossimNitfImageHeaderV2_0;
+   theOutputImageType = "nitf20_block_band_separate";
+
+   // These are always set:
+   theFileHeader->setEncryption( ossimString("0") );
+   theImageHeader->setJustification( ossimString("R") );
+   
+   // Set any site defaults.
+   initializeDefaultsFromConfigFile(
+      dynamic_cast<ossimNitfFileHeaderV2_X*>(theFileHeader.get()),
+      dynamic_cast<ossimNitfImageHeaderV2_X*>(theImageHeader.get()) );
+}
+
+ossimNitf20Writer::~ossimNitf20Writer()
+{
+   //---
+   // This looks like a leak but it's not as both of these are ossimRefPtr's.
+   //---
+   theFileHeader=0;
+   theImageHeader=0;
+   
+   close();
+}
+
+bool ossimNitf20Writer::isOpen()const
+{
+   return (theOutputStream != 0);
+}
+
+bool ossimNitf20Writer::open()
+{
+   if(isOpen())
+   {
+      close();
+   }
+   theOutputStream = new std::ofstream;
+   theOutputStream->open(theFilename.c_str(), ios::out|ios::binary);
+   
+   return theOutputStream->good();
+}
+
+void ossimNitf20Writer::close()
+{
+   if(theOutputStream)
+   {
+      theOutputStream->close();
+      delete theOutputStream;
+      theOutputStream = (std::ofstream*)0;
+   }
+}
+
+bool ossimNitf20Writer::writeFile()
+{
+   if(!theInputConnection->isMaster())
+   {
+      theInputConnection->slaveProcessTiles();
+
+      return true;
+   }
+
+   open();
+
+   if (!isOpen())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitf20Writer::writeFile ERROR:"
+            << " Could not open!  Returning..."
+            << std::endl;
+      }
+
+      return false;
+   }
+
+   // Write out the geometry info.
+   writeGeometry(theImageHeader.get(), theInputConnection.get());
+   
+   addTags();
+   
+   bool result = false;
+   if((theOutputImageType == "nitf20_block_band_separate")||
+      (theOutputImageType == "image/nitf20"))
+   {
+      result =  writeBlockBandSeparate();
+   }
+   else if(theOutputImageType == "nitf20_block_band_sequential")
+   {
+      result =  writeBlockBandSequential();
+   }
+   
+   close();
+   
+   return result;
+}
+
+void ossimNitf20Writer::getImageTypeList(std::vector<ossimString>& imageTypeList)const
+{
+   imageTypeList.push_back(ossimString("nitf20_block_band_separate"));
+   imageTypeList.push_back(ossimString("nitf20_block_band_sequential"));
+}
+
+void ossimNitf20Writer::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+   
+   ossimString name = property->getName();
+   
+   if(name == "file_header")
+   {
+      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
+                                                           property.get());
+      if(containerProperty)
+      {
+         std::vector<ossimRefPtr<ossimProperty> > propertyList;
+         containerProperty->getPropertyList(propertyList);
+         theFileHeader->setProperties(propertyList);
+      }
+   }
+   else if(name == "image_header")
+   {
+      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
+                                                           property.get());
+      if(containerProperty)
+      {
+         std::vector<ossimRefPtr<ossimProperty> > propertyList;
+         containerProperty->getPropertyList(propertyList);
+         theImageHeader->setProperties(propertyList);
+      }
+   }
+   else if (name == "enable_rpcb_tag")
+   {
+      theEnableRpcbTagFlag = property->valueToString().toBool();
+   }
+   else if (name == "enable_blocka_tag")
+   {
+      theEnableBlockaTagFlag = property->valueToString().toBool();
+   }
+   else if(name == "copy_fields_flag")
+   {
+      theCopyFieldsFlag = property->valueToString().toBool();
+   }
+   else
+   {
+      // just in case it was an nitf specific tag we can pass it safely like this
+      theFileHeader->setProperty(property);
+      theImageHeader->setProperty(property);
+      ossimImageFileWriter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitf20Writer::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   
+   if(name == "file_header")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      std::vector<ossimRefPtr<ossimProperty> > propertyList;
+      
+      theFileHeader->getPropertyList(propertyList);
+      container->addChildren(propertyList);
+      
+      result = container;
+   }
+   else if(name == "image_header")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      std::vector<ossimRefPtr<ossimProperty> > propertyList;
+      
+      theImageHeader->getPropertyList(propertyList);
+      container->addChildren(propertyList);
+      
+      result = container;
+   }
+   else if(name == "enable_rpcb_tag")
+   {
+      ossimBooleanProperty* boolProperty =
+         new ossimBooleanProperty(name, theEnableRpcbTagFlag);
+
+      result = boolProperty;
+   }   
+   else if(name == "enable_blocka_tag")
+   {
+      ossimBooleanProperty* boolProperty =
+         new ossimBooleanProperty(name, theEnableBlockaTagFlag);
+
+      result = boolProperty;
+   }   
+   else if(name == "copy_fields_flag")
+   {
+      ossimBooleanProperty* boolProperty =
+      new ossimBooleanProperty(name, theCopyFieldsFlag);
+      
+      result = boolProperty;
+   }
+   else
+   {
+      return ossimImageFileWriter::getProperty(name);
+   }
+
+   return result;
+}
+
+void ossimNitf20Writer::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageFileWriter::getPropertyNames(propertyNames);
+
+   propertyNames.push_back("file_header");
+   propertyNames.push_back("image_header");
+   propertyNames.push_back("enable_rpcb_tag");
+   propertyNames.push_back("enable_blocka_tag");
+   propertyNames.push_back("copy_fields_flag");
+}
+
+bool ossimNitf20Writer::writeBlockBandSeparate()
+{
+   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
+   ossim_uint64 byteSize      = ossim::scalarSizeInBytes(scalarType);
+   ossimIrect rect            = theInputConnection->getBoundingRect();
+   ossim_uint64 bands         = theInputConnection->getNumberOfOutputBands();
+   ossim_uint64 idx           = 0;
+   ossim_uint64 headerStart   = (ossim_uint64)theOutputStream->tellp();
+
+   ossimIpt blockSize(64, 64);
+   ossim_uint64 blocksHorizontal = (ossim_uint32)ceil(((double)rect.width()/(double)blockSize.x));
+   ossim_uint64 blocksVertical   = (ossim_uint32)ceil(((double)rect.height()/(double)blockSize.y));
+
+   ossimNitfImageInfoRecordV2_0 imageInfoRecord;
+   //imageInfoRecord.setSubheaderLength(439); // ok if no tags
+   imageInfoRecord.setImageLength(bands*byteSize*blocksVertical*blockSize.y*blocksHorizontal*blockSize.x);
+
+   theFileHeader->addImageInfoRecord(imageInfoRecord);
+
+   //---
+   // This makes space for the file header; it is written again at the end of
+   // this method with updated values
+   // need a better way to get the length.  This should be queried on the
+   // header before writing
+   //---
+   theFileHeader->writeStream(*theOutputStream); 
+   ossim_uint64 headerLength = ((ossim_uint64)theOutputStream->tellp() - headerStart) /* + 1 */;
+   
+   ossimString representation;
+   theImageHeader->setActualBitsPerPixel(
+      ossim::getActualBitsPerPixel(scalarType));
+   theImageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
+   theImageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
+   theImageHeader->setNumberOfBands(bands);
+   theImageHeader->setImageMode('B');// blocked
+
+   if((bands == 3)&&
+      (scalarType == OSSIM_UCHAR))
+   {
+      theImageHeader->setRepresentation("RGB");
+      theImageHeader->setCategory("VIS");
+   }
+   else if(bands == 1)
+   {
+      theImageHeader->setRepresentation("MONO");
+      theImageHeader->setCategory("MS");
+   }
+   else
+   {
+      theImageHeader->setRepresentation("MULTI");
+      theImageHeader->setCategory("MS");
+   }
+   
+   theImageHeader->setBlocksPerRow(blocksHorizontal);
+   theImageHeader->setBlocksPerCol(blocksVertical);
+   theImageHeader->setNumberOfPixelsPerBlockRow(blockSize.x);
+   theImageHeader->setNumberOfPixelsPerBlockCol(blockSize.y);
+   theImageHeader->setNumberOfRows(rect.height());
+   theImageHeader->setNumberOfCols(rect.width());
+
+   ossimNitfImageBandV2_0 bandInfo;
+   for(idx = 0; idx < bands; ++idx)
+   {
+      std::ostringstream out;
+      
+      out << std::setfill('0')
+          << std::setw(2)
+          << idx;
+      
+      bandInfo.setBandRepresentation(out.str().c_str());
+      theImageHeader->setBandInfo(idx,
+                              bandInfo);
+   }
+
+   ossim_uint64 imageHeaderStart = theOutputStream->tellp();
+   theImageHeader->writeStream(*theOutputStream);
+   ossim_uint64 imageHeaderEnd = theOutputStream->tellp();
+   ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
+
+   theInputConnection->setTileSize(blockSize);
+   ossim_uint64 numberOfTiles   = theInputConnection->getNumberOfTiles();
+   theInputConnection->setToStartOfSequence();
+   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
+   ossim_uint64 tileNumber = 1;
+   ossimEndian endian;
+
+   
+   while( data.valid() && !needsAborting())
+   {
+      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+      {
+         switch(data->getScalarType())
+         {
+            case OSSIM_USHORT16:
+            case OSSIM_USHORT11:
+            case OSSIM_USHORT12:
+            case OSSIM_USHORT13:
+            case OSSIM_USHORT14:
+            case OSSIM_USHORT15:
+            {
+               endian.swap((ossim_uint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_SSHORT16:
+            {
+               endian.swap((ossim_sint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_FLOAT:
+            case OSSIM_NORMALIZED_FLOAT:
+            {
+               endian.swap((ossim_float32*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_DOUBLE:
+            case OSSIM_NORMALIZED_DOUBLE:
+            {
+               endian.swap((ossim_float64*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            default:
+               break;
+         }
+      }
+      
+      theOutputStream->write((char*)(data->getBuf()),
+                             data->getSizeInBytes());
+      
+      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
+      
+      if(!needsAborting())
+      {
+         data = theInputConnection->getNextTile();
+      }
+      ++tileNumber;
+   }
+
+   std::streamoff pos = theOutputStream->tellp();
+
+   setComplexityLevel(pos, theFileHeader.get());
+
+   /*
+    * Need to change the way I compute file length and header length later
+    * We need to figure out a better way to compute.
+    */
+   theFileHeader->setFileLength(static_cast<ossim_uint64>(pos));
+   theFileHeader->setHeaderLength(headerLength);
+   theOutputStream->seekp(0, ios::beg);
+   imageInfoRecord.setSubheaderLength(imageHeaderSize);
+   theFileHeader->replaceImageInfoRecord(0, imageInfoRecord);
+   theFileHeader->writeStream(*theOutputStream);
+   
+   return true;
+}
+
+bool ossimNitf20Writer::writeBlockBandSequential()
+{
+   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
+   ossim_uint64    byteSize   = ossim::scalarSizeInBytes(scalarType);
+   ossimIrect      rect       = theInputConnection->getBoundingRect();
+   ossim_uint64    bands      = theInputConnection->getNumberOfOutputBands();
+   ossim_uint64    idx        = 0;
+   ossim_uint64    headerStart   = (ossim_uint64)theOutputStream->tellp();
+
+   ossimIpt blockSize(64, 64);
+
+   ossim_uint64 blocksHorizontal = theInputConnection->getNumberOfTilesHorizontal();
+   ossim_uint64 blocksVertical   = theInputConnection->getNumberOfTilesVertical();
+   theInputConnection->setTileSize(blockSize);
+   ossim_uint64 numberOfTiles   = theInputConnection->getNumberOfTiles();
+   theInputConnection->setToStartOfSequence();
+   
+   ossimNitfImageInfoRecordV2_0 imageInfoRecord;
+ //  imageInfoRecord.setSubheaderLength(439);
+   imageInfoRecord.setImageLength(bands*byteSize*blocksHorizontal*blocksVertical*blockSize.x*blockSize.y);
+
+   ossimDate currentDate;
+   
+   theFileHeader->setDate(currentDate);
+   theFileHeader->addImageInfoRecord(imageInfoRecord);
+
+   //---
+   // This makes space for the file header; it is written again at the end of
+   // this method with updated values
+   // need a better way to get the length.  This should be queried on the
+   // header before writing
+   //---  
+   theFileHeader->writeStream(*theOutputStream);
+   ossim_uint64 headerLength = ((ossim_uint64)theOutputStream->tellp() - headerStart) /* + 1 */;
+   
+   ossimString representation;
+   theImageHeader->setActualBitsPerPixel(
+      ossim::getActualBitsPerPixel(scalarType));
+   theImageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
+   theImageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
+   theImageHeader->setNumberOfBands(bands);
+   theImageHeader->setImageMode('S');// blocked
+   
+   if((bands == 3)&&
+      (scalarType == OSSIM_UCHAR))
+   {
+      theImageHeader->setRepresentation("RGB");
+      theImageHeader->setCategory("VIS");
+   }
+   else if(bands == 1)
+   {
+      theImageHeader->setRepresentation("MONO");
+      theImageHeader->setCategory("MS");
+   }
+   else
+   {
+      theImageHeader->setRepresentation("MULTI");
+      theImageHeader->setCategory("MS");
+   }
+   theImageHeader->setBlocksPerRow(blocksHorizontal);
+   theImageHeader->setBlocksPerCol(blocksVertical);
+   theImageHeader->setNumberOfPixelsPerBlockRow(blockSize.x);
+   theImageHeader->setNumberOfPixelsPerBlockCol(blockSize.y);
+   theImageHeader->setNumberOfRows(rect.height());
+   theImageHeader->setNumberOfCols(rect.width());
+
+   ossimNitfImageBandV2_0 bandInfo;
+   for(idx = 0; idx < bands; ++idx)
+   {
+      std::ostringstream out;
+      
+      out << std::setfill('0')
+          << std::setw(2)
+          << idx;
+      
+      bandInfo.setBandRepresentation(out.str().c_str());
+      theImageHeader->setBandInfo(idx,
+                              bandInfo);
+   }
+
+   int imageHeaderStart = theOutputStream->tellp();
+   theImageHeader->writeStream(*theOutputStream);
+   int imageHeaderEnd = theOutputStream->tellp();
+   int imageHeaderSize = imageHeaderEnd - imageHeaderStart;
+
+   // ossimIpt ul = rect.ul();
+   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
+   ossim_uint64 tileNumber = 0;
+   ossimEndian endian;
+
+   // get the start to the first band of data block
+   //
+   ossim_uint64 streamOffset = theOutputStream->tellp();
+   
+   // holds the total pixels to the next band
+
+   ossim_uint64 blockSizeInBytes = blockSize.x*blockSize.y*ossim::scalarSizeInBytes(data->getScalarType());
+   ossim_uint64 bandOffsetInBytes = (blockSizeInBytes*blocksHorizontal*blocksVertical);
+
+   bool needSwapping = endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN;
+   while(data.valid() && !needsAborting())
+   {
+      if(needSwapping)
+      {
+         switch(data->getScalarType())
+         {
+            case OSSIM_USHORT16:
+            case OSSIM_USHORT11:
+            case OSSIM_USHORT12:
+            case OSSIM_USHORT13:
+            case OSSIM_USHORT14:
+            case OSSIM_USHORT15:
+            {
+               endian.swap((ossim_uint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_SSHORT16:
+            {
+               endian.swap((ossim_sint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_FLOAT:
+            case OSSIM_NORMALIZED_FLOAT:
+            {
+               endian.swap((ossim_float32*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_DOUBLE:
+            case OSSIM_NORMALIZED_DOUBLE:
+            {
+               endian.swap((ossim_float64*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            default:
+               break;
+         }
+      }
+
+      for(idx = 0; idx < bands; ++idx)
+      {
+         theOutputStream->seekp(streamOffset+ // start of image stream
+                                tileNumber*blockSizeInBytes + // start of block for band separate output
+                                bandOffsetInBytes*idx, // which band offset is it
+                                ios::beg); 
+         
+         theOutputStream->write((char*)(data->getBuf(idx)),
+                                blockSizeInBytes);
+      }
+      ++tileNumber;
+      
+      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
+
+      if(!needsAborting())
+      {
+         data = theInputConnection->getNextTile();
+      }
+   }
+   
+   std::streamoff pos = theOutputStream->tellp();
+
+   setComplexityLevel(pos, theFileHeader.get());
+
+   /*
+    * Need to change the way I compute file length and header length later
+    * We need to figure out a better way to compute.
+    */
+   theFileHeader->setFileLength(static_cast<ossim_uint64>(pos));
+   theFileHeader->setHeaderLength(headerLength);
+   theOutputStream->seekp(0, ios::beg);
+   imageInfoRecord.setSubheaderLength(imageHeaderSize);
+   theFileHeader->replaceImageInfoRecord(0, imageInfoRecord);
+   theFileHeader->writeStream(*theOutputStream);
+   
+   return true;
+}
+
+
+void ossimNitf20Writer::addRegisteredTag(
+   ossimRefPtr<ossimNitfRegisteredTag> registeredTag)
+{
+   ossimNitfTagInformation tagInfo;
+   tagInfo.setTagData(registeredTag.get());
+     theImageHeader->addTag(tagInfo);
+}
+
+void ossimNitf20Writer::addTags()
+{
+   ossimDate currentDate;
+   theFileHeader->setDate(currentDate);
+   
+   if(theCopyFieldsFlag)
+   {
+      ossimTypeNameVisitor visitor(ossimString("ossimNitfTileSource"),
+                                   true,
+                                   (ossimVisitor::VISIT_CHILDREN|ossimVisitor::VISIT_INPUTS));
+      accept(visitor);
+      
+      // If there are multiple image handlers, e.g. a mosaic do not uses.
+      ossimRefPtr<ossimNitfTileSource> nitf = 0;
+      if ( visitor.getObjects().size() == 1 )
+      {
+         nitf = visitor.getObjectAs<ossimNitfTileSource>( 0 );
+      }
+
+      if( nitf.valid() )
+      {
+         ossimString value;
+         ossimPropertyInterface* fileHeaderProperties = dynamic_cast<ossimPropertyInterface*>(theFileHeader.get());
+         ossimPropertyInterface* imageHeaderProperties = dynamic_cast<ossimPropertyInterface*>(theImageHeader.get());
+         bool nitf21Flag = false;
+         const ossimNitfFileHeader*   header      = nitf->getFileHeader();
+         const ossimNitfImageHeader*  imageHeader = nitf->getCurrentImageHeader();
+         if(header)
+         {
+            ossimString version = header->getPropertyValueAsString("fhdr");
+            nitf21Flag = version.contains("2.1");
+            value = header->getPropertyValueAsString("stype");
+            if(value.size())
+            {
+               fileHeaderProperties->setProperty("stype", value);
+            }
+            value = header->getPropertyValueAsString("ostaid");
+            if(value.size())
+            {
+               fileHeaderProperties->setProperty("ostaid", value);
+            }
+            value = header->getPropertyValueAsString("ftitle");
+            if(value.size())
+            {
+               fileHeaderProperties->setProperty("ftitle", value);
+            }
+            value = header->getPropertyValueAsString("fsclas");
+            if(value.size())
+            {
+               fileHeaderProperties->setProperty("fsclas", value);
+            }
+            value = header->getPropertyValueAsString("oname");
+            if(value.size())
+            {
+               fileHeaderProperties->setProperty("oname", value);
+            }
+            value = header->getPropertyValueAsString("ophone");
+            if(value.size())
+            {
+               fileHeaderProperties->setProperty("ophone", value);
+            }
+            int idx = 0;
+            for(idx = 0; idx < header->getNumberOfTags(); ++idx)
+            {
+               ossimNitfTagInformation info;
+               header->getTagInformation(info,
+                                         idx);
+               theFileHeader->addTag(info);
+            }
+            value = header->getPropertyValueAsString("");
+            if(value.size())
+            {
+               fileHeaderProperties->setProperty("", value);
+            }
+            value = header->getPropertyValueAsString("fdt");
+            if(value.size()==14)
+            {
+               if(nitf21Flag)
+               {
+                  ossimString year(value.begin()+2, value.begin()+4);
+                  ossimString mon(value.begin()+4, value.begin()+6);
+                  ossimString day(value.begin()+6, value.begin()+8);
+                  ossimString hour(value.begin()+8, value.begin()+10);
+                  ossimString min(value.begin()+10, value.begin()+12);
+                  ossimString sec(value.begin()+12, value.begin()+14);
+                  if(mon.toUInt32() < 13)
+                  {
+                     mon = monthConversionTable[mon.toUInt32()];
+                  }
+                  fileHeaderProperties->setProperty("fdt", day+hour+min+sec+"Z"+mon+year);
+               }
+               else
+               {
+                  fileHeaderProperties->setProperty("fdt", value);
+               }
+            }
+         }
+         if(imageHeader)
+         {
+            ossim_uint32 idx = 0;
+            for(idx = 0; idx < imageHeader->getNumberOfTags(); ++idx)
+            {
+               ossimNitfTagInformation info;
+               imageHeader->getTagInformation(info,
+                                              idx);
+               theImageHeader->addTag(info);
+            }
+            value = imageHeader->getPropertyValueAsString("tgtid");
+            if(value.size())
+            {
+               imageHeaderProperties->setProperty("tgtid", value);
+            }
+            value = imageHeader->getPropertyValueAsString("isclas");
+            if(value.size())
+            {
+               imageHeaderProperties->setProperty("isclas", value);
+            }
+            value = imageHeader->getPropertyValueAsString("igeolo");
+            if(value.size())
+            {
+               imageHeaderProperties->setProperty("igeolo", value);
+            }
+            value = imageHeader->getPropertyValueAsString("ititle");
+            if(nitf21Flag)
+            {
+               value = imageHeader->getPropertyValueAsString("iid2");
+            }
+            if(value.size())
+            {
+               imageHeaderProperties->setProperty("ititle", value);
+            }
+            if(!nitf21Flag)
+            {
+               value = imageHeader->getPropertyValueAsString("iscaut");
+               if(value.size())
+               {
+                  imageHeaderProperties->setProperty("iscaut", value);
+               }
+               value = imageHeader->getPropertyValueAsString("iscode");
+               if(value.size())
+               {
+                  imageHeaderProperties->setProperty("iscode", value);
+               }
+               value = imageHeader->getPropertyValueAsString("isctlh");
+               if(value.size())
+               {
+                  imageHeaderProperties->setProperty("isctlh", value);
+               }
+               value = imageHeader->getPropertyValueAsString("isrel");
+               if(value.size())
+               {
+                  imageHeaderProperties->setProperty("isrel", value);
+               }
+               value = imageHeader->getPropertyValueAsString("isctln");
+               if(value.size())
+               {
+                  imageHeaderProperties->setProperty("isctln", value);
+               }
+               value = imageHeader->getPropertyValueAsString("isdwng");
+               if(value.size())
+               {
+                  imageHeaderProperties->setProperty("isdevt", value);
+               }
+               value = imageHeader->getPropertyValueAsString("isorce");
+               if(value.size())
+               {
+                  imageHeaderProperties->setProperty("isorce", value);
+               }
+            }
+            value = imageHeader->getPropertyValueAsString("idatim");
+            if(value.size()==14)
+            {
+               if(nitf21Flag)
+               {
+                  ossimString year(value.begin()+2, value.begin()+4);
+                  ossimString mon(value.begin()+4, value.begin()+6);
+                  ossimString day(value.begin()+6, value.begin()+8);
+                  ossimString hour(value.begin()+8, value.begin()+10);
+                  ossimString min(value.begin()+10, value.begin()+12);
+                  ossimString sec(value.begin()+12, value.begin()+14);
+                  if(mon.toUInt32() < 13)
+                  {
+                     mon = monthConversionTable[mon.toUInt32()];
+                  }
+                  imageHeaderProperties->setProperty("idatim", day+hour+min+sec+"Z"+mon+year);
+               }
+               else
+               {
+                  imageHeaderProperties->setProperty("idatim", value);
+               }
+            }
+         }
+         
+         // we will port over only a selected few 
+      }
+   }
+}
+
+bool ossimNitf20Writer::saveState(ossimKeywordlist& kwl,
+                                  const char* prefix) const
+{
+   return ossimNitfWriterBase::saveState(kwl, prefix);
+}
+
+bool ossimNitf20Writer::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix)
+{
+   return ossimNitfWriterBase::loadState(kwl, prefix);
+}
diff --git a/src/imaging/ossimNitfTileSource.cpp b/src/imaging/ossimNitfTileSource.cpp
new file mode 100644
index 0000000..125a30a
--- /dev/null
+++ b/src/imaging/ossimNitfTileSource.cpp
@@ -0,0 +1,3683 @@
+//---
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  Contains class definition for ossimNitfTileSource.
+// 
+//---
+// $Id$
+
+#include <ossim/imaging/ossimNitfTileSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimInterleaveTypeLut.h>
+#include <ossim/base/ossimPackedBits.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimJpegMemSrc.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimJpegDefaultTable.h>
+#include <ossim/base/ossim2dTo2dShiftTransform.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/support_data/ossimNitfIchipbTag.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfStdidcTag.h>
+#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
+
+#include <cstdlib> /* free, malloc, size_t (jpeglib.h) */
+#include <cstdio>  /* FILE* (jpeglib.h) */
+#include <csetjmp> /** for jmp_buf (jpeglib.h) */
+#include <jerror.h>
+#include <jpeglib.h>
+#include <fstream>
+#include <algorithm> /* for std::fill */
+
+RTTI_DEF1_INST(ossimNitfTileSource, "ossimNitfTileSource", ossimImageHandler)
+
+#ifdef OSSIM_ID_ENABLED
+   static const char OSSIM_ID[] = "$Id: ossimNitfTileSource.cpp 22925 2014-10-28 22:01:09Z dburken $";
+#endif
+   
+//---
+// NOTE:  This should match the enumerations for ReadMode.
+//---
+static const char* READ_MODE[] = { "READ_MODE_UNKNOWN",
+                                   "READ_BIB_BLOCK",
+                                   "READ_BIP_BLOCK",
+                                   "READ_BIR_BLOCK",
+                                   "READ_BSQ_BLOCK",
+                                   "READ_BIB",
+                                   "READ_BIP",
+                                   "READ_BIR",
+                                   "READ_JPEG_BLOCK" };
+
+//***
+// Static trace for debugging
+//***
+static ossimTrace traceDebug("ossimNitfTileSource:debug");
+
+// 64x64*12bits
+// divide by 8 bits to get bytes gives you 6144 bytes
+static const ossim_uint32   OSSIM_NITF_VQ_BLOCKSIZE = 6144;
+
+/** @brief Extended error handler struct for jpeg code. */
+struct ossimJpegErrorMgr
+{
+   struct jpeg_error_mgr pub;	/* "public" fields */
+   jmp_buf setjmp_buffer;	/* for return to caller */
+};
+
+
+ossimNitfTileSource::ossimNitfTileSource()
+   :
+      ossimImageHandler(),
+      theTile(0),
+      theCacheTile(0),
+      theNitfFile(0),
+      theNitfImageHeader(0),
+      theReadMode(READ_MODE_UNKNOWN),
+      theScalarType(OSSIM_SCALAR_UNKNOWN),
+      theSwapBytesFlag(false),
+      theNumberOfInputBands(0),
+      theNumberOfOutputBands(0),
+      theBlockSizeInBytes(0),
+      theReadBlockSizeInBytes(0),
+      theNumberOfImages(0),
+      theCurrentEntry(0),
+      theImageRect(0,0,0,0),
+      theFileStr(0),
+      theOutputBandList(),
+      theCacheSize(0, 0),
+      theCacheTileInterLeaveType(OSSIM_INTERLEAVE_UNKNOWN),
+      theCacheEnabledFlag(false),
+      theEntryList(0),
+      theCacheId(-1),
+      thePackedBitsFlag(false),
+      theCompressedBuf(0),
+      theNitfBlockOffset(0),
+      theNitfBlockSize(0),
+      m_jpegOffsetsDirty(false)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::ossimNitfTileSource entered..." << endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
+#endif
+   }
+
+}
+
+ossimNitfTileSource::~ossimNitfTileSource()
+{
+   destroy();
+}
+
+void ossimNitfTileSource::destroy()
+{
+   if (theCacheId != -1)
+   {
+      ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
+      theCacheId = -1;
+   }
+
+   // Delete the list of image headers.
+   theNitfImageHeader.clear();
+
+   theNitfFile = 0;
+
+   shared_ptr<ossim::ifstream> str = std::dynamic_pointer_cast<ossim::ifstream>( theFileStr );
+   if ( str )
+   {
+      if(str->is_open())
+      {
+         str->close();
+      }
+   }
+   
+   theCacheTile = 0;
+   theTile      = 0;
+   theOverview  = 0;
+ }
+
+bool ossimNitfTileSource::isOpen()const
+{
+   
+   return (theNitfImageHeader.size() > 0);
+}
+
+bool ossimNitfTileSource::open()
+{
+   bool result = false;
+   
+   if(isOpen())
+   {
+      close();
+   }
+   
+   theErrorStatus = ossimErrorCodes::OSSIM_OK;
+
+   if ( parseFile() )
+   {
+      result = allocate();
+   }
+   if (result)
+   {
+      completeOpen();
+   }
+   
+   return result;
+}
+
+bool ossimNitfTileSource::open( std::shared_ptr<ossim::istream>& str,
+                                const std::string& connectionString )
+{
+   static const char MODULE[] = "ossimNitfTileSource::open( stream, ...)";
+
+   bool result = false;
+   if(!str) return result;
+   ossimFilename file = connectionString;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\nFile =  " << file << "\n";
+   }
+
+   if( isOpen() )
+   {
+      close();
+   }
+   
+   theErrorStatus = ossimErrorCodes::OSSIM_OK;
+   
+
+   theNitfFile = new ossimNitfFile();
+
+   result = theNitfFile->parseStream( file, *str);
+
+   if ( result )
+   {
+      // Get the number of images within the file.
+      theNumberOfImages = theNitfFile->getHeader()->getNumberOfImages();
+
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG:\nNumber of images " << theNumberOfImages << "\n"; 
+      }
+
+      theEntryList.clear();
+      
+      //---
+      // Get image header pointers.  Note there can be multiple images in one
+      // image file.
+      //---
+      
+      for (ossim_uint32 i = 0; i < theNumberOfImages; ++i)
+      {
+         ossimRefPtr<ossimNitfImageHeader> hdr = theNitfFile->getNewImageHeader(*str, i);
+         if (!hdr)
+         {
+            result = false;
+            setErrorStatus();
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << MODULE << " ERROR:\nNull image header!" << endl;
+            }
+            break;
+         }
+
+         if (traceDebug())
+         {
+            if(hdr.valid())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << MODULE << "DEBUG:"
+                  << "\nImage header[" << i << "]:\n" << *(hdr.get())
+                  << "\n";
+            }
+         }
+         if(hdr->isValid())
+         {
+            if( !hdr->isCompressed() )
+            {
+               // Skip entries tagged NODISPLAY, e.g. cloud mask entries.
+               if (hdr->getRepresentation() != "NODISPLY")
+               {
+                  theEntryList.push_back(i);
+                  theNitfImageHeader.push_back(hdr);
+               }
+               else 
+               {
+                  ossimString cat = hdr->getCategory().trim().downcase();
+                  // this is an NGA Highr Resoluion Digital Terrain Model NITF format
+                  if(cat == "dtem")
+                  {
+                     theEntryList.push_back(i);
+                     theNitfImageHeader.push_back(hdr);
+                  }
+               }
+
+            }
+            else if ( canUncompress(hdr.get()) )
+            {
+               theEntryList.push_back(i);
+               theCacheEnabledFlag = true;
+               theNitfImageHeader.push_back(hdr);
+            }
+            else
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "Entry " << i
+                     <<" has an unsupported compression code = "
+                     << hdr->getCompressionCode() << std::endl;
+               }
+            }
+         }   
+         
+      } // End: image header loop
+
+      // Reset the number of images in case we skipped some, e.g. tagged "NODISPLAY"
+      if ( theNitfImageHeader.size() )
+      {
+         theNumberOfImages = (ossim_uint32)theNitfImageHeader.size();
+      }
+      else
+      {
+         result = false;
+      }
+
+      
+
+      if ( result )
+      {
+         // Save the stream and connection/file name.
+         theFileStr = str;
+         theImageFile = file;
+         
+         // Initialize the lut to the current entry if the current entry has a lut.
+         initializeLut();
+
+         result = allocate();
+         
+         if (result)
+         {
+            completeOpen();
+         }
+      }
+      else
+      {
+         setErrorStatus();
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << MODULE << "DEBUG:\nNo images in file!" << endl;
+         }         
+      }
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit status: " << (result?"true":"false") << "\n";
+   }
+   
+   return result;
+}
+
+void ossimNitfTileSource::close()
+{
+   destroy();
+}
+
+bool ossimNitfTileSource::parseFile()
+{
+   static const char MODULE[] = "ossimNitfTileSource::parseFile";
+   
+   ossimFilename file = getFilename();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: Nitf file =  " << file << endl;
+   }
+
+   if (file.empty())
+   {
+      setErrorStatus();
+      return false;
+   }
+
+   if ( !theNitfFile )  // A close deletes "theNitfFile".
+   {
+      theNitfFile = new ossimNitfFile();
+   }
+   
+   if ( !theNitfFile->parseFile(file) )
+   {
+      setErrorStatus();
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << "DEBUG:" << "\nError parsing file!" << endl;
+      }
+
+      return false;
+   }
+
+   // Get the number of images within the file.
+   theNumberOfImages = theNitfFile->getHeader()->getNumberOfImages();
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << "DEBUG:\nNumber of images "
+         <<theNumberOfImages << std::endl; 
+   }
+   
+   if ( theNumberOfImages == 0 )
+   {
+      setErrorStatus();
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << "DEBUG:\nNo images in file!" << endl;
+      }
+      
+      return false;
+   }
+   theEntryList.clear();
+   //---
+   // Get image header pointers.  Note there can be multiple images in one
+   // image file.
+   //---
+   for (ossim_uint32 i = 0; i < theNumberOfImages; ++i)
+   {
+      ossimRefPtr<ossimNitfImageHeader> hdr = theNitfFile->getNewImageHeader(i);
+      if (!hdr)
+      {
+         setErrorStatus();
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " ERROR:\nNull image header!" << endl;
+         }
+         
+         return false;
+      }
+      if (traceDebug())
+      {
+         if(hdr.valid())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << MODULE << "DEBUG:"
+               << "\nImage header[" << i << "]:\n" << *hdr
+               << endl;
+         }
+      }
+
+      if(hdr->isValid())
+      {
+         if( !hdr->isCompressed() )
+         {
+            // Skip entries tagged NODISPLAY, e.g. cloud mask entries.
+            if (hdr->getRepresentation() != "NODISPLY")
+            {
+               theEntryList.push_back(i);
+               theNitfImageHeader.push_back(hdr);
+            }
+            else 
+            {
+               ossimString cat = hdr->getCategory().trim().downcase();
+               // this is an NGA Highr Resoluion Digital Terrain Model NITF format
+               if(cat == "dtem")
+               {
+                  theEntryList.push_back(i);
+                  theNitfImageHeader.push_back(hdr);
+               }
+            }
+
+         }
+         else if ( canUncompress(hdr.get()) )
+         {
+            theEntryList.push_back(i);
+            theCacheEnabledFlag = true;
+            theNitfImageHeader.push_back(hdr);
+         }
+         else
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "Entry " << i
+                  <<" has an unsupported compression code = "
+                  << hdr->getCompressionCode() << std::endl;
+            }
+            return false;
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "Entry " << i
+                  <<" has an invalid image header\n";
+
+         }
+      }
+   }
+
+   if(theEntryList.size()<1)
+   {
+      return false;
+   }
+   
+   //### WHY IS THIS HERE? THIS CAUSED A BUG BECAUSE theCurrentEntry was previously initialized 
+   //### in loadState() according to a KWL. Any entry index in the KWL was being ignored.
+   //if(theEntryList.size()>0)
+   //{
+   //   theCurrentEntry = theEntryList[0];
+   //}
+
+   theNumberOfImages = (ossim_uint32)theNitfImageHeader.size();
+   
+   if (theNitfImageHeader.size() != theNumberOfImages)
+   {
+      setErrorStatus();
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE
+            << "DEBUG:\nNumber of header not equal number of images!"
+            << endl;
+      }
+      
+      return false;
+   }
+
+   // Check the current entry range.
+   if ( theCurrentEntry >= theNumberOfImages )
+   {
+      if(theEntryList.size())
+      {
+         theCurrentEntry = theEntryList[0];
+      }
+   }
+   
+   // Initialize the lut to the current entry if the current entry has a lut.
+   initializeLut();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG:"
+         << "\nCurrent entry:  " << theCurrentEntry
+         << endl;
+   }
+
+
+   // Open up a stream to the file.
+   theFileStr = ossim::StreamFactoryRegistry::instance()->createIstream(
+      file, ios::in | ios::binary);
+   if (!theFileStr)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " ERROR:"
+            << "\nCannot open:  " << file.c_str() << endl;
+      }
+      return false;
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " leaving with true..." << endl;
+      
+   }
+   
+   return true;
+}
+
+bool ossimNitfTileSource::allocate()
+{
+   // Clear out the cache if there was any.
+   if (theCacheId != -1)
+   {
+      ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
+      theCacheId = -1;
+   }
+
+   // Clear buffers:
+   theTile = 0;
+   theCacheTile = 0;
+   theCompressedBuf.clear();
+
+   // Set the scalar type.
+   initializeScalarType();
+   if (theScalarType == OSSIM_SCALAR_UNKNOWN)
+   {
+      return false;
+   }
+
+   // Set the swap bytes flag.
+   initializeSwapBytesFlag();
+   
+   // Set the read mode.
+   initializeReadMode();
+   if (theReadMode == READ_MODE_UNKNOWN)
+   {
+      return false;
+   }
+   
+   // Set the number of bands.
+   initializeBandCount();
+   if (theNumberOfInputBands == 0)
+   {
+      return false;
+   }
+   
+   // Initialize the image rectangle. before the cache size is done
+   if (initializeImageRect() == false)
+   {
+      return false;
+   }
+   
+   // Initialize the cache size.  Must be done before
+   // setting the blocksize.  Since bit encoded data may very
+   // and we need to know if the nitf file needs to be accessed
+   // like a general raster.
+   //
+   initializeCacheSize();
+   if ( (theCacheSize.x == 0) || (theCacheSize.y == 0) )
+   {
+      return false;
+   }
+   
+   // Initialize the block size.
+   if (initializeBlockSize() == false)
+   {
+      return false;
+   }
+
+   // Initialize the cache tile interleave type.
+   initializeCacheTileInterLeaveType();
+   if (theCacheTileInterLeaveType == OSSIM_INTERLEAVE_UNKNOWN)
+   {
+      return false;
+   }
+
+   return true;
+}
+
+bool ossimNitfTileSource::allocateBuffers()
+{
+   //---
+   // Initialize the cache tile.  This will be used for a block buffer even
+   // if the cache is disabled.
+   //---
+   initializeCacheTile();
+   if (!theCacheTile.valid())
+   {
+      return false;
+   }
+
+   // Initialize the cache if enabled.
+   if (theCacheEnabledFlag)
+   {
+      theCacheId = ossimAppFixedTileCache::instance()->
+         newTileCache(theBlockImageRect, theCacheSize);
+   }
+
+   //---
+   // Initialize the compressed buffer if needed.
+   //---
+   initializeCompressedBuf();
+
+   //---
+   // Make the output tile.
+   //---
+   initializeOutputTile();
+
+   return true;
+}
+
+bool ossimNitfTileSource::canUncompress(const ossimNitfImageHeader* hdr) const
+{
+
+   bool result = false;
+   if (hdr)
+   {
+      ossimString code = hdr->getCompressionCode();
+
+      if (code == "C3") // jpeg
+      {
+         if (hdr->getBitsPerPixelPerBand() == 8)
+         {
+            result = true;
+         }
+         else
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "Entry with jpeg compression (C3) has an unsupported "
+                  << "JPEG data precision: " << hdr->getBitsPerPixelPerBand()
+                  << std::endl;
+            }
+         }
+      }
+      else if(isVqCompressed( code ) &&
+              (hdr->getCompressionHeader().valid()) )
+      {
+         // we will only support single band vq compressed NITFS
+         // basically CIB and CADRG products are single band code words.
+         //
+         if(hdr->getNumberOfBands() == 1)
+         {
+            result = true;
+         }
+      }
+   }
+   return result;
+}
+
+void ossimNitfTileSource::initializeReadMode()
+{
+   // Initialize the read mode.
+   theReadMode = READ_MODE_UNKNOWN;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return;
+   }
+
+   ossim_uint32 numberOfBlocks = getNumberOfBlocks();
+   ossimString imode           = hdr->getIMode();
+   ossimString compressionCode = hdr->getCompressionCode();
+
+   if ( (compressionCode == "C3") && ((imode == "B")||(imode == "P")) )
+   {
+      theReadMode = READ_JPEG_BLOCK; 
+   }
+   else if (numberOfBlocks > 1)
+   {
+      if (imode == "B")
+      {
+         theReadMode = READ_BIB_BLOCK;
+      }
+      else if (imode == "P")
+      {
+         theReadMode = READ_BIP_BLOCK;
+      }
+      else if (imode == "R")
+      {
+         theReadMode = READ_BIR_BLOCK;
+      }
+      else if (imode == "S")
+      {
+         theReadMode = READ_BSQ_BLOCK;
+      }
+   }
+   else // The entire image comprises one block.
+   {
+      if (imode == "B")
+      {
+         theReadMode = READ_BIB;
+      }
+      else if (imode == "P")
+      {
+         theReadMode = READ_BIP;
+      }
+      else if (imode == "R")
+      {
+         theReadMode = READ_BIR;
+      }
+      else if (imode == "S")
+      {
+         theReadMode = READ_BSQ_BLOCK;
+      }
+   }        
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::initializeReadMode DEBUG:"
+         << "\nnumberOfBlocks:  " << numberOfBlocks
+         << "\nIMODE:           " << imode
+         << "\nRead Mode:       " << READ_MODE[theReadMode]
+         << endl;
+   }
+}
+
+void ossimNitfTileSource::initializeScalarType()
+{
+   thePackedBitsFlag = false;
+   // Initialize the read mode.
+   theScalarType = OSSIM_SCALAR_UNKNOWN;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return;
+   }
+
+   ossim_int32 bitsPerPixel = hdr->getActualBitsPerPixelPerBand();
+   if (bitsPerPixel < 1)
+   {
+      bitsPerPixel = hdr->getBitsPerPixelPerBand();
+   }
+
+   ossimString pixelValueType = hdr->getPixelValueType().upcase();
+   
+   switch (bitsPerPixel)
+   {
+      case 8:
+      {
+         theScalarType = OSSIM_UINT8;
+         break;
+      }
+      case 11:
+      {
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_USHORT11;
+         }
+         break;
+      }
+      case 12:
+      {
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_USHORT12;
+         }
+         break;
+      }
+      case 13:
+      {
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_USHORT13;
+         }
+         break;
+      }
+      case 14:
+      {
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_USHORT14;
+         }
+         break;
+      }
+      case 15:
+      {
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_USHORT15;
+         }
+         break;
+      }
+      case  9:
+      case 10:
+      case 16:         
+      {
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_UINT16;
+         }
+         break;
+      }
+      case 32:
+      {
+         if(pixelValueType == "SI")
+         {
+            theScalarType = OSSIM_SINT32;
+         }
+         else if(pixelValueType == "R")
+         {
+            theScalarType = OSSIM_FLOAT32;
+         }
+         break;
+      }
+      case 64:
+      {
+         if(pixelValueType == "R")
+         {
+            theScalarType = OSSIM_FLOAT64;
+         }
+         
+         break;
+      }
+      default:
+      {
+         if(hdr->isCompressed())
+         {
+            thePackedBitsFlag = true;
+            if(bitsPerPixel < 8)
+            {
+               theScalarType = OSSIM_UINT8;
+            }
+            else if(bitsPerPixel < 16)
+            {
+               theScalarType = OSSIM_UINT16;
+            }
+            else if(bitsPerPixel < 32)
+            {
+               theScalarType = OSSIM_FLOAT32;
+            }
+         }
+         else
+         {
+            if(bitsPerPixel<8)
+            {
+               theScalarType = OSSIM_UINT8;
+            }
+         }
+         break;
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::initializeScalarType DEBUG:"
+         << "\nScalar type:  "
+         << (ossimScalarTypeLut::instance()->getEntryString(theScalarType))
+         << "\nPacked bits:  " << (thePackedBitsFlag?"true":"false")
+         << endl;
+   }
+}
+
+void ossimNitfTileSource::initializeSwapBytesFlag()
+{
+   if ( (theScalarType != OSSIM_UINT8) &&
+        (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN) )
+   {
+      theSwapBytesFlag = true;
+   }
+   else
+   {
+     theSwapBytesFlag = false;
+   }
+}
+
+void ossimNitfTileSource::initializeBandCount()
+{
+   // Initialize the read mode.
+   theNumberOfInputBands = 0;
+   theNumberOfOutputBands = 0;
+   //theOutputBandList.clear();
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return;
+   }
+
+   if(!isVqCompressed(hdr->getCompressionCode()))
+   {
+      theNumberOfInputBands = hdr->getNumberOfBands();
+      theNumberOfOutputBands = hdr->getNumberOfBands();
+      if(hdr->getRepresentation().contains("LUT")&&(theNumberOfInputBands == 1))
+      {
+         theNumberOfOutputBands = 3;
+      }
+   }
+   else 
+   {
+      ossimRefPtr<ossimNitfImageBand> bandInfo = hdr->getBandInformation(0);
+      if ( bandInfo.valid() )
+      {
+         theNumberOfInputBands = 1;
+         theNumberOfOutputBands = bandInfo->getNumberOfLuts();
+      }
+   }
+   
+   //for (ossim_uint32 i=0; i < theNumberOfOutputBands; ++i)
+   // Need to take bands from loadState to pass to Kakadu to avoid decompressing all bands
+   if (theOutputBandList.size() > 0) theNumberOfOutputBands = theOutputBandList.size();
+   else
+   {
+      theOutputBandList.resize(theNumberOfOutputBands);
+      for (ossim_uint32 i=0; i < theNumberOfOutputBands; ++i)
+      {
+        theOutputBandList[i] = i; // One to one for initial setup.
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::initializeBandCount DEBUG:"
+         << "\nInput Band count:  " << theNumberOfInputBands
+         << "\nOutput Band count:  " << theNumberOfOutputBands
+         << endl;
+   }
+}
+
+bool ossimNitfTileSource::initializeBlockSize()
+{
+   theBlockSizeInBytes     = 0;
+   theReadBlockSizeInBytes = 0;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return false;
+   }
+
+   ossim_uint32 bytesRowCol = 0;
+   ossim_uint32 bytesRowColCacheTile = 0;
+
+   if(isVqCompressed(hdr->getCompressionCode()))
+   {
+      bytesRowCol = OSSIM_NITF_VQ_BLOCKSIZE;
+   }
+   else
+   {
+      //---
+      // Busting int32 limit on single block data.
+      // Need a new read method to handle this. (drb - 09 May 2016)
+      //---
+      ossim_uint64 x     = hdr->getNumberOfPixelsPerBlockHoriz();
+      ossim_uint64 y     = hdr->getNumberOfPixelsPerBlockVert();
+      ossim_uint64 bpp   = hdr->getBitsPerPixelPerBand();
+      ossim_uint64 bytes = x * y * bpp / 8;
+      if ( bytes > 2147483647 )
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimNitfTileSource::initializeBlockSize WARNING!"
+               << "\nBusting 2 GIG block size: " << bytes
+               << std::endl;
+         }
+         return false;
+      }
+      bytesRowCol = (ossim_uint32)bytes;
+   }
+
+   if ( !bytesRowColCacheTile )
+   {
+      //---
+      // Busting int32 limit on single block data.
+      // Need a new read method to handle this. (drb - 09 May 2016)
+      //---
+      ossim_uint64 x = theCacheSize.x;
+      ossim_uint64 y = theCacheSize.y;
+      ossim_uint64 bpp = hdr->getBitsPerPixelPerBand();
+      ossim_uint64 bytes = x * y * bpp / 8;
+      if ( bytes > 2147483647 )
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimNitfTileSource::initializeBlockSize WARNING!"
+               << "\nBusting 2 GIG cache bytes: " << bytes
+               << std::endl;
+         }
+         return false;
+      }
+      
+      bytesRowColCacheTile = bytes;
+   }
+
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG:"
+         // << "\ncompressionHeader:  " << compressionHeader
+         << "\ngetNumberOfPixelsPerBlockHoriz():  "
+         << hdr->getNumberOfPixelsPerBlockHoriz()
+         << "\ngetNumberOfPixelsPerBlockVert():  "
+         << hdr->getNumberOfPixelsPerBlockVert()
+         << "\ngetBitsPerPixelPerBand():  "
+         << hdr->getBitsPerPixelPerBand()
+         << "\nbytesRowCol:  " << bytesRowCol
+         << "\nbytesRowColCacheTile:  " << bytesRowColCacheTile
+         << endl;
+   }
+#endif
+   
+   theBlockSizeInBytes = bytesRowCol;
+   theReadBlockSizeInBytes = theBlockSizeInBytes;
+   switch (theReadMode)
+   {
+      case READ_BSQ_BLOCK:
+      case READ_BIB_BLOCK:
+      {
+         break;
+      }
+      case READ_BIB:
+      {
+         theReadBlockSizeInBytes = bytesRowColCacheTile;
+         break;
+      }
+      
+      case READ_BIP_BLOCK:
+      case READ_BIR_BLOCK:
+      {
+         theBlockSizeInBytes     *= theNumberOfInputBands;
+         theReadBlockSizeInBytes *= theNumberOfInputBands;
+         break;
+      }
+      case READ_BIP:
+      case READ_BIR:   
+      {
+         theBlockSizeInBytes *= theNumberOfInputBands;
+         theReadBlockSizeInBytes = bytesRowColCacheTile*theNumberOfInputBands;
+         break;
+      }
+      case READ_JPEG_BLOCK:
+      {
+         theBlockSizeInBytes *= theNumberOfInputBands;
+         ossimString code = hdr->getCompressionCode();
+         if (code == "C3") // jpeg
+         {
+            m_jpegOffsetsDirty  = true;
+         }
+         break;
+      }
+      default:
+      {
+         return false;
+      }
+   }
+
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::initializeBlockSize DEBUG:"
+         << "\nNumber of input bands:          " << theNumberOfInputBands
+         << "\nNumber of output bands:          " << theNumberOfOutputBands
+         << "\nBlock size in bytes:      " << theBlockSizeInBytes
+         << "\nRead block size in bytes: " << theReadBlockSizeInBytes
+         << endl;
+   }
+#endif
+
+   return true;
+}
+
+//*************************************************************************************************
+// Virtual method determines the decimation factors at each resolution level. 
+// This implementation derives the R0 decimation from the image metadata if available, then hands
+// off the computation of remaining R-levels to the base class implementation.
+//*************************************************************************************************
+void ossimNitfTileSource::establishDecimationFactors()
+{
+   theDecimationFactors.clear();
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (hdr)
+   {
+      double decimation;
+      hdr->getDecimationFactor(decimation);
+      if ((decimation != 0.0) && !ossim::isnan(decimation))
+      {
+         //---
+         // Note: Commented out as other code is picking up the resolution and then we're applying
+         // a decimation on top of that. (drb Aug. 2011)
+         // ossimDpt dec_2d (decimation, decimation);
+         //---
+         ossimDpt dec_2d (1.0, 1.0);
+         theDecimationFactors.push_back(dec_2d);
+      }
+   }
+
+   // Just needed to set the first R level here, the base class can do the rest:
+   ossimImageHandler::establishDecimationFactors();
+}
+
+#if 0
+ossimImageGeometry* ossimNitfTileSource::getImageGeometry()
+{
+   //---
+   // Call base class getImageGeometry which will check for external geometry
+   // or an already set geometry.
+   //---
+   ossimImageGeometry* result = ossimImageHandler::getImageGeometry();
+
+   if (result)
+   {
+      if ( !result->getTransform() )
+      {
+         ossimRefPtr<ossim2dTo2dTransform> transform = 0;
+         
+         const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+         if (hdr)
+         {
+            //---
+            // Test for the ichipb tag and set the sub image if needed.
+            // 
+            // NOTE # 1:
+            // 
+            // There are nitf writers that set the ichipb offsets and only have
+            // IGEOLO field present.  For these it has been determined
+            // (but still in question) that we should not apply the sub image
+            // offset.
+            //
+            // See trac # 1578
+            // http://trac.osgeo.org/ossim/ticket/1578
+            //
+            // NOTE # 2:
+            //
+            // Let the ICHIPB have precedence over the STDIDC tag as we could
+            // have a chip of a segment.
+            //---
+            ossimRefPtr<ossimNitfRegisteredTag> tag =
+               hdr->getTagData(ossimString("ICHIPB"));
+            if (tag.valid())
+            {
+               ossimNitfIchipbTag* ichipb =
+                  PTR_CAST(ossimNitfIchipbTag, tag.get());
+               if (ichipb)
+               {
+//                  const ossimRefPtr<ossimNitfRegisteredTag> blocka =
+//                     hdr->getTagData(ossimString("BLOCKA"));
+//                  const ossimRefPtr<ossimNitfRegisteredTag> rpc00a =
+//                     hdr->getTagData(ossimString("RPC00A"));              
+//                  const ossimRefPtr<ossimNitfRegisteredTag> rpc00b =
+//                     hdr->getTagData(ossimString("RPC00B"));
+                  
+                  //---
+                  // If any of these tags are present we will use the sub
+                  // image from the ichipb tag.
+                  //---
+//                  if ( blocka.get() || rpc00a.get() || rpc00b.get() )
+                  // ************************* THERE ARE PROBLEMS NOT SETTING THIS AT SITE.  GO AHEAD AND ALWAYS INIT THE SHIFT
+                  {
+                     transform = ichipb->newTransform();
+                  }
+               }
+            }
+   
+            if ( !transform)
+            {
+               //---
+               // Look for the STDIDC tag for a sub image (segment) offset.
+               //
+               // See: STDI-002 Table 7.3 for documentation.
+               //---
+               tag = hdr->getTagData(ossimString("STDIDC"));
+               if (tag.valid() && (hdr->getIMode() == "B") )
+               {
+                  ossimDpt shift;
+                  ossimNitfStdidcTag* stdidc =
+                     PTR_CAST(ossimNitfStdidcTag, tag.get());
+                  if (stdidc)
+                  {
+                     ossim_int32 startCol = stdidc->getStartColumn().toInt32();
+                     ossim_int32 startRow = stdidc->getStartRow().toInt32();
+                     if ( (startCol > 0) && (startRow > 0) )
+                     {
+                        
+                        // field are one based; hence, the - 1.
+                        shift.x = (startCol-1) *
+                           hdr->getNumberOfPixelsPerBlockHoriz();
+                        shift.y = (startRow-1) *
+                           hdr->getNumberOfPixelsPerBlockVert();
+                     }
+                     if(shift.x > 0 ||
+                        shift.y > 0)
+                     {
+                        transform = new ossim2dTo2dShiftTransform(shift);
+                     }
+                  }
+               }
+            }
+            
+         } // matches: if (hdr)
+
+         if ( transform.valid() )
+         {
+            result->setTransform( transform.get() );
+         }
+         //else
+         //{
+         //   ossimImageGeometryRegistry::instance()->createTransform(this);
+         //}
+         
+         
+      } // matches: if ( !result->getTransform() )
+
+      if ( !result->getProjection() )
+      {
+         ossimRefPtr<ossimProjection> proj =
+            ossimProjectionFactoryRegistry::instance()->
+               createProjection(this);
+         if ( proj.valid() )
+         {
+            result->setProjection( proj.get() );
+         }
+         //else
+         //{
+         //   ossimImageGeometryRegistry::instance()->createProjection(this);
+         //}
+         
+      }
+      
+   } // matches: if (result)
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::createImageGeometry DEBUG:\n";
+
+      if (result)
+      {
+         result->print(ossimNotify(ossimNotifyLevel_DEBUG)) << "\n";
+      }
+   }
+
+   return result;
+}
+#endif
+
+bool ossimNitfTileSource::initializeImageRect()
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      theImageRect.makeNan();
+      return false;
+   }
+   
+   theBlockImageRect = hdr->getBlockImageRect();
+   theImageRect      = hdr->getImageRect();
+
+   if (traceDebug())
+   {
+      ossimIpt iloc;
+      hdr->getImageLocation(iloc); // for temp debug (drb)
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::initializeImageRect DEBUG:"
+         << "\noffset from ILOC field:  " << iloc
+         << "\nImage Rect:              " << theImageRect
+         << "\nBlock rect:              " << theBlockImageRect
+         << endl;
+   }
+   return true;
+}
+
+void ossimNitfTileSource::initializeCacheSize()
+{
+   theCacheSize.x = 0;
+   theCacheSize.y = 0;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return;
+   }
+   switch (theReadMode)
+   {
+      case READ_BIB_BLOCK:
+      case READ_BIP_BLOCK:
+      case READ_BIR_BLOCK:
+      case READ_BSQ_BLOCK:
+      case READ_JPEG_BLOCK:
+         theCacheSize.x = hdr->getNumberOfPixelsPerBlockHoriz();
+         theCacheSize.y = hdr->getNumberOfPixelsPerBlockVert();
+         break;
+
+      case READ_BIB:
+      case READ_BIP:
+      case READ_BIR:
+         theCacheSize.x = hdr->getNumberOfPixelsPerBlockHoriz();
+         theCacheSize.y = hdr->getNumberOfPixelsPerBlockVert();
+//          theCacheSize.x = getNumberOfSamples(0);
+//          theCacheSize.y = getTileHeight();
+//          if(theCacheSize.y > hdr->getNumberOfPixelsPerBlockVert())
+//          {
+//             theCacheSize.y = hdr->getNumberOfPixelsPerBlockVert();
+//          }
+         break;
+
+      default:
+         break;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::initializeCacheSize DEBUG:"
+         << "\nCache size:  " << theCacheSize
+         << endl;
+   }
+}
+
+void ossimNitfTileSource::initializeCacheTileInterLeaveType()
+{
+   theCacheTileInterLeaveType = OSSIM_INTERLEAVE_UNKNOWN;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return;
+   }
+
+   switch (theReadMode)
+   {
+      case READ_BIB_BLOCK:
+      case READ_BSQ_BLOCK:
+      case READ_BIB:
+      case READ_JPEG_BLOCK:  
+         theCacheTileInterLeaveType = OSSIM_BSQ;
+         break;
+
+      case READ_BIP_BLOCK:
+      case READ_BIP:
+         theCacheTileInterLeaveType = OSSIM_BIP;
+         break;
+
+      case READ_BIR_BLOCK:
+      case READ_BIR:
+         theCacheTileInterLeaveType = OSSIM_BIL;
+         break;
+
+      default:
+         break;
+   }
+
+   if (traceDebug())
+   {
+      ossimInterleaveTypeLut lut;
+      
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::initializeCacheTileInterLeaveType DEBUG:"
+         << "\nCache tile interleave type:  "
+         << lut.getEntryString(theCacheTileInterLeaveType)
+         << endl;
+   }
+}
+
+void ossimNitfTileSource::initializeCacheTile()
+{
+   theCacheTile = ossimImageDataFactory::instance()->create(
+      this,
+      theScalarType,
+      theNumberOfOutputBands,
+      theCacheSize.x,
+      theCacheSize.y);
+
+   theCacheTile->initialize();
+}
+
+void ossimNitfTileSource::initializeCompressedBuf()
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return;
+   }
+
+   if( (hdr->getRepresentation().upcase().contains("LUT")) ||
+       ( isVqCompressed(hdr->getCompressionCode()) ) )
+   {
+      theCompressedBuf.resize(theReadBlockSizeInBytes);
+      std::fill(theCompressedBuf.begin(), theCompressedBuf.end(), '\0');
+   }
+}
+
+void ossimNitfTileSource::initializeOutputTile()
+{
+   //---
+   // Make the output tile.  This implementation will use default tile size.
+   ossimImageDataFactory* idf = ossimImageDataFactory::instance();
+   theTile = idf->create(this, this);
+   theTile->initialize();
+}
+
+void ossimNitfTileSource::initializeLut()
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (hdr)
+   {
+      if ( hdr->hasLut() )
+      {
+         //---
+         // NOTE: Only band 0 ??? (drb)
+         //---
+         theLut = theNitfImageHeader[theCurrentEntry]->createLut(0);
+      }
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimNitfTileSource::getTile(
+   const  ossimIrect& tileRect, ossim_uint32 resLevel)
+{
+   // This tile source bypassed, or invalid res level, return a blank tile.
+   if(!isSourceEnabled() || !isOpen() || !isValidRLevel(resLevel))
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   if ( !theTile.valid() )
+   {
+      // First call to getTile:
+      allocateBuffers();
+      if ( !theTile.valid() )
+      {
+         return theTile;
+      }
+   }
+
+   // Rectangle must be set prior to getOverviewTile call.
+   theTile->setImageRectangle(tileRect);
+
+   if (resLevel)
+   {
+      if ( getOverviewTile(resLevel, theTile.get() ) )
+      {
+         return theTile;
+      }
+   }
+   
+   ossim_uint32 level = resLevel;
+   if (theStartingResLevel)  // Used as overview.
+   {
+      if (theStartingResLevel <= resLevel)
+      {
+         //---
+         // Adjust the level to be relative to the reader using this as
+         // overview.
+         //---
+         level -= theStartingResLevel; 
+      }
+   }
+
+   //---
+   // See if the whole tile is going to be filled, if not, start out with
+   // a blank tile so data from a previous load gets wiped out.
+   //---
+   if ( !tileRect.completely_within(theImageRect) )
+   {
+      // Start with a blank tile.
+      theTile->makeBlank();
+   }
+
+   //---
+   // See if any point of the requested tile is in the image.
+   //---
+   if ( tileRect.intersects(theBlockImageRect) )
+   {
+      ossimIrect clipRect = tileRect.clipToRect(theImageRect);
+            
+      // See if the requested clip rect is already in the cache tile.
+      if ( (clipRect.completely_within(theCacheTile->getImageRectangle()))&&
+           (theCacheTile->getDataObjectStatus() != OSSIM_EMPTY)&&
+           (theCacheTile->getBuf()))
+      {
+         //---
+         // Note: Clip the cache tile(nitf block) to the image clipRect since
+         // there are nitf blocks that go beyond the image dimensions, i.e.,
+         // edge blocks.
+         //---
+         ossimIrect cr =
+               theCacheTile->getImageRectangle().clipToRect(clipRect);
+         theTile->loadTile(theCacheTile->getBuf(),
+                           theCacheTile->getImageRectangle(),
+                           cr,
+                           theCacheTileInterLeaveType);
+         //---
+         // Validate the tile.  This will set the status to full, partial
+         // or empty.  Must be performed if any type of combining is to be
+         // performed down the chain.
+         //---
+         theTile->validate();
+      }
+      else
+      {
+         if ( loadTile(clipRect) == true )
+         {
+            //---
+            // Validate the tile.  This will set the status to full, partial
+            // or empty.  Must be performed if any type of combining is to be
+            // performed down the chain.
+            //---
+            theTile->validate();
+         }
+         else
+         {
+            //---
+            // Commented setting error status out for jpeg data that had several bad
+            // blocks but the rest of the image was good.  If the error status is
+            // set the overview builder stops! (drb) 10 May 2013
+            // Flag an error for callers:
+            // setErrorStatus();
+            
+            ossimNotify(ossimNotifyLevel_WARN)
+               << __FILE__ << " " << __LINE__
+               << " loadTile failed!"
+               << std::endl;
+
+            theTile->makeBlank(); // loadTile failed...
+         }
+      }
+   } // End of if ( tileRect.intersects(image_rect) )
+
+   return theTile;   
+}
+
+bool ossimNitfTileSource::loadTile(const ossimIrect& clipRect)
+{
+   ossimIrect zbClipRect  = clipRect;
+
+   const ossim_uint32 BLOCK_HEIGHT = theCacheSize.y;
+   const ossim_uint32 BLOCK_WIDTH  = theCacheSize.x;
+
+   zbClipRect.stretchToTileBoundary(ossimIpt(BLOCK_WIDTH, BLOCK_HEIGHT));
+   
+   //---
+   // Shift the upper left corner of the "clip_rect" to the an even nitf
+   // block boundry.  
+   //---
+   ossimIpt nitfBlockOrigin = zbClipRect.ul();
+
+   // Vertical block loop.
+   ossim_int32 y = nitfBlockOrigin.y;
+   while (y < zbClipRect.lr().y)
+   {
+      // Horizontal block loop.
+      ossim_int32 x = nitfBlockOrigin.x;
+      while (x < zbClipRect.lr().x)
+      {
+         if ( loadBlockFromCache(x, y, clipRect) == false )
+         {
+            if ( loadBlock(x, y) )
+            {
+               //---
+               // Note: Clip the cache tile(nitf block) to the image clipRect
+               // since there are nitf blocks that go beyond the image
+               // dimensions, i.e., edge blocks.
+               //---    
+               ossimIrect cr =
+                  theCacheTile->getImageRectangle().clipToRect(clipRect);
+               
+               theTile->loadTile(theCacheTile->getBuf(),
+                                 theCacheTile->getImageRectangle(),
+                                 cr,
+                                 theCacheTileInterLeaveType);
+            }
+            else
+            {
+               // Error loading...
+               return false;
+            }
+         }
+         
+         x += BLOCK_WIDTH; // Go to next block.
+      }
+      
+      y += BLOCK_HEIGHT; // Go to next row of blocks.
+   }
+
+   return true;
+}
+
+bool ossimNitfTileSource::loadBlockFromCache(ossim_uint32 x, ossim_uint32 y,
+                                             const ossimIrect& clipRect)
+{
+   bool result = false;
+   
+   if (theCacheEnabledFlag)
+   {
+      //---
+      // The origin set in the cache tile must have the sub image offset in it
+      // since "theTile" is relative to any sub image offset.  This is so that
+      // "theTile->loadTile(theCacheTile)" will work.
+      //---
+      ossimIpt origin(x, y);
+
+      ossimRefPtr<ossimImageData> tempTile =
+         ossimAppFixedTileCache::instance()->getTile(theCacheId, origin);
+      if (tempTile.valid())
+      {
+         //---
+         // Note: Clip the cache tile(nitf block) to the image clipRect since
+         // there are nitf blocks that go beyond the image dimensions, i.e.,
+         // edge blocks.
+         //---    
+         ossimIrect cr =
+            tempTile->getImageRectangle().clipToRect(clipRect);
+
+         theTile->loadTile(tempTile.get()->getBuf(),
+                           tempTile->getImageRectangle(),
+                           cr,
+                           theCacheTileInterLeaveType);
+         result = true;
+      }
+   }
+   
+   return result;
+}
+
+bool ossimNitfTileSource::loadBlock(ossim_uint32 x, ossim_uint32 y)
+{
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::loadBlock DEBUG:"
+         << "  x:  " << x << " y:  " << y << endl;
+   }
+#endif
+   
+   //---
+   // The origin set in the cache tile must have the sub image offset in it
+   // since "theTile" is relative to any sub image offset.  This is so that
+   // "theTile->loadTile(theCacheTile)" will work.
+   //---
+   ossimIpt origin(x, y);
+    
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   theCacheTile->setOrigin(origin);
+   ossim_uint32 readSize = theReadBlockSizeInBytes;
+   if(!theCacheTile->getImageRectangle().completely_within(theBlockImageRect))
+   {
+      readSize = getPartialReadSize(origin);
+   }
+   if((hdr->hasBlockMaskRecords())||
+      (readSize != theReadBlockSizeInBytes))
+   {
+      theCacheTile->makeBlank();
+   }
+
+   switch (theReadMode)
+   {
+      case READ_BIR:  
+      case READ_BIR_BLOCK:
+      case READ_BIP:  
+      case READ_BIP_BLOCK:
+      {
+         std::streamoff p;
+         if(getPosition(p, x, y, 0))
+         {
+            theFileStr->seekg(p, ios::beg);
+            char* buf = (char*)(theCacheTile->getBuf());
+            if (!theFileStr->read(buf, readSize))
+            {
+               theFileStr->clear();
+               ossimNotify(ossimNotifyLevel_FATAL)
+                  << "ossimNitfTileSource::loadBlock BIP Read Error!"
+                  << "\nReturning error..." << endl;
+               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+               
+               return false;
+            }
+         }
+         break;
+      }
+      case READ_BSQ_BLOCK:
+      case READ_BIB_BLOCK:
+      case READ_BIB:
+      {
+         //---
+         // NOTE:
+         // With some of these types we could do one read and get all bands.
+         // The reads are done per for future enabling on band selection
+         // at the image handler level.
+         //---
+         for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
+         {
+            ossim_uint8* buf =0;
+            if(isVqCompressed(hdr->getCompressionCode())||
+               hdr->getRepresentation().upcase().contains("LUT"))
+            {
+               buf = (ossim_uint8*)&(theCompressedBuf.front());
+            }
+            else
+            {
+               buf = (ossim_uint8*)(theCacheTile->getBuf(band));
+            }
+            std::streamoff p;
+            if(getPosition(p, x, y, band))
+            {
+               theFileStr->seekg(p, ios::beg);
+               if (!theFileStr->read((char*)buf, readSize))
+               {
+                  theFileStr->clear();
+                  ossimNotify(ossimNotifyLevel_FATAL)
+                     << "ossimNitfTileSource::loadBlock Read Error!"
+                     << "\nReturning error..." << endl;
+                  theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+                  return false;
+               }
+               else if(hdr->getCompressionCode() == "C4")
+               {
+                  vqUncompressC4(theCacheTile,
+                                 (ossim_uint8*)&(theCompressedBuf.front()));
+               }
+
+               else if(hdr->getCompressionCode() == "M4")
+               {
+                  vqUncompressM4(theCacheTile,
+                                 (ossim_uint8*)&(theCompressedBuf.front()));
+               }
+               else if(hdr->getRepresentation().upcase().contains("LUT"))
+               {
+                  lutUncompress(theCacheTile,
+                                (ossim_uint8*)&(theCompressedBuf.front()));
+               }
+            }
+         }
+         break;
+      }
+      case READ_JPEG_BLOCK:
+      {
+         if (uncompressJpegBlock(x, y) == false)
+         {
+            theCacheTile->makeBlank();
+            theFileStr->clear();
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "ossimNitfTileSource::loadBlock Read Error!"
+               << "\nReturning error..." << endl;
+            return false;
+         }
+         break;
+      }
+      default:
+         break;
+   }
+   
+   if(thePackedBitsFlag)
+   {
+      explodePackedBits(theCacheTile);
+   }
+   // Check for swap bytes.
+   if (theSwapBytesFlag)
+   {
+      ossimEndian swapper;
+      swapper.swap(theScalarType,
+                   theCacheTile->getBuf(),
+                   theCacheTile->getSize());
+   }
+
+   if ( !isVqCompressed(hdr->getCompressionCode()) )
+   {
+      convertTransparentToNull(theCacheTile);
+   }
+
+   // Set the origin of the cache tile.
+   theCacheTile->validate();
+   if (theCacheEnabledFlag)
+   {
+      // Add it to the cache for the next time.
+      ossimAppFixedTileCache::instance()->addTile(theCacheId, theCacheTile);
+   }
+   
+   return true;
+}
+
+void ossimNitfTileSource::explodePackedBits(ossimRefPtr<ossimImageData> packedBuffer)const
+{
+   ossim_uint8* tempBuf = new ossim_uint8[packedBuffer->getSizePerBandInBytes()];
+   ossim_uint32 idx      = 0;
+   ossim_uint32 bandIdx  = 0;
+   ossim_uint32 h = packedBuffer->getHeight();
+   ossim_uint32 w = packedBuffer->getWidth();
+   ossim_uint32 maxIdx = w*h;
+   ossim_uint32 bandCount = packedBuffer->getNumberOfBands();
+   switch(packedBuffer->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         
+         ossim_uint8* outputBuf = (ossim_uint8*)tempBuf;
+         for(bandIdx = 0; bandIdx < bandCount; ++bandIdx)
+         {
+            ossimPackedBits packedBits((ossim_uint8*)packedBuffer->getBuf(bandIdx),
+                                           getCurrentImageHeader()->getBitsPerPixelPerBand());
+            for(idx = 0; idx < maxIdx; ++idx)
+            {
+               *outputBuf = (ossim_uint8)packedBits.getValueAsUint32(idx);
+               ++outputBuf;
+            }
+            
+            memcpy((char*)packedBuffer->getBuf(bandIdx),
+                   (char*)tempBuf,
+                   theCacheTile->getSizePerBandInBytes()*bandCount);
+         }
+         break;
+      }
+      case OSSIM_UINT16:
+      {
+         
+         ossim_uint16* outputBuf = (ossim_uint16*)tempBuf;
+         for(bandIdx = 0; bandIdx < bandCount; ++bandIdx)
+         {
+            ossimPackedBits packedBits((ossim_uint8*)packedBuffer->getBuf(bandIdx),
+                                           getCurrentImageHeader()->getBitsPerPixelPerBand());
+            for(idx = 0; idx < maxIdx; ++idx)
+            {
+               *outputBuf = (ossim_uint16)packedBits.getValueAsUint32(idx);
+               ++outputBuf;
+            }
+            
+            memcpy((char*)packedBuffer->getBuf(bandIdx),
+                   (char*)tempBuf,
+                   theCacheTile->getSizePerBandInBytes()*bandCount);
+         }
+         break;
+      }
+      case OSSIM_FLOAT:
+      {
+         ossim_float32* outputBuf = (ossim_float32*)tempBuf;
+         for(bandIdx = 0; bandIdx < bandCount; ++bandIdx)
+         {
+            ossimPackedBits packedBits((ossim_uint8*)packedBuffer->getBuf(bandIdx),
+                                           getCurrentImageHeader()->getBitsPerPixelPerBand());
+            for(idx = 0; idx < maxIdx; ++idx)
+            {
+               *outputBuf = (ossim_float32)packedBits.getValueAsUint32(idx);
+               ++outputBuf;
+            }
+            
+            memcpy((char*)packedBuffer->getBuf(bandIdx),
+                   (char*)tempBuf,
+                   theCacheTile->getSizePerBandInBytes()*bandCount);
+         }
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+   delete [] tempBuf;
+}
+
+void ossimNitfTileSource::convertTransparentToNull(ossimRefPtr<ossimImageData> tile)const
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+
+   if(!hdr||!tile) return;
+
+   if(!tile->getBuf()) return;
+   ossimIpt tempOrigin = tile->getOrigin();
+   ossim_uint32 blockNumber = getBlockNumber(tempOrigin);
+   ossim_uint32 numberOfBands = tile->getNumberOfBands();
+   ossim_uint32 band = 0;
+
+   if(hdr->hasPadPixelMaskRecords())
+   {
+      if(hdr->hasTransparentCode())
+      {
+         ossim_uint32 idx = 0;
+         ossim_uint32 maxIdx = tile->getWidth()*tile->getHeight();
+         
+         for (band = 0; band < numberOfBands; ++band)
+         {
+            if(hdr->getPadPixelMaskRecordOffset(blockNumber,
+                                                band)!=0xffffffff)
+            {
+               switch(tile->getScalarType())
+               {
+                  case OSSIM_UINT8:
+                  {
+                     ossim_uint8 transparentValue = hdr->getTransparentCode();
+                     ossim_uint8* buf = (ossim_uint8*)tile->getBuf(band);
+                     ossim_uint8 nullPix = (ossim_uint8)tile->getNullPix(band);
+                     for(idx = 0; idx < maxIdx; ++idx)
+                     {
+                        if(*buf == transparentValue)
+                        {
+                           *buf = nullPix;
+                        }
+                        ++buf;
+                     }
+                     break;
+                  }
+                  case OSSIM_USHORT11:
+                  case OSSIM_USHORT12:
+                  case OSSIM_USHORT13:
+                  case OSSIM_USHORT14:
+                  case OSSIM_USHORT15:
+                  case OSSIM_UINT16:
+                  {
+                     ossim_uint16 transparentValue = hdr->getTransparentCode();
+                     ossim_uint16* buf = (ossim_uint16*)tile->getBuf(band);
+                     ossim_uint16 nullPix = (ossim_uint16)tile->getNullPix(band);
+                     for(idx = 0; idx < maxIdx; ++idx)
+                     {
+                        if(*buf == transparentValue)
+                        {
+                           *buf = nullPix;
+                        }
+                        ++buf;
+                     }
+                     break;
+                  }
+                  case OSSIM_SINT16:
+                  {
+                     ossim_sint16 transparentValue = hdr->getTransparentCode();
+                     ossim_sint16* buf = (ossim_sint16*)tile->getBuf(band);
+                     ossim_sint16 nullPix = (ossim_sint16)tile->getNullPix(band);
+                     for(idx = 0; idx < maxIdx; ++idx)
+                     {
+                        if(*buf == transparentValue)
+                        {
+                           *buf = nullPix;
+                        }
+                        ++buf;
+                     }
+                     break;
+                  }
+                  default:
+                  {
+                     break;
+                  }
+               }
+            }
+         }
+      }
+   }
+}
+
+
+double ossimNitfTileSource::getMinPixelValue(ossim_uint32 band)const
+{
+   double result = ossimImageHandler::getMinPixelValue(band);
+
+   if(thePackedBitsFlag)
+   {
+      if(result < 1.0) result = 1.0;
+   }
+   
+   return result;
+}
+
+double ossimNitfTileSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   double result = ossimImageHandler::getMaxPixelValue(band);
+
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if(hdr)
+   {
+      if(thePackedBitsFlag)
+      {
+         double test = 1<<(hdr->getBitsPerPixelPerBand());
+         
+         if(result > test) result = test;
+      }
+      else
+      {
+         ossim_int32 bitsPerPixel = hdr->getActualBitsPerPixelPerBand();
+         switch (bitsPerPixel)
+         {
+            case 11:
+            {
+               if (result > 2047.0)
+               {
+                  result = 2047.0;
+               }
+               break;
+            }
+            case 12:
+            {
+               if (result > 4095.0)
+               {
+                  result = 4095.0;
+               }
+               break;
+            }
+            default:
+               break;
+         }
+      }
+   }
+
+   return result;
+}
+
+double ossimNitfTileSource::getNullPixelValue(ossim_uint32 band)const
+{
+   double result = ossimImageHandler::getNullPixelValue(band);
+
+   if(thePackedBitsFlag)
+   {
+      if((result < 0) ||
+         (result > getMaxPixelValue(band)))
+         {
+            result = 0.0;
+         }
+   }
+
+
+   return result;
+}
+
+
+bool ossimNitfTileSource::getPosition(std::streamoff& streamPosition,
+                                      ossim_uint32 x,
+                                      ossim_uint32 y,
+                                      ossim_uint32 band) const
+{
+   //
+   // NOTE:  "theCacheSize is always relative to a block size except in
+   // the case where a block is the entire image.
+   //
+   streamPosition = 0;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return streamPosition;
+   }
+
+   ossim_uint64 blockNumber = getBlockNumber(ossimIpt(x,y));
+   
+#if 0
+   cout << "ossimNitfTileSource::getPosition blockNumber:  "
+        << blockNumber << endl;
+#endif
+   
+   streamPosition = (std::streamoff)hdr->getDataLocation(); // Position to first block.
+   if(hdr->hasBlockMaskRecords())
+   {
+      ossim_uint64 blockOffset = hdr->getBlockMaskRecordOffset(blockNumber,
+                                                               band);
+      if(blockOffset == 0xffffffff)
+      {
+         return false;
+      }
+      streamPosition += blockOffset;
+   }
+   
+   switch (theReadMode)
+   {
+      case READ_BIB_BLOCK:
+      {
+         if(!hdr->hasBlockMaskRecords())
+         {
+            streamPosition +=
+            (std::streamoff)((ossim_uint64)blockNumber * 
+                (ossim_uint64)getBlockOffset()) +
+               ((ossim_uint64)getBandOffset() * band);
+         }
+         else
+         {
+            streamPosition += (std::streamoff)((ossim_uint64)getBandOffset() * (ossim_uint64)band);
+            
+         }
+         break;
+      }
+      
+      case READ_BIB:
+      {
+         streamPosition +=
+         (std::streamoff) ((ossim_uint64)blockNumber * (ossim_uint64)theReadBlockSizeInBytes)+
+            ((ossim_uint64)getBandOffset() * (ossim_uint64)band);
+         break;
+      }
+      
+      case READ_BSQ_BLOCK:
+      {
+         
+         if(!hdr->hasBlockMaskRecords())
+         {
+            streamPosition += (std::streamoff)((ossim_uint64)blockNumber * 
+                                               (ossim_uint64)getBlockOffset()) +
+                                              ((ossim_uint64)getBandOffset() * 
+                                               (ossim_uint64)band);
+         }
+         
+         break;
+      }
+      case READ_JPEG_BLOCK:
+      {
+         streamPosition += (std::streamoff)((ossim_uint64)blockNumber * (ossim_uint64)theReadBlockSizeInBytes);
+         break;
+      }
+      default:
+      {
+         if(!hdr->hasBlockMaskRecords())
+         {
+            streamPosition += (std::streamoff)((ossim_uint64)blockNumber*(ossim_uint64)getBlockOffset());
+         }
+         
+         break;
+      }
+   }
+
+   return true;
+}
+
+std::streampos ossimNitfTileSource::getBandOffset() const
+{
+   std::streampos bandOffset = 0;
+
+   switch (theReadMode)
+   {
+      case READ_BIB_BLOCK:
+      case READ_BIP_BLOCK:
+      case READ_BIR_BLOCK:
+      case READ_BIB:
+      case READ_BIP:
+      case READ_BIR:
+         bandOffset = theBlockSizeInBytes;
+         break;
+         
+      case READ_BSQ_BLOCK:
+         bandOffset = getNumberOfBlocks() * theBlockSizeInBytes;
+         break;
+
+      default:
+         break;
+   }
+
+   return bandOffset;
+}
+
+std::streampos ossimNitfTileSource::getBlockOffset() const
+{
+   std::streampos blockOffset = 0;
+   std::streampos blockSizeInBytes = 0;
+   if (getNumberOfBlocks() == 1)
+   {
+      blockSizeInBytes = theReadBlockSizeInBytes;
+   }
+   else
+   {
+      blockSizeInBytes = theBlockSizeInBytes;
+   }
+   
+   switch (theReadMode)
+   {
+      case READ_BIB_BLOCK:
+      case READ_BIB:
+         // Band interleaved by block.
+         blockOffset = blockSizeInBytes * theNumberOfInputBands;
+         break;
+         
+      case READ_BIR_BLOCK:
+      case READ_BSQ_BLOCK:
+      case READ_BIP_BLOCK:
+      case READ_BIP:
+      case READ_BIR:
+         // Blocks side by side.
+         blockOffset = blockSizeInBytes;
+         break;
+      case READ_JPEG_BLOCK:
+        blockSizeInBytes = theReadBlockSizeInBytes;
+        break;
+   
+      default:
+         break;
+   }
+
+   return blockOffset;
+}
+   
+ossim_uint32 ossimNitfTileSource::getNumberOfBlocks() const
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return 0;
+   }
+
+   return static_cast<ossim_uint32>( hdr->getNumberOfBlocksPerRow() *
+                                     hdr->getNumberOfBlocksPerCol() );
+}
+
+bool ossimNitfTileSource::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   if ( !ossimImageHandler::loadState(kwl, prefix) )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfTileSource::loadState(kwl, prefix) DEBUG:"
+            << "\nUnable to load, exiting..." << std::endl;
+      }
+      return false;
+   }
+   
+   const char* lookup = kwl.find(prefix, "entry");
+   if (lookup)
+   {
+      ossimString s(lookup);
+      theCurrentEntry = s.toUInt32();
+   }
+
+   theOutputBandList.clear();
+   ossimString bands = kwl.find(prefix, ossimKeywordNames::BANDS_KW);
+   if (!bands.empty())
+   {
+      ossim::toSimpleVector(theOutputBandList, bands);
+   }
+
+   lookup = kwl.find(prefix,ossimKeywordNames::ENABLE_CACHE_KW);
+   if (lookup)
+   {
+      ossimString s(lookup);
+      theCacheEnabledFlag = s.toBool();
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::loadState(kwl, prefix) DEBUG:"
+         << "\nCurrent entry:      " << theCurrentEntry
+         << "\nCache enable flag:  " << theCacheEnabledFlag
+         << std::endl;
+   }
+   
+   return open();
+}
+
+bool ossimNitfTileSource::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix) const
+{
+   // Add the entry number.
+   kwl.add(prefix, "entry", theCurrentEntry, true);
+
+   // Add the cache_enable flag.
+   kwl.add(prefix, ossimKeywordNames::ENABLE_CACHE_KW, theCacheEnabledFlag, true);
+
+   // Call the base class save state.
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+ossimScalarType ossimNitfTileSource::getOutputScalarType() const
+{
+   return theScalarType;
+}
+
+ossim_uint32 ossimNitfTileSource::getTileWidth() const
+{
+   ossim_uint32 result = 0;
+   if(!theCacheSize.hasNans()&& theCacheSize.x > 0)
+   {
+      result = theCacheSize.x;
+   }
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = static_cast<ossim_uint32>(tileSize.x);
+   }
+   return result;
+}
+
+ossim_uint32 ossimNitfTileSource::getTileHeight() const
+{
+   ossim_uint32 result = 0;
+   if(!theCacheSize.hasNans()&& theCacheSize.y > 0)
+   {
+      result = theCacheSize.y;
+   }
+   else
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = static_cast<ossim_uint32>(tileSize.y);
+   }
+   return result;
+}
+
+ossim_uint32 ossimNitfTileSource::getNumberOfInputBands() const
+{
+   return theNumberOfInputBands;
+}
+
+ossim_uint32 ossimNitfTileSource::getNumberOfOutputBands() const
+{
+   return theNumberOfOutputBands;
+}
+
+ossim_uint32 ossimNitfTileSource::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   ossim_uint32 result = 0;
+   if (resLevel == 0)
+   {
+      const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+      if (hdr)
+      {
+         result = hdr->getNumberOfRows();
+      }
+   }
+   else if (theOverview.valid())
+   {
+      result = theOverview->getNumberOfLines(resLevel);
+   }
+   return result;
+}
+
+ossim_uint32 ossimNitfTileSource::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   ossim_uint32 result = 0;
+   if (resLevel == 0)
+   {
+      const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+      if (hdr)
+      {
+         result = hdr->getNumberOfCols();
+      }
+   }
+   else if (theOverview.valid())
+   {
+      result = theOverview->getNumberOfSamples(resLevel);
+   }
+   return result;
+}
+
+ossim_uint32 ossimNitfTileSource::getBlockNumber(const ossimIpt& block_origin) const
+{
+   ossim_uint32 blockNumber = 0;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return blockNumber; 
+   }
+
+   ossim_uint32 blockY;
+   ossim_uint32 blockX;
+   blockX  = (block_origin.x /
+              theCacheSize.x);
+   blockY= (block_origin.y /
+            theCacheSize.y);
+
+   switch (theReadMode)
+   {
+      case READ_BIB_BLOCK:
+      case READ_BIP_BLOCK:
+      case READ_BIR_BLOCK:
+      case READ_BSQ_BLOCK:
+      case READ_JPEG_BLOCK:
+      {
+         blockNumber = ((blockY*hdr->getNumberOfBlocksPerRow()) + blockX);
+         break;
+      }
+      case READ_BIB:
+      case READ_BIP:
+      case READ_BIR:
+         //---
+         // These read modes are for a single block image.  The cache size will
+         // be set to the width of the image (block) by the height of one tile.
+         //
+         // This is to avoid reading an entire large image with a single block
+         // into memory.
+         //---
+         blockNumber = blockY;
+         break;
+
+      default:
+         break;
+   }
+   return blockNumber;
+}
+
+ossim_uint32 ossimNitfTileSource::getPartialReadSize(const ossimIpt& /* blockOrigin */)const
+{
+   ossim_uint32 result = 0;
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return result;
+   }
+   
+   if(theCacheTile->getImageRectangle().completely_within(theBlockImageRect))
+   {
+      return theReadBlockSizeInBytes;
+   }
+   ossimIrect clipRect = theCacheTile->getImageRectangle().clipToRect(theBlockImageRect);
+   
+   result = (theCacheSize.x*
+             clipRect.height()*
+             hdr->getBitsPerPixelPerBand())/8;
+   
+   switch (theReadMode)
+   {
+      case READ_BSQ_BLOCK:
+      case READ_BIB_BLOCK:
+      case READ_BIB:
+      {
+         // purposely left blank.  only hear for clarity.
+         break;
+      }
+
+      case READ_BIP_BLOCK:
+      case READ_BIR_BLOCK:
+      case READ_BIP:
+      case READ_BIR:   
+      {
+         result *= theNumberOfInputBands;
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+   return result;
+}
+
+bool ossimNitfTileSource::isVqCompressed(const ossimString& compressionCode)const
+{
+   return((compressionCode == "C4")||
+          (compressionCode == "M4"));
+}
+
+
+ossim_uint32 ossimNitfTileSource::getImageTileWidth() const
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return 0;
+   }
+   return hdr->getNumberOfPixelsPerBlockHoriz();
+}
+
+ossim_uint32 ossimNitfTileSource::getImageTileHeight() const
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return 0;
+   }
+   return hdr->getNumberOfPixelsPerBlockVert();
+}
+
+ossimString ossimNitfTileSource::getShortName()const
+{
+   return ossimString("ossim_nitf");
+}
+
+ossimString ossimNitfTileSource::getLongName()const
+{
+   return ossimString("ossim nitf reader");
+}
+
+ossim_uint32 ossimNitfTileSource::getCurrentEntry() const
+{
+   return theCurrentEntry;
+}
+
+ossim_uint32 ossimNitfTileSource::getNumberOfEntries() const
+{
+   return (ossim_uint32)theEntryList.size();
+}
+
+void ossimNitfTileSource::getEntryList(std::vector<ossim_uint32>& entryList)const
+{
+   entryList = theEntryList;
+//    entryList.resize(theNumberOfImages);
+//    for (ossim_uint32 i = 0; i < theNumberOfImages; ++i)
+//    {
+//       entryList[i] = i;
+//    }
+}
+
+bool ossimNitfTileSource::setCurrentEntry(ossim_uint32 entryIdx)
+{
+   bool result = true;
+   if (theCurrentEntry != entryIdx)
+   {
+      if ( isOpen() )
+      {
+         if ( entryIdx < theNumberOfImages )
+         {
+            // Clear the geometry.
+            theGeometry = 0;
+            
+            // Must clear or openOverview will use last entries.
+            theOverviewFile.clear();
+            
+            theCurrentEntry = entryIdx;
+            theOutputBandList.clear();
+            //---
+            // Since we were previously open and the the entry has changed we
+            // need to reinitialize some things.
+            //---
+            result = allocate();
+            if (result)
+            {
+               completeOpen();
+            }
+         }
+         else
+         {
+            result = false; // Entry index out of range.
+         }
+      }
+      else
+      {
+         //---
+         // Not open.
+         // Allow this knowing that the parseFile will check for out of range.
+         //---
+         theCurrentEntry = entryIdx;
+      }
+   }
+   
+   if(result)
+   {
+      if(theNitfImageHeader[theCurrentEntry]->getRepresentation().contains("LUT"))
+      {
+         theLut = theNitfImageHeader[theCurrentEntry]->createLut(0);
+      }
+      
+      
+   }
+   return result;
+}
+
+bool ossimNitfTileSource::getCacheEnabledFlag() const
+{
+   return theCacheEnabledFlag;
+}
+
+void ossimNitfTileSource::setCacheEnabledFlag(bool flag)
+{
+   if (flag != theCacheEnabledFlag)
+   {
+      // State of caching has changed...
+
+      theCacheEnabledFlag = flag;
+
+      if ( theCacheEnabledFlag) // Cache enabled.
+      {
+         theCacheId = ossimAppFixedTileCache::instance()->
+            newTileCache(theBlockImageRect, theCacheSize);
+      }
+      else // Cache disabled...
+      {
+         // Clean out the cache if there was one.
+         if (theCacheId != -1)
+         {
+            ossimAppFixedTileCache::instance()->deleteCache(theCacheId);
+            theCacheId = -1;
+         }
+      }
+   }
+}
+
+const ossimNitfFileHeader* ossimNitfTileSource::getFileHeader()const
+{
+   if(theNitfFile.valid())
+   {
+      return theNitfFile->getHeader();
+   }
+   
+   return 0;
+}
+
+ossimNitfFileHeader* ossimNitfTileSource::getFileHeader()
+{
+   if(theNitfFile.valid())
+   {
+      return theNitfFile->getHeader();
+   }
+   
+   return 0;
+}
+
+const ossimNitfImageHeader* ossimNitfTileSource::getCurrentImageHeader() const
+{
+   if(theNitfImageHeader.size())
+   {
+      return theNitfImageHeader[theCurrentEntry].get();
+   }
+   
+   return 0;
+}
+
+ossimNitfImageHeader* ossimNitfTileSource::getCurrentImageHeader()
+{
+   if(theNitfImageHeader.size())
+   {
+      return theNitfImageHeader[theCurrentEntry].get();
+   }
+   
+   return 0;
+}
+
+bool ossimNitfTileSource::getRgbBandList(std::vector<ossim_uint32>& bandList) const
+{
+   bool result = false;
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+   const ossim_uint32 BOGUS = 99999;
+   if ( hdr && (BANDS > 2) )
+   {
+      ossim_uint32 r = BOGUS;
+      ossim_uint32 g = BOGUS;
+      ossim_uint32 b = BOGUS;
+
+      for ( ossim_uint32 i = 0; i < BANDS; ++i )
+      {
+         const ossimRefPtr<ossimNitfImageBand> imageBand = hdr->getBandInformation( i );
+         if ( imageBand.valid() )
+         {
+            ossimString os = imageBand->getBandRepresentation();
+            os.trim(); // Remove trailing spaces.
+            os.upcase();
+            if ( os == "R" )
+            {
+               r = i;
+            }
+            else if ( os == "G" )
+            {
+               g = i;
+            }
+            else if ( os == "B" )
+            {
+               b = i;
+            }
+            
+            if ( ( i > 1 ) &&
+                 ( r != BOGUS ) && ( g != BOGUS ) && ( b != BOGUS ) )
+            {
+               result = true;
+               bandList.resize(3);
+               bandList[0] = r;
+               bandList[1] = g;
+               bandList[2] = b;
+               break; // done...
+            }
+         }
+      }
+      // TODO: Derive rgb from ISUBCAT wavelength or other nitf tags.
+   }
+   
+   return result;
+   
+} // End: ossimNitfTileSource::getRgbBandList( ... )
+
+void ossimNitfTileSource::setBoundingRectangle(const ossimIrect& imageRect)
+{
+   theImageRect = imageRect;
+   // now shift the internal block rect as well
+   theBlockImageRect = (theBlockImageRect - theBlockImageRect.ul());
+}
+
+ossimRefPtr<ossimProperty> ossimNitfTileSource::getProperty(const ossimString& name)const
+{
+   if (name == ossimKeywordNames::ENABLE_CACHE_KW)
+   {
+      ossimProperty* p = new ossimBooleanProperty(name, theCacheEnabledFlag);
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   else 
+   {
+      if(theNitfFile.valid())
+      {
+         if(getFileHeader())
+         {
+            ossimRefPtr<ossimProperty> p = theNitfFile->getHeader()->getProperty(name);
+            if(p.valid())
+            {
+               p->setReadOnlyFlag(true);
+               return p;
+            }
+         }
+      }
+      const ossimNitfImageHeader* imageHeader = getCurrentImageHeader();
+      if(imageHeader)
+      {
+         ossimRefPtr<ossimProperty> p = imageHeader->getProperty(name);
+         if(p.valid())
+         {
+            p->setReadOnlyFlag(true);
+            return p;
+         }
+      }
+   }
+
+   return ossimImageHandler::getProperty(name);
+}
+
+void ossimNitfTileSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property) return;
+   
+   ossimString name = property->getName();
+
+   if (name == ossimKeywordNames::ENABLE_CACHE_KW)
+   {
+      ossimBooleanProperty* obj = PTR_CAST(ossimBooleanProperty,
+                                           property.get());
+      if (obj)
+      {
+         setCacheEnabledFlag(obj->getBoolean());
+      }
+   }
+   else
+   {
+      ossimImageHandler::setProperty(property);
+   }
+}
+
+void ossimNitfTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageHandler::getPropertyNames(propertyNames);
+   propertyNames.push_back(ossimKeywordNames::ENABLE_CACHE_KW);
+   if(getFileHeader())
+   {
+      getFileHeader()->getPropertyNames(propertyNames);
+   }
+   const ossimNitfImageHeader* imageHeader = getCurrentImageHeader();
+   if(imageHeader)
+   {
+      imageHeader->getPropertyNames(propertyNames);
+   }
+}
+
+ossimString ossimNitfTileSource::getSecurityClassification() const
+{
+   if(getCurrentImageHeader())
+   {
+      return getCurrentImageHeader()->getSecurityClassification();
+   }
+   
+   return "U";
+}
+
+void ossimNitfTileSource::lutUncompress(ossimRefPtr<ossimImageData> destination, ossim_uint8* source)
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr||!destination)
+   {
+      return;
+   }
+   if((destination->getNumberOfBands()<3)||
+      (!destination->getBuf())||
+      (destination->getScalarType()!=OSSIM_UINT8)||
+      (!theLut.valid()))
+   {
+      return;
+   }
+
+   if(destination->getNumberOfBands()!=theLut->getNumberOfBands())
+   {
+      return;
+   }
+   
+   ossim_uint8* tempRows[3];
+   tempRows[0] = (ossim_uint8*)destination->getBuf(0);
+   tempRows[1] = (ossim_uint8*)destination->getBuf(1);
+   tempRows[2] = (ossim_uint8*)destination->getBuf(2);
+   
+   ossim_uint8* srcPtr = source;
+   ossim_uint32 compressionYidx   = 0;
+   ossim_uint32 compressionXidx   = 0;
+   ossim_uint32 uncompressIdx     = 0;
+   ossim_uint32 h = destination->getHeight();
+   ossim_uint32 w = destination->getWidth();
+   
+   for(compressionYidx = 0; compressionYidx < h; ++compressionYidx)
+   {
+      for(compressionXidx = 0; compressionXidx < w; ++compressionXidx)
+      {
+         tempRows[0][uncompressIdx] = (*theLut)[*srcPtr][0];
+         tempRows[1][uncompressIdx] = (*theLut)[*srcPtr][1];
+         tempRows[2][uncompressIdx] = (*theLut)[*srcPtr][2];
+         ++srcPtr;
+         ++uncompressIdx;
+      }
+   }
+}
+
+void ossimNitfTileSource::vqUncompressC4(
+   ossimRefPtr<ossimImageData> destination, ossim_uint8* source)
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr||!destination)
+   {
+      return;
+   }
+
+   const ossim_uint32 BANDS = destination->getNumberOfBands();
+
+   if( ( (BANDS != 1) && (BANDS!=3) ) ||
+       (!destination->getBuf()) ||
+       (destination->getScalarType()!=OSSIM_UINT8) ||
+       !theLut.valid() ||
+       (theLut->getNumberOfBands() != BANDS) )
+   {
+      return;
+   }
+   
+   ossimNitfVqCompressionHeader* compressionHeader =
+      PTR_CAST(ossimNitfVqCompressionHeader,
+               hdr->getCompressionHeader().get());
+
+   if(!compressionHeader)
+   {
+      return;
+   }
+   
+   const std::vector<ossimNitfVqCompressionOffsetTableData>& table =
+      compressionHeader->getTable();
+
+   ossimRefPtr<ossimNitfImageBand> bandInfo = hdr->getBandInformation(0);
+   
+   if(!bandInfo.valid()) return;
+   
+   std::vector<ossimRefPtr<ossimNitfImageLut> > luts(BANDS);
+   std::vector<ossim_uint8*> tempRows(BANDS);
+   
+   ossim_uint32 band;
+   for (band =0; band<BANDS; ++band)
+   {
+      luts[band] = bandInfo->getLut(band);
+      if ( luts[band].valid() )
+      {
+         tempRows[band] = (ossim_uint8*)destination->getBuf(band);
+      }
+      else
+      {
+         return;
+      }
+   }
+
+   ossimPackedBits bits(source, compressionHeader->getImageCodeBitLength());
+
+
+   const ossim_uint32 ROWS = static_cast<ossim_uint32>(table.size());
+   const ossim_uint32 COLS =
+      static_cast<ossim_uint32>(table[0].
+                                theNumberOfValuesPerCompressionLookup);
+   const ossim_uint32 COMPRESSION_HEIGHT =
+      compressionHeader->getNumberOfImageRows();
+   const ossim_uint32 COMPRESSION_WIDTH  =
+      compressionHeader->getNumberOfImageCodesPerRow();
+   ossim_uint32 DEST_WIDTH  = destination->getWidth();
+   
+   ossim_uint32 compressionIdx = 0;
+   ossim_uint32 uncompressIdx  = 0;
+   ossim_uint32 uncompressYidx = 0;
+   ossim_uint8  lutValue = 0;
+   ossim_uint8* data     = 0;
+   ossim_uint32 codeWord = 0;
+   
+   for(ossim_uint32 compressionYidx = 0;
+       compressionYidx < COMPRESSION_HEIGHT;
+       ++compressionYidx)
+   {
+      uncompressYidx = compressionYidx * ROWS * DEST_WIDTH;
+      
+      for(ossim_uint32 compressionXidx = 0;
+          compressionXidx < COMPRESSION_WIDTH;
+          ++compressionXidx)
+      {
+         uncompressIdx = uncompressYidx + COLS * compressionXidx;
+
+         codeWord = bits.getValueAsUint32(compressionIdx++);
+         codeWord *= COLS;
+
+         for(ossim_uint32 rowIdx = 0; rowIdx < ROWS; ++rowIdx)
+         {
+            data = &(table[rowIdx].theData[codeWord]);
+            
+            for(ossim_uint32 colIdx = 0; colIdx < COLS; ++colIdx)
+            {
+               lutValue = (*data)&0xff;
+
+               for (band = 0; band < BANDS; ++band)
+               {
+                  ossim_uint8 p = (*theLut.get())[lutValue][band];
+                  tempRows[band][uncompressIdx+colIdx] = p;
+               }
+               ++data;
+               
+            } // column loop
+
+            uncompressIdx += DEST_WIDTH;
+            
+         } // row loop
+
+      } // x compression loop
+      
+   } // y compression loop
+}
+
+void ossimNitfTileSource::vqUncompressM4(
+   ossimRefPtr<ossimImageData> destination, ossim_uint8* source)
+{
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr||!destination)
+   {
+      return;
+   }
+
+   const ossim_uint32 BANDS = destination->getNumberOfBands();
+
+   if(( (BANDS != 1)&&(BANDS!=3) ) ||
+      (!destination->getBuf())||
+      (destination->getScalarType()!=OSSIM_UINT8))
+   {
+      return;
+   }
+   
+   ossimNitfVqCompressionHeader* compressionHeader =
+      PTR_CAST(ossimNitfVqCompressionHeader,
+               hdr->getCompressionHeader().get());
+
+   if(!compressionHeader)
+   {
+      return;
+   }
+
+   const std::vector<ossimNitfVqCompressionOffsetTableData>& table =
+      compressionHeader->getTable();
+
+   ossimRefPtr<ossimNitfImageBand> bandInfo = hdr->getBandInformation(0);
+   
+   if(!bandInfo.valid()) return;
+   
+   std::vector<ossimRefPtr<ossimNitfImageLut> > luts(BANDS);
+   std::vector<ossim_uint8*> tempRows(BANDS);
+
+   ossim_uint32 band;
+   for (band =0; band<BANDS; ++band)
+   {
+      luts[band] = bandInfo->getLut(band);
+      if ( luts[band].valid() )
+      {
+         tempRows[band] = (ossim_uint8*)destination->getBuf(band);
+      }
+      else
+      {
+         return;
+      }
+   }
+
+   const ossim_uint8 NI = 216; // null index (transparency index).
+   const ossim_uint8 NP = 0;   // null pixel
+
+   ossim_uint32 destWidth  = destination->getWidth();
+   ossimPackedBits bits(source, compressionHeader->getImageCodeBitLength());
+
+   ossim_uint32 compressionYidx   = 0;
+   ossim_uint32 compressionXidx   = 0;
+   ossim_uint32 compressionIdx    = 0;
+   ossim_uint32 uncompressIdx     = 0;
+   ossim_uint32 uncompressYidx    = 0;
+   ossim_uint32 rows   = (ossim_uint32)table.size();
+   ossim_uint32 cols   = 0;
+   ossim_uint32 rowIdx = 0;
+   ossim_uint32 colIdx = 0;
+   if(rows)
+   {
+      cols = table[0].theNumberOfValuesPerCompressionLookup;
+   }
+   ossim_uint32 compressionHeight = compressionHeader->getNumberOfImageRows();
+   ossim_uint32 compressionWidth  =
+      compressionHeader->getNumberOfImageCodesPerRow();
+   ossim_uint8 lutValue = 0;
+   ossim_uint8* data=0;
+
+   for(compressionYidx = 0;
+       compressionYidx < compressionHeight;
+       ++compressionYidx)
+   {
+      uncompressYidx = compressionYidx*rows*destWidth;
+
+      for(compressionXidx = 0;
+          compressionXidx < compressionWidth;
+          ++compressionXidx)
+      {
+         uncompressIdx = uncompressYidx + cols*compressionXidx;
+         ossim_uint32 codeWord = bits.getValueAsUint32(compressionIdx);
+         
+         bool transparent = false;
+         if (codeWord == 4095)
+         {
+            //---
+            // Check to see if the whole kernel is transparent.  If no, the
+            // null index '216' could be used for valid pixels.
+            //
+            // For more see docs:
+            // MIL-PRF-89041A 3.13.1.2 Transparent pixels
+            // MIL-STD-2411
+            //---
+            codeWord *= cols;
+            transparent = true;
+            for(rowIdx = 0; rowIdx < rows; ++rowIdx)
+            {
+               data = &table[rowIdx].theData[codeWord];
+               
+               for(colIdx = 0; colIdx < cols; ++colIdx)
+               {
+                  lutValue = (*data)&0xff;
+                  if (lutValue != NI)
+                  {
+                     // Not a kernel full of transparent pixels.
+                     transparent = false;
+                     break;
+                  }
+                  ++data;
+               }
+               if (!transparent)
+               {
+                  break;
+               }
+               uncompressIdx += destWidth;
+            }
+         }
+
+         // Reset everyone for loop to copy pixel data from lut.
+         uncompressIdx = uncompressYidx + cols*compressionXidx;
+         codeWord = bits.getValueAsUint32(compressionIdx);
+         codeWord *= cols;
+
+         for(rowIdx = 0; rowIdx < rows; ++rowIdx)
+         {
+            data = &table[rowIdx].theData[codeWord];
+            
+            for(colIdx = 0; colIdx < cols; ++colIdx)
+            {
+               lutValue = (*data)&0xff;
+               
+               for (band = 0; band < BANDS; ++band)
+               {
+                  ossim_uint8 p = luts[band]->getValue(lutValue);
+                  tempRows[band][uncompressIdx+colIdx] = (!transparent?p:NP);
+               }
+               ++data;
+            }
+
+            uncompressIdx += destWidth;
+         }
+         ++compressionIdx;
+         
+      } // x loop
+      
+   } // y loop
+}
+
+bool ossimNitfTileSource::scanForJpegBlockOffsets()
+{
+   // Find, capture all jpeg block offsets and sizes for an entry.
+   
+   bool allBlocksFound = false;
+   
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+
+   if ( !hdr || (theReadMode != READ_JPEG_BLOCK) || !theFileStr )
+   {
+      return allBlocksFound; // Get out...
+   }
+
+   theNitfBlockOffset.clear();
+   theNitfBlockSize.clear();
+
+   //---
+   // Get the totol blocks.
+   // Note:  There can be more than one jpeg image in the nitf.  So after blocks
+   // found equals total_blocks get out.
+   //---
+   ossim_uint32 total_blocks = hdr->getNumberOfBlocksPerRow()*hdr->getNumberOfBlocksPerCol();
+   
+   //---
+   // NOTE:
+   // SOI = 0xffd8 Start of image
+   // EOI = 0xffd9 End of image
+   // DHT = 0xffc4 Define Huffman Table(s)
+   // DQT = 0xffdb Define Quantization Table(s)
+   //---
+
+   // Seek to the first block.
+   theFileStr->seekg(hdr->getDataLocation(), ios::beg);
+
+   if ( theFileStr->good() )
+   {
+      const ossim_uint8 AP6 = 0xe6;
+      const ossim_uint8 AP7 = 0xe7;
+      const ossim_uint8 DHT = 0xc4;
+      const ossim_uint8 DQT = 0xdb;
+      const ossim_uint8 EOI = 0xd9;
+      const ossim_uint8 FF  = 0xff;
+      const ossim_uint8 SOI = 0xd8;
+      const ossim_uint8 SOS = 0xda;
+
+      union
+      {
+         char c;
+         ossim_uint8 uc;
+      } ct;
+
+      std::streamoff soiOffset = 0;
+      std::streamoff eoiOffset = 0;
+      ossim_uint16   length    = 0;
+
+      ossimEndian* swapper = 0;
+      if ( ossim::byteOrder() == OSSIM_LITTLE_ENDIAN )
+      {
+         swapper = new ossimEndian();
+      }
+      
+      // Find all the SOI markers.
+      while ( theFileStr->get( ct.c ) && !allBlocksFound ) 
+      {
+         if ( ct.uc == FF ) // Found FF byte.
+         {
+            // Loop to skip multiple 0xff's in cases like FF FF D8
+            while ( theFileStr->get( ct.c ) )
+            {
+               if ( ct.uc != FF)
+               {
+                  break;
+               }
+            }
+         
+            if ( ct.uc == SOI ) 
+            {
+               // At SOI 0xFFD8 marker... SOI marker offset is two bytes back.
+               soiOffset = ((std::streamoff)theFileStr->tellg()) - 2;
+
+               // Now look for matching EOI.
+               while ( theFileStr->get( ct.c ) )
+               {
+                  if ( ct.uc == FF ) // Found FF byte.
+                  {
+                     // Loop to skip multiple 0xff's in cases like FF FF D8
+                     while ( theFileStr->get( ct.c ) )
+                     {
+                        if ( ct.uc != FF )
+                        {
+                           break;
+                        }
+                     }
+
+                     if ( ct.uc == EOI )
+                     {
+                        // At EOI 0xD9marker...
+                        eoiOffset = theFileStr->tellg();
+
+                        // Capture offset:
+                        theNitfBlockOffset.push_back( soiOffset );
+
+                        // Capture block size:
+                        theNitfBlockSize.push_back( eoiOffset - soiOffset );
+
+                        //---
+                        // Since there can be more than one jpeg entry in a file, breeak out of
+                        // loop when we hit block size.
+                        //---
+                        if ( theNitfBlockOffset.size() == total_blocks )
+                        {
+                           allBlocksFound = true;
+                        }
+
+                        break; // From "find EOI" while loop.
+                     }
+                     //---
+                     // These are things to skip to avoid hitting random sequence of FFD9
+                     // and picking up a false EOI.
+                     // Not a complete set of markers but all test data works.
+                     // drb - 14 May 2013.
+                     //---
+                     else if ( ( ct.uc == AP6 ) || ( ct.uc == AP7 ) || ( ct.uc == DHT ) ||
+                               ( ct.uc == DQT ) || ( ct.uc == SOS ) ||
+                               ( ( ct.uc >= 0xc0 ) && ( ct.uc <= 0xcF ) )
+                               )
+                     {
+                        // Length two byte big endian.
+                        theFileStr->read( (char*)&length, 2 );
+                        if ( swapper )
+                        {
+                           swapper->swap( length );
+                        }
+                        // Length includes two length bytes.
+
+                        // Seek to the end of the record.
+                        theFileStr->seekg( length - 2, std::ios_base::cur );
+                     }
+
+                  } //  Matches: if ( ct.uc == FF )
+                  
+               } // Matches: while ( theFileStr->get( ut.c ) ) "find EOI loop" 
+               
+            } // Matches: if ( ut.uc == SOI ) "SOI marker found"
+
+         } // Matches: if ( ut.uc == FF )
+
+      } // Matches: while ( theFileStr->get( ut.c ) && !allBlocksFound )
+
+      if ( swapper )
+      {
+         delete swapper;
+         swapper = 0;
+      }
+
+   } // Matches: if ( theFileStr->good() )
+
+   theFileStr->seekg(0, ios::beg);
+   theFileStr->clear();
+
+#if 0 /* Please leave for debug. (drb) */
+   std::streamoff startOfData = hdr->getDataLocation();
+   ossimNotify(ossimNotifyLevel_WARN) << "current entry: " << theCurrentEntry << "\n";
+   for (ossim_uint32 i = 0; i < total_blocks; ++i)
+   {
+      cout << "theNitfBlockOffset[" << i << "]: " << theNitfBlockOffset[i]
+           << "\nrealative_offset[" << i << "]:   " << (theNitfBlockOffset[i] - startOfData)
+           << "\ntheNitfBlockSize[" << i << "]:   " << theNitfBlockSize[i]
+           << "\n";
+   }
+#endif
+   
+   if ( !allBlocksFound )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG:"
+            << "\nBlock offset count wrong!"
+            << "\nexpected blocks:        " << total_blocks
+            << "\noffset array count:     " << theNitfBlockOffset.size()
+            << "\nblock size array count: " << theNitfBlockSize.size()
+            << std::endl;
+      }
+      theNitfBlockOffset.clear();
+      theNitfBlockSize.clear();
+   }
+
+   return allBlocksFound;
+}
+
+bool ossimNitfTileSource::uncompressJpegBlock(ossim_uint32 x, ossim_uint32 y)
+{
+   ossim_uint32 blockNumber = getBlockNumber( ossimIpt(x,y) );
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfTileSource::uncompressJpegBlock DEBUG:"
+         << "\nblockNumber:  " << blockNumber
+         << std::endl;
+   }
+
+   //---
+   // Logic to hold off on scanning for offsets until a block is actually needed
+   // to speed up loads for things like ossim-info that don't actually read
+   // pixel data.
+   //---
+   if ( m_jpegOffsetsDirty )
+   {
+      if ( scanForJpegBlockOffsets() )
+      {
+         m_jpegOffsetsDirty = false;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "ossimNitfTileSource::uncompressJpegBlock scan for offsets error!"
+            << "\nReturning error..." << endl;
+         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+         return false;
+      }
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\noffset to block: " << theNitfBlockOffset[blockNumber]
+         << "\nblock size: " << theNitfBlockSize[blockNumber]
+         << std::endl;
+   }
+   
+   // Seek to the block.
+   theFileStr->seekg(theNitfBlockOffset[blockNumber], ios::beg);
+   
+   // Read the block into memory.
+   std::vector<ossim_uint8> compressedBuf(theNitfBlockSize[blockNumber]);
+   if (!theFileStr->read((char*)&(compressedBuf.front()),
+                        theNitfBlockSize[blockNumber]))
+   {
+      theFileStr->clear();
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "ossimNitfTileSource::uncompressJpegBlock Read Error!"
+         << "\nReturning error..." << endl;
+      return false;
+   }
+
+   //---
+   // Most of comments below from jpeg-6b "example.c" file.
+   //---
+   
+   /* This struct contains the JPEG decompression parameters and pointers
+    * to working space (which is allocated as needed by the JPEG library).
+    */
+   jpeg_decompress_struct cinfo;
+   
+   /* We use our private extension JPEG error handler.
+    * Note that this struct must live as long as the main JPEG parameter
+    * struct, to avoid dangling-pointer problems.
+    */
+   ossimJpegErrorMgr jerr;
+   
+   /* Step 1: allocate and initialize JPEG decompression object */
+   
+   /* We set up the normal JPEG error routines, then override error_exit. */
+   cinfo.err = jpeg_std_error(&jerr.pub);
+ 
+   jerr.pub.error_exit = ossimJpegErrorExit;
+
+   /* Establish the setjmp return context for my_error_exit to use. */
+   if (setjmp(jerr.setjmp_buffer))
+   {
+      /* If we get here, the JPEG code has signaled an error.
+       * We need to clean up the JPEG object, close the input file, and return.
+       */
+     jpeg_destroy_decompress(&cinfo);
+     return false;
+   }
+
+   /* Now we can initialize the JPEG decompression object. */
+   jpeg_CreateDecompress(&cinfo, JPEG_LIB_VERSION, sizeof(cinfo));
+   
+   //---
+   // Step 2: specify data source.  In this case we will uncompress from
+   // memory so we will use "ossimJpegMemorySrc" in place of " jpeg_stdio_src".
+   //---
+   ossimJpegMemorySrc (&cinfo,
+                       &(compressedBuf.front()),
+                       static_cast<size_t>(theReadBlockSizeInBytes));
+
+   /* Step 3: read file parameters with jpeg_read_header() */
+   jpeg_read_header(&cinfo, TRUE);
+  
+   // Check for Quantization tables.
+   if (cinfo.quant_tbl_ptrs[0] == NULL)
+   {
+      // This will load table specified in COMRAT field.
+      if (loadJpegQuantizationTables(cinfo) == false)
+      {
+        jpeg_destroy_decompress(&cinfo);
+        return false;
+      }
+   }
+
+   // Check for huffman tables.
+   if (cinfo.ac_huff_tbl_ptrs[0] == NULL)
+   {
+      // This will load default huffman tables into .
+      if (loadJpegHuffmanTables(cinfo) == false)
+      {
+        jpeg_destroy_decompress(&cinfo);
+        return false;
+      }
+   }
+
+   /* Step 4: set parameters for decompression */
+   
+   /* In this example, we don't need to change any of the defaults set by
+    * jpeg_read_header(), so we do nothing here.
+    */
+
+   /* Step 5: Start decompressor */
+   jpeg_start_decompress(&cinfo);
+
+#if 0 /* Please leave for debug. (drb) */
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "jpeg cinfo.output_width:  " << cinfo.output_width
+         << "\njpeg cinfo.output_height: " << cinfo.output_height
+         << "\n";
+   }
+#endif
+   
+   const ossim_uint32 SAMPLES = cinfo.output_width;
+
+   //---
+   // Note: Some nitf will be tagged with a given number of lines but the last
+   // jpeg block may go beyond that to a complete block.  So it you clamp to
+   // last line of the nitf you will get a libjpeg error:
+   // 
+   // "Application transferred too few scanlines"
+   //
+   // So here we will always read the full jpeg block even if it is beyond the
+   // last line of the nitf.
+   //---
+   const ossim_uint32 LINES_TO_READ =
+      min(static_cast<ossim_uint32>(theCacheSize.y), cinfo.output_height);
+
+   /* JSAMPLEs per row in output buffer */
+   const ossim_uint32 ROW_STRIDE = SAMPLES * cinfo.output_components;
+
+   if ( (SAMPLES < theCacheTile->getWidth() ) ||
+        (LINES_TO_READ < theCacheTile->getHeight()) )
+   {
+      theCacheTile->makeBlank();
+   }
+
+   if ( (SAMPLES > theCacheTile->getWidth()) ||
+        (LINES_TO_READ > theCacheTile->getHeight()) )
+   {
+     // Error...
+     jpeg_finish_decompress(&cinfo);
+     jpeg_destroy_decompress(&cinfo);
+     return false;
+   }
+   
+   // Get pointers to the cache tile buffers.
+   std::vector<ossim_uint8*> destinationBuffer(theNumberOfInputBands);
+   for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
+   {
+     destinationBuffer[band] = theCacheTile->getUcharBuf(band);
+   }
+
+   std::vector<ossim_uint8> lineBuffer(ROW_STRIDE);
+   JSAMPROW jbuf[1];
+   jbuf[0] = (JSAMPROW) &(lineBuffer.front());
+
+   while (cinfo.output_scanline < LINES_TO_READ)
+   {
+     // Read a line from the jpeg file.
+     jpeg_read_scanlines(&cinfo, jbuf, 1);
+
+     //---
+     // Copy the line which if band interleaved by pixel the the band
+     // separate buffers.
+     //
+     // Note:
+     // Not sure if IMODE of 'B' is interleaved the same as image with
+     // IMODE of 'P'.
+     //
+     // This works with all samples with IMODE of B and P but I only have
+     // one band 'B' and three band 'P'.  So if we ever get a three band
+     // 'B' it could be wrong here. (drb - 20090615)
+     //---
+     ossim_uint32 index = 0;
+     for (ossim_uint32 sample = 0; sample < SAMPLES; ++sample)         
+     {
+       for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
+       {
+         destinationBuffer[band][sample] = lineBuffer[index];
+         ++index;
+       }
+     }
+
+     for (ossim_uint32 band = 0; band < theNumberOfInputBands; ++band)
+     {
+       destinationBuffer[band] += theCacheSize.x;         
+     }
+   }
+
+   // clean up...
+
+   jpeg_finish_decompress(&cinfo);
+   jpeg_destroy_decompress(&cinfo);
+
+   return true;
+}
+
+//---
+// Default JPEG quantization tables
+// Values from: MIL-STD-188-198, APPENDIX A
+//---
+bool ossimNitfTileSource::loadJpegQuantizationTables(
+   jpeg_decompress_struct& cinfo) const
+{
+   //---
+   // Check to see if table is present.  We will only look at the first table
+   // in the array of arrays.
+   // 
+   // NOTE:  There are four tables in the array "cinfo.quant_tbl_ptrs".  It
+   // looks like the standard is to use the first table. (not sure though)
+   //---
+   if (cinfo.quant_tbl_ptrs[0] != NULL)
+   {
+      return false;
+   }
+
+   // Get the COMRAT (compression rate code) from the header:
+   const ossimNitfImageHeader* hdr = getCurrentImageHeader();
+   if (!hdr)
+   {
+      return false;
+   }
+   
+   ossimString comrat = hdr->getCompressionRateCode();
+   ossim_uint32 tableIndex = 0;
+   if (comrat.size() >= 4)
+   {
+      // COMRAT string like: "00.2" = use table 2. (between 1 and 5).
+      ossimString s;
+      s.push_back(comrat[static_cast<std::string::size_type>(3)]);
+      ossim_int32 comTbl = s.toInt32();
+      if ( (comTbl > 0) && (comTbl < 6) )
+      {
+         tableIndex = comTbl-1;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimNitfTileSource::loadJpegQuantizationTables WARNING\n"
+            << "\nNo quantization tables specified!"
+            << endl;
+         return false;  
+      }
+   }
+
+   cinfo.quant_tbl_ptrs[0] = jpeg_alloc_quant_table((j_common_ptr) &cinfo);
+ 
+   JQUANT_TBL* quant_ptr = cinfo.quant_tbl_ptrs[0]; // quant_ptr is JQUANT_TBL*
+
+   for (ossim_int32 i = 0; i < 64; ++i)
+   {
+      /* Qtable[] is desired quantization table, in natural array order */
+      quant_ptr->quantval[i] = QTABLE_ARRAY[tableIndex][i];
+   }
+   return true;
+}
+
+//---
+// Default JPEG Huffman tables
+// Values from: MIL-STD-188-198, APPENDIX B
+//---
+bool ossimNitfTileSource::loadJpegHuffmanTables(
+   jpeg_decompress_struct& cinfo) const
+{
+   if ( (cinfo.ac_huff_tbl_ptrs[0] != NULL) &&
+        (cinfo.dc_huff_tbl_ptrs[0] != NULL) )
+   {
+      return false;
+   }
+
+   cinfo.ac_huff_tbl_ptrs[0] = jpeg_alloc_huff_table((j_common_ptr)&cinfo);
+   cinfo.dc_huff_tbl_ptrs[0] = jpeg_alloc_huff_table((j_common_ptr)&cinfo);
+
+   ossim_int32 i;
+   JHUFF_TBL* huff_ptr;
+   
+   // Copy the ac tables.
+   huff_ptr = cinfo.ac_huff_tbl_ptrs[0]; /* huff_ptr is JHUFF_TBL* */     
+   for (i = 0; i < 16; ++i) 
+   {
+      // huff_ptr->bits is array of 17 bits[0] is unused; hence, the i+1
+      huff_ptr->bits[i+1] = AC_BITS[i]; 
+   }
+   
+   for (i = 0; i < 256; ++i)
+   {
+      huff_ptr->huffval[i] = AC_HUFFVAL[i];
+   }
+   
+   // Copy the dc tables.
+   huff_ptr = cinfo.dc_huff_tbl_ptrs[0]; /* huff_ptr is JHUFF_TBL* */
+   for (i = 0; i < 16; ++i)
+   {
+      // huff_ptr->bits is array of 17 bits[0] is unused; hence, the i+1
+      huff_ptr->bits[i+1] = DC_BITS[i];
+   }
+   
+   for (i = 0; i < 256; i++)
+   {
+      /* symbols[] is the list of Huffman symbols, in code-length order */
+      huff_ptr->huffval[i] = DC_HUFFVAL[i];
+   }
+   return true;
+}
+
+// Protected to disallow use...
+ossimNitfTileSource::ossimNitfTileSource(const ossimNitfTileSource& /* obj */)
+{
+}
+
+// Protected to disallow use...
+ossimNitfTileSource& ossimNitfTileSource::operator=(
+   const ossimNitfTileSource& /* rhs */)
+{
+   return *this;
+}
diff --git a/src/imaging/ossimNitfWriter.cpp b/src/imaging/ossimNitfWriter.cpp
new file mode 100644
index 0000000..a123d38
--- /dev/null
+++ b/src/imaging/ossimNitfWriter.cpp
@@ -0,0 +1,943 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimNitfWriter.cpp 22814 2014-06-05 15:13:28Z dburken $
+
+#include <ossim/imaging/ossimNitfWriter.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimRpcSolver.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
+#include <ossim/support_data/ossimNitfNameConversionTables.h>
+#include <ossim/support_data/ossimNitfImageDataMaskV2_1.h>
+#include <tiffio.h>
+#include <fstream>
+#include <algorithm>
+#include <sstream>
+#include <iomanip>
+
+RTTI_DEF1(ossimNitfWriter, "ossimNitfWriter", ossimNitfWriterBase);
+
+static ossimTrace traceDebug(ossimString("ossimNitfWriter:debug"));
+
+// Maximum file size
+static const ossim_uint64 KB = 1024;
+static const ossim_uint64 MB = KB * KB;
+static const ossim_uint64 MB50 = 50 * MB;
+static const ossim_uint64 GB = KB * MB;
+static const ossim_uint64 GB2 = 2 * GB;
+static const ossim_uint64 GB10 = 10 * GB;
+                            
+ossimNitfWriter::ossimNitfWriter(const ossimFilename& filename,
+                                 ossimImageSource* inputSource)
+   : ossimNitfWriterBase(filename, inputSource),
+     m_str(0),
+     m_fileHeader(0),
+     m_imageHeader(0),
+     m_textHeader(0),
+     m_textEntry(),
+     m_blockSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT)
+{
+   //---
+   // Since the internal nitf tags are not very accurate, write an external
+   // geometry out as default behavior.  Users can disable this via the
+   // property interface or keyword list.
+   //---
+   setWriteExternalGeometryFlag(true);
+   
+   m_fileHeader       = new ossimNitfFileHeaderV2_1;
+   m_imageHeader      = new ossimNitfImageHeaderV2_1;
+
+   // m_textHeader is conditional so we will not new here.
+   
+   theOutputImageType = "nitf_block_band_separate";
+
+   //---
+   // The tile size can be set in the preferences via "tile_size" keyword.
+   // This will get it if set; else, set to default.
+   //---
+   ossim::defaultTileSize(m_blockSize);
+
+   // These are always set:
+   m_fileHeader->setEncryption( ossimString("0") );
+   m_imageHeader->setJustification( ossimString("R") );
+
+   // Set any site defaults.
+   initializeDefaultsFromConfigFile(
+      dynamic_cast<ossimNitfFileHeaderV2_X*>(m_fileHeader.get()),
+      dynamic_cast<ossimNitfImageHeaderV2_X*>(m_imageHeader.get()) );
+}
+
+ossimNitfWriter::~ossimNitfWriter()
+{
+   //---
+   // This looks like a leak but it's not as both of these are ossimRefPtr's.
+   //---
+   m_fileHeader=0;
+   m_imageHeader=0;
+   m_textHeader=0;
+
+   close();
+}
+
+bool ossimNitfWriter::isOpen()const
+{
+   return (m_str ? m_str->is_open() : false);
+}
+
+bool ossimNitfWriter::open()
+{
+   bool result = true;
+   if(isOpen())
+   {
+      close();
+   }
+   
+   // there is a bug in gcc < 5.0 and we can't use constructors in the 
+   // C++11 build.  Will refactor to do a new ifstream then use open
+   //
+   m_str = std::make_shared<ossim::ofstream>();
+   m_str->open(theFilename.c_str(), ios::out|ios::binary);
+   if(!m_str->is_open())
+   {
+      m_str.reset();
+      result = false;
+   }
+   
+   //new std::ofstream;
+   //m_str->open(theFilename.c_str(), ios::out|ios::binary);
+   
+   return result;
+}
+
+void ossimNitfWriter::close()
+{
+   if(m_str)
+   {
+      m_str->close();
+      m_str.reset();
+   }
+}
+
+bool ossimNitfWriter::writeFile()
+{
+   if(!theInputConnection->isMaster())
+   {
+      theInputConnection->slaveProcessTiles();
+
+      return true;
+   }
+
+   open();
+
+   if (!isOpen())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfWriter::writeFile ERROR:"
+            << " Could not open!  Returning..."
+            << std::endl;
+      }
+
+      return false;
+   }
+   
+   // Write out the geometry info.
+   writeGeometry(m_imageHeader.get(), theInputConnection.get());
+
+   // addStandardTags();
+   
+   bool result = false;
+   if((theOutputImageType == "nitf_block_band_separate")||
+      (theOutputImageType == "image/nitf"))
+   {
+      result =  writeBlockBandSeparate();
+   }
+   else if(theOutputImageType == "nitf_block_band_sequential")
+   {
+      result =  writeBlockBandSequential();
+   }
+   
+   close();
+   
+   return result;
+}
+
+void ossimNitfWriter::getImageTypeList(std::vector<ossimString>& imageTypeList)const
+{
+   imageTypeList.push_back(ossimString("nitf_block_band_separate"));
+   imageTypeList.push_back(ossimString("nitf_block_band_sequential"));
+}
+
+void ossimNitfWriter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+   
+   ossimString name = property->getName();
+   
+   if(name == "file_header")
+   {
+      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
+                                                           property.get());
+      if(containerProperty)
+      {
+         std::vector<ossimRefPtr<ossimProperty> > propertyList;
+         containerProperty->getPropertyList(propertyList);
+         m_fileHeader->setProperties(propertyList);
+      }
+   }
+   else if(name == "image_header")
+   {
+      ossimContainerProperty* containerProperty = PTR_CAST(ossimContainerProperty,
+                                                           property.get());
+      if(containerProperty)
+      {
+         std::vector<ossimRefPtr<ossimProperty> > propertyList;
+         containerProperty->getPropertyList(propertyList);
+         m_imageHeader->setProperties(propertyList);
+      }
+   }
+   else if(name == "block_size")
+   {
+      ossimIpt blockSize;
+      blockSize.x = property->valueToString().toInt32();
+      blockSize.y = blockSize.x;
+      setTileSize(blockSize);
+   }
+   else
+   {
+      ossimNitfWriterBase::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitfWriter::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   
+   if(name == "file_header")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      std::vector<ossimRefPtr<ossimProperty> > propertyList;
+      
+      m_fileHeader->getPropertyList(propertyList);
+      container->addChildren(propertyList);
+      
+      result = container;
+   }
+   else if(name == "image_header")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      std::vector<ossimRefPtr<ossimProperty> > propertyList;
+      
+      m_imageHeader->getPropertyList(propertyList);
+      container->addChildren(propertyList);
+      
+      result = container;
+   }
+   else if(name == "des_header")
+   {
+      ossimContainerProperty* container = new ossimContainerProperty(name);
+      std::vector<ossimRefPtr<ossimProperty> > propertyList;
+
+      // Create a temporary DES in order to populate propertyList.
+      ossimNitfDataExtensionSegmentV2_1 des;
+      des.getPropertyList(propertyList);
+      container->addChildren(propertyList);
+
+      result = container;
+   }
+   else if(name == "block_size")
+   {
+      ossimStringProperty* stringProp =
+         new ossimStringProperty(name,
+                                 ossimString::toString(m_blockSize.x),
+                                 false); // editable flag
+      stringProp->addConstraint(ossimString("64"));
+      stringProp->addConstraint(ossimString("128"));
+      stringProp->addConstraint(ossimString("256"));      
+      stringProp->addConstraint(ossimString("512"));      
+      stringProp->addConstraint(ossimString("1024"));      
+      stringProp->addConstraint(ossimString("2048"));      
+      return stringProp;
+   }
+   else
+   {
+      return ossimNitfWriterBase::getProperty(name);
+   }
+
+   return result;
+}
+
+void ossimNitfWriter::getPropertyNames(
+   std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfWriterBase::getPropertyNames(propertyNames);
+
+   propertyNames.push_back("file_header");
+   propertyNames.push_back("image_header");
+   propertyNames.push_back("des_header");
+   propertyNames.push_back("block_size");
+}
+
+bool ossimNitfWriter::writeBlockBandSeparate()
+{
+   ossimScalarType scalarType  = theInputConnection->getOutputScalarType();
+   ossim_uint64    byteSize    = ossim::scalarSizeInBytes(scalarType);
+   ossimIrect      rect        = theInputConnection->getBoundingRect();
+   ossim_uint64    bands       = theInputConnection->getNumberOfOutputBands();
+   ossim_uint64    idx         = 0;
+   ossim_uint64    headerStart = (ossim_uint64)m_str->tellp();
+
+   // Set the sequencer block size to be the same as output.
+   theInputConnection->setTileSize(m_blockSize);
+   
+   ossim_uint64 blocksHorizontal = theInputConnection->getNumberOfTilesHorizontal();
+   ossim_uint64 blocksVertical   = theInputConnection->getNumberOfTilesVertical();
+   ossim_uint64 numberOfTiles    = theInputConnection->getNumberOfTiles();
+
+   ossimNitfImageInfoRecordV2_1 imageInfoRecord;
+   imageInfoRecord.setSubheaderLength(439); // ok if no tags
+   imageInfoRecord.setImageLength(bands*byteSize*blocksVertical*m_blockSize.y*blocksHorizontal*m_blockSize.x);
+
+   m_fileHeader->setDate();
+   m_fileHeader->addImageInfoRecord(imageInfoRecord);
+
+   if ( m_textHeader.valid() )
+   {
+      // Add any text headers
+      ossimNitfTextFileInfoRecordV2_1 textInfoRecord;
+      textInfoRecord.setSubheaderLength(285); //default
+      // Set length of text to be that of input text
+      textInfoRecord.setTextLength(m_textEntry.length()); 
+      m_fileHeader->addTextInfoRecord(textInfoRecord);
+   }  
+
+   // Get the overflow tags from the file header and the image subheader
+   takeOverflowTags(true, true);
+   takeOverflowTags(true, false);
+   takeOverflowTags(false, true);
+   takeOverflowTags(false, false);
+
+   for (vector<ossimNitfDataExtensionSegmentV2_1>::iterator iter = m_dataExtensionSegments.begin();
+      iter != m_dataExtensionSegments.end(); iter++)
+   {
+      ossimNitfDataExtSegInfoRecordV2_1 desInfoRecord;
+      iter->setSecurityMarkings(*m_fileHeader);
+      std::ostringstream headerOut;
+      headerOut << std::setw(4)
+                << std::setfill('0')
+                << std::setiosflags(ios::right)
+                << iter->getHeaderLength();
+      strcpy(desInfoRecord.theDataExtSegSubheaderLength, headerOut.str().c_str());
+
+      std::ostringstream dataOut;
+      dataOut << std::setw(9)
+                << std::setfill('0')
+                << std::setiosflags(ios::right)
+                << iter->getDataLength();
+      strcpy(desInfoRecord.theDataExtSegLength, dataOut.str().c_str());
+
+      m_fileHeader->addDataExtSegInfoRecord(desInfoRecord);
+   }
+
+   //---
+   // This makes space for the file header; it is written again at the end of
+   // this method with updated values
+   // need a better way to get the length.  This should be queried on the
+   // header before writing
+   //---
+   m_fileHeader->writeStream( *m_str ); 
+   ossim_uint64 headerLength = ((ossim_uint64)m_str->tellp() - headerStart) /* + 1 */;
+   
+   ossimString representation;
+   m_imageHeader->setActualBitsPerPixel(ossim::getActualBitsPerPixel(scalarType));
+   m_imageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
+   m_imageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
+   m_imageHeader->setNumberOfBands(bands);
+   m_imageHeader->setImageMode('B');// blocked
+
+   bool masked = (m_imageHeader->getCompressionCode() == "NM");
+   ossimNitfImageDataMaskV2_1 datamask;
+   datamask.setBlockCount(blocksVertical * blocksHorizontal);
+   ossim_uint64 blockLength = bands * byteSize * m_blockSize.x * m_blockSize.y;
+   datamask.setBlockLengthInBytes(blockLength);
+   std::vector<char> blockZeros;
+
+
+   if((bands == 3)&&
+      (scalarType == OSSIM_UCHAR))
+   {
+      m_imageHeader->setRepresentation("RGB");
+      m_imageHeader->setCategory("VIS");
+   }
+   else if(bands == 1)
+   {
+      m_imageHeader->setRepresentation("MONO");
+      m_imageHeader->setCategory("VIS");
+   }
+   else
+   {
+      m_imageHeader->setRepresentation("MULTI");
+      m_imageHeader->setCategory("MS");
+   }
+   
+   m_imageHeader->setBlocksPerRow(blocksHorizontal);
+   m_imageHeader->setBlocksPerCol(blocksVertical);
+   m_imageHeader->setNumberOfPixelsPerBlockRow(m_blockSize.x);
+   m_imageHeader->setNumberOfPixelsPerBlockCol(m_blockSize.y);
+   m_imageHeader->setNumberOfRows(rect.height());
+   m_imageHeader->setNumberOfCols(rect.width());
+
+   ossimNitfImageBandV2_1 bandInfo;
+   for(idx = 0; idx < bands; ++idx)
+   {
+      std::ostringstream out;
+      
+      out << std::setfill('0')
+          << std::setw(2)
+          << idx;
+      
+      bandInfo.setBandRepresentation(out.str().c_str());
+      m_imageHeader->setBandInfo(idx, bandInfo);
+   }
+
+   ossim_uint64 imageHeaderStart = m_str->tellp();
+   m_imageHeader->writeStream( *m_str );
+   ossim_uint64 imageHeaderEnd = m_str->tellp();
+   ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
+
+   // Start the sequence through tiles:
+   theInputConnection->setToStartOfSequence();
+   
+   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
+   ossim_uint64 tileNumber = 1;
+   ossimEndian endian;
+   
+   // write out mask if needed
+   if(masked)
+   {
+      blockZeros.resize(blockLength);
+      memset(&blockZeros.front(), '\0', blockLength);
+      datamask.writeStream( *m_str );
+   }
+   while( data.valid() && !needsAborting())
+   {
+      bool write = true;
+      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+      {
+         switch(data->getScalarType())
+         {
+            case OSSIM_USHORT16:
+            case OSSIM_USHORT11:
+            case OSSIM_USHORT12:
+            case OSSIM_USHORT13:
+            case OSSIM_USHORT14:
+            case OSSIM_USHORT15:
+            {
+               endian.swap((ossim_uint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_SSHORT16:
+            {
+               endian.swap((ossim_sint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_FLOAT:
+            case OSSIM_NORMALIZED_FLOAT:
+            {
+               endian.swap((ossim_float32*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_DOUBLE:
+            case OSSIM_NORMALIZED_DOUBLE:
+            {
+               endian.swap((ossim_float64*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            default:
+               break;
+         }
+      }
+      
+      if (masked)
+      {
+         if (memcmp(data->getBuf(), &blockZeros.front(), blockLength) == 0)
+         {
+            write = false;
+            datamask.setIncludeBlock(tileNumber-1, false);
+         }
+      }
+      if(write)
+      {
+         m_str->write((char*)(data->getBuf()), data->getSizeInBytes());         
+      }
+      
+      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
+      
+      if(!needsAborting())
+      {
+         data = theInputConnection->getNextTile();
+      }
+      ++tileNumber;
+   }
+
+   // ossim_uint64 imageSegmentEnd = m_str->tellp();
+
+   // Let's write our text header
+   if ( m_textHeader.valid() )
+   {
+      m_textHeader->writeStream( *m_str ); 
+      //Now write the text
+      m_str->write((char*)(m_textEntry.c_str()), m_textEntry.length());
+   }   
+
+
+   for (vector<ossimNitfDataExtensionSegmentV2_1>::iterator iter = m_dataExtensionSegments.begin();
+      iter != m_dataExtensionSegments.end(); iter++)
+   {
+      iter->writeStream( *m_str );
+   }
+
+   if (masked)
+   {
+      m_str->seekp(imageHeaderEnd);
+      datamask.writeStream( *m_str );
+      //delete [] blockZeros;
+   }
+
+   std::streamoff pos = m_str->tellp();
+
+   setComplexityLevel(pos, m_fileHeader.get());
+
+   /*
+    * Need to change the way I compute file length and header length later
+    * We need to figure out a better way to compute.
+    */
+   m_fileHeader->setFileLength(static_cast<ossim_uint64>(pos));
+   m_fileHeader->setHeaderLength(headerLength);
+   m_str->seekp(0, ios::beg);
+   imageInfoRecord.setSubheaderLength(imageHeaderSize);
+   m_fileHeader->replaceImageInfoRecord(0, imageInfoRecord);
+   m_fileHeader->writeStream( *m_str );
+   
+   return true;
+}
+
+bool ossimNitfWriter::writeBlockBandSequential()
+{
+   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
+   ossim_uint64    byteSize   = ossim::scalarSizeInBytes(scalarType);
+   ossimIrect      rect       = theInputConnection->getBoundingRect();
+   ossim_uint64    bands      = theInputConnection->getNumberOfOutputBands();
+   ossim_uint64    idx        = 0;
+   ossim_uint64    headerStart   = (ossim_uint64)m_str->tellp();
+
+   // Set the sequencer block size to be the same as output.
+   theInputConnection->setTileSize(m_blockSize);
+   
+   ossim_uint64 blocksHorizontal = theInputConnection->getNumberOfTilesHorizontal();
+   ossim_uint64 blocksVertical   = theInputConnection->getNumberOfTilesVertical();
+   ossim_uint64 numberOfTiles    = theInputConnection->getNumberOfTiles();
+
+   ossimNitfImageInfoRecordV2_1 imageInfoRecord;
+   imageInfoRecord.setSubheaderLength(439);
+   imageInfoRecord.setImageLength(bands*byteSize*blocksHorizontal*blocksVertical*m_blockSize.x*m_blockSize.y);
+
+   m_fileHeader->setDate();
+   m_fileHeader->addImageInfoRecord(imageInfoRecord);
+
+   if ( m_textHeader.valid() )
+   {
+      // Add any text headers
+      ossimNitfTextFileInfoRecordV2_1 textInfoRecord;
+      textInfoRecord.setSubheaderLength(285); //default
+      // Set length of text to be that of input text
+      textInfoRecord.setTextLength(m_textEntry.length()); 
+      m_fileHeader->addTextInfoRecord(textInfoRecord);
+   }
+
+   //---
+   // This makes space for the file header; it is written again at the end of
+   // this method with updated values
+   // need a better way to get the length.  This should be queried on the
+   // header before writing
+   //---  
+   m_fileHeader->writeStream( *m_str );
+   ossim_uint64 headerLength = ((ossim_uint64)m_str->tellp() - headerStart) /* + 1 */;
+   
+   ossimString representation;
+   m_imageHeader->setActualBitsPerPixel(ossim::getActualBitsPerPixel(scalarType));
+   m_imageHeader->setBitsPerPixel(ossim::getBitsPerPixel(scalarType));
+   m_imageHeader->setPixelType(ossimNitfCommon::getNitfPixelType(scalarType));
+   m_imageHeader->setNumberOfBands(bands);
+   m_imageHeader->setImageMode('S');// blocked
+   
+   if((bands == 3)&&
+      (scalarType == OSSIM_UCHAR))
+   {
+      m_imageHeader->setRepresentation("RGB");
+      m_imageHeader->setCategory("VIS");
+   }
+   else if(bands == 1)
+   {
+      m_imageHeader->setRepresentation("MONO");
+      m_imageHeader->setCategory("VIS");
+   }
+   else
+   {
+      m_imageHeader->setRepresentation("MULTI");
+      m_imageHeader->setCategory("MS");
+   }
+   m_imageHeader->setBlocksPerRow(blocksHorizontal);
+   m_imageHeader->setBlocksPerCol(blocksVertical);
+   m_imageHeader->setNumberOfPixelsPerBlockRow(m_blockSize.x);
+   m_imageHeader->setNumberOfPixelsPerBlockCol(m_blockSize.y);
+   m_imageHeader->setNumberOfRows(rect.height());
+   m_imageHeader->setNumberOfCols(rect.width());
+
+   ossimNitfImageBandV2_1 bandInfo;
+   for(idx = 0; idx < bands; ++idx)
+   {
+      std::ostringstream out;
+      
+      out << std::setfill('0')
+          << std::setw(2)
+          << idx;
+      
+      bandInfo.setBandRepresentation(out.str().c_str());
+      m_imageHeader->setBandInfo(idx, bandInfo);
+   }
+
+   ossim_uint64 imageHeaderStart = m_str->tellp();
+   m_imageHeader->writeStream( *m_str );
+   ossim_uint64 imageHeaderEnd = m_str->tellp();
+   ossim_uint64 imageHeaderSize = imageHeaderEnd - imageHeaderStart;
+
+   // ossimIpt ul = rect.ul();
+
+   // Start the sequence through tiles:
+   theInputConnection->setToStartOfSequence();
+
+   ossimRefPtr<ossimImageData> data = theInputConnection->getNextTile();
+   ossim_uint64 tileNumber = 0;
+   ossimEndian endian;
+
+   // get the start to the first band of data block
+   //
+   ossim_uint64 streamOffset = m_str->tellp();
+   
+   // holds the total pixels to the next band
+
+   ossim_uint64 blockSizeInBytes = m_blockSize.x*m_blockSize.y*ossim::scalarSizeInBytes(data->getScalarType());
+   ossim_uint64 bandOffsetInBytes = (blockSizeInBytes*blocksHorizontal*blocksVertical);
+
+   bool needSwapping = endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN;
+   while(data.valid() && !needsAborting())
+   {
+      if(needSwapping)
+      {
+         switch(data->getScalarType())
+         {
+            case OSSIM_USHORT16:
+            case OSSIM_USHORT11:
+            case OSSIM_USHORT12:
+            case OSSIM_USHORT13:
+            case OSSIM_USHORT14:
+            case OSSIM_USHORT15:
+            {
+               endian.swap((ossim_uint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_SSHORT16:
+            {
+               endian.swap((ossim_sint16*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_FLOAT:
+            case OSSIM_NORMALIZED_FLOAT:
+            {
+               endian.swap((ossim_float32*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            case OSSIM_DOUBLE:
+            case OSSIM_NORMALIZED_DOUBLE:
+            {
+               endian.swap((ossim_float64*)data->getBuf(),
+                           data->getWidth()*data->getHeight()*data->getNumberOfBands());
+               break;
+            }
+            default:
+               break;
+         }
+      }
+
+      for(idx = 0; idx < bands; ++idx)
+      {
+         m_str->seekp(streamOffset+ // start of image stream
+                               tileNumber*blockSizeInBytes + // start of block for band separate output
+                               bandOffsetInBytes*idx, // which band offset is it
+                               ios::beg); 
+         
+         m_str->write((char*)(data->getBuf(idx)),
+                               blockSizeInBytes);
+      }
+      ++tileNumber;
+      
+      setPercentComplete(((double)tileNumber / (double)numberOfTiles) * 100);
+      
+      if(!needsAborting())
+      {
+         data = theInputConnection->getNextTile();
+      }
+   }
+
+   // Let's write our text header
+   if ( m_textHeader.valid() )
+   {
+      m_textHeader->writeStream( *m_str ); 
+      //Now write the text
+      m_str->write((char*)(m_textEntry.c_str()), m_textEntry.length());
+   }   
+
+   ossim_uint64 pos = m_str->tellp();
+
+   setComplexityLevel(pos, m_fileHeader.get());
+
+   /*
+    * Need to change the way I compute file length and header length later
+    * We need to figure out a better way to compute.
+    */
+   m_fileHeader->setFileLength(static_cast<ossim_uint64>(pos));
+   m_fileHeader->setHeaderLength(headerLength);
+   m_str->seekp(0, ios::beg);
+   imageInfoRecord.setSubheaderLength(imageHeaderSize);
+   m_fileHeader->replaceImageInfoRecord(0, imageInfoRecord);
+   m_fileHeader->writeStream( *m_str );
+   
+   return true;
+}
+
+void ossimNitfWriter::addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag,
+   bool unique)
+{
+   addRegisteredTag(registeredTag, unique, 1, ossimString("IXSHD"));
+}
+
+void ossimNitfWriter::addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> registeredTag,
+   bool unique, const ossim_uint32& ownerIndex, const ossimString& tagType)
+{
+   ossimNitfTagInformation tagInfo;
+   tagInfo.setTagData(registeredTag.get());
+   tagInfo.setTagType(tagType);
+
+   switch (ownerIndex)
+   {
+      case 0:
+      {
+         m_fileHeader->addTag(tagInfo, unique);
+         break;
+      }
+
+      case 1:
+      {
+         m_imageHeader->addTag(tagInfo, unique);
+         break;
+      }
+
+      default:
+      {
+         // Do nothing
+      }
+   }
+}
+
+bool ossimNitfWriter::addTextToNitf(std::string &inputText)
+{
+   // Initialize the m_textHeader
+   m_textEntry = inputText;
+   if ( m_textHeader.valid() == false )
+   {
+      // Only created if we need it.
+      m_textHeader = new ossimNitfTextHeaderV2_1;
+   }
+   return true;
+}
+void ossimNitfWriter::getTileSize(ossimIpt& size) const
+{
+   size = m_blockSize;
+}
+
+void ossimNitfWriter::setTileSize(const ossimIpt& tileSize)
+{
+   const ossim_int32 MIN_BLOCK_SIZE = 64;
+   if ( (tileSize.x % MIN_BLOCK_SIZE) || (tileSize.y % MIN_BLOCK_SIZE) )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfWriter::setTileSize ERROR:"
+            << "\nBlock size must be a multiple of " << MIN_BLOCK_SIZE
+            << "\nSize remains:  " << m_blockSize
+            << std::endl;
+      }
+   }
+   else
+   {
+      m_blockSize = tileSize;
+   }
+}
+
+#if 0
+void ossimNitfWriter::addStandardTags()
+{
+
+   if(!theInputConnection)
+   {
+      return;
+   }
+   
+   // commenting this out for now.  For some reason the pixels
+   // are off when I add this tag.  I checked the parsing and it
+   // appears to be the correct length???  So, I am not sure
+   // why we are off when reading the output back in.
+   //
+   // first lets do the projection tag.  I REALLY need to add
+   // parameter support soon or this tag is useless.
+   //
+   ossimKeywordlist kwl;
+   theInputConnection->getImageGeometry(kwl);
+   ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->createProjection(kwl);
+   ossimNitfNameConversionTables table;
+   ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj.get());
+   ossimNitfTagInformation tagInfo;
+   
+   if(mapProj)
+   {
+
+      if(!PTR_CAST(ossimUtmProjection, mapProj))
+      {
+         ossimRefPtr<ossimNitfProjectionParameterTag> parameterTag = new ossimNitfProjectionParameterTag;
+         
+         ossimString nitfCode = table.convertMapProjectionNameToNitfCode(proj->getClassName());
+         ossimString nitfName = table.convertNitfCodeToNitfProjectionName(nitfCode);
+         
+         parameterTag->setName(nitfName);
+         parameterTag->setCode(nitfCode);
+         parameterTag->setFalseX(mapProj->getFalseEasting());
+         parameterTag->setFalseY(mapProj->getFalseNorthing());
+         
+         tagInfo.setTagData(parameterTag.get());
+         m_imageHeader->addTag(tagInfo);
+      }
+   }
+}
+#endif
+
+bool ossimNitfWriter::saveState(ossimKeywordlist& kwl,
+                                const char* prefix) const
+{
+   return ossimNitfWriterBase::saveState(kwl, prefix);
+}
+
+bool ossimNitfWriter::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   return ossimNitfWriterBase::loadState(kwl, prefix);
+}
+
+ossimNitfImageHeaderV2_1 *ossimNitfWriter::getImageHeader()
+{
+   return m_imageHeader.get();
+}
+
+ossimNitfFileHeaderV2_1 *ossimNitfWriter::getFileHeader()
+{
+   return m_fileHeader.get();
+}
+
+void ossimNitfWriter::addDataExtensionSegment(const ossimNitfDataExtensionSegmentV2_1& des, bool allowTreOverflow)
+{
+   if (allowTreOverflow == false)
+   {
+      ossimRefPtr<ossimProperty> pId = des.getProperty(ossimNitfDataExtensionSegmentV2_1::DESID_KW);
+      if (pId == NULL || pId->valueToString() == "TRE_OVERFLOW" ||
+         pId->valueToString() == "REGISTERED EXTENSIONS" || pId->valueToString() == "CONTROLLED EXTENSIONS")
+      {
+         return;
+      }
+   }
+
+   m_dataExtensionSegments.push_back(des);
+}
+void ossimNitfWriter::takeOverflowTags(bool useFileHeader, bool userDefinedTags)
+{
+   ossimString itemIndex;
+   std::vector<ossimNitfTagInformation> overflowTags;
+   const ossim_uint32 potentialDesIndex = m_dataExtensionSegments.size() + 1;
+
+   if (useFileHeader)
+   {
+      m_fileHeader->takeOverflowTags(overflowTags, potentialDesIndex, userDefinedTags);
+      itemIndex = "0";
+   }
+   else
+   {
+      m_imageHeader->takeOverflowTags(overflowTags, potentialDesIndex, userDefinedTags);
+      itemIndex = "1";
+   }
+
+   if (overflowTags.empty() == false)
+   {
+      ossimNitfDataExtensionSegmentV2_1 des;
+      ossimRefPtr<ossimProperty> pDe =
+         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DE_KW, "DE");
+      des.setProperty(pDe);
+
+      ossimRefPtr<ossimProperty> pId =
+         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESID_KW, "TRE_OVERFLOW");
+      des.setProperty(pId);
+
+      ossimRefPtr<ossimProperty> pVersion =
+         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESVER_KW, "1");
+      des.setProperty(pVersion);
+
+      ossimRefPtr<ossimProperty> pOverflow =
+         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESOFLW_KW, overflowTags[0].getTagType());
+      des.setProperty(pOverflow);
+
+      ossimRefPtr<ossimProperty> pItem =
+         new ossimStringProperty(ossimNitfDataExtensionSegmentV2_1::DESITEM_KW, itemIndex);
+      des.setProperty(pItem);
+
+      des.setTagList(overflowTags);
+      addDataExtensionSegment(des, true);
+   }
+}
+
diff --git a/src/imaging/ossimNitfWriterBase.cpp b/src/imaging/ossimNitfWriterBase.cpp
new file mode 100644
index 0000000..e6dc9e9
--- /dev/null
+++ b/src/imaging/ossimNitfWriterBase.cpp
@@ -0,0 +1,404 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: OSSIM Kakadu based nitf writer.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfWriterBase.cpp 2981 2011-10-10 21:14:02Z david.burken $
+
+#include <ossim/imaging/ossimNitfWriterBase.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageSourceSequencer.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimRpcSolver.h>
+#include <ossim/support_data/ossimNitfBlockaTag.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/support_data/ossimNitfTagInformation.h>
+
+static const char ENABLE_BLOCKA_KW[] = "enable_blocka_tag";
+static const char ENABLE_RPCB_KW[]   = "enable_rpcb_tag";
+
+RTTI_DEF1(ossimNitfWriterBase, "ossimNitfWriterBase", ossimImageFileWriter)
+   
+static ossimTrace traceDebug(ossimString("ossimNitfWriterBase:debug"));
+
+ossimNitfWriterBase::ossimNitfWriterBase()
+   : ossimImageFileWriter(),
+     theEnableRpcbTagFlag(false),
+     theEnableBlockaTagFlag(true)
+{
+}
+
+ossimNitfWriterBase::ossimNitfWriterBase(const ossimFilename& filename,
+                                         ossimImageSource* inputSource)
+   : ossimImageFileWriter(filename, inputSource, 0),
+     theEnableRpcbTagFlag(false),
+     theEnableBlockaTagFlag(true)
+{
+}
+
+ossimNitfWriterBase::~ossimNitfWriterBase()
+{
+}
+
+void ossimNitfWriterBase::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(property.valid())
+   {
+      ossimString name = property->getName();
+
+      if (name == ENABLE_RPCB_KW)
+      {
+         theEnableRpcbTagFlag = property->valueToString().toBool();
+      }
+      else if (name == ENABLE_BLOCKA_KW)
+      {
+         theEnableBlockaTagFlag = property->valueToString().toBool();
+      }
+      else
+      {
+         ossimImageFileWriter::setProperty(property);
+      }
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitfWriterBase::getProperty(
+   const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   
+   if(name == ENABLE_RPCB_KW)
+   {
+      result = new ossimBooleanProperty(name, theEnableRpcbTagFlag);
+   }   
+   else if(name == ENABLE_BLOCKA_KW)
+   {
+      result = new ossimBooleanProperty(name, theEnableBlockaTagFlag);
+   }   
+   else
+   {
+      result = ossimImageFileWriter::getProperty(name);
+   }
+
+   return result;
+}
+
+void ossimNitfWriterBase::getPropertyNames(
+   std::vector<ossimString>& propertyNames)const
+{
+   ossimImageFileWriter::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(ENABLE_BLOCKA_KW);
+   propertyNames.push_back(ENABLE_RPCB_KW);
+}
+
+
+bool ossimNitfWriterBase::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix) const
+{
+   kwl.add(prefix, ENABLE_RPCB_KW, theEnableRpcbTagFlag, true);
+   kwl.add(prefix, ENABLE_BLOCKA_KW, theEnableBlockaTagFlag, true);
+
+   return ossimImageFileWriter::saveState(kwl, prefix);
+}
+
+bool ossimNitfWriterBase::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   // Look for the rpcb enable flag keyword.
+   const char* lookup = kwl.find(prefix, ENABLE_RPCB_KW);
+   if(lookup)
+   {
+      ossimString os = lookup;
+      theEnableRpcbTagFlag = os.toBool();
+   }
+
+   // Look for the blocka enable flag keyword.
+   lookup = kwl.find(prefix, ENABLE_BLOCKA_KW);
+   if(lookup)
+   {
+      ossimString os = lookup;
+      theEnableBlockaTagFlag = os.toBool();
+   }
+
+   return ossimImageFileWriter::loadState(kwl, prefix);
+}
+
+void ossimNitfWriterBase::writeGeometry(ossimNitfImageHeaderV2_X* hdr,
+                                        ossimImageSourceSequencer* seq)
+{
+   if (hdr && seq)
+   {
+      ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();
+      ossimKeywordlist kwl;
+
+      if (geom.valid()&&geom->hasProjection())
+      {
+         // Get the requested bounding rectangles.
+         ossimIrect rect = seq->getBoundingRect();
+         
+         // See if it's a map projection; else, a sensor model.
+         ossimMapProjection* mapProj =
+            PTR_CAST(ossimMapProjection, geom->getProjection());
+         if (mapProj)
+         {
+            // Use map info to get the corners.
+            ossimMapProjectionInfo mapInfo(mapProj, rect);
+            mapInfo.setPixelType(OSSIM_PIXEL_IS_AREA);
+            
+            // See if it's utm.
+            ossimUtmProjection* utmProj = PTR_CAST(ossimUtmProjection,
+                                                   mapProj);
+            if(utmProj)
+            {
+               ossimDpt ul = mapInfo.ulEastingNorthingPt();
+               ossimDpt ur = mapInfo.urEastingNorthingPt();
+               ossimDpt lr = mapInfo.lrEastingNorthingPt();
+               ossimDpt ll = mapInfo.llEastingNorthingPt();
+               
+               if(utmProj->getHemisphere() == 'N')
+               {
+                  hdr->setUtmNorth(utmProj->getZone(), ul, ur, lr, ll);
+               }
+               else
+               {
+                  hdr->setUtmSouth(utmProj->getZone(), ul, ur, lr, ll);
+               }
+            }
+            else
+            {
+               ossimGpt ul = mapInfo.ulGroundPt();
+               ossimGpt ur = mapInfo.urGroundPt();
+               ossimGpt lr = mapInfo.lrGroundPt();
+               ossimGpt ll = mapInfo.llGroundPt();
+               hdr->setGeographicLocationDms(ul, ur, lr, ll);
+            }
+
+            if (theEnableBlockaTagFlag)
+            {
+               addBlockaTag(mapInfo, hdr);
+            }
+         }
+         else
+         {
+            ossimGpt ul, ur, lr, ll;
+            bool status = geom->getCornerGpts(ul, ur, lr, ll);
+            if (status)
+            {
+                hdr->setGeographicLocationDms(ul, ur, lr, ll);
+            }
+         }
+         
+         if (theEnableRpcbTagFlag)
+         {
+            addRpcbTag(rect, geom->getProjection(), hdr);
+         }
+         
+      } // matches:  if (proj.valid())
+      
+   } // matches: if (hdr && seq)
+}
+
+void ossimNitfWriterBase::addBlockaTag(ossimMapProjectionInfo& mapInfo,
+                                       ossimNitfImageHeaderV2_X* hdr)
+{
+   if (hdr)
+   {
+      // Capture the current pixel type.
+      ossimPixelType originalPixelType = mapInfo.getPixelType();
+      
+      // This tag wants corners as area:
+      mapInfo.setPixelType(OSSIM_PIXEL_IS_AREA);
+      
+      // Stuff the blocka tag which has six digit precision.
+      ossimRefPtr<ossimNitfBlockaTag> blockaTag = new ossimNitfBlockaTag();
+      
+      // Set the block number.
+      blockaTag->setBlockInstance(1);
+      
+      // Set the number of lines.
+      blockaTag->setLLines(mapInfo.linesPerImage());
+      
+      // Set first row, first column.
+      blockaTag->setFrfcLoc(ossimDpt(mapInfo.ulGroundPt()));
+      
+      // Set first row, last column.
+      blockaTag->setFrlcLoc(ossimDpt(mapInfo.urGroundPt()));
+      
+      // Set last row, last column.
+      blockaTag->setLrlcLoc(ossimDpt(mapInfo.lrGroundPt()));
+      
+      // Set last row, first column.
+      blockaTag->setLrfcLoc(ossimDpt(mapInfo.llGroundPt()));
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfWriterBase::addBlockaTag DEBUG:"
+            << "\nBLOCKA Tag:" << *((ossimObject*)(blockaTag.get()))
+            << std::endl;
+      }
+      
+      // Add the tag to the header.
+      ossimRefPtr<ossimNitfRegisteredTag> blockaTagRp = blockaTag.get();
+      ossimNitfTagInformation blockaTagInfo(blockaTagRp);
+      hdr->addTag(blockaTagInfo);
+      
+      // Reset the pixel type to original value
+      mapInfo.setPixelType(originalPixelType);
+      
+   } // matches: if (hdr)
+}
+
+void ossimNitfWriterBase::addRpcbTag(const ossimIrect& rect,
+                                     ossimProjection* proj,
+                                     ossimNitfImageHeaderV2_X* hdr)
+{
+   if (proj && hdr)
+   {
+      bool useElevation = false;
+      
+      if (PTR_CAST(ossimMapProjection, proj))
+      {
+         // If we're already map projected turn the elevation off.
+         useElevation = false;
+      }
+      
+      // Make an rpc solver.
+      ossimRefPtr<ossimRpcSolver> rs = new ossimRpcSolver(useElevation);
+      
+      // Compute the coefficients.
+      rs->solveCoefficients(ossimDrect(rect), proj, 64, 64);
+      
+      // Add the tag.
+      ossimRefPtr<ossimNitfRegisteredTag> tag = rs->getNitfRpcBTag();
+      ossimNitfTagInformation tagInfo(tag);
+      hdr->addTag(tagInfo);
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfWriterBase::addRpcbTag DEBUG:"
+            << "\nRPCB Tag:" << *((ossimObject*)(tag.get()))
+            << "\nProjection:\n";
+         
+         proj->print(ossimNotify(ossimNotifyLevel_DEBUG));
+         
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "\nRect: " << rect << std::endl;
+      }
+      
+   } // matches: if (proj && hdr)
+}
+
+void ossimNitfWriterBase::setComplexityLevel(std::streamoff endPosition,
+                                             ossimNitfFileHeaderV2_X* hdr)
+{
+   if (hdr)
+   {
+      //---
+      // See MIL-STD-2500C, Table A-10:
+      //
+      // Lots of rules here, but for now we will key off of file size.
+      //---
+      const std::streamoff MB   = 1024 * 1024;
+      const std::streamoff MB50 = 50   * MB;
+      const std::streamoff GIG  = 1000 * MB;
+      const std::streamoff GIG2 = 2    * GIG;
+      
+      ossimString complexity = "03"; // Less than 50 mb.
+      
+      if ( (endPosition >= MB50) && (endPosition < GIG) )
+      {
+         complexity = "05";
+      }
+      else if ( (endPosition >= GIG) && (endPosition < GIG2) )
+      {
+         complexity = "06";
+      }
+      else if (endPosition >= GIG2)
+      {
+         complexity = "07";
+      }
+      
+      hdr->setComplexityLevel(complexity);
+   }
+}
+
+// Alternate calculation option for complexity.  This seems to match more test data.
+void ossimNitfWriterBase::setComplexityLevel(ossimNitfFileHeaderV2_X* hdr, ossim_uint64 width, ossim_uint64 height)
+{
+   if (hdr)
+   {
+      ossim_uint64 max = (width > height) ? width : height;
+      ossimString complexity = "03";
+      if (max > 65536) complexity = "07";
+      else if (max > 8192) complexity = "06";
+      else if (max > 2048) complexity = "05";
+
+      hdr->setComplexityLevel(complexity);
+   }
+}
+
+ossimString ossimNitfWriterBase::getExtension() const
+{
+   return ossimString("ntf");
+}
+
+void ossimNitfWriterBase::addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> /* registeredTag */)
+{
+}
+
+void ossimNitfWriterBase::addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> /* registeredTag */, bool /* unique */)
+{
+}
+
+void ossimNitfWriterBase::addRegisteredTag(ossimRefPtr<ossimNitfRegisteredTag> /* registeredTag */, bool /* unique */, const ossim_uint32& /* ownerIndex */, const ossimString& /* tagType */)
+{
+}
+
+void ossimNitfWriterBase::setFileHeaderV2_1(ossimRefPtr<ossimNitfFileHeaderV2_1>, bool /* preferSource */)
+{
+}
+
+void ossimNitfWriterBase::setImageHeaderV2_1(ossimRefPtr<ossimNitfImageHeaderV2_1>, bool /* preferSource */)
+{
+}
+
+void ossimNitfWriterBase::initializeDefaultsFromConfigFile( ossimNitfFileHeaderV2_X* fileHdr,
+                                                            ossimNitfImageHeaderV2_X* imgHdr )
+{
+   // Look in prefs for site configuration file:
+   const char* lookup = ossimPreferences::instance()->
+      findPreference("nitf_writer.site_configuration_file");
+   if ( lookup && fileHdr && imgHdr )
+   {
+      ossimKeywordlist kwl;
+      if ( kwl.addFile( lookup ) )
+      {
+         fileHdr->loadState( kwl, "nitf.file." );
+         imgHdr->loadState( kwl, "nitf.image." );
+      }
+   }
+}
+
diff --git a/src/imaging/ossimNormalizedRemapTable.cpp b/src/imaging/ossimNormalizedRemapTable.cpp
new file mode 100644
index 0000000..05f26c9
--- /dev/null
+++ b/src/imaging/ossimNormalizedRemapTable.cpp
@@ -0,0 +1,36 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for NormalizedRemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedRemapTable.cpp 15496 2009-09-29 11:36:56Z dburken $
+
+#include <ossim/imaging/ossimNormalizedRemapTable.h>
+
+ossimNormalizedRemapTable::ossimNormalizedRemapTable()
+{
+}
+
+ossimNormalizedRemapTable::~ossimNormalizedRemapTable()
+{
+}
+
+// Private copy constructor.
+ossimNormalizedRemapTable::ossimNormalizedRemapTable(
+   const ossimNormalizedRemapTable&)
+{}
+
+// Private assignment operator.
+ossimNormalizedRemapTable& ossimNormalizedRemapTable::operator=(
+   const ossimNormalizedRemapTable&)
+{
+   return *this;
+}
diff --git a/src/imaging/ossimNormalizedS16RemapTable.cpp b/src/imaging/ossimNormalizedS16RemapTable.cpp
new file mode 100644
index 0000000..ecd1593
--- /dev/null
+++ b/src/imaging/ossimNormalizedS16RemapTable.cpp
@@ -0,0 +1,49 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedS16RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedS16RemapTable.cpp 9963 2006-11-28 21:11:01Z gpotts $
+
+#include <ossim/imaging/ossimNormalizedS16RemapTable.h>
+
+ossim_float64 ossimNormalizedS16RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedS16RemapTable::theTableIsInitialized = false;
+
+ossimNormalizedS16RemapTable::ossimNormalizedS16RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //
+      // Specialized for elevation, make -32768 and -32767 map to 0 since
+      // DTED NULL is -32767.
+      //
+      // NOTE: Zero will always remap back to -32768 with this hack.  This
+      // could cause issues on writers that use pixFromNorm(). (drb)
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      theTable[1] = 0.0; // Specialized for DTED.
+
+      for (ossim_int32 i = 2; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedS16RemapTable::~ossimNormalizedS16RemapTable()
+{}
diff --git a/src/imaging/ossimNormalizedU11RemapTable.cpp b/src/imaging/ossimNormalizedU11RemapTable.cpp
new file mode 100644
index 0000000..a8df5c9
--- /dev/null
+++ b/src/imaging/ossimNormalizedU11RemapTable.cpp
@@ -0,0 +1,41 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedU11RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU11RemapTable.cpp 15743 2009-10-17 13:00:45Z dburken $
+
+#include <ossim/imaging/ossimNormalizedU11RemapTable.h>
+
+ossim_float64 ossimNormalizedU11RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedU11RemapTable::theTableIsInitialized = false;
+
+ossimNormalizedU11RemapTable::ossimNormalizedU11RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      for (ossim_int32 i = 1; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedU11RemapTable::~ossimNormalizedU11RemapTable()
+{}
diff --git a/src/imaging/ossimNormalizedU12RemapTable.cpp b/src/imaging/ossimNormalizedU12RemapTable.cpp
new file mode 100644
index 0000000..9dfd626
--- /dev/null
+++ b/src/imaging/ossimNormalizedU12RemapTable.cpp
@@ -0,0 +1,41 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedU12RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU12RemapTable.cpp 15743 2009-10-17 13:00:45Z dburken $
+
+#include <ossim/imaging/ossimNormalizedU12RemapTable.h>
+
+ossim_float64 ossimNormalizedU12RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedU12RemapTable::theTableIsInitialized = false;
+
+ossimNormalizedU12RemapTable::ossimNormalizedU12RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      for (ossim_int32 i = 1; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedU12RemapTable::~ossimNormalizedU12RemapTable()
+{}
diff --git a/src/imaging/ossimNormalizedU13RemapTable.cpp b/src/imaging/ossimNormalizedU13RemapTable.cpp
new file mode 100644
index 0000000..a8340cc
--- /dev/null
+++ b/src/imaging/ossimNormalizedU13RemapTable.cpp
@@ -0,0 +1,41 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedU13RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU13RemapTable.cpp 15743 2009-10-17 13:00:45Z dburken $
+
+#include <ossim/imaging/ossimNormalizedU13RemapTable.h>
+
+ossim_float64 ossimNormalizedU13RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedU13RemapTable::theTableIsInitialized = false;
+
+ossimNormalizedU13RemapTable::ossimNormalizedU13RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      for (ossim_int32 i = 1; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedU13RemapTable::~ossimNormalizedU13RemapTable()
+{}
diff --git a/src/imaging/ossimNormalizedU14RemapTable.cpp b/src/imaging/ossimNormalizedU14RemapTable.cpp
new file mode 100644
index 0000000..90aff6d
--- /dev/null
+++ b/src/imaging/ossimNormalizedU14RemapTable.cpp
@@ -0,0 +1,41 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedU14RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU14RemapTable.cpp 15743 2009-10-17 13:00:45Z dburken $
+
+#include <ossim/imaging/ossimNormalizedU14RemapTable.h>
+
+ossim_float64 ossimNormalizedU14RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedU14RemapTable::theTableIsInitialized = false;
+
+ossimNormalizedU14RemapTable::ossimNormalizedU14RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      for (ossim_int32 i = 1; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedU14RemapTable::~ossimNormalizedU14RemapTable()
+{}
diff --git a/src/imaging/ossimNormalizedU15RemapTable.cpp b/src/imaging/ossimNormalizedU15RemapTable.cpp
new file mode 100644
index 0000000..d3533ec
--- /dev/null
+++ b/src/imaging/ossimNormalizedU15RemapTable.cpp
@@ -0,0 +1,41 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedU15RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU15RemapTable.cpp 15743 2009-10-17 13:00:45Z dburken $
+
+#include <ossim/imaging/ossimNormalizedU15RemapTable.h>
+
+ossim_float64 ossimNormalizedU15RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedU15RemapTable::theTableIsInitialized = false;
+
+ossimNormalizedU15RemapTable::ossimNormalizedU15RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      for (ossim_int32 i = 1; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedU15RemapTable::~ossimNormalizedU15RemapTable()
+{}
diff --git a/src/imaging/ossimNormalizedU16RemapTable.cpp b/src/imaging/ossimNormalizedU16RemapTable.cpp
new file mode 100644
index 0000000..9bc8070
--- /dev/null
+++ b/src/imaging/ossimNormalizedU16RemapTable.cpp
@@ -0,0 +1,44 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedU16RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU16RemapTable.cpp 15743 2009-10-17 13:00:45Z dburken $
+
+#include <ossim/imaging/ossimNormalizedU16RemapTable.h>
+
+ossim_float64 ossimNormalizedU16RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedU16RemapTable::theTableIsInitialized = false;
+
+
+ossimNormalizedU16RemapTable::ossimNormalizedU16RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      for (ossim_int32 i = 1; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedU16RemapTable::~ossimNormalizedU16RemapTable()
+{}
+
+
diff --git a/src/imaging/ossimNormalizedU8RemapTable.cpp b/src/imaging/ossimNormalizedU8RemapTable.cpp
new file mode 100644
index 0000000..a353d5a
--- /dev/null
+++ b/src/imaging/ossimNormalizedU8RemapTable.cpp
@@ -0,0 +1,42 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+//
+// Contains class definition for ossimNormalizedU8RemapTable.
+// 
+//*******************************************************************
+//  $Id: ossimNormalizedU8RemapTable.cpp 15743 2009-10-17 13:00:45Z dburken $
+
+#include <ossim/imaging/ossimNormalizedU8RemapTable.h>
+
+ossim_float64 ossimNormalizedU8RemapTable::theTable[TABLE_ENTRIES];
+bool          ossimNormalizedU8RemapTable::theTableIsInitialized = false;
+
+ossimNormalizedU8RemapTable::ossimNormalizedU8RemapTable()
+   : ossimNormalizedRemapTable()
+{
+   if (!theTableIsInitialized)
+   {
+      const ossim_int32   ENTRIES     = getEntries();
+      const ossim_float64 DENOMINATOR = getNormalizer();
+      
+      //---
+      // Initialize the remap table.
+      //---
+      theTable[0] = 0.0; // Index zero always for null.
+      for (ossim_int32 i = 1; i < ENTRIES; ++i)
+      {
+         theTable[i] = static_cast<ossim_float64>(i)/DENOMINATOR;
+      }
+
+      theTableIsInitialized = true;
+   }
+}
+
+ossimNormalizedU8RemapTable::~ossimNormalizedU8RemapTable()
+{}
+
diff --git a/src/imaging/ossimNullPixelFlip.cpp b/src/imaging/ossimNullPixelFlip.cpp
new file mode 100644
index 0000000..15ff009
--- /dev/null
+++ b/src/imaging/ossimNullPixelFlip.cpp
@@ -0,0 +1,176 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// 
+//*******************************************************************
+//  $Id$
+
+#include <ossim/imaging/ossimNullPixelFlip.h>
+#include <ossim/imaging/ossimImageData.h>
+
+RTTI_DEF1(ossimNullPixelFlip, "ossimNullPixelFlip", ossimImageSourceFilter);
+ossimNullPixelFlip::ossimNullPixelFlip()
+:m_clipMode(ClipMode_BOUNDING_RECT),
+m_replacementType(ReplacementType_MINPIX)
+{
+}
+
+void ossimNullPixelFlip::initialize()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimNullPixelFlip::getTile(const ossimIrect& tile_rect,
+                                                        ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> result = ossimImageSourceFilter::getTile(tile_rect, resLevel);
+   if(!isSourceEnabled()||!result.valid())
+   {
+      return result.get();
+   }
+   ossimDataObjectStatus status =  result->getDataObjectStatus();
+   
+   if((status == OSSIM_FULL)||
+      (status == OSSIM_NULL))
+   {
+      return result.get();
+   }
+   // Call the appropriate load method.
+   switch (result->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         flipPixels(ossim_uint8(0), result.get(), resLevel);
+         break;
+      }
+         
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         flipPixels(ossim_uint16(0), result.get(), resLevel);
+         break;
+      }
+         
+      case OSSIM_SSHORT16:
+      {
+         flipPixels(ossim_sint16(0), result.get(), resLevel);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         flipPixels(ossim_uint32(0), result.get(), resLevel);
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         flipPixels(ossim_sint32(0), result.get(), resLevel);
+         break;
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         flipPixels(ossim_float32(0), result.get(), resLevel);
+         break;
+      }
+         
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_FLOAT64:
+      {
+         flipPixels(ossim_float64(0), result.get(), resLevel);
+         break;
+      }
+         
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+//         ossimNotify(ossimNotifyLevel_WARN)
+//         << "ossimPixelFlipper::getTile Unsupported scalar type!" << endl;
+         break;
+      }
+   }
+   
+   return result;
+}
+
+template <class T>
+void ossimNullPixelFlip::flipPixels(T /* dummy */,
+                                   ossimImageData* inputTile,
+                                   ossim_uint32 resLevel)
+{
+   if (!inputTile) return;
+   ossimDataObjectStatus status =  inputTile->getDataObjectStatus();
+   ossimIrect rect = inputTile->getImageRectangle();
+   ossimIrect imageBounds = getBoundingRect(resLevel);
+   ossimIrect clipRect;
+   if(!rect.intersects(imageBounds))
+   {
+      return;
+   }
+   clipRect = rect.clipToRect(imageBounds);
+   if((status == OSSIM_EMPTY)||
+      (status == OSSIM_PARTIAL))
+   {
+      if(!rect.completely_within(imageBounds))
+      {
+         ossim_uint32 bands = inputTile->getNumberOfBands();
+         ossimIpt origin = clipRect.ul() - rect.ul();
+         ossim_uint32 bandIdx = 0;
+         ossim_uint32 inputW = inputTile->getWidth();
+         ossim_uint32 originOffset = origin.y*inputW + origin.x;
+         ossim_uint32 w = clipRect.width();
+         ossim_uint32 h = clipRect.height();
+         ossim_uint32 x = 0;
+         ossim_uint32 y = 0;
+         for(bandIdx = 0; bandIdx < bands; ++bandIdx)
+         {
+            T* bandPtr = static_cast<T*>(inputTile->getBuf(bandIdx)) + originOffset;
+            T  nullValue = static_cast<T>(inputTile->getNullPix(bandIdx));
+            T  replaceValue = (m_replacementType==ReplacementType_MINPIX?static_cast<T>(inputTile->getMinPix(bandIdx)):
+                               static_cast<T>(inputTile->getMaxPix(bandIdx)));
+            for(y = 0; y < h; ++y)
+            {
+               for(x = 0; x < w; ++x)
+               {
+                  if(bandPtr[x] == nullValue)
+                  {
+                     bandPtr[x] = replaceValue;
+                  }
+               }
+               bandPtr += inputW;
+            }
+         }
+      }
+      else
+      {
+         ossim_uint32 bands = inputTile->getNumberOfBands();
+         ossim_uint32 bandIdx = 0;
+         ossim_uint32 size = inputTile->getWidth()*inputTile->getHeight();
+         for(bandIdx = 0; bandIdx < bands; ++bandIdx)
+         {
+            T* bandPtr = static_cast<T*>(inputTile->getBuf(bandIdx));
+            T  nullValue = static_cast<T>(inputTile->getNullPix(bandIdx));
+            T  replaceValue = (m_replacementType==ReplacementType_MINPIX?static_cast<T>(inputTile->getMinPix(bandIdx)):
+                               static_cast<T>(inputTile->getMaxPix(bandIdx)));
+                               
+            ossim_uint32 idx = 0;
+            for(idx = 0; idx < size;++idx)
+            {
+               if((*bandPtr) == nullValue)
+               {
+                  (*bandPtr) = replaceValue;
+               }
+               ++bandPtr;
+            }
+         }
+         inputTile->setDataObjectStatus(OSSIM_FULL);
+      }
+   }
+}
diff --git a/ossim/src/ossim/imaging/ossimOrthoImageMosaic.cpp b/src/imaging/ossimOrthoImageMosaic.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimOrthoImageMosaic.cpp
rename to src/imaging/ossimOrthoImageMosaic.cpp
diff --git a/ossim/src/ossim/imaging/ossimOverviewBuilderBase.cpp b/src/imaging/ossimOverviewBuilderBase.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimOverviewBuilderBase.cpp
rename to src/imaging/ossimOverviewBuilderBase.cpp
diff --git a/ossim/src/ossim/imaging/ossimOverviewBuilderFactory.cpp b/src/imaging/ossimOverviewBuilderFactory.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimOverviewBuilderFactory.cpp
rename to src/imaging/ossimOverviewBuilderFactory.cpp
diff --git a/ossim/src/ossim/imaging/ossimOverviewBuilderFactoryBase.cpp b/src/imaging/ossimOverviewBuilderFactoryBase.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimOverviewBuilderFactoryBase.cpp
rename to src/imaging/ossimOverviewBuilderFactoryBase.cpp
diff --git a/ossim/src/ossim/imaging/ossimOverviewBuilderFactoryRegistry.cpp b/src/imaging/ossimOverviewBuilderFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimOverviewBuilderFactoryRegistry.cpp
rename to src/imaging/ossimOverviewBuilderFactoryRegistry.cpp
diff --git a/src/imaging/ossimOverviewSequencer.cpp b/src/imaging/ossimOverviewSequencer.cpp
new file mode 100644
index 0000000..6a54e24
--- /dev/null
+++ b/src/imaging/ossimOverviewSequencer.cpp
@@ -0,0 +1,1056 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Sequencer for building overview files.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimOverviewSequencer.cpp 23377 2015-06-17 18:03:05Z okramer $
+
+#include <ossim/imaging/ossimOverviewSequencer.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageMetaData.h>
+#include <ossim/parallel/ossimMpi.h>
+
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimOverviewSequencer.cpp 23377 2015-06-17 18:03:05Z okramer $";
+#endif
+
+static ossimTrace traceDebug("ossimOverviewSequencer:debug");
+
+ossimOverviewSequencer::ossimOverviewSequencer()
+   :
+   ossimReferenced(),
+   ossimErrorStatusInterface(),
+   m_imageHandler(0),
+   m_maskWriter(0),
+   m_maskFilter(0),
+   m_tile(0),
+   m_areaOfInterest(),
+   m_tileSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT),
+   m_numberOfTilesHorizontal(0),
+   m_numberOfTilesVertical(0),
+   m_currentTileNumber(0),
+   m_sourceResLevel(0),
+   m_dirtyFlag(true),
+   m_decimationFactor(2),
+   m_resampleType(ossimFilterResampler::ossimFilterResampler_BOX),
+   m_histogram(0),
+   m_histoMode(OSSIM_HISTO_MODE_UNKNOWN),
+   m_histoTileIndex(1),
+   m_scanForMinMax(false),
+   m_scanForMinMaxNull(false),
+   m_minValues(0),
+   m_maxValues(0),
+   m_nulValues(0)
+{
+   m_areaOfInterest.makeNan();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimOverviewSequencer::ossimOverviewSequencer entered..."
+         << "\nmpi rank:  "<< ossimMpi::instance()->getRank()
+         << std::endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID
+                                         << std::endl;
+#endif
+   }
+}
+
+ossimOverviewSequencer::~ossimOverviewSequencer()
+{
+   m_imageHandler = 0;
+   m_maskFilter   = 0;
+   m_maskWriter   = 0;
+   m_tile         = 0;
+   m_histogram    = 0;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimOverviewSequencer::~ossimOverviewSequencer entered..."
+         << "\nmpi rank:  " << ossimMpi::instance()->getRank()
+         << std::endl;
+   }
+}
+
+ossim_uint32 ossimOverviewSequencer::getNumberOfTiles() const
+{
+   return (m_numberOfTilesHorizontal*m_numberOfTilesVertical);
+}
+
+ossim_uint32 ossimOverviewSequencer::getNumberOfTilesHorizontal()const
+{
+   return m_numberOfTilesHorizontal;
+}
+
+ossim_uint32 ossimOverviewSequencer::getNumberOfTilesVertical()const
+{
+   return m_numberOfTilesVertical;
+}
+
+void ossimOverviewSequencer::getOutputImageRectangle(ossimIrect& rect) const
+{
+   if (m_areaOfInterest.hasNans())
+   {
+      rect.makeNan(); // not initialized...
+   }
+   else
+   {
+      ossim_int32 width  = m_areaOfInterest.width()  / m_decimationFactor;
+      ossim_int32 height = m_areaOfInterest.height() / m_decimationFactor;
+
+      //---
+      // NOTE:
+      // This will add a sample or line if there is a remainder like:
+      // 1025 / 2 = 512 will then become 513.  It will be up to the resample
+      // tile method to fill the extra sample correctly.
+      //---
+      if (m_areaOfInterest.width() % m_decimationFactor)
+      {
+         ++width;
+      }
+      if (m_areaOfInterest.height() % m_decimationFactor)
+      {
+         ++height;
+      }
+      
+      rect = ossimIrect(0, 0, width-1, height-1);
+   }
+}
+
+void ossimOverviewSequencer::setImageHandler(ossimImageHandler* input)
+{
+   m_imageHandler = input;
+   m_areaOfInterest.makeNan();
+   m_dirtyFlag = true;
+
+   if (m_maskWriter.valid())
+      m_maskWriter->connectMyInputTo(m_imageHandler.get());
+}
+
+void ossimOverviewSequencer::setSourceLevel(ossim_uint32 level)
+{
+   m_sourceResLevel = level;
+   m_areaOfInterest.makeNan();
+   m_dirtyFlag = true;
+}
+
+ossimHistogramMode ossimOverviewSequencer::getHistogramMode() const
+{
+   return m_histoMode;
+}
+
+void ossimOverviewSequencer::setHistogramMode(ossimHistogramMode mode)
+{
+   m_histoMode = mode;
+   m_dirtyFlag = true;
+}
+
+void ossimOverviewSequencer::writeHistogram()
+{
+   if ( m_histogram.valid() && m_imageHandler.valid() )
+   {
+      writeHistogram( m_imageHandler->getFilenameWithThisExtension("his") );
+   }
+}
+
+void ossimOverviewSequencer::writeHistogram(const ossimFilename& file)
+{
+   if ( m_histogram.valid() )
+   {
+      ossimRefPtr<ossimMultiResLevelHistogram> histo = new ossimMultiResLevelHistogram;
+      histo->addHistogram( m_histogram.get() );
+      ossimKeywordlist kwl;
+      histo->saveState(kwl);
+      kwl.write(file.c_str());
+   }
+}
+
+void ossimOverviewSequencer::initialize()
+{
+   if ( m_dirtyFlag == false )
+   {
+      return; // Already initialized.
+   }
+   
+   if ( !m_imageHandler )
+   {
+      return;
+   }
+
+   ossimImageSource* imageSource = m_imageHandler.get();
+   if (m_maskFilter.valid())
+      imageSource = m_maskFilter.get();
+
+   // Check the area of interest and set from image if needed.
+   if ( m_areaOfInterest.hasNans() )
+   {
+      m_areaOfInterest = m_imageHandler->getImageRectangle(m_sourceResLevel);
+   }
+
+   // Check the tile size and set from image if needed.
+   if ( m_tileSize.hasNans() )
+   {
+      m_tileSize.x = imageSource->getTileWidth();
+      m_tileSize.y = imageSource->getTileHeight();
+   }
+
+   // Update m_numberOfTilesHorizontal and m_numberOfTilesVertical.
+   updateTileDimensions();
+
+   // Start on first tile.
+   m_currentTileNumber = 0;
+
+   // Use this factory constructor as it copies the min/max/nulls from the image handler.
+   m_tile = ossimImageDataFactory::instance()->
+      create( 0, imageSource->getNumberOfOutputBands(), imageSource);
+   
+   if(m_tile.valid())
+   {
+      // Set the width and height.
+      m_tile->setWidthHeight(static_cast<ossim_uint32>(m_tileSize.x),
+                             static_cast<ossim_uint32>(m_tileSize.y) );
+      // Initialize tile buffer.
+      m_tile->initialize();
+   }
+
+   if (m_histoMode != OSSIM_HISTO_MODE_UNKNOWN)
+   {
+      m_histogram = new ossimMultiBandHistogram;
+      
+      m_histogram->create(imageSource);
+
+      if (m_histoMode == OSSIM_HISTO_MODE_NORMAL)
+      {
+         m_histoTileIndex = 1; // Sample every tile.
+      }
+      else
+      {
+         const ossim_float64 PIXEL_TO_SAMPLE = 100.0 * 256.0 * 256.0; // 100 256x256 tiles.
+         ossim_float64 pixels = m_tileSize.x * m_tileSize.y * getNumberOfTiles();
+
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "pixels: " << pixels << "\n"
+               << "PIXEL_TO_SAMPLE: " << PIXEL_TO_SAMPLE << "\n";
+         }
+         
+         if (pixels > PIXEL_TO_SAMPLE)
+         {
+            m_histoTileIndex = ossim::round<ossim_uint32>(pixels/PIXEL_TO_SAMPLE);
+         }
+         else
+         {
+            m_histoTileIndex = 1; // Sample every tile.
+         }
+      }
+   }
+   else
+   {
+      m_histogram = 0;
+   }
+
+
+   if ( m_scanForMinMax || m_scanForMinMaxNull )
+   {
+      //---
+      // The methods ossimImageData::computeMinMaxNullPix and computeMinMaxPix
+      // will resize and set min to max, max to min and null to max if the arrays passed in
+      // are empty.
+      //---
+      clearMinMaxNullArrays();
+   }
+   
+   m_dirtyFlag = false;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "aoi:                      " << m_areaOfInterest
+         << "\ntile size:              " << m_tileSize
+         << "\ntiles wide:             " << m_numberOfTilesHorizontal
+         << "\ntiles high:             " << m_numberOfTilesVertical
+         << "\nsource rlevel:          " << m_sourceResLevel
+         << "\ndecimation factor:      " << m_decimationFactor
+         << "\nresamp type:            " << m_resampleType
+         << "\nscan for min max:       " << (m_scanForMinMax?"true\n":"false\n")
+         << "\nscan for min, max null: " << (m_scanForMinMaxNull?"true\n":"false\n")
+         << "\nhisto mode:             " << m_histoMode << "\n";
+      if (m_histoMode != OSSIM_HISTO_MODE_UNKNOWN)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "Sampling every " << m_histoTileIndex << " tile(s) for histogram.\n";
+      }
+   }
+}
+
+void ossimOverviewSequencer::setToStartOfSequence()
+{
+   m_currentTileNumber = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimOverviewSequencer::getNextTile()
+{
+   if ( m_dirtyFlag )
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   // Get the rectangle to grab from the image.
+   ossimIrect inputRect;
+   getInputTileRectangle(inputRect);
+
+   // Get the output rectangle.
+   ossimIrect outputRect;
+   getOutputTileRectangle(outputRect);
+
+   // Capture the output rectangle.
+   m_tile->setImageRectangle(outputRect);
+
+   // Start with a blank tile.
+   m_tile->makeBlank();
+
+   // Grab the input tile.
+   ossimRefPtr<ossimImageData> inputTile;
+   if (m_maskFilter.valid())
+   {
+      inputTile = m_maskFilter->getTile(inputRect, m_sourceResLevel);
+
+      // Check for errors reading tile and set our error status for callers.
+      if ( m_maskFilter->hasError() )
+      {
+         setErrorStatus();
+      }
+   }
+   else
+   {
+      inputTile = m_imageHandler->getTile(inputRect, m_sourceResLevel);
+
+      // Check for errors reading tile and set our error status for callers.
+      if ( m_imageHandler->hasError() )
+      {
+         setErrorStatus();
+      }
+   }
+
+   if ( hasError() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimOverviewSequencer::getNextTile  ERROR:"
+         << "\nError set reading tile:  " << m_currentTileNumber << std::endl;
+      if ( inputTile.valid() )
+      {
+         inputTile->makeBlank();
+      }
+   }
+   else if ( inputTile.valid() )
+   {
+      if ( m_scanForMinMaxNull )
+      {
+         inputTile->computeMinMaxNulPix(m_minValues, m_maxValues, m_nulValues);
+      }
+      else if ( m_scanForMinMax )
+      {
+         inputTile->computeMinMaxPix(m_minValues, m_maxValues);
+      }
+      
+      if ( ( m_histoMode != OSSIM_HISTO_MODE_UNKNOWN ) &&
+           ( (m_currentTileNumber % m_histoTileIndex) == 0 ) )
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimOverviewSequencer::getNextTile DEBUG:"
+               << "\npopulating histogram for tile: " << m_currentTileNumber
+               << "\n";
+         }
+         inputTile->populateHistogram(m_histogram);
+      }
+      
+      if ( (inputTile->getDataObjectStatus() == OSSIM_PARTIAL) ||
+           (inputTile->getDataObjectStatus() == OSSIM_FULL ) )
+      {
+         // Resample the tile.
+         resampleTile(inputTile.get());
+         m_tile->validate();
+         
+         // Scan the resampled pixels for bogus values to be masked out (if masking enabled)
+         if (m_maskWriter.valid())
+            m_maskWriter->generateMask(m_tile, m_sourceResLevel+1);
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimOverviewSequencer::getNextTile DEBUG:"
+         << "\nRequest failed for input rect: " << inputRect
+         << "\nRes level:  " << m_sourceResLevel << std::endl;
+   }
+
+   // Increment the tile index.
+   ++m_currentTileNumber;
+
+   return m_tile;
+}
+
+void ossimOverviewSequencer::slaveProcessTiles()
+{
+}
+
+bool ossimOverviewSequencer::isMaster() const
+{
+   return true;
+}
+
+ossimIpt ossimOverviewSequencer::getTileSize() const
+{
+   return m_tileSize;
+}
+
+void ossimOverviewSequencer::setTileSize(const ossimIpt& tileSize)
+{
+   m_tileSize = tileSize;
+   updateTileDimensions();
+   m_dirtyFlag = true;
+}
+
+void ossimOverviewSequencer::setResampleType(
+   ossimFilterResampler::ossimFilterResamplerType resampleType)
+{
+   m_resampleType = resampleType;
+}
+
+void ossimOverviewSequencer::setScanForMinMax(bool flag)
+{
+   m_scanForMinMax  = flag;
+}
+
+bool ossimOverviewSequencer::getScanForMinMax() const
+{
+   return m_scanForMinMax;
+}
+
+void ossimOverviewSequencer::setScanForMinMaxNull(bool flag)
+{
+   m_scanForMinMaxNull = flag;
+}
+
+bool ossimOverviewSequencer::getScanForMinMaxNull() const
+{
+   return m_scanForMinMaxNull;
+}
+
+void ossimOverviewSequencer::clearMinMaxNullArrays()
+{
+   m_minValues.clear();
+   m_maxValues.clear();
+   m_nulValues.clear();
+}
+
+bool ossimOverviewSequencer::writeOmdFile(const std::string& file)
+{
+   static const char M[] = "ossimOverviewSequencer::writeOmdFile";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\nfile: " << file << endl;
+   }
+
+   //---
+   // This method writes an omd file to disk.  Typically called after sequencing trough tile that
+   // were scanned for min, max, and potentially null values.
+   // Since this can be called without a scan there is extra logic in here to initialize values
+   // if so.  Also there are sanity checks for cases where there is no null value, i.e. a
+   // full tile, in which case assumptions have to be made...
+   //---
+   
+   bool result = false;
+   if ( file.size() && m_imageHandler.valid() )
+   {
+      const ossim_uint32 BANDS = m_imageHandler->getNumberOfInputBands();
+      const ossimScalarType SCALAR = m_imageHandler->getOutputScalarType();
+      const ossim_float64 DEFAULT_NULL = ossim::defaultNull(SCALAR);
+
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "Original array values:\n";
+         std::vector<ossim_float64>::const_iterator i = m_minValues.begin();
+         ossim_int32 band = 0;
+         while ( i < m_minValues.end() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "min[" << band++ << "]: " << *i << "\n";
+            ++i;
+         }
+         i = m_maxValues.begin();
+         band = 0;
+         while ( i < m_maxValues.end() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "max[" << band++ << "]: " << *i << "\n";
+            ++i;
+         }
+         i = m_nulValues.begin();
+         band = 0;
+         while ( i < m_nulValues.end() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "nul[" << band++ << "]: " << *i << "\n";
+            ++i;
+         }
+      }
+      
+      if ( (m_scanForMinMax == true) || (m_nulValues.size() !=  BANDS) )
+      {
+         // Only scanned for min and max so set the null.
+         if (m_nulValues.size() !=  BANDS)
+         {
+            m_nulValues.resize(BANDS);
+         }
+         for (ossim_uint32 band = 0; band < BANDS; ++band)
+         {
+            m_nulValues[band] = m_imageHandler->getNullPixelValue(band);
+         }
+      }
+      else if ( m_scanForMinMaxNull == true )
+      {
+         //---
+         // The arrays (sizes) should be set if we did the scan.
+         // Note that scanning for null only works if there IS a null in the image; hence, the
+         // extra sanity checks as if there are no null then the null gets set to the real min.
+         //
+         // This is very dangerous code as it makes assumptions (drb)...
+         //---
+         if ( (m_minValues.size() ==  BANDS) &&
+              (m_maxValues.size() ==  BANDS) &&
+              (m_nulValues.size() ==  BANDS) )
+         {
+            switch(SCALAR)
+            {
+               case OSSIM_UINT8:
+               case OSSIM_SINT8:                  
+               case OSSIM_UINT16:
+               case OSSIM_USHORT11:
+               case OSSIM_USHORT12:
+               case OSSIM_USHORT13:
+               case OSSIM_USHORT14:
+               case OSSIM_USHORT15:
+               case OSSIM_UINT32:
+               {
+                  // All of these should have a null of 0.
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( m_nulValues[band] > DEFAULT_NULL )
+                     {
+                        if ( m_nulValues[band] < m_minValues[band] )
+                        {
+                           m_minValues[band] = m_nulValues[band];
+                        }
+                        m_nulValues[band] = DEFAULT_NULL;
+                     }
+                  }
+                  break;
+               }
+               case OSSIM_SINT16:
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NULL ) && // -32768
+                          ( m_nulValues[band] != -32767.0 )    &&
+                          ( m_nulValues[band] != -32766.0 )    &&
+                          ( m_nulValues[band] != -9999.0 ) )
+                     {
+                        if ( ( m_nulValues[band] > -9999.0 ) &&
+                             ( m_nulValues[band] < m_minValues[band] ) )
+                        {
+                           m_minValues[band] = m_nulValues[band];
+                        }
+                        m_nulValues[band] = DEFAULT_NULL;
+                     }
+                  }
+                  break;
+               }
+               case OSSIM_SINT32:
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NULL ) &&
+                          ( m_nulValues[band] != -32768.0 ) &&        // Common null
+                          ( m_nulValues[band] != -32767.0 ) &&       // The other common null.
+                          ( m_nulValues[band] != -32766.0 ) &&
+                          ( m_nulValues[band] != -9999.0  ) &&
+                          ( m_nulValues[band] != -99999.0 ) )
+                     {
+                        if ( ( m_nulValues[band] > -9999.0 ) &&
+                             ( m_nulValues[band] < m_minValues[band] ) )
+                        {
+                           m_minValues[band] = m_nulValues[band];
+                        }
+                        m_nulValues[band] = DEFAULT_NULL;
+                     } 
+                  }
+                  break;
+               }
+               case OSSIM_FLOAT32:
+               case OSSIM_FLOAT64: 
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NULL ) &&
+                          ( m_nulValues[band] != -32768.0 ) &&  
+                          ( m_nulValues[band] != -32767.0 ) && 
+                          ( m_nulValues[band] != -32766.0 ) &&
+                          ( m_nulValues[band] != -9999.0  ) &&
+                          ( m_nulValues[band] != -99999.0 ) )
+                     {
+                        if ( ( m_nulValues[band] > -9999 ) &&
+                             ( m_nulValues[band] < m_minValues[band] ) )
+                        {
+                           m_minValues[band] = m_nulValues[band];
+                        }
+                        m_nulValues[band] = DEFAULT_NULL;
+                     } 
+                  }
+                  break;
+               }
+               case OSSIM_NORMALIZED_FLOAT:
+               case OSSIM_NORMALIZED_DOUBLE:
+               {
+                  for (ossim_uint32 band = 0; band < BANDS; ++band)
+                  {
+                     if ( ( m_nulValues[band] != DEFAULT_NULL ) &&
+                          ( m_nulValues[band] > 0.0) )
+                     {
+                        if ( m_nulValues[band] < m_minValues[band] )
+                        {
+                           m_minValues[band] = m_nulValues[band];
+                        }
+                        m_nulValues[band] = 0.0;
+                     }
+                  }
+                  break;
+               }
+               case OSSIM_SCALAR_UNKNOWN:
+               default:
+               {
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_DEBUG)
+                        << __FILE__ << ":" << __LINE__
+                        << " " << M << "\nUnhandled scalar type:  " << SCALAR << std::endl;
+                  }
+                  break;
+               }
+
+            } // End: switch(SCALAR)
+            
+         } // Matches: if ( (m_minValues.size() ==  BANDS) &&...
+         else
+         {
+            // ERROR!
+            ossimNotify(ossimNotifyLevel_WARN)
+               << M << "ERROR:\nMin, max and null array sizes bad! No omd file will be written."
+               << std::endl;
+         }
+         
+      } // Matches: else if ( m_scanForMinMaxNull == true )
+      else
+      {
+         // Get the values from the image handler.
+         if (m_minValues.size() !=  BANDS)
+         {
+            m_minValues.resize(BANDS);
+            for (ossim_uint32 band = 0; band < BANDS; ++band)
+            {
+               m_minValues[band] = m_imageHandler->getMinPixelValue(band);
+            }
+         }
+         if (m_maxValues.size() !=  BANDS)
+         {
+            m_maxValues.resize(BANDS);
+            for (ossim_uint32 band = 0; band < BANDS; ++band)
+            {
+               m_maxValues[band] = m_imageHandler->getMaxPixelValue(band);
+            }
+         }
+         if (m_nulValues.size() !=  BANDS)
+         {
+            m_nulValues.resize(BANDS);
+            for (ossim_uint32 band = 0; band < BANDS; ++band)
+            {
+               m_nulValues[band] = m_imageHandler->getNullPixelValue(band);
+            }
+         }
+      }
+
+      // Last size check as the m_scanForMinMaxNull block could have failed.
+      if ( ( m_minValues.size() ==  BANDS ) &&
+           ( m_maxValues.size() ==  BANDS ) &&
+           ( m_nulValues.size() ==  BANDS ) )
+      {
+         // Write the omd file:
+         ossimKeywordlist kwl;
+         if( ossimFilename(file).exists())
+         {
+            // Pick up existing omd file.
+            kwl.addFile(file.c_str());
+         }
+         ossimImageMetaData metaData(SCALAR, BANDS);
+         for(ossim_uint32 band = 0; band < BANDS; ++band)
+         {
+            metaData.setMinPix(band,  m_minValues[band]);
+            metaData.setMaxPix(band,  m_maxValues[band]);
+            metaData.setNullPix(band, m_nulValues[band]);
+         }
+         // Save to keyword list.
+         metaData.saveState(kwl);
+         
+         // Write to disk.
+         result = kwl.write(file.c_str());
+         if ( result )
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE) << "Wrote file: " << file << "\n";
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "ERROR writing file: " << file << "\n";
+         }
+      }
+
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "Final array values:\n";
+         std::vector<ossim_float64>::const_iterator i = m_minValues.begin();
+         ossim_int32 band = 0;
+         while ( i < m_minValues.end() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "min[" << band++ << "]: " << *i << "\n";
+            ++i;
+         }
+         i = m_maxValues.begin();
+         band = 0;
+         while ( i < m_maxValues.end() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "max[" << band++ << "]: " << *i << "\n";
+            ++i;
+         }
+         i = m_nulValues.begin();
+         band = 0;
+         while ( i < m_nulValues.end() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "nul[" << band++ << "]: " << *i << "\n";
+            ++i;
+         }
+      }
+
+   } // Matches: if ( file && m_imageHandler.valid() )
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exit status" << (result?"true\n":"false\n");
+   }
+   
+   return result;
+}
+
+void ossimOverviewSequencer::getInputTileRectangle(ossimIrect& inputRect) const
+{
+   if (!m_imageHandler) return;
+   
+   getOutputTileRectangle(inputRect);
+   inputRect = inputRect * m_decimationFactor;
+
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimOverviewSequencer::getInputTileRectangle DEBUG:"
+         << "input rect: " << inputRect << std::endl;
+   }
+#endif
+}
+
+void ossimOverviewSequencer::getOutputTileRectangle(
+   ossimIrect& outputRect) const
+{
+   // Get the row and column.
+   ossim_int32 row = m_currentTileNumber / m_numberOfTilesHorizontal;
+   ossim_int32 col = m_currentTileNumber % m_numberOfTilesHorizontal;
+
+   ossimIpt pt;
+
+   // Set the upper left.
+   pt.y = row * m_tileSize.y;
+   pt.x = col * m_tileSize.x;
+   outputRect.set_ul(pt);
+
+   // Set the lower right.
+   pt.y = pt.y + m_tileSize.y - 1;
+   pt.x = pt.x + m_tileSize.x - 1;   
+   outputRect.set_lr(pt);
+
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimOverviewSequencer::getOutputTileRectangle DEBUG:"
+         << "output rect: " << outputRect << std::endl;
+   }
+#endif
+}
+
+void ossimOverviewSequencer::updateTileDimensions()
+{
+   if( m_areaOfInterest.hasNans() || m_tileSize.hasNans() )
+   {
+      m_numberOfTilesHorizontal = 0;
+      m_numberOfTilesVertical   = 0;
+      m_dirtyFlag = true;
+   }
+   else
+   {
+      // Get the output rectangle.
+      ossimIrect rect;
+      getOutputImageRectangle(rect);
+      
+      m_numberOfTilesHorizontal =
+         static_cast<ossim_uint32>( rect.width()  / m_tileSize.x );
+      m_numberOfTilesVertical =
+         static_cast<ossim_uint32>( rect.height() / m_tileSize.y );
+
+      if (rect.width()  % m_tileSize.x)
+      {
+         ++m_numberOfTilesHorizontal;
+      }
+      if (rect.height() % m_tileSize.y)
+      {
+         ++m_numberOfTilesVertical;
+      }
+   }
+}
+
+void ossimOverviewSequencer::resampleTile(const ossimImageData* inputTile)
+{
+   switch(m_imageHandler->getOutputScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         resampleTile(inputTile, ossim_uint8(0));
+         break;
+      }
+
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         resampleTile(inputTile, ossim_uint16(0));
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         resampleTile(inputTile, ossim_sint16(0));
+         break;
+      }
+
+      case OSSIM_UINT32:
+      {
+         resampleTile(inputTile, ossim_uint32(0));
+         break;
+      }
+         
+      case OSSIM_SINT32:
+      {
+         resampleTile(inputTile, ossim_sint32(0));
+         break;
+      }
+         
+      case OSSIM_FLOAT32:
+      {
+         resampleTile(inputTile, ossim_float32(0.0));
+         break;
+      }
+         
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_FLOAT64:
+      {
+         resampleTile(inputTile, ossim_float64(0.0));
+         break;
+      }
+      default:
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimOverviewSequencer::resampleTile Unknown pixel type!"
+            << std::endl;
+         return;
+         
+   } // End of "switch(m_imageHandler->getOutputScalarType())"
+}
+
+template <class T>
+void  ossimOverviewSequencer::resampleTile(const ossimImageData* inputTile, T  /* dummy */ )
+{
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimOverviewSequencer::resampleTile DEBUG: "
+         << "\ncurrent tile: " << m_currentTileNumber
+         << "\ninput tile:\n" << *inputTile
+         << "output tile:\n" << *(m_tile.get())
+         << endl;
+   }
+#endif
+   
+   const ossim_uint32 BANDS = m_tile->getNumberOfBands();
+   const ossim_uint32 LINES = m_tile->getHeight();
+   const ossim_uint32 SAMPS = m_tile->getWidth();
+   const ossim_uint32 INPUT_WIDTH = m_decimationFactor*m_tileSize.x;
+   
+   T nullPixel              = 0;
+   ossim_float64 weight     = 0.0;
+   ossim_float64 value      = 0.0;
+   ossim_uint32 sampOffset  = 0;
+   
+   if (m_resampleType == ossimFilterResampler::ossimFilterResampler_NEAREST_NEIGHBOR)
+   {
+      for (ossim_uint32 band=0; band<BANDS; ++band)
+      {
+         const T* s = static_cast<const T*>(inputTile->getBuf(band)); // source
+         T*       d = static_cast<T*>(m_tile->getBuf(band)); // destination
+         
+         nullPixel = static_cast<T>(inputTile->getNullPix(band));
+         weight = 0.0;
+         value  = 0.0;
+         
+         for (ossim_uint32 i=0; i<LINES; ++i)
+         {
+            for (ossim_uint32 j=0; j<SAMPS; ++j)
+            {
+               sampOffset = j*m_decimationFactor;
+               
+               weight = 1.0;
+               value  = *(s + i*m_decimationFactor*INPUT_WIDTH + sampOffset);
+               
+               if(weight)
+               {
+                  d[j] = static_cast<T>( value/weight );
+               }
+               else
+               {
+                  d[j] = nullPixel;
+               }
+               
+            } // End of sample loop.
+            
+            d += m_tileSize.x;
+            
+         } // End of line loop.
+         
+      } // End of band loop.
+      
+   }
+   else // ossimFilterResampler::ossimFilterResampler_BOX
+   {
+      ossim_uint32 lineOffset1 = 0;
+      ossim_uint32 lineOffset2 = 0;
+      ossim_float64 ul = 0.0;
+      ossim_float64 ur = 0.0;
+      ossim_float64 ll = 0.0;
+      ossim_float64 lr = 0.0;
+
+      for (ossim_uint32 band=0; band<BANDS; ++band)
+      {
+         const T* s = static_cast<const T*>(inputTile->getBuf(band)); // source
+         T*       d = static_cast<T*>(m_tile->getBuf(band)); // destination
+
+         nullPixel = static_cast<T>(inputTile->getNullPix(band));
+         weight = 0.0;
+         value  = 0.0;
+         
+         for (ossim_uint32 i=0; i<LINES; ++i)
+         {
+            lineOffset1 = i*m_decimationFactor*INPUT_WIDTH;
+            lineOffset2 = (i*m_decimationFactor+1)*INPUT_WIDTH;
+            
+            for (ossim_uint32 j=0; j<SAMPS; ++j)
+            {
+               sampOffset = j*m_decimationFactor;
+               
+               weight = 0.0;
+               value  = 0.0;
+               
+               //---
+               // Grab four pixels from the source, average, and assign
+               // to output.
+               //---
+               ul = *(s + lineOffset1 + sampOffset);
+               ur = *(s + lineOffset1 + sampOffset + 1);
+               ll = *(s + lineOffset2 + sampOffset);
+               lr = *(s + lineOffset2 + sampOffset + 1);
+               
+               if(ul != nullPixel)
+               {
+                  ++weight;
+                  value += ul;
+               }
+               if(ur != nullPixel)
+               {
+                  ++weight;
+                  value += ur;
+               }
+               if(ll != nullPixel)
+               {
+                  ++weight;
+                  value += ll;
+               }
+               if(lr != nullPixel)
+               {
+                  ++weight;
+                  value += lr;
+               }
+
+               if(weight)
+               {
+                  d[j] = static_cast<T>( value/weight );
+               }
+               else
+               {
+                  d[j] = nullPixel;
+               }
+            
+            } // End of sample loop.
+            
+            d += m_tileSize.x;
+            
+         } // End of line loop.
+         
+      } // End of band loop.
+   }
+}
+
+void ossimOverviewSequencer::setBitMaskObjects(ossimBitMaskWriter* mask_writer,
+                                               ossimMaskFilter* mask_filter)
+{
+   m_maskWriter = mask_writer;
+   m_maskFilter = mask_filter;
+}
diff --git a/src/imaging/ossimPdfWriter.cpp b/src/imaging/ossimPdfWriter.cpp
new file mode 100644
index 0000000..cdd3009
--- /dev/null
+++ b/src/imaging/ossimPdfWriter.cpp
@@ -0,0 +1,1889 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file
+//
+// Author:  David Burken
+//
+// Description: OSSIM Portable Document Format (PDF) writer.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/imaging/ossimPdfWriter.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/imaging/ossimBandSelector.h>
+#include <ossim/imaging/ossimGeneralRasterWriter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimJpegMemDest.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ctime>
+#include <fstream>
+#include <iomanip>
+#include <ostream>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <jpeglib.h>
+
+RTTI_DEF1(ossimPdfWriter,
+	  "ossimPdfWriter",
+	  ossimImageFileWriter)
+
+//---
+// For trace debugging (to enable at runtime do:
+// your_app -T "ossimPdfWriter:debug" your_app_args
+//---
+static ossimTrace traceDebug("ossimPdfWriter:debug");
+static ossimTrace traceLog("ossimPdfWriter:log");
+
+// Property keywords:
+static const std::string AUTHOR_KW        = "Author";
+static const std::string CREATOR_KW       = "Creator";
+static const std::string CREATION_DATE_KW = "CreationDate";
+static const std::string KEYWORDS_KW      = "Keywords";
+static const std::string MOD_DATE_KW      = "ModDate";
+static const std::string PRODUCER_KW      = "Producer";
+static const std::string SUBJECT_KW       = "Subject";
+static const std::string TITLE_KW         = "Title";
+
+//---
+// For the "ident" program which will find all exanded $Id$ macros and print them.
+//---
+#if OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id$";
+#endif
+
+ossimPdfWriter::ossimPdfWriter()
+   : ossimImageFileWriter(),
+     m_str(0),
+     m_ownsStream(false),
+     m_savedInput(0),
+     m_kwl( new ossimKeywordlist() ),
+     m_mutex()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPdfWriter::ossimPdfWriter entered" << std::endl;
+#if OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  "
+         << OSSIM_ID
+         << std::endl;
+#endif
+   }
+   
+   // Since there is no internal geometry set the flag to write out one.
+   setWriteExternalGeometryFlag(true);
+   
+   theOutputImageType = "ossim_pdf";
+}
+
+ossimPdfWriter::~ossimPdfWriter()
+{
+   // This will flush stream and delete it if we own it.
+   close();
+
+   m_kwl = 0; // Not a leak, ossimRefPtr
+}
+
+ossimString ossimPdfWriter::getShortName() const
+{
+   return ossimString("ossim_pdf_writer");
+}
+
+ossimString ossimPdfWriter::getLongName() const
+{
+   return ossimString("ossim pdf writer");
+}
+
+ossimString ossimPdfWriter::getClassName() const
+{
+   return ossimString("ossimPdfWriter");
+}
+
+bool ossimPdfWriter::writeFile()
+{
+   bool result = false;
+   
+   if( theInputConnection.valid() && ( getErrorStatus() == ossimErrorCodes::OSSIM_OK ) )
+   {
+      //---
+      // Make sure we can open the file.  Note only the master process is used for
+      // writing...
+      //---
+      if(theInputConnection->isMaster())
+      {
+         if (!isOpen())
+         {
+            open();
+         }
+      }
+      
+      result = writeStream();
+   }
+
+   return result;
+}
+
+bool ossimPdfWriter::writeStream()
+{
+   static const char MODULE[] = "ossimPdfWriter::writeStream";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..."
+         << "\nCurrent options:\n"
+         << *(m_kwl.get()) <<  std::endl;
+   }
+   
+   bool result = false;
+
+   if ( isOpen() )
+   {
+      // Make sure we have a region of interest.
+      if( theAreaOfInterest.hasNans() )
+      {
+         theInputConnection->initialize();
+         theAreaOfInterest = theInputConnection->getAreaOfInterest();
+      }
+      else
+      {
+         theInputConnection->setAreaOfInterest( theAreaOfInterest );
+      }
+
+      ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
+      ossimScalarType scalarType = theInputConnection->getOutputScalarType();
+
+     // std::cout <<"BANDS ======== " << bands << "   scalarType = " << scalarType << std::endl;
+      if(((bands == 3) || (bands == 1))&&(scalarType == OSSIM_UINT8))
+      {
+         // Write the image:
+         result = writeImage( m_str );
+      }
+      else
+      {
+	ossimNotify(ossimNotifyLevel_INFO) << MODULE << " result = false" << std::endl;
+	// need some kind of error
+	result = false;
+      }
+
+      close();
+
+
+      // Reset the input to the image source sequence if it was modified.      
+      if ( m_savedInput.get() != theInputConnection->getInput( 0 ) )
+      {
+         theInputConnection->connectMyInputTo( 0, m_savedInput.get() );  
+      }
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit status = " << (result?"true":"false") << std::endl;
+   }
+
+   return result;
+   
+} // bool ossimPdfWriter::writeStream()
+
+void ossimPdfWriter::writeHeader( std::ostream* str )
+{
+   // Header:
+   if ( str )
+   {
+      // Open in binary mode:
+      std::ostringstream os( std::ios_base::out|std::ios_base::binary );
+      
+      os << "%PDF-1.7\n";
+
+      //---
+      // Add comment with four characters greater than 127 to flag "binary pdf".
+      // Standard/norm from spec is "0xE2E3CFD3":
+      //---
+      std::vector<ossim_uint8> binData(4);
+      binData[0] = 0xE2;
+      binData[1] = 0xE3;
+      binData[2] = 0xCF;
+      binData[3] = 0xD3;
+
+      os << "%";
+      os.write( (char*)&binData.front(), binData.size() );
+      os << "\n";
+
+      // Write it:
+      str->write( os.str().data(), os.str().size() );
+
+      if ( traceLog() )
+      {
+         // Has binary data in it???
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+}
+
+void ossimPdfWriter::writeCatalog( std::ostream* str,
+                                   std::vector<std::streamoff>& xref )
+{
+   // Write the Catalog object.  This assumes an order of:
+   if ( str )
+   {
+      // Capture position:
+      xref.push_back( (std::streamoff)m_str->tellp() );
+
+      std::ostringstream os; // tmp stream...
+      os << xref.size() << " 0 obj\n"
+         << "  << /Type /Catalog\n"
+         << "     /Pages "    << xref.size()+1 << " 0 R\n" // Reference to Pages.
+         << "  >>\n"
+         << "endobj\n";
+
+      // Write it:
+      str->write( os.str().data(), os.str().size() );
+
+      if ( traceLog() )
+      {
+         // Has binary data in it???
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+}
+
+#if 0
+void ossimPdfWriter::writeOutlines( std::ostream* str,
+                                    std::vector<std::streamoff>& xref )
+{
+   // Write the Outlines object:
+   if ( str )
+   {
+      // Capture position:
+      xref.push_back( (std::streamoff)m_str->tellp() );
+
+      std::ostringstream os; // tmp stream...
+      os << xref.size() << " 0 obj\n"
+         << "  << /Type /Outlines\n"
+         << "     /Count 0\n"
+         << "  >>\n"
+         << "endobj\n";
+
+      str->write( os.str().data(), os.str().size() );
+
+      if ( traceLog() )
+      {
+         // Has binary data in it???
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+}
+#endif
+
+void ossimPdfWriter::writePages( std::ostream* str,
+                                 std::vector<std::streamoff>& xref )
+{
+   // Write Pages object.
+   if ( str )
+   {
+      // Capture position:
+      xref.push_back( (std::streamoff)str->tellp() );
+
+      std::ostringstream os;
+      os << xref.size() << " 0 obj\n"
+         << "  << /Type /Pages\n"
+         << "     /Kids [ " << xref.size()+1 << " 0 R ]\n" // Reference to Page.
+         << "     /Count 1\n"
+         << "  >>\n"
+         << "endobj\n";
+
+      str->write( os.str().data(), os.str().size() );
+      
+      if ( traceLog() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+}
+
+void ossimPdfWriter::writeInfo( std::ostream* str,
+                                std::vector<std::streamoff>& xref )
+{
+   // Write Pages object.
+   if ( str )
+   {
+      // Capture position:
+      xref.push_back( (std::streamoff)str->tellp() );
+
+      std::ostringstream os;
+      os << xref.size() << " 0 obj % Document Information Dictionary\n";
+
+      // Tile:
+      std::string s;
+      getTitle( s );
+      if ( s.size() )
+      {
+         os << "   << /Title (" << s << ")\n";
+      }
+      
+      // Author:
+      getAuthor( s );
+      if ( s.size() )
+      {
+         os << "      /Author (" << s << ")\n";
+      }
+
+      // Creator:
+      getCreator( s );
+      if ( s.size() )
+      {
+         os << "      /Creator (" << s << ")\n";
+      }
+
+      // Producer:
+      getProducer( s );
+      if ( s.size() )
+      {
+         os << "      /Producer (" << s << ")\n";
+      }
+
+      // Creation date ( D : YYYYMMDDHHmmSSOHH ' mm ' ):
+      getCreationDate( s );
+      if ( s.size() )
+      {
+         os << "      /CreationDate " << s << "\n";
+      }
+
+      // Modification date ( D : YYYYMMDDHHmmSSOHH ' mm ' ):
+      getModDate( s );
+      if ( s.size() )
+      {
+         os << "      /ModDate " << s << "\n";
+      }
+
+      os << "   >>\n"
+            << "endobj\n";
+
+      str->write( os.str().data(), os.str().size() );
+      
+      if ( traceLog() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+   
+} // End: ossimPdfWriter::writeInfo
+
+bool ossimPdfWriter::writeImage( std::ostream* str )
+{
+   bool status = false;
+   
+   if ( str )
+   {
+
+      //---
+      // This will remap input to eight bit if not already and make input one or
+      // three band depending on number of bands.
+      //---
+      setupInputChain();
+         
+      // Set the sequence tile size:
+      ossimIpt tileSize;
+      getTileSize( tileSize );
+      theInputConnection->setTileSize( tileSize );
+      
+      // Start the sequence at the first tile.
+      theInputConnection->setToStartOfSequence();
+      
+      const ossim_uint32 WIDTH  = theAreaOfInterest.width();
+      const ossim_uint32 HEIGHT = theAreaOfInterest.height();
+      const ossim_uint32 TW     = theInputConnection->getNumberOfTilesHorizontal();    
+      const ossim_uint32 TH     = theInputConnection->getNumberOfTilesVertical();
+      const ossim_uint32 TILES  = theInputConnection->getNumberOfTiles();
+
+#if 0 /* Please save for debug. (drb) */
+      ossimIrect   boundingRect  = theInputConnection->getBoundingRect();
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "\nBounding rect: " << theInputConnection->getBoundingRect()
+         << "\nAOI:           " << theAreaOfInterest  
+         << "\nBands:         " << theInputConnection->getNumberOfOutputBands()
+         << "\ntilesWide:     " << TW
+         << "\ntilesHigh:     " << TH
+         << "\ntileWidth:     " << tileWidth
+         << "\ntileHeight     " << tileHeight << std::endl;
+#endif
+
+      if ( traceLog() )
+      {
+         ossimKeywordlist logKwl;
+         theInputConnection->saveStateOfAllInputs(logKwl);      
+         ossimFilename logFile = getFilename();
+         logFile.setExtension("log");
+         ossimKeywordlist kwl;
+         theInputConnection->saveStateOfAllInputs(kwl);
+         kwl.write(logFile.c_str() );
+      }
+      
+      // Cross reference(xref) table.  Holds the offset of each object.  Written at the end.
+      std::vector<std::streamoff> xref;
+         
+      //---
+      // Header:
+      //---
+      writeHeader( str );
+         
+      //---
+      // Catalog object:
+      //---
+      writeCatalog( str, xref );
+         
+      //---
+      // Outlines object:
+      //---
+      // writeOutlines( m_str, xref );
+         
+      //---
+      // Pages object:
+      //---
+      writePages( str, xref );
+      
+      //---
+      // Page object:
+      //---
+      
+      // Capture position:
+      xref.push_back( (std::streamoff)str->tellp() );
+      
+      std::ostringstream os1;
+      os1 << xref.size() << " 0 obj\n"
+          << "  << /Type /Page\n"
+          << "     /Parent "    << xref.size()-1 << " 0 R\n" // Parent always one back.
+          << "     /Resources " << xref.size()+1 << " 0 R\n" // Next object.
+          << "     /MediaBox[0.0 0.0 " << WIDTH << " " << HEIGHT << "]\n"
+          // Contents = Resources_dictionary + tiles + base_form + 1):
+          << "     /Contents["  << (xref.size()+TILES+3) << " 0 R]\n";
+      
+      ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();      
+      if ( geom.valid() )
+      {
+         // Coordinate Transformation Matrix (CTM)
+         std::string lgiDictString;
+         getLgiDict( geom.get(), theAreaOfInterest, lgiDictString );
+         
+         if ( lgiDictString.size() )
+         {
+            os1 << lgiDictString;
+         }
+      }
+      
+      os1 << "  >>\n"
+         << "endobj\n"; // Matches: <</Type /Page"
+      
+      str->write( os1.str().data(), os1.str().size() );
+      if ( traceLog() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << os1.str() << "\n";
+      }
+      
+      // End /Page object
+      
+      //---
+      // Resource dictionary for page:
+      //---
+      
+      // Capture position:
+      xref.push_back( (std::streamoff)str->tellp() );
+
+      std::ostringstream os2;
+      os2 << xref.size() << " 0 obj % Resource dictionary for page.\n"
+          << "  << /ProcSet[/PDF/ImageB/ImageC]\n"
+          << "     /XObject << /Basemap_Form " << (xref.size()+TILES+1) << " 0 R ";
+
+      // Write in the tiles:
+      ossim_uint32 objIndex = static_cast<ossim_uint32>(xref.size()+1);
+      ossim_uint32 x;
+      ossim_uint32 y;
+      for ( x = 0; x < TW; ++x )
+      {
+         for ( y = 0; y < TH; ++y )
+         {
+            os2 << getTileString( x, y ) << " " << objIndex << " 0 R ";
+
+            ++objIndex;
+         }
+ 
+      }
+      os2 << ">>\n" // Matches: /XObject<<
+          << "  >>\nendobj\n"; // Matches: % Resources...";
+
+      str->write( os2.str().data(), os2.str().size() );
+      if ( traceLog() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << os2.str() << "\n";
+      }
+      
+      // End Resources dictionary.
+
+      //---
+      // Now write the XObjects jpeg tiles:
+      //---
+      ossim_uint32 tileNumber = 0;
+      std::vector<ossimIrect> outputTileRects;
+      while ( tileNumber < TILES )
+      {
+         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
+         if( id.valid() )
+         {
+            // To hold output tile rect clamped to AOI.
+            ossimIrect outputTileRect;
+
+            switch ( getImageType() )
+            {
+               case ossimPdfWriter::RAW:
+               {
+                  writeRawTile( str, xref, id.get(), theAreaOfInterest, outputTileRect );
+                  break;
+               }
+               case ossimPdfWriter::JPEG:
+               default:
+               {
+                  writeJpegTile( str, xref, id.get(), theAreaOfInterest, outputTileRect );
+                  break;
+               }
+            }
+
+            // Capture tile rect:
+            outputTileRects.push_back( outputTileRect );
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimPdfWriter::writeImage ERROR:"
+               << "\nNULL Tile encountered, tile number=" << tileNumber
+               << std::endl;
+            status = false;
+            break;
+         }
+
+         ++tileNumber;
+
+         setPercentComplete( tileNumber / TILES * 100.0 );
+      }
+
+      if ( tileNumber == TILES )
+      {
+         status = true;
+      }
+
+      if ( status )
+      {
+         //---
+         // XObect Form for image tiles:
+         //---
+         
+         // Capture position:
+         xref.push_back( (std::streamoff)str->tellp() );
+
+         ossimIpt llPageOffset;
+         getLowerLeftPageOffset( theAreaOfInterest, llPageOffset );
+
+         std::ostringstream os3;
+         
+         // Tile loop - ontents for each ile:
+         tileNumber = 0;
+         ossim_uint32 x;
+         ossim_uint32 y;
+         for ( x = 0; x < TW; ++x )
+         {
+            for ( y = 0; y < TH; ++y )
+            {
+               //---
+               // PDF space is positive y = up, positive x = right.
+               // ossim image space is positive y down.
+               // 0, 0 is lower left corner in pdf space so "y of 0" in pdf space is
+               // theAreaOfInterest.ll().y in image space.
+               //---
+               ossim_int32 width = outputTileRects[tileNumber].width();
+
+               ossim_int32 height = outputTileRects[tileNumber].height();
+               
+               ossim_int32 llOffsetX =
+                  llPageOffset.x + outputTileRects[tileNumber].ll().x - theAreaOfInterest.ll().x;
+
+               ossim_int32 llOffsetY = llPageOffset.y + theAreaOfInterest.lr().y -
+                  outputTileRects[tileNumber].ll().y;
+               
+               os3 << "   q\n"                      // Save graphics state
+                   << "      " << width << " 0 0 " << height << " "
+                   << llOffsetX << " " << llOffsetY << " cm\n"
+                   << "      " << getTileString( x, y ) << " Do\n"
+                   << "   Q\n"; // Restore graphics state.
+               ++tileNumber;
+            }
+         }
+
+         std::ostringstream os4;
+         os4 << xref.size() << " 0 obj % /XObject/Form dictionary for image tiles.\n"
+             << "   << /Type /XObject\n"
+             << "      /Subtype /Form\n"
+             << "      /Length " << os3.str().size() << "\n"
+             << "      /BBox["
+             << llPageOffset.x << " " << llPageOffset.y << " "
+             << WIDTH << " " << HEIGHT << "]\n"
+             << "   >>\n"
+             << "stream\n";
+
+         // Write the content stream to tmp stream.
+         os4.write( os3.str().data(), os3.str().size() );
+         
+         os4 << "\n"
+             << "endstream\n"
+             << "endobj\n";
+
+         // Write the tmp stream to output stream.
+         str->write( os4.str().data(), os4.str().size() );
+         
+         if ( traceLog() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << os4.str() << "\n";
+         }
+         
+         //---
+         // Contents of page:
+         //---
+         
+         // Capture position:
+         xref.push_back( (std::streamoff)str->tellp() );
+
+         std::ostringstream os5;
+         os5 << "/Basemap_Form Do";
+         
+         std::ostringstream os6;
+         os6 << xref.size() << " 0 obj % Contents of page.\n"
+             << "   << /Length " << os5.str().size() << " >>\n"
+             << "stream\n";
+
+         os6.write( os5.str().data(), os5.str().size() );
+         os6 << "\n"
+             << "endstream\n"
+             << "endobj\n";
+         
+         str->write( os6.str().data(), os6.str().size() );
+         if ( traceLog() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << os6.str() << "\n";
+         }
+         
+         m_mutex.lock(); // Code not thread safe.
+         
+         // Document Information dictionary:
+         writeInfo( str, xref );
+         
+         m_mutex.unlock();
+         
+         //---
+         // Cross reference tables:
+         //---
+         
+         // Capture start of xref for the second to last line:
+         std::streamoff xrefOffset = (std::streamoff)m_str->tellp();
+         
+         writeXref( m_str, xref );
+         
+         //---
+         // Trailer:
+         //---
+         writeTrailer( m_str, static_cast<ossim_uint32>(xref.size()+1), xrefOffset );
+      }
+      
+   } // Matches: if ( str ...
+   
+   return status;
+
+} // End: ossimPdfWriter::writeImage
+
+void ossimPdfWriter::writeJpegTile( std::ostream* str,
+                                    std::vector<std::streamoff>& xref,
+                                    ossimImageData* id,
+                                    const ossimIrect& aoi,
+                                    ossimIrect& outputTileRect )
+{
+   //---
+   // Most of code and comments below are from jpeg-6b "example.c" file. See 
+   // http://www4.cs.fau.de/Services/Doc/graphics/doc/jpeg/libjpeg.html
+   //---
+
+   //---
+   // Initialize JPEG compression library:
+   // Note: JDIMENSION is typedefed to an unsigned int.
+   //---
+   struct jpeg_compress_struct cinfo;
+   struct jpeg_error_mgr jerr;
+   cinfo.err = jpeg_std_error( &jerr );
+   jpeg_create_compress(&cinfo);
+
+   //---
+   // Need to define a custom ostream destination manager for jpeglib to write compressed block:
+   // Note: Write the tile to a temp memory stream to get the size up front.
+   //---
+   std::ostringstream tileStream;
+   jpeg_cpp_stream_dest(&cinfo, tileStream);
+   
+   
+   // Setting the parameters of the output file here.
+   const ossim_uint32 BANDS = id->getNumberOfBands();
+   const ossim_uint32 TW    = id->getWidth();
+   const ossim_uint32 TH    = id->getHeight();
+   
+
+   // Assign width, height clamping to the aoi.      
+   cinfo.image_width = ossim::min<ossim_uint32>(
+      TW, aoi.lr().x - id->getOrigin().x + 1 );
+   cinfo.image_height = ossim::min<ossim_uint32>(
+      TH, aoi.lr().y - id->getOrigin().y + 1 );
+   cinfo.input_components = BANDS;
+
+   // Capture the output tile rect:
+   outputTileRect = ossimIrect( id->getOrigin(),
+                                ossimIpt( id->getOrigin().x + cinfo.image_width - 1,
+                                          id->getOrigin().y + cinfo.image_height - 1 ) );
+   
+   // colorspace of input image 
+   if ( BANDS == 3 )
+   {
+      cinfo.in_color_space = JCS_RGB;
+   }
+   else
+   {
+      cinfo.in_color_space = JCS_GRAYSCALE;
+   }
+   
+   // Default compression parameters...
+   jpeg_set_defaults( &cinfo );
+   
+   /* Now do the compression .. */
+   jpeg_start_compress( &cinfo, TRUE );
+   
+   // Compress the tile on line at a time:
+   JSAMPLE** samp_array = new JSAMPLE* [cinfo.image_height];
+   
+   //---
+   // Get a pointer to the source data.
+   // Needs to be band interleaved by pixel(BIP), so convert if needed.
+   //---
+   ossimRefPtr<ossimImageData> tempTile = 0;
+   ossim_uint8* tile = 0;
+   if ( ( BANDS == 1 ) &&
+        ( cinfo.image_width == id->getWidth() ) &&
+        ( cinfo.image_height == id->getHeight() ) )
+   {
+      tile = id->getUcharBuf();
+   }
+   else
+   {
+      // Convert from OSSIM's native BSQ interleave to BIP.
+      tempTile = new ossimImageData(
+         0, OSSIM_UINT8, BANDS, cinfo.image_width, cinfo.image_height );
+      tempTile->setOrigin( id->getOrigin() );
+      tempTile->initialize();
+      tile = tempTile->getUcharBuf();
+      id->unloadTile( tile, tempTile->getImageRectangle(), OSSIM_BIP );
+   }
+      
+   for ( ossim_uint32 row=0; row<cinfo.image_height; ++row )
+   {
+      samp_array[row] = (JSAMPLE*) tile + row*cinfo.input_components*cinfo.image_width;
+   }
+   
+   jpeg_write_scanlines( &cinfo, samp_array, cinfo.image_height );
+
+   //---
+   // Clean up after done compressing:
+   // Note: MUST do before writing to output stream below.
+   //---
+   jpeg_finish_compress( &cinfo );
+   jpeg_destroy_compress( &cinfo );
+   delete [] samp_array;
+   samp_array = 0;
+
+   // Capture position:
+   xref.push_back( (std::streamoff)str->tellp() );
+   
+   std::ostringstream os1;
+   os1 << xref.size() << " 0 obj\n"
+       << "   << /Type /XObject\n"
+       << "      /Subtype /Image\n"
+       << "      /Length " << tileStream.str().size() << "\n"
+       << "      /Filter[/DCTDecode]\n"
+       << "      /BitsPerComponent 8"
+       << "      /ColorSpace " << (BANDS==1?"/DeviceGray\n":"/DeviceRGB\n")
+       << "      /Width " << cinfo.image_width
+       << "      /Height " << cinfo.image_height
+       << "   >>\n"
+       << "stream\n";
+   
+   str->write( os1.str().data(), os1.str().size() );
+   
+   if ( traceLog() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << os1.str()
+         << "*** image stream not displayed ***\n"
+         << "endstream\n"
+         << "endobj\n\n";
+   }
+
+   // Write the image tile from memory to output stream.
+   str->write( tileStream.str().data(), tileStream.str().size() );
+
+   // Close out stream object.
+   *str << "\n"
+        << "endstream\n"
+        << "endobj\n";
+   
+} // End: ossimPdfWriter::writeJpegTile( ... )
+
+void ossimPdfWriter::writeRawTile( std::ostream* str,
+                                   std::vector<std::streamoff>& xref,
+                                   ossimImageData* id,
+                                   const ossimIrect& aoi,
+                                   ossimIrect& outputTileRect )
+{
+   const ossim_uint32 BANDS = id->getNumberOfBands();
+   const ossim_uint32 TW    = id->getWidth();
+   const ossim_uint32 TH    = id->getHeight();
+
+   // Assign width, height clamping to the aoi.      
+   ossim_uint32 width = ossim::min<ossim_uint32>(
+      TW, aoi.lr().x - id->getOrigin().x + 1  );
+   ossim_uint32 height = ossim::min<ossim_uint32>(
+      TH, aoi.lr().y - id->getOrigin().y + 1 );
+
+   // Capture the output tile rect:
+   outputTileRect = ossimIrect( id->getOrigin(),
+                                ossimIpt( id->getOrigin().x + width - 1,
+                                          id->getOrigin().y + height - 1 ) );
+
+   //---
+   // Get a pointer to the source data.
+   // Needs to be band interleaved by pixel(BIP), so convert if needed.
+   //---
+   ossimRefPtr<ossimImageData> tempTile = 0;
+   ossim_uint8* tile = 0;
+   ossim_uint32 length = 0;
+   if ( ( BANDS == 1 ) && ( width == id->getWidth() ) && ( height == id->getHeight() ) )
+   {
+      tile   = id->getUcharBuf();
+      length = id->getSizeInBytes();
+   }
+   else
+   {
+      // Convert from OSSIM's native BSQ interleave to BIP.
+      tempTile = new ossimImageData( 0, OSSIM_UINT8, BANDS, width, height );
+      tempTile->setOrigin( id->getOrigin() );
+      tempTile->initialize();
+      tile = tempTile->getUcharBuf();
+      id->unloadTile( tile, tempTile->getImageRectangle(), OSSIM_BIP );
+      length = tempTile->getSizeInBytes();
+   }
+
+   // Capture position:
+   xref.push_back( (std::streamoff)str->tellp() );
+   
+   std::ostringstream os1;
+   os1 << xref.size() << " 0 obj\n"
+       << "   << /Type /XObject\n"
+       << "      /Subtype /Image\n"
+       << "      /Length " << length << "\n"
+       << "      /BitsPerComponent 8"
+       << "      /ColorSpace " << (BANDS==1?"/DeviceGray\n":"/DeviceRGB\n")
+       << "      /Width " << width
+       << "      /Height " << height
+       << "   >>\n"
+       << "stream\n";
+
+   str->write( os1.str().data(), os1.str().size() );
+   
+   if ( traceLog() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << os1.str()
+         << "*** image stream not displayed ***\n"
+         << "endstream\n"
+         << "endobj\n\n";
+   }
+
+   // Write the image tile from memory to output stream.
+   str->write( (char*)tile, length );
+   
+   // Close out stream object.
+   *str << "\n"
+        << "endstream\n"
+        << "endobj\n";
+   
+} // End ossimPdfWriter::writeRawTile( ... )
+
+void ossimPdfWriter::writeXref( std::ostream* str,
+                                const std::vector<std::streamoff>& xref )
+{
+   if ( str )
+   {
+      std::ostringstream os;
+      os << "xref\n"
+         << "0 " << (xref.size()+1) << "\n"
+         << "0000000000 65535 f \n";
+            
+      std::vector<std::streamoff>::const_iterator i = xref.begin();
+      while ( i != xref.end() )
+      {
+         os << std::setiosflags(std::ios_base::fixed|std::ios_base::right)
+            << std::setfill('0')
+            << std::setw(10)
+            << (*i)
+            << " 00000 n \n";
+         ++i;
+      }
+      
+      // os << "\n";
+      
+      str->write( os.str().data(), os.str().size() );
+      
+      if ( traceLog() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+}
+
+void ossimPdfWriter::writeTrailer( std::ostream* str,
+                                   ossim_uint32 entrySize,
+                                   std::streamoff xrefOffset )
+{
+   if ( str )
+   {
+      std::ostringstream os;
+      os << "trailer\n"
+         << "   << /Size " << entrySize << "\n"
+         << "      /Root 1 0 R\n"
+         << "      /Info " << entrySize-1 << " 0 R\n"
+         << "   >>\n"
+         << "startxref\n"
+         << xrefOffset << "\n"
+         << "%%EOF\n";
+      // << "%%EOF";
+
+      str->write( os.str().data(), os.str().size() );
+
+      if ( traceLog() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+}
+
+#if 0
+void ossimPdfWriter::writeDummy( std::ostream* str,
+                                 std::vector<std::streamoff>& xref  )
+{
+   // Write a blank object.
+   if ( str )
+   {
+      // Capture position:
+      xref.push_back( (std::streamoff)str->tellp() );
+      
+      std::ostringstream os;
+      os << xref.size() << " 0 obj % dummy\n"
+         << "endobj\n";
+      
+      str->write( os.str().data(), os.str().size() );
+      
+      if ( traceLog() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << os.str() << "\n";
+      }
+   }
+}
+#endif
+
+bool ossimPdfWriter::saveState(ossimKeywordlist& kwl,
+                               const char* prefix)const
+{
+   return ossimImageFileWriter::saveState(kwl, prefix);
+}
+
+bool ossimPdfWriter::loadState(const ossimKeywordlist& kwl,
+                               const char* prefix)
+{
+   return ossimImageFileWriter::loadState(kwl, prefix);
+}
+
+bool ossimPdfWriter::isOpen() const
+{
+   bool result = false;
+   if (m_str)
+   {
+      const std::ofstream* fs = dynamic_cast<const std::ofstream*>(m_str);
+      if ( fs )
+      {
+         result = fs->is_open();
+      }
+      else
+      {
+         // Pointer good enough...
+         result = true;
+      }
+   }
+   return result;
+}
+
+
+bool ossimPdfWriter::open()
+{
+   bool result = false;
+   
+   close();
+
+   // Check for empty filenames.
+   if (theFilename.size())
+   {
+      std::ofstream* os = new std::ofstream();
+      os->open(theFilename.c_str(), ios::out | ios::binary);
+      if(os->is_open())
+      {
+         m_str = os;
+         m_ownsStream = true;
+         result = true;
+      }
+      else
+      {
+         delete os;
+         os = 0;
+      }
+   }
+   return result;
+}
+
+void ossimPdfWriter::close()
+{
+   if (m_str)      
+   {
+      m_str->flush();
+
+      if (m_ownsStream)
+      {
+         delete m_str;
+         m_str = 0;
+         m_ownsStream = false;
+      }
+   }
+}
+
+void ossimPdfWriter::getImageTypeList(std::vector<ossimString>& imageTypeList)const
+{
+   imageTypeList.push_back(ossimString("ossim_pdf"));
+}
+
+ossimString ossimPdfWriter::getExtension() const
+{
+   return ossimString("pdf");
+}
+
+bool ossimPdfWriter::hasImageType(const ossimString& imageType) const
+{
+   bool result = false;
+   if ( (imageType == "ossim_pdf") || (imageType == "image/pdf")||(imageType == "application/pdf") )
+   {
+      result = true;
+   }
+   return result;
+}
+
+void ossimPdfWriter::setProperty( ossimRefPtr<ossimProperty> property )
+{
+   if ( property.valid() )
+   {
+      std::string name = property->getName().string();
+      if ( name.size() )
+      {
+         if ( ( name == ossimKeywordNames::IMAGE_TYPE_KW ) ||
+              ( name == AUTHOR_KW ) ||
+              ( name == CREATOR_KW ) ||
+              ( name == CREATION_DATE_KW ) ||
+              ( name == KEYWORDS_KW ) ||
+              ( name == MOD_DATE_KW ) ||
+              ( name == ossimKeywordNames::OUTPUT_TILE_SIZE_KW ) ||
+              ( name == PRODUCER_KW ) ||
+              ( name == SUBJECT_KW ) ||
+              ( name == TITLE_KW ) )
+         {
+            addOption( name, property->valueToString().string() );
+         }
+         else
+         {
+            ossimImageFileWriter::setProperty(property);
+         }
+      }
+   }
+   
+} // ossimPdfWriter::setProperty
+
+ossimRefPtr<ossimProperty> ossimPdfWriter::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+
+   if ( name.size() )
+   {
+      if ( name == AUTHOR_KW )
+      {
+         ossimString value;
+         getAuthor( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, true);
+         prop = stringProp.get();
+      }
+      else if ( name == CREATOR_KW )
+      {
+         ossimString value;
+         getCreator( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, true);
+         prop = stringProp.get();
+      }
+      else if ( name == CREATION_DATE_KW )
+      {
+         ossimString value;
+         getCreationDate( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, true);
+         prop = stringProp.get();
+      }
+      else if ( name == ossimKeywordNames::IMAGE_TYPE_KW )
+      {
+         ossimString value;
+         getImageType( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, false); //  editable flag = false
+         
+         // Alway support jpeg.
+         stringProp->addConstraint( ossimString("jpeg") );
+         
+         // Alway support raw (general raster).
+         stringProp->addConstraint( ossimString("raw") );
+
+         prop = stringProp.get();
+      }
+      else if ( name == KEYWORDS_KW )
+      {
+         ossimString value;
+         getKeywords( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, true);
+         prop = stringProp.get();
+      }
+      else if ( name == MOD_DATE_KW )
+      {
+         ossimString value;
+         getModDate( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, true);
+         prop = stringProp.get();
+      }
+      else if( name == ossimKeywordNames::OUTPUT_TILE_SIZE_KW )
+      {
+         ossimString value;
+         getTileSize( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, false);
+         stringProp->addConstraint(ossimString("16"));
+         stringProp->addConstraint(ossimString("32"));
+         stringProp->addConstraint(ossimString("64"));
+         stringProp->addConstraint(ossimString("128"));
+         stringProp->addConstraint(ossimString("256"));      
+         stringProp->addConstraint(ossimString("512"));      
+         stringProp->addConstraint(ossimString("1024"));      
+         stringProp->addConstraint(ossimString("2048"));      
+         prop = stringProp.get();
+      }
+      else if ( name == SUBJECT_KW )
+      {
+         ossimString value;
+         getSubject( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, true);
+         prop = stringProp.get();
+      }
+      else if ( name == TITLE_KW )
+      {
+         ossimString value;
+         getSubject( value.string() );
+         ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty( name, value, true);
+         prop = stringProp.get();
+      }
+      else
+      {
+         prop = ossimImageFileWriter::getProperty(name);
+      }
+   }
+   
+   return prop;
+   
+} // End: ossimPdfWriter::getProperty
+
+void ossimPdfWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back( ossimString( AUTHOR_KW ) );
+   propertyNames.push_back( ossimString( CREATOR_KW ) );
+   propertyNames.push_back( ossimString( CREATION_DATE_KW ) );
+   propertyNames.push_back( ossimString( ossimKeywordNames::IMAGE_TYPE_KW ) );
+   propertyNames.push_back( ossimString( KEYWORDS_KW ) );
+   propertyNames.push_back( ossimString( MOD_DATE_KW ) );
+   propertyNames.push_back( ossimString( ossimKeywordNames::OUTPUT_TILE_SIZE_KW ) );
+   propertyNames.push_back( ossimString( PRODUCER_KW ) );
+   propertyNames.push_back( ossimString( SUBJECT_KW ) );
+   propertyNames.push_back( ossimString( TITLE_KW ) );
+
+   ossimImageFileWriter::getPropertyNames(propertyNames);
+}
+
+bool ossimPdfWriter::setOutputStream(std::ostream& stream)
+{
+   if (m_ownsStream && m_str)
+   {
+      delete m_str;
+   }
+   m_str = &stream;
+   m_ownsStream = false;
+   return true;
+}
+
+void ossimPdfWriter::setupInputChain()
+{
+   if ( theInputConnection.get() )
+   {
+      // Capture the input to the image source sequencer(theInputConnection).
+      m_savedInput = theInputConnection->getInput( 0 );
+      
+      ossimScalarType inputScalar = theInputConnection->getOutputScalarType();
+      ossim_uint32 bands          = theInputConnection->getNumberOfOutputBands();
+
+      if( inputScalar != OSSIM_UINT8 )
+      {
+         // Make eight bit.
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimPdfWriter::setupInputChain WARNING:"
+               << "\nData is being scaled to 8 bit!"
+               << "\nOriginal scalar type:  "
+               << ossimScalarTypeLut::instance()->
+               getEntryString(inputScalar).c_str()
+               << std::endl;
+         }
+         
+         //---
+         // Attach a scalar remapper to the end of the input chain.  This will
+         // need to be unattached and deleted at the end of this.
+         //---
+         ossimRefPtr<ossimScalarRemapper> sr = new ossimScalarRemapper;
+
+         // Connect remapper's input to sequencer input.
+         sr->connectMyInputTo( 0, theInputConnection->getInput(0) );
+
+         // Connet sequencer to remapper.
+         theInputConnection->connectMyInputTo(0, sr.get() );
+
+         // Initialize connections.
+         theInputConnection->initialize();
+      }
+
+      // Must be one or three band. Note bands are zero based...      
+      if ( ( bands != 1 ) && ( bands != 3 ) )
+      {
+         std::vector<ossim_uint32> bandList;
+         
+         // Always have one band.
+         bandList.push_back( 0 );
+
+         if ( bands > 3 )
+         {
+            // Use the first three bands.
+            bandList.push_back( 1 );
+            bandList.push_back( 2 );
+         }
+
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimPdfWriter::setupInputChain WARNING:"
+               << "\nOutput bands must be 1 or 3 and are being filterd!"
+               << "\nOriginal band count: " << bands
+               << "\nNew band count: " << bandList.size()
+               << std::endl;
+         }
+         
+         ossimRefPtr<ossimBandSelector> bs = new ossimBandSelector();
+
+         // Set the the band selector list.
+         bs->setOutputBandList( bandList );
+         
+         // Connect band selector's input to sequencer input.
+         bs->connectMyInputTo( 0, theInputConnection->getInput(0) );
+
+         // Connet sequencer to band selector.
+         theInputConnection->connectMyInputTo(0, bs.get() );
+
+         // Initialize connections.
+         theInputConnection->initialize();
+      }
+
+      if (  m_savedInput != theInputConnection->getInput( 0 ) )
+      {
+         //---
+         // If the input to the image source sequencer change the AOI
+         // MUST be reset as it gets wiped.
+         //---
+         theInputConnection->setAreaOfInterest( theAreaOfInterest );
+      }
+      
+   } // Matches: if ( theInputConnection )
+
+} // End: void ossimPdfWriter::setupInputChain()
+
+ossimPdfWriter::ossimPdfImageType ossimPdfWriter::getImageType() const
+{
+   ossimPdfWriter::ossimPdfImageType result = ossimPdfWriter::UNKNOWN;
+
+   // Get the type and downcase.
+   ossimString os;
+   getImageType( os.string() );
+   os.downcase();
+
+   if ( os == "jpeg" )
+   {
+      result = ossimPdfWriter::JPEG;
+   }
+   else if ( os == "raw" )
+   {
+      result = ossimPdfWriter::RAW;
+   }
+   else
+   {
+      // Unknown value:
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimPdfWriter::getImageCompression WARN\n"
+         << "Unhandled image compression type: " << os << std::endl;
+   }
+   return result;
+}
+
+void ossimPdfWriter::getImageType( std::string& type ) const
+{
+   type = m_kwl->findKey( std::string(ossimKeywordNames::IMAGE_TYPE_KW) );
+   if ( type.empty() )
+   {
+      type = "jpeg"; // default
+   }
+}
+
+void ossimPdfWriter::addOption(  const std::string& key, const std::string& value )
+{
+   m_mutex.lock();
+   if ( m_kwl.valid() )
+   {
+      if ( key.size() && value.size() )
+      {
+         m_kwl->addPair( key, value );
+      }
+   }
+   m_mutex.unlock();
+}
+
+#if 0
+void ossimPdfWriter::getMediaBoxSize(  ossim_uint32 imageWidth,
+                                       ossim_uint32 imageHeight,
+                                       ossimIpt& size ) const
+{
+   //---
+   // This could be an option / property.
+   // 612 x 792 = 8.5 x 11 inches at 72 dots per inch (612/72 x 792/72)
+   //---
+   size.x = static_cast<ossim_uint32>(imageWidth);
+   size.y = static_cast<ossim_uint32>(imageHeight);
+}
+#endif
+
+void ossimPdfWriter::getLowerLeftPageOffset( const ossimIrect& aoi, ossimIpt& offset ) const
+{
+   if ( aoi.hasNans() == false )
+   {
+      // Get the page size.
+      // ossimIpt mediaBoxSize;
+      // getMediaBoxSize( mediaBoxSize );
+
+      // Temp hard coded. (drb)
+      offset.x = 0;
+      offset.y = 0;
+   }
+   else
+   {
+      offset.x = 0;
+      offset.y = 0;
+   }
+}
+
+void ossimPdfWriter::getLgiDict( ossimImageGeometry* geom,
+                                 const ossimIrect& aoi,
+                                 std::string& s ) const
+{
+   s.clear(); // Empty string indicates error.
+
+   if ( geom && !aoi.hasNans() )
+   {
+      // Coordinate Transformation Matrix (CTM)
+      std::string ctmString;
+      getLgiDictCtm( geom, aoi, ctmString );
+
+      if ( ctmString.size() )
+      {
+         // ProjectionType
+         std::string projectionString;
+         getLgiDictProjection( geom, projectionString );
+         
+         if ( projectionString.size() )
+         {
+            //---
+            // Neatline: Not required for single frame.
+            // std::string neatLineString;
+            // getLgiDictNeatline( geom, neatLineString );
+            //---
+            
+            // if ( neatLineString.size() )
+            // {
+            // cout << "d..." << endl;
+               
+            // Description
+            std::string descriptionString;
+            getLgiDictDescription( geom, descriptionString );
+            
+            if ( descriptionString.size() )
+            {
+               std::ostringstream os;
+               os << "/LGIDict"
+                  << "[<<"
+                  << ctmString
+                  << "/Version(2.1)"
+                  << projectionString
+                  // << neatLineString
+                  << descriptionString
+                  << "/Type/LGIDict>>]";
+               
+               s = os.str();
+               // }
+            }
+         }
+      }
+   }
+   
+} // End: ossimPdfWriter::getLgiDictString
+
+void ossimPdfWriter::getLgiDictDatum( ossimImageGeometry* geom,
+                                      std::string& s ) const
+{
+   s.clear();
+   if ( geom )
+   {
+      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
+      if ( mapProj.valid() )
+      {
+         const ossimDatum* datum = mapProj->getDatum();
+         if ( datum )
+         {
+            s = "/Datum(";
+            s += datum->code().string();
+            s += ")";
+         }
+      }
+   }
+   
+} // End: ossimPdfWriter::getLgiDictDatum
+
+void ossimPdfWriter::getLgiDictDescription( ossimImageGeometry* geom,
+                                            std::string& s ) const
+{
+   s.clear();
+   if ( geom )
+   {
+      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
+      if ( mapProj.valid() )
+      {
+         const ossimDatum* datum = mapProj->getDatum();
+         if ( datum )
+         {
+            std::string code = datum->code().string();
+
+            if ( code == "WGE" )
+            {
+               s = "/Description(WGS 84)";
+            }
+         }
+      }
+   }
+   
+} // End: ossimPdfWriter::getLgiDictDescription
+
+#if 0
+void ossimPdfWriter::getLgiDictNeatline( ossimImageGeometry* geom,
+                                         std::string& s ) const
+{
+   s.clear();
+   if ( geom )
+   {
+      std::ostringstream os;
+
+      // Tmp drb...
+      os << "/Neatline[(0.0000000000)(0.0000000000)(0.0000000000)(718.0800000000)(609.8400000000)(718.0800000000)(609.8400000000)(0.0000000000)]";
+
+      s = os.str();
+   }
+   
+} // End: ossimPdfWriter::getLgiDictNeatline
+#endif
+
+void ossimPdfWriter::getLgiDictProjection( ossimImageGeometry* geom,
+                                           std::string& s ) const
+{
+   s.clear(); // Empty string indicates error.
+   
+   // Projection:
+   std::string projType;
+   getLgiDictProjectionType( geom, projType );
+   
+   // Datum:
+   std::string datumString;
+   getLgiDictDatum( geom, datumString );
+   
+   // Description
+   std::string descriptionString;
+   getLgiDictDescription( geom, descriptionString );
+
+   if ( projType.size() && datumString.size() )
+   {
+      std::ostringstream os;
+      os << "/Projection<<"
+         << projType
+         << descriptionString
+         << datumString
+         << "/Type/Projection>>"
+         << "/Display<<"
+         << projType
+         << descriptionString
+         << datumString
+         << "/Type/Projection>>";
+
+      s = os.str();
+   }
+   
+} // End: ossimPdfWriter::getLgiDictProjection
+
+void ossimPdfWriter::getLgiDictCtm( ossimImageGeometry* geom,
+                                    const ossimIrect& aoi,
+                                    std::string& s ) const
+{
+   s.clear(); // Empty string indicates error.
+
+   ossimDpt scale;
+   scale.makeNan();
+   ossimDpt dTie;
+   dTie.makeNan();
+   
+   ossimRefPtr<ossimProjection> proj = geom->getProjection();
+   if ( proj.valid() )
+   {
+      ossimRefPtr<ossimMapProjection> mapProj = dynamic_cast<ossimMapProjection*>( proj.get() );
+      if ( mapProj.valid() )
+      {
+         if ( mapProj->isGeographic() )
+         {
+            // Degrees per pixel.
+            geom->getDegreesPerPixel( scale );
+
+            if ( !scale.hasNans() )
+            {
+               // Tie point: Lat, lon of lower left corner. 
+               ossimGpt gTie;
+               geom->localToWorld( ossimDpt( aoi.ll() ), gTie );
+
+               // Check just lat and lon disregard height.
+               if ( !ossim::isnan(gTie.lon) && !ossim::isnan(gTie.lon) )
+               {
+                  dTie.x = gTie.lon;
+                  dTie.y = gTie.lat;
+               }
+            }
+         }
+      }
+   }
+
+   if ( !scale.hasNans() && !dTie.hasNans() )
+   {
+      //---
+      // Example string:
+      // (0.0000381944)(0.0000000000)(0.0000000000)(0.0000381944)(-77.0558525000)(38.8388091667)
+      // NOTE: (0,0) is lower left corner in pdf space.
+      ossim_float64 d = 0.0;
+      std::ostringstream os;
+      os << setprecision(15) // Not sure if this should be 10??? (drb)
+         << std::setiosflags(std::ios_base::fixed|std::ios_base::right)
+         << std::setfill('0')
+         << "/CTM[(" << scale.x << ")(" << d << ")(" << d << ")("
+         << scale.y << ")(" << dTie.x << ")(" << dTie.y << ")]";
+      
+      s = os.str();
+   }
+   
+} // End: ossimPdfWriter::getCtmString
+
+void ossimPdfWriter::getLgiDictProjectionType( ossimImageGeometry* geom, std::string& s ) const
+{
+   //---
+   // Initialize the projection string from geometry:
+   // Currently only coded for geographic and UTM projection.
+   //---
+   
+   s.clear(); // Empty string indicates error.
+
+   if ( geom )
+   {
+      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
+      if ( mapProj.valid() )
+      {
+         if ( mapProj->isGeographic() )
+         {
+            s = "/ProjectionType(GEOGRAPHIC)";
+         }
+         else
+         {
+            // Check for UTM:
+            ossimRefPtr<const ossimUtmProjection> utmProj =
+               dynamic_cast<const ossimUtmProjection*>( mapProj.get() );
+            if ( utmProj.valid() )
+            {
+               ossim_int32 zone = utmProj->getZone();
+               char hemisphere = utmProj->getHemisphere();
+               std::ostringstream os;
+               os << "/ProjectionType(UT)"
+                  << "/Zone(" << zone << ")"
+                  << "/Hemisphere(" << hemisphere << ")";
+               s = os.str();
+            }
+         }
+      }
+      
+   } // Matches if ( geom )
+   
+} // End: ossimPdfWriter::getProjectionType
+
+ossim_uint32 ossimPdfWriter::getEpsgCode( const ossimImageGeometry* geom ) const
+{
+   ossim_uint32 code = 32767;
+   if ( geom )
+   {
+      ossimRefPtr<const ossimProjection> proj = geom->getProjection();
+      if ( proj.valid() )
+      {
+         // Map projection:
+         ossimRefPtr<const ossimMapProjection> mapProj =
+            dynamic_cast<const ossimMapProjection*>( proj.get() );
+            
+         if ( mapProj.valid() )
+         {
+            code = mapProj->getPcsCode();
+         }
+      }
+   }
+   return code;
+}
+
+#if 0
+void ossimPdfWriter::getNumberOfTiles( ossim_uint32 imageWidth,
+                                       ossim_uint32 imageHeight,
+                                       ossimIpt size ) const
+{
+   const ossim_int32 DEFAULT_TILE_DIMENSION = 1024;
+
+   size.x = imageWidth / DEFAULT_TILE_DIMENSION;
+   size.y = imageHeight / DEFAULT_TILE_DIMENSION;   
+
+   if ( imageWidth % DEFAULT_TILE_DIMENSION )
+   {
+      ++size.x;
+   }
+   if ( imageHeight % DEFAULT_TILE_DIMENSION )
+   {
+      ++size.y;
+   }
+   
+} // End: getNumberOfTiles( ... )
+#endif
+
+void ossimPdfWriter::getTitle( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( TITLE_KW );
+   
+   if ( s.empty() )
+   {
+      if ( theFilename.size() )
+      {
+         // Set to basename of file.
+         s = theFilename.file().string();
+      }
+   }
+}
+
+void ossimPdfWriter::getAuthor( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( AUTHOR_KW );
+   
+   if ( s.empty() )
+   {
+      s = "ossim"; // Default: ???
+   }
+}
+
+void ossimPdfWriter::getSubject( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( SUBJECT_KW );
+}
+
+void ossimPdfWriter::getKeywords( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( KEYWORDS_KW ); 
+}
+
+void ossimPdfWriter::getCreator( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( CREATOR_KW );
+   
+   if ( s.empty() )
+   {
+      s = "ossim"; // Default: ???
+   }
+}
+
+void ossimPdfWriter::getProducer( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( PRODUCER_KW );
+   
+   if ( s.empty() )
+   {
+      s = "ossim"; // Default: ???
+   }
+}
+
+void ossimPdfWriter::getCreationDate( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( CREATION_DATE_KW );
+   
+   if ( s.empty() )
+   {
+      getGmtDate( s ); 
+   }
+}
+
+void ossimPdfWriter::getModDate( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( MOD_DATE_KW );
+   
+   if ( s.empty() )
+   {
+      getGmtDate( s );
+   }
+}
+
+void ossimPdfWriter::getGmtDate( std::string& s ) const
+{
+   // Get the time:
+   time_t now;
+   time(&now);
+   
+   // Convert to UTC:
+   tm* gt = gmtime(&now);
+
+   if ( gt )
+   {
+      //---
+      // Format(26 charactors including trailing null):
+      // (D:YYYYMMDDHHmmSSZ00'00')
+      char dateChars[26];
+      dateChars[25] = '\0';
+      strftime(dateChars, 26, "(D:%Y%m%d%H%M%SZ00'00')", gt);
+      s = dateChars;
+   }
+   
+} // End: ossimPdfWriter::getGmtDate
+
+void ossimPdfWriter::getTileSize( std::string& s ) const
+{
+   // Check if in keyword list.
+   s = m_kwl->findKey( std::string( ossimKeywordNames::OUTPUT_TILE_SIZE_KW ) );
+   if ( s.empty() )
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize( tileSize );
+      s = ossimString::toString( tileSize.x ).string(); 
+   }
+}
+
+void ossimPdfWriter::getTileSize( ossimIpt& tileSize ) const
+{
+   std::string s;
+   getTileSize( s );
+   if ( s.size() )
+   {
+      tileSize.x = ossimString(s).toInt32();
+   }
+   else
+   {
+      tileSize.x = 1024; // default
+   }
+   tileSize.y = tileSize.x;
+}
+
+std::string ossimPdfWriter::getTileString( ossim_uint32 x, ossim_uint32 y ) const
+{
+   // Format like:  /Tile_0001_0002
+   std::ostringstream os;
+   os << std::setiosflags(std::ios_base::fixed|std::ios_base::right)
+      << std::setfill('0')
+      << "/Tile_"
+      << std::setw(4) << x
+      << "_"
+      << std::setw(4) << y;
+   
+   return os.str();
+}
diff --git a/src/imaging/ossimPiecewiseRemapper.cpp b/src/imaging/ossimPiecewiseRemapper.cpp
new file mode 100644
index 0000000..7d6c4a4
--- /dev/null
+++ b/src/imaging/ossimPiecewiseRemapper.cpp
@@ -0,0 +1,951 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Piecewise remapper class definition. Derived from ossimTableRemapper.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/imaging/ossimPiecewiseRemapper.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <iomanip>
+#include <iostream>
+#include <limits>
+#include <sstream>
+
+RTTI_DEF1(ossimPiecewiseRemapper, "ossimPiecewiseRemapper", ossimTableRemapper)
+
+
+static const std::string REMAP_KW      = "remap";
+static const std::string REMAP_TYPE_KW = "remap_type";
+
+static ossimTrace traceDebug("ossimPiecewiseRemapper:debug");
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id$";
+#endif
+
+// Private container class for points.
+ossimPiecewiseRemapper::ossimRemapSet::ossimRemapSet()
+   :
+   m_set(0)
+{
+}
+
+ossimPiecewiseRemapper::ossimRemapSet::ossimRemapSet(const ossimRemapSet& obj)
+   :
+   m_set(obj.m_set)
+{
+}
+
+const ossimPiecewiseRemapper::ossimRemapSet&
+ossimPiecewiseRemapper::ossimRemapSet::operator=( const ossimRemapSet& rhs )
+{
+   if ( this != &rhs )
+   {
+      m_set = rhs.m_set;
+   }
+   return *this;
+}
+
+// Private container class for points.
+ossimPiecewiseRemapper::ossimBandRemap::ossimBandRemap()
+   :
+   m_remap(0)
+{
+}
+
+ossimPiecewiseRemapper::ossimBandRemap::ossimBandRemap(const ossimBandRemap& obj)
+   :
+   m_remap(obj.m_remap)
+{
+}
+
+const ossimPiecewiseRemapper::ossimBandRemap&
+ossimPiecewiseRemapper::ossimBandRemap::operator=( const ossimBandRemap& rhs )
+{
+   if ( this != &rhs )
+   {
+      m_remap = rhs.m_remap;
+   }
+   return *this;
+}
+
+void ossimPiecewiseRemapper::ossimBandRemap::loadState( const ossimKeywordlist& kwl,
+                                                        const std::string& prefix,
+                                                        ossim_uint32 band )
+{
+   //---
+   // Band Remap set example:
+   // band0.remap0:((0, 127, 0, 127), (128, 255, 128, 382))
+   // band0.remap1:((0, 382, 0, 255))
+   //---
+
+   // Clear the sets:
+   m_remap.clear();
+   
+   // Get the number of remaps for this band.
+   std::string keyBase = "band";
+   keyBase += ossimString::toString(band).string();
+   keyBase += ".";
+   keyBase += REMAP_KW;
+   
+   ossim_uint32 NUMBER_REMAPS = kwl.numberOf(prefix.c_str(), keyBase.c_str());
+   ossim_uint32 found = 0;
+   ossim_uint32 index = 0;
+   
+   // Loop to find band remaps.  This allows for skipping indexes. 
+   while ( found < NUMBER_REMAPS )
+   {
+      std::string key = keyBase + ossimString::toString(index).string();
+      std::string value = kwl.findKey( prefix, key );
+      if ( value.size() )
+      {
+         ossimPiecewiseRemapper::ossimRemapSet set;
+         if ( initRemapSetFromString( value, set ) )
+         {
+            m_remap.push_back( set );
+         }
+         ++found;
+      }
+      
+      ++index;
+      if ( index > (NUMBER_REMAPS+100) )
+      {
+         break;
+      }
+   }
+   
+} // End: ossimPiecewiseRemapper::ossimBandRemap::loadState
+      
+void ossimPiecewiseRemapper::ossimBandRemap::saveState(
+   ossimKeywordlist& kwl,
+   const std::string& prefix,
+   ossimPiecewiseRemapper::PiecewiseRemapType remapType,
+   ossim_uint32 band ) const
+{
+   //---
+   // Remap set:
+   // Remap set: "band0.remap0":
+   // band0.remap0:((0, 127, 0, 127), (128, 255, 128, 382))
+   // band0.remap1:((0, 382, 0, 255))
+   //---
+   ossim_uint32 remapIndex = 0;
+   std::vector<ossimRemapSet>::const_iterator i = m_remap.begin();
+   while ( i != m_remap.end() )
+   {
+      std::string key = "band";
+      key += ossimString::toString(band).string();
+      key += ".";
+      key += REMAP_KW;
+      key += ossimString::toString(remapIndex).string();
+      std::string value;
+      getRemapSetString( remapType, (*i), value );
+      kwl.addPair( prefix, key, value );
+      ++i;
+      ++remapIndex;
+   }
+   
+} // End: ossimPiecewiseRemapper::ossimBandRemap::saveState
+
+bool ossimPiecewiseRemapper::ossimBandRemap::initRemapSetFromString(
+   const std::string& s, ossimPiecewiseRemapper::ossimRemapSet& set ) const
+{
+   //---
+   // Example:
+   // ((0, 127, 0, 127), (128, 255, 128, 382))
+   //---
+
+   bool result = false;
+
+   if ( s.size() )
+   {
+      std::istringstream in( s );
+      char c;
+      ossim_float64 d;
+      
+      // Gobble the open '('
+      while ( !in.bad() && !in.eof() )
+      {
+         c = in.get();
+         if ( c == '(' ) break;
+      }
+      
+      // Main loop:
+      while( !in.bad() && !in.eof() )
+      {
+         c = in.get();
+         
+         if ( c == ')' ) // Possible end of quadruple...
+         {
+            // Gobble next comma:
+            while( !in.bad() && !in.eof() )
+            {
+               c = in.get();
+               if ( c == ',' )
+               {
+                  break;
+               }
+            }
+            c = in.get();
+         }
+         
+         if ( (c == '(') || (c == ',') )
+         {
+            // Next string should be a number:
+            in >> d;
+            if ( in.good() )
+            {
+               set.m_set.push_back(d);
+            }
+            else
+            {
+               break;
+            }
+         }
+      }
+
+      if ( set.m_set.size() )
+      {
+         result = true;
+      }
+   }
+
+   if ( !result )
+   {
+      set.m_set.clear();
+   }
+
+   return result;
+   
+} // End: ossimPiecewiseRemapper::ossimBandRemap::initRemapSetFromString( ... )
+
+void ossimPiecewiseRemapper::ossimBandRemap::getRemapSetString(
+   ossimPiecewiseRemapper::PiecewiseRemapType remapType,
+   const ossimPiecewiseRemapper::ossimRemapSet& set, 
+   std::string& s ) const
+{
+   if ( remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
+   {
+      getLinearRemapSetString( set, s );
+   }
+}
+
+void ossimPiecewiseRemapper::ossimBandRemap::getLinearRemapSetString(
+   const ossimPiecewiseRemapper::ossimRemapSet& set, 
+   std::string& s ) const
+{
+   //---
+   // Save in the form of:
+   // ((0, 127, 0, 127), (128, 255, 128, 382))
+   //---
+   s.clear();
+   if ( set.m_set.size() )
+   {
+      const ossim_uint32 TUPLES = set.m_set.size() / 4;
+      if ( TUPLES )
+      {  
+         std::ostringstream os;
+         os << std::setprecision(15)
+            << "(";
+         for ( ossim_uint32 i = 0; i < TUPLES; ++i )
+         {
+            ossim_uint32 setIdx = i*4;
+            os << "("
+               << set.m_set[ setIdx ]
+               << ","
+               << set.m_set[ setIdx + 1 ]
+               << ","
+               << set.m_set[ setIdx + 2 ]
+               << ","
+               << set.m_set[ setIdx + 3 ]
+               << ")";
+            if ( i < (TUPLES-1) )
+            {
+               os << ","; // Comma between quadruples.
+            }
+         }
+         os << ")";
+         s = os.str();
+      }
+   }
+   
+} // End: ossimPiecewiseRemapper::ossimBandRemap::getLinearRemapSetString( ... )
+
+ossimPiecewiseRemapper::ossimPiecewiseRemapper()
+   :
+   ossimTableRemapper(),  // base class
+   m_dirty(false),
+   m_remapType(ossimPiecewiseRemapper::UNKNOWN),
+   m_bandRemap(0),
+   m_min(0),
+   m_max(0)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPiecewiseRemapper::ossimPiecewiseRemapper entered...\n";
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << "\n";
+#endif      
+   }
+}
+
+ossimPiecewiseRemapper::~ossimPiecewiseRemapper()
+{
+}
+
+void ossimPiecewiseRemapper::initialize()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPiecewiseRemapper::initialize entered..." << endl;
+   }
+
+   //---
+   // Call the base class initialize.
+   // Note:  This will reset "theInputConnection" if it changed...
+   //---
+   ossimTableRemapper::initialize();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPiecewiseRemapper::initialize exited..." << endl;
+   }
+}
+
+void ossimPiecewiseRemapper::setRemapType( const std::string& type )
+{
+   if ( (type == "linear_native") ||
+        (ossimString(type).downcase() == "linear_native") )
+   {
+      m_remapType = ossimPiecewiseRemapper::LINEAR_NATIVE;
+   }
+   else
+   {
+      m_remapType = ossimPiecewiseRemapper::UNKNOWN;
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimPiecewiseRemapper::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> result = 0;
+   
+   if ( theInputConnection )
+   {
+      if ( m_dirty )
+      {
+         // Rebuild the table if dirty flag set:
+         buildTable();
+      }
+
+      if ( theEnableFlag && theTable.size() ) 
+      {
+         //---
+         // Not bypassed and has a table...
+         // Base handles the rest...
+         //---
+         result = ossimTableRemapper::getTile(tileRect, resLevel);
+      }
+      else
+      {
+         // Fetch tile from pointer from the input source.
+         result = theInputConnection->getTile(tileRect, resLevel);
+      }
+   }
+
+   return result;
+}
+
+void ossimPiecewiseRemapper::getRemapTypeString(
+   ossimPiecewiseRemapper::PiecewiseRemapType remapType, std::string& s ) const
+{
+   if ( remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
+   {
+      s = "linear_native";
+   }
+   else
+   {
+      s = "unknown";
+   }
+}
+
+bool ossimPiecewiseRemapper::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   static const char MODULE[] = "ossimPiecewiseRemapper::loadState";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " Entered..." << "\nprefix:  " << (prefix?prefix:"null") << endl;
+   }
+
+   bool status = false;
+   std::string p = ( prefix ? prefix : "" );
+
+   // Check type first before going on:
+   std::string key = ossimKeywordNames::TYPE_KW;
+   std::string value;
+   value = kwl.findKey( p, key );
+
+   if ( value == "ossimPiecewiseRemapper" )
+   {
+      // Load the base class states...
+      status = ossimTableRemapper::loadState(kwl, prefix);
+      
+      if (status)
+      {
+         // Look for scalar type keyword.
+         // ossim_int32 st = ossimScalarTypeLut::instance()->getEntryNumber(kwl, p.c_str(), true);
+
+         // Lookup table returns -1 if not found so check return...
+         // if ( (st != -1) && (st != OSSIM_SCALAR_UNKNOWN) )
+         // {
+         // m_outputScalarType = static_cast<ossimScalarType>(st);
+         //}
+         
+         // Remap type "remap_type":
+         value = kwl.findKey( p, REMAP_TYPE_KW );
+         if ( value.size() )
+         {
+            setRemapType( value );
+            
+            if ( m_remapType != ossimPiecewiseRemapper::UNKNOWN )
+            {
+               // Get the number of bands "number_bands":
+               ossim_uint32 bands = 0;
+               key = ossimKeywordNames::NUMBER_BANDS_KW;
+               value = kwl.findKey( p, key );
+               if ( value.size() )
+               {
+                  bands = ossimString(value).toUInt32();
+               }
+               
+               if ( bands )
+               {
+                  // Start with clean remap set:
+                  m_bandRemap.clear();
+                  m_bandRemap.resize( bands );
+                  
+                  m_min.clear();
+                  m_max.clear();
+
+                  // Loop through bands:
+                  for ( ossim_uint32 band = 0; band < bands; ++band )
+                  {
+                     // Band remap:
+                     m_bandRemap[band].loadState( kwl, p, band );
+                     
+                     // Min:
+                     std::string keyBase = ossimKeywordNames::MIN_VALUE_KW;
+                     keyBase += ".band";
+                     key = keyBase + ossimString::toString(band).string();
+                     value =  kwl.findKey( p, key );
+                     if ( value.size() )
+                     {
+                        m_min.push_back( ossimString(value).toFloat64() );
+                     }
+                     
+                     // Max:
+                     keyBase = ossimKeywordNames::MAX_VALUE_KW;
+                     keyBase += ".band";
+                     key = keyBase + ossimString::toString(band).string();
+                     value =  kwl.findKey( p, key );
+                     if ( value.size() )
+                     {
+                        m_max.push_back( ossimString(value).toFloat64() );
+                     }
+                     
+                  } // End: Band loop
+                  
+                  if ( m_bandRemap.size() && ( !m_min.size() || !m_max.size() ) )
+                  {
+                     initMinMax(); // Initialize from the m_reampSet tuples.
+                  }
+               }
+            }
+         }
+
+         if ( m_bandRemap.size() )
+         {
+            m_dirty = true;
+         }
+         
+      } // Matches: status = ossimTableRemapper::loadState(kwl, prefix); if (status){...
+      else
+      {
+         // Sets base: ossimSource::theEnableFlag
+         setEnableFlag(false);
+      }
+
+
+      // Tmp drb:
+      // initMinMax();
+      
+   } // Matches: if ( value == "ossimPiecewiseRemapper" )
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG:\n";
+      this->print( ossimNotify(ossimNotifyLevel_DEBUG) );
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\nExited..." << endl;
+   }
+   return status;
+   
+} // End: ossimPiecewiseRemapper::loadState
+
+bool ossimPiecewiseRemapper::saveState( ossimKeywordlist& kwl,
+                                        const char* prefix) const
+{
+   bool result = false;
+   
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+   
+   if ( ( m_remapType != ossimPiecewiseRemapper::UNKNOWN ) &&
+        ( m_bandRemap.size() == BANDS ) )
+   {
+      std::string p = ( prefix ? prefix : "" );
+
+      // Bands:
+      std::string value = ossimString::toString(BANDS).string();
+      kwl.addPair( p, std::string(ossimKeywordNames::NUMBER_BANDS_KW), value );
+      
+      // Remap type:
+      getRemapTypeString( m_remapType, value );
+      kwl.addPair( p, REMAP_TYPE_KW, value );
+
+      // Save the band remaps.
+      if ( m_bandRemap.size() == BANDS )
+      {
+         for ( ossim_uint32 band = 0; band < BANDS; ++band )
+         {
+            m_bandRemap[band].saveState( kwl, p, m_remapType, band );
+         }
+      }
+      
+      // Min/max values:
+      if ( ( m_min.size() == BANDS ) && ( m_max.size() == BANDS ) )
+      {
+         std::string minBase = ossimKeywordNames::MIN_VALUE_KW;
+         minBase += ".band";
+         std::string maxBase = ossimKeywordNames::MAX_VALUE_KW;
+         maxBase += ".band";
+         
+         for ( ossim_uint32 band = 0; band < BANDS; ++band )
+         {
+            // Min:
+            std::string key = minBase + ossimString::toString(band).string();
+            kwl.add( p.c_str(), key.c_str(), m_min[band] );
+
+            // Max:
+            key = maxBase + ossimString::toString(band).string();
+            kwl.add( p.c_str(), key.c_str(), m_max[band] );
+         }
+      }
+
+      // Base class:
+      result = ossimTableRemapper::saveState(kwl, prefix);
+   }
+   
+   return result;
+}
+
+ostream& ossimPiecewiseRemapper::print(ostream& os) const
+{
+   ossimKeywordlist kwl;
+   saveState( kwl, 0 );
+   
+   os << setiosflags(ios::fixed) << setprecision(15)
+      << "\nossimPiecewiseRemapper::print:\n"
+      << kwl
+      << "\n";
+   
+   return os;
+}
+
+ossimString ossimPiecewiseRemapper::getClassName() const
+{
+   return ossimString("ossimPiecewiseRemapper");
+}
+
+ossimString ossimPiecewiseRemapper::getLongName()const
+{
+   return ossimString("OSSIM Piecewise Remapper");
+}
+
+ossimString ossimPiecewiseRemapper::getShortName()const
+{
+   return ossimString("Piecewise Remapper");
+}
+
+double ossimPiecewiseRemapper::getMinPixelValue(ossim_uint32 band)const
+{
+   ossim_float64 result = ossimTableRemapper::getMinPixelValue(band);
+   if ( theEnableFlag && (band < m_min.size()) )
+   {
+      result = m_min[band];
+   }
+   return result;
+}
+
+ossim_float64 ossimPiecewiseRemapper::getMaxPixelValue(ossim_uint32 band) const
+{
+   ossim_float64 result = ossimTableRemapper::getMaxPixelValue(band);
+   if ( theEnableFlag && (band < m_max.size()) )
+   {
+      result = m_max[band];
+   }
+   return result;
+}
+
+void ossimPiecewiseRemapper::initMinMax()
+{
+#if 0
+   if ( m_remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
+   {
+      //---
+      // Each remap set holds a group of tuples for the band.
+      // Tuple format example: <min_in> <max_in> <min_out> <max_out>
+      //---
+      const ossim_uint32 BANDS = getNumberOfOutputBands();
+
+      if ( m_bandRemap.size() == BANDS )
+      {
+         m_min.resize( BANDS );
+         m_max.resize( BANDS );
+         
+         // First time through:
+         for( ossim_uint32 band = 0; band < BANDS; ++band )
+         {
+            const ossim_uint32 TUPLES = m_bandRemap[band].m_set.size() / 4;
+            for ( ossim_uint32 tuple = 0; tuple < TUPLES; ++tuple )
+            {
+               //---
+               // Min: get min of "min_out" from sets.
+               // Max: get max of "max_out" from sets.
+               //---
+               if ( tuple == 0 )
+               {
+                  m_min[band] = m_bandRemap[band].m_set[tuple*4+2];
+                  m_max[band] = m_bandRemap[band].m_set[tuple*4+3];
+               }
+               else
+               {
+                  if ( m_bandRemap[band].m_set[tuple*4+2] < m_min[band] )
+                  {
+                     m_min[band] = m_bandRemap[band].m_set[tuple*4+2];
+                  }
+                  if ( m_bandRemap[band].m_set[tuple*4+3] > m_max[band] )
+                  {
+                     m_max[band] = m_bandRemap[band].m_set[tuple*4+3];
+                  }
+               }  
+            }
+
+            //---
+            // Clamp min to scalar min as this is used for getMinPixelValue.
+            // This will keep a remap of:
+            // ((0, 127, 0, 127), (128, 255, 128, 382))
+            // From having a min and null of 0...
+            //---
+            if ( m_outputScalarType != OSSIM_SCALAR_UNKNOWN )
+            {
+               if ( m_min[band] < ossim::defaultMin( m_outputScalarType ) )
+               {
+                  m_min[band] = ossim::defaultMin( m_outputScalarType );
+               }
+            }
+            
+         } // End: band loop...
+      }
+   }
+   else
+   {
+      m_min.clear();
+      m_max.clear();
+   }
+#endif
+
+   // Disabled for now (drb)
+   m_min.clear();
+   m_max.clear();
+   
+   
+} // End: ossimPiecewiseRemapper::initMinMax()
+
+void ossimPiecewiseRemapper::buildTable()
+{
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+   if ( BANDS && (m_bandRemap.size() == BANDS) &&
+        ( m_remapType == ossimPiecewiseRemapper::LINEAR_NATIVE ) )
+   {
+      setupTable();
+
+      if ( theTable.size() )
+      {
+         if ( m_remapType == ossimPiecewiseRemapper::LINEAR_NATIVE )
+         {
+            buildLinearNativeTable();
+         }
+      }
+   }
+   else
+   {
+      // No remaps:
+      theTable.clear();
+   }
+
+   // Clear the dirty flag.
+   m_dirty = false;
+   
+} // End: ossimPiecewiseRemapper::buildTable()
+
+void ossimPiecewiseRemapper::buildLinearNativeTable()
+{
+   switch ( getOutputScalarType() )
+   {
+      case OSSIM_UINT8:
+      {
+         buildLinearNativeTable(ossim_uint8(0));
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         buildLinearNativeTable(ossim_uint16(0));
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         buildLinearNativeTable(ossim_sint16(0));
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         buildLinearNativeTable(ossim_uint32(0));
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         buildLinearNativeTable(ossim_sint32(0));
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+            // Shouldn't hit this.
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimHistogramRemapper::buildLinearNativeTable OSSIM_SCALAR_UNKNOWN!" << endl;
+         }
+         break;
+      }
+			
+   } // End of "switch (theTableType)"
+      
+} // End: void ossimPiecewiseRemapper::buildLinearNativeTable()
+
+template <class T> void ossimPiecewiseRemapper::buildLinearNativeTable(T /* dummy */)
+{
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+   
+   if ( BANDS && (m_bandRemap.size() == BANDS) && theTable.size() )
+   {
+      T* table = reinterpret_cast<T*>(&theTable.front());
+
+      ossim_uint32 index = 0;
+      
+      bool isInteger = std::numeric_limits<T>::is_integer; // Flag to round or not.
+      
+      // Band loop:
+      for(ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         // First bin is always for null.
+         table[index++] = (T)getNullPixelValue(band);
+         
+         const ossim_float64 MIN_PIX = getMinPixelValue(band);
+         const ossim_float64 MAX_PIX = getMaxPixelValue(band);
+
+         for( ossim_uint32 bin = 1; bin < theTableBinCount; ++bin )
+         {
+            ossim_float64 p = MIN_PIX + bin - 1;
+
+#if 0 /* Please keep for debug. (drb) */
+            cout << "\ninput pix[" << bin << "]: " << p << endl;
+#endif
+            
+            // Loop through remaps:
+            std::vector<ossimRemapSet>::const_iterator i = m_bandRemap[band].m_remap.begin();
+            while ( i != m_bandRemap[band].m_remap.end() )
+            {
+               //---
+               // Each remap set holds a group of tuples for the band.
+               // Tuple format example: <min_in> <max_in> <min_out> <max_out>
+               //---
+               const ossim_uint32 TUPLES = (*i).m_set.size() / 4;
+               for ( ossim_uint32 set = 0; set < TUPLES; ++set )
+               {
+                  // Range check it:
+                  if ( ( p >= (*i).m_set[set*4] ) &&  // input min
+                       ( p <= (*i).m_set[set*4+1] ) ) // input max
+                  {
+                     //---
+                     // p = (p - output_min) * (output_max-output_min)/(input_max-input_min)
+                     // + output_min;
+                     //---
+                     p = (p - (*i).m_set[set*4]) *
+                        ((*i).m_set[set*4+3]-(*i).m_set[set*4+2]) /
+                        ((*i).m_set[set*4+1]-(*i).m_set[set*4]) +
+                        (*i).m_set[set*4];
+
+#if 0 /* Please keep for debug. (drb) */
+                     cout << "remapp_pix[" << bin << "][" << set << "]: " << p << endl;
+#endif
+                  }
+                  
+               } // End: TUPLE loop
+
+               ++i; // Next remap.
+
+            } // End: remap loop:
+
+            if ( isInteger )
+            {
+               p = ossim::round<ossim_float64>(p); // Round to integer correctly.
+            }
+            
+#if 0 /* Please keep for debug. (drb) */
+            cout << "output_pix[" << bin << "]: " << p << endl;
+#endif
+            
+            // Assign to table with min/max clip:
+            table[bin] = (T)( ( p >= MIN_PIX ) ? ( ( p <= MAX_PIX ) ? p : MAX_PIX ) : MIN_PIX);
+            
+         } // End: bin loop
+         
+      } // End: band loop
+      
+   } // Matches: if ( theTable.size() )
+
+#if 0 /* Please leave for debug. (drb) */
+   ossimTableRemapper::print( cout );
+#endif
+   
+} // End: template <class T> void ossimPiecewiseRemapper::buildLinearNativeTable(T dummy)
+
+void ossimPiecewiseRemapper::setupTable()
+{
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+   if ( BANDS )
+   {
+      ossim_uint32 values_per_band = 0;
+      ossim_uint32 bytes_per_pixel = 0;
+      
+      switch (theOutputScalarType)
+      {
+         case OSSIM_UINT8:
+            values_per_band = 256;  // 2 ^ 8
+            bytes_per_pixel = 1;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+            
+         case OSSIM_USHORT11:
+            values_per_band = 2048; // 2 ^ 11
+            bytes_per_pixel = 2;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+         case OSSIM_USHORT12:
+            values_per_band = 4096; // 2 ^ 12
+            bytes_per_pixel = 2;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+         case OSSIM_USHORT13:
+            values_per_band = 8192; // 2 ^ 13
+            bytes_per_pixel = 2;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+         case OSSIM_USHORT14:
+            values_per_band = 16384; // 2 ^ 14
+            bytes_per_pixel = 2;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+         case OSSIM_USHORT15:
+            values_per_band = 32768; // 2 ^ 15
+            bytes_per_pixel = 2;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+            
+         case OSSIM_UINT16:
+         case OSSIM_SINT16:
+            values_per_band = 65536; // 2 ^ 16
+            bytes_per_pixel = 2;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+            
+         case OSSIM_UINT32:
+         case OSSIM_SINT32:
+            values_per_band = 65536; // 2 ^ 16
+            bytes_per_pixel = 4;
+            theTableType = ossimTableRemapper::NATIVE;
+            break;
+            
+         case OSSIM_NORMALIZED_FLOAT:
+         case OSSIM_FLOAT:
+            bytes_per_pixel = 4;
+            break;
+            
+         case OSSIM_NORMALIZED_DOUBLE:         
+         case OSSIM_DOUBLE:
+            bytes_per_pixel = 8;
+            theTableType = ossimTableRemapper::NORMALIZED;
+            break;
+            
+         default:
+            break;
+      }
+   
+      theTableBinCount  = values_per_band;
+      theTableBandCount = BANDS;
+
+      ossim_uint32 size_in_bytes = values_per_band * BANDS * bytes_per_pixel;
+      theTable.resize(size_in_bytes);
+   }
+   
+} // End: ossimPiecwiseRemapper::getTableSize()
+
+// Private to disallow use...
+ossimPiecewiseRemapper::ossimPiecewiseRemapper(const ossimPiecewiseRemapper&)
+:  m_dirty(true),
+   m_remapType(UNKNOWN)
+{
+}
+
+// Private to disallow use...
+ossimPiecewiseRemapper& ossimPiecewiseRemapper::operator=(const ossimPiecewiseRemapper&)
+{
+   return *this;
+}
+
+
diff --git a/src/imaging/ossimPixelFlipper.cpp b/src/imaging/ossimPixelFlipper.cpp
new file mode 100644
index 0000000..f651d79
--- /dev/null
+++ b/src/imaging/ossimPixelFlipper.cpp
@@ -0,0 +1,1183 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Filter to toggle pixel values.
+//
+//*************************************************************************
+// $Id: ossimPixelFlipper.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+
+#include <ossim/imaging/ossimPixelFlipper.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <OpenThreads/ScopedLock>
+#include <cstdlib>
+
+RTTI_DEF1(ossimPixelFlipper, "ossimPixelFlipper", ossimImageSourceFilter)
+
+static ossimTrace traceDebug("ossimPixelFlipper:debug");
+
+const char ossimPixelFlipper::PF_TARGET_VALUE_KW[]      = "target_value";
+const char ossimPixelFlipper::PF_TARGET_RANGE_KW[]      = "target_range";
+const char ossimPixelFlipper::PF_REPLACEMENT_VALUE_KW[] = "replacement_value";
+const char ossimPixelFlipper::PF_REPLACEMENT_MODE_KW[]  = "replacement_mode";
+const char ossimPixelFlipper::PF_CLAMP_VALUE_KW[]       = "clamp_value"; // deprecated by clamp_value_hi
+const char ossimPixelFlipper::PF_CLAMP_VALUE_LO_KW[]    = "clamp_value_lo";
+const char ossimPixelFlipper::PF_CLAMP_VALUE_HI_KW[]    = "clamp_value_hi";
+const char ossimPixelFlipper::PF_CLIP_MODE_KW[]         = "border_clip_mode";
+
+static const char TARGET_LOWER_LIMIT_PROP_NAME[] = "target_range_lower_limit";
+static const char TARGET_UPPER_LIMIT_PROP_NAME[] = "target_range_upper_limit";
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimPixelFlipper.cpp 21631 2012-09-06 18:10:55Z dburken $";
+#endif
+
+ossimPixelFlipper::ossimPixelFlipper(ossimObject* owner)
+   :
+      ossimImageSourceFilter(owner),
+      theTargetValueLo(0.0),
+      theTargetValueHi(0.0),
+      theReplacementValue(1.0),
+      theReplacementMode(ossimPixelFlipper::REPLACE_BAND_IF_TARGET),
+      theClampValueLo(ossim::nan()),
+      theClampValueHi(ossim::nan()),
+      theClampingMode(DISABLED),
+      theClipMode(NONE)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPixelFlipper::ossimPixelFlipper entered...\n";
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << "\n";
+#endif      
+   }
+   
+   setDescription(ossimString("Pixel Flipper"));
+   enableSource();
+}
+
+ossimPixelFlipper::~ossimPixelFlipper()
+{}
+
+ossimRefPtr<ossimImageData> ossimPixelFlipper::getTile(
+   const ossimIrect& tile_rect, ossim_uint32 resLevel)
+{
+
+   if(!theInputConnection)
+   {
+      return 0;
+   }
+
+   // Fetch tile from pointer from the input source.
+   ossimRefPtr<ossimImageData> inputTile =
+      theInputConnection->getTile(tile_rect, resLevel);
+   
+   if (!inputTile.valid() || !isSourceEnabled()) return inputTile;
+   
+   if (!inputTile->getBuf()) return inputTile;
+   
+   // Lock for the length of this method.
+	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+   
+   // Call the appropriate load method.
+   switch (inputTile->getScalarType())
+   {
+      
+      case OSSIM_UCHAR:
+      {
+         flipPixels(ossim_uint8(0), inputTile.get(), resLevel);
+         break;
+      }
+      
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         flipPixels(ossim_uint16(0), inputTile.get(), resLevel);
+         break;
+      }
+      
+      case OSSIM_SSHORT16:
+      {
+         flipPixels(ossim_sint16(0), inputTile.get(), resLevel);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         flipPixels(ossim_uint32(0), inputTile.get(), resLevel);
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         flipPixels(ossim_sint32(0), inputTile.get(), resLevel);
+         break;
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         flipPixels(float(0), inputTile.get(), resLevel);
+         break;
+      }
+      
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_FLOAT64:
+      {
+         flipPixels(ossim_float64(0), inputTile.get(), resLevel);
+         break;
+      }
+      
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimPixelFlipper::getTile Unsupported scalar type!" << endl;
+         break;
+      }
+   }
+   
+   inputTile->validate();
+   return inputTile;
+}
+
+template <class T>
+void ossimPixelFlipper::flipPixels(T /* dummy */,
+                                   ossimImageData* inputTile,
+                                   ossim_uint32 resLevel)
+{
+   if (!inputTile) return;
+
+   T targetLo    = static_cast<T>(theTargetValueLo);
+   T targetHi    = static_cast<T>(theTargetValueHi);
+   T replacement = static_cast<T>(theReplacementValue);
+   T clampLo       = static_cast<T>(theClampValueLo);
+   T clampHi       = static_cast<T>(theClampValueHi);
+
+   // Get pointers to data for each band.
+   ossim_uint32 bands = inputTile->getNumberOfBands();
+   ossim_uint32 band;
+   T** buf = new T*[bands];
+   for(band=0; band<bands; ++band)
+      buf[band] = static_cast<T*>(inputTile->getBuf(band));
+
+   ossimIrect rect = inputTile->getImageRectangle();
+   ossimIpt ul = rect.ul();
+   ossimIpt lr = rect.lr();
+
+   // Check the relation between tile rect and the area of interest (either bounding rect or
+   // valid vertices polygons). If completely outside, we can return with empty buffer.get If
+   // partially inside, we'll need to test individual pixels.
+   bool is_outside_aoi = false;
+   bool needsTesting = false;
+   if ((theClipMode == BOUNDING_RECT) && (resLevel < theBoundingRects.size()))
+   {
+      if(!rect.intersects(theBoundingRects[resLevel]))
+         is_outside_aoi = true;
+      else
+         needsTesting = !rect.completely_within(theBoundingRects[resLevel]);
+   }
+   else if ((theClipMode == VALID_VERTICES) && (resLevel < theValidVertices.size()))
+   {
+      bool ulFlag = theValidVertices[resLevel].isPointWithin(rect.ul());
+      bool urFlag = theValidVertices[resLevel].isPointWithin(rect.ur());
+      bool lrFlag = theValidVertices[resLevel].isPointWithin(rect.lr());
+      bool llFlag = theValidVertices[resLevel].isPointWithin(rect.ll());
+      if((!ulFlag) && (!urFlag) && (!lrFlag) && (!llFlag))
+         is_outside_aoi = true;
+      else
+         needsTesting = !(ulFlag && urFlag && lrFlag && llFlag);
+   }
+   if (is_outside_aoi)
+   {
+      // none of the tile is inside so just return with empty tile:
+      delete [] buf;
+      return; 
+   }
+
+   ossim_uint32 i = 0;  // index into band buffers;
+   ossimIpt pixel_loc; 
+   bool can_replace, found_candidate;
+
+   // Begin loop over each pixel in the tile. The individual bands are handled inside this loop:
+   for(pixel_loc.y = ul.y; pixel_loc.y <= lr.y; ++pixel_loc.y)
+   {
+      for(pixel_loc.x = ul.x; pixel_loc.x <= lr.x; ++pixel_loc.x)
+      {
+         // First consider if we need to test the pixel for border clipping:
+         if (needsTesting)
+         {
+            bool is_inside = true; // Assume it will pass the border test
+            if (theClipMode == BOUNDING_RECT)
+               is_inside = theBoundingRects[resLevel].pointWithin(pixel_loc);
+            else if (theClipMode == VALID_VERTICES)
+               is_inside = theValidVertices[resLevel].isPointWithin(pixel_loc);
+
+            if (!is_inside)
+            {
+               // Remap this pixel to the replacement value (all bands)
+               for (band=0; band<bands; ++band)
+                  buf[band][i] = replacement;
+
+               // Proceed to next pixel location:
+               ++i;
+               continue; 
+            }
+         }
+
+         // If clamping specified, the target replacement function is disabled:
+         if (theClampingMode)
+         {
+            switch (theReplacementMode)
+            {
+            case REPLACE_BAND_IF_TARGET:
+            case REPLACE_ALL_BANDS_IF_ANY_TARGET:
+               for (band=0; band<bands; ++band)
+               {
+                  if (!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo))
+                     buf[band][i] = clampLo;
+                  else if (!ossim::isnan(theClampValueHi) && (buf[band][i] > clampHi))
+                     buf[band][i] = clampHi;
+               }
+               break;
+
+            case REPLACE_BAND_IF_PARTIAL_TARGET: 
+            case REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
+               // First band loop to establish if pixel qualifies for replacement (at least one 
+               // band must be valid):
+               can_replace = false;
+               found_candidate = false;
+               for (band=0; (band < bands) && !(can_replace && found_candidate); ++band)
+               {
+                  if ((!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo)) ||
+                     (!ossim::isnan(theClampValueHi) && (buf[band][i] > clampHi)))
+                     found_candidate = true;
+                  else
+                     can_replace = true;
+               }
+               if (can_replace && found_candidate)
+               {
+                  // This pixel has at least one band with normal value, so need to rescan bands
+                  // to find pixels that need replacing (are within the target range):
+                  for (band=0; band<bands; ++band)
+                  {
+                     if (!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo))
+                        buf[band][i] = clampLo;
+                     else if (!ossim::isnan(theClampValueHi) && buf[band][i] > clampHi)
+                        buf[band][i] = clampHi;
+                  }
+               }
+               break;
+
+            case REPLACE_ONLY_FULL_TARGETS:
+               // First band loop to establish if pixel qualifies for replacement (all 
+               // bands must be in target range):
+               can_replace = true;
+               for (band=0; (band < bands) && can_replace; ++band)
+               {
+                  if ((ossim::isnan(theClampValueLo) || (buf[band][i] >= clampLo)) &&
+                      (ossim::isnan(theClampValueHi) || (buf[band][i] <= clampHi)))
+                     can_replace = false;
+               }
+               if (can_replace)
+               {
+                  // Map all pixels to replacement value: 
+                  for (band=0; band<bands; ++band)
+                  {
+                     if (!ossim::isnan(theClampValueLo) && (buf[band][i] < clampLo))
+                        buf[band][i] = clampLo;
+                     else if (!ossim::isnan(theClampValueHi) && buf[band][i] > clampHi)
+                        buf[band][i] = clampHi;
+                  }
+               }
+               break;
+            } // close switch
+
+            // Proceed to next pixel location:
+            ++i;
+            continue; 
+         }
+
+         // If we got here (the continue statement was not reached) then
+         // the pixel value now needs to be checked for possible target replacement:
+         switch (theReplacementMode)
+         {
+         case REPLACE_BAND_IF_TARGET:
+            for (band=0; band<bands; ++band)
+            {
+               if ((buf[band][i] >= targetLo) && (buf[band][i] <=targetHi)) 
+                  buf[band][i] = theReplacementValue;
+            }
+            break;
+
+         case REPLACE_BAND_IF_PARTIAL_TARGET: 
+
+            // First band loop to establish if pixel qualifies for replacement (at least one 
+            // band must be valid):
+            can_replace = false;
+            found_candidate = false;
+            for (band=0; (band < bands) && !(can_replace && found_candidate); ++band)
+            {
+               //  check for target range replacement qualification:
+               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
+                  can_replace = true; // Has valid band
+               else
+                  found_candidate = true; // found band within target range
+            }
+            if (can_replace && found_candidate)
+            {
+               // This pixel has at least one band with normal value, so need to rescan bands
+               // to find pixels that need replacing (are within the target range):
+               for (band=0; band<bands; ++band)
+               {
+                  if ((buf[band][i] >= targetLo) && (buf[band][i] <= targetHi)) 
+                     buf[band][i] = theReplacementValue;
+               }
+            }
+            break;
+
+         case REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
+
+            // First band loop to establish if pixel qualifies for replacement (at least one 
+            // band must be valid):
+            can_replace = false;
+            found_candidate = false;
+            for (band=0; (band < bands) && !(can_replace && found_candidate); ++band)
+            {
+               // check for target range replacement qualification:
+               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
+                  can_replace = true;
+               else
+                  found_candidate = true;
+            }
+            if (can_replace && found_candidate)
+            {
+               // This pixel has at least one band with normal value and one with target, so 
+               // map all bands to target:
+               for (band=0; band<bands; ++band)
+                  buf[band][i] = theReplacementValue;
+            }
+            break;
+
+         case REPLACE_ONLY_FULL_TARGETS:
+
+            // First band loop to establish if pixel qualifies for replacement (all 
+            // bands must be in target range):
+            can_replace = true;
+            for (band=0; (band < bands) && can_replace; ++band)
+            {
+               // check for target range replacement qualification:
+               if ((buf[band][i] < targetLo) || (buf[band][i] > targetHi))
+                  can_replace = false;
+            }
+            if (can_replace)
+            {
+               // Map all pixels to replacement value: 
+               for (band=0; band<bands; ++band)
+                  buf[band][i] = theReplacementValue;
+            }
+            break;
+
+         case REPLACE_ALL_BANDS_IF_ANY_TARGET:
+
+            // First band loop to establish if pixel qualifies for replacement (all 
+            // bands must be in target range):
+            can_replace = false;
+            for (band=0; (band < bands) && !can_replace; ++band)
+            {
+               // check for target range replacement qualification:
+               if ((buf[band][i] >= targetLo) && (buf[band][i] <= targetHi))
+                  can_replace = true;
+            }
+            if (can_replace)
+            {
+               // Map all pixels to replacement value: 
+               for (band=0; band<bands; ++band)
+                  buf[band][i] = theReplacementValue;
+            }
+            break;
+         } // close switch
+
+         // Reached end of processing for one pixel location. Increment the band buffers index:
+         ++i;
+      } // end of loop over pixel_loc.x
+   } // end of loop over pixel_loc.y
+   
+   delete [] buf;
+   inputTile->validate();
+}
+
+template <class T> void ossimPixelFlipper::clipTile(T /* dummy */,
+                                                    ossimImageData* inputTile,
+                                                    ossim_uint32 resLevel)
+{
+   if(theClipMode == NONE)
+   {
+      theClipTileBuffer = 0;
+      return;
+   }
+   if(!inputTile) return;
+   if(!inputTile->getBuf()||
+      (inputTile->getDataObjectStatus() == OSSIM_EMPTY))
+   {
+      return;
+   }
+   allocateClipTileBuffer(inputTile);
+
+
+   if(theClipTileBuffer.valid())
+   {
+      ossimIrect tileRect = inputTile->getImageRectangle();
+      // force to all nulls
+      theClipTileBuffer->setDataObjectStatus(OSSIM_FULL);
+      theClipTileBuffer->makeBlank();
+      
+      switch(theClipMode)
+      {
+         case NONE:
+         {
+            break;
+         }
+         case BOUNDING_RECT:
+         {
+            if(resLevel < theBoundingRects.size())
+            {
+               if(tileRect.completely_within(theBoundingRects[resLevel])||
+                  theBoundingRects[resLevel].hasNans())
+               {
+                  return;
+               }
+               else
+               {
+                  if(tileRect.intersects(theBoundingRects[resLevel]))
+                  {
+                     ossimIrect clipRect = tileRect.clipToRect(theBoundingRects[resLevel]);
+
+                     theClipTileBuffer->setImageRectangle(clipRect);
+                     
+                     theClipTileBuffer->loadTile(inputTile);
+                     inputTile->makeBlank();
+                     inputTile->loadTile(theClipTileBuffer.get());
+                     inputTile->validate();
+                  }
+                  else
+                  {
+                     inputTile->makeBlank();
+                  }
+               }
+            }
+            break;
+         }
+         case VALID_VERTICES:
+         {
+            if(resLevel < theValidVertices.size())
+            {
+               const ossimPolygon& p = theValidVertices[resLevel];
+               bool ulWithin = p.isPointWithin(tileRect.ul());
+               bool urWithin = p.isPointWithin(tileRect.ur());
+               bool lrWithin = p.isPointWithin(tileRect.lr());
+               bool llWithin = p.isPointWithin(tileRect.ll());
+               
+               if(ulWithin&&
+                  urWithin&&
+                  lrWithin&&
+                  llWithin)
+               {
+                  return;
+               }
+               else if(!(ulWithin|| // if none are in
+                         urWithin||
+                         lrWithin||
+                         llWithin))
+               {
+                  inputTile->makeBlank();
+                  return;
+               }
+               else
+               {
+                  ossimIpt ul = tileRect.ul();
+                  ossimIpt origin;
+                  ossim_uint32 x = 0;
+                  ossim_uint32 y = 0;
+                  ossim_uint32 w = inputTile->getWidth();
+                  ossim_uint32 h = inputTile->getHeight();
+                  ossim_uint32 offset = 0;
+                  origin.y = ul.y;
+                  for(y = 0; y < h; ++y)
+                  {
+                     origin.x = ul.x;
+                     for(x = 0; x < w; ++x)
+                     {
+                        if(!p.isPointWithin(origin))
+                        {
+                           inputTile->setNull(offset);
+                        }
+                        ++offset;
+                        ++origin.x;
+                     }
+                     ++origin.y;
+                  }
+               }
+            }
+            break;
+         }
+      }
+   }
+}
+
+
+void ossimPixelFlipper::allocateClipTileBuffer(ossimRefPtr<ossimImageData> inputImage)
+{
+   if(inputImage.valid())
+   {
+      bool needDupFlag = false;
+      if(theClipTileBuffer.valid())
+      {
+         if((theClipTileBuffer->getScalarType() != inputImage->getScalarType())||
+            theClipTileBuffer->getNumberOfBands() != theClipTileBuffer->getNumberOfBands())
+         {
+            needDupFlag = true;
+         }
+         else
+         {
+            theClipTileBuffer->setImageRectangle(inputImage->getImageRectangle());
+         }
+      }
+      else
+      {
+         needDupFlag = true;
+      }
+      if(needDupFlag)
+      {
+         theClipTileBuffer = (ossimImageData*)inputImage->dup();
+      }
+   }
+}
+
+void ossimPixelFlipper::initialize()
+{
+	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+   ossimImageSourceFilter::initialize();
+   theValidVertices.clear();
+   theBoundingRects.clear();
+
+   ossim_uint32 rlevels = getNumberOfDecimationLevels();
+   ossim_uint32 idx = 0;
+
+   if(rlevels)
+   {
+      if(theValidVertices.size() != rlevels)
+      {
+         theValidVertices.resize(rlevels);
+      }
+      if(theBoundingRects.size() != rlevels)
+      {
+         theBoundingRects.resize(rlevels);
+      }
+      for(idx = 0; idx < rlevels; ++idx)
+      {
+         std::vector<ossimIpt> validVertices;
+         getValidImageVertices(validVertices,
+                               OSSIM_CLOCKWISE_ORDER,
+                               idx);
+         theValidVertices[idx] = ossimPolygon(validVertices);
+         theBoundingRects[idx] = getBoundingRect(idx);
+      }
+   }
+}
+
+ossimScalarType ossimPixelFlipper::getOutputScalarType() const
+{
+   if(theInputConnection)
+   {
+      ossimScalarType scalar = theInputConnection->getOutputScalarType();
+      {
+         if (scalar == OSSIM_USHORT16 && theClampValueHi == 2047.0)
+         {
+            //---
+            // Special case:
+            // We have an unsigned 16 bit type but we want to call it
+            // USHORT11 ( (2^11- 1) = 2047 ).
+            //---
+            return OSSIM_USHORT11;
+         }
+         else if (scalar == OSSIM_USHORT16 && theClampValueHi == 4095.0)
+         {
+            //---
+            // Special case:
+            // We have an unsigned 16 bit type but we want to call it
+            // USHORT12 ( (2^12- 1) = 4095 ).
+            //---
+            return OSSIM_USHORT12;
+         }
+         else if (scalar == OSSIM_USHORT16 && theClampValueHi == 8191.0)
+         {
+            //---
+            // Special case:
+            // We have an unsigned 16 bit type but we want to call it
+            // USHORT13 ( (2^13- 1) = 8191 ).
+            //---
+            return OSSIM_USHORT13;
+         }
+         else if (scalar == OSSIM_USHORT16 && theClampValueHi == 16383.0)
+         {
+            //---
+            // Special case:
+            // We have an unsigned 16 bit type but we want to call it
+            // USHORT14 ( (2^14- 1) = 16383 ).
+            //---
+            return OSSIM_USHORT14;
+         }
+         else if (scalar == OSSIM_USHORT16 && theClampValueHi == 32767.0)
+         {
+            //---
+            // Special case:
+            // We have an unsigned 16 bit type but we want to call it
+            // USHORT15 ( (2^15- 1) = 32767 ).
+            //---
+            return OSSIM_USHORT15;
+         }
+         return scalar;
+      }
+   }
+   return OSSIM_SCALAR_UNKNOWN;
+}
+
+ossim_float64 ossimPixelFlipper::getMaxPixelValue (ossim_uint32 band) const
+{
+   const ossim_float64 MIN = ossimImageSourceFilter::getMinPixelValue(band);
+   const ossim_float64 MAX = ossimImageSourceFilter::getMaxPixelValue(band);
+
+   if ((theClampValueHi > MIN) && (theClampValueHi < MAX))
+      return theClampValueHi;
+
+   return MAX;
+}
+
+ossim_float64 ossimPixelFlipper::getMinPixelValue (ossim_uint32 band) const
+{
+   const ossim_float64 MIN = ossimImageSourceFilter::getMinPixelValue(band);
+   const ossim_float64 MAX = ossimImageSourceFilter::getMaxPixelValue(band);
+
+   if ((theClampValueLo > MIN) && (theClampValueLo < MAX))
+      return theClampValueLo;
+
+   return MIN;
+}
+
+bool ossimPixelFlipper::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix)
+{
+   const char* lookupReturn;
+   
+   lookupReturn = kwl.find(prefix, PF_TARGET_VALUE_KW);
+   if(lookupReturn)
+   {
+      setTargetValue(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(prefix, PF_TARGET_RANGE_KW);
+   if(lookupReturn)
+   {
+      ossimString min_max_string (lookupReturn);
+      ossimString separator (" ");
+      ossim_float64 min_target = min_max_string.before(separator).toFloat64();
+      ossim_float64 max_target = min_max_string.after(separator).toFloat64();
+      setTargetRange(min_target, max_target);
+   }
+
+   lookupReturn = kwl.find(prefix, PF_REPLACEMENT_VALUE_KW);
+   if(lookupReturn)
+   {
+      setReplacementValue(atof(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(prefix, PF_REPLACEMENT_MODE_KW);
+   if(lookupReturn)
+   {
+      ossimString modeString = lookupReturn;
+      setReplacementMode(modeString);
+   }
+
+   lookupReturn = kwl.find(prefix, PF_CLAMP_VALUE_KW);
+   if(lookupReturn)
+   {
+      setClampValue(atof(lookupReturn), true);
+   }
+
+   lookupReturn = kwl.find(prefix, PF_CLAMP_VALUE_LO_KW);
+   if(lookupReturn)
+   {
+      setClampValue(atof(lookupReturn), false);
+   }
+
+   lookupReturn = kwl.find(prefix, PF_CLAMP_VALUE_HI_KW);
+   if(lookupReturn)
+   {
+      setClampValue(atof(lookupReturn), true);
+   }
+
+   lookupReturn = kwl.find(prefix, PF_CLIP_MODE_KW);
+   if(lookupReturn)
+   {
+      ossimString modeString = lookupReturn;
+      setClipMode(modeString);
+   }
+
+   bool status = ossimImageSourceFilter::loadState(kwl, prefix);
+
+   if (traceDebug())
+   {
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+
+   return status;
+}
+
+bool ossimPixelFlipper::saveState(ossimKeywordlist& kwl,
+                                 const char* prefix) const
+{
+   // Call the base class saveState.
+   ossimImageSourceFilter::saveState(kwl, prefix);
+
+   if (theTargetValueHi != theTargetValueLo)
+   {
+      ossimString s (ossimString::toString(theTargetValueLo) + " " + 
+         ossimString::toString(theTargetValueHi));
+      kwl.add(prefix, PF_TARGET_RANGE_KW, s);
+   }
+   else
+   {
+      kwl.add(prefix, PF_TARGET_VALUE_KW, theTargetValueLo);
+   }
+   kwl.add(prefix, PF_REPLACEMENT_VALUE_KW, theReplacementValue);
+   kwl.add(prefix, PF_REPLACEMENT_MODE_KW,  getReplacementModeString().c_str());
+
+   if (theClampingMode)
+   {
+      kwl.add(prefix, PF_CLAMP_VALUE_LO_KW,    theClampValueLo);
+      kwl.add(prefix, PF_CLAMP_VALUE_HI_KW,    theClampValueHi);
+   }
+   kwl.add(prefix, PF_CLIP_MODE_KW,  getClipModeString().c_str());
+
+   return true;
+}
+
+void ossimPixelFlipper::setTargetValue(ossim_float64 target_value)
+{
+   //---
+   // Since this is the value to replace we will allow for any value as it
+   // won't affect the output null, min and max ranges.  This will fix a
+   // tiled nitf with max of 2047(11bit) with edge tile fill values of 2048.
+   //---
+   OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+
+   theTargetValueLo = target_value;
+   theTargetValueHi = target_value; 
+}
+
+void ossimPixelFlipper::setTargetRange(ossim_float64 target_min, ossim_float64 target_max)
+{
+   //---
+   // Since this is the value to replace we will allow for any value as it
+   // won't affect the output null, min and max ranges.  This will fix a
+   // tiled nitf with max of 2047(11bit) with edge tile fill values of 2048.
+   //---
+   OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+
+   theTargetValueLo = target_min;
+   theTargetValueHi = target_max; 
+}
+
+void ossimPixelFlipper::setReplacementValue(ossim_float64 replacement_value)
+{
+	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+
+   // Range check to ensure within null, min and max of output radiometry.
+   if (inRange(replacement_value))
+   {
+      theReplacementValue = replacement_value;
+   }
+}
+
+void ossimPixelFlipper::setClampValue(ossim_float64 clamp_value, bool clamp_max_value)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+
+   if (inRange(clamp_value))
+   {
+      // Stupid MS compiler complains if we do an |= on enum type. (OLK 1/11)
+      int temp_int = (int) theClampingMode;
+      if (clamp_max_value)
+      {
+         theClampValueHi = clamp_value;
+         temp_int |= (int) CLAMPING_HI;
+      }
+      else
+      {
+         theClampValueLo = clamp_value;
+         temp_int |= (int) CLAMPING_LO;
+      }
+      theClampingMode = (ClampingMode) temp_int;
+   }
+}
+
+void ossimPixelFlipper::setClampValues(ossim_float64 clamp_value_lo, ossim_float64 clamp_value_hi)
+{
+   theClampingMode = DISABLED; // reset and let next calls set accordingly
+   setClampValue(clamp_value_lo, false);
+   setClampValue(clamp_value_hi, true);
+}
+
+void ossimPixelFlipper::setReplacementMode(ossimPixelFlipper::ReplacementMode mode)
+{
+	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+   theReplacementMode = mode;
+}
+
+bool ossimPixelFlipper::setReplacementMode(const ossimString& modeString)
+{
+	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+
+   ossimString mode = modeString;
+   mode.upcase();
+   if (mode == "REPLACE_BAND_IF_TARGET")
+   {
+      theReplacementMode = REPLACE_BAND_IF_TARGET;
+   }
+   else if (mode == "REPLACE_BAND_IF_PARTIAL_TARGET")
+   {
+      theReplacementMode = REPLACE_BAND_IF_PARTIAL_TARGET;
+   }
+   else if (mode == "REPLACE_ALL_BANDS_IF_PARTIAL_TARGET")
+   {
+      theReplacementMode = REPLACE_ALL_BANDS_IF_PARTIAL_TARGET;
+   }
+   else if (mode == "REPLACE_ONLY_FULL_TARGETS")
+   {
+      theReplacementMode = REPLACE_ONLY_FULL_TARGETS;
+   }
+   else if (mode == "REPLACE_ALL_BANDS_IF_ANY_TARGET")
+   {
+      theReplacementMode = REPLACE_ALL_BANDS_IF_ANY_TARGET;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimPixelFlipper::setReplacementMode warning:\n"
+         << "Invalid mode:  " << modeString
+         << endl;
+      return false;
+   }
+   return true;
+}
+
+void ossimPixelFlipper::setClipMode(ossimPixelFlipper::ClipMode mode)
+{
+	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+   theClipMode = mode;
+}
+
+void ossimPixelFlipper::setClipMode(const ossimString& modeString)
+{
+   ossimString mode = modeString;
+   mode.downcase();
+   if (mode == "none")
+   {
+      setClipMode(NONE);
+   }
+   else if (mode == "bounding_rect")
+   {
+      setClipMode(BOUNDING_RECT);
+   }
+   else if (mode == "valid_vertices")
+   {
+      setClipMode(VALID_VERTICES);
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimPixelFlipper::setClipMode warning:\n"
+         << "Invalid mode:  " << modeString
+         << endl;
+   }
+}
+
+//ossim_float64 ossimPixelFlipper::getTargetValue() const
+//{
+//   return theTargetValueLo;
+//}
+
+ossim_float64 ossimPixelFlipper::getReplacementValue() const
+{
+   return theReplacementValue;
+}
+
+ossimPixelFlipper::ReplacementMode ossimPixelFlipper::getReplacementMode()  const
+{
+   return theReplacementMode;
+}
+   
+ossimString ossimPixelFlipper::getReplacementModeString()  const
+{
+   switch(theReplacementMode)
+   {
+      case REPLACE_BAND_IF_TARGET:
+         return ossimString("REPLACE_BAND_IF_TARGET");
+      case REPLACE_BAND_IF_PARTIAL_TARGET:
+         return ossimString("REPLACE_BAND_IF_PARTIAL_TARGET");
+      case REPLACE_ALL_BANDS_IF_PARTIAL_TARGET:
+         return ossimString("REPLACE_ALL_BANDS_IF_PARTIAL_TARGET");
+      case REPLACE_ONLY_FULL_TARGETS:
+         return ossimString("REPLACE_ONLY_FULL_TARGETS");
+      case REPLACE_ALL_BANDS_IF_ANY_TARGET:
+         return ossimString("REPLACE_ALL_BANDS_IF_ANY_TARGET");
+      default:
+         break;
+   }
+
+   return ossimString("UNKNOWN_MODE");
+}
+
+ossimString ossimPixelFlipper::getClipModeString()  const
+{
+   if (theClipMode == BOUNDING_RECT)
+      return ossimString("bounding_rect");
+
+   if (theClipMode == VALID_VERTICES)
+      return ossimString("valid_vertices");
+
+   return ossimString("none");
+}
+
+ossimPixelFlipper::ClipMode ossimPixelFlipper::getClipMode() const
+{
+   return theClipMode;
+}
+
+std::ostream& ossimPixelFlipper::print(std::ostream& out) const
+{
+   out << "ossimPixelFlipper::print:"
+       << "\ntarget value Lo:    " << theTargetValueLo
+       << "\ntarget value Hi:    " << theTargetValueHi
+       << "\nreplacement value:  " << theReplacementValue
+       << "\nclamp value Lo:     " << theClampValueLo
+       << "\nclamp value Hi:     " << theClampValueHi
+       << "\nreplacement mode:   " << getReplacementModeString().c_str()
+       << "\nclip_mode:          " << getClipModeString().c_str()
+      << endl;
+   return out;
+}
+
+ossimRefPtr<ossimProperty> ossimPixelFlipper::getProperty(
+   const ossimString& name)const
+{
+   // Lock for the length of this method.
+	OpenThreads::ScopedLock<OpenThreads::Mutex> scopeLock(theMutex);
+
+   if (name == PF_TARGET_VALUE_KW)
+   {
+      ossimProperty* p =
+         new ossimNumericProperty(name,
+         ossimString::toString(theTargetValueLo));
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   if (name == PF_TARGET_RANGE_KW)
+   {
+      ossimProperty* p =
+         new ossimNumericProperty(name,
+         ossimString::toString(theTargetValueLo));
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   if (name == TARGET_UPPER_LIMIT_PROP_NAME)
+   {
+      ossimProperty* p =
+         new ossimNumericProperty(name,
+         ossimString::toString(theTargetValueHi));
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   else if (name == PF_REPLACEMENT_VALUE_KW)
+   {
+      ossimProperty* p =
+         new ossimNumericProperty(name,
+                                  ossimString::toString(theReplacementValue));
+       p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   else if (name == PF_CLAMP_VALUE_LO_KW)
+   {
+      ossimProperty* p =
+         new ossimNumericProperty(name, ossimString::toString(theClampValueLo));
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   else if (name == PF_CLAMP_VALUE_HI_KW)
+   {
+      ossimProperty* p =
+         new ossimNumericProperty(name, ossimString::toString(theClampValueHi));
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   else if (name == PF_REPLACEMENT_MODE_KW)
+   {
+      vector<ossimString> constraintList(5);
+      constraintList[0] = "REPLACE_BAND_IF_TARGET";
+      constraintList[1] = "REPLACE_BAND_IF_PARTIAL_TARGET";
+      constraintList[2] = "REPLACE_ALL_BANDS_IF_PARTIAL_TARGET";
+      constraintList[3] = "REPLACE_ONLY_FULL_TARGETS";
+      constraintList[4] = "REPLACE_ALL_BANDS_IF_ANY_TARGET";
+      
+      ossimStringProperty* p =
+         new ossimStringProperty(name,
+                                 getReplacementModeString(),
+                                 false,
+                                 constraintList);
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   else if (name == PF_CLIP_MODE_KW)
+   {
+      vector<ossimString> constraintList(3);
+      constraintList[0] = "none";
+      constraintList[1] = "bounding_rect";
+      constraintList[2] = "valid_vertices";
+      
+      ossimStringProperty* p =
+         new ossimStringProperty(name,
+                                 getClipModeString(),
+                                 false,
+                                 constraintList);
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   ossimRefPtr<ossimProperty> result = ossimSource::getProperty(name);
+
+   if(result.valid())
+   {
+      if(result->getName() == ossimKeywordNames::ENABLED_KW)
+      {
+         result->clearChangeType();
+         
+         // we will at least say its a radiometric change
+         //
+         result->setCacheRefreshBit();
+      }
+   }
+
+   return result;
+}
+
+void ossimPixelFlipper::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property) return;
+
+   ossimString os = property->valueToString();
+   
+   ossimString name = property->getName();
+   if (name == PF_TARGET_VALUE_KW)
+   {
+      setTargetValue(os.toDouble());
+   }
+   if (name == TARGET_LOWER_LIMIT_PROP_NAME)
+   {
+      setTargetRange(os.toDouble(), theTargetValueHi);
+   }
+   if (name == TARGET_UPPER_LIMIT_PROP_NAME)
+   {
+      setTargetRange(theTargetValueLo, os.toDouble());
+   }
+   else if  (name == PF_REPLACEMENT_VALUE_KW)
+   {
+      setReplacementValue(os.toDouble());
+   }
+   else if  (name == PF_REPLACEMENT_MODE_KW)
+   {
+      setReplacementMode(os);
+   }
+   else if  (name == PF_CLAMP_VALUE_LO_KW)
+   {
+      setClampValue(os.toDouble(), false);
+   }
+   else if  (name == PF_CLAMP_VALUE_HI_KW)
+   {
+      setClampValue(os.toDouble(), true);
+   }
+   else if  (name == PF_CLIP_MODE_KW)
+   {
+      setClipMode(os);
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+void ossimPixelFlipper::getPropertyNames(
+   std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(PF_TARGET_VALUE_KW);
+   propertyNames.push_back(TARGET_LOWER_LIMIT_PROP_NAME);
+   propertyNames.push_back(TARGET_UPPER_LIMIT_PROP_NAME);
+   propertyNames.push_back(PF_REPLACEMENT_VALUE_KW);
+   propertyNames.push_back(PF_REPLACEMENT_MODE_KW);
+   propertyNames.push_back(PF_CLAMP_VALUE_LO_KW);
+   propertyNames.push_back(PF_CLAMP_VALUE_HI_KW);
+   propertyNames.push_back(PF_CLIP_MODE_KW);
+   
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+}
+
+ossimString ossimPixelFlipper::getShortName()const
+{
+   return ossimString("Pixel flipper");
+}
+
+bool ossimPixelFlipper::inRange(ossim_float64 value) const
+{
+   if (!theInputConnection)
+   {
+      //---
+      // Not initialized yet...  We're going to return true so that things
+      // like loadState work with the assumption that the caller know's
+      // the correct range.  This check is really intended for an uncheck
+      // range on the gui side.
+      //---
+      return true;
+   }
+   
+   const ossim_float64 NULL_PIX = ossimImageSourceFilter::getNullPixelValue();
+   const ossim_float64 MIN_PIX  = ossimImageSourceFilter::getMinPixelValue();
+   const ossim_float64 MAX_PIX  = ossimImageSourceFilter::getMaxPixelValue();
+
+   if ( (value == NULL_PIX) || ((value >= MIN_PIX) && (value <= MAX_PIX)) )
+   {
+      return true;
+   }
+
+   ossimNotify(ossimNotifyLevel_WARN)
+      << "\nossimPixelFlipper::inRange WARNING:"
+      << "\nvalue \"" << value
+      << "\" is out of range!"
+      << "\nInput source null = " << NULL_PIX
+      << "\nInput source min  = " << MIN_PIX
+      << "\nInput source max  = " << MAX_PIX
+      << endl;
+
+   return false;
+}
diff --git a/src/imaging/ossimPolyCutter.cpp b/src/imaging/ossimPolyCutter.cpp
new file mode 100644
index 0000000..6db4813
--- /dev/null
+++ b/src/imaging/ossimPolyCutter.cpp
@@ -0,0 +1,411 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimPolyCutter.cpp 21518 2012-08-22 21:15:56Z dburken $
+#include <ossim/imaging/ossimPolyCutter.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimRgbImage.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimActiveEdgeTable.h>
+static const char* NUMBER_POLYGONS_KW = "number_polygons";
+
+RTTI_DEF1(ossimPolyCutter, "ossimPolyCutter", ossimImageSourceFilter)
+
+ossimPolyCutter::ossimPolyCutter()
+   : ossimImageSourceFilter(),
+     theTile(NULL),
+     theCutType(OSSIM_POLY_NULL_OUTSIDE),
+     m_boundingOverwrite(false)
+{
+   thePolygonList.push_back(ossimPolygon());
+   theBoundingRect.makeNan();
+}
+
+// ossimPolyCutter::ossimPolyCutter(ossimImageSource* inputSource,
+//                                  ossimPolyArea2d* polygon)
+ossimPolyCutter::ossimPolyCutter(ossimImageSource* inputSource,
+                                 const ossimPolygon& polygon)
+   : ossimImageSourceFilter(inputSource),
+     theTile(NULL),
+     theCutType(OSSIM_POLY_NULL_INSIDE),
+     m_boundingOverwrite(false)
+{
+   thePolygonList.push_back(polygon);
+   computeBoundingRect();
+   initialize();
+}
+
+ossimPolyCutter::~ossimPolyCutter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimPolyCutter::getTile(const ossimIrect& tileRect,
+                                                     ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return theTile;
+   }
+   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(tileRect,
+                                                                   resLevel);
+   
+   if(!isSourceEnabled() || theBoundingRect.hasNans() || !input.valid())
+   {
+      return input;
+   }
+   
+   if((input->getDataObjectStatus() == OSSIM_EMPTY) ||
+      (input->getDataObjectStatus() == OSSIM_NULL))
+   {
+      return input;
+   }
+
+   if(!theTile.valid())
+   {
+      allocate(); // First time through...
+   }
+
+   if(!theTile.valid())
+   {
+      return input;
+   }
+   
+   theTile->setImageRectangle(tileRect);
+   
+   theTile->loadTile(input.get());
+   theTile->setDataObjectStatus(input->getDataObjectStatus());
+   vector<ossimPolygon>* polyList = &thePolygonList;
+   vector<ossimPolygon>  scaledPoly;
+   
+   ossimIrect boundingRect = getBoundingRect(resLevel);
+   if(resLevel)
+   {
+      ossimDpt decimation;
+      getDecimationFactor(resLevel, decimation);
+
+      if(!decimation.hasNans())
+      {
+         for(int polyIndex = 0;
+             polyIndex < (int)thePolygonList.size();
+             ++polyIndex)
+         {
+            scaledPoly.push_back(thePolygonList[polyIndex]*decimation);
+         }
+         polyList = &scaledPoly;
+      }
+   }
+   
+   if(polyList->size()&&
+      theTile->getDataObjectStatus()!=OSSIM_NULL)
+   {
+//       ossimActiveEdgeTable aet;
+      
+      
+      if(theCutType == OSSIM_POLY_NULL_OUTSIDE)
+      {
+         if(boundingRect.intersects(tileRect))
+         {
+            theTile->makeBlank();
+            theHelper.setImageData(theTile.get());
+            for(int polyIndex = 0; polyIndex < (int)polyList->size(); ++polyIndex)
+            {
+               theHelper.copyInputToThis(input->getBuf(),
+                                      (*polyList)[polyIndex]);
+            }
+            theTile->validate();
+         }
+         else
+         {
+            theTile->makeBlank();
+         }
+      }
+      else if(theCutType == OSSIM_POLY_NULL_INSIDE)
+      {
+         if(boundingRect.intersects(tileRect))
+         {
+            theHelper.setImageData(theTile.get());
+            for(int polyIndex = 0;
+                polyIndex < (int)polyList->size();
+                ++polyIndex)
+            {
+               theHelper.fill(theTile->getNullPix(),
+                           (*polyList)[polyIndex]);
+            }
+         }
+         theTile->validate();
+      }
+      
+   }
+   return theTile;
+}
+
+ossimIrect ossimPolyCutter::getBoundingRect(ossim_uint32 resLevel)const
+{
+   ossimIrect result;
+
+   result.makeNan();
+   if(!theInputConnection)
+   {
+      return result;
+   }
+   if(!isSourceEnabled())
+   {
+      return ossimImageSourceFilter::getBoundingRect(resLevel);
+   }
+   
+   result = theInputConnection->getBoundingRect(resLevel);
+
+   if(isSourceEnabled()&&(!theBoundingRect.hasNans()))
+   {
+      if(theCutType == OSSIM_POLY_NULL_OUTSIDE)
+      {
+         ossimDpt decimation;
+         getDecimationFactor(resLevel, decimation);
+         if(decimation.hasNans())
+         {
+            result =  theBoundingRect;
+         }
+         else
+         {
+            result = theBoundingRect*decimation;
+         }
+      }
+   }
+   else if(isSourceEnabled())
+   {
+      return theBoundingRect;
+   }
+   
+   return result;
+}
+
+void ossimPolyCutter::initialize()
+{
+   // Capture the input connection.
+   ossimImageSourceFilter::initialize();
+
+   // Force an allocate on next getTile.
+   theTile = NULL;
+}
+
+void ossimPolyCutter::allocate()
+{
+   theTile=NULL;
+   if(theInputConnection)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,
+                                                          theInputConnection);
+      theTile->initialize();
+
+   }
+}
+
+bool ossimPolyCutter::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   ossimString newPrefix = prefix;
+
+   for(int i = 0; i < (int)thePolygonList.size();++i)
+   {
+      newPrefix = ossimString(prefix) + "polygon" + ossimString::toString(i)+".";
+
+      thePolygonList[i].saveState(kwl, newPrefix.c_str());
+   }
+   kwl.add(prefix,
+           NUMBER_POLYGONS_KW,
+           (int)thePolygonList.size(),
+           true);
+   
+   ossimString fillType = "null_inside";
+   if(theCutType == OSSIM_POLY_NULL_OUTSIDE)
+   {
+      fillType = "null_outside";
+   }
+   kwl.add(prefix,
+           "cut_type",
+           fillType.c_str(),
+           true);   
+  
+   return ossimImageSourceFilter::saveState(kwl, prefix);;
+}
+
+bool ossimPolyCutter::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   const char* numberPolygons = kwl.find(prefix, NUMBER_POLYGONS_KW);
+
+   ossimString newPrefix;
+   if(numberPolygons)
+   {
+      thePolygonList.clear();
+      int npolys = ossimString(numberPolygons).toLong();
+      for(int i = 0; i < npolys;++i)
+      {
+         thePolygonList.push_back(ossimPolygon());
+         
+         newPrefix = ossimString(prefix) + "polygon" + ossimString::toString(i)+".";
+         
+         thePolygonList[i].loadState(kwl, newPrefix.c_str());
+      }
+   }
+
+   const char* lookup = kwl.find(prefix,
+                                 "cut_type");
+   if(lookup)
+   {
+      theCutType = OSSIM_POLY_NULL_INSIDE;
+      ossimString test = lookup;
+      if(test == "null_outside")
+      {
+         theCutType = OSSIM_POLY_NULL_OUTSIDE;
+      }
+   }
+   else
+   {
+      theCutType = OSSIM_POLY_NULL_OUTSIDE;
+   }
+
+   computeBoundingRect();
+
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+void ossimPolyCutter::setPolygon(const vector<ossimDpt>& polygon,
+                                 ossim_uint32 index)
+{
+   if(index < polygon.size())
+   {
+      thePolygonList[index] = polygon;
+
+      computeBoundingRect();
+   }
+
+}
+
+void ossimPolyCutter::setPolygon(const vector<ossimIpt>& polygon,
+                                 ossim_uint32 index)
+{
+   if(polygon.size())
+   {
+      thePolygonList[index] = polygon;
+      computeBoundingRect();
+   }
+}
+
+void ossimPolyCutter::addPolygon(const vector<ossimIpt>& polygon)
+{
+   thePolygonList.push_back(ossimPolygon(polygon));
+   computeBoundingRect();
+}
+
+void ossimPolyCutter::addPolygon(const vector<ossimDpt>& polygon)
+{
+   thePolygonList.push_back(ossimPolygon(polygon));
+   computeBoundingRect();
+}
+
+void ossimPolyCutter::addPolygon(const ossimPolygon& polygon)
+{
+   thePolygonList.push_back(ossimPolygon(polygon));
+   computeBoundingRect();
+}
+
+
+void ossimPolyCutter::setCutType(ossimPolyCutterCutType cutType)
+{
+   theCutType = cutType;
+}
+
+ossimPolyCutter::ossimPolyCutterCutType ossimPolyCutter::getCutType()const
+{
+   return theCutType;
+}
+
+void ossimPolyCutter::clear()
+{
+   setNumberOfPolygons(0);
+}
+
+void ossimPolyCutter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimImageSourceFilter::setProperty(property);
+}
+
+ossimRefPtr<ossimProperty> ossimPolyCutter::getProperty(const ossimString& name)const
+{
+
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimPolyCutter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+} 
+
+void ossimPolyCutter::computeBoundingRect()
+{
+   ossimIrect bounds;
+   theBoundingRect.makeNan();
+
+   for(int i = 0; i < (int)thePolygonList.size(); ++i)
+   {
+      thePolygonList[i].getBoundingRect(bounds);
+
+      if(!bounds.hasNans())
+      {
+         if(theBoundingRect.hasNans())
+         {
+            theBoundingRect = bounds;
+         }
+         else
+         {
+            theBoundingRect = theBoundingRect.combine(bounds);
+         }
+      }
+   }
+}
+
+const ossimIrect& ossimPolyCutter::getRectangle() const
+{
+   return theBoundingRect;
+}
+
+void ossimPolyCutter::setRectangle(const ossimIrect& rect)
+{
+   theBoundingRect = rect;
+   m_boundingOverwrite = true;
+}
+
+void ossimPolyCutter::setNumberOfPolygons(ossim_uint32 count)
+{
+   if(!count)
+   {
+      thePolygonList.clear();
+      thePolygonList.clear();
+   }
+   else
+   {
+      thePolygonList.resize(count);
+   }
+}
+
+std::vector<ossimPolygon>& ossimPolyCutter::getPolygonList()
+{
+   return thePolygonList;
+}
+
+const std::vector<ossimPolygon>& ossimPolyCutter::getPolygonList()const
+{
+   return thePolygonList;
+}
+
diff --git a/src/imaging/ossimQbTileFilesHandler.cpp b/src/imaging/ossimQbTileFilesHandler.cpp
new file mode 100644
index 0000000..b39127a
--- /dev/null
+++ b/src/imaging/ossimQbTileFilesHandler.cpp
@@ -0,0 +1,330 @@
+//*************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+// Description: Image handler used for tiled Quickbird imagery. 
+//
+//*************************************************************************************************
+//  $Id: ossimQbTileFilesHandler.cpp 2814 2011-07-05 13:40:16Z oscar.kramer $
+
+#include <ossim/imaging/ossimQbTileFilesHandler.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossim2dTo2dShiftTransform.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/imaging/ossimTiffOverviewBuilder.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/support_data/ossimQuickbirdMetaData.h>
+#include <ossim/support_data/ossimQuickbirdTile.h>
+#include <ossim/projection/ossimQuickbirdRpcModel.h>
+#include <algorithm>
+
+RTTI_DEF1(ossimQbTileFilesHandler, "ossimQbTileFilesHandler", ossimTiledImageHandler)
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimQbTileFilesHandler:debug");
+
+//*************************************************************************************************
+//!  Constructor (default):
+//*************************************************************************************************
+ossimQbTileFilesHandler::ossimQbTileFilesHandler()
+{
+}
+
+//*************************************************************************************************
+//! Destructor:
+//*************************************************************************************************
+ossimQbTileFilesHandler::~ossimQbTileFilesHandler()
+{
+}
+
+//*************************************************************************************************
+//! Opens the image file given entry index. This class does not support multiple entries.
+//! @param imageFile File to open.
+//! @param entryIndex
+//! @return false if entry index other than 0 specified.
+//*************************************************************************************************
+bool ossimQbTileFilesHandler::open()
+{
+   static const char* MODULE = "ossimQbTileFilesHandler::open() -- ";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+         <<MODULE << "Entering...\nimage: " << theImageFile << "\n";
+   }
+   
+   // Test for extension: image.til
+   ossimString ext = theImageFile.ext().downcase();
+   if ( ext == "ovr" )
+   {
+      return false; // Don't try to open overviews.
+   }
+   
+   ossimRegExp regExp("^[t|T][i|I][l|L]");
+   if ( regExp.find( ext.c_str() ) )
+   {
+      if (!theImageFile.exists())
+      {
+         return false;
+      }
+   }
+      
+   // Use ossimQuickbirdTile object for parsing the TIL file and fetching the data structure 
+   // containing tile-file info:
+   if (traceDebug())
+      ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"OPENING ossimQuickbirdTile..."<<std::endl;
+   
+   ossimQuickbirdTile qbt;
+   bool success = qbt.open(theImageFile);
+   if (!success)
+      return false;
+   
+   // Populate our own data structure given the QBT map:
+   ossimFilename image_dir (theImageFile.path());
+   const ossimQuickbirdTile::TileMap& qbtTileMap = qbt.getMap();
+
+   m_fullImgRect.makeNan();
+   ossimIrect subImageRect;
+   ossimQuickbirdTile::TileMap::const_iterator qbt_iter = qbtTileMap.begin();
+   ossimImageHandlerRegistry* factory = ossimImageHandlerRegistry::instance();
+   while (qbt_iter != qbtTileMap.end())
+   {
+      ossimQuickbirdTileInfo info ((*qbt_iter).second);
+      ossimTileFile tilefile;
+      tilefile.tileFilename = (*qbt_iter).second.theFilename;
+      tilefile.tileFilename.setPath(image_dir);
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Using factory to open <"
+            <<tilefile.tileFilename<<">"<<std::endl;
+      }
+
+      // Now open up the handlers for this tile-file:
+      tilefile.imageHandler = factory->open(tilefile.tileFilename);
+      if (tilefile.imageHandler.valid())
+      {
+         // Valid handler, populate remaining items of interest and push it on our list...
+         // Fetch image coordinates in full-view:
+         subImageRect.set_ulx((*qbt_iter).second.theUlXOffset);
+         subImageRect.set_uly((*qbt_iter).second.theUlYOffset);
+         subImageRect.set_lrx((*qbt_iter).second.theLrXOffset);
+         subImageRect.set_lry((*qbt_iter).second.theLrYOffset);
+         tilefile.subImageRects.push_back(subImageRect);
+
+         // Update bounding image rectangle:
+         m_fullImgRect = m_fullImgRect.combine(subImageRect);
+         m_tileFiles.push_back(tilefile);
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Pushed <"<<tilefile.tileFilename<<"> on"
+               "to tile-files list."<<std::endl;
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<"TIL file listed <"
+            <<tilefile.tileFilename<<"> as one of the tiles, but the file could not be opened. "
+            <<"This is being ignored but may cause a problem downstream."<<std::endl;
+      }
+   
+      ++qbt_iter;   
+   }
+
+   // Need to check the full-image rect for validity. May need to explore the .IMD file if this 
+   // was not properly initialized:
+   if (m_fullImgRect.hasNans())
+   {
+      if (!computeImageRects())
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Could not establish image rectangles."
+               <<std::endl;
+         }
+         return false;
+      }
+   }
+
+   if (traceDebug())
+      ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Finished loading tiles."<<std::endl;
+
+   bool open_good = false;
+   if ((m_tileFiles.size() != 0) && m_tileFiles[0].imageHandler.valid())
+   {
+      completeOpen();
+      open_good = true;
+      
+      if (traceDebug())
+         ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Open successful."<<std::endl;
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_INFO)<<MODULE<<"Returning with <"
+         <<ossimString::toString(open_good)<<">"<<std::endl;
+   }
+   return open_good;
+}
+
+//*************************************************************************************************
+//! Fetch the tile-files common RPC data file and create the projection for this image
+//*************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimQbTileFilesHandler::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      // Try external geom first:
+      theGeometry = getExternalImageGeometry();
+      
+      if ( !theGeometry )
+      {
+         theGeometry = new ossimImageGeometry;
+         
+         // The dataset is expected to have an RPC model associated with it:
+         ossimRefPtr<ossimQuickbirdRpcModel> model = new ossimQuickbirdRpcModel(this);
+         if (!model->getErrorStatus())
+         {
+            theGeometry->setProjection(model.get());
+         }
+         else
+         {
+            // Check for map projected data:
+            ossimFilename imd_file = theImageFile;
+            imd_file.setExtension("IMD");
+            if ( imd_file.exists() == false )
+            {
+               imd_file.setExtension("imd");
+            }
+
+            if ( imd_file.exists() )
+            {
+               ossimQuickbirdMetaData md;
+               ossimKeywordlist kwl;
+               if ( md.getMapProjectionKwl( imd_file, kwl ) == true )
+               {
+                  ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->
+                     createProjection( kwl, 0 );
+                  if ( proj.valid() == true )
+                  {
+                     theGeometry->setProjection( proj.get() );
+                  }
+               }
+            }
+         }
+
+         if ( (m_fullImgRect.ul().x != 0) || (m_fullImgRect.ul().y != 0) )
+         {
+            // Set sub image offset.
+            ossimRefPtr<ossim2dTo2dShiftTransform> xfrm =
+               new ossim2dTo2dShiftTransform( m_fullImgRect.ul() );
+            theGeometry->setTransform( xfrm.get() );
+         }
+      }
+            
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+   }
+   
+   return theGeometry;
+}
+
+//*************************************************************************************************
+//! Initializes tile image rects by considering adjacent row/col offsets. Called when TIL
+//! doesn't contain the info. Returns true if successful.
+//*************************************************************************************************
+bool ossimQbTileFilesHandler::computeImageRects()
+{
+   try
+   {
+      ossimQuickbirdMetaData oqmd;
+      if (!oqmd.open(theImageFile))
+         throw 1;
+
+      ossimIpt image_size (oqmd.getImageSize());
+      if (image_size.hasNans())
+         throw 2;
+
+      ossimIpt full_image_lr (image_size.x-1, image_size.y-1);
+      m_fullImgRect.set_ulx(0);
+      m_fullImgRect.set_uly(0);
+      m_fullImgRect.set_lr(full_image_lr);
+
+      // Now consider the subrects for each tile. It is assumed that all tiles (except right
+      // and bottom) will be of uniform size. The TIL file should have at least provided the row
+      // and column offsets for each tile into the full image. This is equivalent to the UL corner.
+      // It is presumed that the TIL failed to provide the LR corner since this method was called.
+      int dx=0, dy=0, i=0;
+      int num_tiles = (int) m_tileFiles.size();
+      while (((dx == 0) || (dy == 0)) && (i < num_tiles-1))
+      {
+         if (dx == 0)
+            dx = m_tileFiles[i+1].subImageRects[0].ul().x - m_tileFiles[i].subImageRects[0].ul().x;
+         if (dy == 0)
+            dy = m_tileFiles[i+1].subImageRects[0].ul().y - m_tileFiles[i].subImageRects[0].ul().y;
+         ++i;
+      }
+
+      // We should have the nominal tile size now. Check this is so:
+      if ((dx == 0) || (dy == 0))
+      {
+         // Prior scheme failed for establishing the tile dimensions. Final resort is to open the first
+         // available tile file and query its dimensions:
+         if (num_tiles == 0)
+            throw 3;
+         if (m_tileFiles[0].imageHandler.valid())
+         {
+            // we have an open handler, so just query it:
+            dy = m_tileFiles[0].imageHandler->getNumberOfLines();
+            dx = m_tileFiles[0].imageHandler->getNumberOfSamples();
+         }
+         else
+         {
+            // Struck out, just assume the tile is square:
+            if ((dx == 0) && (dy == 0))
+               throw 4;
+            if (dy == 0)
+               dy = dx;
+            else
+               dx = dy;
+         }
+      }
+
+      // Loop over all tiles to properly assign their image rectangles:
+      for (i=0; i<num_tiles; i++)
+      {
+         ossimIpt ul (m_tileFiles[i].subImageRects[0].ul());
+         ossimIpt lr (ul.x + dx - 1, ul.y + dy - 1);
+
+         // Check to make sure we don't exceed extents of full image:
+         if (lr.x > full_image_lr.x)
+            lr.x = full_image_lr.x;
+         if (lr.y > full_image_lr.y)
+            lr.y = full_image_lr.y;
+
+         m_tileFiles[i].subImageRects[0].set_lr(lr);
+      }
+   }
+   
+   catch (...)
+   {
+      // Could not establish the rectangles:
+      return false;
+   }
+
+   return true;
+}
+
diff --git a/src/imaging/ossimQuickbirdNitfTileSource.cpp b/src/imaging/ossimQuickbirdNitfTileSource.cpp
new file mode 100644
index 0000000..b5190d5
--- /dev/null
+++ b/src/imaging/ossimQuickbirdNitfTileSource.cpp
@@ -0,0 +1,167 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+//*******************************************************************
+//  $Id: ossimQuickbirdNitfTileSource.cpp 22836 2014-07-25 15:13:47Z dburken $
+#include <ossim/imaging/ossimQuickbirdNitfTileSource.h>
+#include <ossim/support_data/ossimQuickbirdTile.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossim2dTo2dShiftTransform.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+
+RTTI_DEF1(ossimQuickbirdNitfTileSource, "ossimQuickbirdNitfTileSource", ossimNitfTileSource);
+
+static const ossimTrace traceDebug("ossimQuickbirdNitfTileSource:debug");
+
+bool ossimQuickbirdNitfTileSource::open()
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimQuickbirdNitfTileSource::open(file) DEBUG: entered ..."
+         << std::endl;
+   }
+   
+   ossimFilename file = theImageFile;
+   file = file.replaceAllThatMatch("_R[0-9]+C[0-9]+");
+   ossimQuickbirdTile tileFile;
+   bool openedTileFile = false;
+   file.setExtension("TIL");
+   
+   if(!tileFile.open(file))
+   {
+      file.setExtension("TIL");
+      if(tileFile.open(file))
+      {
+         openedTileFile = true;
+      }
+      else
+      {
+         file.setExtension("til");
+         if(tileFile.open(file))
+         {
+            openedTileFile = true;
+         }
+      }
+   }
+   else
+   {
+      openedTileFile = true;
+   }
+   
+   if(openedTileFile)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimQuickbirdNitfTileSource::open(file) DEBUG:"
+            << "\nOpened tile file" << std::endl;
+      }
+
+      // Call the base class open...
+      if(!ossimNitfTileSource::open())
+      {
+         return false;
+      }
+      
+      ossimQuickbirdTileInfo info;
+      ossimIrect tempBounds = getCurrentImageHeader()->getImageRect();
+      
+      
+      tempBounds = ossimIrect(0,
+                              0,
+                              tempBounds.width() - 1,
+                              tempBounds.height() - 1);
+      
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimQuickbirdNitfTileSource::open(file) DEBUG:"
+            << "\nheader rectangle = " << tempBounds << std::endl;
+      }
+      
+      ossimIpt ulPt;
+      ossimIpt urPt;
+      ossimIpt lrPt;
+      ossimIpt llPt;
+      ossimDpt shift;
+      if(tileFile.getInfo(info, theImageFile.file().upcase()))
+      {
+         ulPt.makeNan();
+         urPt.makeNan();
+         lrPt.makeNan();
+         llPt.makeNan();
+         
+         if((info.theUlXOffset != OSSIM_INT_NAN) &&
+            (info.theUlYOffset != OSSIM_INT_NAN))
+         {
+            shift = ossimIpt(info.theUlXOffset, info.theUlYOffset);
+         }
+         else
+         {
+            shift = ossimIpt(0,0);
+         }
+         m_transform = new ossim2dTo2dShiftTransform(shift);
+      }
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimQuickbirdNitfTileSource::open(file) DEBUG:"
+            << "\nUl = " << ulPt
+            << "\nUr = " << urPt
+            << "\nLr = " << lrPt
+            << "\nLl = " << llPt
+            << "\ntheImageRect:  " << getImageRectangle(0)
+            << "\nExiting..." 
+            << std::endl;
+      }
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimQuickbirdNitfTileSource::open(file) DEBUG"
+            << "Not opened..."
+            << std::endl;
+      }
+   }
+   
+   return openedTileFile;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimQuickbirdNitfTileSource::getImageGeometry()
+{
+   ossimRefPtr<ossimImageGeometry> result = ossimImageHandler::getImageGeometry();
+   if( result.valid() )
+   {
+      if(!result->getTransform())
+      {
+         result->setTransform(m_transform.get());
+      }
+   }
+   return result;
+}
+
+bool ossimQuickbirdNitfTileSource::saveState(ossimKeywordlist& kwl,
+                                             const char* prefix)const
+{
+   return ossimNitfTileSource::saveState( kwl, prefix );
+}
+
+bool ossimQuickbirdNitfTileSource::loadState(const ossimKeywordlist& kwl,
+                                            const char* prefix)
+   
+{
+   return ossimNitfTileSource::loadState( kwl, prefix );
+}
diff --git a/src/imaging/ossimQuickbirdTiffTileSource.cpp b/src/imaging/ossimQuickbirdTiffTileSource.cpp
new file mode 100644
index 0000000..8de3082
--- /dev/null
+++ b/src/imaging/ossimQuickbirdTiffTileSource.cpp
@@ -0,0 +1,156 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+// 
+// Copied from ossimQuickbirdTiffTileSource written by Garrett Potts.
+//
+// Description:
+//
+// Class definition for specialized image handler to pick up offsets from
+// Quick Bird ".TIL" files.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimQuickbirdTiffTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimQuickbirdTiffTileSource.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/support_data/ossimQuickbirdTile.h>
+#include <ossim/projection/ossimQuickbirdRpcModel.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimTrace.h>
+
+RTTI_DEF1(ossimQuickbirdTiffTileSource,
+          "ossimQuickbirdTiffTileSource",
+          ossimTiffTileSource);
+
+static const ossimTrace traceDebug("ossimQuickbirdTiffTileSource:debug");
+
+//*************************************************************************************************
+// Checks for presence of required info before flagging successful open
+//*************************************************************************************************
+bool ossimQuickbirdTiffTileSource::open()
+{
+   static const char M[] = "ossimQuickbirdTiffTileSource::open()";
+   
+   bool result = false;
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " ENTERED ..." << std::endl;
+   }
+
+   m_tileInfoFilename = theImageFile.noExtension().replaceAllThatMatch("_R[0-9]+C[0-9]+");
+   
+   // QB is recognized by the presence of a tile info file. Fail if not present:
+   m_tileInfoFilename.setExtension("TIL");
+
+   if ( !m_tileInfoFilename.exists() )
+   {
+      m_tileInfoFilename.setExtension("til");
+   }
+
+   if ( m_tileInfoFilename.exists() )
+   {
+      // Call the base class open...
+      result = ossimTiffTileSource::open();
+   }
+
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " result=" << (result?"true\n":"false\n");
+   }
+   
+   return result;
+}
+
+//*************************************************************************************************
+// I know what I am. I am a Quickbird TIFF image. I may be standalone or tiled with row-column
+// designation in the file name. My projection information is available (possibly) in an 
+// accompanying RPC file and/or internal TIF tag, and my transform info (sub-image offset) is 
+// available in a TILE info file (*.til) or internal TIF tag. Therefore, I (and not some outside
+// factory) am best qualified for establishing my image geometry.
+//*************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimQuickbirdTiffTileSource::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      //---
+      // Check factory for external geom:
+      //---
+      theGeometry = getExternalImageGeometry();
+      
+      if ( !theGeometry )
+      {
+         theGeometry = new ossimImageGeometry();
+         
+         // Fetch the tile info for this particular image:
+         if ( m_tileInfoFilename.size() )
+         {
+            ossimQuickbirdTile tileFile;
+            if ( tileFile.open(m_tileInfoFilename) ) 
+            {
+               ossimQuickbirdTileInfo info;
+               bool infoStatus = tileFile.getInfo(info, theImageFile.file().upcase());
+               if ( !infoStatus )
+               {
+                  infoStatus = tileFile.getInfo(info, theImageFile.file().downcase());
+               }
+
+               if ( infoStatus )
+               {
+                  // Next is the projection part of the image geometry. This should be available
+                  // as an external RPC file or internal RPC's in the tiff file. Otherwise use
+                  // the map projection specified in the 
+                  // tiff file:
+                  theGeometry->setProjection(0);
+                  
+                  ossimRefPtr<ossimQuickbirdRpcModel> model = new ossimQuickbirdRpcModel;
+                  if (model->parseFile(theImageFile))
+                  {
+                     //---
+                     // If RPC projection set the sub-image offset:
+                     // Establish sub-image offset (shift) for this tile:
+                     //---
+                     ossimDpt shift(0,0);
+                     if ((info.theUlXOffset != OSSIM_INT_NAN) &&
+                         (info.theUlYOffset != OSSIM_INT_NAN))
+                        shift = ossimIpt(info.theUlXOffset, info.theUlYOffset);
+                     
+                     if(traceDebug())
+                     {
+                        ossimNotify(ossimNotifyLevel_DEBUG)
+                           << "ossimQuickbirdTiffTileSource::open() DEBUG:"
+                           << "\nSub image offset  = " << shift << std::endl;
+                     }
+
+                     // Create the transform and set it in the geometry object:
+                     ossimRefPtr<ossim2dTo2dTransform> transform =
+                        new ossim2dTo2dShiftTransform(shift);
+                     
+                     theGeometry->setTransform(transform.get());
+                     theGeometry->setProjection(model.get());
+                  }
+                  else
+                  {
+                     // Last resort to a projection factory:
+                     ossimRefPtr<ossimProjection> proj = 
+                        ossimProjectionFactoryRegistry::instance()->createProjection(this);
+                     if (proj.valid()) theGeometry->setProjection(proj.get());
+                  }
+               }
+
+               // Set image things the geometry object should know about.
+               initImageParameters( theGeometry.get() );
+            }
+         }
+      }
+   }
+
+   return theGeometry;
+}
+
+
diff --git a/src/imaging/ossimRLevelFilter.cpp b/src/imaging/ossimRLevelFilter.cpp
new file mode 100644
index 0000000..d046497
--- /dev/null
+++ b/src/imaging/ossimRLevelFilter.cpp
@@ -0,0 +1,234 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRLevelFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
+#include <ossim/imaging/ossimRLevelFilter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimTrace.h>
+
+static const char* CURRENT_RLEVEL_KW    = "current_rlevel";
+static const char* OVERRIDE_GEOMETRY_KW = "override_geometry";
+
+static ossimTrace traceDebug("ossimRLevelFilter:debug");
+
+RTTI_DEF1(ossimRLevelFilter, "ossimRLevelFilter", ossimImageSourceFilter);
+
+//**************************************************************************************************
+ossimRLevelFilter::ossimRLevelFilter()
+   : ossimImageSourceFilter(),
+     theCurrentRLevel(0),
+     theOverrideGeometryFlag(false)
+{
+}
+
+//**************************************************************************************************
+ossimRLevelFilter::~ossimRLevelFilter()
+{
+}
+
+//**************************************************************************************************
+void ossimRLevelFilter::getDecimationFactor(ossim_uint32 resLevel,
+                                            ossimDpt& result) const
+{
+   if(!theInputConnection)
+   {
+      result.makeNan();
+   }
+
+   theInputConnection->getDecimationFactor(resLevel,
+                                           result);
+}
+
+//**************************************************************************************************
+bool ossimRLevelFilter::getOverrideGeometryFlag() const
+{
+   return theOverrideGeometryFlag;
+}
+
+//**************************************************************************************************
+void ossimRLevelFilter::setOverrideGeometryFlag(bool override)
+{
+   theOverrideGeometryFlag = override;
+}
+
+//**************************************************************************************************
+void ossimRLevelFilter::setCurrentRLevel(ossim_uint32 rlevel)
+{
+   theCurrentRLevel = rlevel;
+   updateGeometry();
+}
+
+//**************************************************************************************************
+ossim_uint32 ossimRLevelFilter::getCurrentRLevel()const
+{
+   return theCurrentRLevel;
+}
+
+//**************************************************************************************************
+// Returns a pointer reference to the active image geometry at this filter. The input source
+// geometry is modified, so we need to maintain our own geometry object as a data member.
+//**************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimRLevelFilter::getImageGeometry()
+{
+   // Have we already defined our own geometry? Return it if so:
+   if (m_ScaledGeometry.valid()) return m_ScaledGeometry;
+
+   if (!theInputConnection) return ossimRefPtr<ossimImageGeometry>();
+
+   ossim_uint32 rlevel = getCurrentRLevel();
+   ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
+
+   // If no scaling is happening, just return the input image geometry:
+   if ((!inputGeom) || (rlevel == 0) || (getEnableFlag() == false))
+      return inputGeom;
+
+   // Need to create a copy of the input geom and modify it as our own, then pass that:
+   m_ScaledGeometry = new ossimImageGeometry(*inputGeom);
+   updateGeometry();
+
+   // Return our version of the image geometry:
+   return m_ScaledGeometry;
+}
+
+//**************************************************************************************************
+//! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
+//! a scale change so that the geometry's projection is modified accordingly.
+//**************************************************************************************************
+void ossimRLevelFilter::updateGeometry()
+{
+   if (m_ScaledGeometry.valid())
+   {
+      // Modify the image geometry's projection with the scale factor before returning geom:
+      ossimProjection* proj = m_ScaledGeometry->getProjection();
+      ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);;
+      if(mapProj)
+      {
+         ossimDpt decimation;
+         getDecimationFactor(theCurrentRLevel, decimation);
+         decimation.x = 1.0/decimation.x;
+         decimation.y = 1.0/decimation.y;
+
+         // This will adjust both the scale and the tie point to account for decimation.
+         mapProj->applyScale(decimation, true);  // recenter tie point flag
+      }
+   }
+}
+
+//**************************************************************************************************
+void ossimRLevelFilter::getSummedDecimation(ossimDpt& result) const
+{
+   // Start with fresh values.
+   result.x = 0.0;
+   result.y = 0.0;
+
+   ossim_uint32 rlevel = getCurrentRLevel();
+
+   if (rlevel == 0)
+   {
+      return; // no decimation.
+   }
+
+   // Sum the decimations from rlevel one to the current rlevel.
+   for (ossim_uint32 i = 1; i <= rlevel; ++i)
+   {
+      ossimDpt dpt;
+      getDecimationFactor(i, dpt);
+      if (dpt.hasNans())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimRLevelFilter::getSummedDecimation WARNING:"
+            << "\nNans returned from getDecimationFactor!"
+            << std::endl;
+         result.makeNan();
+         return;
+      }
+      result.x += dpt.x;
+      result.y += dpt.y;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimRLevelFilter::getSummedDecimation result: " << result
+         << std::endl;
+   }
+}
+
+//**************************************************************************************************
+ossimIrect ossimRLevelFilter::getBoundingRect(ossim_uint32 resLevel)const
+{
+   ossimIrect rect;
+   rect.makeNan();
+   if(!theInputConnection) return rect;
+
+   if (isSourceEnabled())
+   {
+      return theInputConnection->getBoundingRect(theCurrentRLevel);
+   }
+   return theInputConnection->getBoundingRect(resLevel);
+}
+
+//**************************************************************************************************
+ossimRefPtr<ossimImageData> ossimRLevelFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return 0;
+   }
+
+   if(!isSourceEnabled())
+   {
+      return theInputConnection->getTile(tileRect, resLevel);
+   }
+
+   // Ignoring resLevel as we're in charge of it here!
+   return theInputConnection->getTile(tileRect, theCurrentRLevel);
+}
+
+//**************************************************************************************************
+bool ossimRLevelFilter::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix)
+{
+   const char* current  = kwl.find(prefix, CURRENT_RLEVEL_KW);
+   const char* override = kwl.find(prefix, OVERRIDE_GEOMETRY_KW);
+
+   if(current)
+      theCurrentRLevel = ossimString(current).toULong();
+
+   if(override)
+      theOverrideGeometryFlag = ossimString(override).toBool();
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+
+   // An existing image geometry object here will need to be updated:
+   updateGeometry();
+}
+
+//**************************************************************************************************
+bool ossimRLevelFilter::saveState(ossimKeywordlist& kwl,
+                                  const char* prefix)const
+{
+   kwl.add(prefix,
+           CURRENT_RLEVEL_KW,
+           theCurrentRLevel,
+           true);
+
+   kwl.add(prefix,
+           OVERRIDE_GEOMETRY_KW,
+           (ossim_uint32)theOverrideGeometryFlag,
+           true);
+
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
diff --git a/src/imaging/ossimRangeDomeTileSource.cpp b/src/imaging/ossimRangeDomeTileSource.cpp
new file mode 100644
index 0000000..9b5990d
--- /dev/null
+++ b/src/imaging/ossimRangeDomeTileSource.cpp
@@ -0,0 +1,398 @@
+/*
+ * ossimRangeDomeTileSource.cpp
+ *
+ *  Created on: Aug 3, 2015
+ *      Author: okramer
+ */
+
+#include <ossim/imaging/ossimRangeDomeTileSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <iostream>
+
+using namespace std;
+
+RTTI_DEF1(ossimRangeDomeTileSource, "ossimRangeDomeTileSource", ossimImageHandler);
+
+const ossimString ossimRangeDomeTileSource::OSSIM_RANGE_DOME_SPEC_MAGIC_NUMBER ("OSSIM_RANGE_DOMES");
+
+ossimRangeDome::ossimRangeDome(vector<ossimString>& tokens)
+: valid (false),
+  id (0),
+  radiusMeters (0),
+  radiusPixelsSq (0),
+  classification (UNASSIGNED),
+  startAz (0),
+  endAz (0)
+{
+   if ((tokens.size() < 6) || (tokens[0].size() && (tokens[0].chars()[0] == '#')))
+      return;
+
+   ossim_uint32 i = 0;
+   id             = tokens[i++].toUInt32();
+   centerGpt.lat  = tokens[i++].toDouble();
+   centerGpt.lon  = tokens[i++].toDouble();
+   centerGpt.hgt  = tokens[i++].toDouble();
+   radiusMeters   = tokens[i++].toDouble();
+   classification = (Classification) tokens[i++].toInt32();
+   valid = true;
+
+   if (tokens.size() >= 8)
+   {
+      startAz = tokens[i++].toDouble();
+      endAz = tokens[i++].toDouble();
+      if (endAz == 360.0)
+         endAz = 0.0;
+   }
+
+   if ( tokens.size()-i )
+   {
+      description = tokens[i];
+      description.trim();
+   }
+}
+
+ossimGrect ossimRangeDome::boundingRect() const
+{
+   ossimDpt scale = centerGpt.metersPerDegree();
+   double dlat = radiusMeters/scale.y;
+   double dlon = radiusMeters/scale.x;
+   return ossimGrect(centerGpt.lat+dlat, centerGpt.lon-dlon,
+                     centerGpt.lat-dlat, centerGpt.lon+dlon);
+}
+
+ossimRangeDomeTileSource::ossimRangeDomeTileSource()
+:  m_gsd(1.0, 1.0) // default GSD
+{
+}
+
+
+ossimRangeDomeTileSource::~ossimRangeDomeTileSource()
+{
+   close();
+}
+
+
+bool ossimRangeDomeTileSource::open()
+{
+#if 0 /* Please wrap with traceDebug().  drb */
+   if (!theImageFile.isReadable())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimRangeDomeTileSource::open() -- Error. Coould not"
+            " open CSV file at <"<<theImageFile<<">" << endl;
+      return false;
+   }
+#endif
+
+   ossimString dome_spec;
+   ossim_uint32 sizeOfMagic = (ossim_uint32)OSSIM_RANGE_DOME_SPEC_MAGIC_NUMBER.size();
+   char* magic_number = new char [ sizeOfMagic ];
+
+   // Open the CSV and check proper file type:
+   ifstream indata (theImageFile.chars());
+   if (indata.fail())
+      return false;
+   indata.read(magic_number, sizeOfMagic);
+
+   if (indata.eof() || indata.fail() || (OSSIM_RANGE_DOME_SPEC_MAGIC_NUMBER != magic_number))
+      return false;
+
+   // loop over each record/dome spec:
+   vector<ossimString> tokens;
+   while (indata.good())
+   {
+      tokens.clear();
+      getline(indata, dome_spec);
+      dome_spec.split(tokens, ",", true);
+      ossimRangeDome dome (tokens);
+      if (dome.valid)
+         m_rangeDomes.push_back(dome);
+   }
+
+   // The GSD may be incorrect, but init anyway then redo whe GSD is set:
+   initialize();
+
+   return isOpen();
+}
+
+void ossimRangeDomeTileSource::initialize()
+{
+   if (!isOpen())
+      return;
+
+   // Establish bounding rect:
+   ossimGrect boundingRect;
+   boundingRect.makeNan();
+   vector<ossimRangeDome>::iterator dome = m_rangeDomes.begin();
+   while (dome != m_rangeDomes.end())
+   {
+      boundingRect.expandToInclude(dome->boundingRect());
+      ++dome;
+   }
+
+   // Set up the geometry:
+   ossimRefPtr<ossimMapProjection> mapProj = new ossimEquDistCylProjection();
+   mapProj->setOrigin(boundingRect.midPoint());
+   mapProj->setMetersPerPixel(m_gsd);
+   ossimDpt degPerPixel (mapProj->getDecimalDegreesPerPixel());
+   mapProj->setElevationLookupFlag(false);
+   mapProj->setUlTiePoints(boundingRect.ul());
+   ossimIpt image_size(boundingRect.width()/degPerPixel.x, boundingRect.height()/degPerPixel.y);
+   theGeometry = new ossimImageGeometry(0, mapProj.get());
+   theGeometry->setImageSize(image_size);
+
+   // Transform the domes to image space coordinates:
+   dome = m_rangeDomes.begin();
+   double r;
+   while (dome != m_rangeDomes.end())
+   {
+      theGeometry->worldToLocal(dome->centerGpt, dome->centerIpt);
+      r = dome->radiusMeters/m_gsd.x;
+      dome->radiusPixelsSq = r*r;
+      ++dome;
+   }
+}
+
+
+bool ossimRangeDomeTileSource::isOpen() const
+{
+   return (!m_rangeDomes.empty());
+}
+
+
+void ossimRangeDomeTileSource::close()
+{
+   m_rangeDomes.clear();
+   theGeometry = 0;
+}
+
+
+ossimRefPtr<ossimImageData> ossimRangeDomeTileSource::getTile(const ossimIrect& rect,
+                                                              ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> tile = ossimImageDataFactory::instance()->create(this, this);
+
+   tile->setImageRectangle(rect);
+   tile->initialize();
+
+   getTile(tile.get(), resLevel);
+
+   return tile;
+}
+
+
+bool ossimRangeDomeTileSource::getTile(ossimImageData* result, ossim_uint32 resLevel)
+{
+   if (!result || !theGeometry.valid())
+      return false;
+
+   // Start with null fill:
+   result->fill(getNullPixelValue());
+
+   // Verify intersection with dataset. Everything done in R0 space:
+   ossimIrect tile_rect (result->getImageRectangle());
+   ossim_uint32 coord_scale = resLevel + 1;
+   ossimIrect tile_rect_r0 (coord_scale*tile_rect);
+   ossimIrect boundingImgRect;
+   theGeometry->getBoundingRect(boundingImgRect);
+
+   if (!tile_rect_r0.intersects(boundingImgRect))
+   {
+      result->setDataObjectStatus(OSSIM_EMPTY);
+      return true;
+   }
+
+   vector<ossimRangeDome>::iterator dome;
+   double d2, x0, y0, dx, dy, az;
+
+   // Nested loop over all pixels in tile:
+   for (ossim_int32 yn=tile_rect.ul().y; yn<=tile_rect.lr().y; ++yn)
+   {
+      y0 = yn * coord_scale;
+
+      for (ossim_int32 xn=tile_rect.ul().x; xn<=tile_rect.lr().x; ++xn)
+      {
+         x0 = xn * coord_scale;
+
+         // Loop over each dome in the list to see if this pixel is affected:
+         dome = m_rangeDomes.begin();
+         while (dome != m_rangeDomes.end())
+         {
+            // Check distance to center:
+            dx = x0 - dome->centerIpt.x;
+            dy = y0 - dome->centerIpt.y;
+            d2 = dx*dx + dy*dy;
+
+            if (d2 > dome->radiusPixelsSq)
+            {
+               ++dome;
+               continue;
+            }
+
+            // Passed range test, do azimuth test. First check for simple 360 dome:
+            if (dome->startAz == dome->endAz)
+            {
+               result->setValue(xn, yn, (ossim_uint8) dome->classification);
+               ++dome;
+               continue;
+            }
+
+            // Need full azimuth test:
+            az = ossim::atan2d(dx, -dy);
+            if (az < 0)
+               az += 360;
+            if (((dome->startAz < dome->endAz) && (az >= dome->startAz) && (az <= dome->endAz)) ||
+                ((dome->startAz > dome->endAz) && (
+                     ((az >= dome->startAz) && (az > dome->endAz)) ||
+                     ((az < dome->startAz) && (az <= dome->endAz)))))
+            {
+               result->setValue(xn, yn, (ossim_uint8) dome->classification);
+            }
+            ++dome;
+         }
+      }
+   }
+
+   result->validate();
+   return true;
+}
+
+
+ossim_uint32 ossimRangeDomeTileSource::getNumberOfInputBands() const
+{
+   return 1;
+}
+
+
+ossim_uint32 ossimRangeDomeTileSource::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   if (theGeometry.valid())
+      return ( theGeometry->getImageSize().y / (resLevel+1) );
+   return 0;
+}
+
+
+ossim_uint32 ossimRangeDomeTileSource::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   if (theGeometry.valid())
+      return ( theGeometry->getImageSize().x / (resLevel+1) );
+   return 0;
+}
+
+
+bool ossimRangeDomeTileSource::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   static const char MODULE[] = "ossimRangeDomeTileSource::saveState()";
+
+   ossimImageHandler::saveState(kwl, prefix);
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE
+            << " ERROR detected in keyword list!  State not saved." << std::endl;
+      return false;
+   }
+
+   kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW, m_gsd.x, true);
+
+   return true;
+}
+
+
+bool ossimRangeDomeTileSource::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   static const char MODULE[] = "ossimRangeDomeTileSource::loadState()";
+   theDecimationFactors.clear();
+
+   ossimImageHandler::loadState(kwl, prefix);
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<< MODULE
+            << "WARNING: error detected in keyword list!  State not load." << std::endl;
+      return false;
+   }
+
+   ossimDpt gsd;
+   ossimString value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW);
+   if (!value.empty())
+      gsd.x = value.toDouble();
+
+   value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW);
+   if (!value.empty())
+      setGSD(value.toDouble());
+
+   // The rest of the state is established by opening the file:
+   bool good_open = open();
+   return good_open;
+}
+
+
+void ossimRangeDomeTileSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property.valid())
+      return;
+
+   ossimString s;
+   property->valueToString(s);
+   if (s.empty())
+      return;
+
+   // The user should select either explicit GSD or relative GSD factor, never both:
+   if ( property->getName() == ossimKeywordNames::METERS_PER_PIXEL_KW )
+   {
+      ossim_float64 gsd = s.toFloat64();
+      if (!ossim::isnan(gsd))
+         setGSD(gsd);
+   }
+   else
+   {
+      ossimImageHandler::setProperty(property);
+   }
+}
+
+
+ossimRefPtr<ossimProperty> ossimRangeDomeTileSource::getProperty(const ossimString& name) const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+   if ( name == ossimKeywordNames::METERS_PER_PIXEL_KW )
+   {
+      ossimString value = ossimString::toString(m_gsd.x);
+      prop = new ossimStringProperty(name, value);
+   }
+   else
+   {
+      prop = ossimImageHandler::getProperty(name);
+   }
+   return prop;
+}
+
+
+
+void ossimRangeDomeTileSource::getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const
+{
+   gsd.x =(1.0/(resLevel+1)) * m_gsd.x;
+   gsd.y =(1.0/(resLevel+1)) * m_gsd.y;
+}
+
+
+void ossimRangeDomeTileSource::setGSD( const ossim_float64& gsd )
+{
+   if (gsd == m_gsd.x)
+      return;
+
+   m_gsd.x = gsd;
+   m_gsd.y = gsd;
+
+   initialize();
+}
+
+
+
diff --git a/src/imaging/ossimReadmeFileWriter.cpp b/src/imaging/ossimReadmeFileWriter.cpp
new file mode 100644
index 0000000..60b5146
--- /dev/null
+++ b/src/imaging/ossimReadmeFileWriter.cpp
@@ -0,0 +1,454 @@
+//*******************************************************************
+// Copyright (C) 2003 Storage Area Networks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Kenneth Melero (kmelero at sanz.com)
+//
+//*******************************************************************
+//  $Id: ossimReadmeFileWriter.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/imaging/ossimReadmeFileWriter.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <iostream>
+using namespace std;
+
+RTTI_DEF1(ossimReadmeFileWriter,
+          "ossimReadmeFileWriter",
+          ossimMetadataFileWriter)
+
+static const char DEFAULT_FILE_NAME[] = "output_readme.txt";
+static ossimTrace traceDebug("ossimReadmeFileWriter:debug");
+
+//**************************************************************************************************
+// 
+//**************************************************************************************************
+ossimReadmeFileWriter::ossimReadmeFileWriter()
+:
+ossimMetadataFileWriter()
+{
+}
+
+//**************************************************************************************************
+// 
+//**************************************************************************************************
+ossimReadmeFileWriter::~ossimReadmeFileWriter()
+{
+}
+
+//**************************************************************************************************
+// 
+//**************************************************************************************************
+bool ossimReadmeFileWriter::writeFile()
+{
+   static const char MODULE[] = "ossimReadmeFileWriter::writeFile";
+
+   if(!theInputConnection)
+   {
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nNo input connection!  Returning..."
+              << endl;
+      }
+
+      return false;
+   }
+
+   std::ofstream out(theFilename.c_str(), ios_base::out);
+   if (!out)
+      return false;
+
+   // Fetch the map projection of the input image if it exists:
+   const ossimMapProjection* mapProj = 0;
+   ossimRefPtr<ossimImageGeometry> imgGeom = theInputConnection->getImageGeometry();
+   if ( imgGeom.valid() )
+   {
+      const ossimProjection* proj = imgGeom->getProjection();
+      mapProj = PTR_CAST(ossimMapProjection, proj);
+   }
+   if (!mapProj)
+   {
+      out.close();
+      return false;
+   }
+
+   ossimMapProjectionInfo* projectionInfo = new ossimMapProjectionInfo(mapProj, theAreaOfInterest);
+   if(projectionInfo)
+   {
+      out << setiosflags(ios::fixed)
+          << setiosflags(ios::left)
+          << setw(16) << "Image: "
+          << projectionInfo->getImageInfoString();
+      
+      out << setw(17) << "\nLines:"
+          << projectionInfo->linesPerImage()
+          << setw(17) << "\nSamples:"
+          << projectionInfo->pixelsPerLine()
+          << setw(17) << "\nPixel Size x:"
+          << setprecision(8) 
+          << projectionInfo->getMetersPerPixel().x 
+          << " meters";
+      
+      out << ", " 
+          << setprecision(8) 
+          << projectionInfo->getUsSurveyFeetPerPixel().x
+          << " U.S. feet";
+      
+      out << setw(17) << "\nPixel Size y:"
+          << setprecision(8) 
+          << projectionInfo->getMetersPerPixel().y 
+          << " meters";
+      
+      out << ", " 
+          << setprecision(8) 
+          << projectionInfo->getUsSurveyFeetPerPixel().y
+          << " U.S. feet";
+      
+      const ossimString type  = TYPE_NAME(mapProj);
+      const ossimString datum = mapProj->getDatum()->code();
+      const ossimString ellipsoid = mapProj->getEllipsoid().code();
+
+      if(type)
+         out << setw(17) << "\nProjection:" << type;
+
+      const ossimUtmProjection* utmProj = PTR_CAST(ossimUtmProjection, mapProj);
+      if (utmProj)
+         out << setw(17) << "\nUTM map zone:" << utmProj->getZone();
+      
+      if(datum && ellipsoid)
+         out << setw(17) << "\nDatum:"      << datum
+             << setw(17) << "\nEllipsoid:"
+             << ellipsoid;
+      
+      out << resetiosflags(ios::left) << endl;
+      
+      const ossimString NORTH = "N";
+      const ossimString SOUTH = "S";
+      const ossimString EAST  = "E";
+      const ossimString WEST  = "W";
+      
+      ossimString tmpString;
+      double tmpDouble;
+      
+      // HACK: Easiest way to get projection info for optional params is via the old keywordlist:
+      ossimKeywordlist kwl;
+      mapProj->saveState(kwl);
+      const char* parallel1   = kwl.find(ossimKeywordNames::STD_PARALLEL_1_KW);
+      const char* parallel2   = kwl.find(ossimKeywordNames::STD_PARALLEL_2_KW);
+      const char* scaleFactor = kwl.find(ossimKeywordNames::SCALE_FACTOR_KW);
+      
+      
+      ossimString proj_name = mapProj->getClassName();
+      if ( ( proj_name.contains("Lambert")           ) ||
+           ( proj_name.contains("Albers")            ) ||
+           ( proj_name.contains("TransverseMercator" ) ) )
+      {
+         double falseEasting  =  mapProj->getFalseEasting();
+         double falseNorthing =  mapProj->getFalseNorthing();
+ 
+         double origin_lat = mapProj->origin().latd();
+         tmpDouble = fabs(origin_lat);
+         tmpString = (origin_lat < 0.0) ? SOUTH : NORTH;
+         out << setiosflags(ios::left)
+             << "\n"
+             << setw(18) << "Origin Latitude:"
+             << resetiosflags(ios::left)
+             << setw(21) << setprecision(12) << tmpDouble 
+             << tmpString << endl;
+         
+         double origin_lon = mapProj->origin().lond();
+         tmpDouble = fabs(origin_lon);
+         tmpString = (origin_lon < 0.0) ? WEST : EAST;
+         out << setiosflags(ios::left)
+             << setw(18) << "Origin Longitude:"
+             << resetiosflags(ios::left)
+             << setw(21) << tmpDouble << tmpString
+             << setiosflags(ios::left)
+             << "\n"
+             << setw(23) << "False Easting:"
+             << resetiosflags(ios::left)
+             << setw(17) << setprecision(4) 
+             << falseEasting;
+         
+         out << " meters, " << setprecision(4)
+             << ossim::mtrs2usft(falseEasting) 
+             << " U.S. feet";
+         
+         out << endl;
+	 
+         out << setiosflags(ios::left)
+             << setw(23) << "False Northing:"
+             << resetiosflags(ios::left)
+             << setw(17) << setprecision(4) 
+             << falseNorthing;
+         
+         out << " meters, " << setprecision(4)
+             << ossim::mtrs2usft(falseNorthing) 
+             << " U.S. feet";
+         
+         out << endl;
+	 
+      } // End of if "Alber Lambert or TM.
+      
+      if (proj_name.contains("TransverseMercator"))
+      {
+
+         out << setiosflags(ios::left)
+             << "\n"
+             << setw(18) << "Scale Factor:"
+             << resetiosflags(ios::left)
+             << setw(21) << setprecision(10) 
+             << ossimString(scaleFactor).toDouble()
+             << "\n" << endl;
+      }
+      
+      if ( (proj_name.contains("Lambert") ) ||
+           (proj_name.contains("Albers")  ) )
+      {
+         double stdpar1 = ossimString(parallel1).toDouble();
+         tmpDouble = fabs(stdpar1);
+         tmpString = (stdpar1 < 0.0) ? SOUTH : NORTH;
+         out << setiosflags(ios::left) 
+             << setw(23) << "Standard Parallel #1:"
+             << resetiosflags(ios::left)
+             << setw(16) << setprecision(12) << tmpDouble
+             << tmpString << endl;
+         
+         double stdpar2 = ossimString(parallel2).toDouble();
+         tmpDouble = fabs(stdpar2);
+         tmpString = (stdpar2 < 0.0) ? SOUTH : NORTH;
+         out << setiosflags(ios::left)
+             << setw(23) << "Standard Parallel #2:"
+             << resetiosflags(ios::left)
+             << setw(16) << setprecision(12) 
+             << tmpDouble << tmpString
+             << "\n" << endl;
+      }
+      
+      ossimString cornerString[4] = { "Upper Left",
+                                      "Upper Right",
+                                      "Lower Right",
+                                      "Lower Left" };
+	
+      //---
+      // Add a note to the readme file stating what the corner coordinates
+      // are relative to.
+      //---
+      if (projectionInfo->getPixelType() == OSSIM_PIXEL_IS_AREA)
+      {
+         out 
+            << "\nCorner coordinates relative to outer edge of pixel.\n\n";
+      }
+      else
+      {
+         out
+            << "\nCorner coordinates relative to center of pixel.\n\n";
+      }
+      
+      out << "Corner Coordinates:\n\n";
+      
+      //---
+      // Upper Left Corner Points
+      //---
+      tmpDouble = fabs(projectionInfo->ulGroundPt().latd());
+      tmpString = (projectionInfo->ulGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
+      out << cornerString[0]  << endl;
+      out << setw(14) << "Latitude:  "
+          << setw(16) << setprecision(12) << tmpDouble 
+          << tmpString << endl;
+      tmpDouble = fabs(projectionInfo->ulGroundPt().lond());
+      tmpString = (projectionInfo->ulGroundPt().lond() < 0.0) ? WEST : EAST;
+      out << setw(14) << "Longitude:  "
+          << setw(16) << tmpDouble << tmpString << endl;
+      
+      out << setw(14) << "Easting:  "
+          << setw(17) << setprecision(4) 
+          << projectionInfo->ulEastingNorthingPt().x;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().x)
+          << " U.S. feet";
+      
+      out << endl
+          << setw(14) << "Northing:  "
+          << setw(17) << projectionInfo->ulEastingNorthingPt().y;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().y)
+          << " U.S. feet";
+      
+      out << endl << endl;
+      
+      //---
+      // Upper Right Corner Points
+      //---
+      tmpDouble = fabs(projectionInfo->urGroundPt().latd());
+      tmpString = (projectionInfo->urGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
+      out << cornerString[1]  << endl;
+      out << setw(14) << "Latitude:  "
+          << setw(16) << setprecision(12) << tmpDouble
+          << tmpString << endl;
+      tmpDouble = fabs(projectionInfo->urGroundPt().lond());
+      tmpString = (projectionInfo->urGroundPt().lond() < 0.0) ? WEST : EAST;
+      out << setw(14) << "Longitude:  "
+          << setw(16) << tmpDouble << tmpString << endl;
+      
+      out << setw(14) << "Easting:  "
+          << setw(17) << setprecision(4)
+          << projectionInfo->urEastingNorthingPt().x;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->urEastingNorthingPt().x)
+          << " U.S. feet";
+      
+      out << endl
+          << setw(14) << "Northing:  "
+          << setw(17) << projectionInfo->urEastingNorthingPt().y;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->urEastingNorthingPt().y)
+          << " U.S. feet";
+      
+      out << endl << endl;
+      
+      //---
+      // Lower Right Corner Points
+      //---
+      tmpDouble = fabs(projectionInfo->lrGroundPt().latd());
+      tmpString = (projectionInfo->lrGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
+      out << cornerString[2]  << endl;
+      out << setw(14) << "Latitude:  "
+          << setw(16) << setprecision(12) << tmpDouble 
+          << tmpString << endl;
+      tmpDouble = fabs(projectionInfo->lrGroundPt().lond());
+      tmpString = (projectionInfo->lrGroundPt().lond() < 0.0) ? WEST : EAST;
+      out << setw(14) << "Longitude:  "
+          << setw(16) << tmpDouble << tmpString << endl;
+      
+      out << setw(14) << "Easting:  "
+          << setw(17) << setprecision(4) 
+          << projectionInfo->lrEastingNorthingPt().x;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->lrEastingNorthingPt().x)
+          << " U.S. feet";
+      
+      out << endl
+          << setw(14) << "Northing:  "
+          << setw(17) << projectionInfo->lrEastingNorthingPt().y;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->lrEastingNorthingPt().y)
+          << " U.S. feet";
+      
+      out << endl << endl;
+      
+      //---
+      // Lower Left Corner Points
+      //---
+      tmpDouble = fabs(projectionInfo->llGroundPt().latd());
+      tmpString = (projectionInfo->llGroundPt().latd() < 0.0) ? SOUTH : NORTH; 
+      out << cornerString[3]  << endl;
+      out << setw(14) << "Latitude:  "
+          << setw(16) << setprecision(12) << tmpDouble
+          << tmpString << endl;
+      tmpDouble = fabs(projectionInfo->llGroundPt().lond());
+      tmpString = (projectionInfo->llGroundPt().lond() < 0.0) ? WEST : EAST;
+      out << setw(14) << "Longitude:  "
+          << setw(16) << tmpDouble << tmpString << endl;
+      
+      out << setw(14) << "Easting:  "
+          << setw(17) << setprecision(4)
+          <<  projectionInfo->llEastingNorthingPt().x;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->llEastingNorthingPt().x)
+          << " U.S. feet";
+      
+      out << endl
+          << setw(14) << "Northing:  "
+          << setw(17) << projectionInfo->llEastingNorthingPt().y;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->llEastingNorthingPt().y)
+          << " U.S. feet";
+      
+      out << endl << endl;
+      
+      out << "Center Coordinates:\n\n";
+      
+      tmpDouble = fabs(projectionInfo->centerGroundPt().latd());
+      
+      tmpString = (projectionInfo->centerGroundPt().latd() < 0.0) ? SOUTH : NORTH;
+      
+      out << setw(14) << "Latitude:  "
+          << setw(16) << setprecision(12) << tmpDouble
+          << tmpString << endl;
+      
+      tmpDouble = fabs(projectionInfo->centerGroundPt().lond());
+      
+      tmpString = (projectionInfo->centerGroundPt().lond() < 0.0) ? WEST : EAST;
+      
+      out << setw(14) << "Longitude:  "
+          << setw(16) << tmpDouble << tmpString << endl;
+      
+      out << setw(14) << "Easting:  "
+          << setw(17) << setprecision(4)
+          << projectionInfo->centerEastingNorthingPt().x;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->centerEastingNorthingPt().x)
+          << " U.S. feet";
+      
+      out << endl
+          << setw(14) << "Northing:  "
+          << setw(17) << projectionInfo->centerEastingNorthingPt().y;
+      
+      out << " meters, " << setprecision(4)
+          << ossim::mtrs2usft(projectionInfo->centerEastingNorthingPt().y)
+          << " U.S. feet";
+      
+      out << endl << endl;
+      
+      out 
+         << "\nNOTE:  Lat/Lon values are in decimal degrees.";
+      
+      out 
+         << "\n       Eastings/Northings are in meters.";
+      
+      out << endl;
+      
+      delete projectionInfo;
+   }
+   
+   out.close();
+   return true;
+}
+
+//**************************************************************************************************
+// 
+//**************************************************************************************************
+void ossimReadmeFileWriter::getMetadatatypeList(std::vector<ossimString>& metadatatypeList) const
+{
+   metadatatypeList.push_back(ossimString("ossim_readme")); 
+}
+
+//**************************************************************************************************
+// 
+//**************************************************************************************************
+bool ossimReadmeFileWriter::hasMetadataType(const ossimString& metadataType) const
+{
+   return (metadataType == "ossim_readme");
+}
diff --git a/src/imaging/ossimRectangleCutFilter.cpp b/src/imaging/ossimRectangleCutFilter.cpp
new file mode 100644
index 0000000..4773fc5
--- /dev/null
+++ b/src/imaging/ossimRectangleCutFilter.cpp
@@ -0,0 +1,306 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRectangleCutFilter.cpp 22953 2014-11-05 19:19:28Z dburken $
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+static ossimTrace traceDebug("ossimRectangleCutFilter:debug");
+
+RTTI_DEF1(ossimRectangleCutFilter,
+          "ossimRectangleCutFilter",
+          ossimImageSourceFilter);
+
+ossimRectangleCutFilter::ossimRectangleCutFilter(ossimObject* owner,
+                                     ossimImageSource* inputSource)
+   :ossimImageSourceFilter(owner, inputSource),
+    theCutType(OSSIM_RECTANGLE_NULL_OUTSIDE)
+{
+   theRectangle.makeNan();
+}
+
+ossimRectangleCutFilter::ossimRectangleCutFilter(ossimImageSource* inputSource)
+   :ossimImageSourceFilter(NULL, inputSource),
+    theCutType(OSSIM_RECTANGLE_NULL_OUTSIDE)
+{
+   theRectangle.makeNan();
+}
+
+
+ossimRefPtr<ossimImageData> ossimRectangleCutFilter::getTile(
+   const ossimIrect& rect,
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> tile = 0;
+
+   if ( theInputConnection && isSourceEnabled() && ( theRectangle.hasNans() == false ) )
+   {
+      ossim_int32 decimationIndex = min((ossim_int32)resLevel,
+                                        (ossim_int32)theDecimationList.size()-1);
+
+      // Compute cut rect for resLevel:
+      ossimIrect cutRect = theRectangle*theDecimationList[decimationIndex];
+
+      // Check intersection of our cut rect:
+      bool requestIntersects = rect.intersects( cutRect );
+      bool requestCompletelyWithin = rect.completely_within(cutRect);
+      
+      if ( ( ( theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE ) && requestIntersects ) ||
+           ( ( theCutType == OSSIM_RECTANGLE_NULL_INSIDE ) && !requestCompletelyWithin ) )
+      {
+         // Grab tile from the input.
+         tile = theInputConnection->getTile(rect, resLevel);
+
+         if ( tile.valid() )
+         {
+            if ( tile->getDataObjectStatus() != OSSIM_NULL &&
+                 tile->getDataObjectStatus() != OSSIM_EMPTY )
+            {
+               ossimIrect inputRectangle = tile->getImageRectangle();
+               
+               if( theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE ) // Typical case...
+               {
+                  if ( !requestCompletelyWithin )
+                  {
+                     // Clip the tile:
+                     ossim_int32 ulx = inputRectangle.ul().x;
+                     ossim_int32 uly = inputRectangle.ul().y;
+                     ossim_int32 w   = tile->getWidth();
+                     ossim_int32 h   = tile->getHeight();
+                     ossim_int32 offset = 0;
+                     ossimIpt tempPoint(ulx, uly);
+                     
+                     for(ossim_int32 y = 0;  y < h; ++tempPoint.y,++y)
+                     {
+                        tempPoint.x = ulx;
+                        for(ossim_int32 x = 0; x < w; ++tempPoint.x,++x)
+                        {
+                           if(!cutRect.pointWithin(tempPoint))
+                           {
+                              tile->setNull(offset);
+                           }
+                           ++offset;
+                        }
+                     }
+                     tile->validate();
+                  }
+               }
+               else // Null inside...
+               {
+                  // Note if complete within requested rect this block was bypassed entirely.
+                  ossim_int32 ulx = inputRectangle.ul().x;
+                  ossim_int32 uly = inputRectangle.ul().y;
+                  ossim_int32 w   = tile->getWidth();
+                  ossim_int32 h   = tile->getHeight();
+                  ossim_int32 offset = 0;
+                  ossimIpt tempPoint(ulx, uly);
+                  
+                  for(ossim_int32 y = 0;  y < h; ++tempPoint.y,++y)
+                  {
+                     tempPoint.x = ulx;
+                     for(ossim_int32 x = 0; x < w; ++tempPoint.x,++x)
+                     {
+                        if(cutRect.pointWithin(tempPoint))
+                        {
+                           tile->setNull(offset);
+                        }
+                        ++offset;
+                     }
+                  }
+                  tile->validate();
+               }
+               
+            } // Matches: if ( tile->getDataObjectStatus() ... 
+            
+         } // Matches: if ( tile.valid() )
+         
+      } // Matches: if ( ( ( theCutType == OSSI ...
+      
+   } // Matches: if ( theInputConnection && enabled && ... 
+
+   return tile;
+} // End: ossimRectangleCutFilter::getTile( ... )
+
+void ossimRectangleCutFilter::setRectangle(const ossimIrect& rect)
+{
+   theRectangle = rect;
+
+   if(theRectangle.hasNans())
+   {
+      if(theInputConnection)
+      {
+         theRectangle = theInputConnection->getBoundingRect();
+      }
+   }
+}
+
+void ossimRectangleCutFilter::getValidImageVertices(
+   vector<ossimIpt>& validVertices,
+   ossimVertexOrdering ordering,
+   ossim_uint32 /* resLevel */)const
+{
+   ossimIrect rect = getBoundingRect();
+
+   if(ordering == OSSIM_CLOCKWISE_ORDER)
+   {
+      validVertices.push_back(rect.ul());
+      validVertices.push_back(rect.ur());
+      validVertices.push_back(rect.lr());
+      validVertices.push_back(rect.ll());
+   }
+   else
+   {
+      validVertices.push_back(rect.ul());
+      validVertices.push_back(rect.ll());
+      validVertices.push_back(rect.lr());
+      validVertices.push_back(rect.ur());
+   }
+}
+
+ossimIrect ossimRectangleCutFilter::getBoundingRect(ossim_uint32 resLevel)const
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRectangleCutFilter::getBoundingRect DEBUG: entered..." << std::endl;
+   }
+   ossimIrect result;
+
+   result.makeNan();
+   if(!theInputConnection)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRectangleCutFilter::getBoundingRect DEBUG: Input connection was not valid so leaving" << std::endl;
+      }
+      return result;
+   }
+
+   result = theInputConnection->getBoundingRect(resLevel);
+   if(isSourceEnabled())
+   {
+      if(theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE)
+      {
+         ossimDpt decimation;
+         getDecimationFactor(resLevel, decimation);
+         ossimIrect cutRect = theRectangle;
+         if(!decimation.hasNans())
+         {
+            cutRect = theRectangle*decimation;
+         }
+         result = cutRect;
+      }
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRectangleCutFilter::getBoundingRect DEBUG: cut rect = " << result  << std::endl;
+   }
+   return result;
+}
+
+void ossimRectangleCutFilter::initialize()
+{
+   theDecimationList.clear();
+   if(theInputConnection)
+   {
+      getDecimationFactors(theDecimationList);
+   }
+   if(theDecimationList.empty())
+   {
+      theDecimationList.push_back(ossimDpt(1,1));
+   }
+   if(theRectangle.hasNans())
+   {
+      setRectangle(theRectangle);
+   }
+}
+
+bool ossimRectangleCutFilter::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)const
+{
+   ossimString newPrefix = prefix;
+   newPrefix+="clip_rect.";
+   
+   theRectangle.saveState(kwl, newPrefix);
+
+   if(theCutType == OSSIM_RECTANGLE_NULL_INSIDE)
+   {
+      kwl.add(prefix,
+              "cut_type",
+              "null_inside",
+              true);
+   }
+   else if(theCutType == OSSIM_RECTANGLE_NULL_OUTSIDE)
+   {
+      kwl.add(prefix,
+              "cut_type",
+              "null_outside",
+              true);      
+   }
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimRectangleCutFilter::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   ossimString newPrefix = prefix;
+   
+   ossimString rect = kwl.find(prefix, "rect");
+   if(!rect.empty())
+   {
+      theRectangle.toRect(rect);
+   }
+   else 
+   {
+      newPrefix+="clip_rect.";
+      
+      theRectangle.loadState(kwl, newPrefix.c_str());
+   }
+
+   const char* cutType = kwl.find(prefix, "cut_type");
+   if(cutType)
+   {
+      ossimString c = cutType;
+      if(c == "null_inside")
+      {
+         theCutType = OSSIM_RECTANGLE_NULL_INSIDE;
+      }
+      else if(c == "null_outside")
+      {
+         theCutType = OSSIM_RECTANGLE_NULL_OUTSIDE;         
+      }
+      else
+      {
+         theCutType = static_cast<ossimRectangleCutType>(ossimString(cutType).toLong());
+      }
+   }
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+const ossimIrect& ossimRectangleCutFilter::getRectangle()const
+{
+   return theRectangle;
+}
+
+ossimRectangleCutFilter::ossimRectangleCutType ossimRectangleCutFilter::getCutType()const
+{
+   return theCutType;
+}
+
+void ossimRectangleCutFilter::setCutType(ossimRectangleCutType cutType)
+{
+   theCutType = cutType;
+}
diff --git a/src/imaging/ossimResampler.cpp b/src/imaging/ossimResampler.cpp
new file mode 100644
index 0000000..ab2f213
--- /dev/null
+++ b/src/imaging/ossimResampler.cpp
@@ -0,0 +1,1263 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//
+// Description:
+//
+// Contains class definition for ossimResampler.
+// 
+//*******************************************************************
+//  $Id: ossimResampler.cpp 20204 2011-11-04 15:12:28Z dburken $
+
+
+#include <iostream>
+using namespace std;
+#include <ossim/imaging/ossimResampler.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimFilter.h>
+#include <ossim/imaging/ossimTilePatch.h>
+#include <ossim/imaging/ossimImageHandler.h>
+
+RTTI_DEF1(ossimResampler, "ossimResampler", ossimConnectableObject)
+
+
+static const char* RESAMPLER_CONVOLUTION_TYPE_KW = "convolution_type";
+static const char* RESAMPLER_SCALE_X_KW          = "scale_x";
+static const char* RESAMPLER_SCALE_Y_KW          = "scale_y";
+static const char* RESAMPLER_CUBIC_PARAMETER_KW  = "cubic_parameter";
+
+ossimResampler::ossimResampler()
+   :ossimConnectableObject(NULL,0,0,true, false),
+    theOutputToInputRatio(1,1),
+    theResamplerType(ossimResampler_NONE),
+    theTableWidthX(0),
+    theTableWidthY(0),
+    theTableHeight(0),
+    theKernelWidth(0),
+    theKernelHeight(0),
+    theWeightTableX(NULL),
+    theWeightTableY(NULL),
+    theCubicAdjustableParameter(-.5)
+{
+}
+
+ossimResampler::~ossimResampler()
+{
+   deleteWeightTable();
+}
+
+void ossimResampler::resample(ossimImageData* input,
+                              ossimImageData* output)
+{
+   if(!input||
+      !output ||
+      !input->getBuf() ||
+      !output->getBuf())
+   {
+      return;
+   }
+
+   if(theWeightTableX&&theWeightTableY)
+   {
+      ossimScalarType scalarType = input->getScalarType();
+      switch(scalarType)
+      {
+         case OSSIM_UINT8:
+         {
+            resampleTile(ossim_uint8(0), // dummy template variable
+                         input,
+                         output);
+            break;
+         }
+         case OSSIM_UINT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         {
+            resampleTile(ossim_uint16(0), // dummy template variable
+                         input,
+                         output);
+            break;
+         }
+         case OSSIM_SSHORT16:
+         {
+            resampleTile(ossim_sint16(0), // dummy template variable
+                         input,
+                         output);
+            break;
+         }      
+         case OSSIM_UINT32:
+         {
+            resampleTile(ossim_uint32(0), // dummy template variable
+                         input,
+                         output);
+            break;
+         }      
+         case OSSIM_FLOAT32:
+         case OSSIM_NORMALIZED_FLOAT:
+         {
+            resampleTile(ossim_float32(0.0), // dummy template variable
+                         input,
+                         output);
+            break;
+         }
+         case OSSIM_FLOAT64:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            resampleTile(ossim_float64(0.0), // dummy template variable
+                         input,
+                         output);
+            break;
+         }
+         default:
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimResampler::resample error: unknown scalar type:  "
+               << scalarType
+               << endl;
+            
+         }
+      }
+   }      
+   // convolve the input and copy to output.
+}
+
+void ossimResampler::resample(ossimImageData* input,
+                              ossimImageData* output,
+                              const ossimDpt& ul,
+                              const ossimDpt& ur,
+                              const ossimDpt& deltaUl,
+                              const ossimDpt& deltaUr,
+                              const ossimDpt& length)
+{
+   resample(input,
+            output,
+            output->getImageRectangle(),
+            ul,
+            ur,
+            deltaUl,
+            deltaUr,
+            length);
+}
+
+void ossimResampler::resample(ossimImageData* input,
+                              ossimImageData* output,
+                              const ossimIrect& outputSubRect,
+                              const ossimDpt& ul,
+                              const ossimDpt& ur,
+                              const ossimDpt& deltaUl,
+                              const ossimDpt& deltaUr,
+                              const ossimDpt& length)
+{
+   if(!input||
+      !output ||
+      !input->getBuf() ||
+      !output->getBuf())
+   {
+      return;
+   }
+   
+   if(theWeightTableX&&theWeightTableY)
+   {
+      ossimScalarType scalarType = input->getScalarType();
+      switch(scalarType)
+      {
+         case OSSIM_UINT8:
+         {
+            resampleTile(ossim_uint8(0), // dummy template variable
+                         input,
+                         output,
+                         outputSubRect,
+                         ul,
+                         ur,
+                         deltaUl,
+                         deltaUr,
+                         length);
+            break;
+         }
+         case OSSIM_UINT16:
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         {
+            resampleTile(ossim_uint16(0), // dummy template variable
+                         input,
+                         output,
+                         outputSubRect,
+                         ul,
+                         ur,
+                         deltaUl,
+                         deltaUr,
+                         length);
+            break;
+         }
+         case OSSIM_SINT16:
+         {
+            resampleTile(ossim_sint16(0), // dummy template variable
+                         input,
+                         output,
+                         outputSubRect,
+                         ul,
+                         ur,
+                         deltaUl,
+                         deltaUr,
+                         length);
+            break;
+         }      
+         case OSSIM_UINT32:
+         {
+            resampleTile(ossim_uint32(0), // dummy template variable
+                         input,
+                         output,
+                         outputSubRect,
+                         ul,
+                         ur,
+                         deltaUl,
+                         deltaUr,
+                         length);
+            break;
+         }      
+         case OSSIM_FLOAT32:
+         case OSSIM_NORMALIZED_FLOAT:
+         {
+            resampleTile(ossim_float32(0.0), // dummy template variable
+                         input,
+                         output,
+                         outputSubRect,
+                         ul,
+                         ur,
+                         deltaUl,
+                         deltaUr,
+                         length);
+            break;
+         }
+         case OSSIM_FLOAT64:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            resampleTile(ossim_float64(0.0), // dummy template variable
+                         input,
+                         output,
+                         outputSubRect,
+                         ul,
+                         ur,
+                         deltaUl,
+                         deltaUr,
+                         length);
+            break;
+         }
+         default:
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimResampler::resample error: unknown scalar type:  "
+               << scalarType
+               << endl;
+         }
+      }
+   }
+   
+}
+
+void ossimResampler::resampleNearestNeighbor(ossimImageData* input,
+                                             ossimImageData* output,
+                                             const ossimIrect& outputSubRect,
+                                             const ossimDpt& ul,
+                                             const ossimDpt& ur,
+                                             const ossimDpt& deltaUl,
+                                             const ossimDpt& deltaUr,
+                                             const ossimDpt& length)
+{
+   if(!input||
+      !output ||
+      !input->getBuf() ||
+      !output->getBuf())
+   {
+      return;
+   }
+   
+   ossimScalarType scalarType = input->getScalarType();
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      {
+         resampleTileNearestNeighbor(ossim_uint8(0),// dummy template variable
+                                     input,
+                                     output,
+                                     outputSubRect,
+                                     ul,
+                                     ur,
+                                     deltaUl,
+                                     deltaUr,
+                                     length);
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         resampleTileNearestNeighbor(ossim_uint16(0),// dummy template variable
+                                     input,
+                                     output,
+                                     outputSubRect,
+                                     ul,
+                                     ur,
+                                     deltaUl,
+                                     deltaUr,
+                                     length);
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         resampleTileNearestNeighbor(ossim_sint16(0),// dummy template variable
+                                     input,
+                                     output,
+                                     outputSubRect,
+                                     ul,
+                                     ur,
+                                     deltaUl,
+                                     deltaUr,
+                                     length);
+         break;
+      }      
+      case OSSIM_UINT32:
+      {
+         resampleTileNearestNeighbor(ossim_uint32(0),// dummy template variable
+                                     input,
+                                     output,
+                                     outputSubRect,
+                                     ul,
+                                     ur,
+                                     deltaUl,
+                                     deltaUr,
+                                     length);
+         break;
+      }      
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         resampleTileNearestNeighbor(ossim_float32(0.0),
+                                     input,
+                                     output,
+                                     outputSubRect,
+                                     ul,
+                                     ur,
+                                     deltaUl,
+                                     deltaUr,
+                                     length);
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         resampleTileNearestNeighbor(ossim_float64(0.0),
+                                     input,
+                                     output,
+                                     outputSubRect,
+                                     ul,
+                                     ur,
+                                     deltaUl,
+                                     deltaUr,
+                                     length);
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimResampler::resample error: unknown scalar type:  "
+            << scalarType
+            << endl;
+      }
+   }   
+}
+
+void ossimResampler::resampleNearestNeighbor(ossimImageData* input,
+                                             ossimImageData* output,
+                                             const ossimDpt& ul,
+                                             const ossimDpt& ur,
+                                             const ossimDpt& deltaUl,
+                                             const ossimDpt& deltaUr,
+                                             const ossimDpt& length)
+{
+   resampleNearestNeighbor(input,
+                           output,
+                           output->getImageRectangle(),
+                           ul,
+                           ur,
+                           deltaUl,
+                           deltaUr,
+                           length);
+}
+
+
+template <class T>
+void ossimResampler::resampleTile(T,// not used
+                                  ossimImageData* input,
+                                  ossimImageData* output)
+{
+   switch(input->getDataObjectStatus())
+   {
+      case OSSIM_FULL:
+      {
+         resampleFullTile((T)0, input, output);
+         break;
+      }
+      case OSSIM_PARTIAL:
+      {      
+         resamplePartialTile((T)0, input, output);
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+}
+
+template <class T>
+void ossimResampler::resamplePartialTile(T,// not used
+                                         ossimImageData* input,
+                                         ossimImageData* output)
+{   
+   ossim_int32 maxInputSize  = std::max(input->getWidth(),  input->getHeight());
+   ossim_int32 maxOutputSize = std::max(output->getWidth(), output->getHeight());
+   ossim_int32 k;
+   double *h  = new double[maxInputSize];
+   int    *Lx = new int[maxOutputSize];
+   int    *Ly = new int[maxOutputSize];
+   ossim_int32 out_height = output->getHeight();
+   ossim_int32 out_width  = output->getWidth();
+   ossim_int32 in_width   = input->getWidth();
+   ossim_int32 in_height  = input->getHeight();
+   ossim_int32 j;
+   ossim_int32 l;
+
+   ossimIpt origin=output->getOrigin();
+   ossimIpt scaledOriginShift(input->getOrigin()*-1);
+
+   ossim_int32 evenKernelW = (ossim_int32)(!(theKernelWidth%2));
+   ossim_int32 evenKernelH = (ossim_int32)(!(theKernelHeight%2));
+   ossim_int32 kernelHorizontalShift = (ossim_int32)(-theKernelWidth/2.0+evenKernelW);
+   ossim_int32 kernelVerticalShift   = (ossim_int32)(-theKernelHeight/2.0+evenKernelH);
+   
+   for (k = 0; k < maxOutputSize; k++)
+   {
+      Lx[k] = (ossim_int32)(scaledOriginShift.x+((k+origin.x)/
+                                           theOutputToInputRatio.x));
+   }
+   for (k = 0; k < maxOutputSize; k++)
+   {
+      Ly[k] = (ossim_int32)(scaledOriginShift.y+((k+origin.y)/
+                                           theOutputToInputRatio.y));
+   }
+   for(ossim_int32 band = 0; band < (ossim_int32)input->getNumberOfBands();++band)
+   {
+      const T* inputBuf  = static_cast<T*>(input->getBuf(band));
+      T*       outputBuf = static_cast<T*>(output->getBuf(band));
+      T        minPix    = static_cast<T>(input->getMinPix(band));
+      T        maxPix    = static_cast<T>(input->getMaxPix(band));
+      T        np        = static_cast<T>(input->getNullPix(band));
+      
+      for (k = 0; k < out_height; k++)
+      {
+         ossim_int32 indexMod = (ossim_int32)fmod((k+origin.y), theOutputToInputRatio.y);
+         if(indexMod >= theTableWidthY) indexMod = theTableWidthY - 1;
+         if(indexMod <0) indexMod = 0;
+         for (j = 0; j < in_width; j++)
+         {
+            h[j] = 0.0;
+            ossim_int32 count = 0;
+            double lastValue = ossim::nan();
+            for (l = 0; l < theKernelHeight; l++)
+            {
+               ossim_int32 index = Ly[k] + l + kernelVerticalShift;
+               if ((index >= 0) && (index < in_height))
+               {
+                  ossim_int32 offset = index*in_width +j;
+                  if(!input->isNull(offset))
+                  {
+                     lastValue = (double)inputBuf[offset];
+                     h[j] += lastValue *
+                             theWeightTableY[theKernelHeight - l-1][indexMod];
+                     ++count;
+                  }
+                  // I think instead of skipping to next value I'll just assume 0
+                  
+                  // this was code to skip to next non-null value and use it
+                  // 
+//                   else
+//                   {
+//                      for(ossim_int32 templ = l; templ < theKernelHeight; ++templ)
+//                      {
+//                         index = Ly[k] + templ + kernelVerticalShift;
+//                         offset = index*in_width +j;
+//                         if(!input->isNull(offset))
+//                         {
+//                            lastValue = (double)inputBuf[offset];
+//                            break;
+//                         }
+//                      }
+//                      if(ossim::isnan(lastValue) == false)
+//                      {
+//                         h[j] += lastValue *
+//                                 theWeightTableY[theKernelHeight - l-1][indexMod];
+                        
+//                         ++count;
+//                      }
+//                      else
+//                      {
+//                         break;
+//                      }
+//                   }
+               }
+            }
+            if(!count)
+            {
+               h[j] = ossim::nan();
+            }
+         }
+         for (ossim_int32 m = 0; m < out_width; m++)
+         {
+            double x = 0.0;
+            ossim_int32 indexMod = (ossim_int32)fmod((m+origin.x), theOutputToInputRatio.x);
+            if(indexMod >= theTableWidthX) indexMod = theTableWidthX-1;
+            if(indexMod <0) indexMod = 0;
+            
+            if(input->isNull(ossimIpt(Lx[m]-scaledOriginShift.x, Ly[k]-scaledOriginShift.y)))
+            {
+               outputBuf[k*out_width +m] = np;
+            }
+            else
+            {
+               for (l = 0; l < theKernelWidth; l++)
+               {
+                  ossim_int32 index = Lx[m] + l + kernelHorizontalShift;
+                  if ((index >= 0) && (index < in_width))
+                  {
+                     if(ossim::isnan(h[index]) == false)
+                     {
+                        x += h[index] * theWeightTableX[theKernelWidth - l-1][indexMod];
+                     }
+
+                     // I am commenting out the code that searches for the next
+                     // non null value with the kernel range.  This will have the
+                     // same effect as multiplying by 0.0 for the NULL value.
+                     //
+//                      else
+//                      {
+//                         for(ossim_int32 templ = l; templ < l; ++templ)
+//                         {
+//                            ossim_int32 index = Lx[m] + templ + kernelHorizontalShift;
+//                            if(ossim::isnan(h[index]) == false))
+//                            {
+//                               lastValue = h[index];
+//                               break;
+//                            }
+//                         }
+//                         if(ossim::isnan(lastValue) == false)
+//                         {
+//                            x += lastValue * theWeightTableX[theKernelWidth - l-1][indexMod];
+//                         }
+//                      }
+                  }
+               }
+               if (x < minPix)
+               {
+                  outputBuf[k*out_width +m] = static_cast<T>(minPix);
+               }
+               else if (x > maxPix)
+               {
+                  outputBuf[k*out_width +m] = static_cast<T>(maxPix);
+               }
+               else
+               {
+                  outputBuf[k*out_width +m] = static_cast<T>(x);
+               }
+            }
+         }
+      }
+   }
+   
+   delete [] h;
+   delete [] Lx;   
+   delete [] Ly;
+}
+
+template <class T>
+void ossimResampler::resampleFullTile(T,// not used
+                                      ossimImageData* input,
+                                      ossimImageData* output)
+{
+   ossim_int32 maxInputSize  = std::max(input->getWidth(),  input->getHeight());
+   ossim_int32 maxOutputSize = std::max(output->getWidth(), output->getHeight());
+   ossim_int32 k;
+   double *h     = new double[maxInputSize];
+   ossim_int32 *Lx        = new ossim_int32[maxOutputSize];
+   ossim_int32 *Ly        = new ossim_int32[maxOutputSize];
+   ossim_int32 out_height = output->getHeight();
+   ossim_int32 out_width  = output->getWidth();
+   ossim_int32 in_width   = input->getWidth();
+   ossim_int32 in_height  = input->getHeight();
+   ossim_int32 j;
+   ossim_int32 l;
+   
+   ossimIpt origin=output->getOrigin();
+   ossimIpt scaledOriginShift(input->getOrigin()*-1);
+
+   ossim_int32 evenKernelW = (ossim_int32)(!(theKernelWidth%2));
+   ossim_int32 evenKernelH = (ossim_int32)(!(theKernelHeight%2));
+   ossim_int32 kernelHorizontalShift = (ossim_int32)(-theKernelWidth/2.0+evenKernelW);
+   ossim_int32 kernelVerticalShift   = (ossim_int32)(-theKernelHeight/2.0+evenKernelH);
+   
+   for (k = 0; k < maxOutputSize; k++)
+   {
+      Lx[k] = (ossim_int32)(scaledOriginShift.x+((k+origin.x)/
+                                           theOutputToInputRatio.x));
+   }
+   for (k = 0; k < maxOutputSize; k++)
+   {
+      Ly[k] = (ossim_int32)(scaledOriginShift.y+((k+origin.y)/
+                                           theOutputToInputRatio.y));
+   }
+   for(ossim_int32 band = 0; band < (ossim_int32)input->getNumberOfBands();++band)
+   {
+      const T* inputBuf  = (const T*)(input->getBuf(band));
+      T*       outputBuf = (T*)(output->getBuf(band));
+      double  minPix    = static_cast<T>(input->getMinPix()[band]);
+      double  maxPix    = static_cast<T>(input->getMaxPix()[band]);
+      
+      for (k = 0; k < out_height; k++)
+      {
+         int indexMod = (int)fmod((k+origin.y), theOutputToInputRatio.y);
+         if(indexMod >= theTableWidthY) indexMod = theTableWidthY - 1;
+         if(indexMod <0) indexMod = 0;
+         for (j = 0; j < in_width; j++)
+         {
+            h[j] = 0.0;
+            for (l = 0; l < theKernelHeight; l++)
+            {
+               ossim_int32 index = Ly[k] + l + kernelVerticalShift;
+               if ((index >= 0) && (index < in_height))
+               {
+                  h[j] += ((double)inputBuf[index*in_width +j]) *
+                          theWeightTableY[theKernelHeight - l-1][indexMod];
+               }
+            }
+         }
+         for (ossim_int32 m = 0; m < out_width; m++)
+         {
+            double x = 0.0;
+            int indexMod = (int)fmod((m+origin.x), theOutputToInputRatio.x);
+            if(indexMod >= theTableWidthX) indexMod = theTableWidthX-1;
+            if(indexMod <0) indexMod = 0;
+            
+            for (l = 0; l < theKernelWidth; l++)
+            {
+               ossim_int32 index = Lx[m] + l + kernelHorizontalShift;
+               if ((index >= 0) && (index < in_width))
+               {
+         
+                  x += h[index] * theWeightTableX[theKernelWidth - l-1][indexMod];
+               }
+            }
+            if (x < minPix)
+            {
+               outputBuf[k*out_width +m] = static_cast<T>(minPix);
+            }
+            else if (x > maxPix)
+            {
+               outputBuf[k*out_width +m] = static_cast<T>(maxPix);
+            }
+            else
+            {
+               outputBuf[k*out_width +m] = static_cast<T>(x);
+            }
+         }
+      }
+   }
+   
+   delete [] h;
+   delete [] Lx;   
+   delete [] Ly;
+}
+
+
+
+template <class T>
+void ossimResampler::resampleTile(T,// not used
+                                  ossimImageData* input,
+                                  ossimImageData* output,
+                                  const ossimIrect& outputSubRect,
+                                  const ossimDpt& inputUl,
+                                  const ossimDpt& inputUr,
+                                  const ossimDpt& deltaUl,
+                                  const ossimDpt& deltaUr,
+                                  const ossimDpt& outLength)
+{
+   ossimRefPtr<ossimImageData> dupIn = input;
+   ossimDpt origin = input->getOrigin();
+   ossimDpt newInputUl = inputUl;
+   ossimDpt newInputUr = inputUr;
+   ossimDpt newDeltaUl = deltaUl;
+   ossimDpt newDeltaUr = deltaUr;
+
+   if(theResamplerType != ossimResampler_NEAREST_NEIGHBOR)
+   {
+      newInputUl = ossimDpt(inputUl.x * theOutputToInputRatio.x,
+                            inputUl.y * theOutputToInputRatio.y);
+      newInputUr = ossimDpt(inputUr.x * theOutputToInputRatio.x,
+                            inputUr.y * theOutputToInputRatio.y);
+      newDeltaUl = ossimDpt(deltaUl.x * theOutputToInputRatio.x,
+                            deltaUl.y * theOutputToInputRatio.y);
+      newDeltaUr = ossimDpt(deltaUr.x * theOutputToInputRatio.x,
+                            deltaUr.y * theOutputToInputRatio.y);
+
+      ossimDpt newLl = newInputUl + newDeltaUl*outLength.y;
+      ossimDpt newLr = newInputUr + newDeltaUr*outLength.y;
+      
+      ossimDrect newBoundingRect(newInputUl,
+                                 newInputUr,
+                                 newLl,
+                                 newLr);
+      
+
+      newBoundingRect = ossimDrect(newBoundingRect.ul() - ossimDpt(theKernelWidth, theKernelHeight),
+                                   newBoundingRect.lr() + ossimDpt(theKernelWidth, theKernelHeight));
+      ossimIrect roundedRect = newBoundingRect;
+      origin = roundedRect.ul();
+
+      dupIn = new ossimImageData(NULL,
+                                 input->getScalarType(),
+                                 input->getNumberOfBands(),
+                                 roundedRect.width(),
+                                 roundedRect.height());
+      dupIn->setOrigin(roundedRect.ul());
+      dupIn->initialize();
+      resampleTile(static_cast<T>(0), input, dupIn.get());
+   }
+   long    inWidth        = dupIn->getWidth();
+   long    inHeight       = dupIn->getHeight();
+   double  stepSizeWidth  = 1.0/outLength.x;
+   double  stepSizeHeight = 1.0/outLength.y;   
+   ossimIrect rect = dupIn->getImageRectangle();
+   
+   ossimDpt startSave(newInputUl.x - rect.ul().x,
+                      newInputUl.y - rect.ul().y );
+   ossimDpt endSave(newInputUr.x - rect.ul().x,
+                    newInputUr.y - rect.ul().y);
+
+   ossimIrect outputRect = output->getImageRectangle();
+   ossimIpt subRectUl = outputSubRect.ul();
+   long     subRectH  = outputSubRect.height();
+   long     subRectW  = outputSubRect.width();
+   
+   ossimIpt outputRectUl    = outputRect.ul();
+   long outputRectW         = outputRect.width();
+   long resultOffset = (subRectUl.y - outputRectUl.y)*outputRectW + (subRectUl.x - outputRectUl.x);
+
+   for(ossim_uint32 band = 0; band < input->getNumberOfBands(); band++)
+   {
+      T* resultBuf       = static_cast<T*>(output->getBuf(band))+resultOffset;
+      const T *sourceBuf = static_cast<T*>(dupIn->getBuf(band));
+      ossimDpt start = startSave;
+      ossimDpt end   = endSave;
+      T np = (T)output->getNullPix(band);
+                        
+      for(long y = 0; y < subRectH; y++)
+      {
+         double deltaX = (end.x - start.x)*stepSizeWidth;
+         double deltaY = (end.y - start.y)*stepSizeHeight;
+         ossimDpt pointXY = start;
+         
+         for(long x = 0; x < subRectW; x++)
+         {
+            int xPixel = pointXY.x<0?(int)floor(pointXY.x):(int)pointXY.x;
+            int yPixel = pointXY.y<0?(int)floor(pointXY.y):(int)pointXY.y;
+
+            
+            if( (xPixel >=0) && (xPixel < inWidth) &&
+                (yPixel >=0) && (yPixel < inHeight))
+            {
+               resultBuf[x] = sourceBuf[yPixel*inWidth + xPixel];
+            }
+            else
+            {
+               resultBuf[x] = np;
+            }
+            
+            pointXY.y += deltaY;
+            pointXY.x += deltaX;
+         }
+         resultBuf += outputRectW;
+         
+         start.x += newDeltaUl.x;
+         start.y += newDeltaUl.y;
+         end.x   += newDeltaUr.x;
+         end.y   += newDeltaUr.y;
+      }
+   }
+   dupIn = 0;
+}
+
+template <class T>
+void ossimResampler::resampleTileNearestNeighbor(T, // dummy template variable
+                                                 ossimImageData* input,
+                                                 ossimImageData* output,
+                                                 const ossimDpt& ul,
+                                                 const ossimDpt& ur,
+                                                 const ossimDpt& deltaUl,
+                                                 const ossimDpt& deltaUr,
+                                                 const ossimDpt& length)
+{
+   resampleTileNearestNeighbor((T)0,
+                               input,
+                               output,
+                               output->getImageRectangle(),
+                               ul,
+                               ur,
+                               deltaUl,
+                               deltaUr,
+                               length);
+}
+
+template <class T>
+void ossimResampler::resampleTileNearestNeighbor(T, // dummy template variable
+                                                 ossimImageData* input,
+                                                 ossimImageData* output,
+                                                 const ossimIrect& outputSubRect,
+                                                 const ossimDpt& ul,
+                                                 const ossimDpt& ur,
+                                                 const ossimDpt& deltaUl,
+                                                 const ossimDpt& deltaUr,
+                                                 const ossimDpt& length)
+{   
+   long    inWidth        = input->getWidth();
+   long    inHeight       = input->getHeight();
+   double  stepSizeWidth  = 1.0/length.x;
+   double  stepSizeHeight = 1.0/length.y;
+   ossimIrect rect        = input->getImageRectangle();
+   
+   ossimDpt startSave(ul.x - rect.ul().x,
+                      ul.y - rect.ul().y );
+   
+   ossimDpt endSave(ur.x - rect.ul().x,
+                    ur.y - rect.ul().y);
+
+   ossimIrect outputRect = output->getImageRectangle();
+   ossimIpt subRectUl = outputSubRect.ul();
+//   ossimIpt subRectUl((int)outputSubRect.ul().x,
+//                      (int)outputSubRect.ul().y);
+   long     subRectH  = outputSubRect.height();
+   long     subRectW  = outputSubRect.width();
+   
+   ossimIpt outputRectUl    = outputRect.ul();
+   long outputRectW         = outputRect.width();
+
+   long resultOffset = (subRectUl.y - outputRectUl.y)*outputRectW + (subRectUl.x - outputRectUl.x);
+   for(ossim_uint32 band = 0; band < input->getNumberOfBands(); band++)
+   {
+      T* resultBuf       = static_cast<T*>(output->getBuf(band))+resultOffset;
+      const T *sourceBuf = static_cast<T*>(input->getBuf(band));
+      ossimDpt start = startSave;
+      ossimDpt end   = endSave;
+      T inNp  = (T)input->getNullPix(band);
+      T outNp = (T)output->getNullPix(band);
+                        
+      for(long y = 0; y < subRectH; y++)
+      {
+         double deltaX = (end.x - start.x)*stepSizeWidth;
+         double deltaY = (end.y - start.y)*stepSizeHeight;
+         ossimDpt pointXY = start;
+         
+         for(long x = 0; x < subRectW; x++)
+         {
+            int xPixel = pointXY.x<0?(int)floor(pointXY.x):(int)pointXY.x;
+            int yPixel = pointXY.y<0?(int)floor(pointXY.y):(int)pointXY.y;
+
+            
+             if( (xPixel >=0) && (xPixel < inWidth) &&
+                 (yPixel >=0) && (yPixel < inHeight))
+             {
+                T value = sourceBuf[yPixel*inWidth + xPixel];
+
+                if(value != inNp)
+                {
+                   resultBuf[x] = value;
+                }
+                else
+                {
+                   resultBuf[x] = outNp;
+                }
+            }
+            else
+            {
+               resultBuf[x] = outNp;
+            }
+            
+            pointXY.y += deltaY;
+            pointXY.x += deltaX;
+         }
+         resultBuf += outputRectW;
+         
+         start.x += deltaUl.x;
+         start.y += deltaUl.y;
+         end.x   += deltaUr.x;
+         end.y   += deltaUr.y;
+      }
+   }
+}
+
+ossim_int32 ossimResampler::getKernelWidth()const
+{
+   return theKernelWidth;
+}
+
+ossim_int32 ossimResampler::getKernelHeight()const
+{
+   return theKernelHeight;
+}
+
+void ossimResampler::deleteWeightTable()
+{
+   if(theWeightTableX)
+   {
+      for(ossim_int32 index = 0; index < theTableHeight; ++index)
+      {
+         delete [] theWeightTableX[index];
+      }
+      delete [] theWeightTableX;
+
+      theWeightTableX = NULL;
+   }
+   if(theWeightTableY)
+   {
+      for(ossim_int32 index = 0; index < theTableHeight; ++index)
+      {
+         delete [] theWeightTableY[index];
+      }
+      delete [] theWeightTableY;
+
+      theWeightTableY = NULL;
+   }
+}
+
+void ossimResampler::allocateWeightTable()//uint32 outWidth)
+{
+   if(theWeightTableX||
+      theWeightTableY)
+   {
+      deleteWeightTable();
+   }
+   
+   switch(theResamplerType)
+   {
+   case ossimResampler_BICUBIC:
+   {
+      theTableHeight = 4;
+      break;
+   }
+   case ossimResampler_BILINEAR:
+   {
+      theTableHeight = 2;
+      break;
+   }
+   case ossimResampler_NEAREST_NEIGHBOR:
+   {
+      theTableHeight = 1;
+      break;
+   }
+   case ossimResampler_NONE:
+     {
+       theResamplerType = ossimResampler_NEAREST_NEIGHBOR;
+      theTableHeight = 1;
+      break;
+     }
+   }
+   theTableWidthX = (ossim_int32)ossim::round<int>(theOutputToInputRatio.x);
+   theTableWidthY = (ossim_int32)ossim::round<int>(theOutputToInputRatio.y);
+   if(theTableWidthX&&theTableHeight)
+   {
+      theWeightTableX = new double*[theTableHeight];
+      
+      for(ossim_int32 index = 0; index < theTableHeight; ++index)
+      {
+         theWeightTableX[index] = new double[theTableWidthX];
+      }
+   }
+   if(theTableWidthY&&theTableHeight)
+   {
+      theWeightTableY = new double*[theTableHeight];
+      
+      for(ossim_int32 index = 0; index < theTableHeight; ++index)
+      {
+         theWeightTableY[index] = new double[theTableWidthY];
+      }
+   }
+}
+
+void ossimResampler::generateWeightTable()
+{
+   if(theWeightTableX&&
+      theWeightTableY)
+   {
+//      ossim_int32 d = theOutputToInputRatio.theDen;
+//      ossim_int32 n = theOutputToInputRatio.theNum;
+      ossim_int32 i = 0;
+      
+      double x = 0.0;
+      
+      switch(theResamplerType)
+      {
+   case ossimResampler_NONE:
+     {
+       theResamplerType = ossimResampler_NEAREST_NEIGHBOR;
+       for (i = 0; i < theTableWidthY; i++)
+         {
+	   theWeightTableY[0][i] = 1;
+         }
+       for (i = 0; i < theTableWidthX; i++)
+         {
+	   theWeightTableX[0][i] = 1;
+         }
+      break;
+     }
+      case ossimResampler_NEAREST_NEIGHBOR:
+      {         
+         for (i = 0; i < theTableWidthY; i++)
+         {
+            theWeightTableY[0][i] = 1;
+         }
+         for (i = 0; i < theTableWidthX; i++)
+         {
+            theWeightTableX[0][i] = 1;
+         }
+         break;
+      }
+      case ossimResampler_BILINEAR:
+      {
+         for (i = 0; i < theTableWidthX; i++)
+         {
+            x = (double)i/(double)(theTableWidthX);
+            theWeightTableX[0][i] = x;
+            theWeightTableX[1][i] = 1-x;
+         }
+         for (i = 0; i < theTableWidthY; i++)
+         {
+            x = (double)i/(double)(theTableWidthY);
+            theWeightTableY[0][i] = x;
+            theWeightTableY[1][i] = 1-x;
+         }
+         break;
+      }
+      case ossimResampler_BICUBIC:
+      {         
+         for (i = 0; i < theTableWidthX; i++)
+         {
+            x = (double)i/(double)(theTableWidthX);
+            theWeightTableX[0][i] = getCubicC0(x);
+            theWeightTableX[1][i] = getCubicC1(x);
+            theWeightTableX[2][i] = getCubicC2(x);
+            theWeightTableX[3][i] = getCubicC3(x);               
+         }
+         for (i = 0; i < theTableWidthY; i++)
+         {
+            x = (double)i/(double)(theTableWidthY);
+            theWeightTableY[0][i] = getCubicC0(x);
+            theWeightTableY[1][i] = getCubicC1(x);
+            theWeightTableY[2][i] = getCubicC2(x);
+            theWeightTableY[3][i] = getCubicC3(x);               
+         }
+         break;
+      }
+      }
+   }
+}
+
+void ossimResampler::setResamplerType(ossimResLevelResamplerType type)
+{
+   if(theResamplerType != type)
+   {
+      theResamplerType = type;
+      
+      switch(theResamplerType)
+      {
+      case ossimResampler_NONE:
+      {
+	theResamplerType = ossimResampler_NEAREST_NEIGHBOR;
+         theKernelWidth  = 1;
+         theKernelHeight = 1;
+
+         break;
+      }
+      case ossimResampler_NEAREST_NEIGHBOR:
+      {
+         theKernelWidth  = 1;
+         theKernelHeight = 1;
+
+         break;
+      }
+      case ossimResampler_BILINEAR:
+      {
+         theKernelWidth  = 2;
+         theKernelHeight = 2;
+
+         break;
+      }
+      case ossimResampler_BICUBIC:
+      {
+         theKernelWidth  = 4;
+         theKernelHeight = 4;
+         
+         break;
+      }
+      }
+      
+      allocateWeightTable();
+      generateWeightTable();
+   }
+}
+
+void ossimResampler::setRatio(double outputToInputRatio)
+{
+   // make it square
+   setRatio(ossimDpt(outputToInputRatio, outputToInputRatio));
+}
+
+void ossimResampler::setRatio(const ossimDpt& outputToInputRatio)
+{
+   // make it square
+   theOutputToInputRatio.x = (outputToInputRatio.x);
+   theOutputToInputRatio.y = (outputToInputRatio.y);
+
+   if((theTableWidthX != ossim::round<int>(outputToInputRatio.x))||
+      (theTableWidthY != ossim::round<int>(outputToInputRatio.y)))
+   {
+      allocateWeightTable();
+      generateWeightTable();
+   }
+}
+
+double ossimResampler::getCubicC0(double t)const
+{
+   return ((-theCubicAdjustableParameter * t * t * t) +
+           (theCubicAdjustableParameter * t * t));
+}
+
+double ossimResampler::getCubicC1(double t)const
+{
+   return (-(theCubicAdjustableParameter + 2.0) * t * t * t +
+           (2.0 * theCubicAdjustableParameter + 3.0) * t * t -
+           theCubicAdjustableParameter * t);
+}
+
+double ossimResampler::getCubicC2(double t)const
+{
+   return ((theCubicAdjustableParameter + 2.0) * t * t * t -
+           (theCubicAdjustableParameter + 3.0) * t * t + 1.0);
+}
+
+double ossimResampler::getCubicC3(double t)const
+{
+   return ((theCubicAdjustableParameter * t * t * t) -
+           (2.0f * theCubicAdjustableParameter * t * t) +
+           (theCubicAdjustableParameter * t));
+}
+
+bool ossimResampler::loadState(const ossimKeywordlist& kwl,
+                               const char* prefix)
+{   
+   const char* resamplerType = kwl.find(prefix, RESAMPLER_CONVOLUTION_TYPE_KW);
+   const char* scaleX        = kwl.find(prefix, RESAMPLER_SCALE_X_KW);
+   const char* scaleY        = kwl.find(prefix, RESAMPLER_SCALE_Y_KW);
+   const char* cubicParameter= kwl.find(prefix, RESAMPLER_CUBIC_PARAMETER_KW);
+   
+   if(cubicParameter)
+   {
+      theCubicAdjustableParameter = ossimString(cubicParameter).toDouble();
+      if(theCubicAdjustableParameter < -1) theCubicAdjustableParameter = -1;
+      if(theCubicAdjustableParameter > 0)  theCubicAdjustableParameter = 0;
+   }
+   else
+   {
+      theCubicAdjustableParameter = -.5;
+   }
+   if(resamplerType)
+   {
+      ossimString test =ossimString(resamplerType).upcase().trim();
+      
+      if( test == "BICUBIC")
+      {
+         setResamplerType(ossimResampler::ossimResampler_BICUBIC);
+      }
+      else if( test == "BILINEAR")
+      {
+         setResamplerType(ossimResampler::ossimResampler_BILINEAR);
+      }
+      else
+      {
+         setResamplerType(ossimResampler::ossimResampler_NEAREST_NEIGHBOR);
+      }
+   }
+   if(scaleX&&scaleY)
+   {
+      setRatio(ossimDpt(ossimString(scaleX).toDouble(),
+                        ossimString(scaleY).toDouble()));
+   }
+   allocateWeightTable();
+   generateWeightTable();
+   
+   return ossimConnectableObject::loadState(kwl, prefix);
+}
+
+bool ossimResampler::saveState(ossimKeywordlist& kwl,
+                               const char* prefix)const
+{
+   ossimString resamplerType;
+   if(getResamplerType() == ossimResampler_BICUBIC)
+   {
+      resamplerType = "BICUBIC";
+   }
+   else if(getResamplerType() == ossimResampler_BILINEAR)
+   {
+      resamplerType = "BILINEAR";
+   }
+   else 
+   {
+      resamplerType = "NEAREST_NEIGHBOR";
+   }
+   kwl.add(prefix,
+           RESAMPLER_CONVOLUTION_TYPE_KW,
+           resamplerType.c_str(),
+           true);
+
+   kwl.add(prefix,
+           RESAMPLER_SCALE_X_KW,
+           theOutputToInputRatio.x,
+           true);
+
+   kwl.add(prefix,
+           RESAMPLER_SCALE_Y_KW,
+           theOutputToInputRatio.y,
+           true);
+
+   kwl.add(prefix,
+           RESAMPLER_CUBIC_PARAMETER_KW,
+           theCubicAdjustableParameter,
+           true);
+   
+   return ossimConnectableObject::saveState(kwl, prefix);
+}
diff --git a/src/imaging/ossimRgbGridRemapEngine.cpp b/src/imaging/ossimRgbGridRemapEngine.cpp
new file mode 100644
index 0000000..2ce2923
--- /dev/null
+++ b/src/imaging/ossimRgbGridRemapEngine.cpp
@@ -0,0 +1,271 @@
+//*****************************************************************************
+// FILE: ossimRgbGridRemapEngine.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class 
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimRgbGridRemapEngine.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+
+#include <ossim/imaging/ossimRgbGridRemapEngine.h>
+
+RTTI_DEF1(ossimRgbGridRemapEngine, "ossimRgbGridRemapEngine",
+          ossimGridRemapEngine);
+
+#include <ossim/imaging/ossimGridRemapSource.h>
+#include <ossim/imaging/ossimAtbPointSource.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDblGrid.h>
+#include <ossim/imaging/ossimImageData.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimRgbGridRemapEngine:exec");
+static ossimTrace traceDebug ("ossimRgbGridRemapEngine:debug");
+
+//*****************************************************************************
+//  METHOD: ossimRgbGridRemapEngine::dup
+//  
+//*****************************************************************************
+ossimObject* ossimRgbGridRemapEngine::dup() const
+{
+   return new ossimRgbGridRemapEngine;
+}
+
+//*****************************************************************************
+//  METHOD: ossimRgbGridRemapEngine::remapTile
+//  
+//*****************************************************************************
+void ossimRgbGridRemapEngine::remapTile(const ossimDpt&       origin,
+                                        ossimGridRemapSource* remapper,
+                                        ossimRefPtr<ossimImageData>& tile)
+{
+   static const char MODULE[] = "ossimRgbGridRemapEngine::remapTile";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // Fetch tile size and NULL pixel value:
+   //***
+   int    width         = tile->getWidth();
+   int    height        = tile->getHeight();
+   int    offset        = 0;
+   double null[3];
+
+   //***
+   // Determine null pixel values so that we can recognize a null coming in and
+   // not remap it:
+   //***
+   null[0] = tile->getNullPix(0);
+   null[1] = tile->getNullPix(1);
+   null[2] = tile->getNullPix(2);
+   
+   ossimDblGrid& gridR = *(remapper->getGrid(0));
+   ossimDblGrid& gridG = *(remapper->getGrid(1));
+   ossimDblGrid& gridB = *(remapper->getGrid(2));
+      
+   //***
+   // Remap according to pixel type:
+   //***
+   switch(tile->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      ossim_uint8* red_buf  = (ossim_uint8*)tile->getBuf(0);
+      ossim_uint8* grn_buf  = (ossim_uint8*)tile->getBuf(1);
+      ossim_uint8* blu_buf  = (ossim_uint8*)tile->getBuf(2);
+      short  pixel_buffer[3];
+      
+      for (double line=origin.line; line<origin.line+height; line+=1.0)
+      {
+         for (double samp=origin.samp; samp<origin.samp+width; samp+=1.0)
+         {
+            //***
+            // Scan for null pixel before adding remap delta:
+            //***
+            if ((red_buf[offset] != (ossim_uint8) null[0]) &&
+                (grn_buf[offset] != (ossim_uint8) null[1]) &&
+                (blu_buf[offset] != (ossim_uint8) null[2]))
+            {
+               //***
+               // Remap RGB pixel with spatially variant bias value:
+               //***
+               pixel_buffer[0] = red_buf[offset] + (short) gridR(samp,line);
+               pixel_buffer[1] = grn_buf[offset] + (short) gridG(samp,line);
+               pixel_buffer[2] = blu_buf[offset] + (short) gridB(samp,line);
+
+               //***
+               // Clamp:
+               //***
+               if      (pixel_buffer[0]<0)   red_buf[offset] = 0;
+               else if (pixel_buffer[0]>255) red_buf[offset] = 255;
+               else                          red_buf[offset] = pixel_buffer[0];
+               
+
+               if      (pixel_buffer[1]<0)   grn_buf[offset] = 0;
+               else if (pixel_buffer[1]>255) grn_buf[offset] = 255;
+               else                          grn_buf[offset] = pixel_buffer[1];
+               
+
+               if      (pixel_buffer[2]<0)   blu_buf[offset] = 0;
+               else if (pixel_buffer[2]>255) blu_buf[offset] = 255;
+               else                          blu_buf[offset] = pixel_buffer[2];
+               
+               //***
+               // Avoid NULLS:
+               //***
+               if (red_buf[offset] == (ossim_uint8) null[0]) red_buf[offset]++;
+               if (grn_buf[offset] == (ossim_uint8) null[1]) grn_buf[offset]++;
+               if (blu_buf[offset] == (ossim_uint8) null[2]) blu_buf[offset]++;
+            }
+            
+            offset++;
+         }
+      }
+      break;
+   }
+   
+   default:
+   {
+	   ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimRgbGridRemapEngine::remapTile: Scalar type not handled" << std::endl;
+	   break;
+   }
+
+   }   // end switch statement
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+};
+
+//*****************************************************************************
+//  METHOD: ossimRgbGridRemapEngine::assignRemapValues
+//
+//  This engine defines the target value as an RGB vector of doubles, computed
+//  as the mean of all contributor RGB values.
+//  
+//*****************************************************************************
+void ossimRgbGridRemapEngine::assignRemapValues (
+   vector<ossimAtbPointSource*>& sources_list)
+{
+   static const char MODULE[] = "ossimRgbGridRemapEngine::assignRemapValues";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   int i; // index to individual sources
+
+   //***
+   // Declare a 2D array that will contain all of the contributing sources'
+   // RGB mean values. Also declare the accumulator target vector.
+   //***
+   int num_contributors =  (int)sources_list.size();
+   double** contributor_pixel = new double* [num_contributors];
+   for (i=0; i<num_contributors; i++)
+      contributor_pixel[i] = new double[3];
+   double target_pixel[3] = {0.0, 0.0, 0.0};
+
+   //***
+   // Now loop over each remaining contributor and sum in its contribution:
+   //***
+   vector<ossimAtbPointSource*>::iterator source;
+   i = 0;
+   for(source=sources_list.begin();
+       source!=sources_list.end();
+       source++)
+   {
+      (*source)->getSourceValue(contributor_pixel[i]);
+
+      target_pixel[0] += contributor_pixel[i][0]/(double)num_contributors;
+      target_pixel[1] += contributor_pixel[i][1]/(double)num_contributors;
+      target_pixel[2] += contributor_pixel[i][2]/(double)num_contributors;
+
+      i++;
+   }
+
+   //***
+   // The target pixel has been established. Now need to compute the actual
+   // remap quantities that will be written to the appropriate remap grids:
+   //***
+   i = 0;
+   for(source=sources_list.begin();
+       source!=sources_list.end();
+       source++)
+   {
+      computeRemapNode(*source, contributor_pixel[i], target_pixel);
+      i++;
+   }
+
+   //***
+   // Delete locally allocated memory:
+   //***
+   for (i=0; i<num_contributors; i++)
+      delete [] contributor_pixel[i];
+   delete [] contributor_pixel;
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimRgbGridRemapEngine::computeSourceValue
+//  
+//*****************************************************************************
+void ossimRgbGridRemapEngine::computeSourceValue(
+   ossimRefPtr<ossimImageData>& source, void* result)
+{
+   static const char MODULE[]="ossimRgbGridRemapEngine::computeSourceValue";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // This engine defines "value" as the RGB vector corresponding to the mean
+   // RGB pixel value of the source data:
+   //***
+   ((double*)result)[0] = source->computeAverageBandValue(0);
+   ((double*)result)[1] = source->computeAverageBandValue(1);
+   ((double*)result)[2] = source->computeAverageBandValue(2);
+   
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimRgbGridRemapEngine::computeRemapNode
+//
+//  This engine defines the remap value as the difference between the target
+//  RGB vector and the individual point source's value vector.
+//
+//*****************************************************************************
+void ossimRgbGridRemapEngine::computeRemapNode(ossimAtbPointSource* ps,
+                                              void* source_value,
+                                              void* target_value)
+{
+   static const char MODULE[] = "ossimRgbGridRemapEngine::computeRemapNode";
+   if (traceExec())  CLOG << "entering..." << endl;
+
+   //***
+   // Compute the remap grid node value specific to this RGB implementation:
+   //***
+   double node[3];
+   node[0] = ((double*)target_value)[0] - ((double*)source_value)[0];
+   node[1] = ((double*)target_value)[1] - ((double*)source_value)[1];
+   node[2] = ((double*)target_value)[2] - ((double*)source_value)[2];
+
+   //***
+   // Fetch a pointer to the remapper feeding this point source in order to
+   // pass it the node value:
+   //***
+   ossimGridRemapSource* remapper = ps->getRemapSource();
+   remapper->setGridNode(ps->getViewPoint(), node);
+
+   if (traceExec())  CLOG << "returning..." << endl;
+   return;
+}
+
diff --git a/ossim/src/ossim/imaging/ossimRgbImage.cpp b/src/imaging/ossimRgbImage.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimRgbImage.cpp
rename to src/imaging/ossimRgbImage.cpp
diff --git a/src/imaging/ossimRgbToGreyFilter.cpp b/src/imaging/ossimRgbToGreyFilter.cpp
new file mode 100644
index 0000000..141dca5
--- /dev/null
+++ b/src/imaging/ossimRgbToGreyFilter.cpp
@@ -0,0 +1,247 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToGreyFilter.cpp 19223 2011-03-24 13:38:21Z dburken $
+
+#include <ossim/imaging/ossimRgbToGreyFilter.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+RTTI_DEF1(ossimRgbToGreyFilter, "ossimRgbToGreyFilter", ossimImageSourceFilter)
+
+ossimRgbToGreyFilter::ossimRgbToGreyFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theBlankTile(NULL),
+    theTile(NULL),
+    theC1(1.0/3.0),
+    theC2(1.0/3.0),
+    theC3(1.0/3.0)
+{
+}
+
+ossimRgbToGreyFilter::ossimRgbToGreyFilter(ossimImageSource* inputSource,
+                                           double c1,
+                                           double c2,
+                                           double c3)
+   : ossimImageSourceFilter(NULL, inputSource),
+     theBlankTile(NULL),
+     theTile(NULL),
+     theC1(c1),
+     theC2(c2),
+     theC3(c3)
+{
+}
+
+ossimRgbToGreyFilter::ossimRgbToGreyFilter(ossimObject* owner,
+                                           ossimImageSource* inputSource,
+                                           double c1,
+                                           double c2,
+                                           double c3)
+   : ossimImageSourceFilter(owner, inputSource),
+     theBlankTile(NULL),
+     theTile(NULL),
+     theC1(c1),
+     theC2(c2),
+     theC3(c3)
+{
+}
+ossimRgbToGreyFilter::~ossimRgbToGreyFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimRgbToGreyFilter::getTile(const ossimIrect& tileRect,
+                                              ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return NULL;  // This filter requires an input.
+   }
+
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
+                                                           resLevel);   
+   if(!isSourceEnabled() || !inputTile.valid())
+   {
+      return inputTile;
+   }
+
+   if(!theTile)
+   {
+      allocate(); // First time through...
+   }
+
+   // if (!theTile) // throw exeption...
+
+   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
+       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
+   {
+      theBlankTile->setImageRectangle(tileRect);
+      return theBlankTile;
+   }
+
+   // Set the origin, resize if needed of the output tile.
+   theTile->setImageRectangle(tileRect);
+
+   // Filter the tile.
+   runUcharTransformation(inputTile);
+
+   // Always validate to set the status.
+   theTile->validate();
+   
+   return theTile;
+}
+
+
+void ossimRgbToGreyFilter::initialize()
+{
+   // Base class will recapture "theInputConnection".
+   ossimImageSourceFilter::initialize();
+}
+
+void ossimRgbToGreyFilter::allocate()
+{
+   if(theInputConnection)
+   {
+      theTile      = NULL;
+      theBlankTile = NULL;
+
+      if(isSourceEnabled())
+      {
+         theBlankTile = new ossimU8ImageData(this,
+                                             1,
+                                             theInputConnection->getTileWidth(),
+                                             theInputConnection->getTileHeight());  
+         
+         
+         theTile = (ossimImageData*)theBlankTile->dup();
+         theTile->initialize();
+      }
+   }
+}
+
+ossim_uint32 ossimRgbToGreyFilter::getNumberOfOutputBands() const
+{
+   if(isSourceEnabled())
+   {
+      return 1;
+   }
+
+   return ossimImageSourceFilter::getNumberOfOutputBands();
+}
+
+bool ossimRgbToGreyFilter::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix)const
+{
+   ossimImageSourceFilter::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           "c1",
+           theC1,
+           true);
+   kwl.add(prefix,
+           "c2",
+           theC2,
+           true);
+   kwl.add(prefix,
+           "c3",
+           theC2,
+           true);
+   
+   return true;
+}
+
+bool ossimRgbToGreyFilter::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   ossimImageSourceFilter::loadState(kwl, prefix);
+
+   const char* lookup = kwl.find(prefix, "c1");
+   if(lookup)
+   {
+      theC1 = ossimString(lookup).toDouble();
+   }
+   lookup = kwl.find(prefix, "c2");
+   if(lookup)
+   {
+      theC2 = ossimString(lookup).toDouble();
+   }
+   lookup = kwl.find(prefix, "c3");
+   if(lookup)
+   {
+      theC3 = ossimString(lookup).toDouble();
+   }
+   return true;
+}
+
+void ossimRgbToGreyFilter::runUcharTransformation(ossimRefPtr<ossimImageData>& tile)
+{   
+   unsigned char** bandSrc = new unsigned char*[tile->getNumberOfBands()];
+   unsigned char* bandDest;
+   
+   if(tile->getNumberOfBands() == 1)
+   {
+      bandSrc[0]  = static_cast<unsigned char*>(tile->getBuf(0));
+      bandSrc[1]  = static_cast<unsigned char*>(tile->getBuf(0));
+      bandSrc[2]  = static_cast<unsigned char*>(tile->getBuf(0));
+   }
+   else if(tile->getNumberOfBands() == 2)
+   {
+      bandSrc[0]  = static_cast<unsigned char*>(tile->getBuf(0));
+      bandSrc[1]  = static_cast<unsigned char*>(tile->getBuf(1));
+      bandSrc[2]  = static_cast<unsigned char*>(tile->getBuf(1));      
+   }
+   else if(tile->getNumberOfBands() >= 3)
+   {
+      bandSrc[0]  = static_cast<unsigned char*>(tile->getBuf(0));
+      bandSrc[1]  = static_cast<unsigned char*>(tile->getBuf(1));
+      bandSrc[2]  = static_cast<unsigned char*>(tile->getBuf(2));      
+   }
+   bandDest = static_cast<unsigned char*>(theTile->getBuf());
+   
+   ossim_int32 offset;
+
+   ossim_int32 upperBound = tile->getWidth()*tile->getHeight();
+   for(offset = 0; offset < upperBound; ++offset)
+   {
+      ossim_int32 value;
+      
+      value = ossim::round<int>(theC1*(bandSrc[0][offset]) +
+                    theC2*(bandSrc[1][offset]) +
+                    theC3*(bandSrc[2][offset]));
+      
+      value = value<255?value:255;
+      value = value>0?value:0;
+
+      bandDest[offset] = value;
+   }
+
+   delete [] bandSrc;
+}
+
+ossimString ossimRgbToGreyFilter::getShortName()const
+{
+   return ossimString("grey");
+}
+
+ossimString ossimRgbToGreyFilter::getLongName()const
+{
+   return ossimString("rgb to grey scale filter");
+}
+
+ossimScalarType ossimRgbToGreyFilter::getOutputScalarType() const
+{
+   if(isSourceEnabled())
+   {
+      return OSSIM_UCHAR;
+   }
+   
+   return ossimImageSourceFilter::getOutputScalarType();
+}
diff --git a/src/imaging/ossimRgbToHsiSource.cpp b/src/imaging/ossimRgbToHsiSource.cpp
new file mode 100644
index 0000000..6ee4a99
--- /dev/null
+++ b/src/imaging/ossimRgbToHsiSource.cpp
@@ -0,0 +1,162 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToHsiSource.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <ossim/imaging/ossimRgbToHsiSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimHsiVector.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimRgbToHsiSource, "ossimRgbToHsiSource", ossimImageSourceFilter)
+
+ossimRgbToHsiSource::ossimRgbToHsiSource()
+   :ossimImageSourceFilter(),
+    theBlankTile(NULL),
+    theTile(NULL)
+{
+}
+
+ossimRgbToHsiSource::ossimRgbToHsiSource(ossimImageSource* inputSource)
+   : ossimImageSourceFilter(inputSource),
+     theBlankTile(NULL),
+     theTile(NULL)
+{
+}
+
+ossimRgbToHsiSource::~ossimRgbToHsiSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimRgbToHsiSource::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();  // This filter requires an input.
+   }
+   
+   ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile(tileRect,
+                                                                       resLevel);   
+   if(!isSourceEnabled() || !inputTile.valid())
+   {
+      return inputTile;
+   }
+
+   if(!theTile)
+   {
+      allocate(); // First time through...
+   }
+
+   if (!theTile.valid())
+   {
+      return inputTile;
+   }
+   
+   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
+       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
+   {
+      theBlankTile->setImageRectangle(tileRect);
+      return theBlankTile;
+   }
+   
+   if((inputTile->getNumberOfBands()==3)&&
+      (inputTile->getScalarType()==OSSIM_UCHAR)&&
+      (inputTile->getDataObjectStatus()!=OSSIM_NULL))
+   {
+      // Set the origin, resize if needed of the output tile.
+      theTile->setImageRectangle(tileRect);
+
+      float* outputBands[3];
+      ossim_uint8* inputBands[3];
+      outputBands[0] = static_cast<float*>(theTile->getBuf(0));
+      outputBands[1] = static_cast<float*>(theTile->getBuf(1));
+      outputBands[2] = static_cast<float*>(theTile->getBuf(2));
+      inputBands[0]  = static_cast<ossim_uint8*>(inputTile->getBuf(0));
+      inputBands[1]  = static_cast<ossim_uint8*>(inputTile->getBuf(1));
+      inputBands[2]  = static_cast<ossim_uint8*>(inputTile->getBuf(2));
+      
+      long height = inputTile->getHeight();
+      long width  = inputTile->getWidth();
+      long offset = 0;
+      for(long row = 0; row < height; ++row)
+      {
+         for(long col = 0; col < width; ++col)
+         {
+            ossimRgbVector rgb(inputBands[0][offset],
+                               inputBands[1][offset],
+                               inputBands[2][offset]);
+            
+            ossimHsiVector hsi(rgb);
+            
+            
+            outputBands[0][offset] = hsi.getH();
+            outputBands[1][offset] = hsi.getS();
+            outputBands[2][offset] = hsi.getI();
+            
+            ++offset;
+         }
+      }
+   }
+   else // Input tile not of correct type to process...
+   {
+      return inputTile;
+   }
+
+   theTile->validate();
+   return theTile;
+}
+
+ossimScalarType ossimRgbToHsiSource::getOutputScalarType() const
+{
+   return OSSIM_NORMALIZED_FLOAT;
+}
+
+void ossimRgbToHsiSource::initialize()
+{
+   // Base class will recapture "theInputConnection".
+   ossimImageSourceFilter::initialize();   
+}
+
+void ossimRgbToHsiSource::allocate()
+{
+   theBlankTile = NULL;
+   theTile = NULL;
+
+   if(!theInputConnection) return;
+   
+   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
+   theTile      = (ossimImageData*)theBlankTile->dup();
+   theTile->initialize();
+}
+
+ossim_uint32 ossimRgbToHsiSource::getNumberOfOutputBands()const
+{
+   return 3;
+}
+
+double ossimRgbToHsiSource::getNullPixelValue()const
+{
+   return ossim::nan();
+}
+
+double ossimRgbToHsiSource::getMinPixelValue(ossim_uint32 /* band */)const
+{
+   return 0.0;
+}
+
+double ossimRgbToHsiSource::getMaxPixelValue(ossim_uint32 /* band */)const
+{
+   return 1.0;
+}
diff --git a/src/imaging/ossimRgbToHsvSource.cpp b/src/imaging/ossimRgbToHsvSource.cpp
new file mode 100644
index 0000000..18ea93c
--- /dev/null
+++ b/src/imaging/ossimRgbToHsvSource.cpp
@@ -0,0 +1,155 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToHsvSource.cpp 17195 2010-04-23 17:32:18Z dburken $
+#include <ossim/imaging/ossimRgbToHsvSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimHsvVector.h>
+#include <ossim/base/ossimRgbVector.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimRgbToHsvSource, "ossimRgbToHsvSource", ossimImageSourceFilter)
+
+ossimRgbToHsvSource::ossimRgbToHsvSource()
+   :ossimImageSourceFilter(),
+    theBlankTile(NULL),
+    theTile(NULL)
+{
+}
+
+
+ossimRgbToHsvSource::ossimRgbToHsvSource(ossimImageSource* inputSource)
+   : ossimImageSourceFilter(inputSource),
+    theBlankTile(NULL),
+    theTile(NULL)
+{
+}
+
+ossimRgbToHsvSource::~ossimRgbToHsvSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimRgbToHsvSource::getTile(
+   const  ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();  // This filter requires an input.
+   }
+
+   ossimRefPtr<ossimImageData> inputTile =
+      theInputConnection->getTile(tileRect, resLevel);   
+   if(!isSourceEnabled() || !inputTile.valid())
+   {
+      return inputTile;
+   }
+
+   if(!theTile.valid())
+   {
+      allocate(); // First time through...
+   }
+   
+   if (!theTile.valid()) // throw exeption...
+   {
+      return inputTile;
+   }
+   
+   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
+       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
+   {
+      theBlankTile->setImageRectangle(tileRect);
+      return theBlankTile;
+   }
+
+   if((inputTile->getNumberOfBands()==3)&&
+      (inputTile->getScalarType()==OSSIM_UCHAR)&&
+      (inputTile->getDataObjectStatus()!=OSSIM_NULL))
+   {
+      // Set the origin, resize if needed of the output tile.
+      theTile->setImageRectangle(tileRect);
+
+      float* outputBands[3];
+      ossim_uint8* inputBands[3];
+      outputBands[0] = static_cast<float*>(theTile->getBuf(0));
+      outputBands[1] = static_cast<float*>(theTile->getBuf(1));
+      outputBands[2] = static_cast<float*>(theTile->getBuf(2));
+      inputBands[0] = static_cast<ossim_uint8*>(inputTile->getBuf(0));
+      inputBands[1] = static_cast<ossim_uint8*>(inputTile->getBuf(1));
+      inputBands[2] = static_cast<ossim_uint8*>(inputTile->getBuf(2));
+      
+      long height = inputTile->getHeight();
+      long width  = inputTile->getWidth();
+      long offset = 0;
+      for(long row = 0; row < height; ++row)
+      {
+         for(long col = 0; col < width; ++col)
+         {
+            ossimRgbVector rgb(inputBands[0][offset],
+                               inputBands[1][offset],
+                               inputBands[2][offset]);
+            
+            ossimHsvVector hsv(rgb);
+            
+            outputBands[0][offset] = hsv.getH();
+            outputBands[1][offset] = hsv.getS();
+            outputBands[2][offset] = hsv.getV();
+            
+            ++offset;
+         }
+      }
+   }
+   else // Input tile not of correct type to process...
+   {
+      return inputTile;
+   }
+   theTile->validate();
+   return theTile;
+}
+
+void ossimRgbToHsvSource::initialize()
+{
+   // Base class will recapture "theInputConnection".
+   ossimImageSourceFilter::initialize();
+}
+
+void ossimRgbToHsvSource::allocate()
+{
+   theBlankTile = ossimImageDataFactory::instance()->create(this, this);
+   theTile      = (ossimImageData*)theBlankTile->dup();
+   theTile->initialize();
+}
+
+ossimScalarType ossimRgbToHsvSource::getOutputScalarType() const
+{
+   return OSSIM_NORMALIZED_FLOAT;
+}
+
+ossim_uint32 ossimRgbToHsvSource::getNumberOfOutputBands()const
+{
+   return 3;
+}
+
+double ossimRgbToHsvSource::getNullPixelValue()const
+{
+   return ossim::nan();
+}
+
+double ossimRgbToHsvSource::getMinPixelValue(ossim_uint32 /* band */)const
+{
+   return 0.0;
+}
+
+double ossimRgbToHsvSource::getMaxPixelValue(ossim_uint32 /* band */)const
+{
+   return 1.0;
+}
diff --git a/src/imaging/ossimRgbToIndexFilter.cpp b/src/imaging/ossimRgbToIndexFilter.cpp
new file mode 100644
index 0000000..a77246d
--- /dev/null
+++ b/src/imaging/ossimRgbToIndexFilter.cpp
@@ -0,0 +1,228 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToIndexFilter.cpp 17195 2010-04-23 17:32:18Z dburken $
+
+#include <ossim/imaging/ossimRgbToIndexFilter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+
+RTTI_DEF1(ossimRgbToIndexFilter,
+          "ossimRgbToIndexFilter",
+          ossimImageSourceFilter);
+
+ossimRgbToIndexFilter::ossimRgbToIndexFilter()
+   :ossimImageSourceFilter(),
+    theLut(new ossimRgbLutDataObject()),
+    theTile(NULL)
+{
+}
+
+ossimRgbToIndexFilter::ossimRgbToIndexFilter(ossimImageSource* inputSource,
+                                             const ossimRgbLutDataObject& rgbLut)
+   :ossimImageSourceFilter(inputSource),
+    theLut((ossimRgbLutDataObject*)rgbLut.dup()),
+    theTile(NULL)
+{
+}
+
+ossimRgbToIndexFilter::~ossimRgbToIndexFilter()
+{
+   theLut = 0;
+}
+
+void ossimRgbToIndexFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   // Force allocate on next getTile.
+   theTile      = NULL;
+}
+
+void ossimRgbToIndexFilter::allocate()
+{
+   theTile      = NULL;
+   
+   if(isSourceEnabled())
+   {
+      theTile      = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+   }
+}
+
+void ossimRgbToIndexFilter::disableSource()
+{
+   ossimImageSourceFilter::disableSource();
+   theTile = NULL;
+}
+
+ossimRefPtr<ossimImageData> ossimRgbToIndexFilter::getTile(
+   const ossimIrect& origin,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   if(!theTile.valid())
+   {
+      allocate();
+   }
+   
+   ossimRefPtr<ossimImageData> input = theInputConnection->getTile(origin,
+                                                                   resLevel);
+
+   if(!theTile.valid() || !input.valid())
+   {
+      return input;
+   }
+
+   theTile->setImageRectangle(origin);
+
+   if(input->getScalarType() == OSSIM_UCHAR)
+   {
+      theTile->setDataObjectStatus(OSSIM_FULL);
+      return convertInputTile(input);
+   }
+   else
+   {
+      theTile->makeBlank();
+   }
+
+   theTile->setDataObjectStatus(OSSIM_FULL);
+   
+   return theTile;
+}
+
+ossimRefPtr<ossimImageData> ossimRgbToIndexFilter::convertInputTile(ossimRefPtr<ossimImageData>& tile)
+{
+   if (!tile)
+   {
+      return theTile;
+   }
+   
+   const ossim_uint32 BANDS = tile->getNumberOfBands();
+
+   if (!BANDS)
+   {
+      return theTile;
+   }
+   
+   ossim_uint8* band[3];
+   ossim_uint8* outBand = (ossim_uint8*)theTile->getBuf();
+
+   if(BANDS >= 3)
+   {
+      band[0] = (ossim_uint8*)(tile->getBuf(0));
+      band[1] = (ossim_uint8*)(tile->getBuf(1));
+      band[2] = (ossim_uint8*)(tile->getBuf(2));
+   }
+   else
+   {
+      band[0] = (ossim_uint8*)(tile->getBuf(0));
+      band[1] = (ossim_uint8*)(tile->getBuf(0));
+      band[2] = (ossim_uint8*)(tile->getBuf(0));
+   }
+
+   if(band[0])
+   {
+      ossim_uint32 upper = tile->getWidth()*tile->getHeight();
+
+      for(ossim_uint32 offset = 0; offset < upper; ++offset)
+      {
+         *outBand = theLut->findIndex(*band[0], *band[1], *band[2]);
+         
+         ++outBand;
+         ++band[0];
+         ++band[1];
+         ++band[2];
+      }
+   }
+   
+   return theTile;
+}
+
+bool ossimRgbToIndexFilter::saveState(ossimKeywordlist& kwl,
+                                      const char* prefix)const
+{
+   ossimString newPrefix = prefix;
+   newPrefix = newPrefix + "lut.";
+
+   theLut->saveState(kwl, newPrefix.c_str());
+
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimRgbToIndexFilter::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   ossimString newPrefix = prefix;
+   newPrefix = newPrefix + "lut.";
+
+   theLut->loadState(kwl, newPrefix.c_str());
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+ossim_uint32 ossimRgbToIndexFilter::getNumberOfOutputBands() const
+{
+   if(isSourceEnabled())
+   {
+      return 1;
+   }
+   
+   return ossimImageSourceFilter::getNumberOfOutputBands();
+}
+   
+ossimScalarType ossimRgbToIndexFilter::getOutputScalarType() const
+{
+   if(isSourceEnabled())
+   {
+      return OSSIM_UCHAR;
+   }
+   
+   return ossimImageSourceFilter::getOutputScalarType();
+}
+
+void ossimRgbToIndexFilter::setLut(ossimRgbLutDataObject& lut)
+{
+   theLut = (ossimRgbLutDataObject*) lut.dup();
+}
+
+double ossimRgbToIndexFilter::getNullPixelValue(ossim_uint32 band)const
+{
+   if(isSourceEnabled())
+   {
+      return 0.0;
+   }
+   
+   return ossimImageSourceFilter::getNullPixelValue(band);
+}
+
+double ossimRgbToIndexFilter::getMinPixelValue(ossim_uint32 /* band */)const
+{
+   if(isSourceEnabled())
+   {
+      return 1.0;
+   }
+   
+   return ossimImageSourceFilter::getMinPixelValue();
+}
+
+double ossimRgbToIndexFilter::getMaxPixelValue(ossim_uint32 /* band */)const
+{
+   if(isSourceEnabled())
+   {
+      return 255.0;
+   }
+   
+   return ossimImageSourceFilter::getMaxPixelValue();
+}
diff --git a/src/imaging/ossimRgbToJpegYCbCrSource.cpp b/src/imaging/ossimRgbToJpegYCbCrSource.cpp
new file mode 100644
index 0000000..5d34ec8
--- /dev/null
+++ b/src/imaging/ossimRgbToJpegYCbCrSource.cpp
@@ -0,0 +1,93 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRgbToJpegYCbCrSource.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/imaging/ossimRgbToJpegYCbCrSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimJpegYCbCrVector.h>
+#include <ossim/base/ossimRgbVector.h>
+
+RTTI_DEF1(ossimRgbToJpegYCbCrSource,
+          "ossimRgbToJpegYCbCrSource",
+          ossimImageSourceFilter)
+
+ossimRgbToJpegYCbCrSource::ossimRgbToJpegYCbCrSource()
+   :ossimImageSourceFilter()
+{
+   theBlankTile = new ossimImageData(this,
+                                     OSSIM_UCHAR,
+                                     3);
+}
+
+ossimRgbToJpegYCbCrSource::ossimRgbToJpegYCbCrSource(ossimImageSource* inputSource)
+   : ossimImageSourceFilter(inputSource)
+{
+}
+
+ossimRgbToJpegYCbCrSource::~ossimRgbToJpegYCbCrSource()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimRgbToJpegYCbCrSource::getTile(const  ossimIrect& tileRect,
+                                                   ossim_uint32 resLevel)
+{
+   theBlankTile->setOrigin(tileRect.ul());
+   theBlankTile->setWidthHeight(tileRect.width(), tileRect.height());
+   
+   if(theInputConnection)
+   {
+      ossimRefPtr<ossimImageData> imageData = theInputConnection->getTile(tileRect,
+                                                              resLevel);
+      if(!imageData.valid())
+      {
+         return theBlankTile;
+      }
+      if((isSourceEnabled())&&
+         (imageData->getNumberOfBands()==3)&&
+         (imageData->getScalarType()==OSSIM_UCHAR)&&
+         (imageData->getDataObjectStatus()!=OSSIM_NULL)&&
+         (imageData->getDataObjectStatus()!=OSSIM_EMPTY))
+      {
+         ossim_uint8* bands[3];
+         
+         bands[0] = static_cast<ossim_uint8*>(imageData->getBuf(0));
+         bands[1] = static_cast<ossim_uint8*>(imageData->getBuf(1));
+         bands[2] = static_cast<ossim_uint8*>(imageData->getBuf(2));
+         
+         long height = imageData->getHeight();
+         long width  = imageData->getWidth();
+         long offset = 0;
+         
+         for(long row = 0; row < height; ++row)
+         {
+            for(long col = 0; col < width; ++col)
+            {
+               ossimRgbVector rgb(bands[0][offset],
+                                  bands[1][offset],
+                                  bands[2][offset]);
+               
+               ossimJpegYCbCrVector ycbcr(rgb);
+               
+               
+               bands[0][offset] = ycbcr.getY();
+               bands[1][offset] = ycbcr.getCb();
+               bands[2][offset] = ycbcr.getCr();
+               ++offset;
+            }
+         }
+         imageData->validate();
+      }
+      return imageData;
+   }
+   
+   return theBlankTile;
+}  
diff --git a/src/imaging/ossimRpfCacheTileSource.cpp b/src/imaging/ossimRpfCacheTileSource.cpp
new file mode 100644
index 0000000..f631f55
--- /dev/null
+++ b/src/imaging/ossimRpfCacheTileSource.cpp
@@ -0,0 +1,1314 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//********************************************************************
+// $Id: ossimRpfCacheTileSource.cpp 1361 2010-08-26 00:24:22Z david.burken $
+#include <algorithm>
+using namespace std;
+
+#include <ossim/imaging/ossimRpfCacheTileSource.h>
+
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimNBandLutDataObject.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimRpfFrame.h>
+#include <ossim/support_data/ossimRpfToc.h>
+#include <ossim/support_data/ossimRpfTocEntry.h>
+#include <ossim/support_data/ossimRpfCompressionSection.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimCylEquAreaProjection.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimPolygon.h>
+
+static ossimTrace traceDebug = ossimTrace("ossimRpfCacheTileSource:debug");
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimRpfCacheTileSource.cpp 1361 2010-08-26 00:24:22Z david.burken $";
+#endif
+
+RTTI_DEF1(ossimRpfCacheTileSource, "ossimRpfCacheTileSource", ossimImageHandler)
+
+const ossim_uint32 ossimRpfCacheTileSource::CIBCADRG_FRAME_WIDTH  = 1536;
+const ossim_uint32 ossimRpfCacheTileSource::CIBCADRG_FRAME_HEIGHT = 1536;
+
+ossimRpfCacheTileSource::ossimRpfCacheTileSource()
+   :
+   ossimImageHandler(),
+
+   // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
+   // convert to bytes   
+   m_compressedBuffer(new ossim_uint8[(64*64*12)/8]),
+
+   // whether CIB or CADRG we will alocate the buffer
+   // to the larger of the 2 (CADRG is 3 bands) 
+   m_uncompressedBuffer(new ossim_uint8[256*256*3]),
+   
+   m_numberOfLines(0),
+   m_numberOfSamples(0),
+   m_tile(0),
+   m_fileNames(),
+   m_tileSize(128, 128),
+   m_productType(OSSIM_PRODUCT_TYPE_UNKNOWN),
+   m_workFrame(new ossimRpfFrame),
+   m_bBox_LL_Lon(0.0),
+   m_bBox_LL_Lat(0.0),
+   m_bBox_UR_Lon(0.0),
+   m_bBox_UR_Lat(0.0),
+   m_numOfFramesVertical(0),
+   m_numOfFramesHorizontal(0),
+   m_frameEntryArray()
+{
+  if (traceDebug())
+  {
+    ossimNotify(ossimNotifyLevel_DEBUG)
+      << "ossimRpfCacheTileSource::ossimRpfCacheTileSource entered...\n";
+#ifdef OSSIM_ID_ENABLED
+    ossimNotify(ossimNotifyLevel_DEBUG)
+      << "OSSIM_ID:  " << OSSIM_ID << "\n";
+#endif      
+  }
+
+  m_actualImageRect.makeNan();
+
+}
+
+ossimRpfCacheTileSource::~ossimRpfCacheTileSource()
+{
+  if(m_compressedBuffer)
+  {
+    delete [] m_compressedBuffer;
+    m_compressedBuffer = 0;
+  }
+  if(m_uncompressedBuffer)
+  {
+    delete [] m_uncompressedBuffer;
+    m_uncompressedBuffer = 0;
+  }
+  if(m_workFrame)
+  {
+    delete m_workFrame;
+    m_workFrame = 0;
+  }
+  close();
+}
+
+ossimString ossimRpfCacheTileSource::getShortName()const
+{
+  return ossimString("RpfCache");
+}
+
+ossimString ossimRpfCacheTileSource::getLongName()const
+{
+  return ossimString("RpfCache reader");
+}
+
+
+void ossimRpfCacheTileSource::close()
+{
+  deleteAll();
+}
+
+bool ossimRpfCacheTileSource::isOpen()const
+{
+  //return (theTableOfContents!=0);
+  ossimString ext = theImageFile.ext().downcase();
+
+  if(ext == "rpf")
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+bool ossimRpfCacheTileSource::open()
+{
+  if(traceDebug())
+  {
+    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfCacheTileSource::open(): Entered....." << std::endl;
+  }
+
+  ossimFilename imageFile = theImageFile;
+  bool result = true;
+
+  if(isOpen() == false)
+  {
+    close();
+    result = false;
+  }
+
+  if(result)
+  {
+    if (m_fileNames.size() == 0 && m_frameEntryArray.size() == 0)
+    {
+      if (buildFrameEntryArray(imageFile) == false)
+      {
+        return false;
+      }
+    }
+    
+    setCurrentEntry(0);
+    //---
+    // Adjust image rect so not to go over the -180 to 180 and -90 to 90
+    // bounds.
+    //---
+    setActualImageRect();
+
+    // Set the base class image file name.
+    theImageFile = imageFile;
+    m_tile = ossimImageDataFactory::instance()->create(this, this);
+    m_tile->initialize();
+  }
+
+  if(traceDebug())
+  {
+    ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfCacheTileSource::open(): Leaving at line" << __LINE__ << std::endl;
+  }
+
+  return result;
+}
+
+bool ossimRpfCacheTileSource::buildFrameEntryArray(ossimFilename imageFile)
+{
+   static const char MODULE[] = "ossimRpfCacheTileSource::buildFrameEntryArray";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered..." << endl;
+   }
+
+   std::ifstream in((imageFile).c_str() );
+   
+   std::string line;
+   ossim_uint32 index = 0; // used throughout
+   while( in.good() )
+   {
+      // Read in a line.
+      std::getline(in, line);
+
+      ossimString tmpStr = ossimString(line);
+      if (!tmpStr.empty())
+      {
+         if (index == 0)
+         {
+            std::vector<ossimString> box_lat_lon;
+            tmpStr.split(box_lat_lon, "|");
+            
+            if (box_lat_lon.size() > 2)
+            {
+               std::vector<ossimString> ll;
+               std::vector<ossimString> ur;
+               
+               box_lat_lon[0].split(ll, ",");
+               box_lat_lon[1].split(ur, ",");
+               ossimString bandStr = box_lat_lon[2];
+               
+               m_bBox_LL_Lon = ll[0].toFloat64();
+               m_bBox_LL_Lat = ll[1].toFloat64();
+               m_bBox_UR_Lon = ur[0].toFloat64();
+               m_bBox_UR_Lat = ur[1].toFloat64();
+               
+               checkLongitude(m_bBox_LL_Lon, m_bBox_UR_Lon);
+               
+               ossim_int32 bands = ossimString(bandStr).toInt32();
+               if (bands == 1)
+               {
+                  m_productType = OSSIM_PRODUCT_TYPE_CIB;
+               }
+               else if (bands == 3)
+               {
+                  m_productType = OSSIM_PRODUCT_TYPE_CADRG;
+               }
+            }
+            else
+            {
+               return false;
+            }
+         }
+         else if (index == 1)
+         {
+            m_fileNames.push_back(tmpStr);
+            std::vector<ossimString> frame_lat_lon = tmpStr.split("|");
+            if (frame_lat_lon.size() > 2)
+            {
+               ossimString ll_lon_lat = frame_lat_lon[1];
+               ossimString ur_lon_lat = frame_lat_lon[2];
+               ossim_float64 ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
+               ossim_float64 ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
+               ossim_float64 ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
+               ossim_float64 ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
+
+               checkLongitude(ll_lon, ur_lon);
+               
+               ossim_float64 bBox_lat_diff = std::fabs(m_bBox_UR_Lat - m_bBox_LL_Lat);
+               ossim_float64 bBox_lon_diff = std::fabs(m_bBox_UR_Lon - m_bBox_LL_Lon);
+               
+               ossim_float64 lat_diff = std::fabs(ur_lat - ll_lat);
+               ossim_float64 lon_diff = std::fabs(ur_lon - ll_lon);
+               
+               m_numOfFramesVertical   = static_cast<ossim_uint32>(bBox_lat_diff/lat_diff + 0.5);
+               m_numOfFramesHorizontal = static_cast<ossim_uint32>(bBox_lon_diff/lon_diff + 0.5);
+               
+               m_numberOfLines   = m_numOfFramesVertical*CIBCADRG_FRAME_HEIGHT;
+               m_numberOfSamples = m_numOfFramesHorizontal*CIBCADRG_FRAME_WIDTH;
+
+               if ( traceDebug() )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "\nscene height in degrees: " << bBox_lat_diff
+                     << "\nscene width in degrees:  " << bBox_lon_diff
+                     << "\nframe height in degrees: " << lat_diff
+                     << "\nframe width in degrees:  " << lon_diff
+                     << "\nframes vertical:         " << m_numOfFramesVertical
+                     << "\nframes horizontal:       " << m_numOfFramesHorizontal
+                     << "\nlines:                   " << m_numberOfLines
+                     << "\nsamples:                 " << m_numberOfSamples << "\n";
+               }
+            }
+            else
+            {
+               return false;
+            }
+         }
+         else
+         {
+            m_fileNames.push_back(tmpStr);
+         }
+         
+      } // matches: if (!tmpStr.empty())
+      
+      ++index;
+      
+   } // matches: while( in.good() )
+   in.close();
+
+   m_frameEntryArray.resize(m_numOfFramesVertical);
+   for(index = 0; index < m_frameEntryArray.size(); ++index)
+   {
+      m_frameEntryArray[index].resize(m_numOfFramesHorizontal);
+   }
+
+   for(index = 0; index < m_fileNames.size(); ++index)
+   {
+      ossimString tmpStr = m_fileNames[index];
+      std::vector<ossimString> frameInfos = tmpStr.split("|");
+      if (frameInfos.size() > 1)
+      {
+         ossimString fileName = frameInfos[0];
+         ossimString ll_lon_lat = frameInfos[1];
+         ossimString ur_lon_lat = frameInfos[2];
+         double ll_lon = ossimString(ll_lon_lat.split(",")[0]).toDouble();
+         double ll_lat = ossimString(ll_lon_lat.split(",")[1]).toDouble();
+         double ur_lon = ossimString(ur_lon_lat.split(",")[0]).toDouble();
+         double ur_lat = ossimString(ur_lon_lat.split(",")[1]).toDouble();
+         
+         checkLongitude(ll_lon, ur_lon);
+         
+         ossim_float64 tmpColPostion = std::fabs(ll_lon - m_bBox_LL_Lon);
+         ossim_float64 tmpFrameLon = std::fabs(ur_lon - ll_lon);
+         
+         ossim_float64 tmpRowPostion = std::fabs(m_bBox_UR_Lat - ur_lat);
+         ossim_float64 tmpFrameLat = std::fabs(ur_lat - ll_lat);
+         
+         ossim_uint32 colNum = static_cast<ossim_uint32>(tmpColPostion/tmpFrameLon + 0.5);
+         ossim_uint32 rowNum = static_cast<ossim_uint32>(tmpRowPostion/tmpFrameLat + 0.5);
+         
+         if (colNum >= m_numOfFramesHorizontal)
+         {
+            colNum = m_numOfFramesHorizontal-1; // Clamp to last column.
+         }
+         
+         if (rowNum >= m_numOfFramesVertical)
+         {
+            rowNum = m_numOfFramesVertical-1; // Clamp to last row.
+         }
+         
+         ossimRpfFrameEntry tempEntry;
+         tempEntry.setEntry(ossimFilename(""), fileName);
+         m_frameEntryArray[rowNum][colNum] = tempEntry;
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+void ossimRpfCacheTileSource::checkLongitude(ossim_float64& leftLon,
+                                             const ossim_float64& rightLon) const
+{
+   //---
+   // Test for scene coordinates being 180 to 180 and adjust leftLon to -180
+   // if so.
+   //
+   // NOTE:
+   // Setting tolerance to 1/7200 about 15 meters.
+   // Not sure if this is too loose or not. (drb)
+   //---
+   const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
+
+   if ( ossim::almostEqual(leftLon, 180.0, TOLERANCE) )
+   {
+      if ( ossim::almostEqual(rightLon, 180.0, TOLERANCE) )
+      {
+         leftLon = -180.0;
+      }
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimRpfCacheTileSource::getTile(
+  const  ossimIrect& rect, ossim_uint32 resLevel)
+{
+  if (m_tile.valid())
+  {
+    // Image rectangle must be set prior to calling getTile.
+    m_tile->setImageRectangle(rect);
+
+    if ( getTile( m_tile.get(), resLevel ) == false )
+    {
+      if (m_tile->getDataObjectStatus() != OSSIM_NULL)
+      {
+        m_tile->makeBlank();
+      }
+    }
+  }
+
+  return m_tile;
+}
+
+bool ossimRpfCacheTileSource::getTile(ossimImageData* result,
+                                      ossim_uint32 resLevel)
+{
+   bool status = false;
+   
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) &&
+       (m_productType != OSSIM_PRODUCT_TYPE_UNKNOWN) )
+   {
+      if ( resLevel > 0 )
+      {
+         //---
+         // Check for overview tile.  Some overviews can contain r0 so always
+         // call even if resLevel is 0 (if overview is not virtual).  Method 
+         // returns true on success, false on error.
+         //---
+         status = getOverviewTile(resLevel, result);
+      }
+      
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+         
+         ossimIrect rect = result->getImageRectangle();
+         
+         ossimIrect imageRect = getImageRectangle();
+         
+         if ( rect.intersects(imageRect) )
+         {
+            //---
+            // Start with a blank tile in case there is not total coverage
+            // for rect.
+            //---
+            result->makeBlank();
+            
+            vector<ossimFrameEntryData> frames = getIntersectingEntries(rect);
+            if(frames.size() > 0)
+            {
+               //---
+               // Now lets render each frame.  Note we will have to find
+               // subframes
+               // that intersect the rectangle of interest for each frame.
+               //---
+               fillTile(rect, frames, result);
+               
+               // Revalidate tile status.
+               result->validate();
+            }
+         }
+         else
+         {
+            result->makeBlank();
+         }
+      }
+   }
+   
+   return status;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getNumberOfInputBands()const
+{
+  switch(m_productType)
+  {
+  case  OSSIM_PRODUCT_TYPE_UNKNOWN:
+    {
+      return 0;
+    }
+  case OSSIM_PRODUCT_TYPE_CIB:
+    {
+      return 1;
+    }
+  case OSSIM_PRODUCT_TYPE_CADRG:
+    {
+      return 3;
+    }
+  }
+
+  return 0;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getNumberOfOutputBands()const
+{
+  switch(m_productType)
+  {
+  case  OSSIM_PRODUCT_TYPE_UNKNOWN:
+    {
+      return 0;
+    }
+  case OSSIM_PRODUCT_TYPE_CIB:
+    {
+      return 1;
+    }
+  case OSSIM_PRODUCT_TYPE_CADRG:
+    {
+      return 3;
+    }
+  }
+
+  return 0;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return m_numberOfLines;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfLines(reduced_res_level);
+   }
+   
+   return 0;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return m_numberOfSamples;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->getNumberOfSamples(reduced_res_level);
+   }
+   
+   return 0;
+}
+
+void ossimRpfCacheTileSource::setActualImageRect()
+{
+   m_actualImageRect = ossimIrect(0,0,m_numberOfLines, m_numberOfSamples);
+}
+
+ossimIrect ossimRpfCacheTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return ossimIrect(0,                         // upper left x
+                     0,                         // upper left y
+                     getNumberOfSamples(reduced_res_level) - 1,  // lower right x
+                     getNumberOfLines(reduced_res_level)   - 1); // lower right y                     
+}
+
+ossimRefPtr<ossimImageGeometry> ossimRpfCacheTileSource::getImageGeometry()
+{
+   if (theGeometry.valid()) return theGeometry;
+   
+   // datum
+   // WGS 84
+   ossimKeywordlist kwl;
+   const char* prefix = 0; // legacy
+   kwl.add(prefix,
+           ossimKeywordNames::DATUM_KW,
+           "WGE",
+           true);   
+   
+   ossimGpt ul(m_bBox_UR_Lat,m_bBox_LL_Lon);
+   ossimGpt ll(m_bBox_LL_Lat,m_bBox_LL_Lon);
+   ossimGpt ur(m_bBox_UR_Lat,m_bBox_UR_Lon);
+   ossimGpt lr(m_bBox_LL_Lat,m_bBox_UR_Lon);
+
+   double latInterval = fabs(ul.latd() - lr.latd())/ getNumberOfLines();
+   double lonInterval = fabs(ul.lond() - ur.lond())/ getNumberOfSamples();
+
+   kwl.add(prefix,
+           ossimKeywordNames::UL_LAT_KW,
+           ul.latd(),//-(latInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::UL_LON_KW,
+           ul.lond(),//+(lonInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::LL_LAT_KW,
+           ll.latd(),//+(latInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::LL_LON_KW,
+           ll.lond(),//+(lonInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::LR_LAT_KW,
+           lr.latd(),//+(latInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::LR_LON_KW,
+           lr.lond(),//-(lonInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::UR_LAT_KW,
+           ur.latd(),//-(latInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::UR_LON_KW,
+           ur.lond(),//-(latInterval/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_INPUT_BANDS_KW,
+           getNumberOfInputBands(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
+           getNumberOfOutputBands(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_LINES_KW,
+           getNumberOfLines(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_SAMPLES_KW,
+           getNumberOfSamples(),
+           true);
+
+
+   //---
+   // Make a projection to get the easting / northing of the tie point and
+   // the scale in meters.  This will only be used by the CIB.
+   //---
+   kwl.add(prefix,
+           ossimKeywordNames::DATUM_KW,
+           "WGE",
+           true);
+
+   ossimGpt origin((ul.latd()+lr.latd())*.5,
+                   (ul.lond()+lr.lond())*.5,
+                   0.0);
+
+   double deltaLatPerPixel = latInterval;
+   double deltaLonPerPixel = lonInterval;
+
+   ossimDpt tie;
+
+   tie.lat = ul.latd() - deltaLatPerPixel/2.0;
+   tie.lon = ul.lond() + deltaLonPerPixel/2.0;
+
+   kwl.add(prefix, 
+           ossimKeywordNames::TIE_POINT_XY_KW,
+           tie.toString(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+           deltaLatPerPixel,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+           deltaLonPerPixel,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::ORIGIN_LATITUDE_KW,
+           origin.latd(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CENTRAL_MERIDIAN_KW,
+           origin.lond(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LAT_KW,
+           ul.latd()-(deltaLatPerPixel/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LON_KW,
+           ul.lond()+(deltaLonPerPixel/2.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           "ossimEquDistCylProjection",
+           true);
+  
+   // Capture this for next time.
+   theGeometry = new ossimImageGeometry;
+   theGeometry->loadState(kwl, prefix);
+
+   // Set image things the geometry object should know about.
+   initImageParameters( theGeometry.get() ); 
+
+   return theGeometry;
+}
+
+ossimScalarType ossimRpfCacheTileSource::getOutputScalarType() const
+{
+   return OSSIM_UCHAR;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getTileWidth() const
+{
+   return m_tileSize.x;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getTileHeight() const
+{
+   return m_tileSize.y;
+}
+
+bool ossimRpfCacheTileSource::setCurrentEntry(ossim_uint32 entryIdx)
+{
+   // Clear the geometry.
+   theGeometry = 0;
+
+   // Must clear or openOverview will use last entries.
+   theOverviewFile.clear();
+
+   if(!setEntryToRender(entryIdx))
+   {
+      return false;
+   }
+   completeOpen();
+
+   return true;
+}
+
+void ossimRpfCacheTileSource::getEntryList(std::vector<ossim_uint32>& entryList)const
+{
+   entryList.push_back(0);
+}
+
+bool ossimRpfCacheTileSource::setEntryToRender(ossim_uint32 /* index */)
+{
+   if(isOpen())
+   { 
+      populateLut();
+      return true;
+   }
+
+   return false;
+}
+
+bool ossimRpfCacheTileSource::isValidRLevel(ossim_uint32 reduced_res_level) const
+{
+   if (reduced_res_level == 0)
+   {
+      return true;
+   }
+   else if (theOverview.valid())
+   {
+      return theOverview->isValidRLevel(reduced_res_level);
+   }
+   else
+   {
+      return false;
+   }
+}
+
+vector<ossimRpfCacheTileSource::ossimFrameEntryData> ossimRpfCacheTileSource::getIntersectingEntries(const ossimIrect& rect)
+{
+   vector<ossimFrameEntryData> result;
+
+   // make sure we have the Toc entry to render
+   if(!isOpen()) return result;
+
+   ossimIrect imageRect = getImageRectangle();
+   if(rect.intersects(imageRect))
+   {
+      ossimIrect clipRect  = rect.clipToRect(imageRect);
+      ossimIrect frameRect(clipRect.ul().x/CIBCADRG_FRAME_WIDTH,
+                           clipRect.ul().y/CIBCADRG_FRAME_HEIGHT,
+                           clipRect.lr().x/CIBCADRG_FRAME_WIDTH,
+                           clipRect.lr().y/CIBCADRG_FRAME_HEIGHT);
+
+      for(ossim_int32 row = frameRect.ul().y; row <= frameRect.lr().y; ++row)
+      {
+         for(ossim_int32 col = frameRect.ul().x; col <= frameRect.lr().x; ++col)
+         {
+            ossimRpfFrameEntry tempEntry = m_frameEntryArray[row][col];
+            if(tempEntry.exists())
+            {
+               result.push_back(ossimFrameEntryData(row,
+                                                    col,
+                                                    row*CIBCADRG_FRAME_HEIGHT,
+                                                    col*CIBCADRG_FRAME_WIDTH,
+                                                    tempEntry));
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+void ossimRpfCacheTileSource::fillTile(
+   const ossimIrect& tileRect,
+   const vector<ossimFrameEntryData>& framesInvolved,
+   ossimImageData* tile)
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0;
+       idx < framesInvolved.size();
+       ++idx)
+   {
+
+      if(m_workFrame->parseFile(framesInvolved[idx].theFrameEntry.getFullPath())
+         == ossimErrorCodes::OSSIM_OK)
+      {
+         // we will fill a subtile.  We pass in which frame it is and the position of the frame.
+         // the actual pixel will be 1536*row and 1536 *col.
+         if(m_productType == OSSIM_PRODUCT_TYPE_CIB)
+         {
+            fillSubTileCib(*m_workFrame,
+                           tileRect,
+                           framesInvolved[idx],
+                           tile);
+         }
+         else
+         {
+            fillSubTileCadrg(*m_workFrame,
+                             tileRect,
+                             framesInvolved[idx],
+                             tile);
+         }
+      }
+   }
+}
+
+void ossimRpfCacheTileSource::fillSubTileCadrg(
+   const ossimRpfFrame&  aFrame,
+   const ossimIrect& tileRect,
+   const ossimFrameEntryData& frameEntryData,
+   ossimImageData* tile)
+{;
+// first let's grab the absolute position of the frame rectangle in pixel space
+   ossimIrect frameRect(frameEntryData.thePixelCol,
+                        frameEntryData.thePixelRow,
+                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
+                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
+
+
+// now clip it to the tile
+   ossimIrect clipRect = tileRect.clipToRect(frameRect);
+
+   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
+
+   if(!compressionSection)
+   {
+      return;
+   }
+
+   const vector<ossimRpfColorGrayscaleTable>& colorTable =
+      aFrame.getColorGrayscaleTable();
+
+// ESH 03/2009 -- Partial fix for ticket #646.
+// Crash fix on reading RPFs: Make sure the colorTable vector 
+// has entries before trying to make use of them. 
+   int numTables = (int)colorTable.size();
+   if ( numTables <= 0 )
+   {
+      return;
+   }
+
+   ossim_uint8 *tempRows[3];
+
+   tempRows[0] = m_uncompressedBuffer;
+   tempRows[1] = (m_uncompressedBuffer + 256*256);
+   tempRows[2] = (tempRows[1] + 256*256);
+
+// find the shift to 0,0
+   ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
+                      clipRect.ul().y - frameEntryData.thePixelRow);
+
+
+// In order to compute the subframe we will need the corner offsets of
+// the upper left of the frame and the upper left of the clip rect.  The
+// clip rect should be completely within the frame.  This just translates the value
+// to make the upper left of the frame be 0,0.
+//
+   ossimIrect offsetRect(tempDelta.x,
+                         tempDelta.y,
+                         tempDelta.x + clipRect.width()-1,
+                         tempDelta.y + clipRect.height()-1);
+
+// each subframe is 64x64.  We will actually use 256x256 since
+// we will be uncompressing them.  Note CADRG is a 256x256 tile
+// compressed to 64x64x12 bit data
+//
+   ossimIrect subFrameRect(offsetRect.ul().x/256,
+                           offsetRect.ul().y/256,
+                           (offsetRect.lr().x)/256,
+                           (offsetRect.lr().y)/256);
+
+   ossim_uint32 readPtr  = 0;
+
+   ossim_int32 row = 0;
+   ossim_int32 col = 0;
+   ossim_uint32 i = 0;
+   ossim_uint32 j = 0;
+   ossim_int32 upperY = subFrameRect.lr().y;
+   ossim_int32 upperX = subFrameRect.lr().x;
+   ossim_int32 lowerY = subFrameRect.ul().y;
+   ossim_int32 lowerX = subFrameRect.ul().x; 
+   for(row = lowerY; row <= upperY; ++row)
+   {
+      for(col = lowerX; col <= upperX; ++col)
+      {
+         readPtr = 0;
+         if(aFrame.fillSubFrameBuffer(m_compressedBuffer, 0, row, col))
+         {
+            for (i = 0; i < 256; i += 4)
+            {
+               for (j = 0; j < 256; j += 8)
+               {
+                  ossim_uint16 firstByte  = m_compressedBuffer[readPtr++] & 0xff;
+                  ossim_uint16 secondByte = m_compressedBuffer[readPtr++] & 0xff;
+                  ossim_uint16 thirdByte  = m_compressedBuffer[readPtr++] & 0xff;
+
+                  //because dealing with half-bytes is hard, we
+                  //uncompress two 4x4 tiles at the same time. (a
+                  //4x4 tile compressed is 12 bits )
+                  // this little code was grabbed from openmap software.
+
+                  /* Get first 12-bit value as index into VQ table */
+                  // I think we need to swap
+                  ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
+
+                  /* Get second 12-bit value as index into VQ table*/
+                  ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
+
+                  for (ossim_uint32 t = 0; t < 4; ++t)
+                  {
+                     for (ossim_uint32 e = 0; e < 4; ++e)
+                     {
+                        ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
+                        ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
+
+                        ossim_uint32 pixindex = ((i+t)*256) +
+                           (j + e);
+                        const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
+                        const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
+
+
+                        tempRows[0][pixindex] = color1[0];
+                        tempRows[1][pixindex] = color1[1];
+                        tempRows[2][pixindex] = color1[2];
+
+                        tempRows[0][pixindex+4] = color2[0];
+                        tempRows[1][pixindex+4] = color2[1];
+                        tempRows[2][pixindex+4] = color2[2];
+                     } //for e
+                  } //for t
+               }  /* for j */
+            } //for i
+         }
+         else
+         {
+            memset(m_uncompressedBuffer, 0, 256*256*3);
+         }
+         ossim_int32 tempCol = col*256;
+         ossim_int32 tempRow = row*256;
+         ossimIrect subRectToFill(frameRect.ul().x + tempCol,
+                                  frameRect.ul().y + tempRow,
+                                  frameRect.ul().x + tempCol + 255,
+                                  frameRect.ul().y + tempRow + 255);
+         tile->loadTile(m_uncompressedBuffer,
+                        subRectToFill,
+                        OSSIM_BSQ);
+      }
+   }
+}
+
+void ossimRpfCacheTileSource::fillSubTileCib(
+   const ossimRpfFrame&  aFrame,
+   const ossimIrect& tileRect,
+   const ossimFrameEntryData& frameEntryData,
+   ossimImageData* tile)
+{
+   // first let's grab the absolute position of the frame rectangle in pixel
+   // space
+   ossimIrect frameRect(frameEntryData.thePixelCol,
+                        frameEntryData.thePixelRow,
+                        frameEntryData.thePixelCol + CIBCADRG_FRAME_WIDTH  - 1,
+                        frameEntryData.thePixelRow + CIBCADRG_FRAME_HEIGHT - 1);
+
+
+   // now clip it to the tile
+   ossimIrect clipRect = tileRect.clipToRect(frameRect);
+
+   const ossimRpfCompressionSection* compressionSection = aFrame.getCompressionSection();
+
+   if(!compressionSection)
+   {
+      return;
+   }
+
+   const vector<ossimRpfColorGrayscaleTable>& colorTable =
+      aFrame.getColorGrayscaleTable();
+
+   // ESH 03/2009 -- Partial fix for ticket #646.
+   // Crash fix on reading RPFs: Make sure the colorTable vector 
+   // has entries before trying to make use of them. 
+   int numTables = (int)colorTable.size();
+   if ( numTables <= 0 )
+   {
+      return;
+   }
+
+   // check to see if it does overlap.  If it doesn't then the width and height
+   // will be a single point
+   {
+      ossim_uint8 *tempRow;
+
+      tempRow = m_uncompressedBuffer;
+
+      // find the shift to 0,0
+      ossimIpt tempDelta(clipRect.ul().x - frameEntryData.thePixelCol,
+                         clipRect.ul().y - frameEntryData.thePixelRow);
+
+      // In order to compute the subframe we will need the corner offsets of
+      // the upper left of the frame and the upper left of the clip rect.  The
+      // clip rect should be completely within the frame.  This just translates the value
+      // to make the upper left of the frame be 0,0.
+      //
+      ossimIrect offsetRect(tempDelta.x,
+                            tempDelta.y,
+                            tempDelta.x + clipRect.width()-1,
+                            tempDelta.y + clipRect.height()-1);
+
+      // each subframe is 64x64.  We will actually use 256x256 since
+      // we will be uncompressing them.  Note CADRG is a 256x256 tile
+      // compressed to 64x64x12 bit data
+      //
+      ossimIrect subFrameRect(offsetRect.ul().x/256,
+                              offsetRect.ul().y/256,
+                              (offsetRect.lr().x)/256,
+                              (offsetRect.lr().y)/256);
+
+      ossim_int32 row = 0;
+      ossim_int32 col = 0;
+      ossim_uint32 i = 0;
+      ossim_uint32 j = 0;
+      ossim_uint32 readPtr = 0;
+      for(row = subFrameRect.ul().y; row <= subFrameRect.lr().y; ++row)
+      {
+         for(col = subFrameRect.ul().x; col <= subFrameRect.lr().x; ++col)
+         {
+            readPtr = 0;
+            if(aFrame.fillSubFrameBuffer(m_compressedBuffer, 0, row, col))
+            {
+               for (i = 0; i < 256; i += 4)
+               {
+                  for (j = 0; j < 256; j += 8)
+                  {
+                     ossim_uint16 firstByte  = m_compressedBuffer[readPtr++] & 0xff;
+                     ossim_uint16 secondByte = m_compressedBuffer[readPtr++] & 0xff;
+                     ossim_uint16 thirdByte  = m_compressedBuffer[readPtr++] & 0xff;
+
+                     //because dealing with half-bytes is hard, we
+                     //uncompress two 4x4 tiles at the same time. (a
+                     //4x4 tile compressed is 12 bits )
+                     // this little code was grabbed from openmap software.
+
+                     /* Get first 12-bit value as index into VQ table */
+                     // I think we need to swap
+                     ossim_uint16 val1 = (firstByte << 4) | (secondByte >> 4);
+
+                     /* Get second 12-bit value as index into VQ table*/
+                     ossim_uint16 val2 = ((secondByte & 0x000F) << 8) | thirdByte;
+
+                     for (ossim_uint32 t = 0; t < 4; ++t)
+                     {
+                        for (ossim_uint32 e = 0; e < 4; ++e)
+                        {
+                           ossim_uint16 tableVal1 = compressionSection->getTable()[t].theData[val1*4 + e] & 0xff;
+                           ossim_uint16 tableVal2 = compressionSection->getTable()[t].theData[val2*4 + e] & 0xff;
+
+                           ossim_uint32 pixindex = ((i+t)*256) + (j + e);
+                           const ossim_uint8* color1 = colorTable[0].getStartOfData(tableVal1);
+                           const ossim_uint8* color2 = colorTable[0].getStartOfData(tableVal2);
+
+
+                           tempRow[pixindex]      = color1[0];
+                           tempRow[pixindex + 4]  = color2[0];
+                        } //for e
+                     } //for t
+                  }  /* for j */
+               } //for i
+            }
+            else
+            {
+               memset(m_uncompressedBuffer, 0, 256*256);
+            }
+            ossim_int32 tCol = col*256;
+            ossim_int32 tRow = row*256;
+            ossimIrect subRectToFill(frameRect.ul().x + tCol,
+                                     frameRect.ul().y + tRow,
+                                     frameRect.ul().x + tCol + 255,
+                                     frameRect.ul().y + tRow + 255);
+            tile->loadTile(m_uncompressedBuffer,
+                           subRectToFill,
+                           OSSIM_BSQ);
+         }
+      }
+   }  
+}
+
+void ossimRpfCacheTileSource::allocateForProduct()
+{
+   if(m_productType ==  OSSIM_PRODUCT_TYPE_UNKNOWN)
+   {
+      return;
+   }
+   if(m_uncompressedBuffer)
+   {
+      delete [] m_uncompressedBuffer;
+      m_uncompressedBuffer = 0;
+   }
+   if(m_compressedBuffer)
+   {
+      delete [] m_compressedBuffer;
+      m_compressedBuffer = 0;
+   }
+
+   // a CADRG and CIBis a 64*64*12 bit buffer and must divide by 8 to
+   // convert to bytes
+   m_compressedBuffer   = new ossim_uint8[(64*64*12)/8];
+   if(m_productType == OSSIM_PRODUCT_TYPE_CIB)
+   {
+      m_uncompressedBuffer = new ossim_uint8[256*256];
+   }
+   else
+   {
+      m_uncompressedBuffer = new ossim_uint8[256*256*3];
+   }
+
+   m_tile = ossimImageDataFactory::instance()->create(this, this);
+   m_tile->initialize();
+}
+
+void ossimRpfCacheTileSource::deleteAll()
+{
+   theOverview = 0;
+}
+
+bool ossimRpfCacheTileSource::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)const
+{
+   bool result = ossimImageHandler::saveState(kwl, prefix);
+
+   return result;
+}
+
+bool ossimRpfCacheTileSource::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   const char* MODULE = "ossimRpfCacheTileSource::loadState";
+
+   if(traceDebug())
+   {
+      CLOG << "Entering..." << endl;
+   }
+   bool result = ossimImageHandler::loadState(kwl, prefix);
+
+   if(!result)
+   {
+      if(traceDebug())
+      {
+         CLOG << "Leaving..." << endl;
+      }
+      return false;
+   }
+   const char* lookup = 0;
+   lookup = kwl.find(ossimString(prefix), "entry");
+   ossim_int32 entry = ossimString(lookup).toInt32();
+
+   // if an entry is specified then
+   // call the open with an entry number
+   if(lookup)
+   {
+      if(traceDebug())
+      {
+         CLOG << "Leaving..." << endl;
+      }
+      result = ossimImageHandler::open(theImageFile);
+      setCurrentEntry(entry);
+      return result;
+   }
+
+   result = ossimImageHandler::open(theImageFile);
+
+   return result;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getImageTileWidth() const
+{
+   return 256;
+}
+
+ossim_uint32 ossimRpfCacheTileSource::getImageTileHeight() const
+{
+   return 256;
+}
+
+bool ossimRpfCacheTileSource::isCib() const
+{
+   return (m_productType==OSSIM_PRODUCT_TYPE_CIB);
+}
+
+bool ossimRpfCacheTileSource::isCadrg() const
+{
+   return (m_productType==OSSIM_PRODUCT_TYPE_CADRG);
+}
+
+ossimRefPtr<ossimProperty> ossimRpfCacheTileSource::getProperty(const ossimString& name)const
+{
+   if(name == "file_type")
+   {
+      if(m_productType == OSSIM_PRODUCT_TYPE_CIB)
+      {
+         return new ossimStringProperty("file_type", "CIB");
+      }
+      else if(m_productType == OSSIM_PRODUCT_TYPE_CADRG)
+      {
+         return new ossimStringProperty("file_type", "CADRG");
+      }
+      return 0;
+   }
+   return ossimImageHandler::getProperty(name);
+}
+
+void ossimRpfCacheTileSource::populateLut()
+{
+   theLut = 0;
+   if(m_fileNames.size() > 0)
+   {
+      // bool found = false;
+      ossimRpfFrameEntry tempEntry;
+      ossimRpfFrame aFrame;
+      ossimFilename fileName = m_fileNames[0].split("|")[0];
+      // if (fileName.exists())
+      // {
+      //    found = true;
+      // }
+
+      if(aFrame.parseFile(fileName)
+         == ossimErrorCodes::OSSIM_OK)
+      {
+         const vector<ossimRpfColorGrayscaleTable>& colorTable =
+            aFrame.getColorGrayscaleTable();
+
+         // ESH 03/2009 -- Partial fix for ticket #646.
+         // Crash fix on reading RPFs: Make sure the colorTable vector 
+         // has entries before trying to make use of them. 
+         int numTables = (int)colorTable.size();
+
+         ossim_uint32 numElements = (numTables > 0) ? colorTable[0].getNumberOfElements() : 0;
+         if(numElements > 0)
+         {
+            if((m_productType == OSSIM_PRODUCT_TYPE_CIB)||
+               (m_productType == OSSIM_PRODUCT_TYPE_CADRG))
+            {
+               theLut = new ossimNBandLutDataObject(numElements,
+                                                    3,
+                                                    OSSIM_UINT8);
+            }
+            else
+            {
+               theLut = 0;
+               return;
+            }
+            ossim_uint32 idx = 0;
+
+            for(idx = 0; idx < numElements;++idx)
+            {
+               const ossim_uint8* startOfData = colorTable[0].getStartOfData(idx);
+               switch(m_productType)
+               {
+                  case OSSIM_PRODUCT_TYPE_CIB:
+                  {
+                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     break;
+                  }
+                  case OSSIM_PRODUCT_TYPE_CADRG:
+                  {
+                     (*theLut)[idx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[0]);
+                     (*theLut)[idx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[1]);
+                     (*theLut)[idx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(startOfData[2]);
+                     break;
+                  }
+                  default:
+                  {
+                     break;
+                  }
+               }
+            }
+         }
+      }
+   }
+}
+
+void ossimRpfCacheTileSource::establishDecimationFactors()
+{
+   theDecimationFactors.clear();
+   
+   // Just needed to set the first R level here, the base class can do the rest:
+   ossimImageHandler::establishDecimationFactors();
+}
+
diff --git a/ossim/src/ossim/imaging/ossimS16ImageData.cpp b/src/imaging/ossimS16ImageData.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimS16ImageData.cpp
rename to src/imaging/ossimS16ImageData.cpp
diff --git a/ossim/src/ossim/imaging/ossimSFIMFusion.cpp b/src/imaging/ossimSFIMFusion.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimSFIMFusion.cpp
rename to src/imaging/ossimSFIMFusion.cpp
diff --git a/ossim/src/ossim/imaging/ossimSICDToDetectedImage.cpp b/src/imaging/ossimSICDToDetectedImage.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimSICDToDetectedImage.cpp
rename to src/imaging/ossimSICDToDetectedImage.cpp
diff --git a/src/imaging/ossimScalarRemapper.cpp b/src/imaging/ossimScalarRemapper.cpp
new file mode 100644
index 0000000..9740e4f
--- /dev/null
+++ b/src/imaging/ossimScalarRemapper.cpp
@@ -0,0 +1,637 @@
+//*******************************************************************
+// Copyright (C) 2001 ImageLinks Inc.
+//
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimScalarRemapper.
+// This class is used to remap image data from one scalar type to another.
+//
+//*******************************************************************
+//  $Id$
+
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimPropertyEvent.h>
+#include <ossim/base/ossimRefreshEvent.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimStringProperty.h>
+
+#include <iostream>
+
+RTTI_DEF1(ossimScalarRemapper,
+          "ossimScalarRemapper",
+          ossimImageSourceFilter)
+
+static const ossimTrace traceDebug("ossimScalarRemapper:debug");
+   
+ossimScalarRemapper::ossimScalarRemapper()
+   :
+      ossimImageSourceFilter(),
+      theNormBuf(NULL),
+      theTile(NULL),
+      theOutputScalarType(OSSIM_UINT8),
+      theByPassFlag(false),
+      thePreserveMagnitudeFlag(false)
+{
+}
+
+ossimScalarRemapper::ossimScalarRemapper(ossimImageSource* inputSource,
+                                         ossimScalarType outputScalarType)
+   :
+      ossimImageSourceFilter(inputSource),
+      theNormBuf(NULL),
+      theTile(NULL),
+      theOutputScalarType(outputScalarType),
+      theByPassFlag(false),
+      thePreserveMagnitudeFlag(false)
+{
+   if(inputSource)
+   {
+      if (inputSource->getOutputScalarType() == outputScalarType)
+      {
+         // Disable this filter simply return the inputSource's data.
+         theByPassFlag = true;
+         
+         // Nothing else to do.
+      }
+      else
+      {
+         theByPassFlag = false;
+      }
+   }
+   else
+   {
+      theByPassFlag = true;
+   }
+}
+
+ossimScalarRemapper::~ossimScalarRemapper()
+{
+   destroy();
+}
+
+void ossimScalarRemapper::destroy()
+{
+   if (theNormBuf)
+   {
+      delete [] theNormBuf;
+      theNormBuf = NULL;
+   }
+   theTile      = NULL;
+}
+
+ossimRefPtr<ossimImageData> ossimScalarRemapper::getTile(
+   const ossimIrect& tileRect, ossim_uint32 resLevel)
+{
+   if(traceDebug())
+   {
+     std::cout << "ossimScalarRemapper::getTile START ... " << tileRect << " RES: " << resLevel << std::endl;
+   }
+   if(!theInputConnection)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   // Fetch tile from pointer from the input source.
+   ossimRefPtr<ossimImageData> inputTile =
+      theInputConnection->getTile(tileRect, resLevel);
+
+   // Check for remap bypass:
+   if ( !isSourceEnabled()||theByPassFlag )
+   {
+      return inputTile;
+   }
+
+   // Check for first time through.
+   if ( !theTile.valid() )
+   {
+      allocate();
+      
+      if ( !theTile.valid() )
+      {
+         // This can happen if input/output scalars are the same.
+         return inputTile;
+      }
+   }
+
+   // Capture the size prior to a possible resize.
+   ossim_uint32 oldSize = theTile->getSize();
+
+   // Set the origin,bands of the output tile.
+   theTile->setImageRectangle(tileRect);
+
+   ossim_uint32 newSize = theTile->getSize();
+
+   // Check for size change before possible return.
+   if(newSize != oldSize)
+   {
+      if(theNormBuf)
+      {
+         //---
+         // Delete the current buffer since it is the wrong size.
+         // 
+         // NOTE:
+         // We won't reallocate it yet since we could return without using it.
+         // It will be checked prior to using later.
+         //---
+         delete [] theNormBuf;
+         theNormBuf = NULL;
+      }
+   }
+   
+   if ( !inputTile.valid() ||
+        (inputTile->getDataObjectStatus() == OSSIM_NULL) ||
+        (inputTile->getDataObjectStatus() == OSSIM_EMPTY) )
+   {
+      //---
+      // Since the filter is enabled, return theTile which is of the
+      // correct scalar type.
+      //---
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   if (!theNormBuf) // First time through or size changed and was deleted...
+   {
+      theNormBuf = new double[newSize];
+      memset(theNormBuf, '\0', newSize);
+   }
+
+   if (inputTile->getScalarType() == theOutputScalarType)
+   {
+      // Scalar types already the same.  Nothing to do...
+      return inputTile;
+   }
+   
+   if(thePreserveMagnitudeFlag)
+   {
+     switch(inputTile->getScalarType())
+     {
+        case OSSIM_SINT16:
+        {
+          inputTile->copyTileToFloatBuffer(ossim_sint16(0), theTile->getFloatBuf());
+          break;
+        }
+        case OSSIM_UINT16:
+        {
+          inputTile->copyTileToFloatBuffer(ossim_uint16(0), theTile->getFloatBuf());
+          break;
+        }
+        case OSSIM_SINT32:
+        {
+          inputTile->copyTileToFloatBuffer(ossim_sint32(0), theTile->getFloatBuf());
+          break;
+        }
+        case OSSIM_UINT32:
+        {
+          inputTile->copyTileToFloatBuffer(ossim_uint32(0), theTile->getFloatBuf());
+          break;
+        }
+        default:
+        {
+          break;
+        }
+     }
+   }
+   else
+   {
+     switch(inputTile->getScalarType())
+     {
+        case OSSIM_NORMALIZED_DOUBLE:
+        {
+           // Un-normalize and copy the buffer to the destination tile.
+           theTile->copyNormalizedBufferToTile(
+              static_cast<double*>( inputTile->getBuf() ) );
+           break;
+        }
+        case OSSIM_NORMALIZED_FLOAT:
+        {
+           // Un-normalize and copy the buffer to the destination tile.
+           theTile->copyNormalizedBufferToTile(
+              static_cast<float*>( inputTile->getBuf() ) );
+           break;
+        }
+        default:
+        {
+           //---
+           // NOTE: stretchMinMax commented out as it was incorrectly not resetting
+           // the tile's min/max data members; hence, messing up the downstream copy
+           // to normalized buffer. (drb 02 Feb. 2013)
+           // Special case.  Stretch assuming caller want to view this data.
+           //---
+           // inputTile->stretchMinMax();
+
+           // Normalize and copy the source tile to a buffer.
+           inputTile->copyTileToNormalizedBuffer(theNormBuf);
+         
+           // Un-normalize and copy the buffer to the destination tile.
+           theTile->copyNormalizedBufferToTile(theNormBuf);
+
+           break;
+        }
+     }
+   }
+   
+   theTile->validate();
+   if(traceDebug())
+   {
+     std::cout << "ossimScalarRemapper::getTile END ... " << tileRect << " RES: " << resLevel << std::endl;
+   }
+
+   
+   return theTile;
+}
+
+ossimScalarType ossimScalarRemapper::getOutputScalarType() const
+{
+   if(isSourceEnabled()&&!theByPassFlag)
+   {
+      return theOutputScalarType;
+   }
+
+   return ossimImageSourceFilter::getOutputScalarType();
+}
+
+void ossimScalarRemapper::setOutputScalarType(ossimScalarType scalarType)
+{
+   if (scalarType == OSSIM_SCALAR_UNKNOWN)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimScalarRemapper::setOutputScalarType WARN:\n"
+         << "OSSIM_SCALAR_UNKNOWN passed to method.  No action taken..."
+         << std::endl;
+      }
+      return;
+   }
+   
+   if (theInputConnection)
+   {
+      if ( scalarType == theInputConnection->getOutputScalarType() )
+      {
+         // Input same as output, nothing for us to do...
+         theByPassFlag = true;
+      }
+      else // Types not equal...
+      {
+         theByPassFlag = false;
+         destroy();
+      }
+   }
+   else // No input source, disable.
+   {
+      theByPassFlag = true;
+   }
+
+   theOutputScalarType = scalarType;
+}
+
+void ossimScalarRemapper::setOutputScalarType(ossimString scalarType)
+{
+   int scalar =
+      ossimScalarTypeLut::instance()->getEntryNumber(scalarType.c_str());
+   
+   if (scalar != ossimLookUpTable::NOT_FOUND)
+   {
+      setOutputScalarType(static_cast<ossimScalarType>(scalar));
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimScalarRemapper ERROR:"
+         << "\nUnknown scalar type:  " << scalarType.c_str() << std::endl;
+      }
+   }
+}
+
+void ossimScalarRemapper::initialize()
+{
+   //---
+   // Call the base class initialize.
+   // Note:  This will reset "theInputConnection" if it changed...
+   //---
+   ossimImageSourceFilter::initialize();
+
+   if (theInputConnection)
+   {
+      // Set the bypass flag accordingly...
+      if ( theInputConnection->getOutputScalarType() == 
+           theOutputScalarType )
+      {
+         theByPassFlag = true;
+      }
+      else
+      {
+         theByPassFlag = false;
+      }
+      
+      if (theTile.valid())
+      {
+         //---
+         // Check for:
+         // - bypass
+         // - disabled(!enabled)
+         // - scalar change
+         // - band count change
+         //---
+         if ( theByPassFlag ||
+              !theEnableFlag ||
+              ( theInputConnection->getOutputScalarType() !=
+                theOutputScalarType ) ||
+              ( theInputConnection->getNumberOfOutputBands() !=
+                theTile->getNumberOfBands() ) )
+         {
+            destroy();  // Reallocated first unbypassed getTile.
+         }
+      }
+   }
+}
+
+void ossimScalarRemapper::allocate()
+{
+   destroy();
+
+   if(!theInputConnection) // Nothing to do here.
+   {
+      setInitializedFlag(false);
+      theByPassFlag = true;
+      return;
+   }
+   
+   if (theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
+   {
+      // default to OSSIM_UINT8
+      theOutputScalarType = OSSIM_UINT8;
+   }
+   
+   if(theInputConnection &&
+      (getOutputScalarType() != theInputConnection->getOutputScalarType())&&
+      (theInputConnection->getOutputScalarType() != OSSIM_SCALAR_UNKNOWN)&&
+      (getOutputScalarType() != OSSIM_SCALAR_UNKNOWN))
+   {
+      theByPassFlag = false;
+      
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+
+      // Initialize the tile.
+      theTile->initialize();
+      
+      // Set the base class flags to be initialized and enabled.
+      setInitializedFlag(true);
+      
+   } // End of "if(theInputConnection->isConnected()..."
+   else
+   {
+      // Set to not initialized and disabled.
+      setInitializedFlag(false);
+      theByPassFlag = true;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimScalarRemapper::allocate() DEBUG"
+         << "\ninput scalar:  " << theInputConnection->getOutputScalarType()
+         << "\noutput scalar: " << getOutputScalarType()
+         << "\nenabled:  " << (isSourceEnabled()?"true":"false")
+         << std::endl;
+   }
+}
+
+void ossimScalarRemapper::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property) return;
+
+   if(property->getName() == "Output scalar type")
+   {
+      theOutputScalarType = ossimScalarTypeLut::instance()->
+         getScalarTypeFromString(property->valueToString());
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimScalarRemapper::getProperty(const ossimString& name)const
+{
+   if(name == "Output scalar type")
+   {
+      std::vector<ossimString> scalarNames;
+
+      ossim_int32 tableSize = (ossim_int32)ossimScalarTypeLut::instance()->
+         getTableSize();
+      ossim_int32 idx;
+
+      for(idx = 0; idx < tableSize; ++idx)
+      {
+         scalarNames.push_back(ossimScalarTypeLut::instance()->
+                               getEntryString(idx));
+      }
+      ossimStringProperty* stringProp =
+         new ossimStringProperty("Output scalar type",
+                                 ossimScalarTypeLut::instance()->getEntryString((ossim_int32)theOutputScalarType),
+                                 false,
+                                 scalarNames);
+      stringProp->clearChangeType();
+      stringProp->setReadOnlyFlag(false);
+      stringProp->setCacheRefreshBit();
+      
+      return stringProp;
+   }
+
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimScalarRemapper::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+   propertyNames.push_back("Output scalar type");
+}
+
+bool ossimScalarRemapper::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix) const
+{
+   ossimImageSourceFilter::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           ossimKeywordNames::SCALAR_TYPE_KW,
+           ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType),
+           true);
+   kwl.add(prefix, "elevation", ossimString::toString(thePreserveMagnitudeFlag).c_str());
+
+   return true;
+}
+
+bool ossimScalarRemapper::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   ossimImageSourceFilter::loadState(kwl, prefix);
+
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimScalarRemapper::loadState\n"
+            << " ERROR detected in keyword list!  State not loaded."
+            << std::endl;
+      }
+      return false;
+   }
+
+   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
+
+   if (scalar != ossimLookUpTable::NOT_FOUND)
+   {
+      setOutputScalarType(static_cast<ossimScalarType>(scalar));
+   }
+   const char* lookup = kwl.find(prefix, "elevation");
+   if(lookup)
+   {
+      thePreserveMagnitudeFlag = ossimString(lookup).toBool();
+   }
+
+   return true;
+}
+
+ossimString ossimScalarRemapper::getOutputScalarTypeString() const
+{
+   return ossimScalarTypeLut::instance()->getEntryString(theOutputScalarType);
+}
+
+void ossimScalarRemapper::propertyEvent(ossimPropertyEvent& event)
+{
+   // if my properties have changed then just initialize
+   //
+   if(event.getObject() == this)
+   {
+      initialize();
+   }
+   else // if an input property has changed just check to see if the number
+   {    // of bands has changed
+      
+      if(!theTile)
+      {
+         initialize();
+      }
+      else
+      {
+         int b = theInputConnection->getNumberOfOutputBands();
+         if((int)theTile->getNumberOfBands() != b)
+         {
+            initialize();
+         }
+      }
+   }
+}
+
+void ossimScalarRemapper::refreshEvent(ossimRefreshEvent& event)
+{
+   // if my properties have changed then just initialize
+   if(event.getObject() == this)
+   {
+      initialize();
+   }
+   else // if an input property has changed just check to see if the number
+   {    // of bands has changed
+      
+      if(!theTile)
+      {
+         initialize();
+      }
+      else
+      {
+         int b = theInputConnection->getNumberOfOutputBands();
+         if((int)theTile->getNumberOfBands() != b)
+         {
+            initialize();
+         }
+      }
+   }
+}
+
+double ossimScalarRemapper::getNullPixelValue(ossim_uint32 band) const
+{
+   if(!isSourceEnabled()||theByPassFlag)
+   {
+      if(theInputConnection)
+      {
+         return theInputConnection->getNullPixelValue(band);
+      }
+   }
+   else if(theTile.valid())
+   {
+      if (band < theTile->getNumberOfBands())
+      {
+         return theTile->getNullPix(band);
+      }
+   }
+   
+   return ossim::defaultNull(theOutputScalarType);
+}
+
+double ossimScalarRemapper::getMinPixelValue(ossim_uint32 band) const
+{
+   if(!isSourceEnabled()||theByPassFlag)
+   {
+      if(theInputConnection)
+      {
+         return theInputConnection->getMinPixelValue(band);
+      }
+   }
+   else if(theTile.valid())
+   {
+      if (band < theTile->getNumberOfBands())
+      {
+         return theTile->getMinPix(band);
+      }
+   }
+   
+   return ossim::defaultMin(theOutputScalarType);
+}
+
+double ossimScalarRemapper::getMaxPixelValue(ossim_uint32 band) const
+{
+   if(!isSourceEnabled()||theByPassFlag)
+   {
+      if(theInputConnection)
+      {
+         return theInputConnection->getMaxPixelValue(band);
+      }
+   }
+   else if(theTile.valid())
+   {
+      if (band < theTile->getNumberOfBands())
+      {
+         return theTile->getMaxPix(band);
+      }
+   }
+   
+   return ossim::defaultMax(theOutputScalarType);
+}
+
+void ossimScalarRemapper::setPreserveMagnitude(bool value)
+{
+   thePreserveMagnitudeFlag = value;
+}
+
+ossimString ossimScalarRemapper::getLongName()const
+{
+   return ossimString("Scalar Remapper, filters between different scalar types.");
+}
+
+ossimString ossimScalarRemapper::getShortName()const
+{
+   return ossimString("Scalar Remapper");
+}
+
diff --git a/src/imaging/ossimScaleFilter.cpp b/src/imaging/ossimScaleFilter.cpp
new file mode 100644
index 0000000..c360b25
--- /dev/null
+++ b/src/imaging/ossimScaleFilter.cpp
@@ -0,0 +1,963 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimScaleFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
+#include <ossim/imaging/ossimScaleFilter.h>
+#include <ossim/imaging/ossimFilter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimDiscreteConvolutionKernel.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimScaleFilter, "ossimScaleFilter", ossimImageSourceFilter);
+
+//**************************************************************************************************
+ossimScaleFilter::ossimScaleFilter()
+   :ossimImageSourceFilter(),
+    m_BlankTile(NULL),
+    m_Tile(NULL),
+    m_MinifyFilter(NULL),
+    m_MagnifyFilter(NULL),
+    m_MinifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
+    m_MagnifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
+    m_ScaleFactor(1.0, 1.0),
+    m_InverseScaleFactor(1.0, 1.0),
+    m_TileSize(64, 64),
+    m_BlurFactor(1.0)
+{
+   m_InputRect.makeNan();
+   m_MinifyFilter  = new ossimNearestNeighborFilter();
+   m_MagnifyFilter = new ossimNearestNeighborFilter();
+}
+
+//**************************************************************************************************
+ossimScaleFilter::ossimScaleFilter(ossimImageSource* inputSource,
+                                   const ossimDpt& scaleFactor)
+   :ossimImageSourceFilter(inputSource),
+    m_BlankTile(NULL),
+    m_Tile(NULL),
+    m_MinifyFilter(NULL),
+    m_MagnifyFilter(NULL),
+    m_MinifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
+    m_MagnifyFilterType(ossimScaleFilter_NEAREST_NEIGHBOR),
+    m_ScaleFactor(scaleFactor),
+    m_TileSize(64, 64),
+    m_BlurFactor(1.0)
+{
+   m_InputRect.makeNan();
+   m_MinifyFilter  = new ossimNearestNeighborFilter();
+   m_MagnifyFilter = new ossimNearestNeighborFilter();
+}
+
+//**************************************************************************************************
+ossimScaleFilter::~ossimScaleFilter()
+{
+   if(m_MinifyFilter)
+   {
+      delete m_MinifyFilter;
+      m_MinifyFilter = NULL;
+   }
+   
+   if(m_MagnifyFilter)
+   {
+      delete m_MagnifyFilter;
+      m_MagnifyFilter = NULL;
+   }
+}
+
+//**************************************************************************************************
+ossimRefPtr<ossimImageData> ossimScaleFilter::getTile(
+   const ossimIrect& tileRect, ossim_uint32 resLevel)
+{
+   
+   if((!isSourceEnabled())||
+      (!theInputConnection)||
+      ((m_ScaleFactor.x == 1.0)&&
+       (m_ScaleFactor.y == 1.0)&&
+       (m_BlurFactor == 1.0)))
+   {
+      return ossimImageSourceFilter::getTile(tileRect, resLevel);
+   }
+   if(!m_Tile.valid())
+   {
+      allocate();
+   }
+
+   if(!m_Tile)
+   {
+      return ossimImageSourceFilter::getTile(tileRect, resLevel);
+   }
+
+   m_Tile->makeBlank();
+
+                       
+   ossimIrect imageRect = tileRect*m_InverseScaleFactor;
+
+   m_Tile->setImageRectangle(tileRect);
+   m_BlankTile->setImageRectangle(tileRect);
+
+
+   double xSupport;
+   double ySupport;
+
+   getSupport(xSupport, ySupport);
+   
+   ossimIpt deltaPt;
+   deltaPt.x = (ossim_int32)ceil(xSupport);
+   deltaPt.y = (ossim_int32)ceil(ySupport);
+
+   imageRect = ossimIrect(imageRect.ul().x - (deltaPt.x),
+                          imageRect.ul().y - (deltaPt.y),
+                          imageRect.lr().x + (deltaPt.x),
+                          imageRect.lr().y + (deltaPt.y));
+
+   
+   runFilter(imageRect, tileRect);
+   
+   m_Tile->validate();
+   
+   return m_Tile;
+}
+
+//**************************************************************************************************
+void ossimScaleFilter::runFilter(const ossimIrect& imageRect,
+                                 const ossimIrect& viewRect)
+{
+   switch(m_Tile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         runFilterTemplate((ossim_uint8)0,
+                           imageRect,
+                           viewRect);
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         runFilterTemplate((ossim_uint16)0,
+                           imageRect,
+                           viewRect);
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         runFilterTemplate((ossim_sint16)0,
+                           imageRect,
+                           viewRect);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         runFilterTemplate((ossim_uint32)0,
+                           imageRect,
+                           viewRect);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         runFilterTemplate((ossim_float64)0,
+                           imageRect,
+                           viewRect);
+         break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         runFilterTemplate((ossim_float32)0,
+                           imageRect,
+                           viewRect);
+         break;
+      }
+      default:
+         break;
+   }
+}
+
+//**************************************************************************************************
+template <class T>
+void ossimScaleFilter::runFilterTemplate(T dummy,
+                                         const ossimIrect& imageRect,
+                                         const ossimIrect& viewRect)
+{
+   ossimRefPtr<ossimImageData> inputData =
+      theInputConnection->getTile(imageRect);
+
+   if(!inputData.valid()   ||
+      !inputData->getBuf() ||
+      (inputData->getDataObjectStatus() == OSSIM_EMPTY))
+   {
+      return;
+   }
+
+   ossim_int32 h = imageRect.height();
+   ossimRefPtr<ossimImageData> tempData =
+      ossimImageDataFactory::instance()->create(NULL,
+                                                inputData->getScalarType(),
+                                                inputData->getNumberOfBands(),
+                                                viewRect.width(),
+                                                h);
+   tempData->setOrigin(ossimIpt(viewRect.ul().x,
+                                imageRect.ul().y));
+   
+   tempData->initialize();
+   
+   if((m_ScaleFactor.x != 1.0)||
+      (m_BlurFactor != 1.0))
+   {
+      runHorizontalFilterTemplate(dummy,
+                                  inputData,
+                                  tempData);
+      tempData->validate();
+   }
+   else
+   {
+      tempData->loadTile(inputData.get());
+   }
+   
+   if((m_ScaleFactor.y != 1.0)||
+      (m_BlurFactor != 1.0))
+   {
+      runVerticalFilterTemplate(dummy,
+                                tempData,
+                                m_Tile);
+   }
+   else
+   {
+      m_Tile->loadTile(tempData.get());
+   }
+   
+   m_Tile->validate();
+}
+
+//**************************************************************************************************
+ossimIrect ossimScaleFilter::getBoundingRect(ossim_uint32 resLevel)const
+{
+   ossimIrect result = ossimImageSourceFilter::getBoundingRect(resLevel);
+
+   if(!result.hasNans())
+   {
+      result = ossimIrect(result.ul().x,
+                          result.ul().y,
+                          result.lr().x+1,
+                          result.lr().y+1);
+      result *= m_ScaleFactor;
+   }
+   
+   return result;
+}
+
+//**************************************************************************************************
+void ossimScaleFilter::setFilterType(ossimScaleFilterType filterType)
+{
+   setFilterType(filterType, filterType);
+}
+
+
+//**************************************************************************************************
+void ossimScaleFilter::setFilterType(ossimScaleFilterType minifyFilterType,
+                                     ossimScaleFilterType magnifyFilterType)
+{
+   if(m_MinifyFilter)
+   {
+      delete m_MinifyFilter;
+      m_MinifyFilter = NULL;
+   }
+   if(m_MagnifyFilter)
+   {
+      delete m_MagnifyFilter;
+      m_MagnifyFilter = NULL;
+   }
+   
+   m_MinifyFilterType  = minifyFilterType;
+   m_MagnifyFilterType = magnifyFilterType;
+   
+   m_MinifyFilter  = createNewFilter(minifyFilterType, m_MinifyFilterType);
+   m_MagnifyFilter = createNewFilter(magnifyFilterType, m_MagnifyFilterType);
+}
+
+//**************************************************************************************************
+ossimFilter* ossimScaleFilter::createNewFilter(ossimScaleFilterType filterType,
+                                               ossimScaleFilterType& result)
+{
+   switch(filterType)
+   {
+   case ossimScaleFilter_NEAREST_NEIGHBOR:
+   {
+      return new ossimNearestNeighborFilter();
+   }
+   case ossimScaleFilter_BOX:
+   {
+      return new ossimBoxFilter();
+   }
+   case ossimScaleFilter_GAUSSIAN:
+   {
+      return new ossimGaussianFilter();
+   }
+   case ossimScaleFilter_CUBIC:
+   {
+      return new ossimCubicFilter();
+   }
+   case ossimScaleFilter_HANNING:
+   {
+      return new ossimHanningFilter();
+   }
+   case ossimScaleFilter_HAMMING:
+   {
+      return new ossimHammingFilter();
+   }
+   case ossimScaleFilter_LANCZOS:
+   {
+      return new ossimLanczosFilter();
+   }
+   case ossimScaleFilter_CATROM:
+   {
+      return new ossimCatromFilter();
+   }
+   case ossimScaleFilter_MITCHELL:
+   {
+      return new ossimMitchellFilter();
+   }
+   case ossimScaleFilter_BLACKMAN:
+   {
+      return new ossimBlackmanFilter();
+   }
+   case ossimScaleFilter_BLACKMAN_SINC:
+   {
+      return new ossimBlackmanSincFilter();
+   }
+   case ossimScaleFilter_BLACKMAN_BESSEL:
+   {
+      return new ossimBlackmanBesselFilter();
+   }
+   case ossimScaleFilter_QUADRATIC:
+   {
+      return new ossimQuadraticFilter();
+   }
+   case ossimScaleFilter_TRIANGLE:
+   {
+      return new ossimTriangleFilter();
+   }
+   case ossimScaleFilter_HERMITE:
+   {
+      return new ossimHermiteFilter();
+   }
+   
+   }
+
+   result = ossimScaleFilter_NEAREST_NEIGHBOR;
+   return new ossimNearestNeighborFilter();
+}
+
+//**************************************************************************************************
+void ossimScaleFilter::setScaleFactor(const ossimDpt& scale)
+{
+   m_ScaleFactor = scale;
+   if(fabs(m_ScaleFactor.x) <= FLT_EPSILON)
+   {
+      m_ScaleFactor.x = 1.0;
+   }
+   if(fabs(m_ScaleFactor.y) <= FLT_EPSILON)
+   {
+      m_ScaleFactor.y = 1.0;
+   }
+
+   m_InverseScaleFactor.x = 1.0/m_ScaleFactor.x;
+   m_InverseScaleFactor.y = 1.0/m_ScaleFactor.y;
+
+   // A change in the scale factor implies a change to the image geometry. If one has been created
+   // it needs to be modified:
+   updateGeometry();
+}
+
+
+//**************************************************************************************************
+template <class T> void ossimScaleFilter::runHorizontalFilterTemplate(
+   T /* dummy */,
+   const ossimRefPtr<ossimImageData>& input,
+   ossimRefPtr<ossimImageData>& output)
+{
+   ossimIrect viewRect  = output->getImageRectangle();
+   ossimIrect imageRect = input->getImageRectangle();
+   ossim_int32 vw = viewRect.width();
+   ossim_int32 vh = viewRect.height();
+   ossim_int32 iw = imageRect.width();
+   ossimIpt origin(viewRect.ul());
+   ossimIpt imageOrigin(imageRect.ul());
+   ossimIpt inputUl = m_InputRect.ul();
+   ossimIpt inputLr = m_InputRect.lr();
+   
+   double scale = 0.0;
+   double support = 0.0;
+   ossim_int32 x = 0;
+   ossim_int32 y = 0;
+   ossim_int32 start = 0;
+   ossim_int32 stop  = 0;
+   ossim_int32 kernelIdx = 0;
+   const ossimFilter* filter = getHorizontalFilter();
+   ossim_float64 center = 0.0;
+   ossim_int32 bandIdx = 0;
+   ossim_int32 numberOfBands = m_Tile->getNumberOfBands();
+   
+   scale = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.x, 1.0);
+   
+   support=scale*filter->getSupport();
+   if (support <= 0.5)
+   {
+      support = 0.5 + FLT_EPSILON;
+      scale = 1.0;
+   }
+   scale=1.0/scale;
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      T* imageBuf = (T*)input->getBuf(bandIdx);
+      T* viewBuf  = (T*)output->getBuf(bandIdx);
+      T np        = (T)input->getNullPix(bandIdx);
+      T outNp     = (T)output->getNullPix(bandIdx);
+      T outMinPix = (T)output->getMinPix(bandIdx);
+      T outMaxPix = (T)output->getMaxPix(bandIdx);
+      
+      for(x = 0; x < vw; ++x)
+      {
+         center=(origin.x + x+ .5)/m_ScaleFactor.x;
+         start=ossim::max((ossim_int32)ossim::round<int>(center-support), (ossim_int32)inputUl.x);
+         stop=ossim::min((ossim_int32)ossim::round<int>(center+support), (ossim_int32)inputLr.x);
+         ossim_int32 delta = stop-start;
+         if (delta <= 0)
+         {
+            break;
+         }
+         vector<double> kernel(delta);
+         double density=0.0;
+         
+         for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
+         {
+            double t = scale*(start + kernelIdx -
+                              center + .5);
+            kernel[kernelIdx] = filter->filter(t,
+                                               filter->getSupport());
+            density += kernel[kernelIdx];
+         }
+         if ((density != 0.0) && (density != 1.0))
+         {
+            /*
+              Normalize.
+            */
+            density=1.0/density;
+            for (kernelIdx=0; kernelIdx < delta; kernelIdx++)
+               kernel[kernelIdx]*=density;
+         }
+         ossim_int32 offset       = start  - imageOrigin.x;
+         
+         T* xptr         = imageBuf + offset;
+         T* xCenterptr   = imageBuf + offset;
+         T* outptr       = viewBuf  + x;
+         
+         for(y = 0; y < vh; ++y)
+         {
+            double result = 0.0;
+            density = 0.0;
+            if((*xCenterptr) == np)
+            {
+               *outptr = outNp;
+            }
+            else
+            {
+               for(kernelIdx = 0; kernelIdx < (int)kernel.size(); ++kernelIdx)
+               {
+                  if((*xptr != np)&&
+                     (kernel[kernelIdx] != 0.0))
+                  {
+                     result  += ((double)(*(xptr+kernelIdx))*kernel[kernelIdx]);
+                     density += kernel[kernelIdx];
+                  }
+               }
+               if(density != 0.0)
+               {
+                  result /= density;
+                  
+                  if(result < outMinPix) result = outMinPix;
+                  if(result > outMaxPix) result = outMaxPix;
+                  
+                  *outptr = (T)result;
+               }
+               else
+               {
+                  *outptr = outNp;
+               }
+            }
+            xCenterptr += iw;
+            xptr   += iw;
+            outptr += vw;
+         }
+      }
+   }
+}
+
+//**************************************************************************************************
+template <class T> void ossimScaleFilter::runVerticalFilterTemplate(
+   T /* dummy */,
+   const ossimRefPtr<ossimImageData>& input,
+   ossimRefPtr<ossimImageData>& output)
+{
+   ossimIrect viewRect  = output->getImageRectangle();
+   ossimIrect imageRect = input->getImageRectangle();
+   ossim_int32 vw = viewRect.width();
+   ossim_int32 vh = viewRect.height();
+   ossim_int32 iw = imageRect.width();
+   ossimIpt origin(viewRect.ul());
+   ossimIpt imageOrigin(imageRect.ul());
+   ossimIpt inputUl = m_InputRect.ul();
+   ossimIpt inputLr = m_InputRect.lr();
+   double scale = 0.0;
+   double support = 0.0;
+   ossim_int32 x = 0;
+   ossim_int32 y = 0;
+   ossim_int32 start = 0;
+   ossim_int32 stop  = 0;
+   ossim_int32 kernelIdx = 0;
+   const ossimFilter* filter = getVerticalFilter();
+   ossim_float64 center = 0.0;
+   ossim_int32 bandIdx = 0;
+   ossim_int32 numberOfBands = m_Tile->getNumberOfBands();
+   
+   scale = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.y, 1.0);
+   
+   support=scale*filter->getSupport();
+   if (support <= 0.5)
+   {
+      support = .5 + FLT_EPSILON;
+      scale = 1.0;
+   }
+   scale=1.0/scale;
+
+   for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
+   {
+      T* imageBuf = (T*)input->getBuf(bandIdx);
+      T* viewBuf  = (T*)output->getBuf(bandIdx);
+      T np        = (T)input->getNullPix(bandIdx);
+      T outNp     = (T)output->getNullPix(bandIdx);
+      T outMinPix = (T)output->getMinPix(bandIdx);
+      T outMaxPix = (T)output->getMaxPix(bandIdx);
+     
+      for(y = 0; y < vh; ++y)
+      {
+         center=(double) ((y + origin.y+0.5)/m_ScaleFactor.y);
+         start=ossim::max((ossim_int32)ossim::round<int>(center-support), (ossim_int32)inputUl.y);
+         stop=ossim::min((ossim_int32)ossim::round<int>(center+support), (ossim_int32)inputLr.y);
+         ossim_int32 delta = stop-start;
+         if (delta <= 0)
+         {
+            break;
+         }
+         vector<double> kernel(delta);
+         double density = 0.0;
+         for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
+         {
+            kernel[kernelIdx] = filter->filter(scale*(start + kernelIdx - center + .5),
+                                               filter->getSupport());
+            density += kernel[kernelIdx];
+         }
+         if ((density != 0.0) && (density != 1.0))
+         {
+            /*
+              Normalize.
+            */
+            density=1.0/density;
+            for (kernelIdx=0; kernelIdx < delta; kernelIdx++)
+               kernel[kernelIdx]*=density;
+         }
+
+         ossim_int32 offset       = ((start  - imageOrigin.y)*iw);
+         ossim_int32 offsetCenter = ((((ossim_int32)center) - imageOrigin.y)*iw);
+        
+         for(x = 0; x < vw; ++x)
+         {
+            T* yptr         = imageBuf + offset       + x;
+            T* yCenterptr   = imageBuf + offsetCenter + x;
+            double result = 0.0;
+            density = 0.0;
+
+            if((*yCenterptr) == np)
+            {
+               *viewBuf = outNp;
+            }
+            else
+            {
+               for(kernelIdx = 0; kernelIdx < delta; ++kernelIdx)
+               {
+                  if((*yptr != np)&&
+                     (kernel[kernelIdx] != 0.0))
+                  {
+                     result  += ((*yptr)*kernel[kernelIdx]);
+                     density += kernel[kernelIdx];
+                  }
+                  yptr += iw;
+               }
+               if(density != 0.0)
+               {
+                  result /= density;
+                 
+                  if(result < outMinPix) result = outMinPix;
+                  if(result > outMaxPix) result = outMaxPix;
+                 
+                  *viewBuf = (T)result;
+               }
+               else
+               {
+                  *viewBuf = outNp;
+               }
+            }
+            ++viewBuf;
+         }
+      }
+   }
+}
+
+//**************************************************************************************************
+void ossimScaleFilter::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   // Force an allocate next getTile.
+   m_Tile = NULL;
+   m_BlankTile = NULL;
+   m_InputRect.makeNan();
+}
+
+//**************************************************************************************************
+void ossimScaleFilter::allocate()
+{
+   m_Tile      = NULL;
+   m_BlankTile = NULL;
+   m_InputRect.makeNan();
+
+   if(theInputConnection&&isSourceEnabled())
+   {
+      m_Tile      = ossimImageDataFactory::instance()->create(this, this);
+      m_BlankTile = ossimImageDataFactory::instance()->create(this, this);
+      
+      m_Tile->initialize();
+
+      m_InputRect = theInputConnection->getBoundingRect();
+   }
+}
+
+//**************************************************************************************************
+// Returns a pointer reference to the active image geometry at this filter. The input source
+// geometry is modified, so we need to maintain our own geometry object as a data member.
+//**************************************************************************************************
+ossimRefPtr<ossimImageGeometry> ossimScaleFilter::getImageGeometry()
+{
+   // Have we already defined our own geometry? Return it if so:
+   if (m_ScaledGeometry.valid()) return m_ScaledGeometry;
+
+   // Otherwise we'll need to establish a geometry based on the input connection:
+   if(theInputConnection)
+   {
+      // Fetch the map projection of the input image if it exists:
+      ossimRefPtr<ossimImageGeometry> inputGeom = theInputConnection->getImageGeometry();
+
+      // If trivial case of identity scale, just pass along the input connection's geometry:
+      if ((m_ScaleFactor.x == 1.0) && (m_ScaleFactor.y == 1.0))
+         return inputGeom;
+
+      // Need to create a copy of the input geom and modify it as our own, then pass that:
+      if ( inputGeom.valid() )
+      {
+         m_ScaledGeometry = new ossimImageGeometry(*inputGeom);
+         updateGeometry();
+
+         // Return the modified geometry:
+         return m_ScaledGeometry;
+      }
+   }
+
+   // No geometry defined, return NULL pointer:
+   return ossimRefPtr<ossimImageGeometry>();
+}
+
+//**************************************************************************************************
+ossimIrect ossimScaleFilter::scaleRect(const ossimIrect input,
+                                       const ossimDpt& scaleFactor)const
+{
+   ossimIpt origin(ossim::round<int>(input.ul().x*scaleFactor.x),
+                   ossim::round<int>(input.ul().y*scaleFactor.y));
+   ossim_int32 w = ossim::round<int>(input.width()*scaleFactor.x);
+   ossim_int32 h = ossim::round<int>(input.height()*scaleFactor.y);
+
+   if(w < 1) w = 1;
+   if(h < 1) h = 1;
+   
+   return ossimIrect(origin.x,
+                     origin.y,
+                     origin.x + (w-1),
+                     origin.y + (h-1));
+}
+
+//**************************************************************************************************
+ossimString ossimScaleFilter::getFilterTypeAsString(ossimScaleFilterType type)const
+{
+   switch(type)
+   {
+   case ossimScaleFilter_NEAREST_NEIGHBOR:
+   {
+      return "nearest_neighbor";
+   }
+   case ossimScaleFilter_BOX:
+   {
+      return "box";
+   }
+   case ossimScaleFilter_GAUSSIAN:
+   {
+      return "gaussian";
+   }
+   case ossimScaleFilter_CUBIC:
+   {
+      return "cubic";
+   }
+   case ossimScaleFilter_HANNING:
+   {
+      return "hanning";
+   }
+   case ossimScaleFilter_HAMMING:
+   {
+      return "hamming";
+   }
+   case ossimScaleFilter_LANCZOS:
+   {
+      return "lanczos";
+   }
+   case ossimScaleFilter_MITCHELL:
+   {
+      return "mitchell";
+   }
+   case ossimScaleFilter_CATROM:
+   {
+      return "catrom";
+   }
+   case ossimScaleFilter_BLACKMAN:
+   {
+      return "blackman";
+   }
+   case ossimScaleFilter_BLACKMAN_SINC:
+   {
+      return "blackman_sinc";
+   }
+   case ossimScaleFilter_BLACKMAN_BESSEL:
+   {
+      return "blackman_bessel";
+   }
+   case ossimScaleFilter_QUADRATIC:
+   {
+      return "quadratic";
+   }
+   case ossimScaleFilter_TRIANGLE:
+   {
+      return "triangle";
+   }
+   case ossimScaleFilter_HERMITE:
+   {
+      return "hermite";
+   }
+   }
+
+   return "nearest_neighbor";
+}
+
+//**************************************************************************************************
+ossimScaleFilter::ossimScaleFilterType ossimScaleFilter::getFilterType(const ossimString& type)const
+{
+   ossimString typeUpper = type;
+   typeUpper = typeUpper.upcase();
+
+   if(typeUpper.contains("BOX"))
+   {
+      return ossimScaleFilter_BOX;
+   }
+   else if(typeUpper.contains("NEAREST_NEIGHBOR"))
+   {
+      return ossimScaleFilter_NEAREST_NEIGHBOR;
+   }
+   else if(typeUpper.contains("GAUSSIAN"))
+   {
+      return ossimScaleFilter_GAUSSIAN;
+   }
+   else if(typeUpper.contains("HANNING"))
+   {
+      return ossimScaleFilter_HANNING;
+   }
+   else if(typeUpper.contains("HAMMING"))
+   {
+      return ossimScaleFilter_HAMMING;
+   }
+   else if(typeUpper.contains("LANCZOS"))
+   {
+      return ossimScaleFilter_LANCZOS;
+   }
+   else if(typeUpper.contains("MITCHELL"))
+   {
+      return ossimScaleFilter_MITCHELL;
+   }
+   else if(typeUpper.contains("CATROM"))
+   {
+      return ossimScaleFilter_CATROM;
+   }
+   else if(typeUpper.contains("CUBIC"))
+   {
+      return ossimScaleFilter_CUBIC;
+   }
+   else if(typeUpper.contains("BLACKMAN_BESSEL"))
+   {
+      return ossimScaleFilter_BLACKMAN_BESSEL;
+   }
+   else if(typeUpper.contains("BLACKMAN_SINC"))
+   {
+      return ossimScaleFilter_BLACKMAN_SINC;
+   }
+   else if(typeUpper.contains("BLACKMAN"))
+   {
+      return ossimScaleFilter_BLACKMAN;
+   }
+   else if(typeUpper.contains("QUADRATIC"))
+   {
+      return ossimScaleFilter_QUADRATIC;
+   }
+   else if(typeUpper.contains("TRIANGLE"))
+   {
+      return ossimScaleFilter_TRIANGLE;
+   }
+   else if(typeUpper.contains("HERMITE"))
+   {
+      return ossimScaleFilter_HERMITE;
+   }
+   
+   return ossimScaleFilter_NEAREST_NEIGHBOR;
+}
+
+//**************************************************************************************************
+void ossimScaleFilter::getSupport(double& x, double& y)
+{
+   const ossimFilter* horizontalFilter = getHorizontalFilter();
+   const ossimFilter* verticalFilter   = getVerticalFilter();
+   
+   x = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.x, 1.0)*
+       horizontalFilter->getSupport();
+   y = m_BlurFactor*ossim::max(1.0/m_ScaleFactor.y, 1.0)*
+       verticalFilter->getSupport();
+}
+
+//**************************************************************************************************
+const ossimFilter* ossimScaleFilter::getHorizontalFilter()const
+{
+   if(m_ScaleFactor.x < 1)
+   {
+      return m_MinifyFilter;
+   }
+
+   return m_MagnifyFilter;
+}
+
+//**************************************************************************************************
+const ossimFilter* ossimScaleFilter::getVerticalFilter()const
+{
+   if(m_ScaleFactor.y < 1)
+   {
+      return m_MinifyFilter;
+   }
+
+   return m_MagnifyFilter;
+}
+
+
+
+//**************************************************************************************************
+bool ossimScaleFilter::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_X_KW,
+           m_ScaleFactor.x,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_Y_KW,
+           m_ScaleFactor.y,
+           true);
+   kwl.add(prefix,
+           "minify_type",
+           getFilterTypeAsString(m_MinifyFilterType),
+           true);
+   kwl.add(prefix,
+           "magnify_type",
+           getFilterTypeAsString(m_MagnifyFilterType),
+           true);
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+//**************************************************************************************************
+bool ossimScaleFilter::loadState(const ossimKeywordlist& kwl,
+                                 const char* prefix)
+{
+   ossimString scalex  = kwl.find(prefix,
+                                 ossimKeywordNames::SCALE_X_KW);
+   ossimString scaley  = kwl.find(prefix,
+                                  ossimKeywordNames::SCALE_Y_KW);
+   ossimString minify  = kwl.find(prefix,
+                                  "minify_type");
+   ossimString magnify = kwl.find(prefix,
+                                  "magnify_type");
+   
+   m_ScaleFactor.x = scalex.toDouble();
+   m_ScaleFactor.y = scaley.toDouble();
+
+   if(fabs(m_ScaleFactor.x) <= FLT_EPSILON)
+   {
+      m_ScaleFactor.x = 1.0;
+   }
+   if(fabs(m_ScaleFactor.y) <= FLT_EPSILON)
+   {
+      m_ScaleFactor.y = 1.0;
+   }
+
+   m_InverseScaleFactor.x = 1.0/m_ScaleFactor.x;
+   m_InverseScaleFactor.y = 1.0/m_ScaleFactor.y;
+   
+   setFilterType(getFilterType(minify),
+                 getFilterType(magnify));
+   
+   // A change in the scale factor implies a change to the image geometry. If one has been created
+   // it needs to be modified:
+   updateGeometry();
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+//**************************************************************************************************
+//! If this object is maintaining an ossimImageGeometry, this method needs to be called after 
+//! a scale change so that the geometry's projection is modified accordingly.
+//**************************************************************************************************
+void ossimScaleFilter::updateGeometry()
+{
+   if (m_ScaledGeometry.valid())
+   {
+      // Modify the image geometry's projection with the scale factor before returning geom:
+      ossimProjection* proj = m_ScaledGeometry->getProjection();
+      ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);
+      if(mapProj)
+         mapProj->applyScale(m_InverseScaleFactor, true);
+   }
+}
diff --git a/src/imaging/ossimShiftFilter.cpp b/src/imaging/ossimShiftFilter.cpp
new file mode 100644
index 0000000..c70144d
--- /dev/null
+++ b/src/imaging/ossimShiftFilter.cpp
@@ -0,0 +1,315 @@
+//----------------------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Filter for shifting input to an output range.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/imaging/ossimShiftFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+
+RTTI_DEF1(ossimShiftFilter, "ossimShiftFilter", ossimImageSourceFilter)
+
+static ossimTrace traceDebug("ossimShiftFilter:debug");
+
+ossimShiftFilter::ossimShiftFilter()
+   :
+   ossimImageSourceFilter(),  // base class
+   m_tile(0),
+   m_min(ossim::nan()),
+   m_max(ossim::nan()),
+   m_null(ossim::nan())
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimShiftFilter::ossimShiftFilter entered...\n";
+   }
+}
+
+ossimShiftFilter::~ossimShiftFilter()
+{
+}
+
+void ossimShiftFilter::initialize()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimShiftFilter::initialize entered..." << endl;
+   }
+
+   //---
+   // Call the base class initialize.
+   // Note:  This will reset "theInputConnection" if it changed...
+   //---
+   ossimImageSourceFilter::initialize();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimShiftFilter::initialize exited..." << endl;
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimShiftFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> result = 0;
+   
+   if ( theInputConnection )
+   {
+      ossimRefPtr<ossimImageData> inputTile = theInputConnection->getTile( tileRect, resLevel );
+      
+      if ( inputTile.get() && isSourceEnabled() &&
+           !ossim::isnan(m_null) && !ossim::isnan(m_min) && !ossim::isnan(m_max) )
+      {
+         // Get its status of the input tile.
+         ossimDataObjectStatus tile_status = inputTile->getDataObjectStatus();
+         
+         if ( tile_status != OSSIM_NULL )
+         {
+            if ( !m_tile )
+            {
+               allocate(); // First time through.
+            }
+            
+            if ( tile_status != OSSIM_EMPTY )
+            {
+               // Set the origin,bands of the output tile.
+               m_tile->setImageRectangle(tileRect);
+
+               switch(inputTile->getScalarType())
+               {
+                  case OSSIM_UINT8:
+                  {
+                     fillTile( ossim_uint8(0), inputTile.get(), m_tile.get() );
+                     break;
+                  }
+                  case OSSIM_SINT8:
+                  {
+                     fillTile( ossim_sint8(0), inputTile.get(), m_tile.get() );
+                     break;
+                  }
+                  case OSSIM_UINT16:
+                  case OSSIM_USHORT11:
+                  case OSSIM_USHORT12:
+                  case OSSIM_USHORT13:
+                  case OSSIM_USHORT14:
+                  case OSSIM_USHORT15:
+                  {
+                     fillTile( ossim_uint16(0), inputTile.get(), m_tile.get() );
+                     break;
+                  }
+                  case OSSIM_SINT16:
+                  {
+                     fillTile( ossim_sint16(0), inputTile.get(), m_tile.get() ); 
+                     break;
+                  }
+                  case OSSIM_SINT32:
+                  {
+                     fillTile( ossim_sint32(0), inputTile.get(), m_tile.get() );
+                     break;
+                  }
+                  case OSSIM_UINT32:
+                  {
+                     fillTile( ossim_uint32(0), inputTile.get(), m_tile.get() );
+                     break;
+                  }
+                  case OSSIM_FLOAT32: 
+                  case OSSIM_NORMALIZED_FLOAT:
+                  {
+                     fillTile( ossim_float32(0), inputTile.get(), m_tile.get() );
+                     break;
+                  }
+                  case OSSIM_FLOAT64:
+                  case OSSIM_NORMALIZED_DOUBLE:
+                  {
+                     fillTile( ossim_float64(0), inputTile.get(), m_tile.get() );
+                     break;
+                  }
+                  case OSSIM_SCALAR_UNKNOWN:
+                  default:
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "ossimShiftFilter::getTile ERROR Unhandled scalar!" << endl;
+                        break;
+                  }
+            
+               } // Matches: switch(inputTile->getScalarType())
+
+               m_tile->validate();
+            }
+            else
+            {
+               m_tile->makeBlank();
+            }
+
+            result = m_tile;
+            
+         } // Matches: if ( tile_status != OSSIM_NULL )
+            
+      } // Matches: if ( inputTile.get() ... )
+
+      if ( !result && inputTile.get() )
+      {
+         result = inputTile;
+      }
+           
+   } // Matches: if ( theInputConnection ) 
+   
+   return result;
+}
+
+template <class T> void ossimShiftFilter::fillTile(T /* dummy */,
+                                                   const ossimImageData* inputTile,
+                                                   ossimImageData* outputTile) const
+{
+   const double BANDS = inputTile->getNumberOfBands();
+   const ossim_uint32 SPB = inputTile->getSizePerBand();
+   std::vector<double> inNull(BANDS);
+   std::vector<double> inMin(BANDS);
+   std::vector<double> inMax(BANDS);
+   std::vector<double> coef(BANDS);
+   ossim_uint32 band = 0;
+
+   for( ; band < BANDS; ++band )
+   {
+      inNull[band] = inputTile->getNullPix(band);
+      inMin[band]  = inputTile->getMinPix(band);
+      inMax[band]  = inputTile->getMaxPix(band);
+      coef[band]   = (m_max-m_min)/(inMax[band]-inMin[band]);
+   }
+   
+   double pix = 0;
+   for( band = 0; band < BANDS; ++band )
+   {
+      const T* inBuf = static_cast<const T*>(inputTile->getBuf(band));
+      T* outBuf = static_cast<T*>(outputTile->getBuf(band));
+      
+      for ( ossim_uint32 i = 0; i < SPB; ++i )
+      {
+         pix = inBuf[i];
+         if (  pix == inNull[band] )
+         {
+            pix = m_null;
+         }
+         else
+         {
+            // Shift and multiply:
+            pix = m_min + (pix - inMin[band]) * coef[band];
+            
+            // Range check:
+            pix = pix <= m_max ? (pix >= m_min ? pix : m_min) : m_max;
+         }
+         
+         outBuf[i] = static_cast<T>(pix);
+      }
+   }
+
+   outputTile->validate();
+}
+
+ossimString ossimShiftFilter::getClassName() const
+{
+   return ossimString("ossimShiftFilter");
+}
+
+ossimString ossimShiftFilter::getLongName()const
+{
+   return ossimString("OSSIM shift filter");
+}
+
+ossimString ossimShiftFilter::getShortName()const
+{
+   return ossimString("shift filter");
+}
+
+double ossimShiftFilter::getNullPixelValue(ossim_uint32 band )const
+{
+   double result = 0;;
+   if ( theEnableFlag && !ossim::isnan(m_null) )
+   {
+      result = m_null;
+   }
+   else
+   {
+      result = ossimImageSourceFilter::getNullPixelValue( band );
+   }
+   return result;
+}
+
+double ossimShiftFilter::getMinPixelValue(ossim_uint32 band )const
+{
+   double result = 0;;
+   if ( theEnableFlag && !ossim::isnan(m_min) )
+   {
+      result = m_min;
+   }
+   else
+   {
+      result = ossimImageSourceFilter::getMinPixelValue( band );
+   }
+   return result;
+}
+
+double ossimShiftFilter::getMaxPixelValue(ossim_uint32 band )const
+{
+   double result = 0;;
+   if ( theEnableFlag && !ossim::isnan(m_max) )
+   {
+      result = m_max;
+   }
+   else
+   {
+      result = ossimImageSourceFilter::getMaxPixelValue( band );
+   }
+   return result;
+}
+
+void ossimShiftFilter::setNullPixelValue(double null)
+{
+   m_null = null;
+}
+
+void ossimShiftFilter::setMinPixelValue(double min)
+{
+   m_min = min;
+}
+
+void ossimShiftFilter::setMaxPixelValue(double max)
+{
+   m_max = max;
+}
+
+void ossimShiftFilter::allocate()
+{
+   m_tile = ossimImageDataFactory::instance()->create(this,this);
+   m_tile->initialize();
+}
+
+// Private to disallow use...
+ossimShiftFilter::ossimShiftFilter(const ossimShiftFilter&)
+: m_min(0),m_max(0),m_null(0)
+{
+}
+
+// Private to disallow use...
+ossimShiftFilter& ossimShiftFilter::operator=(const ossimShiftFilter&)
+{
+   return *this;
+}
+
+
diff --git a/src/imaging/ossimSingleImageChain.cpp b/src/imaging/ossimSingleImageChain.cpp
new file mode 100644
index 0000000..5c840f1
--- /dev/null
+++ b/src/imaging/ossimSingleImageChain.cpp
@@ -0,0 +1,1023 @@
+//---
+//
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description: Utility class definition for a single image chain.
+// 
+//---
+// $Id$
+
+#include <ossim/imaging/ossimSingleImageChain.h>
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGeoPolygon.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+// #include <ossim/imaging/ossimTiledImagePatch.h>
+#include <ossim/support_data/ossimSrcRecord.h>
+
+ossimSingleImageChain::ossimSingleImageChain()
+   :
+   ossimImageChain(),
+   m_handler(0),
+   m_bandSelector(0),
+   m_histogramRemapper(0),
+   m_brightnessContrast(0),
+   m_sharpen(0),
+   m_scalarRemapper(0),
+   m_resamplerCache(0),
+   m_resampler(0),
+   m_chainCache(0),
+   m_addHistogramFlag(false),
+   m_addResamplerCacheFlag(false),
+   m_addChainCacheFlag(false),
+   m_remapToEightBitFlag(false),
+   m_threeBandFlag(false),
+   m_threeBandReverseFlag(false),
+   m_brightnessContrastFlag(false),
+   m_sharpenFlag(false),
+   m_geoPolyCutterFlag(false)
+{
+}
+
+ossimSingleImageChain::ossimSingleImageChain(bool addHistogramFlag,
+                                             bool addResamplerCacheFlag,
+                                             bool addChainCacheFlag,
+                                             bool remapToEightBitFlag,
+                                             bool threeBandFlag,
+                                             bool threeBandReverseFlag,
+                                             bool brightnessContrastFlag,
+                                             bool sharpenFlag,
+                                             bool geoPolyCutterFlag)
+   :
+   ossimImageChain(),
+   m_handler(0),
+   m_bandSelector(0),
+   m_histogramRemapper(0),
+   m_brightnessContrast(0),
+   m_sharpen(0),
+   m_scalarRemapper(0),
+   m_resamplerCache(0),
+   m_resampler(0),
+   m_chainCache(0),
+   m_addHistogramFlag(addHistogramFlag),
+   m_addResamplerCacheFlag(addResamplerCacheFlag),
+   m_addChainCacheFlag(addChainCacheFlag),
+   m_remapToEightBitFlag(remapToEightBitFlag),
+   m_threeBandFlag(threeBandFlag),
+   m_threeBandReverseFlag(threeBandReverseFlag),
+   m_brightnessContrastFlag(brightnessContrastFlag),
+   m_sharpenFlag(sharpenFlag),
+   m_geoPolyCutterFlag(geoPolyCutterFlag)
+{
+}
+
+ossimSingleImageChain::~ossimSingleImageChain()
+{
+   m_handler            = 0;
+   m_bandSelector       = 0;
+   m_histogramRemapper  = 0;
+   m_brightnessContrast = 0;
+   m_sharpen            = 0;
+   m_scalarRemapper     = 0;
+   m_resamplerCache     = 0;
+   m_resampler          = 0;
+   m_chainCache         = 0;
+   m_geoPolyCutter      = 0;
+
+}
+
+void ossimSingleImageChain::reset()
+{
+   bool result = true;
+   do
+   {
+      result = deleteLast();
+   } while (result);
+
+   m_handler                = 0;
+   m_bandSelector           = 0;
+   m_histogramRemapper      = 0;
+   m_brightnessContrast     = 0;
+   m_sharpen                = 0;
+   m_scalarRemapper         = 0;
+   m_resamplerCache         = 0;
+   m_resampler              = 0;
+   m_geoPolyCutter          = 0;
+   m_chainCache             = 0;
+
+   m_addHistogramFlag       = false;
+   m_addResamplerCacheFlag  = false;
+   m_addChainCacheFlag      = false;
+   m_remapToEightBitFlag    = false;
+   m_threeBandFlag          = false;
+   m_threeBandReverseFlag   = false;
+   m_brightnessContrastFlag = false;
+   m_sharpenFlag            = false;
+   m_geoPolyCutterFlag      = false;
+}
+
+void ossimSingleImageChain::close()
+{
+   if ( m_handler.valid() )
+   {
+      if ( removeChild(m_handler.get()) )
+      {
+         m_handler = 0;
+      }
+   }
+}
+
+ossimFilename ossimSingleImageChain::getFilename() const
+{
+   ossimFilename result;
+   if ( m_handler.valid() )
+   {
+      result = m_handler->getFilename();
+   }
+   return result;
+}
+
+bool ossimSingleImageChain::open(const ossimFilename& file, bool openOverview)
+{
+   return addImageHandler(file, openOverview);
+}
+
+bool ossimSingleImageChain::isOpen() const
+{
+   return m_handler.valid();
+}
+
+bool ossimSingleImageChain::open(const ossimSrcRecord& src)
+{
+   return addImageHandler(src);
+}
+
+void ossimSingleImageChain::createRenderedChain()
+{
+   // Band selector after image handler only if needed.
+   if ( m_handler.valid() )
+   {
+      // Only add if multiple bands.
+      if ( m_handler->getNumberOfOutputBands() != 1 )
+      {
+         addBandSelector();
+         if ( m_threeBandReverseFlag )
+         {
+            setToThreeBandsReverse();
+         }
+      }
+   }
+   else // No image handler so just add it.
+   {
+      addBandSelector();
+   }
+   
+   // histogram:
+   if ( m_addHistogramFlag )
+   {
+      addHistogramRemapper();
+   }
+
+   // brightness contrast:
+   if ( m_brightnessContrastFlag )
+   {
+      addBrightnessContrast();
+   }
+
+   // sharpen filter:
+   if ( m_sharpenFlag )
+   {
+      addSharpen();
+   }
+
+   // scalar remapper
+   if ( m_remapToEightBitFlag )
+   {
+      if ( m_handler.valid() )
+      {
+         // See if it's eight bit.
+         if (m_handler->getOutputScalarType() != OSSIM_UINT8)
+         {
+            addScalarRemapper();
+         }
+      }
+      else
+      {
+         // Just add...
+         addScalarRemapper(); 
+      }
+   }
+
+   // resampler cache
+   if ( m_addResamplerCacheFlag )
+   {
+      m_resamplerCache = addCache();
+
+      // If input image is tiled set the cache input tile size to that.
+      if ( m_handler.valid() )
+      {
+         if ( m_handler->isImageTiled() )
+         {
+            ossimIpt inputImageTileSize;
+            inputImageTileSize.x = (ossim_int32)m_handler->getImageTileWidth();
+            inputImageTileSize.y = (ossim_int32)m_handler->getImageTileHeight();
+            if ( m_resamplerCache.valid() )
+            {
+               m_resamplerCache->setTileSize( inputImageTileSize );
+            }
+         }
+      }
+   }
+
+#if 0 /* test code - drb */
+   ossimRefPtr<ossimTiledImagePatch> tp = new ossimTiledImagePatch();
+   if ( m_handler.valid() )
+   {
+      if ( m_handler->isImageTiled() )
+      {
+         ossimIpt inputImageTileSize;
+         inputImageTileSize.x = (ossim_int32)m_handler->getImageTileWidth();
+         inputImageTileSize.y = (ossim_int32)m_handler->getImageTileHeight();
+         tp->setInputTileSize( inputImageTileSize );
+      }
+   }
+   addFirst( tp.get() );
+#endif   
+   
+   // resampler
+   addResampler();
+
+#if 0 /* test code - drb */
+   ossimRefPtr<ossimTiledImagePatch> tp2 = new ossimTiledImagePatch();
+   ossimIpt inputImageTileSize(64, 64);
+   tp2->setInputTileSize( inputImageTileSize );
+   addFirst( tp2.get() );
+#endif   
+
+   //---
+   // Do this here so that if a band selector is added to the end of the
+   // chain it will go in before the end of chain cache.
+   //---
+   if (m_threeBandFlag)
+   {
+      if (!m_bandSelector)
+      {
+         addBandSelector();
+      }
+      setToThreeBands();
+   }
+
+   //---
+   // Ditto...
+   //---
+   if ( m_threeBandReverseFlag && !m_bandSelector )
+   {
+      addBandSelector();
+      setToThreeBandsReverse();
+   }
+
+   // Put the geo cutter just before the cache.
+   if(m_geoPolyCutterFlag)
+   {
+      addGeoPolyCutter();
+   }
+
+   // End of chain cache.
+   if ( m_addChainCacheFlag )
+   {
+      m_chainCache = addCache();
+   }
+
+   initialize();
+
+}
+
+void ossimSingleImageChain::createRenderedChain(const ossimSrcRecord& src)
+{
+   // Band selector after image handler only if needed.
+   if ( m_handler.valid() )
+   {
+      // Only add if needed.
+      if ( ( m_handler->getNumberOfOutputBands() != 1 ) || src.getBands().size() )
+      {
+         addBandSelector(src);
+         if ( m_threeBandReverseFlag )
+         {
+            setToThreeBandsReverse();
+         }
+      }
+   }
+   else // No image handler so just add it.
+   {
+      addBandSelector(src);
+   }
+   
+   // histogram
+   if ( m_addHistogramFlag || src.getHistogramOp().size() )
+   {
+      addHistogramRemapper(src);
+   }
+
+   // brightness contrast:
+   if ( m_brightnessContrastFlag )
+   {
+      addBrightnessContrast();
+   }
+
+   // sharpen filter:
+   if ( m_sharpenFlag )
+   {
+      addSharpen();
+   }
+
+   // scalar remapper
+   if ( m_remapToEightBitFlag )
+   {
+      if ( m_handler.valid() )
+      {
+         // See if it's eight bit.
+         if (m_handler->getOutputScalarType() != OSSIM_UINT8)
+         {
+            addScalarRemapper();
+         }
+      }
+      else
+      {
+         // Just add...
+         addScalarRemapper(); 
+      }
+   }
+
+   // resampler cache
+   if ( m_addResamplerCacheFlag )
+   {
+      m_resamplerCache = addCache();
+   }
+   
+   // resampler
+   addResampler();
+
+   //---
+   // Do this here so that if a band selector is added to the end of the
+   // chain it will go in before the end of chain cache.
+   //---
+   if (m_threeBandFlag)
+   {
+      if (!m_bandSelector) // Input must be one band.
+      {
+         addBandSelector(src);
+      }
+      setToThreeBands();
+   }
+
+   //---
+   // Ditto...
+   //---
+   if ( m_threeBandReverseFlag && !m_bandSelector )
+   {
+      addBandSelector();
+      setToThreeBandsReverse();
+   }
+
+   // End of chain cache.
+   if ( m_addChainCacheFlag )
+   {
+      m_chainCache = addCache();
+   }
+
+   initialize();
+
+}
+
+bool ossimSingleImageChain::addImageHandler(const ossimFilename& file, bool openOverview)
+{
+   bool result = false;
+
+   close();
+   
+   // m_handler = ossimImageHandlerRegistry::instance()->open(file, true, openOverview);
+   m_handler = ossimImageHandlerRegistry::instance()->openConnection(file, openOverview);
+   
+   if ( m_handler.valid() )
+   {
+      // Add to the chain.  Note: last is really first.
+      addLast( m_handler.get() );
+      
+      result = true;
+   }
+
+   return result;
+}
+
+bool ossimSingleImageChain::addImageHandler(const ossimSrcRecord& src)
+{
+   bool result = addImageHandler( src.getFilename() );
+   if (result)
+   {
+      //---
+      // When loading from ossimSrcRecord typically the overview/histograms are
+      // not in the same directory and the "support" keyword is not set.  For
+      // the ossimImageHandler::getFilenameWithThisExtension to work correctly
+      // the ossimImageHandler::theSupplementaryDirectory must be set.
+      // So if the ossimSrcRecord::getSupportDir() is empty and the overview
+      // or histogram is not co-located with the image we will set it here.
+      //---
+      ossimFilename supportDir = src.getSupportDir();
+      if ( supportDir.empty() )
+      {
+         if ( src.getOverviewPath().size() )
+         {
+            if ( src.getOverviewPath().isDir() )
+            {
+               supportDir = src.getOverviewPath();
+            }
+            else
+            {
+               supportDir = src.getOverviewPath().path();
+            }
+         }
+         else if ( src.getHistogramPath().size() )
+         {
+            if ( src.getHistogramPath().isDir() )
+            {
+               supportDir = src.getHistogramPath();
+            }
+            else
+            {
+               supportDir = src.getHistogramPath().path();
+            }
+         }
+         else if ( src.getMaskPath().size() )
+         {
+            if ( src.getMaskPath().isDir() )
+            {
+               supportDir = src.getMaskPath();
+            }
+            else
+            {
+               supportDir = src.getMaskPath().path();
+            }
+         }
+      }
+      if ( supportDir.size() && (src.getFilename().path() != supportDir) )
+      {
+         m_handler->setSupplementaryDirectory( supportDir );
+      }
+      if ( src.getEntryIndex() > 0 ) // defaulted to -1.
+      {
+         m_handler->setCurrentEntry( static_cast<ossim_uint32>( src.getEntryIndex() ) );
+      }
+      if ( m_handler->getOverview() == 0 )
+      {
+         if ( src.getOverviewPath().size() )
+         {
+            m_handler->openOverview( src.getOverviewPath() );
+         }
+         else
+         {
+            ossimFilename ovrFile = m_handler->getFilenameWithThisExtension(ossimString(".ovr"));
+            m_handler->openOverview( ovrFile ); 
+         }
+      }
+   }
+   return result;
+}
+
+void ossimSingleImageChain::addBandSelector()
+{
+   if (!m_bandSelector)
+   {
+      m_bandSelector = new ossimBandSelector();
+
+      // Add to the end of the chain.
+      addFirst(m_bandSelector.get());
+   }
+}
+
+void ossimSingleImageChain::addBandSelector(const ossimSrcRecord& src)
+{
+   if (!m_bandSelector)
+   {
+      m_bandSelector = new ossimBandSelector();
+      
+      // Add to the end of the chain.
+      addFirst(m_bandSelector.get());
+   }
+   if ( src.getBands().size() )
+   {
+      m_bandSelector->setOutputBandList( src.getBands() );
+   }
+}
+
+void ossimSingleImageChain::addHistogramRemapper()
+{
+   if (!m_histogramRemapper)
+   {
+      m_histogramRemapper = new ossimHistogramRemapper();
+      
+      m_histogramRemapper->setEnableFlag(false);
+
+      // Add to the end of the chain.
+      addFirst(m_histogramRemapper.get());
+   } 
+}
+
+void ossimSingleImageChain::addHistogramRemapper(const ossimSrcRecord& src)
+{
+   static const char MODULE[] =
+      "ossimSingleImageChain::addHistogramRemapper(const ossimSrcRecord&)";
+   
+   if (!m_histogramRemapper)
+   {
+      m_histogramRemapper = new ossimHistogramRemapper();
+      
+      m_histogramRemapper->setEnableFlag(false);
+
+      // Add to the end of the chain.
+      addFirst(m_histogramRemapper.get());
+   }
+
+   if ( src.getHistogramOp().size() && m_handler.valid() )
+   {
+      // Create histogram code here???
+      
+      // Open the histogram if needed.
+      if ( m_histogramRemapper->getHistogramFile() == ossimFilename::NIL )
+      {
+         ossimFilename f;
+         if ( src.getSupportDir().size() )
+         {
+            f = src.getSupportDir();
+            f.dirCat( m_handler->getFilename().fileNoExtension() );
+            f.setExtension(".his");
+         }
+         else
+         {
+            f = m_handler->getFilenameWithThisExtension( ossimString("his") );
+         }
+         if ( m_histogramRemapper->openHistogram( f ) == false )
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nCould not open:  " << f << "\n";
+         }
+      }
+
+      // Set the histogram strech mode.
+      if ( src.getHistogramOp().size() )
+      {
+         // Enable.
+         m_histogramRemapper->setEnableFlag(true);
+         
+         // Set the histo mode:
+         ossimString op = src.getHistogramOp();
+         op.downcase();
+         if ( op == "auto-minmax" )
+         {
+            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX );
+         }
+         else if ( (op == "std-stretch-1") || (op == "std-stretch 1") )
+         {
+            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN );
+         } 
+         else if ( (op == "std-stretch-2") || (op == "std-stretch 2") )
+         {
+            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN );
+         } 
+         else if ( (op == "std-stretch-3") || (op == "std-stretch 3") )
+         {
+            m_histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN );
+         }
+         else
+         {
+            m_histogramRemapper->setEnableFlag(false);
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << "\nUnhandled operation: " << op << "\n";
+         }
+      }
+      
+   } // End: if ( src.setHistogramOp().size() && m_handler.valid() )
+}
+
+ossimRefPtr<ossimCacheTileSource> ossimSingleImageChain::addCache()
+{
+   ossimRefPtr<ossimCacheTileSource> cache = new ossimCacheTileSource();
+
+   // Add to the end of the chain.
+   addFirst(cache.get());
+
+   return cache;
+}
+
+void ossimSingleImageChain::addResampler()
+{
+   if ( !m_resampler )
+   {
+      m_resampler = new ossimImageRenderer();
+
+      // Add to the end of the chain.
+      addFirst(m_resampler.get());
+   }
+}
+void ossimSingleImageChain::addRenderer()
+{
+   addResampler();
+}
+
+void ossimSingleImageChain::addScalarRemapper()
+{
+   if ( !m_scalarRemapper )
+   {
+      m_scalarRemapper = new ossimScalarRemapper();
+
+      if ( m_resamplerCache.valid() )
+      {
+         // Add to the left of the resampler cache.
+         insertLeft(m_scalarRemapper.get(), m_resamplerCache.get());
+      }
+      else
+      {
+         // Add to the end of the chain.
+         addFirst(m_scalarRemapper.get());
+      }
+   }
+}
+
+void ossimSingleImageChain::addBrightnessContrast()
+{
+   if ( !m_brightnessContrast )
+   {
+      m_brightnessContrast = new ossimBrightnessContrastSource();
+
+      // Add to the end of the chain.
+      addFirst( m_brightnessContrast.get() );
+   }
+}
+
+void ossimSingleImageChain::addSharpen()
+{
+   if ( !m_sharpen )
+   {
+      m_sharpen = new ossimImageSharpenFilter();
+
+      // Add to the end of the chain.
+      addFirst( m_sharpen.get() );
+   }
+}
+
+void ossimSingleImageChain::addGeoPolyCutter()
+{
+   if(!m_geoPolyCutter.valid())
+   {
+      m_geoPolyCutter = new ossimGeoPolyCutter();
+
+      //---
+      // ossimGeoPolyCutter requires a view geometry to transform the points.
+      // So set prior to adding to end of chain if valid.  If not, user is
+      // responsible for setting.
+      //---
+      ossimRefPtr<ossimImageGeometry> geom = getImageGeometry();
+      if ( geom.valid() )
+      {
+         m_geoPolyCutter->setView( geom.get() );
+      }
+      
+      addFirst( m_geoPolyCutter.get() );
+   }
+}
+
+void ossimSingleImageChain::addGeoPolyCutterPolygon(const vector<ossimGpt>& polygon)
+{
+   if(!m_geoPolyCutter.valid())
+   {
+      addGeoPolyCutter();
+   }
+   
+   // sanity check to verify that the add did not fail
+   if(m_geoPolyCutter.valid())
+   {
+      m_geoPolyCutter->addPolygon(polygon);   
+   }
+}
+
+void ossimSingleImageChain::addGeoPolyCutterPolygon(const ossimGeoPolygon& polygon)
+{
+   if(!m_geoPolyCutter.valid())
+   {
+      addGeoPolyCutter();
+   }
+   
+   // sanity check to verify that the add did not fail
+   if(m_geoPolyCutter.valid())
+   {
+      m_geoPolyCutter->addPolygon(polygon);
+   }
+}
+
+ossimRefPtr<const ossimImageHandler> ossimSingleImageChain::getImageHandler() const
+{
+   return ossimRefPtr<const ossimImageHandler>( m_handler.get() );
+}
+
+ossimRefPtr<ossimImageHandler> ossimSingleImageChain::getImageHandler()
+{
+   return m_handler;
+}
+
+ossimRefPtr<const ossimBandSelector> ossimSingleImageChain::getBandSelector() const
+{
+   return ossimRefPtr<const ossimBandSelector>( m_bandSelector.get() );
+}
+
+ossimRefPtr<ossimBandSelector> ossimSingleImageChain::getBandSelector()
+{
+   return m_bandSelector;
+}
+
+ossimRefPtr<const ossimHistogramRemapper> ossimSingleImageChain::getHistogramRemapper() const
+{
+   return ossimRefPtr<const ossimHistogramRemapper>( m_histogramRemapper.get() );
+}
+
+ossimRefPtr<ossimHistogramRemapper> ossimSingleImageChain::getHistogramRemapper()
+{
+   return m_histogramRemapper;
+}
+
+ossimRefPtr<const ossimCacheTileSource> ossimSingleImageChain::getResamplerCache() const
+{
+   return ossimRefPtr<const ossimCacheTileSource>( m_resamplerCache.get() );
+}
+
+ossimRefPtr<ossimCacheTileSource> ossimSingleImageChain::getResamplerCache()
+{
+   return m_resamplerCache;
+}
+
+ossimRefPtr<const ossimImageRenderer> ossimSingleImageChain::getImageRenderer() const
+{
+   return ossimRefPtr<const ossimImageRenderer>( m_resampler.get() );
+}
+
+ossimRefPtr<ossimImageRenderer> ossimSingleImageChain::getImageRenderer()
+{
+   return m_resampler;
+}
+
+ossimRefPtr<const ossimScalarRemapper> ossimSingleImageChain::getScalarRemapper() const
+{
+   return ossimRefPtr<const ossimScalarRemapper>( m_scalarRemapper.get() );
+}
+
+ossimRefPtr<ossimScalarRemapper> ossimSingleImageChain::getScalarRemapper()
+{
+   return m_scalarRemapper;
+}
+
+ossimRefPtr<const ossimBrightnessContrastSource>
+ossimSingleImageChain::getBrightnessContrast() const
+{
+   return ossimRefPtr<const ossimBrightnessContrastSource>( m_brightnessContrast.get() );
+}
+
+ossimRefPtr<ossimBrightnessContrastSource> ossimSingleImageChain::getBrightnessContrast()
+{
+   return m_brightnessContrast;
+}
+
+ossimRefPtr<const ossimImageSharpenFilter>
+ossimSingleImageChain::getSharpenFilter() const
+{
+   return ossimRefPtr<const ossimImageSharpenFilter>( m_sharpen.get() );
+}
+
+ossimRefPtr<ossimImageSharpenFilter> ossimSingleImageChain::getSharpenFilter()
+{
+   return m_sharpen;
+}
+
+ossimRefPtr<const ossimCacheTileSource> ossimSingleImageChain::getChainCache() const
+{
+   return ossimRefPtr<const ossimCacheTileSource>( m_chainCache.get() );
+}
+
+ossimRefPtr<ossimCacheTileSource> ossimSingleImageChain::getChainCache()
+{
+   return m_chainCache;
+}
+
+void ossimSingleImageChain::setAddHistogramFlag(bool flag)
+{
+   m_addHistogramFlag = flag;
+}
+
+bool ossimSingleImageChain::getAddHistogramFlag() const
+{
+   return m_addHistogramFlag;
+}
+
+void ossimSingleImageChain::setAddResamplerCacheFlag(bool flag)
+{
+   m_addResamplerCacheFlag = flag;
+}
+
+bool ossimSingleImageChain::getAddResamplerCacheFlag() const
+{
+   return m_addResamplerCacheFlag;
+}
+
+void ossimSingleImageChain::setAddChainCacheFlag(bool flag)
+{
+   m_addChainCacheFlag = flag;
+}
+
+bool ossimSingleImageChain::getAddChainCacheFlag() const
+{
+   return m_addChainCacheFlag;
+}
+
+void ossimSingleImageChain::setRemapToEightBitFlag(bool flag)
+{
+   m_remapToEightBitFlag = flag;
+}
+
+bool ossimSingleImageChain::getRemapToEightBitFlag() const
+{
+   return m_remapToEightBitFlag;
+}
+
+void ossimSingleImageChain::setThreeBandFlag(bool flag)
+{
+   m_threeBandFlag = flag;
+}
+
+bool ossimSingleImageChain::getThreeBandFlag() const
+{
+   return m_threeBandFlag;
+}
+   
+void ossimSingleImageChain::setThreeBandReverseFlag(bool flag)
+{
+   m_threeBandReverseFlag = flag;
+}
+
+bool ossimSingleImageChain::getThreeBandReverseFlag() const
+{
+   return m_threeBandReverseFlag;
+}
+
+void ossimSingleImageChain::setBrightnessContrastFlag(bool flag)
+{
+   m_brightnessContrastFlag = flag;
+}
+
+bool ossimSingleImageChain::getBrightnessContrastFlag() const
+{
+   return m_brightnessContrastFlag;
+}
+
+void ossimSingleImageChain::setSharpenFlag(bool flag)
+{
+   m_sharpenFlag = flag;
+}
+
+bool ossimSingleImageChain::getSharpenFlag() const
+{
+   return m_sharpenFlag;
+}
+
+void ossimSingleImageChain::setToThreeBands()
+{
+   if (!m_bandSelector)
+   {
+      addBandSelector();
+   }
+
+   m_bandSelector->setEnableFlag(true);
+   m_bandSelector->setThreeBandRgb();
+
+   if ( m_histogramRemapper.valid() )
+   {
+      m_histogramRemapper->initialize();
+   } 
+
+#if 0
+   if ( m_handler.valid() )
+   {
+      // Only do if not three bands already so the band list order is not wiped out.
+      if ( !m_bandSelector.valid() ||
+           ( m_bandSelector.valid() &&
+             ( m_bandSelector->getNumberOfOutputBands() != 3 ) ) )
+      {
+         std::vector<ossim_uint32> bandList(3);
+
+         if ( m_handler->getRgbBandList( bandList ) == false )
+         {
+            const ossim_uint32 BANDS = m_handler->getNumberOfInputBands();
+            if(BANDS >= 3)
+            {
+               bandList[0] = 0;
+               bandList[1] = 1;
+               bandList[2] = 2;
+            }
+            else
+            {
+               bandList[0] = 0;
+               bandList[1] = 0;
+               bandList[2] = 0;
+            }
+         }
+         setBandSelection(bandList);
+      }
+   }
+#endif
+}
+
+void ossimSingleImageChain::setToThreeBandsReverse()
+{
+   if ( m_handler.valid() )
+   {
+      std::vector<ossim_uint32> bandList(3);
+      const ossim_uint32 BANDS = m_handler->getNumberOfInputBands();
+      if(BANDS >= 3)
+      {
+         bandList[0] = 2;
+         bandList[1] = 1;
+         bandList[2] = 0;
+      }
+      else
+      {
+         bandList[0] = 0;
+         bandList[1] = 0;
+         bandList[2] = 0;
+      }
+      setBandSelection(bandList);
+   }
+}
+
+void ossimSingleImageChain::setBandSelection(
+   const std::vector<ossim_uint32>& bandList)
+{
+   if (!m_bandSelector)
+   {
+      addBandSelector();
+   }
+   m_bandSelector->setEnableFlag(true);
+   m_bandSelector->setOutputBandList(bandList);
+   if ( m_histogramRemapper.valid() )
+   {
+      m_histogramRemapper->initialize();
+   }
+}
+
+void ossimSingleImageChain::setDefaultBandSelection()
+{
+   if(!m_bandSelector)
+   {
+      addBandSelector();
+   }
+   m_bandSelector->setEnableFlag(true);
+
+   if(m_bandSelector.valid())
+   {
+      m_bandSelector->setThreeBandRgb();
+   }
+}
+
+ossimScalarType ossimSingleImageChain::getImageHandlerScalarType() const
+{
+   ossimScalarType result = OSSIM_SCALAR_UNKNOWN;
+   if ( m_handler.valid() )
+   {
+      result = m_handler->getOutputScalarType();
+   }
+   return result;
+}
+
+bool ossimSingleImageChain::openHistogram( ossimHistogramRemapper::StretchMode mode )
+{
+   bool result = false;
+   ossimRefPtr<ossimImageHandler> ih = getImageHandler();
+   if ( ih.valid() )
+   {
+      ossimRefPtr<ossimHistogramRemapper> hr = getHistogramRemapper();
+      if ( hr.valid() )
+      {
+         ossimFilename f = ih->getFilenameWithThisExtension( ossimString("his") );
+         if ( hr->openHistogram( f ) == true )
+         {
+            // Enable:
+            hr->setEnableFlag(true);
+
+            // Set the mode:
+            hr->setStretchMode( mode );
+
+            result = true;
+         }
+      }
+   }
+   return result;
+}
diff --git a/ossim/src/ossim/imaging/ossimSlopeFilter.cpp b/src/imaging/ossimSlopeFilter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimSlopeFilter.cpp
rename to src/imaging/ossimSlopeFilter.cpp
diff --git a/ossim/src/ossim/imaging/ossimSrtmTileSource.cpp b/src/imaging/ossimSrtmTileSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimSrtmTileSource.cpp
rename to src/imaging/ossimSrtmTileSource.cpp
diff --git a/src/imaging/ossimSubImageTileSource.cpp b/src/imaging/ossimSubImageTileSource.cpp
new file mode 100644
index 0000000..398bf85
--- /dev/null
+++ b/src/imaging/ossimSubImageTileSource.cpp
@@ -0,0 +1,225 @@
+//*****************************************************************************
+// FILE: ossimSubImageTileSource.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class ossimSubImageTileSource.
+//   This tile source permits specifying an offset that is to be applied to the
+//   tile origin for all getTile() requests. It is intended for converting
+//   a full-image space coordinate to a sub-image coordinate.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimSubImageTileSource.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <ossim/imaging/ossimSubImageTileSource.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimImageData.h>
+
+RTTI_DEF1(ossimSubImageTileSource,
+          "ossimSubImageTileSource",
+          ossimImageSourceFilter);
+
+static const char* SUBIMAGE_OFFSET_X = "offset_x";
+static const char* SUBIMAGE_OFFSET_Y = "offset_y";
+
+ossimSubImageTileSource::ossimSubImageTileSource()
+   : ossimImageSourceFilter(),
+     theSubImageOffset(0, 0),
+     theTile(0)
+{
+}
+
+ossimSubImageTileSource::ossimSubImageTileSource(ossimImageSource* inputSource)
+   : ossimImageSourceFilter(inputSource), theSubImageOffset(0, 0),
+     theTile(0)
+{
+}
+
+ossimSubImageTileSource::ossimSubImageTileSource(ossimImageSource* inputSource,
+                                                 const ossimIpt&   offset)
+   : ossimImageSourceFilter(inputSource), theSubImageOffset(offset),
+     theTile(0)
+{
+}
+
+ossimSubImageTileSource::~ossimSubImageTileSource()
+{
+}
+
+//*****************************************************************************
+//  METHOD: ossimSubImageTileSource::getTile()
+//  
+//*****************************************************************************
+ossimRefPtr<ossimImageData> ossimSubImageTileSource::getTile(
+   const ossimIrect& rect,
+   ossim_uint32  res_level)
+{
+   ossimIpt offset = theSubImageOffset;
+
+   if(res_level)
+   {
+      //***
+      // Determine the offset for the particular rr level requested:
+      //***
+      ossimDpt decimation_factor;
+      theInputConnection->getDecimationFactor(res_level, decimation_factor);
+      
+      if(!decimation_factor.hasNans())
+      {
+         offset = ossimIpt((int)(theSubImageOffset.x*decimation_factor.x + 0.5),
+                           (int)(theSubImageOffset.y*decimation_factor.y + 0.5));
+      }
+      else
+      {
+         offset = theSubImageOffset;
+      }
+   }
+   //
+   // Apply the offset to the requested rect and fetch tile. The tile's origin
+   // needs to be adjusted to reflect the requested origin:
+   //
+   ossimIrect rect_prime (rect - offset);
+
+   ossimRefPtr<ossimImageData> tile =
+      ossimImageSourceFilter::getTile(rect_prime, res_level);
+   
+   if(theTile.valid())
+   {
+      theTile->setImageRectangle(rect_prime);
+
+      if(tile.valid())
+      {
+         theTile->loadTile(tile.get());
+      }
+      else
+      {
+         theTile->makeBlank();
+      }
+   }
+   else
+   {
+      if(tile.valid())
+      {
+         theTile = (ossimImageData*)tile->dup();
+      }
+   }
+   if(theTile.valid())
+   {
+      theTile->setOrigin(rect.ul());
+      theTile->validate();
+   }
+   
+   return theTile;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSubImageTileSource::getBoundingRect()
+//  
+//*****************************************************************************
+ossimIrect ossimSubImageTileSource::getBoundingRect(ossim_uint32 resLevel) const
+{
+   ossimDrect result;
+
+   result.makeNan();
+   if(!theInputConnection)
+      return result;
+   ossimDpt offset = theSubImageOffset;
+   
+   ossimDrect rect (theInputConnection->getBoundingRect(resLevel));
+   if(resLevel)
+   {
+      ossimDpt decimation_factor;
+      theInputConnection->getDecimationFactor(resLevel, decimation_factor);
+
+      if(!decimation_factor.hasNans())
+      {
+         rect*=decimation_factor;
+         offset= ossimDpt(theSubImageOffset.x*decimation_factor.x,
+                          theSubImageOffset.y*decimation_factor.y);
+      }
+   }
+   ossimDrect rect_prime (rect + offset);
+   
+   return rect_prime;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSubImageTileSource::getValidImageVertices()
+//  
+//*****************************************************************************
+void ossimSubImageTileSource::getValidImageVertices(vector<ossimIpt>& vertices,
+                                                    ossimVertexOrdering ordering,
+                                                    ossim_uint32 /* resLevel */) const
+{
+   if(!theInputConnection)
+   {
+      vertices.clear();
+      return;
+   }
+
+   ossimDpt offset (theSubImageOffset);
+
+   theInputConnection->getValidImageVertices(vertices, ordering);
+   vector<ossimIpt>::iterator vertex = vertices.begin();
+
+   while (vertex != vertices.end())
+   {
+      (*vertex) += offset;
+      vertex++;
+   }
+   
+   return;
+}
+
+void ossimSubImageTileSource::initialize()
+{
+   ossimImageSourceFilter::initialize();
+
+   theTile = NULL;
+}
+
+bool ossimSubImageTileSource::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   const char* offset_x = kwl.find(prefix, SUBIMAGE_OFFSET_X);
+   const char* offset_y = kwl.find(prefix, SUBIMAGE_OFFSET_Y);
+
+   if(offset_x)
+   {
+      theSubImageOffset.x = ossimString(offset_x).toLong();
+      
+   }
+   if(offset_y)
+   {
+      theSubImageOffset.y = ossimString(offset_y).toLong();      
+   }
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimSubImageTileSource::saveState(ossimKeywordlist& kwl,
+                                        const char* prefix)const
+{
+   bool result = ossimImageSourceFilter::saveState(kwl, prefix);
+   
+   kwl.add(prefix,
+           SUBIMAGE_OFFSET_X,
+           theSubImageOffset.x,
+           true);
+
+   kwl.add(prefix,
+           SUBIMAGE_OFFSET_Y,
+           theSubImageOffset.y,
+           true);
+   
+   return result;        
+}
diff --git a/src/imaging/ossimTableRemapper.cpp b/src/imaging/ossimTableRemapper.cpp
new file mode 100644
index 0000000..c250083
--- /dev/null
+++ b/src/imaging/ossimTableRemapper.cpp
@@ -0,0 +1,596 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Table remapper class definition.
+//
+// Takes input tile, remaps it through a table, then output tile in the desired
+// scalar type.
+//
+// Two modes one that works on native remap tables, that being of the same
+// scalar type (like ossim_uint8) of the input connection, and another that
+// uses a normalized remap table (more scalar independent).
+//
+//*************************************************************************
+// $Id: ossimTableRemapper.cpp 22745 2014-04-22 16:57:22Z dburken $
+
+#include <ossim/imaging/ossimTableRemapper.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimTableRemapper, "ossimTableRemapper", ossimImageSourceFilter)
+
+static ossimTrace traceDebug("ossimTableRemapper:debug");
+
+static const char* TABLE_TYPE[] = { "UNKNOWN", "NATIVE", "NORMALIZED" };
+
+ossimTableRemapper::ossimTableRemapper()
+   :
+      ossimImageSourceFilter(),  // base class
+      theTile(0),
+      theTmpTile(0),
+      theNormBuf(0),
+      theTableBinCount(0),
+      theTableBandCount(0),
+      theTableType(ossimTableRemapper::UKNOWN),
+      theInputScalarType(OSSIM_SCALAR_UNKNOWN),
+      theOutputScalarType(OSSIM_SCALAR_UNKNOWN)
+{
+   //***
+   // Set the base class "theEnableFlag" to off since no adjustments have been
+   // made yet.
+   //***
+   //disableSource();
+}
+
+ossimTableRemapper::~ossimTableRemapper()
+{
+   destroy();
+}
+
+void ossimTableRemapper::destroy()
+{
+   if (theNormBuf)
+   {
+      delete [] theNormBuf;
+      theNormBuf = 0;
+   }
+   theTmpTile = 0;
+   theTile    = 0;
+}
+
+void ossimTableRemapper::initialize()
+{
+   //---
+   // Call the base class initialize.
+   // Note:  This will reset "theInputConnection" if it changed...
+   //---
+   ossimImageSourceFilter::initialize();
+   destroy();
+   if (theInputConnection)
+   {
+      theInputScalarType = theInputConnection->getOutputScalarType();
+      
+      // Since we override "getOutputScalarType" make sure something's set.
+      if (theOutputScalarType == OSSIM_SCALAR_UNKNOWN)
+      {
+         theOutputScalarType = theInputConnection->getOutputScalarType();
+      }
+
+      if (theTile.valid())
+      {
+         //if ( theTile->getNumberOfBands() !=
+         //     theInputConnection->getNumberOfOutputBands() )
+        // {
+            // Wipe everything slick. The next getTile will call allocate.
+        //    destroy();
+        // }
+      }
+   }
+
+   // Nothing else to do for this...
+}
+
+void ossimTableRemapper::allocate(const ossimIrect& rect)
+{
+   //---
+   // It's either first getTile or we've had either a resize, so allocate
+   // needed stuff...
+   //---
+   destroy();
+
+   if (theInputConnection)
+   {
+      ossim_uint32 width  = rect.width();
+      ossim_uint32 height = rect.height();
+    
+      theTile =  ossimImageDataFactory::instance()->create(this,this);
+      theTile->setImageRectangle(rect); 
+     // theTile =
+     //    ossimImageDataFactory::instance()->create(this,
+     //                                              getOutputScalarType(),
+     //                                              getNumberOfOutputBands(),
+     //                                              width,x
+     //                                              height);
+      theTile->initialize();
+
+
+      if (theInputScalarType !=  getOutputScalarType() &&
+          theTableType == ossimTableRemapper::NATIVE)
+      {
+         //---
+         // We need a temp tile so we can do two remaps
+         // inputTile->remapTable->tmpTile then
+         // tmpTile->normalize->theTile(unnormalize to new scalar)...
+         //---
+         theTmpTile 
+         = ossimImageDataFactory::instance()->create(this,
+                                                     theInputScalarType,
+                                                     getNumberOfOutputBands(),
+                                                     width,
+                                                     height);
+         theTmpTile->setMinPix(theTile->getMinPix(), theTile->getNumberOfBands());
+         theTmpTile->initialize();
+
+      }
+
+      if (theTableType == ossimTableRemapper::NORMALIZED ||
+          theInputScalarType != theOutputScalarType)
+      {
+         theNormBuf = new ossim_float64[theTile->getSize()];
+      }
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimTableRemapper::getTile(
+   const ossimIrect& tile_rect, ossim_uint32 resLevel)
+{
+   ossimRefPtr<ossimImageData> result = 0;
+   
+   if(theInputConnection)
+   {
+      // Fetch tile from pointer from the input source.
+      result = theInputConnection->getTile(tile_rect, resLevel);
+      if (theEnableFlag&&result.valid())
+      {  
+         // Get its status of the input tile.
+         ossimDataObjectStatus tile_status = result->getDataObjectStatus();
+         
+         // Check for remap bypass:
+         if ( (tile_status != OSSIM_NULL) &&
+              (tile_status != OSSIM_EMPTY) && theTable.size() )
+         {
+
+            // OK we have an input tile... and it's not null or empty.
+            if(!theTile)
+            {
+               allocate(tile_rect);
+            }
+            if (theTile.valid())
+            {
+               theTile->setImageRectangle(tile_rect);
+               if(theTmpTile.valid()) // not mandatory for all modes.
+               {
+                  theTmpTile->setImageRectangle(tile_rect);
+               }   
+               // Think things are good.  Do the real work...
+               if (theTableType == ossimTableRemapper::NATIVE)
+               {
+                  // Most efficient case...
+                  remapFromNativeTable(result);
+               }
+               else
+               {
+                  remapFromNormalizedTable(result);
+               }
+              
+               theTile->validate();
+               result = theTile;
+            }
+         }
+      }
+   }
+   return result;
+}
+
+void ossimTableRemapper::remapFromNativeTable(
+   ossimRefPtr<ossimImageData>& inputTile)
+{
+   switch (theOutputScalarType)
+   {
+      case OSSIM_UINT8:
+      {
+         remapFromNativeTable(ossim_uint8(0), inputTile);
+         break;
+      }
+      
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_USHORT16:
+      {
+         remapFromNativeTable(ossim_uint16(0), inputTile);
+         break;
+      }
+      
+      case OSSIM_SSHORT16:
+      {
+         remapFromNativeTable(ossim_sint16(0), inputTile);
+         break;
+      }
+      
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_FLOAT:
+      {
+         remapFromNativeTable(ossim_float32(0), inputTile);
+         break;
+      }
+      
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_DOUBLE:
+      {
+         remapFromNativeTable(ossim_float64(0), inputTile);
+         break;
+      }
+      
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+         // Shouldn't hit this.
+            ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimTableRemapper::remapFromNativeTable"
+            << "\nOutput scalar type is OSSIM_SCALAR_UNKNOWN!\n";
+         }
+         break;
+      }
+
+   } // End of "switch (theTableType)"
+}
+
+template <class T> void ossimTableRemapper::remapFromNativeTable(
+   T /* dummy */,
+   ossimRefPtr<ossimImageData>& inputTile)
+{
+   
+   const ossim_uint32 BANDS = theTile->getNumberOfBands();
+   const ossim_uint32 PPB   = theTile->getSizePerBand(); // pixels per band
+   //---
+   // NOTE:
+   // If (theTableBandCount == one) that means we only have one band; or,
+   // the user wanted to remap all bands using the same table...
+   //---
+   const ossim_uint32 BAND_OFFSET =
+      (theTableBandCount != 1) ? theTableBinCount: 0;
+
+
+
+   const T* rt = reinterpret_cast<T*>(&theTable.front()); // remap table (rt)
+   ossimRefPtr<ossimImageData> id;
+   if (theInputScalarType == theOutputScalarType)
+   {
+      id = theTile;
+   }
+   else
+   {
+      id = theTmpTile;
+   }
+   if(theTable.size() >= (BANDS*BAND_OFFSET))
+   {
+      for (ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         const T NULL_PIX = static_cast<T>(id->getNullPix(band));
+         //const T MIN_PIX  = static_cast<T>(id->getMinPix(band));
+
+         const T* s = static_cast<T*>(inputTile->getBuf(band)); // source (s)
+         T*       d = static_cast<T*>(id->getBuf(band));   // destination (d)
+
+         if(s&&d)
+         {
+            for (ossim_uint32 pixel = 0; pixel < PPB; ++pixel)
+            {
+               //---
+               // Get the source pixel and use it as an index to the table.
+               // Note Null is always the "0" index, min always the "1".
+               //---
+               T p = s[pixel];
+               if (p == NULL_PIX)  // Null is not always zero (dted).
+               {
+                  d[pixel] = NULL_PIX;
+                 // p = 0;
+               }
+               else
+               {
+      //         else
+      //         {
+      //            p = (p+1-MIN_PIX);  // If min == 1 we want that to map to index 1.
+      //         }
+
+                  ossim_uint32 table_index = static_cast<ossim_uint32>(p);
+                  
+                  //---
+                  // If within range use to index the remap table; else, null.
+                  // Note:
+                  // There is no min, max range checking on value retrieved from table.
+                  // Range checking should be performed when the table is built.
+                  //---
+                  if(table_index < theTableBinCount)
+                  {
+                     d[pixel] = rt[table_index];
+                  }
+      //            else if(table_index < 0)
+      //            {
+      //               if(theTableBinCount > 1)
+      //               {
+      //                  d[pixel] = rt[1];
+      //               }
+      //               else
+      //               {
+      //                  d[pixel] = table_index;
+       //              }
+       //           }
+                  else
+                  {
+                     if(theTableBinCount>0)
+                     {
+                        d[pixel] = rt[theTableBinCount-1];
+                     }
+                     else
+                     {
+                        d[pixel] = p;
+                    }
+                  }
+               }
+            }
+
+         }
+
+         rt += BAND_OFFSET; // Go to next band in the table.
+      }
+
+   }
+
+   if (theInputScalarType != theOutputScalarType)
+   {
+      // Normalize and copy the temp tile to a buffer.
+      id->copyTileToNormalizedBuffer(theNormBuf);
+
+      // Un-normalize and copy the buffer to the destination tile.
+      theTile->copyNormalizedBufferToTile(theNormBuf);
+   }
+}
+
+void ossimTableRemapper::remapFromNormalizedTable(
+   ossimRefPtr<ossimImageData>& inputTile)
+{
+   if (!theNormBuf) // First time...
+   {
+      theNormBuf = new ossim_float64[theTile->getSize()];
+   }
+   
+   // Normalize and copy the source tile to a buffer.
+   inputTile->copyTileToNormalizedBuffer(theNormBuf);
+
+   const ossim_uint32 BANDS = theTile->getNumberOfBands();
+   const ossim_uint32 PPB   = theTile->getSizePerBand(); // pixels per band
+
+   //---
+   // NOTE:
+   // If (theTableBandCount == one) that means we only have one band; or,
+   // the user wanted to remap all bands using the same table...
+   //---
+   const ossim_uint32 BAND_OFFSET = (theTableBandCount == 1) ? 0 : PPB;
+
+   // remap table (rt)
+   ossim_float64* rt = reinterpret_cast<ossim_float64*>(&theTable.front()); 
+
+   ossim_float64* buf = theNormBuf;
+   ossim_float64 p = 0.0;
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      for (ossim_uint32 pixel = 0; pixel < PPB; ++pixel)
+      {
+         // Get the source pixel...
+         ossim_uint32 idx
+            = static_cast<ossim_uint32>(buf[pixel]*theTableBinCount+0.5);
+
+         if((idx < theTableBinCount))
+         {
+            // If within range use to index the remap table; else, null.
+            p = (idx < theTableBinCount) ? rt[idx] : 0.0;
+         }
+//         else if(idx < 0)
+//         {
+//            p = 0.0;
+//         }
+         else 
+         {
+            p = 1.0;
+         }
+         // Range check (in case table bad) and assign to destination pixel.
+         buf[pixel] = (p >= 0.0) ? ( (p <=1.0) ? p : 1) : 0.0;
+      }
+
+      // (GP)this is not for th table so this offset appears wrong
+      // commenting this out and replacing with t bin count
+      // Go to next band.
+      //rt += BAND_OFFSET;
+
+
+      rt += theTableBinCount;
+      buf += PPB;
+   }
+   
+   // Un-normalize and copy the buffer to the destination tile.
+   theTile->copyNormalizedBufferToTile(theNormBuf);
+}
+
+ossimScalarType ossimTableRemapper::getOutputScalarType() const
+{
+   if (theOutputScalarType != OSSIM_SCALAR_UNKNOWN)
+   {
+      return theOutputScalarType;
+   }
+
+   return ossimImageSourceFilter::getOutputScalarType();
+}
+
+bool ossimTableRemapper::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   // Look for scalar type keyword.
+   ossim_int32 st = ossimScalarTypeLut::instance()->
+      getEntryNumber(kwl, prefix, true);
+
+   // Lookup table returns -1 if not found so check return...
+   if ( (st != -1) && (st != OSSIM_SCALAR_UNKNOWN) )
+   {
+      theOutputScalarType = static_cast<ossimScalarType>(st);
+   }
+
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimTableRemapper::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix) const
+{
+   // Save the output scalar type.
+   kwl.add(prefix,
+           ossimKeywordNames::SCALAR_TYPE_KW,
+           ossimScalarTypeLut::instance()->
+           getEntryString(theOutputScalarType).c_str(),
+           true);
+   
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+ostream& ossimTableRemapper::print(ostream& os) const
+{
+   ossimScalarTypeLut* sl = ossimScalarTypeLut::instance();
+
+   os << "\nossimTableRemapper::print:"
+      << "\ntheTableBinCount:    " << theTableBinCount
+      << "\ntheTableBandCount:   " << theTableBandCount
+      << "\ntheTableType:        " << TABLE_TYPE[theTableType]
+      << "\ntheInputScalarType:  " << (*sl)[theInputScalarType]
+      << "\ntheOutputScalarType: " << (*sl)[theOutputScalarType]
+      << endl;
+   
+   if (theTile.valid())
+   {
+      os << "theTile:\n" << *theTile << endl;
+   }
+   if (theTmpTile.valid())
+   {
+      os << "theTmpTile:\n" << *theTmpTile << endl;
+   }
+
+   switch (theOutputScalarType)
+   {
+      case OSSIM_UCHAR:
+      {
+         dumpTable(ossim_uint8(0), os);
+         break;
+      }
+      
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_USHORT16:
+      {
+         dumpTable(ossim_uint16(0), os);
+         break;
+      }
+      
+      case OSSIM_SSHORT16:
+      {
+         dumpTable(ossim_sint16(0), os);
+         break;
+      }
+      
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_FLOAT:
+      {
+         dumpTable(ossim_float32(0), os);
+         break;
+      }
+      
+      case OSSIM_NORMALIZED_DOUBLE:
+      case OSSIM_DOUBLE:
+      {
+         dumpTable(ossim_float64(0), os);
+         break;
+      }
+      
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         if(traceDebug())
+         {
+         // Shouldn't hit this.
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimTableRemapper::print OSSIM_SCALAR_UNKNOWN!\n";
+         }
+         break;
+      }
+
+   } // End of "switch (theTableType)"
+
+   return os;
+}
+
+template <class T> void ossimTableRemapper::dumpTable(T /*dummy*/,
+                                                      ostream& os) const
+{
+   if (theTable.empty() || !theTableBinCount || !theTableBandCount)
+   {
+      return;
+   }
+
+   const T* table = reinterpret_cast<const T*>(&theTable.front());
+
+   ossim_uint32 table_index = 0;
+   for (ossim_uint32 band = 0; band < theTableBandCount; ++band)
+   {
+      for (ossim_uint32 index = 0; index < theTableBinCount; ++index)
+      {
+         os << "tabel[" << band << "][" << index << "]:  "
+            << static_cast<int>(table[table_index]) << endl;
+         ++table_index;
+      }
+   }
+}
+
+
+ostream& operator<<(ostream& os, const ossimTableRemapper& tr)
+{
+   return tr.print(os);
+}
+
+// Private to disallow use...
+ossimTableRemapper::ossimTableRemapper(const ossimTableRemapper&)
+: theNormBuf(0),
+  theTableBinCount(0),
+  theTableBandCount(0),
+  theTableType(UKNOWN),
+  theInputScalarType(OSSIM_SCALAR_UNKNOWN),
+  theOutputScalarType(OSSIM_SCALAR_UNKNOWN)
+{
+}
+
+// Private to disallow use...
+ossimTableRemapper& ossimTableRemapper::operator=(const ossimTableRemapper&)
+{
+   return *this;
+}
diff --git a/src/imaging/ossimTiffOverviewBuilder.cpp b/src/imaging/ossimTiffOverviewBuilder.cpp
new file mode 100644
index 0000000..30229d6
--- /dev/null
+++ b/src/imaging/ossimTiffOverviewBuilder.cpp
@@ -0,0 +1,1461 @@
+//---
+//
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for TiffOverviewBuilder
+// 
+//---
+// $Id$
+
+#include <ossim/imaging/ossimTiffOverviewBuilder.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/parallel/ossimMpiMasterOverviewSequencer.h>
+#include <ossim/parallel/ossimMpiSlaveOverviewSequencer.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimBitMaskTileSource.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/support_data/ossimGeoTiff.h>
+
+#include <xtiffio.h>
+#include <algorithm> /* for std::fill */
+#include <sstream>
+using namespace std;
+
+RTTI_DEF1(ossimTiffOverviewBuilder,
+          "ossimTiffOverviewBuilder",
+          ossimOverviewBuilderBase)
+
+static ossimTrace traceDebug("ossimTiffOverviewBuilder:degug");
+
+// Property keywords.
+static const char COPY_ALL_KW[]           = "copy_all_flag";
+static const char TEMP_EXTENSION[] = "temp_extension";
+static const char INTERNAL_OVERVIEWS_KW[] = "internal_overviews_flag";
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimTiffOverviewBuilder.cpp 22362 2013-08-07 20:23:22Z dburken $";
+#endif
+
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimTiffOverviewBuilder::ossimTiffOverviewBuilder()
+   :
+      ossimOverviewBuilderBase(),
+      m_nullDataBuffer(0),
+      m_bytesPerPixel(1),
+      m_bitsPerSample(8),
+      m_tileWidth(0),
+      m_tileHeight(0),
+      m_tileSizeInBytes(0),
+      m_sampleFormat(0),
+      m_currentTiffDir(0),
+      m_tiffCompressType(COMPRESSION_NONE),
+      m_jpegCompressQuality(DEFAULT_COMPRESS_QUALITY),
+      m_resampleType(ossimFilterResampler::ossimFilterResampler_BOX),
+      m_nullPixelValues(),
+      m_copyAllFlag(false),
+      m_outputTileSizeSetFlag(false),
+      m_internalOverviewsFlag(false)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiffOverviewBuilder::ossimTiffOverviewBuilder DEBUG:\n";
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  "
+         << OSSIM_ID
+         << "\n";
+#endif
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "overview stop dimension: " << m_overviewStopDimension
+         << std::endl;
+   }
+}
+
+ossimTiffOverviewBuilder::~ossimTiffOverviewBuilder()
+{
+}
+
+void ossimTiffOverviewBuilder::setResampleType(
+   ossimFilterResampler::ossimFilterResamplerType resampleType)
+{
+   m_resampleType = resampleType;
+}
+
+bool ossimTiffOverviewBuilder::buildOverview(const ossimFilename& overview_file, bool copy_all)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiffOverviewBuilder::buildOverview DEBUG:"
+         << "\noverview file: " << overview_file.c_str()
+         << "\ncopy_all flag: " << (copy_all?"true":"false")
+         << std::endl;
+   }
+
+
+   m_outputFile  = overview_file;
+   m_copyAllFlag = copy_all;
+
+   return execute();
+}
+
+
+bool ossimTiffOverviewBuilder::execute()
+{
+   static const char MODULE[] = "ossimTiffOverviewBuilder::execute";
+   
+   if (theErrorStatus == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " ERROR:"
+         << "\nError status has been previously set!  Returning..."
+         << std::endl;
+      return false;
+   }
+
+   if ( !m_imageHandler || m_imageHandler->hasError() )
+   {
+      setErrorStatus();
+      return false;
+   }
+
+   m_outputFile = getOutputFile();
+   if (m_outputFile == ossimFilename::NIL)
+   {
+      return false;
+   }
+
+   // Check the file.  Disallow same file overview building.
+   if ( !buildInternalOverviews() && (m_imageHandler->getFilename() == m_outputFile) )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "Source image file and overview file cannot be the same!"
+         << std::endl;
+      return false;
+   }
+
+   // RP - allow user to set extension with hidden option.  Used to add unique suffix to prevent duplicate requests from stomping each other
+   ossimFilename outputFileTemp;
+   if ( !buildInternalOverviews() )
+   {   
+      outputFileTemp = m_outputFile;
+      if ( m_tempExtension.size() )
+      {
+         outputFileTemp += "." + m_tempExtension;
+      }
+
+      // Add .tmp in case process gets aborted to avoid leaving bad .ovr file.
+      outputFileTemp += ".tmp";
+   }
+
+   // Required number of levels needed including r0.
+   ossim_uint32 requiedResLevels = getRequiredResLevels(m_imageHandler.get());
+
+   // Zero based starting resLevel.
+   ossim_uint32 startingResLevel  = 0;
+   if ( !copyR0() )
+   {
+      startingResLevel = m_imageHandler->getNumberOfDecimationLevels();
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE
+         << "\nCurrent number of reduced res sets: "
+         << m_imageHandler->getNumberOfDecimationLevels()
+         << "\nNumber of required reduced res sets:  " << requiedResLevels
+         << "\nStarting reduced res set:    " << startingResLevel
+         << "\nResampling type:  " << getOverviewType().c_str()
+         << std::endl;
+   }
+
+   if ( startingResLevel >= requiedResLevels )
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+         << MODULE << " NOTICE:"
+         << "\nImage has required reduced resolution data sets.\nReturning..."
+         << std::endl;
+      return true;
+   }
+
+   //---
+   // If image handler is band selector, start with all bands.
+   // Some sources, e.g. ossimEnviTileSource can pick up default
+   // bands and filter out all other bands.
+   //---
+   m_imageHandler->setOutputToInputBandList();  
+   
+   //---
+   // If alpha bit mask generation was requested, then need to instantiate the mask writer object.
+   // This is simply a "transparent" tile source placed after to the right of the image handler
+   // that scans the pixels being pulled and accumulates alpha bit mask for writing at the end.
+   //---
+   if (m_bitMaskSpec.getSize() > 0)
+   {
+      m_maskWriter = new ossimBitMaskWriter();
+      m_maskWriter->loadState(m_bitMaskSpec);
+      m_maskWriter->setStartingResLevel(1);
+      ossimRefPtr<ossimBitMaskTileSource> bmts = new ossimBitMaskTileSource;
+      bmts->setAssociatedMaskWriter(m_maskWriter.get());
+      m_maskFilter = new ossimMaskFilter();
+      m_maskFilter->connectMyInputTo(m_imageHandler.get());
+      m_maskFilter->setMaskSource((ossimImageSource*)bmts.get());
+   }
+
+   ossimStdOutProgress* progressListener = 0; // Only used on master.
+   TIFF* tif = 0;                             // Only used on master.
+
+   setProcessStatus(ossimProcessInterface::PROCESS_STATUS_EXECUTING);
+   setPercentComplete(0.0);
+
+   if (ossimMpi::instance()->getRank() == 0 )
+   {
+      //---
+      // See if the file can be opened for writing.
+      // Note:  If this file existed previously it will be overwritten.
+      //---
+      tif = openTiff(outputFileTemp);
+      if (!tif)
+      {
+         // Set the error...
+         setErrorStatus();
+         ossimNotify(ossimNotifyLevel_WARN)
+            << __FILE__ << " " << __LINE__ << " " << MODULE
+            << "\nCannot open file: " << outputFileTemp << std::endl;
+         return false;
+      } 
+
+      //---
+      // Check for a listeners.  If the list is empty, add a standard out
+      // listener so that command line apps like img2rr will get some progress.
+      //---
+      ossimStdOutProgress* progressListener = 0;
+      if (theListenerList.empty())
+      {
+         progressListener = new ossimStdOutProgress(0, true);
+         addListener(progressListener);
+      }
+
+      if (startingResLevel == 0)
+      {       
+         if (!writeR0(tif))
+         {
+            // Set the error...
+            setErrorStatus();
+            ossimNotify(ossimNotifyLevel_WARN)
+               << __FILE__ << " " << __LINE__
+               << "\nError copying image!" << std::endl;
+
+            closeTiff(tif);
+            if (progressListener)
+            {
+               removeListener(progressListener);
+               delete progressListener;
+               progressListener = 0;
+            }
+            
+            if ( outputFileTemp.exists() && !buildInternalOverviews() )
+            {
+               ossimFilename::remove( outputFileTemp );
+            }
+            return false;
+         }
+
+         ++startingResLevel; // Go to r1.
+      }
+
+      if (needsAborting())
+      {
+         closeTiff(tif);
+         if (progressListener)
+         {
+            removeListener(progressListener);
+            delete progressListener;
+            progressListener = 0;
+         }
+         return false;
+      }
+      
+      TIFFFlush(tif);
+      
+   } // End of master only write of r0.
+        
+   for (ossim_uint32 i = startingResLevel; i < requiedResLevels; ++i)
+   {
+      if (ossimMpi::instance()->getRank() == 0 )
+      {
+         TIFFFlush(tif);
+      }
+
+      // Sync all processes...
+      ossimMpi::instance()->barrier();
+      
+      ossimRefPtr<ossimImageHandler> ih = 0;
+
+      //---
+      // If we copied r0 to the overview file use it instead of the
+      // original image handler as it is probably faster.
+      //---
+      if ( !copyR0() && (i <= m_imageHandler->getNumberOfDecimationLevels()) ) 
+      {
+         ih = m_imageHandler;
+      }
+      else
+      {
+         // We know we're a tiff so don't use the factory.
+         ih = new ossimTiffTileSource;
+         if ( ih->open(outputFileTemp) == false )
+         {
+            ih = 0;
+            
+            // Set the error...
+            setErrorStatus();
+            ossimNotify(ossimNotifyLevel_WARN)
+               << __FILE__ << " " << __LINE__ << " " << MODULE
+               << "\nCannot open file: " << outputFileTemp << std::endl;
+            
+            return false;
+         }
+
+         //---
+         // Since the overview file is being opened here, need to set its handler's starting res
+         // level where the original image file left off. This is usually R1 since the original
+         // file only has R0, but the original file may have more than R0:
+         //---
+         if ( !copyR0() &&  !buildInternalOverviews() )
+         {
+            ih->setStartingResLevel( m_imageHandler->getNumberOfDecimationLevels());
+         }
+      }
+      
+      // If mask is to be generated, need to notify both the writer and the reader of new 
+      // input source:
+      if (m_bitMaskSpec.getSize() > 0)
+      {
+         m_maskFilter->connectMyInputTo(0, ih.get());
+         m_maskWriter->connectMyInputTo(ih.get());
+      }
+
+      if ( !writeRn( ih.get(), tif, i, (i==startingResLevel) && !copyR0() ) )
+      {
+         // Set the error...
+         setErrorStatus();
+         ossimNotify(ossimNotifyLevel_WARN)
+            << __FILE__ << " " << __LINE__ << " " << MODULE
+            << "\nError creating reduced res set: " << i << std::endl;
+
+         ih->disconnect();
+         ih = 0;
+         if (tif)
+         {
+            closeTiff(tif);
+            tif = 0;
+         }
+
+         if (progressListener)
+         {
+            removeListener(progressListener);
+            delete progressListener;
+            progressListener = 0;
+         }
+
+         if ( outputFileTemp.exists() && !buildInternalOverviews() )
+         {
+            ossimFilename::remove( outputFileTemp );
+         }
+
+         return false;
+      }
+      
+      if (needsAborting())
+      {
+         ih->disconnect();
+         ih = 0;
+         if (tif)
+         {
+            closeTiff(tif);
+            tif = 0;
+         }
+         if (progressListener)
+         {
+            removeListener(progressListener);
+            delete progressListener;
+            progressListener = 0;
+         }
+         return false;
+      }
+      
+      if (m_bitMaskSpec.getSize() > 0)
+      {
+         m_maskFilter->disconnectMyInput(0);
+         m_maskWriter->disconnectAllInputs();
+      }
+      ih = 0;
+   }
+
+   if (ossimMpi::instance()->getRank() == 0 )
+   {
+      if (tif)
+      {
+         closeTiff(tif);
+         tif = 0;
+      }
+
+      // Write out the alpha bit mask if one was enabled:
+      if (m_maskWriter.valid())
+      {
+         ossimNotify(ossimNotifyLevel_INFO) << "Writing alpha bit mask file..." << std::endl;
+         m_maskWriter->close();
+      }
+
+      // Remove the listener if we had one.
+      if (progressListener)
+      {
+         removeListener(progressListener);
+         delete progressListener;
+         progressListener = 0;
+      }
+
+      if ( !buildInternalOverviews() )
+      {
+         outputFileTemp.rename(m_outputFile);
+      }
+      
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_INFO)
+            << "Wrote file:  " << m_outputFile.c_str() << std::endl;
+      }
+     
+      setCurrentMessage(ossimString("Finished..."));
+   }
+   
+   finalize();  // Reset band list if a band selector.
+
+   return true;
+}
+
+bool ossimTiffOverviewBuilder::writeR0(TIFF* tif)
+{
+   static const char MODULE[] = "ossimTiffOverviewBuilder::writeR0";
+
+   ossimIrect rect = m_imageHandler->getImageRectangle();
+
+   if (!setTags(tif, rect, 0))
+   {
+      closeTiff(tif);
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " Error writing tags!" << std::endl;
+      return false;
+   }
+   
+   // Set the geotiff tags.
+   if ( setGeotiffTags(m_imageHandler->getImageGeometry().get(),
+                       m_imageHandler->getBoundingRect(),
+                       0,
+                       tif) == false )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << MODULE << " NOTICE: geotiff tags not set." << std::endl;
+      } 
+   }
+   
+   ossim_int32 samples         = m_imageHandler->getNumberOfSamples();
+   ossim_int32 lines           = m_imageHandler->getNumberOfLines();
+   ossim_int32 tilesWide       = samples % m_tileWidth ?
+                           samples / m_tileWidth + 1 : samples / m_tileWidth;
+   ossim_int32 tilesHigh       = lines % m_tileHeight ?
+                           lines / m_tileHeight + 1 : lines / m_tileHeight;
+   ossim_int32 numberOfTiles   = tilesWide * tilesHigh;
+
+   int tileNumber = 0;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiffOverviewBuilder::writeR0 DEBUG:"
+         << "\nsamples:        " << samples
+         << "\nlines:          " << lines
+         << "\ntilesWide:      " << tilesWide
+         << "\ntilesHigh:      " << tilesHigh
+         << "\nnumberOfTiles:  " << numberOfTiles
+         << std::endl;
+   }
+
+   setCurrentMessage(ossimString("Copying r0..."));
+   
+   //***
+   // Tile loop in the line direction.
+   //***
+   for(int i = 0; i < tilesHigh; ++i)
+   {
+      ossimIpt origin(0, 0);
+      origin.y = i * m_tileHeight;
+      
+      //***
+      // Tile loop in the sample (width) direction.
+      //***
+      for(int j = 0; j < tilesWide; ++j)
+      {
+         origin.x = j * m_tileWidth;
+
+         ossimRefPtr<ossimImageData> t =
+            m_imageHandler->getTile(ossimIrect(origin.x,
+                                                origin.y,
+                                                origin.x +(m_tileWidth-1),
+                                                origin.y +(m_tileHeight-1)));
+
+         // Check for errors reading tile:
+         if ( m_imageHandler->hasError() )
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR: reading tile:  " << i << std::endl;
+            return false;
+         }
+
+         // If masking was enabled, pass the tile onto that object for processing:
+         if (m_maskWriter.valid())
+            m_maskWriter->generateMask(t, 0);
+
+         //***
+         // Band loop.
+         //***
+         for (uint32 band=0;
+              band < m_imageHandler->getNumberOfOutputBands();
+              ++band)
+         {
+            tdata_t data;
+            
+            if ( t.valid() && (t->getDataObjectStatus() != OSSIM_NULL) )
+            {
+               // Grab a pointer to the tile for the band.
+               data = static_cast<tdata_t>(t->getBuf(band));
+            }
+            else
+            {
+               data = static_cast<tdata_t>(&(m_nullDataBuffer.front()));
+            }
+
+            // Write the tile.
+            int bytesWritten = 0;
+            bytesWritten = TIFFWriteTile(tif,
+                                         data,
+                                         origin.x,
+                                         origin.y,
+                                         0,        // z
+                                         band);    // sample
+
+            if (bytesWritten != m_tileSizeInBytes)
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " ERROR:"
+                  << "Error returned writing tiff tile:  " << i
+                  << "\nExpected bytes written:  " << m_tileSizeInBytes
+                  << "\nBytes written:  " << bytesWritten
+                  << std::endl;
+               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+               return false;
+            }
+
+         } // End of band loop.  
+        
+         ++tileNumber;
+
+      } // End of tile loop in the sample (width) direction.
+
+      if (needsAborting())
+      {
+         setPercentComplete(100.0);
+         break;
+      }
+      else
+      {
+         double tile = tileNumber;
+         double numTiles = numberOfTiles;
+         setPercentComplete(tile / numTiles * 100.0);
+      }
+
+   } // End of tile loop in the line (height) direction.
+
+   //***
+   // Write the current dirctory.
+   //***
+   if (!TIFFWriteDirectory(tif))
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " Error writing directory!" << std::endl;
+      return false;
+   }
+
+   ++m_currentTiffDir;
+
+   return true;
+}
+
+bool ossimTiffOverviewBuilder::writeRn( ossimImageHandler* imageHandler,
+                                        TIFF* tif,
+                                        ossim_uint32 resLevel,
+                                        bool firstResLevel )
+{
+   if ( ossimMpi::instance()->getRank() == 0 )
+   {
+      if ( tif ) //  && buildInternalOverviews() )
+      {
+         // Create an empty directory to start with.
+         TIFFCreateDirectory( tif );
+      }
+      else
+      {
+         return false;
+      }
+   } 
+   //---
+   // Set up the sequencer.  This will be one of three depending on if we're
+   // running mpi and if we are a master process or a slave process.
+   //---
+   ossimRefPtr<ossimOverviewSequencer> sequencer;
+   
+   if(ossimMpi::instance()->getNumberOfProcessors() > 1)
+   {
+      if ( ossimMpi::instance()->getRank() == 0 )
+      {
+         sequencer = new ossimMpiMasterOverviewSequencer();
+      }
+      else
+      {
+         sequencer = new ossimMpiSlaveOverviewSequencer();
+      }
+   }
+   else
+   {
+      sequencer = new ossimOverviewSequencer();
+   }
+   
+   sequencer->setImageHandler(imageHandler);
+
+   if (m_maskWriter.valid() && m_maskFilter.valid())
+   {
+      sequencer->setBitMaskObjects(m_maskWriter.get(), m_maskFilter.get());
+   }
+
+   // sourceResLevel: This is the res level to pull data from:
+   ossim_uint32 sourceResLevel = imageHandler->getNumberOfDecimationLevels() +
+      imageHandler->getStartingResLevel() - 1;
+
+   sequencer->setSourceLevel(sourceResLevel);
+   sequencer->setResampleType(m_resampleType);
+   sequencer->setTileSize( ossimIpt(m_tileWidth, m_tileHeight) );
+   
+   if ( firstResLevel )
+   {
+      // Set up things that are only performed on first scan through tiles.
+      
+      if ( getHistogramMode() != OSSIM_HISTO_MODE_UNKNOWN )
+      {
+         // Accumulate a histogram.  Can't do with mpi/multi-process.
+         if(ossimMpi::instance()->getNumberOfProcessors() == 1)
+         {
+            sequencer->setHistogramMode(getHistogramMode());
+         }
+         //---
+         // else{} Not sure if we want an error thrown here.  For now will handle at the
+         // application level.
+         //---
+      }
+      if ( getScanForMinMaxNull() == true )
+      {
+         sequencer->setScanForMinMaxNull(true);
+      }
+      else if ( getScanForMinMax() == true )
+      {
+         sequencer->setScanForMinMax(true);
+      }
+   }
+
+   // Note sequence setup must be performed before intialize. 
+   sequencer->initialize();
+
+   // If we are a slave process start the resampling of tiles.
+   if (ossimMpi::instance()->getRank() != 0 )
+   {
+      sequencer->slaveProcessTiles();
+      return true;
+   }
+
+   //---
+   // The rest of the method on master node only.
+   //---
+   static const char MODULE[] = "ossimTiffOverviewBuilder::writeRn";
+
+   ostringstream os;
+   os << "creating r" << resLevel << "...";
+   setCurrentMessage(os.str());
+
+   if (resLevel == 0)
+   {
+      return false;
+   }
+
+   ossimIrect rect;
+   sequencer->getOutputImageRectangle(rect);
+
+   if (!setTags(tif, rect, resLevel))
+   {
+      setErrorStatus();
+      closeTiff(tif);
+      tif = 0;
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE << " Error writing tags!" << std::endl;
+      return false;
+   }
+
+   if ( !buildInternalOverviews() && !copyR0() && (resLevel == 1) )
+   {
+      //---
+      // Set the geotif tags for the first layer.
+      // Note this is done in writeR0 method if m_copyAllFlag is set.
+      //---
+      if ( setGeotiffTags(m_imageHandler->getImageGeometry().get(),
+                          ossimDrect(rect),
+                          resLevel,
+                          tif) == false )
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << MODULE << " NOTICE: geotiff tags not set." << std::endl;
+         } 
+      }
+   }
+
+   ossim_uint32 outputTilesWide = sequencer->getNumberOfTilesHorizontal();
+   ossim_uint32 outputTilesHigh = sequencer->getNumberOfTilesVertical();
+   ossim_uint32 numberOfTiles   = sequencer->getNumberOfTiles();
+   ossim_uint32 tileNumber      = 0;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiffOverviewBuilder::writeRn DEBUG:"
+         << "\noutputTilesWide:  " << outputTilesWide
+         << "\noutputTilesHigh:  " << outputTilesHigh
+         << "\nnumberOfTiles:    " << numberOfTiles
+         << std::endl;
+   }
+ 
+   // Tile loop in the line direction.
+   ossim_uint32 y = 0;
+
+   for(ossim_uint32 i = 0; i < outputTilesHigh; ++i)
+   {
+      // Tile loop in the sample (width) direction.
+      ossim_uint32 x = 0;
+      for(ossim_uint32 j = 0; j < outputTilesWide; ++j)
+      {
+         // Grab the resampled tile.
+         ossimRefPtr<ossimImageData> t = sequencer->getNextTile();
+
+         // Check for errors reading tile:
+         if ( sequencer->hasError() )
+         {
+            setErrorStatus();
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR: reading tile:  " << i << std::endl;
+            return false;
+         }
+         
+         if ( t.valid() && ( t->getDataObjectStatus() != OSSIM_NULL ) )
+         {
+            // Write it to the tiff.
+            for (ossim_uint32 band = 0; band < t->getNumberOfBands(); ++band)
+            {
+               // Write the tile.
+               int bytesWritten = 0;
+               bytesWritten = TIFFWriteTile(tif,
+                                            t->getBuf(band),
+                                            x,
+                                            y,
+                                            0,        // z
+                                            band);    // sample
+               
+               if (bytesWritten != m_tileSizeInBytes)
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " ERROR:"
+                     << "Error returned writing tiff tile:  " << i
+                     << "\nExpected bytes written:  " << m_tileSizeInBytes
+                     << "\nBytes written:  " << bytesWritten
+                     << std::endl;
+                  theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+                  
+                  return false;
+               }
+            }
+         }
+         x += m_tileWidth; // Increment x for next TIFFWriteTile.
+         ++tileNumber;      // Increment tile number for percent complete.
+
+      } // End of tile loop in the sample (width) direction.
+
+      if (needsAborting())
+      {
+         setPercentComplete(100.0);
+         break;
+      }
+      else
+      {
+         double tile = tileNumber;
+         double numTiles = numberOfTiles;
+         setPercentComplete(tile / numTiles * 100.0);
+      }
+
+      y += m_tileHeight; // Increment y for next TIFFWriteTile.
+
+   } // End of tile loop in the line (height) direction.
+
+   //---
+   // Write the current dirctory.
+   //---
+   if (!TIFFFlush(tif))
+   {
+      setErrorStatus();
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " Error writing to TIF file!" << std::endl;
+      return false;
+   }
+
+   if ( firstResLevel )
+   {
+      if ( ossimMpi::instance()->getNumberOfProcessors() == 1 )
+      {
+         if ( getHistogramMode() != OSSIM_HISTO_MODE_UNKNOWN )
+         {
+            // Write the histogram.
+            ossimFilename histoFilename = getOutputFile();
+            histoFilename.setExtension("his");
+            sequencer->writeHistogram(histoFilename);
+         }
+
+         if ( ( getScanForMinMaxNull() == true ) || ( getScanForMinMax() == true ) )
+         {
+            // Write the omd file:
+            ossimFilename file = getOutputFile();
+            file = file.setExtension("omd");
+            sequencer->writeOmdFile(file);
+         }
+      }
+   }
+
+   ++m_currentTiffDir;
+
+   return true;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimTiffOverviewBuilder::setTags(TIFF* tif,
+                                       const ossimIrect& outputRect,
+                                       ossim_int32 resLevel) const
+{
+   if (outputRect.hasNans())
+   {
+      return false;
+   }
+   
+   ossim_int32   imageWidth      = outputRect.width();
+   ossim_int32   imageHeight     = outputRect.height();
+   int16         samplesPerPixel = m_imageHandler->getNumberOfOutputBands();
+   ossim_float64 minSampleValue  = m_imageHandler->getMinPixelValue();
+   ossim_float64 maxSampleValue  = m_imageHandler->getMaxPixelValue();
+
+   if (resLevel)
+   {
+      TIFFSetField( tif, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE );
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiffOverviewBuilder::setTags DEBUG:"
+         << "\nrrds_level:      " << resLevel
+         << "\nimageWidth:      " << imageWidth
+         << "\nimageHeight:     " << imageHeight
+         << "\nminSampleValue:  " << minSampleValue
+         << "\nmaxSampleValue:  " << maxSampleValue
+         << "\ncompression:     " << m_tiffCompressType
+         << std::endl;
+   }
+   TIFFSetField( tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_SEPARATE );
+   TIFFSetField( tif, TIFFTAG_IMAGEWIDTH, imageWidth);
+   TIFFSetField( tif, TIFFTAG_IMAGELENGTH, imageHeight);
+   TIFFSetField( tif, TIFFTAG_BITSPERSAMPLE, m_bitsPerSample );
+   TIFFSetField( tif, TIFFTAG_SAMPLEFORMAT, m_sampleFormat );
+   TIFFSetField( tif, TIFFTAG_SAMPLESPERPIXEL, samplesPerPixel );
+
+   if( m_imageHandler->getNumberOfInputBands() == 3 )
+      TIFFSetField( tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB );
+   else
+      TIFFSetField( tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK );
+   
+   TIFFSetField( tif, TIFFTAG_TILEWIDTH,  m_tileWidth  );
+   TIFFSetField( tif, TIFFTAG_TILELENGTH, m_tileHeight );
+
+   // Set the compression related tags...
+   if (m_tiffCompressType != COMPRESSION_JPEG)
+   {
+      TIFFSetField( tif, TIFFTAG_COMPRESSION, m_tiffCompressType ); 
+   }
+   //---
+   // If jpeg only turn on compression for 8 bit, one or three band data.  Not
+   // sure what compression types can handle what but this was crashing
+   // ossim-prepoc on a directory walk with jpeg compression.
+   //---
+   else if ( (m_tiffCompressType == COMPRESSION_JPEG) &&
+             ( m_imageHandler->getOutputScalarType() == OSSIM_UINT8 ) &&
+             ( ( m_imageHandler->getNumberOfInputBands() == 3 ) ||
+               ( m_imageHandler->getNumberOfInputBands() == 1 ) ) )
+   {
+      TIFFSetField( tif, TIFFTAG_COMPRESSION, m_tiffCompressType );
+      TIFFSetField( tif, TIFFTAG_JPEGQUALITY, m_jpegCompressQuality);
+   }
+   else
+   {
+      if ( traceDebug() && (m_tiffCompressType != COMPRESSION_NONE ) )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimTiffOverviewBuilder::setTags WARNING:\n"
+            << "Compression not set for this data type:\n"
+            << "scalar type: "
+            << ossimScalarTypeLut::instance()->getEntryString(
+               m_imageHandler->getOutputScalarType())
+            << "\nband count: " << m_imageHandler->getNumberOfInputBands()
+            << std::endl;
+      }
+      TIFFSetField( tif, TIFFTAG_COMPRESSION, COMPRESSION_NONE );
+   }
+   
+   // Set the min/max values.
+   switch( m_imageHandler->getOutputScalarType() )
+   {
+      case OSSIM_SINT16:
+      case OSSIM_FLOAT32:
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+         TIFFSetField( tif, TIFFTAG_SMINSAMPLEVALUE, minSampleValue );
+         TIFFSetField( tif, TIFFTAG_SMAXSAMPLEVALUE, maxSampleValue );
+         break;
+
+      case OSSIM_UINT8:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      case OSSIM_UINT32:
+      default:
+         TIFFSetField( tif, TIFFTAG_MINSAMPLEVALUE,
+                       static_cast<int>(minSampleValue) );
+         TIFFSetField( tif, TIFFTAG_MAXSAMPLEVALUE,
+                       static_cast<int>(maxSampleValue) );
+         break;
+   }
+   
+    return true;
+}
+
+bool ossimTiffOverviewBuilder::setGeotiffTags(const ossimImageGeometry* geom,
+                                              const ossimDrect& boundingRect,
+                                              ossim_uint32 resLevel,
+                                              TIFF* tif)
+{
+   bool result = false;
+
+   if ( geom && tif )
+   {
+      const ossimProjection* proj = geom->getProjection();
+      if (proj)
+      {
+         // Must duplicate if changing scale.
+         ossimObject* obj = proj->dup();
+         ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, obj);
+         if ( mapProj )
+         {
+            if ( mapProj->hasModelTransform() == false )
+            {
+               if (resLevel)
+               {
+                  ossim_float64 factor = (ossim_float64)(1 << resLevel);
+                  mapProj->applyScale(ossimDpt(factor, factor), true);
+               }
+               ossimRefPtr<ossimMapProjectionInfo> projInfo =
+                  new ossimMapProjectionInfo(mapProj, boundingRect);
+               result = ossimGeoTiff::writeTags(tif, projInfo);
+            }
+         }
+         delete obj; // Cleanup from dup.
+         obj = 0;
+      }
+   }
+   
+   return result;
+}
+
+TIFF* ossimTiffOverviewBuilder::openTiff(const ossimString& filename) const
+{
+   ossimString openMode;
+   if ( !buildInternalOverviews() )
+   {
+      openMode = "w";
+
+      ossim_uint64 fourGigs = (static_cast<ossim_uint64>(1024)*
+                               static_cast<ossim_uint64>(1024)*
+                               static_cast<ossim_uint64>(1024)*
+                               static_cast<ossim_uint64>(4));
+      ossimIrect bounds = m_imageHandler->getBoundingRect();
+      ossim_uint64 byteCheck =
+         (static_cast<ossim_uint64>(bounds.width())*
+          static_cast<ossim_uint64>(bounds.height())*
+          static_cast<ossim_uint64>(m_imageHandler->getNumberOfOutputBands())*
+          static_cast<ossim_uint64>(ossim::scalarSizeInBytes(m_imageHandler->
+                                                             getOutputScalarType())));
+         
+      if((byteCheck*static_cast<ossim_uint64>(2))>fourGigs)
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << " Big tiff activated\n";
+         }
+         openMode += "8";
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << " No big tiff activated\n";
+         }
+      }
+   }
+   else
+   {
+      openMode = "r+"; // Append to existing file...
+   }
+
+   // Open:
+   return XTIFFOpen( filename.c_str(), openMode.c_str() );
+}
+
+void ossimTiffOverviewBuilder::closeTiff(TIFF* tif)
+{
+   XTIFFClose( tif );
+}
+
+void ossimTiffOverviewBuilder::setCompressionType(ossim_uint16 compression_type)
+{
+   switch (compression_type)
+   {
+   case COMPRESSION_JPEG:
+   case COMPRESSION_LZW:
+   case COMPRESSION_DEFLATE:
+   case COMPRESSION_PACKBITS:
+      m_tiffCompressType = compression_type;
+      break;
+   default:
+      m_tiffCompressType = COMPRESSION_NONE;
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << __FILE__ << " " << __LINE__
+            << "\nossimTiffOverviewBuilder::setCompressionType Unsupported compression type: "
+            << compression_type << "\nDefaulting to none."
+            << std::endl;
+      }
+      break;
+   }
+}
+
+void ossimTiffOverviewBuilder::setJpegCompressionQuality(ossim_int32 quality)
+{
+   if (quality > 1 && quality < 101)
+   {
+      m_jpegCompressQuality = quality;
+   }
+   else
+   {
+      m_jpegCompressQuality = DEFAULT_COMPRESS_QUALITY;
+
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTiffOverviewBuilder::setJpegCompressionQuality\n"
+         << "\nCompression quality of " << quality << " is out of range!"
+         << "\nRange is 100 to 1.  Current quality set to default of 75."
+         << std::endl;
+   }
+}
+
+bool ossimTiffOverviewBuilder::getCopyAllFlag() const
+{
+   return m_copyAllFlag;
+}
+
+void ossimTiffOverviewBuilder::setCopyAllFlag(bool flag)
+{
+   m_copyAllFlag = flag;
+}
+
+void ossimTiffOverviewBuilder::setInternalOverviewsFlag( bool flag )
+{
+   m_internalOverviewsFlag = flag;
+}
+
+bool ossimTiffOverviewBuilder::getInternalOverviewsFlag() const
+{
+   return m_internalOverviewsFlag;
+}
+
+ossimObject* ossimTiffOverviewBuilder::getObject()
+{
+   return this;
+}
+
+const ossimObject* ossimTiffOverviewBuilder::getObject() const
+{
+   return this;
+}
+
+void ossimTiffOverviewBuilder::setOutputFile(const ossimFilename& file)
+{
+   m_outputFile = file;
+}
+
+ossimFilename ossimTiffOverviewBuilder::getOutputFile() const
+{
+   ossimFilename result;
+
+   if ( buildInternalOverviews() )
+   {
+      // m_imageHandler pointer good if buildInternalOverviews() returns true.
+      result = m_imageHandler->getFilename();
+   }
+   else
+   {
+      result = m_outputFile;
+   }
+
+   if (m_outputFile == ossimFilename::NIL)
+   {
+      if ( m_imageHandler.valid() )
+      {
+         bool usePrefix = (m_imageHandler->getNumberOfEntries()>1?true:false);
+         result = m_imageHandler->
+            getFilenameWithThisExtension(ossimString("ovr"), usePrefix);
+      }
+   }
+   
+   return result;
+}
+
+void ossimTiffOverviewBuilder::setOutputTileSize(const ossimIpt& tileSize)
+{
+   m_tileWidth  = tileSize.x;
+   m_tileHeight = tileSize.y;
+   m_outputTileSizeSetFlag = true;
+}
+
+bool ossimTiffOverviewBuilder::setInputSource(ossimImageHandler* imageSource)
+{
+   static const char MODULE[] = "ossimTiffOverviewBuilder::initializeFromHandler";
+
+   bool result = ossimOverviewBuilderBase::setInputSource( imageSource );
+   
+   if ( result )
+   {
+      if(!m_outputTileSizeSetFlag)
+      {
+         ossimIpt tileSize;
+         ossim::defaultTileSize(tileSize);
+         m_tileWidth  = tileSize.x;
+         m_tileHeight = tileSize.y;
+      }
+      
+      if (traceDebug())
+      {
+         CLOG << "DEBUG:"
+              << "\nm_tileWidth:   " << m_tileWidth
+              << "\nm_tileHeight:  " << m_tileHeight
+              << "\nSource image is tiled:  "
+              << (m_imageHandler->isImageTiled()?"true":"false")
+              << "\nm_imageHandler->getTileWidth():  "
+              << m_imageHandler->getTileWidth()
+              << "\nm_imageHandler->getTileHeight():  "
+              << m_imageHandler->getTileHeight()
+              << "\nm_imageHandler->getImageTileWidth():  "
+              << m_imageHandler->getImageTileWidth()
+              << "\nm_imageHandler->getImageTileHeight():  "
+              << m_imageHandler->getImageTileHeight()
+              << std::endl;
+      }
+
+      switch(m_imageHandler->getOutputScalarType())
+      {
+         case OSSIM_UINT8:
+            m_bitsPerSample = 8;
+            m_bytesPerPixel = 1;
+            m_sampleFormat  = SAMPLEFORMAT_UINT;
+            break;
+            
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         case OSSIM_UINT16:
+            m_bitsPerSample = 16;
+            m_bytesPerPixel = 2;
+            m_sampleFormat  = SAMPLEFORMAT_UINT;
+            break;
+            
+         case OSSIM_SINT16:
+            m_bitsPerSample = 16;
+            m_bytesPerPixel = 2;
+            m_sampleFormat  = SAMPLEFORMAT_INT;
+            break;
+            
+         case OSSIM_SINT32:
+            m_bitsPerSample = 32;
+            m_bytesPerPixel = 4;
+            m_sampleFormat  = SAMPLEFORMAT_INT;
+            break;
+            
+         case OSSIM_UINT32:
+            m_bitsPerSample = 32;
+            m_bytesPerPixel = 4;
+            m_sampleFormat  = SAMPLEFORMAT_UINT;
+            break;
+            
+         case OSSIM_FLOAT32:
+            m_bitsPerSample = 32;
+            m_bytesPerPixel = 4;
+            m_sampleFormat  = SAMPLEFORMAT_IEEEFP;
+            break;
+            
+         case OSSIM_NORMALIZED_DOUBLE:
+         case OSSIM_FLOAT64:
+            m_bitsPerSample = 64;
+            m_bytesPerPixel = 8;
+            m_sampleFormat  = SAMPLEFORMAT_IEEEFP;
+            break;
+            
+         default:
+            // Set the error...
+            setErrorStatus();
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:"
+               << "\nUnknow pixel type:  "
+               << (ossimScalarTypeLut::instance()->
+                   getEntryString(m_imageHandler->getOutputScalarType()))
+               << std::endl;
+            result = false;
+      }
+
+      if ( result )
+      {
+         m_tileSizeInBytes = m_tileWidth * m_tileHeight * m_bytesPerPixel;
+         
+         //---
+         // Make a buffer to pass to pass to the write tile methods when an image
+         // handler returns a null tile.
+         //---
+         m_nullDataBuffer.resize(m_tileSizeInBytes);
+      
+         // Fill it with zeroes.
+         std::fill(m_nullDataBuffer.begin(), m_nullDataBuffer.end(), 0);
+      }
+   }
+   else
+   {
+      // Set the error...
+      setErrorStatus();
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " ERROR:"
+         << "\nSetting image handler as input failed!"
+         << std::endl;
+   }
+
+   return result;
+
+} // End: ossimTiffOverviewBuilder::setInputSource(ossimImageHandler* imageSource)
+
+bool ossimTiffOverviewBuilder::setOverviewType(const ossimString& type)
+{
+   bool result = true;
+   if (type == "ossim_tiff_nearest")
+   {
+      m_resampleType =
+         ossimFilterResampler::ossimFilterResampler_NEAREST_NEIGHBOR;
+   }
+   else if (type == "ossim_tiff_box")
+   {
+      m_resampleType = ossimFilterResampler::ossimFilterResampler_BOX;
+   }
+   else
+   {
+      result = false;
+   }
+   return result;
+}
+
+ossimString ossimTiffOverviewBuilder::getOverviewType() const
+{
+   ossimString type;
+   if (m_resampleType == ossimFilterResampler::ossimFilterResampler_NEAREST_NEIGHBOR)
+   {
+      type = "ossim_tiff_nearest";
+   }
+   else
+   {
+      type = "ossim_tiff_box"; // This is default...
+   }
+   return type;
+}
+
+void ossimTiffOverviewBuilder::getTypeNameList(
+   std::vector<ossimString>& typeList)const
+{
+   typeList.push_back(ossimString("ossim_tiff_box"));
+   typeList.push_back(ossimString("ossim_tiff_nearest"));
+}
+
+void ossimTiffOverviewBuilder::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if ( property.valid() )
+   {
+      if(property->getName() == ossimKeywordNames::COMPRESSION_QUALITY_KW)
+      {
+         m_jpegCompressQuality = property->valueToString().toInt32();
+      }
+      else if(property->getName() == ossimKeywordNames::COMPRESSION_TYPE_KW)
+      {
+         ossimString value = property->valueToString();
+         value = value.downcase();
+         if(value == "jpeg")
+         {
+            m_tiffCompressType =  COMPRESSION_JPEG;
+         }
+         else if(value == "lzw")
+         {
+            m_tiffCompressType =  COMPRESSION_LZW;
+            
+         }
+         else if(value == "deflate")
+         {
+            m_tiffCompressType =  COMPRESSION_DEFLATE;
+         }
+         else if(value == "packbits")
+         {
+            m_tiffCompressType =  COMPRESSION_PACKBITS;
+         }
+         else
+         {
+            m_tiffCompressType = COMPRESSION_NONE;
+         }
+      }
+      else if(property->getName() == COPY_ALL_KW)
+      {
+         m_copyAllFlag = property->valueToString().toBool();
+      }
+      else if(property->getName() == TEMP_EXTENSION)
+      {
+         m_tempExtension = property->valueToString();
+      }
+      else if( property->getName() == INTERNAL_OVERVIEWS_KW )
+      {
+         m_internalOverviewsFlag = property->valueToString().toBool();
+      }
+      else if(property->getName() == ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW)
+      {
+         m_overviewStopDimension = property->valueToString().toUInt32();
+      }
+      else if(property->getName() == ossimKeywordNames::OUTPUT_TILE_SIZE_KW)
+      {
+         ossimIpt ipt;
+         
+         ipt.toPoint(property->valueToString());
+         
+         setOutputTileSize(ipt);
+      }
+   }
+}
+
+void ossimTiffOverviewBuilder::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(ossimKeywordNames::COMPRESSION_QUALITY_KW);
+   propertyNames.push_back(ossimKeywordNames::COMPRESSION_TYPE_KW);
+   propertyNames.push_back(COPY_ALL_KW);
+   propertyNames.push_back(INTERNAL_OVERVIEWS_KW);
+   propertyNames.push_back(ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW);
+   propertyNames.push_back(TEMP_EXTENSION);
+}
+
+bool ossimTiffOverviewBuilder::canConnectMyInputTo(
+   ossim_int32 index,
+   const ossimConnectableObject* obj) const
+{
+   if ( (index == 0) &&
+        PTR_CAST(ossimImageHandler, obj) )
+   {
+      return true;
+   }
+
+   return false;
+}
+
+bool ossimTiffOverviewBuilder::buildInternalOverviews() const
+{
+   bool result = false;
+   if ( m_internalOverviewsFlag &&  m_imageHandler.valid() )
+   {
+      if ( m_imageHandler->getClassName() == "ossimTiffTileSource" )
+      {
+         result = true;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Internal overviews opton not supported for class: "
+            << m_imageHandler->getClassName()
+            << std::endl;
+      }
+   }
+   return result;
+}
+
+bool ossimTiffOverviewBuilder::copyR0() const
+{
+   return ( m_copyAllFlag && !buildInternalOverviews());
+}
diff --git a/src/imaging/ossimTiffTileSource.cpp b/src/imaging/ossimTiffTileSource.cpp
new file mode 100644
index 0000000..ed270ad
--- /dev/null
+++ b/src/imaging/ossimTiffTileSource.cpp
@@ -0,0 +1,2908 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//          Frank Warmerdam (warmerdam at pobox.com)
+//
+// Description:
+//
+// Contains class definition for TiffTileSource.
+//
+//*******************************************************************
+//  $Id: ossimTiffTileSource.cpp 23548 2015-09-28 21:01:36Z dburken $
+
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/support_data/ossimGeoTiff.h>
+#include <ossim/support_data/ossimTiffInfo.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIoStream.h> /* for ossimIOMemoryStream */
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <xtiffio.h>
+#include <geo_normalize.h>
+#include <cstdlib> /* for abs(int) */
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+
+RTTI_DEF1(ossimTiffTileSource, "ossimTiffTileSource", ossimImageHandler)
+
+static ossimTrace traceDebug("ossimTiffTileSource:debug");
+
+#define OSSIM_TIFF_UNPACK_R4(value) ( (value)&0x000000FF)
+#define OSSIM_TIFF_UNPACK_G4(value) ( ((value)>>8)&0x000000FF)
+#define OSSIM_TIFF_UNPACK_B4(value) ( ((value)>>16)&0x000000FF)
+#define OSSIM_TIFF_UNPACK_A4(value) ( ((value)>>24)&0x000000FF)
+
+//---
+// OSSIM_BUFFER_SCAN_LINE_READS:
+// If set to 1 ossimTiffTileSource::loadFromScanLine method will buffer image
+// width by tile height.  If set to 0 one line will be read at a time which
+// conserves memory on wide images or tall tiles.
+//
+// Buffered read is faster but uses more memory. Non-buffered slower less
+// memory.
+//
+// Only affects reading strip tiffs.
+//---
+#define OSSIM_BUFFER_SCAN_LINE_READS 1
+
+class TiffStreamAdaptor
+{
+public:
+   TiffStreamAdaptor(ossimTiffTileSource* tiffTileSource)
+      :m_tiffTileSource(tiffTileSource)
+   {
+      m_tiffStream = ossim::StreamFactoryRegistry::instance()->createIstream(m_tiffTileSource->getFilename());
+   }
+
+   TiffStreamAdaptor(ossimTiffTileSource* tiffTileSource, 
+                     std::shared_ptr<ossim::istream>& tiffStream)
+      :m_tiffTileSource(tiffTileSource),
+       m_tiffStream(tiffStream)
+   {
+
+   }
+   
+   ~TiffStreamAdaptor()
+   {
+      close();
+   }
+   ossimFilename getFilename()const
+   {
+      if(m_tiffTileSource)
+      {
+         return m_tiffTileSource->getFilename();
+      }
+
+      return "";
+   }
+   void close()
+   {
+      m_tiffStream.reset();
+      m_tiffTileSource = 0;
+   }
+   ossimTiffTileSource* m_tiffTileSource;
+   std::shared_ptr<ossim::istream> m_tiffStream;
+};
+
+tsize_t tiff_Read(thandle_t st,tdata_t buffer,tsize_t size)
+{
+   TiffStreamAdaptor* streamAdaptor = (TiffStreamAdaptor*)st;
+   tsize_t result = -1;
+   if(streamAdaptor->m_tiffStream)
+   {
+      streamAdaptor->m_tiffStream->read((char*)buffer, size);
+
+      result = streamAdaptor->m_tiffStream->gcount();
+   }
+
+   return result;
+};
+
+tsize_t tiff_Write(thandle_t st,tdata_t buffer,tsize_t size)
+{
+   return -1;
+};
+
+int tiff_Close(thandle_t st)
+{
+   TiffStreamAdaptor* streamAdaptor = (TiffStreamAdaptor*)st;
+
+   streamAdaptor->close();
+   
+   return 0;
+};
+
+toff_t tiff_Seek(thandle_t st,toff_t pos, int whence)
+{
+   TiffStreamAdaptor* streamAdaptor = (TiffStreamAdaptor*)st;
+   toff_t result = -1;
+   std::ios_base::seekdir seekDir = std::ios::beg;
+// std::cout << "SIZE OF POS =============== " << sizeof(toff_t) << std::endl;
+// std::cout << "tiff_Seek POS =============== " << pos << std::endl;
+   //std::cout<< "CALLING THE tiff_Seek!!!!!!!!!!!!!!\n" << std::endl;
+   if (!streamAdaptor->m_tiffStream)
+   {
+    return result;      
+   }
+   switch(whence)
+   {
+      case 0: // SEEK_SET
+      {
+       seekDir = std::ios::beg;
+       break;
+      }
+      case 1: // SEEK_CUR
+      {
+         seekDir = std::ios::cur;
+         break;
+      }
+      case 2: // SEEK_END
+      {
+        seekDir = std::ios::end;
+         break;
+      }
+   }
+       // std::cout << "tiff_Seek RESULT === " << result << "\n";
+
+   streamAdaptor->m_tiffStream->seekg(pos, seekDir);
+   return streamAdaptor->m_tiffStream->tellg();
+};
+
+toff_t tiff_Size(thandle_t st)
+{
+   toff_t result = -1;
+   //std::cout<< "CALLING THE tiff_Size!!!!!!!!!!!!!!\n" << std::endl;
+   TiffStreamAdaptor* streamAdaptor = (TiffStreamAdaptor*)st;
+    if (streamAdaptor->m_tiffStream)
+    {
+      ossim_int64 currentOffset = streamAdaptor->m_tiffStream->tellg();
+      streamAdaptor->m_tiffStream->seekg(0, std::ios::end);
+      result = streamAdaptor->m_tiffStream->tellg();
+      streamAdaptor->m_tiffStream->seekg(currentOffset);
+    }
+    // std::cout << "tiff_Size RESULT =========== " << result << "\n";
+   return result;
+};
+
+int tiff_Map(thandle_t, tdata_t*, toff_t*)
+{
+   std::cout << "tiff_Map\n";
+    return 0;
+};
+
+void tiff_Unmap(thandle_t, tdata_t, toff_t)
+{
+   std::cout << "tiff_Unmap\n";
+    return;
+};
+
+//*******************************************************************
+// Public Constructor:
+//*******************************************************************
+ossimTiffTileSource::ossimTiffTileSource()
+   :
+      ossimImageHandler(),
+      theTiffPtr(0),
+      theTile(0),
+      theBuffer(0),
+      theBufferSize(0),
+      theBufferRect(0, 0, 0, 0),
+      theBufferRLevel(0),
+      theCurrentTileWidth(0),
+      theCurrentTileHeight(0),
+      theSamplesPerPixel(0),
+      theBitsPerSample(0),
+      theSampleFormatUnit(0),
+      theMaxSampleValue(ossim::nan()),
+      theMinSampleValue(ossim::nan()),
+      theNullSampleValue(ossim::nan()),
+      theNumberOfDirectories(0),
+      theCurrentDirectory(0),
+      theR0isFullRes(false),
+      theBytesPerPixel(0),
+      theScalarType(OSSIM_SCALAR_UNKNOWN),
+      theApplyColorPaletteFlag(true),
+      theImageWidth(0),
+      theImageLength(0),
+      theReadMethod(0),
+      thePlanarConfig(0),
+      thePhotometric(0),
+      theRowsPerStrip(0),
+      theImageTileWidth(0),
+      theImageTileLength(0),
+      theImageDirectoryList(0),
+      theCurrentTiffRlevel(0),
+      theCompressionType(0),
+      theOutputBandList(0)
+{}
+
+ossimTiffTileSource::~ossimTiffTileSource()
+{
+   close();
+}
+
+ossimRefPtr<ossimImageData> ossimTiffTileSource::getTile(
+   const ossimIrect& tile_rect, ossim_uint32 resLevel )
+{
+   if ( theTile.valid() == false )
+   {
+      allocateTile(); // First time through...
+   }
+   
+   if ( theTile.valid() )
+   {
+      // Image rectangle must be set prior to calling getTile.
+      theTile->setImageRectangle(tile_rect);
+
+      if ( getTile( theTile.get(), resLevel ) == false )
+      {
+         if (theTile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            theTile->makeBlank();
+         }
+      }
+   }
+
+   return theTile;
+}
+
+bool ossimTiffTileSource::getTile(ossimImageData* result,
+                                  ossim_uint32 resLevel)
+{
+   static const char MODULE[] = "ossimTiffTileSource::getTile(ossimImageData*, resLevel)";
+
+   bool status = false;
+   
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
+   {
+      result->ref(); // Increment ref count.
+      
+      //---
+      // Check for overview tile.  Some overviews can contain r0 so always
+      // call even if resLevel is 0.  Method returns true on success, false
+      // on error.
+      //---
+      status = getOverviewTile(resLevel, result);
+
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+         
+         ossim_uint32 level = resLevel;
+
+         //---
+         // If we have r0 our reslevels are the same as the callers so
+         // no adjustment necessary.
+         //---
+         if (theStartingResLevel && !theR0isFullRes) // Used as overview.
+         {
+            //---
+            // If we have r0 our reslevels are the same as the callers so
+            // no adjustment necessary.
+            //---
+            if (level >= theStartingResLevel)
+            {
+               //---
+               // Adjust the level to be relative to the reader using this
+               // as overview.
+               //---
+               level -= theStartingResLevel; 
+            }
+         }
+
+         ossimIrect tile_rect = result->getImageRectangle();
+
+         //---
+         // This should be the zero base image rectangle for this res level.
+         // Note passed the non adjusted resLevel by design.
+         //---
+         ossimIrect image_rect = getImageRectangle(resLevel);
+
+         // See if any point of the requested tile is in the image.
+         if ( tile_rect.intersects(image_rect) )
+         {
+            // Initialize the tile if needed as we're going to stuff it.
+            if (result->getDataObjectStatus() == OSSIM_NULL)
+            {
+               result->initialize();
+            }
+
+            bool reallocateBuffer = false;   
+            if ( (tile_rect.width()  != theCurrentTileWidth) ||
+                 (tile_rect.height() != theCurrentTileHeight) )
+            {
+               // Current tile size must be set prior to allocatBuffer call.
+               theCurrentTileWidth = tile_rect.width();
+               theCurrentTileHeight = tile_rect.height();
+               
+               reallocateBuffer = true;
+            }
+            
+            if (getCurrentTiffRLevel() != theImageDirectoryList[level])
+            {
+               status = setTiffDirectory(theImageDirectoryList[level]);
+               if (status)
+               {
+                  reallocateBuffer = true;
+               }
+            }
+
+            if (status)
+            {
+               if (reallocateBuffer)
+               {
+                  // NOTE: Using this buffer will be a thread issue. (drb) 
+                  status = allocateBuffer();
+               }
+            }
+
+            if ( status )
+            {  
+               ossimIrect clip_rect = tile_rect.clipToRect( image_rect );
+               
+               if ( !tile_rect.completely_within( clip_rect ) )
+               {
+                  //---
+                  // We're not going to fill the whole tile so start with a
+                  // blank tile.
+                  //---
+                  result->makeBlank();
+               }
+               
+               // Load the tile buffer with data from the tif.
+               if ( loadTile( tile_rect, clip_rect, result ) )
+               {
+                  result->validate();
+                  status = true;
+               }
+               else
+               {
+                  // Would like to change this to throw ossimException.(drb)
+                  status = false;
+                  if(traceDebug())
+                  {
+                     // Error in filling buffer.
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << MODULE
+                        << " Error filling buffer. Return status = false..."
+                        << std::endl;
+                  }
+               }
+
+            } // matches: if (status)
+               
+         } // matches:  if ( zeroBasedTileRect.intersects(image_rect) )
+         else 
+         {
+            // No part of requested tile within the image rectangle.
+            status = true; // Not an error.
+            result->makeBlank();
+         }
+         
+      } // matches: if (!status)
+      
+      result->unref(); // Decrement ref count.
+      
+   } // matches: if( isOpen() && isSourceEnabled() && isValidRLevel(level) )
+
+   return status;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimTiffTileSource::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix) const
+{
+   bool result = ossimImageHandler::saveState(kwl, prefix);
+   
+   if ( result )
+   {
+      if ( isBandSelector() && theOutputBandList.size() )
+      {
+         if ( isIdentityBandList( theOutputBandList ) == false )
+         {
+            // If we're not identity output the bands.
+            ossimString bandsString;
+            ossim::toSimpleStringList(bandsString, theOutputBandList);
+            kwl.add(prefix,
+                    ossimKeywordNames::BANDS_KW,
+                    bandsString,
+                    true);
+         }
+      }
+      
+      kwl.add(prefix,
+              "apply_color_palette_flag",
+              theApplyColorPaletteFlag,
+              true);
+   }
+   
+   return result;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+bool ossimTiffTileSource::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   bool result = false;
+   theOutputBandList.clear();
+
+   if (ossimImageHandler::loadState(kwl, prefix))
+   {
+      std::string pfx = ( prefix ? prefix : "" );
+      std::string key = "apply_color_palette_flag";
+      ossimString value;
+      
+      value.string() = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         theApplyColorPaletteFlag = value.toBool();
+      }
+      else
+      {
+         theApplyColorPaletteFlag = true;
+      }
+
+      key = ossimKeywordNames::BANDS_KW;
+      value.string() = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         ossim::toSimpleVector( theOutputBandList, value );
+      }
+      
+      if ( open() ) 
+      {
+         // Set the band list after open so that the overview also gets set.
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimTiffTileSource::open(const ossimFilename& image_file)
+{
+   if (theTiffPtr)
+   {
+     close();
+   }
+   theImageFile = image_file;
+   return open();
+}
+
+void ossimTiffTileSource::close()
+{
+   // std::cout << "ossimTiffTileSource::close()\n";
+
+   if(theTiffPtr)
+   {
+      XTIFFClose(theTiffPtr);
+      theTiffPtr = 0;
+   }
+   if(m_streamAdaptor)
+   {
+      m_streamAdaptor->close();
+      m_streamAdaptor.reset();
+   }
+
+   theImageWidth.clear();
+   theImageLength.clear();
+   theReadMethod.clear();
+   thePlanarConfig.clear();
+   thePhotometric.clear();
+   theRowsPerStrip.clear();
+   theImageTileWidth.clear();
+   theImageTileLength.clear();
+   if (theBuffer)
+   {
+      delete [] theBuffer;
+      theBuffer = 0;
+      theBufferSize = 0;
+   }
+   ossimImageHandler::close();
+}
+
+bool ossimTiffTileSource::open( std::shared_ptr<ossim::istream>& str,
+                                const std::string& connectionString )
+{
+   static const char MODULE[] = "ossimTiffTileSource::open";
+   if(isOpen())
+   {
+      close();
+   }
+
+   // std::cout << "NOW DOING THE STREAM OPEN!!!!!!!!!!!!!!!!" << (ossim_int64)this 
+   //           << " for file:" 
+   //           << connectionString << "\n";
+   
+   // Check for empty file name.
+   if ( connectionString.empty() )
+   {
+      return false;
+   }
+
+   theImageFile = ossimFilename(connectionString);
+   theImageDirectoryList.clear();
+
+   //---
+   // Note:  The 'm' in "rm" is to tell TIFFOpen to not memory map the file.
+   //---
+   //theTiffPtr = XTIFFOpen(theImageFile.c_str(), "rm");
+   //m_streamAdaptor = std::make_shared<TiffStreamAdaptor>(this);
+   m_streamAdaptor = std::make_shared<TiffStreamAdaptor>(this, str);
+
+   theTiffPtr = XTIFFClientOpen(connectionString.c_str(), "rm", 
+                                (thandle_t)m_streamAdaptor.get(),
+                                tiff_Read, tiff_Write, tiff_Seek, tiff_Close, tiff_Size,
+                                tiff_Map, tiff_Unmap);
+
+// std::cout << "TIFF PTR ????????????" << theTiffPtr << std::endl;
+   if (!theTiffPtr)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << "libtiff could not open..." << std::endl;
+      }
+      return false;
+   }
+
+   theCompressionType = COMPRESSION_NONE;
+   //***
+   // Get the general tiff info.
+   //***
+   if(!TIFFGetField(theTiffPtr, TIFFTAG_COMPRESSION, &theCompressionType))
+   {
+      theCompressionType = COMPRESSION_NONE;
+   }
+
+   //***
+   // See if the first directory is of FILETYPE_REDUCEDIMAGE; if not,
+   // the first level is considered to be full resolution data.
+   // Note:  If the tag is not present, consider the first level full
+   // resolution.
+   //***
+   theImageDirectoryList.push_back(0);
+   ossim_uint32 sub_file_type;
+   if ( !TIFFGetField( theTiffPtr,
+                       TIFFTAG_SUBFILETYPE ,
+                       &sub_file_type ) )
+   {
+      sub_file_type = 0;
+   }
+
+   if (sub_file_type == FILETYPE_REDUCEDIMAGE)
+   {
+      theR0isFullRes = false;
+   }
+   else
+   {
+      theR0isFullRes = true;
+   }
+   
+   if( !TIFFGetField(theTiffPtr, TIFFTAG_BITSPERSAMPLE, &(theBitsPerSample)) )
+   {
+      theBitsPerSample = 8;
+   }
+
+   if( !TIFFGetField(theTiffPtr,
+                     TIFFTAG_SAMPLESPERPIXEL,
+                     &theSamplesPerPixel ) )
+   {
+      theSamplesPerPixel = 1;
+   }
+   
+   if ( !TIFFGetField( theTiffPtr,
+                       TIFFTAG_SAMPLEFORMAT,
+                       &theSampleFormatUnit ) )
+   {
+      theSampleFormatUnit = 0;
+   }
+
+   if ( theSampleFormatUnit == SAMPLEFORMAT_COMPLEXINT )
+   {
+      //---
+      // Override the samples per pixel set above as sample data has set to
+      // one.
+      //---
+      theSamplesPerPixel = 2;
+   }
+
+   if ( !TIFFGetField( theTiffPtr,
+                       TIFFTAG_SMAXSAMPLEVALUE,
+                       &theMaxSampleValue ) )
+   {
+      uint16 maxValue = 0;
+      if(!TIFFGetField( theTiffPtr,
+                        TIFFTAG_MAXSAMPLEVALUE,
+                        &maxValue))
+      {
+         //---
+         // This will be reset in validateMinMax method.  Can't set right now because we
+         // don't know the scalar type yet.
+         //---
+         theMaxSampleValue = ossim::nan();
+      }
+      else
+      {
+         theMaxSampleValue = maxValue;
+      }
+   }
+   if ( !TIFFGetField( theTiffPtr,
+                       TIFFTAG_SMINSAMPLEVALUE,
+                       &theMinSampleValue ) )
+   {
+      uint16 minValue = 0;
+      if(!TIFFGetField( theTiffPtr,
+                        TIFFTAG_MINSAMPLEVALUE,
+                        &minValue))
+      {
+         //---
+         // This will be reset in validateMinMax method.  Can't set right now because we
+         // don't know the scalar type yet.
+         //--- 
+         theMinSampleValue = ossim::nan();
+      }
+      else
+      {
+         theMinSampleValue = minValue;
+      }
+   }
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\ntheMinSampleValue:  " << theMinSampleValue
+           << "\ntheMaxSampleValue:  " << theMaxSampleValue
+           << endl;
+   }
+
+   // Get the number of directories.
+   theNumberOfDirectories = TIFFNumberOfDirectories(theTiffPtr);
+
+   // Current dir.
+   theCurrentDirectory = TIFFCurrentDirectory(theTiffPtr);
+
+   theImageWidth.resize(theNumberOfDirectories);
+   theImageLength.resize(theNumberOfDirectories);
+   theReadMethod.resize(theNumberOfDirectories);
+   thePlanarConfig.resize(theNumberOfDirectories);
+   thePhotometric.resize(theNumberOfDirectories);
+   theRowsPerStrip.resize(theNumberOfDirectories);
+   theImageTileWidth.resize(theNumberOfDirectories);
+   theImageTileLength.resize(theNumberOfDirectories);
+
+   for (ossim_uint32 dir=0; dir<theNumberOfDirectories; ++dir)
+   {
+      if (setTiffDirectory(dir) == false)
+      {
+         return false;
+      }
+
+      // Note: Need lines, samples before acceptAsRrdsLayer check.
+      
+      // lines:
+      if ( !TIFFGetField( theTiffPtr,
+                          TIFFTAG_IMAGELENGTH,
+                          &theImageLength[dir] ) )
+      {
+         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " Cannot determine image length."
+            << endl;
+      }
+
+      // samples:
+      if ( !TIFFGetField( theTiffPtr,
+                          TIFFTAG_IMAGEWIDTH,
+                          &theImageWidth[dir] ) )
+      {
+         theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " Cannot determine image width."
+            << endl;
+      }
+      
+      if ( !TIFFGetField( theTiffPtr,
+                         TIFFTAG_SUBFILETYPE ,
+                         &sub_file_type ) )
+      {
+         sub_file_type = 0;
+      }
+
+      if (sub_file_type == FILETYPE_REDUCEDIMAGE)
+      {
+         //---
+         // Check for a thumbnail image.  If present don't use as it will mess with
+         // overviews.  Currently only checking if it's a two directory image, i.e. a full
+         // res and a thumbnail.
+         // 
+         // Note this shuts off the thumbnail which someone may want to see.  We could make
+         // this a reader prop if it becomes an issue. drb - 09 Jan. 2012.
+         //---
+         if ( dir!=0 )
+         {
+            bool acceptAsRrdsLayer = true;
+            if ( ( theNumberOfDirectories == 2 ) && ( dir == 1 ) )
+            {
+               acceptAsRrdsLayer = isPowerOfTwoDecimation(dir);
+            }
+
+            if ( acceptAsRrdsLayer )
+            {
+               theImageDirectoryList.push_back(dir);
+            }
+         }
+      }
+      
+      if( !TIFFGetField( theTiffPtr, TIFFTAG_PLANARCONFIG,
+                         &(thePlanarConfig[dir]) ) )
+      {
+         thePlanarConfig[dir] = PLANARCONFIG_CONTIG;
+      }
+      
+      if( !TIFFGetField( theTiffPtr, TIFFTAG_PHOTOMETRIC,
+                         &(thePhotometric[dir]) ) )
+      {
+         thePhotometric[dir] = PHOTOMETRIC_MINISBLACK;
+      }
+      theLut = 0;
+      // Check for palette.
+      uint16* red;
+      uint16* green;
+      uint16* blue;
+      if(TIFFGetField(theTiffPtr, TIFFTAG_COLORMAP, &red, &green, &blue))
+      {
+         if(theApplyColorPaletteFlag)
+         {
+            thePhotometric[dir] = PHOTOMETRIC_PALETTE;
+            theSamplesPerPixel = 3;
+         }
+         populateLut();
+      }
+
+      if( TIFFIsTiled(theTiffPtr))
+      {
+         theRowsPerStrip[dir] = 0;
+         if ( !TIFFGetField( theTiffPtr,
+                             TIFFTAG_TILEWIDTH,
+                             &theImageTileWidth[dir] ) )
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimTiffTileSource::getTiffTileWidth ERROR:"
+               << "\nCannot determine tile width." << endl;
+            theImageTileWidth[dir] = 0;
+         }
+         if ( !TIFFGetField( theTiffPtr,
+                             TIFFTAG_TILELENGTH,
+                             &theImageTileLength[dir] ) )
+         {
+            theErrorStatus = ossimErrorCodes::OSSIM_ERROR;   
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimTiffTileSource::getTiffTileLength ERROR:"
+               << "\nCannot determine tile length." << endl;
+             theImageTileLength[dir] = 0;
+         }
+      }
+      else
+      {
+         // Strip tiff:
+         theImageTileWidth[dir]  = 0;
+         theImageTileLength[dir] = 0;
+         if( !TIFFGetField( theTiffPtr, TIFFTAG_ROWSPERSTRIP,
+                            &(theRowsPerStrip[dir]) ) )
+         {
+            theRowsPerStrip[dir] = 1;
+         }
+         
+         theImageTileWidth[dir]  = theImageWidth[dir];
+         theImageTileLength[dir] = theRowsPerStrip[dir];
+
+         //---
+         // Let's default the tile size to something efficient.
+         //
+         // NOTE:
+         //
+         // This is not used by the strip reader method.  Only by the getImageTileHeight
+         // and getImageTileHeight methods.
+         //---
+         if ( theImageTileWidth[dir] > 256 )
+         {
+            theImageTileWidth[dir] = 256;
+         }
+         else if( theImageTileWidth[dir] < 64 )
+         {
+            theImageTileWidth[dir]  = 64;
+         }
+         if( theImageTileLength[dir] > 256 )
+         {
+            theImageTileLength[dir] = 256;
+         }
+         else if(theImageTileLength[dir] < 64)
+         {
+            theImageTileLength[dir] = 64;
+         }
+      }
+      
+   } // End of "for (ossim_uint32 dir=0; dir<theNumberOfDirectories; dir++)"
+   
+   // Reset the directory back to "0".
+   if (setTiffDirectory(0) == false)
+   {
+      return false;
+   }
+
+   //---
+   // Get the scalar type.
+   //---
+   theScalarType = OSSIM_SCALAR_UNKNOWN;
+   if (theBitsPerSample == 16)
+   {
+      theBytesPerPixel = 2;
+
+      if (theSampleFormatUnit == SAMPLEFORMAT_INT)
+      {
+         // this is currently causing pixel problems.  I am going to comment this out until we figure out a better solution
+         //
+#if 0         
+         if (theMinSampleValue == 0) //  && (theMaxSampleValue > 36535) )
+         {
+            //---
+            // This is a hack for RadarSat data which is has tag 339 set to
+            // signed sixteen bit data with a min sample value of 0 and
+            // sometimes a max sample value greater than 36535.
+            //---
+            theScalarType = OSSIM_UINT16;
+         }
+         else
+         {
+            theScalarType = OSSIM_SINT16;
+         }
+#else
+         theScalarType = OSSIM_SINT16;
+#endif
+
+      }
+      else if (theSampleFormatUnit == SAMPLEFORMAT_UINT)
+      {
+         // ESH 03/2009 -- Changed "== 2047" to "<= 2047"
+         if (theMaxSampleValue <= 2047) // 2^11-1
+         {
+            // 11 bit EO, i.e. Ikonos, QuickBird, WorldView, GeoEye.
+            theScalarType = OSSIM_USHORT11; // IKONOS probably...
+         }
+         else if (theMaxSampleValue <= 4095) // 2^12-1
+         {
+            theScalarType = OSSIM_USHORT12; 
+         }
+         else if (theMaxSampleValue <= 8191) // 2^13-1
+         {
+            theScalarType = OSSIM_USHORT13;
+         }
+         else if (theMaxSampleValue <= 16383) // 2^14-1
+         {
+            theScalarType = OSSIM_USHORT14;
+         }
+         else if (theMaxSampleValue <= 32767) // 2^15-1
+         {
+            theScalarType = OSSIM_USHORT15;
+         }
+         else
+         {
+            theScalarType = OSSIM_UINT16; 
+         }
+      }
+      else
+      {
+         if (theMaxSampleValue <= 2047) // 2^11-1
+         {
+            // 11 bit EO, i.e. Ikonos, QuickBird, WorldView, GeoEye.
+            theScalarType = OSSIM_USHORT11; // IKONOS probably...
+         }
+         else if (theMaxSampleValue <= 4095) // 2^12-1
+         {
+            theScalarType = OSSIM_USHORT12; 
+         }
+         else if (theMaxSampleValue <= 8191) // 2^13-1
+         {
+            theScalarType = OSSIM_USHORT13;
+         }
+         else if (theMaxSampleValue <= 16383) // 2^14-1
+         {
+            theScalarType = OSSIM_USHORT14;
+         }
+         else if (theMaxSampleValue <= 32767) // 2^15-1
+         {
+            theScalarType = OSSIM_USHORT15;
+         }
+         else
+            theScalarType = OSSIM_UINT16; // Default to unsigned...
+      }
+   }
+   else if ( (theBitsPerSample == 32) &&
+             (theSampleFormatUnit == SAMPLEFORMAT_UINT) )
+   {
+      theBytesPerPixel = 4;
+      theScalarType = OSSIM_UINT32;
+   }
+   else if ( (theBitsPerSample == 32) &&
+             (theSampleFormatUnit == SAMPLEFORMAT_INT) )
+   {
+      theBytesPerPixel = 4;
+      theScalarType = OSSIM_SINT32;
+   }
+   else if ( (theBitsPerSample == 32) &&
+             (theSampleFormatUnit == SAMPLEFORMAT_IEEEFP) )
+   {
+      theBytesPerPixel = 4;
+      theScalarType = OSSIM_FLOAT32;
+   }
+   else if ( (theBitsPerSample == 32) &&
+             (theSampleFormatUnit == SAMPLEFORMAT_COMPLEXINT) )
+   {
+      theBytesPerPixel = 2;
+      theScalarType = OSSIM_SINT16;
+   }
+   else if(theBitsPerSample == 64 &&
+      theSampleFormatUnit == SAMPLEFORMAT_IEEEFP)
+   {
+      theBytesPerPixel = 8;
+      theScalarType = OSSIM_FLOAT64;
+   }
+   else if (theBitsPerSample <= 8)
+   {
+      theBytesPerPixel = 1;
+      theScalarType = OSSIM_UINT8;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " Error:\nCannot determine scalar type.\n"
+         << "Trace dump follows:\n";
+      print(ossimNotify(ossimNotifyLevel_WARN));
+      
+      return false;
+   }
+   
+   // Sanity check for min, max and null values.
+   validateMinMaxNull();
+   
+   setReadMethod();
+   
+   // std::cout << "DOING GTIFF ALLOCATE\n";
+   // Establish raster pixel alignment type:
+   GTIF* gtif = GTIFNew(theTiffPtr);
+   // std::cout << "ALLOCATED!!!!!\n";
+   ossim_uint16 raster_type;
+   if (GTIFKeyGet(gtif, GTRasterTypeGeoKey, &raster_type, 0, 1) && (raster_type == 1))
+   {
+      thePixelType = OSSIM_PIXEL_IS_AREA;
+   }
+   else
+   {
+      thePixelType = OSSIM_PIXEL_IS_POINT;
+   }
+
+   GTIFFree(gtif);
+// std::cout << "DOING COMPLETE OPEN!!!!!!!!!!!!\n";
+   // Let base-class finish the rest:
+   completeOpen();
+
+   if ( isBandSelector() && theOutputBandList.size() && ( isIdentityBandList( theOutputBandList ) == false ) )
+   {
+      // This does range checking and will pass to overview if open.
+      setOutputBandList( theOutputBandList );
+   }
+   
+   //---
+   // Note: Logic changed to leave theTile and theBuffer uninitialized until first getTile(...)
+   // request. (drb)
+   //---
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " Debug:";
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+ // std::cout << "DONE DOING COMPLETE OPEN!!!!!!!!!!!!\n";
+  
+   // Finished...
+   return true;
+
+}
+
+bool ossimTiffTileSource::open()
+{
+   static const char MODULE[] = "ossimTiffTileSource::open";
+   bool result = false;
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " Entered..."
+         << "\nFile:  " << theImageFile.c_str() << std::endl;
+   }
+   std::shared_ptr<std::istream> tiffStream = ossim::StreamFactoryRegistry::instance()->createIstream(theImageFile);
+
+   if(tiffStream)
+   {
+      result = open(tiffStream, theImageFile);
+   }
+
+   return result;
+
+}
+   
+ossim_uint32 ossimTiffTileSource::getNumberOfLines( ossim_uint32 resLevel ) const
+{
+   ossim_uint32 result = 0;
+   if ( theImageDirectoryList.size() && theTiffPtr && isValidRLevel(resLevel) )
+   {
+      //---
+      // If we have r0 our reslevels are the same as the callers so
+      // no adjustment necessary.
+      //---
+      if (!theStartingResLevel || theR0isFullRes) // not an overview or has r0.
+      {
+         //---
+         // If we have r0 our reslevels are the same as the callers so
+         // no adjustment necessary.
+         //---
+         if (resLevel < theImageDirectoryList.size())
+         {
+            result = theImageLength[theImageDirectoryList[resLevel]];
+         }
+         else if (theOverview.valid())
+         {
+            result = theOverview->getNumberOfLines(resLevel);
+         }
+      }
+      else // this is an overview without r0
+      {
+         if (resLevel >= theStartingResLevel)
+         {
+            //---
+            // Adjust the level to be relative to the reader using this as
+            // overview.
+            //---
+            ossim_uint32 level = resLevel - theStartingResLevel;
+            if (level < theImageDirectoryList.size())
+            {
+               result = theImageLength[theImageDirectoryList[level]];
+            }
+         }
+      }
+   }
+   return result;
+}
+
+ossim_uint32 ossimTiffTileSource::getNumberOfSamples( ossim_uint32 resLevel ) const
+{
+   ossim_uint32 result = 0;
+   if ( theImageDirectoryList.size() && theTiffPtr && isValidRLevel(resLevel) )
+   {
+      //---
+      // If we have r0 our reslevels are the same as the callers so
+      // no adjustment necessary.
+      //---
+      if (!theStartingResLevel||theR0isFullRes) // not an overview or has r0.
+      {
+         if (resLevel < theImageDirectoryList.size())
+         {
+            result = theImageWidth[theImageDirectoryList[resLevel]];
+         }
+         else if (theOverview.valid())
+         {
+            result = theOverview->getNumberOfSamples(resLevel);
+         }
+      }
+      else // this is an overview.
+      {
+         if (resLevel >= theStartingResLevel)
+         {
+            //---
+            // Adjust the level to be relative to the reader using this as
+            // overview.
+            //---
+            ossim_uint32 level = resLevel - theStartingResLevel;
+            if (level < theImageDirectoryList.size())
+            {
+               result = theImageWidth[theImageDirectoryList[level]];
+            }
+         }
+      }
+   }
+   return result;
+}
+
+ossim_uint32 ossimTiffTileSource::getNumberOfDecimationLevels() const
+{
+   ossim_uint32 result = theImageDirectoryList.size();
+   
+   // If starting res level is not 0 then this is an overview.
+   if (theStartingResLevel&&theR0isFullRes)
+   {
+      // Don't count r0.
+      --result;
+   }
+   else if (theOverview.valid())
+   {
+      result += theOverview->getNumberOfDecimationLevels();
+   }
+
+   return result;
+}
+
+//*******************************************************************
+// Public method:
+//*******************************************************************
+ossimScalarType ossimTiffTileSource::getOutputScalarType() const
+{
+   return theScalarType;
+}
+
+bool ossimTiffTileSource::loadTile(const ossimIrect& tile_rect,
+                                   const ossimIrect& clip_rect,
+                                   ossimImageData* result)
+{
+   static const char MODULE[] = "ossimTiffTileSource::loadTile";
+
+   bool status = true;
+
+   if ( !theBuffer )
+   {
+      status = allocateBuffer();
+   }
+
+   if ( status )
+   {
+      switch(theReadMethod[theCurrentDirectory])
+      {
+         case READ_TILE:
+            status = loadFromTile(clip_rect, result);
+            break;
+            
+         case READ_SCAN_LINE:
+            status = loadFromScanLine(clip_rect, result);
+            break;
+            
+         case READ_RGBA_U8_TILE:
+            status = loadFromRgbaU8Tile(tile_rect, clip_rect, result);
+            break;
+            
+         case READ_RGBA_U8_STRIP:
+            status = loadFromRgbaU8Strip(tile_rect, clip_rect, result);
+            break;
+            
+         case READ_RGBA_U8A_STRIP:
+            status = loadFromRgbaU8aStrip(tile_rect, clip_rect, result);
+            break;
+
+         case READ_U16_STRIP:
+            status = loadFromU16Strip(clip_rect, result);
+            break;
+            
+         default:
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " Unsupported tiff type!" << endl;
+            status = false;
+            break;
+      }
+   }
+   
+   return status;
+}
+
+bool ossimTiffTileSource::loadFromScanLine(const ossimIrect& clip_rect,
+                                           ossimImageData* result)
+{
+#if OSSIM_BUFFER_SCAN_LINE_READS
+   ossimInterleaveType type =
+      (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG) ?
+       OSSIM_BIP : OSSIM_BIL;
+
+   if ( theBufferRLevel != getCurrentTiffRLevel() ||
+        !clip_rect.completely_within(theBufferRect) )
+   {
+      //***
+      // Must reload the buffer.  Grab enough lines to fill the depth of the
+      // clip rectangle.
+      //***
+      theBufferRLevel = getCurrentTiffRLevel();
+      theBufferRect   = getImageRectangle(theBufferRLevel);
+      theBufferRect.set_uly(clip_rect.ul().y);
+      theBufferRect.set_lry(clip_rect.lr().y);
+      ossim_uint32 startLine = clip_rect.ul().y;
+      ossim_uint32 stopLine  = clip_rect.lr().y;
+      ossim_uint8* buf = theBuffer;
+
+      if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
+      {
+         ossim_uint32 lineSizeInBytes = getNumberOfSamples(theBufferRLevel) *
+                                  theBytesPerPixel * theSamplesPerPixel;
+
+         for (ossim_uint32 line = startLine; line <= stopLine; ++line)
+         {
+            TIFFReadScanline(theTiffPtr, (void*)buf, line, 0);
+            buf += lineSizeInBytes;
+         }
+      }
+      else
+      {
+         ossim_uint32 lineSizeInBytes = getNumberOfSamples(theBufferRLevel) *
+                                  theBytesPerPixel;
+
+         for (ossim_uint32 line = startLine; line <= stopLine; ++line)
+         {
+            for (ossim_uint32 band = 0; band < theSamplesPerPixel; ++band)
+            {
+               TIFFReadScanline(theTiffPtr, (void*)buf, line, band);
+               buf += lineSizeInBytes;
+            }
+         }
+      }
+   }
+
+   //---
+   // Since theTile's internal rectangle is relative to any sub image offset
+   // we must adjust both the zero based "theBufferRect" and the zero base
+   // "clip_rect" before passing to
+   // theTile->loadTile method.
+   //---
+   result->loadTile(theBuffer, theBufferRect, clip_rect, type);
+   return true;
+
+#else
+   ossimInterleaveType type =
+      (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG) ? OSSIM_BIP : OSSIM_BIL;
+
+   ossim_int32 startLine = clip_rect.ul().y;
+   ossim_int32 stopLine  = clip_rect.lr().y;
+   ossim_int32 stopSamp  = static_cast<ossim_int32>(getNumberOfSamples(theBufferRLevel)-1);
+   
+   if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
+   {
+      for (ossim_int32 line = startLine; line <= stopLine; ++line)
+      {
+         TIFFReadScanline(theTiffPtr, (void*)theBuffer, line, 0);
+         result->copyLine((void*)theBuffer, line, 0, stopSamp, type);
+      }
+   }
+   else
+   {
+      ossim_uint32 lineSizeInBytes = getNumberOfSamples(theBufferRLevel) * theBytesPerPixel;
+      for (ossim_int32 line = startLine; line <= stopLine; ++line)
+      {
+         ossim_uint8* buf = theBuffer;
+         for (ossim_uint32 band = 0; band < theSamplesPerPixel; ++band)
+         {
+            TIFFReadScanline(theTiffPtr, (void*)buf, line, band);
+            buf += lineSizeInBytes;
+         }
+         result->copyLine((void*)theBuffer, line, 0, stopSamp, type);
+      }
+   }
+   return true;
+#endif /* #if OSSIM_BUFFER_SCAN_LINE_READS #else - Non buffered scan line reads. */
+}
+
+bool ossimTiffTileSource::loadFromTile(const ossimIrect& clip_rect,
+                                       ossimImageData* result)
+{
+   static const char MODULE[] = "ossimTiffTileSource::loadFromTile";
+   
+   ossim_int32 tileSizeRead = 0;
+   
+   //---
+   // Shift the upper left corner of the "clip_rect" to the an even tile
+   // boundary.  Note this will shift in the upper left direction.
+   //---
+   ossimIpt tileOrigin = clip_rect.ul();
+   adjustToStartOfTile(tileOrigin);
+   ossimIpt ulTilePt       = tileOrigin;
+//   ossimIpt subImageOffset = getSubImageOffset(getCurrentTiffRLevel()+theStartingResLevel);
+
+   //---
+   // Calculate the number of tiles needed in the line/sample directions.
+   //---
+   ossim_uint32 tiles_in_v_dir = (clip_rect.lr().x-tileOrigin.x+1) /
+      theImageTileWidth[theCurrentDirectory];
+   ossim_uint32 tiles_in_u_dir = (clip_rect.lr().y-tileOrigin.y+1) /
+      theImageTileLength[theCurrentDirectory];
+
+   if ( (clip_rect.lr().x-tileOrigin.x+1) %
+        theImageTileWidth[theCurrentDirectory]  ) ++tiles_in_v_dir;
+   if ( (clip_rect.lr().y-tileOrigin.y+1) %
+        theImageTileLength[theCurrentDirectory] ) ++tiles_in_u_dir;
+
+
+   // Tile loop in line direction.
+   for (ossim_uint32 u=0; u<tiles_in_u_dir; ++u)
+   {
+      ulTilePt.x = tileOrigin.x;
+
+      // Tile loop in sample direction.
+      for (ossim_uint32 v=0; v<tiles_in_v_dir; ++v)
+      {
+         ossimIrect tiff_tile_rect(ulTilePt.x,
+                                   ulTilePt.y,
+                                   ulTilePt.x +
+                                   theImageTileWidth[theCurrentDirectory]  - 1,
+                                   ulTilePt.y +
+                                   theImageTileLength[theCurrentDirectory] - 1);
+         
+         if (tiff_tile_rect.intersects(clip_rect))
+         {
+            ossimIrect tiff_tile_clip_rect
+               = tiff_tile_rect.clipToRect(clip_rect);
+
+            //---
+            // Since theTile's internal rectangle is relative to any sub
+            // image offset we must adjust both the zero based
+            // "theBufferRect" and the zero based "clip_rect" before
+            // passing to theTile->loadTile method.
+            //---
+            ossimIrect bufRectWithOffset = tiff_tile_rect;// + subImageOffset;
+            ossimIrect clipRectWithOffset = tiff_tile_clip_rect;// + subImageOffset;
+            
+            if  (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
+            {
+               tileSizeRead = TIFFReadTile(theTiffPtr,
+                                           theBuffer,
+                                           ulTilePt.x,
+                                           ulTilePt.y,
+                                           0,
+                                           0);
+               if (tileSizeRead > 0)
+               {
+                  result->loadTile(theBuffer,
+                                  bufRectWithOffset,
+                                  clipRectWithOffset,
+                                  OSSIM_BIP);
+               }
+               else if(tileSizeRead < 0)
+               {
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << MODULE << " Read Error!"
+                        << "\nReturning error...  " << endl;
+                  }
+                  theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+                  return false;
+               }
+            }
+            else
+            {
+               if ( theOutputBandList.empty() )
+               {
+                  // This will set to identity.
+                  ossimImageSource::getOutputBandList( theOutputBandList );
+               }
+               
+               // band separate tiles...
+               std::vector<ossim_uint32>::const_iterator bandIter = theOutputBandList.begin();
+               ossim_uint32 destinationBand = 0;
+               while ( bandIter != theOutputBandList.end() )
+               {
+                  tileSizeRead = TIFFReadTile( theTiffPtr,
+                                               theBuffer,
+                                               ulTilePt.x,
+                                               ulTilePt.y,
+                                               0,
+                                               (*bandIter) );
+                  if(tileSizeRead > 0)
+                  {
+                     result->loadBand( theBuffer,
+                                       bufRectWithOffset,
+                                       clipRectWithOffset,
+                                       destinationBand );
+                  }
+                  else if (tileSizeRead < 0)
+                  {
+                     if(traceDebug())
+                     {
+                        ossimNotify(ossimNotifyLevel_WARN)
+                           << MODULE << " Read Error!"
+                           << "\nReturning error...  " << endl;
+                     }
+                     theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+                     return false;
+                  }
+                  ++bandIter; // Next band...
+                  ++destinationBand;
+               }
+            }
+
+         } // End of if (tiff_tile_rect.intersects(clip_rect))
+         
+         ulTilePt.x += theImageTileWidth[theCurrentDirectory];
+         
+      }  // End of tile loop in the sample direction.
+
+      ulTilePt.y += theImageTileLength[theCurrentDirectory];
+      
+   }  // End of tile loop in the line direction.
+
+   return true;
+}
+
+bool ossimTiffTileSource::loadFromRgbaU8Tile(const ossimIrect& tile_rect,
+                                             const ossimIrect& clip_rect,
+                                             ossimImageData* result)
+{
+   static const char MODULE[] = "ossimTiffTileSource::loadFromRgbaTile";
+
+   if (theSamplesPerPixel != 3 || theBytesPerPixel!=1)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " Error:"
+         << "\nInvalid number of bands or bytes per pixel!" << endl;
+   }
+   
+   //***
+   // Shift the upper left corner of the "clip_rect" to the an even tile
+   // boundary.  Note this will shift in the upper left direction.
+   //***
+   ossimIpt tileOrigin = clip_rect.ul();
+   adjustToStartOfTile(tileOrigin);
+
+   //---
+   // Calculate the number of tiles needed in the line/sample directions
+   // to fill the tile.
+   //---
+   ossim_uint32 tiles_in_v_dir = (clip_rect.lr().x-tileOrigin.x+1) /
+      theImageTileWidth[theCurrentDirectory];
+   ossim_uint32 tiles_in_u_dir = (clip_rect.lr().y-tileOrigin.y+1) /
+      theImageTileLength[theCurrentDirectory];
+
+   if ( (clip_rect.lr().x-tileOrigin.x+1) %
+        theImageTileWidth[theCurrentDirectory]  ) ++tiles_in_v_dir;
+   if ( (clip_rect.lr().y-tileOrigin.y+1) %
+        theImageTileLength[theCurrentDirectory] ) ++tiles_in_u_dir;
+   
+   ossimIpt ulTilePt = tileOrigin;
+
+#if 0
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\ntile_rect:  " << tile_rect
+           << "\nclip_rect:  " << clip_rect
+           << "\ntiles_in_v_dir:  " << tiles_in_v_dir
+           << "\ntiles_in_u_dir:  " << tiles_in_u_dir
+           << endl;
+   }
+#endif
+   
+   
+   // Tile loop in line direction.
+   for (ossim_uint32 u=0; u<tiles_in_u_dir; u++)
+   {
+      ulTilePt.x = tileOrigin.x;
+
+      // Tile loop in sample direction.
+      for (ossim_uint32 v=0; v<tiles_in_v_dir; v++)
+      {
+         ossimIrect tiff_tile_rect
+            = ossimIrect(ulTilePt.x,
+                         ulTilePt.y,
+                         ulTilePt.x +
+                         theImageTileWidth[theCurrentDirectory]  - 1,
+                         ulTilePt.y +
+                         theImageTileLength[theCurrentDirectory] - 1);
+
+         if ( getCurrentTiffRLevel() != theBufferRLevel ||
+              tiff_tile_rect != theBufferRect)
+         {
+            // Need to grab a new tile.
+            // Read a tile into the buffer.
+            if ( !TIFFReadRGBATile(theTiffPtr,
+                                   ulTilePt.x,
+                                   ulTilePt.y,
+                                   (uint32*)theBuffer) ) // use tiff typedef
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " Read Error!"
+                  << "\nReturning error..." << endl;
+               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+               return false;
+            }
+
+            // Capture the rectangle.
+            theBufferRect   = tiff_tile_rect;
+            theBufferRLevel = getCurrentTiffRLevel();
+         }
+
+         ossimIrect tile_clip_rect = clip_rect.clipToRect(theBufferRect);
+         
+         //***
+         // Get the offset to the first valid pixel.
+         // 
+         // Note: The data in the tile buffer is organized bottom up.  So the
+         //       coordinate must be negated in the line direction since
+         //       the met assumes an origin of upper left.
+         //***
+         ossim_uint32 in_buf_offset =
+              (tiff_tile_rect.lr().y-tile_clip_rect.ul().y)*
+              theImageTileWidth[theCurrentDirectory]*4 +
+              ((tile_clip_rect.ul().x - ulTilePt.x)*4);
+         
+         ossim_uint32 out_buf_offset =
+            (tile_clip_rect.ul().y - tile_rect.ul().y) *
+            ((ossim_int32)result->getWidth()) +
+            tile_clip_rect.ul().x - tile_rect.ul().x;
+         
+         //
+         // Get a pointer positioned at the first valid pixel in buffers.
+         //
+         ossim_uint32* s = (ossim_uint32*)(theBuffer + in_buf_offset);  // s for source...
+//         ossim_uint8* s = theBuffer + in_buf_offset;  // s for source...
+         ossim_uint8* r = static_cast<ossim_uint8*>(result->getBuf(0))+
+            out_buf_offset;
+         ossim_uint8* g = static_cast<ossim_uint8*>(result->getBuf(1))+
+            out_buf_offset;
+         ossim_uint8* b = static_cast<ossim_uint8*>(result->getBuf(2))+
+            out_buf_offset;
+         
+         ossim_uint32 lines2copy = tile_clip_rect.lr().y-tile_clip_rect.ul().y+1;
+         ossim_uint32 samps2copy = tile_clip_rect.lr().x-tile_clip_rect.ul().x+1;
+         
+         // Line loop through valid portion of the tiff tile.         
+         for (ossim_uint32 line = 0; line < lines2copy; line++)
+         {
+            // Sample loop through the tiff tile.
+            ossim_uint32 i=0;
+            ossim_uint32 j=0;
+            
+            // note the bands from the TIFF READ are stored in a, b, g, r ordering.
+            // we must reverse the bands and skip the first byte.
+            for (ossim_uint32 sample = 0; sample < samps2copy; sample++)
+            {
+               r[i] = (ossim_uint8)OSSIM_TIFF_UNPACK_R4(s[j]);
+               g[i] = (ossim_uint8)OSSIM_TIFF_UNPACK_G4(s[j]);
+               b[i] = (ossim_uint8)OSSIM_TIFF_UNPACK_B4(s[j]);
+               i++;
+               ++j;
+            }
+            
+            // Increment the pointers by one line.
+            const ossim_uint32 OUTPUT_TILE_WIDTH = result->getWidth();
+            r += OUTPUT_TILE_WIDTH;
+            g += OUTPUT_TILE_WIDTH;
+            b += OUTPUT_TILE_WIDTH;
+            s -= theImageTileWidth[theCurrentDirectory];
+         }
+      
+         ulTilePt.x += theImageTileWidth[theCurrentDirectory];
+      
+      }  // End of tile loop in the sample direction.
+      
+      ulTilePt.y += theImageTileLength[theCurrentDirectory];
+      
+   }  // End of tile loop in the line direction.
+   
+   return true;
+}
+
+bool ossimTiffTileSource::loadFromRgbaU8Strip(const ossimIrect& tile_rect,
+                                              const ossimIrect& clip_rect,
+                                              ossimImageData* result)
+{
+   static const char MODULE[] = "ossimTiffTileSource::loadFromRgbaU8Strip";
+
+   if (theSamplesPerPixel > 4 || theBytesPerPixel != 1)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " Error:"
+         << "\nInvalid number of bands or bytes per pixel!" << endl;
+   }
+   
+   //***
+   // Calculate the number of strips to read.
+   //***
+   const ossim_uint32 OUTPUT_TILE_WIDTH = result->getWidth();
+
+   ossim_uint32 starting_strip = clip_rect.ul().y /
+      theRowsPerStrip[theCurrentDirectory];
+   ossim_uint32 ending_strip   = clip_rect.lr().y /
+      theRowsPerStrip[theCurrentDirectory];
+   ossim_uint32 strip_width    = theImageWidth[theCurrentDirectory]*4;   
+   ossim_uint32 output_tile_offset = (clip_rect.ul().y - tile_rect.ul().y) *
+                                OUTPUT_TILE_WIDTH + clip_rect.ul().x -
+                                tile_rect.ul().x;
+
+#if 0 /* Please keep for debug: */
+   CLOG << "DEBUG:"
+        << "\nsamples:         " << theSamplesPerPixel
+        << "\ntile_rect:       " << tile_rect
+        << "\nclip_rect:       " << clip_rect
+        << "\nstarting_strip:  " << starting_strip
+        << "\nending_strip:    " << ending_strip
+        << "\nstrip_width:     " << strip_width
+        << "\noutput_tile_offset:  " << output_tile_offset
+        << endl;
+#endif
+   
+   //***
+   // Get the pointers positioned at the first valid pixel in the buffers.
+   // s = source
+   // d = destination
+   //***
+   ossim_uint32 band;
+
+   ossim_uint8** d = new ossim_uint8*[theSamplesPerPixel];
+   for (band = 0; band < theSamplesPerPixel; band++)
+   {
+      d[band] = static_cast<ossim_uint8*>(result->getBuf(band))+output_tile_offset;
+   }
+
+   // Loop through strips...
+   for (ossim_uint32 strip=starting_strip; strip<=ending_strip; strip++)
+   {
+      if ( (theBufferRLevel != theCurrentDirectory) ||
+           ( clip_rect.completely_within( theBufferRect ) == false ) )
+      {
+         if (TIFFReadRGBAStrip(theTiffPtr,
+                               (strip*theRowsPerStrip[theCurrentDirectory]),
+                               (uint32*)theBuffer) == 0) // use tiff typedef
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " Error reading strip!" <<endl;
+            delete [] d;
+            return false;
+         }
+
+         // Capture rect and rlevel of buffer:
+         theBufferRLevel = theCurrentDirectory;
+         theBufferRect = ossimIrect(
+            0,
+            starting_strip,
+            theImageWidth[theCurrentDirectory]-1,
+            (ending_strip-starting_strip) ? (ending_strip-starting_strip) *
+            theRowsPerStrip[theCurrentDirectory] - 1 :
+            theRowsPerStrip[theCurrentDirectory] - 1 );
+      }
+      
+      //***
+      // If the last strip is a partial strip then the first line of the
+      // strip will be the last line of the image.
+      //***
+      ossim_uint32 last_line = theImageLength[theCurrentDirectory] - 1;
+
+      ossim_uint32 strip_offset
+         = ((strip * theRowsPerStrip[theCurrentDirectory]) +
+            theRowsPerStrip[theCurrentDirectory] - 1) <
+         last_line ?  0 :
+         ((strip * theRowsPerStrip[theCurrentDirectory]) +
+          theRowsPerStrip[theCurrentDirectory] - 1) - last_line;
+
+      ossim_uint32 total_rows = theRowsPerStrip[theCurrentDirectory] -
+         strip_offset;
+      
+      for (ossim_uint32 row=0; row<total_rows; row++)
+      {
+         // Write the line if it's in the clip rectangle.
+         ossim_int32 current_line = strip * theRowsPerStrip[theCurrentDirectory]
+            + row;
+         if  (current_line >= clip_rect.ul().y &&
+              current_line <= clip_rect.lr().y)
+         {
+            //
+            // Position the stip pointer to the correct spot.
+            // 
+            // Note:
+            // A strip is organized from bottom to top and the raster buffer is
+            // orgainized from top to bottom so the lineBuf must be offset
+            // accordingly.
+            //
+            ossim_uint32* s = (ossim_uint32*)(theBuffer+ ((theRowsPerStrip[theCurrentDirectory] - row -
+                                                           strip_offset - 1) * strip_width + clip_rect.ul().x * 4));
+            
+            // Copy the data to the output buffer.
+            ossim_uint32 i=0;
+                                                 
+            for (int32 sample=clip_rect.ul().x;
+                 sample<=clip_rect.lr().x;
+                 sample++)
+            {
+               d[0][i] = OSSIM_TIFF_UNPACK_R4(*s);
+               d[1][i] = OSSIM_TIFF_UNPACK_G4(*s);
+               d[2][i] = OSSIM_TIFF_UNPACK_B4(*s);
+               ++i;
+               ++s;
+            }
+
+            for (band = 0; band < theSamplesPerPixel; band++)
+            {
+               d[band] += OUTPUT_TILE_WIDTH;
+            }
+         }
+      }  // End of loop through rows in a strip.
+
+   }  // End of loop through strips.
+
+   delete [] d;
+               
+   return true;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+bool ossimTiffTileSource::loadFromRgbaU8aStrip(const ossimIrect& tile_rect,
+                                               const ossimIrect& clip_rect,
+                                               ossimImageData* result)
+{
+   static const char MODULE[] = "ossimTiffTileSource::loadFromRgbaU8aStrip";
+
+   //***
+   // Specialized for one bit data to handle null values.
+   //***
+   const ossim_uint32 OUTPUT_TILE_WIDTH = result->getWidth();
+   const ossim_uint8 NULL_PIX = static_cast<ossim_uint8>(result->getNullPix(0));
+   const ossim_uint8 MIN_PIX  = static_cast<ossim_uint8>(result->getMinPix(0));
+
+   if (theSamplesPerPixel > 4 || theBytesPerPixel!= 1)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " Error:"
+         << "\nInvalid number of bands or bytes per pixel!" << endl;
+   }
+   
+   //***
+   // Calculate the number of strips to read.
+   //***
+   ossim_uint32 starting_strip = clip_rect.ul().y /
+        theRowsPerStrip[theCurrentDirectory];
+   ossim_uint32 ending_strip   = clip_rect.lr().y /
+      theRowsPerStrip[theCurrentDirectory];
+   ossim_uint32 output_tile_offset = (clip_rect.ul().y - tile_rect.ul().y) *
+                                OUTPUT_TILE_WIDTH + clip_rect.ul().x -
+                                tile_rect.ul().x;
+
+#if 0
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\ntile_rect:       " << tile_rect
+           << "\nclip_rect:       " << clip_rect
+           << "\nstarting_strip:  " << starting_strip
+           << "\nending_strip:    " << ending_strip
+           << "\nstrip_width:     " << strip_width
+           << "\noutput_tile_offset:     " << output_tile_offset
+           << "\nsamples:         " << theSamplesPerPixel
+           << endl;
+   }
+#endif
+   
+   //***
+   // Get the pointers positioned at the first valid pixel in the buffers.
+   // s = source
+   // d = destination
+   //***
+   ossim_uint32 band;
+
+   ossim_uint8** d = new ossim_uint8*[theSamplesPerPixel];
+   for (band = 0; band < theSamplesPerPixel; band++)
+   {
+      d[band] = static_cast<ossim_uint8*>(result->getBuf(band))+output_tile_offset;
+   }
+
+   // Loop through strips...
+   for (ossim_uint32 strip=starting_strip; strip<=ending_strip; strip++)
+   {
+      if (TIFFReadRGBAStrip(theTiffPtr,
+                            (strip*theRowsPerStrip[theCurrentDirectory]),
+                            (uint32*)theBuffer) == 0) // use tiff typedef
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " Error reading strip!" <<endl;
+         delete [] d;
+         return false;
+      }
+
+      //***
+      // If the last strip is a partial strip then the first line of the
+      // strip will be the last line of the image.
+      //***
+      ossim_uint32 last_line = theImageLength[theCurrentDirectory] - 1;
+
+      ossim_uint32 strip_offset
+         = ((strip * theRowsPerStrip[theCurrentDirectory]) +
+            theRowsPerStrip[theCurrentDirectory] - 1) < last_line ?  0 :
+         ((strip * theRowsPerStrip[theCurrentDirectory]) +
+          theRowsPerStrip[theCurrentDirectory] - 1) - last_line;
+
+      ossim_uint32 total_rows = theRowsPerStrip[theCurrentDirectory] -
+         strip_offset;
+      
+      for (ossim_uint32 row=0; row<total_rows; row++)
+      {
+         // Write the line if it's in the clip rectangle.
+         ossim_int32 current_line = strip * theRowsPerStrip[theCurrentDirectory]
+            + row;
+         if  (current_line >= clip_rect.ul().y &&
+              current_line <= clip_rect.lr().y)
+         {
+            //***
+            // Position the stip pointer to the correct spot.
+            // 
+            // Note:
+            // A strip is organized from bottom to top and the raster buffer is
+            // orgainized from top to bottom so the lineBuf must be offset
+            // accordingly.
+            //***
+            ossim_uint8* s = theBuffer;
+            s += (theRowsPerStrip[theCurrentDirectory] - row -
+                  strip_offset - 1) *
+                 theImageWidth[theCurrentDirectory] * 4 +
+                 clip_rect.ul().x * 4;
+            
+            // Copy the data to the output buffer.
+            ossim_uint32 i=0;
+            ossim_uint32 j=0;
+            for (int32 sample=clip_rect.ul().x;
+                 sample<=clip_rect.lr().x;
+                 sample++)
+            {
+               for (band = 0; band < theSamplesPerPixel; band++)
+               {
+                  ossim_uint8 pix = s[j + band];
+                  d[band][i] = pix != NULL_PIX ? pix : MIN_PIX;
+               }
+               ++i;
+               j += 4;
+            }
+
+            for (band = 0; band < theSamplesPerPixel; band++)
+            {
+               d[band] += OUTPUT_TILE_WIDTH;
+            }
+         }
+      }  // End of loop through rows in a strip.
+
+   }  // End of loop through strips.
+
+   delete [] d;
+               
+   return true;
+   
+} // End: ossimTiffTileSource::loadFromRgbaU8aStrip( ... )
+
+bool ossimTiffTileSource::loadFromU16Strip( const ossimIrect& clip_rect, ossimImageData* result )
+{
+   bool status = true;
+   
+   // Calculate the strips to read.
+   ossim_uint32 starting_strip = clip_rect.ul().y / theRowsPerStrip[theCurrentDirectory];
+   ossim_uint32 ending_strip   = clip_rect.lr().y / theRowsPerStrip[theCurrentDirectory];
+
+   ossim_uint32 stripsPerBand = theImageLength[theCurrentDirectory] /
+      theRowsPerStrip[theCurrentDirectory];
+   if ( theImageLength[theCurrentDirectory] % theRowsPerStrip[theCurrentDirectory] )
+   {
+      ++stripsPerBand;
+   }
+   
+   // Loop through strips....
+   for ( ossim_uint32 strip = starting_strip; strip <= ending_strip; ++strip )
+   {
+      if ( (theBufferRLevel != theCurrentDirectory) ||
+           !clip_rect.completely_within(theBufferRect) )
+      {
+         // Fill buffer block:
+         
+         ossim_uint32 linesInStrip = theRowsPerStrip[theCurrentDirectory];
+         
+         // If last strip and not filling entirely memset it.
+         if ( strip == ( stripsPerBand - 1 ) )
+         {
+            // Last strip of image. Strip may be clipped to end of image.
+            linesInStrip = theImageLength[theCurrentDirectory] %
+               theRowsPerStrip[theCurrentDirectory];
+         }
+
+         ossim_uint32 bytesPerStrip = linesInStrip * theImageWidth[theCurrentDirectory] * 2;
+                  
+         // TIFFReadEncodedStrip takes signed int32 arg.
+         ossim_int32 bytesToRead = (ossim_int32)bytesPerStrip;
+         
+         ossim_uint32 startY = strip * theRowsPerStrip[theCurrentDirectory];
+         
+         // Need to read in the strip data:
+         ossim_uint32 bufferOffsetInBytes = 0;
+         
+         for (ossim_uint32 band = 0; band < theSamplesPerPixel; ++band)
+         {
+            ossim_uint32 bandStrip = strip + band * stripsPerBand;
+            
+            //---
+            // TIFFReadEncodedStrip does byte swapping for us.
+            // -1 says to read entire strip.
+            // Return of -1 is error.
+            //---
+            ossim_int32 bytesRead = TIFFReadEncodedStrip( theTiffPtr,
+                                                          bandStrip,
+                                                          theBuffer+bufferOffsetInBytes,
+                                                          bytesToRead );
+           if ( bytesRead != bytesToRead )
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << "ossimTiffTileSource::loadFromU16Strip Read Error!"
+                     << "\nReturning error...  " << endl;
+               }
+               theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+               status = false;
+               result->makeBlank();
+               break;
+            }
+            bufferOffsetInBytes += bytesPerStrip;
+         }
+         
+         if ( status )
+         {
+            // Capture rect and rlevel of buffer:
+            theBufferRLevel = theCurrentDirectory;
+            theBufferRect = ossimIrect( 0,
+                                        startY,
+                                        theImageWidth[theCurrentDirectory] - 1,
+                                        startY + linesInStrip - 1);
+         }
+         
+      } // End: Fill buffer block.
+      
+      if ( status )
+      {
+         result->loadTile(theBuffer, theBufferRect, OSSIM_BSQ);
+      }
+      
+   } // End of strip loop.
+   
+   return status;
+   
+} // End: ossimTiffTileSource::loadFromU16Strip( ... )
+
+void ossimTiffTileSource::adjustToStartOfTile(ossimIpt& pt) const
+{
+   //***
+   // Notes:
+   // - Assumes an origin of (0,0)
+   // - Shifts in to the upper left direction.
+   //***
+   ossim_int32 tw =
+      static_cast<ossim_int32>(theImageTileWidth[theCurrentDirectory]);
+   ossim_int32 th =
+      static_cast<ossim_int32>(theImageTileLength[theCurrentDirectory]);
+   
+   if (pt.x > 0)
+   {
+      pt.x = (pt.x/tw) * tw;
+   }
+   else if (pt.x < 0)
+   {
+      pt.x = std::abs(pt.x) < tw ? -tw : (pt.x/tw)*tw;
+   }
+
+   if (pt.y > 0)
+   {
+      pt.y = (pt.y/th) * th;
+   }
+   else if (pt.y < 0)
+   {
+      pt.y = std::abs(pt.y) < th ? -th : (pt.y/th)*th;
+   }
+}
+
+bool ossimTiffTileSource::isValidRLevel(ossim_uint32 resLevel) const
+{
+   bool result = false;
+   
+   const ossim_uint32 LEVELS = getNumberOfDecimationLevels();
+
+   //---
+   // If we have r0 our reslevels are the same as the callers so
+   // no adjustment necessary.
+   //---
+   if ( !theStartingResLevel || theR0isFullRes) // Not an overview or has r0.
+   {
+      result = (resLevel < LEVELS);
+   }
+   else if (resLevel >= theStartingResLevel) // Used as overview.
+   {
+      result = ( (resLevel - theStartingResLevel) < LEVELS);
+   }
+   
+   return result;
+}
+
+ossim_uint32 ossimTiffTileSource::getCurrentTiffRLevel() const
+{
+   return theCurrentTiffRlevel;
+//   return theCurrentDirectory;
+}
+
+ossimString ossimTiffTileSource::getReadMethod(ossim_uint32 directory) const
+{
+   ossimString result = "UNKNOWN";
+   if ( directory < theReadMethod.size() )
+   {
+      switch (theReadMethod[directory])
+      {
+         case READ_RGBA_U8_TILE:
+            result = "READ_RGBA_U8_TILE";
+            break;
+         case READ_RGBA_U8_STRIP:
+            result = "READ_RGBA_U8_STRIP";
+            break;
+         case READ_RGBA_U8A_STRIP:
+            result = "READ_RGBA_U8A_STRIP";
+            break;
+         case READ_SCAN_LINE:
+            result = "READ_SCAN_LINE";
+            break;
+         case READ_TILE:
+            result = "READ_TILE";
+            break;
+         case UNKNOWN:
+         default:
+            break;
+      }
+   }
+   return result;
+}      
+
+ossim_uint32 ossimTiffTileSource::getNumberOfDirectories() const
+{
+   return theNumberOfDirectories;
+}
+
+ossim_uint32 ossimTiffTileSource::getImageTileWidth() const
+{
+   ossim_uint32 result = 0;
+   if(isOpen())
+   {
+      if(theCurrentDirectory < theImageTileWidth.size())
+      {
+         result = theImageTileWidth[theCurrentDirectory];
+      }
+   }   
+   return result;
+}
+
+ossim_uint32 ossimTiffTileSource::getImageTileHeight() const
+{
+   ossim_uint32 result = 0;
+   if(isOpen())
+   {
+      if(theCurrentDirectory < theImageTileLength.size())
+      {
+         result = theImageTileLength[theCurrentDirectory];
+      }
+   }
+   return result;
+}
+
+ossim_uint32 ossimTiffTileSource::getTileWidth() const
+{
+   ossim_uint32 result = getImageTileWidth();
+   if (!result)
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = tileSize.x;
+   }
+   return result;
+}
+
+ossim_uint32 ossimTiffTileSource::getTileHeight() const
+{
+   ossim_uint32 result = getImageTileHeight();
+   if (!result)
+   {
+      ossimIpt tileSize;
+      ossim::defaultTileSize(tileSize);
+      result = tileSize.y;
+   }
+   return result;
+}
+
+void ossimTiffTileSource::setApplyColorPaletteFlag(bool flag)
+{
+   theApplyColorPaletteFlag = flag;
+   
+   if(isColorMapped())
+   {
+      if(theApplyColorPaletteFlag)
+      {
+         thePhotometric[0] = PHOTOMETRIC_PALETTE;
+         theSamplesPerPixel = 3;
+      }
+      else
+      {
+         thePhotometric[0] = PHOTOMETRIC_MINISBLACK;
+         theSamplesPerPixel = 1; 
+      }
+      
+      setReadMethod();
+
+      theTile = 0;
+      if (theBuffer)
+      {
+         delete [] theBuffer;
+         theBuffer = 0;
+      }
+   }
+}
+
+bool ossimTiffTileSource::getApplyColorPaletteFlag()const
+{
+   return theApplyColorPaletteFlag;
+}
+
+ossimString ossimTiffTileSource::getLongName()const
+{
+   return ossimString("TIFF Image Handler");
+}
+
+ossimString ossimTiffTileSource::getShortName()const
+{
+   return ossimString("ossim_tiff");
+}
+
+std::ostream& ossimTiffTileSource::print(std::ostream& os) const
+{
+   //***
+   // Use a keyword format.
+   //***
+   os << "image_file:                    " << theImageFile
+      << "\nsamples_per_pixel:           " << theSamplesPerPixel
+      << "\nbits_per_sample:             " << theBitsPerSample
+      << "\nsample_format_unit:          " << theSampleFormatUnit
+      << "\nmin_sample_value:            " << theMinSampleValue
+      << "\nmax_sample_value:            " << theMaxSampleValue
+      << "\nnull_sample_value:           " << theNullSampleValue
+      << "\ntheNumberOfDirectories:      " << theNumberOfDirectories
+      << "\nr0_is_full_res:              " << theR0isFullRes;
+
+   
+   for (ossim_uint32 i=0; i<theNumberOfDirectories; ++i)
+   {
+      os << "\ndirectory[" << i << "]"
+         << "\nimage width:     " << theImageWidth[i]
+         << "\nimage_length:    " << theImageLength[i]
+         << "\nread method:     " << getReadMethod(i).c_str()
+         << "\nplanar:          " << thePlanarConfig[i]
+         << "\nphotometric:     " << thePhotometric[i];
+      if (theRowsPerStrip[i])
+      {
+         os << "\nrows per strip:  " << theRowsPerStrip[i];
+      }
+      if (theImageTileWidth[i])
+      {
+         os << "\ntile_width:      " << theImageTileWidth[i];
+      }
+      if (theImageTileLength[i])
+      {
+         os << "\ntile_length:     " << theImageTileLength[i];
+      }
+      os << endl;
+   }
+
+   if (theTile.valid())
+   {
+      os << "\nOutput tile dump:\n" << *theTile << endl;
+   }
+
+   if (theOverview.valid())
+   {
+      os << "\nOverview file:\n";
+      theOverview->print(os);
+   }
+
+   os << endl;
+   
+   return ossimSource::print(os);
+}
+
+ossim_uint32 ossimTiffTileSource::getNumberOfInputBands() const
+{
+   return theSamplesPerPixel;
+}
+
+ossim_uint32 ossimTiffTileSource::getNumberOfOutputBands () const
+{
+   ossim_uint32 bands = theOutputBandList.size();
+   if ( !bands )
+   {
+      bands = getNumberOfInputBands();
+   }
+   return bands;
+}
+
+bool ossimTiffTileSource::isBandSelector() const
+{
+   bool result = false;
+   if ( isOpen() && theReadMethod.size() && ( theReadMethod.size() == thePlanarConfig.size() ) )
+   {
+      // Tiled band separate currently is only coded to be band selector.
+      result = true;
+      for ( ossim_uint32 i = 0; i < theReadMethod.size(); ++i )
+      {
+         if ( ( theReadMethod[i] != READ_TILE ) ||
+              ( thePlanarConfig[i] == PLANARCONFIG_CONTIG ) )
+         {
+            result = false;
+            break;
+         }
+      }
+      if ( result && theOverview.valid() )
+      {
+         result = theOverview->isBandSelector();
+      }
+   }
+   return result;
+}
+
+bool ossimTiffTileSource::setOutputBandList(const std::vector<ossim_uint32>& band_list)
+{
+   bool result = false;
+   if ( isBandSelector() )
+   {
+      // Making a copy as passed in list could be our m_outputBandList.
+      std::vector<ossim_uint32> inputList = band_list;
+      result = ossimImageHandler::setOutputBandList( inputList, theOutputBandList );
+      if ( result && theTile.valid() )
+      {
+         if ( theTile->getNumberOfBands() != theOutputBandList.size() )
+         {
+            theTile = 0; // Force a reinitialize on next getTile.
+         }
+      }
+   }
+   return result;
+}
+
+void ossimTiffTileSource::getOutputBandList(std::vector<ossim_uint32>& bandList) const
+{
+   if ( theOutputBandList.size() )
+   {
+      bandList = theOutputBandList;
+   }
+   else
+   {
+      ossimImageSource::getOutputBandList( bandList );
+   }
+}
+
+bool ossimTiffTileSource::isOpen()const
+{
+   return (theTiffPtr!=NULL);
+}
+
+bool ossimTiffTileSource::hasR0() const
+{
+   return theR0isFullRes;
+}
+
+ossim_float64 ossimTiffTileSource::getMinPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return ossimImageHandler::getMinPixelValue(band);
+   }
+   return theMinSampleValue;
+}
+
+ossim_float64 ossimTiffTileSource::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return ossimImageHandler::getMaxPixelValue(band);
+   }
+   return theMaxSampleValue;
+}
+
+ossim_float64 ossimTiffTileSource::getNullPixelValue(ossim_uint32 band)const
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return ossimImageHandler::getNullPixelValue(band);
+   }
+   return theNullSampleValue;
+}
+
+bool ossimTiffTileSource::isColorMapped() const
+{
+   bool result = false;
+   if ( isOpen() )
+   {
+      uint16* red;
+      uint16* green;
+      uint16* blue;
+      
+      result = static_cast<bool>(TIFFGetField(theTiffPtr,
+                                              TIFFTAG_COLORMAP,
+                                              &red, &green, &blue));
+   }
+   return result;
+}
+
+void ossimTiffTileSource::setReadMethod()
+{
+   for (ossim_uint32 dir=0; dir<theNumberOfDirectories; ++dir)
+   {
+      if (setTiffDirectory(dir) == false)
+      {
+         return;
+      }
+      
+      //---
+      // Establish how this tiff directory will be read.
+      //---
+      if (TIFFIsTiled(theTiffPtr)) 
+      {
+         if ( ( thePhotometric[dir] == PHOTOMETRIC_YCBCR ||
+                thePhotometric[dir] == PHOTOMETRIC_PALETTE ) &&
+              (theSamplesPerPixel <= 3) &&
+              (theBitsPerSample   <= 8 ))
+         {
+            theReadMethod[dir] = READ_RGBA_U8_TILE;
+         }
+         else
+         {
+            theReadMethod[dir] = READ_TILE;
+         }
+      }
+      else // Not tiled...
+      {
+         if ( (thePhotometric[dir] == PHOTOMETRIC_PALETTE ||
+               thePhotometric[dir] == PHOTOMETRIC_YCBCR ) &&
+              theSamplesPerPixel <= 3 &&
+              theBitsPerSample   <= 8 )
+         {
+            theReadMethod[dir] = READ_RGBA_U8_STRIP;
+         }
+         else if (( theBitsPerSample == 16 ) &&
+                  ( theRowsPerStrip[dir] > 1 ) &&
+                  (( thePlanarConfig[dir] == PLANARCONFIG_SEPARATE ) ||
+                    ((thePlanarConfig[dir] == PLANARCONFIG_CONTIG) && (theSamplesPerPixel==1))))
+         {
+            // Buffer a strip of bands.
+            theReadMethod[dir] = READ_U16_STRIP;
+         }
+         else if (theSamplesPerPixel <= 3 && theBitsPerSample == 1)
+         {
+            //---
+            // Note:  One bit data expands to zeroes and 255's so run it through
+            //        a specialized method to flip zeroes to one's since zeroes
+            //        are usually reserved for null value.
+            //---
+            theReadMethod[dir] = READ_RGBA_U8A_STRIP;
+         }
+         else if((theCompressionType == COMPRESSION_NONE)||
+                 (theRowsPerStrip[dir]==1))
+         {
+            theReadMethod[dir] = READ_SCAN_LINE;
+         }
+         else if((theCompressionType!=COMPRESSION_NONE)&&
+                 (theSamplesPerPixel <= 4) &&
+                 (theBitsPerSample   <= 8) )
+         {
+            theReadMethod[dir] = READ_RGBA_U8_STRIP;
+         }
+         else
+         {
+            theReadMethod[dir] = UNKNOWN;
+         }
+      }
+      
+   } // End of loop through directories.
+
+   // Reset the directory back to "0".
+   setTiffDirectory(0);
+}
+
+void ossimTiffTileSource::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid())
+   {
+      return;
+   }
+   if(property->getName() == "apply_color_palette_flag")
+   {
+      // Assuming first directory...
+      setApplyColorPaletteFlag(property->valueToString().toBool());
+   }
+   else
+   {
+      ossimImageHandler::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimTiffTileSource::getProperty(const ossimString& name)const
+{
+   if(name == "apply_color_palette_flag")
+   {
+      ossimBooleanProperty* property = new ossimBooleanProperty("apply_color_palette_flag",
+                                                                theApplyColorPaletteFlag);
+      property->clearChangeType();
+      property->setFullRefreshBit();
+      return property;
+   }
+   else if(name == "file_type")
+	{
+		return new ossimStringProperty(name, "TIFF");
+	}
+	
+   return ossimImageHandler::getProperty(name);
+}
+
+void ossimTiffTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimImageHandler::getPropertyNames(propertyNames);
+   propertyNames.push_back("file_type");
+   propertyNames.push_back("apply_color_palette_flag");
+}
+
+bool ossimTiffTileSource::setTiffDirectory(ossim_uint16 directory)
+{
+   bool status = true;
+   theCurrentTiffRlevel = 0;
+   if (theCurrentDirectory != directory)
+   {
+      status = TIFFSetDirectory(theTiffPtr, directory);
+      if (status == true)
+      {
+         theCurrentDirectory = directory;
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimTiffTileSource::setTiffDirectory ERROR setting directory "
+               << directory << "!" << endl;
+         }
+      }
+   }
+   
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx<theImageDirectoryList.size();++idx)
+   {
+      if(theImageDirectoryList[idx] == directory)
+      {
+         theCurrentTiffRlevel = idx;
+         break;
+      }
+   }
+   return status;
+}
+
+void ossimTiffTileSource::populateLut()
+{
+   ossim_uint16* r;
+   ossim_uint16* g;
+   ossim_uint16* b;
+   if(TIFFGetField(theTiffPtr, TIFFTAG_COLORMAP, &r, &g, &b))
+   {
+      ossim_uint32 numEntries = 256;
+      ossimScalarType scalarType = OSSIM_UINT8;
+      if(theBitsPerSample == 16)
+      {
+         numEntries = 65536;
+         scalarType = OSSIM_UINT16;
+      }
+      theLut = new ossimNBandLutDataObject(numEntries,
+                                           3,
+                                           scalarType,
+                                           0);
+      ossim_uint32 entryIdx = 0;
+      for(entryIdx = 0; entryIdx < numEntries; ++entryIdx)
+      {
+         if(scalarType == OSSIM_UINT8)
+         {
+            (*theLut)[entryIdx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(((*r)/65535.0)*255.0);
+            (*theLut)[entryIdx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(((*g)/65535.0)*255.0);
+            (*theLut)[entryIdx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(((*b)/65535.0)*255.0);
+         }
+         else
+         {
+            (*theLut)[entryIdx][0] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(*r);
+            (*theLut)[entryIdx][1] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(*g);
+            (*theLut)[entryIdx][2] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(*b);
+         }
+         ++r;++g;++b;
+      }
+   }
+}
+
+void ossimTiffTileSource::validateMinMaxNull()
+{
+   ossim_float64 tempNull = ossim::defaultNull(theScalarType);
+   ossim_float64 tempMax  = ossim::defaultMax(theScalarType);
+   ossim_float64 tempMin  = ossim::defaultMin(theScalarType);
+   
+   if( (theMinSampleValue == tempNull) || ossim::isnan(theMinSampleValue) ) 
+   {
+      theMinSampleValue = tempMin;
+   }
+   if( (theMaxSampleValue == tempNull) || ossim::isnan(theMaxSampleValue) )
+   {
+      theMaxSampleValue = tempMax;
+   }
+   if ( ossim::isnan(theNullSampleValue) )
+   {
+      theNullSampleValue = tempNull;
+   }
+
+   if (theScalarType == OSSIM_FLOAT32)
+   {
+      std::ifstream inStr(theImageFile.c_str(), std::ios::in|std::ios::binary);
+      if ( inStr.good() )
+      {   
+         // Do a print to a memory stream in key:value format.
+         ossimTiffInfo ti;
+         ossimIOMemoryStream memStr;
+         ti.print(inStr, memStr);
+
+         // Make keywordlist with all the tags.
+         ossimKeywordlist gtiffKwl;
+         if ( gtiffKwl.parseStream(memStr) )
+         {
+#if 0 /* Please keep for debug. (drb) */
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimTiffTileSource::validateMinMaxNull kwl:\n" << gtiffKwl
+                  << endl;
+            }
+#endif
+            const char* lookup;
+
+            lookup = gtiffKwl.find("tiff.image0.gdal_nodata");
+            bool nullFound = false;
+            if ( lookup )
+            {
+               ossimString os = lookup;
+               theNullSampleValue = os.toFloat32();
+               nullFound = true;
+            }
+            lookup = gtiffKwl.find("tiff.image0.vertical_citation");
+            if ( lookup )
+            {     
+               //---
+               // Format of string this handles:
+               // "Null: -9999.000000, Non-Null Min: 12.428605, 
+               // Non-Null Avg: 88.944082, Non-Null Max: 165.459558|"
+               ossimString citation = lookup;
+               std::vector<ossimString> array;
+               citation.split( array, ossimString(",") );
+               if ( array.size() == 4 )
+               {
+                  std::vector<ossimString> array2;
+
+                  if ( !nullFound )
+                  {
+                     // null
+                     array[0].split( array2, ossimString(":") );
+                     if ( array2.size() == 2 )
+                     {
+                        ossimString os = array2[0].downcase();
+                        if ( os.contains( ossimString("null") ) )
+                        {
+                           if ( array2[1].size() )
+                           {
+                              theNullSampleValue = array2[1].toFloat64(); 
+                              nullFound = true;
+                           }
+                        }
+                     }
+                  }
+
+                  // min
+                  array2.clear();
+                  array[1].split( array2, ossimString(":") );
+                  if ( array2.size() == 2 )
+                  {  
+                     ossimString os = array2[0].downcase();
+                     if ( os.contains( ossimString("min") ) )
+                     {
+                        if ( array2[1].size() )
+                        {
+                           theMinSampleValue = array2[1].toFloat64();
+                        }
+                     }
+                  }
+
+                  // Skipping average.
+
+                  // max
+                  array2.clear();
+                  array[3].split( array2, ossimString(":") );
+                  if ( array2.size() == 2 )
+                  {
+                     ossimString os = array2[0].downcase();
+                     if ( os.contains( ossimString("max") ) )
+                     {
+                        if ( array2[1].size() )
+                        {
+                           array2[1].trim( ossimString("|") );
+                           theMaxSampleValue = array2[1].toFloat64();   
+                        }
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+}
+
+#if 0
+ossimImageGeometry* ossimTiffTileSource::getImageGeometry()
+{
+   //---
+   // Call base class getImageGeometry which will check for external geometry
+   // or an already set geometry.
+   //---
+   ossimImageGeometry* result = ossimImageHandler::getImageGeometry();
+
+   if (result)
+   {
+      //---
+      // TODO: Add transform from tags.
+      //---
+
+      
+      // if ( !result->getTransform() )
+      // {
+      //    if ( transform.valid() )
+      //    {
+      //       result->setTransform( transform.get() );
+      //    }
+      // }
+      //else
+      //{
+      //   ossimImageGeometryRegistry::instance()->createTransform(this);
+      //}
+      
+      if ( !result->getProjection() )
+      {
+         // Get the projection from the tags.
+         
+         ossimRefPtr<ossimProjection> proj = 0;
+
+         if (theTiffPtr)
+         {
+            ossimGeoTiff geotiff;
+
+            //---
+            // Note: must pass false to readTags so it doesn't close our
+            // tiff pointer.
+            //---
+            geotiff.readTags(theTiffPtr, getCurrentEntry(), false);
+            ossimKeywordlist kwl;
+            if(geotiff.addImageGeometry(kwl))
+            {
+               proj = ossimProjectionFactoryRegistry::instance()->
+                  createProjection(kwl);
+            }
+            
+            if ( proj.valid() )
+            {
+               result->setProjection( proj.get() );
+            }
+            //else
+            //{
+            // ossimImageGeometryRegistry::instance()->createProjection(this);
+            //}
+         }
+      }
+      
+   } // matches: if (result)
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiffTileSource::createImageGeometry DEBUG:\n";
+
+      if (result)
+      {
+         result->print(ossimNotify(ossimNotifyLevel_DEBUG)) << "\n";
+      }
+   }
+
+   return result;
+}
+#endif
+
+bool ossimTiffTileSource::isPowerOfTwoDecimation(ossim_uint32 level) const
+{
+   // Check size of this level against last level to see if it's half the previous.
+   bool result = false;
+   if ( (level > 0) && ( theImageWidth.size() > level ) && ( theImageLength.size() > level ) )
+   {
+      ossim_uint32 i = level-1; // previous level
+      
+      if ( ( ( theImageWidth[i]/2 == theImageWidth[level] ) ||
+             ( (theImageWidth[i]+1)/2 == theImageWidth[level] ) ) &&
+           ( ( theImageLength[i]/2 == theImageLength[level] ) ||
+             ( (theImageLength[i]+1)/2 == theImageLength[level] ) ) )
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+void ossimTiffTileSource::allocateTile()
+{
+   theTile = 0;
+   ossim_uint32 bands = 0;
+   if ( theOutputBandList.empty() )
+   {
+      bands = getNumberOfOutputBands();
+   }
+   else
+   {
+      bands = theOutputBandList.size();
+   }
+
+   if ( bands )
+   {
+      theTile = ossimImageDataFactory::instance()->create( this, getOutputScalarType(), bands );
+      if ( theTile.valid() )
+      {
+         theTile->initialize();
+         
+         // The width and height mus be set prior to call to allocateBuffer.
+         theCurrentTileWidth  = theTile->getWidth();
+         theCurrentTileHeight = theTile->getHeight();
+      }
+   }
+}
+
+bool ossimTiffTileSource::allocateBuffer()
+{
+   bool bSuccess = true;
+   // Allocate memory for a buffer to hold data grabbed from the tiff file.
+   ossim_uint32 buffer_size=0;
+   switch (theReadMethod[theCurrentDirectory])
+   {
+      case READ_RGBA_U8_TILE:
+      {
+         buffer_size = theImageTileWidth[theCurrentDirectory]*
+            theImageTileWidth[theCurrentDirectory]*theBytesPerPixel*4;
+         break;
+      }  
+      case READ_TILE:
+      {
+         if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
+         {
+            buffer_size = theImageTileWidth[theCurrentDirectory] *
+               theImageTileLength[theCurrentDirectory] *
+               theBytesPerPixel * theSamplesPerPixel;
+         }
+         else
+         {
+            buffer_size = theImageTileWidth[theCurrentDirectory] *
+               theImageTileLength[theCurrentDirectory] *
+               theBytesPerPixel;
+         }
+         break;
+      }  
+      case READ_RGBA_U8_STRIP:
+      case READ_RGBA_U8A_STRIP:
+      {
+         buffer_size = theImageWidth[0]*theRowsPerStrip[theCurrentDirectory]*
+            theBytesPerPixel*4;
+         break;
+      } 
+      case READ_U16_STRIP:
+      {
+//         std::cout << "DOING READ_U16_STRIP\n";
+         // Encountered case where it was multiple rows per strip, yet PLANARCONFIG_CONTIG. The
+         // case was in fact single band so planar config is irrelevant. (OLK July 2015)
+         
+         // I put the multiplication back in for the theSamplesPerPixel.  In the read method that is used for this
+         // it populates this buffer with all bands and then uses the load method on the image data object.
+         // so all bands has to be populated for the buffer. (GCP Sept 2015)
+         buffer_size = theImageWidth[0]*theRowsPerStrip[theCurrentDirectory]*theBytesPerPixel*
+                       theSamplesPerPixel;
+//         std::cout << "ROWS PER STRIP: " << theRowsPerStrip[theCurrentDirectory] << "\n"
+//                   << "ImageWidth:     " << theImageWidth[0] << "\n"
+//                   << "BytesPerPixel:  " << theBytesPerPixel << "\n";
+//         std::cout << thePlanarConfig[theCurrentDirectory] << " ==== " << PLANARCONFIG_CONTIG << "\n";
+
+         // I commented this out for this is core dumping for one of the tiff images. (GCP Sept 2015)
+        // if (thePlanarConfig[theCurrentDirectory] == PLANARCONFIG_CONTIG)
+          //  buffer_size *= theSamplesPerPixel;
+         break;
+      }
+      case READ_SCAN_LINE:
+      {
+#if OSSIM_BUFFER_SCAN_LINE_READS
+         // Buffer a image width by tile height.
+         buffer_size = theImageWidth[0] * theBytesPerPixel *
+            theSamplesPerPixel * theCurrentTileHeight;
+#else
+         buffer_size = theImageWidth[0] * theBytesPerPixel * theSamplesPerPixel;
+#endif
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Unknown read method!" << endl;
+         print(ossimNotify(ossimNotifyLevel_WARN));
+         bSuccess = false;
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiffTileSource::allocateBuffer DEBUG:"
+         << "\nbuffer_size:  " << buffer_size
+         << endl;
+   }
+
+   theBufferRect.makeNan();
+   theBufferRLevel = theCurrentDirectory;
+
+   if ( bSuccess && ( buffer_size != theBufferSize ) )
+   {
+      theBufferSize = buffer_size;
+      if (theBuffer)
+      {
+         delete [] theBuffer;
+      }
+
+      // ESH 05/2009 -- Fix for ticket #738:  
+      // image_info crashing on aerial_ortho image during ingest
+      try
+      {
+         theBuffer = new ossim_uint8[buffer_size];
+      }
+      catch(...)
+      {
+         theBuffer = 0;
+         bSuccess = false;
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimTiffTileSource::allocateBuffer WARN:"
+               << "\nNot enough memory: buffer_size:  " << buffer_size
+               << endl;
+         }
+      }
+   }
+
+   return bSuccess;
+}
diff --git a/src/imaging/ossimTiffWriter.cpp b/src/imaging/ossimTiffWriter.cpp
new file mode 100644
index 0000000..bca89d5
--- /dev/null
+++ b/src/imaging/ossimTiffWriter.cpp
@@ -0,0 +1,1758 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// Author:  Frank Warmerdam (warmerda at home.com)
+//
+//*******************************************************************
+// $Id$
+
+#include <ossim/ossimConfig.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimBooleanProperty.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimMapProjectionInfo.h>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimEpsgProjectionDatabase.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimStatePlaneProjectionInfo.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/support_data/ossimGeoTiff.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+
+#include <tiffio.h>
+#ifdef OSSIM_HAS_GEOTIFF
+#  if OSSIM_HAS_GEOTIFF
+#    include <xtiffio.h>
+#    include <geotiff.h>
+#    include <geo_normalize.h>
+#    include <geovalues.h>
+#  endif
+#endif
+
+#include <algorithm>
+#include <sstream>
+
+static ossimTrace traceDebug("ossimTiffWriter:debug");
+static const char* TIFF_WRITER_OUTPUT_TILE_SIZE_X_KW = "output_tile_size_x";
+static const char* TIFF_WRITER_OUTPUT_TILE_SIZE_Y_KW = "output_tile_size_y";
+static const long  DEFAULT_JPEG_QUALITY = 75;
+
+RTTI_DEF1(ossimTiffWriter, "ossimTiffWriter", ossimImageFileWriter);
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimTiffWriter.cpp 22942 2014-11-02 20:39:27Z gpotts $";
+#endif
+
+ossimTiffWriter::ossimTiffWriter()
+:
+            ossimImageFileWriter(),
+            theTif(NULL),
+            theCompressionType("none"),
+            theJpegQuality(DEFAULT_JPEG_QUALITY),
+            theOutputGeotiffTagsFlag(true),
+            theColorLutFlag(false),
+            theProjectionInfo(NULL),
+            theOutputTileSize(OSSIM_DEFAULT_TILE_WIDTH, OSSIM_DEFAULT_TILE_HEIGHT),
+            theForceBigTiffFlag(false),
+            theBigTiffFlag(false)
+{
+   theColorLut = new ossimNBandLutDataObject();
+   ossim::defaultTileSize(theOutputTileSize);
+   theOutputImageType = "tiff_tiled_band_separate";
+
+
+#ifdef OSSIM_ID_ENABLED /* to quell unused variable warning. */
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
+   }
+#endif
+}
+
+ossimTiffWriter::~ossimTiffWriter()
+{
+   if(isOpen())
+   {
+      closeTiff();
+   }
+}
+
+bool ossimTiffWriter::openTiff()
+{
+   static const char* MODULE = "ossimTiffWriter::openTiff()";
+
+   bool status = false;
+
+   // Close the existing file pointer.
+   closeTiff();
+
+   // Check for empty file name.
+   if ( theFilename.size() )
+   {
+      //---
+      // On windows libtiff can treat class tiff offsets as signed(2GB limit) or
+      // unsigned(4GB) so if even close to 2GB (2.1.47 GB) limit make a big tiff.
+      //---
+      const ossim_uint64 BIGTIFF_THRESHOLD = 2000000000;
+      ossimIrect bounds = theInputConnection->getBoundingRect();
+      ossim_uint64 byteCheck =
+            (static_cast<ossim_uint64>(bounds.width())*
+                  static_cast<ossim_uint64>(bounds.height())*
+                  static_cast<ossim_uint64>(theInputConnection->getNumberOfOutputBands())*
+                  static_cast<ossim_uint64>(ossim::scalarSizeInBytes(theInputConnection->getOutputScalarType())));
+
+      if( byteCheck > BIGTIFF_THRESHOLD )
+      {
+         theBigTiffFlag = true;
+      }
+
+      ossimString openMode = "w";
+      if(theBigTiffFlag||theForceBigTiffFlag)
+      {
+         openMode += "8";
+      }
+
+      // Open the new file.
+      theTif = XTIFFOpen( theFilename.c_str(), openMode.c_str() );
+      if ( theTif )
+      {
+         status = true;
+      }
+      else
+      {
+         setErrorStatus(); // base class
+         ossimSetError(getClassName().c_str(),
+                       ossimErrorCodes::OSSIM_ERROR,
+                       "File %s line %d Module %s Error:\n\
+Error opening file:  %s\n",
+__FILE__,
+__LINE__,
+MODULE,
+theFilename.c_str());
+      }
+   }
+   return status;
+}
+
+bool ossimTiffWriter::closeTiff()
+{
+   if (theTif)
+   {
+      XTIFFClose( (TIFF*)theTif );
+      theTif = NULL;
+   }
+   return true;
+}
+
+bool ossimTiffWriter::writeTiffTags()
+{
+   static const char MODULE[] = "ossimTiffWriter::writeTiffTags";
+   TIFF* tiffPtr = (TIFF*)theTif;
+   if (!tiffPtr)
+   {
+      setErrorStatus(); // base class
+      ossimSetError(getClassName().c_str(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "File %s line %d %s\nError:  Tiff pointer is null!\n\
+Call setFilename method.\n",
+__FILE__,
+__LINE__,
+MODULE);
+      return false;
+   }
+
+   //---
+   // NOTE:
+   // Since the tiff library uses the variable argument list function "va_arg"
+   // it is important to use the correct data type.  If in doubt see the
+   // code for libtiff's _TIFFVSetField in "tif_dir.c" in the libtiff package.
+   //---
+
+   int bitsPerSample  = 0;
+   int sampleFormat   = 0;
+   switch( theInputConnection->getOutputScalarType() )
+   {
+   case OSSIM_UINT8:
+      bitsPerSample = 8;
+      sampleFormat = SAMPLEFORMAT_UINT;
+      break;
+
+   case OSSIM_UINT16:
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+      bitsPerSample = 16;
+      sampleFormat = SAMPLEFORMAT_UINT;
+      break;
+
+   case OSSIM_SINT16:
+      bitsPerSample = 16;
+      sampleFormat = SAMPLEFORMAT_INT;
+      break;
+
+   case OSSIM_FLOAT32:
+   case OSSIM_NORMALIZED_FLOAT:
+      bitsPerSample = 32;
+      sampleFormat = SAMPLEFORMAT_IEEEFP;
+      break;
+
+   case OSSIM_NORMALIZED_DOUBLE:
+   case OSSIM_FLOAT64:
+      bitsPerSample = 64;
+      sampleFormat = SAMPLEFORMAT_IEEEFP;
+      break;
+
+   default:
+      return false;
+   }
+
+   // Set the pixel type.
+   TIFFSetField( (TIFF*)tiffPtr, TIFFTAG_BITSPERSAMPLE, bitsPerSample );
+   TIFFSetField( (TIFF*)tiffPtr, TIFFTAG_SAMPLEFORMAT, sampleFormat );
+
+   // Set the image dimensions.
+   ossim_uint32  width  = theAreaOfInterest.width();
+   ossim_uint32  height = theAreaOfInterest.height();
+   TIFFSetField( tiffPtr, TIFFTAG_IMAGEWIDTH, width);
+   TIFFSetField( tiffPtr, TIFFTAG_IMAGELENGTH, height);
+   if (isTiled())
+   {
+      ossim_uint32 tileXSize = theOutputTileSize.x;
+      ossim_uint32 tileYSize = theOutputTileSize.y;
+      TIFFSetField(tiffPtr, TIFFTAG_TILEWIDTH,  tileXSize);
+      TIFFSetField(tiffPtr, TIFFTAG_TILELENGTH, tileYSize);
+   }
+   else
+   {
+      TIFFSetField(tiffPtr, TIFFTAG_ROWSPERSTRIP, ossim_uint32(1));
+   }
+
+   ossim_uint32 numberOfBands = theInputConnection->getNumberOfOutputBands();
+
+   // Set the min/max values.
+   std::vector<ossim_float64> minBand(numberOfBands);
+   std::vector<ossim_float64> maxBand(numberOfBands);
+   for(ossim_uint32 idx = 0; idx < numberOfBands; ++idx)
+   {
+      maxBand[idx] = theInputConnection->getMaxPixelValue(idx);
+      minBand[idx] = theInputConnection->getMinPixelValue(idx);
+   }
+
+   writeMinMaxTags(minBand, maxBand);
+
+   // Set the planar configuration.
+   if (  (theOutputImageType == "tiff_strip") ||
+         (theOutputImageType == "tiff_tiled") ||
+         (theOutputImageType == "image/tiff") ||
+         (theOutputImageType == "image/tif") ||
+         (theOutputImageType == "image/gtif") ||
+         (theOutputImageType == "image/gtiff") )
+   {
+      TIFFSetField( tiffPtr, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+   }
+   else
+   {
+      TIFFSetField( tiffPtr, TIFFTAG_PLANARCONFIG, PLANARCONFIG_SEPARATE);
+   }
+
+   // Set the compression type:
+   uint16 tiffCompressType = COMPRESSION_NONE;
+   theCompressionType.downcase();
+   if( theCompressionType == "jpeg")
+   {
+      tiffCompressType  = COMPRESSION_JPEG;
+      // Set the jpeg quality.
+      // note the compression type must be set before the quality or you will get an error
+      TIFFSetField( tiffPtr, TIFFTAG_COMPRESSION, tiffCompressType);
+      TIFFSetField( tiffPtr, TIFFTAG_JPEGQUALITY,  theJpegQuality);
+   }
+   else if( theCompressionType == "lzw")
+   {
+      tiffCompressType  = COMPRESSION_LZW;
+      TIFFSetField( tiffPtr, TIFFTAG_COMPRESSION, tiffCompressType);
+   }
+   else if(theCompressionType == "packbits")
+   {
+      tiffCompressType = COMPRESSION_PACKBITS;
+      TIFFSetField( tiffPtr, TIFFTAG_COMPRESSION, tiffCompressType);
+   }
+   else if((theCompressionType == "deflate") ||
+         (theCompressionType == "zip"))
+   {
+      tiffCompressType  = COMPRESSION_DEFLATE;
+      TIFFSetField( tiffPtr, TIFFTAG_COMPRESSION, tiffCompressType);
+   }
+   TIFFSetField(tiffPtr, TIFFTAG_SAMPLESPERPIXEL, (int)theInputConnection->getNumberOfOutputBands());
+
+   ossimScalarType scalarType = theInputConnection->getOutputScalarType();
+   bool lutEnabled = (theColorLutFlag&&
+                      ((scalarType == OSSIM_UINT8)||
+                       (scalarType == OSSIM_UINT16)||
+                       (scalarType == OSSIM_USHORT11)||
+                       (scalarType == OSSIM_USHORT12)||
+                       (scalarType == OSSIM_USHORT13)||
+                       (scalarType == OSSIM_USHORT14)||
+                       (scalarType == OSSIM_USHORT15))&&
+                      (theColorLut->getNumberOfEntries() > 0)&&
+                      (theInputConnection->getNumberOfOutputBands() == 1));
+   if(lutEnabled)
+   {
+      TIFFSetField( tiffPtr, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE );
+      TIFFSetField( tiffPtr, TIFFTAG_INDEXED, (ossim_uint16)1);
+
+      if(scalarType == OSSIM_UINT8)
+      {
+         ossim_uint16 r[256], g[256], b[256];
+
+         memset(r, '\0', sizeof(ossim_uint16)*256);
+         memset(g, '\0', sizeof(ossim_uint16)*256);
+         memset(b, '\0', sizeof(ossim_uint16)*256);
+
+         for(ossim_uint32 i = 0; i < theColorLut->getNumberOfEntries(); i++)
+         {
+            r[i] = (ossim_uint16) (((*theColorLut)[i][0]/255.0)*65535);
+            g[i] = (ossim_uint16) (((*theColorLut)[i][1]/255.0)*65535);
+            b[i] = (ossim_uint16) (((*theColorLut)[i][2]/255.0)*65535);
+         }
+         TIFFSetField(tiffPtr, TIFFTAG_COLORMAP, r, g ,b);
+      }
+      else
+      {
+         ossim_uint16 r[65536], g[65536], b[65536];
+         memset(r, '\0', sizeof(ossim_uint16)*65536);
+         memset(g, '\0', sizeof(ossim_uint16)*65536);
+         memset(b, '\0', sizeof(ossim_uint16)*65536);
+
+         for(ossim_uint32 i = 0; i < theColorLut->getNumberOfEntries(); i++)
+         {
+            r[i] = (ossim_uint16) ((*theColorLut)[i][0]);
+            g[i] = (ossim_uint16) ((*theColorLut)[i][1]);
+            b[i] = (ossim_uint16) ((*theColorLut)[i][2]);
+         }
+         TIFFSetField(tiffPtr, TIFFTAG_COLORMAP, r, g ,b);
+      }
+   }
+   else if( (theInputConnection->getNumberOfOutputBands() == 3 ||
+         theInputConnection->getNumberOfOutputBands() == 4 ||
+         (thePhotoMetric == "rgb"))&&
+         (scalarType == OSSIM_UCHAR))
+   {
+      TIFFSetField( tiffPtr, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB );
+   }
+   else
+   {
+      TIFFSetField( tiffPtr, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK );
+   }
+
+   return true;
+}
+
+bool ossimTiffWriter::writeGeotiffTags(ossimRefPtr<ossimMapProjectionInfo> projectionInfo)
+{
+   TIFF* tiffPtr = (TIFF*)theTif;
+   bool result = false;
+   if ( tiffPtr )
+   {
+      if ( projectionInfo.valid() )
+      {
+         result = ossimGeoTiff::writeTags(tiffPtr, projectionInfo);
+      }
+   }
+   return result;
+}
+
+void ossimTiffWriter::checkColorLut()
+{
+
+   // this code appears to be wrong.  We can only do an outo lut if the immediate input to the sequencer is 
+   // a handler with a lut or some kind of lut source.
+   // 
+   // I think that we should add a flag to enable auto setting of the lut instead of just doing it. This code causes core
+   // dumps if one is to replicate bands with a band selector where a lut is a single band output like a CIB
+   //
+   // I currenlty have to disable
+   //
+
+
+#if 0
+   bool needColorLut = false;
+   bool needLoop = true;
+   ossimRefPtr<ossimNBandLutDataObject> colorLut = 0;
+   ossimConnectableObject::ConnectableObjectList imageInputs = theInputConnection->getInputList();
+   if (imageInputs.size() > 0)
+   {
+      for (ossim_uint32 i = 0; i < imageInputs.size(); i++)
+      {
+         if (needLoop == false)
+         {
+            break;
+         }
+         ossimImageChain* source = PTR_CAST(ossimImageChain, imageInputs[i].get());
+         if (source)
+         {
+            ossimConnectableObject::ConnectableObjectList imageChains = source->getInputList();
+            for (ossim_uint32 j = 0; j < imageChains.size(); j++)
+            {
+               if (needLoop == false)
+               {
+                  break;
+               }
+               ossimImageChain* imageChain = PTR_CAST(ossimImageChain, imageChains[j].get());
+               if (imageChain)
+               {
+                  ossimConnectableObject::ConnectableObjectList imageHandlers =
+                        imageChain->findAllObjectsOfType(STATIC_TYPE_INFO(ossimImageHandler), false);
+
+                  for (ossim_uint32 h= 0; h < imageHandlers.size(); h++)
+                  {
+                     ossimImageHandler* handler =
+                           PTR_CAST(ossimImageHandler, imageHandlers[h].get());
+                     if (handler)
+                     {
+                        if (handler->getLut() != 0) //
+                        {
+                           colorLut = handler->getLut();
+                           needColorLut = true;
+                        }
+                        else //if not all handlers have color luts, ignore the color lut.
+                        {
+                           needColorLut = false;
+                           needLoop = false;
+                           break;
+                        }
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+
+   if (needColorLut && colorLut != 0)
+   {
+      setLut(*colorLut.get());
+   }
+#endif
+}
+
+bool ossimTiffWriter::writeFile()
+
+{
+   static const char MODULE[] = "ossimTiffWriter::writeFile";
+
+   if (traceDebug()) CLOG << "Entered..." << std::endl;
+
+   //checkColorLut();
+
+   if(isLutEnabled())
+   {
+      theNBandToIndexFilter = new ossimNBandToIndexFilter;
+      theNBandToIndexFilter->connectMyInputTo(0, theInputConnection->getInput());
+      theNBandToIndexFilter->setLut(*theColorLut.get());
+      theNBandToIndexFilter->initialize();
+      theInputConnection->disconnect();
+      theInputConnection->connectMyInputTo(0, theNBandToIndexFilter.get());
+      theInputConnection->initialize();
+   }
+   else
+   {
+      theNBandToIndexFilter = 0;
+   }
+
+   if (traceDebug() && theInputConnection.get())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+               << MODULE << "DEBUG:"
+               << "\nnull:  " << theInputConnection->getNullPixelValue()
+               << "\nmin:   " << theInputConnection->getMinPixelValue()
+               << "\nmax:   " << theInputConnection->getMaxPixelValue()
+               << std::endl;
+   }
+
+   if (isTiled())
+   {
+      if ( (theInputConnection->getTileWidth()  !=
+            static_cast<ossim_uint32>(theOutputTileSize.x)) ||
+            (theInputConnection->getTileHeight() !=
+                  static_cast<ossim_uint32>(theOutputTileSize.y)) )
+      {
+         theInputConnection->setTileSize(theOutputTileSize);
+      }
+   }
+
+   if(!theInputConnection->isMaster())
+   {
+      theInputConnection->slaveProcessTiles();
+
+      if(theNBandToIndexFilter.valid())
+      {
+         theInputConnection->connectMyInputTo(0, theNBandToIndexFilter->getInput());
+         theNBandToIndexFilter = 0;
+      }
+
+      return true;
+   }
+
+   open();
+
+   if (!isOpen())
+   {
+      if (traceDebug())
+      {
+         CLOG << " ERROR:  Could not open!  Returning..." << std::endl;
+      }
+
+      return false;
+   }
+
+   if(!theInputConnection)
+   {
+      if (traceDebug())
+      {
+         CLOG << " ERROR:  No input connection!  Returning..." << std::endl;
+      }
+
+      return false;
+   }
+
+   // First write the tiff tags.
+   if (writeTiffTags() == false)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+                  << MODULE << " ERROR:"
+                  << "\nError detected writing tiff tags.  Returning..." << std::endl;
+         return false;
+      }
+   }
+
+   // Write the geotiff tags.
+   if (theOutputGeotiffTagsFlag)
+   {
+      if(theViewController.get()) // let this override
+      {                     // found in ossimImageWriter base
+         ossimMapProjection* proj = PTR_CAST(ossimMapProjection,
+                                             theViewController->getView());
+         if(proj)
+         {
+            ossimRefPtr<ossimMapProjectionInfo> projectionInfo
+            = new ossimMapProjectionInfo(proj, theAreaOfInterest);
+            projectionInfo->setPixelType(thePixelType);
+
+            if (writeGeotiffTags(projectionInfo) == false)
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                           << MODULE << " ERROR:"
+                           << "\nError detected writing geotiff tags.  Returning..."
+                           << std::endl;
+               }
+               return false;
+            }
+         }
+      }
+      else if(theProjectionInfo.valid())
+      {
+         theProjectionInfo->setPixelType(thePixelType);
+         if (writeGeotiffTags(theProjectionInfo) == false)
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                        << MODULE << " ERROR:"
+                        << "\nError detected writing geotiff tags.  Returning..."
+                        << std::endl;
+            }
+            return false;
+         }
+      }
+      else
+      {
+         // Fetch the map projection of the input image if it exists:
+         ossimMapProjection* mapProj = 0;
+         ossimRefPtr<ossimImageGeometry> imgGeom = theInputConnection->getImageGeometry();
+         if ( imgGeom.valid() )
+         {
+            const ossimProjection* proj = imgGeom->getProjection();
+            mapProj = PTR_CAST(ossimMapProjection, proj);
+         }
+         if(mapProj)
+         {
+            ossimRefPtr<ossimMapProjectionInfo> projectionInfo
+            = new ossimMapProjectionInfo(mapProj, theAreaOfInterest);
+
+            projectionInfo->setPixelType(thePixelType);
+            if (writeGeotiffTags(projectionInfo) == false)
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                           << MODULE << " ERROR:"
+                           << "\nError detected writing geotiff tags.  Returning..."
+                           << std::endl;
+               }
+               return false;
+            }
+         }
+      }
+
+   } // End of "if (theOutputGeotiffTagsFlag)"
+
+   // Write the file with the image data.
+   bool status = false;
+   if(theOutputImageType == "tiff_strip")
+   {
+      status = writeToStrips();
+   }
+   else if(theOutputImageType == "tiff_strip_band_separate")
+   {
+      status = writeToStripsBandSep();
+   }
+   else if((theOutputImageType == "tiff_tiled")||
+         (ossimString::downcase(theOutputImageType) == "image/tiff")||
+         (ossimString::downcase(theOutputImageType) == "image/tif")||
+         (ossimString::downcase(theOutputImageType) == "image/gtif")||
+         (ossimString::downcase(theOutputImageType) == "image/gtiff"))
+   {
+      status = writeToTiles();
+   }
+   else if(theOutputImageType == "tiff_tiled_band_separate")
+   {
+      status = writeToTilesBandSep();
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+                  << MODULE << " ERROR:"
+                  << "\nUnsupported output type:  " << theOutputImageType
+                  << std::endl;
+      }
+   }
+
+   close();
+
+   if (traceDebug()) CLOG << " Exited..." << std::endl;
+
+   if(theNBandToIndexFilter.valid())
+   {
+      theInputConnection->connectMyInputTo(0, theNBandToIndexFilter->getInput());
+      theNBandToIndexFilter = 0;
+   }
+
+   return status;
+}
+
+void ossimTiffWriter::setLut(const ossimNBandLutDataObject& lut)
+{
+   theColorLutFlag = true;
+   theColorLut = (ossimNBandLutDataObject*)lut.dup();
+}
+
+bool ossimTiffWriter::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   kwl.add(prefix,
+           "output_geotiff_flag",
+           (int)theOutputGeotiffTagsFlag,
+           true);
+
+   kwl.add(prefix,
+           TIFF_WRITER_OUTPUT_TILE_SIZE_X_KW,
+           theOutputTileSize.x,
+           true);
+
+   kwl.add(prefix,
+           TIFF_WRITER_OUTPUT_TILE_SIZE_Y_KW,
+           theOutputTileSize.y,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::COMPRESSION_QUALITY_KW,
+           theJpegQuality,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::COMPRESSION_TYPE_KW,
+           theCompressionType,
+           true);
+
+   kwl.add(prefix,
+           "color_lut_flag",
+           (ossim_uint32)theColorLutFlag,
+           true);
+
+   if(theColorLutFlag)
+   {
+      if(theLutFilename != "")
+      {
+         kwl.add(prefix,
+                 "lut_filename",
+                 theLutFilename.c_str(),
+                 true);
+      }
+      else
+      {
+         ossimString newPrefix = ossimString(prefix) + "lut.";
+         theColorLut->saveState(kwl, newPrefix.c_str());
+      }
+   }
+
+
+   return ossimImageFileWriter::saveState(kwl,
+                                          prefix);
+}
+
+bool ossimTiffWriter::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   const char *value;
+
+   ossimIpt defaultTileSize;
+   ossim::defaultTileSize(defaultTileSize);
+
+   value = kwl.find(prefix,
+                    TIFF_WRITER_OUTPUT_TILE_SIZE_X_KW);
+   if(value)
+   {
+      theOutputTileSize.x = ossimString(value).toLong();
+      if(theOutputTileSize.x<1)
+      {
+         theOutputTileSize.x = defaultTileSize.x;
+      }
+   }
+
+   value = kwl.find(prefix,
+                    TIFF_WRITER_OUTPUT_TILE_SIZE_Y_KW);
+   if(value)
+   {
+      theOutputTileSize.y = ossimString(value).toLong();
+      if(theOutputTileSize.y<1)
+      {
+         theOutputTileSize.y = defaultTileSize.y;
+      }
+   }
+
+
+   value = kwl.find(prefix, ossimKeywordNames::COMPRESSION_TYPE_KW);
+   if(value)
+   {
+      theCompressionType = ossimString(value).downcase();
+   }
+   else
+   {
+      theCompressionType = "none";
+   }
+
+   value = kwl.find(prefix, ossimKeywordNames::COMPRESSION_QUALITY_KW);
+   if(value)
+   {
+      setJpegQuality(ossimString(value).toLong());
+   }
+
+   value = kwl.find(prefix, ossimKeywordNames::PHOTOMETRIC_KW);
+   if(value)
+   {
+      thePhotoMetric = ossimString(value).downcase();
+   }
+
+   value = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   if(value)
+   {
+      setFilename(ossimFilename(value));
+   }
+
+   const char* flag = kwl.find(prefix, "output_geotiff_flag");
+   if(flag)
+   {
+      theOutputGeotiffTagsFlag = ossimString(flag).toBool();
+   }
+
+   ossimString newPrefix = ossimString(prefix) + "lut.";
+
+   const char* colorLutFlag = kwl.find(prefix, "color_lut_flag");
+   if(colorLutFlag)
+   {
+      theColorLutFlag = ossimString(colorLutFlag).toBool();
+   }
+   else
+   {
+      theColorLutFlag = false;
+   }
+   theLutFilename = ossimFilename(kwl.find(prefix, "lut_filename"));
+
+   theLutFilename = ossimFilename(theLutFilename.trim());
+   if(theLutFilename != "")
+   {
+      theColorLut->open(theLutFilename);
+   }
+   else
+   {
+      theColorLut->loadState(kwl, newPrefix.c_str());
+   }
+
+   if(ossimImageFileWriter::loadState(kwl,
+                                      prefix))
+   {
+      if((theOutputImageType!="tiff_tiled") &&
+            (theOutputImageType!="tiff_tiled_band_separate") &&
+            (theOutputImageType!="tiff_strip") &&
+            (theOutputImageType!="tiff_strip_band_separate")&&
+            (theOutputImageType!="image/tiff")&&
+            (theOutputImageType!="image/tif")&&
+            (theOutputImageType!="image/gtif")&&
+            (theOutputImageType!="image/gtiff"))
+      {
+
+         theOutputImageType = "tiff_tiled_band_separate";;
+      }
+   }
+   else
+   {
+      return false;
+   }
+
+   return true;
+}
+
+bool ossimTiffWriter::isTiled() const
+{
+   return ( theOutputImageType == "tiff_tiled" ||
+         theOutputImageType == "image/tiff" ||
+         theOutputImageType == "image/tif" ||
+         theOutputImageType == "image/gtif" ||
+         theOutputImageType == "image/gtiff" ||
+         theOutputImageType == "tiff_tiled_band_separate" );
+}
+
+bool ossimTiffWriter::writeToTiles()
+{
+   static const char* const MODULE = "ossimTiffWriter::writeToTiles";
+   TIFF* tiffPtr = (TIFF*)theTif;
+
+   if (traceDebug()) CLOG << " Entered." << std::endl;
+
+   // Start the sequence at the first tile.
+   theInputConnection->setToStartOfSequence();
+
+   ossimRefPtr<ossimImageData> tempTile = 0;
+
+   if(theColorLutFlag)
+   {
+      tempTile = ossimImageDataFactory::instance()->create(this, 1, theInputConnection.get());
+   }
+   else
+   {
+      tempTile = ossimImageDataFactory::instance()->create(this, theInputConnection.get());
+   }
+   if(tempTile.valid())
+   {
+      tempTile->initialize();
+   }
+   ossim_uint32 tilesWide       = theInputConnection->getNumberOfTilesHorizontal();
+   ossim_uint32 tilesHigh       = theInputConnection->getNumberOfTilesVertical();
+   ossim_uint32 tileWidth       = theInputConnection->getTileWidth();
+   ossim_uint32 tileHeight      = theInputConnection->getTileHeight();
+   ossim_uint32 numberOfTiles   = theInputConnection->getNumberOfTiles();
+
+   // Tile loop in the height direction.
+   ossim_uint32 tileNumber = 0;
+   vector<ossim_float64> minBands;
+   vector<ossim_float64> maxBands;
+   for(ossim_uint32 i = 0; ((i < tilesHigh)&&!needsAborting()); i++)
+   {
+      ossimIpt origin(0,0);
+      origin.y = i * tileHeight;
+
+      // Tile loop in the sample (width) direction.
+      for(ossim_uint32 j = 0; ((j < tilesWide)&&!needsAborting()); j++)
+      {
+         origin.x = j * tileWidth;
+
+         // Grab the tile.
+         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
+         if (!id)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " ERROR:"
+                     << "Error returned writing tiff tile:  " << tileNumber
+                     << "\nNULL Tile encountered"
+                     << std::endl;
+            return false;
+         }
+
+         ossimDataObjectStatus  tileStatus      = id->getDataObjectStatus();
+         ossim_uint32           tileSizeInBytes = id->getSizeInBytes();
+         if (tileStatus != OSSIM_FULL)
+         {
+            // Clear out the buffer since it won't be filled all the way.
+            tempTile->setImageRectangle(id->getImageRectangle());
+            tempTile->makeBlank();
+         }
+
+         if ((tileStatus == OSSIM_PARTIAL || tileStatus == OSSIM_FULL))
+         {
+            // Stuff the tile into the tileBuffer.
+            id->unloadTile(tempTile->getBuf(),
+                           id->getImageRectangle(),
+                           OSSIM_BIP);
+            tempTile->setDataObjectStatus(id->getDataObjectStatus());
+            if(!theColorLutFlag&&!needsAborting())
+            {
+               id->computeMinMaxPix(minBands, maxBands);
+            }
+         }
+
+         //---
+         // Write the tile to disk.
+         //---
+         ossim_uint32 bytesWritten = 0;
+         bytesWritten = TIFFWriteTile(tiffPtr,
+                                      tempTile->getBuf(),
+                                      origin.x,
+                                      origin.y,
+                                      0,            // z
+                                      0);           // s
+
+         if (bytesWritten != tileSizeInBytes)
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                        << MODULE << " ERROR:"
+                        << "Error returned writing tiff tile:  " << i
+                        << "\nExpected bytes written:  " << tileSizeInBytes
+                        << "\nBytes written:  " << bytesWritten
+                        << std::endl;
+            }
+            setErrorStatus();
+            return false;
+         }
+
+         ++tileNumber;
+
+      } // End of tile loop in the sample (width) direction.
+
+      double tile = tileNumber;
+      double numTiles = numberOfTiles;
+      setPercentComplete(tile / numTiles * 100);
+
+   } // End of tile loop in the line (height) direction.
+
+   if(!theColorLutFlag&&!needsAborting())
+   {
+      writeMinMaxTags(minBands, maxBands);
+   }
+
+   if (traceDebug()) CLOG << " Exited." << std::endl;
+
+   return true;
+}
+
+bool ossimTiffWriter::writeToTilesBandSep()
+{
+   static const char* const MODULE = "ossimTiffWriter::writeToTilesBandSep";
+   TIFF* tiffPtr = (TIFF*)theTif;
+   if (traceDebug()) CLOG << " Entered." << std::endl;
+
+   // Start the sequence at the first tile.
+   theInputConnection->setToStartOfSequence();
+
+   ossim_uint32 bands     = theInputConnection->getNumberOfOutputBands();
+   ossim_uint32 tilesWide = theInputConnection->getNumberOfTilesHorizontal();
+   ossim_uint32 tilesHigh = theInputConnection->getNumberOfTilesVertical();
+   ossim_uint32 tileWidth     = theInputConnection->getTileWidth();
+   ossim_uint32 tileHeight    = theInputConnection->getTileHeight();
+   ossim_uint32 numberOfTiles = theInputConnection->getNumberOfTiles();
+
+#if 0
+   if(traceDebug())
+   {
+      ossimIrect   boundingRect  = theInputConnection->getBoundingRect();
+      ossimNotify(ossimNotifyLevel_NOTICE)
+      << "Bounding rect = " << boundingRect
+      << "\nBands         = " << bands
+      << "\ntilesWide     = " << tilesWide
+      << "\ntilesHigh     = " << tilesHigh
+      << "\ntileWidth     = " << tileWidth
+      << "\ntileHeight    = " << tileHeight << std::endl;
+   }
+#endif
+
+   ossim_uint32 tileNumber = 0;
+   vector<ossim_float64> minBands;
+   vector<ossim_float64> maxBands;
+   for(ossim_uint32 i = 0; ((i < tilesHigh)&&!needsAborting()); ++i)
+   {
+      ossimIpt origin;
+      origin.y = i * tileHeight;
+
+      //---
+      // Tile loop in the sample (width) direction.
+      //---
+      for(ossim_uint32 j = 0; ((j < tilesWide)&&!needsAborting()); ++j)
+      {
+         origin.x = j * tileWidth;
+
+         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
+         if(!id)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " ERROR:"
+                     << "Error returned writing tiff tile:  " << i
+                     << "\nNULL Tile encountered"
+                     << std::endl;
+            return false;
+         }
+         ossim_int32 tileSizeInBytes = id->getSizePerBandInBytes();
+
+         if(!theColorLutFlag)
+         {
+            id->computeMinMaxPix(minBands, maxBands);
+         }
+
+         //---
+         // Band loop.
+         //---
+         for (ossim_uint32 band=0; ((band<bands)&&(!needsAborting())); ++band)
+         {
+            // Grab a pointer to the tile for the band.
+            tdata_t* data = (tdata_t*)id->getBuf(band);
+            // Write the tile.
+            tsize_t bytesWritten = 0;
+            if(data)
+            {
+               bytesWritten = TIFFWriteTile(tiffPtr,
+                                            data,
+                                            (ossim_uint32)origin.x,
+                                            (ossim_uint32)origin.y,
+                                            (ossim_uint32)0,        // z
+                                            (tsample_t)band);    // sample
+            }
+            if ( ( bytesWritten != tileSizeInBytes ) && !needsAborting() )
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                           << MODULE << " ERROR:"
+                           << "Error returned writing tiff tile:  " << i
+                           << "\nExpected bytes written:  " << tileSizeInBytes
+                           << "\nBytes written:  " << bytesWritten
+                           << std::endl;
+               }
+               setErrorStatus();
+               return false;
+            }
+
+         } // End of band loop.
+
+         ++tileNumber;
+
+      } // End of tile loop in the sample (width) direction.
+
+      double tile = tileNumber;
+      double numTiles = numberOfTiles;
+      setPercentComplete(tile / numTiles * 100);
+      if(needsAborting())
+      {
+         setPercentComplete(100);
+      }
+
+   } // End of tile loop in the line (height) direction.
+
+   if(!theColorLutFlag&&!needsAborting())
+   {
+      writeMinMaxTags(minBands, maxBands);
+   }
+
+   if (traceDebug()) CLOG << " Exited." << std::endl;
+
+   return true;
+}
+
+bool ossimTiffWriter::writeToStrips()
+{
+   static const char* const MODULE = "ossimTiffWriter::writeToStrips";
+   TIFF* tiffPtr = (TIFF*)theTif;
+
+   if (traceDebug()) CLOG << " Entered." << std::endl;
+
+   // Start the sequence at the first tile.
+   theInputConnection->setToStartOfSequence();
+
+   ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
+   ossim_uint32 tilesWide = theInputConnection->getNumberOfTilesHorizontal();
+   ossim_uint32 tilesHigh = theInputConnection->getNumberOfTilesVertical();
+   ossim_uint32 tileHeight = theInputConnection->getTileHeight();
+   ossim_uint32 numberOfTiles = theInputConnection->getNumberOfTiles();
+   ossim_uint32 width = theAreaOfInterest.width();
+   ossim_uint32 bytesInLine =
+         ossim::scalarSizeInBytes(theInputConnection->getOutputScalarType()) *
+         width * bands;
+
+   //---
+   // Buffer to hold one line x tileHeight
+   //---
+   ossim_uint32 bufferSizeInBytes = bytesInLine * tileHeight;
+   unsigned char* buffer = new unsigned char[bufferSizeInBytes];
+
+   int tileNumber = 0;
+   vector<ossim_float64> minBands;
+   vector<ossim_float64> maxBands;
+   for(ossim_uint32 i = 0; ((i < tilesHigh)&&(!needsAborting())); ++i)
+   {
+      // Clear the buffer.
+      memset(buffer, 0, bufferSizeInBytes);
+
+      // Set the buffer rectangle.
+      ossimIrect bufferRect(theAreaOfInterest.ul().x,
+                            theAreaOfInterest.ul().y + i * tileHeight,
+                            theAreaOfInterest.ul().x + width - 1,
+                            theAreaOfInterest.ul().y + i * tileHeight +
+                            tileHeight - 1);
+
+      // Tile loop in the sample (width) direction.
+      for(ossim_uint32 j = 0; ((j < tilesWide)&&(!needsAborting())); ++j)
+      {
+         // Get the tile and copy it to the buffer.
+         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
+         if (!id)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " ERROR:"
+                     << "Error returned writing tiff tile:  " << tileNumber
+                     << "\nNULL Tile encountered"
+                     << std::endl;
+            delete [] buffer;
+            return false;
+         }
+         id->unloadTile(buffer, bufferRect, OSSIM_BIP);
+         if(!theColorLutFlag&&!needsAborting())
+         {
+            id->computeMinMaxPix(minBands, maxBands);
+         }
+         ++tileNumber;
+      }
+
+      // Get the number of lines to write from the buffer.
+      ossim_uint32 linesToWrite = min(tileHeight, static_cast<ossim_uint32>(theAreaOfInterest.lr().y - bufferRect.ul().y + 1));
+
+      // Write the buffer out to disk.
+      ossim_uint32 row = static_cast<ossim_uint32>(bufferRect.ul().y -
+                                                   theAreaOfInterest.ul().y);
+      ossim_uint8* buf = buffer;
+      for (ossim_uint32 ii=0; ((ii<linesToWrite)&&(!needsAborting())); ++ii)
+      {
+         ossim_int32 status = TIFFWriteScanline(tiffPtr,
+                                                buf,
+                                                row,
+                                                0);
+         if (status == -1)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " ERROR:"
+                     << "Error returned writing tiff scanline:  " << row
+                     << std::endl;
+            setErrorStatus();
+            delete [] buffer;
+            return false;
+         }
+
+         ++row;  // Increment the line number.
+         buf += bytesInLine;
+
+      } // End of loop to write lines from buffer to tiff file.
+
+      double tile = tileNumber;
+      double numTiles = numberOfTiles;
+      setPercentComplete(tile / numTiles * 100);
+      if(needsAborting())
+      {
+         setPercentComplete(100);
+      }
+
+   } // End of loop in the line (height) direction.
+
+   if(!theColorLutFlag)
+   {
+      writeMinMaxTags(minBands, maxBands);
+   }
+
+   // Free the memory.
+   delete [] buffer;
+
+   if (traceDebug()) CLOG << " Exited." << std::endl;
+
+   return true;
+}
+
+bool ossimTiffWriter::writeToStripsBandSep()
+{
+   static const char* const MODULE = "ossimTiffWriter::writeToStripsBandSep";
+   TIFF* tiffPtr = (TIFF*)theTif;
+
+   if (traceDebug()) CLOG << " Entered." << std::endl;
+
+   // Start the sequence at the first tile.
+   theInputConnection->setToStartOfSequence();
+
+   ossim_uint32 bands = theInputConnection->getNumberOfOutputBands();
+   ossim_uint32 tilesWide = theInputConnection->getNumberOfTilesHorizontal();
+   ossim_uint32 tilesHigh = theInputConnection->getNumberOfTilesVertical();
+   ossim_uint32 tileHeight      = theInputConnection->getTileHeight();
+   ossim_uint32 numberOfTiles   = theInputConnection->getNumberOfTiles();
+   ossim_uint32 width           = theAreaOfInterest.width();
+   ossim_uint32 bytesInLine     =
+         ossim::scalarSizeInBytes(theInputConnection->getOutputScalarType()) *
+         width;
+
+   //---
+   // Buffer to hold one line x tileHeight
+   //---
+   ossim_uint32 bufferSizeInBytes = bytesInLine * tileHeight * bands;
+
+   unsigned char* buffer = new unsigned char[bufferSizeInBytes];
+
+   // Tile loop in height direction.
+   ossim_uint32 tileNumber = 0;
+   vector<ossim_float64> minBands;
+   vector<ossim_float64> maxBands;
+   for(ossim_uint32 i = 0; ((i < tilesHigh)&&(!needsAborting())); ++i)
+   {
+      // Clear the buffer.
+      memset(buffer, 0, bufferSizeInBytes);
+
+      // Set the buffer rectangle.
+      ossimIrect bufferRect(theAreaOfInterest.ul().x,
+                            theAreaOfInterest.ul().y + i * tileHeight,
+                            theAreaOfInterest.ul().x + width - 1,
+                            theAreaOfInterest.ul().y + i * tileHeight +
+                            tileHeight - 1);
+
+      // Tile loop in the sample (width) direction.
+      for(ossim_uint32 j = 0; ((j < tilesWide)&&(!needsAborting())); ++j)
+      {
+         // Get the tile and copy it to the buffer.
+         ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
+         if (!id)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+                     << MODULE << " ERROR:"
+                     << "Error returned writing tiff tile:  " << tileNumber
+                     << "\nNULL Tile encountered"
+                     << std::endl;
+            delete [] buffer;
+            return false;
+         }
+         id->unloadTile(buffer, bufferRect, OSSIM_BIL);
+         if(!theColorLutFlag)
+         {
+            id->computeMinMaxPix(minBands, maxBands);
+         }
+         ++tileNumber;
+      }
+
+      // Get the number of lines to write from the buffer.
+      ossim_uint32 linesToWrite = min(tileHeight, static_cast<ossim_uint32>(theAreaOfInterest.lr().y - bufferRect.ul().y + 1));
+
+      // Write the buffer out to disk.
+      ossim_uint32 row = static_cast<ossim_uint32>(bufferRect.ul().y -
+                                                   theAreaOfInterest.ul().y);
+      ossim_uint8* buf = buffer;
+      for (ossim_uint32 ii=0; ((ii<linesToWrite)&&(!needsAborting())); ++ii)
+      {
+         for (ossim_uint32 band =0; ((band<bands)&&(!needsAborting())); ++band)
+         {
+            ossim_int32 status = TIFFWriteScanline(tiffPtr,
+                                                   buf,
+                                                   row,
+                                                   band);
+            if (status == -1)
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                        << MODULE << " ERROR:"
+                        << "Error returned writing tiff scanline:  " << row
+                        << std::endl;
+               delete [] buffer;
+               return false;
+            }
+            buf += bytesInLine;
+         }
+
+         ++row;  // Increment the line number.
+
+      } // End of loop to write lines from buffer to tiff file.
+
+      double tile = tileNumber;
+      double numTiles = numberOfTiles;
+      setPercentComplete(tile / numTiles * 100);
+      if(needsAborting())
+      {
+         setPercentComplete(100);
+      }
+   } // End of loop in the line (height) direction.
+
+   if(!theColorLutFlag)
+   {
+      writeMinMaxTags(minBands, maxBands);
+   }
+
+   // Free the memory.
+   delete [] buffer;
+
+   if (traceDebug()) CLOG << " Exited." << std::endl;
+
+   return true;
+}
+
+void ossimTiffWriter::setTileSize(const ossimIpt& tileSize)
+{
+   if ( (tileSize.x % 16) || (tileSize.y % 16) )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimTiffWriter::changeTileSize ERROR:"
+                  << "\nTile size must be a multiple of 32!"
+                  << "\nSize remains:  " << theOutputTileSize
+                  << std::endl;
+      }
+      return;
+   }
+
+   theOutputTileSize = tileSize;
+}
+
+void ossimTiffWriter::writeMinMaxTags(const vector<ossim_float64>& minBand,
+                                      const vector<ossim_float64>& maxBand)
+{
+   TIFF* tiffPtr = (TIFF*)theTif;
+   if(minBand.size() && maxBand.size())
+   {
+      ossim_float64 minValue =
+            *std::min_element(minBand.begin(), minBand.end());
+      ossim_float64 maxValue =
+            *std::max_element(maxBand.begin(), maxBand.end());
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimTiffWriter::writeMinMaxTags DEBUG:"
+                  << "\nminValue:  " << minValue
+                  << "\nmaxValue:  " << maxValue
+                  << std::endl;
+      }
+
+      switch( theInputConnection->getOutputScalarType() )
+      {
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         TIFFSetField( tiffPtr, TIFFTAG_MINSAMPLEVALUE,
+                       static_cast<ossim_sint16>(0) );
+         TIFFSetField( tiffPtr, TIFFTAG_MAXSAMPLEVALUE,
+                       static_cast<ossim_sint16>(2047) );
+         break;
+      }
+      case OSSIM_UINT8:
+      case OSSIM_UINT16:
+      {
+         TIFFSetField( tiffPtr, TIFFTAG_MINSAMPLEVALUE,
+                       static_cast<ossim_sint16>(minValue) );
+         TIFFSetField( tiffPtr, TIFFTAG_MAXSAMPLEVALUE,
+                       static_cast<ossim_sint16>(maxValue) );
+         break;
+      }
+
+      case OSSIM_SINT16:
+      case OSSIM_UINT32:
+      case OSSIM_FLOAT32:
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         TIFFSetField( tiffPtr, TIFFTAG_SMINSAMPLEVALUE,
+                       static_cast<ossim_float32>(minValue) );
+         TIFFSetField( tiffPtr, TIFFTAG_SMAXSAMPLEVALUE,
+                       static_cast<ossim_float32>(maxValue) );
+         break;
+      }
+      default:
+      {
+         break;
+      }
+      }
+   }
+}
+
+void ossimTiffWriter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property)
+   {
+      return;
+   }
+
+   if(property->getName() == ossimKeywordNames::COMPRESSION_QUALITY_KW)
+   {
+      //       ossimNumericProperty* numericProperty = PTR_CAST(ossimNumericProperty,
+      //                                                        property.get());
+      //       if (numericProperty)
+      //       {
+      setJpegQuality( property->valueToString().toInt32() );
+      //       }
+   }
+   else if (property->getName() == ossimKeywordNames::COMPRESSION_TYPE_KW)
+   {
+      ossimStringProperty* stringProperty = PTR_CAST(ossimStringProperty,
+                                                     property.get());
+      if (stringProperty)
+      {
+         ossimString s;
+         stringProperty->valueToString(s);
+         setCompressionType(s);
+      } 
+   }
+   else if(property->getName() == "lut_file")
+   {
+      theLutFilename = ossimFilename(property->valueToString());
+      theColorLut->open(theLutFilename);
+   }
+   else if(property->getName() == "color_lut_flag")
+   {
+      theColorLutFlag = property->valueToString().toBool();
+   }
+   else if(property->getName() == "big_tiff_flag")
+   {
+      theForceBigTiffFlag = property->valueToString().toBool();
+   }
+   else if(property->getName() == ossimKeywordNames::OUTPUT_TILE_SIZE_KW)
+   {
+      theOutputTileSize.x = property->valueToString().toInt32();
+      theOutputTileSize.y =  theOutputTileSize.x;
+   }
+   else
+   {
+      ossimImageFileWriter::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimTiffWriter::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+
+   if (name == "Filename")
+   {
+      prop = ossimImageFileWriter::getProperty(name);
+      if ( prop.valid() )
+      {
+         ossimRefPtr<ossimFilenameProperty> filenameProp = PTR_CAST(ossimFilenameProperty,
+                                                                    prop.get());
+         if ( filenameProp.valid() )
+         {
+            filenameProp->addFilter("*.tif");
+         }
+         prop = filenameProp.get();
+      }
+   }
+   else if (name == ossimKeywordNames::COMPRESSION_QUALITY_KW)
+   {
+      ossimRefPtr<ossimNumericProperty> numericProp =
+            new ossimNumericProperty(name,
+                                     ossimString::toString(theJpegQuality),
+                                     1.0,
+                                     100.0);
+      numericProp->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT);
+      prop = numericProp.get();
+   }
+   else if (name == ossimKeywordNames::COMPRESSION_TYPE_KW)
+   {
+      ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty(name,
+                                    getCompressionType(),
+                                    false); // editable flag
+      stringProp->addConstraint(ossimString("none"));
+      stringProp->addConstraint(ossimString("jpeg"));
+      stringProp->addConstraint(ossimString("lzw"));      
+      stringProp->addConstraint(ossimString("packbits"));
+      stringProp->addConstraint(ossimString("deflate"));
+      stringProp->addConstraint(ossimString("zip"));      
+      prop = stringProp.get();
+   }
+   else if (name == "lut_file")
+   {
+      ossimRefPtr<ossimFilenameProperty> property =
+            new ossimFilenameProperty(name, theLutFilename);
+      property->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+
+      prop = property.get();
+   }
+   else if (name == "color_lut_flag")
+   {
+      prop = new ossimBooleanProperty(name, theColorLutFlag);
+   }
+   else if(name == "big_tiff_flag")
+   {
+      prop = new ossimBooleanProperty(name, theForceBigTiffFlag);
+   }
+   else if( name == ossimKeywordNames::OUTPUT_TILE_SIZE_KW )
+   {
+      ossimRefPtr<ossimStringProperty> stringProp =
+            new ossimStringProperty(name,
+                                    ossimString::toString(theOutputTileSize.x),
+                                    false); // editable flag
+      stringProp->addConstraint(ossimString("16"));
+      stringProp->addConstraint(ossimString("32"));
+      stringProp->addConstraint(ossimString("64"));
+      stringProp->addConstraint(ossimString("128"));
+      stringProp->addConstraint(ossimString("256"));      
+      stringProp->addConstraint(ossimString("512"));      
+      stringProp->addConstraint(ossimString("1024"));      
+      stringProp->addConstraint(ossimString("2048"));
+      prop = stringProp.get();
+   }
+   else
+   {
+      prop = ossimImageFileWriter::getProperty(name);
+   }
+   return prop;
+}
+
+void ossimTiffWriter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(ossimString(
+         ossimKeywordNames::COMPRESSION_QUALITY_KW));
+   propertyNames.push_back(ossimString(
+         ossimKeywordNames::COMPRESSION_TYPE_KW));
+   propertyNames.push_back(ossimString("lut_file"));
+   propertyNames.push_back(ossimString("color_lut_flag"));
+   propertyNames.push_back(ossimString("big_tiff_flag"));
+   propertyNames.push_back(ossimString(ossimKeywordNames::OUTPUT_TILE_SIZE_KW));
+
+   ossimImageFileWriter::getPropertyNames(propertyNames);
+}
+
+bool ossimTiffWriter::isOpen()const
+{
+   return (theTif!=NULL);
+}
+
+bool ossimTiffWriter::open()
+{
+   if(theTif)
+   {
+      closeTiff();
+   }
+   return openTiff();
+}
+
+void ossimTiffWriter::close()
+{
+   closeTiff();
+}
+
+void ossimTiffWriter::setJpegQuality(ossim_int32 quality)
+{
+   // Range 1 to 100 with 100 being best.
+   if (quality > 0 && quality < 101)
+   {
+      theJpegQuality = quality;
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimTiffWriter::setJpegQuality DEBUG:"
+                  << "\nquality out of range:  " << quality
+                  << "\nquality has been set to default:  "
+                  << DEFAULT_JPEG_QUALITY
+                  << "\nvalid range:  1 to 100 with 100 being best."
+                  << std::endl;
+      }
+
+      theJpegQuality = DEFAULT_JPEG_QUALITY;
+   }
+}
+
+ossim_int32 ossimTiffWriter::getJpegQuality()const
+{
+
+   return theJpegQuality;
+}
+
+void ossimTiffWriter::setCompressionType(const ossimString& type)
+{
+   theCompressionType = type;
+}
+
+ossimString ossimTiffWriter::getCompressionType()const
+{
+   return theCompressionType;
+}
+
+bool ossimTiffWriter::getGeotiffFlag()const
+{
+   return theOutputGeotiffTagsFlag;
+}
+
+void ossimTiffWriter::setGeotiffFlag(bool flag)
+{
+   theOutputGeotiffTagsFlag = flag;
+}
+
+ossimIpt ossimTiffWriter::getOutputTileSize()const
+{
+   return theOutputTileSize;
+}
+
+ossim_int32 ossimTiffWriter::setProjectionInfo(const ossimMapProjectionInfo& proj)
+{
+   theProjectionInfo = new ossimMapProjectionInfo(proj);
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+
+void ossimTiffWriter::getImageTypeList(std::vector<ossimString>& imageTypeList)const
+{
+   imageTypeList.push_back(ossimString("tiff_strip"));
+   imageTypeList.push_back(ossimString("tiff_strip_band_separate"));
+   imageTypeList.push_back(ossimString("tiff_tiled"));
+   imageTypeList.push_back(ossimString("tiff_tiled_band_separate"));
+}
+
+ossimString ossimTiffWriter::getExtension() const
+{
+   return ossimString("tif");
+}
+
+bool ossimTiffWriter::hasImageType(const ossimString& imageType) const
+{
+   // check for non image type list types
+   // We will support mime type
+   //
+   if((imageType == "image/tiff")||
+         (imageType == "image/gtiff")||
+         (imageType == "image/tif")||
+         (imageType == "image/gtif"))
+   {
+      return true;
+   }
+
+   return ossimImageFileWriter::hasImageType(imageType);
+}
+
+bool ossimTiffWriter::isLutEnabled()const
+{
+   return (theColorLutFlag);
+}
+
+ossimTiffWriter::UnitType ossimTiffWriter::getUnitType(
+      ossim_int32 pcsCode,
+      const ossimString& projName) const
+{
+
+
+   if ( ( projName == "ossimCylEquAreaProjection" ) ||
+         ( projName == "ossimEquDistCylProjection" ) ||
+         ( projName == "ossimLlxyProjection" ) )
+   {
+      return ANGULAR_DEGREES;
+   } 
+
+   UnitType pcsUnits = getPcsUnitType(pcsCode);
+
+   UnitType type = UNDEFINED;
+
+   switch (theLinearUnits)
+   {
+   case OSSIM_METERS:
+   {
+      type = LINEAR_METER;
+      break;
+   }
+
+   case OSSIM_FEET:
+   {
+      type = LINEAR_FOOT;
+      break;
+   }
+
+   case OSSIM_US_SURVEY_FEET:
+   {
+      type = LINEAR_FOOT_US_SURVEY;
+      break;
+   }
+   default:
+   {
+      break;
+   }
+   }
+   if (type == UNDEFINED)
+   {
+      return pcsUnits;
+   }
+   return type;
+}
+
+ossimTiffWriter::UnitType ossimTiffWriter::getPcsUnitType(ossim_int32 pcsCode) const
+{
+   UnitType pcsUnits = UNDEFINED;
+
+   ossimRefPtr<ossimMapProjection> proj = PTR_CAST(ossimMapProjection, 
+                                                   ossimEpsgProjectionDatabase::instance()->findProjection((ossim_uint32) pcsCode));
+
+   if (proj.valid())
+   {
+      ossimUnitType type = proj->getProjectionUnits();
+      if (type == OSSIM_METERS)
+      {
+         pcsUnits = LINEAR_METER;
+      }
+      else
+      {
+         pcsUnits = LINEAR_FOOT_US_SURVEY;
+      }
+   }
+   return pcsUnits;
+}
+
+//*************************************************************************************************
+// Will take an ossimIMageData tile and write it to disk as a general raster file.
+//*************************************************************************************************
+void ossimTiffWriter::dumpTileToFile(ossimRefPtr<ossimImageData> t,  const ossimFilename& f)
+{
+   ossimRefPtr<ossimMemoryImageSource> tile = new ossimMemoryImageSource;
+   tile->setImage(t);
+   ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper(tile.get(), OSSIM_UINT8);
+   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
+   writer->connectMyInputTo(0, remapper.get());
+   writer->setFilename(f);
+   writer->setGeotiffFlag(false);
+   writer->execute();
+   writer=0;
+   tile=0;
+}
diff --git a/ossim/src/ossim/imaging/ossimTileCache.cpp b/src/imaging/ossimTileCache.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimTileCache.cpp
rename to src/imaging/ossimTileCache.cpp
diff --git a/src/imaging/ossimTilePatch.cpp b/src/imaging/ossimTilePatch.cpp
new file mode 100644
index 0000000..3da484a
--- /dev/null
+++ b/src/imaging/ossimTilePatch.cpp
@@ -0,0 +1,526 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimTilePatch.cpp 17195 2010-04-23 17:32:18Z dburken $
+
+#include <vector>
+using namespace std;
+
+#include <ossim/imaging/ossimTilePatch.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/base/ossimErrorCodes.h>
+ossimDiscreteNearestNeighbor ossimTilePatch::nearestNeighborKernel;
+
+ossimTilePatch::ossimTilePatch(ossimImageSource* input)
+{
+   thePatchData = ossimImageDataFactory::instance()->create(NULL, input);
+   thePatchData->initialize();
+}
+
+ossimTilePatch::ossimTilePatch(ossimScalarType scalarType,
+                               long numberOfComponents,
+                               long width,
+                               long height)
+   :thePatchData(NULL)
+{
+   thePatchData = ossimImageDataFactory::instance()->create(NULL,
+                                                            scalarType,
+                                                            numberOfComponents,
+                                                            width,
+                                                            height);
+
+   thePatchData->initialize();
+}
+
+ossimTilePatch::~ossimTilePatch()
+{
+}
+
+ossimIrect ossimTilePatch::getRect()const
+{
+   return thePatchData->getImageRectangle();
+}
+
+ossimDrect ossimTilePatch::findBoundingRect(const ossimDpt &p1,
+                                            const ossimDpt &p2,
+                                            const ossimDpt &p3,
+                                            const ossimDpt &p4)
+{
+   vector<ossimDpt> points(4);
+   
+   points[0] = p1;
+   points[1] = p2;
+   points[2] = p3;
+   points[3] = p4;
+
+   return ossimDrect(points);
+}
+
+void ossimTilePatch::fillPatch(ossimImageSource* tileSource,
+                               long resLevel)
+{
+   // long w = tileSource->getTileWidth();
+   // long h = tileSource->getTileHeight();
+   
+   if(thePatchData.valid())
+   {
+      ossimIrect rect   = thePatchData->getImageRectangle();
+      thePatchData->makeBlank();
+      // ossimIpt origin(rect.ul());
+      ossimRefPtr<ossimImageData> aTile = tileSource->getTile(rect, resLevel);
+      thePatchData->loadTile(aTile.get());
+   }
+}
+
+void ossimTilePatch::setData(ossimRefPtr<ossimImageData>& patchData)
+{
+   thePatchData = patchData;
+}
+
+void ossimTilePatch::convolve(ossimDiscreteConvolutionKernel* kernel)
+{
+   if(!kernel) return;
+
+   long w = thePatchData->getWidth();
+   long h = thePatchData->getHeight();
+
+   long kW = kernel->getWidth();
+   long kH = kernel->getHeight();
+   ossimIpt origin = thePatchData->getOrigin();
+   
+   if( (w < kW) || (h < kH))
+   {
+      cerr << " Error ossimTilePatch::convolve(kernel): patch is smaller than kernel size" << endl;
+      return;
+   }
+   ossimRefPtr<ossimImageData> kernelBuffer =(ossimImageData*) thePatchData->dup();
+
+   // now let's make the buffer just fit the convolution filter
+   //
+   kernelBuffer->setWidth(w - kW);
+   kernelBuffer->setHeight(h - kH);
+   kernelBuffer->setOrigin(ossimDpt(origin.x + kW/2.0,
+                                    origin.y + kH/2.0));
+   kernelBuffer->initialize();
+
+   fillTile(kernelBuffer, kernel);
+
+   kernelBuffer->validate();
+   // now copy the data back to the buffer
+   //
+   thePatchData->loadTile(kernelBuffer.get());
+
+   // now make sure we validate the buffer.
+   thePatchData->validate();
+}
+
+void ossimTilePatch::fillTile(ossimRefPtr<ossimImageData>& aTile)const
+{
+   if(aTile.valid() &&
+      (aTile->getNumberOfBands()==thePatchData->getNumberOfBands())&&
+      (aTile->getBuf())&&
+      (thePatchData->getBuf())&&
+      (thePatchData->getScalarType()==aTile->getScalarType()))
+   {
+      aTile->loadTile(thePatchData.get());
+   }
+}
+
+void ossimTilePatch::fillTile(ossimRefPtr<ossimImageData>& result,
+                              ossimDiscreteConvolutionKernel* kernel)const
+{
+   if(!kernel)
+   {
+      cerr << "Error: Kernel is NULL in  ossimTilePatch::fillTile(tile, kernel)!!" << endl;
+   }
+   if(thePatchData->getScalarType() != result->getScalarType())
+   {
+      //ERROR
+      return;
+   }
+   else
+   {
+      switch(thePatchData->getScalarType())
+      {
+      case OSSIM_UCHAR:
+      {
+         fillTileTemplate(static_cast<ossim_uint8>(0),
+                          result,
+                          kernel);
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         fillTileTemplate(static_cast<ossim_uint16>(0),
+                          result,
+                          kernel);
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         fillTileTemplate(static_cast<ossim_sint16>(0),
+                          result,
+                          kernel);
+         break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         fillTileTemplate(static_cast<float>(0),
+                          result,
+                          kernel);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         fillTileTemplate(static_cast<double>(0),
+                          result,
+                          kernel);
+         break;
+      }
+      default:
+	{
+	  ossimSetError("ossimTilePatch",
+			ossimErrorCodes::OSSIM_ERROR,
+			"unhandled scalar type %d",
+			(int)thePatchData->getScalarType());
+	  break;
+	}
+      }
+   }
+}
+
+
+
+void ossimTilePatch::fillTile(ossimRefPtr<ossimImageData>& result,
+                              const ossimDpt   &ul,
+                              const ossimDpt   &ur,
+                              const ossimDpt   &deltaUl,
+                              const ossimDpt   &deltaUr,
+                              const ossimDpt   &length)const
+{   
+   result->setNullPix(thePatchData->getNullPix(), thePatchData->getNumberOfBands());
+   result->setMinPix(thePatchData->getMinPix(), thePatchData->getNumberOfBands());
+   result->setMaxPix(thePatchData->getMaxPix(), thePatchData->getNumberOfBands());
+   result->makeBlank();
+   if(thePatchData->getScalarType() != result->getScalarType())
+   {
+      //ERROR
+      return;
+   }
+   else
+   {
+      switch(thePatchData->getScalarType())
+      {
+      case OSSIM_UCHAR:
+      {
+         fillTileTemplate(static_cast<ossim_uint8>(0),
+                          result,
+                          ul,
+                          ur,
+                          deltaUl,
+                          deltaUr,
+                          length);
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         fillTileTemplate(static_cast<ossim_uint16>(0),
+                          result,
+                          ul,
+                          ur,
+                          deltaUl,
+                          deltaUr,
+                          length);
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         fillTileTemplate(static_cast<ossim_sint16>(0),
+                          result,
+                          ul,
+                          ur,
+                          deltaUl,
+                          deltaUr,
+                          length);
+         break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         fillTileTemplate(static_cast<float>(0),
+                          result,
+                          ul,
+                          ur,
+                          deltaUl,
+                          deltaUr,
+                          length);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         fillTileTemplate(static_cast<double>(0),
+                          result,
+                          ul,
+                          ur,
+                          deltaUl,
+                          deltaUr,
+                          length);
+         break;
+      }
+      default:
+	{
+	  ossimSetError("ossimTilePatch",
+			ossimErrorCodes::OSSIM_ERROR,
+			"unhandled scalar type %d",
+			(int)thePatchData->getScalarType());
+	  break;
+	}
+      }
+   }
+
+}
+
+
+template<class T>
+void ossimTilePatch::fillTileTemplate(T /* dummyVariable */,
+                                      ossimRefPtr<ossimImageData>& result,
+                                      ossimDiscreteConvolutionKernel* kernel)const
+{
+   // get the origin.  The convolution could be
+   // an offset into the patch.
+   //
+   ossimIpt startOrigin   = result->getOrigin();
+
+   // Make sure that the patch is not empty or NULL
+   //
+   ossimDataObjectStatus status = thePatchData->getDataObjectStatus();
+   if((status==OSSIM_EMPTY)||
+      (status == OSSIM_NULL))
+   {
+      return;
+   }
+   ossimDpt startDelta(fabs((double)startOrigin.x - thePatchData->getOrigin().x),
+                       fabs((double)startOrigin.y - thePatchData->getOrigin().y));
+   
+   // let's setup some variables that we will need to do the
+   // convolution algorithm.
+   //
+   ossimIrect patchRect   = thePatchData->getImageRectangle();
+   long tileHeight        = result->getHeight();
+   long tileWidth         = result->getWidth();
+   long outputBands       = result->getNumberOfBands();
+   long convolutionWidth  = kernel->getWidth();
+   long convolutionHeight = kernel->getHeight();
+   long convolutionOffsetX= convolutionWidth/2;
+   long convolutionOffsetY= convolutionHeight/2;
+   long patchWidth        = patchRect.width();
+   long patchCenterOffset = (long)(patchWidth*startDelta.y + startDelta.x);
+   long patchConvolutionOffsetDelta = patchWidth*convolutionOffsetY + convolutionOffsetX;
+   long patchLineStartOffset        = patchCenterOffset  - patchConvolutionOffsetDelta;
+   long outputOffset                = 0;
+   double min = 1.0;
+   double max = 255.0;
+   if(status == OSSIM_PARTIAL) // must check for NULLS
+   {
+      for(long y = 0; y <tileHeight; y++)
+      {
+         patchCenterOffset = patchLineStartOffset;
+         
+         for(long x =0; x < tileWidth; x++)
+         {  
+            if(!thePatchData->isNull(patchCenterOffset))
+            {
+               double convolveResult = 0;
+               for(long b = 0; b < outputBands; ++b)
+               {                  
+                  min=result->getMinPix(b);
+                  max=result->getMaxPix(b);
+                  T* buf    = (T*)(thePatchData->getBuf(b)) + patchCenterOffset;
+                  T* outBuf = (T*)(result->getBuf(b));
+
+                  kernel->convolveSubImage(buf,
+                                           patchWidth,
+                                           convolveResult);
+                  convolveResult = convolveResult < min?min:convolveResult;
+                  convolveResult = convolveResult > max?max:convolveResult;
+                  outBuf[outputOffset] = (ossim_uint8)convolveResult;
+               }
+            }
+            else
+            {
+               result->setNull(outputOffset);
+            }
+            ++outputOffset;
+            ++patchCenterOffset;
+         }
+         patchLineStartOffset += patchWidth;
+      }
+    }
+    else
+    {
+       for(long b = 0; b < outputBands; ++b)
+       {                  
+          double convolveResult = 0;
+          const T* buf    = (const T*)thePatchData->getBuf(b);
+          T* outBuf = (T*)(result->getBuf(b));
+          outputOffset = 0;
+          patchCenterOffset = (long)(patchWidth*startDelta.y + startDelta.x);
+          patchLineStartOffset  = patchCenterOffset - patchConvolutionOffsetDelta;
+          min=result->getMinPix(b);
+          max=result->getMaxPix(b);
+          
+          for(long y = 0; y <tileHeight; y++)
+          {
+             patchCenterOffset = patchLineStartOffset;
+             
+             for(long x =0; x < tileWidth; x++)
+             {
+                kernel->convolveSubImage(&buf[patchCenterOffset],
+                                         patchWidth,
+                                         convolveResult);
+                convolveResult = convolveResult < min? min:convolveResult;
+                convolveResult = convolveResult > max?max:convolveResult;
+                outBuf[outputOffset] = (T)convolveResult;
+                ++outputOffset;
+                ++patchCenterOffset;
+             }
+             patchLineStartOffset += patchWidth;
+          }
+       }
+    }
+}
+
+
+template <class T>
+void ossimTilePatch::fillTileTemplate(T /* dummyVariable */,
+                              ossimRefPtr<ossimImageData>& result,
+                              const ossimDpt   &ul,
+                              const ossimDpt   &ur,
+                              const ossimDpt   &deltaUl,
+                              const ossimDpt   &deltaUr,
+                              const ossimDpt   &length)const
+{
+   double stepSizeWidth  = 1.0/length.x;
+   double stepSizeHeight = 1.0/length.y;
+   long patchWidth = thePatchData->getWidth();
+   long patchHeight = thePatchData->getHeight();
+
+   
+   ossimIrect rect = thePatchData->getImageRectangle();
+   
+   ossimDpt startSave(ul.x - rect.ul().x,
+                      ul.y - rect.ul().y );
+   ossimDpt endSave(ur.x - rect.ul().x,
+                    ur.y - rect.ul().y);
+   for(ossim_uint32 band = 0; band < thePatchData->getNumberOfBands(); ++band)
+   {
+      T *resultBuf = (T*)result->getBuf(band);
+      const T *sourceBuf = (T*)thePatchData->getBuf(band);
+      ossimDpt start = startSave;
+      ossimDpt end   = endSave;
+      T nullPix = static_cast<T>(result->getNullPix(band));
+      for(long y = 0; y < length.y; y++)
+      {
+         double deltaX = (end.x - start.x)*stepSizeWidth;
+         double deltaY = (end.y - start.y)*stepSizeHeight;
+         ossimDpt pointXY = start;
+         for(long x = 0; x < length.x; x++)
+         {
+            int xPixel = pointXY.x<0?(int)floor(pointXY.x):(int)pointXY.x;
+            int yPixel = pointXY.y<0?(int)floor(pointXY.y):(int)pointXY.y;
+            if( (xPixel >=0) && (xPixel < patchWidth) &&
+                (yPixel >=0) && (yPixel < patchHeight))
+            {              
+               *resultBuf = sourceBuf[yPixel*patchWidth + xPixel];
+            }
+            else
+            {
+               *resultBuf = nullPix;
+            }
+            
+            resultBuf++;
+            pointXY.y += deltaY;
+            pointXY.x += deltaX;
+         }
+         
+         start.x += deltaUl.x;
+         start.y += deltaUl.y;
+         end.x   += deltaUr.x;
+         end.y   += deltaUr.y;
+      }
+   }
+}
+
+
+void ossimTilePatch::setRect(const ossimDpt &p1,
+                             const ossimDpt &p2,
+                             const ossimDpt &p3,
+                             const ossimDpt &p4,
+                             const ossimDpt &tile_size,
+                             const ossimDpt &padding)
+{
+   setRect(findBoundingRect(p1, p2, p3, p4),
+           tile_size,
+           padding);
+}
+
+void ossimTilePatch::setRect(const ossimDpt &center,
+                             const ossimDpt &rect_size,
+                             const ossimDpt &tile_size,
+                             const ossimDpt &padding)
+{
+   ossimDpt ul (center - rect_size/2.0);
+   ossimDpt lr (center + rect_size/2.0);
+   ossimDrect rect (ul, lr);
+   setRect(rect, tile_size, padding);
+}
+
+void ossimTilePatch::setRect(const ossimDrect& aRect,
+                             const ossimDpt& /* tile_size*/,
+                             const ossimDpt& padding)
+{
+   ossimDpt   ul(aRect.ul().x - padding.x,
+                 aRect.ul().y - padding.y);
+   ossimDpt   lr(aRect.lr().x + padding.x,
+                 aRect.lr().y + padding.y);
+
+   ossimDrect rect(ul, lr);
+   rect.stretchOut();
+   
+//   rect   = alignRectToBoundary(rect, tile_size);
+
+   if(thePatchData.valid())
+   {
+      if(  ((long)thePatchData->getWidth()  != (long)rect.width()) ||
+           ((long)thePatchData->getHeight() != (long)rect.height()))
+      {
+         thePatchData->setWidth((long)rect.width());
+         thePatchData->setHeight((long)rect.height());
+      }
+      thePatchData->setOrigin(rect.ul());
+      thePatchData->initialize();
+   }
+}
+
diff --git a/src/imaging/ossimTiledImageHandler.cpp b/src/imaging/ossimTiledImageHandler.cpp
new file mode 100644
index 0000000..dc0b410
--- /dev/null
+++ b/src/imaging/ossimTiledImageHandler.cpp
@@ -0,0 +1,638 @@
+//*************************************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+// 
+// Image handler used for tile-files when the full image is distributed across multiple files,
+// as is the case for tiled Quickbird imagery. This is not for use with band-separate formats,
+// but only "spatially-separate" schemes.
+//
+//*************************************************************************************************
+//  $Id: ossimTiledImageHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#include <algorithm>
+
+#include <ossim/imaging/ossimTiledImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimTiffOverviewBuilder.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+
+RTTI_DEF1(ossimTiledImageHandler, "ossimTiledImageHandler", ossimImageHandler)
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimTiledImageHandler:debug");
+
+//*************************************************************************************************
+//!  Constructor (default):
+//*************************************************************************************************
+ossimTiledImageHandler::ossimTiledImageHandler()
+   : m_tileFiles(0),
+     m_tile(0),
+     m_fullImgRect(),
+#if USING_SUB_OVRS
+     m_startOvrResLevel(-1),
+     m_lockSubOvrs(false)
+#else
+     m_startOvrResLevel(1)
+#endif
+{
+}
+
+//*************************************************************************************************
+//! Destructor:
+//*************************************************************************************************
+ossimTiledImageHandler::~ossimTiledImageHandler()
+{
+   close();
+}
+
+//*************************************************************************************************
+//! Deletes the overview and clears the valid image vertices.  Derived
+//! classes should implement.
+//*************************************************************************************************
+void ossimTiledImageHandler::close()
+{
+   vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
+   while (iter != m_tileFiles.end())
+   {
+      (*iter).imageHandler->close();
+      ++iter;
+   }
+   m_tileFiles.clear();
+}
+
+//*************************************************************************************************
+//! Derived classes must implement this method to be concrete.
+//! @return true if open, false if not.
+//*************************************************************************************************
+bool ossimTiledImageHandler::isOpen()const
+{
+   if (m_tileFiles.size() > 0)
+      return true;
+
+   return false;
+}
+
+//*************************************************************************************************
+//! Initialize tile buffer to natch image datatype
+//*************************************************************************************************
+void ossimTiledImageHandler::allocate()
+{
+   m_tile = 0;
+   if ((m_tileFiles.size() == 0))
+      return;
+
+   // Just copy the image data tile of the first tile-file:
+   ossimRefPtr<ossimImageHandler> h0 = m_tileFiles[0].imageHandler;
+   ossimIrect rect (h0->getBoundingRect());
+   rect.set_lr(rect.ul() + ossimIpt(h0->getTileWidth()-1, h0->getTileHeight()-1));
+   ossimRefPtr<ossimImageData> source_tile = m_tileFiles[0].imageHandler->getTile(rect);
+   if (!source_tile.valid())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "ossimTiledImageHandler::allocate() -- Could not"
+         "determine file-tile image data for allocating image tile. Aborting."<<endl;
+      return;
+   }
+
+   m_tile = (ossimImageData*) source_tile->dup();
+}
+
+//*************************************************************************************************
+//! Fills the requested tile by pulling pixels from multiple file tiles as needed.
+//*************************************************************************************************
+ossimRefPtr<ossimImageData> ossimTiledImageHandler::getTile(const ossimIrect& tile_rect, 
+                                                             ossim_uint32 resLevel)
+{
+   // First verify that there are file-tiles available:
+   if (m_tileFiles.size() == 0)
+      return ossimRefPtr<ossimImageData>();
+
+   // Allocate data tile if needed:
+   if(!m_tile.valid())
+   {
+      allocate();
+      if(!m_tile.valid())
+         return ossimRefPtr<ossimImageData>();
+   }
+
+   // Check if res level represents data inside the overall scene overview:
+   if (theOverview.valid() && (resLevel >= m_startOvrResLevel))
+      return theOverview->getTile(tile_rect, resLevel);
+
+   // Loop over all tile-files to find which intersect the requested image rect. This necessarily
+   // needs to be done at full res coordinates, so need to adjust by res level requested:
+   ossimDpt decimation_factor;
+   // const ossim_uint32 BANDS = m_tile->getNumberOfBands();
+   // const ossim_uint32 PPB   = m_tile->getSizePerBand(); // pixels per band
+   // bool none_found = true;
+
+   
+   // ossim_uint32 wd, hd, ws, hs;
+   // m_tile->getWidthHeight(wd, hd);
+   
+   // Always start with blank tile.
+   m_tile->makeBlank();
+
+   //---
+   // Add in the sub image offset if any for the rest of this method to work
+   // correctly.
+   //---
+   ossimIrect adjusted_tile_rect = tile_rect + m_fullImgRect.ul();
+
+   // See if any point of the requested tile is in the image.
+   if ( adjusted_tile_rect.intersects( m_fullImgRect ) )
+   {
+      // This need to set for loadTile to work off the full image rect.
+      m_tile->setImageRectangle(adjusted_tile_rect);
+      
+      vector<ossimTileFile>::iterator tf_iter = m_tileFiles.begin();
+      ossimRefPtr<ossimImageData> source_tile = 0;
+      while (tf_iter != m_tileFiles.end())
+      {
+         if (( (*tf_iter).subImageRects.size() > resLevel) &&
+             adjusted_tile_rect.intersects((*tf_iter).subImageRects[resLevel]))
+         {
+            //---
+            // Current image handler lies within requested rect, need to adjust
+            // this rect to be relative to this subimage offset before fetching
+            // the tile:
+            //---
+            ossimIrect full_image_clip_rect =
+               adjusted_tile_rect.clipToRect( (*tf_iter).subImageRects[resLevel]);
+
+            // Subtract the sub image offset to make zero base image rect.
+            ossimIrect relative_clip_rect( full_image_clip_rect -
+                                           (*tf_iter).subImageRects[resLevel].ul());
+            
+            source_tile = (*tf_iter).imageHandler->getTile(relative_clip_rect, resLevel);
+            if ( source_tile.valid() )
+            {
+               if ( (source_tile->getDataObjectStatus() != OSSIM_NULL) &&
+                    (source_tile->getDataObjectStatus() != OSSIM_EMPTY) )
+               {
+                  // Give the loadTile the clip rect relative to the full image.
+                  m_tile->loadTile( source_tile->getBuf(),
+                                    full_image_clip_rect,
+                                    OSSIM_BSQ);
+                  m_tile->validate();
+                  if ( m_tile->getDataObjectStatus() == OSSIM_FULL )
+                  {
+                     break;
+                  }
+               }
+            }
+         }
+         ++tf_iter;
+      }
+      
+   } // Matches: if ( adjusted_tile_rect.intersects( m_fullImgRect ) )
+
+   // Set back to zero based rect.
+   m_tile->setImageRectangle(tile_rect);
+   
+   return m_tile;
+}
+
+// Below code was core dumping on tiled DG data. drb - 20160822
+#if 0 
+   
+            ossimIrect relative_rect (tile_rect - (*tf_iter).subImageRects[resLevel].ul());
+            std::cout << "reletive_rect: " << relative_rect << std::endl;
+            source_tile = (*tf_iter).imageHandler->getTile(relative_rect, resLevel);
+            
+            // Quick check to see if a full tile was returned, in which case we can just return that
+            // tile instead of looping below:
+            //if (source_tile->getDataObjectStatus() == OSSIM_FULL)
+            //{
+            //   source_tile->setImageRectangle(tile_rect);
+            //   return source_tile;
+            //}
+
+            // Set the tile's rect back to full image space before saving to the list:
+            source_tile->getWidthHeight(ws, hs);
+            std::cout << "ws: " << ws << " hs: " << hs << " wd: " << wd << " hd: " << hd
+                      << std::endl;
+            for (ossim_uint32 band = 0; band < BANDS; ++band)
+            {
+               const ossim_uint16 null_pixel = (ossim_uint16) m_tile->getNullPix(band);
+               const ossim_uint16* s = (const ossim_uint16*) source_tile->getBuf(band);
+               ossim_uint16* d = (ossim_uint16*) m_tile->getBuf(band);
+               ossim_uint32 is = 0; 
+               ossim_uint32 id = 0; 
+               for (ossim_uint32 y=0; (y<hd)&&(y<hs); ++y)
+               {
+                  for (ossim_uint32 x=0; x<wd; ++x)
+                  {
+                     if (x < ws)
+                     {
+                        // cout << "is: " << is << endl;
+                        if (s[is] != null_pixel)
+                           d[id] = s[is];
+                        ++is;
+                     }
+                     ++id;
+                  }
+               }
+            }
+
+
+         }
+         ++tf_iter;
+      }
+      
+      m_tile->validate();
+      
+   } // Matches: if ( tile_rect.intersects( m_fullImgRect ) )
+
+   return m_tile;
+}
+#endif
+
+//*************************************************************************************************
+//! @param resLevel Reduced resolution level to return lines of.
+//! Default = 0
+//! @return The number of lines for specified reduced resolution level.
+//*************************************************************************************************
+ossim_uint32 ossimTiledImageHandler::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   if (m_fullImgRect.hasNans())
+      return 0;
+
+   // Using simple decimation by powers of 2:
+   ossim_uint32 numlines = m_fullImgRect.height() >> resLevel;
+   return numlines;
+}
+
+//*************************************************************************************************
+//! @param resLevel Reduced resolution level to return samples of.
+//! Default = 0
+//! @return The number of samples for specified reduced resolution level.
+//*************************************************************************************************
+ossim_uint32 ossimTiledImageHandler::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   if (m_fullImgRect.hasNans())
+      return 0;
+
+   // Using simple decimation by powers of 2:
+   ossim_uint32 numsamps = m_fullImgRect.width() >> resLevel;
+   return numsamps;
+}
+
+//*************************************************************************************************
+//! Method to save the state of an object to a keyword list.
+//! Return true if ok or false on error.
+//*************************************************************************************************
+bool ossimTiledImageHandler::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+  return ossimImageHandler::saveState(kwl, prefix);
+}
+
+//*************************************************************************************************
+//! Method to the load (recreate) the state of an object from a keyword
+//! list.  Return true if ok or false on error.
+//*************************************************************************************************
+bool ossimTiledImageHandler::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (!ossimImageHandler::loadState(kwl, prefix))
+      return false;
+
+   return open();
+}
+
+//*************************************************************************************************
+//! Indicates whether or not the image is tiled internally.
+//! This implementation returns true if (getImageTileWidth() &&
+//! getImageTileHeight()) are both non zero.
+//! Override in the image handler if something else is desired.
+//! Returns true if tiled, false if not.
+//*************************************************************************************************
+bool ossimTiledImageHandler::isImageTiled() const
+{
+   return true;
+}
+
+//*************************************************************************************************
+// Returns the number of bands of the first tile since all tiles need to have the same pixel type.
+//*************************************************************************************************
+ossim_uint32 ossimTiledImageHandler::getNumberOfInputBands() const
+{
+   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
+      return 0;
+
+   return m_tileFiles[0].imageHandler->getNumberOfInputBands();
+}
+
+//*************************************************************************************************
+//! Returns the tile width of the image or 0 if the image is not tiled.
+//! Note: this is not the same as the ossimImageSource::getTileWidth which
+//! returns the output tile width which can be different than the internal
+//! image tile width on disk.
+//*************************************************************************************************
+ossim_uint32 ossimTiledImageHandler::getImageTileWidth() const
+{
+   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
+      return 0;
+
+  if (m_tileFiles[0].imageHandler->isImageTiled())
+     return m_tileFiles[0].imageHandler->getImageTileWidth();
+
+  return m_tileFiles[0].imageHandler->getNumberOfSamples();
+}
+
+//*************************************************************************************************
+//! Returns the tile height of the image or 0 if the image is not tiled.
+//! Note: this is not the same as the ossimImageSource::getTileHeight which
+//! returns the output tile height which can be different than the internal
+//! image tile height on disk.
+//*************************************************************************************************
+ossim_uint32 ossimTiledImageHandler::getImageTileHeight() const
+{
+   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
+      return 0;
+
+   if (m_tileFiles[0].imageHandler->isImageTiled())
+      return m_tileFiles[0].imageHandler->getImageTileHeight();
+
+   return m_tileFiles[0].imageHandler->getNumberOfLines();
+}
+
+//*************************************************************************************************
+//! Returns scalar type of first tile (should be the same for all tiles)
+//*************************************************************************************************
+ossimScalarType ossimTiledImageHandler::getOutputScalarType() const
+{
+   if ((m_tileFiles.size() == 0) || (!m_tileFiles[0].imageHandler.valid()))
+      return OSSIM_SCALAR_UNKNOWN;
+
+   return m_tileFiles[0].imageHandler->getOutputScalarType();
+}
+
+//*************************************************************************************************
+//! Returns overall bounding rect in image space.
+//*************************************************************************************************
+ossimIrect ossimTiledImageHandler::getImageRectangle(ossim_uint32 resLevel) const
+{
+   //---
+   // Note: Rectangle should be zero based.  Sub image offset handled in
+   // getTile and getImageGeometry. drb
+   //---
+   ossimIrect rect = m_fullImgRect - m_fullImgRect.ul();
+   if ( resLevel > 0 )
+   {
+      ossimDpt decimation;
+      getDecimationFactor(resLevel, decimation);
+      
+      rect = rect*decimation;
+   }
+   return rect;
+
+#if 0
+   if (resLevel == 0)
+      return m_fullImgRect;
+
+   ossimDpt decimation;
+   getDecimationFactor(resLevel, decimation);
+
+   return m_fullImgRect*decimation;
+#endif
+}
+
+
+#if USING_SUB_OVRS
+//*************************************************************************************************
+// Overrides base class
+//*************************************************************************************************
+void ossimTiledImageHandler::completeOpen()
+{
+   openOverview();
+   openValidVertices();
+}
+
+//*************************************************************************************************
+//! Will build over files, one for each tile file.
+//! @param includeFullResFlag if true the full resolution layer will also
+//! be put in the overview format.  This is handy for inefficient formats.
+//*************************************************************************************************
+bool ossimTiledImageHandler::buildOverview(ossimImageHandlerOverviewCompressionType ctype, 
+                                            ossim_uint32 qual,
+                                            ossimFilterResampler::ossimFilterResamplerType rtype,
+                                            bool ifr_flag)
+{
+   if (m_tileFiles.size() == 0)
+      return false;
+
+   bool all_ok = true;
+   vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
+   while ((iter != m_tileFiles.end()) && all_ok)
+   {
+      if (!(*iter).imageHandler->hasOverviews())
+      {
+         ossimNotify(ossimNotifyLevel_INFO)<<"\nBuilding overview for <"
+            <<(*iter).imageHandler->getFilename()<<">"<<std::endl;
+
+         all_ok = (*iter).imageHandler->buildOverview(ctype, qual, rtype, ifr_flag);
+      }
+      ++iter;
+   }
+
+   // Overviews for subimage tile-files have been processed. However, we need to check the
+   // preferences for the overview stop dimension to see if we need additional decimation of the
+   // overall scene to achieve the final desired dimension.
+   ossimString stop_dim_str = 
+      ossimPreferences::instance()->findPreference(ossimKeywordNames::OVERVIEW_STOP_DIMENSION_KW);
+   if (!stop_dim_str.empty())
+   {
+      ossim_uint32 stop_dim = stop_dim_str.toUInt32();
+      ossimDpt decimation = theDecimationFactors.back();
+      ossim_uint32 nlines = decimation.y * m_fullImgRect.height();
+      ossim_uint32 nsamps = decimation.x * m_fullImgRect.width();
+      if ((nlines > stop_dim) || (nsamps > stop_dim))
+      {
+         // Need to continue decimating. These decimations are stored in an overall scene file.
+         // Need subimage OVRs open for this next operation:
+         openOverview();
+
+         ossimTiffOverviewBuilder tob;
+         tob.setInputSource(this);
+         theOverviewFile = getFilenameWithThisExtension("ovr");
+
+         // This magically takes over where we left off in decimating:
+         if (tob.buildOverview(theOverviewFile))
+         {
+            // Overview was successfully written, now open it:
+            theOverview = new ossimTiffTileSource;
+            all_ok = openOverview();
+         }
+      }
+   }
+
+   return all_ok;
+}
+
+//*************************************************************************************************
+// Will open overview files for all tile files. Actually, the tile-files will already have opened
+// their individual overviews, so this method only verifies the fact and initializes the 
+// associated subimage rects at all decimation levels.
+//*************************************************************************************************
+bool ossimTiledImageHandler::openOverview()
+{
+   if (m_tileFiles.size() == 0)
+      return false;
+
+   theDecimationFactors.clear();
+   bool all_ok = true;
+   ossimRefPtr<ossimImageHandler> handler = 0;
+   vector<ossimDpt> factors;
+   ossim_uint32 min_num_rlevels = 999;
+
+   // Loop over all tile-files to verify their OVR was opened and to calculate the associated 
+   // subimage rects at each res level:
+   vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
+   while ((iter != m_tileFiles.end()) && all_ok)
+   {
+      handler = (*iter).imageHandler;
+      if (!handler.valid())
+      {
+         ++iter;
+         continue;
+      }
+
+      if ((*iter).subImageRects.size() == 0)
+      {
+         ossimNotify(ossimNotifyLevel_INFO)<<"\nBounding image rectangle not defined for <"
+            <<(*iter).imageHandler->getFilename()<<">! Cannot proceed with overviews."<<std::endl;
+         all_ok = false;
+      }
+
+      else if (handler->getOverview())
+      {
+         // Only verified that overview for tile-file was opened. Check number of decimation levels
+         // to latch minimum:
+         (*iter).overviewIsOpen = true;
+         handler->getDecimationFactors(factors);
+
+         if (factors.size() < min_num_rlevels)
+            min_num_rlevels = (ossim_uint32) factors.size();
+
+         // Need to determine the sub image rects at each decimation level:
+         ossimIrect subRectR0 ((*iter).subImageRects[0]);
+         for (ossim_uint32 i=1; i<(ossim_uint32)factors.size(); i++)
+         {
+            ossimIrect r (factors[i].x * subRectR0.ul().x, factors[i].y * subRectR0.ul().y,
+               factors[i].x * subRectR0.lr().x, factors[i].y * subRectR0.lr().y);
+            (*iter).subImageRects.push_back(r);
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_INFO)<<"\nNo overview available for <"
+            <<(*iter).imageHandler->getFilename()<<">"<<std::endl;
+         all_ok = false;
+      }
+      ++iter;
+   }
+
+   // Assuming here that the first tile will always provide a good representation of the decimations
+   // for all res levels in all tile-files. This may not be true.
+   if (m_tileFiles.size() && m_tileFiles[0].imageHandler.valid())
+   {
+      m_tileFiles[0].imageHandler->getDecimationFactors(theDecimationFactors);
+      theDecimationFactors.resize(min_num_rlevels);
+   }
+
+   // Check for overall scene overview file, that takes over where the individual tile-file
+   // overviews leave off:
+   theOverviewFile = getFilenameWithThisExtension("ovr");
+   if (!theOverviewFile.exists())
+      theOverviewFile.setExtension("OVR");
+   if (theOverviewFile.exists())
+   {
+      m_lockSubOvrs = true; // prevent closing and reopening of subimage ovrs
+      ossimImageHandler::openOverview(theOverviewFile);
+      m_lockSubOvrs = false; // reset
+      if (theOverview.valid())
+      {
+         vector<ossimDpt> extra_decimations;
+         theOverview->getDecimationFactors(extra_decimations);
+         if (extra_decimations.size())
+         {
+            // Obtain the decimations and add it to our decimation list:
+            m_startOvrResLevel = (ossim_uint32) theDecimationFactors.size();
+            ossimDpt start_decimation (theDecimationFactors.back() * 0.5);
+            ossimDpt decimation;
+            for (ossim_uint32 i=0; i<extra_decimations.size(); i++)
+            {
+               decimation.x = start_decimation.x*extra_decimations[i].x;
+               decimation.y = start_decimation.y*extra_decimations[i].y;
+               theDecimationFactors.push_back(decimation);
+            }
+         }
+      }
+   }
+
+   return all_ok;
+}
+
+//*************************************************************************************************
+//! Will close all tile files' overviews.
+//*************************************************************************************************
+void ossimTiledImageHandler::closeOverview()
+{
+   if (theOverview.valid())
+      theOverview = 0;
+
+   if (m_lockSubOvrs == false)
+   {
+      vector<ossimTileFile>::iterator iter = m_tileFiles.begin();
+      while ((iter != m_tileFiles.end()))
+      {
+         if ((*iter).imageHandler.valid())
+            (*iter).imageHandler->closeOverview();
+
+         ++iter;
+      }
+   }
+}
+
+//*************************************************************************************************
+//! Will return TRUE if all tile files have overviews.
+//*************************************************************************************************
+bool ossimTiledImageHandler::hasOverviews() const
+{
+   bool all_have_ovrs = true;
+   vector<ossimTileFile>::const_iterator iter = m_tileFiles.begin();
+   while ((iter != m_tileFiles.end()) && all_have_ovrs)
+   {
+      if (((*iter).imageHandler.valid()) && !((*iter).imageHandler->hasOverviews()))
+         all_have_ovrs = false;
+      ++iter;
+   }
+   return all_have_ovrs;
+}
+
+//*************************************************************************************************
+//! Returns the number of decimation (resolution) levels. This is the minimum number
+//! among all sub-image tile-files.
+//*************************************************************************************************
+ossim_uint32 ossimTiledImageHandler::getNumberOfDecimationLevels() const
+{
+   return (ossim_uint32) theDecimationFactors.size();
+}
+
+#endif /* #if USING_SUB_OVRS */
+
diff --git a/src/imaging/ossimTiledImagePatch.cpp b/src/imaging/ossimTiledImagePatch.cpp
new file mode 100644
index 0000000..56f0fb2
--- /dev/null
+++ b/src/imaging/ossimTiledImagePatch.cpp
@@ -0,0 +1,234 @@
+//---
+// License: MIT
+//
+// Author: David Burken
+// 
+// Description:
+//
+// Class to fill a patch from input tiles requested on even tile boundaries with
+// a tile size typically matching the input, with some output tile size
+// different from the input.
+// 
+//---
+// $Id$
+
+#include <ossim/imaging/ossimTiledImagePatch.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimTiledImagePatch, "ossimTiledImagePatch", ossimImageSourceFilter)
+
+ossimTiledImagePatch::ossimTiledImagePatch()
+   :
+   ossimImageSourceFilter(),  // base class
+   m_tile(0),
+   m_inputTileSize()
+{
+   m_inputTileSize.makeNan();
+}
+
+ossimTiledImagePatch::~ossimTiledImagePatch()
+{
+}
+
+void ossimTiledImagePatch::initialize()
+{
+   //---
+   // Call the base class initialize.
+   // Note:  This will reset "theInputConnection" if it changed...
+   //---
+   ossimImageSourceFilter::initialize();
+
+   // Clear everything.  The tile will be allocated on first getTile call.
+   m_tile = 0;
+
+   // Get the input tile sizes:
+   if ( theInputConnection )
+   {
+      if ( m_inputTileSize.hasNans() )
+      {
+         m_inputTileSize.x = theInputConnection->getTileWidth();
+         m_inputTileSize.y = theInputConnection->getTileHeight();
+      }
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimTiledImagePatch::getTile(
+   const ossimIrect& tileRect, ossim_uint32 resLevel)
+{
+   if ( m_tile.valid() == false )
+   {
+      allocateTile(); // First time through...
+   }
+   
+   if ( m_tile.valid() )
+   {
+      // Image rectangle must be set prior to calling getTile.
+      m_tile->setImageRectangle(tileRect);
+
+      if ( getTile( m_tile.get(), resLevel ) == false )
+      {
+         if (m_tile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            m_tile->makeBlank();
+         }
+      }
+   }
+
+   return m_tile;
+}
+
+bool ossimTiledImagePatch::getTile(ossimImageData* result, ossim_uint32 resLevel)
+{
+   bool status = false;
+
+   if ( isSourceEnabled() && theInputConnection && isValidRLevel(resLevel) &&
+        result && (m_inputTileSize.hasNans() == false) )
+   {
+      status = true;
+      
+      // See if any point of the requested tile is in the image.
+      ossimIrect tile_rect = result->getImageRectangle();
+
+      ossimIrect input_rect;
+      theInputConnection->getBoundingRect( input_rect, resLevel );
+
+      if ( tile_rect.intersects( input_rect ) )         
+      {
+         // Initialize the tile if needed as we're going to stuff it.
+         if (result->getDataObjectStatus() == OSSIM_NULL)
+         {
+            result->initialize();
+         }
+
+         // If empty imput tiles are pulled the entire output tile might not be filled.
+         result->makeBlank();
+         
+         // Clip rect:
+         ossimIrect clip_rect = tile_rect.clipToRect( input_rect );
+         
+         // Zero based start point.
+         ossimIpt inputOrigin = clip_rect.ul() - input_rect.ul();         
+
+         // Zero based point on input tile boundary.
+         inputOrigin.x = (inputOrigin.x / m_inputTileSize.x) * m_inputTileSize.x;
+         inputOrigin.y = (inputOrigin.y / m_inputTileSize.y) * m_inputTileSize.y;
+
+         // Shift back to original space:
+         inputOrigin += input_rect.ul();
+
+         // Line loop:
+         for ( ossim_int32 y = inputOrigin.y; y < clip_rect.lr().y; y += m_inputTileSize.y )
+         {
+            // Sample loop:
+            for ( ossim_int32 x = inputOrigin.x; x < clip_rect.lr().x; x += m_inputTileSize.x )
+            {
+               ossimIrect rect( x, y, x + m_inputTileSize.x - 1, y + m_inputTileSize.y - 1 );
+
+               ossimRefPtr<ossimImageData> tile = theInputConnection->getTile( rect, resLevel );
+               if ( tile.valid() )
+               {
+                  if ( (tile->getDataObjectStatus() != OSSIM_NULL) &&
+                       (tile->getDataObjectStatus() != OSSIM_EMPTY) )
+                  {
+                     result->loadTile( tile.get() );
+                  }
+               }
+            }
+         }
+
+         result->validate();
+               
+      }
+      else 
+      {
+         // No part of requested tile within the image rectangle.
+         result->makeBlank();
+      }
+      
+   } // matches: if( isOpen() && isSourceEnabled() && isValidRLevel(level) )
+
+   return status;
+}
+
+ossimString ossimTiledImagePatch::getClassName() const
+{
+   return ossimString("ossimTiledImagePatch");
+}
+
+ossimString ossimTiledImagePatch::getLongName()const
+{
+   return ossimString("OSSIM tiled image patch");
+}
+
+ossimString ossimTiledImagePatch::getShortName()const
+{
+   return ossimString("tiled_image_patch");
+}
+
+const ossimIpt& ossimTiledImagePatch::getInputTileSize() const
+{
+   return m_inputTileSize;
+}
+
+bool ossimTiledImagePatch::setInputTileSize( const ossimIpt& tileSize )
+{
+   bool status = true;
+   if ( ( tileSize.hasNans() == false ) && (tileSize.x > 0) && (tileSize.y > 0) )
+   {
+      m_inputTileSize = tileSize;
+   }
+   else
+   {
+      m_inputTileSize.makeNan();
+      status = false;
+   }
+   return status;
+}
+
+bool ossimTiledImagePatch::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   std::string myPrefix = (prefix ? prefix : "" );
+   std::string key = "tile_size";
+   std::string value = kwl.findKey( myPrefix, key );
+   if ( value.size() )
+   {
+      m_inputTileSize.toPoint( value );
+   }
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+bool ossimTiledImagePatch::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   std::string myPrefix = (prefix ? prefix : "" );
+   std::string key = "tile_size";
+   kwl.addPair( myPrefix, key, m_inputTileSize.toString().string() );
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+void ossimTiledImagePatch::allocateTile()
+{
+   m_tile = ossimImageDataFactory::instance()->create(this,this);
+   m_tile->initialize();
+}
+
+bool ossimTiledImagePatch::isValidRLevel(ossim_uint32 resLevel) const
+{
+   // return (resLevel < m_inputBoundingRect.size());
+   return (resLevel < theInputConnection->getNumberOfDecimationLevels());
+}
+
+// Private to disallow use...
+ossimTiledImagePatch::ossimTiledImagePatch(const ossimTiledImagePatch&)
+   : m_tile(0),
+     m_inputTileSize()
+{
+}
+
+// Private to disallow use...
+ossimTiledImagePatch& ossimTiledImagePatch::operator=(const ossimTiledImagePatch&)
+{
+   return *this;
+}
+
+
diff --git a/src/imaging/ossimTiling.cpp b/src/imaging/ossimTiling.cpp
new file mode 100644
index 0000000..877d824
--- /dev/null
+++ b/src/imaging/ossimTiling.cpp
@@ -0,0 +1,987 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: implementation for image generator
+//
+//*************************************************************************
+// $Id: ossimTiling.cpp 22668 2014-03-10 16:52:03Z dburken $
+
+#include <sstream>
+#include <iomanip>
+#include <ossim/imaging/ossimTiling.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceDebug("ossimTiling:debug");
+
+RTTI_DEF1(ossimTiling, "ossimTiling", ossimObject);
+
+ossimTiling::ossimTiling()
+      :theTilingDistance(0,0),
+       theTilingDistanceUnitType(OSSIM_UNIT_UNKNOWN),
+       theDelta(0,0),
+       theDeltaType(ossimTilingDeltaType_TOTAL_PIXELS),
+       theOutputSizeInBytes(0),
+       theNumberOfBands(1),
+       theNumberOfBytesPerPixelPerBand(1),
+       thePaddingSizeInPixels(0.0, 0.0),
+       theMapProjection(),
+       theImageRect(),
+       theTilingRect(),
+       theTileId(-1),
+       theTotalHorizontalTiles(0),
+       theTotalVerticalTiles(0),
+       theTotalTiles(0),
+       theTileNameMask(),
+       theEdgeToEdgeFlag(false)
+{
+}
+
+bool ossimTiling::initialize(const ossimMapProjection& proj,
+                             const ossimIrect& boundingRect)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTiling::initialize DEBUG: Entered..."
+         << "\nBounding rect === " << boundingRect
+         << std::endl;
+   }
+   
+   bool result = true;
+   theMapProjection = (ossimMapProjection*)proj.dup();
+   theImageRect     = boundingRect;
+
+   result = validate();
+
+   ossimDpt convertedTilingDistance = theTilingDistance;
+
+   if(result)
+   {
+      // Let's setup the bounding tile rect.
+      if(theTilingDistanceUnitType != OSSIM_PIXEL)
+      {
+         getConvertedTilingDistance(convertedTilingDistance);
+         
+         if(theMapProjection->isGeographic())
+         {
+            ossimGpt ul;
+            ossimGpt ur;
+            ossimGpt lr;
+            ossimGpt ll;
+
+            theMapProjection->lineSampleToWorld(theImageRect.ul(),
+                                                ul);
+            theMapProjection->lineSampleToWorld(theImageRect.ur(),
+                                                ur);
+            theMapProjection->lineSampleToWorld(theImageRect.lr(),
+                                                lr);
+            theMapProjection->lineSampleToWorld(theImageRect.ll(),
+                                                ll);
+
+            theTilingRect = ossimDrect(ossimDpt(ul),
+                                       ossimDpt(ur),
+                                       ossimDpt(lr),
+                                       ossimDpt(ll),
+                                       OSSIM_RIGHT_HANDED);
+
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG: Geographic input bounds =  "
+                  << theTilingRect
+                  << std::endl;
+            }
+            
+            theTilingRect.stretchToTileBoundary(convertedTilingDistance);
+            
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG: Geographic input bounds stretched =  "
+                  << theTilingRect << std::endl;
+            }
+            
+            clampGeographic(theTilingRect);
+
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG: Geographic input bounds clamped =  "
+                  << theTilingRect << std::endl;
+            }
+
+         }  // End "if(theMapProjection->isGeographic())"
+         
+         else // meters
+         {
+            ossimDpt ul;
+            ossimDpt ur;
+            ossimDpt lr;
+            ossimDpt ll;
+            
+            theMapProjection->lineSampleToEastingNorthing(theImageRect.ul(),
+                                                          ul);
+            theMapProjection->lineSampleToEastingNorthing(theImageRect.ur(),
+                                                          ur);
+            theMapProjection->lineSampleToEastingNorthing(theImageRect.lr(),
+                                                          lr);
+            theMapProjection->lineSampleToEastingNorthing(theImageRect.ll(),
+                                                          ll);
+            theTilingRect = ossimDrect(ul,
+                                       ur,
+                                       lr,
+                                       ll,
+                                       OSSIM_RIGHT_HANDED);
+            
+            theTilingRect.stretchToTileBoundary(convertedTilingDistance);
+         }
+      }
+      else
+      {
+         ossim_int32 remainderX = (ossim_int32)((theImageRect.width()%((ossim_int32)theDelta.x)) != 0);
+         ossim_int32 remainderY = (ossim_int32)((theImageRect.height()%((ossim_int32)theDelta.y)) != 0);
+         
+         ossim_int32 w = (ossim_int32)((theImageRect.width()/(ossim_int32)theDelta.x)*theDelta.x +
+                                       (remainderX*theDelta.x));
+         ossim_int32 h = (ossim_int32)((theImageRect.height()/(ossim_int32)theDelta.y)*theDelta.y +
+                                       (remainderY*theDelta.y));
+         theTilingRect = ossimDrect(theImageRect.ul().x,
+                                    theImageRect.ul().y,
+                                    theImageRect.ul().x + (w-1),
+                                    theImageRect.ul().y + (h-1));
+
+         // since we are pixel space we force delta to be 1 pixel unit
+         //
+         theDelta.x   = 1.0;
+         theDelta.y   = 1.0;
+         theDeltaType = ossimTilingDeltaType_PER_PIXEL;
+      }
+   }
+   
+   theTotalHorizontalTiles = ossim::round<int>(fabs(theTilingRect.ur().x - theTilingRect.ul().x)/convertedTilingDistance.x);
+   theTotalVerticalTiles   = ossim::round<int>(fabs(theTilingRect.ur().y - theTilingRect.lr().y)/convertedTilingDistance.y);
+   theTotalTiles           = theTotalHorizontalTiles*theTotalVerticalTiles;
+
+   // reset the tile id to the beginning
+   //
+   reset();
+   
+   if(traceDebug())
+   {
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+      
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimTiling::initialize DEBUG: Leaving..." << std::endl;
+   }
+   return result;
+}
+
+bool ossimTiling::next(ossimRefPtr<ossimMapProjection>& resultProjection,
+                       ossimIrect& resultingBounds,
+                       ossimString& resultingName)const
+{
+   bool result = true;
+   
+   if(theTileId < theTotalTiles)
+   {
+      ossimDpt origin;
+      ossim_int64 row=0;
+      ossim_int64 col=0;
+
+      getRowCol(row, col, theTileId);
+
+      getTileName(resultingName,
+                  row, col, theTileId);
+      
+      getOrigin(origin, row, col);
+
+      if(theTilingDistanceUnitType == OSSIM_PIXEL)
+      {
+         ossimIpt ul = origin;
+
+         resultingBounds =
+            ossimIrect(ul.x - (ossim_int32)thePaddingSizeInPixels.x,
+                       ul.y - (ossim_int32)thePaddingSizeInPixels.y,
+                       ul.x + ((ossim_int32)theTilingDistance.x-1) +
+                       (ossim_int32)thePaddingSizeInPixels.x,
+                       ul.y + ((ossim_int32)theTilingDistance.y-1) +
+                       (ossim_int32)thePaddingSizeInPixels.y);
+      }
+      else
+      {
+         
+         ossimDpt deltaPerPixel = getDeltaPerPixel();
+         ossimIpt pixels;
+
+         if(theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS)
+         {
+            pixels =   theDelta;
+         }
+         else
+         {
+            pixels =   ossimDpt(theTilingDistance.x/theDelta.x,
+                                theTilingDistance.y/theDelta.y);
+         }
+
+         if(theMapProjection->isGeographic())
+         {
+            if ( theEdgeToEdgeFlag )
+            {
+               theMapProjection->setUlTiePoints(
+                  ossimGpt( origin.lat - (deltaPerPixel.y/2.0),
+                            origin.lon + (deltaPerPixel.x/2.0),
+                            0.0,
+                            theMapProjection->origin().datum()) );
+            }
+            else
+            {
+               theMapProjection->setUlTiePoints(
+                  ossimGpt(origin.lat,
+                           origin.lon,
+                           0.0,
+                           theMapProjection->origin().datum()));
+               
+            }
+            theMapProjection->setDecimalDegreesPerPixel(deltaPerPixel);
+         }
+         else
+         {
+            if ( theEdgeToEdgeFlag )
+            {
+               theMapProjection->setUlTiePoints(
+                  ossimDpt( origin.x + (deltaPerPixel.x/2.0),
+                            origin.y - (deltaPerPixel.y/2.0) ) );
+            }
+            else
+            {
+               theMapProjection->setUlTiePoints(ossimDpt(origin.x, origin.y));
+            }
+            theMapProjection->setMetersPerPixel(deltaPerPixel);
+         }
+         resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
+                                      -(ossim_int32)thePaddingSizeInPixels.y,
+                                      (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+                                      (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+      }
+      resultProjection = theMapProjection;
+
+      ++theTileId;
+      if(traceDebug()&&resultProjection.valid())
+      {
+         ossimKeywordlist projKwl;
+         
+         resultProjection->saveState(projKwl);
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimTiling::next DEBUG: rect = " << resultingBounds
+            << "\nproj                          = " << projKwl
+            << "\ntileName                      = " << resultingName
+            << "\norigin                        = " << origin << std::endl;
+      }
+   }
+   else
+   {
+      result = false;
+   }
+
+   
+   return result;
+}
+
+
+void ossimTiling::reset()
+{
+   theTileId = 0;
+}
+
+void ossimTiling::setTilingDistance(const ossimDpt& tilingDistance,
+                                    ossimUnitType unitType)
+{
+   theTilingDistance         = tilingDistance;
+   theTilingDistanceUnitType = unitType;
+}
+
+void ossimTiling::setDelta(const ossimDpt& delta,
+                           ossimTilingDeltaType deltaType)
+{
+   theDelta     = delta;
+   theDeltaType = deltaType;
+}
+
+bool ossimTiling::validate()const
+{
+   bool result = true;
+
+   if(theMapProjection.valid())
+   {
+      if(theMapProjection->isGeographic())
+      {
+         switch(theTilingDistanceUnitType)
+         {
+            case OSSIM_DEGREES:
+            case OSSIM_RADIANS:
+            case OSSIM_SECONDS:
+            case OSSIM_MINUTES:
+            case OSSIM_PIXEL:
+            {
+               break;
+            }
+            default:
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimTiling::validate()\n"
+                  << "Map projeciton requires tiling in angular units but the"
+                  << "\nspacing is in non angular" << std::endl;
+               result = false;
+            }
+         }
+      }
+      else
+      {
+         switch(theTilingDistanceUnitType)
+         {
+            case OSSIM_METERS:
+            case OSSIM_FEET:
+            case OSSIM_US_SURVEY_FEET:
+            case OSSIM_NAUTICAL_MILES:
+            case OSSIM_PIXEL:
+            case OSSIM_MILES:
+            case OSSIM_MILLIMETERS:
+            {
+               break;
+            }
+            default:
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimTiling::validate()"
+                  << "\nMap projeciton requires tiling using linear spacing"
+                  << " but the spacing is in non linear" << std::endl;
+               result = false;
+            }
+         }
+      }
+   }
+   else
+   {
+      result = false;
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTiling::validate()"
+         << "\nthe image projection is null and so not valid"
+         << std::endl;
+   }
+   if((theDelta.x <= FLT_EPSILON) ||
+      (theDelta.y <= FLT_EPSILON))
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTiling::validate() the delta is too small or is negative"
+         << "value = " << theDelta << std::endl;
+      result = false;
+   }
+   if((theTilingDistance.x <= FLT_EPSILON)||
+      (theTilingDistance.y <= FLT_EPSILON))
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTiling::validate()"
+         << "\nthe tiling distance is too small or is negative"
+         << "Value = " << theTilingDistance << std::endl;
+   }
+   
+   if(theImageRect.hasNans())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTiling::validate() the image rect has nans"
+         << std::endl;
+      result = false;
+   }
+   
+   return result;
+}
+
+bool ossimTiling::isAngularUnit(ossimUnitType unitType)const
+{
+   bool result = false;
+   
+   switch(unitType)
+   {
+      case OSSIM_DEGREES:
+      case OSSIM_RADIANS:
+      case OSSIM_SECONDS:
+      case OSSIM_MINUTES:
+      {
+         result = true;
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+   return result;
+}
+
+bool ossimTiling::isLinearUnit(ossimUnitType unitType)const
+{
+   bool result = false;
+   
+   switch(unitType)
+   {
+      case OSSIM_METERS:
+      case OSSIM_FEET:
+      case OSSIM_US_SURVEY_FEET:
+      case OSSIM_NAUTICAL_MILES:
+      case OSSIM_MILES:
+      case OSSIM_MILLIMETERS:
+      {
+         result = true;
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+   return result;
+   
+}
+
+void ossimTiling::setTileNameMask(const ossimString& mask)
+{
+   if(theTileNameMask == "")
+   {
+      theTileNameMask = "tile%i%";
+   }
+   if(mask.contains("%i%")||
+      mask.contains("%oc%")||
+      mask.contains("%or%")||
+      mask.contains("%r%")||
+      mask.contains("%c%")||
+      mask.contains("%SRTM%"))
+   {
+      theTileNameMask = mask;
+   }
+   else
+   {
+      theTileNameMask += "%i%";
+   }
+}
+
+ossimString ossimTiling::getTileNameMask()const
+{
+   return theTileNameMask;
+}
+
+bool ossimTiling::getRowCol(ossim_int64& row,
+                            ossim_int64& col,
+                            ossim_int64 tileId)const
+{
+   bool result = true;
+   
+   if((theTotalHorizontalTiles > 0)&&
+      (tileId < theTotalTiles))
+   {
+      row = tileId/static_cast<ossim_int64>(theTotalHorizontalTiles);
+      col = tileId%static_cast<ossim_int64>(theTotalHorizontalTiles);
+      if((col >= static_cast<ossim_int32>(theTotalHorizontalTiles)) &&
+         (row >= static_cast<ossim_int32>(theTotalVerticalTiles)))
+      {           
+         result = false;
+      }
+   }
+   return result;
+}
+
+bool ossimTiling::getOrigin(ossimDpt& origin,
+                            ossim_int64 tileId)const
+{
+   ossim_int64 row=0;
+   ossim_int64 col=0;
+   
+   bool result = getRowCol(row, col, tileId);
+   if(result)
+   {
+      result = getOrigin(origin, row, col);
+   }
+
+   return result;
+}
+
+bool ossimTiling::getOrigin(ossimDpt& origin,
+                            ossim_int64 row,
+                            ossim_int64 col)const
+{
+   bool result = false;
+
+   if((col < static_cast<ossim_int64>(theTotalHorizontalTiles)) &&
+      (row < static_cast<ossim_int64>(theTotalVerticalTiles)))
+   {
+      ossimDpt convertedTilingDistance;
+      getConvertedTilingDistance(convertedTilingDistance);
+
+      result = true;
+      if(theTilingRect.orientMode() == OSSIM_RIGHT_HANDED)
+      {
+         origin.x = theTilingRect.ul().x + col*convertedTilingDistance.x;
+         origin.y = theTilingRect.ul().y - row*convertedTilingDistance.y;
+      }
+      else
+      {
+         origin.x = theTilingRect.ul().x + col*convertedTilingDistance.x;
+         origin.y = theTilingRect.ul().y + row*convertedTilingDistance.y;
+      }
+   }
+
+   return result;
+}
+
+ossimDpt ossimTiling::getDeltaPerPixel()const
+{
+   
+   ossimDpt result = theDelta;
+
+   if (!theMapProjection)
+   {
+      return result;
+   }
+
+   if(theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS)
+   {
+      result = ossimDpt(theTilingDistance.x/theDelta.x,
+                        theTilingDistance.y/theDelta.y);
+   }
+
+   ossimUnitConversionTool unitConverter(theMapProjection->origin(),
+                                         1.0,
+                                         theTilingDistanceUnitType);
+   if(theMapProjection->isGeographic())
+   {
+      unitConverter.setValue(result.x, theTilingDistanceUnitType);
+      result.x = unitConverter.getValue(OSSIM_DEGREES);
+      
+      unitConverter.setValue(result.y,
+                             theTilingDistanceUnitType);
+      result.y = unitConverter.getValue(OSSIM_DEGREES);
+   }
+   else
+   {
+      unitConverter.setValue(result.x,
+                             theTilingDistanceUnitType);
+      result.x = unitConverter.getValue(OSSIM_METERS);
+      
+      unitConverter.setValue(result.y,
+                             theTilingDistanceUnitType);
+      result.y = unitConverter.getValue(OSSIM_METERS);
+   }
+
+   return result;
+}
+
+void ossimTiling::getTileName(ossimString& resultingName,
+                              ossim_int64 row,
+                              ossim_int64 col,
+                              ossim_int64 id)const
+{
+   if(theTileNameMask == "")
+   {
+      ostringstream idString;
+      idString << id;
+      resultingName = ossimString("tile") + idString.str().c_str();
+   }
+   else if(theTileNameMask.contains("%SRTM%"))
+   {
+      // must be a 1x1 degree tiling distance
+      //
+      if((theTilingDistanceUnitType == OSSIM_DEGREES)&&
+         (theTilingDistance.x == 1.0)&&
+         (theTilingDistance.x == 1.0))
+      {
+         ostringstream latString;
+         ostringstream lonString;
+         
+         resultingName = "";
+         ossimDpt origin;
+         getOrigin(origin, row, col);
+         // the name is lower left and not upper left 
+         // subtract one degree
+         //
+         origin.lat -=1;
+         latString << setfill('0') << setw(2) << fabs(origin.lat);
+         lonString << setfill('0') << setw(3) << fabs(origin.lon);
+         
+         if(origin.lat < 0.0)
+         {
+            resultingName += "S";
+         }
+         else 
+         {
+            resultingName += "N";
+         }
+         resultingName += latString.str().c_str();
+         if(origin.lon < 0.0)
+         {
+            resultingName += "W";
+         }
+         else
+         {
+            resultingName += "E";
+         }
+         resultingName += lonString.str().c_str();
+         resultingName += ".hgt";
+      }
+   }
+   else
+   {
+      ostringstream rowString;
+      ostringstream colString;
+      ostringstream idString;
+      ostringstream oRowString;
+      ostringstream oColString;
+      ossimDpt      origin;
+      getOrigin(origin, row, col);
+      
+      rowString << row;
+      colString << col;
+      idString  << id;
+      oRowString << row;
+      oColString << col;
+      
+      resultingName = theTileNameMask;
+      resultingName = resultingName.substitute("%r%",
+                                               rowString.str().c_str());
+      resultingName = resultingName.substitute("%c%",
+                                               colString.str().c_str());
+      resultingName = resultingName.substitute("%i%",
+                                               idString.str().c_str());
+      resultingName = resultingName.substitute("%oc",
+                                               oColString.str().c_str());
+      resultingName = resultingName.substitute("%or",
+                                               oRowString.str().c_str());
+   }
+}
+
+void ossimTiling::clampGeographic(ossimDrect& rect)const
+{
+   ossimDpt ul = rect.ul();
+   ossimDpt lr = rect.lr();
+
+   if(ul.lat > 90) ul.lat = 90.0;
+   if(lr.lat < -90.0) lr.lat = -90.0;
+
+   if(ul.lon < -180) ul.lon = -180;
+   if(lr.lon > 180)  lr.lon = 180;
+
+   rect = ossimDrect(ul, lr, rect.orientMode());
+}
+
+bool ossimTiling::saveState(ossimKeywordlist& kwl,
+                            const char* prefix)const
+{
+   std::stringstream tilingDistance;
+
+   tilingDistance << theTilingDistance.x << " " << theTilingDistance.y << std::endl;
+   
+   kwl.add(prefix,
+           "tiling_distance",
+           tilingDistance.str().c_str(),
+           true);
+
+   
+   kwl.add(prefix,
+           "tiling_distance_type",
+           ossimUnitTypeLut::instance()->
+           getTableIndexString(theTilingDistanceUnitType),
+           true);
+   std::ostringstream delta;
+   delta << theDelta.x << " " << theDelta.y;
+   kwl.add(prefix,
+           "delta",
+           delta.str().c_str(),
+           true);
+   
+   if(theDeltaType == ossimTilingDeltaType_TOTAL_PIXELS)
+   {
+      kwl.add(prefix,
+              "delta_type",
+              "total_pixels",
+              true);
+   }
+   else
+   {
+      kwl.add(prefix,
+              "delta_type",
+              "delta_per_pixels",
+              true);
+   }
+   std::ostringstream padding;
+
+   padding << thePaddingSizeInPixels.x << " " << thePaddingSizeInPixels.y;
+   kwl.add(prefix,
+           "padding_size_in_pixels",
+           padding.str().c_str(),
+           true);
+
+   kwl.add(prefix,
+           "tile_name_mask",
+           theTileNameMask.c_str(),
+           true);
+
+   if (theOutputSizeInBytes)
+   {
+      kwl.add(prefix,
+              "output_size_in_bytes",
+              ossimString::toString(theOutputSizeInBytes).c_str(),
+              true);
+      kwl.add(prefix,
+              "output_bands",
+              theNumberOfBands,
+              true);
+      kwl.add(prefix,
+              "output_bytes_per_pixel_per_band",
+              theNumberOfBytesPerPixelPerBand,
+              true);
+   }
+
+   kwl.add(prefix,
+           "edge_to_edge",
+           ossimString::toString(theEdgeToEdgeFlag),
+           true);
+   
+   
+   return true;
+}
+
+bool ossimTiling::loadState(const ossimKeywordlist& kwl,
+                            const char* prefix)
+{
+   bool result = false;
+   
+   // Get the mask if any.
+   theTileNameMask = kwl.find(prefix, "tile_name_mask");
+   setTileNameMask(theTileNameMask);
+
+   const char* paddingSizeInPixels = kwl.find(prefix,
+                                              "padding_size_in_pixels");
+   if (paddingSizeInPixels)
+   {
+      ossimString x,y;
+      std::istringstream padding(ossimString(paddingSizeInPixels).c_str());
+      padding >> x >> y;
+      thePaddingSizeInPixels.x = x.toFloat64();
+      thePaddingSizeInPixels.y = y.toFloat64();
+   }
+   
+   // Check to tile by size in bytes.
+   const char* lookup;
+   if (kwl.numberOf(prefix, "output_size_in_"))
+   {
+      lookup = kwl.find(prefix, "output_size_in_bytes");
+      if (lookup)
+      {
+         theOutputSizeInBytes = ossimString(lookup).toInt64();
+      }
+      lookup = kwl.find(prefix, "output_size_in_kilo_bytes");
+      if (lookup)
+      {
+         theOutputSizeInBytes = ossimString(lookup).toInt64() * 1024;
+      }
+      lookup = kwl.find(prefix, "output_size_in_mega_bytes");
+      if (lookup)
+      {
+         theOutputSizeInBytes = ossimString(lookup).toInt64() * 1024 * 1024;
+      }
+   }
+
+   if (theOutputSizeInBytes)
+   {
+      
+      lookup = kwl.find(prefix, "output_bands");
+      if (lookup)
+      {
+         theNumberOfBands = ossimString(lookup).toInt32();
+      }
+      lookup = kwl.find(prefix, "output_bytes_per_pixel_per_band");
+      if (lookup)
+      {
+         theNumberOfBytesPerPixelPerBand = ossimString(lookup).toInt32();
+      }
+      
+      ossim_int64 pixelsPerBand = theOutputSizeInBytes /
+         (theNumberOfBands * theNumberOfBytesPerPixelPerBand);
+      
+      ossim_int32 oneDimension =
+         static_cast<ossim_int32>(floor(sqrt((double)pixelsPerBand)));
+
+      //---
+      // TODO: Clamp to power of two option. (drb)
+      //---
+      // theDelta.x = oneDimension;
+      // theDelta.y = oneDimension;
+      // theTilingDistance.x = 1;
+      // theTilingDistance.y = 1;
+      
+      theDelta.x = 1;
+      theDelta.y = 1;
+      theTilingDistance.x = oneDimension;
+      theTilingDistance.y = oneDimension;
+      theDeltaType = ossimTilingDeltaType_TOTAL_PIXELS;
+      theTilingDistanceUnitType = OSSIM_PIXEL;
+      result = true;
+   }
+   else
+   {
+      const char* tilingDistance = kwl.find(prefix,
+                                            "tiling_distance");
+      const char* tilingDistanceType = kwl.find(prefix,
+                                                "tiling_distance_type");
+      const char* delta = kwl.find(prefix,
+                                   "delta");
+      
+      const char* deltaType = kwl.find(prefix,
+                                       "delta_type");
+      
+      result = tilingDistance&&tilingDistanceType&&delta&&deltaType&&paddingSizeInPixels;
+      ossimString x,y;
+      std::istringstream distance(ossimString(tilingDistance).c_str());
+      distance >> x >> y;
+      theTilingDistance.x = x.toFloat64();
+      theTilingDistance.y = y.toFloat64();
+      if(theTilingDistance.x <= 0.0)
+      {
+         theTilingDistance.x = 1.0;
+      }
+      if(theTilingDistance.y<=0.0)
+      {
+         theTilingDistance.y = theTilingDistance.x;
+      }
+      
+      // unitLut.getTableIndexString(theTilingDistanceUnitType), ?????
+      
+      theTilingDistanceUnitType = (ossimUnitType)
+         ossimUnitTypeLut::instance()->getEntryNumber(
+            ossimString(tilingDistanceType).c_str());
+      
+      theDelta = ossimDpt(0,0);
+      x="";
+      y="";
+      std::istringstream deltaValues(ossimString(delta).c_str());
+      deltaValues >> x >> y;
+      theDelta.x = x.toFloat64();
+      theDelta.y = y.toFloat64();
+      
+      if(theDelta.x <= 0.0)
+      {
+         theDelta.x = 1.0;
+      }
+      
+      if(theDelta.y <= 0.0)
+      {
+         theDelta.y = theDelta.x;
+      }
+      
+      if(ossimString(deltaType).downcase().contains("total"))
+      {
+         theDeltaType = ossimTilingDeltaType_TOTAL_PIXELS;
+      }
+      else
+      {
+         theDeltaType = ossimTilingDeltaType_PER_PIXEL;
+      }
+   }
+   
+   lookup = kwl.find(prefix, "edge_to_edge");
+   if ( lookup )
+   {
+      theEdgeToEdgeFlag = ossimString::toBool(lookup);
+   }
+      
+   if (traceDebug())
+   {
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+
+   return result;
+}
+
+std::ostream& ossimTiling::print(std::ostream& out) const
+{
+   out << "theTilingDistance:                 " << theTilingDistance
+       << "\ntheTilingDistanceUnitType:       " << theTilingDistanceUnitType
+       << "\ntheDelta:                        " << theDelta
+       << "\ntheDeltaType:                    " << theDeltaType
+       << "\nthePaddingSizeInPixels:          " << thePaddingSizeInPixels
+       << "\ntheImageRect:                    " << theImageRect
+       << "\ntheTilingRect:                   " << theTilingRect
+       << "\ntheTileId:                       " << theTileId
+       << "\ntheTotalHorizontalTiles:         " << theTotalHorizontalTiles
+       << "\ntheTotalVerticalTiles:           " << theTotalVerticalTiles
+       << "\ntheTotalTiles:                   " << theTotalTiles
+       << "\ntheTileNameMask:                 " << theTileNameMask
+       << "\ntheOutputSizeInBytes:            " << theOutputSizeInBytes
+       << "\ntheNumberOfBands:                " << theNumberOfBands
+       << "\ntheNumberOfBytesPerPixelPerBand: " <<
+      theNumberOfBytesPerPixelPerBand
+       << "\ntheEdgeToEdgeFlag:               " << theEdgeToEdgeFlag
+       << "\n";
+
+   if (theMapProjection.valid())
+   {
+      out << "\ntheMapProjection:\n";
+      theMapProjection->print(out);
+   }
+   else
+   {
+      out << "theMapProjection is not set.";
+   }
+   out << endl;
+
+   return out;
+}
+
+void ossimTiling::getConvertedTilingDistance(ossimDpt& pt) const
+{
+   if(theTilingDistanceUnitType == OSSIM_PIXEL)
+   {
+      pt = theTilingDistance;
+      return;
+   }
+   if (!theMapProjection)
+   {
+      // This should not happen...
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTiling::getConvertedTilingDistance WARNING"
+         << " projection not set!" << endl;
+      pt = theTilingDistance;
+      return;
+   }
+   ossimUnitConversionTool unitConverter(theMapProjection->origin(),
+                                         1.0,
+                                         theTilingDistanceUnitType);
+
+   if(theMapProjection->isGeographic())
+   {
+      unitConverter.setValue(theTilingDistance.x,
+                             theTilingDistanceUnitType);
+      pt.x = unitConverter.getValue(OSSIM_DEGREES);
+      
+      unitConverter.setValue(theTilingDistance.y,
+                             theTilingDistanceUnitType);
+      pt.y = unitConverter.getValue(OSSIM_DEGREES);
+   }
+   else
+   {
+      unitConverter.setValue(theTilingDistance.x,
+                             theTilingDistanceUnitType);
+      pt.x = unitConverter.getValue(OSSIM_METERS);
+      
+      unitConverter.setValue(theTilingDistance.y,
+                             theTilingDistanceUnitType);
+      pt.y = unitConverter.getValue(OSSIM_METERS);
+   }
+}
diff --git a/src/imaging/ossimTilingPoly.cpp b/src/imaging/ossimTilingPoly.cpp
new file mode 100644
index 0000000..61ddc56
--- /dev/null
+++ b/src/imaging/ossimTilingPoly.cpp
@@ -0,0 +1,369 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Mingjie Su
+// 
+// Description: implementation for image generator
+//
+//*************************************************************************
+// $Id: ossimTilingPoly.cpp 2725 2011-06-15 18:13:07Z david.burken $
+
+#include <sstream>
+#include <iomanip>
+#include <ossim/imaging/ossimTilingPoly.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimEsriShapeFileInterface.h>
+
+static ossimTrace traceDebug("ossimTilingPoly:debug");
+
+RTTI_DEF1(ossimTilingPoly, "ossimTilingPoly", ossimTilingRect);
+
+ossimTilingPoly::ossimTilingPoly()
+      : ossimTilingRect(),
+      m_shpFilename(""),
+      m_useMbr(true),
+      m_bufferDistance(0.0),
+      m_exteriorCut(0),
+      m_interiorCut(0),
+      m_featureBoundingIntersect(true)
+{
+}
+
+ossimTilingPoly::~ossimTilingPoly()
+{
+   m_exteriorCut = 0; // Ref ptr, not a leak.
+   m_interiorCut = 0; // ditto...
+   m_features.clear();
+}
+
+bool ossimTilingPoly::initialize(const ossimMapProjection& proj,
+                             const ossimIrect& boundingRect)
+{
+   bool result = false;
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTilingPoly::initialize DEBUG: Entered..."
+         << "\nBounding rect === " << boundingRect
+         << std::endl;
+   }
+
+   ossimDpt convertedTilingDistance = theTilingDistance;
+   result = initializeBase(proj, boundingRect, convertedTilingDistance);
+   if (result)
+   {
+      return parseShpFile();
+   }
+   return result;
+}
+
+bool ossimTilingPoly::next(ossimRefPtr<ossimMapProjection>& resultProjection,
+                           ossimIrect& resultingBounds,
+                           ossimString& resultingName)
+{
+   bool result = true;
+   
+   if(theTileId < theTotalTiles)
+   {
+      ostringstream idString;
+      ossim_int64 tileId = theTileId + 1;
+      if (tileId < static_cast<ossim_int64>(m_features.size()))
+      {
+         idString  << m_features[tileId].m_fid;
+         resultingName = theTileNameMask;
+         resultingName = resultingName.substitute("%f%", idString.str().c_str());
+      }
+      result = nextFeature();
+      resultingBounds = m_exteriorCut->getRectangle();
+
+      resultProjection = theMapProjection;
+
+      ++theTileId; 
+   }
+   else
+   {
+      result = false;
+   }
+
+   return result;
+}
+
+bool ossimTilingPoly::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   kwl.add(prefix,
+           "tile_source",
+           m_shpFilename.c_str(),
+           true);
+
+   kwl.add(prefix,
+      "paddding_use_mbr",
+      m_useMbr,
+      true);
+
+   return  ossimTilingRect::saveState(kwl, prefix);;
+}
+
+bool ossimTilingPoly::loadState(const ossimKeywordlist& kwl,
+                            const char* prefix)
+{
+   bool result = ossimTilingRect::loadState(kwl, prefix);
+   
+   //Get the shp file if any
+   m_shpFilename = kwl.find(prefix, "tile_source");
+
+   // Get the mask if any.
+   if (!m_shpFilename.empty())
+   {
+      if (theTileNameMask.contains("%r%_%c%"))
+      {
+         theTileNameMask = theTileNameMask.substitute("%r%_%c%", "%f%", true);
+      }
+      result = true;
+   }
+ 
+   const char* useMbr = kwl.find(prefix, "padding_use_mbr");
+   if (useMbr)
+   {
+      if (!ossimString(useMbr).toBool())
+      {
+         m_useMbr = false;
+         m_bufferDistance = thePaddingSizeInPixels.x;
+      }
+   }
+
+   return result;
+}
+
+bool ossimTilingPoly::nextFeature()
+{
+   if (m_exteriorCut == 0)
+   {
+      m_exteriorCut = new ossimGeoPolyCutter;
+      m_exteriorCut->setView(theMapProjection.get());
+   }
+   
+   bool result = false;
+   ossim_int64 tileId = theTileId + 1;//use (theTileId+1) because theTileId is intialized as -1
+   if (tileId < static_cast<ossim_int64>(m_features.size())) 
+   {
+      if (m_features[tileId].m_polygon.size() > 0)
+      {
+         if (m_features[tileId].m_polyType == ossimGeoAnnotationPolyObject::OSSIM_POLY_INTERIOR_RING)
+         {
+            if (m_interiorCut == 0)
+            {
+               m_interiorCut = new ossimGeoPolyCutter;
+               m_interiorCut->setView(theMapProjection.get());
+               m_interiorCut->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
+            }
+            m_interiorCut->setPolygon(m_features[tileId].m_polygon);
+         }
+         else
+         {
+            // std::vector<ossimGpt> points = m_features[tileId].m_polygon;
+            // for (ossim_uint32 i = 0; i < points.size(); i++)
+            // {
+            //    ossimGpt point = points[i];
+            // }
+            m_exteriorCut->setPolygon(m_features[tileId].m_polygon);
+            setRect();
+         }
+         result = true;
+      }
+      else if (m_features[tileId].m_multiPolys.size() > 0)
+      {
+         for (ossim_uint32 i = 0; i < m_features[tileId].m_multiPolys.size(); i++)
+         {
+            ossimGeoPolygon geoPoly = m_features[tileId].m_multiPolys[i];
+            std::vector<ossimGeoPolygon> holePolys = geoPoly.getHoleList();
+            if (holePolys.size() > 0)
+            {
+               if (m_interiorCut == 0)
+               {
+                  m_interiorCut = new ossimGeoPolyCutter;
+                  m_interiorCut->setView(theMapProjection.get());
+                  m_interiorCut->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
+               }
+               m_interiorCut->clear();
+               for (ossim_uint32 j = 0; j < holePolys.size(); j++)
+               {
+                  m_interiorCut->addPolygon(holePolys[j]);
+               }
+            }
+            m_exteriorCut->setPolygon(m_features[tileId].m_multiPolys[i]);
+            setRect();
+         }
+         result = true;
+      }
+   }
+   else
+   {
+      result = false;
+   }
+   return result;
+}
+
+ void ossimTilingPoly::setRect()
+ {
+    ossimIrect rect = m_exteriorCut->getRectangle();
+    if (rect.intersects(theImageRect))
+    {
+       m_featureBoundingIntersect = true;
+       if (!rect.completely_within(theImageRect))
+       {
+          ossimIrect clipRect = rect.clipToRect(theImageRect);
+          m_exteriorCut->setRectangle(clipRect);
+          rect = clipRect;
+       }
+    }
+    else
+    {
+       m_featureBoundingIntersect = false;
+    }
+    if (m_useMbr)
+    {
+       if (thePaddingSizeInPixels.x > 0 && thePaddingSizeInPixels.y > 0)
+       {
+          ossimIrect newRect = ossimIrect(rect.ul().x-(ossim_int32)thePaddingSizeInPixels.x,
+             rect.ul().y-(ossim_int32)thePaddingSizeInPixels.y,
+             rect.lr().x + (ossim_int32)thePaddingSizeInPixels.x,
+             rect.lr().y + (ossim_int32)thePaddingSizeInPixels.y);
+          ossimIrect clipRect = newRect.clipToRect(theImageRect);//in case the bounding is larger than input image after adding buffer
+          m_exteriorCut->setRectangle(clipRect);
+       }
+    }
+ }
+
+bool ossimTilingPoly::parseShpFile()
+{
+   m_features.clear();
+
+   ossimString query = "";
+   bool result = false;
+   if (m_shpFilename.contains("|"))
+   {
+      ossimString fileName = m_shpFilename;
+      std::vector<ossimString> fileList = fileName.split("|");
+      if (fileList.size() > 1)
+      {
+         m_shpFilename = fileList[0];
+         query = fileList[1];
+      }
+   }
+
+   ossimRefPtr<ossimImageHandler> shpHandler = ossimImageHandlerRegistry::instance()->open(m_shpFilename);
+   ossimEsriShapeFileInterface* shpInterface = PTR_CAST(ossimEsriShapeFileInterface, shpHandler.get());
+   if (shpInterface != 0)
+   {
+      if (!query.empty())
+      {
+         shpInterface->setQuery(query);
+      }
+      if (m_useMbr == false)
+      {
+         ossimProjection* proj = shpHandler->getImageGeometry()->getProjection();
+         ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);
+         if (mapProj)
+         {
+            if (mapProj->isGeographic())
+            {
+               m_bufferDistance = thePaddingSizeInPixels.x * theMapProjection->getDecimalDegreesPerPixel().x;
+               shpInterface->setGeometryBuffer(m_bufferDistance, OSSIM_DEGREES);
+            }
+            else
+            {
+               m_bufferDistance = thePaddingSizeInPixels.x * theMapProjection->getMetersPerPixel().x;
+               shpInterface->setGeometryBuffer(m_bufferDistance, OSSIM_METERS);
+            }
+         }
+      }
+      std::multimap<long, ossimAnnotationObject*> features = shpInterface->getFeatureTable();
+      if (features.size() > 0)
+      {
+         std::multimap<long, ossimAnnotationObject*>::iterator it = features.begin();
+         while (it != features.end())
+         {
+            ossimAnnotationObject* anno = it->second;
+            if (anno != 0)
+            {
+               ossimGeoAnnotationPolyObject* annoPoly = PTR_CAST(ossimGeoAnnotationPolyObject, anno);
+               ossimGeoAnnotationMultiPolyObject* annoMultiPoly = 0;
+               if (annoPoly == 0)
+               {
+                  annoMultiPoly = PTR_CAST(ossimGeoAnnotationMultiPolyObject, anno);
+               }
+               if (annoPoly != 0)
+               {
+                  result = true;
+                  std::vector<ossimGpt> polygon;
+
+                  //get the points of a polygon
+                  std::vector<ossimGpt> points = annoPoly->getPoints();
+                  for (ossim_uint32 i = 0; i < points.size(); i++)
+                  {
+                     polygon.push_back(points[i]);
+                  }
+
+                  //get polygon type, if it is an internal polygon, initialize the internal cutter
+                  ossimGeoAnnotationPolyObject::ossimPolyType polyType = annoPoly->getPolyType();
+                  ossimShpFeature feature(it->first, polyType, polygon, std::vector<ossimGeoPolygon>()); 
+                  m_features.push_back(feature);
+               }
+               else if (annoMultiPoly != 0)
+               {
+                  std::vector<ossimGeoPolygon> multiPolys = annoMultiPoly->getMultiPolygon();
+                  ossimShpFeature feature(it->first, 0, std::vector<ossimGpt>(), multiPolys); 
+               }
+            }
+            it++;
+         }
+      }
+   }
+   if (m_features.size() > 0)
+   {
+      theTotalTiles = m_features.size();
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTilingPoly::useMbr() const
+{
+   //if the use_mbr is set to true, no matter if the padding is set to 0 or greater than 0,
+   //always clip the MBR of each feature
+   return m_useMbr;
+}
+
+bool ossimTilingPoly::hasExteriorCut() const
+{
+   return m_exteriorCut.valid();
+}
+
+bool ossimTilingPoly::hasInteriorCut() const
+{
+   return m_interiorCut.valid();
+}
+
+ossimRefPtr<ossimGeoPolyCutter>& ossimTilingPoly::getExteriorCut()
+{
+   return m_exteriorCut;
+}
+
+ossimRefPtr<ossimGeoPolyCutter>& ossimTilingPoly::getInteriorCut()
+{
+   return m_interiorCut;
+}
+
+bool ossimTilingPoly::isFeatureBoundingIntersect() const
+{
+   return m_featureBoundingIntersect;
+}
diff --git a/src/imaging/ossimTilingRect.cpp b/src/imaging/ossimTilingRect.cpp
new file mode 100644
index 0000000..941692e
--- /dev/null
+++ b/src/imaging/ossimTilingRect.cpp
@@ -0,0 +1,886 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Mingjie Su
+// 
+// Description: implementation for image generator
+//
+//*************************************************************************
+// $Id: ossimTilingRect.cpp 2725 2011-06-15 18:13:07Z david.burken $
+
+#include <sstream>
+#include <iomanip>
+#include <ossim/imaging/ossimTilingRect.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimEsriShapeFileInterface.h>
+
+static ossimTrace traceDebug("ossimTilingRect:debug");
+
+RTTI_DEF1(ossimTilingRect, "ossimTilingRect", ossimTiling);
+
+ossimTilingRect::ossimTilingRect()
+      : ossimTiling(),
+      m_clipToAoi(true),
+      m_lastWidth(0),
+      m_lastHeight(0),
+      m_useOffset(false),
+      m_offsetInPixels(0,0),
+      m_tilingDistanceInPixels(0,0),
+      m_tilinResolutionDistance(ossim::nan(),ossim::nan()),
+      m_tilingResolutionUnitType(OSSIM_UNIT_UNKNOWN),
+      m_fractionalPixelMisalignment(ossim::nan(),ossim::nan())
+{
+}
+
+ossimTilingRect::~ossimTilingRect()
+{
+}
+
+bool ossimTilingRect::initializeBase(const ossimMapProjection& proj,
+   const ossimIrect& boundingRect,
+   ossimDpt& convertedTilingDistance)
+{
+   theMapProjection = (ossimMapProjection*)proj.dup();
+   theImageRect     = boundingRect;
+
+   ossimDpt gsd = theMapProjection->getMetersPerPixel();
+   // Find image center and GSD at that point:
+   if (theMapProjection->isGeographic() && theTilingDistanceUnitType != OSSIM_DEGREES)
+   {
+      ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry (0, theMapProjection.get());
+      geom->setImageSize(ossimIpt(theImageRect.width(), theImageRect.height()));
+      gsd = geom->getMetersPerPixel();
+   }
+
+   m_tilingDistanceInPixels = theTilingDistance;
+
+   //if resolution and resolution type are defined, need to reset degree/meter per pixel and the image rect. do calculation below
+   ossim_float64 latDiff = 0.0;
+   ossim_float64 lonDiff = 0.0;
+   ossim_uint32 imageWidth = 0;
+   ossim_uint32 imageHeight = 0;
+   if (!m_tilinResolutionDistance.hasNans())
+   {
+      ossimDpt result(0,0);
+      if (m_tilingResolutionUnitType == OSSIM_DEGREES)
+      {
+         ossimGpt ulg;
+         ossimGpt llg;
+         ossimGpt lrg;
+         ossimGpt urg;
+
+         theMapProjection->lineSampleToWorld(theImageRect.ul(), ulg);
+         theMapProjection->lineSampleToWorld(theImageRect.ll(), llg);
+         theMapProjection->lineSampleToWorld(theImageRect.lr(), lrg);
+         theMapProjection->lineSampleToWorld(theImageRect.ur(), urg);
+
+         latDiff = fabs(ulg.lat - llg.lat);
+         lonDiff = fabs(urg.lon - llg.lon);
+
+         if (!theMapProjection->isGeographic())
+         {
+            ossim_float64 tileHorizatalNum = lonDiff/m_tilinResolutionDistance.x;
+            ossim_float64 tileVerticalNum = latDiff/m_tilinResolutionDistance.y;
+
+            if (theTilingDistanceUnitType != OSSIM_PIXEL) //convert tiling distance to pixel if unit type is not pixel
+            {
+               ossimDpt convertedDis = m_tilingDistanceInPixels;
+               getConvertedDistance(convertedDis, m_tilingDistanceInPixels);
+               imageWidth = (ossim_uint32)convertedDis.x/gsd.x*tileHorizatalNum;
+               imageHeight = (ossim_uint32)convertedDis.y/gsd.y*tileVerticalNum;
+            }
+            else
+            {
+               imageWidth = (ossim_uint32)m_tilingDistanceInPixels.x*tileHorizatalNum;
+               imageHeight = (ossim_uint32)m_tilingDistanceInPixels.y*tileVerticalNum;
+            }
+            result = ossimDpt(theImageRect.width()*gsd.x/imageWidth, theImageRect.height()*gsd.y/imageHeight);
+            gsd = result;
+
+            theMapProjection->setMetersPerPixel(result);
+         }
+         else
+         {
+            result = ossimDpt(m_tilinResolutionDistance.x/m_tilingDistanceInPixels.x,
+               m_tilinResolutionDistance.y/m_tilingDistanceInPixels.y);
+
+            theMapProjection->setDecimalDegreesPerPixel(result);
+         }
+      }
+      else //only handle degree type for resolution
+      {
+         return false;
+      }
+   }
+
+   if (theTilingDistanceUnitType != OSSIM_PIXEL)
+   {
+      ossimDpt paddingSize = getPaddingSize();//convert padding size to meters or degree
+      getConvertedDistance(convertedTilingDistance, theTilingDistance);
+
+      ossimDpt convertedOffset = m_offsetInPixels;
+      if (m_useOffset)
+      {
+         getConvertedDistance(convertedOffset, m_offsetInPixels);
+      }
+
+      if (theMapProjection->isGeographic() && theTilingDistanceUnitType == OSSIM_DEGREES)
+      {
+         thePaddingSizeInPixels.x = ossim::round<int>(paddingSize.x / theMapProjection->getDecimalDegreesPerPixel().x);
+         thePaddingSizeInPixels.y = ossim::round<int>(paddingSize.y / theMapProjection->getDecimalDegreesPerPixel().y);
+
+         double intpart;
+         m_fractionalPixelMisalignment.x = modf(convertedTilingDistance.x / theMapProjection->getDecimalDegreesPerPixel().x, &intpart);
+         m_fractionalPixelMisalignment.y = modf(convertedTilingDistance.y / theMapProjection->getDecimalDegreesPerPixel().y, &intpart);
+
+         m_tilingDistanceInPixels.x = ossim::round<int>(convertedTilingDistance.x / theMapProjection->getDecimalDegreesPerPixel().x);
+         m_tilingDistanceInPixels.y = ossim::round<int>(convertedTilingDistance.y / theMapProjection->getDecimalDegreesPerPixel().y);
+
+         if (m_useOffset)
+         {
+            m_offsetInPixels.x = ossim::round<int>(convertedOffset.x / theMapProjection->getDecimalDegreesPerPixel().x);
+            m_offsetInPixels.y = ossim::round<int>(convertedOffset.y / theMapProjection->getDecimalDegreesPerPixel().y);
+         }
+      }
+      else
+      {
+         thePaddingSizeInPixels.x = ossim::round<int>(paddingSize.x / gsd.x);
+         thePaddingSizeInPixels.y = ossim::round<int>(paddingSize.y / gsd.y);
+
+         double intpart;
+         m_fractionalPixelMisalignment.x = modf(convertedTilingDistance.x / gsd.x, &intpart);
+         m_fractionalPixelMisalignment.y = modf(convertedTilingDistance.y / gsd.y, &intpart);
+
+         m_tilingDistanceInPixels.x = ossim::round<int>(convertedTilingDistance.x / gsd.x);
+         m_tilingDistanceInPixels.y = ossim::round<int>(convertedTilingDistance.y / gsd.y);
+
+         if (m_useOffset)
+         {
+            m_offsetInPixels.x = ossim::round<int>(convertedOffset.x / gsd.x);
+            m_offsetInPixels.y = ossim::round<int>(convertedOffset.y / gsd.y);
+         }
+      }
+   }
+   else
+   {
+      if (theMapProjection->isGeographic())
+      {
+         theTilingDistance.x = theTilingDistance.x * theMapProjection->getDecimalDegreesPerPixel().x;
+         theTilingDistance.y = theTilingDistance.y * theMapProjection->getDecimalDegreesPerPixel().y;
+      }
+      else
+      {
+         theTilingDistance.x = theTilingDistance.x * gsd.x;
+         theTilingDistance.y = theTilingDistance.y * gsd.y;
+      }
+   }
+
+   //re-calculation the image rect if resolution and resolution type defined
+   if (!m_tilinResolutionDistance.hasNans())
+   {
+      if (theMapProjection->isGeographic())
+      {
+         imageWidth = (ossim_uint32)m_tilingDistanceInPixels.x * lonDiff;
+         imageHeight = (ossim_uint32)m_tilingDistanceInPixels.y * latDiff;
+      }
+
+      //avoid very small pixel offset by calculation if tiling distance unit type is pixel
+      if (theTilingDistanceUnitType == OSSIM_PIXEL)
+      {
+         if (imageWidth % (ossim_int32)m_tilingDistanceInPixels.x != 0)
+         {
+            ossim_int32 numX =  ossim::round<int>((double)imageWidth/m_tilingDistanceInPixels.x);
+            imageWidth = m_tilingDistanceInPixels.x * numX;
+         }
+         if (imageHeight % (ossim_int32)m_tilingDistanceInPixels.y != 0)
+         {
+            ossim_int32 numY =  ossim::round<int>((double)imageHeight/m_tilingDistanceInPixels.y);
+            imageHeight = m_tilingDistanceInPixels.y * numY;
+         }
+      }
+    
+      theImageRect = ossimIrect(boundingRect.ul(),
+         ossimIpt((boundingRect.ul().x + imageWidth), boundingRect.ul().y),
+         ossimIpt((boundingRect.ul().x + imageWidth), (imageHeight - boundingRect.ul().y)),
+         ossimIpt(boundingRect.ul().x , (imageHeight - boundingRect.ul().y)));
+   }
+   return true;
+}
+
+bool ossimTilingRect::initialize(const ossimMapProjection& proj,
+   const ossimIrect& boundingRect)
+{
+   bool result = false;
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimTilingRect::initialize DEBUG: Entered..."
+         << "\nBounding rect === " << boundingRect
+         << std::endl;
+   }
+
+   ossimDpt convertedTilingDistance = theTilingDistance;
+   result = initializeBase(proj, boundingRect, convertedTilingDistance);
+   ossimDrect tilingRectInPixels = theImageRect;
+
+   // Let's setup the bounding tile rect.
+   if(theMapProjection->isGeographic())
+   {
+      ossimGpt ul;
+      ossimGpt ur;
+      ossimGpt lr;
+      ossimGpt ll;
+
+      theMapProjection->lineSampleToWorld(theImageRect.ul(), ul);
+      theMapProjection->lineSampleToWorld(theImageRect.ur(), ur);
+      theMapProjection->lineSampleToWorld(theImageRect.lr(), lr);
+      theMapProjection->lineSampleToWorld(theImageRect.ll(), ll);
+
+      theTilingRect = ossimDrect(ossimDpt(ul), ossimDpt(ur), ossimDpt(lr), ossimDpt(ll),
+         OSSIM_RIGHT_HANDED);
+
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG: Geographic input bounds =  "
+            << theTilingRect
+            << std::endl;
+      }
+
+      if (!m_clipToAoi)
+      {
+         theTilingRect.stretchToTileBoundary(convertedTilingDistance);
+      }
+
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG: Geographic input bounds stretched =  "
+            << theTilingRect << std::endl;
+      }
+
+      clampGeographic(theTilingRect);
+
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG: Geographic input bounds clamped =  "
+            << theTilingRect << std::endl;
+      }
+
+   }  // End "if(theMapProjection->isGeographic())"
+   else // meters
+   {
+      ossimDpt ul;
+      ossimDpt ur;
+      ossimDpt lr;
+      ossimDpt ll;
+
+      theMapProjection->lineSampleToEastingNorthing(theImageRect.ul(), ul);
+      theMapProjection->lineSampleToEastingNorthing(theImageRect.ur(), ur);
+      theMapProjection->lineSampleToEastingNorthing(theImageRect.lr(), lr);
+      theMapProjection->lineSampleToEastingNorthing(theImageRect.ll(), ll);
+      theTilingRect = ossimDrect(ul, ur, lr, ll, OSSIM_RIGHT_HANDED);
+
+      if (!m_clipToAoi)
+      {
+         theTilingRect.stretchToTileBoundary(convertedTilingDistance);
+      }
+   }
+
+   theTotalHorizontalTiles = ossim::round<int>(fabs(tilingRectInPixels.ur().x - tilingRectInPixels.ul().x)/m_tilingDistanceInPixels.x);
+   theTotalVerticalTiles   = ossim::round<int>(fabs(tilingRectInPixels.ur().y - tilingRectInPixels.lr().y)/m_tilingDistanceInPixels.y);
+
+   if (m_clipToAoi)
+   {
+      if (m_useOffset)
+      {
+         ossim_float32 totalHorizontalTilesAfterOffset = 
+            ((fabs(tilingRectInPixels.ur().x - tilingRectInPixels.ul().x))-m_tilingDistanceInPixels.x)/(m_tilingDistanceInPixels.x - m_offsetInPixels.x) + 1;
+         ossim_float32 totalVerticalTilesAfterOffset = 
+            ((fabs(tilingRectInPixels.ur().y - tilingRectInPixels.lr().y))-m_tilingDistanceInPixels.y)/(m_tilingDistanceInPixels.y - m_offsetInPixels.y) + 1;
+
+         ossim_float32 lastHorizontal = totalHorizontalTilesAfterOffset - (ossim_int32)totalHorizontalTilesAfterOffset;
+         ossim_float32 lastVertical = totalVerticalTilesAfterOffset - (ossim_int32)totalVerticalTilesAfterOffset;
+
+         m_lastWidth = ossim::round<int>(fabs(lastHorizontal* (m_tilingDistanceInPixels.x - m_offsetInPixels.x) + m_offsetInPixels.x));
+         m_lastHeight = ossim::round<int>(fabs(lastVertical* (m_tilingDistanceInPixels.y - m_offsetInPixels.y) + m_offsetInPixels.y));
+
+         theTotalHorizontalTiles = ossim::round<int>(totalHorizontalTilesAfterOffset);
+         theTotalVerticalTiles = ossim::round<int>(totalVerticalTilesAfterOffset);
+
+         if (m_lastWidth > 0 && (lastHorizontal < 0.5))//if lastHorizontal is less than 0.5, the last tile will not add to total tiles after rounding, do here
+         {
+            theTotalHorizontalTiles = theTotalHorizontalTiles + 1;
+         }
+         if (m_lastHeight > 0 && (lastVertical < 0.5))
+         {
+            theTotalVerticalTiles = theTotalVerticalTiles + 1;
+         }
+      }
+      else
+      {
+         ossim_int32 tmpX = (ossim_int32)(fabs(tilingRectInPixels.ur().x - tilingRectInPixels.ul().x)) + 1;
+         ossim_int32 tmpY = (ossim_int32)(fabs(tilingRectInPixels.ur().y - tilingRectInPixels.lr().y)) + 1;
+
+         ossim_int32 modValueX = tmpX % (ossim_int32)m_tilingDistanceInPixels.x;
+         ossim_int32 modValueY = tmpY % (ossim_int32)m_tilingDistanceInPixels.y;
+         if (modValueX >= 1)
+         {
+            m_lastWidth = modValueX;
+         }
+         else
+         {
+            m_lastWidth = m_tilingDistanceInPixels.x;
+         }
+         if (modValueY >= 1)
+         {
+            m_lastHeight = modValueY;
+         }
+         else
+         {
+            m_lastHeight = m_tilingDistanceInPixels.y;
+         }
+
+         if (m_lastWidth > 0)
+         {  
+            if (m_lastWidth < m_tilingDistanceInPixels.x/2)
+            {
+               theTotalHorizontalTiles = theTotalHorizontalTiles + 1;
+            }
+         }
+         if (m_lastHeight > 0)
+         {
+            if (m_lastHeight < m_tilingDistanceInPixels.y/2)
+            {
+               theTotalVerticalTiles = theTotalVerticalTiles + 1;
+            }
+         }
+      }
+   }
+
+   theTotalTiles = theTotalHorizontalTiles*theTotalVerticalTiles;
+
+   // reset the tile id to the beginning
+   reset();
+
+   if(traceDebug())
+   {
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimTiling::initialize DEBUG: Leaving..." << std::endl;
+   }
+
+   return result;
+}
+
+bool ossimTilingRect::next(ossimRefPtr<ossimMapProjection>& resultProjection,
+   ossimIrect& resultingBounds,
+   ossimString& resultingName)
+{
+   bool result = true;
+
+   if(theTileId < theTotalTiles)
+   {
+      ossimDpt origin;
+      ossim_int64 row=0;
+      ossim_int64 col=0;
+
+      getRowCol(row, col, theTileId);
+
+      getTileName(resultingName,
+         (row+1), (col+1), theTileId);
+
+      getOrigin(origin, row, col);
+
+      if (!m_fractionalPixelMisalignment.isNan())
+      {
+         if (row == 0 && col != 0)
+         {
+            if (m_fractionalPixelMisalignment.x >= 0.5)
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getDecimalDegreesPerPixel().x * col;
+               }
+               else
+               {
+                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getMetersPerPixel().x * col;
+               }
+            }  
+            else
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getDecimalDegreesPerPixel().x * col;
+               }
+               else
+               {
+                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getMetersPerPixel().x * col;
+               }
+            }
+         }
+         else if (col == 0 && row != 0)
+         {
+            if (m_fractionalPixelMisalignment.y >= 0.5)
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getDecimalDegreesPerPixel().y * row;
+               }
+               else
+               {
+                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getMetersPerPixel().y * row;
+               }
+            }
+            else
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getDecimalDegreesPerPixel().y * row;
+               }
+               else
+               {
+                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getMetersPerPixel().y * row;
+               }  
+            }
+         }
+         else if (col != 0 && row != 0)
+         {
+            if (m_fractionalPixelMisalignment.x >= 0.5)
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getDecimalDegreesPerPixel().x * col;
+               }
+               else
+               {
+                  origin.x = origin.x + (1 - m_fractionalPixelMisalignment.x) * theMapProjection->getMetersPerPixel().x * col;
+               }
+            }  
+            else
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getDecimalDegreesPerPixel().x * col;
+               }
+               else
+               {
+                  origin.x = origin.x - m_fractionalPixelMisalignment.x * theMapProjection->getMetersPerPixel().x * col;
+               }
+            }
+
+            if (m_fractionalPixelMisalignment.y >= 0.5)
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getDecimalDegreesPerPixel().y * row;
+               }
+               else
+               {
+                  origin.y = origin.y - (1 - m_fractionalPixelMisalignment.y) * theMapProjection->getMetersPerPixel().y * row;
+               }
+            }
+            else
+            {
+               if (theMapProjection->isGeographic())
+               {
+                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getDecimalDegreesPerPixel().y * row;
+               }
+               else
+               {
+                  origin.y = origin.y + m_fractionalPixelMisalignment.y * theMapProjection->getMetersPerPixel().y * row;
+               }  
+            }
+         }
+      }
+
+      ossimIpt pixels = ossimDpt(m_tilingDistanceInPixels.x, m_tilingDistanceInPixels.y);
+
+      if(theMapProjection->isGeographic())
+      {
+         theMapProjection->setUlTiePoints(
+            ossimGpt(origin.lat,
+            origin.lon,
+            0.0,
+            theMapProjection->origin().datum()));
+      }
+      else
+      {
+         theMapProjection->setUlTiePoints(ossimDpt(origin.x, origin.y));
+      }
+
+      if (m_clipToAoi || m_useOffset)
+      {
+         if (row == 0 && col == 0)
+         {
+            resultingBounds = ossimIrect(0, 0,
+               (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+               (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+         }
+         else if (row == 0 && col != 0)
+         {
+            if (col == (theTotalHorizontalTiles-1))
+            {
+               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x, 0,
+                  (m_lastWidth-1),
+                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+
+               if (m_useOffset)
+               {
+                  ossim_int32 lr_x = -((ossim_int32)m_offsetInPixels.x*col)- resultingBounds.width();
+                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 0,
+                     lr_x, (resultingBounds.height()-1));
+               }
+            }
+            else
+            {
+               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x, 0,
+                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+
+               if (m_useOffset)
+               {
+                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 0,
+                     (resultingBounds.width()-1)-((ossim_int32)m_offsetInPixels.x*col), 
+                     (resultingBounds.height()-1));
+               }
+            }
+         }
+         else if (row != 0 && col == 0)
+         {
+            if (row == (theTotalVerticalTiles-1))
+            {
+               resultingBounds = ossimIrect(0, -(ossim_int32)thePaddingSizeInPixels.y,
+                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+                  (m_lastHeight-1));
+
+               if (m_useOffset)
+               {
+                  ossim_int32 lr_y = -((ossim_int32)m_offsetInPixels.y*row)-resultingBounds.height();
+                  resultingBounds = ossimIrect(0, -((ossim_int32)m_offsetInPixels.y*row),
+                     (resultingBounds.width()-1), lr_y);
+               }
+            }
+            else
+            {
+               resultingBounds = ossimIrect(0,
+                  -(ossim_int32)thePaddingSizeInPixels.y,
+                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+
+               if (m_useOffset)
+               {
+                  resultingBounds = ossimIrect(0, -((ossim_int32)m_offsetInPixels.y*row),
+                     (resultingBounds.width()-1), 
+                     (resultingBounds.height()-1)-((ossim_int32)m_offsetInPixels.y*row));
+               }
+            }
+         }
+         else if (row != 0 && col != 0)
+         {
+            if (row == (theTotalVerticalTiles-1) && col == (theTotalHorizontalTiles-1))
+            {
+               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
+                  -(ossim_int32)thePaddingSizeInPixels.y,
+                  (m_lastWidth-1),
+                  (m_lastHeight-1));
+
+               if (m_useOffset)
+               {
+                  ossim_int32 lr_x = -((ossim_int32)m_offsetInPixels.x*col)-resultingBounds.width();
+                  ossim_int32 lr_y = -((ossim_int32)m_offsetInPixels.y*row)-resultingBounds.height();
+                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
+                     -((ossim_int32)m_offsetInPixels.y*row),
+                     lr_x, lr_y);
+               }
+            }
+            else if (row != (theTotalVerticalTiles-1) && col == (theTotalHorizontalTiles-1))
+            {
+               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
+                  -(ossim_int32)thePaddingSizeInPixels.y,
+                  (m_lastWidth-1),
+                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+
+               if (m_useOffset)
+               {
+                  ossim_int32 lr_x = -((ossim_int32)m_offsetInPixels.x*col)-resultingBounds.width();
+                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
+                     -((ossim_int32)m_offsetInPixels.y*row),
+                     lr_x, (resultingBounds.height()-1)-((ossim_int32)m_offsetInPixels.y*row));
+               }
+            }
+            else if (row == (theTotalVerticalTiles-1) && col != (theTotalHorizontalTiles-1))
+            {
+               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
+                  -(ossim_int32)thePaddingSizeInPixels.y,
+                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+                  (m_lastHeight-1));
+
+               if (m_useOffset)
+               {
+                  ossim_int32 lr_y = -((ossim_int32)m_offsetInPixels.y*row)-resultingBounds.height();
+                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
+                     -((ossim_int32)m_offsetInPixels.y*row),
+                     (resultingBounds.width()-1)-((ossim_int32)m_offsetInPixels.x*col), 
+                     lr_y);
+               }
+            }
+            else
+            {
+               resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
+                  -(ossim_int32)thePaddingSizeInPixels.y,
+                  (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+                  (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+
+               if (m_useOffset)
+               {
+                  resultingBounds = ossimIrect(-((ossim_int32)m_offsetInPixels.x*col), 
+                     -((ossim_int32)m_offsetInPixels.y*row),
+                     (resultingBounds.width()-1)-((ossim_int32)m_offsetInPixels.x*col), 
+                     (resultingBounds.height()-1)-((ossim_int32)m_offsetInPixels.y*row));
+               }
+            }
+         }
+      }
+      else
+      {
+         resultingBounds = ossimIrect(-(ossim_int32)thePaddingSizeInPixels.x,
+            -(ossim_int32)thePaddingSizeInPixels.y,
+            (pixels.x-1) + (ossim_int32)thePaddingSizeInPixels.x,
+            (pixels.y-1) + (ossim_int32)thePaddingSizeInPixels.y);
+
+         if (m_useOffset)
+         {
+            resultingBounds = ossimIrect(-(ossim_int32)m_offsetInPixels.x, 
+               -(ossim_int32)m_offsetInPixels.y,
+               (resultingBounds.width()-1), (resultingBounds.height()-1));
+         }
+      }
+
+      if(traceDebug()&&resultProjection.valid())
+      {
+         ossimKeywordlist projKwl;
+
+         resultProjection->saveState(projKwl);
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimTilingRect::next DEBUG: rect = " << resultingBounds
+            << "\nproj                          = " << projKwl
+            << "\ntileName                      = " << resultingName
+            << "\norigin                        = " << origin << std::endl;
+      }
+
+      resultProjection = theMapProjection;
+
+      ++theTileId; 
+   }
+   else
+   {
+      result = false;
+   }
+
+   return result;
+}
+
+bool ossimTilingRect::saveState(ossimKeywordlist& kwl,
+                            const char* prefix)const
+{
+   std::stringstream tilingDistance;
+
+   tilingDistance << theTilingDistance.x << " " << theTilingDistance.y << std::endl;
+   
+   kwl.add(prefix,
+           "tile_size",
+           tilingDistance.str().c_str(),
+           true);
+
+   kwl.add(prefix,
+           "units",
+           ossimUnitTypeLut::instance()->
+           getTableIndexString(theTilingDistanceUnitType),
+           true);
+   
+   std::ostringstream padding;
+
+   padding << thePaddingSizeInPixels.x << " " << thePaddingSizeInPixels.y;
+   kwl.add(prefix,
+           "padding",
+           padding.str().c_str(),
+           true);
+
+   kwl.add(prefix,
+      "output_file_name",
+      theTileNameMask.c_str(),
+      true);
+
+   kwl.add(prefix,
+      "clip_to_aoi",
+      m_clipToAoi,
+      true);
+
+   return true;
+}
+
+bool ossimTilingRect::loadState(const ossimKeywordlist& kwl,
+                            const char* prefix)
+{
+   bool result = false;
+   
+   // Get the mask if any.
+   theTileNameMask = kwl.find(prefix, "output_file_name");
+   if (!theTileNameMask.contains("%f%")) //%f% format is used for feature id in a shape file
+   {
+      setTileNameMask(theTileNameMask);
+   }
+  
+   const char* paddingSizeInPixels = kwl.find(prefix, "padding");
+
+   if (paddingSizeInPixels)
+   {
+      ossimString x,y;
+      std::istringstream padding(ossimString(paddingSizeInPixels).c_str());
+      padding >> x >> y;
+      thePaddingSizeInPixels.x = x.toFloat64();
+      thePaddingSizeInPixels.y = y.toFloat64();
+   }
+  
+   const char* tilingDistance = kwl.find(prefix, "tile_size");
+
+   const char* tilingDistanceType = kwl.find(prefix, "units");
+   
+   result = tilingDistance&&tilingDistanceType&&paddingSizeInPixels;
+   
+   ossimString x,y;
+   std::istringstream distance(ossimString(tilingDistance).c_str());
+   distance >> x >> y;
+   theTilingDistance.x = x.toFloat64();
+   theTilingDistance.y = y.toFloat64();
+   if(theTilingDistance.x <= 0.0)
+   {
+      theTilingDistance.x = 1.0;
+   }
+   if(theTilingDistance.y<=0.0)
+   {
+      theTilingDistance.y = theTilingDistance.x;
+   }
+
+   theTilingDistanceUnitType = (ossimUnitType)
+      ossimUnitTypeLut::instance()->getEntryNumber(
+      ossimString(tilingDistanceType).c_str());
+
+   const char* clipToAoi = kwl.find(prefix, "clip_to_aoi");
+   if (clipToAoi)
+   {
+      if (!ossimString(clipToAoi).toBool())
+      {
+         m_clipToAoi = false;
+      }
+   }
+
+   const char* offset = kwl.find(prefix, "use_offset");
+   if (offset)
+   {
+      ossimString width, height;
+      std::istringstream distanceOffset(ossimString(offset).c_str());
+      distanceOffset >> width >> height;
+      m_offsetInPixels.x = width.toFloat64();
+      m_offsetInPixels.y = height.toFloat64();
+      if (m_offsetInPixels.x > 0 || m_offsetInPixels.y > 0.0)
+      {
+         m_useOffset = true;
+         result = true;
+      }
+   }
+
+   const char* tileRes = kwl.find(prefix, "resolution");
+   if (tileRes)
+   {
+      theDelta = ossimDpt(0,0);
+      x="";
+      y="";
+      std::istringstream tileResValues(ossimString(tileRes).c_str());
+      tileResValues >> x >> y;
+
+      m_tilinResolutionDistance.x = x.toFloat64();
+      m_tilinResolutionDistance.y = y.toFloat64();
+   }
+ 
+   const char* tilingResType = kwl.find(prefix, "resolution_units");
+   if (tilingResType)
+   {
+      m_tilingResolutionUnitType = (ossimUnitType)
+         ossimUnitTypeLut::instance()->getEntryNumber(
+         ossimString(tilingResType).c_str());
+   }
+
+   if (traceDebug())
+   {
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+   return result;
+}
+
+ossimDpt ossimTilingRect::getPaddingSize()const
+{
+   ossimDpt result = thePaddingSizeInPixels;
+
+   if (!theMapProjection.valid())
+      return result;
+
+   if(theMapProjection->isGeographic() && theTilingDistanceUnitType == OSSIM_DEGREES)
+   {
+      return result;
+   }
+   else
+   {
+      ossimUnitConversionTool unitConverter(1.0, theTilingDistanceUnitType);
+      unitConverter.setValue(result.x, theTilingDistanceUnitType);
+      result.x = unitConverter.getValue(OSSIM_METERS);
+
+      unitConverter.setValue(result.y, theTilingDistanceUnitType);
+      result.y = unitConverter.getValue(OSSIM_METERS);
+   }
+
+   return result;
+}
+
+void ossimTilingRect::getConvertedDistance(ossimDpt& pt, ossimDpt inputDistance) const
+{
+   if (!theMapProjection)
+   {
+      // This should not happen...
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTiling::getConvertedDistance WARNING"
+         << " projection not set!" << endl;
+      pt = inputDistance;
+      return;
+   }
+
+   if(theMapProjection->isGeographic() && theTilingDistanceUnitType == OSSIM_DEGREES)
+   {
+      pt = inputDistance;
+   }
+   else
+   {
+      ossimUnitConversionTool unitConverter(theMapProjection->origin(),
+         1.0,
+         theTilingDistanceUnitType);
+
+      unitConverter.setValue(inputDistance.x,
+         theTilingDistanceUnitType);
+      pt.x = unitConverter.getValue(OSSIM_METERS);
+
+      unitConverter.setValue(inputDistance.y,
+         theTilingDistanceUnitType);
+      pt.y = unitConverter.getValue(OSSIM_METERS);
+   }
+}
diff --git a/src/imaging/ossimTopographicCorrectionFilter.cpp b/src/imaging/ossimTopographicCorrectionFilter.cpp
new file mode 100644
index 0000000..b8f8eea
--- /dev/null
+++ b/src/imaging/ossimTopographicCorrectionFilter.cpp
@@ -0,0 +1,1305 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimTopographicCorrectionFilter.cpp 21184 2012-06-29 15:13:09Z dburken $
+#include <algorithm>
+#include <sstream>
+#include <ossim/imaging/ossimTopographicCorrectionFilter.h>
+#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/matrix/newmat.h>
+#include <ossim/base/ossimMatrix3x3.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+static const char* CORRECTION_TYPE_KW        = "correction_type";
+static const char* C_COMPUTED_FLAG_KW        = "c_computed_flag";
+static const char* NDVI_RANGE_KW             = "ndvi_range";
+
+RTTI_DEF1(ossimTopographicCorrectionFilter, "ossimTopographicCorrectionFilter", ossimImageCombiner);
+ossimTopographicCorrectionFilter::ossimTopographicCorrectionFilter()
+   :ossimImageCombiner(NULL, 2, 0, true, false),
+    theTile(NULL),
+//    theScalarRemapper(NULL),
+    theLightSourceElevationAngle(45.0),
+    theLightSourceAzimuthAngle(45.0),
+    theJulianDay(0),
+    theCComputedFlag(false),
+    theTopoCorrectionType(TOPO_CORRECTION_COSINE),
+//    theTopoCorrectionType(TOPO_CORRECTION_MINNAERT),
+    theNdviLowTest(-0.1),
+    theNdviHighTest(0.1)
+{
+//    theScalarRemapper = new ossimScalarRemapper();
+//    theScalarRemapper->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
+//    theScalarRemapper->initialize();
+}
+
+ossimTopographicCorrectionFilter::ossimTopographicCorrectionFilter(ossimImageSource* colorSource,
+                                                                   ossimImageSource* elevSource)
+   :ossimImageCombiner(NULL, 2, 0, true, false),
+    theTile(NULL),
+    theLightSourceElevationAngle(45.0),
+    theLightSourceAzimuthAngle(45.0),
+    theJulianDay(0),
+    theCComputedFlag(false),
+    theTopoCorrectionType(TOPO_CORRECTION_COSINE),
+    theNdviLowTest(-0.1),
+    theNdviHighTest(0.1)
+{
+   connectMyInputTo(colorSource);
+   connectMyInputTo(elevSource);
+}
+
+ossimTopographicCorrectionFilter::~ossimTopographicCorrectionFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimTopographicCorrectionFilter::getTile(
+   const  ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource,
+                                                     getInput(0));
+   ossimImageSource* normalSource  = PTR_CAST(ossimImageSource,
+                                                       getInput(1));
+
+   if(!isSourceEnabled()||!normalSource||!colorSource)
+   {
+      if(colorSource)
+      {
+         return colorSource->getTile(tileRect, resLevel);
+      }
+   }
+
+   if(!theTile.valid())
+   {
+      allocate();
+   }
+
+   if(!theTile)
+   {
+      return ossimRefPtr<ossimImageData>();
+   }
+
+   long w = tileRect.width();
+   long h = tileRect.height();
+   ossimIpt origin = tileRect.ul();
+
+   theTile->setOrigin(origin);
+   long tileW = theTile->getWidth();
+   long tileH = theTile->getHeight();
+   if((w != tileW)||
+      (h != tileH))
+   {
+      theTile->setWidth(w);
+      theTile->setHeight(h);
+      if((w*h)!=(tileW*tileH))
+      {
+         theTile->initialize();
+      }
+      else
+      {
+         theTile->makeBlank();
+      }
+   }
+   else
+   {
+      theTile->makeBlank();
+   }
+
+   // ossimImageData* inputTile = NULL;
+
+   ossimRefPtr<ossimImageData> normalData = normalSource->getTile(tileRect,
+                                                                  resLevel);
+
+   ossimRefPtr<ossimImageData> colorData  = colorSource->getTile(tileRect,
+                                                                 resLevel);
+
+   if(!colorData.valid() || !normalData.valid())
+   {
+      return theTile;
+   }
+
+   if((normalData->getNumberOfBands() != 3)||
+      (normalData->getScalarType() != OSSIM_DOUBLE)||
+      !normalData->getBuf()||
+      !colorData->getBuf()||
+      (colorData->getDataObjectStatus() == OSSIM_EMPTY)||
+      (normalData->getDataObjectStatus()==OSSIM_EMPTY))
+   {
+      return colorData;
+   }
+
+   executeTopographicCorrection(theTile,
+                                colorData,
+                                normalData);
+   theTile->validate();
+   return theTile;
+}
+
+void ossimTopographicCorrectionFilter::initialize()
+{
+   ossimImageCombiner::initialize();
+
+   // Force an "allocate()" on the first getTile.
+   theTile      = NULL;
+}
+
+void ossimTopographicCorrectionFilter::allocate()
+{
+   if(!getInput(0) || !getInput(1)) return;
+   theBandMapping.clear();
+   if(isSourceEnabled())
+   {
+      // ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+
+      int arraySize = theTile->getNumberOfBands();
+      if(theGain.size() > 0)
+      {
+         arraySize = (int)theGain.size();
+      }
+      // we will do a non destructive resize onf the arrays
+      //
+      resizeArrays(arraySize);
+
+      ossimImageSource* input1 = PTR_CAST(ossimImageSource,
+                                                   getInput(0));
+      if(input1)
+      {
+         input1->getOutputBandList(theBandMapping);
+         for(ossim_uint32 idx = 0; idx < theBandMapping.size(); ++idx)
+         {
+            if(theBias.size())
+            {
+               if(theBandMapping[idx] >= theBias.size())
+               {
+                  theBandMapping[idx] = (unsigned int)theBias.size()-1;
+               }
+            }
+            else
+            {
+               theBandMapping[idx] = 0;
+            }
+         }
+      }
+   }
+
+   computeLightDirection();
+}
+
+void ossimTopographicCorrectionFilter::computeLightDirection()
+{
+   NEWMAT::Matrix m = ossimMatrix3x3::createRotationMatrix(theLightSourceElevationAngle,
+                                                           0.0,
+                                                           theLightSourceAzimuthAngle);
+   NEWMAT::ColumnVector v(3);
+   v[0] = 0;
+   v[1] = 1;
+   v[2] = 0;
+   v = m*v;
+   // reflect Z.  We need the Z pointing up from the surface and not into it.
+   //
+   ossimColumnVector3d d(v[0], v[1], -v[2]);
+   d = d.unit();
+   theLightDirection[0] = d[0];
+   theLightDirection[1] = d[1];
+   theLightDirection[2] = d[2];
+}
+
+void ossimTopographicCorrectionFilter::executeTopographicCorrection(
+   ossimRefPtr<ossimImageData>& outputData,
+   ossimRefPtr<ossimImageData>& colorData,
+   ossimRefPtr<ossimImageData>& normalData)
+{
+   switch(colorData->getScalarType())
+   {
+   case OSSIM_UCHAR:
+   {
+      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
+      {
+         executeTopographicCorrectionTemplate((ossim_uint8)0,
+                                              outputData,
+                                              colorData,
+                                              normalData);
+      }
+      else
+      {
+         executeTopographicCorrectionMinnaertTemplate((ossim_uint8)0,
+                                                      outputData,
+                                                      colorData,
+                                                      normalData);
+      }
+      break;
+   }
+   case OSSIM_USHORT11:
+   case OSSIM_USHORT12:
+   case OSSIM_USHORT13:
+   case OSSIM_USHORT14:
+   case OSSIM_USHORT15:
+   case OSSIM_USHORT16:
+   {
+      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
+      {
+         executeTopographicCorrectionTemplate((ossim_uint16)0,
+                                              outputData,
+                                              colorData,
+                                              normalData);
+      }
+      else
+      {
+         executeTopographicCorrectionMinnaertTemplate((ossim_uint16)0,
+                                                      outputData,
+                                                      colorData,
+                                                      normalData);
+      }
+      break;
+   }
+   case OSSIM_SSHORT16:
+   {
+      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
+      {
+         executeTopographicCorrectionTemplate((ossim_sint16)0,
+                                              outputData,
+                                              colorData,
+                                              normalData);
+      }
+      else
+      {
+         executeTopographicCorrectionMinnaertTemplate((ossim_sint16)0,
+                                                      outputData,
+                                                      colorData,
+                                                      normalData);
+      }
+      break;
+   }
+   case OSSIM_DOUBLE:
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
+      {
+         executeTopographicCorrectionTemplate((ossim_float64)0,
+                                              outputData,
+                                              colorData,
+                                              normalData);
+      }
+      else
+      {
+         executeTopographicCorrectionMinnaertTemplate((ossim_float64)0,
+                                                      outputData,
+                                                      colorData,
+                                                      normalData);
+      }
+      break;
+   }
+   case OSSIM_FLOAT:
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      if(theTopoCorrectionType!=TOPO_CORRECTION_MINNAERT)
+      {
+         executeTopographicCorrectionTemplate((ossim_float32)0,
+                                              outputData,
+                                              colorData,
+                                              normalData);
+      }
+      else
+      {
+         executeTopographicCorrectionMinnaertTemplate((ossim_float32)0,
+                                                      outputData,
+                                                      colorData,
+                                                      normalData);
+      }
+      break;
+   }
+   default:
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimTopographicCorrectionFilter::executeTopographicCorrection WARN: Not handling scalar type"
+         << endl;
+   }
+   }
+}
+
+template <class T>
+void ossimTopographicCorrectionFilter::executeTopographicCorrectionTemplate(
+   T /* dummy */,
+   ossimRefPtr<ossimImageData>& outputData,
+   ossimRefPtr<ossimImageData>& colorData,
+   ossimRefPtr<ossimImageData>& normalData)
+{
+   ossim_int32 y = 0;
+   ossim_int32 x = 0;
+   ossim_int32 colorW = colorData->getWidth();
+   ossim_int32 colorH = colorData->getHeight();
+
+   T* colorDataBand = 0;
+   T* outputDataBand = 0;
+   ossim_float64 colorNp = 0;
+   ossim_float64 colorMin = 0;
+   ossim_float64 colorMax = 0;
+   // ossim_float64 outputDelta = 0;;
+   // ossim_float64 outputMin = 0;
+   // ossim_float64 outputMax = 0;
+   ossim_float64 outputNp;
+   double  normalNp = normalData->getNullPix(0);
+   double  LPrime = 0.0;
+   double  LNew   = 0.0;
+   double  dn     = 0.0;
+   double cosineZenith = ossim::cosd(90 - theLightSourceElevationAngle);
+
+   if(!colorData->getBuf()||
+      !normalData->getBuf()||
+      (colorData->getDataObjectStatus() == OSSIM_EMPTY))
+   {
+      return;
+   }
+   for(ossim_uint32 b = 0; b < outputData->getNumberOfBands();++b)
+   {
+      int mappedBand = theBandMapping[b];
+      double* normalX  = (double*)normalData->getBuf(0);
+      double* normalY  = (double*)normalData->getBuf(1);
+      double* normalZ  = (double*)normalData->getBuf(2);
+      double numerator = cosineZenith + theC[mappedBand];
+      outputNp  = (ossim_float64)outputData->getNullPix(b);
+      // outputMin = (ossim_float64)outputData->getMinPix(b);
+      // outputMax = (ossim_float64)outputData->getMaxPix(b);
+      // outputDelta = outputMax - outputMin;
+      colorDataBand    = (T*)(colorData->getBuf(b));
+      colorNp          = (ossim_float64)(colorData->getNullPix(b));
+      colorMin         = (ossim_float64)(colorData->getMinPix(b));
+      colorMax         = (ossim_float64)(colorData->getMaxPix(b));
+      outputDataBand   = (T*)(outputData->getBuf(b));
+      bool theValuesAreGood = b < theC.size();
+      double c = theC[mappedBand];
+      if(theTopoCorrectionType != TOPO_CORRECTION_COSINE_C)
+      {
+         c = 0;
+      }
+      for(y = 0; y < colorH; ++y)
+      {
+         for(x = 0; x < colorW; ++x)
+         {
+            if((*colorDataBand) != colorNp)
+            {
+               if((*normalX != normalNp)&&
+                  (*normalY != normalNp)&&
+                  (*normalZ != normalNp)&&
+                  theValuesAreGood)
+               {
+
+                  double cosineNewI = ((*normalX)*theLightDirection[0] +
+                                       (*normalY)*theLightDirection[1] +
+                                       (*normalZ)*theLightDirection[2]);
+                  double cosineRatioDenom = (cosineNewI + c);
+                  if((fabs(cosineRatioDenom) > FLT_EPSILON)&&(cosineNewI >= 0.0))
+                  {
+                     double cosineRatio = numerator/cosineRatioDenom;
+
+                     LPrime = theGain[mappedBand]*((ossim_float64)(*colorDataBand)) + theBias[mappedBand];
+
+                     LNew = LPrime*cosineRatio;
+
+                     dn = ((LNew-theBias[mappedBand])/theGain[mappedBand]);
+
+                     if(dn < colorMin) dn = colorMin;
+                     if(dn > colorMax) dn = colorMax;
+
+                     *outputDataBand = (T)(dn);
+                  }
+                  else
+                  {
+                     *outputDataBand = (T)(*colorDataBand);
+                  }
+               }
+               else
+               {
+                  *outputDataBand = (T)(*colorDataBand);
+               }
+            }
+            else
+            {
+               *outputDataBand = (T)outputNp;
+            }
+
+            ++outputDataBand;
+            ++colorDataBand;
+            ++normalX;
+            ++normalY;
+            ++normalZ;
+         }
+      }
+   }
+}
+
+template <class T>
+void ossimTopographicCorrectionFilter::executeTopographicCorrectionMinnaertTemplate(
+   T /* dummy */,
+   ossimRefPtr<ossimImageData>& outputData,
+   ossimRefPtr<ossimImageData>& colorData,
+   ossimRefPtr<ossimImageData>& normalData)
+{
+
+   ossim_int32 y = 0;
+   ossim_int32 x = 0;
+   ossim_int32 colorW = colorData->getWidth();
+   ossim_int32 colorH = colorData->getHeight();
+
+   T* colorDataBand = 0;
+   T* outputDataBand = 0;
+   ossim_float64 colorNp = 0;
+   ossim_float64 colorMin = 0;
+   ossim_float64 colorMax = 0;
+   // ossim_float64 outputDelta = 0;;
+   // ossim_float64 outputMin = 0;
+   // ossim_float64 outputMax = 0;
+   ossim_float64 outputNp;
+   double  normalNp = normalData->getNullPix(0);
+   double  LPrime = 0.0;
+   double  LNew   = 0.0;
+   double  dn     = 0.0;
+
+   if(!colorData->getBuf()||
+      !normalData->getBuf()||
+      (colorData->getDataObjectStatus() == OSSIM_EMPTY))
+   {
+      return;
+   }
+   int maxBands = ossim::min((int)theK.size(), (int)outputData->getNumberOfBands());
+   for(int b = 0; b < maxBands;++b)
+   {
+      int mappedBand = theBandMapping[b];
+      double* normalX  = (double*)normalData->getBuf(0);
+      double* normalY  = (double*)normalData->getBuf(1);
+      double* normalZ  = (double*)normalData->getBuf(2);
+      outputNp  = (ossim_float64)outputData->getNullPix(b);
+      // outputMin = (ossim_float64)outputData->getMinPix(b);
+      // outputMax = (ossim_float64)outputData->getMaxPix(b);
+      // outputDelta = outputMax - outputMin;
+      colorDataBand    = (T*)(colorData->getBuf(b));
+      colorNp          = (ossim_float64)(colorData->getNullPix(b));
+      colorMin         = (ossim_float64)(colorData->getMinPix(b));
+      colorMax         = (ossim_float64)(colorData->getMaxPix(b));
+      outputDataBand   = (T*)(outputData->getBuf(b));
+      for(y = 0; y < colorH; ++y)
+      {
+         for(x = 0; x < colorW; ++x)
+         {
+            if((*colorDataBand) != colorNp)
+            {
+               if((*normalX != normalNp)&&
+                  (*normalY != normalNp)&&
+                  (*normalZ != normalNp))
+               {
+
+//                   if(fabs(*normalZ) < FLT_EPSILON)
+//                   {
+//                      *normalZ = 0.0;
+//                   }
+                  double cosineNewI = (((*normalX)*theLightDirection[0] +
+                                        (*normalY)*theLightDirection[1] +
+                                        (*normalZ)*theLightDirection[2]));
+                  double slopeAngle = acos(*normalZ);
+                  double cosineSlope = cos(slopeAngle);
+                  double k  = theK[mappedBand];
+                  double cosineSlopeKPower = pow(cosineSlope, k);
+                  double denom = pow((double)cosineNewI, k)*cosineSlopeKPower;
+                  double numerator = cosineSlope;
+
+//                  double slopeAngle = asin(*normalZ);
+//                  double tempK = theK[mappedBand]*cosineNewI;
+//                double denom = pow((double)cosineNewI*cosineSlope, theK[mappedBand]);
+//                  double numerator = pow((double)cosineSlope, 1-tempK);
+//                  if((fabs(denom) > .0001)&&(cosineNewI >= 0.0))
+//                  if((cosineNewI >= 0.0) &&fabs(denom) > .000001)
+                  if(fabs(denom) > .00000001)
+                  {
+//                     double cosineRatio = cosineSlope/denom;
+                     double cosineRatio = numerator/denom;
+
+                     LPrime = theGain[mappedBand]*((ossim_float64)(*colorDataBand)) + theBias[mappedBand];
+
+                     LNew = LPrime*cosineRatio;
+
+                     dn = ((LNew-theBias[mappedBand])/theGain[mappedBand]);
+
+                     if(dn < colorMin) dn = colorMin;
+                     if(dn > colorMax) dn = colorMax;
+
+                     *outputDataBand = (T)(dn);
+                  }
+                  else
+                  {
+                     *outputDataBand = (T)(*colorDataBand);
+                  }
+               }
+               else
+               {
+                  *outputDataBand = (T)(*colorDataBand);
+               }
+            }
+            else
+            {
+               *outputDataBand = (T)outputNp;
+            }
+
+            ++outputDataBand;
+            ++colorDataBand;
+            ++normalX;
+            ++normalY;
+            ++normalZ;
+         }
+      }
+   }
+}
+
+
+#if 0
+void ossimTopographicCorrectionFilter::computeC()
+{
+   theCComputedFlag = false;
+   int b = 0;
+   int tileCount = 0;
+   bool done = false;
+   if(theC.size()<1) return;
+
+   for(b = 0; b < (int) theC.size(); ++b)
+   {
+      theC[b] = 0.0;
+   }
+
+
+   theNdviLowTest  = 0.1;
+   theNdviHighTest = 1;
+
+   ossimImageSource* colorSource  = PTR_CAST(ossimImageSource, getInput(0));
+   ossimImageSource* normalSource = PTR_CAST(ossimImageSource, getInput(1));
+
+   if(!colorSource || !normalSource)
+   {
+      return;
+   }
+   std::vector<ossim2dLinearRegression> linearRegression(theC.size());
+   ossimIrect normalRect = normalSource->getBoundingRect();
+   ossimIrect colorRect  = colorSource->getBoundingRect();
+   ossimIrect clipRect   = normalRect.clipToRect(colorRect);
+   ossimIpt ul = clipRect.ul();
+   ossimIpt lr = clipRect.lr();
+   ossimIpt tileSize(128,128);
+   ossim_int32 tilesHoriz = clipRect.width()/tileSize.x;
+   ossim_int32 tilesVert  = clipRect.height()/tileSize.y;
+
+
+   if(!normalRect.intersects(colorRect))
+   {
+      return;
+   }
+   ossim_int32 maxSize = tilesHoriz*tilesVert;//ossim::min(200, );
+
+   int idx = 0;
+
+   idx = 0;
+   std::vector<int> cosineIBucketCount(10);
+   std::fill(cosineIBucketCount.begin(), cosineIBucketCount.end(), 0);
+   const int maxBucketCount = 1000;
+   bool goodCoefficients = false;
+   long numberOfRuns = 0;
+   while((!goodCoefficients)&&(numberOfRuns < 2))
+   {
+      while((idx < maxSize)&&
+            (!done))
+      {
+         ossim_int32 ty = idx/tilesHoriz;
+         ossim_int32 tx = idx%tilesHoriz;
+
+
+         ossim_int32 x = (ul.x + tx*tileSize.x);
+         ossim_int32 y = (ul.y + ty*tileSize.y);
+
+         ossimIrect requestRect(x,
+                                y,
+                                x+tileSize.x-1,
+                                y+tileSize.y-1);
+
+         ossimRefPtr<ossimImageData> colorData  = colorSource->getTile(requestRect);
+         ossimRefPtr<ossimImageData> normalData = normalSource->getTile(requestRect);
+
+         switch(colorData->getScalarType())
+         {
+         case OSSIM_UCHAR:
+         {
+            addRegressionPointsTemplate((ossim_uint8)0,
+                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
+            break;
+         }
+         case OSSIM_USHORT11:
+         case OSSIM_USHORT12:
+         case OSSIM_USHORT13:
+         case OSSIM_USHORT14:
+         case OSSIM_USHORT15:
+         case OSSIM_USHORT16:
+         {
+            addRegressionPointsTemplate((ossim_uint16)0,
+                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
+            break;
+         }
+         case OSSIM_SSHORT16:
+         {
+            addRegressionPointsTemplate((ossim_sint16)0,
+                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
+            break;
+         }
+         case OSSIM_FLOAT:
+         case OSSIM_NORMALIZED_FLOAT:
+         {
+            addRegressionPointsTemplate((ossim_float32)0,
+                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
+            break;
+         }
+         case OSSIM_DOUBLE:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            addRegressionPointsTemplate((ossim_float64)0,
+                                        linearRegression, cosineIBucketCount, maxBucketCount, colorData, normalData);
+            break;
+         }
+         }
+         if(((double)linearRegression[0].getNumberOfPoints()/(double)(maxBucketCount*10.0))>=.7)
+         {
+            done = true;
+         }
+         ++idx;
+      }
+
+      double intercept, m;
+      long numberOfPositiveSlopes=0;
+      for(b=0;b<theC.size();++b)
+      {
+         if(linearRegression[b].getNumberOfPoints()>2)
+         {
+            linearRegression[b].solve();
+            linearRegression[b].getEquation(m, intercept);
+            theC[b] = intercept/m;
+
+            ossimNotify(ossimNotifyLevel_INFO) << "equation for b = " << b <<" is y = " << m << "*x + " << intercept << endl
+                                               << "with c =         " << theC[b] << endl;
+            if(m >=0.0)
+            {
+               numberOfPositiveSlopes++;
+            }
+         }
+      }
+      for(idx = 0; idx < cosineIBucketCount.size(); ++idx)
+      {
+         ossimNotify(ossimNotifyLevel_INFO) << "bucket " << idx << " = " << cosineIBucketCount[idx] << endl;
+      }
+      if(numberOfPositiveSlopes > .5*theC.size())
+      {
+         goodCoefficients = true;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimTopographicCorrectionFilter::computeC() WARN: not enough positive slopes" << endl
+                                             << "changing test to look for dirt areas" << endl;
+         theNdviLowTest = -1.0;
+         theNdviHighTest = .1;
+         for(b=0;b<theC.size();++b)
+         {
+            linearRegression[b].clear();
+         }
+      }
+      ++numberOfRuns;
+   }
+   theCComputedFlag = true;
+}
+
+template<class T>
+void ossimTopographicCorrectionFilter::addRegressionPointsTemplate(
+   T, //dummy
+   std::vector<ossim2dLinearRegression>& regressionPoints,
+   std::vector<int>& cosineIBucketCount,
+   ossim_int32 maxCountPerBucket,
+   ossimRefPtr<ossimImageData>& colorData,
+   ossimRefPtr<ossimImageData>& normalData)
+{
+   if(!colorData||!normalData)
+   {
+      return;
+   }
+   if((colorData->getDataObjectStatus() == OSSIM_EMPTY)||
+      (!colorData->getBuf())||
+      (!normalData->getBuf())||
+      (normalData->getDataObjectStatus()==OSSIM_EMPTY))
+   {
+      return;
+   }
+
+   ossim_float64* normalBands[3];
+   ossim_float64 normalBandsNp[3];
+   ossim_uint32 count=0;
+   ossim_uint32 b = 0;
+   std::vector<T*> colorBands(colorData->getNumberOfBands());
+   std::vector<T> colorBandsNp(colorData->getNumberOfBands());
+
+   normalBands[0]   = (ossim_float64*)normalData->getBuf(0);
+   normalBands[1]   = (ossim_float64*)normalData->getBuf(1);
+   normalBands[2]   = (ossim_float64*)normalData->getBuf(2);
+   normalBandsNp[0] = normalData->getNullPix(0);
+   normalBandsNp[1] = normalData->getNullPix(1);
+   normalBandsNp[2] = normalData->getNullPix(2);
+
+   for(b=0;b<colorData->getNumberOfBands();++b)
+   {
+      colorBands[b]   = (T*)colorData->getBuf(b);
+      colorBandsNp[b] = (T)colorData->getNullPix(b);
+   }
+
+   ossim_uint32 maxOffset = colorData->getWidth()*colorData->getHeight();
+   ossim_uint32 offset=0;
+   ossim_float64 ndviTest=0.0;
+   ossim_uint32 numberOfTests = 0;
+   if(maxOffset)
+   {
+      maxOffset-=1;
+   }
+
+   ossim_int32 percent = (ossim_int32)(colorData->getWidth()*colorData->getHeight()*.2);
+   offset = 0;
+   ossim_uint32 countPixels = 0;
+   while(offset < maxOffset)
+   {
+      bool nullBandsExist = false;
+      for(b = 0; ((b < colorData->getNumberOfBands())&&(!nullBandsExist));++b)
+      {
+         if(*colorBands[b] == colorBandsNp[b])
+         {
+            nullBandsExist = true;
+         }
+      }
+
+      if((!nullBandsExist)&&
+         (*normalBands[0] != normalBandsNp[0])&&
+         (*normalBands[1] != normalBandsNp[1])&&
+         (*normalBands[2] != normalBandsNp[2]))
+      {
+         if(computeNdvi((T)0,
+                        ndviTest,
+                        offset,
+                        colorBands))
+         {
+            if((ndviTest >= theNdviLowTest) && (ndviTest <= theNdviHighTest))
+            {
+               double cosineI = ((*(normalBands[0]+offset))*theLightDirection[0] +
+                                 (*(normalBands[1]+offset))*theLightDirection[1] +
+                                 (*(normalBands[2]+offset))*theLightDirection[2]);
+               if(cosineI >= 0.0)
+               {
+                  long bucketIdx = (long)(cosineI*cosineIBucketCount.size());
+
+                  // we will try to disperse the normals out and so we don't clump everything
+                  // in one place
+                  //
+                  if(cosineIBucketCount[bucketIdx] < maxCountPerBucket)
+                  {
+                     for(b = 0; b < colorData->getNumberOfBands();++b)
+                     {
+                        regressionPoints[b].addPoint(ossimDpt(cosineI, *(colorBands[b]+offset)));
+                     }
+                     ++cosineIBucketCount[bucketIdx];
+                     ++count;
+                  }
+               }
+            }
+         }
+      }
+      ++offset;
+   }
+}
+#endif
+
+template <class T> bool ossimTopographicCorrectionFilter::computeNdvi(
+   T,
+   ossim_float64& result,
+   ossim_uint32 offset,
+   const std::vector<T*>& bands)const
+{
+   if(bands.size() > 3)
+   {
+      result = (((double)*(bands[3]+offset) - (double)*(bands[2]+offset))/
+                ((double)*(bands[3]+offset) + (double)*(bands[2]+offset)));
+      return true;
+   }
+
+   return false;
+}
+
+void ossimTopographicCorrectionFilter::resizeArrays(ossim_uint32 newSize)
+{
+  if(!getInput(0) || !getInput(1)) return;
+
+
+   vector<double> tempC    = theC;
+   vector<double> tempK    = theK;
+   vector<double> tempBias = theBias;
+   vector<double> tempGain = theGain;
+
+   theC.resize(newSize);
+   theK.resize(newSize);
+   theBias.resize(newSize);
+   theGain.resize(newSize);
+   ossim_uint32 tempIdx = 0;
+   if(tempC.size() > 0 && (theC.size() > 0))
+   {
+      int numberOfElements = ossim::min((int)tempC.size(),(int)theC.size());
+
+      std::copy(tempC.begin(), tempC.begin()+numberOfElements,
+                theC.begin());
+      std::copy(tempK.begin(), tempK.begin()+numberOfElements,
+                theK.begin());
+      std::copy(tempBias.begin(), tempBias.begin()+numberOfElements,
+                theBias.begin());
+      std::copy(tempGain.begin(), tempGain.begin()+numberOfElements,
+                theGain.begin());
+
+      if(theC.size() > tempC.size())
+      {
+         std::fill(theC.begin()+numberOfElements, theC.end(), (double)0.0);
+         std::fill(theBias.begin()+numberOfElements, theBias.end(), (double)0.0);
+         std::fill(theGain.begin()+numberOfElements, theGain.end(), (double)1.0);
+         for(tempIdx = numberOfElements; tempIdx < theK.size(); ++tempIdx)
+         {
+            theK[tempIdx] = 0.3 + .4*(tempIdx/(double)(theK.size()));
+         }
+      }
+   }
+   else
+   {
+      std::fill(theC.begin(), theC.end(), (double)0.0);
+      std::fill(theBias.begin(), theBias.end(), (double)0.0);
+      std::fill(theGain.begin(), theGain.end(), (double)1.0);
+      for(tempIdx = 0; tempIdx < theK.size(); ++tempIdx)
+      {
+         theK[tempIdx] = 0.3 + .4*(tempIdx/(double)(theK.size()));
+      }
+   }
+}
+
+bool ossimTopographicCorrectionFilter::loadState(const ossimKeywordlist& kwl,
+                                                 const char* prefix)
+{
+
+   ossimString elevAngle      = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
+   ossimString azimuthAngle   = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
+   ossimString bands          = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
+   ossimString correctionType = kwl.find(prefix, CORRECTION_TYPE_KW);
+   ossimString julianDay      = kwl.find(prefix, ossimKeywordNames::JULIAN_DAY_KW);
+   ossimString cComputedFlag  = kwl.find(prefix, C_COMPUTED_FLAG_KW);
+   ossimString ndviRange      = kwl.find(prefix, NDVI_RANGE_KW);
+
+   theCComputedFlag = cComputedFlag.toBool();
+   correctionType = correctionType.downcase();
+   int numberOfBands = bands.toInt();
+   theLightSourceElevationAngle = elevAngle.toDouble();
+   theLightSourceAzimuthAngle   = azimuthAngle.toDouble();
+   theJulianDay = julianDay.toDouble();
+
+   if(ndviRange != "")
+   {
+      std::istringstream input(ndviRange.c_str());
+
+      input >> theNdviLowTest >> theNdviHighTest;
+   }
+   if(numberOfBands>0)
+   {
+     theGain.resize(numberOfBands);
+     theBias.resize(numberOfBands);
+     theC.resize(numberOfBands);
+     theK.resize(numberOfBands);
+      for(int b = 0; b < numberOfBands; ++b)
+      {
+         ossimString k    = "k"+ossimString::toString(b);
+         ossimString c    = "c"+ossimString::toString(b);
+         ossimString bias = "bias"+ossimString::toString(b);
+         ossimString gain = "gain"+ossimString::toString(b);
+
+         const char* kValue    = kwl.find(prefix, k);
+         const char* cValue    = kwl.find(prefix, c);
+         const char* biasValue = kwl.find(prefix, bias);
+         const char* gainValue = kwl.find(prefix, gain);
+	 if(kValue)
+	   {
+	     theK[b] = ossimString(kValue).toDouble();
+	   }
+	 else
+	   {
+	     theK[b] = 1.0;
+	   }
+         if(cValue)
+         {
+            theC[b] = ossimString(cValue).toDouble();
+         }
+         else
+         {
+            theC[b] = 0.0;;
+         }
+         if(biasValue)
+         {
+            theBias[b] = ossimString(biasValue).toDouble();
+         }
+         else
+         {
+            theBias[b] = 0.0;
+         }
+         if(gainValue)
+         {
+            theGain[b] = ossimString(gainValue).toDouble();
+         }
+         else
+         {
+            theGain[b] = 1.0;
+         }
+      }
+   }
+
+   if(correctionType.contains("cosine_c"))
+   {
+      theTopoCorrectionType = TOPO_CORRECTION_COSINE_C;
+   }
+   else if(correctionType.contains("minnaert"))
+   {
+      theTopoCorrectionType = TOPO_CORRECTION_MINNAERT;
+   }
+   else
+   {
+      theTopoCorrectionType = TOPO_CORRECTION_COSINE;
+   }
+
+
+   bool result =  ossimImageCombiner::loadState(kwl, prefix);
+
+   computeLightDirection();
+
+   return result;
+}
+
+bool ossimTopographicCorrectionFilter::saveState(ossimKeywordlist& kwl,
+                                                 const char* prefix)const
+{
+   // we can use any of the arrays theC, theBias, or theGain since
+   // they mirror the number of input bands
+   //
+   int numberOfBands = (int)theC.size();
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_BANDS_KW,
+           numberOfBands,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::ELEVATION_ANGLE_KW,
+           theLightSourceElevationAngle,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::AZIMUTH_ANGLE_KW,
+           theLightSourceAzimuthAngle,
+           true);
+
+   kwl.add(prefix,
+           C_COMPUTED_FLAG_KW,
+           (ossim_uint32)theCComputedFlag,
+           true);
+   kwl.add(prefix,
+           NDVI_RANGE_KW,
+           ossimString::toString(theNdviLowTest) +
+           " " + ossimString::toString(theNdviHighTest),
+           true);
+
+   if(theTopoCorrectionType == TOPO_CORRECTION_COSINE_C)
+   {
+      kwl.add(prefix,
+              CORRECTION_TYPE_KW,
+              "cosine_c",
+              true);
+   }
+   else if(theTopoCorrectionType == TOPO_CORRECTION_MINNAERT)
+   {
+      kwl.add(prefix,
+              CORRECTION_TYPE_KW,
+              "minnaert",
+              true);
+   }
+   else
+   {
+      kwl.add(prefix,
+              CORRECTION_TYPE_KW,
+              "cosine",
+              true);
+   }
+
+   for(int b = 0; b < numberOfBands; ++b)
+   {
+      ossimString k    = "k"+ossimString::toString(b);
+      ossimString c    = "c"+ossimString::toString(b);
+      ossimString bias = "bias"+ossimString::toString(b);
+      ossimString gain = "gain"+ossimString::toString(b);
+      kwl.add(prefix,
+              k,
+              theK[b],
+              true);
+      kwl.add(prefix,
+              c,
+              theC[b],
+              true);
+      kwl.add(prefix,
+              bias,
+              theBias[b],
+              true);
+      kwl.add(prefix,
+              gain,
+              theGain[b],
+              true);
+   }
+
+   return ossimImageCombiner::saveState(kwl, prefix);
+}
+
+ossim_uint32 ossimTopographicCorrectionFilter::getNumberOfOutputBands() const
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+   if(colorSource)
+   {
+      return colorSource->getNumberOfOutputBands();
+   }
+   return ossimImageCombiner::getNumberOfOutputBands();
+}
+
+ossimScalarType ossimTopographicCorrectionFilter::getOutputScalarType() const
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+   if(colorSource)
+   {
+      return colorSource->getOutputScalarType();
+   }
+   return ossimImageCombiner::getOutputScalarType();
+}
+
+double ossimTopographicCorrectionFilter::getNullPixelValue(ossim_uint32 band)const
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+   if(colorSource)
+   {
+      return colorSource->getNullPixelValue(band);
+   }
+   return ossimImageCombiner::getNullPixelValue(band);
+}
+
+double ossimTopographicCorrectionFilter::getMinPixelValue(ossim_uint32 band)const
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+   if(colorSource)
+   {
+      return colorSource->getMinPixelValue(band);
+   }
+   return ossimImageCombiner::getMinPixelValue(band);
+}
+
+double ossimTopographicCorrectionFilter::getMaxPixelValue(ossim_uint32 band)const
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+   if(colorSource)
+   {
+      return colorSource->getMaxPixelValue(band);
+   }
+   return ossimImageCombiner::getMaxPixelValue(band);
+}
+
+ossimIrect ossimTopographicCorrectionFilter::getBoundingRect(ossim_uint32 resLevel)const
+{
+   ossimIrect result;
+   result.makeNan();
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+
+   if(colorSource)
+   {
+      result = colorSource->getBoundingRect(resLevel);
+   }
+
+   return result;
+}
+
+void ossimTopographicCorrectionFilter::getDecimationFactor(ossim_uint32 resLevel,
+                                                           ossimDpt& result) const
+{
+   result.makeNan();
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+
+   if(colorSource)
+   {
+      colorSource->getDecimationFactor(resLevel,
+                                       result);
+   }
+}
+
+void ossimTopographicCorrectionFilter::getDecimationFactors(vector<ossimDpt>& decimations) const
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+   if(colorSource)
+   {
+      colorSource->getDecimationFactors(decimations);
+   }
+}
+
+ossim_uint32 ossimTopographicCorrectionFilter::getNumberOfDecimationLevels()const
+{
+   ossimImageSource* colorSource = PTR_CAST(ossimImageSource, getInput(0));
+   if(colorSource)
+   {
+      return colorSource->getNumberOfDecimationLevels();
+   }
+   return 0;
+}
+
+double ossimTopographicCorrectionFilter::getAzimuthAngle()const
+{
+   return theLightSourceAzimuthAngle;
+}
+
+double ossimTopographicCorrectionFilter::getElevationAngle()const
+{
+   return theLightSourceElevationAngle;
+}
+
+void ossimTopographicCorrectionFilter::setAzimuthAngle(double angle)
+{
+   theLightSourceAzimuthAngle = angle;
+}
+
+void ossimTopographicCorrectionFilter::setElevationAngle(double angle)
+{
+   theLightSourceElevationAngle = angle;
+}
+bool ossimTopographicCorrectionFilter::canConnectMyInputTo(ossim_int32 inputIndex,
+                                                           const ossimConnectableObject* object)const
+{
+   return (object&&
+           ( (inputIndex>=0) && inputIndex < 2)&&
+           PTR_CAST(ossimImageSource, object));
+
+}
+
+void ossimTopographicCorrectionFilter::connectInputEvent(ossimConnectionEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimTopographicCorrectionFilter::disconnectInputEvent(ossimConnectionEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimTopographicCorrectionFilter::propertyEvent(ossimPropertyEvent& /* event */)
+{
+   initialize();
+}
+
+void ossimTopographicCorrectionFilter::refreshEvent(ossimRefreshEvent& /* event */)
+{
+   initialize();
+}
+
+ossimTopographicCorrectionFilter::ossimTopoCorrectionType ossimTopographicCorrectionFilter::getTopoCorrectionType()const
+{
+   return theTopoCorrectionType;
+}
+
+void ossimTopographicCorrectionFilter::setTopoCorrectionType(ossimTopoCorrectionType topoType)
+{
+   theTopoCorrectionType = topoType;
+}
+
+const std::vector<double>& ossimTopographicCorrectionFilter::getGainValues()const
+{
+   return theGain;
+}
+
+void ossimTopographicCorrectionFilter::setGainValues(const std::vector<double>& gainValues)
+{
+   theGain = gainValues;
+}
+
+const vector<double>& ossimTopographicCorrectionFilter::getBiasValues()const
+{
+   return theBias;
+}
+
+void ossimTopographicCorrectionFilter::setBiasValues(const std::vector<double>& biasValues)
+{
+   theBias = biasValues;
+}
+
+const vector<double>& ossimTopographicCorrectionFilter::getKValues()const
+{
+   return theK;
+}
+
+double ossimTopographicCorrectionFilter::getK(int idx)const
+{
+   if(idx < (int)theK.size())
+   {
+      return theK[idx];
+   }
+   else
+   {
+      return 1.0;
+   }
+}
+
+void ossimTopographicCorrectionFilter::setK(int idx, double value)
+{
+   if(idx < (int)theK.size())
+   {
+      theK[idx] = value;
+   }
+}
+
+void ossimTopographicCorrectionFilter::setKValues(const vector<double>& kValues)
+{
+   theK = kValues;
+}
+
+double ossimTopographicCorrectionFilter::getC(int idx)const
+{
+   if(idx < (int)theC.size())
+   {
+      return theC[idx];
+   }
+   else
+   {
+      return 0.0;
+   }
+}
+
+void ossimTopographicCorrectionFilter::setC(int idx, double value)
+{
+   if(idx < (int)theC.size())
+   {
+      theC[idx] = value;
+   }
+}
+
+void ossimTopographicCorrectionFilter::setCValues(const vector<double>& cValues)
+{
+   theC = cValues;
+}
diff --git a/src/imaging/ossimTrimFilter.cpp b/src/imaging/ossimTrimFilter.cpp
new file mode 100644
index 0000000..0de08f7
--- /dev/null
+++ b/src/imaging/ossimTrimFilter.cpp
@@ -0,0 +1,357 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimTrimFilter.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/imaging/ossimTrimFilter.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimDpt.h>
+
+static ossimTrace traceDebug("ossimTrimFilter:debug");
+
+RTTI_DEF1(ossimTrimFilter,
+          "ossimTrimFilter",
+          ossimImageSourceFilter);
+
+ossimTrimFilter::ossimTrimFilter()
+   :ossimImageSourceFilter(),
+    theLeftPercent(0.0),
+    theRightPercent(0.0),
+    theTopPercent(0.0),
+    theBottomPercent(0.0)
+{
+   theCutter = new ossimPolyCutter;
+}
+
+ossimTrimFilter::~ossimTrimFilter()
+{
+   theCutter = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimTrimFilter::getTile(
+   const ossimIrect& rect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return NULL;
+   }
+
+   if(!theValidVertices.size())
+   {
+      return ossimImageSourceFilter::getTile(rect, resLevel);
+   }
+   
+   ossimRefPtr<ossimImageData> tile =
+      theCutter->getTile(rect, resLevel);
+
+   if(!isSourceEnabled()||!tile.valid())
+   {
+      return tile;
+   }
+   if(tile->getDataObjectStatus() == OSSIM_NULL ||
+      tile->getDataObjectStatus() == OSSIM_EMPTY)
+   {
+      return tile;
+   }
+
+   return theCutter->getTile(rect, resLevel);
+//    theTile->setImageRectangle(rect);
+//    theTile->setDataObjectStatus(OSSIM_FULL);
+
+//    theTile->makeBlank();
+//    ossimIrect boundingRect = getBoundingRect(resLevel);
+//    ossimIrect tileRect     = tile->getImageRectangle();
+//    ossimIrect clipRect     = boundingRect.clipToRect(tileRect);
+
+//    theTile->loadTile(tile->getBuf(),
+//                      tile->getImageRectangle(),
+//                      clipRect,
+//                      OSSIM_BSQ);
+   
+//    theTile->validate();
+   
+}
+
+void ossimTrimFilter::getValidImageVertices(
+   vector<ossimIpt>& validVertices,
+   ossimVertexOrdering ordering,
+   ossim_uint32 resLevel)const
+{
+   ossimImageSource::getValidImageVertices(validVertices,
+                                           ordering,
+                                           resLevel);
+   if(validVertices.size()==4)
+   {
+      ossimDpt averagePt((ossimDpt(validVertices[0])+
+                          ossimDpt(validVertices[1])+
+                          ossimDpt(validVertices[2])+
+                          ossimDpt(validVertices[3]))*.25);
+      ossimDpt averageTop( ( ossimDpt(validVertices[0]+
+                                      validVertices[1])*.5) );
+      ossimDpt averageBottom( ( ossimDpt(validVertices[2]+
+                                         validVertices[3])*.5 ) );
+      ossimDpt averageLeft( (ossimDpt(validVertices[0]+
+                                      validVertices[3])*.5) );
+      ossimDpt averageRight( (ossimDpt(validVertices[1]+
+                                       validVertices[2])*.5) );
+
+      ossimDpt topAxis    = (averageTop-averagePt);
+      ossimDpt rightAxis = (averageRight-averagePt);
+      ossimDpt leftAxis  = (averageLeft-averagePt);
+      ossimDpt bottomAxis = (averageBottom-averagePt);
+
+      double topLen    = topAxis.length();
+      double bottomLen = bottomAxis.length();
+      double rightLen  = rightAxis.length();
+      double leftLen   = leftAxis.length();
+
+      if((topLen > FLT_EPSILON)&&
+         (bottomLen > FLT_EPSILON)&&
+         (leftLen > FLT_EPSILON)&&
+         (rightLen > FLT_EPSILON))
+      {
+         topAxis    = topAxis*(1.0/topLen);
+         bottomAxis = bottomAxis*(1.0/bottomLen);
+         leftAxis   = leftAxis*(1.0/leftLen);
+         rightAxis  = rightAxis*(1.0/rightLen);
+
+         ossim_uint32 idx = 0;
+         ossim_uint32 count = 0;
+         for(idx = 0; idx < validVertices.size(); ++idx)
+         {
+            ossimDpt axis[2];
+            double   axisLen[2];
+            ossimDpt diff  = validVertices[idx]-averagePt;
+            double testLen = (topAxis.x*diff.x+
+                              topAxis.y*diff.y);
+            count = 0;
+            if(testLen >= -FLT_EPSILON)
+            {
+               axis[count]    = topAxis;
+               axisLen[count] = testLen*(1.0-theTopPercent);
+               ++count;
+            }
+
+            if(count < 2)
+            {
+               testLen = (bottomAxis.x*diff.x+
+                          bottomAxis.y*diff.y);
+               if(testLen >= -FLT_EPSILON)
+               {
+                  axis[count]    = bottomAxis;
+                  axisLen[count] = testLen*(1.0-theBottomPercent);
+                  ++count;
+               }
+            }
+            if(count < 2)
+            {
+               testLen = (leftAxis.x*diff.x+
+                          leftAxis.y*diff.y);
+               if(testLen >= -FLT_EPSILON)
+               {
+                  axis[count]    = leftAxis;
+                  axisLen[count] = testLen*(1.0-theLeftPercent);
+                  ++count;
+               }
+            }
+            if(count < 2)
+            {
+               testLen = (rightAxis.x*diff.x+
+                          rightAxis.y*diff.y);
+               if(testLen >= -FLT_EPSILON)
+               {
+                  axis[count]    = rightAxis;
+                  axisLen[count] = testLen*(1.0-theRightPercent);
+                  ++count;
+               }
+            }
+            if(count == 2)
+            {
+               validVertices[idx] = (averagePt + (axis[0]*axisLen[0] +
+                                                  axis[1]*axisLen[1]));
+            }
+         }
+      }
+   }
+//    ossimIrect rect = getBoundingRect();
+
+//    if(ordering == OSSIM_CLOCKWISE_ORDER)
+//    {
+//       validVertices.push_back(rect.ul());
+//       validVertices.push_back(rect.ur());
+//       validVertices.push_back(rect.lr());
+//       validVertices.push_back(rect.ll());
+//    }
+//    else
+//    {
+//       validVertices.push_back(rect.ul());
+//       validVertices.push_back(rect.ll());
+//       validVertices.push_back(rect.lr());
+//       validVertices.push_back(rect.ur());
+//    }
+}
+
+ossimIrect ossimTrimFilter::getBoundingRect(ossim_uint32 resLevel)const
+{
+
+   vector<ossimIpt> validVertices;
+   ossimIrect result;
+   result.makeNan();
+   getValidImageVertices(validVertices, OSSIM_CLOCKWISE_ORDER, resLevel);
+   
+   if(validVertices.size())
+   {
+      result = ossimIrect(validVertices);
+   }
+
+   return result;
+}
+
+void ossimTrimFilter::initialize()
+{
+   if(theInputConnection)
+   {
+      theCutter->disconnectMyInput(0, false, false);
+      if(getInput())
+      {
+         theCutter->connectMyInputTo(0, getInput());
+      }
+      theCutter->initialize();
+      getValidImageVertices(theValidVertices);
+      theCutter->setNumberOfPolygons(1);
+      theCutter->setPolygon(theValidVertices);
+   }
+}
+
+bool ossimTrimFilter::saveState(ossimKeywordlist& kwl,
+                                const char* prefix)const
+{
+   kwl.add(prefix,
+           "left_percent",
+           theLeftPercent,
+           true);
+   kwl.add(prefix,
+           "right_percent",
+           theRightPercent,
+           true);
+   kwl.add(prefix,
+           "top_percent",
+           theTopPercent,
+           true);
+   kwl.add(prefix,
+           "bottom_percent",
+           theBottomPercent,
+           true);
+
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimTrimFilter::loadState(const ossimKeywordlist& kwl,
+                                const char* prefix)
+{
+   const char* leftPerc   = kwl.find(prefix, "left_percent");
+   const char* rightPerc  = kwl.find(prefix, "right_percent");
+   const char* topPerc    = kwl.find(prefix, "top_percent");
+   const char* bottomPerc = kwl.find(prefix, "bottom_percent");
+
+   if(leftPerc)
+   {
+      theLeftPercent = ossimString(leftPerc).toDouble();
+   }
+   if(rightPerc)
+   {
+      theRightPercent = ossimString(rightPerc).toDouble();
+   }
+   if(topPerc)
+   {
+      theTopPercent = ossimString(topPerc).toDouble();
+   }
+   if(bottomPerc)
+   {
+      theBottomPercent = ossimString(bottomPerc).toDouble();
+   }
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+ossimRefPtr<ossimProperty> ossimTrimFilter::getProperty(const ossimString& name)const
+{
+   ossimProperty* prop = 0;
+   if(name == "left_percent")
+   {
+      prop = new ossimNumericProperty(name,
+                                      ossimString::toString(theLeftPercent),
+                                      0.0, 1.0);
+      prop->setFullRefreshBit();
+   }
+   else if(name == "right_percent")
+   {
+      prop = new ossimNumericProperty(name,
+                                      ossimString::toString(theRightPercent),
+                                      0.0, 1.0);
+      prop->setFullRefreshBit();
+   }
+   else if(name == "top_percent")
+   {
+      prop = new ossimNumericProperty(name,
+                                      ossimString::toString(theTopPercent),
+                                      0.0, 1.0);
+      prop->setFullRefreshBit();
+   }
+   else if(name == "bottom_percent")
+   {
+      prop = new ossimNumericProperty(name,
+                                      ossimString::toString(theBottomPercent),
+                                      0.0, 1.0);
+      prop->setFullRefreshBit();
+   }
+
+   if(prop) return prop;
+   
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimTrimFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid())return;
+   ossimString name = property->getName();
+   
+   if(name == "left_percent")
+   {
+      theLeftPercent = property->valueToString().toDouble();
+   }
+   else if(name == "right_percent")
+   {
+      theRightPercent = property->valueToString().toDouble();
+   }
+   else if(name == "top_percent")
+   {
+      theTopPercent = property->valueToString().toDouble();
+   }
+   else if(name == "bottom_percent")
+   {
+      theBottomPercent = property->valueToString().toDouble();
+   }
+   else
+   {
+      return ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+void ossimTrimFilter::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back("left_percent");
+   propertyNames.push_back("right_percent");
+   propertyNames.push_back("top_percent");
+   propertyNames.push_back("bottom_percent");
+}
diff --git a/src/imaging/ossimTwoColorView.cpp b/src/imaging/ossimTwoColorView.cpp
new file mode 100644
index 0000000..92f61c1
--- /dev/null
+++ b/src/imaging/ossimTwoColorView.cpp
@@ -0,0 +1,420 @@
+//-------------------------------------------------------------------
+// License:  LGPL.  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//-------------------------------------------------------------------
+//  $Id$
+
+#include <ossim/imaging/ossimTwoColorView.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimTwoColorView,
+          "ossimTwoColorView" ,
+          ossimImageCombiner);
+
+ossimTwoColorView::ossimTwoColorView()
+   :
+   ossimImageCombiner(0, 2, 0, true, false) ,
+   m_byPassFlag(true),
+   m_nativeFlag(false),
+   m_newInput(0),
+   m_oldInput(0),
+   m_newInputBandIndex(0),
+   m_oldInputBandIndex(0),
+   m_redSource(ossimTwoColorView::OLD),
+   m_grnSource(ossimTwoColorView::NEW),
+   m_bluSource(ossimTwoColorView::NEW)
+{
+}
+
+ossim_uint32 ossimTwoColorView::getNumberOfOutputBands() const
+{
+   if(m_byPassFlag||!isSourceEnabled())
+   {
+      return ossimImageCombiner::getNumberOfOutputBands();
+   }
+   return 3;
+}
+
+ossimScalarType ossimTwoColorView::getOutputScalarType() const
+{
+   if(m_byPassFlag||!isSourceEnabled())
+   {
+      return ossimImageCombiner::getOutputScalarType();
+   }
+   return OSSIM_UINT8;
+}
+
+void ossimTwoColorView::setBandIndexMapping(
+   ossim_uint32 oldInputBandIndex,
+   ossim_uint32 newInputBandIndex,
+   ossimTwoColorMultiViewOutputSource redOutputSource,
+   ossimTwoColorMultiViewOutputSource grnOutputSource,
+   ossimTwoColorMultiViewOutputSource bluOutputSource)
+{
+   m_oldInputBandIndex = oldInputBandIndex;
+   m_newInputBandIndex = newInputBandIndex;
+   m_redSource = redOutputSource;
+   m_grnSource = grnOutputSource;
+   m_bluSource = bluOutputSource;
+}
+
+double ossimTwoColorView::getNullPixelValue(ossim_uint32 band)const
+{
+   if(m_byPassFlag||!isSourceEnabled())
+   {
+      return ossimImageCombiner::getNullPixelValue(band);
+   }
+   return 0;
+}
+
+double ossimTwoColorView::getMinPixelValue(ossim_uint32 band)const
+{
+   if(m_byPassFlag||!isSourceEnabled())
+   {
+      return ossimImageCombiner::getMinPixelValue(band);
+   }
+   return 1;
+}
+
+double ossimTwoColorView::getMaxPixelValue(ossim_uint32 band)const
+{
+   if(m_byPassFlag||!isSourceEnabled())
+   {
+      return ossimImageCombiner::getMaxPixelValue(band);
+   }
+   return 256;
+}
+
+ossimRefPtr<ossimImageData> ossimTwoColorView::getTile(const ossimIrect& rect,
+                                                       ossim_uint32 resLevel)
+{
+   ossim_uint32 tileIdx = 0;
+   if(m_byPassFlag||!isSourceEnabled())
+   {
+      return getNextTile(tileIdx, 0, rect, resLevel);
+   }
+   if(!m_twoColorTile.valid())
+   {
+      allocate();
+   }
+   if(!m_twoColorTile.valid())
+   {
+      return m_twoColorTile;
+   }
+   m_twoColorTile->setImageRectangle(rect);
+   m_twoColorTile->makeBlank();
+   
+   ossimRefPtr<ossimImageData> newData = m_newInput->getTile(rect, resLevel);
+   ossimRefPtr<ossimImageData> oldData = m_oldInput->getTile(rect, resLevel);
+
+   runAlgorithm(newData.get(), oldData.get());
+
+   m_twoColorTile->validate();
+
+   return m_twoColorTile;
+}
+void ossimTwoColorView::runAlgorithm(ossimImageData* newData, ossimImageData* oldData)
+{
+   if(m_nativeFlag)
+   {
+      runNative8(newData, oldData);
+   }
+   else 
+   {
+      runNorm(newData, oldData);
+   }
+}
+
+void ossimTwoColorView::runNative8(ossimImageData* newData, ossimImageData* oldData)
+{
+   if ( newData && oldData && m_twoColorTile.valid() &&
+        ( m_twoColorTile->getNumberOfBands() == 3 ) )
+   {
+      // old, new, red, green, blue buffers...
+      ossim_uint8* o = static_cast<ossim_uint8*>( oldData->getBuf(m_oldInputBandIndex) );
+      ossim_uint8* n = static_cast<ossim_uint8*>( newData->getBuf(m_newInputBandIndex) );
+      ossim_uint8* r = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(0) );
+      ossim_uint8* g = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(1) );
+      ossim_uint8* b = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(2) );
+
+      if ( o && n && r && g && b )
+      {
+         // Assuming null pix of 0 for 8 bit.
+         const ossim_uint8 MP = 1;
+         const ossim_uint8 NP = 0;
+
+         ossim_uint8 newPix = 0;
+         ossim_uint8 oldPix = 0;
+         
+         const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
+         
+         for(ossim_uint32 idx = 0; idx < MAX_IDX; ++idx)
+         {
+            if( ( *n == NP ) && ( *o == NP ) )
+            {
+               // Both inputs null, set all outputs null.
+               *r = NP;
+               *b = NP;
+               *g = NP;
+            }
+            else 
+            {
+               // At least one input is not null.
+               newPix = (*n != NP) ? *n : MP;
+               oldPix = (*o != NP) ? *o : MP;
+
+               // Set red, OLD is default so check first:
+               if ( m_redSource == ossimTwoColorView::OLD )
+               {
+                  *r = oldPix;
+               }
+               else if ( m_redSource == ossimTwoColorView::NEW )
+               {
+                  *r = newPix;
+               }
+               else
+               {
+                  *r = MP;
+               }
+
+               // Set green, NEW is default so check first:
+               if ( m_grnSource == ossimTwoColorView::NEW )
+               {
+                  *g = newPix;
+               }
+               else if ( m_grnSource == ossimTwoColorView::OLD )
+               {
+                  *g = oldPix;
+               }
+               else
+               {
+                  *g = MP;
+               }
+
+               // Set blue, NEW is default so check first:
+               if ( m_grnSource == ossimTwoColorView::NEW )
+               {
+                  *b = newPix;
+               }
+               else if ( m_grnSource == ossimTwoColorView::OLD )
+               {
+                  *b = oldPix;
+               }
+               else
+               {
+                  *b = MP;
+               }
+            }
+
+            // Next pixel:
+            ++n;
+            ++o;
+            ++r;
+            ++g;
+            ++b;
+         }
+      }
+   }
+}
+
+void ossimTwoColorView::runNorm(ossimImageData* newData, ossimImageData* oldData)
+{
+   if ( newData && oldData && m_twoColorTile.valid() &&
+        ( m_twoColorTile->getNumberOfBands() == 3 ) )
+   {
+      const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
+      
+      // Buffers for normalized oldData and newData tiles.
+      std::vector<ossim_float32> oldDataBuffer(MAX_IDX);
+      std::vector<ossim_float32> newDataBuffer(MAX_IDX);
+
+      // old and new input buffers.
+      ossim_float32* o = &oldDataBuffer.front();      
+      ossim_float32* n = &newDataBuffer.front();
+
+      // Normalize/copy to buffers.
+      newData->copyTileBandToNormalizedBuffer(m_newInputBandIndex, n);
+      oldData->copyTileBandToNormalizedBuffer(m_oldInputBandIndex, o);
+      
+      // Get the output buffers.
+      ossim_uint8* r = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(0) );
+      ossim_uint8* g = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(1) );
+      ossim_uint8* b = static_cast<ossim_uint8*>( m_twoColorTile->getBuf(2) );
+
+      if ( o && n && r && g && b )
+      {
+         // Assuming null pix of 0 for 8 bit.
+         const ossim_uint8 MP = 1;
+         const ossim_uint8 NP = 0;
+
+         ossim_uint8   newPix = 0;
+         ossim_uint8   oldPix = 0;
+         ossim_float32 tmpPix = 0.0;
+         
+         const ossim_uint32 MAX_IDX = m_twoColorTile->getSizePerBand();
+         
+         for(ossim_uint32 idx = 0; idx < MAX_IDX; ++idx)
+         {
+            if( ( *n == NP ) && ( *o == NP ) )
+            {
+               // Both inputs null, set all outputs null.
+               *r = NP;
+               *b = NP;
+               *g = NP;
+            }
+            else 
+            {
+               // At least one input is not null.
+               
+               // Set the newPix:
+               if ( *n != NP )
+               {
+                  // Un-normalize:
+                  tmpPix = (*n) * 255.0;
+
+                  // Clamp to min/max.
+                  tmpPix = (tmpPix <= 255.0) ? ( (tmpPix >= 1.0) ? tmpPix : 1.0) : 255.0;
+
+                  // Copy
+                  newPix = static_cast<ossim_uint8>( tmpPix );
+               }
+               else
+               {
+                  newPix = MP;
+               }
+
+               // Set the oldPix:
+               if ( *o != NP )
+               {
+                  // Un-normalize:
+                  tmpPix = (*o) * 255.0;
+
+                  // Clamp to min/max.
+                  tmpPix = (tmpPix <= 255.0) ? ( (tmpPix >= 1.0) ? tmpPix : 1.0) : 255.0;
+
+                  // Copy
+                  oldPix = static_cast<ossim_uint8>( tmpPix );
+               }
+               else
+               {
+                  oldPix = MP;
+               }
+
+               // Set red, OLD is default so check first:
+               if ( m_redSource == ossimTwoColorView::OLD )
+               {
+                  *r = oldPix;
+               }
+               else if ( m_redSource == ossimTwoColorView::NEW )
+               {
+                  *r = newPix;
+               }
+               else
+               {
+                  *r = MP;
+               }
+
+               // Set green, NEW is default so check first:
+               if ( m_grnSource == ossimTwoColorView::NEW )
+               {
+                  *g = newPix;
+               }
+               else if ( m_grnSource == ossimTwoColorView::OLD )
+               {
+                  *g = oldPix;
+               }
+               else
+               {
+                  *g = MP;
+               }
+
+               // Set blue, NEW is default so check first:
+               if ( m_grnSource == ossimTwoColorView::NEW )
+               {
+                  *b = newPix;
+               }
+               else if ( m_grnSource == ossimTwoColorView::OLD )
+               {
+                  *b = oldPix;
+               }
+               else
+               {
+                  *b = MP;
+               }
+            }
+
+            // Next pixel:
+            ++n;
+            ++o;
+            ++r;
+            ++g;
+            ++b;
+         }
+      }
+   }
+}
+
+void ossimTwoColorView::allocate()
+{
+   m_twoColorTile = ossimImageDataFactory::instance()->create(this, this);
+   if(m_twoColorTile.valid())
+   {
+      m_twoColorTile->initialize();
+   }
+}
+
+
+void ossimTwoColorView::initialize()
+{
+   ossimImageCombiner::initialize();
+   m_newInput = 0;
+   m_oldInput = 0;
+   m_twoColorTile = 0;
+   m_nativeFlag = false;
+   m_byPassFlag = false;
+
+   if(getNumberOfInputs() < 2)
+   {
+      m_byPassFlag = true;
+   }
+   else 
+   {
+      m_oldInput = dynamic_cast<ossimImageSource*>( getInput(0) );
+      m_newInput = dynamic_cast<ossimImageSource*>( getInput(1) );
+
+      //---
+      // Range check band selection. This can be set from setBandIndexMapping method which
+      // does no error checking because inputs may not be set.
+      //----
+      if ( m_oldInput.valid() )
+      {
+         if ( m_oldInputBandIndex >= m_oldInput->getNumberOfOutputBands() )
+         {
+            m_oldInputBandIndex = 0;
+         }
+      }
+      
+      if ( m_newInput.valid() )
+      {
+         if ( m_newInputBandIndex >= m_newInput->getNumberOfOutputBands() )
+         {
+            m_newInputBandIndex = 0;
+         }
+      }
+         
+      if(!m_newInput||!m_oldInput)
+      {
+         m_byPassFlag = true;
+      }
+      else
+      {
+         if((m_newInput->getOutputScalarType() == OSSIM_UINT8)&&
+            (m_oldInput->getOutputScalarType() == OSSIM_UINT8))
+         {
+            m_nativeFlag = true;
+         }
+      }
+   }
+}
diff --git a/ossim/src/ossim/imaging/ossimU11ImageData.cpp b/src/imaging/ossimU11ImageData.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimU11ImageData.cpp
rename to src/imaging/ossimU11ImageData.cpp
diff --git a/src/imaging/ossimU12ImageData.cpp b/src/imaging/ossimU12ImageData.cpp
new file mode 100644
index 0000000..57c581a
--- /dev/null
+++ b/src/imaging/ossimU12ImageData.cpp
@@ -0,0 +1,614 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class definition of ossimU12ImageData.  Specialized image data object for
+// unsigned short data with an 11 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 4095.0  (2^12 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU12ImageData.cpp 16052 2009-12-08 22:20:40Z dburken $
+
+#include <ossim/imaging/ossimU12ImageData.h>
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+
+RTTI_DEF1(ossimU12ImageData, "ossimU12ImageData", ossimImageData)
+
+const ossimNormalizedU12RemapTable ossimU12ImageData::m_remapTable;
+   
+ossimU12ImageData::ossimU12ImageData()
+   :
+      ossimImageData()
+{
+   m_scalarType = OSSIM_USHORT12;
+}
+
+ossimU12ImageData::ossimU12ImageData(ossimSource* source,
+                                     ossim_uint32 bands)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT12,
+                     bands)
+{
+}
+
+ossimU12ImageData::ossimU12ImageData(ossimSource* source,
+                                     ossim_uint32 bands,
+                                     ossim_uint32 width,
+                                     ossim_uint32 height)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT12,
+                     bands,
+                     width,
+                     height)
+{
+}
+
+ossimU12ImageData::ossimU12ImageData(const ossimU12ImageData &rhs)
+   :
+      ossimImageData(rhs)
+{}
+
+ossimU12ImageData::~ossimU12ImageData()
+{
+}
+
+ossimObject* ossimU12ImageData::dup()const
+{
+   return new ossimU12ImageData(*this);
+}
+
+ossimDataObjectStatus ossimU12ImageData::validate() const
+{
+   if (m_dataBuffer.size() == 0)
+   {
+      setDataObjectStatus(OSSIM_NULL);
+      return OSSIM_NULL;
+   }
+   
+   ossim_uint32 count = 0;
+   const ossim_uint32 SIZE = getSize();
+   const ossim_uint32 BOUNDS = getSizePerBand();
+   const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
+   
+   for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
+   {
+      const ossim_uint16* p  = getUshortBuf(band);
+      for (ossim_uint32 i=0; i<BOUNDS; ++i)
+      {
+         // check if the band is null
+         if (p[i] != 0) ++count;         
+      }
+   }
+   
+   if (!count)
+      setDataObjectStatus(OSSIM_EMPTY);
+   else if (count == SIZE)
+      setDataObjectStatus(OSSIM_FULL);
+   else
+      setDataObjectStatus(OSSIM_PARTIAL);
+
+   return getDataObjectStatus();
+}
+
+void ossimU12ImageData::getNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float& result)const
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
+   {
+      const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      result =
+         static_cast<float>(m_remapTable.normFromPix(sourceBuf[offset]));
+   }
+}
+
+void ossimU12ImageData::setNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float inputValue)
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) &&  isValidBand(bandNumber) )
+   {
+      ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      sourceBuf[offset]
+         = static_cast<ossim_uint16>(m_remapTable.pixFromNorm(inputValue));
+   }
+}
+
+void
+ossimU12ImageData::convertToNormalizedFloat(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         float* resultBuf = static_cast<float*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter]
+               = static_cast<float>(m_remapTable.
+                                    normFromPix(sourceBuf[counter]));
+         }
+      }
+   }
+}
+
+void ossimU12ImageData::convertToNormalizedDouble(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         double* resultBuf = static_cast<double*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter] = m_remapTable.normFromPix(sourceBuf[counter]);
+         }
+      }
+   }
+
+}
+
+void ossimU12ImageData::unnormalizeInput(ossimImageData* normalizedInput)
+{
+   if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
+      (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
+   {
+      //ERROR
+      return;
+   }
+   
+   ossim_uint32 counter = 0;
+   ossim_uint32 bandCount = 0;
+   ossim_uint32 size = getSizePerBand();
+   ossimScalarType scalarType = normalizedInput->getScalarType();
+
+   if(size > 0)
+   {
+      if(scalarType == OSSIM_NORMALIZED_FLOAT)
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            float* sourceBuf =
+               static_cast<float*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+      else // Double
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            double* sourceBuf =
+               static_cast<double*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+   }   
+}
+
+double ossimU12ImageData::computeMeanSquaredError(double meanValue,
+                                                  ossim_uint32 bandNumber)
+{
+   double result = -1; // invalid MSE
+   ossim_uint32 index = 0;
+   double delta = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getWidth()*getHeight();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            delta = *buffer - meanValue;
+            result += (delta*delta);
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+double ossimU12ImageData::computeAverageBandValue(ossim_uint32 bandNumber)
+{
+   double result = 0.0;
+   ossim_uint32 index = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getSizePerBand();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            result += *buffer;
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+void ossimU12ImageData::setValue(long x, long y, double color)
+{
+   if(m_dataBuffer.size() > 0 && isWithin(x, y))
+   {
+      //***
+      // Compute the offset into the buffer for (x,y).  This should always
+      // come out positive.
+      //***
+      ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
+      ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
+      
+      ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
+      
+      for(ossim_uint32 band = 0; offset < m_dataBuffer.size() && // prevent buffer overrun
+                                 band < m_numberOfDataComponents; band++)
+      {
+         ossim_uint16* buf = getUshortBuf(band)+offset;
+         *buf = (ossim_uint16)color;
+      }
+   }
+}
+
+void ossimU12ImageData::fill(ossim_uint32 band, double value)
+{
+   void* s         = getBuf(band);
+
+   if (s == NULL) return; // nothing to do...
+
+   ossim_uint32 size_in_pixels = getSizePerBand();
+   ossim_uint16* p = getUshortBuf(band);
+   ossim_uint16 np = static_cast<ossim_uint16>(value);
+
+   for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+   // Set the status to unknown since we don't know about the other bands.
+   setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+}
+
+
+bool ossimU12ImageData::isNull(ossim_uint32 offset)const
+{
+   for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)  
+   {
+      const ossim_uint16* buf = getUshortBuf(band)+offset;
+      
+      if((*buf) != m_nullPixelValue[band])
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+void ossimU12ImageData::setNull(ossim_uint32 offset)
+{
+   ossim_uint32 bands = getNumberOfBands();
+   for(ossim_uint32 band = 0; band < bands; ++band)  
+   {
+      ossim_uint16* buf = getUshortBuf(band)+offset;
+      *buf          = (ossim_uint16)m_nullPixelValue[band];
+   }
+}
+
+
+void ossimU12ImageData::copyTileToNormalizedBuffer(double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         double* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; ++index)
+         {
+            d[index] = m_remapTable.
+               normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+
+      }
+   }
+}
+
+void ossimU12ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      double* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; index++)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU12ImageData::copyNormalizedBufferToTile(double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         double* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; index++)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+void ossimU12ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      double* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
+
+void ossimU12ImageData::copyTileToNormalizedBuffer(float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         float* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; index++)
+         {
+            d[index] = m_remapTable.
+                       normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+      }
+   }
+}
+
+void ossimU12ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      float* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; ++index)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU12ImageData::copyNormalizedBufferToTile(float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         float* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; ++index)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+
+void ossimU12ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU12ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      float* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
diff --git a/src/imaging/ossimU13ImageData.cpp b/src/imaging/ossimU13ImageData.cpp
new file mode 100644
index 0000000..f126b7a
--- /dev/null
+++ b/src/imaging/ossimU13ImageData.cpp
@@ -0,0 +1,614 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class definition of ossimU13ImageData.  Specialized image data object for
+// unsigned short data with an 11 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 8191.0  (2^13 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU13ImageData.cpp 16052 2009-12-08 22:20:40Z dburken $
+
+#include <ossim/imaging/ossimU13ImageData.h>
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+
+RTTI_DEF1(ossimU13ImageData, "ossimU13ImageData", ossimImageData)
+
+const ossimNormalizedU13RemapTable ossimU13ImageData::m_remapTable;
+   
+ossimU13ImageData::ossimU13ImageData()
+   :
+      ossimImageData()
+{
+   m_scalarType = OSSIM_USHORT13;
+}
+
+ossimU13ImageData::ossimU13ImageData(ossimSource* source,
+                                     ossim_uint32 bands)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT13,
+                     bands)
+{
+}
+
+ossimU13ImageData::ossimU13ImageData(ossimSource* source,
+                                     ossim_uint32 bands,
+                                     ossim_uint32 width,
+                                     ossim_uint32 height)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT13,
+                     bands,
+                     width,
+                     height)
+{
+}
+
+ossimU13ImageData::ossimU13ImageData(const ossimU13ImageData &rhs)
+   :
+      ossimImageData(rhs)
+{}
+
+ossimU13ImageData::~ossimU13ImageData()
+{
+}
+
+ossimObject* ossimU13ImageData::dup()const
+{
+   return new ossimU13ImageData(*this);
+}
+
+ossimDataObjectStatus ossimU13ImageData::validate() const
+{
+   if (m_dataBuffer.size() == 0)
+   {
+      setDataObjectStatus(OSSIM_NULL);
+      return OSSIM_NULL;
+   }
+   
+   ossim_uint32 count = 0;
+   const ossim_uint32 SIZE = getSize();
+   const ossim_uint32 BOUNDS = getSizePerBand();
+   const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
+   
+   for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
+   {
+      const ossim_uint16* p  = getUshortBuf(band);
+      for (ossim_uint32 i=0; i<BOUNDS; ++i)
+      {
+         // check if the band is null
+         if (p[i] != 0) ++count;         
+      }
+   }
+   
+   if (!count)
+      setDataObjectStatus(OSSIM_EMPTY);
+   else if (count == SIZE)
+      setDataObjectStatus(OSSIM_FULL);
+   else
+      setDataObjectStatus(OSSIM_PARTIAL);
+
+   return getDataObjectStatus();
+}
+
+void ossimU13ImageData::getNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float& result)const
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
+   {
+      const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      result =
+         static_cast<float>(m_remapTable.normFromPix(sourceBuf[offset]));
+   }
+}
+
+void ossimU13ImageData::setNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float inputValue)
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) &&  isValidBand(bandNumber) )
+   {
+      ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      sourceBuf[offset]
+         = static_cast<ossim_uint16>(m_remapTable.pixFromNorm(inputValue));
+   }
+}
+
+void
+ossimU13ImageData::convertToNormalizedFloat(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         float* resultBuf = static_cast<float*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter]
+               = static_cast<float>(m_remapTable.
+                                    normFromPix(sourceBuf[counter]));
+         }
+      }
+   }
+}
+
+void ossimU13ImageData::convertToNormalizedDouble(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         double* resultBuf = static_cast<double*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter] = m_remapTable.normFromPix(sourceBuf[counter]);
+         }
+      }
+   }
+
+}
+
+void ossimU13ImageData::unnormalizeInput(ossimImageData* normalizedInput)
+{
+   if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
+      (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
+   {
+      //ERROR
+      return;
+   }
+   
+   ossim_uint32 counter = 0;
+   ossim_uint32 bandCount = 0;
+   ossim_uint32 size = getSizePerBand();
+   ossimScalarType scalarType = normalizedInput->getScalarType();
+
+   if(size > 0)
+   {
+      if(scalarType == OSSIM_NORMALIZED_FLOAT)
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            float* sourceBuf =
+               static_cast<float*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+      else // Double
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            double* sourceBuf =
+               static_cast<double*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+   }   
+}
+
+double ossimU13ImageData::computeMeanSquaredError(double meanValue,
+                                                  ossim_uint32 bandNumber)
+{
+   double result = -1; // invalid MSE
+   ossim_uint32 index = 0;
+   double delta = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getWidth()*getHeight();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            delta = *buffer - meanValue;
+            result += (delta*delta);
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+double ossimU13ImageData::computeAverageBandValue(ossim_uint32 bandNumber)
+{
+   double result = 0.0;
+   ossim_uint32 index = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getSizePerBand();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            result += *buffer;
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+void ossimU13ImageData::setValue(long x, long y, double color)
+{
+   if(m_dataBuffer.size() > 0 && isWithin(x, y))
+   {
+      //***
+      // Compute the offset into the buffer for (x,y).  This should always
+      // come out positive.
+      //***
+      ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
+      ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
+      
+      ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
+      
+      for(ossim_uint32 band = 0; offset < m_dataBuffer.size() && // prevent buffer overrun
+                                 band < m_numberOfDataComponents; band++)
+      {
+         ossim_uint16* buf = getUshortBuf(band)+offset;
+         *buf = (ossim_uint16)color;
+      }
+   }
+}
+
+void ossimU13ImageData::fill(ossim_uint32 band, double value)
+{
+   void* s         = getBuf(band);
+
+   if (s == NULL) return; // nothing to do...
+
+   ossim_uint32 size_in_pixels = getSizePerBand();
+   ossim_uint16* p = getUshortBuf(band);
+   ossim_uint16 np = static_cast<ossim_uint16>(value);
+
+   for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+   // Set the status to unknown since we don't know about the other bands.
+   setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+}
+
+
+bool ossimU13ImageData::isNull(ossim_uint32 offset)const
+{
+   for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)  
+   {
+      const ossim_uint16* buf = getUshortBuf(band)+offset;
+      
+      if((*buf) != m_nullPixelValue[band])
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+void ossimU13ImageData::setNull(ossim_uint32 offset)
+{
+   ossim_uint32 bands = getNumberOfBands();
+   for(ossim_uint32 band = 0; band < bands; ++band)  
+   {
+      ossim_uint16* buf = getUshortBuf(band)+offset;
+      *buf          = (ossim_uint16)m_nullPixelValue[band];
+   }
+}
+
+
+void ossimU13ImageData::copyTileToNormalizedBuffer(double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         double* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; ++index)
+         {
+            d[index] = m_remapTable.
+               normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+
+      }
+   }
+}
+
+void ossimU13ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      double* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; index++)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU13ImageData::copyNormalizedBufferToTile(double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         double* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; index++)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+void ossimU13ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      double* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
+
+void ossimU13ImageData::copyTileToNormalizedBuffer(float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         float* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; index++)
+         {
+            d[index] = m_remapTable.
+                       normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+      }
+   }
+}
+
+void ossimU13ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      float* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; ++index)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU13ImageData::copyNormalizedBufferToTile(float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         float* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; ++index)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+
+void ossimU13ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU13ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      float* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
diff --git a/src/imaging/ossimU14ImageData.cpp b/src/imaging/ossimU14ImageData.cpp
new file mode 100644
index 0000000..7d54505
--- /dev/null
+++ b/src/imaging/ossimU14ImageData.cpp
@@ -0,0 +1,614 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class definition of ossimU14ImageData.  Specialized image data object for
+// unsigned short data with an 11 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 16383.0  (2^14 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU14ImageData.cpp 16052 2009-12-08 22:20:40Z dburken $
+
+#include <ossim/imaging/ossimU14ImageData.h>
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+
+RTTI_DEF1(ossimU14ImageData, "ossimU14ImageData", ossimImageData)
+
+const ossimNormalizedU14RemapTable ossimU14ImageData::m_remapTable;
+   
+ossimU14ImageData::ossimU14ImageData()
+   :
+      ossimImageData()
+{
+   m_scalarType = OSSIM_USHORT14;
+}
+
+ossimU14ImageData::ossimU14ImageData(ossimSource* source,
+                                     ossim_uint32 bands)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT14,
+                     bands)
+{
+}
+
+ossimU14ImageData::ossimU14ImageData(ossimSource* source,
+                                     ossim_uint32 bands,
+                                     ossim_uint32 width,
+                                     ossim_uint32 height)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT14,
+                     bands,
+                     width,
+                     height)
+{
+}
+
+ossimU14ImageData::ossimU14ImageData(const ossimU14ImageData &rhs)
+   :
+      ossimImageData(rhs)
+{}
+
+ossimU14ImageData::~ossimU14ImageData()
+{
+}
+
+ossimObject* ossimU14ImageData::dup()const
+{
+   return new ossimU14ImageData(*this);
+}
+
+ossimDataObjectStatus ossimU14ImageData::validate() const
+{
+   if (m_dataBuffer.size() == 0)
+   {
+      setDataObjectStatus(OSSIM_NULL);
+      return OSSIM_NULL;
+   }
+   
+   ossim_uint32 count = 0;
+   const ossim_uint32 SIZE = getSize();
+   const ossim_uint32 BOUNDS = getSizePerBand();
+   const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
+   
+   for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
+   {
+      const ossim_uint16* p  = getUshortBuf(band);
+      for (ossim_uint32 i=0; i<BOUNDS; ++i)
+      {
+         // check if the band is null
+         if (p[i] != 0) ++count;         
+      }
+   }
+   
+   if (!count)
+      setDataObjectStatus(OSSIM_EMPTY);
+   else if (count == SIZE)
+      setDataObjectStatus(OSSIM_FULL);
+   else
+      setDataObjectStatus(OSSIM_PARTIAL);
+
+   return getDataObjectStatus();
+}
+
+void ossimU14ImageData::getNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float& result)const
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
+   {
+      const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      result =
+         static_cast<float>(m_remapTable.normFromPix(sourceBuf[offset]));
+   }
+}
+
+void ossimU14ImageData::setNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float inputValue)
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) &&  isValidBand(bandNumber) )
+   {
+      ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      sourceBuf[offset]
+         = static_cast<ossim_uint16>(m_remapTable.pixFromNorm(inputValue));
+   }
+}
+
+void
+ossimU14ImageData::convertToNormalizedFloat(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         float* resultBuf = static_cast<float*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter]
+               = static_cast<float>(m_remapTable.
+                                    normFromPix(sourceBuf[counter]));
+         }
+      }
+   }
+}
+
+void ossimU14ImageData::convertToNormalizedDouble(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         double* resultBuf = static_cast<double*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter] = m_remapTable.normFromPix(sourceBuf[counter]);
+         }
+      }
+   }
+
+}
+
+void ossimU14ImageData::unnormalizeInput(ossimImageData* normalizedInput)
+{
+   if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
+      (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
+   {
+      //ERROR
+      return;
+   }
+   
+   ossim_uint32 counter = 0;
+   ossim_uint32 bandCount = 0;
+   ossim_uint32 size = getSizePerBand();
+   ossimScalarType scalarType = normalizedInput->getScalarType();
+
+   if(size > 0)
+   {
+      if(scalarType == OSSIM_NORMALIZED_FLOAT)
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            float* sourceBuf =
+               static_cast<float*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+      else // Double
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            double* sourceBuf =
+               static_cast<double*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+   }   
+}
+
+double ossimU14ImageData::computeMeanSquaredError(double meanValue,
+                                                  ossim_uint32 bandNumber)
+{
+   double result = -1; // invalid MSE
+   ossim_uint32 index = 0;
+   double delta = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getWidth()*getHeight();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            delta = *buffer - meanValue;
+            result += (delta*delta);
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+double ossimU14ImageData::computeAverageBandValue(ossim_uint32 bandNumber)
+{
+   double result = 0.0;
+   ossim_uint32 index = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getSizePerBand();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            result += *buffer;
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+void ossimU14ImageData::setValue(long x, long y, double color)
+{
+   if(m_dataBuffer.size() > 0 && isWithin(x, y))
+   {
+      //***
+      // Compute the offset into the buffer for (x,y).  This should always
+      // come out positive.
+      //***
+      ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
+      ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
+      
+      ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
+      
+      for(ossim_uint32 band = 0; offset < m_dataBuffer.size() && // prevent buffer overrun
+                                 band < m_numberOfDataComponents; band++)
+      {
+         ossim_uint16* buf = getUshortBuf(band)+offset;
+         *buf = (ossim_uint16)color;
+      }
+   }
+}
+
+void ossimU14ImageData::fill(ossim_uint32 band, double value)
+{
+   void* s         = getBuf(band);
+
+   if (s == NULL) return; // nothing to do...
+
+   ossim_uint32 size_in_pixels = getSizePerBand();
+   ossim_uint16* p = getUshortBuf(band);
+   ossim_uint16 np = static_cast<ossim_uint16>(value);
+
+   for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+   // Set the status to unknown since we don't know about the other bands.
+   setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+}
+
+
+bool ossimU14ImageData::isNull(ossim_uint32 offset)const
+{
+   for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)  
+   {
+      const ossim_uint16* buf = getUshortBuf(band)+offset;
+      
+      if((*buf) != m_nullPixelValue[band])
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+void ossimU14ImageData::setNull(ossim_uint32 offset)
+{
+   ossim_uint32 bands = getNumberOfBands();
+   for(ossim_uint32 band = 0; band < bands; ++band)  
+   {
+      ossim_uint16* buf = getUshortBuf(band)+offset;
+      *buf          = (ossim_uint16)m_nullPixelValue[band];
+   }
+}
+
+
+void ossimU14ImageData::copyTileToNormalizedBuffer(double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         double* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; ++index)
+         {
+            d[index] = m_remapTable.
+               normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+
+      }
+   }
+}
+
+void ossimU14ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      double* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; index++)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU14ImageData::copyNormalizedBufferToTile(double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         double* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; index++)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+void ossimU14ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      double* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
+
+void ossimU14ImageData::copyTileToNormalizedBuffer(float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         float* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; index++)
+         {
+            d[index] = m_remapTable.
+                       normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+      }
+   }
+}
+
+void ossimU14ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      float* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; ++index)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU14ImageData::copyNormalizedBufferToTile(float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         float* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; ++index)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+
+void ossimU14ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU14ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      float* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
diff --git a/src/imaging/ossimU15ImageData.cpp b/src/imaging/ossimU15ImageData.cpp
new file mode 100644
index 0000000..f64f5c3
--- /dev/null
+++ b/src/imaging/ossimU15ImageData.cpp
@@ -0,0 +1,614 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Class definition of ossimU15ImageData.  Specialized image data object for
+// unsigned short data with an 11 bit depth.
+//
+// NOTE:  This object is optimized for unsigned short data and assumes the
+//        following:  null pixel value  = 0.0
+//                    min  pixel value  = 1.0
+//                    max  pixel value  = 32767.0  (2^15 - 1)
+//
+//        If you want anything else use the less efficient ossimImageData.
+//
+//*************************************************************************
+// $Id: ossimU15ImageData.cpp 16052 2009-12-08 22:20:40Z dburken $
+
+#include <ossim/imaging/ossimU15ImageData.h>
+#include <ossim/base/ossimSource.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimHistogram.h>
+
+RTTI_DEF1(ossimU15ImageData, "ossimU15ImageData", ossimImageData)
+
+const ossimNormalizedU15RemapTable ossimU15ImageData::m_remapTable;
+   
+ossimU15ImageData::ossimU15ImageData()
+   :
+      ossimImageData()
+{
+   m_scalarType = OSSIM_USHORT15;
+}
+
+ossimU15ImageData::ossimU15ImageData(ossimSource* source,
+                                     ossim_uint32 bands)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT15,
+                     bands)
+{
+}
+
+ossimU15ImageData::ossimU15ImageData(ossimSource* source,
+                                     ossim_uint32 bands,
+                                     ossim_uint32 width,
+                                     ossim_uint32 height)
+   :
+      ossimImageData(source,
+                     OSSIM_USHORT15,
+                     bands,
+                     width,
+                     height)
+{
+}
+
+ossimU15ImageData::ossimU15ImageData(const ossimU15ImageData &rhs)
+   :
+      ossimImageData(rhs)
+{}
+
+ossimU15ImageData::~ossimU15ImageData()
+{
+}
+
+ossimObject* ossimU15ImageData::dup()const
+{
+   return new ossimU15ImageData(*this);
+}
+
+ossimDataObjectStatus ossimU15ImageData::validate() const
+{
+   if (m_dataBuffer.size() == 0)
+   {
+      setDataObjectStatus(OSSIM_NULL);
+      return OSSIM_NULL;
+   }
+   
+   ossim_uint32 count = 0;
+   const ossim_uint32 SIZE = getSize();
+   const ossim_uint32 BOUNDS = getSizePerBand();
+   const ossim_uint32 NUMBER_OF_BANDS = getNumberOfBands();
+   
+   for(ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
+   {
+      const ossim_uint16* p  = getUshortBuf(band);
+      for (ossim_uint32 i=0; i<BOUNDS; ++i)
+      {
+         // check if the band is null
+         if (p[i] != 0) ++count;         
+      }
+   }
+   
+   if (!count)
+      setDataObjectStatus(OSSIM_EMPTY);
+   else if (count == SIZE)
+      setDataObjectStatus(OSSIM_FULL);
+   else
+      setDataObjectStatus(OSSIM_PARTIAL);
+
+   return getDataObjectStatus();
+}
+
+void ossimU15ImageData::getNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float& result)const
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) && isValidBand(bandNumber) )
+   {
+      const ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      result =
+         static_cast<float>(m_remapTable.normFromPix(sourceBuf[offset]));
+   }
+}
+
+void ossimU15ImageData::setNormalizedFloat(ossim_uint32 offset,
+                                           ossim_uint32 bandNumber,
+                                           float inputValue)
+{
+   if( (getDataObjectStatus() != OSSIM_NULL) &&  isValidBand(bandNumber) )
+   {
+      ossim_uint16* sourceBuf = getUshortBuf(bandNumber);
+      sourceBuf[offset]
+         = static_cast<ossim_uint16>(m_remapTable.pixFromNorm(inputValue));
+   }
+}
+
+void
+ossimU15ImageData::convertToNormalizedFloat(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         float* resultBuf = static_cast<float*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter]
+               = static_cast<float>(m_remapTable.
+                                    normFromPix(sourceBuf[counter]));
+         }
+      }
+   }
+}
+
+void ossimU15ImageData::convertToNormalizedDouble(ossimImageData* result)const
+{
+   if(!result)
+   {
+      return;
+   }
+   
+   // make sure that the types and width and height are
+   // good.
+   if( (result->getScalarType() != OSSIM_NORMALIZED_FLOAT) ||
+       (result->getNumberOfBands() != this->getNumberOfBands())||
+       (result->getWidth() != this->getWidth()) ||
+       (result->getHeight() != this->getHeight())||
+       (result->getDataObjectStatus() == OSSIM_NULL) ||
+       (getDataObjectStatus() == OSSIM_NULL))
+   {
+      return;
+   }
+
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+      {
+         const ossim_uint16* sourceBuf = getUshortBuf(bandCount);
+         double* resultBuf = static_cast<double*>(result->getBuf(bandCount));
+         for(ossim_uint32 counter = 0; counter <  size; ++counter)
+         {
+            resultBuf[counter] = m_remapTable.normFromPix(sourceBuf[counter]);
+         }
+      }
+   }
+
+}
+
+void ossimU15ImageData::unnormalizeInput(ossimImageData* normalizedInput)
+{
+   if((normalizedInput->getScalarType() != OSSIM_NORMALIZED_FLOAT) &&
+      (normalizedInput->getScalarType() != OSSIM_NORMALIZED_DOUBLE) )
+   {
+      //ERROR
+      return;
+   }
+   
+   ossim_uint32 counter = 0;
+   ossim_uint32 bandCount = 0;
+   ossim_uint32 size = getSizePerBand();
+   ossimScalarType scalarType = normalizedInput->getScalarType();
+
+   if(size > 0)
+   {
+      if(scalarType == OSSIM_NORMALIZED_FLOAT)
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            float* sourceBuf =
+               static_cast<float*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+      else // Double
+      {
+         for(bandCount = 0; bandCount < m_numberOfDataComponents; ++bandCount)
+         {
+            double* sourceBuf =
+               static_cast<double*>(normalizedInput->getBuf(bandCount));
+            ossim_uint16* resultBuf = getUshortBuf(bandCount);
+            for(counter = 0; counter <  size; ++counter)
+            {
+               resultBuf[counter]
+                  = static_cast<ossim_uint16>(m_remapTable.
+                                              pixFromNorm(sourceBuf[counter]));
+            }
+         }
+      }
+   }   
+}
+
+double ossimU15ImageData::computeMeanSquaredError(double meanValue,
+                                                  ossim_uint32 bandNumber)
+{
+   double result = -1; // invalid MSE
+   ossim_uint32 index = 0;
+   double delta = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getWidth()*getHeight();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            delta = *buffer - meanValue;
+            result += (delta*delta);
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+double ossimU15ImageData::computeAverageBandValue(ossim_uint32 bandNumber)
+{
+   double result = 0.0;
+   ossim_uint32 index = 0;
+   ossim_uint32 validPixelCount=0;
+   
+   ossim_uint16* buffer = getUshortBuf(bandNumber);
+   if(buffer)
+   {
+      ossim_uint32 bounds = getSizePerBand();
+      for(index = 0; index < bounds; ++index)
+      {
+         if(!isNull(index))
+         {
+            result += *buffer;
+            ++validPixelCount;
+         }
+         ++buffer;
+      }
+      if(validPixelCount > 0)
+      {
+         result /= validPixelCount;
+      }
+   }
+
+   return result;
+}
+
+void ossimU15ImageData::setValue(long x, long y, double color)
+{
+   if(m_dataBuffer.size() > 0 && isWithin(x, y))
+   {
+      //***
+      // Compute the offset into the buffer for (x,y).  This should always
+      // come out positive.
+      //***
+      ossim_uint32 ux = static_cast<ossim_uint32>(x - m_origin.x);
+      ossim_uint32 uy = static_cast<ossim_uint32>(y - m_origin.y);
+      
+      ossim_uint32 offset = uy * m_spatialExtents[0] + ux;
+      
+      for(ossim_uint32 band = 0; offset < m_dataBuffer.size() && // prevent buffer overrun
+                                 band < m_numberOfDataComponents; band++)
+      {
+         ossim_uint16* buf = getUshortBuf(band)+offset;
+         *buf = (ossim_uint16)color;
+      }
+   }
+}
+
+void ossimU15ImageData::fill(ossim_uint32 band, double value)
+{
+   void* s         = getBuf(band);
+
+   if (s == NULL) return; // nothing to do...
+
+   ossim_uint32 size_in_pixels = getSizePerBand();
+   ossim_uint16* p = getUshortBuf(band);
+   ossim_uint16 np = static_cast<ossim_uint16>(value);
+
+   for (ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
+
+   // Set the status to unknown since we don't know about the other bands.
+   setDataObjectStatus(OSSIM_STATUS_UNKNOWN);
+}
+
+
+bool ossimU15ImageData::isNull(ossim_uint32 offset)const
+{
+   for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)  
+   {
+      const ossim_uint16* buf = getUshortBuf(band)+offset;
+      
+      if((*buf) != m_nullPixelValue[band])
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
+
+void ossimU15ImageData::setNull(ossim_uint32 offset)
+{
+   ossim_uint32 bands = getNumberOfBands();
+   for(ossim_uint32 band = 0; band < bands; ++band)  
+   {
+      ossim_uint16* buf = getUshortBuf(band)+offset;
+      *buf          = (ossim_uint16)m_nullPixelValue[band];
+   }
+}
+
+
+void ossimU15ImageData::copyTileToNormalizedBuffer(double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         double* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; ++index)
+         {
+            d[index] = m_remapTable.
+               normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+
+      }
+   }
+}
+
+void ossimU15ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   double* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      double* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; index++)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU15ImageData::copyNormalizedBufferToTile(double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         double* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; index++)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+void ossimU15ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   double* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      double* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
+
+void ossimU15ImageData::copyTileToNormalizedBuffer(float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); band++)
+      {
+         const ossim_uint16* s = getUshortBuf(band);  // source
+         float* d = buf + (band*size);   // destination
+
+         for(ossim_uint32 index = 0; index < size; index++)
+         {
+            d[index] = m_remapTable.
+                       normFromPix(static_cast<ossim_int32>(s[index]));
+         }
+      }
+   }
+}
+
+void ossimU15ImageData::copyTileToNormalizedBuffer(ossim_uint32 band,
+                                                   float* buf) const
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   if(!getBuf(band)) return;
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      const ossim_uint16* s = getUshortBuf(band);  // source
+      float* d = buf;   // destination
+      
+      for(ossim_uint32 index = 0; index < size; ++index)
+      {
+         *d = m_remapTable.normFromPix(static_cast<ossim_int32>(*s));
+      }
+   }
+}
+
+void ossimU15ImageData::copyNormalizedBufferToTile(float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if(size > 0)
+   {
+      for(ossim_uint32 band = 0; band < getNumberOfBands(); ++band)
+      {
+         float* s = buf + (band*size); // source
+         ossim_uint16* d = getUshortBuf(band); // destination
+
+         for(ossim_uint32 index = 0; index <  size; ++index)
+         {
+            d[index] = m_remapTable.pixFromNorm(s[index]);
+         }
+      }
+   }
+}
+
+
+void ossimU15ImageData::copyNormalizedBufferToTile(ossim_uint32 band,
+                                                   float* buf)
+{
+   if (!buf)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "ossimU15ImageData::copyTileToNormalizedBuffer File %s line %d\nNull pointer passed to method!",
+                    __FILE__,
+                    __LINE__);
+      return;
+   }
+   
+   ossim_uint32 size = getSizePerBand();
+   
+   if((size > 0)&&getBuf(band))
+   {
+      float* s = buf; // source
+      ossim_uint16* d = getUshortBuf(band); // destination
+      
+      for(ossim_uint32 index = 0; index <  size; ++index)
+      {
+         *d = m_remapTable.pixFromNorm(*s);
+         ++d;
+         ++s;
+      }
+   }
+}
+
diff --git a/ossim/src/ossim/imaging/ossimU16ImageData.cpp b/src/imaging/ossimU16ImageData.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimU16ImageData.cpp
rename to src/imaging/ossimU16ImageData.cpp
diff --git a/ossim/src/ossim/imaging/ossimU8ImageData.cpp b/src/imaging/ossimU8ImageData.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimU8ImageData.cpp
rename to src/imaging/ossimU8ImageData.cpp
diff --git a/src/imaging/ossimUsgsDemTileSource.cpp b/src/imaging/ossimUsgsDemTileSource.cpp
new file mode 100644
index 0000000..80ed3ed
--- /dev/null
+++ b/src/imaging/ossimUsgsDemTileSource.cpp
@@ -0,0 +1,562 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Contains class declaration for ossimUsgsDemTileSource.
+//
+//********************************************************************
+// $Id: ossimUsgsDemTileSource.cpp 19640 2011-05-25 15:58:00Z oscarkramer $
+
+#include <iostream>
+#include <fstream>
+#include <ossim/imaging/ossimUsgsDemTileSource.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/support_data/ossimDemHeader.h>
+#include <ossim/support_data/ossimDemProfile.h>
+#include <ossim/support_data/ossimDemGrid.h>
+#include <ossim/support_data/ossimDemUtil.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+
+RTTI_DEF1(ossimUsgsDemTileSource, "ossimUsgsDemTileSource", ossimImageHandler)
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimUsgsDemTileSource:debug");
+
+static const char DEM_TYPE_KW[] = "dem_type";
+static const char USGS_DEM_KW[] = "usgs_dem";
+
+
+ossimUsgsDemTileSource::ossimUsgsDemTileSource()
+   :
+      ossimImageHandler(),
+      theDem(0),
+      theTile(0),
+      theNullValue(0.0),
+      theMinHeight(0.0),
+      theMaxHeight(0.0),
+      theFeetFlag(false),
+      theIsDemFlag(false),
+      theScalarType(OSSIM_SINT16)
+{
+   // Construction not complete.  Users should call "open" method.
+}
+
+ossimUsgsDemTileSource::~ossimUsgsDemTileSource()
+{
+   if (theDem)
+   {
+      delete theDem;
+      theDem = 0;
+   }
+   theTile = 0;
+}
+
+ossimRefPtr<ossimImageData> ossimUsgsDemTileSource::getTile(
+   const  ossimIrect& tile_rect, ossim_uint32 resLevel)
+{
+   if (theTile.valid())
+   {
+      // Image rectangle must be set prior to calling getTile.
+      theTile->setImageRectangle(tile_rect);
+      
+      if ( getTile( theTile.get(), resLevel ) == false )
+      {
+         if (theTile->getDataObjectStatus() != OSSIM_NULL)
+         {
+            theTile->makeBlank();
+         }
+      }
+   }
+   
+   return theTile;
+}
+
+bool ossimUsgsDemTileSource::getTile(ossimImageData* result,
+                                     ossim_uint32 resLevel)
+{
+   bool status = false;
+
+   //---
+   // Not open, this tile source bypassed, or invalid res level,
+   // return a blank tile.
+   //---
+   if( isOpen() && isSourceEnabled() && isValidRLevel(resLevel) &&
+       result && (result->getNumberOfBands() == getNumberOfOutputBands()) )
+   {
+      result->ref(); // Increment ref count.
+
+      //---
+      // Check for overview tile.  Some overviews can contain r0 so always
+      // call even if resLevel is 0.  Method returns true on success, false
+      // on error.
+      //---
+      status = getOverviewTile(resLevel, result);
+      
+      if (status) // From old code.  Not sure if still needed.
+      {
+         result->setMinPix(theTile->getMinPix(), theTile->getNumberOfBands());
+         result->setMaxPix(theTile->getMaxPix(), theTile->getNumberOfBands());
+         result->setNullPix(theTile->getNullPix(), theTile->getNumberOfBands());
+      }
+      
+      if (!status) // Did not get an overview tile.
+      {
+         status = true;
+         
+         ossimIrect tile_rect = result->getImageRectangle();
+         
+         ossimIrect image_rect = getImageRectangle(resLevel);
+         
+         //---
+         // See if any point of the requested tile is in the image.
+         //---
+         if ( tile_rect.intersects(image_rect) )
+         {
+            ossimIrect clip_rect = tile_rect.clipToRect(image_rect);
+            
+            if ( !tile_rect.completely_within(clip_rect) )
+            {
+               // Start with a blank tile.
+               result->makeBlank();
+            }
+            
+            // Load the tile buffer with data from the dem cell.
+            if (theScalarType == OSSIM_FLOAT32)
+            {
+               status = fillBuffer(ossim_float32(0.0),
+                                   tile_rect,
+                                   clip_rect,
+                                   result);
+            }
+            else
+            {
+               status = fillBuffer(ossim_sint16(0),
+                                   tile_rect,
+                                   clip_rect,
+                                   result);
+            }
+            if (status == true)
+            {
+               result->validate();
+            }
+         }    
+         else // No intersection:  if ( tile_rect.intersects(image_rect) )
+         {
+            result->makeBlank();
+         }
+      }
+
+      result->unref(); // Decrement ref count.
+   }
+
+   return status;
+}
+
+//*******************************************************************
+// Private Method:
+//*******************************************************************
+template <class T>
+bool ossimUsgsDemTileSource::fillBuffer(T,
+                                        const ossimIrect& tile_rect,
+                                        const ossimIrect& clip_rect,
+                                        ossimImageData* tile)
+{
+   const ossim_uint32 TILE_WIDTH = tile->getWidth();
+
+   T* d = static_cast<T*>(tile->getBuf());
+   
+   ossim_float32 spatialResZ = theDem->getHeader().getSpatialResZ();
+   if (spatialResZ == 0.0) spatialResZ = 1.0;
+
+   // Compute the starting offset.
+   ossim_uint32 offset = (clip_rect.ul().y - tile_rect.ul().y) * TILE_WIDTH +
+      clip_rect.ul().x - tile_rect.ul().x;
+
+   for (ossim_int32 line = clip_rect.ul().y; line <= clip_rect.lr().y; ++line)
+   {
+      // Loop in the longitude or sample direction.
+      int samp_offset = 0;
+      for (ossim_int32 samp = clip_rect.ul().x; samp <= clip_rect.lr().x; ++samp)
+      {
+         ossim_float32 p = theDem->getElevation(samp, line);
+         if (p != theNullValue)
+         {
+            p *= spatialResZ;
+            if (theFeetFlag) p = p * MTRS_PER_FT;
+         }
+         d[offset + samp_offset] = static_cast<T>(p);
+         ++samp_offset;
+      }
+      offset += TILE_WIDTH;
+   }
+
+   return true;
+}
+
+ossimIrect
+ossimUsgsDemTileSource::getImageRectangle(ossim_uint32 reduced_res_level) const
+{
+   return ossimIrect(0,
+                     0,
+                     getNumberOfSamples(reduced_res_level) - 1,
+                     getNumberOfLines(reduced_res_level)   - 1);
+}
+
+bool ossimUsgsDemTileSource::open()
+{
+   static const char MODULE[] = "ossimUsgsDemTileSource::open";
+
+   if (traceDebug())
+   {
+      CLOG << "DEBUG:"
+           << "\nAttempting to parse file:  " << theImageFile.c_str()
+           << std::endl;
+   }
+
+   theIsDemFlag = ossimDemUtil::isUsgsDem(theImageFile);
+
+   if (theIsDemFlag)
+   {
+      // Open up the file for reading.
+      std::ifstream is(theImageFile.c_str(),
+                       std::ios_base::in | std::ios_base::binary);
+      if (is.good())
+      {
+         // Start out with a fresh dem.
+         if (theDem) delete theDem;
+         
+         //---
+         // Set the null to -32768.  This will also be the missing data values.
+         //---
+         theNullValue = OSSIM_DEFAULT_NULL_PIX_SINT16;
+         
+         //---
+         // Read the dem.
+         // 
+         // NOTE:  This defines the missing data value.  It should be the
+         // same as null for mosaicing and min/max calculations.
+         //---
+         theDem = new ossimDemGrid(theNullValue);
+         theDem->read(is);
+         
+         is.close();
+      }
+      else
+      {
+         theIsDemFlag = false;
+      }
+   }
+   
+   if (theIsDemFlag)
+   {
+      theFeetFlag  = (theDem->getHeader().getElevationUnits() == 1) ?
+         true : false;
+      
+      theMinHeight = theFeetFlag ? theDem->getHeader().getMinimumElev() *
+         MTRS_PER_FT : theDem->getHeader().getMinimumElev();
+      theMaxHeight = theFeetFlag ? theDem->getHeader().getMaximumElev() *
+         MTRS_PER_FT : theDem->getHeader().getMaximumElev();
+      
+      completeOpen();
+      
+      //---
+      // Set up the tiles.  Note the blank tile will not get initialized to
+      // save memory.  This includes setting the min and max pixel value
+      // gathered from the statistics.
+      //---
+      theTile = ossimImageDataFactory::instance()->create(this, this);
+      theTile->initialize();
+      
+      if (traceDebug())
+      {
+         CLOG << setiosflags(ios::fixed) << setprecision(5) << "DEBUG:"
+              << "\nNull pix:  " << (theTile->getNullPix(0))
+              << "\nMin  pix:  " << (theTile->getMinPix(0))
+              << "\nMax  pix:  " << (theTile->getMaxPix(0))
+              << "\nlines:     " << theDem->getHeight()
+              << "\nsamples:   " << theDem->getWidth()
+              << std::endl;
+      }
+   }
+
+   return theIsDemFlag;
+}
+
+bool ossimUsgsDemTileSource::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix) const
+{
+   // Save of the dem type keyword.
+   kwl.add(prefix, DEM_TYPE_KW, USGS_DEM_KW, true);
+
+   // Save the scalar type.
+   kwl.add(prefix,
+           ossimKeywordNames::SCALAR_TYPE_KW,
+           ossimScalarTypeLut::instance()->getEntryString(theScalarType));
+   
+   return ossimImageHandler::saveState(kwl, prefix);
+}
+
+bool ossimUsgsDemTileSource::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   if (ossimImageHandler::loadState(kwl, prefix))
+   {
+      //***
+      // Look for "dem_type: usgs_dem" key value pair.
+      // Note:  If not in the keyword list the "open" will look for it on
+      //        disk.
+      //***
+      const char* lookup = kwl.find(prefix, DEM_TYPE_KW);
+      if (lookup)
+      {
+         ossimString s = lookup;
+         s.downcase();
+         if (s == USGS_DEM_KW) theIsDemFlag = true;
+      }
+
+      //---
+      // Look for scalar type override.
+      //
+      // Note: We only allow float or signed 16 bit.
+      //---
+      lookup = kwl.find(prefix, ossimKeywordNames::SCALAR_TYPE_KW);
+      if (lookup)
+      {
+         ossimScalarType st =
+            static_cast<ossimScalarType>(ossimScalarTypeLut::instance()->
+                                         getEntryNumber(lookup));
+         if ( (st == OSSIM_FLOAT32) || (st == OSSIM_SINT16))
+         {
+            theScalarType = st;
+         }
+         else
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimUsgsDemTileSource::loadState WARNING:"
+                  << "\nInvalid scalar type: "
+                  << ossimScalarTypeLut::instance()->
+                  getEntryString(st)
+                  << std::endl;
+            }
+         }
+      }
+
+      if (open())
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimUsgsDemTileSource::getImageGeometry()
+{
+   if ( !theGeometry )
+   {
+      // Check for external geom:
+      theGeometry = getExternalImageGeometry();
+
+      if ( !theGeometry )
+      {
+         // Check the internal geometry first to avoid a factory call.
+         theGeometry = getInternalImageGeometry();
+
+         // At this point it is assured theGeometry is set.
+
+         //---
+         // WARNING:
+         // Must create/set theGeometry at this point or the next call to
+         // ossimImageGeometryRegistry::extendGeometry will put us in an infinite loop
+         // as it does a recursive call back to ossimImageHandler::getImageGeometry().
+         //---         
+
+         // Check for set projection.
+         if ( !theGeometry->getProjection() )
+         {
+            // Try factories for projection.
+            ossimImageGeometryRegistry::instance()->extendGeometry(this);
+         }
+      }
+
+      // Set image things the geometry object should know about.
+      initImageParameters( theGeometry.get() );
+   }
+
+   return theGeometry;
+}
+
+
+ossimRefPtr<ossimImageGeometry> ossimUsgsDemTileSource::getInternalImageGeometry() const
+{
+   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
+   
+   if (theDem)
+   {
+      const ossimDemHeader HDR = theDem->getHeader();
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:"
+            << "\nDEM Header:"
+            << std::endl;
+         HDR.print(ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+      
+      // The DEM's image geometry is a map projection, obtained here via KWL:
+      ossimKeywordlist proj_kwl;
+      if ( HDR.getImageGeometry(proj_kwl) ) 
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimUsgsDemTileSource::getInternalImageGeometry DEBUG:"
+               << "keyword list:\n" << proj_kwl
+               << std::endl;
+         }
+         
+         // Capture for next time.
+         ossimRefPtr<ossimProjection> proj =
+            ossimProjectionFactoryRegistry::instance()->
+            createProjection(proj_kwl);
+         if ( proj.valid() )
+         {
+            geom->setProjection(proj.get());
+         }
+      }
+   }
+   
+   return geom;
+}
+
+ossimScalarType ossimUsgsDemTileSource::getOutputScalarType() const
+{
+   return theScalarType;
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getTileWidth() const
+{
+   return ( theTile.valid() ? theTile->getWidth() : 0 );
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getTileHeight() const
+{
+   return ( theTile.valid() ? theTile->getHeight() : 0 );
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getNumberOfLines(ossim_uint32 reduced_res_level) const
+{
+   ossim_uint32 result = 0;
+   if (reduced_res_level == 0)
+   {
+      if (theDem)
+      {
+         result = theDem->getHeight();
+      }
+   }
+   else if (theOverview.valid())
+   {
+      result = theOverview->getNumberOfLines(reduced_res_level);
+   }
+   return result;
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getNumberOfSamples(ossim_uint32 reduced_res_level) const
+{
+   ossim_uint32 result = 0;
+   if (reduced_res_level == 0)
+   {
+      if (theDem)
+      {
+         result = theDem->getWidth();
+      }
+   }
+   else if (theOverview.valid())
+   {
+      result = theOverview->getNumberOfSamples(reduced_res_level);
+   }
+   return result;
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getImageTileWidth() const
+{
+   return 0;
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getImageTileHeight() const
+{
+   return 0;
+}
+
+ossimString ossimUsgsDemTileSource::getShortName() const
+{
+   return ossimString("usgs dem");
+}
+
+ossimString ossimUsgsDemTileSource::getLongName() const
+{
+   return ossimString("usgs dem reader");
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getNumberOfInputBands() const
+{
+   return 1;
+}
+
+ossim_uint32 ossimUsgsDemTileSource::getNumberOfOutputBands()const
+{
+   return 1;
+}
+
+double ossimUsgsDemTileSource::getNullPixelValue(ossim_uint32 /* band */)const 
+{
+   return theNullValue;
+}
+
+double ossimUsgsDemTileSource::getMinPixelValue(ossim_uint32 band)const 
+{
+   if(band < theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getMinPix(band);
+   }
+   return theMinHeight; 
+}
+
+double ossimUsgsDemTileSource::getMaxPixelValue(ossim_uint32 band)const 
+{
+   if(theMetaData.getNumberOfBands())
+   {
+      return theMetaData.getMaxPix(band);
+   }
+   return theMaxHeight; 
+}
+
+bool ossimUsgsDemTileSource::isOpen()const
+{
+   return (theDem ? true : false );
+}
+
+const ossimUsgsDemTileSource& ossimUsgsDemTileSource::operator=(const  ossimUsgsDemTileSource& rhs)
+{
+   return rhs;
+} 
+
+ossimUsgsDemTileSource::ossimUsgsDemTileSource(const ossimUsgsDemTileSource&)
+{
+}
diff --git a/src/imaging/ossimValueAssignImageSourceFilter.cpp b/src/imaging/ossimValueAssignImageSourceFilter.cpp
new file mode 100644
index 0000000..c265f16
--- /dev/null
+++ b/src/imaging/ossimValueAssignImageSourceFilter.cpp
@@ -0,0 +1,381 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimValueAssignImageSourceFilter.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+#include <ossim/imaging/ossimValueAssignImageSourceFilter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+RTTI_DEF1(ossimValueAssignImageSourceFilter,
+          "ossimValueAssignImageSourceFilter",
+          ossimImageSourceFilter);
+
+ossimValueAssignImageSourceFilter::ossimValueAssignImageSourceFilter(ossimObject* owner)
+   :ossimImageSourceFilter(owner),
+    theAssignType(ossimValueAssignType_GROUP),
+    theTile(NULL)
+{
+}
+
+ossimValueAssignImageSourceFilter::~ossimValueAssignImageSourceFilter()
+{
+}
+
+ossimRefPtr<ossimImageData> ossimValueAssignImageSourceFilter::getTile(
+   const ossimIrect& tileRect,
+   ossim_uint32 resLevel)
+{
+   if(!theInputConnection)
+   {
+      return NULL;  // This filter requires an input.
+   }
+   
+   ossimRefPtr<ossimImageData> inputTile =
+      theInputConnection->getTile(tileRect, resLevel);
+   
+   if(!isSourceEnabled() || !inputTile.valid())
+   {
+      return inputTile;
+   }
+
+   if(!theTile.valid())
+   {
+      allocate(); // First time through...
+   }
+   
+   if (!theTile.valid()) // throw exeption...
+   {
+      return inputTile;
+   }
+
+   // Set the origin, resize if needed of the output tile.
+   theTile->setImageRectangle(tileRect);
+
+   if( inputTile->getDataObjectStatus() == OSSIM_NULL ||
+       inputTile->getDataObjectStatus() == OSSIM_EMPTY )
+   {
+      theTile->makeBlank();
+      return theTile;
+   }
+
+   if(!inputTile->getBuf())
+   {
+      theTile->makeBlank();
+   }
+   else
+   {
+      theTile->loadTile(inputTile.get());
+   }
+
+   switch(inputTile->getScalarType())
+   {
+      case OSSIM_UCHAR:
+      {
+         executeAssign(static_cast<ossim_uint8>(0),
+                       theTile);
+         break;
+      }
+      case OSSIM_FLOAT: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         executeAssign(static_cast<float>(0),
+                       theTile);
+         break;
+      }
+      case OSSIM_USHORT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         executeAssign(static_cast<ossim_uint16>(0),
+                       theTile);
+         break;
+      }
+      case OSSIM_SSHORT16:
+      {
+         executeAssign(static_cast<ossim_sint16>(0),
+                       theTile);
+         break;
+      }
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         executeAssign(static_cast<double>(0),
+                       theTile);
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimValueAssignImageSourceFilter::getTile WARN: Scalar type = " << theTile->getScalarType()
+                                            << " Not supported!" << std::endl;
+         break;
+      }
+   }
+
+   theTile->validate();
+   
+   return theTile;
+}
+
+void ossimValueAssignImageSourceFilter::setInputOutputValues(const vector<double>& inputValues,
+                                                             const vector<double>& outputValues)
+{
+   theInputValueArray  = inputValues;
+   theOutputValueArray = outputValues;
+
+   validateArrays();
+}
+
+void ossimValueAssignImageSourceFilter::validateArrays()
+{
+   if(theOutputValueArray.size() != theInputValueArray.size())
+   {
+      ossim_uint32 index = std::min((ossim_uint32)theOutputValueArray.size(),
+                                    (ossim_uint32)theInputValueArray.size());
+      
+      vector<double> copyVector(theOutputValueArray.begin(),
+                                theOutputValueArray.begin() + index);
+
+      theOutputValueArray = copyVector;
+
+      for(ossim_uint32 index2 = index; index < theInputValueArray.size(); ++index)
+      {
+         theOutputValueArray.push_back(theInputValueArray[index2]);
+      }
+   }
+}
+
+template <class T> void ossimValueAssignImageSourceFilter::executeAssign(
+   T,
+   ossimRefPtr<ossimImageData>& data)
+{
+   if(!theInputValueArray.size()) return;
+   
+   if(theAssignType == ossimValueAssignType_SEPARATE)
+   {
+      executeAssignSeparate(static_cast<T>(0), data);
+   }
+   else
+   {
+      executeAssignGroup(static_cast<T>(0), data);      
+   }
+}
+
+template <class T> void ossimValueAssignImageSourceFilter::executeAssignSeparate(
+   T,
+   ossimRefPtr<ossimImageData>& data)
+{
+   ossim_uint32 numberOfBands = std::min((ossim_uint32)data->getNumberOfBands(),
+                                         (ossim_uint32)theInputValueArray.size());
+   ossim_uint32 maxOffset     = data->getWidth()*data->getHeight();
+   
+   for(ossim_uint32 band = 0; band<numberOfBands; ++band)
+   {
+      T* buf      = static_cast<T*>(data->getBuf(band));
+      T  inValue  = static_cast<T>(theInputValueArray[band]);
+      T  outValue = static_cast<T>(theOutputValueArray[band]);
+      for(ossim_uint32 count = 0; count < maxOffset; ++count)
+      {
+         if(*buf == inValue)
+         {
+            *buf = outValue;
+         }
+         ++buf;
+      }
+   }
+}
+
+template <class T> void ossimValueAssignImageSourceFilter::executeAssignGroup(
+   T,
+   ossimRefPtr<ossimImageData>& data)
+{
+   ossim_uint32 numberOfBands = std::min((ossim_uint32)data->getNumberOfBands(),
+                                         (ossim_uint32)theInputValueArray.size());
+   ossim_uint32 maxOffset     = data->getWidth()*data->getHeight();
+   ossim_uint32 band = 0;
+   bool equalFlag = false;
+
+   T** bufArray = new T*[data->getNumberOfBands()];
+   for(band = 0; band < data->getNumberOfBands(); ++band)
+   {
+      bufArray[band] = static_cast<T*>(data->getBuf(band));
+   }
+   
+   for(ossim_uint32 offset = 0; offset < maxOffset; ++offset)
+   {
+      equalFlag = true;
+      
+      for(band = 0; band<numberOfBands; ++band)
+      {
+         if(bufArray[band][offset] != theInputValueArray[band])
+         {
+            equalFlag = false;
+         }
+      }
+      if(equalFlag)
+      {
+         for(band = 0; band<numberOfBands; ++band)
+         {
+            bufArray[band][offset] = static_cast<T>(theOutputValueArray[band]);
+         }
+      }
+   }
+
+   delete [] bufArray;
+}
+
+void ossimValueAssignImageSourceFilter::initialize()
+{
+   // Base class will recapture "theInputConnection".
+   ossimImageSourceFilter::initialize();
+}
+
+void ossimValueAssignImageSourceFilter::allocate()
+{   
+   theTile = NULL;
+
+   if(theInputConnection)
+   {
+      ossimImageDataFactory* idf = ossimImageDataFactory::instance();
+      
+      theTile = idf->create(this,
+                            this);
+      
+      theTile->initialize();
+   }
+}
+
+bool ossimValueAssignImageSourceFilter::saveState(ossimKeywordlist& kwl,
+                                                  const char* prefix)const
+{
+   ossim_uint32 index = 0;
+   for(index =0; index < theInputValueArray.size(); ++index)
+   {
+      ossimString in  = ("input_band" + ossimString::toString(index));
+      ossimString out = ("output_band" + ossimString::toString(index));
+
+      kwl.add(prefix,
+              in.c_str(),
+              theInputValueArray[index],
+              true);
+      kwl.add(prefix,
+              out.c_str(),
+              theOutputValueArray[index],
+              true);
+   }
+   if(theAssignType ==  ossimValueAssignType_SEPARATE)
+   {
+      kwl.add(prefix,
+              "assign_type",
+              "separate",
+              true);
+   }
+   else
+   {
+      kwl.add(prefix,
+              "assign_type",
+              "group",
+              true);
+   }
+           
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+/*!
+ * Method to the load (recreate) the state of an object from a keyword
+ * list.  Return true if ok or false on error.
+ */
+bool ossimValueAssignImageSourceFilter::loadState(const ossimKeywordlist& kwl,
+                                                  const char* prefix)
+{
+   
+   ossimString inRegExpression =  ossimString("^(") +
+                                  ossimString(prefix) +
+                                  "input_band[0-9]+)";
+   ossimString outRegExpression =  ossimString("^(") +
+                                   ossimString(prefix) +
+                                   "output_band[0-9]+)";
+   ossim_uint32 numberOfInputs  = kwl.getNumberOfSubstringKeys(inRegExpression);
+   ossim_uint32 numberOfOutputs = kwl.getNumberOfSubstringKeys(outRegExpression);
+   ossim_uint32 index = 0;
+   ossim_uint32 currentIndex = 0;
+   
+   theInputValueArray.clear();
+   theOutputValueArray.clear();
+
+   while(index < numberOfInputs)
+   {
+      const char* value = kwl.find(prefix,
+                                   (ossimString("input_band") +
+                                    ossimString::toString(currentIndex)).c_str()
+                                   );
+      if(value)
+      {
+         theInputValueArray.push_back(ossimString(value).toDouble());
+         ++index;
+      }
+      ++currentIndex;
+   }
+   index = 0;
+   currentIndex = 0;
+   while(index < numberOfOutputs)
+   {
+      const char* value = kwl.find(prefix,
+                                   (ossimString("output_band") +
+                                    ossimString::toString(currentIndex)).c_str()
+                                   );
+      if(value)
+      {
+         theOutputValueArray.push_back(ossimString(value).toDouble());
+         ++index;
+      }
+      ++currentIndex;
+   }
+   validateArrays();
+   
+   const char* assignType = kwl.find(prefix, "assign_type");
+   if(assignType)
+   {
+      if(ossimString(assignType).trim().downcase() == "separate")
+      {
+         theAssignType = ossimValueAssignType_SEPARATE;
+      }
+      else
+      {
+         theAssignType = ossimValueAssignType_GROUP;
+      }
+   }
+   else
+   {
+      theAssignType = ossimValueAssignType_GROUP;
+   }
+   
+   return ossimImageSourceFilter::loadState(kwl, prefix);
+}
+
+const vector<double>& ossimValueAssignImageSourceFilter::getInputValues()const
+{
+   return theInputValueArray;
+}
+const vector<double>& ossimValueAssignImageSourceFilter::getOutputValues()const
+{
+   return theOutputValueArray;
+}
+
+ossimValueAssignImageSourceFilter::ossimValueAssignType ossimValueAssignImageSourceFilter::getValueAssignType()const
+{
+   return theAssignType;
+}
+void ossimValueAssignImageSourceFilter::setValueAssignType(ossimValueAssignType type)
+{
+   theAssignType = type;
+}
diff --git a/ossim/src/ossim/imaging/ossimVectorRenderer.cpp b/src/imaging/ossimVectorRenderer.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimVectorRenderer.cpp
rename to src/imaging/ossimVectorRenderer.cpp
diff --git a/ossim/src/ossim/imaging/ossimVertexExtractor.cpp b/src/imaging/ossimVertexExtractor.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimVertexExtractor.cpp
rename to src/imaging/ossimVertexExtractor.cpp
diff --git a/src/imaging/ossimVpfAnnotationCoverageInfo.cpp b/src/imaging/ossimVpfAnnotationCoverageInfo.cpp
new file mode 100644
index 0000000..a7f1d92
--- /dev/null
+++ b/src/imaging/ossimVpfAnnotationCoverageInfo.cpp
@@ -0,0 +1,217 @@
+//*************************************************************************
+// Copyright (C) 2004 Intelligence Data Systems, Inc.  All rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//**************************************************************************
+// $Id: ossimVpfAnnotationCoverageInfo.cpp 15833 2009-10-29 01:41:53Z eshirschorn $
+
+#include <vector>
+#include <algorithm>
+#include <ossim/imaging/ossimVpfAnnotationCoverageInfo.h>
+#include <ossim/vec/ossimVpfLibrary.h>
+#include <ossim/vec/ossimVpfFeatureClassSchema.h>
+
+bool ossimVpfAnnotationCoverageInfo::hasRenderableFeature()const
+{
+  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
+  {
+     if(theFeatureInfoArray[idx]->getEnabledFlag())
+     {
+        return true;
+     }
+  }
+
+  return false;
+}
+
+void ossimVpfAnnotationCoverageInfo::getEnabledFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result)
+{
+  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
+    {
+      if(theFeatureInfoArray[idx]->getEnabledFlag())
+	{
+	  result.push_back(theFeatureInfoArray[idx]);
+	}
+    }
+}
+
+void ossimVpfAnnotationCoverageInfo::getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& result)
+{
+  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
+  {
+     result.push_back(theFeatureInfoArray[idx]);
+  }
+}
+
+ossimIrect ossimVpfAnnotationCoverageInfo::getBoundingProjectedRect()const
+{
+  ossimIrect result;
+  result.makeNan();
+
+  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
+    {
+      ossimIrect tempRect = theFeatureInfoArray[idx]->getBoundingProjectedRect();
+      if(!tempRect.hasNans())
+	{
+	  if(result.hasNans())
+	    {
+	      result = tempRect;
+	    }
+	  else
+	    {
+	      result = result.combine(tempRect);
+	    }
+	}
+    }
+
+  return result;
+}
+
+
+void ossimVpfAnnotationCoverageInfo::transform(ossimImageGeometry* geom)
+{
+  for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
+  {
+     theFeatureInfoArray[idx]->transform(geom);
+  }
+}
+
+void ossimVpfAnnotationCoverageInfo::buildCoverage()
+{
+   buildCoverage( "" );
+}
+
+void ossimVpfAnnotationCoverageInfo::buildCoverage(const ossimString& feature)
+{
+   deleteAllFeatures();
+   if(theLibrary)
+   {
+      ossimVpfCoverage coverage;
+      
+      if(theLibrary->getCoverage(theName, coverage))
+      {
+         ossimVpfFeatureClassSchema schema;
+         if(coverage.openFeatureClassSchema(schema))
+         {
+            std::vector<ossimString> featureClassArray;
+            schema.getFeatureClasses(featureClassArray);
+            schema.closeTable();
+            for(ossim_uint32  idx = 0; idx < featureClassArray.size(); ++idx)
+            {
+               ossimString s1 = feature;
+               ossimString s2 = featureClassArray[idx];
+               s1.downcase();
+               s2.downcase();
+               if (! feature.length() || (s1 == s2) )
+               {
+                  ossimVpfAnnotationFeatureInfo* featureInfo =
+                     new ossimVpfAnnotationFeatureInfo;
+                  featureInfo->setName(featureClassArray[idx]);
+                  featureInfo->setCoverage(coverage);
+                  theFeatureInfoArray.push_back(featureInfo);
+                  featureInfo->buildFeature();
+               }
+            }
+         }
+      }
+   }
+}
+
+void ossimVpfAnnotationCoverageInfo::drawAnnotations(ossimRgbImage* tile)
+{
+   for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
+   {
+      if(theFeatureInfoArray[idx]->getEnabledFlag())
+      {
+         theFeatureInfoArray[idx]->drawAnnotations(tile);
+      }
+   }
+}
+
+void ossimVpfAnnotationCoverageInfo::deleteAllFeatures()
+{
+   for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size();++idx)
+   {
+      theFeatureInfoArray[idx];
+   }
+   
+   theFeatureInfoArray.clear();
+}
+
+
+
+bool ossimVpfAnnotationCoverageInfo::saveState(ossimKeywordlist& kwl,
+					       const char* prefix)const
+{
+   kwl.add(prefix,
+           "name",
+           theName,
+           true);
+   
+   for(ossim_uint32 idx = 0; idx < theFeatureInfoArray.size(); ++idx)
+   {
+      theFeatureInfoArray[idx]->saveState(kwl,
+					  (ossimString(prefix) + "feature" +
+					   ossimString::toString(idx) + ".").c_str());
+   }
+   
+   return true;
+}
+
+bool ossimVpfAnnotationCoverageInfo::loadState(const ossimKeywordlist& kwl,
+					       const char* prefix)
+{
+  deleteAllFeatures();
+
+  if(!theLibrary)
+    {
+      return false;
+    }
+
+  theName = kwl.find(prefix, "name");
+  ossimVpfCoverage coverage;
+
+  if(theLibrary->getCoverage(theName, coverage))
+    {
+      ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "feature[0-9]+.)";
+      vector<ossimString> keys =
+	kwl.getSubstringKeyList( regExpression );
+      std::vector<int> theNumberList(keys.size());
+      int offset = (int)(ossimString(prefix)+"feature").size();
+      int idx = 0;
+      for(idx = 0; idx < (int)theNumberList.size();++idx)
+	{
+	  ossimString numberStr(keys[idx].begin() + offset,
+				keys[idx].end());
+	  theNumberList[idx] = numberStr.toInt();
+	}
+      std::sort(theNumberList.begin(), theNumberList.end());
+      
+      for(idx=0;idx < (int)keys.size();++idx)
+	{
+	  ossimString newPrefix = ossimString(prefix);
+	  newPrefix += ossimString("feature");
+	  newPrefix += ossimString::toString(theNumberList[idx]);
+	  newPrefix += ossimString(".");
+	  ossimVpfAnnotationFeatureInfo* featureInfo = new ossimVpfAnnotationFeatureInfo;
+	  featureInfo->setCoverage(coverage);
+	  theFeatureInfoArray.push_back(featureInfo);
+	  if(!featureInfo->loadState(kwl,
+				     newPrefix))
+	    {
+	      return false;
+	    }
+	}
+    }
+  else
+    {
+      return false;
+    }
+
+  return true;
+}
diff --git a/ossim/src/ossim/imaging/ossimVpfAnnotationFeatureInfo.cpp b/src/imaging/ossimVpfAnnotationFeatureInfo.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimVpfAnnotationFeatureInfo.cpp
rename to src/imaging/ossimVpfAnnotationFeatureInfo.cpp
diff --git a/src/imaging/ossimVpfAnnotationLibraryInfo.cpp b/src/imaging/ossimVpfAnnotationLibraryInfo.cpp
new file mode 100644
index 0000000..dcb2134
--- /dev/null
+++ b/src/imaging/ossimVpfAnnotationLibraryInfo.cpp
@@ -0,0 +1,259 @@
+//*************************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+//**************************************************************************
+// $Id: ossimVpfAnnotationLibraryInfo.cpp 15836 2009-10-30 12:29:09Z dburken $
+
+#include <algorithm>
+
+#include <ossim/imaging/ossimVpfAnnotationLibraryInfo.h>
+#include <ossim/imaging/ossimVpfAnnotationFeatureInfo.h>
+#include <ossim/vec/ossimVpfLibrary.h>
+#include <ossim/vec/ossimVpfDatabase.h>
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceDebug("ossimVpfAnnotationLibraryInfo:debug");
+
+
+ossimVpfAnnotationLibraryInfo::ossimVpfAnnotationLibraryInfo(const ossimString& libraryName, bool enabledFlag)
+   :
+      theName(libraryName),
+      theEnabledFlag(enabledFlag),
+      theDatabase(NULL)
+{
+}
+
+ossimVpfAnnotationLibraryInfo::~ossimVpfAnnotationLibraryInfo()
+{
+   deleteAllCoverage();
+}
+
+bool ossimVpfAnnotationLibraryInfo::getEnabledFlag()const
+{
+   return theEnabledFlag;
+}
+
+void ossimVpfAnnotationLibraryInfo::setEnabledFlag(bool flag)
+{
+   theEnabledFlag = flag;
+}
+
+const ossimString& ossimVpfAnnotationLibraryInfo::getName()const
+{
+   return theName;
+}
+
+void ossimVpfAnnotationLibraryInfo::setName(const ossimString& libraryName)
+{
+   theName = libraryName;
+}
+
+void ossimVpfAnnotationLibraryInfo::setDatabase(ossimVpfDatabase* database)
+{
+   theDatabase = database;
+}
+
+ossimVpfDatabase* ossimVpfAnnotationLibraryInfo::getDatabase()
+{
+   return theDatabase;
+}
+
+ossimIrect ossimVpfAnnotationLibraryInfo::getBoundingProjectedRect()const
+{
+   ossimIrect result;
+   result.makeNan();
+   
+   for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
+   {
+      ossimIrect tempRect = theCoverageLayerList[idx]->getBoundingProjectedRect();
+      if(!tempRect.hasNans())
+      {
+         if(result.hasNans())
+         {
+            result = tempRect;
+         }
+         else
+         {
+            result = result.combine(tempRect);
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimVpfAnnotationLibraryInfo::getAllFeatures(std::vector<ossimVpfAnnotationFeatureInfo*>& features)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::getAllFeatures DEBUG: entered..." << std::endl;
+   }
+   
+   for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
+   {
+      theCoverageLayerList[idx]->getAllFeatures(features);
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::getAllFeatures DEBUG: leaving..." << std::endl;
+   }
+}
+
+void ossimVpfAnnotationLibraryInfo::transform(ossimImageGeometry* geom)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::transform DEBUG: entered..." << std::endl;
+   }
+   
+   
+   for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "transforming coverage = " << theCoverageLayerList[idx]->getName() << std::endl;
+      }
+      
+      theCoverageLayerList[idx]->transform(geom);
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::transform DEBUG: leaving..." << std::endl;
+   }
+}
+
+void ossimVpfAnnotationLibraryInfo::buildLibrary()
+{
+   buildLibrary( "", "");
+}
+
+void ossimVpfAnnotationLibraryInfo::buildLibrary(const ossimString& coverageName, const ossimString& feature)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::buildLibrary DEBUG: entered..." << std::endl;
+   }
+   deleteAllCoverage();
+   if(!theDatabase)
+   {
+      return;
+   }
+   
+   ossimVpfLibrary* library = theDatabase->getLibrary(theName);
+   if(library)
+   {
+      std::vector<ossimString> coverageNames;
+      library->getCoverageNames(coverageNames);
+      for(ossim_uint32 idx = 0; idx < coverageNames.size(); ++idx)
+      {
+         ossimString s1 = coverageName;
+         ossimString s2 = coverageNames[idx];
+         s1.downcase();
+         s2.downcase();
+         if ( ! coverageName.length() || (s1 == s2) )
+         {
+            ossimVpfAnnotationCoverageInfo* coverageInfo =
+               new ossimVpfAnnotationCoverageInfo;
+            coverageInfo->setName(coverageNames[idx]);
+            coverageInfo->setLibrary(library);
+            theCoverageLayerList.push_back(coverageInfo);
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG) << "coverage name = " << coverageNames[idx] << std::endl;
+            }
+            coverageInfo->buildCoverage(feature);
+         }
+      }
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimVpfAnnotationLibraryInfo::buildLibrary DEBUG: leaving..." << std::endl;
+   }
+}
+
+
+void ossimVpfAnnotationLibraryInfo::drawAnnotations(ossimRgbImage* tile)
+{
+  for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
+    {
+      theCoverageLayerList[idx]->drawAnnotations(tile);
+    }
+}
+
+void ossimVpfAnnotationLibraryInfo::deleteAllCoverage()
+{
+  for(ossim_uint32 idx = 0; idx < theCoverageLayerList.size(); ++idx)
+    {
+      delete theCoverageLayerList[idx];
+    }
+
+  theCoverageLayerList.clear();
+}
+
+bool ossimVpfAnnotationLibraryInfo::saveState(ossimKeywordlist& kwl,
+					      const char* prefix)const
+{
+   ossim_uint32 idx;
+   
+   kwl.add(prefix,
+           "name",
+           theName,
+           true);
+   
+   for(idx = 0; idx < theCoverageLayerList.size(); ++idx)
+   {
+      theCoverageLayerList[idx]->saveState(kwl,
+					   (ossimString(prefix) + "coverage" + ossimString::toString(idx) + ".").c_str());
+   }
+   
+   return true;
+}
+
+bool ossimVpfAnnotationLibraryInfo::loadState(const ossimKeywordlist& kwl,
+					      const char* prefix)
+{
+  deleteAllCoverage();
+  theName = kwl.find(prefix, "name");
+  
+  ossimVpfLibrary* library = theDatabase->getLibrary(theName);
+
+  if(!library)
+    {
+      return false;
+    }
+  ossimString regExpression =  ossimString("^(") + ossimString(prefix) + "coverage[0-9]+.)";
+  vector<ossimString> keys =
+    kwl.getSubstringKeyList( regExpression );
+  std::vector<int> theNumberList(keys.size());
+  int offset = (int)(ossimString(prefix)+"coverage").size();
+  int idx = 0;
+  for(idx = 0; idx < (int)theNumberList.size();++idx)
+    {
+      ossimString numberStr(keys[idx].begin() + offset,
+			    keys[idx].end());
+      theNumberList[idx] = numberStr.toInt();
+    }
+  std::sort(theNumberList.begin(), theNumberList.end());
+  
+  for(idx = 0; idx < (int)keys.size(); ++idx)
+    {
+      ossimString newPrefix = ossimString(prefix);
+      newPrefix += ossimString("coverage");
+      newPrefix += ossimString::toString(theNumberList[idx]);
+      newPrefix += ossimString(".");
+      ossimVpfAnnotationCoverageInfo* coverageInfo = new ossimVpfAnnotationCoverageInfo;
+      coverageInfo->setLibrary(library);
+      theCoverageLayerList.push_back(coverageInfo);
+      coverageInfo->loadState(kwl,
+			      newPrefix);
+    }
+  
+  return true;
+}
diff --git a/ossim/src/ossim/imaging/ossimVpfAnnotationSource.cpp b/src/imaging/ossimVpfAnnotationSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimVpfAnnotationSource.cpp
rename to src/imaging/ossimVpfAnnotationSource.cpp
diff --git a/ossim/src/ossim/imaging/ossimVpfTileSource.cpp b/src/imaging/ossimVpfTileSource.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimVpfTileSource.cpp
rename to src/imaging/ossimVpfTileSource.cpp
diff --git a/src/imaging/ossimWatermarkFilter.cpp b/src/imaging/ossimWatermarkFilter.cpp
new file mode 100644
index 0000000..d167d0c
--- /dev/null
+++ b/src/imaging/ossimWatermarkFilter.cpp
@@ -0,0 +1,1163 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, David Burken, all rights reserved.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description: Class definition of ossimWatermarkFilter.
+// Applies an image or watermark to image.  Positioning is based on mode.
+// Density is base on alpha weight.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimWatermarkFilter.cpp 15766 2009-10-20 12:37:09Z gpotts $
+
+#include <vector>
+
+#include <ossim/imaging/ossimWatermarkFilter.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimFilenameProperty.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+
+#include <ossim/imaging/ossimScalarRemapper.h>
+
+
+RTTI_DEF1(ossimWatermarkFilter, "ossimWatermarkFilter", ossimImageSourceFilter)
+
+static ossimTrace traceDebug(ossimString("ossimWatermarkFilter:debug"));
+
+// Keywords:
+static const char WATERMARK_MODE_KW[] = "watermark_mode";
+static const char WEIGHT_KW[]         = "weight";
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimWatermarkFilter.cpp 15766 2009-10-20 12:37:09Z gpotts $";
+#endif
+
+const ossim_float64 DEFAULT_WEIGHT = 0.20;
+
+ossimWatermarkFilter::ossimWatermarkFilter()
+   :
+   theFilename(ossimFilename::NIL),
+   theWatermarkWeight(DEFAULT_WEIGHT),
+   theTile(NULL),
+   theWatermark(NULL),
+   theMode(ossimWatermarkFilter::UPPER_LEFT),
+   theInputBoundingRect(),
+   theDirtyFlag(true)
+{
+   theEnableFlag = true;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPixelFlipper::ossimPixelFlipper" << std::endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << std::endl;
+#endif      
+   }
+}
+
+ossimWatermarkFilter::~ossimWatermarkFilter()
+{
+   // Dereference tiles and force a delete if last reference.
+   theWatermark = NULL;
+   theTile      = NULL;
+}
+
+ossimString ossimWatermarkFilter::getShortName() const
+{
+   return ossimString("Watermark Filter");
+}
+
+ossimString ossimWatermarkFilter::getLongName() const
+{
+   return ossimString("Watermark Filter - Applies watermark image onto getTile Request.");
+}
+
+ossimString ossimWatermarkFilter::getDescription() const
+{
+   ossimString description;
+   description = getLongName();
+   description += "\n";
+   description += "Valid modes:\n";
+
+   vector<ossimString> list;
+   getModeList(list);
+
+   vector<ossimString>::const_iterator i = list.begin();
+   while (i != list.end())
+   {
+      description +=(*i);
+      description += "\n";
+      ++i;
+   }
+
+   return description;
+}
+
+ossimRefPtr<ossimImageData> ossimWatermarkFilter::getTile(
+   const ossimIrect& tile_rect, ossim_uint32 resLevel)
+{
+   // Lock for the length of this method.
+   // Check for input.
+   if (!theInputConnection)
+   {
+      if (theTile.valid())
+      {
+         theTile->setImageRectangle(tile_rect);
+         theTile->makeBlank();
+      }
+      return theTile;
+   }
+
+   // Fetch a tile from from the input source.
+   ossimRefPtr<ossimImageData> inputTile =
+      theInputConnection->getTile(tile_rect, resLevel);
+
+   // Check for bypass.
+   if (theEnableFlag == false) return inputTile;
+
+   // Check for weight being 0.0.
+   if (theWatermarkWeight == 0.0) return inputTile;
+
+   //---
+   // Check for dirty state.
+   // Note: This is set in initialize if something changes.
+   //---
+   if (theDirtyFlag == true)
+   {
+      if (allocate() == false) // Something not right if false.
+      {
+         return inputTile;
+      }
+   }   
+   
+   // We will only watermark (process) within the input bounding rectangle.
+   if (tile_rect.intersects(theInputBoundingRect) == false)
+   {
+      return inputTile;
+   }
+
+   // Capture the rectangle and blank out theTile.
+   theTile->setImageRectangle(tile_rect);
+
+   if (inputTile.valid() &&
+       (inputTile->getDataObjectStatus() != OSSIM_NULL))
+   {
+      // Copy the inputTile to theTile.
+      theTile->loadTile(inputTile.get());
+   }
+   else 
+   {
+      theTile->makeBlank();
+   }
+
+   // Write the watermarks...
+   switch(theTile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         fill(ossim_uint8(0));
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         fill(ossim_sint8(0));
+         break;
+      }
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      {
+         fill(ossim_uint16(0));
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         fill(ossim_sint16(0));
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         fill(ossim_uint32(0));
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         fill(ossim_sint32(0));
+         break;
+      }
+      case OSSIM_FLOAT32: 
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         fill(ossim_float32(0));
+         break;
+      }
+      case OSSIM_FLOAT64: 
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         fill(ossim_float32(0));
+         break;
+      }
+      case OSSIM_SCALAR_UNKNOWN:
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Scalar type = " << theTile->getScalarType()
+            << " Not supported by ossimWatermarkFilter" << std::endl;
+         return inputTile;
+      }
+   }
+
+   return theTile;
+}
+
+template <class T> void ossimWatermarkFilter::fill(T /* dummy */)
+{
+   const ossimIrect TILE_RECT = theTile->getImageRectangle();
+
+   // We will only fill data within the input bounding rect.
+   const ossimIrect CLIPPED_TILE_RECT =
+      TILE_RECT.clipToRect(theInputBoundingRect);
+
+   // Get the bounding rectangles.
+   vector<ossimIrect> rects(0);
+   getIntersectingRects(rects);
+
+   if (rects.size() == 0)
+   {
+      return;
+   }
+
+   //---
+   // Have watermark rectangles that intersect this tile so we need to process.
+   //---
+   ossim_uint32 band = 0;
+   ossim_float64 inputPixWeight = 1.0 - theWatermarkWeight;
+
+   // Get a pointers to the watermark buffers (wmBuf) and nulls wn.
+   T** wmBuf = new T*[theWatermarkNumberOfBands];
+   for (band = 0; band < theWatermarkNumberOfBands; ++band)
+   {
+      wmBuf[band] = static_cast<T*>(theWatermark->getBuf(band));
+   }
+   
+   // Get a pointers to the output tile buffers and nulls in.
+   T** otBuf = new T*[theInputNumberOfBands];
+   for (band = 0; band < theInputNumberOfBands; ++band)
+   {
+      otBuf[band] = static_cast<T*>(theTile->getBuf(band));
+   }
+
+   // Get the width of the buffers for indexing.
+   ossim_int32 wmWidth = static_cast<ossim_int32>(theWatermark->getWidth());
+   ossim_int32 otWidth = static_cast<ossim_int32>(theTile->getWidth());
+
+   const ossim_float64* wmNull = theWatermark->getNullPix();
+   const ossim_float64* otMin  = theTile->getMinPix();
+   const ossim_float64* otMax  = theTile->getMaxPix();
+   const ossim_float64* otNull = theTile->getNullPix();
+   
+      
+   // Control loop through intersecting rectangles.
+   vector<ossimIrect>::const_iterator i = rects.begin();
+   while (i != rects.end())
+   {
+      if ( (*i).intersects(CLIPPED_TILE_RECT) )
+      {
+         //---
+         // This is the rectangle we want to fill relative to requesting
+         // image space.
+         //---
+         const ossimIrect CLIPPED_WATERMARRK_RECT =
+            (*i).clipToRect(CLIPPED_TILE_RECT);
+
+         ossim_int32 clipHeight = CLIPPED_WATERMARRK_RECT.height();
+         ossim_int32 clipWidth  = CLIPPED_WATERMARRK_RECT.width();
+
+         // Compute the starting offset into the wmBuf and otBuf.
+         ossim_int32 wmOffset =
+            (CLIPPED_WATERMARRK_RECT.ul().y - (*i).ul().y) * wmWidth +
+            CLIPPED_WATERMARRK_RECT.ul().x  - (*i).ul().x;
+         ossim_int32 otOffset =
+            (CLIPPED_WATERMARRK_RECT.ul().y - TILE_RECT.ul().y)* otWidth +
+             CLIPPED_WATERMARRK_RECT.ul().x - TILE_RECT.ul().x;
+         
+         // Line loop...
+         for (ossim_int32 line = 0; line < clipHeight; ++line)
+         {
+            // Sample loop...
+            for (ossim_int32 sample = 0; sample < clipWidth; ++sample)
+            {
+               // Output band control loop until all output bands are filled.
+               ossim_uint32 otBand = 0;
+               while (otBand < theInputNumberOfBands)
+               {
+                  // Band loop through the watermark.
+                  for (ossim_uint32 wmBand = 0;
+                       wmBand < theWatermarkNumberOfBands;
+                       ++wmBand)
+                  {
+                     if (wmBuf[wmBand][wmOffset+sample] != wmNull[wmBand])
+                     {
+                        // Apply the weight to the input pixel.
+                        ossim_float64 p1 =
+                           (otBuf[otBand][otOffset+sample] != otNull[otBand]) ?
+                           otBuf[otBand][otOffset+sample] * inputPixWeight :
+                           0.0;
+
+                        // Apply the Weight to the watermark pixel.
+                        ossim_float64 p2 =
+                           wmBuf[wmBand][wmOffset+sample]*theWatermarkWeight;
+
+                        // Add them up.
+                        ossim_float64 p3 = p1 + p2;
+
+                        // Cast to output type with range checking.
+                        otBuf[otBand][otOffset+sample] = static_cast<T>(
+                           ( (p3 >= otMin[otBand]) ?
+                             (p3 < otMax[otBand] ? p3 : otMax[otBand]) :
+                             otNull[otBand]) );
+                     }
+                     ++otBand;
+                     
+                     // We stop when we reach here.  All output bands filled.
+                     if (otBand == theInputNumberOfBands)
+                     {
+                        break;
+                     }
+                     
+                  } // End of band through watermark.
+                  
+               } // End of outer band loop.
+               
+            } // End of sample loop.
+
+            wmOffset += wmWidth;
+            otOffset += otWidth;
+            
+         } // End of line loop.
+
+      } // End "if ( (*i).intersects(TILE_RECT) )"
+      
+      ++i; // Go to next rectangle to fill if any.
+      
+   } // End of "while (i != rects.end())"
+
+   // Clean up.
+   delete [] wmBuf;
+   delete [] otBuf;
+   
+   theTile->validate();
+}
+
+void ossimWatermarkFilter::getIntersectingRects(vector<ossimIrect>& rects)
+{
+   switch(theMode)
+   {
+      case UPPER_LEFT:
+         getUpperLeftRect(rects);
+         break;
+      case UPPER_CENTER:
+         getUpperCenterRect(rects);
+         break;
+      case UPPER_RIGHT:
+         getUpperRightRect(rects);
+         break;
+      case CENTER:
+         getCenterRect(rects);
+         break;
+      case LOWER_LEFT:
+         getLowerLeftRect(rects);
+         break;
+      case LOWER_CENTER:
+         getLowerCenterRect(rects);
+         break;
+      case LOWER_RIGHT:
+         getLowerRightRect(rects);
+         break;
+      case UNIFORM_DENSE:
+         getUniformDenseRects(rects);
+         break;
+      case UNIFORM_SPARSE:
+         getUniformSparceRects(rects);
+         break;
+      default:
+         break;
+   }
+}
+
+void ossimWatermarkFilter::getUpperLeftRect(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   theWatermark->setOrigin(theInputBoundingRect.ul());
+   ossimIrect r = theWatermark->getImageRectangle();
+   if (r.intersects(CLIP_RECT))
+   {
+      rects.push_back(r);
+   }
+}
+
+void ossimWatermarkFilter::getUpperCenterRect(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
+   ossim_uint32 inputWidth = theInputBoundingRect.width();
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   // Input wider than watermark so center.
+   if (inputWidth > watermarkWidth)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>((inputWidth - watermarkWidth) / 2);
+      origin.x = origin.x + offset;
+   }
+   
+   theWatermark->setOrigin(origin);
+   
+   ossimIrect r = theWatermark->getImageRectangle();
+   if (r.intersects(CLIP_RECT))
+   {
+      rects.push_back(r);
+   }
+}  
+
+void ossimWatermarkFilter::getUpperRightRect(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkWidth =
+      theWatermark->getImageRectangle().width();
+   ossim_uint32 inputWidth = theInputBoundingRect.width();
+   
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   // Input wider than watermark so center.
+   if (inputWidth > watermarkWidth)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>(inputWidth - watermarkWidth);
+      origin.x = origin.x + offset;
+   }
+   
+   theWatermark->setOrigin(origin);
+   
+   ossimIrect r = theWatermark->getImageRectangle();
+   if (r.intersects(CLIP_RECT))
+   {
+      rects.push_back(r);
+   }
+}  
+
+void ossimWatermarkFilter::getCenterRect(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
+   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
+   ossim_uint32 inputWidth = theInputBoundingRect.width();
+   ossim_uint32 inputHeight = theInputBoundingRect.height();
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   // Input wider than watermark so center.
+   if (inputWidth > watermarkWidth)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>((inputWidth - watermarkWidth) / 2);
+      origin.x = origin.x + offset;
+   }
+   // Input higher than watermark so center.
+   if (inputHeight > watermarkHeight)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>((inputHeight - watermarkHeight) / 2);
+      origin.y = origin.y + offset;
+   }
+   
+   theWatermark->setOrigin(origin);
+   
+   ossimIrect r = theWatermark->getImageRectangle();
+   if (r.intersects(CLIP_RECT))
+   {
+      rects.push_back(r);
+   }
+}
+
+void ossimWatermarkFilter::getLowerLeftRect(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
+   ossim_uint32 inputHeight = theInputBoundingRect.height();
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   // Input higher than watermark so apply offset.
+   if (inputHeight > watermarkHeight)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>(inputHeight - watermarkHeight);
+      origin.y = origin.y + offset;
+   }
+   
+   theWatermark->setOrigin(origin);
+   
+   ossimIrect r = theWatermark->getImageRectangle();
+   if (r.intersects(CLIP_RECT))
+   {
+      rects.push_back(r);
+   }
+}
+
+void ossimWatermarkFilter::getLowerCenterRect(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
+   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
+   ossim_uint32 inputWidth = theInputBoundingRect.width();
+   ossim_uint32 inputHeight = theInputBoundingRect.height();
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   // Input wider than watermark so center.
+   if (inputWidth > watermarkWidth)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>((inputWidth - watermarkWidth) / 2);
+      origin.x = origin.x + offset;
+   }
+   // Input higher than watermark so apply offset.
+   if (inputHeight > watermarkHeight)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>(inputHeight - watermarkHeight);
+      origin.y = origin.y + offset;
+   }
+   
+   theWatermark->setOrigin(origin);
+   ossimIrect r = theWatermark->getImageRectangle();
+   if (r.intersects(CLIP_RECT))
+   {
+      rects.push_back(r);
+   }
+}
+
+void ossimWatermarkFilter::getLowerRightRect(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
+   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
+   ossim_uint32 inputWidth = theInputBoundingRect.width();
+   ossim_uint32 inputHeight = theInputBoundingRect.height();
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   // Input wider than watermark so center.
+   if (inputWidth > watermarkWidth)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>(inputWidth - watermarkWidth);
+      origin.x = origin.x + offset;
+   }
+   // Input higher than watermark so apply offset.
+   if (inputHeight > watermarkHeight)
+   {
+      ossim_int32 offset =
+         static_cast<ossim_int32>(inputHeight - watermarkHeight);
+      origin.y = origin.y + offset;
+   }
+   
+   theWatermark->setOrigin(origin);
+   ossimIrect r = theWatermark->getImageRectangle();
+   if (r.intersects(CLIP_RECT))
+   {
+      rects.push_back(r);
+   }
+   
+}
+
+void ossimWatermarkFilter::getUniformDenseRects(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkWidth = theWatermark->getImageRectangle().width();
+   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
+   ossim_uint32 inputWidth = theInputBoundingRect.width();
+   ossim_uint32 inputHeight = theInputBoundingRect.height();
+
+   ossim_uint32 watermarksHigh = inputHeight / watermarkHeight;
+   if (inputHeight % watermarkHeight) ++watermarksHigh;
+   
+   ossim_uint32 watermarksWide = inputWidth / watermarkWidth;
+   if (inputWidth % watermarkWidth) ++watermarksWide;
+
+   ossim_int32 xOffset = static_cast<ossim_int32>(watermarkWidth);
+   ossim_int32 yOffset = static_cast<ossim_int32>(watermarkHeight);
+   
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   for (ossim_uint32 y = 0; y < watermarksHigh; ++y)
+   {
+      for (ossim_uint32 x = 0; x < watermarksWide; ++x)
+      {
+         theWatermark->setOrigin(origin);
+         ossimIrect r = theWatermark->getImageRectangle();
+         if (r.intersects(CLIP_RECT))
+         {
+            rects.push_back(r);
+         }
+         origin.x = origin.x + xOffset;
+      }
+      origin.y = origin.y + yOffset;
+      origin.x = theInputBoundingRect.ul().x;
+   }
+}
+
+void ossimWatermarkFilter::getUniformSparceRects(vector<ossimIrect>& rects)
+{
+   // First clip the rect to the bounding image rectangle.
+   const ossimIrect CLIP_RECT =
+      theTile->getImageRectangle().clipToRect(theInputBoundingRect);
+   ossim_uint32 watermarkWidth  = theWatermark->getImageRectangle().width();
+   ossim_uint32 watermarkHeight = theWatermark->getImageRectangle().height();
+   ossim_uint32 inputWidth      = theInputBoundingRect.width();
+   ossim_uint32 inputHeight     = theInputBoundingRect.height();
+   ossim_uint32 gapWidth   = watermarkWidth/2;
+   ossim_uint32 gapHeight  = watermarkHeight/2;
+
+   ossim_uint32 watermarksHigh = inputHeight/(watermarkHeight+gapHeight);
+   if (inputHeight % watermarkHeight) ++watermarksHigh;
+   
+   ossim_uint32 watermarksWide = inputWidth/(watermarkWidth+gapWidth);
+   if (inputWidth % watermarkWidth) ++watermarksWide;
+
+   ossim_int32 xOffset = static_cast<ossim_int32>(watermarkWidth  + gapWidth);
+   ossim_int32 yOffset = static_cast<ossim_int32>(watermarkHeight + gapHeight);
+
+   ossimIpt origin = theInputBoundingRect.ul();
+   
+   for (ossim_uint32 y = 0; y < watermarksHigh; ++y)
+   {
+      for (ossim_uint32 x = 0; x < watermarksWide; ++x)
+      {
+         theWatermark->setOrigin(origin);
+         ossimIrect r = theWatermark->getImageRectangle();
+         if (r.intersects(CLIP_RECT))
+         {
+            rects.push_back(r);
+         }
+         origin.x = origin.x + xOffset;
+      }
+      origin.y = origin.y + yOffset;
+      origin.x = theInputBoundingRect.ul().x;
+   }
+}
+
+void ossimWatermarkFilter::initialize()
+{
+   //---
+   // If state is not already dirty and there is an input connection
+   // check for:
+   // 
+   // 1) Scalar change
+   // 2) band number change
+   // 3) bounding box change
+   //
+   // Set state to dirty on a change.
+   //
+   // NOTE:  This method intentionally only sets the dirty state and doesn't do
+   // anything else as it is called repetitively during chain setup or chain
+   // state changes.
+   //
+   // The first getTile call will do the real work, call allocate(),
+   // if the state is dirty.
+   //---
+
+   // Lock for the length of this method.
+   // Set the input connection.
+   ossimImageSourceFilter::initialize();
+
+   // Once dirty flag is set no need to do it again.
+   if (theDirtyFlag == false)
+   {
+      if (theInputConnection)
+      {
+         // Check for scalar type change.
+         if (theInputScalarType != theInputConnection->getOutputScalarType())
+         {
+            theDirtyFlag = true;
+            return;
+         }
+
+         // Check for band change.
+         if (theInputNumberOfBands !=
+             theInputConnection->getNumberOfOutputBands())
+         {
+            theDirtyFlag = true;
+            return;
+         }
+
+         // Check for bounding rectangle change.
+         if ( theInputBoundingRect != theInputConnection->getBoundingRect() )
+         {
+            theDirtyFlag = true;
+            return;
+         }
+      }
+   }
+}
+
+bool ossimWatermarkFilter::allocate()
+{
+   // Capture the bounding rect:
+   theInputBoundingRect = theInputConnection->getBoundingRect();
+
+   // Capture the scalar type:
+   theInputScalarType = theInputConnection->getOutputScalarType();
+
+   // Capture the number of bands:
+   theInputNumberOfBands = theInputConnection->getNumberOfOutputBands();
+
+   //---
+   // Check the watermark scalar type.
+   //---
+   if (theWatermark.valid())
+   {
+      if (theWatermark->getScalarType() != theInputScalarType)
+      {
+         //---
+         // We'll need to make a new one with a scalar remapper after it.
+         //---
+         theWatermark = NULL; // We'll need to make a new one.
+      }
+   }
+
+   //---
+   // Make a new watermark tile.  This will do a scalar remap if needed.
+   // If we don't have a watermark no point in going on...
+   //---
+   if (!theWatermark)
+   {
+      if (openWatermarkFile() == false)
+      {
+         return false;
+      }
+   }
+
+   if (theTile.valid())
+   {
+      if ( (theTile->getScalarType()    != theInputScalarType) ||
+           (theTile->getNumberOfBands() != theInputNumberOfBands) )
+      {
+         theTile = NULL;  // We'll need to make a new one.
+      }
+   }
+
+   // Make a new output tile if we need to.
+   if (!theTile)
+   {
+      theTile = ossimImageDataFactory::instance()->create(this,
+                                                          theInputConnection);
+      if (theTile.valid())
+      {
+         theTile->initialize();
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   //---
+   // If we get here things are good so clear the dirty flag so we don't
+   // get called again needlessly.
+   //---
+   theDirtyFlag = false;
+   
+   return true;
+}
+
+bool ossimWatermarkFilter::openWatermarkFile()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimWatermarkFilter::openWatermarkFile DEBUG: entered..."
+         << std::endl;
+   }
+
+   if (!theInputConnection || (theFilename == ossimFilename::NIL))
+   {
+      return false;
+   }
+
+   theWatermark = NULL; // This will destroy any previous tiles.
+
+   // Open the watermark image.
+   ossimRefPtr<ossimImageHandler> ih =
+      ossimImageHandlerRegistry::instance()->open(theFilename);
+   if (!ih)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimWatermarkFilter::openWatermarkFile"
+            << "\nCould not open: " << theFilename 
+            << std::endl;
+      }
+      
+      return false;
+   }
+   if (ih->getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimWatermarkFilter::openWatermarkFile"
+            << "\nError reading image:  " << theFilename
+            << std::endl; 
+         return false;
+      }
+   }
+
+   ih->initialize();
+   ossimRefPtr<ossimImageSource> imageSource = ih.get();
+   ossimRefPtr<ossimScalarRemapper> remapper;
+   
+   if (ih->getOutputScalarType() != theInputConnection->getOutputScalarType())
+   {
+      // Remap the watemark to the same scalar type as the input.
+      remapper = new ossimScalarRemapper(imageSource.get(),
+                                         theInputConnection->
+                                         getOutputScalarType());
+      remapper->initialize();
+      imageSource = remapper.get();
+   }
+   
+   // Get the full image rectangle.
+   theWatermark = imageSource->getTile(ih->getImageRectangle(), 0);
+
+   // Cleanup...
+   if (remapper.valid())
+   {
+      remapper->disconnect();
+      remapper = NULL;
+   }
+   if(ih.valid())
+   {
+      ih->disconnect();
+      ih = 0;
+   }
+   imageSource = 0;
+   
+   if (theWatermark.valid() == false)
+   {
+      return false;
+   }
+
+   // Capture the bands as we will need this repetitively.
+   theWatermarkNumberOfBands = theWatermark->getNumberOfBands();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimWatermarkFilter::openWatermarkFile DEBUG:"
+         << *(theWatermark.get())
+         << endl;
+   }
+
+   return true;
+}
+
+bool ossimWatermarkFilter::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::FILENAME_KW,
+           theFilename.c_str());
+   kwl.add(prefix,
+           WATERMARK_MODE_KW,
+           getModeString().c_str());
+   kwl.add(prefix,
+           WEIGHT_KW,
+           theWatermarkWeight);
+
+   return ossimImageSourceFilter::saveState(kwl, prefix);
+}
+
+bool ossimWatermarkFilter::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   // Do this first so connections get set up.
+   if (ossimImageSourceFilter::loadState(kwl, prefix) == false)
+   {
+      return false;
+   }
+
+   const char* lookupReturn;
+
+   lookupReturn = kwl.find(prefix, WEIGHT_KW);
+   if(lookupReturn)
+   {
+      setWeight(ossimString(lookupReturn).toDouble());
+   }
+
+   lookupReturn = kwl.find(prefix, WATERMARK_MODE_KW);
+   if(lookupReturn)
+   {
+      setMode(ossimString(lookupReturn));
+   }
+
+   lookupReturn = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   if(lookupReturn)
+   {
+      setFilename(lookupReturn);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimWatermarkFilter::loadState DEBUG:"
+         << std::endl;
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+
+   return true;
+}
+
+ossimRefPtr<ossimProperty> ossimWatermarkFilter::getProperty(
+   const ossimString& name) const
+{
+   // Lock for the length of this method.
+   if (name == ossimKeywordNames::FILENAME_KW)
+   {
+      ossimFilenameProperty* ofp =
+         new ossimFilenameProperty(name, theFilename);
+      ofp->setIoType(ossimFilenameProperty::ossimFilenamePropertyIoType_INPUT);
+      ofp->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>((ossimProperty*)ofp);
+   }
+   else if (name == WATERMARK_MODE_KW)
+   {
+      vector<ossimString> constraintList;
+      getModeList(constraintList);
+
+      ossimStringProperty* p =
+         new ossimStringProperty(name,
+                                 getModeString(),
+                                 false,
+                                 constraintList);
+       p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+   else if (name == WEIGHT_KW)
+   {
+      ossimProperty* p =
+         new ossimNumericProperty(name,
+                                  ossimString::toString(theWatermarkWeight));
+      p->setCacheRefreshBit();
+      return ossimRefPtr<ossimProperty>(p);
+   }
+
+   return ossimImageSourceFilter::getProperty(name);
+}
+
+void ossimWatermarkFilter::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property) return;
+
+   ossimString os = property->valueToString();
+   
+   ossimString name = property->getName();
+   if (name == ossimKeywordNames::FILENAME_KW)
+   {
+      setFilename(os);
+   }
+   else if  (name == WATERMARK_MODE_KW)
+   {
+      setMode(os);
+   }
+   else if  (name == WEIGHT_KW)
+   {
+      setWeight(os.toDouble());
+   }
+   else
+   {
+      ossimImageSourceFilter::setProperty(property);
+   }
+}
+
+void ossimWatermarkFilter::getPropertyNames(
+   std::vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(ossimKeywordNames::FILENAME_KW);
+   propertyNames.push_back(WATERMARK_MODE_KW);
+   propertyNames.push_back(WEIGHT_KW);
+   ossimImageSourceFilter::getPropertyNames(propertyNames);
+}
+
+void ossimWatermarkFilter::getModeList(vector<ossimString>& list) const
+{
+   list.clear();
+   list.resize(ossimWatermarkFilter::END);
+   list[0] = ossimString("upper_left");
+   list[1] = ossimString("upper_center");
+   list[2] = ossimString("upper_right");
+   list[3] = ossimString("center");
+   list[4] = ossimString("lower_left");
+   list[5] = ossimString("lower_center");
+   list[6] = ossimString("lower_right");
+   list[7] = ossimString("uniform_dense");
+   list[8] = ossimString("uniform_sparse");
+}
+
+ossimWatermarkFilter::WatermarkMode ossimWatermarkFilter::getMode() const
+{
+   return theMode;
+}
+
+ossimString ossimWatermarkFilter::getModeString() const
+{
+   switch(theMode)
+   {
+      case UPPER_LEFT:
+         return ossimString("upper_left");
+      case UPPER_CENTER:
+         return ossimString("upper_center");
+      case UPPER_RIGHT:
+         return ossimString("upper_right");
+      case CENTER:
+         return ossimString("center");
+      case LOWER_LEFT:
+         return ossimString("lower_left");
+      case LOWER_CENTER:
+         return ossimString("lower_center");
+      case LOWER_RIGHT:
+         return ossimString("lower_right");
+      case UNIFORM_DENSE:
+         return ossimString("uniform_dense");
+      case UNIFORM_SPARSE:
+         return ossimString("uniform_sparse");
+      default:
+         break;
+   }
+
+   return ossimString("UNKNOWN_MODE");
+}
+
+void ossimWatermarkFilter::setFilename(const ossimFilename& file)
+{
+   if (file != theFilename)
+   {
+      theFilename = file;
+      theWatermark = NULL; // Will be reallocated next getTile.
+      theDirtyFlag = true;
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimWatermarkFilter::setFilename DEBUG:" << std::endl;
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+}
+
+void ossimWatermarkFilter::setMode(const ossimString& mode)
+{
+   ossimString os = mode;
+   os.downcase();
+   
+   if (os == "upper_left")
+   {
+      theMode = UPPER_LEFT;
+   }
+   else if (os == "upper_center")
+   {
+      theMode = UPPER_CENTER;
+   }
+   else if (os == "upper_right")
+   {
+      theMode = UPPER_RIGHT;
+   }
+   else if (os == "center")
+   {
+      theMode = CENTER;
+   }
+   else if (os == "lower_left")
+   {
+      theMode = LOWER_LEFT;
+   }
+   else if (os == "lower_center")
+   {
+      theMode = LOWER_CENTER;
+   }
+   else if (os == "lower_right")
+   {
+      theMode = LOWER_RIGHT;
+   }
+   else if (os == "uniform_dense")
+   {
+      theMode = UNIFORM_DENSE;
+   }
+   else if (os == "uniform_sparse")
+   {
+      theMode = UNIFORM_SPARSE;
+   }
+   else
+   {
+      // Invalid mode...
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimWatermarkFilter::setMode DEBUG:"
+            << "\nInvalid mode!  " << mode
+            << std::endl;
+      }
+   }
+}
+
+void ossimWatermarkFilter::setWeight(ossim_float64 weight)
+{
+   if ( (weight >= 0.0) && (weight <= 1.0) )
+   {
+      theWatermarkWeight = weight;
+   }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimWatermarkFilter::setWeight DEBUG:" << std::endl;
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+   
+}
+
+std::ostream& ossimWatermarkFilter::print(std::ostream& out) const
+{
+   out << "ossimWatermarkFilter::print"
+       << "\ntheFilename:        " << theFilename
+       << "\ntheWatermarkWeight: " << theWatermarkWeight
+       << "\ntheMode:            " << getModeString()
+       << std::endl;
+   return ossimImageSourceFilter::print(out);
+}
+
diff --git a/ossim/src/ossim/imaging/ossimWorldFileWriter.cpp b/src/imaging/ossimWorldFileWriter.cpp
similarity index 100%
rename from ossim/src/ossim/imaging/ossimWorldFileWriter.cpp
rename to src/imaging/ossimWorldFileWriter.cpp
diff --git a/src/imaging/ossimWriter.cpp b/src/imaging/ossimWriter.cpp
new file mode 100644
index 0000000..d7a1d82
--- /dev/null
+++ b/src/imaging/ossimWriter.cpp
@@ -0,0 +1,927 @@
+//---
+//
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description: Generic image writer class.
+// 
+//---
+// $Id$
+
+#include <ossim/imaging/ossimWriter.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTiffConstants.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+
+#include <limits>
+#include <ostream>
+
+static const ossimTrace traceDebug("ossimWriter:debug");
+
+using namespace std; // tmp drb
+
+ossimWriter::ossimWriter()
+   : ossimImageFileWriter(),
+     m_str(0),
+     m_ownsStreamFlag(false)
+{
+}
+
+ossimWriter::~ossimWriter()
+{
+   close();
+}
+
+void ossimWriter::close()
+{
+   if (m_str)      
+   {
+      m_str->flush();
+
+      if (m_ownsStreamFlag)
+      {
+         delete m_str;
+         m_str = 0;
+         m_ownsStreamFlag = false;
+      }
+   }
+}
+
+ossimString ossimWriter::getShortName() const
+{
+   return ossimString("ossim_writer");
+}
+
+ossimString ossimWriter::getLongName() const
+{
+   return ossimString("ossim writer");
+}
+
+ossimString ossimWriter::getClassName() const
+{
+   return ossimString("ossimWriter");
+}
+
+ossimString ossimWriter::getExtension() const
+{
+   ossimString result = "";
+   if ( theOutputImageType == "ttbs" ) // tiled tiff band separate
+   {
+      result = "tif";
+   }
+   return result;
+}
+
+void ossimWriter::getImageTypeList(std::vector<ossimString>& imageTypeList) const
+{
+   // imageTypeList.push_back(ossimString("tiff_tiled_band_separate"));
+   imageTypeList.push_back(ossimString("ossim_ttbs")); // tmp drb
+}
+
+bool ossimWriter::isOpen() const
+{
+   return ( m_str ? true : false );
+}
+
+bool ossimWriter::open()
+{
+   bool status = false;
+   
+   close();
+
+   if ( theFilename.size() && hasImageType( theOutputImageType ) )
+   {
+      std::ofstream* os = new std::ofstream();
+      os->open( theFilename.c_str(), ios::out | ios::binary );
+      if( os->is_open() )
+      {
+         m_str = os;
+         m_ownsStreamFlag = true;
+         status = true;
+      }
+      else
+      {
+         delete os;
+         os = 0;
+      }
+   }
+
+   return status;
+}
+
+bool ossimWriter::hasImageType(const ossimString& imageType) const
+{
+   bool result = false;
+   if ( (imageType == "ossim_ttbs") || (imageType == "image/tif") )
+   {
+      result = true;
+   }
+   return result;
+}
+
+bool ossimWriter::writeFile()
+{
+   bool status = true;
+   
+   if( theInputConnection.valid() &&
+       (getErrorStatus() == ossimErrorCodes::OSSIM_OK) )
+   {
+      //---
+      // Check for stream if master process.
+      // Note only the master process is used for writing...
+      //---
+      if( theInputConnection->isMaster() )
+      {
+         if (!isOpen())
+         {
+            status = open();
+         }
+      }
+
+      if ( status )
+      {
+         status = writeStream();
+      }
+   }
+
+   return status;
+}
+
+bool ossimWriter::writeStream()
+{
+   //---
+   // This can be called publically so we must to the same checks as the
+   // writeFile method.
+   //---
+   bool status = false;
+
+   // Must have a sequencer...
+   if( theInputConnection.valid() )
+   {
+      if ( isOpen() )
+      {
+         if ( theOutputImageType == "ossim_ttbs" )
+         {
+            status = writeStreamTtbs();
+         }
+      }
+   }
+   
+   return status;
+}
+
+bool ossimWriter::writeStreamTtbs()
+{
+   // Alway big tiff in native byte order.
+   
+   bool status = false;
+
+   if ( writeTiffHdr() == true )
+   {
+      std::vector<ossim_uint64>  tile_offsets;
+      std::vector<ossim_uint64>  tile_byte_counts;
+
+      //---
+      // Min/max arrays must start off empty for
+      // ossimImageData::computeMinMaxPix code.
+      //---
+      std::vector<ossim_float64> minBands(0);
+      std::vector<ossim_float64> maxBands(0);
+      
+      if ( writeTiffTilesBandSeparate(
+              tile_offsets, tile_byte_counts, minBands, maxBands   ) == true )
+      {
+         status = writeTiffTags( tile_offsets, tile_byte_counts, minBands, maxBands );
+      }
+   }
+   
+   return status;
+}
+
+bool ossimWriter::writeTiffHdr()
+{
+   //---
+   // First two bytes, byte order indication.
+   // "MM"(big endian) or "II"(little endian.
+   //---
+   std::string s;
+   if ( ossim::byteOrder() == OSSIM_LITTLE_ENDIAN )
+   {
+      s = "II";
+   }
+   else
+   {
+      s = "MM";
+   }
+   m_str->write( s.c_str(), 2 );
+
+   // Version, 42=classic tiff, 43=big tiff.
+   ossim_uint16 us16 = 43;
+   m_str->write( (const char*)&us16, 2 );
+
+   // Byte size of offsets.
+   us16 = 8;
+   m_str->write( (const char*)&us16, 2 );
+
+   // Always 0:
+   us16 = 0;
+   m_str->write( (const char*)&us16, 2 );
+
+   //---
+   // Offset to first IFD(image file directory).
+   // This will be updated by writeTiffTags method.
+   //---
+   ossim_uint64 ul64 = 16;
+   m_str->write( (const char*)&ul64, 8 );
+   
+   return m_str->good();
+}
+
+bool ossimWriter::writeTiffTags( const std::vector<ossim_uint64>& tile_offsets,
+                                 const std::vector<ossim_uint64>& tile_byte_counts,
+                                 const std::vector<ossim_float64>& minBands,
+                                 const std::vector<ossim_float64>& maxBands )
+{
+   bool status = false;
+
+   ossimRefPtr<ossimMapProjection> mapProj = 0;
+   ossimRefPtr<ossimImageGeometry> geom = theInputConnection->getImageGeometry();
+   if ( geom.valid() )
+   {
+      ossimRefPtr<ossimProjection> proj = geom->getProjection();
+      mapProj = dynamic_cast<ossimMapProjection*>( proj.get() );
+   }
+   
+   // Seek back and set the image file dectory offset(ifd).
+   std::streamoff currentPos = m_str->tellp();
+
+   m_str->seekp( 8, std::ios_base::beg );
+   
+   ossim_uint64 ifdOffset = (ossim_uint64)currentPos;
+   m_str->write( (const char*)&ifdOffset, 8 );
+
+   // Seek back to ifd:
+   m_str->seekp( currentPos, std::ios_base::beg );
+   
+   // tag count:
+   ossim_uint64 ul64 = mapProj.valid() ? 18 : 14; // tmp drb
+   m_str->write( (const char*)&ul64, 8 );
+
+   // Set the sart position for array writing.
+   std::streamoff arrayWritePos = m_str->tellp();
+   arrayWritePos += 24 * 20; // tmp drb
+
+   // Used throughout:
+   ossim_uint16 tag;
+   ossim_uint16 type;
+   ossim_uint64 count;
+   ossim_uint16 value_ui16;
+   ossim_uint32 value_ui32;
+   
+   // image width tag 256:
+   tag   = ossim::OTIFFTAG_IMAGEWIDTH;
+   count = 1;
+   if ( theAreaOfInterest.width() <= OSSIM_DEFAULT_MAX_PIX_UINT16 )
+   {
+      type = ossim::OTIFF_SHORT;
+      value_ui16 = (ossim_uint16)theAreaOfInterest.width();
+      writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   }
+   else
+   {
+      type = ossim::OTIFF_LONG;
+      value_ui32 = theAreaOfInterest.width();
+      writeTiffTag<ossim_uint32>( tag, type, count, &value_ui32, arrayWritePos );
+   }
+   
+   // image length tag 257:
+   tag   = ossim::OTIFFTAG_IMAGELENGTH;
+   count = 1;
+   if ( theAreaOfInterest.height() <= OSSIM_DEFAULT_MAX_PIX_UINT16 )
+   {
+      type = ossim::OTIFF_SHORT;
+      value_ui16 = (ossim_uint16)theAreaOfInterest.height();
+      writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   }
+   else
+   {
+      type = ossim::OTIFF_LONG;
+      value_ui32 = theAreaOfInterest.width();
+      writeTiffTag<ossim_uint32>( tag, type, count, &value_ui32, arrayWritePos );
+   }   
+
+   // bits per sample tag 258:
+   tag   = ossim::OTIFFTAG_BITSPERSAMPLE;
+   count = theInputConnection->getNumberOfOutputBands();
+   type  = ossim::OTIFF_SHORT;
+   value_ui16 = (ossim_uint16)ossim::getBitsPerPixel( theInputConnection->getOutputScalarType() );
+   if ( count == 1 )
+   {
+      writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   }
+   else
+   {
+      std::vector<ossim_uint16> v(count, value_ui16);
+      writeTiffTag<ossim_uint16>( tag, type, count, &v.front(), arrayWritePos );
+   }
+
+   // compression tag 259:
+   tag   = ossim::OTIFFTAG_COMPRESSION;
+   type  = ossim::OTIFF_SHORT;
+   count = 1;
+   value_ui16 = ossim::COMPRESSION_NONE; // tmp only uncompressed supported.
+   writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   
+   // photo interpretation tag 262:
+   tag   = ossim::OTIFFTAG_PHOTOMETRIC;
+   type  = ossim::OTIFF_SHORT;
+   count = 1;
+   if ( theInputConnection->getNumberOfOutputBands() == 3 )
+   {
+      value_ui16 = ossim::OPHOTO_RGB;
+   }
+   else
+   {
+      value_ui16 = ossim::OPHOTO_MINISBLACK;
+   }
+   
+   writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+
+   // samples per pixel tag 277:
+   tag   = ossim::OTIFFTAG_SAMPLESPERPIXEL;
+   type  = ossim::OTIFF_SHORT;
+   count = 1;
+   value_ui16 = theInputConnection->getNumberOfOutputBands();
+   writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+
+   // Writes two tags 280 and 281:
+   writeMinMaxTiffTags( minBands, maxBands, arrayWritePos );
+
+   // planar conf tag 284:
+   tag   = ossim::OTIFFTAG_PLANARCONFIG;
+   type  = ossim::OTIFF_SHORT;
+   count = 1;
+   value_ui16 = ossim::OTIFFTAG_PLANARCONFIG_SEPARATE;
+   writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   
+   // tile width tag 322:
+   tag   = ossim::OTIFFTAG_TILEWIDTH;
+   count = 1;
+   if ( theInputConnection->getTileWidth() <= OSSIM_DEFAULT_MAX_PIX_UINT16 )
+   {
+      type = ossim::OTIFF_SHORT;
+      value_ui16 = (ossim_uint16)theInputConnection->getTileWidth();
+      writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   }
+   else
+   {
+      type = ossim::OTIFF_LONG;
+      value_ui32 = theAreaOfInterest.width();
+      writeTiffTag<ossim_uint32>( tag, type, count, &value_ui32, arrayWritePos );
+   }
+
+   // tile length tag 323:
+   tag   = ossim::OTIFFTAG_TILELENGTH;
+   count = 1;
+   if ( theInputConnection->getTileHeight() <= OSSIM_DEFAULT_MAX_PIX_UINT16 )
+   {
+      type = ossim::OTIFF_SHORT;
+      value_ui16 = (ossim_uint16)theInputConnection->getTileWidth();
+      writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   }
+   else
+   {
+      type = ossim::OTIFF_LONG;
+      value_ui32 = theAreaOfInterest.width();
+      writeTiffTag<ossim_uint32>( tag, type, count, &value_ui32, arrayWritePos );
+   }
+
+   // tile offsets tag 324:
+   tag   = ossim::OTIFFTAG_TILEOFFSETS;
+   count = tile_offsets.size();
+   type  = ossim::OTIFF_LONG8;
+   writeTiffTag<ossim_uint64>( tag, type, count, &tile_offsets.front(), arrayWritePos );
+
+   // tile byte counts tag 325:
+   tag   = ossim::OTIFFTAG_TILEBYTECOUNTS;
+   count = tile_byte_counts.size();
+   type  = ossim::OTIFF_LONG8;
+   writeTiffTag<ossim_uint64>( tag, type, count, &tile_byte_counts.front(), arrayWritePos );
+
+   // sample format tag 339:
+   tag   = ossim::OTIFFTAG_SAMPLEFORMAT;
+   count = theInputConnection->getNumberOfOutputBands();
+   type  = ossim::OTIFF_SHORT;
+   value_ui16 = getTiffSampleFormat();
+   if ( count == 1 )
+   {
+      writeTiffTag<ossim_uint16>( tag, type, count, &value_ui16, arrayWritePos );
+   }
+   else
+   {
+      std::vector<ossim_uint16> v(count, value_ui16);
+      writeTiffTag<ossim_uint16>( tag, type, count, &v.front(), arrayWritePos );
+   }
+
+   // Writes two tags 340 and 341 (conditional on scalar type):
+   writeSMinSMaxTiffTags( minBands, maxBands, arrayWritePos );
+
+   // Write geo keys if valid map projection:
+   if ( mapProj.valid() )
+   {
+      std::vector<ossim_float64> vf;
+      ossimDpt scale;
+      ossimDpt tie;
+      
+      if ( mapProj->isGeographic() )
+      {
+         ossimGpt gpt;
+         mapProj->lineSampleToWorld( theAreaOfInterest.ul(), gpt );
+         tie.x = gpt.lon;
+         tie.y = gpt.lat;
+         scale = mapProj->getDecimalDegreesPerPixel();
+      }
+      else
+      {
+         mapProj->lineSampleToEastingNorthing( theAreaOfInterest.ul(), tie );
+         scale = mapProj->getMetersPerPixel();
+      }
+      
+      // model pixel scale tag 33550:
+      tag   = ossim::OMODEL_PIXEL_SCALE_TAG;
+      count = 3; // x, y, z
+      type  = ossim::OTIFF_DOUBLE;
+      vf.resize( count );
+      vf[0] = scale.x;
+      vf[1] = scale.y;
+      vf[2] = 0.0;
+      writeTiffTag<ossim_float64>( tag, type, count, &vf.front(), arrayWritePos );
+
+      // model tie point tag 33992:
+      tag   = ossim::OMODEL_TIE_POINT_TAG;
+      count = 6; // x, y, z
+      type  = ossim::OTIFF_DOUBLE;
+      vf.resize( count );
+      vf[0] = 0.0;   // x image point
+      vf[1] = 0.0;   // y image point
+      vf[2] = 0.0;   // z image point
+      vf[3] = tie.x; // longitude or easting
+      vf[4] = tie.y; // latitude of northing
+      vf[5] = 0.0;
+      writeTiffTag<ossim_float64>( tag, type, count, &vf.front(), arrayWritePos );
+
+      // geo key directory tag 34735:
+      tag   = ossim::OGEO_KEY_DIRECTORY_TAG;
+      count = 0; // set later.
+      type  = ossim::OTIFF_SHORT;
+      std::vector<ossim_uint16> vs(0);
+
+      // No
+      vs.push_back(1);
+      vs.push_back(1);
+      vs.push_back(0);
+      vs.push_back(10); // Updated later.
+
+      vs.push_back(ossim::OGT_MODEL_TYPE_GEO_KEY); // 1024
+      vs.push_back(0);
+      vs.push_back(1);
+      vs.push_back(mapProj->isGeographic() ? ossim::OMODEL_TYPE_GEOGRAPHIC :
+                   ossim::OMODEL_TYPE_PROJECTED);
+
+      vs.push_back(ossim::OGT_RASTER_TYPE_GEO_KEY); // 1025
+      vs.push_back(0);
+      vs.push_back(1);
+      vs.push_back(ossim::OPIXEL_IS_POINT);
+
+      if ( mapProj->isGeographic() )
+      {
+         vs.push_back(ossim::OGEOGRAPHIC_TYPE_GEO_KEY); // 2048
+         vs.push_back(0);
+         vs.push_back(1);
+         vs.push_back((ossim_uint16)(mapProj->getPcsCode()));
+      }
+
+      vs.push_back(ossim::OGEOG_GEODETIC_DATUM_GEO_KEY); // 2050
+      vs.push_back(0);
+      vs.push_back(1);
+      vs.push_back((ossim_uint16)(mapProj->getDatum()->epsgCode()));
+
+      if ( mapProj->isGeographic() )
+      {
+         vs.push_back(ossim::OGEOG_ANGULAR_UNITS_GEO_KEY); // 2054
+         vs.push_back(0);
+         vs.push_back(1);
+         vs.push_back(ossim::OANGULAR_DEGREE);
+      }
+         
+      vs.push_back(ossim::OGEOG_ELLIPSOID_GEO_KEY); // 2056
+      vs.push_back(0);
+      vs.push_back(1);
+      vs.push_back((ossim_uint16)(mapProj->getDatum()->ellipsoid()->getEpsgCode()));
+
+      // Stored in external OOGEO_DOUBLE_PARAMS_TAG
+      vs.push_back(ossim::OGEOG_SEMI_MAJOR_AXIS); // 2057
+      vs.push_back(ossim::OGEO_DOUBLE_PARAMS_TAG); 
+      vs.push_back(1);
+      vs.push_back(0);
+         
+      vs.push_back(ossim::OGEOG_SEMI_MINOR_AXIS); // 2058
+      vs.push_back(ossim::OGEO_DOUBLE_PARAMS_TAG);
+      vs.push_back(1);
+      vs.push_back(1);
+
+      vs.push_back(ossim::OPROJECTED_CS_TYPE_GEO_KEY); // 3072
+      vs.push_back(0);
+      vs.push_back(1);
+      vs.push_back((ossim_uint16)(mapProj->getPcsCode()));
+
+      vs.push_back(ossim::OPROJECTION_GEO_KEY); // 3074
+      vs.push_back(0);
+      vs.push_back(1);
+      vs.push_back((ossim_uint16)(mapProj->getPcsCode()));
+
+      if ( mapProj->isGeographic() == false )
+      {
+         vs.push_back(ossim::OPROJ_LINEAR_UNITS_GEO_KEY); // 3076
+         vs.push_back(0);
+         vs.push_back(1);
+         vs.push_back(ossim::OLINEAR_METER);
+      }
+      
+      count = vs.size();
+      vs[3] = (count / 4) - 1;
+      writeTiffTag<ossim_uint16>( tag, type, count, &vs.front(), arrayWritePos );
+       
+      // geo double params tag 33550:
+      tag   = ossim::OGEO_DOUBLE_PARAMS_TAG;
+      count = 2; // ellipsoid major, minor axis
+      type  = ossim::OTIFF_DOUBLE;
+      vf.resize( count );
+      vf[0] = mapProj->getDatum()->ellipsoid()->a();
+      vf[1] = mapProj->getDatum()->ellipsoid()->b();
+      writeTiffTag<ossim_float64>( tag, type, count, &vf.front(), arrayWritePos );
+   }
+
+   // Last write is zero indicading no more ifds.
+   ossim_uint64 offsetToNextIfd = 0;
+   m_str->write( (const char*)&offsetToNextIfd, 8 );
+
+   status =  m_str->good();
+   
+   return status;
+}
+
+bool ossimWriter::writeMinMaxTiffTags( const vector<ossim_float64>& minBands,
+                                       const vector<ossim_float64>& maxBands,
+                                       std::streamoff& arrayWritePos )
+{
+   bool status = true;
+   
+   if(minBands.size() && maxBands.size())
+   {
+      ossim_float64 minValue = *std::min_element(minBands.begin(), minBands.end());
+      ossim_float64 maxValue = *std::max_element(maxBands.begin(), maxBands.end());
+
+      switch( theInputConnection->getOutputScalarType() )
+      {
+         case OSSIM_USHORT11:
+         {
+            ossim_uint16 v = 0;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MINSAMPLEVALUE,
+                                        ossim::OTIFF_SHORT,
+                                        1, &v, arrayWritePos );
+            v = 2047;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MAXSAMPLEVALUE,
+                                       ossim::OTIFF_SHORT,
+                                       1, &v, arrayWritePos );
+            break;
+         }
+         case OSSIM_USHORT12:
+         {
+            ossim_uint16 v = 0;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MINSAMPLEVALUE,
+                                        ossim::OTIFF_SHORT,
+                                        1, &v, arrayWritePos );
+            v = 4095;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MAXSAMPLEVALUE,
+                                       ossim::OTIFF_SHORT,
+                                       1, &v, arrayWritePos );
+            break;
+         }
+         case OSSIM_USHORT13:
+         {
+            ossim_uint16 v = 0;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MINSAMPLEVALUE,
+                                        ossim::OTIFF_SHORT,
+                                        1, &v, arrayWritePos );
+            v = 8191;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MAXSAMPLEVALUE,
+                                       ossim::OTIFF_SHORT,
+                                       1, &v, arrayWritePos );
+            break;
+         }
+         case OSSIM_USHORT14:
+         {
+            ossim_uint16 v = 0;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MINSAMPLEVALUE,
+                                        ossim::OTIFF_SHORT,
+                                        1, &v, arrayWritePos );
+            v = 16383;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MAXSAMPLEVALUE,
+                                       ossim::OTIFF_SHORT,
+                                       1, &v, arrayWritePos );
+            break;
+         }
+         case OSSIM_USHORT15:
+         {
+            ossim_uint16 v = 0;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MINSAMPLEVALUE,
+                                        ossim::OTIFF_SHORT,
+                                        1, &v, arrayWritePos );
+            v = 32767;
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MAXSAMPLEVALUE,
+                                       ossim::OTIFF_SHORT,
+                                       1, &v, arrayWritePos );
+            break;
+         }
+         case OSSIM_UINT8:
+         case OSSIM_UINT16:
+         {
+            ossim_uint16 v = static_cast<ossim_uint16>(minValue);
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MINSAMPLEVALUE,
+                                        ossim::OTIFF_SHORT,
+                                        1, &v, arrayWritePos );
+            v = static_cast<ossim_uint16>(maxValue);
+            writeTiffTag<ossim_uint16>( ossim::OTIFFTAG_MAXSAMPLEVALUE,
+                                        ossim::OTIFF_SHORT,
+                                        1, &v, arrayWritePos );
+            break;
+         }
+         default:
+         {
+            status = false;
+            break;
+         }
+      }
+   }
+   return status;
+}
+
+bool ossimWriter::writeSMinSMaxTiffTags( const vector<ossim_float64>& minBands,
+                                         const vector<ossim_float64>& maxBands,
+                                         std::streamoff& arrayWritePos )
+{
+   bool status = true;
+   
+   if(minBands.size() && maxBands.size())
+   {
+      ossim_float64 minValue = *std::min_element(minBands.begin(), minBands.end());
+      ossim_float64 maxValue = *std::max_element(maxBands.begin(), maxBands.end());
+
+      switch( theInputConnection->getOutputScalarType() )
+      {
+         case OSSIM_SINT16: 
+         case OSSIM_UINT32:
+         case OSSIM_FLOAT32:
+         case OSSIM_FLOAT64:
+         case OSSIM_NORMALIZED_FLOAT:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            ossim_float32 v = static_cast<ossim_float32>(minValue);
+            writeTiffTag<ossim_float32>( ossim::OTIFFTAG_SMINSAMPLEVALUE,
+                                         ossim::OTIFF_FLOAT,
+                                         1, &v, arrayWritePos );
+            v = static_cast<ossim_float32>(maxValue);
+            writeTiffTag<ossim_float32>( ossim::OTIFFTAG_SMAXSAMPLEVALUE,
+                                         ossim::OTIFF_FLOAT,
+                                         1, &v, arrayWritePos );
+            break;
+         }
+         default:
+         {
+            status = false;
+            break;
+         }
+      }
+   }
+   return status;
+}
+
+
+
+template <class T>
+void ossimWriter::writeTiffTag(
+   ossim_uint16 tag, ossim_uint16 type, ossim_uint64 count,
+   const T* value, std::streamoff& arrayWritePos )
+{
+   m_str->write( (const char*)&tag, 2 );
+   m_str->write( (const char*)&type, 2 );
+   m_str->write( (const char*)&count, 8 );
+
+   ossim_uint64 bytes = sizeof( T ) * count;
+   
+   if ( bytes <= 8 )
+   {
+      m_str->write( (const char*)value, bytes );
+      if ( bytes < 8 )
+      {
+         // Fill remaining bytes with 0.
+         char c = '\0';
+         m_str->write( (const char*)&c, (8-bytes) );
+      }
+   }
+   else // Greater than 8 bytes, must write at end of file.
+   {
+      // Store the offset to array:
+      m_str->write( (const char*)&arrayWritePos, 8 );
+
+      // Capture posistion:
+      std::streamoff currentPos = m_str->tellp();
+
+      // Seek to end:
+      m_str->seekp( arrayWritePos, std::ios_base::beg );
+      
+      // Write:
+      m_str->write( (const char*)value, bytes );
+
+      // Capture new offset for next array write.
+      arrayWritePos = m_str->tellp();
+
+      // Seek back:
+      m_str->seekp( currentPos, std::ios_base::beg );
+   }
+}
+
+bool ossimWriter::writeTiffTilesBandSeparate( std::vector<ossim_uint64>& tile_offsets,
+                                              std::vector<ossim_uint64>& tile_byte_counts,
+                                              std::vector<ossim_float64>& minBands,
+                                              std::vector<ossim_float64>& maxBands )
+{
+   static const char* const MODULE = "ossimTiffWriter::writeToTilesBandSeparate";
+   if (traceDebug()) CLOG << " Entered." << std::endl;
+
+   // Start the sequence at the first tile.
+   theInputConnection->setToStartOfSequence();
+
+   const ossim_int32 BANDS       = (ossim_int32)theInputConnection->getNumberOfOutputBands();
+   const ossim_int32 TILES_WIDE  = (ossim_int32)theInputConnection->getNumberOfTilesHorizontal();
+   const ossim_int32 TILES_TOTAL = (ossim_int32)theInputConnection->getNumberOfTiles();
+
+   tile_offsets.resize( TILES_TOTAL*BANDS );
+   tile_byte_counts.resize( TILES_TOTAL*BANDS );
+
+   ossim_int64 ossimTileIndex    = 0;
+   ossim_int64 tiffTileIndex     = 0;
+   ossim_int64 tileSizeInBytes   = 0;
+   ossim_int64 bandOffsetInBytes = 0;
+   std::streamoff startPos = m_str->tellp();
+
+   while ( ossimTileIndex < TILES_TOTAL )
+   {
+      ossimRefPtr<ossimImageData> id = theInputConnection->getNextTile();
+      if(!id)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:"
+            << "Error returned writing tiff tile:  " << ossimTileIndex
+            << "\nNULL Tile from input encountered"
+            << std::endl;
+         return false;
+      }
+      
+      if ( ossimTileIndex == 0 )
+      {
+         tileSizeInBytes = (ossim_int64)id->getSizePerBandInBytes();
+         bandOffsetInBytes = tileSizeInBytes * TILES_TOTAL;
+      }
+
+      // Compute running min, max.
+      id->computeMinMaxPix(minBands, maxBands);
+      
+      // Band loop.
+      for (ossim_int32 band=0; band < BANDS; ++band)
+      {
+         // Grab a pointer to the tile for the band.
+         const char* data = (const char*)id->getBuf(band);
+         
+         // Compress data here(future maybe, i.e. jpeg, j2k...
+
+         //---
+         // Write the tile.
+         // Note: tiles laid out, all the red tiles, all the green tiles all the
+         // blue tiles.
+         //---
+         if(data)
+         {
+            // Compute the stream position:
+            std::streamoff pos = startPos + ossimTileIndex * tileSizeInBytes +
+               band * bandOffsetInBytes;
+            m_str->seekp( pos );
+
+            if ( m_str->good() )
+            {
+               tiffTileIndex = ossimTileIndex + band * TILES_TOTAL;
+               tile_offsets[ tiffTileIndex ] = (ossim_uint64)pos;
+               tile_byte_counts[ tiffTileIndex ] = (ossim_uint64)tileSizeInBytes;
+               
+               // Write the tile to stream:
+               m_str->write( data, (std::streamsize)tileSizeInBytes);
+               
+               // Check stream:
+               if ( m_str->fail() == true )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << MODULE << " ERROR:\nWrite error on tiff tile:  " << ossimTileIndex
+                     << std::endl;
+                  return false;
+               }
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << MODULE << " ERROR:\nStream has gone bad!" << std::endl;
+               return false;
+            }
+
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " ERROR:\nNull input tile:  " << ossimTileIndex
+               << std::endl;
+            return false;
+         }
+         
+      } // End of band loop.
+
+      ++ossimTileIndex;
+
+      if( needsAborting() )
+      {
+         setPercentComplete(100);
+         break; // Get out...
+      }
+      else if ( ossimTileIndex % TILES_WIDE )
+      {
+         // Output percent complete every row of tiles.
+         double tileNum = ossimTileIndex;
+         double numTiles = TILES_TOTAL;
+         setPercentComplete(tileNum / numTiles * 100.0);
+      }
+      
+   } // End: while ( ossimTileIndex < TILES_TOTAL )
+
+   if (traceDebug()) CLOG << " Exited." << std::endl;
+   
+   return m_str->good();
+}
+
+bool ossimWriter::setOutputStream(std::ostream& stream)
+{
+   if (m_ownsStreamFlag && m_str)
+   {
+      delete m_str;
+   }
+   m_str = &stream;
+   m_ownsStreamFlag = false;
+   return true;
+}
+
+ossim_uint16 ossimWriter::getTiffSampleFormat() const
+{
+   ossim_uint16 result = 0;
+   switch( theInputConnection->getOutputScalarType() )
+   {
+      case OSSIM_UINT8:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      case OSSIM_UINT32:
+         result = ossim::OSAMPLEFORMAT_UINT;
+         break;
+
+      case OSSIM_SINT16:
+         result = ossim::OSAMPLEFORMAT_INT;
+         break;
+
+      case OSSIM_FLOAT32:
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_NORMALIZED_DOUBLE:
+         result = ossim::OSAMPLEFORMAT_IEEEFP;
+         break;
+
+      default:
+         break;
+   }
+
+   return result;
+}
diff --git a/src/init/ossimInit.cpp b/src/init/ossimInit.cpp
new file mode 100644
index 0000000..12167ee
--- /dev/null
+++ b/src/init/ossimInit.cpp
@@ -0,0 +1,937 @@
+//*****************************************************************************
+// FILE: ossimInit.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimInit. This object handles all
+//   aspects of initialization for OSSIM applications. These tasks include:
+//
+//      1. Parsing the command line.
+//      2. Instantiating all class factories.
+//      3. Initializing the "trace" code execution tracing functionality.
+//      4. Scanning the preferences file for relevant values.
+//
+// SOFTWARE HISTORY:
+//   24Apr2001  Oscar Kramer
+//              Initial coding.
+//*****************************************************************************
+// $Id$
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/ossimVersion.h>
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimBaseObjectFactory.h>
+#include <ossim/base/ossimDatumFactoryRegistry.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimEnvironmentUtility.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimStreamFactory.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimTraceManager.h>
+#include <ossim/base/ossimGeoidEgm96.h>
+#include <ossim/base/ossim2dTo2dTransformRegistry.h>
+
+#include <ossim/elevation/ossimElevManager.h>
+
+#include <ossim/font/ossimFontFactoryRegistry.h>
+
+#include <ossim/imaging/ossimCodecFactoryRegistry.h>
+#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
+#include <ossim/imaging/ossimImageGeometryRegistry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
+#include <ossim/imaging/ossimOverviewBuilderFactory.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageMetaDataWriterRegistry.h>
+
+#include <ossim/plugin/ossimSharedPluginRegistry.h>
+#include <ossim/plugin/ossimDynamicLibrary.h>
+
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimProjectionViewControllerFactory.h>
+
+#include <algorithm>
+
+
+static ossimTrace traceExec = ossimTrace("ossimInit:exec");
+static ossimTrace traceDebug = ossimTrace("ossimInit:debug");
+
+ossimInit* ossimInit::theInstance = 0;
+
+ossimInit::~ossimInit()
+{
+   theInstance = 0;
+}
+
+ossimInit::ossimInit()
+    :
+       theInitializedFlag(false),
+       theAppName(),
+       thePreferences(0), // Delay instance() call until stream factory init.
+       theElevEnabledFlag(true),
+       thePluginLoaderEnabledFlag(true)
+{
+}
+
+ossimInit* ossimInit::instance()
+{
+   static OpenThreads::Mutex m;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
+   if (!theInstance)
+   {
+      theInstance = new ossimInit();
+   }
+   return theInstance;
+}
+
+void ossimInit::addOptions(ossimArgumentParser& parser)
+{
+   parser.getApplicationUsage()->addCommandLineOption("--env", "Specify an env variable to set.  Any number of these can appear with format --env VARIABLE=VALUE");
+   parser.getApplicationUsage()->addCommandLineOption("-P", "specify a preference file to load");
+   parser.getApplicationUsage()->addCommandLineOption("-K", "specify individual keywords to add to the preferences keyword list: name=value");
+   parser.getApplicationUsage()->addCommandLineOption("-T", "specify the classes to trace, ex: ossimInit|ossimImage.* \nwill trace ossimInit and all ossimImage classes");
+   parser.getApplicationUsage()->addCommandLineOption("--disable-elev", "Will disable the elevation");
+   parser.getApplicationUsage()->addCommandLineOption("--disable-plugin", "Will disable the plugin loader");
+   
+   parser.getApplicationUsage()->addCommandLineOption("--ossim-logfile", "takes a logfile as an argument.  All output messages are redirected to the specified log file.  By default there is no log file and all messages are enabled.");
+   parser.getApplicationUsage()->addCommandLineOption("--disable-notify", "Takes an argument. Arguments are ALL, WARN, NOTICE, INFO, FATAL, DEBUG.  If you want multiple disables then just do multiple --disable-notify on the command line.  All argument are case insensitive.  Default is all are enabled.");
+}
+
+/*!****************************************************************************
+ * METHOD: ossimInit::initialize()
+ *  
+ *  Method called from the OSSIM application main.
+ *  
+ *****************************************************************************/
+void ossimInit::initialize(int& argc, char** argv)
+{
+   static OpenThreads::Mutex m;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
+   if( !theInitializedFlag )
+   {
+      ossimArgumentParser argumentParser(&argc, argv);
+      theInstance->initialize(argumentParser);
+   }
+}
+
+void ossimInit::initialize(ossimArgumentParser& parser)
+{
+   static OpenThreads::Mutex m;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
+   if(theInitializedFlag)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimInit::initialize(parser):"
+            << " Already initialized, returning......"
+            << std::endl;
+      }
+      return;
+   }
+   theInstance->parseEnvOptions(parser);
+   theInstance->parseNotifyOption(parser);
+   theInstance->parsePrefsOptions(parser);
+   // Stream factories must be initialized before call to: ossimPreferences::instance()
+   ossim::StreamFactoryRegistry::instance()->registerFactory(ossim::StreamFactory::instance());
+   ossimStreamFactoryRegistry::instance()->registerFactory(ossimStreamFactory::instance());
+
+   theInstance->theAppName  = parser.getApplicationUsage()->getApplicationName();
+
+   //Parse the command line:
+
+   theInstance->parseOptions(parser);
+   // we will also support defining a trace pattern from an Environment
+   // variable.  This will make JNI code easier to enable tracing
+   //
+   ossimString traceVariable = ossimEnvironmentUtility::instance()->getEnvironmentVariable("OSSIM_TRACE");
+
+   if(!traceVariable.empty())
+   {
+      ossimTraceManager::instance()->setTracePattern(traceVariable);
+   }
+
+   theInstance->initializeDefaultFactories();
+
+   if ( theElevEnabledFlag )
+   {
+      theInstance->initializeElevation();
+   }
+
+   theInstance->initializeLogFile();
+   
+   if(thePluginLoaderEnabledFlag)
+   {
+      theInstance->initializePlugins();
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossim preferences file: "
+         << theInstance->thePreferences->getPreferencesFilename()
+         << "\nVersion: " << version()
+         << "\nossimInit::initialize(parser): leaving..." << std::endl;
+   }
+   
+   theInitializedFlag = true;
+}
+
+void ossimInit::initialize()
+{
+   if(theInitializedFlag)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimInit::initialize(parser):"
+            << " Already initialized, returning......"
+            << std::endl;
+      }
+      return;
+   }
+   
+   int argc = 1;
+   char* argv[1];
+
+   argv[0] = new char[1];
+   argv[0][0] = '\0';
+   initialize(argc, argv);
+   delete [] argv[0];
+
+#if 0   
+    static OpenThreads::Mutex m;
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m);
+   if(theInitializedFlag)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimInit::initialize(): Already initialized, returning......" << std::endl;
+      }
+      return;
+   }
+
+   theInstance->theAppName  = "";
+   theInstance->thePreferences = ossimPreferences::instance();
+   theInstance->initializeDefaultFactories();
+   
+   if ( theElevEnabledFlag )
+   {
+      theInstance->initializeElevation();
+   }
+
+   theInstance->initializeLogFile();
+
+   //---
+   // To do:
+   // We need a mechanism to register factories to the "front" or the
+   // "back" of factory list so that plugins can override things.  For
+   // now we will initialize the plugins last...
+   //---
+   if(thePluginLoaderEnabledFlag)
+   {
+      theInstance->initializePlugins();
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossim preferences file: "
+         << theInstance->thePreferences->getPreferencesFilename()
+         << "\nVersion: " << version()
+         << "\nossimInit::initialize() leaving..."
+         << std::endl;
+   } 
+   
+   theInitializedFlag = true;
+#endif
+}
+
+void ossimInit::finalize()
+{
+   
+}
+/*!****************************************************************************
+ *  Prints to stdout the list of command line options that this object parses.
+ *****************************************************************************/
+void ossimInit::usage()
+{
+   ossimNotify(ossimNotifyLevel_INFO)
+      << "INFORMATION ossimInit::usage():\n"
+      << "Additional command-line options available are as follows: "
+      << "\n"
+      << "\n  -P<pref_filename> -- Allows the user to override the loading "
+      << "\n    of the default preferences with their own pref file."
+      << "\n"
+      << "\n  -K<keyword>[=<value>] -- Allows the user to specify additional"
+      << "\n    keyword/value pairs that are added onto the preferences "
+      << "\n    previously loaded. Keywords specified here override those in"
+      << "\n    the preferences file."
+      << "\n"
+      << "\n  -T<trace_tag> -- Lets user turn on specific trace flags."
+      << "\n"
+      << "\n  -S<session_filename> -- Allows user to specify a session file"
+      << "\n    to load."
+      << std::endl;
+   return;
+}
+
+bool ossimInit::getElevEnabledFlag() const
+{
+   return theElevEnabledFlag;
+}
+
+void ossimInit::setElevEnabledFlag(bool flag)
+{
+   theElevEnabledFlag = flag; 
+}
+
+void ossimInit::setPluginLoaderEnabledFlag(bool flag)
+{
+   thePluginLoaderEnabledFlag = flag;  
+}
+
+void ossimInit::loadPlugins(const ossimFilename& plugin, const char* options)
+{
+   if(!thePluginLoaderEnabledFlag) return;
+
+   if(plugin.exists())
+   {
+      if(plugin.isDir())
+      {
+         ossimDirectory dir;
+         if(dir.open(plugin))
+         {
+            ossimFilename file;
+            
+            if(dir.getFirst(file, ossimDirectory::OSSIM_DIR_FILES))
+            {
+               do
+               { 
+                  ossimSharedPluginRegistry::instance()->registerPlugin(file, options);
+               }
+               while(dir.getNext(file));
+            }
+         }
+      }
+      else
+      {
+         ossimSharedPluginRegistry::instance()->registerPlugin(plugin, options);
+      }
+   }
+}
+
+void ossimInit::parsePrefsOptions(ossimArgumentParser& parser)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimInit::parseOptions: entering..." << std::endl;
+
+   
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParameter(tempString);
+
+   tempString = "";
+   ossimString prefsFile = ossimEnvironmentUtility::instance()->getEnvironmentVariable("OSSIM_PREFS_FILE");
+   theInstance->thePreferences = ossimPreferences::instance();
+   if(!prefsFile.empty())
+   {
+      thePreferences->loadPreferences();// Use the default load 
+   }
+   tempString = "";
+   // override ENV with passed in variable
+   while(parser.read("-P", stringParameter));
+
+   if(tempString != "")
+   {
+      thePreferences->loadPreferences(ossimFilename(tempString));
+   }
+   tempString = "";
+   while(parser.read("-K", stringParameter))
+   {
+      ossimString option = tempString;
+      if (option.contains("=") )
+      {
+         ossimString delimiter = "=";
+         ossimString key (option.before(delimiter));
+         ossimString value = option.after(delimiter);
+         thePreferences->addPreference(key.c_str(), value.c_str());
+      }
+      else
+      {
+         ossimString key (option);
+         thePreferences->addPreference(key, "");
+      }
+   }
+
+}
+
+void ossimInit::parseOptions(ossimArgumentParser& parser)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimInit::parseOptions: entering..." << std::endl;
+   
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParameter(tempString);
+
+   tempString = "";
+
+   while(parser.read("-T", stringParameter))
+   {
+      ossimTraceManager::instance()->setTracePattern(ossimString(tempString));
+   }
+
+   while(parser.read("--ossim-logfile", stringParameter))
+   {
+      ossimSetLogFilename(ossimFilename(tempString));
+   }
+   while(parser.read("--disable-notify", stringParameter))
+   {
+      ossimString tempDownCase = tempString;
+      tempDownCase = tempDownCase.downcase();
+
+      if(tempDownCase == "warn")
+      {
+         ossimDisableNotify(ossimNotifyFlags_WARN);
+      }
+      else if(tempDownCase == "fatal")
+      {
+         ossimDisableNotify(ossimNotifyFlags_FATAL);
+      }
+      else if(tempDownCase == "debug")
+      {
+         ossimDisableNotify(ossimNotifyFlags_DEBUG);
+      }
+      else if(tempDownCase == "info")
+      {
+         ossimDisableNotify(ossimNotifyFlags_INFO);
+      }
+      else if(tempDownCase == "notice")
+      {
+         ossimDisableNotify(ossimNotifyFlags_NOTICE);
+      }
+      else if(tempDownCase == "all")
+      {
+         ossimDisableNotify(ossimNotifyFlags_ALL);
+      }
+   }
+   if(parser.read("--disable-elev"))
+   {
+      theElevEnabledFlag = false;
+   }
+   if(parser.read("--disable-plugin"))
+   {
+      thePluginLoaderEnabledFlag = false;
+   }
+}
+
+void ossimInit::parseNotifyOption(ossimArgumentParser& parser)
+{
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParameter(tempString);
+   while(parser.read("--disable-notify", stringParameter))
+   {
+      ossimString tempDownCase = tempString;
+      tempDownCase = tempDownCase.downcase();
+
+      if(tempDownCase == "warn")
+      {
+         ossimDisableNotify(ossimNotifyFlags_WARN);
+      }
+      else if(tempDownCase == "fatal")
+      {
+         ossimDisableNotify(ossimNotifyFlags_FATAL);
+      }
+      else if(tempDownCase == "debug")
+      {
+         ossimDisableNotify(ossimNotifyFlags_DEBUG);
+      }
+      else if(tempDownCase == "info")
+      {
+         ossimDisableNotify(ossimNotifyFlags_INFO);
+      }
+      else if(tempDownCase == "notice")
+      {
+         ossimDisableNotify(ossimNotifyFlags_NOTICE);
+      }
+      else if(tempDownCase == "all")
+      {
+         ossimDisableNotify(ossimNotifyFlags_ALL);
+      }
+   }
+}
+
+void ossimInit::parseEnvOptions(ossimArgumentParser& parser)
+{
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParameter(tempString);
+   while(parser.read("--env", stringParameter))
+   {
+      ossimString option = tempString;
+      if (option.contains("=") )
+      {
+         ossimString delimiter = "=";
+         ossimString key (option.before(delimiter));
+         ossimString value = option.after(delimiter);
+         ossimEnvironmentUtility::instance()->setEnvironmentVariable(key.c_str(), value.c_str());
+
+      }
+      else
+      {
+         ossimString key (option);
+         ossimEnvironmentUtility::instance()->setEnvironmentVariable(key.c_str(), "");
+      }
+   }
+}
+/*!****************************************************************************
+ * METHOD: ossimInit::removeOption()
+ *  
+ * Removes all characters associated with the indicated option from the
+ * command line string.
+ *  
+ *****************************************************************************/
+void ossimInit::removeOption(int& argc,
+                             char** argv,
+                             int argToRemove)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimInit::removeOption(argc, argv, argToRemove): entering..."
+      << std::endl;
+   
+   // Shift the args up by one position, overwriting the arg being removed:
+   for (int i=argToRemove+1; i<argc;  i++)
+   {
+      argv[i - 1] = argv[i];
+   }
+   
+   argc--;
+   argv[argc] = 0;
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimInit::removeOption(argc, argv, argToRemove): leaving..."
+      << std::endl;
+   return;
+}
+
+void ossimInit::initializeDefaultFactories()
+{
+   ossimObjectFactoryRegistry::instance()->registerFactory(ossimImageSourceFactoryRegistry::instance());
+
+   //---
+   // Because of how the imagehandlers work off a magic number make sure
+   // we place the writer first if we don't then the imagehandler will
+   // be false and will then try to open the filename and go through a
+   // magic number and if the file already
+   // existed it will open and create a handler instead of a writer.
+   //---
+   ossimCodecFactoryRegistry::instance();
+   ossimImageWriterFactoryRegistry::instance();
+   ossimDatumFactoryRegistry::instance();
+   ossimImageMetaDataWriterRegistry::instance();
+   ossimImageHandlerRegistry::instance();
+   ossim2dTo2dTransformRegistry::instance();
+   ossimImageGeometryRegistry::instance();
+   // Initialize the overview factories.
+   ossimOverviewBuilderFactoryRegistry::instance()->
+      registerFactory(ossimOverviewBuilderFactory::instance(), true);
+   
+   ossimObjectFactoryRegistry::instance()->addFactory(ossimBaseObjectFactory::instance());
+   
+   // initialize. projection factory.
+   ossimProjectionFactoryRegistry::instance();
+
+   // add the view controllers
+   ossimObjectFactoryRegistry::instance()->registerFactory(ossimProjectionViewControllerFactory::instance());
+
+   ossimFontFactoryRegistry::instance();
+}
+
+void ossimInit::initializePlugins()
+{
+
+#if 0   
+   // Note: Removed "autoload" code. Commented out below.
+   
+   const ossimKeywordlist& KWL = thePreferences->preferencesKWL();
+
+   //---
+   // Look for plugins in the form of:
+   // plugin0.file: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_png_plugin.so
+   // plugin0.option: front
+   //---
+   ossimString regExp =  ossimString("^(") + "plugin[0-9]+.file)";
+   ossim_uint32 numberOfPlugins = KWL.getNumberOfSubstringKeys( regExp );
+   if ( numberOfPlugins )
+   {  
+      const ossim_uint32 MAX_INDEX = numberOfPlugins + 1000; // for skipage...
+      ossim_uint32 index            = 0;
+      ossim_uint32 processedIndexes = 0;
+      const std::string PREFIX_BASE = "plugin";
+      const std::string DOT         = ".";
+      const std::string FILE_KEY    = "file";
+      const std::string OPTIONS_KEY = "options";
+      
+      ossimString prefix;
+      ossimFilename pluginFile;
+      ossimString pluginOptions;      
+
+      // Loop to load plugins in order. Note allows for skipage.
+      while ( processedIndexes < MAX_INDEX )
+      {
+         prefix = PREFIX_BASE + ossimString::toString(index).string() + DOT; 
+         pluginFile = KWL.findKey( prefix, FILE_KEY );
+         if ( pluginFile.size() )
+         {
+            if ( pluginFile.exists() )
+            {
+               // Found plugin, look for options:
+               pluginOptions = KWL.findKey( prefix, OPTIONS_KEY );
+               
+               ossimSharedPluginRegistry::instance()->registerPlugin(pluginFile, pluginOptions);
+            }
+            ++processedIndexes;
+         }
+         if ( processedIndexes == numberOfPlugins )
+         {
+            break;
+         }
+         ++index;
+      }
+   }
+
+   //---
+   // Look for plugins in the form of:
+   // plugin.file0: $(OSSIM_INSTALL_PREFIX)/lib64/ossim/plugins/libossim_png_plugin.so
+   //---
+   regExp =  ossimString("^(") + "plugin.file[0-9]+)";
+   numberOfPlugins = KWL.getNumberOfSubstringKeys( regExp );
+   if ( numberOfPlugins )
+   {  
+      const ossim_uint32 MAX_INDEX = numberOfPlugins + 1000; // for skipage...
+      ossim_uint32 index            = 0;
+      ossim_uint32 processedIndexes = 0;
+      const std::string PREFIX_BASE = "plugin.file";
+      std::string fileKey;
+      
+      ossimString prefix;
+      ossimFilename pluginFile;
+      ossimString pluginOptions = ""; // No options:
+
+      // Loop to load plugins in order. Note allows for skipage.
+      while ( processedIndexes < MAX_INDEX )
+      {
+         fileKey = PREFIX_BASE + ossimString::toString(index).string();
+         pluginFile = KWL.findKey( fileKey );
+         if ( pluginFile.size() )
+         {
+            if ( pluginFile.exists() )
+            {
+               ossimSharedPluginRegistry::instance()->registerPlugin(pluginFile, pluginOptions);
+            }
+            ++processedIndexes;
+         }
+         
+         if ( processedIndexes == numberOfPlugins )
+         {
+            break;
+         }
+         ++index;
+      }
+   }
+
+#else  /* Old code that auto loads plugins. */
+   #if 0
+   ossimString regExpressionDir =  ossimString("^(") + "plugin.dir[0-9]+)";
+   ossimString regExpressionFile =  ossimString("^(") + "plugin.file[0-9]+)";
+
+   const ossimKeywordlist& kwl = thePreferences->preferencesKWL();
+
+   vector<ossimString> keys = kwl.getSubstringKeyList( regExpressionDir );
+
+   ossim_uint32 numberOfDirs = (ossim_uint32)keys.size();
+   ossim_uint32 offset = (ossim_uint32)ossimString("plugin.dir").size();
+   int idx = 0;
+   
+   std::vector<int> numberList(numberOfDirs);
+   
+   // register user plugins first
+   ossimFilename userPluginDir = ossimEnvironmentUtility::instance()->getUserOssimPluginDir();
+   loadPlugins(userPluginDir);
+
+   if(numberList.size()>0)
+   {
+      for(idx = 0; idx < (int)numberList.size();++idx)
+      {
+         ossimString numberStr(keys[idx].begin() + offset,
+                               keys[idx].end());
+         numberList[idx] = numberStr.toInt();
+      }
+      
+      std::sort(numberList.begin(), numberList.end());
+      for(idx=0;idx < (int)numberList.size();++idx)
+      {
+         ossimString newPrefix = "plugin.dir";
+         newPrefix += ossimString::toString(numberList[idx]);
+         const char* directory = kwl.find(newPrefix.c_str());
+         
+         if(directory)
+         {
+            loadPlugins(ossimFilename(directory));
+         }
+      }
+   }
+   keys = kwl.getSubstringKeyList( regExpressionFile );
+   
+   ossim_uint32 numberOfFiles = (ossim_uint32)keys.size();
+   offset = (ossim_uint32)ossimString("plugin.file").size();
+   numberList.resize(numberOfFiles);
+   if(numberList.size()>0)
+   {
+      for(idx = 0; idx < (int)numberList.size();++idx)
+      {
+         ossimString numberStr(keys[idx].begin() + offset,
+                               keys[idx].end());
+         numberList[idx] = numberStr.toInt();
+      }
+      
+      std::sort(numberList.begin(), numberList.end());   
+      for(idx=0;idx < (int)numberList.size();++idx)
+      {
+         ossimString newPrefix="plugin.file";
+         newPrefix += ossimString::toString(numberList[idx]);
+         const char* file = kwl.find(newPrefix.c_str());
+         
+         if(file&&ossimFilename(file).exists())
+         {
+            loadPlugins(file);
+//             ossimSharedPluginRegistry::instance()->registerPlugin(file);
+         }
+      }
+   }
+   #endif   
+   // now check new plugin loading that supports passing options to the plugins
+   // 
+   const ossimKeywordlist& kwl = thePreferences->preferencesKWL();
+   ossimString regExpressionFile =  ossimString("^(") + "plugin[0-9]+\\.file)";
+   vector<ossimString> keys = kwl.getSubstringKeyList( regExpressionFile );
+   
+   ossim_uint32 numberOfFiles = (ossim_uint32)keys.size();
+   ossim_uint32 offset = (ossim_uint32)ossimString("plugin").size();
+   std::vector<int> numberList(numberOfFiles);
+   
+   if(numberList.size()>0)
+   {
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < numberList.size();++idx)
+      {
+         ossimString numberStr(keys[idx].begin() + offset,
+                               keys[idx].end());
+         numberList[idx] = numberStr.toInt();
+      }
+      std::sort(numberList.begin(), numberList.end());
+      ossimFilename pluginFile;
+      ossimString options;
+      for(std::vector<ossim_int32>::const_iterator iter = numberList.begin();
+         iter != numberList.end();++iter)
+      {
+         ossimString newPrefix = ossimString("plugin")+ossimString::toString(*iter) + ".";
+       
+         pluginFile = kwl.find((newPrefix+"file").c_str());
+         options    = kwl.find((newPrefix+"options").c_str());
+         if(pluginFile.exists())
+         {
+            ossimSharedPluginRegistry::instance()->registerPlugin(pluginFile, options);
+         }
+      }
+   }
+
+   regExpressionFile =  ossimString("^(") + "plugin.file[0-9]+)";
+   keys = kwl.getSubstringKeyList( regExpressionFile );
+   
+   numberOfFiles = (ossim_uint32)keys.size();
+   offset = (ossim_uint32)ossimString("plugin.file").size();
+   numberList.resize(numberOfFiles);
+   
+   if(numberList.size()>0)
+   {
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < numberList.size();++idx)
+      {
+         ossimString numberStr(keys[idx].begin() + offset,
+                               keys[idx].end());
+         numberList[idx] = numberStr.toInt();
+      }
+      std::sort(numberList.begin(), numberList.end());
+      ossimFilename pluginFile;
+      ossimString options;
+      for(std::vector<ossim_int32>::const_iterator iter = numberList.begin();
+         iter != numberList.end();++iter)
+      {
+         ossimString newPrefix = ossimString("plugin.file")+ossimString::toString(*iter);
+       
+         pluginFile = kwl.find(newPrefix.c_str());
+         if(pluginFile.exists())
+         {
+            ossimSharedPluginRegistry::instance()->registerPlugin(pluginFile, options);
+         }
+      }
+   }
+
+
+
+   ossimString auto_load_plugins(ossimPreferences::instance()->findPreference("ossim_init.auto_load_plugins"));
+   
+   if(auto_load_plugins.empty()) auto_load_plugins = "false";
+   // now load any plugins not found in the keywordlist
+   //
+   // check for plugins in the current directory
+   // and load them
+   if(auto_load_plugins.toBool())
+   {
+      ossimFilename ossimpluginsDir = ossimFilename(theAppName).dirCat("ossimplugins");
+      ossimDirectory currentDir(theAppName.path());
+
+      if(ossimpluginsDir.exists())
+      {
+         currentDir = ossimpluginsDir;
+      }
+      std::vector<ossimFilename> result;
+      currentDir.findAllFilesThatMatch(result, "ossim.*plugin.*", ossimDirectory::OSSIM_DIR_FILES);
+      
+      if(result.size())
+      {
+         ossim_uint32 idx = 0;
+         for(idx = 0; idx < result.size(); ++idx)
+         {
+            ossimSharedPluginRegistry::instance()->registerPlugin(result[idx]);
+         }
+      }
+   }
+#endif
+}
+
+void ossimInit::initializeElevation()
+{
+   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimInit::initializeElevation(): Entered..." << std::endl;
+   
+   const ossimKeywordlist& KWL = thePreferences->preferencesKWL();
+
+#if 0  /* All autoload stuff disabled. drb 20170408 */
+   ossimFilename appPath = theAppName.path();
+   
+   // look for bundled elevation and geoids
+   {
+      ossimFilename geoid = appPath.dirCat("geoids");
+      geoid = geoid.dirCat("geoid1996");
+      geoid = geoid.dirCat("egm96.grd");
+      if(geoid.exists())
+      {
+         ossimGeoid* geoidPtr = new ossimGeoidEgm96(geoid);
+         
+         if (geoidPtr->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+         {
+            ossimGeoidManager::instance()->addGeoid(geoidPtr);
+         }
+         
+      }
+   }
+#endif
+   
+   ossimGeoidManager::instance()->loadState(KWL);
+
+   //---
+   // Auto load removed to avoid un-wanted directory scanning.
+   // Use ossim preferences.  drb - 28 March 2016.
+   //---
+#if 0
+   ossimFilename elevation = appPath.dirCat("elevation");
+   if(elevation.exists())
+   {
+      ossimElevManager::instance()->loadElevationPath(elevation);
+   }
+#endif
+
+   // lets do backward compatability here
+   //
+   ossimString regExpression =  ossimString("^(") + "elevation_source[0-9]+.)";
+   vector<ossimString> keys =
+   KWL.getSubstringKeyList( regExpression );
+   if(!keys.empty())
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "Please specify elevation_source keywords with the new prefix\n"
+                                         << "of elevation_manager.elevation_source....\n";
+      thePreferences->preferencesKWL().addPrefixToKeysThatMatch("elevation_manager.", regExpression);
+   }
+   ossimElevManager::instance()->loadState(KWL, "elevation_manager.");
+   
+   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimInit::initializeElevation(): leaving..." << std::endl;
+}
+
+void ossimInit::initializeLogFile()
+{
+   //---
+   // Do not set if already as --ossim-logfile take precidence over preferences
+   // file.
+   //---
+   ossimFilename logFile;
+   ossimGetLogFilename(logFile);
+
+   if ( (logFile.size() == 0) && thePreferences )
+   {
+      const char* lookup =
+         thePreferences->preferencesKWL().find("ossim.log.file");
+      if (lookup)
+      {
+         logFile = lookup;
+         ossimSetLogFilename(logFile);
+      }
+   }
+}
+
+ossimString ossimInit::version() const
+{
+   ossimString versionString;
+#ifdef OSSIM_VERSION
+   versionString += OSSIM_VERSION;
+#else
+   versionString += "Version ?.?.?";
+#endif
+   
+   versionString += " ";
+
+#ifdef OSSIM_BUILD_DATE
+   versionString += OSSIM_BUILD_DATE;
+#else
+   versionString += "(yyyymmdd)";
+#endif
+
+   return versionString;
+}
+
+ossimFilename ossimInit::appName()const
+{
+   return theAppName;
+}
+
+ossimInit::ossimInit(const ossimInit& /* obj */ )
+:  theInitializedFlag(false),
+   theAppName(),
+   thePreferences(ossimPreferences::instance()),
+   theElevEnabledFlag(true),
+   thePluginLoaderEnabledFlag(true)
+{}       
+
+void ossimInit::operator=(const ossimInit& /* rhs */) const
+{}
diff --git a/ossim/src/ossim/matrix/bandmat.cpp b/src/matrix/bandmat.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/bandmat.cpp
rename to src/matrix/bandmat.cpp
diff --git a/ossim/src/ossim/matrix/bc.mak b/src/matrix/bc.mak
similarity index 100%
rename from ossim/src/ossim/matrix/bc.mak
rename to src/matrix/bc.mak
diff --git a/ossim/src/ossim/matrix/bc32.mak b/src/matrix/bc32.mak
similarity index 100%
rename from ossim/src/ossim/matrix/bc32.mak
rename to src/matrix/bc32.mak
diff --git a/ossim/src/ossim/matrix/cc.mak b/src/matrix/cc.mak
similarity index 100%
rename from ossim/src/ossim/matrix/cc.mak
rename to src/matrix/cc.mak
diff --git a/ossim/src/ossim/matrix/cholesky.cpp b/src/matrix/cholesky.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/cholesky.cpp
rename to src/matrix/cholesky.cpp
diff --git a/ossim/src/ossim/matrix/evalue.cpp b/src/matrix/evalue.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/evalue.cpp
rename to src/matrix/evalue.cpp
diff --git a/ossim/src/ossim/matrix/example.txt b/src/matrix/example.txt
similarity index 100%
rename from ossim/src/ossim/matrix/example.txt
rename to src/matrix/example.txt
diff --git a/ossim/src/ossim/matrix/fft.cpp b/src/matrix/fft.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/fft.cpp
rename to src/matrix/fft.cpp
diff --git a/ossim/src/ossim/matrix/gnu.mak b/src/matrix/gnu.mak
similarity index 100%
rename from ossim/src/ossim/matrix/gnu.mak
rename to src/matrix/gnu.mak
diff --git a/ossim/src/ossim/matrix/hholder.cpp b/src/matrix/hholder.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/hholder.cpp
rename to src/matrix/hholder.cpp
diff --git a/ossim/src/ossim/matrix/jacobi.cpp b/src/matrix/jacobi.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/jacobi.cpp
rename to src/matrix/jacobi.cpp
diff --git a/ossim/src/ossim/matrix/ms.mak b/src/matrix/ms.mak
similarity index 100%
rename from ossim/src/ossim/matrix/ms.mak
rename to src/matrix/ms.mak
diff --git a/ossim/src/ossim/matrix/ms_nt.mak b/src/matrix/ms_nt.mak
similarity index 100%
rename from ossim/src/ossim/matrix/ms_nt.mak
rename to src/matrix/ms_nt.mak
diff --git a/ossim/src/ossim/matrix/myexcept.cpp b/src/matrix/myexcept.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/myexcept.cpp
rename to src/matrix/myexcept.cpp
diff --git a/ossim/src/ossim/matrix/newfft.cpp b/src/matrix/newfft.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newfft.cpp
rename to src/matrix/newfft.cpp
diff --git a/ossim/src/ossim/matrix/newmat.txt b/src/matrix/newmat.txt
similarity index 100%
rename from ossim/src/ossim/matrix/newmat.txt
rename to src/matrix/newmat.txt
diff --git a/ossim/src/ossim/matrix/newmat1.cpp b/src/matrix/newmat1.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat1.cpp
rename to src/matrix/newmat1.cpp
diff --git a/ossim/src/ossim/matrix/newmat2.cpp b/src/matrix/newmat2.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat2.cpp
rename to src/matrix/newmat2.cpp
diff --git a/ossim/src/ossim/matrix/newmat3.cpp b/src/matrix/newmat3.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat3.cpp
rename to src/matrix/newmat3.cpp
diff --git a/ossim/src/ossim/matrix/newmat4.cpp b/src/matrix/newmat4.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat4.cpp
rename to src/matrix/newmat4.cpp
diff --git a/ossim/src/ossim/matrix/newmat5.cpp b/src/matrix/newmat5.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat5.cpp
rename to src/matrix/newmat5.cpp
diff --git a/ossim/src/ossim/matrix/newmat6.cpp b/src/matrix/newmat6.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat6.cpp
rename to src/matrix/newmat6.cpp
diff --git a/ossim/src/ossim/matrix/newmat7.cpp b/src/matrix/newmat7.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat7.cpp
rename to src/matrix/newmat7.cpp
diff --git a/ossim/src/ossim/matrix/newmat8.cpp b/src/matrix/newmat8.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat8.cpp
rename to src/matrix/newmat8.cpp
diff --git a/ossim/src/ossim/matrix/newmat9.cpp b/src/matrix/newmat9.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmat9.cpp
rename to src/matrix/newmat9.cpp
diff --git a/ossim/src/ossim/matrix/newmatex.cpp b/src/matrix/newmatex.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmatex.cpp
rename to src/matrix/newmatex.cpp
diff --git a/ossim/src/ossim/matrix/newmatnl.cpp b/src/matrix/newmatnl.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmatnl.cpp
rename to src/matrix/newmatnl.cpp
diff --git a/ossim/src/ossim/matrix/newmatrm.cpp b/src/matrix/newmatrm.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/newmatrm.cpp
rename to src/matrix/newmatrm.cpp
diff --git a/ossim/src/ossim/matrix/nl_ex.txt b/src/matrix/nl_ex.txt
similarity index 100%
rename from ossim/src/ossim/matrix/nl_ex.txt
rename to src/matrix/nl_ex.txt
diff --git a/ossim/src/ossim/matrix/sl_ex.txt b/src/matrix/sl_ex.txt
similarity index 100%
rename from ossim/src/ossim/matrix/sl_ex.txt
rename to src/matrix/sl_ex.txt
diff --git a/ossim/src/ossim/matrix/solution.cpp b/src/matrix/solution.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/solution.cpp
rename to src/matrix/solution.cpp
diff --git a/ossim/src/ossim/matrix/sort.cpp b/src/matrix/sort.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/sort.cpp
rename to src/matrix/sort.cpp
diff --git a/ossim/src/ossim/matrix/submat.cpp b/src/matrix/submat.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/submat.cpp
rename to src/matrix/submat.cpp
diff --git a/ossim/src/ossim/matrix/svd.cpp b/src/matrix/svd.cpp
similarity index 100%
rename from ossim/src/ossim/matrix/svd.cpp
rename to src/matrix/svd.cpp
diff --git a/ossim/src/ossim/matrix/test_exc.txt b/src/matrix/test_exc.txt
similarity index 100%
rename from ossim/src/ossim/matrix/test_exc.txt
rename to src/matrix/test_exc.txt
diff --git a/ossim/src/ossim/matrix/watco_nt.mak b/src/matrix/watco_nt.mak
similarity index 100%
rename from ossim/src/ossim/matrix/watco_nt.mak
rename to src/matrix/watco_nt.mak
diff --git a/ossim/src/ossim/matrix/watcom.mak b/src/matrix/watcom.mak
similarity index 100%
rename from ossim/src/ossim/matrix/watcom.mak
rename to src/matrix/watcom.mak
diff --git a/src/ossimConfig.h.in b/src/ossimConfig.h.in
new file mode 100644
index 0000000..1bd86c9
--- /dev/null
+++ b/src/ossimConfig.h.in
@@ -0,0 +1,23 @@
+/*  $Id: ossimConfig.h.in 13607 2008-09-25 19:39:45Z gpotts $ */
+#ifndef ossimConfig_HEADER
+#define ossimConfig_HEADER
+
+/* Define to "1" if you have libz installed, "0" if not. */
+#define OSSIM_HAS_LIBZ @OSSIM_HAS_LIBZ@
+
+/* Define to "1" if you have MPI(lam/mpi), "0" if not. */
+#define OSSIM_HAS_MPI @OSSIM_HAS_MPI@
+
+/* Define to "1" if you have FREETYPE, "0" if not. */
+#define OSSIM_HAS_FREETYPE @OSSIM_HAS_FREETYPE@
+
+/* Define to "1" if you have GEOTIFF, "0" if not. */
+#define OSSIM_HAS_GEOTIFF @OSSIM_HAS_GEOTIFF@
+
+/* Define to "1" if you have HDF5 installed, "0" if not. */
+#define OSSIM_HAS_HDF5 @OSSIM_HAS_HDF5@
+
+/* Enable cvs id strings for use with "ident" application. */
+#define OSSIM_ID_ENABLED @OSSIM_ID_ENABLED@
+
+#endif /* End of "#ifndef ossimConfig_HEADER" */
diff --git a/src/ossimVersion.h.in b/src/ossimVersion.h.in
new file mode 100644
index 0000000..cc519ba
--- /dev/null
+++ b/src/ossimVersion.h.in
@@ -0,0 +1,14 @@
+#ifndef ossimVersion_HEADER
+#define ossimVersion_HEADER 1
+
+#define OSSIM_VERSION @OSSIM_VERSION_NUMBER@
+#define OSSIM_MAJOR_VERSION_NUMBER @OSSIM_MAJOR_VERSION_NUMBER@
+#define OSSIM_MINOR_VERSION_NUMBER @OSSIM_MINOR_VERSION_NUMBER@
+#define OSSIM_PATCH_VERSION_NUMBER @OSSIM_PATCH_VERSION_NUMBER@  
+#define OSSIM_RELEASE_NUMBER @OSSIM_RELEASE_NUMBER@  
+#define OSSIM_REVISION @OSSIM_REVISION@  
+
+// date format = (yyyymmdd)
+#define OSSIM_BUILD_DATE @OSSIM_BUILD_DATE@
+
+#endif /* End of #ifndef ossimVersion_HEADER */
diff --git a/ossim/src/ossim/parallel/ossimIgen.cpp b/src/parallel/ossimIgen.cpp
similarity index 100%
rename from ossim/src/ossim/parallel/ossimIgen.cpp
rename to src/parallel/ossimIgen.cpp
diff --git a/src/parallel/ossimImageChainMtAdaptor.cpp b/src/parallel/ossimImageChainMtAdaptor.cpp
new file mode 100644
index 0000000..4bad7fc
--- /dev/null
+++ b/src/parallel/ossimImageChainMtAdaptor.cpp
@@ -0,0 +1,489 @@
+//*************************************************************************************************
+//                                            OSSIM
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+//
+// This class supports multi-threading of image chain getTile() requests and associated chain
+// updating. It accepts an original ossimImageChain object which is then cloned (replicated). 
+// One replicant per thread is created (counting the original as replicant[0]), with all replicants
+// sharing a common input handler (if directed) so that disk access is serialized and thread-safe.
+//
+//*************************************************************************************************
+// $Id$
+
+#include <ossim/parallel/ossimImageChainMtAdaptor.h>
+#include <ossim/parallel/ossimMtDebug.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <iterator>
+
+static const char* NUM_THREADS_KW         = "ossimImageChainMtAdaptor.num_threads";
+static const char* ORIGINAL_SOURCE_ID_KW  = "ossimImageChainMtAdaptor.original_source_id";
+
+//*************************************************************************************************
+// Constructor.
+//*************************************************************************************************
+ossimImageChainMtAdaptor::ossimImageChainMtAdaptor()
+:  m_numThreads (0),
+   d_useSharedHandlers(false),
+   d_debugEnabled(false),
+   d_cacheTileSize(1024),
+   d_useCache(false)
+{
+   //###### DEBUG ############
+   ossimMtDebug* mt_debug = ossimMtDebug::instance();
+   //d_useSharedHandlers = mt_debug->chainSharedHandlers;
+   d_debugEnabled = mt_debug->chainDebugEnabled;
+   //###### END DEBUG ############
+}
+
+//*************************************************************************************************
+// Constructor with original image chain provided. This source becomes the first clone in the list.
+//*************************************************************************************************
+ossimImageChainMtAdaptor::ossimImageChainMtAdaptor(ossimImageChain* original,
+                                                   ossim_uint32 num_threads_req, bool use_shared_handlers, bool use_cache, ossim_uint32 cache_tile_size)
+:  m_numThreads (0),
+   d_useSharedHandlers(false),
+   d_debugEnabled(false),
+   d_cacheTileSize(1024),
+   d_useCache(false)
+{
+   //###### DEBUG ############
+   ossimMtDebug* mt_debug = ossimMtDebug::instance();
+   //d_useSharedHandlers = mt_debug->chainSharedHandlers;
+   d_debugEnabled = mt_debug->chainDebugEnabled;
+   //###### END DEBUG ############
+
+   setNumberOfThreads(num_threads_req); 
+   setUseSharedHandlers(use_shared_handlers);
+   setUseCache(use_cache);
+   setCacheTileSize(cache_tile_size);
+   setOriginalChain(original); 
+}
+
+//*************************************************************************************************
+// Destructor.
+//*************************************************************************************************
+ossimImageChainMtAdaptor::~ossimImageChainMtAdaptor()
+{
+  removeListener((ossimConnectableObjectListener*)this);
+  if (d_useSharedHandlers)
+    m_sharedHandlers[0]->disconnectAllOutputs();
+  m_clones.clear();
+  m_chainContainers.clear();
+  if (d_useSharedHandlers)
+  {
+    m_sharedHandlers[0]->close();
+    m_sharedHandlers[0] = 0;
+    m_sharedHandlers.clear();
+  }
+}
+
+//*************************************************************************************************
+//! Alternate way of specifying number of threads to support. This is the same as the number of 
+//! clones that will be available after replicating the original chain.
+//*************************************************************************************************
+void ossimImageChainMtAdaptor::setNumberOfThreads(ossim_uint32 num_threads)
+{
+   if (m_numThreads == num_threads)
+      return;
+
+   // Determine number of cores/threads to set up:
+   if (num_threads > 0)
+   {
+      m_numThreads = num_threads;
+   }
+   else
+   {
+      // Look in ossim preferences if arg is provided above.
+      ossimString value = ossimPreferences::instance()->findPreference("ossim_threads");
+      if ( !value.empty() )
+         m_numThreads = value.toUInt32();
+   }
+
+   // If there is a valid original chain, we can perform the replication:
+   if (!m_chainContainers.empty())
+      replicate();
+}
+ 
+void ossimImageChainMtAdaptor::setUseSharedHandlers(bool use_shared_handlers)
+{
+   d_useSharedHandlers = use_shared_handlers;
+}
+
+void ossimImageChainMtAdaptor::setCacheTileSize(ossim_uint32 cache_tile_size)
+{
+   d_cacheTileSize = cache_tile_size;
+}
+
+void ossimImageChainMtAdaptor::setUseCache(bool use_cache)
+{
+   d_useCache = use_cache;
+}
+
+//*************************************************************************************************
+//! Alternate way of specifying the original chain being adapted for multi-threading.
+//*************************************************************************************************
+void ossimImageChainMtAdaptor::setOriginalChain(ossimImageChain* original)
+{
+   if (original == NULL)
+      return;
+
+   ossimImageSource* first_source = original->getFirstSource();
+   if (first_source == NULL)
+      return;
+
+   // Assign the adaptee and put it in the first position of the clones list:
+   m_adaptedChain = original;
+   m_clones.clear();
+   m_clones.push_back(first_source);
+
+   m_chainContainers.clear();
+   m_chainContainers.push_back(new ossimConnectableContainer);
+   m_adaptedChain->fillContainer(*m_chainContainers[0].get());
+
+   // If we know the number of threads, we can begin replicating:
+   if (m_numThreads > 1)
+      replicate();
+}
+
+//*************************************************************************************************
+// Creates clones of the original and pushes them onto the clone list.
+//
+// Need to consider the possibility that the original chain is a combiner with multiple image 
+// handler inputs, and also the possibility that one handler is wired to multiple input chains
+// before the combiner. In order to handle this, we will save the connection information for each 
+// input handler encountered so that we can later reproduce it using a shared handler (if requested)
+//*************************************************************************************************
+bool ossimImageChainMtAdaptor::replicate()
+{
+   if ((m_clones.empty()) || (m_numThreads == 0))
+      return false;
+
+   // Don't need to replicate if only one thread is being requested. This is not an error though:
+   if (m_numThreads == 1)
+      return true;
+
+   // If the handlers are to be shared, need to isolate them from the original chain and replace
+   // them with a "hollow adaptor" (i.e., a handler adaptor without the adaptee set yet:
+   m_sharedHandlers.clear();
+   if (d_useSharedHandlers)
+   {
+      if (m_chainContainers.empty())
+         return false;
+
+      // Collect all image handlers in original chain for possible sharing with all clones:
+      ossimTypeNameVisitor visitor (ossimString("ossimImageHandler"));
+      m_chainContainers[0]->accept(visitor);
+      ossimRefPtr<ossimImageHandler> handler = 0;
+      ossimRefPtr<ossimImageHandlerMtAdaptor> handler_adaptor = 0;
+      ossimRefPtr<ossimConnectableObject> output_connection = 0;
+      ossim_uint32 handler_idx = 0;
+
+      // Loop over all image handlers found in the original chain. Each handler's connection info
+      // is stored and the handler is removed temporarily from the original chain.
+      while (1) 
+      {
+         // Fetch a handler from the chain and wrap it with a handler adaptor:
+         handler = visitor.getObjectAs<ossimImageHandler>(handler_idx++);
+         if (handler == NULL)
+            break; // Only exit point of while loop
+         
+         handler_adaptor = new ossimImageHandlerMtAdaptor(handler.get(), d_useCache, d_cacheTileSize);
+         m_sharedHandlers.push_back(handler_adaptor);
+
+         // Change ownership:
+         m_chainContainers[0]->removeChild(handler.get());
+         handler->changeOwner(this);
+      } 
+
+      // If no handler was found, we can't continue.
+      if (m_sharedHandlers.empty())
+         return false;
+   }
+
+   // Fetch the state of this and the original chain. This KWL will be used for creating replicas
+   // via the loadState. The saveState essentially bootstraps the replication task:
+   ossimKeywordlist kwl;
+   bool succeeded = saveState(kwl);
+
+   // The original chain may have had the handlers temporarily removed for the saveState in support
+   // of shared handlers. If so, need to restore them now:
+   if (d_useSharedHandlers)
+      succeeded = connectSharedHandlers(0);
+
+   // Finally, initialize THIS chain with the original chain's state. This call will also create
+   // the clones:
+   if (succeeded)
+      succeeded = loadState(kwl);
+
+   return succeeded;
+}
+
+//*************************************************************************************************
+// Deletes instances of all replicas from the clone list and leaves only the original.
+//*************************************************************************************************
+void ossimImageChainMtAdaptor::deleteReplicas()
+{
+   if (m_clones.size() > 1)
+   {
+      std::vector< ossimRefPtr<ossimImageSource> >::iterator first_copy = m_clones.begin();
+      first_copy++;
+      m_clones.erase(first_copy, m_clones.end());
+   }
+   m_numThreads = 1;
+}
+
+//*************************************************************************************************
+// Saves the state of the original chain along with number of clones present.
+//*************************************************************************************************
+bool ossimImageChainMtAdaptor::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   if (m_chainContainers.empty())
+      return false;
+
+   kwl.add(prefix, NUM_THREADS_KW, m_numThreads);
+   kwl.add(prefix, ORIGINAL_SOURCE_ID_KW, m_clones[0]->getId().getId());
+   
+   bool rtn_state = m_chainContainers[0]->saveState(kwl, prefix);
+
+   if (d_debugEnabled)
+      kwl.write("ossimImageChainMtAdaptor.kwl");
+
+   return rtn_state;
+}
+
+//*************************************************************************************************
+// Fetches the state of the original chain and regenerates the clones. Special handling is required
+// when the image handlers are to be shared among all clones.
+//*************************************************************************************************
+bool ossimImageChainMtAdaptor::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool succeeded;
+
+   // Reset this object:
+   deleteReplicas();
+
+   // Fetch this object's data members before moving onto original chain:
+   ossimString value = kwl.find(prefix, NUM_THREADS_KW);
+   if (value.empty())
+      return false;
+   m_numThreads = value.toUInt32();
+   if (m_numThreads == 0)
+      return false;
+
+   // The chain ID needs to be read from KWL:
+   ossimId orig_source_id (ossimId::INVALID_ID);
+   value = kwl.find(prefix, ORIGINAL_SOURCE_ID_KW);
+   if (value.empty())
+      return false;
+   orig_source_id.setId(value.toInt64());
+
+   // This loadState may be called for the purpose of replicating the existing original, or it can
+   // be intended as an adapter to a yet-to-be-instantiated original chain. Check if we already
+   // have a valid original chain:
+   ossimConnectableObject* candidate = 0;
+   ossimImageSource* original_source = 0;
+   if (!m_adaptedChain.valid() || m_chainContainers.empty())
+   {
+      m_chainContainers.clear();
+      m_chainContainers.push_back(new ossimConnectableContainer);
+      m_chainContainers[0]->loadState(kwl, prefix);
+
+      // Need to instantiate a new original. This is a bootstrap for a full initialization of this
+      // object. We'll need to replicate the clones afterwards:
+      ossimIdVisitor visitor (orig_source_id);
+      m_chainContainers[0]->accept(visitor);
+      candidate = visitor.getObject();
+      original_source = dynamic_cast<ossimImageSource*>(candidate);
+      if (original_source == NULL)
+         return false;
+      m_clones.push_back(original_source); // original is always in first position of clones list
+
+      // The original "chain" is morphed into a chain with a single child (original first source).
+      // This source is the one maintaining the connection to the rest of the sources in the real
+      // processing chain:
+      m_adaptedChain = new ossimImageChain;
+      m_adaptedChain->add(original_source);
+
+      // Now that we have an original chain, Recursive code to replicate clones:
+      succeeded = replicate();
+      if (!succeeded)
+         return false;
+   }
+
+   // We may be done:
+   if (m_numThreads == 1)
+      return true;
+
+   // In preparation for multi-threading jobs, loop to instantiate all clone chains. The container
+   // class is used to perform a deep copy of the original chain with all connections established.
+   // It would have been cleaner to just use the ossimImageChain::dup() but that method was not
+   // traversing the full chain, resulting in missing input sources:
+   succeeded = true;
+   for (ossim_uint32 i=1; (i<m_numThreads) && succeeded; ++i)
+   {
+      // Use original container's kwl to dup clone container, and pull out our chain of interest:
+      m_chainContainers.push_back(new ossimConnectableContainer);
+      m_chainContainers[i]->loadState(kwl, prefix);
+      
+      // Special handling required if the handlers are being shared. In this case, the handler had
+      // been removed from the original chain, so connections need to be identified and made:
+      if (d_useSharedHandlers)
+      {
+         succeeded = connectSharedHandlers(i);
+         if (!succeeded)
+            return false;
+      }
+
+      // Find the first (right-most) source in the chain and store it in the clone list. Need to
+      // Modify all IDs
+      ossimIdVisitor visitor (orig_source_id);
+      m_chainContainers[i]->accept(visitor);
+      candidate = visitor.getObject();
+      m_chainContainers[i]->makeUniqueIds();
+      ossimRefPtr<ossimImageSource> clone_source = dynamic_cast<ossimImageSource*>(candidate);
+      if (clone_source == NULL)
+         return false;
+      m_clones.push_back(clone_source);
+   }
+
+   return succeeded;
+}
+
+//*************************************************************************************************
+//! Adapts call to original chain so that all clones are initialized.
+//*************************************************************************************************
+void ossimImageChainMtAdaptor::initialize()
+{
+   for (size_t i=0; i<m_clones.size(); ++i)
+      m_clones[i]->initialize();
+}
+
+//*************************************************************************************************
+// Intercept this getTile because it should never be called directly. The tile request must go
+// to the specific chain clone.
+//*************************************************************************************************
+ossimRefPtr<ossimImageData> ossimImageChainMtAdaptor::getTile(const ossimIrect& tileRect,
+                                                                       ossim_uint32 resLevel)
+{
+   ossimNotify(ossimNotifyLevel_WARN)<<"ossimImageChainMtAdaptor::getTile() -- This method "
+      "Should never be called directly. The tile request must go to the specific chain clone. "
+      "Returning a tile using the original chain's getTile (not threaded)..."<<endl;
+   
+   if (!m_adaptedChain.valid())
+      return ossimRefPtr<ossimImageData>(0);
+      
+   return m_adaptedChain->getTile(tileRect, resLevel);
+}
+
+//*************************************************************************************************
+// Manages reconnecting shared image handlers to an image chain after its creation.
+// This is in support of shared image handlers. Returns TRUE if successful.
+//*************************************************************************************************
+bool ossimImageChainMtAdaptor::connectSharedHandlers(ossim_uint32 chain_index)
+{
+   if ((size_t)chain_index >= m_chainContainers.size())
+      return false;
+
+   // Loop over each adapted handler in our shared handler list:
+   SharedHandlerList::iterator handler = m_sharedHandlers.begin();
+   while (handler != m_sharedHandlers.end())
+   {
+      // Fetch all objects connected to this adapted handler. The list will point to objects in
+      // m_chainContainers[0], the original chain. The new chain's objects share the same ID's as
+      // the original chain for the moment. So we can search for the output connection 
+      // in the new chain using the ID of the corresponding object in the original chain:
+      ConnectableObjectList handler_connections = (*handler)->getOutputList();
+      ConnectableObjectList::iterator output_connection = handler_connections.begin();
+      // BUG HERE AFTER UPGRADING FROM 1.8.14 to 1.8.20 - only grabbing the first output connection
+      //while (output_connection != handler_connections.end())
+      //{
+         ossimId obj_id = (*output_connection)->getId();
+         ossimIdVisitor visitor (obj_id);
+         m_chainContainers[chain_index]->accept(visitor);
+
+         // Get the pointer to the actual output object that needs to be connected to the shared
+         // handler:
+         ossimConnectableObject* output_obj = visitor.getObject();
+         if (output_obj == NULL)
+            return false; // Should never happen
+         output_obj->connectMyInputTo((*handler).get(), true, true);
+
+         output_connection++;
+      //}
+      handler++;
+   }
+   return true;
+}
+
+
+//*************************************************************************************************
+// Adapts base class method for accessing connectables in the original chain.
+//*************************************************************************************************
+ossimConnectableObject::ConnectableObjectList& ossimImageChainMtAdaptor::imageChainList()
+{
+   // If there is no original chain defined, then just return our own blank list:
+   if (!m_adaptedChain.valid())
+      return theImageChainList;
+
+   return m_adaptedChain->imageChainList();
+}
+
+//*************************************************************************************************
+// Adapts base class method for accessing connectables in the original chain.
+//*************************************************************************************************
+const ossimConnectableObject::ConnectableObjectList& 
+   ossimImageChainMtAdaptor::imageChainList()const
+{
+   // If there is no original chain defined, then just return our own blank list:
+   if (!m_adaptedChain.valid())
+      return theImageChainList;
+
+   return m_adaptedChain->imageChainList();
+}
+
+//*************************************************************************************************
+//! Adapts the image chain event handler. If the event involves a change to the original image 
+//! chain, then the clones will need to be regenerated here.
+//*************************************************************************************************
+void ossimImageChainMtAdaptor::processEvent(ossimEvent& /* event */)
+{
+   ossimNotify(ossimNotifyLevel_WARN)<<"ossimImageChainMtAdaptor::processEvent() -- "
+      "NOT YET IMPLEMENTED"<<endl;
+}
+
+//*************************************************************************************************
+ossimImageSource* ossimImageChainMtAdaptor::getClone(ossim_uint32 index)
+{
+   if (index < (ossim_uint32) m_clones.size())
+      return m_clones[index].get();
+   
+   return 0;
+}
+
+//*************************************************************************************************
+//! Overrides base class implementation in order to make the connection to each clone. This 
+//! connection is typically to the multi-thread sequencer object.
+//*************************************************************************************************
+ossim_int32 ossimImageChainMtAdaptor::connectMyOutputTo(ossimConnectableObject* outputObject,
+                                                        bool makeInputConnection,
+                                                        bool createEventFlag)
+{
+   // Make output connection for each clone source:
+   std::vector< ossimRefPtr<ossimImageSource> >::iterator clone_source = m_clones.begin();
+   while (clone_source != m_clones.end())
+   {
+      (*clone_source)->connectMyOutputTo(outputObject, false, false);
+      clone_source++;
+   }
+
+   // Now make master connection including making input connection on outputObject and firing event:
+   return ossimConnectableObject::connectMyOutputTo(outputObject, 
+                                                    makeInputConnection, 
+                                                    createEventFlag);
+}
diff --git a/src/parallel/ossimImageHandlerMtAdaptor.cpp b/src/parallel/ossimImageHandlerMtAdaptor.cpp
new file mode 100644
index 0000000..8a10e66
--- /dev/null
+++ b/src/parallel/ossimImageHandlerMtAdaptor.cpp
@@ -0,0 +1,438 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+//! Intended mainly to provide a mechanism for mutex-locking access to a shared resource during
+//! a getTile operation on an ossimImageHandler. This is needed for multi-threaded implementation.
+// 
+//**************************************************************************************************
+//  $Id$
+#include <ossim/parallel/ossimImageHandlerMtAdaptor.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+  // #include <ossim/parallel/ossimMtDebug.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/base/ossimTrace.h>
+#include <cstdio>
+#include <ctime>
+// #include <sys/time.h>
+
+RTTI_DEF1(ossimImageHandlerMtAdaptor, "ossimImageHandlerMtAdaptor", ossimImageHandler);
+
+const char* ossimImageHandlerMtAdaptor::ADAPTEE_ID_KW = "adaptee_id";
+static ossimTrace traceDebug = ossimTrace("ossimImageHandlerMtAdaptor:debug");
+
+//**************************************************************************************************
+// Constructor
+//**************************************************************************************************
+ossimImageHandlerMtAdaptor::ossimImageHandlerMtAdaptor(ossimImageHandler* adaptee, bool use_cache, ossim_uint32 cache_tile_size)
+   :  d_getTileT (0),
+      d_cacheTileSize(1024),
+      m_adaptedHandler (0),
+      m_cache (0),
+      d_useCache (false),
+      d_useFauxTile (false)
+{
+   //###### DEBUG ############
+   // ossimMtDebug* mt_debug = ossimMtDebug::instance();
+   //d_useCache = mt_debug->handlerCacheEnabled;
+   //d_useFauxTile = mt_debug->handlerUseFauxTile;
+   //###### END DEBUG ############
+
+   setUseCache(use_cache);
+   setCacheTileSize(cache_tile_size);
+   setAdaptee(adaptee);
+}
+
+//**************************************************************************************************
+// Destructor
+//**************************************************************************************************
+ossimImageHandlerMtAdaptor::~ossimImageHandlerMtAdaptor()
+{
+   m_adaptedHandler = 0;
+   m_cache = 0;
+   d_fauxTile = 0;
+}
+
+//**************************************************************************************************
+//! Sets the handler being adapted.
+//**************************************************************************************************
+void ossimImageHandlerMtAdaptor::setAdaptee(ossimImageHandler* handler)
+{
+   m_adaptedHandler = handler;
+   if (handler == NULL)
+      return;
+
+   // Fetch the adaptee's output list and make it our own:
+   ConnectableObjectList output_list = handler->getOutputList();
+
+   if (d_useCache)
+   {
+      // Create the cache and connect this adaptor as its output:
+      m_cache = new ossimCacheTileSource;
+      m_cache->setTileSize(ossimIpt(d_cacheTileSize, d_cacheTileSize));
+      m_cache->connectMyOutputTo(this, true, false);
+      m_cache->changeOwner(this);
+      //m_cache->connectMyOutputTo(this, true, false);
+      handler->disconnectMyOutputs(output_list, true, false);
+      handler->connectMyOutputTo(m_cache.get(), true, true);
+   }
+   else
+   {
+      handler->disconnectMyOutputs(output_list, true, false);
+      handler->connectMyOutputTo(this, true, false);
+   }
+
+   // Finally connect the adaptee's outputs to this and fire connection events:
+   connectMyOutputTo(output_list, true, true);
+   handler->changeOwner(this);
+
+   if (d_useFauxTile)
+   {
+      d_fauxTile = (ossimImageData*) handler->getTile(ossimIpt(0,0), 0)->dup();
+      //d_fauxTile = new ossimImageData(this, 
+      //                                handler->getOutputScalarType(), 
+      //                                handler->getNumberOfOutputBands(),
+      //                                handler->getTileWidth(),
+      //                                handler->getTileHeight());
+      //d_fauxTile->fill(128.0);
+   }
+}
+
+//**************************************************************************************************
+//! Only an ossimImageHandler is allowed as input here.
+//**************************************************************************************************
+bool ossimImageHandlerMtAdaptor::canConnectMyInputTo(ossim_int32 inputIndex,
+                                                     const ossimConnectableObject* obj) const
+{
+   const ossimImageHandler* h = dynamic_cast<const ossimImageHandler*>(obj);
+   if ((inputIndex == 0) && (h != NULL))
+      return true;
+   return false;
+}
+
+
+//**************************************************************************************************
+//! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
+//! adaptee's getTile call.
+//**************************************************************************************************
+ossimRefPtr<ossimImageData> 
+   ossimImageHandlerMtAdaptor::getTile(const ossimIpt& origin, ossim_uint32 rLevel)
+{
+   if (!m_adaptedHandler.valid())
+      return NULL;
+
+   // Establish tile rect to call overloaded getTile(tile_rect):
+   ossim_uint32 h = m_adaptedHandler->getTileHeight();
+   ossim_uint32 w = m_adaptedHandler->getTileWidth();
+   ossimIpt lr (origin.x + w - 1, origin.y + h - 1);
+   ossimIrect tile_rect (origin, lr);
+
+   // Need to unlock to prevent freezing in the called getTile():
+   return getTile(tile_rect, rLevel);
+}
+
+//**************************************************************************************************
+//! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
+//! adaptee's getTile call.
+//**************************************************************************************************
+ossimRefPtr<ossimImageData>  
+   ossimImageHandlerMtAdaptor::getTile(const ossimIrect& tile_rect, ossim_uint32 rLevel)
+{
+   if (traceDebug())
+   {
+       std::cout << "TILE: " << tile_rect << std::endl;
+   }
+
+   if (d_useFauxTile)
+   {
+      ossimRefPtr<ossimImageData> ftile = new ossimImageData(*(d_fauxTile.get()));
+      ftile->setOrigin(tile_rect.ul());
+      return ftile;
+   }
+
+   if (!m_adaptedHandler.valid())
+      return NULL;
+
+   // The sole purpose of the adapter is this mutex lock around the actual handler getTile:
+   //OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+
+   ossimRefPtr<ossimImageData> tile = new ossimImageData();
+   ossimRefPtr<ossimImageData> temp_tile = 0;
+   double dt = ossimTimer::instance()->time_s();
+
+   //writeTime();
+   if (traceDebug())
+   {
+     std::cout << "WAIT LOCK: " << tile_rect << std::endl;
+   }
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+
+   if (traceDebug())
+   {
+     std::cout << "START LOCK: " << tile_rect << std::endl;
+   }
+
+   if (d_useCache)
+      temp_tile = m_cache->getTile(tile_rect, rLevel);
+   else
+      temp_tile = m_adaptedHandler->getTile(tile_rect, rLevel);
+   d_getTileT += ossimTimer::instance()->time_s() - dt;
+
+   // We make our own instance of a tile and copy the adaptee's returned tile to it. This avoids
+   // the product tile from changing while being processed up the chain. The adaptee's tile can
+   // change as soon as the mutex lock is released:
+   
+   if (temp_tile.valid())
+      *tile = *(temp_tile.get());
+   else
+      tile = NULL;
+
+   //writeTime();
+   if (traceDebug())
+   {
+      std::cout << "END LOCK: " << tile_rect << std::endl;
+   }
+   if (traceDebug())
+   {
+       std::cout << "END TILE: " << tile_rect << std::endl;
+   }
+
+   return tile;
+}
+
+//**************************************************************************************************
+//! Intercepts the getTile call intended for the adaptee and sets a mutex lock around the
+//! adaptee's getTile call.
+//**************************************************************************************************
+bool ossimImageHandlerMtAdaptor::getTile(ossimImageData* tile, ossim_uint32 rLevel)
+{
+   if ((!m_adaptedHandler.valid()) || (tile == NULL))
+      return false;
+
+   // The sole purpose of the adapter is this mutex lock around the actual handler getTile:
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_mutex);
+
+   // This is effectively a copy of ossimImageSource::getTile(ossimImageData*). It is reimplemented 
+   // here to save two additional function calls:
+   tile->ref();
+   bool status = true;
+   ossimIrect tile_rect = tile->getImageRectangle();
+
+   ossimRefPtr<ossimImageData> temp_tile = 0;
+   if (d_useCache)
+      temp_tile = m_cache->getTile(tile_rect, rLevel);
+   else
+      temp_tile = m_adaptedHandler->getTile(tile_rect, rLevel);
+   
+   if (temp_tile.valid())
+      *tile = *(temp_tile.get());
+   else
+      status = false;
+   tile->unref();
+   
+   return status;
+}
+
+//**************************************************************************************************
+//! Method to save the state of an object to a keyword list.
+//! Return true if ok or false on error.
+//**************************************************************************************************
+bool ossimImageHandlerMtAdaptor::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   if (!m_adaptedHandler.valid())
+      return false;
+   
+   // Skip the ossimImageHandler::saveState() since it is not necessary here:
+   ossimImageSource::saveState(kwl, prefix);
+
+   kwl.add(prefix, ADAPTEE_ID_KW, m_adaptedHandler->getId().getId());
+
+   return true;
+}
+
+//**************************************************************************************************
+//! Method to the load (recreate) the state of an object from a keyword
+//! list.  Return true if ok or false on error.
+//**************************************************************************************************
+bool ossimImageHandlerMtAdaptor::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   m_adaptedHandler = 0;
+
+   // Skip the ossimImageHandler::loadState() since it is not necessary here:
+   if (!ossimImageSource::loadState(kwl, prefix))
+      return false;
+
+   // The adaptee's ID at least will be in the KWL:
+   ossimString value = kwl.find(prefix, ADAPTEE_ID_KW);
+   if (value.empty())
+      return false;
+   
+   return true;
+}
+
+//**************************************************************************************************
+// The following are virtuals in the base class. Implemented here as pass-through to adaptee
+//**************************************************************************************************
+ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfInputBands() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getNumberOfInputBands();
+   return 0;
+}
+
+bool ossimImageHandlerMtAdaptor::isOpen() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->isOpen();
+   return false;
+}
+
+bool ossimImageHandlerMtAdaptor::open()
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->open();
+   return false;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getNumberOfLines(resLevel);
+   return 0;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getNumberOfSamples(resLevel);
+   return 0;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getImageTileWidth() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getImageTileWidth();
+   return 0;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getImageTileHeight() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getImageTileHeight();
+   return 0;
+}
+
+ossimString ossimImageHandlerMtAdaptor::getLongName() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getLongName();
+   return ossimString();
+}
+
+ossimString ossimImageHandlerMtAdaptor::getShortName() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getShortName();
+   return ossimString();
+}
+
+void ossimImageHandlerMtAdaptor::close()
+{
+   removeListener((ossimConnectableObjectListener*)this);
+   this->disconnectAllOutputs();
+   m_cache = 0;
+   if (m_adaptedHandler.valid())
+   {
+       m_adaptedHandler->closeOverview();
+       m_adaptedHandler->close();
+   }
+   d_fauxTile = 0;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfOutputBands() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getNumberOfOutputBands();
+   return 0;
+}
+
+void ossimImageHandlerMtAdaptor::setUseCache(bool use_cache)
+{
+   d_useCache = use_cache;
+}
+
+void ossimImageHandlerMtAdaptor::setCacheTileSize(ossim_uint32 cache_tile_size)
+{
+   d_cacheTileSize = cache_tile_size;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getNumberOfDecimationLevels() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getNumberOfDecimationLevels();
+   return 0;
+}
+
+void ossimImageHandlerMtAdaptor::writeTime() const
+{
+#if 0  /* not portable (drb) */
+   struct timeval tv;
+   struct timezone tz;
+   struct tm *tm;
+   gettimeofday(&tv, &tz);
+   tm=localtime(&tv.tv_sec);
+   printf("%d:%02d:%02d.%ld ", tm->tm_hour, tm->tm_min,tm->tm_sec,tv.tv_usec);
+#endif
+   // Sorry no usecs...
+   time_t rawTime = (time_t)ossim::getTime();
+   char buf[9];
+   strftime(buf, 9, "%H:%M:%S", gmtime(&rawTime));
+   cerr << buf << std::endl;
+}
+
+ossimScalarType ossimImageHandlerMtAdaptor::getOutputScalarType() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getOutputScalarType();
+   return OSSIM_SCALAR_UNKNOWN;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getTileWidth() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getTileWidth();
+   return 0;
+}
+
+ossim_uint32 ossimImageHandlerMtAdaptor::getTileHeight() const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getTileHeight();
+   return 0;
+}
+
+ossim_float64 ossimImageHandlerMtAdaptor::getMinPixelValue(ossim_uint32 band) const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getMinPixelValue(band);
+   return 0.0;
+}
+
+ossim_float64 ossimImageHandlerMtAdaptor::getMaxPixelValue(ossim_uint32 band) const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getMaxPixelValue(band);
+   return 0.0;
+}
+
+ossim_float64 ossimImageHandlerMtAdaptor::getNullPixelValue(ossim_uint32 band) const
+{
+   if (m_adaptedHandler.valid())
+      return m_adaptedHandler->getNullPixelValue(band);
+   return 0.0;
+}
+
diff --git a/src/parallel/ossimImageMpiMWriterSequenceConnection.cpp b/src/parallel/ossimImageMpiMWriterSequenceConnection.cpp
new file mode 100644
index 0000000..18f9162
--- /dev/null
+++ b/src/parallel/ossimImageMpiMWriterSequenceConnection.cpp
@@ -0,0 +1,291 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// This class is specific to the Master connection and is optimized
+// for the writer sequence and batch processing chain.  For the Slave
+// implementation look for the ossimImageMpiSWriterSequenceConnection.cc and .h
+// files.  The Master connection is currently implemented to allways do
+// a recieve and does no processing itself.  The slave connection does
+// all the actual work and processing.
+//
+//*******************************************************************
+//  $Id: ossimImageMpiMWriterSequenceConnection.cpp 12099 2007-12-01 16:09:36Z dburken $
+
+
+#include <ossim/ossimConfig.h> /* To pick up OSSIM_HAS_MPI. */
+
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI
+#    include <mpi.h>
+#  endif
+#endif
+
+#include <ossim/parallel/ossimImageMpiMWriterSequenceConnection.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimEndian.h>
+
+static ossimTrace traceDebug = ossimTrace("ossimImageMpiMWriterSequenceConnection:debug");
+
+RTTI_DEF1(ossimImageMpiMWriterSequenceConnection, "ossimImageMpiMWriterSequenceConnection", ossimImageSourceSequencer)
+
+
+ossimImageMpiMWriterSequenceConnection::ossimImageMpiMWriterSequenceConnection(
+   ossimImageSource* inputSource,
+   ossimObject* owner)
+   :ossimImageSourceSequencer(inputSource, owner),
+    theOutputTile(NULL)
+{
+   theRank = 0;
+   theNumberOfProcessors = 1;
+
+#ifdef OSSIM_HAS_MPI   
+#  if OSSIM_HAS_MPI
+   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
+   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
+#  endif
+#endif   
+
+   if(theRank!=0)
+   {
+      theCurrentTileNumber = theRank -1;
+   }
+   else
+   {
+      theCurrentTileNumber = 0;
+   }
+   theNeedToSendRequest = true;
+}
+
+ossimImageMpiMWriterSequenceConnection::ossimImageMpiMWriterSequenceConnection(ossimObject* owner)
+   :ossimImageSourceSequencer(NULL, owner),
+    theOutputTile(NULL)
+{
+   theRank = 0;
+   theNumberOfProcessors = 1;
+   
+#ifdef OSSIM_HAS_MPI     
+#  if OSSIM_HAS_MPI
+   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
+   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
+#  endif
+#endif
+   
+   if(theRank!=0)
+   {
+      theCurrentTileNumber = theRank -1;
+   }
+   else
+   {
+      theCurrentTileNumber = 0;
+   }
+   theNeedToSendRequest = true;
+}
+
+ossimImageMpiMWriterSequenceConnection::~ossimImageMpiMWriterSequenceConnection()
+{
+}
+
+void ossimImageMpiMWriterSequenceConnection::initialize()
+{
+  ossimImageSourceSequencer::initialize();
+
+  theCurrentTileNumber = theRank;//-1;
+  theOutputTile = NULL;
+  
+  if(theInputConnection)
+  {
+     theOutputTile = ossimImageDataFactory::instance()->create(this, this);
+     theOutputTile->initialize();
+  }
+}
+
+void ossimImageMpiMWriterSequenceConnection::setToStartOfSequence()
+{
+   ossimImageSourceSequencer::setToStartOfSequence();
+   if(theRank != 0)
+   {
+      // we will subtract one since the masters job is just
+      // writting and not issue getTiles.
+      theCurrentTileNumber = theRank-1;
+
+   }
+   else
+   {
+      // the master will start at 0
+      theCurrentTileNumber = 0;
+   }
+}
+
+/*!
+ * Will allow you to get the next tile in the sequence.
+ */
+ossimRefPtr<ossimImageData> ossimImageMpiMWriterSequenceConnection::getNextTile(ossim_uint32 resLevel)
+{
+#if OSSIM_HAS_MPI
+   ossimEndian endian;
+   if(!theOutputTile)
+   {
+      initialize();
+      if (!theOutputTile)
+      {
+         return theOutputTile;
+      }
+   }
+   
+   void* buf = theOutputTile->getBuf();
+
+   ossim_uint32 numberOfTiles = getNumberOfTiles();
+   int errorValue = 0;
+   
+   if(theCurrentTileNumber >= numberOfTiles)
+   {
+      return NULL;
+   }
+   errorValue = MPI_Recv(buf,
+                         theOutputTile->getSizeInBytes(),
+                         MPI_UNSIGNED_CHAR,
+                         theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                         0,
+                         MPI_COMM_WORLD,
+                         MPI_STATUS_IGNORE);
+   if((endian.getSystemEndianType()!=OSSIM_BIG_ENDIAN)&&
+      (theOutputTile->getScalarType()!=OSSIM_UINT8))
+   {
+      endian.swap(theOutputTile->getScalarType(),
+                  buf,
+                  theOutputTile->getSize());
+   }
+   
+#if 0
+   // Since MPI can run on different platforms
+   // I am not sure if MPI has built in byte
+   // swap.  If so I will name each datatype
+   // so it can handle byte swap.  Does anyone
+   // know if MPI does byte swapping.
+   switch(theOutputTile->getScalarType())
+   {
+      case OSSIM_UINT8:
+      {
+         // we add 1 to the rank so we don't wait on a message
+         // to ourself (rank = 0).
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_UNSIGNED_CHAR,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      case OSSIM_SINT8:
+      {
+         // we add 1 to the rank so we don't wait on a message
+         // to ourself (rank = 0).
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_CHAR,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      case OSSIM_UINT16:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      {
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_UNSIGNED_SHORT,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      case OSSIM_SINT16:
+      {
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_SHORT,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      case OSSIM_SINT32:
+      {
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_LONG,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      case OSSIM_UINT32:
+      {
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_UNSIGNED_LONG,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      case OSSIM_FLOAT32:
+      case OSSIM_NORMALIZED_FLOAT:
+      {
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_FLOAT,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      case OSSIM_FLOAT64:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         errorValue = MPI_Recv(buf,
+                               theOutputTile->getSize(),
+                               MPI_DOUBLE,
+                               theCurrentTileNumber%(theNumberOfProcessors-1)+1,
+                               0,
+                               MPI_COMM_WORLD,
+                               MPI_STATUS_IGNORE);
+         break;
+      }
+      default:
+      {
+         break;
+      }
+   }
+#endif
+   ossimIpt origin;
+   getTileOrigin(theCurrentTileNumber,
+                 origin);
+   theOutputTile->setOrigin(origin);
+   theOutputTile->validate();
+   ++theCurrentTileNumber;
+   return theOutputTile;
+#else
+   return ossimImageSourceSequencer::getNextTile(resLevel);
+#endif
+   
+}
diff --git a/src/parallel/ossimImageMpiSWriterSequenceConnection.cpp b/src/parallel/ossimImageMpiSWriterSequenceConnection.cpp
new file mode 100644
index 0000000..6848729
--- /dev/null
+++ b/src/parallel/ossimImageMpiSWriterSequenceConnection.cpp
@@ -0,0 +1,350 @@
+//----------------------------------------------------------------------------
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// $Id: ossimImageMpiSWriterSequenceConnection.cpp 17206 2010-04-25 23:20:40Z dburken $
+//----------------------------------------------------------------------------
+
+#include <ossim/ossimConfig.h> /* To pick up OSSIM_HAS_MPI. */
+
+#ifdef OSSIM_HAS_MPI
+#  if OSSIM_HAS_MPI
+#    include <mpi.h>
+#  endif
+#endif
+
+#include <ossim/parallel/ossimImageMpiSWriterSequenceConnection.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+static ossimTrace traceDebug = ossimTrace("ossimImageMpiSWriterSequenceConnection:debug");
+
+RTTI_DEF1(ossimImageMpiSWriterSequenceConnection, "ossimImageMpiSWriterSequenceConnection", ossimImageSourceSequencer)
+
+ossimImageMpiSWriterSequenceConnection::ossimImageMpiSWriterSequenceConnection(ossimObject* owner,
+                                                                               long numberOfTilesToBuffer)
+   :ossimImageSourceSequencer(NULL,
+                              owner),
+    theNumberOfTilesToBuffer(numberOfTilesToBuffer),
+    theOutputTile(NULL)
+{
+   theRank = 0;
+   theNumberOfProcessors = 1;
+   theNumberOfTilesToBuffer = ((theNumberOfTilesToBuffer>0)?theNumberOfTilesToBuffer:2);
+
+#ifdef OSSIM_HAS_MPI   
+#  if OSSIM_HAS_MPI
+   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
+   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
+#  endif
+#endif
+   
+   if(theRank!=0)
+   {
+      theCurrentTileNumber = theRank -1;
+   }
+   else
+   {
+      theCurrentTileNumber = 0;
+   }
+}
+
+ossimImageMpiSWriterSequenceConnection::ossimImageMpiSWriterSequenceConnection(ossimImageSource* inputSource,
+                                                                               ossimObject* owner,
+                                                                               long numberOfTilesToBuffer)
+   :ossimImageSourceSequencer(inputSource,
+                                 owner),
+    theNumberOfTilesToBuffer(numberOfTilesToBuffer),
+    theOutputTile(NULL)
+{
+   theRank = 0;
+   theNumberOfProcessors = 1;
+   theNumberOfTilesToBuffer = ((theNumberOfTilesToBuffer>0)?theNumberOfTilesToBuffer:2);
+#if OSSIM_HAS_MPI
+   MPI_Comm_rank(MPI_COMM_WORLD, &theRank);
+   MPI_Comm_size(MPI_COMM_WORLD, &theNumberOfProcessors);
+#endif
+   if(theRank!=0)
+   {
+      theCurrentTileNumber = theRank -1;
+   }
+   else
+   {
+      theCurrentTileNumber = 0;
+   }   
+}
+
+ossimImageMpiSWriterSequenceConnection::~ossimImageMpiSWriterSequenceConnection()
+{   
+   deleteOutputTiles();
+}
+
+void ossimImageMpiSWriterSequenceConnection::deleteOutputTiles()
+{
+   if(theOutputTile)
+   {
+      delete [] theOutputTile;
+      theOutputTile = NULL;
+   }
+}
+
+void ossimImageMpiSWriterSequenceConnection::initialize()
+{
+  ossimImageSourceSequencer::initialize();
+
+  theCurrentTileNumber = theRank-1;
+  if(theOutputTile)
+  {
+     deleteOutputTiles();
+  }
+  
+  if(theInputConnection)
+  {
+     theOutputTile = new ossimRefPtr<ossimImageData>[theNumberOfTilesToBuffer];
+     
+     for(long index = 0; index < theNumberOfTilesToBuffer; ++index)
+     {
+        theOutputTile[index] = ossimImageDataFactory::instance()->create(this,
+                                                                         this);
+        theOutputTile[index]->initialize();
+     }
+  }
+}
+
+void ossimImageMpiSWriterSequenceConnection::setToStartOfSequence()
+{
+   ossimImageSourceSequencer::setToStartOfSequence();
+   if(theRank != 0)
+   {
+      // we will subtract one since the masters job is just
+      // writting and not issue getTiles.
+      theCurrentTileNumber = theRank-1;
+
+   }
+   else
+   {
+      // the master will start at 0
+      theCurrentTileNumber = 0;
+   }
+}
+
+void ossimImageMpiSWriterSequenceConnection::slaveProcessTiles()
+{
+#ifdef OSSIM_HAS_MPI 
+#  if OSSIM_HAS_MPI
+   ossimEndian endian;
+   ossim_uint32 numberOfTiles    = getNumberOfTiles();
+   long currentSendRequest = 0;
+   //long numberOfTilesSent  = 0;
+   int errorValue= 0;
+   MPI_Request *requests   = new MPI_Request[theNumberOfTilesToBuffer];
+   for (int i = 0; i < theNumberOfTilesToBuffer; ++i)
+   {
+      requests[i] = MPI_REQUEST_NULL;
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): entering slave and will look at " << numberOfTiles << " tiles" << std::endl;
+   }
+   while(theCurrentTileNumber < numberOfTiles)
+   {
+      ossimRefPtr<ossimImageData> data = ossimImageSourceSequencer::getTile(theCurrentTileNumber);
+
+      // if the current send requests have looped around
+      // make sure we wait to see if it was sent
+      //
+      errorValue = MPI_Wait(&requests[currentSendRequest], MPI_STATUS_IGNORE);
+      requests[currentSendRequest] = MPI_REQUEST_NULL;
+      if(data.valid() &&
+         (data->getDataObjectStatus()!=OSSIM_NULL)&&
+         (data->getDataObjectStatus()!=OSSIM_EMPTY))
+      {
+         theOutputTile[currentSendRequest]->setImageRectangle(data->getImageRectangle());
+         theOutputTile[currentSendRequest]->initialize();
+         
+         theOutputTile[currentSendRequest]->loadTile(data.get());
+         theOutputTile[currentSendRequest]->setDataObjectStatus(data->getDataObjectStatus());
+
+         if(traceDebug())
+         {
+            if(data->getDataObjectStatus() == OSSIM_EMPTY)
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In salve = "
+                  << theRank << " tile is empty" << std::endl;
+            }
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            if(!data)
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In slave = "
+                  << theRank << " ptr is null " << std::endl;
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG ossimImageMpiSWriterSequenceConnection::slaveProcessTiles(): In slave = " << theRank << " tile is empty" << std::endl;
+            }
+         }
+         theOutputTile[currentSendRequest]->makeBlank();
+      }
+
+      void* buf = theOutputTile[currentSendRequest]->getBuf();
+      if((endian.getSystemEndianType()!=OSSIM_BIG_ENDIAN)&&
+         (theOutputTile[currentSendRequest]->getScalarType()!=OSSIM_UINT8))
+      {
+         endian.swap(theOutputTile[currentSendRequest]->getScalarType(),
+                     buf,
+                     theOutputTile[currentSendRequest]->getSize());
+      }
+      errorValue = MPI_Isend(buf,
+                             theOutputTile[currentSendRequest]->getSizeInBytes(),
+                             MPI_UNSIGNED_CHAR,
+                             0,
+                             0,
+                             MPI_COMM_WORLD,
+                             &requests[currentSendRequest]);
+#if 0      
+      switch(theOutputTile[currentSendRequest]->getScalarType())
+      {
+         case OSSIM_UINT8:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_UNSIGNED_CHAR,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         case OSSIM_SINT8:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_CHAR,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         case OSSIM_UINT16:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_UNSIGNED_SHORT,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         case OSSIM_SINT16:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_SHORT,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         case OSSIM_UINT32:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_UNSIGNED_LONG,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         case OSSIM_SINT32:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_LONG,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         case OSSIM_FLOAT32:
+         case OSSIM_NORMALIZED_FLOAT:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_FLOAT,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         case OSSIM_FLOAT64:
+         case OSSIM_NORMALIZED_DOUBLE:
+         {
+            errorValue = MPI_Isend(buf,
+                                    theOutputTile[currentSendRequest]->getSize(),
+                                    MPI_DOUBLE,
+                                    0,
+                                    0,
+                                    MPI_COMM_WORLD,
+                                    &requests[currentSendRequest]);
+            break;
+         }
+         default:
+            break;
+      }
+#endif
+      theCurrentTileNumber += (theNumberOfProcessors-1);
+      //numberOfTilesSent++;
+      currentSendRequest++;
+      currentSendRequest %= theNumberOfTilesToBuffer;
+   }
+   ossim_int32 tempCount = 0;
+   // must wait in the correct order
+   //
+   while(tempCount < theNumberOfTilesToBuffer)
+   {
+      errorValue = MPI_Wait(&requests[currentSendRequest], MPI_STATUS_IGNORE);
+      currentSendRequest++;
+      currentSendRequest %= theNumberOfTilesToBuffer;
+      
+      ++tempCount;
+   }
+   
+//   MPI_Waitall(theNumberOfTilesToBuffer,
+//               requests,
+//               MPI_STATUS_IGNORE);
+   
+   delete [] requests;
+#  endif
+#endif
+}
+
+
+ossimRefPtr<ossimImageData> ossimImageMpiSWriterSequenceConnection::getNextTile(
+   ossim_uint32 /* resLevel */)
+{
+   ossimNotify(ossimNotifyLevel_FATAL)
+      << "FATAL ossimImageMpiSWriterSequenceConnection::getNextTile(): "
+      << "should not be called" << std::endl;
+   return ossimRefPtr<ossimImageData>();
+}
+
diff --git a/ossim/src/ossim/parallel/ossimJob.cpp b/src/parallel/ossimJob.cpp
similarity index 100%
rename from ossim/src/ossim/parallel/ossimJob.cpp
rename to src/parallel/ossimJob.cpp
diff --git a/ossim/src/ossim/parallel/ossimJobMultiThreadQueue.cpp b/src/parallel/ossimJobMultiThreadQueue.cpp
similarity index 100%
rename from ossim/src/ossim/parallel/ossimJobMultiThreadQueue.cpp
rename to src/parallel/ossimJobMultiThreadQueue.cpp
diff --git a/ossim/src/ossim/parallel/ossimJobQueue.cpp b/src/parallel/ossimJobQueue.cpp
similarity index 100%
rename from ossim/src/ossim/parallel/ossimJobQueue.cpp
rename to src/parallel/ossimJobQueue.cpp
diff --git a/src/parallel/ossimJobThreadQueue.cpp b/src/parallel/ossimJobThreadQueue.cpp
new file mode 100644
index 0000000..f1a0de2
--- /dev/null
+++ b/src/parallel/ossimJobThreadQueue.cpp
@@ -0,0 +1,244 @@
+#include<ossim/parallel/ossimJobThreadQueue.h>
+
+ossimJobThreadQueue::ossimJobThreadQueue(ossimJobQueue* jqueue)
+:m_doneFlag(false)
+{
+   setJobQueue(jqueue);    
+}
+void ossimJobThreadQueue::setJobQueue(ossimJobQueue* jqueue)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   
+   if (m_jobQueue == jqueue) return;
+   
+   if(isRunning())
+   {
+      ossimRefPtr<ossimJobQueue> jobQueueTemp = m_jobQueue;
+      m_jobQueue = jqueue;
+      if(jobQueueTemp.valid())
+      {
+         jobQueueTemp->releaseBlock();
+      }
+   }
+   else 
+   {
+      m_jobQueue = jqueue;
+   }
+   
+   startThreadForQueue();
+}
+
+ossimJobQueue* ossimJobThreadQueue::getJobQueue() 
+{ 
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   return m_jobQueue.get(); 
+}
+
+const ossimJobQueue* ossimJobThreadQueue::getJobQueue() const 
+{ 
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   return m_jobQueue.get(); 
+}
+
+ossimRefPtr<ossimJob> ossimJobThreadQueue::currentJob() 
+{ 
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   return m_currentJob; 
+}
+
+void ossimJobThreadQueue::cancelCurrentJob()
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   if(m_currentJob.valid())
+   {
+      m_currentJob->cancel();
+   }
+}
+bool ossimJobThreadQueue::isValidQueue()const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   return m_jobQueue.valid();
+}
+
+void ossimJobThreadQueue::run()
+{
+   bool firstTime = true;
+   bool validQueue = true;
+   ossimRefPtr<ossimJob> job;
+   do
+   {
+      // osg::notify(osg::NOTICE)<<"In thread loop "<<this<<std::endl;
+      validQueue = isValidQueue();
+      job = nextJob();
+      if (job.valid()&&!m_doneFlag)
+      {
+         {
+            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+            m_currentJob = job;
+         }
+         
+         // if the job is ready to execute
+         if(job->isReady())
+         {
+            job->resetState(ossimJob::ossimJob_RUNNING);
+            job->start();
+         }
+         {            
+            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+            m_currentJob = 0;
+         }
+         job->setState(ossimJob::ossimJob_FINISHED);
+         job = 0;
+      }
+      
+      if (firstTime)
+      {
+         // do a yield to get round a peculiar thread hang when testCancel() is called 
+         // in certain cirumstances - of which there is no particular pattern.
+         YieldCurrentThread();
+         firstTime = false;
+      }
+   } while (!m_doneFlag&&validQueue);
+   
+   if(job.valid()&&m_doneFlag&&job->isReady())
+   {
+      {            
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+         m_currentJob = 0;
+      }
+      job->cancel();
+   }
+   {            
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+      m_currentJob = 0;
+   }
+   job = 0;
+}
+
+void ossimJobThreadQueue::setDone(bool done)
+{
+   m_threadMutex.lock();
+   if (m_doneFlag==done)
+   {
+      m_threadMutex.unlock();
+      return;
+   }
+   m_doneFlag = done;
+   m_threadMutex.unlock();
+   if(done)
+   {
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+         if (m_currentJob.valid())
+            m_currentJob->release();
+      }
+      
+      if (m_jobQueue.valid())
+         m_jobQueue->releaseBlock();
+   }
+}
+
+bool ossimJobThreadQueue::isDone() const 
+{ 
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   return m_doneFlag; 
+}
+
+bool ossimJobThreadQueue::isProcessingJob()const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   return m_currentJob.valid();
+}
+
+int ossimJobThreadQueue::cancel()
+{
+   
+   if( isRunning() )
+   {
+      {
+         OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+         m_doneFlag = true;
+         if (m_currentJob.valid())
+         {
+            m_currentJob->cancel();
+         }
+         
+         if (m_jobQueue.valid()) 
+         {
+            m_jobQueue->releaseBlock();
+         }
+      }
+      
+      // then wait for the the thread to stop running.
+      while(isRunning())
+      {
+#if 1
+         {
+            OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+            
+            if (m_jobQueue.valid()) 
+            {
+               m_jobQueue->releaseBlock();
+            }
+         }
+#endif
+// RP - The extra cancel and join resolves a bug where threads were not being
+// closed out and OS thread limits are quickly hit
+         OpenThreads::Thread::YieldCurrentThread();
+	 OpenThreads::Thread::cancel();
+      }
+   }
+   OpenThreads::Thread::join();
+   return OpenThreads::Thread::cancel();
+}
+
+bool ossimJobThreadQueue::isEmpty()const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+   return m_jobQueue->isEmpty();
+}
+
+ossimJobThreadQueue::~ossimJobThreadQueue()
+{
+   cancel();
+}
+
+void ossimJobThreadQueue::startThreadForQueue()
+{
+   if(m_jobQueue.valid())
+   {
+      if(!isRunning())
+      {
+         start();
+         while(!isRunning()) // wait for the thread to start running
+         {
+            OpenThreads::Thread::YieldCurrentThread();
+         }
+      }
+   }
+}
+
+bool ossimJobThreadQueue::hasJobsToProcess()const
+{
+   bool result = false;
+   {
+      OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_threadMutex);
+      result = !m_jobQueue->isEmpty()||m_currentJob.valid();
+   }
+   
+   return result;
+}
+
+ossimRefPtr<ossimJob> ossimJobThreadQueue::nextJob()
+{
+   ossimRefPtr<ossimJob> job;
+   m_threadMutex.lock();
+   ossimRefPtr<ossimJobQueue> jobQueue = m_jobQueue;
+   bool checkIfValid = !m_doneFlag&&jobQueue.valid();
+   m_threadMutex.unlock();
+   if(checkIfValid)
+   {
+      return jobQueue->nextJob(true);
+   }
+   return 0;
+}
diff --git a/src/parallel/ossimMpi.cpp b/src/parallel/ossimMpi.cpp
new file mode 100644
index 0000000..916b684
--- /dev/null
+++ b/src/parallel/ossimMpi.cpp
@@ -0,0 +1,190 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimMpi.cpp 23002 2014-11-24 17:11:17Z dburken $
+
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <time.h>
+#if OSSIM_HAS_MPI
+#  include <mpi.h>
+#endif
+
+#if OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimMpi.cpp 23002 2014-11-24 17:11:17Z dburken $";
+#endif
+
+static ossimTrace traceDebug = ossimTrace("ossimMpi:debug");
+
+ossimMpi* ossimMpi::theInstance=0;
+
+ossimMpi* ossimMpi::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimMpi;
+   }
+   
+   return theInstance;
+}
+
+bool ossimMpi::isEnabled()const
+{
+   return theEnabledFlag;
+}
+
+void ossimMpi::barrier()
+{
+#if OSSIM_HAS_MPI
+   if(theEnabledFlag)
+   {
+      // Blocks until all processes have reached this routine.
+      MPI_Barrier( MPI_COMM_WORLD );
+   }
+#endif
+}
+
+ossim_float64 ossimMpi::getTime()const
+{
+#if OSSIM_HAS_MPI
+   if(theEnabledFlag)
+   {
+      return MPI_Wtime();
+   }
+   else
+   {
+      return time(0);
+   }
+#else
+   return time(0);
+#endif
+}
+
+#if OSSIM_HAS_MPI
+void ossimMpi::initialize(int* argc, char*** argv)
+{
+   int success=0;
+   success = MPI_Init(argc, argv);
+   if(success == MPI_SUCCESS)
+   {
+      theEnabledFlag = true;
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimMpi::initialize\n"
+            << "MPI is initialized and running with "
+            << getNumberOfProcessors()
+            << " processors..."
+            << std::endl;
+      }
+   }
+   else
+   {
+      theEnabledFlag = false;
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimMpi::initialize:  MPI is not initialized."
+            << std::endl;
+      }
+   }
+}
+#else
+void ossimMpi::initialize(int* /* argc */, char*** /* argv */)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimMpi::initialize: Not compiled with mpi!"
+         << std::endl;
+   }
+}
+#endif
+
+void ossimMpi::setEnabledFlag(bool flag)
+{
+   theEnabledFlag = flag;
+}
+
+void ossimMpi::finalize()
+{
+#if OSSIM_HAS_MPI
+   if(theEnabledFlag)
+   {
+      int success;
+      success = MPI_Finalize();
+      if(traceDebug())
+      {
+         if(success == MPI_SUCCESS)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG ossimMpi::finalize(): mpi is finalized" << std::endl;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG ossimMpi::finalize(): "
+               << "mpi is not finalized successfully" << std::endl;
+         }
+      }
+   }
+#endif
+}
+
+int ossimMpi::getRank()const
+{
+   int result = 0;
+
+#if OSSIM_HAS_MPI
+   if(theEnabledFlag)
+   {
+      MPI_Comm_rank(MPI_COMM_WORLD, &result);
+   }
+#endif
+   
+   return result;
+}
+
+int ossimMpi::getNumberOfProcessors()const
+{
+   int result = 1;
+
+#if OSSIM_HAS_MPI
+   if(theEnabledFlag)
+   {
+      MPI_Comm_size(MPI_COMM_WORLD, &result);
+   }
+#endif
+
+   return result;
+}
+
+ossimMpi::ossimMpi()
+   : theEnabledFlag(false)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimMpi::ossimMpi entered..."
+         << std::endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID = " << OSSIM_ID << std::endl;
+#endif
+   }
+}
+
+ossimMpi::ossimMpi(const ossimMpi& obj)
+   : theEnabledFlag(obj.theEnabledFlag)
+{}
+
+void ossimMpi::operator=(const ossimMpi& rhs)
+{
+   theEnabledFlag = rhs.theEnabledFlag; 
+}
diff --git a/ossim/src/ossim/parallel/ossimMpiMasterOverviewSequencer.cpp b/src/parallel/ossimMpiMasterOverviewSequencer.cpp
similarity index 100%
rename from ossim/src/ossim/parallel/ossimMpiMasterOverviewSequencer.cpp
rename to src/parallel/ossimMpiMasterOverviewSequencer.cpp
diff --git a/ossim/src/ossim/parallel/ossimMpiSlaveOverviewSequencer.cpp b/src/parallel/ossimMpiSlaveOverviewSequencer.cpp
similarity index 100%
rename from ossim/src/ossim/parallel/ossimMpiSlaveOverviewSequencer.cpp
rename to src/parallel/ossimMpiSlaveOverviewSequencer.cpp
diff --git a/src/parallel/ossimMultiThreadSequencer.cpp b/src/parallel/ossimMultiThreadSequencer.cpp
new file mode 100644
index 0000000..1c3301e
--- /dev/null
+++ b/src/parallel/ossimMultiThreadSequencer.cpp
@@ -0,0 +1,509 @@
+//**************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+//! This class manages the sequencing of tile requests across multiple threads. Note that multi-
+//! threading can only be achieved through the use of getNextTile() method for sequencing. 
+//! Conventional getTiles will not be multi-threaded.
+// 
+//**************************************************************************************************
+//  $Id$
+
+#include <ossim/parallel/ossimMultiThreadSequencer.h>
+#include <ossim/parallel/ossimMtDebug.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimTimer.h>
+
+static const ossim_uint32 DEFAULT_MAX_TILE_CACHE_FACTOR = 8; // Must be > 1
+
+ossimMtDebug* ossimMtDebug::m_instance = NULL;
+
+//*************************************************************************************************
+// Job's start method performs actual getTile in a thread on cloned chain and saves the result
+// in the sequencer's results cache.
+//*************************************************************************************************
+void ossimMultiThreadSequencer::ossimGetTileJob::start()
+{
+   running();
+   if (m_sequencer.d_debugEnabled)
+   {
+      ostringstream s1;
+      s1<<"THREAD #"<<m_chainID<<" -- Starting tile/job #"<<m_tileID;
+      m_sequencer.print(s1);
+   }
+
+   // Figure out the rect for this tile. Only process if rect is valid:
+   ossimIrect tileRect;
+   if (m_sequencer.getTileRect(m_tileID, tileRect))
+   {
+      // Perform the getTile and save the result:
+      ossimRefPtr<ossimImageData> tile = 0;
+      ossimImageSource* source = m_sequencer.m_inputChain->getClone(m_chainID);
+      double dt = ossimTimer::instance()->time_s(); //###
+
+      if (source != NULL)
+         tile = source->getTile(tileRect);
+      if (!tile.valid())
+      {
+         tile = m_sequencer.theBlankTile;
+         tile->setImageRectangle(tileRect);
+      }
+      dt = ossimTimer::instance()->time_s() - dt; //###
+
+      // Give the sequencer the tile. Execution may pause here while waiting for space to free up
+      // if the cache is full.
+      m_sequencer.setTileInCache(m_tileID, (ossimImageData*)tile->dup(), m_chainID, dt);
+   }
+
+   // Unblock the main thread which might be blocked waiting for jobs to finish:
+   m_sequencer.m_getTileBlock.release();
+
+   // Queue the next job using this job's freed-up image chain:
+   if (t_launchNewJob)
+      m_sequencer.nextJob(m_chainID);
+
+   finished();
+   
+   if (m_sequencer.d_debugEnabled)
+   {
+      ostringstream s2;
+      s2<<"THREAD #"<<m_chainID<<" -- Finished tile/job #"<<m_tileID;
+      m_sequencer.print(s2);
+   }
+}
+
+//*************************************************************************************************
+// Constructor
+//*************************************************************************************************
+ossimMultiThreadSequencer::ossimMultiThreadSequencer(ossimImageSource* input, 
+                                                     ossim_uint32 num_threads,
+                                                     ossimObject* owner)
+   : ossimImageSourceSequencer(input, owner),
+   d_maxCacheUsed(0),
+   d_cacheEmptyCount(0), 
+   d_idleTime1(0.0),     
+   d_idleTime2(0.0),     
+   d_idleTime3(0.0),     
+   d_idleTime4(0.0),     
+   d_idleTime5(0.0),     
+   d_idleTime6(0.0),
+   d_jobGetTileT(0.0),
+   m_inputChain(0),
+   m_jobMtQueue(0),
+   m_numThreads (num_threads),
+   m_callback(new ossimGetTileCallback()),
+   m_nextTileID (0),
+   m_tileCache(),                       
+   m_maxCacheSize (DEFAULT_MAX_TILE_CACHE_FACTOR * num_threads),
+   m_maxTileCacheFactor (DEFAULT_MAX_TILE_CACHE_FACTOR),
+   m_cacheMutex(),
+   m_jobMutex(),
+   m_totalNumberOfTiles(0),
+   m_getTileBlock(),
+   m_nextJobBlock(),
+   d_printMutex(),
+   d_timerMutex(),                                 
+   d_debugEnabled(false),
+   d_timedBlocksDt(0),
+   d_timeMetricsEnabled(false),
+   d_useSharedHandlers(true),
+   d_cacheTileSize(1024),
+   d_useCache(true),
+   d_t1(0.0)                              
+{
+   //###### DEBUG ############
+   ossimMtDebug* mt_debug = ossimMtDebug::instance();
+   if (mt_debug->maxTileCacheSize != 0)
+      m_maxCacheSize =  mt_debug->maxTileCacheSize;
+   d_debugEnabled = mt_debug->seqDebugEnabled;
+   d_timedBlocksDt = mt_debug->seqTimedBlocksDt;
+   d_timeMetricsEnabled = mt_debug->seqMetricsEnabled;
+   //###### END DEBUG ############
+
+   // The base-class' initialize() method should have been called by the base class constructor
+   // unless somebody moved it!
+   OpenThreads::Thread::Init();
+   m_nextJobBlock.release();
+   m_getTileBlock.release();
+   ossimTimer::instance()->setStartTick();
+}
+
+//*************************************************************************************************
+// Destructor
+//*************************************************************************************************
+ossimMultiThreadSequencer::~ossimMultiThreadSequencer()
+{
+   m_inputChain = 0; //!< Same as base class' theInputConnection
+   m_jobMtQueue = 0;
+   m_callback = 0;
+}
+
+//*************************************************************************************************
+//! Overrides base class in order to implement multi-threaded tile requests. 
+//*************************************************************************************************
+void ossimMultiThreadSequencer::setToStartOfSequence()
+{
+   // Reset important indices:
+   theCurrentTileNumber = 0;
+   m_nextTileID = 0;
+   m_totalNumberOfTiles = theNumberOfTilesHorizontal * theNumberOfTilesVertical;
+
+   //! The base class should have successfully assigned its input:
+   if (theInputConnection ==  NULL)
+      return;
+
+   // Check if this param was already set externally. Query the system capability if not:
+   if (m_numThreads == 0)
+   {
+      m_numThreads = 2 * ossim::getNumberOfThreads();
+      m_maxCacheSize = m_maxTileCacheFactor * m_numThreads;
+   }
+
+   // Adapt the input source to be an ossimImageChainMtAdaptor since we can only work
+   // with this type:
+   m_inputChain = dynamic_cast<ossimImageChainMtAdaptor*>(theInputConnection);
+   if (m_inputChain.valid())
+   {
+      m_inputChain->setNumberOfThreads(m_numThreads);
+      m_inputChain->setUseSharedHandlers(d_useSharedHandlers);
+      m_inputChain->setCacheTileSize(d_cacheTileSize);
+      m_inputChain->setUseCache(d_useCache);
+   }
+   else
+   {
+      // Need to adapt input. First, is it a chain?
+      ossimImageChain* chain = dynamic_cast<ossimImageChain*>(theInputConnection);
+      if (chain == NULL)
+      {
+         // The input is just a common image source. Make it a chain:
+         chain = new ossimImageChain;
+         chain->add(theInputConnection);
+      }
+
+      // This instantiation creates a set of cloned image chains, one per thread, that will be
+      // accessed in parallel for the getTile() operation:
+      m_inputChain = new ossimImageChainMtAdaptor(chain, m_numThreads, d_useSharedHandlers, d_useCache, d_cacheTileSize);
+   }
+
+   // Set the output of the chain to be this sequencer:
+   m_inputChain->disconnectAllOutputs();
+   //connectMyInputTo(m_inputChain.get());
+   //setAreaOfInterest(m_inputChain->getBoundingRect());
+
+   //// EXPERIMENTAL -- Fetch the first N tiles sequentially:
+   for (ossim_uint32 i=0; i<m_numThreads; ++i)
+   {
+      ossimGetTileJob* job = new ossimGetTileJob(m_nextTileID++, i, *this);
+      job->setCallback(m_callback.get());
+      job->t_launchNewJob = false;
+      job->start();
+   }
+
+   // Set up the job queue and fill it with first N jobs:
+   ossim_uint32 num_jobs_to_launch =  min<ossim_uint32>(m_numThreads, m_totalNumberOfTiles);
+   ossimRefPtr<ossimJobQueue> jobQueue = new ossimJobQueue();
+   for (ossim_uint32 chain_id=0; chain_id<num_jobs_to_launch; ++chain_id)
+   {
+      if (d_debugEnabled)
+      {
+         ostringstream s;
+         s<<"setToStartOfSequence() -- Creating tile/job #"<<m_nextTileID;
+         print(s);
+      }
+
+      ossimGetTileJob* job = new ossimGetTileJob(m_nextTileID++, chain_id, *this);
+      job->setCallback(m_callback.get());
+      jobQueue->add(job, false);
+   }
+
+   // Initialize the multi-thread queue. Note the setQueue is done after construction as it was 
+   // crashing do to jobs being launched during init:
+   m_jobMtQueue = new ossimJobMultiThreadQueue(0, num_jobs_to_launch);
+   m_jobMtQueue->setQueue(jobQueue.get());
+}
+
+
+//*************************************************************************************************
+//! Overrides base class in order to implement multi-threaded tile requests. The output tile 
+//! should be available in the tile cache, otherwise, method waits until it becomes available.
+//*************************************************************************************************
+ossimRefPtr<ossimImageData> ossimMultiThreadSequencer::getNextTile(ossim_uint32 /*resLevel*/)
+{
+   if (!m_inputChain.valid())
+      return NULL;
+
+   // May need to initiate the threaded sequencing if not already done:
+   if (m_nextTileID == 0)
+      setToStartOfSequence();
+
+   // Terminate with null return if done:
+   ossimRefPtr<ossimImageData> tile = 0;
+   if (theCurrentTileNumber >= m_totalNumberOfTiles)
+   {
+      return tile;
+   }
+
+   // May need to wait until the corresponding job is finished if the tile is not in the cache:
+   TileCache::iterator tile_iter = m_tileCache.begin();
+   while (!tile.valid()) 
+   {
+      // If the tile is not yet copied into the cache, it means the job is still running. Let's 
+      // block this thread and let the getTile jobs unlock as they finish. We'll exit this loop
+      // when the job of interest finishes.
+      if (d_timeMetricsEnabled)
+         d_t1 = ossimTimer::instance()->time_s(); 
+      m_cacheMutex.lock();
+      if (d_timeMetricsEnabled)
+         d_idleTime1 += ossimTimer::instance()->time_s() - d_t1; 
+
+      // RP - Just grab the first tile for better performance, because order does not matter, we need
+      // to process them all
+      tile_iter = m_tileCache.begin(); //.find(theCurrentTileNumber);
+      m_cacheMutex.unlock();
+
+      if (tile_iter == m_tileCache.end())
+      {
+         if (d_debugEnabled)
+         {
+            ostringstream s1;
+            s1<<"getNextTile() -- Waiting on tile #"<<theCurrentTileNumber;
+            m_cacheMutex.lock();
+            s1<<"\n   cache size = "<<m_tileCache.size();
+            TileCache::iterator iter = m_tileCache.begin();
+            while(iter != m_tileCache.end())
+            {
+               s1<<"\n   cache.tile_id = "<<iter->first;
+               iter++;
+            }
+            m_cacheMutex.unlock();
+            print(s1);
+         }
+
+         if (d_timedBlocksDt > 0)
+            m_getTileBlock.block(d_timedBlocksDt); 
+         else
+         {
+            m_getTileBlock.reset();
+            if (d_timeMetricsEnabled)
+               d_t1 = ossimTimer::instance()->time_s(); 
+            m_getTileBlock.block();
+            if (d_timeMetricsEnabled)
+               d_idleTime2 += ossimTimer::instance()->time_s() - d_t1; 
+         }
+      }
+      else
+      {
+         // A valid tile was found. Need to assign the output tile and free up the reference in the
+         // cache:
+         if (d_debugEnabled)
+         {
+            ostringstream s2;
+            s2<<"getNextTile() -- Copying tile #"<<theCurrentTileNumber<<".  Cache size: "<<m_tileCache.size();
+            print(s2);
+         }
+         tile = tile_iter->second;
+         
+         if (d_timeMetricsEnabled)
+            d_t1 = ossimTimer::instance()->time_s(); 
+         m_cacheMutex.lock();
+         m_tileCache.erase(tile_iter);
+         m_cacheMutex.unlock();
+         if (d_timeMetricsEnabled)
+            d_idleTime3 += ossimTimer::instance()->time_s() - d_t1; 
+
+         if (m_tileCache.empty()) 
+            ++d_cacheEmptyCount; 
+         m_nextJobBlock.release(); // nextJob() may be blocked until cache space is freed
+      }
+   }
+
+   // Advance the caller-requested tile ID. This is different from the last threaded getTile()'s
+   // tile index maintained in m_nextTileID and advanced in initNextJob():
+   ++theCurrentTileNumber;
+   return tile;
+}
+
+//*************************************************************************************************
+// Specifies number of thread to support. Default behavior (if this method is never called) is
+// query the system for number of cores available.
+//*************************************************************************************************
+void ossimMultiThreadSequencer::setNumberOfThreads(ossim_uint32 num_threads)
+{
+   m_numThreads = num_threads;
+   m_maxCacheSize = m_maxTileCacheFactor * m_numThreads;
+
+   if (m_inputChain.valid())
+      m_inputChain->setNumberOfThreads(num_threads);
+
+   if (m_jobMtQueue.valid() && m_jobMtQueue->hasJobsToProcess())
+      m_jobMtQueue->getJobQueue()->clear();
+
+   m_nextTileID = 0; // effectively resets this sequencer
+}
+
+void ossimMultiThreadSequencer::setUseSharedHandlers(bool use_shared_handlers)
+{
+   d_useSharedHandlers = use_shared_handlers;
+
+   if (m_inputChain.valid())
+      m_inputChain->setUseSharedHandlers(use_shared_handlers);
+}
+
+void ossimMultiThreadSequencer::setCacheTileSize(ossim_uint32 cache_tile_size)
+{
+   d_cacheTileSize = cache_tile_size;
+
+   if (m_inputChain.valid())
+      m_inputChain->setCacheTileSize(cache_tile_size);
+}
+
+void ossimMultiThreadSequencer::setUseCache(bool use_cache)
+{
+   d_useCache = use_cache;
+
+   if (m_inputChain.valid())
+      m_inputChain->setUseCache(use_cache);
+}
+
+//*************************************************************************************************
+//! Access method to tile cache with scope lock to avoid multiple threads writing to
+//! the cache simultaneously.
+//*************************************************************************************************
+void ossimMultiThreadSequencer::setTileInCache(ossim_uint32 tile_id, 
+                                               ossimImageData* tile, 
+                                               ossim_uint32 chain_id,
+                                               double dt)
+{
+   if (d_timeMetricsEnabled)
+      d_t1 = ossimTimer::instance()->time_s(); 
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_cacheMutex);
+   if (d_timeMetricsEnabled)
+      d_idleTime4 += ossimTimer::instance()->time_s() - d_t1; 
+
+   d_jobGetTileT += dt;
+
+   m_tileCache[tile_id] = tile;
+   if (d_debugEnabled)
+   {
+      ostringstream s2;
+      s2<<"THREAD #"<<chain_id<<" -- setTileInCache() Wrote tile #"<<tile_id;
+      print(s2);
+   }
+   if (d_maxCacheUsed < m_tileCache.size())
+      d_maxCacheUsed = (ossim_uint32) m_tileCache.size();
+}
+
+//*************************************************************************************************
+// Queues up the next getTile job if cache is not full. This is called as soon as the job
+// handling the corresponding chain ID is finished.
+//*************************************************************************************************
+void ossimMultiThreadSequencer::nextJob(ossim_uint32 chain_id)
+{
+   // Check for end of sequence:
+   if (m_nextTileID >= m_totalNumberOfTiles)
+      return;
+
+   while (((ossim_uint32) m_tileCache.size()) >= m_maxCacheSize)
+   {
+      if (d_debugEnabled)
+      {
+         m_cacheMutex.lock();
+         TileCache::const_iterator iter = m_tileCache.begin();
+         ostringstream s1;
+         s1<<"THREAD #"<<chain_id<<" -- nextJob() Waiting on cache before queuing tile/job #"
+            <<m_nextTileID<<"using chain #"<<chain_id<<". Cache size: "<<m_tileCache.size();
+         while(iter != m_tileCache.end())
+         {
+            s1<<"\n   cache.tile_id = "<<iter->first;
+            iter++;
+         }
+         m_cacheMutex.unlock();
+         print(s1);
+      }
+
+      if (d_timedBlocksDt > 0)
+         m_nextJobBlock.block(d_timedBlocksDt);
+      else
+      {
+         m_nextJobBlock.reset();
+         if (d_timeMetricsEnabled)
+            d_t1 = ossimTimer::instance()->time_s(); 
+         m_nextJobBlock.block();
+         if (d_timeMetricsEnabled)
+         d_idleTime5 += ossimTimer::instance()->time_s() - d_t1; 
+      }
+   }
+
+   if (d_debugEnabled)
+   {
+      ostringstream s2;
+      s2<<"THREAD #"<<chain_id<<" -- nextJob() Queuing tile/job #"<<m_nextTileID;
+      print(s2);
+   }
+
+   // Job queue will receive pointer into ossimRefPtr so no leak here:
+   if (d_timeMetricsEnabled)
+      d_t1 = ossimTimer::instance()->time_s(); 
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(m_jobMutex);
+   if (d_timeMetricsEnabled)
+      d_idleTime6 += ossimTimer::instance()->time_s() - d_t1; 
+
+   ossimGetTileJob* job = new ossimGetTileJob(m_nextTileID++, chain_id, *this);
+   job->setCallback(m_callback.get());
+   m_jobMtQueue->getJobQueue()->add(job);
+}
+
+//*************************************************************************************************
+// For Debugging
+//*************************************************************************************************
+void ossimMultiThreadSequencer::print(ostringstream& msg) const
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(d_printMutex);
+   cerr << msg.str() << endl;
+}
+double ossimMultiThreadSequencer::handlerGetTileT() 
+{
+   if (m_inputChain->m_sharedHandlers.empty())
+      return -1.0;
+   ossimRefPtr<ossimImageHandlerMtAdaptor> ha = m_inputChain->m_sharedHandlers[0].get();
+   if (ha.valid())
+      return ha->d_getTileT;
+   return -1;
+}
+
+bool ossimMultiThreadSequencer::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup;
+   lookup = kwl.find(prefix, "num_threads");
+   if(lookup)
+   {
+      ossim_uint32 num_threads = ossimString(lookup).toUInt32();
+      setNumberOfThreads(num_threads);
+   }
+   lookup = kwl.find(prefix, "use_shared_handlers");
+   if(lookup)
+   {
+      bool use_shared_handlers = ossimString(lookup).toBool();
+      setUseSharedHandlers(use_shared_handlers);
+   }
+   lookup = kwl.find(prefix, "cache_tile_size");
+   if(lookup)
+   {
+      ossim_uint32 cache_tile_size = ossimString(lookup).toUInt32();
+      setCacheTileSize(cache_tile_size);
+   }
+   lookup = kwl.find(prefix, "use_cache");
+
+   if(lookup)
+   {
+      bool use_cache = ossimString(lookup).toBool();
+      setUseCache(use_cache);
+   }
+
+   bool status = ossimImageSourceSequencer::loadState(kwl, prefix);
+
+   return status;
+}
diff --git a/src/plugin/ossimDynamicLibrary.cpp b/src/plugin/ossimDynamicLibrary.cpp
new file mode 100644
index 0000000..ea76ff7
--- /dev/null
+++ b/src/plugin/ossimDynamicLibrary.cpp
@@ -0,0 +1,102 @@
+//*******************************************************************
+//
+// LICENSE: LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//*********************************************************************
+// $Id: ossimDynamicLibrary.cpp 20694 2012-03-19 12:22:05Z dburken $
+#include <ossim/plugin/ossimDynamicLibrary.h>
+#include <ossim/plugin/ossimSharedObjectBridge.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+// Static trace for debugging.
+static ossimTrace traceDebug(ossimString("ossimDynamicLibrary:debug"));
+
+ossimDynamicLibrary::ossimDynamicLibrary()
+   :theLibrary(0)
+{
+}
+
+ossimDynamicLibrary::ossimDynamicLibrary(const ossimString& name)
+{
+   load(name);
+}
+
+ossimDynamicLibrary::~ossimDynamicLibrary()
+{
+   unload();
+}
+
+bool ossimDynamicLibrary::load()
+{
+   return load(theLibraryName);
+}
+
+bool ossimDynamicLibrary::load(const ossimString& name)
+{
+   ossimFilename libraryName = name.trim();
+   if(libraryName.empty()||!libraryName.isFile())
+      return false;
+   
+#  if defined(__WIN32__) || defined(_WIN32)
+   theLibrary = LoadLibrary(libraryName.c_str());
+#  else 
+   theLibrary = dlopen(libraryName.c_str(), RTLD_LAZY);
+#endif
+
+   if (isLoaded())
+   {
+      theLibraryName = libraryName;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimDynamicLibrary:"<<__LINE__
+            << "  Failed to load library:  " << name << std::endl;
+#if !defined(__WIN32__) && !defined(_WIN32)
+      ossimNotify(ossimNotifyLevel_WARN) << dlerror() << std::endl;
+#endif
+   }
+
+   if (traceDebug())
+   {
+      if (isLoaded())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)<<"ossimDynamicLibrary:"<<__LINE__
+               << "  Loaded library:  " << name << std::endl;
+      }
+   }
+   
+   return isLoaded();
+}
+
+void ossimDynamicLibrary::unload()
+{
+   if(isLoaded())
+   {
+#if defined(__WIN32__) || defined(_WIN32)
+      FreeLibrary(theLibrary);
+// #else HAVE_DLFCN_H
+#else
+      dlclose(theLibrary);
+#endif
+      theLibrary = 0;
+   }
+}
+
+void *ossimDynamicLibrary::getSymbol(const ossimString& name) const
+{
+   if(isLoaded())
+   {
+#if defined(__WIN32__) || defined(_WIN32)
+      return (void*)GetProcAddress( (HINSTANCE)theLibrary, name.c_str());
+#else
+      return dlsym(theLibrary, name.c_str());
+#endif
+   }
+
+   return (void*)0;
+}
diff --git a/src/plugin/ossimPluginLibrary.cpp b/src/plugin/ossimPluginLibrary.cpp
new file mode 100644
index 0000000..5f90ad8
--- /dev/null
+++ b/src/plugin/ossimPluginLibrary.cpp
@@ -0,0 +1,89 @@
+//*******************************************************************
+///
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimPluginLibrary.cpp 20694 2012-03-19 12:22:05Z dburken $
+#include <ossim/plugin/ossimPluginLibrary.h>
+#include <iostream>
+
+ossimPluginLibrary::ossimPluginLibrary()
+   :ossimDynamicLibrary(),
+    m_info(0)
+{
+}
+
+ossimPluginLibrary::ossimPluginLibrary(const ossimString& name, const ossimString& options)
+   :ossimDynamicLibrary(name),
+    m_options(options),
+    m_info(0)
+{
+   initialize();
+}
+
+ossimPluginLibrary::~ossimPluginLibrary()
+{
+   finalize();
+}
+
+void ossimPluginLibrary::initialize()
+{
+   if(!isLoaded())
+   {
+      load();
+   }
+   
+   ossimSharedLibraryInitializePtr init = (ossimSharedLibraryInitializePtr)getSymbol("ossimSharedLibraryInitialize");
+   if(init)
+   {
+      init(&m_info, m_options.c_str());
+   }
+}
+
+void ossimPluginLibrary::finalize()
+{
+   ossimSharedLibraryFinalizePtr finalizeLib = (ossimSharedLibraryFinalizePtr)getSymbol("ossimSharedLibraryFinalize");
+   if(finalizeLib)
+   {         
+      finalizeLib();
+   }
+   
+   unload();
+}
+
+ossimString ossimPluginLibrary::getDescription()const
+{
+   ossimString result;
+
+   if(m_info&&isLoaded()&&m_info->getDescription)
+   {
+      result = m_info->getDescription();
+   }
+
+   return result;
+}
+
+void ossimPluginLibrary::getClassNames(std::vector<ossimString>& classNames)const
+{
+   if(m_info&&m_info->getNumberOfClassNames&&m_info->getClassName)
+   {
+      ossim_int32 idx        = 0;
+      ossim_int32 numObjects = 0;
+
+      numObjects = m_info->getNumberOfClassNames();
+      for(idx = 0; idx < numObjects; ++idx)
+      {
+         classNames.push_back(m_info->getClassName(idx));
+      }
+   }
+}
+
+void ossimPluginLibrary::setOptions(const ossimString& options)
+{
+   m_options = options;
+   
+}
diff --git a/ossim/src/ossim/plugin/ossimSharedObjectBridge.cpp b/src/plugin/ossimSharedObjectBridge.cpp
similarity index 100%
rename from ossim/src/ossim/plugin/ossimSharedObjectBridge.cpp
rename to src/plugin/ossimSharedObjectBridge.cpp
diff --git a/ossim/src/ossim/plugin/ossimSharedPluginRegistry.cpp b/src/plugin/ossimSharedPluginRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/plugin/ossimSharedPluginRegistry.cpp
rename to src/plugin/ossimSharedPluginRegistry.cpp
diff --git a/src/point_cloud/ossimGenericPointCloudHandler.cpp b/src/point_cloud/ossimGenericPointCloudHandler.cpp
new file mode 100644
index 0000000..4898d9f
--- /dev/null
+++ b/src/point_cloud/ossimGenericPointCloudHandler.cpp
@@ -0,0 +1,69 @@
+#include <ossim/point_cloud/ossimGenericPointCloudHandler.h>
+
+ossimGenericPointCloudHandler::ossimGenericPointCloudHandler(vector<ossimEcefPoint>& ecef_points)
+{
+   // Fill the point storage in any order.
+   // Loop to add your points (assume your points are passed in a vector ecef_points[])
+   for (ossim_uint32 i=0; i<ecef_points.size(); ++i)
+   {
+      ossimPointRecord* point = new ossimPointRecord(ossimGpt(ecef_points[i]));
+      m_pointBlock.addPoint(point);
+   }
+   ossimGrect bounds;
+   m_pointBlock.getBounds(bounds);
+   m_minRecord = new ossimPointRecord(bounds.ll());
+   m_maxRecord = new ossimPointRecord(bounds.ur());
+}
+
+ossimGenericPointCloudHandler::ossimGenericPointCloudHandler(vector<ossimGpt>& ground_points)
+{
+   // Fill the point storage in any order.
+   // Loop to add your points (assume your points are passed in a vector ecef_points[])
+   for (ossim_uint32 i=0; i<ground_points.size(); ++i)
+   {
+      ossimPointRecord* point = new ossimPointRecord(ground_points[i]);
+      m_pointBlock.addPoint(point);
+   }
+   ossimGrect bounds;
+   m_pointBlock.getBounds(bounds);
+   m_minRecord = new ossimPointRecord(bounds.ll());
+   m_maxRecord = new ossimPointRecord(bounds.ur());
+}
+
+ossimGenericPointCloudHandler::~ossimGenericPointCloudHandler() 
+{ 
+   m_pointBlock.clear(); 
+}
+
+ossim_uint32 ossimGenericPointCloudHandler::getNumPoints() const 
+{ 
+   return m_pointBlock.size(); 
+}
+
+void ossimGenericPointCloudHandler::getFileBlock(ossim_uint32 offset,
+                                                 ossimPointBlock& block,
+                                                 ossim_uint32 /* maxNumPoints */) const
+{
+   block.clear();
+   if (offset >= m_pointBlock.size())
+      return;
+
+   for (ossim_uint32 i=offset; i<m_pointBlock.size(); ++i)
+      block.addPoint(new ossimPointRecord(*(m_pointBlock[i])));
+
+   m_currentPID = block.size();
+}
+
+ossim_uint32 ossimGenericPointCloudHandler::getFieldCode() const 
+{ 
+  return 0; 
+}
+
+bool ossimGenericPointCloudHandler::open(const ossimFilename& /* pointsFile */)
+{ 
+   return false; 
+}
+ 
+void ossimGenericPointCloudHandler::close() 
+{  
+}
diff --git a/src/point_cloud/ossimPointBlock.cpp b/src/point_cloud/ossimPointBlock.cpp
new file mode 100644
index 0000000..6aae927
--- /dev/null
+++ b/src/point_cloud/ossimPointBlock.cpp
@@ -0,0 +1,238 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+#include <ossim/point_cloud/ossimPointBlock.h>
+
+RTTI_DEF1(ossimPointBlock, "ossimPointBlock", ossimDataObject)
+
+ossimPointBlock::ossimPointBlock(ossimSource* owner, ossim_uint32 fields)
+:  ossimDataObject(owner),
+   m_nullPCR(fields),
+   m_minMaxValid(false),
+   m_fieldCode(0),
+   m_isNormalized(false)
+{
+}
+
+ossimPointBlock::~ossimPointBlock()
+{
+
+}
+
+void ossimPointBlock::getFieldMin(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const
+{
+   if (empty())
+      value = ossim::nan();
+   else if (!m_minMaxValid)
+      scanForMinMax();
+
+   value = m_minRecord.getField(field);
+}
+
+void ossimPointBlock::getFieldMax(ossimPointRecord::FIELD_CODES field, ossim_float32& value) const
+{
+   if (empty())
+      value = ossim::nan();
+   else if (!m_minMaxValid)
+      scanForMinMax();
+
+   value = m_maxRecord.getField(field);
+}
+
+
+void ossimPointBlock::getBounds(ossimGrect& block_bounds) const
+{
+   if (!m_minMaxValid)
+      scanForMinMax();
+
+   block_bounds = ossimGrect(m_minRecord.getPosition(), m_maxRecord.getPosition());
+}
+
+const ossimPointRecord* ossimPointBlock::getPoint(ossim_uint32 point_offset) const
+{
+   if (point_offset < m_pointList.size())
+      return m_pointList[point_offset].get();
+   return 0;
+}
+
+ossimPointRecord* ossimPointBlock::getPoint(ossim_uint32 point_offset)
+{
+   if (point_offset < m_pointList.size())
+      return m_pointList[point_offset].get();
+   return 0;
+}
+
+const ossimPointBlock& ossimPointBlock::operator=(const ossimPointBlock& block )
+{
+   ossim_uint32 numPoints = block.size();
+   if (numPoints == 0)
+      return *this;
+
+   for (ossim_uint32 i=0; i<numPoints; ++i)
+      m_pointList.push_back(new ossimPointRecord(*(block[i])));
+
+   m_nullPCR = block.m_nullPCR;
+   m_minRecord = block.m_minRecord;
+   m_maxRecord = block.m_maxRecord;
+   m_minMaxValid = block.m_minMaxValid;
+   m_fieldCode = block.m_fieldCode;
+   m_isNormalized = block.m_isNormalized;
+
+   return *this;
+}
+
+ossimObject* ossimPointBlock::dup() const
+{
+   ossimPointBlock* copy = new ossimPointBlock(0, m_fieldCode);
+   *copy = *this;
+   return copy;
+}
+
+ossim_uint32 ossimPointBlock::getFieldCode() const
+{
+   if (!m_pointList.empty())
+      m_fieldCode = m_pointList[0]->getFieldCode();
+
+   return m_fieldCode;
+}
+
+vector<ossimPointRecord::FIELD_CODES> ossimPointBlock::getFieldCodesAsList() const
+{
+   vector<ossimPointRecord::FIELD_CODES> code_list;
+   if (m_fieldCode & ossimPointRecord::Intensity)
+      code_list.push_back(ossimPointRecord::Intensity);
+   if (m_fieldCode & ossimPointRecord::ReturnNumber)
+      code_list.push_back(ossimPointRecord::ReturnNumber);
+   if (m_fieldCode & ossimPointRecord::NumberOfReturns)
+      code_list.push_back(ossimPointRecord::NumberOfReturns);
+   if (m_fieldCode & ossimPointRecord::Red)
+      code_list.push_back(ossimPointRecord::Red);
+   if (m_fieldCode & ossimPointRecord::Green)
+      code_list.push_back(ossimPointRecord::Green);
+   if (m_fieldCode & ossimPointRecord::Blue)
+      code_list.push_back(ossimPointRecord::Blue);
+   if (m_fieldCode & ossimPointRecord::GpsTime)
+      code_list.push_back(ossimPointRecord::GpsTime);
+   if (m_fieldCode & ossimPointRecord::Infrared)
+      code_list.push_back(ossimPointRecord::Infrared);
+  return code_list;
+}
+
+void ossimPointBlock::setFieldCode(ossim_uint32 code)
+{
+   if (getFieldCode() != code)
+      clear();
+
+   m_fieldCode = code;
+}
+
+void ossimPointBlock::addPoint(ossimPointRecord* opr)
+{
+   // First check that the fields match the expected. If not, sync up to this point:
+   if ((opr->getFieldCode() & m_fieldCode) != m_fieldCode)
+      m_fieldCode = opr->getFieldCode();
+
+   m_pointList.push_back(ossimRefPtr<ossimPointRecord>(opr));
+   m_minMaxValid = false;
+}
+
+void ossimPointBlock::scanForMinMax() const
+{
+   ossim_uint32 numPoints = size();
+   if (numPoints == 0)
+      return;
+
+   // Latch first point:
+   m_minRecord = *(m_pointList[0].get());
+   m_maxRecord = m_minRecord;
+   ossimGpt minPos (m_minRecord.getPosition());
+   ossimGpt maxPos (minPos);
+
+   // For shorthand later:
+   const ossimPointRecord::FIELD_CODES I = ossimPointRecord::Intensity;
+   const ossimPointRecord::FIELD_CODES R = ossimPointRecord::Red;
+   const ossimPointRecord::FIELD_CODES G = ossimPointRecord::Green;
+   const ossimPointRecord::FIELD_CODES B = ossimPointRecord::Blue;
+   const ossimPointRecord::FIELD_CODES S = ossimPointRecord::ReturnNumber;
+   const ossimPointRecord::FIELD_CODES N = ossimPointRecord::NumberOfReturns;
+
+   // If color available, latch the min for all bands as one to minimize color distortion:
+   bool hasRGB = false;
+   if (m_minRecord.hasFields(R|G|B))
+   {
+      hasRGB = true;
+      ossim_float32 r = m_pointList[0]->getField(R);
+      ossim_float32 g = m_pointList[0]->getField(G);
+      ossim_float32 b = m_pointList[0]->getField(B);
+      float minC = std::min(r, std::min(g, b));
+      float maxC = std::max(r, std::max(g, b));
+      m_minRecord.setField(R,   minC);
+      m_minRecord.setField(G, minC);
+      m_minRecord.setField(B,  minC);
+      m_maxRecord.setField(R,   maxC);
+      m_maxRecord.setField(G, maxC);
+      m_maxRecord.setField(B,  maxC);
+   }
+
+   // Now loop over all points in file to latch min/max:
+   for (ossim_uint32 i=0; i<numPoints; ++i)
+   {
+      if (m_pointList[i]->getPosition().lat < minPos.lat)
+         minPos.lat = m_pointList[i]->getPosition().lat;
+      if (m_pointList[i]->getPosition().lon < minPos.lon)
+         minPos.lon = m_pointList[i]->getPosition().lon;
+      if (m_pointList[i]->getPosition().hgt < minPos.hgt)
+         minPos.hgt = m_pointList[i]->getPosition().hgt;
+
+      if (m_pointList[i]->getPosition().lat > maxPos.lat)
+         maxPos.lat = m_pointList[i]->getPosition().lat;
+      if (m_pointList[i]->getPosition().lon > maxPos.lon)
+         maxPos.lon = m_pointList[i]->getPosition().lon;
+      if (m_pointList[i]->getPosition().hgt > maxPos.hgt)
+         maxPos.hgt = m_pointList[i]->getPosition().hgt;
+
+      if (m_minRecord.hasFields(I) &&  (m_minRecord.getField(I) > m_pointList[i]->getField(I)))
+         m_minRecord.setField(I, m_pointList[i]->getField(I));
+
+      if (m_minRecord.hasFields(S) &&  (m_minRecord.getField(S) > m_pointList[i]->getField(S)))
+         m_minRecord.setField(S, m_pointList[i]->getField(S));
+
+      if (m_minRecord.hasFields(N) &&  (m_minRecord.getField(N) > m_pointList[i]->getField(N)))
+         m_minRecord.setField(N, m_pointList[i]->getField(N));
+
+      if (hasRGB)
+      {
+         ossim_float32 r = m_pointList[i]->getField(R);
+         ossim_float32 g = m_pointList[i]->getField(G);
+         ossim_float32 b = m_pointList[i]->getField(B);
+
+         float minC = std::min(r, std::min(g, b));
+         if (m_minRecord.getField(R) > minC)
+         {
+            m_minRecord.setField(R, minC);
+            m_minRecord.setField(G, minC);
+            m_minRecord.setField(B, minC);
+         }
+
+         float maxC = std::max(r, std::max(g, b));
+         if (m_maxRecord.getField(R) < maxC)
+         {
+            m_maxRecord.setField(R, maxC);
+            m_maxRecord.setField(G, maxC);
+            m_maxRecord.setField(B, maxC);
+         }
+      }
+   } // end loop over all points
+
+   m_minRecord.setPosition(minPos);
+   m_maxRecord.setPosition(maxPos);
+   m_minMaxValid = true;
+}
+
+
+
+
diff --git a/src/point_cloud/ossimPointCloudGeometry.cpp b/src/point_cloud/ossimPointCloudGeometry.cpp
new file mode 100644
index 0000000..1d89113
--- /dev/null
+++ b/src/point_cloud/ossimPointCloudGeometry.cpp
@@ -0,0 +1,78 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#include <ossim/point_cloud/ossimPointCloudGeometry.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/projection/ossimWktProjectionFactory.h>
+#include <ossim/projection/ossimMapProjection.h>
+
+RTTI_DEF1(ossimPointCloudGeometry, "ossimPointCloudGeometry" , ossimObject);
+
+ossimPointCloudGeometry::ossimPointCloudGeometry(const ossimString& wkt)
+      : m_format(GEOGRAPHIC),
+        m_projection(0),
+        m_datum(ossimDatumFactory::instance()->wgs84())
+{
+   // Establish projection from WKT:
+   m_projection = dynamic_cast<ossimMapProjection*>(
+         ossimWktProjectionFactory::instance()->createProjection(wkt));
+
+   if (m_projection.valid())
+   {
+      m_datum = m_projection->getDatum();
+      if (!m_projection->isGeographic())
+         m_format = MAP_PROJECTED;
+   }
+}
+
+bool ossimPointCloudGeometry::operator==(const ossimPointCloudGeometry& other) const
+{
+   if (m_format != other.m_format)
+      return false;
+
+   if (m_projection.valid() && other.m_projection.valid() && (*m_projection == *(other.m_projection)))
+      return true;
+
+   return false;
+}
+
+void ossimPointCloudGeometry::convertPos(const ossimDpt3d& oldPt, ossimGpt& converted_gpos) const
+{
+   converted_gpos.makeNan();
+
+   // If the data buffer has existing points, transform them into the new projection and datum:
+   if (m_format == GEOGRAPHIC)
+   {
+      ossimGpt gpt (oldPt.y, oldPt.x, oldPt.z, m_datum);
+      gpt.changeDatum(converted_gpos.datum());
+      converted_gpos = gpt;
+   }
+   else if ((m_format == MAP_PROJECTED) && m_projection.valid())
+   {
+      ossimUnitConversionTool uct (1.0, m_projection->getProjectionUnits());
+      double coord_scale = uct.getMeters();
+
+      //Need to convert map E, N to lat, lon
+      ossimDpt oldMapPt(oldPt.x*coord_scale, oldPt.y*coord_scale);
+      ossimGpt gpt(getProjection()->inverse(oldMapPt));
+      gpt.changeDatum(m_datum);
+      gpt.hgt = oldPt.z*coord_scale;
+      gpt.changeDatum(converted_gpos.datum());
+      converted_gpos = gpt;
+   }
+   else if (m_format == ECF_METERS)
+   {
+      ossimEcefPoint oldEcfPt(oldPt);
+      converted_gpos = ossimGpt (oldEcfPt, converted_gpos.datum());
+   }
+
+   return;
+}
+
diff --git a/src/point_cloud/ossimPointCloudHandler.cpp b/src/point_cloud/ossimPointCloudHandler.cpp
new file mode 100644
index 0000000..fc39579
--- /dev/null
+++ b/src/point_cloud/ossimPointCloudHandler.cpp
@@ -0,0 +1,99 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+
+RTTI_DEF1(ossimPointCloudHandler, "ossimPointCloudHandler" , ossimPointCloudSource);
+
+ossim_uint32 ossimPointCloudHandler::DEFAULT_BLOCK_SIZE = 0x400000;
+
+ossimPointCloudHandler::ossimPointCloudHandler()
+:  m_currentPID(0)
+{
+}
+
+ossimPointCloudHandler::ossimPointCloudHandler(ossimObject* owner)
+:  ossimPointCloudSource(owner),
+   m_currentPID(0)
+{
+
+}
+
+ossimPointCloudHandler::~ossimPointCloudHandler()
+{
+}
+
+void ossimPointCloudHandler::getNextFileBlock(ossimPointBlock& block, ossim_uint32 maxPts) const
+{
+   getFileBlock(m_currentPID, block, maxPts);
+   return;
+}
+
+void ossimPointCloudHandler::getBlock(const ossimGrect& bounds, ossimPointBlock& block) const
+{
+   block.clear();
+
+   // This default implementation simply reads the whole datafile in file-blocks, retaining
+   // only those points inside the bounds:
+   ossimPointBlock file_block;
+   rewind();
+   ossimGpt gpt;
+
+   do
+   {
+      file_block.clear();
+      getNextFileBlock(file_block, DEFAULT_BLOCK_SIZE);
+      ossimPointBlock::PointList& pointList = file_block.getPoints();
+      ossimPointBlock::PointList::iterator iter = pointList.begin();
+      while (iter != pointList.end())
+      {
+         gpt = (*iter)->getPosition();
+         if (bounds.pointWithin(gpt))
+         {
+            block.addPoint(iter->get());
+         }
+         ++iter;
+      }
+   } while (file_block.size() == DEFAULT_BLOCK_SIZE);
+}
+
+void ossimPointCloudHandler::getBounds(ossimGrect& bounds) const
+{
+   if (m_minRecord.valid() && m_maxRecord.valid())
+      bounds = ossimGrect(m_minRecord->getPosition(), m_maxRecord->getPosition());
+   else
+      bounds.makeNan();
+}
+
+void ossimPointCloudHandler::normalizeBlock(ossimPointBlock& block)
+{
+   if (!m_minRecord.valid() || !m_maxRecord.valid())
+      return;
+
+   ossim_uint32 numPoints = block.size();
+   float val, norm, min, max;
+   vector<ossimPointRecord::FIELD_CODES> field_codes = block.getFieldCodesAsList();
+   vector<ossimPointRecord::FIELD_CODES>::const_iterator iter;
+   ossimPointRecord::FIELD_CODES field_code;
+   for (ossim_uint32 i=0; i<numPoints; ++i)
+   {
+      ossimPointRecord* opr = block[i];
+      iter = field_codes.begin();
+      while (iter != field_codes.end())
+      {
+         field_code = *iter;
+         min = m_minRecord->getField(field_code);
+         max = m_maxRecord->getField(field_code);
+         val = opr->getField(field_code);
+         norm = (val - min) / (max - min);
+         opr->setField(field_code, norm);
+         ++iter;
+      }
+   }
+}
diff --git a/src/point_cloud/ossimPointCloudHandlerRegistry.cpp b/src/point_cloud/ossimPointCloudHandlerRegistry.cpp
new file mode 100644
index 0000000..45645a9
--- /dev/null
+++ b/src/point_cloud/ossimPointCloudHandlerRegistry.cpp
@@ -0,0 +1,97 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#include <ossim/point_cloud/ossimPointCloudHandlerRegistry.h>
+#include <ossim/point_cloud/ossimPointCloudHandler.h>
+#include <ossim/point_cloud/ossimPointCloudHandlerFactory.h>
+
+ossimPointCloudHandlerRegistry* ossimPointCloudHandlerRegistry::m_instance = 0;
+
+RTTI_DEF1(ossimPointCloudHandlerRegistry, "ossimPointCloudHandlerRegistry" , ossimObjectFactory);
+
+ossimPointCloudHandlerRegistry::ossimPointCloudHandlerRegistry()
+{
+   // TODO Auto-generated constructor stub
+}
+
+ossimPointCloudHandlerRegistry::~ossimPointCloudHandlerRegistry()
+{
+   // TODO Auto-generated destructor stub
+}
+
+ossimPointCloudHandlerRegistry* ossimPointCloudHandlerRegistry::instance()
+{
+   if (m_instance)
+      return m_instance;
+   m_instance = new ossimPointCloudHandlerRegistry;
+   return m_instance;
+}
+
+ossimPointCloudHandler* ossimPointCloudHandlerRegistry::open(const ossimFilename& fileName) const
+{
+   ossimPointCloudHandler*  result = NULL;
+   std::vector<ossimPointCloudHandlerFactory*>::const_iterator factory;
+
+   factory = m_factoryList.begin();
+   while((factory != m_factoryList.end()) && !result)
+   {
+      result = (*factory)->open(fileName);
+      ++factory;
+   }
+
+   return result;
+}
+
+ossimPointCloudHandler* ossimPointCloudHandlerRegistry::open(const ossimKeywordlist& kwl,
+                                                             const char* prefix) const
+{
+   ossimPointCloudHandler* result = NULL;
+   std::vector<ossimPointCloudHandlerFactory*>::const_iterator factory;
+
+   factory = m_factoryList.begin();
+   while((factory != m_factoryList.end()) && !result)
+   {
+      result = (*factory)->open(kwl, prefix);
+      ++factory;
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimPointCloudHandler> ossimPointCloudHandlerRegistry::open(std::istream* /*str*/,
+                                                 std::streamoff /*restartPosition*/,
+                                                 bool /*youOwnIt*/) const
+{
+   // TODO Auto-generated constructor stub
+   return 0;
+}
+
+ossimObject* ossimPointCloudHandlerRegistry::createObject(const ossimString& typeName) const
+{
+   return createObjectFromRegistry(typeName);
+}
+
+ossimObject* ossimPointCloudHandlerRegistry::createObject(const ossimKeywordlist& kwl,
+                                                          const char* prefix) const
+{
+   return createObjectFromRegistry(kwl, prefix);
+}
+
+const ossimPointCloudHandlerRegistry& ossimPointCloudHandlerRegistry::operator=(
+      const ossimPointCloudHandlerRegistry& /*rhs*/)
+{
+   return *this;
+}
+
+void ossimPointCloudHandlerRegistry::getTypeNameList(std::vector<ossimString>& typeList) const
+{
+   getAllTypeNamesFromRegistry(typeList);
+}
+
+
diff --git a/src/point_cloud/ossimPointCloudImageHandler.cpp b/src/point_cloud/ossimPointCloudImageHandler.cpp
new file mode 100644
index 0000000..885d239
--- /dev/null
+++ b/src/point_cloud/ossimPointCloudImageHandler.cpp
@@ -0,0 +1,831 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id$
+
+#include <ossim/point_cloud/ossimPointCloudImageHandler.h>
+#include <ossim/point_cloud/ossimPointCloudSource.h>
+#include <ossim/point_cloud/ossimPointCloudHandlerRegistry.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+
+RTTI_DEF1(ossimPointCloudImageHandler, "ossimPointCloudImageHandler", ossimImageHandler);
+
+static ossimTrace traceDebug("ossimPointCloudImageHandler:debug");
+static const char* GSD_FACTOR_KW = "gsd_factor";
+static const char* COMPONENT_KW = "component";
+
+// The member m_activeComponent should be one of the following strings. This is set either in a
+// state KWL or by a call to setProperty(<"active_component", <string> >)
+static const char* INTENSITY_KW = "INTENSITY";
+static const char* HIGHEST_KW = "HIGHEST";
+static const char* LOWEST_KW = "LOWEST";
+static const char* RETURNS_KW = "RETURNS";
+static const char* RGB_KW = "RGB";
+
+ossimPointCloudImageHandler::PcrBucket::PcrBucket(const ossim_float32* init_value,
+                                                  ossim_uint32 numBands)
+:  m_numSamples (1)
+{
+   m_bucket = new ossim_float32[numBands];
+   for (ossim_uint32 i=0; i<numBands; i++)
+      m_bucket[i] = init_value[i];
+}
+
+
+ossimPointCloudImageHandler::PcrBucket::PcrBucket(const ossim_float32& R,
+      const ossim_float32& G,
+      const ossim_float32& B)
+:  m_numSamples (1)
+{
+   m_bucket = new ossim_float32[3];
+   m_bucket[0] = R;
+   m_bucket[1] = G;
+   m_bucket[2] = B;
+
+}
+
+
+ossimPointCloudImageHandler::PcrBucket::PcrBucket(const ossim_float32& init_value)
+:  m_numSamples (1)
+{
+   m_bucket = new ossim_float32[1];
+   m_bucket[0] = init_value;
+}
+
+
+ossimPointCloudImageHandler::PcrBucket::~PcrBucket()
+{
+   delete [] m_bucket;
+}
+
+
+ossimPointCloudImageHandler::ossimPointCloudImageHandler()
+      : ossimImageHandler(),
+        m_maxPixel(1.0),
+        m_minPixel(0.0),
+        m_gsd(),
+        m_gsdFactor (1.0),
+        m_tile(0),
+        m_mutex(),
+        m_activeComponent(INTENSITY)
+{
+   //---
+   // Nan out as can be set in several places, i.e. setProperty,
+   // loadState and initProjection.
+   //---
+   m_gsd.makeNan();
+
+   m_componentNames.push_back(INTENSITY_KW);
+   m_componentNames.push_back(HIGHEST_KW);
+   m_componentNames.push_back(LOWEST_KW);
+   m_componentNames.push_back(RETURNS_KW);
+   m_componentNames.push_back(RGB_KW);
+}
+
+ossimPointCloudImageHandler::~ossimPointCloudImageHandler()
+{
+   close();
+}
+
+bool ossimPointCloudImageHandler::open()
+{
+   close();
+
+   // Need to utilize the Point Cloud handler registry to open the PC file:
+   m_pch = ossimPointCloudHandlerRegistry::instance()->open(theImageFile);
+   if (!m_pch.valid())
+      return false;
+
+   getImageGeometry();
+   ossimImageHandler::completeOpen();
+
+   // Needed here after open to make sure that min/max pixels are set for active component/entry
+   setCurrentEntry((ossim_uint32)m_activeComponent);
+
+   return true;
+}
+
+bool ossimPointCloudImageHandler::setPointCloudHandler(ossimPointCloudHandler* pch)
+{
+   close();
+
+   // Need to utilize the Point Cloud handler registry to open the PC file:
+   m_pch = pch;
+   if (!m_pch.valid())
+      return false;
+
+   getImageGeometry();
+   ossimImageHandler::completeOpen();
+
+   // Needed here after open to make sure that min/max pixels are set for active component/entry
+   setCurrentEntry((ossim_uint32)m_activeComponent);
+
+   return true;
+}
+
+void ossimPointCloudImageHandler::close()
+{
+   if (isOpen())
+   {
+      m_pch->close();
+      m_tile = 0;
+      ossimImageHandler::close();
+   }
+}
+
+ossimRefPtr<ossimImageGeometry> ossimPointCloudImageHandler::getImageGeometry()
+{
+   if (!isOpen())
+      return 0;
+
+   if (theGeometry.valid())
+      return theGeometry;
+
+   // Check for external geom (i.e., a *.geom file)
+   theGeometry = getExternalImageGeometry();
+   if (theGeometry.valid())
+      return theGeometry;
+
+   theGeometry = new ossimImageGeometry();
+   ossimString epsgCode ("EPSG:4326");
+   ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>(
+         ossimEpsgProjectionFactory::instance()->createProjection(epsgCode));
+   if (!proj)
+      return 0;
+   theGeometry->setProjection(proj);
+
+   // Need to establish image bounds and optimal GSD given ground rect. Use this switch to also
+   // initialize the UL tiepoint of image projection:
+   ossimGrect bounds;
+   m_pch->getBounds(bounds);
+   proj->setOrigin(bounds.ul());
+   proj->setUlTiePoints(bounds.ul());
+
+   // The GSD depends on the point density on the ground. count all final returns and
+   // assume they are evenly distributed over the bounding ground rect. Note that this can have
+   // up to a sqrt(2)X error if the collection was taken in a cardinal-diagonal direction.
+   // Also use this point loop to latch the ground quad vertices vertices.
+   ossim_uint32 numPulses = m_pch->getNumPoints(); // count of final returns
+   if (numPulses == 0)
+   {
+      // Not yet determined. Set GSD to NAN and expect it will be set later:
+      m_gsd.makeNan();
+   }
+   else if (m_gsd.hasNans())
+   {
+      ossimDpt delta (bounds.widthMeters(), bounds.heightMeters());
+      ossim_float64 gsd = sqrt(delta.x * delta.y / numPulses) * m_gsdFactor;
+      setGSD(gsd); // also recomputes the image size
+   }
+
+   return theGeometry;
+}
+
+ossimRefPtr<ossimImageData> ossimPointCloudImageHandler::getTile(const ossimIrect& tile_rect,
+                                                                 ossim_uint32 resLevel)
+{
+   if (!m_tile.valid())
+      initTile();
+
+   // Image rectangle must be set prior to calling getTile.
+   m_tile->setImageRectangle(tile_rect);
+   if (getTile(m_tile.get(), resLevel) == false)
+   {
+      if (m_tile->getDataObjectStatus() != OSSIM_NULL)
+         m_tile->makeBlank();
+   }
+
+   return m_tile;
+}
+
+bool ossimPointCloudImageHandler::getTile(ossimImageData* result, ossim_uint32 resLevel)
+{
+   // check for all systems go and valid args:
+   if (!m_pch.valid() || !result || (result->getScalarType() != OSSIM_FLOAT32)
+       || (result->getDataObjectStatus() == OSSIM_NULL) || m_gsd.hasNans())
+   {
+      return false;
+   }
+
+   // Overviews achieved with GSD setting. This may be too slow.
+   ossimDpt gsd (m_gsd);
+   if (resLevel > 0)
+      getGSD(gsd, resLevel);
+
+   // Establish the ground and image rects for this tile:
+   const ossimIrect img_tile_rect = result->getImageRectangle();
+   const ossimIpt tile_offset (img_tile_rect.ul());
+   const ossim_uint32 tile_width = img_tile_rect.width();
+   const ossim_uint32 tile_height = img_tile_rect.height();
+   const ossim_uint32 tile_size = img_tile_rect.area();
+
+   ossimGpt gnd_ul, gnd_lr;
+   ossimDpt dpt_ul (img_tile_rect.ul().x - 0.5, img_tile_rect.ul().y - 0.5);
+   ossimDpt dpt_lr (img_tile_rect.lr().x + 0.5, img_tile_rect.lr().y + 0.5);
+   theGeometry->rnToWorld(dpt_ul, resLevel, gnd_ul);
+   theGeometry->rnToWorld(dpt_lr, resLevel, gnd_lr);
+   const ossimGrect gnd_rect (gnd_ul, gnd_lr);
+
+   // Create array of buckets to store accumulated point data.
+   ossim_uint32 numBands = result->getNumberOfBands();
+   if (numBands > getNumberOfInputBands())
+   {
+      // This should never happen;
+      ossimNotify(ossimNotifyLevel_FATAL)
+            << "ossimPointCloudImageHandler::getTile() ERROR: \n"
+            << "More bands were requested than was available from the point cloud source. Returning "
+            << "blank tile." << endl;
+      result->makeBlank();
+      return false;
+   }
+   std::map<ossim_int32, PcrBucket*> accumulator;
+
+   // initialize a point block with desired fields as requested in the reader properties
+   ossimPointBlock pointBlock (this);
+   pointBlock.setFieldCode(componentToFieldCode());
+   m_pch->rewind();
+
+   ossimDpt ipt;
+   ossimGpt pos;
+
+#define USE_GETBLOCK
+#ifdef USE_GETBLOCK
+   m_pch->getBlock(gnd_rect, pointBlock);
+   for (ossim_uint32 id=0; id<pointBlock.size(); ++id)
+   {
+      pos = pointBlock[id]->getPosition();
+      theGeometry->worldToRn(pos, resLevel, ipt);
+      ipt.x = ossim::round<double,double>(ipt.x) - tile_offset.x;
+      ipt.y = ossim::round<double,double>(ipt.y) - tile_offset.y;
+
+      ossim_int32 bucketIndex = ipt.y*tile_width + ipt.x;
+      if ((bucketIndex >= 0) && (bucketIndex < (ossim_int32)tile_size))
+         addSample(accumulator, bucketIndex, pointBlock[id]);
+   }
+
+#else // using getFileBlock
+   ossim_uint32 numPoints = m_pch->getNumPoints();
+   if (numPoints > ossimPointCloudHandler::DEFAULT_BLOCK_SIZE)
+      numPoints = ossimPointCloudHandler::DEFAULT_BLOCK_SIZE;
+
+   // Loop to read all point blocks:
+   do
+   {
+      pointBlock.clear();
+      m_pch->getNextFileBlock(pointBlock, numPoints);
+      //m_pch->normalizeBlock(pointBlock);
+
+      for (ossim_uint32 id=0; id<pointBlock.size(); ++id)
+      {
+         // Check that each point in read block is inside the ROI before accumulating it:
+         pos = pointBlock[id]->getPosition();
+         if (gnd_rect.pointWithin(pos))
+         {
+            theGeometry->worldToRn(pos, resLevel, ipt);
+            ipt.x = ossim::round<double,double>(ipt.x) - tile_offset.x;
+            ipt.y = ossim::round<double,double>(ipt.y) - tile_offset.y;
+
+            ossim_int32 bucketIndex = ipt.y*tile_width + ipt.x;
+            if ((bucketIndex >= 0) && (bucketIndex < (ossim_int32)tile_size))
+               addSample(accumulator, bucketIndex, pointBlock[id]);
+         }
+      }
+   } while (pointBlock.size() == numPoints);
+#endif
+
+   // Finished accumulating, need to normalize and fill the tile.
+   // We must always blank out the tile as we may not have a point for every pixel.
+   normalize(accumulator);
+   ossim_float32** buf = new ossim_float32*[numBands];
+   std::map<ossim_int32, PcrBucket*>::iterator accum_iter;
+   ossim_float32 null_pixel = OSSIM_DEFAULT_NULL_PIX_FLOAT;
+   result->setNullPix(null_pixel);
+   for (ossim_uint32 band = 0; band < numBands; band++)
+   {
+      ossim_uint32 index = 0;
+      buf[band] = result->getFloatBuf(band);
+      for (ossim_uint32 y = 0; y < tile_height; y++)
+      {
+         for (ossim_uint32 x = 0; x < tile_width; x++)
+         {
+            accum_iter = accumulator.find(index);
+            if (accum_iter != accumulator.end())
+               buf[band][index] = accum_iter->second->m_bucket[band];
+            else
+               buf[band][index] = null_pixel;
+            ++index;
+         }
+      }
+   }
+
+   delete [] buf;
+   buf = 0;
+
+   std::map<ossim_int32, PcrBucket*>::iterator pcr_iter = accumulator.begin();
+   while (pcr_iter != accumulator.end())
+   {
+      delete pcr_iter->second;
+      pcr_iter++;
+   }
+
+   result->validate();
+   return true;
+}
+
+void ossimPointCloudImageHandler::addSample(std::map<ossim_int32, PcrBucket*>& accumulator,
+                                            ossim_int32 index,
+                                            const ossimPointRecord* sample)
+{
+   if (sample == 0)
+      return;
+
+   //cout << "sample: "<<*sample<<endl;//TODO: REMOVE DEBUG
+
+   // Search map for exisiting point in that location:
+   std::map<ossim_int32, PcrBucket*>::iterator iter = accumulator.find(index);
+   if (iter == accumulator.end())
+   {
+      // First hit. Initialize location with current sample:
+      if (m_activeComponent == INTENSITY)
+      {
+         accumulator[index] = new PcrBucket(sample->getField(ossimPointRecord::Intensity));
+      }
+      else if (m_activeComponent == RGB)
+      {
+         ossim_float32 color[3];
+         color[0] = sample->getField(ossimPointRecord::Red);
+         color[1] = sample->getField(ossimPointRecord::Green);
+         color[2] = sample->getField(ossimPointRecord::Blue);
+         accumulator[index] = new PcrBucket(color, 3);
+      }
+      else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
+         accumulator[index] = new PcrBucket(sample->getPosition().hgt);
+      else if (m_activeComponent == RETURNS)
+         accumulator[index] = new PcrBucket(sample->getField(ossimPointRecord::NumberOfReturns));
+   }
+   else
+   {
+      // Not the first hit at this location, accumulate:
+      // First hit. Initialize location with current sample:
+      if (m_activeComponent == INTENSITY)
+      {
+         iter->second->m_bucket[0] += sample->getField(ossimPointRecord::Intensity);
+      }
+      else if (m_activeComponent == RGB)
+      {
+         iter->second->m_bucket[0] += sample->getField(ossimPointRecord::Red);
+         iter->second->m_bucket[1] += sample->getField(ossimPointRecord::Green);
+         iter->second->m_bucket[2] += sample->getField(ossimPointRecord::Blue);
+      }
+      else if ((m_activeComponent == HIGHEST) &&
+            (sample->getPosition().hgt > iter->second->m_bucket[0]))
+         iter->second->m_bucket[0] = sample->getPosition().hgt;
+      else if ((m_activeComponent == LOWEST) &&
+            (sample->getPosition().hgt < iter->second->m_bucket[0]))
+         iter->second->m_bucket[0] = sample->getPosition().hgt;
+      else if (m_activeComponent == RETURNS)
+         iter->second->m_bucket[0] += sample->getField(ossimPointRecord::NumberOfReturns);
+
+      iter->second->m_numSamples++;
+   }
+}
+
+void ossimPointCloudImageHandler::normalize(std::map<ossim_int32, PcrBucket*>& accumulator)
+{
+   // highest and lowest elevations latch extremes, no mean is computed but needs to be normalized
+   if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST) ||
+         (m_activeComponent == RETURNS))
+      return;
+
+   int numBands = 1;
+   if (m_activeComponent == RGB)
+      numBands = 3;
+
+   std::map<ossim_int32, PcrBucket*>::iterator iter = accumulator.begin();
+   ossim_float32 avg;
+   while (iter != accumulator.end())
+   {
+      for (int i=0; i<numBands; i++)
+      {
+         avg = iter->second->m_bucket[i] / iter->second->m_numSamples;
+         iter->second->m_bucket[i] = avg;
+      }
+      iter++;
+   }
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getNumberOfInputBands() const
+{
+   ossim_uint32 numBands = 0;
+   if (m_pch.valid())
+   {
+      if (m_activeComponent == INTENSITY)
+         numBands = 1;
+      else if (m_activeComponent == RGB)
+         numBands = 3;
+      else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
+         numBands = 1;
+      else if (m_activeComponent == RETURNS)
+         numBands = 1;
+   }
+   return numBands;
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getNumberOfLines(ossim_uint32 resLevel) const
+{
+   ossim_uint32 result = 0;
+   if (isOpen() && theGeometry.valid())
+   {
+      ossimIpt image_size(theGeometry->getImageSize());
+      result = image_size.line;
+      if (resLevel)
+         result = (result >> resLevel);
+   }
+   return result;
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getNumberOfSamples(ossim_uint32 resLevel) const
+{
+   ossim_uint32 result = 0;
+   if (isOpen() && theGeometry.valid())
+   {
+      ossimIpt image_size(theGeometry->getImageSize());
+      result = image_size.samp;
+      if (resLevel)
+         result = (result >> resLevel);
+   }
+   return result;
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getImageTileWidth() const
+{
+   return getTileWidth();
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getImageTileHeight() const
+{
+   return getTileHeight();
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getTileWidth() const
+{
+   ossimIpt ipt;
+   ossim::defaultTileSize(ipt);
+   return ipt.x;
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getTileHeight() const
+{
+   ossimIpt ipt;
+   ossim::defaultTileSize(ipt);
+   return ipt.y;
+}
+
+ossimScalarType ossimPointCloudImageHandler::getOutputScalarType() const
+{
+   return OSSIM_FLOAT32;
+}
+
+void ossimPointCloudImageHandler::getEntryList(std::vector<ossim_uint32>& entryList) const
+{
+   entryList.clear();
+   for (ossim_uint32 i = 0; i < m_componentNames.size(); i++)
+   {
+      entryList.push_back(i);
+   }
+}
+
+void ossimPointCloudImageHandler::getEntryNames(std::vector<ossimString>& entryNames) const
+{
+   entryNames = m_componentNames;
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getCurrentEntry() const
+{
+   return (ossim_uint32) m_activeComponent;
+}
+
+bool ossimPointCloudImageHandler::setCurrentEntry(ossim_uint32 entryIdx)
+{
+   if (entryIdx >= NUM_COMPONENTS)
+      return false;
+
+   m_activeComponent = (Components) entryIdx;
+   if (m_pch.valid() && m_pch->getMinPoint() && m_pch->getMaxPoint())
+   {
+      if (m_activeComponent == INTENSITY)
+      {
+         m_minPixel = m_pch->getMinPoint()->getField(ossimPointRecord::Intensity);
+         m_maxPixel = m_pch->getMaxPoint()->getField(ossimPointRecord::Intensity);
+      }
+      else if (m_activeComponent == RGB)
+      {
+         m_minPixel = m_pch->getMinPoint()->getField(ossimPointRecord::Red);
+         m_maxPixel = m_pch->getMaxPoint()->getField(ossimPointRecord::Red);
+      }
+      else if ((m_activeComponent == LOWEST) || (m_activeComponent == HIGHEST))
+      {
+         m_minPixel = m_pch->getMinPoint()->getPosition().hgt;
+         m_maxPixel = m_pch->getMaxPoint()->getPosition().hgt;
+      }
+      else if (m_activeComponent == RETURNS)
+      {
+         m_minPixel = 0;
+         m_maxPixel = m_pch->getMaxPoint()->getField(ossimPointRecord::NumberOfReturns);
+      }
+   }
+
+   return true;
+}
+
+ossimString ossimPointCloudImageHandler::getShortName() const
+{
+   return ossimString("Point Cloud Image Handler");
+}
+
+ossimString ossimPointCloudImageHandler::getLongName() const
+{
+   return ossimString("ossim point cloud to image renderer");
+}
+
+double ossimPointCloudImageHandler::getMinPixelValue(ossim_uint32 /* band */) const
+{
+   return m_minPixel;
+}
+
+double ossimPointCloudImageHandler::getMaxPixelValue(ossim_uint32 /* band */) const
+{
+   return m_maxPixel;
+}
+
+double ossimPointCloudImageHandler::getNullPixelValue(ossim_uint32 /* band */) const
+{
+   return OSSIM_DEFAULT_NULL_PIX_FLOAT;
+}
+
+ossim_uint32 ossimPointCloudImageHandler::getNumberOfDecimationLevels() const
+{
+   // Can support any number of rlevels.
+   ossim_uint32 result = 1;
+   const ossim_uint32 STOP_DIMENSION = 16;
+   ossim_uint32 largestImageDimension =
+         getNumberOfSamples(0) > getNumberOfLines(0) ? getNumberOfSamples(0) : getNumberOfLines(0);
+   while (largestImageDimension > STOP_DIMENSION)
+   {
+      largestImageDimension /= 2;
+      ++result;
+   }
+   return result;
+}
+
+void ossimPointCloudImageHandler::initTile()
+{
+   const ossim_uint32 BANDS = getNumberOfOutputBands();
+
+   m_tile = new ossimImageData(this, getOutputScalarType(), BANDS, getTileWidth(), getTileHeight());
+
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      m_tile->setMinPix(getMinPixelValue(band), band);
+      m_tile->setMaxPix(getMaxPixelValue(band), band);
+      m_tile->setNullPix(getNullPixelValue(band), band);
+   }
+
+   m_tile->initialize();
+}
+
+void ossimPointCloudImageHandler::getGSD(ossimDpt& gsd, ossim_uint32 resLevel) const
+{
+   // std::pow(2.0, 0) returns 1.
+   ossim_float64 d = std::pow(2.0, static_cast<double>(resLevel));
+   gsd.x = m_gsd.x * d;
+   gsd.y = m_gsd.y * d;
+}
+
+void ossimPointCloudImageHandler::setGSD(const ossim_float64& gsd)
+{
+   if (ossim::isnan(gsd) || (gsd<=0.0) || !theGeometry.valid())
+         return;
+
+   m_gsd = ossimDpt(gsd, gsd);
+   m_gsdFactor = 1.0; // resets after GSD adjusted
+
+   ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>(theGeometry->getProjection());
+   if (!proj)
+      return;
+
+   proj->setMetersPerPixel(m_gsd);
+
+   ossimGrect bounds;
+   m_pch->getBounds(bounds);
+
+   ossimDpt ipt_ul, ipt_lr;
+   theGeometry->worldToLocal(bounds.ul(), ipt_ul);
+   theGeometry->worldToLocal(bounds.lr(), ipt_lr);
+   ossimIpt image_size;
+   image_size.x = ossim::round<ossim_int32,double>(ipt_lr.x - ipt_ul.x) + 1;
+   image_size.y = ossim::round<ossim_int32,double>(ipt_lr.y - ipt_ul.y) + 1;
+
+   theGeometry->setImageSize(image_size);
+}
+
+bool ossimPointCloudImageHandler::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   static const char MODULE[] = "ossimPointCloudImageHandler::saveState()";
+
+   ossimImageHandler::saveState(kwl, prefix);
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << MODULE
+            << " ERROR detected in keyword list!  State not saved." << std::endl;
+      return false;
+   }
+
+   kwl.add(prefix, ossimKeywordNames::ENTRY_KW, (int) m_activeComponent, true);
+   kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW, m_gsd.x, true);
+
+   return true;
+}
+
+bool ossimPointCloudImageHandler::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   static const char MODULE[] = "ossimPointCloudImageHandler::loadState()";
+   theDecimationFactors.clear();
+   if(traceDebug())
+      ossimNotify(ossimNotifyLevel_DEBUG)<< MODULE << " DEBUG: entered ..."<< std::endl;
+
+   ossimImageHandler::loadState(kwl, prefix);
+   if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_ERROR)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<< MODULE
+            << "WARNING: error detected in keyword list!  State not load." << std::endl;
+      return false;
+   }
+
+   m_activeComponent = INTENSITY;
+   ossimString value = kwl.find(prefix, ossimKeywordNames::ENTRY_KW);
+   if (!value.empty())
+   {
+      ossim_uint32 i = value.toUInt32();
+      if (i < NUM_COMPONENTS)
+         m_activeComponent = (Components) i;
+   }
+
+   value = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_KW);
+   if (!value.empty())
+      setGSD(value.toDouble());
+
+   // The rest of the state is established by opening the file:
+   bool good_open = open();
+
+   return good_open;
+}
+
+void ossimPointCloudImageHandler::getValidImageVertices(std::vector<ossimIpt>& validVertices,
+                                   ossimVertexOrdering ordering,
+                                   ossim_uint32 resLevel) const
+{
+   validVertices.clear();
+   if (!m_pch.valid())
+      return;
+   int divisor = 1;
+   if (resLevel)
+      divisor = resLevel<<1;
+
+   // Transform the world coords for the four vertices into image vertices:
+   ossimDpt r0Pt;
+   ossimGrect bounds;
+   m_pch->getBounds(bounds);
+   theGeometry->worldToLocal(bounds.ul(), r0Pt);
+   validVertices.push_back(r0Pt);
+   theGeometry->worldToLocal(bounds.ur(), r0Pt);
+   validVertices.push_back(r0Pt);
+   theGeometry->worldToLocal(bounds.lr(), r0Pt);
+   validVertices.push_back(r0Pt);
+   theGeometry->worldToLocal(bounds.ll(), r0Pt);
+   validVertices.push_back(r0Pt);
+
+   if (ordering == OSSIM_COUNTERCLOCKWISE_ORDER)
+   {
+      for (int i=3; i>=0; i--)
+         validVertices.push_back(validVertices[i]/divisor);
+      validVertices.erase(validVertices.begin(), validVertices.begin()+4);
+   }
+}
+
+void ossimPointCloudImageHandler::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if (!property.valid())
+      return;
+
+   ossimString s;
+   property->valueToString(s);
+   if (s.empty())
+      return;
+
+   // The user should select either explicit GSD or relative GSD factor, never both:
+   if ( property->getName() == ossimKeywordNames::METERS_PER_PIXEL_KW )
+   {
+      ossim_float64 gsd = s.toFloat64();
+      if (!ossim::isnan(gsd))
+         setGSD(gsd);
+   }
+   else if ( property->getName() == GSD_FACTOR_KW )
+   {
+      m_gsdFactor = s.toDouble();
+      if (!ossim::isnan(m_gsdFactor))
+      {
+         if (!m_gsd.hasNans())
+            setGSD(m_gsd.x * m_gsdFactor);
+      }
+      else
+         m_gsdFactor = 1.0;
+   }
+   else if ( property->getName() == ossimKeywordNames::ENTRY_KW )
+   {
+      m_activeComponent = (Components) s.toUInt32();
+   }
+   else if ( property->getName() == COMPONENT_KW )
+   {
+      for (int i=0; i<NUM_COMPONENTS; i++)
+      {
+         if (s.upcase() == m_componentNames[i])
+         {
+            m_activeComponent = (Components) i;
+            break;
+         }
+      }
+   }
+   else
+   {
+      ossimImageHandler::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimPointCloudImageHandler::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> prop = 0;
+   if ( name == ossimKeywordNames::METERS_PER_PIXEL_KW )
+   {
+      ossimString value = ossimString::toString(m_gsd.x);
+      prop = new ossimStringProperty(name, value);
+   }
+   else if ( name == GSD_FACTOR_KW )
+   {
+      prop = new ossimNumericProperty(name, ossimString::toString(m_gsdFactor));
+   }
+   else if ( name == ossimKeywordNames::ENTRY_KW )
+   {
+      prop = new ossimNumericProperty(name, ossimString::toString((ossim_uint32) m_activeComponent));
+   }
+   else if ( name == COMPONENT_KW )
+   {
+      prop = new ossimStringProperty(name, m_componentNames[m_activeComponent]);
+   }
+   else
+   {
+      prop = ossimImageHandler::getProperty(name);
+   }
+   return prop;
+}
+
+ossim_uint32 ossimPointCloudImageHandler::componentToFieldCode() const
+{
+   ossim_uint32 field_code = 0;
+   switch (m_activeComponent)
+   {
+   case INTENSITY:
+      field_code = ossimPointRecord::Intensity;
+      break;
+   case RETURNS:
+      field_code = ossimPointRecord::NumberOfReturns;
+      break;
+   case RGB:
+      field_code = ossimPointRecord::Red | ossimPointRecord::Green | ossimPointRecord::Blue;
+      break;
+   default:
+      break;
+   }
+   return field_code;
+}
+
+
diff --git a/ossim/src/ossim/point_cloud/ossimPointCloudImageHandlerFactory.cpp b/src/point_cloud/ossimPointCloudImageHandlerFactory.cpp
similarity index 100%
rename from ossim/src/ossim/point_cloud/ossimPointCloudImageHandlerFactory.cpp
rename to src/point_cloud/ossimPointCloudImageHandlerFactory.cpp
diff --git a/src/point_cloud/ossimPointCloudSource.cpp b/src/point_cloud/ossimPointCloudSource.cpp
new file mode 100644
index 0000000..d778646
--- /dev/null
+++ b/src/point_cloud/ossimPointCloudSource.cpp
@@ -0,0 +1,66 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+
+#include <ossim/point_cloud/ossimPointCloudSource.h>
+#include <ossim/point_cloud/ossimPointCloudGeometry.h>
+#include <ossim/point_cloud/ossimPointRecord.h>
+
+RTTI_DEF1(ossimPointCloudSource, "ossimPointCloudSource" , ossimSource);
+
+
+ossimPointCloudSource::ossimPointCloudSource(ossimObject* owner)
+      : ossimSource(owner)
+{
+}
+
+ossimPointCloudSource::ossimPointCloudSource(const ossimPointCloudSource& rhs)
+      : ossimSource(rhs)
+{
+}
+
+ossimPointCloudSource::~ossimPointCloudSource()
+{
+}
+
+const ossimPointRecord*  ossimPointCloudSource::getMinPoint() const
+{
+   if (getInput(0) == 0)
+      return &m_nullPCR;
+
+   return ((ossimPointCloudSource*)getInput(0))->getMinPoint();
+}
+
+const ossimPointRecord*  ossimPointCloudSource::getMaxPoint() const
+{
+   if (getInput(0) == 0)
+      return &m_nullPCR;
+
+   return ((ossimPointCloudSource*)getInput(0))->getMaxPoint();
+}
+
+ossim_uint32  ossimPointCloudSource::getFieldCode() const
+{
+   if (getInput(0) == 0)
+      return 0;
+
+   return ((ossimPointCloudSource*)getInput(0))->getFieldCode();
+}
+
+void ossimPointCloudSource::setFieldCode(ossim_uint32 fc)
+{
+   if (getInput(0) != 0)
+      ((ossimPointCloudSource*) getInput(0))->setFieldCode(fc);
+}
+
+bool ossimPointCloudSource::canConnectMyInputTo(ossim_int32 i,const ossimConnectableObject* p) const
+{
+   if ( (i>0) || (p==0) )
+      return false;
+
+   return (p->canCastTo("ossimPointCloudSource"));
+}
diff --git a/src/point_cloud/ossimPointCloudUtilityFilter.cpp b/src/point_cloud/ossimPointCloudUtilityFilter.cpp
new file mode 100644
index 0000000..2cf6e88
--- /dev/null
+++ b/src/point_cloud/ossimPointCloudUtilityFilter.cpp
@@ -0,0 +1,94 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+//*******************************************************************
+//  $Id$
+
+#include <ossim/point_cloud/ossimPointCloudUtilityFilter.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/util/ossimPointCloudUtil.h>
+
+RTTI_DEF1(ossimPointCloudUtilityFilter, "ossimPointCloudUtilityFilter", ossimImageSourceFilter);
+
+
+ossimPointCloudUtilityFilter::ossimPointCloudUtilityFilter( ossimPointCloudUtil* pc_util)
+:  m_util (pc_util)
+{
+}
+
+bool ossimPointCloudUtilityFilter::getTile(ossimImageData* result, ossim_uint32 resLevel)
+{
+   if (!result)
+      return false;
+
+   ossimIrect irect (result->getImageRectangle());
+   ossimIpt ipt;
+   ossimGpt gpt;
+   double h, dh;
+   ossimElevManager* elevation = ossimElevManager::instance();
+   ossimRefPtr<ossimImageData> highest = 0;
+   ossimRefPtr<ossimImageData> lowest = 0;
+
+   // Fetch tile from inputs as needed:
+   if ((m_util->m_operation == ossimPointCloudUtil::HIGHEST_DEM) ||
+         (m_util->m_operation == ossimPointCloudUtil::HIGHEST_LOWEST))
+   {
+      m_util->m_pciHandler->setCurrentEntry(ossimPointCloudImageHandler::HIGHEST);
+      highest = m_util->m_pciHandler->getTile(irect, resLevel);
+   }
+   if ((m_util->m_operation == ossimPointCloudUtil::LOWEST_DEM) ||
+         (m_util->m_operation == ossimPointCloudUtil::HIGHEST_LOWEST))
+   {
+      m_util->m_pciHandler->setCurrentEntry(ossimPointCloudImageHandler::LOWEST);
+      lowest = m_util->m_pciHandler->getTile(irect, resLevel);
+   }
+
+   // Now loop over all pixels in tile and perform operations as needed:
+   ossimIpt pt_l0;
+   for (ipt.y=irect.ul().y; ipt.y<=irect.lr().y; ++ipt.y)
+   {
+      for (ipt.x=irect.ul().x; ipt.x<=irect.lr().x; ++ipt.x)
+      {
+         pt_l0 = ipt * (resLevel + 1);
+         switch (m_util->m_operation)
+         {
+         case ossimPointCloudUtil::HIGHEST_DEM:
+            m_util->m_prodGeom->localToWorld(pt_l0, gpt);
+            h = elevation->getHeightAboveEllipsoid(gpt);
+            dh = highest->getPix(ipt) - h;
+            break;
+
+         case ossimPointCloudUtil::HIGHEST_LOWEST:
+            dh = highest->getPix(ipt) - lowest->getPix(ipt);
+            break;
+
+         default: // LOWEST_DEM
+            m_util->m_prodGeom->localToWorld(pt_l0, gpt);
+            h = elevation->getHeightAboveEllipsoid(gpt);
+            dh = lowest->getPix(ipt) - h;
+            break;
+
+         }
+         result->setValue(ipt.x, ipt.y, dh);
+      }
+   }
+
+   result->validate();
+   return true;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimPointCloudUtilityFilter::getImageGeometry()
+{
+   if (!m_util.valid())
+      return 0;
+   return m_util->m_prodGeom;
+}
+
diff --git a/src/point_cloud/ossimPointRecord.cpp b/src/point_cloud/ossimPointRecord.cpp
new file mode 100644
index 0000000..d40323d
--- /dev/null
+++ b/src/point_cloud/ossimPointRecord.cpp
@@ -0,0 +1,179 @@
+//**************************************************************************************************
+//
+// OSSIM (http://trac.osgeo.org/ossim/)
+//
+// License:  LGPL -- See LICENSE.txt file in the top level directory for more details.
+//
+//**************************************************************************************************
+// $Id: ossimPointRecord.cpp 23352 2015-05-29 17:38:12Z okramer $
+
+#include <ossim/point_cloud/ossimPointRecord.h>
+
+ossimPointRecord::ossimPointRecord(ossim_uint32 field_code)
+      : m_pointId(0)
+{
+   if (field_code & Intensity)
+      m_fieldMap[Intensity] = ossim::nan();
+   if (field_code & ReturnNumber)
+      m_fieldMap[ReturnNumber] = ossim::nan();
+   if (field_code & NumberOfReturns)
+      m_fieldMap[NumberOfReturns] = ossim::nan();
+   if (field_code & Red)
+      m_fieldMap[Red] = ossim::nan();
+   if (field_code & Green)
+      m_fieldMap[Green] = ossim::nan();
+   if (field_code & Blue)
+      m_fieldMap[Blue] = ossim::nan();
+   if (field_code & GpsTime)
+      m_fieldMap[GpsTime] = ossim::nan();
+   if (field_code & Infrared)
+      m_fieldMap[Infrared] = ossim::nan();
+}
+
+ossimPointRecord::ossimPointRecord(const ossimPointRecord& pcr)
+      : m_pointId(pcr.m_pointId),
+        m_position(pcr.m_position),
+        m_fieldMap (pcr.m_fieldMap)
+{
+}
+
+ossimPointRecord::ossimPointRecord(const ossimGpt& pos)
+      : m_pointId(0),
+        m_position(pos)
+{
+}
+
+ossimPointRecord::~ossimPointRecord()
+{
+}
+
+inline bool ossimPointRecord::hasFields(ossim_uint32 field_code) const
+{
+   bool found = true;
+
+   if (field_code & Intensity)
+      found &= m_fieldMap.find(Intensity) != m_fieldMap.end();
+   if (found && (field_code & ReturnNumber))
+         found = m_fieldMap.find(ReturnNumber) != m_fieldMap.end();
+   if (found && (field_code & NumberOfReturns))
+         found = m_fieldMap.find(NumberOfReturns) != m_fieldMap.end();
+   if (found && (field_code & Red))
+         found = m_fieldMap.find(Red) != m_fieldMap.end();
+   if (found && (field_code & Green))
+         found = m_fieldMap.find(Green) != m_fieldMap.end();
+   if (found && (field_code & Blue))
+         found = m_fieldMap.find(Blue) != m_fieldMap.end();
+   if (found && (field_code & GpsTime))
+         found = m_fieldMap.find(GpsTime) != m_fieldMap.end();
+   if (found && (field_code & Infrared))
+         found = m_fieldMap.find(Infrared) != m_fieldMap.end();
+
+   return found;
+}
+
+inline ossim_uint32 ossimPointRecord::getFieldCode() const
+{
+   ossim_uint32 field_code = 0;
+
+   if (m_fieldMap.find(Intensity) != m_fieldMap.end())
+      field_code |= Intensity;
+   if (m_fieldMap.find(ReturnNumber) != m_fieldMap.end())
+      field_code |= ReturnNumber;
+   if (m_fieldMap.find(NumberOfReturns) != m_fieldMap.end())
+      field_code |= NumberOfReturns;
+   if (m_fieldMap.find(Red) != m_fieldMap.end())
+      field_code |= Red;
+   if (m_fieldMap.find(Green) != m_fieldMap.end())
+      field_code |= Green;
+   if (m_fieldMap.find(Blue) != m_fieldMap.end())
+      field_code |= Blue;
+   if (m_fieldMap.find(GpsTime) != m_fieldMap.end())
+      field_code |= GpsTime;
+   if (m_fieldMap.find(Infrared) != m_fieldMap.end())
+      field_code |= Infrared;
+
+   return field_code;
+}
+
+ossim_float32 ossimPointRecord::getField(FIELD_CODES fc) const
+{
+   std::map<FIELD_CODES, ossim_float32>::const_iterator v = m_fieldMap.find(fc);
+   if (v == m_fieldMap.end())
+      return ossim::nan();
+   return v->second;
+}
+
+void  ossimPointRecord::setField(FIELD_CODES fc, ossim_float32 value)
+{
+   m_fieldMap[fc] = value;
+}
+
+
+ossimPointRecord& ossimPointRecord::operator=(const ossimPointRecord& pcr)
+{
+   if (this == &pcr)
+      return *this;
+
+   m_pointId = pcr.m_pointId;
+   m_position = pcr.m_position;
+   m_fieldMap = pcr.m_fieldMap;
+
+   return *this;
+}
+
+std::ostream& operator << (std::ostream& out, const ossimPointRecord& p)
+{
+   out   << "ossimPointCloudRecord for pointId: " << p.m_pointId
+         << "\n   Position: " << p.m_position << ends;
+
+   std::map<ossimPointRecord::FIELD_CODES, ossim_float32>::const_iterator iter = p.m_fieldMap.begin();
+   while (iter != p.m_fieldMap.end())
+   {
+      switch (iter->first)
+      {
+      case ossimPointRecord::Intensity:
+         out << "\n   Intensity: ";
+         break;
+      case ossimPointRecord::ReturnNumber:
+         out << "\n   ReturnNumber: ";
+         break;
+      case ossimPointRecord::NumberOfReturns:
+         out << "\n   NumberOfReturns: ";
+         break;
+      case ossimPointRecord::Red:
+         out << "\n   Red: ";
+         break;
+      case ossimPointRecord::Green:
+         out << "\n   Green: ";
+         break;
+      case ossimPointRecord::Blue:
+         out << "\n   Blue: ";
+         break;
+      case ossimPointRecord::GpsTime:
+         out << "\n   GpsTime: ";
+         break;
+      case ossimPointRecord::Infrared:
+         out << "\n   Infrared: ";
+         break;
+      default:
+         out << "\n   Unidentified: ";
+      }
+      out << iter->second;
+      ++iter;
+   }
+   return out;
+}
+
+void ossimPointRecord::clear()
+{
+   m_pointId = 0;
+}
+
+bool ossimPointRecord::isValid() const
+{
+   if ((m_pointId == 0) || m_fieldMap.empty() || m_position.hasNans())
+      return false;
+   return true;
+}
+
+
diff --git a/src/projection/ossimAdjMapModel.cpp b/src/projection/ossimAdjMapModel.cpp
new file mode 100644
index 0000000..6b5f638
--- /dev/null
+++ b/src/projection/ossimAdjMapModel.cpp
@@ -0,0 +1,430 @@
+//----------------------------------------------------------------------------
+// Copyright (c) 2005, Oscar Kramer, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+// Description:
+// 
+// Special "sensor model" that provides a conventional map projection but
+// with additional capability for adjusting the map x,y coordinates with
+// offset, scale, and rotation transform.  Funtions to control notifications,
+// information and error output.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimAdjMapModel.cpp 15766 2009-10-20 12:37:09Z gpotts $
+
+#include <cstdlib> /* for atof */
+#include <ossim/projection/ossimAdjMapModel.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/projection/ossimMapProjectionFactory.h>
+#include <ossim/elevation/ossimElevManager.h>
+
+// Geometry File Keywords:
+static const char* PARAMETER_KEYWORDS[] = {"map_offset_x",
+                                           "map_offset_y",
+                                           "map_rotation",
+                                           "map_scale_x",
+                                           "map_scale_y"};
+static const char* MAP_PROJ_FILE_KW    = "map_proj_filename";
+
+RTTI_DEF1(ossimAdjMapModel, "ossimAdjMapModel", ossimSensorModel);
+
+//----------------------------------------------------------------------------
+//! Constructs to uninitialized state (needed by factory).
+//----------------------------------------------------------------------------
+
+ossimAdjMapModel::ossimAdjMapModel()
+   :
+   ossimSensorModel(),
+   theAdjParams(NUM_ADJ_PARAMS),
+   theMapProjection(),
+   theCosTheta(0.0),
+   theSinTheta(0.0)
+{
+   theImageSize = ossimIpt(0,0);
+   initAdjustableParameters();
+   theErrorStatus++;
+}
+
+//----------------------------------------------------------------------------
+//! Constructs with map projection and image rectangle size.
+//----------------------------------------------------------------------------
+
+ossimAdjMapModel::ossimAdjMapModel(ossimMapProjection* map_proj,
+                                   const ossimIpt& image_size)
+   :
+   ossimSensorModel(),
+   theAdjParams(NUM_ADJ_PARAMS),
+   theMapProjection(map_proj),
+   theCosTheta(0.0),
+   theSinTheta(0.0)
+{
+   initializeFromMap();
+   theImageSize = image_size;
+   initAdjustableParameters();
+}
+
+//----------------------------------------------------------------------------
+//! Copy constructor
+//----------------------------------------------------------------------------
+
+ossimAdjMapModel::ossimAdjMapModel(const ossimAdjMapModel& copy_this)
+   :
+   ossimSensorModel(copy_this),
+   theAdjParams(NUM_ADJ_PARAMS),
+   theMapProjection(copy_this.theMapProjection),
+   theCosTheta(0.0),
+   theSinTheta(0.0)
+{
+   theAdjParams = copy_this.theAdjParams;
+}
+
+//----------------------------------------------------------------------------
+//! Constructs from Geom KWL
+//----------------------------------------------------------------------------
+ossimAdjMapModel::ossimAdjMapModel(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+   :
+   ossimSensorModel(kwl),
+   theAdjParams(NUM_ADJ_PARAMS),
+   theMapProjection(),
+   theCosTheta(0.0),
+   theSinTheta(0.0)      
+                
+{
+   initAdjustableParameters();
+   loadState(kwl, prefix);
+}
+
+//----------------------------------------------------------------------------
+//! Constructs from Geom KWL
+//----------------------------------------------------------------------------
+
+ossimAdjMapModel::ossimAdjMapModel(const ossimFilename& kwl_filename)
+   :
+   ossimSensorModel(),
+   theAdjParams(NUM_ADJ_PARAMS),
+   theMapProjection(),
+   theCosTheta(0.0),
+   theSinTheta(0.0)      
+{
+   initAdjustableParameters();
+   ossimKeywordlist kwl (kwl_filename);
+   loadState(kwl);
+}
+
+//----------------------------------------------------------------------------
+//! Initializes base class data members after map model established. Returns TRUE if all's well.
+//----------------------------------------------------------------------------
+bool ossimAdjMapModel::initializeFromMap()
+{
+   if (!theMapProjection)
+   {
+      theErrorStatus++;
+      return false;
+   }
+   theSensorID = "AdjMapModel";
+   theGSD = theMapProjection->getMetersPerPixel();
+   theMeanGSD = 0.5*(theGSD.x + theGSD.y);
+   theRefGndPt = theMapProjection->origin();
+
+   return true;
+}
+
+//----------------------------------------------------------------------------
+//! Destructor
+//----------------------------------------------------------------------------
+ossimAdjMapModel::~ossimAdjMapModel()
+{
+   theAdjParams.CleanUp();
+}
+
+//----------------------------------------------------------------------------
+//! Initializes adjustable parameters to their default values.
+//! Overrides ossimAdjustableParameterInterface virtual method.
+//----------------------------------------------------------------------------
+void ossimAdjMapModel::initAdjustableParameters()
+{
+   // Initialize this adjustment as the initial geometry "adjustment":
+   removeAllAdjustments();
+   newAdjustment(NUM_ADJ_PARAMS);
+   setAdjustmentDescription("Initial Geometry");
+
+   // Initialize each adjustable parameter for this initial:
+   setAdjustableParameter (OFFSET_X, 0.0, 1.0);
+   setParameterDescription(OFFSET_X, "map_offset_x");
+   setParameterCenter     (OFFSET_X, 0.0);
+
+   setAdjustableParameter (OFFSET_Y, 0.0, 1.0);
+   setParameterDescription(OFFSET_Y, "map_offset_y");
+   setParameterCenter     (OFFSET_Y, 0.0);
+
+   setAdjustableParameter (ROTATION, 0.0, 1.0);
+   setParameterDescription(ROTATION, "map_rotation");
+   setParameterCenter     (ROTATION, 0.0);
+
+   setAdjustableParameter (SCALE_X, 0.0, 1.0);
+   setParameterDescription(SCALE_X, "map_scale_x");
+   setParameterCenter     (SCALE_X, 1.0);
+
+   setAdjustableParameter (SCALE_Y, 0.0, 1.0);
+   setParameterDescription(SCALE_Y, "map_scale_y");
+   setParameterCenter     (SCALE_Y, 1.0);
+
+   updateModel();
+}
+
+//----------------------------------------------------------------------------
+//! Following a change to the adjustable parameter set, this virtual is called
+//! to permit instances to compute derived quantities after parameter change.
+//----------------------------------------------------------------------------
+void ossimAdjMapModel::updateModel()
+{
+   for (int i=0; i<NUM_ADJ_PARAMS; i++)
+      theAdjParams[i] = computeParameterOffset(i);
+
+   theCosTheta = ossim::cosd(theAdjParams[ROTATION]);
+   theSinTheta = ossim::sind(theAdjParams[ROTATION]);
+}
+
+//----------------------------------------------------------------------------
+//! Overrides base class pure virtual.
+//----------------------------------------------------------------------------
+void ossimAdjMapModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                     const double&   heightEllipsoid,
+                                     ossimGpt&       worldPoint) const
+{
+   // Just call other transform method 
+   // Check for bad map projection pointer:
+   if (!theMapProjection)
+   {
+      worldPoint = ossimGpt(ossim::nan(), ossim::nan(), ossim::nan());
+      return;
+   }
+
+   // Adjust image point by transform:
+   double x = theAdjParams[SCALE_X]*(image_point.x - theAdjParams[OFFSET_X]);
+   double y = theAdjParams[SCALE_Y]*(image_point.y - theAdjParams[OFFSET_Y]);
+   ossimDpt adjusted_point(x*theCosTheta + y*theSinTheta, 
+                           y*theCosTheta - x*theSinTheta);
+
+   // Obtain ground point given adjusted image point:
+   theMapProjection->lineSampleHeightToWorld(adjusted_point,
+                                             heightEllipsoid,
+                                             worldPoint);
+   worldPoint.height(heightEllipsoid);
+}
+
+//----------------------------------------------------------------------------
+//! Overrides base class virtual.
+//----------------------------------------------------------------------------
+void ossimAdjMapModel::lineSampleToWorld(const ossimDpt& image_point,
+                                         ossimGpt&       worldPoint) const
+{
+   lineSampleHeightToWorld(image_point, 0.0, worldPoint);
+   if (!worldPoint.hasNans())
+   {
+//      worldPoint.height(theElevation->getHeightAboveEllipsoid(worldPoint));
+   }
+}
+
+//----------------------------------------------------------------------------
+//! Rigorous inverse transform implented, overrides base-class' iterative
+//! solution.
+//----------------------------------------------------------------------------
+void ossimAdjMapModel::worldToLineSample(const ossimGpt& world_point,
+                                         ossimDpt&       image_point) const
+{
+   // Check for bad map projection pointer:
+   if (!theMapProjection)
+   {
+      image_point = ossimDpt(ossim::nan(), ossim::nan());
+      return;
+   }
+
+   // Obtain non-adjusted image point given ground point:
+   ossimDpt p1;
+   theMapProjection->worldToLineSample(world_point, p1);
+
+   // Adjust image point by transform:
+   ossimDpt p2 (p1.x*theCosTheta - p1.y*theSinTheta, 
+                p1.y*theCosTheta + p1.x*theSinTheta);
+   image_point.x = p2.x/theAdjParams[SCALE_X] + theAdjParams[OFFSET_X];
+   image_point.y = p2.y/theAdjParams[SCALE_Y] + theAdjParams[OFFSET_Y];
+}
+
+//----------------------------------------------------------------------------
+//! Fulfills ossimObject base-class pure virtuals. Saves geometry
+//! KWL files. Returns true if successful.
+//----------------------------------------------------------------------------
+bool ossimAdjMapModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   // Save off map projection info:
+   if (theMapProjection.valid())
+   {
+      ossimString map_prefix(prefix);
+      if (map_prefix.size() && (map_prefix[map_prefix.size()-1] != '.'))
+            map_prefix += ".";
+      map_prefix += "map_proj.";
+      theMapProjection->saveState(kwl, map_prefix.chars());
+   }
+
+   // Hand off to base class for common stuff:
+   ossimSensorModel::saveState(kwl, prefix);
+
+   // Save off data members:
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimAdjMapModel");
+   for (int i=0; i<NUM_ADJ_PARAMS; i++)
+      kwl.add(prefix, PARAMETER_KEYWORDS[i], theAdjParams[i]);
+
+   return true;
+}
+
+//----------------------------------------------------------------------------
+//! Fulfills ossimObject base-class pure virtuals. Loads geometry
+//! KWL files. Returns true if successful.
+//----------------------------------------------------------------------------
+bool ossimAdjMapModel::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   static const ossimString MODULE ("ossimAdjMapModel::loadState() -- ");
+   bool success = true;
+   const char* value_str;
+   double value;
+   ossimString error_msg (MODULE+"Error encountered reading keyword: ");
+
+   try
+   {
+      // Verify correct model type:
+      value_str = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+      if ((!value_str) || (strcmp(value_str, TYPE_NAME(this))))
+      {
+         throw (error_msg + ossimKeywordNames::TYPE_KW);
+      }
+
+      ossimString map_prefix(prefix);
+      if (map_prefix.size() && (map_prefix[map_prefix.size()-1] != '.'))
+            map_prefix += ".";
+      map_prefix += "map_proj.";
+      theMapProjection = dynamic_cast<ossimMapProjection*>(
+         ossimMapProjectionFactory::instance()->createProjection(kwl, map_prefix.chars()));
+
+      //---
+      // Instantiate the map projection via the factory if one has not been
+      // initialized yet:
+      //---
+      if (!theMapProjection)
+      {
+         // should find the map projection filename in the KWL:
+         value_str = kwl.find(prefix, MAP_PROJ_FILE_KW);
+         if (!value_str)
+         {
+            throw (error_msg + MAP_PROJ_FILE_KW);
+         }
+         theMapProjection = PTR_CAST(ossimMapProjection,
+            ossimMapProjectionFactory::instance()->createProjection(ossimKeywordlist(value_str)));
+         if (!theMapProjection)
+         {
+            throw "Error encountered instantiating map ";
+         }
+      }
+
+      // Hand off to base class for common stuff:
+      ossimSensorModel::loadState(kwl, prefix);
+
+      // Everything OK so far, just load in the adjustable parameters. This involves modifying the
+      // center value of the bsae class adjustable parameter:
+      for (int i=0; i<NUM_ADJ_PARAMS; i++)
+      {
+         value_str = kwl.find(prefix, PARAMETER_KEYWORDS[i]);
+         if (!value_str)
+         {
+            throw (error_msg + PARAMETER_KEYWORDS[i]).chars();
+         }
+         value = atof(value_str);
+         setParameterCenter(i, value);
+      }
+   }
+   catch (const char* /*message*/)
+   {
+      theErrorStatus++;
+      success = false;
+   }
+
+   //---
+   // updateModel() reads the base class adjustable parameters and initializes
+   // theAdjParams
+   // with the unnormalized, biased (to the "center" set above) quantities
+   // used in the projection:
+   //---
+   if (success)
+   {
+      initializeFromMap();
+      updateModel();
+   }
+
+   return success;
+}  
+
+//----------------------------------------------------------------------------
+//! Writes a template of geom keywords processed by loadState and saveState to
+//! output stream.
+//----------------------------------------------------------------------------
+void ossimAdjMapModel::writeGeomTemplate(ostream& os)
+{
+   os <<
+      "//*****************************************************************\n"
+      "// Template for Adjustable Map Model keywordlist\n"
+      "//*****************************************************************\n"
+      << ossimKeywordNames::TYPE_KW << ": " << "ossimFcsiModel" << endl;
+
+   ossimSensorModel::writeGeomTemplate(os);
+
+   os << "//***\n"
+      << "// Derived-class AdjMapModel Keywords:\n"
+      << "//***\n"
+      << PARAMETER_KEYWORDS[OFFSET_X] << ": <east offset meters>\n"
+      << PARAMETER_KEYWORDS[OFFSET_Y] << ": <north offset meters>\n"
+      << PARAMETER_KEYWORDS[ROTATION] << ": <degrees CW>\n"
+      << PARAMETER_KEYWORDS[SCALE_X]  << ": <ratio>\n"
+      << PARAMETER_KEYWORDS[SCALE_Y]  << ": <ratio>\n"
+      << endl;
+
+   return;
+}
+
+//----------------------------------------------------------------------------
+//! Extends base-class implementation. Dumps contents of object to ostream.
+//----------------------------------------------------------------------------
+std::ostream& ossimAdjMapModel::print(std::ostream& out) const
+{      
+   ossimSensorModel::print(out);
+   for (int i=0; i<NUM_ADJ_PARAMS; i++)
+      out << PARAMETER_KEYWORDS[i]  << ": " << theAdjParams[i] << endl;
+   out << endl;
+
+   return out;
+}
+
+//----------------------------------------------------------------------------
+//! Fetches the GSD from the internal map projection.
+//----------------------------------------------------------------------------
+ossimDpt ossimAdjMapModel::getMetersPerPixel () const
+{
+   if (theMapProjection.valid())
+   {
+      return theMapProjection->getMetersPerPixel();
+   }
+   
+   return ossimDpt(0,0);
+}
+
+ossimObject* ossimAdjMapModel::dup() const
+{
+   return new ossimAdjMapModel(*this);
+}
+
diff --git a/ossim/src/ossim/projection/ossimAffineProjection.cpp b/src/projection/ossimAffineProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimAffineProjection.cpp
rename to src/projection/ossimAffineProjection.cpp
diff --git a/src/projection/ossimAlbersProjection.cpp b/src/projection/ossimAlbersProjection.cpp
new file mode 100644
index 0000000..b15e397
--- /dev/null
+++ b/src/projection/ossimAlbersProjection.cpp
@@ -0,0 +1,642 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Albers projection code.  
+//*******************************************************************
+//  $Id: ossimAlbersProjection.cpp 23002 2014-11-24 17:11:17Z dburken $
+
+#include <ossim/projection/ossimAlbersProjection.h>
+
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimAlbersProjection, "ossimAlbersProjection", ossimMapProjection)
+
+#ifdef PI_OVER_2
+#  undef PI_OVER_2
+#endif   
+
+#define ALBERS_NO_ERROR           0x0000
+#define ALBERS_LAT_ERROR          0x0001
+#define ALBERS_LON_ERROR          0x0002
+#define ALBERS_EASTING_ERROR      0x0004
+#define ALBERS_NORTHING_ERROR     0x0008
+#define ALBERS_ORIGIN_LAT_ERROR   0x0010
+#define ALBERS_CENT_MER_ERROR     0x0020
+#define ALBERS_A_ERROR            0x0040
+#define ALBERS_INV_F_ERROR        0x0080
+#define ALBERS_FIRST_STDP_ERROR   0x0100
+#define ALBERS_SECOND_STDP_ERROR  0x0200
+#define ALBERS_FIRST_SECOND_ERROR 0x0400
+#define ALBERS_HEMISPHERE_ERROR   0x0800
+
+#define PI_OVER_2  ( M_PI / 2.0)                 
+#define ES_SIN(sinlat)          (es * sinlat)
+#define ONE_MINUS_SQR(x)        (1.0 - x * x)
+#define ALBERS_M(clat,oneminussqressin)   (clat / sqrt(oneminussqressin))
+#define ALBERS_Q(slat,oneminussqressin,essin) (one_MINUS_es2)*(slat / (oneminussqressin)-    \
+											  (1 / (two_es)) *log((1 - essin) / (1 + essin)))
+
+
+ossimAlbersProjection::ossimAlbersProjection(const ossimEllipsoid& ellipsoid,
+                                             const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   Albers_Delta_Northing = 40000000.0;
+   Albers_Delta_Easting  = 40000000.0;
+   setDefaults();
+   update();
+}
+    
+ossimAlbersProjection::ossimAlbersProjection(const ossimEllipsoid& ellipsoid,
+                                             const ossimGpt& origin,
+                                             double stdParallel1,
+                                             double stdParallel2,
+                                             double falseEasting,
+                                             double falseNorthing)
+  :ossimMapProjection(ellipsoid, origin)
+{
+   Albers_Std_Parallel_1 = stdParallel1*RAD_PER_DEG;
+   Albers_Std_Parallel_2 = stdParallel2*RAD_PER_DEG;
+   Albers_Delta_Northing = 40000000.0;
+   Albers_Delta_Easting  = 40000000.0;
+   Albers_False_Easting  = falseEasting;
+   Albers_False_Northing = falseNorthing;
+   
+   update();
+   
+}
+
+ossimObject* ossimAlbersProjection::dup() const
+{
+   return new ossimAlbersProjection(*this);
+}
+
+ossimAlbersProjection::~ossimAlbersProjection()
+{
+}
+
+void ossimAlbersProjection::update()
+{
+   Set_Albers_Parameters(theEllipsoid.getA(),
+                         theEllipsoid.getFlattening(),
+                         theOrigin.latr(),
+                         theOrigin.lonr(),
+                         Albers_Std_Parallel_1,
+                         Albers_Std_Parallel_2,
+                         Albers_False_Easting,
+                         Albers_False_Northing);
+   
+   theFalseEastingNorthing.x = Albers_False_Easting;
+   theFalseEastingNorthing.y = Albers_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+
+ossimGpt ossimAlbersProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat, lon;
+   
+   
+   Convert_Albers_To_Geodetic(eastingNorthing.x,
+                              eastingNorthing.y,
+                              &lat,
+                              &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0, theDatum);
+}
+
+ossimDpt ossimAlbersProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+
+   Convert_Geodetic_To_Albers(gpt.latr(),
+                              gpt.lonr(),
+                              &easting,
+                              &northing);
+   
+   return ossimDpt(easting, northing);
+}
+
+void ossimAlbersProjection::setStandardParallel1(double degree)
+{
+   Albers_Std_Parallel_1 = degree*RAD_PER_DEG;
+   update();
+}
+
+void ossimAlbersProjection::setStandardParallel2(double degree)
+{
+   Albers_Std_Parallel_2 = degree*RAD_PER_DEG;
+   update();
+}
+
+void ossimAlbersProjection::setStandardParallels(double parallel1Degree,
+                                                 double parallel2Degree)
+{
+   Albers_Std_Parallel_1 = parallel1Degree*RAD_PER_DEG;
+   Albers_Std_Parallel_2 = parallel2Degree*RAD_PER_DEG;
+   update();
+   
+}
+
+void ossimAlbersProjection::setFalseEasting(double falseEasting)
+{
+   Albers_False_Easting = falseEasting;
+   update();
+}
+
+void ossimAlbersProjection::setFalseNorthing(double falseNorthing)
+{
+   Albers_False_Northing = falseNorthing;
+   update();
+}
+
+void ossimAlbersProjection::setFalseEastingNorthing(double falseEasting,
+                                                    double falseNorthing)
+{
+   Albers_False_Easting = falseEasting;
+   Albers_False_Northing = falseNorthing;  
+   update();
+}
+
+void ossimAlbersProjection::setParameters(double parallel1,
+                                          double parallel2,
+                                          double falseEasting,
+                                          double falseNorthing)
+{
+   Albers_False_Easting = falseEasting;
+   Albers_False_Northing = falseNorthing;  
+   Albers_Std_Parallel_1 = parallel1*RAD_PER_DEG;
+   Albers_Std_Parallel_2 = parallel2*RAD_PER_DEG;
+   update(); 
+}
+
+double ossimAlbersProjection::getStandardParallel1()const
+{
+   return  Albers_Std_Parallel_1/RAD_PER_DEG;
+}
+
+double ossimAlbersProjection::getStandardParallel2()const
+{
+   return  Albers_Std_Parallel_2/RAD_PER_DEG;
+}
+
+void ossimAlbersProjection::setDefaults()
+{
+   // initialize to some default
+   Albers_Std_Parallel_1 = 29.5*RAD_PER_DEG;
+   Albers_Std_Parallel_2 = 45.5*RAD_PER_DEG;
+   Albers_False_Easting  = 0.0;
+   Albers_False_Northing = 0.0;  
+}
+
+bool ossimAlbersProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::STD_PARALLEL_1_KW,
+           Albers_Std_Parallel_1*DEG_PER_RAD,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::STD_PARALLEL_2_KW,
+           Albers_Std_Parallel_2*DEG_PER_RAD,
+           true);
+   
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimAlbersProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // Must do this first...
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+
+   const char* stdParallel1  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_1_KW);
+   const char* stdParallel2  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_2_KW);
+
+   
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimAlbersProjection))
+   {
+      Albers_False_Easting  = theFalseEastingNorthing.x;
+      Albers_False_Northing = theFalseEastingNorthing.y;
+
+      if(stdParallel1)
+      {
+         Albers_Std_Parallel_1 = ossimString(stdParallel1).toDouble()*RAD_PER_DEG;
+      }
+      else
+      {
+         Albers_Std_Parallel_1 = 29.5*RAD_PER_DEG;         
+      }
+      if(stdParallel2)
+      {
+         Albers_Std_Parallel_2 = ossimString(stdParallel2).toDouble()*RAD_PER_DEG;
+      }
+      else
+      {
+         Albers_Std_Parallel_2 = 45.5*RAD_PER_DEG;
+      }
+   }
+
+   update();
+   
+   return flag;
+}
+
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS
+ */
+long ossimAlbersProjection::Set_Albers_Parameters(double a,
+                                                  double f,
+                                                  double Origin_Latitude,
+                                                  double Central_Meridian,
+                                                  double Std_Parallel_1,
+                                                  double Std_Parallel_2,
+                                                  double False_Easting,
+                                                  double False_Northing)
+
+{
+/*
+ * The function Set_Albers_Parameters receives the ellipsoid parameters and
+ * projection parameters as inputs, and sets the corresponding state
+ * variables.  If any errors occur, the error code(s) are returned by the function, 
+ * otherwise ALBERS_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid                   (input)
+ *    Origin_Latitude   : Latitude in radians at which the          (input)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    Std_Parallel_1    : First standard parallel                   (input)
+ *    Std_Parallel_2    : Second standard parallel                  (input)
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (input)
+ */
+
+  double sin_lat, sin_lat_1, cos_lat;
+  double m1, m2, SQRm1;
+  double q0, q1, q2;
+  double es_sin, one_MINUS_SQRes_sin;
+  double nq0;
+  double inv_f = 1 / f;
+  long Error_Code = ALBERS_NO_ERROR;
+
+  if (a <= 0.0)
+  { /* Semi-major axis must be greater than zero */
+    Error_Code |= ALBERS_A_ERROR;
+  }
+  if ((inv_f < 250) || (inv_f > 350))
+  { /* Inverse flattening must be between 250 and 350 */
+    Error_Code |= ALBERS_INV_F_ERROR;
+  }
+  if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
+  { /* origin latitude out of range */
+    Error_Code |= ALBERS_ORIGIN_LAT_ERROR;
+  }
+  if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
+  { /* origin longitude out of range */
+    Error_Code |= ALBERS_CENT_MER_ERROR;
+  }
+  if ((Std_Parallel_1 < -PI_OVER_2) || (Std_Parallel_1 > PI_OVER_2))
+  { /* First Standard Parallel out of range */
+    Error_Code |= ALBERS_FIRST_STDP_ERROR;
+  }
+  if ((Std_Parallel_2 < -PI_OVER_2) || (Std_Parallel_2 > PI_OVER_2))
+  { /* Second Standard Parallel out of range */
+    Error_Code |= ALBERS_SECOND_STDP_ERROR;
+  }
+  if ((Std_Parallel_1 == 0.0) && (Std_Parallel_2 == 0.0))
+  { /* First & Second Standard Parallels equal 0 */
+    Error_Code |= ALBERS_FIRST_SECOND_ERROR;
+  }
+  if (Std_Parallel_1 == -Std_Parallel_2)
+  { /* Parallels are opposite latitudes */
+    Error_Code |= ALBERS_HEMISPHERE_ERROR;
+  }
+
+  if (!Error_Code)
+  { /* no errors */
+    Albers_a = a;
+    Albers_f = f;
+    Albers_Origin_Lat = Origin_Latitude;
+    Albers_Std_Parallel_1 = Std_Parallel_1;
+    Albers_Std_Parallel_2 = Std_Parallel_2;
+    if (Central_Meridian > M_PI)
+      Central_Meridian -= TWO_PI;
+    Albers_Origin_Long = Central_Meridian;
+    Albers_False_Easting = False_Easting;
+    Albers_False_Northing = False_Northing;
+
+    es2 = 2 * Albers_f - Albers_f * Albers_f;
+    es = sqrt(es2);
+    one_MINUS_es2 = 1 - es2;
+    two_es = 2 * es;
+
+    sin_lat = sin(Albers_Origin_Lat);
+    es_sin = ES_SIN(sin_lat);
+    one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
+    q0 = ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
+
+    sin_lat_1 = sin(Albers_Std_Parallel_1);
+    cos_lat = cos(Albers_Std_Parallel_1);
+    es_sin = ES_SIN(sin_lat_1);
+    one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
+    m1 = ALBERS_M(cos_lat, one_MINUS_SQRes_sin);
+    q1 = ALBERS_Q(sin_lat_1, one_MINUS_SQRes_sin, es_sin);
+
+    SQRm1 = m1 * m1;
+    if (fabs(Albers_Std_Parallel_1 - Albers_Std_Parallel_2) > 1.0e-10)
+    {
+      sin_lat = sin(Albers_Std_Parallel_2);
+      cos_lat = cos(Albers_Std_Parallel_2);
+      es_sin = ES_SIN(sin_lat);
+      one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
+      m2 = ALBERS_M(cos_lat, one_MINUS_SQRes_sin);
+      q2 = ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
+      n = (SQRm1 - m2 * m2) / (q2 - q1);
+    }
+    else
+      n = sin_lat_1;
+
+    C = SQRm1 + n * q1;
+    Albers_a_OVER_n = Albers_a / n;
+    nq0 = n * q0;
+    if (C < nq0)
+      rho0 = 0;
+    else
+      rho0 = Albers_a_OVER_n * sqrt(C - nq0);
+
+
+  } /* END OF if(!Error_Code) */
+  return (Error_Code);
+} /* END OF Set_Albers_Parameters */
+
+
+void ossimAlbersProjection::Get_Albers_Parameters(double *a,
+                                                  double *f,
+                                                  double *Origin_Latitude,
+                                                  double *Central_Meridian,
+                                                  double *Std_Parallel_1,
+                                                  double *Std_Parallel_2,
+                                                  double *False_Easting,
+                                                  double *False_Northing)const
+
+{ /* BEGIN Get_Albers_Parameters */
+/*
+ * The function Get_Albers_Parameters returns the current ellipsoid
+ * parameters, and Albers projection parameters.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid										(output)
+ *    Origin_Latitude   : Latitude in radians at which the          (output)
+ *                          point scale factor is 1.0
+ *    Origin_Longitude  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    Std_Parallel_1    : First standard parallel                   (output)
+ *    Std_Parallel_2    : Second standard parallel                  (output)
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (output)
+ */
+
+  *a = Albers_a;
+  *f = Albers_f;
+  *Origin_Latitude = Albers_Origin_Lat;
+  *Std_Parallel_1 = Albers_Std_Parallel_1;
+  *Std_Parallel_2 = Albers_Std_Parallel_2;
+  *Central_Meridian = Albers_Origin_Long;
+  *False_Easting = Albers_False_Easting;
+  *False_Northing = Albers_False_Northing;
+  return;
+} /* END OF Get_Albers_Parameters */
+
+
+long ossimAlbersProjection::Convert_Geodetic_To_Albers (double Latitude,
+                                                        double Longitude,
+                                                        double *Easting,
+                                                        double *Northing)const
+
+{ /* BEGIN Convert_Geodetic_To_Albers */
+/*
+ * The function Convert_Geodetic_To_Albers converts geodetic (latitude and
+ * longitude) coordinates to Albers projection (easting and northing)
+ * coordinates, according to the current ellipsoid and Albers projection
+ * parameters.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise ALBERS_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double dlam;                      /* Longitude - Central Meridan */
+  double sin_lat;
+  // double cos_lat;
+  double es_sin, one_MINUS_SQRes_sin;
+  double q;
+  double rho;
+  double theta;
+  double nq;
+  long Error_Code = ALBERS_NO_ERROR;
+
+  if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+  {  /* Latitude out of range */
+    Error_Code |= ALBERS_LAT_ERROR;
+  }
+  if ((Longitude < -M_PI) || (Longitude > TWO_PI))
+  {  /* Longitude out of range */
+    Error_Code|= ALBERS_LON_ERROR;
+  }
+
+  if (!Error_Code)
+  { /* no errors */
+
+    dlam = Longitude - Albers_Origin_Long;
+    if (dlam > M_PI)
+    {
+      dlam -= TWO_PI;
+    }
+    if (dlam < -M_PI)
+    {
+      dlam += TWO_PI;
+    }
+    sin_lat = sin(Latitude);
+    // cos_lat = cos(Latitude);
+    es_sin = ES_SIN(sin_lat);
+    one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
+    q = ALBERS_Q(sin_lat, one_MINUS_SQRes_sin, es_sin);
+    nq = n * q;
+    if (C < nq)
+      rho = 0;
+    else
+      rho = Albers_a_OVER_n * sqrt(C - nq);
+
+
+    theta = n * dlam;
+    *Easting = rho * sin(theta) + Albers_False_Easting;
+    *Northing = rho0 - rho * cos(theta) + Albers_False_Northing;
+  }
+  return (Error_Code);
+} /* END OF Convert_Geodetic_To_Albers */
+
+
+long ossimAlbersProjection::Convert_Albers_To_Geodetic(double Easting,
+                                                       double Northing,
+                                                       double *Latitude,
+                                                       double *Longitude)const
+{ /* BEGIN Convert_Albers_To_Geodetic */
+/*
+ * The function Convert_Albers_To_Geodetic converts Albers projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid and Albers projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise ALBERS_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double dy, dx;
+  double rho0_MINUS_dy;
+  double q, qconst, q_OVER_2;
+  double rho, rho_n;
+  double PHI, Delta_PHI = 1.0;
+  double sin_phi;
+  double es_sin, one_MINUS_SQRes_sin;
+  double theta = 0.0;
+  double tolerance = 4.85e-10;        /* approximately 1/1000th of
+                              an arc second or 1/10th meter */
+  long Error_Code = ALBERS_NO_ERROR; 
+
+  if ((Easting < (Albers_False_Easting - Albers_Delta_Easting)) 
+      || (Easting > Albers_False_Easting + Albers_Delta_Easting))
+  { /* Easting out of range  */
+    Error_Code |= ALBERS_EASTING_ERROR;
+  }
+  if ((Northing < (Albers_False_Northing - Albers_Delta_Northing)) 
+      || (Northing > Albers_False_Northing + Albers_Delta_Northing))
+  { /* Northing out of range */
+    Error_Code |= ALBERS_NORTHING_ERROR;
+  }
+
+  if (!Error_Code)
+  {
+    dy = Northing - Albers_False_Northing;
+    dx = Easting - Albers_False_Easting;
+    rho0_MINUS_dy = rho0 - dy;
+    rho = sqrt(dx * dx + rho0_MINUS_dy * rho0_MINUS_dy);
+
+    if (n < 0)
+    {
+      rho *= -1.0;
+      dy *= -1.0;
+      dx *= -1.0;
+      rho0_MINUS_dy *= -1.0;
+    }
+
+    if (rho != 0.0)
+      theta = atan2(dx, rho0_MINUS_dy);
+    rho_n = rho * n;
+    q = (C - (rho_n * rho_n) / (Albers_a * Albers_a)) / n;
+    qconst = 1 - ((one_MINUS_es2) / (two_es)) * log((1.0 - es) / (1.0 + es));
+    if (fabs(fabs(qconst) - fabs(q)) > 1.0e-6)
+    {
+      q_OVER_2 = q / 2.0;
+      if (q_OVER_2 > 1.0)
+        *Latitude = PI_OVER_2;
+      else if (q_OVER_2 < -1.0)
+        *Latitude = -PI_OVER_2;
+      else
+      {
+        PHI = asin(q_OVER_2);
+        if (es < 1.0e-10)
+          *Latitude = PHI;
+        else
+        {
+          while (fabs(Delta_PHI) > tolerance)
+          {
+            sin_phi = sin(PHI);
+            es_sin = ES_SIN(sin_phi);
+            one_MINUS_SQRes_sin = ONE_MINUS_SQR(es_sin);
+            Delta_PHI = (one_MINUS_SQRes_sin * one_MINUS_SQRes_sin) / (2.0 * cos(PHI)) *
+                        (q / (one_MINUS_es2) - sin_phi / one_MINUS_SQRes_sin +
+                         (log((1.0 - es_sin) / (1.0 + es_sin)) / (two_es)));
+            PHI += Delta_PHI;
+          }
+          *Latitude = PHI;
+        }
+
+        if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+          *Latitude = PI_OVER_2;
+        else if (*Latitude < -PI_OVER_2)
+          *Latitude = -PI_OVER_2;
+
+      }
+    }
+    else
+    {
+      if (q >= 0.0)
+        *Latitude = PI_OVER_2;
+      else
+        *Latitude = -PI_OVER_2;
+    }
+    *Longitude = Albers_Origin_Long + theta / n;
+
+    if (*Longitude > M_PI)
+      *Longitude -= TWO_PI;
+    if (*Longitude < -M_PI)
+      *Longitude += TWO_PI;
+
+    if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
+      *Longitude = M_PI;
+    else if (*Longitude < -M_PI)
+      *Longitude = -M_PI;
+
+  }
+  return (Error_Code);
+} /* END OF Convert_Albers_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimAlbersProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj)) return false;
+
+   const ossimAlbersProjection* p = dynamic_cast<const ossimAlbersProjection*>(&proj);
+   if (!p) return false;
+
+   if (!ossim::almostEqual(Albers_Std_Parallel_1,p->Albers_Std_Parallel_1)) return false;
+   if (!ossim::almostEqual(Albers_Std_Parallel_2,p->Albers_Std_Parallel_2)) return false;
+   if (!ossim::almostEqual(Albers_Delta_Northing,p->Albers_Delta_Northing)) return false;
+   if (!ossim::almostEqual(Albers_Delta_Easting, p->Albers_Delta_Easting) ) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimAlphaSensor.cpp b/src/projection/ossimAlphaSensor.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimAlphaSensor.cpp
rename to src/projection/ossimAlphaSensor.cpp
diff --git a/ossim/src/ossim/projection/ossimAlphaSensorHRI.cpp b/src/projection/ossimAlphaSensorHRI.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimAlphaSensorHRI.cpp
rename to src/projection/ossimAlphaSensorHRI.cpp
diff --git a/ossim/src/ossim/projection/ossimAlphaSensorHSI.cpp b/src/projection/ossimAlphaSensorHSI.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimAlphaSensorHSI.cpp
rename to src/projection/ossimAlphaSensorHSI.cpp
diff --git a/src/projection/ossimApplanixEcefModel.cpp b/src/projection/ossimApplanixEcefModel.cpp
new file mode 100644
index 0000000..df2d164
--- /dev/null
+++ b/src/projection/ossimApplanixEcefModel.cpp
@@ -0,0 +1,805 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimApplanixEcefModel.cpp 23564 2015-10-02 14:12:25Z dburken $
+#include <sstream>
+#include <ossim/projection/ossimApplanixEcefModel.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimLsrSpace.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/support_data/ossimApplanixEOFile.h>
+#include <ossim/base/ossimMatrix4x4.h>
+#include <ossim/elevation/ossimElevManager.h>
+static ossimTrace traceDebug("ossimApplanixEcefModel:debug");
+
+RTTI_DEF1(ossimApplanixEcefModel, "ossimApplanixEcefModel", ossimSensorModel);
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimApplanixEcefModel.cpp 23564 2015-10-02 14:12:25Z dburken $";
+#endif
+
+ossimApplanixEcefModel::ossimApplanixEcefModel()
+{
+   theCompositeMatrix          = ossimMatrix4x4::createIdentity();
+   theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
+   theRoll                     = 0.0;
+   thePitch                    = 0.0;
+   theHeading                  = 0.0;
+   theFocalLength              = 55.0;
+   thePixelSize = ossimDpt(.009, .009);
+   theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
+   theAdjEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
+   theGSD.x = 0.1524;
+   theGSD.y = 0.1524;
+   theMeanGSD = 0.1524;
+   theLensDistortion = new ossimMeanRadialLensDistortion;
+   initAdjustableParameters();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
+#endif
+   }
+}
+ossimApplanixEcefModel::ossimApplanixEcefModel(const ossimDrect& imageRect,
+                                               const ossimGpt& platformPosition,
+                                               double roll,
+                                               double pitch,
+                                               double heading,
+                                               const ossimDpt& /* principalPoint */, // in millimeters
+                                               double focalLength, // in millimeters
+                                               const ossimDpt& pixelSize) // in millimeters
+{
+   theImageClipRect = imageRect;
+   theRefImgPt      = theImageClipRect.midPoint();
+   theCompositeMatrix          = ossimMatrix4x4::createIdentity();
+   theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
+   theRoll                     = roll;
+   thePitch                    = pitch;
+   theHeading                  = heading;
+   theFocalLength              = focalLength;
+   thePixelSize                = pixelSize;
+   theEcefPlatformPosition     = platformPosition;
+   theAdjEcefPlatformPosition  = platformPosition;
+   theLensDistortion           = new ossimMeanRadialLensDistortion;
+   initAdjustableParameters();
+   updateModel();
+
+   try
+   {
+      // Method throws ossimException.
+      computeGsd();
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimApplanixEcefModel Constructor caught Exception:\n"
+         << e.what() << std::endl;
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "ossimApplanixEcefModel::ossimApplanixEcefModel DEBUG:" << endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
+#endif
+   }
+}
+
+ossimApplanixEcefModel::ossimApplanixEcefModel(const ossimApplanixEcefModel& src)
+   :ossimSensorModel(src)
+{
+   initAdjustableParameters();
+   
+   if(src.theLensDistortion.valid())
+   {
+      theLensDistortion = new ossimMeanRadialLensDistortion(*(src.theLensDistortion.get()));
+   }
+   else
+   {
+      theLensDistortion = new ossimMeanRadialLensDistortion();
+   }
+}
+
+ossimObject* ossimApplanixEcefModel::dup()const
+{
+   return new ossimApplanixEcefModel(*this);
+}
+
+void ossimApplanixEcefModel::imagingRay(const ossimDpt& image_point,
+                                    ossimEcefRay&   image_ray) const
+{
+//    if(traceDebug())
+//    {
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... entered" << std::endl;
+//    }
+    ossimDpt f1 ((image_point) - theRefImgPt);
+   f1.x *= thePixelSize.x;
+   f1.y *= -thePixelSize.y;
+   ossimDpt film (f1 - thePrincipalPoint);
+//    if(traceDebug())
+//    {
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size   = " << thePixelSize << std::endl;
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "film pt      = " << film << std::endl;
+//    }
+   if (theLensDistortion.valid())
+   {
+      ossimDpt filmOut;
+      theLensDistortion->undistort(film, filmOut);
+      film = filmOut;
+   }
+   
+   ossimColumnVector3d cam_ray_dir (film.x,
+                                    film.y,
+                                    -theFocalLength);
+   ossimEcefVector     ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
+   ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
+  
+   image_ray.setOrigin(theAdjEcefPlatformPosition);
+   image_ray.setDirection(ecf_ray_dir);
+
+//    if(traceDebug())
+//    {
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixEcefModel::imagingRay: ..... leaving" << std::endl;
+//    }
+}
+
+void ossimApplanixEcefModel::lineSampleToWorld(const ossimDpt& image_point,
+                                               ossimGpt&       gpt) const
+{
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimApplanixEcefModel::lineSampleToWorld:entering..." << std::endl;
+   
+   if(image_point.hasNans())
+   {
+      gpt.makeNan();
+      return;
+   }
+   //***
+   // Extrapolate if image point is outside image:
+   //***
+//   if (!insideImage(image_point))
+//   {
+//      gpt.makeNan();
+//       gpt = extrapolate(image_point);
+//      return;
+//   }
+
+   //***
+   // Determine imaging ray and invoke elevation source object's services to
+   // intersect ray with terrain model:
+   //***
+   ossimEcefRay ray;
+   imagingRay(image_point, ray);
+   ossimElevManager::instance()->intersectRay(ray, gpt);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
+   }
+
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
+   return;
+}
+
+void ossimApplanixEcefModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                                 const double&   heightEllipsoid,
+                                                 ossimGpt&       worldPoint) const
+{
+//  if (!insideImage(image_point))
+//   {
+//      worldPoint.makeNan();
+//       worldPoint = extrapolate(image_point, heightEllipsoid);
+//   }
+//   else
+   {
+      //***
+      // First establish imaging ray from image point:
+      //***
+      ossimEcefRay ray;
+      imagingRay(image_point, ray);
+      ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
+      worldPoint = ossimGpt(Pecf);
+   }
+}
+
+void ossimApplanixEcefModel::worldToLineSample(const ossimGpt& world_point,
+                                           ossimDpt&       image_point) const
+{
+   #if 0
+   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
+      (!theBoundGndPolygon.hasNans()))
+   {
+      if (!(theBoundGndPolygon.pointWithin(world_point)))
+      {
+//         image_point.makeNan();
+//          image_point = extrapolate(world_point);
+//         return;
+      }         
+   }
+   #endif
+   ossimEcefPoint g_ecf(world_point);
+   ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
+   ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
+   
+      
+   double scale = -theFocalLength/camRayDir[2];
+   ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
+      
+   if (theLensDistortion.valid())
+   {
+      ossimDpt filmOut;
+      theLensDistortion->distort(film, filmOut);
+      film = filmOut;
+    }
+   
+     ossimDpt f1(film + thePrincipalPoint);
+    ossimDpt p1(f1.x/thePixelSize.x,
+                -f1.y/thePixelSize.y);
+
+    ossimDpt p0 (p1.x + theRefImgPt.x,
+                 p1.y + theRefImgPt.y);
+    
+    image_point = p0;
+}
+
+void ossimApplanixEcefModel::updateModel()
+{
+   ossimGpt gpt;
+   ossimGpt wgs84Pt;
+   double metersPerDegree = wgs84Pt.metersPerDegree().x;
+   double degreePerMeter = 1.0/metersPerDegree;
+   double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter;
+   double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;
+
+   gpt = theEcefPlatformPosition;
+   double height = gpt.height();
+   gpt.height(height + computeParameterOffset(5));
+   gpt.latd(gpt.latd() + latShift);
+   gpt.lond(gpt.lond() + lonShift);
+   theAdjEcefPlatformPosition = gpt;
+   ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4));
+
+   // make a left handed roational matrix;
+   ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
+   NEWMAT::Matrix orientation = (ossimMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), OSSIM_LEFT_HANDED)*
+                                 ossimMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), OSSIM_LEFT_HANDED));
+   theCompositeMatrix        = (lsrMatrix.getData()*orientation);
+   theCompositeMatrixInverse = theCompositeMatrix.i();
+
+   theBoundGndPolygon.resize(4);
+   // ossim_float64 w = theImageClipRect.width()*2.0;
+   // ossim_float64 h = theImageClipRect.height()*2.0;
+   theExtrapolateImageFlag = false;
+   theExtrapolateGroundFlag = false;
+
+   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
+   theBoundGndPolygon[0] = gpt;
+   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
+   theBoundGndPolygon[1] = gpt;
+   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
+   theBoundGndPolygon[2] = gpt;
+   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
+   theBoundGndPolygon[3] = gpt;
+}
+
+void ossimApplanixEcefModel::initAdjustableParameters()
+{
+   
+   resizeAdjustableParameterArray(6);
+   
+   setAdjustableParameter(0, 0.0);
+   setParameterDescription(0, "x_offset");
+   setParameterUnit(0, "pixels");
+
+   setAdjustableParameter(1, 0.0);
+   setParameterDescription(1, "y_offset");
+   setParameterUnit(1, "pixels");
+
+   setAdjustableParameter(2, 0.0);
+   setParameterDescription(2, "roll");
+   setParameterUnit(2, "degrees");
+
+   setAdjustableParameter(3, 0.0);
+   setParameterDescription(3, "pitch");
+   setParameterUnit(3, "degrees");
+
+   setAdjustableParameter(4, 0.0);
+   setParameterDescription(4, "heading");
+   setParameterUnit(4, "degrees");
+
+   setAdjustableParameter(5, 0.0);
+   setParameterDescription(5, "altitude");
+   setParameterUnit(5, "meters");
+   
+   
+   setParameterSigma(0, 20.0);
+   setParameterSigma(1, 20.0);
+   setParameterSigma(2, .1);
+   setParameterSigma(3, .1);
+   setParameterSigma(4, .1);
+   setParameterSigma(5, 50);
+}
+
+void ossimApplanixEcefModel::setPrincipalPoint(ossimDpt principalPoint)
+{
+   thePrincipalPoint = principalPoint;
+}
+
+void ossimApplanixEcefModel::setRollPitchHeading(double roll,
+                                                 double pitch,
+                                                 double heading)
+{
+   theRoll    = roll;
+   thePitch   = pitch;
+   theHeading = heading;
+   
+   updateModel();
+}
+
+void ossimApplanixEcefModel::setPixelSize(const ossimDpt& pixelSize)
+{
+   thePixelSize = pixelSize;
+}
+
+void ossimApplanixEcefModel::setImageRect(const ossimDrect& rect)
+{
+   theImageClipRect = rect;
+   theRefImgPt = rect.midPoint();
+}
+
+void ossimApplanixEcefModel::setFocalLength(double focalLength)
+{
+   theFocalLength = focalLength;
+}
+
+void ossimApplanixEcefModel::setPlatformPosition(const ossimGpt& gpt)
+{
+   theRefGndPt            = gpt;
+   theEcefPlatformPosition = gpt;
+   updateModel();
+   
+}
+
+bool ossimApplanixEcefModel::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix) const
+{
+   ossimSensorModel::saveState(kwl, prefix);
+   
+   kwl.add(prefix, "type", "ossimApplanixEcefModel", true);
+
+   kwl.add(prefix, "roll", theRoll, true);
+   kwl.add(prefix, "pitch", thePitch, true);
+   kwl.add(prefix, "heading", theHeading, true);
+   kwl.add(prefix, "principal_point", ossimString::toString(thePrincipalPoint.x) + " " + ossimString::toString(thePrincipalPoint.y));
+   kwl.add(prefix, "pixel_size",      ossimString::toString(thePixelSize.x) + " " + ossimString::toString(thePixelSize.y));
+   kwl.add(prefix, "focal_length", theFocalLength);
+   kwl.add(prefix, "ecef_platform_position",
+           ossimString::toString(theEcefPlatformPosition.x()) + " " +
+           ossimString::toString(theEcefPlatformPosition.y()) + " " +
+           ossimString::toString(theEcefPlatformPosition.z()));
+
+   if(theLensDistortion.valid())
+   {
+      ossimString lensPrefix = ossimString(prefix)+"distortion.";
+      theLensDistortion->saveState(kwl,
+                                   lensPrefix.c_str());
+   }
+   
+   return true;
+}
+
+bool ossimApplanixEcefModel::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   if(traceDebug())
+   {
+      std::cout << "ossimApplanixEcefModel::loadState: ......... entered" << std::endl;
+   }
+
+   theImageClipRect = ossimDrect(0,0,4076,4091);
+   theRefImgPt      = ossimDpt(2046.0, 2038.5);
+
+   ossimSensorModel::loadState(kwl, prefix);
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+      initAdjustableParameters();
+   }
+   theEcefPlatformPosition    = ossimGpt(0.0,0.0,1000.0);
+   theAdjEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
+   theRoll    = 0.0;
+   thePitch   = 0.0;
+   theHeading = 0.0;
+   // bool computeGsdFlag = false;
+   const char* roll              = kwl.find(prefix, "roll");
+   const char* pitch             = kwl.find(prefix, "pitch");
+   const char* heading           = kwl.find(prefix, "heading");
+   const char* principal_point   = kwl.find(prefix, "principal_point");
+   const char* pixel_size        = kwl.find(prefix, "pixel_size");
+   const char* focal_length      = kwl.find(prefix, "focal_length");
+   const char* ecef_platform_position = kwl.find(prefix, "ecef_platform_position");
+   const char* latlonh_platform_position = kwl.find(prefix, "latlonh_platform_position");
+   const char* compute_gsd_flag  = kwl.find(prefix, "compute_gsd_flag");
+   const char* eo_file           = kwl.find(prefix, "eo_file");
+   const char* camera_file       = kwl.find(prefix, "camera_file");
+   const char* eo_id             = kwl.find(prefix, "eo_id");
+   bool result = true;
+   if(eo_id)
+   {
+      theImageID = eo_id;
+   }
+   if(eo_file)
+   {
+      ossimApplanixEOFile eoFile;
+      if(eoFile.parseFile(ossimFilename(eo_file)))
+      {
+         ossimRefPtr<ossimApplanixEORecord> record = eoFile.getRecordGivenId(theImageID);
+         if(record.valid())
+         {
+            ossim_int32 rollIdx    = eoFile.getFieldIdx("ROLL");
+            ossim_int32 pitchIdx   = eoFile.getFieldIdx("PITCH");
+            ossim_int32 headingIdx = eoFile.getFieldIdx("HEADING");
+            ossim_int32 xIdx       = eoFile.getFieldIdx("X");
+            ossim_int32 yIdx       = eoFile.getFieldIdx("Y");
+            ossim_int32 zIdx       = eoFile.getFieldIdx("Z");
+
+            if((rollIdx >= 0)&&
+               (pitchIdx >= 0)&&
+               (headingIdx >= 0)&&
+               (xIdx >= 0)&&
+               (yIdx >= 0)&&
+               (zIdx >= 0))
+            {
+               theRoll    = (*record)[rollIdx].toDouble();
+               thePitch   = (*record)[pitchIdx].toDouble();
+               theHeading = (*record)[headingIdx].toDouble();
+               theEcefPlatformPosition = ossimEcefPoint((*record)[xIdx].toDouble(),
+                                                        (*record)[yIdx].toDouble(),
+                                                        (*record)[zIdx].toDouble());
+               theAdjEcefPlatformPosition = theEcefPlatformPosition;
+            }
+            else
+            {
+               return false;
+            }
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "ossimApplanixEcefModel::loadState()  Image id " << theImageID << " not found in eo file " << eo_file << std::endl;
+            
+            return false;
+         }
+      }
+      else
+      {
+         return false;
+      }
+      // computeGsdFlag = true;
+   }
+   else
+   {
+      if(roll)
+      {
+         theRoll = ossimString(roll).toDouble();
+      }
+      if(pitch)
+      {
+         thePitch = ossimString(pitch).toDouble();
+      }
+      if(heading)
+      {
+         theHeading = ossimString(heading).toDouble();
+      }
+      if(ecef_platform_position)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(ecef_platform_position);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() > 2)
+         {
+            theEcefPlatformPosition  = ossimEcefPoint(splitString[0].toDouble(),
+                                                      splitString[1].toDouble(),
+                                                      splitString[2].toDouble());
+         }
+      }
+      else if(latlonh_platform_position)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(latlonh_platform_position);
+         tempString.split(splitString, ossimString(" "));
+         std::string datumString;
+         double lat=0.0, lon=0.0, h=0.0;
+         if(splitString.size() > 2)
+         {
+            lat = splitString[0].toDouble();
+            lon = splitString[1].toDouble();
+            h = splitString[2].toDouble();
+         }
+         
+         theEcefPlatformPosition = ossimGpt(lat,lon,h);
+      }
+   }
+
+   if(camera_file)
+   {
+      ossimKeywordlist cameraKwl;
+      ossimKeywordlist lensKwl;
+      cameraKwl.add(camera_file);
+      const char* sensor = cameraKwl.find("sensor");
+      const char* image_size      = cameraKwl.find(prefix, "image_size");
+      principal_point = cameraKwl.find("principal_point");
+      focal_length    = cameraKwl.find("focal_length");
+      pixel_size      = cameraKwl.find(prefix, "pixel_size");
+      focal_length    = cameraKwl.find(prefix, "focal_length");
+      const char* distortion_units = cameraKwl.find(prefix, "distortion_units");
+      ossimUnitConversionTool tool;
+      ossimUnitType unitType = OSSIM_MILLIMETERS;
+
+      if(distortion_units)
+      {
+         unitType = (ossimUnitType)ossimUnitTypeLut::instance()->getEntryNumber(distortion_units);
+
+         if(unitType == OSSIM_UNIT_UNKNOWN)
+         {
+            unitType = OSSIM_MILLIMETERS;
+         }
+      }
+      if(image_size)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(image_size);
+         tempString.split(splitString, ossimString(" "));
+         double w=1, h=1;
+         if(splitString.size() == 2)
+         {
+            w = splitString[0].toDouble();
+            h = splitString[1].toDouble();
+         }
+         theImageClipRect = ossimDrect(0,0,w-1,h-1);
+         theRefImgPt      = ossimDpt(w/2.0, h/2.0);
+         theImageSize     = ossimDpt(w,h);
+      }
+      if(sensor)
+      {
+         theSensorID = sensor;
+      }
+      if(principal_point)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(principal_point);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() == 2)
+         {
+            thePrincipalPoint.x = splitString[0].toDouble();
+            thePrincipalPoint.y = splitString[1].toDouble();
+         }
+      }
+      if(pixel_size)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(pixel_size);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() == 1)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = thePixelSize.x;
+         }
+         else if(splitString.size() == 2)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = splitString[1].toDouble();
+         }
+      }
+      if(focal_length)
+      {
+         theFocalLength = ossimString(focal_length).toDouble();
+      }
+
+      cameraKwl.trimAllValues();
+      
+      
+      ossimString regExpression =  ossimString("^(") + "d[0-9]+)";
+      vector<ossimString> keys;
+      cameraKwl.getSubstringKeyList( keys, regExpression );
+      long numberOfDistortions = (long)keys.size();
+      int offset = (int)ossimString("d").size();
+      ossim_uint32 idx = 0;
+      std::vector<int> numberList(numberOfDistortions);
+      for(idx = 0; idx < numberList.size();++idx)
+      {
+         ossimString numberStr(keys[idx].begin() + offset,
+                               keys[idx].end());
+         numberList[idx] = numberStr.toInt();
+      }
+      std::sort(numberList.begin(), numberList.end());
+      double distance=0.0, distortion=0.0;
+
+      for(idx = 0; idx < numberList.size(); ++idx)
+      {
+         ossimString value = cameraKwl.find(ossimString("d")+ossimString::toString(numberList[idx]));
+
+         if(!value.empty())
+         {
+            std::istringstream inStr(value.c_str());
+            inStr >> distance;
+            ossim::skipws(inStr);
+            inStr >> distortion;
+#if 0
+            std::vector<ossimString> splitString;
+            ossimString tempString(value);
+            tempString = tempString.trim();
+            tempString.split(splitString, " ");
+            std::cout << splitString.size() << std::endl;
+            if(splitString.size() >= 2)
+            {
+               distance = splitString[0].toDouble();
+               distortion = splitString[1].toDouble();
+            }
+#endif
+            
+            tool.setValue(distortion, unitType);
+            lensKwl.add(ossimString("distance") + ossimString::toString(idx),
+                        distance,
+                        true);
+            lensKwl.add(ossimString("distortion") + ossimString::toString(idx),
+                        tool.getMillimeters(),
+                        true);
+         }
+         lensKwl.add("convergence_threshold",
+                     .00001,
+                     true);
+         if(pixel_size)
+         {
+            lensKwl.add("dxdy",
+                        ossimString(pixel_size) + " " + ossimString(pixel_size),
+                        true);
+         }
+         else
+         {
+            lensKwl.add("dxdy",
+                        ".009 .009",
+                        true);
+         }
+      }
+      if(theLensDistortion.valid())
+      {
+         theLensDistortion->loadState(lensKwl,"");
+      }
+   }
+   else
+   {
+      
+      if(principal_point)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(principal_point);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() == 2)
+         {
+            thePrincipalPoint.x = splitString[0].toDouble();
+            thePrincipalPoint.y = splitString[1].toDouble();
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No principal_point found" << std::endl;
+            result = false;
+         }
+      }
+      if(pixel_size)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(pixel_size);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() == 1)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = thePixelSize.x;
+         }
+         else if(splitString.size() == 2)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = splitString[1].toDouble();
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No pixel size found" << std::endl;
+            result = false;
+         }
+      }
+      if(focal_length)
+      {
+         theFocalLength = ossimString(focal_length).toDouble();
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No focal length found" << std::endl;
+            result = false;
+         }
+      }
+      
+      if(theLensDistortion.valid())
+      {
+         ossimString lensPrefix = ossimString(prefix)+"distortion.";
+         if(!theLensDistortion->loadState(kwl,
+                                          lensPrefix.c_str()))
+         {
+            result = false;
+         }
+      }
+   }
+   theRefGndPt = theEcefPlatformPosition;
+   theRefGndPt.height(0.0);
+
+   updateModel();
+
+   if(compute_gsd_flag)
+   {
+      if(ossimString(compute_gsd_flag).toBool())
+      {
+         try
+         {
+            //---
+            // This will set theGSD and theMeanGSD. Method throws
+            // ossimException.
+            //---
+            computeGsd();
+         }
+         catch (const ossimException& e)
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimApplanixEcefModel::loadState Caught Exception:\n"
+               << e.what() << std::endl;
+         }
+      }
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << std::setprecision(15) << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "roll:     " << theRoll << std::endl
+                                          << "pitch:    " << thePitch << std::endl
+                                          << "heading:  " << theHeading << std::endl
+                                          << "platform: " << theEcefPlatformPosition << std::endl
+                                          << "latlon Platform: " << ossimGpt(theEcefPlatformPosition) << std::endl
+                                          << "focal len: " << theFocalLength << std::endl
+                                          << "principal: " << thePrincipalPoint << std::endl
+                                          << "Ground:    " << ossimGpt(theEcefPlatformPosition) << std::endl;
+   }
+
+   return result;
+}
+
+bool ossimApplanixEcefModel::setupOptimizer(const ossimString& init_file)
+{
+   ossimKeywordlist kwl;
+   kwl.addFile(init_file.c_str());
+
+   return loadState(kwl);
+}
diff --git a/src/projection/ossimApplanixUtmModel.cpp b/src/projection/ossimApplanixUtmModel.cpp
new file mode 100644
index 0000000..688d3e6
--- /dev/null
+++ b/src/projection/ossimApplanixUtmModel.cpp
@@ -0,0 +1,979 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// LGPL
+// 
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimApplanixUtmModel.cpp 23564 2015-10-02 14:12:25Z dburken $
+#include <sstream>
+#include <ossim/projection/ossimApplanixUtmModel.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimLsrSpace.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/support_data/ossimApplanixEOFile.h>
+#include <ossim/base/ossimMatrix4x4.h>
+#include <ossim/elevation/ossimElevManager.h>
+static ossimTrace traceDebug("ossimApplanixUtmModel:debug");
+
+RTTI_DEF1(ossimApplanixUtmModel, "ossimApplanixUtmModel", ossimSensorModel);
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimApplanixUtmModel.cpp 23564 2015-10-02 14:12:25Z dburken $";
+#endif
+
+ossimApplanixUtmModel::ossimApplanixUtmModel()
+   :theOmega(0.0),
+    thePhi(0.0),
+    theKappa(0.0),
+    theBoreSightTx(0.0),
+    theBoreSightTy(0.0),
+    theBoreSightTz(0.0)
+{
+   theCompositeMatrix          = ossimMatrix4x4::createIdentity();
+   theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
+   theFocalLength              = 55.0;
+   thePixelSize = ossimDpt(.009, .009);
+   theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
+   theGSD.x = 0.1524;
+   theGSD.y = 0.1524;
+   theMeanGSD = 0.1524;
+   theLensDistortion = new ossimMeanRadialLensDistortion;
+   initAdjustableParameters();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimApplanixUtmModel::ossimApplanixUtmModel DEBUG:" << endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
+#endif
+   }
+}
+
+ossimApplanixUtmModel::ossimApplanixUtmModel(const ossimApplanixUtmModel& src)
+   :ossimSensorModel(src),
+    theCompositeMatrix(src.theCompositeMatrix),
+    theCompositeMatrixInverse(src.theCompositeMatrixInverse),
+    theOmega(src.theOmega),
+    thePhi(src.thePhi),
+    theKappa(src.theKappa),
+    theBoreSightTx(src.theBoreSightTx),
+    theBoreSightTy(src.theBoreSightTy),
+    theBoreSightTz(src.theBoreSightTz),
+    thePrincipalPoint(src.thePrincipalPoint),
+    thePixelSize(src.thePixelSize),
+    theFocalLength(src.theFocalLength),
+    theEcefPlatformPosition(src.theEcefPlatformPosition),
+    thePlatformPosition(src.thePlatformPosition),
+    theUtmZone(src.theUtmZone),
+    theUtmHemisphere(src.theUtmHemisphere),
+    theUtmPlatformPosition(src.theUtmPlatformPosition)
+{
+   if(src.theLensDistortion.valid())
+   {
+      theLensDistortion = new ossimMeanRadialLensDistortion(*(src.theLensDistortion.get()));
+   }
+   else
+   {
+      theLensDistortion = new ossimMeanRadialLensDistortion();
+   }
+}
+
+ossimObject* ossimApplanixUtmModel::dup()const
+{
+   return new ossimApplanixUtmModel(*this);
+}
+
+void ossimApplanixUtmModel::imagingRay(const ossimDpt& image_point,
+                                    ossimEcefRay&   image_ray) const
+{
+//    if(traceDebug())
+//    {
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixUtmModel::imagingRay: ..... entered" << std::endl;
+//    }
+    ossimDpt f1 ((image_point) - theRefImgPt);
+   f1.x *= thePixelSize.x;
+   f1.y *= -thePixelSize.y;
+   ossimDpt film (f1 - thePrincipalPoint);
+//    if(traceDebug())
+//    {
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size   = " << thePixelSize << std::endl;
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "film pt      = " << film << std::endl;
+//    }
+   if (theLensDistortion.valid())
+   {
+      ossimDpt filmOut;
+      theLensDistortion->undistort(film, filmOut);
+      film = filmOut;
+   }
+   
+   ossimColumnVector3d cam_ray_dir (film.x,
+                                    film.y,
+                                    -theFocalLength);
+   ossimEcefVector     ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
+   ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
+   
+   image_ray.setOrigin(theAdjEcefPlatformPosition);
+   image_ray.setDirection(ecf_ray_dir);
+   
+//    if(traceDebug())
+//    {
+//       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimApplanixUtmModel::imagingRay: ..... leaving" << std::endl;
+//    }
+}
+
+void ossimApplanixUtmModel::lineSampleToWorld(const ossimDpt& image_point,
+                                               ossimGpt&       gpt) const
+{
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimApplanixEcefModel::lineSampleToWorld:entering..." << std::endl;
+   
+   if(image_point.hasNans())
+   {
+      gpt.makeNan();
+      return;
+   }
+   //***
+   // Extrapolate if image point is outside image:
+   //***
+  // if (!insideImage(image_point))
+  // {
+   //   gpt.makeNan();
+//       gpt = extrapolate(image_point);
+   //   return;
+   //}
+
+   //***
+   // Determine imaging ray and invoke elevation source object's services to
+   // intersect ray with terrain model:
+   //***
+   ossimEcefRay ray;
+   imagingRay(image_point, ray);
+   ossimElevManager::instance()->intersectRay(ray, gpt);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
+   }
+
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
+   return;
+}
+
+void ossimApplanixUtmModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                                 const double&   heightEllipsoid,
+                                                 ossimGpt&       worldPoint) const
+{
+//   if (!insideImage(image_point))
+//   {
+      //worldPoint.makeNan();
+//       worldPoint = extrapolate(image_point, heightEllipsoid);
+//   }
+//   else
+   {
+      //***
+      // First establish imaging ray from image point:
+      //***
+      ossimEcefRay ray;
+      imagingRay(image_point, ray);
+      ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
+      worldPoint = ossimGpt(Pecf);
+   }
+}
+
+void ossimApplanixUtmModel::worldToLineSample(const ossimGpt& world_point,
+                                           ossimDpt&       image_point) const
+{
+#if 0
+   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
+      (!theBoundGndPolygon.hasNans()))
+   {
+      if (!(theBoundGndPolygon.pointWithin(world_point)))
+      {
+         image_point.makeNan();
+//          image_point = extrapolate(world_point);
+         return;
+      }         
+   }
+#endif
+   ossimEcefPoint g_ecf(world_point);
+   ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
+   ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
+   
+      
+   double scale = -theFocalLength/camRayDir[2];
+   ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
+      
+   if (theLensDistortion.valid())
+   {
+      ossimDpt filmOut;
+      theLensDistortion->distort(film, filmOut);
+      film = filmOut;
+    }
+   
+     ossimDpt f1(film + thePrincipalPoint);
+    ossimDpt p1(f1.x/thePixelSize.x,
+                -f1.y/thePixelSize.y);
+
+    ossimDpt p0 (p1.x + theRefImgPt.x,
+                 p1.y + theRefImgPt.y);
+    
+    image_point = p0;
+}
+
+void ossimApplanixUtmModel::updateModel()
+{
+
+   ossimGpt wgs84Pt;
+   double metersPerDegree = wgs84Pt.metersPerDegree().x;
+   double degreePerMeter = 1.0/metersPerDegree;
+   double latShift = -computeParameterOffset(1)*theMeanGSD*degreePerMeter;
+   double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;
+
+   ossimGpt gpt = thePlatformPosition;
+//   gpt.height(0.0);
+   double height = gpt.height();
+   gpt.height(height + computeParameterOffset(5));
+   gpt.latd(gpt.latd() + latShift);
+   gpt.lond(gpt.lond() + lonShift);
+   
+   theAdjEcefPlatformPosition = gpt;
+   ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition);
+   // ORIENT TO A UTM AXIS
+   //
+    NEWMAT::ColumnVector v(3);
+   
+    v[0] = 0.0;
+    v[1] = 0.0;
+    v[2] = 1.0;
+    NEWMAT::ColumnVector v2 = lsrSpace.lsrToEcefRotMatrix()*v;
+    ossimEcefVector zVector(v2[0], v2[1], v2[2]);
+    zVector.normalize();
+   
+   // now lets create a UTM axis by creating a derivative at the center
+   // by shift over a few pixels and subtracting
+   //
+   ossimUtmProjection utmProj;
+   
+   utmProj.setZone(theUtmZone);
+   utmProj.setZone(theUtmHemisphere);
+   utmProj.setMetersPerPixel(ossimDpt(1.0,1.0));
+   ossimDpt midPt  = utmProj.forward(theAdjEcefPlatformPosition);
+   ossimDpt rPt    = midPt + ossimDpt(10, 0.0);
+   ossimDpt uPt    = midPt + ossimDpt(0.0, 10.0);
+   ossimGpt wMidPt = utmProj.inverse(midPt);
+   ossimGpt wRPt   = utmProj.inverse(rPt);
+   ossimGpt wUPt   = utmProj.inverse(uPt);
+   
+   ossimEcefPoint ecefMidPt = wMidPt;
+   ossimEcefPoint ecefRPt   = wRPt;
+   ossimEcefPoint ecefUPt   = wUPt;
+   
+   ossimEcefVector east  = ecefRPt-ecefMidPt;
+   ossimEcefVector north = ecefUPt-ecefMidPt;
+   east.normalize();
+   north.normalize();
+   
+   // now use the lsr space constructors to construct an orthogonal set of axes
+   //
+   lsrSpace = ossimLsrSpace(thePlatformPosition,
+                            0,
+                            north,
+                            east.cross(north));
+//   lsrSpace = ossimLsrSpace(thePlatformPosition);
+   // DONE ORIENT TO UTM AXIS
+   
+   NEWMAT::Matrix platformLsrMatrix = lsrSpace.lsrToEcefRotMatrix();
+   NEWMAT::Matrix orientationMatrix = (ossimMatrix3x3::createRotationXMatrix(theOmega+computeParameterOffset(2), OSSIM_LEFT_HANDED)*
+                                       ossimMatrix3x3::createRotationYMatrix(thePhi+computeParameterOffset(3), OSSIM_LEFT_HANDED)*
+                                       ossimMatrix3x3::createRotationZMatrix(theKappa+computeParameterOffset(4), OSSIM_LEFT_HANDED));
+   
+   theCompositeMatrix         = platformLsrMatrix*orientationMatrix;
+   theCompositeMatrixInverse  = theCompositeMatrix.i();
+
+//   theAdjEcefPlatformPosition = theEcefPlatformPosition; 
+
+   theBoundGndPolygon.resize(4);
+   // ossim_float64 w = theImageClipRect.width();//*2.0;
+   // ossim_float64 h = theImageClipRect.height();//*2.0;
+   
+   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
+   theBoundGndPolygon[0] = gpt;
+   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
+   theBoundGndPolygon[1] = gpt;
+   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
+   theBoundGndPolygon[2] = gpt;
+   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
+   theBoundGndPolygon[3] = gpt;
+}
+
+void ossimApplanixUtmModel::initAdjustableParameters()
+{
+   resizeAdjustableParameterArray(6);
+   
+   setAdjustableParameter(0, 0.0);
+   setParameterDescription(0, "x_offset");
+   setParameterUnit(0, "pixels");
+
+   setAdjustableParameter(1, 0.0);
+   setParameterDescription(1, "y_offset");
+   setParameterUnit(1, "pixels");
+
+   setAdjustableParameter(2, 0.0);
+   setParameterDescription(2, "orientation x");
+   setParameterUnit(2, "degrees");
+
+   setAdjustableParameter(3, 0.0);
+   setParameterDescription(3, "orientation y");
+   setParameterUnit(3, "degrees");
+
+   setAdjustableParameter(4, 0.0);
+   setParameterDescription(4, "orientation z");
+   setParameterUnit(4, "degrees");
+
+   setAdjustableParameter(5, 0.0);
+   setParameterDescription(5, "Altitude delta");
+   setParameterUnit(5, "meters");
+
+   
+   
+   setParameterSigma(0, 20.0);
+   setParameterSigma(1, 20.0);
+   setParameterSigma(2, .1);
+   setParameterSigma(3, .1);
+   setParameterSigma(4, .1);
+   setParameterSigma(5, 50);
+}
+
+void ossimApplanixUtmModel::setPrincipalPoint(ossimDpt principalPoint)
+{
+   thePrincipalPoint = principalPoint;
+}
+
+void ossimApplanixUtmModel::setPixelSize(const ossimDpt& pixelSize)
+{
+   thePixelSize = pixelSize;
+}
+
+void ossimApplanixUtmModel::setImageRect(const ossimDrect& rect)
+{
+   theImageClipRect = rect;
+   theRefImgPt = rect.midPoint();
+}
+
+void ossimApplanixUtmModel::setFocalLength(double focalLength)
+{
+   theFocalLength = focalLength;
+}
+
+void ossimApplanixUtmModel::setPlatformPosition(const ossimGpt& gpt)
+{
+   theRefGndPt             = gpt;
+   theEcefPlatformPosition = gpt;
+   updateModel();
+   
+}
+
+bool ossimApplanixUtmModel::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix) const
+{
+   ossimSensorModel::saveState(kwl, prefix);
+   
+   kwl.add(prefix, "type", "ossimApplanixUtmModel", true);
+
+   kwl.add(prefix, "omega", theOmega, true);
+   kwl.add(prefix, "phi", thePhi, true);
+   kwl.add(prefix, "kappa", theKappa, true);
+   kwl.add(prefix, "bore_sight_tx", theBoreSightTx*60, true);
+   kwl.add(prefix, "bore_sight_ty", theBoreSightTy*60, true);
+   kwl.add(prefix, "bore_sight_tz", theBoreSightTz*60, true);
+   kwl.add(prefix, "principal_point", ossimString::toString(thePrincipalPoint.x) + " " + ossimString::toString(thePrincipalPoint.y));
+   kwl.add(prefix, "pixel_size",      ossimString::toString(thePixelSize.x) + " " + ossimString::toString(thePixelSize.y));
+   kwl.add(prefix, "focal_length", theFocalLength);
+   kwl.add(prefix, "ecef_platform_position",
+           ossimString::toString(theEcefPlatformPosition.x()) + " " +
+           ossimString::toString(theEcefPlatformPosition.y()) + " " +
+           ossimString::toString(theEcefPlatformPosition.z()));
+   kwl.add(prefix, "latlonh_platform_position",
+           ossimString::toString(thePlatformPosition.latd()) + " " +
+           ossimString::toString(thePlatformPosition.lond()) + " " +
+           ossimString::toString(thePlatformPosition.height()) + " " +
+           thePlatformPosition.datum()->code());
+   kwl.add(prefix,
+           "utm_platform_position",
+           ossimString::toString(theUtmPlatformPosition.x) + " " +
+           ossimString::toString(theUtmPlatformPosition.y) + " " +
+           ossimString::toString(theUtmPlatformPosition.z) + " " +
+           thePlatformPosition.datum()->code(),
+           true);
+   kwl.add(prefix,
+           "utm_zone",
+           theUtmZone,
+           true);
+   kwl.add(prefix,
+           "utm_hemisphere",
+           theUtmHemisphere,
+           true);
+   kwl.add(prefix,
+           "shift_values",
+           ossimString::toString(theShiftValues.x()) + " " + 
+           ossimString::toString(theShiftValues.y()) + " " +
+           ossimString::toString(theShiftValues.z()),
+           true);
+   if(theLensDistortion.valid())
+   {
+      ossimString lensPrefix = ossimString(prefix)+"distortion.";
+      theLensDistortion->saveState(kwl,
+                                   lensPrefix.c_str());
+   }
+   
+   return true;
+}
+
+bool ossimApplanixUtmModel::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   if(traceDebug())
+   {
+      std::cout << "ossimApplanixUtmModel::loadState: ......... entered" << std::endl;
+   }
+   theImageClipRect = ossimDrect(0,0,4076,4091);
+   theRefImgPt      = ossimDpt(2046.0, 2038.5);
+   
+   ossimSensorModel::loadState(kwl, prefix);
+
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+      initAdjustableParameters();
+   }
+
+   const char* eo_file           = kwl.find(prefix, "eo_file");
+   const char* eo_id             = kwl.find(prefix, "eo_id");
+   const char* omega             = kwl.find(prefix, "omega");
+   const char* phi               = kwl.find(prefix, "phi");
+   const char* kappa             = kwl.find(prefix, "kappa");
+   const char* bore_sight_tx     = kwl.find(prefix, "bore_sight_tx");
+   const char* bore_sight_ty     = kwl.find(prefix, "bore_sight_ty");
+   const char* bore_sight_tz     = kwl.find(prefix, "bore_sight_tz");
+   
+   const char* principal_point   = kwl.find(prefix, "principal_point");
+   const char* pixel_size        = kwl.find(prefix, "pixel_size");
+   const char* focal_length      = kwl.find(prefix, "focal_length");
+   const char* latlonh_platform_position = kwl.find(prefix, "latlonh_platform_position");
+   const char* utm_platform_position = kwl.find(prefix, "utm_platform_position");
+   const char* compute_gsd_flag  = kwl.find(prefix, "compute_gsd_flag");
+   const char* utm_zone          = kwl.find(prefix, "utm_zone");
+   const char* utm_hemisphere    = kwl.find(prefix, "utm_hemisphere");
+   const char* camera_file       = kwl.find(prefix, "camera_file");
+   const char* shift_values      = kwl.find(prefix, "shift_values");
+   
+   theCompositeMatrix          = ossimMatrix3x3::createIdentity();
+   theCompositeMatrixInverse   = ossimMatrix3x3::createIdentity();
+   theOmega                    = 0.0;
+   thePhi                      = 0.0;
+   theKappa                    = 0.0;
+   theBoreSightTx              = 0.0;
+   theBoreSightTy              = 0.0;
+   theBoreSightTz              = 0.0;
+   theFocalLength              = 55.0;
+   thePixelSize = ossimDpt(.009, .009);
+   theEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
+
+   bool loadedFromEoFile = false;
+
+   if(eo_id)
+   {
+      theImageID = eo_id;
+   }
+   // loading from standard eo file with given record id
+   //
+   if(eo_file)
+   {
+      ossimApplanixEOFile eoFile;
+      
+      if(eoFile.parseFile(ossimFilename(eo_file)))
+      {
+         ossimRefPtr<ossimApplanixEORecord> record = eoFile.getRecordGivenId(theImageID);
+
+         if(record.valid())
+         {
+            loadedFromEoFile = true;
+            theBoreSightTx = eoFile.getBoreSightTx()/60.0;
+            theBoreSightTy = eoFile.getBoreSightTy()/60.0;
+            theBoreSightTz = eoFile.getBoreSightTz()/60.0;
+            theShiftValues = ossimEcefVector(eoFile.getShiftValuesX(),
+                                             eoFile.getShiftValuesY(),
+                                             eoFile.getShiftValuesZ());
+            ossim_int32 easting  = eoFile.getFieldIdxLike("EASTING");
+            ossim_int32 northing = eoFile.getFieldIdxLike("NORTHING");
+            ossim_int32 height   = eoFile.getFieldIdxLike("HEIGHT");
+            ossim_int32 omega    = eoFile.getFieldIdxLike("OMEGA");
+            ossim_int32 phi      = eoFile.getFieldIdxLike("PHI");
+            ossim_int32 kappa    = eoFile.getFieldIdxLike("KAPPA");
+
+            if((omega>=0)&&
+               (phi>=0)&&
+               (kappa>=0)&&
+               (height>=0)&&
+               (easting>=0)&&
+               (northing>=0))
+            {
+               theOmega = (*record)[omega].toDouble();
+               thePhi   = (*record)[phi].toDouble();
+               theKappa = (*record)[kappa].toDouble();
+               double h = (*record)[height].toDouble();
+               ossimString heightType = kwl.find(prefix, "height_type");
+               if(eoFile.isUtmFrame())
+               {
+                  theUtmZone = eoFile.getUtmZone();
+                  theUtmHemisphere = eoFile.getUtmHemisphere()=="North"?'N':'S';
+                  ossimUtmProjection utmProj;
+                  utmProj.setZone(theUtmZone);
+                  utmProj.setHemisphere((char)theUtmHemisphere);
+                  theUtmPlatformPosition.x = (*record)[easting].toDouble();
+                  theUtmPlatformPosition.y = (*record)[northing].toDouble();
+                  theUtmPlatformPosition.z = h;
+                  thePlatformPosition = utmProj.inverse(ossimDpt(theUtmPlatformPosition.x,
+                                                                 theUtmPlatformPosition.y));
+                  thePlatformPosition.height(h);
+
+                  if(eoFile.isHeightAboveMSL())
+                  {
+                     double offset = ossimGeoidManager::instance()->offsetFromEllipsoid(thePlatformPosition);
+                     if(!ossim::isnan(offset))
+                     {
+                        thePlatformPosition.height(h + offset);
+                        theUtmPlatformPosition.z = h + offset;
+                     }
+                  }
+               }
+               else
+               {
+                  return false;
+               }
+            }
+            theEcefPlatformPosition = thePlatformPosition;
+         }
+         else
+         {
+            return false;
+         }
+      }
+   }
+   if(!loadedFromEoFile)
+   {
+      if(shift_values)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(shift_values);
+         tempString = tempString.trim();
+         tempString.split(splitString, " " );
+         if(splitString.size() == 3)
+         {
+            theShiftValues = ossimEcefVector(splitString[0].toDouble(),
+                                             splitString[1].toDouble(),
+                                             splitString[2].toDouble());
+         }
+      }
+      if(omega&&phi&&kappa)
+      {
+         theOmega = ossimString(omega).toDouble();
+         thePhi   = ossimString(phi).toDouble();
+         theKappa = ossimString(kappa).toDouble();
+      }
+      if(bore_sight_tx&&bore_sight_ty&&bore_sight_tz)
+      {
+         theBoreSightTx = ossimString(bore_sight_tx).toDouble()/60.0;
+         theBoreSightTy = ossimString(bore_sight_ty).toDouble()/60.0;
+         theBoreSightTz = ossimString(bore_sight_tz).toDouble()/60.0;
+      }
+      double lat=0.0, lon=0.0, h=0.0;
+      if(utm_zone)
+      {
+         theUtmZone = ossimString(utm_zone).toInt32();
+      }
+      if(utm_hemisphere)
+      {
+         ossimString hem = utm_hemisphere;
+         hem = hem.trim();
+         hem = hem.upcase();
+         theUtmHemisphere = *(hem.begin());
+      }
+      if(utm_platform_position)
+      {
+         ossimUtmProjection utmProj;
+         std::vector<ossimString> splitString;
+         ossimString tempString(utm_platform_position);
+         tempString = tempString.trim();
+         ossimString datumString;
+         utmProj.setZone(theUtmZone);
+         utmProj.setHemisphere((char)theUtmHemisphere);
+         tempString.split(splitString, " ");
+         if(splitString.size() > 2)
+         {
+            theUtmPlatformPosition.x = splitString[0].toDouble();
+            theUtmPlatformPosition.y = splitString[1].toDouble();
+            theUtmPlatformPosition.z = splitString[2].toDouble();
+         }
+         if(splitString.size() > 3)
+         {
+            datumString = splitString[3];
+         }
+         const ossimDatum* datum = ossimDatumFactory::instance()->create(datumString);
+         if(datum)
+         {
+            utmProj.setDatum(datum);
+         }
+         
+         thePlatformPosition = utmProj.inverse(ossimDpt(theUtmPlatformPosition.x,
+                                                        theUtmPlatformPosition.y));
+         thePlatformPosition.height(theUtmPlatformPosition.z);
+         
+         ossimString heightType = kwl.find(prefix, "height_type");
+         if(heightType == "msl")
+         {
+            double offset = ossimGeoidManager::instance()->offsetFromEllipsoid(thePlatformPosition);
+            if(ossim::isnan(offset) == false)
+            {
+               thePlatformPosition.height(thePlatformPosition.height() + offset);
+               theUtmPlatformPosition.z = thePlatformPosition.height();
+            }
+         }
+         theEcefPlatformPosition = thePlatformPosition;
+      }
+      else if(latlonh_platform_position)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(latlonh_platform_position);
+         std::string datumString;
+         tempString = tempString.trim();
+         tempString.split(splitString, " ");
+         if(splitString.size() > 2)
+         {
+            lat = splitString[0].toDouble();
+            lon = splitString[1].toDouble();
+            h = splitString[2].toDouble();
+         }
+         if(splitString.size() > 3)
+         {
+            datumString = splitString[3].string();
+         }
+         thePlatformPosition.latd(lat);
+         thePlatformPosition.lond(lon);
+         thePlatformPosition.height(h);
+         const ossimDatum* datum = ossimDatumFactory::instance()->create(datumString);
+         if(datum)
+         {
+            thePlatformPosition.datum(datum);
+         }
+         ossimString heightType = kwl.find(prefix, "height_type");
+         if(heightType == "msl")
+         {
+            double offset = ossimGeoidManager::instance()->offsetFromEllipsoid(thePlatformPosition);
+            if(ossim::isnan(offset) == false)
+            {
+               thePlatformPosition.height(thePlatformPosition.height() + offset);
+            }
+         }
+         theEcefPlatformPosition = thePlatformPosition;
+      }
+   }
+   if(principal_point)
+   {
+      std::vector<ossimString> splitString;
+      ossimString tempString(principal_point);
+      tempString = tempString.trim();
+      tempString.split(splitString, " ");
+      if(splitString.size() == 2)
+      {
+         thePrincipalPoint.x = splitString[0].toDouble();
+         thePrincipalPoint.y = splitString[1].toDouble();
+      }
+   }
+   if(pixel_size)
+   {
+      std::vector<ossimString> splitString;
+      ossimString tempString(principal_point);
+      tempString = tempString.trim();
+      tempString.split(splitString, " ");
+      if(splitString.size() == 2)
+      {
+         thePixelSize.x = splitString[0].toDouble();
+         thePixelSize.y = splitString[1].toDouble();
+      }
+   }
+   if(focal_length)
+   {
+      theFocalLength = ossimString(focal_length).toDouble();
+   }
+
+   if(camera_file)
+   {
+      ossimKeywordlist cameraKwl;
+      ossimKeywordlist lensKwl;
+      cameraKwl.add(camera_file);
+      const char* sensor = cameraKwl.find("sensor");
+      const char* image_size      = cameraKwl.find(prefix, "image_size");
+      principal_point = cameraKwl.find("principal_point");
+      focal_length    = cameraKwl.find("focal_length");
+      pixel_size      = cameraKwl.find(prefix, "pixel_size");
+      focal_length    = cameraKwl.find(prefix, "focal_length");
+      const char* distortion_units = cameraKwl.find(prefix, "distortion_units");
+      ossimUnitConversionTool tool;
+      ossimUnitType unitType = OSSIM_MILLIMETERS;
+
+      if(distortion_units)
+      {
+         unitType = (ossimUnitType)ossimUnitTypeLut::instance()->getEntryNumber(distortion_units);
+
+         if(unitType == OSSIM_UNIT_UNKNOWN)
+         {
+            unitType = OSSIM_MILLIMETERS;
+         }
+      }
+      if(image_size)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(image_size);
+         tempString = tempString.trim();
+         tempString.split(splitString, " ");
+         double w=1, h=1;
+         if(splitString.size() == 2)
+         {
+            w = splitString[0].toDouble();
+            h = splitString[1].toDouble();
+         }
+         theImageClipRect = ossimDrect(0,0,w-1,h-1);
+         theRefImgPt      = ossimDpt(w/2.0, h/2.0);
+         theImageSize     = ossimDpt(w, h);
+      }
+      if(sensor)
+      {
+         theSensorID = sensor;
+      }
+      if(principal_point)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(principal_point);
+         tempString = tempString.trim();
+         tempString.split(splitString, " ");
+         if(splitString.size() == 2)
+         {
+            thePrincipalPoint.x = splitString[0].toDouble();
+            thePrincipalPoint.y = splitString[1].toDouble();
+         }
+      }
+      if(pixel_size)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(pixel_size);
+         tempString = tempString.trim();
+         tempString.split(splitString, " ");
+         if(splitString.size() == 1)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = thePixelSize.x;
+         }
+         else if(splitString.size() == 2)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = splitString[1].toDouble();
+         }
+      }
+      if(focal_length)
+      {
+         theFocalLength = ossimString(focal_length).toDouble();
+      }
+
+      cameraKwl.trimAllValues();
+      
+      
+      ossimString regExpression =  ossimString("^(") + "d[0-9]+)";
+      vector<ossimString> keys;
+      cameraKwl.getSubstringKeyList( keys, regExpression );
+      long numberOfDistortions = (long)keys.size();
+      int offset = (int)ossimString("d").size();
+      ossim_uint32 idx = 0;
+      std::vector<int> numberList(numberOfDistortions);
+      for(idx = 0; idx < numberList.size();++idx)
+      {
+         ossimString numberStr(keys[idx].begin() + offset,
+                               keys[idx].end());
+         numberList[idx] = numberStr.toInt();
+      }
+      std::sort(numberList.begin(), numberList.end());
+      double distance=0.0, distortion=0.0;
+     
+      for(idx = 0; idx < numberList.size(); ++idx)
+      {
+         ossimString value = cameraKwl.find(ossimString("d")+ossimString::toString(numberList[idx]));
+         if(!value.empty())
+         {
+            std::istringstream inStr(value.c_str());
+            inStr >> distance;
+            ossim::skipws(inStr);
+            inStr >> distortion;
+#if 0
+            std::vector<ossimString> splitString;
+            ossimString tempString(value);
+            tempString = tempString.trim();
+            tempString.split(splitString, " ");
+            std::cout << splitString.size() << std::endl;
+            if(splitString.size() >= 2)
+            {
+               distance = splitString[0].toDouble();
+               distortion = splitString[1].toDouble();
+            }
+#endif
+            
+            tool.setValue(distortion, unitType);
+            lensKwl.add(ossimString("distance") + ossimString::toString(idx),
+                        distance,
+                        true);
+            lensKwl.add(ossimString("distortion") + ossimString::toString(idx),
+                        tool.getMillimeters(),
+                        true);
+         }
+         lensKwl.add("convergence_threshold",
+                     .00001,
+                     true);
+         if(pixel_size)
+         {
+            lensKwl.add("dxdy",
+                        ossimString::toString(thePixelSize.x) + " " +ossimString::toString(thePixelSize.y),
+                        true);
+         }
+         else
+         {
+            lensKwl.add("dxdy",
+                        ".009 .009",
+                        true);
+         }
+      }
+      if(theLensDistortion.valid())
+      {
+         theLensDistortion->loadState(lensKwl,"");
+      }
+   }
+   else
+   {
+      
+      if(principal_point)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(principal_point);
+         tempString = tempString.trim();
+         tempString.split(splitString, " ");
+         if(splitString.size() >= 2)
+         {
+            thePrincipalPoint.x = splitString[0].toDouble();
+            thePrincipalPoint.y = splitString[1].toDouble();
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No principal_point found" << std::endl;
+            return false;
+         }
+      }
+      if(pixel_size)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(pixel_size);
+         tempString = tempString.trim();
+         tempString.split(splitString, " ");
+         if(splitString.size() == 1)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = thePixelSize.x;
+         }
+         else if(splitString.size() == 2)
+         {
+            thePixelSize.x = splitString[0].toDouble();
+            thePixelSize.y = splitString[1].toDouble();
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No pixel size found" << std::endl;
+            return false;
+         }
+      }
+      if(focal_length)
+      {
+         theFocalLength = ossimString(focal_length).toDouble();
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No focal length found" << std::endl;
+            return false;
+         }
+      }
+      
+      if(theLensDistortion.valid())
+      {
+         ossimString lensPrefix = ossimString(prefix)+"distortion.";
+         theLensDistortion->loadState(kwl,
+                                      lensPrefix.c_str());
+      }
+   }
+   theRefGndPt = thePlatformPosition;
+   
+   updateModel();
+
+   lineSampleToWorld(theRefImgPt, theRefGndPt);
+   if(compute_gsd_flag)
+   {
+      if(ossimString(compute_gsd_flag).toBool())
+      {
+         ossimGpt right;
+         ossimGpt top;
+         lineSampleToWorld(theRefImgPt + ossimDpt(1.0, 0.0),
+                           right);
+         lineSampleToWorld(theRefImgPt + ossimDpt(1.0, 0.0),
+                           top);
+
+         ossimEcefVector horizontal = ossimEcefPoint(theRefGndPt)-ossimEcefPoint(right);
+         ossimEcefVector vertical   = ossimEcefPoint(theRefGndPt)-ossimEcefPoint(top);
+
+         theGSD.x = horizontal.length();
+         theGSD.y = vertical.length();
+         theMeanGSD = (theGSD.x+theGSD.y)*.5;
+      }
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theOmega:              " << theOmega << std::endl
+                                          << "thePhi:                " << thePhi   << std::endl
+                                          << "theKappa:              " << theKappa << std::endl;
+      std::cout << "platform position:     " << thePlatformPosition << std::endl;
+      std::cout << "platform position ECF: " << theEcefPlatformPosition << std::endl;
+      std::cout << "ossimApplanixModel::loadState: ......... leaving" << std::endl;
+   }
+
+   return true;
+}
+
+bool ossimApplanixUtmModel::setupOptimizer(const ossimString& init_file)
+{
+   ossimKeywordlist kwl;
+   kwl.addFile(init_file.c_str());
+
+   return loadState(kwl);
+}
diff --git a/ossim/src/ossim/projection/ossimAzimEquDistProjection.cpp b/src/projection/ossimAzimEquDistProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimAzimEquDistProjection.cpp
rename to src/projection/ossimAzimEquDistProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimBilinearProjection.cpp b/src/projection/ossimBilinearProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimBilinearProjection.cpp
rename to src/projection/ossimBilinearProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimBngProjection.cpp b/src/projection/ossimBngProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimBngProjection.cpp
rename to src/projection/ossimBngProjection.cpp
diff --git a/src/projection/ossimBonneProjection.cpp b/src/projection/ossimBonneProjection.cpp
new file mode 100644
index 0000000..6ddff68
--- /dev/null
+++ b/src/projection/ossimBonneProjection.cpp
@@ -0,0 +1,535 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Bonne projection code.  
+//*******************************************************************
+//  $Id: ossimBonneProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+#include <ossim/projection/ossimBonneProjection.h>
+#include <ossim/projection/ossimSinusoid.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimBonneProjection, "ossimBonneProjection", ossimMapProjection)
+
+
+/***************************************************************************/
+/*
+ *                               DEFINES
+ */
+#define BONN_NO_ERROR           0x0000
+#define BONN_LAT_ERROR          0x0001
+#define BONN_LON_ERROR          0x0002
+#define BONN_EASTING_ERROR      0x0004
+#define BONN_NORTHING_ERROR     0x0008
+#define BONN_ORIGIN_LAT_ERROR   0x0010
+#define BONN_CENT_MER_ERROR     0x0020
+#define BONN_A_ERROR            0x0040
+#define BONN_B_ERROR            0x0080
+#define BONN_A_LESS_B_ERROR     0x0100
+
+#define PI_OVER_2  (M_PI / 2.0)                 
+#define BONN_m(coslat,sinlat)                   (coslat/sqrt(1.0 - es2*sinlat*sinlat))
+#define BONN_M(c0lat,c1s2lat,c2s4lat,c3s6lat)   (Bonn_a*(c0lat-c1s2lat+c2s4lat-c3s6lat))
+#define COEFF_TIMES_BONN_SIN(coeff,x,latit)	    (coeff*(sin(x * latit)))
+#define FLOAT_EQ(x,v,epsilon)   (((v - epsilon) < x) && (x < (v + epsilon)))
+
+ossimBonneProjection::ossimBonneProjection(const ossimEllipsoid& ellipsoid,
+                                           const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();   
+   update();
+}
+
+ossimBonneProjection::ossimBonneProjection(const ossimEllipsoid& ellipsoid,
+                                           const ossimGpt& origin,
+                                           const double falseEasting,
+                                           const double falseNorthing)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   Bonn_False_Easting  = falseEasting;
+   Bonn_False_Northing = falseNorthing;
+   Bonn_Delta_Northing = 25000000.0;
+
+   update();
+}
+
+void ossimBonneProjection::update()
+{
+   Set_Bonne_Parameters(theEllipsoid.getA(),
+                        theEllipsoid.getFlattening(),
+                        theOrigin.latr(),
+                        theOrigin.lonr(),
+                        Bonn_False_Easting,
+                        Bonn_False_Northing);
+
+   theFalseEastingNorthing.x = Bonn_False_Easting;
+   theFalseEastingNorthing.y = Bonn_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+void ossimBonneProjection::setFalseEasting(double falseEasting)
+{
+   Bonn_False_Easting = falseEasting;
+   update();
+}
+
+void ossimBonneProjection::setFalseNorthing(double falseNorthing)
+{
+   Bonn_False_Northing = falseNorthing;
+   update();
+}
+
+void ossimBonneProjection::setFalseEastingNorthing(double falseEasting,
+                                                   double falseNorthing)
+{
+   Bonn_False_Easting = falseEasting;
+   Bonn_False_Northing = falseNorthing;  
+   update();
+}
+
+void ossimBonneProjection::setDefaults()
+{
+
+   Bonn_False_Easting  = 0.0;
+   Bonn_False_Northing = 0.0;  
+   Bonn_Delta_Northing = 25000000.0;
+   if(theOrigin.latd() == 0.0)
+   {
+      // we can't have the origin of lat 0 for Bonne
+      // so bump it up an arc second.
+      //
+      theOrigin.latd(1.0/3600.0);
+   }
+}
+
+ossimGpt ossimBonneProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat, lon;
+
+   Convert_Bonne_To_Geodetic(eastingNorthing.x,
+                             eastingNorthing.y,
+                             &lat,
+                             &lon);
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0, theDatum);  
+}
+
+ossimDpt ossimBonneProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Bonne(gpt.latr(),
+                             gpt.lonr(),
+                             &easting,
+                             &northing);
+   return ossimDpt(easting, northing);
+}
+
+bool ossimBonneProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimBonneProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // Must do this first.
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+   
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+
+   setDefaults();
+
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimBonneProjection))
+   {
+      Bonn_False_Easting  = theFalseEastingNorthing.x;
+      Bonn_False_Northing = theFalseEastingNorthing.y;
+   }
+   
+   update();
+   return flag;
+}
+
+
+/*
+ * These state variables are for optimization purposes.  The only function
+ * that should modify them is Set_Bonne_Parameters.
+ */
+
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS     
+ */
+
+
+long ossimBonneProjection::Set_Bonne_Parameters(double a,
+                                                double f,
+                                                double Origin_Latitude,
+                                                double Central_Meridian,
+                                                double False_Easting,
+                                                double False_Northing)
+{ /* Begin Set_Bonne_Parameters */
+/*
+ * The function Set_Bonne_Parameters receives the ellipsoid parameters and
+ * Bonne projection parameters as inputs, and sets the corresponding state
+ * variables.  If any errors occur, the error code(s) are returned by the 
+ * function, otherwise BONN_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid                   (input)
+ *    Origin_Latitude   : Latitude in radians at which the          (input)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (input)
+ */
+
+  double j, three_es4;
+  double x,e1,e2,e3,e4;
+  double clat; 
+  double sin2lat, sin4lat, sin6lat, lat;
+//  double inv_f = 1 / f;
+  long Error_Code = BONN_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= BONN_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+// 	 Error_Code |= BONN_INV_F_ERROR;
+//   } 
+//   if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
+//   { /* origin latitude out of range */
+//     Error_Code |= BONN_ORIGIN_LAT_ERROR;
+//   }
+//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= BONN_CENT_MER_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    Bonn_a = a;
+    Bonn_f = f;
+    Bonn_Origin_Lat = Origin_Latitude;
+//     if (Central_Meridian > PI)
+//       Central_Meridian -= TWO_PI;
+    Bonn_Origin_Long = Central_Meridian;
+    Bonn_False_Northing = False_Northing;
+    Bonn_False_Easting = False_Easting;
+    if (Bonn_Origin_Lat == 0.0)
+    {
+       if (Bonn_Origin_Long > 0)
+       {
+          Bonn_Max_Easting = 19926189.0;
+          Bonn_Min_Easting = -20037509.0;
+       }
+       else if (Bonn_Origin_Long < 0)
+       {
+          Bonn_Max_Easting = 20037509.0;
+          Bonn_Min_Easting = -19926189.0;
+       }
+       else
+       {
+          Bonn_Max_Easting = 20037509.0;
+          Bonn_Min_Easting = -20037509.0;
+       }
+       Bonn_Delta_Northing = 10001966.0;
+       Set_Sinusoidal_Parameters(Bonn_a, Bonn_f, Bonn_Origin_Long, Bonn_False_Easting, Bonn_False_Northing);
+    }
+    else
+    {
+       Sin_Bonn_Origin_Lat = sin(Bonn_Origin_Lat);
+       
+       es2 = 2 * Bonn_f - Bonn_f * Bonn_f;
+       es4 = es2 * es2;
+       es6 = es4 * es2;
+       j = 45.0 * es6 / 1024.0;
+       three_es4 = 3.0 * es4;
+       c0 = 1 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
+       c1 = 3.0 * es2 / 8.0 + three_es4 / 32.0 + j;
+       c2 = 15.0 * es4 / 256.0 + j;
+       c3 = 35.0 * es6 / 3072.0;
+       
+       clat = cos(Bonn_Origin_Lat);
+       m1 = BONN_m(clat, Sin_Bonn_Origin_Lat);
+       
+       lat = c0 * Bonn_Origin_Lat;
+       sin2lat = COEFF_TIMES_BONN_SIN(c1, 2.0, Bonn_Origin_Lat);
+       sin4lat = COEFF_TIMES_BONN_SIN(c2, 4.0, Bonn_Origin_Lat);
+       sin6lat = COEFF_TIMES_BONN_SIN(c3, 6.0, Bonn_Origin_Lat);
+       M1 = BONN_M(lat, sin2lat, sin4lat, sin6lat);
+       
+       x = sqrt (1.0 - es2);
+       e1 = (1.0 - x) / (1.0 + x);
+       e2 = e1 * e1;
+       e3 = e2 * e1;
+       e4 = e3 * e1;
+       a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
+       a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
+       a2 = 151.0 * e3 / 96.0;
+       a3 = 1097.0 * e4 / 512.0;
+       if (Sin_Bonn_Origin_Lat == 0.0)
+          Bonn_am1sin = 0.0;
+       else
+          Bonn_am1sin = Bonn_a * m1 / Sin_Bonn_Origin_Lat;
+       
+       Bonn_Max_Easting = 20027474.0;
+       Bonn_Min_Easting = -20027474.0;
+       Bonn_Delta_Northing = 20003932.0;
+       
+    }
+    
+  } /* End if(!Error_Code) */
+  return (Error_Code);
+} /* End Set_Bonne_Parameters */
+
+
+void ossimBonneProjection::Get_Bonne_Parameters(double *a,
+                                                double *f,
+                                                double *Origin_Latitude,
+                                                double *Central_Meridian,
+                                                double *False_Easting,
+                                                double *False_Northing)const
+{ /* Begin Get_Bonne_Parameters */
+/*
+ * The function Get_Bonne_Parameters returns the current ellipsoid
+ * parameters and Bonne projection parameters.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid                   (output)
+ *    Origin_Latitude   : Latitude in radians at which the          (output)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (output)
+ */
+
+  *a = Bonn_a;
+  *f = Bonn_f;
+  *Origin_Latitude = Bonn_Origin_Lat;
+  *Central_Meridian = Bonn_Origin_Long;
+  *False_Easting = Bonn_False_Easting;
+  *False_Northing = Bonn_False_Northing;
+  return;
+} /* End Get_Bonne_Parameters */
+
+
+long ossimBonneProjection::Convert_Geodetic_To_Bonne (double Latitude,
+                                                      double Longitude,
+                                                      double *Easting,
+                                                      double *Northing)const
+{ /* Begin Convert_Geodetic_To_Bonne */
+/*
+ * The function Convert_Geodetic_To_Bonne converts geodetic (latitude and
+ * longitude) coordinates to Bonne projection (easting and northing)
+ * coordinates, according to the current ellipsoid and Bonne projection
+ * parameters.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise BONN_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double dlam; /* Longitude - Central Meridan */
+  double mm;
+  double MM;
+  double rho;
+  double EE;
+  double clat = cos(Latitude);
+  double slat = sin(Latitude);
+  double lat, sin2lat, sin4lat, sin6lat;
+  long Error_Code = BONN_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   { /* Latitude out of range */
+//     Error_Code |= BONN_LAT_ERROR;
+//   }
+//   if ((Longitude < -PI) || (Longitude > TWO_PI))
+//   { /* Longitude out of range */
+//     Error_Code |= BONN_LON_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+     if (Bonn_Origin_Lat == 0.0)
+        Convert_Geodetic_To_Sinusoidal(Latitude, Longitude, Easting, Northing);
+     else
+     {
+        dlam = Longitude - Bonn_Origin_Long;
+        if (dlam > M_PI)
+        {
+           dlam -= TWO_PI;
+        }
+        if (dlam < -M_PI)
+        {
+           dlam += TWO_PI;
+        }
+        if ((Latitude - Bonn_Origin_Lat) == 0.0 && FLOAT_EQ(fabs(Latitude),PI_OVER_2,.00001))
+        {
+           *Easting = 0.0;
+           *Northing = 0.0;
+        }
+        else
+        {
+           mm = BONN_m(clat, slat);
+           
+           lat = c0 * Latitude;
+           sin2lat = COEFF_TIMES_BONN_SIN(c1, 2.0, Latitude);
+           sin4lat = COEFF_TIMES_BONN_SIN(c2, 4.0, Latitude);
+           sin6lat = COEFF_TIMES_BONN_SIN(c3, 6.0, Latitude);
+           MM = BONN_M(lat, sin2lat, sin4lat, sin6lat);         
+           
+           rho = Bonn_am1sin + M1 - MM;
+           if (rho == 0)
+              EE = 0;
+           else
+              EE = Bonn_a * mm * dlam / rho;
+           *Easting = rho * sin(EE) + Bonn_False_Easting;
+           *Northing = Bonn_am1sin - rho * cos(EE) + Bonn_False_Northing;
+        }
+     }
+  }
+  return (Error_Code);
+} /* End Convert_Geodetic_To_Bonne */
+
+
+long ossimBonneProjection::Convert_Bonne_To_Geodetic(double Easting,
+                                                     double Northing,
+                                                     double *Latitude,
+                                                     double *Longitude)const
+{ /* Begin Convert_Bonne_To_Geodetic */
+/*
+ * The function Convert_Bonne_To_Geodetic converts Bonne projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid and Bonne projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise BONN_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
+  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
+  double mu;
+  double MM;
+  double mm;
+  double am1sin_dy;
+  double rho;
+  double sin2mu, sin4mu, sin6mu, sin8mu;
+  double clat, slat;
+  long Error_Code = BONN_NO_ERROR;
+
+//   if ((Easting < (Bonn_False_Easting + Bonn_Min_Easting))
+//       || (Easting > (Bonn_False_Easting + Bonn_Max_Easting)))
+//   { /* Easting out of range */
+//     Error_Code |= BONN_EASTING_ERROR;
+//   }
+//   if ((Northing < (Bonn_False_Northing - Bonn_Delta_Northing))
+//       || (Northing > (Bonn_False_Northing + Bonn_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= BONN_NORTHING_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+     if (Bonn_Origin_Lat == 0.0)
+        Convert_Sinusoidal_To_Geodetic(Easting, Northing, Latitude, Longitude);
+     else
+     {
+        dy = Northing - Bonn_False_Northing;
+        dx = Easting - Bonn_False_Easting;
+        am1sin_dy = Bonn_am1sin - dy;
+        rho = sqrt(dx * dx + am1sin_dy * am1sin_dy);
+        if (Bonn_Origin_Lat < 0.0)
+           rho = -rho;
+        MM = Bonn_am1sin + M1 - rho;
+        
+        mu = MM / (Bonn_a * c0); 
+        sin2mu = COEFF_TIMES_BONN_SIN(a0, 2.0, mu);
+        sin4mu = COEFF_TIMES_BONN_SIN(a1, 4.0, mu);
+        sin6mu = COEFF_TIMES_BONN_SIN(a2, 6.0, mu);
+        sin8mu = COEFF_TIMES_BONN_SIN(a3, 8.0, mu);
+        *Latitude = mu + sin2mu + sin4mu + sin6mu + sin8mu;
+        
+        if (FLOAT_EQ(fabs(*Latitude),PI_OVER_2,.00001))
+        {
+           *Longitude = Bonn_Origin_Long;
+        }
+        else
+        {
+           clat = cos(*Latitude);
+           slat = sin(*Latitude);
+           mm = BONN_m(clat, slat);
+           
+           if (Bonn_Origin_Lat < 0.0)
+           {
+              dx = -dx;
+              am1sin_dy = -am1sin_dy;
+           }
+           *Longitude = Bonn_Origin_Long + rho * (atan2(dx, am1sin_dy)) /
+                        (Bonn_a * mm);
+        }
+        
+        if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+           *Latitude = PI_OVER_2;
+        else if (*Latitude < -PI_OVER_2)
+           *Latitude = -PI_OVER_2;
+        
+//         if (*Longitude > PI)
+//            *Longitude -= TWO_PI;
+//         if (*Longitude < -PI)
+//            *Longitude += TWO_PI;
+        
+        if (*Longitude > M_PI)/* force distorted values to 180, -180 degrees */
+           *Longitude = M_PI;
+        else if (*Longitude < -M_PI)
+           *Longitude = -M_PI;
+     }
+  }
+  return (Error_Code);
+} /* End Convert_Bonne_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimBonneProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimBonneProjection* p = dynamic_cast<const ossimBonneProjection*>(&proj);
+   if (!p)
+      return false;
+
+   if (!ossim::almostEqual(Bonn_False_Easting, p->Bonn_False_Easting) ) return false;
+   if (!ossim::almostEqual(Bonn_False_Northing,p->Bonn_False_Northing)) return false;
+   if (!ossim::almostEqual(Bonn_Delta_Northing,p->Bonn_Delta_Northing)) return false;
+
+   return true;
+}
diff --git a/src/projection/ossimBuckeyeSensor.cpp b/src/projection/ossimBuckeyeSensor.cpp
new file mode 100644
index 0000000..3128bf7
--- /dev/null
+++ b/src/projection/ossimBuckeyeSensor.cpp
@@ -0,0 +1,720 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//
+//*******************************************************************
+//  $Id: ossimBuckeyeSensor.cpp  $
+
+#include <ossim/projection/ossimBuckeyeSensor.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimLsrSpace.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimMatrix4x4.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimCsvFile.h>
+static ossimTrace traceDebug("ossimBuckeyeSensor:debug");
+
+RTTI_DEF1(ossimBuckeyeSensor, "ossimBuckeyeSensor", ossimSensorModel);
+
+ossimBuckeyeSensor::ossimBuckeyeSensor()
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(): entering..." << std::endl;
+
+	theCompositeMatrix			= ossimMatrix4x4::createIdentity();
+	theCompositeMatrixInverse	= ossimMatrix4x4::createIdentity();
+	theRoll						   = 0.0;
+	thePitch					      = 0.0;
+	theHeading					   = 0.0;
+	theFocalLength				   = 0.0;
+	thePixelSize				   = ossimDpt(0.0, 0.0);
+	thePrincipalPoint			   = ossimDpt(0.0, 0.0);
+	theEcefPlatformPosition		= ossimGpt(0.0, 0.0, 0.0);
+	theAdjEcefPlatformPosition	= ossimGpt(0.0, 0.0, 0.0);
+	theLensDistortion			   = new ossimSmacCallibrationSystem();
+
+	theGSD.makeNan();
+	initAdjustableParameters();
+
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(): returning..." << std::endl;
+}
+ossimBuckeyeSensor::ossimBuckeyeSensor(const ossimDrect& imageRect,
+	const ossimGpt& platformPosition,
+	double roll,
+	double pitch,
+	double heading,
+	const ossimDpt& /* principalPoint */, // in millimeters
+	double focalLength, // in millimeters
+	const ossimDpt& pixelSize) // in millimeters
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(imageRect,platformPosition,roll,pitch,heading,ossimDpt,focalLength,pixelSize): entering..." << std::endl;
+
+	theImageClipRect			    = imageRect;
+	theRefImgPt					    = theImageClipRect.midPoint();
+	theCompositeMatrix          = ossimMatrix4x4::createIdentity();
+	theCompositeMatrixInverse   = ossimMatrix4x4::createIdentity();
+	theRoll                     = roll;
+	thePitch                    = pitch;
+	theHeading                  = heading;
+	theFocalLength              = focalLength;
+	thePixelSize                = pixelSize;
+	theEcefPlatformPosition     = platformPosition;
+	theAdjEcefPlatformPosition  = platformPosition;
+	theLensDistortion           = new ossimSmacCallibrationSystem();
+	theGSD.makeNan();
+
+	initAdjustableParameters();
+	updateModel();
+
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(imageRect,platformPosition,roll,pitch,heading,ossimDpt,focalLength,pixelSize): returning..." << std::endl;
+}
+
+ossimBuckeyeSensor::ossimBuckeyeSensor(const ossimBuckeyeSensor& src)
+	:ossimSensorModel(src)
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(src): entering..." << std::endl;
+
+	initAdjustableParameters();
+
+	if(src.theLensDistortion.valid())
+	{
+		theLensDistortion = new ossimSmacCallibrationSystem(*(src.theLensDistortion.get()));
+	}
+	else
+	{
+		theLensDistortion = new ossimSmacCallibrationSystem();
+	}
+	theGSD.makeNan();
+
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::ossimBuckeyeSensor(src): returning..." << std::endl;
+}
+
+ossimObject* ossimBuckeyeSensor::dup()const
+{
+	return new ossimBuckeyeSensor(*this);
+}
+
+void ossimBuckeyeSensor::imagingRay(const ossimDpt& image_point,
+	ossimEcefRay&   image_ray) const
+{
+	if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimBuckeyeSensor::imagingRay: ..... entered" << std::endl;
+
+	ossimDpt f1 ((image_point) - theRefImgPt);
+	f1.x *= thePixelSize.x;
+	f1.y *= -thePixelSize.y;
+	ossimDpt film (f1 - thePrincipalPoint);
+
+	if(traceDebug())
+	{
+		ossimNotify(ossimNotifyLevel_DEBUG) << "pixel size   = " << thePixelSize << std::endl;
+		ossimNotify(ossimNotifyLevel_DEBUG) << "principal pt = " << thePrincipalPoint << std::endl;
+		ossimNotify(ossimNotifyLevel_DEBUG) << "film pt      = " << film << std::endl;
+	}
+
+	if (theLensDistortion.valid())
+	{
+		ossimDpt filmOut;
+		theLensDistortion->undistort(film, filmOut);
+		film = filmOut;
+	}
+
+	ossimColumnVector3d cam_ray_dir (film.x,
+		film.y,
+		-theFocalLength);
+	ossimEcefVector     ecf_ray_dir (theCompositeMatrix*cam_ray_dir);
+	ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
+
+	image_ray.setOrigin(theAdjEcefPlatformPosition);
+	image_ray.setDirection(ecf_ray_dir);
+
+	if(traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "ossimBuckeyeSensor::imagingRay: ..... leaving" << std::endl;
+}
+
+void ossimBuckeyeSensor::lineSampleToWorld(const ossimDpt& image_point,
+	ossimGpt&       gpt) const
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleToWorld:entering..." << std::endl;
+
+	if(image_point.hasNans())
+	{
+		gpt.makeNan();
+		return;
+	}
+
+	//***
+	// Determine imaging ray and invoke elevation source object's services to
+	// intersect ray with terrain model:
+	//***
+
+	ossimEcefRay ray;
+	imagingRay(image_point, ray);
+	ossimElevManager::instance()->intersectRay(ray, gpt);
+
+	if (traceDebug())
+	{
+		ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
+		ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
+		ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
+	}
+
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleToWorld: returning..." << std::endl;
+	return;
+}
+
+void ossimBuckeyeSensor::lineSampleHeightToWorld(const ossimDpt& image_point,
+	const double&   heightEllipsoid,
+	ossimGpt&       worldPoint) const
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleHeightToWorld: entering..." << std::endl;
+	if (!insideImage(image_point))
+	{
+		worldPoint.makeNan();
+	}
+	else
+	{
+		//***
+		// First establish imaging ray from image point:
+		//***
+		ossimEcefRay ray;
+		imagingRay(image_point, ray);
+		ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
+		worldPoint = ossimGpt(Pecf);
+	}
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::lineSampleHeightToWorld: returning..." << std::endl;
+}
+
+void ossimBuckeyeSensor::worldToLineSample(const ossimGpt& world_point,
+	ossimDpt&       image_point) const
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::worldToLineSample: entering..." << std::endl;
+	if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
+		(!theBoundGndPolygon.hasNans()))
+	{
+		if (!(theBoundGndPolygon.pointWithin(world_point)))
+		{
+			image_point.makeNan();
+			return;
+		}         
+	}
+	ossimEcefPoint g_ecf(world_point);
+	ossimEcefVector ecfRayDir(g_ecf - theAdjEcefPlatformPosition);
+	ossimColumnVector3d camRayDir (theCompositeMatrixInverse*ecfRayDir.data());
+
+
+	double scale = -theFocalLength/camRayDir[2];
+	ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
+
+	if (theLensDistortion.valid())
+	{
+		ossimDpt filmOut;
+		theLensDistortion->distort(film, filmOut);
+		film = filmOut;
+	}
+
+	ossimDpt f1(film + thePrincipalPoint);
+	ossimDpt p1(f1.x/thePixelSize.x,
+		-f1.y/thePixelSize.y);
+
+	ossimDpt p0 (p1.x + theRefImgPt.x,
+		p1.y + theRefImgPt.y);
+
+	image_point = p0;
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::worldToLineSample: returning..." << std::endl;
+}
+
+void ossimBuckeyeSensor::updateModel()
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: entering..." << std::endl;
+	ossimGpt gpt;
+	ossimGpt wgs84Pt;
+	double metersPerDegree = wgs84Pt.metersPerDegree().x;
+	double degreePerMeter = 1.0/metersPerDegree;
+	double latShift = -computeParameterOffset(1)*degreePerMeter;
+	double lonShift = computeParameterOffset(0)*degreePerMeter;
+
+	gpt = theEcefPlatformPosition;
+	double height = gpt.height();
+	gpt.height(height + computeParameterOffset(5));
+	gpt.latd(gpt.latd() + latShift);
+	gpt.lond(gpt.lond() + lonShift);
+	theAdjEcefPlatformPosition = gpt;
+	ossimLsrSpace lsrSpace(theAdjEcefPlatformPosition, theHeading+computeParameterOffset(4));
+
+	// make a left handed rotational matrix;
+	ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
+	NEWMAT::Matrix orientation = (ossimMatrix4x4::createRotationXMatrix(thePitch+computeParameterOffset(3), OSSIM_LEFT_HANDED)*
+		ossimMatrix4x4::createRotationYMatrix(theRoll+computeParameterOffset(2), OSSIM_LEFT_HANDED));
+	theCompositeMatrix        = (lsrMatrix.getData()*orientation);
+	theCompositeMatrixInverse = theCompositeMatrix.i();
+
+	theBoundGndPolygon.resize(4);
+
+	theExtrapolateImageFlag = false;
+	theExtrapolateGroundFlag = false;
+
+   try
+   {
+      // Method throws ossimException.
+      computeGsd();
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimBuckeyeSensor Constructor caught Exception:\n"
+         << e.what() << std::endl;
+   }
+
+	lineSampleToWorld(theImageClipRect.ul(),gpt);
+	theBoundGndPolygon[0] = gpt;
+	lineSampleToWorld(theImageClipRect.ur(),gpt);
+	theBoundGndPolygon[1] = gpt;
+	lineSampleToWorld(theImageClipRect.lr(),gpt);
+	theBoundGndPolygon[2] = gpt;
+	lineSampleToWorld(theImageClipRect.ll(),gpt);
+	theBoundGndPolygon[3] = gpt;
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::updateModel: returning..." << std::endl;
+}
+
+void ossimBuckeyeSensor::initAdjustableParameters()
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::initAdjustableParameters: entering..." << std::endl;
+	resizeAdjustableParameterArray(6);
+
+	setAdjustableParameter(0, 0.0);
+	setParameterDescription(0, "x_offset");
+	setParameterUnit(0, "pixels");
+
+	setAdjustableParameter(1, 0.0);
+	setParameterDescription(1, "y_offset");
+	setParameterUnit(1, "pixels");
+
+	setAdjustableParameter(2, 0.0);
+	setParameterDescription(2, "roll");
+	setParameterUnit(2, "degrees");
+
+	setAdjustableParameter(3, 0.0);
+	setParameterDescription(3, "pitch");
+	setParameterUnit(3, "degrees");
+
+	setAdjustableParameter(4, 0.0);
+	setParameterDescription(4, "heading");
+	setParameterUnit(4, "degrees");
+
+	setAdjustableParameter(5, 0.0);
+	setParameterDescription(5, "altitude");
+	setParameterUnit(5, "meters");
+
+	// TODO: default to correct default values, or just leave it up to the input file, since we have different offsets for the B100, 182, and Metroliner, also need a z offset
+	setParameterSigma(0, 1.0);
+	setParameterSigma(1, 1.0);
+	setParameterSigma(2, 0);
+	setParameterSigma(3, 0);
+	setParameterSigma(4, 0);
+	setParameterSigma(5, 1000);
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::initAdjustableParameters: returning..." << std::endl;
+}
+
+void ossimBuckeyeSensor::setLensDistortion(ossimSmacCallibrationSystem* lensDistortion)
+{
+	theLensDistortion = lensDistortion;
+	updateModel();
+}
+
+bool ossimBuckeyeSensor::saveState(ossimKeywordlist& kwl,
+	const char* prefix) const
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::saveState: entering..." << std::endl;
+	ossimSensorModel::saveState(kwl, prefix);
+
+	kwl.add(prefix, "type", "ossimBuckeyeSensor", true);
+
+	kwl.add(prefix, "roll", theRoll, true);
+	kwl.add(prefix, "pitch", thePitch, true);
+	kwl.add(prefix, "heading", theHeading, true);
+	kwl.add(prefix, "principal_point", "("+ossimString::toString(thePrincipalPoint.x) + "," + ossimString::toString(thePrincipalPoint.y)+")");
+	kwl.add(prefix, "pixel_size", "("+ossimString::toString(thePixelSize.x) + "," + ossimString::toString(thePixelSize.y)+")");
+	kwl.add(prefix, "focal_length", theFocalLength);
+	kwl.add(prefix, "ecef_platform_position",
+		ossimString::toString(theEcefPlatformPosition.x()) + " " +
+		ossimString::toString(theEcefPlatformPosition.y()) + " " +
+		ossimString::toString(theEcefPlatformPosition.z()));
+
+	if(theLensDistortion.valid())
+	{
+		ossimString lensPrefix = ossimString(prefix)+"distortion.";
+		theLensDistortion->saveState(kwl,
+			lensPrefix.c_str());
+	}
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::saveState: returning..." << std::endl;
+	return true;
+}
+
+bool ossimBuckeyeSensor::loadState(const ossimKeywordlist& kwl,
+	const char* prefix)
+{
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::loadState: entering..." << std::endl;
+
+	ossimSensorModel::loadState(kwl, prefix);
+
+   // If theRefImgPt remains unset by ossimSensorModel::loadState(), 
+   // set it to the image center.
+   if ( theRefImgPt == ossimDpt(0, 0) )
+   {
+      theRefImgPt = theImageClipRect.midPoint();
+   }
+
+	if(getNumberOfAdjustableParameters() < 1)
+	{
+		initAdjustableParameters();
+	}
+
+	ossimString framemeta_gsti = kwl.find(prefix, "framemeta_gsti");
+	ossimString framemeta = kwl.find(prefix,"framemeta");
+	ossimString frame_number = kwl.find(prefix, "frame_number");
+	ossimString pixel_size = kwl.find(prefix, "pixel_size");
+	ossimString principal_point = kwl.find(prefix, "principal_point");
+	ossimString focal_length = kwl.find(prefix, "focal_length");
+	ossimString smac_radial = kwl.find(prefix, "smac_radial");
+	ossimString smac_decent = kwl.find(prefix, "smac_decent");
+	ossimString roll;
+	ossimString pitch;
+	ossimString yaw;
+	ossimString platform_position;
+	ossimFilename file_to_load;
+
+	ossimString FRAME_STRING	= "Frame#";
+	ossimString ROLL_STRING		= "Roll(deg)";
+	ossimString PITCH_STRING	= "Pitch(deg)";
+	ossimString YAW_STRING		= "Yaw(deg)";
+	ossimString LAT_STRING		= "Lat(deg)";
+	ossimString LON_STRING		= "Lon(deg)";
+	ossimString HAE_STRING		= "HAE(m)";
+
+	// Deal with the fact that there are 3 different types of 'FrameMeta' file
+	if (framemeta_gsti.empty() && !framemeta.empty() && !frame_number.empty())
+	{
+		file_to_load.setFile(framemeta);
+		YAW_STRING	= "Azimuth(deg)";
+	}
+	else if (!framemeta_gsti.empty() && framemeta.empty() && !frame_number.empty())
+	{
+		file_to_load.setFile(framemeta_gsti);
+	}
+
+	if (file_to_load.exists() && !frame_number.empty())
+	{
+		ossimCsvFile csv(" \t"); // we will use tab or spaces as separator
+		if(csv.open(file_to_load))
+		{
+			if(csv.readHeader())
+			{
+				ossimCsvFile::StringListType heads = csv.fieldHeaderList();
+				// Try to see if you can find the first header item, if not, then you either have a file that doesn't work in this case, or it's uppercase
+				if (std::find(heads.begin(), heads.end(), FRAME_STRING) == heads.end())
+				{
+					FRAME_STRING	= FRAME_STRING.upcase();
+					ROLL_STRING		= ROLL_STRING.upcase();
+					PITCH_STRING	= PITCH_STRING.upcase();
+					YAW_STRING		= YAW_STRING.upcase();
+					LAT_STRING		= LAT_STRING.upcase();
+					LON_STRING		= LON_STRING.upcase();
+					HAE_STRING		= HAE_STRING.upcase();
+				}
+
+				ossimRefPtr<ossimCsvFile::Record> record;
+				bool foundFrameNumber = false;
+				while( ((record = csv.nextRecord()).valid()) && !foundFrameNumber)
+				{
+					if( (*record)[FRAME_STRING] == frame_number)
+					{
+						foundFrameNumber = true;
+						roll = (*record)[ROLL_STRING];
+						pitch = (*record)[PITCH_STRING];
+						yaw = (*record)[YAW_STRING];
+						platform_position = (*record)[LAT_STRING] + " " 
+							+ (*record)[LON_STRING]+ " "
+							+ (*record)[HAE_STRING] + " WGE";
+					}
+				}
+			}
+		}
+		csv.close();
+	}
+	else
+	{
+		roll = kwl.find(prefix, "roll"); 
+		pitch = kwl.find(prefix, "pitch"); 
+		yaw = kwl.find(prefix, "heading"); 
+		platform_position = kwl.find(prefix, "ecef_platform_position");
+	}
+
+	bool result = (!pixel_size.empty()&&
+		!principal_point.empty()&&
+		!focal_length.empty()&&
+		!platform_position.empty());
+
+	if(!focal_length.empty())
+	{
+		theFocalLength = focal_length.toDouble();
+	}
+	if(!pixel_size.empty())
+	{
+		thePixelSize.toPoint(pixel_size);
+	}
+	if(!roll.empty())
+	{
+		theRoll = roll.toDouble();
+	}
+	if(!pitch.empty())
+	{
+		thePitch = pitch.toDouble();
+	}
+	if(!yaw.empty())
+	{
+		theHeading   = yaw.toDouble();
+	}
+	if(!principal_point.empty())
+	{
+		thePrincipalPoint.toPoint(principal_point);
+	}
+	if(platform_position.contains("WGE"))
+	{
+		std::vector<ossimString> splitString;
+		ossimString tempString(platform_position);
+		tempString.split(splitString, ossimString(" "));
+		std::string datumString;
+		double lat=0.0, lon=0.0, h=0.0;
+		if(splitString.size() > 2)
+		{
+			lat = splitString[0].toDouble();
+			lon = splitString[1].toDouble();
+			h = splitString[2].toDouble();
+		}
+
+		theEcefPlatformPosition = ossimGpt(lat,lon,h);
+	} else {
+		std::vector<ossimString> splitString;
+		ossimString tempString(platform_position);
+		tempString.split(splitString, ossimString(" "));
+		std::string datumString;
+		double x=0.0, y=0.0, z=0.0;
+		if(splitString.size() > 2)
+		{
+			x = splitString[0].toDouble();
+			y = splitString[1].toDouble();
+			z = splitString[2].toDouble();
+		}
+		theEcefPlatformPosition = ossimEcefPoint(x, y, z);
+	}
+	theLensDistortion = 0;
+	if(!smac_radial.empty()&&
+		!smac_decent.empty())
+	{
+		std::vector<ossimString> radial;
+		std::vector<ossimString> decent;
+		smac_radial.split(radial, " ");
+		smac_decent.split(decent, " ");
+		if((radial.size() == 5)&&
+			(decent.size() == 4))
+		{
+			// Just for debugging really.. optimization will make this sleeker
+			double k0 = radial[0].toDouble();
+			double k1 = radial[1].toDouble();
+			double k2 = radial[2].toDouble();
+			double k3 = radial[3].toDouble();
+			double k4 = radial[4].toDouble();
+
+			double p0 = decent[0].toDouble();
+			double p1 = decent[1].toDouble();
+			double p2 = decent[2].toDouble();
+			double p3 = decent[3].toDouble();
+
+			theLensDistortion = new ossimSmacCallibrationSystem(k0,k1,k2,k3,k4,p0,p1,p2,p3);
+		}
+	}
+	theImageSize = ossimDpt(theImageClipRect.width(),
+		theImageClipRect.height());
+
+	updateModel();
+
+	if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimBuckeyeSensor::loadState: returning..." << std::endl;
+	return result;
+}
+
+bool ossimBuckeyeSensor::setupOptimizer(const ossimString& init_file)
+{
+	ossimKeywordlist kwl;
+	kwl.addFile(init_file.c_str());
+
+	return loadState(kwl);
+}
+
+void ossimBuckeyeSensor::setPrincipalPoint(ossimDpt principalPoint)
+{
+	thePrincipalPoint = principalPoint;
+}
+
+void ossimBuckeyeSensor::setRollPitchHeading(double roll,
+	double pitch,
+	double heading)
+{
+	theRoll    = roll;
+	thePitch   = pitch;
+	theHeading = heading;
+
+	updateModel();
+}
+
+void ossimBuckeyeSensor::setPixelSize(const ossimDpt& pixelSize)
+{
+	thePixelSize = pixelSize;
+}
+
+void ossimBuckeyeSensor::setImageRect(const ossimDrect& rect)
+{
+	theImageClipRect = rect;
+	theRefImgPt = rect.midPoint();
+}
+
+void ossimBuckeyeSensor::setFocalLength(double focalLength)
+{
+	theFocalLength = focalLength;
+}
+
+void ossimBuckeyeSensor::setPlatformPosition(const ossimGpt& gpt)
+{
+	theRefGndPt             = gpt;
+	theEcefPlatformPosition = gpt;
+	updateModel();
+
+}
+
+bool ossimBuckeyeSensor::getImageGeometry( 
+    const ossimString& ref, const ossimString& value, 
+    ossimKeywordlist& geomKwl ) const
+{
+   if ( ref == ossimString( "parameters/fsmmgSensorImage/collectionTime" ) )
+   {
+      /* not currently used */
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/sensorType" ) )
+   {
+      /* not currently used */
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/focus/focalLength" ) )
+   {
+      geomKwl.add( "focal_length", value.toDouble() );
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/numberOfRowsInImage" ) )
+   {
+      /* Add check to value already set from limits/GridEnvelope/low,high: should be equal */
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/numberOfColumnsInImage" ) )
+   {
+      /* Add check to value already set from limits/GridEnvelope/low,high: should be equal */
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/rowSpacing" ) )
+   {
+      ossimDpt point = ossimDpt();
+      ossimString pixel_size = geomKwl.find( "pixel_size" );
+      if ( !pixel_size.empty() )
+      {
+         point.toPoint( pixel_size );
+      }
+      point.y = value.toDouble();
+      geomKwl.add( "pixel_size", point.toString().c_str() );
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/pixelGridCharacteristics/columnSpacing" ) )
+   {
+      ossimDpt point = ossimDpt();
+      ossimString pixel_size = geomKwl.find( "pixel_size" );
+      if ( !pixel_size.empty() )
+      {
+         point.toPoint( pixel_size );
+      }
+      point.x = value.toDouble();
+      geomKwl.add( "pixel_size", point.toString().c_str() );
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorImage/positionOrientationState/perspectiveCenter/geocentric-x-y-z" ) )
+   {
+      // first remove trailing spaces
+      size_t first_space = value.find_first_of( ' ', 0 );
+      ossimString truncatedValue = value.beforePos( first_space );
+      // change commas into spaces
+      ossimString platformPositionStr = truncatedValue.substitute( ossimString( "," ), ossimString( " " ), true );
+      // add to keywordlist
+      geomKwl.add( "ecef_platform_position", platformPositionStr );
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorImage/velocity/components/geocentric-x-y-z" ) )
+   {
+      /* not currently used */
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/principalPointOffset/components/imagePlaneCRS-x0-y0" ) )
+   {
+      ossimDpt principal_point_offset;
+      size_t first_comma = value.find_first_of( ',', 0 );
+      ossimString offsetxStr = value.beforePos( first_comma );
+      ossimString offsetyStr = value.afterPos( first_comma );
+      principal_point_offset.x = offsetxStr.toDouble();
+      principal_point_offset.y = offsetyStr.toDouble();
+      geomKwl.add( "principal_point", principal_point_offset.toString().c_str() );
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/radialDistortion/coefficients/k0-k1-k2-k3-k4" ) )
+   {
+      // first remove trailing spaces
+      size_t first_space = value.find_first_of( ' ', 0 );
+      ossimString truncatedValue = value.beforePos( first_space );
+      // change commas into spaces
+      ossimString radialDistortionStr = truncatedValue.substitute( ossimString( "," ), ossimString( " " ), true );
+      // add to keywordlist
+      geomKwl.add( "smac_radial", radialDistortionStr );
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgSensorSession/decenteringDistortion/coefficients/p0-p1-p2-p3" ) )
+   {
+      // first remove trailing spaces
+      size_t first_space = value.find_first_of( ' ', 0 );
+      ossimString truncatedValue = value.beforePos( first_space );
+      // change commas into spaces
+      ossimString decenteringDistortionStr = truncatedValue.substitute( ossimString( "," ), ossimString( " " ), true );
+      // add to keywordlist
+      geomKwl.add( "smac_decent", decenteringDistortionStr );
+   }
+   else
+   if ( ref == ossimString( "parameters/fsmmgPlatformImage/positionOrientationState/externalOrientation/platformCS-roll-pitch-yaw" ) )
+   {
+      size_t pos_comma = value.find_first_of( ',', 0 );
+      ossimString rollStr = value.beforePos( pos_comma );
+      ossimString remainderStr0 = value.afterPos( pos_comma );
+
+      pos_comma = remainderStr0.find_first_of( ',', 0 );
+      ossimString pitchStr = remainderStr0.beforePos( pos_comma );
+      ossimString remainderStr1 = remainderStr0.afterPos( pos_comma );
+
+      pos_comma = remainderStr1.find_first_of( ',', 0 );
+      ossimString yawStr = remainderStr1.beforePos( pos_comma );
+
+      geomKwl.add( "roll",    rollStr.toDouble() );
+      geomKwl.add( "pitch",   pitchStr.toDouble() );
+      geomKwl.add( "heading", yawStr.toDouble() );
+   }
+   else // need to add in all supported parameters from the primary SensorML document
+   {
+      /* Add debug message */
+      return false;
+   }
+
+   return true;
+}
diff --git a/src/projection/ossimCadrgProjection.cpp b/src/projection/ossimCadrgProjection.cpp
new file mode 100644
index 0000000..b826403
--- /dev/null
+++ b/src/projection/ossimCadrgProjection.cpp
@@ -0,0 +1,424 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimCadrgProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+#include <ossim/projection/ossimCadrgProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimDatum.h>
+
+RTTI_DEF1(ossimCadrgProjection, "ossimCadrgProjection", ossimMapProjection)
+
+double ossimCadrgProjection::theOldZoneExtents[] = {0.0, 32.0, 48.0, 56.0, 64.0,
+                                                    68.0, 72.0, 76.0, 80.0, 90.0};
+double ossimCadrgProjection::theCadrgArcA[] = { 369664, 302592, 245760, 199168,
+					       163328, 137216, 110080, 82432 };
+
+double ossimCadrgProjection::theNorthLimit = 90.0*M_PI/180.0;
+double ossimCadrgProjection::theSouthLimit = -90.0*M_PI/180.0;
+
+ossimCadrgProjection::ossimCadrgProjection()
+   :ossimMapProjection(ossimEllipsoid(), ossimGpt()),
+    theCadrgZone(1),
+    theMapScale(5000000),
+    theWidth(0.0),
+    theHeight(0.0)
+{
+   computeParameters();
+}
+
+ossimCadrgProjection::~ossimCadrgProjection()
+{
+   
+}
+
+ossimObject *ossimCadrgProjection::dup()const
+{
+   return new ossimCadrgProjection(*this);
+}
+
+
+ossimDpt ossimCadrgProjection::worldToLineSample(const ossimGpt &worldPoint)    const
+{
+   ossimDpt lineSample;
+
+   worldToLineSample(worldPoint, lineSample);
+
+   return lineSample;
+}
+
+ossimGpt ossimCadrgProjection::inverse(const ossimDpt& /* eastingNorthing */)const
+{
+   double lat=0.0;
+   double lon=0.0;
+
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
+}
+
+ossimDpt ossimCadrgProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+   
+   return ossimDpt(easting, northing);
+}
+
+ossimGpt ossimCadrgProjection::lineSampleToWorld(const ossimDpt &projectedPoint)const
+{
+   ossimGpt worldPoint;
+
+   lineSampleToWorld(projectedPoint, worldPoint);
+
+   return worldPoint;
+}
+
+void ossimCadrgProjection::worldToLineSample(const ossimGpt &worldPoint,
+                                            ossimDpt&       lineSample)const
+{
+   double lat = worldPoint.latd();
+   double lon = worldPoint.lond();
+   double centerLat = theOrigin.latd();
+   double centerLon = theOrigin.lond()*DEG_PER_RAD;
+   
+   lineSample.y = (centerLat - lat)/90.0*thePixelConstant.y;
+   lineSample.x = (lon - centerLon)/360.0*thePixelConstant.x;
+
+   lineSample = lineSample - theUlLineSample;
+}
+
+void ossimCadrgProjection::lineSampleToWorld(const ossimDpt &projectedPoint,
+                                            ossimGpt& gpt)const
+{
+   gpt = theOrigin;
+
+
+   ossimDpt adjustedPixel(projectedPoint.x + theUlLineSample.x,
+                          projectedPoint.y + theUlLineSample.y);
+
+//   double lat = gpt.latd() - (90/thePixelConstant.y)*adjustedPixel.y;
+//   double lon = gpt.lond() + (360/thePixelConstant.x)*adjustedPixel.x;
+   double lat = gpt.latd() - (90/thePixelConstant.y)*adjustedPixel.y;
+   double lon = gpt.lond() + (360/thePixelConstant.x)*adjustedPixel.x;
+   
+   gpt.latd(lat);
+   gpt.lond(lon);
+
+   gpt.clampLat(-90, 90);
+   gpt.clampLon(-180, 180);
+}
+
+double ossimCadrgProjection::computeXPixConstant(double scale,
+                                                 long zone)const
+{
+   double adrgscale = 1000000/scale;
+   
+   // E-W pixel constant
+   double x_pix = (double) adrgscale*theCadrgArcA[zone-1] / 512.0;
+   
+   // Increase, if necessary, to the next highest integer value
+   x_pix = ceil(x_pix);
+   x_pix = x_pix * 1.33333;//(512*100)/(150*256);
+   
+   // Round the final result.
+   x_pix = ossim::round<int>(x_pix);
+   
+   return x_pix*256.0;
+   
+}
+
+double ossimCadrgProjection::computeYPixConstant(double scale)const
+{
+   double adrgscale = 1000000/scale;
+   const long CADRG_ARC_B = 400384;
+   
+   double y_pix = (double) adrgscale * CADRG_ARC_B / 512.0;
+   
+   // Increase, if necessary, to the next highest integer value
+   y_pix = ceil(y_pix);
+
+   y_pix = y_pix * 0.33333;//(512*100)/(4*150*256);
+   
+   // Round the final result.
+   y_pix = ossim::round<int>(y_pix);
+   
+   return y_pix*256.0;
+}
+
+void ossimCadrgProjection::computeParameters()
+{
+   theUlLineSample = ossimDpt(0,0);
+
+   thePixelConstant.y = computeYPixConstant(theMapScale);
+   thePixelConstant.x = computeXPixConstant(theMapScale,
+                                            theCadrgZone);
+   double height = theHeight;
+   double width  = theWidth;
+   
+   if(width > thePixelConstant.x)
+   {
+      width  = thePixelConstant.x;
+   }
+   
+   if(height > thePixelConstant.y)
+   {
+      height = thePixelConstant.y;
+   }
+
+
+   theUlLineSample.x = -width/2.0;
+   theUlLineSample.y = -height/2.0;
+}
+
+bool ossimCadrgProjection::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix)const
+{
+   bool result = ossimProjection::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           ossimKeywordNames::ZONE_KW,
+           theCadrgZone,
+           true);
+   
+   kwl.add(prefix,
+           "map_scale",
+           theMapScale,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_LINES_KW,
+           theHeight,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_SAMPLES_KW,
+           theWidth,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::UL_LAT_KW,
+           theUlGpt.latd(),
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::UL_LON_KW,
+           theUlGpt.lond(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::LL_LAT_KW,
+           theLlGpt.latd(),
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::LL_LON_KW,
+           theLlGpt.lond(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::LR_LAT_KW,
+           theLrGpt.latd(),
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::LR_LON_KW,
+           theLrGpt.lond(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::UR_LAT_KW,
+           theUrGpt.latd(),
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::UR_LON_KW,
+           theUrGpt.lond(),
+           true);
+
+  
+   
+   if(theDatum)
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::DATUM_KW,
+              theDatum->code(),
+              true);
+   }
+
+   return result;
+}
+
+
+bool ossimCadrgProjection::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   ossimProjection::loadState(kwl, prefix);
+
+   
+   const char* lookup = kwl.find(prefix, ossimKeywordNames::UL_LAT_KW);
+   if(lookup)
+   {
+      theUlGpt.latd(ossimString(lookup).toDouble());
+   }
+   else
+    {
+       theUlGpt.latd(90.0);
+    }
+
+    lookup = kwl.find(prefix, ossimKeywordNames::UL_LON_KW);
+    if(lookup)
+    {
+       theUlGpt.lond(ossimString(lookup).toDouble());
+    }
+    else
+    {
+       theUlGpt.lond(-180.0);
+    }
+
+    lookup = kwl.find(prefix, ossimKeywordNames::LL_LAT_KW);
+    if(lookup)
+    {
+       theLlGpt.latd(ossimString(lookup).toDouble());
+    }
+    else
+    {
+       theLlGpt.latd(0.0);
+    }
+
+    lookup = kwl.find(prefix, ossimKeywordNames::LL_LON_KW);
+    if(lookup)
+    {
+       theLlGpt.lond(ossimString(lookup).toDouble());
+    }
+   else
+   {
+      theLlGpt.lond(-180.0);
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::LR_LAT_KW);
+   if(lookup)
+   {
+      theLrGpt.latd(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      theLrGpt.latd(0.0);
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::LR_LON_KW);
+   if(lookup)
+   {
+      theLrGpt.lond(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      theLrGpt.lond(180.0);
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::LR_LAT_KW);
+   if(lookup)
+   {
+      theLrGpt.latd(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      theLrGpt.latd(0.0);
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::LR_LON_KW);
+   if(lookup)
+   {
+      theLrGpt.lond(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      theLrGpt.lond(180.0);
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::UR_LAT_KW);
+   if(lookup)
+   {
+      theUrGpt.latd(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      theUrGpt.latd(90.0);
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::UR_LON_KW);
+   if(lookup)
+   {
+      theUrGpt.lond(ossimString(lookup).toDouble());
+   }
+   else
+   {
+      theUrGpt.lond(180.0);
+   }
+
+   const char* zone = kwl.find(prefix,
+                               ossimKeywordNames::ZONE_KW);
+   if(zone)
+   {
+      theCadrgZone = ossimString(zone).toLong();
+   }
+   const char* mapScale = kwl.find(prefix,
+                                   "map_scale");
+   if(mapScale)
+   {
+      theMapScale = ossimString(mapScale).toDouble();
+   }
+   const char *height = kwl.find(prefix,
+                                 ossimKeywordNames::NUMBER_LINES_KW);
+   const char *width  = kwl.find(prefix,
+                                 ossimKeywordNames::NUMBER_SAMPLES_KW);
+   if(height)
+   {
+      theHeight = ossimString(height).toDouble();
+   }
+   
+   if(width)
+   {
+      theWidth  = ossimString(width).toDouble();
+   }
+
+   computeParameters();
+
+   return true;
+}
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimCadrgProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimCadrgProjection* p = dynamic_cast<const ossimCadrgProjection*>(&proj);
+   if (!p) return false;
+
+   if (theUlGpt != p->theUlGpt) return false;
+   if (theLlGpt != p->theLlGpt) return false;
+   if (theLrGpt != p->theLrGpt) return false;
+   if (theUrGpt != p->theUrGpt) return false;
+   if (!ossim::almostEqual(theWidth,p->theWidth)) return false;
+   if (!ossim::almostEqual(theHeight,p->theHeight)) return false;
+   if (theCadrgZone != p->theCadrgZone) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimCassiniProjection.cpp b/src/projection/ossimCassiniProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimCassiniProjection.cpp
rename to src/projection/ossimCassiniProjection.cpp
diff --git a/src/projection/ossimCoarseGridModel.cpp b/src/projection/ossimCoarseGridModel.cpp
new file mode 100644
index 0000000..00a0b98
--- /dev/null
+++ b/src/projection/ossimCoarseGridModel.cpp
@@ -0,0 +1,1059 @@
+//*****************************************************************************
+// FILE: ossimCoarseGridModel.cc
+//
+// License:  See LICENSE.txt file in the top level directory.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimCoarseGridModel. This is an
+//   implementation of an interpolation sensor model. 
+//
+//   IMPORTANT: The lat/lon grid is for ground points on the ellipsoid.
+//   The dLat/dHgt and dLon/dHgt partials therefore are used against
+//   elevations relative to the ellipsoid.
+//
+//*****************************************************************************
+//  $Id: ossimCoarseGridModel.cpp 22825 2014-07-07 23:14:52Z dburken $
+
+#include <ossim/projection/ossimCoarseGridModel.h>
+
+RTTI_DEF1(ossimCoarseGridModel, "ossimCoarseGridModel", ossimSensorModel);
+
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/support_data/ossimSupportFilesList.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <cstdio>
+#include <fstream>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceExec  ("ossimCoarseGridModel:exec");
+static ossimTrace traceDebug ("ossimCoarseGridModel:debug");
+
+static const char* MODEL_TYPE = "ossimCoarseGridModel";
+static const char* GRID_FILE_NAME_KW = "grid_file_name";
+static const char* CROSSES_DATELINE_KW = "crosses_dateline";
+
+const ossimFilename DEFAULT_GEOM_FILE_EXT ("geom");
+const ossimFilename DEFAULT_GRID_FILE_EXT ("ocg");
+double ossimCoarseGridModel::theInterpolationError = .1;
+ossim_int32 ossimCoarseGridModel::theMinGridSpacing     = 100;
+
+//*****************************************************************************
+//  DEFAULT CONSTRUCTOR: ossimCoarseGridModel()
+//  
+//*****************************************************************************
+ossimCoarseGridModel::ossimCoarseGridModel()
+   :
+      ossimSensorModel(),
+      theDlatDparamGrid (0),
+      theDlonDparamGrid (0),
+      theHeightEnabledFlag(true)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel: entering..."
+      << std::endl;
+
+   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
+   theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
+   theLatGrid.enableExtrapolation();
+   theLonGrid.enableExtrapolation();
+
+   setErrorStatus();
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel: returning..."
+      << std::endl;
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: ossimCoarseGridModel(ossimCoarseGridModel)
+//  
+//*****************************************************************************
+ossimCoarseGridModel::ossimCoarseGridModel(const ossimCoarseGridModel& model)
+   :
+      ossimSensorModel  (model),
+      theGridFilename   (model.theGridFilename),
+      theLatGrid        (model.theLatGrid),
+      theLonGrid        (model.theLonGrid),
+      theDlatDhGrid     (model.theDlatDhGrid),
+      theDlonDhGrid     (model.theDlonDhGrid),
+      theDlatDparamGrid (0),
+      theDlonDparamGrid (0),
+      theHeightEnabledFlag(true)
+{
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(model): entering..."
+      << std::endl;
+
+   int numberOfParams = getNumberOfAdjustableParameters();
+   if(numberOfParams)
+   {
+      //***
+      // Allocate adjustable parameter partials grids then assign:
+      //***
+      theDlatDparamGrid = new ossimDblGrid [numberOfParams];
+      theDlonDparamGrid = new ossimDblGrid [numberOfParams];
+      
+      for (int i=0; i<numberOfParams; i++)
+      {
+         theDlatDparamGrid[i] = model.theDlatDparamGrid[i];
+         theDlonDparamGrid[i] = model.theDlonDparamGrid[i];
+      }
+   }
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel: returning..."
+      << std::endl;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimCoarseGridModel(filename)
+//  
+//  Constructs model from geometry file
+//  
+//*****************************************************************************
+ossimCoarseGridModel::ossimCoarseGridModel(const ossimFilename& geom_file)
+   :
+      ossimSensorModel(),
+      theDlatDparamGrid (0),
+      theDlonDparamGrid (0),
+      theHeightEnabledFlag(true)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(geom_file): entering..." << std::endl;
+   
+   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
+   theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
+   theLatGrid.enableExtrapolation();
+   theLonGrid.enableExtrapolation();
+
+   ossimKeywordlist kwl;
+   if(geom_file.exists()&&kwl.addFile(geom_file))
+   {
+      loadState(kwl);
+   }
+   else
+   {
+      ++theErrorStatus;
+   }
+
+   if (traceExec())   ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(geom_file): returning..." << std::endl;
+   return;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimCoarseGridModel(kwl)
+//  
+//  Constructs model from keywordlist geometry file
+//  
+//*****************************************************************************
+ossimCoarseGridModel::ossimCoarseGridModel(const ossimKeywordlist& geom_kwl)
+   :
+      ossimSensorModel(),
+      theDlatDparamGrid (0),
+      theDlonDparamGrid (0),
+      theHeightEnabledFlag(true)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::ossimCoarseGridModel(geom_kwl): entering..." << std::endl;
+
+   theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
+   theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
+   theLatGrid.enableExtrapolation();
+   theLonGrid.enableExtrapolation();
+
+  // Parse keywordlist for geometry:
+   loadState(geom_kwl);
+}
+
+//*************************************************************************************************
+//! Assigns the grid data given a projection (typically a rigorous sensor model)
+//*************************************************************************************************
+void ossimCoarseGridModel::buildGrid(const ossimDrect& imageBounds,
+                                     ossimProjection* proj,
+                                     double heightDelta,
+                                     bool enableHeightFlag,
+                                     bool makeAdjustableFlag)
+{
+   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
+   geom->setProjection(proj);
+   buildGrid(imageBounds, geom.get(), heightDelta, enableHeightFlag, makeAdjustableFlag);
+}  
+
+
+//*************************************************************************************************
+//! Assigns the grid data given a geometry
+//*************************************************************************************************
+void ossimCoarseGridModel::buildGrid(const ossimDrect& imageBounds,
+                                     ossimImageGeometry* geom,
+                                     double heightDelta,
+                                     bool enableHeightFlag,
+                                     bool makeAdjustableFlag)
+{
+   theHeightEnabledFlag =  enableHeightFlag;
+   
+   if (!geom->getProjection() || imageBounds.hasNans())
+      return;
+
+   // don't let it get any smaller than 100, 100 pixels
+   // on the input projector
+   //
+   // may want this to be adjusted by outside
+   //
+   const ossimDatum* targetDatum = ossimDatumFactory::instance()->wgs84();
+   ossimIpt gridSize(2,2);
+   ossimDpt gridOrigin(0,0);
+   ossimGpt gpt;
+   ossimGpt gpt2;
+   ossimGpt bilinearGpt;
+   resizeAdjustableParameterArray(0);
+   double normSplit = 1.0;
+   ossimIpt imageSize = ossimIpt(imageBounds.width(), imageBounds.height());
+   double error = 0.0;
+
+   ossimIpt imageOrigin = imageBounds.ul();
+   ossimDpt spacing ((double)(imageBounds.width()-1)/(gridSize.x-1),
+      (double)(imageBounds.height()-1)/(gridSize.y-1));
+
+   if(theDlatDparamGrid)
+   {
+      delete [] theDlatDparamGrid;
+      theDlatDparamGrid = NULL;
+   }
+   if(theDlonDparamGrid)
+   {
+      delete [] theDlonDparamGrid;
+      theDlonDparamGrid = NULL;
+   }
+
+   geom->localToWorld(imageBounds.midPoint(), gpt);
+
+   do
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "Checking grid size " << gridSize << std::endl;
+      }
+
+      spacing = ossimDpt((double)(imageBounds.width()-1)/(gridSize.x-1),
+         (double)(imageBounds.height()-1)/(gridSize.y-1));
+
+      theLatGrid.setNullValue(ossim::nan());
+      theLonGrid.setNullValue(ossim::nan());
+      theDlatDhGrid.setNullValue(0.0);
+      theDlonDhGrid.setNullValue(0.0);
+      theLatGrid.setDomainType(ossimDblGrid::SAWTOOTH_90);
+      theLonGrid.setDomainType(ossimDblGrid::WRAP_180);
+      theLatGrid.initialize(gridSize, gridOrigin, spacing);
+      theLonGrid.initialize(gridSize, gridOrigin, spacing);
+      theDlatDhGrid.initialize(gridSize, gridOrigin, spacing);
+      theDlonDhGrid.initialize(gridSize, gridOrigin, spacing);
+      ossim_int32 x, y;
+
+      for(y = 0; y < gridSize.y; ++y)
+      {
+         for(x = 0; x < gridSize.x; ++x)
+         {
+            ossimDpt norm((double)x/(double)(gridSize.x-1),
+               (double)y/(double)(gridSize.y-1));
+
+            ossimDpt pt(imageOrigin.x + norm.x*(imageSize.x-1),
+               imageOrigin.y + norm.y*(imageSize.y-1));
+
+            geom->localToWorld(pt, gpt);
+            double h = gpt.height();
+            if(ossim::isnan(h))
+            {
+               h += heightDelta;
+            }
+            ossimDpt fullPt;
+            geom->rnToFull(pt, 0, fullPt);
+            geom->getProjection()->lineSampleHeightToWorld(fullPt, h, gpt2);
+            gpt.changeDatum(targetDatum);
+            gpt2.changeDatum(targetDatum);
+
+            theLatGrid.setNode(x, y, gpt.latd());
+            theLonGrid.setNode(x, y, gpt.lond());
+
+            theDlatDhGrid.setNode(x, y, (gpt2.latd() - gpt.latd())/heightDelta);
+            theDlonDhGrid.setNode(x, y, (gpt2.lond() - gpt.lond())/heightDelta);
+         }
+      }
+      ossim_int32 upperY = 2*gridSize.y;
+      ossim_int32 upperX = 2*gridSize.x;
+      error = 0.0;
+
+      // Set all base-class data members needed for subsequent calls to projection code:
+      initializeModelParams(imageBounds);
+
+      for(y = 0; ((y < upperY)&&(error < theInterpolationError)); ++y)
+      {
+         for(x = 0; ((x < upperX)&&(error<theInterpolationError)); ++x)
+         {
+            ossimDpt norm((double)x/(double)(upperX-1),
+               (double)y/(double)(upperY-1));
+
+            ossimDpt imagePoint(imageOrigin.x + norm.x*(imageSize.x-1),
+               imageOrigin.y + norm.y*(imageSize.y-1));
+            ossimDpt testIpt;
+
+            geom->localToWorld(imagePoint, gpt);
+            worldToLineSample(gpt, testIpt);
+            error = (testIpt-imagePoint).length();
+         }
+      }
+
+      gridSize.x *= 2;
+      gridSize.y *= 2;
+      normSplit *= .5;
+   } while((error > theInterpolationError) &&
+           ((imageSize.x*normSplit) > theMinGridSpacing) &&
+           ((imageSize.y*normSplit) > theMinGridSpacing));
+
+   gridSize = theLatGrid.size();
+
+   ossimAdjustableParameterInterface* adjustableParameters = 
+      PTR_CAST(ossimAdjustableParameterInterface, geom->getProjection());
+   removeAllAdjustments();
+   if(adjustableParameters&&makeAdjustableFlag)
+   {
+      if(adjustableParameters->getNumberOfAdjustableParameters() > 0)
+      {
+         newAdjustment(adjustableParameters->getNumberOfAdjustableParameters());
+
+         int numberOfParams = getNumberOfAdjustableParameters();
+         if(numberOfParams)
+         {
+            //***
+            // Allocate adjustable parameter partials grids then assign:
+            //***
+            theDlatDparamGrid = new ossimDblGrid [numberOfParams];
+            theDlonDparamGrid = new ossimDblGrid [numberOfParams];
+            for(int paramIdx = 0; paramIdx < numberOfParams; ++ paramIdx)
+            {
+               theDlonDparamGrid[paramIdx].setNullValue(0.0);
+               theDlatDparamGrid[paramIdx].setNullValue(0.0);
+               theDlatDparamGrid[paramIdx].initialize(gridSize, gridOrigin, spacing);
+               theDlonDparamGrid[paramIdx].initialize(gridSize, gridOrigin, spacing);
+               setAdjustableParameter(paramIdx, 0.0);
+               setParameterSigma(paramIdx, adjustableParameters->getParameterSigma(paramIdx));
+               setParameterUnit(paramIdx, adjustableParameters->getParameterUnit(paramIdx));
+               setParameterCenter(paramIdx, 0.0);
+               setParameterDescription(paramIdx,
+                  adjustableParameters->getParameterDescription(paramIdx));
+
+               double oldParameter = adjustableParameters->getAdjustableParameter(paramIdx);
+               adjustableParameters->setAdjustableParameter(paramIdx, 1.0, true);
+               double adjust = adjustableParameters->computeParameterOffset(paramIdx);
+               double deltaLat = 0;
+               double deltaLon = 0;
+               if(adjust != 0.0)
+               {
+                  for(int y = 0; y < gridSize.y; ++y)
+                  {
+                     for(int x = 0; x < gridSize.x; ++x)
+                     {
+                        ossimDpt norm((double)x/(double)(gridSize.x-1),
+                           (double)y/(double)(gridSize.y-1));
+
+                        ossimDpt pt(imageOrigin.x + norm.x*(imageSize.x-1),
+                           imageOrigin.y + norm.y*(imageSize.y-1));
+                        geom->localToWorld(pt, gpt);
+
+                        gpt.changeDatum(targetDatum);
+                        gpt2.latd(theLatGrid(pt));
+                        gpt2.lond(theLonGrid(pt));
+                        deltaLat = gpt.latd()-gpt2.latd();
+                        deltaLon = gpt.lond()-gpt2.lond();
+
+                        theDlatDparamGrid[paramIdx].setNode(x, y, deltaLat/adjust);
+                        theDlonDparamGrid[paramIdx].setNode(x, y, deltaLon/adjust);
+                     }
+                  }
+
+                  // The partials grids for this parameter are initialized, now initialize the
+                  // grid's extrapolator:
+                  theDlatDparamGrid[paramIdx].enableExtrapolation();
+                  theDlonDparamGrid[paramIdx].enableExtrapolation();
+               }
+               adjustableParameters->setAdjustableParameter(paramIdx, oldParameter, true);
+            }
+         }
+      }
+   }
+   getAdjustment(theInitialAdjustment);
+
+
+}
+
+void ossimCoarseGridModel::setInterpolationError(double error)
+{
+   theInterpolationError = error;
+}
+
+void ossimCoarseGridModel::setMinGridSpacing(ossim_int32 minSpacing)
+{
+   theMinGridSpacing = minSpacing;
+}
+
+//*************************************************************************************************
+//! Initializes base class data members after grids have been assigned.
+//! It is assumed that theImageSize and the origin image point were already set.
+//*************************************************************************************************
+void ossimCoarseGridModel::initializeModelParams(ossimIrect imageBounds)
+{
+   // NOTE: it is assumed that the grid size and spacing is the same for ALL grids:
+   ossimIpt gridSize (theLatGrid.size());
+   ossimDpt spacing  (theLatGrid.spacing());
+   ossimDpt v[4];
+   v[0].lat = theLatGrid.getNode(0,0);
+   v[0].lon = theLonGrid.getNode(0,0);
+   v[1].lat = theLatGrid.getNode(gridSize.x-1, 0);
+   v[1].lon = theLonGrid.getNode(gridSize.x-1, 0);
+   v[2].lat = theLatGrid.getNode(gridSize.x-1, gridSize.y-2);
+   v[2].lon = theLonGrid.getNode(gridSize.x-1, gridSize.y-2);
+   v[3].lat = theLatGrid.getNode(0, gridSize.y-2);
+   v[3].lon = theLonGrid.getNode(0, gridSize.y-2);
+
+   // Guaranty longitude values are -180 to 180
+   for (int i=0; i<4; i++)
+   {
+      if (v[i].lon > 180.0)
+         v[i].lon -= 360.0;
+   }
+
+   theBoundGndPolygon = ossimPolygon(4, v);
+   
+   theImageSize  = ossimDpt(imageBounds.width(), imageBounds.height());
+   theRefImgPt   = imageBounds.midPoint();
+   theRefGndPt.lat = theLatGrid(theRefImgPt);
+   theRefGndPt.lon = theLonGrid(theRefImgPt);
+   
+   ossimDpt ref_ip_dx (theRefImgPt.x+1.0, theRefImgPt.y    );
+   ossimDpt ref_ip_dy (theRefImgPt.x    , theRefImgPt.y+1.0);
+   ossimGpt ref_gp_dx (theLatGrid(ref_ip_dx), theLonGrid(ref_ip_dx));
+   ossimGpt ref_gp_dy (theLatGrid(ref_ip_dy), theLonGrid(ref_ip_dy));
+
+   theGSD.x   = theRefGndPt.distanceTo(ref_gp_dx);
+   theGSD.y   = theRefGndPt.distanceTo(ref_gp_dy);
+
+   theMeanGSD = (theGSD.line + theGSD.samp)/2.0;
+   theImageClipRect  = imageBounds;
+   theSubImageOffset = imageBounds.ul();
+}
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimCoarseGridModel()
+//  
+//*****************************************************************************
+ossimCoarseGridModel::~ossimCoarseGridModel()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimCoarseGridModel::~ossimCoarseGridModel: entering..."
+      << std::endl;
+
+   if(theDlatDparamGrid&&theDlonDparamGrid)
+   {
+      //***
+      // Deallocate memory:
+      //***
+      delete [] theDlatDparamGrid;
+      delete [] theDlonDparamGrid;
+      theDlatDparamGrid = NULL;
+      theDlonDparamGrid = NULL;
+   }
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimCoarseGridModel::~ossimCoarseGridModel: returning..."
+      << std::endl;
+}
+
+//*************************************************************************************************
+// METHOD
+//*************************************************************************************************
+void ossimCoarseGridModel::lineSampleToWorld(const ossimDpt& image_point,
+                                             ossimGpt&       gpt) const
+{
+   if(!theHeightEnabledFlag)
+   {
+      //
+      // Extrapolate if image point is outside image:
+      //
+      if (!insideImage(image_point))
+      {
+         gpt = extrapolate(image_point);
+         return;
+      }
+      
+      lineSampleHeightToWorld(image_point, 0.0, gpt);
+   }
+   else
+   {
+      ossimSensorModel::lineSampleToWorld(image_point, gpt);
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimCoarseGridModel::lineSampleHeightToWorld()
+//  
+//  Establishes the ground point corresponding to the input image_point and
+//  specified elevation above MSL
+//
+//*****************************************************************************
+void
+ossimCoarseGridModel::lineSampleHeightToWorld(const ossimDpt& lineSampPt,
+                                              const double&   arg_hgt_above_ellipsoid,
+                                              ossimGpt&       worldPt) const
+{
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::lineSampleHeightToWorld: entering..." << std::endl;
+   
+   if(theLatGrid.size().x < 1 ||
+      theLatGrid.size().y < 1)
+   {
+      worldPt.makeNan();
+      return;
+   }
+
+   double height = (ossim::isnan(arg_hgt_above_ellipsoid)) ? 0.0 : arg_hgt_above_ellipsoid;
+
+   // Note that there is no check for image point outside of valid image rect because this model
+   // uses the extrapolation inherent to the ossimDblGrid.
+
+   // The image point may correspond to an offset sub-image. Need to convert
+   // to full image space before anything:
+   ossimDpt ip = lineSampPt + theSubImageOffset;
+   
+   // Establish the interpolated values from the grids:
+   worldPt.lat = theLatGrid(ip);
+   worldPt.lon = theLonGrid(ip);
+   worldPt.hgt = height;
+
+   if(theHeightEnabledFlag)
+   {
+      // Adjust horizontally due to elevation:
+      worldPt.lat += theDlatDhGrid(ip)*height;
+      worldPt.lon += theDlonDhGrid(ip)*height;
+   }
+   int numberOfParams = getNumberOfAdjustableParameters();
+ 
+   // Now add increments due to adjustable parameter deltas:
+   for (int p=0; p<numberOfParams; p++)
+   {
+       worldPt.lat += (theDlatDparamGrid[p](ip) * computeParameterOffset(p));
+       worldPt.lon += (theDlonDparamGrid[p](ip) * computeParameterOffset(p));
+   }
+
+   worldPt.limitLonTo180();
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::lineSampleHeightToWorld: returning..." << std::endl;
+}
+
+//*************************************************************************************************
+// METHOD
+//*************************************************************************************************
+void ossimCoarseGridModel::initAdjustableParameters()
+{
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+      addAdjustment(theInitialAdjustment, true);
+   }
+   else
+   {
+      setAdjustment(theInitialAdjustment, true);
+   }
+}
+
+//*************************************************************************************************
+// METHOD
+//*************************************************************************************************
+void ossimCoarseGridModel::imagingRay(const ossimDpt& image_point,
+                                      ossimEcefRay&   image_ray) const
+{
+   ossimSensorModel::imagingRay(image_point, image_ray);
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimCoarseGridModel::print()
+//  
+//  Formatted dump of data members.
+//  
+//*****************************************************************************
+std::ostream& ossimCoarseGridModel::print(std::ostream& out) const 
+{
+   out << "\nDump of ossimCoarseGridModel object at: " << this << "\n"
+       << "\n           Grid File Name: " << theGridFilename 
+       << "\n                 Image ID: " << theImageID 
+       << "\n                   Sensor: " << theSensorID
+       << "\n  Image Size (rows, cols): " << theImageSize
+       << "\n      Ref Pt (samp, line): " << theRefImgPt 
+       << "\n   Ref Pt (lat, lon, hgt): " << theRefGndPt 
+       << "\n           GSD (row, col): " << theGSD 
+       << "\n  Bounding Ground Polygon: " << theBoundGndPolygon << endl;
+//      << "\n         Number of Params: " << theNumParams << "\n"<<endl;
+   
+   char buf[256];
+   ossimIpt size (theLatGrid.size());
+   ossimDpt spacing (theLatGrid.spacing());
+   int line, samp;
+   ossimIpt node;
+   
+   out << "[ line,  samp]        lat        lon         dLat/dH      dLon/dH\n"
+       << "-------------------------------------------------------------------"
+       <<endl;
+
+   for (node.y=0; node.y<size.y; node.y++)
+   {
+      line = (int) (node.y*spacing.y);
+      
+      for (node.x=0; node.x<size.x; node.x++)
+      {
+         samp = (int) (node.x*spacing.x);
+         
+         sprintf(buf, "[%5d, %5d]    %+9.5f  %+10.5f    %+11.4e  %+11.4e",
+                  line, samp,
+                  theLatGrid.getNode(node),
+                  theLonGrid.getNode(node),
+                  theDlatDhGrid.getNode(node),
+                  theDlonDhGrid.getNode(node));
+         out << buf << endl;
+      }
+      out <<"-----------------------------------------------------------------"
+          <<endl;
+   }
+
+   out << "\n\nDump of lat/lon Partials w.r.t. Adjustable Parameters:"<<endl;
+   out << "\nEnd Dump of ossimCoarseGridModel.\n" <<  endl;
+   return out;
+}
+
+//*****************************************************************************
+//  METHOD: ossimCoarseGridModel::saveState()
+//  
+//  Saves the model state to the KWL. This KWL also serves as a geometry file.
+//
+//  Returns true if successful.
+//  
+//*****************************************************************************
+bool ossimCoarseGridModel::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveState: entering..." << std::endl;
+
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimCoarseGridModel");
+
+   //---
+   // Save just the file part so that the geometry stuff is relocatable.
+   // Code was added to ossimProjectionFactoryBase::createProjectionFromGeometryFile
+   // to handle this.
+   //---
+   kwl.add( prefix, GRID_FILE_NAME_KW, theGridFilename.file() );
+   
+   kwl.add(prefix, "height_enabled_flag", theHeightEnabledFlag, true);
+   ossimSensorModel::saveState(kwl, prefix);
+   ossimString initAdjPrefix = ossimString(prefix) + "init_adjustment.";
+   theInitialAdjustment.saveState(kwl, initAdjPrefix);
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveState: returning..." << std::endl;
+
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimCoarseGridModel::loadState()
+//  
+//  Restores the model's state from the KWL. This KWL also serves as a
+//  geometry file.
+//
+//  Returns true if successful.
+//  
+//*****************************************************************************
+bool ossimCoarseGridModel::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix) 
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: entering..." << std::endl;
+
+   clearErrorStatus();
+   const char* value;
+   bool success;
+   
+   //***
+   // Assure this keywordlist contains correct type info:
+   //***
+   value = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if (!value || (strcmp(value, "ossimCoarseGridModel")))
+   {
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState:  returning..." << std::endl;
+      theErrorStatus++;
+      return false;
+   }
+   value = kwl.find(prefix, "height_enabled_flag");
+   if(value)
+   {
+      theHeightEnabledFlag = ossimString(value).toBool();
+   }
+
+   //***
+   // Pass on to the base-class for parsing first:
+   //***
+   success = ossimSensorModel::loadState(kwl, prefix);
+   if (!success)
+   {
+      theErrorStatus++;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: returning with error..." << std::endl;
+      return false;
+   }
+
+   //***
+   // Look for geom filename or explicit grid filename to establish path to grid:
+   //***
+   theGridFilename = kwl.find(prefix, GRID_FILE_NAME_KW);
+
+   if (!theGridFilename.isReadable())
+   {
+      //---
+      // This is set in ossimProjectionFactoryBase::createProjectionFromGeometryFile
+      // so we can derive the dot.ocg from it.
+      //---
+      ossimFilename alt_path_to_grid = kwl.find("kwl_source");
+      theGridFilename = alt_path_to_grid.setExtension(DEFAULT_GRID_FILE_EXT);
+      
+      if (!theGridFilename.isReadable())
+      {
+         ossimFilename alt_path_to_grid = kwl.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
+         theGridFilename = alt_path_to_grid.setExtension(DEFAULT_GRID_FILE_EXT);
+      }
+   }
+   
+   if (!theGridFilename.isReadable())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "ossimCoarseGridModel::loadState() -- Error "
+         "encountered opening coarse grid file at "<< "<" <<theGridFilename << ">." << std::endl;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: returning with error..." << std::endl;
+      theErrorStatus++;
+      return false;
+   }
+
+   // Load the coarse grid file specified in KWL. This method resets the
+   // theErrorStatus to OSSIM_OK if successful:
+   if (!loadCoarseGrid(theGridFilename))
+   {
+      theErrorStatus++;
+      return false;
+   }
+
+   // crossesDateline legacy. No longer saved.
+   bool crossesDateline = false;
+   kwl.getBoolKeywordValue(crossesDateline, CROSSES_DATELINE_KW, prefix);
+   if (crossesDateline)
+      theLonGrid.setDomainType(ossimDblGrid::WRAP_360);
+
+   // Add the coarse grid filename to list of support files being referenced for logging purposes:
+   ossimSupportFilesList::instance()->add(theGridFilename.expand());
+
+   ossimString initAdjPrefix = ossimString(prefix) + "init_adjustment.";
+   theInitialAdjustment.loadState(kwl, initAdjPrefix.c_str());
+
+   if((ossim::isnan(theRefGndPt.hgt)) ||
+      (theRefGndPt.hgt == 0))
+   {
+      theRefGndPt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(theRefGndPt);
+      if(theRefGndPt.hgt < 0)
+      {
+         theRefGndPt.hgt = fabs(theRefGndPt.hgt);
+      }
+   }
+      
+   if(theInitialAdjustment.getNumberOfAdjustableParameters() < 1)
+   {
+      getAdjustment(theInitialAdjustment);
+   }
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadState: returning..." << std::endl;
+   if (theErrorStatus)
+      return false;
+   
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimCoarseGridModel::saveCoarseGrid(cgFileName)
+//  
+//  Saves the coarse grid to disk file.
+//
+//  Returns true if successful.
+//  
+//*****************************************************************************
+bool ossimCoarseGridModel::saveCoarseGrid(const ossimFilename& fileName)const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: entering..." << std::endl;
+
+   // Create and open grid file as stream:
+   theGridFilename = fileName.expand();
+   theGridFilename.setExtension(DEFAULT_GRID_FILE_EXT);
+   ofstream outstream (theGridFilename.chars());
+   if (!outstream.is_open())
+   {
+      theErrorStatus++;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: Error "
+         "encountered creating coarse grid file <" << theGridFilename<< ">. Check that directory "
+         "exists and is writable." << std::endl;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: returning with error..." << std::endl;
+      return false;
+   }
+
+   // Let each grid object write itself to the output file:
+   theLatGrid.save(outstream, "Latitude Grid");
+   theLonGrid.save(outstream, "Longitude Grid");
+   theDlatDhGrid.save(outstream, "dLat/dH Grid");
+   theDlonDhGrid.save(outstream, "dLon_dH Grid");
+
+   ossimString descr;
+   int numberOfParams = getNumberOfAdjustableParameters();
+   for (int p=0; p<numberOfParams; p++)
+   {
+      descr = getParameterDescription(p) + " dLat_dParam Grid";
+      theDlatDparamGrid[p].save(outstream, descr.chars());
+      descr = getParameterDescription(p) + " dLon_dParam Grid";
+      theDlonDparamGrid[p].save(outstream, descr.chars());
+   }
+   
+   // Since the geom file is needed in the same path as the grid file, take this opportunity to 
+   // write the geom file out as well:
+   ossimFilename geom_file (theGridFilename);
+   geom_file.setExtension(DEFAULT_GEOM_FILE_EXT);
+   ossimKeywordlist kwl;
+   saveState(kwl);
+   kwl.write(geom_file);
+
+   // Add to the list of support files referenced (though technically it has not yet been 
+   // referenced, but will be next time this image is opened):
+   ossimSupportFilesList::instance()->add(geom_file);
+   ossimSupportFilesList::instance()->add(theGridFilename);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::saveCoarseGrid: returning..." << std::endl;
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimCoarseGridModel::loadCoarseGrid(cgFileName)
+//  
+//  Loads the coarse grid from disk file.
+//
+//  Returns true if successful.
+//  
+//*****************************************************************************
+bool ossimCoarseGridModel::loadCoarseGrid(const ossimFilename& cgFileName)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadCoarseGrid: entering..." << std::endl;
+
+   ossimDpt v[4];
+   ossimIpt grid_size;
+
+   //***
+   // Open existing grid file:
+   //***
+   ifstream instream (cgFileName.chars());
+   if (!instream.is_open())
+   {
+      theErrorStatus++;
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimCoarseGridModel::loadCoarseGrid: Error encountered opening coarse grid file <" << cgFileName
+         << ">. Check that the file exists and is readable." << std::endl;
+      }
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "CEBUG ossimCoarseGridModel::loadCoarseGrid: returning with error..." << std::endl;
+      return false;
+   }
+   theGridFilename = cgFileName;
+   if(theDlatDparamGrid)
+     {
+       delete [] theDlatDparamGrid;
+       theDlatDparamGrid = NULL;
+     }
+   if(theDlonDparamGrid)
+     {
+       delete [] theDlonDparamGrid;
+       theDlonDparamGrid = NULL;
+     }
+   //
+   // Reallocate memory:
+   //
+   int numberOfParams = getNumberOfAdjustableParameters();
+   if(numberOfParams)
+   {
+      theDlatDparamGrid = new ossimDblGrid [numberOfParams];
+      theDlonDparamGrid = new ossimDblGrid [numberOfParams];
+   }
+   //***
+   // Let each grid object read itself from the input file:
+   //***
+   if (!theLatGrid.load(instream))
+   {
+      ++theErrorStatus;
+      return false;
+   }
+   if (!theLonGrid.load(instream))
+   {
+      ++theErrorStatus;
+      return false;
+   }
+   if (!theDlatDhGrid.load(instream))
+   {
+      ++theErrorStatus;
+      return false;
+   }
+   if (!theDlonDhGrid.load(instream))
+   {
+      ++theErrorStatus;
+      return false;
+   }
+
+   for (int p=0; p<numberOfParams; p++)
+   {
+      if (!theDlatDparamGrid[p].load(instream))
+      {
+         ++theErrorStatus;
+         return false;
+      }
+      if (!theDlonDparamGrid[p].load(instream))
+      {
+         ++theErrorStatus;
+         return false;
+      }
+   }
+
+   //***
+   // Initialize the bounding ground rectangle:
+   //***
+   grid_size = theLatGrid.size();
+
+   v[0].lat = theLatGrid(0,0);
+   v[0].lon = theLonGrid(0,0);
+   v[1].lat = theLatGrid(theImageSize.x-1, 0);
+   v[1].lon = theLonGrid(theImageSize.x-1, 0);
+   v[2].lat = theLatGrid(theImageSize.x-1, theImageSize.y-1);
+   v[2].lon = theLonGrid(theImageSize.x-1, theImageSize.y-1);
+   v[3].lat = theLatGrid(0, theImageSize.y-1);
+   v[3].lon = theLonGrid(0, theImageSize.y-1);
+
+   theBoundGndPolygon = ossimPolygon(4, v);
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::loadCoarseGrid: returning..." << std::endl;
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimCoarseGridModel::reallocateGrid()
+//  
+//  Deletes existing grid arrays and allocates new ones.
+//  
+//*****************************************************************************
+void ossimCoarseGridModel::reallocateGrid(const ossimIpt& grid_size)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::reallocateGrid:entering..." << endl;
+
+
+   //***
+   // Deallocate memory:
+   //***
+   if(theDlatDparamGrid)
+     {
+       delete [] theDlatDparamGrid;
+       theDlatDparamGrid = NULL;
+     }
+   if(theDlonDparamGrid)
+     {
+       delete [] theDlonDparamGrid;
+       theDlonDparamGrid = NULL;
+     }
+   //***
+   // determine grid spacing given new info:
+   //***
+   ossimDpt spacing ((double)(theImageSize.x-1)/(double)(grid_size.x-1),
+                     (double)(theImageSize.y-1)/(double)(grid_size.y-1));
+
+   //***
+   // Allocate all:
+   //***
+   ossimDpt grid_origin(0.0, 0.0);
+   theLatGrid.setNullValue(ossim::nan());
+   theLonGrid.setNullValue(ossim::nan());
+   theDlatDhGrid.setNullValue(0.0);
+   theDlonDhGrid.setNullValue(0.0);
+   theLatGrid.initialize(grid_size, grid_origin, spacing);
+   theLonGrid.initialize(grid_size, grid_origin, spacing);
+   theDlatDhGrid.initialize(grid_size, grid_origin, spacing);
+   theDlonDhGrid.initialize(grid_size, grid_origin, spacing);
+   
+   int numberOfParams = getNumberOfAdjustableParameters();
+   if(numberOfParams)
+   {
+      
+      theDlatDparamGrid = new ossimDblGrid [numberOfParams];
+      theDlonDparamGrid = new ossimDblGrid [numberOfParams];
+   }
+   for (int p=0; p<numberOfParams; p++)
+   {
+      theDlonDparamGrid[p].setNullValue(0.0);
+      theDlatDparamGrid[p].setNullValue(0.0);
+      theDlatDparamGrid[p].initialize(grid_size, grid_origin, spacing);
+      theDlonDparamGrid[p].initialize(grid_size, grid_origin, spacing);
+   }
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::reallocateGrid: returning..." << std::endl;
+   return;
+}
+
+//*****************************************************************************
+// STATIC METHOD: ossimCoarseGridModel::writeGeomTemplate
+//  
+//  Writes a sample geometry KWL to the output stream.
+//  
+//*****************************************************************************
+void ossimCoarseGridModel::writeGeomTemplate(ostream& os)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::writeGeomTemplate: entering..." << std::endl;
+
+   os <<
+      "//**************************************************************\n"
+      "// Template for OCG model kewordlist\n"
+      "//**************************************************************\n"
+      << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
+
+   ossimSensorModel::writeGeomTemplate(os);
+   
+   os << "//\n"
+      << "// Derived-class ossimCoarseGridModel Keywords:\n"
+      << "//\n"
+      << GRID_FILE_NAME_KW << ": <string>\n" << endl;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimCoarseGridModel::writeGeomTemplate: returning..." << std::endl;
+   return;
+}
+   
+//*************************************************************************************************
+// Overrides base-class extrapolation code. Uses extrapolation inherent to ossimDbleGrid
+//*************************************************************************************************
+ossimGpt ossimCoarseGridModel::extrapolate(const ossimDpt& local_ip, const double& height) const
+{
+   ossimGpt gpt;
+   lineSampleHeightToWorld(local_ip, height, gpt);
+   return gpt;
+}
+
+bool ossimCoarseGridModel::isAffectedByElevation() const
+{
+   return theHeightEnabledFlag;
+}
diff --git a/ossim/src/ossim/projection/ossimCylEquAreaProjection.cpp b/src/projection/ossimCylEquAreaProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimCylEquAreaProjection.cpp
rename to src/projection/ossimCylEquAreaProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimEckert4Projection.cpp b/src/projection/ossimEckert4Projection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimEckert4Projection.cpp
rename to src/projection/ossimEckert4Projection.cpp
diff --git a/ossim/src/ossim/projection/ossimEckert6Projection.cpp b/src/projection/ossimEckert6Projection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimEckert6Projection.cpp
rename to src/projection/ossimEckert6Projection.cpp
diff --git a/src/projection/ossimEpsgProjectionDatabase.cpp b/src/projection/ossimEpsgProjectionDatabase.cpp
new file mode 100644
index 0000000..7c4ac17
--- /dev/null
+++ b/src/projection/ossimEpsgProjectionDatabase.cpp
@@ -0,0 +1,1005 @@
+//*************************************************************************************************
+//                          OSSIM -- Open Source Software Image Map
+//
+// LICENSE:  See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Projection database for EPSG coded projections provided in database files
+//
+//*************************************************************************************************
+//  $Id: ossimEpsgProjectionDatabase.cpp 23177 2015-03-04 15:05:25Z gpotts $
+#include <ossim/projection/ossimEpsgProjectionDatabase.h>
+#include <ossim/projection/ossimStatePlaneProjectionInfo.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimTransMercatorProjection.h>
+#include <ossim/projection/ossimMercatorProjection.h>
+#include <ossim/projection/ossimOrthoGraphicProjection.h>
+#include <ossim/projection/ossimNewZealandMapGridProjection.h>
+#include <ossim/projection/ossimGoogleProjection.h>
+#include <ossim/projection/ossimLambertConformalConicProjection.h>
+#include <ossim/projection/ossimCassiniProjection.h>
+#include <ossim/projection/ossimAlbersProjection.h>
+#include <ossim/projection/ossimUpsProjection.h>
+#include <ossim/base/ossimEpsgDatumFactory.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimDatumFactoryRegistry.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/projection/ossimMapProjectionFactory.h>
+#include <ossim/base/ossimException.h>
+#include <cmath>
+
+//ossimEpsgProjectionDatabase* ossimEpsgProjectionDatabase::m_instance = 0;
+
+// Indexes into the DB file fields using "SPADAC EPSG" format (format "A"). 
+// IF THE LINE FIELDS CHANGE ORDER, THIS LIST WILL NEED TO BE CHANGED TO REFLECT THE NEW ORDER!
+enum
+{
+   A_CODE = 0,  // This is the EPSG code
+   A_NAME,
+   A_PROJ_TYPE,
+   A_UNITS,
+   A_DATUM_CODE,
+   A_DATUM_NAME,
+   A_ELLIPSOID_NAME,
+   A_FALSE_EASTING,
+   A_NAT_ORG_LAT,
+   A_FALSE_NORTHING,
+   A_NAT_ORG_LON,
+   A_NAT_ORG_SCALE,
+   A_INIT_LINE_AZ,
+   A_PROJ_CTR_LAT,
+   A_PROJ_CTR_NORTHING,
+   A_RECT_TO_SKEW_ANGLE,
+   A_INIT_LINE_SCALE,
+   A_PROJ_CTR_EASTING,
+   A_PROJ_CTR_LON,
+   A_PSEUDO_STD_PARL_1,
+   A_PSEUDO_STD_PARL_1_SCALE,
+   A_ORG_LON,
+   A_STD_PARL_2_LAT,
+   A_FALSE_ORG_LAT,
+   A_FALSE_ORG_LON,
+   A_STD_PARL_1_LAT,
+   A_FALSE_ORG_NORTHING,
+   A_FALSE_ORG_EASTING,
+   A_STD_PARL_LAT,
+   A_TOPOCTR_HGT,
+   A_TOPOCTR_LAT,
+   A_TOPOCTR_Z,
+   A_TOPOCTR_Y,
+   A_TOPOCTR_X,
+   A_VIEWPOINT_H,
+   A_INIT_LON,
+   A_ZONE_WIDTH,
+   A_NUM_FIELDS   // Not an index, but a count
+};
+static const ossimString EPSG_DB_FORMAT_A ("EPSG_DB_FORMAT_A");
+
+// State Plane database CSV file field format (format "B")
+// NOTE: Eventually, all EPSG-coded projections, including State Plane/HARN should be specified
+// in the EPSG database format. Presently there is a disconnect between Geotrans params and EPSG-Db
+// params, particularly regarding datums, that makes a purely EPSG-Db solution too awkward to
+// implement, so provision is made here to continue reading the state plane CSV files.
+enum 
+{
+   B_NAME = 0,
+   B_CODE,   // This is the EPSG code
+   B_PROJ_TYPE,
+   B_PARAM1,
+   B_PARAM2,
+   B_PARAM3,
+   B_PARAM4,
+   B_FALSE_EASTING,
+   B_FALSE_NORTHING,
+   B_UNITS,
+   B_DATUM_CODE,
+   B_NUM_FIELDS   // Not an index, but a count
+};
+static const ossimString STATE_PLANE_FORMAT_B ("STATE_PLANE");
+
+// "Ming Special" database CSV file format (format "C")
+// State Plane Coordinate System (SPCS) coding is an alternate coding scheme that maps to EPSG.
+// http://www.pcigeomatics.com/cgi-bin/pcihlp/PROJ%7CSPCS+ZONES
+enum 
+{
+   C_NAME = 0,
+   C_CODE,
+   C_NUM_FIELDS   // Not an index, but a count
+};
+static const ossimString SPCS_EPSG_MAP_FORMAT_C ("SPCS_EPSG_MAP");
+
+//*************************************************************************************************
+//! Converts sexagesimal DMS to decimal degrees
+//*************************************************************************************************
+double decodeSexagesimalDms(const ossimString& sex_str)
+{
+   if (!sex_str.contains("."))
+      return sex_str.toDouble();
+
+   double sign = 1.0;
+   if (sex_str.chars()[0] == '-')
+      sign = -1.0;
+
+   double dsex, msex, ssex;
+   std::vector<ossimString> splitstr = sex_str.split(".");
+   dsex = splitstr[0].toDouble();
+   
+   if (splitstr.size() < 2)
+      return dsex;
+
+   const char* MMSSssstr = splitstr[1].chars();
+   unsigned int str_size = (unsigned int) splitstr[1].size();
+   char minstr[] = "00";
+   ossimString secstr ("00.");
+   minstr[0] = MMSSssstr[0];
+   if (str_size > 1)
+   {
+      minstr[1] = MMSSssstr[1];
+      if (str_size > 2)
+      {
+         secstr = &(MMSSssstr[2]);
+         if (str_size == 3)
+            secstr += ossimString("0.");
+         else if (str_size > 4)
+            secstr.insert(2, ".");
+      }
+   }
+   msex = ossimString(minstr).toDouble();
+   ssex = secstr.toDouble();
+   dsex += sign*(msex + ssex/60.0)/60.0;
+   return dsex;
+}
+
+//*************************************************************************************************
+//! Implements singleton pattern
+//*************************************************************************************************
+ossimEpsgProjectionDatabase* ossimEpsgProjectionDatabase::instance()
+{
+   static ossimEpsgProjectionDatabase inst;
+
+   return &inst;
+   //if(!m_instance)
+   //   m_instance = new ossimEpsgProjectionDatabase;
+   //return m_instance;
+}
+
+//*************************************************************************************************
+//! Destructor
+//*************************************************************************************************
+ossimEpsgProjectionDatabase::~ossimEpsgProjectionDatabase()
+{
+}
+
+//*************************************************************************************************
+//! Constructor loads all DB CSV files specified in the ossim prefs
+//*************************************************************************************************
+ossimEpsgProjectionDatabase::ossimEpsgProjectionDatabase()
+   :
+   m_projDatabase(),
+   m_mutex()
+{
+}
+
+//*************************************************************************************************
+//! Populates the database with contents of DB files as specified in ossim_preferences.
+//*************************************************************************************************
+void ossimEpsgProjectionDatabase::initialize() const
+{
+   // Fetch filenames of all projection DB files from the share directory specified in
+   // ossim_preferences:
+
+   // Optional ossim share dir:
+   ossimFilename share_dir = ossimPreferences::instance()->
+      preferencesKWL().findKey( std::string( "ossim_share_directory" ) );
+   
+   ossimString regEx =  ossimString("^epsg_database_file[0-9]+");
+   vector<ossimString> keys = 
+      ossimPreferences::instance()->preferencesKWL().getSubstringKeyList(regEx);
+   vector<ossimString>::const_iterator i = keys.begin();
+
+   // Create only once outside the loop:
+   ossimFilename epsg_path;
+   ossimFilename db_name;
+   ossimString group_id;
+   ossimString format_id;
+   ossimString line;
+
+   // Loop over each file and read contents into memory:
+   while ( i != keys.end() )
+   {
+      db_name.clear();
+      epsg_path = ossimPreferences::instance()->preferencesKWL().findKey( (*i).string() );
+      if ( epsg_path.size() )
+      {
+         if ( !epsg_path.isRelative() )
+         {
+            //---
+            // example:
+            // epsg_database_file0:/usr/share/ossim/projection/ossim_epsg_projections-v7_4.csv
+            //---
+            db_name = epsg_path;
+         }
+         else if ( share_dir.size() )
+         {
+            //---
+            // example:
+            // ossim_share_dir: /usr/share/ossim
+            // epsg_database_file0: projection/ossim_epsg_projections-v7_4.csv
+            //---
+            db_name = share_dir.dirCat( epsg_path );
+
+            //---
+            // This block is for backwards compatibility.
+            // Try tacking "projection" onto share dir.
+            //---
+            if ( !db_name.isReadable() )
+            {
+               db_name = share_dir.dirCat( ossimFilename("projection") );
+               db_name = db_name.dirCat( epsg_path);
+
+               // Lastly: Try tacking "ossim/projection" onto share dir.
+               if ( !db_name.isReadable() )
+               {
+                  db_name = share_dir.dirCat( ossimFilename("ossim/projection") );
+                  db_name = db_name.dirCat( epsg_path);
+               }
+            }
+         }
+      }
+      ++i;
+      
+      if (!db_name.isReadable())
+      {
+         continue;
+      }
+
+      // Open the DB file:
+      std::ifstream db_stream (db_name.chars());
+      bool good_file = false;
+      if (db_stream.good())
+      {
+         // Format specification implied in file's magic number:
+         std::getline(db_stream, format_id.string());
+         format_id.trim();
+         if ((format_id == EPSG_DB_FORMAT_A) || 
+             (format_id == STATE_PLANE_FORMAT_B) ||
+             (format_id == SPCS_EPSG_MAP_FORMAT_C))
+            good_file = true;
+      }
+      if (!good_file)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)<<"ossimEpsgProjectionDatabase::initialize() -- "
+            "Encountered bad database file <"<<db_name<<">. Skipping this file."<<endl;
+         db_stream.close();
+         continue;
+      }
+
+      // The file is good. Skip over the column descriptor line:
+      std::getline(db_stream, line.string());
+
+      // Loop to read all data records:
+      while (!db_stream.eof())
+      {
+         ossimRefPtr<ProjDbRecord> db_record = new ProjDbRecord;
+         std::getline(db_stream, line.string());
+         db_record->csvRecord = line.explode(","); // ONLY CSV FILES CONSIDERED HERE
+         if (db_record->csvRecord.size())
+         {
+            // Check if primary EPSG database format A:
+            if (format_id == EPSG_DB_FORMAT_A)
+            {
+               db_record->code = db_record->csvRecord[A_CODE].toUInt32();
+               db_record->name = db_record->csvRecord[A_NAME];
+               db_record->csvFormat = FORMAT_A;
+            }
+
+            // Check if State Plane (subset of EPSG but handled differently until projection 
+            // geotrans-EPSG disconnect is resolved. 
+            else if (format_id == STATE_PLANE_FORMAT_B)
+            {
+               db_record->code = db_record->csvRecord[B_CODE].toUInt32();
+               db_record->name = db_record->csvRecord[B_NAME];
+               db_record->csvFormat = FORMAT_B;
+            }
+
+            // This format is for Ming-special State Plane Coordinate System coded format.
+            // This format is simply a mapping from SPCS spec name (OSSIM-specific) to EPSG code.
+            // Note that no proj is instantiated and no KWL is populated. Only name and EPSG mapped
+            // code is saved.
+            else if (format_id == SPCS_EPSG_MAP_FORMAT_C)
+            {
+               db_record->code = db_record->csvRecord[C_CODE].toUInt32();
+               db_record->name = db_record->csvRecord[C_NAME];
+               db_record->csvFormat = FORMAT_C;
+            }
+
+            m_projDatabase.insert(make_pair(db_record->code, db_record));
+         }
+      }
+
+      db_stream.close();
+   } // end of while loop over all DB files
+}
+
+//*************************************************************************************************
+//! Returns a projection corresponding to the group (e.g., "EPSG") and PCS code provided, 
+//! or NULL if no entry found.
+//*************************************************************************************************
+ossimProjection* ossimEpsgProjectionDatabase::findProjection(ossim_uint32 epsg_code) const
+{
+   ossimMapProjection* proj = 0;
+
+   // Quick check for bogus EPSG:
+   if ((epsg_code == 0) || (epsg_code == 32767))
+      return 0;
+
+   // Check for Google projection:
+   else if (( epsg_code==3857) || (epsg_code == 900913))
+   {
+      proj = new ossimGoogleProjection();
+
+      // Set this for saveState:
+      proj->setPcsCode( 3857 );
+      /*
+      const ossimDatum* datum = ossimDatumFactory::instance()->create(ossimString("6055"));
+      ossimMercatorProjection* merc_proj = new ossimMercatorProjection();
+      ossimGpt origin(0.0,0.0,0.0, datum);
+      merc_proj->setFalseEasting(0.0);
+      merc_proj->setFalseNorthing(0.0);
+      merc_proj->setOrigin(origin); // Also sets the projections datum to the origin's datum
+      merc_proj->update();
+      merc_proj->setPcsCode(900913);
+      proj = merc_proj;
+      */
+   }
+
+   else
+   {
+      // Search database for entry:
+      m_mutex.lock();
+      if (m_projDatabase.empty())
+      {
+         initialize();
+      }
+      m_mutex.unlock();
+
+      std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = 
+         m_projDatabase.find(epsg_code);
+      if (db_iter != m_projDatabase.end())
+      {
+         // See if a projection has already been created for this entry:
+         m_mutex.lock();
+         ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
+         if ( db_record.valid() )
+         {
+            if (db_record->proj.valid())
+               proj = (ossimMapProjection*) db_record->proj->dup();
+            else
+            {
+               // Try decoding the EPSG code before accessing DB:
+               proj = createProjFromUtmCode(epsg_code);
+               if (proj)
+               {
+                  db_record->proj = proj;
+                  db_record->datumValid = true;
+               }
+               else if (db_iter->second->csvFormat == FORMAT_A)
+               {
+                  proj = createProjFromFormatARecord( db_record.get() );
+               }
+               else if (db_iter->second->csvFormat == FORMAT_B)
+               {
+                  proj = createProjFromFormatBRecord( db_record.get() );
+               }
+               
+               if (proj)
+               {
+                  // To save allocated memory, get rid of the original CSV entry since a real 
+                  // projection is now represented in the database:
+                  db_record->csvRecord.clear();
+                  db_record->csvFormat = NOT_ASSIGNED;
+               }
+            }
+
+         } // Matches: if  ( db_record.valid() )
+         m_mutex.unlock();
+      }
+   }
+
+   return proj;
+}
+
+//*************************************************************************************************
+//! Returns a projection corresponding to the group (e.g., "EPSG") and PCS code provided, 
+//! or NULL if no entry found.
+//*************************************************************************************************
+ossimProjection* ossimEpsgProjectionDatabase::findProjection(const ossimString& spec) const
+{
+   //std::cout << "ossimEpsgProjectionDatabase::findProjection: entered with spec " << spec << "\n";
+   ossimProjection* proj = 0;
+
+   // Use the CRS code to access the database. The spec should be <group>:<code> where <group> is 
+   // "EPSG" (the only group handled here):
+   ossim_uint32 spec_code;
+   ossimString spec_group ("epsg"); // default if only integer code provided
+   if (spec.contains(":"))
+   {
+      spec_group = spec.before(":");
+      spec_code = spec.after(":").toUInt32();
+      spec_group = spec_group.downcase();
+   }
+   else
+   {
+      spec_code = spec.toUInt32();
+   }
+
+   // Presently only EPSG database is handled:
+   if ((spec_code != 0) && (spec_group == "epsg"))
+      return findProjection(spec_code);
+
+   // The spec is probably a projection name. Need to search Db by the projection name. 
+   // Search database for entry. The spec may use different delimiters than
+   // the DB so need to split the strings and compare the words:
+   ossimString separators ("_ /()");
+   vector<ossimString> split_spec = spec.split(separators, true);
+   vector<ossimString> split_db_name;
+   ossimRefPtr<ossimMapProjection> map_proj = 0;
+   if (m_projDatabase.empty())
+      initialize();
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
+   while ((db_iter != m_projDatabase.end()) && !proj)
+   {
+      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
+      if ( db_record.valid() )
+      {
+         split_db_name.clear();
+         db_record->name.split(split_db_name, separators, true);
+         if (split_spec == split_db_name)
+         {
+            // We may already have instantiated this projection, in which case just return its copy.
+            // Otherwise, create the projection from the EPSG code that corresponds to the name:
+            if (db_record->proj.valid())
+               proj = (ossimMapProjection*) db_record->proj->dup();
+            else
+               proj = findProjection(db_record->code);
+            return proj;
+         }
+      }
+      ++db_iter;
+   }
+    
+   // No hit? Could be that just a datum was identified, in which case we need a simple 
+   // Platte Carree:
+   const ossimDatum* datum = ossimDatumFactoryRegistry::instance()->create(spec);
+   if (datum)
+   {
+      ossimEquDistCylProjection* proj = new ossimEquDistCylProjection(*(datum->ellipsoid()));
+      proj->setDatum(datum);
+      proj->setPcsCode(spec_code);
+      return proj;
+   }
+
+   return 0;
+}
+
+
+//*************************************************************************************************
+//! Given a projection name, assigns the group (e.g., "EPSG") and code of the projection. 
+//! Returns "<group>:<code>" if match was found or empty string if not found.
+//*************************************************************************************************
+ossim_uint32 ossimEpsgProjectionDatabase::findProjectionCode(const ossimString& proj_name) const
+{
+   if (m_projDatabase.empty())
+      initialize();
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
+   while (db_iter != m_projDatabase.end())
+   {
+      ossimRefPtr<ProjDbRecord> db_record = db_iter->second.get();
+      if ( db_record.valid() )
+      {
+         if (db_record->name == proj_name)
+            return (db_record->code);
+      }
+      ++db_iter;
+   }
+      
+   return 0;
+}
+
+//*************************************************************************************************
+//! Given a projection instance, this method determines the corresponding EPSG code. Obviously
+//! this is only needed if the projection does not have its PCS code assigned (it is NULL). This
+//! happens when the projection was constructed with full parameters instead of the EPSG code.
+//! Returns integer EPSG code if match was found or 0 if not found.
+//*************************************************************************************************
+ossim_uint32 
+ossimEpsgProjectionDatabase::findProjectionCode(const ossimMapProjection& lost_proj) const
+{
+   ossimString lost_type (lost_proj.getClassName());
+
+   // Shortcut for EPSG:4326 (WGS-85 geographic rectangular -- very common):
+   if ((lost_type == "ossimEquDistCylProjection") && (lost_proj.getDatum()->epsgCode() == 6326))
+      return 4326;
+
+   ossim_uint32 found_code = 0;
+   if (lost_type == "ossimUtmProjection")
+   {
+      found_code = getCodeFromUtmProj(dynamic_cast<const ossimUtmProjection*>(&lost_proj));
+      if (found_code)
+         return found_code;
+   }
+
+   if (m_projDatabase.empty())
+      initialize();
+   ossimString lookup;
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter =
+      m_projDatabase.begin();
+   while ((db_iter != m_projDatabase.end()) && (found_code == 0))
+   {
+      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
+      if ( db_record.valid() )
+      {
+         // Has a projection already been created for this db iter?
+         if (!db_record->proj.valid())
+         {
+            // No projection has been created yet for this DB entry. 
+            // NOTE: THIS IS VERY SLOW BECAUSE WE ARE INSTANTIATING EVERY PROJECTION IN THE DB!!!
+            db_record->proj = dynamic_cast<ossimMapProjection*>(findProjection(db_record->code));
+         }
+         if (db_record->proj.valid() && (*(db_record->proj.get()) == lost_proj))
+         {
+            found_code = db_record->code;
+            
+            // Hack to remap projection code 4087 to 4326 (which is not really a projection 
+            // code but other packages like to see 4326 for geographic projections.
+            // Hacked under protest (OLK, 08/2010)
+            if (found_code == 4087)
+               found_code = 4326;
+         }
+      }
+      ++db_iter;
+   }
+   return found_code;
+}
+
+//*************************************************************************************************
+//! This method provides acess to the projection name given the EPSG code. The name provides 
+//! enough info for recognizing a non-meters HARN-based projection. 
+//*************************************************************************************************
+ossimString ossimEpsgProjectionDatabase::findProjectionName(ossim_uint32 epsg_code) const
+{
+   if (m_projDatabase.empty())
+      initialize();
+
+   ossimString name ("");
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = 
+       m_projDatabase.find(epsg_code);
+   
+   if (db_iter != m_projDatabase.end())
+      name = db_iter->second->name;
+   
+   return name;
+}
+
+//*************************************************************************************************
+//! Populates caller's list with all projections currently represented in the database.
+//! The format is: 
+//!    EPSG:<code>  "<Name as appears in Db>"
+//! There may be duplicate entries if the projection is duplicated in the various Db files.
+//*************************************************************************************************
+void ossimEpsgProjectionDatabase::getProjectionsList(std::vector<ossimString>& list) const
+{
+   if (m_projDatabase.empty())
+      initialize();
+
+   std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> >::iterator db_iter = m_projDatabase.begin();
+   while (db_iter != m_projDatabase.end())
+   {
+      ossimRefPtr<ProjDbRecord> db_record = db_iter->second;
+      if ( db_record.valid() )
+      {
+         ossimString record ("EPSG:");
+         record += ossimString::toString(db_record->code);
+         record += "  \"";
+         record += db_record->name;
+         record += "\"";
+         list.push_back(record);
+      }
+      ++db_iter;
+   }
+   return;
+}
+
+//*************************************************************************************************
+//! This method is invoked to parse the Db record and produce a projection (or NULL if spec invalid)
+//
+// LIMITATION: Currently not parsing the datum info from the EPSG database file due to disconnect
+// with current ossimDatumFactory. Setting to default WGS84 with warning message.
+//*************************************************************************************************
+ossimMapProjection* 
+ossimEpsgProjectionDatabase::createProjFromFormatARecord(ProjDbRecord* record) const
+{
+   // Establish EPSG code and test for UTM (full projection is implied in the code itself -- no 
+   // accessing the database). Until the database is solidified, it is probably better to do 
+   // it this way:
+   record->datumValid = true;
+   record->proj = 0;
+
+   // Establish the units in which the easting/northing is provided:
+   ossimUnitType mapProjUnits = OSSIM_METERS;
+   double mtrs_per_unit = 1.0;
+   if (record->csvRecord[A_UNITS] == "US survey foot")
+   {
+      mapProjUnits = OSSIM_US_SURVEY_FEET;
+      mtrs_per_unit = US_METERS_PER_FT;
+   }
+   else if (record->csvRecord[A_UNITS].contains("foot")) // THIS IS INTERNATIONAL FOOT, NOT EXACT FOR MANY INTERNATIONAL VARIETIES
+   {
+      mapProjUnits = OSSIM_FEET;
+      mtrs_per_unit = MTRS_PER_FT;
+   }
+   else if (record->csvRecord[A_UNITS].contains("kilometre"))
+   {
+      mapProjUnits = OSSIM_KILOMETERS;
+      mtrs_per_unit = 1000.0;
+   }
+   else if (!record->csvRecord[A_UNITS].contains("metre"))
+   {
+      // ### SKIP THIS MESSAGE BUT BE AWARE THAT THIS PROJECTION WON'T BE REPRESENTED IN DB ###
+      //ossimNotify(ossimNotifyLevel_WARN)<<MODULE<<"EPSG:"<<pcs_code<<" units of <"
+      //   <<record->csvRecord[A_UNITS]<<"> not presently supported."<<endl;
+      return 0;
+   }
+
+   // First create a datum given the datum code in the record:
+   ossim_uint32 gcs_code = record->csvRecord[A_DATUM_CODE].toUInt32();
+   const ossimDatum* datum = ossimEpsgDatumFactory::instance()->create(gcs_code);
+   if (!datum)
+   {
+      // Default to WGS 84 -- this may throw an exception:
+      datum = ossimDatumFactory::instance()->create(ossimString("WGE"));
+      record->datumValid = false;
+   }
+   const ossimEllipsoid* ellipsoid = datum->ellipsoid();
+
+   ossimGpt origin(0,0,0,datum);
+   ossimString proj_type = record->csvRecord[A_PROJ_TYPE];
+   if (proj_type.contains("Transverse Mercator"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      double sf = record->csvRecord[A_NAT_ORG_SCALE].toDouble();
+      record->proj = new ossimTransMercatorProjection(*ellipsoid, origin, fe, fn, sf);
+   }
+   else if (proj_type.contains("Lambert Conic Conformal (1SP)"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      record->proj = new ossimLambertConformalConicProjection(*ellipsoid, origin, origin.lat, 
+         origin.lat, fe, fn);
+   }
+   else if (proj_type.contains("Lambert Conic Conformal (2SP)"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LON]);
+      double p1 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_1_LAT]);
+      double p2 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_2_LAT]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_NORTHING].toDouble();
+      record->proj = new ossimLambertConformalConicProjection(*ellipsoid, origin, p1, p2, fe, fn);
+   }
+   else if (proj_type.contains("Cassini"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      record->proj =  new ossimCassiniProjection(*ellipsoid, origin, fe, fn);
+   }
+   else if (proj_type.contains("Mercator (1SP)"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      double sf = record->csvRecord[A_NAT_ORG_SCALE].toDouble();
+      record->proj = new ossimMercatorProjection(*ellipsoid, origin, fe, fn, sf);
+   }
+   else if(proj_type.contains("Popular Visualisation Sphere"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      double sf = record->csvRecord[A_NAT_ORG_SCALE].toDouble();
+      record->proj = new ossimMercatorProjection(*ellipsoid, origin, fe, fn, sf);
+
+      // Set this for saveState:
+      record->proj->setPcsCode( 3785 );
+
+   }
+   else if(proj_type.contains("Pseudo Mercator"))
+   {
+      record->proj = new ossimGoogleProjection();
+
+      // Set this for saveState:
+      record->proj->setPcsCode( 3857 );
+
+   }
+   else if (proj_type.contains("Albers"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_FALSE_ORG_LON]);
+      double p1 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_1_LAT]);
+      double p2 = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_2_LAT]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_ORG_NORTHING].toDouble();
+      record->proj = new ossimAlbersProjection(*ellipsoid, origin, p1, p2, fe, fn);
+   }
+   else if (proj_type.contains("Equidistant Cylindrical"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_STD_PARL_1_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      record->proj = new ossimEquDistCylProjection(*ellipsoid, origin, fe, fn);
+   }
+   else if (proj_type.contains("New Zealand Map Grid"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      ossimNewZealandMapGridProjection* nz_proj = new ossimNewZealandMapGridProjection;
+      nz_proj->setOrigin(origin);
+      nz_proj->setFalseEastingNorthing(fe, fn);
+      record->proj = nz_proj;
+   }
+   else if (proj_type.contains("Polar Stereographic"))
+   {
+      origin.lat = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LAT]);
+      origin.lon = decodeSexagesimalDms(record->csvRecord[A_NAT_ORG_LON]);
+      // double fe = mtrs_per_unit*record->csvRecord[A_FALSE_EASTING].toDouble();
+      // double fn = mtrs_per_unit*record->csvRecord[A_FALSE_NORTHING].toDouble();
+      ossimUpsProjection* ups_proj = new ossimUpsProjection(ossimEllipsoid(), origin);
+      record->proj = ups_proj;
+   }
+   else
+   {
+      // Can't handle it now. 
+      //ossimNotify(ossimNotifyLevel_FATAL)<<MODULE<<"EPSG:"<<record->csvRecord[A_CODE]<<" \""<<proj_type<<"\" "
+      //   "not presently supported. Returning NULL projection..."<<endl;
+      return 0;
+   }
+  
+   record->proj->setDatum(datum);
+   record->proj->setPcsCode(record->code);
+   record->proj->setProjectionUnits(mapProjUnits);
+
+   return record->proj.get();
+}
+
+//*************************************************************************************************
+// ### HACK ###
+//! State Plane projections as specified in the EPSG are indistinguishable from regular TM. 
+//! Unfortunately OSSIM does make a distinction. For the time being, parse the code and 
+//! programmatically arrive at the UTM projection.
+//*************************************************************************************************
+ossimMapProjection* 
+ossimEpsgProjectionDatabase::createProjFromFormatBRecord(ProjDbRecord* db_record) const
+{
+   // Unfortunately, as of this writing, there is a disconnect between the Geotrans projection
+   // parameters and those provided by EPSG database. In the meantime, to maintain functionality,
+   // we intercept the EPSG code and programmatically arrive at the projection versus pulling
+   // all the parameters out of the Db record->
+   ossimStatePlaneProjectionInfo  info(db_record->name,
+                                       db_record->code,
+                                       db_record->csvRecord[B_PROJ_TYPE],
+                                       db_record->csvRecord[B_PARAM1],
+                                       db_record->csvRecord[B_PARAM2],
+                                       db_record->csvRecord[B_PARAM3],
+                                       db_record->csvRecord[B_PARAM4],
+                                       db_record->csvRecord[B_FALSE_EASTING].toDouble(),
+                                       db_record->csvRecord[B_FALSE_NORTHING].toDouble(),
+                                       db_record->csvRecord[B_UNITS],
+                                       db_record->csvRecord[B_DATUM_CODE]);
+   
+   // NOTE: In order to avoid infinite recursion with this object, we initialized the PCS code in 
+   // info to NULL to insure that the projection is instantiated directly (not via this class):
+   ossimKeywordlist kwl;
+   info.populateProjectionKeywords(kwl);
+   kwl.remove(ossimKeywordNames::PCS_CODE_KW);
+   db_record->proj = 
+      PTR_CAST(ossimMapProjection, ossimMapProjectionFactory::instance()->createProjection(kwl));
+   if (db_record->proj.valid())
+   {
+      db_record->proj->setPcsCode(db_record->csvRecord[B_CODE].toUInt32());
+      db_record->datumValid = true;
+   }
+
+   return db_record->proj.get();
+}
+
+//*************************************************************************************************
+// ### HACK ###
+//! UTM projections as specified in the EPSG are indistinguishable from regular TM. Unfortunately
+//! OSSIM does make a distinction. For the time being, parse the code and programmatically arrive 
+//! at the UTM projection.
+//*************************************************************************************************
+ossimMapProjection* ossimEpsgProjectionDatabase::createProjFromUtmCode(ossim_uint32 code) const
+{
+   // This code originally found in deprecated ossimPcsCodeProjectionFactory authored by
+   // David Burken.
+   int type = code/100;
+   int zone = code%100;
+   ossimUtmProjection* proj = NULL;
+   switch (type)
+   {
+   case 322:
+      // utm, WGS72 (WGD), northern hemisphere
+      if ( (zone > 0 ) && (zone < 61) )
+      {
+         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs72()->ellipsoid()));
+         proj->setDatum(ossimDatumFactory::instance()->wgs72());
+         proj->setZone(zone);
+         proj->setHemisphere('N');
+      }
+      break;
+
+   case 323:
+      // utm, WGS72 (WGD), southern hemisphere
+      if ( (zone > 0) && (zone < 61) )
+      {
+         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs72()->ellipsoid()));
+         proj->setDatum(ossimDatumFactory::instance()->wgs72());
+         proj->setZone(zone);
+         proj->setHemisphere('S');
+      }
+      break;
+
+   case 326:
+      // utm, WGS84 (WGE), northern hemisphere
+      if ( (zone > 0) && (zone < 61) )
+      {
+         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs84()->ellipsoid()));
+         proj->setDatum(ossimDatumFactory::instance()->wgs84());
+         proj->setZone(zone);
+         proj->setHemisphere('N');
+      }
+      break;
+
+   case 327:
+      // utm, WGS84 (WGE), southern hemisphere
+      if ( (zone > 0) && (zone < 61) )
+      {
+         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->wgs84()->ellipsoid()));
+         proj->setDatum(ossimDatumFactory::instance()->wgs84());
+         proj->setZone(zone);
+         proj->setHemisphere('S');
+      }
+      break;
+
+   case 267:
+      // utm, "NAS-C", northern hemisphere
+      // Only UTM NAD27 North zones 3 to 22 are in the 267xx range...
+      // 26729 through 26803 handled by state plane factory.
+      //---
+      if ( (code > 26702) && (code < 26723) )
+      {
+         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->
+            create(ossimString("NAS-C"))->ellipsoid()));
+         proj->setDatum(ossimDatumFactory::instance()->create(ossimString("NAS-C")));
+         proj->setZone(zone);
+         proj->setHemisphere('N');
+      }
+      break;
+
+   case 269:
+      // utm, "NAR-C", northern hemisphere
+      // Only UTM NAD83 North zones 3 to 23 are in the 269xx range...
+      // 26929 through 26998 handled by state plane factory.
+      if ( (code > 26902) && (code < 26924) )
+      {
+         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->
+            create(ossimString("NAR-C"))->ellipsoid()));
+         proj->setDatum(ossimDatumFactory::instance()->create(ossimString("NAR-C")));
+         proj->setZone(zone);
+         proj->setHemisphere('N');
+      }
+      break;
+
+   case 248:
+      // Provisional S. American 1956, 24818 through 24880
+      if ( (code > 24817) && (code < 24881) )
+      {
+         proj = new ossimUtmProjection(*(ossimDatumFactory::instance()->
+            create(ossimString("PRP-M"))->ellipsoid()));
+         proj->setDatum(ossimDatumFactory::instance()->create(ossimString("PRP-M")));
+         if (zone > 60)
+         {
+            proj->setZone(zone - 60);
+            proj->setHemisphere('S');
+         }
+         else
+         {
+            proj->setZone(zone);
+            proj->setHemisphere('N');
+         }
+      }
+      break;
+
+   } // End of switch on code.
+
+   if (proj)
+      proj->setPcsCode(code);
+
+   return proj;
+}
+
+//*************************************************************************************************
+//! Given UTM projection, derives the associated EPSG code. This is faster than a Db lookup.
+//*************************************************************************************************
+ossim_uint32 ossimEpsgProjectionDatabase::getCodeFromUtmProj(const ossimUtmProjection* proj) const
+{
+   if (proj == NULL)
+      return 0;
+
+   char hemisphere = proj->getHemisphere();
+   ossim_uint32 zone = proj->getZone();
+   ossimString datum_code = proj->getDatum()->code();
+   
+   if ((zone < 1 ) || (zone > 60))
+      return 0;
+
+   ossim_uint32 epsg_code = zone;
+   if ((hemisphere == 'N') && (datum_code == "WGD"))
+      epsg_code += 32200;
+   
+   else if ((hemisphere == 'S') && (datum_code == "WGD"))
+      epsg_code += 32300;
+
+   else if ((hemisphere == 'N') && (datum_code == "WGE"))
+      epsg_code += 32600;
+
+   else if ((hemisphere == 'S') && (datum_code == "WGE"))
+      epsg_code += 32700;
+
+   else if ((hemisphere == 'N') && (datum_code == "NAS-C") && (zone > 2) && (zone < 23))
+      epsg_code += 26700;
+
+   else if ((hemisphere == 'N') && (datum_code == "NAR-C") && (zone > 2) && (zone < 24))
+      epsg_code += 26900;
+
+   else if ((hemisphere == 'N') && (datum_code == "PRP-M"))
+      epsg_code += 24800;
+
+   else if ((hemisphere == 'S') && (datum_code == "PRP-M"))
+      epsg_code += 24800 + 60;
+   
+   else
+   {
+      //---
+      // Use a projection code that does not imply a datum.
+      // See section "6.3.3.2 Projection Codes" for definition.
+      //---
+      if  ( hemisphere == 'N' ) // Northern hemisphere.
+      {
+         epsg_code += 16000;
+      }
+      else // Southern hemisphere.
+      {
+         epsg_code += 16100;
+      }
+   }
+
+   return epsg_code;
+}
+
diff --git a/ossim/src/ossim/projection/ossimEpsgProjectionFactory.cpp b/src/projection/ossimEpsgProjectionFactory.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimEpsgProjectionFactory.cpp
rename to src/projection/ossimEpsgProjectionFactory.cpp
diff --git a/src/projection/ossimEquDistCylProjection.cpp b/src/projection/ossimEquDistCylProjection.cpp
new file mode 100644
index 0000000..4eeb236
--- /dev/null
+++ b/src/projection/ossimEquDistCylProjection.cpp
@@ -0,0 +1,686 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Equidistant Cylinder projection code.  
+//*******************************************************************
+//  $Id: ossimEquDistCylProjection.cpp 23373 2015-06-13 17:16:38Z okramer $
+
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/elevation/ossimElevManager.h>
+
+static ossimTrace traceDebug("ossimEquDistCylProjection:debug");
+
+RTTI_DEF1(ossimEquDistCylProjection,
+          "ossimEquDistCylProjection",
+	  ossimMapProjection);
+	  //          ossimLlxyProjection)
+   
+/***************************************************************************/
+/*
+ *                               DEFINES
+ */
+
+#ifndef PI_OVER_2
+#  define PI_OVER_2  ( M_PI / 2.0)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI     (2.0 * M_PI)
+#endif
+#define ONE	   (1.0 * M_PI / 180.0)       /* 1 degree in radians*/
+
+#define EQCY_NO_ERROR           0x0000
+#define EQCY_LAT_ERROR          0x0001
+#define EQCY_LON_ERROR          0x0002
+#define EQCY_EASTING_ERROR      0x0004
+#define EQCY_NORTHING_ERROR     0x0008
+#define EQCY_ORIGIN_LAT_ERROR   0x0010
+#define EQCY_CENT_MER_ERROR     0x0020
+#define EQCY_A_ERROR            0x0040
+#define EQCY_B_ERROR            0x0080
+#define EQCY_A_LESS_B_ERROR     0x0100
+
+
+ossimEquDistCylProjection::ossimEquDistCylProjection(const ossimEllipsoid& ellipsoid,
+                                                     const ossimGpt& origin)
+//  :ossimLlxyProjection(ellipsoid, origin)
+  :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+
+ossimEquDistCylProjection::ossimEquDistCylProjection(const ossimEllipsoid& ellipsoid,
+                                                     const ossimGpt& origin,
+                                                     double falseEasting,
+                                                     double falseNorthing)
+//  :ossimLlxyProjection(ellipsoid, origin)
+  :ossimMapProjection(ellipsoid, origin)
+{
+   Eqcy_False_Easting  = falseEasting;
+   Eqcy_False_Northing = falseNorthing;
+
+   Eqcy_Delta_Northing = 10007555.0;
+   Eqcy_Max_Easting    = 20015110.0;
+   Eqcy_Min_Easting    = -20015110.0;
+   
+   update();
+}
+
+void ossimEquDistCylProjection::update()
+{
+   Set_Equidistant_Cyl_Parameters(theEllipsoid.getA(),
+                                  theEllipsoid.getFlattening(),
+                                  theOrigin.latr(),
+                                  theOrigin.lonr(),
+                                  Eqcy_False_Easting,
+                                  Eqcy_False_Northing);
+
+   theFalseEastingNorthing.x = Eqcy_False_Easting;
+   theFalseEastingNorthing.y = Eqcy_False_Northing;
+
+   theMetersPerPixel.makeNan(); // force recompute by base class
+
+   ossimMapProjection::update();
+
+   // For geographic projection, the PCS EPSG code can be derived from the datum in most cases:
+   if ((thePcsCode == 0) && (theDatum != NULL))
+   {
+      ossim_uint32 datum_code = theDatum->epsgCode();
+      if ((datum_code >= 6000) && (datum_code < 7000))
+         thePcsCode = datum_code - 2000;
+   }
+
+   // Workaround for bug
+}
+
+void ossimEquDistCylProjection::setOrigin(const ossimGpt& origin)
+{
+   ossimMapProjection::setOrigin(origin); // breaks the projection
+   setUlTiePoints(theUlGpt); // needed to reset easting northing
+
+   // Changing the projection origin from the equator implies a scale change in the longitude
+   // direction to maintain GSD (meters) square at origin:
+   ossimDpt gsd = getMetersPerPixel();
+   gsd.x = gsd.y; // reset X (longitude) direction GSD
+   setMetersPerPixel(gsd);
+}
+
+void ossimEquDistCylProjection::setFalseEasting(double falseEasting)
+{
+   Eqcy_False_Easting = falseEasting;
+   update();
+}
+
+void ossimEquDistCylProjection::setFalseNorthing(double falseNorthing)
+{
+   Eqcy_False_Northing = falseNorthing;
+   update();
+}
+
+void ossimEquDistCylProjection::setFalseEastingNorthing(double falseEasting,
+                                                        double falseNorthing)
+{
+   Eqcy_False_Easting  = falseEasting;
+   Eqcy_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimEquDistCylProjection::setDefaults()
+{
+   theProjectionUnits = OSSIM_DEGREES;
+   Eqcy_False_Easting  = 0.0;
+   Eqcy_False_Northing = 0.0;
+   Eqcy_Delta_Northing = 10007555.0;
+   Eqcy_Max_Easting    = 20015110.0;
+   Eqcy_Min_Easting    = -20015110.0;
+}
+
+void ossimEquDistCylProjection::lineSampleHeightToWorld(const ossimDpt &lineSample,
+                                                        const double&  hgtEllipsoid,
+                                                        ossimGpt&      gpt)const
+{
+   //
+   // make sure that the passed in lineSample is good and
+   // check to make sure our easting northing is good so
+   // we can compute the line sample.
+   //
+   //
+   if(lineSample.hasNans())
+   {
+      gpt.makeNan();
+      return;
+   }
+   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
+   {
+      ossimMapProjection::lineSampleHeightToWorld(lineSample, hgtEllipsoid, gpt);
+      return;
+   }
+   else
+   {
+      if(theUlEastingNorthing.hasNans())
+      {
+         gpt.makeNan();
+         return;
+      }
+      ossimDpt eastingNorthing;
+      
+      eastingNorthing = (theUlEastingNorthing);
+      
+      eastingNorthing.x += (lineSample.x*theMetersPerPixel.x);
+      
+      //
+      // Note:  the Northing is positive up.  In image space
+      // the positive axis is down so we must multiply by
+      // -1
+      //
+      eastingNorthing.y += (-lineSample.y*theMetersPerPixel.y);
+      
+      //
+      // now invert the meters into a ground point.
+      //
+      gpt = inverse(eastingNorthing);
+      gpt.datum(theDatum);
+      
+      if(gpt.isLatNan() && gpt.isLonNan())
+      {
+         gpt.makeNan();
+      }
+      else
+      {
+         // Finally assign the specified height:
+         gpt.hgt = hgtEllipsoid;
+      }
+   }
+   if(theElevationLookupFlag)
+   {
+      gpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
+   }
+}
+
+void ossimEquDistCylProjection::worldToLineSample(const ossimGpt &worldPoint,
+                                                  ossimDpt&       lineSample)const
+{
+   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
+   {
+      ossimMapProjection::worldToLineSample(worldPoint, lineSample);
+      return;
+   }
+   
+   // make sure our tie point is good and world point is good.
+   if(theUlEastingNorthing.isNan() || worldPoint.isLatNan() || worldPoint.isLonNan())
+   {
+      lineSample.makeNan();
+      return;
+   }
+
+   // see if we have a datum set and if so shift the world to our datum.  If not then
+   // find the easting northing value for the world point.
+   ossimDpt gptEastingNorthing;
+   if(theDatum)
+   {
+      ossimGpt gpt = worldPoint;
+      gpt.changeDatum(theDatum);
+      gptEastingNorthing = forward(gpt);
+   }
+   else
+   {
+      gptEastingNorthing = forward(worldPoint);
+   }
+
+   // check the final result to make sure there were no problems.
+   if(!gptEastingNorthing.isNan())
+   {
+      lineSample.x = ((gptEastingNorthing.x  - theUlEastingNorthing.x)/theMetersPerPixel.x);
+
+      // We must remember that the Northing is negative since the positive
+      // axis for an image is assumed to go down since it's image space.
+      lineSample.y = (-(gptEastingNorthing.y - theUlEastingNorthing.y)/theMetersPerPixel.y);
+   }
+}
+
+void ossimEquDistCylProjection::worldToLineSample( const ossimGpt& worldPoint,
+                                                   const ossimIpt& imageSize,
+                                                   ossimDpt&       lineSample ) const
+{
+   if( theModelTransformUnitType == OSSIM_UNIT_UNKNOWN )
+   {
+      // Make sure our points are good.
+      if( !theUlEastingNorthing.isNan() && !worldPoint.isLatNan() && !worldPoint.isLonNan() &&
+          !imageSize.isNan() )
+      {
+         ossimGpt gpt = worldPoint;
+
+         //---
+         // See if we have a datum set and if so shift the world to our datum.  If not then
+         // find the easting northing value for the world point.
+         if(theDatum)
+         {
+            gpt.changeDatum(theDatum);
+         }
+
+         // Convert to easting northing.
+         ossimDpt gptEastingNorthing = forward(gpt);
+        
+         if( !gptEastingNorthing.isNan() )
+         {
+#if 0            
+            if ( imageSize.x > 0.0 )
+            {
+               ossimGpt edge(gpt.lat, -180.0, 0.0);
+               ossimDpt leftProjectionEdge = forward(edge);
+               
+               edge.lon = 180;
+               ossimDpt rightProjectionEdge = forward(edge);
+
+               // Right edge Easting of image from tie.
+               ossim_float64 leftImageX = theUlEastingNorthing.x  - (0.5*theMetersPerPixel.x);
+               ossim_float64 rightImageX = leftImageX + (imageSize.x * theMetersPerPixel.x);
+
+               if ( rightImageX < rightProjectionEdge.x ) // Image edge left of date line.
+               {
+                  // Image does not cross the date line.
+                  lineSample.x =
+                     (gptEastingNorthing.x - theUlEastingNorthing.x) / theMetersPerPixel.x;
+               }
+               else // Crossed date line:
+               {
+                  // Normalize the right image point to account for wrap:
+                  ossim_float64 normRightX =
+                     rightImageX - rightProjectionEdge.x + leftProjectionEdge.x;
+
+                  if ( ( gptEastingNorthing.x >= leftImageX ) &&
+                       ( gptEastingNorthing.x <= rightProjectionEdge.x ) )
+                  {
+                     // Between tie and date line.
+                     lineSample.x =
+                        (gptEastingNorthing.x - theUlEastingNorthing.x)/theMetersPerPixel.x;
+                  }
+                  else if ( ( gptEastingNorthing.x >= leftProjectionEdge.x ) &&
+                            ( gptEastingNorthing.x <=  normRightX ) )
+                  {
+                     // Between date line and right image point.
+                     lineSample.x = ( rightProjectionEdge.x - theUlEastingNorthing.x +
+                                     gptEastingNorthing.x - leftProjectionEdge.x )/theMetersPerPixel.x;
+                  }
+                  else
+                  {
+                     // Point in between normalized right x and tie:
+                     ossim_float64 deltaToLeft  = theUlEastingNorthing.x - gptEastingNorthing.x;
+                     ossim_float64 deltaToRight = gptEastingNorthing.x - normRightX;
+                     
+                     // Make relative to the closest edge.
+                     if ( deltaToRight < deltaToLeft )
+                     {
+                        lineSample.x = (imageSize.x - 1) + deltaToRight/theMetersPerPixel.x;
+                     }
+                     else
+                     {
+                        lineSample.x = -(deltaToLeft/theMetersPerPixel.x );
+                     }
+                  }  
+               }
+              
+            } // Matches: if ( ( imageSize.x > 0.0 ) && ( imageSize.y > 0.0 ) )
+            else
+            {
+               lineSample.x = (gptEastingNorthing.x - theUlEastingNorthing.x)/theMetersPerPixel.x;
+            }
+ #endif
+            lineSample.x = (gptEastingNorthing.x - theUlEastingNorthing.x)/theMetersPerPixel.x;
+            // We must remember that the Northing is negative since the positive
+            // axis for an image is assumed to go down since it's image space.
+            lineSample.y = (theUlEastingNorthing.y - gptEastingNorthing.y) / theMetersPerPixel.y;
+            
+         } // Matches: if( !lineSample.isNan() )
+      }
+      else // Some point we need has nans...
+      {
+         lineSample.makeNan();
+      }
+   } // Matches: if( theModelTransformUnitType == OSSIM_UNIT_UNKNOWN )
+   else 
+   {
+      // Has transform:
+      ossimMapProjection::worldToLineSample(worldPoint, lineSample);
+   }
+
+} // End: ossimEquDistCylProjection::worldToLineSample(worldPoint, lineSample, imageSize)
+
+ossimGpt ossimEquDistCylProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+
+   Convert_Equidistant_Cyl_To_Geodetic(eastingNorthing.x,
+                                       eastingNorthing.y,
+                                       &lat,
+                                       &lon);
+
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
+}
+
+ossimDpt ossimEquDistCylProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Equidistant_Cyl(gpt.latr(),
+                                       gpt.lonr(),
+                                       &easting,
+                                       &northing);
+   
+   return ossimDpt(easting, northing);
+}
+
+
+
+bool ossimEquDistCylProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimEquDistCylProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimEquDistCylProjection::loadState: Input keyword list is \n" << kwl << endl;
+   }
+
+   //   ossimLlxyProjection::loadState(kwl, prefix);
+   ossimMapProjection::loadState(kwl, prefix);
+   theProjectionUnits = OSSIM_DEGREES;
+
+   // Make sure the origin.lat is defined since it is needed to relate degrees/meter:
+   if (ossim::isnan(theOrigin.lat))
+   {
+      theOrigin.lat = theUlGpt.lat;
+      if (ossim::isnan(theOrigin.lat))
+         theOrigin.lat = 0.0;
+   }
+
+   // Make sure degrees per pixel is defined:
+   if (theDegreesPerPixel.hasNans() && !theMetersPerPixel.hasNans())
+      computeDegreesPerPixel();
+
+   const char* type = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+
+   setDefaults();
+   // make sure we are of the same type.  If we are then the easting
+   // northing values will make since
+   //
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimEquDistCylProjection))
+   {
+      Eqcy_False_Easting  = theFalseEastingNorthing.x;
+      Eqcy_False_Northing = theFalseEastingNorthing.y;
+   }
+   else
+   {
+      theUlEastingNorthing.makeNan();
+   }
+   // finalize the initialization.
+   update();
+            
+   return true;
+}
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS
+ */
+
+
+long ossimEquDistCylProjection::Set_Equidistant_Cyl_Parameters(double a,
+                                                               double f,
+                                                               double Std_Parallel,
+                                                               double Central_Meridian,
+                                                               double False_Easting,
+                                                               double False_Northing)
+{ /* Begin Set_Equidistant_Cyl_Parameters */
+/*
+ * The function Set_Equidistant_Cyl_Parameters receives the ellipsoid parameters and
+ * projection parameters as inputs, and sets the corresponding state
+ * variables.  It also calculates the spherical radius of the sphere having 
+ * the same area as the ellipsoid.  If any errors occur, the error code(s) 
+ * are returned by the function, otherwise EQCY_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid						        (input)
+ *    Std_Parallel      : Latitude in radians at which the          (input)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          standard parallel of the projection     (input)
+ */
+
+  double temp;
+//  double inv_f = 1 / f;
+  long Error_Code = EQCY_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= EQCY_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= EQCY_INV_F_ERROR;
+//   }
+//   if ((Std_Parallel < -PI_OVER_2) || (Std_Parallel > PI_OVER_2))
+//   { /* standard parallel out of range */
+//     Error_Code |= EQCY_STDP_ERROR;
+//   }
+//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= EQCY_CENT_MER_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    Eqcy_a = a;
+    Eqcy_f = f;
+    es2 = 2 * Eqcy_f - Eqcy_f * Eqcy_f;
+    es4 = es2 * es2;
+    es6 = es4 * es2;
+    /* spherical radius */
+    Ra = Eqcy_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 /3024.0);
+    Eqcy_Std_Parallel = Std_Parallel;
+    Cos_Eqcy_Std_Parallel = cos(Eqcy_Std_Parallel);
+    Ra_Cos_Eqcy_Std_Parallel = Ra * Cos_Eqcy_Std_Parallel;
+//    if (Central_Meridian > M_PI)
+//      Central_Meridian -= TWO_PI;
+    Eqcy_Origin_Long = Central_Meridian;
+    Eqcy_False_Easting = False_Easting;
+    Eqcy_False_Northing = False_Northing;
+    if (Eqcy_Origin_Long > 0)
+    {
+      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long - M_PI - ONE, &Eqcy_Max_Easting, &temp);
+      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long - M_PI, &Eqcy_Min_Easting, &temp);
+    }
+    else if (Eqcy_Origin_Long < 0)
+    {
+      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long + M_PI, &Eqcy_Max_Easting, &temp);
+      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, Eqcy_Origin_Long + M_PI + ONE, &Eqcy_Min_Easting, &temp);
+    }
+    else
+    {
+      Convert_Geodetic_To_Equidistant_Cyl(PI_OVER_2, M_PI, &Eqcy_Max_Easting, &temp);
+      Eqcy_Min_Easting = -Eqcy_Max_Easting;
+    }
+  } /* End if(!Error_Code) */
+  return (Error_Code);
+} /* End Set_Equidistant_Cyl_Parameters */
+
+
+void ossimEquDistCylProjection::Get_Equidistant_Cyl_Parameters(double *a,
+                                                               double *f,
+                                                               double *Std_Parallel,
+                                                               double *Central_Meridian,
+                                                               double *False_Easting,
+                                                               double *False_Northing)const
+{ /* Begin Get_Equidistant_Cyl_Parameters */
+/*
+ * The function Get_Equidistant_Cyl_Parameters returns the current ellipsoid
+ * parameters and Equidistant Cylindrical projection parameters.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid						        (output)
+ *    Std_Parallel      : Latitude in radians at which the          (output)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          standard parallel of the projection     (output)
+ */
+
+  *a = Eqcy_a;
+  *f = Eqcy_f;
+  *Std_Parallel = Eqcy_Std_Parallel;
+  *Central_Meridian = Eqcy_Origin_Long;
+  *False_Easting = Eqcy_False_Easting;
+  *False_Northing = Eqcy_False_Northing;
+  return;
+} /* End Get_Equidistant_Cyl_Parameters */
+
+
+long ossimEquDistCylProjection::Convert_Geodetic_To_Equidistant_Cyl (double Latitude,
+                                                                     double Longitude,
+                                                                     double *Easting,
+                                                                     double *Northing)const
+   
+{ /* Begin Convert_Geodetic_To_Equidistant_Cyl */
+/*
+ * The function Convert_Geodetic_To_Equidistant_Cyl converts geodetic (latitude and
+ * longitude) coordinates to Equidistant Cylindrical projection (easting and northing)
+ * coordinates, according to the current ellipsoid, spherical radiius
+ * and Equidistant Cylindrical projection parameters.
+ * If any errors occur, the error code(s) are returned by the
+ * function, otherwise EQCY_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double dlam;     /* Longitude - Central Meridan */
+  long Error_Code = EQCY_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   {  /* Latitude out of range */
+//     Error_Code |= EQCY_LAT_ERROR;
+//   }
+//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
+//   {  /* Longitude out of range */
+//     Error_Code|= EQCY_LON_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+    dlam = Longitude - Eqcy_Origin_Long;
+    //if (dlam >= TWO_PI)
+    //{
+    //  dlam -= TWO_PI;
+   // }
+   // if (dlam <= -TWO_PI)
+   // {
+   //   dlam += TWO_PI;
+   // }
+
+    *Easting = Ra_Cos_Eqcy_Std_Parallel * dlam + Eqcy_False_Easting;
+    *Northing = Ra * Latitude + Eqcy_False_Northing;
+
+  }
+  return (Error_Code);
+
+} /* End Convert_Geodetic_To_Equidistant_Cyl */
+
+
+long ossimEquDistCylProjection::Convert_Equidistant_Cyl_To_Geodetic(double Easting,
+                                                                    double Northing,
+                                                                    double *Latitude,
+                                                                    double *Longitude)const
+{ /* Begin Convert_Equidistant_Cyl_To_Geodetic */
+/*
+ * The function Convert_Equidistant_Cyl_To_Geodetic converts Equidistant Cylindrical projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid, spherical radius
+ * and Equidistant Cylindrical projection coordinates.
+ * If any errors occur, the error code(s) are returned by the
+ * function, otherwise EQCY_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double dx, dy;
+  long Error_Code = EQCY_NO_ERROR;
+
+//   if ((Easting < (Eqcy_False_Easting + Eqcy_Min_Easting))
+//       || (Easting > (Eqcy_False_Easting + Eqcy_Max_Easting)))
+//   { /* Easting out of range */
+//     Error_Code |= EQCY_EASTING_ERROR;
+//   }
+//   if ((Northing < (Eqcy_False_Northing - Eqcy_Delta_Northing))
+//       || (Northing > (Eqcy_False_Northing + Eqcy_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= EQCY_NORTHING_ERROR;
+//   }
+
+  if (!Error_Code)
+  {
+    dy = Northing - Eqcy_False_Northing;
+    dx = Easting - Eqcy_False_Easting;
+    *Latitude = dy / Ra;
+
+    if (Ra_Cos_Eqcy_Std_Parallel == 0)
+      *Longitude = 0;
+    else
+      *Longitude = Eqcy_Origin_Long + dx / Ra_Cos_Eqcy_Std_Parallel;
+
+//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+//       *Latitude = PI_OVER_2;
+//     else if (*Latitude < -PI_OVER_2)
+//       *Latitude = -PI_OVER_2;
+
+//    if (*Longitude > PI)
+//      *Longitude -= TWO_PI;
+//    if (*Longitude < -PI)
+//      *Longitude += TWO_PI;
+
+//    if (*Longitude > PI)  /* force distorted values to 180, -180 degrees */
+//      *Longitude = PI;
+//    else if (*Longitude < -PI)
+//      *Longitude = -PI;
+
+  }
+  return (Error_Code);
+
+} /* End Convert_Equidistant_Cyl_To_Geodetic */
diff --git a/src/projection/ossimFcsiModel.cpp b/src/projection/ossimFcsiModel.cpp
new file mode 100644
index 0000000..7817135
--- /dev/null
+++ b/src/projection/ossimFcsiModel.cpp
@@ -0,0 +1,1064 @@
+//*****************************************************************************
+// FILE: ossimFcsiModel.cc
+//
+// Copyright (C) 2001 ImageLinks, Inc.
+//
+// LGPL
+//
+// AUTHOR: Oscar Kramer (okramer at imagelinks.com)
+//
+// DESCRIPTION: Contains sensor model implementation for "Frame Camera Scanned
+//   Image" (FCSI, pronounced "foxy"). 
+//   
+//   This model represents image data that was scanned from film exposed by a
+//   conventional aerial frame camera. The data members defined in this class
+//   represent the fundamental quantities needed for the transformation.
+//   Typically, a different set of parameters will be provided in the metadata.
+//   An interface (support data) class will need to be implemented to convert
+//   a particular system's format to the quantities needed by this model.
+// 
+//   Coordinate systems in use are described here:
+//
+//   Pixel    -- line/sample in the digital image. The origin of this system is
+//               the upper left corner of the image, and represents a LEFT-
+//               HANDED coordinate system with Y (line) positive down and X
+//               (sample) positive to the right.
+//
+//   Film     -- x, y related to pixel space by affine transform (which includes
+//               mirror reflection due to left-handed system above) represented
+//               by thePrincipalPoint and the theScanXformMatrix. The latter
+//               contains scale, skew, and rotation/reflection. The film
+//               coordinates are adjusted for radial and decentering distortion.
+//
+//   Camera/  -- 3D system containing film plane and optical (Z) axis. Given the
+//   Platform    focal length (Z) and the film point (X,Y), a 3D ray direction
+//               is established in this space. This space is also termed "LSR"
+//               in the code. If there is a rotation between the film/optical
+//               axes and the platform (interior orientation), then that
+//               transformation must be included as part of the LSR-to-ECF
+//               rotation by the metadata reader object.
+//
+//   ECF      -- Universal earth frame of reference. The imaging ray direction
+//               is transformed from Camera space to ECF by theAdjLsrToEcfRot.
+//
+//   There are two rotations to go from Camera to ECF. First is the initial
+//   camera orientation as derived from the metadata, combining the interior
+//   orientation (relation between camera and platform) and the exterior
+//   orientation dependent on the platform attitude w.r.t. the ECF system.
+//   The second rotation is a differential rotation due to the attitude
+//   adjustable params. These are arbitrarily taken as rotations about the ECF
+//   XYZ axes, not the platform attitude axes of roll/pitch/yaw. The
+//   combined rotation is stored in theAdjLsrToEcfRot, which is precomputed
+//   in updateModel() once with each adjustment.
+//
+//   When the time comes to incorporate least-squares parameter adjustment, care
+//   must be taken to propagate the a priori sigmas for position and attitude
+//   (including both internal and external orientation angles) into the ECF
+//   coordinates. This also applies to the affine transform parameters used in
+//   transforming pixels to film coordinates. The propagated uncertainties can
+//   then be used to assign the adjustable parameter sigmas array (and
+//   covariance when we get to that...)
+//
+// SOFTWARE HISTORY:
+//   16JAN2003  Oscar Kramer, ImageLinks
+//              Initial coding
+//
+//*****************************************************************************
+// $Id: ossimFcsiModel.cpp 13005 2008-06-08 20:26:36Z dburken $
+
+#include <cstdlib>
+#include <fstream>
+#include <sstream>
+
+#include <ossim/projection/ossimFcsiModel.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimEcefRay.h>
+
+RTTI_DEF1(ossimFcsiModel, "ossimFcsiModel", ossimSensorModel);
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimFcsiModel:exec");
+static ossimTrace traceDebug ("ossimFcsiModel:debug");
+
+//***
+// File-scope constants:
+//***
+static const int MODEL_VERSION_NUMBER  = 1;
+static const ossimString PARAM_NAMES[] ={"x_pos_offset",
+                                         "y_pos_offset",
+                                         "z_pos_offset",
+                                         "x_rot_corr",
+                                         "y_rot_corr",
+                                         "z_rot_corr",
+                                         "foc_len_offset",
+                                         "scan_skew_corr"};
+static const ossimString PARAM_UNITS[] ={"meters",
+                                         "meters",
+                                         "meters",
+                                         "degrees",
+                                         "degress",
+                                         "degress",
+                                         "millimeters",
+                                         "degrees"};
+
+//***
+// Public FCSI Keywords:
+//***
+const char* ossimFcsiModel::PRINCIPAL_POINT_X_KW   = "principal_point_x";
+const char* ossimFcsiModel::PRINCIPAL_POINT_Y_KW   = "principal_point_y";
+const char* ossimFcsiModel::SCAN_SCALE_MATRIX_00_KW = "scan_scale_matrix_00";
+const char* ossimFcsiModel::SCAN_SCALE_MATRIX_01_KW = "scan_scale_matrix_01";
+const char* ossimFcsiModel::SCAN_SCALE_MATRIX_10_KW = "scan_scale_matrix_10";
+const char* ossimFcsiModel::SCAN_SCALE_MATRIX_11_KW = "scan_scale_matrix_11";
+const char* ossimFcsiModel::SCAN_ROTATION_ANGLE_KW = "scan_rotation_angle";
+const char* ossimFcsiModel::SCAN_SKEW_ANGLE_KW     = "scan_skew_angle";
+const char* ossimFcsiModel::FOCAL_LENGTH_KW        = "focal_length";
+const char* ossimFcsiModel::PLATFORM_POSITION_X_KW = "platform_position_x";
+const char* ossimFcsiModel::PLATFORM_POSITION_Y_KW = "platform_position_y";
+const char* ossimFcsiModel::PLATFORM_POSITION_Z_KW = "platform_position_z";
+const char* ossimFcsiModel::CAMERA_ORIENTATION_MATRIX_ELEM_KW
+                               = "camera_orientation_matrix_elem_";
+
+//*****************************************************************************
+//  DEFAULT CONSTRUCTOR: ossimFcsiModel()
+//
+//  Note: Using this constructor results in an uninitialized model. It is
+//  expected that either a loadState with valid keywordlist is called, or that
+//  the individual set-methods (including the base-class' set methods are
+//  called. When set-methods are used, a final call to completeInitialization()
+//  (declared in ossimSensorModel) is required to give the model a chance to
+//  "digest" the values previously set.
+//  
+//*****************************************************************************
+ossimFcsiModel::ossimFcsiModel()
+   :
+   ossimSensorModel       (),
+   thePrincipalPoint      (0, 0),
+   theScanSkew            (0.0),  
+   theScanRotation        (0.0),
+   theOpticalDistortion   (0),
+   theLsrToEcfRot         (3, 3),
+   theEcfOffset           (0, 0, 0),
+   theXrotCorr            (0.0),
+   theYrotCorr            (0.0),
+   theZrotCorr            (0.0),
+   theFocalOffset         (0.0),
+   theScanSkewCorr        (0.0),
+   theAdjLsrToEcfRot      (3, 3),
+   theAdjEcfToLsrRot      (3, 3)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
+   theScanScaleMatrix[0] = 1.0;
+   theScanScaleMatrix[1] = 0.0;
+   theScanScaleMatrix[2] = 0.0;
+   theScanScaleMatrix[3] = 1.0;
+   theScanXformMatrix[0] = 1.0;
+   theScanXformMatrix[1] = 0.0;
+   theScanXformMatrix[2] = 0.0;
+   theScanXformMatrix[3] = 1.0;
+   initAdjustableParameters();
+   setErrorStatus(); // indicate uninitialized
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimFcsiModel(filename)
+//  
+//  Constructs model from a keywordlist filename
+//  
+//*****************************************************************************
+ossimFcsiModel::ossimFcsiModel(const ossimFilename& init_file)
+   :
+   ossimSensorModel       (),
+   thePrincipalPoint      (0, 0),
+   theScanSkew            (0.0),  
+   theScanRotation        (0.0),
+   theOpticalDistortion   (0),
+   theLsrToEcfRot         (3, 3),
+   theEcfOffset           (0, 0, 0),
+   theXrotCorr            (0.0),
+   theYrotCorr            (0.0),
+   theZrotCorr            (0.0),
+   theFocalOffset         (0.0),
+   theScanSkewCorr        (0.0),
+   theAdjLsrToEcfRot      (3, 3),
+   theAdjEcfToLsrRot      (3, 3)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
+
+   initAdjustableParameters();
+   ossimKeywordlist kwl (init_file);
+   loadState(kwl);
+
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: Exited..." << std::endl;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimFcsiModel(kwl)
+//  
+//  Constructs model from keywordlist geometry file
+//  
+//*****************************************************************************
+ossimFcsiModel::ossimFcsiModel(const ossimKeywordlist& geom_kwl)
+   :
+   ossimSensorModel       (),
+   thePrincipalPoint      (0, 0),
+   theScanSkew            (0.0),  
+   theScanRotation        (0.0),
+   theOpticalDistortion   (0),
+   theLsrToEcfRot         (3, 3),
+   theEcfOffset           (0, 0, 0),
+   theXrotCorr            (0.0),
+   theYrotCorr            (0.0),
+   theZrotCorr            (0.0),
+   theFocalOffset         (0.0),
+   theScanSkewCorr        (0.0),
+   theAdjLsrToEcfRot      (3, 3),
+   theAdjEcfToLsrRot      (3, 3)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
+
+   initAdjustableParameters();
+   loadState(geom_kwl);
+
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: Exited..." << std::endl;
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: 
+//*****************************************************************************
+ossimFcsiModel::ossimFcsiModel(const ossimFcsiModel& foxy)
+   :
+   ossimSensorModel     (foxy),
+   thePrincipalPoint    (foxy.thePrincipalPoint),
+   theScanSkew          (foxy.theScanSkew),  
+   theScanRotation      (foxy.theScanRotation),
+   theFocalLen          (foxy.theFocalLen),
+   thePlatformPos       (foxy.thePlatformPos),
+   theLsrToEcfRot       (foxy.theLsrToEcfRot),
+   theEcfOffset         (foxy.theEcfOffset),
+   theXrotCorr          (foxy.theXrotCorr),
+   theYrotCorr          (foxy.theYrotCorr),
+   theZrotCorr          (foxy.theZrotCorr),
+   theFocalOffset       (foxy.theFocalOffset),
+   theScanSkewCorr      (foxy.theScanSkewCorr)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
+
+   if(foxy.theOpticalDistortion)
+   {
+      //
+      // Finish the copy:
+      //
+      theOpticalDistortion =
+         new ossimRadialDecentLensDistortion (*(foxy.theOpticalDistortion));
+   }
+
+   for (int i=0; i<4; i++)
+      theScanScaleMatrix[i] = foxy.theScanScaleMatrix[i];
+
+   //***
+   // Compute quantities derived from adjustables:
+   //***
+   updateModel();
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  METHOD: ossimFcsiModel::lineSampleHeightToWorld()
+//  
+//  Performs the line/sample to groundpoint projection given an elevation.
+//
+//  1. Compute ECF Imaging ray (see imagingRay() method below)
+//  5. Intersect imaging ray with elevation surface.
+//
+//*****************************************************************************
+void ossimFcsiModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                             const double&   height,
+                                             ossimGpt&       gpt) const
+{
+   bool debug = false;  // setable via interactive debugger
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: entering..." << std::endl;
+   
+   //***
+   // Extrapolate if point is outside image:
+   //***
+   if (!insideImage(image_point))
+   {
+      gpt = extrapolate(image_point, height);
+   }
+
+   else
+   {
+      //***
+      // First establish imaging ray from image point:
+      //***
+      ossimEcefRay imaging_ray;
+      imagingRay(image_point, imaging_ray);
+      ossimEcefPoint Pecf (imaging_ray.intersectAboveEarthEllipsoid(height));
+      gpt = ossimGpt(Pecf);
+
+      if (traceDebug() || debug)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "Pecf = " << Pecf << std::endl;
+         ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
+      }
+   }
+
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::ossimFcsiModel: returning..." << std::endl;
+}
+   
+   
+//*****************************************************************************
+//  METHOD: ossimFcsiModel::imagingRay()
+//
+//  Establishes an origin (at the platform position) and direction of the
+//  imaging ray as follows:
+//
+//  1. Remove any pixel offset into the image (in the case where the digital
+//     image is a sub-image of a larger scan).
+//  2. Transform pixel coordinates to film point (with inherent lens distortion)
+//  3. Remove radial and decentering lens distortion to arrive at ideal film
+//     coordinates.
+//  4. Establish an internal imaging ray direction vector given the focal length
+//  5. Transform ray direction vector to ECF coordinates and assign origin.
+//
+//*****************************************************************************
+void ossimFcsiModel::imagingRay(const ossimDpt& image_point,
+                                ossimEcefRay&   image_ray) const
+{
+   bool debug = false;  // setable via interactive debugger: "set debug = true"
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: entering..." << std::endl;
+   
+   //***
+   // In case this is a sub-image of a full image scan, need to add the
+   // sub-image offset maintained in the base-class:
+   //***
+   ossimDpt p0 (image_point + theSubImageOffset);
+
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theSubImageOffset = " << theSubImageOffset << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "p0 = " << p0 << std::endl;
+   }
+   
+   //***
+   // Apply pixel to film coordinates affine transform:
+   //***
+   ossimDpt p1 (p0 - theRefImgPt);
+   ossimDpt f1 (theScanXformMatrix[0]*p1.x + theScanXformMatrix[1]*p1.y,
+                theScanXformMatrix[2]*p1.x + theScanXformMatrix[3]*p1.y);
+   ossimDpt film (f1 - thePrincipalPoint);
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theRefImgPt = " << theRefImgPt << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "p1 = " << p1 << std::endl;
+      for (int i=0; i<4; i++)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "theScanXformMatrix["<<i<<"] = "<<theScanXformMatrix[i] << std::endl;
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG) << "f1 = " << f1 << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "thePrincipalPoint = " << thePrincipalPoint << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "film (distorted) = " << film << std::endl;
+   }
+
+   //***
+   // Correct film point for optical (radial, decentering) distortion:
+   //***
+   if (theOpticalDistortion)
+      theOpticalDistortion->inverse(film);
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "film (undistorted) = " << film << std::endl;
+      if(theOpticalDistortion)
+      {
+         theOpticalDistortion->print(ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+   }
+   
+   //***
+   // Establish image ray in  camera-space (LSR) coordinates, then rotate to the
+   // ECF. This rotation contains interior orientation, exterior orientation,
+   // and attitude correction:
+   //***
+   ossimColumnVector3d cam_ray_dir (film.x, film.y, -theAdjFocalLen);
+   ossimEcefVector ecf_ray_dir (theAdjLsrToEcfRot*cam_ray_dir);
+   ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjFocalLen = " << theAdjFocalLen << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "cam_ray_dir = " << cam_ray_dir << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjLsrToEcfRot = \n" << theAdjLsrToEcfRot << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ecf_ray_dir = " << ecf_ray_dir << std::endl;
+   }
+   
+   //***
+   // Establish ECF Ray object to represent imaging ray:
+   //***
+   image_ray.setOrigin(theAdjPlatformPos);
+   image_ray.setDirection(ecf_ray_dir);
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjPlatformPos = " << theAdjPlatformPos << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjPlatformPos (ossimGpt): " << ossimGpt(theAdjPlatformPos)
+                                          << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "image_ray = " << image_ray << std::endl;
+   }
+
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  METHOD ossimFcsiModel::worldToLineSample()
+//
+//  Rigorous inverse transform overrides base-class iterative solution. It
+//  implements the exact reverse transform as imagingRay() above.
+//  
+//*****************************************************************************
+void ossimFcsiModel::worldToLineSample(const ossimGpt& world_point,
+                                       ossimDpt&       image_point) const
+{
+   bool debug = false;  // setable via interactive debugger: "set debug = true"
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: entering..." << std::endl;
+
+   //***
+   // Establish ECF ray from platform to ground point and rotate to platform LSR
+   //***
+   ossimEcefPoint g_ecf (world_point);
+   ossimEcefVector ecf_ray_dir (g_ecf - theAdjPlatformPos);
+   ossimColumnVector3d cam_ray_dir (theAdjEcfToLsrRot*ecf_ray_dir.data());
+
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"world_point = " << world_point << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"g_ecf = " << g_ecf << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjPlatformPos = " << theAdjPlatformPos << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjPlatformPos (ossimGpt): "<<ossimGpt(theAdjPlatformPos)<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"ecf_ray_dir = " << ecf_ray_dir.unitVector() << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"theAdjEcfToLsrRot = \n" << theAdjEcfToLsrRot << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"cam_ray_dir = " << cam_ray_dir << endl;
+   }
+      
+   //***
+   // Scale the direction vector by the focal length to arrive at  film
+   // coordinates:
+   //***
+   double scale = -theAdjFocalLen/cam_ray_dir[2];
+   ossimDpt film (scale*cam_ray_dir[0], scale*cam_ray_dir[1]);
+
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theAdjFocalLen = " << theAdjFocalLen << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "scale = " << scale << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "film (undistorted) = " << film << endl;
+   }
+      
+   //***
+   // Add distortion:
+   //***
+   if (theOpticalDistortion)
+      theOpticalDistortion->forward(film);
+   
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "film (distorted) = " << film << endl;
+   }
+      
+   //***
+   // Apply film to pixel coordinates affine transform:
+   //***
+   ossimDpt f1(film + thePrincipalPoint);
+   ossimDpt p1(theInvScanXformMatrix[0]*f1.x+theInvScanXformMatrix[1]*f1.y,
+               theInvScanXformMatrix[2]*f1.x+theInvScanXformMatrix[3]*f1.y);
+   ossimDpt p0 (p1 + theRefImgPt);
+
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "thePrincipalPoint = " << thePrincipalPoint << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "f1 = " << f1 << endl;
+      for (int i=0; i<4; i++)
+         ossimNotify(ossimNotifyLevel_DEBUG)<<"theInvScanXformMatrix["<<i<<"] = "<<theInvScanXformMatrix[i]
+             <<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "p1 = " << p1 << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theRefImgPt = " << theRefImgPt << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "p0 = " << p0 << endl;
+   }
+      
+   //***
+   // Finally, apply the sub-image offset to get to digital image coordinates:
+   //***
+   image_point = p0 - theSubImageOffset;
+   
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "theImageOffset = " << theSubImageOffset << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << endl;
+   }
+   
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::imagingRay: returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimFcsiModel::print()
+//  
+//  Formatted dump of data members.
+//  
+//*****************************************************************************
+std::ostream& ossimFcsiModel::print(std::ostream& out) const
+{
+   out << "\nDump of ossimFcsiModel object at " << hex << this << ":\n"
+       << "\nossimFcsiModel data members: "
+       << "\n        thePrincipalPoint: " << thePrincipalPoint
+       << "\n        theScanScaleMatrix: " << theScanScaleMatrix[0] << "  "
+       << theScanScaleMatrix[1]
+       << "\n                            " << theScanScaleMatrix[2] << "  "
+       << theScanScaleMatrix[3]
+       << "\n          theScanSkew: " << theScanSkew
+       << "\n      theScanRotation: " << theScanRotation;
+
+   for (int i=0; i<4; ++i)
+   {
+      out << "\ntheScanXformMatrix["<<i<<"]: " << theScanXformMatrix[i];
+   }
+
+   out << "\n          theFocalLen: " << theFocalLen
+       << "\n       thePlatformPos: " << thePlatformPos
+       << "\n       theLsrToEcfRot: \n"  << theLsrToEcfRot
+       << "\n    theAdjLsrToEcfRot: \n" << theAdjLsrToEcfRot
+       << "\n         theEcfOffset: " << theEcfOffset
+       << "\n          theXrotCorr: " << theXrotCorr
+       << "\n          theYrotCorr: " << theYrotCorr
+       << "\n          theZrotCorr: " << theZrotCorr
+       << "\n       theFocalOffset: " << theFocalOffset
+       << "\n      theScanSkewCorr: " << theScanSkewCorr
+       << endl;
+   
+   if (theOpticalDistortion)
+   {
+      out << *theOpticalDistortion << endl;
+   }
+
+   return ossimSensorModel::print(out);
+}
+
+//*****************************************************************************
+//  METHOD: ossimFcsiModel::saveState()
+//  
+//  Saves the model state to the KWL. This KWL also serves as a geometry file.
+//  
+//*****************************************************************************
+bool ossimFcsiModel::saveState(ossimKeywordlist& kwl,
+                              const char* prefix) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: entering..." << std::endl;
+
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, "ossimFcsiModel");
+
+   //***
+   // Hand off to base class for common stuff:
+   //***
+   ossimSensorModel::saveState(kwl, prefix);
+
+   //***
+   // Save off data members:
+   //***
+   kwl.add(prefix, PRINCIPAL_POINT_X_KW,    thePrincipalPoint.x);
+   kwl.add(prefix, PRINCIPAL_POINT_Y_KW,    thePrincipalPoint.y);
+   kwl.add(prefix, SCAN_SCALE_MATRIX_00_KW, theScanScaleMatrix[0]);
+   kwl.add(prefix, SCAN_SCALE_MATRIX_01_KW, theScanScaleMatrix[1]);
+   kwl.add(prefix, SCAN_SCALE_MATRIX_10_KW, theScanScaleMatrix[2]);
+   kwl.add(prefix, SCAN_SCALE_MATRIX_11_KW, theScanScaleMatrix[3]);
+   kwl.add(prefix, SCAN_SKEW_ANGLE_KW,      theScanSkew);
+   kwl.add(prefix, SCAN_ROTATION_ANGLE_KW,  theScanRotation);
+   kwl.add(prefix, FOCAL_LENGTH_KW,         theFocalLen);
+   kwl.add(prefix, PLATFORM_POSITION_X_KW,
+           thePlatformPos.x());
+   kwl.add(prefix, PLATFORM_POSITION_Y_KW,
+           thePlatformPos.y());
+   kwl.add(prefix, PLATFORM_POSITION_Z_KW,
+           thePlatformPos.z());
+
+   //***
+   // Camera orientation matrix:
+   // i is row and j is column
+   //***
+   for (int i=0; i<3; i++)
+   {
+      for (int j=0; j<3; j++)
+      {
+         ostringstream ostr;
+         ostr << CAMERA_ORIENTATION_MATRIX_ELEM_KW
+              << i << "_" << j << ends;
+         kwl.add(prefix, ostr.str().c_str(), theLsrToEcfRot[i][j]);
+      }
+   }
+   
+   //***
+   // Optical distortion coefficients:
+   //***
+   if (theOpticalDistortion)
+   {
+      ostringstream ostr;
+      ostr << prefix << "distortion." << ends;
+      theOpticalDistortion->saveState(kwl, ostr.str().c_str());
+   }
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: returning..." << std::endl;
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimFcsiModel::loadState()
+//  
+//  Restores the model's state from the KWL. This KWL also serves as a
+//  geometry file.
+//  
+//*****************************************************************************
+bool ossimFcsiModel::loadState(const ossimKeywordlist& kwl,
+                               const char* prefix) 
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::loadState: entering..." << std::endl;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG:"
+                                          << "\nInput kwl:  " << kwl
+                                          << std::endl;
+   }
+
+   const char* value;
+   const char* keyword;
+   bool success;
+
+   //***
+   // Assure this keywordlist contains correct type info:
+   //***
+   keyword = ossimKeywordNames::TYPE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "Type name not found");
+      return false;
+      
+   }
+   if (strcmp(value, TYPE_NAME(this)))
+   {
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::saveState: returning..." << std::endl;
+      return false;
+   }
+      
+   //***
+   // Clear out any existing adjustable params:
+   //***
+   
+   //***
+   // Pass on to the base-class for parsing first:
+   //***
+   success = ossimSensorModel::loadState(kwl, prefix);
+   if (!success)
+   {
+      return false;
+   }
+   if(!getNumberOfAdjustableParameters())
+   {
+      initAdjustableParameters();
+   }
+
+   //***
+   // Now begin loading data members:
+   //***
+   keyword = PRINCIPAL_POINT_X_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "principle point x not given");
+      return false;
+   }
+   thePrincipalPoint.x = atof(value);
+ 
+   keyword = PRINCIPAL_POINT_Y_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "principle point y not given");
+      return false;
+   }
+      
+   thePrincipalPoint.y = atof(value);
+ 
+   keyword = SCAN_SCALE_MATRIX_00_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "scale matrix 0,0 not given");
+      return false;
+   }
+   theScanScaleMatrix[0] = atof(value);
+ 
+   keyword = SCAN_SCALE_MATRIX_01_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "scale matrix 0,1 not given");
+      return false;
+   }
+   theScanScaleMatrix[1] = atof(value);
+ 
+   keyword = SCAN_SCALE_MATRIX_10_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "scale matrix 1,0 not given");
+      return false;
+   }
+   theScanScaleMatrix[2] = atof(value);
+ 
+   keyword = SCAN_SCALE_MATRIX_11_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "scale matrix 1,1 not given");
+      return false;
+   }
+   theScanScaleMatrix[3] = atof(value);
+ 
+   keyword = SCAN_SKEW_ANGLE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+      theScanSkew = 0.0;
+   else
+      theScanSkew = atof(value);
+
+   keyword = SCAN_ROTATION_ANGLE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+      theScanRotation = 0.0;
+   else
+      theScanRotation = atof(value);
+ 
+   keyword = FOCAL_LENGTH_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "Focal length not given");
+      return false;
+   }
+   theFocalLen = atof(value);
+ 
+   keyword = PLATFORM_POSITION_X_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "Platform position X not given");
+      return false;
+   }
+   thePlatformPos.x() = atof(value);
+ 
+   keyword = PLATFORM_POSITION_Y_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "Platform position Y not given");
+   }
+   thePlatformPos.y() = atof(value);
+ 
+   keyword = PLATFORM_POSITION_Z_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimSetError(getClassName(),
+                    ossimErrorCodes::OSSIM_ERROR,
+                    "Platform position Z not given");
+   }
+   thePlatformPos.z() = atof(value);
+   
+   //***
+   // Platform orientation matrix:
+   //***
+   for (int i=0; i<3; i++)
+   {
+      for (int j=0; j<3; j++)
+      {
+         ostringstream ostr;
+         ostr << CAMERA_ORIENTATION_MATRIX_ELEM_KW
+              << i << "_" << j << ends;
+         ossimString s = ostr.str();
+         keyword = s.c_str();
+         value = kwl.find(prefix, keyword);
+         if (!value)
+         {
+            ossimSetError(getClassName(),
+                          ossimErrorCodes::OSSIM_ERROR,
+                          "Camera orientation matrix not given");
+         }
+         theLsrToEcfRot[i][j] = ossimString(value).toDouble();
+      }
+   }
+   
+   //***
+   // Reading of optical distortion coefficients is left to the service object:
+   //***
+   if (theOpticalDistortion)
+      delete theOpticalDistortion;
+   theOpticalDistortion = new ossimRadialDecentLensDistortion(kwl, prefix);
+
+   //***
+   // Initialize given parameters read:
+   //***
+   clearErrorStatus();
+   updateModel();
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::loadState: returning..." << std::endl;
+   return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimFcsiModel::updateModel()
+//
+// Following a parameter adjustment, this method is called to recompute all
+// dependent quantities that are used by the projection methods.
+// 
+//*****************************************************************************
+void  ossimFcsiModel::updateModel()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::updateModel: entering..." << std::endl;
+   
+   //***
+   // Update the geometry...
+   // Adjusted = Initial + adj_parm[i]*adj_sigma[i]
+   // Some parameters have a zero initial value and that term is not included.
+   //***
+   theEcfOffset.x() = getAdjustableParameter(X_POS) *
+                      getParameterSigma(X_POS);
+   theEcfOffset.y() = getAdjustableParameter(Y_POS) *
+                      getParameterSigma(Y_POS);
+   theEcfOffset.z() = getAdjustableParameter(Z_POS) *
+                      getParameterSigma(Z_POS);
+   theXrotCorr      = getAdjustableParameter(X_ROT) *
+                      getParameterSigma(X_ROT);
+   theYrotCorr      = getAdjustableParameter(Y_ROT) *
+                      getParameterSigma(Y_ROT);
+   theZrotCorr      = getAdjustableParameter(Z_ROT) *
+                      getParameterSigma(Z_ROT);
+   theFocalOffset   = getAdjustableParameter(FOCAL_LEN) *
+                      getParameterSigma(FOCAL_LEN);
+   theScanSkewCorr  = getAdjustableParameter(SCAN_SKEW) *
+                      getParameterSigma(SCAN_SKEW);
+
+   //***
+   // Compute adjusted quatities used in projection code:
+   //***
+   theAdjFocalLen    = theFocalLen    + theFocalOffset;
+   theAdjPlatformPos = thePlatformPos + theEcfOffset;
+   
+   //***
+   // Establish the Scanner to film transform matrix.
+   //
+   // NOTE FOR IMPLEMENTING PARAMETER ADJUSTMENT: while the scan skew
+   // angle is an adjustable parameter, the pixel scaling is not since this
+   // error can be absorbed by the focal length adjustment, though the sigma
+   // for the focal length must be inflated to account for the additional error
+   // source. A similar situation occurrs with the scan rotation which manifests
+   // as an attitude adjustment.
+   //***
+   double cos_rot  = ossim::cosd(theScanRotation);
+   double sin_rot  = ossim::sind(theScanRotation);
+   double tan_skew = ossim::tand(theScanSkew + theScanSkewCorr);
+
+   double a =  theScanScaleMatrix[0]*(sin_rot*tan_skew + cos_rot) +
+               theScanScaleMatrix[1]*(cos_rot*tan_skew - sin_rot);
+   double b =  theScanScaleMatrix[0]*sin_rot + theScanScaleMatrix[1]*cos_rot;
+   double c =  theScanScaleMatrix[2]*(sin_rot*tan_skew + cos_rot) +
+               theScanScaleMatrix[3]*(cos_rot*tan_skew - sin_rot);
+   double d =  theScanScaleMatrix[2]*sin_rot + theScanScaleMatrix[3]*cos_rot;
+
+   theScanXformMatrix[0] = a;
+   theScanXformMatrix[1] = b;
+   theScanXformMatrix[2] = c;
+   theScanXformMatrix[3] = d;
+
+   //***
+   // The inverse of the scanner-to-film transform must be computed since it is
+   // not an orthogonal matrix (inverse != transpose):
+   //***
+   theInvScanXformMatrix[0] =  d/(d*a - b*c);
+   theInvScanXformMatrix[1] = -b/(d*a - b*c);
+   theInvScanXformMatrix[2] =  c/(b*c - a*d);
+   theInvScanXformMatrix[3] = -a/(b*c - a*d);
+
+   //***
+   // Establish the differential rotation matrix due to attitude correction:
+   //***
+   double cw = ossim::cosd(theXrotCorr);
+   double sw = ossim::sind(theXrotCorr);
+   double cp = ossim::cosd(theYrotCorr);
+   double sp = ossim::sind(theYrotCorr);
+   double ck = ossim::cosd(theZrotCorr);
+   double sk = ossim::sind(theZrotCorr);
+
+   NEWMAT::Matrix attitudeCorrection(3, 3);
+   attitudeCorrection(1,1) =  ck*cw - sk*sp*sw;
+   attitudeCorrection(1,2) =  sk*cp;
+   attitudeCorrection(1,3) =  ck*sw + sk*sp*cw;
+   attitudeCorrection(2,1) = -sk*cw - ck*sp*sw;
+   attitudeCorrection(2,2) =  cp*ck;
+   attitudeCorrection(2,3) = -sk*sw + ck*sp*cw;
+   attitudeCorrection(3,1) = -cp*sw;
+   attitudeCorrection(3,2) = -sp;
+   attitudeCorrection(3,3) =  cp*cw;
+
+   //***
+   // Now compute the final LSR to ECF rotation:
+   //***
+   theAdjLsrToEcfRot = attitudeCorrection * theLsrToEcfRot;
+   theAdjEcfToLsrRot = theAdjLsrToEcfRot.t();
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::updateModel: returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimFcsiModel::initAdjustableParameters()
+//  
+//  This method initializes the base class adjustable parameter and associated
+//  sigmas arrays with quantities specific to this model. These are default
+//  values only. A functional implementation would assign the sigmas via a
+//  keywordlist or camera specific derived class.
+//  
+//*****************************************************************************
+void ossimFcsiModel::initAdjustableParameters()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::initAdjustableParameters: entering..." << std::endl;
+
+   int numParams = NUM_ADJUSTABLE_PARAMS;
+   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
+   
+//   if(!getNumberOfAdjustableParameters())
+///   {
+   //***
+   // Allocate storage for adjustables and assign their names and units strings
+   //***
+//      newAdjustment(NUM_ADJUSTABLE_PARAMS);
+//   }
+   //***
+   // Initialize base-class adjustable parameter array:
+   //***
+   for (int i=0; i<numParams; i++)
+   {
+      setAdjustableParameter(i, 0.0);
+      setParameterDescription(i, PARAM_NAMES[i]);
+      setParameterUnit(i, PARAM_UNITS[i]);
+   }
+   
+   //***
+   // Initialize base-class parameter sigma array:
+   //***
+   setParameterSigma(X_POS, 50.0);
+   setParameterSigma(Y_POS, 50.0);
+   setParameterSigma(Z_POS, 50.0);  
+   setParameterSigma(X_ROT, 0.01);
+   setParameterSigma(Y_ROT, 0.01);
+   setParameterSigma(Z_ROT, 0.01);
+   setParameterSigma(FOCAL_LEN,0.005);  
+   setParameterSigma(SCAN_SKEW, 0.001);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::initAdjustableParameters: returning..." << std::endl;
+}
+
+//*****************************************************************************
+// STATIC METHOD: ossimFcsiModel::writeGeomTemplate
+//  
+//  Writes a sample kwl to output stream. Please update this method with any
+//  format and/or keyword changes. It will make life a lot easier for everyone.
+//  
+//*****************************************************************************
+void ossimFcsiModel::writeGeomTemplate(ostream& os)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::writeGeomTemplate: entering..." << std::endl;
+
+   os <<
+      "//*****************************************************************\n"
+      "// Template for Frame Camera Scanned Image (FCSI) model keywordlist\n"
+      "//*****************************************************************\n"
+      << ossimKeywordNames::TYPE_KW << ": " << "ossimFcsiModel" << endl;
+
+   ossimSensorModel::writeGeomTemplate(os);
+   
+   os << "//***\n"
+      << "// Derived-class FCSI Keywords:\n"
+      << "//***\n"
+      << PRINCIPAL_POINT_X_KW << ": <pixels>\n"
+      << PRINCIPAL_POINT_Y_KW << ": <pixels>\n"
+      << SCAN_SCALE_MATRIX_00_KW << ": <mm/pixel>\n"
+      << SCAN_SCALE_MATRIX_01_KW << ": <mm/pixel>\n"
+      << SCAN_SCALE_MATRIX_10_KW << ": <mm/pixel>\n"
+      << SCAN_SCALE_MATRIX_11_KW << ": <mm/pixel>\n"
+      << SCAN_SKEW_ANGLE_KW << ": <degrees> [OPTIONAL]\n"
+      << SCAN_ROTATION_ANGLE_KW << ": <degrees> [OPTIONAL]\n"
+      << FOCAL_LENGTH_KW << ": <millimeters>\n"
+      << PLATFORM_POSITION_X_KW << ": <meters (ECF)>\n"
+      << PLATFORM_POSITION_Y_KW << ": <meters (ECF)>\n"
+      << PLATFORM_POSITION_Z_KW << ": <meters (ECF)>\n"
+      << "\n"
+      << "//***\n"
+      << "// Camera (LSR) to ECF orientation matrix:\n"
+      << "//***\n";
+   
+   for (int i=0; i<3; i++)
+   {
+      for (int j=0; j<3; j++)
+      {
+         ostringstream ostr;
+         ostr << CAMERA_ORIENTATION_MATRIX_ELEM_KW
+              << i << "_" << j << ends;
+         os << ostr.str() << ": <Euler rot matrix element>\n";
+      }
+   }
+
+   os << "\n"
+      << "//***\n"
+      << "// Optical distortion coefficients [OPTIONAL]:\n"
+      << "//***\n"
+      << "distortion."
+      << ossimRadialDecentLensDistortion::RADIAL_DISTORTION_COEFF_KW
+      << "N: <coeff N> (for N <= 5)\n"
+      << "distortion."
+      << ossimRadialDecentLensDistortion::DECENT_DISTORTION_COEFF_KW
+      << "N: <coeff N> (for N <= 4)\n"
+      << endl;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimFcsiModel::writeGeomTemplate: returning..." << std::endl;
+   
+   return;
+}
+
+
diff --git a/ossim/src/ossim/projection/ossimGnomonicProjection.cpp b/src/projection/ossimGnomonicProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimGnomonicProjection.cpp
rename to src/projection/ossimGnomonicProjection.cpp
diff --git a/src/projection/ossimGoogleProjection.cpp b/src/projection/ossimGoogleProjection.cpp
new file mode 100644
index 0000000..49892d0
--- /dev/null
+++ b/src/projection/ossimGoogleProjection.cpp
@@ -0,0 +1,124 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//
+//*******************************************************************
+#include <ossim/projection/ossimGoogleProjection.h>
+
+RTTI_DEF1(ossimGoogleProjection, "ossimGoogleProjection", ossimMapProjection)
+
+
+//***************** THIS CODE WAS PULLED FROM THE INTERNET FOR GLOBAL MERCATOR ******
+// I will leave as is without modifications
+//
+#define deg2rad(d) (((d)*M_PI)/180)
+#define rad2deg(d) (((d)*180)/M_PI)
+#define earth_radius 6378137
+ 
+/* The following functions take or return there results in degrees */
+ 
+double y2lat_d(double y) { return rad2deg(2 * atan(exp(  deg2rad(y) ) ) - M_PI/2); }
+double x2lon_d(double x) { return x; }
+double lat2y_d(double lat) { return rad2deg(log(tan(M_PI/4+ deg2rad(lat)/2))); }
+double lon2x_d(double lon) { return lon; }
+ 
+/* The following functions take or return there results in something close to meters, along the equator */
+ 
+double y2lat_m(double y) { return rad2deg(2 * atan(exp( (y / earth_radius ) )) - M_PI/2); }
+double x2lon_m(double x) { return rad2deg(x / earth_radius); }
+double lat2y_m(double lat) { return earth_radius * log(tan(M_PI/4+ deg2rad(lat)/2)); }
+double lon2x_m(double lon) { return deg2rad(lon) * earth_radius; }
+
+//******************** END GLOBAL MERCATOR CODE ***********************
+
+ossimGoogleProjection::ossimGoogleProjection(const ossimEllipsoid& ellipsoid,
+                                           const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   thePcsCode = 3857;
+   update();
+}
+ossimGoogleProjection::ossimGoogleProjection(const ossimGoogleProjection& src)
+   :ossimMapProjection(src)
+{
+   thePcsCode = 3857;
+   update();
+}
+   
+ossimGoogleProjection::~ossimGoogleProjection()
+{
+
+}
+
+void ossimGoogleProjection::update()
+{
+   ossimMapProjection::update();
+}
+
+ossimGpt ossimGoogleProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   /*
+	double lon = (eastingNorthing.x / 20037508.34) * 180.0;
+	double lat = (eastingNorthing.y / 20037508.34) * 180.0;
+
+  	lat = 180.0/M_PI * (2.0 * atan(exp(lat * M_PI / 180)) - M_PI / 2.0);
+
+   return ossimGpt(lat, lon, 0, theDatum);  
+   */
+   //return ossimGpt(merc_lat(eastingNorthing.y), merc_lon(eastingNorthing.x), 0, theDatum);
+   return ossimGpt(y2lat_m(eastingNorthing.y), x2lon_m(eastingNorthing.x), 0, theDatum);
+}
+
+ossimDpt ossimGoogleProjection::forward(const ossimGpt &latLon)const
+{
+   /*
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+   //double y = Math.Log(Math.Tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
+   easting = gpt.lond()*20037508.34/180.0;
+   northing = log(tan((90.0 + gpt.latd())*M_PI/360.0))/(M_PI/180.0);
+   northing *=20037508.34/180.0;
+
+   return ossimDpt(easting, northing);
+   */
+
+   return ossimDpt(lon2x_m(latLon.lond()), lat2y_m(latLon.latd()));
+}
+
+bool ossimGoogleProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimGoogleProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   thePcsCode = 3857;
+   // Must do this first.
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+   
+   update();
+   return flag;
+}
+
+bool ossimGoogleProjection::operator==(const ossimProjection& projection) const
+{
+   if (!ossimMapProjection::operator==(projection))
+      return false;
+
+   const ossimGoogleProjection* p = dynamic_cast<const ossimGoogleProjection*>(&projection);
+
+   return (p != 0);
+}
+
diff --git a/src/projection/ossimIkonosRpcModel.cpp b/src/projection/ossimIkonosRpcModel.cpp
new file mode 100644
index 0000000..e509eb1
--- /dev/null
+++ b/src/projection/ossimIkonosRpcModel.cpp
@@ -0,0 +1,984 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class ossimIkonosRpcModel. This 
+//    derived class implements the capability of reading Ikonos RPC support
+//    data.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimIkonosRpcModel.cpp 23323 2015-05-27 12:53:00Z gpotts $
+
+#include <cstdlib>
+#include <ossim/projection/ossimIkonosRpcModel.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/base/ossimTrace.h>
+
+
+RTTI_DEF1(ossimIkonosRpcModel, "ossimIkonosRpcModel", ossimRpcModel);
+
+//***
+// Define Trace flags for use within this file:
+//***
+static ossimTrace traceExec  ("ossimIkonosRpcModel:exec");
+static ossimTrace traceDebug ("ossimIkonosRpcModel:debug");
+
+const ossimFilename INIT_RPC_GEOM_FILENAME ("rpc_init.geom");
+
+static const char* MODEL_TYPE        = "ossimIkonosRpcModel";
+static const char* META_DATA_FILE    = "meta_data_file";
+static const char* RPC_DATA_FILE     = "rpc_data_file";
+static const char* LINE_OFF_KW       = "LINE_OFF";
+static const char* SAMP_OFF_KW       = "SAMP_OFF";
+static const char* LAT_OFF_KW        = "LAT_OFF";
+static const char* LONG_OFF_KW       = "LONG_OFF";
+static const char* HEIGHT_OFF_KW     = "HEIGHT_OFF";
+static const char* LINE_SCALE_KW     = "LINE_SCALE";
+static const char* SAMP_SCALE_KW     = "SAMP_SCALE";
+static const char* LAT_SCALE_KW      = "LAT_SCALE";
+static const char* LONG_SCALE_KW     = "LONG_SCALE";
+static const char* HEIGHT_SCALE_KW   = "HEIGHT_SCALE";
+static const char* LINE_NUM_COEFF_KW = "LINE_NUM_COEFF_";
+static const char* LINE_DEN_COEFF_KW = "LINE_DEN_COEFF_";
+static const char* SAMP_NUM_COEFF_KW = "SAMP_NUM_COEFF_";
+static const char* SAMP_DEN_COEFF_KW = "SAMP_DEN_COEFF_";
+
+
+ossimIkonosRpcModel::ossimIkonosRpcModel()
+   :ossimRpcModel(),
+    theSupportData(new ossimIkonosMetaData())
+{
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimIkonosRpcModel
+//  
+//  Constructs given a geometry file that specifies the filenames for the
+//  metadata and RPC data files.
+//  
+//*****************************************************************************
+ossimIkonosRpcModel::ossimIkonosRpcModel(const ossimFilename& geom_file)
+   :  ossimRpcModel(),
+      theSupportData(new ossimIkonosMetaData())
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel Constructor #1: entering..."
+         << std::endl;
+   }
+
+   ossimKeywordlist kwl(geom_file);
+   const char* value;
+   
+   //***
+   // Assure this keywordlist contains correct type info:
+   //***
+   value = kwl.find(ossimKeywordNames::TYPE_KW);
+   if (!value || (strcmp(value, "ossimIkonosRpcModel")))
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG  ossimIkonosRpcModel Constructor #1:"
+            << "\nFailed attempt to construct. sensor type \""<<value
+            << "\" does not match \"ossimIkonosRpcModel\"." << std::endl;
+      }
+
+      theErrorStatus++;
+      if (traceExec())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG  ossimIkonosRpcModel Constructor #1: returning..."
+            << std::endl;
+      }
+      return;
+   }
+
+   //***
+   // Read meta data filename from geom file:
+   //***
+   value = kwl.find(META_DATA_FILE);
+   if (!value)
+   {
+      theErrorStatus++;
+      if (traceExec())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimIkonosRpcModel Constructor #1: returning..."
+            << std::endl;
+      }
+      return;
+   }
+
+   ossimFilename metadata (value);
+
+   //***
+   // Read RPC data filename from geom file:
+   //***
+   value = kwl.find(RPC_DATA_FILE);
+   if (!value)
+   {
+      theErrorStatus++;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG  ossimIkonosRpcModel Constructor #1: returning..." << std::endl;
+      return;
+   }
+   ossimFilename rpcdata (value);
+
+   parseMetaData(metadata);
+   parseRpcData (rpcdata);
+   finishConstruction();
+
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+   geom_file.split(drivePart,
+                   pathPart,
+                   filePart,
+                   extPart);
+
+   
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG returning..." << std::endl;
+   
+   return;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimIkonosRpcModel
+//  
+//  Constructs given filenames for metadata and RPC data.
+//  
+//*****************************************************************************
+ossimIkonosRpcModel::ossimIkonosRpcModel(const ossimFilename& metadata,
+                                         const ossimFilename& rpcdata)
+   :
+   ossimRpcModel(),
+   theSupportData(new ossimIkonosMetaData())
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #2: entering..." << std::endl;
+
+   parseMetaData(metadata);
+   parseRpcData (rpcdata);
+   finishConstruction();
+
+   //***
+   // Save current state in RPC model format:
+   //***
+   ossimString drivePart;
+   ossimString pathPart;
+   ossimString filePart;
+   ossimString extPart;
+   metadata.split(drivePart,
+                  pathPart,
+                  filePart,
+                  extPart);
+   
+   ossimFilename init_rpc_geom;
+   init_rpc_geom.merge(drivePart,
+                       pathPart,
+                       INIT_RPC_GEOM_FILENAME,
+                       "");
+//      (metadata.path().dirCat(ossimRpcModel::INIT_RPC_GEOM_FILENAME));
+   ossimKeywordlist kwl (init_rpc_geom);
+   saveState(kwl);
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel Constructor #2: returning..." << std::endl;
+}
+
+ossimIkonosRpcModel::~ossimIkonosRpcModel()
+{
+   theSupportData = 0;
+}
+
+//*****************************************************************************
+//  METHOD: ossimIkonosRpcModel::finishConstruction()
+//  
+//*****************************************************************************
+void ossimIkonosRpcModel::finishConstruction()
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel finishConstruction(): entering..."
+         << std::endl;
+   }
+
+   //***
+   // Assign other data members:
+   //***
+   thePolyType      = B; // This may not be true for early RPC imagery
+   theRefImgPt.line = theLineOffset;
+   theRefImgPt.samp = theSampOffset;
+   theRefGndPt.lat  = theLatOffset;
+   theRefGndPt.lon  = theLonOffset;
+   theRefGndPt.hgt  = theHgtOffset;
+
+   //***
+   // Assign the bounding image space rectangle:
+   //***
+   theImageClipRect = ossimDrect(0.0, 0.0,
+                                 theImageSize.samp-1, theImageSize.line-1);
+
+   //---
+   // NOTE:  We must call "updateModel()" to set parameter used by base
+   // ossimRpcModel prior to calling lineSampleHeightToWorld or all
+   // the world points will be same.
+   //---
+   updateModel();   
+
+   //***
+   // Assign the bounding ground polygon:
+   //***
+   ossimGpt v0, v1, v2, v3;
+   ossimDpt ip0 (0.0, 0.0);
+   lineSampleHeightToWorld(ip0, 0.0, v0);
+   ossimDpt ip1 (theImageSize.samp-1.0, 0.0);
+   lineSampleHeightToWorld(ip1, 0.0, v1);
+   ossimDpt ip2 (theImageSize.samp-1.0, theImageSize.line-1.0);
+   lineSampleHeightToWorld(ip2, 0.0, v2);
+   ossimDpt ip3 (0.0, theImageSize.line-1.0);
+   lineSampleHeightToWorld(ip3, 0.0, v3);
+   theBoundGndPolygon
+      = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
+
+   //---
+   // Call compute gsd:
+   // 
+   // This will set theGSD and theMeanGSD using lineSampleHeightToWorld on
+   // three image points.  Previously this was pulled from metadata.  Some of
+   // which was in US Survey feet and not converted to meters.  This method
+   // is more accurate as it uses the sensor model to compute.
+   //---
+   try
+   {
+      // Method throws ossimException.
+      computeGsd();
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimIkonosRpcModel finishConstruction Caught Exception:\n"
+         << e.what() << std::endl;
+   }
+   
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel finishConstruction(): returning..."
+         << std::endl;
+   }
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimIkonosRpcModel::parseMetaData()
+//  
+//  Parses the Ikonos metadata file.
+//  
+//*****************************************************************************
+void ossimIkonosRpcModel::parseMetaData(const ossimFilename& data_file)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): entering..."
+         << std::endl;
+   }
+
+   FILE* fptr = fopen (data_file, "r");
+   if (!fptr)
+   {
+      ++theErrorStatus;
+      if (traceExec())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimIkonosRpcModel::parseMetaData(data_file) DEBUG:"
+            << "\nCould not open Meta data file:  " << data_file
+            << "\nreturning with error..." << std::endl;
+      }
+      return;
+   }
+
+   char* strptr;
+   // char linebuf[80];
+   char dummy[80], name[80];
+
+   //***
+   // Read the file into a buffer:
+   //***
+   char filebuf[5000];
+   fread(filebuf, 1, 5000, fptr);
+   
+   //***
+   // Image ID:
+   //***
+   strptr = strstr(filebuf, "\nSource Image ID:");
+   if (!strptr)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << endl;
+      }
+
+      fclose( fptr );
+      fptr = 0;
+      return;
+   }
+      
+   sscanf(strptr, "%17c %s", dummy, name);
+   theImageID = name;
+
+   //***
+   // Sensor Type:
+   //***
+   strptr = strstr(strptr, "\nSensor:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << endl;
+      }
+      fclose(fptr);
+      fptr = 0;
+      return;
+   }
+   sscanf(strptr, "%8c %s", dummy, name);
+   theSensorID = name;
+
+   //***
+   // GSD:  NOTE - this will be recomputed by computeGsd method later.
+   //***
+   strptr = strstr(strptr, "\nPixel Size X:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << endl;
+         
+      }
+      fclose(fptr);
+      fptr = 0;
+      return;
+   }
+   
+   sscanf(strptr, "%14c %lf", dummy, &theGSD.samp);
+   strptr = strstr(strptr, "\nPixel Size Y:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << endl;
+         
+      }
+      fclose(fptr);
+      fptr = 0;
+      return;
+   }
+   sscanf(strptr, "%14c %lf", dummy, &theGSD.line);
+
+   //***
+   // Image size:
+   //***
+   strptr = strstr(strptr, "\nColumns:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << endl;
+      }
+         
+      fclose(fptr);
+      fptr = 0;
+      return;
+   }
+   sscanf(strptr, "%s %d", dummy, &theImageSize.samp);
+   strptr = strstr(strptr, "\nRows:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << endl;
+      }
+
+      fclose(fptr);
+      fptr = 0;
+      return;
+  }
+   sscanf(strptr, "%s %d", dummy, &theImageSize.line);
+           
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): returning..."
+         << std::endl;
+   }
+   fclose(fptr);
+   fptr = 0;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimIkonosRpcModel::parseHdrData()
+//  
+//  Parses the Ikonos hdr file.
+//  
+//*****************************************************************************
+bool ossimIkonosRpcModel::parseHdrData(const ossimFilename& data_file)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): entering..."
+         << std::endl;
+   }
+   
+   if( !data_file.exists() )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
+            << "\nrpc data file <" << data_file << ">. "<< "doesn't exist..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   FILE* fptr = fopen (data_file, "r");
+   if (!fptr)
+   {
+      ++theErrorStatus;
+      
+      if (traceDebug())
+      { 
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
+            << "\nCould not open hdr data file <" << data_file << ">. "
+            << "returning with error..." << std::endl;
+      }
+      return false;
+   }
+
+   char* strptr = 0;
+   // char linebuf[80];
+   char dummy[80];
+   // , name[80];
+
+   //***
+   // Read the file into a buffer:
+   //***
+   char filebuf[5000];
+   fread(filebuf, 1, 5000, fptr);
+
+   //***
+   // GSD:  NOTE - this will be recomputed by computeGsd method later.
+   //***
+   strptr = strstr(filebuf, "\nPixel Size X:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file):"
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed hdr file." << endl;
+      }
+      
+      fclose( fptr ); // cleanup
+      fptr = 0;
+      return false;
+   }
+      
+   sscanf(strptr, "%14c %lf", dummy, &theGSD.samp);
+   strptr = strstr(strptr, "\nPixel Size Y:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed hdr file." << endl;
+      }
+         
+      fclose( fptr ); // cleanup
+      fptr = 0;
+      return false;
+   }
+
+   sscanf(strptr, "%14c %lf", dummy, &theGSD.line);
+
+   //***
+   // Image size:
+   //***
+   strptr = strstr(strptr, "\nColumns:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed hdr file." << endl;
+      }
+         
+      fclose( fptr ); // cleanup
+      fptr = 0;
+      return false;
+   }
+   sscanf(strptr, "%s %d", dummy, &theImageSize.samp);
+   strptr = strstr(strptr, "\nRows:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed hdr file." << endl;
+      }
+      fclose( fptr ); // cleanup
+      fptr = 0;
+      
+      return false;
+   }
+   sscanf(strptr, "%s %d", dummy, &theImageSize.line);
+   
+   fclose( fptr ); // cleanup
+   fptr = 0;
+           
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): returning..."
+         << std::endl;
+   }
+   return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimIkonosRpcModel::parseRpcData()
+//  
+//  Parses the Ikonos RPC data file.
+//  
+//*****************************************************************************
+void ossimIkonosRpcModel::parseRpcData(const ossimFilename& data_file)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): entering..."
+         << std::endl;
+   }
+      
+   if( !data_file.exists() )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseRpcData(data_file) WARN:"
+            << "\nrpc data file <" << data_file << ">. "<< "doesn't exist..."
+            << std::endl;
+      }
+      ++theErrorStatus;
+      return;
+   }
+   
+   //***
+   // The Ikonos RPC data file is conveniently formatted as KWL file:
+   //***
+   ossimKeywordlist kwl (data_file);
+   if (kwl.getErrorStatus())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "ERROR ossimIkonosRpcModel::parseRpcData(data_file): Could not open RPC data file <" << data_file << ">. " << "Aborting..." << std::endl;
+      ++theErrorStatus;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+         << "returning with error..." << std::endl;
+      return;
+   }
+
+   const char* buf;
+   const char* keyword;
+   
+   //***
+   // Parse data from KWL:
+   //***
+   keyword = LINE_OFF_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+   theLineOffset = atof(buf);
+      
+   keyword = SAMP_OFF_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+   theSampOffset = atof(buf);
+
+   keyword = LAT_OFF_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+      
+   theLatOffset = atof(buf);
+   
+   keyword = LONG_OFF_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+   theLonOffset = atof(buf);
+
+   keyword = HEIGHT_OFF_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+      
+   theHgtOffset = atof(buf);
+
+   keyword = LINE_SCALE_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+   theLineScale = atof(buf);
+   
+   keyword = SAMP_SCALE_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+   theSampScale = atof(buf);
+   
+   keyword = LAT_SCALE_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+   else
+     {
+       // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
+       theSensorID = theSupportData->getSensorID();
+     }
+   
+
+   theLatScale = atof(buf);
+   
+   keyword = LONG_SCALE_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+   theLonScale = atof(buf);
+   
+   keyword = HEIGHT_SCALE_KW;
+   buf = kwl.find(keyword);
+   if (!buf)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                          << "\nAborting construction. Error looking up keyword: "
+                                          << keyword << std::endl;
+      return;
+   }
+      
+   theHgtScale = atof(buf);
+   
+   char kwbuf[32];
+   keyword = kwbuf;
+   for(int i=1; i<=20; i++)
+   {
+      sprintf(kwbuf, "%s%d", LINE_NUM_COEFF_KW, i);
+      buf = kwl.find(keyword);
+      if (!buf)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                             << "\nAborting construction. Error looking up keyword: "
+                                             << keyword << std::endl;
+         return;
+      }
+      
+      theLineNumCoef[i-1] = atof(buf);
+      
+      sprintf(kwbuf, "%s%d", LINE_DEN_COEFF_KW, i);
+      buf = kwl.find(keyword);
+      if (!buf)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                             << "\nAborting construction. Error looking up keyword: "
+                                             << keyword << std::endl;
+         return;
+      }
+      theLineDenCoef[i-1] = atof(buf);
+      
+      sprintf(kwbuf, "%s%d", SAMP_NUM_COEFF_KW, i);
+      buf = kwl.find(keyword);
+      if (!buf)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                             << "\nAborting construction. Error looking up keyword: "
+                                             << keyword << std::endl;
+         return;
+      }
+      theSampNumCoef[i-1] = atof(buf);
+      
+      sprintf(kwbuf, "%s%d", SAMP_DEN_COEFF_KW, i);
+      buf = kwl.find(keyword);
+      if (!buf)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimIkonosRpcModel::parseRpcData(data_file):"
+                                             << "\nAborting construction. Error looking up keyword: "
+                                             << keyword << std::endl;
+         return;
+      }
+      theSampDenCoef[i-1] = atof(buf);
+   }
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): returning..." << std::endl;
+   return;
+
+   theErrorStatus++;
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimIkonosRpcModel::parseRpcData(data_file): returning with error..." << std::endl;
+   
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimIkonosRpcModel::writeGeomTemplate()
+//  
+//   Writes a template of an ossimIkonosRpcModel geometry file.
+//  
+//*****************************************************************************
+void ossimIkonosRpcModel::writeGeomTemplate(ostream& os)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(os): entering..." << std::endl;
+
+   os <<
+      "//**************************************************************\n"
+      "// Template for Ikonos RPC geometry keywordlist\n"
+      "//\n"
+      "// NOTE: It is preferable to select the full RPC geometry KWL \n"
+      "//       that should have been created with the first use of the\n"
+      "//       derived model type ossimIkonosRpcModel. Using this KWL \n"
+      "//       implies that an initial geometry is being constructed \n"
+      "//       with all adjustable parameters initialized to 0. \n"
+      "//**************************************************************\n"
+      << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
+   os << META_DATA_FILE << ": <string>\n"
+      << RPC_DATA_FILE  << ": <string>\n" << endl;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(os): returning..." << std::endl;
+   return;
+}
+
+bool ossimIkonosRpcModel::saveState(ossimKeywordlist& kwl,
+				    const char* prefix)const
+{
+   if(theSupportData.valid())
+   {
+      ossimString supportPrefix = ossimString(prefix) + "support_data.";
+      // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
+      theSupportData->saveState(kwl, supportPrefix);
+   }
+
+   ossimRpcModel::saveState(kwl, prefix);
+
+  // this model just sets the base class values so
+  // we do not need to re-construct this model so 
+  // specify the type as the base class type
+  //
+//   kwl.add(prefix,
+// 	  ossimKeywordNames::TYPE_KW,
+// 	  STATIC_TYPE_NAME(ossimRpcModel),
+// 	  true);
+
+  // cout << "kwl:\n" << kwl << std::endl;
+
+  return true;
+}
+
+bool ossimIkonosRpcModel::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   if(theSupportData.valid())
+   {
+      ossimString supportPrefix = ossimString(prefix) + "support_data.";
+      theSupportData->loadState(kwl, supportPrefix);
+   }
+
+   return ossimRpcModel::loadState(kwl, prefix);
+}
+
+bool ossimIkonosRpcModel::parseFile(const ossimFilename& file)
+{
+      return parseTiffFile(file);
+}
+
+bool ossimIkonosRpcModel::parseTiffFile(const ossimFilename& filename)
+{
+   bool result = false;
+   
+   ossimRefPtr<ossimTiffTileSource> tiff = new ossimTiffTileSource();
+
+   if ( tiff->open(filename) )
+   {
+      if ( !theSupportData )
+      {
+         theSupportData = new ossimIkonosMetaData();
+      }
+
+      if ( theSupportData->open(filename) == false )
+      {
+         if(traceDebug())
+         {
+            // Currently not required by model so we will not error out here.
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "WARNING: ossimIkonosMetaData::open returned false.\n"
+               << std::endl;
+         }
+      }
+      else
+      {
+         // copy ossimIkonosMetada-sensor into ossimIkonosRpcModel-sensorId
+         theSensorID = theSupportData->getSensorID();
+      }
+
+      //convert file to rpc filename and hdr filename so we can get some info
+      ossimFilename rpcfile = filename.noExtension();
+      rpcfile += "_rpc.txt";
+      
+      ossimFilename hdrfile = filename;
+      hdrfile.setExtension(ossimString("hdr"));
+      
+      if( parseHdrData(hdrfile) )
+      {
+         // parseRpcData sets the error status on error.
+         parseRpcData (rpcfile);
+         if ( !getErrorStatus() ) //check for errors in parsing rpc data
+         {
+            finishConstruction();
+            
+            //---
+            // Save current state in RPC model format:
+            //---
+            ossimString drivePart;
+            ossimString pathPart;
+            ossimString filePart;
+            ossimString extPart;
+            filename.split(drivePart,
+                           pathPart,
+                           filePart,
+                           extPart);
+            
+            ossimFilename init_rpc_geom;
+            init_rpc_geom.merge(drivePart,
+                                pathPart,
+                                INIT_RPC_GEOM_FILENAME,
+                                "");
+
+            ossimKeywordlist kwl (init_rpc_geom);
+            saveState(kwl);
+
+            // If we get here set the return status to true.
+            result = true;
+
+         } // matches: if ( !getErrorStatus() )
+   
+      } // matches: if( parseHdrData(hdrfile) )
+
+   } // matches:  if ( tiff->open(filename) )
+   
+   if ( traceExec() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "return status: " << (result?"true\n":"false\n")
+         << "DEBUG ossimIkonosRpcModel parseTiffFile: returning..."
+         << std::endl;
+   }
+
+   return result;
+}
+
+bool ossimIkonosRpcModel::isNitf(const ossimFilename& filename)
+{
+   std::ifstream in(filename.c_str(), ios::in|ios::binary);
+   
+   if(in)
+   {
+      char nitfFile[4];
+      in.read((char*)nitfFile, 4);
+
+      return (ossimString(nitfFile,
+                          nitfFile+4) == "NITF");
+   }
+
+   return false;
+}
diff --git a/src/projection/ossimImageProjectionModel.cpp b/src/projection/ossimImageProjectionModel.cpp
new file mode 100644
index 0000000..2be06e9
--- /dev/null
+++ b/src/projection/ossimImageProjectionModel.cpp
@@ -0,0 +1,54 @@
+//-----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class definition of ossimImageProjectionModel.
+//
+//-----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/projection/ossimImageProjectionModel.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/projection/ossimProjection.h>
+#include <string>
+
+RTTI_DEF1(ossimImageProjectionModel,
+          "ossimImageProjectionModel",
+          ossimImageModel)
+
+ossimImageProjectionModel::ossimImageProjectionModel()
+   : ossimImageModel(),
+     theProjection(0)
+{
+}
+
+ossimImageProjectionModel::~ossimImageProjectionModel()
+{
+   theProjection = 0;
+}
+
+void ossimImageProjectionModel::initialize(const ossimImageHandler& ih)
+{
+   // Initialize base.
+   ossimImageModel::initialize(ih);
+   
+   theProjection = 0;
+
+   // Fetch the handler's image geometry and see if it has a projection:
+   ossimImageHandler* iih = const_cast<ossimImageHandler*>(&ih); // cast away constness
+   ossimRefPtr<ossimImageGeometry> image_geom = iih->getImageGeometry();
+   if ( image_geom.valid() )
+   {
+      theProjection = image_geom->getProjection();
+   }
+}
+
+const ossimProjection* ossimImageProjectionModel::getProjection() const
+{
+   return theProjection;
+}
diff --git a/src/projection/ossimImageViewAffineTransform.cpp b/src/projection/ossimImageViewAffineTransform.cpp
new file mode 100644
index 0000000..736c8e4
--- /dev/null
+++ b/src/projection/ossimImageViewAffineTransform.cpp
@@ -0,0 +1,346 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimImageViewAffineTransform.cpp 23423 2015-07-13 19:07:38Z dburken $
+
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimMatrix3x3.h>
+#include <ossim/base/ossimString.h>
+
+RTTI_DEF1(ossimImageViewAffineTransform, "ossimImageViewAffineTransform", ossimImageViewTransform)
+
+ossimImageViewAffineTransform::ossimImageViewAffineTransform(double rotateDegrees,
+                                                             double imageScaleX,
+                                                             double imageScaleY,
+                                                             double scaleXValue,
+                                                             double scaleYValue,
+                                                             double translateXValue,
+                                                             double translateYValue,
+                                                             double pivotXValue,
+                                                             double pivotYValue)
+   :m_transform(3,3),
+    m_inverseTransform(3,3),
+    m_rotation(rotateDegrees),
+    m_imageSpaceScale(imageScaleX,imageScaleY),
+    m_scale(scaleXValue, scaleYValue),
+    m_translate(translateXValue, translateYValue),
+    m_pivot(pivotXValue, pivotYValue)
+{
+   m_transform << 1 << 0 << 0
+                << 0 << 1 << 0
+                << 0 << 0 << 1;
+   
+   m_inverseTransform << 1 << 0 << 0
+                       << 0 << 1 << 0
+                       << 0 << 0 << 1;
+
+   
+   rotate(rotateDegrees);
+   scale(scaleXValue, scaleYValue);
+   translate(translateXValue, translateYValue);
+   pivot(m_pivot.x, m_pivot.y);
+}
+
+ossimImageViewAffineTransform::~ossimImageViewAffineTransform()
+{
+}
+
+void ossimImageViewAffineTransform::imageToView(const ossimDpt& imagePoint,
+                                                ossimDpt&       viewPoint)const
+{
+   
+    viewPoint.x = m_transform[0][0]*imagePoint.x + m_transform[0][1]*imagePoint.y + m_transform[0][2];
+    viewPoint.y = m_transform[1][0]*imagePoint.x + m_transform[1][1]*imagePoint.y + m_transform[1][2];
+}
+
+void ossimImageViewAffineTransform::viewToImage(const ossimDpt& viewPoint,
+                                                ossimDpt&       imagePoint)const
+{
+   imagePoint.x = m_inverseTransform[0][0]*viewPoint.x + m_inverseTransform[0][1]*viewPoint.y + m_inverseTransform[0][2];
+   imagePoint.y = m_inverseTransform[1][0]*viewPoint.x + m_inverseTransform[1][1]*viewPoint.y + m_inverseTransform[1][2];
+}
+
+void ossimImageViewAffineTransform::setMatrix(NEWMAT::Matrix& matrix)
+{
+   m_transform        = matrix;
+   m_inverseTransform = m_transform.i();
+}
+
+const NEWMAT::Matrix& ossimImageViewAffineTransform::getMatrix()const
+{
+   return m_transform;
+}
+
+void ossimImageViewAffineTransform::translate(double deltaX,
+                                              double deltaY)
+{
+   m_translate = ossimDpt(deltaX, deltaY);
+   buildCompositeTransform();
+//    NEWMAT::Matrix m(3,3);
+
+//    m << 1 << 0 << deltaX
+//      << 0 << 1 << deltaY
+//      << 0 << 0 << 1;
+   
+   
+//    m_transform = m*m_transform;
+//    m_inverseTransform = m_transform.i();
+}
+
+void ossimImageViewAffineTransform::translateX(double deltaX)
+{
+   translate(deltaX, m_translate.y);
+}
+
+void ossimImageViewAffineTransform::translateY(double deltaY)
+{
+   translate(m_translate.x, deltaY);
+}
+
+void ossimImageViewAffineTransform::imageSpaceScale(double x, double y)
+{
+   m_imageSpaceScale = ossimDpt(x,y);
+   buildCompositeTransform();
+}
+
+void ossimImageViewAffineTransform::imageSpaceScaleX(double x)
+{
+   imageSpaceScale(x, m_imageSpaceScale.y);
+}
+
+void ossimImageViewAffineTransform::imageSpaceScaleY(double y)
+{
+   imageSpaceScale(m_imageSpaceScale.x, y);
+}
+
+void ossimImageViewAffineTransform::scale(double x, double y)
+{
+//    NEWMAT::Matrix m(3, 3);
+
+//    m << x << 0 << 0
+//      << 0 << y << 0
+//      << 0 << 0 << 1;
+
+   
+//   m_transform = (m*m_transform);
+
+//   m_inverseTransform = m_transform.i();
+
+   m_scale = ossimDpt(x,y);
+   buildCompositeTransform();
+}
+
+void ossimImageViewAffineTransform::scaleX(double x)
+{
+   scale(x, m_scale.y);
+}
+
+void ossimImageViewAffineTransform::scaleY(double y)
+{
+   scale(m_scale.x, y);
+}
+
+void ossimImageViewAffineTransform::pivot(double originX, double originY)
+{
+   m_pivot.x = originX;
+   m_pivot.y = originY;
+   buildCompositeTransform();
+}
+
+void ossimImageViewAffineTransform::pivotX(double originX)
+{
+   pivot(originX,m_pivot.y);
+}
+
+void ossimImageViewAffineTransform::pivotY(double originY)
+{
+   pivot(m_pivot.x, originY);
+}
+
+void ossimImageViewAffineTransform::rotate(double degrees)
+{
+   m_rotation = degrees;
+   buildCompositeTransform();
+//   m_transform = (m_transform * ossimMatrix3x3::createRotationZMatrix(degrees));
+//    m_transform = ossimMatrix3x3::createRotationZMatrix(degrees) * m_transform;
+
+//    m_inverseTransform = m_transform.i();
+}
+
+void ossimImageViewAffineTransform::buildCompositeTransform()
+{
+   NEWMAT::Matrix imageSpaceScaleM(3,3);
+   NEWMAT::Matrix scaleM(3, 3);
+   NEWMAT::Matrix rotzM = ossimMatrix3x3::createRotationZMatrix(m_rotation);
+   NEWMAT::Matrix transM(3,3);
+   NEWMAT::Matrix transOriginM(3,3);
+   NEWMAT::Matrix transOriginNegatedM(3,3);
+
+   transM << 1 << 0 << m_translate.x
+          << 0 << 1 << m_translate.y
+          << 0 << 0 << 1;
+   
+   transOriginM << 1 << 0 << m_pivot.x
+                << 0 << 1 << m_pivot.y
+                << 0 << 0 << 1;
+   
+   transOriginNegatedM << 1 << 0 << -m_pivot.x
+                       << 0 << 1 << -m_pivot.y
+                       << 0 << 0 << 1;
+   
+   scaleM << m_scale.x << 0 << 0
+          << 0 << m_scale.y << 0
+          << 0 << 0 << 1;
+   
+   imageSpaceScaleM << m_imageSpaceScale.x << 0 << 0
+          << 0 << m_imageSpaceScale.y << 0
+          << 0 << 0 << 1;
+
+//   m_transform        = transOriginM*transM*scaleM*rotzM*transOriginNegatedM;
+   // pivot should just be around the rotation
+   m_transform        = transM*scaleM*transOriginM*rotzM*imageSpaceScaleM*transOriginNegatedM;
+   m_inverseTransform = m_transform.i();
+   
+}
+
+
+bool ossimImageViewAffineTransform::loadState(const ossimKeywordlist& kwl,
+                                              const char* prefix)
+{
+   ossimString imageScaleString(kwl.find(prefix,"image_scale"));
+   ossimString scaleString(kwl.find(prefix,"scale"));
+   ossimString pivotString(kwl.find(prefix,"pivot"));
+   ossimString translateString(kwl.find(prefix,"translate"));
+   ossimString rotateString(kwl.find(prefix,"rotate"));
+   
+   if(!imageScaleString.empty())
+   {
+      m_imageSpaceScale.toPoint(imageScaleString);
+   }
+   if(!scaleString.empty())
+   {
+      m_scale.toPoint(scaleString);
+   }
+   if(!pivotString.empty())
+   {
+      m_pivot.toPoint(pivotString);
+   }
+   if(!translateString.empty())
+   {
+      m_translate.toPoint(translateString);
+   }
+   if(!rotateString.empty())
+   {
+      m_rotation = rotateString.toDouble();
+   }
+   buildCompositeTransform();
+   ossimImageViewTransform::loadState(kwl, prefix);
+   return true;
+}
+
+bool ossimImageViewAffineTransform::saveState(ossimKeywordlist& kwl,
+                                              const char* prefix)const
+{
+   kwl.add(prefix,
+           "image_scale",
+           m_imageSpaceScale.toString(),
+           true);
+   kwl.add(prefix,
+           "rotation",
+           m_rotation,
+           true);
+
+   // Fixed for multithread sequencer load, this uses saveState/loadState to
+   // clone image chains and rotate was not cloning, producing invalid tiles
+   kwl.add(prefix,
+           "rotate",
+           m_rotation,
+           true);
+   kwl.add(prefix,
+           "pivot",
+           m_pivot.toString(),
+           true);
+   kwl.add(prefix,
+           "scale",
+           m_scale.toString(),
+           true);
+   kwl.add(prefix,
+           "translate",
+           m_translate.toString(),
+           true);
+           
+   return ossimImageViewTransform::saveState(kwl,prefix);
+}
+
+bool ossimImageViewAffineTransform::isValid()const
+{
+   return true;
+}
+
+bool ossimImageViewAffineTransform::setView(ossimObject* obj)
+{
+   ossimImageViewAffineTransform* view = dynamic_cast<ossimImageViewAffineTransform*> (obj);
+   if(view)
+   {  
+      m_transform = view->m_transform;
+      m_inverseTransform = view->m_inverseTransform;
+      m_rotation = view->m_rotation;
+      m_imageSpaceScale = view->m_imageSpaceScale;
+      m_scale = view->m_scale;
+      m_translate = view->m_translate;
+      m_pivot = view->m_pivot;
+   }
+   return (view!=0);
+}
+
+ossimObject* ossimImageViewAffineTransform::getView()
+{
+   return this;
+}
+
+const ossimObject* ossimImageViewAffineTransform::getView()const
+{
+   return this;
+}
+
+ossimDpt ossimImageViewAffineTransform::getInputMetersPerPixel()const
+{
+   return ossimDpt(1,1);
+}
+
+ossimDpt ossimImageViewAffineTransform::getOutputMetersPerPixel()const
+{
+   ossimDpt result;
+   
+   result.makeNan();
+   
+   return result;
+}
+
+bool ossimImageViewAffineTransform::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
+{
+   bool result = ossimImageViewTransform::isEqualTo(obj,compareType);
+   
+   if(result)
+   {
+      result = false;
+      const ossimImageViewAffineTransform* rhs = dynamic_cast<const ossimImageViewAffineTransform*> (&obj);
+      if(rhs)
+      {
+         result = (ossim::almostEqual(m_rotation, rhs->m_rotation)&&
+                   (m_imageSpaceScale.isEqualTo(rhs->m_imageSpaceScale))&&
+                   (m_scale.isEqualTo(rhs->m_scale))&&                   
+                   (m_translate.isEqualTo(rhs->m_translate))&&
+                   (m_pivot.isEqualTo(rhs->m_pivot))
+                   );  
+      }
+   }
+   
+   return result;
+}
diff --git a/src/projection/ossimImageViewProjectionTransform.cpp b/src/projection/ossimImageViewProjectionTransform.cpp
new file mode 100644
index 0000000..2cbeaea
--- /dev/null
+++ b/src/projection/ossimImageViewProjectionTransform.cpp
@@ -0,0 +1,748 @@
+//*****************************************************************************
+// FILE: ossimImageViewProjectionTransform.cc
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Garrett Potts
+//         Oscar Kramer (oscar at krameranalytic.com)
+//
+// DESCRIPTION: Contains declaration of ossimImageViewProjectionTransform.
+//    This class provides an image to view transform that utilizes two
+//    independent 2D-to-3D projections. Intended for transforming view to
+//    geographic "world" space to input image space.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimImageViewProjectionTransform.cpp 20489 2012-01-23 20:07:56Z dburken $
+//
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimGeoPolygon.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimPolyArea2d.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <cmath>
+
+RTTI_DEF1(ossimImageViewProjectionTransform,
+          "ossimImageViewProjectionTransform",
+          ossimImageViewTransform);
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimImageViewProjectionTransform
+//*****************************************************************************
+ossimImageViewProjectionTransform::ossimImageViewProjectionTransform
+(  ossimImageGeometry* imageGeometry, ossimImageGeometry* viewGeometry)
+:  m_imageGeometry(imageGeometry),
+   m_viewGeometry(viewGeometry),
+   m_crossesDateline(false)
+{
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimImageViewProjectionTransform
+//*****************************************************************************
+ossimImageViewProjectionTransform::
+ossimImageViewProjectionTransform(const ossimImageViewProjectionTransform& src)
+: ossimImageViewTransform(src),
+  m_imageGeometry(src.m_imageGeometry),
+  m_viewGeometry(src.m_viewGeometry),
+  m_crossesDateline(false)
+{
+}
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimImageViewProjectionTransform
+//*****************************************************************************
+ossimImageViewProjectionTransform::~ossimImageViewProjectionTransform()
+{
+}
+//! Assigns the geometry to use for output view. This object does NOT own the geometry.
+void ossimImageViewProjectionTransform::setViewGeometry(ossimImageGeometry* g) 
+{
+  m_viewGeometry = g;
+
+  initializeDatelineCrossing();
+}   
+
+//! Assigns the geometry to use for input image. This object does NOT own the geometry.
+void ossimImageViewProjectionTransform::setImageGeometry(ossimImageGeometry* g) 
+{ 
+  m_imageGeometry = g; 
+  initializeDatelineCrossing();
+}  
+
+//*****************************************************************************
+//  Workhorse of the object. Converts image-space to view-space.
+//*****************************************************************************
+void ossimImageViewProjectionTransform::imageToView(const ossimDpt& ip, ossimDpt& vp) const
+{
+   // Check for same geometries on input and output (this includes NULL geoms):
+   if (m_imageGeometry == m_viewGeometry)
+   {
+      vp = ip;
+      return;
+   }
+   
+   // Otherwise we need access to good geoms. Check for a bad geometry object:
+   if (!m_imageGeometry || !m_viewGeometry)
+   {
+      vp.makeNan();
+      return;
+   }
+   
+   // Check for same projection on input and output sides to save projection to ground:
+   if (m_imageGeometry->getProjection() == m_viewGeometry->getProjection())
+   {
+      // Check for possible same 2D transforms as well:
+      if ( (m_imageGeometry->getTransform() == m_viewGeometry->getTransform()) &&
+           (m_imageGeometry->decimationFactor(0) == m_viewGeometry->decimationFactor(0)) )
+      {
+         vp = ip;
+         return;
+      }
+      
+      // Not the same 2D transform, so just perform local-image -> full-image -> local-view:
+      ossimDpt fp;
+      m_imageGeometry->rnToFull(ip, 0, fp);
+      m_viewGeometry->fullToRn(fp, 0, vp);
+      return;
+   }
+   
+   //---
+   // Completely different left and right side geoms (typical situation).
+   // Need to project to ground.
+   //---
+   ossimGpt gp;
+   m_imageGeometry->localToWorld(ip, gp);
+   m_viewGeometry->worldToLocal(gp, vp);
+
+#if 0 /* Please leave for debug. */
+   cout <<"DEBUG ossimImageViewProjectionTransform::imageToView:"
+        <<"\n    ip: "<<ip
+        <<"\n    gp: "<<gp
+        <<"\n    vp: "<<vp<<std::endl;
+#endif
+}
+
+//*****************************************************************************
+//  Other workhorse of the object. Converts view-space to image-space.
+//*****************************************************************************
+void ossimImageViewProjectionTransform::viewToImage(const ossimDpt& vp, ossimDpt& ip) const
+{
+   // Check for same geometries on input and output (this includes NULL geoms):
+   if (m_imageGeometry == m_viewGeometry)
+   {
+      ip = vp;
+      return;
+   }
+   
+   // Otherwise we need access to good geoms. Check for a bad geometry object:
+   if (!m_imageGeometry || !m_viewGeometry)
+   {
+      ip.makeNan();
+      return;
+   }
+   
+   // Check for same projection on input and output sides to save projection to ground:
+   const ossimProjection* iproj = m_imageGeometry->getProjection();
+   const ossimProjection* vproj = m_viewGeometry->getProjection();
+   if ((iproj && vproj && iproj->isEqualTo(*vproj)) || (iproj == vproj))
+   {
+      // Check for possible same 2D transforms as well:
+      const ossim2dTo2dTransform* ixform = m_imageGeometry->getTransform();
+      const ossim2dTo2dTransform* vxform = m_viewGeometry->getTransform();
+      if (((ixform && vxform && ixform->isEqualTo(*vxform)) || (ixform == vxform)) &&
+          (m_imageGeometry->decimationFactor(0) == m_viewGeometry->decimationFactor(0)))
+      {
+         ip = vp;
+         return;
+      }
+      
+      // Not the same 2D transform, so just perform local-image -> full-image -> local-view:
+      ossimDpt fp;
+      m_viewGeometry->rnToFull(vp, 0, fp);
+      m_imageGeometry->fullToRn(fp, 0, ip);
+      return;
+   }
+   
+   //---
+   // Completely different left and right side geoms (typical situation).
+   // Need to project to ground.
+   //---
+   ossimGpt gp;
+   m_viewGeometry->localToWorld(vp, gp);
+   m_imageGeometry->worldToLocal(gp, ip);
+
+#if 0 /* Please leave for debug. */
+   cout <<"DEBUG ossimImageViewProjectionTransform::viewToImage:"
+        <<"\n    vp: "<<vp
+        <<"\n    gp: "<<gp
+        <<"\n    ip: "<<ip
+        <<std::endl;
+#endif
+}
+
+void ossimImageViewProjectionTransform::getViewSegments(std::vector<ossimDrect>& viewBounds, 
+                                                      ossimPolyArea2d& polyArea,
+                                                      ossim_uint32 numberOfEdgePoints)const
+{
+  ossimDrect imageRect;
+  ossimDrect worldRect(ossimDpt(-180,-90),
+                       ossimDpt(-180,90),
+                       ossimDpt(180,90),
+                       ossimDpt(180,-90));
+  viewBounds.clear();
+  polyArea.clear();
+
+  if(m_imageGeometry.valid())
+  {
+    m_imageGeometry->getBoundingRect(imageRect);
+    ossim_uint32 idx=0;
+    std::vector<ossimDpt> points;
+    std::vector<ossimGpt> gPoints;
+    bool affectedByElevation = m_imageGeometry->isAffectedByElevation();
+
+
+    if((numberOfEdgePoints > 2)&&(affectedByElevation))
+    {
+      m_imageGeometry->getImageEdgePoints(points, numberOfEdgePoints);
+    }
+    else
+    {
+      points.resize(4);
+
+      points[0] = imageRect.ul();
+      points[1] = imageRect.ur();
+      points[2] = imageRect.lr();
+      points[3] = imageRect.ll();
+    }
+    if(m_crossesDateline)
+    {
+      ossimDpt testPt;
+      ossimGpt cg;
+      m_imageGeometry->localToWorld(imageRect.midPoint(), cg);
+      ossim_int32 sgn = static_cast<ossim_int32>(ossim::sgn(cg.lond()));
+      std::vector<ossimPolygon> polyList;
+      for(idx=0; idx < points.size();++idx)
+      {
+        ossimGpt testGpt;
+        m_imageGeometry->localToWorld(points[idx], testGpt); 
+
+        if(!testGpt.isLatNan()&&!testGpt.isLonNan())
+        {
+          gPoints.push_back(testGpt);        
+        }
+      }
+
+      // first we get the list of ground points initialized
+      // and shifted to one side of the full world rect
+      // We will do the other side next
+      //
+      for(idx=0; idx < gPoints.size();++idx)
+      {
+         if(std::fabs(gPoints[idx].lond()-cg.lond()) > 180)
+         {
+            gPoints[idx].lond(gPoints[idx].lond()+sgn*360);
+         }
+      }
+
+      // now clip the ground list to the full ground rect
+      //
+      ossimPolygon tempPoly(gPoints);
+      tempPoly.clipToRect(polyList, worldRect);
+
+      ossim_uint32 pointListIdx=0;
+
+      // Loop through the clipped polygons and find their 
+      // view projection.  We will add this to the view
+      // bounds and we will add to the poly Area.  Poly Area
+      // is used for a tighter clip.
+      //
+      for(pointListIdx=0;pointListIdx<polyList.size();++pointListIdx)
+      {
+         const std::vector<ossimDpt>& clipPoints = polyList[pointListIdx].getVertexList();
+         points.clear();
+         for(idx = 0; idx<clipPoints.size(); ++idx)
+         {
+            m_viewGeometry->worldToLocal(ossimGpt(clipPoints[idx]), testPt);
+            if(!testPt.hasNans())
+            {
+               points.push_back(testPt);
+            }
+         }
+         viewBounds.push_back(ossimDrect(points));
+
+         if (points.size() >= 4)
+         {
+            points.push_back(points[0]);
+            polyArea.add(ossimPolyArea2d(points));//ossimPolygon(points)));
+         }
+      }
+
+      // now shift the ground points to the other side of the world rect
+      //
+      for(idx=0; idx < gPoints.size();++idx)
+      {
+        gPoints[idx].lond(gPoints[idx].lond()+(-sgn*360));
+      }
+
+      // Now we will do the same thing to the other side of the world
+      // and find the view projection and add those to the poly area
+      // and the view rect
+      //
+      tempPoly = gPoints;
+      polyList.clear();
+      tempPoly.clipToRect(polyList, worldRect);
+
+      for(pointListIdx=0;pointListIdx<polyList.size();++pointListIdx)
+      {
+         const std::vector<ossimDpt>& clipPoints = polyList[pointListIdx].getVertexList();
+         points.clear();
+         for(idx = 0; idx<clipPoints.size(); ++idx)
+         {
+            m_viewGeometry->worldToLocal(ossimGpt(clipPoints[idx]), testPt);
+            if(!testPt.hasNans())
+            {
+               points.push_back(testPt);
+            }
+         }
+         viewBounds.push_back(ossimDrect(points));
+         if (points.size() >= 4)
+         {
+            points.push_back(points[0]);
+            polyArea.add(ossimPolyArea2d(points));//ossimPolygon(points)));
+         }
+
+      }
+    }// end: if(m_crossesDateline)
+    else 
+    {
+      ossimDpt testPoint;
+      std::vector<ossimDpt> vpoints;
+
+      for(idx=0; idx < points.size();++idx)
+      {
+        ossimDpt testDpt;
+        imageToView(points[idx], testDpt); 
+        if(!testDpt.hasNans())
+        {
+          vpoints.push_back(testDpt);
+        }
+      }
+  
+      if(vpoints.size())
+      {
+        vpoints.push_back(vpoints[0]);
+        viewBounds.push_back(ossimDrect(vpoints));
+        polyArea = vpoints;// = ossimPolyArea2d(points);
+
+      }
+    }
+  } 
+}
+
+
+bool ossimImageViewProjectionTransform::setView(ossimObject* baseObject)
+{
+   ossimImageGeometry* g = dynamic_cast<ossimImageGeometry*>(baseObject);
+   bool new_view_set = false;
+   m_crossesDateline = false;
+   if (g)
+   {
+      m_viewGeometry = g;
+      new_view_set = true;
+   }
+   else
+   {
+      ossimProjection* proj = dynamic_cast<ossimProjection*>(baseObject);
+      if(proj)
+      {
+         if(m_viewGeometry.valid())
+         {
+            m_viewGeometry->setProjection(proj);
+         }
+         else
+         {
+            m_viewGeometry = new ossimImageGeometry(0, proj);
+         }
+
+         new_view_set = true;
+      }
+   }
+
+   if ( m_viewGeometry.valid() && m_viewGeometry-> getImageSize().hasNans() )
+   {
+      // Sets the view image size from the image geometry if present.
+      initializeViewSize();
+   } 
+
+   return new_view_set;
+}
+
+//*****************************************************************************
+//  Dumps contents to stream
+//*****************************************************************************
+std::ostream& ossimImageViewProjectionTransform::print(std::ostream& out)const
+{
+    out << "ossimImageViewProjectionTransform::print: ..... entered " <<endl;
+
+    if(m_imageGeometry.valid())
+    {
+        out << "  Input Image (LEFT) Geometry: " << endl;
+        m_imageGeometry->print(out);
+    }
+    else
+    {
+        out << "  None defined." << endl;
+    }
+    if(m_viewGeometry.valid())
+    {
+        out << "Output View (RIGHT) Geometry: " << endl;
+        m_viewGeometry->print(out);
+    }
+    else
+    {
+        out << "  None defined." << endl;
+    }
+    return out;
+}
+
+//**************************************************************************************************
+// Converts the local image space rect into bounding view-space rect
+//**************************************************************************************************
+ossimDrect ossimImageViewProjectionTransform::getImageToViewBounds(const ossimDrect& imageRect)const
+{
+    // Let base class try:
+   ossimDrect result = ossimImageViewTransform::getImageToViewBounds(imageRect);
+
+   // If not successful, compute using input and output geometries:
+   if (result.hasNans() && m_imageGeometry.valid() && m_viewGeometry.valid() &&
+       m_imageGeometry->hasProjection() && m_viewGeometry->hasProjection())
+   {
+      ossimGeoPolygon viewClip;
+      m_viewGeometry->getProjection()->getGroundClipPoints(viewClip);
+      if(viewClip.size())
+      {
+         std::vector<ossimGpt> imageGpts(4);
+         m_imageGeometry->localToWorld(imageRect.ul(), imageGpts[0]);
+         m_imageGeometry->localToWorld(imageRect.ur(), imageGpts[1]);
+         m_imageGeometry->localToWorld(imageRect.lr(), imageGpts[2]);
+         m_imageGeometry->localToWorld(imageRect.ll(), imageGpts[3]);
+
+         const ossimDatum* viewDatum = m_viewGeometry->getProjection()->origin().datum();
+         imageGpts[0].changeDatum(viewDatum);
+         imageGpts[1].changeDatum(viewDatum);
+         imageGpts[2].changeDatum(viewDatum);
+         imageGpts[3].changeDatum(viewDatum);
+         
+         ossimPolyArea2d viewPolyArea(viewClip.getVertexList());
+         ossimPolyArea2d imagePolyArea(imageGpts);
+         viewPolyArea &= imagePolyArea;
+         std::vector<ossimPolygon> visiblePolygons;
+         viewPolyArea.getVisiblePolygons(visiblePolygons);
+         if(visiblePolygons.size())
+         {
+            std::vector<ossimDpt> vpts;
+            ossim_uint32 idx = 0;
+            for(idx=0; idx<visiblePolygons[0].getNumberOfVertices();++idx)
+            {
+               ossimDpt tempPt;
+               ossimGpt gpt(visiblePolygons[0][idx].lat, visiblePolygons[0][idx].lon, 0.0,  viewDatum);
+               m_viewGeometry->worldToLocal(gpt, tempPt);
+               vpts.push_back(tempPt);
+            }
+            result = ossimDrect(vpts);
+         }
+      }
+   }
+   return result;
+}
+
+//*****************************************************************************
+//  METHOD: ossimImageViewProjectionTransform::loadState
+//*****************************************************************************
+bool ossimImageViewProjectionTransform::loadState(const ossimKeywordlist& kwl,
+                                                  const char* prefix)
+{
+   bool result = ossimImageViewTransform::loadState(kwl, prefix);
+   if(result)
+   {
+      ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
+      ossimString viewPrefix  = ossimString(prefix)+"view_geometry.";
+      if(kwl.numberOf(imagePrefix.c_str())>0)
+      {
+         m_imageGeometry = new ossimImageGeometry();
+         m_imageGeometry->loadState(kwl, imagePrefix.c_str());
+      }
+      if(kwl.numberOf(viewPrefix.c_str())>0)
+      {
+         m_viewGeometry = new ossimImageGeometry();
+         m_viewGeometry->loadState(kwl, viewPrefix.c_str());
+      }
+      
+   }
+   
+   return result;
+}
+
+//**************************************************************************************************
+// 
+//**************************************************************************************************
+bool ossimImageViewProjectionTransform::saveState(ossimKeywordlist& kwl,
+                                                  const char* prefix)const
+{
+   ossimString imagePrefix = ossimString(prefix)+"image_geometry.";
+   ossimString viewPrefix  = ossimString(prefix)+"view_geometry.";
+   
+   if(m_imageGeometry.valid())
+   {
+      m_imageGeometry->saveState(kwl, imagePrefix.c_str());
+   }
+   if(m_viewGeometry.valid())
+   {
+      m_viewGeometry->saveState(kwl, viewPrefix.c_str());
+   }
+   return ossimImageViewTransform::saveState(kwl, prefix);
+}
+
+//**************************************************************************************************
+// Returns the GSD of input image.
+//**************************************************************************************************
+ossimDpt ossimImageViewProjectionTransform::getInputMetersPerPixel() const
+{
+    ossimDpt result;
+
+    if (m_imageGeometry.valid() && m_imageGeometry->hasProjection())
+        result = m_imageGeometry->getProjection()->getMetersPerPixel();
+    else
+        result.makeNan();
+
+    return result;
+}
+
+//**************************************************************************************************
+// Returns the GSD of the output view.
+//**************************************************************************************************
+ossimDpt ossimImageViewProjectionTransform::getOutputMetersPerPixel() const
+{
+    ossimDpt result;
+
+    if(m_viewGeometry.valid() && m_viewGeometry->hasProjection())
+        result = m_viewGeometry->getProjection()->getMetersPerPixel();
+    else
+        result.makeNan();
+
+    return result;
+}
+
+// Initialize view geometry image size from image geometry.
+bool ossimImageViewProjectionTransform::initializeViewSize()
+{
+   bool result = false;
+   m_crossesDateline = false;
+   if ( m_imageGeometry.valid() )
+   {
+      m_crossesDateline = m_imageGeometry->getCrossesDateline();
+      ossimDrect imageRect( 0, 0,
+                            m_imageGeometry->getImageSize().x - 1,
+                            m_imageGeometry->getImageSize().y - 1);
+      ossimDpt size;
+      ossimDrect rect;
+      if(m_crossesDateline)
+      {
+         ossimGpt ulg;
+         ossimGpt urg;
+         ossimGpt lrg;
+         ossimGpt llg;
+         ossimGpt cg;
+         ossimDpt ul;
+         ossimDpt ur;
+         ossimDpt lr;
+         ossimDpt ll;
+         m_imageGeometry->localToWorld(imageRect.ul(), ulg);
+         m_imageGeometry->localToWorld(imageRect.ur(), urg);
+         m_imageGeometry->localToWorld(imageRect.lr(), lrg);
+         m_imageGeometry->localToWorld(imageRect.ll(), llg);
+         m_imageGeometry->localToWorld(imageRect.midPoint(), cg);
+
+         if(std::fabs(ulg.lond()-cg.lond()) > 180)
+         {
+            ulg.lond(ulg.lond()+ossim::sgn(cg.lond())*360);
+         }
+         if(std::fabs(urg.lond()-cg.lond()) > 180)
+         {
+            urg.lond((urg.lond()+ossim::sgn(cg.lond())*360));
+         }
+         if(std::fabs(lrg.lond()-cg.lond()) > 180)
+         {
+            lrg.lond(lrg.lond()+ossim::sgn(cg.lond())*360);
+         }
+         if(std::fabs(llg.lond()-cg.lond()) > 180)
+         {
+            llg.lond(llg.lond()+ossim::sgn(cg.lond())*360);
+         }
+
+         m_viewGeometry->worldToLocal(ulg, ul);
+         m_viewGeometry->worldToLocal(urg, ur);
+         m_viewGeometry->worldToLocal(lrg, lr);
+         m_viewGeometry->worldToLocal(llg, ll);
+
+         rect= ossimDrect(ul,ur,lr,ll);
+      }
+      else
+      {
+        rect = getImageToViewBounds( imageRect );
+      }
+      size.x = ossim::round<ossim_int32>( rect.width()  );
+      size.y = ossim::round<ossim_int32>( rect.height() );
+      if ( size.hasNans() == false )
+      {
+         m_viewGeometry->setImageSize( size );
+         result = true;
+      }
+//      std::cout << "VIEW SIZE ============== " << size << "\n";
+#if 0
+
+      if ( (imageRect.hasNans() == false) && m_viewGeometry.valid() )
+      {
+         ossimRefPtr<ossimProjection> viewProj = m_viewGeometry->getProjection();
+         if ( viewProj.valid() )
+         {
+            ossimIpt size;
+            size.makeNan();
+            
+            const ossimEquDistCylProjection* eqProj =
+               dynamic_cast<const ossimEquDistCylProjection*>( viewProj.get() );
+            if ( eqProj )
+            {
+               // Specialized to take into consideration a date line crossing.
+               
+               // Get the ground points we need:
+               ossimDpt iRight(imageRect.ul().x+1, imageRect.ul().y);
+               ossimDpt iDown(imageRect.ul().x, imageRect.ul().y+1);
+               ossimGpt gul;
+               ossimGpt gur; 
+               ossimGpt glr;
+               ossimGpt gll;
+               ossimGpt gRight;
+               ossimGpt gDown;
+               ossim_float64 hdd; // height decimal degrees
+               ossim_float64 wdd; // width decimal degrees
+               ossim_float64 leftLon;
+               ossim_float64 rightLon;
+               
+               m_imageGeometry->localToWorld( imageRect.ul(), gul );
+               m_imageGeometry->localToWorld( imageRect.ur(), gur );
+               m_imageGeometry->localToWorld( imageRect.lr(), glr );
+               m_imageGeometry->localToWorld( imageRect.ll(), gll );
+               m_imageGeometry->localToWorld( iRight, gRight );
+               m_imageGeometry->localToWorld( iDown, gDown );
+               
+               //---
+               // Determine the direction of the image and get the geographic bounding box.
+               // For the longitude consider a date line crossing.
+               //---
+               if ( gul.lat > gDown.lat ) // oriented north up
+               {
+                  if ( gul.lat >= gRight.lat ) // straight up or leaning right
+                  {
+                     hdd      = gul.lat - glr.lat;
+                     leftLon  = gll.lon;
+                     rightLon = gur.lon;
+                  }
+                  else // leaning left
+                  {
+                     hdd      = gur.lat - gll.lat;
+                     leftLon  = gul.lon;
+                     rightLon = glr.lon;
+                  }
+               }
+               else // south or on side
+               {
+                  if ( gRight.lat >= gul.lat ) // straight down or leaning right
+                  {
+                     hdd      = glr.lat - gul.lat;
+                     leftLon  = gur.lon;
+                     rightLon = gll.lon;
+                  }
+                  else // leaning left
+                  {
+                     hdd      = gll.lat - gur.lat;
+                     leftLon  = glr.lon;
+                     rightLon = gul.lon;
+                  }
+               }
+               
+               if ( rightLon > leftLon )
+               {
+                  wdd = rightLon - leftLon;
+               }
+               else // Date line cross:
+               {
+                  wdd = rightLon + 360.0 - leftLon;
+               }
+
+               //---
+               // Add one pixel width/height to the point to point size to make it edge to edge
+               // before dividing by gsd to get the size.  The view projection gsd is used here
+               // since the view could be a different resolution than the input projection.
+               //---
+               size.x = ossim::round<ossim_int32>(
+                  ( wdd + eqProj->getDecimalDegreesPerPixel().x ) /
+                  eqProj->getDecimalDegreesPerPixel().x );
+               size.y = ossim::round<ossim_int32>(
+                  ( hdd + eqProj->getDecimalDegreesPerPixel().y ) /
+                  eqProj->getDecimalDegreesPerPixel().y );
+               
+#if 0 /* Please leave for debug: */
+               cout << "\nwdd: " << wdd
+                    << "\nhdd: " << hdd
+                    << "\ngul: " << gul
+                    << "\ngur: " << gur
+                    << "\nglr: " << glr
+                    << "\ngll: " << gll
+                    << endl;
+#endif
+            }
+            else // Not an ossimEquDistCylProjection:
+            {
+               ossimDrect rect = getImageToViewBounds( imageRect );
+               size.x = ossim::round<ossim_int32>( rect.width()  );
+               size.y = ossim::round<ossim_int32>( rect.height() );
+            }
+
+#if 0 /* Please leave for debug: */
+            cout << "m_imageGeometry:\n" << *(m_imageGeometry.get())
+                 << "\n\nm_viewGeometry:\n" << *(m_viewGeometry.get())
+                 << "\n\ncomputed view size: " << size << endl;
+#endif
+            
+            if ( size.hasNans() == false )
+            {
+               m_viewGeometry->setImageSize( size );
+               result = true;
+            }
+            
+         } // Matches: if ( viewProj.valid() )
+
+      } // Matches: if ( (imageRect.hasNans() == false) ... 
+#endif
+      
+   } // Matches: if ( m_imageGeometry.valid() && ...
+
+   return result;
+   
+} // End:  bool ossimImageViewProjectionTransform::initializeViewSize()
+
+void ossimImageViewProjectionTransform::initializeDatelineCrossing()
+{
+  m_crossesDateline = false;
+  if(m_imageGeometry.valid())
+  {
+    m_crossesDateline = m_imageGeometry->getCrossesDateline();
+  }
+}
\ No newline at end of file
diff --git a/ossim/src/ossim/projection/ossimImageViewTransform.cpp b/src/projection/ossimImageViewTransform.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimImageViewTransform.cpp
rename to src/projection/ossimImageViewTransform.cpp
diff --git a/ossim/src/ossim/projection/ossimImageViewTransformFactory.cpp b/src/projection/ossimImageViewTransformFactory.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimImageViewTransformFactory.cpp
rename to src/projection/ossimImageViewTransformFactory.cpp
diff --git a/ossim/src/ossim/projection/ossimIpodSensor.cpp b/src/projection/ossimIpodSensor.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimIpodSensor.cpp
rename to src/projection/ossimIpodSensor.cpp
diff --git a/src/projection/ossimLambertConformalConicProjection.cpp b/src/projection/ossimLambertConformalConicProjection.cpp
new file mode 100644
index 0000000..edef1f0
--- /dev/null
+++ b/src/projection/ossimLambertConformalConicProjection.cpp
@@ -0,0 +1,647 @@
+//*******************************************************************
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Lamberts Conformal Conic projection code.  
+//*******************************************************************
+//  $Id: ossimLambertConformalConicProjection.cpp 19640 2011-05-25 15:58:00Z oscarkramer $
+
+#include <iostream>
+#include <iomanip>
+#include <ossim/projection/ossimLambertConformalConicProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimLambertConformalConicProjection, "ossimLambertConformalConicProjection", ossimMapProjection)
+
+/***************************************************************************/
+/*                               DEFINES
+ *
+ */
+#ifndef PI_OVER_2
+#  define PI_OVER_2  ( M_PI / 2.0)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI     (2.0 * M_PI)
+#endif
+#define MAX_LAT    (( M_PI *  89.99972222222222) / 180.0)  /* 89 59 59.0 degrees in radians */
+#define LAMBERT_m(clat,essin)                  (clat / sqrt(1.0 - essin * essin))
+#define LAMBERT_t(lat,essin)                   tan(PI_OVER_4 - lat / 2) /				\
+										            pow((1.0 - essin) / (1.0 + essin), es_OVER_2)
+#define ES_SIN(sinlat)                         (es * sinlat)
+/**************************************************************************/
+/*                               GLOBAL DECLARATIONS
+ *
+ */
+
+const double PI_OVER_4 = (M_PI / 4.0);
+
+#define LAMBERT_NO_ERROR           0x0000
+#define LAMBERT_LAT_ERROR          0x0001
+#define LAMBERT_LON_ERROR          0x0002
+#define LAMBERT_EASTING_ERROR      0x0004
+#define LAMBERT_NORTHING_ERROR     0x0008
+#define LAMBERT_FIRST_STDP_ERROR   0x0010
+#define LAMBERT_SECOND_STDP_ERROR  0x0020
+#define LAMBERT_ORIGIN_LAT_ERROR   0x0040
+#define LAMBERT_CENT_MER_ERROR     0x0080
+#define LAMBERT_A_ERROR            0x0100
+#define LAMBERT_B_ERROR            0x0200
+#define LAMBERT_A_LESS_B_ERROR     0x0400
+#define LAMBERT_HEMISPHERE_ERROR   0x0800
+#define LAMBERT_FIRST_SECOND_ERROR 0x1000
+
+ossimLambertConformalConicProjection::ossimLambertConformalConicProjection(const ossimEllipsoid& ellipsoid,
+                                                                           const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+    
+ossimLambertConformalConicProjection::ossimLambertConformalConicProjection(const ossimEllipsoid& ellipsoid,
+                                                                           const ossimGpt& origin,
+                                                                           double stdParallel1,
+                                                                           double stdParallel2,
+                                                                           double falseEasting,
+                                                                           double falseNorthing)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   Lambert_Std_Parallel_1 = stdParallel1*RAD_PER_DEG;
+   Lambert_Std_Parallel_2 = stdParallel2*RAD_PER_DEG;
+   Lambert_False_Easting  = falseEasting;
+   Lambert_False_Northing = falseNorthing;
+   
+   update();
+}
+
+ossimLambertConformalConicProjection::~ossimLambertConformalConicProjection()
+{
+}
+
+ossimObject* ossimLambertConformalConicProjection::dup()const
+{
+   return new ossimLambertConformalConicProjection(*this);
+}
+
+void ossimLambertConformalConicProjection::update()
+{   
+   Set_Lambert_Parameters(theEllipsoid.getA(),
+                          theEllipsoid.getFlattening(),
+                          theOrigin.latr(),
+                          theOrigin.lonr(),
+                          Lambert_Std_Parallel_1,
+                          Lambert_Std_Parallel_2,
+                          Lambert_False_Easting,
+                          Lambert_False_Northing);
+
+   theFalseEastingNorthing.x = Lambert_False_Easting;
+   theFalseEastingNorthing.y = Lambert_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+void ossimLambertConformalConicProjection::setStandardParallel1(double degree)
+{
+   Lambert_Std_Parallel_1 = degree*RAD_PER_DEG;
+   update();
+}
+
+void ossimLambertConformalConicProjection::setStandardParallel2(double degree)
+{
+   Lambert_Std_Parallel_2 = degree*RAD_PER_DEG;
+   update();
+}
+
+void ossimLambertConformalConicProjection::setStandardParallels(double parallel1Degree,
+                                                                double parallel2Degree)
+{
+   Lambert_Std_Parallel_1 = parallel1Degree*RAD_PER_DEG;
+   Lambert_Std_Parallel_2 = parallel2Degree*RAD_PER_DEG;
+   update();
+   
+}
+
+void ossimLambertConformalConicProjection::setFalseEasting(double falseEasting)
+{
+   Lambert_False_Easting = falseEasting;
+   update();
+}
+
+void ossimLambertConformalConicProjection::setFalseNorthing(double falseNorthing)
+{
+   Lambert_False_Northing = falseNorthing;
+   update();
+}
+
+void ossimLambertConformalConicProjection::setFalseEastingNorthing(double falseEasting,
+                                                                   double falseNorthing)
+{
+   Lambert_False_Easting = falseEasting;
+   Lambert_False_Northing = falseNorthing;  
+   update();
+}
+
+void ossimLambertConformalConicProjection::setParameters(double parallel1,
+                                                         double parallel2,
+                                                         double falseEasting,
+                                                         double falseNorthing)
+{
+   Lambert_False_Easting = falseEasting;
+   Lambert_False_Northing = falseNorthing;  
+   Lambert_Std_Parallel_1 = parallel1*RAD_PER_DEG;
+   Lambert_Std_Parallel_2 = parallel2*RAD_PER_DEG;
+   update(); 
+}
+
+
+void ossimLambertConformalConicProjection::setDefaults()
+{
+   Lambert_Std_Parallel_1 = 40*RAD_PER_DEG;
+   Lambert_Std_Parallel_2 = 50*RAD_PER_DEG;
+   Lambert_False_Northing = 0.0;
+   Lambert_False_Easting  = 0.0;
+}
+
+ossimGpt ossimLambertConformalConicProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+  
+   Convert_Lambert_To_Geodetic(eastingNorthing.x,
+                               eastingNorthing.y,
+                               &lat,
+                               &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
+}
+
+ossimDpt ossimLambertConformalConicProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Lambert(gpt.latr(),
+                               gpt.lonr(),
+                               &easting,
+                               &northing);
+
+   return ossimDpt(easting, northing);
+}
+
+bool ossimLambertConformalConicProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::STD_PARALLEL_1_KW,
+           Lambert_Std_Parallel_1*DEG_PER_RAD,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::STD_PARALLEL_2_KW,
+           Lambert_Std_Parallel_2*DEG_PER_RAD,
+           true);
+   
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimLambertConformalConicProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   const char* stdParallel1  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_1_KW);
+   const char* stdParallel2  = kwl.find(prefix, ossimKeywordNames::STD_PARALLEL_2_KW);
+
+   setDefaults();
+   
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimLambertConformalConicProjection))
+   {
+      Lambert_False_Easting  = theFalseEastingNorthing.x;
+      Lambert_False_Northing = theFalseEastingNorthing.y;
+
+      if(stdParallel1)
+      {
+         Lambert_Std_Parallel_1 = ossimString(stdParallel1).toDouble()*RAD_PER_DEG;
+      }
+      if(stdParallel2)
+      {
+         Lambert_Std_Parallel_2 = ossimString(stdParallel2).toDouble()*RAD_PER_DEG;
+      }
+   }
+   update();
+   return flag;
+}
+
+std::ostream& ossimLambertConformalConicProjection::print(
+   std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << setiosflags(ios::fixed) << setprecision(15);
+
+   out << "// ossimLambertConformalConicProjection::print\n"
+       << ossimKeywordNames::STD_PARALLEL_1_KW << ": "
+       << Lambert_Std_Parallel_1*DEG_PER_RAD << "\n"
+       << ossimKeywordNames::STD_PARALLEL_2_KW << ": "
+      << Lambert_Std_Parallel_2*DEG_PER_RAD << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+   
+   return ossimMapProjection::print(out);
+}
+
+/************************************************************************/
+/*                              FUNCTIONS
+ *
+ */
+
+long ossimLambertConformalConicProjection::Set_Lambert_Parameters(double a,
+                                                                  double f,
+                                                                  double Origin_Latitude,
+                                                                  double Central_Meridian,
+                                                                  double Std_Parallel_1,
+                                                                  double Std_Parallel_2,
+                                                                  double False_Easting,
+                                                                  double False_Northing)
+
+{ /* BEGIN Set_Lambert_Parameters */
+/*
+ * The function Set_Lambert_Parameters receives the ellipsoid parameters and
+ * Lambert Conformal Conic projection parameters as inputs, and sets the
+ * corresponding state variables.  If any errors occur, the error code(s)
+ * are returned by the function, otherwise LAMBERT_NO_ERROR is returned.
+ *
+ *   a                   : Semi-major axis of ellipsoid, in meters   (input)
+ *   f                   : Flattening of ellipsoid						       (input)
+ *   Origin_Latitude     : Latitude of origin, in radians            (input)
+ *   Central_Meridian    : Longitude of origin, in radians           (input)
+ *   Std_Parallel_1      : First standard parallel, in radians       (input)
+ *   Std_Parallel_2      : Second standard parallel, in radians      (input)
+ *   False_Easting       : False easting, in meters                  (input)
+ *   False_Northing      : False northing, in meters                 (input)
+ */
+
+  double slat, slat1, clat;
+  double es_sin;
+  double t0, t1, t2;
+  double m1, m2;
+//  double inv_f = 1 / f;
+  long Error_Code = LAMBERT_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= LAMBERT_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= LAMBERT_INV_F_ERROR;
+//   }
+//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
+//   { /* Origin Latitude out of range */
+//     Error_Code |= LAMBERT_ORIGIN_LAT_ERROR;
+//   }
+//   if ((Std_Parallel_1 < -MAX_LAT) || (Std_Parallel_1 > MAX_LAT))
+//   { /* First Standard Parallel out of range */
+//     Error_Code |= LAMBERT_FIRST_STDP_ERROR;
+//   }
+//   if ((Std_Parallel_2 < -MAX_LAT) || (Std_Parallel_2 > MAX_LAT))
+//   { /* Second Standard Parallel out of range */
+//     Error_Code |= LAMBERT_SECOND_STDP_ERROR;
+//   }
+//   if ((Std_Parallel_1 == 0) && (Std_Parallel_2 == 0))
+//   { /* First & Second Standard Parallels are both 0 */
+//     Error_Code |= LAMBERT_FIRST_SECOND_ERROR;
+//   }
+//   if (Std_Parallel_1 == -Std_Parallel_2)
+//   { /* Parallels are the negation of each other */
+//     Error_Code |= LAMBERT_HEMISPHERE_ERROR;
+//   }
+//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
+//   { /* Origin Longitude out of range */
+//     Error_Code |= LAMBERT_CENT_MER_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+
+    Lambert_a = a;
+    Lambert_f = f;
+    Lambert_Origin_Lat = Origin_Latitude;
+    Lambert_Std_Parallel_1 = Std_Parallel_1;
+    Lambert_Std_Parallel_2 = Std_Parallel_2;
+//     if (Central_Meridian > PI)
+//       Central_Meridian -= TWO_PI;
+    Lambert_Origin_Long = Central_Meridian;
+    Lambert_False_Easting = False_Easting;
+    Lambert_False_Northing = False_Northing;
+
+    es2 = 2 * Lambert_f - Lambert_f * Lambert_f;
+    es = sqrt(es2);
+    es_OVER_2 = es / 2.0;
+
+    slat = sin(Lambert_Origin_Lat);
+    es_sin = ES_SIN(slat);
+    t0 = LAMBERT_t(Lambert_Origin_Lat, es_sin);
+
+    slat1 = sin(Lambert_Std_Parallel_1);
+    clat = cos(Lambert_Std_Parallel_1);
+    es_sin = ES_SIN(slat1);
+    m1 = LAMBERT_m(clat, es_sin);
+    t1 = LAMBERT_t(Lambert_Std_Parallel_1, es_sin);
+
+
+    if (fabs(Lambert_Std_Parallel_1 - Lambert_Std_Parallel_2) > 1.0e-10)
+    {
+      slat = sin(Lambert_Std_Parallel_2);
+      clat = cos(Lambert_Std_Parallel_2);
+      es_sin = ES_SIN(slat);
+      m2 = LAMBERT_m(clat, es_sin);
+      t2 = LAMBERT_t(Lambert_Std_Parallel_2, es_sin);
+      n = log(m1 / m2) / log(t1 / t2);
+    }
+    else
+      n = slat1;
+    F = m1 / (n * pow(t1, n));
+    Lambert_aF = Lambert_a * F;
+    if ((t0 == 0) && (n < 0))
+      rho0 = 0.0;
+    else
+      rho0 = Lambert_aF * pow(t0, n);
+
+  }
+  return (Error_Code);
+} /* END OF Set_Lambert_Parameters */
+
+
+void ossimLambertConformalConicProjection::Get_Lambert_Parameters(double *a,
+                                                                  double *f,
+                                                                  double *Origin_Latitude,
+                                                                  double *Central_Meridian,
+                                                                  double *Std_Parallel_1,
+                                                                  double *Std_Parallel_2,
+                                                                  double *False_Easting,
+                                                                  double *False_Northing)const
+
+{ /* BEGIN Get_Lambert_Parameters */
+/*                         
+ * The function Get_Lambert_Parameters returns the current ellipsoid
+ * parameters and Lambert Conformal Conic projection parameters.
+ *
+ *   a                   : Semi-major axis of ellipsoid, in meters   (output)
+ *   f                   : Flattening of ellipsoid					         (output)
+ *   Origin_Latitude     : Latitude of origin, in radians            (output)
+ *   Central_Meridian    : Longitude of origin, in radians           (output)
+ *   Std_Parallel_1      : First standard parallel, in radians       (output)
+ *   Std_Parallel_2      : Second standard parallel, in radians      (output)
+ *   False_Easting       : False easting, in meters                  (output)
+ *   False_Northing      : False northing, in meters                 (output)
+ */
+
+
+  *a = Lambert_a;
+  *f = Lambert_f;
+  *Std_Parallel_1 = Lambert_Std_Parallel_1;
+  *Std_Parallel_2 = Lambert_Std_Parallel_2;
+  *Origin_Latitude = Lambert_Origin_Lat;
+  *Central_Meridian = Lambert_Origin_Long;
+  *False_Easting = Lambert_False_Easting;
+  *False_Northing = Lambert_False_Northing;
+  
+  return;
+} /* END OF Get_Lambert_Parameters */
+
+
+long ossimLambertConformalConicProjection::Convert_Geodetic_To_Lambert (double Latitude,
+                                                                        double Longitude,
+                                                                        double *Easting,
+                                                                        double *Northing)const
+   
+{ /* BEGIN Convert_Geodetic_To_Lambert */
+/*
+ * The function Convert_Geodetic_To_Lambert converts Geodetic (latitude and
+ * longitude) coordinates to Lambert Conformal Conic projection (easting
+ * and northing) coordinates, according to the current ellipsoid and
+ * Lambert Conformal Conic projection parameters.  If any errors occur, the
+ * error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR is
+ * returned.
+ *
+ *    Latitude         : Latitude, in radians                         (input)
+ *    Longitude        : Longitude, in radians                        (input)
+ *    Easting          : Easting (X), in meters                       (output)
+ *    Northing         : Northing (Y), in meters                      (output)
+ */
+
+  double slat;
+  double es_sin;
+  double t;
+  double rho;
+  double dlam;
+  double theta;
+  long  Error_Code = LAMBERT_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   {  /* Latitude out of range */
+//     Error_Code|= LAMBERT_LAT_ERROR;
+//   }
+//   if ((Longitude < -PI) || (Longitude > TWO_PI))
+//   {  /* Longitude out of range */
+//     Error_Code|= LAMBERT_LON_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+
+    if (fabs(fabs(Latitude) - PI_OVER_2) > 1.0e-10)
+    {
+      slat = sin(Latitude);
+      es_sin = ES_SIN(slat);
+      t = LAMBERT_t(Latitude, es_sin);
+      rho = Lambert_aF * pow(t, n);
+    }
+    else
+    {
+      if ((Latitude * n) <= 0)
+      { /* Point can not be projected */
+        Error_Code |= LAMBERT_LAT_ERROR;
+        return (Error_Code);
+      }
+      rho = 0.0;
+    }
+
+    dlam = Longitude - Lambert_Origin_Long;
+
+//     if (dlam > PI)
+//     {
+//       dlam -= TWO_PI;
+//     }
+//     if (dlam < -PI)
+//     {
+//       dlam += TWO_PI;
+//     }
+
+    theta = n * dlam;
+
+    *Easting = rho * sin(theta) + Lambert_False_Easting;
+    *Northing = rho0 - rho * cos(theta) + Lambert_False_Northing;
+
+  }
+  return (Error_Code);
+} /* END OF Convert_Geodetic_To_Lambert */
+
+
+
+long ossimLambertConformalConicProjection::Convert_Lambert_To_Geodetic (double Easting,
+                                                                        double Northing,
+                                                                        double *Latitude,
+                                                                        double *Longitude)const
+
+{ /* BEGIN Convert_Lambert_To_Geodetic */
+/*
+ * The function Convert_Lambert_To_Geodetic converts Lambert Conformal
+ * Conic projection (easting and northing) coordinates to Geodetic
+ * (latitude and longitude) coordinates, according to the current ellipsoid
+ * and Lambert Conformal Conic projection parameters.  If any errors occur,
+ * the error code(s) are returned by the function, otherwise LAMBERT_NO_ERROR
+ * is returned.
+ *
+ *    Easting          : Easting (X), in meters                       (input)
+ *    Northing         : Northing (Y), in meters                      (input)
+ *    Latitude         : Latitude, in radians                         (output)
+ *    Longitude        : Longitude, in radians                        (output)
+ */
+
+
+  double dy, dx;
+  double rho, rho0_MINUS_dy;
+  double t;
+  double PHI;
+  double tempPHI = 0.0;
+  double sin_PHI;
+  double es_sin;
+  double theta = 0.0;
+  double tolerance = 4.85e-10;
+  long Error_Code = LAMBERT_NO_ERROR;
+
+//   if ((Easting < (Lambert_False_Easting - Lambert_Delta_Easting))
+//       ||(Easting > (Lambert_False_Easting + Lambert_Delta_Easting)))
+//   { /* Easting out of range  */
+//     Error_Code |= LAMBERT_EASTING_ERROR;
+//   }
+//   if ((Northing < (Lambert_False_Northing - Lambert_Delta_Northing))
+//       || (Northing > (Lambert_False_Northing + Lambert_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= LAMBERT_NORTHING_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+
+    dy = Northing - Lambert_False_Northing;
+    dx = Easting - Lambert_False_Easting;
+    rho0_MINUS_dy = rho0 - dy;
+    rho = sqrt(dx * dx + (rho0_MINUS_dy) * (rho0_MINUS_dy));
+
+    if (n < 0.0)
+    {
+      rho *= -1.0;
+      dy *= -1.0;
+      dx *= -1.0;
+      rho0_MINUS_dy *= -1.0;
+    }
+
+    if (rho != 0.0)
+    {
+      theta = atan2(dx, rho0_MINUS_dy);
+      t = pow(rho / (Lambert_aF) , 1.0 / n);
+      PHI = PI_OVER_2 - 2.0 * atan(t);
+      while (fabs(PHI - tempPHI) > tolerance)
+      {
+        tempPHI = PHI;
+        sin_PHI = sin(PHI);
+        es_sin = ES_SIN(sin_PHI);
+        PHI = PI_OVER_2 - 2.0 * atan(t * pow((1.0 - es_sin) / (1.0 + es_sin), es_OVER_2));
+      }
+      *Latitude = PHI;
+      *Longitude = theta / n + Lambert_Origin_Long;
+
+      if (fabs(*Latitude) < 2.0e-7)  /* force lat to 0 to avoid -0 degrees */
+        *Latitude = 0.0;
+      if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+        *Latitude = PI_OVER_2;
+      else if (*Latitude < -PI_OVER_2)
+        *Latitude = -PI_OVER_2;
+
+      if (*Longitude > M_PI)
+      {
+        if (*Longitude - M_PI < 3.5e-6) 
+          *Longitude = M_PI;
+//         else
+//           *Longitude -= TWO_PI;
+      }
+      if (*Longitude < -M_PI)
+      {
+        if (fabs(*Longitude + M_PI) < 3.5e-6)
+          *Longitude = -M_PI;
+//         else
+//           *Longitude += TWO_PI;
+      }
+
+      if (fabs(*Longitude) < 2.0e-7)  /* force lon to 0 to avoid -0 degrees */
+        *Longitude = 0.0;
+      if (*Longitude > M_PI)  /* force distorted values to 180, -180 degrees */
+        *Longitude = M_PI;
+      else if (*Longitude < -M_PI)
+        *Longitude = -M_PI;
+    }
+    else
+    {
+      if (n > 0.0)
+        *Latitude = PI_OVER_2;
+      else
+        *Latitude = -PI_OVER_2;
+      *Longitude = Lambert_Origin_Long;
+    }
+  }
+  return (Error_Code);
+} /* END OF Convert_Lambert_To_Geodetic */
+
+double ossimLambertConformalConicProjection::getStandardParallel1()const
+{
+   return  Lambert_Std_Parallel_1/RAD_PER_DEG;
+}
+
+double ossimLambertConformalConicProjection::getStandardParallel2()const
+{
+   return  Lambert_Std_Parallel_2/RAD_PER_DEG;
+}
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimLambertConformalConicProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj)) 
+      return false;
+
+   const ossimLambertConformalConicProjection* p = dynamic_cast<const ossimLambertConformalConicProjection*>(&proj);
+   if (!p) return false;
+
+   if (!ossim::almostEqual(Lambert_Std_Parallel_1,p->Lambert_Std_Parallel_1)) return false;
+   if (!ossim::almostEqual(Lambert_Std_Parallel_2,p->Lambert_Std_Parallel_2)) return false;
+
+   return true;
+}
diff --git a/src/projection/ossimLandSatModel.cpp b/src/projection/ossimLandSatModel.cpp
new file mode 100644
index 0000000..e26a3a3
--- /dev/null
+++ b/src/projection/ossimLandSatModel.cpp
@@ -0,0 +1,1204 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+// 
+// AUTHOR: Oscar Kramer (okramer at imagelinks.com)
+//
+// DESCRIPTION: 
+//
+// SOFTWARE HISTORY:
+//   01AUG2002  O. Kramer, ImageLinks
+//              Initial coding.
+//   21NOV2002  O. Kramer, ImageLinks
+//              Fixed use of map projection to use forward/inverse instead of
+//              worldTLinesample/lineSampleToWorld methods.
+//
+//*****************************************************************************
+
+#include <cstdlib>
+#include <ossim/projection/ossimLandSatModel.h>
+
+RTTI_DEF1(ossimLandSatModel, "ossimLandSatModel", ossimSensorModel);
+
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/support_data/ossimFfL7.h>
+#include <ossim/support_data/ossimFfL5.h>
+#include <ossim/projection/ossimSpaceObliqueMercatorProjection.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/base/ossimLsrPoint.h>
+#include <ossim/base/ossimLsrRay.h>
+#include <ossim/base/ossimLsrSpace.h>
+#include <stdio.h>
+#include <fstream>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimLandSatModel:exec");
+static ossimTrace traceDebug ("ossimLandSatModel:debug");
+
+static const char*  PROJECTION_TYPE_KW     = "theProjectionType";
+static const char*  MAP_ZONE_KW            = "theMapZone";
+static const char*  MAP_OFFSET_X_KW        = "theMapOffset.x";
+static const char*  MAP_OFFSET_Y_KW        = "theMapOffset.y";
+static const char*  WRS_PATH_NUMBER_KW     = "theWrsPathNumber";
+static const char*  ROW_NUMBER_KW          = "theWrsRowNumber";
+static const char*  ILLUM_AZIMUTH_KW       = "theIllumAzimuth";
+static const char*  ILLUM_ELEVATION_KW     = "theIllumElevation";
+static const char*  MERIDIANAL_ANGLE_KW    = "theMeridianalAngle";
+static const char*  ORBIT_ALTITUDE_KW      = "theOrbitAltitude";
+static const char*  ORBIT_INCLINATION_KW   = "theOrbitInclination";
+static const char*  MAP_AZIM_ANGLE_KW      = "theMapAzimAngle";
+static const char*  MAP_2Ic_ROT_ANGLE_KW   = "theMap2IcRotAngle";
+static const char*  INTRACK_OFFSET_KW      = "theIntrackOffset";
+static const char*  CRTRACK_OFFSET_KW      = "theCrtrackOffset";
+static const char*  LINE_GSD_CORR_KW       = "theLineGsdCorr";
+static const char*  SAMP_GSD_CORR_KW       = "theSampGsdCorr";
+static const char*  ROLL_OFFSET_KW         = "theRollOffset";
+static const char*  YAW_OFFSET_KW          = "theYawOffset";
+static const char*  YAW_RATE_KW            = "theYawRate";
+static const char*  MAP_ROTATION_KW        = "theMapRotation";
+
+
+static const double   GEODETIC_2_GEOCENTRIC_FACTOR  = 1.00674;
+static const double   L7_ORBIT_ALTITUDE  = 705300.0;
+static const double   L7_ORBIT_INCLINATION  = 98.22;
+static const double   L7_NOMINAL_POS_ERROR  = 200.0;
+
+static const double   L5_ORBIT_ALTITUDE  = 705300.0;
+static const double   L5_ORBIT_INCLINATION  = 98.22;
+static const double   L5_NOMINAL_POS_ERROR  = 12000.0; //arbitrary : to be fixed
+
+
+static const char* PARAM_NAMES[] ={"intrack_offset",
+                                         "crtrack_offset",
+                                         "line_gsd_corr",
+                                         "samp_gsd_corr",
+                                         "roll_offset",
+                                         "yaw_offset",
+                                         "yaw_rate",
+                                         "map_rotation"};
+
+static const char* PARAM_UNITS[] ={"meters",
+                                         "meters",
+                                         "meters",
+                                         "meters",
+                                         "degrees",
+                                         "degrees",
+                                         "seconds",
+                                         "degrees"};
+
+static const char* PROJ_TYPE[] = { "UNKNOWN_PROJECTION",
+                                         "UTM_MAP",
+                                         "UTM_ORBIT",
+                                         "SOM_MAP",
+                                         "SOM_ORBIT" };
+
+//*****************************************************************************
+//  DEFAULT CONSTRUCTOR: ossimLandSatModel()
+//  
+//*****************************************************************************
+ossimLandSatModel::ossimLandSatModel()
+   :
+   ossimSensorModel(),
+   theIntrackOffset     (0.0),
+   theCrtrackOffset     (0.0),
+   theLineGsdCorr       (0.0),   
+   theSampGsdCorr       (0.0),
+   theRollOffset        (0.0),
+   theYawOffset         (0.0),
+   theYawRate           (0.0),
+   theMapRotation       (0.0)
+
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel: entering..." << std::endl;
+
+   initAdjustableParameters();
+   
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: ossimLandSatModel(ossimLandSatModel)
+//  
+//*****************************************************************************
+ossimLandSatModel::ossimLandSatModel(const ossimFfL7& head)
+   :
+   ossimSensorModel(),
+   theIntrackOffset     (0.0),
+   theCrtrackOffset     (0.0),
+   theLineGsdCorr       (0.0),   
+   theSampGsdCorr       (0.0),
+   theRollOffset        (0.0),
+   theYawOffset         (0.0),
+   theYawRate           (0.0),
+   theMapRotation       (0.0)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(head): entering..." << std::endl;   
+
+   initFromHeader(head);
+
+   if (traceDebug()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(head): Exited..." << std::endl;
+}
+
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimLandSatModel(filename)
+//  
+//  Constructs model from a filename. The file can be either a FF header file
+//  or a KWL file.
+//  
+//*****************************************************************************
+ossimLandSatModel::ossimLandSatModel(const ossimFilename& init_file)
+ 
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(init_file): entering..." << std::endl;
+
+   setupOptimizer(init_file);
+
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(init_file): Exited..." << std::endl;
+}
+
+
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimLandSatModel(kwl)
+//  
+//  Constructs model from keywordlist geometry file
+//  
+//*****************************************************************************
+ossimLandSatModel::ossimLandSatModel(const ossimKeywordlist& geom_kwl)
+   :
+   ossimSensorModel(),
+   theIntrackOffset     (0.0),
+   theCrtrackOffset     (0.0),
+   theLineGsdCorr       (0.0),   
+   theSampGsdCorr       (0.0),
+   theRollOffset        (0.0),
+   theYawOffset         (0.0),
+   theYawRate           (0.0),
+   theMapRotation       (0.0)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(geom_kwl): entering..." << std::endl;
+
+   initAdjustableParameters();
+
+   //***
+   // Parse keywordlist for geometry:
+   //***
+   loadState(geom_kwl);
+
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(geom_kwl): Exited..." << std::endl;
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: 
+//*****************************************************************************
+ossimLandSatModel::ossimLandSatModel(const ossimLandSatModel& rhs)
+   :
+   ossimSensorModel   (rhs),
+   theIllumAzimuth    (rhs.theIllumAzimuth),
+   theIllumElevation  (rhs.theIllumElevation),
+   theOrbitAltitude   (rhs.theOrbitAltitude),
+   theOrbitInclination(rhs.theOrbitInclination),
+   theMapZone         (rhs.theMapZone),
+   theMapOffset       (rhs.theMapOffset),
+   theWrsPathNumber   (rhs.theWrsPathNumber),
+   theWrsRowNumber    (rhs.theWrsRowNumber),
+   theMeridianalAngle (rhs.theMeridianalAngle),
+   thePositionError   (rhs.thePositionError),
+   theProjectionType  (rhs.theProjectionType),
+   theMapProjection   (rhs.theMapProjection.valid()?
+                       (ossimMapProjection*)rhs.theMapProjection->dup():
+                       (ossimMapProjection*)0),
+   theMapAzimAngle    (rhs.theMapAzimAngle),
+   theMapAzimCos      (rhs.theMapAzimCos),
+   theMapAzimSin      (rhs.theMapAzimSin),
+   theMap2IcRotAngle  (rhs.theMap2IcRotAngle),
+   theMap2IcRotCos    (rhs.theMap2IcRotCos),
+   theMap2IcRotSin    (rhs.theMap2IcRotSin),
+   theIntrackOffset   (rhs.theIntrackOffset),
+   theCrtrackOffset   (rhs.theCrtrackOffset),
+   theLineGsdCorr     (rhs.theLineGsdCorr),
+   theSampGsdCorr     (rhs.theSampGsdCorr),
+   theRollOffset      (rhs.theRollOffset),
+   theYawOffset       (rhs.theYawOffset),
+   theYawRate         (rhs.theYawRate),
+   theMapRotation     (rhs.theMapRotation),
+   theRollRotMat      (rhs.theRollRotMat)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(rhs): entering..." << std::endl;
+   
+   initAdjustableParameters();
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::ossimLandSatModel(rhs): returning..." << std::endl;
+}
+ossimObject* ossimLandSatModel::dup()const
+{
+   return new ossimLandSatModel(*this);
+}
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimLandSatModel()
+//  
+//*****************************************************************************
+ossimLandSatModel::~ossimLandSatModel()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::~ossimLandSatModel: entering..." << std::endl;
+
+   theMapProjection = 0;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::~ossimLandSatModel: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  METHOD: ossimLandSatModel::initFromHeader()
+//  
+//*****************************************************************************
+void ossimLandSatModel::initFromHeader(const ossimFfL7& head)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initFromHeader: entering..." << std::endl;
+   
+   //***
+   // Initialize base-class data members:
+   //***
+   theRefGndPt         = head.theCenterGP;
+   theRefImgPt         = head.theCenterImagePoint;
+   theImageSize.x      = head.thePixelsPerLine;
+   theImageSize.y      = head.theLinesPerBand;
+   theImageID          = head.theRequestNumber;
+   theImageClipRect    = ossimDrect(0, 0, theImageSize.x-1, theImageSize.y-1);
+   theGSD.samp         = head.theGsd;
+   theGSD.line         = head.theGsd;
+   theIllumAzimuth     = head.theSunAzimuth;
+   theIllumElevation   = head.theSunElevation;
+   theMapZone          = head.theUsgsMapZone;
+   theWrsPathNumber    = head.thePathNumber;
+   theWrsRowNumber     = head.theRowNumber;
+   theRollOffset       = head.theOffNadirAngle;
+   theMeanGSD          = head.theGsd;
+   
+   //satellite orbit and accuracy
+   ossimString satname(head.theSatName);
+   if (satname.contains("7"))
+   {
+      theOrbitAltitude    = L7_ORBIT_ALTITUDE;
+      theOrbitInclination = L7_ORBIT_INCLINATION;
+      theNominalPosError  = L7_NOMINAL_POS_ERROR;
+   } else if (satname.contains("5"))
+   {
+      theOrbitAltitude    = L5_ORBIT_ALTITUDE;
+      theOrbitInclination = L5_ORBIT_INCLINATION;
+      theNominalPosError  = L5_NOMINAL_POS_ERROR;
+   } else {
+      theErrorStatus = 1; //MODEL_ERROR
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimLandSatModel::initFromHeader: " << "Unknown satellite name : " << satname << std::endl;
+      }
+   }   
+   
+   
+   //***
+   // Assign the meridianal angle. The Meridianal angle is
+   // the angle between true north and the vehicles ground track. The
+   // orientation angle is the rotation of the raster image from north (this
+   // will be 0 for map-oriented imagery).
+   //
+   // Compute meridianal angle between the along-track direction
+   // and the meridian going through the scene center excluding earth rotation
+   // effects. The spherical triangle equation is Napier's rule for right-angle
+   // spherical triangles.  This angle is a negative number from -8.2 to -90
+   // depending on scene latitude:
+   //***
+   double phi_c = ossim::atand(ossim::tand(theRefGndPt.lat)/
+                               GEODETIC_2_GEOCENTRIC_FACTOR);
+   double cos_phi_c   = ossim::cosd(phi_c);
+   theMeridianalAngle = -ossim::asind(ossim::cosd(theOrbitInclination) / cos_phi_c);
+   theMapAzimAngle = head.theOrientationAngle;
+
+   //***
+   // Fetch the corner points from the header:
+   //***
+   ossimDpt v[4]; // temporarily holds vertices for ground polygon
+   v[0] = head.theUL_Corner;
+   v[1] = head.theUR_Corner;
+   v[2] = head.theLR_Corner;
+   v[3] = head.theLL_Corner;
+   theBoundGndPolygon = ossimPolygon(4, v);
+
+   //***
+   // Initialize map projection parameters:
+   // Determine the projection/orientation type:
+   //***
+   ossimString orient_type = head.theProductType;
+   ossimString proj_type   = head.theMapProjectionName;
+   if (proj_type.contains("SOM"))
+   {
+      //***
+      // Inverse the line direction GSD for SOM, since projection "intrack"
+      // axis (x) is descending:
+      //***
+      if (orient_type.contains("ORBIT"))
+         theProjectionType  = SOM_ORBIT;
+      else
+         theProjectionType = SOM_MAP;
+
+      // this is a hack.  After testing two it is consistently off
+      // by 90 degrees.
+      //
+      theMapAzimAngle -= 90.0;
+   }
+   else if (proj_type.contains("UTM"))
+   {
+      if (orient_type.contains("ORBIT"))
+         theProjectionType  = UTM_ORBIT;
+      else
+         theProjectionType = UTM_MAP;
+   }
+   else
+   {
+      theErrorStatus = 1; //MODEL_ERROR
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimLandSatModel::initFromHeader: "
+                                             << "Unknown projection/orientation type." << std::endl;
+      }
+      return;
+   }
+
+   //***
+   // Establish the map projection:
+   //***
+   initMapProjection();
+
+      
+   theMapOffset = theMapProjection->forward(head.theUL_Corner);
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimLandSatModel::initFromHeader:"
+         << "\ntheMapProjection:\n";
+
+      theMapProjection->print(ossimNotify(ossimNotifyLevel_DEBUG));
+
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nHeader upper left ground point:  " << head.theUL_Corner
+         << std::endl;
+   }
+
+   //*** 
+   // initialize remaining data members:
+   //***
+   initAdjustableParameters();
+   updateModel();
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initFromHeader: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  METHOD: ossimLandSatModel::lineSampleHeightToWorld()
+//  
+//  Performs the line/sample to groundpoint projection given an elevation.
+//  
+//  5. Intersect imaging ray with elevation surface.
+//
+//*****************************************************************************
+void ossimLandSatModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                                const double&   height,
+                                                ossimGpt&       gpt) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::lineSampleHeightToWorld: entering..." << std::endl;
+
+#if 0
+   //***
+   // Extrapolate if point is outside image:
+   //***
+   if (!insideImage(image_point))
+   {
+      gpt = extrapolate(image_point, height);
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::lineSampleHeightToWorld: returning..." << std::endl;
+      return;
+   }
+#endif
+   
+   //***
+   // First establish imaging ray from image point:
+   //***
+   ossimEcefRay imaging_ray;
+   imagingRay(image_point, imaging_ray);
+   ossimEcefPoint Pecf (imaging_ray.intersectAboveEarthEllipsoid(height));
+   gpt = ossimGpt(Pecf);
+}
+   
+   
+//*****************************************************************************
+//  METHOD: ossimLandSatModel::imagingRay()
+//  
+//  This model implements an affine transform with scaling to arrive at an
+//  ECF ray given an image point. This ray is intersected with a constant
+//  elevation surface to arrive at a ground point. The transform to arrive at a
+//  point on the ground [p,l,0] is implemented briefly as follows:
+//
+//  0. Establish the lat/lon map point given input point.
+//
+//  1. Determine intrack/crosstrack coordinates of image map point by rotating
+//     the input coordinates by meridianal angle.
+//
+//  2. Given intrack line number, compute vehicle position at time of imaging.
+//
+//  3. Establish imaging ray given input point ground coordinates and vehicle
+//     position.
+//
+//  4. Perturb imaging ray by adjustable parameters for platform attitude and
+//     position error.
+//
+//*****************************************************************************
+void ossimLandSatModel::imagingRay(const ossimDpt& inImgPt,
+                                   ossimEcefRay&   image_ray) const
+{
+#if 0
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "ossimLandSatModel::imagingRay: entering..." << std::endl;
+
+   bool debug_flag = false; // setable by interactive debugger
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "inImgPt = " << inImgPt << std::endl;
+   }
+#endif
+   
+   //***
+   // Get ground point for given map image point:
+   //***
+   ossimDpt rot_img_pt(-inImgPt.line*theMapAzimSin+inImgPt.samp*theMapAzimCos,
+                        inImgPt.line*theMapAzimCos+inImgPt.samp*theMapAzimSin);
+   ossimDpt map_point 
+      (theMapOffset.x + rot_img_pt.samp*(theGSD.samp+theSampGsdCorr), 
+       theMapOffset.y - rot_img_pt.line*(theGSD.line+theLineGsdCorr));
+
+   ossimGpt inGndPt (theMapProjection->inverse(map_point));
+
+#if 0
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t theMapOffset="<<theMapOffset<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t rot_img_pt="<<rot_img_pt<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t image point map_point="<<map_point<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t inGndPt="<<inGndPt<<endl;
+   }
+#endif
+   //***
+   // Rotate the image map coordinates by the map-to-IC rotation
+   // to arrive at intrack/crosstrack coordinate:
+   //***
+   ossimDpt offInMapPt (inImgPt - theRefImgPt);
+   ossimDpt icInPt
+      (offInMapPt.line*theMap2IcRotSin + offInMapPt.samp*theMap2IcRotCos,
+       offInMapPt.line*theMap2IcRotCos - offInMapPt.samp*theMap2IcRotSin);
+
+#if 0
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t offInMapPt="<<offInMapPt<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t icInPt="<<icInPt<<endl;
+   }
+#endif
+   
+   //***
+   // Establish an image map point at vehicle NADIR corresponding to imaging
+   // line:
+   //***
+   ossimDpt icNdrPt (0.0, icInPt.line);
+   ossimDpt offNdrMapPt
+      (-icNdrPt.line*theMap2IcRotSin + icNdrPt.samp*theMap2IcRotCos,
+        icNdrPt.line*theMap2IcRotCos + icNdrPt.samp*theMap2IcRotSin);
+   ossimDpt ndrMapPt(offNdrMapPt + theRefImgPt);
+   ossimDpt rotNdrMapPt
+      (-ndrMapPt.line*theMapAzimSin + ndrMapPt.samp*theMapAzimCos,
+       ndrMapPt.line*theMapAzimCos + ndrMapPt.samp*theMapAzimSin);
+
+#if 0
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t icNdrPt="<<icNdrPt<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t offNdrMapPt="<<offNdrMapPt<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t ndrMapPt="<<ndrMapPt<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t rotNdrMapPt="<<rotNdrMapPt<<endl;
+   }
+#endif
+
+   //***
+   // Establish the vehicle position at time of line imaging:
+   //***
+   map_point.y =theMapOffset.y+rotNdrMapPt.x*(theGSD.x+theSampGsdCorr);
+   if ((theProjectionType == SOM_ORBIT) || (theProjectionType == SOM_MAP))
+      map_point.x = theMapOffset.x+rotNdrMapPt.y*(theGSD.y+theLineGsdCorr);
+   else
+      map_point.x = theMapOffset.x-rotNdrMapPt.y*(theGSD.y+theLineGsdCorr);
+      
+   ossimGpt vehiclePlhPos(theMapProjection->inverse(map_point));
+   vehiclePlhPos.hgt = theOrbitAltitude;
+
+#if 0
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t map_point="<<map_point<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t vehiclePlhPos="<<vehiclePlhPos<<endl;
+   }
+#endif
+   
+   //***
+   // Establish an LSR space at the vehicle with X along the intrack direction:
+   //***
+   ossimLsrSpace icrSpace (vehiclePlhPos, theMeridianalAngle-90.0);
+
+#if 0
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t icrSpace="<<icrSpace<<endl;
+   }
+#endif
+
+   //***
+   // Now establish a ray pointing to the imaged ground point from the vehicle
+   // in ICR space:
+   //***
+   ossimLsrPoint lsrInPt (inGndPt, icrSpace);
+   ossimLsrPoint vehicleLsrPos (0.0, 0.0, 0.0, icrSpace);
+   ossimLsrRay   initLsrImgRay (vehicleLsrPos, lsrInPt);
+
+#if 0
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t initLsrImgRay="<<initLsrImgRay<<endl;
+   }
+#endif
+
+   //***
+   // Establish the attitude rotation matrix considering the attitude biases
+   // and rates:
+   //***
+   double cos, sin;
+   double norm_line = inImgPt.line/theImageSize.line;
+   double yaw = theYawOffset + theYawRate*norm_line;
+   cos = ossim::cosd(yaw);
+   sin = ossim::sind(yaw);
+   NEWMAT::Matrix T_yaw = ossimMatrix3x3::create( cos,-sin, 0.0,
+                                                  sin, cos, 0.0,
+                                                  0.0, 0.0, 1.0);
+   NEWMAT::Matrix attRotMat = T_yaw * theRollRotMat;
+
+   //***
+   // Now apply the perturbation to the ray due to the adjustable parameters,
+   // and arrive at the ECF adjusted imaging ray:
+   //***
+   ossimLsrVector adjLsrImgRayDir (attRotMat*initLsrImgRay.direction().data(),
+                                   icrSpace);
+   ossimLsrPoint  adjLsrImgRayOrg (theIntrackOffset,
+                                   theCrtrackOffset,
+                                   0.0,  // no radial adjustment of position
+                                   icrSpace);
+   ossimLsrRay adjLsrImgRay (adjLsrImgRayOrg, adjLsrImgRayDir);
+   image_ray = ossimEcefRay(adjLsrImgRay);
+
+#if 0
+   if (traceDebug() || debug_flag)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t adjLsrImgRay="<<adjLsrImgRay<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\t image_ray="<<image_ray<<endl;
+   }
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::imagingRay: Returning..." << std::endl;
+   }
+#endif
+}
+
+//*****************************************************************************
+//  METHOD: ossimLandSatModel::print()
+//  
+//  Formatted dump of data members.
+//  
+//*****************************************************************************
+std::ostream& ossimLandSatModel::print(std::ostream& os) const
+{
+   os << "\nDump of ossimLandSatModel object at "
+      << hex << this << ":\n"
+      << "\nLandSatModel -- Dump of all data members: "
+      << "\n         theImageID: " << theImageID.chars()
+      << "\n       theImageSize: " << theImageSize
+      << "\n        theRefImgPt: " << theRefImgPt
+      << "\n        theRefGndPt: " << theRefGndPt
+      << "\n        theGSD.line: " << theGSD.line
+      << "\n        theGSD.samp: " << theGSD.samp
+      << "\n  theProjectionType: " << PROJ_TYPE[theProjectionType]
+      << "\n         theMapZone: " << theMapZone
+      << "\n       theMapOffset: " << theMapOffset
+      << "\n   theWrsPathNumber: " << theWrsPathNumber
+      << "\n    theWrsRowNumber: " << theWrsRowNumber
+      << "\n    theIllumAzimuth: " << theIllumAzimuth
+      << "\n  theIllumElevation: " << theIllumElevation
+      << "\n   thePositionError: " << thePositionError
+      << "\n theMeridianalAngle: " << theMeridianalAngle
+      << "\n   theOrbitAltitude: " << theOrbitAltitude
+      << "\ntheOrbitInclination: " << theOrbitInclination
+      << "\n    theMapAzimAngle: " << theMapAzimAngle
+      << "\n  theMap2IcRotAngle: " << theMap2IcRotAngle
+      << "\n   theIntrackOffset: " << theIntrackOffset
+      << "\n   theCrtrackOffset: " << theCrtrackOffset
+      << "\n     theLineGsdCorr: " << theLineGsdCorr
+      << "\n     theSampGsdCorr: " << theSampGsdCorr
+      << "\n      theRollOffset: " << theRollOffset
+      << "\n       theYawOffset: " << theYawOffset
+      << "\n         theYawRate: " << theYawRate
+      << "\n     theMapRotation: " << theMapRotation
+      << endl;
+
+   return ossimSensorModel::print(os);
+}
+
+//*****************************************************************************
+//  METHOD: ossimLandSatModel::saveState()
+//  
+//  Saves the model state to the KWL. This KWL also serves as a geometry file.
+//  
+//*****************************************************************************
+bool ossimLandSatModel::saveState(ossimKeywordlist& kwl,
+                              const char* prefix) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::saveState: entering..." << std::endl;
+
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, TYPE_NAME(this));
+
+   //***
+   // Hand off to base class for common stuff:
+   //***
+   ossimSensorModel::saveState(kwl, prefix);
+
+   //***
+   // Save off data members:
+   //***
+   kwl.add(prefix, PROJECTION_TYPE_KW,   theProjectionType, true);
+   kwl.add(prefix, MAP_ZONE_KW,          theMapZone, true);
+   kwl.add(prefix, MAP_OFFSET_X_KW,      theMapOffset.x, true);
+   kwl.add(prefix, MAP_OFFSET_Y_KW,      theMapOffset.y, true);
+   kwl.add(prefix, WRS_PATH_NUMBER_KW,   theWrsPathNumber, true);
+   kwl.add(prefix, ROW_NUMBER_KW,        theWrsRowNumber, true);
+   kwl.add(prefix, ILLUM_AZIMUTH_KW,     theIllumAzimuth, true);
+   kwl.add(prefix, ILLUM_ELEVATION_KW,   theIllumElevation, true);
+   kwl.add(prefix, MERIDIANAL_ANGLE_KW,  theMeridianalAngle, true);
+   kwl.add(prefix, ORBIT_ALTITUDE_KW,    theOrbitAltitude, true);
+   kwl.add(prefix, ORBIT_INCLINATION_KW, theOrbitInclination, true);
+   kwl.add(prefix, MAP_AZIM_ANGLE_KW,    theMapAzimAngle, true);
+   kwl.add(prefix, MAP_2Ic_ROT_ANGLE_KW, theMap2IcRotAngle, true);
+
+//    kwl.add(prefix, INTRACK_OFFSET_KW ,   theIntrackOffset, true);
+//    kwl.add(prefix, CRTRACK_OFFSET_KW,    theCrtrackOffset, true);
+//    kwl.add(prefix, LINE_GSD_CORR_KW,     theLineGsdCorr, true);
+//    kwl.add(prefix, SAMP_GSD_CORR_KW,     theSampGsdCorr, true);
+//    kwl.add(prefix, ROLL_OFFSET_KW,       theRollOffset, true);
+//    kwl.add(prefix, YAW_OFFSET_KW,        theYawOffset, true);
+//    kwl.add(prefix, YAW_RATE_KW,          theYawRate, true);
+//    kwl.add(prefix, MAP_ROTATION_KW,      theMapRotation, true);
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::saveState: returning..." << std::endl;
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimLandSatModel::loadState()
+//  
+//  Restores the model's state from the KWL. This KWL also serves as a
+//  geometry file.
+//  
+//*****************************************************************************
+bool ossimLandSatModel::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix) 
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState: entering..." << std::endl;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState:"
+                                          << "\nInput kwl:  " << kwl
+                                          << std::endl;
+   }
+
+   const char* value = NULL;
+   const char* keyword =NULL;
+   bool success;
+
+   //***
+   // Assure this keywordlist contains correct type info:
+   //***
+   value = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if (!value || (strcmp(value, TYPE_NAME(this)))) 
+     {
+       theErrorStatus = 1;
+       return false;
+     }
+
+   //
+   // Clear out any existing adjustable params:
+   //
+   if(getNumberOfAdjustableParameters() != NUM_ADJUSTABLE_PARAMS)
+     {
+       initAdjustableParameters();
+     }
+   
+   //***
+   // Pass on to the base-class for parsing first:
+   //***
+   success = ossimSensorModel::loadState(kwl, prefix);
+   if (!success) 
+     {
+       theErrorStatus++;
+       return false;
+     }
+ 
+   keyword = PROJECTION_TYPE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+
+   theProjectionType = (ProjectionType) atoi(value);
+ 
+   keyword = MAP_ZONE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theMapZone = atoi(value);
+ 
+   keyword = MAP_OFFSET_X_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theMapOffset.x = atof(value);
+ 
+   keyword = MAP_OFFSET_Y_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theMapOffset.y = atof(value);
+ 
+   keyword = WRS_PATH_NUMBER_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theWrsPathNumber = atoi(value);
+
+   keyword = ROW_NUMBER_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theWrsRowNumber = atoi(value);
+ 
+   keyword = ILLUM_AZIMUTH_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theIllumAzimuth = atof(value);
+ 
+   keyword = ILLUM_ELEVATION_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theIllumElevation = atof(value);
+ 
+   keyword = MERIDIANAL_ANGLE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theMeridianalAngle = atof(value);
+ 
+   keyword = ORBIT_ALTITUDE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theOrbitAltitude = atof(value);
+   
+   keyword = ORBIT_INCLINATION_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theOrbitInclination = atof(value);
+   
+   keyword = MAP_AZIM_ANGLE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theMapAzimAngle = atof(value);
+ 
+   keyword = MAP_2Ic_ROT_ANGLE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+     {
+       theErrorStatus++;
+       return false;
+     }
+   theMap2IcRotAngle = atof(value);
+
+   theIntrackOffset = 0.0;
+   theCrtrackOffset = 0.0;
+   theLineGsdCorr   = 0.0;
+   theSampGsdCorr   = 0.0;
+   theRollOffset    = 0.0;
+   theYawOffset     = 0.0;
+   theYawRate       = 0.0;
+   theMapRotation   = 0.0;
+
+   //***
+   // Adjustable parameters are optional keywords:
+   //***
+//    keyword = INTRACK_OFFSET_KW;
+//    value = kwl.find(prefix, keyword);
+//    if(value)
+//       theIntrackOffset = ossimString(value).toDouble();
+//    else
+//     theIntrackOffset = 0.0;
+   
+//    keyword = CRTRACK_OFFSET_KW;
+//    value = kwl.find(prefix, keyword);
+//    if(value)
+//       theCrtrackOffset = ossimString(value).toDouble();
+//    else
+//      theCrtrackOffset = 0.0;
+
+//    keyword = LINE_GSD_CORR_KW;
+//    value = kwl.find(prefix, keyword);
+//    if(value)
+//       theLineGsdCorr = ossimString(value).toDouble();
+//    else
+//       theLineGsdCorr = 0.0;
+
+//    keyword = SAMP_GSD_CORR_KW;
+//    value = kwl.find(prefix, keyword);
+//    if(value)
+//       theSampGsdCorr = ossimString(value).toDouble();
+//    else
+//       theSampGsdCorr = 0.0;
+   
+//    keyword = ROLL_OFFSET_KW;
+//    value = kwl.find(prefix, keyword);
+//    if(value)
+//       theRollOffset = ossimString(value).toDouble();
+//    else
+//       theRollOffset = 0.0;
+   
+//    keyword = YAW_OFFSET_KW;
+//    value = kwl.find(prefix, keyword);
+//    if(value)
+//       theYawOffset = ossimString(value).toDouble();
+//    else
+//      theYawOffset = 0.0;
+   
+//    keyword = YAW_RATE_KW;
+//    value = kwl.find(prefix, keyword);
+//    if(value)
+//       theYawRate = ossimString(value).toDouble();
+//    else
+//       theYawRate = 0.0;
+
+//    keyword = MAP_ROTATION_KW;
+//    value = kwl.find(prefix,  keyword);
+//    if(value)
+//       theMapRotation = ossimString(value).toDouble();
+//    else
+//       theMapRotation = 0.0;
+
+   //***
+   // Initialize given parameters read:
+   //***
+   initMapProjection();
+   updateModel();
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::loadState: returning..." << std::endl;
+   return true;
+}
+
+//*****************************************************************************
+// STATIC METHOD: ossimLandSatModel::writeGeomTemplate
+//  
+//  Writes a sample kwl to output stream.
+//  
+//*****************************************************************************
+void ossimLandSatModel::writeGeomTemplate(ostream& os)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: entering..." << std::endl;
+
+   os <<
+      "//**************************************************************\n"
+      "// Template for LandSat model keywordlist\n"
+      "//**************************************************************\n"
+      << ossimKeywordNames::TYPE_KW << ": " << "ossimLandSatModel" << endl;
+
+   ossimSensorModel::writeGeomTemplate(os);
+   
+   os << "//\n"
+      << "// Derived-class ossimLandSatModel Keywords:\n"
+      << "//\n"
+      << PROJECTION_TYPE_KW     << ": <float>\n"
+      << MAP_ZONE_KW            << ": <float>\n"
+      << MAP_OFFSET_X_KW        << ": <float>\n"
+      << MAP_OFFSET_Y_KW        << ": <float>\n"
+      << WRS_PATH_NUMBER_KW     << ": <float>\n"
+      << ROW_NUMBER_KW          << ": <float>\n"
+      << ILLUM_AZIMUTH_KW       << ": <float>\n"
+      << ILLUM_ELEVATION_KW     << ": <float>\n"
+      << MERIDIANAL_ANGLE_KW    << ": <float>\n"
+      << ORBIT_ALTITUDE_KW      << ": <float>\n"
+      << ORBIT_INCLINATION_KW   << ": <float>\n"
+      << MAP_AZIM_ANGLE_KW      << ": <float>\n"
+      << MAP_2Ic_ROT_ANGLE_KW   << ": <float>\n"
+      << INTRACK_OFFSET_KW      << ": <float> [optional]\n"
+      << CRTRACK_OFFSET_KW      << ": <float> [optional]\n"
+      << LINE_GSD_CORR_KW       << ": <float> [optional]\n"
+      << SAMP_GSD_CORR_KW       << ": <float> [optional]\n"
+      << ROLL_OFFSET_KW         << ": <float> [optional]\n"
+      << YAW_OFFSET_KW          << ": <float> [optional]\n"
+      << YAW_RATE_KW            << ": <float> [optional]\n"
+      << MAP_ROTATION_KW        << ": <float> [optional]\n"
+      << endl;
+   os << "\n" <<endl;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::writeGeomTemplate: returning..." << std::endl;
+   return;
+}
+
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimLandSatModel::initMapProjection()
+//  
+//*****************************************************************************
+void ossimLandSatModel::initMapProjection()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimLandSatModel::writeGeomTemplate: entering... " << std::endl;
+
+   theMapProjection = 0;   
+   //*** 
+   // Instantiate the proper map projection:
+   //***
+   if ((theProjectionType == SOM_ORBIT) || (theProjectionType == SOM_MAP))
+   {
+      theMapProjection = new ossimSpaceObliqueMercatorProjection(
+         ossimSpaceObliqueMercatorProjection::SOM_TYPE_LANDSAT_7,
+         (double)theWrsPathNumber);
+   }
+   else 
+   {
+      ossimUtmProjection* utm   = new ossimUtmProjection(theMapZone);
+      theMapProjection = utm;
+      if(theRefGndPt.latd() < 0.0)
+      {
+         utm->setHemisphere('S');
+      }
+      else
+      {
+         utm->setHemisphere('N');
+      }
+   }
+
+   //***
+   // Initialize angle sines/cosines used in phiLambda projection:
+   //***
+   theMap2IcRotAngle = theMeridianalAngle + theMapAzimAngle;
+   theMap2IcRotCos   = ossim::cosd(theMap2IcRotAngle);
+   theMap2IcRotSin   = ossim::sind(theMap2IcRotAngle);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimLandSatModel::writeGeomTemplate: returning... " << std::endl;
+   return;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD:
+//*****************************************************************************
+void  ossimLandSatModel::updateModel()
+{
+   //***
+   // Update the geometry...
+   // Adjusted = Initial + adj_parm[i]*adj_sigma[i]
+   // Some parameters have a zero initial value and that term is not included.
+   //***
+  theIntrackOffset = computeParameterOffset(INTRACK_OFFSET);
+  theCrtrackOffset = computeParameterOffset(CRTRACK_OFFSET);
+  theLineGsdCorr   = computeParameterOffset(LINE_GSD_CORR);
+  theSampGsdCorr   = computeParameterOffset(SAMP_GSD_CORR);
+  theRollOffset    = computeParameterOffset(ROLL_OFFSET);
+  theYawOffset     = computeParameterOffset(YAW_OFFSET);
+  theYawRate       = computeParameterOffset(YAW_RATE);
+  theMapRotation   = computeParameterOffset(MAP_ROTATION);
+
+//   int numParams = getNumberOfAdjustableParameters();
+   //***
+   // Now the initial values have been updated, zero out the adjustment:
+   //***
+//    for (int i=0; i<numParams; i++)
+//       setAdjustableParameter(i, 0.0);
+
+   //***
+   // Compute image-common values dependent on adjustable parameters:
+   //***
+   if (theProjectionType == UTM_ORBIT)
+   {
+      theMapAzimCos = ossim::cosd(-theMapAzimAngle + theMapRotation);
+      theMapAzimSin = ossim::sind(-theMapAzimAngle + theMapRotation);
+   }
+   else
+   {
+      theMapAzimCos = ossim::cosd(theMapAzimAngle + theMapRotation);
+      theMapAzimSin = ossim::sind(theMapAzimAngle + theMapRotation);
+   }
+
+   double cos = ossim::cosd(theRollOffset);
+   double sin = ossim::sind(theRollOffset);
+   theRollRotMat = ossimMatrix3x3::create( 1.0, 0.0, 0.0,
+                                           0.0, cos,-sin,
+                                           0.0, sin, cos);
+   
+   
+}
+//*****************************************************************************
+// PRIVATE METHOD: ossimLandSatModel::initAdjustableParameters()
+//  
+//  This method initializes the base class adjustable parameter and associated
+//  sigmas arrays with quantities specific to this model.
+//
+//  
+//*****************************************************************************
+void ossimLandSatModel::initAdjustableParameters()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initAdjustableParameters: entering..." << std::endl;
+
+   //
+   // Allocate storage for adjustables and assign their names and units strings
+   //
+   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
+   int numParams = getNumberOfAdjustableParameters();
+   //***
+   // Initialize base-class adjustable parameter array:
+   //***
+   for (int i=0; i<numParams; i++)
+   {
+      setAdjustableParameter(i, 0.0);
+      setParameterDescription(i, PARAM_NAMES[i]);
+      setParameterUnit(i,PARAM_UNITS[i]);
+   }
+   //***
+   // Initialize base-class parameter sigma array:
+   //***
+   setParameterSigma(INTRACK_OFFSET, 500.0); //change for Landsat 5
+   setParameterSigma(CRTRACK_OFFSET, 500.0); //change for Landsat 5
+   setParameterSigma(LINE_GSD_CORR, 0.005);  
+   setParameterSigma(SAMP_GSD_CORR, 0.005);  
+   setParameterSigma(ROLL_OFFSET, 0.01);  
+   setParameterSigma(YAW_OFFSET, 0.01);  
+   setParameterSigma(YAW_RATE, 0.05);  
+   setParameterSigma(MAP_ROTATION, 0.1);
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::initAdjustableParameters: returning..." << std::endl;
+}
+
+bool
+ossimLandSatModel::setupOptimizer(const ossimString& init_file)
+{
+   //init model using file path
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::setupOptimizer(init_file): entering..." << std::endl;
+
+   theMapProjection = 0;
+   theIntrackOffset = 0.0;
+   theCrtrackOffset = 0.0;
+   theLineGsdCorr   = 0.0;   
+   theSampGsdCorr   = 0.0;
+   theRollOffset    = 0.0;
+   theYawOffset     = 0.0;
+   theYawRate       = 0.0;
+   theMapRotation   = 0.0;
+
+   ossimRefPtr<ossimFfL7> ff_headerp;
+   if (ossimString::downcase(init_file).contains("header.dat"))
+   {
+      ossimRefPtr<ossimFfL5> h = new ossimFfL5(init_file); 
+      ff_headerp = h.get();
+      
+      if (!ff_headerp->getErrorStatus())
+      {
+         double d = fabs(h->revb()->theUlEasting - h->revb()->theCenterEasting)/h->theGsd;
+         h->theCenterImagePoint.x = static_cast<ossim_int32>(d); // d + 0.5 ???
+         
+         d = fabs(h->revb()->theUlNorthing - h->revb()->theCenterNorthing)/h->theGsd;
+         h->theCenterImagePoint.y = static_cast<ossim_int32>(d); // d + 0.5 ???
+         initFromHeader(*ff_headerp);
+         
+         theMapOffset.x = h->revb()->theUlEasting;
+         theMapOffset.y = h->revb()->theUlNorthing;
+         
+      }
+      else
+      {
+         ff_headerp = 0;
+      }
+   }
+   else
+   {
+      ff_headerp=new ossimFfL7(init_file);
+      if (!ff_headerp->getErrorStatus())
+      {
+         initFromHeader(*ff_headerp);
+      }
+      else
+      {
+         ff_headerp = 0;
+      }
+   }
+   if(!ff_headerp.valid())
+   {
+      //
+      // If not header, then check for possible KWL file. The loadState sets the
+      // error status:
+      //
+      ossimFilename init_filename(init_file);
+      ossimKeywordlist kwl(init_filename);
+      loadState(kwl);
+   }
+
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimLandSatModel::setupOptimizer(init_file): Exited..." << std::endl;
+   return true;
+}
diff --git a/src/projection/ossimLensDistortion.cpp b/src/projection/ossimLensDistortion.cpp
new file mode 100644
index 0000000..834bfa9
--- /dev/null
+++ b/src/projection/ossimLensDistortion.cpp
@@ -0,0 +1,130 @@
+//*******************************************************************
+// Copyright (C) 2005 Garrett Potts
+//
+// LGPL
+// 
+// Author:  Garrett Potts
+//
+// Description:
+//
+// ossimLensDistortion
+//*******************************************************************
+//  $Id: ossimLensDistortion.cpp 15929 2009-11-16 18:20:46Z gpotts $
+#include <sstream>
+#include <ossim/projection/ossimLensDistortion.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+
+RTTI_DEF1(ossimLensDistortion, "ossimLensDistortion", ossim2dTo2dTransform);
+
+bool ossimLensDistortion::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix)const
+{
+   ossim2dTo2dTransform::saveState(kwl, prefix);
+   
+   kwl.add(prefix,
+           "center",
+           ossimString::toString(theCenter.x) + " " + ossimString::toString(theCenter.y),
+           true);
+
+   return true;
+}
+
+bool ossimLensDistortion::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   const char* center = kwl.find(prefix, "center");
+   theCenter.x = 0.0;
+   theCenter.y = 0.0;
+   
+   if(center)
+   {
+      std::vector<ossimString> splitString;
+      ossimString tempString(center);
+      tempString = tempString.trim();
+      tempString.split(splitString, " ");
+      if(splitString.size() == 2)
+      {
+         theCenter.x = splitString[0].toDouble();
+         theCenter.y = splitString[1].toDouble();
+      }
+   }
+
+   return ossim2dTo2dTransform::loadState(kwl, prefix);
+
+}
+
+void ossimLensDistortion::distort(const ossimDpt& input, ossimDpt& output)const
+{
+   int iters = 0;
+   
+   //***
+   // Begin with guess. Forward transform is defined as trasforming left to
+   // right. We are therefore solving for left:
+   //***
+   ossimDpt left (input);
+   ossimDpt left_dx;
+   ossimDpt left_dy;
+   ossimDpt right;
+   ossimDpt right_dx;
+   ossimDpt right_dy;
+   ossimDpt dr_dx;
+   ossimDpt dr_dy;
+   ossimDpt r_diff;
+   ossimDpt l_diff;
+   double inverse_norm;
+   
+   //***
+   // Begin iterations:
+   //***
+   do
+   {
+      //***
+      // establish perturbed image points about the guessed point:
+      //***
+      left_dx.x = left.x + 1.0;
+      left_dx.y = left.y;
+      left_dy.x = left.x;
+      left_dy.y = left.y + 1.0;
+      
+      //***
+      // Compute numerical partials at current guessed point:
+      //***
+      undistort(left,    right);
+      undistort(left_dx, right_dx);
+      undistort(left_dy, right_dy);
+      
+      dr_dx.x = (right_dx.x - right.x); //e
+      dr_dx.y = (right_dx.y - right.y); //g
+      dr_dy.x = (right_dy.x - right.x); //f
+      dr_dy.y = (right_dy.y - right.y); //h
+      
+      //***
+      // Test for convergence:
+      //***
+      r_diff = input - right;
+      
+      //***
+      // Compute linearized estimate of image point given gp delta:
+      //***
+      inverse_norm = dr_dy.u*dr_dx.v - dr_dx.u*dr_dy.v; // fg-eh
+      if (std::fabs(inverse_norm) > DBL_EPSILON)
+      {
+         l_diff.u = (-dr_dy.v*r_diff.u + dr_dy.u*r_diff.v)/inverse_norm;
+         l_diff.v = ( dr_dx.v*r_diff.u - dr_dx.u*r_diff.v)/inverse_norm;
+         left += l_diff;
+      }
+      else
+      {
+         l_diff.u = 0;
+         l_diff.v = 0;
+      }
+      
+      iters++;
+      
+   } while (((fabs(l_diff.u) > theConvergenceThreshold) ||
+             (fabs(l_diff.v) > theConvergenceThreshold)) &&
+            (iters < theMaxIterations));
+   output = left;
+}
+
diff --git a/src/projection/ossimLlxyProjection.cpp b/src/projection/ossimLlxyProjection.cpp
new file mode 100644
index 0000000..f4fc011
--- /dev/null
+++ b/src/projection/ossimLlxyProjection.cpp
@@ -0,0 +1,321 @@
+//*******************************************************************
+// Copyright (C) 2002 ImageLinks Inc.
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for ossimLlxy.  This is a simple "latitude /
+// longitude to x / y" projection.
+// 
+//*******************************************************************
+//  $Id: ossimLlxyProjection.cpp 20060 2011-09-07 12:33:46Z gpotts $
+
+#include <ossim/projection/ossimLlxyProjection.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDatum.h>
+
+// RTTI information for the ossimMapProjection
+RTTI_DEF1(ossimLlxyProjection, "ossimLlxyProjection" , ossimMapProjection);
+
+// About 1 meter.
+static const ossim_float64 DEFAULT_DEGREES_PER_PIXEL = 8.9831528412e-006;
+
+ossimLlxyProjection::ossimLlxyProjection()
+{
+  // set to about 1 meter per pixel
+   theDegreesPerPixel.y = DEFAULT_DEGREES_PER_PIXEL;
+   theDegreesPerPixel.x = DEFAULT_DEGREES_PER_PIXEL;
+   theUlEastingNorthing.y = ossim::nan();
+   theUlEastingNorthing.x = ossim::nan();
+   computeMetersPerPixel(theOrigin, 
+			 theDegreesPerPixel.y,
+			 theDegreesPerPixel.x,
+			 theMetersPerPixel);
+}
+
+ossimLlxyProjection::ossimLlxyProjection(const ossimLlxyProjection& rhs)
+   :
+      ossimMapProjection(rhs)
+{
+   theOrigin              = rhs.theOrigin;
+   theUlGpt               = rhs.theUlGpt;
+   theUlEastingNorthing.y = ossim::nan();
+   theUlEastingNorthing.x = ossim::nan();
+   theDatum               = theOrigin.datum();
+   theEllipsoid           = *(theDatum->ellipsoid());
+   theDegreesPerPixel.y    = rhs.theDegreesPerPixel.y;
+   theDegreesPerPixel.x    = rhs.theDegreesPerPixel.x;
+   computeMetersPerPixel(theOrigin, 
+			 theDegreesPerPixel.y,
+			 theDegreesPerPixel.x,
+			 theMetersPerPixel);
+}
+
+ossimLlxyProjection::ossimLlxyProjection(const ossimGpt& origin,
+                                         double latSpacing,
+                                         double lonSpacing)
+   :
+      ossimMapProjection()
+{
+   theOrigin              = origin;
+   theUlGpt               = origin;
+   theUlEastingNorthing.y = 0.0;
+   theUlEastingNorthing.x = 0.0;
+   theDatum               = theOrigin.datum();
+   theEllipsoid           = *(theDatum->ellipsoid());
+   theDegreesPerPixel.y    = latSpacing;
+   theDegreesPerPixel.x    = lonSpacing;
+   computeMetersPerPixel(theOrigin, 
+			 theDegreesPerPixel.y,
+			 theDegreesPerPixel.x,
+			 theMetersPerPixel);
+}
+
+ossimLlxyProjection::ossimLlxyProjection(const ossimEllipsoid& ellipsoid,
+					 const ossimGpt& origin)
+  :ossimMapProjection(ellipsoid, origin)
+{
+   theDegreesPerPixel.y = 1.0;
+   theDegreesPerPixel.x = 1.0;
+   theUlEastingNorthing.y = ossim::nan();
+   theUlEastingNorthing.x = ossim::nan();
+   computeMetersPerPixel(theOrigin, 
+			 theDegreesPerPixel.y,
+			 theDegreesPerPixel.x,
+			 theMetersPerPixel);
+}
+
+ossimLlxyProjection::~ossimLlxyProjection()
+{
+}
+
+ossimObject* ossimLlxyProjection::dup()const
+{
+   return new ossimLlxyProjection(*this);
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::computeDegreesPerPixel
+//  
+//*****************************************************************************
+void ossimLlxyProjection::computeDegreesPerPixel(const ossimGpt& ground,
+                                                const ossimDpt& metersPerPixel,
+                                                double &deltaLat,
+                                                double &deltaLon)
+{
+   ossimDpt mpd = ground.metersPerDegree();
+   ossimDpt dpm(1.0/mpd.x,
+                1.0/mpd.y);
+   deltaLat = metersPerPixel.y*dpm.y;
+   deltaLon = metersPerPixel.x*dpm.x;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::computeMetersPerPixel
+//  
+//*****************************************************************************
+void ossimLlxyProjection::computeMetersPerPixel(const ossimGpt& center,
+						  double deltaDegreesPerPixelLat,
+						  double deltaDegreesPerPixelLon,
+						  ossimDpt &metersPerPixel)
+{
+  metersPerPixel = center.metersPerDegree();
+  metersPerPixel.x *= deltaDegreesPerPixelLon;
+  metersPerPixel.y *= deltaDegreesPerPixelLat;
+}
+
+void ossimLlxyProjection::worldToLineSample(const ossimGpt& worldPoint,
+                                            ossimDpt&       lineSampPt) const
+{
+   ossimGpt gpt = worldPoint;
+   
+   if (*theOrigin.datum() != *gpt.datum())
+   {
+      // Apply datum shift if it's not the same.
+      gpt.changeDatum(theOrigin.datum());
+   }
+
+   lineSampPt.line = (theUlGpt.latd() - gpt.latd()) / theDegreesPerPixel.y;
+   lineSampPt.samp = (gpt.lond() - theUlGpt.lond()) / theDegreesPerPixel.x;
+}
+
+void ossimLlxyProjection::lineSampleToWorld(const ossimDpt& lineSampPt,
+                                            ossimGpt&       worldPt) const
+{
+   worldPt.makeNan();
+   // Start with the origin.  This will keep the origin's datum.
+   worldPt.datum(theOrigin.datum());
+   
+   double lat = theUlGpt.latd() - (lineSampPt.line * theDegreesPerPixel.y);
+   double lon = theUlGpt.lond() + (lineSampPt.samp * theDegreesPerPixel.x);
+
+   //---
+   // Assuming the origin had a lon between -180 and 180 and lat between -90
+   // and 90.
+   //---
+//    if (lon > 180.0)
+//    {
+//       lon -= 360.0;
+//    }
+//    else if (lon < -180.0)
+//    {
+//       lon += 360.0;
+//    }
+//    if (lat > 90.0)
+//    {
+//       lat -= 90.0;
+//    }
+//    else if (lat < -90.0)
+//    {
+//       lat = -180.0 - lat;
+//    }
+
+   worldPt.latd(lat);
+   worldPt.lond(lon);
+   if(theElevationLookupFlag)
+   {
+      worldPt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(worldPt);
+   }
+}
+
+std::ostream& ossimLlxyProjection::print(std::ostream& out) const
+{
+   out << setiosflags(ios::fixed) << setprecision(15)
+       << "ossimLlxyProjection dump:"
+       << "\norigin:  " << theOrigin
+       << "\nlatitude spacing in decimal degrees:   " << theDegreesPerPixel.y
+       << "\nlongitude spacing in decimal degrees:  " << theDegreesPerPixel.x
+       << "\n\nossimMapProjection dump:\n" << endl;
+
+   return ossimMapProjection::print(out);
+}
+
+void ossimLlxyProjection::setMetersPerPixel(const ossimDpt& pt)
+{
+  ossimMapProjection::setMetersPerPixel(pt);
+  computeDegreesPerPixel(theOrigin,
+			 theMetersPerPixel,
+			 theDegreesPerPixel.y,
+			 theDegreesPerPixel.x);
+}
+
+bool ossimLlxyProjection::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix) const
+{
+   // Base class...
+   ossimMapProjection::saveState(kwl, prefix);
+
+   return true;
+}
+
+bool ossimLlxyProjection::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   // Base class...
+   ossimMapProjection::loadState(kwl, prefix);
+
+   if (theOrigin.hasNans() == false)
+   {
+      if ( (theDegreesPerPixel.hasNans() == false) &&
+           theMetersPerPixel.hasNans() )
+      {
+         // Compute meters per pixel from origin and decimal degrees.
+         computeMetersPerPixel(theOrigin, 
+                               theDegreesPerPixel.y,
+                               theDegreesPerPixel.x,
+                               theMetersPerPixel);
+      }
+      else if( (theMetersPerPixel.hasNans() == false) &&
+               theDegreesPerPixel.hasNans() )
+      {
+         // Compute decimal degrees per pixel from origin and meters.
+         computeDegreesPerPixel(theOrigin, 
+                                theMetersPerPixel,
+                                theDegreesPerPixel.y,
+                                theDegreesPerPixel.x);
+      }
+      else
+      {
+         // Assign some value.
+         theDegreesPerPixel.y = DEFAULT_DEGREES_PER_PIXEL;
+         theDegreesPerPixel.x = DEFAULT_DEGREES_PER_PIXEL;
+         computeMetersPerPixel(theOrigin,
+                               theDegreesPerPixel.y,
+                               theDegreesPerPixel.x,
+                               theMetersPerPixel);
+      }
+   }
+    
+   return true;
+}
+
+bool ossimLlxyProjection::operator==(const ossimProjection& projection) const
+{
+   const ossimLlxyProjection* proj = dynamic_cast<const ossimLlxyProjection*>(&projection);
+   
+   if(!proj)
+   {
+      return false;
+   }
+
+   return ( // (theOrigin     == proj->theOrigin)     &&  // tmp... fix gpt!
+            (theDegreesPerPixel.y == proj->theDegreesPerPixel.y) &&
+            (theDegreesPerPixel.x == proj->theDegreesPerPixel.x) );
+}
+
+
+ossimDpt ossimLlxyProjection::forward(const ossimGpt &worldPoint) const
+{
+   ossimDpt result;
+
+   worldToLineSample(worldPoint, result);
+
+   return result;
+}
+
+ossimGpt ossimLlxyProjection::inverse(const ossimDpt &projectedPoint) const
+{
+   ossimGpt result;
+   
+   lineSampleToWorld(projectedPoint, result);
+   
+   return result;
+}
+
+void ossimLlxyProjection::setLatSpacing(double spacing)
+{
+   theDegreesPerPixel.y = spacing;
+
+   // Update the meters per pixel.
+   ossimDpt pt = ossimGpt(0.0, 0.0).metersPerDegree();
+   theMetersPerPixel.y = pt.y * theDegreesPerPixel.y;
+}
+
+void ossimLlxyProjection::setLonSpacing(double spacing)
+{
+   theDegreesPerPixel.x = spacing;
+
+   // Update the meters per pixel.
+   ossimDpt pt = ossimGpt(0.0, 0.0).metersPerDegree();
+   theMetersPerPixel.x = pt.x * theDegreesPerPixel.x;
+}
+
+bool ossimLlxyProjection::isGeographic() const
+{
+   return true;
+}
+
+double ossimLlxyProjection::getLatSpacing() const
+{
+   return theDegreesPerPixel.y;
+}
+
+double ossimLlxyProjection::getLonSpacing() const
+{
+   return theDegreesPerPixel.x;
+}
diff --git a/src/projection/ossimMapProjection.cpp b/src/projection/ossimMapProjection.cpp
new file mode 100644
index 0000000..32983ce
--- /dev/null
+++ b/src/projection/ossimMapProjection.cpp
@@ -0,0 +1,1699 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Base class for all map projections.
+// 
+//*******************************************************************
+//  $Id: ossimMapProjection.cpp 23418 2015-07-09 18:46:41Z gpotts $
+
+#include <iostream>
+#include <cstdlib>
+#include <iomanip>
+#include <sstream>
+
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDatumFactoryRegistry.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimMatrix3x3.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimTrace.h>
+
+static ossimTrace traceDebug("ossimMapProjection:debug");
+
+// RTTI information for the ossimMapProjection
+RTTI_DEF1(ossimMapProjection, "ossimMapProjection" , ossimProjection);
+
+ossimMapProjection::ossimMapProjection(const ossimEllipsoid& ellipsoid,
+                                       const ossimGpt& origin)
+   :theEllipsoid(ellipsoid),
+    theOrigin(origin),
+    theDatum(origin.datum()), // force no shifting
+    theUlGpt(0, 0),
+    theUlEastingNorthing(0, 0),
+    theFalseEastingNorthing(0, 0),
+    thePcsCode(0),
+    theElevationLookupFlag(false),
+    theModelTransform(),
+    theInverseModelTransform(),
+    theModelTransformUnitType(OSSIM_UNIT_UNKNOWN),
+    theProjectionUnits(OSSIM_METERS) 
+{
+   theUlGpt = theOrigin;
+   theUlEastingNorthing.makeNan();
+   theMetersPerPixel.makeNan();
+   theDegreesPerPixel.makeNan();
+}
+
+ossimMapProjection::ossimMapProjection(const ossimMapProjection& src)
+      : ossimProjection(src),
+        theEllipsoid(src.theEllipsoid),
+        theOrigin(src.theOrigin),
+        theDatum(src.theDatum),
+        theMetersPerPixel(src.theMetersPerPixel),
+        theDegreesPerPixel(src.theDegreesPerPixel),
+        theUlGpt(src.theUlGpt),
+        theUlEastingNorthing(src.theUlEastingNorthing),
+        theFalseEastingNorthing(src.theFalseEastingNorthing),
+        thePcsCode(src.thePcsCode),
+        theElevationLookupFlag(false),
+        theModelTransform(src.theModelTransform),
+        theInverseModelTransform(src.theInverseModelTransform),
+        theModelTransformUnitType(src.theModelTransformUnitType),
+        theProjectionUnits(src.theProjectionUnits)
+{
+}
+
+ossimMapProjection::~ossimMapProjection()
+{
+}
+
+ossimGpt ossimMapProjection::origin()const
+{
+   return theOrigin;
+}
+
+void ossimMapProjection::setPcsCode(ossim_uint32 pcsCode)
+{
+   thePcsCode = pcsCode;
+}
+
+ossim_uint32 ossimMapProjection::getPcsCode() const
+{
+   // The PCS code is not always set when the projection is instantiated with explicit parameters,
+   // since the code is only necessary when looking up those parameters in a database. However, it
+   // is still necessary to recognize when an explicit projection coincides with an EPSG-specified
+   // projection, and assign our PCS code to match it. So let's take this opportunity now to make 
+   // sure the PCS code is properly initialized.
+   if (thePcsCode == 0)
+   {
+      thePcsCode = ossimEpsgProjectionDatabase::instance()->findProjectionCode(*this);
+      if (thePcsCode == 0)
+         thePcsCode = 32767; // user-defined (non-EPSG) projection
+   }
+  
+   if (thePcsCode == 32767)
+      return 0; // 32767 only used internally. To the rest of OSSIM, the PCS=0 is undefined
+   
+   return thePcsCode;
+}
+
+ossimString ossimMapProjection::getProjectionName() const
+{
+   return getClassName();
+}
+
+double ossimMapProjection::getA() const
+{
+   return theEllipsoid.getA();
+}
+
+double ossimMapProjection::getB() const
+{
+   return theEllipsoid.getB();
+}
+
+double ossimMapProjection::getF() const
+{
+   return theEllipsoid.getFlattening();
+}
+
+ossimDpt ossimMapProjection::getMetersPerPixel() const
+{
+   return theMetersPerPixel;
+}
+
+const ossimDpt& ossimMapProjection::getDecimalDegreesPerPixel() const
+{
+   return theDegreesPerPixel;
+}
+
+const ossimDpt& ossimMapProjection::getUlEastingNorthing() const
+{
+   return theUlEastingNorthing;
+}
+
+const ossimGpt&   ossimMapProjection::getUlGpt() const
+{
+   return theUlGpt;
+}
+
+const ossimGpt& ossimMapProjection::getOrigin() const
+{
+  return theOrigin;
+}
+
+const ossimDatum* ossimMapProjection::getDatum() const
+{
+   return theDatum;
+}
+
+bool ossimMapProjection::isGeographic()const
+{
+   return false;
+}
+
+void ossimMapProjection::setEllipsoid(const ossimEllipsoid& ellipsoid)
+{
+   theEllipsoid = ellipsoid; update();
+}
+
+void ossimMapProjection::setAB(double a, double b)
+{
+   theEllipsoid.setA(a); theEllipsoid.setB(b); update();
+}
+
+void ossimMapProjection::setDatum(const ossimDatum* datum)
+{
+
+   if (!datum || (*theDatum == *datum))
+      return;
+
+   theDatum = datum; 
+   theEllipsoid = *(theDatum->ellipsoid());
+
+   // Change the datum of the ossimGpt data members:
+   theOrigin.changeDatum(theDatum);
+   theUlGpt.changeDatum(theDatum);
+
+   update();
+
+   // A change of datum usually implies a change of EPSG codes. Reset the PCS code. It will be
+   // reestablished as needed in the getPcsCode() method:
+   thePcsCode = 0;
+}
+
+void ossimMapProjection::setOrigin(const ossimGpt& origin)
+{
+   // Set the origin and since the origin has a datum which in turn has
+   // an ellipsoid, sync them up.
+   // NOTE: Or perhaps we need to change the datum of the input origin to that of theDatum? (OLK 05/11)
+   theOrigin    = origin;
+   theOrigin.changeDatum(theDatum);
+      
+   update();
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::assign
+//
+//*****************************************************************************
+void ossimMapProjection::assign(const ossimProjection &aProjection)
+{
+   if(&aProjection!=this)
+   {
+      ossimKeywordlist kwl;
+
+      aProjection.saveState(kwl);
+      loadState(kwl);
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::update
+//
+//*****************************************************************************
+void ossimMapProjection::update()
+{
+   // if the delta lat and lon per pixel is set then
+   // check to see if the meters were set.
+   //
+   if( hasModelTransform() )
+   {
+      updateFromTransform();
+   }
+   else if( theDegreesPerPixel.hasNans() == false )
+   {
+      if(theMetersPerPixel.hasNans())
+      {
+         computeMetersPerPixel();
+      }
+   }
+   else if(!theMetersPerPixel.hasNans())
+   {
+      computeDegreesPerPixel();
+   }
+   // compute the tie points if not already computed
+   //
+   // The tiepoint was specified either as easting/northing or lat/lon. Need to initialize the one
+   // that has not been assigned yet:
+   if (theUlEastingNorthing.hasNans() && !theUlGpt.hasNans())
+      theUlEastingNorthing = forward(theUlGpt);
+   else if (theUlGpt.hasNans() && !theUlEastingNorthing.hasNans())
+      theUlGpt = inverse(theUlEastingNorthing);
+   else if (theUlGpt.hasNans() && theUlEastingNorthing.hasNans())
+   {
+      theUlGpt = theOrigin;
+      theUlEastingNorthing = forward(theUlGpt);
+   }
+   if(theMetersPerPixel.hasNans() &&
+      theDegreesPerPixel.hasNans())
+   {
+      ossimDpt mpd = ossimGpt().metersPerDegree();
+      if(isGeographic())
+      {
+         theDegreesPerPixel.lat = 1.0/mpd.y;
+         theDegreesPerPixel.lon = 1.0/mpd.x;
+         computeMetersPerPixel();
+      }
+      else
+      {
+         theMetersPerPixel.x = 1.0;
+         theMetersPerPixel.y = 1.0;
+         computeDegreesPerPixel();
+     }
+   }
+}
+
+void ossimMapProjection::updateFromTransform()
+{
+   if ( hasModelTransform() )
+   {
+      const NEWMAT::Matrix& m = theModelTransform.getData();
+      ossimDpt ls1(0, 0);
+      ossimDpt ls2(1, 0);
+      ossimDpt ls3(0, 1);
+      ossimGpt wpt1;
+      ossimGpt wpt2;
+      lineSampleToWorld(ls1, wpt1);
+      ossimDpt mpt1(m[0][0]*ls1.x + m[0][1]*ls1.y + m[0][3],
+                    m[1][0]*ls1.x + m[1][1]*ls1.y + m[1][3]);
+      ossimDpt mpt2(m[0][0]*ls2.x + m[0][1]*ls2.y + m[0][3],
+                    m[1][0]*ls2.x + m[1][1]*ls2.y + m[1][3]);
+      ossimDpt mpt3(m[0][0]*ls3.x + m[0][1]*ls3.y + m[0][3],
+                    m[1][0]*ls3.x + m[1][1]*ls3.y + m[1][3]);
+      
+      double len = 1.0;
+      double len2 = 1.0;
+      switch(theModelTransformUnitType)
+      {
+         case OSSIM_DEGREES:
+         case OSSIM_MINUTES:
+         case OSSIM_SECONDS:
+         case OSSIM_RADIANS:
+         {
+            ossimUnitConversionTool ut;
+            len  = (mpt1-mpt2).length();
+            len2  = (mpt1-mpt3).length();
+            ut.setValue((len+len2)*.5, theModelTransformUnitType);
+            len = ut.getValue(OSSIM_DEGREES);
+            theDegreesPerPixel = ossimDpt(len, len);
+            theUlGpt = wpt1;
+            computeMetersPerPixel();
+            break;
+         }
+         default:
+         {
+            ossimUnitConversionTool ut;
+            len  = (mpt1-mpt2).length();
+            len2  = (mpt1-mpt3).length();
+            ut.setValue(mpt1.x, theModelTransformUnitType);
+            mpt1.x = ut.getValue(OSSIM_METERS);
+            ut.setValue(mpt1.y, theModelTransformUnitType);
+            mpt1.y = ut.getValue(OSSIM_METERS);
+            ut.setValue((len+len2)*.5, theModelTransformUnitType);
+            len = ut.getValue(OSSIM_METERS);
+            theMetersPerPixel = ossimDpt(len, len);
+            theUlEastingNorthing = mpt1;
+            computeDegreesPerPixel();
+            break;
+         }
+      }
+      theUlGpt = wpt1;
+   }
+
+}
+
+void ossimMapProjection::applyScale(const ossimDpt& scale,
+                                    bool recenterTiePoint)
+{
+   ossimDpt mapTieDpt;
+   ossimGpt mapTieGpt;
+   if (recenterTiePoint)
+   {
+      if (isGeographic())
+      {
+         mapTieGpt = getUlGpt();
+         mapTieGpt.lat += theDegreesPerPixel.lat/2.0;
+         mapTieGpt.lon -= theDegreesPerPixel.lon/2.0;
+      }
+      else
+      {
+         mapTieDpt = getUlEastingNorthing();
+         mapTieDpt.x -= theMetersPerPixel.x/2.0;
+         mapTieDpt.y += theMetersPerPixel.y/2.0;
+      }
+   }
+
+   theDegreesPerPixel.x *= scale.x;
+   theDegreesPerPixel.y *= scale.y;
+   theMetersPerPixel.x  *= scale.x;
+   theMetersPerPixel.y  *= scale.y;
+
+   if ( recenterTiePoint )
+   {
+      if (isGeographic())
+      {
+         mapTieGpt.lat -= theDegreesPerPixel.lat/2.0;
+         mapTieGpt.lon += theDegreesPerPixel.lon/2.0;
+         setUlTiePoints(mapTieGpt);
+      }
+      else
+      {
+         mapTieDpt.x += theMetersPerPixel.x/2.0;
+         mapTieDpt.y -= theMetersPerPixel.y/2.0;
+         setUlTiePoints(mapTieDpt);
+      }
+   }
+
+   if (theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
+   {
+      theModelTransform.getData()[0][0] = theModelTransform.getData()[0][0]*scale.x;
+      theModelTransform.getData()[1][1] = theModelTransform.getData()[1][1]*scale.y;
+
+      theInverseModelTransform = theModelTransform;
+      theInverseModelTransform.i();
+
+      updateFromTransform();
+   }
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::worldToLineSample
+//
+//*****************************************************************************
+ossimDpt ossimMapProjection::worldToLineSample(const ossimGpt &worldPoint)const
+{
+   ossimDpt result;
+
+   worldToLineSample(worldPoint, result);
+
+   return result;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::lineSampleToWorld
+//
+//*****************************************************************************
+ossimGpt ossimMapProjection::lineSampleToWorld(const ossimDpt &lineSample)const
+{
+   ossimGpt result;
+
+   lineSampleToWorld(lineSample, result);
+
+   return result;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::worldToLineSample
+//
+//*****************************************************************************
+void ossimMapProjection::worldToLineSample(const ossimGpt &worldPoint,
+                                           ossimDpt&       lineSample)const
+{
+
+   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
+   {
+      ossimGpt gpt = worldPoint;
+      if(theDatum)
+      {
+         gpt.changeDatum(theDatum);
+      }
+      switch(theModelTransformUnitType)
+      {
+         case OSSIM_METERS:
+         case OSSIM_FEET:
+         case OSSIM_US_SURVEY_FEET:
+         {
+            ossimDpt modelPoint = forward(gpt);
+            ossimUnitConversionTool ut;
+            ut.setValue(modelPoint.x, OSSIM_METERS);
+            modelPoint.x = ut.getValue(theModelTransformUnitType);
+            ut.setValue(modelPoint.y, OSSIM_METERS);
+            modelPoint.y = ut.getValue(theModelTransformUnitType);
+            const NEWMAT::Matrix& m = theInverseModelTransform.getData();
+            
+            lineSample.x = m[0][0]*modelPoint.x + m[0][1]*modelPoint.y + m[0][3];
+            lineSample.y = m[1][0]*modelPoint.x + m[1][1]*modelPoint.y + m[1][3];
+            
+            return;
+         }
+         case OSSIM_DEGREES:
+         case OSSIM_RADIANS:
+         case OSSIM_MINUTES:
+         case OSSIM_SECONDS:
+         {
+            ossimUnitConversionTool ut;
+            ossimDpt modelPoint;
+            modelPoint.lat = gpt.latd();
+            modelPoint.lon = gpt.lond();
+            ut.setValue(modelPoint.lat, OSSIM_DEGREES);
+            modelPoint.lat = ut.getValue(theModelTransformUnitType);
+            ut.setValue(modelPoint.lon, OSSIM_DEGREES);
+            modelPoint.lon = ut.getValue(theModelTransformUnitType);
+            const NEWMAT::Matrix& m = theInverseModelTransform.getData();
+            
+            lineSample.x = m[0][0]*modelPoint.x + m[0][1]*modelPoint.y + m[0][3];
+            lineSample.y = m[1][0]*modelPoint.x + m[1][1]*modelPoint.y + m[1][3];
+            return;
+         }
+         default:
+         {
+            lineSample.makeNan();
+            return;
+         }
+      }
+   }
+   else if(isGeographic())
+   {
+      ossimGpt gpt = worldPoint;
+      
+      if (theOrigin.datum() != gpt.datum())
+      {
+         // Apply datum shift if it's not the same.
+         gpt.changeDatum(theOrigin.datum());
+      }
+      
+      lineSample.line = (theUlGpt.latd() - gpt.latd()) / theDegreesPerPixel.y;
+      lineSample.samp = (gpt.lond() - theUlGpt.lond()) / theDegreesPerPixel.x;
+   }
+   else
+   {
+      // make sure our tie point is good and world point
+      // is good.
+      //
+      if(theUlEastingNorthing.isNan()||
+         worldPoint.isLatNan() || worldPoint.isLonNan())
+      {
+         lineSample.makeNan();
+         return;
+      }
+      // initialize line sample
+      //   lineSample = ossimDpt(0,0);
+      
+      // I am commenting this code out because I am going to
+      // move it to the ossimImageViewProjectionTransform.
+      //
+      // see if we have a datum set and if so
+      // shift the world to our datum.  If not then
+      // find the easting northing value for the world
+      // point.
+      if(theDatum)
+      {
+         ossimGpt gpt = worldPoint;
+         
+         gpt.changeDatum(theDatum);
+         
+         // lineSample is currently in easting northing
+         // and will need to be converted to line sample.
+         lineSample = forward(gpt);
+      }
+      else
+      {
+         // lineSample is currently in easting northing
+         // and will need to be converted to line sample.
+         lineSample = forward(worldPoint);
+      }
+      
+      // check the final result to make sure there were no
+      // problems.
+      //
+      if(!lineSample.isNan())
+      {
+//       if(!isIdentityMatrix())
+//       {
+//          ossimDpt temp = lineSample;
+         
+//          lineSample.x = theInverseTrans[0][0]*temp.x+
+//                         theInverseTrans[0][1]*temp.y+
+//                         theInverseTrans[0][2];
+         
+//          lineSample.y = theInverseTrans[1][0]*temp.x+
+//                         theInverseTrans[1][1]*temp.y+
+//                         theInverseTrans[1][2];
+//       }
+//       else
+         {
+            lineSample.x = ((lineSample.x  - theUlEastingNorthing.x)/theMetersPerPixel.x);
+            
+            // We must remember that the Northing is negative since the positive
+            // axis for an image is assumed to go down since it's image space.
+            lineSample.y = (-(lineSample.y - theUlEastingNorthing.y)/theMetersPerPixel.y);
+         }
+      }
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::lineSampleHeightToWorld
+//
+//*****************************************************************************
+void ossimMapProjection::lineSampleHeightToWorld(const ossimDpt &lineSample,
+                                                 const double&  hgtEllipsoid,
+                                                 ossimGpt&      gpt)const
+{
+   // make sure that the passed in lineSample is good and
+   // check to make sure our easting northing is good so
+   // we can compute the line sample.
+   if(lineSample.hasNans())
+   {
+      gpt.makeNan();
+      return;
+   }
+   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
+   {
+      const NEWMAT::Matrix& m = theModelTransform.getData();
+      // map transforms can only be 2-D for now so we will look at
+      // the first 2 rows only
+      ossimDpt modelPoint(m[0][0]*lineSample.x + m[0][1]*lineSample.y + m[0][3],
+                          m[1][0]*lineSample.x + m[1][1]*lineSample.y + m[1][3]);
+      switch(theModelTransformUnitType)
+      {
+         case OSSIM_DEGREES:
+         {
+            gpt.latd(modelPoint.lat);
+            gpt.lond(modelPoint.lon);
+            gpt.datum(theDatum);
+            return;
+         }
+         case OSSIM_MINUTES:
+         case OSSIM_SECONDS:
+         case OSSIM_RADIANS:
+         {
+            ossimUnitConversionTool ut;
+            ut.setValue(modelPoint.x, theModelTransformUnitType);
+            modelPoint.x = ut.getValue(OSSIM_DEGREES);
+            ut.setValue(modelPoint.y, theModelTransformUnitType);
+            modelPoint.y = ut.getValue(OSSIM_DEGREES);
+            gpt.latd(modelPoint.lat);
+            gpt.lond(modelPoint.lon);
+            gpt.datum(theDatum);
+            return;
+         }
+         default:
+         {
+            ossimUnitConversionTool ut;
+            ut.setValue(modelPoint.x, theModelTransformUnitType);
+            modelPoint.x = ut.getValue(OSSIM_METERS);
+            ut.setValue(modelPoint.y, theModelTransformUnitType);
+            modelPoint.y = ut.getValue(OSSIM_METERS);
+            gpt = inverse(modelPoint);
+            break;
+         }
+      }
+      gpt.datum(theDatum);
+   }
+   else if(isGeographic())
+   {
+      double lat = theUlGpt.latd() - (lineSample.line * theDegreesPerPixel.y);
+      double lon = theUlGpt.lond() + (lineSample.samp * theDegreesPerPixel.x);
+      
+      gpt.latd(lat);
+      gpt.lond(lon);
+      gpt.hgt = hgtEllipsoid;
+   }
+   else
+   {
+      if(theUlEastingNorthing.hasNans())
+      {
+         gpt.makeNan();
+         return;
+      }
+      ossimDpt eastingNorthing;
+      
+      eastingNorthing = (theUlEastingNorthing);
+      
+      eastingNorthing.x += (lineSample.x*theMetersPerPixel.x);
+      
+      //
+      // Note:  the Northing is positive up.  In image space
+      // the positive axis is down so we must multiply by
+      // -1
+      //
+      eastingNorthing.y += (-lineSample.y*theMetersPerPixel.y);
+      
+      
+      //
+      // now invert the meters into a ground point.
+      //
+      gpt = inverse(eastingNorthing);
+      gpt.datum(theDatum);
+      
+      if(gpt.isLatNan() && gpt.isLonNan())
+      {
+         gpt.makeNan();
+      }
+      else
+      {
+         gpt.clampLat(-90, 90);
+         gpt.clampLon(-180, 180);
+         
+         // Finally assign the specified height:
+         gpt.hgt = hgtEllipsoid;
+      }
+   }
+   if(theElevationLookupFlag)
+   {
+      gpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::lineSampleToWorld
+//
+//  Implements the base class pure virtual. Simply calls lineSampleToWorld()
+//  and assigns argument height to the resultant groundpoint.
+//
+//*****************************************************************************
+void ossimMapProjection::lineSampleToWorld (const ossimDpt& lineSampPt,
+                                            ossimGpt&       worldPt) const
+{
+   double elev = ossim::nan();
+
+//    if(theElevationLookupFlag)
+//    {
+//       elev =  ossimElevManager::instance()->getHeightAboveEllipsoid(worldPt);
+//    }
+
+   lineSampleHeightToWorld(lineSampPt, elev, worldPt);
+
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::lineSampleToEastingNorthing
+//
+//*****************************************************************************
+void ossimMapProjection::lineSampleToEastingNorthing(const ossimDpt& lineSample,
+                                                     ossimDpt&       eastingNorthing)const
+{
+   // make sure that the passed in lineSample is good and
+   // check to make sure our easting northing is good so
+   // we can compute the line sample.
+   //
+   if(lineSample.hasNans()||theUlEastingNorthing.hasNans())
+   {
+      eastingNorthing.makeNan();
+      return;
+   }
+   ossimDpt deltaPoint = lineSample;
+
+   eastingNorthing.x = theUlEastingNorthing.x + deltaPoint.x*theMetersPerPixel.x;
+   eastingNorthing.y = theUlEastingNorthing.y + (-deltaPoint.y)*theMetersPerPixel.y ;
+
+   //   eastingNorthing.x += (lineSample.x*theMetersPerPixel.x);
+
+   // Note:  the Northing is positive up.  In image space
+   // the positive axis is down so we must multiply by
+   // -1
+   //   eastingNorthing.y += (-lineSample.y*theMetersPerPixel.y);
+}
+
+
+void ossimMapProjection::setMetersPerPixel(const ossimDpt& resolution)
+{
+   theMetersPerPixel = resolution;
+   computeDegreesPerPixel();
+}
+
+void ossimMapProjection::setDecimalDegreesPerPixel(const ossimDpt& resolution)
+{
+   theDegreesPerPixel = resolution;
+   computeMetersPerPixel();
+}
+
+void ossimMapProjection::eastingNorthingToWorld(const ossimDpt& eastingNorthing,
+                                                ossimGpt&       worldPt)const
+{
+   ossimDpt lineSample;
+   eastingNorthingToLineSample(eastingNorthing, lineSample);
+   lineSampleToWorld(lineSample, worldPt);
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::eastingNorthingToLineSample
+//
+//*****************************************************************************
+void ossimMapProjection::eastingNorthingToLineSample(const ossimDpt& eastingNorthing,
+                                                     ossimDpt&       lineSample)const
+{
+   if(eastingNorthing.hasNans())
+   {
+      lineSample.makeNan();
+      return;
+   }
+   // check the final result to make sure there were no
+   // problems.
+   //
+   if(!eastingNorthing.isNan())
+   {
+     lineSample.x = (eastingNorthing.x - theUlEastingNorthing.x)/theMetersPerPixel.x;
+
+     // We must remember that the Northing is negative since the positive
+     // axis for an image is assumed to go down since it's image space.
+     lineSample.y = (-(eastingNorthing.y-theUlEastingNorthing.y))/theMetersPerPixel.y;
+   }
+}
+
+void ossimMapProjection::setUlTiePoints(const ossimGpt& gpt)
+{
+   setUlGpt(gpt);
+   setUlEastingNorthing(forward(gpt));
+}
+
+void ossimMapProjection::setUlTiePoints(const ossimDpt& eastingNorthing)
+{
+   setUlEastingNorthing(eastingNorthing);
+   setUlGpt(inverse(eastingNorthing));
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::setUlEastingNorthing
+//
+//*****************************************************************************
+void ossimMapProjection::setUlEastingNorthing(const ossimDpt& ulEastingNorthing)
+{
+   theUlEastingNorthing = ulEastingNorthing;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::setUlGpt
+//
+//*****************************************************************************
+void ossimMapProjection::setUlGpt(const ossimGpt& ulGpt)
+{
+   theUlGpt = ulGpt;
+
+   // The ossimGpt data members need to use the same datum as this projection:
+   if (*theDatum != *(ulGpt.datum()))
+      theUlGpt.changeDatum(theDatum);
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::saveState
+//
+//*****************************************************************************
+bool ossimMapProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   ossimProjection::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           ossimKeywordNames::ORIGIN_LATITUDE_KW,
+           theOrigin.latd(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CENTRAL_MERIDIAN_KW,
+           theOrigin.lond(),
+           true);
+
+   theEllipsoid.saveState(kwl, prefix);
+
+   if(theDatum)
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::DATUM_KW,
+              theDatum->code(),
+              true);
+   }
+
+   // Calling access method to give it an opportunity to update the code in case of param change:
+   ossim_uint32 code = getPcsCode();
+   if (code)
+   {
+      ossimString epsg_spec = ossimString("EPSG:") + ossimString::toString(code);
+      kwl.add(prefix, ossimKeywordNames::SRS_NAME_KW, epsg_spec, true);
+   }
+   
+   if(isGeographic())
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_XY_KW,
+              ossimDpt(theUlGpt).toString().c_str(),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_UNITS_KW,
+              ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::PIXEL_SCALE_XY_KW,
+              theDegreesPerPixel.toString().c_str(),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
+              ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES),
+              true);
+   }
+   else
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_XY_KW,
+              theUlEastingNorthing.toString().c_str(),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_UNITS_KW,
+              ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::PIXEL_SCALE_XY_KW,
+              theMetersPerPixel.toString().c_str(),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
+              ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS),
+              true);  
+      kwl.add(prefix,
+              ossimKeywordNames::ORIGINAL_MAP_UNITS_KW,
+              ossimUnitTypeLut::instance()->getEntryString(theProjectionUnits),
+              true);
+   }
+
+   kwl.add(prefix, ossimKeywordNames::PCS_CODE_KW, code, true);
+   kwl.add(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_KW,
+           theFalseEastingNorthing.toString().c_str(), true);
+   kwl.add(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW,
+           ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS), true);
+   kwl.add(prefix, ossimKeywordNames::ELEVATION_LOOKUP_FLAG_KW,
+           ossimString::toString(theElevationLookupFlag), true);
+
+   if(theModelTransformUnitType != OSSIM_UNIT_UNKNOWN)
+   {
+      const NEWMAT::Matrix& m = theModelTransform.getData();
+      ostringstream out;
+      ossim_uint32 row, col;
+      for(row = 0; row < 4; ++row)
+      {
+         for(col = 0; col < 4; ++col)
+         {
+            out << std::setprecision(20) << m[row][col] << " ";
+         }
+      }
+      kwl.add(prefix,
+              ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW,
+              out.str().c_str(),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW,
+              ossimUnitTypeLut::instance()->getEntryString(theModelTransformUnitType),
+              true);
+   }
+
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::loadState
+//
+//*****************************************************************************
+bool ossimMapProjection::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   ossimProjection::loadState(kwl, prefix);
+
+   const char* elevLookupFlag = kwl.find(prefix, ossimKeywordNames::ELEVATION_LOOKUP_FLAG_KW);
+   if(elevLookupFlag)
+   {
+      theElevationLookupFlag = ossimString(elevLookupFlag).toBool();
+   }
+   // Get the ellipsoid.
+   theEllipsoid.loadState(kwl, prefix);
+
+   const char *lookup;
+
+   // Get the Projection Coordinate System (assumed from EPSG database). 
+   // NOTE: the code is read here for saving in this object only. 
+   // The code is not verified until a call to getPcs() is called. If ONLY this code
+   // had been provided, then the EPSG projection factory would populate a new instance of the 
+   // corresponding map projection and have it saveState for constructing again later in the 
+   // conventional fashion here
+   thePcsCode = 0; 
+   lookup = kwl.find(prefix, ossimKeywordNames::PCS_CODE_KW);
+   if(lookup)
+      thePcsCode = ossimString(lookup).toUInt32(); // EPSG PROJECTION CODE
+
+   // The datum can be specified in 2 ways: either via OSSIM/geotrans alpha-codes or EPSG code.
+   // Last resort use WGS 84 (consider throwing an exception to catch any bad datums): 
+   theDatum = ossimDatumFactoryRegistry::instance()->create(kwl, prefix);
+   if (theDatum == NULL)
+   {
+      theDatum = ossimDatumFactory::instance()->wgs84();
+   }
+
+   // Set all ossimGpt-type members to use this datum:
+   theOrigin.datum(theDatum);
+   theUlGpt.datum(theDatum);
+
+   // Fetch the ellipsoid from the datum:
+   const ossimEllipsoid* ellipse = theDatum->ellipsoid();
+   if(ellipse)
+      theEllipsoid = *ellipse;
+   
+   // Get the latitude of the origin.
+   lookup = kwl.find(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW);
+   if (lookup)
+   {
+      theOrigin.latd(ossimString(lookup).toFloat64());
+   }
+   // else ???
+
+   // Get the central meridian.
+   lookup = kwl.find(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW);
+   if (lookup)
+   {
+      theOrigin.lond(ossimString(lookup).toFloat64());
+   }
+   // else ???
+
+
+   // Get the pixel scale.
+   theMetersPerPixel.makeNan();
+   theDegreesPerPixel.makeNan();
+   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW);
+   if (lookup)
+   {
+      ossimUnitType units =
+         static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
+                                    getEntryNumber(lookup));
+      
+      lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW);
+      if (lookup)
+      {
+         ossimDpt scale;
+         scale.toPoint(std::string(lookup));
+
+         switch (units)
+         {
+            case OSSIM_METERS:
+            {
+               theMetersPerPixel = scale;
+               break;
+            }
+            case OSSIM_DEGREES:
+            {
+               theDegreesPerPixel.x = scale.x;
+               theDegreesPerPixel.y = scale.y;
+               break;
+            }
+            case OSSIM_FEET:
+            case OSSIM_US_SURVEY_FEET:
+            {
+               ossimUnitConversionTool ut;
+               ut.setValue(scale.x, units);
+               theMetersPerPixel.x = ut.getValue(OSSIM_METERS);
+               ut.setValue(scale.y, units);
+               theMetersPerPixel.y = ut.getValue(OSSIM_METERS);
+               break;
+            }
+            default:
+            {
+               if(traceDebug())
+               {
+                  // Unhandled unit type!
+                  ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimMapProjection::loadState WARNING!"
+                  << "Unhandled unit type for "
+                  << ossimKeywordNames::PIXEL_SCALE_UNITS_KW << ":  "
+                  << ( ossimUnitTypeLut::instance()->
+                      getEntryString(units).c_str() )
+                  << endl;
+               }
+               break;
+            }
+         } // End of switch (units)
+         
+      }  // End of if (PIXEL_SCALE_XY)
+
+   } // End of if (PIXEL_SCALE_UNITS)
+   else
+   {
+      // BACKWARDS COMPATIBILITY LOOKUPS...
+      lookup =  kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_X_KW);
+      if(lookup)
+      {
+         theMetersPerPixel.x = fabs(ossimString(lookup).toFloat64());
+      }
+      
+      lookup =  kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW);
+      if(lookup)
+      {
+         theMetersPerPixel.y = fabs(ossimString(lookup).toFloat64());
+      }
+      
+      lookup = kwl.find(prefix,
+                        ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT);
+      if(lookup)
+      {
+         theDegreesPerPixel.y = fabs(ossimString(lookup).toFloat64());
+      }
+      
+      lookup = kwl.find(prefix,
+                        ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON);
+      if(lookup)
+      {
+         theDegreesPerPixel.x = fabs(ossimString(lookup).toFloat64());
+      }
+   }            
+
+   // Get the tie point.
+   theUlGpt.makeNan();
+
+    // Since this won't be picked up from keywords set to 0 to keep nan out.
+   theUlGpt.hgt = 0.0;
+   
+   theUlEastingNorthing.makeNan();
+   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW);
+   if (lookup)
+   {
+      ossimUnitType units = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
+                                                       getEntryNumber(lookup));
+      
+      lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_XY_KW);
+      if (lookup)
+      {
+         ossimDpt tie;
+         tie.toPoint(std::string(lookup));
+
+         switch (units)
+         {
+            case OSSIM_METERS:
+            {
+               theUlEastingNorthing = tie;
+               break;
+            }
+            case OSSIM_DEGREES:
+            {
+               theUlGpt.lond(tie.x);
+               theUlGpt.latd(tie.y);
+               break;
+            }
+            case OSSIM_FEET:
+            case OSSIM_US_SURVEY_FEET:
+            {
+               ossimUnitConversionTool ut;
+               ut.setValue(tie.x, units);
+               theUlEastingNorthing.x = ut.getValue(OSSIM_METERS);
+               ut.setValue(tie.y, units);
+               theUlEastingNorthing.y = ut.getValue(OSSIM_METERS);
+               break;
+            }
+            default:
+            {
+               if(traceDebug())
+               {
+                  // Unhandled unit type!
+                  ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimMapProjection::loadState WARNING!"
+                  << "Unhandled unit type for "
+                  << ossimKeywordNames::TIE_POINT_UNITS_KW << ": " 
+                  << ( ossimUnitTypeLut::instance()->
+                      getEntryString(units).c_str() )
+                  << endl;
+               }
+               break;
+            }
+         } // End of switch (units)
+         
+      }  // End of if (TIE_POINT_XY)
+
+   } // End of if (TIE_POINT_UNITS)
+   else
+   {
+      // BACKWARDS COMPATIBILITY LOOKUPS...
+      lookup =  kwl.find(prefix, ossimKeywordNames::TIE_POINT_EASTING_KW);
+      if(lookup)
+      {
+         theUlEastingNorthing.x = (ossimString(lookup).toFloat64());
+      }
+
+      lookup =  kwl.find(prefix, ossimKeywordNames::TIE_POINT_NORTHING_KW);
+      if(lookup)
+      {
+         theUlEastingNorthing.y = (ossimString(lookup).toFloat64());
+      }
+
+      lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LAT_KW);
+      if (lookup)
+      {
+         theUlGpt.latd(ossimString(lookup).toFloat64());
+      }
+
+      lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_LON_KW);
+      if (lookup)
+      {
+         theUlGpt.lond(ossimString(lookup).toFloat64());
+      }
+   }
+   
+   // Get the false easting northing.
+   theFalseEastingNorthing.x = 0.0;
+   theFalseEastingNorthing.y = 0.0;
+   ossimUnitType en_units = OSSIM_METERS;
+   lookup = kwl.find(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW);
+   if (lookup)
+   {
+      en_units = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->getEntryNumber(lookup));
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::FALSE_EASTING_NORTHING_KW);
+   if (lookup)
+   {
+      ossimDpt eastingNorthing;
+      eastingNorthing.toPoint(std::string(lookup));
+
+      switch (en_units)
+      {
+         case OSSIM_METERS:
+         {
+            theFalseEastingNorthing = eastingNorthing;
+            break;
+         }
+         case OSSIM_FEET:
+         case OSSIM_US_SURVEY_FEET:
+         {
+            ossimUnitConversionTool ut;
+            ut.setValue(eastingNorthing.x, en_units);
+            theFalseEastingNorthing.x = ut.getValue(OSSIM_METERS);
+            ut.setValue(eastingNorthing.y, en_units);
+            theFalseEastingNorthing.y = ut.getValue(OSSIM_METERS);
+            break;
+         }
+         default:
+         {
+            if(traceDebug())
+            {
+               // Unhandled unit type!
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimMapProjection::loadState WARNING! Unhandled unit type for "
+                  << ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW << ":  " 
+                  << (ossimUnitTypeLut::instance()->getEntryString(en_units).c_str())
+                  << endl;
+            }
+            break;
+         }
+      } // End of switch (units)
+   }  // End of if (FALSE_EASTING_NORTHING_KW)
+   else
+   {
+      // BACKWARDS COMPATIBILITY LOOKUPS...
+      lookup =  kwl.find(prefix, ossimKeywordNames::FALSE_EASTING_KW);
+      if(lookup)
+      {
+         theFalseEastingNorthing.x = (ossimString(lookup).toFloat64());
+      }
+      
+      lookup =  kwl.find(prefix, ossimKeywordNames::FALSE_NORTHING_KW);
+      if(lookup)
+      {
+         theFalseEastingNorthing.y = (ossimString(lookup).toFloat64());
+      }
+   }            
+
+//    if((theDegreesPerPixel.x!=OSSIM_DBL_NAN)&&
+//       (theDegreesPerPixel.y!=OSSIM_DBL_NAN)&&
+//       theMetersPerPixel.hasNans())
+//    {
+//       theMetersPerPixel    = theOrigin.metersPerDegree();
+//       theMetersPerPixel.x *= theDegreesPerPixel.x;
+//       theMetersPerPixel.y *= theDegreesPerPixel.y;
+//    }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_TYPE_KW);
+   if (lookup)
+   {
+      ossimString pixelType = lookup;
+      pixelType=pixelType.trim();
+      if(pixelType!="")
+      {
+         pixelType.downcase();
+         if(pixelType.contains("area"))
+         {
+            if( theMetersPerPixel.hasNans() == false)
+            {
+               if(!theUlEastingNorthing.hasNans())
+               {
+                  theUlEastingNorthing.x += (theMetersPerPixel.x*0.5);
+                  theUlEastingNorthing.y -= (theMetersPerPixel.y*0.5);
+               }
+            }
+            if(theDegreesPerPixel.hasNans() == false)
+            {
+               theUlGpt.latd( theUlGpt.latd() - (theDegreesPerPixel.y*0.5) );
+               theUlGpt.lond( theUlGpt.lond() + (theDegreesPerPixel.x*0.5) );
+            }
+         }
+      }
+   }
+   
+   // We preserve the units of the originally created projection (typically from EPSG proj factory)
+   // in case user needs map coordinates in those units (versus default meters)
+   lookup = kwl.find(prefix, ossimKeywordNames::ORIGINAL_MAP_UNITS_KW);
+   if (lookup)
+   {
+      theProjectionUnits = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
+                                                      getEntryNumber(lookup));
+   }
+
+   theModelTransformUnitType = OSSIM_UNIT_UNKNOWN;
+   const char* modelTransform = kwl.find(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW);
+   const char* modelTransformUnit = kwl.find(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW);
+   if(modelTransform&&modelTransformUnit) // row ordered 4x4 matrix.  Should be 16 values
+   {
+      
+      NEWMAT::Matrix& m = theModelTransform.getData();
+      istringstream in(modelTransform);
+      ossim_uint32 row, col;
+      ossimString value;
+      for(row = 0; row < 4; ++row)
+      {
+         for(col = 0; col < 4; ++col)
+         {
+            in >> value;
+            m[row][col] = value.toDouble();
+         }
+      }
+      // make sure these have the identity and all unused are 0.0
+      m[2][2] = 1.0;
+      m[2][0] = 0.0;
+      m[2][1] = 0.0;
+      m[2][3] = 0.0;
+      m[3][3] = 1.0;
+      m[3][2] = 0.0;
+      m[3][1] = 0.0;
+      m[3][0] = 0.0;
+      
+      if(!in.fail())
+      {
+         try
+         {
+            theInverseModelTransform = theModelTransform;
+            theInverseModelTransform.i();
+            theModelTransformUnitType = static_cast<ossimUnitType>(ossimUnitTypeLut::instance()->
+                                                                   getEntryNumber(modelTransformUnit));
+         }
+         catch(...)
+         {
+            theModelTransformUnitType = OSSIM_UNIT_UNKNOWN;   
+         }
+      }
+   }
+
+   //---
+   // Set the datum of the origin and tie point.
+   // Use method that does NOT perform a shift.
+   //---
+   if(theDatum)
+   {
+      theOrigin.datum(theDatum);
+      theUlGpt.datum(theDatum);
+   }
+
+   if(theMetersPerPixel.hasNans() &&
+      theDegreesPerPixel.hasNans())
+   {
+      ossimDpt mpd = ossimGpt().metersPerDegree();
+      if(isGeographic())
+      {
+         theDegreesPerPixel.lat = 1.0/mpd.y;
+         theDegreesPerPixel.lon = 1.0/mpd.y;
+      }
+      else
+      {
+         theMetersPerPixel.x = 1.0;
+         theMetersPerPixel.y = 1.0;
+      }
+   }
+
+   //---
+   // Final sanity check:
+   //---
+   if ( theOrigin.hasNans() )
+   {
+      if ( theModelTransformUnitType == OSSIM_DEGREES )
+      {
+         const NEWMAT::Matrix& m = theModelTransform.getData();
+         theOrigin.lon = m[0][3];
+         theOrigin.lat = m[1][3];
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << __FILE__ << ": " << __LINE__
+            << "\nossimMapProjection::loadState ERROR: Origin is not set!"
+            << std::endl;
+      }
+   }
+
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::print
+//*****************************************************************************
+std::ostream& ossimMapProjection::print(std::ostream& out) const
+{
+   const char MODULE[] = "ossimMapProjection::print";
+
+   out << setiosflags(ios::fixed) << setprecision(15)
+       << "\n// " << MODULE
+       << "\n" << ossimKeywordNames::TYPE_KW               << ":  "
+       << getClassName()
+       << "\n" << ossimKeywordNames::MAJOR_AXIS_KW         << ":  "
+       << theEllipsoid.getA()
+       << "\n" << ossimKeywordNames::MINOR_AXIS_KW         << ":  "
+       << theEllipsoid.getB()
+       << "\n" << ossimKeywordNames::ORIGIN_LATITUDE_KW    << ":  "
+       << theOrigin.latd()
+       << "\n" << ossimKeywordNames::CENTRAL_MERIDIAN_KW   << ":  "
+       << theOrigin.lond()
+       << "\norigin: " << theOrigin
+       << "\n" << ossimKeywordNames::DATUM_KW              << ":  "
+       << (theDatum?theDatum->code().c_str():"unknown")
+       << "\n" << ossimKeywordNames::METERS_PER_PIXEL_X_KW << ":  "
+       << ((ossim::isnan(theMetersPerPixel.x))?ossimString("nan"):ossimString::toString(theMetersPerPixel.x, 15))
+       << "\n" << ossimKeywordNames::METERS_PER_PIXEL_Y_KW << ":  "
+       << ((ossim::isnan(theMetersPerPixel.y))?ossimString("nan"):ossimString::toString(theMetersPerPixel.y, 15))
+       << "\n" << ossimKeywordNames::FALSE_EASTING_NORTHING_KW << ": "
+       << theFalseEastingNorthing.toString().c_str()
+       << "\n" << ossimKeywordNames::FALSE_EASTING_NORTHING_UNITS_KW << ": "
+       << ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS)
+       << "\n" << ossimKeywordNames::PCS_CODE_KW << ": " << thePcsCode;
+
+   if(isGeographic())
+   {
+      out << "\n" << ossimKeywordNames::TIE_POINT_XY_KW << ": " 
+          << ossimDpt(theUlGpt).toString().c_str()
+          << "\n" << ossimKeywordNames::TIE_POINT_UNITS_KW << ": " 
+          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES)
+          << "\n" << ossimKeywordNames::PIXEL_SCALE_XY_KW << ": "
+          << theDegreesPerPixel.toString().c_str()
+          << "\n" << ossimKeywordNames::PIXEL_SCALE_UNITS_KW << ": "
+          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_DEGREES)
+          << std::endl;
+   }
+   else
+   {
+      out << "\n" << ossimKeywordNames::TIE_POINT_XY_KW << ": " 
+          << theUlEastingNorthing.toString().c_str()
+          << "\n" << ossimKeywordNames::TIE_POINT_UNITS_KW << ": " 
+          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS)
+          << "\n" << ossimKeywordNames::PIXEL_SCALE_XY_KW << ": "
+          << theMetersPerPixel.toString().c_str()
+          << "\n" << ossimKeywordNames::PIXEL_SCALE_UNITS_KW << ": "
+          << ossimUnitTypeLut::instance()->getEntryString(OSSIM_METERS)
+          << std::endl;
+   }
+   
+   return ossimProjection::print(out);
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::computeDegreesPerPixel
+//
+//*****************************************************************************
+void ossimMapProjection::computeDegreesPerPixel()
+{
+   ossimDpt eastNorthGround = forward(theOrigin);
+   ossimDpt rightEastNorth  =  eastNorthGround;
+   ossimDpt downEastNorth   =  eastNorthGround;
+   rightEastNorth.x += theMetersPerPixel.x;
+   downEastNorth.y  -= theMetersPerPixel.y;
+
+   ossimGpt rightGpt = inverse(rightEastNorth);
+   ossimGpt downGpt  = inverse(downEastNorth);
+
+   // use euclidean distance to get length along the horizontal (lon)
+   // and vertical (lat) directions
+   //
+   double tempDeltaLat = rightGpt.latd() - theOrigin.latd();
+   double tempDeltaLon = rightGpt.lond() - theOrigin.lond();
+   theDegreesPerPixel.lon = sqrt(tempDeltaLat*tempDeltaLat + tempDeltaLon*tempDeltaLon);
+
+   tempDeltaLat = downGpt.latd() - theOrigin.latd();
+   tempDeltaLon = downGpt.lond() - theOrigin.lond();
+   theDegreesPerPixel.lat = sqrt(tempDeltaLat*tempDeltaLat + tempDeltaLon*tempDeltaLon);
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjection::computeMetersPerPixel
+//
+//*****************************************************************************
+void ossimMapProjection::computeMetersPerPixel()
+{
+//#define USE_OSSIMGPT_METERS_PER_DEGREE
+#ifdef USE_OSSIMGPT_METERS_PER_DEGREE
+   ossimDpt metersPerDegree (theOrigin.metersPerDegree());
+   theMetersPerPixel.x = metersPerDegree.x * theDegreesPerPixel.lon;
+   theMetersPerPixel.y = metersPerDegree.y * theDegreesPerPixel.lat;
+#else
+   ossimGpt right=theOrigin;
+   ossimGpt down=theOrigin;
+
+   down.latd(theOrigin.latd()  + theDegreesPerPixel.lat);
+   right.lond(theOrigin.lond() + theDegreesPerPixel.lon);
+
+   ossimDpt centerMeters = forward(theOrigin);
+   ossimDpt rightMeters = forward(right);
+   ossimDpt downMeters  = forward(down);
+
+   theMetersPerPixel.x = (rightMeters - centerMeters).length();
+   theMetersPerPixel.y = (downMeters  - centerMeters).length();
+#endif
+}
+
+//**************************************************************************************************
+//  METHOD: ossimMapProjection::operator==
+//! Compares this to arg projection and returns TRUE if the same. 
+//! NOTE: As currently implemented in OSSIM, map projections also contain image geometry 
+//! information like tiepoint and scale. This operator is only concerned with the map 
+//! specification and ignores image geometry differences.
+//**************************************************************************************************
+bool ossimMapProjection::operator==(const ossimProjection& projection) const
+{
+   // Verify that derived types match:
+   if (getClassName() != projection.getClassName())
+      return false;
+
+   // If both PCS codes are non-zero, that's all we need to check:
+   const ossimMapProjection* mapProj = dynamic_cast<const ossimMapProjection*>(&projection);
+   if (thePcsCode && mapProj->thePcsCode && (thePcsCode != 32767) && 
+       (thePcsCode == mapProj->thePcsCode) )
+   {
+      return true;
+   }
+
+   if ( *theDatum != *(mapProj->theDatum) )
+      return false;
+   
+   if (theOrigin != mapProj->theOrigin)
+      return false;
+
+   if (theFalseEastingNorthing != mapProj->theFalseEastingNorthing)
+      return false;
+
+#if 0
+   THIS SECTION IGNORED SINCE IT DEALS WITH IMAGE GEOMETRY, NOT MAP PROJECTION
+   if (isGeographic())
+   {
+      if ((theDegreesPerPixel != mapProj->theDegreesPerPixel) ||
+          (theUlGpt != mapProj->theUlGpt))
+         return false;
+   }
+   else
+   {
+      if ((theMetersPerPixel != mapProj->theMetersPerPixel) ||
+         (theUlEastingNorthing != mapProj->theUlEastingNorthing))
+         return false;
+   }
+#endif
+
+   // Units must match:
+   if ((theProjectionUnits != OSSIM_UNIT_UNKNOWN) && 
+       (mapProj->theProjectionUnits != OSSIM_UNIT_UNKNOWN) &&
+       (theProjectionUnits != mapProj->theProjectionUnits))
+       return false;
+
+   // Check transform if present and compare it also:
+   if (hasModelTransform() && mapProj->hasModelTransform() &&
+      (theModelTransform.getData() != mapProj->theModelTransform.getData()))
+      return false;
+
+   return true;
+}
+
+bool ossimMapProjection::isEqualTo(const ossimObject& obj, ossimCompareType compareType)const
+{
+   const ossimMapProjection* mapProj = dynamic_cast<const ossimMapProjection*>(&obj);
+   bool result = mapProj&&ossimProjection::isEqualTo(obj, compareType);
+   
+   if(result)
+   {
+      result = (theEllipsoid.isEqualTo(mapProj->theEllipsoid, compareType)&&
+                theOrigin.isEqualTo(mapProj->theOrigin, compareType)&&
+                theMetersPerPixel.isEqualTo(mapProj->theMetersPerPixel, compareType)&&             
+                theDegreesPerPixel.isEqualTo(mapProj->theDegreesPerPixel, compareType)&&             
+                theUlGpt.isEqualTo(mapProj->theUlGpt, compareType)&&             
+                theUlEastingNorthing.isEqualTo(mapProj->theUlEastingNorthing, compareType)&&             
+                theFalseEastingNorthing.isEqualTo(mapProj->theFalseEastingNorthing, compareType)&&             
+                (thePcsCode == mapProj->thePcsCode)&&
+                (theElevationLookupFlag == mapProj->theElevationLookupFlag)&&
+                (theElevationLookupFlag == mapProj->theElevationLookupFlag)&&
+                (theModelTransform.isEqualTo(mapProj->theModelTransform))&&
+                (theInverseModelTransform.isEqualTo(mapProj->theInverseModelTransform))&&
+                (theModelTransformUnitType == mapProj->theModelTransformUnitType)&&
+                (theProjectionUnits == mapProj->theProjectionUnits));
+      
+      if(result)
+      {
+         if(compareType == OSSIM_COMPARE_FULL)
+         {
+            if(theDatum&&mapProj->theDatum)
+            {
+               result = theDatum->isEqualTo(*mapProj->theDatum, compareType);
+            }
+         }
+         else 
+         {
+            result = (theDatum==mapProj->theDatum);
+         }
+      }
+   }
+   return result;
+}
+
+double ossimMapProjection::getFalseEasting() const
+{
+   return theFalseEastingNorthing.x;
+}
+
+double ossimMapProjection::getFalseNorthing() const
+{
+   return theFalseEastingNorthing.y;
+}
+
+double ossimMapProjection::getStandardParallel1() const
+{
+   return 0.0;
+}
+
+double ossimMapProjection::getStandardParallel2() const
+{
+   return 0.0;
+}
+
+void ossimMapProjection::snapTiePointTo(ossim_float64 multiple,
+                                        ossimUnitType unitType)
+{
+   ossim_float64 convertedMultiple = multiple;
+   
+   if (isGeographic() && (unitType != OSSIM_DEGREES) )
+   {
+      // Convert to degrees.
+      ossimUnitConversionTool convertor;
+      convertor.setOrigin(theOrigin);
+      convertor.setValue(multiple, unitType);
+      convertedMultiple = convertor.getDegrees();
+   }
+   else if ( !isGeographic() && (unitType != OSSIM_METERS) )
+   {
+      // Convert to meters.
+      ossimUnitConversionTool convertor;
+      convertor.setOrigin(theOrigin);
+      convertor.setValue(multiple, unitType);
+      convertedMultiple = convertor.getMeters();
+   }
+
+   // Convert the tie point.
+   if (isGeographic())
+   {
+      // Snap the latitude.
+      ossim_float64 d = theUlGpt.latd();
+      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
+      theUlGpt.latd(d);
+
+      // Snap the longitude.
+      d = theUlGpt.lond();
+      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
+      theUlGpt.lond(d);
+
+      // Adjust the stored easting / northing.
+      theUlEastingNorthing = forward(theUlGpt);
+   }
+   else
+   {
+      // Snap the easting.
+      ossim_float64 d = theUlEastingNorthing.x - getFalseEasting();
+      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
+      theUlEastingNorthing.x = d + getFalseEasting();
+
+      // Snap the northing.
+      d = theUlEastingNorthing.y - getFalseNorthing();
+      d = ossim::round<int>(d / convertedMultiple) * convertedMultiple;
+      theUlEastingNorthing.y = d + getFalseNorthing();
+
+      // Adjust the stored upper left ground point.
+      theUlGpt = inverse(theUlEastingNorthing);
+   }
+}
+
+void ossimMapProjection::snapTiePointToOrigin()
+{
+   // Convert the tie point.
+   if (isGeographic())
+   {
+      // Note the origin may not be 0.0, 0.0:
+      
+      // Snap the latitude.
+      ossim_float64 d = theUlGpt.latd() - origin().latd();
+      d = ossim::round<int>(d / theDegreesPerPixel.y) * theDegreesPerPixel.y;
+      theUlGpt.latd(d + origin().latd());
+
+      // Snap the longitude.
+      d = theUlGpt.lond() - origin().lond();
+      d = ossim::round<int>(d / theDegreesPerPixel.x) * theDegreesPerPixel.x;
+      theUlGpt.lond(d + origin().lond());
+
+      // Adjust the stored easting / northing.
+      theUlEastingNorthing = forward(theUlGpt);
+   }
+   else
+   {
+      // Snap the easting.
+      ossim_float64 d = theUlEastingNorthing.x - getFalseEasting();
+      d = ossim::round<int>(d / theMetersPerPixel.x) * theMetersPerPixel.x;
+      theUlEastingNorthing.x = d + getFalseEasting();
+
+      // Snap the northing.
+      d = theUlEastingNorthing.y - getFalseNorthing();
+      d = ossim::round<int>(d / theMetersPerPixel.y) * theMetersPerPixel.y;
+      theUlEastingNorthing.y = d + getFalseNorthing();
+
+      // Adjust the stored upper left ground point.
+      theUlGpt = inverse(theUlEastingNorthing);
+   }
+}
+
+void ossimMapProjection::setElevationLookupFlag(bool flag)
+{
+   theElevationLookupFlag = flag;
+}
+
+bool ossimMapProjection::getElevationLookupFlag()const
+{
+   return theElevationLookupFlag;
+}
+   
+
diff --git a/src/projection/ossimMapProjectionFactory.cpp b/src/projection/ossimMapProjectionFactory.cpp
new file mode 100644
index 0000000..0270b3f
--- /dev/null
+++ b/src/projection/ossimMapProjectionFactory.cpp
@@ -0,0 +1,294 @@
+//*****************************************************************************
+// FILE: ossimMapProjectionFactory.cc
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimMapProjectionFactory
+//
+// SOFTWARE HISTORY:
+//>
+//   15Jun2001  Garrett Potts
+//              Initial coding.
+//<
+//*****************************************************************************
+//  $Id: ossimMapProjectionFactory.cpp 22602 2014-01-31 18:39:11Z gpotts $
+
+#include <ossim/projection/ossimMapProjectionFactory.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimFilename.h>
+
+//***
+// Note to programmer: To add a new projection, search this file for
+// "ADD_PROJECTION" to locate places requiring editing. Functional example
+// below...
+//
+// ADD_PROJECTION: Include all map projection headers here:
+//***
+
+#include <ossim/projection/ossimAlbersProjection.h>
+#include <ossim/projection/ossimAzimEquDistProjection.h>
+#include <ossim/projection/ossimBonneProjection.h>
+#include <ossim/projection/ossimBngProjection.h>
+#include <ossim/projection/ossimCassiniProjection.h>
+#include <ossim/projection/ossimCylEquAreaProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimEckert4Projection.h>
+#include <ossim/projection/ossimEckert6Projection.h>
+#include <ossim/projection/ossimGnomonicProjection.h>
+#include <ossim/projection/ossimLambertConformalConicProjection.h>
+#include <ossim/projection/ossimLlxyProjection.h>
+#include <ossim/projection/ossimMercatorProjection.h>
+#include <ossim/projection/ossimMillerProjection.h>
+#include <ossim/projection/ossimMollweidProjection.h>
+#include <ossim/projection/ossimNewZealandMapGridProjection.h>
+#include <ossim/projection/ossimObliqueMercatorProjection.h>
+#include <ossim/projection/ossimOrthoGraphicProjection.h>
+#include <ossim/projection/ossimPolarStereoProjection.h>
+#include <ossim/projection/ossimPolyconicProjection.h>
+#include <ossim/projection/ossimSinusoidalProjection.h>
+#include <ossim/projection/ossimStereographicProjection.h>
+#include <ossim/projection/ossimTransCylEquAreaProjection.h>
+#include <ossim/projection/ossimTransMercatorProjection.h>
+#include <ossim/projection/ossimUpsProjection.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimVanDerGrintenProjection.h>
+#include <ossim/projection/ossimSpaceObliqueMercatorProjection.h>
+#include <ossim/projection/ossimGoogleProjection.h>
+#include <ossim/projection/ossimAdjMapModel.h>
+#include <ossim/support_data/ossimSpaceImagingGeom.h>
+//***
+// ADD_PROJECTION: List names of all map projections produced by this factory:
+//***
+
+ossimMapProjectionFactory* ossimMapProjectionFactory::theInstance = 0;
+
+//*****************************************************************************
+//  STATIC METHOD: ossimMapProjectionFactory::instance()
+//  
+//*****************************************************************************
+ossimMapProjectionFactory* ossimMapProjectionFactory::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimMapProjectionFactory;
+   }
+
+   return (ossimMapProjectionFactory*) theInstance;
+}
+
+ossimProjection*
+ossimMapProjectionFactory::createProjection(const ossimFilename& filename,
+                                            ossim_uint32 entryIdx)const
+{
+   if(!filename.exists())
+   {
+      return NULL;
+   }
+
+   // Check for external geometry file.
+   ossimProjection* proj = createProjectionFromGeometryFile(filename,
+                                                            entryIdx);
+   if (proj)
+   {
+      return proj;
+   }
+
+   ossimFilename geomFile = filename;
+   geomFile = geomFile.setExtension("geom");
+   if(!geomFile.exists())
+   {
+      return NULL;
+   }
+   ossimKeywordlist kwl;
+   if(kwl.addFile(geomFile))
+   {
+      return createProjection(kwl);
+   }
+
+   return NULL;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjectionFactory::create(kwl, prefix)
+//  
+//*****************************************************************************
+ossimProjection* ossimMapProjectionFactory::createProjection(const ossimKeywordlist &keywordList,
+															 const char *prefix) const
+{
+   ossimProjection *result=NULL;
+	
+   const char *lookup = keywordList.find(prefix, ossimKeywordNames::TYPE_KW);
+   const char *lookupSpaceImaging = keywordList.find(prefix, ossimSpaceImagingGeom::SIG_PRODUCER_KW);
+   if(lookup)
+   {
+      result = createProjection(ossimString(lookup).trim());
+      if(result)
+      {
+         result->loadState(keywordList, prefix);
+      }
+   }
+   else
+   {
+      if(lookupSpaceImaging)
+      {
+		  ossimKeywordlist kwl;
+		  ossimKeywordlist kwl2;
+		  kwl.add(keywordList,
+				  prefix,
+				  true);
+         
+         ossimSpaceImagingGeom spaceImaging;
+         
+         spaceImaging.setGeometry(kwl);
+
+         spaceImaging.exportToOssim(kwl2);
+
+         result = ossimProjectionFactoryRegistry::instance()->createProjection(kwl2);
+         if(result)
+         {
+            return result;
+         }
+      }
+      // look for the geom_file keyword.
+      //
+      lookup = keywordList.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
+      if(lookup)
+      {
+         ossimKeywordlist kwl;
+
+         kwl.addFile(lookup);
+
+         result = createProjection(kwl);
+         
+         if(!result)
+         {
+         // maybe they prepend projection. in the geom
+         // file.
+            result = createProjection(kwl, "projection.");
+         }
+
+      }      
+   }
+   return result;
+}
+
+//*****************************************************************************
+//  METHOD: ossimMapProjectionFactory::create(projection_name)
+//*****************************************************************************
+ossimProjection* ossimMapProjectionFactory::createProjection(const ossimString &name) const
+{
+   //***
+   // ADD_PROJECTION: Test for each map projection here:
+   //***
+   if(name ==  STATIC_TYPE_NAME(ossimAlbersProjection))
+      return new ossimAlbersProjection;
+   if(name ==  STATIC_TYPE_NAME(ossimAzimEquDistProjection))
+      return new ossimAzimEquDistProjection;
+   if( name == STATIC_TYPE_NAME(ossimBonneProjection))
+      return new ossimBonneProjection;
+   if( name == STATIC_TYPE_NAME(ossimBngProjection))
+      return new ossimBngProjection;
+   if(name ==  STATIC_TYPE_NAME(ossimCassiniProjection))
+      return new ossimCassiniProjection;
+   if(name ==  STATIC_TYPE_NAME(ossimCylEquAreaProjection))
+      return new ossimCylEquAreaProjection;
+   if(name ==  STATIC_TYPE_NAME(ossimEquDistCylProjection))
+      return new ossimEquDistCylProjection;
+   if(name ==  STATIC_TYPE_NAME(ossimEckert4Projection))
+      return new ossimEckert4Projection;
+   if(name ==  STATIC_TYPE_NAME(ossimEckert6Projection))
+      return new ossimEckert6Projection;
+   if(name == STATIC_TYPE_NAME(ossimGnomonicProjection))
+      return new ossimGnomonicProjection;
+   if(name ==  STATIC_TYPE_NAME(ossimLambertConformalConicProjection))
+      return new ossimLambertConformalConicProjection;
+   if(name ==  STATIC_TYPE_NAME(ossimLlxyProjection))
+      return new ossimLlxyProjection;
+   if(name == STATIC_TYPE_NAME(ossimMercatorProjection))
+      return new ossimMercatorProjection;
+   if(name == STATIC_TYPE_NAME(ossimMillerProjection))
+      return new ossimMillerProjection;
+   if(name == STATIC_TYPE_NAME(ossimMollweidProjection))
+      return new ossimMollweidProjection;
+   if(name == STATIC_TYPE_NAME(ossimNewZealandMapGridProjection))
+      return new ossimNewZealandMapGridProjection;
+   if(name == STATIC_TYPE_NAME(ossimObliqueMercatorProjection))
+      return new ossimObliqueMercatorProjection;
+   if(name == STATIC_TYPE_NAME(ossimOrthoGraphicProjection))
+      return new ossimOrthoGraphicProjection;
+   if(name == STATIC_TYPE_NAME(ossimPolarStereoProjection))
+      return new ossimPolarStereoProjection;
+   if(name == STATIC_TYPE_NAME(ossimPolyconicProjection))
+      return new ossimPolyconicProjection;
+   if(name == STATIC_TYPE_NAME(ossimSinusoidalProjection))
+      return new ossimSinusoidalProjection;
+   if(name == STATIC_TYPE_NAME(ossimStereographicProjection))
+      return new ossimStereographicProjection;
+   if(name == STATIC_TYPE_NAME(ossimTransCylEquAreaProjection))
+      return new ossimTransCylEquAreaProjection;
+   if(name == STATIC_TYPE_NAME(ossimTransMercatorProjection))
+      return new ossimTransMercatorProjection;
+   if(name == STATIC_TYPE_NAME(ossimUpsProjection))
+      return new ossimUpsProjection;
+   if(name == STATIC_TYPE_NAME(ossimUtmProjection))
+      return new ossimUtmProjection;
+   if(name == STATIC_TYPE_NAME(ossimVanDerGrintenProjection))
+      return new ossimVanDerGrintenProjection;
+   if(name == STATIC_TYPE_NAME(ossimSpaceObliqueMercatorProjection))
+      return new ossimSpaceObliqueMercatorProjection;
+   if(name == STATIC_TYPE_NAME(ossimGoogleProjection))
+     return new ossimGoogleProjection;
+   if(name == STATIC_TYPE_NAME(ossimAdjMapModel))
+     return new ossimAdjMapModel;
+  return NULL;
+}
+
+ossimObject* ossimMapProjectionFactory::createObject(const ossimString& typeName)const
+{
+   return createProjection(typeName);
+}
+
+ossimObject* ossimMapProjectionFactory::createObject(const ossimKeywordlist& kwl,
+                                                     const char* prefix)const
+{
+   return createProjection(kwl, prefix);
+}
+
+void ossimMapProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList)const
+{
+   
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimAlbersProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimAzimEquDistProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimBonneProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimBngProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimCassiniProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimCylEquAreaProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimEquDistCylProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimEckert4Projection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimEckert6Projection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimGnomonicProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimLambertConformalConicProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimLlxyProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimMercatorProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimMillerProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimMollweidProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimNewZealandMapGridProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimObliqueMercatorProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimOrthoGraphicProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimPolarStereoProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimPolyconicProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimSinusoidalProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimStereographicProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimTransCylEquAreaProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimTransMercatorProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimUpsProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimUtmProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimVanDerGrintenProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimSpaceObliqueMercatorProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimGoogleProjection)));
+   typeList.push_back(ossimString(STATIC_TYPE_NAME(ossimAdjMapModel)));
+
+}
diff --git a/ossim/src/ossim/projection/ossimMapProjectionInfo.cpp b/src/projection/ossimMapProjectionInfo.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimMapProjectionInfo.cpp
rename to src/projection/ossimMapProjectionInfo.cpp
diff --git a/ossim/src/ossim/projection/ossimMapViewController.cpp b/src/projection/ossimMapViewController.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimMapViewController.cpp
rename to src/projection/ossimMapViewController.cpp
diff --git a/ossim/src/ossim/projection/ossimMeanRadialLensDistortion.cpp b/src/projection/ossimMeanRadialLensDistortion.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimMeanRadialLensDistortion.cpp
rename to src/projection/ossimMeanRadialLensDistortion.cpp
diff --git a/src/projection/ossimMercatorProjection.cpp b/src/projection/ossimMercatorProjection.cpp
new file mode 100644
index 0000000..4ca59da
--- /dev/null
+++ b/src/projection/ossimMercatorProjection.cpp
@@ -0,0 +1,503 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Mercator projection code.  
+//*******************************************************************
+//  $Id: ossimMercatorProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+
+#include <math.h>
+#include <ossim/projection/ossimMercatorProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimMercatorProjection, "ossimMercatorProjection", ossimMapProjection)
+/***************************************************************************/
+/*
+ *                               DEFINES
+ */
+
+#define PI         3.14159265358979323e0  /* PI                            */
+#define PI_OVER_2  ( PI / 2.0e0)  
+//#define MAX_LAT    ( (PI * 89.5) / 180.0 )  /* 89.5 degrees in radians         */
+#define MAX_LAT    ( (PI * 89.99) / 180.0 )  /* 89.99 degrees in radians         */
+
+#define MERC_NO_ERROR           0x0000
+#define MERC_LAT_ERROR          0x0001
+#define MERC_LON_ERROR          0x0002
+#define MERC_EASTING_ERROR      0x0004
+#define MERC_NORTHING_ERROR     0x0008
+#define MERC_ORIGIN_LAT_ERROR   0x0010
+#define MERC_CENT_MER_ERROR     0x0020
+#define MERC_A_ERROR            0x0040
+#define MERC_B_ERROR            0x0080
+#define MERC_A_LESS_B_ERROR     0x0100
+
+ossimMercatorProjection::ossimMercatorProjection(const ossimEllipsoid& ellipsoid,
+                                                 const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+
+ossimMercatorProjection::ossimMercatorProjection(const ossimEllipsoid& ellipsoid,
+                                                 const ossimGpt& origin,
+                                                 double falseEasting,
+                                                 double falseNorthing,
+                                                 double scaleFactor)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   Merc_False_Easting  = falseEasting;
+   Merc_False_Northing = falseNorthing;
+   Merc_Scale_Factor   = scaleFactor;
+
+   update();
+}
+
+void ossimMercatorProjection::update()
+{
+   
+   Set_Mercator_Parameters(theEllipsoid.getA(),
+                           theEllipsoid.getFlattening(),
+                           theOrigin.latr(),
+                           theOrigin.lonr(),
+                           Merc_False_Easting,
+                           Merc_False_Northing,
+                           &Merc_Scale_Factor);
+
+   theFalseEastingNorthing.x = Merc_False_Easting;
+   theFalseEastingNorthing.y = Merc_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+void ossimMercatorProjection::setFalseEasting(double falseEasting)
+{
+   Merc_False_Easting = falseEasting;
+   update();
+}
+
+void ossimMercatorProjection::setFalseNorthing(double falseNorthing)
+{
+   Merc_False_Northing = falseNorthing;
+   update();
+}
+
+void ossimMercatorProjection::setScaleFactor(double scaleFactor)
+{
+   Merc_Scale_Factor = scaleFactor;
+   update();
+}
+
+void ossimMercatorProjection::setFalseEastingNorthing(double falseEasting,
+                                                      double falseNorthing)
+{
+   Merc_False_Easting = falseEasting;
+   Merc_False_Northing = falseNorthing;
+   update();
+}
+
+void ossimMercatorProjection::setParameters(double falseEasting,
+                                            double falseNorthing,
+                                            double scaleFactor)
+{
+   Merc_False_Easting  = falseEasting;
+   Merc_False_Northing = falseNorthing;
+   Merc_Scale_Factor   = scaleFactor;
+   
+   update(); 
+}
+
+void ossimMercatorProjection::setDefaults()
+{
+   Merc_False_Easting  = 0.0;
+   Merc_False_Northing = 0.0;
+   Merc_Delta_Easting  = 20237883.0;
+   Merc_Delta_Northing = 23421740.0;
+   Merc_Scale_Factor   = 1.0;
+}
+
+ossimGpt ossimMercatorProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+
+   if(theSphericalFlag)
+   {
+      double shift = M_PI * 6378137.0;
+      lon = (eastingNorthing.x / shift) * 180.0;
+      lat = (eastingNorthing.y / shift) * 180.0;
+      
+      lat = 180 / M_PI * (2 * atan( exp( lat * M_PI / 180.0)) - M_PI / 2.0);   
+   }
+   else 
+   {
+      Convert_Mercator_To_Geodetic(eastingNorthing.x,
+                                   eastingNorthing.y,
+                                   &lat,
+                                   &lon);
+      lat = ossim::radiansToDegrees(lat);
+      lon = ossim::radiansToDegrees(lon);
+   }
+
+   
+   
+   return ossimGpt(lat, lon, 0.0, theDatum);  
+}
+
+ossimDpt ossimMercatorProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   ossimDpt result;
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+   if(theSphericalFlag)
+   {
+      double lat = latLon.latd();
+      double lon = latLon.lond();
+      double shift = M_PI * Merc_a;
+      easting = lon * shift / 180.0;
+      northing = log( tan((90 + lat) * M_PI / 360.0 )) / (M_PI / 180.0);
+      
+      northing = northing * shift / 180.0;
+      result = ossimDpt(easting, northing);
+   }
+   else 
+   {
+     long errorCode = Convert_Geodetic_To_Mercator(gpt.latr(),
+                                   gpt.lonr(),
+                                   &easting,
+                                   &northing);
+     if(errorCode!=MERC_NO_ERROR)
+     {
+      result.makeNan();
+     }
+     else
+     {
+      result = ossimDpt(easting, northing);
+     }
+   }      
+
+   
+   return result;
+}
+
+
+bool ossimMercatorProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_FACTOR_KW,
+           Merc_Scale_Factor,
+           true);
+
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimMercatorProjection::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   const char* scaleFactor   = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
+   
+   setDefaults();
+
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimMercatorProjection))
+   {
+      Merc_False_Easting  = theFalseEastingNorthing.x;
+      Merc_False_Northing = theFalseEastingNorthing.y;
+
+      if(scaleFactor)
+      {
+         Merc_Scale_Factor = ossimString(scaleFactor).toDouble();
+      }
+   }
+   update();
+   
+   return flag;
+}
+
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS     
+ */
+
+
+long ossimMercatorProjection::Set_Mercator_Parameters(double a,      
+                                                      double f,
+                                                      double Origin_Latitude,
+                                                      double Central_Meridian,
+                                                      double False_Easting,
+                                                      double False_Northing,
+                                                      double *Scale_Factor)
+{ /* BEGIN Set_Mercator_Parameters */
+/*
+ * The function Set_Mercator_Parameters receives the ellipsoid parameters and
+ * Mercator projection parameters as inputs, and sets the corresponding state 
+ * variables.  It calculates and returns the scale factor.  If any errors
+ * occur, the error code(s) are returned by the function, otherwise Merc_NO_ERROR
+ * is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid						        (input)
+ *    Origin_Latitude   : Latitude in radians at which the          (input)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (input)
+ *    Scale_Factor      : Multiplier which reduces distances in the 
+ *                          projection to the actual distance on the
+ *                          ellipsoid                               (output)
+ */
+
+  double es2;   /* Eccentricity squared of ellipsoid to the second power    */
+  double es3;   /* Eccentricity squared of ellipsoid to the third power     */
+  double es4;   /* Eccentricity squared of ellipsoid to the fourth power    */
+  double sin_olat; /* sin(Origin_Latitude), temp variable */
+//  double inv_f = 1 / f;
+  long Error_Code = MERC_NO_ERROR;
+
+   theSphericalFlag = ossim::almostEqual(f, 0.0);
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= MERC_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= MERC_INV_F_ERROR;
+//   }
+//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
+//   { /* origin latitude out of range */
+//     Error_Code |= MERC_ORIGIN_LAT_ERROR;
+//   }
+//   if ((Central_Meridian < -PI) || (Central_Meridian > (2*PI)))
+//   { /* origin longitude out of range */
+//     Error_Code |= MERC_CENT_MER_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    Merc_a = a;
+    Merc_f = f;
+    Merc_Origin_Lat = Origin_Latitude;
+//     if (Central_Meridian > PI)
+//       Central_Meridian -= (2*PI);
+    Merc_Origin_Long = Central_Meridian;
+    Merc_False_Northing = False_Northing;
+    Merc_False_Easting = False_Easting;
+    Merc_es = 2 * Merc_f - Merc_f * Merc_f;
+    Merc_e = sqrt(Merc_es);
+    sin_olat = sin(Origin_Latitude);
+    Merc_Scale_Factor = 1.0 / ( sqrt(1.e0 - Merc_es * sin_olat * sin_olat) 
+                                / cos(Origin_Latitude) );
+    es2 = Merc_es * Merc_es;
+    es3 = es2 * Merc_es;
+    es4 = es3 * Merc_es;
+    Merc_ab = Merc_es / 2.e0 + 5.e0 * es2 / 24.e0 + es3 / 12.e0
+              + 13.e0 * es4 / 360.e0;
+    Merc_bb = 7.e0 * es2 / 48.e0 + 29.e0 * es3 / 240.e0 
+              + 811.e0 * es4 / 11520.e0;
+    Merc_cb = 7.e0 * es3 / 120.e0 + 81.e0 * es4 / 1120.e0;
+    Merc_db = 4279.e0 * es4 / 161280.e0;
+    *Scale_Factor = Merc_Scale_Factor;
+    Convert_Geodetic_To_Mercator( MAX_LAT, (Merc_Origin_Long + PI),                                           
+                                  &Merc_Delta_Easting, &Merc_Delta_Northing);
+    if (Merc_Delta_Easting < 0)
+      Merc_Delta_Easting = -Merc_Delta_Easting;
+    Merc_Delta_Easting *= 1.01;
+    Merc_Delta_Easting -= Merc_False_Easting;
+    Merc_Delta_Northing *= 1.01;
+    Merc_Delta_Northing -= Merc_False_Northing;
+  } /* END OF if(!Error_Code) */
+  return (Error_Code);
+} /* END OF Set_Mercator_Parameters */
+
+
+void ossimMercatorProjection::Get_Mercator_Parameters(double *a,
+                                                      double *f,
+                                                      double *Origin_Latitude,
+                                                      double *Central_Meridian,
+                                                      double *False_Easting,
+                                                      double *False_Northing,
+                                                      double *Scale_Factor)const
+{ /* BEGIN Get_Mercator_Parameters */
+/*
+ * The function Get_Mercator_Parameters returns the current ellipsoid
+ * parameters, Mercator projection parameters, and scale factor.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid						        (output)
+ *    Origin_Latitude   : Latitude in radians at which the          (output)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (output)
+ *    Scale_Factor      : Multiplier which reduces distances in the 
+ *                          projection to the actual distance on the
+ *                          ellipsoid                               (output)
+ */
+
+  *a = Merc_a;
+  *f = Merc_f;
+  *Origin_Latitude = Merc_Origin_Lat;
+  *Central_Meridian = Merc_Origin_Long;
+  *False_Easting = Merc_False_Easting;
+  *False_Northing = Merc_False_Northing;
+  *Scale_Factor = Merc_Scale_Factor;
+  
+  return;
+} /* END OF Get_Mercator_Parameters */
+
+
+long ossimMercatorProjection::Convert_Geodetic_To_Mercator (double Latitude,
+                                                            double Longitude,
+                                                            double *Easting,
+                                                            double *Northing)const
+{ /* BEGIN Convert_Geodetic_To_Mercator */
+   long Error_Code = MERC_NO_ERROR;
+/*
+ * The function Convert_Geodetic_To_Mercator converts geodetic (latitude and
+ * longitude) coordinates to Mercator projection (easting and northing)
+ * coordinates, according to the current ellipsoid and Mercator projection
+ * parameters.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise MERC_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double ctanz2;        /* Cotangent of z/2 - z - Isometric colatitude     */
+  double e_x_sinlat;    /* e * sin(Latitude)                               */
+  double Delta_Long;    /* Difference in origin longitude and longitude    */
+  double tan_temp;
+  double pow_temp;
+
+
+   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
+   { /* Latitude out of range */
+     Error_Code |= MERC_LAT_ERROR;
+   }
+//   if ((Longitude < -PI) || (Longitude > (2*PI)))
+//   { /* Longitude out of range */
+//     Error_Code |= MERC_LON_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    if (Longitude > PI)
+      Longitude -= (2*PI);
+    e_x_sinlat = Merc_e * sin(Latitude);
+    tan_temp = tan(PI / 4.e0 + Latitude / 2.e0);
+    pow_temp = pow( ((1.e0 - e_x_sinlat) / (1.e0 + e_x_sinlat)),
+                    (Merc_e / 2.e0) );
+    ctanz2 = tan_temp * pow_temp;
+    *Northing = Merc_Scale_Factor * Merc_a * log(ctanz2) + Merc_False_Northing;
+    Delta_Long = Longitude - Merc_Origin_Long;
+//     if (Delta_Long > PI)
+//       Delta_Long -= (2 * PI);
+//     if (Delta_Long < -PI)
+//       Delta_Long += (2 * PI);
+    *Easting = Merc_Scale_Factor * Merc_a * Delta_Long
+               + Merc_False_Easting;
+  }
+
+  return (Error_Code);
+} /* END OF Convert_Geodetic_To_Mercator */
+
+
+long ossimMercatorProjection::Convert_Mercator_To_Geodetic(double Easting,
+                                                           double Northing,
+                                                           double *Latitude,
+                                                           double *Longitude)const
+{ /* BEGIN Convert_Mercator_To_Geodetic */
+/*
+ * The function Convert_Mercator_To_Geodetic converts Mercator projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid and Mercator projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise MERC_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
+  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
+  double xphi;   /* Isometric latitude                                      */
+   long Error_Code = MERC_NO_ERROR;
+
+#if 0
+   if(theSphericalFlag)
+   {
+      *Latitude = M_PI*.5 - 2.0 * atan(exp(-Easting / Merc_a));
+      *Longitude = Easting/Merc_a;
+      
+      return Error_Code;
+   }
+#endif
+//   if ((Easting < (Merc_False_Easting - Merc_Delta_Easting))
+//       || (Easting > (Merc_False_Easting + Merc_Delta_Easting)))
+//   { /* Easting out of range */
+//     Error_Code |= MERC_EASTING_ERROR;
+//   }
+//   if ((Northing < (Merc_False_Northing - Merc_Delta_Northing))
+//       || (Northing > (Merc_False_Northing + Merc_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= MERC_NORTHING_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    dy = Northing - Merc_False_Northing;
+    dx = Easting - Merc_False_Easting;
+    *Longitude = Merc_Origin_Long + dx / (Merc_Scale_Factor * Merc_a);
+    xphi = PI / 2.e0 
+           - 2.e0 * atan(1.e0 / exp(dy / (Merc_Scale_Factor * Merc_a)));
+    *Latitude = xphi + Merc_ab * sin(2.e0 * xphi) + Merc_bb * sin(4.e0 * xphi)
+                + Merc_cb * sin(6.e0 * xphi) + Merc_db * sin(8.e0 * xphi);
+//     if (*Longitude > PI)
+//       *Longitude -= (2 * PI);
+//     if (*Longitude < -PI)
+//       *Longitude += (2 * PI);
+  }
+  return (Error_Code);
+} /* END OF Convert_Mercator_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimMercatorProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimMercatorProjection* p = dynamic_cast<const ossimMercatorProjection*>(&proj);
+   if (!p) return false;
+   
+   if (!ossim::almostEqual(Merc_Scale_Factor,p->Merc_Scale_Factor)) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimMgrs.c b/src/projection/ossimMgrs.c
similarity index 100%
rename from ossim/src/ossim/projection/ossimMgrs.c
rename to src/projection/ossimMgrs.c
diff --git a/ossim/src/ossim/projection/ossimMillerProjection.cpp b/src/projection/ossimMillerProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimMillerProjection.cpp
rename to src/projection/ossimMillerProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimMiscProjectionFactory.cpp b/src/projection/ossimMiscProjectionFactory.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimMiscProjectionFactory.cpp
rename to src/projection/ossimMiscProjectionFactory.cpp
diff --git a/src/projection/ossimMollweidProjection.cpp b/src/projection/ossimMollweidProjection.cpp
new file mode 100644
index 0000000..d44c552
--- /dev/null
+++ b/src/projection/ossimMollweidProjection.cpp
@@ -0,0 +1,448 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Mollweid projection code.  
+//*******************************************************************
+//  $Id: ossimMollweidProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+#include <math.h>
+#include <ossim/projection/ossimMollweidProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimMollweidProjection, "ossimMollweidProjection", ossimMapProjection)
+
+/***************************************************************************/
+/*
+ *                              DEFINES
+ */
+#ifndef PI_OVER_2
+#  define PI_OVER_2  ( M_PI / 2.0)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI     (2.0 * M_PI)
+#endif
+#define MAX_LAT    ( (M_PI * 90.0) / 180.0 ) /* 90 degrees in radians    */
+
+#define MOLL_NO_ERROR           0x0000
+#define MOLL_LAT_ERROR          0x0001
+#define MOLL_LON_ERROR          0x0002
+#define MOLL_EASTING_ERROR      0x0004
+#define MOLL_NORTHING_ERROR     0x0008
+#define MOLL_CENT_MER_ERROR     0x0020
+#define MOLL_A_ERROR            0x0040
+#define MOLL_B_ERROR            0x0080
+#define MOLL_A_LESS_B_ERROR     0x0100
+
+ossimMollweidProjection::ossimMollweidProjection(const ossimEllipsoid& ellipsoid,
+                                                 const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+
+ossimMollweidProjection::ossimMollweidProjection(const ossimEllipsoid& ellipsoid,
+                                                 const ossimGpt& origin,
+                                                 double falseEasting,
+                                                 double falseNorthing)
+   :ossimMapProjection(ellipsoid, origin)
+{
+
+   Moll_False_Easting  = falseEasting;
+   Moll_False_Northing = falseNorthing;
+   Moll_Delta_Northing = 9009965.0;
+   Moll_Max_Easting    = 18019930.0;
+   Moll_Min_Easting    = -18019930.0;
+
+   update();
+}
+
+void ossimMollweidProjection::update()
+{   
+
+   Set_Mollweide_Parameters(theEllipsoid.getA(),
+                            theEllipsoid.getFlattening(),
+                            theOrigin.lonr(),
+                            Moll_False_Easting,
+                            Moll_False_Northing);
+
+   theFalseEastingNorthing.x = Moll_False_Easting;
+   theFalseEastingNorthing.y = Moll_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+void ossimMollweidProjection::setFalseEasting(double falseEasting)
+{
+   Moll_False_Easting = falseEasting;
+   update();
+}
+
+void ossimMollweidProjection::setFalseNorthing(double falseNorthing)
+{
+   Moll_False_Northing = falseNorthing;
+   update();
+}
+
+void ossimMollweidProjection::setDefaults()
+{
+   Moll_False_Easting  = 0.0;
+   Moll_False_Northing = 0.0;
+   Moll_Delta_Northing = 9009965.0;
+   Moll_Max_Easting    = 18019930.0;
+   Moll_Min_Easting    = -18019930.0;
+}
+
+void ossimMollweidProjection::setFalseEastingNorthing(double falseEasting,
+                                                      double falseNorthing)
+{
+   Moll_False_Easting  = falseEasting;
+   Moll_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimMollweidProjection::setCentralMeridian(double centralMeridian)
+{
+  Moll_Origin_Long = centralMeridian;
+  update();
+}
+
+ossimGpt ossimMollweidProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_Mollweide_To_Geodetic(eastingNorthing.x,
+                                 eastingNorthing.y,
+                                 &lat,
+                                 &lon);
+
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
+}
+
+ossimDpt ossimMollweidProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Mollweide(gpt.latr(),
+                                 gpt.lonr(),
+                                 &easting,
+                                 &northing);
+   
+   return ossimDpt(easting, northing);
+}
+
+bool ossimMollweidProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimMollweidProjection::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+
+   setDefaults();
+
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimMollweidProjection))
+   {
+      Moll_False_Easting  = theFalseEastingNorthing.x;
+      Moll_False_Northing = theFalseEastingNorthing.y;
+   }
+   update();
+
+   return flag;   
+}
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS
+ */
+
+
+long ossimMollweidProjection::Set_Mollweide_Parameters(double a,
+                                                       double f,
+                                                       double Central_Meridian,
+                                                       double False_Easting,
+                                                       double False_Northing)
+{ /* Begin Set_Mollweide_Parameters */
+/*
+ * The function Set_Mollweide_Parameters receives the ellipsoid parameters and
+ * Mollweide projcetion parameters as inputs, and sets the corresponding state
+ * variables.  If any errors occur, the error code(s) are returned by the 
+ * function, otherwise MOLL_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid						        (input)
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (input)
+ */
+
+  double Ra;                       /* Spherical Radius */
+//  double inv_f = 1 / f;
+  long Error_Code = MOLL_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= MOLL_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= MOLL_INV_F_ERROR;
+//   }
+//   if ((Central_Meridian < -PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= MOLL_CENT_MER_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    Moll_a = a;
+    Moll_f = f;
+    es2 = 2 * Moll_f - Moll_f * Moll_f;
+    es4 = es2 * es2;
+    es6 = es4 * es2;
+    /* spherical radius */
+    Ra = Moll_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 / 3024.0);
+    Sqrt2_Ra = sqrt(2.0) * Ra;
+    Sqrt8_Ra = sqrt(8.0) * Ra;
+//     if (Central_Meridian > PI)
+//       Central_Meridian -= TWO_PI;
+    Moll_Origin_Long = Central_Meridian;
+    Moll_False_Easting = False_Easting;
+    Moll_False_Northing = False_Northing;
+
+    if (Moll_Origin_Long > 0)
+    {
+      Moll_Max_Easting = 17919819.0;
+      Moll_Min_Easting = -18019930.0;
+    }
+    else if (Moll_Origin_Long < 0)
+    {
+      Moll_Max_Easting = 18019930.0;
+      Moll_Min_Easting = -17919819.0;
+    }
+    else
+    {
+      Moll_Max_Easting = 18019930.0;
+      Moll_Min_Easting = -18019930.0;
+    }
+
+  } /* End if(!Error_Code) */
+  return (Error_Code);
+} /* End Set_Mollweide_Parameters */
+
+
+void ossimMollweidProjection::Get_Mollweide_Parameters(double *a,
+                                                       double *f,
+                                                       double *Central_Meridian,
+                                                       double *False_Easting,
+                                                       double *False_Northing)const
+{ /* Begin Get_Mollweide_Parameters */
+/*
+ * The function Get_Mollweide_Parameters returns the current ellipsoid
+ * parameters and Mollweide projection parameters.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid						        (output)
+ *    Central_Meridian  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (output)
+ */
+
+  *a = Moll_a;
+  *f = Moll_f;
+  *Central_Meridian = Moll_Origin_Long;
+  *False_Easting = Moll_False_Easting;
+  *False_Northing = Moll_False_Northing;
+  
+  return;
+} /* End Get_Mollweide_Parameters */
+
+
+long ossimMollweidProjection::Convert_Geodetic_To_Mollweide (double Latitude,
+                                                             double Longitude,
+                                                             double *Easting,
+                                                             double *Northing)const
+
+{ /* Begin Convert_Geodetic_To_Mollweide */
+/*
+ * The function Convert_Geodetic_To_Mollweide converts geodetic (latitude and
+ * longitude) coordinates to Mollweide projection (easting and northing)
+ * coordinates, according to the current ellipsoid and Mollweide projection
+ * parameters.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise MOLL_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double PI_Sin_Latitude = M_PI * sin(Latitude);
+  double dlam;                                  /* Longitude - Central Meridan */
+  double theta;
+  double theta_primed = Latitude;
+  double delta_theta_primed = 0.1745329;        /* arbitrarily initialized to 10 deg */
+  double dtp_tolerance = 4.85e-10;              /* approximately 1/1000th of
+                                                 an arc second or 1/10th meter */
+  long   Error_Code = MOLL_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   {  /* Latitude out of range */
+//     Error_Code |= MOLL_LAT_ERROR;
+//   }
+//   if ((Longitude < -PI) || (Longitude > TWO_PI))
+//   {  /* Longitude out of range */
+//     Error_Code|= MOLL_LON_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+    dlam = Longitude - Moll_Origin_Long;
+//     if (dlam > PI)
+//     {
+//       dlam -= TWO_PI;
+//     }
+//     if (dlam < -PI)
+//     {
+//       dlam += TWO_PI;
+//     }
+    while (fabs(delta_theta_primed) > dtp_tolerance)
+    {
+      delta_theta_primed = -(theta_primed + sin(theta_primed) -
+                             PI_Sin_Latitude) / (1.0 + cos(theta_primed));
+      theta_primed += delta_theta_primed;
+    }
+    theta = theta_primed / 2.0;
+    *Easting = (Sqrt8_Ra / M_PI ) * dlam * cos(theta) +
+               Moll_False_Easting;
+    *Northing = Sqrt2_Ra * sin(theta) + Moll_False_Northing;
+
+  }
+  return (Error_Code);
+
+} /* End Convert_Geodetic_To_Mollweide */
+
+
+long ossimMollweidProjection::Convert_Mollweide_To_Geodetic(double Easting,
+                                                            double Northing,
+                                                            double *Latitude,
+                                                            double *Longitude)const
+{ /* Begin Convert_Mollweide_To_Geodetic */
+/*
+ * The function Convert_Mollweide_To_Geodetic converts Mollweide projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid and Mollweide projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise MOLL_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double dx, dy;
+  double theta = 0.0;
+  double two_theta;
+  double i;
+
+  long Error_Code = MOLL_NO_ERROR;
+
+//   if ((Easting < (Moll_False_Easting + Moll_Min_Easting))
+//       || (Easting > (Moll_False_Easting + Moll_Max_Easting)))
+//   { /* Easting out of range  */
+//     Error_Code |= MOLL_EASTING_ERROR;
+//   }
+//   if ((Northing < (Moll_False_Northing - Moll_Delta_Northing)) || 
+//       (Northing >(Moll_False_Northing + Moll_Delta_Northing) ))
+//   { /* Northing out of range */
+//     Error_Code |= MOLL_NORTHING_ERROR;
+//   }
+
+  if (!Error_Code)
+  {
+    dy = Northing - Moll_False_Northing;
+    dx = Easting - Moll_False_Easting;
+    i = dy / Sqrt2_Ra;
+    if (fabs(i) > 1.0)
+    {
+      *Latitude = MAX_LAT;
+      if (Northing < 0.0)
+        *Latitude *= -1.0;
+    }
+
+    else
+    {
+      theta = asin(i);
+      two_theta = 2.0 * theta;
+      *Latitude = asin((two_theta + sin(two_theta)) / M_PI);
+
+      if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+        *Latitude = PI_OVER_2;
+      else if (*Latitude < -PI_OVER_2)
+        *Latitude = -PI_OVER_2;
+
+    }
+    if (fabs(fabs(*Latitude) - MAX_LAT) < 1.0e-10)
+      *Longitude = Moll_Origin_Long;
+    else
+      *Longitude = Moll_Origin_Long + M_PI * dx /
+                   (Sqrt8_Ra * cos(theta));
+
+//     if (*Longitude > PI)
+//       *Longitude -= TWO_PI;
+//     if (*Longitude < -PI)
+//       *Longitude += TWO_PI;
+
+//     if (*Longitude > PI)  /* force distorted values to 180, -180 degrees */
+//       *Longitude = PI;
+//     else if (*Longitude < -PI)
+//       *Longitude = -PI;
+
+
+  }
+  return (Error_Code);
+
+} /* End Convert_Mollweide_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimMollweidProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimMollweidProjection* p = dynamic_cast<const ossimMollweidProjection*>(&proj);
+   if (!p) return false;
+
+   if (!ossim::almostEqual(Moll_Origin_Long,p->Moll_Origin_Long)) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimNewZealandMapGridProjection.cpp b/src/projection/ossimNewZealandMapGridProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimNewZealandMapGridProjection.cpp
rename to src/projection/ossimNewZealandMapGridProjection.cpp
diff --git a/src/projection/ossimNgaProjectionFactory.cpp b/src/projection/ossimNgaProjectionFactory.cpp
new file mode 100644
index 0000000..5caf0ee
--- /dev/null
+++ b/src/projection/ossimNgaProjectionFactory.cpp
@@ -0,0 +1,86 @@
+//*******************************************************************
+// Copyright (C) 2014 RadiantBlue, Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//*******************************************************************
+//  $Id$
+
+#include <ossim/projection/ossimNgaProjectionFactory.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/projection/ossimMercatorProjection.h>
+
+// Define Trace flags for use within this file:
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceDebug = ossimTrace("ossimNgaProjectionFactory:debug");
+
+RTTI_DEF1(ossimNgaProjectionFactory, "ossimNgaProjectionFactory",
+      ossimProjectionFactoryBase);
+
+//*************************************************************************************************
+//! Implements singleton pattern
+//*************************************************************************************************
+ossimNgaProjectionFactory* ossimNgaProjectionFactory::instance()
+{
+   static ossimNgaProjectionFactory inst;
+
+   return &inst;
+}
+
+ossimProjection* ossimNgaProjectionFactory::createProjection(const ossimFilename& filename,
+      ossim_uint32 entryIdx) const
+      {
+   // Check for external geometry file.
+   return createProjectionFromGeometryFile(filename, entryIdx);
+}
+
+//**************************************************************************************************
+// This is the principal factory method. It accepts a string in format:
+//
+//   <group>:<code>, for example "NGA:235" (Currently only code supported, used in GeoPackage)
+//
+// IMPORTANT NOTE: Image tie-points cannot be conveyed by a projection code. The projection
+// created here will not be fully initialized for use in rendering imagery.
+//**************************************************************************************************
+ossimProjection* ossimNgaProjectionFactory::createProjection(const ossimString& spec) const
+
+{
+   ossimProjection* proj = 0;
+   if ((!ossimString(spec).downcase().contains("nga")) && (spec.after(":").toInt() == 235))
+   {
+      const ossimEllipsoid* e = ossimEllipsoidFactory::instance()->create("WE");
+      proj = new ossimMercatorProjection(*e, ossimGpt(0,0), 0, 0, 0.857385503731176);
+   }
+
+   return proj;
+}
+
+/**
+ * Take a keywordlist.
+ */
+ossimProjection* ossimNgaProjectionFactory::createProjection(
+   const ossimKeywordlist& /* kwl */, const char* /* prefix */) const
+{
+   return 0;
+}
+
+ossimObject* ossimNgaProjectionFactory::createObject(
+      const ossimString& typeName) const
+{
+   return createProjection(typeName);
+}
+
+ossimObject* ossimNgaProjectionFactory::createObject(const ossimKeywordlist& kwl,
+      const char* prefix) const
+{
+   return createProjection(kwl, prefix);
+}
+
+void ossimNgaProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList) const
+{
+    typeList.push_back(ossimString("NGA:235 \"Scaled World Mercator\""));
+}
diff --git a/ossim/src/ossim/projection/ossimNitfMapModel.cpp b/src/projection/ossimNitfMapModel.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimNitfMapModel.cpp
rename to src/projection/ossimNitfMapModel.cpp
diff --git a/src/projection/ossimNitfProjectionFactory.cpp b/src/projection/ossimNitfProjectionFactory.cpp
new file mode 100644
index 0000000..329688b
--- /dev/null
+++ b/src/projection/ossimNitfProjectionFactory.cpp
@@ -0,0 +1,992 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Description:
+//
+// Contains class definition for ossimNitfProjectionFactory.
+//
+// $Id: ossimNitfProjectionFactory.cpp 23671 2015-12-19 01:07:26Z gpotts $
+//----------------------------------------------------------------------------
+
+#include <ossim/projection/ossimNitfProjectionFactory.h>
+#include <ossim/base/ossimDms.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/imaging/ossimNitfTileSource.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimMgrs.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/support_data/ossimNitfBlockaTag.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <fstream>
+#include <cmath>
+
+// Define Trace flags for use within this file:
+static ossimTrace traceDebug(ossimString("ossimNitfProjectionFactory:debug"));
+
+ossimNitfProjectionFactory* ossimNitfProjectionFactory::theInstance = 0;
+
+ossimNitfProjectionFactory::ossimNitfProjectionFactory()
+{
+}
+
+ossimNitfProjectionFactory::~ossimNitfProjectionFactory()
+{
+}
+
+ossimNitfProjectionFactory* ossimNitfProjectionFactory::instance()
+{
+   if(!theInstance)
+   {
+      theInstance = new ossimNitfProjectionFactory();
+   }
+
+   return theInstance;
+}
+
+ossimProjection*
+ossimNitfProjectionFactory::createProjection(const ossimFilename& filename,
+                                             ossim_uint32 entryIdx)const
+{
+   static const char MODULE[]="ossimNitfProjectionFactory::createProjection";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG:"
+         << "\nfilename:  " << filename
+         << "\nentryIdx:  " << entryIdx
+         << std::endl;
+   }
+
+   // See if there is an external geomtry.
+   ossimProjection* result = createProjectionFromGeometryFile(filename, entryIdx);
+   if (result)
+   {
+      return result;
+   }
+
+   if(!isNitf(filename))
+   {
+      return result; // result is NULL
+   }
+
+   ossimRefPtr<ossimNitfFile> nitf = new ossimNitfFile();
+   if (!nitf->parseFile(filename))
+   {
+      return result; // result is NULL
+   }
+
+   long imageIndex = static_cast<long>(entryIdx);
+   if ( imageIndex > (nitf->getHeader()->getNumberOfImages()-1) )
+   {
+      return result;
+   }
+
+   ossimRefPtr<ossimNitfImageHeader> imageHeader = nitf->getNewImageHeader(imageIndex);
+   {
+      if (!imageHeader)
+      {
+         return result;
+      }
+   }
+
+   result = createProjectionFromHeaders(nitf->getHeader(),
+                                        imageHeader.get());
+   if (traceDebug())
+   {
+      ossimString coordinateSystem   = imageHeader->getCoordinateSystem();
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG:"
+         << "\ncoordinateSysetm:       " << coordinateSystem
+         << std::endl;
+   }
+
+   return result;
+}
+
+
+ossimProjection*
+ossimNitfProjectionFactory::createProjection(const ossimKeywordlist& /* kwl */,
+                                             const char* /* prefix */) const
+{
+   return 0;
+}
+
+ossimProjection*
+ossimNitfProjectionFactory::createProjection(const ossimString& /* name */) const
+{
+   return 0;
+}
+
+ossimObject*
+ossimNitfProjectionFactory::createObject(const ossimString& typeName)const
+{
+   return (ossimObject*)createProjection(typeName);
+}
+
+ossimObject*
+ossimNitfProjectionFactory::createObject(const ossimKeywordlist& kwl,
+                                         const char* prefix)const
+{
+   return createProjection(kwl, prefix);
+}
+
+void ossimNitfProjectionFactory::getTypeNameList(std::vector<ossimString>& /* typeList */)const
+{
+   
+}
+
+ossimProjection* ossimNitfProjectionFactory::createProjection(ossimImageHandler* handler)const
+{
+   ossimNitfTileSource* nitfTileSource = dynamic_cast<ossimNitfTileSource*> (handler);
+   ossimProjection* result = 0;
+   if(nitfTileSource)
+   {
+      if(!result)
+      {
+         ossimNitfImageHeader* imageHeader = nitfTileSource->getCurrentImageHeader();
+         if(imageHeader)
+         {
+            result = createProjectionFromHeaders(nitfTileSource->getFileHeader(),imageHeader);
+         }
+      }
+   }
+   else if(isNitf(handler->getFilename()))
+   {
+      result =  createProjection(handler->getFilename(), handler->getCurrentEntry());
+   }
+   return result;
+}
+
+bool ossimNitfProjectionFactory::isNitf(const ossimFilename& filename)const
+{
+   std::ifstream in(filename.c_str(), ios::in|ios::binary);
+   
+   if(in)
+   {
+      char nitfFile[4];
+      in.read((char*)nitfFile, 4);
+      ossimString s(nitfFile, nitfFile+4);
+      if ( (s == "NITF") || (s == "NSIF") )
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+ossimProjection* ossimNitfProjectionFactory::createProjectionFromHeaders(
+   ossimNitfFileHeader* fileHeader, ossimNitfImageHeader* imageHeader)const
+{
+   ossimProjection* result = 0;
+   ossimString version = fileHeader->getVersion();
+   ossimString coordinateSystem = imageHeader->getCoordinateSystem();
+
+   // Note in version 2.0 ICORDS with 'N' == NONE.  In 2.1 it is UTM North:
+   if (coordinateSystem == "G" || coordinateSystem == "D")
+   {
+      result = makeGeographic(imageHeader, coordinateSystem);
+   }
+   else if( (coordinateSystem == "S") || (coordinateSystem == "U") || 
+            ( version != "02.00" && (coordinateSystem == "N") ) )
+   {
+      result = makeUtm(imageHeader, coordinateSystem);
+   }
+   return result;
+}
+
+ossimProjection* ossimNitfProjectionFactory::makeGeographic(
+   const ossimNitfImageHeader* hdr,
+   const ossimString& coordinateSysetm) const
+{
+   ossimProjection* proj = 0;
+
+   if (hdr)
+   {
+      // To hold corner points.
+      std::vector<ossimGpt> gpts;
+      
+      //---
+      // Get the corner points.
+      // 
+      // Look for points from the BLOCKA tag.  This may or may not be present.
+      // If present since it has six digit precision use it for the points.
+      //---
+      if ( getBlockaPoints(hdr, gpts) == false )
+      {
+         ossimString geographicLocation = hdr->getGeographicLocation();
+
+         if ( geographicLocation.size() )
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimNitfProjectionFactory::makeGeographic DEBUG:"
+                  << "\ngeographicLocation: " << geographicLocation
+                  << std::endl;
+            }
+            
+            if (coordinateSysetm == "G")
+            {
+               //---
+               // If coord system is G then format is:
+               // Lat = ddmmssX
+               //       where d is degrees and m is minutes
+               //       and s is seconds and X is either N (North) or S (South).
+               // Lon = dddmmssX
+               //       where d is degrees and m is minutes
+               //       and s is seconds and X is either N (North) or S (South).
+               //---
+               parseGeographicString(geographicLocation, gpts);
+            }
+            else if (coordinateSysetm == "D")
+            {
+               //---
+               // If coor system is D then format is:
+               // +-dd.ddd +-dd.ddd four times where + is northern hemispher and
+               // - is souther hemisphere for lat and longitude
+               // + is easting and - is westing.
+               //---
+               parseDecimalDegreesString(geographicLocation, gpts);
+            }
+            
+         } // matches: if ( geographicLocation.size() )
+         
+      } // matches: if ( getBlockaPoints(hdr, gpts) == false )
+         
+      if (gpts.size() == 4)
+      {   
+         ossimDpt scaleTest;
+         computeScaleInDecimalDegrees(hdr, gpts, scaleTest);
+
+         if (!isSkewed(gpts)&&(ossim::abs(scaleTest.y/scaleTest.x) <= 1.0))
+         {
+            proj = makeEuiDistant(hdr, gpts);
+         }
+         else
+         {
+            // Image is rotated.  Make a Bilinear.
+            proj = makeBilinear(hdr, gpts);
+         }
+      }
+
+      if (traceDebug() && proj)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfProjectionFactory::makeGeographic DEBUG:"
+            << "\nUpper left corner:   " << gpts[0]
+            << "\nUpper right corner:  " << gpts[1]
+            << "\nLower right corner:  " << gpts[2]
+            << "\nLower left corner:   " << gpts[3] << "\n";
+         proj->print( ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+      
+   } // matches: if (hdr)
+
+   return proj;
+}
+
+ossimProjection* ossimNitfProjectionFactory::makeUtm(
+   const ossimNitfImageHeader* hdr,
+   const ossimString& coordinateSystem) const
+{
+   ossimProjection* proj = 0;
+   bool isBilinear = false;
+   if (hdr)
+   {
+      ossimString geographicLocation = hdr->getGeographicLocation();
+
+      if ( geographicLocation.size() )
+      {
+         std::vector<ossimDpt> utmPoints;
+         ossim_uint32 zone;
+         ossimDpt scale;
+         char hemisphere = 'N';
+         
+         bool status = true;
+         if ( coordinateSystem == "U")
+         {
+            // Sets zone, hemisphere and utmPoints. Returns true on success.
+            status = parseMgrsString(geographicLocation, zone, hemisphere, utmPoints);
+         }
+         else
+         {
+            // Sets zone and utmPoints.  Void return...
+            parseUtmString(geographicLocation, zone, utmPoints);
+            if(coordinateSystem == "S")
+            {
+               hemisphere = 'S';
+            }
+         }
+         
+         if ( status )
+         {
+            if ( traceDebug() )
+            {
+               std::string s;
+               s.push_back(hemisphere);
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimNitfProjectionFactory::makeUtm DEBUG"
+                  << "\ngeo string: " << geographicLocation
+                  << "\nutm zone:   " << zone
+                  << "\nhemisphere: " << hemisphere
+                  << std::endl;
+               for (ossim_uint32 i=0; i<utmPoints.size(); ++i)
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "utmPoints[" << utmPoints[i] << std::endl;
+               }
+            }
+            
+            ossimRefPtr<ossimUtmProjection> uproj = new ossimUtmProjection;
+            uproj->setHemisphere(hemisphere);
+            uproj->setZone(zone);
+            
+            if(isSkewed(utmPoints))
+            {
+               std::vector<ossimGpt> gpts;
+               
+               // Try blocka points first as they are more accurate.
+               if ( getBlockaPoints(hdr, gpts) == false )
+               {
+                  ossimGpt ul = uproj->inverse(utmPoints[0]);
+                  ossimGpt ur = uproj->inverse(utmPoints[1]);
+                  ossimGpt lr = uproj->inverse(utmPoints[2]);
+                  ossimGpt ll = uproj->inverse(utmPoints[3]);
+                  gpts.push_back(ul);
+                  gpts.push_back(ur);
+                  gpts.push_back(lr);
+                  gpts.push_back(ll);
+               }
+
+               //---
+               // Make a bilinear either from our skewed utm points or the points from the blocka
+               // tag.
+               //---
+               proj = makeBilinear(hdr, gpts);
+               if(proj) scale = proj->getMetersPerPixel();
+               isBilinear = true;
+               uproj = 0; // Done with utm projeciton
+               
+            }
+            else
+            {
+               computeScaleInMeters(hdr, utmPoints, scale);
+               
+               //---
+               // Assign our projection to the return "proj".
+               // Use ossimRefPtr::release the so we don't delete proj when uproj
+               // goes out of scope.
+               //---
+               proj = uproj.release(); 
+            }
+            
+            if( (scale.hasNans() == false)&&(!isBilinear) )
+            {
+               //---
+               // Get the tie point.
+               // 
+               // Look for the the BLOCKA tag which may or may not be present.
+               // This has six digit precision in decimal degrees which equates to
+               // about 0.11 meters (at equator) as compared to 1.0 accuaracy of the
+               // IGEOLO field.
+               //---
+               ossimDpt tie;
+               std::vector<ossimGpt> gpts;
+               if ( getBlockaPoints(hdr, gpts) )
+               {
+                  if (traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_DEBUG)
+                        << "ossimNitfProjectionFactory::makeUtm DEBUG:"
+                        << "\nTie point from blocka: " << gpts[0]
+                        << endl;
+                  }
+                  
+                  tie = proj->forward(gpts[0]);
+                  tie.x += scale.x/2.0;
+                  tie.y -= scale.y/2.0;
+               }
+               else
+               {
+                  tie.x = utmPoints[0].x + scale.x/2.0;
+                  tie.y = utmPoints[0].y - scale.y/2.0;
+               }
+               
+               if (traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "ossimNitfProjectionFactory::makeUtm DEBUG:"
+                     << "\nTie point: " << tie
+                     << "\nScale:     " << scale
+                     << endl;
+               }
+               
+               // Set the tie and scale.
+               ossimMapProjection* mproj = dynamic_cast<ossimMapProjection*>(proj);
+               if ( mproj )
+               {
+                  mproj->setUlEastingNorthing(tie);
+                  mproj->setMetersPerPixel(scale);
+               }
+               else // cannot cast
+               {
+                  if ( proj )
+                  {
+                     delete proj;
+                     proj = 0;
+                  }
+               }
+            }
+            else if(isBilinear)
+            {
+               // blank
+            }
+            else // Scale has nans
+            {
+               if ( proj )
+               {
+                  delete proj;
+                  proj = 0;
+               }
+            }
+            
+         } // matches: if (status)
+
+      } // matches:  if ( geographicLocation.size() )
+         
+   } // matches: if (hdr)
+   
+   return proj;
+}
+
+bool ossimNitfProjectionFactory::parseMgrsString(const ossimString& mgrsLocationString,
+                                                 ossim_uint32& zone,
+                                                 char& hemisphere,
+                                                 std::vector<ossimDpt>& utmPoints)const
+{
+   bool result = false; // Start false.
+   
+   //---
+   // From spec:
+   // UTM expressed in MGRS use the format zzBJKeeeeennnnn (15 characters).
+   // Assumption Zone and hemisphere same for all corners.
+   //---
+   if ( mgrsLocationString.size() >= 60 )
+   {
+      // Split the location string into four separate ones.
+      std::vector<std::string> mgrsStr(4); // Corner strings.
+      mgrsStr[0] = mgrsLocationString.substr(0, 15);
+      mgrsStr[1] = mgrsLocationString.substr(15, 15);
+      mgrsStr[2] = mgrsLocationString.substr(30, 15);
+      mgrsStr[3] = mgrsLocationString.substr(45, 15);
+      
+      utmPoints.resize(4);
+      long z = 0;
+      ossim_float64 e=0.0;
+      ossim_float64 n=0.0;
+      
+      result = true; // Set to true.
+
+
+      //---
+      // Convert each string to Easting Northing.  This also sets zone hemisphere.
+      // Method takes long for zone.
+      //---
+      for (ossim_uint32 i = 0; i < 4; ++i)
+      {
+         if ( Convert_OSSIM_MGRS_To_UTM(mgrsStr[i].c_str(), &z, &hemisphere, &e, &n) == 0 )
+         {
+            utmPoints[i].x = e;
+            utmPoints[i].y = n;
+         }
+         else
+         {
+            result = false; // Geotrans code errored on string.
+            break;
+         }
+      }
+      if (result) zone = static_cast<ossim_uint32>(z); // Set the zone.
+   }
+
+   return result;
+}
+
+ossimProjection* ossimNitfProjectionFactory::makeEuiDistant(
+   const ossimNitfImageHeader* hdr,
+   const std::vector<ossimGpt>& gpts) const
+{
+   ossimEquDistCylProjection* proj = 0;
+
+   // Get the scale.
+   ossimDpt scale;
+   computeScaleInDecimalDegrees(hdr, gpts, scale);
+
+   if (scale.hasNans())
+   {
+      return proj;
+   }
+   // Make the projection.
+   proj = new ossimEquDistCylProjection();
+
+   if ( scale.x )
+   {
+      ossimGpt origin = proj->getOrigin();
+
+      //---
+      // ossimEquDistCylProjection uses the origin_latitude for meters per pixel (gsd)
+      // computation.  So is not set in tiff tags, compute to achieve the proper
+      // horizontal scaling.
+      //---
+      origin.lat = ossim::acosd(scale.y/scale.x);
+
+      proj->setOrigin(origin);
+   }
+
+   // Shift the tie to the center of the pixel.
+   ossimGpt tiePoint;
+   tiePoint.latd(gpts[0].latd() - (scale.y/2.0));
+   tiePoint.lond(gpts[0].lond() + (scale.x/2.0));
+
+   // Set the tie points.
+   proj->setUlTiePoints(tiePoint);
+
+   // Set the scale.
+   proj->setDecimalDegreesPerPixel(scale);
+
+   return proj;
+}
+
+ossimProjection* ossimNitfProjectionFactory::makeBilinear(
+   const ossimNitfImageHeader* hdr,
+   const std::vector<ossimGpt>& gpts) const
+{
+   double rows = hdr->getNumberOfRows();
+   double cols = hdr->getNumberOfCols();
+   
+   ossimDpt ul(0.0, 0.0);
+   ossimDpt ur(cols-1.0, 0.0);   
+   ossimDpt lr(cols-1.0, rows-1.0);
+   ossimDpt ll(0.0, rows-1.0);
+
+   ossimRefPtr<ossimBilinearProjection> proj;
+   try
+   {
+     proj = new ossimBilinearProjection(ul,
+                                      ur,
+                                      lr,
+                                      ll,
+                                      gpts[0],
+                                      gpts[1],
+                                      gpts[2],
+                                      gpts[3]);
+   }
+   catch(...)
+   {
+      proj = 0;
+   }
+   
+   return proj.release();
+}
+
+bool ossimNitfProjectionFactory::isSkewed(
+   const std::vector<ossimGpt>& gpts) const
+{
+
+   return !( (gpts[0].latd() == gpts[1].latd()) &&
+             (gpts[2].latd() == gpts[3].latd()) &&
+             (gpts[0].lond() == gpts[3].lond()) &&
+             (gpts[1].lond() == gpts[2].lond()) );
+   
+}
+
+bool ossimNitfProjectionFactory::isSkewed(
+   const std::vector<ossimDpt>& dpts) const
+{
+   return !( (dpts[0].y == dpts[1].y) &&
+             (dpts[2].y == dpts[3].y) &&
+             (dpts[0].x == dpts[3].x) &&
+             (dpts[1].x == dpts[2].x) );
+   
+}
+
+bool ossimNitfProjectionFactory::getBlockaPoints(
+   const ossimNitfImageHeader* hdr,
+   std::vector<ossimGpt>& gpts) const
+{
+   if (!hdr)
+   {
+      return false;
+   }
+
+   ossimRefPtr<ossimNitfRegisteredTag> tag =
+      hdr->getTagData(ossimString("BLOCKA"));
+
+   if (!tag)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfProjectionFactory::getBlockaPoints DEBUG:"
+            << "\nBLOCKA tag not found."
+            << std::endl;
+      }
+      return false;
+   }
+
+   if (gpts.size())
+   {
+      gpts.clear();
+   }
+
+   ossimNitfBlockaTag* blockaTag = PTR_CAST(ossimNitfBlockaTag, tag.get());
+   if (!blockaTag)
+   {
+      return false;
+   }
+
+   ossimDpt dpt;
+   ossimGpt gpt;
+
+   // Get the upper left or first row first column.
+   blockaTag->getFrfcLoc(dpt);
+   gpt.latd(dpt.y);
+   gpt.lond(dpt.x);
+   gpts.push_back(gpt);
+
+   // Get the upper right or first row last column.
+   blockaTag->getFrlcLoc(dpt);
+   gpt.latd(dpt.y);
+   gpt.lond(dpt.x);
+   gpts.push_back(gpt);
+
+   // Get the lower right or last row last column.
+   blockaTag->getLrlcLoc(dpt);
+   gpt.latd(dpt.y);
+   gpt.lond(dpt.x);
+   gpts.push_back(gpt);
+
+   // Get the lower left or last row first column.
+   blockaTag->getLrfcLoc(dpt);
+   gpt.latd(dpt.y);
+   gpt.lond(dpt.x);
+   gpts.push_back(gpt);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfProjectionFactory::getBlockaPoints DEBUG:"
+         << std::endl;
+      for (int i=0; i<4; ++i)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "gpt[" << i << "] " << gpts[i] << std::endl;
+      }
+   }
+   
+   return true;
+}
+
+void ossimNitfProjectionFactory::computeScaleInDecimalDegrees(
+   const ossimNitfImageHeader* hdr,
+   const std::vector<ossimGpt>& gpts,
+   ossimDpt& scale) const
+{
+   if ( !hdr || isSkewed(gpts))
+   {
+      scale.makeNan();
+      return;
+   }
+   ossimIrect imageRect = hdr->getImageRect();
+
+   //---
+   // Calculate the scale.  This assumes that the corner points are for the
+   // edge of the corner pixels, not the center of the corner pixels.
+   //---
+   double longitudeSize  = 0.0;
+   double latitudeSize = 0.0;
+   if ( (gpts[1].lond() < 0.0) && (gpts[0].lond() >= 0) )
+   {
+      //---
+      // Upper right negative(Western), upper left positive (Eastern).
+      // Crossing date line maybe???
+      //---
+      longitudeSize = (gpts[1].lond() + 360.0) - gpts[0].lond();
+   }
+   else
+   {
+      longitudeSize = gpts[1].lond() - gpts[0].lond();
+   }
+
+   latitudeSize = gpts[0].latd() - gpts[2].latd();
+
+   double rows = imageRect.height();
+   double cols = imageRect.width();
+//   double rows = hdr->getNumberOfRows();
+//   double cols = hdr->getNumberOfCols();
+       
+   if (!rows || !cols)
+   {
+      scale.makeNan();
+      return;
+   }
+   scale.y = latitudeSize  / rows;
+   scale.x = longitudeSize / cols;
+}
+
+void ossimNitfProjectionFactory::computeScaleInMeters(
+   const ossimNitfImageHeader* hdr,
+   const std::vector<ossimDpt>& dpts,
+   ossimDpt& scale) const
+{
+   if ( !hdr || isSkewed(dpts))
+   {
+      scale.makeNan();
+      return;
+   }
+   ossimIrect imageRect = hdr->getImageRect();
+
+   //---
+   // Calculate the scale.  This assumes that the corner points are for the
+   // edge of the corner pixels, not the center of the corner pixels.
+   //---
+   double eastingSize  = 0.0;
+   double northingSize = 0.0;
+   
+   eastingSize  = fabs(dpts[1].x - dpts[0].x);
+   northingSize = fabs(dpts[0].y - dpts[3].y);
+
+   double rows = imageRect.height();//hdr->getNumberOfRows();
+   double cols = imageRect.width();//hdr->getNumberOfCols();
+
+   if (!rows || !cols)
+   {
+      scale.makeNan();
+      return;
+   }
+   scale.y = northingSize / rows;
+   scale.x = eastingSize  / cols;
+}
+
+void ossimNitfProjectionFactory::parseUtmString(const ossimString& utmLocation,
+                                                ossim_uint32& zone,
+                                                std::vector<ossimDpt>& utmPoints)const
+{
+   ossim_uint32 idx = 0;
+   ossimString z;
+   ossimString east;
+   ossimString north;
+
+   
+   z    = ossimString(utmLocation.begin() + idx,
+                   utmLocation.begin() + idx + 2);
+   idx += 2;
+   east = ossimString(utmLocation.begin() + idx,
+                      utmLocation.begin() + idx + 6);
+   idx += 6;
+   north = ossimString(utmLocation.begin() + idx,
+                       utmLocation.begin() + idx + 7);
+   idx += 7;
+
+   utmPoints.push_back(ossimDpt(east.toDouble(),
+                                north.toDouble()));
+   
+   z    = ossimString(utmLocation.begin() + idx,
+                   utmLocation.begin() + idx + 2);
+   idx += 2;
+   east = ossimString(utmLocation.begin() + idx,
+                      utmLocation.begin() + idx + 6);
+   idx += 6;
+   north = ossimString(utmLocation.begin() + idx,
+                       utmLocation.begin() + idx + 7);
+   idx += 7;
+   utmPoints.push_back(ossimDpt(east.toDouble(),
+                                north.toDouble()));
+
+   z    = ossimString(utmLocation.begin() + idx,
+                   utmLocation.begin() + idx + 2);
+   idx += 2;
+   east = ossimString(utmLocation.begin() + idx,
+                      utmLocation.begin() + idx + 6);
+   idx += 6;
+   north = ossimString(utmLocation.begin() + idx,
+                       utmLocation.begin() + idx + 7);
+   idx += 7;
+   utmPoints.push_back(ossimDpt(east.toDouble(),
+                                north.toDouble()));
+
+   z    = ossimString(utmLocation.begin() + idx,
+                   utmLocation.begin() + idx + 2);
+   idx += 2;
+   east = ossimString(utmLocation.begin() + idx,
+                      utmLocation.begin() + idx + 6);
+   idx += 6;
+   north = ossimString(utmLocation.begin() + idx,
+                       utmLocation.begin() + idx + 7);
+   idx += 7;
+   utmPoints.push_back(ossimDpt(east.toDouble(),
+                                north.toDouble()));
+
+   zone = z.toUInt32();
+}
+
+
+void ossimNitfProjectionFactory::parseGeographicString(
+   const ossimString& geographicLocation, std::vector<ossimGpt>& gpts) const
+{
+   gpts.clear();
+   
+   if (geographicLocation.size() != 60)
+   {
+      return;
+   }
+
+   std::string::size_type geo_index = 0;
+   for (int i=0; i<4; ++i)
+   {
+      //---
+      // We have to split up the geographicLocation string for the dms class.
+      // 
+      // geographicLocation = ddmmssXdddmmssX (four times).
+      // "dd mm ss X" has a string length of 10
+      // "ddd mm ss X" has a string length of 11
+      //---
+      std::string::size_type lat_index = 0;
+      std::string::size_type lon_index = 0;
+      const char SPACE = ' ';
+      ossimString latString(10, SPACE);
+      ossimString lonString(11, SPACE);
+
+      // degrees latitude
+      latString[lat_index++] = geographicLocation[geo_index++];
+      latString[lat_index++] = geographicLocation[geo_index++];
+      ++lat_index;
+
+      // minutes latitude
+      latString[lat_index++] = geographicLocation[geo_index++];
+      latString[lat_index++] = geographicLocation[geo_index++];
+      ++lat_index;
+      
+      // seconds latitude
+      latString[lat_index++] = geographicLocation[geo_index++];
+      latString[lat_index++] = geographicLocation[geo_index++];
+      ++lat_index;
+
+      // hemisphere
+      latString[lat_index++] = geographicLocation[geo_index++];
+ 
+      // degrees longitude
+      lonString[lon_index++] = geographicLocation[geo_index++];
+      lonString[lon_index++] = geographicLocation[geo_index++];
+      lonString[lon_index++] = geographicLocation[geo_index++];
+      ++lon_index;
+
+      // minutes longitude
+      lonString[lon_index++] = geographicLocation[geo_index++];
+      lonString[lon_index++] = geographicLocation[geo_index++];
+      ++lon_index;
+
+      // seconds longitude
+      lonString[lon_index++] = geographicLocation[geo_index++];
+      lonString[lon_index++] = geographicLocation[geo_index++];
+      ++lon_index;
+
+      // hemisphere
+      lonString[lon_index++] = geographicLocation[geo_index++];
+
+      // Convert to decimal degrees using the dms class.
+      ossimGpt gpt;
+      ossimDms dms(0.0);
+      dms.setLatFlag(true);
+      if ( ! dms.setDegrees(latString.c_str()) )
+      {
+         gpts.clear();
+         return;
+      }
+      gpt.latd(dms.getDegrees());
+
+      dms.setLatFlag(false);
+      if ( ! dms.setDegrees(lonString.c_str()) )
+      {
+         gpts.clear();
+         return;
+      }
+      gpt.lond(dms.getDegrees());
+
+      gpts.push_back(gpt);
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfProjectionFactory::parseGeographicString DEBUG:"
+            << "\nground point[" << i << "]:  " << gpt
+            << std::endl;
+      }
+   }
+}
+
+void ossimNitfProjectionFactory::parseDecimalDegreesString(const ossimString& geographicLocation,
+                                                           std::vector<ossimGpt>& gpts) const
+{
+   const char* bufPtr = geographicLocation.c_str();
+
+   
+   ossimString ulLat(bufPtr,
+                     bufPtr + 7);
+   bufPtr+=7;
+   ossimString ulLon(bufPtr,
+                     bufPtr+8);
+   bufPtr+=8;
+   ossimString urLat(bufPtr,
+                     bufPtr + 7);
+   bufPtr+=7;
+   ossimString urLon(bufPtr,
+                     bufPtr+8);
+   bufPtr+=8;
+   ossimString lrLat(bufPtr,
+                     bufPtr + 7);
+   bufPtr+=7;
+   ossimString lrLon(bufPtr,
+                     bufPtr+8);
+   bufPtr+=8;
+   ossimString llLat(bufPtr,
+                     bufPtr + 7);
+   bufPtr+=7;
+   ossimString llLon(bufPtr,
+                     bufPtr+8);
+
+   gpts.push_back(ossimGpt(ulLat.toDouble(), ulLon.toDouble()));
+   gpts.push_back(ossimGpt(urLat.toDouble(), urLon.toDouble()));
+   gpts.push_back(ossimGpt(lrLat.toDouble(), lrLon.toDouble()));
+   gpts.push_back(ossimGpt(llLat.toDouble(), llLon.toDouble()));
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfProjectionFactory::parseDecimalDegreesString DEBUG:"
+         << "\nground point[" << 0 << "]:  " << gpts[0]
+         << "\nground point[" << 1 << "]:  " << gpts[1]
+         << "\nground point[" << 2 << "]:  " << gpts[2]
+         << "\nground point[" << 3 << "]:  " << gpts[3]
+         << std::endl;
+   }
+}
+
+ossimNitfProjectionFactory::ossimNitfProjectionFactory(const ossimNitfProjectionFactory&)
+{
+}
+
+ossimNitfProjectionFactory& ossimNitfProjectionFactory::operator=(const ossimNitfProjectionFactory&)
+{
+   return *this;
+}
diff --git a/src/projection/ossimNitfRpcModel.cpp b/src/projection/ossimNitfRpcModel.cpp
new file mode 100644
index 0000000..55dedd4
--- /dev/null
+++ b/src/projection/ossimNitfRpcModel.cpp
@@ -0,0 +1,488 @@
+//*****************************************************************************
+// FILE: ossimNitfRpcModel.cc
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class ossimNitfRpcModel. This 
+//    derived class implements the capability of reading Nitf RPC support
+//    data.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimNitfRpcModel.cpp 16643 2010-02-22 21:32:43Z dburken $
+
+#include <ossim/projection/ossimNitfRpcModel.h>
+
+RTTI_DEF1(ossimNitfRpcModel, "ossimNitfRpcModel", ossimRpcModel);
+
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <ossim/support_data/ossimNitfUse00aTag.h>
+#include <ossim/support_data/ossimNitfPiaimcTag.h>
+#include <ossim/support_data/ossimNitfStdidcTag.h>
+#include <ossim/support_data/ossimNitfRpcBase.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimNitfRpcModel:exec");
+static ossimTrace traceDebug ("ossimNitfRpcModel:debug");
+
+static const char* RPC00A_TAG = "RPC00A";
+static const char* RPC00B_TAG = "RPC00B";
+static const char* PIAIMC_TAG = "PIAIMC";
+static const char* STDIDC_TAG = "STDIDC";
+static const char* USE00A_TAG = "USE00A";
+
+ossimNitfRpcModel::ossimNitfRpcModel()
+   :
+   ossimRpcModel(),
+   theDecimation(1.0)
+{
+}
+
+ossimNitfRpcModel::ossimNitfRpcModel(const ossimNitfRpcModel& rhs)
+  :
+   ossimRpcModel(rhs),
+   theDecimation(1.0)
+{
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimNitfRpcModel
+//  
+//  Constructs given filename for NITF file
+//  
+//*****************************************************************************
+ossimNitfRpcModel::ossimNitfRpcModel(const ossimFilename& nitfFile)
+   :
+   ossimRpcModel(),
+   theDecimation(1.0)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): entering..."
+         << std::endl;
+   }
+   if(!parseFile(nitfFile))
+   {
+      if (traceExec())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): Unable to parse file " << nitfFile
+            << std::endl;
+      }
+      ++theErrorStatus;
+   }
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimNitfRpcModel::ossimNitfRpcModel(nitfFile): returning..."
+         << std::endl;
+   }
+}
+
+ossimObject* ossimNitfRpcModel::dup() const
+{
+   return new ossimNitfRpcModel(*this);
+}
+
+bool ossimNitfRpcModel::parseFile(const ossimFilename& nitfFile,
+                                  ossim_uint32 entryIndex)
+{
+   ossimRefPtr<ossimNitfFile> file = new ossimNitfFile;
+
+   if(!file->parseFile(nitfFile))
+   {
+      setErrorStatus();
+      return false;
+   }
+   
+   ossimRefPtr<ossimNitfImageHeader> ih = file->getNewImageHeader(entryIndex);
+   if(!ih)
+   {
+      setErrorStatus();
+      return false;
+   }
+
+   return parseImageHeader(ih.get());
+   
+}
+
+bool ossimNitfRpcModel::parseImageHeader(const ossimNitfImageHeader* ih)
+{
+   // Do this first so we don't waste time if not rpc image.
+   if (getRpcData(ih) == false)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfRpcModel::parseFile DEBUG:"
+         << "\nError parsing rpc tags.  Aborting with error."
+         << std::endl;
+      }
+      setErrorStatus();
+      return false;
+   }
+   
+   
+   //---
+   // Get the decimation if any from the header "IMAG" field.
+   // 
+   // Look for string like:
+   // "/2" = 1/2
+   // "/4  = 1/4
+   // ...
+   // "/16 = 1/16
+   // If it is full resolution it should be "1.0"
+   //---
+   ossimString os = ih->getImageMagnification();
+   if ( os.contains("/") )
+   {
+      os = os.after("/");
+      ossim_float64 d = os.toFloat64();
+      if (d)
+      {
+         theDecimation = 1.0 / d;
+      }
+   }
+   
+   //***
+   // Fetch Image ID:
+   //***
+   theImageID = ih->getImageId();
+   
+   ossimIrect imageRect = ih->getImageRect();
+   
+   //---
+   // Fetch Image Size:
+   //---
+   theImageSize.line =
+   static_cast<ossim_int32>(imageRect.height() / theDecimation);
+   theImageSize.samp =
+   static_cast<ossim_int32>(imageRect.width() / theDecimation);
+   
+   // Search for the STDID Tag to fetch mission (satellite) name:
+   getSensorID(ih);
+   
+   //***
+   // Assign other data members:
+   //***
+   theRefImgPt.line = theImageSize.line/2.0;
+   theRefImgPt.samp = theImageSize.samp/2.0;
+   theRefGndPt.lat  = theLatOffset;
+   theRefGndPt.lon  = theLonOffset;
+   theRefGndPt.hgt  = theHgtOffset;
+   
+   //***
+   // Assign the bounding image space rectangle:
+   //***
+   theImageClipRect = ossimDrect(0.0, 0.0,
+                                 theImageSize.samp-1, theImageSize.line-1);
+   
+   //---
+   // Assign the bounding ground polygon:
+   //
+   // NOTE:  We will use the base ossimRpcModel for transformation since all
+   // of our calls are in full image space (not decimated).
+   //---
+   ossimGpt v0, v1, v2, v3;
+   ossimDpt ip0 (0.0, 0.0);
+   ossimRpcModel::lineSampleHeightToWorld(ip0, theHgtOffset, v0);
+   ossimDpt ip1 (theImageSize.samp-1.0, 0.0);
+   ossimRpcModel::lineSampleHeightToWorld(ip1, theHgtOffset, v1);
+   ossimDpt ip2 (theImageSize.samp-1.0, theImageSize.line-1.0);
+   ossimRpcModel::lineSampleHeightToWorld(ip2, theHgtOffset, v2);
+   ossimDpt ip3 (0.0, theImageSize.line-1.0);
+   ossimRpcModel::lineSampleHeightToWorld(ip3, theHgtOffset, v3);
+   
+   theBoundGndPolygon
+   = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
+   
+   updateModel();
+   
+   // Set the ground reference point.
+   ossimRpcModel::lineSampleHeightToWorld(theRefImgPt,
+                                          theHgtOffset,
+                                          theRefGndPt);
+   if ( theRefGndPt.isLatNan() || theRefGndPt.isLonNan() )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:"
+         << "\nGround Reference Point not valid." 
+         << " Aborting with error..."
+         << std::endl;
+      }
+      setErrorStatus();
+      return false;
+   }
+   
+   //---
+   // This will set theGSD and theMeanGSD.  This model doesn't need these but
+   // others do.
+   //---
+   try
+   {
+      computeGsd();
+   }
+   catch (const ossimException& e)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:\n"
+         << e.what() << std::endl;
+      }
+   }
+   
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG ossimNitfRpcModel::parseFile: returning..."
+      << std::endl;
+   }
+   
+   return true;
+}
+
+void ossimNitfRpcModel::worldToLineSample(const ossimGpt& world_point,
+                                          ossimDpt&       image_point) const
+{
+   // Get the full res (not decimated) point.
+   ossimRpcModel::worldToLineSample(world_point, image_point);
+
+   // Apply decimation.
+   image_point.x = image_point.x * theDecimation;
+   image_point.y = image_point.y * theDecimation;
+}
+
+void ossimNitfRpcModel::lineSampleHeightToWorld(
+   const ossimDpt& image_point,
+   const double&   heightEllipsoid,
+   ossimGpt&       worldPoint) const
+{
+   // Convert image point to full res (not decimated) point.
+   ossimDpt pt;
+   pt.x = image_point.x / theDecimation;
+   pt.y = image_point.y / theDecimation;
+
+   // Call base...
+   ossimRpcModel::lineSampleHeightToWorld(pt, heightEllipsoid, worldPoint);
+}
+
+bool ossimNitfRpcModel::saveState(ossimKeywordlist& kwl,
+                                  const char* prefix) const
+{
+   // Save the decimation.
+   kwl.add(prefix, "decimation", theDecimation);
+
+   // Call base.
+   return ossimRpcModel::saveState(kwl, prefix);
+}
+
+bool ossimNitfRpcModel::loadState(const ossimKeywordlist& kwl,
+                                  const char* prefix)
+{
+   // Lookup decimation.
+   const char* value = kwl.find(prefix, "decimation");
+   if (value)
+   {
+      theDecimation = ossimString(value).toFloat64();
+      if (theDecimation <= 0.0)
+      {
+         // Do not allow negative or "0.0"(divide by zero).
+         theDecimation = 1.0;
+      }
+   }
+
+   // Call base.
+   return ossimRpcModel::loadState(kwl, prefix);
+}
+
+void ossimNitfRpcModel::getGsd(const ossimNitfImageHeader* ih)
+{
+   theGSD.line = ossim::nan();
+   theGSD.samp = ossim::nan();
+
+   if (!ih)
+   {
+      return;
+   }
+   
+   ossimRefPtr<ossimNitfRegisteredTag> tag;
+   tag = ih->getTagData(PIAIMC_TAG);
+   if (tag.valid())
+   {
+      ossimNitfPiaimcTag* p = PTR_CAST(ossimNitfPiaimcTag, tag.get());
+      if (p)
+      {
+         theGSD.line = p->getMeanGsdInMeters();
+         theGSD.samp = theGSD.line;
+         return;
+      }
+   }
+
+   tag = ih->getTagData(USE00A_TAG);
+   if (tag.valid())
+   {
+      ossimNitfUse00aTag* p = PTR_CAST(ossimNitfUse00aTag, tag.get());
+      if (p)
+      {
+         theGSD.line = p->getMeanGsdInMeters();
+         theGSD.samp = theGSD.line;
+      }
+   }
+}
+
+void ossimNitfRpcModel::getSensorID(const ossimNitfImageHeader* ih)
+{
+   theSensorID = "UNKNOWN";
+
+   if (!ih)
+   {
+      return;
+   }
+   
+   ossimRefPtr<ossimNitfRegisteredTag> tag;
+   tag = ih->getTagData(STDIDC_TAG);
+   if (tag.valid())
+   {
+      ossimNitfStdidcTag* p = PTR_CAST(ossimNitfStdidcTag, tag.get());
+      if (p)
+      {
+         theSensorID = p->getMission();
+         return;
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcModel::getSensorID DEBUG:"
+            << "\ntheSensorID set to: " << theSensorID << endl;
+   }
+}
+
+bool ossimNitfRpcModel::getRpcData(const ossimNitfImageHeader* ih)
+{
+   if (!ih)
+   {
+      return false;
+   }
+
+   // Get the the RPC tag:
+   ossimNitfRpcBase* rpcTag = 0;
+
+   // Look for the RPC00B tag first.
+   ossimRefPtr<ossimNitfRegisteredTag> tag = ih->getTagData(RPC00B_TAG);
+   if (tag.valid())
+   {
+      rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
+   }
+
+   if (!rpcTag)
+   {
+      // Look for RPC00A tag.
+      tag = ih->getTagData(RPC00A_TAG);
+      if (tag.valid())
+      {
+         rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
+      }
+   }
+
+   if (!rpcTag)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcModel::getRpcData DEBUG:"
+            << "\nCould not find neither RPC tags <" << RPC00A_TAG
+            << "> nor <" << RPC00B_TAG
+            << "\nAborting with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   if ( rpcTag->getSuccess() == false )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcModel::getRpcData DEBUG:"
+            << "\nSuccess flag set to false."
+            << "\nAborting with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Set the polynomial type.
+   if (rpcTag->getRegisterTagName() == "RPC00B")
+   {
+      thePolyType = B;
+   }
+   else
+   {
+      thePolyType = A;
+   }
+   
+   // Now parse the tag block for pertinent data:
+   theBiasError  = rpcTag->getErrorBias().toFloat64();
+   theRandError  = rpcTag->getErrorRand().toFloat64();
+   theLineOffset = rpcTag->getLineOffset().toFloat64();
+   theSampOffset = rpcTag->getSampleOffset().toFloat64();
+   theLatOffset  = rpcTag->getGeodeticLatOffset().toFloat64();
+   theLonOffset  = rpcTag->getGeodeticLonOffset().toFloat64();
+   theHgtOffset  = rpcTag->getGeodeticHeightOffset().toFloat64();
+   theLineScale  = rpcTag->getLineScale().toFloat64();
+   theSampScale  = rpcTag->getSampleScale().toFloat64();
+   theLatScale   = rpcTag->getGeodeticLatScale().toFloat64();
+   theLonScale   = rpcTag->getGeodeticLonScale().toFloat64();
+   theHgtScale   = rpcTag->getGeodeticHeightScale().toFloat64();
+
+   // OBC has some data with negative height offsets that blows up the ray intersection with elevation model.  The bilinear model seems more accurate than trying to work around this.
+   if (ih->getImageSource().trim() == "OBC" && theHgtOffset < 0)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcModel::getRpcData DEBUG:"
+            << "\nHeight Offset will force invalid ellipsoid intersection."
+            << "\nAborting with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Parse coefficients:
+   ossim_uint32 i;
+   
+   for (i=0; i<20; ++i)
+   {
+      theLineNumCoef[i] = rpcTag->getLineNumeratorCoeff(i).toFloat64();
+      theLineDenCoef[i] = rpcTag->getLineDenominatorCoeff(i).toFloat64();
+      theSampNumCoef[i] = rpcTag->getSampleNumeratorCoeff(i).toFloat64();
+      theSampDenCoef[i] = rpcTag->getSampleDenominatorCoeff(i).toFloat64();
+   }
+   
+   // Assign other data members to default values:
+   theNominalPosError = sqrt(theBiasError*theBiasError +
+                             theRandError*theRandError); // meters
+
+   return true;
+}
diff --git a/src/projection/ossimNitfRsmModel.cpp b/src/projection/ossimNitfRsmModel.cpp
new file mode 100644
index 0000000..d735e6e
--- /dev/null
+++ b/src/projection/ossimNitfRsmModel.cpp
@@ -0,0 +1,391 @@
+//---
+// File: ossimNitfRsmModel.cpp
+//
+//  RP 
+//  LIMITATIONS - This is supporting only the RSM features that have been
+//  observed in current data samples and does not attempt to support the entire
+//  RSM specification.
+//  Examples of currently unsupported items include ->
+//  1.  multiple RSMPC tags for different polynomials for separate image sections 
+//  2.  Error Covariance (this may gain priority as we have access to RSMECA data)
+//  3.  Illumination model
+//  4.  Rectangular coodinate system conversion (RSDIDA GRNDD = "R")
+//---
+
+#include <ossim/projection/ossimNitfRsmModel.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/support_data/ossimNitfRsmecaTag.h>
+#include <ossim/support_data/ossimNitfRsmidaTag.h>
+#include <ossim/support_data/ossimNitfRsmpcaTag.h>
+#include <ossim/support_data/ossimNitfRsmpiaTag.h>
+
+
+RTTI_DEF1(ossimNitfRsmModel, "ossimNitfRsmModel", ossimRsmModel);
+
+//---
+// Define Trace flags for use within this file:
+//---
+
+static ossimTrace traceExec  ("ossimNitfRsmModel:exec");
+static ossimTrace traceDebug ("ossimNitfRsmModel:debug");
+
+
+
+ossimNitfRsmModel::ossimNitfRsmModel()
+   :  ossimRsmModel()
+{
+}
+
+ossimNitfRsmModel::ossimNitfRsmModel( const ossimNitfRsmModel& obj )
+   : ossimRsmModel(obj)
+{
+}
+
+const ossimNitfRsmModel& ossimNitfRsmModel::operator=( const ossimNitfRsmModel& rhs )
+{
+   if (this != &rhs)
+   {
+      ossimRsmModel::operator=(rhs);
+   }
+   return *this;
+}
+
+ossimNitfRsmModel::~ossimNitfRsmModel()
+{
+}
+
+bool ossimNitfRsmModel::parseFile( const ossimFilename& nitfFile,
+                                   ossim_uint32 entryIndex )
+{
+   bool status = false;
+
+   if ( nitfFile.exists() )
+   {
+      ossimRefPtr<ossimNitfFile> file = new ossimNitfFile;   
+      if( file->parseFile(nitfFile) )
+      {
+         ossimRefPtr<ossimNitfImageHeader> ih = file->getNewImageHeader(entryIndex);
+         if ( ih.valid() )
+         {
+            status = parseImageHeader( ih.get() );
+         }
+      }
+   }
+
+   if( !status )
+   {
+      setErrorStatus();
+   }
+   
+   return status;
+}
+
+bool ossimNitfRsmModel::parseImageHeader(const ossimNitfImageHeader* ih)
+{
+   static const char MODULE[] = "ossimNitfRsmModel::getRsmData";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering..." << std::endl;
+   }
+
+   bool status = false;
+
+   if ( getRsmData(ih) )
+   {
+      
+      theImageID = m_pca[0].m_iid; // tmp drb...
+      theImageID = theImageID.trim();
+      
+      ossimIrect imageRect = ih->getImageRect();
+      
+      // Fetch Image Size:
+      theImageSize.line = static_cast<ossim_int32>(imageRect.height());
+      theImageSize.samp = static_cast<ossim_int32>(imageRect.width());
+      
+      // Assign other data members:
+      theRefImgPt.line = theImageSize.line/2.0;
+      theRefImgPt.samp = theImageSize.samp/2.0;
+      
+      // Assign the bounding image space rectangle:
+      theImageClipRect = ossimDrect(0.0, 0.0, theImageSize.samp-1, theImageSize.line-1);
+      
+      ossimGpt v0, v1, v2, v3;
+      ossimDpt ip0 (0.0, 0.0);
+      lineSampleHeightToWorld(ip0, m_pca[0].m_znrmo, v0);
+      ossimDpt ip1 (theImageSize.samp-1.0, 0.0);
+      lineSampleHeightToWorld(ip1, m_pca[0].m_znrmo, v1);
+      ossimDpt ip2 (theImageSize.samp-1.0, theImageSize.line-1.0);
+      lineSampleHeightToWorld(ip2, m_pca[0].m_znrmo, v2);
+      ossimDpt ip3 (0.0, theImageSize.line-1.0);
+      lineSampleHeightToWorld(ip3, m_pca[0].m_znrmo, v3);
+      
+      theBoundGndPolygon = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
+      
+      updateModel();
+      
+      // Set the ground reference point.
+      lineSampleHeightToWorld(theRefImgPt, m_pca[0].m_znrmo, theRefGndPt);
+
+      // Height could have nan if elevation is not set so check lat, lon individually.
+      if ( ( theRefGndPt.isLatNan() == false ) && ( theRefGndPt.isLonNan() == false ) )
+      {
+         //---
+         // This will set theGSD and theMeanGSD.  This model doesn't need these but
+         // others do.
+         //---
+         try
+         {
+            computeGsd();
+
+            // Set return status.
+            status = true;
+         }
+         catch (const ossimException& e)
+         {
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:\n"
+                  << e.what() << std::endl;
+            }
+            setErrorStatus();
+         }
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimNitfRpcModel::ossimNitfRpcModel DEBUG:"
+               << "\nGround Reference Point not valid(has nans)."
+               << " Aborting with error..."
+               << std::endl;
+         }
+         setErrorStatus();
+      }
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcModel::parseFile DEBUG:"
+            << "\nError parsing rsm tags.  Aborting with error."
+            << std::endl;
+      }
+      setErrorStatus();
+   }
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit status: " << ( status ? "true" : "false" ) << "\n";
+   }
+
+   return status;
+   
+} // End: ossimNitfRsmModel::parseImageHeader(const ossimNitfImageHeader* ih)
+
+bool ossimNitfRsmModel::getRsmData(const ossimNitfImageHeader* ih)
+{
+   static const char MODULE[] = "ossimNitfRsmModel::getRsmData";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entering..." << std::endl;
+   }
+   
+   bool status = false;
+   
+   if ( ih )
+   {
+      ossimRefPtr<ossimNitfRegisteredTag> tag = 0;
+
+      // RSMECA:
+      const ossimString RSMECA_TAG = "RSMECA";
+      tag = ih->getTagData(RSMECA_TAG);
+      if (tag.valid())
+      {
+         ossimRefPtr<ossimNitfRsmecaTag> rsmecaTag =
+            dynamic_cast<ossimNitfRsmecaTag*>(tag.get());
+         if ( rsmecaTag.valid() )
+         {
+            if ( initializeModel( rsmecaTag.get() ) )
+            {
+               // RSMIDA:
+               ossimString RSMIDA_TAG = "RSMIDA";
+               tag = ih->getTagData(RSMIDA_TAG);
+               if (tag.valid())
+               {
+                  ossimRefPtr<ossimNitfRsmidaTag> rsmidaTag =
+                     dynamic_cast<ossimNitfRsmidaTag*>( tag.get() );
+                  if ( rsmidaTag.valid() )
+                  {
+                     if ( m_ida.initialize( rsmidaTag.get() ) )
+                     {
+                        // RSMPIA:
+                        const ossimString RSMPIA_TAG = "RSMPIA";
+                        tag = ih->getTagData(RSMPIA_TAG);
+                        if (tag.valid())
+                        {
+                           ossimRefPtr<ossimNitfRsmpiaTag> rsmpiaTag =
+                              dynamic_cast<ossimNitfRsmpiaTag*>( tag.get() );
+                           if ( rsmpiaTag.valid() )
+                           {
+                              if ( m_pia.initialize( rsmpiaTag.get() ) )
+                              {
+                                 //---
+                                 // RSMPCA:
+                                 // Multiple tags if image is sectioned.
+                                 //---
+                                 const ossimString RSMPCA_TAG = "RSMPCA";
+                                 std::vector< const ossimNitfRegisteredTag* > tags;
+                                 ih->getTagData( RSMPCA_TAG, tags );
+
+                                 if ( tags.size() == m_pia.m_tnis )
+                                 {
+                                    for ( ossim_uint32 tagIndex = 0;
+                                          tagIndex < m_pia.m_tnis;
+                                          ++tagIndex )
+                                    {
+                                       const ossimNitfRsmpcaTag* rsmpcaTag =
+                                          dynamic_cast<const ossimNitfRsmpcaTag*>( tags[tagIndex] );
+                                       if ( rsmpcaTag )
+                                       {
+                                          ossimRsmpca pca;
+                                          if ( pca.initialize( rsmpcaTag ) )
+                                          {
+                                             m_pca.push_back( pca );
+                                          }
+                                          else if (traceDebug())
+                                          {
+                                             ossimNotify(ossimNotifyLevel_WARN)
+                                                << "WARNING! RSMPCA[" << tagIndex << "] intitialization failed!"
+                                                << std::endl;
+                                          }
+                                       }
+                                    }
+
+                                    // Call base ossimRsmModel::validate() for sanity check:
+                                    status = validate();
+                                 }
+                                 
+                              } // Matches: if ( m_pia.initialize( rsmpiaTag ) )
+                           }
+                        }
+                        else if (traceDebug())
+                        {
+                           ossimNotify(ossimNotifyLevel_WARN)
+                              << "\nCould not find RSM tag: " << RSMPIA_TAG
+                              << "\nAborting with error..."
+                              << std::endl;
+                        }
+                     }
+                  }
+               }
+               else if (traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << "\nCould not find RSM tag: " << RSMIDA_TAG
+                     << "\nAborting with error..." << std::endl;
+               }
+            }
+         }
+      }
+      else if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimNitfRsmModel::getRsmData WARNING!"
+            << "\nCould not find RSM tag: " << RSMECA_TAG
+            << "\nAborting with error..." << std::endl;
+      }
+   }
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit status: " << ( status ? "true" : "false" ) << "\n";
+   }
+
+   return status;
+   
+} // End: ossimNitfRsmModel::getRsmData(const ossimNitfImageHeader* ih)
+
+
+bool ossimNitfRsmModel::initializeModel( const ossimNitfRsmecaTag* rsmecaTag )
+{
+   bool status = false;
+
+   if ( rsmecaTag )
+   {
+      // TODO:
+      status = true;
+   }
+
+   return status;
+   
+} // End: ossimNitfRsmModel::initializeModel( rsmecaTag )
+
+ossimObject* ossimNitfRsmModel::dup() const
+{
+   return new ossimNitfRsmModel(*this);
+}
+
+bool ossimNitfRsmModel::saveState(ossimKeywordlist& kwl,
+                                  const char* prefix) const
+{
+   
+   static const char MODULE[] = "ossimNitfRsmModel::saveState";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   //---
+   // Hand off to base class for common stuff:
+   //
+   // Note: Class type "ossimKeywordNames::TYPE_KW" is saved in
+   // ossimOject::saveState.
+   //---
+   bool status = ossimRsmModel::saveState(kwl, prefix);
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return status;
+}
+
+bool ossimNitfRsmModel::loadState( const ossimKeywordlist& kwl,
+                                   const char* prefix ) 
+{
+   static const char MODULE[] = "ossimNitfRsmModel::loadState";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   bool status = false;
+
+   // Check for type match before preceeding:
+   std::string myPrefix = ( prefix ? prefix : "" );
+   std::string type = kwl.findKey( myPrefix, std::string(ossimKeywordNames::TYPE_KW) );
+
+   if ( type == "ossimNitfRsmModel" )
+   {
+      // Pass on to the base-class for parsing first:
+      status = ossimRsmModel::loadState(kwl, prefix);
+   }
+   
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit status = " << (status?"true":"false") << "\n";
+   }
+   
+   return status;
+}
diff --git a/src/projection/ossimObliqueMercatorProjection.cpp b/src/projection/ossimObliqueMercatorProjection.cpp
new file mode 100644
index 0000000..908e817
--- /dev/null
+++ b/src/projection/ossimObliqueMercatorProjection.cpp
@@ -0,0 +1,725 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimObliqueMercatorProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+#include <ossim/projection/ossimObliqueMercatorProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+#define OMERC_NO_ERROR                0x0000
+#define OMERC_LAT_ERROR               0x0001
+#define OMERC_LON_ERROR               0x0002
+#define OMERC_ORIGIN_LAT_ERROR        0x0004
+#define OMERC_LAT1_ERROR              0x0008
+#define OMERC_LAT2_ERROR              0x0010
+#define OMERC_LON1_ERROR              0x0020
+#define OMERC_LON2_ERROR              0x0040
+#define OMERC_LAT1_LAT2_ERROR         0x0080
+#define OMERC_DIFF_HEMISPHERE_ERROR   0x0100
+#define OMERC_EASTING_ERROR           0x0200
+#define OMERC_NORTHING_ERROR          0x0400
+#define OMERC_A_ERROR                 0x0800
+#define OMERC_INV_F_ERROR             0x1000
+#define OMERC_SCALE_FACTOR_ERROR      0x2000
+#define OMERC_LON_WARNING             0x4000
+
+RTTI_DEF1(ossimObliqueMercatorProjection, "ossimObliqueMercatorProjection", ossimMapProjection)
+
+#ifndef PI_OVER_2
+#  define PI_OVER_2  ( M_PI / 2.0)
+#endif
+#ifndef PI_OVER_4
+#  define PI_OVER_4  ( M_PI / 4.0)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI     (2.0 * M_PI)
+#endif
+#define MIN_SCALE_FACTOR  0.3
+#define MAX_SCALE_FACTOR  3.0
+   
+#define OMERC_t(lat, e_sinlat, e_over_2)  (tan(PI_OVER_4 - lat / 2.0)) /         \
+                      (pow((1 - e_sinlat) / (1 + e_sinlat), e_over_2))
+
+
+ossimObliqueMercatorProjection::ossimObliqueMercatorProjection(const ossimEllipsoid& ellipsoid,
+                                                               const ossimGpt& origin)
+   : ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+
+ossimObliqueMercatorProjection::ossimObliqueMercatorProjection(const ossimEllipsoid& ellipsoid,
+                                                               const ossimGpt& origin,
+                                                               const ossimGpt& point1,
+                                                               const ossimGpt& point2,
+                                                               double falseEasting,
+                                                               double falseNorthing,
+                                                               double scaleFactor)
+   : ossimMapProjection(ellipsoid, origin)
+{
+   setParameters(point1, point2, falseEasting, falseNorthing, scaleFactor);
+}
+
+void ossimObliqueMercatorProjection::update()
+{
+   Set_Oblique_Mercator_Parameters(theEllipsoid.getA(),
+                                   theEllipsoid.getFlattening(),
+                                   theOrigin.latr(),
+                                   theCentralPoint1.latr(),
+                                   theCentralPoint1.lonr(),
+                                   theCentralPoint2.latr(),
+                                   theCentralPoint2.lonr(),
+                                   OMerc_False_Easting,
+                                   OMerc_False_Northing,
+                                   OMerc_Scale_Factor);
+
+   theFalseEastingNorthing.x = OMerc_False_Easting;
+   theFalseEastingNorthing.y = OMerc_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+void ossimObliqueMercatorProjection::setFalseEasting(double falseEasting)
+{
+   OMerc_False_Easting = falseEasting;
+   update();
+}
+
+void ossimObliqueMercatorProjection::setFalseNorthing(double falseNorthing)
+{
+   OMerc_False_Northing = falseNorthing;
+   update();  
+}
+
+void ossimObliqueMercatorProjection::setFalseEastingNorthing(double falseEasting, double falseNorthing)
+{
+   OMerc_False_Easting = falseEasting;
+   OMerc_False_Northing = falseNorthing;
+   update();  
+   
+}
+
+void ossimObliqueMercatorProjection::setCentralPoint1(const ossimGpt& point)
+{
+   theCentralPoint1 = point;
+
+   update();
+}
+
+void ossimObliqueMercatorProjection::setCentralPoint2(const ossimGpt& point)
+{
+   theCentralPoint2 = point;
+   update();
+}
+
+void ossimObliqueMercatorProjection::setScaleFactor(double scaleFactor)
+{
+   OMerc_Scale_Factor = scaleFactor;
+   update();
+}
+
+void ossimObliqueMercatorProjection::setParameters(const ossimGpt& point1,
+                                                   const ossimGpt& point2,
+                                                   double falseEasting,
+                                                   double falseNorthing,
+                                                   double scaleFactor)
+{
+   theCentralPoint1 = point1;
+   theCentralPoint2 = point2;
+   OMerc_False_Easting = falseEasting;
+   OMerc_False_Northing = falseNorthing;
+   OMerc_Scale_Factor = scaleFactor;
+
+   update();
+}
+
+void ossimObliqueMercatorProjection::setDefaults()
+{
+   // initialize the central points to be 5 degrees about the origin.
+   OMerc_Delta_Northing = 40000000.0;
+   OMerc_Delta_Easting  = 40000000.0;
+
+   theCentralPoint1.latd(theOrigin.latd() - 5.0);
+   theCentralPoint1.lond(theOrigin.lond() - 5.0);
+   theCentralPoint2.latd(theOrigin.latd() + 5.0);
+   theCentralPoint2.lond(theOrigin.lond() + 5.0);
+   
+   theCentralPoint1.clampLat(-90.0, 90.0);
+   theCentralPoint1.clampLon(-180.0, 180.0);
+   theCentralPoint2.clampLat(-90.0, 90.0);
+   theCentralPoint2.clampLon(-180.0, 180.0);
+   
+   OMerc_False_Easting  = 0.0;
+   OMerc_False_Northing = 0.0;
+
+   OMerc_Scale_Factor   = 1.0;
+}
+
+
+ossimGpt ossimObliqueMercatorProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_Oblique_Mercator_To_Geodetic(eastingNorthing.x,
+                                        eastingNorthing.y,
+                                        &lat,
+                                        &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
+}
+
+ossimDpt ossimObliqueMercatorProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Oblique_Mercator(gpt.latr(),
+                                        gpt.lonr(),
+                                        &easting,
+                                        &northing);
+   return ossimDpt(easting, northing);
+}
+
+bool ossimObliqueMercatorProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_FACTOR_KW,
+           OMerc_Scale_Factor,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CENTRAL_POINT1_LAT_KW,
+           theCentralPoint1.latd(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CENTRAL_POINT1_LON_KW,
+           theCentralPoint1.lond(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CENTRAL_POINT2_LAT_KW,
+           theCentralPoint2.latd(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CENTRAL_POINT2_LON_KW,
+           theCentralPoint2.lond(),
+           true);
+           
+   
+   return ossimMapProjection::saveState(kwl, prefix);   
+}
+
+bool ossimObliqueMercatorProjection::loadState(const ossimKeywordlist& kwl,
+                                             const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   const char* point1Lat     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT1_LAT_KW);
+   const char* point1Lon     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT1_LON_KW);
+   const char* point2Lat     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT2_LAT_KW);
+   const char* point2Lon     = kwl.find(prefix, ossimKeywordNames::CENTRAL_POINT2_LON_KW);
+   const char* scale         = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
+   
+   setDefaults();
+
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimObliqueMercatorProjection))
+   {
+      OMerc_False_Easting  = theFalseEastingNorthing.x;
+      OMerc_False_Northing = theFalseEastingNorthing.y;
+
+      if(point1Lat&&point1Lon&&point2Lat&&point2Lon)
+      {
+         theCentralPoint1.latd(ossimString(point1Lat).toDouble());
+         theCentralPoint1.lond(ossimString(point1Lon).toDouble());
+         theCentralPoint2.latd(ossimString(point2Lat).toDouble());
+         theCentralPoint2.lond(ossimString(point2Lon).toDouble());
+      }
+      if(scale)
+      {
+         OMerc_Scale_Factor = ossimString(scale).toDouble();
+      }
+   }
+   
+   update();
+
+   return flag;
+
+}
+
+/*
+ *                              FUNCTIONS     
+ */
+
+long ossimObliqueMercatorProjection::Set_Oblique_Mercator_Parameters(double a,
+                                                                     double f,
+                                                                     double Origin_Latitude,
+                                                                     double Latitude_1,
+                                                                     double Longitude_1,
+                                                                     double Latitude_2,
+                                                                     double Longitude_2,
+                                                                     double False_Easting,
+                                                                     double False_Northing,
+                                                                     double Scale_Factor)
+{ /* BEGIN Set_Oblique_Mercator_Parameters */
+/*
+ * The function Set_Oblique_Mercator_Parameters receives the ellipsoid parameters and
+ * projection parameters as inputs, and sets the corresponding state
+ * variables.  If any errors occur, the error code(s) are returned by the function, 
+ * otherwise OMERC_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters  (input)
+ *    f                 : Flattening of ellipsoid                  (input)
+ *    Origin_Latitude   : Latitude, in radians, at which the       (input)
+ *                          point scale factor is 1.0
+ *    Latitude_1        : Latitude, in radians, of first point lying on
+ *                          central line                           (input)
+ *    Longitude_1       : Longitude, in radians, of first point lying on
+ *                          central line                           (input)
+ *    Latitude_2        : Latitude, in radians, of second point lying on
+ *                          central line                           (input)
+ *    Longitude_2       : Longitude, in radians, of second point lying on
+ *                          central line                           (input)
+ *    False_Easting     : A coordinate value, in meters, assigned to the
+ *                          central meridian of the projection     (input)
+ *    False_Northing    : A coordinate value, in meters, assigned to the
+ *                          origin latitude of the projection      (input)
+ *    Scale_Factor      : Multiplier which reduces distances in the
+ *                          projection to the actual distance on the
+ *                          ellipsoid                              (input)
+ */
+
+//  double inv_f = 1 / f;
+  double es2, one_MINUS_es2;
+  double cos_olat, cos_olat2;
+  double sin_olat, sin_olat2, es2_sin_olat2;
+  double t0, t1, t2;
+  double D, D2, D2_MINUS_1, sqrt_D2_MINUS_1;
+  double H, L, LH;
+  double E2;
+  double F, G, J, P;
+  double dlon;
+  long Error_Code = OMERC_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= OMERC_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= OMERC_INV_F_ERROR;
+//   }
+//   if ((Origin_Latitude <= -PI_OVER_2) || (Origin_Latitude >= PI_OVER_2))
+//   { /* origin latitude out of range -  can not be at a pole */
+//     Error_Code |= OMERC_ORIGIN_LAT_ERROR;
+//   }
+//   if ((Latitude_1 <= -PI_OVER_2) || (Latitude_1 >= PI_OVER_2))
+//   { /* first latitude out of range -  can not be at a pole */
+//     Error_Code |= OMERC_LAT1_ERROR;
+//   }
+//   if ((Latitude_2 <= -PI_OVER_2) || (Latitude_2 >= PI_OVER_2))
+//   { /* second latitude out of range -  can not be at a pole */
+//     Error_Code |= OMERC_LAT2_ERROR;
+//   }
+//   if (Latitude_1 == 0.0)
+//   { /* first latitude can not be at the equator */
+//     Error_Code |= OMERC_LAT1_ERROR;
+//   }
+//   if (Latitude_1 == Latitude_2)
+//   { /* first and second latitudes can not be equal */
+//     Error_Code |= OMERC_LAT1_LAT2_ERROR;
+//   }
+//   if (((Latitude_1 < 0.0) && (Latitude_2 > 0.0)) ||
+//       ((Latitude_1 > 0.0) && (Latitude_2 < 0.0)))
+//   { /*first and second points can not be in different hemispheres */
+//     Error_Code |= OMERC_DIFF_HEMISPHERE_ERROR;
+//   }
+//   if ((Longitude_1 < -PI) || (Longitude_1 > TWO_PI))
+//   { /* first longitude out of range */
+//     Error_Code |= OMERC_LON1_ERROR;
+//   }
+//   if ((Longitude_2 < -PI) || (Longitude_2 > TWO_PI))
+//   { /* first longitude out of range */
+//     Error_Code |= OMERC_LON2_ERROR;
+//   }
+//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
+//   { /* scale factor out of range */
+//     Error_Code |= OMERC_SCALE_FACTOR_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+
+    OMerc_a = a;
+    OMerc_f = f;
+    OMerc_Origin_Lat = Origin_Latitude;
+    OMerc_Lat_1 = Latitude_1;
+    OMerc_Lat_2 = Latitude_2;
+    OMerc_Lon_1 = Longitude_1;
+    OMerc_Lon_2 = Longitude_2;
+    OMerc_Scale_Factor = Scale_Factor;
+    OMerc_False_Northing = False_Northing;
+    OMerc_False_Easting = False_Easting;
+
+    es2 = 2 * OMerc_f - OMerc_f * OMerc_f;
+    es = sqrt(es2);
+    one_MINUS_es2 = 1 - es2;
+    es_OVER_2 = es / 2.0;
+
+    cos_olat = cos(OMerc_Origin_Lat);
+    cos_olat2 = cos_olat * cos_olat;
+    sin_olat = sin(OMerc_Origin_Lat);
+    sin_olat2 = sin_olat * sin_olat;
+    es2_sin_olat2 = es2 * sin_olat2;
+
+    OMerc_B = sqrt(1 + (es2 * cos_olat2 * cos_olat2) / one_MINUS_es2);
+    OMerc_A = (OMerc_a * OMerc_B * OMerc_Scale_Factor * sqrt(one_MINUS_es2)) / (1.0 - es2_sin_olat2);  
+    A_over_B = OMerc_A / OMerc_B;
+    B_over_A = OMerc_B / OMerc_A;
+
+    t0 = OMERC_t(OMerc_Origin_Lat, es * sin_olat, es_OVER_2);
+    t1 = OMERC_t(OMerc_Lat_1, es * sin(OMerc_Lat_1), es_OVER_2);  
+    t2 = OMERC_t(OMerc_Lat_2, es * sin(OMerc_Lat_2), es_OVER_2);  
+
+    D = (OMerc_B * sqrt(one_MINUS_es2)) / (cos_olat * sqrt(1.0 - es2_sin_olat2)); 
+    D2 = D * D;
+    if (D2 < 1.0)
+      D2 = 1.0;
+    D2_MINUS_1 = D2 - 1.0;
+    sqrt_D2_MINUS_1 = sqrt(D2_MINUS_1);
+    if (D2_MINUS_1 > 1.0e-10)
+    {
+      if (OMerc_Origin_Lat >= 0.0)
+        OMerc_E = (D + sqrt_D2_MINUS_1) * pow(t0, OMerc_B);
+      else
+        OMerc_E = (D - sqrt_D2_MINUS_1) * pow(t0, OMerc_B);
+    }
+    else
+      OMerc_E = D * pow(t0, OMerc_B);
+    H = pow(t1, OMerc_B);
+    L = pow(t2, OMerc_B);
+    F = OMerc_E / H;
+    G = (F - 1.0 / F) / 2.0;
+    E2 = OMerc_E * OMerc_E;
+    LH = L * H;
+    J = (E2 - LH) / (E2 + LH);
+    P = (L - H) / (L + H);
+
+    dlon = OMerc_Lon_1 - OMerc_Lon_2;
+    if (dlon < -M_PI )
+      OMerc_Lon_2 -= TWO_PI;
+    if (dlon > M_PI)
+      OMerc_Lon_2 += TWO_PI;
+    dlon = OMerc_Lon_1 - OMerc_Lon_2;
+    OMerc_Origin_Long = (OMerc_Lon_1 + OMerc_Lon_2) / 2.0 - (atan(J * tan(OMerc_B * dlon / 2.0) / P)) / OMerc_B;
+
+    dlon = OMerc_Lon_1 - OMerc_Origin_Long;
+//     if (dlon < -M_PI )
+//       OMerc_Origin_Long -= TWO_PI;
+//     if (dlon > M_PI)
+//       OMerc_Origin_Long += TWO_PI;
+   
+    dlon = OMerc_Lon_1 - OMerc_Origin_Long;
+    OMerc_gamma = atan(sin(OMerc_B * dlon) / G);
+    cos_gamma = cos(OMerc_gamma);
+    sin_gamma = sin(OMerc_gamma);
+  
+    OMerc_azimuth = asin(D * sin_gamma);
+    cos_azimuth = cos(OMerc_azimuth);
+    sin_azimuth = sin(OMerc_azimuth);
+
+   if (OMerc_Origin_Lat >= 0)
+      OMerc_u =  A_over_B * atan(sqrt_D2_MINUS_1/cos_azimuth);
+   else
+      OMerc_u = -A_over_B * atan(sqrt_D2_MINUS_1/cos_azimuth);
+
+  } /* End if(!Error_Code) */
+  return (Error_Code);
+} /* End Set_Oblique_Mercator_Parameters */
+
+void ossimObliqueMercatorProjection::Get_Oblique_Mercator_Parameters(double *a,
+                                                                     double *f,
+                                                                     double *Origin_Latitude,
+                                                                     double *Latitude_1,
+                                                                     double *Longitude_1,
+                                                                     double *Latitude_2,
+                                                                     double *Longitude_2,
+                                                                     double *False_Easting,
+                                                                     double *False_Northing,
+                                                                     double *Scale_Factor)const
+{ /* Begin Get_Oblique_Mercator_Parameters */
+/*
+ * The function Get_Oblique_Mercator_Parameters returns the current ellipsoid
+ * parameters and Oblique Mercator projection parameters.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters  (output)
+ *    f                 : Flattening of ellipsoid                  (output)
+ *    Origin_Latitude   : Latitude, in radians, at which the       (output)
+ *                          point scale factor is 1.0
+ *    Latitude_1        : Latitude, in radians, of first point lying on
+ *                          central line                           (output)
+ *    Longitude_1       : Longitude, in radians, of first point lying on
+ *                          central line                           (output)
+ *    Latitude_2        : Latitude, in radians, of second point lying on
+ *                          central line                           (output)
+ *    Longitude_2       : Longitude, in radians, of second point lying on
+ *                          central line                           (output)
+ *    False_Easting     : A coordinate value, in meters, assigned to the
+ *                          central meridian of the projection     (output)
+ *    False_Northing    : A coordinate value, in meters, assigned to the
+ *                          origin latitude of the projection      (output)
+ *    Scale_Factor      : Multiplier which reduces distances in the
+ *                          projection to the actual distance on the
+ *                          ellipsoid                              (output)
+ */
+
+  *a = OMerc_a;
+  *f = OMerc_f;
+  *Origin_Latitude = OMerc_Origin_Lat;
+  *Latitude_1 = OMerc_Lat_1;
+  *Longitude_1 = OMerc_Lon_1;
+  *Latitude_2 = OMerc_Lat_2;
+  *Longitude_2 = OMerc_Lon_2;
+  *Scale_Factor = OMerc_Scale_Factor;
+  *False_Easting = OMerc_False_Easting;
+  *False_Northing = OMerc_False_Northing;
+  
+  return;
+} /* End Get_Azimuthal_Equidistant_Parameters */
+
+long ossimObliqueMercatorProjection::Convert_Geodetic_To_Oblique_Mercator(double Latitude,
+                                                                          double Longitude,
+                                                                          double *Easting,
+                                                                          double *Northing)const
+{ /* BEGIN Convert_Geodetic_To_Oblique_Mercator */
+/*
+ * The function Convert_Geodetic_To_Oblique_Mercator converts geodetic (latitude and
+ * longitude) coordinates to Oblique Mercator projection (easting and
+ * northing) coordinates, according to the current ellipsoid and Oblique Mercator 
+ * projection parameters.  If any errors occur, the error code(s) are returned 
+ * by the function, otherwise OMERC_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi), in radians           (input)
+ *    Longitude         : Longitude (lambda), in radians       (input)
+ *    Easting           : Easting (X), in meters               (output)
+ *    Northing          : Northing (Y), in meters              (output)
+ */
+
+  double dlam, B_dlam, cos_B_dlam;
+  double t, S, T, V, U;
+  double Q, Q_inv;
+  /* Coordinate axes defined with respect to the azimuth of the center line */
+  /* Natural origin*/
+  double v = 0;
+  double u = 0;
+  long Error_Code = OMERC_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   { /* Latitude out of range */
+//     Error_Code |= OMERC_LAT_ERROR;
+//   }
+//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
+//   { /* Longitude out of range */
+//     Error_Code |= OMERC_LON_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    dlam = Longitude - OMerc_Origin_Long;
+
+//     if (fabs(dlam) >= PI_OVER_2)
+//     { /* Distortion will result if Longitude is 90 degrees or more from the Central Meridian */
+//       Error_Code |= OMERC_LON_WARNING;
+//     }
+
+//     if (dlam > M_PI)
+//     {
+//       dlam -= TWO_PI;
+//     }
+//     if (dlam < -M_PI)
+//     {
+//       dlam += TWO_PI;
+//     }
+
+    if (fabs(fabs(Latitude) - PI_OVER_2) > 1.0e-10)
+    {
+      t = OMERC_t(Latitude, es * sin(Latitude), es_OVER_2);  
+      Q = OMerc_E / pow(t, OMerc_B);
+      Q_inv = 1.0 / Q;
+      S = (Q - Q_inv) / 2.0;
+      T = (Q + Q_inv) / 2.0;
+      B_dlam = OMerc_B * dlam;
+      V = sin(B_dlam);
+      U = ((-1.0 * V * cos_gamma) + (S * sin_gamma)) / T;
+      if (fabs(fabs(U) - 1.0) < 1.0e-10)
+      { /* Point projects into infinity */
+        Error_Code |= OMERC_LON_ERROR;
+      }
+      else
+      {
+        v = A_over_B * log((1.0 - U) / (1.0 + U)) / 2.0;
+        cos_B_dlam = cos(B_dlam);
+        if (fabs(cos_B_dlam) < 1.0e-10)
+          u = OMerc_A * B_dlam;
+        else
+          u = A_over_B * atan(((S * cos_gamma) + (V * sin_gamma)) / cos_B_dlam);
+      }
+    }
+    else
+    {
+      if (Latitude > 0.0)
+        v = A_over_B * log(tan(PI_OVER_4 - (OMerc_gamma / 2.0)));
+      else
+        v = A_over_B * log(tan(PI_OVER_4 + (OMerc_gamma / 2.0)));
+      u = A_over_B * Latitude;
+    }
+
+
+    u = u - OMerc_u;
+
+    *Easting  = OMerc_False_Easting + v * cos_azimuth + u * sin_azimuth;
+    *Northing = OMerc_False_Northing + u * cos_azimuth - v * sin_azimuth;
+
+  }
+  return (Error_Code);
+} /* End Convert_Geodetic_To_Oblique_Mercator */
+
+
+long ossimObliqueMercatorProjection::Convert_Oblique_Mercator_To_Geodetic(double Easting,
+                                                                          double Northing,
+                                                                          double *Latitude,
+                                                                          double *Longitude)const
+{ /* Begin Convert_Oblique_Mercator_To_Geodetic */
+/*
+ * The function Convert_Oblique_Mercator_To_Geodetic converts Oblique Mercator projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid and Oblique Mercator projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise OMERC_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X), in meters                  (input)
+ *    Northing          : Northing (Y), in meters                 (input)
+ *    Latitude          : Latitude (phi), in radians              (output)
+ *    Longitude         : Longitude (lambda), in radians          (output)
+ */
+
+  double dx, dy;
+  /* Coordinate axes defined with respect to the azimuth of the center line */
+  /* Natural origin*/
+  double u, v;
+  double Q_prime, Q_prime_inv;
+  double S_prime, T_prime, V_prime, U_prime;
+  double t;
+  double es_sin;
+  double u_B_over_A;
+  double phi;
+  double temp_phi = 0.0;
+  long Error_Code = OMERC_NO_ERROR; 
+
+//   if ((Easting < (OMerc_False_Easting - OMerc_Delta_Easting)) 
+//       || (Easting > (OMerc_False_Easting + OMerc_Delta_Easting)))
+//   { /* Easting out of range  */
+//     Error_Code |= OMERC_EASTING_ERROR;
+//   }
+//   if ((Northing < (OMerc_False_Northing - OMerc_Delta_Northing)) 
+//       || (Northing > (OMerc_False_Northing + OMerc_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= OMERC_NORTHING_ERROR;
+//   }
+
+  if (!Error_Code)
+  {
+    dy = Northing - OMerc_False_Northing;
+    dx = Easting - OMerc_False_Easting;
+    v = dx * cos_azimuth - dy * sin_azimuth;
+    u = dy * cos_azimuth + dx * sin_azimuth;
+    u = u + OMerc_u;
+    Q_prime = exp(-1.0 * (v * B_over_A ));
+    Q_prime_inv = 1.0 / Q_prime;
+    S_prime = (Q_prime - Q_prime_inv) / 2.0;
+    T_prime = (Q_prime + Q_prime_inv) / 2.0;
+    u_B_over_A = u * B_over_A;
+    V_prime = sin(u_B_over_A);
+    U_prime = (V_prime * cos_gamma + S_prime * sin_gamma) / T_prime;
+    if (fabs(fabs(U_prime) - 1.0) < 1.0e-10)
+    {
+      if (U_prime > 0)
+        *Latitude = PI_OVER_2;
+      else
+        *Latitude = -PI_OVER_2;
+      *Longitude = OMerc_Origin_Long;
+    }
+    else
+    {
+      t = pow(OMerc_E / sqrt((1.0 + U_prime) / (1.0 - U_prime)), 1.0 / OMerc_B);
+      phi = PI_OVER_2 - 2.0 * atan(t);
+      while (fabs(phi - temp_phi) > 1.0e-10)
+      {
+        temp_phi = phi;
+        es_sin = es * sin(phi);
+        phi = PI_OVER_2 - 2.0 * atan(t * pow((1.0 - es_sin) / (1.0 + es_sin), es_OVER_2));
+      }
+      *Latitude = phi;
+      *Longitude = OMerc_Origin_Long - atan2((S_prime * cos_gamma - V_prime * sin_gamma), cos(u_B_over_A)) / OMerc_B;
+    }
+
+//     if (fabs(*Latitude) < 2.0e-7)  /* force lat to 0 to avoid -0 degrees */
+//       *Latitude = 0.0;
+//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+//       *Latitude = PI_OVER_2;
+//     else if (*Latitude < -PI_OVER_2)
+//       *Latitude = -PI_OVER_2;
+
+//     if (*Longitude > PI)
+//       *Longitude -= TWO_PI;
+//     if (*Longitude < -PI)
+//       *Longitude += TWO_PI;
+
+//     if (fabs(*Longitude) < 2.0e-7)  /* force lon to 0 to avoid -0 degrees */
+//       *Longitude = 0.0;
+//     if (*Longitude > PI)  /* force distorted values to 180, -180 degrees */
+//       *Longitude = PI;
+//     else if (*Longitude < -PI)
+//       *Longitude = -PI;
+
+//     if (fabs(*Longitude - OMerc_Origin_Long) >= PI_OVER_2)
+//     { /* Distortion will result if Longitude is 90 degrees or more from the Central Meridian */
+//       Error_Code |= OMERC_LON_WARNING;
+//     }
+
+  }
+  return (Error_Code);
+} /* End Convert_Oblique_Mercator_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimObliqueMercatorProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimObliqueMercatorProjection* p =
+      dynamic_cast<const ossimObliqueMercatorProjection*>(&proj);
+   if (!p) return false;
+
+   if (theCentralPoint1 != p->theCentralPoint1) return false;
+   if (theCentralPoint2 != p->theCentralPoint2) return false;
+   if (!ossim::almostEqual(OMerc_Scale_Factor,p->OMerc_Scale_Factor)) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimOptimizableProjection.cpp b/src/projection/ossimOptimizableProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimOptimizableProjection.cpp
rename to src/projection/ossimOptimizableProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimOrthoGraphicProjection.cpp b/src/projection/ossimOrthoGraphicProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimOrthoGraphicProjection.cpp
rename to src/projection/ossimOrthoGraphicProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimPolarStereoProjection.cpp b/src/projection/ossimPolarStereoProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimPolarStereoProjection.cpp
rename to src/projection/ossimPolarStereoProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimPolarst.c b/src/projection/ossimPolarst.c
similarity index 100%
rename from ossim/src/ossim/projection/ossimPolarst.c
rename to src/projection/ossimPolarst.c
diff --git a/ossim/src/ossim/projection/ossimPolyconicProjection.cpp b/src/projection/ossimPolyconicProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimPolyconicProjection.cpp
rename to src/projection/ossimPolyconicProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimPolynomProjection.cpp b/src/projection/ossimPolynomProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimPolynomProjection.cpp
rename to src/projection/ossimPolynomProjection.cpp
diff --git a/ossim/src/ossim/projection/ossimPositionQualityEvaluator.cpp b/src/projection/ossimPositionQualityEvaluator.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimPositionQualityEvaluator.cpp
rename to src/projection/ossimPositionQualityEvaluator.cpp
diff --git a/src/projection/ossimPpjFrameSensor.cpp b/src/projection/ossimPpjFrameSensor.cpp
new file mode 100644
index 0000000..c35b0a0
--- /dev/null
+++ b/src/projection/ossimPpjFrameSensor.cpp
@@ -0,0 +1,475 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Dave Hicks
+//
+// Description:  PPJ Frame Model
+//
+//*******************************************************************
+//  $Id$
+#include <ossim/projection/ossimPpjFrameSensor.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimLsrRay.h>
+#include <ossim/base/ossimLsrSpace.h>
+#include <ossim/base/ossimMatrix4x4.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/matrix/newmatio.h>
+
+static ossimTrace traceExec ("ossimPpjFrameSensor:exec");
+static ossimTrace traceDebug("ossimPpjFrameSensor:debug");
+
+RTTI_DEF1(ossimPpjFrameSensor, "ossimPpjFrameSensor", ossimSensorModel);
+
+enum
+{
+   PARAM_ADJ_LON_OFFSET   = 0,
+   PARAM_ADJ_LAT_OFFSET = 1,
+   PARAM_ADJ_ALTITUDE_OFFSET =2, 
+   // PARAM_ADJ_ROLL_OFFSET,
+   // PARAM_ADJ_PITCH_OFFSET,
+   // PARAM_ADJ_YAW_OFFSET,
+   PARAM_ADJ_FOCAL_LENGTH_OFFSET=6,
+   PARAM_ADJ_COUNT = 7
+};
+
+ossimPpjFrameSensor::ossimPpjFrameSensor()
+   :
+   m_ecef2Cam(),
+   m_ecef2CamInverse(),
+   m_principalPoint(0.0, 0.0),
+   m_focalLengthX(0.0),
+   m_focalLengthY(0.0),
+   m_focalLength(0.0),
+   m_ecefCameraPosition(),
+   m_cameraPositionEllipsoid(),
+   m_radialK1(0.0),
+   m_radialK2(0.0),
+   m_radialP1(0.0),
+   m_radialP2(0.0),
+   m_adjustedCameraPosition(),
+   m_adjustedFocalLength(0.0),
+   m_averageProjectedHeight(0.0)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPpjFrameSensor::ossimPpjFrameSensor DEBUG:" << std::endl;
+   }
+   initAdjustableParameters();
+   theSensorID = "PpjFrame";
+   m_ecef2Cam.ReSize(3,3);
+   m_ecef2CamInverse.ReSize(3,3);
+
+   std::fill(m_ecef2Cam.Store(), m_ecef2Cam.Store()+9, 0.0);
+   std::fill(m_ecef2CamInverse.Store(), m_ecef2CamInverse.Store()+9, 0.0);
+   m_ecef2Cam[0][0] = 1.0;
+   m_ecef2Cam[1][1] = 1.0;
+   m_ecef2Cam[2][2] = 1.0;
+   m_ecef2CamInverse[0][0] = 1.0;
+   m_ecef2CamInverse[1][1] = 1.0;
+   m_ecef2CamInverse[2][2] = 1.0;
+}
+
+ossimPpjFrameSensor::ossimPpjFrameSensor(const ossimPpjFrameSensor& src)
+   :
+   ossimSensorModel(src),
+   m_ecef2Cam(src.m_ecef2Cam),
+   m_ecef2CamInverse(src.m_ecef2CamInverse),
+   m_principalPoint(src.m_principalPoint),
+   m_focalLengthX(src.m_focalLengthX),
+   m_focalLengthY(src.m_focalLengthY),
+   m_focalLength(src.m_focalLength),
+   m_ecefCameraPosition(src.m_ecefCameraPosition),
+   m_cameraPositionEllipsoid(src.m_cameraPositionEllipsoid),
+   m_radialK1(src.m_radialK1),
+   m_radialK2(src.m_radialK2),
+   m_radialP1(src.m_radialP1),
+   m_radialP2(src.m_radialP2),
+   m_adjustedCameraPosition(src.m_adjustedCameraPosition),
+   m_adjustedFocalLength(src.m_adjustedFocalLength),
+   m_averageProjectedHeight(src.m_averageProjectedHeight)
+{
+}
+
+ossimObject* ossimPpjFrameSensor::dup()const
+{
+   return new ossimPpjFrameSensor(*this);
+}
+   
+void ossimPpjFrameSensor::setFocalLength(double focX, double focY)
+{
+   m_focalLengthX = focX;
+   m_focalLengthY = focY;
+   m_focalLength  = m_focalLengthX;
+}
+
+void ossimPpjFrameSensor::setCameraPosition(const ossimGpt& value)
+{
+   m_cameraPositionEllipsoid = value;
+   m_ecefCameraPosition = value;
+}
+   
+void ossimPpjFrameSensor::setPrincipalPoint(const ossimDpt& value)
+{
+   m_principalPoint = value;
+}
+
+void ossimPpjFrameSensor::setecef2CamMatrix(const NEWMAT::Matrix& value)
+{
+   m_ecef2Cam = value;
+   m_ecef2CamInverse = m_ecef2Cam.t();
+}
+
+void ossimPpjFrameSensor::setAveragePrjectedHeight(double averageProjectedHeight)
+{
+   m_averageProjectedHeight = averageProjectedHeight;
+}
+
+void ossimPpjFrameSensor::imagingRay(const ossimDpt& imagePoint,
+                                     ossimEcefRay& imageRay) const
+{
+   // Form camera frame LOS vector
+   ossimColumnVector3d camLOS(imagePoint.x - m_principalPoint.x,
+                              imagePoint.y - m_principalPoint.y,
+                              m_adjustedFocalLength);   
+
+   // Rotate to ECF
+   ossimColumnVector3d ecfLOS = m_ecef2CamInverse * camLOS;
+   imageRay.setOrigin(m_adjustedCameraPosition);
+   ossimEcefVector ecfRayDir(ecfLOS);
+   imageRay.setDirection(ecfRayDir);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPpjFrameSensor::imagingRay DEBUG:\n"
+         << "  camLOS = " << camLOS << "\n"
+         << "  m_adjustedPlatformPosition = " << m_adjustedCameraPosition << "\n"
+         << "  imageRay = " << imageRay << "\n"
+         << std::endl;
+   }
+
+}
+
+void ossimPpjFrameSensor::lineSampleToWorld(const ossimDpt& imagePoint,
+                                                ossimGpt& worldPt) const
+{
+   ossimEcefRay ray;
+   imagingRay(imagePoint, ray);
+   ossimElevManager::instance()->intersectRay(ray, worldPt, m_averageProjectedHeight);
+}  
+
+void ossimPpjFrameSensor::lineSampleHeightToWorld(const ossimDpt& imagePoint,
+                                                  const double&   heightEllipsoid,
+                                                        ossimGpt& worldPt) const
+{
+   ossimEcefRay ray;
+   imagingRay(imagePoint, ray);
+   double h = (ossim::isnan(heightEllipsoid)||ossim::almostEqual(heightEllipsoid, 0.0))?m_averageProjectedHeight:heightEllipsoid;
+   ossimEcefPoint pecf(ray.intersectAboveEarthEllipsoid(h));
+   worldPt = ossimGpt(pecf);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimPpjFrameSensor::lineSampleHeightToWorld DEBUG:" << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "  imagePoint = " << imagePoint << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "  heightEllipsoid = " << heightEllipsoid << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "  ray = " << ray << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "  worldPt = " << worldPt << std::endl;
+   }
+}
+
+void ossimPpjFrameSensor::worldToLineSample(const ossimGpt& world_point,
+                                             ossimDpt&       image_point) const
+{   
+   ossimGpt wpt = world_point;
+   if(wpt.isHgtNan())
+   {
+      wpt.height(m_averageProjectedHeight);
+   }
+   ossimEcefPoint gnd_ecf(wpt);
+   ossimEcefPoint cam_ecf(m_adjustedCameraPosition);
+   ossimEcefVector ecfRay(gnd_ecf - cam_ecf);
+   ossimColumnVector3d camRay(m_ecef2Cam*ecfRay.data());   
+      
+   double x = m_principalPoint.x + m_adjustedFocalLength*camRay[0]/camRay[2];
+   double y = m_principalPoint.y + m_adjustedFocalLength*camRay[1]/camRay[2];
+
+   ossimDpt p(x, y);
+    
+   image_point = p;
+}
+
+void ossimPpjFrameSensor::updateModel()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPpjFrameSensor::updateModel DEBUG:" << std::endl;
+   }
+
+   double deltap = computeParameterOffset(PARAM_ADJ_LAT_OFFSET)/
+      m_cameraPositionEllipsoid.metersPerDegree().y;
+   double deltal = computeParameterOffset(PARAM_ADJ_LON_OFFSET)/
+      m_cameraPositionEllipsoid.metersPerDegree().x;
+   
+   m_adjustedCameraPosition = ossimGpt(m_cameraPositionEllipsoid.latd()   + deltap,
+                                       m_cameraPositionEllipsoid.lond()   + deltal,
+                                       m_cameraPositionEllipsoid.height() + computeParameterOffset(PARAM_ADJ_ALTITUDE_OFFSET));
+
+   // TODO  Need to add correction matrix to accommodate orientation offsets.  It
+   //       shouldn't be done in ECF frame.
+   // double r = ossim::degreesToRadians(m_roll  + computeParameterOffset(PARAM_ADJ_ROLL_OFFSET));
+   // double p = ossim::degreesToRadians(m_pitch + computeParameterOffset(PARAM_ADJ_PITCH_OFFSET) );
+   // double y = ossim::degreesToRadians(m_yaw   + computeParameterOffset(PARAM_ADJ_YAW_OFFSET));
+   // NEWMAT::Matrix rollM   = ossimMatrix3x3::create(1, 0, 0,
+   //                                                 0, cos(r), sin(r),
+   //                                                 0, -sin(r), cos(r));
+   // NEWMAT::Matrix pitchM  = ossimMatrix3x3::create(cos(p), 0, -sin(p),
+   //                                                 0,      1, 0,
+   //                                                 sin(p), 0, cos(p));
+   // NEWMAT::Matrix yawM    = ossimMatrix3x3::create(cos(y), sin(y), 0,
+   //                                                 -sin(y), cos(y), 0,
+   //                                                 0,0,1); 
+   
+   m_adjustedFocalLength = m_focalLength + computeParameterOffset(PARAM_ADJ_FOCAL_LENGTH_OFFSET);
+   
+     
+   try
+   {
+      computeGsd();
+   }
+   catch(...)
+   {
+      
+   }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPpjFrameSensor::updateModel complete..." << std::endl;
+   }
+   /*
+   ossimGpt gpt;
+   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
+   theBoundGndPolygon[0] = gpt;
+   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
+   theBoundGndPolygon[1] = gpt;
+   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
+   theBoundGndPolygon[2] = gpt;
+   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
+   theBoundGndPolygon[3] = gpt;
+   */
+}
+
+void ossimPpjFrameSensor::initAdjustableParameters()
+{
+   if (traceExec())
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimPpjFrameSensor::initAdjustableParameters: returning..." << std::endl;
+   resizeAdjustableParameterArray(PARAM_ADJ_COUNT);
+   
+   setAdjustableParameter(PARAM_ADJ_LON_OFFSET, 0.0);
+   setParameterDescription(PARAM_ADJ_LON_OFFSET, "lon_offset");
+   setParameterUnit(PARAM_ADJ_LON_OFFSET, "meters");
+   setParameterSigma(PARAM_ADJ_LON_OFFSET, 10);
+   
+   setAdjustableParameter(PARAM_ADJ_LAT_OFFSET, 0.0);
+   setParameterDescription(PARAM_ADJ_LAT_OFFSET, "lat_offset");
+   setParameterUnit(PARAM_ADJ_LAT_OFFSET, "meters");
+   setParameterSigma(PARAM_ADJ_LAT_OFFSET, 10);
+   
+   setAdjustableParameter(PARAM_ADJ_ALTITUDE_OFFSET, 0.0);
+   setParameterDescription(PARAM_ADJ_ALTITUDE_OFFSET, "altitude_offset");
+   setParameterUnit(PARAM_ADJ_ALTITUDE_OFFSET, "meters");
+   setParameterSigma(PARAM_ADJ_ALTITUDE_OFFSET, 10);
+   
+   // TODO  Add these back in when orientation angle offsets are fixed.
+   // setAdjustableParameter(PARAM_ADJ_ROLL_OFFSET, 0.0);
+   // setParameterDescription(PARAM_ADJ_ROLL_OFFSET, "roll_offset");
+   // setParameterUnit(PARAM_ADJ_ROLL_OFFSET, "degrees");
+   // setParameterSigma(PARAM_ADJ_ROLL_OFFSET, 10);
+   
+   // setAdjustableParameter(PARAM_ADJ_PITCH_OFFSET, 0.0);
+   // setParameterDescription(PARAM_ADJ_PITCH_OFFSET, "pitch_offset");
+   // setParameterUnit(PARAM_ADJ_PITCH_OFFSET, "degrees");
+   // setParameterSigma(PARAM_ADJ_PITCH_OFFSET, 10);
+   
+   // setAdjustableParameter(PARAM_ADJ_YAW_OFFSET, 0.0);
+   // setParameterDescription(PARAM_ADJ_YAW_OFFSET, "yaw_offset");
+   // setParameterUnit(PARAM_ADJ_YAW_OFFSET, "degrees");
+   // setParameterSigma(PARAM_ADJ_YAW_OFFSET, .04);
+   
+   setAdjustableParameter(PARAM_ADJ_FOCAL_LENGTH_OFFSET, 0.0);
+   setParameterDescription(PARAM_ADJ_FOCAL_LENGTH_OFFSET, "focal_length_offset");
+   setParameterUnit(PARAM_ADJ_FOCAL_LENGTH_OFFSET, "pixels");
+   setParameterSigma(PARAM_ADJ_FOCAL_LENGTH_OFFSET, 20.0);   
+}
+
+bool ossimPpjFrameSensor::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPpjFrameSensor::loadState DEBUG:" << std::endl;
+   }
+
+   theGSD.makeNan();
+   theRefImgPt.makeNan();
+   ossimSensorModel::loadState(kwl, prefix);
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+      initAdjustableParameters();
+   }
+   ossimString principal_point = kwl.find(prefix, "principal_point");
+   ossimString focal_length_x = kwl.find(prefix, "focal_length_x");
+   ossimString focal_length_y = kwl.find(prefix, "focal_length_y");
+   ossimString number_samples = kwl.find(prefix, "number_samples");
+   ossimString number_lines = kwl.find(prefix, "number_lines");
+   ossimString ecf_to_cam_row1 = kwl.find(prefix, "ecf_to_cam_row1");
+   ossimString ecf_to_cam_row2 = kwl.find(prefix, "ecf_to_cam_row2");
+   ossimString ecf_to_cam_row3 = kwl.find(prefix, "ecf_to_cam_row3");
+   ossimString platform_position = kwl.find(prefix, "ecef_camera_position");
+   ossimString averageProjectedHeight = kwl.find(prefix, "average_projected_height");
+
+   // ossimString roll;
+   // ossimString pitch;
+   // ossimString yaw;
+   // m_roll    = 0;
+   // m_pitch   = 0;
+   // m_yaw     = 0;
+   // roll      = kwl.find(prefix, "roll"); 
+   // pitch     = kwl.find(prefix, "pitch"); 
+   // yaw       = kwl.find(prefix, "yaw"); 
+
+   bool result = (!principal_point.empty()&&
+                  !focal_length_x.empty()&&
+                  !platform_position.empty()&&
+                  !ecf_to_cam_row1.empty()&&
+                  !ecf_to_cam_row2.empty()&&
+                  !ecf_to_cam_row3.empty());
+   if(!averageProjectedHeight.empty())
+   {
+      m_averageProjectedHeight = averageProjectedHeight.toDouble();
+   }
+   if(!number_samples.empty())
+   {
+      theImageSize = ossimIpt(number_samples.toDouble(), number_lines.toDouble());
+      theRefImgPt = ossimDpt(theImageSize.x*.5, theImageSize.y*.5);
+      theImageClipRect = ossimDrect(0,0,theImageSize.x-1, theImageSize.y-1);
+   }
+   if(theImageClipRect.hasNans())
+   {
+      theImageClipRect = ossimDrect(0,0,theImageSize.x-1,theImageSize.y-1);
+   }
+   if(theRefImgPt.hasNans())
+   {
+      theRefImgPt = theImageClipRect.midPoint();
+   }
+   if(!focal_length_x.empty())
+   {
+      m_focalLengthX = focal_length_x.toDouble();
+      m_focalLength = m_focalLengthX;
+   }
+   if(!focal_length_y.empty())
+   {
+      m_focalLengthY = focal_length_y.toDouble();
+   }
+
+   std::vector<ossimString> row;
+   if(!ecf_to_cam_row1.empty())
+   {
+      row = ecf_to_cam_row1.explode(" ");
+      for (int i=0; i<3; ++i)
+         m_ecef2Cam[0][i] = row[i].toDouble();
+      row = ecf_to_cam_row2.explode(" ");
+      for (int i=0; i<3; ++i)
+         m_ecef2Cam[1][i] = row[i].toDouble();
+      row = ecf_to_cam_row3.explode(" ");
+      for (int i=0; i<3; ++i)
+         m_ecef2Cam[2][i] = row[i].toDouble();
+      m_ecef2CamInverse = m_ecef2Cam.t();
+   }
+
+   // if(!roll.empty())
+   // {
+   //    m_roll = roll.toDouble();
+   // }
+   // if(!pitch.empty())
+   // {
+   //    m_pitch = pitch.toDouble();
+   // }
+   // if(!yaw.empty())
+   // {
+   //    m_yaw   = yaw.toDouble();
+   // }
+
+   if(!principal_point.empty())
+   {
+      m_principalPoint.toPoint(principal_point);
+   }
+   if(!platform_position.empty())
+   {
+      m_ecefCameraPosition.toPoint(platform_position);
+      m_cameraPositionEllipsoid = ossimGpt(m_ecefCameraPosition);
+   }
+
+   
+   updateModel();
+   
+   if(theGSD.isNan())
+   {
+      try
+      {
+         computeGsd();
+      }
+      catch (const ossimException& e)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimPpjFrameSensor::loadState Caught Exception:\n"
+            << e.what() << std::endl;
+         }
+      }
+   }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimPpjFrameSensor::loadState complete..." << std::endl;
+   }
+   
+   return result;
+}
+
+bool ossimPpjFrameSensor::saveState(ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimSensorModel::saveState(kwl, prefix);
+   // kwl.add(prefix, "roll", ossimString::toString(m_roll), true);
+   // kwl.add(prefix, "pitch", ossimString::toString(m_pitch), true);
+   // kwl.add(prefix, "yaw", ossimString::toString(m_yaw), true);
+   kwl.add(prefix, "gsd", theGSD.toString(), true);
+   kwl.add(prefix, "principal_point", m_principalPoint.toString(), true);
+   kwl.add(prefix, "ecef_camera_position",m_ecefCameraPosition.toString() ,true);
+   kwl.add(prefix, "focal_length_x", ossimString::toString(m_focalLengthX) ,true);
+   kwl.add(prefix, "focal_length_y", ossimString::toString(m_focalLengthY) ,true);
+   kwl.add(prefix, "image_size", theImageSize.toString() ,true);
+   kwl.add(prefix, "average_projected_height", m_averageProjectedHeight, true);
+   ossimString row1 = ossimString::toString(m_ecef2Cam[0][0]) + " " +
+                      ossimString::toString(m_ecef2Cam[0][1]) + " " +
+                      ossimString::toString(m_ecef2Cam[0][2]);
+   kwl.add(prefix, "ecf_to_cam_row1", row1, true);
+   ossimString row2 = ossimString::toString(m_ecef2Cam[1][0]) + " " +
+                      ossimString::toString(m_ecef2Cam[1][1]) + " " +
+                      ossimString::toString(m_ecef2Cam[1][2]);
+   kwl.add(prefix, "ecf_to_cam_row2", row2, true);
+   ossimString row3 = ossimString::toString(m_ecef2Cam[2][0]) + " " +
+                      ossimString::toString(m_ecef2Cam[2][1]) + " " +
+                      ossimString::toString(m_ecef2Cam[2][2]);
+   kwl.add(prefix, "ecf_to_cam_row3", row3, true);
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimProjection.cpp b/src/projection/ossimProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimProjection.cpp
rename to src/projection/ossimProjection.cpp
diff --git a/src/projection/ossimProjectionFactoryBase.cpp b/src/projection/ossimProjectionFactoryBase.cpp
new file mode 100644
index 0000000..8098214
--- /dev/null
+++ b/src/projection/ossimProjectionFactoryBase.cpp
@@ -0,0 +1,110 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//*******************************************************************
+//  $Id: ossimProjectionFactoryBase.cpp 22626 2014-02-11 22:18:06Z dburken $
+
+#include <ossim/projection/ossimProjectionFactoryBase.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/imaging/ossimImageHandler.h>
+//---
+// Define Trace flags for use within this file:
+//---
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceDebug = ossimTrace("ossimProjectionFactoryBase:debug");
+
+RTTI_DEF1(ossimProjectionFactoryBase, "ossimProjectionFactoryBase", ossimObjectFactory);
+
+ossimProjection* ossimProjectionFactoryBase::createProjectionFromGeometryFile(const ossimFilename& imageFile, ossim_uint32 entryIdx)const
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimProjectionFactoryBase::createProjectionFromGeometryFile "
+         << "DEBUG:"
+         << "\nimageFile:  " << imageFile
+         << "\nentryIdx:   " << entryIdx
+         << std::endl;
+   }
+
+   // Try to find a geometry file for imageFile.
+   
+   ossimFilename geomFile = imageFile;
+   if (entryIdx == 0)
+   {
+      geomFile.setExtension("geom");
+      if(geomFile.exists())
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "Found geometry file:  " << geomFile
+               << std::endl;
+         }
+
+         ossimKeywordlist kwl;
+         if(kwl.addFile(geomFile))
+         {
+            //---
+            // Add the geometry file to the keyword list.
+            // This was added for ossimCoarseGridModel so it can pick up the
+            // file.ocg with a relative path.
+            //
+            // NOTE: The can't be called "geometry_file" as it causes an infinite loop in the factory
+            // code. (drb - 20140211)
+            //---
+            kwl.addPair( std::string("kwl_source"),
+                         geomFile.expand().string(),
+                         false); // Don't overwrite if in there already.
+            
+            return ossimProjectionFactoryRegistry::instance()->
+               createProjection(kwl);
+         }
+      }
+   }
+
+   // Look for an indexed geometry file.
+   geomFile = imageFile.fileNoExtension();
+   geomFile += "_e";
+   geomFile += ossimString::toString(entryIdx);
+   geomFile.setExtension("geom");
+   if(geomFile.exists())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "Found geometry file:  " << geomFile
+            << std::endl;
+      }
+      
+      ossimKeywordlist kwl;
+      if(kwl.addFile(geomFile))
+      {
+         return ossimProjectionFactoryRegistry::instance()->
+            createProjection(kwl);
+      }
+   }   
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG:  No geometry file found.  Returning NULL..."
+         << std::endl;
+   }
+
+   return NULL;
+}
+
+ossimProjection* ossimProjectionFactoryBase::createProjection(ossimImageHandler* handler)const
+{
+   if(!handler) return 0;
+   return createProjection(handler->getFilename(), handler->getCurrentEntry());
+}
+
diff --git a/src/projection/ossimProjectionFactoryRegistry.cpp b/src/projection/ossimProjectionFactoryRegistry.cpp
new file mode 100644
index 0000000..18be1cb
--- /dev/null
+++ b/src/projection/ossimProjectionFactoryRegistry.cpp
@@ -0,0 +1,181 @@
+//*******************************************************************
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimProjectionFactoryRegistry.cpp 22898 2014-09-29 15:22:32Z okramer $
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimProjectionFactoryBase.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+#include <ossim/projection/ossimNgaProjectionFactory.h>
+#include <ossim/projection/ossimWktProjectionFactory.h>
+#include <ossim/projection/ossimMapProjectionFactory.h>
+#include <ossim/projection/ossimTiffProjectionFactory.h>
+#include <ossim/projection/ossimNitfProjectionFactory.h>
+#include <ossim/projection/ossimSensorModelFactory.h>
+#include <ossim/projection/ossimMiscProjectionFactory.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <algorithm>
+#include <vector>
+
+#if OSSIM_HAS_HDF5
+#include <ossim/hdf5/ossimHdf5ProjectionFactory.h>
+#endif
+
+//ossimProjectionFactoryRegistry* ossimProjectionFactoryRegistry::m_instance = 0;
+
+
+ossimProjectionFactoryRegistry::ossimProjectionFactoryRegistry()
+{
+   initializeDefaults();
+   ossimObjectFactoryRegistry::instance()->registerFactory(this);
+}
+
+ossimProjectionFactoryRegistry::ossimProjectionFactoryRegistry(const ossimProjectionFactoryRegistry& rhs)
+:
+ossimObjectFactory(rhs)
+{}
+
+void ossimProjectionFactoryRegistry::operator=(const ossimProjectionFactoryRegistry&)
+{}
+
+ossimProjectionFactoryRegistry::~ossimProjectionFactoryRegistry()
+{
+}
+
+ossimProjectionFactoryRegistry* ossimProjectionFactoryRegistry::instance()
+{
+   static ossimProjectionFactoryRegistry inst;
+
+   return &inst;
+   //   if(!m_instance)
+//   {
+//      m_instance = new ossimProjectionFactoryRegistry();
+//   }
+   
+//   return m_instance;
+}
+
+ossimProjection*
+ossimProjectionFactoryRegistry::createProjection(const ossimFilename& name,
+                                                 ossim_uint32 entryIdx)const
+{
+   ossimProjection* result = 0;
+   ossim_uint32 idx = 0;
+   for(idx = 0; ((idx < m_factoryList.size())&&(!result)); ++idx)
+   {
+      result = m_factoryList[idx]->createProjection(name, entryIdx);
+   }
+   
+   return result;
+}
+
+ossimProjection* ossimProjectionFactoryRegistry::createProjection(ossimImageHandler* handler)const
+{
+   ossimProjection* result = 0;
+   ossim_uint32 idx = 0;
+   for(idx = 0; ((idx < m_factoryList.size())&&(!result)); ++idx)
+   {
+      result = m_factoryList[idx]->createProjection(handler);
+   }
+   
+   return result;
+}
+
+ossimProjection* ossimProjectionFactoryRegistry::createProjection(
+   const ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimProjection* result = 0;//createNativeObjectFromRegistry(kwl, prefix); 
+   ossim_uint32 idx = 0; 
+   for(idx = 0; ((idx < m_factoryList.size())&&!result);++idx) 
+   { 
+      result = m_factoryList[idx]->createProjection(kwl, prefix); 
+   } 
+   
+   if ( (result == 0) && (prefix == 0) )
+   {
+      //---
+      // Check for an embedded prefix like "image0."
+      //
+      // This is a workaround for people who use the "image_info" application
+      // to create a geometry file.
+      //
+      // If the image has an external geometry file and it has a prefix like
+      // "image0." and someone does:
+      //
+      // theInputConnection->getImageGeometry(kwl);
+      // ossimRefPtr<ossimProjection> proj =
+      // ossimProjectionFactoryRegistry::instance()->createProjection(kwl);
+      //
+      // It will fail because the factory doesn't know it has a prefix.
+      //
+      // ESH 01/2009: I've changed the following so that not just the first
+      // line is checked for "image" and ".".  If the image_info .geom file
+      // was created with the -m (metadata) option, the first lines of the
+      // file will not have the expected structure.
+      //---
+      bool bFoundImageLine = false;
+      ossimKeywordlist::KeywordMap::const_iterator i = kwl.getMap().begin();
+      while ( (i != kwl.getMap().end()) && (bFoundImageLine == false) )
+      {
+         ossimString s1 = (*i).first;
+         if ( s1.size() )
+         {
+            std::vector<ossimString> v;
+            s1.split(v, ossimString("."));
+            if ( v.size() )
+            {
+               if ( v[0].contains("image") )
+               {
+                  bFoundImageLine = true;
+                  ossimString s2 = v[0];
+                  s2 += ".";
+                  idx = 0;
+                  for(;((idx < m_factoryList.size())&&!result); ++idx)
+                  {
+                     result =  m_factoryList[idx]->createProjection(kwl, s2.c_str());
+                  }
+               }
+            }
+         }
+
+         // Go to the next line of the .geom file
+         ++i;
+      }
+   }
+
+   return result;
+}
+
+void ossimProjectionFactoryRegistry::initializeDefaults()
+{
+   registerFactory(ossimSensorModelFactory::instance());
+   registerFactory(ossimNitfProjectionFactory::instance());
+   registerFactory(ossimTiffProjectionFactory::instance());
+   registerFactory(ossimWktProjectionFactory::instance());
+   registerFactory(ossimMapProjectionFactory::instance());
+   registerFactory(ossimMiscProjectionFactory::instance());
+   registerFactory(ossimNgaProjectionFactory::instance());
+
+#if OSSIM_HAS_HDF5
+   registerFactory(ossimHdf5ProjectionFactory::instance());
+#endif
+
+   // KEEP THIS LAST PLEASE!
+   // This factory constructs map projections from EPSG codes. An infinite loop will occur if this
+   // is placed before the explicit (non-coded) factories, since this factory will invoke the above
+   // factories via this registry after populating a KWL which includes a PCS code. If this factory
+   // sees that request before the others, it will be caught in a loop.
+   registerFactory(ossimEpsgProjectionFactory::instance()); 
+}
+
+extern "C"
+{
+  void* ossimProjectionFactoryRegistryGetInstance()
+  {
+    return ossimProjectionFactoryRegistry::instance();
+  }
+
+}
diff --git a/ossim/src/ossim/projection/ossimProjectionViewControllerFactory.cpp b/src/projection/ossimProjectionViewControllerFactory.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimProjectionViewControllerFactory.cpp
rename to src/projection/ossimProjectionViewControllerFactory.cpp
diff --git a/ossim/src/ossim/projection/ossimQuadProjection.cpp b/src/projection/ossimQuadProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimQuadProjection.cpp
rename to src/projection/ossimQuadProjection.cpp
diff --git a/src/projection/ossimQuickbirdRpcModel.cpp b/src/projection/ossimQuickbirdRpcModel.cpp
new file mode 100644
index 0000000..becd455
--- /dev/null
+++ b/src/projection/ossimQuickbirdRpcModel.cpp
@@ -0,0 +1,512 @@
+//*****************************************************************************
+// FILE: ossimQuickbirdRpcModel.cpp
+//
+// License:  See top level LICENSE.txt file.
+//
+// DESCRIPTION: Contains declaration of class ossimQuickbirdRpcModel. This 
+//    derived class implements the capability of reading Quickbird RPC support
+//    data.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimQuickbirdRpcModel.cpp 23564 2015-10-02 14:12:25Z dburken $
+
+#include <ossim/projection/ossimQuickbirdRpcModel.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimQuickbirdRpcHeader.h>
+#include <ossim/support_data/ossimQuickbirdTile.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <ossim/support_data/ossimNitfRpcBase.h>
+#include <ossim/support_data/ossimNitfUse00aTag.h>
+#include <ossim/support_data/ossimNitfPiaimcTag.h>
+#include <ossim/imaging/ossimTiffTileSource.h>
+#include <ossim/imaging/ossimQbTileFilesHandler.h>
+
+static const char* RPC00A_TAG = "RPC00A";
+static const char* RPC00B_TAG = "RPC00B";
+static const char* PIAIMC_TAG = "PIAIMC";
+static const char* USE00A_TAG = "USE00A";
+
+RTTI_DEF1(ossimQuickbirdRpcModel, "ossimQuickbirdRpcModel", ossimRpcModel);
+
+
+//*************************************************************************************************
+// Constructor
+//*************************************************************************************************
+ossimQuickbirdRpcModel::ossimQuickbirdRpcModel()
+   :ossimRpcModel(),
+    theSupportData(new ossimQuickbirdMetaData())
+{
+}
+
+//*************************************************************************************************
+// Constructor
+//*************************************************************************************************
+ossimQuickbirdRpcModel::ossimQuickbirdRpcModel(const ossimQuickbirdRpcModel& rhs)
+   : ossimRpcModel(rhs),
+     theSupportData(new ossimQuickbirdMetaData())
+{
+}
+
+//*************************************************************************************************
+//! Constructor for multiple tile-files sharing common RPC model initializes given pointer
+//! to multi-tile-files handler.
+//*************************************************************************************************
+ossimQuickbirdRpcModel::ossimQuickbirdRpcModel(const ossimQbTileFilesHandler* handler)
+:  ossimRpcModel(),
+   theSupportData(new ossimQuickbirdMetaData())
+{
+   setErrorStatus();
+   if (!handler)
+      return;
+
+   // Make the gsd nan so it gets computed.
+   theGSD.makeNan();
+
+   theImageClipRect = handler->getImageRectangle();
+
+   ossimFilename imageFile = handler->getFilename();
+   if (!parseRpcData(imageFile))
+      return;
+
+   finishConstruction();
+   clearErrorStatus();
+   return;
+}
+
+//*************************************************************************************************
+// Destructor
+//*************************************************************************************************
+ossimQuickbirdRpcModel::~ossimQuickbirdRpcModel()
+{
+   theSupportData = 0;
+}
+
+//*************************************************************************************************
+// Infamous DUP 
+//*************************************************************************************************
+ossimObject* ossimQuickbirdRpcModel::dup() const
+{
+   return new ossimQuickbirdRpcModel(*this);
+}
+
+//*************************************************************************************************
+//! Public method for parsing generic image file.
+//*************************************************************************************************
+bool ossimQuickbirdRpcModel::parseFile(const ossimFilename& file)
+{
+   bool result = parseNitfFile(file);
+   if ( !result )
+   {
+      result = parseTiffFile(file);
+   }
+   return result;
+}
+
+//*************************************************************************************************
+//! Parses a NITF image file for RPC info. Returns TRUE if successful.
+//*************************************************************************************************
+bool ossimQuickbirdRpcModel::parseNitfFile(const ossimFilename& file)
+{
+   setErrorStatus();
+
+   //---
+   // ossimNitfFile::parseFile(...) checks the first eight byte so three calls
+   // to parseFile are not necessary. drb - 21 Dec. 2016  
+   //---
+   ossimRefPtr<ossimNitfFile> nitfFilePtr = new ossimNitfFile;
+   if( nitfFilePtr->parseFile( file ) == false )
+   {
+      return false;
+   }
+   
+#if 0   
+   ossimFilename nitfFile = file;
+   ossimRefPtr<ossimNitfFile> nitfFilePtr = new ossimNitfFile;
+   if(!nitfFilePtr->parseFile(nitfFile))
+   {
+      nitfFile = nitfFile.setExtension("NTF");
+      if(!nitfFilePtr->parseFile(nitfFile))
+      {
+         nitfFile = nitfFile.setExtension("ntf");
+         if(!nitfFilePtr->parseFile(nitfFile))
+            return false;
+      }
+   }
+#endif
+   
+   ossimRefPtr<ossimNitfImageHeader> ih = nitfFilePtr->getNewImageHeader(0);
+   if (!ih)
+      return false;
+
+   theImageClipRect = ih->getImageRect();
+ 
+   // Give preference to external RPC data file:
+   bool useInternalRpcTags = false;
+   if(!parseRpcData(file))
+      useInternalRpcTags = true;
+   if (!parseTileData(file))
+      return false;
+ 
+   // Check for IMD (metadata) file:
+   parseMetaData(file);
+
+   // Get the gsd.
+   theGSD.line = ossim::nan();
+   theGSD.samp = ossim::nan();
+   
+   ossimRefPtr<ossimNitfRegisteredTag> tag;
+   tag = ih->getTagData(PIAIMC_TAG);
+   if (tag.valid())
+   {
+      ossimNitfPiaimcTag* p = PTR_CAST(ossimNitfPiaimcTag, tag.get());
+      if (p)
+      {
+         theGSD.line = p->getMeanGsdInMeters();
+         theGSD.samp = theGSD.line;
+      }
+   }
+   if (ossim::isnan(theGSD.line))
+   {
+      tag = ih->getTagData(USE00A_TAG);
+      if (tag.valid())
+      {
+         ossimNitfUse00aTag* p = PTR_CAST(ossimNitfUse00aTag, tag.get());
+         if (p)
+         {
+            theGSD.line = p->getMeanGsdInMeters();
+            theGSD.samp = theGSD.line;
+         }
+      }
+   }
+
+   // If external RPC data file was correctly parsed, then we can bypass this code block. Otherwise
+   // need to parse internal NITF tags for RPC data:
+   if (useInternalRpcTags)
+   {
+      // Get the the RPC tag:
+      ossimNitfRpcBase* rpcTag = NULL;
+      
+      // Look for the RPC00B tag first.
+      tag = ih->getTagData(RPC00B_TAG);
+      if (tag.valid())
+         rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
+      
+      if (!tag.valid())
+      {
+         // Look for RPC00A tag.
+         tag = ih->getTagData(RPC00A_TAG);
+         if (tag.valid())
+            rpcTag = PTR_CAST(ossimNitfRpcBase, tag.get());
+      }
+      
+      if (!rpcTag)
+         return false;
+      
+      // Set the polynomial type.
+      if (rpcTag->getRegisterTagName() == "RPC00B")
+         thePolyType = B;
+      else
+         thePolyType = A;
+
+      // Parse coefficients:
+      for (ossim_uint32 i=0; i<20; ++i)
+      {
+         theLineNumCoef[i] = rpcTag->getLineNumeratorCoeff(i).toFloat64();
+         theLineDenCoef[i] = rpcTag->getLineDenominatorCoeff(i).toFloat64();
+         theSampNumCoef[i] = rpcTag->getSampleNumeratorCoeff(i).toFloat64();
+         theSampDenCoef[i] = rpcTag->getSampleDenominatorCoeff(i).toFloat64();
+      }
+
+      // Initialize other items in tags:
+      theLineScale  = rpcTag->getLineScale().toFloat64();
+      theSampScale  = rpcTag->getSampleScale().toFloat64();
+      theLatScale   = rpcTag->getGeodeticLatScale().toFloat64();
+      theLonScale   = rpcTag->getGeodeticLonScale().toFloat64();
+      theHgtScale   = rpcTag->getGeodeticHeightScale().toFloat64();
+      theLineOffset = rpcTag->getLineOffset().toFloat64();
+      theSampOffset = rpcTag->getSampleOffset().toFloat64();
+      theLatOffset  = rpcTag->getGeodeticLatOffset().toFloat64();
+      theLonOffset  = rpcTag->getGeodeticLonOffset().toFloat64();
+      theHgtOffset  = rpcTag->getGeodeticHeightOffset().toFloat64();
+      theImageID    = ih->getImageId();
+   }
+
+   finishConstruction();
+   clearErrorStatus();
+   return true;
+}
+
+//*************************************************************************************************
+//! Parses a tagged TIFF image file for RPC info. Returns TRUE if successful.
+//*************************************************************************************************
+bool ossimQuickbirdRpcModel::parseTiffFile(const ossimFilename& file)
+{
+   setErrorStatus();
+
+   // Make the gsd nan so it gets computed.
+   theGSD.makeNan();
+
+   ossimFilename tiffFile = file;
+   ossimRefPtr<ossimTiffTileSource> tiff = new ossimTiffTileSource();
+   if (!tiff->open(file))
+   {
+      return false;
+   }
+
+   theImageClipRect = tiff->getImageRectangle();
+
+   parseMetaData(file);
+
+   if (!parseRpcData(file))
+      return false;
+
+   if (!parseTileData(file))
+      return false;
+
+   finishConstruction();
+   clearErrorStatus();
+   return true;
+}
+
+//*************************************************************************************************
+//! Given some base name for the image data, parses the associated RPC data file. Returns TRUE
+//! if successful
+//*************************************************************************************************
+bool ossimQuickbirdRpcModel::parseRpcData(const ossimFilename& base_name)
+{
+   ossimFilename rpcFile (base_name);
+
+   // There are two possibilities for RPC data files: either each image file has its own RPC data
+   // file, or a single RPC file is provided for a multi-tile scene.
+   rpcFile.setExtension("RPB");
+   if (!findSupportFile(rpcFile))
+   {
+      rpcFile.setExtension("RPA");
+      if (!findSupportFile(rpcFile))
+         return false;
+   }
+
+   // An RPC file was located, open it:
+   ossimQuickbirdRpcHeader hdr;
+   if(!hdr.open(rpcFile))
+      return false;
+
+   if(hdr.isAPolynomial())
+      thePolyType = A;
+   else
+      thePolyType = B;
+
+   std::copy(hdr.theLineNumCoeff.begin(), hdr.theLineNumCoeff.end(), theLineNumCoef);
+   std::copy(hdr.theLineDenCoeff.begin(), hdr.theLineDenCoeff.end(), theLineDenCoef);
+   std::copy(hdr.theSampNumCoeff.begin(), hdr.theSampNumCoeff.end(), theSampNumCoef);
+   std::copy(hdr.theSampDenCoeff.begin(), hdr.theSampDenCoeff.end(), theSampDenCoef);
+
+   theLineScale  = hdr.theLineScale;
+   theSampScale  = hdr.theSampScale;
+   theLatScale   = hdr.theLatScale;
+   theLonScale   = hdr.theLonScale;
+   theHgtScale   = hdr.theHeightScale;
+   theLineOffset = hdr.theLineOffset;
+   theSampOffset = hdr.theSampOffset;
+   theLatOffset  = hdr.theLatOffset;
+   theLonOffset  = hdr.theLonOffset;
+   theHgtOffset  = hdr.theHeightOffset;
+   theImageID    = rpcFile.fileNoExtension();
+
+   return true;
+}
+
+
+//*************************************************************************************************
+//! Initializes the support data member with metadata file info. Returns TRUE if successful
+//*************************************************************************************************
+bool ossimQuickbirdRpcModel::parseMetaData(const ossimFilename& base_name)
+{
+
+   ossimFilename metadataFile (base_name);
+   metadataFile.setExtension("IMD");
+   if (!findSupportFile(metadataFile))
+      return false;
+
+   if ( !theSupportData.valid() )
+      theSupportData = new ossimQuickbirdMetaData();
+
+   if(!theSupportData->open(metadataFile))
+   {
+      theSupportData = 0; // ossimRefPtr
+#if 0 /* This should be wrapped in trace. drb */
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimQuickbirdRpcModel::parseMetaData WARNING:"
+         << "\nCould not open IMD file.  Sensor ID unknown." << std::endl;
+#endif
+      return false;
+   }
+
+   theSensorID = theSupportData->getSatID();
+   return true;
+}
+
+//*************************************************************************************************
+//! Reads the TIL file for pertinent info. Returns TRUE if successful
+//*************************************************************************************************
+bool ossimQuickbirdRpcModel::parseTileData(const ossimFilename& image_file)
+{
+   ossimFilename tileFile (image_file);
+   tileFile.setExtension("TIL");
+  if (!findSupportFile(tileFile))
+      return false;
+   ossimQuickbirdTile tileHdr;
+   if(!tileHdr.open(tileFile))
+      return false;
+
+   ossimQuickbirdTileInfo info;
+   if(!tileHdr.getInfo(info, image_file.file()))
+      return false;
+   if((info.theUlXOffset != OSSIM_INT_NAN) && (info.theUlYOffset != OSSIM_INT_NAN) &&
+      (info.theLrXOffset != OSSIM_INT_NAN) && (info.theLrYOffset != OSSIM_INT_NAN) &&
+      (info.theLlXOffset != OSSIM_INT_NAN) && (info.theLlYOffset != OSSIM_INT_NAN) &&
+      (info.theUrXOffset != OSSIM_INT_NAN) && (info.theUrYOffset != OSSIM_INT_NAN))
+   {
+      theImageClipRect = ossimIrect(ossimIpt(info.theUlXOffset, info.theUlYOffset),
+                                    ossimIpt(info.theUrXOffset, info.theUrYOffset),
+                                    ossimIpt(info.theLrXOffset, info.theLrYOffset),
+                                    ossimIpt(info.theLlXOffset, info.theLlYOffset));
+   }
+   else if ((info.theUlXOffset != OSSIM_INT_NAN) && (info.theUlYOffset != OSSIM_INT_NAN) &&
+      (theImageClipRect.width() != OSSIM_INT_NAN) && (theImageClipRect.height() != OSSIM_INT_NAN))
+   {
+      theImageClipRect = ossimIrect(info.theUlXOffset, info.theUlYOffset,
+                                    info.theUlXOffset+theImageClipRect.width()-1, 
+                                    info.theUlYOffset+theImageClipRect.height()-1);
+   }
+
+   return true;
+}
+
+//*************************************************************************************************
+//! Collects common code among all parsers
+//*************************************************************************************************
+void ossimQuickbirdRpcModel::finishConstruction()
+{
+   theImageSize.line = theImageClipRect.height();
+   theImageSize.samp = theImageClipRect.width();
+   theRefImgPt.line = theImageClipRect.midPoint().y;
+   theRefImgPt.samp = theImageClipRect.midPoint().x;
+   theRefGndPt.lat = theLatOffset;
+   theRefGndPt.lon = theLonOffset;
+   theRefGndPt.hgt = theHgtOffset;
+
+   //---
+   // NOTE:  We must call "updateModel()" to set parameter used by base
+   // ossimRpcModel prior to calling lineSampleHeightToWorld or all
+   // the world points will be same.
+   //---
+   updateModel();
+
+   ossimGpt v0, v1, v2, v3;
+   lineSampleHeightToWorld(theImageClipRect.ul(), theHgtOffset, v0);
+   lineSampleHeightToWorld(theImageClipRect.ur(), theHgtOffset, v1);
+   lineSampleHeightToWorld(theImageClipRect.lr(), theHgtOffset, v2);
+   lineSampleHeightToWorld(theImageClipRect.ll(), theHgtOffset, v3);
+
+   theBoundGndPolygon = ossimPolygon (ossimDpt(v0), ossimDpt(v1), ossimDpt(v2), ossimDpt(v3));
+
+   // Set the ground reference point using the model.
+   lineSampleHeightToWorld(theRefImgPt, theHgtOffset, theRefGndPt);
+
+   if( theGSD.hasNans() )
+   {
+      try
+      {
+         // This will set theGSD and theMeanGSD. Method throws ossimException.
+         computeGsd();
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimQuickbirdRpcModel::finishConstruction -- caught exception:\n"
+            << e.what() << std::endl;
+      }
+   }
+}
+
+bool ossimQuickbirdRpcModel::saveState(ossimKeywordlist& kwl,
+                                       const char* prefix) const
+{
+   // sanity check only.  This shoulc always be true
+   if(theSupportData.valid())
+   {
+      ossimString supportPrefix = ossimString(prefix) + "support_data.";
+      theSupportData->saveState(kwl, supportPrefix);
+   }
+
+   return ossimRpcModel::saveState(kwl, prefix);
+}
+
+bool ossimQuickbirdRpcModel::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   // sanity check only.  This shoulc always be true
+   if(theSupportData.valid())
+   {
+      ossimString supportPrefix = ossimString(prefix) + "support_data.";
+      theSupportData->loadState(kwl, supportPrefix);
+   }
+   return ossimRpcModel::loadState(kwl, prefix);
+}
+
+//*************************************************************************************************
+// Given an initial filename with case-agnostic extension, this method searches first for an
+// image-specific instance of that file (i.e., with R*C* in the filename) before considering
+// the mosaic-global support file (R*C* removed). If a file is found, the argument is modified to
+// match the actual filename and TRUE is returned. Otherwise, argument filename is left unchanged
+// and FALSE is returned.
+//*************************************************************************************************
+bool ossimQuickbirdRpcModel::findSupportFile(ossimFilename& filename) const
+{
+   ossimFilename f (filename);
+   ossimString extension = f.ext();
+   if(f.exists())
+   {
+      filename = f;
+      return true;
+   }
+   // Search for support file with same basename as image:
+   extension.upcase();
+   f.setExtension(extension);
+   if(f.exists())
+   {
+      filename = f;
+      return true;
+   }
+   extension.downcase();
+   if(f.exists())
+   {
+      filename = f;
+      return true;
+   }
+
+   // None found so far, search for mosaic-global support file:
+   f = f.replaceAllThatMatch("_R[0-9]+C[0-9]+");
+   if(f.exists())
+   {
+      filename = f;
+      return true;
+   }
+  extension.upcase();
+   f.setExtension(extension);
+   if(f.exists())
+   {
+      filename = f;
+      return true;
+   }
+
+
+   // Modify argument to match good filename:
+   return false;
+}
diff --git a/ossim/src/ossim/projection/ossimRS1SarModel.cpp b/src/projection/ossimRS1SarModel.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimRS1SarModel.cpp
rename to src/projection/ossimRS1SarModel.cpp
diff --git a/ossim/src/ossim/projection/ossimRadialDecentLensDistortion.cpp b/src/projection/ossimRadialDecentLensDistortion.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimRadialDecentLensDistortion.cpp
rename to src/projection/ossimRadialDecentLensDistortion.cpp
diff --git a/src/projection/ossimRpcModel.cpp b/src/projection/ossimRpcModel.cpp
new file mode 100644
index 0000000..2f8a58f
--- /dev/null
+++ b/src/projection/ossimRpcModel.cpp
@@ -0,0 +1,1399 @@
+//*****************************************************************************
+// FILE: ossimRpcModel.cpp
+//
+// License:  See top level LICENSE.txt file.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION: Contains implementation of class ossimRpcModel.
+//   This is a replacement model utilizing the Rational Polynomial Coefficients
+//   (RPC), a.k.a. Rapid Positioning Capability, and Universal Sensor Model
+//   (USM).
+//
+// LIMITATIONS: Does not support parameter adjustment (YET)
+//
+//*****************************************************************************
+//  $Id: ossimRpcModel.cpp 23670 2015-12-18 22:33:12Z dburken $
+
+#include <ossim/projection/ossimRpcModel.h>
+#include <ossim/elevation/ossimElevManager.h>
+
+RTTI_DEF1(ossimRpcModel, "ossimRpcModel", ossimSensorModel);
+
+#include <ossim/elevation/ossimHgtRef.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <iostream>
+#include <algorithm>
+#include <iomanip>
+#include <sstream>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimRpcModel:exec");
+static ossimTrace traceDebug ("ossimRpcModel:debug");
+
+//static const int    MODEL_VERSION_NUMBER  = 1;
+static const int    NUM_COEFFS        = 20;
+static const char*  MODEL_TYPE        = "ossimRpcModel";
+static const char*  POLY_TYPE_KW      = "polynomial_format";
+static const char*  LINE_SCALE_KW     = "line_scale";
+static const char*  SAMP_SCALE_KW     = "samp_scale";
+static const char*  LAT_SCALE_KW      = "lat_scale";
+static const char*  LON_SCALE_KW      = "long_scale";
+static const char*  HGT_SCALE_KW      = "height_scale";
+static const char*  LINE_OFFSET_KW    = "line_off";
+static const char*  SAMP_OFFSET_KW    = "samp_off";
+static const char*  LAT_OFFSET_KW     = "lat_off";
+static const char*  LON_OFFSET_KW     = "long_off";
+static const char*  HGT_OFFSET_KW     = "height_off";
+
+static const char*  BIAS_ERROR_KW     = "bias_error";
+static const char*  RAND_ERROR_KW     = "rand_error";
+
+static const char*  LINE_NUM_COEF_KW  = "line_num_coeff_";
+static const char*  LINE_DEN_COEF_KW  = "line_den_coeff_";
+static const char*  SAMP_NUM_COEF_KW  = "samp_num_coeff_";
+static const char*  SAMP_DEN_COEF_KW  = "samp_den_coeff_";
+
+static const ossimString PARAM_NAMES[] ={"intrack_offset",
+                                        "crtrack_offset",
+                                        "intrack_scale",
+                                        "crtrack_scale",
+                                        "map_rotation",
+                                        "yaw_offset"};
+static const ossimString PARAM_UNITS[] ={"pixel",
+                                        "pixel",
+                                        "scale",
+                                        "scale",
+                                        "degrees",
+                                        "degrees"};
+      
+//*****************************************************************************
+//  DEFAULT CONSTRUCTOR: ossimRpcModel()
+//  
+//*****************************************************************************
+ossimRpcModel::ossimRpcModel()
+   :  ossimSensorModel(),
+      thePolyType     (A),
+      theLineScale    (0.0),
+      theSampScale    (0.0),
+      theLatScale     (0.0),
+      theLonScale     (0.0),
+      theHgtScale     (0.0),
+      theLineOffset   (0.0),
+      theSampOffset   (0.0),
+      theLatOffset    (0.0),
+      theLonOffset    (0.0),
+      theHgtOffset    (0.0),
+      theIntrackOffset(0.0),
+      theCrtrackOffset(0.0),
+      theIntrackScale (0.0),
+      theCrtrackScale (0.0),
+      theCosMapRot    (0.0),
+      theSinMapRot    (0.0),
+      theBiasError    (0.0),
+      theRandError    (0.0)
+
+{
+   initAdjustableParameters();
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: ossimRpcModel(ossimRpcModel)
+//  
+//*****************************************************************************
+ossimRpcModel::ossimRpcModel(const ossimRpcModel& model)
+   :
+      ossimSensorModel(model),
+      thePolyType     (model.thePolyType),
+      theLineScale    (model.theLineScale),
+      theSampScale    (model.theSampScale),
+      theLatScale     (model.theLatScale),
+      theLonScale     (model.theLonScale),
+      theHgtScale     (model.theHgtScale),
+      theLineOffset   (model.theLineOffset),
+      theSampOffset   (model.theSampOffset),
+      theLatOffset    (model.theLatOffset),
+      theLonOffset    (model.theLonOffset),
+      theHgtOffset    (model.theHgtOffset),
+      theIntrackOffset(model.theIntrackOffset),
+      theCrtrackOffset(model.theCrtrackOffset),
+      theIntrackScale(model.theIntrackScale),
+      theCrtrackScale(model.theCrtrackScale),
+      theCosMapRot    (model.theCosMapRot),
+      theSinMapRot    (model.theSinMapRot),
+      theBiasError    (model.theBiasError),
+      theRandError    (model.theRandError)
+{
+   for (int i=0; i<20; ++i  )
+   {
+      theLineNumCoef[i] = model.theLineNumCoef[i];
+      theLineDenCoef[i] = model.theLineDenCoef[i];
+      theSampNumCoef[i] = model.theSampNumCoef[i];
+      theSampDenCoef[i] = model.theSampDenCoef[i];
+   }
+}
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimRpcModel()
+//  
+//*****************************************************************************
+ossimRpcModel::~ossimRpcModel()
+{
+}
+
+void ossimRpcModel::setAttributes(ossim_float64 sampleOffset,
+                                  ossim_float64 lineOffset,
+                                  ossim_float64 sampleScale,
+                                  ossim_float64 lineScale,
+                                  ossim_float64 latOffset,
+                                  ossim_float64 lonOffset,
+                                  ossim_float64 heightOffset,
+                                  ossim_float64 latScale,
+                                  ossim_float64 lonScale,
+                                  ossim_float64 heightScale,
+                                  const std::vector<double>& xNumeratorCoeffs,
+                                  const std::vector<double>& xDenominatorCoeffs,
+                                  const std::vector<double>& yNumeratorCoeffs,
+                                  const std::vector<double>& yDenominatorCoeffs,
+                                  PolynomialType polyType,
+                                  bool computeGsdFlag)
+{
+   thePolyType = polyType;
+   
+   theLineScale  = lineScale;
+   theSampScale  = sampleScale;
+   theLatScale   = latScale;
+   theLonScale   = lonScale;
+   theHgtScale   = heightScale;
+   theLineOffset = lineOffset;
+   theSampOffset = sampleOffset;
+   theLatOffset  = latOffset;
+   theLonOffset  = lonOffset;
+   theHgtOffset  = heightOffset;
+
+   if(xNumeratorCoeffs.size() == 20)
+   {
+      std::copy(xNumeratorCoeffs.begin(),
+                xNumeratorCoeffs.end(),
+                theSampNumCoef);
+   }
+   if(xDenominatorCoeffs.size() == 20)
+   {
+      std::copy(xDenominatorCoeffs.begin(),
+                xDenominatorCoeffs.end(),
+                theSampDenCoef);
+   }
+   if(yNumeratorCoeffs.size() == 20)
+   {
+      std::copy(yNumeratorCoeffs.begin(),
+                yNumeratorCoeffs.end(),
+                theLineNumCoef);
+   }
+   if(yDenominatorCoeffs.size() == 20)
+   {
+      std::copy(yDenominatorCoeffs.begin(),
+                yDenominatorCoeffs.end(),
+                theLineDenCoef);
+   }
+
+   if(computeGsdFlag)
+   {
+      try
+      {
+         // This will set theGSD and theMeanGSD. Method throws ossimException.
+         computeGsd();
+      }
+      catch (const ossimException& e)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimRpcModel::setAttributes Caught Exception:\n"
+               << e.what() << std::endl;
+         }
+      }
+   }
+}
+
+void ossimRpcModel::setMetersPerPixel(const ossimDpt& metersPerPixel)
+{
+   theGSD = metersPerPixel;
+   theMeanGSD = (theGSD.x+theGSD.y)*.5;
+}
+
+void ossimRpcModel::setPositionError(const ossim_float64& biasError,
+                                     const ossim_float64& randomError,
+                                     bool initNominalPostionErrorFlag)
+{
+   theBiasError = biasError;
+   theRandError = randomError;
+   if (initNominalPostionErrorFlag)
+   {
+      theNominalPosError = sqrt(theBiasError*theBiasError +
+                                theRandError*theRandError); // meters
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcModel::worldToLineSample()
+//  
+//  Overrides base class implementation. Directly computes line-sample from
+//  the polynomials.
+//*****************************************************************************
+void ossimRpcModel::worldToLineSample(const ossimGpt& ground_point,
+                                      ossimDpt&       img_pt) const
+{
+   // if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::worldToLineSample(): entering..." << std::endl;
+
+   if(ground_point.isLatNan() || ground_point.isLonNan() )
+   {
+      img_pt.makeNan();
+      return;
+   }
+
+   //***
+   // First check if the world point is inside bounding rectangle:
+   //***
+   //ossimDpt wdp (ground_point);
+    //if (!(theBoundGndPolygon.pointWithin(ground_point)))
+   // {
+      //img_pt = extrapolate(ground_point);
+       //if (traceExec())  CLOG << "returning..." << endl;
+   //   img_pt.makeNan();
+   //    return;
+   // }
+         
+   //***
+   // Normalize the lat, lon, hgt:
+   //***
+   double nlat = (ground_point.lat - theLatOffset) / theLatScale;
+   double nlon = (ground_point.lon - theLonOffset) / theLonScale;
+   double nhgt;
+
+   if( ground_point.isHgtNan() )
+   {
+      // nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
+      nhgt = ( - theHgtOffset) / theHgtScale;
+   }
+   else
+   {
+      nhgt = (ground_point.hgt - theHgtOffset) / theHgtScale;
+   }
+
+   //***
+   // Compute the adjusted, normalized line (U) and sample (V):
+   //***
+   double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
+   double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
+   double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
+   double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
+   double U_rot  = Pu / Qu;
+   double V_rot  = Pv / Qv;
+
+   //***
+   // U, V are normalized quantities. Need now to establish the image file
+   // line and sample. First, back out the adjustable parameter effects
+   // starting with rotation:
+   //***
+   double U = U_rot*theCosMapRot + V_rot*theSinMapRot;
+   double V = V_rot*theCosMapRot - U_rot*theSinMapRot;
+
+   //***
+   // Now back out skew, scale, and offset adjustments:
+   //***
+   img_pt.line = U*(theLineScale+theIntrackScale) + theLineOffset + theIntrackOffset;
+   
+   img_pt.samp = V*(theSampScale+theCrtrackScale) + theSampOffset + theCrtrackOffset;
+
+   // if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::worldToLineSample(): returning..." << std::endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcModel::lineSampleToWorld()
+//  
+//  Overrides base class implementation. Performs DEM intersection.
+//*****************************************************************************
+void  ossimRpcModel::lineSampleToWorld(const ossimDpt& imagePoint,
+                                       ossimGpt&       worldPoint) const
+{
+
+//---
+// Under debate... (drb 20130610)
+// this seems to be more accurate for the round trip
+//---   
+#if 0
+   if(!imagePoint.hasNans())
+   {
+      
+      lineSampleHeightToWorld(imagePoint,
+                              worldPoint.height(),
+                              worldPoint);
+   }
+   else
+   {
+      worldPoint.makeNan();
+   }
+#else
+   if(!imagePoint.hasNans())
+   {
+      ossimEcefRay ray;
+      imagingRay(imagePoint, ray);
+      ossimElevManager::instance()->intersectRay(ray, worldPoint);
+   }
+   else
+   {
+      worldPoint.makeNan();
+   }
+#endif
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcModel::imagingRay()
+//  
+//  Constructs an RPC ray by intersecting 2 ellipsoid heights above and
+//  below the RPC height offset, and then forming a vector between the two.
+//
+//*****************************************************************************
+void ossimRpcModel::imagingRay(const ossimDpt& imagePoint,
+                               ossimEcefRay&   imageRay) const
+{
+   //---
+   // For "from point", "to point" we want the image ray to be from above the
+   // ellipsoid down to Earth.
+   // 
+   // It appears the ray "from point" must be above the ellipsiod for the
+   // ossimElevSource::intersectRay method; ultimately, the
+   // ossimEllipsoid::nearestIntersection method, else it goes off in the
+   // weeds...
+   //---
+
+// this one is messed up so keep as #if 0 untill tested more
+  #if 0 
+
+  ossimGpt gpt;
+
+ lineSampleHeightToWorld(imagePoint, theHgtOffset, gpt);
+
+ //lineSampleHeightToWorld(imagePoint, ossim::nan(), gpt);
+
+  ossimEcefVector v;
+  if(gpt.datum())
+  {
+    if(gpt.datum()->ellipsoid())
+    {
+      gpt.datum()->ellipsoid()->gradient(ossimEcefPoint(gpt), v);
+
+      v = v.unitVector();
+
+      ossimEcefPoint intECFto(gpt);
+      ossimEcefPoint intECFfrom = (intECFto + v*100000);
+
+      ossimEcefRay ray(intECFfrom, intECFto);
+
+      imageRay = ray;
+    }
+  }
+#else
+   double vectorLength = theHgtScale ? (theHgtScale * 2.0) : 1000.0;
+
+   ossimGpt gpt;
+   
+   // "from" point
+   double intHgt = theHgtOffset + vectorLength;
+   lineSampleHeightToWorld(imagePoint, intHgt, gpt);
+   ossimEcefPoint intECFfrom(gpt);
+   
+   // "to" point
+   lineSampleHeightToWorld(imagePoint, theHgtOffset, gpt);
+   ossimEcefPoint intECFto(gpt);
+   
+   // Construct ray
+   ossimEcefRay ray(intECFfrom, intECFto);
+   
+   imageRay = ray;
+
+   #endif
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimRpcModel::lineSampleHeightToWorld()
+//  
+//  Performs reverse projection of image line/sample to ground point.
+//  The imaging ray is intersected with a level plane at height = elev.
+//
+//  NOTE: U = line, V = sample -- this differs from the convention.
+//
+//*****************************************************************************
+void ossimRpcModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                            const double&   ellHeight,
+                                            ossimGpt&       gpt) const
+{
+   // if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG)
+   // << "DEBUG ossimRpcModel::lineSampleHeightToWorld: entering..." << std::endl;
+
+   //---
+   // Removed below "gpt.makeNan()" if outside of image.  This was put in
+   // troubleshooting dateline wrap issues.  Returned nans are also
+   // causing issues so commenting out.  drb - 17 Dec. 2015
+   //---
+
+   //***
+   // Extrapolate if point is outside image:
+   //***
+   // if (!insideImage(image_point))
+   // {
+   //    gpt = extrapolate(image_point, ellHeight);
+   //    if (traceExec())  CLOG << "returning..." << endl;
+   //    return;
+   // }
+
+   //***
+   // Constants for convergence tests:
+   //***
+   static const int    MAX_NUM_ITERATIONS  = 10;
+   static const double CONVERGENCE_EPSILON = 0.1;  // pixels
+   
+   //***
+   // The image point must be adjusted by the adjustable parameters as well
+   // as the scale and offsets given as part of the RPC param normalization.
+   //
+   //      NOTE: U = line, V = sample
+   //***
+   double U    = (image_point.y-theLineOffset - theIntrackOffset) / (theLineScale+theIntrackScale);
+   double V    = (image_point.x-theSampOffset - theCrtrackOffset) / (theSampScale+theCrtrackScale);
+
+   //***
+   // Rotate the normalized U, V by the map rotation error (adjustable param):
+   //***
+   double U_rot = theCosMapRot*U - theSinMapRot*V;
+   double V_rot = theSinMapRot*U + theCosMapRot*V;
+   U = U_rot; V = V_rot;
+
+
+   // now apply adjust intrack and cross track
+   //***
+   // Initialize quantities to be used in the iteration for ground point:
+   //***
+   double nlat      = 0.0;  // normalized latitude
+   double nlon      = 0.0;  // normalized longitude
+   
+   double nhgt;
+
+   if(ossim::isnan(ellHeight))
+   {
+     nhgt = (theHgtScale - theHgtOffset) / theHgtScale;  // norm height
+   }
+   else
+   {
+      nhgt = (ellHeight - theHgtOffset) / theHgtScale;  // norm height
+   }
+   
+   double epsilonU = CONVERGENCE_EPSILON/(theLineScale+theIntrackScale);
+   double epsilonV = CONVERGENCE_EPSILON/(theSampScale+theCrtrackScale);
+   int    iteration = 0;
+
+   //***
+   // Declare variables only once outside the loop. These include:
+   // * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
+   // * partial derivatives of polynomials wrt X, Y,
+   // * computed normalized image point: Uc, Vc,
+   // * residuals of normalized image point: deltaU, deltaV,
+   // * partial derivatives of Uc and Vc wrt X, Y,
+   // * corrections to normalized lat, lon: deltaLat, deltaLon.
+   //***
+   double Pu, Qu, Pv, Qv;
+   double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
+   double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
+   double Uc, Vc;
+   double deltaU, deltaV;
+   double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
+   double deltaLat, deltaLon;
+   
+   //***
+   // Now iterate until the computed Uc, Vc is within epsilon of the desired
+   // image point U, V:
+   //***
+   do
+   {
+      //***
+      // Calculate the normalized line and sample Uc, Vc as ratio of
+      // polynomials Pu, Qu and Pv, Qv:
+      //***
+      Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
+      Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
+      Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
+      Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
+      Uc = Pu/Qu;
+      Vc = Pv/Qv;
+      
+      //***
+      // Compute residuals between desired and computed line, sample:
+      //***
+      deltaU = U - Uc;
+      deltaV = V - Vc;
+      
+      //***
+      // Check for convergence and skip re-linearization if converged:
+      //***
+      if ((fabs(deltaU) > epsilonU) || (fabs(deltaV) > epsilonV))
+      {
+         //***
+         // Analytically compute the partials of each polynomial wrt lat, lon:
+         //***
+         dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
+         dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
+         dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
+         dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
+         dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
+         dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
+         dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
+         dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
+         
+         //***
+         // Analytically compute partials of quotients U and V wrt lat, lon: 
+         //***
+         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
+         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
+         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
+         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
+         
+         W = dU_dLon*dV_dLat - dU_dLat*dV_dLon;
+         
+         //***
+         // Now compute the corrections to normalized lat, lon:
+         //***
+         deltaLat = (dU_dLon*deltaV - dV_dLon*deltaU) / W;
+         deltaLon = (dV_dLat*deltaU - dU_dLat*deltaV) / W;
+         nlat += deltaLat;
+         nlon += deltaLon;
+      }
+      
+      //double h = ossimElevManager::instance()->getHeightAboveEllipsoid(ossimGpt(nlat, nlon));
+     // if(!ossim::isnan(h))
+     // {
+     //   nhgt = h;
+     // }
+
+      iteration++;
+      
+   } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
+            && (iteration < MAX_NUM_ITERATIONS));
+      
+   //***
+   // Test for exceeding allowed number of iterations. Flag error if so:
+   //***
+   if (iteration == MAX_NUM_ITERATIONS)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimRpcModel::lineSampleHeightToWorld: \nMax number of iterations reached in ground point "
+                                         << "solution. Results are inaccurate." << endl;
+   }
+
+   //***
+   // Now un-normalize the ground point lat, lon and establish return quantity:
+   //***
+   gpt.lat = nlat*theLatScale + theLatOffset;
+   gpt.lon = nlon*theLonScale + theLonOffset;
+   gpt.hgt = ellHeight;
+   
+}
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimRpcModel::polynomial
+//  
+//  Computes polynomial.
+//  
+//*****************************************************************************
+double ossimRpcModel::polynomial(const double& P, const double& L,
+                                 const double& H, const double* c) const
+{
+   double r;
+
+   if (thePolyType == A)
+   {
+      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
+          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*P*H +
+          c[ 8]*L*L   + c[ 9]*P*P   + c[10]*H*H   + c[11]*L*L*L +
+          c[12]*L*L*P + c[13]*L*L*H + c[14]*L*P*P + c[15]*P*P*P +
+          c[16]*P*P*H + c[17]*L*H*H + c[18]*P*H*H + c[19]*H*H*H;
+   }
+   else
+   {
+      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
+          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*L   +
+          c[ 8]*P*P   + c[ 9]*H*H   + c[10]*L*P*H + c[11]*L*L*L +
+          c[12]*L*P*P + c[13]*L*H*H + c[14]*L*L*P + c[15]*P*P*P +
+          c[16]*P*H*H + c[17]*L*L*H + c[18]*P*P*H + c[19]*H*H*H;
+   }
+   
+   return r;
+}
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimRpcModel::dPoly_dLat
+//  
+//  Computes derivative of polynomial wrt normalized Latitude P.
+//  
+//*****************************************************************************
+double ossimRpcModel::dPoly_dLat(const double& P, const double& L,
+                                 const double& H, const double* c) const
+{
+   double dr;
+
+   if (thePolyType == A)
+   {
+      dr = c[2] + c[4]*L + c[6]*H + c[7]*L*H + 2*c[9]*P + c[12]*L*L +
+           2*c[14]*L*P + 3*c[15]*P*P +2*c[16]*P*H + c[18]*H*H;
+   }
+   else
+   {
+      dr = c[2] + c[4]*L + c[6]*H + 2*c[8]*P + c[10]*L*H + 2*c[12]*L*P +
+           c[14]*L*L + 3*c[15]*P*P + c[16]*H*H + 2*c[18]*P*H;
+   }
+   
+   return dr;
+}
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimRpcModel::dPoly_dLon
+//  
+//  Computes derivative of polynomial wrt normalized Longitude L.
+//  
+//*****************************************************************************
+double ossimRpcModel::dPoly_dLon(const double& P, const double& L,
+                                 const double& H, const double* c) const
+{
+   double dr;
+
+   if (thePolyType == A)
+   {
+      dr = c[1] + c[4]*P + c[5]*H + c[7]*P*H + 2*c[8]*L + 3*c[11]*L*L +
+           2*c[12]*L*P + 2*c[13]*L*H + c[14]*P*P + c[17]*H*H;
+   }
+   else
+   {
+      dr = c[1] + c[4]*P + c[5]*H + 2*c[7]*L + c[10]*P*H + 3*c[11]*L*L +
+           c[12]*P*P + c[13]*H*H + 2*c[14]*P*L + 2*c[17]*L*H;
+   }
+   return dr;
+}
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimRpcModel::dPoly_dHgt
+//  
+//  Computes derivative of polynomial wrt normalized Height H.
+//  
+//*****************************************************************************
+double ossimRpcModel::dPoly_dHgt(const double& P, const double& L,
+                                 const double& H, const double* c) const
+{
+   double dr;
+
+   if (thePolyType == A)
+   {
+      dr = c[3] + c[5]*L + c[6]*P + c[7]*L*P + 2*c[10]*H + c[13]*L*L +
+           c[16]*P*P + 2*c[17]*L*H + 2*c[18]*P*H + 3*c[19]*H*H;
+   }
+   else
+   {
+      dr = c[3] + c[5]*L + c[6]*P + 2*c[9]*H + c[10]*L*P + 2*c[13]*L*H +
+           2*c[16]*P*H + c[17]*L*L + c[18]*P*P + 3*c[19]*H*H;
+   }
+   return dr;
+}
+
+void ossimRpcModel::updateModel()
+{
+   theIntrackOffset    = computeParameterOffset(INTRACK_OFFSET);
+   theCrtrackOffset    = computeParameterOffset(CRTRACK_OFFSET);
+   theIntrackScale     = computeParameterOffset(INTRACK_SCALE);
+   theCrtrackScale     = computeParameterOffset(CRTRACK_SCALE);
+   double mapRotation  = computeParameterOffset(MAP_ROTATION);
+   theCosMapRot        = ossim::cosd(mapRotation);
+   theSinMapRot        = ossim::sind(mapRotation);
+}
+
+void ossimRpcModel::initAdjustableParameters()
+{
+   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
+   int numParams = getNumberOfAdjustableParameters();
+   for (int i=0; i<numParams; i++)
+   {
+      setAdjustableParameter(i, 0.0);
+      setParameterDescription(i, PARAM_NAMES[i]);
+      setParameterUnit(i,PARAM_UNITS[i]);
+   }
+   setParameterSigma(INTRACK_OFFSET, 50.0);
+   setParameterSigma(CRTRACK_OFFSET, 50.0);
+   setParameterSigma(INTRACK_SCALE, 50.0);  
+   setParameterSigma(CRTRACK_SCALE, 50.0);  
+   setParameterSigma(MAP_ROTATION, 0.1);
+//   setParameterSigma(YAW_OFFSET, 0.001);
+}
+
+ossimObject* ossimRpcModel::dup() const
+{
+   return new ossimRpcModel(*this);
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcModel::print()
+//  
+//  Formatted dump of data members.
+//  
+//*****************************************************************************
+std::ostream& ossimRpcModel::print(std::ostream& out) const
+{
+   out << "\nDump of ossimRpcModel object at " << std::hex << this << std::dec << ":\n"
+       << POLY_TYPE_KW   << ": " << thePolyType   << "\n"
+       << LINE_SCALE_KW  << ": " << theLineScale  << "\n"
+       << SAMP_SCALE_KW  << ": " << theSampScale  << "\n"
+       << LAT_SCALE_KW   << ": " << theLatScale   << "\n"
+       << LON_SCALE_KW   << ": " << theLonScale   << "\n"
+       << HGT_SCALE_KW   << ": " << theHgtScale   << "\n"
+       << LINE_OFFSET_KW << ": " << theLineOffset << "\n"
+       << SAMP_OFFSET_KW << ": " << theSampOffset << "\n"
+       << LAT_OFFSET_KW  << ": " << theLatOffset  << "\n"
+       << LON_OFFSET_KW  << ": " << theLonOffset  << "\n"
+       << HGT_OFFSET_KW  << ": " << theHgtOffset  << "\n"
+       << BIAS_ERROR_KW  << ": " << theBiasError  << "\n"
+       << RAND_ERROR_KW  << ": " << theRandError  << "\n"
+       << std::endl;
+
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<LINE_NUM_COEF_KW<<"["<<i<<"]: "<<theLineNumCoef[i]<<std::endl;
+
+   out << std::endl;
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<LINE_DEN_COEF_KW<<"["<<i<<"]: "<<theLineDenCoef[i]<<std::endl;
+
+   out << std::endl;
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<SAMP_NUM_COEF_KW<<"["<<i<<"]: "<<theSampNumCoef[i]<<std::endl;
+
+   out << std::endl;
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<SAMP_DEN_COEF_KW<<"["<<i<<"]: "<<theSampDenCoef[i]<<std::endl;
+      
+   out << std::endl;
+
+   return ossimSensorModel::print(out);
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcModel::saveState()
+//  
+//  Saves the model state to the KWL. This KWL also serves as a geometry file.
+//  
+//*****************************************************************************
+bool ossimRpcModel::saveState(ossimKeywordlist& kwl,
+                              const char* prefix) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::saveState(): entering..." << std::endl;
+
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, MODEL_TYPE);
+
+   //***
+   // Hand off to base class for common stuff:
+   //***
+   ossimSensorModel::saveState(kwl, prefix);
+
+   //---
+   // Save off offsets and scales:
+   //---
+   kwl.add(prefix, POLY_TYPE_KW,   ((char)thePolyType));
+   kwl.add(prefix, LINE_SCALE_KW,  theLineScale);
+   kwl.add(prefix, SAMP_SCALE_KW,  theSampScale);
+   kwl.add(prefix, LAT_SCALE_KW,   theLatScale);
+   kwl.add(prefix, LON_SCALE_KW,   theLonScale);
+   kwl.add(prefix, HGT_SCALE_KW,   theHgtScale);
+   kwl.add(prefix, LINE_OFFSET_KW, theLineOffset);
+   kwl.add(prefix, SAMP_OFFSET_KW, theSampOffset);
+   kwl.add(prefix, LAT_OFFSET_KW,  theLatOffset);
+   kwl.add(prefix, LON_OFFSET_KW,  theLonOffset);
+   kwl.add(prefix, HGT_OFFSET_KW,  theHgtOffset);
+   kwl.add(prefix, BIAS_ERROR_KW,  theBiasError);
+   kwl.add(prefix, RAND_ERROR_KW,  theRandError);
+
+   for (int i=0; i<NUM_COEFFS; i++)
+   {
+      ossimString key;
+      std::ostringstream os;
+      os << setw(2) << setfill('0') << right << i;
+      
+      key = LINE_NUM_COEF_KW;
+      key += os.str();
+      kwl.add(prefix, key.c_str(), theLineNumCoef[i],
+              true, 15);
+      
+      key = LINE_DEN_COEF_KW;
+      key += os.str();
+      kwl.add(prefix, key.c_str(), theLineDenCoef[i],
+              true, 15);
+
+      key = SAMP_NUM_COEF_KW;
+      key += os.str();
+      kwl.add(prefix, key.c_str(), theSampNumCoef[i],
+              true, 15);
+
+      key = SAMP_DEN_COEF_KW;
+      key += os.str();
+      kwl.add(prefix, key.c_str(), theSampDenCoef[i],
+              true, 15);
+   }
+      
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::saveState(): returning..." << std::endl;
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcModel::loadState()
+//  
+//  Restores the model's state from the KWL. This KWL also serves as a
+//  geometry file.
+//  
+//*****************************************************************************
+bool ossimRpcModel::loadState(const ossimKeywordlist& kwl,
+                              const char* prefix) 
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimRpcModel::loadState(): entering..." << std::endl;
+   }
+
+   const char* value;
+   const char* keyword;
+
+   //***
+   // Pass on to the base-class for parsing first:
+   //***
+   bool success = ossimSensorModel::loadState(kwl, prefix);
+   if (!success)
+   {
+      theErrorStatus++;
+
+      if (traceExec())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimRpcModel::loadState(): returning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+      
+   //---
+   // Continue parsing for local members:
+   //---
+   value = kwl.find(prefix, BIAS_ERROR_KW);
+   if (value)
+   {
+      theBiasError = ossimString(value).toDouble();
+   }
+
+   value = kwl.find(prefix, RAND_ERROR_KW);
+   if (value)
+   {
+      theRandError = ossimString(value).toDouble();
+   }
+        
+   keyword = POLY_TYPE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   thePolyType = (PolynomialType) value[0];
+      
+   keyword = LINE_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLineScale = atof(value);
+   
+   keyword = SAMP_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theSampScale = atof(value);
+   
+   keyword = LAT_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLatScale = atof(value);
+   
+   keyword = LON_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLonScale = atof(value);
+   
+   keyword = HGT_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theHgtScale = atof(value);
+   
+   keyword = LINE_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLineOffset = atof(value);
+   
+   keyword = SAMP_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theSampOffset = atof(value);
+   
+   keyword = LAT_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLatOffset = atof(value);
+   
+   keyword = LON_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLonOffset = atof(value);
+   
+   keyword = HGT_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theHgtOffset = atof(value);
+
+   for (int i=0; i<NUM_COEFFS; i++)
+   {
+      ossimString keyword;
+      ostringstream os;
+      os << setw(2) << setfill('0') << right << i;
+
+      keyword = LINE_NUM_COEF_KW;
+      keyword += os.str();
+      value = kwl.find(prefix, keyword.c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+            << "<" << keyword << ">. Check the keywordlist for proper syntax."
+            << std::endl;
+         return false;
+      }
+      theLineNumCoef[i] = atof(value);
+
+      keyword = LINE_DEN_COEF_KW;
+      keyword += os.str();
+      value = kwl.find(prefix, keyword.c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                             << std::endl;
+         return false;
+      }
+      theLineDenCoef[i] = atof(value);
+   
+      keyword = SAMP_NUM_COEF_KW;
+      keyword += os.str();
+      value = kwl.find(prefix, keyword.c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                             << std::endl;
+         return false;
+      }
+      theSampNumCoef[i] = atof(value);
+
+      keyword = SAMP_DEN_COEF_KW;
+      keyword += os.str();
+      value = kwl.find(prefix, keyword.c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcModel::loadState(): Error encountered parsing the following required keyword: "
+                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                             << std::endl;
+         return false;
+      }
+      theSampDenCoef[i] = atof(value);
+   }
+      
+   //***
+   // Initialize other data members given quantities read in KWL:
+   //***
+   theCosMapRot = 1.0;
+   theSinMapRot = 0.0;
+
+   updateModel();
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::loadState(): returning..." << std::endl;
+   return true;
+}
+
+//*****************************************************************************
+// STATIC METHOD: ossimRpcModel::writeGeomTemplate
+//  
+//  Writes a sample kwl to output stream.
+//  
+//*****************************************************************************
+void ossimRpcModel::writeGeomTemplate(ostream& os)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(): entering..." << std::endl;
+
+   os <<
+      "//**************************************************************\n"
+      "// Template for RPC model keywordlist\n"
+      "//**************************************************************\n"
+      << ossimKeywordNames::TYPE_KW << ": " << MODEL_TYPE << endl;
+
+   ossimSensorModel::writeGeomTemplate(os);
+   
+   os << "//\n"
+      << "// Derived-class ossimRpcModel Keywords:\n"
+      << "//\n"
+      << POLY_TYPE_KW << ": A|B\n"
+      << "\n"
+      << "// RPC data consists of coefficients and normalization \n"
+      << "// parameters. The RPC keywords used here are compatible with \n"
+      << "// keywords found in Ikonos \"rpc.txt\" files.\n"
+      << "// First are the normalization parameters:\n"
+      << LINE_OFFSET_KW << ": <float>\n"
+      << SAMP_OFFSET_KW << ": <float>\n"
+      << LAT_OFFSET_KW << ": <float>\n"
+      << LON_OFFSET_KW << ": <float>\n"
+      << HGT_OFFSET_KW << ": <float>\n"
+      << LINE_SCALE_KW << ": <float>\n"
+      << SAMP_SCALE_KW << ": <float>\n"
+      << LAT_SCALE_KW << ": <float>\n"
+      << LON_SCALE_KW << ": <float>\n"
+      << HGT_SCALE_KW << ": <float>\n"
+      << BIAS_ERROR_KW << ": <float>\n"
+      << RAND_ERROR_KW << ": <float>\n"
+      << "\n"
+      << "// RPC Coefficients are specified with indexes. Coefficients \n "
+      << "// are specified for the four polynomials: line numerator, line \n"
+      << "// denominator, sample numerator, and sample denominator:" << endl;
+
+   for (int i=1; i<=20; i++)
+      os << LINE_NUM_COEF_KW << setw(2) << setfill('0') << right
+         << i << ": <float>" << endl; 
+   os << endl;
+   for (int i=1; i<=20; i++)
+      os << LINE_DEN_COEF_KW << setw(2) << setfill('0') << right
+         << i << ": <float>" << endl; 
+   os << endl;
+   for (int i=1; i<=20; i++)
+      os << SAMP_NUM_COEF_KW << setw(2) << setfill('0') << right
+         << i << ": <float>" << endl; 
+   os << endl;
+   for (int i=1; i<=20; i++)
+      os << SAMP_DEN_COEF_KW << setw(2) << setfill('0') << right
+         << i << ": <float>" << endl; 
+   os << "\n" <<endl;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcModel::writeGeomTemplate(): returning..." << std::endl;
+   return;
+}
+
+bool ossimRpcModel::setupOptimizer(const ossimString& init_file)
+{
+   ossimKeywordlist kwl;
+
+   if(kwl.addFile(ossimFilename(init_file)))
+   {
+      return loadState(kwl);
+   }
+   else
+   {
+      ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->createProjection(init_file);
+      if(proj.valid())
+      {
+         kwl.clear();
+         proj->saveState(kwl);
+         
+         return loadState(kwl);
+      }
+   }
+   
+   return false;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getForwardDeriv()
+//  
+//  Compute partials of samp/line WRT to ground.
+//  
+//*****************************************************************************
+ossimDpt ossimRpcModel::getForwardDeriv(int derivMode,
+                                        const ossimGpt& pos,
+                                        double h)
+{
+   // If derivMode (parmIdx) >= 0 call base class version
+   // for "adjustable parameters"
+   if (derivMode >= 0)
+   {
+      return ossimSensorModel::getForwardDeriv(derivMode, pos, h);
+   }
+   
+   // Use alternative derivMode definitions
+   else
+   {
+      ossimDpt returnData;
+
+      //******************************************
+      // OBS_INIT mode
+      //    [1] 
+      //    [2] 
+      //  Note: In this mode, pos is used to pass
+      //  in the (s,l) observations.
+      //******************************************
+      if (derivMode==OBS_INIT)
+      {
+         // Image coordinates
+         ossimDpt obs;
+         obs.samp = pos.latd();
+         obs.line = pos.lond();
+         theObs = obs;
+      }
+
+      //******************************************
+      // EVALUATE mode
+      //   [1] evaluate & save partials, residuals
+      //   [2] return residuals
+      //******************************************
+      else if (derivMode==EVALUATE)
+      {
+         //***
+         // Normalize the lat, lon, hgt:
+         //***
+         double nlat = (pos.lat - theLatOffset) / theLatScale;
+         double nlon = (pos.lon - theLonOffset) / theLonScale;
+         double nhgt;
+
+         if( ossim::isnan(pos.hgt) )
+         {
+            nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
+         }
+         else
+         {
+            nhgt = (pos.hgt - theHgtOffset) / theHgtScale;
+         }
+         
+         //***
+         // Compute the normalized line (Un) and sample (Vn):
+         //***
+         double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
+         double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
+         double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
+         double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
+         double Un  = Pu / Qu;
+         double Vn  = Pv / Qv;
+         
+         //***
+         // Compute the actual line (U) and sample (V):
+         //***
+         double U  = Un*theLineScale + theLineOffset;
+         double V  = Vn*theSampScale + theSampOffset;
+
+         //***
+         // Compute the partials of each polynomial wrt lat, lon, hgt
+         //***
+         double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
+         double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
+         double dPu_dHgt, dQu_dHgt, dPv_dHgt, dQv_dHgt;
+         dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
+         dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
+         dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
+         dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
+         dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
+         dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
+         dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
+         dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
+         dPu_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theLineNumCoef);
+         dQu_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theLineDenCoef);
+         dPv_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theSampNumCoef);
+         dQv_dHgt = dPoly_dHgt(nlat, nlon, nhgt, theSampDenCoef);
+         
+         //***
+         // Compute partials of quotients U and V wrt lat, lon, hgt 
+         //***
+         double dU_dLat, dU_dLon, dU_dHgt, dV_dLat, dV_dLon, dV_dHgt;
+         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
+         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
+         dU_dHgt = (Qu*dPu_dHgt - Pu*dQu_dHgt)/(Qu*Qu);
+         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
+         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
+         dV_dHgt = (Qv*dPv_dHgt - Pv*dQv_dHgt)/(Qv*Qv);
+         
+         //***
+         // Apply necessary scale factors 
+         //***
+        dU_dLat *= theLineScale/theLatScale;
+        dU_dLon *= theLineScale/theLonScale;
+        dU_dHgt *= theLineScale/theHgtScale;
+        dV_dLat *= theSampScale/theLatScale;
+        dV_dLon *= theSampScale/theLonScale;
+        dV_dHgt *= theSampScale/theHgtScale;
+
+        dU_dLat *= DEG_PER_RAD;
+        dU_dLon *= DEG_PER_RAD;
+        dV_dLat *= DEG_PER_RAD;
+        dV_dLon *= DEG_PER_RAD;
+
+         // Save the partials referenced to ECF
+         ossimEcefPoint location(pos);
+         NEWMAT::Matrix jMat(3,3);
+         pos.datum()->ellipsoid()->jacobianWrtEcef(location, jMat);
+         //  Line
+         theParWRTx.u = dU_dLat*jMat(1,1)+dU_dLon*jMat(2,1)+dU_dHgt*jMat(3,1);
+         theParWRTy.u = dU_dLat*jMat(1,2)+dU_dLon*jMat(2,2)+dU_dHgt*jMat(3,2);
+         theParWRTz.u = dU_dLat*jMat(1,3)+dU_dLon*jMat(2,3)+dU_dHgt*jMat(3,3);
+         //  Samp
+         theParWRTx.v = dV_dLat*jMat(1,1)+dV_dLon*jMat(2,1)+dV_dHgt*jMat(3,1);
+         theParWRTy.v = dV_dLat*jMat(1,2)+dV_dLon*jMat(2,2)+dV_dHgt*jMat(3,2);
+         theParWRTz.v = dV_dLat*jMat(1,3)+dV_dLon*jMat(2,3)+dV_dHgt*jMat(3,3);
+
+         // Residuals
+         ossimDpt resid(theObs.samp-V, theObs.line-U);
+         returnData = resid;
+      }
+
+      //******************************************
+      // P_WRT_X, P_WRT_Y, P_WRT_Z modes
+      //   [1] 3 separate calls required
+      //   [2] return 3 sets of partials
+      //******************************************
+      else if (derivMode==P_WRT_X)
+      {
+         returnData = theParWRTx;
+      }
+
+      else if (derivMode==P_WRT_Y)
+      {
+         returnData = theParWRTy;
+      }
+
+      else
+      {
+         returnData = theParWRTz;
+      }
+
+      return returnData;
+   }
+}
+
+double ossimRpcModel::getBiasError() const
+{
+   return theBiasError;
+}
+
+double ossimRpcModel::getRandError() const
+{
+   return theRandError;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getRpcParameters)
+//  
+//  Accessor for RPC parameter set.
+//  
+//*****************************************************************************
+void ossimRpcModel::getRpcParameters(ossimRpcModel::rpcModelStruct& model) const
+{
+   model.lineScale  = theLineScale;
+   model.sampScale  = theSampScale;
+   model.latScale   = theLatScale;
+   model.lonScale   = theLonScale;
+   model.hgtScale   = theHgtScale;
+   model.lineOffset = theLineOffset;
+   model.sampOffset = theSampOffset;
+   model.latOffset  = theLatOffset;
+   model.lonOffset  = theLonOffset;
+   model.hgtOffset  = theHgtOffset;
+   
+   for (int i=0; i<20; ++i)
+   {
+      model.lineNumCoef[i] = theLineNumCoef[i];
+      model.lineDenCoef[i] = theLineDenCoef[i];
+      model.sampNumCoef[i] = theSampNumCoef[i];
+      model.sampDenCoef[i] = theSampDenCoef[i];
+   }
+   
+   if (thePolyType == A)
+   {
+      model.type= 'A';
+   }
+   else
+   {
+      model.type= 'B';
+   }
+}
diff --git a/src/projection/ossimRpcProjection.cpp b/src/projection/ossimRpcProjection.cpp
new file mode 100644
index 0000000..435700e
--- /dev/null
+++ b/src/projection/ossimRpcProjection.cpp
@@ -0,0 +1,1393 @@
+//*****************************************************************************
+// FILE: ossimRpcModel.cc
+//
+// Copyright (C) 2004 Intelligence Data Systems.
+//
+// LGPL
+// 
+// AUTHOR: Garrett Potts
+//
+//*****************************************************************************
+//$Id: ossimRpcProjection.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimRpcProjection.h>
+#include <ossim/projection/ossimRpcSolver.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimEcefVector.h>
+#include <ossim/base/ossimTieGptSet.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+
+RTTI_DEF3(ossimRpcProjection, "ossimRpcProjection", ossimProjection, ossimOptimizableProjection,
+          ossimAdjustableParameterInterface);
+
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <cstdio>
+#include <fstream>
+#include <iostream>
+#include <algorithm>
+#include <ossim/matrix/newmatrc.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimRpcProjection:exec");
+static ossimTrace traceDebug ("ossimRpcProjection:debug");
+
+//static const int    MODEL_VERSION_NUMBER  = 1;
+static const int    NUM_COEFFS        = 20;
+static const char*  MODEL_TYPE        = "ossimRpcModel";
+static const char*  POLY_TYPE_KW      = "polynomial_format";
+static const char*  LINE_SCALE_KW     = "line_scale";
+static const char*  SAMP_SCALE_KW     = "samp_scale";
+static const char*  LAT_SCALE_KW      = "lat_scale";
+static const char*  LON_SCALE_KW      = "long_scale";
+static const char*  HGT_SCALE_KW      = "height_scale";
+static const char*  LINE_OFFSET_KW    = "line_off";
+static const char*  SAMP_OFFSET_KW    = "samp_off";
+static const char*  LAT_OFFSET_KW     = "lat_off";
+static const char*  LON_OFFSET_KW     = "long_off";
+static const char*  HGT_OFFSET_KW     = "height_off";
+static const char*  LINE_NUM_COEF_KW  = "line_num_coeff_";
+static const char*  LINE_DEN_COEF_KW  = "line_den_coeff_";
+static const char*  SAMP_NUM_COEF_KW  = "samp_num_coeff_";
+static const char*  SAMP_DEN_COEF_KW  = "samp_den_coeff_";
+
+static const ossim_int32 INTRACK_OFFSET = 0;
+static const ossim_int32 CRTRACK_OFFSET = 1;
+static const ossim_int32 INTRACK_SCALE  = 2;
+static const ossim_int32 CRTRACK_SCALE  = 3;
+static const ossim_int32 MAP_ROTATION   = 4;
+//static const ossim_int32 YAW_OFFSET;
+static const ossim_int32 NUM_ADJUSTABLE_PARAMS = 5;
+
+static const ossimString PARAM_NAMES[] ={"intrack_offset",
+                                        "crtrack_offset",
+                                        "intrack_scale",
+                                        "crtrack_scale",
+                                        "map_rotation",
+                                        "yaw_offset"};
+
+static const ossimString PARAM_UNITS[] ={"pixel",
+                                        "pixel",
+                                        "scale",
+                                        "scale",
+                                        "degrees",
+                                        "degrees"};
+
+//*****************************************************************************
+//  DEFAULT CONSTRUCTOR: ossimRpcModel()
+//  
+//*****************************************************************************
+ossimRpcProjection::ossimRpcProjection()
+   : ossimOptimizableProjection(),
+     theIntrackOffset(0),
+     theCrtrackOffset(0),
+     theIntrackScale(0.0),
+     theCrtrackScale(0.0),
+     theYawSkew   (0.0),
+     theCosMapRot (1.0),
+     theSinMapRot (0.0)
+
+ {
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Default Constructor: entering..." << std::endl;
+
+   initAdjustableParameters();
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Default Constructor: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: ossimRpcProjection(ossimRpcProjection)
+//  
+//*****************************************************************************
+ossimRpcProjection::ossimRpcProjection(const ossimRpcProjection& model)
+   :
+      ossimOptimizableProjection(model),
+      ossimAdjustableParameterInterface(model),
+      thePolyType     (model.thePolyType),
+      theLineScale    (model.theLineScale),
+      theSampScale    (model.theSampScale),
+      theLatScale     (model.theLatScale),
+      theLonScale     (model.theLonScale),
+      theHgtScale     (model.theHgtScale),
+      theLineOffset   (model.theLineOffset),
+      theSampOffset   (model.theSampOffset),
+      theLatOffset    (model.theLatOffset),
+      theLonOffset    (model.theLonOffset),
+      theHgtOffset    (model.theHgtOffset),
+      theIntrackOffset(model.theIntrackOffset),
+      theCrtrackOffset(model.theCrtrackOffset),
+      theIntrackScale(model.theIntrackScale),
+      theCrtrackScale(model.theCrtrackScale),
+      theYawSkew      (model.theYawSkew),
+      theCosMapRot    (model.theCosMapRot),
+      theSinMapRot    (model.theSinMapRot)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Copy Constructor: entering..." << std::endl;
+
+   for (int i=0; i<20; i++)
+   {
+      theLineNumCoef[i] = model.theLineNumCoef[i];
+      theLineDenCoef[i] = model.theLineDenCoef[i];
+      theSampNumCoef[i] = model.theSampNumCoef[i];
+      theSampDenCoef[i] = model.theSampDenCoef[i];
+   }
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection Copy Constructor: returning..." << std::endl;
+}
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimRpcProjection()
+//  
+//*****************************************************************************
+ossimRpcProjection::~ossimRpcProjection()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ~ossimRpcProjection() Destructor: entering..." << std::endl;
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimNotify(ossimNotifyLevel_DEBUG): returning..." << std::endl;
+}
+
+ossimObject* ossimRpcProjection::getBaseObject()
+{
+   return this;
+}
+
+const ossimObject* ossimRpcProjection::getBaseObject()const
+{
+   return this;
+}
+
+ossimRpcProjection& 
+ossimRpcProjection::operator=(const ossimRpcProjection& source)
+{
+   if (this != &source)
+   {
+      ossimOptimizableProjection::operator=(source);
+
+      thePolyType    = source.thePolyType;
+      theLineScale   = source.theLineScale;
+      theSampScale   = source.theSampScale;
+      theLatScale    = source.theLatScale;
+      theLonScale    = source.theLonScale;
+      theHgtScale    = source.theHgtScale;
+      theLineOffset  = source.theLineOffset;
+      theSampOffset  = source.theSampOffset;
+      theLatOffset   = source.theLatOffset;
+      theLonOffset   = source.theLonOffset;
+      theHgtOffset   = source.theHgtOffset;
+      for (int i=0; i<20; i++)
+      {
+         theLineNumCoef[i] = source.theLineNumCoef[i];
+         theLineDenCoef[i] = source.theLineDenCoef[i];
+         theSampNumCoef[i] = source.theSampNumCoef[i];
+         theSampDenCoef[i] = source.theSampDenCoef[i];
+      }
+   }
+   return *this;
+}
+
+void ossimRpcProjection::setAttributes(ossim_float64 sampleOffset,
+                                       ossim_float64 lineOffset,
+                                       ossim_float64 sampleScale,
+                                       ossim_float64 lineScale,
+                                       ossim_float64 latOffset,
+                                       ossim_float64 lonOffset,
+                                       ossim_float64 heightOffset,
+                                       ossim_float64 latScale,
+                                       ossim_float64 lonScale,
+                                       ossim_float64 heightScale,
+                                       const std::vector<double>& xNumeratorCoeffs,
+                                       const std::vector<double>& xDenominatorCoeffs,
+                                       const std::vector<double>& yNumeratorCoeffs,
+                                       const std::vector<double>& yDenominatorCoeffs,
+                                       PolynomialType polyType)
+{
+   thePolyType = polyType;
+   
+   theLineScale  = lineScale;
+   theSampScale  = sampleScale;
+   theLatScale   = latScale;
+   theLonScale   = lonScale;
+   theHgtScale   = heightScale;
+   theLineOffset = lineOffset;
+   theSampOffset = sampleOffset;
+   theLatOffset  = latOffset;
+   theLonOffset  = lonOffset;
+   theHgtOffset  = heightOffset;
+
+   if(xNumeratorCoeffs.size() == 20)
+   {
+      std::copy(xNumeratorCoeffs.begin(),
+                xNumeratorCoeffs.end(),
+                theSampNumCoef);
+   }
+   if(xDenominatorCoeffs.size() == 20)
+   {
+      std::copy(xDenominatorCoeffs.begin(),
+                xDenominatorCoeffs.end(),
+                theSampDenCoef);
+   }
+   if(yNumeratorCoeffs.size() == 20)
+   {
+      std::copy(yNumeratorCoeffs.begin(),
+                yNumeratorCoeffs.end(),
+                theLineNumCoef);
+   }
+   if(yDenominatorCoeffs.size() == 20)
+   {
+      std::copy(yDenominatorCoeffs.begin(),
+                yDenominatorCoeffs.end(),
+                theLineDenCoef);
+   }
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimRpcProjection::worldToLineSample()
+//  
+//  Overrides base class implementation. Directly computes line-sample from
+//  the polynomials.
+//*****************************************************************************
+void ossimRpcProjection::worldToLineSample(const ossimGpt& ground_point,
+                                      ossimDpt&       imgPt) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::worldToLineSample(): entering..." << std::endl;
+
+   if(ground_point.isLatNan() ||
+      ground_point.isLonNan() )
+     {
+       imgPt.makeNan();
+       return;
+     }
+         
+   //*
+   // Normalize the lat, lon, hgt:
+   //*
+   double nlat = (ground_point.lat - theLatOffset) / theLatScale;
+   double nlon = (ground_point.lon - theLonOffset) / theLonScale;
+   double nhgt;
+
+   if(ossim::isnan(ground_point.hgt))
+   {
+      nhgt = (theHgtScale - theHgtOffset) / theHgtScale;
+   }
+   else
+   {
+      nhgt = (ground_point.hgt - theHgtOffset) / theHgtScale;
+   }
+
+   
+   //***
+   // Compute the adjusted, normalized line (U) and sample (V):
+   //***
+   double Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
+   double Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
+   double Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
+   double Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
+   double U_rot  = Pu / Qu;
+   double V_rot  = Pv / Qv;
+
+   //***
+   // U, V are normalized quantities. Need now to establish the image file
+   // line and sample. First, back out the adjustable parameter effects
+   // starting with rotation:
+   //***
+   double U = U_rot*theCosMapRot + V_rot*theSinMapRot;
+   double V = V_rot*theCosMapRot - U_rot*theSinMapRot;
+
+   //***
+   // Now back out skew, scale, and offset adjustments:
+   //***
+   imgPt.line = U*(theLineScale+theIntrackScale) + theLineOffset + theIntrackOffset;
+   imgPt.samp = V*(theSampScale+theCrtrackScale) + theSampOffset + theCrtrackOffset;
+
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::worldToLineSample(): returning..." << std::endl;
+
+   return;
+}
+
+void  ossimRpcProjection::lineSampleToWorld(const ossimDpt& imagePoint,
+                                            ossimGpt&       worldPoint) const
+{
+   if(!imagePoint.hasNans())
+   {
+      
+      lineSampleHeightToWorld(imagePoint,
+                              worldPoint.height(),
+                              worldPoint);
+   }
+   else
+   {
+      worldPoint.makeNan();
+   }
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcProjection::lineSampleHeightToWorld()
+//  
+//  Performs reverse projection of image line/sample to ground point.
+//  The imaging ray is intersected with a level plane at height = elev.
+//
+//  NOTE: U = line, V = sample -- this differs from the convention.
+//
+//*****************************************************************************
+void ossimRpcProjection::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                            const double&   ellHeight,
+                                            ossimGpt&       gpt) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::lineSampleHeightToWorld: entering..." << std::endl;
+
+   //***
+   // Constants for convergence tests:
+   //***
+   static const int    MAX_NUM_ITERATIONS  = 10;
+   static const double CONVERGENCE_EPSILON = 0.1;  // pixels
+   
+   //***
+   // The image point must be adjusted by the adjustable parameters as well
+   // as the scale and offsets given as part of the RPC param normalization.
+   //
+   //      NOTE: U = line, V = sample
+   //***
+   double skew = (image_point.x-theSampOffset - theCrtrackOffset)*theYawSkew;
+   double U    = (image_point.y-theLineOffset - theIntrackOffset+skew) / (theLineScale+theIntrackScale);
+   double V    = (image_point.x-theSampOffset - theCrtrackOffset) / (theSampScale+theCrtrackScale);
+
+   //***
+   // Rotate the normalized U, V by the map rotation error (adjustable param):
+   //***
+   double U_rot = theCosMapRot*U - theSinMapRot*V;
+   double V_rot = theSinMapRot*U + theCosMapRot*V;
+   U = U_rot; V = V_rot;
+
+
+   // now apply adjust intrack and cross track
+   //***
+   // Initialize quantities to be used in the iteration for ground point:
+   //***
+   double nlat      = 0.0;  // normalized latitude
+   double nlon      = 0.0;  // normalized longitude
+   
+   double nhgt;
+
+   if(ossim::isnan(ellHeight))
+   {
+     nhgt = (theHgtScale - theHgtOffset) / theHgtScale;  // norm height
+   }
+   else
+   {
+      nhgt = (ellHeight - theHgtOffset) / theHgtScale;  // norm height
+   }
+   
+   double epsilonU = CONVERGENCE_EPSILON/(theLineScale+theIntrackScale);
+   double epsilonV = CONVERGENCE_EPSILON/(theSampScale+theCrtrackScale);
+   int    iteration = 0;
+
+   //***
+   // Declare variables only once outside the loop. These include:
+   // * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
+   // * partial derivatives of polynomials wrt X, Y,
+   // * computed normalized image point: Uc, Vc,
+   // * residuals of normalized image point: deltaU, deltaV,
+   // * partial derivatives of Uc and Vc wrt X, Y,
+   // * corrections to normalized lat, lon: deltaLat, deltaLon.
+   //***
+   double Pu, Qu, Pv, Qv;
+   double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
+   double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
+   double Uc, Vc;
+   double deltaU, deltaV;
+   double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
+   double deltaLat, deltaLon;
+   
+   //***
+   // Now iterate until the computed Uc, Vc is within epsilon of the desired
+   // image point U, V:
+   //***
+   do
+   {
+      //***
+      // Calculate the normalized line and sample Uc, Vc as ratio of
+      // polynomials Pu, Qu and Pv, Qv:
+      //***
+      Pu = polynomial(nlat, nlon, nhgt, theLineNumCoef);
+      Qu = polynomial(nlat, nlon, nhgt, theLineDenCoef);
+      Pv = polynomial(nlat, nlon, nhgt, theSampNumCoef);
+      Qv = polynomial(nlat, nlon, nhgt, theSampDenCoef);
+      Uc = Pu/Qu;
+      Vc = Pv/Qv;
+      
+      //***
+      // Compute residuals between desired and computed line, sample:
+      //***
+      deltaU = U - Uc;
+      deltaV = V - Vc;
+      
+      //***
+      // Check for convergence and skip re-linearization if converged:
+      //***
+      if ((fabs(deltaU) > epsilonU) || (fabs(deltaV) > epsilonV))
+      {
+         //***
+         // Analytically compute the partials of each polynomial wrt lat, lon:
+         //***
+         dPu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineNumCoef);
+         dQu_dLat = dPoly_dLat(nlat, nlon, nhgt, theLineDenCoef);
+         dPv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampNumCoef);
+         dQv_dLat = dPoly_dLat(nlat, nlon, nhgt, theSampDenCoef);
+         dPu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineNumCoef);
+         dQu_dLon = dPoly_dLon(nlat, nlon, nhgt, theLineDenCoef);
+         dPv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampNumCoef);
+         dQv_dLon = dPoly_dLon(nlat, nlon, nhgt, theSampDenCoef);
+         
+         //***
+         // Analytically compute partials of quotients U and V wrt lat, lon: 
+         //***
+         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
+         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
+         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
+         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
+         
+         W = dU_dLon*dV_dLat - dU_dLat*dV_dLon;
+         
+         //***
+         // Now compute the corrections to normalized lat, lon:
+         //***
+         deltaLat = (dU_dLon*deltaV - dV_dLon*deltaU) / W;
+         deltaLon = (dV_dLat*deltaU - dU_dLat*deltaV) / W;
+         nlat += deltaLat;
+         nlon += deltaLon;
+      }
+      
+      iteration++;
+      
+   } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
+            && (iteration < MAX_NUM_ITERATIONS));
+      
+   //***
+   // Test for exceeding allowed number of iterations. Flag error if so:
+   //***
+   if (iteration == MAX_NUM_ITERATIONS)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimRpcProjection::lineSampleHeightToWorld: \nMax number of iterations reached in ground point "
+                                         << "solution. Results are inaccurate." << endl;
+   }
+
+   //***
+   // Now un-normalize the ground point lat, lon and establish return quantity:
+   //***
+   gpt.lat = nlat*theLatScale + theLatOffset;
+   gpt.lon = nlon*theLonScale + theLonOffset;
+   gpt.hgt = ellHeight;
+   
+}
+
+ossimGpt ossimRpcProjection::origin()const
+{
+   return ossimGpt(theLatOffset,
+                   theLonOffset,
+                   theHgtOffset);
+}
+
+
+ossimDpt ossimRpcProjection::getMetersPerPixel() const
+{
+   ossimDpt result;
+   
+//    ossimDpt left  = ossimDpt(theSampOffset-1,
+//                              theLineOffset);
+//    ossimDpt right = ossimDpt(theSampOffset+1,
+//                              theLineOffset);
+   ossimDpt top  = ossimDpt(theSampOffset,
+                            theLineOffset-1);
+   ossimDpt bottom = ossimDpt(theSampOffset,
+                              theLineOffset+1);
+//    ossimGpt leftG;
+//    ossimGpt rightG;
+   ossimGpt topG;
+   ossimGpt bottomG;
+   
+//    lineSampleToWorld(left, leftG);
+//    lineSampleToWorld(right, rightG);
+   lineSampleToWorld(top, topG);
+   lineSampleToWorld(bottom, bottomG);
+   
+//    result.x = (ossimEcefPoint(leftG) - ossimEcefPoint(rightG)).magnitude()/2.0;
+   result.y = (ossimEcefPoint(topG) - ossimEcefPoint(bottomG)).magnitude()/2.0;
+   result.x = result.y;
+
+   return result;
+}
+
+bool ossimRpcProjection::operator==(const ossimProjection& projection) const
+{
+   if(&projection == this) return true;
+
+   // not implemented yet
+   //
+   return false;
+}
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimRpcProjection::polynomial
+//  
+//  Computes polynomial.
+//  
+//*****************************************************************************
+double ossimRpcProjection::polynomial(const double& P, const double& L,
+                                      const double& H, const double* c) const
+{
+   double r;
+
+   if (thePolyType == A)
+   {
+      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
+          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*P*H +
+          c[ 8]*L*L   + c[ 9]*P*P   + c[10]*H*H   + c[11]*L*L*L +
+          c[12]*L*L*P + c[13]*L*L*H + c[14]*L*P*P + c[15]*P*P*P +
+          c[16]*P*P*H + c[17]*L*H*H + c[18]*P*H*H + c[19]*H*H*H;
+   }
+   else
+   {
+      r = c[ 0]       + c[ 1]*L     + c[ 2]*P     + c[ 3]*H     +
+          c[ 4]*L*P   + c[ 5]*L*H   + c[ 6]*P*H   + c[ 7]*L*L   +
+          c[ 8]*P*P   + c[ 9]*H*H   + c[10]*L*P*H + c[11]*L*L*L +
+          c[12]*L*P*P + c[13]*L*H*H + c[14]*L*L*P + c[15]*P*P*P +
+          c[16]*P*H*H + c[17]*L*L*H + c[18]*P*P*H + c[19]*H*H*H;
+   }
+   
+   return r;
+}
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimRpcProjection::dPoly_dLat
+//  
+//  Computes derivative of polynomial wrt normalized Latitude P.
+//  
+//*****************************************************************************
+double ossimRpcProjection::dPoly_dLat(const double& P, const double& L,
+                                 const double& H, const double* c) const
+{
+   double dr;
+
+   if (thePolyType == A)
+   {
+      dr = c[2] + c[4]*L + c[6]*H + c[7]*L*H + 2*c[9]*P + c[12]*L*L +
+           2*c[14]*L*P + 3*c[15]*P*P +2*c[16]*P*H + c[18]*H*H;
+   }
+   else
+   {
+      dr = c[2] + c[4]*L + c[6]*H + 2*c[8]*P + c[10]*L*H + 2*c[12]*L*P +
+           c[14]*L*L + 3*c[15]*P*P + c[16]*H*H + 2*c[18]*P*H;
+   }
+   
+   return dr;
+}
+
+//*****************************************************************************
+// PRIVATE METHOD: ossimRpcProjection::dPoly_dLon
+//  
+//  Computes derivative of polynomial wrt normalized Longitude L.
+//  
+//*****************************************************************************
+double ossimRpcProjection::dPoly_dLon(const double& P, const double& L,
+                                 const double& H, const double* c) const
+{
+   double dr;
+
+   if (thePolyType == A)
+   {
+      dr = c[1] + c[4]*P + c[5]*H + c[7]*P*H + 2*c[8]*L + 3*c[11]*L*L +
+           2*c[12]*L*P + 2*c[13]*L*H + c[14]*P*P + c[17]*H*H;
+   }
+   else
+   {
+      dr = c[1] + c[4]*P + c[5]*H + 2*c[7]*L + c[10]*P*H + 3*c[11]*L*L +
+           c[12]*P*P + c[13]*H*H + 2*c[14]*P*L + 2*c[17]*L*H;
+   }
+   return dr;
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcProjection::print()
+//  
+//  Formatted dump of data members.
+//  
+//*****************************************************************************
+std::ostream& ossimRpcProjection::print(std::ostream& out) const
+{
+   out << "\nDump of ossimRpcProjection object at " << hex << this << ":\n"
+       << POLY_TYPE_KW   << ": " << thePolyType   << "\n"
+       << LINE_SCALE_KW  << ": " << theLineScale  << "\n"
+       << SAMP_SCALE_KW  << ": " << theSampScale  << "\n"
+       << LAT_SCALE_KW   << ": " << theLatScale   << "\n"
+       << LON_SCALE_KW   << ": " << theLonScale   << "\n"
+       << HGT_SCALE_KW   << ": " << theHgtScale   << "\n"
+       << LINE_OFFSET_KW << ": " << theLineOffset << "\n"
+       << SAMP_OFFSET_KW << ": " << theSampOffset << "\n"
+       << LAT_OFFSET_KW  << ": " << theLatOffset  << "\n"
+       << LON_OFFSET_KW  << ": " << theLonOffset  << "\n"
+       << HGT_OFFSET_KW  << ": " << theHgtOffset  << endl;
+
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<LINE_NUM_COEF_KW<<"["<<i<<"]: "<<theLineNumCoef[i]<<endl;
+
+   out << endl;
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<LINE_DEN_COEF_KW<<"["<<i<<"]: "<<theLineDenCoef[i]<<endl;
+
+   out << endl;
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<SAMP_NUM_COEF_KW<<"["<<i<<"]: "<<theSampNumCoef[i]<<endl;
+
+   out << endl;
+   for (int i=0; i<NUM_COEFFS; i++)
+      out<<"  "<<SAMP_DEN_COEF_KW<<"["<<i<<"]: "<<theSampDenCoef[i]<<endl;
+      
+   out << endl;
+
+   return ossimProjection::print(out);
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcProjection::saveState()
+//  
+//  Saves the model state to the KWL. This KWL also serves as a geometry file.
+//  
+//*****************************************************************************
+bool ossimRpcProjection::saveState(ossimKeywordlist& kwl,
+                              const char* prefix) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::saveState(): entering..." << std::endl;
+
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, MODEL_TYPE);
+
+   //***
+   // Hand off to base class for common stuff:
+   //***
+   ossimProjection::saveState(kwl, prefix);
+
+   kwl.add(prefix,
+           POLY_TYPE_KW,
+           (char)thePolyType,
+           true);
+   
+   kwl.add(prefix, LINE_SCALE_KW, theLineScale);
+   kwl.add(prefix, SAMP_SCALE_KW, theSampScale);
+   kwl.add(prefix, LAT_SCALE_KW, theLatScale);
+   kwl.add(prefix, LON_SCALE_KW, theLonScale);
+   kwl.add(prefix, HGT_SCALE_KW, theHgtScale);
+   kwl.add(prefix, LINE_OFFSET_KW, theLineOffset);
+   kwl.add(prefix, SAMP_OFFSET_KW, theSampOffset);
+   kwl.add(prefix, LAT_OFFSET_KW, theLatOffset);
+   kwl.add(prefix, LON_OFFSET_KW, theLonOffset);
+   
+   kwl.add(prefix, HGT_OFFSET_KW, theHgtOffset);
+
+   for (int i=0; i<NUM_COEFFS; i++)
+   {
+      kwl.add(prefix, (LINE_NUM_COEF_KW + ossimString::toString(i)).c_str(), theLineNumCoef[i]);
+      kwl.add(prefix, (LINE_DEN_COEF_KW + ossimString::toString(i)).c_str(), theLineDenCoef[i]);
+      kwl.add(prefix, (SAMP_NUM_COEF_KW + ossimString::toString(i)).c_str(), theSampNumCoef[i]);
+      kwl.add(prefix, (SAMP_DEN_COEF_KW + ossimString::toString(i)).c_str(), theSampDenCoef[i]);
+   }
+      
+   saveAdjustments(kwl, prefix);
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::saveState(): returning..." << std::endl;
+   return true;
+}
+
+//*****************************************************************************
+//  METHOD: ossimRpcProjection::loadState()
+//  
+//  Restores the model's state from the KWL. This KWL also serves as a
+//  geometry file.
+//  
+//*****************************************************************************
+bool ossimRpcProjection::loadState(const ossimKeywordlist& kwl,
+                              const char* prefix) 
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::loadState(): entering..." << std::endl;
+
+   const char* value;
+   const char* keyword;
+
+   //***
+   // Pass on to the base-class for parsing first:
+   //***
+   bool success = ossimProjection::loadState(kwl, prefix);
+   if (!success)
+   {
+      theErrorStatus++;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::loadState(): returning with error..." << std::endl;
+      return false;
+   }
+      
+   //***
+   // Continue parsing for local members:
+   //***
+   keyword = POLY_TYPE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   thePolyType = (PolynomialType) value[0];
+      
+   keyword = LINE_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLineScale = ossimString(value).toDouble();
+   
+   keyword = SAMP_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theSampScale = ossimString(value).toDouble();
+   
+   keyword = LAT_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLatScale = ossimString(value).toDouble();
+   
+   keyword = LON_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLonScale = ossimString(value).toDouble();
+   
+   keyword = HGT_SCALE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theHgtScale = ossimString(value).toDouble();
+   
+   keyword = LINE_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLineOffset = ossimString(value).toDouble();
+   
+   keyword = SAMP_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theSampOffset = ossimString(value).toDouble();
+   
+   keyword = LAT_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLatOffset = ossimString(value).toDouble();
+   
+   keyword = LON_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theLonOffset = ossimString(value).toDouble();
+   
+   keyword = HGT_OFFSET_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                          << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                          << std::endl;
+      return false;
+   }
+   theHgtOffset = ossimString(value).toDouble();
+
+   for (int i=0; i<NUM_COEFFS; i++)
+   {
+      value = kwl.find(prefix, (LINE_NUM_COEF_KW+ossimString::toString(i)).c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                             << std::endl;
+         return false;
+      }
+      theLineNumCoef[i] = ossimString(value).toDouble();
+   
+      value = kwl.find(prefix, (LINE_DEN_COEF_KW+ossimString::toString(i)).c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                             << std::endl;
+         return false;
+      }
+      theLineDenCoef[i] = ossimString(value).toDouble();
+   
+      value = kwl.find(prefix, (SAMP_NUM_COEF_KW+ossimString::toString(i)).c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                             << std::endl;
+         return false;
+      }
+      theSampNumCoef[i] = ossimString(value).toDouble();
+      
+      value = kwl.find(prefix, (SAMP_DEN_COEF_KW+ossimString::toString(i)).c_str());
+      if (!value)
+      {
+         ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::loadState(): Error encountered parsing the following required keyword: "
+                                             << "<" << keyword << ">. Check the keywordlist for proper syntax."
+                                             << std::endl;
+         return false;
+      }
+      theSampDenCoef[i] = ossimString(value).toDouble();
+   }
+
+   loadAdjustments(kwl, prefix);
+
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+      initAdjustableParameters();
+   }
+      
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimRpcProjection::loadState(): returning..." << std::endl;
+
+   return true;
+}
+
+void ossimRpcProjection::initAdjustableParameters()
+{
+   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
+   int numParams = getNumberOfAdjustableParameters();
+   for (int i=0; i<numParams; i++)
+   {
+      setAdjustableParameter(i, 0.0);
+      setParameterDescription(i, PARAM_NAMES[i]);
+      setParameterUnit(i,PARAM_UNITS[i]);
+   }
+   setParameterSigma(INTRACK_OFFSET, 50.0);
+   setParameterSigma(CRTRACK_OFFSET, 50.0);
+   setParameterSigma(INTRACK_SCALE, 50.0);  
+   setParameterSigma(CRTRACK_SCALE, 50.0);  
+   setParameterSigma(MAP_ROTATION, 0.1);
+//   setParameterSigma(YAW_OFFSET, 0.001);
+}
+
+void ossimRpcProjection::adjustableParametersChanged()
+{
+   theIntrackOffset    = computeParameterOffset(INTRACK_OFFSET);
+   theCrtrackOffset    = computeParameterOffset(CRTRACK_OFFSET);
+   theIntrackScale     = computeParameterOffset(INTRACK_SCALE);
+   theCrtrackScale     = computeParameterOffset(CRTRACK_SCALE);
+   double mapRotation  = computeParameterOffset(MAP_ROTATION);
+   theCosMapRot        = ossim::cosd(mapRotation);
+   theSinMapRot        = ossim::sind(mapRotation);
+}
+
+bool
+ossimRpcProjection::setupOptimizer(const ossimString& setup)
+{
+   ossimKeywordlist kwl;
+
+   if(kwl.addFile(ossimFilename(setup)))
+   {
+      return loadState(kwl);
+   }
+   else
+   {
+      ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->createProjection(setup);
+      if(proj.valid())
+      {
+         kwl.clear();
+         proj->saveState(kwl);
+         
+         return loadState(kwl);
+      }
+   }
+   
+   return false;
+}
+
+ossim_uint32
+ossimRpcProjection::degreesOfFreedom()const
+{
+   ossim_uint32 dof = 0;
+   ossim_uint32 idx = 0;
+   ossim_uint32 numAdj = getNumberOfAdjustableParameters();
+   for(idx = 0; idx < numAdj; ++idx)
+   {
+      if(!isParameterLocked(idx))
+      {
+         ++dof;
+      }
+   }
+   
+   return dof;
+}
+//give inverse() partial derivative regarding parameter parmIdx (>=0)
+ossimGpt
+ossimRpcProjection::getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta)
+{   
+   double den = 0.5/hdelta;
+   ossimGpt res,gd;
+
+   double middle = getAdjustableParameter(parmIdx);
+   //set parm to high value
+   setAdjustableParameter(parmIdx, middle + hdelta, true);
+   res = inverse(ipos);
+   //set parm to low value and gte difference
+   setAdjustableParameter(parmIdx, middle - hdelta, true);
+   gd = inverse(ipos);
+
+   //reset parm
+   setAdjustableParameter(parmIdx, middle, true);
+
+   res.lon = den*(res.lon - gd.lon) * 100000.0; //TBC : approx meters
+   res.lat = den*(res.lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
+   res.hgt = den*(res.hgt - gd.hgt);
+
+   return res;
+}
+
+//give forward() partial derivative regarding parameter parmIdx (>=0)
+ossimDpt
+ossimRpcProjection::getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta)
+{   
+   static double den = 0.5/hdelta;
+   ossimDpt res;
+
+   double middle = getAdjustableParameter(parmIdx);
+   //set parm to high value
+   setAdjustableParameter(parmIdx, middle + hdelta, true);
+   res = forward(gpos);
+   //set parm to low value and gte difference
+   setAdjustableParameter(parmIdx, middle - hdelta, true);
+   res -= forward(gpos);
+   //get partial derivative
+   res = res*den;
+
+   //reset parm
+   setAdjustableParameter(parmIdx, middle, true);
+
+   return res;
+}
+
+double
+ossimRpcProjection::optimizeFit(const ossimTieGptSet& tieSet, double* /* targetVariance */)
+{
+#if 1
+   //NOTE : ignore targetVariance
+   ossimRefPtr<ossimRpcSolver> solver = new ossimRpcSolver(false, false); //TBD : choices should be part of setupFromString
+
+   std::vector<ossimDpt> imagePoints;
+   std::vector<ossimGpt> groundPoints;
+   tieSet.getSlaveMasterPoints(imagePoints, groundPoints);
+   solver->solveCoefficients(imagePoints, groundPoints);
+
+   ossimRefPtr< ossimImageGeometry > optProj = solver->createRpcProjection();
+   if (!optProj)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimRpcProjection::optimizeFit(): error when optimizing the RPC with given tie points"
+                                             << std::endl;
+      return -1.0;
+   }
+
+   if(optProj->hasProjection())
+   {
+      ossimKeywordlist kwl;
+      optProj->getProjection()->saveState(kwl);
+      this->loadState(kwl);
+   }
+
+   return std::pow(solver->getRmsError(), 2); //variance in pixel^2
+#else
+   // COPIED from ossimRpcProjection
+   //
+   //
+   //use a simple Levenberg-Marquardt non-linear optimization
+   //note : please limit the number of tie points
+   //
+   //INPUTS: requires Jacobian matrix (partial derivatives with regards to parameters)
+   //OUTPUTS: will also compute parameter covariance matrix
+   //
+   //TBD: use targetVariance!
+ 
+   int np = getNumberOfAdjustableParameters();
+   int nobs = tieSet.size();
+
+   //setup initail values
+   int iter=0;
+   int iter_max = 200;
+   double minResidue = 1e-10; //TBC
+   double minDelta = 1e-10; //TBC
+
+   //build Least Squares initial normal equation
+   // don't waste memory, add samples one at a time
+   NEWMAT::SymmetricMatrix A;
+   NEWMAT::ColumnVector residue;
+   NEWMAT::ColumnVector projResidue;
+   double deltap_scale = 1e-4; //step_Scale is 1.0 because we expect parameters to be between -1 and 1
+   buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
+   double ki2=residue.SumSquare();
+
+   //get current adjustment (between -1 and 1 normally) and convert to ColumnVector
+   ossimAdjustmentInfo cadj;
+   getAdjustment(cadj);
+   std::vector< ossimAdjustableParameterInfo >& parmlist = cadj.getParameterList();
+   NEWMAT::ColumnVector cparm(np), nparm(np);
+   for(int n=0;n<np;++n)
+   {
+      cparm(n+1) = parmlist[n].getParameter();
+   }
+
+   double damping_speed = 2.0;
+   //find max diag element for A
+   double maxdiag=0.0;
+   for(int d=1;d<=np;++d) {
+      if (maxdiag < A(d,d)) maxdiag=A(d,d);
+   }
+   double damping = 1e-3 * maxdiag;
+   double olddamping = 0.0;
+   bool found = false;
+
+//DEBUG TBR
+cout<<"rms="<<sqrt(ki2/nobs)<<" ";
+cout.flush();
+
+   while ( (!found) && (iter < iter_max) ) //non linear optimization loop
+   {
+      bool decrease = false;
+
+      do
+      {
+         //add damping update to normal matrix
+         for(int d=1;d<=np;++d) A(d,d) += damping - olddamping;
+         olddamping = damping;
+
+         NEWMAT::ColumnVector deltap = solveLeastSquares(A, projResidue);
+
+         if (deltap.NormFrobenius() <= minDelta) 
+         {
+            found = true;
+         } else {
+            //update adjustment
+            nparm = cparm + deltap;
+            for(int n=0;n<np;++n)
+            {
+               setAdjustableParameter(n, nparm(n+1), false); //do not update now, wait
+            }
+            adjustableParametersChanged();
+
+            //check residue is reduced
+            NEWMAT::ColumnVector newresidue = getResidue(tieSet);
+            double newki2=newresidue.SumSquare();
+            double res_reduction = (ki2 - newki2) / (deltap.t()*(deltap*damping + projResidue)).AsScalar();
+ //DEBUG TBR
+       cout<<sqrt(newki2/nobs)<<" ";
+       cout.flush();
+
+            if (res_reduction > 0)
+            {
+               //accept new parms
+               cparm = nparm;
+               ki2=newki2;
+
+               deltap_scale = max(1e-15, deltap.NormInfinity()*1e-4);
+
+               buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
+               olddamping = 0.0;
+
+               found = ( projResidue.NormInfinity() <= minResidue );
+               //update damping factor
+               damping *= std::max( 1.0/3.0, 1.0-std::pow((2.0*res_reduction-1.0),3));
+               damping_speed = 2.0;
+               decrease = true;
+            } else {
+               //cancel parameter update
+               for(int n=0;n<np;++n)
+               {
+                  setAdjustableParameter(n, nparm(n+1), false); //do not update right now
+               }
+               adjustableParametersChanged();
+
+               damping *= damping_speed;
+               damping_speed *= 2.0;
+            }
+         }
+      } while (!decrease && !found);
+      ++iter;
+   }
+
+//DEBUG TBR
+cout<<endl;
+
+   //compute parameter correlation
+   // use normal matrix inverse
+   //TBD
+
+   return ki2/nobs;
+#endif
+}
+
+void
+ossimRpcProjection::buildNormalEquation(const ossimTieGptSet& tieSet,
+                                      NEWMAT::SymmetricMatrix& A,
+                                      NEWMAT::ColumnVector& residue,
+                                      NEWMAT::ColumnVector& projResidue,
+                                      double pstep_scale)
+{
+   //goal:       build Least Squares system
+   //constraint: never store full Jacobian matrix in memory (can be huge)
+   //            so we build the matrices incrementally
+   // the system can be built using forward() or inverse() depending on the projection capabilities : useForward()
+   //
+   //TBD : add covariance matrix for each tie point
+
+   //init
+   int np = getNumberOfAdjustableParameters();
+   int dimObs;
+   bool useImageObs = useForward(); //caching
+   if (useImageObs)
+   {
+      dimObs = 2; //image observation
+   } else {
+      dimObs = 3; //ground observations
+   }
+   int no = dimObs * tieSet.size(); //number of observations
+
+   A.ReSize(np);
+   residue.ReSize(no);
+   projResidue.ReSize(np);
+   //Zeroify matrices that will be accumulated
+   A           = 0.0;
+   projResidue = 0.0;
+
+   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
+   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
+   unsigned long c=1;
+
+   if (useImageObs)
+   { 
+     //image observations 
+     ossimDpt* imDerp = new ossimDpt[np];
+     ossimDpt resIm;
+     // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         resIm = (*tit)->tie - forward(*(*tit));
+         residue(c++) = resIm.x;
+         residue(c++) = resIm.y;
+
+         //compute all image derivatives regarding parametres for the tie point position
+         for(int p=0;p<np;++p)
+         {
+            imDerp[p] = getForwardDeriv( p , *(*tit) , pstep_scale);
+         }
+
+         //compute influence of tie point on all sytem elements
+         for(int p1=0;p1<np;++p1)
+         {        
+            //proj residue: J * residue
+            projResidue.element(p1) += imDerp[p1].x * resIm.x + imDerp[p1].y * resIm.y;
+
+            //normal matrix A = transpose(J)*J
+            for(int p2=p1;p2<np;++p2)
+            {
+               A.element(p1,p2) += imDerp[p1].x * imDerp[p2].x + imDerp[p1].y * imDerp[p2].y;
+            }
+         }
+      }
+      delete []imDerp;
+   }
+   else
+   {
+      // ground observations
+      std::vector<ossimGpt> gdDerp(np);
+      ossimGpt gd, resGd;
+      // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         gd = inverse((*tit)->tie);
+         residue(c++) = resGd.lon = ((*tit)->lon - gd.lon) * 100000.0;
+         residue(c++) = resGd.lat = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
+         residue(c++) = resGd.hgt = (*tit)->hgt - gd.hgt; //TBD : normalize to meters?
+
+         //compute all image derivatives regarding parametres for the tie point position
+         for(int p=0;p<np;++p)
+         {
+            gdDerp[p] = getInverseDeriv( p , (*tit)->tie, pstep_scale);
+         }
+
+         //compute influence of tie point on all sytem elements
+         for(int p1=0;p1<np;++p1)
+         {        
+            //proj residue: J * residue
+            projResidue.element(p1) += gdDerp[p1].lon * resGd.lon + gdDerp[p1].lat * resGd.lat + gdDerp[p1].hgt * resGd.hgt; //TBC
+
+            //normal matrix A = transpose(J)*J
+            for(int p2=p1;p2<np;++p2)
+            {
+               A.element(p1,p2) += gdDerp[p1].lon * gdDerp[p2].lon + gdDerp[p1].lat * gdDerp[p2].lat + gdDerp[p1].hgt * gdDerp[p2].hgt;
+            }
+         }
+      }
+   } //end of if (useImageObs)
+}
+
+NEWMAT::ColumnVector
+ossimRpcProjection::getResidue(const ossimTieGptSet& tieSet)
+{
+   //init
+   NEWMAT::ColumnVector residue;
+   int dimObs;
+
+   bool useImageObs = useForward(); //caching
+   if (useImageObs)
+   {
+      dimObs = 2; //image observation
+   } else {
+      dimObs = 3; //ground observations
+   }
+   int no = dimObs * tieSet.size(); //number of observations
+
+   residue.ReSize(no);
+
+   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
+   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
+   unsigned long c=1;
+
+   if (useImageObs)
+   { 
+     //image observations 
+     ossimDpt resIm;
+     // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         resIm = (*tit)->tie - forward(**tit);
+         residue(c++) = resIm.x;
+         residue(c++) = resIm.y;
+      }
+   } else {
+      // ground observations
+      ossimGpt gd;
+      // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         gd = inverse((*tit)->tie);
+         residue(c++) = ((*tit)->lon - gd.lon) * 100000.0; //approx meters //TBC TBD
+         residue(c++) = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
+         residue(c++) = (*tit)->hgt - gd.hgt; //meters
+      }
+   } //end of if (useImageObs)
+
+   return residue;
+}
+
+/*!
+ * solves Ax = r , with A symmetric positive definite
+ * A can be rank deficient
+ * size of A is typically between 10 and 100 rows
+ */
+NEWMAT::ColumnVector 
+ossimRpcProjection::solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const
+{
+   NEWMAT::ColumnVector x = invert(A)*r;
+   return x;
+}
+
+/** 
+ * stable invert stolen from ossimRpcSolver
+ */
+NEWMAT::Matrix 
+ossimRpcProjection::invert(const NEWMAT::Matrix& m)const
+{
+   ossim_uint32 idx = 0;
+   NEWMAT::DiagonalMatrix d;
+   NEWMAT::Matrix u;
+   NEWMAT::Matrix v;
+
+   // decompose m.t*m which is stored in Temp into the singular values and vectors.
+   //
+   NEWMAT::SVD(m, d, u, v, true, true);
+   
+   // invert the diagonal
+   // this is just doing the reciprical fo all diagonal components and store back int
+   // d.  ths compute d inverse.
+   //
+   for(idx=0; idx < (ossim_uint32)d.Ncols(); ++idx)
+   {
+      if(d[idx] > 1e-14) //TBC : use DBL_EPSILON ?
+      {
+         d[idx] = 1.0/d[idx];
+      }
+      else
+      {
+         d[idx] = 0.0;
+
+//DEBUG TBR
+cout<<"warning: singular matrix in SVD"<<endl;
+
+      }
+   }
+
+   //compute inverse of decomposed m;
+   return v*d*u.t();
+}
diff --git a/src/projection/ossimRpcSolver.cpp b/src/projection/ossimRpcSolver.cpp
new file mode 100644
index 0000000..f61d462
--- /dev/null
+++ b/src/projection/ossimRpcSolver.cpp
@@ -0,0 +1,827 @@
+//*****************************************************************************
+// FILE: ossimRpcModel.h
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Garrett Potts
+//
+//*****************************************************************************
+//  $Id: ossimRpcSolver.cpp 18960 2011-02-25 12:07:18Z gpotts $
+
+#include <cstdlib>
+#include <ctime>
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+
+#include <ossim/projection/ossimRpcSolver.h>
+#include <ossim/projection/ossimRpcModel.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/matrix/newmatap.h>
+#include <ossim/matrix/newmatio.h>
+#include <ossim/matrix/newmatnl.h>
+#include <ossim/matrix/newmatio.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/support_data/ossimNitfRpcBTag.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/base/ossim2dTo2dIdentityTransform.h>
+ossimRpcSolver::ossimRpcSolver(bool useElevation,
+                               bool useHeightAboveMSLFlag)
+{
+   theUseElevationFlag   = useElevation;
+   theHeightAboveMSLFlag = useHeightAboveMSLFlag;
+   theXNumCoeffs.resize(20);
+   theXDenCoeffs.resize(20);
+   theYNumCoeffs.resize(20);
+   theYDenCoeffs.resize(20);
+
+   std::fill(theXNumCoeffs.begin(),
+             theXNumCoeffs.end(), 0.0);
+   std::fill(theXDenCoeffs.begin(),
+             theXDenCoeffs.end(), 0.0);
+   std::fill(theYNumCoeffs.begin(),
+             theYNumCoeffs.end(), 0.0);
+   std::fill(theYDenCoeffs.begin(),
+             theYDenCoeffs.end(), 0.0);
+   theXNumCoeffs[0] = 1.0;
+   theXDenCoeffs[0] = 1.0;
+   theYNumCoeffs[0] = 1.0;
+   theYDenCoeffs[0] = 1.0;
+}
+
+void ossimRpcSolver::solveCoefficients(const ossimDrect& imageBounds,
+                                       ossimProjection* proj,
+                                       ossim_uint32 xSamples,
+                                       ossim_uint32 ySamples,
+                                       bool shiftTo0Flag)
+{
+   ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry();
+   geom->setProjection(proj);
+   solveCoefficients(imageBounds, geom.get(), xSamples, ySamples, shiftTo0Flag);
+}
+
+void ossimRpcSolver::solveCoefficients(const ossimDrect& imageBounds,
+                                       ossimImageGeometry* geom,
+                                       ossim_uint32 xSamples,
+                                       ossim_uint32 ySamples,
+                                       bool shiftTo0Flag)
+{
+   std::vector<ossimGpt> theGroundPoints;
+   std::vector<ossimDpt> theImagePoints;
+   ossim_uint32 x,y;
+   ossim_float64 w = imageBounds.width();
+   ossim_float64 h = imageBounds.height();
+   ossimGpt gpt;
+   ossimGpt defaultGround;
+   if(ySamples < 1) ySamples = 12;
+   if(xSamples < 1) xSamples = 12;
+   srand(time(0));
+   double xnorm;
+   double ynorm;
+   ossimDpt ul = imageBounds.ul();
+   ossimDpt shiftTo0(-ul.x,
+                     -ul.y);
+   for(y = 0; y < ySamples; ++y)
+   {
+      for(x = 0; x < xSamples; ++x)
+      {
+         if(ySamples > 1)
+         {
+//            ynorm = (double)y/(double)(ySamples-1.0);
+            ynorm = (double)y/(double)(ySamples);
+         }
+         else
+         {
+            ynorm = 0.0;
+         }
+         if(xSamples > 1)
+         {
+//            xnorm = (double)x/(double)(xSamples-1.0);
+            xnorm = (double)x/(double)(xSamples);
+         }
+         else
+         {
+            xnorm = 0.0;
+         }
+         
+//          ossimDpt dpt((.25 + .5*xnorm)*w + ul.x,
+//                       (.25 + .5*ynorm)*h + ul.y);
+         ossimDpt dpt(w*xnorm + ul.x,
+                      h*ynorm + ul.y);
+         
+         geom->localToWorld(dpt, gpt);
+         gpt.changeDatum(defaultGround.datum());
+
+         if(shiftTo0Flag)
+         {
+            theImagePoints.push_back(dpt+shiftTo0);
+         }
+         else
+         {
+            theImagePoints.push_back(dpt);
+         }
+         if(theHeightAboveMSLFlag)
+         {
+            double h = ossimElevManager::instance()->getHeightAboveMSL(gpt);
+            if(ossim::isnan(h) == false)
+            {
+               gpt.height(h);
+            }
+         }
+         if(gpt.isHgtNan())
+         {
+            gpt.height(0.0);
+         }
+         theGroundPoints.push_back(gpt);
+      }
+   }
+   solveCoefficients(theImagePoints,
+                     theGroundPoints);
+}
+
+void ossimRpcSolver::solveCoefficients(const std::vector<ossimDpt>& imagePoints,
+                                       const std::vector<ossimGpt>& groundControlPoints,
+                                       const ossimDpt& /* imageShift */)
+{
+   if((imagePoints.size() != groundControlPoints.size()))
+   {
+      return;
+   }
+
+   // we will first create f which holds the result of f(x,y,z).
+   // This basically holds the cooresponding image point for each
+   // ground control point.  One for x and a second array for y
+   //
+   std::vector<double> f[2];
+
+   //  Holds the x, y, z vectors
+   //
+   std::vector<double> x;
+   std::vector<double> y;
+   std::vector<double> z;
+   ossim_uint32 c = 0;
+   f[0].resize(imagePoints.size());
+   f[1].resize(imagePoints.size());
+   x.resize(imagePoints.size());
+   y.resize(imagePoints.size());
+   z.resize(imagePoints.size());
+
+   // compute the image bounds for the given image points
+   //
+   ossimDrect rect(imagePoints);
+
+   // get the widtha dn height that will be used
+   // in data normalization
+   //
+   ossim_float64 w = rect.width();
+   ossim_float64 h = rect.height();
+
+   // setup scales for normalization
+//   ossim_float64 xScale = w/2.0;
+//   ossim_float64 yScale = h/2.0;
+
+   // get the shift for the cneter of the data
+   ossimDpt centerImagePoint  = rect.midPoint();
+   
+   double latSum=0.0;
+   double lonSum=0.0;
+   double heightSum=0.0;
+
+   // find the center ground  Use elevation only if its enabled
+   //
+   for(c = 0; c < groundControlPoints.size();++c)
+   {
+      if(ossim::isnan(groundControlPoints[c].latd()) == false)
+      {
+         latSum += groundControlPoints[c].latd();
+      }
+      if(ossim::isnan(groundControlPoints[c].lond()) == false)
+      {
+         lonSum += groundControlPoints[c].lond();
+      }
+      if(!groundControlPoints[c].isHgtNan())
+      {
+         if(theUseElevationFlag)
+         {
+            heightSum += groundControlPoints[c].height();
+         }
+      }
+   }
+
+   // set the center ground for the offset
+   //
+   ossimGpt centerGround(latSum/groundControlPoints.size(),
+                         lonSum/groundControlPoints.size(),
+                         heightSum/groundControlPoints.size());
+
+   // set up ground scales and deltas for normalization
+   //
+//   ossim_float64 latScale       = 0.0;
+//   ossim_float64 lonScale       = 0.0;
+//   ossim_float64 heightScale    = 0.0;
+   ossim_float64 deltaLat       = 0.0;
+   ossim_float64 deltaLon       = 0.0;
+   ossim_float64 deltaHeight    = 0.0;
+   ossim_float64 maxDeltaLat    = 0.0;
+   ossim_float64 maxDeltaLon    = 0.0;
+   ossim_float64 maxDeltaHeight = 0.0;
+   ossim_float64 heightTest       = 0.0;
+   for(c = 0; c < groundControlPoints.size(); ++c)
+   {
+      deltaLat = (groundControlPoints[c].latd()-centerGround.latd());
+      deltaLon = (groundControlPoints[c].lond()-centerGround.lond());
+      if(!groundControlPoints[c].isHgtNan())
+      {
+         if(theUseElevationFlag)
+         {
+            deltaHeight = groundControlPoints[c].height() - centerGround.height();
+            heightTest  = groundControlPoints[c].height();
+         }
+         else
+         {
+            deltaHeight = 0.0;
+            heightTest  = 0.0;
+         }
+      }
+      else
+      {
+         deltaHeight = 0.0;
+      }
+      f[0][c] = (imagePoints[c].x - centerImagePoint.x)/(w/2.0);
+      f[1][c] = (imagePoints[c].y - centerImagePoint.y)/(h/2.0);
+      
+      x[c] = deltaLon;
+      y[c] = deltaLat;
+      z[c] = deltaHeight;
+
+      if(fabs(deltaLat) > maxDeltaLat) maxDeltaLat          = fabs(deltaLat);
+      if(fabs(deltaLon) > maxDeltaLon) maxDeltaLon          = fabs(deltaLon);
+      if(fabs(heightTest) > maxDeltaHeight) maxDeltaHeight  = fabs(heightTest);
+   }
+   bool elevationEnabled = theUseElevationFlag;
+   // always normalize, except if too small
+   //
+   // if max delta is less than a degree set it to 1 degree.
+   //
+   if(maxDeltaLat < 1.0)    maxDeltaLat = 1.0;
+   // if max delta is less than 1 degree then set it to 1.0 degree
+   if(maxDeltaLon < 1.0)    maxDeltaLon = 1.0;
+
+   if(fabs(maxDeltaHeight) < FLT_EPSILON) elevationEnabled = false;
+   // if max delta is less than a meter then set it to a meter.
+   if(maxDeltaHeight < 1.0) maxDeltaHeight = 1.0;
+
+   // set the height scale to something pretty large
+   if(!elevationEnabled)
+   {
+      maxDeltaHeight = 1.0/DBL_EPSILON;
+      centerGround.height(0.0);
+   }
+   // normalize the ground points
+   for(c = 0; c < groundControlPoints.size(); ++c)
+   {
+      x[c] /= maxDeltaLon;
+      y[c] /= maxDeltaLat;
+      z[c] /= maxDeltaHeight;
+   }
+
+   theLatScale    = maxDeltaLat;
+   theLonScale    = maxDeltaLon;
+   theHeightScale = maxDeltaHeight;
+
+   theImageOffset = centerImagePoint;
+   theImageScale  = ossimDpt(w/2.0,
+                             h/2.0);
+   theGroundOffset = centerGround;
+
+   if(ossim::isnan(theGroundOffset.height()))
+   {
+      theGroundOffset.height(0.0);
+   }
+
+   // now lets solve the coefficients
+   //
+   std::vector<double> coeffx;
+   std::vector<double> coeffy;
+
+   NEWMAT::ColumnVector coeffxVec;
+   NEWMAT::ColumnVector coeffyVec;
+   // perform a least squares fit for sample values found in f
+   // given the world values with variables x, y, z
+   //
+   solveCoefficients(coeffxVec,
+                     f[0],
+                     x,
+                     y,
+                     z);
+
+   
+   // perform a least squares fit for line values found in f
+   // given the world values with variables x, y, z
+   //
+   solveCoefficients(coeffyVec,
+                     f[1],
+                     x,
+                     y,
+                     z);
+
+   coeffx.resize(coeffxVec.Nrows());
+   coeffy.resize(coeffyVec.Nrows());
+   
+   for(c = 0; c < coeffx.size();++c)
+   {
+      coeffx[c] = coeffxVec[c];
+      coeffy[c] = coeffyVec[c];
+   }
+   // there are 20 numerator coefficients
+   // and 19 denominator coefficients
+   // I believe that the very first one for the
+   // denominator coefficients is fixed at 1.0
+   //
+   std::copy(coeffx.begin(),
+             coeffx.begin()+20,
+             theXNumCoeffs.begin());
+   std::copy(coeffx.begin()+20,
+             coeffx.begin()+39,
+             theXDenCoeffs.begin()+1);
+   std::copy(coeffy.begin(),
+             coeffy.begin()+20,
+             theYNumCoeffs.begin());
+   std::copy(coeffy.begin()+20,
+             coeffy.begin()+39,
+             theYDenCoeffs.begin()+1);
+   theXDenCoeffs[0] = 1.0;
+   theYDenCoeffs[0] = 1.0;
+
+
+   // now lets compute the RMSE for the given control points by feeding it
+   // back through the modeled RPC
+   //
+   ossim_float64  sumSquareError = 0.0;
+   ossim_uint32 idx = 0;
+
+//    std::cout << "ground offset height = " << theGroundOffset.height()
+//              << "Height scale         = " << theHeightScale << std::endl;
+   for (idx = 0; idx<imagePoints.size(); idx++)
+   {
+      ossim_float64 x = (groundControlPoints[idx].lond() - theGroundOffset.lond())/theLonScale;
+      ossim_float64 y = (groundControlPoints[idx].latd() - theGroundOffset.latd())/theLatScale;
+      ossim_float64 z = (groundControlPoints[idx].height() - theGroundOffset.height())/theHeightScale;
+      
+      if(ossim::isnan(z))
+      {
+         z = 0.0;
+      }
+      else
+      {
+         z = (z - theGroundOffset.height()/theHeightScale);
+      }
+       ossim_float64 imageX = ((eval(theXNumCoeffs, x, y, z)/
+                                eval(theXDenCoeffs, x, y, z))*theImageScale.x) + theImageOffset.x;
+      
+       ossim_float64 imageY = ((eval(theYNumCoeffs, x, y, z)/
+                                eval(theYDenCoeffs, x, y, z))*theImageScale.y) + theImageOffset.y;
+      
+      ossimDpt evalPt(imageX, imageY);
+      ossim_float64 len = (evalPt - imagePoints[idx]).length();
+      
+      sumSquareError += (len*len);
+   }
+
+   // set the error
+   //
+   theError = sqrt(sumSquareError/imagePoints.size());
+}
+
+ossimImageGeometry* ossimRpcSolver::createRpcModel()const
+{
+   ossimRpcModel* model = new ossimRpcModel;
+   
+   model->setAttributes(theImageOffset.x,
+                        theImageOffset.y,
+                        theImageScale.x,
+                        theImageScale.y,
+                        theGroundOffset.latd(),
+                        theGroundOffset.lond(),
+                        theGroundOffset.height(),
+                        theLatScale,
+                        theLonScale,
+                        theHeightScale,
+                        theXNumCoeffs,
+                        theXDenCoeffs,
+                        theYNumCoeffs,
+                        theYDenCoeffs);
+   return new ossimImageGeometry(new ossim2dTo2dIdentityTransform, model);
+}
+
+ossimImageGeometry* ossimRpcSolver::createRpcProjection()const
+{
+   ossimRpcProjection* proj = new ossimRpcProjection;
+   
+   proj->setAttributes(theImageOffset.x,
+                       theImageOffset.y,
+                       theImageScale.x,
+                       theImageScale.y,
+                       theGroundOffset.latd(),
+                       theGroundOffset.lond(),
+                       theGroundOffset.height(),
+                       theLatScale,
+                       theLonScale,
+                       theHeightScale,
+                       theXNumCoeffs,
+                       theXDenCoeffs,
+                       theYNumCoeffs,
+                       theYDenCoeffs);
+   return new ossimImageGeometry(new ossim2dTo2dIdentityTransform, proj);
+}
+
+const std::vector<double>& ossimRpcSolver::getImageXNumCoefficients()const
+{
+   return theXNumCoeffs;
+}
+
+const std::vector<double>& ossimRpcSolver::getImageXDenCoefficients()const
+{
+   return theXDenCoeffs;
+}
+
+const std::vector<double>& ossimRpcSolver::getImageYNumCoefficients()const
+{
+   return theYNumCoeffs;
+}
+
+const std::vector<double>& ossimRpcSolver::getImageYDenCoefficients()const
+{
+   return theYDenCoeffs;
+}
+
+double ossimRpcSolver::getImageXOffset()const
+{
+   return theImageOffset.x;
+}
+
+double ossimRpcSolver::getImageYOffset()const
+{
+   return theImageOffset.y;
+}
+
+double ossimRpcSolver::getLatOffset()const
+{
+   return theGroundOffset.latd();
+}
+
+double ossimRpcSolver::getLonOffset()const
+{
+   return theGroundOffset.lond();
+}
+
+double ossimRpcSolver::getHeightOffset()const
+{
+   return theGroundOffset.height();
+}
+
+double ossimRpcSolver::getImageXScale()const
+{
+   return theImageScale.x;
+}
+
+double ossimRpcSolver::getImageYScale()const
+{
+   return theImageScale.y;
+}
+
+double ossimRpcSolver::getLatScale()const
+{
+   return theLatScale;
+}
+
+double ossimRpcSolver::getLonScale()const
+{
+   return theLonScale;
+}
+
+double ossimRpcSolver::getHeightScale()const
+{
+   return theHeightScale;
+}
+
+double ossimRpcSolver::getRmsError()const
+{
+   return theError;
+}
+
+void ossimRpcSolver::solveInitialCoefficients(NEWMAT::ColumnVector& coeff,
+                                              const std::vector<double>& f,
+                                              const std::vector<double>& x,
+                                              const std::vector<double>& y,
+                                              const std::vector<double>& z)const
+{
+   ossim_uint32 idx = 0;
+   NEWMAT::Matrix m;
+   NEWMAT::ColumnVector r((int)f.size());
+   for(idx = 0; idx < f.size(); ++idx)
+   {
+      r[idx] = f[idx];
+   }
+   setupSystemOfEquations(m,
+                          r,
+                          x,
+                          y,
+                          z);
+   
+   coeff = invert(m.t()*m)*m.t()*r;
+}
+
+void ossimRpcSolver::solveCoefficients(NEWMAT::ColumnVector& coeff,
+                                       const std::vector<double>& f,
+                                       const std::vector<double>& x,
+                                       const std::vector<double>& y,
+                                       const std::vector<double>& z)const
+{
+   // this is an iterative  linear least square fit.  We really pobably need
+   // a nonlinear fit instead
+   //
+   ossim_uint32 idx = 0;
+   NEWMAT::Matrix m;
+
+   NEWMAT::ColumnVector r((int)f.size());
+
+   for(idx = 0; idx < f.size(); ++idx)
+   {
+      r[idx] = f[idx];
+   }
+
+   NEWMAT::ColumnVector tempCoeff;
+   NEWMAT::DiagonalMatrix weights((int)f.size());
+   NEWMAT::ColumnVector denominator(20);
+
+   // initialize the weight matrix to the identity
+   //
+   for(idx = 0; idx < f.size(); ++idx)
+   {
+      weights[idx] = 1.0;
+   }
+
+   double residualValue = 1.0/FLT_EPSILON;
+   ossim_uint32 iterations = 0;
+   NEWMAT::Matrix w2;
+   do
+   {
+      w2 = weights*weights;
+
+      // sets up the matrix to hold the system of
+      // equations
+      setupSystemOfEquations(m,
+                             r,
+                             x,
+                             y,
+                             z);
+
+      // solve the least squares solution.  Note: the invert is used
+      // to do a Singular Value Decomposition for the inverse since the
+      // matrix is more than likely singular.  Slower but more robust
+      //
+      tempCoeff = invert(m.t()*w2*m)*m.t()*w2*r;
+
+      // set up the weight matrix by using the denominator
+      //
+      for(idx = 0; idx < 19; ++idx)
+      {
+         denominator[idx+1] = tempCoeff[20+idx];
+      }
+      denominator[0] = 1.0;
+      
+      setupWeightMatrix(weights,
+                        denominator,
+                        r,
+                        x,
+                        y,
+                        z);
+
+      // compute the residual
+      //
+      NEWMAT::ColumnVector residual = m.t()*w2*(m*tempCoeff-r);
+
+      // now get the innerproduct
+      //
+      NEWMAT::Matrix tempRes = (residual.t()*residual);
+      residualValue = tempRes[0][0];
+
+      ++iterations;
+      
+   }while((residualValue >FLT_EPSILON)&&
+          (iterations < 10));
+   coeff = tempCoeff;
+
+}
+
+NEWMAT::Matrix ossimRpcSolver::invert(const NEWMAT::Matrix& m)const
+{
+   ossim_uint32 idx = 0;
+   NEWMAT::DiagonalMatrix d;
+   NEWMAT::Matrix u;
+   NEWMAT::Matrix v;
+
+   // decompose m.t*m which is stored in Temp into the singular values and vectors.
+   //
+   NEWMAT::SVD(m, d, u, v, true, true);
+   
+   // invert the diagonal
+   // this is just doing the reciprical fo all diagonal components and store back int
+   // d.  ths compute d inverse.
+   //
+   for(idx=0; idx < (ossim_uint32)d.Ncols(); ++idx)
+   {
+      if(d[idx] > FLT_EPSILON)
+      {
+         d[idx] = 1.0/d[idx];
+      }
+      else
+      {
+         d[idx] = 0.0;
+      }
+   }
+
+   //compute inverse of decomposed m;
+   return v*d*u.t();
+}
+
+
+void ossimRpcSolver::setupSystemOfEquations(NEWMAT::Matrix& equations,
+                                            const NEWMAT::ColumnVector& f,
+                                            const std::vector<double>& x,
+                                            const std::vector<double>& y,
+                                            const std::vector<double>& z)const
+{
+   ossim_uint32 idx;
+   equations.ReSize(f.Nrows(),
+                    39);
+   
+   for(idx = 0; idx < (ossim_uint32)f.Nrows();++idx)
+   {
+      equations[idx][0]  = 1;
+      equations[idx][1]  = x[idx];
+      equations[idx][2]  = y[idx];
+      equations[idx][3]  = z[idx];
+      equations[idx][4]  = x[idx]*y[idx];
+      equations[idx][5]  = x[idx]*z[idx];
+      equations[idx][6]  = y[idx]*z[idx];
+      equations[idx][7]  = x[idx]*x[idx];
+      equations[idx][8]  = y[idx]*y[idx];
+      equations[idx][9]  = z[idx]*z[idx];
+      equations[idx][10] = x[idx]*y[idx]*z[idx];
+      equations[idx][11] = x[idx]*x[idx]*x[idx];
+      equations[idx][12] = x[idx]*y[idx]*y[idx];
+      equations[idx][13] = x[idx]*z[idx]*z[idx];
+      equations[idx][14] = x[idx]*x[idx]*y[idx];
+      equations[idx][15] = y[idx]*y[idx]*y[idx];
+      equations[idx][16] = y[idx]*z[idx]*z[idx];
+      equations[idx][17] = x[idx]*x[idx]*z[idx];
+      equations[idx][18] = y[idx]*y[idx]*z[idx];
+      equations[idx][19] = z[idx]*z[idx]*z[idx];
+      equations[idx][20] = -f[idx]*x[idx];
+      equations[idx][21] = -f[idx]*y[idx];
+      equations[idx][22] = -f[idx]*z[idx];
+      equations[idx][23] = -f[idx]*x[idx]*y[idx];
+      equations[idx][24] = -f[idx]*x[idx]*z[idx];
+      equations[idx][25] = -f[idx]*y[idx]*z[idx];
+      equations[idx][26] = -f[idx]*x[idx]*x[idx];
+      equations[idx][27] = -f[idx]*y[idx]*y[idx];
+      equations[idx][28] = -f[idx]*z[idx]*z[idx];
+      equations[idx][29] = -f[idx]*x[idx]*y[idx]*z[idx];
+      equations[idx][30] = -f[idx]*x[idx]*x[idx]*x[idx];
+      equations[idx][31] = -f[idx]*x[idx]*y[idx]*y[idx];
+      equations[idx][32] = -f[idx]*x[idx]*z[idx]*z[idx];
+      equations[idx][33] = -f[idx]*x[idx]*x[idx]*y[idx];
+      equations[idx][34] = -f[idx]*y[idx]*y[idx]*y[idx];
+      equations[idx][35] = -f[idx]*y[idx]*z[idx]*z[idx];
+      equations[idx][36] = -f[idx]*x[idx]*x[idx]*z[idx];
+      equations[idx][37] = -f[idx]*y[idx]*y[idx]*z[idx];
+      equations[idx][38] = -f[idx]*z[idx]*z[idx]*z[idx];
+   }
+}
+
+void ossimRpcSolver::setupWeightMatrix(NEWMAT::DiagonalMatrix& result, // holds the resulting weights
+                                       const NEWMAT::ColumnVector& coefficients,
+                                       const NEWMAT::ColumnVector& f,
+                                       const std::vector<double>& x,
+                                       const std::vector<double>& y,
+                                       const std::vector<double>& z)const
+{
+   result.ReSize(f.Nrows());
+   ossim_uint32 idx = 0;
+   ossim_uint32 idx2 = 0;
+   NEWMAT::RowVector row(coefficients.Nrows());
+   
+    for(idx = 0; idx < (ossim_uint32)f.Nrows(); ++idx)
+    {
+       row[0]  = 1;
+       row[1]  = x[idx];
+       row[2]  = y[idx];
+       row[3]  = z[idx];
+       row[4]  = x[idx]*y[idx];
+       row[5]  = x[idx]*z[idx];
+       row[6]  = y[idx]*z[idx];
+       row[7]  = x[idx]*x[idx];
+       row[8]  = y[idx]*y[idx];
+       row[9]  = z[idx]*z[idx];
+       row[10] = x[idx]*y[idx]*z[idx];
+       row[11] = x[idx]*x[idx]*x[idx];
+       row[12] = x[idx]*y[idx]*y[idx];
+       row[13] = x[idx]*z[idx]*z[idx];
+       row[14] = x[idx]*x[idx]*y[idx];
+       row[15] = y[idx]*y[idx]*y[idx];
+       row[16] = y[idx]*z[idx]*z[idx];
+       row[17] = x[idx]*x[idx]*z[idx];
+       row[18] = y[idx]*y[idx]*z[idx];
+       row[19] = z[idx]*z[idx]*z[idx];
+
+      result[idx] = 0.0;
+      for(idx2 = 0; idx2 < (ossim_uint32)row.Ncols(); ++idx2)
+      {
+         result[idx] += row[idx2]*coefficients[idx2];
+      }
+
+      if(result[idx] > FLT_EPSILON)
+      {
+         result[idx] = 1.0/result[idx];
+      }
+    }
+}
+
+double ossimRpcSolver::eval(const std::vector<double>& coeff,
+                            double x,
+                            double y,
+                            double z)const
+{
+   return coeff[ 0]       + coeff[ 1]*x     + coeff[ 2]*y     + coeff[ 3]*z     +
+          coeff[ 4]*x*y   + coeff[ 5]*x*z   + coeff[ 6]*y*z   + coeff[ 7]*x*x   +
+          coeff[ 8]*y*y   + coeff[ 9]*z*z   + coeff[10]*x*y*z + coeff[11]*x*x*x +
+          coeff[12]*x*y*y + coeff[13]*x*z*z + coeff[14]*x*x*y + coeff[15]*y*y*y +
+          coeff[16]*y*z*z + coeff[17]*x*x*z + coeff[18]*y*y*z + coeff[19]*z*z*z;
+}
+
+
+ossimRefPtr<ossimNitfRegisteredTag> ossimRpcSolver::getNitfRpcBTag() const
+{
+   ossimNitfRpcBTag* rpcbTag = new ossimNitfRpcBTag();
+
+   // success always true
+   rpcbTag->setSuccess(true);
+
+   // temp "0"...
+   rpcbTag->setErrorBias(0.0);
+
+   // temp "0"...
+   rpcbTag->setErrorRand(0.0);
+
+   // line offset
+   rpcbTag->setLineOffset(static_cast<ossim_uint32>(getImageYOffset()));
+
+   // sample offset
+   rpcbTag->setSampleOffset(static_cast<ossim_uint32>(getImageXOffset()));
+
+   // latitude offset
+   rpcbTag->setGeodeticLatOffset(getLatOffset());
+
+   // longitude offset
+   rpcbTag->setGeodeticLonOffset(getLonOffset());
+
+   // height offset
+   rpcbTag->setGeodeticHeightOffset(
+      static_cast<ossim_int32>(getHeightOffset()));
+
+   // line scale
+   rpcbTag->setLineScale(static_cast<ossim_uint32>(getImageYScale()));
+
+   // sample scale
+   rpcbTag->setSampleScale(static_cast<ossim_uint32>(getImageXScale()));
+
+   // latitude scale
+   rpcbTag->setGeodeticLatScale(getLatScale());
+
+   // longitude scale
+   rpcbTag->setGeodeticLonScale(getLonScale());
+
+   // height scale
+   rpcbTag->setGeodeticHeightScale(static_cast<ossim_int32>(getHeightScale()));
+
+   // line numerator coefficients
+   rpcbTag->setLineNumeratorCoeff(getImageYNumCoefficients());
+   
+   // line denominator coefficients
+   rpcbTag->setLineDenominatorCoeff(getImageYDenCoefficients());
+
+   // sample numerator coefficients
+   rpcbTag->setSampleNumeratorCoeff(getImageXNumCoefficients());
+
+   // sample denominator coefficients
+   rpcbTag->setSampleDenominatorCoeff(getImageXDenCoefficients());
+
+   // Return it as an ossimRefPtr<ossimNitfRegisteredTag>...
+   ossimRefPtr<ossimNitfRegisteredTag> tag = rpcbTag;
+   
+   return tag;
+}
diff --git a/src/projection/ossimRsmModel.cpp b/src/projection/ossimRsmModel.cpp
new file mode 100644
index 0000000..d273746
--- /dev/null
+++ b/src/projection/ossimRsmModel.cpp
@@ -0,0 +1,720 @@
+//---
+// File: ossimRsmModel.cpp
+//
+//  RP 
+//  LIMITATIONS - This is supporting only the RSM features that have been
+//  observed in current data samples and does not attempt to support the entire
+//  RSM specification.
+//  Examples of currently unsupported items include ->
+//  1.  multiple RSMPC tags for different polynomials for separate image sections 
+//  2.  Error Covariance (this may gain priority as we have access to RSMECA data)
+//  3.  Illumination model
+//  4.  Rectangular coodinate system conversion (RSDIDA GRNDD = "R")
+// 
+//---
+
+#include <ossim/projection/ossimRsmModel.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/elevation/ossimHgtRef.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+
+#include <algorithm>
+#include <iomanip>
+#include <iostream>
+#include <sstream>
+
+RTTI_DEF1(ossimRsmModel, "ossimRsmModel", ossimSensorModel);
+
+// Define Trace flags for use within this file:
+static const ossimTrace traceExec  ("ossimRsmModel:exec");
+static const ossimTrace traceDebug ("ossimRsmModel:debug");
+
+static std::string MODEL_TYPE_KW  = "ossimRsmModel";
+
+ossimRsmModel::ossimRsmModel()
+   :
+   ossimSensorModel(),
+   m_ida(),
+   m_pia(),   
+   m_pca()
+{
+   initAdjustableParameters();
+   
+}
+
+ossimRsmModel::ossimRsmModel( const ossimRsmModel& obj )
+   :
+   ossimSensorModel( obj ),
+   m_ida( obj.m_ida ),
+   m_pia( obj.m_pia ),
+   m_pca( obj.m_pca )
+{
+   
+}
+
+const ossimRsmModel& ossimRsmModel::operator=( const ossimRsmModel& rhs )
+{
+   if (this != &rhs)
+   {
+      ossimSensorModel::operator=(rhs);
+      m_ida = rhs.m_ida;
+      m_pia = rhs.m_pia;      
+      m_pca = rhs.m_pca;
+   }
+   return *this;  
+}
+
+ossimRsmModel::~ossimRsmModel()
+{
+}
+
+//---
+//  METHOD: ossimRsmModel::worldToLineSample()
+//  
+//  Overrides base class implementation. Directly computes line-sample from
+//  the polynomials.
+//---
+void ossimRsmModel::worldToLineSample(const ossimGpt& ground_point,
+                                      ossimDpt&       img_pt) const
+{
+   if(ground_point.isLatNan() || ground_point.isLonNan() )
+   {
+      img_pt.makeNan();
+      return;
+   }
+
+   //---
+   // RSMIDA GRNDD Ground Domain Form:
+   // G: Geodetic: range x is -pi to pi, y is -pi/2 to pi/2
+   // H: Geodetic: range x is 0 to 2pi, y is -pi/2 to pi/2 (where image is close to pi.
+   // R: Rectangular (not supported).
+   //---
+
+   // Initial xyz for computing the pca index.
+   double x;
+   if ( m_ida.m_grndd == 'H' )
+   {
+      x = ossim::degreesToRadians((ground_point.lon >= 0.0) ?
+                                  ground_point.lon : ground_point.lon + 360.0);
+   }
+   else
+   {
+      x = ossim::degreesToRadians( ground_point.lon );
+   }
+      
+   double y = ossim::degreesToRadians(ground_point.lat);
+   double z = ground_point.hgt;
+   if ( ossim::isnan( z ) )
+   {
+      z = 0.0; // ??? drb
+   }
+
+   ossim_uint32 pcaIndex = getPcaIndex( x, y, z );
+
+   //---
+   // Normalize the lat, lon, hgt:
+   // a_norm = (a-offset)/scalefactor
+   //---
+   y = (y - m_pca[pcaIndex].m_ynrmo) / m_pca[pcaIndex].m_ynrmsf;
+   x = (x - m_pca[pcaIndex].m_xnrmo) / m_pca[pcaIndex].m_xnrmsf;   
+   if( ground_point.isHgtNan() )
+   {
+     z = ( - m_pca[pcaIndex].m_znrmo) / m_pca[pcaIndex].m_znrmsf;
+   }
+   else
+   {
+     z = (ground_point.hgt - m_pca[pcaIndex].m_znrmo) / m_pca[pcaIndex].m_znrmsf;
+   }
+
+   double rnNrm =  polynomial(x, y, z, m_pca[pcaIndex].m_rnpwrx, m_pca[pcaIndex].m_rnpwry, m_pca[pcaIndex].m_rnpwrz, m_pca[pcaIndex].m_rnpcf); 
+   double rdNrm =  polynomial(x, y, z, m_pca[pcaIndex].m_rdpwrx, m_pca[pcaIndex].m_rdpwry, m_pca[pcaIndex].m_rdpwrz, m_pca[pcaIndex].m_rdpcf);
+   double cnNrm =  polynomial(x, y, z, m_pca[pcaIndex].m_cnpwrx, m_pca[pcaIndex].m_cnpwry, m_pca[pcaIndex].m_cnpwrz, m_pca[pcaIndex].m_cnpcf);
+   double cdNrm =  polynomial(x, y, z, m_pca[pcaIndex].m_cdpwrx, m_pca[pcaIndex].m_cdpwry, m_pca[pcaIndex].m_cdpwrz, m_pca[pcaIndex].m_cdpcf);
+   
+   double rNrm  = rnNrm / rdNrm;
+   double cNrm  = cnNrm / cdNrm;
+
+   //---
+   //  Unnormalize the computed value
+   //  a = (a_norm * scalefactor) + offset
+   //
+   //  Note:
+   //
+   //  RSM (0,0) is upper left corner of pixel(0,0). OSSIM (0,0) is
+   //  center of the pixel; hence, the - 0.5. (drb 22 May 2015)
+   //---
+   
+   // img_pt.line = (rNrm * m_rnrmsf) + m_rnrmo; 
+   // img_pt.samp = (cNrm * m_cnrmsf) + m_cnrmo; 
+   img_pt.line = (rNrm * m_pca[pcaIndex].m_rnrmsf) + m_pca[pcaIndex].m_rnrmo - 0.5; 
+   img_pt.samp = (cNrm * m_pca[pcaIndex].m_cnrmsf) + m_pca[pcaIndex].m_cnrmo - 0.5; 
+
+
+} // End: ossimRsmModel::worldToLineSample( ... )
+
+//---
+//  METHOD: ossimRsmModel::lineSampleToWorld()
+//  
+//  Overrides base class implementation. Performs DEM intersection.
+//---
+void  ossimRsmModel::lineSampleToWorld(const ossimDpt& imagePoint,
+                                       ossimGpt&       worldPoint) const
+{
+   if(!imagePoint.hasNans())
+   {
+      ossimEcefRay ray;
+      
+      //---
+      // Note:
+      // RSM (0,0) is upper left corner of pixel(0,0). OSSIM (0,0) is
+      //  center of the pixel; hence, the + 0.5. (drb 22 May 2015)
+      //---
+      // imagingRay(imagePoint, ray);
+      imagingRay(ossimDpt(imagePoint.x+0.5, imagePoint.y+0.5), ray);
+      ossimElevManager::instance()->intersectRay(ray, worldPoint);
+   }
+   else
+   {
+      worldPoint.makeNan();
+   }
+}
+
+//---
+//  METHOD: ossimRsmModel::lineSampleHeightToWorld()
+//  
+//  Performs reverse projection of image line/sample to ground point.
+//  The imaging ray is intersected with a level plane at height = elev.
+//
+//  NOTE: U = line, V = sample -- this differs from the convention.
+//
+//---
+void ossimRsmModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                            const double&   ellHeight,
+                                            ossimGpt&       gpt) const
+{
+   // Borrowed from ossimRpcModel algorithm to converge on polynomial roots
+
+   //---
+   // Constants for convergence tests:
+   //---
+   // SPEC says 1/20 of a pixel for polynomial fit, so converge to at least that point
+   static const int    MAX_NUM_ITERATIONS  = 100;
+   static const double CONVERGENCE_EPSILON = 0.05;  // pixels
+
+   ossim_uint32 pcaIndex = getPcaIndex( image_point, true );
+   
+   // Image point of 0 to ossim is 0.5 to RSM.
+   // double U    = (image_point.y-m_rnrmo) / (m_rnrmsf);
+   // double V    = (image_point.x-m_cnrmo) / (m_cnrmsf);
+
+   double U = (image_point.y+0.5-m_pca[pcaIndex].m_rnrmo) / (m_pca[pcaIndex].m_rnrmsf);
+   double V = (image_point.x+0.5-m_pca[pcaIndex].m_cnrmo) / (m_pca[pcaIndex].m_cnrmsf);
+
+   //---
+   // Initialize quantities to be used in the iteration for ground point:
+   //---
+   double nlat = 0.0;  // normalized latitude
+   double nlon = 0.0;  // normalized longitude
+   double nhgt;
+
+   if(ossim::isnan(ellHeight))
+   {
+     nhgt = (- m_pca[pcaIndex].m_znrmo) / m_pca[pcaIndex].m_znrmsf;  // norm height
+   }
+   else
+   {
+      nhgt = (ellHeight - m_pca[pcaIndex].m_znrmo) / m_pca[pcaIndex].m_znrmsf;  // norm height
+   }
+
+   double epsilonU = CONVERGENCE_EPSILON/m_pca[pcaIndex].m_rnrmsf;
+   double epsilonV = CONVERGENCE_EPSILON/m_pca[pcaIndex].m_cnrmsf;
+   int    iteration = 0;
+   //---
+   // Declare variables only once outside the loop. These include:
+   // * polynomials (numerators Pu, Pv, and denominators Qu, Qv),
+   // * partial derivatives of polynomials wrt X, Y,
+   // * computed normalized image point: Uc, Vc,
+   // * residuals of normalized image point: deltaU, deltaV,
+   // * partial derivatives of Uc and Vc wrt X, Y,
+   // * corrections to normalized lat, lon: deltaLat, deltaLon.
+   //---
+   double Pu, Qu, Pv, Qv;
+   double dPu_dLat, dQu_dLat, dPv_dLat, dQv_dLat;
+   double dPu_dLon, dQu_dLon, dPv_dLon, dQv_dLon;
+   double Uc, Vc;
+   double deltaU, deltaV;
+   double dU_dLat, dU_dLon, dV_dLat, dV_dLon, W;
+   double deltaLat, deltaLon;
+
+   //---
+   // Now iterate until the computed Uc, Vc is within epsilon of the desired
+   // image point U, V:
+   //---
+   do
+   {
+      //---
+      // Calculate the normalized line and sample Uc, Vc as ratio of
+      // polynomials Pu, Qu and Pv, Qv:
+      //---
+      Pu = polynomial(nlon, nlat, nhgt, m_pca[pcaIndex].m_rnpwrx, m_pca[pcaIndex].m_rnpwry, m_pca[pcaIndex].m_rnpwrz, m_pca[pcaIndex].m_rnpcf);
+      Qu = polynomial(nlon, nlat, nhgt, m_pca[pcaIndex].m_rdpwrx, m_pca[pcaIndex].m_rdpwry, m_pca[pcaIndex].m_rdpwrz, m_pca[pcaIndex].m_rdpcf);
+      Pv = polynomial(nlon, nlat, nhgt, m_pca[pcaIndex].m_cnpwrx, m_pca[pcaIndex].m_cnpwry, m_pca[pcaIndex].m_cnpwrz, m_pca[pcaIndex].m_cnpcf);
+      Qv = polynomial(nlon, nlat, nhgt, m_pca[pcaIndex].m_cdpwrx, m_pca[pcaIndex].m_cdpwry, m_pca[pcaIndex].m_cdpwrz, m_pca[pcaIndex].m_cdpcf);
+      Uc = Pu/Qu;
+      Vc = Pv/Qv;
+
+      //---
+      // Compute residuals between desired and computed line, sample:
+      //---
+      deltaU = U - Uc;
+      deltaV = V - Vc;
+
+      //---
+      // Check for convergence and skip re-linearization if converged:
+      //---
+      if ((fabs(deltaU) > epsilonU) || (fabs(deltaV) > epsilonV))
+      {
+         //---
+         // Analytically compute the partials of each polynomial wrt lat, lon:
+         //---
+         dPu_dLat = dPoly_dLat(nlon, nlat, nhgt, m_pca[pcaIndex].m_rnpwrx, m_pca[pcaIndex].m_rnpwry, m_pca[pcaIndex].m_rnpwrz, m_pca[pcaIndex].m_rnpcf);
+         dQu_dLat = dPoly_dLat(nlon, nlat, nhgt, m_pca[pcaIndex].m_rdpwrx, m_pca[pcaIndex].m_rdpwry, m_pca[pcaIndex].m_rdpwrz, m_pca[pcaIndex].m_rdpcf);
+         dPv_dLat = dPoly_dLat(nlon, nlat, nhgt, m_pca[pcaIndex].m_cnpwrx, m_pca[pcaIndex].m_cnpwry, m_pca[pcaIndex].m_cnpwrz, m_pca[pcaIndex].m_cnpcf);
+         dQv_dLat = dPoly_dLat(nlon, nlat, nhgt, m_pca[pcaIndex].m_cdpwrx, m_pca[pcaIndex].m_cdpwry, m_pca[pcaIndex].m_cdpwrz, m_pca[pcaIndex].m_cdpcf);
+         dPu_dLon = dPoly_dLon(nlon, nlat, nhgt, m_pca[pcaIndex].m_rnpwrx, m_pca[pcaIndex].m_rnpwry, m_pca[pcaIndex].m_rnpwrz, m_pca[pcaIndex].m_rnpcf);
+         dQu_dLon = dPoly_dLon(nlon, nlat, nhgt, m_pca[pcaIndex].m_rdpwrx, m_pca[pcaIndex].m_rdpwry, m_pca[pcaIndex].m_rdpwrz, m_pca[pcaIndex].m_rdpcf);
+         dPv_dLon = dPoly_dLon(nlon, nlat, nhgt, m_pca[pcaIndex].m_cnpwrx, m_pca[pcaIndex].m_cnpwry, m_pca[pcaIndex].m_cnpwrz, m_pca[pcaIndex].m_cnpcf);
+         dQv_dLon = dPoly_dLon(nlon, nlat, nhgt, m_pca[pcaIndex].m_cdpwrx, m_pca[pcaIndex].m_cdpwry, m_pca[pcaIndex].m_cdpwrz, m_pca[pcaIndex].m_cdpcf);
+
+         //---
+         // Analytically compute partials of quotients U and V wrt lat, lon:
+         //---
+         dU_dLat = (Qu*dPu_dLat - Pu*dQu_dLat)/(Qu*Qu);
+         dU_dLon = (Qu*dPu_dLon - Pu*dQu_dLon)/(Qu*Qu);
+         dV_dLat = (Qv*dPv_dLat - Pv*dQv_dLat)/(Qv*Qv);
+         dV_dLon = (Qv*dPv_dLon - Pv*dQv_dLon)/(Qv*Qv);
+
+         W = dU_dLon*dV_dLat - dU_dLat*dV_dLon;
+
+         //---
+         // Now compute the corrections to normalized lat, lon:
+         //---
+         deltaLat = (dU_dLon*deltaV - dV_dLon*deltaU) / W;
+         deltaLon = (dV_dLat*deltaU - dU_dLat*deltaV) / W;
+         nlat += deltaLat;
+         nlon += deltaLon;
+      }
+
+      ++iteration;
+
+   } while (((fabs(deltaU)>epsilonU) || (fabs(deltaV)>epsilonV))
+            && (iteration < MAX_NUM_ITERATIONS));
+   //---
+   // Test for exceeding allowed number of iterations. Flag error if so:
+   //---
+   if (iteration == MAX_NUM_ITERATIONS)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "WARNING ossimRsmModel::lineSampleHeightToWorld:\n"
+         << "Max number of iterations reached in ground point "
+         << "solution. Results are inaccurate." << endl;
+   }
+
+   //---
+   // Now un-normalize the ground point lat, lon and establish return quantity:
+   //
+   // lon will 0 to 2PI when image is near PI radians as specified in RSMIDA
+   // GRNDD field when value is "H" versus "G".   OSSIMGPT wrap handles this
+   // automatically, so no need to worry about it.
+   //---
+   gpt.lat = ossim::radiansToDegrees(nlat*m_pca[pcaIndex].m_ynrmsf + m_pca[pcaIndex].m_ynrmo);
+   gpt.lon = ossim::radiansToDegrees(nlon*m_pca[pcaIndex].m_xnrmsf + m_pca[pcaIndex].m_xnrmo);
+   gpt.hgt = (nhgt * m_pca[pcaIndex].m_znrmsf) + m_pca[pcaIndex].m_znrmo; //ellHeight;
+
+   //---
+   // Note: See above note. Added in wrap call. Longitude was coming out 242
+   // when should have been -118. (drb - 22 May 2015)
+   //---
+   gpt.wrap();
+   
+} // End: ossimRsmModel::lineSampleHeightToWorld( ... )
+
+//---
+//  METHOD: ossimRsmModel::imagingRay()
+//  
+//  Constructs a ray by intersecting 2 ellipsoid heights above and
+//  below the RPC height offset, and then forming a vector between the two.
+//
+//---
+void ossimRsmModel::imagingRay(const ossimDpt& imagePoint,
+                               ossimEcefRay&   imageRay) const
+{
+   ossim_uint32 pcaIndex = getPcaIndex( imagePoint, true );
+   
+   //---
+   // For "from point", "to point" we want the image ray to be from above the
+   // ellipsoid down to Earth.
+   // 
+   // It appears the ray "from point" must be above the ellipsiod for the
+   // ossimElevSource::intersectRay method; ultimately, the
+   // ossimEllipsoid::nearestIntersection method, else it goes off in the
+   // weeds...
+   //---
+   double vectorLength = m_pca[pcaIndex].m_znrmsf * 2.0;
+
+   ossimGpt gpt;
+
+   // "from" point
+   double intHgt = m_pca[pcaIndex].m_znrmo + vectorLength;
+   lineSampleHeightToWorld(imagePoint, intHgt, gpt);
+   ossimEcefPoint intECFfrom(gpt);
+
+   // "to" point
+   lineSampleHeightToWorld(imagePoint, m_pca[pcaIndex].m_znrmo, gpt);
+   ossimEcefPoint intECFto(gpt);
+
+   // Construct ray
+   ossimEcefRay ray(intECFfrom, intECFto);
+
+   imageRay = ray;
+}
+
+void ossimRsmModel::updateModel()
+{
+}
+
+void ossimRsmModel::initAdjustableParameters()
+{
+}
+
+ossimObject* ossimRsmModel::dup() const
+{
+   return new ossimRsmModel(*this);
+}
+
+//---
+//  METHOD: ossimRsmModel::print()
+//  
+//  Formatted dump of data members.
+//---
+std::ostream& ossimRsmModel::print(std::ostream& out) const
+{
+   std::string prefix = "";
+   ossimKeywordlist kwl;
+   saveState( kwl, prefix.c_str() );
+   out << kwl;
+   return out;
+}
+
+bool ossimRsmModel::saveState(ossimKeywordlist& kwl,
+                              const char* prefix) const
+{
+   static const char MODULE[] = "ossimRsmModel::saveState";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   kwl.add(prefix, ossimKeywordNames::TYPE_KW, MODEL_TYPE_KW.c_str());
+
+   //---
+   // Hand off to base class for common stuff:
+   //---
+   ossimSensorModel::saveState(kwl, prefix);
+
+   std::string pfx = (prefix ? prefix : "" );
+
+   // IDA:
+   m_ida.saveState( kwl, prefix );
+
+   // PIA:
+   m_pia.saveState( kwl, prefix );  
+
+   // PCA:
+   for ( ossim_uint32 i = 0; i < m_pca.size(); ++i )
+   {
+      m_pca[i].saveState( kwl, pfx, i );
+   }
+   
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return true;
+}
+
+bool ossimRsmModel::loadState(const ossimKeywordlist& kwl,
+                              const char* prefix) 
+{
+   static const char MODULE[] = "ossimRsmModel::loadState";
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   bool status = false;
+   
+   // Check for type match before preceeding:
+   std::string pfx = ( prefix ? prefix : "" );
+   std::string type = kwl.findKey( pfx, std::string(ossimKeywordNames::TYPE_KW) );
+   if ( (type == "ossimNitfRsmModel" ) || ( type == MODEL_TYPE_KW ) )
+   {
+      // Pass on to the base-class for parsing first:
+      if ( ossimSensorModel::loadState(kwl, prefix) )
+      {
+         if ( m_ida.loadState( kwl, pfx ) )
+         {
+            if ( m_pia.loadState( kwl, pfx ) )
+            {
+               m_pca.clear();
+               
+               for ( ossim_uint32 tagIndex = 0; tagIndex < m_pia.m_tnis; ++tagIndex )
+               {
+                  ossimRsmpca pca;
+                  if ( pca.loadState( kwl, pfx, tagIndex ) )
+                  {
+                     m_pca.push_back( pca );
+                  }
+                  else
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "WARNING! RSMPCA[" << tagIndex << "] intitialization failed!"
+                        << std::endl;
+                     break; // Get out...
+                  }
+               }
+
+               // Should now have a rsmpca record for each segment.
+               if ( m_pia.m_tnis == (ossim_uint32)m_pca.size() )
+               {
+                  // Set the status for downstream code.
+                  status = true;
+                  
+                  updateModel();
+               }
+               
+            } // Matches: if ( m_pia.loadState( kwl, pfx ) )
+            
+         } // Matches:if ( m_ida.loadState( kwl, pfx ) ) 
+         
+      } // Matches: if ( ossimSensorModel::loadState(kwl, prefix) )
+      
+   } // Matches: if ( (type == "ossimNitfRsmModel" ) || ...
+   
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit status = " << (status?"true":"false") << "\n";
+   }
+   
+   return status;
+}
+
+ossim_uint32 ossimRsmModel::getPcaIndex(
+   const double& x, const double& y, const double& z) const
+{
+   ossimDpt ipt;
+   lowOrderPolynomial( x, y, z, ipt );
+   return getPcaIndex( ipt, false );
+}
+
+ossim_uint32 ossimRsmModel::getPcaIndex( const ossimDpt& ipt, bool shiftPoint ) const
+{
+   //---
+   //  RSM (0,0) is upper left corner of pixel(0,0). OSSIM (0,0) is
+   //  center of the pixel; hence, the shift 0.5 if coming from ossim.
+   //---
+   double shift = shiftPoint ? 0.5 : 0.0;
+   
+   // Row section number:
+   double rsn = std::floor( ( ipt.y + shift - (double)(m_ida.m_minr) ) /
+                            (double)(m_pia.m_rssiz) );
+   if ( rsn < 0.0 )
+   {
+      rsn = 0.0;
+   }
+   else if ( rsn > (m_pia.m_rnis-1) )
+   {
+      rsn = m_pia.m_rnis-1;
+   }
+   // Column section number:
+   double csn = std::floor( ( ipt.x + shift - (double)(m_ida.m_minc) ) / (double)(m_pia.m_cssiz) );
+   if ( csn < 0.0 )
+   {
+      csn = 0.0;
+   }
+   else if ( csn > (m_pia.m_cnis-1) )
+   {
+      csn = m_pia.m_cnis-1;
+   }
+
+   //return static_cast<ossim_uint32>(rsn) * m_pia.m_rnis + static_cast<ossim_uint32>(csn);
+   return static_cast<ossim_uint32>(rsn) * m_pia.m_cnis + static_cast<ossim_uint32>(csn);
+}
+
+void ossimRsmModel::lowOrderPolynomial(
+   const double& x, const double& y, const double& z, ossimDpt& ipt ) const
+{
+   ipt.y = m_pia.m_r0 + m_pia.m_rx * x + m_pia.m_ry * y + m_pia.m_rz * z +
+      m_pia.m_rxx * x * x + m_pia.m_rxy * x * y + m_pia.m_rxz * x * z +
+      m_pia.m_ryy * y * y + m_pia.m_ryz * y * z + m_pia.m_rzz * z * z;
+
+   ipt.x = m_pia.m_c0 + m_pia.m_cx * x + m_pia.m_cy * y + m_pia.m_cz * z +
+      m_pia.m_cxx * x * x + m_pia.m_cxy * x * y + m_pia.m_cxz * x * z +
+      m_pia.m_cyy * y * y + m_pia.m_cyz * y * z + m_pia.m_czz * z * z;
+}
+
+double ossimRsmModel::polynomial(
+   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
+   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<double> pcf) const
+{
+   double r = 0.0;
+   ossim_uint32 index = 0;
+   for (ossim_uint32 k = 0; k <= maxz; ++k)
+   {
+      for (ossim_uint32 j = 0; j <= maxy; ++j)
+      {
+         for (ossim_uint32 i = 0; i <= maxx; ++i)
+         {
+            r+=pcf[index]*std::pow(x,(double)i)*std::pow(y,(double)j)*std::pow(z,(double)k);
+            ++index;
+         }
+      }
+   }
+   return r;
+}
+
+double ossimRsmModel::dPoly_dLat(
+   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
+   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<double> pcf) const
+                                 
+{
+   double dr = 0.0;
+   ossim_uint32 index = 0;
+   for (ossim_uint32 k = 0; k <= maxz; ++k)
+   {
+      for (ossim_uint32 j = 0; j <= maxy; ++j)
+      {
+         for (ossim_uint32 i = 0; i <= maxx; ++i)
+         {
+            if (j>0)
+            {
+               dr+=j*pcf[index]*std::pow(x,(double)i)*std::pow(y,(double)(j-1))*std::pow(z,(double)k);
+            }
+            ++index;
+         }
+      }
+   }
+   return dr;
+}
+
+double ossimRsmModel::dPoly_dLon(
+   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
+   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<double> pcf) const
+{
+   double dr = 0.0;
+   ossim_uint32 index = 0;
+   for (ossim_uint32 k = 0; k <= maxz; ++k)
+   {
+      for (ossim_uint32 j = 0; j <= maxy; ++j)
+      {
+         for (ossim_uint32 i = 0; i <= maxx; ++i)
+         {
+            if (i>0)
+            {
+               dr += i*pcf[index]*std::pow(x,(double)(i-1)) *
+                  std::pow(y,(double)j)*std::pow(z,(double)k);
+            }
+            ++index;
+         } 
+      }     
+   }
+   return dr;
+}
+
+double ossimRsmModel::dPoly_dHgt(
+   const double& x, const double& y, const double& z, const ossim_uint32& maxx,
+   const ossim_uint32& maxy, const ossim_uint32& maxz, std::vector<double> pcf) const
+{
+   double dr = 0.0;
+   ossim_uint32 index = 0;
+   for (ossim_uint32 k = 0; k <= maxz; ++k)
+   {
+      for (ossim_uint32 j = 0; j <= maxy; ++j)
+      {
+         for (ossim_uint32 i = 0; i <= maxx; ++i)
+         {
+            if (k>0)
+            {
+               dr += k*pcf[index]*std::pow(x,(double)i) *
+                  std::pow(y,(double)j)*std::pow(z,(double)(k-1));
+            }
+            ++index;
+         } 
+      }     
+   }
+   return dr;
+}
+
+bool ossimRsmModel::validate() const
+{
+   static const char MODULE[] = "ossimRsmModel::validate";
+
+   bool status = true;
+
+   if (  (m_pia.m_rnis == 0) ||  (m_pia.m_rnis == 0) || (m_pia.m_tnis == 0) )
+   {
+      status = false;
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " ERROR: rsmpia must have at least one section!" << std::endl;
+   }
+
+   if ( m_pca.size() != m_pia.m_tnis )
+   {
+      status = false;
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " ERROR: rsmpca array not equal to section count!" << std::endl;
+   }
+   if ( ( m_ida.m_grndd != 'G' ) && ( m_ida.m_grndd != 'H' ) && ( m_ida.m_grndd != 'R' ) )
+   {
+      status = false;
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " ERROR: rsmida grndd Ground Domain Form not set!" << std::endl;
+   }
+   if ( m_ida.m_grndd == 'R' )
+   {
+      status = false;
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " ERROR: rsmida grndd Rectangular Ground Domain not supported!" << std::endl;
+   }
+   if ( m_pia.m_rssiz == 0 )
+   {
+      status = false; // divide by zero.
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " ERROR: rsmpia rrsiz Section row size cannot be zero!" << std::endl;
+   }
+   if ( m_pia.m_cssiz == 0 )
+   {
+      status = false; // divide by zero.
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE
+         << " ERROR: rsmpia cssiz Section column size cannot be zero!" << std::endl;
+   }
+
+   return status;
+}
+
+
diff --git a/src/projection/ossimSarModel.cpp b/src/projection/ossimSarModel.cpp
new file mode 100644
index 0000000..76f3759
--- /dev/null
+++ b/src/projection/ossimSarModel.cpp
@@ -0,0 +1,1418 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Base class for Synthetic Aperture Radar model.
+//
+//              This model represents a standard model using relatively
+//              generic support data based on the following references:
+//                [1] Modern Photogrammetry; Mikhail, Bethel, & McGlone;
+//                    Sections 11.7-11.9.  Equation number references are
+//                    provided where possible for added clarity.
+//                [2] The Compendium of Controlled Extensions for NITFS
+//                    21 Mar 2006, paragraph E.3.8, SAR MPDSR
+//
+//----------------------------------------------------------------------------
+// $Id: ossimSarModel.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <ossim/elevation/ossimHgtRef.h>
+#include <ossim/projection/ossimSarModel.h>
+#include <ossim/base/ossimLsrSpace.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotify.h>
+
+RTTI_DEF1(ossimSarModel, "ossimSarModel", ossimSensorModel);
+
+static ossimTrace traceExec (ossimString("ossimSarModel:exec"));
+static ossimTrace traceDebug(ossimString("ossimSarModel:debug"));
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimSarModel.cpp 17206 2010-04-25 23:20:40Z dburken $";
+#endif
+
+static const char ACQ_MODE_KW[]         = "acq_mode";
+static const char ORP_POS_KW[]          = "orp_pos";
+static const char ORP_CENTER_KW[]       = "orp_ctr_xy";
+static const char OPNORM_KW[]           = "opnorm";
+static const char OP_X_AXIS_KW[]        = "opx";
+static const char OIPR_KW[]             = "oipr";
+static const char PIX_SIZE_KW[]         = "pixel_size";
+static const char ARP_TIME_KW[]         = "arptm";
+static const char ARP_POLY_COEFF_X_KW[] = "arppol_coeff_x";
+static const char ARP_POLY_COEFF_Y_KW[] = "arppol_coeff_y";
+static const char ARP_POLY_COEFF_Z_KW[] = "arppol_coeff_z";
+static const char TIME_COEFF[]          = "time_coeff";
+
+static const ossimString PARAM_NAMES[] ={"x_pos_offset",
+                                         "y_pos_offset",
+                                         "z_pos_offset"};
+static const ossimString PARAM_UNITS[] ={"meters",
+                                         "meters",
+                                         "meters"};
+ 
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::ossimSarModel()
+//  
+//  Constructor.
+//  
+//*****************************************************************************
+ossimSarModel::ossimSarModel()
+   :
+   theAcquisitionMode(),
+   theOrpPosition(),
+   theOrpCenter(),
+   theOutputPlaneNormal(),
+   theOipr(0.0),
+   theLsrOffset(0, 0, 0)
+{
+   initAdjustableParameters();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSarModel::ossimSarModel DEBUG:" << std::endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "OSSIM_ID:  " << OSSIM_ID << std::endl;
+#endif 
+   }
+   
+}
+
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimSarModel()
+//  
+//*****************************************************************************
+ossimSarModel::~ossimSarModel()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSarModel(): entering..." << std::endl;
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG DESTRUCTOR: ~ossimSarModel(): returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::initAdjustableParameters()
+//  
+//  This method initializes the base class adjustable parameter and associated
+//  sigmas arrays with quantities specific to this model. These are default
+//  values only. A functional implementation would assign the sigmas via a
+//  keywordlist or camera specific derived class.
+//  
+//*****************************************************************************
+void ossimSarModel::initAdjustableParameters()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::initAdjustableParameters: entering..." << std::endl;
+
+   int numParams = NUM_ADJUSTABLE_PARAMS;
+   resizeAdjustableParameterArray(NUM_ADJUSTABLE_PARAMS);
+   
+   //***
+   // Initialize adjustable parameter array:
+   //***
+   for (int i=0; i<numParams; i++)
+   {
+      setAdjustableParameter(i, 0.0);
+      setParameterDescription(i, PARAM_NAMES[i]);
+      setParameterUnit(i, PARAM_UNITS[i]);
+   }
+   
+   //***
+   // Initialize parameter sigma array:
+   //***
+   setParameterSigma(X_POS, 50.0);
+   setParameterSigma(Y_POS, 50.0);
+   setParameterSigma(Z_POS, 50.0);  
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::initAdjustableParameters: returning..." << std::endl;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::loadState()
+//  
+//  Load the state of this object from KWL.
+//  
+//*****************************************************************************
+bool ossimSarModel::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // Call the base class.  If it fails, no sense going on.
+   if (ossimSensorModel::loadState(kwl, prefix) == false)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimSarModel::loadState(): returning with error..."
+            << std::endl;
+      }
+      
+      return false;
+   }
+
+   const char* lookup;
+   
+   // Get the acquisition mode
+   lookup = kwl.find(prefix, ACQ_MODE_KW);
+   theAcquisitionMode = ossimSarModel::UNKNOWN;
+   if (lookup)
+   {
+      setAcquisitionMode(ossimString(lookup));
+   }
+   if (theAcquisitionMode == ossimSarModel::UNKNOWN)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << ACQ_MODE_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the ORP (aka Output/Ground Reference Point)
+   theOrpPosition.makeNan();
+   lookup = kwl.find(prefix, ORP_POS_KW);
+   if (lookup)
+   {
+      theOrpPosition.toPoint(std::string(lookup));
+   }
+
+   if (theOrpPosition.hasNans())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << ORP_POS_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+   
+   // Get the ORP image coordinates
+   theOrpCenter.makeNan();
+   lookup = kwl.find(prefix, ORP_CENTER_KW);
+   if (lookup)
+   {
+      theOrpCenter.toPoint(std::string(lookup));
+   }
+
+   if (theOrpCenter.hasNans())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << ORP_CENTER_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the output plane normal (slant plane orientation)
+   theOutputPlaneNormal.makeNan();
+   lookup = kwl.find(prefix, OPNORM_KW);
+   if (lookup)
+   {
+      theOutputPlaneNormal.toPoint(std::string(lookup));
+   }
+
+   if (theOutputPlaneNormal.hasNans())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << OPNORM_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the output plane x-axis (slant plane orientation)
+   theOutputPlaneXaxis.makeNan();
+   lookup = kwl.find(prefix, OP_X_AXIS_KW);
+   if (lookup)
+   {
+      theOutputPlaneXaxis.toPoint(std::string(lookup));
+   }
+
+   if (theOutputPlaneXaxis.hasNans())
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << OP_X_AXIS_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the output IPR
+   theOipr = ossim::nan();
+   lookup = kwl.find(prefix, OIPR_KW);
+   if (lookup)
+   {
+      theOipr = ossimString::toFloat64(lookup);
+   }
+   
+   if (ossim::isnan(theOipr))
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << OIPR_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the pixel size
+   thePixelSize = ossim::nan();
+   lookup = kwl.find(prefix, PIX_SIZE_KW);
+   if (lookup)
+   {
+      thePixelSize = ossimString::toFloat64(lookup);
+   }
+   
+   if (ossim::isnan(thePixelSize))
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << PIX_SIZE_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the ARP time
+   theArpTime = ossim::nan();
+   lookup = kwl.find(prefix, ARP_TIME_KW);
+   if (lookup)
+   {
+      theArpTime = ossimString::toFloat64(lookup);
+   }
+
+   if (ossim::isnan(theArpTime))
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << ARP_TIME_KW << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the ARP position coefficients
+   //  (variable degree polynomial representation of position)
+   theArpXPolCoeff.clear();
+   theArpYPolCoeff.clear();
+   theArpZPolCoeff.clear();
+   ossim_uint32 x_count = kwl.numberOf(ARP_POLY_COEFF_X_KW);
+   ossim_uint32 y_count = kwl.numberOf(ARP_POLY_COEFF_Y_KW);
+   ossim_uint32 z_count = kwl.numberOf(ARP_POLY_COEFF_Z_KW);
+
+   if ( (x_count == y_count) && (x_count == z_count) )
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+   
+      while ( (found < x_count) &&
+              (count < 100) ) // limit lookups to 100...
+      {
+         ossimString s = ossimString::toString(count);
+         ossimString xkw = ARP_POLY_COEFF_X_KW;
+         ossimString ykw = ARP_POLY_COEFF_Y_KW;
+         ossimString zkw = ARP_POLY_COEFF_Z_KW;
+         xkw += s;
+         ykw += s;
+         zkw += s;
+
+         const char* xLookup = kwl.find(prefix, xkw.c_str());
+         const char* yLookup = kwl.find(prefix, ykw.c_str());
+         const char* zLookup = kwl.find(prefix, zkw.c_str());
+
+         if (xLookup && yLookup && zLookup)
+         {
+            ++found;
+            theArpXPolCoeff.push_back(ossimString::toFloat64(xLookup));
+            theArpYPolCoeff.push_back(ossimString::toFloat64(yLookup));
+            theArpZPolCoeff.push_back(ossimString::toFloat64(zLookup));
+         }
+         ++count;
+      }
+   }     
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << "arppol_coeff" << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+
+   // Get the time coefficients
+   //  (variable degree polynomial representation of time WRT image coordinates)
+   theTimeCoeff.clear();
+   ossim_uint32 timeCount = kwl.numberOf(TIME_COEFF);
+   if (timeCount)
+   {
+      ossim_uint32 found = 0;
+      ossim_uint32 count = 0;
+   
+      while ( (found < timeCount) &&
+              (count < 100) ) // limit lookups to 100...
+      {
+         ossimString kw = TIME_COEFF;
+         kw += ossimString::toString(count);;
+
+         lookup = kwl.find(prefix, kw.c_str());
+
+         if (lookup)
+         {
+            ++found;
+            theTimeCoeff.push_back(ossimString::toFloat64(lookup));
+         }
+         ++count;
+      }
+   }     
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "DEBUG ossimSarModel::loadState() lookup failure: "
+            << TIME_COEFF << "\nreturning with error..."
+            << std::endl;
+      }
+      return false;
+   }
+   
+   
+   updateModel();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimSarModel::loadState() DEBUG: " << std::endl;
+   }
+   
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::saveState()
+//  
+//  Save the state of this object to KWL.
+//  
+//*****************************************************************************
+bool ossimSarModel::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix, ACQ_MODE_KW, getAcquistionModeString());
+   kwl.add(prefix, ORP_POS_KW, theOrpPosition.toString(15).c_str());
+   kwl.add(prefix, ORP_CENTER_KW, theOrpCenter.toString(15).c_str());
+   kwl.add(prefix, OPNORM_KW, theOutputPlaneNormal.toString(15).c_str());
+   kwl.add(prefix, OP_X_AXIS_KW, theOutputPlaneXaxis.toString(15).c_str());
+   kwl.add(prefix, OIPR_KW, theOipr);
+   kwl.add(prefix, PIX_SIZE_KW, thePixelSize);
+   kwl.add(prefix, ARP_TIME_KW, theArpTime);
+
+   ossim_uint32 i;
+   for (i = 0; i < theArpXPolCoeff.size(); ++i)
+   {
+      ossimString kw = ARP_POLY_COEFF_X_KW;
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, theArpXPolCoeff[i]);
+   }
+   for (i = 0; i < theArpYPolCoeff.size(); ++i)
+   {
+      ossimString kw = ARP_POLY_COEFF_Y_KW;
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, theArpYPolCoeff[i]);
+   }
+   for (i = 0; i < theArpZPolCoeff.size(); ++i)
+   {
+      ossimString kw = ARP_POLY_COEFF_Z_KW;
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, theArpZPolCoeff[i]);
+   }
+   for (i = 0; i < theTimeCoeff.size(); ++i)
+   {
+      ossimString kw = TIME_COEFF;
+      kw += ossimString::toString(i);
+      kwl.add(prefix, kw, theTimeCoeff[i]);
+   }
+   
+   return ossimSensorModel::saveState(kwl, prefix);
+}
+
+
+//*****************************************************************************
+// STATIC METHOD: ossimSarModel::writeGeomTemplate
+//  
+//  Writes a sample kwl to output stream. Please update this method with any
+//  format and/or keyword changes. It will make life a lot easier for everyone.
+//  
+//*****************************************************************************
+void ossimSarModel::writeGeomTemplate(ostream& os)
+{
+   if (traceExec())
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSarModel::writeGeomTemplate: entering..." << std::endl;
+
+   os <<
+      "//************************************\n"
+      "// Template for SAR model keywordlist\n"
+      "//************************************\n";
+ 
+   ossimSensorModel::writeGeomTemplate(os);
+   os << "//***\n"
+      << "// Base-class SAR Keywords:\n"
+      << "//***\n"
+      << ACQ_MODE_KW         << ": <SCAN, SPOT>\n"
+      << ORP_POS_KW          << ": <meters (ECF)>\n"
+      << ORP_CENTER_KW       << ": <pixels>\n"
+      << OPNORM_KW           << ": <unit vector>\n"
+      << OP_X_AXIS_KW        << ": <unit vector>\n"
+      << OIPR_KW             << ": <meters>\n"
+      << PIX_SIZE_KW         << ": <meters>\n"
+      << ARP_TIME_KW         << ": <sec>\n"
+      << ARP_POLY_COEFF_X_KW << ": <meters (ECF)>\n"
+      << ARP_POLY_COEFF_Y_KW << ": <meters (ECF)>\n"
+      << ARP_POLY_COEFF_Z_KW << ": <meters (ECF)>\n"
+      << TIME_COEFF          << ": <sec>\n";
+   }
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::print()
+//  
+//  Print the KWL.
+//  
+//*****************************************************************************
+std::ostream& ossimSarModel::print(std::ostream& out) const
+{
+   out << "// ossimSarModel::print:" << std::endl;
+
+   ossimKeywordlist kwl;
+   if (saveState(kwl))
+   {
+      kwl.print(out);
+   }
+   else
+   {
+      out << "// ossimSarModel::saveState failed!" << std::endl;
+   }
+   return ossimSensorModel::print(out);
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getAcquisitionMode()
+//  
+//  Get internal acquisition mode parameter.
+//  
+//*****************************************************************************
+ossimString ossimSarModel::getAcquistionModeString() const
+{
+   ossimString result;
+   
+   switch (theAcquisitionMode)
+   {
+      case ossimSarModel::SCAN:
+         result = "scan";
+         break;
+      case ossimSarModel::SPOT:
+         result = "spot";
+         break;
+      case ossimSarModel::UNKNOWN:
+      default:
+         result = "unknown";
+         break;
+   }
+   return result;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::lineSampleHeightToWorld()
+//  
+//  Perform inverse projection of image space to ground point @ specified hgt.
+//
+//    Note: Special case indicated by 'heightAboveEllipsoid=OSSIM_NAN'
+//          will utilize the ORP height for intersection.
+//  
+//*****************************************************************************
+void ossimSarModel::lineSampleHeightToWorld(const ossimDpt& lineSampPt,
+                                            const double&   heightAboveEllipsoid,
+                                            ossimGpt&       worldPt) const
+{
+   // Compute OP position from image coordinates 
+   ossimEcefPoint opPt;
+   computeOPfromImage(lineSampPt, opPt);
+   
+   // Get image time
+   ossim_float64 iTime = getArpTime(lineSampPt);
+   
+   // Get ARP state
+   ossimEcefPoint  arpPos = getArpPos(iTime);
+   ossimEcefVector arpVel = getArpVel(iTime);
+   
+   // Get range/Doppler
+   ossim_float64 range;
+   ossim_float64 doppler;
+   computeRangeDoppler(opPt, arpPos, arpVel, range, doppler);
+   
+   // Set the height reference
+   ossim_float64 hgtSet;
+   if ( ossim::isnan(heightAboveEllipsoid) )
+   {
+      ossimGpt orpG(theOrpPosition);
+      hgtSet = orpG.height();
+   }
+   else
+   {
+      hgtSet = heightAboveEllipsoid;
+   }
+      
+   ossimHgtRef hgtRef(AT_HGT, hgtSet);
+   
+   // Project OP to DEM
+   ossimEcefPoint ellPt;
+   projOPtoSurface(opPt, range, doppler, arpPos, arpVel, &hgtRef, ellPt);
+   ossimGpt iPt(ellPt);
+   
+   worldPt = iPt;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::worldToLineSample()
+//  
+//  Perform forward projection of ground point to image space.
+//  
+//*****************************************************************************
+void ossimSarModel::worldToLineSample(const ossimGpt& world_point,
+                                      ossimDpt&       image_point) const
+{
+   ossimEcefPoint pt(world_point);
+   
+   // Project to OP plane
+   ossimEcefPoint opPt;
+   projEllipsoidToOP(pt, opPt);
+   
+   // Compute image coordinates from OP position
+   computeImageFromOP(opPt,image_point);
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::lineSampleToWorld()
+//  
+//  Perform inverse projection of image space to ground point.
+//  
+//*****************************************************************************
+void ossimSarModel::lineSampleToWorld(const ossimDpt& lineSampPt,
+                                      ossimGpt&       worldPt) const
+{
+   // Compute OP position from image coordinates 
+   ossimEcefPoint opPt;
+   computeOPfromImage(lineSampPt, opPt);
+   
+   // Get image time
+   ossim_float64 iTime = getArpTime(lineSampPt);
+   
+   // Get ARP state vector
+   ossimEcefPoint  arpPos = getArpPos(iTime);
+   ossimEcefVector arpVel = getArpVel(iTime);
+   
+   // Get range/Doppler
+   ossim_float64 range;
+   ossim_float64 doppler;
+   computeRangeDoppler(opPt, arpPos, arpVel, range, doppler);
+   
+   // Set the height reference
+   ossimHgtRef hgtRef(AT_DEM);
+   
+   // Project OP to DEM
+   ossimEcefPoint ellPt;
+   projOPtoSurface(opPt, range, doppler, arpPos, arpVel, &hgtRef, ellPt);
+   ossimGpt iPt(ellPt);
+   
+   worldPt = iPt;
+
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::imagingRay()
+//  
+//  Given an image point, returns a ray originating at the ARP position
+//  and pointing towards the target's position in the Output
+//  Plane.
+//  This DOES NOT provide the conventional definition for an imaging ray
+//  because the imaging locus for SAR is not a ray.
+//
+//  It DOES provide a radius vector for the range/Doppler circle.
+//  
+//*****************************************************************************
+void ossimSarModel::imagingRay(const ossimDpt& image_point,
+                               ossimEcefRay&   image_ray) const
+{
+   // Compute OP position from image coordinates 
+   ossimEcefPoint opPt;
+   computeOPfromImage(image_point, opPt);
+   
+   // Get image time
+   ossim_float64 iTime = getArpTime(image_point);
+   
+   // Get ARP position
+   ossimEcefPoint arpPos = getArpPos(iTime);
+   
+   // Construct the ray
+   ossimGpt start(arpPos);
+   ossimGpt end(opPt);
+
+   image_ray = ossimEcefRay(start, end);
+
+   return;   
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getObsCovMat()
+//
+//  Gives 2X2 covariance matrix of observations.
+//
+//    Note: At this base class level, the only error source currently
+//          considered is mensuration error.  This is obviously optimistic,
+//          but is included as a placeholder/example.
+//
+//*****************************************************************************
+ossimSensorModel::CovMatStatus ossimSarModel::getObsCovMat(
+   const ossimDpt& /* ipos */, NEWMAT::SymmetricMatrix& Cov)
+{
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Mensuration error contribution
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   //  Sensitivity matrix
+   NEWMAT::SymmetricMatrix B(2);
+   B(1,1) = thePixelSpacing;
+   B(2,2) = B(1,1);
+   B(1,2) = 0.0;
+   //  Default pointing error = 0.5 pixels
+   ossim_float64 defPointingSigma = 0.5;
+   NEWMAT::SymmetricMatrix P(2);
+   P(1,1) = defPointingSigma*defPointingSigma;
+   P(2,2) = P(1,1);
+   P(1,2) = 0.0;
+   //  Propagate to rng/az
+   NEWMAT::SymmetricMatrix Cm;
+   Cm << B * P * B.t();
+   
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Sum total covariance in rng/az
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   NEWMAT::SymmetricMatrix Ctot = Cm; //+ other contributors as identified
+   
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Propagate to rng/Dop
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   NEWMAT::SymmetricMatrix Bad(2);
+   Bad(1,1) = 1.0;
+   Bad(2,2) = theParDopWRTaz;
+   Bad(1,2) = 0.0;
+   
+   Cov << Bad * Ctot * Bad.t();
+
+   return ossimSensorModel::COV_PARTIAL;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::updateModel()
+//  
+//  Update computed parameters.
+//  
+//*****************************************************************************
+void ossimSarModel::updateModel()
+{
+   // Set the pixel size
+   thePixelSpacing = thePixelSize;
+   
+   // Define the output(focus) plane
+   //    Ref[1], eq. 11-29 -> 11-31
+   theOPZ = theOutputPlaneNormal.unitVector();
+   theOPX = theOutputPlaneXaxis.unitVector();
+   
+   theOPY = theOPZ.cross(theOPX);
+   theOPY.normalize();
+   
+   theOPX = theOPY.cross(theOPZ);
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG updateModel:\n OP vectors...";
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "\n  OPX: "<<theOPX
+      << "\n  OPY: "<<theOPY
+      << "\n  OPZ: "<<theOPZ<<endl;
+      ossimGpt orpg(theOrpPosition);
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      <<"  ORPgeo: "<<orpg<<endl;
+   }
+   // Update geometry
+   theLsrOffset.x() = getAdjustableParameter(X_POS) *
+                      getParameterSigma(X_POS);
+   theLsrOffset.y() = getAdjustableParameter(Y_POS) *
+                      getParameterSigma(Y_POS);
+   theLsrOffset.z() = getAdjustableParameter(Z_POS) *
+                      getParameterSigma(Z_POS);
+
+   // Set base class members
+   theRefGndPt = ossimGpt(theOrpPosition);
+   theRefImgPt = theOrpCenter;
+   theGSD.samp = thePixelSpacing;
+   theGSD.line = thePixelSpacing;
+   theMeanGSD  = thePixelSpacing;
+   
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getArpPos()
+//  
+//  Return ARP position as constant term.
+//  
+//*****************************************************************************
+ossimEcefPoint ossimSarModel::getArpPos() const
+{
+   ossimEcefPoint pos(theArpXPolCoeff[0],
+                      theArpYPolCoeff[0],
+                      theArpZPolCoeff[0]);
+                       
+   // Handle the adjustable offset
+   //   Define ENU space at pos
+   ossimGpt posG(pos);
+   ossimLsrSpace enu(posG);
+   //   Rotate offset vector to ECF
+   ossimColumnVector3d tpnn(theLsrOffset[0],theLsrOffset[1], theLsrOffset[2]);
+   ossimEcefVector ecfOffset = enu.lsrToEcefRotMatrix()*tpnn;
+   //   Add the offset   
+   pos = pos + ecfOffset;
+   
+   return pos;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getArpVel()
+//  
+//  Return ARP velocity as 1st order term coefficient.
+//  
+//*****************************************************************************
+ossimEcefVector ossimSarModel::getArpVel() const
+{
+   ossimEcefVector vec(theArpXPolCoeff[1],
+                       theArpYPolCoeff[1],
+                       theArpZPolCoeff[1]);
+
+   return vec;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getArpPos()
+//  
+//  Compute ARP position as function of time-dependent polynomial.
+//    Note: The polynomial degree/coefficients must be
+//    predetermined by the data provider.
+//  
+//*****************************************************************************
+ossimEcefPoint ossimSarModel::getArpPos(const ossim_float64& time) const
+{
+   ossim_int32 i;
+   ossim_uint32 nTermsX = (ossim_uint32)theArpXPolCoeff.size();
+   ossim_uint32 nTermsY = (ossim_uint32)theArpYPolCoeff.size();
+   ossim_uint32 nTermsZ = (ossim_uint32)theArpZPolCoeff.size();
+
+   ossim_float64 x = theArpXPolCoeff[nTermsX-1];
+   for (i=nTermsX-2; i>=0; i--)
+      x = x*time + theArpXPolCoeff[i];
+      
+   ossim_float64 y = theArpYPolCoeff[nTermsY-1];
+   for (i=nTermsY-2; i>=0; i--)
+      y = y*time + theArpYPolCoeff[i];
+      
+   ossim_float64 z = theArpZPolCoeff[nTermsZ-1];
+   for (i=nTermsZ-2; i>=0; i--)
+      z = z*time + theArpZPolCoeff[i];
+   
+   ossimEcefPoint pos(x, y, z);
+                       
+   // Handle the adjustable offset
+   //   Define ENU space at pos
+   ossimGpt posG(pos);
+   ossimLsrSpace enu(posG);
+   //   Rotate offset vector to ECF
+   ossimColumnVector3d tpnn(theLsrOffset[0],theLsrOffset[1], theLsrOffset[2]);
+   ossimEcefVector ecfOffset = enu.lsrToEcefRotMatrix()*tpnn;
+   //   Add the offset
+   pos = pos + ecfOffset;
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpPos:"<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << " time   = "<<time<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << " pos    = "<<pos<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << " offset = "<<theLsrOffset<<endl;
+   }
+   
+   return pos;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getArpVel()
+//  
+//  Compute ARP velocity as 1st derivative of time-dependent polynomial.
+//    Note: The polynomial degree/coefficients must be
+//    predetermined by the data provider.
+//  
+//*****************************************************************************
+ossimEcefVector ossimSarModel::getArpVel(const ossim_float64& time) const
+{
+   ossim_int32 i;
+   ossim_uint32 nTermsX = (ossim_uint32)theArpXPolCoeff.size();
+   ossim_uint32 nTermsY = (ossim_uint32)theArpYPolCoeff.size();
+   ossim_uint32 nTermsZ = (ossim_uint32)theArpZPolCoeff.size();
+   
+   ossim_float64 x = nTermsX * theArpXPolCoeff[nTermsX-1];
+   for (i=nTermsX-2; i>=1; i--)
+      x = x*time + i*theArpXPolCoeff[i];
+      
+   ossim_float64 y = nTermsY * theArpYPolCoeff[nTermsY-1];
+   for (i=nTermsY-2; i>=1; i--)
+      y = y*time + i*theArpYPolCoeff[i];
+      
+   ossim_float64 z = nTermsZ * theArpZPolCoeff[nTermsZ-1];
+   for (i=nTermsZ-2; i>=1; i--)
+      z = z*time + i*theArpZPolCoeff[i];
+      
+   ossimEcefVector vel(x, y, z);
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpVel:"<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << " time = "<<time<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << " vel  = "<<vel<<endl;
+   }
+   
+   return vel;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getArpTime()
+//  
+//  Return constant ARP time.
+//  
+//*****************************************************************************
+ossim_float64 ossimSarModel::getArpTime() const
+{
+   return theTimeCoeff[0];
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getArpTime()
+//  
+//  Compute ARP time as function of line/sample-dependent polynomial.
+//  Defaults to full 3rd order.
+//    Note: The polynomial degree/coefficients must be
+//    predetermined by the data provider.  Higher order terms
+//    can be zeroed out if necessary.
+//  
+//*****************************************************************************
+ossim_float64 ossimSarModel::getArpTime(const ossimDpt& imgPt) const
+{
+   ossim_float64 s = imgPt.samp;
+   ossim_float64 l = imgPt.line;
+  
+   ossim_float64 s2 = s*s;
+   ossim_float64 s3 = s2*s;
+   ossim_float64 l2 = l*l;
+   ossim_float64 l3 = l2*l;
+      
+   // Evaluate the time polynomial
+   ossim_float64 imgTime = theTimeCoeff[0];
+   imgTime += theTimeCoeff[1]  * l;
+   imgTime += theTimeCoeff[2]  * l2;
+   imgTime += theTimeCoeff[3]  * l3;
+   imgTime += theTimeCoeff[4]  * s;
+   imgTime += theTimeCoeff[5]  * s * l;
+   imgTime += theTimeCoeff[6]  * s * l2;
+   imgTime += theTimeCoeff[7]  * s * l3;
+   imgTime += theTimeCoeff[8]  * s2;
+   imgTime += theTimeCoeff[9]  * s2 * l;
+   imgTime += theTimeCoeff[10] * s2 * l2;
+   imgTime += theTimeCoeff[11] * s2 * l3;
+   imgTime += theTimeCoeff[12] * s3;
+   imgTime += theTimeCoeff[13] * s3 * l;
+   imgTime += theTimeCoeff[14] * s3 * l2;
+   imgTime += theTimeCoeff[15] * s3 * l3;
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG getArpTime:"<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << " imgPt   = "<<imgPt<<endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << " imgTime = "<<imgTime<<endl;
+   }
+      
+
+   return imgTime;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::computeRangeDoppler()
+//  
+//  Compute range/Doppler for given ARP state and ECF point.
+//    Ref[1], eq. 11-37, 11-38
+//  
+//*****************************************************************************
+bool ossimSarModel::computeRangeDoppler(const ossimEcefPoint& pt,
+                                        const ossimEcefPoint& arpPos,
+                                        const ossimEcefVector& arpVel,
+                                        ossim_float64& range,
+                                        ossim_float64& doppler) const
+{
+   // Compute range
+   ossimEcefVector delta = pt - arpPos;
+   range = delta.magnitude();
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG computeRangeDoppler: range vector..." << endl;
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "delta components: \n"<<delta<<endl;
+   }
+   
+   if (range != 0.0)
+   {
+      // Compute Doppler
+      doppler = arpVel.dot(delta) / range;
+      return true;
+   }
+   
+   return false;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::computeOPfromImage()
+//  
+//  Compute Output Plane coordinates from image coordinates.
+//    Ref[1], eq. 11-32 -> 11-35
+//  
+//*****************************************************************************
+bool ossimSarModel::computeOPfromImage(const ossimDpt& imgPt,
+                                       ossimEcefPoint& opPt) const
+{
+   ossim_float64 dL = imgPt.line - theOrpCenter.line;
+   ossim_float64 dS = imgPt.samp - theOrpCenter.samp;
+      
+   dL *= thePixelSpacing;
+   dS *= thePixelSpacing;
+   
+   opPt = theOPX*dL + theOPY*dS + theOrpPosition;
+   
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::computeImageFromOP()
+//  
+//  Compute image coordinates from Output Plane coordinates.
+//    Ref[1], eq. 11-32 -> 11-35
+//  
+//*****************************************************************************
+bool ossimSarModel::computeImageFromOP(const ossimEcefPoint& opPt, ossimDpt& imgPt) const
+{
+   ossimEcefVector delta(opPt - theOrpPosition);
+   
+   ossim_float64 dL = delta.dot(theOPX) / thePixelSpacing;
+   ossim_float64 dS = delta.dot(theOPY) / thePixelSpacing;
+      
+   imgPt.line = theOrpCenter.line + dL;
+   imgPt.samp = theOrpCenter.samp + dS;
+   
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::projOPtoSurface()
+//  
+//  Project Output Plane coordinates to ellipsoid at reference height.
+//  
+//*****************************************************************************
+bool ossimSarModel::projOPtoSurface(const ossimEcefPoint& opPt,
+                                    const ossim_float64& range,
+                                    const ossim_float64& doppler,
+                                    const ossimEcefPoint& arpPos,
+                                    const ossimEcefVector& arpVel,
+                                    const ossimHgtRef* hgtRef,
+                                    ossimEcefPoint& ellPt) const
+{
+   // Set slopes for tangent plane
+   ossim_float64 sx  = 0.0;
+   ossim_float64 sy  = 0.0;
+   
+   // Set tangent plane normal vector in ENU
+   ossimColumnVector3d tpn(sx, sy, 1.0);
+   ossimColumnVector3d tpnn(-sx, -sy, 1.0);
+
+   // Initialize at OP point
+   ossimEcefPoint rg(opPt);
+   
+   // Matrices
+   NEWMAT::SymmetricMatrix BtB(3);
+   NEWMAT::ColumnVector BtF(3);
+   NEWMAT::ColumnVector F(3);
+   NEWMAT::ColumnVector dR(3);
+   
+   // Initialize criteria
+   F(1)=theOipr;
+   
+   ossim_int32 iter = 0;
+   
+   while ((F(1)>=theOipr || F(2)>=0.0003048 || F(3)>=0.5) && iter<5)
+   {
+      // Compute current latitude/longitude estimate
+      ossimGpt pg(rg);
+
+      // Set reference point @ desired elevation
+      ossim_float64 atHgt = hgtRef->getRefHeight(pg);
+      pg.height(atHgt);
+      ossimEcefPoint rt(pg);
+
+      // Define ENU space at reference point
+      ossimLsrSpace enu(pg);
+
+      // Rotate normal vector to ECF
+      ossimEcefVector st = enu.lsrToEcefRotMatrix()*tpn;
+
+      // Compute current range & Doppler estimate
+      ossim_float64 rngComp;
+      ossim_float64 dopComp;
+      computeRangeDoppler(rg, arpPos, arpVel, rngComp, dopComp);
+      
+      // Compute current height estimate
+      ossim_float64 diffHgt = st.dot(rg-rt);
+
+      // Compute current fr, fd, ft
+      F(1) = rngComp - range;
+      F(2) = dopComp - doppler;
+      F(3) = diffHgt;
+   
+      // Compute fr partials
+      ossimEcefVector delta = rg - arpPos;
+      ossimEcefVector deltaUv = delta.unitVector();
+      ossimEcefVector p_fr = -deltaUv;
+
+      // Compute fd partials
+      ossim_float64 vDotr = arpVel.dot(deltaUv);
+      ossimEcefVector p_fd = (arpVel - deltaUv*vDotr)/rngComp;
+
+      // Compute ft partials
+      ossimColumnVector3d p_ft = enu.lsrToEcefRotMatrix()*tpnn;
+
+      // Form B-matrix
+      NEWMAT::Matrix B = ossimMatrix3x3::create(p_fr[0], p_fr[1], p_fr[2],
+                                                p_fd[0], p_fd[1], p_fd[2],
+                                                p_ft[0], p_ft[1], p_ft[2]);
+
+      // Form coefficient matrix & discrepancy vector
+      BtF << B.t()*F;
+      BtB << B.t()*B;
+
+      // Solve system
+      dR = solveLeastSquares(BtB, BtF);
+
+      // Update estimate
+      for (ossim_int32 k=0; k<3; k++)
+         rg[k] -= dR(k+1);
+      
+      iter++;
+   }
+   
+   // Set intersection for return
+   ellPt = rg;
+
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::projEllipsoidToOP()
+//  
+//  Projects ellipsoid coordinates to Output Plane.
+//  
+//*****************************************************************************
+bool ossimSarModel::projEllipsoidToOP(const ossimEcefPoint& ellPt,
+                                      ossimEcefPoint& opPt) const
+{
+   ossimDpt currentImagePt;
+   ossimEcefPoint selPt;
+   
+   // Initialize at ORP image point
+   currentImagePt = theOrpCenter;
+   
+   ossim_float64 checkTime = 1.0;
+   ossim_float64 lTime=10000.0;
+   ossim_int32 iter = 0;
+   
+   
+   // Iterate on imaging time
+   while (checkTime > 10.0e-6 && iter<5)
+   {
+   
+      // Get current time estimate
+      ossim_float64 cTime = getArpTime(currentImagePt);
+      checkTime = fabs(cTime-lTime)/cTime;
+
+      // Get state vector at current time estimate
+      ossimEcefPoint  arpPos = getArpPos(cTime);
+      ossimEcefVector arpVel = getArpVel(cTime);
+      ossimEcefVector arpVelunit = arpVel.unitVector();
+
+      // Define planes
+      ossim_float64 constOP = theOPZ.dot(
+         ossimEcefVector(theOrpPosition[0],theOrpPosition[1],theOrpPosition[2]));
+      ossim_float64 constRD = arpVelunit.dot(
+         ossimEcefVector(ellPt[0],ellPt[1],ellPt[2]));
+
+      // Compute dot product of normals
+      ossim_float64 ndot = theOPZ.dot(arpVelunit);
+
+      // Compute line of intersection of OP and RD planes
+      ossim_float64 det = 1.0 - ndot*ndot;
+      ossim_float64 c1 = (constOP - ndot*constRD) / det;
+      ossim_float64 c2 = (constRD - ndot*constOP) / det;
+      ossimEcefPoint ori = (theOPZ*c1+arpVelunit*c2)+ossimEcefPoint(0.0,0.0,0.0);
+      ossimEcefVector dir = theOPZ.cross(arpVelunit);
+   
+      // Solve for intersection points (RD circle and OP)
+      ossimEcefVector delta = ori - arpPos;
+      ossim_float64 a2 = dir.length()*dir.length();
+      ossim_float64 a1 = delta.dot(dir);
+      ossimEcefVector rng(ellPt-arpPos);
+      ossim_float64 a0 = delta.length()*delta.length()-rng.length()*rng.length();
+
+      ossim_float64 rootSqr = a1*a1-a0*a2;
+      ossim_float64 root = sqrt(rootSqr);
+      ossimEcefPoint p1 = ori - dir*((a1+root)/a2);
+      ossimEcefPoint p2 = ori - dir*((a1-root)/a2);
+
+      ossimEcefVector p1Delta = p1 - ellPt;
+      ossimEcefVector p2Delta = p2 - ellPt;
+
+      // Pick correct point
+      if (p1Delta.magnitude()<p2Delta.magnitude())
+         selPt = p1;
+      else
+         selPt = p2;
+
+      // Compute OP image coordinates
+      computeImageFromOP(selPt,currentImagePt);
+
+      lTime = cTime;
+      iter++;
+   }
+      
+   opPt = selPt;
+   
+   return true;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::getForwardDeriv()
+//  
+//  Compute partials of range/Doppler WRT to ground.
+//  
+//*****************************************************************************
+ossimDpt ossimSarModel::getForwardDeriv(int derivMode,
+                                        const ossimGpt& pos,
+                                        double h)
+{
+   // If derivMode (parmIdx) >= 0 call base class version
+   // for "adjustable parameters"
+   if (derivMode >= 0)
+   {
+      return ossimSensorModel::getForwardDeriv(derivMode, pos, h);
+   }
+   
+   // Use alternative derivMode definitions
+   else
+   {
+      ossimDpt returnData;
+
+      //******************************************
+      // OBS_INIT mode
+      //    [1] compute r/D corresponding to (s,l)
+      //    [2] compute time, ARP posvel and save 
+      //  Note: In this mode, pos is used to pass
+      //  in the (s,l) observations.
+      //******************************************
+      if (derivMode==OBS_INIT)
+      {
+         // Compute the r/D observations from image coordinates
+         ossimDpt obs;
+         obs.samp = pos.latd();
+         obs.line = pos.lond();
+
+         theObsTime = getArpTime(obs);
+         theObsArpPos = getArpPos(theObsTime);
+         theObsArpVel = getArpVel(theObsTime);
+         theObsArpVel_U = theObsArpVel.unitVector();
+         theObsArpVel_Mag = theObsArpVel.magnitude();
+
+         computeOPfromImage(obs, theObsOP);
+         computeRangeDoppler
+            (theObsOP, theObsArpPos, theObsArpVel, theObsRng, theObsDop);
+         ossimDpt obsRD(theObsRng, theObsDop);
+         theObs = obsRD;
+      }
+
+      //******************************************
+      // EVALUATE mode
+      //   [1] evaluate & save partials, residuals
+      //   [2] return residuals
+      //******************************************
+      else if (derivMode==EVALUATE)
+      {
+
+         // Compute the partials
+         ossimEcefPoint gpos(pos);
+         ossimEcefPoint ellObs = gpos;
+         theObsPosition = gpos;
+
+         // Partials of range WRT ground
+         ossimEcefVector rng = ellObs - theObsArpPos;
+         ossimEcefVector rngU = rng.unitVector();
+
+         // Partials of azimuth WRT ground
+         ossimEcefVector slantPerp = rngU.cross(theObsArpVel);
+         ossimEcefVector rs(theObsArpPos[0],theObsArpPos[1],theObsArpPos[2]);
+         ossim_float64 signPar = (slantPerp.dot(rs)<0.0) ? -1:1;
+         ossimEcefVector slantNormal = slantPerp.unitVector() * signPar;
+         ossimEcefVector azU = slantNormal.unitVector().cross(rngU);
+
+         // Partials of Doppler WRT azimuth
+         ossim_float64 dca = acos(theObsArpVel_U.dot(rngU));
+         signPar = ((theObsArpVel.cross(rng)).dot(slantNormal)<0.0) ? 1:-1;
+         theParDopWRTaz = signPar*sin(dca)*theObsArpVel_Mag/rng.magnitude();
+
+         // Save the partials
+         //  Range
+         theParWRTx.u = rngU.x();
+         theParWRTy.u = rngU.y();
+         theParWRTz.u = rngU.z();
+         //  Doppler
+         theParWRTx.v = azU.x()*theParDopWRTaz;
+         theParWRTy.v = azU.y()*theParDopWRTaz;
+         theParWRTz.v = azU.z()*theParDopWRTaz;
+
+         // Residuals
+         ossim_float64 cRng;
+         ossim_float64 cDop;
+         ossimEcefPoint opPt;
+         projEllipsoidToOP(ellObs, opPt);
+         computeRangeDoppler(opPt, theObsArpPos, theObsArpVel, cRng, cDop);
+         ossimDpt resid(theObsRng-cRng, theObsDop-cDop);
+         returnData = resid;
+      }
+
+      //******************************************
+      // P_WRT_X, P_WRT_Y, P_WRT_Z modes
+      //   [1] 3 separate calls required
+      //   [2] return 3 sets of partials
+      //******************************************
+      else if (derivMode==P_WRT_X)
+      {
+         returnData = theParWRTx;
+      }
+
+      else if (derivMode==P_WRT_Y)
+      {
+         returnData = theParWRTy;
+      }
+
+      else
+      {
+         returnData = theParWRTz;
+      }
+
+      return returnData;
+   }
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSarModel::setAcquisitionMode()
+//  
+//  Set internal acquisition mode parameter.
+//  
+//*****************************************************************************
+void ossimSarModel::setAcquisitionMode(const ossimString& mode)
+{
+   ossimString os = mode;
+   os.downcase();
+   if (os == "scan")
+   {
+      theAcquisitionMode = ossimSarModel::SCAN;
+   }
+   else if (os == "spot")
+   {
+      theAcquisitionMode = ossimSarModel::SPOT;
+   }
+   else
+   {
+      theAcquisitionMode = ossimSarModel::UNKNOWN;
+   }
+}
+
+double ossimSarModel::sensorAzimuth(const ossimDpt& image_point) const
+{
+   ossimGpt ground;
+   lineSampleToWorld(image_point, ground);
+
+   // Get image time
+   ossim_float64 iTime = getArpTime(image_point);
+
+   // Get ARP position
+   ossimEcefPoint arpPos = getArpPos(iTime);
+
+   ossimGpt sensor(arpPos);
+
+   return ground.azimuthTo(sensor);
+}
diff --git a/src/projection/ossimSensorModel.cpp b/src/projection/ossimSensorModel.cpp
new file mode 100644
index 0000000..0d0e3f9
--- /dev/null
+++ b/src/projection/ossimSensorModel.cpp
@@ -0,0 +1,1800 @@
+//*****************************************************************************
+// FILE: ossimSensorModel.cc
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR: Oscar Kramer
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimSensorModel. This is the base
+//   class to all sensor model-related projections including replacement
+//   models such as coarse grids and polynomial models. This base class
+//   supports adjustable parameters for registration adjustment.
+//
+//   Important note to sensor model implementors: In order to avoid a separate
+//   set of "initial adjustable parameters," this design assumes ALL initial
+//   values are 0. When designing the derived-class model, insure that the
+//   adjustable parameters are 0-based. This applies to the adjustable param
+//   array declared in this base class only. The derived classes can declare
+//   their own adjstable params that are more descriptive and that can be
+//   assigned an initial value thet is non-zero, but that are linearly related
+//   to the adjustable params of this class. In that case, the updateModel()
+//   method will compute the derived-class's parameters based on
+//   theAdjustableParams array, after an adjustment is made.
+//
+// LIMITATIONS: None.
+//
+//*****************************************************************************
+//  $Id: ossimSensorModel.cpp 23564 2015-10-02 14:12:25Z dburken $
+#include <iostream>
+#include <sstream>
+using namespace std;
+
+// #include <stdio.h>
+
+#include <ossim/projection/ossimSensorModel.h>
+
+RTTI_DEF3(ossimSensorModel, "ossimSensorModel", ossimProjection, ossimOptimizableProjection, ossimAdjustableParameterInterface);
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimTieGptSet.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+
+#include <ossim/matrix/newmatrc.h>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  ("ossimSensorModel:exec");
+static ossimTrace traceDebug ("ossimSensorModel:debug");
+
+static const char*       REF_GPT_LAT_KW      = "ref_point_lat";
+static const char*       REF_GPT_LON_KW      = "ref_point_lon";
+static const char*       REF_GPT_HGT_KW      = "ref_point_hgt";
+static const char*       REF_IPT_LINE_KW     = "ref_point_line";
+static const char*       REF_IPT_SAMP_KW     = "ref_point_samp";
+static const char*       IMAGE_ID_KW         = "image_id";
+static const char*       SENSOR_ID_KW        = "sensor";
+static const ossimString NULL_STRING         = "NULL";
+static const double      RAY_ORIGIN_HEIGHT   = 10000.0; //meters
+
+
+//DEBUG TBR : output ops
+std::ostream& operator<<(std::ostream& os, NEWMAT::GeneralMatrix& mat)
+{
+   int nr=mat.Nrows();
+   int nc=mat.Ncols();
+
+   NEWMAT::MatrixRow crow(&mat,NEWMAT::LoadOnEntry);
+//   NEWMAT::MatrixRowCol crow;
+   mat.RestoreRow(crow);  
+   for (int r=0;r<nr;++r)
+   {
+      for (int c=0;c<nc;++c)
+      {
+         os<<*(crow.Data()+c)<<" ";
+      }
+      os<<std::endl;
+      mat.NextRow(crow);
+   }
+   return os;
+}
+
+//*****************************************************************************
+//  DEFAULT CONSTRUCTOR: ossimSensorModel()
+//*****************************************************************************
+ossimSensorModel::ossimSensorModel()
+   :
+   ossimOptimizableProjection       (),
+   ossimAdjustableParameterInterface(),
+   theImageSize        (0, 0),
+   theSubImageOffset   (0.0, 0.0),
+   theImageID          (),
+   theSensorID         (),
+   theGSD              (0.0, 0.0),
+   theMeanGSD          (0.0),
+   theRefGndPt         (0.0, 0.0, 0.0),
+   theRefImgPt         (0.0, 0.0),
+   theBoundGndPolygon  (),
+   theImageClipRect    (),
+   theRelPosError      (0.0),
+   theNominalPosError  (0.0),
+   theParWRTx          (0.0, 0.0),
+   theParWRTy          (0.0, 0.0),
+   theParWRTz          (0.0, 0.0),
+   theObs              (0.0, 0.0),
+   theResid            (0.0, 0.0),
+   theExtrapolateImageFlag(false),
+   theExtrapolateGroundFlag(false)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): entering...\n"
+         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): returning..."
+         << std::endl;
+   }
+}
+
+//*****************************************************************************
+//  COPY CONSTRUCTOR: ossimSensorModel(ossimSensorModel)
+//*****************************************************************************
+ossimSensorModel::ossimSensorModel(const ossimSensorModel& model)
+   :
+   ossimOptimizableProjection(model),
+   ossimAdjustableParameterInterface(model),
+   theImageSize       (model.theImageSize),
+   theSubImageOffset  (model.theSubImageOffset),
+   theImageID         (model.theImageID),
+   theSensorID        (model.theSensorID),
+   theGSD             (model.theGSD),
+   theMeanGSD         (model.theMeanGSD),
+   theRefGndPt        (model.theRefGndPt),
+   theRefImgPt        (model.theRefImgPt),
+   theBoundGndPolygon (model.theBoundGndPolygon),
+   theImageClipRect   (model.theImageClipRect),
+   theRelPosError     (model.theRelPosError),
+   theNominalPosError (model.theNominalPosError),
+   theParWRTx         (model.theParWRTx),
+   theParWRTy         (model.theParWRTy),
+   theParWRTz         (model.theParWRTz),
+   theObs             (model.theObs),
+   theResid           (model.theResid),
+   theExtrapolateImageFlag(false),
+   theExtrapolateGroundFlag(false)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimSensorModel::ossimSensorModel(model): entering..." << std::endl;
+   }
+
+   theErrorStatus = model.theErrorStatus;
+   
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimSensorModel::ossimSensorModel(model): returning..." << std::endl;
+   }
+   
+   return;
+}
+
+//*****************************************************************************
+//  CONSTRUCTOR: ossimSensorModel(geom_kwl)
+//  
+//  Constructs from a geometry keywordlist.
+//  
+//*****************************************************************************
+ossimSensorModel::ossimSensorModel(const ossimKeywordlist& geom_kwl)
+   :
+   ossimOptimizableProjection     (),
+   ossimAdjustableParameterInterface(),
+   theImageSize        (0, 0),
+   theSubImageOffset   (0.0, 0.0),
+   theImageID          (),
+   theSensorID         (),
+   theGSD              (0.0, 0.0),
+   theMeanGSD          (0.0),
+   theRefGndPt         (0.0, 0.0, 0.0),
+   theRefImgPt         (0.0, 0.0),
+   theBoundGndPolygon  (),
+   theImageClipRect    (),
+   theRelPosError      (0.0),
+   theNominalPosError  (0.0),
+   theParWRTx          (0.0, 0.0),
+   theParWRTy          (0.0, 0.0),
+   theParWRTz          (0.0, 0.0),
+   theObs              (0.0, 0.0),
+   theResid            (0.0, 0.0),
+   theExtrapolateImageFlag(false),
+   theExtrapolateGroundFlag(false)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): entering..." << std::endl;
+   }
+   
+//   ossimElevManager::instance()->loadState(geom_kwl);
+   loadState(geom_kwl);
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimSensorModel::ossimSensorModel(geom_kwl): returning..." << std::endl;
+   }
+}
+
+
+const ossimSensorModel& ossimSensorModel::operator=( const ossimSensorModel& rhs )
+{
+   if (this != &rhs)
+   {
+      // ossimProjection base has no data members.
+      ossimOptimizableProjection::operator=(rhs);
+      ossimAdjustableParameterInterface::operator=(rhs);
+      theImageSize             = rhs.theImageSize;
+      theSubImageOffset        = rhs.theSubImageOffset;
+      theImageID               = rhs.theImageID;
+      theSensorID              = rhs.theSensorID;
+      theGSD                   = rhs.theGSD;
+      theMeanGSD               = rhs.theMeanGSD;
+      theRefGndPt              = rhs.theRefGndPt;
+      theRefImgPt              = rhs.theRefImgPt;
+      theBoundGndPolygon       = rhs.theBoundGndPolygon;
+      theImageClipRect         = rhs.theImageClipRect;
+      theRelPosError           = rhs.theRelPosError;
+      theNominalPosError       = rhs.theNominalPosError;
+      theParWRTx               = rhs.theParWRTx;
+      theParWRTy               = rhs.theParWRTy;
+      theParWRTz               = rhs.theParWRTz;
+      theObs                   = rhs.theObs;
+      theResid                 = rhs.theResid;
+      theExtrapolateImageFlag  = rhs.theExtrapolateImageFlag;
+      theExtrapolateGroundFlag = rhs.theExtrapolateGroundFlag;
+   }
+   return *this;
+}
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimSensorModel
+//  
+//*****************************************************************************
+ossimSensorModel::~ossimSensorModel()
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::~ossimSensorModel: entering..." << std::endl;
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::~ossimSensorModel: returning..." << std::endl;
+}
+
+ossimObject* ossimSensorModel::getBaseObject()
+{
+   return this;
+}
+
+const ossimObject* ossimSensorModel::getBaseObject()const
+{
+   return this;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSensorModel::lineSampleToWorld(image_pt, &gpt)
+//  
+//  Intersects the ray associated with image_pt with the available elevation
+//  model. Returns ground point
+//  
+//*****************************************************************************
+void ossimSensorModel::lineSampleToWorld(const ossimDpt& image_point,
+                                         ossimGpt&       gpt) const
+{
+   bool debug = false;  // setable via interactive debugger
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld:entering..." << std::endl;
+   
+   if(image_point.hasNans())
+   {
+      gpt.makeNan();
+      return;
+   }
+   //***
+   // Extrapolate if image point is outside image:
+   //***
+   if (!insideImage(image_point)&&(!theExtrapolateImageFlag))
+   {
+      gpt = extrapolate(image_point);
+      return;
+   }
+
+   //***
+   // Determine imaging ray and invoke elevation source object's services to
+   // intersect ray with terrain model:
+   //***
+   ossimEcefRay ray;
+   imagingRay(image_point, ray);
+   ossimElevManager::instance()->intersectRay(ray, gpt);
+
+   if (traceDebug() || debug)
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
+   }
+
+   if (traceExec() || debug)  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSensorModel::worldToLineSample()
+//  
+//  Performs forward projection of ground point to image space.
+//  
+//*****************************************************************************
+void ossimSensorModel::worldToLineSample(const ossimGpt& worldPoint,
+                                         ossimDpt&       ip) const
+{
+   //   static bool recursionFlag = false;
+
+   static const double PIXEL_THRESHOLD    = .1; // acceptable pixel error
+   static const int    MAX_NUM_ITERATIONS = 20;
+
+
+   if(worldPoint.isLatNan() || worldPoint.isLonNan())
+   {
+      ip.makeNan();
+      return;
+   }
+      
+   //***
+   // First check if the world point is inside bounding rectangle:
+   //***
+   int iters = 0;
+   ossimDpt wdp (worldPoint);
+   //   if ((!recursionFlag)&&!(theBoundGndPolygon.pointWithin(wdp)))
+
+   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
+      (!theBoundGndPolygon.hasNans()))
+   {
+      if (!(theBoundGndPolygon.pointWithin(wdp)))
+      {
+         if(theSeedFunction.valid())
+         {
+            theSeedFunction->worldToLineSample(worldPoint, ip);
+         }
+         else if(!theExtrapolateGroundFlag) // if I am not already in the extrapolation routine
+
+         {
+         //      recursionFlag = true;
+            ip = extrapolate(worldPoint);
+         //      recursionFlag = false;
+         }
+         return;
+      }         
+   }
+
+   //***
+   // Substitute zero for null elevation if present:
+   //***
+   double height = worldPoint.hgt;
+   if ( ossim::isnan(height) )
+   {
+      height = 0.0;
+   }
+
+   //
+   // Utilize iterative scheme for arriving at image point. Begin with guess
+   // at image center:
+   //
+   if(theSeedFunction.valid())
+   {
+      theSeedFunction->worldToLineSample(worldPoint, ip);
+   }
+   else
+   {
+      ip.u = theRefImgPt.u;
+      ip.v = theRefImgPt.v;
+   }
+   
+   ossimDpt ip_du;
+   ossimDpt ip_dv;
+
+   ossimGpt gp, gp_du, gp_dv;
+   double dlat_du, dlat_dv, dlon_du, dlon_dv;
+   double delta_lat, delta_lon, delta_u, delta_v;
+   double inverse_norm;
+   bool done = false;
+   //***
+   // Begin iterations:
+   //***
+   do
+   {
+      //***
+      // establish perturbed image points about the guessed point:
+      //***
+      ip_du.u = ip.u + 1.0;
+      ip_du.v = ip.v;
+      ip_dv.u = ip.u;
+      ip_dv.v = ip.v + 1.0;
+      
+      //***
+      // Compute numerical partials at current guessed point:
+      //***
+      lineSampleHeightToWorld(ip,    height, gp);
+      lineSampleHeightToWorld(ip_du, height, gp_du);
+      lineSampleHeightToWorld(ip_dv, height, gp_dv);
+
+      if(gp.isLatNan() || gp.isLonNan())
+      {
+         gp = extrapolate(ip);
+      }
+      if(gp_du.isLatNan() || gp_du.isLonNan())
+      {
+         gp_du = extrapolate(ip_du);
+      }
+      if(gp_dv.isLatNan() | gp_dv.isLonNan())
+      {
+         gp_dv = extrapolate(ip_dv);
+         
+      }
+      dlat_du = gp_du.lat - gp.lat; //e
+      dlon_du = gp_du.lon - gp.lon; //g
+      dlat_dv = gp_dv.lat - gp.lat; //f
+      dlon_dv = gp_dv.lon - gp.lon; //h
+      
+      //
+      // Test for convergence:
+      //
+      delta_lat = worldPoint.lat - gp.lat;
+      delta_lon = worldPoint.lon - gp.lon;
+
+
+      //
+      // Compute linearized estimate of image point given gp delta:
+      //
+      inverse_norm = dlat_dv*dlon_du - dlat_du*dlon_dv; // fg-eh
+      
+      if (!ossim::almostEqual(inverse_norm, 0.0, DBL_EPSILON))
+      {
+         delta_u = (-dlon_dv*delta_lat + dlat_dv*delta_lon)/inverse_norm;
+         delta_v = ( dlon_du*delta_lat - dlat_du*delta_lon)/inverse_norm;
+         ip.u += delta_u;
+         ip.v += delta_v;
+      }
+      else
+      {
+         delta_u = 0;
+         delta_v = 0;
+      }
+      done = ((fabs(delta_u) < PIXEL_THRESHOLD)&&
+              (fabs(delta_v) < PIXEL_THRESHOLD));
+      iters++;
+   } while ((!done) && (iters < MAX_NUM_ITERATIONS));
+   
+//    } while (((fabs(delta_u) > PIXEL_THRESHOLD) ||
+//              (fabs(delta_v) > PIXEL_THRESHOLD)) &&
+//             (iters < MAX_NUM_ITERATIONS));
+
+#if 0 /* Please leave for debug. */
+   //---
+   // Note that this error mesage appears only if max count was reached while
+   // iterating. A linear (no iteration) solution would finish with iters =
+   // MAX_NUM_ITERATIONS + 1:
+   //---
+   if (iters >= MAX_NUM_ITERATIONS)
+   {
+      std::cout << "MAX ITERATION!!!" << std::endl;
+      std::cout << "delta_u = "   << delta_u
+                << "\ndelta_v = " << delta_v << "\n";
+   }
+   else
+   {
+      std::cout << "ITERS === " << iters << std::endl;
+   }
+   std::cout << "iters = " << iters << "\n";
+#endif
+
+   //***
+   // The image point computed this way corresponds to full image space.
+   // Apply image offset in the case this is a sub-image rectangle:
+   //***
+   ip -= theSubImageOffset;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSensorModel::print(ostream)
+//  
+//  Dumps contents of object to ostream.
+//  
+//*****************************************************************************
+std::ostream& ossimSensorModel::print(std::ostream& out) const
+{
+   out << setprecision(15) << setiosflags(ios::fixed)
+       << "\n ossimSensorModel base-class data members:\n"
+       << "\n         theImageID: " << theImageID
+       << "\n        theSensorID: " << theSensorID
+       << "\n       theImageSize: " << theImageSize
+       << "\n  theSubImageOffset: " << theSubImageOffset
+       << "\n             theGSD: " << theGSD
+       << "\n         theMeanGSD: " << theMeanGSD
+       << "\n        theRefGndPt: " << theRefGndPt
+       << "\n        theRefImgPt: " << theRefImgPt
+       << "\n theBoundGndPolygon: \n" << theBoundGndPolygon
+       << "\n   theImageClipRect: " << theImageClipRect
+       << "\n theNominalPosError: " << theNominalPosError
+       << "\n     theRelPosError: " << theRelPosError
+       << endl;
+
+   //---
+   // Note:
+   // need ossimAdjustableParameterInterface::print(os);
+   //---
+   return ossimProjection::print(out);
+}
+
+void ossimSensorModel::setRefImgPt(const ossimDpt& pt)
+{
+   theRefImgPt = pt;
+}
+
+void ossimSensorModel::setRefGndPt(const ossimGpt& pt)
+{
+   theRefGndPt = pt;
+}
+
+void ossimSensorModel::setImageRect(const ossimDrect& imageRect)
+{
+   theImageClipRect = imageRect;
+   theRefImgPt = imageRect.midPoint();
+}
+void ossimSensorModel::setGroundRect(const ossimGpt& ul,
+                                     const ossimGpt& ur,
+                                     const ossimGpt& lr,
+                                     const ossimGpt& ll)
+{
+   theBoundGndPolygon.clear();
+   theBoundGndPolygon.addPoint(ul);
+   theBoundGndPolygon.addPoint(ur);
+   theBoundGndPolygon.addPoint(lr);
+   theBoundGndPolygon.addPoint(ll);
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSensorModel::saveState()
+//  
+//  Saves the state of this object to KWL.
+//  
+//*****************************************************************************
+bool ossimSensorModel::saveState(ossimKeywordlist& kwl,
+                                 const char*       prefix) const 
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::saveState: entering..." << std::endl;
+
+   kwl.add(prefix, IMAGE_ID_KW, theImageID.chars());
+   kwl.add(prefix, SENSOR_ID_KW, theSensorID.chars());
+   
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_LINES_KW,
+           theImageSize.line,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_SAMPLES_KW,
+           theImageSize.samp,
+           true);
+   
+   kwl.add(prefix,
+           REF_GPT_LAT_KW,
+           theRefGndPt.lat,
+           true);
+   
+   kwl.add(prefix,
+           REF_GPT_LON_KW,
+           theRefGndPt.lon,
+           true);
+   
+   kwl.add(prefix,
+           REF_GPT_HGT_KW,
+           theRefGndPt.hgt,
+           true);
+   
+   kwl.add(prefix,
+           REF_IPT_LINE_KW,
+           theRefImgPt.line,
+           true);
+      
+   kwl.add(prefix,
+           REF_IPT_SAMP_KW,
+           theRefImgPt.samp,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
+           theGSD.line,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::METERS_PER_PIXEL_X_KW,
+           theGSD.samp,
+           true);
+   
+   ossimDpt corner;
+   if(!theBoundGndPolygon.vertex(0, corner))
+   {
+      corner = ossimDpt(0,0);
+   }
+   
+   kwl.add(prefix,
+           ossimKeywordNames::UL_LAT_KW,
+           corner.lat,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::UL_LON_KW,
+           corner.lon,
+           true);
+   
+   if(!theBoundGndPolygon.nextVertex(corner))
+   {
+      corner = ossimDpt(0,0);
+   }
+   kwl.add(prefix,
+           ossimKeywordNames::UR_LAT_KW,
+           corner.lat,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::UR_LON_KW,
+           corner.lon,
+           true);
+   
+   if(!theBoundGndPolygon.nextVertex(corner))
+   {
+      corner = ossimDpt(0,0);
+   }
+   kwl.add(prefix,
+           ossimKeywordNames::LR_LAT_KW,
+           corner.lat,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::LR_LON_KW,
+           corner.lon,
+           true);
+   
+   
+   if(!theBoundGndPolygon.nextVertex(corner))
+   {
+      corner = ossimDpt(0,0);
+   }
+   kwl.add(prefix,
+           ossimKeywordNames::LL_LAT_KW,
+           corner.lat,
+           true);
+   kwl.add(prefix,
+           ossimKeywordNames::LL_LON_KW,
+           corner.lon,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CE90_ABSOLUTE_KW,
+           theNominalPosError,
+           true, 20);
+
+   kwl.add(prefix,
+           ossimKeywordNames::CE90_RELATIVE_KW,
+           theRelPosError,
+           true, 20);
+
+   kwl.add(prefix,
+           "rect",
+           ossimString::toString(theImageClipRect.ul().x)
+           + " " + ossimString::toString(theImageClipRect.ul().y) + " " +
+           ossimString::toString(theImageClipRect.lr().x) + " " +
+           ossimString::toString(theImageClipRect.lr().y),
+           true);
+
+   if ( theSeedFunction.valid() )
+   {
+      ossimString seedPrefix = prefix;
+      seedPrefix += "seed_projection.";
+      theSeedFunction->saveState(kwl, seedPrefix.c_str());
+   }
+
+   // Avoid passing null char* to method that takes an ossimString.
+   ossimString tmpStr;
+   if (prefix)
+   {
+      tmpStr = prefix;
+   }
+   saveAdjustments(kwl, tmpStr);
+      
+   //
+   // Also save the state of the elevation object:
+   //
+//   ossimElevManager::instance()->saveState(kwl, prefix);
+   
+   
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::saveState:returning..." << std::endl;
+   return ossimProjection::saveState(kwl, prefix);;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSensorModel::loadState()
+//  
+//  Loads the state of this object from KWL.
+//  
+//*****************************************************************************
+bool ossimSensorModel::loadState(const ossimKeywordlist& kwl,
+                                 const char*       prefix)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::loadState: entering..." << std::endl;
+
+   const char* keyword;
+   const char* value;
+//   int nconv;
+   ossimDpt v[4]; // temporarily holds vertices for ground polygon
+
+   //***
+   // Read each keyword, breaking out if error occurs:
+   //***
+   keyword = IMAGE_ID_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+      theImageID = value;
+   else
+      theImageID = NULL_STRING;
+   
+   keyword = SENSOR_ID_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+      theSensorID = value;
+   else
+      theSensorID = NULL_STRING;
+      
+   keyword = ossimKeywordNames::NUMBER_LINES_KW;//IMAGE_SIZE_LINES_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      theImageSize.line = ossimString(value).toLong();
+   }
+
+   keyword = ossimKeywordNames::NUMBER_SAMPLES_KW;// IMAGE_SIZE_SAMPS_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      theImageSize.samp = ossimString(value).toLong();
+   }
+
+   keyword = REF_IPT_LINE_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      theRefImgPt.line = ossimString(value).toDouble();
+   }
+
+   keyword = REF_IPT_SAMP_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      theRefImgPt.samp = ossimString(value).toDouble();
+   }
+
+   keyword = REF_GPT_LAT_KW;
+   value = kwl.find(prefix, keyword);
+   if(value)
+   {
+      theRefGndPt.latd(ossimString(value).toDouble());
+   }
+   
+
+   keyword = REF_GPT_LON_KW;
+   value = kwl.find(prefix, keyword);
+   if(value)
+   {
+      theRefGndPt.lond(ossimString(value).toDouble());
+   }
+   
+
+   keyword = REF_GPT_HGT_KW;
+   value = kwl.find(prefix, keyword);
+   if(value)
+   {
+      theRefGndPt.hgt = ossimString(value).toDouble();
+   }
+   
+
+   keyword = ossimKeywordNames::METERS_PER_PIXEL_Y_KW;// GSD_LINE_DIR_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      theGSD.line = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::METERS_PER_PIXEL_X_KW;//GSD_SAMP_DIR_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      theGSD.samp = ossimString(value).toDouble();
+   }
+
+   theMeanGSD = (fabs(theGSD.line) + fabs(theGSD.samp))/2.0;
+
+   keyword = ossimKeywordNames::UL_LAT_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[0].lat = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::UL_LON_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[0].lon = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::UR_LAT_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[1].lat = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::UR_LON_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[1].lon = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::LR_LAT_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[2].lat = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::LR_LON_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[2].lon = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::LL_LAT_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[3].lat = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::LL_LON_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+   {
+      v[3].lon = ossimString(value).toDouble();
+   }
+
+   keyword = ossimKeywordNames::CE90_ABSOLUTE_KW;
+   value = kwl.find(prefix, keyword);
+   if (!value)
+   {
+      // Try old keyword for legacy purposes:
+      keyword = ossimKeywordNames::IMAGE_CE90_KW;
+      value = kwl.find(prefix, keyword);
+   }
+   if (value)
+      theNominalPosError = atof(value);
+   else
+      theNominalPosError = 0.0;
+
+   keyword = ossimKeywordNames::CE90_RELATIVE_KW;
+   value = kwl.find(prefix, keyword);
+   if (value)
+      theRelPosError = atof(value);
+   else
+      theRelPosError = theNominalPosError;
+
+   //***
+   // Initialize other data members given quantities read in KWL:
+   //***
+   theBoundGndPolygon = ossimPolygon(4, v);
+
+   const char* rect = kwl.find(prefix, "rect");
+   if(rect)
+   {
+      std::vector<ossimString> splitArray;
+      ossimString rectString(rect);
+      rectString = rectString.trim();
+      rectString.split(splitArray, " ");
+      if(splitArray.size() == 4)
+      {
+         theImageClipRect = ossimDrect(splitArray[0].toDouble(),
+                                       splitArray[1].toDouble(),
+                                       splitArray[2].toDouble(),
+                                       splitArray[3].toDouble());
+      }
+      else
+      {
+         theImageClipRect = ossimDrect(0.0, 0.0,
+                                       theImageSize.samp-1, theImageSize.line-1);
+      }
+   }
+   else
+   {
+      theImageClipRect = ossimDrect(0.0, 0.0,
+                                    theImageSize.samp-1, theImageSize.line-1);
+   }
+   
+   // theSeedFunction: This is in the base class ossimSensorModel but is not
+   // in the ossimSensorModel::loadState so do it here.
+   ossimString seedPrefix = prefix;
+   seedPrefix += ".seed_projection.";
+   value = kwl.find( seedPrefix.chars(), ossimKeywordNames::TYPE_KW );
+   if ( value )
+   {
+      // Only do expensive factory call if key is found...
+      theSeedFunction = ossimProjectionFactoryRegistry::instance()->
+         createProjection(kwl, seedPrefix.chars());
+   }
+
+   // Avoid passing null char* to method that takes an ossimString.
+   ossimString tmpStr;
+   if (prefix)
+   {
+      tmpStr = prefix;
+   }
+   loadAdjustments(kwl, tmpStr);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::loadState: returning..." << std::endl;
+   return ossimProjection::loadState(kwl, prefix);;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: Model_type::extrapolate(image_point)
+//
+//  This method computes extrapolated values of latitude and longitude for
+//  points which are outside the actual image boundaries.
+//*****************************************************************************
+ossimGpt ossimSensorModel::extrapolate (const ossimDpt& imagePoint,
+                                        const double&   height) const
+{
+   theExtrapolateImageFlag = true;
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimSensorModel::extrapolate: entering... " << std::endl;
+
+   //---
+   // If image point supplied has NaN components, return now with a NaN point.
+   // This prevents an infinite recursion between model worldToLineSample
+   // and this method:
+   //---
+   if (imagePoint.hasNans())
+   {
+      theExtrapolateImageFlag = false;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
+      return ossimGpt(ossim::nan(), ossim::nan(), ossim::nan());
+   }
+
+   if(theSeedFunction.valid())
+   {
+      ossimGpt wpt;
+
+      theSeedFunction->lineSampleToWorld(imagePoint, wpt);
+      theExtrapolateImageFlag = false;
+      return wpt;
+   }
+   //***
+   // Determine which edge is intersected by the radial, and establish
+   // intersection:
+   //***
+   ossimGpt gpt;
+   ossimDpt edgePt (imagePoint);
+   ossimDpt image_center (theRefImgPt);
+   theImageClipRect.clip(image_center, edgePt);
+
+   //***
+   // Need edgePt relative to image center. Compute an epsilon perturbation in
+   // the direction of edgePt for later computing directional derivative,
+   // and back out the offset to origin:
+   //***
+   ossimDpt deltaPt (edgePt - image_center);
+   ossimDpt epsilon (deltaPt/deltaPt.length());
+   edgePt -= epsilon;  // insure that we are inside the image
+   ossimDpt edgePt_prime (edgePt - epsilon); // epsilon=1pixel
+       
+   //***
+   // Establish ground point corresponding to edge point and edgePt+epsilon:
+   //***
+   ossimGpt edgeGP;
+   ossimGpt edgeGP_prime;
+
+   if (ossim::isnan(height))
+   {
+      lineSampleToWorld(edgePt, edgeGP);
+      lineSampleToWorld(edgePt_prime, edgeGP_prime);
+   }
+   else
+   {
+      lineSampleHeightToWorld(edgePt, height, edgeGP);
+      lineSampleHeightToWorld(edgePt_prime, height, edgeGP_prime);
+   }
+   
+   //***
+   // Compute approximate directional derivatives of lat and lon along radial
+   // at the edge:
+   //***
+   double dpixel    = (edgePt-edgePt_prime).length();
+   double dlat_drad = (edgeGP.lat - edgeGP_prime.lat)/dpixel;
+   double dlon_drad = (edgeGP.lon - edgeGP_prime.lon)/dpixel;
+
+   //***
+   // Now extrapolate to image point of interest:
+   //***
+   double delta_pixel = (imagePoint - edgePt).length();
+
+   gpt.lat = edgeGP.lat + dlat_drad*delta_pixel;
+   gpt.lon = edgeGP.lon + dlon_drad*delta_pixel;
+   if ( ossim::isnan(height) )
+   {
+      gpt.hgt = ossimElevManager::instance()->getHeightAboveEllipsoid(gpt);
+   }
+   else
+   {
+      gpt.hgt = height;
+   }
+   theExtrapolateImageFlag = false;
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
+   return gpt;
+}
+
+
+//*****************************************************************************
+// PROTECTED METHOD: Model_type::extrapolate(ground_point)
+//
+//  This method computes extrapolated values of line and sample for
+//  points which are outside the actual image boundaries.
+//*****************************************************************************
+ossimDpt ossimSensorModel::extrapolate (const ossimGpt& gpt) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) <<  "DEBUG ossimSensorModel::extrapolate: entering... " << std::endl;
+   theExtrapolateGroundFlag = true;
+   double height = 0.0;
+   //---
+   // If ground point supplied has NaN components, return now with a NaN point.
+   //---
+   if ( (ossim::isnan(gpt.lat)) || (ossim::isnan(gpt.lon)) )
+//       (gpt.hgt==OSSIM_DBL_NAN))
+   {
+      theExtrapolateGroundFlag = false;
+      if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
+      return ossimDpt(ossim::nan(), ossim::nan());
+   }
+   if(ossim::isnan(gpt.hgt) == false)
+   {
+      height = gpt.hgt;
+   }
+   
+   if(theSeedFunction.valid())
+   {
+      ossimDpt ipt;
+
+      theSeedFunction->worldToLineSample(gpt, ipt);
+
+      theExtrapolateGroundFlag = false;
+     return ipt;
+   }
+   //***
+   // Determine which edge is intersected by the radial, and establish
+   // intersection:
+   //***
+   ossimDpt edgePt (gpt);
+   ossimDpt image_center (theRefGndPt);
+   theBoundGndPolygon.clipLineSegment(image_center, edgePt);
+
+   //---
+   // Compute an epsilon perturbation in the direction away from edgePt for
+   // later computing directional derivative:
+   //---
+   const double  DEG_PER_MTR =  8.983152841e-06; // Equator WGS-84...
+   double epsilon = theMeanGSD*DEG_PER_MTR; //degrees (latitude) per pixel
+   ossimDpt deltaPt (edgePt-image_center);
+   ossimDpt epsilonPt (deltaPt*epsilon/deltaPt.length());
+   edgePt -= epsilonPt;
+   ossimDpt edgePt_prime (edgePt - epsilonPt);
+       
+   //***
+   // Establish image point corresponding to edge point and edgePt+epsilon:
+   //***
+      ossimGpt edgeGP       (edgePt.lat,       edgePt.lon,       height);//gpt.hgt);
+      ossimGpt edgeGP_prime (edgePt_prime.lat, edgePt_prime.lon, height);//gpt.hgt);
+
+   worldToLineSample(edgeGP, edgePt);
+   worldToLineSample(edgeGP_prime, edgePt_prime);
+
+   //***
+   // Compute approximate directional derivatives of line and sample along
+   // radial at the edge:
+   //***
+   double dsamp_drad = (edgePt.samp - edgePt_prime.samp)/epsilon;
+   double dline_drad = (edgePt.line - edgePt_prime.line)/epsilon;
+
+   //***
+   // Now extrapolate to point of interest:
+   //***
+   double delta = (ossimDpt(gpt) - ossimDpt(edgeGP)).length();
+
+   
+   ossimDpt extrapolated_ip (edgePt.samp + delta*dsamp_drad,
+                             edgePt.line + delta*dline_drad);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::extrapolate: returning..." << std::endl;
+
+   theExtrapolateGroundFlag = false;
+   return extrapolated_ip;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimSensorModel::imagingRay()
+//  
+//  Default implementation for computing imaging ray from image point.
+//  
+//*****************************************************************************
+void ossimSensorModel::imagingRay(const ossimDpt& image_point,
+                                  ossimEcefRay&   image_ray) const
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::imagingRay: entering..." << std::endl;
+
+   ossimGpt start;
+   ossimGpt end;
+
+   lineSampleHeightToWorld(image_point, RAY_ORIGIN_HEIGHT, start);
+   lineSampleHeightToWorld(image_point, 0.0, end);
+
+   image_ray = ossimEcefRay(start, end);
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::imagingRay: returning..." << std::endl;
+   return;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSensorModel::getObsCovMat()
+//  
+//  Default implementation for forming observation covariance matrix.
+//
+//    Note: At this base class level, the only error source currently
+//          considered is mensuration error.  This is obviously optimistic,
+//          but is included as a placeholder/example, and is presently
+//          the trivial case.
+//  
+//*****************************************************************************
+ossimSensorModel::CovMatStatus ossimSensorModel::getObsCovMat(
+   const ossimDpt& /* ipos */ , NEWMAT::SymmetricMatrix& Cov, const ossim_float64 defPointingSigma)
+{
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Mensuration error contribution
+   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   //  Sensitivity matrix
+   NEWMAT::SymmetricMatrix B(2);
+   B = 0.0;
+   B(1,1) = 1.0;
+   B(2,2) = B(1,1);
+
+   //  Pointing covariance matrix
+   NEWMAT::SymmetricMatrix P(2);
+   P = 0.0;
+   P(1,1) = defPointingSigma*defPointingSigma;
+   P(2,2) = P(1,1);
+
+   //  Propagate
+   NEWMAT::SymmetricMatrix Cm;
+   Cm << B * P * B.t();
+
+   // ~~~~~~~~~~~~~~~~~~~~
+   // Sum total covariance
+   // ~~~~~~~~~~~~~~~~~~~~
+   NEWMAT::SymmetricMatrix Ctot = Cm; //+ other contributors as identified
+
+   // ~~~~~~~~~~~~~~~~~~
+   // Propagate to image
+   // ~~~~~~~~~~~~~~~~~~
+   NEWMAT::SymmetricMatrix Bi(2);
+   Bi = 0.0;
+   Bi(1,1) = 1.0;
+   Bi(2,2) = Bi(1,1);
+
+   Cov << Bi * Ctot * Bi.t();
+
+   return ossimSensorModel::COV_PARTIAL;
+}
+
+void ossimSensorModel::computeGsd()
+{
+   static const char MODULE[] = "ossimSensorModel::computeGsd";
+
+   if (theImageSize.hasNans())
+   {
+      std::string e = MODULE;
+      e += "Error image size has nans!";
+      throw ossimException(e);
+   }
+
+   //---
+   // Compute gsd in the x direction from left to right points across the middle of image.
+   // Compute gsd in the y direction from top to bottom points across the middle of image.
+   //---
+
+   // ossim_float64 midLine = 0.0;
+   // ossim_float64 midSamp = 0.0;
+   // ossim_float64 endLine = 1.0;
+   // ossim_float64 endSamp = 1.0;
+   // if (theImageSize.x > 2)
+   // {
+   //    midSamp = (theImageSize.x-1)/2.0;
+   //    endSamp = theImageSize.x-1;
+         
+   // }
+   // if (theImageSize.y > 2)
+   // {
+   //    midLine = (theImageSize.y-1)/2.0;
+   //    endLine = theImageSize.y-1;
+   // }
+
+   ossimDpt centerImagePoint = theRefImgPt;
+   ossimDpt quarterSize;
+   if(!theImageSize.hasNans())
+   {
+      quarterSize = ossimDpt(theImageSize.x/4.0, theImageSize.y/4.0);
+   }
+   else if(!theImageClipRect.hasNans())
+   {
+      ossim_float32 w = theImageClipRect.width();
+      ossim_float32 h = theImageClipRect.height();
+
+      quarterSize = ossimDpt(w/4.0, h/4.0);
+   }
+   else
+   {
+      quarterSize = ossimDpt(1.0,1.0);      
+   }
+   if(centerImagePoint.hasNans()&&(!theImageSize.hasNans()))
+   {
+      centerImagePoint.x = (theImageSize.x)/2.0;
+      centerImagePoint.y = (theImageSize.y-1.0)/2.0;
+   }
+   else if(centerImagePoint.hasNans()&&!theImageClipRect.hasNans())
+   {
+      centerImagePoint = theImageClipRect.midPoint();
+   }
+   
+   if(!centerImagePoint.hasNans())
+   {
+      ossimDpt leftDpt(centerImagePoint.x-quarterSize.x, centerImagePoint.y);//  (0.0,     midLine);
+      ossimDpt rightDpt(centerImagePoint.x+quarterSize.y, centerImagePoint.y);// (endSamp, midLine);
+      ossimDpt topDpt(centerImagePoint.x, centerImagePoint.y-quarterSize.y);//   (midSamp, 0.0);
+      ossimDpt bottomDpt(centerImagePoint.x, centerImagePoint.y+quarterSize.y);//(midSamp, endLine);
+
+      ossimGpt leftGpt;
+      ossimGpt rightGpt;
+      ossimGpt topGpt;
+      ossimGpt bottomGpt;
+
+      //---
+      // Left point.
+      // For the first point use lineSampleToWorld to get the height.
+      //---
+      lineSampleToWorld(leftDpt, leftGpt);
+      if (leftGpt.hasNans())
+      {
+         std::string e = MODULE;
+         e += "Error leftGpt has nans!";
+         throw ossimException(e);
+      }
+
+      //---
+      // Right point:
+      // Use lineSampleHeightToWorld using the left height since we want the horizontal distance.
+      //---
+      lineSampleHeightToWorld(rightDpt, leftGpt.hgt, rightGpt);
+      if (rightGpt.hasNans())
+      {
+         std::string e = MODULE;
+         e += "Error rightGpt has nans!";
+         throw ossimException(e);
+      }
+
+      //---
+      // Top point:
+      // Use lineSampleHeightToWorld using the left height since we want the horizontal distance.
+      //---
+      lineSampleHeightToWorld(topDpt, leftGpt.hgt, topGpt);
+      if (topGpt.hasNans())
+      {
+         std::string e = MODULE;
+         e += "Error topGpt has nans!";
+         throw ossimException(e);
+      }
+      
+      //---
+      // Bottom point:
+      // Use lineSampleHeightToWorld using the left height since we want the horizontal distance.
+      //---
+      lineSampleHeightToWorld(bottomDpt, leftGpt.hgt, bottomGpt);
+      if (bottomGpt.hasNans())
+      {
+         std::string e = MODULE;
+         e += "Error bottomGpt has nans!";
+         throw ossimException(e);
+      }
+
+#if 0 /* Please leave for debug. (drb) */
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "image size:    " << theImageSize
+         << "\nleftDpt:   " << leftDpt
+         << "\nrightDpt:  " << rightDpt
+         << "\ntopDpt:    " << topDpt
+         << "\nbottomDpt: " << bottomDpt      
+         << "\nleftGpt:   " << leftGpt
+         << "\nrightGpt:  " << rightGpt
+         << "\ntopGpt:    " << topGpt
+         << "\nbottomGpt: " << bottomGpt      
+         << "\n";
+#endif
+         
+      theGSD.x   = leftGpt.distanceTo(rightGpt)/(rightDpt.x-leftDpt.x);
+      theGSD.y   = topGpt.distanceTo(bottomGpt)/(bottomDpt.y-topDpt.y);
+      theMeanGSD = (theGSD.x + theGSD.y)/2.0;
+
+   }
+   else
+   {
+         std::string e = MODULE;
+         e += "Error center has nans!";
+         throw ossimException(e);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSensorModel::computGsd DEBUG:"
+         << "\ntheGSD:     " << theGSD
+         << "\ntheMeanGSD: " << theMeanGSD << std::endl;
+   }
+}
+
+//*****************************************************************************
+//  STATIC METHOD: ossimSensorModel::writeGeomTemplate
+//  
+//  Outputs a sample geometry KWL to stream provided.
+//  
+//*****************************************************************************
+void ossimSensorModel::writeGeomTemplate(ostream& os)
+{
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::writeGeomTemplate:entering..." << std::endl;
+   
+   os << "//***\n"
+      << "// Base-class ossimSensorModel Keywords:\n"
+      << "//***\n"
+      << ossimKeywordNames::ID_KW << ":  <string>\n"
+      << SENSOR_ID_KW << ": <string>\n"
+      << ossimKeywordNames::NUMBER_LINES_KW << ": <int>\n"
+      << ossimKeywordNames::NUMBER_SAMPLES_KW << ": <int>\n"
+      << REF_GPT_LAT_KW << ": <decimal degrees>\n"
+      << REF_GPT_LON_KW << ": <decimal degrees>\n"
+      << REF_GPT_HGT_KW << ": <float meters>\n"
+      << REF_IPT_LINE_KW << ": <float>\n"
+      << REF_IPT_SAMP_KW << ": <float>\n"
+      << ossimKeywordNames::METERS_PER_PIXEL_Y_KW << ": <float meters>\n"
+      << ossimKeywordNames::METERS_PER_PIXEL_X_KW << ": <float meters>\n"
+      << ossimKeywordNames::UL_LAT_KW << ": <decimal degrees>\n"
+      << ossimKeywordNames::UL_LON_KW << ": <decimal degrees>\n"
+      << ossimKeywordNames::UR_LAT_KW << ": <decimal degrees>\n"
+      << ossimKeywordNames::UR_LON_KW << ": <decimal degrees>\n"
+      << ossimKeywordNames::LR_LAT_KW << ": <decimal degrees>\n"
+      << ossimKeywordNames::LR_LON_KW << ": <decimal degrees>\n"
+      << ossimKeywordNames::LL_LAT_KW << ": <decimal degrees>\n"
+      << ossimKeywordNames::LL_LON_KW << ": <decimal degrees>\n"
+      << "\n"
+      << "//***\n"
+      << "// Repeat following four entries for each adjustable parameter:\n"
+      << "//***\n"
+//       << PARAM_PREFIX << "N." << PARAM_NAME_KW << ": <string>\n" 
+//       << PARAM_PREFIX << "N." << PARAM_UNITS_KW << ": <string>\n" 
+//       << PARAM_PREFIX << "N." << PARAM_VALUE_KW << ": <float>\n" 
+//       << PARAM_PREFIX << "N." << PARAM_SIGMA_KW << ": <float>\n"
+      << std::endl;
+
+   if (traceExec())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::writeGeomTemplate: returning..." << std::endl;
+   return;
+}
+
+ossim_uint32 
+ossimSensorModel::degreesOfFreedom()const
+{
+   ossim_uint32 dof = 0;
+   ossim_uint32 idx = 0;
+   ossim_uint32 numAdj = getNumberOfAdjustableParameters();
+   for(idx = 0; idx < numAdj; ++idx)
+   {
+      if(!isParameterLocked(idx))
+      {
+         ++dof;
+      }
+   }
+   
+   return dof;
+}
+
+double
+ossimSensorModel::optimizeFit(const ossimTieGptSet& tieSet, double* /* targetVariance */)
+{
+   //use a simple Levenberg-Marquardt non-linear optimization
+   //note : please limit the number of tie points
+   //
+   //INPUTS: requires Jacobian matrix (partial derivatives with regards to parameters)
+   //OUTPUTS: will also compute parameter covariance matrix
+   //
+   //TBD: use targetVariance!
+ 
+   int np = getNumberOfAdjustableParameters();
+   int nobs = tieSet.size();
+
+   //setup initail values
+   int iter=0;
+   int iter_max = 200;
+   double minResidue = 1e-10; //TBC
+   double minDelta = 1e-10; //TBC
+
+   //build Least Squares initial normal equation
+   // don't waste memory, add samples one at a time
+   NEWMAT::SymmetricMatrix A;
+   NEWMAT::ColumnVector residue;
+   NEWMAT::ColumnVector projResidue;
+   double deltap_scale = 1e-4; //step_Scale is 1.0 because we expect parameters to be between -1 and 1
+   buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
+   double ki2=residue.SumSquare();
+
+   //get current adjustment (between -1 and 1 normally) and convert to ColumnVector
+   ossimAdjustmentInfo cadj;
+   getAdjustment(cadj);
+   std::vector< ossimAdjustableParameterInfo >& parmlist = cadj.getParameterList();
+   NEWMAT::ColumnVector cparm(np), nparm(np);
+   for(int n=0;n<np;++n)
+   {
+      cparm(n+1) = parmlist[n].getParameter();
+   }
+
+   double damping_speed = 2.0;
+   //find max diag element for A
+   double maxdiag=0.0;
+   for(int d=1;d<=np;++d) {
+      if (maxdiag < A(d,d)) maxdiag=A(d,d);
+   }
+   double damping = 1e-3 * maxdiag;
+   double olddamping = 0.0;
+   bool found = false;
+
+   //DEBUG TBR
+   // cout<<"rms="<<sqrt(ki2/nobs)<<" ";
+   // cout.flush();
+
+   while ( (!found) && (iter < iter_max) ) //non linear optimization loop
+   {
+      bool decrease = false;
+
+      do
+      {
+         //add damping update to normal matrix
+         for(int d=1;d<=np;++d) A(d,d) += damping - olddamping;
+         olddamping = damping;
+
+         NEWMAT::ColumnVector deltap = solveLeastSquares(A, projResidue);
+
+         if (deltap.NormFrobenius() <= minDelta) 
+         {
+            found = true;
+         } else {
+            //update adjustment
+            nparm = cparm + deltap;
+            for(int n=0;n<np;++n)
+            {
+               setAdjustableParameter(n, nparm(n+1), false); //do not update now, wait
+            }
+            updateModel();
+
+            //check residue is reduced
+            NEWMAT::ColumnVector newresidue = getResidue(tieSet);
+            double newki2=newresidue.SumSquare();
+            double res_reduction = (ki2 - newki2) / (deltap.t()*(deltap*damping + projResidue)).AsScalar();
+ //DEBUG TBR
+       cout<<sqrt(newki2/nobs)<<" ";
+       cout.flush();
+
+            if (res_reduction > 0)
+            {
+               //accept new parms
+               cparm = nparm;
+               ki2=newki2;
+
+               deltap_scale = max(1e-15, deltap.NormInfinity()*1e-4);
+
+               buildNormalEquation(tieSet, A, residue, projResidue, deltap_scale);
+               olddamping = 0.0;
+
+               found = ( projResidue.NormInfinity() <= minResidue );
+               //update damping factor
+               damping *= std::max( 1.0/3.0, 1.0-std::pow((2.0*res_reduction-1.0),3));
+               damping_speed = 2.0;
+               decrease = true;
+            } else {
+               //cancel parameter update
+               for(int n=0;n<np;++n)
+               {
+                  setAdjustableParameter(n, nparm(n+1), false); //do not update right now
+               }
+               updateModel();
+
+               damping *= damping_speed;
+               damping_speed *= 2.0;
+            }
+         }
+      } while (!decrease && !found);
+      ++iter;
+   }
+
+//DEBUG TBR
+cout<<endl;
+
+   //compute parameter correlation
+   // use normal matrix inverse
+   //TBD
+
+   return ki2/nobs;
+}
+
+void
+ossimSensorModel::buildNormalEquation(const ossimTieGptSet& tieSet,
+                                      NEWMAT::SymmetricMatrix& A,
+                                      NEWMAT::ColumnVector& residue,
+                                      NEWMAT::ColumnVector& projResidue,
+                                      double pstep_scale)
+{
+   //goal:       build Least Squares system
+   //constraint: never store full Jacobian matrix in memory (can be huge)
+   //            so we build the matrices incrementally
+   // the system can be built using forward() or inverse() depending on the projection capabilities : useForward()
+   //
+   //TBD : add covariance matrix for each tie point
+
+   //init
+   int np = getNumberOfAdjustableParameters();
+   int dimObs;
+   bool useImageObs = useForward(); //caching
+   if (useImageObs)
+   {
+      dimObs = 2; //image observation
+   } else {
+      dimObs = 3; //ground observations
+   }
+   int no = dimObs * tieSet.size(); //number of observations
+
+   A.ReSize(np);
+   residue.ReSize(no);
+   projResidue.ReSize(np);
+   //Zeroify matrices that will be accumulated
+   A           = 0.0;
+   projResidue = 0.0;
+
+   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
+   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
+   unsigned long c=1;
+
+   if (useImageObs)
+   { 
+     //image observations 
+      std::vector<ossimDpt> imDerp(np);
+     ossimDpt resIm;
+     // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         resIm = (*tit)->tie - forward(*(*tit));
+         residue(c++) = resIm.x;
+         residue(c++) = resIm.y;
+
+         //compute all image derivatives regarding parametres for the tie point position
+         for(int p=0;p<np;++p)
+         {
+            imDerp[p] = getForwardDeriv( p , *(*tit) , pstep_scale);
+         }
+
+         //compute influence of tie point on all sytem elements
+         for(int p1=0;p1<np;++p1)
+         {        
+            //proj residue: J * residue
+            projResidue.element(p1) += imDerp[p1].x * resIm.x + imDerp[p1].y * resIm.y;
+
+            //normal matrix A = transpose(J)*J
+            for(int p2=p1;p2<np;++p2)
+            {
+               A.element(p1,p2) += imDerp[p1].x * imDerp[p2].x + imDerp[p1].y * imDerp[p2].y;
+            }
+         }
+      }
+   }
+   else
+   {
+      // ground observations
+      std::vector<ossimGpt>  gdDerp(np);
+      ossimGpt gd, resGd;
+      // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         gd = inverse((*tit)->tie);
+         residue(c++) = resGd.lon = ((*tit)->lon - gd.lon) * 100000.0;
+         residue(c++) = resGd.lat = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
+         residue(c++) = resGd.hgt = (*tit)->hgt - gd.hgt; //TBD : normalize to meters?
+
+         //compute all image derivatives regarding parametres for the tie point position
+         for(int p=0;p<np;++p)
+         {
+            gdDerp[p] = getInverseDeriv( p , (*tit)->tie, pstep_scale);
+         }
+
+         //compute influence of tie point on all sytem elements
+         for(int p1=0;p1<np;++p1)
+         {        
+            //proj residue: J * residue
+            projResidue.element(p1) += gdDerp[p1].lon * resGd.lon + gdDerp[p1].lat * resGd.lat + gdDerp[p1].hgt * resGd.hgt; //TBC
+
+            //normal matrix A = transpose(J)*J
+            for(int p2=p1;p2<np;++p2)
+            {
+               A.element(p1,p2) += gdDerp[p1].lon * gdDerp[p2].lon + gdDerp[p1].lat * gdDerp[p2].lat + gdDerp[p1].hgt * gdDerp[p2].hgt;
+            }
+         }
+      }
+
+   } //end of if (useImageObs)
+}
+
+//give inverse() partial derivative regarding parameter parmIdx (>=0)
+ossimGpt
+ossimSensorModel::getInverseDeriv(int parmIdx, const ossimDpt& ipos, double hdelta)
+{   
+   double den = 0.5/hdelta;
+   ossimGpt res,gd;
+
+   double middle = getAdjustableParameter(parmIdx);
+   //set parm to high value
+   setAdjustableParameter(parmIdx, middle + hdelta, true);
+   res = inverse(ipos);
+   //set parm to low value and gte difference
+   setAdjustableParameter(parmIdx, middle - hdelta, true);
+   gd = inverse(ipos);
+
+   //reset parm
+   setAdjustableParameter(parmIdx, middle, true);
+
+   res.lon = den*(res.lon - gd.lon) * 100000.0; //TBC : approx meters
+   res.lat = den*(res.lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
+   res.hgt = den*(res.hgt - gd.hgt);
+
+   return res;
+}
+
+//give forward() partial derivative regarding parameter parmIdx (>=0)
+ossimDpt
+ossimSensorModel::getForwardDeriv(int parmIdx, const ossimGpt& gpos, double hdelta)
+{   
+   static double den = 0.5/hdelta;
+   ossimDpt res;
+
+   double middle = getAdjustableParameter(parmIdx);
+   //set parm to high value
+   setAdjustableParameter(parmIdx, middle + hdelta, true);
+   res = forward(gpos);
+   //set parm to low value and gte difference
+   setAdjustableParameter(parmIdx, middle - hdelta, true);
+   res -= forward(gpos);
+   //get partial derivative
+   res = res*den;
+
+   //reset parm
+   setAdjustableParameter(parmIdx, middle, true);
+
+   return res;
+}
+
+NEWMAT::ColumnVector
+ossimSensorModel::getResidue(const ossimTieGptSet& tieSet)
+{
+   //init
+   NEWMAT::ColumnVector residue;
+   int dimObs;
+
+   bool useImageObs = useForward(); //caching
+   if (useImageObs)
+   {
+      dimObs = 2; //image observation
+   } else {
+      dimObs = 3; //ground observations
+   }
+   int no = dimObs * tieSet.size(); //number of observations
+
+   residue.ReSize(no);
+
+   const vector<ossimRefPtr<ossimTieGpt> >& theTPV = tieSet.getTiePoints();
+   vector<ossimRefPtr<ossimTieGpt> >::const_iterator tit;
+   unsigned long c=1;
+
+   if (useImageObs)
+   { 
+     //image observations 
+     ossimDpt resIm;
+     // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         resIm = (*tit)->tie - forward(**tit);
+         residue(c++) = resIm.x;
+         residue(c++) = resIm.y;
+      }
+   } else {
+      // ground observations
+      ossimGpt gd;
+      // loop on tie points
+      for (tit = theTPV.begin() ; tit != theTPV.end() ; ++tit)
+      {
+         //compute residue
+         gd = inverse((*tit)->tie);
+         residue(c++) = ((*tit)->lon - gd.lon) * 100000.0; //approx meters //TBC TBD
+         residue(c++) = ((*tit)->lat - gd.lat) * 100000.0 * cos(gd.lat / 180.0 * M_PI);
+         residue(c++) = (*tit)->hgt - gd.hgt; //meters
+      }
+   } //end of if (useImageObs)
+
+   return residue;
+}
+
+/*!
+ * solves Ax = r , with A symmetric positive definite
+ * A can be rank deficient
+ * size of A is typically between 10 and 100 rows
+ */
+NEWMAT::ColumnVector 
+ossimSensorModel::solveLeastSquares(NEWMAT::SymmetricMatrix& A,  NEWMAT::ColumnVector& r)const
+{
+   NEWMAT::ColumnVector x = invert(A)*r;
+   return x;
+}
+
+/** 
+ * stable invert stolen from ossimRpcSolver
+ */
+NEWMAT::Matrix 
+ossimSensorModel::invert(const NEWMAT::Matrix& m)const
+{
+   ossim_uint32 idx = 0;
+   NEWMAT::DiagonalMatrix d;
+   NEWMAT::Matrix u;
+   NEWMAT::Matrix v;
+
+   // decompose m.t*m which is stored in Temp into the singular values and vectors.
+   //
+   NEWMAT::SVD(m, d, u, v, true, true);
+   
+   // invert the diagonal
+   // this is just doing the reciprical fo all diagonal components and store back int
+   // d.  ths compute d inverse.
+   //
+   for(idx=0; idx < (ossim_uint32)d.Ncols(); ++idx)
+   {
+      if(d[idx] > 1e-14) //TBC : use DBL_EPSILON ?
+      {
+         d[idx] = 1.0/d[idx];
+      }
+      else
+      {
+         d[idx] = 0.0;
+
+//DEBUG TBR
+cout<<"warning: singular matrix in SVD"<<endl;
+
+      }
+   }
+
+   //compute inverse of decomposed m;
+   return v*d*u.t();
+}
diff --git a/src/projection/ossimSensorModelFactory.cpp b/src/projection/ossimSensorModelFactory.cpp
new file mode 100644
index 0000000..7fcc902
--- /dev/null
+++ b/src/projection/ossimSensorModelFactory.cpp
@@ -0,0 +1,721 @@
+//*****************************************************************************
+// FILE: ossimSensorModelFactory.cc
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// AUTHOR:  Oscar Kramer
+//
+// DESCRIPTION:
+//   Contains implementation of class ossimSensorModelFactory
+//
+//*****************************************************************************
+// $Id$
+
+#include <ossim/projection/ossimSensorModelFactory.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+
+#include <fstream>
+#include <algorithm>
+#include <memory>
+
+//***
+// Define Trace flags for use within this file:
+//***
+#include <ossim/base/ossimTrace.h>
+static ossimTrace traceExec  = ossimTrace("ossimSensorModelFactory:exec");
+static ossimTrace traceDebug = ossimTrace("ossimSensorModelFactory:debug");
+
+//***
+// Note to programmer: To add a new model, search this file for "ADD_MODEL"
+// to locate places requiring editing. Functional example below...
+//
+// ADD_MODEL: Include all sensor model headers here:
+//***
+#include <ossim/projection/ossimCoarseGridModel.h>
+#include <ossim/projection/ossimRpcModel.h>
+#include <ossim/projection/ossimRpcProjection.h>
+#include <ossim/projection/ossimIkonosRpcModel.h>
+#include <ossim/projection/ossimNitfRpcModel.h>
+#include <ossim/projection/ossimQuickbirdRpcModel.h>
+#include <ossim/projection/ossimLandSatModel.h>
+#include <ossim/projection/ossimSpot5Model.h>
+#include <ossim/projection/ossimBuckeyeSensor.h>
+#include <ossim/projection/ossimSarModel.h>
+#include <ossim/projection/ossimRS1SarModel.h>
+#include <ossim/support_data/ossimSpotDimapSupportData.h>
+//#include <ossim/projection/ossimNitfMapModel.h>
+#include <ossim/projection/ossimFcsiModel.h>
+#include <ossim/projection/ossimApplanixUtmModel.h>
+#include <ossim/projection/ossimApplanixEcefModel.h>
+#include <ossim/projection/ossimSkyBoxLearSensor.h>
+#include <ossim/projection/ossimIpodSensor.h>
+#include <ossim/projection/ossimPpjFrameSensor.h>
+#include <ossim/projection/ossimAlphaSensorHRI.h>
+#include <ossim/projection/ossimAlphaSensorHSI.h>
+#include <ossim/projection/ossimNitfRsmModel.h>
+#include <ossim/support_data/ossimFfL7.h>
+#include <ossim/support_data/ossimFfL5.h>
+#include <ossim/support_data/ossimPpjFrameSensorFile.h>
+#include <ossim/support_data/ossimAlphaSensorSupportData.h>
+#include <ossim/projection/ossimSpectraboticsRedEdgeModel.h>
+
+//***
+// ADD_MODEL: List names of all sensor models produced by this factory:
+//***
+//const char* MY_NEW_MODEL = "myNewModel";
+// const char* OCG_MODEL        = "ossimCoarseGridModel";
+// const char* RPC_MODEL        = "ossimRpcModel";
+// const char* IKONOS_RPC_MODEL = "ossimIkonosRpcModel";
+// const char* NITF_RPC_MODEL   = "ossimNitfRpcModel";
+// const char* LANDSAT_MODEL    = "ossimLandSatModel";
+// const char* NITF_MAP_MODEL   = "ossimNitfMapModel";
+// const char* FCSI_MODEL       = "ossimFcsiModel";
+// const char* EMERGE_FCSI_MODEL= "ossimEmergeFcsiModel";
+
+//*****************************************************************************
+//  STATIC METHOD: ossimSensorModelFactory::instance()
+//*****************************************************************************
+ossimSensorModelFactory*  ossimSensorModelFactory::instance()
+{
+   static ossimSensorModelFactory inst;
+   return &inst;
+}
+
+//*****************************************************************************
+//  METHOD: ossimSensorModelFactory::create(kwl, prefix)
+//*****************************************************************************
+ossimProjection* ossimSensorModelFactory::createProjection(const ossimKeywordlist &keywordList,
+                                                           const char *prefix) const
+{
+   ossimRefPtr<ossimProjection> result;
+
+   //
+   // Permit specification of geometry file name in lieu of type:
+   //
+   const char*  value = keywordList.find(prefix, ossimKeywordNames::GEOM_FILE_KW);
+   if (value)
+   {
+      result = createProjection(ossimFilename(value), 0);
+   }
+   //
+   // Search for occurence of "type" keyword:
+   //
+   else
+   {
+      value = keywordList.find(prefix, ossimKeywordNames::TYPE_KW);
+      if(value)
+      {
+         result = createProjection(ossimString(value));
+         if(result.valid())
+         {
+            if(!result->loadState(keywordList, prefix))
+            {
+               result = 0;
+            }
+        }
+      }
+   }
+   
+   return result.release();
+}
+
+//*****************************************************************************
+//  METHOD: 
+//  
+//*****************************************************************************
+ossimProjection*
+ossimSensorModelFactory::createProjection(const ossimString &name) const
+{
+   //***
+   // Name should represent the model type:
+   //***
+   if(name == STATIC_TYPE_NAME(ossimSkyBoxLearSensor))
+   {
+      return new ossimSkyBoxLearSensor;
+   }
+   if(name == STATIC_TYPE_NAME(ossimIpodSensor))
+   {
+      return new ossimIpodSensor;
+   }
+   if(name == STATIC_TYPE_NAME(ossimCoarseGridModel))
+   {
+      return new ossimCoarseGridModel;
+   }
+   if(name == STATIC_TYPE_NAME(ossimBuckeyeSensor))
+   {
+      return new ossimBuckeyeSensor;
+   }
+   
+   if (name ==  STATIC_TYPE_NAME(ossimRpcModel))
+   {
+      return new ossimRpcModel;
+   }
+
+   if(name == STATIC_TYPE_NAME(ossimLandSatModel))
+   {
+      return new ossimLandSatModel;
+   }
+
+//   if(name == STATIC_TYPE_NAME(ossimNitfMapModel))
+//   {
+//      return new ossimNitfMapModel;
+//   }
+
+   if(name == STATIC_TYPE_NAME(ossimQuickbirdRpcModel))
+   {
+      return new ossimQuickbirdRpcModel;
+   }
+   
+   if(name == STATIC_TYPE_NAME(ossimIkonosRpcModel))
+   {
+     return new ossimIkonosRpcModel;
+   }
+
+   if(name == STATIC_TYPE_NAME(ossimNitfRpcModel))
+   {
+      return new ossimNitfRpcModel;
+   }
+   if(name == STATIC_TYPE_NAME(ossimRpcProjection))
+   {
+      return new ossimRpcProjection;
+   }
+   if(name == STATIC_TYPE_NAME(ossimFcsiModel))
+   {
+      return new ossimFcsiModel;
+   }
+   if(name == STATIC_TYPE_NAME(ossimApplanixUtmModel))
+   {
+      return new ossimApplanixUtmModel;
+   }
+   if(name == STATIC_TYPE_NAME(ossimApplanixEcefModel))
+   {
+      return new ossimApplanixEcefModel;
+   }
+   if(name == STATIC_TYPE_NAME(ossimSpot5Model))
+   {
+      return new ossimSpot5Model;
+   }
+   if(name == STATIC_TYPE_NAME(ossimSarModel))
+   {
+      return new ossimSarModel;
+   }
+   if(name == STATIC_TYPE_NAME(ossimRS1SarModel))
+   {
+      return new ossimRS1SarModel;
+   }
+   if(name == STATIC_TYPE_NAME(ossimPpjFrameSensor))
+   {
+      return new ossimPpjFrameSensor;
+   }
+   if(name == STATIC_TYPE_NAME(ossimAlphaSensorHRI))
+   {
+      return new ossimAlphaSensorHRI;
+   }
+   if(name == STATIC_TYPE_NAME(ossimAlphaSensorHSI))
+   {
+      return new ossimAlphaSensorHSI;
+   }
+   if(name == STATIC_TYPE_NAME(ossimNitfRsmModel))
+   {
+      return new ossimNitfRsmModel();
+   }
+   if(name == STATIC_TYPE_NAME(ossimSpectraboticsRedEdgeModel))
+   {
+      return new ossimSpectraboticsRedEdgeModel();
+   }
+   
+
+   //***
+   // ADD_MODEL: (Please leave this comment for the next programmer)
+   //***
+//   if(name == MY_NEW_MODEL)
+//      return new myNewModel;
+
+   return NULL;
+}
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+ossimObject*
+ossimSensorModelFactory::createObject(const ossimString& typeName)const
+{
+   return createProjection(typeName);
+}
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+ossimObject*
+ossimSensorModelFactory::createObject(const ossimKeywordlist& kwl,
+                                      const char* prefix)const
+{
+   return createProjection(kwl, prefix);
+}
+   
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+void
+ossimSensorModelFactory::getTypeNameList(std::vector<ossimString>& typeList)
+   const
+{
+   typeList.push_back(STATIC_TYPE_NAME(ossimApplanixEcefModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimApplanixUtmModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimCoarseGridModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRpcModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimIkonosRpcModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimQuickbirdRpcModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimNitfRpcModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimLandSatModel));
+//   typeList.push_back(STATIC_TYPE_NAME(ossimNitfMapModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimFcsiModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSpot5Model));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSarModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimRS1SarModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimBuckeyeSensor));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSkyBoxLearSensor));
+   typeList.push_back(STATIC_TYPE_NAME(ossimIpodSensor));
+   typeList.push_back(STATIC_TYPE_NAME(ossimPpjFrameSensor));
+   typeList.push_back(STATIC_TYPE_NAME(ossimAlphaSensorHRI));
+   typeList.push_back(STATIC_TYPE_NAME(ossimAlphaSensorHSI));
+   typeList.push_back(STATIC_TYPE_NAME(ossimNitfRsmModel));
+   typeList.push_back(STATIC_TYPE_NAME(ossimSpectraboticsRedEdgeModel));
+   //***
+   // ADD_MODEL: Please leave this comment for the next programmer. Add above.
+   //***
+   //typeList.push_back(ossimString(MY_NEW_MODEL));
+   
+}
+
+ossimProjection* ossimSensorModelFactory::createProjection(
+   const ossimFilename& filename, ossim_uint32  entryIdx) const
+{
+   // ossimFilename::exists() currently does not work with s3 url's.
+   // if(!filename.exists()) return 0;
+
+   if(filename.empty()) return 0;
+
+   static const char MODULE[] = "ossimSensorModelFactory::createProjection";
+   
+   ossimKeywordlist kwl;
+   ossimRefPtr<ossimProjection> model = 0;
+
+   ossimFilename geomFile = filename;
+   geomFile = geomFile.setExtension("geom");
+   
+   if(geomFile.exists()&&
+      kwl.addFile(filename.c_str()))
+   {
+      ossimFilename coarseGrid;
+      
+      const char* type = kwl.find(ossimKeywordNames::TYPE_KW);
+      if(type)
+      {
+         if(ossimString(type) ==
+            ossimString(STATIC_TYPE_NAME(ossimCoarseGridModel)))
+         {
+            findCoarseGrid(coarseGrid, filename);
+            
+            if(coarseGrid.exists() &&(coarseGrid != ""))
+            {
+               kwl.add("grid_file_name",
+                       coarseGrid.c_str(),
+                       true);
+               model = new ossimCoarseGridModel(kwl);
+               if(!model->getErrorStatus())
+               {
+                  return model.release();
+               }
+               model = 0;
+            }
+         }
+      }
+      kwl.clear();
+   }
+
+   // See if there is an external geomtry.
+   ossimRefPtr<ossimProjection> proj =
+      createProjectionFromGeometryFile(filename, entryIdx);
+   if (proj.valid())
+   {
+      return proj.release();
+   }
+
+   if(model.valid())
+   {
+      model = 0;
+   }
+   
+   // first check for override
+   //
+   if(geomFile.exists()&&kwl.addFile(geomFile.c_str()))
+   {
+      model =  createProjection(kwl);
+      if(model.valid())
+      {
+         return model.release();
+      }
+      model = 0;
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: Testing ossimCoarsGridModel" << std::endl;
+   }
+   
+   ifstream input(geomFile.c_str());
+   char ecgTest[4] = { 0 };
+   input.read(ecgTest, 3); // even if `read()` fails, it will be initialized thanks to `= { 0 };`
+   input.close();
+   if(std::string(ecgTest) == "eCG")
+   {
+      ossimKeywordlist kwlTemp;
+      kwlTemp.add("type",
+                  "ossimCoarseGridModel",
+                  true);
+      kwlTemp.add("geom_file",
+                  geomFile.c_str(),
+                  true);
+      return createProjection(kwlTemp);
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: testing ossimRpcModel" << std::endl;
+   }
+
+   //---
+   // Test for quick bird rpc.  Could be either a tiff or nitf so not wrapped
+   // around "isNitf()" anymore.
+   //---
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: testing ossimQuickbirdRpcModel"
+         << std::endl;
+   }
+   
+   ossimRefPtr<ossimQuickbirdRpcModel> qbModel = new ossimQuickbirdRpcModel;
+   if(qbModel->parseFile(filename))
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG: returning ossimQuickbirdRpcModel"
+            << std::endl;
+      }
+      model = qbModel.get();
+      qbModel = 0;
+      return model.release();
+   }
+   else
+   {
+      qbModel = 0;
+   }
+   
+   //---
+   // Test for ikonos rpc.  Could be tiff or nitf which is handled in
+   // parseFile method.
+   //---
+   ossimRefPtr<ossimIkonosRpcModel> ikModel = new ossimIkonosRpcModel;
+   if(ikModel->parseFile(filename))
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG returning ossimQuickbirdRpcModel"
+            << std::endl;
+      }
+      model = ikModel.get();
+      ikModel = 0;
+      return model.release();
+   }
+   else
+   {
+      ikModel = 0;
+   }
+   if(isNitf(filename))
+   {
+     if(traceDebug())
+     {
+        ossimNotify(ossimNotifyLevel_DEBUG)
+           << MODULE << " DEBUG: testing ossimNitfRsmModel" << std::endl;
+     }
+     ossimRefPtr<ossimNitfRsmModel> rsmModel = new ossimNitfRsmModel();
+
+     if(rsmModel->parseFile(filename, entryIdx))
+     {
+         model = rsmModel.get();
+         rsmModel = 0;
+         return model.release();
+     }
+     else
+     {
+         rsmModel = 0;
+     }
+     if(traceDebug())
+     {
+        ossimNotify(ossimNotifyLevel_DEBUG)
+           << MODULE << " DEBUG: testing ossimNitfRsmModel" << std::endl;
+     }
+
+     ossimRefPtr<ossimNitfRpcModel> rpcModel = new ossimNitfRpcModel();
+     if ( rpcModel->parseFile(filename, entryIdx) ) // filename = NITF_file
+     {
+        model = rpcModel.get();
+        rpcModel = 0;
+        return model.release();
+     }
+     else
+     {
+        rpcModel = 0;
+     }
+     
+     if(traceDebug())
+     {
+        ossimNotify(ossimNotifyLevel_DEBUG)
+           << MODULE << " DEBUG: testing ossimIkinosRpcModel" << std::endl;
+     }
+     
+     // RP - This model crashes routinely if it ever happens to get a hold of a NITF
+     //model = new ossimNitfMapModel(filename); // filename = NITF_file
+     //if(!model->getErrorStatus())
+     //{
+     //   return model.release();
+     //}
+     //model = 0;
+   }
+   else if(isLandsat(filename))
+   {
+      model = new ossimLandSatModel(filename);
+      if(!model->getErrorStatus())
+      {
+         return model.release();
+      }
+      model = 0;
+   }
+   
+   model = new ossimRS1SarModel(filename);
+   if(model->getErrorStatus()!= ossimErrorCodes::OSSIM_OK)
+   {
+      return model.release();
+   }
+   model = 0;
+
+   // SPOT:
+   ossimFilename spot5Test = geomFile;
+   if(!spot5Test.exists())
+   {
+      spot5Test = geomFile.path();
+      spot5Test = spot5Test.dirCat(ossimFilename("METADATA.DIM"));
+      if (spot5Test.exists() == false)
+      {
+         spot5Test = geomFile.path();
+         spot5Test = spot5Test.dirCat(ossimFilename("metadata.dim"));
+      }
+   }
+   if(spot5Test.exists())
+   {
+      //---
+      // Check the basename of the input file. So we don't create a projection
+      // for ancillary files, icon.jpg amd preview.jpg.
+      //---
+      ossimFilename baseName = filename.file();
+      baseName.downcase();
+
+      if ( (baseName != "icon.jpg" ) && ( baseName != "preview.jpg" ) )
+      {
+         ossimRefPtr<ossimSpotDimapSupportData> meta =
+            new ossimSpotDimapSupportData;
+         if(meta->loadXmlFile(spot5Test))
+         {
+            model = new ossimSpot5Model(meta.get());
+            if(!model->getErrorStatus())
+            {
+               return model.release();
+            }
+         }
+      }
+   }
+   model = 0;
+            
+   ossimFilename ppjFilename = filename;
+   ppjFilename = ppjFilename.setExtension("ppj");
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: testing ossimPpjFrameSensor" << std::endl;
+   }
+   if(ppjFilename.exists())
+   {
+      ossimRefPtr<ossimPpjFrameSensorFile> ppjFile = new ossimPpjFrameSensorFile();
+
+      if(ppjFile->readFile(ppjFilename))
+      {
+         ossimRefPtr<ossimPpjFrameSensor> sensor = new ossimPpjFrameSensor();
+         ossimDpt imageSize = ppjFile->getImageSize();
+         sensor->setFocalLength(ppjFile->getIntrinsic()[0][0], ppjFile->getIntrinsic()[1][1]);
+         sensor->setPrincipalPoint(ppjFile->getPrincipalPoint());
+         sensor->setecef2CamMatrix(ppjFile->getExtrinsic().SymSubMatrix(1,3));
+         sensor->setCameraPosition(ppjFile->getPlatformPosition());
+         sensor->setImageSize(imageSize);
+         sensor->setImageRect(ossimDrect(0,0,imageSize.x-1, imageSize.y-1));
+         sensor->setRefImgPt(ossimDpt(imageSize.x*.5, imageSize.y*.5));
+         sensor->setAveragePrjectedHeight(ppjFile->getAverageProjectedHeight());
+         sensor->updateModel();
+         return sensor.release();         
+      }
+      ppjFile = 0;
+   }
+   
+   ossimFilename hdrFilename = filename;
+   hdrFilename = hdrFilename.setExtension("hdr"); // image.hdr
+   if ( !hdrFilename.exists() )   
+   {     
+      hdrFilename = filename;
+      hdrFilename.string() += ".hdr"; // image.ras.hdr
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: testing ossimAlphaSensor\nheader file: " << hdrFilename << std::endl;
+   }
+   if(hdrFilename.exists())
+   {
+      ossimRefPtr<ossimAlphaSensorSupportData> supData = new ossimAlphaSensorSupportData();
+      if(supData->readSupportFiles(hdrFilename))
+      {
+         if (supData->isHSI())
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << MODULE << " DEBUG: loading ossimAlphaSensorHSI" << std::endl;
+            }
+            ossimRefPtr<ossimAlphaSensorHSI> sensor = new ossimAlphaSensorHSI();
+            if ( sensor->initialize( *(supData.get()) ) )
+            {
+               return (ossimProjection*)sensor.release();
+            }
+         }
+         else
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << MODULE << " DEBUG: loading ossimAlphaSensorHRI" << std::endl;
+            }
+            ossimRefPtr<ossimAlphaSensorHRI> sensor = new ossimAlphaSensorHRI();
+            if ( sensor->initialize( *(supData.get()) ) )
+            {
+               return (ossimProjection*)sensor.release();
+            }
+         }
+      }
+      supData = 0;
+   }
+
+   model = new ossimCoarseGridModel(geomFile);
+   if(model.valid())
+   {
+      if(!model->getErrorStatus())
+      {
+        return model.release();
+      }
+      model = 0;
+   }
+
+   return model.release();
+}
+   
+bool ossimSensorModelFactory::isNitf(const ossimFilename& filename)const
+{
+   std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+      createIstream( filename, std::ios_base::in | std::ios_base::binary );
+   
+   if( in )
+   {
+      char nitfFile[4];
+      in->read((char*)nitfFile, 4);
+      
+      return (ossimString(nitfFile, nitfFile+4) == "NITF");
+   }
+
+   return false;
+}
+
+bool ossimSensorModelFactory::isLandsat(const ossimFilename& filename)const
+{
+   ossimFilename temp(filename);
+   temp.downcase();
+   ossimRefPtr<ossimFfL7> ff_headerp;
+   if (temp.contains("header.dat"))
+   {
+       ff_headerp = new ossimFfL5(filename);
+   } 
+   else 
+   {
+       ff_headerp = new ossimFfL7(filename);
+   }
+   bool r = !(ff_headerp->getErrorStatus());
+   ff_headerp = 0;
+   return r;
+}
+
+void ossimSensorModelFactory::findCoarseGrid(ossimFilename& result,
+                                             const ossimFilename& geomFile)const
+{
+   result = geomFile;
+   result.setFile(result.fileNoExtension()+"_ocg");
+   result.setExtension("dat");
+   
+   if(!result.exists())
+   {
+      result = geomFile;
+      result.setExtension("dat");
+   }
+   
+   // let's find a .dat file in the current directory
+   //
+   if(!result.exists())
+   {
+      result = "";
+      ossimDirectory directoryList(geomFile.path());
+      ossimFilename file;
+      if(directoryList.getFirst(file,
+                                ossimDirectory::OSSIM_DIR_FILES))
+      {
+         ossimString testString = "OSSIM_DBL_GRID";
+         char tempBuf[14];
+         do
+         {
+            if(file.ext().downcase() == "dat")
+            {
+               std::ifstream in(file.c_str());
+               if(in)
+               {
+                  in.read((char*)tempBuf, 14);
+                  in.close();
+                  if(ossimString(tempBuf, tempBuf+14) == testString)
+                  {
+                     result = file;
+                  }
+               }
+               
+            }
+         }while((directoryList.getNext(file))&&(result == ""));
+      }
+      // try to find it
+   }
+}
+
diff --git a/ossim/src/ossim/projection/ossimSensorModelTuple.cpp b/src/projection/ossimSensorModelTuple.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimSensorModelTuple.cpp
rename to src/projection/ossimSensorModelTuple.cpp
diff --git a/ossim/src/ossim/projection/ossimSinusoid.c b/src/projection/ossimSinusoid.c
similarity index 100%
rename from ossim/src/ossim/projection/ossimSinusoid.c
rename to src/projection/ossimSinusoid.c
diff --git a/src/projection/ossimSinusoidalProjection.cpp b/src/projection/ossimSinusoidalProjection.cpp
new file mode 100644
index 0000000..2a9dca7
--- /dev/null
+++ b/src/projection/ossimSinusoidalProjection.cpp
@@ -0,0 +1,450 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Sinusoidal projection code.  
+//*******************************************************************
+//  $Id: ossimSinusoidalProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+
+#include <math.h>
+#include <ossim/projection/ossimSinusoidalProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimSinusoidalProjection, "ossimSinusoidalProjection", ossimMapProjection)
+/***************************************************************************/
+/*
+ *                              DEFINES
+ */
+
+#define SINU_NO_ERROR           0x0000
+#define SINU_LAT_ERROR          0x0001
+#define SINU_LON_ERROR          0x0002
+#define SINU_EASTING_ERROR      0x0004
+#define SINU_NORTHING_ERROR     0x0008
+#define SINU_CENT_MER_ERROR     0x0020
+#define SINU_A_ERROR            0x0040
+#define SINU_B_ERROR            0x0080
+#define SINU_A_LESS_B_ERROR     0x0100
+
+#ifndef PI_OVER_2
+#  define PI_OVER_2  ( M_PI / 2.0)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI     (2.0 * M_PI)
+#endif
+
+#define SINU_COEFF_TIMES_SIN(coeff, x, latit)      (coeff * sin(x * latit))
+#define FLOAT_EQ(x,v,epsilon)   (((v - epsilon) < x) && (x < (v + epsilon)))
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS     
+ */
+
+ossimSinusoidalProjection::ossimSinusoidalProjection(const ossimEllipsoid& ellipsoid,
+                                                     const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+
+ossimSinusoidalProjection::ossimSinusoidalProjection(const ossimEllipsoid& ellipsoid,
+                                                     const ossimGpt& origin,
+                                                     double falseEasting,
+                                                     double falseNorthing)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   Sinu_False_Easting  = falseEasting;
+   Sinu_False_Northing = falseNorthing;
+   Sinu_Max_Easting    = 20037509.0;
+   Sinu_Min_Easting    = -20037509.0;
+   Sinu_Delta_Northing = 10001966.0;
+
+   update();
+}
+
+void ossimSinusoidalProjection::update()
+{   
+   Set_Sinusoidal_Parameters(theEllipsoid.getA(),
+                             theEllipsoid.getFlattening(),
+                             theOrigin.lonr(),
+                             Sinu_False_Easting,
+                             Sinu_False_Northing);
+
+   theFalseEastingNorthing.x = Sinu_False_Easting;
+   theFalseEastingNorthing.y = Sinu_False_Northing;
+ 
+   ossimMapProjection::update();
+}
+
+void ossimSinusoidalProjection::setFalseEasting(double falseEasting)
+{
+   Sinu_False_Easting = falseEasting;
+   
+   update();
+}
+
+void ossimSinusoidalProjection::setFalseNorthing(double falseNorthing)
+{
+   Sinu_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimSinusoidalProjection::setDefaults()
+{
+   Sinu_Max_Easting    = 20037509.0;
+   Sinu_Min_Easting    = -20037509.0;
+   Sinu_Delta_Northing = 10001966.0;
+   Sinu_False_Easting  = 0.0;
+   Sinu_False_Northing = 0.0;
+}
+
+void ossimSinusoidalProjection::setCentralMeridian(double centralMeridian)
+{
+  Sinu_Origin_Long = centralMeridian;
+  update();
+}
+
+void ossimSinusoidalProjection::setFalseEastingNorthing(double falseEasting,
+                                                        double falseNorthing)
+{
+   Sinu_False_Easting  = falseEasting;
+   Sinu_False_Northing = falseNorthing;
+   
+   update();
+}
+
+ossimGpt ossimSinusoidalProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_Sinusoidal_To_Geodetic(eastingNorthing.x,
+                                  eastingNorthing.y,
+                                  &lat,
+                                  &lon);   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
+}
+
+ossimDpt ossimSinusoidalProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Sinusoidal(gpt.latr(),
+                                  gpt.lonr(),
+                                  &easting,
+                                  &northing);   
+   return ossimDpt(easting, northing);
+}
+
+bool ossimSinusoidalProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimSinusoidalProjection::loadState(const ossimKeywordlist& kwl,
+                                          const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   
+   setDefaults();
+
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimSinusoidalProjection))
+   {
+      Sinu_False_Easting  = theFalseEastingNorthing.x;
+      Sinu_False_Northing = theFalseEastingNorthing.y;
+   }
+   
+   update();
+
+   return flag;
+}
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS     
+ */
+
+
+long ossimSinusoidalProjection::Set_Sinusoidal_Parameters(double a,
+                                                          double f,
+                                                          double Central_Meridian,
+                                                          double False_Easting,
+                                                          double False_Northing)
+{ /* BEGIN Set_Sinusoidal_Parameters */
+/*
+ * The function Set_Sinusoidal_Parameters receives the ellipsoid parameters and
+ * Sinusoidal projection parameters as inputs, and sets the corresponding state
+ * variables.  If any errors occur, the error code(s) are returned by the function, 
+ * otherwise SINU_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid						        (input)
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (input)
+ */
+
+  double j;
+  double One_MINUS_es2, Sqrt_One_MINUS_es2, e1, e2, e3, e4;
+//  double inv_f = 1 / f;
+  long Error_Code = SINU_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= SINU_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= SINU_INV_F_ERROR;
+//   }
+//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= SINU_CENT_MER_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    Sinu_a = a;
+    Sinu_f = f;
+    es2 = 2 * Sinu_f - Sinu_f * Sinu_f;
+    es4 = es2 * es2;
+    es6 = es4 * es2;
+    j = 45.0 * es6 / 1024.0;
+    c0 = 1.0 - es2 / 4.0 - 3.0 * es4 / 64.0 - 5.0 * es6 / 256.0;
+    c1 = 3.0 * es2 / 8.0 + 3.0 * es4 / 32.0 + j;
+    c2 = 15.0 * es4 / 256.0 + j;
+    c3 = 35.0 * es6 / 3072.0;
+    One_MINUS_es2 = 1.0 - es2;
+    Sqrt_One_MINUS_es2 = sqrt(One_MINUS_es2);
+    e1 = (1.0 - Sqrt_One_MINUS_es2) / (1.0 + Sqrt_One_MINUS_es2);
+    e2 = e1 * e1;
+    e3 = e2 * e1;
+    e4 = e3 * e1;
+    a0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0 ;
+    a1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
+    a2 = 151.0 * e3 / 96.0;
+    a3 = 1097.0 * e4 / 512.0;
+//     if (Central_Meridian > M_PI)
+//       Central_Meridian -= TWO_PI;
+    Sinu_Origin_Long = Central_Meridian;
+    Sinu_False_Northing = False_Northing;
+    Sinu_False_Easting = False_Easting;
+
+    if (Sinu_Origin_Long > 0)
+    {
+      Sinu_Max_Easting = 19926189.0;
+      Sinu_Min_Easting = -20037509.0;
+    }
+    else if (Sinu_Origin_Long < 0)
+    {
+      Sinu_Max_Easting = 20037509.0;
+      Sinu_Min_Easting = -19926189.0;
+    }
+    else
+    {
+      Sinu_Max_Easting = 20037509.0;
+      Sinu_Min_Easting = -20037509.0;
+    }
+  } /* END OF if(!Error_Code) */
+  return (Error_Code);
+} /* END OF Set_Sinusoidal_Parameters */
+
+void ossimSinusoidalProjection::Get_Sinusoidal_Parameters(double *a,
+                                                          double *f,
+                                                          double *Central_Meridian,
+                                                          double *False_Easting,
+                                                          double *False_Northing)const
+{ /* BEGIN Get_Sinusoidal_Parameters */
+/*
+ * The function Get_Sinusoidal_Parameters returns the current ellipsoid
+ * parameters, and Sinusoidal projection parameters.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid						        (output)
+ *    Central_Meridian  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (output)
+ */
+
+  *a = Sinu_a;
+  *f = Sinu_f;
+  *Central_Meridian = Sinu_Origin_Long;
+  *False_Easting = Sinu_False_Easting;
+  *False_Northing = Sinu_False_Northing;
+  
+  return;
+} /* END OF Get_Sinusoidal_Parameters */
+
+
+long ossimSinusoidalProjection::Convert_Geodetic_To_Sinusoidal (double Latitude,
+                                                                double Longitude,
+                                                                double *Easting,
+                                                                double *Northing)const
+{ /* BEGIN Convert_Geodetic_To_Sinusoidal */
+/*
+ * The function Convert_Geodetic_To_Sinusoidal converts geodetic (latitude and
+ * longitude) coordinates to Sinusoidal projection (easting and northing)
+ * coordinates, according to the current ellipsoid and Sinusoidal projection
+ * parameters.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise SINU_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double slat = sin(Latitude);
+  double sin2lat, sin4lat, sin6lat;
+  double dlam;                      /* Longitude - Central Meridan */
+  double mm;
+  double MM;
+  long Error_Code = SINU_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   { /* Latitude out of range */
+//     Error_Code |= SINU_LAT_ERROR;
+//   }
+//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
+//   { /* Longitude out of range */
+//     Error_Code |= SINU_LON_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    dlam = Longitude - Sinu_Origin_Long;
+//     if (dlam > M_PI)
+//     {
+//       dlam -= TWO_PI;
+//     }
+//     if (dlam < -M_PI)
+//     {
+//       dlam += TWO_PI;
+//     }
+    mm = sqrt(1.0 - es2 * slat * slat);
+
+    sin2lat = SINU_COEFF_TIMES_SIN(c1, 2.0, Latitude);
+    sin4lat = SINU_COEFF_TIMES_SIN(c2, 4.0, Latitude);
+    sin6lat = SINU_COEFF_TIMES_SIN(c3, 6.0, Latitude);
+    MM = Sinu_a * (c0 * Latitude - sin2lat + sin4lat - sin6lat);
+
+    *Easting = Sinu_a * dlam * cos(Latitude) / mm + Sinu_False_Easting;
+    *Northing = MM + Sinu_False_Northing;
+  }
+  return (Error_Code);
+} /* END OF Convert_Geodetic_To_Sinusoidal */
+
+
+long ossimSinusoidalProjection::Convert_Sinusoidal_To_Geodetic(double Easting,
+                                                               double Northing,
+                                                               double *Latitude,
+                                                               double *Longitude)const
+{ /* BEGIN Convert_Sinusoidal_To_Geodetic */
+/*
+ * The function Convert_Sinusoidal_To_Geodetic converts Sinusoidal projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid and Sinusoidal projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise SINU_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
+  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
+  double mu;
+  double sin2mu, sin4mu, sin6mu, sin8mu;
+  double sin_lat;
+  long Error_Code = SINU_NO_ERROR;
+
+//   if ((Easting < (Sinu_False_Easting + Sinu_Min_Easting))
+//       || (Easting > (Sinu_False_Easting + Sinu_Max_Easting)))
+//   { /* Easting out of range */
+//     Error_Code |= SINU_EASTING_ERROR;
+//   }
+//   if ((Northing < (Sinu_False_Northing - Sinu_Delta_Northing))
+//       || (Northing > (Sinu_False_Northing + Sinu_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= SINU_NORTHING_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    dy = Northing - Sinu_False_Northing;
+    dx = Easting - Sinu_False_Easting;
+
+    mu = dy / (Sinu_a * c0);
+    sin2mu = SINU_COEFF_TIMES_SIN(a0, 2.0, mu);
+    sin4mu = SINU_COEFF_TIMES_SIN(a1, 4.0, mu);
+    sin6mu = SINU_COEFF_TIMES_SIN(a2, 6.0, mu);
+    sin8mu = SINU_COEFF_TIMES_SIN(a3, 8.0, mu);
+    *Latitude = mu + sin2mu + sin4mu + sin6mu + sin8mu;
+
+    if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+      *Latitude = PI_OVER_2;
+    else if (*Latitude < -PI_OVER_2)
+      *Latitude = -PI_OVER_2;
+
+    if (FLOAT_EQ(fabs(*Latitude),PI_OVER_2,1.0e-8))
+      *Longitude = Sinu_Origin_Long;
+    else
+    {
+      sin_lat = sin(*Latitude);
+      *Longitude = Sinu_Origin_Long + dx * sqrt(1.0 - es2 *
+                                                sin_lat * sin_lat) / (Sinu_a * cos(*Latitude));
+
+
+//       if (*Longitude > M_PI)
+//         *Longitude -= TWO_PI;
+//       if (*Longitude < -M_PI)
+//         *Longitude += TWO_PI;
+
+//       if (*Longitude > M_PI)  /* force distorted values to 180, -180 degrees */
+//         *Longitude = M_PI;
+//       else if (*Longitude < -M_PI)
+//         *Longitude = -M_PI;
+    }
+  }
+  return (Error_Code);
+} /* END OF Convert_Sinusoidal_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimSinusoidalProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimSinusoidalProjection* p = dynamic_cast<const ossimSinusoidalProjection*>(&proj);
+   if (!p) return false;
+
+   if (!ossim::almostEqual(Sinu_Origin_Long,p->Sinu_Origin_Long)) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimSkyBoxLearSensor.cpp b/src/projection/ossimSkyBoxLearSensor.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimSkyBoxLearSensor.cpp
rename to src/projection/ossimSkyBoxLearSensor.cpp
diff --git a/ossim/src/ossim/projection/ossimSmacCallibrationSystem.cpp b/src/projection/ossimSmacCallibrationSystem.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimSmacCallibrationSystem.cpp
rename to src/projection/ossimSmacCallibrationSystem.cpp
diff --git a/ossim/src/ossim/projection/ossimSonomaSensor.cpp b/src/projection/ossimSonomaSensor.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimSonomaSensor.cpp
rename to src/projection/ossimSonomaSensor.cpp
diff --git a/src/projection/ossimSpaceObliqueMercatorProjection.cpp b/src/projection/ossimSpaceObliqueMercatorProjection.cpp
new file mode 100644
index 0000000..3ca7fde
--- /dev/null
+++ b/src/projection/ossimSpaceObliqueMercatorProjection.cpp
@@ -0,0 +1,413 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimSpaceObliqueMercatorProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+#include <ossim/projection/ossimSpaceObliqueMercatorProjection.h>
+#include <math.h>
+#include <ossim/base/ossimConstants.h>
+
+#define PI_OVER_2 (M_PI/2)
+#define PI (M_PI)
+#define TWOPI (2*M_PI)
+#define HALFPI (M_PI/2.0)
+#define TOL 1e-7
+#define PI_HALFPI 4.71238898038468985766
+#define TWOPI_HALFPI 7.85398163397448309610
+#define ONE_TOL	 1.00000000000001
+#define ATOL 1e-50
+#define FORTPI		0.78539816339744833
+
+double aasin(double v)
+{
+   double av;
+
+   if ((av = fabs(v)) >= 1.)
+   {
+      return (v < 0. ? -HALFPI : HALFPI);
+   }
+   return asin(v);
+}
+double aacos(double v)
+{
+	double av;
+
+	if ((av = fabs(v)) >= 1.)
+        {
+           return (v < 0. ? PI : 0.);
+	}
+	return acos(v);
+}
+double asqrt(double v)
+{
+   return ((v <= 0) ? 0. : sqrt(v));
+}
+double aatan2(double n, double d)
+{
+   return ((fabs(n) < ATOL && fabs(d) < ATOL) ? 0. : atan2(n,d));
+}
+
+static const char* PATH_KW                     = "path";
+static const char* SATELLITE_TYPE_KW           = "satellite_type";
+
+#if 0
+static const char* ANGLE_OF_INCLINATION_KW     = "angle_of_inclination";
+static const char* REVOLUTION_TIME_KW          = "earth_rev_time";
+static const char* EARTH_ROTATION_LENGTH_KW    = "earth_rot_length";
+static const char* LONGITUDE_ASCENDING_NODE_KW = "lon_ascending_node";
+static const char* J_COEFFICIENT_KW  = "j_coeff";
+static const char* W_COEFFICIENT_KW  = "w_coeff";
+static const char* Q_COEFFICIENT_KW  = "q_coeff";
+static const char* T_COEFFICIENT_KW  = "t_coeff";
+static const char* A2_COEFFICIENT_KW = "a2_coeff";
+static const char* A4_COEFFICIENT_KW = "a4_coeff";
+static const char* B_COEFFICIENT_KW  = "b_coeff";
+static const char* C1_COEFFICIENT_KW = "c1_coeff";
+static const char* C3_COEFFICIENT_KW = "c3_coeff";
+static const char* ECCENTRICITY_KW   = "eccentricity";
+#endif
+
+RTTI_DEF1(ossimSpaceObliqueMercatorProjection, "ossimSpaceObliqueMercatorProjection", ossimMapProjection);
+
+
+//*****************************************************************************
+//  CONSTRUCTOR
+//*****************************************************************************
+ossimSpaceObliqueMercatorProjection::ossimSpaceObliqueMercatorProjection
+   (ossimSatelliteType type,
+    double pathNumber,
+    const ossimEllipsoid& ellipsoid)
+      :
+      ossimMapProjection(ellipsoid)
+{
+   setParameters(type, pathNumber);
+}
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+void ossimSpaceObliqueMercatorProjection::setParameters(ossimSatelliteType type,
+                                                        double path)
+{
+   thePath = path;
+   theSatelliteType = type;
+   double lam = 0.0;
+   double alf = 0.0;
+   double esc = 0.0;
+   double ess = 0.0;
+   
+   e  = theEllipsoid.eccentricity();
+   es = e*e;
+   one_es = 1- es;
+   rone_es = 1.0/one_es;
+   a   = theEllipsoid.a();
+   
+   switch(theSatelliteType)
+   {
+   case SOM_TYPE_LANDSAT_1:
+   case SOM_TYPE_LANDSAT_2:
+   case SOM_TYPE_LANDSAT_3:
+   {
+      lam0 = RAD_PER_DEG*(128.87 - (360.0/251.0)*path);
+      p22 = 103.2669323;
+      alf = RAD_PER_DEG * 99.092;
+      break;
+   }
+   case SOM_TYPE_LANDSAT_4:
+   case SOM_TYPE_LANDSAT_5:
+   case SOM_TYPE_LANDSAT_7:
+   {
+      
+      lam0 = RAD_PER_DEG*(129.305582487 - (360.0/233.0)*path);
+      p22 = 98.8841202;
+      alf = RAD_PER_DEG * 98.2;
+      break;
+   }
+   }
+   p22 /= 1440.;
+   sa = sin(alf);
+   ca = cos(alf);
+   if (fabs(ca) < 1e-9)
+      ca = 1e-9;
+   esc = es * ca * ca;
+   ess = es * sa * sa;
+   w = (1. - esc) * rone_es;
+   w = w * w - 1.;
+   q = ess * rone_es;
+   t = ess * (2. - es) * rone_es * rone_es;
+   u = esc * rone_es;
+   xj = one_es * one_es * one_es;
+   rlm = PI * (1. / 248. + .5161290322580645);
+   rlm2 = rlm + TWOPI;
+   a2 = a4 = b = c1 = c3 = 0.;
+   seraz0(0.0, 1.0);
+   for (lam = 9.; lam <= 81.0001; lam += 18.)
+      seraz0(lam, 4.0);
+   for (lam = 18; lam <= 72.0001; lam += 18.)
+      seraz0(lam, 2.0);
+   seraz0(90.0, 1.0);
+   a2 /= 30.0;
+   a4 /= 60.0;
+   b /= 30.0;
+   c1 /= 15.0;
+   c3 /= 45.0;
+
+   update();
+}
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+void ossimSpaceObliqueMercatorProjection::seraz0(double lam,
+                                                 double mult)
+{
+    double sdsq, h, s, fc, sd, sq, d__1;
+
+    lam *= RAD_PER_DEG;
+    sd = sin(lam);
+    sdsq = sd * sd;
+    s = p22 * sa * cos(lam) * sqrt((1. + t * sdsq) / ((
+	    1. + w * sdsq) * (1. + q * sdsq)));
+    d__1 = 1. + q * sdsq;
+    h = sqrt((1. + q * sdsq) / (1. + w * sdsq)) * ((1. + 
+	    w * sdsq) / (d__1 * d__1) - p22 * ca);
+    sq = sqrt(xj * xj + s * s);
+    b += fc = mult * (h * xj - s * s) / sq;
+    a2 += fc * cos(lam + lam);
+    a4 += fc * cos(lam * 4.);
+    fc = mult * s * (h + xj) / sq;
+    c1 += fc * cos(lam);
+    c3 += fc * cos(lam * 3.);
+   
+}
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+ossimDpt
+ossimSpaceObliqueMercatorProjection::forward(const ossimGpt &worldPoint) const
+{
+   ossimGpt gpt = worldPoint;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != worldPoint.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   ossimDpt xy;
+   
+   int l, nn;
+   double lamt, xlam, sdsq, c, d, s, lamdp, phidp, lampp, tanph,
+      lamtp, cl, sd, sp, fac, sav, tanphi;
+   double phi = gpt.latr();
+   double lam = gpt.lonr() - lam0;
+   
+   if (phi > HALFPI)
+      phi = HALFPI;
+   else if (phi < -HALFPI)
+      phi = -HALFPI;
+   lampp = phi >= 0. ? HALFPI : PI_HALFPI;
+   tanphi = tan(phi);
+   for (nn = 0;;)
+   {
+      sav = lampp;
+      lamtp = lam + p22 * lampp;
+      cl = cos(lamtp);
+      if (fabs(cl) < TOL)
+         lamtp -= TOL;
+      fac = lampp - sin(lampp) * (cl < 0. ? -HALFPI : HALFPI);
+      for (l = 50; l; --l) {
+         lamt = lam + p22 * sav;
+         if (fabs(c = cos(lamt)) < TOL)
+            lamt -= TOL;
+         xlam = (one_es * tanphi * sa + sin(lamt) * ca) / c;
+         lamdp = atan(xlam) + fac;
+         if (fabs(fabs(sav) - fabs(lamdp)) < TOL)
+            break;
+         sav = lamdp;
+      }
+      if (!l || ++nn >= 3 || (lamdp > rlm && lamdp < rlm2))
+         break;
+      if (lamdp <= rlm)
+         lampp = TWOPI_HALFPI;
+      else if (lamdp >= rlm2)
+         lampp = HALFPI;
+   }
+   if (l) {
+      sp = sin(phi);
+      phidp = aasin((one_es * ca * sp - sa * cos(phi) * 
+                     sin(lamt)) / sqrt(1. - es * sp * sp));
+      tanph = log(tan(FORTPI + .5 * phidp));
+      sd = sin(lamdp);
+      sdsq = sd * sd;
+      s = p22 * sa * cos(lamdp) * sqrt((1. + t * sdsq)
+                                       / ((1. + w * sdsq) * (1. + q * sdsq)));
+      d = sqrt(xj * xj + s * s);
+      xy.x = b * lamdp + a2 * sin(2. * lamdp) + a4 *
+             sin(lamdp * 4.) - tanph * s / d;
+      xy.y = c1 * sd + c3 * sin(lamdp * 3.) + tanph * xj / d;
+   }
+   else
+   {
+      xy.makeNan();
+      return xy;
+//       xy.x = xy.y = 1.0/DBL_EPSILON; // st to large number
+   }
+
+   xy.x*=a;
+   xy.y*=a;
+   return xy;
+}
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+ossimGpt
+ossimSpaceObliqueMercatorProjection::inverse(const ossimDpt &projectedPoint)
+   const
+{
+   int nn;
+   double lamt, sdsq, s, lamdp, phidp, sppsq, dd, sd, sl, fac, scl, sav, spp;
+   double lam, phi;
+   
+   ossimDpt xy = projectedPoint;
+   xy.x/=a;
+   xy.y/=a;
+   
+   lamdp = xy.x / b;
+   nn = 50;
+   do {
+      sav = lamdp;
+      sd = sin(lamdp);
+      sdsq = sd * sd;
+      s = p22 * sa * cos(lamdp) * sqrt((1. + t * sdsq)
+                                       / ((1. + w * sdsq) * (1. + q * sdsq)));
+      lamdp = xy.x + xy.y * s / xj - a2 * sin(
+         2. * lamdp) - a4 * sin(lamdp * 4.) - s / xj * (
+            c1 * sin(lamdp) + c3 * sin(lamdp * 3.));
+      lamdp /= b;
+   } while (fabs(lamdp - sav) >= TOL && --nn);
+   sl = sin(lamdp);
+   fac = exp(sqrt(1. + s * s / xj / xj) * (xy.y - 
+                                           c1 * sl - c3 * sin(lamdp * 3.)));
+   phidp = 2. * (atan(fac) - FORTPI);
+   dd = sl * sl;
+   if (fabs(cos(lamdp)) < TOL)
+      lamdp -= TOL;
+   spp = sin(phidp);
+   sppsq = spp * spp;
+   lamt = atan(((1. - sppsq * rone_es) * tan(lamdp) * ca -
+                spp * sa * sqrt((1. + q * dd) * (1. - sppsq) - sppsq * u) /
+                cos(lamdp)) / (1. - sppsq * (1. + u)));
+   sl = lamt >= 0. ? 1. : -1.;
+   scl = cos(lamdp) >= 0. ? 1. : -1;
+   lamt -= HALFPI * (1. - scl) * sl;
+   
+   lam = lamt - p22 * lamdp;
+   if (fabs(sa) < TOL)
+      phi = aasin(spp / sqrt(one_es * one_es + es * sppsq));
+   else
+      phi = atan((tan(lamdp) * cos(lamt) - ca * sin(lamt)) /
+                    (one_es * sa));
+   return ossimGpt(phi*DEG_PER_RAD,
+                   (lam+lam0)*DEG_PER_RAD, 0.0, theDatum);
+   
+}                        
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+void ossimSpaceObliqueMercatorProjection::update()
+{
+//   theMetersPerPixel.x    = 1.0;
+//   theMetersPerPixel.y    = 1.0;
+   
+//   theUlEastingNorthing.x = 0.0;
+//   theUlEastingNorthing.y = 0.0;
+}
+
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+bool ossimSpaceObliqueMercatorProjection::saveState(ossimKeywordlist& kwl,
+                                                    const char* prefix) const
+{
+   kwl.add(prefix,
+           PATH_KW,
+           thePath,
+           true);
+   
+   kwl.add(prefix,
+           SATELLITE_TYPE_KW,
+           (int)theSatelliteType,
+           true);
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+//*****************************************************************************
+//  METHOD
+//*****************************************************************************
+bool ossimSpaceObliqueMercatorProjection::loadState(const ossimKeywordlist& kwl,
+                                                    const char* prefix)
+{
+   bool result = true;
+
+   const char* path = kwl.find(prefix, PATH_KW);
+   const char* type = kwl.find(prefix,  SATELLITE_TYPE_KW);
+
+   if(path)
+   {
+      thePath = ossimString(path).toDouble();
+   }
+   else
+   {
+      result = false;
+   }
+   if(type)
+   {
+      theSatelliteType = (ossimSatelliteType)ossimString(type).toInt();
+   }
+   else
+   {
+      result = false;
+   }
+
+   setParameters(theSatelliteType, thePath);
+
+   if(result)
+   {
+      result = ossimMapProjection::loadState(kwl, prefix);
+   }
+   else
+   {
+      ossimMapProjection::loadState(kwl, prefix);
+   }
+
+   return result;
+}
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimSpaceObliqueMercatorProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimSpaceObliqueMercatorProjection* p =
+      dynamic_cast<const ossimSpaceObliqueMercatorProjection*>(&proj);
+   if (!p) return false;
+
+   if (theSatelliteType != p->theSatelliteType) return false;
+   if (!ossim::almostEqual(thePath,p->thePath)) return false;
+
+   return true;
+}
diff --git a/src/projection/ossimSpectraboticsRedEdgeModel.cpp b/src/projection/ossimSpectraboticsRedEdgeModel.cpp
new file mode 100644
index 0000000..2c77aaa
--- /dev/null
+++ b/src/projection/ossimSpectraboticsRedEdgeModel.cpp
@@ -0,0 +1,788 @@
+#include <ossim/projection/ossimSpectraboticsRedEdgeModel.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimLsrSpace.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/support_data/ossimApplanixEOFile.h>
+#include <ossim/base/ossimMatrix4x4.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/base/ossimDms.h>
+
+
+#include <sstream>
+
+
+static ossimTrace traceDebug("ossimSpectraboticsRedEdgeModel:debug");
+
+RTTI_DEF1(ossimSpectraboticsRedEdgeModel, "ossimSpectraboticsRedEdgeModel", ossimSensorModel);
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimSpectraboticsRedEdgeModel.cpp 23562 2015-10-02 13:12:40Z gpotts $";
+#endif
+
+ossimSpectraboticsRedEdgeModel::ossimSpectraboticsRedEdgeModel()
+{
+   m_compositeMatrix          = ossimMatrix4x4::createIdentity();
+   m_compositeMatrixInverse   = ossimMatrix4x4::createIdentity();
+   m_roll                     = 0.0;
+   m_pitch                    = 0.0;
+   m_heading                  = 0.0;
+   m_focalLength              = 5.5;
+   m_pixelSize = ossimDpt(0.003, 0.003);
+   m_ecefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
+   m_adjEcefPlatformPosition = ossimGpt(0.0,0.0, 1000.0);
+   theGSD.x   = 0.076;
+   theGSD.y   = 0.076;
+   theMeanGSD = 0.076;
+   m_fov = 48.8; // degrees
+   m_lensDistortion = new ossimTangentialRadialLensDistortion();
+   initAdjustableParameters();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSpectraboticsRedEdgeModel::ossimSpectrabotics DEBUG:" << endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
+#endif
+   }
+}
+ossimSpectraboticsRedEdgeModel::ossimSpectraboticsRedEdgeModel(const ossimDrect& imageRect,
+                                               const ossimGpt& platformPosition,
+                                               double roll,
+                                               double pitch,
+                                               double heading,
+                                               const ossimDpt& /* principalPoint */, // in millimeters
+                                               double focalLength, // in millimeters
+                                               const ossimDpt& pixelSize) // in millimeters
+{
+   theImageClipRect = imageRect;
+   theRefImgPt      = theImageClipRect.midPoint();
+   m_compositeMatrix          = ossimMatrix4x4::createIdentity();
+   m_compositeMatrixInverse   = ossimMatrix4x4::createIdentity();
+   m_roll                     = roll;
+   m_pitch                    = pitch;
+   m_heading                  = heading;
+   m_focalLength              = focalLength;
+   m_pixelSize                = pixelSize;
+   m_ecefPlatformPosition     = platformPosition;
+   m_adjEcefPlatformPosition  = platformPosition;
+   m_lensDistortion           = new ossimTangentialRadialLensDistortion();
+   initAdjustableParameters();
+   updateModel();
+
+   try
+   {
+      // Method throws ossimException.
+     // computeGsd();
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimSpectrabotics Constructor caught Exception:\n"
+         << e.what() << std::endl;
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << "ossimSpectraboticsRedEdgeModel::ossimSpectrabotics DEBUG:" << endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "OSSIM_ID:  " << OSSIM_ID << endl;
+#endif
+   }
+}
+
+ossimSpectraboticsRedEdgeModel::ossimSpectraboticsRedEdgeModel(const ossimSpectraboticsRedEdgeModel& src)
+   :ossimSensorModel(src)
+{
+   initAdjustableParameters();
+   
+   if(src.m_lensDistortion.valid())
+   {
+      m_lensDistortion = new ossimTangentialRadialLensDistortion(*(src.m_lensDistortion.get()));
+   }
+   else
+   {
+      m_lensDistortion = new ossimTangentialRadialLensDistortion();
+   }
+}
+
+ossimObject* ossimSpectraboticsRedEdgeModel::dup()const
+{
+   return new ossimSpectraboticsRedEdgeModel(*this);
+}
+
+void ossimSpectraboticsRedEdgeModel::imagingRay(const ossimDpt& image_point,
+                                    ossimEcefRay&   image_ray) const
+{
+    if(traceDebug())
+    {
+       ossimNotify(ossimNotifyLevel_DEBUG) << "ossimSpectraboticsRedEdgeModel::imagingRay: ..... entered" << std::endl;
+    }
+    ossimDpt film (image_point.x-m_calibratedCenter.x,
+                   m_calibratedCenter.y - image_point.y); //- theRefImgPt);
+//    ossimDpt film (image_point-m_calibratedCenter); //- theRefImgPt);
+    if(m_lensDistortion.valid())
+    {
+      ossimDpt tempFilm(film.x/m_norm, film.y/m_norm);
+      ossimDpt filmOut;
+      m_lensDistortion->undistort(tempFilm, filmOut);
+      film.x = filmOut.x*m_norm;
+      film.y = filmOut.y*m_norm;
+    }
+    film.x *= m_pixelSize.x; // pixel size on the film
+    film.y *= m_pixelSize.y; // pixel size on the film
+    ossimColumnVector3d cam_ray_dir (film.x,
+                                     film.y,
+                                     -m_focalLength);
+    ossimEcefVector     ecf_ray_dir (m_compositeMatrix*cam_ray_dir);
+    ecf_ray_dir = ecf_ray_dir*(1.0/ecf_ray_dir.magnitude());
+
+    image_ray.setOrigin(m_adjEcefPlatformPosition);
+    image_ray.setDirection(ecf_ray_dir);
+}
+
+void ossimSpectraboticsRedEdgeModel::lineSampleToWorld(const ossimDpt& image_point,
+                                               ossimGpt&       gpt) const
+{
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSpectraboticsRedEdgeModel::lineSampleToWorld:entering..." << std::endl;
+   
+   if(image_point.hasNans())
+   {
+      gpt.makeNan();
+      return;
+   }
+   //***
+   // Extrapolate if image point is outside image:
+   //***
+//   if (!insideImage(image_point))
+//   {
+//      gpt.makeNan();
+//       gpt = extrapolate(image_point);
+//      return;
+//   }
+
+   //***
+   // Determine imaging ray and invoke elevation source object's services to
+   // intersect ray with terrain model:
+   //***
+   ossimEcefRay ray;
+   imagingRay(image_point, ray);
+   ossimElevManager::instance()->intersectRay(ray, gpt);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "image_point = " << image_point << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ray = " << ray << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "gpt = " << gpt << std::endl;
+   }
+
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimSensorModel::lineSampleToWorld: returning..." << std::endl;
+   return;
+}
+
+void ossimSpectraboticsRedEdgeModel::lineSampleHeightToWorld(const ossimDpt& image_point,
+                                                 const double&   heightEllipsoid,
+                                                 ossimGpt&       worldPoint) const
+{
+//  if (!insideImage(image_point))
+//   {
+//      worldPoint.makeNan();
+//       worldPoint = extrapolate(image_point, heightEllipsoid);
+//   }
+//   else
+   {
+      //***
+      // First establish imaging ray from image point:
+      //***
+      ossimEcefRay ray;
+      imagingRay(image_point, ray);
+      ossimEcefPoint Pecf (ray.intersectAboveEarthEllipsoid(heightEllipsoid));
+      worldPoint = ossimGpt(Pecf);
+   }
+}
+
+void ossimSpectraboticsRedEdgeModel::worldToLineSample(const ossimGpt& world_point,
+                                           ossimDpt&       image_point) const
+{
+   #if 0
+   if((theBoundGndPolygon.getNumberOfVertices() > 0)&&
+      (!theBoundGndPolygon.hasNans()))
+   {
+      if (!(theBoundGndPolygon.pointWithin(world_point)))
+      {
+//         image_point.makeNan();
+//          image_point = extrapolate(world_point);
+//         return;
+      }         
+   }
+   #endif
+   ossimEcefPoint g_ecf(world_point);
+   ossimEcefVector ecfRayDir(g_ecf - m_adjEcefPlatformPosition);
+   ossimColumnVector3d camRayDir (m_compositeMatrixInverse*ecfRayDir.data());
+   
+      
+    double scale = -m_focalLength/camRayDir[2];
+    ossimDpt film (scale*camRayDir[0], scale*camRayDir[1]);
+    film.x /= m_pixelSize.x; // get into pixel coordinates
+    film.y /= m_pixelSize.y;
+
+
+    // now distort to find the true image coordinate location
+    if (m_lensDistortion.valid())
+    {
+      ossimDpt filmOut;
+      film.x /= m_norm; // normalize radial
+      film.y /= m_norm;
+       m_lensDistortion->distort(film, filmOut);
+      film = filmOut;//+m_lensDistortion->getCenter();
+      film.x *= m_norm;
+      film.y *= m_norm; 
+    }
+
+    // invert Y to get back to left handed image space
+    ossimDpt f1(film.x+m_calibratedCenter.x, m_calibratedCenter.y-film.y);
+    
+    image_point = f1;
+}
+
+void ossimSpectraboticsRedEdgeModel::updateModel()
+{
+   ossimGpt gpt;
+   ossimGpt wgs84Pt;
+   double metersPerDegree = wgs84Pt.metersPerDegree().x;
+   double degreePerMeter = 1.0/metersPerDegree;
+   double latShift = computeParameterOffset(1)*theMeanGSD*degreePerMeter;
+   double lonShift = computeParameterOffset(0)*theMeanGSD*degreePerMeter;
+
+   gpt = m_ecefPlatformPosition;
+   double height = gpt.height();
+   gpt.height(height + computeParameterOffset(5));
+   gpt.latd(gpt.latd() + latShift);
+   gpt.lond(gpt.lond() + lonShift);
+   m_adjEcefPlatformPosition = gpt;
+   ossimLsrSpace lsrSpace(m_adjEcefPlatformPosition);
+
+   NEWMAT::Matrix heading = ossimMatrix4x4::createRotationZMatrix(m_heading+computeParameterOffset(4), OSSIM_RIGHT_HANDED);
+   NEWMAT::Matrix roll = ossimMatrix4x4::createRotationYMatrix(m_roll+computeParameterOffset(2), OSSIM_RIGHT_HANDED);
+   NEWMAT::Matrix pitch = ossimMatrix4x4::createRotationXMatrix(m_pitch+computeParameterOffset(3), OSSIM_LEFT_HANDED);
+   ossimMatrix4x4 lsrMatrix(lsrSpace.lsrToEcefRotMatrix());
+   NEWMAT::Matrix orientation = heading*pitch*roll;//roll*pitch*heading;
+   m_compositeMatrix        = (lsrMatrix.getData()*orientation);
+   m_compositeMatrixInverse = m_compositeMatrix.i();
+
+   theBoundGndPolygon.resize(4);
+   // ossim_float64 w = theImageClipRect.width()*2.0;
+   // ossim_float64 h = theImageClipRect.height()*2.0;
+   theExtrapolateImageFlag = false;
+   theExtrapolateGroundFlag = false;
+
+
+   lineSampleToWorld(theImageClipRect.ul(),gpt);//+ossimDpt(-w, -h), gpt);
+   theBoundGndPolygon[0] = gpt;
+   lineSampleToWorld(theImageClipRect.ur(),gpt);//+ossimDpt(w, -h), gpt);
+   theBoundGndPolygon[1] = gpt;
+   lineSampleToWorld(theImageClipRect.lr(),gpt);//+ossimDpt(w, h), gpt);
+   theBoundGndPolygon[2] = gpt;
+   lineSampleToWorld(theImageClipRect.ll(),gpt);//+ossimDpt(-w, h), gpt);
+   theBoundGndPolygon[3] = gpt;
+}
+
+void ossimSpectraboticsRedEdgeModel::initAdjustableParameters()
+{
+   
+   resizeAdjustableParameterArray(6);
+   
+   setAdjustableParameter(0, 0.0);
+   setParameterDescription(0, "x_offset");
+   setParameterUnit(0, "pixels");
+
+   setAdjustableParameter(1, 0.0);
+   setParameterDescription(1, "y_offset");
+   setParameterUnit(1, "pixels");
+
+   setAdjustableParameter(2, 0.0);
+   setParameterDescription(2, "roll");
+   setParameterUnit(2, "degrees");
+
+   setAdjustableParameter(3, 0.0);
+   setParameterDescription(3, "pitch");
+   setParameterUnit(3, "degrees");
+
+   setAdjustableParameter(4, 0.0);
+   setParameterDescription(4, "heading");
+   setParameterUnit(4, "degrees");
+
+   setAdjustableParameter(5, 0.0);
+   setParameterDescription(5, "altitude");
+   setParameterUnit(5, "meters");
+   
+   
+   setParameterSigma(0, 50.0);
+   setParameterSigma(1, 50.0);
+   setParameterSigma(2, 1);
+   setParameterSigma(3, 1);
+   setParameterSigma(4, 10);
+   setParameterSigma(5, 50);
+}
+
+void ossimSpectraboticsRedEdgeModel::setPrincipalPoint(ossimDpt principalPoint)
+{
+   m_principalPoint = principalPoint;
+}
+
+void ossimSpectraboticsRedEdgeModel::setRollPitchHeading(double roll,
+                                                 double pitch,
+                                                 double heading)
+{
+   m_roll    = roll;
+   m_pitch   = pitch;
+   m_heading = heading;
+   
+   updateModel();
+}
+
+void ossimSpectraboticsRedEdgeModel::setPixelSize(const ossimDpt& pixelSize)
+{
+   m_pixelSize = pixelSize;
+}
+
+void ossimSpectraboticsRedEdgeModel::setImageRect(const ossimDrect& rect)
+{
+   theImageClipRect = rect;
+   theRefImgPt = rect.midPoint();
+}
+
+void ossimSpectraboticsRedEdgeModel::setFocalLength(double focalLength)
+{
+   m_focalLength = focalLength;
+}
+
+void ossimSpectraboticsRedEdgeModel::setPlatformPosition(const ossimGpt& gpt)
+{
+   theRefGndPt            = gpt;
+   m_ecefPlatformPosition = gpt;
+   updateModel();
+   
+}
+
+bool ossimSpectraboticsRedEdgeModel::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix) const
+{
+   ossimSensorModel::saveState(kwl, prefix);
+   
+   kwl.add(prefix, "type", "ossimSpectraboticsRedEdgeModel", true);
+
+   kwl.add(prefix, "roll", m_roll, true);
+   kwl.add(prefix, "pitch", m_pitch, true);
+   kwl.add(prefix, "heading", m_heading, true);
+   kwl.add(prefix, "principal_point", ossimString::toString(m_principalPoint.x) + " " + ossimString::toString(m_principalPoint.y));
+   kwl.add(prefix, "pixel_size",      ossimString::toString(m_pixelSize.x) + " " + ossimString::toString(m_pixelSize.y));
+   kwl.add(prefix, "focal_length", m_focalLength);
+   kwl.add(prefix, "field_of_view", m_fov);
+   kwl.add(prefix, "cx", m_calibratedCenter.x);
+   kwl.add(prefix, "cy", m_calibratedCenter.y);
+   kwl.add(prefix, "fx", m_focalX);
+   kwl.add(prefix, "fy", m_focalY);
+   kwl.add(prefix, "ecef_platform_position",
+           ossimString::toString(m_ecefPlatformPosition.x()) + " " +
+           ossimString::toString(m_ecefPlatformPosition.y()) + " " +
+           ossimString::toString(m_ecefPlatformPosition.z()));
+
+   if(m_lensDistortion.valid())
+   {
+      m_lensDistortion->saveState(kwl,
+                                   prefix);
+   }
+   
+   return true;
+}
+
+bool ossimSpectraboticsRedEdgeModel::loadState(const ossimKeywordlist& kwl,
+                                       const char* prefix)
+{
+   if(traceDebug())
+   {
+      std::cout << "ossimSpectraboticsRedEdgeModel::loadState: ......... entered" << std::endl;
+   }
+   //ossimSensorModel::loadState(kwl,prefix);
+
+   ossimSensorModel::loadState(kwl, prefix);
+   if(getNumberOfAdjustableParameters() < 1)
+   {
+
+      initAdjustableParameters();
+   }
+   m_ecefPlatformPosition    = ossimGpt(0.0,0.0,1000.0);
+   m_adjEcefPlatformPosition = ossimGpt(0.0,0.0,1000.0);
+   m_roll    = 0.0;
+   m_pitch   = 0.0;
+   m_heading = 0.0;
+
+
+   // bool computeGsdFlag = false;
+   const char* roll              = kwl.find(prefix, "Roll");
+   const char* pitch             = kwl.find(prefix, "Pitch");
+   const char* heading           = kwl.find(prefix, "Yaw");
+   const char* focalLength       = kwl.find(prefix, "Focal Length");
+   const char* imageWidth        = kwl.find(prefix, "Image Width");
+   const char* imageHeight       = kwl.find(prefix, "Image Height");
+   const char* fov               = kwl.find(prefix, "Field Of View");
+   const char* gpsPos            = kwl.find(prefix, "GPS Position");
+   const char* gpsAlt            = kwl.find(prefix, "GPS Altitude");
+   const char* imageCenter       = kwl.find(prefix, "Image Center");
+   const char* fx                = kwl.find(prefix, "fx");
+   const char* fy                = kwl.find(prefix, "fy");
+   const char* cx                = kwl.find(prefix, "cx");
+   const char* cy                = kwl.find(prefix, "cy");
+   const char* k                 = kwl.find(prefix, "k");
+   const char* p                 = kwl.find(prefix, "p");
+
+   bool result = true;
+
+#if 0
+   std::cout << "roll: " << roll << "\n";
+   std::cout << "pitch: " << pitch << "\n";
+   std::cout << "heading: " << heading << "\n";
+   std::cout << "focalLength: " << focalLength << "\n";
+   std::cout << "imageWidth: " << imageWidth << "\n";
+   std::cout << "imageHeight: " << imageHeight << "\n";
+  // std::cout << "fov: " << fov << "\n";
+   std::cout << "gpsPos: " << gpsPos << "\n";
+   std::cout << "gpsAlt: " << gpsAlt << "\n";
+   #endif
+   //
+  if(k&&p)
+  {
+    m_lensDistortion = new ossimTangentialRadialLensDistortion();
+    m_lensDistortion->loadState(kwl, prefix);
+  }
+
+   if(roll&&
+      pitch&&
+      heading&&
+      focalLength&&
+      imageWidth&&
+      imageHeight&&
+      gpsPos&&
+      gpsAlt)
+   {
+      theSensorID = "MicaSense RedEdge";
+      m_roll = ossimString(roll).toDouble();
+      m_pitch = ossimString(pitch).toDouble();
+      m_heading = ossimString(heading).toDouble();
+      m_focalLength = ossimString(focalLength).toDouble();
+      m_fov = fov?ossimString(fov).toDouble():48.8;
+      theImageSize.x = ossimString(imageWidth).toDouble();
+      theImageSize.y = ossimString(imageHeight).toDouble();
+
+
+      theImageClipRect = ossimDrect(0,0,theImageSize.x-1,theImageSize.y-1);
+      theRefImgPt      = ossimDpt(theImageSize.x/2.0, theImageSize.y/2.0);
+     
+     m_calibratedCenter = theImageClipRect.midPoint();
+      // now lets use the field of view and the focal length to 
+      // calculate the pixel size on the ccd in millimeters
+      double d = tan((m_fov*0.5)*M_PI/180.0)*m_focalLength;
+      d*=2.0;
+      double tempRadiusPixel = theImageSize.length();
+      m_pixelSize.x = (d)/tempRadiusPixel;
+      m_pixelSize.y = m_pixelSize.x;
+      if(imageCenter)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(imageCenter);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() == 2)
+         {
+            theRefImgPt = ossimDpt(splitString[0].toDouble(), splitString[1].toDouble());
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No Image Center found" << std::endl;
+        //    result = false;
+         }
+      }
+
+      // now extract the GPS position and shift it to the ellipsoidal height.
+      std::vector<ossimString> splitArray;
+
+      ossimString(gpsPos).split(splitArray, ",");
+      splitArray[0] = splitArray[0].replaceAllThatMatch("deg", " ");
+      splitArray[1] = splitArray[1].replaceAllThatMatch("deg", " ");
+
+      ossimDms dmsLat;
+      ossimDms dmsLon;
+      double h = ossimString(gpsAlt).toDouble();
+      dmsLat.setDegrees(splitArray[0]);
+      dmsLon.setDegrees(splitArray[1]);
+      double lat = dmsLat.getDegrees();
+      double lon = dmsLon.getDegrees();
+
+      h = h+ossimGeoidManager::instance()->offsetFromEllipsoid(ossimGpt(lat,lon));
+      m_ecefPlatformPosition = ossimGpt(lat,lon,h);
+      // double height1 = ossimElevManager::instance()->getHeightAboveEllipsoid(ossimGpt(lat, lon));
+     
+//std::cout << "PLATFORM HEIGHT: " << h << "\n" 
+//          << "ELEVATION: " << height1 << "\n";
+     // std::cout << m_ecefPlatformPosition << std::endl;
+     // std::cout << "POINT: " << ossimGpt(lat,lon,h) << std::endl;
+     // std::cout << "MSL:   " << height1 << "\n";
+
+      theRefGndPt = m_ecefPlatformPosition;
+      theRefGndPt.height(0.0);
+
+     m_norm = ossim::nan();
+
+    // lens parameters
+    if(m_lensDistortion.valid()&&cx&&cy&&fx&&fy)
+    {
+      m_focalX = ossimString(fx).toDouble();
+      m_focalY = ossimString(fy).toDouble();
+
+      // our lens distorion assume center point.  So
+      // lets shift to center and then set calibrated relative to 
+      // image center.  We will then normalize.
+      //
+      ossimDpt focal(m_focalX,m_focalY);
+      m_norm = focal.length()*0.5; // convert from diameter to radial
+      m_calibratedCenter = ossimDpt(ossimString(cx).toDouble(), ossimString(cy).toDouble());
+      m_principalPoint = m_calibratedCenter-theImageClipRect.midPoint();
+      m_principalPoint.x /= m_norm;
+      m_principalPoint.y /= m_norm;
+
+      // lets initialize the root to be about one pixel norm along the diagonal
+      // and the convergence will be approximately 100th of a pixel.
+      //
+      double temp = m_norm;
+      if(temp < FLT_EPSILON) temp = 1.0;
+      else temp = 1.0/temp;
+      m_lensDistortion->setCenter(m_principalPoint);
+      m_lensDistortion->setDxDy(ossimDpt(temp,temp));
+      m_lensDistortion->setConvergenceThreshold(temp*0.001);
+    }
+    else
+    {
+      m_lensDistortion = 0;
+      m_calibratedCenter = theImageClipRect.midPoint();
+      m_norm = theImageSize.length()*0.5;
+      m_principalPoint = ossimDpt(0,0);
+    }
+     updateModel();
+   }
+   else // load from regular save state
+   {
+      const char* principal_point   = kwl.find(prefix, "principal_point");
+      const char* pixel_size        = kwl.find(prefix, "pixel_size");
+      const char* ecef_platform_position = kwl.find(prefix, "ecef_platform_position");
+      const char* latlonh_platform_position = kwl.find(prefix, "latlonh_platform_position");
+      // const char* compute_gsd_flag  = kwl.find(prefix, "compute_gsd_flag");
+      roll              = kwl.find(prefix, "roll");
+      pitch             = kwl.find(prefix, "pitch");
+      heading           = kwl.find(prefix, "heading");
+      fov               = kwl.find(prefix, "field_of_view");
+      focalLength       = kwl.find(prefix, "focal_length");
+
+      if(roll)
+      {
+         m_roll = ossimString(roll).toDouble();
+      }
+      if(pitch)
+      {
+         m_pitch = ossimString(pitch).toDouble();
+      }
+      if(heading)
+      {
+         m_heading = ossimString(heading).toDouble();
+      }
+
+      if(cx&&cy)
+      {
+         m_calibratedCenter = ossimDpt(ossimString(cx).toDouble(), ossimString(cy).toDouble());
+      }
+      if(principal_point)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(principal_point);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() == 2)
+         {
+            m_principalPoint.x = splitString[0].toDouble();
+            m_principalPoint.y = splitString[1].toDouble();
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No principal_point found" << std::endl;
+           // result = false;
+         }
+      }
+
+      if(pixel_size)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(pixel_size);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() == 1)
+         {
+            m_pixelSize.x = splitString[0].toDouble();
+            m_pixelSize.y = m_pixelSize.x;
+         }
+         else if(splitString.size() == 2)
+         {
+            m_pixelSize.x = splitString[0].toDouble();
+            m_pixelSize.y = splitString[1].toDouble();
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No pixel size found" << std::endl;
+           // result = false;
+         }
+      }
+      if(ecef_platform_position)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(ecef_platform_position);
+         tempString.split(splitString, ossimString(" "));
+         if(splitString.size() > 2)
+         {
+            m_ecefPlatformPosition  = ossimEcefPoint(splitString[0].toDouble(),
+                                                      splitString[1].toDouble(),
+                                                      splitString[2].toDouble());
+         }
+      }
+      else if(latlonh_platform_position)
+      {
+         std::vector<ossimString> splitString;
+         ossimString tempString(latlonh_platform_position);
+         tempString.split(splitString, ossimString(" "));
+         std::string datumString;
+         double lat=0.0, lon=0.0, h=0.0;
+         if(splitString.size() > 2)
+         {
+            lat = splitString[0].toDouble();
+            lon = splitString[1].toDouble();
+            h = splitString[2].toDouble();
+         }
+         
+         m_ecefPlatformPosition = ossimGpt(lat,lon,h);
+      }
+      if(focalLength)
+      {
+         m_focalLength = ossimString(focalLength).toDouble();
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No focal length found" << std::endl;
+            result = false;
+         }
+      }
+      if(fov)
+      {
+         m_fov = ossimString(fov).toDouble();
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "No field of view found" << std::endl;
+            result = false;
+         }
+      }
+      theRefGndPt = m_ecefPlatformPosition;
+    if(m_lensDistortion.valid()&&cx&&cy&&fx&&fy)
+    {
+      m_focalX = ossimString(fx).toDouble();
+      m_focalY = ossimString(fy).toDouble();
+
+      // our lens distorion assume center point.  So
+      // lets shift to center and then set calibrated relative to 
+      // image center.  We will then normalize.
+      //
+      ossimDpt focal(m_focalX,m_focalY);
+      m_norm = focal.length()*0.5;
+      m_calibratedCenter = ossimDpt(ossimString(cx).toDouble(), ossimString(cy).toDouble());
+     // m_principalPoint = m_calibratedCenter-theImageClipRect.midPoint();
+     // m_principalPoint.x /= m_norm;
+     // m_principalPoint.y /= m_norm;
+
+      // lets initialize the root to be about one pixel norm along the diagonal
+      // and the convergence will be approximately 100th of a pixel.
+      //
+      double temp = m_norm;
+      if(temp < FLT_EPSILON) temp = 1.0;
+      else temp = 1.0/temp;
+      m_lensDistortion->setCenter(m_principalPoint);
+      m_lensDistortion->setDxDy(ossimDpt(temp,temp));
+      m_lensDistortion->setConvergenceThreshold(temp*0.001);
+    }
+    else
+    {
+      m_lensDistortion = 0;
+    }
+      updateModel();
+   }
+    try
+    {
+       //---
+       // This will set theGSD and theMeanGSD. Method throws
+       // ossimException.
+       //---
+       computeGsd();
+    }
+    catch (const ossimException& e)
+    {
+       ossimNotify(ossimNotifyLevel_WARN)
+          << "ossimSpectraboticsRedEdgeModel::loadState Caught Exception:\n"
+          << e.what() << std::endl;
+    }
+   // std::cout << "METERS PER PIXEL :    " << getMetersPerPixel() << std::endl;
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << std::setprecision(15) << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "roll:     " << m_roll << std::endl
+                                          << "pitch:    " << m_pitch << std::endl
+                                          << "heading:  " << m_heading << std::endl
+                                          << "platform: " << m_ecefPlatformPosition << std::endl
+                                          << "latlon Platform: " << ossimGpt(m_ecefPlatformPosition) << std::endl
+                                          << "focal len: " << m_focalLength << std::endl
+                                          << "FOV      : " << m_fov << std::endl
+                                          << "principal: " << m_principalPoint << std::endl
+                                          << "Ground:    " << ossimGpt(m_ecefPlatformPosition) << std::endl;
+   }
+
+   // ossimGpt wpt;
+   // ossimDpt dpt(100,100);
+   // lineSampleToWorld(dpt, wpt);
+   // std::cout << "dpt: " << dpt << "\n"
+   //           << "wpt: " << wpt << "\n";
+   // worldToLineSample(wpt,dpt);
+   // std::cout << "dpt: " << dpt << "\n"
+   //           << "wpt: " << wpt << "\n";
+   return result;
+}
+
+bool ossimSpectraboticsRedEdgeModel::setupOptimizer(const ossimString& init_file)
+{
+   ossimKeywordlist kwl;
+   kwl.addFile(init_file.c_str());
+
+   return loadState(kwl);
+}
diff --git a/ossim/src/ossim/projection/ossimSpot5Model.cpp b/src/projection/ossimSpot5Model.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimSpot5Model.cpp
rename to src/projection/ossimSpot5Model.cpp
diff --git a/ossim/src/ossim/projection/ossimStatePlaneProjectionInfo.cpp b/src/projection/ossimStatePlaneProjectionInfo.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimStatePlaneProjectionInfo.cpp
rename to src/projection/ossimStatePlaneProjectionInfo.cpp
diff --git a/ossim/src/ossim/projection/ossimStereographicProjection.cpp b/src/projection/ossimStereographicProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimStereographicProjection.cpp
rename to src/projection/ossimStereographicProjection.cpp
diff --git a/src/projection/ossimTangentialRadialLensDistortion.cpp b/src/projection/ossimTangentialRadialLensDistortion.cpp
new file mode 100644
index 0000000..a91dad2
--- /dev/null
+++ b/src/projection/ossimTangentialRadialLensDistortion.cpp
@@ -0,0 +1,103 @@
+#include <ossim/projection/ossimTangentialRadialLensDistortion.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+RTTI_DEF1(ossimTangentialRadialLensDistortion, "ossimTangentialRadialLensDistortion",
+          ossimLensDistortion);
+ossimTangentialRadialLensDistortion::ossimTangentialRadialLensDistortion()
+   :ossimLensDistortion()
+{
+  m_k.resize(3);
+  m_p.resize(2);
+  m_k[0] = m_k[1] = m_k[2] = 0.0;
+  m_p[0] = m_p[1];
+}
+ossimTangentialRadialLensDistortion::ossimTangentialRadialLensDistortion(const ossimDpt& calibratedCenter,
+                               double k1, double k2, double k3,
+                               double p1, double p2)
+    :ossimLensDistortion(calibratedCenter)
+ {
+ 
+    m_k.resize(3);
+    m_p.resize(2);
+
+    m_k[0] = k1;
+    m_k[1] = k2;
+    m_k[2] = k3;
+
+    m_p[0] = p1;
+    m_p[1] = p2;
+
+
+}
+ossimTangentialRadialLensDistortion::ossimTangentialRadialLensDistortion(const ossimDpt& calibratedCenter,
+                                     std::vector<double> k,
+                                     std::vector<double> p)
+  :ossimLensDistortion(calibratedCenter),
+  m_k(k),
+  m_p(p)
+{
+}
+
+void ossimTangentialRadialLensDistortion::undistort(const ossimDpt& input, 
+         ossimDpt& output)const
+{
+   // make relative to calibrated center
+   //ossimDpt deltaPosition(input.x - theCenter.x,
+   //                       input.y - theCenter.y);
+
+   double r = sqrt(input.x*input.x + 
+                   input.y*input.y);
+   double r2 = r*r;
+   double rMultiplier = r2;
+   ossim_uint32 idx = 0;
+   // comnpute the radial portion of the equation of the form
+   // 1 + k0*r^2 + k1*r^4 + .......
+   double tempRadial = 1.0;
+   for(idx = 0; idx < m_k.size();++idx)
+   {
+      tempRadial += m_k[idx]*rMultiplier;
+      rMultiplier*=r2;
+   }
+   // now apply the radial to the input point and then 
+   // shift and apply the tangential coefficients along x and y.
+   output.x = (input.x*tempRadial) + 
+              (2.0*m_p[0]*input.x*input.y) + 
+              (m_p[1]*(r2 + 2*input.x*input.x)); 
+
+   output.y = (input.y*tempRadial) + 
+              (2.0*m_p[1]*input.x*input.y) + 
+              (m_p[0]*(r2 + 2*input.y*input.y));
+
+//   output.x += theCenter.x;
+//   output.y += theCenter.y;
+}
+bool ossimTangentialRadialLensDistortion::saveState(ossimKeywordlist& kwl,
+                      const char* prefix )const
+{
+   bool result = ossimLensDistortion::saveState(kwl, prefix);
+   ossimString kValues;
+   ossimString pValues;
+   ossim::toSimpleStringList(kValues, m_k);
+   ossim::toSimpleStringList(pValues, m_p);
+
+   kwl.add(prefix, "k", kValues);
+   kwl.add(prefix, "p", pValues);
+
+   return result;
+}
+
+bool ossimTangentialRadialLensDistortion::loadState(const ossimKeywordlist& kwl,
+                      const char* prefix)
+{
+   bool result = ossimLensDistortion::loadState(kwl, prefix);
+   ossimString k = kwl.find(prefix, "k");
+   ossimString p = kwl.find(prefix, "p");
+
+   m_k.clear();
+   m_p.clear();
+   ossim::toSimpleVector(m_k, k);
+   ossim::toSimpleVector(m_p, p);
+
+   return result;
+}
diff --git a/ossim/src/ossim/projection/ossimTiffProjectionFactory.cpp b/src/projection/ossimTiffProjectionFactory.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimTiffProjectionFactory.cpp
rename to src/projection/ossimTiffProjectionFactory.cpp
diff --git a/ossim/src/ossim/projection/ossimTranmerc.c b/src/projection/ossimTranmerc.c
similarity index 100%
rename from ossim/src/ossim/projection/ossimTranmerc.c
rename to src/projection/ossimTranmerc.c
diff --git a/src/projection/ossimTransCylEquAreaProjection.cpp b/src/projection/ossimTransCylEquAreaProjection.cpp
new file mode 100644
index 0000000..028fdaa
--- /dev/null
+++ b/src/projection/ossimTransCylEquAreaProjection.cpp
@@ -0,0 +1,598 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Transverse Cylindrical Equal Area
+// projection code.  
+//*******************************************************************
+//  $Id: ossimTransCylEquAreaProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+
+#include <math.h>
+#include <ossim/projection/ossimTransCylEquAreaProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimTransCylEquAreaProjection, "ossimTransCylEquAreaProjection", ossimMapProjection)
+/***************************************************************************/
+/*
+ *                              DEFINES
+ */
+
+#ifndef PI_OVER_2
+#  define PI_OVER_2  ( M_PI / 2.0)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI     (2.0 * M_PI)
+#endif
+
+#define TCEA_Q(sinlat,x)                (One_MINUS_es2*(sinlat/(1.0-es2*sinlat*sinlat)-One_OVER_2es*log((1-x)/(1+x))))
+#define TCEA_COEFF_TIMES_SIN(coeff,x,latit)         (coeff * sin(x*latit))
+#define TCEA_M(c0lat,c1lat,c2lat,c3lat)             (Tcea_a * (c0lat - c1lat + c2lat - c3lat))
+#define TCEA_L(Beta,c0lat,c1lat,c2lat)              (Beta + c0lat + c1lat + c2lat)
+#define MIN_SCALE_FACTOR  0.3
+#define MAX_SCALE_FACTOR  3.0
+
+#define TCEA_NO_ERROR           0x0000
+#define TCEA_LAT_ERROR          0x0001
+#define TCEA_LON_ERROR          0x0002
+#define TCEA_EASTING_ERROR      0x0004
+#define TCEA_NORTHING_ERROR     0x0008
+#define TCEA_ORIGIN_LAT_ERROR   0x0010
+#define TCEA_CENT_MER_ERROR     0x0020
+#define TCEA_A_ERROR            0x0040
+#define TCEA_INV_F_ERROR        0x0080
+#define TCEA_SCALE_FACTOR_ERROR 0x0100
+#define TCEA_LON_WARNING        0x0200
+
+ossimTransCylEquAreaProjection::ossimTransCylEquAreaProjection(const ossimEllipsoid& ellipsoid,
+                                                               const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+
+ossimTransCylEquAreaProjection::ossimTransCylEquAreaProjection(const ossimEllipsoid& ellipsoid,
+                                                               const ossimGpt& origin,
+                                                               double falseEasting,
+                                                               double falseNorthing,
+                                                               double scaleFactor)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   Tcea_False_Easting  = falseEasting;
+   Tcea_False_Northing = falseNorthing;
+   Tcea_Scale_Factor   = scaleFactor;
+   Tcea_Min_Easting  = -6398628.0;
+   Tcea_Max_Easting  = 6398628.0;
+   Tcea_Min_Northing = -20003931.0;
+   Tcea_Max_Northing = 20003931.0;
+
+   update();
+}
+
+void ossimTransCylEquAreaProjection::setFalseEasting(double falseEasting)
+{
+   Tcea_False_Easting = falseEasting;
+   
+   update();
+}
+
+
+void ossimTransCylEquAreaProjection::setFalseNorthing(double falseNorthing)
+{
+   Tcea_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimTransCylEquAreaProjection::setFalseEastingNorthing(double falseEasting,
+                                                      double falseNorthing)
+{
+   Tcea_False_Easting  = falseEasting;
+   Tcea_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimTransCylEquAreaProjection::setScaleFactor(double scaleFactor)
+{
+   Tcea_Scale_Factor = scaleFactor;
+   
+   update();
+}
+
+void ossimTransCylEquAreaProjection::setParameters(double falseEasting,
+                                                   double falseNorthing,
+                                                   double scaleFactor)
+{
+   Tcea_False_Easting  = falseEasting;
+   Tcea_False_Northing = falseNorthing;
+   Tcea_Scale_Factor = scaleFactor;
+   
+   update();
+}
+
+void ossimTransCylEquAreaProjection::setDefaults()
+{
+   Tcea_Scale_Factor   = 1.0;
+   Tcea_False_Easting  = 0.0;
+   Tcea_False_Northing = 0.0;
+   Tcea_Min_Easting    = -6398628.0;
+   Tcea_Max_Easting    = 6398628.0;
+   Tcea_Min_Northing   = -20003931.0;
+   Tcea_Max_Northing   = 20003931.0;
+}
+
+void ossimTransCylEquAreaProjection::update()
+{  
+   Set_Trans_Cyl_Eq_Area_Parameters(theEllipsoid.getA(),
+                                    theEllipsoid.getFlattening(),
+                                    theOrigin.latr(),
+                                    theOrigin.lonr(),
+                                    Tcea_False_Easting,
+                                    Tcea_False_Northing,
+                                    Tcea_Scale_Factor);
+
+   theFalseEastingNorthing.x = Tcea_False_Easting;
+   theFalseEastingNorthing.y = Tcea_False_Northing;
+   
+   ossimMapProjection::update();
+}
+   
+
+ossimGpt ossimTransCylEquAreaProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_Trans_Cyl_Eq_Area_To_Geodetic(eastingNorthing.x,
+                                         eastingNorthing.y,
+                                         &lat,
+                                         &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
+}
+
+ossimDpt ossimTransCylEquAreaProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Trans_Cyl_Eq_Area(gpt.latr(),
+                                         gpt.lonr(),
+                                         &easting,
+                                         &northing);
+   
+   return ossimDpt(easting, northing);
+}
+
+bool ossimTransCylEquAreaProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_FACTOR_KW,
+           Tcea_Scale_Factor,
+           true);
+   
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimTransCylEquAreaProjection::loadState(const ossimKeywordlist& kwl,
+                                               const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   const char* scaleFactor   = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
+   
+   setDefaults();
+
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimTransCylEquAreaProjection))
+   {
+      Tcea_False_Easting  = theFalseEastingNorthing.x;
+      Tcea_False_Northing = theFalseEastingNorthing.y;
+
+      if(scaleFactor)
+      {
+         Tcea_Scale_Factor = ossimString(scaleFactor).toDouble();
+      }
+   }
+   
+   update();
+
+   return flag;
+}
+
+long ossimTransCylEquAreaProjection::Set_Trans_Cyl_Eq_Area_Parameters(double a,
+                                                                      double f,
+                                                                      double Origin_Latitude,
+                                                                      double Central_Meridian,
+                                                                      double False_Easting,
+                                                                      double False_Northing,
+                                                                      double Scale_Factor)
+{ /* BEGIN Set_Trans_Cyl_Eq_Area_Parameters */
+/*
+ * The function Set_Trans_Cyl_Eq_Area_Parameters receives the ellipsoid parameters and
+ * Transverse Cylindrical Equal Area projection parameters as inputs, and sets the 
+ * corresponding state variables.  If any errors occur, the error code(s) are returned 
+ * by the function, otherwise TCEA_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid						        (input)
+ *    Origin_Latitude   : Latitude in radians at which the          (input)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (input)
+ *    Scale_Factor      : Multiplier which reduces distances in the
+ *                          projection to the actual distance on the
+ *                          ellipsoid                               (input)
+ */
+
+  double sin_lat_90 = sin(PI_OVER_2);
+  double x, j, three_es4;
+  double Sqrt_One_MINUS_es2;
+  double e1, e2, e3, e4;
+  double lat, sin2lat, sin4lat, sin6lat;
+  double temp, temp_northing;
+//  double inv_f = 1 / f;
+  long Error_Code = TCEA_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= TCEA_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= TCEA_INV_F_ERROR;
+//   }
+//   if ((Origin_Latitude < -PI_OVER_2) || (Origin_Latitude > PI_OVER_2))
+//   { /* origin latitude out of range */
+//     Error_Code |= TCEA_ORIGIN_LAT_ERROR;
+//   }
+//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= TCEA_CENT_MER_ERROR;
+//   }
+//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
+//   {
+//     Error_Code |= TCEA_SCALE_FACTOR_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+    Tcea_a = a;
+    Tcea_f = f;
+    Tcea_Origin_Lat = Origin_Latitude;
+    if (Central_Meridian > M_PI)
+      Central_Meridian -= TWO_PI;
+    Tcea_Origin_Long = Central_Meridian;
+    Tcea_False_Northing = False_Northing;
+    Tcea_False_Easting = False_Easting;
+    Tcea_Scale_Factor = Scale_Factor;
+
+    es2 = 2 * Tcea_f - Tcea_f * Tcea_f;
+    es = sqrt(es2);
+    One_MINUS_es2 = 1.0 - es2;
+    Sqrt_One_MINUS_es2 = sqrt(One_MINUS_es2);
+    One_OVER_2es = 1.0 / (2.0 * es);
+    es4 = es2 * es2;
+    es6 = es4 * es2;
+    x = es * sin_lat_90;
+    qp = TCEA_Q(sin_lat_90,x);
+
+    a0 = es2 / 3.0 + 31.0 * es4 / 180.0 + 517.0 * es6 / 5040.0;
+    a1 = 23.0 * es4 / 360.0 + 251.0 * es6 / 3780.0;
+    a2 = 761.0 * es6 / 45360.0;
+
+    e1 = (1.0 - Sqrt_One_MINUS_es2) / (1.0 + Sqrt_One_MINUS_es2);
+    e2 = e1 * e1;
+    e3 = e2 * e1;
+    e4 = e3 * e1;
+    b0 = 3.0 * e1 / 2.0 - 27.0 * e3 / 32.0;
+    b1 = 21.0 * e2 / 16.0 - 55.0 * e4 / 32.0;
+    b2 = 151.0 * e3 / 96.0;
+    b3 = 1097.0 * e4 / 512.0;
+
+    j = 45.0 * es6 / 1024.0;
+    three_es4 = 3.0 * es4;
+    c0 = 1.0 - es2 / 4.0 - three_es4 / 64.0 - 5.0 * es6 / 256.0;
+    c1 = 3.0 * es2 / 8.0 + three_es4 / 32.0 + j;
+    c2 = 15.0 * es4 / 256.0 + j;
+    c3 = 35.0 * es6 / 3072.0;
+    lat = c0 * Tcea_Origin_Lat;
+    sin2lat = TCEA_COEFF_TIMES_SIN(c1, 2.0, Tcea_Origin_Lat);
+    sin4lat = TCEA_COEFF_TIMES_SIN(c2, 4.0, Tcea_Origin_Lat);
+    sin6lat = TCEA_COEFF_TIMES_SIN(c3, 6.0, Tcea_Origin_Lat);
+    M0 = TCEA_M(lat, sin2lat, sin4lat, sin6lat);
+    Convert_Geodetic_To_Trans_Cyl_Eq_Area(PI_OVER_2, M_PI, &temp, &temp_northing);
+    if (temp_northing > 0)
+    {
+      Tcea_Min_Northing = temp_northing - 20003931.458986;
+      Tcea_Max_Northing = temp_northing;
+    }
+    else if (temp_northing < 0)
+    {
+      Tcea_Max_Northing = temp_northing + 20003931.458986;
+      Tcea_Min_Northing = temp_northing;
+    }
+  } /* END OF if(!Error_Code) */
+  return (Error_Code);
+} /* END OF Set_Trans_Cyl_Eq_Area_Parameters */
+
+void ossimTransCylEquAreaProjection::Get_Trans_Cyl_Eq_Area_Parameters(double *a,
+                                                                      double *f,
+                                                                      double *Origin_Latitude,
+                                                                      double *Central_Meridian,
+                                                                      double *False_Easting,
+                                                                      double *False_Northing,
+                                                                      double *Scale_Factor)const
+{ /* BEGIN Get_Trans_Cyl_Eq_Area_Parameters */
+/*
+ * The function Get_Trans_Cyl_Eq_Area_Parameters returns the current ellipsoid
+ * parameters, Transverse Cylindrical Equal Area projection parameters, and scale factor.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid						        (output)
+ *    Origin_Latitude   : Latitude in radians at which the          (output)
+ *                          point scale factor is 1.0
+ *    Central_Meridian  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (output)
+ *    Scale_Factor      : Multiplier which reduces distances in the
+ *                          projection to the actual distance on the
+ *                          ellipsoid                               (output)
+ */
+
+  *a = Tcea_a;
+  *f = Tcea_f;
+  *Origin_Latitude = Tcea_Origin_Lat;
+  *Central_Meridian = Tcea_Origin_Long;
+  *False_Easting = Tcea_False_Easting;
+  *False_Northing = Tcea_False_Northing;
+  *Scale_Factor = Tcea_Scale_Factor;
+  
+  return;
+} /* END OF Get_Trans_Cyl_Eq_Area_Parameters */
+
+
+long ossimTransCylEquAreaProjection::Convert_Geodetic_To_Trans_Cyl_Eq_Area (double Latitude,
+                                                                            double Longitude,
+                                                                            double *Easting,
+                                                                            double *Northing)const
+{ /* BEGIN Convert_Geodetic_To_Trans_Cyl_Eq_Area */
+/*
+ * The function Convert_Geodetic_To_Trans_Cyl_Eq_Area converts geodetic (latitude and
+ * longitude) coordinates to Transverse Cylindrical Equal Area projection (easting and
+ * northing) coordinates, according to the current ellipsoid and Transverse Cylindrical 
+ * Equal Area projection parameters.  If any errors occur, the error code(s) are returned 
+ * by the function, otherwise TCEA_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double x;
+  double dlam;                      /* Longitude - Central Meridan */
+  double sin_lat = sin(Latitude);
+  double qq, qq_OVER_qp;
+  double beta, betac;
+  double sin2betac, sin4betac, sin6betac;
+  double PHIc;
+  double phi, sin2phi, sin4phi, sin6phi;
+  double sinPHIc;
+  double Mc;
+  long Error_Code = TCEA_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   { /* Latitude out of range */
+//     Error_Code |= TCEA_LAT_ERROR;
+//   }
+//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
+//   { /* Longitude out of range */
+//     Error_Code |= TCEA_LON_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    dlam = Longitude - Tcea_Origin_Long;
+    if (fabs(dlam) >= (M_PI / 2.0))
+    { /* Distortion will result if Longitude is more than 90 degrees from the Central Meridian */
+      Error_Code |= TCEA_LON_WARNING;
+    }
+
+    if (dlam > M_PI)
+    {
+      dlam -= TWO_PI;
+    }
+    if (dlam < -M_PI)
+    {
+      dlam += TWO_PI;
+    }
+    if (Latitude == PI_OVER_2)
+    {
+      qq = qp;
+      qq_OVER_qp = 1.0;
+    }
+    else
+    {
+      x = es * sin_lat;
+      qq = TCEA_Q(sin_lat, x);
+      qq_OVER_qp = qq / qp;
+    }
+
+
+    if (qq_OVER_qp > 1.0)
+      qq_OVER_qp = 1.0;
+    else if (qq_OVER_qp < -1.0)
+      qq_OVER_qp = -1.0;
+
+    beta = asin(qq_OVER_qp);
+    betac = atan(tan(beta) / cos(dlam));
+
+    if ((fabs(betac) - PI_OVER_2) > 1.0e-8)
+      PHIc = betac;
+    else
+    {
+      sin2betac = TCEA_COEFF_TIMES_SIN(a0, 2.0, betac);
+      sin4betac = TCEA_COEFF_TIMES_SIN(a1, 4.0, betac);
+      sin6betac = TCEA_COEFF_TIMES_SIN(a2, 6.0, betac);
+      PHIc = TCEA_L(betac, sin2betac, sin4betac, sin6betac);
+    }
+
+    sinPHIc = sin(PHIc);
+    *Easting = Tcea_a * cos(beta) * cos(PHIc) * sin(dlam) /
+               (Tcea_Scale_Factor * cos(betac) * sqrt(1.0 - es2 *
+                                                      sinPHIc * sinPHIc)) + Tcea_False_Easting;
+
+    phi = c0 * PHIc;
+    sin2phi = TCEA_COEFF_TIMES_SIN(c1, 2.0, PHIc);
+    sin4phi = TCEA_COEFF_TIMES_SIN(c2, 4.0, PHIc);
+    sin6phi = TCEA_COEFF_TIMES_SIN(c3, 6.0, PHIc);
+    Mc = TCEA_M(phi, sin2phi, sin4phi, sin6phi);
+
+    *Northing = Tcea_Scale_Factor * (Mc - M0) + Tcea_False_Northing;
+  }
+  return (Error_Code);
+} /* END OF Convert_Geodetic_To_Trans_Cyl_Eq_Area */
+
+
+long ossimTransCylEquAreaProjection::Convert_Trans_Cyl_Eq_Area_To_Geodetic(double Easting,
+                                                                           double Northing,
+                                                                           double *Latitude,
+                                                                           double *Longitude)const
+{ /* BEGIN Convert_Trans_Cyl_Eq_Area_To_Geodetic */
+/*
+ * The function Convert_Trans_Cyl_Eq_Area_To_Geodetic converts Transverse
+ * Cylindrical Equal Area projection (easting and northing) coordinates
+ * to geodetic (latitude and longitude) coordinates, according to the
+ * current ellipsoid and Transverse Cylindrical Equal Area projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise TCEA_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double x;
+  double dx;     /* Delta easting - Difference in easting (easting-FE)      */
+  double dy;     /* Delta northing - Difference in northing (northing-FN)   */
+  double Mc;
+  double MUc;
+  double sin2mu, sin4mu, sin6mu, sin8mu;
+  double PHIc;
+  double Qc;
+  double sin_lat;
+  double beta, betac, beta_prime;
+  double sin2beta, sin4beta, sin6beta;
+  double cosbetac;
+  double Qc_OVER_qp;
+  double temp;
+
+  long Error_Code = TCEA_NO_ERROR;
+
+//   if ((Easting < (Tcea_False_Easting + Tcea_Min_Easting))
+//       || (Easting > (Tcea_False_Easting + Tcea_Max_Easting)))
+//   { /* Easting out of range */
+//     Error_Code |= TCEA_EASTING_ERROR;
+//   }
+//   if ((Northing < (Tcea_False_Northing + Tcea_Min_Northing))
+//       || (Northing > (Tcea_False_Northing + Tcea_Max_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= TCEA_NORTHING_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    dy = Northing - Tcea_False_Northing;
+    dx = Easting - Tcea_False_Easting;
+    Mc = M0 + dy / Tcea_Scale_Factor;
+    MUc = Mc / (Tcea_a * c0);
+
+    sin2mu = TCEA_COEFF_TIMES_SIN(b0, 2.0, MUc);
+    sin4mu = TCEA_COEFF_TIMES_SIN(b1, 4.0, MUc);
+    sin6mu = TCEA_COEFF_TIMES_SIN(b2, 6.0, MUc);
+    sin8mu = TCEA_COEFF_TIMES_SIN(b3, 8.0, MUc);
+    PHIc = MUc + sin2mu + sin4mu + sin6mu + sin8mu;
+
+    sin_lat = sin(PHIc);
+    x = es * sin_lat;
+    Qc = TCEA_Q(sin_lat, x);
+    Qc_OVER_qp = Qc / qp;
+
+    if (Qc_OVER_qp < -1.0)
+      Qc_OVER_qp = -1.0;
+    else if (Qc_OVER_qp > 1.0)
+      Qc_OVER_qp = 1.0;
+
+    betac = asin(Qc_OVER_qp);
+    cosbetac = cos(betac);
+    temp = Tcea_Scale_Factor * dx * cosbetac * sqrt(1.0 -
+                                                    es2 * sin_lat * sin_lat) / (Tcea_a * cos(PHIc));
+    if (temp > 1.0)
+      temp = 1.0;
+    else if (temp < -1.0)
+      temp = -1.0;
+    beta_prime = -asin(temp);
+    beta = asin(cos(beta_prime) * sin(betac));
+
+    sin2beta = TCEA_COEFF_TIMES_SIN(a0, 2.0, beta);
+    sin4beta = TCEA_COEFF_TIMES_SIN(a1, 4.0, beta);
+    sin6beta = TCEA_COEFF_TIMES_SIN(a2, 6.0, beta);
+    *Latitude = TCEA_L(beta, sin2beta, sin4beta, sin6beta);
+
+    *Longitude = Tcea_Origin_Long - atan(tan(beta_prime) / cosbetac);
+
+//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+//       *Latitude = PI_OVER_2;
+//     else if (*Latitude < -PI_OVER_2)
+//       *Latitude = -PI_OVER_2;
+
+//     if (*Longitude > M_PI)
+//       *Longitude -= TWO_PI;
+//     if (*Longitude < -M_PI)
+//       *Longitude += TWO_PI;
+
+//     if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
+//       *Longitude = M_PI;
+//     else if (*Longitude < -M_PI)
+//       *Longitude = -M_PI;
+  }
+  return (Error_Code);
+} /* END OF Convert_Trans_Cyl_Eq_Area_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimTransCylEquAreaProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimTransCylEquAreaProjection* p =
+      dynamic_cast<const ossimTransCylEquAreaProjection*>(&proj);
+   if (!p) return false;
+
+   if (!ossim::almostEqual(Tcea_Scale_Factor,p->Tcea_Scale_Factor)) return false;
+
+   return true;
+}
diff --git a/src/projection/ossimTransMercatorProjection.cpp b/src/projection/ossimTransMercatorProjection.cpp
new file mode 100644
index 0000000..e6fac78
--- /dev/null
+++ b/src/projection/ossimTransMercatorProjection.cpp
@@ -0,0 +1,734 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Transverse Mercator  projection code.  
+//*******************************************************************
+//  $Id: ossimTransMercatorProjection.cpp 23002 2014-11-24 17:11:17Z dburken $
+#include <cmath>
+using namespace std;
+
+#include <ossim/projection/ossimTransMercatorProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimTransMercatorProjection, "ossimTransMercatorProjection", ossimMapProjection)
+
+/******************************* DEFINES *********************************/
+
+#define TRANMERC_NO_ERROR           0x0000
+#define TRANMERC_LAT_ERROR          0x0001
+#define TRANMERC_LON_ERROR          0x0002
+#define TRANMERC_EASTING_ERROR      0x0004
+#define TRANMERC_NORTHING_ERROR     0x0008
+#define TRANMERC_ORIGIN_LAT_ERROR   0x0010
+#define TRANMERC_CENT_MER_ERROR     0x0020
+#define TRANMERC_A_ERROR            0x0040
+#define TRANMERC_B_ERROR            0x0080
+#define TRANMERC_A_LESS_B_ERROR     0x0100
+#define TRANMERC_SCALE_FACTOR_ERROR 0x0200
+#define TRANMERC_LON_WARNING        0x0400
+
+#define MAX_LAT         ((M_PI * 90.0)/180.0)    /* 90 degrees in radians */
+#define MAX_DELTA_LONG  ((M_PI * 90.0)/180.0)    /* 90 degrees in radians */
+#define MIN_SCALE_FACTOR  0.3
+#define MAX_SCALE_FACTOR  3.0
+
+#define SPHTMD(Latitude) ((double) (TranMerc_ap * Latitude \
+      - TranMerc_bp * sin(2.e0 * Latitude) + TranMerc_cp * sin(4.e0 * Latitude) \
+      - TranMerc_dp * sin(6.e0 * Latitude) + TranMerc_ep * sin(8.e0 * Latitude) ) )
+
+#define SPHSN(Latitude) ((double) (getA() / sqrt( 1.e0 - TranMerc_es * \
+      pow(sin(Latitude), 2))))
+
+#define SPHSR(Latitude) ((double) (getA() * (1.e0 - TranMerc_es) / \
+    pow(DENOM(Latitude), 3)))
+
+#define DENOM(Latitude) ((double) (sqrt(1.e0 - TranMerc_es * pow(sin(Latitude),2))))
+
+ossimTransMercatorProjection::ossimTransMercatorProjection(const ossimEllipsoid& ellipsoid,
+                                                           const ossimGpt& origin)
+   :
+      ossimMapProjection(ellipsoid, origin),
+      TranMerc_a(6378137.0),
+      TranMerc_f(1.0/298.257223563),
+      TranMerc_es(0.0066943799901413800),
+      TranMerc_ebs(0.0067394967565869),
+      TranMerc_Origin_Lat(origin.latr()),
+      TranMerc_Origin_Long(origin.lonr()),
+      TranMerc_False_Northing(0.0),
+      TranMerc_False_Easting(0.0),
+      TranMerc_Scale_Factor(1.0),
+      TranMerc_ap(6367449.1458008),
+      TranMerc_bp(16038.508696861),
+      TranMerc_cp(16.832613334334),
+      TranMerc_dp(0.021984404273757),
+      TranMerc_Delta_Easting(40000000.0),
+      TranMerc_Delta_Northing(40000000.0)
+{
+   update();
+}
+
+ossimTransMercatorProjection::ossimTransMercatorProjection(const ossimEllipsoid& ellipsoid,
+                                                           const ossimGpt& origin,
+                                                           double falseEasting,
+                                                           double falseNorthing,
+                                                           double scaleFactor)
+   :
+      ossimMapProjection(ellipsoid, origin),
+      TranMerc_a(6378137.0),
+      TranMerc_f(1.0/298.257223563),
+      TranMerc_es(0.0066943799901413800),
+      TranMerc_ebs(0.0067394967565869),
+      TranMerc_Origin_Lat(origin.latr()),
+      TranMerc_Origin_Long(origin.lonr()),
+      TranMerc_False_Northing(falseNorthing),
+      TranMerc_False_Easting(falseEasting),
+      TranMerc_Scale_Factor(scaleFactor),
+      TranMerc_ap(6367449.1458008),
+      TranMerc_bp(16038.508696861),
+      TranMerc_cp(16.832613334334),
+      TranMerc_dp(0.021984404273757),
+      TranMerc_Delta_Easting(40000000.0),
+      TranMerc_Delta_Northing(40000000.0)
+{
+   update();
+}
+
+void ossimTransMercatorProjection::update()
+{
+   Set_Transverse_Mercator_Parameters(theEllipsoid.getA(),
+                                      theEllipsoid.getFlattening(),
+                                      theOrigin.latr(),
+                                      theOrigin.lonr(),
+                                      TranMerc_False_Easting,
+                                      TranMerc_False_Northing,
+                                      TranMerc_Scale_Factor);
+
+   theFalseEastingNorthing.x = TranMerc_False_Easting;
+   theFalseEastingNorthing.y = TranMerc_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+void ossimTransMercatorProjection::setFalseEasting(double falseEasting)
+{
+   TranMerc_False_Easting  = falseEasting;
+   
+   update();
+}
+
+
+void ossimTransMercatorProjection::setFalseNorthing(double falseNorthing)
+{
+   TranMerc_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimTransMercatorProjection::setFalseEastingNorthing(double falseEasting,
+                                                      double falseNorthing)
+{
+   TranMerc_False_Easting  = falseEasting;
+   TranMerc_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimTransMercatorProjection::setScaleFactor(double scaleFactor)
+{
+   TranMerc_Scale_Factor = scaleFactor;
+   
+   update();
+}
+
+void ossimTransMercatorProjection::setParameters(double falseEasting,
+                                                   double falseNorthing,
+                                                   double scaleFactor)
+{
+   TranMerc_False_Easting  = falseEasting;
+   TranMerc_False_Northing = falseNorthing;
+   TranMerc_Scale_Factor   = scaleFactor;
+   
+   update();
+}
+
+void ossimTransMercatorProjection::setDefaults()
+{
+   TranMerc_False_Easting  = 0.0;
+   TranMerc_False_Northing = 0.0;
+   TranMerc_Scale_Factor   = 1.0;
+   TranMerc_Delta_Easting  = 40000000.0;
+   TranMerc_Delta_Northing = 40000000.0;
+}
+
+ossimGpt ossimTransMercatorProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_Transverse_Mercator_To_Geodetic(eastingNorthing.x,
+                                           eastingNorthing.y,
+                                           &lat,
+                                           &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
+}
+
+ossimDpt ossimTransMercatorProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Transverse_Mercator(gpt.latr(),
+                                           gpt.lonr(),
+                                           &easting,
+                                           &northing);
+   
+   return ossimDpt(easting, northing);
+}
+
+bool ossimTransMercatorProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::SCALE_FACTOR_KW,
+           TranMerc_Scale_Factor,
+           true);
+   
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+bool ossimTransMercatorProjection::loadState(const ossimKeywordlist& kwl,
+                                             const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   const char* scaleFactor   = kwl.find(prefix, ossimKeywordNames::SCALE_FACTOR_KW);
+   
+   setDefaults();
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimTransMercatorProjection))
+   {
+      TranMerc_False_Easting  = theFalseEastingNorthing.x;
+      TranMerc_False_Northing = theFalseEastingNorthing.y;
+
+      if(scaleFactor)
+      {
+         double d = ossimString(scaleFactor).toDouble();
+         if (d > 0.0) // Check to avoid divide by zero.
+         {
+            TranMerc_Scale_Factor = d;
+         }
+      }
+   }
+
+   update();
+
+   return flag;
+}
+
+/************************************************************************/
+/*                              FUNCTIONS     
+ *
+ */
+
+
+long ossimTransMercatorProjection::Set_Transverse_Mercator_Parameters(double a,
+                                                                      double f,
+                                                                      double Origin_Latitude,
+                                                                      double Central_Meridian,
+                                                                      double False_Easting,
+                                                                      double False_Northing,
+                                                                      double Scale_Factor)
+
+{ /* BEGIN Set_Tranverse_Mercator_Parameters */
+  /*
+   * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
+   * parameters and Tranverse Mercator projection parameters as inputs, and
+   * sets the corresponding state variables. If any errors occur, the error
+   * code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
+   * returned.
+   *
+   *    a                 : Semi-major axis of ellipsoid, in meters    (input)
+   *    f                 : Flattening of ellipsoid						         (input)
+   *    Origin_Latitude   : Latitude in radians at the origin of the   (input)
+   *                         projection
+   *    Central_Meridian  : Longitude in radians at the center of the  (input)
+   *                         projection
+   *    False_Easting     : Easting/X at the center of the projection  (input)
+   *    False_Northing    : Northing/Y at the center of the projection (input)
+   *    Scale_Factor      : Projection scale factor                    (input) 
+   */
+
+  double tn;        /* True Meridianal distance constant  */
+  double tn2;
+  double tn3;
+  double tn4;
+  double tn5;
+  double dummy_northing;
+  double TranMerc_b; /* Semi-minor axis of ellipsoid, in meters */
+//  double inv_f = 1 / f;
+  long Error_Code = TRANMERC_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= TRANMERC_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= TRANMERC_INV_F_ERROR;
+//   }
+//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
+//   { /* origin latitude out of range */
+//     Error_Code |= TRANMERC_ORIGIN_LAT_ERROR;
+//   }
+//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= TRANMERC_CENT_MER_ERROR;
+//   }
+//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
+//   {
+//     Error_Code |= TRANMERC_SCALE_FACTOR_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    TranMerc_a = a;
+    TranMerc_f = f;
+    TranMerc_Origin_Lat = 0;
+    TranMerc_Origin_Long = 0;
+    TranMerc_False_Northing = 0;
+    TranMerc_False_Easting = 0; 
+    TranMerc_Scale_Factor = 1;
+
+    /* Eccentricity Squared */
+    TranMerc_es = 2 * TranMerc_f - TranMerc_f * TranMerc_f;
+    /* Second Eccentricity Squared */
+    TranMerc_ebs = (1 / (1 - TranMerc_es)) - 1;
+
+    TranMerc_b = TranMerc_a * (1 - TranMerc_f);    
+    /*True meridianal constants  */
+    tn = (TranMerc_a - TranMerc_b) / (TranMerc_a + TranMerc_b);
+    tn2 = tn * tn;
+    tn3 = tn2 * tn;
+    tn4 = tn3 * tn;
+    tn5 = tn4 * tn;
+
+    TranMerc_ap = TranMerc_a * (1.e0 - tn + 5.e0 * (tn2 - tn3)/4.e0
+                                + 81.e0 * (tn4 - tn5)/64.e0 );
+    TranMerc_bp = 3.e0 * TranMerc_a * (tn - tn2 + 7.e0 * (tn3 - tn4)
+                                       /8.e0 + 55.e0 * tn5/64.e0 )/2.e0;
+    TranMerc_cp = 15.e0 * TranMerc_a * (tn2 - tn3 + 3.e0 * (tn4 - tn5 )/4.e0) /16.0;
+    TranMerc_dp = 35.e0 * TranMerc_a * (tn3 - tn4 + 11.e0 * tn5 / 16.e0) / 48.e0;
+    TranMerc_ep = 315.e0 * TranMerc_a * (tn4 - tn5) / 512.e0;
+    Convert_Geodetic_To_Transverse_Mercator(MAX_LAT,
+                                            MAX_DELTA_LONG,
+                                            &TranMerc_Delta_Easting,
+                                            &TranMerc_Delta_Northing);
+    Convert_Geodetic_To_Transverse_Mercator(0,
+                                            MAX_DELTA_LONG,
+                                            &TranMerc_Delta_Easting,
+                                            &dummy_northing);
+    TranMerc_Origin_Lat = Origin_Latitude;
+    if (Central_Meridian > M_PI)
+      Central_Meridian -= TWO_PI;
+    TranMerc_Origin_Long = Central_Meridian;
+    TranMerc_False_Northing = False_Northing;
+    TranMerc_False_Easting = False_Easting; 
+    TranMerc_Scale_Factor = Scale_Factor;
+  } /* END OF if(!Error_Code) */
+  return (Error_Code);
+}  /* END of Set_Transverse_Mercator_Parameters  */
+
+
+void ossimTransMercatorProjection::Get_Transverse_Mercator_Parameters(double *a,
+                                                                      double *f,
+                                                                      double *Origin_Latitude,
+                                                                      double *Central_Meridian,
+                                                                      double *False_Easting,
+                                                                      double *False_Northing,
+                                                                      double *Scale_Factor)const
+
+{ /* BEGIN Get_Tranverse_Mercator_Parameters  */
+  /*
+   * The function Get_Transverse_Mercator_Parameters returns the current
+   * ellipsoid and Transverse Mercator projection parameters.
+   *
+   *    a                 : Semi-major axis of ellipsoid, in meters    (output)
+   *    f                 : Flattening of ellipsoid						         (output)
+   *    Origin_Latitude   : Latitude in radians at the origin of the   (output)
+   *                         projection
+   *    Central_Meridian  : Longitude in radians at the center of the  (output)
+   *                         projection
+   *    False_Easting     : Easting/X at the center of the projection  (output)
+   *    False_Northing    : Northing/Y at the center of the projection (output)
+   *    Scale_Factor      : Projection scale factor                    (output) 
+   */
+
+  *a = TranMerc_a;
+  *f = TranMerc_f;
+  *Origin_Latitude = TranMerc_Origin_Lat;
+  *Central_Meridian = TranMerc_Origin_Long;
+  *False_Easting = TranMerc_False_Easting;
+  *False_Northing = TranMerc_False_Northing;
+  *Scale_Factor = TranMerc_Scale_Factor;
+  
+  return;
+} /* END OF Get_Tranverse_Mercator_Parameters */
+
+
+
+long ossimTransMercatorProjection::Convert_Geodetic_To_Transverse_Mercator (double Latitude,
+                                                                            double Longitude,
+                                                                            double *Easting,
+                                                                            double *Northing)const
+   
+{      /* BEGIN Convert_Geodetic_To_Transverse_Mercator */
+
+  /*
+   * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
+   * (latitude and longitude) coordinates to Transverse Mercator projection
+   * (easting and northing) coordinates, according to the current ellipsoid
+   * and Transverse Mercator projection coordinates.  If any errors occur, the
+   * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
+   * returned.
+   *
+   *    Latitude      : Latitude in radians                         (input)
+   *    Longitude     : Longitude in radians                        (input)
+   *    Easting       : Easting/X in meters                         (output)
+   *    Northing      : Northing/Y in meters                        (output)
+   */
+
+  double c;       /* Cosine of latitude                          */
+  double c2;
+  double c3;
+  double c5;
+  double c7;
+  double dlam;    /* Delta longitude - Difference in Longitude       */
+  double eta;     /* constant - TranMerc_ebs *c *c                   */
+  double eta2;
+  double eta3;
+  double eta4;
+  double s;       /* Sine of latitude                        */
+  double sn;      /* Radius of curvature in the prime vertical       */
+  double t;       /* Tangent of latitude                             */
+  double tan2;
+  double tan3;
+  double tan4;
+  double tan5;
+  double tan6;
+  double t1;      /* Term in coordinate conversion formula - GP to Y */
+  double t2;      /* Term in coordinate conversion formula - GP to Y */
+  double t3;      /* Term in coordinate conversion formula - GP to Y */
+  double t4;      /* Term in coordinate conversion formula - GP to Y */
+  double t5;      /* Term in coordinate conversion formula - GP to Y */
+  double t6;      /* Term in coordinate conversion formula - GP to Y */
+  double t7;      /* Term in coordinate conversion formula - GP to Y */
+  double t8;      /* Term in coordinate conversion formula - GP to Y */
+  double t9;      /* Term in coordinate conversion formula - GP to Y */
+  double tmd;     /* True Meridional distance                        */
+  double tmdo;    /* True Meridional distance for latitude of origin */
+  long    Error_Code = TRANMERC_NO_ERROR;
+//  double temp_Origin;
+//  double temp_Long;
+
+//   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
+//   {  /* Latitude out of range */
+//     Error_Code|= TRANMERC_LAT_ERROR;
+//   }
+   if (Longitude > M_PI)
+     Longitude -= TWO_PI;
+//   if ((Longitude < (TranMerc_Origin_Long - MAX_DELTA_LONG))
+//       || (Longitude > (TranMerc_Origin_Long + MAX_DELTA_LONG)))
+//   {
+//     if (Longitude < 0)
+//       temp_Long = Longitude + TWO_PI;
+//     else
+//       temp_Long = Longitude;
+//     if (TranMerc_Origin_Long < 0)
+//       temp_Origin = TranMerc_Origin_Long + TWO_PI;
+//     else
+//       temp_Origin = TranMerc_Origin_Long;
+//     if ((temp_Long < (temp_Origin - MAX_DELTA_LONG))
+//         || (temp_Long > (temp_Origin + MAX_DELTA_LONG)))
+//       Error_Code|= TRANMERC_LON_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+
+    /* 
+     *  Delta Longitude
+     */
+    dlam = Longitude - TranMerc_Origin_Long;
+
+//     if (fabs(dlam) > (9.0 * M_PI / 180))
+//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
+//       Error_Code |= TRANMERC_LON_WARNING;
+//     }
+
+     if (dlam > M_PI)
+       dlam -= TWO_PI;
+     if (dlam < -M_PI)
+       dlam += TWO_PI;
+     if (fabs(dlam) < 2.e-10)
+       dlam = 0.0;
+
+    s = sin(Latitude);
+    c = cos(Latitude);
+    c2 = c * c;
+    c3 = c2 * c;
+    c5 = c3 * c2;
+    c7 = c5 * c2;
+    t = tan (Latitude);
+    tan2 = t * t;
+    tan3 = tan2 * t;
+    tan4 = tan3 * t;
+    tan5 = tan4 * t;
+    tan6 = tan5 * t;
+    eta = TranMerc_ebs * c2;
+    eta2 = eta * eta;
+    eta3 = eta2 * eta;
+    eta4 = eta3 * eta;
+
+    /* radius of curvature in prime vertical */
+    sn = SPHSN(Latitude);
+
+    /* True Meridianal Distances */
+    tmd = SPHTMD(Latitude);
+
+    /*  Origin  */
+    tmdo = SPHTMD (TranMerc_Origin_Lat);
+
+    /* northing */
+    t1 = (tmd - tmdo) * TranMerc_Scale_Factor;
+    t2 = sn * s * c * TranMerc_Scale_Factor/ 2.e0;
+    t3 = sn * s * c3 * TranMerc_Scale_Factor * (5.e0 - tan2 + 9.e0 * eta 
+                                                + 4.e0 * eta2) /24.e0; 
+
+    t4 = sn * s * c5 * TranMerc_Scale_Factor * (61.e0 - 58.e0 * tan2
+                                                + tan4 + 270.e0 * eta - 330.e0 * tan2 * eta + 445.e0 * eta2
+                                                + 324.e0 * eta3 -680.e0 * tan2 * eta2 + 88.e0 * eta4 
+                                                -600.e0 * tan2 * eta3 - 192.e0 * tan2 * eta4) / 720.e0;
+
+    t5 = sn * s * c7 * TranMerc_Scale_Factor * (1385.e0 - 3111.e0 * 
+                                                tan2 + 543.e0 * tan4 - tan6) / 40320.e0;
+
+    *Northing = TranMerc_False_Northing + t1 + pow(dlam,2.e0) * t2
+                + pow(dlam,4.e0) * t3 + pow(dlam,6.e0) * t4
+                + pow(dlam,8.e0) * t5; 
+
+    /* Easting */
+    t6 = sn * c * TranMerc_Scale_Factor;
+    t7 = sn * c3 * TranMerc_Scale_Factor * (1.e0 - tan2 + eta ) /6.e0;
+    t8 = sn * c5 * TranMerc_Scale_Factor * (5.e0 - 18.e0 * tan2 + tan4
+                                            + 14.e0 * eta - 58.e0 * tan2 * eta + 13.e0 * eta2 + 4.e0 * eta3 
+                                            - 64.e0 * tan2 * eta2 - 24.e0 * tan2 * eta3 )/ 120.e0;
+    t9 = sn * c7 * TranMerc_Scale_Factor * ( 61.e0 - 479.e0 * tan2
+                                             + 179.e0 * tan4 - tan6 ) /5040.e0;
+
+    *Easting = TranMerc_False_Easting + dlam * t6 + pow(dlam,3.e0) * t7 
+               + pow(dlam,5.e0) * t8 + pow(dlam,7.e0) * t9;
+  }
+  return (Error_Code);
+} /* END OF Convert_Geodetic_To_Transverse_Mercator */
+
+
+long ossimTransMercatorProjection::Convert_Transverse_Mercator_To_Geodetic (double Easting,
+                                                                            double Northing,
+                                                                            double *Latitude,
+                                                                            double *Longitude)const
+{      /* BEGIN Convert_Transverse_Mercator_To_Geodetic */
+
+  /*
+   * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
+   * Mercator projection (easting and northing) coordinates to geodetic
+   * (latitude and longitude) coordinates, according to the current ellipsoid
+   * and Transverse Mercator projection parameters.  If any errors occur, the
+   * error code(s) are returned by the function, otherwise TRANMERC_NO_ERROR is
+   * returned.
+   *
+   *    Easting       : Easting/X in meters                         (input)
+   *    Northing      : Northing/Y in meters                        (input)
+   *    Latitude      : Latitude in radians                         (output)
+   *    Longitude     : Longitude in radians                        (output)
+   */
+
+  double c;       /* Cosine of latitude                          */
+  double de;      /* Delta easting - Difference in Easting (Easting-Fe)    */
+  double dlam;    /* Delta longitude - Difference in Longitude       */
+  double eta;     /* constant - TranMerc_ebs *c *c                   */
+  double eta2;
+  double eta3;
+  double eta4;
+  double ftphi;   /* Footpoint latitude                              */
+  int    i;       /* Loop iterator                   */
+  // double s;       /* Sine of latitude                        */
+  double sn;      /* Radius of curvature in the prime vertical       */
+  double sr;      /* Radius of curvature in the meridian             */
+  double t;       /* Tangent of latitude                             */
+  double tan2;
+  double tan4;
+  double t10;     /* Term in coordinate conversion formula - GP to Y */
+  double t11;     /* Term in coordinate conversion formula - GP to Y */
+  double t12;     /* Term in coordinate conversion formula - GP to Y */
+  double t13;     /* Term in coordinate conversion formula - GP to Y */
+  double t14;     /* Term in coordinate conversion formula - GP to Y */
+  double t15;     /* Term in coordinate conversion formula - GP to Y */
+  double t16;     /* Term in coordinate conversion formula - GP to Y */
+  double t17;     /* Term in coordinate conversion formula - GP to Y */
+  double tmd;     /* True Meridional distance                        */
+  double tmdo;    /* True Meridional distance for latitude of origin */
+  long Error_Code = TRANMERC_NO_ERROR;
+
+//   if ((Easting < (TranMerc_False_Easting - TranMerc_Delta_Easting))
+//       ||(Easting > (TranMerc_False_Easting + TranMerc_Delta_Easting)))
+//   { /* Easting out of range  */
+//     Error_Code |= TRANMERC_EASTING_ERROR;
+//   }
+//   if ((Northing < (TranMerc_False_Northing - TranMerc_Delta_Northing))
+//       || (Northing > (TranMerc_False_Northing + TranMerc_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= TRANMERC_NORTHING_ERROR;
+//   }
+
+  if (!Error_Code)
+  {
+    /* True Meridional Distances for latitude of origin */
+    tmdo = SPHTMD(TranMerc_Origin_Lat);
+
+    /*  Origin  */
+    tmd = tmdo +  (Northing - TranMerc_False_Northing) / TranMerc_Scale_Factor; 
+
+    /* First Estimate */
+    sr = SPHSR(0.e0);
+    ftphi = tmd/sr;
+
+    for (i = 0; i < 5 ; i++)
+    {
+      t10 = SPHTMD (ftphi);
+      sr = SPHSR(ftphi);
+      ftphi = ftphi + (tmd - t10) / sr;
+    }
+
+    /* Radius of Curvature in the meridian */
+    sr = SPHSR(ftphi);
+
+    /* Radius of Curvature in the meridian */
+    sn = SPHSN(ftphi);
+
+    /* Sine Cosine terms */
+    // s = sin(ftphi);
+    c = cos(ftphi);
+
+    /* Tangent Value  */
+    t = tan(ftphi);
+    tan2 = t * t;
+    tan4 = tan2 * tan2;
+    eta = TranMerc_ebs * pow(c,2);
+    eta2 = eta * eta;
+    eta3 = eta2 * eta;
+    eta4 = eta3 * eta;
+    de = Easting - TranMerc_False_Easting;
+    if (fabs(de) < 0.0001)
+      de = 0.0;
+
+    /* Latitude */
+    t10 = t / (2.e0 * sr * sn * pow(TranMerc_Scale_Factor, 2));
+    t11 = t * (5.e0  + 3.e0 * tan2 + eta - 4.e0 * pow(eta,2)
+               - 9.e0 * tan2 * eta) / (24.e0 * sr * pow(sn,3) 
+                                       * pow(TranMerc_Scale_Factor,4));
+    t12 = t * (61.e0 + 90.e0 * tan2 + 46.e0 * eta + 45.E0 * tan4
+               - 252.e0 * tan2 * eta  - 3.e0 * eta2 + 100.e0 
+               * eta3 - 66.e0 * tan2 * eta2 - 90.e0 * tan4
+               * eta + 88.e0 * eta4 + 225.e0 * tan4 * eta2
+               + 84.e0 * tan2* eta3 - 192.e0 * tan2 * eta4)
+          / ( 720.e0 * sr * pow(sn,5) * pow(TranMerc_Scale_Factor, 6) );
+    t13 = t * ( 1385.e0 + 3633.e0 * tan2 + 4095.e0 * tan4 + 1575.e0 
+                * pow(t,6))/ (40320.e0 * sr * pow(sn,7) * pow(TranMerc_Scale_Factor,8));
+    *Latitude = ftphi - pow(de,2) * t10 + pow(de,4) * t11 - pow(de,6) * t12 
+                + pow(de,8) * t13;
+
+    t14 = 1.e0 / (sn * c * TranMerc_Scale_Factor);
+
+    t15 = (1.e0 + 2.e0 * tan2 + eta) / (6.e0 * pow(sn,3) * c * 
+                                        pow(TranMerc_Scale_Factor,3));
+
+    t16 = (5.e0 + 6.e0 * eta + 28.e0 * tan2 - 3.e0 * eta2
+           + 8.e0 * tan2 * eta + 24.e0 * tan4 - 4.e0 
+           * eta3 + 4.e0 * tan2 * eta2 + 24.e0 
+           * tan2 * eta3) / (120.e0 * pow(sn,5) * c  
+                             * pow(TranMerc_Scale_Factor,5));
+
+    t17 = (61.e0 +  662.e0 * tan2 + 1320.e0 * tan4 + 720.e0 
+           * pow(t,6)) / (5040.e0 * pow(sn,7) * c 
+                          * pow(TranMerc_Scale_Factor,7));
+
+    /* Difference in Longitude */
+    dlam = de * t14 - pow(de,3) * t15 + pow(de,5) * t16 - pow(de,7) * t17;
+
+    /* Longitude */
+    (*Longitude) = TranMerc_Origin_Long + dlam;
+    while (*Latitude > (90.0 * RAD_PER_DEG))
+    {
+      *Latitude = M_PI - *Latitude;
+      *Longitude += M_PI;
+      if (*Longitude > M_PI)
+        *Longitude -= TWO_PI;
+    }
+
+     while (*Latitude < (-90.0 * RAD_PER_DEG))
+     {
+       *Latitude = - (*Latitude + M_PI);
+       *Longitude += M_PI;
+       if (*Longitude > M_PI)
+         *Longitude -= TWO_PI;
+     }
+     if (*Longitude > TWO_PI)
+       *Longitude -= TWO_PI;
+     if (*Longitude < -M_PI)
+       *Longitude += TWO_PI;
+
+//     if (fabs(dlam) > (9.0 * M_PI / 180))
+//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
+//       Error_Code |= TRANMERC_LON_WARNING;
+//     }
+  }
+  return (Error_Code);
+} /* END OF Convert_Transverse_Mercator_To_Geodetic */
+
+std::ostream& ossimTransMercatorProjection::print(std::ostream& out) const
+{
+   out << setiosflags(ios::fixed) << setprecision(15)
+       << "// ossimTransMercatorProjection::print\n"
+       << ossimKeywordNames::SCALE_FACTOR_KW << ":  " << TranMerc_Scale_Factor
+       << endl;
+   return ossimMapProjection::print(out);
+}
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimTransMercatorProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimTransMercatorProjection* p =
+      dynamic_cast<const ossimTransMercatorProjection*>(&proj);
+   if (!p) return false;
+
+   if (!ossim::almostEqual(TranMerc_Scale_Factor,p->TranMerc_Scale_Factor)) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimUps.c b/src/projection/ossimUps.c
similarity index 100%
rename from ossim/src/ossim/projection/ossimUps.c
rename to src/projection/ossimUps.c
diff --git a/src/projection/ossimUpsProjection.cpp b/src/projection/ossimUpsProjection.cpp
new file mode 100644
index 0000000..5d97101
--- /dev/null
+++ b/src/projection/ossimUpsProjection.cpp
@@ -0,0 +1,344 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimUpsProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+#include <ossim/projection/ossimUpsProjection.h>
+#include <ossim/projection/ossimPolarst.h>
+
+#define PI       3.14159265358979323e0  /* PI     */
+#define PI_OVER    (PI/2.0e0)           /* PI over 2 */
+#define MAX_LAT    ((PI * 90)/180.0)    /* 90 degrees in radians */
+#define MAX_ORIGIN_LAT ((81.114528 * PI) / 180.0)
+#define MIN_NORTH_LAT (83.5*PI/180.0)
+#define MIN_SOUTH_LAT (-79.5*PI/180.0)
+#define MIN_EAST_NORTH 0
+#define MAX_EAST_NORTH 4000000
+
+#define UPS_NO_ERROR                0x0000
+#define UPS_LAT_ERROR               0x0001
+#define UPS_LON_ERROR               0x0002
+#define UPS_HEMISPHERE_ERROR        0x0004
+#define UPS_EASTING_ERROR           0x0008
+#define UPS_NORTHING_ERROR          0x0010
+#define UPS_A_ERROR                 0x0020
+#define UPS_INV_F_ERROR             0x0040
+
+RTTI_DEF1(ossimUpsProjection, "ossimUpsProjection", ossimMapProjection);
+
+ossimUpsProjection::ossimUpsProjection(const ossimEllipsoid& ellipsoid,
+                                       const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+    
+
+void ossimUpsProjection::setDefaults()
+{
+   if(theOrigin.latd() >= -FLT_EPSILON)
+   {
+      UPS_Origin_Latitude  =  MAX_ORIGIN_LAT;
+      theHemisphere        = 'N';
+   }
+   else
+   {
+      UPS_Origin_Latitude  =  -MAX_ORIGIN_LAT;
+      theHemisphere = 'S';
+   }
+   UPS_False_Easting    = 2000000;
+   UPS_False_Northing   = 2000000;
+   false_easting        = 0.0;
+   false_northing       = 0.0;
+   UPS_Easting          = 0.0;
+   UPS_Northing         = 0.0;
+   UPS_Origin_Longitude = 0.0;
+   theOrigin            = ossimGpt(UPS_Origin_Latitude*DEG_PER_RAD,
+                                   0.0,0.0);
+}
+
+void ossimUpsProjection::setHemisphere(char hemisphere)
+{ 
+  theHemisphere = hemisphere; 
+  update();
+}
+
+ossimGpt ossimUpsProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_UPS_To_Geodetic(theHemisphere,
+                           eastingNorthing.x,
+                           eastingNorthing.y,
+                           &lat,
+                           &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
+}
+
+ossimDpt ossimUpsProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+   
+   Convert_Geodetic_To_UPS(gpt.latr(),
+                           gpt.lonr(),
+                           &theHemisphere,
+                           &easting,
+                           &northing);
+   
+   return ossimDpt(easting, northing);
+}
+
+void ossimUpsProjection::update()
+{
+   Set_UPS_Parameters(theEllipsoid.getA(),
+                      theEllipsoid.getFlattening());
+
+   theFalseEastingNorthing.x = UPS_False_Easting;
+   theFalseEastingNorthing.y = UPS_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+/*!
+ * Method to save the state of an object to a keyword list.
+ * Return true if ok or false on error.
+ */
+bool ossimUpsProjection::saveState(ossimKeywordlist& kwl,
+                                   const char* prefix)const
+{
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+
+/*!
+ * Method to the load (recreate) the state of an object from a keyword
+ * list.  Return true if ok or false on error.
+ */
+bool ossimUpsProjection::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   setDefaults();
+
+   return ossimMapProjection::loadState(kwl, prefix);
+}
+
+/************************************************************************/
+/*                              FUNCTIONS
+ *
+ */
+
+
+long ossimUpsProjection::Set_UPS_Parameters( double a,
+                                             double f)
+{
+/*
+ * The function SET_UPS_PARAMETERS receives the ellipsoid parameters and sets
+ * the corresponding state variables. If any errors occur, the error code(s)
+ * are returned by the function, otherwise UPS_NO_ERROR is returned.
+ *
+ *   a     : Semi-major axis of ellipsoid in meters (input)
+ *   f     : Flattening of ellipsoid					      (input)
+ */
+
+//  double inv_f = 1 / f;
+  long Error_Code = UPS_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= UPS_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= UPS_INV_F_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+    UPS_a = a;
+    UPS_f = f;
+  }
+  return (Error_Code);
+}  /* END of Set_UPS_Parameters  */
+
+
+void ossimUpsProjection::Get_UPS_Parameters( double *a,
+                                             double *f)const
+{
+/*
+ * The function Get_UPS_Parameters returns the current ellipsoid parameters.
+ *
+ *  a      : Semi-major axis of ellipsoid, in meters (output)
+ *  f      : Flattening of ellipsoid					       (output)
+ */
+
+  *a = UPS_a;
+  *f = UPS_f;
+  
+  return;
+} /* END OF Get_UPS_Parameters */
+
+
+long ossimUpsProjection::Convert_Geodetic_To_UPS ( double Latitude,
+                                                   double Longitude,
+                                                   char   * /* Hemisphere */,
+                                                   double *Easting,
+                                                   double *Northing)const
+{
+/*
+ *  The function Convert_Geodetic_To_UPS converts geodetic (latitude and
+ *  longitude) coordinates to UPS (hemisphere, easting, and northing)
+ *  coordinates, according to the current ellipsoid parameters. If any 
+ *  errors occur, the error code(s) are returned by the function, 
+ *  otherwide UPS_NO_ERROR is returned.
+ *
+ *    Latitude      : Latitude in radians                       (input)
+ *    Longitude     : Longitude in radians                      (input)
+ *    Hemisphere    : Hemisphere either 'N' or 'S'              (output)
+ *    Easting       : Easting/X in meters                       (output)
+ *    Northing      : Northing/Y in meters                      (output)
+ */
+
+  double tempEasting, tempNorthing;
+  long Error_Code = UPS_NO_ERROR;
+
+//   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
+//   {   /* latitude out of range */
+//     Error_Code |= UPS_LAT_ERROR;
+//   }
+//   if ((Latitude < 0) && (Latitude > MIN_SOUTH_LAT))
+//     Error_Code |= UPS_LAT_ERROR;
+//   if ((Latitude >= 0) && (Latitude < MIN_NORTH_LAT))
+//     Error_Code |= UPS_LAT_ERROR;
+//   if ((Longitude < -PI) || (Longitude > (2 * PI)))
+//   {  /* slam out of range */
+//     Error_Code |= UPS_LON_ERROR;
+//   }
+
+  if (!Error_Code)
+  {  /* no errors */
+//     if (Latitude < 0)
+//     {
+//       UPS_Origin_Latitude = -MAX_ORIGIN_LAT; 
+//       *Hemisphere = 'S';
+//     }
+//     else
+//     {
+//       UPS_Origin_Latitude = MAX_ORIGIN_LAT; 
+//       *Hemisphere = 'N';
+//     }
+
+
+    Set_Polar_Stereographic_Parameters( UPS_a,
+                                        UPS_f,
+                                        UPS_Origin_Latitude,
+                                        UPS_Origin_Longitude,
+                                        false_easting,
+                                        false_northing);
+
+    Convert_Geodetic_To_Polar_Stereographic(Latitude,
+                                            Longitude,
+                                            &tempEasting,
+                                            &tempNorthing);
+
+    UPS_Easting = UPS_False_Easting + tempEasting;
+    UPS_Northing = UPS_False_Northing + tempNorthing;
+
+
+    *Easting = UPS_Easting;
+    *Northing = UPS_Northing;
+  }  /*  END of if(!Error_Code)   */
+
+  return (Error_Code);
+}  /* END OF Convert_Geodetic_To_UPS  */
+
+
+long ossimUpsProjection::Convert_UPS_To_Geodetic(char   Hemisphere,
+                                                 double Easting,
+                                                 double Northing,
+                                                 double *Latitude,
+                                                 double *Longitude)const
+{
+/*
+ *  The function Convert_UPS_To_Geodetic converts UPS (hemisphere, easting, 
+ *  and northing) coordinates to geodetic (latitude and longitude) coordinates
+ *  according to the current ellipsoid parameters.  If any errors occur, the 
+ *  error code(s) are returned by the function, otherwise UPS_NO_ERROR is 
+ *  returned.
+ *
+ *    Hemisphere    : Hemisphere either 'N' or 'S'              (input)
+ *    Easting       : Easting/X in meters                       (input)
+ *    Northing      : Northing/Y in meters                      (input)
+ *    Latitude      : Latitude in radians                       (output)
+ *    Longitude     : Longitude in radians                      (output)
+ */
+
+  long Error_Code = UPS_NO_ERROR;
+
+//   if ((Hemisphere != 'N') && (Hemisphere != 'S'))
+//     Error_Code |= UPS_HEMISPHERE_ERROR;
+//   if ((Easting < MIN_EAST_NORTH) || (Easting > MAX_EAST_NORTH))
+//     Error_Code |= UPS_EASTING_ERROR;
+//   if ((Northing < MIN_EAST_NORTH) || (Northing > MAX_EAST_NORTH))
+//     Error_Code |= UPS_NORTHING_ERROR;
+
+  if (Hemisphere =='N')
+  {UPS_Origin_Latitude = MAX_ORIGIN_LAT;}
+  if (Hemisphere =='S')
+  {UPS_Origin_Latitude = -MAX_ORIGIN_LAT;}
+
+  if (!Error_Code)
+  {   /*  no errors   */
+    Set_Polar_Stereographic_Parameters( UPS_a,
+                                        UPS_f,
+                                        UPS_Origin_Latitude,
+                                        UPS_Origin_Longitude,
+                                        UPS_False_Easting,
+                                        UPS_False_Northing);
+
+
+
+    Convert_Polar_Stereographic_To_Geodetic( Easting,
+                                             Northing,
+                                             Latitude,
+                                             Longitude); 
+
+
+//     if ((*Latitude < 0) && (*Latitude > MIN_SOUTH_LAT))
+//       Error_Code |= UPS_LAT_ERROR;
+//     if ((*Latitude >= 0) && (*Latitude < MIN_NORTH_LAT))
+//       Error_Code |= UPS_LAT_ERROR;
+  }  /*  END OF if(!Error_Code) */
+  return (Error_Code);
+}  /*  END OF Convert_UPS_To_Geodetic  */ 
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimUpsProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimUpsProjection* p = dynamic_cast<const ossimUpsProjection*>(&proj);
+   if (!p) return false;
+
+   if (theHemisphere != p->theHemisphere) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimUpspt.cpp b/src/projection/ossimUpspt.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimUpspt.cpp
rename to src/projection/ossimUpspt.cpp
diff --git a/ossim/src/ossim/projection/ossimUtm.c b/src/projection/ossimUtm.c
similarity index 100%
rename from ossim/src/ossim/projection/ossimUtm.c
rename to src/projection/ossimUtm.c
diff --git a/src/projection/ossimUtmProjection.cpp b/src/projection/ossimUtmProjection.cpp
new file mode 100644
index 0000000..2408468
--- /dev/null
+++ b/src/projection/ossimUtmProjection.cpp
@@ -0,0 +1,932 @@
+//*******************************************************************
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Geotrans Utm projection code.  
+//*******************************************************************
+//  $Id: ossimUtmProjection.cpp 20133 2011-10-12 19:03:47Z oscarkramer $
+
+#include <cstdlib>
+#include <cmath>
+using namespace std;
+
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/projection/ossimEpsgProjectionDatabase.h>
+
+RTTI_DEF1(ossimUtmProjection, "ossimUtmProjection", ossimMapProjection)
+
+/******************************* DEFINES *********************************/
+   
+#define UTM_NO_ERROR            0x0000
+#define UTM_LAT_ERROR           0x0001
+#define UTM_LON_ERROR           0x0002
+#define UTM_EASTING_ERROR       0x0004
+#define UTM_NORTHING_ERROR      0x0008
+#define UTM_ZONE_ERROR          0x0010
+#define UTM_HEMISPHERE_ERROR    0x0020
+#define UTM_ZONE_OVERRIDE_ERROR 0x0040
+#define UTM_A_ERROR             0x0080
+#define UTM_B_ERROR             0x0100
+#define UTM_A_LESS_B_ERROR      0x0200
+
+#define MIN_LAT      ( (-80.5 * M_PI) / 180.0 ) /* -80.5 degrees in radians */
+#define MAX_LAT      ( (84.5 * M_PI) / 180.0 )  /* 84.5 degrees in radians  */
+#define MAX_DELTA_LONG  ((M_PI * 90.0)/180.0)    /* 90 degrees in radians */
+#define MIN_EASTING  100000
+#define MAX_EASTING  900000
+#define MIN_NORTHING 0
+#define MAX_NORTHING 10000000
+#define MIN_SCALE_FACTOR  0.3
+#define MAX_SCALE_FACTOR  3.0
+
+#define SPHTMD(Latitude) ((double) (theTranMerc_ap * Latitude \
+      - theTranMerc_bp * sin(2.e0 * Latitude) + theTranMerc_cp * sin(4.e0 * Latitude) \
+      - theTranMerc_dp * sin(6.e0 * Latitude) + theTranMerc_ep * sin(8.e0 * Latitude) ) )
+
+#define SPHSN(Latitude) ((double) (getA() / sqrt( 1.e0 - theTranMerc_es * \
+      pow(sin(Latitude), 2))))
+
+#define SPHSR(Latitude) ((double) (getA() * (1.e0 - theTranMerc_es) / \
+    pow(DENOM(Latitude), 3)))
+
+#define DENOM(Latitude) ((double) (sqrt(1.e0 - theTranMerc_es * pow(sin(Latitude),2))))
+
+
+ossimUtmProjection::ossimUtmProjection(const ossimEllipsoid& ellipsoid,
+                                       const ossimGpt& origin)
+   :
+      ossimMapProjection(ellipsoid, origin),
+      theTranMerc_a(6378137.0),
+      theTranMerc_f(1.0/298.257223563),
+      theTranMerc_es(0.0066943799901413800),
+      theTranMerc_ebs(0.0067394967565869),
+      theTranMerc_Origin_Lat(0.0),
+      theTranMerc_Origin_Long(0.0),
+      theTranMerc_False_Northing(0.0),
+      theTranMerc_False_Easting(500000.0),
+      theTranMerc_Scale_Factor(0.9996),
+      theTranMerc_ap(6367449.1458008),
+      theTranMerc_bp(16038.508696861),
+      theTranMerc_cp(16.832613334334),
+      theTranMerc_dp(0.021984404273757),
+      theTranMerc_Delta_Easting(40000000.0),
+      theTranMerc_Delta_Northing(40000000.0),
+      theZone(1),
+      theHemisphere('N')
+      
+{
+   setZone(origin);
+   setHemisphere(origin);
+   update();
+}
+
+ossimUtmProjection::ossimUtmProjection(const ossimEllipsoid& ellipsoid,
+                                       const ossimGpt& origin,
+                                       ossim_int32 zone,
+                                       char hemisphere)
+   :
+      ossimMapProjection(ellipsoid, origin),
+      theTranMerc_a(6378137.0),
+      theTranMerc_f(1.0/298.257223563),
+      theTranMerc_es(0.0066943799901413800),
+      theTranMerc_ebs(0.0067394967565869),
+      theTranMerc_Origin_Lat(0.0),
+      theTranMerc_Origin_Long(0.0),
+      theTranMerc_False_Northing(0.0),
+      theTranMerc_False_Easting(500000.0),
+      theTranMerc_Scale_Factor(0.9996),
+      theTranMerc_ap(6367449.1458008),
+      theTranMerc_bp(16038.508696861),
+      theTranMerc_cp(16.832613334334),
+      theTranMerc_dp(0.021984404273757),
+      theTranMerc_Delta_Easting(40000000.0),
+      theTranMerc_Delta_Northing(40000000.0),
+      theZone(zone),
+      theHemisphere(hemisphere)      
+{
+   setZone(zone);
+   setHemisphere(hemisphere);
+   update();
+}
+
+ossimUtmProjection::ossimUtmProjection(ossim_int32 zone)
+   :
+      ossimMapProjection(),
+      theTranMerc_a(6378137.0),
+      theTranMerc_f(1.0/298.257223563),
+      theTranMerc_es(0.0066943799901413800),
+      theTranMerc_ebs(0.0067394967565869),
+      theTranMerc_Origin_Lat(0.0),
+      theTranMerc_Origin_Long(0.0),
+      theTranMerc_False_Northing(0.0),
+      theTranMerc_False_Easting(500000.0),
+      theTranMerc_Scale_Factor(0.9996),
+      theTranMerc_ap(6367449.1458008),
+      theTranMerc_bp(16038.508696861),
+      theTranMerc_cp(16.832613334334),
+      theTranMerc_dp(0.021984404273757),
+      theTranMerc_Delta_Easting(40000000.0),
+      theTranMerc_Delta_Northing(40000000.0),
+      theZone(zone),
+      theHemisphere('N')      
+{
+   setZone(zone);
+   update();
+}
+
+ossimUtmProjection::ossimUtmProjection(const ossimUtmProjection& src)
+      :ossimMapProjection(src),
+      theTranMerc_a(src.theTranMerc_a),
+      theTranMerc_f(src.theTranMerc_f),
+      theTranMerc_es(src.theTranMerc_es),
+      theTranMerc_ebs(src.theTranMerc_ebs),
+      theTranMerc_Origin_Lat(src.theTranMerc_Origin_Lat),
+      theTranMerc_Origin_Long(src.theTranMerc_Origin_Long),
+      theTranMerc_False_Northing(src.theTranMerc_False_Northing),
+      theTranMerc_False_Easting(src.theTranMerc_False_Easting),
+      theTranMerc_Scale_Factor(src.theTranMerc_Scale_Factor),
+      theTranMerc_ap(src.theTranMerc_ap),
+      theTranMerc_bp(src.theTranMerc_bp),
+      theTranMerc_cp(src.theTranMerc_cp),
+      theTranMerc_dp(src.theTranMerc_dp),
+      theTranMerc_Delta_Easting(src.theTranMerc_Delta_Easting),
+      theTranMerc_Delta_Northing(src.theTranMerc_Delta_Northing),
+      theZone(src.theZone),
+      theHemisphere(src.theHemisphere)      
+{
+   setZone(theZone);
+   setHemisphere(theHemisphere);
+   update();
+}
+
+void ossimUtmProjection::update()
+{
+   ossimGpt origin = theOrigin;
+   origin.lond(computeZoneMeridian(theZone));
+   origin.latd(0.0);
+   double falseNorthing = 10000000.0;
+   if (theHemisphere == 'N')
+   {
+      falseNorthing = 0.0;
+   }
+   Set_Transverse_Mercator_Parameters(theEllipsoid.getA(),
+                                      theEllipsoid.getFlattening(),
+                                      origin.latr(),
+                                      origin.lonr(),
+                                      theTranMerc_False_Easting,
+                                      falseNorthing,
+                                      theTranMerc_Scale_Factor);
+
+   theFalseEastingNorthing.x = theTranMerc_False_Easting;
+   theFalseEastingNorthing.y = theTranMerc_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+ossimGpt ossimUtmProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_Transverse_Mercator_To_Geodetic(eastingNorthing.x,
+                                           eastingNorthing.y,
+                                           &lat,
+                                           &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
+}
+
+ossimDpt ossimUtmProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Transverse_Mercator(gpt.latr(),
+                                           gpt.lonr(),
+                                           &easting,
+                                           &northing);
+   
+   return ossimDpt(easting, northing);
+}
+
+ossimObject* ossimUtmProjection::dup()const
+{
+   ossimUtmProjection* proj = new ossimUtmProjection(*this);
+   return proj;
+}
+
+ossim_int32 ossimUtmProjection::getZone() const
+{
+   return theZone;
+}
+
+char ossimUtmProjection::getHemisphere() const
+{
+   return theHemisphere;
+}
+
+void ossimUtmProjection::setOrigin(const ossimGpt& origin)
+{
+   setZone(origin);
+   // NOTE: We will not set the hemisphere if the origin latitude is 0.0.
+   if (origin.latd() != 0.0)
+   {
+      setHemisphere(origin);
+   }
+   ossimMapProjection::setOrigin(origin);
+}
+
+void ossimUtmProjection::setZone(const ossimGpt& ground)
+{
+   setZone(computeZone(ground));
+}
+
+void ossimUtmProjection::setZone(ossim_int32 zone)
+{
+   if( (zone < 1) || (zone > 60) )
+   {
+      theZone = computeZone(theOrigin);
+   }
+   else
+   {
+      theZone = zone;
+   }
+   theOrigin.lond(computeZoneMeridian(theZone));
+   theOrigin.latd(0);
+   theOrigin.datum(theDatum);
+   theTranMerc_Origin_Long = theOrigin.lonr();
+}
+
+void ossimUtmProjection::setHemisphere(const ossimGpt& ground)
+{
+   char hemisphere = ground.latd()<0.0?'S':'N';
+   setHemisphere(hemisphere);
+}
+
+void ossimUtmProjection::setHemisphere(char hemisphere)
+{
+   hemisphere = toupper(hemisphere);
+   if((hemisphere != 'N') &&
+      (hemisphere != 'S'))
+   {
+      theHemisphere = theOrigin.latd() < 0?'S':'N';
+   }
+   else
+   {
+      theHemisphere = hemisphere;
+   }
+
+   if (theHemisphere == 'N')
+   {
+      theTranMerc_False_Northing = 0.0;
+   }
+   else
+   {
+      theTranMerc_False_Northing  = 10000000.0;
+   }
+}
+
+ossim_int32 ossimUtmProjection::computeZone(const ossimGpt& ground)
+{
+   ossim_int32 result = 0;
+
+   double longitude = ground.lonr();
+   double lat_Degrees  = (ossim_int32)( (ground.latd()) + 0.00000005);
+   double long_Degrees = (ossim_int32)( (ground.lond()) + 0.00000005);
+   
+   if (longitude < M_PI)
+      result = (ossim_int32)( (31 + ((180 * longitude) / (6 * M_PI)) ) + 0.00000005);
+   else
+      result = (ossim_int32)( (((180 * longitude) / (6 * M_PI)) - 29) + 0.00000005);
+   if (result > 60)
+      result = 1;
+    /* UTM special cases */
+   if ((lat_Degrees > 55) && (lat_Degrees < 64) && (long_Degrees > -1)
+       && (long_Degrees < 3))
+      result = 31;
+   if ((lat_Degrees > 55) && (lat_Degrees < 64) && (long_Degrees > 2)
+       && (long_Degrees < 12))
+      result = 32;
+   if ((lat_Degrees > 71) && (long_Degrees > -1) && (long_Degrees < 9))
+      result = 31;
+   if ((lat_Degrees > 71) && (long_Degrees > 8) && (long_Degrees < 21))
+      result = 33;
+   if ((lat_Degrees > 71) && (long_Degrees > 20) && (long_Degrees < 33))
+      result = 35;
+   if ((lat_Degrees > 71) && (long_Degrees > 32) && (long_Degrees < 42))
+      result = 37;
+
+   return result;
+}
+
+double ossimUtmProjection::computeZoneMeridian(ossim_int32 zone)
+{
+   return (6.0 * zone - 183.0);;
+}
+
+bool ossimUtmProjection::loadState(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   const char* zone       = kwl.find(prefix, ossimKeywordNames::ZONE_KW);
+   const char* hemisphere = kwl.find(prefix, ossimKeywordNames::HEMISPHERE_KW);
+
+   ossimMapProjection::loadState(kwl, prefix);
+
+   // initialize zone to a dummy value.
+   //
+   theZone = 0;
+//   if(ossimString(type) == STATIC_TYPE_NAME(ossimUtmProjection))
+   {
+      if(!zone)
+      {
+         theZone = computeZone(theOrigin);
+      }
+      else if (zone) 
+      {
+         theZone = atoi(zone);
+
+         if( (theZone  < 1) || (theZone > 60) )
+         {
+            theZone = computeZone(theOrigin);
+         }
+         else
+         {
+//            if(!kwl.find(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW))
+//            {
+               theOrigin.lond(computeZoneMeridian(theZone));
+//            }
+//            if(!kwl.find(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW))
+//            {
+               theOrigin.latd(0);
+//            }
+         }
+      }
+      if (hemisphere)
+      {
+         ossimString s = hemisphere;
+         s = s.trim();
+         s = s.upcase();
+         
+         setHemisphere(*s.c_str());
+      }
+      else
+      {
+         char hemisphere = theOrigin.latd()<0?'S':'N';
+         setHemisphere(hemisphere);
+      }
+   }
+
+   update();
+   
+   return true;
+}
+
+bool ossimUtmProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::ZONE_KW,
+           theZone,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::HEMISPHERE_KW,
+           theHemisphere,
+           true);
+   
+   return ossimMapProjection::saveState(kwl, prefix);
+}
+   
+ossim_int32 ossimUtmProjection::Set_Transverse_Mercator_Parameters(double a,
+                                                                   double f,
+                                                                   double Origin_Latitude,
+                                                                   double Central_Meridian,
+                                                                   double False_Easting,
+                                                                   double False_Northing,
+                                                                   double /* Scale_Factor */)
+
+{ /* BEGIN Set_Tranverse_Mercator_Parameters */
+  /*
+   * The function Set_Tranverse_Mercator_Parameters receives the ellipsoid
+   * parameters and Tranverse Mercator projection parameters as inputs, and
+   * sets the corresponding state variables. If any errors occur, the error
+   * code(s) are returned by the function, otherwise UTM_NO_ERROR is
+   * returned.
+   *
+   *    a                 : Semi-major axis of ellipsoid, in meters    (input)
+   *    f                 : Flattening of ellipsoid						         (input)
+   *    Origin_Latitude   : Latitude in radians at the origin of the   (input)
+   *                         projection
+   *    Central_Meridian  : Longitude in radians at the center of the  (input)
+   *                         projection
+   *    False_Easting     : Easting/X at the center of the projection  (input)
+   *    False_Northing    : Northing/Y at the center of the projection (input)
+   *    Scale_Factor      : Projection scale factor                    (input) 
+   */
+
+  double tn;        /* True Meridianal distance constant  */
+  double tn2;
+  double tn3;
+  double tn4;
+  double tn5;
+  double dummy_northing;
+  double TranMerc_b; /* Semi-minor axis of ellipsoid, in meters */
+//  double inv_f = 1 / f;
+  ossim_int32 Error_Code = UTM_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= UTM_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= UTM_INV_F_ERROR;
+//   }
+//   if ((Origin_Latitude < -MAX_LAT) || (Origin_Latitude > MAX_LAT))
+//   { /* origin latitude out of range */
+//     Error_Code |= UTM_ORIGIN_LAT_ERROR;
+//   }
+//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= UTM_CENT_MER_ERROR;
+//   }
+//   if ((Scale_Factor < MIN_SCALE_FACTOR) || (Scale_Factor > MAX_SCALE_FACTOR))
+//   {
+//     Error_Code |= UTM_SCALE_FACTOR_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    theTranMerc_a = a;
+    theTranMerc_f = f;
+    theTranMerc_Origin_Lat = 0;
+    theTranMerc_Origin_Long = 0;
+    theTranMerc_False_Northing = 0;
+    theTranMerc_False_Easting = 0; 
+    // theTranMerc_Scale_Factor = 1;
+
+    /* Eccentricity Squared */
+    theTranMerc_es = 2 * theTranMerc_f - theTranMerc_f * theTranMerc_f;
+    /* Second Eccentricity Squared */
+    theTranMerc_ebs = (1 / (1 - theTranMerc_es)) - 1;
+
+    TranMerc_b = theTranMerc_a * (1 - theTranMerc_f);    
+    /*True meridianal constants  */
+    tn = (theTranMerc_a - TranMerc_b) / (theTranMerc_a + TranMerc_b);
+    tn2 = tn * tn;
+    tn3 = tn2 * tn;
+    tn4 = tn3 * tn;
+    tn5 = tn4 * tn;
+
+    theTranMerc_ap = theTranMerc_a * (1.e0 - tn + 5.e0 * (tn2 - tn3)/4.e0
+                                + 81.e0 * (tn4 - tn5)/64.e0 );
+    theTranMerc_bp = 3.e0 * theTranMerc_a * (tn - tn2 + 7.e0 * (tn3 - tn4)
+                                       /8.e0 + 55.e0 * tn5/64.e0 )/2.e0;
+    theTranMerc_cp = 15.e0 * theTranMerc_a * (tn2 - tn3 + 3.e0 * (tn4 - tn5 )/4.e0) /16.0;
+    theTranMerc_dp = 35.e0 * theTranMerc_a * (tn3 - tn4 + 11.e0 * tn5 / 16.e0) / 48.e0;
+    theTranMerc_ep = 315.e0 * theTranMerc_a * (tn4 - tn5) / 512.e0;
+    Convert_Geodetic_To_Transverse_Mercator(MAX_LAT,
+                                            MAX_DELTA_LONG,
+                                            &theTranMerc_Delta_Easting,
+                                            &theTranMerc_Delta_Northing);
+    Convert_Geodetic_To_Transverse_Mercator(0,
+                                            MAX_DELTA_LONG,
+                                            &theTranMerc_Delta_Easting,
+                                            &dummy_northing);
+    theTranMerc_Origin_Lat = Origin_Latitude;
+    if (Central_Meridian > M_PI)
+      Central_Meridian -= TWO_PI;
+    theTranMerc_Origin_Long = Central_Meridian;
+    theTranMerc_False_Northing = False_Northing;
+    theTranMerc_False_Easting = False_Easting; 
+    // theTranMerc_Scale_Factor = Scale_Factor;
+  } /* END OF if(!Error_Code) */
+  return (Error_Code);
+}  /* END of Set_Transverse_Mercator_Parameters  */
+
+
+void ossimUtmProjection::Get_Transverse_Mercator_Parameters(double *a,
+                                                                      double *f,
+                                                                      double *Origin_Latitude,
+                                                                      double *Central_Meridian,
+                                                                      double *False_Easting,
+                                                                      double *False_Northing,
+                                                                      double *Scale_Factor)const
+
+{ /* BEGIN Get_Tranverse_Mercator_Parameters  */
+  /*
+   * The function Get_Transverse_Mercator_Parameters returns the current
+   * ellipsoid and Transverse Mercator projection parameters.
+   *
+   *    a                 : Semi-major axis of ellipsoid, in meters    (output)
+   *    f                 : Flattening of ellipsoid						         (output)
+   *    Origin_Latitude   : Latitude in radians at the origin of the   (output)
+   *                         projection
+   *    Central_Meridian  : Longitude in radians at the center of the  (output)
+   *                         projection
+   *    False_Easting     : Easting/X at the center of the projection  (output)
+   *    False_Northing    : Northing/Y at the center of the projection (output)
+   *    Scale_Factor      : Projection scale factor                    (output) 
+   */
+
+  *a = theTranMerc_a;
+  *f = theTranMerc_f;
+  *Origin_Latitude = theTranMerc_Origin_Lat;
+  *Central_Meridian = theTranMerc_Origin_Long;
+  *False_Easting = theTranMerc_False_Easting;
+  *False_Northing = theTranMerc_False_Northing;
+  *Scale_Factor = theTranMerc_Scale_Factor;
+  
+  return;
+} /* END OF Get_Tranverse_Mercator_Parameters */
+
+
+
+ossim_int32 ossimUtmProjection::Convert_Geodetic_To_Transverse_Mercator (double Latitude,
+                                                                            double Longitude,
+                                                                            double *Easting,
+                                                                            double *Northing)const
+   
+{      /* BEGIN Convert_Geodetic_To_Transverse_Mercator */
+
+  /*
+   * The function Convert_Geodetic_To_Transverse_Mercator converts geodetic
+   * (latitude and longitude) coordinates to Transverse Mercator projection
+   * (easting and northing) coordinates, according to the current ellipsoid
+   * and Transverse Mercator projection coordinates.  If any errors occur, the
+   * error code(s) are returned by the function, otherwise UTM_NO_ERROR is
+   * returned.
+   *
+   *    Latitude      : Latitude in radians                         (input)
+   *    Longitude     : Longitude in radians                        (input)
+   *    Easting       : Easting/X in meters                         (output)
+   *    Northing      : Northing/Y in meters                        (output)
+   */
+
+  double c;       /* Cosine of latitude                          */
+  double c2;
+  double c3;
+  double c5;
+  double c7;
+  double dlam;    /* Delta longitude - Difference in Longitude       */
+  double eta;     /* constant - theTranMerc_ebs *c *c                   */
+  double eta2;
+  double eta3;
+  double eta4;
+  double s;       /* Sine of latitude                        */
+  double sn;      /* Radius of curvature in the prime vertical       */
+  double t;       /* Tangent of latitude                             */
+  double tan2;
+  double tan3;
+  double tan4;
+  double tan5;
+  double tan6;
+  double t1;      /* Term in coordinate conversion formula - GP to Y */
+  double t2;      /* Term in coordinate conversion formula - GP to Y */
+  double t3;      /* Term in coordinate conversion formula - GP to Y */
+  double t4;      /* Term in coordinate conversion formula - GP to Y */
+  double t5;      /* Term in coordinate conversion formula - GP to Y */
+  double t6;      /* Term in coordinate conversion formula - GP to Y */
+  double t7;      /* Term in coordinate conversion formula - GP to Y */
+  double t8;      /* Term in coordinate conversion formula - GP to Y */
+  double t9;      /* Term in coordinate conversion formula - GP to Y */
+  double tmd;     /* True Meridional distance                        */
+  double tmdo;    /* True Meridional distance for latitude of origin */
+  ossim_int32    Error_Code = UTM_NO_ERROR;
+//  double temp_Origin;
+//  double temp_Long;
+
+//   if ((Latitude < -MAX_LAT) || (Latitude > MAX_LAT))
+//   {  /* Latitude out of range */
+//     Error_Code|= UTM_LAT_ERROR;
+//   }
+   if (Longitude > M_PI)
+     Longitude -= TWO_PI;
+//   if ((Longitude < (theTranMerc_Origin_Long - MAX_DELTA_LONG))
+//       || (Longitude > (theTranMerc_Origin_Long + MAX_DELTA_LONG)))
+//   {
+//     if (Longitude < 0)
+//       temp_Long = Longitude + TWO_PI;
+//     else
+//       temp_Long = Longitude;
+//     if (theTranMerc_Origin_Long < 0)
+//       temp_Origin = theTranMerc_Origin_Long + TWO_PI;
+//     else
+//       temp_Origin = theTranMerc_Origin_Long;
+//     if ((temp_Long < (temp_Origin - MAX_DELTA_LONG))
+//         || (temp_Long > (temp_Origin + MAX_DELTA_LONG)))
+//       Error_Code|= UTM_LON_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+
+    /* 
+     *  Delta Longitude
+     */
+    dlam = Longitude - theTranMerc_Origin_Long;
+
+//     if (fabs(dlam) > (9.0 * M_PI / 180))
+//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
+//       Error_Code |= UTM_LON_WARNING;
+//     }
+
+     if (dlam > M_PI)
+       dlam -= TWO_PI;
+     if (dlam < -M_PI)
+       dlam += TWO_PI;
+     if (fabs(dlam) < 2.e-10)
+       dlam = 0.0;
+
+    s = sin(Latitude);
+    c = cos(Latitude);
+    c2 = c * c;
+    c3 = c2 * c;
+    c5 = c3 * c2;
+    c7 = c5 * c2;
+    t = tan (Latitude);
+    tan2 = t * t;
+    tan3 = tan2 * t;
+    tan4 = tan3 * t;
+    tan5 = tan4 * t;
+    tan6 = tan5 * t;
+    eta = theTranMerc_ebs * c2;
+    eta2 = eta * eta;
+    eta3 = eta2 * eta;
+    eta4 = eta3 * eta;
+
+    /* radius of curvature in prime vertical */
+    sn = SPHSN(Latitude);
+
+    /* True Meridianal Distances */
+    tmd = SPHTMD(Latitude);
+
+    /*  Origin  */
+    tmdo = SPHTMD (theTranMerc_Origin_Lat);
+
+    /* northing */
+    t1 = (tmd - tmdo) * theTranMerc_Scale_Factor;
+    t2 = sn * s * c * theTranMerc_Scale_Factor/ 2.e0;
+    t3 = sn * s * c3 * theTranMerc_Scale_Factor * (5.e0 - tan2 + 9.e0 * eta 
+                                                + 4.e0 * eta2) /24.e0; 
+
+    t4 = sn * s * c5 * theTranMerc_Scale_Factor * (61.e0 - 58.e0 * tan2
+                                                + tan4 + 270.e0 * eta - 330.e0 * tan2 * eta + 445.e0 * eta2
+                                                + 324.e0 * eta3 -680.e0 * tan2 * eta2 + 88.e0 * eta4 
+                                                -600.e0 * tan2 * eta3 - 192.e0 * tan2 * eta4) / 720.e0;
+
+    t5 = sn * s * c7 * theTranMerc_Scale_Factor * (1385.e0 - 3111.e0 * 
+                                                tan2 + 543.e0 * tan4 - tan6) / 40320.e0;
+
+    *Northing = theTranMerc_False_Northing + t1 + pow(dlam,2.e0) * t2
+                + pow(dlam,4.e0) * t3 + pow(dlam,6.e0) * t4
+                + pow(dlam,8.e0) * t5; 
+
+    /* Easting */
+    t6 = sn * c * theTranMerc_Scale_Factor;
+    t7 = sn * c3 * theTranMerc_Scale_Factor * (1.e0 - tan2 + eta ) /6.e0;
+    t8 = sn * c5 * theTranMerc_Scale_Factor * (5.e0 - 18.e0 * tan2 + tan4
+                                            + 14.e0 * eta - 58.e0 * tan2 * eta + 13.e0 * eta2 + 4.e0 * eta3 
+                                            - 64.e0 * tan2 * eta2 - 24.e0 * tan2 * eta3 )/ 120.e0;
+    t9 = sn * c7 * theTranMerc_Scale_Factor * ( 61.e0 - 479.e0 * tan2
+                                             + 179.e0 * tan4 - tan6 ) /5040.e0;
+
+    *Easting = theTranMerc_False_Easting + dlam * t6 + pow(dlam,3.e0) * t7 
+               + pow(dlam,5.e0) * t8 + pow(dlam,7.e0) * t9;
+  }
+  return (Error_Code);
+} /* END OF Convert_Geodetic_To_Transverse_Mercator */
+
+
+ossim_int32 ossimUtmProjection::Convert_Transverse_Mercator_To_Geodetic (double Easting,
+                                                                            double Northing,
+                                                                            double *Latitude,
+                                                                            double *Longitude)const
+{      /* BEGIN Convert_Transverse_Mercator_To_Geodetic */
+
+  /*
+   * The function Convert_Transverse_Mercator_To_Geodetic converts Transverse
+   * Mercator projection (easting and northing) coordinates to geodetic
+   * (latitude and longitude) coordinates, according to the current ellipsoid
+   * and Transverse Mercator projection parameters.  If any errors occur, the
+   * error code(s) are returned by the function, otherwise UTM_NO_ERROR is
+   * returned.
+   *
+   *    Easting       : Easting/X in meters                         (input)
+   *    Northing      : Northing/Y in meters                        (input)
+   *    Latitude      : Latitude in radians                         (output)
+   *    Longitude     : Longitude in radians                        (output)
+   */
+
+  double c;       /* Cosine of latitude                          */
+  double de;      /* Delta easting - Difference in Easting (Easting-Fe)    */
+  double dlam;    /* Delta longitude - Difference in Longitude       */
+  double eta;     /* constant - theTranMerc_ebs *c *c                   */
+  double eta2;
+  double eta3;
+  double eta4;
+  double ftphi;   /* Footpoint latitude                              */
+  int    i;       /* Loop iterator                   */
+  /*double s;        Sine of latitude                        */
+  double sn;      /* Radius of curvature in the prime vertical       */
+  double sr;      /* Radius of curvature in the meridian             */
+  double t;       /* Tangent of latitude                             */
+  double tan2;
+  double tan4;
+  double t10;     /* Term in coordinate conversion formula - GP to Y */
+  double t11;     /* Term in coordinate conversion formula - GP to Y */
+  double t12;     /* Term in coordinate conversion formula - GP to Y */
+  double t13;     /* Term in coordinate conversion formula - GP to Y */
+  double t14;     /* Term in coordinate conversion formula - GP to Y */
+  double t15;     /* Term in coordinate conversion formula - GP to Y */
+  double t16;     /* Term in coordinate conversion formula - GP to Y */
+  double t17;     /* Term in coordinate conversion formula - GP to Y */
+  double tmd;     /* True Meridional distance                        */
+  double tmdo;    /* True Meridional distance for latitude of origin */
+  ossim_int32 Error_Code = UTM_NO_ERROR;
+
+//   if ((Easting < (theTranMerc_False_Easting - theTranMerc_Delta_Easting))
+//       ||(Easting > (theTranMerc_False_Easting + theTranMerc_Delta_Easting)))
+//   { /* Easting out of range  */
+//     Error_Code |= UTM_EASTING_ERROR;
+//   }
+//   if ((Northing < (theTranMerc_False_Northing - theTranMerc_Delta_Northing))
+//       || (Northing > (theTranMerc_False_Northing + theTranMerc_Delta_Northing)))
+//   { /* Northing out of range */
+//     Error_Code |= UTM_NORTHING_ERROR;
+//   }
+
+  if (!Error_Code)
+  {
+    /* True Meridional Distances for latitude of origin */
+    tmdo = SPHTMD(theTranMerc_Origin_Lat);
+
+    /*  Origin  */
+    tmd = tmdo +  (Northing - theTranMerc_False_Northing) / theTranMerc_Scale_Factor; 
+
+    /* First Estimate */
+    sr = SPHSR(0.e0);
+    ftphi = tmd/sr;
+
+    for (i = 0; i < 5 ; i++)
+    {
+      t10 = SPHTMD (ftphi);
+      sr = SPHSR(ftphi);
+      ftphi = ftphi + (tmd - t10) / sr;
+    }
+
+    /* Radius of Curvature in the meridian */
+    sr = SPHSR(ftphi);
+
+    /* Radius of Curvature in the meridian */
+    sn = SPHSN(ftphi);
+
+    /* Sine Cosine terms */
+    // s = sin(ftphi);
+    c = cos(ftphi);
+
+    /* Tangent Value  */
+    t = tan(ftphi);
+    tan2 = t * t;
+    tan4 = tan2 * tan2;
+    eta = theTranMerc_ebs * pow(c,2);
+    eta2 = eta * eta;
+    eta3 = eta2 * eta;
+    eta4 = eta3 * eta;
+    de = Easting - theTranMerc_False_Easting;
+    if (fabs(de) < 0.0001)
+      de = 0.0;
+
+    /* Latitude */
+    t10 = t / (2.e0 * sr * sn * pow(theTranMerc_Scale_Factor, 2));
+    t11 = t * (5.e0  + 3.e0 * tan2 + eta - 4.e0 * pow(eta,2)
+               - 9.e0 * tan2 * eta) / (24.e0 * sr * pow(sn,3) 
+                                       * pow(theTranMerc_Scale_Factor,4));
+    t12 = t * (61.e0 + 90.e0 * tan2 + 46.e0 * eta + 45.E0 * tan4
+               - 252.e0 * tan2 * eta  - 3.e0 * eta2 + 100.e0 
+               * eta3 - 66.e0 * tan2 * eta2 - 90.e0 * tan4
+               * eta + 88.e0 * eta4 + 225.e0 * tan4 * eta2
+               + 84.e0 * tan2* eta3 - 192.e0 * tan2 * eta4)
+          / ( 720.e0 * sr * pow(sn,5) * pow(theTranMerc_Scale_Factor, 6) );
+    t13 = t * ( 1385.e0 + 3633.e0 * tan2 + 4095.e0 * tan4 + 1575.e0 
+                * pow(t,6))/ (40320.e0 * sr * pow(sn,7) * pow(theTranMerc_Scale_Factor,8));
+    *Latitude = ftphi - pow(de,2) * t10 + pow(de,4) * t11 - pow(de,6) * t12 
+                + pow(de,8) * t13;
+
+    t14 = 1.e0 / (sn * c * theTranMerc_Scale_Factor);
+
+    t15 = (1.e0 + 2.e0 * tan2 + eta) / (6.e0 * pow(sn,3) * c * 
+                                        pow(theTranMerc_Scale_Factor,3));
+
+    t16 = (5.e0 + 6.e0 * eta + 28.e0 * tan2 - 3.e0 * eta2
+           + 8.e0 * tan2 * eta + 24.e0 * tan4 - 4.e0 
+           * eta3 + 4.e0 * tan2 * eta2 + 24.e0 
+           * tan2 * eta3) / (120.e0 * pow(sn,5) * c  
+                             * pow(theTranMerc_Scale_Factor,5));
+
+    t17 = (61.e0 +  662.e0 * tan2 + 1320.e0 * tan4 + 720.e0 
+           * pow(t,6)) / (5040.e0 * pow(sn,7) * c 
+                          * pow(theTranMerc_Scale_Factor,7));
+
+    /* Difference in Longitude */
+    dlam = de * t14 - pow(de,3) * t15 + pow(de,5) * t16 - pow(de,7) * t17;
+
+    /* Longitude */
+    (*Longitude) = theTranMerc_Origin_Long + dlam;
+    while (*Latitude > (90.0 * RAD_PER_DEG))
+    {
+      *Latitude = M_PI - *Latitude;
+      *Longitude += M_PI;
+      if (*Longitude > M_PI)
+        *Longitude -= TWO_PI;
+    }
+
+     while (*Latitude < (-90.0 * RAD_PER_DEG))
+     {
+       *Latitude = - (*Latitude + M_PI);
+       *Longitude += M_PI;
+       if (*Longitude > M_PI)
+         *Longitude -= TWO_PI;
+     }
+     if (*Longitude > TWO_PI)
+       *Longitude -= TWO_PI;
+     if (*Longitude < -M_PI)
+       *Longitude += TWO_PI;
+
+//     if (fabs(dlam) > (9.0 * M_PI / 180))
+//     { /* Distortion will result if Longitude is more than 9 degrees from the Central Meridian */
+//       Error_Code |= UTM_LON_WARNING;
+//     }
+  }
+  return (Error_Code);
+} /* END OF Convert_Transverse_Mercator_To_Geodetic */
+
+std::ostream& ossimUtmProjection::print(std::ostream& out) const
+{
+   out << setiosflags(ios::fixed) << setprecision(15)
+       << "// ossimUtmProjection::print"
+       << "\ntheZone:  " << theZone
+       << "\ntheHemisphere:  " << theHemisphere
+       << endl;
+   return ossimMapProjection::print(out);
+}
+
+double ossimUtmProjection::getFalseEasting() const
+{
+   return theTranMerc_False_Easting;
+}
+
+double ossimUtmProjection::getFalseNorthing() const
+{
+   return theTranMerc_False_Northing;
+}
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimUtmProjection::operator==(const ossimProjection& proj) const
+{
+   bool result = false;
+   if ( this == &proj )
+   {
+      result = true; // Pointer addresses the same.
+   }
+   else
+   {
+      //---
+      // Check our stuff first.  No sense going onto ossimMapProjection::operator==
+      // if we are not a utm projection.
+      //---
+      const ossimUtmProjection* p = dynamic_cast<const ossimUtmProjection*>(&proj);
+      if ( p )
+      {
+         if ( theZone == p->theZone )
+         {
+            if ( theHemisphere == p->theHemisphere )
+            {
+               result = ossimMapProjection::operator==(proj);
+            }
+         }
+      }
+   }
+   return result;   
+}
+
+ossim_uint32 ossimUtmProjection::getPcsCode() const
+{
+   // Always recompute in case origin, zone, or hemisphere were changed.
+   return ossimEpsgProjectionDatabase::instance()->getCodeFromUtmProj( this );
+}
+
diff --git a/src/projection/ossimUtmpt.cpp b/src/projection/ossimUtmpt.cpp
new file mode 100644
index 0000000..f9d5c20
--- /dev/null
+++ b/src/projection/ossimUtmpt.cpp
@@ -0,0 +1,88 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// This is the Universal Transverse Mercator (UTM) point.  Allows
+// easy onversion between different coordinates.
+//*******************************************************************
+//  $Id: ossimUtmpt.cpp 10058 2006-12-08 20:04:23Z mlucas $
+
+#include <ossim/projection/ossimUtmpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/projection/ossimUtm.h>
+
+ossimUtmpt::ossimUtmpt(const ossimGpt &aPt)
+{
+   convertFromGround(aPt);
+}
+
+ossimUtmpt::ossimUtmpt(const ossimEcefPoint &aPt)
+{
+   convertFromGround(ossimGpt(aPt));
+}
+
+ossimUtmpt::ossimUtmpt(long         zone,
+                       char         hemisphere,  // N or S
+                       double       easting,
+                       double       northing,
+                       const ossimDatum* datum)
+   :
+      theZone       (zone),
+      theHemisphere (hemisphere),
+      theEasting    (easting),
+      theNorthing   (northing),
+      theDatum      (datum)
+{}
+
+void ossimUtmpt::convertFromGround(const ossimGpt &aPt)
+{
+   const ossimDatum *aDatum = aPt.datum();
+
+   if(aDatum)
+   {
+      //call Geotrans init code
+      Set_UTM_Parameters(aDatum->ellipsoid()->a(), aDatum->ellipsoid()->flattening(), 0);
+      Convert_Geodetic_To_UTM(aPt.latr(),
+                              aPt.lonr(),
+                              &theZone,
+                              &theHemisphere,
+                              &theEasting,
+                              &theNorthing);
+      theDatum = aDatum;
+   }
+   else
+   {
+      //ERROR: Should never happen
+   }
+}
+
+void ossimUtmpt::convertToGround(ossimGpt &aPt)
+{
+   Set_UTM_Parameters( theDatum->ellipsoid()->a(),
+                       theDatum->ellipsoid()->flattening(),
+                       0 );
+   
+   double latitude  = 0.0;
+   double longitude = 0.0;
+
+   Convert_UTM_To_Geodetic( zone(),
+                            hemisphere(),
+                            easting(),
+                            northing(),
+                            &latitude,
+                            &longitude );
+
+   aPt.latr(latitude);
+   aPt.lonr(longitude);
+   aPt.datum(theDatum);
+}
diff --git a/src/projection/ossimVanDerGrintenProjection.cpp b/src/projection/ossimVanDerGrintenProjection.cpp
new file mode 100644
index 0000000..a4360b7
--- /dev/null
+++ b/src/projection/ossimVanDerGrintenProjection.cpp
@@ -0,0 +1,525 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  See top LICENSE.txt file.
+//
+// Author:  Garrett Potts
+//
+// Description:
+//
+// Calls Grinten projection code.  
+//*******************************************************************
+//  $Id: ossimVanDerGrintenProjection.cpp 17815 2010-08-03 13:23:14Z dburken $
+#include <ossim/projection/ossimVanDerGrintenProjection.h>
+#include <ossim/base/ossimKeywordNames.h>
+
+RTTI_DEF1(ossimVanDerGrintenProjection, "ossimVanDerGrintenProjection", ossimMapProjection)
+   
+/***************************************************************************/
+/*
+ *                               DEFINES
+ */
+
+#ifndef PI_OVER_2
+#  define PI_OVER_2  ( M_PI / 2.0)
+#endif
+#ifndef TWO_PI
+#  define TWO_PI     (2.0 * M_PI)
+#endif
+
+#define MAX_LAT     ( 90.0 * (M_PI / 180.0) )  /* 90 degrees in radians   */
+#define FLOAT_EQ(x,v,epsilon)   (((v - epsilon) < x) && (x < (v + epsilon)))
+
+#define GRIN_NO_ERROR           0x0000
+#define GRIN_LAT_ERROR          0x0001
+#define GRIN_LON_ERROR          0x0002
+#define GRIN_EASTING_ERROR      0x0004
+#define GRIN_NORTHING_ERROR     0x0008
+#define GRIN_CENT_MER_ERROR     0x0020
+#define GRIN_A_ERROR            0x0040
+#define GRIN_B_ERROR            0x0080
+#define GRIN_A_LESS_B_ERROR     0x0100
+#define GRIN_RADIUS_ERROR		  0x0200
+
+/***************************************************************************/
+/*
+ *                               GLOBALS
+ */
+
+const double TWO_OVER_PI = (2.0 / M_PI);
+const double PI_OVER_3 = (M_PI / 3.0);
+const double ONE_THIRD  = (1.0 / 3.0);
+
+
+ossimVanDerGrintenProjection::ossimVanDerGrintenProjection(const ossimEllipsoid& ellipsoid,
+                                                           const ossimGpt& origin)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   setDefaults();
+   update();
+}
+
+ossimVanDerGrintenProjection::ossimVanDerGrintenProjection(const ossimEllipsoid& ellipsoid,
+                                                   const ossimGpt& origin,
+                                                   double falseEasting,
+                                                   double falseNorthing)
+   :ossimMapProjection(ellipsoid, origin)
+{
+   Grin_False_Easting  = falseEasting;
+   Grin_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimVanDerGrintenProjection::update()
+{   
+   Set_Van_der_Grinten_Parameters(theEllipsoid.getA(),
+                                  theEllipsoid.getFlattening(),
+                                  theOrigin.lonr(),
+                                  Grin_False_Easting,
+                                  Grin_False_Northing);
+
+   theFalseEastingNorthing.x = Grin_False_Easting;
+   theFalseEastingNorthing.y = Grin_False_Northing;
+
+   ossimMapProjection::update();
+}
+
+void ossimVanDerGrintenProjection::setFalseEasting(double falseEasting)
+{
+   Grin_False_Easting = falseEasting;
+   
+   update();
+}
+
+void ossimVanDerGrintenProjection::setFalseNorthing(double falseNorthing)
+{
+   Grin_False_Northing = falseNorthing;
+   
+   update();
+}
+
+void ossimVanDerGrintenProjection::setDefaults()
+{
+   Grin_False_Easting  = 0.0;
+   Grin_False_Northing = 0.0;
+}
+
+void ossimVanDerGrintenProjection::setCentralMeridian(double centralMeridian)
+{
+  Grin_Origin_Long = centralMeridian;
+  update();
+}
+
+void ossimVanDerGrintenProjection::setFalseEastingNorthing(double falseEasting,
+                                                           double falseNorthing)
+{
+   Grin_False_Easting  = falseEasting;
+   Grin_False_Northing = falseNorthing;
+   
+   update();
+}
+
+ossimGpt ossimVanDerGrintenProjection::inverse(const ossimDpt &eastingNorthing)const
+{
+   double lat = 0.0;
+   double lon = 0.0;
+   
+   Convert_Van_der_Grinten_To_Geodetic(eastingNorthing.x,
+                                       eastingNorthing.y,
+                                       &lat,
+                                       &lon);
+   
+   return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);  
+}
+
+ossimDpt ossimVanDerGrintenProjection::forward(const ossimGpt &latLon)const
+{
+   double easting  = 0.0;
+   double northing = 0.0;
+   ossimGpt gpt = latLon;
+   
+   if (theDatum)
+   {
+      if (theDatum->code() != latLon.datum()->code())
+      {
+         gpt.changeDatum(theDatum); // Shift to our datum.
+      }
+   }
+
+   Convert_Geodetic_To_Van_der_Grinten(gpt.latr(),
+                                       gpt.lonr(),
+                                       &easting,
+                                       &northing);
+   return ossimDpt(easting, northing);
+}
+
+bool ossimVanDerGrintenProjection::saveState(ossimKeywordlist& kwl, const char* prefix) const
+{
+   return ossimMapProjection::saveState(kwl, prefix);   
+}
+
+bool ossimVanDerGrintenProjection::loadState(const ossimKeywordlist& kwl,
+                                             const char* prefix)
+{
+   bool flag = ossimMapProjection::loadState(kwl, prefix);
+   const char* type          = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   
+   setDefaults();
+
+   if(ossimString(type) == STATIC_TYPE_NAME(ossimVanDerGrintenProjection))
+   {
+      Grin_False_Easting  = theFalseEastingNorthing.x;
+      Grin_False_Northing = theFalseEastingNorthing.y;
+   }
+   
+   update();
+
+   return flag;
+
+}
+
+/***************************************************************************/
+/*
+ *                              FUNCTIONS
+ */
+
+
+long ossimVanDerGrintenProjection::Set_Van_der_Grinten_Parameters(double a,
+                                                                  double f,
+                                                                  double Central_Meridian,
+                                                                  double False_Easting,
+                                                                  double False_Northing)
+
+{ /* BEGIN Set_Van_der_Grinten_Parameters */
+/*
+ * The function Set_Van_der_Grinten_Parameters receives the ellipsoid parameters and
+ * projection parameters as inputs, and sets the corresponding state
+ * variables.  If any errors occur, the error code(s) are returned by the function, 
+ * otherwise Grin_NO_ERROR is returned.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (input)
+ *    f                 : Flattening of ellipsoid							      (input)
+ *    Central_Meridian  : Longitude in radians at the center of     (input)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (input)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (input)
+ */
+
+//  double inv_f = 1 / f;
+  long Error_Code = GRIN_NO_ERROR;
+
+//   if (a <= 0.0)
+//   { /* Semi-major axis must be greater than zero */
+//     Error_Code |= GRIN_A_ERROR;
+//   }
+//   if ((inv_f < 250) || (inv_f > 350))
+//   { /* Inverse flattening must be between 250 and 350 */
+//     Error_Code |= GRIN_INV_F_ERROR;
+//   }
+//   if ((Central_Meridian < -M_PI) || (Central_Meridian > TWO_PI))
+//   { /* origin longitude out of range */
+//     Error_Code |= GRIN_CENT_MER_ERROR;
+//   }
+  if (!Error_Code)
+  { /* no errors */
+    Grin_a = a;
+    Grin_f = f;
+    es2 = 2 * Grin_f - Grin_f * Grin_f;
+    es4 = es2 * es2;
+    es6 = es4 * es2;
+    /* spherical radius */
+    Ra = Grin_a * (1.0 - es2 / 6.0 - 17.0 * es4 / 360.0 - 67.0 * es6 /3024.0);
+    PI_Ra = M_PI * Ra;
+//     if (Central_Meridian > M_PI)
+//       Central_Meridian -= TWO_PI;
+    Grin_Origin_Long    = Central_Meridian;
+    Grin_False_Easting  = False_Easting;
+    Grin_False_Northing = False_Northing;
+
+  } /* END OF if(!Error_Code) */
+  return (Error_Code);
+} /* END OF Set_Van_der_Grinten_Parameters */
+
+
+void ossimVanDerGrintenProjection::Get_Van_der_Grinten_Parameters(double *a,
+                                                                  double *f,
+                                                                  double *Central_Meridian,
+                                                                  double *False_Easting,
+                                                                  double *False_Northing)const
+
+{ /* BEGIN Get_Van_der_Grinten_Parameters */
+/*
+ * The function Get_Van_der_Grinten_Parameters returns the current ellipsoid
+ * parameters, and Van Der Grinten projection parameters.
+ *
+ *    a                 : Semi-major axis of ellipsoid, in meters   (output)
+ *    f                 : Flattening of ellipsoid						        (output)
+ *    Central_Meridian  : Longitude in radians at the center of     (output)
+ *                          the projection
+ *    False_Easting     : A coordinate value in meters assigned to the
+ *                          central meridian of the projection.     (output)
+ *    False_Northing    : A coordinate value in meters assigned to the
+ *                          origin latitude of the projection       (output)
+ */
+
+  *a = Grin_a;
+  *f = Grin_f;
+  *Central_Meridian = Grin_Origin_Long;
+  *False_Easting = Grin_False_Easting;
+  *False_Northing = Grin_False_Northing;
+  
+  return;
+} /* END OF Get_Van_der_Grinten_Parameters */
+
+
+long ossimVanDerGrintenProjection::Convert_Geodetic_To_Van_der_Grinten (double Latitude,
+                                                                        double Longitude,
+                                                                        double *Easting,
+                                                                        double *Northing)const
+
+{ /* BEGIN Convert_Geodetic_To_Van_der_Grinten */
+/*
+ * The function Convert_Geodetic_To_Van_der_Grinten converts geodetic (latitude and
+ * longitude) coordinates to Van Der Grinten projection (easting and northing)
+ * coordinates, according to the current ellipsoid and Van Der Grinten projection
+ * parameters.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise GRIN_NO_ERROR is returned.
+ *
+ *    Latitude          : Latitude (phi) in radians           (input)
+ *    Longitude         : Longitude (lambda) in radians       (input)
+ *    Easting           : Easting (X) in meters               (output)
+ *    Northing          : Northing (Y) in meters              (output)
+ */
+
+  double dlam;                      /* Longitude - Central Meridan */
+  double aa, aasqr;
+  double gg;
+  double pp, ppsqr;
+  double gg_MINUS_ppsqr, ppsqr_PLUS_aasqr;
+  double in_theta;
+  double theta;
+  double sin_theta, cos_theta;
+  double qq;
+  long   Error_Code = GRIN_NO_ERROR;
+
+//   if ((Latitude < -PI_OVER_2) || (Latitude > PI_OVER_2))
+//   {  /* Latitude out of range */
+//     Error_Code |= GRIN_LAT_ERROR;
+//   }
+//   if ((Longitude < -M_PI) || (Longitude > TWO_PI))
+//   {  /* Longitude out of range */
+//     Error_Code|= GRIN_LON_ERROR;
+//   }
+
+  if (!Error_Code)
+  { /* no errors */
+
+    dlam = Longitude - Grin_Origin_Long;
+//     if (dlam > M_PI)
+//     {
+//       dlam -= TWO_PI;
+//     }
+//     if (dlam < -M_PI)
+//     {
+//       dlam += TWO_PI;
+//     }
+
+    if (Latitude == 0.0)
+    {
+      *Easting = Ra * dlam + Grin_False_Easting;
+      *Northing = 0.0;
+    }
+    else if (dlam == 0.0 || FLOAT_EQ(Latitude,MAX_LAT,.00001)  || FLOAT_EQ(Latitude,-MAX_LAT,.00001))
+    {
+      in_theta = fabs(TWO_OVER_PI * Latitude);
+
+      if (in_theta > 1.0)
+        in_theta = 1.0;
+      else if (in_theta < -1.0)
+        in_theta = -1.0;
+
+      theta = asin(in_theta);
+      *Easting = 0.0;
+      *Northing = PI_Ra * tan(theta / 2) + Grin_False_Northing;
+      if (Latitude < 0.0)
+        *Northing *= -1.0;
+    }
+    else
+    {
+      aa = 0.5 * fabs(M_PI / dlam - dlam / M_PI);
+      in_theta = fabs(TWO_OVER_PI * Latitude);
+
+      if (in_theta > 1.0)
+        in_theta = 1.0;
+      else if (in_theta < -1.0)
+        in_theta = -1.0;
+
+      theta = asin(in_theta);
+      sin_theta = sin(theta);
+      cos_theta = cos(theta);
+      gg = cos_theta / (sin_theta + cos_theta - 1);
+      pp = gg * (2 / sin_theta - 1);
+      aasqr = aa * aa;
+      ppsqr = pp * pp;
+      gg_MINUS_ppsqr = gg - ppsqr;
+      ppsqr_PLUS_aasqr = ppsqr + aasqr;
+      qq = aasqr + gg;
+      *Easting = PI_Ra * (aa * (gg_MINUS_ppsqr) +
+                          sqrt(aasqr * (gg_MINUS_ppsqr) * (gg_MINUS_ppsqr) -
+                               (ppsqr_PLUS_aasqr) * (gg * gg - ppsqr))) / 
+                 (ppsqr_PLUS_aasqr) + Grin_False_Easting;
+      if (dlam < 0.0)
+        *Easting *= -1.0;
+      *Northing = PI_Ra * (pp * qq - aa * sqrt ((aasqr + 1) * (ppsqr_PLUS_aasqr) - qq * qq)) /
+                  (ppsqr_PLUS_aasqr) + Grin_False_Northing;
+      if (Latitude < 0.0)
+        *Northing *= -1.0;
+    }
+  }
+  return (Error_Code);
+
+} /* END OF Convert_Geodetic_To_Van_der_Grinten */
+
+
+long ossimVanDerGrintenProjection::Convert_Van_der_Grinten_To_Geodetic(double Easting,
+                                                                       double Northing,
+                                                                       double *Latitude,
+                                                                       double *Longitude)const
+{ /* BEGIN Convert_Van_der_Grinten_To_Geodetic */
+/*
+ * The function Convert_Van_der_Grinten_To_Geodetic converts Grinten projection
+ * (easting and northing) coordinates to geodetic (latitude and longitude)
+ * coordinates, according to the current ellipsoid and Grinten projection
+ * coordinates.  If any errors occur, the error code(s) are returned by the
+ * function, otherwise GRIN_NO_ERROR is returned.
+ *
+ *    Easting           : Easting (X) in meters                  (input)
+ *    Northing          : Northing (Y) in meters                 (input)
+ *    Latitude          : Latitude (phi) in radians              (output)
+ *    Longitude         : Longitude (lambda) in radians          (output)
+ */
+
+  double dx, dy;
+  double xx, xxsqr;
+  double yy, yysqr, two_yysqr;
+  double xxsqr_PLUS_yysqr;
+  double c1;
+  double c2;
+  double c3, c3sqr;
+  double c2_OVER_3c3;
+  double dd;
+  double a1;
+  double m1;
+  double i;
+  double theta1;
+//  double temp;
+//  const double epsilon = 1.0e-2;
+
+  long Error_Code = GRIN_NO_ERROR;
+
+//   if ((Easting > (Grin_False_Easting + PI_Ra + epsilon)) ||
+//       (Easting < (Grin_False_Easting - PI_Ra - epsilon)))
+//   { /* Easting out of range */
+//     Error_Code |= GRIN_EASTING_ERROR;
+//   }
+//   if ((Northing > (Grin_False_Northing + PI_Ra + epsilon)) ||
+//       (Northing < (Grin_False_Northing - PI_Ra - epsilon)))
+//   { /* Northing out of range */
+//     Error_Code |= GRIN_NORTHING_ERROR;
+//   }
+//   if (!Error_Code)
+//   {
+//     temp = sqrt(Easting * Easting + Northing * Northing);     
+
+//     if ((temp > (Grin_False_Easting + PI_Ra + epsilon)) || 
+//         (temp > (Grin_False_Northing + PI_Ra + epsilon)) ||
+//         (temp < (Grin_False_Easting - PI_Ra - epsilon)) || 
+//         (temp < (Grin_False_Northing - PI_Ra - epsilon)))
+//     { /* Point is outside of projection area */
+//       Error_Code |= GRIN_RADIUS_ERROR;
+//     }
+//   }
+
+  if (!Error_Code)
+  {
+    dy = Northing - Grin_False_Northing;
+    dx = Easting - Grin_False_Easting;
+    xx = dx / PI_Ra;
+    yy = dy / PI_Ra;
+    xxsqr = xx * xx;
+    yysqr = yy * yy;
+    xxsqr_PLUS_yysqr = xxsqr + yysqr;
+    two_yysqr = 2 * yysqr;
+
+    if (Northing == 0.0)
+      *Latitude = 0.0;
+
+    else
+    {
+      c1 = - fabs(yy) * (1 + xxsqr_PLUS_yysqr);
+      c2 = c1 - two_yysqr + xxsqr;
+      c3 = - 2 * c1 + 1 + two_yysqr + (xxsqr_PLUS_yysqr) * (xxsqr_PLUS_yysqr);
+      c2_OVER_3c3 = c2 / (3.0 * c3);
+      c3sqr = c3 * c3;
+      dd = yysqr / c3 + ((2 * c2 * c2 * c2) / (c3sqr * c3) - (9 * c1 * c2) / (c3sqr)) / 27;
+      a1 = (c1 - c2 * c2_OVER_3c3) /c3;
+      m1 = 2 * sqrt(-ONE_THIRD * a1);
+      i = 3 * dd/ (a1 * m1);
+      if ((i > 1.0)||(i < -1.0))
+        *Latitude = MAX_LAT;
+      else
+      {
+        theta1 = ONE_THIRD * acos(3 * dd / (a1 * m1));
+        *Latitude = M_PI * (-m1 * cos(theta1 + PI_OVER_3) - c2_OVER_3c3);
+      }
+    }
+    if (Northing < 0.0)
+      *Latitude *= -1.0;
+
+    if (xx == 0.0)
+      *Longitude = Grin_Origin_Long;
+    else
+    {
+      *Longitude = M_PI * (xxsqr_PLUS_yysqr - 1 + 
+                         sqrt(1 + (2 * xxsqr - two_yysqr) + (xxsqr_PLUS_yysqr) * (xxsqr_PLUS_yysqr))) / 
+                   (2 * xx) + Grin_Origin_Long;
+    }
+//     if (*Latitude > PI_OVER_2)  /* force distorted values to 90, -90 degrees */
+//       *Latitude = PI_OVER_2;
+//     else if (*Latitude < -PI_OVER_2)
+//       *Latitude = -PI_OVER_2;
+
+//     if (*Longitude > M_PI)
+//       *Longitude -= TWO_PI;
+//     if (*Longitude < -M_PI)
+//       *Longitude += TWO_PI;
+
+//     if (*Longitude > M_PI) /* force distorted values to 180, -180 degrees */
+//       *Longitude = M_PI;
+//     else if (*Longitude < -M_PI)
+//       *Longitude = -M_PI;
+
+  }
+  return (Error_Code);
+
+} /* END OF Convert_Van_der_Grinten_To_Geodetic */
+
+//*************************************************************************************************
+//! Returns TRUE if principal parameters are within epsilon tolerance.
+//*************************************************************************************************
+bool ossimVanDerGrintenProjection::operator==(const ossimProjection& proj) const
+{
+   if (!ossimMapProjection::operator==(proj))
+      return false;
+
+   const ossimVanDerGrintenProjection* p =
+      dynamic_cast<const ossimVanDerGrintenProjection*>(&proj);
+   if (!p) return false;
+
+   if (!ossim::almostEqual(Grin_Origin_Long,p->Grin_Origin_Long)) return false;
+
+   return true;
+}
diff --git a/ossim/src/ossim/projection/ossimWarpProjection.cpp b/src/projection/ossimWarpProjection.cpp
similarity index 100%
rename from ossim/src/ossim/projection/ossimWarpProjection.cpp
rename to src/projection/ossimWarpProjection.cpp
diff --git a/src/projection/ossimWktProjectionFactory.cpp b/src/projection/ossimWktProjectionFactory.cpp
new file mode 100755
index 0000000..88d3be3
--- /dev/null
+++ b/src/projection/ossimWktProjectionFactory.cpp
@@ -0,0 +1,492 @@
+//*************************************************************************************************
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// DESCRIPTION:
+// Projection Factory for EPSG coded projections. These are projections
+// that are fully defined in database files and specified via a projection coordinate system (PCS)
+// code.
+//
+//*************************************************************************************************
+//  $Id: ossimWktProjectionFactory.cpp 23379 2015-06-17 19:17:24Z okramer $
+
+#include <ossim/projection/ossimWktProjectionFactory.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimCylEquAreaProjection.h>
+#include <ossim/projection/ossimTransMercatorProjection.h>
+#include <ossim/projection/ossimMercatorProjection.h>
+#include <ossim/projection/ossimLambertConformalConicProjection.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimEpsgProjectionDatabase.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimEpsgDatumFactory.h>
+#include <ossim/support_data/ossimWkt.h>
+#include <sstream>
+
+ossimWktProjectionFactory* ossimWktProjectionFactory::m_instance = 0;
+
+static const ossimString WKT_MAGIC("WKT_PCS");
+
+/*************************************************************************************************
+ * Sample WKT string (for reference, line feeds and spaces added for human readability)
+ *
+ * PROJCS["NAD_1983_HARN_Lambert_Conformal_Conic",
+ *        GEOGCS["GCS_North_American_1983_HARN",
+ *               DATUM["NAD83_High_Accuracy_Regional_Network",
+ *                     SPHEROID["GRS_1980",6378137,298.257222101, AUTHORITY["EPSG","7019"]],
+ *                     AUTHORITY["EPSG","6152"]],
+ *               PRIMEM["Greenwich",0],
+ *               UNIT["degree",0.0174532925199433]],
+ *        PROJECTION["Lambert_Conformal_Conic_2SP"],
+ *        PARAMETER["standard_parallel_1",43],
+ *        PARAMETER["standard_parallel_2",45.5],
+ *        PARAMETER["latitude_of_origin",41.75],
+ *        PARAMETER["central_meridian",-120.5],
+ *        PARAMETER["false_easting",1312335.958005249],
+ *        PARAMETER["false_northing",0],
+ *        UNIT["foot",0.3048, AUTHORITY["EPSG","9002"]]]
+ *
+ * Another sample (with EPSG at the top for easy instantiation of full projection):
+ *
+ * PROJCS["WGS 84 / UTM zone 41N",
+ *        AUTHORITY["EPSG","32641"],
+ *        GEOGCS["WGS 84",
+ *               DATUM["WGS_1984",
+ *                     SPHEROID["WGS 84",6378137,298.2572235630016, AUTHORITY["EPSG","7030"]],
+ *                     AUTHORITY["EPSG","6326"]],
+ *               PRIMEM["Greenwich",0],
+ *               UNIT["degree",0.0174532925199433]],
+ *        PROJECTION["Transverse_Mercator"],
+ *        PARAMETER["latitude_of_origin",0],
+ *        PARAMETER["central_meridian",63],
+ *        PARAMETER["scale_factor",0.9996],
+ *        PARAMETER["false_easting",500000],
+ *        PARAMETER["false_northing",0],
+ *        UNIT["metre",1, AUTHORITY["EPSG","9001"]]]
+ *
+ **************************************************************************************************/
+
+//*************************************************************************************************
+//! Implements singleton pattern
+//*************************************************************************************************
+ossimWktProjectionFactory* ossimWktProjectionFactory::instance()
+{
+   if (!m_instance)
+      m_instance = new ossimWktProjectionFactory;
+   return m_instance;
+}
+
+//*************************************************************************************************
+//! Loads all SRS CSV files specified in the ossim prefs
+//*************************************************************************************************
+void ossimWktProjectionFactory::loadRecords() const
+{
+   // Fetch filename of WKT projection DB file specified in ossim_preferences:
+
+   // Optional ossim share dir:
+   ossimFilename share_dir = ossimPreferences::instance()->
+      preferencesKWL().findKey( std::string( "ossim_share_directory" ) );
+   
+   ossimFilename db_name;
+   
+   ossimFilename wkt_path = ossimPreferences::instance()->preferencesKWL().
+      findKey( std::string( "wkt_database_file" ) );
+
+   if ( wkt_path.size() )
+   {
+      if ( !wkt_path.isRelative() )
+      {
+         //---
+         // example:
+         // wkt_database_file:/usr/share/ossim/projection/ossim_wkt_pcs.csv
+         //---
+         db_name = wkt_path;
+      }
+      else if ( share_dir.size() )
+      {
+         //---
+         // example:
+         // ossim_share_dir: /usr/share/ossim
+         // wkt_database_file: projection/ossim_wkt_pcs.csv
+         //---
+         db_name = share_dir.dirCat( wkt_path );
+         
+         //---
+         // This block is for backwards compatibility.
+         // Try tacking "projection" onto share dir.
+         //---
+         if ( !db_name.isReadable() )
+         {
+            db_name = share_dir.dirCat( ossimFilename("projection") );
+            db_name = db_name.dirCat( wkt_path);
+
+            // Lastly: Try tacking "ossim/projection" onto share dir.
+            if ( !db_name.isReadable() )
+            {
+               db_name = share_dir.dirCat( ossimFilename("ossim/projection") );
+               db_name = db_name.dirCat( wkt_path);
+            }
+         }
+      }
+   }
+      
+   if (!db_name.isReadable())
+      return;
+
+   // Create only once outside the loop:
+   ossimString format_id;
+   ossimString line;
+
+   // Open the DB file:
+   std::ifstream db_stream(db_name.chars());
+   bool good_file = false;
+   if (db_stream.good())
+   {
+      // Format specification implied in file's magic number:
+      std::getline(db_stream, format_id.string());
+      format_id.trim();
+      if (format_id == WKT_MAGIC)
+         good_file = true;
+   }
+   if (!good_file)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimWktProjectionDatabase::loadRecords() -- Encountered bad WKT database file <"
+            << db_name << ">. Skipping this file." << endl;
+      db_stream.close();
+      return;
+   }
+
+   // The file is good. Skip over the column descriptor line:
+   std::getline(db_stream, line.string());
+
+   // Loop to read all data records:
+   while (!db_stream.eof())
+   {
+      std::getline(db_stream, line.string());
+      std::vector<ossimString> csvRecord = line.explode(","); // ONLY CSV FILES CONSIDERED HERE
+      if (csvRecord.size())
+      {
+         std::pair<std::string, ossim_uint32> projRecord;
+         projRecord.first = csvRecord[1].string();
+         projRecord.second = csvRecord[0].toUInt32();
+         m_wktProjRecords.insert(projRecord);
+      }
+   }
+
+//   for ( std::map<ossimString, ossim_uint32>::const_iterator it = m_wktProjRecords.begin();
+//         it != m_wktProjRecords.end(); it++)
+//     cout << "[" << it->first << ", " << it->second << "]"<<endl;
+
+   db_stream.close();
+}
+
+ossim_uint32 ossimWktProjectionFactory::getCode(const ossimString& pcsName)
+{
+   if (m_wktProjRecords.empty())
+      loadRecords();
+
+   std::map<std::string, ossim_uint32>::const_iterator it = m_wktProjRecords.find(pcsName.string());
+
+   if (it != m_wktProjRecords.end())
+   {
+      // Found an entry by this name, fetch the EPSG code:
+      return it->second;
+   }
+   return 0;
+}
+
+
+//*************************************************************************************************
+//! From keywordlist (as generated typically by ossimWkt class)
+//*************************************************************************************************
+ossimProjection* ossimWktProjectionFactory::createProjection(const ossimKeywordlist &keywordList,
+                                                             const char *prefix) const
+{
+   // The WKT for the horizontal projection may be part of a compound coordinate system, as
+   // indicated by the "COMPD_CS" prefix. Need to remove that prefix first.
+   ossimString compd_cs ("COMPD_CS.");
+   ossimKeywordlist temp_kwl (keywordList);
+   temp_kwl.stripPrefixFromAll(compd_cs);
+
+   ossimProjection* proj = 0;
+   ossimString pcs_name = temp_kwl.find(prefix, "PROJCS.name");
+   if (pcs_name.empty())
+      return 0;
+
+   if (m_wktProjRecords.empty())
+      loadRecords();
+
+   // Search the WKT DB for a mapping of projection name to EPSG code. This should take care of
+   // majority of cases, like UTM:
+   ossimString epsg_code;
+   std::map<std::string, ossim_uint32>::const_iterator it = m_wktProjRecords.find(pcs_name.string());
+   if (it != m_wktProjRecords.end())
+   {
+      // Found an entry by this name, fetch the EPSG code:
+      epsg_code = ossimString::toString(it->second);
+   }
+   else
+   {
+      // The name specified in the WKT could not be found in our WKT->EPSG map.
+      // Check for EPSG code in WKT itself:
+      ossimString auth_name = temp_kwl.find(prefix, "PROJCS.AUTHORITY.name");
+      if (auth_name == "EPSG")
+         epsg_code = temp_kwl.find(prefix, "PROJCS.AUTHORITY.param0");
+   }
+
+   // Use EPSG if determined:
+   if (!epsg_code.empty())
+   {
+      // Strip quotes if any:
+      epsg_code.trim( ossimString("\"") );
+
+      proj = ossimEpsgProjectionDatabase::instance()->findProjection(epsg_code.toUInt32());
+      if (proj)
+         return proj;
+   }
+
+   // Not EPSG, so check conventional proj spec in WKT:
+   ossimString proj_name = temp_kwl.find(prefix, "PROJCS.PROJECTION.name");
+   if (proj_name.empty())
+      return 0;
+   proj_name.downcase();
+   proj_name.gsub(" ", "_", true);
+
+   // Note that prefix is ignored. This KWL is assumed to come from ossimWkt that doesn't prefix:
+   if (proj_name.contains("transverse_mercator"))
+      proj = doTransverseMercator(temp_kwl);
+   else if (proj_name.contains("mercator"))
+      proj = doMercator(temp_kwl);
+   else if (proj_name.contains("lambert"))
+      proj = doLambertConformalConic(temp_kwl);
+   else if (proj_name.contains("equirectangular"))
+      proj = doEquiDistCylindrical(temp_kwl);
+   else if (proj_name.contains("cylindrical_equal_area"))
+      proj = doEquiAreaCylindrical(temp_kwl);
+
+   return proj;
+}
+
+//*************************************************************************************************
+// This is the principal factory method. It accepts a WKT string, e.g.
+//
+//    "Anguilla_1957_British_West_Indies_Grid",
+//
+//  or complete WKT, e.g.
+//
+//    PROJCS["Anguilla_1957_British_West_Indies_Grid", GEOGCS[...
+//
+// IMPORTANT NOTE: Image tie-points cannot be conveyed by a WKT projection string. The projection
+// created here will not be fully initialized for use in rendering imagery.
+//*************************************************************************************************
+ossimProjection* ossimWktProjectionFactory::createProjection(const ossimString &spec) const
+{
+   ossimProjection* proj = 0;
+   ossimWkt wkt;
+   if (wkt.parse(spec))
+   {
+      proj = createProjection(wkt.getKwl());
+   }
+   return proj;
+}
+
+//*************************************************************************************************
+ossimObject* ossimWktProjectionFactory::createObject(const ossimString& typeName) const
+{
+   return createProjection(typeName);
+}
+
+//*************************************************************************************************
+ossimObject* ossimWktProjectionFactory::createObject(const ossimKeywordlist& kwl,
+                                                     const char* prefix) const
+{
+   return createProjection(kwl, prefix);
+}
+
+//*************************************************************************************************
+//! STUB. Not implemented
+//*************************************************************************************************
+ossimProjection* ossimWktProjectionFactory::createProjection(const ossimFilename& /* filename */,
+                                                             ossim_uint32 /* entryIdx */) const
+{
+   return 0;
+}
+
+//*************************************************************************************************
+//! This returns the type name of all objects in all factories. This is the name used to 
+//! construct the objects dynamically and this name must be unique.
+//*************************************************************************************************
+void ossimWktProjectionFactory::getTypeNameList(std::vector<ossimString>& typeList) const
+{
+   if (m_wktProjRecords.empty())
+      loadRecords();
+
+   std::map<std::string, ossim_uint32>::iterator db_iter = m_wktProjRecords.begin();
+   while (db_iter != m_wktProjRecords.end())
+   {
+      typeList.push_back(ossimString(db_iter->first));
+      db_iter++;
+   }
+   return;
+}
+
+ossimProjection* ossimWktProjectionFactory::doTransverseMercator(const ossimKeywordlist& kwl) const
+{
+   ossimTransMercatorProjection* proj = new ossimTransMercatorProjection();
+   doMapCommon<ossimTransMercatorProjection*>(kwl, proj);
+
+   // Determine first the units:
+   ossimString name_read;
+   ossimString val_read;
+
+   // Read projection parameters from WKT KWL:
+   int param_idx = 0;
+   do
+   {
+      ossimString param("PROJCS.PARAMETER");
+      param += ossimString::toString(param_idx++);
+      name_read = kwl.find(param + ".name");
+      val_read = kwl.find(param + ".param0");
+
+      if (name_read.contains("scale_factor"))
+      {
+         proj->setScaleFactor(val_read.toDouble());
+         break;
+      }
+
+   } while (!name_read.empty());
+
+   return proj;
+}
+
+ossimProjection* ossimWktProjectionFactory::doMercator(const ossimKeywordlist& kwl) const
+{
+   ossimMercatorProjection* proj = new ossimMercatorProjection();
+   doMapCommon<ossimMercatorProjection*>(kwl, proj);
+
+   // Determine first the units:
+   ossimString name_read;
+   ossimString val_read;
+
+   // Read projection parameters from WKT KWL:
+   int param_idx = 0;
+   do
+   {
+      ossimString param("PROJCS.PARAMETER");
+      param += ossimString::toString(param_idx++);
+      name_read = kwl.find(param + ".name");
+      val_read = kwl.find(param + ".param0");
+
+      if (name_read.contains("scale_factor"))
+      {
+         proj->setScaleFactor(val_read.toDouble());
+         break;
+      }
+
+   } while (!name_read.empty());
+
+   return proj;
+}
+
+ossimProjection* ossimWktProjectionFactory::doLambertConformalConic(const ossimKeywordlist& kwl) const
+{
+   ossimLambertConformalConicProjection* proj = new ossimLambertConformalConicProjection();
+   doMapCommon<ossimLambertConformalConicProjection*>(kwl, proj);
+
+   // Determine first the units:
+   ossimString name_read;
+   ossimString val_read;
+
+   // Read projection parameters from WKT KWL:
+   int param_idx = 0;
+   do
+   {
+      ossimString param("PROJCS.PARAMETER");
+      param += ossimString::toString(param_idx++);
+      name_read = kwl.find(param + ".name");
+      val_read = kwl.find(param + ".param0");
+
+      if (name_read.contains("standard_parallel_1"))
+         proj->setStandardParallel1(val_read.toDouble());
+
+      else if (name_read.contains("standard_parallel_2"))
+         proj->setStandardParallel2(val_read.toDouble());
+
+   } while (!name_read.empty());
+
+   return proj;
+}
+
+ossimProjection* ossimWktProjectionFactory::doEquiDistCylindrical(const ossimKeywordlist& kwl) const
+{
+   ossimEquDistCylProjection* proj = new ossimEquDistCylProjection();
+   doMapCommon<ossimEquDistCylProjection*>(kwl, proj);
+
+   return proj;
+}
+
+ossimProjection* ossimWktProjectionFactory::doEquiAreaCylindrical(const ossimKeywordlist& kwl) const
+{
+   ossimCylEquAreaProjection* proj = new ossimCylEquAreaProjection();
+   doMapCommon<ossimCylEquAreaProjection*>(kwl, proj);
+
+   return proj;
+}
+
+template<class T>
+void ossimWktProjectionFactory::doMapCommon(const ossimKeywordlist& kwl, T proj) const
+{
+   ossimString name_read;
+   ossimString val_read;
+
+   const ossimDatum* datum = 0;
+   name_read = kwl.find("PROJCS.GEOGCS.AUTHORITY.name");
+   val_read = kwl.find("PROJCS.GEOGCS.AUTHORITY.param0");
+   if ((name_read == "EPSG") && (!val_read.empty()))
+   {
+      datum = ossimEpsgDatumFactory::instance()->create(val_read.toUInt32());
+      if (datum)
+         proj->setDatum(datum);
+      // TODO: HARN Datum not being handled
+   }
+
+   // Determine first the units:
+   name_read = kwl.find("PROJCS.UNIT.name");
+   double conv_factor = 1.0;
+   if (name_read.contains("f")) // feet|foot
+   {
+      conv_factor = MTRS_PER_FT;
+      proj->setProjectionUnits(OSSIM_FEET);
+   }
+
+   // Read projection parameters from WKT KWL:
+   int param_idx = 0;
+   ossimGpt origin(0, 0, 0, datum);
+   do
+   {
+      ossimString param("PROJCS.PARAMETER");
+      param += ossimString::toString(param_idx++);
+      name_read = kwl.find(param + ".name");
+      val_read = kwl.find(param + ".param0");
+
+      if (name_read.contains("central_meridian"))
+         origin.lon = val_read.toDouble();
+
+      else if (name_read.contains("latitude_of_origin"))
+         origin.lat = val_read.toDouble();
+
+      else if (name_read.contains("false_easting"))
+         proj->setFalseEasting(val_read.toDouble() * conv_factor);
+
+      else if (name_read.contains("false_northing"))
+         proj->setFalseNorthing(val_read.toDouble() * conv_factor);
+
+   } while (!name_read.empty());
+
+   proj->setOrigin(origin);
+}
+
diff --git a/src/sockets/ossimToolClient.cpp b/src/sockets/ossimToolClient.cpp
new file mode 100644
index 0000000..0bcd94e
--- /dev/null
+++ b/src/sockets/ossimToolClient.cpp
@@ -0,0 +1,321 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/sockets/ossimToolClient.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#ifdef _MSC_VER
+#include <Windows.h>
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+using namespace std;
+
+#define MAX_BUF_LEN 4096
+#define _DEBUG_ false
+
+ossimToolClient::ossimToolClient()
+:  m_svrsockfd(-1),
+   m_buffer(new char[MAX_BUF_LEN])
+{
+   ossimFilename tmpdir = "/tmp";
+#ifdef _MSC_VER
+   if (GetTempPath(MAX_BUF_LEN, m_buffer))
+      tmpdir = m_buffer;
+#endif
+   setProductFilePath(tmpdir);
+}
+
+ossimToolClient::~ossimToolClient()
+{
+   disconnect();
+}
+
+bool ossimToolClient::disconnect()
+{
+   bool success = true;
+
+   if (m_svrsockfd < 0)
+      return success;
+
+   // Need to send close request to server:
+   if (close(m_svrsockfd) < 0)
+   {
+      error("Error closing socket");
+      success = false;
+   }
+
+   m_svrsockfd = -1;
+   return success;
+}
+
+
+void ossimToolClient::error(const char *msg)
+{
+   perror(msg);
+}
+
+
+int ossimToolClient::connectToServer(char* hostname, char* portname)
+{
+   m_svrsockfd = -1;
+   while (1)
+   {
+      // Consider port number in host URL:
+      ossimString host (hostname);
+      ossimString port;
+      if (portname)
+         port = portname;
+      else if (host.contains(":"))
+      {
+         port = host.after(":");
+         host = host.before(":");
+      }
+
+      if (port.empty())
+      {
+         // Maybe implied port then '/':
+         port = host.after("/");
+         port = "/" + port;
+         host = host.before("/");
+      }
+
+      // Establish full server address including port:
+      struct addrinfo hints;
+      memset(&hints, 0, sizeof hints); // make sure the struct is empty
+      hints.ai_family = AF_INET;     // don't care IPv4 or IPv6
+      hints.ai_socktype = SOCK_STREAM; // TCP stream sockets
+      hints.ai_canonname = host.stringDup();     // fill in my IP for me
+      struct addrinfo *res;
+      int failed = getaddrinfo(host.stringDup(), port.stringDup(), &hints, &res);
+      if (failed)
+      {
+         error(gai_strerror(failed));
+         break;
+      }
+
+      // Create socket for this server by walking the linked list of available addresses:
+      struct addrinfo *server_info = res;
+      while (server_info)
+      {
+         m_svrsockfd =
+               socket(server_info->ai_family, server_info->ai_socktype, server_info->ai_protocol);
+         if (m_svrsockfd >= 0)
+            break;
+         server_info = server_info->ai_next;
+      }
+      if ((m_svrsockfd < 0) || (server_info == NULL))
+      {
+         error("Error opening socket");
+         break;
+      }
+
+      // Connect to the server:portno:
+      struct sockaddr_in* serv_addr = (sockaddr_in*) server_info->ai_addr;
+      serv_addr->sin_family = AF_INET;
+      if (connect(m_svrsockfd,(struct sockaddr*) serv_addr, server_info->ai_addrlen) < 0)
+      {
+         error("ERROR connecting");
+         disconnect();
+      }
+
+      break;
+   }
+   return m_svrsockfd;
+}
+
+
+bool ossimToolClient::execute(const char* command_spec)
+{
+   // Clear previous file path of product filename:
+   if (!m_prodFilePath.isDir())
+      m_prodFilePath =m_prodFilePath.path();
+
+   if (command_spec == NULL)
+      return false;
+
+   // Write command to the OSSIM tool server socket:
+   if (_DEBUG_) cout<<"ossimToolClient:"<<__LINE__<<" sending <"<<command_spec<<">..."<<endl; //TODO REMOVE DEBUG
+   int n = send(m_svrsockfd, command_spec, strlen(command_spec), 0);
+   if (n < 0)
+   {
+      error("ERROR writing to socket");
+      return false;
+   }
+   while (n < (int) strlen(command_spec))
+   {
+      // Partial send, try remainder of buffer:
+      if (_DEBUG_) cout<<"ossimToolClient:"<<__LINE__<<" sending <"<<&(command_spec[n])<<">..."<<endl; //TODO REMOVE DEBUG
+      int r = send(m_svrsockfd, &(command_spec[n]), strlen(command_spec)-n, 0);
+      if (r < 0)
+      {
+         error("ERROR writing to socket");
+         return false;
+      }
+      n += r;
+   }
+
+   // Process response from server. First read the response type. Can be either:
+   //     "TEXT"  -- only text is streamed
+   //     "FILE"  -- a file is treamed
+   //     "MIXED" -- Both file and text
+   //     "ERROR" -- only text with error message. No product generated.
+   //     "ADIOS" -- Server acknowledges disconnect
+   bool success = false;
+   memset(m_buffer, 0, MAX_BUF_LEN);
+   if (_DEBUG_) cout<<"ossimToolClient:"<<__LINE__<<" Waiting to recv"<<endl; //TODO REMOVE DEBUG
+   n = recv(m_svrsockfd, m_buffer, 5, 0);
+   if (_DEBUG_) cout<<"ossimToolClient:"<<__LINE__<<" Received <"<<m_buffer<<">"<<endl; //TODO REMOVE DEBUG
+   if (n < 0)
+   {
+      error("ERROR reading from socket");
+      return false;
+   }
+   ossimString response (string(m_buffer, n));
+   if (response.contains("TEXT"))
+      success = receiveText();
+   else if (response.contains("FILE"))
+      success = receiveFile();
+   else if (response.contains("MIXED"))
+      success = receiveText() && receiveFile();
+   else if (response.contains("ERROR"))
+      receiveText(); // success = false;
+   else if (response.contains("ADIOS"))
+      error("Received unexpected disconnect message from server.");
+   else
+      error("Unknown type in response header");
+
+   return success;
+}
+
+
+bool ossimToolClient::receiveText()
+{
+   int n = MAX_BUF_LEN;
+   m_textResponse.clear();
+   while (n == MAX_BUF_LEN)
+   {
+      memset(m_buffer, 0, MAX_BUF_LEN);
+      if (_DEBUG_) cout<<"ossimToolClient:"<<__LINE__<<" Waiting to recv"<<endl; //TODO REMOVE DEBUG
+      n = recv(m_svrsockfd, m_buffer, MAX_BUF_LEN, 0);
+      if (_DEBUG_) cout<<"ossimToolClient:"<<__LINE__<<" Received <"<<m_buffer<<">"<<endl; //TODO REMOVE DEBUG
+      if (n < 0)
+      {
+         error("ERROR reading from socket");
+         return false;
+      }
+      m_textResponse.append(m_buffer);
+   }
+   if (!acknowledgeRcv())
+      return false;
+
+   printf("Text response:\n-----------------\n%s\n-----------------\n",m_textResponse.c_str());
+   return true;
+}
+
+
+bool ossimToolClient::receiveFile()
+{
+   ostringstream xmsg;
+   cout << "Server requesting file send. " <<endl;
+
+   // Fetch the file size in bytes as the next message "SIZE: GGGMMMKKKBBB", (18 bytes)
+   if (!receiveText())
+      return false;
+   int filesize = m_textResponse.after("SIZE: ").toInt();
+   cout << "File size = " <<filesize<<endl;
+
+   // Fetch the filename as next message "NAME: AAAAA...", (256 bytes)
+   if (!receiveText())
+      return false;
+   ossimFilename fileName (m_textResponse.after("NAME: "));
+   m_prodFilePath = m_prodFilePath.dirCat(fileName);
+   cout << "File name = " <<m_prodFilePath<<endl;
+
+   // Open file for writing:
+   ofstream fout (m_prodFilePath.chars());
+   if (fout.fail())
+   {
+      xmsg <<"ERROR opening output file: <"<<m_prodFilePath<<">"<<ends;
+      error(xmsg.str().c_str());
+      return false;
+   }
+
+   memset(m_buffer, 0, MAX_BUF_LEN);
+   int n = MAX_BUF_LEN;
+   int numBytes = 0;
+   while ((n == MAX_BUF_LEN) && (numBytes < filesize))
+   {
+      n = recv(m_svrsockfd, m_buffer, MAX_BUF_LEN, 0);
+      if (n < 0)
+      {
+         error("ERROR reading from socket");
+         return false;
+      }
+      fout.write(m_buffer, n);
+      if (fout.fail())
+      {
+         error("ERROR on file write().");
+         return false;
+      }
+      numBytes += n;
+   }
+
+   if (!acknowledgeRcv())
+      return false;
+
+   cout<<"\nossim-client: Received and wrote "<<numBytes<<" bytes to: <"<<m_prodFilePath<<">."<<endl;;
+   fout.close();
+
+   return true;
+}
+
+
+bool ossimToolClient::acknowledgeRcv()
+{
+   if (_DEBUG_) cout<<"ossimToolClient:"<<__LINE__<<" sending \"ok_to_send\"..."<<endl; //TODO REMOVE DEBUG
+   int r = send(m_svrsockfd, "ok_to_send", 11, 0);
+   if (r < 0)
+   {
+      error("ERROR writing to socket");
+      return false;
+   }
+   if (_DEBUG_) cout << "Receive acknowledged."<<endl;
+   return true;
+}
+
+
+bool ossimToolClient::setProductFilePath(const char* filepath)
+{
+   if (filepath == NULL)
+      m_prodFilePath = "./";
+   else
+      m_prodFilePath = filepath;
+
+   ostringstream xmsg;
+   if (!m_prodFilePath.exists() && !m_prodFilePath.createDirectory())
+   {
+      xmsg <<"ERROR creating output directory: <"<<m_prodFilePath<<">"<<ends;
+      error(xmsg.str().c_str());
+   }
+   else if (!m_prodFilePath.isWriteable())
+   {
+      xmsg <<"ERROR output directory: <"<<m_prodFilePath<<"> is not writable."<<ends;
+      error(xmsg.str().c_str());
+   }
+   return true;
+}
diff --git a/src/sockets/ossimToolServer.cpp b/src/sockets/ossimToolServer.cpp
new file mode 100644
index 0000000..6ce88e1
--- /dev/null
+++ b/src/sockets/ossimToolServer.cpp
@@ -0,0 +1,473 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/sockets/ossimToolServer.h>
+#include <iostream>
+#include <sstream>
+#include <map>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/util/ossimChipProcTool.h>
+#include <ossim/util/ossimToolRegistry.h>
+
+#ifdef _MSC_VER
+#include <winsock2.h>
+#include <process.h> /* for getpid() and the exec..() family */
+#include <io.h>
+#define dup2 _dup2
+#define close closesocket
+#define pipe(phandles)  _pipe(phandles, 4096, _O_BINARY)
+#else
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/tcp.h>
+#endif
+
+
+#define OWARN ossimNotify(ossimNotifyLevel_WARN)
+#define OINFO ossimNotify(ossimNotifyLevel_INFO)
+#define MAX_BUF_LEN 4096
+#define FORK_PROCESS false
+#define _DEBUG_ false
+
+ossimToolServer::ossimToolServer()
+:  m_svrsockfd(-1),
+   m_clisockfd(-1),
+   m_buffer(new char[MAX_BUF_LEN])
+{}
+
+ossimToolServer::~ossimToolServer()
+{
+   close(m_svrsockfd);
+}
+
+
+void ossimToolServer::startListening(const char* portid)
+{
+   initSocket(portid);
+
+   socklen_t clilen;
+   ostringstream xmsg;
+   bool status_ok = true;
+
+   // Loop forever to listen for OSSIM requests:
+   OINFO<<"Waiting for connections...\n"<<endl;
+   while (1)
+   {
+      // Message received at server socket, establish connection to client's socket:
+      struct sockaddr_in cli_addr;
+      clilen = sizeof(cli_addr);
+      m_clisockfd = accept(m_svrsockfd, (struct sockaddr *) &cli_addr, &clilen);
+      if (m_clisockfd < 0)
+         error("Error accepting message on port.");
+
+      // Test code:
+      char clientname[256];
+      char clientport[256];
+      getnameinfo((struct sockaddr *) &cli_addr, clilen, clientname, 256, clientport, 256, 0);
+      cout<<"ossimToolServer: Got connection from  "<<clientname<<":"<<clientport
+            <<" Forking child process..."<<endl;
+
+
+#if 1
+      // Fork process to handle client request:
+      if (FORK_PROCESS)
+      {
+         if (!fork())
+         {
+            // this is the child process
+            close(m_svrsockfd); // child doesn't need the listener
+
+            // Receive request from client:
+            bool connected = true;
+            while (connected)
+               connected = processOssimRequest(cli_addr);
+
+            exit(0); // exit forked process
+         }
+      }
+      else
+      {
+         bool connected = true;
+         while (connected)
+            connected = processOssimRequest(cli_addr);
+      }
+#else
+      int n=0;
+      while (1)
+      {
+         // Clear the input m_buffer and read the message sent:
+         memset(m_buffer, 0, 256);
+         n = recv(m_clisockfd,m_buffer,256,0);
+         if (n < 0)
+         {
+            printf("recv returned -1 from port %d.\n", m_clisockfd);
+         }
+
+         // Send acknowledgement back to client:
+         printf("Received: %s\n",m_buffer);
+         string msg ="server received message: ";
+         msg.append(m_buffer, strlen(m_buffer));
+         n = send(m_clisockfd, msg.c_str(), msg.size(), 0);
+         if (n < 0)
+            error("ERROR writing to socket");
+      }
+#endif
+      // Finished serving this client. Close the connection:
+      close(m_clisockfd);
+   }
+}
+
+void ossimToolServer::initSocket(const char* portid)
+{
+   // Establish full server address including port:
+   struct addrinfo hints;
+   memset(&hints, 0, sizeof hints); // make sure the struct is empty
+   hints.ai_family = AF_INET;     // don't care IPv4 or IPv6
+   hints.ai_socktype = SOCK_STREAM; // TCP stream sockets
+   hints.ai_flags = AI_PASSIVE;     // fill in my IP for me
+   struct addrinfo *res;
+
+   int failed = getaddrinfo(NULL, portid, &hints, &res);
+   if (failed)
+      error(gai_strerror(failed));
+
+   // Create socket for this server by walking the linked list of available addresses:
+   struct addrinfo *server_info = res;
+   while (server_info)
+   {
+      m_svrsockfd = socket(server_info->ai_family, server_info->ai_socktype, server_info->ai_protocol);
+      if (m_svrsockfd >= 0)
+         break;
+      server_info = server_info->ai_next;
+   }
+   if ((m_svrsockfd < 0) || (server_info == NULL))
+      error("Error opening socket");
+
+   // lose the pesky "Address already in use" error message when requently restarting the daemon:
+   int yes=1;
+   if (setsockopt(m_svrsockfd,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof yes) == -1)
+      error("Error on setsockopt() call");
+
+#ifdef __APPLE__
+   int bindResult = ::bind(m_svrsockfd, server_info->ai_addr, server_info->ai_addrlen);
+#else
+   int bindResult = bind(m_svrsockfd, server_info->ai_addr, server_info->ai_addrlen);
+#endif
+   // Bind the server's socket to the specified port number:
+   if ( bindResult < 0)
+      error("Error on binding to socket:port.");
+
+   struct sockaddr_in *server_addr = (sockaddr_in*) &(server_info->ai_addr);
+
+   OINFO<<"ossimToolServer daemon started. Listening on port "<<portid<<". Process ID: "<<getpid()<<"\n"<<endl;
+   freeaddrinfo(server_info);
+
+   // Start listening:
+   if (listen(m_svrsockfd, 5) == -1)
+      error("Error on listen()");
+
+   // Reap all dead processes:
+   struct sigaction sa;
+   sa.sa_handler = ossimToolServer::sigchld_handler;
+   sigemptyset(&sa.sa_mask);
+   sa.sa_flags = SA_RESTART;
+   if (sigaction(SIGCHLD, &sa, NULL) == -1)
+      error("Error on sigaction()");
+}
+
+void ossimToolServer::sigchld_handler(int s)
+{
+   // waitpid() might overwrite errno, so we save and restore it:
+   int saved_errno = errno;
+   while(waitpid(-1, NULL, WNOHANG) > 0);
+   errno = saved_errno;
+}
+
+void ossimToolServer::error(const char* msg)
+{
+   perror(msg);
+   exit (1);
+}
+
+void ossimToolServer::writeSocket(const char* buf, int bufsize)
+{
+   int remaining = bufsize;
+   int n;
+
+   //int optval = 1;
+   //setsockopt(clientfd, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof(int));
+
+   while (remaining)
+   {
+      n = send(m_clisockfd, buf, remaining, 0);
+      if (n < 0)
+         error("ERROR writing to socket");
+      remaining -= n;
+   }
+}
+
+bool ossimToolServer::sendFile(const ossimFilename& fname)
+{
+   ostringstream xmsg;
+
+   // Open the server-side image file:
+   ifstream svrfile (fname.chars(), ios::binary|ios::in);
+   if (svrfile.fail())
+   {
+      xmsg<<"ossimToolServer.sendFile() -- Error opening file <"<<fname<<">."<<endl;
+      error(xmsg.str().c_str());
+   }
+
+   // Determine file size:
+   std::streampos fsize = svrfile.tellg();
+   svrfile.seekg( 0, std::ios::end );
+   fsize = svrfile.tellg() -fsize;
+   svrfile.seekg( 0, std::ios::beg );
+
+   // Send file size to the client:
+   char size_response[19];
+   sprintf(size_response, "SIZE: %012d", (int) fsize);
+   if (_DEBUG_) cout<<"ossimToolServer:"<<__LINE__<<" sending <"<<size_response<<">"<<endl; //TODO REMOVE DEBUG
+   writeSocket(size_response, strlen(size_response));
+   if (!acknowledgeRcvd())
+      return false;
+
+   // Send file name to the client:
+   char name_response[256];
+   memset(name_response, 0, 256);
+   sprintf(name_response, "NAME: %s", fname.file().chars());
+   if (_DEBUG_) cout<<"ossimToolServer:"<<__LINE__<<" sending <"<<name_response<<">"<<endl; //TODO REMOVE DEBUG
+   writeSocket(name_response, strlen(name_response));
+   if (!acknowledgeRcvd())
+      return false;
+
+   memset(m_buffer, 0, MAX_BUF_LEN);
+
+   // Send image in MAX_BUF_LEN byte packets
+   int n = 0;
+   int r = 0;
+   if (_DEBUG_) cout<<"ossimToolServer:"<<__LINE__<<" sending binary data..."<<endl; //TODO REMOVE DEBUG
+   while (!svrfile.eof())
+   {
+      // Read server-side file block:
+      svrfile.read(m_buffer, MAX_BUF_LEN);
+      if (svrfile.bad())
+         error("ossimToolServer.sendFile() -- Error during file read()");
+
+      n = svrfile.gcount();
+      r += n;
+
+      // transmit the block to the client:
+      writeSocket(m_buffer, n);
+   }
+   if (!acknowledgeRcvd())
+      return false;
+
+   cout << "Send complete."<<endl;
+   svrfile.close();
+   return true;
+}
+bool ossimToolServer::acknowledgeRcvd()
+{
+   if (_DEBUG_) cout<<"ossimToolServer:"<<__LINE__<<" Waiting to recv"<<endl; //TODO REMOVE DEBUG
+   int n = recv(m_clisockfd, m_buffer, 11, 0);
+   if (_DEBUG_) cout<<"ossimToolServer:"<<__LINE__<<" Received <"<<m_buffer<<">"<<endl; //TODO REMOVE DEBUG
+   if (n < 0)
+      error("ossimToolServer: EOF encountered reading from port");
+   if (strcmp(m_buffer, "ok_to_send"))
+      return false;
+   if (_DEBUG_) cout << "Send acknowledged by client."<<endl;
+   return true;
+}
+
+bool ossimToolServer::runCommand(ossimString& command)
+{
+   ostringstream xmsg;
+   bool status_ok = false;
+   static const char* msg = "\nossimToolServer.runCommand(): ";
+
+   // Intercept test mode:
+   if (command == "sendfile")
+   {
+      ossimFilename fname = command.after("sendfile").trim();
+      const char* response = "FILE ";
+      writeSocket(response, strlen(response));
+      sendFile(fname);
+      return true;
+   }
+
+   // Redirect stdout:
+   memset(m_buffer, 0, MAX_BUF_LEN);
+   int pipeDesc[2] = {0,0};
+   int savedStdout = dup( fileno(stdout) );
+   if( pipe( pipeDesc ) == -1 )
+      error("Could not redirect stdout (1).");
+   setbuf( stdout, NULL );
+   dup2( pipeDesc[1], fileno(stdout) );
+
+#ifdef _MSC_VER
+   u_long iMode = 1;
+   ioctlsocket(pipeDesc[0], FIONBIO, &iMode);
+#else
+   fcntl( pipeDesc[0], F_SETFL, O_NONBLOCK );
+#endif
+
+   ossimToolFactoryBase* factory = ossimToolRegistry::instance();
+   ossimRefPtr<ossimTool> utility = 0;
+
+   // Intercept help request:
+   ossimString c1 = command.before(" ");
+   ossimString c2 = command.after(" ");
+   while (1)
+   {
+      if (c1 == "help")
+      {
+         if (!c2.empty())
+         {
+            command = c2 + " --help";
+         }
+         else
+         {
+            map<string, string> capabilities;
+            factory->getCapabilities(capabilities);
+            map<string, string>::iterator iter = capabilities.begin();
+            cout<<"\nAvailable commands:\n"<<endl;
+            for (;iter != capabilities.end(); ++iter)
+               cout<<"  "<<iter->first<<" -- "<<iter->second<<endl;
+            cout<<"\nUse option \"--help\" with above commands to get detailed tool command."<<endl;
+            status_ok = true;
+            break;
+         }
+      }
+      // Fetch OSSIM utility for requested operation:
+      ossimArgumentParser ap (command);
+      ossimString util_name = ap[0];
+      utility = factory->createTool(util_name);
+
+      try
+      {
+         // Perform OSSIM command execution:
+         if (!utility.valid())
+            cout<<msg<<"Did not understand command <"<<util_name<<">"<<endl;
+         else if (!utility->initialize(ap))
+            cout<<msg<<"Could not execute command sequence <"<<command<<">."<<endl;
+         else if (!utility->helpRequested() && !utility->execute())
+            cout<<msg<<"Error encountered executing\n    <"<<command <<">\nCheck options."<<endl;
+         else
+            status_ok = true;
+      }
+      catch (ossimException& x)
+      {
+         cout << msg << "Caught OSSIM exception: "<<x.what()<<endl;
+      }
+      catch (exception& x)
+      {
+         cout << msg << "Caught unknown exception: "<<x.what()<<endl;
+      }
+
+      break;
+   }
+
+   // Stop redirecting stdout and copy the output stream buffer to local memory:
+   dup2( savedStdout, fileno(stdout) );
+   int n = MAX_BUF_LEN;
+   string full_output;
+   while (n == MAX_BUF_LEN)
+   {
+       n = read(pipeDesc[0], m_buffer, MAX_BUF_LEN);
+       if (n > 0)
+          full_output.append(m_buffer, n);
+   }
+
+   if (status_ok)
+   {
+      if (utility.valid() && !utility->helpRequested() && utility->isChipProcessor())
+      {
+         const char* response = "FILE ";
+         writeSocket(response, strlen(response));
+         ossimChipProcTool* ocp = (ossimChipProcTool*) utility.get();
+         ossimFilename prodFilename = ocp->getProductFilename();
+         sendFile(prodFilename);
+      }
+      else
+      {
+         const char* response = "TEXT ";
+         writeSocket(response, strlen(response));
+         writeSocket(full_output.c_str(), full_output.size());
+         if (!acknowledgeRcvd())
+            error("ERROR receiving acknowledge from client.");
+      }
+   }
+   else
+   {
+      const char* response = "ERROR";
+      writeSocket(response, strlen(response));
+      writeSocket(full_output.c_str(), full_output.size());
+      cout << "Sending ERROR to client and closing connection: <"<<full_output<<">"<<endl;
+      close(m_clisockfd);
+   }
+
+   return status_ok;
+}
+
+bool ossimToolServer::processOssimRequest(struct sockaddr_in& cli_addr)
+{
+   char dst[INET6_ADDRSTRLEN];
+
+   // TEST CODE:
+   cout << "\nprocessOssimRequest() -- Process ID: "<<getpid()<<endl;
+   cout <<   "                  Parent process ID: "<<getppid()<<endl;
+
+   // Clear the input m_buffer and read the message sent:
+   memset(m_buffer, 0, MAX_BUF_LEN);
+   if (_DEBUG_) cout<<"ossimToolServer:"<<__LINE__<<" Waiting to recv"<<endl; //TODO REMOVE DEBUG
+   int n = recv(m_clisockfd, m_buffer, MAX_BUF_LEN, 0);
+   if (_DEBUG_) cout<<"ossimToolServer:"<<__LINE__<<" Received <"<<m_buffer<<">"<<endl; //TODO REMOVE DEBUG
+   if (n < 0)
+      error("ossimToolServer: EOF encountered reading from port");
+
+   // If message received, acknowledge back:
+   if (n != 0)
+   {
+      // Log the message received:
+      void* addr = &(cli_addr.sin_addr);
+      if (!inet_ntop(AF_INET, addr, dst, INET6_ADDRSTRLEN))
+         error("ossimToolServer: Error returned from inet_ntop(). ");
+      cout << "\nossimToolServer: received message from: "<<dst<<"\n---------------\n"<<m_buffer
+            <<"\n---------------\n"<< endl;
+
+      // process request:
+      ossimString command (m_buffer);
+      command.trim();
+
+      if (command == "goodbye")
+      {
+         close(m_clisockfd);
+         return true;
+      }
+
+      runCommand(command);
+      return true;
+   }
+   return false;
+}
diff --git a/ossim/src/ossim/support_data/ossimAigBounds.cpp b/src/support_data/ossimAigBounds.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimAigBounds.cpp
rename to src/support_data/ossimAigBounds.cpp
diff --git a/ossim/src/ossim/support_data/ossimAigDataFileHeader.cpp b/src/support_data/ossimAigDataFileHeader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimAigDataFileHeader.cpp
rename to src/support_data/ossimAigDataFileHeader.cpp
diff --git a/ossim/src/ossim/support_data/ossimAigHeader.cpp b/src/support_data/ossimAigHeader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimAigHeader.cpp
rename to src/support_data/ossimAigHeader.cpp
diff --git a/ossim/src/ossim/support_data/ossimAigIndexFileHeader.cpp b/src/support_data/ossimAigIndexFileHeader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimAigIndexFileHeader.cpp
rename to src/support_data/ossimAigIndexFileHeader.cpp
diff --git a/ossim/src/ossim/support_data/ossimAigStatistics.cpp b/src/support_data/ossimAigStatistics.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimAigStatistics.cpp
rename to src/support_data/ossimAigStatistics.cpp
diff --git a/src/support_data/ossimAlphaSensorSupportData.cpp b/src/support_data/ossimAlphaSensorSupportData.cpp
new file mode 100644
index 0000000..e283eac
--- /dev/null
+++ b/src/support_data/ossimAlphaSensorSupportData.cpp
@@ -0,0 +1,702 @@
+#include <ossim/support_data/ossimAlphaSensorSupportData.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+#include <sstream>
+
+static ossimTrace traceDebug("ossimAlphaSensorSupportData:debug");
+
+
+ossimAlphaSensorSupportData::ossimAlphaSensorSupportData()
+   : m_isHSI(false),
+     m_sensorType(),
+     m_imageSize(),
+     m_rollBias(ossim::nan()),
+     m_pitchBias(ossim::nan()),
+     m_headingBias(ossim::nan()),
+     m_fov(ossim::nan()),
+     m_slitRot(ossim::nan()),
+     m_imgLine(),
+     m_roll(),
+     m_pitch(),
+     m_heading(),
+     m_lon(),
+     m_lat(),
+     m_alt(),
+     m_scanAng(),
+     m_rollPolyCoef(),
+     m_pitchPolyCoef(),
+     m_headingPolyCoef(),
+     m_lonPolyCoef(),
+     m_altPolyCoef(),
+     m_scanAngPolyCoef()
+{
+   reset();
+}
+
+void ossimAlphaSensorSupportData::reset()
+{
+   m_imageSize.makeNan();
+}
+
+
+bool ossimAlphaSensorSupportData::readSupportFiles(const ossimFilename& hdrFile)
+{
+   bool readOK = false;
+
+   // Read ENVI hdr file
+   ossimEnviHeader hdr;
+   if ( hdr.open(hdrFile) )
+   {
+      readOK= readSupportFiles( hdr );
+   }
+   return readOK;
+}
+
+bool ossimAlphaSensorSupportData::readSupportFiles(const ossimEnviHeader& hdr)
+{
+   bool readOK = readHdrFile(hdr);
+
+   ossimFilename txtFile = hdr.getFile();
+   
+   if ( readOK )
+   {
+      // Derive associated insgps.txt file name
+      if (m_isHSI)
+      {
+         // HSI:
+         //  Associated file is located in /NavData, sub-directory of current container
+         //   example:
+         //   .hdr = "/data/AH/2012-06-15_20-00-29/HSI/Scan_00002/2012-06-15_20-00-29.HSI.Scan_00002.scene.corrected.hsi.hdr"
+         //   .txt = "/data/AH/2012-06-15_20-00-29/HSI/Scan_00002/NavData/2012-06-15_20-00-29.HSI.Scan_00002.scene.insgps.txt"
+         // txtFile.insert(hdr.getFile().find_last_of('/'), "/NavData");
+         // txtFile.gsub("corrected.hsi.hdr", "insgps.txt");
+
+         ossimFilename navDir = hdr.getFile().path();
+         navDir = navDir.dirCat("NavData");
+         if ( navDir.exists() )
+         {
+            txtFile = navDir.dirCat( hdr.getFile().file() );
+            txtFile.gsub("corrected.hsi.hdr", "insgps.txt");
+         }
+         else
+         {
+            //-- 
+            // Example header and inertial nav support(INS) data file paths:
+            // 
+            // Header: /data/20131113/hsi/cal/001_001_hsi_cal_001.hsi.hdr
+            // INS:    /data/20131113/hsi/nav/001_001_hsi_cal_001.txt
+            //---
+            
+            // Expand header file out to absolute path:
+            txtFile = hdr.getFile().expand();
+            
+            // Substitute the "cal" directory with "nav".
+            txtFile.gsub("cal/", "nav/");
+
+            // Substitute the "hsi.hdr" directory with "txt".
+            txtFile.gsub("hsi.hdr", "txt");
+         }
+      }
+      else
+      {
+         // HRI:
+         //  Associated file is located in ../NavData, parallel to current container
+         //  There is one insgps.txt file common to multiple hdr files
+         //   example:
+         //   .hdr = "/data/AH/2012-06-15_20-00-29/HRI/HRI_2/2012-06-15_20-00-29.HRI_2.Strip_00004.corrected.hri.hdr"
+         //   .txt = "/data/AH/2012-06-15_20-00-29/HRI/NavData/2012-06-15_20-00-29.HRI.Strip_00004.insgps.txt"
+
+         // Replaced: 29 July 2013 (drb)
+         // txtFile = hdr.getFile().path();
+         // if ( txtFile.empty() )
+         // {
+         //    txtFile = txtFile.dirCat("../NavData");
+         // }
+         // else
+         // {
+         //    txtFile.replace(txtFile.find("HRI_"), 5, "NavData");
+         // }  
+         // txtFile = txtFile.dirCat( hdr.getFile().file() );
+         // txtFile.replace(txtFile.find("HRI_"), 5, "HRI");
+         // txtFile.gsub("corrected.hri.hdr", "insgps.txt");
+         // 
+         // with:
+
+         ossimFilename navDir = hdr.getFile().path();
+         if ( navDir.empty() )
+         {
+            navDir = navDir.dirCat("../NavData");
+         }
+         else
+         {
+            std::string::size_type pos = navDir.find("HRI_");
+            if(pos!=std::string::npos)
+            {
+               navDir = navDir.replace(pos, 5, "NavData");
+            }
+         }
+         if ( navDir.exists() )
+         {
+            txtFile = navDir.dirCat( hdr.getFile().file() );
+            std::string::size_type pos = txtFile.find("HRI_");
+            if(pos!=std::string::npos)
+            {
+               txtFile.replace(pos, 5, "HRI");
+            }
+            txtFile.gsub("corrected.hri.hdr", "insgps.txt");
+         }
+         else
+         {
+            navDir = "../nav";
+            txtFile = navDir.dirCat( hdr.getFile().file() );
+            txtFile.gsub("hri.hdr", "txt");
+         }
+      }            
+
+      // Read .txt file
+      readOK = readInsGpsFile(txtFile);
+   }    
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimAlphaSensorSupportData::readSupportFiles DEBUG:"
+         << "\n hdrFile = " << hdr.getFile()
+         << "\n txtFile = " << txtFile
+         << std::endl;
+   }
+
+   return readOK;
+}
+
+bool ossimAlphaSensorSupportData::readHdrFile(const ossimFilename& hdrFile)
+{
+   bool result = false;
+   ossimEnviHeader hdr;
+   if ( hdr.open(hdrFile) )
+   {
+      result = readHdrFile( hdr );
+   }
+   return result;
+}
+
+bool ossimAlphaSensorSupportData::readHdrFile(const ossimEnviHeader& hdr)
+{
+   bool result = false;
+
+   while( 1 )
+   {
+      // Required stuff will break from loop if not found/valid.
+
+      m_sensorType = hdr.getSensorType();
+      if ( m_sensorType.empty() ) break;
+      
+      if ( m_sensorType == "Unknown" )
+      {
+         // Make an assumption from file name...
+         if ( hdr.getFile().file().contains( ossimString("HSI") ) )
+         {
+            m_sensorType = "ACES_YOGI-HSI";
+         }
+         else if (  hdr.getFile().file().contains( ossimString("HRI") ) )
+         {
+            m_sensorType = "ACES_YOGI-HRI2";
+         }
+      }
+
+      if ( m_sensorType == "Unknown" )
+      {
+         break; // Get out...
+      }
+
+      // Set the hsi flag:
+      if ( m_sensorType.contains("HSI") || (hdr.getBands() > 63 ) ) // arbitrary...
+      {
+         m_isHSI = true;
+      }
+      else
+      {
+         m_isHSI = false;
+      }
+
+      m_imageSize.x = hdr.getSamples();
+      m_imageSize.y = hdr.getLines();
+      if ( !m_imageSize.x || !m_imageSize.y ) break;
+      
+      ossimString value;
+ 
+      hdr.getValue("roll bias", value);
+      if ( value.size() )
+      {
+         m_rollBias = ossimString::toDouble(value);
+      }
+      else
+      {
+         break;
+      }
+
+      hdr.getValue("pitch bias", value);
+      if ( value.size() )
+      {
+         m_pitchBias = ossimString::toDouble(value);
+      }
+      else
+      {
+         break;
+      }
+
+      hdr.getValue("heading bias", value);
+      if ( value.size() )
+      {
+         m_headingBias = ossimString::toDouble(value);
+      }
+      else
+      {
+         break;
+      }
+
+      hdr.getValue("fpa fov deg", value);
+      if ( value.size() )
+      {
+         m_fov = ossimString::toDouble(value);
+      }
+      else
+      {
+         break;
+      }
+
+      hdr.getValue("slit rotation deg", value);
+      if ( value.size() )
+      {
+         m_slitRot = ossimString::toDouble(value);
+      }
+      else
+      {
+         // Removed requirement. Missing in some support data and always 0 when present.
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "Missing: \"slit rotation deg\"\n";
+         }
+      }
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimAlphaSensorSupportData::readHdrFile DEBUG:"
+            << "\n getSensorType = " << m_sensorType
+            << "\n getSamples = " << m_imageSize.x
+            << "\n getLines = " << m_imageSize.y
+            << "\n roll bias = " << m_rollBias
+            << "\n pitch bias = " << m_pitchBias
+            << "\n heading bias = " << m_headingBias
+            << "\n fpa fov deg = " << m_fov
+            << "\n slit rotation deg = " << m_slitRot
+            << "\n";
+      }
+
+      // Last two lines of while forever.  If we get here, set status true and break out.
+      result = true;
+      break;
+   }
+
+   return result;
+
+} // End: bool ossimAlphaSensorSupportData::readHdrFile(const ossimEnviHeader& )
+
+bool ossimAlphaSensorSupportData::readInsGpsFile(const ossimFilename& file)
+{
+   bool result = true;
+
+   static const char M[] = "ossimAlphaSensorSupportData::readInsGpsFile";
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered:\n" << "file: " << file << "\n";
+   }
+
+   std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file, std::ios_base::in);
+
+   if ( in && in->good() )
+   {
+      ossim_float64 inum;
+      ossim_float64 roll;
+      ossim_float64 pitch;
+      ossim_float64 heading;
+      ossim_float64 lon;
+      ossim_float64 lat;
+      ossim_float64 alt;
+      ossim_float64 scanAng;
+      int res;
+      int frm;
+      const ossim_float64 BOGUS = -99999.0; // To detect read error/missing value.
+      ossim_float64 timeCode = BOGUS;
+
+      std::vector< ossim_uint32 > lines;
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimAlphaSensorSupportData::readInsGpsFile DEBUG:" << std::endl;
+         ossimNotify(ossimNotifyLevel_DEBUG)<<std::setprecision(8);
+         ossimNotify(ossimNotifyLevel_DEBUG)<<std::setiosflags(std::ios_base::scientific);
+
+      }
+
+      // Format: line,roll,pitch,heading,lon,lat,alt,scanAngle,reserved,frame,time
+
+      // Check the first line.  Some data has a phantom line, some starts with good data.
+      std::string line1;
+      std::getline( *in, line1 );
+      ossim_uint32 fields = 0;
+      if ( line1.size() )
+      {
+         std::string s;
+         std::istringstream tmpStr( line1 );
+         while ( !tmpStr.eof() )
+         {
+            tmpStr >> s;
+            if ( s.size() )
+            {
+               ++fields;
+               s.clear();
+            }
+         }
+         if ( fields == 11 )
+         {
+            // First line is valid.
+            in->seekg( 0, std::ios_base::beg );
+         }
+      }
+
+      while( !in->eof() )
+      {
+         // To detect read error/missing value. Check eof was missing last line.
+         timeCode = BOGUS; 
+         
+         *in >> inum >> roll >> pitch >> heading >> lon >> lat
+            >> alt >> scanAng >> res >> frm >> timeCode;
+
+         // if(!in.eof())
+         if ( timeCode != BOGUS )
+         {
+            lines.push_back(inum);
+            m_roll.push_back(roll);
+            m_pitch.push_back(pitch);
+            m_heading.push_back(heading);
+            m_lon.push_back(lon);
+            m_lat.push_back(lat);
+            m_alt.push_back(alt);
+            m_scanAng.push_back(scanAng);
+          }
+      }
+      
+      // Make sure we have a value per line
+      if( (lines.size() < m_imageSize.y) || (lines.size() < 10) )
+      {
+         return false;
+      }
+
+      // Load independent variable (line number, referenced to first line)
+      vector< ossimPolynom< ossim_float64 , 1 >::VAR_TUPLE >::iterator pit;
+      m_imgLine.resize(lines.size());
+      int j;
+      for (pit=m_imgLine.begin(), j=0; pit!=m_imgLine.end(); ++pit,++j)
+      {
+         pit->push_back(lines[j]-lines[0]);
+      }
+
+      // Dependent variable solutions follow...
+      double rms=0.0;
+
+      // Exponent sets
+      std::vector< ossimPolynom<ossim_float64,1>::EXPT_SET > expSet;
+      expSet.resize(MAX_TERMS);
+      ossimPolynom<ossim_float64,1>::EXP_TUPLE et(1);
+      for (int numExp=1; numExp<=MAX_TERMS; ++numExp)
+      {
+         for(int o=0; o<numExp ; ++o)
+         {
+            et[0]=o;
+            expSet[numExp-1].insert(et);
+         }
+      }
+
+      // Polynomial classes
+      //  scanAngle
+      ossimPolynom<ossim_float64,1> saPoly;
+      //  orientation angles (roll, pitch, heading)
+      ossimPolynom<ossim_float64,1> rPoly;
+      ossimPolynom<ossim_float64,1> pPoly;
+      ossimPolynom<ossim_float64,1> hPoly;
+      //  position (longitude, latitude, altitude)
+      ossimPolynom<ossim_float64,1> lonPoly;
+      ossimPolynom<ossim_float64,1> latPoly;
+      ossimPolynom<ossim_float64,1> altPoly;
+
+      // Solve for polynomial coefficients
+      if (m_isHSI)
+      {
+         result = saPoly.SLSfit(expSet[SCAN_ANGLE_DEG], m_imgLine, m_scanAng, &rms);
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "\n SA  poly deg, rms error = "
+               << SCAN_ANGLE_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
+         }
+      }
+      if (result)
+      {
+         result = rPoly.SLSfit(expSet[ROLL_DEG], m_imgLine, m_roll, &rms);
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "\n R   poly deg, rms error = "
+               << ROLL_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
+         }
+
+         if (result)
+         {
+            result = pPoly.SLSfit(expSet[PITCH_DEG], m_imgLine, m_pitch, &rms);
+            if (traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "\n P   poly deg, rms error = "
+                  << PITCH_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
+            }
+
+            if (result)
+            {
+               result = hPoly.SLSfit(expSet[HEADING_DEG], m_imgLine, m_heading, &rms);
+               if (traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << "\n H   poly deg, rms error = "
+                     << HEADING_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
+               }
+
+               if (result)
+               {
+                  result = lonPoly.SLSfit(expSet[LON_DEG], m_imgLine, m_lon, &rms);
+                  if (traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_DEBUG)
+                        << "\n Lon poly deg, rms error = "
+                        << LON_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
+                  }
+
+                  if (result)
+                  {
+                     result = latPoly.SLSfit(expSet[LAT_DEG], m_imgLine, m_lat, &rms);
+                     if (traceDebug())
+                     {
+                        ossimNotify(ossimNotifyLevel_DEBUG)
+                           << "\n Lat poly deg, rms error = "
+                           << LAT_DEG << ", " << ossim::radiansToDegrees(rms) << " deg";
+                     }
+
+                     if (result)
+                     {
+                        result = altPoly.SLSfit(expSet[ALT_DEG], m_imgLine, m_alt, &rms);
+                        if (traceDebug())
+                        {
+                           ossimNotify(ossimNotifyLevel_DEBUG)
+                              << "\n Alt poly deg, rms error = "
+                              << ALT_DEG << ", " << rms << " mtr";
+                        }
+                     }
+                  }
+               }
+            }
+         }
+      }
+
+      if (result)
+      {
+         // Save coefficients
+         ossimPolynom<ossim_float64,1>::MONOM_MAP::const_iterator it;
+         for (it = rPoly.getMonoms().begin(); it != rPoly.getMonoms().end() ; ++it )
+         {
+            m_rollPolyCoef.push_back(it->second);
+         }
+         for (it = pPoly.getMonoms().begin(); it != pPoly.getMonoms().end() ; ++it )
+         {
+            m_pitchPolyCoef.push_back(it->second);
+         }
+         for (it = hPoly.getMonoms().begin(); it != hPoly.getMonoms().end() ; ++it )
+         {
+            m_headingPolyCoef.push_back(it->second);
+         }
+         for (it = lonPoly.getMonoms().begin(); it != lonPoly.getMonoms().end() ; ++it )
+         {
+            m_lonPolyCoef.push_back(it->second);
+         }
+         for (it = latPoly.getMonoms().begin(); it != latPoly.getMonoms().end() ; ++it )
+         {
+            m_latPolyCoef.push_back(it->second);
+         }
+         for (it = altPoly.getMonoms().begin(); it != altPoly.getMonoms().end() ; ++it )
+         {
+            m_altPolyCoef.push_back(it->second);
+         }
+         if (m_isHSI)
+         {
+            for (it = saPoly.getMonoms().begin(); it != saPoly.getMonoms().end() ; ++it )
+            {
+               m_scanAngPolyCoef.push_back(it->second);
+            }
+         }
+         else
+         {
+            m_scanAngPolyCoef.push_back(0.0);
+         }
+      }
+
+
+      if (traceDebug())
+      {
+         if (result)
+         {
+            vector<ossim_float64> inp(1);
+            inp[0] = 510.0;
+            ossimNotify(ossimNotifyLevel_DEBUG) << "\n Test eval line number = " << inp[0] << endl;
+            if (m_isHSI)
+            {
+               saPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
+               ossim_float64 sa = saPoly.eval(inp);
+               ossimNotify(ossimNotifyLevel_DEBUG)<<"\n sa="<<sa<<endl;
+            }
+            rPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
+            ossim_float64 rr = rPoly.eval(inp);
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n r="<<rr<<endl;
+
+            pPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
+            ossim_float64 pp = pPoly.eval(inp);
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n p="<<pp<<endl;
+
+            hPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
+            ossim_float64 hh = hPoly.eval(inp);
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n h="<<hh<<endl;
+
+            lonPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
+            ossim_float64 lon = lonPoly.eval(inp);
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n lon="<<lon<<endl;
+
+            latPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
+            ossim_float64 lat = latPoly.eval(inp);
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n lat="<<lat<<endl;
+
+            altPoly.print(ossimNotify(ossimNotifyLevel_DEBUG));
+            ossim_float64 alt = altPoly.eval(inp);
+            ossimNotify(ossimNotifyLevel_DEBUG)<<"\n alt="<<alt<<endl;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "  ...polynomial solution error for file: " << file << std::endl;
+         }
+      }
+   }
+   else
+   {
+      result = false;
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "Could not open: " << file << "\n";
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " exit status = " << ( result ? "true" : "false" ) << "\n";
+   }
+   
+   return result;
+}
+
+const ossimDpt& ossimAlphaSensorSupportData::getImageSize()const
+{
+   return m_imageSize;
+}
+
+const ossim_float64& ossimAlphaSensorSupportData::getRollBias()const
+{
+   return m_rollBias;
+}
+
+const ossim_float64& ossimAlphaSensorSupportData::getPitchBias()const
+{
+   return m_pitchBias;
+}
+
+const ossim_float64& ossimAlphaSensorSupportData::getHeadingBias()const
+{
+   return m_headingBias;
+}
+
+const ossim_float64& ossimAlphaSensorSupportData::getFov()const
+{
+   return m_fov;
+}
+
+const ossim_float64& ossimAlphaSensorSupportData::getSlitRot()const
+{
+   return m_slitRot;
+}
+
+const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getRollPoly()const
+{
+   return m_rollPolyCoef;
+}
+
+const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getPitchPoly()const
+{
+   return m_pitchPolyCoef;
+}
+
+const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getHeadingPoly()const
+{
+   return m_headingPolyCoef;
+}
+
+const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getLonPoly()const
+{
+   return m_lonPolyCoef;
+}
+
+const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getLatPoly()const
+{
+   return m_latPolyCoef;
+}
+
+const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getAltPoly()const
+{
+   return m_altPolyCoef;
+}
+
+const std::vector< ossim_float64 >& ossimAlphaSensorSupportData::getScanPoly()const
+{
+   return m_scanAngPolyCoef;
+}
+
+
+// Hidden from use...
+ossimAlphaSensorSupportData::ossimAlphaSensorSupportData(const ossimAlphaSensorSupportData& /* src */)
+{
+}
+
+ossimAlphaSensorSupportData& ossimAlphaSensorSupportData::operator=(
+   const ossimAlphaSensorSupportData& /* src */)
+{
+   return *this;
+}
+
diff --git a/src/support_data/ossimApplanixEOFile.cpp b/src/support_data/ossimApplanixEOFile.cpp
new file mode 100644
index 0000000..c1a03b1
--- /dev/null
+++ b/src/support_data/ossimApplanixEOFile.cpp
@@ -0,0 +1,717 @@
+//*******************************************************************
+//
+// MIT
+// 
+// Author:  Garrett Potts
+//
+//*******************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimApplanixEOFile.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimTrace.h>
+
+#include <iterator>
+#include <sstream>
+#include <iostream>
+#include <iomanip>
+
+static ossimTrace traceDebug("ossimApplanixEOFile:debug");
+
+static std::istream& applanix_skipws(ossim::istream& in)
+{
+   int c = in.peek();
+   while(((c == ' ') ||
+          (c == '\r') ||
+          (c == '\t') ||
+          (c == '\n'))&&
+         (in.good()))
+   {
+      in.ignore(1);
+      c = in.peek();
+   }
+   
+   return in;
+}
+
+std::ostream& operator <<(std::ostream& out, const ossimApplanixEORecord& src)
+{
+   if(src.theField.size())
+   {
+      std::copy(src.theField.begin(),
+                src.theField.end(),
+                std::ostream_iterator<ossimString>(out, " "));
+   }
+
+   return out;
+}
+
+std::ostream& operator <<(std::ostream& out, const ossimApplanixEOFile& src)
+{
+   ossim_uint32 idx = 0;
+   out << src.theHeader << std::endl << std::endl;
+
+   if(src.theRecordFormat.size())
+   {
+      std::copy(src.theRecordFormat.begin(),
+                src.theRecordFormat.end()-1,
+                std::ostream_iterator<ossimString>(out, ", "));
+      out << *(src.theRecordFormat.end()-1);
+      out << std::endl;
+   }
+
+   out << "Kappa Cardinal Rotation = " << src.theKappaCardinal << std::endl;
+   out << "Bore Sight tx = " << src.theBoreSightTx << std::endl
+       << "Bore Sight ty = " << src.theBoreSightTy << std::endl
+       << "Bore Sight tz = " << src.theBoreSightTz << std::endl;
+   
+   out << "Lever arm lx = " << src.theLeverArmLx << std::endl
+       << "Lever arm ly = " << src.theLeverArmLy << std::endl
+       << "Lever arm lz = " << src.theLeverArmLz << std::endl;
+   
+   out << "Shift Value X = " << src.theShiftValuesX << std::endl
+       << "Shift Value Y = " << src.theShiftValuesY << std::endl
+       << "Shift Value Z = " << src.theShiftValuesZ << std::endl;
+   
+   out << "Mapping Frame Datum      = " << src.theMappingFrameDatum      << std::endl
+       << "Mapping Frame Projection = " << src.theMappingFrameProjection << std::endl
+       << "Central Meridian         = " << src.theCentralMeridian << std::endl
+       << "Origin of Latitude       = " << src.theOriginLatitude  << std::endl
+       << "Grid Scale Factor        = " << src.theGridScaleFactor << std::endl
+       << "False easting            = " << src.theFalseEasting    << std::endl
+       << "False northing           = " << src.theFalseNorthing   << std::endl;
+
+   out << "theUtmZone               = " << src.theUtmZone << std::endl;
+   out << "theUtmHemisphere         = " << src.theUtmHemisphere << std::endl;
+   
+   if(src.theApplanixRecordList.size())
+   {
+      out << std::endl;
+      for(idx = 0; idx < src.theApplanixRecordList.size()-1; ++idx)
+      {
+         out << *(src.theApplanixRecordList[idx]) << std::endl;
+      }
+      out << *(src.theApplanixRecordList[idx]);
+      
+   }
+
+   return out;
+}
+
+ossimApplanixEOFile::ossimApplanixEOFile()
+{
+   theMinLat = ossim::nan();
+   theMinLon = ossim::nan();
+   theMaxLat = ossim::nan();
+   theMaxLon = ossim::nan();
+}
+
+bool ossimApplanixEOFile::parseFile(const ossimFilename& file)
+{
+   bool result = false;
+   
+   std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+      createIstream(file, std::ios_base::in);
+      
+   if ( in )
+   {
+      result = parseStream( *in );
+   }
+
+   return result;
+}
+
+bool ossimApplanixEOFile::isEOFile(const ossimFilename& file)const
+{
+   bool result = false;
+   
+   std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file, std::ios_base::in);
+      
+   if ( in )
+   {
+      result = isEOFile( *in );
+   }
+   
+   return result;
+}
+
+bool ossimApplanixEOFile::isEOFile(std::istream& in)const
+{
+   ossimString header;
+
+   return parseHeader(in, header);
+}
+
+bool ossimApplanixEOFile::parseStream(std::istream& in)
+{
+   theRecordIdMap.clear();
+   ossimString line;
+   int c = '\0';
+   if(!parseHeader(in, theHeader))
+   {
+      return false;
+   }
+
+   // now parse parameters
+   in>>applanix_skipws;
+   line = "";
+   while(in.good()&&
+         !line.contains("RECORD FORMAT"))
+   {
+      std::getline(in, line.string());
+      line = line.upcase();
+      line = line.substitute("\r","\n", true);
+      if(line.contains("KAPPA CARDINAL"))
+      {
+         theKappaCardinal = line;
+         theKappaCardinal = theKappaCardinal.substitute("KAPPA CARDINAL ROTATION","");
+         theKappaCardinal = theKappaCardinal.substitute(":","");
+         theKappaCardinal = theKappaCardinal.substitute("\n","");
+      }
+      else if(line.contains("LEVER ARM"))
+      {
+         ossimKeywordlist kwl('=');
+         line = line.substitute("LEVER ARM VALUES:",
+                                "");
+         line = line.substitute(",",
+                                "\n",
+                                true);
+         std::istringstream in(line);
+
+         kwl.parseStream(in);
+
+         theLeverArmLx = kwl.find("LX");
+         theLeverArmLy = kwl.find("LY");
+         theLeverArmLz = kwl.find("LZ");
+      }
+      else if(line.contains("BORESIGHT VALUES"))
+      {
+         ossimKeywordlist kwl('=');
+         line = line.substitute("BORESIGHT VALUES:",
+                                "");
+         line = line.substitute(",",
+                                "\n",
+                                true);
+
+         std::istringstream in(line);
+
+         kwl.parseStream(in);
+
+         
+         theBoreSightTx = kwl.find("TX");
+         theBoreSightTy = kwl.find("TY");
+         theBoreSightTz = kwl.find("TZ");
+      }
+      else if(line.contains("SHIFT VALUES:"))
+      {
+         ossimKeywordlist kwl('=');
+         line = line.substitute("SHIFT VALUES:","");
+         line = line.substitute(",",
+                                "\n",
+                                true);
+
+         std::istringstream in(line);
+         kwl.parseStream(in);
+
+         
+         theShiftValuesX = kwl.find("X");
+         theShiftValuesY = kwl.find("Y");
+         theShiftValuesZ = kwl.find("Z");
+         
+      }
+      else if(line.contains("GRID:"))
+      { 
+         ossimKeywordlist kwl(':');
+         line = line.substitute(";",
+                                "\n",
+                                true);
+         std::istringstream in(line);
+         kwl.parseStream(in);
+         theUtmZone = kwl.find("ZONE");
+
+         if(theUtmZone.contains("NORTH"))
+         {
+            theUtmHemisphere = "North";
+         }
+         else
+         {
+            theUtmHemisphere = "South";
+         }
+          theUtmZone = theUtmZone.replaceAllThatMatch("UTM|\\(.*\\)|NORTH|SOUTH","");
+          theUtmZone = theUtmZone.trim();
+      }
+      else if(line.contains("FRAME DATUM"))
+      {
+         ossimKeywordlist kwl(':');
+         line = line.substitute(";",
+                                "\n",
+                                true);
+         std::istringstream in(line);
+         kwl.parseStream(in);
+
+         theMappingFrameDatum = kwl.find("MAPPING FRAME DATUM");
+         theMappingFrameProjection = kwl.find("MAPPING FRAME PROJECTION");
+         theMappingFrameDatum = theMappingFrameDatum.trim();
+         theMappingFrameProjection = theMappingFrameProjection.trim();
+      }
+      else if(line.contains("POSPROC SBET"))
+      {
+         theSbetField = line.after(":");
+         theSbetField = theSbetField.trim();
+      }
+      else if(line.contains("CENTRAL MERIDIAN"))
+      {
+         theCentralMeridian = line;
+         theCentralMeridian = theCentralMeridian.substitute("CENTRAL MERIDIAN","");
+         theCentralMeridian = theCentralMeridian.substitute("=","");
+         theCentralMeridian = theCentralMeridian.substitute("DEG","");
+         theCentralMeridian = theCentralMeridian.substitute(";","");
+      }
+      else if(line.contains("LATITUDE OF THE GRID ORIGIN"))
+      {
+         ossimKeywordlist kwl('=');
+         line = line.substitute(";",
+                                "\n",
+                                true);
+         std::istringstream in(line);
+         kwl.parseStream(in);
+
+         theOriginLatitude  = kwl.find("LATITUDE OF THE GRID ORIGIN");
+         theGridScaleFactor = kwl.find("GRID SCALE FACTOR");
+      }
+      else if(line.contains("FALSE EASTING"))
+      {
+         ossimKeywordlist kwl('=');
+         line = line.substitute(";",
+                                "\n",
+                                true);
+         std::istringstream in(line);
+         kwl.parseStream(in);
+
+         theFalseEasting  = kwl.find("FALSE EASTING");
+         theFalseNorthing = kwl.find("FALSE NORTHING");
+      }
+   }
+
+   in>>applanix_skipws;
+
+   c = in.get();
+
+   std::vector<ossimString> fieldArray;
+   ossimString field;
+
+   while(in.good()&&
+         (c!='\n')&&
+         (c!='\r'))
+   {
+      field = "";
+      while((c != ',')&&
+            (c != '\n')&&
+            (c != '\r'))
+      {
+         field += (char)c;
+         c = in.get();
+      }
+      if((c!='\n')&&
+         (c!='\r'))
+      {
+         c = in.get();
+      }
+      field = field.trim();
+      if(field != "")
+      {
+         theRecordFormat.push_back(field);
+      }
+   }
+   in>>applanix_skipws;
+
+   if(in.peek() == '(')
+   {
+      std::getline(in, line.string());
+   }
+   in>>applanix_skipws;
+   ossimRefPtr<ossimApplanixEORecord> record = new ossimApplanixEORecord((ossim_uint32)theRecordFormat.size());
+   ossim_int32 latIdx = getFieldIdx("LAT");
+   ossim_int32 lonIdx = getFieldIdx("LONG");;
+   bool hasLatLon = (latIdx >=0)&&(lonIdx >= 0);
+
+   
+   if(hasLatLon)
+   {
+      theMinLat = 90.0;
+      theMaxLat = -90.0;
+      theMinLon = 180.0;
+      theMaxLon = -180.0;
+   }
+   else
+   {
+      theMinLat = ossim::nan();
+      theMaxLat = ossim::nan();
+      theMinLon = ossim::nan();
+      theMaxLon = ossim::nan();
+   }
+   
+   while(in.good()&&theRecordFormat.size())
+   {
+      std::getline(in, line.string());
+      line = line.trim();
+      if(line != "")
+      {
+         std::istringstream inStr(line);
+         ossim_uint32 idx;
+         ossimString value;
+
+         for(idx = 0; idx < theRecordFormat.size(); ++idx)
+         {
+            inStr >> (*record)[idx];
+         }
+         if(hasLatLon)
+         {
+            double lat = (*record)[latIdx].toDouble();
+            double lon = (*record)[lonIdx].toDouble();
+
+            if(lat<theMinLat) theMinLat = lat;
+            if(lat>theMaxLat) theMaxLat = lat;
+            if(lon<theMinLon) theMinLon = lon;
+            if(lon>theMaxLon) theMaxLon = lon;
+            
+         }
+         theApplanixRecordList.push_back(new ossimApplanixEORecord(*record));
+      }
+   }
+   indexRecordIds();
+
+   if(traceDebug())
+   {
+      if(hasLatLon)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "min lat: " << theMinLat << std::endl
+                                             << "min lon: " << theMinLon << std::endl
+                                             << "max lat: " << theMaxLat << std::endl
+                                             << "max lon: " << theMaxLon << std::endl;
+      }
+   }
+   return true;
+}
+
+bool ossimApplanixEOFile::parseHeader(const ossimFilename& file,
+                                      ossimString& header)const
+{
+   bool result = false;
+
+   std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file, std::ios_base::in);
+   
+   if ( in )
+   {
+      result = parseHeader( *in, header);
+   }
+   
+   return result;
+}
+
+bool ossimApplanixEOFile::parseHeader(std::istream& in,
+                                      ossimString& header)const
+{
+   header = "";
+   in >> applanix_skipws;
+
+   int c = in.peek();
+   
+   if((c!='*')||
+      (!in.good()))
+   {
+      return false;
+   }
+   ossimString line;
+
+   std::getline(in, line.string());
+   line = line .substitute("\r",
+                           "\n");
+   if(!line.contains("************"))
+   {
+      return false;
+   }
+
+   header = line;
+   header += "\n";
+
+   in>>applanix_skipws;
+   std::getline(in, line.string());
+   line = line .substitute("\r",
+                           "\n");
+   
+   while((in.good())&&
+         (!line.contains("***********")))
+   {
+      header += line;
+      header += "\n";
+      std::getline(in, line.string());
+      line = line .substitute("\r",
+                              "\n");
+   }
+   header += line;
+   header += "\n";
+
+   if(!header.contains("Applanix"))
+   {
+      return false;
+   }
+   
+   return true;
+}
+
+void ossimApplanixEOFile::indexRecordIds()
+{
+   ossimString id;
+   ossim_uint32 idx;
+   ossim_int32 idIdx = getFieldIdxLike("ID");
+   ossim_uint32 size = (ossim_uint32)theApplanixRecordList.size();
+   theRecordIdMap.clear();
+
+   if(idIdx < 0) return;
+
+   for(idx = 0; idx < size; ++idx)
+   {
+      id = (*theApplanixRecordList[idx])[idIdx];
+      theRecordIdMap.insert(std::make_pair(id, theApplanixRecordList[idx]));
+   }
+}
+
+ossim_int32 ossimApplanixEOFile::getFieldIdxLike(const ossimString& searchKey)const
+{
+   ossimString key = searchKey;
+   ossim_uint32 idx = 0;
+   key = key.upcase();
+
+   for(idx = 0; idx < theRecordFormat.size(); ++idx)
+   {
+      if(ossimString::upcase(theRecordFormat[idx]).contains(key))
+      {
+         return (int)idx;
+      }
+   }
+
+   return -1;
+}
+
+ossim_int32 ossimApplanixEOFile::getFieldIdx(const ossimString& searchKey)const
+{
+   ossimString key = searchKey;
+   ossim_uint32 idx = 0;
+   
+   key = key.upcase();
+
+   for(idx = 0; idx < theRecordFormat.size(); ++idx)
+   {
+      if(ossimString::upcase(theRecordFormat[idx]) == key)
+      {
+         return (int)idx;
+      }
+   }
+   
+   return -1;
+}
+
+
+const ossimRefPtr<ossimApplanixEORecord> ossimApplanixEOFile::getRecordGivenId(const ossimString& id)const
+{
+
+   if(theRecordIdMap.size())
+   {
+      std::map<ossimString, ossimRefPtr<ossimApplanixEORecord>,
+         ossimStringLtstr >::const_iterator iter = theRecordIdMap.find(id);
+      
+      if(iter!=theRecordIdMap.end())
+      {
+         return iter->second;
+      }
+   }
+   else
+   {
+      ossim_uint32 idx;
+      ossim_int32 idxId = getFieldIdx("ID");
+      
+      if(idxId >= 0)
+      {
+         for(idx = 0; idx < theApplanixRecordList.size(); ++idx)
+         {
+            if((*theApplanixRecordList[idx])[idxId] == id)
+            {
+               return theApplanixRecordList[idx];
+            }
+         }
+      }
+   }
+   
+   return 0;
+}
+
+ossim_uint32 ossimApplanixEOFile::getNumberOfRecords()const
+{
+   return (ossim_uint32)theApplanixRecordList.size();
+}
+
+const ossimRefPtr<ossimApplanixEORecord> ossimApplanixEOFile::getRecord(ossim_uint32 idx)const
+{
+   if(idx < theApplanixRecordList.size())
+   {
+      return theApplanixRecordList[idx];
+   }
+   
+   return 0;
+}
+
+bool ossimApplanixEOFile::isHeightAboveMSL()const
+{
+   return (getFieldIdx("ORTHOMETRIC HEIGHT") >= 0);
+}
+
+bool ossimApplanixEOFile::isEcefModel()const
+{
+   ossim_int32 xIdx = getFieldIdx("X");
+   ossim_int32 yIdx = getFieldIdx("Y");
+   ossim_int32 zIdx = getFieldIdx("Z");
+   ossim_int32 rollIdx = getFieldIdx("ROLL");
+   ossim_int32 pitchIdx = getFieldIdx("PITCH");
+   ossim_int32 headingIdx = getFieldIdx("HEADING");
+
+   return ((xIdx >=0)&&
+           (yIdx >=0)&&
+           (zIdx >=0)&&
+           (rollIdx>=0)&&
+           (pitchIdx>=0)&&
+           (headingIdx>=0));
+}
+
+
+bool ossimApplanixEOFile::isUtmFrame()const
+{
+   return ((getFieldIdxLike("EASTING")>=0)&&
+            (getFieldIdxLike("NORTHING") >=0)&&
+            (getFieldIdxLike("HEIGHT") >= 0)&&
+            (getFieldIdxLike("OMEGA") >=0)&&
+            (getFieldIdxLike("PHI") >=0)&&
+            (getFieldIdxLike("KAPPA") >=0));
+            
+   return (getUtmZone() >= 0.0);
+}
+
+ossim_int32 ossimApplanixEOFile::getUtmZone()const
+{
+   return theUtmZone.toInt32();
+}
+
+ossimString ossimApplanixEOFile::getUtmHemisphere()const
+{
+   return theUtmHemisphere;
+}
+
+ossimString ossimApplanixEOFile::getSbetField()const
+{
+   return theSbetField;
+}
+
+double ossimApplanixEOFile::getBoreSightTx()const
+{
+   return theBoreSightTx.toDouble();
+}
+
+double ossimApplanixEOFile::getBoreSightTy()const
+{
+   return theBoreSightTy.toDouble();
+}
+
+double ossimApplanixEOFile::getBoreSightTz()const
+{
+   return theBoreSightTz.toDouble();
+}
+
+double ossimApplanixEOFile::getLeverArmLx()const
+{
+   return theLeverArmLx.toDouble();
+}
+
+double ossimApplanixEOFile::getLeverArmLy()const
+{
+   return theLeverArmLy.toDouble();
+}
+
+double ossimApplanixEOFile::getLeverArmLz()const
+{
+   return theLeverArmLz.toDouble();
+}
+
+double ossimApplanixEOFile::getKardinalKappa()const
+{
+   return theKappaCardinal.toDouble();
+}
+
+double ossimApplanixEOFile::getShiftValuesX()const
+{
+   return theShiftValuesX.toDouble();
+}
+
+double ossimApplanixEOFile::getShiftValuesY()const
+{
+   return theShiftValuesY.toDouble();
+}
+
+double ossimApplanixEOFile::getShiftValuesZ()const
+{
+   return theShiftValuesZ.toDouble();
+}
+
+ossimString ossimApplanixEOFile::getMappingFrameDatum()const
+{
+   return theMappingFrameDatum;
+}
+
+ossimString ossimApplanixEOFile::getMappingFrameProjection()const
+{
+   return theMappingFrameProjection;
+}
+
+double ossimApplanixEOFile::getMappingFrameCentralMeridian()const
+{
+   return theCentralMeridian.toDouble();
+}
+
+double ossimApplanixEOFile::getMappingFrameOriginLatitude()const
+{
+   return theOriginLatitude.toDouble();
+}
+
+double ossimApplanixEOFile::getMappingFrameGridScaleFactor()const
+{
+   return theGridScaleFactor.toDouble();
+}
+
+double ossimApplanixEOFile::getMappingFrameFalseEasting()const
+{
+   return theFalseEasting.toDouble();
+}
+
+double ossimApplanixEOFile::getMappingFrameFalseNorthing()const
+{
+   return theFalseNorthing.toDouble();
+}
+
+ossimString ossimApplanixEOFile::convertToOssimDatumCode(const ossimString& datum)const
+{
+   ossimString result = "WGE";
+   ossimString temp = datum;
+   temp = temp.upcase();
+
+   if(temp == "NAD83")
+   {
+      result = "NAR-C";
+   }
+
+   return result;
+}
diff --git a/src/support_data/ossimAuxFileHandler.cpp b/src/support_data/ossimAuxFileHandler.cpp
new file mode 100644
index 0000000..e263e30
--- /dev/null
+++ b/src/support_data/ossimAuxFileHandler.cpp
@@ -0,0 +1,1138 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: SPADAC Inc
+//         Adaptd from the GDAL package hfadataset.cpp
+// Description: This class provides some simple utilities for aux file.
+//
+//********************************************************************
+// $Id: ossimAuxFileHandler.cpp 2644 2011-05-26 15:20:11Z oscar.kramer $
+
+#include <cstdio>
+#include <cstdlib>
+#include <iostream>
+
+#include <ossim/support_data/ossimAuxFileHandler.h>
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+using namespace std;
+
+void ossimAuxStandardFile( int nBytes, void * pData )
+
+{
+  int		i;
+  char	*entryData = (char *) pData;
+
+  for( i = nBytes/2-1; i >= 0; i-- )
+  {
+    ossim_uint8	byTemp;
+
+    byTemp = entryData[i];
+    entryData[i] = entryData[nBytes-i-1];
+    entryData[nBytes-i-1] = byTemp;
+  }
+}
+
+int ossimAuxGetDataTypeBits( int nDataType )
+
+{
+  switch( nDataType )
+  {
+  case EPT_u1:
+    return 1;
+
+  case EPT_u2:
+    return 2;
+
+  case EPT_u4:
+    return 4;
+
+  case EPT_u8:
+  case EPT_s8:
+    return 8;
+
+  case EPT_u16:
+  case EPT_s16:
+    return 16;
+
+  case EPT_u32:
+  case EPT_s32:
+  case EPT_f32:
+    return 32;
+
+  case EPT_f64:
+  case EPT_c64:
+    return 64;
+
+  case EPT_c128:
+    return 128;
+  }
+
+  return 0;
+}
+
+static char * ossimAuxGetDictionary(ossimAuxInfo* hHFA)
+
+{
+  int		nDictMax = 100;
+  char	*pszDictionary = (char *)malloc(nDictMax);
+  int		nDictSize = 0;
+
+  fseek(hHFA->fp, hHFA->nDictionaryPos, SEEK_SET );
+
+  while( true )
+  {
+    if( nDictSize >= nDictMax-1 )
+    {
+      nDictMax = nDictSize * 2 + 100;
+      pszDictionary = (char *) realloc(pszDictionary, nDictMax );
+    }
+
+    if( fread( pszDictionary + nDictSize, 1, 1, hHFA->fp ) < 1
+      || pszDictionary[nDictSize] == '\0'
+      || (nDictSize > 2 && pszDictionary[nDictSize-2] == ','
+      && pszDictionary[nDictSize-1] == '.') )
+      break;
+
+    nDictSize++;
+  }
+
+  pszDictionary[nDictSize] = '\0';
+
+  return( pszDictionary );
+}
+
+ossimAuxFileHandler::ossimAuxFileHandler()
+{
+  m_auxInfo = NULL;
+}
+
+ossimAuxFileHandler::~ossimAuxFileHandler()
+{
+  if (m_auxInfo != NULL)
+  {
+    delete m_auxInfo;
+    m_auxInfo = 0;
+  }
+}
+
+bool ossimAuxFileHandler::isAuxFile(const ossimFilename& file)
+{
+  bool result = false;
+
+  if ( file.exists() )
+  { 
+    ossimString ext = file.ext();
+    ext.downcase();
+    if (ext == "aux")
+    {
+      result = true;
+    }
+    else
+    {
+      result = false;
+    } 
+  } 
+
+  return result;
+}
+
+bool ossimAuxFileHandler::open(const ossimFilename& file)
+{
+   FILE	*fp = fopen(file.c_str(), "r");
+   char	header[16];
+   ossim_uint32	nHeaderPos;
+
+   if( fp == NULL )
+   {
+      return false;
+   }
+
+   fread( header, 16, 1, fp);
+  
+   char* tmpHeader = const_cast<char*>(header);
+   if(strcmp(tmpHeader,"EHFA_HEADER_TAG") != 0)
+   {
+      fclose( fp );
+      return false;
+   }
+
+   //Create the ossimAuxInfo                                          
+   m_auxInfo = new ossimAuxInfo();
+   m_auxInfo->fp = fp;
+ 
+   //Where is the header?						
+   fread( &nHeaderPos, sizeof(ossim_int32), 1, fp );
+
+   fseek( fp, nHeaderPos, SEEK_SET );
+
+   fread( &(m_auxInfo->nVersion), sizeof(ossim_int32), 1, fp );
+ 
+   fread( header, 4, 1, fp ); /* skip freeList */
+
+   fread( &(m_auxInfo->nRootPos), sizeof(ossim_int32), 1, fp );
+ 
+   fread( &(m_auxInfo->nEntryHeaderLength), sizeof(ossim_int16), 1, fp );
+   fread( &(m_auxInfo->nDictionaryPos), sizeof(ossim_int32), 1, fp );
+  
+   fseek( fp, 0, SEEK_END );
+   m_auxInfo->nEndOfFile = (ossim_int32) ftell(fp);
+
+   m_auxInfo->m_Root = new ossimAuxEntry( m_auxInfo, m_auxInfo->nRootPos, NULL, NULL );
+
+   m_auxInfo->dictionaryData = ossimAuxGetDictionary(m_auxInfo);
+   m_auxInfo->m_Dictionary = new ossimAuxDictionary( m_auxInfo->dictionaryData );
+
+   ossimAuxEntry	*node = m_auxInfo->m_Root->getChild();
+   while( node != NULL )
+   {
+      std::string typeStr = node->getType();
+      size_t typeLen = typeStr.length();
+      std::string str = "Eimg_Layer";
+      size_t strLen = str.length();
+      if( typeLen == strLen)
+      {
+         ossimAuxEntry* projEntry = node->getNamedChild("Map_Info");
+         if( projEntry == NULL )
+         {
+            ossimAuxEntry* childEntry;
+            for( childEntry = node->getChild(); childEntry != NULL && projEntry == NULL; childEntry = childEntry->getNext() )
+            {
+               if (ossimString(childEntry->getType()) == "Eprj_MapInfo")
+                  projEntry = childEntry;
+            }
+         }
+
+         const char* proj = NULL;
+         const char* units = NULL;
+         if (projEntry)
+         {
+            proj = projEntry->getStringField("proName");
+            units = projEntry->getStringField("units");
+         }
+      
+         if (proj != NULL)
+         {
+            m_projName = ossimString(proj);
+         }
+         if (units != NULL)
+         {
+            m_unitsType = ossimString(proj);
+         }
+
+         ossimAuxEntry* datumEntry = node->getNamedChild( "Projection.Datum" );
+         const char* datumStr = NULL;
+         if (datumEntry)
+         {
+            datumStr = datumEntry->getStringField("datumname");
+         }
+         if (datumStr != NULL)
+         {
+            m_datumName = ossimString(datumStr);;
+         }
+         break;
+      }
+      node = node->getNext();
+   }
+
+   fclose(fp);
+   return true;
+}
+
+/************************************************************************/
+/*                              ossimAuxInfo()                              */
+/************************************************************************/
+ossimAuxInfo::ossimAuxInfo()
+{
+   fp = NULL;
+   m_Root = NULL;
+   m_Dictionary = NULL;
+   dictionaryData = NULL;
+}
+
+ossimAuxInfo::~ossimAuxInfo()
+{
+   if (m_Root != NULL)
+   {
+      delete m_Root;
+      m_Root = 0;
+   }
+   
+   if (m_Dictionary != NULL)
+   {
+      delete m_Dictionary;
+      m_Dictionary = 0;
+   }
+   
+   if (dictionaryData != NULL)
+   {
+      delete[] dictionaryData;
+      dictionaryData = 0;
+   }
+}
+
+/************************************************************************/
+/*                              ossimAuxEntry()                              */
+/************************************************************************/
+
+ossimAuxEntry::ossimAuxEntry(ossimAuxInfo * auxInfoIn, ossim_uint32 nPos,
+                             ossimAuxEntry * parentIn, ossimAuxEntry * prevIn)
+
+{
+   m_auxInfo = auxInfoIn;
+
+   nFilePos = nPos;
+  
+   m_Parent = parentIn;
+   m_Prev = prevIn;
+
+   m_Next = NULL;
+   m_Child = NULL;
+   entryData = NULL;
+
+   nDataPos = nDataSize = 0;
+   nNextPos = nChildPos = 0;
+
+   entryNodeName[0] = entryType[0] = '\0';
+
+   ossim_int32	anEntryNums[6];
+ 
+   if( fseek( m_auxInfo->fp, nFilePos, SEEK_SET ) == -1
+       || fread( anEntryNums, sizeof(ossim_uint32), 6, m_auxInfo->fp ) < 1 )
+   {
+      return;
+   }
+
+   nNextPos = anEntryNums[0];
+   nChildPos = anEntryNums[3];
+   nDataPos = anEntryNums[4];
+   nDataSize = anEntryNums[5];
+
+   if( fread( entryNodeName, 1, 64, m_auxInfo->fp ) < 1
+       || fread( entryType, 1, 32, m_auxInfo->fp ) < 1 )
+   {
+      return;
+   }
+}
+ossimAuxEntry::~ossimAuxEntry()
+{
+   if( entryData != NULL )
+   {
+      delete entryData;
+      entryData = 0;
+   }
+
+   if( m_Next != NULL )
+   {
+      delete m_Next;
+      m_Next = 0;
+   }
+
+   if( m_Child != NULL )
+   {
+      delete m_Child;
+      m_Child = 0;
+   }
+}
+
+void ossimAuxEntry::setName( const char *nodeName )
+{
+   memset( entryNodeName, '\0', 64 );
+   strncpy( entryNodeName, nodeName, 64 );
+}
+
+ossimAuxEntry *ossimAuxEntry::getChild()
+{
+   if( m_Child == NULL && nChildPos != 0 )
+   {
+      m_Child = new ossimAuxEntry( m_auxInfo, nChildPos, this, NULL );
+   }
+
+   return( m_Child );
+}
+
+ossimAuxEntry* ossimAuxEntry::getNext()
+{
+   if( m_Next == NULL && nNextPos != 0 )
+   {
+      // Check if we have a loop on the next node in this sibling chain.
+      ossimAuxEntry *past;
+
+      for( past = this; 
+           past != NULL && past->nFilePos != nNextPos; 
+           past = past->m_Prev ) {}
+
+      if( past != NULL )
+      {
+         nNextPos = 0;
+         return NULL;
+      }
+
+      m_Next = new ossimAuxEntry(m_auxInfo, nNextPos, m_Parent, this );
+   }
+
+   return( m_Next );
+}
+
+void ossimAuxEntry::loadData()
+{
+   if( entryData != NULL || nDataSize == 0 )
+   {
+      return;
+   }
+
+   entryData = (char*) malloc(nDataSize);
+   if (entryData == NULL)
+   {
+      return;
+   }
+
+   if(fseek(m_auxInfo->fp, nDataPos, SEEK_SET ) < 0 )
+   {
+      return;
+   }
+
+   if( fread( entryData, 1, nDataSize, m_auxInfo->fp ) < 1 )
+   {
+      return;
+   }
+
+   m_Type = m_auxInfo->m_Dictionary->findType( entryType );
+   if(m_Type == NULL)
+   {
+      return;
+   }
+}
+
+ossimAuxEntry* ossimAuxEntry::getNamedChild( const char* name )
+{
+   int		nNameLen;
+   ossimAuxEntry	*entry;
+
+   for( nNameLen = 0;
+        name[nNameLen] != '.'
+           && name[nNameLen] != '\0'
+           && name[nNameLen] != ':';
+        nNameLen++ ) {}
+
+  
+   for( entry = getChild(); entry != NULL; entry = entry->getNext() )
+   {
+      std::string tmpEntryName = const_cast<char*>(entry->getName());
+      tmpEntryName = tmpEntryName.substr(0, nNameLen);
+      std::string tmpName = const_cast<char*>(name);
+      tmpName = tmpName.substr(0, nNameLen);
+      if( strcmp(tmpEntryName.c_str(),tmpName.c_str()) == 0
+          && (int) strlen(entry->getName()) == nNameLen )
+      {
+         if( name[nNameLen] == '.' )
+         {
+            ossimAuxEntry *result;
+
+            result = entry->getNamedChild( name+nNameLen+1 );
+            if( result != NULL )
+               return result;
+         }
+         else
+            return entry;
+      }
+   }
+
+   return NULL;
+}
+
+int ossimAuxEntry::getFieldValue( const char * auxFieldPath,
+                                  char chReqType, void *reqReturn )
+{
+   ossimAuxEntry	*entry = this;
+
+   if( strchr(auxFieldPath,':') != NULL )
+   {
+      entry = getNamedChild( auxFieldPath );
+      if( entry == NULL )
+         return false;
+
+      auxFieldPath = strchr(auxFieldPath,':') + 1;
+   }
+
+   loadData();
+
+   if( entryData == NULL )
+   {
+      return false;
+   }
+
+   if( m_Type == NULL )
+   {
+      return false;
+   }
+
+   return (m_Type->extractInstValue( auxFieldPath,
+                                     entryData, nDataPos, nDataSize,
+                                     chReqType, reqReturn ));
+}
+
+ossim_int16 ossimAuxEntry::getIntField(const char* auxFieldPath)
+{
+   ossim_int16	nIntValue;
+
+   if( !getFieldValue( auxFieldPath, 'i', &nIntValue ) )
+   {
+      return 0;
+   }
+   else
+   {
+      return nIntValue;
+   }
+}
+
+const char* ossimAuxEntry::getStringField( const char* auxFieldPath)
+{
+   char *result = NULL;
+
+   if( !getFieldValue( auxFieldPath, 's', &result ) )
+   {
+      return NULL;
+   }
+   else
+   {
+      return result;
+   }
+}
+
+/************************************************************************/
+/*                              ossimAuxField()                              */
+/************************************************************************/
+
+ossimAuxField::ossimAuxField()
+{
+   nBytes = 0;
+
+   nItemCount = 0;
+   chPointer = '\0';
+   chItemType = '\0';
+
+   itemObjectType = NULL;
+   m_auxItemObjectType = NULL;
+
+   enumNames = NULL;
+   fieldName = NULL;
+}
+
+ossimAuxField::~ossimAuxField()
+{
+   if (itemObjectType != NULL)
+   {
+      delete[] itemObjectType;
+      itemObjectType = 0;
+   }
+
+   if (enumNames != NULL)
+   {
+      delete[] enumNames;
+      enumNames = 0;
+   }
+
+   if (fieldName != NULL)
+   {
+      delete[] fieldName;
+      fieldName = 0;
+   }
+}
+
+int ossimAuxField::extractInstValue( const char* /* auxField */, int nIndexValue,
+                                     char* entryData, ossim_uint32 nDataOffset, int nDataSize,
+                                     char chReqType, void *reqReturn )
+
+{
+   int			nInstItemCount = getInstCount( entryData, nDataSize );
+  
+   if( nIndexValue < 0 || nIndexValue >= nInstItemCount )
+   {
+      if( chItemType == 'b' && nIndexValue >= -3 && nIndexValue < 0 )
+         /* ok - special index values */;
+      else
+         return false;
+   }
+
+   if( chPointer != '\0' )
+   {
+      ossim_uint32	nOffset;
+
+      memcpy( &nOffset, entryData+4, 4 );
+  
+      entryData += 8;
+
+      nDataOffset += 8;
+      nDataSize -= 8;
+   }
+
+   if( (chItemType == 'c' || chItemType == 'C') && chReqType == 's' )
+   {
+      *((char **)reqReturn) = entryData;
+      return( entryData != NULL );
+   }
+
+   return false;
+}
+
+int ossimAuxField::getInstCount( char * entryData, int nDataSize )
+{
+   if( chPointer == '\0' )
+      return nItemCount;
+   else if( chItemType == 'b' )
+   {
+      ossim_int32 nRows, nColumns;
+
+      if( nDataSize < 20 )
+         return 0;
+
+      memcpy( &nRows, entryData+8, 4 );
+      ossimAuxStandardFile( 4, &nRows );
+      memcpy( &nColumns, entryData+12, 4 );
+      ossimAuxStandardFile( 4, &nColumns );
+
+      return nRows * nColumns;
+   }
+   else
+   {
+      ossim_int32 nCount;
+
+      if( nDataSize < 4 )
+         return 0;
+
+      memcpy( &nCount, entryData, 4 );
+      ossimAuxStandardFile( 4, &nCount );
+      return nCount;
+   }
+}
+
+void ossimAuxField::completeDefn( ossimAuxDictionary * auxDict )
+
+{
+   if( itemObjectType != NULL )
+   {
+      m_auxItemObjectType = auxDict->findType( itemObjectType );
+   }
+
+   if( chPointer == 'p' )
+   {
+      nBytes = -1; /* we can't know the instance size */
+   }
+   else if( m_auxItemObjectType != NULL )
+   {
+      m_auxItemObjectType->completeDefn( auxDict );
+      if( m_auxItemObjectType->nBytes == -1 )
+      {
+         nBytes = -1;
+      }
+      else
+      {
+         nBytes = m_auxItemObjectType->nBytes * nItemCount;
+      }
+
+      if( chPointer == '*' && nBytes != -1 )
+      {
+         nBytes += 8; /* count, and offset */
+      }
+   }
+   else
+   {
+      nBytes = auxDict->getItemSize( chItemType ) * nItemCount;
+   }
+}
+
+const char *ossimAuxField::initialize( const char * fieldInput )
+{
+   int		i;
+   nItemCount = atoi(fieldInput);
+
+   while( *fieldInput != '\0' && *fieldInput != ':' )
+   {
+      fieldInput++;
+   }
+
+   if( *fieldInput == '\0' )
+   {
+      return NULL;
+   }
+
+   fieldInput++;
+
+   if( *fieldInput == 'p' || *fieldInput == '*' )
+      chPointer = *(fieldInput++);
+
+   if( *fieldInput == '\0' )
+      return NULL;
+
+   chItemType = *(fieldInput++);
+
+   if( chItemType == 'o' )
+   {
+      for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
+
+      itemObjectType = (char *) malloc(i+1);
+      strncpy( itemObjectType, fieldInput, i );
+      itemObjectType[i] = '\0';
+
+      fieldInput += i+1;
+   }
+
+   if( chItemType == 'x' && *fieldInput == '{' )
+   {
+      int nBraceDepth = 1;
+      fieldInput++;
+
+      // Skip past the definition.
+      while( nBraceDepth > 0 && *fieldInput != '\0' )
+      {
+         if( *fieldInput == '{' )
+            nBraceDepth++;
+         else if( *fieldInput == '}' )
+            nBraceDepth--;
+
+         fieldInput++;
+      }
+
+      chItemType = 'o';
+
+      // find the comma terminating the type name.
+      for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
+
+      itemObjectType = (char *) malloc(i+1);
+      strncpy( itemObjectType, fieldInput, i );
+      itemObjectType[i] = '\0';
+
+      fieldInput += i+1;
+   }
+
+   if( chItemType == 'e' )
+   {
+      int	nEnumCount = atoi(fieldInput);
+      int	iEnum;
+
+      fieldInput = strchr(fieldInput,':');
+      if( fieldInput == NULL )
+         return NULL;
+
+      fieldInput++;
+
+      enumNames = (char **) calloc(sizeof(char *), nEnumCount+1);
+
+      for( iEnum = 0; iEnum < nEnumCount; iEnum++ )
+      {
+         char	*pszToken;
+
+         for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
+
+         if( fieldInput[i] != ',' )
+            return NULL;
+
+         pszToken = (char *) malloc(i+1);
+         strncpy( pszToken, fieldInput, i );
+         pszToken[i] = '\0';
+
+         enumNames[iEnum] = pszToken;
+
+         fieldInput += i+1;
+      }
+   }
+
+   for( i = 0; fieldInput[i] != '\0' && fieldInput[i] != ','; i++ ) {}
+
+   fieldName = (char *) malloc(i+1);
+   strncpy( fieldName, fieldInput, i );
+   fieldName[i] = '\0';
+
+   fieldInput += i+1;
+
+   return( fieldInput );
+}
+
+int ossimAuxField::getInstBytes( char *entryData, int nDataSize )
+
+{
+   int		nCount;
+   int		nInstBytes = 0;
+
+   if( nBytes > -1 )
+      return nBytes;
+
+   if( chPointer != '\0' )
+   {
+      memcpy( &nCount, entryData, 4 );
+      ossimAuxStandardFile( 4, &nCount );
+
+      entryData += 8;
+      nInstBytes += 8;
+   }
+   else
+      nCount = 1;
+
+   if( chItemType == 'b' && nCount != 0 ) // BASEDATA
+   {
+      ossim_int32 nRows, nColumns;
+      ossim_int16 nBaseItemType;
+
+      memcpy( &nRows, entryData, 4 );
+      ossimAuxStandardFile( 4, &nRows );
+      memcpy( &nColumns, entryData+4, 4 );
+      ossimAuxStandardFile( 4, &nColumns );
+      memcpy( &nBaseItemType, entryData+8, 2 );
+      ossimAuxStandardFile( 2, &nBaseItemType );
+
+      nInstBytes += 12;
+
+      nInstBytes += 
+         ((ossimAuxGetDataTypeBits(nBaseItemType) + 7) / 8) * nRows * nColumns;
+   }
+   else if( m_auxItemObjectType == NULL )
+   {
+      nInstBytes += nCount * ossimAuxDictionary::getItemSize(chItemType);
+   }
+   else
+   {
+      int		i;
+
+      for( i = 0; i < nCount; i++ )
+      {
+         int	nThisBytes;
+
+         nThisBytes =
+            m_auxItemObjectType->getInstBytes( entryData,
+                                               nDataSize - nInstBytes );
+         nInstBytes += nThisBytes;
+         entryData += nThisBytes;
+      }
+   }
+
+   return( nInstBytes );
+}
+
+/************************************************************************/
+/*                              ossimAuxType()                              */
+/************************************************************************/
+ossimAuxType::ossimAuxType()
+{
+   nBytes = 0;
+   nFields = 0;
+   m_auxFields = NULL;
+   auxTypeName = NULL;
+}
+
+ossimAuxType::~ossimAuxType()
+{
+   for(int i = 0; i < nFields; i++ )
+   {
+      delete m_auxFields[i];
+      m_auxFields[i] = 0;
+   }
+
+   if (auxTypeName != NULL)
+   {
+      delete[] auxTypeName;
+      auxTypeName = 0;
+   }
+}
+
+const char* ossimAuxType::initialize( const char * typeInput )
+{
+   int		i;
+   if( *typeInput != '{' )
+   {
+      while( *typeInput != '{' && *typeInput != '\0' )
+         typeInput++;
+
+      if( *typeInput == '\0' )
+         return NULL;
+   }
+
+   typeInput++;
+
+   while( typeInput != NULL && *typeInput != '}' )
+   {
+      ossimAuxField	*newField = new ossimAuxField();
+
+      typeInput = newField->initialize( typeInput );
+      if( typeInput != NULL )
+      {
+         m_auxFields = (ossimAuxField **)realloc(m_auxFields, sizeof(void*) * (nFields+1) );
+         m_auxFields[nFields++] = newField;
+      }
+      else
+      {
+         delete newField;
+      }
+   }
+
+   if( typeInput == NULL )
+   {
+      return NULL;
+   }
+
+   typeInput++; /* skip `}' */
+
+   for( i = 0; typeInput[i] != '\0' && typeInput[i] != ','; i++ ) {}
+
+   auxTypeName = (char *) malloc(i+1);
+   strncpy( auxTypeName, typeInput, i );
+   auxTypeName[i] = '\0';
+
+   typeInput += i+1;
+
+   return( typeInput );
+}
+
+void ossimAuxType::completeDefn( ossimAuxDictionary* auxDict )
+{
+   int		i;
+
+   if( nBytes != 0 )
+      return;
+
+   for( i = 0; i < nFields; i++ )
+   {
+      m_auxFields[i]->completeDefn( auxDict );
+      if( m_auxFields[i]->nBytes < 0 || nBytes == -1 )
+      {
+         nBytes = -1;
+      }
+      else
+      {
+         nBytes += m_auxFields[i]->nBytes;
+      }
+   }
+}
+
+int ossimAuxType::extractInstValue( const char * auxFieldPath,
+                                    char *entryData, ossim_uint32 nDataOffset, int nDataSize,
+                                    char chReqType, void *reqReturn )
+
+{
+   int		nArrayIndex = 0, nNameLen, iField, nByteOffset;
+   const char	*remainder;
+
+   const char *firstArray = strchr(auxFieldPath,'[');
+   const char *firstDot = strchr(auxFieldPath,'.');
+
+   if( firstArray != NULL
+       && (firstDot == NULL
+           || firstDot > firstArray) )
+   {
+      const char	*theEnd = firstArray;
+
+      nArrayIndex = atoi(theEnd+1);
+      nNameLen = theEnd - auxFieldPath;
+
+      remainder = strchr(auxFieldPath,'.');
+      if( remainder != NULL )
+      {
+         remainder++;
+      }
+   }
+   else if( firstDot != NULL )
+   {
+      const char	*theEnd = firstDot;
+
+      nNameLen = theEnd - auxFieldPath;
+
+      remainder = theEnd + 1;
+   }
+   else
+   {
+      nNameLen = (int)strlen(auxFieldPath);
+      remainder = NULL;
+   }
+
+   //Find this field within this type, if possible.                 
+   nByteOffset = 0;
+   for( iField = 0; iField < nFields && nByteOffset < nDataSize; iField++ )
+   {
+      std::string tmpFieldPath = const_cast<char*>(auxFieldPath);
+      tmpFieldPath = tmpFieldPath.substr(0, nNameLen);
+      std::string tmpFieldName = const_cast<char*>(m_auxFields[iField]->fieldName);
+      tmpFieldName = tmpFieldName.substr(0, nNameLen);
+      if( strcmp(tmpFieldPath.c_str(),tmpFieldName.c_str()) == 0
+          && m_auxFields[iField]->fieldName[nNameLen] == '\0' )
+      {
+         break;
+      }
+
+      nByteOffset +=
+         m_auxFields[iField]->getInstBytes( entryData + nByteOffset,
+                                            nDataSize - nByteOffset );
+   }
+
+   if( iField == nFields || nByteOffset >= nDataSize )
+   {
+      return false;
+   }
+
+   //Extract this field value, and return.                          
+   return( m_auxFields[iField]->
+           extractInstValue( remainder, nArrayIndex,
+                             entryData + nByteOffset,
+                             nDataOffset + nByteOffset,
+                             nDataSize - nByteOffset,
+                             chReqType, reqReturn ) );
+}
+
+int ossimAuxType::getInstBytes( char* entryData, int nDataSize )
+{
+   if( nBytes >= 0 )
+   {
+      return( nBytes );
+   }
+   else
+   {
+      int	nTotal = 0;
+      int	iField;
+
+      for( iField = 0; iField < nFields && nTotal < nDataSize; iField++ )
+      {
+         ossimAuxField	*poField = m_auxFields[iField];
+
+         int nInstBytes = poField->getInstBytes( entryData,
+                                                 nDataSize - nTotal );
+
+         entryData += nInstBytes;
+         nTotal += nInstBytes;
+      }
+
+      return( nTotal );
+   }
+}
+
+/************************************************************************/
+/*                              ossimAuxDictionary()                              */
+/************************************************************************/
+static const char *defDefn[] = {
+   "Eprj_MapInfo", 
+   "{0:pcproName,1:*oEprj_Coordinate,upperLeftCenter,1:*oEprj_Coordinate,lowerRightCenter,1:*oEprj_Size,pixelSize,0:pcunits,}Eprj_MapInfo",
+   NULL,
+   NULL };
+
+ossimAuxDictionary::ossimAuxDictionary( const char* auxDictStr )
+{
+   int		i;
+   nTypes = 0;
+   nTypesMax = 0;
+   m_auxTypes = NULL;
+
+   //Read all the types.            
+   while( auxDictStr != NULL && *auxDictStr != '.' )
+   {
+      ossimAuxType* newType = new ossimAuxType();
+      auxDictStr = newType->initialize( auxDictStr );
+
+      if( auxDictStr != NULL )
+      {
+         addType( newType );
+      }
+      else
+      {
+         delete newType;
+      }
+   }
+
+   for( i = 0; defDefn[i] != NULL; i += 2 )
+   {
+      if( findType( defDefn[i] ) == NULL )
+      {
+         ossimAuxType *newType = new ossimAuxType();
+
+         newType->initialize( defDefn[i+1] );
+         addType( newType );
+      }
+   }
+
+   //Complete the definitions.    
+   for( i = 0; i < nTypes; i++ )
+   {
+      m_auxTypes[i]->completeDefn( this );
+   }
+}
+
+ossimAuxDictionary::~ossimAuxDictionary()
+{
+   for(int i = 0; i < nTypes; i++ )
+   {
+      delete m_auxTypes[i];
+      m_auxTypes[i] = 0;
+   }
+}
+
+void ossimAuxDictionary::addType( ossimAuxType *type )
+
+{
+   if( nTypes == nTypesMax )
+   {
+      nTypesMax = nTypes * 2 + 10;
+      m_auxTypes = (ossimAuxType **) realloc( m_auxTypes,
+                                              sizeof(void*) * nTypesMax );
+   }
+
+   m_auxTypes[nTypes++] = type;
+}
+
+ossimAuxType* ossimAuxDictionary::findType( const char * name )
+
+{
+   int		i;
+
+   for( i = 0; i < nTypes; i++ )
+   {
+      if( strcmp(name, m_auxTypes[i]->auxTypeName) == 0 )
+      {
+         return( m_auxTypes[i] );
+      }
+   }
+
+   return NULL;
+}
+
+int ossimAuxDictionary::getItemSize( char chType )
+
+{
+   switch( chType )
+   {
+      case '1':
+      case '2':
+      case '4':
+      case 'c':
+      case 'C':
+         return 1;
+
+      case 'e':
+      case 's':
+      case 'S':
+         return 2;
+
+      case 't':
+      case 'l':
+      case 'L':
+      case 'f':
+         return 4;
+
+      case 'd':
+      case 'm':
+         return 8;
+
+      case 'M':
+         return 16;
+
+      case 'b':
+         return -1;
+
+      case 'o':
+      case 'x':
+         return 0;
+   }
+
+   return 0;
+}
diff --git a/src/support_data/ossimAuxXmlSupportData.cpp b/src/support_data/ossimAuxXmlSupportData.cpp
new file mode 100644
index 0000000..e712003
--- /dev/null
+++ b/src/support_data/ossimAuxXmlSupportData.cpp
@@ -0,0 +1,353 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Utility/support data class to extract the projection from a dot aux dot xml
+// file commonly found with mrsid data.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimAuxXmlSupportData.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimXmlAttribute.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimProjection.h>
+#include <memory>
+
+// Static trace for debugging.
+static const ossimTrace traceDebug( ossimString("ossimAuxXmlSupportData:debug") );
+
+ossimAuxXmlSupportData::ossimAuxXmlSupportData()
+{
+}
+
+ossimAuxXmlSupportData::~ossimAuxXmlSupportData()
+{
+}
+
+ossimRefPtr<ossimProjection> ossimAuxXmlSupportData::getProjection(const ossimFilename& file) const
+{
+   ossimRefPtr<ossimProjection> result = 0;
+
+   std::shared_ptr<ossim::istream> is = ossim::StreamFactoryRegistry::instance()->
+      createIstream(file, std::ios_base::in | std::ios_base::binary);
+
+   if ( is && is->good() )
+   {
+      // Read the xml document:
+      ossimXmlDocument xdoc;
+      if ( xdoc.read( *is ) )
+      {
+         // Get the WKT string
+         ossimString wkt;
+         ossimString path = "/PAMDataset/Metadata/GeodataXform/SpatialReference/WKT";
+         if ( getPath( path, xdoc, wkt ) )
+         {
+            if ( wkt.size() )
+            {
+               // Substitute """:
+               ossimString tmpWkt = wkt.substitute( ossimString("""), ossimString(""), true );
+               
+               ossimString name;
+               if ( getProjcsName( tmpWkt.string(), name.string() ) )
+               {
+                  result = ossimProjectionFactoryRegistry::instance()->createProjection( name );
+                  if ( result.valid() == false )
+                  {
+                     // Hack...
+                     if ( name.contains("_NAD83_") )
+                     {
+                        cout << "name1: " << name << endl;
+                        name.gsub( ossimString("Georef_NAD83_m"), ossimString("GeoRef_M"), false );
+                        name.string() = std::string("NAD_1983_") + name.string();
+                        cout << "name2: " << name << endl;
+                        result = ossimProjectionFactoryRegistry::instance()->
+                           createProjection( name );
+                     }
+                  }
+                  
+                  if ( result.valid() )
+                  {
+                     if ( initializeProjection( xdoc, tmpWkt.string(), result.get() ) == false )
+                     {
+                        // Zero out the result if tie or scale not set.
+                        result = 0;
+                     }
+                  }
+               }
+            }
+         }
+      }  
+   }
+   
+   return result;
+   
+} // End: ossimAuxXmlSupportData::getProjection
+
+bool ossimAuxXmlSupportData::initializeProjection( const ossimXmlDocument xdoc,
+                                                   const std::string& wkt, 
+                                                   ossimProjection* proj ) const
+{
+   bool result = false;
+
+   ossimRefPtr<ossimMapProjection> mapProj = dynamic_cast<ossimMapProjection*>( proj );
+   if ( mapProj.valid() )
+   {
+      // Find the tie and scale.
+      ossimString path = "/PAMDataset/Metadata/MDI";
+      std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
+      xdoc.findNodes(path, xnodes);
+      if ( xnodes.size() )
+      {
+         ossimDpt tie;
+         ossimDpt scale;
+         tie.makeNan();
+         scale.makeNan();
+         
+         for ( ossim_uint32 i = 0; i < xnodes.size(); ++i )
+         {
+            if ( xnodes[i].valid() )
+            {
+               ossimString value;
+               ossimString attrName = "key";
+               
+               ossimRefPtr<ossimXmlAttribute> attr = xnodes[i]->findAttribute( attrName );
+               if ( attr.valid() )
+               {
+                  if (attr->getValue() == "IMAGE__XY_ORIGIN" )
+                  {
+                     value = xnodes[i]->getText();
+                     if ( value.size() )
+                     {
+                        // Split it:
+                        std::vector<ossimString> list;
+                        value.split( list, ossimString(","), true );
+                        if ( list.size() == 2 )
+                        {
+                           if ( list[0].size() )
+                           {
+                              tie.x = list[0].toFloat64();
+                           }
+                           if ( list[1].size() )
+                           {
+                              tie.y = list[1].toFloat64();
+                           }
+                        }
+                     }
+                  }
+                  else if (attr->getValue() == "IMAGE__X_RESOLUTION" )
+                  {
+                     value = xnodes[i]->getText();
+                     if ( value.size() )
+                     {
+                        scale.x = value.toFloat64();
+                     }
+                  }
+                  else if (attr->getValue() == "IMAGE__Y_RESOLUTION" )
+                  {
+                     value = xnodes[i]->getText();
+                     if ( value.size() )
+                     {
+                        scale.y = value.toFloat64();
+                     }
+                  }
+               }
+               
+            } // Matches: if ( xnodes[i].valid() )
+            
+         } // Matches: for ( ossim_uint32 i = 0; i < xnodes.size(); ++i )
+
+         if ( !tie.hasNans() && !scale.hasNans() )
+         {
+            if ( mapProj->isGeographic() )
+            {
+               // Assuming tie and scale in decimal degrees:
+               mapProj->setDecimalDegreesPerPixel( scale );
+               ossimGpt gpt(tie.y, tie.x, 0.0);
+               mapProj->setUlTiePoints( ossimGpt( gpt ) );
+               result = true;
+            }
+            else
+            {
+               // Get the units:
+               ossimUnitType units = getUnits( wkt );
+
+               // Convert to meters:
+               result = true;
+               if ( units != OSSIM_METERS )
+               {
+                  if ( units == OSSIM_FEET )
+                  {
+                     tie.x = tie.x * MTRS_PER_FT;
+                     tie.y = tie.y * MTRS_PER_FT;
+                     scale.x = scale.x * MTRS_PER_FT;
+                     scale.y = scale.y * MTRS_PER_FT;                     
+                  }
+                  else if ( units == OSSIM_US_SURVEY_FEET)
+                  {
+                     tie.x = tie.x * US_METERS_PER_FT;
+                     tie.y = tie.y * US_METERS_PER_FT;
+                     scale.x = scale.x * OSSIM_US_SURVEY_FEET;
+                     scale.y = scale.y * OSSIM_US_SURVEY_FEET;
+                  }
+                  else
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "ossimAuxXmlSupportData::initializeProjection WARNING: "
+                        << "Unhandled unit type: " << units << std::endl;
+                     result = false;
+                  }
+               }
+
+               if ( result )
+               {
+                  mapProj->setMetersPerPixel( scale );
+                  mapProj->setUlTiePoints( tie );
+               }
+            }
+         }
+         
+      } // Matches: if ( xnodes.size() ) 
+   }
+
+   return result;
+   
+} // ossimAuxXmlSupportData::initializeProjection
+
+bool ossimAuxXmlSupportData::getPath(
+   const ossimString& path, const ossimXmlDocument& xdoc, ossimString& s) const
+{
+   bool result = false;
+
+   std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
+   xdoc.findNodes(path, xnodes);
+   if ( xnodes.size() == 1 ) // Error if more than one.
+   {
+      if ( xnodes[0].valid() )
+      {
+         s = xnodes[0]->getText();
+         result = true;
+      }
+      else if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimAuxXmlSupportData::getPath ERROR:\n"
+            << "Node not found: " << path
+            << std::endl;
+      }
+   }
+   else if ( xnodes.size() == 0 )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimAuxXmlSupportData::getPath ERROR:\n"
+            << "Node not found: " << path
+            << std::endl;
+      }
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimAuxXmlSupportData::getPath ERROR:\n"
+            << "Multiple nodes found: " << path
+            << std::endl;
+      }
+   }
+
+   if (!result)
+   {
+      s.clear();
+   }
+   return result;
+   
+} // bool ossimAuxXmlSupportData::getPath
+
+
+
+bool ossimAuxXmlSupportData::getProjcsName( const std::string& wkt,
+                                            std::string& name ) const
+{
+   bool result = false;
+   
+   if ( wkt.size() )
+   {
+      // Find "PROJCS":
+      std::string::size_type startPos = wkt.find( std::string("PROJCS[") );
+      if ( startPos != std::string::npos )
+      {
+         startPos += 7; // Move to end of projcs[ string.
+         
+         // Find first comma ',':
+         std::string::size_type endPos = wkt.find( ',', startPos+1 );
+         if ( endPos != std::string::npos )
+         {
+            if ( startPos < endPos )
+            {
+               name = wkt.substr( startPos, endPos-startPos );
+               if ( name.size() )
+               {
+                  result = true;
+               }
+            }
+         }
+      }
+   }
+   
+   return result;
+                  
+} // End: ossimAuxXmlSupportData::getProgcsName
+
+ossimUnitType ossimAuxXmlSupportData::getUnits( const std::string& wkt ) const
+{
+   ossimUnitType units = OSSIM_UNIT_UNKNOWN;
+   if ( wkt.size() )
+   {
+      // Note this is order dependent, i.e. you have to look for "Foot_US" before "Foot".
+      ossimString os = wkt;
+      os.downcase();
+      if ( os.contains("feet_intl") )
+      {
+         units = OSSIM_FEET;
+      }
+      else if ( os.contains("foot_us") )
+      {
+         units = OSSIM_US_SURVEY_FEET;
+      }
+      else if ( os.contains("feet") || os.contains("foot") )
+      {
+         units = OSSIM_FEET;
+      }
+      //---
+      // There can be two "unit" blocks.  One for PROJCS and one for GEOGCS.
+      // Do this last as the GEOGCS block will have Degree in it. May need to split
+      // the two blocks and then search if this doesn't work.
+      //---
+      else if ( os.contains("degree") )
+      {
+         units = OSSIM_DEGREES;
+      }
+   }
+
+   return units;
+   
+} // End: ossimAuxXmlSupportData::getUnits
diff --git a/src/support_data/ossimCcfInfo.cpp b/src/support_data/ossimCcfInfo.cpp
new file mode 100644
index 0000000..82f1905
--- /dev/null
+++ b/src/support_data/ossimCcfInfo.cpp
@@ -0,0 +1,69 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CCF Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <iostream>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/support_data/ossimCcfInfo.h>
+#include <ossim/imaging/ossimCcfHead.h>
+
+ossimCcfInfo::ossimCcfInfo()
+{
+}
+
+ossimCcfInfo::~ossimCcfInfo()
+{
+}
+
+bool ossimCcfInfo::open(const ossimFilename& file)
+{
+   std::string connectionString = file.c_str();
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
+
+   if(!str) return false;
+   
+   return open(str, connectionString);
+
+}
+
+bool ossimCcfInfo::open(std::shared_ptr<ossim::istream>& str,
+                        const std::string& connectionString)
+{
+   bool result = false;
+   m_fileStr.reset();
+   m_connectionString.clear();
+   ossimString extension = ossimFilename(connectionString).ext();
+
+   extension.downcase();
+
+   if (extension == "ccf")
+   {
+      m_fileStr = str;
+      m_connectionString = connectionString;
+      result = true;
+   }
+
+   return result;
+
+} 
+
+std::ostream& ossimCcfInfo::print(std::ostream& out) const
+{
+   if(m_fileStr)
+   {
+      ossimCcfHead ccf(m_fileStr, m_connectionString);
+      out << "File:  " << m_connectionString << "\n" << ccf;
+   }
+   return out;
+}
diff --git a/ossim/src/ossim/support_data/ossimCeosData.cpp b/src/support_data/ossimCeosData.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimCeosData.cpp
rename to src/support_data/ossimCeosData.cpp
diff --git a/src/support_data/ossimDemGrid.cpp b/src/support_data/ossimDemGrid.cpp
new file mode 100644
index 0000000..3ceabbf
--- /dev/null
+++ b/src/support_data/ossimDemGrid.cpp
@@ -0,0 +1,249 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Ken Melero (kmelero at imagelinks.com)
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class defines a DEM grid.
+//
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimDemGrid.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/support_data/ossimDemPoint.h>
+#include <ossim/support_data/ossimDemUtil.h>
+
+
+ossimDemGrid::ossimDemGrid(ossim_float32 missingDataValue)
+   : _missDataVal(missingDataValue),
+     _width(0),
+     _height(0),
+     _grid(0),
+     _firstTime(true),
+     _curProfile(0)
+{        
+}
+
+ossimDemGrid::~ossimDemGrid()
+{
+   if(_grid)
+   {
+      delete [] _grid;
+      _grid =0;
+   }
+}
+
+long
+ossimDemGrid::read(ossim::istream& dem, bool incrementalRead)
+{
+   if (_firstTime)
+   {
+      dem >> _header;
+   }
+
+   long retval;
+   if (_header.getGroundRefSysCode() == 0)  // Geographic
+      retval = fillGeographic(dem,incrementalRead);
+   else
+      retval = fillUTM(dem,incrementalRead);   // This may not work if it's 
+                                               // really in State Plane.
+
+   if (_firstTime)
+      _firstTime = false;
+
+   return retval;
+}
+
+ossimDemHeader const&
+ossimDemGrid::getHeader() const
+{
+   return _header;
+}
+
+long
+ossimDemGrid::getWidth() const
+{
+   return _width;
+}
+
+long
+ossimDemGrid::getHeight() const
+{
+   return _height;
+}
+
+ossim_float32 ossimDemGrid::getElevation(long x, long y) const
+{
+   if (_grid == 0)
+      return _missDataVal;
+
+   if ((x < 0) || (y < 0) || (x >= _width) || (y >= _height))
+      return _missDataVal;
+
+   return _grid[(y * _width) + x];
+}
+
+ossim_float32 ossimDemGrid::getMissingDataValue() const
+{
+   return _missDataVal;
+}
+
+long ossimDemGrid::fillGeographic(ossim::istream& dem,bool incrementalRead)
+{
+   if (_firstTime) {
+      _curProfile = 0;
+      _width = _header.getProfileColumns();
+   }
+
+   while (_curProfile < _width)
+   {
+      _profiles.push_back(ossimDemProfile());
+      dem >> _profiles.back();
+      _curProfile++;
+      if (incrementalRead)
+         return _width - _curProfile + 1;
+   }
+
+   // Assume all profiles have as many elevations as the first.
+   _height = _profiles[0].getNumberOfElevations();
+   if(_grid)
+   {
+      delete [] _grid;
+      _grid =0;
+   }
+   _grid = new ossim_float32[_width * _height];
+
+   ossimDemPoint sw_corner = _profiles[0].getProfileLocation();
+   _northwest_x = sw_corner.getX();
+   _northwest_y = sw_corner.getY() 
+                  + ((_profiles[0].getNumberOfElevations() - 1) * _header.getSpatialResY());
+
+
+   unsigned int i,j;
+   for (i = 0; (int)i < _width; i++)
+   {
+      ossimDemElevationVector const& elev = _profiles[i].getElevations();
+      for (j = 0; j < elev.size(); j++)
+      {
+         setElevation(i, _height - j - 1, elev[j]);
+      }
+   }
+
+   _profiles.erase(_profiles.begin(), _profiles.end());
+
+   return 0;
+}
+
+long
+ossimDemGrid::fillUTM(ossim::istream& dem, bool incrementalRead)
+{
+   // 7.5 UTM DEMs are small enough we can get away with doing this stupid...
+
+   unsigned int i;
+   unsigned int x,y;
+
+   if (_firstTime)
+   {
+      _curProfile = 0;
+      _width = _header.getProfileColumns();
+   }
+
+
+   while (_curProfile < _width)
+   {
+      _profiles.push_back(ossimDemProfile());
+      dem >> _profiles.back();
+      _curProfile++;
+      if (incrementalRead)
+         return _width - _curProfile + 1;
+   }
+
+   double dy = _header.getSpatialResY();
+
+   // Determine min and max Y values.
+   // Some DEMs can have profiles which do not have any
+   // elevations, and erroneous (x,y) values. I suspect
+   // these are probably illegal DEMs, but we'll try to
+   // do the right thing anyway.
+   ossimDemPoint curpoint;
+   i = 0;
+   while ((_profiles[i].getNumberOfElevations() == 0) &&
+          (i < _profiles.size()))
+      i++;
+   if (i < _profiles.size())
+      curpoint = _profiles[i].getProfileLocation();
+   else
+   {
+      // XXX This isn't the best way to handle this...
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimDemGrid::fillUTM: Yikes! All profiles have zero elevations!\n";
+      return(1);
+   }
+ 
+   double miny, maxy;
+   miny = curpoint.getY();
+   maxy = miny;
+   double profymin, profymax;  // Min and max y values for current profile.
+   for (i = 0; i < _profiles.size(); i++)
+   {
+      if (_profiles[i].getNumberOfElevations() > 0)
+      {
+         curpoint = _profiles[i].getProfileLocation();
+         profymin = curpoint.getY();
+         profymax = profymin + ((_profiles[i].getNumberOfElevations() - 1) * dy);
+
+         if (profymin < miny)
+            miny = profymin;
+         if (profymax > maxy)
+            maxy = profymax;
+      }
+   }
+
+   // We now have minimum and maximum y values over all profiles in the DEM.
+   // Allocate a rectangular array large enough to hold them.
+
+   _height = static_cast<long>(((maxy - miny) / dy) + 1);
+   if(_grid)
+   {
+      delete [] _grid;
+      _grid =0;
+   }
+   _grid = new ossim_float32[_width * _height];
+
+   // Fill grid with the "missing data" value.
+   for (i = 0; (int)i < _width * _height; i++)
+      _grid[i] = _missDataVal;
+
+   ossimDemPoint sw_corner = _profiles[0].getProfileLocation();
+   _northwest_x = sw_corner.getX();
+   _northwest_y = maxy;
+
+
+   // Now, insert the elevations in the profiles in the appropriate place in the grid.
+
+   long startpos;
+   for (x = 0; (int)x < _width; x++)
+   {
+      ossimDemElevationVector const& elev = _profiles[x].getElevations();
+      curpoint = _profiles[x].getProfileLocation();
+      startpos = static_cast<long>((curpoint.getY() - miny) / dy);
+      for (y = 0; y < elev.size(); y++)
+      {
+         setElevation(x, _height - startpos - y - 1, elev[y]);
+      }
+   }
+
+   _profiles.erase(_profiles.begin(), _profiles.end());
+
+   return 0;
+}
+
+void
+ossimDemGrid::getGroundCoords(long x, long y, double& ground_x,
+                              double& ground_y)
+{
+   ground_x = _northwest_x + (x * _header.getSpatialResX());
+   ground_y = _northwest_y - (y * _header.getSpatialResY());
+}
diff --git a/src/support_data/ossimDemHeader.cpp b/src/support_data/ossimDemHeader.cpp
new file mode 100644
index 0000000..8084fbe
--- /dev/null
+++ b/src/support_data/ossimDemHeader.cpp
@@ -0,0 +1,889 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class parses a DEM header.
+//
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimDemHeader.h>
+#include <ossim/support_data/ossimDemUtil.h>
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimString.h>
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+
+static const char* PROCESS_CODE[]
+= { "Autocorrelation resample simple bilinear",
+    "Manual profile GRIDEM simple bilinear",
+    "DLG/hypsography CTOG 8-direction bilinear",
+    "Interpolation from photogrammetic system contours DCASS",
+    "direction bilinear",
+    "DLG/hypsography LINETRACE, LT4X complex linear",
+    "DLG/hypsography CPS-3, ANUDEM, GRASS complex polynomial",
+    "Electronic imaging (non-photogrammetric), active or passive",
+    "sensor systems" };
+
+static const int MAX_PROCESS_CODE_INDEX = 8;
+
+static const char* GROUND_REF_SYSTEM[]
+= { "Geographic",
+    "UTM",
+    "State Plane" };
+
+static const int MAX_GROUND_REF_SYSTEM_INDEX = 2;
+
+static const char* GROUND_REF_SYSTEM_UNITS[]
+= { "Radians",
+    "Feet",
+    "Meters",
+    "Arc Seconds" };
+
+static const int MAX_GROUND_REF_SYSTEM_UNITS_INDEX = 3;
+
+
+static const char* VERTICAL_DATUM[]
+= { "local mean sea level",
+    "National Geodetic Vertical Datum 1929",
+    "North American Vertical Datum 1988" };
+
+static const int MAX_VERTICAL_DATUM_INDEX = 2;
+
+static const char* HORIZONTAL_DATUM[]
+= { "North American Datum 1927 (NAD 27)",
+    "World Geoditic System 1972 (WGS 72)",
+    "WGS 84",
+    "NAD 83",
+    "Old Hawaii Datum",
+    "Puerto Rico Datum" };
+
+static const int MAX_HORIZONTAL_DATUM_INDEX = 5;
+
+
+ossimDemHeader::ossimDemHeader()
+   : _seGeoCornerX(0.0),
+     _seGeoCornerY(0.0),
+     _processCode(0),
+     _levelCode(0),
+     _elevPattern(0),
+     _groundRefSysCode(0),
+     _groundRefSysZone(0),
+     _groundRefSysUnits(0),
+     _elevUnits(0),
+     _numPolySides(0),
+     _counterclockAngle(0.0),
+     _elevAccuracyCode(0),
+     _minElevation(0),
+     _maxElevation(0),
+     _spatialResX(0.0),
+     _spatialResY(0.0),
+     _spatialResZ(0.0),
+     _profileRows(0),
+     _profileColumns(0),
+     _largeContInt(0),
+     _maxSourceUnits(0),
+     _smallContInt(0),
+     _minSourceUnits(0),
+     _sourceDate(0),
+     _inspRevDate(0),
+     _valFlag(0),
+     _suspectVoidFlg(0),
+     _vertDatum(0),
+     _horizDatum(0),
+     _dataEdition(0),
+     _perctVoid(0),
+     _westEdgeFlag(0),
+     _northEdgeFlag(0),
+     _eastEdgeFlag(0),
+     _southEdgeFlag(0),
+     _vertDatumShift(0.0)
+{
+}
+   
+std::string const&
+ossimDemHeader::getQuadName() const
+{
+   return _quadName;
+}
+
+std::string const&
+ossimDemHeader::getProcessInfo() const
+{
+   return _processInfo;
+}
+
+double
+ossimDemHeader::getSEGeoCornerX() const
+{
+   return _seGeoCornerX;
+}
+
+double
+ossimDemHeader::getSEGeoCornerY() const
+{
+   return _seGeoCornerY;
+}
+
+ossim_int32
+ossimDemHeader::getProcessCode() const
+{
+   return _processCode;
+}
+
+std::string const&
+ossimDemHeader::getSectionIndicator() const
+{
+   return _sectionIndicator;
+}
+
+std::string const&
+ossimDemHeader::getMappingCenterCode() const
+{
+   return _mapCenterCode;
+}
+
+ossim_int32
+ossimDemHeader::getLevelCode() const
+{
+   return _levelCode;
+}
+         
+ossim_int32
+ossimDemHeader::getElevPattern() const
+{
+   return _elevPattern;
+}
+
+ossim_int32
+ossimDemHeader::getGroundRefSysCode() const
+{
+   return _groundRefSysCode;
+}
+    
+ossim_int32
+ossimDemHeader::getGroundRefSysZone() const
+{
+   return _groundRefSysZone;
+}
+
+ossim_int32
+ossimDemHeader::getGroundRefSysUnits() const
+{
+   return _groundRefSysUnits;
+}
+
+ossim_int32
+ossimDemHeader::getElevationUnits() const
+{
+   return _elevUnits;
+}
+
+ossim_int32
+ossimDemHeader::getNumPolySides() const
+{
+   return _numPolySides;
+}
+
+ossimDemPointVector const&
+ossimDemHeader::getDEMCorners() const
+{
+   return _demCorners;
+}
+
+double
+ossimDemHeader::getCounterclockAngle() const
+{
+   return _counterclockAngle;
+}
+
+ossim_int32
+ossimDemHeader::getElevAccuracyCode() const
+{
+   return _elevAccuracyCode;
+}
+
+double
+ossimDemHeader::getMinimumElev() const
+{
+   return _minElevation;
+}
+
+double
+ossimDemHeader::getMaximumElev() const
+{
+   return _maxElevation;
+}
+
+double
+ossimDemHeader::getSpatialResX() const
+{
+   return _spatialResX;
+}
+
+double
+ossimDemHeader::getSpatialResY() const
+{
+   return _spatialResY;
+}
+
+double
+ossimDemHeader::getSpatialResZ() const
+{
+   return _spatialResZ;
+}
+
+ossim_int32
+ossimDemHeader::getProfileRows() const
+{
+   return _profileRows;
+}
+
+ossim_int32
+ossimDemHeader::getProfileColumns() const
+{
+   return _profileColumns;
+}
+
+ossim_int32
+ossimDemHeader::getLargeContInt() const
+{
+   return _largeContInt;
+}
+
+ossim_int32
+ossimDemHeader::getMaxSourceUnits() const
+{
+   return _maxSourceUnits;
+}
+
+ossim_int32
+ossimDemHeader::getSmallContInt() const
+{
+   return _smallContInt;
+}
+
+ossim_int32
+ossimDemHeader::getMinSourceUnits() const
+{
+   return _minSourceUnits;
+}
+
+ossim_int32
+ossimDemHeader::getSourceDate() const
+{
+   return _sourceDate;
+}
+
+ossim_int32
+ossimDemHeader::getInspRevDate() const
+{
+   return _inspRevDate;
+}
+
+std::string const&
+ossimDemHeader::getInspFlag() const
+{
+   return _inspFlag;
+}
+
+ossim_int32
+ossimDemHeader::getDataValFlag() const
+{
+   return _valFlag;
+}
+
+ossim_int32
+ossimDemHeader::getSuspectVoidFlag() const
+{
+   return _suspectVoidFlg;
+}
+
+ossim_int32
+ossimDemHeader::getVertDatum () const
+{
+   return _vertDatum;
+}
+
+ossim_int32
+ossimDemHeader::getHorizDatum() const
+{
+   return _horizDatum;
+}
+
+ossim_int32
+ossimDemHeader::getDataEdition() const
+{
+   return _dataEdition;
+}
+
+ossim_int32
+ossimDemHeader::getPerctVoid() const
+{
+   return _perctVoid;
+}
+
+ossim_int32
+ossimDemHeader::getWestEdgeFlag() const
+{
+   return _westEdgeFlag;
+}
+
+ossim_int32
+ossimDemHeader::getNorthEdgeFlag() const
+{
+   return _northEdgeFlag;
+}
+
+ossim_int32
+ossimDemHeader::getEastEdgeFlag() const
+{
+   return _eastEdgeFlag;
+}
+
+ossim_int32
+ossimDemHeader::getSouthEdgeFlag() const
+{
+   return _southEdgeFlag;
+}
+
+double
+ossimDemHeader::getVertDatumShift() const
+{
+   return _vertDatumShift;
+}
+
+std::ostream&
+operator<<(std::ostream& s, const ossimDemHeader& header)
+{
+   return header.print(s);
+}
+
+bool ossimDemHeader::open(const ossimFilename& file)
+{
+   bool result = ossimDemUtil::isUsgsDem(file);
+   std::string connectionString = file.c_str();
+   std::shared_ptr<ossim::istream> is = ossim::StreamFactoryRegistry::instance()->
+      createIstream(connectionString, std::ios_base::in | std::ios_base::binary);
+   if(result)
+   {
+      if ( is && is->good() )
+      {
+         open( is, connectionString );
+      }
+      else
+      {
+         result = false;
+      }    
+   }
+
+   return result;
+}
+
+
+
+bool ossimDemHeader::open(std::shared_ptr<ossim::istream>& str,  
+                          const std::string& connectionString)
+{
+   bool result = ossimDemUtil::isUsgsDem(ossimFilename(connectionString));
+   if ( result&&str&& str->good() )
+   {
+
+      char* bufstr = new char[1024];
+      char* temp   = new char[1024];
+      ossim_int32 i;
+      
+      ossimDemUtil::getRecord(*str, bufstr);
+      
+      strncpy(temp, bufstr, 40);
+      temp[40] = '\0';
+      _quadName = temp;
+      
+      strncpy(temp,bufstr+40,40);
+      temp[40] = '\0';
+      _processInfo = temp;
+      
+      ossimDemUtil::getDouble(bufstr, 109, 13, _seGeoCornerX);
+      ossimDemUtil::getDouble(bufstr, 122, 13, _seGeoCornerY);
+      _processCode = ossimDemUtil::getLong(bufstr, 135, 1);
+      
+      strncpy(temp,bufstr+137,3);
+      temp[3] = '\0';
+      _sectionIndicator = temp;
+      
+      strncpy(temp,bufstr+140,4);
+      temp[4] = '\0';
+      _mapCenterCode = temp;
+      
+      _levelCode = ossimDemUtil::getLong(bufstr, 144, 6);
+      _elevPattern = ossimDemUtil::getLong(bufstr, 150, 6);
+      _groundRefSysCode = ossimDemUtil::getLong(bufstr, 156, 6);
+      _groundRefSysZone = ossimDemUtil::getLong(bufstr, 162, 6);
+      _groundRefSysUnits = ossimDemUtil::getLong(bufstr, 528, 6);
+      _elevUnits = ossimDemUtil::getLong(bufstr, 534, 6);
+      _numPolySides = ossimDemUtil::getLong(bufstr, 540, 6);
+      
+      for (i = 0; i < 4; i++)
+      {
+         double x,y;
+         ossim_int32 pos = 546 + (i * 48);
+         ossimDemUtil::getDouble(bufstr, pos, 24, x);
+         ossimDemUtil::getDouble(bufstr, pos + 24, 24, y);
+         _demCorners.push_back(ossimDemPoint(x,y));
+      }
+      
+      ossimDemUtil::getDouble(bufstr, 738, 24, _minElevation);
+      ossimDemUtil::getDouble(bufstr, 762, 24, _maxElevation);
+      ossimDemUtil::getDouble(bufstr, 786, 24, _counterclockAngle );
+      _elevAccuracyCode = ossimDemUtil::getLong(bufstr, 810, 6);
+      ossimDemUtil::getDouble(bufstr, 816, 12, _spatialResX);
+      ossimDemUtil::getDouble(bufstr, 828, 12, _spatialResY);
+      ossimDemUtil::getDouble(bufstr, 840, 12, _spatialResZ);
+      _profileRows = ossimDemUtil::getLong(bufstr, 852, 6);
+      _profileColumns = ossimDemUtil::getLong(bufstr, 858, 6);
+      _largeContInt = ossimDemUtil::getLong(bufstr, 864, 5);
+      _maxSourceUnits = ossimDemUtil::getLong(bufstr, 869, 1);
+      _smallContInt = ossimDemUtil::getLong(bufstr, 870, 5);
+      _minSourceUnits = ossimDemUtil::getLong(bufstr, 875, 1);
+      _sourceDate = ossimDemUtil::getLong(bufstr, 876, 4);
+      _inspRevDate = ossimDemUtil::getLong(bufstr, 880, 4);
+      
+      strncpy(temp, bufstr+884,1);
+      temp[1]='\0';
+      _inspFlag = temp;
+      
+      _valFlag = ossimDemUtil::getLong(bufstr, 885, 1);
+      _suspectVoidFlg = ossimDemUtil::getLong(bufstr, 886, 2);
+      _vertDatum = ossimDemUtil::getLong(bufstr, 888, 2);
+      _horizDatum = ossimDemUtil::getLong(bufstr, 890, 2);
+      if (_horizDatum == 0)
+         _horizDatum = 1;   // Default to NAD27
+      
+      _dataEdition = ossimDemUtil::getLong(bufstr, 892, 4);
+      _perctVoid = ossimDemUtil::getLong(bufstr, 896, 4);
+      _westEdgeFlag = ossimDemUtil::getLong(bufstr, 900, 2);
+      _northEdgeFlag = ossimDemUtil::getLong(bufstr, 902, 2);
+      _eastEdgeFlag = ossimDemUtil::getLong(bufstr, 904, 2);
+      _southEdgeFlag = ossimDemUtil::getLong(bufstr, 906, 2);
+      ossimDemUtil::getDouble(bufstr, 908, 7, _vertDatumShift);
+
+      delete [] bufstr;
+      delete [] temp;
+      bufstr = 0;
+      temp = 0;
+   }
+   return result;
+}
+
+
+std::istream& ossimDemHeader::open(ossim::istream& in)
+{
+   if(in.good())
+   {
+      char* bufstr = new char[1024];
+      char* temp   = new char[1024];
+      ossim_int32 i;
+      
+      ossimDemUtil::getRecord(in, bufstr);
+      
+      strncpy(temp, bufstr, 40);
+      temp[40] = '\0';
+      _quadName = temp;
+      
+      strncpy(temp,bufstr+40,40);
+      temp[40] = '\0';
+      _processInfo = temp;
+      
+      ossimDemUtil::getDouble(bufstr, 109, 13, _seGeoCornerX);
+      ossimDemUtil::getDouble(bufstr, 122, 13, _seGeoCornerY);
+      _processCode = ossimDemUtil::getLong(bufstr, 135, 1);
+      
+      strncpy(temp,bufstr+137,3);
+      temp[3] = '\0';
+      _sectionIndicator = temp;
+      
+      strncpy(temp,bufstr+140,4);
+      temp[4] = '\0';
+      _mapCenterCode = temp;
+      
+      _levelCode = ossimDemUtil::getLong(bufstr, 144, 6);
+      _elevPattern = ossimDemUtil::getLong(bufstr, 150, 6);
+      _groundRefSysCode = ossimDemUtil::getLong(bufstr, 156, 6);
+      _groundRefSysZone = ossimDemUtil::getLong(bufstr, 162, 6);
+      _groundRefSysUnits = ossimDemUtil::getLong(bufstr, 528, 6);
+      _elevUnits = ossimDemUtil::getLong(bufstr, 534, 6);
+      _numPolySides = ossimDemUtil::getLong(bufstr, 540, 6);
+      
+      for (i = 0; i < 4; i++)
+      {
+         double x,y;
+         ossim_int32 pos = 546 + (i * 48);
+         ossimDemUtil::getDouble(bufstr, pos, 24, x);
+         ossimDemUtil::getDouble(bufstr, pos + 24, 24, y);
+         _demCorners.push_back(ossimDemPoint(x,y));
+      }
+      
+      ossimDemUtil::getDouble(bufstr, 738, 24, _minElevation);
+      ossimDemUtil::getDouble(bufstr, 762, 24, _maxElevation);
+      ossimDemUtil::getDouble(bufstr, 786, 24, _counterclockAngle );
+      _elevAccuracyCode = ossimDemUtil::getLong(bufstr, 810, 6);
+      ossimDemUtil::getDouble(bufstr, 816, 12, _spatialResX);
+      ossimDemUtil::getDouble(bufstr, 828, 12, _spatialResY);
+      ossimDemUtil::getDouble(bufstr, 840, 12, _spatialResZ);
+      _profileRows = ossimDemUtil::getLong(bufstr, 852, 6);
+      _profileColumns = ossimDemUtil::getLong(bufstr, 858, 6);
+      _largeContInt = ossimDemUtil::getLong(bufstr, 864, 5);
+      _maxSourceUnits = ossimDemUtil::getLong(bufstr, 869, 1);
+      _smallContInt = ossimDemUtil::getLong(bufstr, 870, 5);
+      _minSourceUnits = ossimDemUtil::getLong(bufstr, 875, 1);
+      _sourceDate = ossimDemUtil::getLong(bufstr, 876, 4);
+      _inspRevDate = ossimDemUtil::getLong(bufstr, 880, 4);
+      
+      strncpy(temp, bufstr+884,1);
+      temp[1]='\0';
+      _inspFlag = temp;
+      
+      _valFlag = ossimDemUtil::getLong(bufstr, 885, 1);
+      _suspectVoidFlg = ossimDemUtil::getLong(bufstr, 886, 2);
+      _vertDatum = ossimDemUtil::getLong(bufstr, 888, 2);
+      _horizDatum = ossimDemUtil::getLong(bufstr, 890, 2);
+      if (_horizDatum == 0)
+         _horizDatum = 1;   // Default to NAD27
+      
+      _dataEdition = ossimDemUtil::getLong(bufstr, 892, 4);
+      _perctVoid = ossimDemUtil::getLong(bufstr, 896, 4);
+      _westEdgeFlag = ossimDemUtil::getLong(bufstr, 900, 2);
+      _northEdgeFlag = ossimDemUtil::getLong(bufstr, 902, 2);
+      _eastEdgeFlag = ossimDemUtil::getLong(bufstr, 904, 2);
+      _southEdgeFlag = ossimDemUtil::getLong(bufstr, 906, 2);
+      ossimDemUtil::getDouble(bufstr, 908, 7, _vertDatumShift);
+
+      delete [] bufstr;
+      delete [] temp;
+      bufstr = 0;
+      temp = 0;
+   }
+   return in;
+}
+
+
+std::ostream& ossimDemHeader::print(std::ostream& out) const
+{
+   const int W = 24; // format width
+   const int CW = W-8; // format corner width
+   
+   // Capture the original flags then set float output to full precision.
+   std::ios_base::fmtflags f = out.flags();
+
+   // Note:  This is only a partial print for now...
+   std::string prefix = "usgs_dem.";
+   
+   out << std::setiosflags(std::ios_base::fixed|std::ios_base::left)
+       << std::setprecision(10)
+      
+       << prefix << std::setw(W)
+       << "quadrangle_name:" << getQuadName().c_str() << "\n"
+       << prefix << std::setw(W)
+       << "process_info:" << getProcessInfo().c_str() << "\n"
+       << prefix << std::setw(W)
+       << "se_geo_corner_x:" << getSEGeoCornerX() << "\n"
+       << prefix << std::setw(W)
+       << "se_geo_corner_y:" << getSEGeoCornerY() << "\n"
+       << prefix << std::setw(W)
+       << "process_code:";
+   
+   ossim_int32 tmpl = getProcessCode() - 1;
+   if ( tmpl >= 0 && tmpl <= MAX_PROCESS_CODE_INDEX)
+   {
+      out << PROCESS_CODE[tmpl] << "\n";
+   }
+   else
+   {
+      out << "unknown" << "\n";
+   }
+
+   out << prefix << std::setw(W)
+       << "section_indicator: " << getSectionIndicator().c_str() << "\n"
+       << prefix << std::setw(W)
+       << "mapping_center_code: " << getMappingCenterCode().c_str() << "\n"
+       << prefix << std::setw(W)
+       << "level_code: " << getLevelCode() << "\n"
+       << prefix << std::setw(W)
+       << "elev_pattern: " << getElevPattern() << "\n"
+       << prefix << std::setw(W) << "ground_ref_sys: ";
+   
+   tmpl = getGroundRefSysCode();
+   if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_INDEX)
+   {
+      out << GROUND_REF_SYSTEM[tmpl] << "\n";
+   }
+   else
+   {
+      out << "unknown\n";
+   }
+   
+   out << prefix << std::setw(W)
+       << "ground_ref_sys_zone: " << getGroundRefSysZone() << "\n"
+       << prefix << std::setw(W)
+       << "ground_ref_sys_units:";
+   tmpl = getGroundRefSysUnits();
+   if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_UNITS_INDEX)
+   {
+      out << GROUND_REF_SYSTEM_UNITS[tmpl] << "\n";
+   }
+   else
+   {
+      out << "unknown\n";
+   }
+         
+   out << prefix << std::setw(W)
+       << "elevation_units: ";
+   tmpl = getElevationUnits();
+   if ( tmpl >= 0 && tmpl <= MAX_GROUND_REF_SYSTEM_UNITS_INDEX)
+   {
+      out << GROUND_REF_SYSTEM_UNITS[tmpl] << "\n";
+   }
+   else
+   {
+      out << "unknown\n";
+   }
+
+   out << prefix << std::setw(W)
+       << "number_poly_sides: " << getNumPolySides() << "\n"
+       << prefix << std::setw(W)
+       << "counterclock_angle: " << getCounterclockAngle()<< "\n"
+       << prefix << std::setw(W)
+       << "elev_accuracy_code: " << getElevAccuracyCode()<< "\n"
+       << prefix << std::setw(W)
+       << "minimum_elevation: " << getMinimumElev() << "\n"
+       << prefix << std::setw(W)
+       << "maximum_elevation: " << getMaximumElev() << "\n"
+       << prefix << std::setw(W)
+       << "spatial_res_x: " << getSpatialResX() << "\n"
+       << prefix << std::setw(W)
+       << "spatial_res_y: " << getSpatialResY() << "\n"
+       << prefix << std::setw(W)
+       << "spatial_res_z:" << getSpatialResZ() << "\n"
+       << prefix << std::setw(W)
+       << "profile_rows: " << getProfileRows() << "\n"
+       << prefix << std::setw(W)
+       << "profile_columns:" << getProfileColumns() << "\n"
+       << prefix << std::setw(W)
+       << "source_date:" << getSourceDate() << "\n"
+       << prefix << std::setw(W)
+       << "revision_date:" << getInspRevDate() << "\n"
+       << prefix  << std::setw(W)
+       << "vertical_datum:";
+   
+   tmpl = getVertDatum() - 1;
+   if ( tmpl >= 0 && tmpl <= MAX_VERTICAL_DATUM_INDEX)
+   {
+      out << VERTICAL_DATUM[tmpl] << "\n";
+   }
+   else
+   {
+      out << "unknown\n";
+   }
+
+   out << prefix << std::setw(W)
+       << "vertical_datum_shift:" << getVertDatumShift() << "\n"
+       << prefix << std::setw(W)
+       << "horizontal_datum:";
+   tmpl = getHorizDatum() - 1;
+   if ( tmpl >= 0 && tmpl <= MAX_HORIZONTAL_DATUM_INDEX)
+   {
+      out << HORIZONTAL_DATUM[tmpl] << "\n";
+   }
+   else
+   {
+      out << "unknown\n";
+   }
+
+   const ossimDemPointVector CORNERS = getDEMCorners();
+   for (unsigned int i=0; i < CORNERS.size(); ++i)
+   {
+      out << prefix << "corner[" << i
+          << std::setw(CW)<< "].x:  " << CORNERS[i].getX() << "\n"
+          << prefix << "corner[" << i
+          << std::setw(CW)<< "].y:  " << CORNERS[i].getY() << "\n"
+          << std::endl;
+   }
+
+   out << std::endl;
+
+   // Reset flags.
+   out.setf(f);   
+
+   return out;
+}
+
+ossim::istream& operator>>(ossim::istream& s, ossimDemHeader& header)
+{
+    return header.open(s);
+}
+
+bool ossimDemHeader::getImageGeometry(ossimKeywordlist& kwl,
+                                      const char* prefix) const
+{
+   ossimString type = getProjectionType();
+   ossimString datum = getHorizDatumCode();
+   if ( (type == "unknown") || (datum == "unknown") )
+   {
+      return false;
+   }
+
+   if (_demCorners.size() != 4)
+   {
+      return false;
+   }
+
+   double tieX   = _demCorners[1].getX();
+   double tieY   = _demCorners[1].getY();
+   double scaleX = getSpatialResX();
+   double scaleY = getSpatialResX();
+   
+   // Add these for all projections.
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           type);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::DATUM_KW,
+           datum);
+
+   if (getGroundRefSysCode() == 0) // Geographic.
+   {
+      // ESH 10/2008 -- The Dem ground units can be either radians or 
+      // arc seconds, so we have to convert parameters in these units 
+      // to degrees which is what OSSIM is assuming.
+      bool bIsArcSecs = (getGroundRefSysUnits() == 3) ? true : false;
+      bool bIsRadians = (getGroundRefSysUnits() == 0) ? true : false;
+
+      double convertFactor = 1.0;
+      if ( bIsArcSecs == true )
+      {
+         convertFactor = 1.0 / 3600;
+      }
+      else if ( bIsRadians == true )
+      {
+         convertFactor = 180.0 / M_PI;
+      }
+
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_LON_KW,
+              (tieX * convertFactor) );
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_LAT_KW,
+              (tieY * convertFactor) );
+      kwl.add(prefix,
+              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+              (scaleX * convertFactor) );
+      kwl.add(prefix,
+              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+              (scaleY * convertFactor) );
+   }
+   else if (getGroundRefSysCode() == 1) // UTM
+   {
+      // Get the zone.
+      kwl.add(prefix,
+              ossimKeywordNames::ZONE_KW,
+              abs(getGroundRefSysZone()));
+
+      // Set the hemisphere.
+      kwl.add(prefix,
+              ossimKeywordNames::HEMISPHERE_KW,
+              (getGroundRefSysZone()<0?"S":"N"));
+
+      // Set the tie.
+      if (getGroundRefSysUnits() == 1) // Feet...
+      {
+         tieX = ossim::usft2mtrs(tieX);
+         tieY = ossim::usft2mtrs(tieY);
+         scaleX = ossim::usft2mtrs(scaleX);
+         scaleY = ossim::usft2mtrs(scaleY);
+         
+      }
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_EASTING_KW,
+              tieX);
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_NORTHING_KW,
+              tieY);
+      kwl.add(prefix,
+              ossimKeywordNames::METERS_PER_PIXEL_X_KW,
+              scaleX);
+      kwl.add(prefix,
+              ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
+              scaleY);
+   }
+   else if (getGroundRefSysCode() == 2) // State Plane
+   {
+      return false; // Need to code...
+   }
+
+   
+   return true;
+}
+
+ossimString ossimDemHeader::getHorizDatumCode() const
+{
+   ossimString code;
+   switch(getHorizDatum())
+   {
+      case 1:
+         code = "NAS-C";
+         break;
+      case 2:
+         code = "WGD";
+         break;
+      case 3:
+         code = "WGE";
+        break;         
+      case 4:
+         code = "NAR-C";
+        break;         
+      case 5:
+         code = "OHA-M";
+        break;         
+      case 6:
+         code = "PUR";
+         break;
+      default:
+         code = "unknown";
+        break;         
+   }
+   return code;
+}
+         
+ossimString ossimDemHeader::getProjectionType() const
+{
+   ossimString type;
+   switch(getGroundRefSysCode())
+   {
+      case 0:
+         type = "ossimEquDistCylProjection";
+         break;
+      case 1:
+         type = "ossimUtmProjection";
+         break;
+      case 2:
+      default:
+         type = "unknown";
+         break;
+   }
+   return type;
+}
diff --git a/src/support_data/ossimDemInfo.cpp b/src/support_data/ossimDemInfo.cpp
new file mode 100644
index 0000000..9766fba
--- /dev/null
+++ b/src/support_data/ossimDemInfo.cpp
@@ -0,0 +1,76 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: USGS DEM Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <iostream>
+
+#include <ossim/support_data/ossimDemInfo.h>
+
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+
+#include <ossim/support_data/ossimDemHeader.h>
+#include <ossim/support_data/ossimDemUtil.h>
+
+ossimDemInfo::ossimDemInfo()
+{
+}
+
+ossimDemInfo::~ossimDemInfo()
+{
+}
+
+bool ossimDemInfo::open(const ossimFilename& file)
+{
+   std::string connectionString = file.c_str();
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
+   if(!str) return false;
+   return open(str, connectionString);
+}
+
+bool ossimDemInfo::open(std::shared_ptr<ossim::istream>& str,
+                        const std::string& connectionString)
+{
+   if(!str) return false;
+   bool result = ossimDemUtil::isUsgsDem(str, connectionString);
+
+   if ( result )
+   {
+      m_fileStr = str;
+      m_connectionString = connectionString;
+   }
+   else
+   {
+      m_connectionString = "";
+   }
+   
+   return result;
+  
+}
+
+std::ostream& ossimDemInfo::print(std::ostream& out) const
+{
+   if ( m_fileStr )
+   {
+      ossimDemHeader hdr;
+      m_fileStr->clear();
+      m_fileStr->seekg(0);
+      if ( hdr.open(m_fileStr, m_connectionString) )
+      {
+         // std::string prefix;
+         hdr.print(std::cout);
+      }
+   }
+   return out;
+}
diff --git a/src/support_data/ossimDemPoint.cpp b/src/support_data/ossimDemPoint.cpp
new file mode 100644
index 0000000..16df265
--- /dev/null
+++ b/src/support_data/ossimDemPoint.cpp
@@ -0,0 +1,16 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Contains class definition for DEMPoint.
+//*******************************************************************
+//  $Id: ossimDemPoint.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/support_data/ossimDemPoint.h>
diff --git a/src/support_data/ossimDemProfile.cpp b/src/support_data/ossimDemProfile.cpp
new file mode 100644
index 0000000..e074d1f
--- /dev/null
+++ b/src/support_data/ossimDemProfile.cpp
@@ -0,0 +1,155 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class defines a DEM profile.
+//
+//********************************************************************
+// $Id: ossimDemProfile.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <cstdlib>
+#include <iostream>
+#include <sstream>
+
+#include <ossim/support_data/ossimDemProfile.h>
+#include <ossim/support_data/ossimDemUtil.h>
+
+ossimDemProfile::ossimDemProfile()
+   : _row(0),
+     _column(0),
+     _numberElevations(0),
+     _locDatumElev(0.0),
+     _minElev(0.0),
+     _maxElev(0.0)
+{
+}
+
+ossimDemProfile::ossimDemProfile(ossimDemProfile const& right)
+{
+   operator=(right);
+}
+
+ossimDemProfile const&
+ossimDemProfile::operator=(ossimDemProfile const& right)
+{
+   if (this == &right)
+      return *this;
+
+   _row = right._row;
+   _column = right._column;
+   _numberElevations = right._numberElevations;
+   _profileLocation = right._profileLocation;
+   _locDatumElev = right._locDatumElev;
+   _minElev = right._minElev;
+   _maxElev = right._maxElev;
+   _elevations = right._elevations;
+
+   return *this;
+}
+
+ossim_int32
+ossimDemProfile::getRowNumber() const
+{
+   return _row;
+}
+
+ossim_int32
+ossimDemProfile::getColumnNumber() const
+{
+   return _column;
+}
+
+ossim_int32
+ossimDemProfile::getNumberOfElevations() const
+{
+   return _numberElevations;
+}
+
+ossimDemPoint const&
+ossimDemProfile::getProfileLocation() const
+{
+   return _profileLocation;
+}
+
+double
+ossimDemProfile::getLocalDatumElevation() const
+{
+   return _locDatumElev;
+}
+
+double
+ossimDemProfile::getMinimumElev() const
+{
+   return _minElev;
+}
+
+double
+ossimDemProfile::getMaximumElev() const
+{
+   return _maxElev;
+}
+
+ossimDemElevationVector const&
+ossimDemProfile::getElevations() const
+{
+   return _elevations;
+}
+
+std::istream&
+operator>>(std::istream& s, ossimDemProfile& demp)
+{
+   //   string bufstr;
+   char bufstr[1024];
+
+   ossimDemUtil::getRecord(s,bufstr);
+
+   demp._row = ossimDemUtil::getLong(bufstr, 0, 6);
+   demp._column = ossimDemUtil::getLong(bufstr, 6, 6);
+   demp._numberElevations = ossimDemUtil::getLong(bufstr, 12, 6);
+
+   double x,y;
+   ossimDemUtil::getDouble(bufstr, 24, 24, x);
+   ossimDemUtil::getDouble(bufstr, 48, 24, y);
+   demp._profileLocation.setXY(x,y);
+
+   ossimDemUtil::getDouble(bufstr, 72, 24, demp._locDatumElev);
+   ossimDemUtil::getDouble(bufstr, 96, 24, demp._minElev);
+   ossimDemUtil::getDouble(bufstr, 120, 24, demp._maxElev);
+
+   demp._elevations.erase(demp._elevations.begin(), demp._elevations.end());   
+   demp._elevations.reserve(demp._numberElevations);
+
+   // Extract elevations in this record.
+   ossim_int32 count = 0;
+   while ((count < 146) && (count < demp._numberElevations))
+   {
+      demp._elevations.push_back(ossimDemUtil::getLong(bufstr, 144+(count*6), 6));
+      count++;
+   }
+   
+   ossim_int32 t;
+   while (count < demp._numberElevations)
+   {
+      t = (count - 146) % 170;
+      if (t == 0)
+         ossimDemUtil::getRecord(s,bufstr);
+      demp._elevations.push_back(ossimDemUtil::getLong(bufstr, t*6, 6));
+      count++;
+   }
+
+   return s;
+}
+
+
+std::ostream& operator<<(std::ostream& s, ossimDemProfile& /* demp */)
+{
+   return s;
+}
+
+
diff --git a/src/support_data/ossimDemStats.cpp b/src/support_data/ossimDemStats.cpp
new file mode 100644
index 0000000..665774b
--- /dev/null
+++ b/src/support_data/ossimDemStats.cpp
@@ -0,0 +1,126 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class provides some statistics for DEMs.
+//
+//********************************************************************
+// $Id: ossimDemStats.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <stdlib.h>
+
+#include <ossim/support_data/ossimDemStats.h>
+#include <ossim/support_data/ossimDemUtil.h>
+using namespace std;
+
+ossimDemStats::ossimDemStats()
+   : _availCodeDE2(0),
+     _rsmeDE2x(0),
+     _rsmeDE2y(0),
+     _rsmeDE2z(0),
+     _sampleSizeDE2(0),
+     _availCodeDE5(0),
+     _rsmeDE5x(0),
+     _rsmeDE5y(0),
+     _rsmeDE5z(0),
+     _sampleSizeDE5(0)
+
+{
+}
+
+ossimDemStats::~ossimDemStats()
+{
+}
+
+long
+ossimDemStats::getAvailCodeDE2() const
+{
+   return _availCodeDE2;
+}
+
+long
+ossimDemStats::getRSMEDE2x() const
+{
+   return _rsmeDE2x;
+}
+
+long
+ossimDemStats::getRSMEDE2y() const
+{
+   return _rsmeDE2y;
+}
+
+long
+ossimDemStats::getRSMEDE2z() const
+{
+   return _rsmeDE2z;
+}
+
+long
+ossimDemStats::getSampleSizeDE2() const
+{
+   return _sampleSizeDE2;
+}
+
+long
+ossimDemStats::getAvailCodeDE5() const
+{
+   return _availCodeDE5;
+}
+
+long
+ossimDemStats::getRSMEDE5x() const
+{
+   return _rsmeDE5x;
+}
+
+long
+ossimDemStats::getRSMEDE5y() const
+{
+   return _rsmeDE5y;
+}
+
+long
+ossimDemStats::getRSMEDE5z() const
+{
+   return _rsmeDE5z;
+}
+
+long
+ossimDemStats::getSampleSizeDE5() const
+{
+   return _sampleSizeDE5;
+}
+
+ostream&
+operator<<(ostream& s,  ossimDemStats const& /* stats */)
+{
+   return s;
+}
+
+istream&
+operator>>(istream& s, ossimDemStats& stats)
+{
+   char bufstr[1024];
+
+   ossimDemUtil::getRecord(s, bufstr);
+
+   stats._availCodeDE2 = ossimDemUtil::getLong(bufstr, 0, 6);
+   stats._rsmeDE2x = ossimDemUtil::getLong(bufstr, 6, 6);
+   stats._rsmeDE2y = ossimDemUtil::getLong(bufstr, 12, 6);
+   stats._rsmeDE2z = ossimDemUtil::getLong(bufstr, 18, 6);
+   stats._sampleSizeDE2 = ossimDemUtil::getLong(bufstr, 24, 6);
+   stats._availCodeDE5 = ossimDemUtil::getLong(bufstr, 30, 6);
+   stats._rsmeDE5x = ossimDemUtil::getLong(bufstr, 36, 6);
+   stats._rsmeDE5y = ossimDemUtil::getLong(bufstr, 42, 6);
+   stats._rsmeDE5z = ossimDemUtil::getLong(bufstr, 48, 6);
+   stats._sampleSizeDE5 = ossimDemUtil::getLong(bufstr, 54, 6);
+
+   return s;
+}
diff --git a/src/support_data/ossimDemUtil.cpp b/src/support_data/ossimDemUtil.cpp
new file mode 100644
index 0000000..40d23f8
--- /dev/null
+++ b/src/support_data/ossimDemUtil.cpp
@@ -0,0 +1,211 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+//         Orginally written by Jamie Moyers (jmoyers at geeks.com)
+//         Adapted from the package KDEM.
+// Description: This class provides some simple utilities for DEMs.
+//
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimDemUtil.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <cstring>
+#include <iostream>
+
+static const char DEM_TYPE_KW[] = "dem_type";
+static const char USGS_DEM_KW[] = "usgs_dem";
+
+bool ossimDemUtil::isUsgsDem(const ossimFilename& file)
+{
+   bool result = false;
+
+   ossimString ext = file.ext();
+   ext.downcase();
+   if (ext == "dem")
+   {
+      result = true;
+   }
+   else
+   {
+      // Look for file.omd
+      ossimFilename kwlFile = file;
+      kwlFile.setExtension("omd");
+      if (! kwlFile.exists() )
+      {
+         kwlFile.setExtension("OMD");
+      }
+      
+      if ( kwlFile.exists() )
+      {
+         ossimKeywordlist kwl(kwlFile);
+         if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+         {
+            const char* lookup = kwl.find(DEM_TYPE_KW);
+            if (lookup)
+            {
+               ossimString s = lookup;
+               s.downcase();
+               if (s == USGS_DEM_KW)
+               {
+                  result = true;
+               }
+            }
+         }
+      }
+   }
+   
+   if ( result )
+   {
+      
+      // Open up the file for reading.
+      // std::shared_ptr<ossim::istream> is = ossim::StreamFactoryRegistry::instance()->
+      //    createIstream(file, std::ios_base::in | std::ios_base::binary);
+   }
+      
+   return result;
+}
+
+bool ossimDemUtil::isUsgsDem(std::shared_ptr<ossim::istream> str, 
+                             const std::string& connectionString)
+{
+   bool result = false;
+   ossimFilename tempFile = connectionString;
+   ossimString ext = tempFile.ext();
+   ext.downcase();
+   if (ext == "dem")
+   {
+      result = true;
+   }
+   else
+   {
+      // Look for file.omd
+      ossimFilename kwlFile = tempFile;
+      kwlFile.setExtension("omd");
+      if (! kwlFile.exists() )
+      {
+         kwlFile.setExtension("OMD");
+      }
+      
+      if ( kwlFile.exists() )
+      {
+         ossimKeywordlist kwl(kwlFile);
+         if (kwl.getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+         {
+            const char* lookup = kwl.find(DEM_TYPE_KW);
+            if (lookup)
+            {
+               ossimString s = lookup;
+               s.downcase();
+               if (s == USGS_DEM_KW)
+               {
+                  result = true;
+               }
+            }
+         }
+      }
+   }
+   if(result&&str&&str->good())
+   {
+      //---
+      // SPECIAL HACK (drb):
+      // Check some bytes and make sure there is no binary data.
+      // There are files out there with .dem extension that are binary
+      // rasters.
+      //---
+      ossim_uint8* ubuf = new ossim_uint8[512];
+      str->read((char*)ubuf, 512);
+      for (int i = 0; i < 512; ++i)
+      {
+         if (ubuf[i] > 0x7f)
+         {
+            result = false;
+            break;
+         }
+      }
+      delete [] ubuf;
+      ubuf = 0;
+   }
+   else
+   {
+      result = false;
+   }
+
+   return result;   
+}
+
+bool ossimDemUtil::getRecord(ossim::istream& s, std::string& strbuf, long reclength)
+{
+   char* buf = new char[reclength + 1];
+
+   bool flag = ossimDemUtil::getRecord(s,buf,reclength);
+   if (flag == true)
+      strbuf = buf;
+
+   delete [] buf;
+
+   return flag;
+}
+
+bool ossimDemUtil::getRecord(ossim::istream& s, char* buf, long reclength)
+{
+   // buf is assumed to be at least reclength+1 in size.
+
+   if (!s)
+      return false;
+
+   long curpos = 0;
+   buf[curpos] = s.get();
+   while ((buf[curpos] != EOF) && 
+          (buf[curpos] != '\n') &&
+          (curpos < reclength-1))
+   {
+      curpos++;
+      buf[curpos] = s.get();
+   }
+   buf[curpos] = '\0';
+
+   if (s.peek() == '\n')
+      s.get();
+
+   return true;
+
+}
+
+bool
+ossimDemUtil::getDouble(std::string const& strbuf,
+                        long const startpos,
+                        long const width,
+                        double& val)
+{
+   if ((startpos + width - 1) > (long)(strbuf.length()))
+      return false;
+
+   // Convert FORTRAN 'D' exponent indicator to 'E'.
+   std::string tempbuf(strbuf.substr(startpos,width));
+   for (unsigned int i = 0; i < tempbuf.length(); i++)
+      if (tempbuf[i] == 'D')
+         tempbuf[i] = 'E';
+
+   val = atof(tempbuf.c_str());
+   return true;
+}
+
+long ossimDemUtil::getLong(char* const strbuf, // string to extract long from
+                           long const startpos,  // starting position of field
+                           long const width)     // width of field
+{
+   char temp[1024];
+   std::strncpy(temp,strbuf+startpos,width);
+   temp[width] = '\0';
+   return atol(temp);
+}
diff --git a/src/support_data/ossimDoqq.cpp b/src/support_data/ossimDoqq.cpp
new file mode 100644
index 0000000..5af3c5e
--- /dev/null
+++ b/src/support_data/ossimDoqq.cpp
@@ -0,0 +1,437 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description: This class parses a Digital Ortho Quarter Quad (DOQQ)
+//              header.
+//
+//********************************************************************
+// $Id: ossimDoqq.cpp 22855 2014-08-05 14:46:38Z gpotts $
+
+#include <string.h>
+#include <ossim/support_data/ossimDoqq.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+static ossimTrace traceDebug("ossimDoqq:debug");
+
+//**************************************************************************
+// CONSTRUCTOR
+//**************************************************************************
+ossimDoqq::ossimDoqq()
+   :  theErrorStatus(OSSIM_ERROR)
+{
+}
+
+//**************************************************************************
+// CONSTRUCTOR
+//**************************************************************************
+ossimDoqq::ossimDoqq(ossimFilename file)
+   :  theErrorStatus(OSSIM_ERROR)
+{
+   ossimInfoBase::open(file);
+   //theDoqFile.close();
+}
+
+
+bool ossimDoqq::open(std::shared_ptr<ossim::istream>& str,
+                     const std::string& connectionString)
+{
+   theErrorStatus = OSSIM_OK;
+   if(!str) return false;
+   char header[23];
+   str->clear();
+   str->seekg(0);
+   str->get(header, 22);
+
+   header[22] = '\0';
+   if(strcmp((const char*)header, "BEGIN_USGS_DOQ_HEADER") == 0)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimDoqq::ossimDoqq Loading DOQ version 2 header..."
+            << std::endl;
+      }
+
+      ldstr_v2(*str);
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimDoqq::ossimDoqq  Loading DOQ version 1 header..."
+            << std::endl;
+      }
+
+      ldstr_v1(*str);
+   }
+
+   // Check for error.
+   if(theErrorStatus)
+      return false;
+
+   m_connectionString = connectionString;
+   m_doqqFileStr = str;
+   return true;
+}
+
+
+ossimDoqq::~ossimDoqq()
+{
+   m_doqqFileStr.reset();
+}
+
+void ossimDoqq::ldstr_v2(std::istream& in)
+{
+   static const char MODULE[] = "ossimDoqq::ldstr_v2(istream& in)";
+
+   if (!in)
+   {
+      theErrorStatus = OSSIM_ERROR;
+      return;
+   }
+
+   char line[100];
+   char dum1[30];
+   char dum2[30];
+   char dum3[30];
+   char dum4[30];
+
+   while((strncmp(line, "END_USGS_HEADER", 15) != 0)&&
+			(in.good()))
+   {
+      // Read in one line of header at a time.
+      in.getline(line, 100);
+      
+      if(strncmp(line, "SAMPLES_AND_LINES", 17) == 0)
+      {
+         sscanf(line, "%s %s %s", dum1, dum2, dum3);
+         theLine = atoi(dum3);
+         theSample = atoi(dum2);
+      }
+
+      else if(strncmp(line, "HORIZONTAL_COORDINATE_SYSTEM", 28) == 0)
+      {
+         sscanf(line, "%s %s", dum1, dum2);
+         theProjection = dum2;
+      }
+      
+      else if(strncmp(line, "NW_QUAD_CORNER_XY", 17) == 0)
+      {         
+         sscanf(line, "%s %s %s", dum1, dum2, dum3);
+         
+         theUE = atof(dum2);
+         theUN = atof(dum3);
+      }
+      
+      else if(strncmp(line, "NE_QUAD_CORNER_XY", 17) == 0)
+      {
+         sscanf(line, "%s %s %s", dum1, dum2, dum3);
+         theLE = atof(dum2);
+         theLN = atof(dum3);
+      }
+
+      else if(strncmp(line, "COORDINATE_ZONE", 15) == 0)
+      {
+         sscanf(line, "%s %s", dum1, dum2);
+         theUtmZone = atoi(dum2);
+      }
+
+      else if(strncmp(line, "SOURCE_IMAGE_DATE", 17) == 0)
+      {
+         sscanf(line, "%s %s %s %s", dum1, dum2, dum3, dum4);
+         theAcqYear  = ossimString(dum2);
+         theAcqMonth = ossimString(dum3);
+         theAcqDay   = ossimString(dum4);
+      }
+
+      else if((strncmp(line, "XY_ORIGIN", 9) == 0))
+      {
+         sscanf(line, "%s %s %s", dum1, dum2, dum3);
+         theEasting = atof(dum2);
+         theNorthing = atof(dum3);        
+      }
+
+      else if((strncmp(line, "HORIZONTAL_DATUM", 16) == 0) && theDatum.empty())
+      {
+         ossimString datum;         
+         sscanf(line, "%s %s", dum1, dum2);
+         datum = dum2; 
+         
+         if(datum.contains("NAD27"))
+            theDatum = "NAD";
+         else
+            theDatum = "NAR";
+      }
+
+      else if(strncmp(line, "BYTE_COUNT", 10) == 0)
+      {
+         ossimString header;         
+         sscanf(line, "%s %s", dum1, dum2);
+         header = dum2;
+         
+         theHeaderSize = atoi(header.chars());
+      }
+
+      else if(strncmp(line, "BAND_CONTENT", 12) == 0)
+      {
+         ossimString rgbType;        
+         sscanf(line, "%s %s", dum1, dum2);
+         rgbType = dum2;
+
+         if(rgbType.contains("BLACK&WHITE"))
+            theRgb = 1;
+         else
+            theRgb = 3;
+      }
+
+      else if(strncmp(line, "HORIZONTAL_RESOLUTION", 21) == 0)
+      {
+         ossimString gsd;
+         sscanf(line, "%s %s", dum1, dum2);
+         gsd = dum2;
+
+         theGsd.x = gsd.toDouble();
+         theGsd.y = gsd.toDouble();
+      }
+
+      else if(strncmp(line, "QUADRANGLE_NAME", 15) == 0)
+      {
+         sscanf(line, "%s %29c", dum1, dum2);
+         dum2[29] = 0;
+         theQuadName = dum2;
+      }
+
+      else if(strncmp(line, "QUADRANT", 8) == 0)
+      {
+         sscanf(line, "%s %s", dum1, dum2);
+         theQuad = dum2;
+      }
+
+      else if(strncmp(line, "NATION", 6) == 0)
+      {
+         sscanf(line, "%s %s", dum1, dum2);
+         theNation = dum2;
+      }
+
+      else if(strncmp(line, "STATE", 5) == 0)
+      {
+         sscanf(line, "%s %s", dum1, dum2);
+         theState = dum2;
+      }
+
+      else if(strncmp(line, "RMSE_XY", 7) == 0)
+      {
+         sscanf(line, "%s %s", dum1, dum2);
+         theRMSE = ossimString(dum2).toDouble();
+      }
+
+      else if(strncmp(line, "IMAGE_SOURCE", 12) == 0)
+      {
+         sscanf(line, "%s %29c", dum1, dum2);
+         dum2[29] = 0;
+         theImageSource = dum2;
+      }
+
+      else if(strncmp(line, "SOURCE_IMAGE_ID", 15) == 0)
+      {
+         sscanf(line, "%s %29c", dum1, dum2);
+         dum2[29] = 0;
+         theSourceImageID = dum2;
+      }
+   }
+
+	if (!in.good())
+	{
+      theErrorStatus = OSSIM_ERROR;
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+			<< MODULE << " ERROR:\n"
+			<< "\tHeader stream is bad."
+			<< std::endl;
+      }
+		return;
+	}
+
+   // Check for valid lines and samples and header size.
+   if(theLine <= 0 || theSample <= 0 || theHeaderSize <= 0)
+   {
+      theErrorStatus = OSSIM_ERROR;
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << "\tInvalid lines or samples or header size."
+            << std::endl;
+      }
+      return;
+   }
+
+   // Assign concatenated acquisition date:
+   theAcqYearMonthDay = theAcqYear;
+   theAcqYearMonthDay += "-";
+   theAcqYearMonthDay += theAcqMonth;
+   theAcqYearMonthDay += "-";
+   theAcqYearMonthDay += theAcqDay;
+
+}
+
+void ossimDoqq::ldstr_v1(std::istream& in)
+{
+   static const char MODULE[] = "ossimDoqq::ldstr_v1(istream& in)";
+
+   if (!in)
+   {
+      theErrorStatus = OSSIM_ERROR;
+      return;
+   }
+
+   char tmp1[DATA_ORDER_SIZE+1];
+   in.seekg(DATA_ORDER_OFFSET, std::ios::beg);
+   in.get(tmp1, DATA_ORDER_SIZE+1);
+   theDataOrder = tmp1;
+
+   //***
+   // Perform a sanity check on the data order just in case this isn't a
+   // ossimDoqq file.
+   //***  
+   tmp1[DATA_ORDER_SIZE] = '\0';
+   int data_order = atoi(tmp1);
+   if ( (data_order != 1) && (data_order != 2) )
+   {
+      theErrorStatus = OSSIM_ERROR;
+
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " NOTICE:\n"
+            << "Invalid data ordering.  Not a doq?" << std::endl;
+      }
+   }
+   
+   char tmp2[LINE_SIZE+1];
+   in.seekg(LINE_OFFSET, std::ios::beg);
+   in.get(tmp2, LINE_SIZE+1);
+   theLine = atoi(tmp2);
+
+   char tmp3[SAMPLE_SIZE+1];
+   in.seekg(SAMPLE_OFFSET,std::ios::beg);
+   in.get(tmp3, SAMPLE_SIZE+1); 
+   theSample = atoi(tmp3);
+
+   // Check for valid lines and samples.
+   if (theLine <= 0 || theSample <= 0)
+   {
+      theErrorStatus = OSSIM_ERROR;
+
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " ERROR:\n"
+            << "\tInvalid lines or samples."
+            << std::endl;
+      }
+      
+      return;
+   }
+   
+   char tmp4[PROJECTION_SIZE+1];
+   in.seekg(PROJECTION_OFFSET, std::ios::beg);
+   in.get(tmp4, PROJECTION_SIZE+1);
+   theProjection = tmp4;
+
+   char tmp5[UTM_ZONE_SIZE+1];
+   in.seekg(UTM_ZONE_OFFSET, std::ios::beg);
+   in.get(tmp5, UTM_ZONE_SIZE+1);
+   theUtmZone = atoi(tmp5);
+
+   char tmp8[DATUM_SIZE+1];
+   in.seekg(DATUM_OFFSET, std::ios::beg);
+   in.get(tmp8, DATUM_SIZE+1);
+   theDatum = tmp8;
+
+   char rgbType[RGB_SIZE+1];
+   in.seekg(RGB_OFFSET, std::ios::beg);
+   in.get(rgbType, RGB_SIZE+1);
+
+
+   if(atoi(rgbType) == 5)
+   {
+      theRgb = 3;
+   }
+   else
+   {
+      theRgb = 1;
+   }
+   
+   theHeaderSize = (theSample * theRgb * 4);
+
+   // Calculate the size of each record.
+   theRecordSize = (theSample * theRgb);
+
+   char tmp6[UL_EASTING_SIZE+1];
+   in.seekg( (theRecordSize * 2) + UL_EASTING_OFFSET, std::ios::beg);
+   in.get(tmp6, UL_EASTING_SIZE+1);
+
+   char tmp7[UL_NORTHING_SIZE+1];
+   in.seekg( (theRecordSize * 2) + UL_NORTHING_OFFSET, std::ios::beg);
+   in.get(tmp7, UL_NORTHING_SIZE+1);
+   
+   // Get Easting and Northing.
+   theEasting = convertStr(tmp6);
+   theNorthing = convertStr(tmp7);
+
+   char tmp10[GSD_SIZE+1];
+   in.seekg( (theRecordSize*3) + GSD_X_OFFSET, std::ios::beg);
+   in.get(tmp10, GSD_SIZE+1);
+   theGsd.x = std::abs(ossimString(tmp10, tmp10+GSD_SIZE).toDouble());
+   in.seekg( (theRecordSize*3) + GSD_Y_OFFSET, std::ios::beg);
+   in.get(tmp10, GSD_SIZE+1);
+   theGsd.y = std::abs(ossimString(tmp10, tmp10+GSD_SIZE).toDouble());
+   
+}
+
+ossim_float64 ossimDoqq::convertStr(const char* str) const
+{
+   //***
+   // The USGS Projection Parameters in a OssimDoqq header have a "D" to
+   // denote the exponent.  This simply substitutes the "D" with an
+   // "E" so that atof works properly.
+   //***
+   ossimString tmp = str;
+   tmp.gsub("D", "E");
+   return tmp.toFloat64();
+}
+
+std::ostream& ossimDoqq::print(std::ostream& out) const
+{
+   const char* prefix = "doqq.";
+   out << prefix << "Quadrangle_Name: " << theQuadName << std::endl;
+   out << prefix << "Quadrant: " << theQuad << std::endl;
+   out << prefix << "Image_Source: " << theImageSource << std::endl;
+   out << prefix << "Source_Image_ID: " << theSourceImageID << std::endl;
+   out << prefix << "RMSE_XY: " << theRMSE << std::endl;
+   out << prefix << "Line: " << theLine << std::endl;
+   out << prefix << "Sample: " << theSample << std::endl;
+   out << prefix << "Projection: " << theProjection << std::endl;
+   out << prefix << "Datum: " << theDatum << std::endl;
+   out << prefix << "Easting: " << theEasting << std::endl;
+   out << prefix << "Northing: " << theNorthing << std::endl;
+   out << prefix << "UN: " << theUN << std::endl;
+   out << prefix << "UE: " << theUE << std::endl;
+   out << prefix << "LN: " << theLN << std::endl;
+   out << prefix << "LE: " << theLE << std::endl;
+   out << prefix << "GSD: " << theGsd << std::endl;
+   out << prefix << "Band: " << theRgb << std::endl;
+   out << prefix << "Utm_Zone: " << theUtmZone << std::endl;
+   
+   return out;
+}
diff --git a/src/support_data/ossimDtedAcc.cpp b/src/support_data/ossimDtedAcc.cpp
new file mode 100644
index 0000000..d3e2af7
--- /dev/null
+++ b/src/support_data/ossimDtedAcc.cpp
@@ -0,0 +1,261 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the Accuracy Description
+//               (ACC) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedAcc.cpp 23276 2015-04-24 21:01:51Z rashadkm $
+
+#include <cstdlib>
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+#include <string>
+
+#include <ossim/support_data/ossimDtedAcc.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimIoStream.h>
+
+ossimDtedAcc::ossimDtedAcc()
+{
+   
+}
+
+ossimDtedAcc::ossimDtedAcc(std::shared_ptr<ossim::istream>& str, ossim_int64 offset)
+{
+   if(str)
+   {
+      str->seekg(offset);
+      parse(*str); 
+   }
+   else
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+   }
+}
+
+void ossimDtedAcc::clearFields()
+{
+   memset(theRecSen, '\0', FIELD1_SIZE+1);
+   memset(theAbsoluteCE, '\0',FIELD2_SIZE+1);
+   memset(theAbsoluteLE, '\0',FIELD3_SIZE+1);
+   memset(theRelativeCE, '\0',FIELD4_SIZE+1);
+   memset(theRelativeLE, '\0',FIELD5_SIZE+1);
+   memset(theField6, '\0',FIELD6_SIZE+1);
+   memset(theField7, '\0',FIELD7_SIZE+1);
+   memset(theField8, '\0',FIELD8_SIZE+1);
+   memset(theField9, '\0',FIELD9_SIZE+1);
+   memset(theField10, '\0',FIELD10_SIZE+1);
+   memset(theField11, '\0',FIELD11_SIZE+1);
+   memset(theField12, '\0',FIELD12_SIZE+1);
+   memset(theField13, '\0',FIELD13_SIZE+1);
+   memset(theField14, '\0',FIELD14_SIZE+1);
+   memset(theField15, '\0',FIELD15_SIZE+1);
+   memset(theField16, '\0',FIELD16_SIZE+1);
+   memset(theField17, '\0',FIELD17_SIZE+1);
+   
+   theStartOffset = 0;
+   theStopOffset = 0;
+}
+//**************************************************************************
+// ossimDtedAcc::parse()
+//**************************************************************************
+void ossimDtedAcc::parse(std::istream& in)
+{
+   clearErrorStatus();
+	clearFields();
+	theStartOffset = in.tellg();
+   theStopOffset  = theStartOffset;
+   // Parse theRecSen
+   in.read(theRecSen, FIELD1_SIZE);
+   theRecSen[FIELD1_SIZE] = '\0';
+
+   if(!(strncmp(theRecSen, "ACC", 3) == 0))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      in.seekg(theStartOffset);
+      return;
+   }
+   
+   // Parse theAbsoluteCE
+   in.read(theAbsoluteCE, FIELD2_SIZE);
+   theAbsoluteCE[FIELD2_SIZE] = '\0';
+   
+   // Parse theAbsoluteLE
+   in.read(theAbsoluteLE, FIELD3_SIZE);
+   theAbsoluteLE[FIELD3_SIZE] = '\0';
+   
+   // Parse theRelativeCE
+   in.read(theRelativeCE, FIELD4_SIZE);
+   theRelativeCE[FIELD4_SIZE] = '\0';
+   
+   // Parse theRelativeLE
+   in.read(theRelativeLE, FIELD5_SIZE);
+   theRelativeLE[FIELD5_SIZE] = '\0';
+   
+   // Parse Field 6
+   in.read(theField6, FIELD6_SIZE);
+   theField6[FIELD6_SIZE] = '\0';
+   
+   // Parse Field 7
+   in.read(theField7, FIELD7_SIZE);
+   theField7[FIELD7_SIZE] = '\0';
+   
+   // Parse Field 8
+   in.read(theField8, FIELD8_SIZE);
+   theField8[FIELD8_SIZE] = '\0';
+   
+   // Parse Field 9
+   in.read(theField9, FIELD9_SIZE);
+   theField9[FIELD9_SIZE] = '\0';
+   
+   // Parse Field 10
+   in.read(theField10, FIELD10_SIZE);
+   theField10[FIELD10_SIZE] = '\0';
+   
+   // Parse Field 11
+   in.read(theField11, FIELD11_SIZE);
+   theField11[FIELD11_SIZE] = '\0';
+   
+   // Parse Field 12
+   in.read(theField12, FIELD12_SIZE);
+   theField12[FIELD12_SIZE] = '\0';
+   
+   // Parse Field 13
+   in.read(theField13, FIELD13_SIZE);
+   theField13[FIELD13_SIZE] = '\0';
+   
+   // Parse Field 14
+   in.read(theField14, FIELD14_SIZE);
+   theField14[FIELD14_SIZE] = '\0';
+   
+   // Parse Field 15
+   in.read(theField15, FIELD15_SIZE);
+   theField15[FIELD15_SIZE] = '\0';
+   
+   // Parse Field 16
+   in.read(theField16, FIELD16_SIZE);
+   theField16[FIELD16_SIZE] = '\0';
+   
+   // Parse Field 17
+   in.read(theField17, FIELD17_SIZE);
+   theField17[FIELD17_SIZE] = '\0';
+
+   in.ignore(FIELD18_SIZE);
+   // Set the stop offset.
+   theStopOffset = theStartOffset + ACC_LENGTH;
+}
+
+ossimRefPtr<ossimProperty> ossimDtedAcc::getProperty(
+   const ossimString& name) const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   if (name == "recognition_sentinel")
+   {
+      result = new ossimStringProperty(name, theRecSen);
+      
+   }
+   else if (name == "absolute_ce")
+   {
+      result = new ossimStringProperty(name, theAbsoluteCE);
+   }
+   else if (name == "absolute_le")
+   {
+      result = new ossimStringProperty(name, theAbsoluteLE); 
+   }
+   else if (name == "relative_ce")
+   {
+      result = new ossimStringProperty(name, theRelativeCE);
+   }
+   else if (name == "relative_le")
+   {
+      result = new ossimStringProperty(name, theRelativeLE);
+   }
+   return result;
+}
+
+void ossimDtedAcc::getPropertyNames(
+   std::vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(ossimString("recognition_sentinel"));
+   propertyNames.push_back(ossimString("absolute_ce"));
+   propertyNames.push_back(ossimString("absolute_le"));
+   propertyNames.push_back(ossimString("relative_ce"));
+   propertyNames.push_back(ossimString("relative_le"));
+}
+
+std::ostream& ossimDtedAcc::print(std::ostream& out,
+                                  const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += "acc.";
+
+   out << setiosflags(ios::left)
+       << pfx << setw(28) << "recognition_sentinel:" << theRecSen << "\n"
+       << pfx << setw(28) << "absolute_ce:"  << theAbsoluteCE << "\n"
+       << pfx << setw(28) << "absolute_le:"  << theAbsoluteLE << "\n"
+       << pfx << setw(28) << "relative ce:"  << theRelativeCE << "\n"
+       << pfx << setw(28) << "relative le:"  << theRelativeLE << "\n"
+       << pfx << setw(28) << "start_offset:" << theStartOffset << "\n"
+       << pfx << setw(28) << "stop_offset:"  << theStopOffset
+       << std::endl;
+   return out;
+}
+
+ossim_int32 ossimDtedAcc::absCE() const
+{
+   return atoi(theAbsoluteCE);
+}
+
+ossim_int32 ossimDtedAcc::absLE() const
+{
+   return atoi(theAbsoluteLE);
+}
+
+ossim_int32 ossimDtedAcc::relCE() const
+{
+   return atoi(theRelativeCE);
+}
+
+ossim_int32 ossimDtedAcc::relLE() const
+{
+   return atoi(theRelativeLE);
+}
+   
+ossim_int32 ossimDtedAcc::startOffset() const
+{
+   return theStartOffset;
+}
+
+ossim_int32 ossimDtedAcc::stopOffset()  const
+{
+   return theStopOffset;
+}
+
+
+
+//**************************************************************************
+// operator <<
+//**************************************************************************
+std::ostream& operator<<( std::ostream& os, const ossimDtedAcc& acc)
+{
+   std::string prefix;
+   return acc.print(os, prefix);
+}
+
+ossimDtedAcc::ossimDtedAcc(const ossimDtedAcc& /* source */)
+{
+      clearFields();
+}
+
+const ossimDtedAcc& ossimDtedAcc::operator=(const ossimDtedAcc& rhs)
+{
+   return rhs;
+}
diff --git a/src/support_data/ossimDtedDsi.cpp b/src/support_data/ossimDtedDsi.cpp
new file mode 100644
index 0000000..d7c8051
--- /dev/null
+++ b/src/support_data/ossimDtedDsi.cpp
@@ -0,0 +1,558 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the Data Set Identification
+//               (DSI) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedDsi.cpp 23276 2015-04-24 21:01:51Z rashadkm $
+
+#include <cstdlib>
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+#include <string>
+
+#include <ossim/support_data/ossimDtedDsi.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimIoStream.h>
+
+ossimDtedDsi::ossimDtedDsi()
+   :
+      theRecSen(),
+      theSecurityCode(),
+      theField3(),
+      theField4(),
+      theProductLevel(),
+      theField7(),
+      theField8(),
+      theEdition(),
+      theMatchMergeVersion(),
+      theMaintenanceDate(),
+      theMatchMergeDate(),
+      theMaintenanceCode(),
+      theProducerCode(),
+      theField15(),
+      theProductStockSpecNumber(),
+      theProductSpecNumber(),
+      theProductSpecDate(),
+      theVerticalDatum(),
+      theHorizontalDatum(),
+      theField21(),
+      theCompilationDate(),
+      theField23(),
+      theLatOrigin(),
+      theLonOrigin(),
+      theLatSW(),
+      theLonSW(),
+      theLatNW(),
+      theLonNW(),
+      theLatNE(),
+      theLonNE(),
+      theLatSE(),
+      theLonSE(),
+      theOrientation(),
+      theLatInterval(),
+      theLonInterval(),
+      theNumLatPoints(),
+      theNumLonLines(),
+      theCellIndicator(),
+      theField40(),
+      theField41(),
+      theField42(),
+      theStartOffset(0),
+      theStopOffset(0)
+{
+
+}
+
+ossimDtedDsi::ossimDtedDsi(std::shared_ptr<ossim::istream>& str, ossim_int64 offset)
+   :
+      theRecSen(),
+      theSecurityCode(),
+      theField3(),
+      theField4(),
+      theProductLevel(),
+      theField7(),
+      theField8(),
+      theEdition(),
+      theMatchMergeVersion(),
+      theMaintenanceDate(),
+      theMatchMergeDate(),
+      theMaintenanceCode(),
+      theProducerCode(),
+      theField15(),
+      theProductStockSpecNumber(),
+      theProductSpecNumber(),
+      theProductSpecDate(),
+      theVerticalDatum(),
+      theHorizontalDatum(),
+      theField21(),
+      theCompilationDate(),
+      theField23(),
+      theLatOrigin(),
+      theLonOrigin(),
+      theLatSW(),
+      theLonSW(),
+      theLatNW(),
+      theLonNW(),
+      theLatNE(),
+      theLonNE(),
+      theLatSE(),
+      theLonSE(),
+      theOrientation(),
+      theLatInterval(),
+      theLonInterval(),
+      theNumLatPoints(),
+      theNumLonLines(),
+      theCellIndicator(),
+      theField40(),
+      theField41(),
+      theField42(),
+      theStartOffset(0),
+      theStopOffset(0)
+{
+  if(str)
+  {
+    str->seekg(offset);
+    parse(*str);
+  }
+  else
+  {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+  }
+}
+
+void ossimDtedDsi::parse(std::istream& in)
+{
+   clearErrorStatus();
+   theStartOffset = in.tellg();
+   theStopOffset  = theStartOffset;
+   char tmp_chars[26]; // For blank field reads.
+   
+   // Seek to the start of the record.
+   in.seekg(theStartOffset, std::ios::beg);
+   
+   // Parse theRecSen
+   in.read(theRecSen, FIELD1_SIZE);
+   theRecSen[FIELD1_SIZE] = '\0';
+   if(!(strncmp(theRecSen, "DSI", 3) == 0))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      in.seekg(theStartOffset);
+      return;
+   }
+
+   // Parse theSecurityCode
+   in.read(theSecurityCode, FIELD2_SIZE);
+   theSecurityCode[FIELD2_SIZE] = '\0';
+   
+   // Parse Field 3
+   in.read(theField3, FIELD3_SIZE);
+   theField3[FIELD3_SIZE] = '\0';
+   
+   // Parse Field 4
+   in.read(theField4, FIELD4_SIZE);
+   theField4[FIELD4_SIZE] = '\0';
+   
+   // Parse Field 5 (currently blank)
+   in.read(tmp_chars, FIELD5_SIZE);
+   
+   // Parse theProductLevel
+   in.read(theProductLevel, FIELD6_SIZE);
+   theProductLevel[FIELD6_SIZE] = '\0';
+   
+   // Parse Field 7
+   in.read(theField7, FIELD7_SIZE);
+   theField7[FIELD7_SIZE] = '\0';
+   
+   // Parse Field 8
+   in.read(theField8, FIELD8_SIZE);
+   theField8[FIELD8_SIZE] = '\0';
+   
+   // Parse theEdition
+   in.read(theEdition, FIELD9_SIZE);
+   theEdition[FIELD9_SIZE] = '\0';
+   
+   // Parse theMatchMergeVersion
+   in.read(theMatchMergeVersion, FIELD10_SIZE);
+   theMatchMergeVersion[FIELD10_SIZE] = '\0';
+   
+   // Parse theMaintenanceDate
+   in.read(theMaintenanceDate, FIELD11_SIZE);
+   theMaintenanceDate[FIELD11_SIZE] = '\0';
+   
+   // Parse theMatchMergeDate
+   in.read(theMatchMergeDate, FIELD12_SIZE);
+   theMatchMergeDate[FIELD12_SIZE] = '\0';
+   
+   // Parse theMaintenanceCode
+   in.read(theMaintenanceCode, FIELD13_SIZE);
+   theMaintenanceCode[FIELD13_SIZE] = '\0';
+   
+   // Parse theProducerCode
+   in.read(theProducerCode, FIELD14_SIZE);
+   theProducerCode[FIELD14_SIZE] = '\0';
+   
+   // Parse Field 15
+   in.read(theField15, FIELD15_SIZE);
+   theField15[FIELD15_SIZE] = '\0';
+   
+   // Parse theProductStockSpecNumber
+   in.read(theProductStockSpecNumber, FIELD16_SIZE);
+   theProductStockSpecNumber[FIELD16_SIZE] = '\0';
+   
+   // Parse theProductSpecNumber
+   in.read(theProductSpecNumber, FIELD17_SIZE);
+   theProductSpecNumber[FIELD17_SIZE] = '\0';
+   
+   // Parse theProductSpecDate
+   in.read(theProductSpecDate, FIELD18_SIZE);
+   theProductSpecDate[FIELD18_SIZE] = '\0';
+   
+   // Parse theVerticalDatum
+   in.read(theVerticalDatum, FIELD19_SIZE);
+   theVerticalDatum[FIELD19_SIZE] = '\0';
+   
+   // Parse theHorizontalDatum
+   in.read(theHorizontalDatum, FIELD20_SIZE);
+   theHorizontalDatum[FIELD20_SIZE] = '\0';
+   
+   // Parse Field 21
+   in.read(theField21, FIELD21_SIZE);
+   theField21[FIELD21_SIZE] = '\0';
+   
+   // Parse theCompilationDate
+   in.read(theCompilationDate, FIELD22_SIZE);
+   theCompilationDate[FIELD22_SIZE] = '\0';
+   
+   // Parse Field 23
+   in.read(theField23, FIELD23_SIZE);
+   theField23[FIELD23_SIZE] = '\0';
+   
+   // Parse theLatOrigin
+   in.read(theLatOrigin, FIELD24_SIZE);
+   theLatOrigin[FIELD24_SIZE] = '\0';
+   
+   // Parse theLonOrigin
+   in.read(theLonOrigin, FIELD25_SIZE);
+   theLonOrigin[FIELD25_SIZE] = '\0';
+   
+   // Parse theLatSW
+   in.read(theLatSW, FIELD26_SIZE);
+   theLatSW[FIELD26_SIZE] = '\0';
+   
+   // Parse theLonSW
+   in.read(theLonSW, FIELD27_SIZE);
+   theLonSW[FIELD27_SIZE] = '\0';
+   
+   // Parse theLatNW
+   in.read(theLatNW, FIELD28_SIZE);
+   theLatNW[FIELD28_SIZE] = '\0';
+   
+   // Parse theLonNW
+   in.read(theLonNW, FIELD29_SIZE);
+   theLonNW[FIELD29_SIZE] = '\0';
+   
+   // Parse theLatNE
+   in.read(theLatNE, FIELD30_SIZE);
+   theLatNE[FIELD30_SIZE] = '\0';
+   
+   // Parse theLonNE
+   in.read(theLonNE, FIELD31_SIZE);
+   theLonNE[FIELD31_SIZE] = '\0';
+   
+   // Parse theLatSE
+   in.read(theLatSE, FIELD32_SIZE);
+   theLatSE[FIELD32_SIZE] = '\0';
+   
+   // Parse theLonSE
+   in.read(theLonSE, FIELD33_SIZE);
+   theLonSE[FIELD33_SIZE] = '\0';
+   
+   // Parse theOrientation
+   in.read(theOrientation, FIELD34_SIZE);
+   theOrientation[FIELD34_SIZE] = '\0';
+   
+   // Parse theLatInterval
+   in.read(theLatInterval, FIELD35_SIZE);
+   theLatInterval[FIELD35_SIZE] = '\0';
+   
+   // Parse theLonInterval
+   in.read(theLonInterval, FIELD36_SIZE);
+   theLonInterval[FIELD36_SIZE] = '\0';
+   
+   // Parse theNumLatPoints
+   in.read(theNumLatPoints, FIELD37_SIZE);
+   theNumLatPoints[FIELD37_SIZE] = '\0';
+   
+   // Parse theNumLonLines
+   in.read(theNumLonLines, FIELD38_SIZE);
+   theNumLonLines[FIELD38_SIZE] = '\0';
+   
+   // Parse theCellIndicator
+   in.read(theCellIndicator, FIELD39_SIZE);
+   theCellIndicator[FIELD39_SIZE] = '\0';
+   
+   // Parse Field 40
+   in.read(theField40, FIELD40_SIZE);
+   theField40[FIELD40_SIZE] = '\0';
+   
+   // Parse Field 41
+   in.read(theField41, FIELD41_SIZE);
+   theField41[FIELD41_SIZE] = '\0';
+   
+   // Parse Field 42
+   in.read(theField42, FIELD42_SIZE);
+   theField42[FIELD42_SIZE] = '\0';
+
+   // Set the stop offset.
+   theStopOffset = theStartOffset + DSI_LENGTH;
+}
+
+ossimRefPtr<ossimProperty> ossimDtedDsi::getProperty(
+   const ossimString& /* name */) const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   return result;
+}
+
+void ossimDtedDsi::getPropertyNames(
+   std::vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(ossimString("dted_dsi_record"));
+}
+
+ossimString ossimDtedDsi::recognitionSentinel() const
+{
+   return theRecSen;
+}
+
+ossimString ossimDtedDsi::securityCode() const
+{
+   return ossimString(theSecurityCode);
+}
+
+ossimString ossimDtedDsi::productLevel() const
+{
+   return ossimString(theProductLevel);
+}
+
+ossimString ossimDtedDsi::edition() const
+{
+   return ossimString(theEdition);
+}
+
+ossimString ossimDtedDsi::matchMergeVersion() const
+{
+   return ossimString(theMatchMergeVersion);
+}
+
+ossimString ossimDtedDsi::maintanenceDate() const
+{
+   return ossimString(theMaintenanceDate);
+}
+
+ossimString ossimDtedDsi::matchMergeDate() const
+{
+   return ossimString(theMatchMergeDate);
+}
+
+ossimString ossimDtedDsi::maintenanceCode() const
+{
+   return ossimString(theMaintenanceCode);
+}
+
+ossimString ossimDtedDsi::producerCode() const
+{
+   return ossimString(theProducerCode);
+}
+
+ossimString ossimDtedDsi::productStockSpecNumber() const
+{
+   return ossimString(theProductStockSpecNumber);
+}
+
+ossimString ossimDtedDsi::productSpecNumber() const
+{
+   return ossimString(theProductSpecNumber);
+}
+
+ossimString ossimDtedDsi::productSpecDate() const
+{
+   return ossimString(theProductSpecDate);
+}
+
+ossimString ossimDtedDsi::verticalDatum() const
+{
+   return ossimString(theVerticalDatum);
+}
+
+ossimString ossimDtedDsi::horizontalDatum() const
+{
+   return ossimString(theHorizontalDatum);
+}
+
+ossimString ossimDtedDsi::compilationDate() const
+{
+   return ossimString(theCompilationDate);
+}
+
+ossimString ossimDtedDsi::latOrigin() const
+{
+   return ossimString(theLatOrigin);
+}
+
+ossimString ossimDtedDsi::lonOrigin() const
+{
+   return ossimString(theLonOrigin);
+}
+
+ossimString ossimDtedDsi::latSW() const
+{
+   return ossimString(theLatSW);
+}
+
+ossimString ossimDtedDsi::lonSW() const
+{
+   return ossimString(theLonSW);
+}
+
+ossimString ossimDtedDsi::latNW() const
+{
+   return ossimString(theLatNW);
+}
+
+ossimString ossimDtedDsi::lonNW() const
+{
+   return ossimString(theLonNW);
+}
+
+ossimString ossimDtedDsi::latNE() const
+{
+   return ossimString(theLatNE);
+}
+
+ossimString ossimDtedDsi::lonNE() const
+{
+   return ossimString(theLonNE);
+}
+
+ossimString ossimDtedDsi::latSE() const
+{
+   return ossimString(theLatSE);
+}
+
+ossimString ossimDtedDsi::lonSE() const
+{
+   return ossimString(theLonSE);
+}
+
+ossimString ossimDtedDsi::orientation() const
+{
+   return ossimString(theOrientation);
+}
+
+ossimString ossimDtedDsi::latInterval() const
+{
+   return ossimString(theLatInterval);
+}
+
+ossimString ossimDtedDsi::lonInterval() const
+{
+   return ossimString(theLonInterval);
+}
+
+ossim_int32  ossimDtedDsi::numLatPoints() const
+{
+   return atoi(theNumLatPoints);
+}
+
+ossim_int32  ossimDtedDsi::numLonLines() const
+{
+   return atoi(theNumLonLines);
+}
+
+ossim_int32  ossimDtedDsi::cellIndicator() const
+{
+   return atoi(theCellIndicator);
+}
+
+ossim_int32 ossimDtedDsi::startOffset() const
+{
+   return theStartOffset;
+}
+ossim_int32 ossimDtedDsi::stopOffset() const
+{
+   return theStopOffset;
+}
+
+//**************************************************************************
+// operator <<
+//**************************************************************************
+std::ostream& operator<<( std::ostream& os, const ossimDtedDsi& dsi)
+{
+   std::string prefix;
+   return dsi.print(os, prefix);
+}
+
+std::ostream& ossimDtedDsi::print(std::ostream& out,
+                                  const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += "dsi.";
+   
+   out << setiosflags(ios::left)
+       << pfx << setw(28) << "recognition_sentinel:" << theRecSen << "\n"
+       << pfx << setw(28) << "security_code:" << theSecurityCode << "\n"
+       << pfx << setw(28) << "product_level:" << theProductLevel << "\n"
+       << pfx << setw(28) << "edition:" << theEdition << "\n"
+       << pfx << setw(28) << "match_merge_version:" << theMatchMergeVersion
+       << "\n"
+       << pfx << setw(28) << "maintenance_date:" << theMaintenanceDate << "\n"
+       << pfx << setw(28) << "match_merge_date:" << theMatchMergeDate << "\n"
+       << pfx << setw(28) << "maintenance_code:" << theMaintenanceCode << "\n"
+       << pfx << setw(28) << "producer_code:" << theProducerCode << "\n"
+       << pfx << setw(28) << "product_stock_spec_number:"
+       << theProductStockSpecNumber
+       << "\n"
+       << pfx << setw(28) << "product_spec_number:"
+       << theProductSpecNumber << "\n"
+       << pfx << setw(28) << "vertical_datum:" << theVerticalDatum << "\n"
+       << pfx << setw(28) << "horizontal_datum:" << theHorizontalDatum << "\n"
+       << pfx << setw(28) << "compilation_date:" << theCompilationDate << "\n"
+       << pfx << setw(28) << "lat_origin:" << theLatOrigin << "\n"
+       << pfx << setw(28) << "lon_origin:" << theLonOrigin << "\n"
+       << pfx << setw(28) << "lat_sw:" << theLatSW << "\n"
+       << pfx << setw(28) << "lon_sw:" << theLonSW << "\n"
+       << pfx << setw(28) << "lat_nw:" << theLatNW << "\n"
+       << pfx << setw(28) << "lon_nw:" << theLonNW << "\n"
+       << pfx << setw(28) << "lat_ne:" << theLatNE << "\n"
+       << pfx << setw(28) << "lon_ne:" << theLonNE << "\n"
+       << pfx << setw(28) << "lat_se:" << theLatSE << "\n"
+       << pfx << setw(28) << "lon_se:" << theLonSE << "\n"
+       << pfx << setw(28) << "orientation:" << theOrientation << "\n"
+       << pfx << setw(28) << "lat_interval:" << theLatInterval << "\n"
+       << pfx << setw(28) << "lon_interval:" << theLonInterval << "\n"
+       << pfx << setw(28) << "number_of_lat_points:" << theNumLatPoints << "\n"
+       << pfx << setw(28) << "number_of_lon_lines:" << theNumLonLines << "\n"
+       << pfx << setw(28) << "cell_indicator:" << theCellIndicator << "\n"
+       << pfx << setw(28) << "start_offset:" << theStartOffset << "\n"
+       << pfx << setw(28) << "stop_offset:" << theStopOffset
+       << std::endl;
+   return out;
+}
+
+ossimDtedDsi::ossimDtedDsi(const ossimDtedDsi& /* source */)
+{}
+
+const ossimDtedDsi& ossimDtedDsi::operator=(const ossimDtedDsi& rhs)
+{
+   return rhs;
+}
diff --git a/src/support_data/ossimDtedHdr.cpp b/src/support_data/ossimDtedHdr.cpp
new file mode 100644
index 0000000..1d683d0
--- /dev/null
+++ b/src/support_data/ossimDtedHdr.cpp
@@ -0,0 +1,207 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the File Header Label
+//               (HDR) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedHdr.cpp 17501 2010-06-02 11:14:55Z dburken $
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#include <ossim/support_data/ossimDtedHdr.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimIoStream.h>
+
+ossimDtedHdr::ossimDtedHdr()
+:
+  theStartOffset(0),
+  theStopOffset(0)
+{
+
+}
+
+ossimDtedHdr::ossimDtedHdr(std::shared_ptr<ossim::istream>& str, ossim_int64 offset)
+:
+  theStartOffset(0),
+  theStopOffset(0)
+{
+  if(str)
+  {
+    str->seekg(offset);
+    // Continue parsing all the record fields.
+    parse(*str);  
+
+  }
+  else
+  {
+    theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+  }
+}
+
+//**************************************************************************
+// ossimDtedHdr::parse()
+//**************************************************************************
+void ossimDtedHdr::parse(std::istream& in)
+{
+   clearErrorStatus();
+   theStartOffset = in.tellg();
+   theStopOffset  = theStartOffset;
+   // Parse theRecSen
+   in.read(theRecSen, FIELD1_SIZE);
+   theRecSen[FIELD1_SIZE] = '\0';
+
+   if(!(strncmp(theRecSen, "HDR", 3) == 0))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      in.seekg(theStartOffset);
+      return;
+   }
+   
+   // Parse Field 2
+   in.read(theField2, FIELD2_SIZE);
+   theField2[FIELD2_SIZE] = '\0';
+   
+   // Parse theFilename
+   in.read(theFilename, FIELD3_SIZE);
+   theFilename[FIELD3_SIZE] = '\0';
+   
+   // Parse Field 4
+   in.read(theField4, FIELD4_SIZE);
+   theField4[FIELD4_SIZE] = '\0';
+   
+   // Parse Field 5
+   in.read(theField5, FIELD5_SIZE);
+   theField5[FIELD5_SIZE] = '\0';
+   
+   // Parse Field 6
+   in.read(theField6, FIELD6_SIZE);
+   theField6[FIELD6_SIZE] = '\0';
+   
+   // Parse Field 7
+   in.read(theVersion, FIELD7_SIZE);
+   theVersion[FIELD7_SIZE] = '\0';
+   
+   // Parse theCreationDate
+   in.read(theCreationDate, FIELD8_SIZE);
+   theCreationDate[FIELD8_SIZE] = '\0';
+   
+   // Parse Field 9
+   in.read(theField9, FIELD9_SIZE);
+   theField9[FIELD9_SIZE] = '\0';   
+   
+   // Parse Field 10
+   in.read(theField10, FIELD10_SIZE);
+   theField10[FIELD10_SIZE] = '\0';   
+   
+   // Parse Field 11
+   in.read(theField11, FIELD11_SIZE);
+   theField11[FIELD11_SIZE] = '\0';   
+   
+   // Parse Field 12
+   in.read(theField12, FIELD12_SIZE);
+   theField12[FIELD12_SIZE] = '\0';   
+   
+   // Parse Field 13
+   in.read(theField13, FIELD13_SIZE);
+   theField13[FIELD13_SIZE] = '\0';   
+   
+   // Parse Field 14
+   in.read(theField14, FIELD14_SIZE);
+   theField14[FIELD14_SIZE] = '\0';
+
+   // Set the stop offset.
+   theStopOffset = theStartOffset + HDR_LENGTH;
+}
+
+ossimRefPtr<ossimProperty> ossimDtedHdr::getProperty(
+   const ossimString& /* name */) const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   return result;
+}
+
+void ossimDtedHdr::getPropertyNames(
+   std::vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(ossimString("dted_hdr_record"));
+}
+
+
+//**************************************************************************
+// operator <<
+//**************************************************************************
+std::ostream& operator<<( std::ostream& os, const ossimDtedHdr& hdr)
+{
+   std::string prefix;
+   return hdr.print(os, prefix);
+}
+
+std::ostream& ossimDtedHdr::print(std::ostream& out,
+                                  const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += "hdr.";
+   
+   out << pfx << "recognition_sentinel:  " << theRecSen << "\n"
+       << pfx << "field2:                " << theField2 << "\n"
+       << pfx << "filename:              " << theFilename << "\n"
+       << pfx << "field4:                " << theField4 << "\n"
+       << pfx << "field5:                " << theField5 << "\n"
+       << pfx << "field6:                " << theField6 << "\n"
+       << pfx << "version:               " << theVersion << "\n"
+       << pfx << "creation_date:         " << theCreationDate << "\n"
+       << pfx << "field9:                " << theField9 << "\n"
+       << pfx << "field10:               " << theField10 << "\n"
+       << pfx << "field11:               " << theField11 << "\n"
+       << pfx << "field12:               " << theField12 << "\n"
+       << pfx << "field13:               " << theField13 << "\n"
+       << pfx << "field14:               " << theField14 << "\n"
+       << std::endl;
+   
+   return out;
+}
+
+ossimString ossimDtedHdr::recognitionSentinel() const
+{
+   return theRecSen;
+}
+
+ossimString ossimDtedHdr::fileName() const
+{
+   return theFilename;
+}
+ossimString ossimDtedHdr::version() const
+{ return theVersion;
+}
+
+ossimString ossimDtedHdr::creationDate() const
+{
+   return theCreationDate;
+}
+
+ossim_int32 ossimDtedHdr::startOffset() const
+{
+   return theStartOffset;
+}
+
+ossim_int32 ossimDtedHdr::stopOffset() const
+{
+   return theStopOffset;
+}
+
+ossimDtedHdr::ossimDtedHdr(const ossimDtedHdr& /* source */)
+{}
+
+const ossimDtedHdr& ossimDtedHdr::operator=(const ossimDtedHdr& rhs)
+{
+   return rhs;
+}
diff --git a/src/support_data/ossimDtedInfo.cpp b/src/support_data/ossimDtedInfo.cpp
new file mode 100644
index 0000000..7a010c7
--- /dev/null
+++ b/src/support_data/ossimDtedInfo.cpp
@@ -0,0 +1,271 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: DTED Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <iostream>
+#include <ossim/support_data/ossimDtedInfo.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimRegExp.h>
+
+
+ossimDtedInfo::ossimDtedInfo()
+{
+}
+
+ossimDtedInfo::~ossimDtedInfo()
+{
+}
+
+bool ossimDtedInfo::open(std::shared_ptr<ossim::istream>& str,
+                         const std::string& connectionString)
+{
+   bool result = false;
+   if(!str) return false;
+   // Test for extension, like dt0, dt1...
+   ossimString ext = ossimFilename(connectionString).ext();
+   ossimRegExp regExp("^[d|D][t|T][0-9]");
+   m_dtedFileStr.reset();
+   if ( regExp.find( ext.c_str() ) )
+   {
+      m_vol.parse(*str);
+      m_hdr.parse(*str);
+      m_uhl.parse(*str);
+      m_dsi.parse(*str);
+      m_acc.parse(*str);
+      //---
+      // Check for errors.  Must have uhl, dsi and acc records.  vol and hdr
+      // are for magnetic tape only; hence, may or may not be there.
+      //---
+      if ( (m_uhl.getErrorStatus() == ossimErrorCodes::OSSIM_OK) &&
+           (m_dsi.getErrorStatus() == ossimErrorCodes::OSSIM_OK) &&
+           (m_acc.getErrorStatus() == ossimErrorCodes::OSSIM_OK) )
+      {
+         result = true;
+         m_connectionString = connectionString;
+         m_dtedFileStr = str;
+      }
+      else
+      {
+         m_connectionString.clear();
+         m_dtedFileStr.reset();
+      }
+   }
+
+   return result;
+}
+
+std::ostream& ossimDtedInfo::print(std::ostream& out) const
+{
+   std::string prefix = "dted.";
+   if( m_vol.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+   {
+      m_vol.print(out, prefix);
+   }
+   if( m_hdr.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+   {
+      m_hdr.print(out, prefix);
+   }
+   if( m_uhl.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+   {
+      m_uhl.print(out, prefix);
+   }
+   if( m_dsi.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+   {
+      m_dsi.print(out, prefix);
+   }
+   if( m_acc.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+   {
+      m_acc.print(out, prefix);
+   }
+   return out;
+}
+
+ossimRefPtr<ossimProperty> ossimDtedInfo::getProperty(
+   const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+
+   //---
+   // Look through dted records.
+   // Must have uhl, dsi and acc records.  vol and hdr
+   // are for magnetic tape only; hence, may or may not be there.
+   //---
+   //ossimDtedVol vol(m_dtedFileStr, 0);
+   if( m_vol.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+   {
+      if (name == "dted_vol_record")
+      {
+         ossimContainerProperty* box = new ossimContainerProperty();
+         box->setName(name);
+
+         std::vector<ossimString> list;
+         m_vol.getPropertyNames(list);
+
+         std::vector< ossimRefPtr<ossimProperty> > propList;
+
+         std::vector<ossimString>::const_iterator i = list.begin();
+         while (i != list.end())
+         {
+            ossimRefPtr<ossimProperty> prop = m_vol.getProperty( (*i) );
+            if (prop.valid())
+            {
+               propList.push_back(prop);
+            }
+            ++i;
+         }
+         box->addChildren(propList);
+         result = box;
+      }
+   }
+   if (result.valid() == false)
+   {
+      //ossimDtedHdr hdr(m_dtedFileStr, vol.stopOffset());
+      if( m_hdr.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+      {
+         if (name == "dted_hdr_record")
+         {
+            ossimContainerProperty* box = new ossimContainerProperty();
+            box->setName(name);
+            
+            std::vector<ossimString> list;
+            m_hdr.getPropertyNames(list);
+            
+            std::vector< ossimRefPtr<ossimProperty> > propList;
+            
+            std::vector<ossimString>::const_iterator i = list.begin();
+            while (i != list.end())
+            {
+               ossimRefPtr<ossimProperty> prop = m_hdr.getProperty( (*i) );
+               if (prop.valid())
+               {
+                  propList.push_back(prop);
+               }
+               ++i;
+            }
+            box->addChildren(propList);
+            result = box;
+         }
+      }
+      if (result.valid() == false)
+      {
+        // ossimDtedUhl uhl(m_dtedFileStr, hdr.stopOffset());
+         if( m_uhl.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+         {
+            if (name == "dted_uhl_record")
+            {
+               ossimContainerProperty* box = new ossimContainerProperty();
+               box->setName(name);
+               
+               std::vector<ossimString> list;
+               m_uhl.getPropertyNames(list);
+               
+               std::vector< ossimRefPtr<ossimProperty> > propList;
+               
+               std::vector<ossimString>::const_iterator i = list.begin();
+               while (i != list.end())
+               {
+                  ossimRefPtr<ossimProperty> prop = m_uhl.getProperty( (*i) );
+                  if (prop.valid())
+                  {
+                     propList.push_back(prop); 
+                  }
+                  ++i;
+               }
+               box->addChildren(propList);
+               result = box;
+            }
+         }
+         if (result.valid() == false)
+         {
+            //ossimDtedDsi dsi(m_dtedFileStr, uhl.stopOffset());
+            if( m_dsi.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+            {
+               if (name == "dted_dsi_record")
+               {
+                  ossimContainerProperty* box =
+                     new ossimContainerProperty();
+                  box->setName(name);
+                  
+                  std::vector<ossimString> list;
+                  m_dsi.getPropertyNames(list);
+                  
+                  std::vector< ossimRefPtr<ossimProperty> > propList;
+                  
+                  std::vector<ossimString>::const_iterator i = list.begin();
+                  while (i != list.end())
+                  {
+                     ossimRefPtr<ossimProperty> prop =
+                        m_dsi.getProperty( (*i) );
+                     if (prop.valid())
+                     {
+                        propList.push_back(prop);
+                     }
+                     ++i;
+                  }
+                  box->addChildren(propList);
+                  result = box;
+               }
+            }
+            if (result.valid() == false)
+            {
+               //ossimDtedAcc acc(m_dtedFileStr, dsi.stopOffset());
+               if( m_acc.getErrorStatus() == ossimErrorCodes::OSSIM_OK )
+               {
+                  if (name == "dted_acc_record")
+                  {
+                     ossimContainerProperty* box =
+                        new ossimContainerProperty();
+                     box->setName(name);
+                     
+                     std::vector<ossimString> list;
+                     m_acc.getPropertyNames(list);
+                     
+                     std::vector< ossimRefPtr<ossimProperty> > propList;
+                     
+                     ossimRefPtr<ossimProperty> prop = 0;
+                     std::vector<ossimString>::const_iterator i =
+                        list.begin();
+                     while (i != list.end())
+                     {
+                        ossimRefPtr<ossimProperty> prop =
+                           m_acc.getProperty( (*i) );
+                        if (prop.valid())
+                        {
+                           propList.push_back(prop);
+                        }
+                        ++i;
+                     }
+                     box->addChildren(propList);
+                     result = box;
+                  }
+               }
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+void ossimDtedInfo::getPropertyNames(
+   std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(ossimString("dted_vol_record"));
+   propertyNames.push_back(ossimString("dted_hdr_record"));
+   propertyNames.push_back(ossimString("dted_uhl_record"));
+   propertyNames.push_back(ossimString("dted_dsi_record"));
+   propertyNames.push_back(ossimString("dted_acc_record"));
+}
+
+
diff --git a/ossim/src/ossim/support_data/ossimDtedRecord.cpp b/src/support_data/ossimDtedRecord.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimDtedRecord.cpp
rename to src/support_data/ossimDtedRecord.cpp
diff --git a/src/support_data/ossimDtedUhl.cpp b/src/support_data/ossimDtedUhl.cpp
new file mode 100644
index 0000000..7285388
--- /dev/null
+++ b/src/support_data/ossimDtedUhl.cpp
@@ -0,0 +1,290 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the User Header Label
+//               (UHL) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedUhl.cpp 23277 2015-04-24 21:02:24Z rashadkm $
+
+#include <cstdlib>
+#include <iostream>
+#include <iomanip>
+#include <fstream>
+#include <string>
+
+#include <ossim/support_data/ossimDtedUhl.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimIoStream.h>
+
+ossimDtedUhl::ossimDtedUhl()
+{
+
+}
+
+ossimDtedUhl::ossimDtedUhl(std::shared_ptr<ossim::istream>& str, ossim_int64 offset)
+   :
+      theRecSen(),
+      theField2(),
+      theLonOrigin(),
+      theLatOrigin(),
+      theLonInterval(),
+      theLatInterval(),
+      theAbsoluteLE(),
+      theSecurityCode(),
+      theNumLonLines(),
+      theNumLatPoints(),
+      theMultipleAccuracy(),
+      theStartOffset(0),
+      theStopOffset(0)
+{
+  if(str)
+  {
+    str->seekg(offset);
+    parse(*str);
+  }
+  else
+  {
+    theErrorStatus = ossimErrorCodes::OSSIM_ERROR;  
+  }
+}
+
+
+//**************************************************************************
+// ossimDtedUhl::parse()
+//**************************************************************************
+void ossimDtedUhl::parse(std::istream& in)
+{
+   clearErrorStatus();
+   theStartOffset = in.tellg();
+   theStopOffset  = theStartOffset;
+   // Parse theRecSen
+   in.read(theRecSen, FIELD1_SIZE);
+   theRecSen[FIELD1_SIZE] = '\0';
+
+   if(!(strncmp(theRecSen, "UHL", 3) == 0))
+   {
+      // Not a user header label.
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;  
+      in.seekg(theStartOffset);
+      return;
+   }  
+   
+   // Parse Field 2
+   in.read(theField2, FIELD2_SIZE);
+   theField2[FIELD2_SIZE] = '\0';
+   
+   // Parse theLonOrigin
+   in.read(theLonOrigin, FIELD3_SIZE);
+   theLonOrigin[FIELD3_SIZE] = '\0';
+   
+   // Parse theLatOrigin
+   in.read(theLatOrigin, FIELD4_SIZE);
+   theLatOrigin[FIELD4_SIZE] = '\0';
+   
+   // Parse theLonInterval
+   in.read(theLonInterval, FIELD5_SIZE);
+   theLonInterval[FIELD5_SIZE] = '\0';
+   
+   // Parse theLatInterval
+   in.read(theLatInterval, FIELD6_SIZE);
+   theLatInterval[FIELD6_SIZE] = '\0';
+   
+   // Parse theAbsoluteLE
+   in.read(theAbsoluteLE, FIELD7_SIZE);
+   theAbsoluteLE[FIELD7_SIZE] = '\0';
+   
+   // Parse theSecurityCode
+   in.read(theSecurityCode, FIELD8_SIZE);
+   theSecurityCode[FIELD8_SIZE] = '\0';
+   
+   // Parse Field 9
+   in.read(theField9, FIELD9_SIZE);
+   theField9[FIELD9_SIZE] = '\0';
+   
+   // Parse theNumLonLines
+   in.read(theNumLonLines, FIELD10_SIZE);
+   theNumLonLines[FIELD10_SIZE] = '\0';
+   
+   // Parse theNumLatPoints
+   in.read(theNumLatPoints, FIELD11_SIZE);
+   theNumLatPoints[FIELD11_SIZE] = '\0';
+   
+   // Parse theMultipleAccuracy
+   in.read(theMultipleAccuracy, FIELD12_SIZE);
+   theMultipleAccuracy[FIELD12_SIZE] = '\0';
+
+   // Field 13 not parsed as it's unused.
+   in.ignore(FIELD13_SIZE);
+   // Set the stop offset.
+   theStopOffset = theStartOffset + UHL_LENGTH;
+}
+
+ossimRefPtr<ossimProperty> ossimDtedUhl::getProperty(
+   const ossimString& /* name */) const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   return result;
+}
+
+void ossimDtedUhl::getPropertyNames(
+   std::vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(ossimString("dted_uhl_record"));
+}
+
+ossimString ossimDtedUhl::recognitionSentinel() const
+{
+   return theRecSen;
+}
+
+double ossimDtedUhl::lonOrigin() const
+{
+   return degreesFromString(theLonOrigin);
+}
+
+double ossimDtedUhl::latOrigin() const
+{
+   return degreesFromString(theLatOrigin);
+}
+
+double ossimDtedUhl::lonInterval()      const
+{
+   return spacingFromString(theLonInterval);
+}
+
+double ossimDtedUhl::latInterval()      const
+{
+   return spacingFromString(theLatInterval);
+}
+  
+double ossimDtedUhl::degreesFromString(const char* str) const
+{
+   // Parse the string:  DDDMMMSSH
+   if (!str)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "FATAL ossimDtedUhl::degreesFromString: "
+         << "Null pointer passed to method!" << std::endl;
+      return 0.0;
+   }
+   
+   if (strlen(str) < 8)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "FATAL ossimDtedUhl::decimalDegreesFromString:"
+         << "String not big enough!" << std::endl;
+      return 0.0;
+   }
+
+   double d = ((str[0]-'0')*100 + (str[1]-'0')*10 + (str[2]-'0') +
+               (str[3]-'0')/6.0 + (str[4]-'0')/60.0 +
+               (str[5]-'0')/360.0 + (str[6]-'0')/3600.0);
+   
+   if ( (str[7] == 'S') || (str[7] == 's') ||
+        (str[7] == 'W') || (str[7] == 'w') )
+   {
+      d *= -1.0;
+   }
+   
+   return d;
+}
+ 
+double ossimDtedUhl::spacingFromString(const char* str) const
+{
+   // Parse the string: SSSS (tenths of a second)
+   if (!str)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "FATAL ossimDtedUhl::decimalDegreesFromString: "
+         << "Null pointer passed to method!" << std::endl;
+      return 0.0;
+   }
+
+   return atof(str) / 36000.0;  // return 10ths of second as decimal degrees.
+}
+
+double ossimDtedUhl::absoluteLE() const
+{
+  return strtod(theAbsoluteLE, NULL);  
+}
+
+ossimString ossimDtedUhl::securityCode() const
+{
+   return theSecurityCode;
+}
+
+ossim_int32 ossimDtedUhl::numLonLines() const
+{
+  return atoi(theNumLonLines);
+}
+
+ossim_int32 ossimDtedUhl::numLatPoints() const
+{
+  return atoi(theNumLatPoints);
+}
+
+ossim_int32 ossimDtedUhl::mulitpleAccuracy() const
+{
+  return atoi(theMultipleAccuracy);
+}
+
+ossim_int32 ossimDtedUhl::startOffset() const
+{
+  return theStartOffset;
+}
+
+ossim_int32 ossimDtedUhl::stopOffset() const
+{
+  return theStopOffset;
+}
+
+//**************************************************************************
+// operator <<
+//**************************************************************************
+std::ostream& operator<<( std::ostream& out, const ossimDtedUhl& uhl)
+{
+   std::string prefix;
+   return uhl.print(out, prefix);
+}
+
+std::ostream& ossimDtedUhl::print(std::ostream& out,
+                                  const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += "uhl.";
+   
+   out << setiosflags(ios::left)
+       << pfx << setw(28) << "recognition_sentinel:" << theRecSen << "\n"
+       << pfx << setw(28) << "lon_origin:" << theLonOrigin << "\n"
+       << pfx << setw(28) << "lat_origin:" << theLatOrigin << "\n"
+       << pfx << setw(28) << "lon_interval:" << theLonInterval << "\n"
+       << pfx << setw(28) << "lat_interval:" << theLatInterval << "\n"
+       << pfx << setw(28) << "absolute_le:" << theAbsoluteLE << "\n"
+       << pfx << setw(28) << "security_code:" << theSecurityCode << "\n"
+       << pfx << setw(28) << "number_of_lat_points:" << theNumLatPoints << "\n"
+       << pfx << setw(28) << "number_of_lon_lines:" << theNumLonLines << "\n"
+       << pfx << setw(28) << "multiple_accuracy:"
+       << theMultipleAccuracy << "\n"
+       << pfx << setw(28) << "start_offset:" << theStartOffset << "\n"
+       << pfx << setw(28) << "stop_offset:" << theStopOffset
+       << std::endl;
+   
+   return out;
+}
+
+ossimDtedUhl::ossimDtedUhl(const ossimDtedUhl& /* source */)
+{
+}
+
+const ossimDtedUhl& ossimDtedUhl::operator=(const ossimDtedUhl& rhs)
+{
+   return rhs;
+}
+
diff --git a/src/support_data/ossimDtedVol.cpp b/src/support_data/ossimDtedVol.cpp
new file mode 100644
index 0000000..255bad1
--- /dev/null
+++ b/src/support_data/ossimDtedVol.cpp
@@ -0,0 +1,226 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Ken Melero
+// 
+// Description:  This class gives access to the Volume Header Label
+//               (VOL) of a DTED Level 1 file.
+//
+//********************************************************************
+// $Id: ossimDtedVol.cpp 17501 2010-06-02 11:14:55Z dburken $
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#include <ossim/support_data/ossimDtedVol.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimIoStream.h>
+
+ossimDtedVol::ossimDtedVol()
+:theStartOffset(0),
+theStopOffset(0)
+{
+
+}
+
+ossimDtedVol::ossimDtedVol(std::shared_ptr<ossim::istream>& str, ossim_int64 offset)
+   :
+      theStartOffset(0),
+      theStopOffset(0)
+{
+  if(str)
+  {
+    str->seekg(offset);
+
+    parse(*str);
+  }
+  else
+  {
+    theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+  }
+}
+
+//**************************************************************************
+// CONSTRUCTOR
+//**************************************************************************
+// ossimDtedVol::ossimDtedVol(const ossimFilename& dted_file,
+//                            ossim_int32 offset)
+//    :
+//       theStartOffset(0),
+//       theStopOffset(0)
+// {
+//    if(!dted_file.empty())
+//    {
+//       // Check to see that dted file exists.
+//       if(!dted_file.exists())
+//       {
+//          theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+//          ossimNotify(ossimNotifyLevel_FATAL)
+//          << "FATAL ossimDtedVol::ossimDtedVol"
+//          << "\nThe DTED file does not exist: " << dted_file << std::endl;
+//          return;
+//       }
+      
+//       // Check to see that the dted file is readable.
+//       if(!dted_file.isReadable())
+//       {
+//          theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+//          ossimNotify(ossimNotifyLevel_FATAL)
+//          << "FATAL ossimDtedVol::ossimDtedVol"
+//          << "\nThe DTED file is not readable: " << dted_file << std::endl;
+//          return;
+//       }
+      
+//       // Open the dted file for reading.
+//       std::ifstream in(dted_file.c_str());
+//       if(!in)
+//       {
+//          theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+//          ossimNotify(ossimNotifyLevel_FATAL)
+//          << "FATAL ossimDtedVol::ossimDtedVol"
+//          << "\nUnable to open the DTED file: " << dted_file << std::endl;
+//          return;
+//       }
+//       in.seekg(offset);
+//       parse(in);
+      
+//       in.close();
+//    }
+// }
+
+//**************************************************************************
+// CONSTRUCTOR
+//**************************************************************************
+// ossimDtedVol::ossimDtedVol(std::istream& in)
+//    :
+//       theStartOffset(0),
+//       theStopOffset(0)
+// {
+//    parse(in);
+// }
+
+void ossimDtedVol::parse(std::istream& in)
+{
+   clearErrorStatus();
+   theStartOffset = in.tellg();
+   theStopOffset  = theStartOffset;
+   // Parse theRecSen
+   in.read(theRecSen, FIELD1_SIZE);
+   theRecSen[FIELD1_SIZE] = '\0';
+   if(!(strncmp(theRecSen, "VOL", 3) == 0))
+   {
+      // Not a volume header label.
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      in.seekg(theStartOffset);
+      return;
+   }   
+
+   // Parse Field 2
+   in.read(theField2, FIELD2_SIZE);
+   theField2[FIELD2_SIZE] = '\0';
+   
+   // Parse theReelNumber
+   in.read(theReelNumber, FIELD3_SIZE);
+   theReelNumber[FIELD3_SIZE] = '\0';
+   
+   // Parse Field 4
+   in.read(theField4, FIELD4_SIZE);
+   theField4[FIELD4_SIZE] = '\0';
+   
+   // Parse Field 5
+   in.read(theField5, FIELD5_SIZE);
+   theField5[FIELD5_SIZE] = '\0';
+   
+   // Parse theAccountNumber
+   in.read(theAccountNumber, FIELD6_SIZE);
+   theAccountNumber[FIELD6_SIZE] = '\0';
+   
+   // Parse Field 7
+   in.read(theField7, FIELD7_SIZE);
+   theField7[FIELD7_SIZE] = '\0';
+
+   // Parse Field 8
+   in.read(theField8, FIELD8_SIZE);
+   theField8[FIELD8_SIZE] = '\0';
+
+   // Set the stop offset.
+   theStopOffset = theStartOffset + VOL_LENGTH;
+}
+
+ossimRefPtr<ossimProperty> ossimDtedVol::getProperty(
+   const ossimString& /* name */) const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+   return result;
+}
+
+void ossimDtedVol::getPropertyNames(
+   std::vector<ossimString>& propertyNames) const
+{
+   propertyNames.push_back(ossimString("dted_vol_record"));
+}
+
+ossimString ossimDtedVol::getRecognitionSentinel() const
+{
+   return ossimString(theRecSen);
+}
+
+ossimString ossimDtedVol::getReelNumber() const
+{
+   return ossimString(theReelNumber);
+}
+
+ossimString ossimDtedVol::getAccountNumber() const
+{
+   return ossimString(theAccountNumber);
+}
+
+ossim_int32 ossimDtedVol::startOffset() const
+{
+   return theStartOffset;
+}
+
+ossim_int32 ossimDtedVol::stopOffset() const
+{
+   return theStopOffset;
+}
+
+std::ostream& ossimDtedVol::print(std::ostream& out,
+                                  const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += "vol.";
+   
+   out << pfx << "recognition_sentinel: " << theRecSen << "\n"
+       << pfx << "field2:                " << theField2 << "\n"
+       << pfx << "reel_number:           " << theReelNumber << "\n"
+       << pfx << "field4:                " << theField4 << "\n"
+       << pfx << "field5:                " << theField5 << "\n"
+       << pfx << "account_number:        " << theAccountNumber << "\n"
+       << pfx << "field7:                " << theField7 << "\n"
+       << pfx << "field8:                " << theField8 << "\n"
+       << std::endl;
+   return out;
+}
+
+//**************************************************************************
+// operator <<
+//**************************************************************************
+std::ostream& operator<<( std::ostream& out, const ossimDtedVol& vol)
+{
+   std::string prefix;
+   return vol.print(out, prefix);
+}
+
+ossimDtedVol::ossimDtedVol(const ossimDtedVol& /* source */)
+{
+}
+
+const ossimDtedVol& ossimDtedVol::operator=(const ossimDtedVol& rhs)
+{
+   return rhs;
+}
+
diff --git a/src/support_data/ossimERS.cpp b/src/support_data/ossimERS.cpp
new file mode 100644
index 0000000..07e2184
--- /dev/null
+++ b/src/support_data/ossimERS.cpp
@@ -0,0 +1,681 @@
+//*******************************************************************
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Chong-Ket Chuah
+// Contributor: Anrew Huang
+// 
+// Description:
+// Implementation of ossimERS class for parsing a ER Mapper raster
+// file format header.
+//
+//********************************************************************
+// $Id: ossimERS.cpp 17501 2010-06-02 11:14:55Z dburken $
+
+#include <cstdio>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimERS.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+static ossimTrace traceDebug("ossimERS:degug");
+
+
+ossimERS::ossimERS()
+   :
+      ossimErrorStatusInterface()
+{
+   clearFields();
+}
+
+ossimERS::ossimERS(const char* headerFile)
+   :
+      ossimErrorStatusInterface()
+{
+   clearFields();
+
+   // open the header file:
+   std::ifstream in;
+   in.open(headerFile, std::ios::in | std::ios::binary);
+
+   if (!in)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   // Begin parsing records:
+   if (!theErrorStatus)
+   {
+      parseHeader(in);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimERS DEBUG:"
+         << *this
+         << std::endl;
+   }
+}
+
+void ossimERS::parseError(const char* /* msg*/ )
+{
+   theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+}
+
+void ossimERS::parseRasterInfo(std::istream& in)
+{
+   std::vector<ossimString> tokens;
+
+   bool done = false;
+   while (!done)
+   {
+      tokens = parseLine(in);
+      if (tokens.empty())
+      {
+         parseError("premature end of header file.");
+         return;
+      }
+      if (tokens[0] == "CellType")
+      {
+         if (tokens[1] == "Unsigned8BitInteger")
+         {
+            theCelltype = OSSIM_UCHAR;
+         }
+         else if (tokens[1] == "Unsigned16BitInteger")
+         {
+            theCelltype = OSSIM_USHORT16;
+         }
+         else if (tokens[1] == "Signed16BitInteger")
+         {
+            theCelltype = OSSIM_SSHORT16;
+         }
+         else if (tokens[1] == "IEEE4ByteReal")
+         {
+            theCelltype = OSSIM_FLOAT;
+         }
+         else if (tokens[1] == "IEEE8ByteReal")
+         {
+            theCelltype = OSSIM_DOUBLE;
+         }
+         else
+         {
+            parseError("Unsupported CellType.");
+         }
+      }
+      else if (tokens[0] == "NullCellValue")
+      {
+         theHasNullCells = true;
+         theNullCell = tokens[1].toInt();	 // float nullcell value?
+      }
+      else if (tokens[0] == "Xdimension")
+      {	// ignore "CellInfo"
+         theCellSizeX = tokens[1].toDouble();
+      }
+      else if (tokens[0] == "Ydimension")
+      {	// ignore "CellInfo"
+         theCellSizeY = tokens[1].toDouble();
+      }
+      else if (tokens[0] == "NrOfLines")
+      {
+         theLine = tokens[1].toInt();
+      }
+      else if (tokens[0] == "NrOfCellsPerLine")
+      {
+         theSample = tokens[1].toInt();
+      }
+      else if (tokens[0] == "Eastings")
+      {	// ignore "RegistrationCoord"
+         theTieUnitType = OSSIM_METERS;
+         theOriginX = tokens[1].toDouble();
+      }
+      else if (tokens[0] == "Northings")
+      {	// ignore "RegistrationCoord"
+         theTieUnitType = OSSIM_METERS;
+         theOriginY = tokens[1].toDouble();
+      }
+      else if (tokens[0] == "Longitude")
+      {	// ignore "RegistrationCoord"
+                                                // need to check coordinatestype ("Cannot use Latitude with UTM projection")
+         double deg, min, sec;
+         sscanf (tokens[1].chars(), "%lg:%lg:%lg", &deg, &min, &sec);
+         theOriginX = std::abs(deg) + min/60.0 + sec/3600.0;
+         if (deg < 0.0)
+         {
+            theOriginX = -theOriginX;
+         }
+         theTieUnitType = OSSIM_DEGREES;
+      }
+      else if (tokens[0] == "Latitude")
+      {	// ignore "RegistrationCoord"
+         double deg, min, sec;
+         sscanf (tokens[1].chars(), "%lg:%lg:%lg", &deg, &min, &sec);
+         theOriginY = std::abs(deg) + min/60.0 + sec/3600.0;
+         if (deg < 0.0)
+         {
+            theOriginY = -theOriginY;
+         }
+         theTieUnitType = OSSIM_DEGREES;
+      }
+      else if (tokens[0] == "NrOfBands")
+      {
+         theBands = tokens[1].toInt();
+      }
+      else if (tokens[0] == "Value")
+      {	// ignore "BandID"
+        // keep adding to the bandID vector
+        // delete Value key then join the rest of tokens
+         tokens.erase(tokens.begin());
+         ossimString id;
+         id.join(tokens, " ");
+         theBandID.push_back(id);
+      }
+      else if (tokens[0] == "RasterInfo")
+      {
+         done = true;
+      }
+   }
+}
+
+
+void ossimERS::parseCoordinateSpace(std::istream& in)
+{
+   std::vector<ossimString> tokens;
+
+   bool done = false;
+   while (!done)
+   {
+      tokens = parseLine(in);
+      if (tokens.empty())
+      {
+         parseError("premature end of header file.");
+         return;
+      }
+      if (tokens[0] == "Datum")
+      {
+         theDatum = tokens[1];
+         if (theDatum != "WGS84" && theDatum != "RAW")
+         {
+            parseError("Datum must be WGS84 or RAW");
+         }
+      }
+      else if (tokens[0] == "Projection")
+      {
+         theProjection = tokens[1];
+         // need to parse projection string
+         /*(EqualStrings (tok(1,3), "UTM")) {
+           coordinateSystem = 'U';
+           if (tok(0) == 'N')
+           northernHemisphere = 1;
+           else
+           northernHemisphere = 0;
+           spString zoneStr = tok(4,2);
+           sscanf (zoneStr.chars(), "%d", &zone);
+         */
+      }
+      else if (tokens[0] == "CoordinateType")
+      {
+         // ignore it
+      }
+      else if (tokens[0] == "Units")
+      {
+         // ignore it for now
+      }
+      else if (tokens[0] == "Rotation")
+      {
+         double deg, min, sec;
+         sscanf (tokens[1].chars(), "%lg:%lg:%lg", &deg, &min, &sec);
+         theRotation = deg + min/60.0 + sec/3600.0;
+      }
+      else if (tokens[0] == "CoordinateSpace")
+      {
+         done = true;
+      }
+   }
+
+   // requires more error checking on unit and rotation here
+   return;
+}
+
+void ossimERS::parseHeader(std::istream& in)
+{
+   theErrorStatus = ossimErrorCodes::OSSIM_OK;
+   char magicNumberTest[14];
+   in.read(magicNumberTest, 13);
+   if(ossimString(magicNumberTest,
+                  magicNumberTest+13) != "DatasetHeader")
+   {
+      parseError("First line must be DatasetHeader");
+      return;
+   }
+   in.seekg(0);
+   std::vector<ossimString> tokens = parseLine(in);
+   if(!tokens.size())
+   {
+      parseError("First line must be DatasetHeader");
+      return;
+   }
+   if (tokens[0] != "DatasetHeader")
+   {
+      parseError("First line must be DatasetHeader");
+      return;
+   }
+
+   bool done = false;
+   while (!done)
+   {
+      tokens = parseLine(in);
+      if (tokens.empty())
+      {
+         parseError("premature end of header file.");
+         return;
+      }
+      if (tokens[0] == "Version")
+      {
+         theVersion = tokens[1].toDouble();
+         if (theVersion < 4.0)
+         {
+            parseError("Version must be 4.0 or greater");
+         }
+      }
+      else if (tokens[0] == "DataSetType")
+      {
+         theDatasetType = tokens[1];
+         if (theDatasetType != "ERStorage")
+         {
+            parseError("DataSetType must be ERStorage");
+         }
+      }
+      else if (tokens[0] == "DataType")
+      {
+         theDatatype = tokens[1];
+         if (theDatatype != "Raster")
+         {
+            parseError("DataType must be Raster");
+         }
+      }
+      else if (tokens[0] == "ByteOrder")
+      {
+         theByteorder = tokens[1];
+         if (theByteorder != "MSBFirst" && theByteorder != "LSBFirst")
+         {
+            parseError("ByteOrder must either be MSBFirst or LSBFirst");
+         }
+      }
+      else if (tokens[0] == "CoordinateSpace")
+      {
+         if (tokens[1] == "Begin")
+         {
+            parseCoordinateSpace(in);
+         }
+      }
+      else if (tokens[0] == "RasterInfo")
+      {
+         if (tokens[1] == "Begin")
+         {
+            parseRasterInfo(in);
+         }
+      }
+      else if (tokens[0] == "SenseDate")
+      {
+         // ignore for now
+      }
+      else if (tokens[0] == "Comments")
+      {
+         // ignore for now
+      }
+      else if (tokens[0] == "DatasetHeader")
+      {
+         done = true;
+      }
+   }
+
+   if(theProjection.contains("GEODETIC"))
+   {
+      theTieUnitType = OSSIM_DEGREES;
+   }
+
+   return;
+}
+
+
+// read a line from the file, split it using "= \t\n" delimiters.
+// if the first token is empty, if the line begins with a tab, delete
+// the token.  The second token, the value for the key, may be quoted.
+// trim the quotes.
+std::vector<ossimString> ossimERS::parseLine(std::istream& in)
+{
+/*   const int bufSize = 500; */
+   ossimString line;
+   std::vector<ossimString> tokens;
+   bool invalidCharHit = false;
+   const int MAX_LENGTH = 10000;
+   int tempCount = 0;
+   // read a line, skipping empty line
+   while (tokens.empty()&&(in)&&(tempCount < MAX_LENGTH))
+   {
+     tempCount = 1;
+      char c = in.get();
+      while( (c != '\n')&&
+             (!in.eof())&&
+             (!invalidCharHit))
+      {
+         if(c > 0x7e)
+         {
+            invalidCharHit = true;
+         }
+         else
+         {
+            line += (char)c;
+            c = in.get();
+	    ++tempCount;
+         }
+      }
+
+      if(!invalidCharHit)
+      {
+         line.trim('\t');
+         line.trim('\n');
+         line.trim('\r');
+         line.trim(' ');
+
+         if(line != "")
+         {
+            tokens = line.split("= \t");
+            if (tokens.size() > 1)
+            {
+               tokens[1].trim('\"');
+               tokens.back().trim('\"');
+            }
+         }
+      }
+      else
+      {
+         tokens.clear();
+         return tokens;
+      }
+   }
+   if(in.bad()||(tempCount>=MAX_LENGTH))
+     {
+       tokens.clear();
+     }
+
+   return tokens;
+}
+
+bool ossimERS::writeFile(const ossimFilename &file)
+{
+   if (theDescription.empty())
+   {
+      theDescription = file;
+   }
+   
+   std::ofstream out(file.c_str(), std::ios_base::out);
+   
+   if (!out)
+   {
+      return false;
+   }
+   
+   print(out);
+   out.close();
+   return true;
+
+}
+
+std::ostream& ossimERS::print(std::ostream& out) const
+{
+   out<< std::setiosflags(std::ios::fixed) << std::setprecision(12);
+   out<<"DatasetHeader Begin" <<std::endl;
+   out<<"	Version		= \"5.5\"" <<std::endl;
+   out<<"	DataSetType	= " <<theDatasetType <<std::endl;
+   out<<"	DataType	= " <<theDatatype <<std::endl;
+   out<<"	ByteOrder	= " <<theByteorder <<std::endl;
+   
+   out<<"	CoordinateSpace Begin" <<std::endl;
+   out<<"		Datum		= \"" <<theDatum <<"\"" <<std::endl;
+   out<<"		Projection	= \"" <<theProjection <<"\"" <<std::endl;
+   out<<"		CoordinateType	= " <<theCoordSysType <<std::endl;
+   out<<"	CoordinateSpace End" <<std::endl;
+   
+   ossimString celltype;
+   if (theCelltype == OSSIM_UINT8)
+      celltype = "Unsigned8BitInteger";
+   else if (theCelltype == OSSIM_SINT8)
+      celltype = "Signed8BitInteger";
+   else if (theCelltype == OSSIM_UINT16)
+      celltype = "Unsigned16BitInteger";
+   else if (theCelltype == OSSIM_SINT16)
+      celltype = "Signed16BitInteger";
+   else if (theCelltype == OSSIM_UINT32)
+      celltype = "Unsigned32BitInteger";
+   else if (theCelltype == OSSIM_SINT32)
+      celltype = "Signed32BitInteger";
+   else if (theCelltype == OSSIM_USHORT11)
+      celltype = "Unsigned16BitInteger";
+   else if (theCelltype == OSSIM_USHORT12)
+      celltype = "Unsigned16BitInteger";
+   else if (theCelltype == OSSIM_USHORT13)
+      celltype = "Unsigned16BitInteger";
+   else if (theCelltype == OSSIM_USHORT14)
+      celltype = "Unsigned16BitInteger";
+   else if (theCelltype == OSSIM_USHORT15)
+      celltype = "Unsigned16BitInteger";
+   else if (theCelltype == OSSIM_USHORT16)
+      celltype = "Unsigned16BitInteger";
+   
+   out<<"	RasterInfo Begin" <<std::endl;
+   out<<"		CellType	= " <<celltype <<std::endl;
+   
+   out<<"		CellInfo Begin" <<std::endl;
+   out<<"			Xdimension	= " <<theCellSizeX <<std::endl;
+   out<<"			Ydimension	= " <<theCellSizeY <<std::endl;
+   out<<"		CellInfo End" <<std::endl;
+   
+   out<<"		NrOfLines	= " <<theLine <<std::endl;
+   out<<"		NrOfCellsPerLine	= " <<theSample <<std::endl;
+   
+   out<<"		RegistrationCoord Begin" <<std::endl;
+   if (theTieUnitType == OSSIM_METERS)
+   {
+      out<<"			Eastings	= " <<theOriginX <<std::endl;
+      out<<"			Northings	= " <<theOriginY <<std::endl;
+   }
+   else if (theTieUnitType == OSSIM_DEGREES)
+   {
+      bool minus = false;
+      int min;
+      double degrees, seconds;
+      degrees = theOriginY;
+      if (theOriginY < 0)
+      {
+         minus = true;
+         degrees *=-1;
+      }
+      min = (int)((degrees-(int)degrees)*60);
+      seconds =  ((degrees-(int)degrees)*60 - min)*60;
+      if (minus)
+         degrees *= -1;
+      out<<"			Latitude	= "
+         <<(int)degrees<<":"<<min<<":"<<seconds<<std::endl;
+      
+      minus = false;
+      degrees = theOriginX;
+      if (theOriginX < 0)
+      {
+         minus = true;
+         degrees *=-1;
+      }
+      min = (int)((degrees-(int)degrees)*60);
+      seconds =  ((degrees-(int)degrees)*60 - min)*60;
+      if (minus)
+         degrees *= -1;
+      out<<"			Longitude	= "
+         <<(int)degrees<<":"<<min<<":"<<seconds<<std::endl;
+   }
+   out<<"		RegistrationCoord End" <<std::endl;
+   
+   out<<"		NrOfBands	= " <<theBands <<std::endl;
+   out<<"	RasterInfo End" <<std::endl;
+   
+   out<<"DatasetHeader End" <<std::endl;
+   
+   return out;
+}
+
+bool ossimERS::toOssimProjectionGeom(ossimKeywordlist& kwl,
+                                     const char* prefix)const
+{
+   ossimString proj  = toOssimProjection();
+   ossimString datum = toOssimDatum();
+
+   if(proj == "")
+   {
+      return false;
+   }
+
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           proj.c_str(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::DATUM_KW,
+           datum.c_str(),
+           true);
+
+   // if it's UTM we have to extract out zone and hemisphere
+   // from the projection name stored by ERMapper.
+   //
+   if(proj == "ossimUtmProjection")
+   {
+      ossimString zone(theProjection.begin()+4,
+                       theProjection.end());
+      ossimString hemisphere(theProjection.begin(),
+                             theProjection.begin()+1);
+      kwl.add(prefix,
+              ossimKeywordNames::ZONE_KW,
+              zone.c_str(),
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::HEMISPHERE_KW,
+              hemisphere.c_str(),
+              true);
+   }
+
+   if(theTieUnitType == OSSIM_METERS)
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_EASTING_KW,
+              theOriginX + theCellSizeX/2,
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_NORTHING_KW,
+              theOriginY - theCellSizeY/2,
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::METERS_PER_PIXEL_X_KW,
+              theCellSizeX,
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::METERS_PER_PIXEL_Y_KW,
+              theCellSizeY,
+              true);
+
+   }
+   else if(theTieUnitType == OSSIM_DEGREES)
+   {
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_LAT_KW,
+              theOriginY - theCellSizeY/2,
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::TIE_POINT_LON_KW,
+              theOriginX + theCellSizeX/2,
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+              theCellSizeX,
+              true);
+      kwl.add(prefix,
+              ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+              theCellSizeY,
+              true);
+   }
+
+   return true;
+}
+
+ossimString ossimERS::toOssimProjection()const
+{
+   ossimString result = "";
+
+   if(theProjection.contains("UTM"))
+   {
+      result = "ossimUtmProjection";
+   }
+   else if(theProjection.contains("GEODETIC"))
+   {
+      result = "ossimEquDistCylProjection";
+   }
+
+   return result;
+}
+
+ossimString ossimERS::toOssimDatum()const
+{
+   ossimString result = "WGE"; // wgs 84 default datum code
+
+   if(theDatum != "WGS84")
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING Datum ossimERS::toOssimDatum: " << theDatum << " is not handled in ossimERS::toOssimDatum()\n"
+                                            << "Please notify us with the datum name so we can add it\n";
+   }
+
+   return result;
+}
+
+//***************************************************************************
+// PRIVATE METHOD: ossimERS::initialize()
+// Initializes all fields to blanks (or 0's) and null terminates strings.
+//***************************************************************************
+void ossimERS::clearFields()
+{
+//   static const char source[] = "";
+
+   theErrorStatus = ossimErrorCodes::OSSIM_OK;
+   theVersion       = 0;
+   theFilename      = "";
+   theDescription   = "";
+   theSensorname    = "";
+   theHeaderOffset = 0;
+   theDatasetType   = "";
+   theDatatype      = "";
+   theByteorder     = "";
+   theComments      = "";
+   theDatum         = "";
+   theProjection    = "";
+   theCoordSysType  = "";
+   theUnits         = "";
+   theRotation      = 0.0;
+   theCelltype      = OSSIM_SCALAR_UNKNOWN;
+   theCellsizeof    = 0;
+   theHasNullCells  = false;
+   theNullCell      = 0;
+   theCellSizeX     = 0;
+   theCellSizeY     = 0;
+   theLine       = 0;
+   theSample     = 0;
+   theOriginX       = 0;
+   theOriginY       = 0;
+   theBands      = 0;
+   theTieUnitType= OSSIM_UNIT_UNKNOWN;
+   theBandID.clear();
+
+   return;
+}
diff --git a/ossim/src/ossim/support_data/ossimEnviHeader.cpp b/src/support_data/ossimEnviHeader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimEnviHeader.cpp
rename to src/support_data/ossimEnviHeader.cpp
diff --git a/src/support_data/ossimEnviInfo.cpp b/src/support_data/ossimEnviInfo.cpp
new file mode 100644
index 0000000..a5030ce
--- /dev/null
+++ b/src/support_data/ossimEnviInfo.cpp
@@ -0,0 +1,78 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ENVI Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimEnviInfo.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+#include <iostream>
+
+ossimEnviInfo::ossimEnviInfo()
+   : ossimInfoBase(),
+     m_file()
+{
+}
+
+ossimEnviInfo::~ossimEnviInfo()
+{
+}
+
+bool ossimEnviInfo::open( const ossimFilename& file )
+{
+   bool result = false;
+
+   m_file = file;
+
+   if ( file.ext().downcase() != "hdr" )
+   {
+      // Typical case, we were fed the image file.  Look for a header file beside image.
+      m_file.setExtension("hdr"); // image.hdr
+      if ( !m_file.exists() )
+      {
+         m_file.setExtension("HDR"); // image.HDR
+         if ( !m_file.exists() )
+         {
+            m_file = file;
+            m_file.string() += ".hdr"; // image.ras.hdr
+         }
+      }
+   }
+
+   if ( m_file.exists() )
+   {
+      if ( ossimEnviHeader::isEnviHeader( m_file ) )
+      {
+         result = true;
+      }
+   }
+
+   if ( !result ) 
+   {
+      m_file.clear();
+   }
+
+   return result;
+}
+
+std::ostream& ossimEnviInfo::print( std::ostream& out ) const
+{
+   if ( m_file.size() )
+   {
+      ossimEnviHeader hdr;
+      if ( hdr.open( m_file ) )
+      {
+         hdr.getMap().addPrefixToAll( ossimString( "envi." ) );
+         out << hdr.getMap() << std::endl;
+      }
+   }
+   return out; 
+}
diff --git a/ossim/src/ossim/support_data/ossimFfL5.cpp b/src/support_data/ossimFfL5.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimFfL5.cpp
rename to src/support_data/ossimFfL5.cpp
diff --git a/ossim/src/ossim/support_data/ossimFfL7.cpp b/src/support_data/ossimFfL7.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimFfL7.cpp
rename to src/support_data/ossimFfL7.cpp
diff --git a/src/support_data/ossimFfRevb.cpp b/src/support_data/ossimFfRevb.cpp
new file mode 100644
index 0000000..42dcdf0
--- /dev/null
+++ b/src/support_data/ossimFfRevb.cpp
@@ -0,0 +1,1132 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Ken Melero (kmelero at imagelinks.com)
+//         Orginally written by Dave Burken (dburken at imagelinks.com)
+// Description: This class parses an EOSAT Fast Format rev b header.
+//
+//********************************************************************
+// $Id$
+
+
+#include <ossim/support_data/ossimFfRevb.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <sstream>
+#include <iomanip>
+
+
+// File scope constants for seek positions.
+const int RADIANCE_OFFSET [7] = { 300,
+                                  317,
+                                  334,
+                                  351,
+                                  368,
+                                  385,
+                                  402  };
+
+static const int PROJ_PARAM_OFFSET [15]  = { 594,
+                                      618,
+                                      642,
+                                      666,
+                                      690,
+                                      714,
+                                      738,
+                                      762,
+                                      786,
+                                      810,
+                                      834,
+                                      858,
+                                      882,
+                                      906,
+                                      930 };
+
+
+//***************************************************************************
+// CONSTRUCTOR
+//***************************************************************************
+ossimFfRevb::ossimFfRevb()
+   :
+      the1stLineInVolume(1),
+      theLinesPerVolume(0),
+      theOrientationAngle(0.0),
+      theUsgsProjNumber(0),
+      theUsgsMapZone(0),
+      theSemiMajorAxis(0.0),
+      theSemiMinorAxis(0.0),
+      theGsd(0.0),
+      thePixelsPerLine(0),
+      theLinesPerImage(0),
+      theUlEasting(0.0),
+      theUlNorthing(0.0),
+      theUrEasting(0.0),
+      theUrNorthing(0.0),
+      theLrEasting(0.0),
+      theLrNorthing(0.0),
+      theLlEasting(0.0),
+      theLlNorthing(0.0),
+      theBlockingFactor(0),
+      theRecordSize(0),
+      theSunElevation(0),
+      theSunAzimuth(0),
+      theCenterEasting(0.0),
+      theCenterNorthing(0.0),
+      theCenterSample(0),
+      theCenterLine(0),
+      theOffset(0),
+      theErrorStatus(OSSIM_OK)
+{
+   const char tmpBuff[] = "";
+
+   strcpy(theProductOrderNumber, tmpBuff);
+   strcpy(thePathRowNumber, tmpBuff);
+   strcpy(theAcquisitionDate, tmpBuff);
+   strcpy(theSatNumber, tmpBuff);
+   strcpy(theInstrumentType, tmpBuff);
+   strcpy(theProductType, "MAP ORIENTED");
+   strcpy(theProductSize, tmpBuff);
+   strcpy(theMapSheetName, tmpBuff);
+   strcpy(theProcessingType, "TERRAIN");
+   strcpy(theResampAlgorithm, "NN");
+
+   int i;
+   for (i=0; i<NUMBER_OF_BANDS; i++)
+   {
+      strcpy(theBandRadiance[i], tmpBuff);
+   }
+
+   strcpy(theVolumeNumber, tmpBuff);
+   strcpy(theMapProjName, tmpBuff);
+
+   for (i=0; i<NUMBER_OF_PROJECTION_PARAMETERS; i++)
+   {
+      strcpy(theUsgsProjParam[i], tmpBuff);
+   }
+
+   strcpy(theEllipsoid, tmpBuff);
+   strcpy(theUlLon, tmpBuff);
+   strcpy(theUlLat, tmpBuff);
+   strcpy(theUrLon, tmpBuff);
+   strcpy(theUrLat, tmpBuff);
+   strcpy(theLrLon, tmpBuff);
+   strcpy(theLrLat, tmpBuff);
+   strcpy(theLlLon, tmpBuff);
+   strcpy(theLlLat, tmpBuff);
+   strcpy(theBandsPresentString, "P");
+   strcpy(theCenterLon, tmpBuff);
+   strcpy(theCenterLat, tmpBuff);
+   strcpy(theFormatVersion, "B");
+   
+}
+
+//***************************************************************************
+// CONSTRUCTOR:
+// ossimFfRevb::ossimFfRevb(const char* headerFile)
+//
+// Takes a filename representing an IRS-1C Fast Format rev C header.
+//***************************************************************************
+ossimFfRevb::ossimFfRevb(const char* headerFile)
+   :
+   theErrorStatus(OSSIM_OK)
+{
+   std::shared_ptr<ossim::istream> is = ossim::StreamFactoryRegistry::instance()->
+      createIstream(ossimString(headerFile), std::ios_base::in);
+
+   if (!is)
+   {
+      theErrorStatus = OSSIM_ERROR;
+
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevb::ossimFfRevb(header):"
+                                          << "Cannot open header = " << headerFile << "\n"
+                                          << "Returning from constructor." << std::endl;
+
+      return;
+   }
+
+   loadFromStream( *is );
+}
+
+
+//***************************************************************************
+// PUBLIC METHOD:
+// int ossimFfRevb::path(int sceneNbr) const
+//
+// Convenience method to parse the path from the path/row string.  Returns
+// zero if stream is not opened.  Current loacation field is:
+// path/row/fraction/subscene in ppp/rrrff format.
+//***************************************************************************
+int ossimFfRevb::path() const
+{
+   char tmpBuff[4];
+   int path = 0;
+
+   std::istringstream is(thePathRowNumber);
+
+   if (is)
+   {
+      is.get(tmpBuff, 4);
+      tmpBuff[3] = '\0';
+      path = atoi(tmpBuff);
+   }
+
+   return path;
+}
+
+
+//***************************************************************************
+// PUBLIC METHOD:
+// int ossimFfRevb::row(int sceneNbr) const
+//
+// Convenience method to parse the row from the path/row string.  Returns
+// zero if stream is not opened.  Current loacation field is:
+// path/row/fraction/subscene in ppp/rrrff format.
+//***************************************************************************
+int ossimFfRevb::row() const
+{
+   char tmpBuff[4];
+   int row = 0;
+
+   std::istringstream is(thePathRowNumber);
+
+   if (is)
+   {
+      is.seekg(4, std::ios_base::beg);
+      is.get(tmpBuff, 4);
+      tmpBuff[3] = '\0';
+      row = atoi(tmpBuff);
+   }
+
+   return row;
+}
+
+
+//***************************************************************************
+// PUBLIC METHOD:
+// int ossimFfRevb::fraction(int sceneNbr) const
+//
+// Convenience method to parse the fraction from the path/row string.  Returns
+// zero if stream is not opened.  Current loacation field is:
+// path/row/fraction/subscene in ppp/rrrff format.
+//***************************************************************************
+int ossimFfRevb::fraction() const
+{
+   char tmpBuff[3];
+   int fraction = 0;
+
+   std::istringstream is(thePathRowNumber);
+
+   if (is)
+   {
+      is.seekg(7, std::ios_base::beg);
+      is.get(tmpBuff, 3);
+      tmpBuff[2] = '\0';
+      fraction = atoi(tmpBuff);
+   }
+
+   return fraction;
+}
+
+//***************************************************************************
+// PUBLIC METHOD:
+// double ossimFfRevb::projParam(int paramNumber) const
+//
+// Returns the projection parameter as a double from the string taken from
+// the header.  There are fifteen parameters so the possible range for
+// paramNumber is 0 to 14.
+//***************************************************************************
+double ossimFfRevb::projParam(int paramNumber) const
+{
+   if (paramNumber >= NUMBER_OF_PROJECTION_PARAMETERS)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevb::projParam: "
+                                          << "Parameter out of range:  " << paramNumber
+                                          << "\nValid range:  0 - 14" << std::endl;
+      return 0.0;
+   }
+
+   //***
+   // The USGS Projection Parameters in a rev b header have a "D" to
+   // denote the exponent.  This simply substitutes the "D" with an
+   // "E" so that atof works properly.
+   //***
+   ossimString tmp = theUsgsProjParam[paramNumber];
+   tmp.gsub("D", "E");
+
+   return atof(tmp.chars());
+}
+
+//***************************************************************************
+// PUBLIC METHOD:
+// void ossimFfRevb::print(ostream& os) const
+//
+// Prints data members.
+//***************************************************************************
+void ossimFfRevb::print(std::ostream& os) const
+{
+   os << std::setiosflags(std::ios_base::left | std::ios_base::fixed)
+      << std::setw(30) << "\nimage_id:" 
+      << theProductOrderNumber
+      << std::setw(30) << "\npath_row_number:"
+      << thePathRowNumber
+      << std::setw(30) << "\nacquisition_date:"
+      << theAcquisitionDate
+      << std::setw(30) << "\nsatellite_name:"
+      << theSatNumber
+      << std::setw(30) << "\nsensor_name:"
+      << theInstrumentType
+      << std::setw(30) << "\nproduct_type:" 
+      << theProductType
+      << std::setw(30) << "\nproduct_size:" 
+      << theProductSize
+      << std::setw(30) << "\nprocessing_type:" 
+      << theProcessingType 
+      << std::setw(30) << "\nresamp_algorithm:" 
+      << theResampAlgorithm;
+
+   int i;
+   for (i=0; i<NUMBER_OF_BANDS; i++)
+   {
+      os << "\nband" << i+1 << std::setw(25) << "_radiance:"
+         << theBandRadiance[i];
+   }
+
+   os << std::setw(30) << "\ntape_volume_number:" 
+      << theVolumeNumber
+      << std::setw(30) << "\nfirst_line_in_volume:" 
+      << the1stLineInVolume
+      << std::setw(30) << "\nlines_per_volume:" 
+      << theLinesPerVolume
+      << std::setw(30) << "\norientation_angle:" 
+      << std::setprecision(2) << theOrientationAngle
+      << std::setw(30) << "\nprojection_type:" 
+      << theMapProjName
+      << std::setw(30) << "\nusgs_projection_number:" 
+      << theUsgsProjNumber
+      << std::setw(30) << "\nmap_zone:" 
+      << theUsgsMapZone;
+
+//    os << std::setprecision(15);
+   os << std::setiosflags(std::ios_base::right);
+   for (i=0; i<NUMBER_OF_PROJECTION_PARAMETERS; i++)
+   {
+      os << "\nprojection_parameter_" << i+1 << std::setw(10) << ":"
+         << std::setw(24) << theUsgsProjParam[i];
+   }
+   os << std::resetiosflags(std::ios_base::right);
+   
+
+   os << std::setw(30) << "\nellipsoid:" 
+      << theEllipsoid
+      << std::setw(30) << "\nsemi_major_axis:"
+      << std::setprecision(3) << std::setw(11) << theSemiMajorAxis
+      << std::setw(30) << "\nsemi_minor_axis:"
+      << std::setw(11) << theSemiMinorAxis
+      << std::setw(30) << "\ngsd:" 
+      << std::setprecision(2) << std::setw(5) << theGsd      
+      << std::setw(30) << "\nnumber_samples:"
+      << thePixelsPerLine
+      << std::setw(30) << "\nnumber_lines:" 
+      << theLinesPerImage
+      << std::setprecision(3)
+      << std::setw(30) << "\nul_longitude:" 
+      << theUlLon
+      << std::setw(30) << "\nul_latitude:" 
+      << theUlLat
+      << std::setw(30) << "\nul_easting:" 
+      << std::setw(13) << theUlEasting
+      << std::setw(30) << "\nul_northing:" 
+      << std::setw(13) << theUlNorthing   
+      << std::setw(30) << "\nur_longitude:" 
+      << theUrLon
+      << std::setw(30) << "\nur_latitude:" 
+      << theUrLat
+      << std::setw(30) << "\nur_easting:" 
+      << std::setw(13) << theUrEasting
+      << std::setw(30) << "\nur_northing:" 
+      << std::setw(13) << theUrNorthing
+      << std::setw(30) << "\nlr_longitude:" 
+      << theLrLon
+      << std::setw(30) << "\nlr_latitude:" 
+      << theLrLat
+      << std::setw(30) << "\nlr_easting:" 
+      << std::setw(13) << theLrEasting
+      << std::setw(30) << "\nlr_northing:" 
+      << std::setw(13) << theLrNorthing
+      << std::setw(30) << "\nll_longitude:" 
+      << theLlLon
+      << std::setw(30) << "\nll_latitude:" 
+      << theLlLat
+      << std::setw(30) << "\nll_easting:" 
+      << std::setw(13) << theLlEasting
+      << std::setw(30) << "\nll_northing:" 
+      << std::setw(13) << theLlNorthing      
+      << std::setw(30) << "\nbands_present_string:" 
+      << theBandsPresentString
+      << std::setw(30) << "\ntape_blocking_factor:" 
+      << theBlockingFactor
+      << std::setw(30) << "\nrecord_size:" 
+      << theRecordSize
+      << std::setw(30) << "\nillum_elevation:" 
+      << theSunElevation
+      << std::setw(30) << "\nillum_azimuth:"
+      << theSunAzimuth
+      << std::setw(30) << "\ncenter_longitude:" 
+      << theCenterLon
+      << std::setw(30) << "\ncenter_latitude:" 
+      << theCenterLat
+      << std::setw(30) << "\ncenter_easting:" 
+      << std::setw(13) << theCenterEasting
+      << std::setw(30) << "\ncenter_northing:" 
+      << std::setw(13) << theCenterNorthing
+      << std::setw(30) << "\ncenter_sample:" 
+      << theCenterSample
+      << std::setw(30) << "\ncenter_line:" 
+      << theCenterLine
+      << std::setw(30) << "\nhorizontal_offset:" 
+      << theOffset
+      << std::setw(30) << "\nformat_version:" 
+      << theFormatVersion
+      << std::endl;
+
+}
+
+//***************************************************************************
+// PUBLIC METHOD:
+// void ossimFfRevb::write(ostream& os) const
+//
+// Writes an EOSAT Fast Format Rev B formatted header.
+//***************************************************************************
+void ossimFfRevb::write(ossim::ostream& os) const
+{
+   const char PRODUCT_ID_DESC [PRODUCT_ORDER_NUMBER_DESC_SIZE + 1]
+      = "PRODUCT =";
+
+   const char WRS_DESC [WRS_DESC_SIZE + 1]
+      = " WRS =";
+
+   const char DATE_DESC [DATE_DESC_SIZE + 1]
+      = " ACQUISITION DATE =";
+   
+   const char SATELLITE_NUMBER_DESC [SAT_NUMBER_DESC_SIZE + 1]
+      = " SATELLITE =";
+   
+   const char INSTRUMENT_TYPE_DESC [INSTRUMENT_TYPE_DESC_SIZE + 1]
+      = " INSTRUMENT =";
+   
+   const char PRODUCT_TYPE_DESC [PRODUCT_TYPE_DESC_SIZE + 1]
+      = " PRODUCT TYPE =";
+   
+   const char PRODUCT_SIZE_DESC [PRODUCT_SIZE_DESC_SIZE + 1]
+      = " PRODUCT SIZE =";
+   
+   const char PROCESSING_TYPE_DESC [PROCESSING_TYPE_DESC_SIZE + 1]
+      = " TYPE OF GEODETIC PROCESSING =";
+   
+   const char RESAMPLING_ALGO_DESC [RESAMPLING_ALGO_DESC_SIZE + 1]
+      = " RESAMPLING =";
+   
+   const char RADIANCE_DESC [RADIANCE_DESC_SIZE + 1]
+      = " RAD GAINS/BIASES = ";
+
+   const char VOLUME_NUMBER_DESC [VOLUME_NUMBER_DESC_SIZE + 1]
+      = " TAPE SPANNING FLAG=";
+   
+   const char  FIRST_LINE_DESC [FIRST_LINE_DESC_SIZE + 1]
+      = " START LINE #=";
+
+   const char LINES_PER_VOLUME_DESC [LINES_PER_VOLUME_DESC_SIZE + 1]
+      = " LINES PER VOL=";
+
+   const char ORIENTATION_ANGLE_DESC [ORIENTATION_ANGLE_DESC_SIZE + 1]
+      = " ORIENTATION =";
+
+   const char MAP_PROJ_NAME_DESC [MAP_PROJ_NAME_DESC_SIZE + 1]
+      = " PROJECTION =";
+ 
+   const char USGS_PROJ_NUMBER_DESC [USGS_PROJ_NUMBER_DESC_SIZE + 1]
+      = " USGS PROJECTION # =";
+ 
+   const char USGS_MAP_ZONE_DESC [USGS_MAP_ZONE_DESC_SIZE + 1]
+      = " USGS MAP ZONE =";
+ 
+   const char PROJECTION_PARAMETER_DESC [USGS_PROJ_PARAMS_DESC_SIZE + 1]
+      = " USGS PROJECTION PARAMETERS =";
+
+   const char ELLIPSOID_DESC [ELLIPSOID_DESC_SIZE + 1]
+      = " EARTH ELLIPSOID =";
+      
+   const char MAJOR_AXIS_DESC [MAJOR_AXIS_DESC_SIZE+ 1]
+      = " SEMI-MAJOR AXIS =";
+      
+   const char MINOR_AXIS_DESC [MINOR_AXIS_DESC_SIZE+ 1]
+      = " SEMI-MINOR AXIS =";
+      
+   const char PIXEL_GSD_DESC [PIXEL_GSD_DESC_SIZE + 1]
+      = " PIXEL SIZE =";
+   
+   const char PIXELS_PER_LINE_DESC [PIXELS_PER_LINE_DESC_SIZE + 1]
+      = " PIXELS PER LINE=";
+   
+   const char LINES_PER_IMAGE_DESC [LINES_PER_IMAGE_DESC_SIZE + 1]
+      = " LINES PER IMAGE=";
+
+   const char UL_DESC [CORNER_DESC_SIZE + 1]
+      = " UL ";
+
+   const char UR_DESC [CORNER_DESC_SIZE + 1]
+      = " UR ";
+   
+   const char LR_DESC [CORNER_DESC_SIZE + 1]
+      = " LR ";
+   
+   const char LL_DESC [CORNER_DESC_SIZE + 1]
+      = " LL ";
+   
+   const char BANDS_PRESENT_DESC [BANDS_PRESENT_DESC_SIZE + 1]
+      = " BANDS PRESENT =";
+   
+   const char BLOCKING_FACTOR_DESC [BLOCKING_FACTOR_DESC_SIZE + 1]
+      = " BLOCKING FACTOR =";
+   
+   const char RECORD_LENGTH_DESC [RECORD_LENGTH_DESC_SIZE + 1]
+      = " RECORD LENGTH =";
+   
+   const char SUN_ELEVATION_DESC [SUN_ELEVATION_DESC_SIZE + 1]
+      = " SUN ELEVATION =";
+   
+   const char SUN_AZIMUTH_DESC [SUN_AZIMUTH_DESC_SIZE + 1]
+      = " SUN AZIMUTH =";
+
+   const char CENTER_DESC [CENTER_DESC_SIZE + 1]
+      = " CENTER ";
+   
+   const char OFFSET_DESC [OFFSET_DESC_SIZE + 1]
+      = " OFFSET=";
+   
+   const char REV_DESC [REV_DESC_SIZE + 1]
+      = " REV";
+      
+   const char SPACE[] = " ";
+
+   //***
+   // Start at beginning of the stream.
+   //***
+   os.seekp(0, std::ios_base::beg);
+   os << std::setiosflags(std::ios_base::fixed)  // Disable scientific mode.
+      << std::setiosflags(std::ios_base::left)
+       
+      << PRODUCT_ID_DESC
+      << std::setw(PRODUCT_ORDER_NUMBER_SIZE)
+      << theProductOrderNumber
+
+      << WRS_DESC         
+      << std::setw(PATH_ROW_NUMBER_SIZE) 
+      << thePathRowNumber
+
+      << DATE_DESC
+      << std::setw(DATE_SIZE) 
+      << theAcquisitionDate
+
+      << SATELLITE_NUMBER_DESC
+      << std::setw(SAT_NUMBER_SIZE) 
+      << theSatNumber 
+
+      << INSTRUMENT_TYPE_DESC
+      << std::setw(INSTRUMENT_TYPE_SIZE) 
+      << theInstrumentType
+
+      << PRODUCT_TYPE_DESC
+      << std::setw(PRODUCT_TYPE_SIZE) 
+      << theProductType
+
+      << PRODUCT_SIZE_DESC
+      << std::setw(PRODUCT_SIZE_SIZE) 
+      << theProductSize
+
+      << std::setw(MAP_SHEET_SIZE)
+      << theMapSheetName
+
+      << PROCESSING_TYPE_DESC
+      << std::setw(PROCESSING_TYPE_SIZE) 
+      << theProcessingType
+
+      << RESAMPLING_ALGO_DESC
+      << std::setw(RESAMPLING_ALGO_SIZE) 
+      << theResampAlgorithm
+
+      << RADIANCE_DESC;
+
+   int i;
+   for (i=0; i<NUMBER_OF_BANDS-1; i++) // Output six of the seven bands.
+   {
+      os << std::setw(RADIANCE_SIZE) << theBandRadiance[i] << SPACE;
+   }
+
+   os << std::setw(RADIANCE_SIZE) << theBandRadiance[6] // Last one no space.
+
+      << VOLUME_NUMBER_DESC
+      << std::setw(VOLUME_NUMBER_SIZE) 
+      << theVolumeNumber
+
+      << std::resetiosflags(std::ios_base::left)
+      << std::setiosflags(std::ios_base::right)
+
+      << FIRST_LINE_DESC
+      << std::setw(FIRST_LINE_IN_VOLUME_SIZE) 
+      << the1stLineInVolume
+
+      << LINES_PER_VOLUME_DESC 
+      << std::setw(LINES_PER_VOLUME_SIZE) 
+      << theLinesPerVolume 
+
+      << ORIENTATION_ANGLE_DESC 
+      << std::setprecision(2) << std::setw(ORIENTATION_ANGLE_SIZE) 
+      << theOrientationAngle  
+
+      << MAP_PROJ_NAME_DESC
+      << std::setw(MAP_PROJ_NAME_SIZE) 
+      << theMapProjName
+
+      << USGS_PROJ_NUMBER_DESC 
+      << std::setw(USGS_PROJ_NUMBER_SIZE) 
+      << theUsgsProjNumber 
+
+      << USGS_MAP_ZONE_DESC 
+      << std::setw(USGS_MAP_ZONE_SIZE) 
+      << theUsgsMapZone 
+
+      << PROJECTION_PARAMETER_DESC;
+
+   for (i=0; i<NUMBER_OF_PROJECTION_PARAMETERS; i++)
+   {
+      os << std::setw(USGS_PROJ_PARAMS_SIZE)
+         << theUsgsProjParam[i];
+   }
+
+   
+   os << std::setiosflags(std::ios_base::left)
+
+      << ELLIPSOID_DESC
+      << std::setw(ELLIPSOID_SIZE)
+      << theEllipsoid
+      << std::resetiosflags(std::ios_base::left)
+      << std::setprecision(3)
+
+      << std::setiosflags(std::ios_base::right)
+
+      << MAJOR_AXIS_DESC
+      << std::setw(MAJOR_AXIS_SIZE) 
+      << theSemiMajorAxis 
+
+      << MINOR_AXIS_DESC
+      << std::setw(MINOR_AXIS_SIZE) 
+      << theSemiMinorAxis
+
+      << std::setprecision(2)
+
+      << PIXEL_GSD_DESC
+      << std::setw(PIXEL_GSD_SIZE) 
+      << theGsd
+      
+      << PIXELS_PER_LINE_DESC
+      << std::setw(PIXELS_PER_LINE_SIZE) 
+      << thePixelsPerLine
+ 
+      << LINES_PER_IMAGE_DESC
+      << std::setw(LINES_PER_IMAGE_SIZE) 
+      << theLinesPerImage
+
+      << std::setprecision(3)
+
+      << UL_DESC
+      << std::setw(LON_SIZE)
+      << theUlLon
+      << SPACE
+      << std::setw(LAT_SIZE)
+      << theUlLat
+      << SPACE
+      << std::setw(EASTING_SIZE)
+      << theUlEasting
+      << SPACE
+      << std::setw(NORTHING_SIZE) 
+      << theUlNorthing
+
+      << UR_DESC
+      << std::setw(LON_SIZE)
+      << theUrLon
+      << SPACE
+      << std::setw(LAT_SIZE)
+      << theUrLat
+      << SPACE
+      << std::setw(EASTING_SIZE)
+      << theUrEasting
+      << SPACE
+      << std::setw(NORTHING_SIZE) 
+      << theUrNorthing
+
+      << LR_DESC
+      << std::setw(LON_SIZE)
+      << theLrLon
+      << SPACE
+      << std::setw(LAT_SIZE)
+      << theLrLat
+      << SPACE
+      << std::setw(EASTING_SIZE)
+      << theLrEasting
+      << SPACE
+      << std::setw(NORTHING_SIZE) 
+      << theLrNorthing
+
+      << LL_DESC
+      << std::setw(LON_SIZE)
+      << theLlLon
+      << SPACE
+      << std::setw(LAT_SIZE)
+      << theLlLat
+      << SPACE
+      << std::setw(EASTING_SIZE)
+      << theLlEasting
+      << SPACE
+      << std::setw(NORTHING_SIZE) 
+      << theLlNorthing
+
+      << std::resetiosflags(std::ios_base::right);
+
+   os << BANDS_PRESENT_DESC
+      << std::setw(BANDS_PRESENT_SIZE) 
+      << theBandsPresentString
+
+      << BLOCKING_FACTOR_DESC
+      << std::setw(BLOCKING_FACTOR_SIZE) 
+      << theBlockingFactor
+
+      << RECORD_LENGTH_DESC
+      << std::setw(RECORD_LENGTH_SIZE) 
+      << theRecordSize
+         
+      << SUN_ELEVATION_DESC
+      << std::setw(SUN_ELEVATION_SIZE) 
+      << theSunElevation
+         
+      << SUN_AZIMUTH_DESC
+      << std::setw(SUN_AZIMUTH_SIZE) 
+      << theSunAzimuth
+         
+      << CENTER_DESC 
+      << std::setw(LON_SIZE) 
+      << theCenterLon 
+      << SPACE
+      << std::setw(LAT_SIZE)
+      << theCenterLat
+      << SPACE
+      << std::setiosflags(std::ios_base::right)
+      << std::setw(EASTING_SIZE)
+      << theCenterEasting
+      << SPACE
+      << std::setw(NORTHING_SIZE)
+      << theCenterNorthing
+      << std::setw(CENTER_SAMPLE_SIZE)
+      << theCenterSample
+      << std::setw(CENTER_LINE_SIZE)
+      << theCenterLine
+
+      << OFFSET_DESC
+      << std::setw(OFFSET_SIZE)
+      << theOffset
+
+      << REV_DESC
+      << std::setw(FORMAT_VERSION_SIZE)
+      << theFormatVersion << std::flush;  // Byte count of file should be 1536.
+
+}
+
+
+//***************************************************************************
+// PRIVATE METHOD:
+// ossimFfRevb::loadFromStream(istream& is)
+// Initializes data members from an EOSAT Fast Format Rev B header.
+//***************************************************************************
+void ossimFfRevb::loadFromStream(ossim::istream& is)
+{
+   if (!is)
+   {
+      theErrorStatus = OSSIM_ERROR;
+
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevb::loadFromStream:\n"
+                                          << "Null stream passed in.  Returning from method."
+                                          << std::endl;
+      return;
+   }
+
+   //***
+   // See .h for enumerations for field sizes and offsets. 
+   //***
+
+   //***
+   // NOTE:  Because of header inconsistencies all seeks will be relative to
+   //        the beginning of the stream.
+   //***
+
+   //***
+   // Temporary buffer for fields that need to be converted to integers or
+   // floats.
+   //***
+   char tmpBuff[25];
+
+   int i; // For iterations.
+
+   is.seekg(PRODUCT_ORDER_NUMBER_OFFSET, std::ios_base::beg);
+   is.get(theProductOrderNumber, 
+          PRODUCT_ORDER_NUMBER_SIZE + 1,
+          ' ');
+   if (checkStream(is)) return;
+ 
+   is.seekg(PATH_ROW_NUMBER_OFFSET, std::ios_base::beg);
+   is.get(thePathRowNumber, PATH_ROW_NUMBER_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(DATE_OFFSET, std::ios_base::beg);
+   is.get(theAcquisitionDate, DATE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(SAT_NUMBER_OFFSET, std::ios_base::beg);
+   is.get(theSatNumber, SAT_NUMBER_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(INSTRUMENT_TYPE_OFFSET, std::ios_base::beg);
+   is.get(theInstrumentType, INSTRUMENT_TYPE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(PRODUCT_TYPE_OFFSET, std::ios_base::beg);
+   is.get(theProductType, PRODUCT_TYPE_SIZE+ 1);
+   if (checkStream(is)) return;
+
+   is.seekg(PRODUCT_SIZE_OFFSET, std::ios_base::beg);
+   is.get(theProductSize, PRODUCT_SIZE_SIZE+ 1);
+   if (checkStream(is)) return;
+
+   is.seekg(MAP_SHEET_NAME_OFFSET, std::ios_base::beg);
+   is.get(theMapSheetName, MAP_SHEET_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(PROCESSING_TYPE_OFFSET, std::ios_base::beg);
+   is.get(theProcessingType, PROCESSING_TYPE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(RESAMPLING_ALGO_OFFSET, std::ios_base::beg);
+   is.get(theResampAlgorithm, RESAMPLING_ALGO_SIZE + 1);
+   if (checkStream(is)) return;
+
+   for (i=0; i<NUMBER_OF_BANDS; i++)
+   {      
+      is.seekg(RADIANCE_OFFSET[i], std::ios_base::beg);
+      is.get(theBandRadiance[i], RADIANCE_SIZE + 1);
+      if (checkStream(is)) return;
+   }
+
+   is.seekg(VOLUME_NUMBER_OFFSET, std::ios_base::beg);
+   is.get(theVolumeNumber, VOLUME_NUMBER_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(FIRST_LINE_IN_VOLUME_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, FIRST_LINE_IN_VOLUME_SIZE + 1);
+   if (checkStream(is)) return;
+
+   the1stLineInVolume = atoi(tmpBuff);
+
+   is.seekg(LINES_PER_VOLUME_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, LINES_PER_VOLUME_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theLinesPerVolume = atoi(tmpBuff);
+   
+   is.seekg(ORIENTATION_ANGLE_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, ORIENTATION_ANGLE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theOrientationAngle = atof(tmpBuff);
+
+   is.seekg(MAP_PROJ_NAME_OFFSET, std::ios_base::beg);
+   is.get(theMapProjName, MAP_PROJ_NAME_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(USGS_PROJ_NUMBER_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, USGS_PROJ_NUMBER_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theUsgsProjNumber = atoi(tmpBuff);
+
+   is.seekg(USGS_MAP_ZONE_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, USGS_MAP_ZONE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theUsgsMapZone = atoi(tmpBuff);
+
+   //***
+   // Get the fifteen projection parameters.
+   //***
+   for (i=0; i < NUMBER_OF_PROJECTION_PARAMETERS; i++)
+   {
+      is.seekg(PROJ_PARAM_OFFSET[i], std::ios_base::beg);
+      is.get(theUsgsProjParam[i], USGS_PROJ_PARAMS_SIZE + 1);
+      if (checkStream(is)) return;
+   }
+   
+   is.seekg(ELLIPSOID_OFFSET, std::ios_base::beg);
+   is.get(theEllipsoid, ELLIPSOID_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(MAJOR_AXIS_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff,  MAJOR_AXIS_SIZE+ 1);
+   if (checkStream(is)) return;
+
+   theSemiMajorAxis = atof(tmpBuff);
+   
+   is.seekg(MINOR_AXIS_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff,  MINOR_AXIS_SIZE+ 1);
+   if (checkStream(is)) return;
+
+   theSemiMinorAxis = atof(tmpBuff);
+
+   is.seekg(PIXEL_GSD_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, PIXEL_GSD_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theGsd = atof(tmpBuff);
+   
+   is.seekg(PIXELS_PER_LINE_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, PIXELS_PER_LINE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   thePixelsPerLine = atoi(tmpBuff);
+
+   is.seekg(LINES_PER_IMAGE_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, LINES_PER_IMAGE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theLinesPerImage = atoi(tmpBuff);
+
+   //***
+   // Start of upper left data:  longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(UL_LON_OFFSET, std::ios_base::beg);
+   is.get(theUlLon, LON_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(UL_LAT_OFFSET, std::ios_base::beg);
+   is.get(theUlLat, LAT_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(UL_EASTING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, EASTING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theUlEasting = atof(tmpBuff);
+
+   is.seekg(UL_NORTHING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theUlNorthing = atof(tmpBuff);
+
+   //***
+   // End of upper left data.
+   //***
+
+   //***
+   // Start of upper right data: longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(UR_LON_OFFSET, std::ios_base::beg);
+   is.get(theUrLon, LON_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(UR_LAT_OFFSET, std::ios_base::beg);
+   is.get(theUrLat, LAT_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(UR_EASTING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, EASTING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theUrEasting = atof(tmpBuff);
+
+   is.seekg(UR_NORTHING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theUrNorthing = atof(tmpBuff);
+   
+   //***
+   // End of upper right data.
+   //***
+
+   //***
+   // Start of lower right data: longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(LR_LON_OFFSET, std::ios_base::beg);
+   is.get(theLrLon, LON_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(LR_LAT_OFFSET, std::ios_base::beg);
+   is.get(theLrLat, LAT_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(LR_EASTING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, EASTING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theLrEasting = atof(tmpBuff);
+
+   is.seekg(LR_NORTHING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theLrNorthing = atof(tmpBuff);
+
+   //***
+   // End of lower right data.
+   //***
+
+   //***
+   // Start of lower left data:  longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(LL_LON_OFFSET, std::ios_base::beg);
+   is.get(theLlLon, LON_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(LL_LAT_OFFSET, std::ios_base::beg);
+   is.get(theLlLat, LAT_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(LL_EASTING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, EASTING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theLlEasting = atof(tmpBuff);
+
+   is.seekg(LL_NORTHING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theLlNorthing = atof(tmpBuff);
+
+   //***
+   // End of lower left data.
+   //***
+
+   is.seekg(BANDS_PRESENT_OFFSET, std::ios_base::beg);
+   is.get(theBandsPresentString, BANDS_PRESENT_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(BLOCKING_FACTOR_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, BLOCKING_FACTOR_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theBlockingFactor = atoi(tmpBuff);
+
+   is.seekg(RECORD_LENGTH_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, RECORD_LENGTH_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theRecordSize = atoi(tmpBuff);
+
+   is.seekg(SUN_ELEVATION_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, SUN_ELEVATION_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theSunElevation = atoi(tmpBuff);
+
+   is.seekg(SUN_AZIMUTH_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, SUN_AZIMUTH_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theSunAzimuth = atoi(tmpBuff);
+
+   //***
+   // Start of scene center data:  longitude, latitude, easting, northing,
+   // sample, line. 
+   //***
+   is.seekg(CENTER_LON_OFFSET, std::ios_base::beg);
+   is.get(theCenterLon, LON_SIZE + 1);
+   if (checkStream(is)) return;
+
+   is.seekg(CENTER_LAT_OFFSET, std::ios_base::beg);
+   is.get(theCenterLat, LAT_SIZE + 1);
+   if (checkStream(is)) return;
+   
+   is.seekg(CENTER_EASTING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, EASTING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theCenterEasting = atof(tmpBuff);
+
+   is.seekg(CENTER_NORTHING_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theCenterNorthing = atof(tmpBuff);
+
+   is.seekg(CENTER_SAMPLE_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, CENTER_SAMPLE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theCenterSample = atoi(tmpBuff);
+
+   is.seekg(CENTER_LINE_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, CENTER_LINE_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theCenterLine = atoi(tmpBuff);
+
+   //***
+   // End of scene center data.
+   //***
+
+   is.seekg(OFFSET_OFFSET, std::ios_base::beg);
+   is.get(tmpBuff, OFFSET_SIZE + 1);
+   if (checkStream(is)) return;
+
+   theOffset = atoi(tmpBuff);
+
+   is.seekg(FORMAT_VERSION_OFFSET, std::ios_base::beg);
+   is.get(theFormatVersion, FORMAT_VERSION_SIZE + 1);
+   if (checkStream(is)) return;
+
+}
+
+//***************************************************************************
+// PRIVATE METHOD:
+// ossimFfRevb::checkStream(istream& is)
+//
+// Checks the stream.  If an error has occurred it sets theErrorStatus.
+// Returns: theErrorStatus    ( 0 = OK,  1 = ERROR )
+//***************************************************************************
+int ossimFfRevb::checkStream(ossim::istream& is)
+{
+   //***
+   // istreams set fault bits and the operator! is overloaded to return
+   // true if an error has occurred.
+   //***
+   if (!is)
+   {
+      theErrorStatus = OSSIM_ERROR;
+      ossimNotify(ossimNotifyLevel_FATAL) << "ossimFfRevb::checkStream ERROR: "
+                                          << "Stream corrupted.   Returning from method."
+                                          << std::endl;
+   } 
+   return theErrorStatus;
+}
+   
+//***************************************************************************
+// Function:
+// ostream& operator<<(ostream& os, const ossimFfRevb& head)
+//***************************************************************************
+std::ostream& operator<<(std::ostream& os, const ossimFfRevb& head)
+{
+   head.print(os);
+
+   return os;
+}
diff --git a/src/support_data/ossimFfRevc.cpp b/src/support_data/ossimFfRevc.cpp
new file mode 100644
index 0000000..85ee00d
--- /dev/null
+++ b/src/support_data/ossimFfRevc.cpp
@@ -0,0 +1,1653 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Ken Melero (kmelero at imagelinks.com)
+//         Orginally written by Dave Burken (dburken at imagelinks.com)
+// Description: This class parses an EOSAT Fast Format rev c header.
+//
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimFfRevc.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimString.h>
+#include <sstream>
+#include <iomanip>
+
+const int LOCATION_OFFSET [4] = { 23,
+                                  183,
+                                  343,
+                                  503 };
+
+const int PATH_ROW_NUMBER_OFFSET [4] = { 34,
+                                         194,
+                                         354,
+                                         514 };
+
+const int DATE_OFFSET [4] = { 70,
+                              230,
+                              390,
+                              550 };
+
+const int SAT_NAME_OFFSET [4] = { 91,
+                                  251,
+                                  411,
+                                  571 };
+
+const int SENSOR_NAME_OFFSET [4] = { 110,
+                                     270,
+                                     430,
+                                     590 };
+
+const int SENSOR_MODE_OFFSET [4] = { 134,
+                                     294,
+                                     454,
+                                     614 };
+
+const int OFF_NADIR_ANGLE_OFFSET [4] = { 153, 
+                                         313,
+                                         473,
+                                         633 };
+
+
+const int BIAS_OFFSET [8] = { 1616,
+                              1696,
+                              1776,
+                              1856,
+                              1936,
+                              2016,
+                              2096,
+                              2176  };
+
+const int GAIN_OFFSET [8] = { 1641,
+                              1721,
+                              1801,
+                              1881,
+                              1961,
+                              2041,
+                              2121,
+                              2201  };
+
+static const int PROJ_PARAM_OFFSET [15]  = { 3181,
+                                      3206,
+                                      3232,
+                                      3257,
+                                      3282,
+                                      3312,
+                                      3337,
+                                      3362,
+                                      3392,
+                                      3417,
+                                      3442,
+                                      3472,
+                                      3497,
+                                      3522,
+                                      3552  };
+
+static const char BLANK_STRING[] = " ";
+
+//***************************************************************************
+// CONSTRUCTOR
+//***************************************************************************
+ossimFfRevc::ossimFfRevc()
+   :
+      theAdminRecord(),
+      theRadiomRecord(),
+      theGeoRecord(),
+      theErrorStatus(OSSIM_OK)
+{ }
+
+//***************************************************************************
+// CONSTRUCTOR:
+// ossimFfRevc::ossimFfRevc(const char* headerFile)
+//
+// Takes a filename representing an IRS-1C Fast Format rev C header.
+//***************************************************************************
+ossimFfRevc::ossimFfRevc(const char* headerFile)
+   :
+   theErrorStatus(OSSIM_OK)
+{
+   std::shared_ptr<ossim::istream> is = ossim::StreamFactoryRegistry::instance()->
+      createIstream(ossimString(headerFile), std::ios_base::in);
+
+   if (!is)
+   {
+      theErrorStatus = OSSIM_ERROR;
+
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevc::ossimFfRevc(header): "
+                                          << "Cannot open:  " << headerFile << "\n"
+                                          << "Returning from constructor." << std::endl;
+
+      return;
+   }
+
+   loadFromStream( *is );
+}
+
+
+//***************************************************************************
+// PUBLIC METHOD:
+// int ossimFfRevc::path(int sceneNbr) const
+//
+// Convenience method to parse the path from the path/row string.  Returns
+// zero if stream is not opened.  Current loacation field is:
+// path/row/fraction/subscene in ppp/rrrffss format.
+//***************************************************************************
+int ossimFfRevc::path(int sceneNbr) const
+{
+   char tmpBuff[4];
+   int path = 0;
+
+   std::istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
+
+   if (is)
+   {
+      is.get(tmpBuff, 4);
+      path = atoi(tmpBuff);
+   }
+
+   return path;
+}
+
+
+//***************************************************************************
+// PUBLIC METHOD:
+// int ossimFfRevc::row(int sceneNbr) const
+//
+// Convenience method to parse the row from the path/row string.  Returns
+// zero if stream is not opened.  Current loacation field is:
+// path/row/fraction/subscene in ppp/rrrffss format.
+//***************************************************************************
+int ossimFfRevc::row(int sceneNbr) const
+{
+   char tmpBuff[4];
+   int row = 0;
+
+   std::istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
+
+   if (is)
+   {
+      is.seekg(4, std::ios_base::beg);
+      is.get(tmpBuff, 4);
+      row = atoi(tmpBuff);
+   }
+
+   return row;
+}
+
+
+//***************************************************************************
+// PUBLIC METHOD:
+// int ossimFfRevc::fraction(int sceneNbr) const
+//
+// Convenience method to parse the fraction from the path/row string.  Returns
+// zero if stream is not opened.  Current loacation field is:
+// path/row/fraction/subscene in ppp/rrrffss format.
+//***************************************************************************
+int ossimFfRevc::fraction(int sceneNbr) const
+{
+   char tmpBuff[3];
+   int fraction = 0;
+
+   std::istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
+
+   if (is)
+   {
+      is.seekg(7, std::ios_base::beg);
+      is.get(tmpBuff, 3);
+      fraction = atoi(tmpBuff);
+   }
+
+   return fraction;
+}
+
+
+//***************************************************************************
+// PUBLIC METHOD:
+// int ossimFfRevc::subScene(int sceneNbr) const
+//
+// Convenience method to parse the subScene from the path/row string.  Returns
+// zero if stream is not opened.  Current loacation field is:
+// path/row/fraction/subscene in ppp/rrrffss format.
+//***************************************************************************
+ossimString ossimFfRevc::subScene(int sceneNbr) const
+{
+   char   tmpBuff[3];
+   ossimString subScene;
+
+   std::istringstream is(theAdminRecord.thePathRowNumber[sceneNbr]);
+
+   if (is)
+   {
+      is.seekg(9, std::ios_base::beg);
+      is.get(tmpBuff, 3);
+      subScene = tmpBuff;
+   }
+
+   return subScene;
+}
+
+//***************************************************************************
+// ossimFfRevc::pathRow(int sceneNbr)
+//***************************************************************************
+ossimString ossimFfRevc::pathRow(int sceneNbr) const
+{
+   ossimString tmp = "p";
+
+   tmp += theAdminRecord.thePathRowNumber[sceneNbr];
+
+   tmp.gsub("/", "r");
+
+   tmp.gsub(" ", "");
+
+   return tmp;
+}
+
+//***************************************************************************
+// PUBLIC METHOD:
+// void ossimFfRevc::print(ostream& os) const
+//
+// Prints data members.
+//***************************************************************************
+void ossimFfRevc::print(std::ostream& os) const
+{
+   os << std::setiosflags(std::ios_base::left | std::ios_base::fixed)
+      << "Administrative Record:"
+      << std::setw(30) << "\ntheProductOrderNumber:" 
+      << theAdminRecord.theProductOrderNumber;
+
+   int i;
+   for (i = 0; i < NUMBER_OF_SCENES; i++)
+   {
+      os << "\nScene" << (i + 1) << std::setw(23) << " PathRowNumber:"
+         << theAdminRecord.thePathRowNumber[i]
+         << "\nScene" << (i + 1) << std::setw(23) << " AcquisitionDate:  "
+         << theAdminRecord.theAcquisitionDate[i]
+         << "\nScene" << (i + 1) << std::setw(23) << " SatelliteName:    "
+         << theAdminRecord.theSatName[i]
+         << "\nScene" << (i + 1) << std::setw(23) << " SensorName:       "
+         << theAdminRecord.theSensorName[i]
+         << "\nScene" << (i + 1) << std::setw(23) << " SensorMode:       "
+         << theAdminRecord.theSensorMode[i]
+         << "\nScene" << (i + 1) << std::setw(23) << " OffNadirAngle:    "
+         << std::setprecision(2) << theAdminRecord.theOffNadirAngle[i];
+   }
+
+   os << std::setw(30) << "\nProductType:" 
+      << theAdminRecord.theProductType
+      << std::setw(30) << "\nProductSize:" 
+      << theAdminRecord.theProductSize
+      << std::setw(30) << "\nProcessingType:" 
+      << theAdminRecord.theProcessingType 
+      << std::setw(30) << "\nResampAlgorithm:" 
+      << theAdminRecord.theResampAlgorithm
+      << std::setw(30) << "\nTapeVolumeNumber:" 
+      << theAdminRecord.theTapeVolumeNumber
+      << std::setw(30) << "\nNumberVolumesPerTape:" 
+      << theAdminRecord.theNumberVolumesPerTape
+      << std::setw(30) << "\nPixelsPerLine:" 
+      << theAdminRecord.thePixelsPerLine
+      << std::setw(30) << "\nLinesPerImage:" 
+      << theAdminRecord.theLinesPerImage
+      << std::setw(30) << "\n1stLineInVolume:" 
+      << theAdminRecord.the1stLineInVolume
+      << std::setw(30) << "\nTapeBlockingFactor:" 
+      << theAdminRecord.theTapeBlockingFactor
+      << std::setw(30) << "\nRecordSize:" 
+      << theAdminRecord.theRecordSize
+      << std::setw(30) << "\nGsd:" 
+      << std::setprecision(2) << theAdminRecord.theGsd
+      << std::setw(30) << "\nOutputBitsPerPixel:" 
+      << theAdminRecord.theOutputBitsPerPixel
+      << std::setw(30) << "\nAcquiredBitsPerPixel:" 
+      << theAdminRecord.theAcquiredBitsPerPixel
+      << std::setw(30) << "\nBandsPresentString:" 
+      << theAdminRecord.theBandsPresentString
+      << std::setw(30) << "\nFormatVersion:" 
+      << theAdminRecord.theFormatVersion
+      << "\n" 
+      << std::setw(30) << "Radiometric record:";
+
+   os << std::setprecision(15);
+
+   for (i = 0; i < NUMBER_OF_BANDS; i++)
+   {
+      os << "\nBand" << (i + 1) << std::setw(24) << " bias:" 
+         << theRadiomRecord.theBias[i]
+         << "\nBand" << (i + 1) << std::setw(24) << " gain:" 
+         << theRadiomRecord.theGain[i];
+   }
+
+   os << "\n"
+      << "Geometric Record:"
+      << std::setw(30) << "\nMapProjectionName:" 
+      << theGeoRecord.theMapProjectionName
+      << std::setw(30) << "\nEllipsoid:" 
+      << theGeoRecord.theEllipsoid
+      << std::setw(30) << "\nDatum:" 
+      << theGeoRecord.theDatum;
+
+   for (i = 0; i < 15; i++)
+   {
+      os << "\nProjectionParams[" << std::setw(2) << i << std::setw(10) << "]:  "
+         << theGeoRecord.theProjectionParams[i];
+   }
+
+   os << std::setprecision(3) 
+      << std::setw(30) << "\nUlLon:" 
+      << theGeoRecord.theUlLon
+      << std::setw(30) << "\nUlLat:" 
+      << theGeoRecord.theUlLat
+      << std::setw(30) << "\nUlEasting:" 
+      << theGeoRecord.theUlEasting
+      << std::setw(30) << "\nUlNorthing:" 
+      << theGeoRecord.theUlNorthing   
+      << std::setw(30) << "\nUrLon:" 
+      << theGeoRecord.theUrLon
+      << std::setw(30) << "\nUrLat:" 
+      << theGeoRecord.theUrLat
+      << std::setw(30) << "\nUrEasting:" 
+      << theGeoRecord.theUrEasting
+      << std::setw(30) << "\nUrNorthing:" 
+      << theGeoRecord.theUrNorthing
+      << std::setw(30) << "\nLrLon:" 
+      << theGeoRecord.theLrLon
+      << std::setw(30) << "\nLrLat:" 
+      << theGeoRecord.theLrLat
+      << std::setw(30) << "\nLrEasting:" 
+      << theGeoRecord.theLrEasting
+      << std::setw(30) << "\nLrNorthing:" 
+      << theGeoRecord.theLrNorthing
+      << std::setw(30) << "\nLlLon:" 
+      << theGeoRecord.theLlLon
+      << std::setw(30) << "\nLlLat:" 
+      << theGeoRecord.theLlLat
+      << std::setw(30) << "\nLlEasting:" 
+      << theGeoRecord.theLlEasting
+      << std::setw(30) << "\nLlNorthing:" 
+      << theGeoRecord.theLlNorthing
+      << std::setw(30) << "\nCenterLon:" 
+      << theGeoRecord.theCenterLon
+      << std::setw(30) << "\nCenterLat:" 
+      << theGeoRecord.theCenterLat
+      << std::setw(30) << "\nCenterEasting:" 
+      << theGeoRecord.theCenterEasting
+      << std::setw(30) << "\nCenterNorthing:" 
+      << theGeoRecord.theCenterNorthing
+      << std::setw(30) << "\nCenterSample:" 
+      << theGeoRecord.theCenterSample
+      << std::setw(30) << "\nCenterLine:" 
+      << theGeoRecord.theCenterLine
+      << std::setw(30) << "\nHorizontalOffset:" 
+      << theGeoRecord.theHorizontalOffset
+      << std::setprecision(2) << std::setw(30) << "\nOrientationAngle:" 
+      << theGeoRecord.theOrientationAngle
+      << std::setw(30) << "\nSunElevationAngle:" 
+      << std::setprecision(1) << theGeoRecord.theSunElevationAngle
+      << std::setw(30) << "\nSunAzimuth:" <<  theGeoRecord.theSunAzimuth
+      << std::resetiosflags(std::ios_base::left)
+      << "\n\n";
+
+}
+
+//***************************************************************************
+// PUBLIC METHOD:
+// void ossimFfRevc::write(ostream& os) const
+//
+// Writes data members in EOSAT Fast Format Rev C format.
+//***************************************************************************
+void ossimFfRevc::write(ossim::ostream& os) const
+{
+   const char PRODUCT_ID_DESC [PRODUCT_ORDER_NUMBER_DESC_SIZE + 1]
+      = "PRODUCT ID =";
+
+   const char LOCATION_DESC [LOCATION_DESC_SIZE + 1]
+      = " LOCATION =";
+
+   const char DATE_DESC [DATE_DESC_SIZE + 1]
+      = " ACQUISITION DATE =";
+   
+   const char SATELLITE_NAME_DESC [SAT_NAME_DESC_SIZE + 1]
+      = "SATELLITE =";
+   
+   const char SENSOR_NAME_DESC [SENSOR_NAME_DESC_SIZE + 1]
+      = " SENSOR =";
+   
+   const char SENSOR_MODE_DESC [SENSOR_MODE_DESC_SIZE + 1]
+      = " SENSOR MODE =";
+      
+   const char LOOK_ANGLE_DESC [LOOK_ANGLE_DESC_SIZE + 1]
+      = " LOOK ANGLE =";
+   
+   const char PRODUCT_TYPE_DESC [PRODUCT_TYPE_DESC_SIZE + 1]
+      = "PRODUCT TYPE =";
+   
+   const char PRODUCT_SIZE_DESC [PRODUCT_SIZE_DESC_SIZE + 1]
+      = " PRODUCT SIZE =";
+   
+   const char PROCESSING_TYPE_DESC [PROCESSING_TYPE_DESC_SIZE + 1]
+      = "TYPE OF PROCESSING =";
+   
+   const char RESAMPLING_ALGO_DESC [RESAMPLING_ALGO_DESC_SIZE + 1]
+      = " RESAMPLING =";
+   
+   const char TAPE_VOLUME_NUMBER_DESC [TAPE_VOLUME_NUMBER_DESC_SIZE + 1]
+      = "VOLUME #/# IN SET =";
+   
+   const char PIXELS_PER_LINE_DESC [PIXELS_PER_LINE_DESC_SIZE + 1]
+      = " PIXELS PER LINE =";
+   
+   const char LINES_PER_IMAGE_DESC [LINES_PER_IMAGE_DESC_SIZE + 1]
+      = " LINES PER BAND =";
+
+   const char  FIRST_LINE_DESC [FIRST_LINE_DESC_SIZE + 1]
+      = "START LINE # =";
+   
+   const char BLOCKING_FACTOR_DESC [BLOCKING_FACTOR_DESC_SIZE + 1]
+      = " BLOCKING FACTOR =";
+   
+   const char RECORD_LENGTH_DESC [RECORD_LENGTH_DESC_SIZE + 1]
+      = " RECORD LENGTH =";
+   
+   const char PIXEL_GSD_DESC [PIXEL_GSD_DESC_SIZE + 1]
+      = " PIXEL SIZE =";
+   
+   const char BITS_PER_PIXEL_DESC [BITS_PER_PIXEL_DESC_SIZE + 1]
+      = "OUTPUT BITS PER PIXEL =";
+   
+   const char AQUIRED_BITS_PER_PIXEL_DESC
+      [AQUIRED_BITS_PER_PIXEL_DESC_SIZE + 1] = " ACQUIRED BITS PER PIXEL =";
+   
+   const char BANDS_PRESENT_DESC [BANDS_PRESENT_DESC_SIZE + 1]
+      = "BANDS PRESENT =";
+   
+   const char REV_DESC [REV_DESC_SIZE + 1]
+      = "REV            ";
+   
+   const char BIAS_GAIN_DESC [BIAS_GAIN_DESC_SIZE + 1]
+      = "BIASES AND GAINS IN THE BAND ORDER AS ON THIS TAPE";
+   
+   const char GEO_DESC [GEO_DESC_SIZE + 1]
+      = "GEOMETRIC DATA";
+   
+   const char MAP_PROJECTION_NAME_DESC [MAP_PROJECTION_NAME_DESC_SIZE + 1]
+      = " MAP PROJECTION =";
+   
+   const char ELLIPSOID_DESC [ELLIPSOID_DESC_SIZE + 1]
+      = " ELLIPSOID =";
+      
+   const char DATUM_DESC [DATUM_DESC_SIZE + 1]
+      = " DATUM =";
+   
+   const char PROJECTION_PARAMETER_DESC [PROJECTION_PARAMETER_DESC_SIZE + 1]
+      = "USGS PROJECTION PARAMETERS =";
+   
+   const char UL_DESC [CORNER_DESC_SIZE + 1]
+      = "UL =";
+
+   const char UR_DESC [CORNER_DESC_SIZE + 1]
+      = "UR =";
+   
+   const char LR_DESC [CORNER_DESC_SIZE + 1]
+      = "LR =";
+   
+   const char LL_DESC [CORNER_DESC_SIZE + 1]
+      = "LL =";
+   
+   const char CENTER_DESC [CENTER_DESC_SIZE + 1]
+      = "CENTER =";
+   
+   const char HORIZONTAL_OFFSET_DESC [HORIZONTAL_OFFSET_DESC_SIZE + 1]
+      = "OFFSET =";
+   
+   const char ORIENTATION_ANGLE_DESC [ORIENTATION_ANGLE_DESC_SIZE + 1]
+      = " ORIENTATION ANGLE =";
+   
+   const char SUN_ELEVATION_DESC [SUN_ELEVATION_DESC_SIZE + 1]
+      = "SUN ELEVATION ANGLE =";
+   
+   const char SUN_AZIMUTH_DESC [SUN_AZIMUTH_DESC_SIZE + 1]
+      = " SUN AZIMUTH ANGLE =";
+
+   const char SPACE[] = " ";
+
+   //>
+   // NOTE:  "seekp's" will be perormed as needed for safety.
+   //<
+
+   //>
+   // Start at beginning of the stream.
+   //<
+   os.seekp(0, std::ios_base::beg);
+
+   //>
+   // Start of administrative record.
+   //<
+
+   os << std::setiosflags(std::ios_base::fixed)  // Disable scientific mode.
+
+      << PRODUCT_ID_DESC
+
+      << std::setw(PRODUCT_ORDER_NUMBER_SIZE)
+      << theAdminRecord.theProductOrderNumber;
+
+   //>
+   // The admin record can contain info for up to four scenes.
+   //<
+
+   int i;
+   for (i = 0; i < 4; i++)
+   {
+      os.seekp(LOCATION_OFFSET[i], std::ios_base::beg);
+
+      os << LOCATION_DESC         
+      
+         << std::setw(PATH_ROW_NUMBER_SIZE) 
+         << theAdminRecord.thePathRowNumber[i] 
+
+         << DATE_DESC
+
+         << std::setw(DATE_SIZE) 
+         << theAdminRecord.theAcquisitionDate[i] 
+
+         << std::setw(1) << SPACE << "\n" // End of line.
+
+         << SATELLITE_NAME_DESC // Start of line.
+
+         << std::setw(SAT_NAME_SIZE) 
+         << theAdminRecord.theSatName[i] 
+
+         << SENSOR_NAME_DESC
+      
+         << std::setw(SENSOR_NAME_SIZE) 
+         << theAdminRecord.theSensorName[i]
+
+         << SENSOR_MODE_DESC
+
+         << std::setw(SENSOR_MODE_SIZE) 
+         << theAdminRecord.theSensorMode[i]
+
+         << LOOK_ANGLE_DESC
+
+         << std::setw(OFF_NADIR_ANGLE_SIZE)
+         << std::setiosflags(std::ios_base::right)
+         << std::setprecision(2) 
+         << theAdminRecord.theOffNadirAngle[i] // End of scene.
+         << std::resetiosflags(std::ios_base::right)
+         << "\n" 
+         << std::setw(23) << SPACE; // End of line.
+   } // End of scene loop.
+
+   os.seekp(640, std::ios_base::beg); // Start of line.
+
+   os << PRODUCT_TYPE_DESC
+
+      << std::setiosflags(std::ios_base::left)
+      
+      << std::setw(PRODUCT_TYPE_SIZE)
+      << theAdminRecord.theProductType
+
+      << PRODUCT_SIZE_DESC
+
+      << std::setw(PRODUCT_SIZE_SIZE)
+      << theAdminRecord.theProductSize
+
+      << std::setw(22) << SPACE << "\n"; // End of line.
+
+   os.seekp(720, std::ios_base::beg);
+
+   os << PROCESSING_TYPE_DESC
+
+      << std::setw(PROCESSING_TYPE_SIZE)
+      << theAdminRecord.theProcessingType
+
+      << RESAMPLING_ALGO_DESC
+
+      << std::setw(RESAMPLING_ALGO_SIZE)
+      << theAdminRecord.theResampAlgorithm
+
+      << std::resetiosflags(std::ios_base::left)
+
+      << std::setw(33) << SPACE << "\n"; // End of line.
+
+   os.seekp(800, std::ios_base::beg);  // Start of line.
+   
+   os << TAPE_VOLUME_NUMBER_DESC
+
+      << std::setiosflags(std::ios_base::right)
+
+      << std::setw(TAPE_VOLUME_NUMBER_SIZE) 
+      << theAdminRecord.theTapeVolumeNumber
+      << "/" << std::setw(VOLUMES_PER_TAPE_SIZE)
+      << theAdminRecord.theNumberVolumesPerTape
+
+      << PIXELS_PER_LINE_DESC
+
+      << std::setw(PIXELS_PER_LINE_SIZE)
+      << theAdminRecord.thePixelsPerLine 
+
+      << LINES_PER_IMAGE_DESC
+
+      << std::setw(LINES_PER_IMAGE_SIZE)
+      << theAdminRecord.theLinesPerImage
+
+      << "/"
+
+      << std::setw(LINES_PER_IMAGE_SIZE)
+      << theAdminRecord.theLinesPerImage
+
+      << std::setw(4) << SPACE << "\n";  // End of line.
+  
+   os.seekp(880, std::ios_base::beg);  // Start of line.
+
+   os << std::setiosflags(std::ios_base::right)
+
+      << FIRST_LINE_DESC
+
+      << std::setw(LINES_PER_IMAGE_SIZE)
+      << theAdminRecord.the1stLineInVolume
+
+      << BLOCKING_FACTOR_DESC
+
+      << std::setw(BLOCKING_FACTOR_SIZE)
+      << theAdminRecord.theTapeBlockingFactor
+ 
+      << RECORD_LENGTH_DESC
+
+      << std::setw(RECORD_LENGTH_SIZE)
+      << theAdminRecord.theRecordSize
+
+      << PIXEL_GSD_DESC
+
+      
+      << std::setw(PIXEL_GSD_SIZE)
+      << std::setprecision(2)
+      << theAdminRecord.theGsd
+
+      << "\n";  // End of line.
+
+   os.seekp(960, std::ios_base::beg);  // Start of line.
+
+   os << BITS_PER_PIXEL_DESC
+
+      << std::setw(BITS_PER_PIXEL_SIZE)
+      << theAdminRecord.theOutputBitsPerPixel
+
+      << AQUIRED_BITS_PER_PIXEL_DESC
+
+      << std::setw(BITS_PER_PIXEL_SIZE)
+      << theAdminRecord.theAcquiredBitsPerPixel
+
+      << std::resetiosflags(std::ios_base::right)
+
+      << std::setw(26) << SPACE << "\n";  // End of line.
+
+   os.seekp(1040, std::ios_base::beg);  // Start of line.
+
+   os << BANDS_PRESENT_DESC
+
+      << std::setw(BANDS_PRESENT_SIZE)
+      << theAdminRecord.theBandsPresentString
+
+      << std::setw(31) << SPACE << "\n" // End of line.
+      << std::setw(79) << SPACE << "\n"
+      << std::setw(79) << SPACE << "\n"
+      << std::setw(79) << SPACE << "\n"
+      << std::setw(79) << SPACE << "\n"
+      << std::setw(79) << SPACE << "\n";
+
+   os.seekp(1520, std::ios_base::beg);
+   
+   os << REV_DESC
+
+      << std::setw(FORMAT_VERSION_SIZE)
+      << theAdminRecord.theFormatVersion;
+
+   //***
+   // End of administrative record(bytes 0 to 1535).
+   //***
+
+   //***
+   // Beginning of radiometric record.
+   //***
+
+   os.seekp(1536, std::ios_base::beg);  
+
+   os << BIAS_GAIN_DESC
+
+      << std::setw(29) << SPACE << "\n"; 
+
+   //***
+   // Loop through the bands and get write out the bias and gain for each
+   // band.
+   //***
+   
+   os << std::resetiosflags(std::ios_base::left) << std::setiosflags(std::ios_base::right);
+
+   for (i = 0; i < 8; i++)
+   {
+      os.seekp(BIAS_OFFSET[i], std::ios_base::beg);
+
+      os << std::setprecision(15)
+         
+         << std::setw(BIAS_SIZE)
+         << theRadiomRecord.theBias[i]
+
+         << SPACE 
+
+         << std::setw(GAIN_SIZE) 
+         << theRadiomRecord.theGain[i]
+
+         << std::setw(30) << SPACE << "\n";
+   } // End of loop through the bands.
+
+   os << std::resetiosflags(std::ios_base::right);
+
+   os.seekp(2256, std::ios_base::beg);
+
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(79) << SPACE << "\n";
+   os << std::setw(15) << SPACE << "\n";
+
+   //***
+   // End of radiometric record(bytes 1536 to 3071).
+   //***
+
+   //**
+   // Start of geometric record(bytes 3072 to 4607).
+   //***
+
+   os.seekp(3072, std::ios_base::beg);  // Start of record.
+
+   os << GEO_DESC
+
+      << MAP_PROJECTION_NAME_DESC
+
+      << std::setiosflags(std::ios_base::left) // Alpha fields left justified.
+
+      << std::setw(MAP_PROJECTION_NAME_SIZE)
+      << theGeoRecord.theMapProjectionName
+
+      << ELLIPSOID_DESC // Looks like this has changed.
+
+      << std::setw(ELLIPSOID_SIZE)
+      << theGeoRecord.theEllipsoid
+
+      << DATUM_DESC
+
+      << std::setw(DATUM_SIZE)
+      << theGeoRecord.theDatum
+
+      << std::resetiosflags(std::ios_base::left)
+      
+      << "\n" // End of line
+
+      << PROJECTION_PARAMETER_DESC
+      << SPACE;
+
+   os.seekp(PROJ_PARAM_OFFSET[0], std::ios_base::beg);
+   os << std::setprecision(15)
+      << std::setiosflags(std::ios_base::right)
+      
+      << std::setw(PROJECTION_PARAMETER_SIZE) 
+      << theGeoRecord.theProjectionParams[0]
+      << SPACE;
+
+   os.seekp(PROJ_PARAM_OFFSET[1], std::ios_base::beg);
+   os << std::setw(PROJECTION_PARAMETER_SIZE) 
+      << theGeoRecord.theProjectionParams[1]
+      << std::setw(1) << SPACE << "\n";
+
+   //***
+   // Code is duplicated every three projection parameter four times; 
+   // hence, the double loop.
+   //***
+   for (i = 0; i < 4; i++)
+   {
+      for (int j = i * 3 + 2; j < (i * 3) + 5; j++)
+      {
+         os.seekp(PROJ_PARAM_OFFSET[j], std::ios_base::beg);
+
+         os << std::setw(PROJECTION_PARAMETER_SIZE) 
+            << theGeoRecord.theProjectionParams[j]
+            << std::setw(1) << SPACE;
+
+         os.seekp(PROJ_PARAM_OFFSET[j], std::ios_base::beg);
+         os << std::setw(PROJECTION_PARAMETER_SIZE) 
+            << theGeoRecord.theProjectionParams[j]
+            << std::setw(1) << SPACE;
+
+         os.seekp(PROJ_PARAM_OFFSET[j], std::ios_base::beg);
+         os << std::setw(PROJECTION_PARAMETER_SIZE) 
+            << theGeoRecord.theProjectionParams[j]
+            << std::setw(5) << SPACE << "\n";
+      }
+   }
+
+   os.seekp(PROJ_PARAM_OFFSET[14], std::ios_base::beg);
+   os << std::setw(PROJECTION_PARAMETER_SIZE) 
+      << theGeoRecord.theProjectionParams[14]
+      << std::setw(55) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
+
+
+   os.seekp(3632, std::ios_base::beg);
+   os << UL_DESC
+ 
+      << SPACE
+      
+      << std::setw(LON_SIZE) << theGeoRecord.theUlLon
+
+      << SPACE
+
+      << std::setw(LAT_SIZE) << theGeoRecord.theUlLat
+
+      << SPACE
+
+      << std::setprecision(3)
+      
+      << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right) 
+      << theGeoRecord.theUlEasting
+
+      << SPACE
+
+      << std::setw(NORTHING_SIZE) 
+      << theGeoRecord.theUlNorthing
+
+      << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
+
+      
+   os.seekp(3712, std::ios_base::beg);
+   os << UR_DESC
+ 
+      << SPACE
+      
+      << std::setw(LON_SIZE) << theGeoRecord.theUrLon
+
+      << SPACE
+
+      << std::setw(LAT_SIZE) << theGeoRecord.theUrLat
+
+      << SPACE
+
+      << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right) 
+      << theGeoRecord.theUrEasting
+
+      << SPACE
+
+      << std::setw(NORTHING_SIZE) 
+      << theGeoRecord.theUrNorthing
+
+      << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
+
+      
+   os.seekp(3792, std::ios_base::beg);
+   os << LR_DESC
+ 
+      << SPACE
+      
+      << std::setw(LON_SIZE) << theGeoRecord.theLrLon
+
+      << SPACE
+
+      << std::setw(LAT_SIZE) << theGeoRecord.theLrLat
+
+      << SPACE
+
+      << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right) 
+      << theGeoRecord.theLrEasting
+
+      << SPACE
+
+      << std::setw(NORTHING_SIZE) 
+      << theGeoRecord.theLrNorthing
+
+      << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
+
+      
+   os.seekp(3872, std::ios_base::beg);
+   os << LL_DESC
+ 
+      << SPACE
+      
+      << std::setw(LON_SIZE) << theGeoRecord.theLlLon
+
+      << SPACE
+
+      << std::setw(LAT_SIZE) << theGeoRecord.theLlLat
+
+      << SPACE
+
+      << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right) 
+      << theGeoRecord.theLlEasting
+
+      << SPACE
+
+      << std::setw(NORTHING_SIZE) 
+      << theGeoRecord.theLlNorthing
+
+      << std::setw(20) << SPACE << "\n" << std::resetiosflags(std::ios_base::right);
+
+   os.seekp(3952, std::ios_base::beg);
+   os << CENTER_DESC
+
+      << SPACE
+
+      << std::setw(LON_SIZE) 
+      << theGeoRecord.theCenterLon
+      
+      << SPACE
+
+      << std::setw(LAT_SIZE) 
+      << theGeoRecord.theCenterLat
+
+      << SPACE
+
+      << std::setw(EASTING_SIZE) << std::setiosflags(std::ios_base::right) 
+      << theGeoRecord.theCenterEasting
+
+      << SPACE
+
+      << std::setw(NORTHING_SIZE) 
+      << theGeoRecord.theCenterNorthing
+
+      << SPACE 
+
+      << std::setw(CENTER_SAMPLE_SIZE) 
+      << theGeoRecord.theCenterSample
+
+      << SPACE 
+
+      << std::setw(CENTER_LINE_SIZE) 
+      << theGeoRecord.theCenterLine
+
+      << std::setw(4) << SPACE << "\n";
+
+   os.seekp(4032, std::ios_base::beg);
+   os << HORIZONTAL_OFFSET_DESC
+
+      << std::setw(HORIZONTAL_OFFSET_SIZE) 
+      << theGeoRecord.theHorizontalOffset
+
+      << ORIENTATION_ANGLE_DESC
+
+      << std::setw(ORIENTATION_ANGLE_SIZE) 
+      << std::setprecision(2)
+      << theGeoRecord.theOrientationAngle
+
+      << std::setw(39) << SPACE << "\n"; // 41 in spec
+
+   os.seekp(4112, std::ios_base::beg);
+   os << SUN_ELEVATION_DESC
+
+      << std::setw(SUN_ELEVATION_SIZE) 
+      << std::setprecision(1) 
+      << theGeoRecord.theSunElevationAngle
+
+      << SUN_AZIMUTH_DESC
+
+      << std::setw(SUN_AZIMUTH_SIZE) 
+      << std::setprecision(1) 
+      << theGeoRecord.theSunAzimuth  // End of data.
+
+      << std::setw(29) << SPACE << "\n" 
+      << std::setw(79) << SPACE << "\n" 
+      << std::setw(79) << SPACE << "\n" 
+      << std::setw(79) << SPACE << "\n" 
+      << std::setw(79) << SPACE << "\n"
+      << std::setw(79) << SPACE << "\n"
+      << std::setw(15) << SPACE << "\n" << std::flush; // ? size
+
+   //***
+   // End of geometric record(bytes 3072 to 4607).
+   //***
+   
+}
+
+
+//***************************************************************************
+// PRIVATE METHOD:
+// ossimFfRevc::loadFromStream(istream& is)
+//***************************************************************************
+void ossimFfRevc::loadFromStream(ossim::istream& is)
+{
+   //***
+   // See .h for enumerations for field sizes and offsets. 
+   //***
+
+   //***
+   // NOTE:  Because of header inconsistencies all seeks will be relative to
+   //        the beginning of the stream.
+   //***
+
+   //***
+   // Temporary buffer for fields that need to be converted to integers or
+   // floats.
+   //***
+   
+   char tmpBuff[25];
+
+   //***
+   // Start of administrative record.
+   //***
+
+   is.seekg(PRODUCT_ORDER_NUMBER_OFFSET, std::ios_base::beg);
+
+   is.get(theAdminRecord.theProductOrderNumber, 
+          PRODUCT_ORDER_NUMBER_SIZE + 1,
+          ' ');
+
+   if (checkStream(is)) return;
+
+   //***
+   // Loop through the four scenes and get the data.
+   //***
+
+   int i;
+   for (i = 0; i < NUMBER_OF_SCENES; i++)
+   {
+ 
+      is.seekg(PATH_ROW_NUMBER_OFFSET[i], std::ios_base::beg);
+
+      is.get(theAdminRecord.thePathRowNumber[i], PATH_ROW_NUMBER_SIZE + 1);
+   
+      if (checkStream(is)) return;
+
+      is.seekg(DATE_OFFSET[i], std::ios_base::beg);
+
+      is.get(theAdminRecord.theAcquisitionDate[i], DATE_SIZE + 1);
+   
+      if (checkStream(is)) return;
+
+      is.seekg(SAT_NAME_OFFSET[i], std::ios_base::beg);
+
+      is.get(theAdminRecord.theSatName[i], SAT_NAME_SIZE + 1);
+   
+      if (checkStream(is)) return;
+
+      is.seekg(SENSOR_NAME_OFFSET[i], std::ios_base::beg);
+
+      is.get(theAdminRecord.theSensorName[i], SENSOR_NAME_SIZE + 1);
+   
+      if (checkStream(is)) return;
+
+      is.seekg(SENSOR_MODE_OFFSET[i], std::ios_base::beg);
+
+      is.get(theAdminRecord.theSensorMode[i], SENSOR_MODE_SIZE + 1);
+  
+      if (checkStream(is)) return;
+
+      is.seekg(OFF_NADIR_ANGLE_OFFSET[i], std::ios_base::beg);
+
+      is.get(tmpBuff, OFF_NADIR_ANGLE_SIZE + 1);
+
+      if (checkStream(is)) return;
+
+      theAdminRecord.theOffNadirAngle[i] = atof(tmpBuff);
+
+   } // End of scene loop.
+   
+   is.seekg(PRODUCT_TYPE_OFFSET, std::ios_base::beg);
+
+   is.get(theAdminRecord.theProductType, PRODUCT_TYPE_SIZE + 1);
+
+   if (checkStream(is)) return;
+ 
+   is.seekg(PRODUCT_SIZE_OFFSET, std::ios_base::beg);
+
+   is.get(theAdminRecord.theProductSize, PRODUCT_SIZE_SIZE + 1);
+
+   if (checkStream(is)) return;
+   
+   is.seekg(PROCESSING_TYPE_OFFSET, std::ios_base::beg);
+
+   is.get(theAdminRecord.theProcessingType, PROCESSING_TYPE_SIZE + 1);
+
+   if (checkStream(is)) return;
+   
+   is.seekg(RESAMPLING_ALGO_OFFSET, std::ios_base::beg);
+
+   is.get(theAdminRecord.theResampAlgorithm, RESAMPLING_ALGO_SIZE + 1);
+
+   if (checkStream(is)) return;
+   
+   is.seekg(TAPE_VOLUME_NUMBER_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, TAPE_VOLUME_NUMBER_SIZE + 1, '/');
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theTapeVolumeNumber = atoi(tmpBuff);
+
+   is.seekg(VOLUMES_PER_TAPE_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, VOLUMES_PER_TAPE_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theNumberVolumesPerTape = atoi(tmpBuff);
+    
+   is.seekg(PIXELS_PER_LINE_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, PIXELS_PER_LINE_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.thePixelsPerLine = atoi(tmpBuff);
+   
+   is.seekg(LINES_PER_IMAGE_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, LINES_PER_IMAGE_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theLinesPerImage = atoi(tmpBuff);
+
+   is.seekg(FIRST_LINE_IN_VOLUME_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, FIRST_LINE_IN_VOLUME_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.the1stLineInVolume = atoi(tmpBuff);
+
+   is.seekg(BLOCKING_FACTOR_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, BLOCKING_FACTOR_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theTapeBlockingFactor = atoi(tmpBuff);
+   
+   is.seekg(RECORD_LENGTH_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, RECORD_LENGTH_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theRecordSize = atoi(tmpBuff);
+   
+   is.seekg(PIXEL_GSD_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, PIXEL_GSD_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theGsd = atof(tmpBuff);
+   
+   is.seekg(BITS_PER_PIXEL_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, BITS_PER_PIXEL_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theOutputBitsPerPixel = atoi(tmpBuff);
+   
+   is.seekg(ACQUIRED_BITS_PER_PIXEL_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, BITS_PER_PIXEL_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theAdminRecord.theAcquiredBitsPerPixel = atoi(tmpBuff);
+   
+   is.seekg(BANDS_PRESENT_OFFSET, std::ios_base::beg);
+
+   is.get(theAdminRecord.theBandsPresentString, BANDS_PRESENT_SIZE + 1);
+
+   if (checkStream(is)) return;
+   
+   is.seekg(FORMAT_VERSION_OFFSET, std::ios_base::beg);
+
+   is.get(theAdminRecord.theFormatVersion, FORMAT_VERSION_SIZE + 1);
+
+   if (checkStream(is)) return;
+   //***
+   // End of administrative record.
+   //***
+
+   //***
+   // Start of radiometric record.
+   //***
+
+   for (i = 0; i < NUMBER_OF_BANDS; i++)
+   {
+      is.seekg(BIAS_OFFSET[i], std::ios_base::beg);
+
+      is.get(tmpBuff, BIAS_SIZE + 1);
+
+      if (checkStream(is)) return;
+   
+      theRadiomRecord.theBias[i] = atof(tmpBuff);
+
+      is.seekg(GAIN_OFFSET[i], std::ios_base::beg);
+
+      is.get(tmpBuff, GAIN_SIZE + 1);
+
+      if (checkStream(is)) return;
+   
+      theRadiomRecord.theGain[i] = atof(tmpBuff);
+   }
+   //***
+   // End of radiometric record.
+   //***
+
+   //***
+   // Start of geometric record.
+   //***
+
+   is.seekg(MAP_PROJECTION_NAME_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theMapProjectionName, MAP_PROJECTION_NAME_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   is.seekg(ELLIPSOID_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theEllipsoid, ELLIPSOID_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   is.seekg(DATUM_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theDatum, DATUM_SIZE + 1, ' ');
+   
+   if (checkStream(is)) return;
+
+   //***
+   // Get the fifteen projection parameters.
+   //***
+   
+   for(i = 0; i < 15; i++)
+   {
+      is.seekg(PROJ_PARAM_OFFSET[i], std::ios_base::beg);
+   
+      is.get(tmpBuff, PROJECTION_PARAMETER_SIZE + 1);
+
+      if (checkStream(is)) return;
+
+      theGeoRecord.theProjectionParams[i] = atof(tmpBuff);
+   }
+
+   //***
+   // Start of upper left data:  longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(UL_LON_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theUlLon, LON_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(UL_LAT_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theUlLat, LAT_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(UL_EASTING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, EASTING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theUlEasting = atof(tmpBuff);
+
+   is.seekg(UL_NORTHING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theUlNorthing = atof(tmpBuff);
+
+   //***
+   // End of upper left data.
+   //***
+
+   //***
+   // Start of upper right data:  longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(UR_LON_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theUrLon, LON_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(UR_LAT_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theUrLat, LAT_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(UR_EASTING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, EASTING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theUrEasting = atof(tmpBuff);
+
+   is.seekg(UR_NORTHING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theUrNorthing = atof(tmpBuff);
+
+   //***
+   // End of upper right data.
+   //***
+
+   //***
+   // Start of lower right data:  longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(LR_LON_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theLrLon, LON_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(LR_LAT_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theLrLat, LAT_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(LR_EASTING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, EASTING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theLrEasting = atof(tmpBuff);
+
+   is.seekg(LR_NORTHING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theLrNorthing = atof(tmpBuff);
+
+   //***
+   // End of lower right data.
+   //***
+
+   //***
+   // Start of lower left data:  longitude, latitude, easting, and northing. 
+   //***
+   is.seekg(LL_LON_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theLlLon, LON_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(LL_LAT_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theLlLat, LAT_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(LL_EASTING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, EASTING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theLlEasting = atof(tmpBuff);
+
+   is.seekg(LL_NORTHING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theLlNorthing = atof(tmpBuff);
+
+   //***
+   // End of lower left data.
+   //***
+
+   //***
+   // Start of scene center data:  longitude, latitude, easting, northing,
+   // sample, line. 
+   //***
+   is.seekg(CENTER_LON_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theCenterLon, LON_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(CENTER_LAT_OFFSET, std::ios_base::beg);
+
+   is.get(theGeoRecord.theCenterLat, LAT_SIZE + 1);
+   
+   if (checkStream(is)) return;
+   
+   is.seekg(CENTER_EASTING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, EASTING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theCenterEasting = atof(tmpBuff);
+
+   is.seekg(CENTER_NORTHING_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, NORTHING_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theCenterNorthing = atof(tmpBuff);
+
+   is.seekg(CENTER_SAMPLE_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, CENTER_SAMPLE_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theCenterSample = atoi(tmpBuff);
+
+   is.seekg(CENTER_LINE_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, CENTER_LINE_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theCenterLine = atoi(tmpBuff);
+
+   //***
+   // End of scene center data.
+   //***
+   
+   is.seekg(HORIZONTAL_OFFSET_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, HORIZONTAL_OFFSET_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theHorizontalOffset = atoi(tmpBuff);
+   
+   is.seekg(ORIENTATION_ANGLE_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, ORIENTATION_ANGLE_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theOrientationAngle = atof(tmpBuff);
+   
+   is.seekg(SUN_ELEVATION_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, SUN_ELEVATION_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theSunElevationAngle = atof(tmpBuff);
+   
+   is.seekg(SUN_AZIMUTH_OFFSET, std::ios_base::beg);
+
+   is.get(tmpBuff, SUN_AZIMUTH_SIZE + 1);
+
+   if (checkStream(is)) return;
+
+   theGeoRecord.theSunAzimuth = atof(tmpBuff);
+
+   //***
+   // End of geometric record.
+   //***
+   
+}
+
+//***************************************************************************
+// PRIVATE METHOD:
+// ossimFfRevc::checkStream(istream& is)
+//
+// Checks the stream.  If an error has occurred it sets theErrorStatus.
+// Returns: theErrorStatus    ( 0 = OK,  1 = ERROR )
+//***************************************************************************
+int ossimFfRevc::checkStream(ossim::istream& is)
+{
+   //***
+   // istreams set fault bits and the operator! is overloaded to return
+   // true if an error has occurred.
+   //***
+   
+   if (!is)
+   {
+      theErrorStatus = OSSIM_ERROR;
+
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimFfRevc::checkStream: "
+                                          << "Stream corrupted.   Returning from method."
+                                          << std::endl;
+   } 
+
+   return theErrorStatus;
+}
+   
+//***************************************************************************
+// Function:
+// ostream& operator<<(ostream& os, const ossimFfRevc& head)
+//***************************************************************************
+std::ostream& operator<<(std::ostream& os, const ossimFfRevc& head)
+{
+   head.print(os);
+
+   return os;
+}
+
+//***************************************************************************
+// CONSTRUCTOR:
+// ossimFfRevc::AdminRecord::AdminRecord()
+//
+// Default constructor for AdminRecord nested class:
+//***************************************************************************
+ossimFfRevc::AdminRecord::AdminRecord()
+   :
+      theTapeVolumeNumber(1),
+      theNumberVolumesPerTape(1),
+      thePixelsPerLine(0),
+      theLinesPerImage(0),
+      the1stLineInVolume(1),
+      theTapeBlockingFactor(1),
+      theRecordSize(0),
+      theGsd(0.0),
+      theOutputBitsPerPixel(8),
+      theAcquiredBitsPerPixel(6)
+{
+   const char tmpBuff[] = "";
+
+   strcpy(theProductOrderNumber, tmpBuff);
+
+   //>
+   // There can be four scenes.
+   //<
+   
+   for (int i = 0; i < 4; i++)
+   {
+      strcpy(thePathRowNumber[i], tmpBuff);
+      strcpy(theAcquisitionDate[i], tmpBuff);
+      strcpy(theSatName[i], tmpBuff);
+      strcpy(theSensorName[i], tmpBuff);
+      strcpy(theSensorMode[i], tmpBuff);
+      theOffNadirAngle[i] = 0.0;
+   }
+   strcpy(theProductType, "MAP ORIENTED");
+   strcpy(theProductSize, tmpBuff);
+   strcpy(theProcessingType, "SYSTEMATIC");
+   strcpy(theResampAlgorithm, "CC");
+   strcpy(theBandsPresentString, "P");
+   strcpy(theFormatVersion, "C");
+}
+
+//***************************************************************************
+// CONSTRUCTOR:
+// ossimFfRevc::RadiomRecord::RadiomRecord()
+//
+// Default constructor for RadiomRecord nested class:
+//***************************************************************************
+ossimFfRevc::RadiomRecord::RadiomRecord()
+{
+   for (int i = 0; i < 8; i++)
+   {
+      theBias[i] = 0.0;
+      theGain[i] = 0.0;
+   }
+}
+         
+//***************************************************************************
+// CONSTRUCTOR:
+// ossimFfRevc::GeoRecord::GeomRecord()
+//
+// Default constructor for GeoRecord nested class:
+//***************************************************************************
+ossimFfRevc::GeoRecord::GeoRecord()
+   :
+      theUlEasting(0.0),
+      theUlNorthing(0.0),
+      theUrEasting(0.0),
+      theUrNorthing(0.0),
+      theLrEasting(0.0),
+      theLrNorthing(0.0),
+      theLlEasting(0.0),
+      theLlNorthing(0.0),
+      theCenterEasting(0.0),
+      theCenterNorthing(0.0),
+      theCenterSample(0),
+      theCenterLine(0),
+      theHorizontalOffset(0),
+      theOrientationAngle(0.0),
+      theSunElevationAngle(0.0),
+      theSunAzimuth(0.0)
+{
+   for (int i = 0; i < 15; i++)
+   {
+      theProjectionParams[i] = 0.0;
+   }
+
+   const char tmpBuff[] = "";
+
+   strcpy(theMapProjectionName, "UTM");
+   strcpy(theEllipsoid, tmpBuff);
+   strcpy(theDatum, tmpBuff);
+   strcpy(theUlLon, tmpBuff);
+   strcpy(theUlLat, tmpBuff);
+   strcpy(theUrLon, tmpBuff);
+   strcpy(theUrLat, tmpBuff);
+   strcpy(theLrLon, tmpBuff);
+   strcpy(theLrLat, tmpBuff);
+   strcpy(theLlLon, tmpBuff);
+   strcpy(theLlLat, tmpBuff);
+   strcpy(theCenterLon, tmpBuff);
+   strcpy(theCenterLat, tmpBuff);
+}
diff --git a/src/support_data/ossimFgdcTxtDoc.cpp b/src/support_data/ossimFgdcTxtDoc.cpp
new file mode 100644
index 0000000..6aa2a2a
--- /dev/null
+++ b/src/support_data/ossimFgdcTxtDoc.cpp
@@ -0,0 +1,306 @@
+//----------------------------------------------------------------------------
+//
+// File ossimFgdcTxtDoc.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ossimFgdcTxtDoc class definition.
+//
+// FGDC = "Federal Geographic Data Committee"
+//
+// See: http://www.fgdc.gov/
+// 
+//----------------------------------------------------------------------------
+
+#include <ossim/support_data/ossimFgdcTxtDoc.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/projection/ossimMapProjectionFactory.h>
+#include <fstream>
+#include <iostream>
+#include <string>
+#include <vector>
+
+static const std::string ALTITUDE_DISTANCE_UNITS_KW = "altitude_distance_units";
+static const std::string FGDC_FILE_KW               = "fgdc_file";
+static const std::string FGDC_VERSION_KW            = "fgdc_version";
+static const std::string FGDC_VERSION_001_1998      = "FGDC-STD-001-1998";
+
+ossimFgdcTxtDoc::ossimFgdcTxtDoc()
+   : m_kwl( new ossimKeywordlist() )
+{
+}
+
+ossimFgdcTxtDoc::~ossimFgdcTxtDoc()
+{
+   m_kwl = 0; // Not a leak, m_kwl is a ossimRefPtr.
+}
+
+bool ossimFgdcTxtDoc::open(const ossimFilename& file)
+{
+   bool result = false;
+
+   // Open the file:
+   std::ifstream str( file.c_str(), std::ios_base::in );
+
+   if ( str.good() )
+   {
+      std::string key = "Metadata_Standard_Version";
+      std::string value;
+      if ( findKey( str, true, key, value ) )
+      {
+         if ( value == FGDC_VERSION_001_1998 )
+         {
+            result = true;
+            m_kwl->addPair( FGDC_VERSION_KW, value );
+            m_kwl->addPair( FGDC_FILE_KW, file.string() );
+
+            // Store for getAltitudeDistanceUnits() method if key found.
+            key = "Altitude_Distance_Units";
+            if ( findKey( str, false, key, value ) )
+            {
+               m_kwl->addPair( ALTITUDE_DISTANCE_UNITS_KW, value );
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+void ossimFgdcTxtDoc::close()
+{
+   m_kwl->clear();
+}
+
+void ossimFgdcTxtDoc::getProjection(ossimRefPtr<ossimProjection>& proj)
+{
+   static const char M[] = "ossimFgdcTxtDoc::getProjection";
+   
+   try
+   {
+      // Get the file name:
+      std::string file = m_kwl->findKey( FGDC_FILE_KW );
+      if ( file.size() )
+      {
+         // Get the version:
+         std::string version = m_kwl->findKey( FGDC_VERSION_KW );
+         if ( version.size() )
+         {
+            // Note: Currently only coded against FGDC-STD-001-1998
+            if ( version ==  FGDC_VERSION_001_1998)
+            {
+               // Open the file:
+               std::ifstream str( file.c_str(), std::ios_base::in );
+               if ( str.good() )
+               {
+                  // Find the Spatial_Reference_Information  section:
+                  std::string key = "Spatial_Reference_Information:";
+                  if ( findKey( str, key ) )
+                  {
+                     getProjectionV1( str, proj );
+                  }
+               }
+            }
+         }
+      }
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << M << " caught exception:\n" << e.what() << std::endl;
+   }
+}
+
+void ossimFgdcTxtDoc::getAltitudeDistanceUnits(std::string& units) const
+{
+   units = m_kwl->findKey( ALTITUDE_DISTANCE_UNITS_KW );
+}
+
+void ossimFgdcTxtDoc::getProjectionV1(std::ifstream& str, ossimRefPtr<ossimProjection>& proj)
+{
+   static const char M[] = "ossimFgdcTxtDoc::getProjectionV1";
+   
+   std::string fgdcKey;
+   std::string fgdcValue;
+   std::string key;
+   std::string value;
+   ossimKeywordlist projectionKwl;
+   
+   fgdcKey = "Grid_Coordinate_System_Name";
+   if ( findKey( str, true, fgdcKey, fgdcValue ) )
+   {
+      if ( fgdcValue == "Universal Transverse Mercator" )
+      {
+         key = "type";
+         value = "ossimUtmProjection";
+         projectionKwl.addPair(key, value);
+
+         // Get the zone:
+         fgdcKey = "UTM_Zone_Number";
+         if ( findKey( str, true, fgdcKey, fgdcValue ) )
+         {
+            key = "zone";
+            value = fgdcValue;
+            projectionKwl.addPair(key, value);
+         }
+         else
+         {
+            std::string errMsg = M;
+            errMsg += " ERROR: Could not determine utm zone!";
+            throw ossimException(errMsg);
+         }
+
+         // Check for Southern hemisphere.
+         fgdcKey = "False_Northing";
+         if ( findKey( str, true, fgdcKey, fgdcValue ) )
+         {
+            key = "hemisphere";
+            
+            // Hemisphere( North false easting = 0.0, South = 10000000):
+            ossim_float64 f = ossimString::toFloat64( fgdcKey.c_str() );
+            if ( f == 0.0 )
+            {
+               value = "N";
+            }
+            else
+            {
+               value = "S";
+            }
+            projectionKwl.addPair(key, value);
+         }
+         
+      } // UTM section:
+      else
+      {
+         // Exception thrown so that we see that we are not handling a projection.
+         std::string errMsg = M;
+         errMsg += "ERROR: Unhandled projection: ";
+         errMsg += fgdcValue;
+         throw ossimException(errMsg);  
+      }
+
+      fgdcKey = "Horizontal_Datum_Name";
+      if ( findKey( str, true, fgdcKey, fgdcValue ) )
+      {
+         getOssimDatum( fgdcValue, value );
+         key = "datum";
+         projectionKwl.addPair(key, value);
+      }
+      
+   } // Matches: findKey( Grid_Coordinate_System_Name )
+
+   if ( projectionKwl.getSize() )
+   {
+      proj = ossimMapProjectionFactory::instance()->createProjection(projectionKwl);
+   }
+   else
+   {
+      proj = 0;
+   }
+}
+
+bool ossimFgdcTxtDoc::findKey( std::ifstream& str, const std::string& key)
+{
+   bool result = false;
+   ossimString line;
+   while ( !str.eof() )
+   {
+      // Read line:
+      std::getline( str, line.string() );
+      if ( line.size() )
+      {
+         // Eat white space.
+         line.trim();
+         if ( line.string() == key )
+         {
+            result = true;
+            break;
+         }
+      }
+   }
+   return result;
+}
+
+bool ossimFgdcTxtDoc::findKey(
+   std::ifstream& str, bool seekBack, const std::string& key, std::string& value)
+{
+   bool result = false;
+
+   std::vector<ossimString> fgdcKeyValue;
+   ossimString separator = ":";
+   ossimString line;
+   ossimKeywordlist projectionKwl;
+   std::streampos currentPosition = str.tellg();
+   
+   while ( !str.eof() )
+   {
+      // Read line:
+      std::getline( str, line.string() );
+      
+      if ( line.size() )
+      {
+         // Eat white space.
+         line.trim();
+         
+         // Split between ':'
+         fgdcKeyValue.clear();
+         line.split(fgdcKeyValue, separator, false);
+         if ( fgdcKeyValue.size() == 2 )
+         {
+            fgdcKeyValue[0].trim();
+
+            if ( fgdcKeyValue[0].size() )
+            {
+               if ( fgdcKeyValue[0] == key )
+               {
+                  // Found it.  Initialize value and get out.
+                  result = true;
+                  fgdcKeyValue[1].trim();
+                  value = fgdcKeyValue[1].string();
+                  break; // from while loop.
+               }
+            }
+         }
+      }
+   }
+
+   if ( seekBack )
+   {
+      str.seekg(currentPosition);
+   }
+   
+   return result;
+}
+
+// Could be moved to base class for xml and text doc.
+void ossimFgdcTxtDoc::getOssimDatum( const std::string& fgdcDatumString,
+                                     std::string& ossimDatumCode ) const
+{
+   ossimString horizdn = fgdcDatumString;
+   horizdn.downcase();
+   if ( horizdn == "north american datum of 1983" )
+   {
+      ossimDatumCode = "NAR-C";
+   }
+   else if ( horizdn == "north american datum of 1927" )
+   {
+      ossimDatumCode = "NAS-C";
+   }
+   else if ( horizdn == "wgs84")
+   {
+      ossimDatumCode = "WGE";
+   }
+   else
+   {
+      // Exception thrown so that we see that we are not handling a datum.
+      std::string errMsg = "ossimFgdcTxtDoc::getOssimDatum ERROR: Unhandled datum: ";
+      errMsg += horizdn.string();
+      throw ossimException(errMsg);
+   }
+}
diff --git a/src/support_data/ossimFgdcXmlDoc.cpp b/src/support_data/ossimFgdcXmlDoc.cpp
new file mode 100644
index 0000000..737ea52
--- /dev/null
+++ b/src/support_data/ossimFgdcXmlDoc.cpp
@@ -0,0 +1,548 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Utility class to encapsulate parsing projection info in the xml file.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimFgdcXmlDoc.cpp 2063 2011-01-19 19:38:12Z ming.su $
+
+#include <ossim/support_data/ossimFgdcXmlDoc.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimDatumFactoryRegistry.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimUtmProjection.h>
+
+#include <cmath> /* for std::fabs */
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimFgdcXmlDoc:debug");
+
+ossimFgdcXmlDoc::ossimFgdcXmlDoc()
+   : m_xmlFilename(ossimFilename::NIL),
+     m_xmlDocument(0),
+     m_projection(0),
+     m_boundInDegree(false)
+{
+}
+
+ossimFgdcXmlDoc::~ossimFgdcXmlDoc()
+{
+}
+
+bool ossimFgdcXmlDoc::open(const ossimFilename& xmlFileName)
+{
+   bool result = false;
+   if ( isOpen() )
+   {
+      close();
+   }
+   
+   if (xmlFileName.size())
+   {
+      m_xmlDocument = new ossimXmlDocument(xmlFileName);
+      if ( m_xmlDocument.valid() )
+      {
+         // May want to add a test for valid FGDC here??? (drb)
+         m_xmlFilename = xmlFileName;
+         result = true;
+      }
+   }
+   return result;
+}
+
+void ossimFgdcXmlDoc::close()
+{
+   m_xmlFilename = ossimFilename::NIL;
+   m_xmlDocument = 0;
+   m_projection  = 0;
+}
+
+ossimRefPtr<ossimProjection> ossimFgdcXmlDoc::getProjection()
+{
+   if ( (m_projection.valid() == false) && isOpen() )
+   {
+      ossimString projName;
+      if ( getProjCsn(projName) )
+      {
+         if (!projName.empty())
+         {
+            m_projection = ossimEpsgProjectionFactory::instance()->createProjection(projName);
+            
+            if ( m_projection.valid() )
+            {
+               ossimDpt gsd;
+               gsd.makeNan();
+               ossim_float64 d;
+               if ( getXRes(d) )
+               {
+                  gsd.x = std::fabs(d);
+               }
+               if ( getYRes(d) )
+               {
+                  gsd.y = std::fabs(d);
+               }
+               ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(m_projection.get());
+               if (mapProj)
+               {
+                  ossimDrect rect;
+                  getBoundingBox(rect);
+                  if (mapProj->isGeographic())
+                  {
+                     ossimGpt tie(rect.ul().lat, rect.ul().lon);
+                     mapProj->setUlTiePoints(tie);
+                     mapProj->setDecimalDegreesPerPixel(gsd);
+                  }
+                  else
+                  {
+                     ossimDpt tie(rect.ul().x, rect.ul().y);
+                     ossimUnitType unitType = getUnitType();
+                     if ( unitType == OSSIM_US_SURVEY_FEET)
+                     {
+                        gsd = gsd * US_METERS_PER_FT;
+                        tie = tie * US_METERS_PER_FT;
+                     }
+                     else if ( unitType == OSSIM_FEET )
+                     {
+                        gsd = gsd * MTRS_PER_FT;
+                        tie = tie * MTRS_PER_FT;
+                     }
+                        
+                     mapProj->setUlTiePoints(tie);
+                     mapProj->setMetersPerPixel(gsd);
+                  }
+               }
+            }
+         }
+      }
+   }
+   return m_projection;
+}
+
+ossimUnitType ossimFgdcXmlDoc::getUnitType() const
+{
+   ossimUnitType result = OSSIM_METERS; // default
+   ossimString units;
+   if ( getPlanarDistantUnits(units) )
+   {
+      units.downcase();
+      if ( units.contains("feet") )
+      {
+         if ( units.contains("international") )
+         {
+            result = OSSIM_FEET;
+         }
+         else
+         {
+            result = OSSIM_US_SURVEY_FEET; // Default for feet.
+         }
+      }
+   }
+   return result;
+}
+
+bool ossimFgdcXmlDoc::isOpen() const
+{
+   return m_xmlDocument.valid();
+}
+
+bool ossimFgdcXmlDoc::getGeoCsn(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/horizsys/cordsysn/geogcsn";
+   return getPath(xpath, s);
+}
+
+bool ossimFgdcXmlDoc::getProjCsn(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/horizsys/cordsysn/projcsn";
+   return getPath(xpath, s);
+}
+
+bool ossimFgdcXmlDoc::getAltitudeDistantUnits(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/vertdef/altsys/altunits";
+   return getPath(xpath, s);
+}
+
+bool ossimFgdcXmlDoc::getGridCoordinateSystem(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/horizsys/planar/gridsys/gridsysn";
+   return getPath(xpath, s);
+}
+
+ossimRefPtr<ossimProjection> ossimFgdcXmlDoc::getGridCoordSysProjection()
+{
+   static const char M[] = "ossimFgdcXmlDoc::getGridCoordSysProjection";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+
+   if ( m_projection.valid() == false )
+   {
+      ossimString s;
+      if ( getGridCoordinateSystem(s) )
+      {
+         ossimString gridsysn = s.downcase();
+         if ( getHorizontalDatum(s) )
+         {
+            ossimString horizdn = s.downcase();
+            const ossimDatum* datum = createOssimDatum(s); // throws exception
+            
+            if ( gridsysn == "universal transverse mercator" )
+            {
+               // Get the zone:
+               if ( getUtmZone(s) )
+               {
+                  ossim_int32 zone = s.toInt32();
+
+                  //---
+                  // Note: Contruct with an origin with our datum.
+                  // "proj->setDatum" does not change the origin's datum.
+                  // This ensures theossimEpsgProjectionDatabase::findProjectionCode
+                  // sets the psc code correctly down the line.
+                  //---
+                  ossimRefPtr<ossimUtmProjection> utmProj =
+                     new ossimUtmProjection( *(datum->ellipsoid()), ossimGpt(0.0,0.0,0.0,datum) );
+                  utmProj->setDatum(datum);
+                  utmProj->setZone(zone);
+                  
+                  // Hemisphere( North false easting = 0.0, South = 10000000):
+                  bool tmpResult = getUtmFalseNorthing(s);
+                  if ( tmpResult && ( s != "0.0" ) )
+                  {
+                     utmProj->setHemisphere('S');
+                  }
+                  else
+                  {
+                     utmProj->setHemisphere('N');
+                  }
+                  utmProj->setPcsCode(0);
+
+                  ossim_float64 xRes = 0.0;
+                  ossim_float64 yRes = 0.0;
+                  if (getXRes(xRes) && getYRes(yRes))
+                  {
+                     ossimDrect rect;
+                     getBoundingBox(rect);
+
+                     ossimDpt gsd(std::fabs(xRes), std::fabs(yRes));
+                     ossimUnitType unitType = getUnitType();
+                   
+                     if (m_boundInDegree)
+                     {
+                        ossimGpt tieg(rect.ul().lat, rect.ul().lon);
+                        utmProj->setUlTiePoints(tieg);
+                     }
+                     else
+                     {
+                        ossimDpt tie(rect.ul().x, rect.ul().y);
+                        if ( unitType == OSSIM_US_SURVEY_FEET)
+                        {
+                           tie = tie * US_METERS_PER_FT;
+                        }
+                        else if ( unitType == OSSIM_FEET )
+                        {
+                           tie = tie * MTRS_PER_FT;
+                        }
+                        utmProj->setUlTiePoints(tie);
+                     }
+
+                     if ( unitType == OSSIM_US_SURVEY_FEET)
+                     {
+                        gsd = gsd * US_METERS_PER_FT;
+                     }
+                     else if ( unitType == OSSIM_FEET )
+                     {
+                        gsd = gsd * MTRS_PER_FT;
+                     }
+                     utmProj->setMetersPerPixel(gsd);
+                  }
+                  m_projection = utmProj.get(); // Capture projection.
+               }
+               else
+               {
+                  std::string errMsg = M;
+                  errMsg += " ERROR: Could not determine utm zone!";
+                  throw ossimException(errMsg);
+               }
+            }
+         }
+      }
+   }
+   
+   if ( traceDebug() )
+   {
+      if ( m_projection.valid() )
+      {
+         m_projection->print(ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exiting...\n";
+   }
+   return m_projection;
+}
+
+
+bool ossimFgdcXmlDoc::getHorizontalDatum(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/horizsys/geodetic/horizdn";
+   return getPath(xpath, s);
+}
+
+bool ossimFgdcXmlDoc::getPlanarDistantUnits(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/horizsys/planar/planci/plandu";
+   return getPath(xpath, s);
+}
+
+bool ossimFgdcXmlDoc::getUtmFalseNorthing(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/horizsys/planar/gridsys/utm/transmer/fnorth";
+   return getPath(xpath, s); 
+}
+
+bool ossimFgdcXmlDoc::getUtmZone(ossimString& s) const
+{
+   ossimString xpath = "/metadata/spref/horizsys/planar/gridsys/utm/utmzone";
+   return getPath(xpath, s); 
+}
+
+bool ossimFgdcXmlDoc::getXRes(ossim_float64& v) const
+{
+   ossimString xpath = "/metadata/spdoinfo/rastinfo/rastxsz";
+   if (getPath(xpath, v) == false)
+   {
+      xpath = "/metadata/spref/horizsys/planar/planci/coordrep/absres";
+   }
+   return getPath(xpath, v);
+}
+
+bool ossimFgdcXmlDoc::getYRes(ossim_float64& v) const
+{
+   ossimString xpath = "/metadata/spdoinfo/rastinfo/rastysz";
+   if (getPath(xpath, v) == false)
+   {
+      xpath = "/metadata/spref/horizsys/planar/planci/coordrep/ordres";
+   }
+   return getPath(xpath, v);
+}
+
+bool ossimFgdcXmlDoc::getImageSize(ossimIpt& size) const
+{
+   bool result = false;
+   if (  m_xmlDocument.valid() )
+   {
+      ossimString xpath = "/metadata/spatRepInfo/GridSpatRep/axDimProps/Dimen/dimSize";
+      vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
+      m_xmlDocument->findNodes(xpath, xml_nodes);
+      if (xml_nodes.size() > 1)
+      {
+         size.x = xml_nodes[0]->getText().toInt32();
+         size.y = xml_nodes[1]->getText().toInt32();
+         result = true;
+      }
+
+      if (result == false)
+      {
+         xpath = "/metadata/spdoinfo/rastinfo/colcount";
+         ossim_float64 x = 0.0;
+         result = getPath(xpath, x);
+         if (result)
+         {
+            size.x = (ossim_int32)x;
+         }
+         xpath = "/metadata/spdoinfo/rastinfo/rowcount";
+         ossim_float64 y = 0.0;
+         result = getPath(xpath, y);
+         if (result)
+         {
+            size.y = (ossim_int32)y;
+         }
+      }
+   }
+   return result;
+}
+
+void ossimFgdcXmlDoc::getBoundingBox(ossimDrect& rect) const
+{
+   rect.makeNan();
+   
+   if (isOpen())
+   {
+      double ll_lat = 0.0;
+      double ll_lon = 0.0;
+      double lr_lat = 0.0;
+      double lr_lon = 0.0;
+      double ul_lat = 0.0;
+      double ul_lon = 0.0;
+      double ur_lat = 0.0;
+      double ur_lon = 0.0;
+     
+      ossimString xpath = "/metadata/idinfo/spdom/lboundng/leftbc";
+      bool result = getPath(xpath, ul_lon);
+      if (!result)
+      {
+         xpath = "/metadata/idinfo/spdom/bounding/westbc";
+         result = getPath(xpath, ul_lon);
+         m_boundInDegree = true;
+      }
+      if (result)
+      {
+         ll_lon = ul_lon;
+      }
+      
+      xpath = "/metadata/idinfo/spdom/lboundng/rightbc";
+      result = getPath(xpath, ur_lon);
+      if (!result)
+      {
+         xpath = "/metadata/idinfo/spdom/bounding/eastbc";
+         result = getPath(xpath, ur_lon);
+         m_boundInDegree = true;
+      }
+      if (result)
+      {
+         lr_lon = ur_lon;
+      }
+
+      xpath = "/metadata/idinfo/spdom/lboundng/bottombc";
+      result = getPath(xpath, ll_lat);
+      if (!result)
+      {
+         xpath = "/metadata/idinfo/spdom/bounding/southbc";
+         result = getPath(xpath, ll_lat);
+         m_boundInDegree = true;
+      }
+      if (result)
+      {
+         lr_lat = ll_lat;
+      }
+
+      xpath = "/metadata/idinfo/spdom/lboundng/topbc";
+      result = getPath(xpath, ul_lat);
+      if (!result)
+      {
+         xpath = "/metadata/idinfo/spdom/bounding/northbc";
+         result = getPath(xpath, ul_lat);
+         m_boundInDegree = true;
+      }
+      if (result)
+      {
+         ur_lat = ul_lat;
+      }
+      
+      rect = ossimDrect(ossimDpt(ul_lon, ul_lat),
+                        ossimDpt(ur_lon, ur_lat),
+                        ossimDpt(lr_lon, lr_lat),
+                        ossimDpt(ll_lon, ll_lat), OSSIM_RIGHT_HANDED); 
+   }
+}
+
+ossim_uint32 ossimFgdcXmlDoc::getNumberOfBands()
+{
+   ossim_uint32 numOfBands = 0;
+   ossimString s;
+   ossimString xpath = "/metadata/spdoinfo/rastinfo/vrtcount";
+   if (getPath(xpath, s))
+   {
+      numOfBands = s.toInt();
+   }
+   return numOfBands;
+}
+
+bool ossimFgdcXmlDoc::getPath(const ossimString& path, ossimString& s) const
+{
+   static const char M[] = "ossimFgdcXmlDoc::getPath";
+   
+   bool result = false;
+   if ( m_xmlDocument.valid() )
+   {
+      std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
+      m_xmlDocument->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            s = xnodes[0]->getText();
+            result = true;
+         }
+         else
+         {
+            if(traceDebug())
+            {
+               
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << M << " ERROR:\n"
+                  << "Node not found: " << path
+                  << std::endl;
+            }
+         }
+      }
+      else if ( xnodes.size() == 0 )
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << M << " ERROR:\nNode not found: " << path
+               << std::endl;
+         }
+      }
+      else
+      {
+         if(traceDebug())
+         {
+            
+            ossimNotify(ossimNotifyLevel_WARN)
+               << M << " ERROR:\nMultiple nodes found: " << path << std::endl;
+         }
+      }
+   }
+   if (!result)
+   {
+      s.clear();
+   }
+   return result;      
+}
+   
+bool ossimFgdcXmlDoc::getPath(const ossimString& path, ossim_float64& v) const
+{
+   ossimString s;
+   bool result = getPath(path, s);
+   if ( result )
+   {
+      v = s.toFloat64();
+   }
+   return result;
+}
+
+const ossimDatum* ossimFgdcXmlDoc::createOssimDatum(const ossimString& s) const
+{
+   ossimString horizdn = s.downcase();
+   ossimString datumCode;
+   if ( horizdn == "north american datum of 1983" )
+   {
+      datumCode = "NAR-C";
+   }
+   else if ( horizdn == "north american datum of 1927" )
+   {
+      datumCode = "NAS-C";
+   }
+   else if ( horizdn == "wgs84")
+   {
+      datumCode = "WGE";
+   }
+   else
+   {
+      std::string errMsg = "ossimFgdcXmlDoc::createOssimDatum ERROR: Unhandled datum: ";
+      errMsg += horizdn.string();
+      throw ossimException(errMsg);
+   }
+   return ossimDatumFactoryRegistry::instance()->create(datumCode);   
+}
diff --git a/src/support_data/ossimGeoTiff.cpp b/src/support_data/ossimGeoTiff.cpp
new file mode 100644
index 0000000..879c6de
--- /dev/null
+++ b/src/support_data/ossimGeoTiff.cpp
@@ -0,0 +1,2183 @@
+//***************************************************************************
+// FILE: ossimGeoTiff.cpp
+//
+// License:  See top level LICENSE.txt file.
+//
+// Description:
+// 
+// Class definition for ossimGeoTiff which is designed to read and hold tag
+// information.
+//
+//***************************************************************************
+// $Id: ossimGeoTiff.cpp 21024 2012-05-30 08:45:13Z dburken $
+
+#include <ossim/support_data/ossimGeoTiff.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimErrorContext.h>
+#include <ossim/base/ossimGeoTiffCoordTransformsLut.h>
+#include <ossim/base/ossimGeoTiffDatumLut.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimTransMercatorProjection.h>
+#include <ossim/projection/ossimLambertConformalConicProjection.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+#include <ossim/projection/ossimEpsgProjectionDatabase.h>
+#include <ossim/projection/ossimStatePlaneProjectionInfo.h>
+#include <ossim/projection/ossimPolynomProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <ossim/base/ossimTieGptSet.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/base/ossimUnitTypeLut.h>
+#include <tiff.h>
+#include <tiffio.h>
+#include <xtiffio.h>
+#include <geotiff.h>
+#include <geo_normalize.h>
+#include <geovalues.h>
+#include <string.h>
+#include <iomanip>
+#include <iterator>
+#include <sstream>
+#include <cstdlib>
+
+static const ossimGeoTiffCoordTransformsLut COORD_TRANS_LUT;
+static const ossimGeoTiffDatumLut DATUM_LUT;
+OpenThreads::Mutex ossimGeoTiff::theMutex;
+
+#ifdef OSSIM_ID_ENABLED
+static const char OSSIM_ID[] = "$Id: ossimGeoTiff.cpp 21024 2012-05-30 08:45:13Z dburken $";
+#endif
+
+//---
+// Static trace for debugging
+//---
+static ossimTrace traceDebug("ossimGeoTiff:debug");
+
+// Prototype, defined at bottom of this file. ArcMAP 9.2 bug workaround.
+ossim_uint16 getMetersEquivalentHarnCode(ossim_uint16 feet_harn_code);
+
+//---
+// This was created to remove/hide "libgetiff/geo_normalize.h" in ossimGeoTiff.h.
+//---
+class ossimPrivateGtifDef
+{
+public:
+   ossimPrivateGtifDef()
+      : m_defs(0)
+   {}
+   ~ossimPrivateGtifDef()
+   {
+      if ( m_defs )
+      {
+         delete m_defs;
+         m_defs = 0;
+      }
+   }
+   GTIFDefn* m_defs;
+};
+
+//*************************************************************************************************
+// CONSTRUCTOR
+//*************************************************************************************************
+ossimGeoTiff::ossimGeoTiff()
+   :
+   theTiffPtr(0),
+   theGeoKeyOffset(0),
+   theGeoKeyLength(0),
+   theGeoKeysPresentFlag(false),
+   theZone(0),
+   theHemisphere("N"),
+   theDoubleParamLength(0),
+   theAsciiParamLength(0),
+   theProjectionName("unknown"),
+   theDatumName("unknown"),
+   theWidth(0),
+   theLength(0),
+   theBitsPerSample(0),
+   theModelType(0),
+   theRasterType(ossimGeoTiff::UNDEFINED),
+   theGcsCode(0),
+   theDatumCode(0),
+   theAngularUnits(0),
+   thePcsCode(0),
+   theCoorTransGeoCode(0),
+   theLinearUnitsCode(ossimGeoTiff::UNDEFINED),
+   theStdPar1(0.0),
+   theStdPar2(0.0),
+   theOriginLon(0.0),
+   theOriginLat(0.0),
+   theFalseEasting(0.0),
+   theFalseNorthing(0.0),
+   theScaleFactor(0.0),
+   thePrivateDefinitions(new ossimPrivateGtifDef())
+{
+}
+
+//*************************************************************************************************
+// CONSTRUCTOR
+//*************************************************************************************************
+ossimGeoTiff::ossimGeoTiff(const ossimFilename& file, ossim_uint32 entryIdx)
+   :
+   theTiffPtr(0),
+   theGeoKeyOffset(0),
+   theGeoKeyLength(0),
+   theGeoKeysPresentFlag(false),
+   theZone(0),
+   theHemisphere("N"),
+   theDoubleParamLength(0),
+   theAsciiParamLength(0),
+   theProjectionName("unknown"),
+   theDatumName("unknown"),
+   theWidth(0),
+   theLength(0),
+   theBitsPerSample(0),
+   theModelType(0),
+   theRasterType(ossimGeoTiff::UNDEFINED),
+   theGcsCode(0),
+   theDatumCode(0),
+   theAngularUnits(0),
+   thePcsCode(0),
+   theCoorTransGeoCode(0),
+   theLinearUnitsCode(ossimGeoTiff::UNDEFINED),
+   theStdPar1(0.0),
+   theStdPar2(0.0),
+   theOriginLon(0.0),
+   theOriginLat(0.0),
+   theFalseEasting(0.0),
+   theFalseNorthing(0.0),
+   theScaleFactor(0.0),
+   thePrivateDefinitions(new ossimPrivateGtifDef())
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimGeoTiff::ossimGeoTiff: Entered..." << std::endl;
+#ifdef OSSIM_ID_ENABLED
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimGeoTiff::ossimGeoTiff: OSSIM_ID =  "
+         << OSSIM_ID << endl;
+#endif      
+   }
+   
+   if(readTags(file, entryIdx) == false)
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_ERROR;
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimGeoTiff::ossimGeoTiff: "
+            << "Unable to reade tags."
+            << std::endl;
+      }
+      ossimNotify(ossimNotifyLevel_FATAL)
+         << "FATAL ossimGeoTiff::ossimGeoTiff: "
+         << "Unable to reade tags."
+         << std::endl;
+   }
+   if (traceDebug())
+   {
+      print(ossimNotify(ossimNotifyLevel_DEBUG));
+   }
+
+}
+
+ossimGeoTiff::~ossimGeoTiff()
+{
+   if(thePrivateDefinitions)
+   {
+      delete thePrivateDefinitions;
+      thePrivateDefinitions = 0;
+   }
+   if(theTiffPtr)
+   {
+      XTIFFClose(theTiffPtr);
+      theTiffPtr = 0;
+   }
+}
+
+int ossimGeoTiff::getPcsUnitType(ossim_int32 pcsCode) 
+{
+   int pcsUnits = ossimGeoTiff::UNDEFINED;
+   ossimUnitType units = OSSIM_UNIT_UNKNOWN; // default
+
+   // Need to instantiate a projection given the pcs code:
+   ossimMapProjection* proj = PTR_CAST(ossimMapProjection, 
+      ossimEpsgProjectionDatabase::instance()->findProjection(pcsCode));
+   if (proj)
+      units = proj->getProjectionUnits();
+   else   
+      return ossimGeoTiff::UNDEFINED;
+   
+   switch (units)
+   {
+      case OSSIM_METERS:
+         pcsUnits = ossimGeoTiff::LINEAR_METER;
+         break;
+      case OSSIM_FEET:
+         pcsUnits = ossimGeoTiff::LINEAR_FOOT;
+         break;
+      case OSSIM_US_SURVEY_FEET:
+         pcsUnits = ossimGeoTiff::LINEAR_FOOT_US_SURVEY;
+         break;
+      default:
+         break;
+   }
+
+   return pcsUnits;
+}
+
+#define EPSG_CODE_MAX 32767
+bool ossimGeoTiff::writeTags(TIFF* tifPtr,
+                             const ossimRefPtr<ossimMapProjectionInfo> projectionInfo,
+                             bool imagineNad27Flag)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+
+   const ossimMapProjection* mapProj = projectionInfo->getProjection();
+
+   if(!mapProj) return false;
+
+   GTIF* gtif = GTIFNew(tifPtr);
+
+    // Get some things we need throughout.
+   ossimGpt origin      = mapProj->origin();
+   double falseEasting  =  mapProj->getFalseEasting();
+   double falseNorthing =  mapProj->getFalseNorthing();
+   
+   ossimKeywordlist kwl;
+   mapProj->saveState(kwl);
+   const char* stdParallel1 = kwl.find(ossimKeywordNames::STD_PARALLEL_1_KW);
+   const char* stdParallel2 = kwl.find(ossimKeywordNames::STD_PARALLEL_2_KW);
+   const char* scaleFactor  = kwl.find(ossimKeywordNames::SCALE_FACTOR_KW);
+
+   bool gcsTypeSet = false;
+
+   //---
+   // Since using a pcs code is the easiest way to go, look for that first.
+   //---
+   ossim_int16 pcsCode = mapProj->getPcsCode();
+
+   //---
+   // Get the units now.  If user has overriden pcs units then go user defined
+   // projection by setting pcs code to 0.
+   //---
+   ossimString projName = mapProj->getClassName();
+   
+   int units = ossimGeoTiff::UNDEFINED;
+   if(mapProj->isGeographic())
+      units = ossimGeoTiff::ANGULAR_DEGREE;
+   else
+      units = getPcsUnitType(pcsCode);
+   if (units == UNDEFINED)
+      units = LINEAR_METER;
+
+   if (pcsCode)
+   {
+      if ((units==LINEAR_FOOT_US_SURVEY) || (units==LINEAR_FOOT))
+      {
+         // ArcMap 9.2 bug workaround (originally implemented by ESH 2008, reworked by OLK 04/2010
+         ossim_uint16 meter_pcs = getMetersEquivalentHarnCode(pcsCode);
+         if (meter_pcs)
+            pcsCode = meter_pcs;
+      }
+
+      //int gcs_code = mapProj->getGcsCode();
+      int datum_code = USER_DEFINED;
+      int ellipsoid_code = USER_DEFINED;
+      const ossimDatum* datum = mapProj->getDatum();
+      if (datum)
+      {
+         datum_code = (int) datum->epsgCode();
+         const ossimEllipsoid* ellipsoid = datum->ellipsoid();
+         if (ellipsoid)
+            ellipsoid_code = ellipsoid->getEpsgCode();
+      }
+      
+      if(mapProj->isGeographic())
+         GTIFKeySet(gtif, GeographicTypeGeoKey,    TYPE_SHORT, 1, pcsCode);
+
+      GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1, datum_code);
+      GTIFKeySet(gtif, ProjectionGeoKey ,       TYPE_SHORT, 1, pcsCode);
+      GTIFKeySet(gtif, GeogEllipsoidGeoKey,     TYPE_SHORT, 1, ellipsoid_code);
+      GTIFKeySet(gtif, ProjectedCSTypeGeoKey,   TYPE_SHORT, 1, pcsCode);
+   }
+   else
+   {
+      ossimString datumCode = "WGE";
+      ossimString datumName = "WGE";
+      // Attemp to get the datum code
+      const ossimDatum* datum = mapProj->getDatum();
+      if(datum)
+      {
+         datumCode = datum->code();
+         datumName = datum->name();
+      }
+
+      short gcs = USER_DEFINED;
+
+      if (datumCode == "WGE") gcs = GCS_WGS_84;
+      else if (datumCode == "WGD") gcs = GCS_WGS_72;
+      else if (datumCode == "NAR-C") gcs = GCS_NAD83;
+      else if (datumCode == "NAR") gcs = GCS_NAD83;
+      else if (datumCode == "NAS-C") gcs = GCS_NAD27;
+      else if (datumCode == "NAS") gcs = GCS_NAD27;
+      else if (datumCode == "ADI-M") gcs = GCS_Adindan;
+      else if (datumCode == "ARF-M") gcs = GCS_Arc_1950;
+      else if (datumCode == "ARS-M") gcs = GCS_Arc_1960;
+      else if (datumCode == "EUR-7" || datumCode == "EUR-M") gcs = GCS_ED50;
+      else if ((datumCode == "OGB-7") ||
+               (datumCode == "OGB-M") ||
+               (datumCode == "OGB-A") ||
+               (datumCode == "OGB-B") ||
+               (datumCode == "OGB-C") ||
+               (datumCode == "OGB-D")) gcs = GCS_OSGB_1936;
+      else if (datumCode == "TOY-M") gcs = GCS_Tokyo;
+      else if(datumCode == "6055") gcs = 3785; // this is a special google datum so we will give it a gcs code of 3785
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DATUM = " << datumCode << " tag not written " << std::endl
+               << "Please let us know so we can add it"          << std::endl;
+         }
+      }
+
+      // ***
+      // ERDAS Imagine < v8.7 has a NAD27 Conus Bug.  They are not using the
+      // proper GCS code.  They use user-defined fields and Geog citation tag to
+      // define.  Sucks!  It is an open issue at Leica.  This is a work around
+      // flag for this issue.
+      // ***
+      if((datumCode == "NAS-C") && imagineNad27Flag)
+      {
+         gcs = USER_DEFINED;
+
+         std::ostringstream os;
+         os << "IMAGINE GeoTIFF Support\nCopyright 1991 -  2001 by ERDAS, Inc. All Rights Reserved\n@(#)$RCSfile$ $Revision: 21024 $ $Date: 2012-05-30 04:45:13 -0400 (Wed, 30 May 2012) $\nUnable to match Ellipsoid (Datum) to a GeographicTypeGeoKey value\nEllipsoid = Clarke 1866\nDatum = NAD27 (CONUS)";
+
+         GTIFKeySet(gtif,
+                    GeogCitationGeoKey,
+                    TYPE_ASCII,
+                    1,
+                    os.str().c_str());
+
+         // User-Defined
+         GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1,
+                    KvUserDefined );
+         // User-Defined
+         GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT, 1,
+                    KvUserDefined );
+      }
+      else
+      {
+      GTIFKeySet( gtif, GeographicTypeGeoKey, TYPE_SHORT, 1, gcs );
+      gcsTypeSet = true;
+      }
+
+      // Write the projection parameters.
+
+      bool setFalseEastingNorthingFlag = false;
+      
+      if ( projName == "ossimUtmProjection" )
+      {
+         //---
+         // UTM tags needed example from the geo tiff spec page:
+         // ModelTiepointTag       = (0, 0, 0,  350807.4, 5316081.3, 0.0)
+         // ModelPixelScaleTag     = (100.0, 100.0, 0.0)
+         // GeoKeyDirectoryTag:
+         //       GTModelTypeGeoKey        =  1      (ModelTypeProjected)
+         //       GTRasterTypeGeoKey       =  1      (RasterPixelIsArea)
+         //       ProjectedCSTypeGeoKey    =  32660  (PCS_WGS84_UTM_zone_60N)
+         //       PCSCitationGeoKey        =  "UTM Zone 60 N with WGS84"
+         //
+         // NOTE:
+         // The "ProjectedCSTypeGeoKey" can be constructed using the map zone
+         // and the datum.
+         //---
+         const ossimUtmProjection* utmProjection = dynamic_cast<const ossimUtmProjection*>(mapProj);
+
+         // Attempt to get the pcs key.
+         int mapZone = utmProjection->getZone();
+         ossimString hemisphere = utmProjection->getHemisphere();
+         short projSysCode=0;
+
+         //---
+         // Use a projection code that does not imply a datum.
+         // See section "6.3.3.2 Projection Codes" for definition.
+         //
+         // NOTE: The ossim code does not use negative zones to discriminate between
+         // hemispheres. (drb 26 Oct. 2016)
+         //---
+         if ( hemisphere == "N" ) // Northern hemisphere.
+         {
+            projSysCode = 16000 + mapZone;
+         }
+         else // Southern hemisphere.
+         {
+            projSysCode = 16100 + mapZone;
+         }
+         
+         // Set the Projected Coordinate System Type to be user defined.
+         GTIFKeySet(gtif,
+                    ProjectedCSTypeGeoKey,
+                    TYPE_SHORT,
+                    1,
+                    USER_DEFINED);
+
+         if ( !gcsTypeSet )
+         {
+            // Set the geographic type to be user defined.
+            GTIFKeySet(gtif,
+                       GeographicTypeGeoKey,
+                       TYPE_SHORT,
+                       1,
+                       USER_DEFINED);
+         }
+         
+         // Set the ProjectionGeoKey in place of the ProjectedCSTypeGeoKey.
+         GTIFKeySet(gtif,
+                    ProjectionGeoKey,
+                    TYPE_SHORT,
+                    1,
+                    projSysCode);
+
+         std::ostringstream os;
+         os << "UTM Zone " << dec << mapZone << hemisphere.c_str()
+            << " with " << datumName << " datum";
+         
+         GTIFKeySet(gtif,
+                    PCSCitationGeoKey,
+                    TYPE_ASCII,
+                    1,
+                    os.str().c_str());
+         
+      } // End of "if ( projName == "ossimUtmProjection" )
+      
+      else if(projName == "ossimBngProjection")
+      {
+         // User-Defined
+         GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
+		    PCS_BRITISH_NATIONAL_GRID);//KvUserDefined );
+         
+         // User-Defined
+         GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1,
+		    KvUserDefined );
+         
+         GTIFKeySet(gtif,
+                    PCSCitationGeoKey,
+                    TYPE_ASCII,
+                    26,
+                    "PCS_British_National_Grid");
+         
+         GTIFKeySet(gtif,
+                    ProjCoordTransGeoKey,
+                    TYPE_SHORT,
+                    1,
+                    (uint16)CT_TransverseMercator);
+         
+         GTIFKeySet(gtif,
+		    ProjNatOriginLongGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.lond());
+         
+         GTIFKeySet(gtif,
+		    ProjNatOriginLatGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.latd());
+
+         setFalseEastingNorthingFlag = true;
+
+         double scale = ossimString(scaleFactor).toDouble();
+
+         GTIFKeySet(gtif,
+                    ProjScaleAtNatOriginGeoKey,
+                    TYPE_DOUBLE,
+                    1,
+                    scale);
+      }
+      else if( projName == "ossimSinusoidalProjection")
+      {
+         GTIFKeySet(gtif,
+                    ProjCoordTransGeoKey,
+                    TYPE_SHORT,
+                    1,
+                    (uint16)CT_Sinusoidal);
+         
+         GTIFKeySet(gtif,
+		    ProjNatOriginLongGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.lond());
+
+         GTIFKeySet(gtif,
+		    ProjNatOriginLatGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.latd());
+
+         setFalseEastingNorthingFlag = true;
+      }
+      else if( (projName == "ossimEquDistCylProjection")||
+               (projName == "ossimLlxyProjection"))
+      {
+         GTIFKeySet(gtif,
+		    ProjNatOriginLongGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.lond());
+         
+         GTIFKeySet(gtif,
+		    ProjNatOriginLatGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.latd());
+      }
+      else if ( (projName == "ossimLambertConformalConicProjection") ||
+                (projName == "ossimAlbersProjection") )
+      {
+         //---
+         // Lambert Conformal Conic:
+         // tags needed example from the geo tiff spec page:
+         // ModelTiepointTag     = (  80,  100, 0,  200000,  1500000, 0)
+         // ModelPixelScaleTag         = (1000, 1000, 0)
+         // GeoKeyDirectoryTag:
+         //       GTModelTypeGeoKey           =  1     (ModelTypeProjected)
+         //       GTRasterTypeGeoKey          =  1     (RasterPixelIsArea)
+         //       GeographicTypeGeoKey        =  4267  (GCS_NAD27)
+         //       ProjectedCSTypeGeoKey       =  32767 (user-defined)
+         //       ProjectionGeoKey            =  32767 (user-defined)
+         //       ProjLinearUnitsGeoKey       =  9001     (Linear_Meter)
+         //       ProjCoordTransGeoKey        =  8 (CT_LambertConfConic_2SP)
+         //            ProjStdParallel1GeoKey     =  41.333
+         //            ProjStdParallel2GeoKey     =  48.666
+         //            ProjCenterLongGeoKey       =-120.0
+         //            ProjNatOriginLatGeoKey     =  45.0
+         //            ProjFalseEastingGeoKey,    = 200000.0
+         //            ProjFalseNorthingGeoKey,   = 1500000.0
+         //
+         // NOTE: Albers Same as Lambert with the exception of the
+         //       ProjCoordTransGeoKey which is:  CT_AlbersEqualArea.
+         //---
+         
+         if (projName == "ossimLambertConformalConicProjection")
+         {
+            GTIFKeySet(gtif,
+                       ProjCoordTransGeoKey,
+                       TYPE_SHORT,
+                       1,
+                       (uint16)CT_LambertConfConic_2SP );
+         }
+         else // Albers
+         {
+            GTIFKeySet(gtif,
+                       ProjCoordTransGeoKey,
+                       TYPE_SHORT,
+                       1,
+                       (uint16)CT_AlbersEqualArea);
+         }
+         
+         // User-Defined
+         GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1,
+                    KvUserDefined );
+
+         // User-Defined
+         GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1,
+		    KvUserDefined );
+
+         double phi1 = ossimString(stdParallel1).toDouble();
+
+         GTIFKeySet(gtif,
+		    ProjStdParallel1GeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    phi1);  // 1st parallel
+
+         double phi2 = ossimString(stdParallel2).toDouble();
+
+         GTIFKeySet(gtif,
+		    ProjStdParallel2GeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    phi2);  // 2nd parallel
+
+         GTIFKeySet(gtif,
+		    ProjCenterLongGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.lond());  // Longitude at the origin.
+
+         GTIFKeySet(gtif,
+		    ProjNatOriginLatGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.latd());  // Origin
+
+         setFalseEastingNorthingFlag = true;
+
+      }  // End of Lambert.
+
+
+      else if ( projName == "ossimMercatorProjection" )
+      {
+         GTIFKeySet(gtif,
+                    ProjCoordTransGeoKey,
+                    TYPE_SHORT,
+                    1,
+                    (uint16)CT_Mercator);
+         
+         GTIFKeySet(gtif,
+		    ProjNatOriginLongGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.lond());
+
+         GTIFKeySet(gtif,
+		    ProjNatOriginLatGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.latd());
+
+         setFalseEastingNorthingFlag = true;
+
+         double scale = ossimString(scaleFactor).toDouble();
+
+         GTIFKeySet(gtif,
+                    ProjScaleAtNatOriginGeoKey,
+                    TYPE_DOUBLE,
+                    1,
+                    scale);
+      }
+      else if ( projName == "ossimTransMercatorProjection" )
+      {
+         //---
+         // Transverse Mercator ( no example in the geo tiff spec.
+         // Requires:
+         //    - latitude/longitude of the origin
+         //    - easting/northing of some tie point(line/sample 0,0)
+         //    - false easting/northing
+         //    - The scale factor.
+         //---
+
+         //---
+         // The easting/northing is the distance from the origin plus the
+         // false easting/northing.  In other words if line 0 is 5,000
+         // meters from the origin and the false northing is 5,000 meters,
+         // then the northing would be 10,000.  The same goes for the easting.
+         //---
+         GTIFKeySet(gtif,
+                    ProjCoordTransGeoKey,
+                    TYPE_SHORT,
+                    1,
+                    (uint16)CT_TransverseMercator);
+         
+         // User-Defined
+         GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, KvUserDefined );
+         
+         // User-Defined
+         GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1, KvUserDefined );
+         
+         GTIFKeySet(gtif,
+		    ProjNatOriginLongGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.lond());
+
+         GTIFKeySet(gtif,
+		    ProjNatOriginLatGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    origin.latd());
+
+         setFalseEastingNorthingFlag = true;
+
+         double scale = ossimString(scaleFactor).toDouble();
+
+         GTIFKeySet(gtif,
+                    ProjScaleAtNatOriginGeoKey,
+                    TYPE_DOUBLE,
+                    1,
+                    scale);
+      } // End of TM
+
+      if (setFalseEastingNorthingFlag == true)
+      {
+
+         GTIFKeySet(gtif,
+		    ProjFalseEastingGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    falseEasting);
+
+         GTIFKeySet(gtif,
+		    ProjFalseNorthingGeoKey,
+		    TYPE_DOUBLE,
+		    1,
+		    falseNorthing);
+      }
+   }
+
+   //---
+   // Set the model type and units.
+   //---
+   if (units == ossimGeoTiff::ANGULAR_DEGREE)
+   {
+      GTIFKeySet(gtif,
+         GTModelTypeGeoKey,
+         TYPE_SHORT,
+         1,
+         ModelTypeGeographic);
+
+      // Set the units key.
+      GTIFKeySet(gtif,
+         GeogAngularUnitsGeoKey,
+         TYPE_SHORT,
+         1,
+         units);
+   }
+   else
+   {
+      GTIFKeySet(gtif,
+         GTModelTypeGeoKey,
+         TYPE_SHORT,
+         1,
+         ModelTypeProjected);
+
+      // Set the units key.
+      GTIFKeySet(gtif,
+         ProjLinearUnitsGeoKey,
+         TYPE_SHORT,
+         1,
+         units);
+   }
+
+   // Set the ellipsoid major/minor axis.
+   GTIFKeySet(gtif,
+              GeogSemiMajorAxisGeoKey,
+              TYPE_DOUBLE,
+              1,
+              mapProj->getA());
+
+   GTIFKeySet(gtif,
+              GeogSemiMinorAxisGeoKey,
+              TYPE_DOUBLE,
+              1,
+              mapProj->getB());
+
+   // Set the pixel type.
+   if (projectionInfo->getPixelType() == OSSIM_PIXEL_IS_POINT)
+   {
+      // Tie point relative to center of pixel.
+      GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsPoint);
+   }
+   else
+   {
+      // Tie point relative to upper left corner of pixel
+      GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
+   }
+
+   //---
+   // Set the tie point and scale.
+   //---
+   double  tiePoints[6]  = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+   double  pixScale[3]   = { 0.0, 0.0, 0.0 };
+   switch (units)
+   {
+      case LINEAR_FOOT:
+      {
+         tiePoints[3]  = ossim::mtrs2ft(projectionInfo->ulEastingNorthingPt().x);
+         tiePoints[4]  = ossim::mtrs2ft(projectionInfo->ulEastingNorthingPt().y);
+         pixScale[0]   = ossim::mtrs2ft(projectionInfo->getMetersPerPixel().x);
+         pixScale[1]   = ossim::mtrs2ft(projectionInfo->getMetersPerPixel().y);
+         falseEasting  = ossim::mtrs2ft(falseEasting);
+         falseNorthing = ossim::mtrs2ft(falseNorthing);
+
+         break;
+      }
+      case LINEAR_FOOT_US_SURVEY:
+      {
+         tiePoints[3]  = ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().x);
+         tiePoints[4]  = ossim::mtrs2usft(projectionInfo->ulEastingNorthingPt().y);
+         pixScale[0]   = ossim::mtrs2usft(projectionInfo->getMetersPerPixel().x);
+         pixScale[1]   = ossim::mtrs2usft(projectionInfo->getMetersPerPixel().y);
+         falseEasting  = ossim::mtrs2usft(falseEasting);
+         falseNorthing = ossim::mtrs2usft(falseNorthing);
+         break;
+      }
+      case ANGULAR_DEGREE:
+      {
+         tiePoints[3] = projectionInfo->ulGroundPt().lond();
+         tiePoints[4] = projectionInfo->ulGroundPt().latd();
+         pixScale[0]  = projectionInfo->getDecimalDegreesPerPixel().x;
+         pixScale[1]  = projectionInfo->getDecimalDegreesPerPixel().y;
+         break;
+      }
+      case LINEAR_METER:
+      default:
+      {
+         tiePoints[3] = projectionInfo->ulEastingNorthingPt().x;
+         tiePoints[4] = projectionInfo->ulEastingNorthingPt().y;
+         pixScale[0]  = projectionInfo->getMetersPerPixel().x;
+         pixScale[1]  = projectionInfo->getMetersPerPixel().y;
+         break;
+      }
+
+   } // End of "switch (units)"
+
+   TIFFSetField( tifPtr, TIFFTAG_GEOTIEPOINTS,  6, tiePoints );
+   TIFFSetField( tifPtr, TIFFTAG_GEOPIXELSCALE, 3, pixScale );
+
+
+   GTIFWriteKeys(gtif); // Write out geotiff tags.
+   GTIFFree(gtif);
+
+   return true;
+}
+
+bool ossimGeoTiff::writeJp2GeotiffBox(const ossimFilename& tmpFile,
+                                      const ossimIrect& rect,
+                                      const ossimProjection* proj,
+                                       std::vector<ossim_uint8>& buf,
+                                       ossimPixelType pixelType )
+{
+   //---
+   // Snip from The "GeoTIFF Box" Specification for JPEG 2000 Metadata:
+   // This box contains a valid GeoTIFF image.  The image is "degenerate", in
+   // that it represents a very simple image with specific constraints:
+   // . the image height and width are both 1
+   // . the datatype is 8-bit
+   // . the colorspace is grayscale
+   // . the (single) pixel must have a value of 0 for its (single) sample
+   //
+   // NOTE: It also states little endian but I think libtiff writes whatever
+   // endianesss the host is.
+   //
+   // Also assuming class tiff for now.  Not big tiff.
+   //---
+   bool result = true;
+   
+   TIFF* tiff = XTIFFOpen(tmpFile.c_str(), "w");
+   if (tiff)
+   {
+      // Write the projection info out.
+      ossimMapProjection* mapProj = PTR_CAST(ossimMapProjection, proj);
+      if(mapProj)
+      {
+         ossimRefPtr<ossimMapProjectionInfo> projectionInfo
+	   = new ossimMapProjectionInfo(mapProj, ossimDrect(rect));
+
+         // Set the pixel type to point of area.
+         projectionInfo->setPixelType(pixelType);
+
+         // Write the geotiff keys.
+         ossimGeoTiff::writeTags(tiff, projectionInfo, false);
+      }
+
+      // Basic tiff tags.
+      TIFFSetField( tiff, TIFFTAG_IMAGEWIDTH, 1 );
+      TIFFSetField( tiff, TIFFTAG_IMAGELENGTH, 1 );
+      TIFFSetField( tiff, TIFFTAG_BITSPERSAMPLE, 8 );
+      TIFFSetField( tiff, TIFFTAG_SAMPLESPERPIXEL, 1 );
+      TIFFSetField( tiff, TIFFTAG_ROWSPERSTRIP, 1 );
+      TIFFSetField( tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG );
+      TIFFSetField( tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK );
+
+      // One pixel image:
+      ossim_uint8 pixel = 0;
+      TIFFWriteEncodedStrip( tiff, 0, (char *) &pixel, 1 );
+
+      TIFFWriteDirectory( tiff );
+      XTIFFClose( tiff );
+
+      // Get the size.  Note 16 bytes added for the JP2 UUID:
+      const std::vector<ossim_uint8>::size_type UUID_SIZE = 16;
+      const std::vector<ossim_uint8>::size_type BOX_SIZE = UUID_SIZE +
+         static_cast<std::vector<ossim_uint8>::size_type>(tmpFile.fileSize());
+
+      // Create the buffer.
+      buf.resize( BOX_SIZE );
+
+      if ( BOX_SIZE == buf.size() )
+      {
+         const ossim_uint8 GEOTIFF_UUID[UUID_SIZE] = 
+         {
+            0xb1, 0x4b, 0xf8, 0xbd,
+            0x08, 0x3d, 0x4b, 0x43,
+            0xa5, 0xae, 0x8c, 0xd7,
+            0xd5, 0xa6, 0xce, 0x03
+         };
+
+         // Copy the UUID.
+         std::vector<ossim_uint8>::size_type i;
+         for (i = 0; i < UUID_SIZE; ++i)
+         {
+            buf[i] = GEOTIFF_UUID[i];
+         }
+
+         // Copy the tiff.
+         std::ifstream str;
+         str.open(tmpFile.c_str(), ios::in | ios::binary);
+         if (str.is_open())
+         {
+            char ch;
+            for (; i < BOX_SIZE; ++i)
+            {
+               str.get(ch);
+               buf[i] = static_cast<ossim_uint8>(ch);
+            }
+         }
+      }
+      else
+      {
+         result = false;
+      }
+
+      // Remove the temp file.
+      tmpFile.remove();
+      
+   }
+   else
+   {
+      result = false;
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimGeoTiff::writeJp2GeotiffBox ERROR:\n"
+            << "Could not open " << tmpFile << std::endl;
+      }
+   }
+   return result;
+}
+
+bool ossimGeoTiff::readTags(const ossimFilename& file, ossim_uint32 entryIdx)
+{
+   bool result = false;
+   
+   TIFF* tiff = XTIFFOpen(file.c_str(), "r");
+   if(tiff)
+   {
+      result = readTags(tiff, entryIdx, true);
+   }
+
+   return result;
+}
+
+bool ossimGeoTiff::readTags(
+   TIFF* tiff, ossim_uint32 entryIdx, bool ownTiffPtrFlag)
+{
+   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(theMutex);
+
+   if ( !tiff )
+   {
+      return false;
+   }
+
+   if(!TIFFSetDirectory(tiff, (ossim_uint16)entryIdx))
+   {
+      return false;
+   }
+   
+   GTIF* gtif = GTIFNew(tiff);
+   if(!gtif)
+   {
+      return false;
+   }
+
+   if(theTiffPtr)
+   {
+      XTIFFClose(theTiffPtr);
+   }
+   theTiffPtr = tiff;
+   
+   if(thePrivateDefinitions->m_defs)
+   {
+      delete thePrivateDefinitions->m_defs;;
+   }
+   thePrivateDefinitions->m_defs = new GTIFDefn;
+   GTIFGetDefn(gtif, thePrivateDefinitions->m_defs);
+   ossim_uint32 idx = 0;
+   theGeoKeysPresentFlag = true;
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimGeoTiff::readTags: Raw Geotiff Tags are\n";
+      GTIFPrint(gtif,0,0);
+   }
+   if(TIFFGetField( theTiffPtr,
+                    TIFFTAG_IMAGELENGTH,
+                    &theLength ))
+   {
+   }
+   if(TIFFGetField( theTiffPtr,
+                    TIFFTAG_IMAGEWIDTH,
+                    &theWidth ))
+   {
+   }
+   theScaleFactor     = 0.0;
+   theModelType       = thePrivateDefinitions->m_defs->Model;
+   theGcsCode         = thePrivateDefinitions->m_defs->GCS;
+   thePcsCode         = thePrivateDefinitions->m_defs->PCS;
+   theDatumCode       = thePrivateDefinitions->m_defs->Datum;
+   theAngularUnits    = thePrivateDefinitions->m_defs->UOMAngle;
+   theLinearUnitsCode = thePrivateDefinitions->m_defs->UOMLength;
+
+   if (theAngularUnits == ANGULAR_DMS_HEMISPHERE || theAngularUnits == 9122)
+   {
+      //---
+      // Hack for bug, where the libgeotiff funtion GTIFGetDefn sets the angular units 
+      // incorrectly to ANGULAR_DMS_HEMISPHERE:
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << " WARNING ossimGeoTiff::addImageGeometry:"           
+            << "The angular units (key 2054) is set to ANGULAR_DMS_HEMISPHERE!"  
+            << "\nAssuming \"Angular_Degree\"..." << std::endl;
+      }
+      theAngularUnits = ANGULAR_DEGREE;  
+   }
+   
+#if 0
+   ossim_uint16 modelType;
+   if(GTIFKeyGet(gtif, GTModelTypeGeoKey, &modelType, 0, 1))
+   {
+      theModelType = (ModelType)modelType;
+   }
+#endif
+   if(GTIFKeyGet(gtif, GTRasterTypeGeoKey, &theRasterType, 0, 1))
+   {
+   }
+   
+#if 0
+   if(GTIFKeyGet(gtif, GeographicTypeGeoKey, &theGcsCode, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, GeogGeodeticDatumGeoKey, &theDatumCode, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, GeogAngularUnitsGeoKey, &theAngularUnits, 0, 1))
+   {
+   }
+#endif
+   
+   if (GTIFKeyGet(gtif, ProjectedCSTypeGeoKey, &thePcsCode, 0, 1))
+      parsePcsCode();
+   
+   //---
+   // ESH 2/2008 -- Handle geotiff's with state plane coordinate systems produced by ERDAS.
+   // They use the citation filed to specify the geometry (complete HACK by Erdas)
+   //---
+   else
+   {
+      const int CITATION_STRING_SIZE = 512;
+      char citationStr[CITATION_STRING_SIZE];
+      if ( GTIFKeyGet(gtif, GTCitationGeoKey,  &citationStr,
+                      0, CITATION_STRING_SIZE))
+      {
+         ossimString gTCitation = citationStr; // key 1026
+
+         // Extract state plane string from the citation key
+         ossimString projStrTemp =
+            gTCitation.afterRegExp( "Projection Name = " );
+         
+         ossimString projStr  = projStrTemp.beforeRegExp( "\n" );
+         if ( projStr.empty() == false )
+         {
+            ossimEpsgProjectionFactory* f = ossimEpsgProjectionFactory::instance();
+            ossimProjection* proj = f->createProjection(projStr);
+            ossimMapProjection* map_proj = PTR_CAST(ossimMapProjection, proj);
+            parseProjection(map_proj);
+         }
+      }  // End of "if(GTIFKeyGet(gtif, GTCitationGeoKey..."
+   }
+   
+   char* buf = 0;
+   theOriginLon = ossim::nan();
+   theOriginLat = ossim::nan();
+   if(GTIFKeyGet(gtif, PCSCitationGeoKey , &buf, 0, 1))
+   {
+      thePcsCitation = ossimString(buf);
+   }
+   GTIFKeyGet(gtif, ProjCoordTransGeoKey , &theCoorTransGeoCode, 0, 1);
+   for(idx = 0; idx < (ossim_uint32)thePrivateDefinitions->m_defs->nParms; ++idx)
+   {
+      switch(thePrivateDefinitions->m_defs->ProjParmId[idx])
+      {
+         case ProjStdParallel1GeoKey:
+         {
+            theStdPar1 = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjStdParallel2GeoKey:
+         {
+            theStdPar2 = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjOriginLongGeoKey:
+         {
+            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjOriginLatGeoKey:
+         {
+            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjFalseEastingGeoKey:
+         {
+            theFalseEasting = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjFalseNorthingGeoKey:
+         {
+            theFalseNorthing = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjCenterLongGeoKey:
+         {
+            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjCenterLatGeoKey:
+         {
+            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjFalseOriginLatGeoKey:
+         {
+            theOriginLat = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjFalseOriginLongGeoKey:
+	 case ProjStraightVertPoleLongGeoKey:
+         {
+            theOriginLon = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+         case ProjScaleAtNatOriginGeoKey:
+         {
+            theScaleFactor = thePrivateDefinitions->m_defs->ProjParm[idx];
+            break;
+         }
+      }
+   }
+   
+#if 0
+   if(GTIFKeyGet(gtif, ProjStdParallel1GeoKey, &theStdPar1, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, ProjStdParallel2GeoKey, &theStdPar2, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, ProjNatOriginLongGeoKey, &tempDouble, 0, 1))
+   {
+      theOriginLon = tempDouble;
+   }
+   else if(GTIFKeyGet(gtif, ProjOriginLongGeoKey, &tempDouble, 0, 1))
+   {
+      theOriginLon = tempDouble;
+   }
+   if(GTIFKeyGet(gtif, ProjNatOriginLatGeoKey, &tempDouble, 0, 1))
+   {
+      theOriginLat = tempDouble;
+   }
+   else if(GTIFKeyGet(gtif, ProjOriginLatGeoKey, &tempDouble, 0, 1))
+   {
+      theOriginLat = tempDouble;
+   }
+   if(GTIFKeyGet(gtif, ProjFalseEastingGeoKey, &theFalseEasting, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, ProjFalseNorthingGeoKey, &theFalseNorthing, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, ProjCenterLongGeoKey, &theCenterLon, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, ProjCenterLatGeoKey, &theCenterLat, 0, 1))
+   {
+   }
+   if(GTIFKeyGet(gtif, ProjScaleAtNatOriginGeoKey, &theScaleFactor, 0, 1))
+   {
+   }
+#endif
+   theScale.clear();
+   ossim_uint16 pixScaleSize = 0;
+   double* pixScale=0;
+   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOPIXELSCALE, &pixScaleSize, &pixScale))
+   {
+      theScale.insert(theScale.begin(), pixScale, pixScale+pixScaleSize);
+      if ( theModelType == ModelTypeGeographic )
+      {
+         // The origin latitude must be computed so as to achieve the proper horizontal scaling:
+         theOriginLat = ossim::acosd(theScale[1]/theScale[0]);
+      }
+   }
+   theTiePoint.clear();
+   ossim_uint16 tiePointSize = 0;
+   double* tiepoints=0;
+   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOTIEPOINTS,  &tiePointSize, &tiepoints))
+   {
+      theTiePoint.insert(theTiePoint.begin(), tiepoints, tiepoints+tiePointSize);
+ 
+      // ESH 05/2009 -- If the image is in a projected coordinate system, the
+      // tiepoints will be projected coordinates not lat/lon. Let's avoid setting
+      // the origin lon/lat to projected x/y. Fix for ticket #711.
+      //if ( theModelType == ModelTypeGeographic )
+      //{
+      //   if(ossim::isnan(theOriginLon) && 
+      //      (pixScaleSize > 1) &&
+      //      (tiePointSize > 3))
+      //   {
+      //      theOriginLon = tiepoints[3] - tiepoints[0] * pixScale[0]; 
+      //   }
+      //   
+      //   if(ossim::isnan(theOriginLat) && (pixScaleSize > 1) && (tiePointSize > 3))
+      //   {
+      //      theOriginLat = tiepoints[4] + tiepoints[1] * fabs(pixScale[1]);
+      //   }
+      //}
+   }
+   theModelTransformation.clear();
+   ossim_uint16 transSize = 0;
+   double* trans = 0;
+   
+   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOTRANSMATRIX, &transSize, &trans))
+   {
+      theModelTransformation.insert(theModelTransformation.begin(),
+                                    trans, trans+transSize);
+   }
+//    if(!theTiePoint.size()&&(theModelTransform.size()==16))
+//    {
+//       // for now we will stuff the tie point with the model transform tie points.
+//       theTiePoint.push_back(0.0);
+//       theTiePoint.push_back(0.0);
+//       theTiePoint.push_back(0.0);
+//       theTiePoint.push_back(theModelTransformation[3]); 
+//       theTiePoint.push_back(theModelTransformation[7]);
+//       theTiePoint.push_back(0.0);
+//    }
+   ossim_uint16 doubleParamSize = 0;
+   double* tempDoubleParam = 0;
+   theDoubleParam.clear();
+   if(TIFFGetField(theTiffPtr, TIFFTAG_GEODOUBLEPARAMS, &doubleParamSize, &tempDoubleParam))
+   {
+      theDoubleParam.insert(theDoubleParam.begin(),
+                            tempDoubleParam,
+                            tempDoubleParam+doubleParamSize);
+   }
+
+   char* tempAsciiParam=0;
+   theAsciiParam = "";
+	
+	// Note: this tag does not have the setting set to return the size
+	// so this call is only a 3 argument call without a size parameter
+	if(TIFFGetField(theTiffPtr, TIFFTAG_GEOASCIIPARAMS, &tempAsciiParam))
+   {
+      theAsciiParam = tempAsciiParam;
+   }
+
+   if(theGeoKeysPresentFlag)
+   {
+      setOssimProjectionName();  // Initialize the ossim projection name.
+      setOssimDatumName();       // Initialize the ossim datum name.
+   }
+
+   // commenting this out.  Frank mentioned the GTIFFGetDefn which in geo_normalize
+   // this should be all we need.
+   //
+#if 0  
+   /* 
+      ESH 05/2009: Replacing badly broken code for making 
+      use of TIFFTAG_GEODOUBLEPARAMS.
+
+      Read the geokey directory tag in order to see how 
+      the TIFFTAG_GEODOUBLEPARAMS are defined.
+
+      For structure of geokey directory, see:
+      http://www.remotesensing.org/geotiff/spec/geotiff2.4.html
+   */
+   ossim_uint16  gkdParamSize = 0;
+   ossim_uint16* gkdParams = 0;
+   if(TIFFGetField(theTiffPtr, TIFFTAG_GEOKEYDIRECTORY, &gkdParamSize, &gkdParams))
+   {
+      ossim_uint16 numKeys = gkdParams ? gkdParams[3] : 0;
+      ossim_uint16 key = 0;
+      for( key=0; key<numKeys; ++key )
+      {
+         ossim_uint16 loc = (key+1) * 4;
+         ossim_uint16 ind = gkdParams[loc+3];
+
+         if ( gkdParams[loc+1] == TIFFTAG_GEODOUBLEPARAMS && 
+              gkdParams[loc+2] == 1 && 
+              ind >= 0 && ind < doubleParamSize )
+         {
+            double dval = theDoubleParam[ind];
+            switch( gkdParams[loc] )
+            {
+               case ProjStdParallel1GeoKey:     theStdPar1       = dval; break;
+               case ProjStdParallel2GeoKey:     theStdPar2       = dval; break;
+               case ProjNatOriginLongGeoKey:    theOriginLon     = dval; break;
+               /* case ProjOriginLongGeoKey:       theOriginLon     = dval; break; (alias) */
+               case ProjNatOriginLatGeoKey:     theOriginLat     = dval; break;
+               /* case ProjOriginLatGeoKey:        theOriginLat     = dval; break; (alias) */
+               case ProjFalseEastingGeoKey:     theFalseEasting  = dval; break;
+               case ProjFalseNorthingGeoKey:    theFalseNorthing = dval; break;
+               case ProjCenterLongGeoKey:       theCenterLon     = dval; break;
+               case ProjCenterLatGeoKey:        theCenterLat     = dval; break;
+               case ProjScaleAtNatOriginGeoKey: theScaleFactor   = dval; break;
+               default: 
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_DEBUG)
+                        << "ossimGeoTiff::readTags: Unrecognized geokey directory entry."
+                        << "\ngeokey directory index = " << loc
+                        << "\ngeokey = " << gkdParams[loc]
+                        << "\ndouble array index = " << ind
+                        << "\ndval = " << dval
+                        << std::endl;
+                  }
+                  break;
+            }
+         }
+      }
+   }
+#endif
+
+   GTIFFree(gtif);
+
+   if (ownTiffPtrFlag == false)
+   {
+      //---
+      // Zero out the pointer so the destructor doesn't close it on some
+      // external code.
+      //---
+      theTiffPtr = 0;
+   }
+   
+   return true;
+}
+
+bool ossimGeoTiff::addImageGeometry(ossimKeywordlist& kwl, const char* prefix) const
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimGeoTiff::addImageGeometry: Entered............."
+         << std::endl;
+   }
+
+   // NOT SURE THIS IS A GOOD IDEA HERE. KEPT FOR LEGACY SAKE. (OLK 5/10)
+   if(theGcsCode == 3785)
+   {
+      ossimRefPtr<ossimProjection> proj = 
+         ossimProjectionFactoryRegistry::instance()->createProjection(ossimString("EPSG:3785"));
+      if(proj.valid())
+      {
+         proj->saveState(kwl, prefix);
+      }
+   }
+
+   //---
+   // Sanity check...
+   // NOTE: It takes six doubles to make one tie point ie:
+   // x,y,z,longitude,latitude,height or x,y,z,easting,northing,height
+   //---
+   if (theErrorStatus ||
+       (!usingModelTransform() &&
+        ( (theScale.size() < 2) && // no scale
+          ( theTiePoint.size() < 24) ) ) )//need at least 3 ties if no scale.
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimGeoTiff::addImageGeometry: Failed sanity check "
+            << std::endl;
+         if(theErrorStatus)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "for error status" << std::endl;
+         }
+         else if( theTiePoint.size()<5)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "for tie points, size = " <<  theTiePoint.size()
+               << std::endl;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "for scale" << std::endl;
+         }
+      }
+      return false;
+   }
+
+   double x_tie_point = 0.0;
+   double y_tie_point = 0.0;
+   ossim_uint32 tieCount = (ossim_uint32)theTiePoint.size()/6;
+
+   if( (theScale.size() == 3) && (tieCount == 1))
+   {
+      //---
+      // Shift the tie point to the (0, 0) position if it's not already.
+      //
+      // Note:
+      // Some geotiff writers like ERDAS IMAGINE set the "GTRasterTypeGeoKey"
+      // key to RasterPixelIsArea, then set the tie point to (0.5, 0.5).
+      // This really means "RasterPixelIsPoint" with a tie point of (0.0, 0.0).
+      // Anyway we will check for this blunder and attempt to do the right
+      // thing...
+      //---
+      x_tie_point = theTiePoint[3] - theTiePoint[0]*theScale[0];
+      y_tie_point = theTiePoint[4] + theTiePoint[1]*theScale[1];
+   }
+   else if(tieCount > 1)
+   {
+      //---
+      // Should we check the model type??? (drb)
+      // if (theModelType == ModelTypeGeographic)
+      //---
+      if(tieCount >= 4)
+      {
+         ossimTieGptSet tieSet;
+         getTieSet(tieSet);
+
+         if(tieCount > 4)
+         {
+            // create a cubic polynomial model
+            //ossimRefPtr<ossimPolynomProjection> proj = new ossimPolynomProjection;
+            //proj->setupOptimizer("1 x y x2 xy y2 x3 y3 xy2 x2y z xz yz");
+            ossimRefPtr<ossimBilinearProjection> proj = new ossimBilinearProjection;
+            proj->optimizeFit(tieSet);
+            proj->saveState(kwl, prefix);
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimGeoTiff::addImageGeometry: "
+                  << "Creating a Cubic polynomial projection" << std::endl;
+            }
+            
+            return true;
+            
+         }
+         else if(tieCount == 4)
+         {
+            // create a bilinear model
+
+            // Should we check the model type (drb)
+            // if (theModelType == ModelTypeGeographic)
+            
+            ossimRefPtr<ossimBilinearProjection> proj = new ossimBilinearProjection;
+            proj->optimizeFit(tieSet);
+            proj->saveState(kwl, prefix);
+            
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimGeoTiff::addImageGeometry: "
+                  << "Creating a bilinear projection" << std::endl;
+            }
+           return true;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimGeoTiff::addImageGeometry: "
+               << "Not enough tie points to create a interpolation model"
+               <<std::endl;
+         }
+         return false;
+      }
+   }
+   else if (usingModelTransform())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimGeoTiff::addImageGeometry: Do not support rotated "
+            << "map models yet.  You should provide the image as a sample "
+            << "and we will fix it" << std::endl;
+      }
+   }
+  
+   if ((theRasterType == PIXEL_IS_AREA))
+   {
+      // Since the internal pixel representation is "point", shift the
+      // tie point to be relative to the center of the pixel.
+      if (theScale.size() > 1)
+      {
+         x_tie_point += (theScale[0])/2.0;
+         y_tie_point -= (theScale[1])/2.0;
+      }
+   }
+
+   if( thePcsCode && (thePcsCode != USER_DEFINED) )
+   {
+      ossimString epsg_spec ("EPSG:");
+      epsg_spec += ossimString::toString(thePcsCode);
+      ossimRefPtr<ossimProjection> proj = 
+         ossimEpsgProjectionFactory::instance()->createProjection(epsg_spec);
+      if (proj.valid())
+      {
+         proj->saveState(kwl, prefix);
+      }
+      // Should be some else "WARNING" here maybe. (drb)
+   }
+   else if (getOssimProjectionName() == "unknown")
+   {
+      //---
+      // Get the projection type.  If unknown no point going on, so get out.
+      //---
+      return false;
+   }
+   else
+   {
+      // No PCS code but we do have a projection name
+      // Add these for all projections.
+      kwl.add(prefix, ossimKeywordNames::TYPE_KW, getOssimProjectionName());
+      kwl.add(prefix, ossimKeywordNames::DATUM_KW, getOssimDatumName());
+   }
+
+   // Now set the image-specific projection info (scale and image tiepoint):
+   if (theModelType == MODEL_TYPE_GEOGRAPHIC)
+   {
+      if (theAngularUnits != ANGULAR_DEGREE)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING ossimGeoTiff::addImageGeometry:"
+            << "\nNot coded yet for unit type:  "
+            << theAngularUnits << endl;
+         return false;
+      }
+
+      //---
+      // Tiepoint
+      // Have data with tie points -180.001389 so use ossimGpt::wrap() to handle:
+      //---
+      ossimGpt tieGpt(y_tie_point, x_tie_point, 0.0);
+      tieGpt.wrap();
+      ossimDpt tiepoint(tieGpt);
+      kwl.add(prefix, ossimKeywordNames::TIE_POINT_XY_KW, tiepoint.toString(), true);
+      kwl.add(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW, "degrees", true);
+
+      // scale or gsd
+      if (theScale.size() > 1)
+      {
+         ossimDpt scale (theScale[0], theScale[1]);
+         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW, scale.toString(), true);
+         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW, "degrees", true);
+
+         // origin
+         if ( ossim::isnan(theOriginLat) )
+         {
+            //---
+            // Put the origin lat at the center of the image so the meters per
+            // pixel is somewhat real.
+            //---
+            double centerY = theLength/2.0;
+            theOriginLat = tieGpt.lat - theScale[1]*centerY;
+         }
+
+         if (  ossim::isnan(theOriginLon) )
+         {
+            theOriginLon = 0.0;
+         }
+      }
+      
+      if (!(ossim::isnan(theOriginLat) || ossim::isnan(theOriginLon)))
+      {
+         kwl.add(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW,  theOriginLat, true);
+         kwl.add(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW, theOriginLon, true);
+      }
+
+   }
+   else // Projected
+   {
+      // Tiepoint
+      ossimDpt tiepoint (convert2meters(x_tie_point),convert2meters(y_tie_point));
+      kwl.add(prefix, ossimKeywordNames::TIE_POINT_XY_KW, tiepoint.toString(), true);
+      kwl.add(prefix, ossimKeywordNames::TIE_POINT_UNITS_KW, "meters", true);
+
+      // scale or gsd
+      if (theScale.size() > 1)
+      {
+         ossimDpt scale (convert2meters(theScale[0]), convert2meters(theScale[1]));
+         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW, scale.toString(), true);
+         kwl.add(prefix, ossimKeywordNames::PIXEL_SCALE_UNITS_KW, "meters", true);
+      }
+      
+      // origin
+      if(!ossim::isnan(theOriginLat))
+         kwl.add(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW, theOriginLat);
+      if(!ossim::isnan(theOriginLon))
+         kwl.add(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW, theOriginLon);
+
+      // std paralles for conical projections
+      kwl.add(prefix, ossimKeywordNames::STD_PARALLEL_1_KW, theStdPar1);
+      kwl.add(prefix, ossimKeywordNames::STD_PARALLEL_2_KW, theStdPar2);
+      
+      // false easting and northing.
+      kwl.add(prefix, ossimKeywordNames::FALSE_EASTING_KW, convert2meters(theFalseEasting));
+      kwl.add(prefix, ossimKeywordNames::FALSE_NORTHING_KW, convert2meters(theFalseNorthing));
+
+      // Based on projection type, override/add the appropriate info.
+      if (getOssimProjectionName() == "ossimUtmProjection")
+      {
+         // Check the zone before adding...
+         if (theZone > 0 && theZone < 61)
+         {
+            kwl.add(prefix, ossimKeywordNames::ZONE_KW, theZone);
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimGeoTiff::addImageGeometry: "
+               << "UTM zone " << theZone << " out of range!\n"
+               << "Valid range:  1 to 60" << endl;
+            return false;
+         }
+
+         // Check the hemisphere before adding.
+         if (theHemisphere == "N" || theHemisphere == "S")
+         {
+            kwl.add(prefix, ossimKeywordNames::HEMISPHERE_KW, theHemisphere);
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimGeoTiff::addImageGeometry: "
+               << "UTM hemisphere " << theHemisphere << " is invalid!\n"
+               << "Valid hemisphere:  N or S" << std::endl;
+            return false;
+         }
+
+         //---
+         // Must set the central meridian even though the zone should do it.
+         // (in decimal degrees)
+         //---
+         double central_meridian = ( 6.0 * abs(theZone) ) - 183.0;
+         kwl.add(prefix, ossimKeywordNames::CENTRAL_MERIDIAN_KW, central_meridian, true);
+         kwl.add(prefix, ossimKeywordNames::ORIGIN_LATITUDE_KW, 0.0, true);
+
+      } // End of "if (UTM)"
+
+      else if (getOssimProjectionName() == "ossimTransMercatorProjection")
+         kwl.add(prefix, ossimKeywordNames::SCALE_FACTOR_KW, theScaleFactor, true); 
+
+   } // end of projected CS
+
+   //---
+   // Get the model transformation info if it's present.
+   //---
+   if (usingModelTransform())
+   {
+      std::vector<double> v = getModelTransformation();
+      std::ostringstream out;
+      out << std::setprecision(15); // To avoid truncating.
+      ossim_uint32 idx = 0;
+      for(idx =0; idx < 16; ++idx)
+      {
+         out << v[idx] << " ";
+      }
+      kwl.add(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW, out.str().c_str(), true);
+      ossimUnitType modelTransformUnitType = OSSIM_UNIT_UNKNOWN;
+      if(theModelType == ModelTypeGeographic)
+      {
+         switch(theAngularUnits)
+         {
+            case ANGULAR_DEGREE:
+               modelTransformUnitType = OSSIM_DEGREES;
+               break;
+            case ANGULAR_ARC_MINUTE:
+               modelTransformUnitType = OSSIM_MINUTES;
+               break;
+            case ANGULAR_ARC_SECOND:
+               modelTransformUnitType = OSSIM_SECONDS;
+               break;
+            default:
+               return false;
+         }
+      }
+      else if(theModelType == ModelTypeProjected)
+      {
+         switch(theLinearUnitsCode)
+         {
+            case LINEAR_METER:
+               modelTransformUnitType = OSSIM_METERS;
+               break;
+            default:
+               return false;
+         }
+      }
+      kwl.add(prefix, ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW,
+              ossimUnitTypeLut::instance()->getEntryString(modelTransformUnitType), true);
+   } 
+
+   if(theScaleFactor > 0.0)
+   {
+      kwl.add(prefix, ossimKeywordNames::SCALE_FACTOR_KW, theScaleFactor, true);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimGeoTiff::addImageGeometry: Keyword list dump:\n"
+         << kwl << std::endl;
+   }
+   
+   return true;
+}
+
+double ossimGeoTiff::convert2meters(double d) const
+{
+   switch(theLinearUnitsCode)
+   {
+   case LINEAR_METER:
+      return d;
+   case LINEAR_FOOT:
+      return ossim::ft2mtrs(d);
+   case LINEAR_FOOT_US_SURVEY:
+      return ossim::usft2mtrs(d);
+   default:
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimGeoTiff::convert2meters: " 
+            << "Linear units code was undefined!\n"
+            << "No conversion was performed." << std::endl;
+      }
+      break;
+   }
+   
+   return d;
+}
+
+ossimString ossimGeoTiff::getOssimProjectionName() const
+{
+   return theProjectionName;
+}
+
+void ossimGeoTiff::setOssimProjectionName()
+{
+   //---
+   // The "parsePcsCode" method can also set the projection name.  So check
+   // it prior to looking in the lookup table.
+   //---
+   if (theProjectionName == "unknown")
+   {
+      ossimString name =  COORD_TRANS_LUT.getEntryString(theCoorTransGeoCode);
+      
+      if (name.size())
+      {
+         theProjectionName = name;
+      }
+   }
+
+   // If still unknown check for the model type.
+   if (theProjectionName == "unknown")
+   {
+      if (theModelType == ModelTypeGeographic)
+      {
+         theProjectionName = "ossimEquDistCylProjection";
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimGeoTiff::setOssimProjectionName: "
+         << "theProjectionName:  "
+         << theProjectionName
+         << std::endl;
+   }
+   
+}
+
+ossimString ossimGeoTiff::getOssimDatumName() const
+{
+   return theDatumName;
+}
+
+void ossimGeoTiff::setOssimDatumName()
+{
+   //---
+   // The "parsePcsCode" method can also set the datum name.  So check
+   // it prior to trying to assign.
+   //---
+   if (theDatumName == "unknown")
+   {
+      ossimString name = DATUM_LUT.getEntryString(theDatumCode);
+      
+      if (!name.empty())
+      {
+         theDatumName = name;
+      }
+      else
+      {
+         // Try the GCS code.
+         name = DATUM_LUT.getEntryString(theGcsCode);
+         if (name.size())
+         {
+            theDatumName = name;
+         }
+      }
+   }
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimGeoTiff::setOssimDatumName: "
+         << "theDatumName:  "
+         << theDatumName
+         << std::endl;
+   } 
+}
+
+//*************************************************************************************************
+//! Initializes data members given a projection code. Returns TRUE if valid PCS code specified.
+//*************************************************************************************************
+bool ossimGeoTiff::parsePcsCode()
+{
+   // key 3072 Section 6.3.3.1 codes
+   ossimString epsg_spec (ossimString("EPSG:") + ossimString::toString(thePcsCode));
+   ossimRefPtr<ossimProjection> proj = 
+      ossimEpsgProjectionFactory::instance()->createProjection(epsg_spec);
+   ossimMapProjection* map_proj = PTR_CAST(ossimMapProjection, proj.get());
+   if (!parseProjection(map_proj))
+      thePcsCode = 0;
+
+   return (thePcsCode != 0);
+}
+
+//*************************************************************************************************
+//! Initializes data members given a projection.
+//*************************************************************************************************
+bool ossimGeoTiff::parseProjection(ossimMapProjection* map_proj)
+{
+   if (map_proj == NULL)
+      return false;
+
+   // Initialize parameters from base-class ossimMapProjection:
+   if (map_proj->isGeographic())
+   {
+      theModelType = ModelTypeGeographic;
+      theAngularUnits = ANGULAR_DEGREE;
+      theLinearUnitsCode = ANGULAR_DEGREE;
+   }
+   else
+      theModelType = ModelTypeProjected;
+
+   theProjectionName = map_proj->getProjectionName();
+   theFalseEasting   = map_proj->getFalseEasting();
+   theFalseNorthing  = map_proj->getFalseNorthing();
+   theStdPar1        = map_proj->getStandardParallel1();
+   theStdPar2        = map_proj->getStandardParallel2();
+   thePcsCode        = map_proj->getPcsCode();
+
+   // GCS code only defined for geographic projections and is basically the same as PCS in OSSIM:
+   theGcsCode = 0;
+   
+   ossimGpt origin (map_proj->origin());
+   theOriginLat      = origin.lat;
+   theOriginLon      = origin.lon;
+   
+   const ossimDatum* datum = map_proj->getDatum();
+   if (datum)
+   {
+      theDatumName  = datum->name();
+      theDatumCode  = datum->epsgCode();
+   }
+   
+   // Now intercept a select few that have additional parameters specific to their derived type:
+   if (map_proj->getProjectionName() == "ossimEquDistCylProjection")
+   {
+      theGcsCode = map_proj->getPcsCode();
+   }
+   else if (theProjectionName == "ossimUtmProjection")
+   {
+      ossimUtmProjection* utm_proj = PTR_CAST(ossimUtmProjection, map_proj);
+      theHemisphere = utm_proj->getHemisphere();
+      theScaleFactor = 0.9996; // UTM fixed
+      theZone = utm_proj->getZone();
+   }
+   else if (theProjectionName == "ossimTransMercatorProjection")
+   {
+      ossimTransMercatorProjection* tm_proj = PTR_CAST(ossimTransMercatorProjection, map_proj);
+      theScaleFactor = tm_proj->getScaleFactor();
+   }
+   else if (theProjectionName == "ossimBngProjection")
+   {
+      // ### LEGACY HACK ###
+      theDatumName = "OGB-M";
+      theFalseEasting = 400000.0;
+      theFalseNorthing = -100000.0;
+      theScaleFactor   = .9996012717;
+      theOriginLat     = 49.0;
+      theOriginLon     = -2.0;
+      theHemisphere    = "N";
+   }
+
+   return true;
+}
+
+int ossimGeoTiff::mapZone() const
+{
+   return theZone;
+}
+
+void ossimGeoTiff::getScale(std::vector<double>& scale) const
+{
+   scale = theScale;
+}
+
+void ossimGeoTiff::getTiePoint(std::vector<double>& tie_point) const
+{
+   tie_point = theTiePoint;
+}
+
+void ossimGeoTiff::getModelTransformation(std::vector<double>& transform) const
+{
+   transform = theModelTransformation;
+}
+
+const std::vector<double>& ossimGeoTiff::getScale() const
+{
+   return theScale;
+}
+
+ossimPixelType ossimGeoTiff::getRasterType() const
+{
+   if (theRasterType == PIXEL_IS_AREA)
+      return OSSIM_PIXEL_IS_AREA;
+
+   return OSSIM_PIXEL_IS_POINT;
+}
+
+const std::vector<double>& ossimGeoTiff::getTiePoint() const
+{
+   return theTiePoint;
+}
+
+const std::vector<double>& ossimGeoTiff::getModelTransformation() const
+{
+   return theModelTransformation;
+}
+
+int ossimGeoTiff::getWidth() const
+{
+   return theWidth;
+}
+
+int ossimGeoTiff::getLength() const
+{
+   return theLength;
+}
+
+std::ostream& ossimGeoTiff::print(std::ostream& out) const
+{
+   // Capture stream flags.
+   std::ios_base::fmtflags f = out.flags();
+   
+   out << setiosflags(ios::fixed) << setprecision(15)
+       << "ossimGeoTiff::print" << std::endl;
+
+   if (theScale.size())
+   {
+      std::vector<double>::const_iterator i = theScale.begin();
+      ossim_uint32 index = 0;
+      while ( i < theScale.end() )
+      {
+         out << "theScale[" << index << "]: " << (*i) << std::endl;
+         ++index;
+         ++i;
+      }
+   }
+   else
+   {
+      out << "theScale is empty..." << endl;
+   }
+   
+   if (theTiePoint.size())
+   {
+      std::vector<double>::const_iterator i = theTiePoint.begin();
+      ossim_uint32 index = 0;
+      while ( i < theTiePoint.end() )
+      {
+         out << "theTiePoint[" << index << "]: " << (*i) << std::endl;
+         ++index;
+         ++i;
+      }
+   }
+   else
+   {
+      out << "theTiePoint is empty..." << endl;
+   }
+
+   if (theModelTransformation.size())
+   {
+      std::vector<double>::const_iterator i = theModelTransformation.begin();
+      ossim_uint32 index = 0;
+      while ( i < theModelTransformation.end() )
+      {
+         out << "theModelTransformation[" << index << "]: "
+             << (*i) << std::endl;
+         ++index;
+         ++i;
+      }
+   }  
+   else
+   {
+      out << "theModelTransformation is empty..." << endl;
+   }
+
+   // Set the flags back.
+   out.flags(f);
+   
+   return out;
+}
+
+
+bool ossimGeoTiff::usingModelTransform() const
+{
+   //---
+   // If we have 16 model points do we always use them? (drb)
+   //
+   // In other word should the check just be if size == 16?
+   //--- 
+   if (getModelTransformation().size() == 16)
+   {
+      if (theScale.size() == 0)
+      {
+         // Need at least 24 (which is four ties) to use bilinear.
+         if (theTiePoint.size() < 24)
+         {
+            return true;
+         }
+      }
+   }
+   return false;
+}
+
+void ossimGeoTiff::getTieSet(ossimTieGptSet& tieSet) const
+{
+   ossim_uint32 idx = 0;
+   ossim_uint32 tieCount = (ossim_uint32)theTiePoint.size()/6;
+   const double* tiePointsPtr = &theTiePoint.front();
+   double offset = 0;
+   if (hasOneBasedTiePoints())
+   {
+      offset = -1.0;
+   }
+   
+   for(idx = 0; idx < tieCount; ++idx)
+   {
+      ossimDpt xyPixel(tiePointsPtr[0]+offset, tiePointsPtr[1]+offset);
+      // tie[3] = x, tie[4]
+      ossimGpt gpt(tiePointsPtr[4], tiePointsPtr[3], tiePointsPtr[5]);
+      
+      tieSet.addTiePoint(new ossimTieGpt(gpt, xyPixel, .5));
+      tiePointsPtr+=6;
+   }
+}
+
+bool ossimGeoTiff::hasOneBasedTiePoints() const
+{
+   bool result = false;
+   
+   // Assuming ties of (x,y,z,lat,lon,hgt) so size should be divide by 3.
+   if (theTiePoint.size()%6)
+   {
+      return result;
+   }
+   
+   ossim_float64 minX = 999999.0;
+   ossim_float64 minY = 999999.0;
+   ossim_float64 maxX = 0.0;
+   ossim_float64 maxY = 0.0;
+
+   const ossim_uint32 SIZE = (ossim_uint32)theTiePoint.size();
+   ossim_uint32 tieIndex = 0;
+
+   while (tieIndex < SIZE)
+   {
+      if ( theTiePoint[tieIndex]   < minX ) minX = theTiePoint[tieIndex];
+      if ( theTiePoint[tieIndex]   > maxX ) maxX = theTiePoint[tieIndex];
+      if ( theTiePoint[tieIndex+1] < minY ) minY = theTiePoint[tieIndex+1];
+      if ( theTiePoint[tieIndex+1] > maxY ) maxY = theTiePoint[tieIndex+1];
+      tieIndex += 6;
+   }
+
+   if ( (minX == 1) && (maxX == theWidth) &&
+        (minY == 1) && (maxY == theLength) )
+   {
+      result = true;
+   }
+
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimGeoTiff::hasOneBasedTiePoints DEBUG:"
+         << "\nminX:       " << minX
+         << "\nmaxX:       " << maxX
+         << "\nminY:       " << minY
+         << "\nmaxY:       " << maxY
+         << "\ntheWidth:   " << theWidth
+         << "\ntheLength:  " << theLength
+         << "\none based:  " << (result?"true":"false")
+         << std::endl;
+   }
+#endif
+   
+   return result;
+}
+
+//*************************************************************************************************
+// ArcMAP 9.2 bug workaround.
+// ESH 05/2008 -- ArcMap 9.2 compatibility hack
+// If the PCS code is for a HARN state plane and the implied pcs 
+// code's units is feet (us or intl), we find the equivalent code 
+// for units of meters.  We're doing this because ArcMap (9.2 and 
+// less) doesn't understand the non-meters HARN codes.  However, 
+// the units are left unchanged in this process, so the units can 
+// be different than the user-specified pcs code. ArcMap 9.2 
+// seems to understand the mixed definition just fine.
+// OLK 04/2010 -- Converted to vector<pair> scheme after refactoring EPSG factory. 
+//*************************************************************************************************
+ossim_uint16 getMetersEquivalentHarnCode(ossim_uint16 feet_harn_code)
+{
+   static const ossim_uint16 harn_feet[] =
+   {
+      2867, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 2877, 2878, 2879, 2880, 2881, 2882, 
+      2883, 2884, 2885, 2886, 2887, 2888, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2898, 2899, 2900, 
+      2901, 2902, 2903, 2904, 2905, 2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915, 2916, 
+      2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925, 2926, 2927, 2928, 2929, 2930, 2967, 2968
+   };
+   static const ossim_uint16 harn_meters[] =
+   {
+      2761, 2762, 2763, 2766, 2767, 2768, 2769, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2778, 
+      2779, 2780, 2781, 2787, 2788, 2789, 2798, 2799, 2804, 2805, 2806, 2807, 2808, 2809, 2813, 2814, 
+      2818, 2825, 2826, 2827, 2828, 2829, 2830, 2831, 2832, 2833, 2836, 2837, 2838, 2839, 2843, 2844, 
+      2845, 2846, 2847, 2848, 2849, 2850, 2851, 2853, 2854, 2855, 2856, 2859, 2860, 2861, 2792, 2793
+   };
+
+   ossim_uint16 result = 0;
+   int index = 0;
+   while ((result == 0) && (index < 64))
+   {
+      if (harn_feet[index] == feet_harn_code)
+         result = harn_meters[index];
+      ++index;
+   }
+   return result;
+};
+
diff --git a/src/support_data/ossimGmlSupportData.cpp b/src/support_data/ossimGmlSupportData.cpp
new file mode 100644
index 0000000..e2d6f66
--- /dev/null
+++ b/src/support_data/ossimGmlSupportData.cpp
@@ -0,0 +1,1445 @@
+//---
+//
+// License:  MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: GML support data object.
+// 
+//---
+// $Id$
+
+#include <ossim/support_data/ossimGmlSupportData.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimXmlAttribute.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimSensorModel.h>
+
+#include <iomanip>
+#include <sstream>
+
+static ossimTrace traceDebug("ossimGmlSupportData:debug");
+
+#define UNKNOWN_PCSCODE 32767
+
+ossimGmlSupportData::ossimGmlSupportData()
+   :
+   m_xmlDocument(0),
+   // m_use_gmljp2_version2(true), 
+   m_pcsCodeMap(UNKNOWN_PCSCODE),
+   m_pcsCodeGeo(UNKNOWN_PCSCODE),
+   m_srsNameStringMap("http://www.opengis.net/def/crs/EPSG/0/32767"),
+   m_srsNameStringGeo("http://www.opengis.net/def/crs/EPSG/0/32767"),
+   m_srsDimensionString("2"),
+   m_axisLabelsStringMap("X Y"),
+   m_axisLabelsStringGeo("Lat Long"),
+   m_uomLabelsStringMap("m m"),
+   m_uomLabelsStringGeo("deg deg")
+{
+}
+
+ossimGmlSupportData::~ossimGmlSupportData()
+{
+}
+
+bool ossimGmlSupportData::initialize( std::istream& in )
+{
+   bool status = false;
+   
+   if ( in.good() )
+   {
+      m_xmlDocument = new ossimXmlDocument();
+      m_xmlDocument->read( in );
+      status = true;
+   }
+   else
+   {
+      m_xmlDocument = 0;
+   }
+   
+   return status;
+}
+
+bool ossimGmlSupportData::initialize( const ossimImageGeometry* geom,
+                                      const ossimIrect& rect )
+{
+   static const char MODULE[] = "ossimGmlSupportData::initialize(geom)";
+   
+   bool status = false;
+   
+   if ( geom )
+   {
+      // ossim_uint32 code = UNKNOWN_PCSCODE; // unknown code
+       
+      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
+      if ( mapProj.valid() )
+      {
+         // Get the PCS code:
+         m_pcsCodeMap = mapProj->getPcsCode();
+         m_pcsCodeGeo = mapProj->getPcsCode();
+         
+         // Create an SRS Name for the map projection
+         std::ostringstream os;
+         os << "http://www.opengis.net/def/crs/EPSG/0/" << m_pcsCodeMap;
+         m_srsNameStringMap = os.str();
+         
+         // Create an SRS Name for the projection datum
+         std::ostringstream os2;
+         os2 << "http://www.opengis.net/def/crs/EPSG/0/" << m_pcsCodeGeo;
+         m_srsNameStringGeo = os2.str();
+         
+         m_xmlDocument = new ossimXmlDocument(ossimFilename::NIL);
+         
+         // if ( m_use_gmljp2_version2 == true )
+         // {
+
+         ossimRefPtr<ossimXmlNode> rootNode = getGmljp2V2RootNode();
+         m_xmlDocument->initRoot( rootNode );
+         status = configureGmljp2V2( rootNode, geom, rect );
+         // }
+         
+#if 0
+         else
+         {
+            ossimRefPtr<ossimXmlNode> rootNode = getGmljp2V1RootNode();
+            m_xmlDocument->initRoot( rootNode );
+            status = configureGmljp2V1( rootNode, geom, rect );
+         }
+#endif
+         
+         // cout << "gmljp2Node: " << *(gmljp2Node.get()) << endl;
+         
+         // cout << "xmlDoc: " << *(m_xmlDocument.get()) << endl;
+      }
+   }
+
+   if ( status == false )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG Entered...\n";
+      
+   }
+
+   return status;
+   
+} // End: ossimGmlSupportData::initialize( geom, mapProj )
+
+#if 0 
+bool ossimGmlSupportData::configureGmljp2V1( ossimRefPtr<ossimXmlNode> node0,
+                                             const ossimImageGeometry* geom )
+{
+   bool success = true;
+   const ossimString BLANK = "";
+
+   ossimString gridHighString;
+   ossimString gridLowString;
+   getLimits( geom, gridHighString, gridLowString );
+
+   configureBounds( node0, geom );
+
+   ossimString path = "rectifiedGridDomain";
+   ossimRefPtr<ossimXmlNode> node2 = node0->addChildNode( path, BLANK );
+
+   path = "RectifiedGrid";
+   ossimRefPtr<ossimXmlNode> node2a = node2->addChildNode( path, BLANK );
+
+   ossimRefPtr<ossimXmlAttribute> attr1 = new ossimXmlAttribute();
+   ossimString name = "dimension";
+   ossimString value = "2";
+   attr1->setNameValue( name, value );
+   node2a->addAttribute( attr1 );
+
+   path = "limit";
+   ossimRefPtr<ossimXmlNode> node2a1 = node2a->addChildNode( path, BLANK );
+
+   path = "GridEnvelope"; 
+   ossimRefPtr<ossimXmlNode> node2a1a = node2a1->addChildNode( path, BLANK );
+
+   path = "low";
+   ossimRefPtr<ossimXmlNode> node2a1a1 = node2a1a->addChildNode( path, gridLowString );
+
+   path = "high";
+   ossimRefPtr<ossimXmlNode> node2a1a2 = node2a1a->addChildNode( path, gridHighString );
+
+   return success;
+}
+#endif
+
+bool ossimGmlSupportData::configureGmljp2V2( ossimRefPtr<ossimXmlNode> node0,
+                                             const ossimImageGeometry* geom,
+                                             const ossimIrect& rect )
+{
+   bool success = false;
+
+   ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
+   if ( mapProj.valid() )
+   {
+      bool isGeographic = mapProj->isGeographic();
+      
+      const ossimString BLANK = "";
+      
+      ossimRefPtr<ossimXmlAttribute> attr(0);
+      ossimString name;
+      ossimString value;
+      
+      ossimString gridHighString;
+      ossimString gridLowString;
+      getLimits( rect, gridHighString, gridLowString );
+      
+      configureBounds( node0, geom, rect );
+      
+      ossimString path = "domainSet";
+      ossimRefPtr<ossimXmlNode> node2 =
+         node0->addChildNode( path, BLANK );
+      
+      path = "rangeSet";
+      ossimRefPtr<ossimXmlNode> node3 =
+         node0->addChildNode( path, BLANK );
+      
+      path = "File";
+      ossimRefPtr<ossimXmlNode> node3a =
+         node3->addChildNode( path, BLANK );
+      
+      path = "rangeParameters";
+      ossimRefPtr<ossimXmlNode> node3a1 =
+         node3a->addChildNode( path, BLANK );
+      
+      path = "fileName";
+      ossimRefPtr<ossimXmlNode> node3a2 =
+         node3a->addChildNode( path, "gmljp2://codestream" );
+      
+      path = "fileStructure";
+      ossimRefPtr<ossimXmlNode> node3a3 =
+         node3a->addChildNode( path, "inapplicable" );
+      
+      path = "gmlcov:rangeType";
+      ossimRefPtr<ossimXmlNode> node4 =
+         node0->addChildNode( path, BLANK );
+      
+      path = "gmljp2:featureMember";
+      ossimRefPtr<ossimXmlNode> node5 =
+         node0->addChildNode( path, BLANK );
+      
+      path = "gmljp2:GMLJP2RectifiedGridCoverage";
+      ossimRefPtr<ossimXmlNode> node5a =
+         node5->addChildNode( path, BLANK );
+
+      attr  = new ossimXmlAttribute();
+      name  = "gml:id";
+      value = "CodeStream_0";
+      attr->setNameValue( name, value );
+      node5a->addAttribute( attr );
+
+      path = "domainSet";
+      ossimRefPtr<ossimXmlNode> node5a1 =
+         node5a->addChildNode( path, BLANK );
+
+      path = "RectifiedGrid";
+      ossimRefPtr<ossimXmlNode> node5a1a =
+         node5a1->addChildNode( path, BLANK );
+
+      attr  = new ossimXmlAttribute();
+      name  = "gml:id";
+      value = "RG0001";
+      attr->setNameValue( name, value );
+      node5a1a->addAttribute( attr );
+
+      attr  = new ossimXmlAttribute();
+      name  = "dimension";
+      value = "2";
+      attr->setNameValue( name, value );
+      node5a1a->addAttribute( attr );
+
+      attr  = new ossimXmlAttribute();
+      name  = "srsName";
+      attr->setNameValue( name, m_srsNameStringMap );
+      node5a1a->addAttribute( attr );
+
+      path = "limits";
+      ossimRefPtr<ossimXmlNode> node5a1a1 =
+         node5a1a->addChildNode( path, BLANK );
+
+      path = "GridEnvelope";
+      ossimRefPtr<ossimXmlNode> node5a1a1a =
+         node5a1a1->addChildNode( path, BLANK );
+
+      path = "low";
+      ossimRefPtr<ossimXmlNode> node5a1a1a1 =
+         node5a1a1a->addChildNode( path, gridLowString );
+
+      path = "high";
+      ossimRefPtr<ossimXmlNode> node5a1a1a2 =
+         node5a1a1a->addChildNode( path, gridHighString );
+
+      path = "axisLabels";
+      ossimRefPtr<ossimXmlNode> node5a1a2 =
+         node5a1a->addChildNode( path, 
+                                 mapProj->isGeographic() ? 
+                                 m_axisLabelsStringGeo : m_axisLabelsStringMap );
+
+      path = "origin";
+      ossimRefPtr<ossimXmlNode> node5a1a3 =
+         node5a1a->addChildNode( path, BLANK );
+
+      path = "Point";
+      ossimRefPtr<ossimXmlNode> node5a1a3a =
+         node5a1a3->addChildNode( path, BLANK );
+
+      attr  = new ossimXmlAttribute();
+      name  = "gml:id";
+      value = "P0001";
+      attr->setNameValue( name, value );
+      node5a1a3a->addAttribute( attr );
+
+      attr  = new ossimXmlAttribute();
+      name  = "srsName";
+      attr->setNameValue( name, m_srsNameStringMap );
+      node5a1a3a->addAttribute( attr );
+
+      ossimString originString;
+      ossimString offsetVector1String;
+      ossimString offsetVector2String;
+      if ( isGeographic )
+      {
+         getGeoOrigin( geom, rect.ul(), originString,
+                       offsetVector1String, offsetVector2String );
+      }
+      else
+      {
+         getMapOrigin( geom, rect.ul(), originString,
+                       offsetVector1String, offsetVector2String );
+      }
+
+      path = "pos";
+      ossimRefPtr<ossimXmlNode> node5a1a3a1 =
+         node5a1a3a->addChildNode( path, originString );
+
+      path = "offsetVector";
+      ossimRefPtr<ossimXmlNode> node5a1a4 =
+         node5a1a->addChildNode( path, offsetVector1String );
+
+      attr  = new ossimXmlAttribute();
+      name  = "srsName";
+      attr->setNameValue( name, 
+                          (isGeographic ? m_srsNameStringGeo : m_srsNameStringMap ) );
+      node5a1a4->addAttribute( attr );
+
+      path = "offsetVector";
+      ossimRefPtr<ossimXmlNode> node5a1a5 =
+         node5a1a->addChildNode( path, offsetVector2String );
+
+      attr  = new ossimXmlAttribute();
+      name  = "srsName";
+      attr->setNameValue( name, (isGeographic ? m_srsNameStringGeo : m_srsNameStringMap) );
+      node5a1a5->addAttribute( attr );
+
+      path = "rangeSet";
+      ossimRefPtr<ossimXmlNode> node5a2 =
+         node5a->addChildNode( path, BLANK );
+
+      path = "File";
+      ossimRefPtr<ossimXmlNode> node5a2a =
+         node5a2->addChildNode( path, BLANK );
+
+      path = "rangeParameters";
+      ossimRefPtr<ossimXmlNode> node5a2a1 =
+         node5a2a->addChildNode( path, BLANK );
+
+      path = "fileName";
+      ossimRefPtr<ossimXmlNode> node5a2a2 =
+         node5a2a->addChildNode( path, "gmljp2://codestream" );
+
+      path = "fileStructure";
+      ossimRefPtr<ossimXmlNode> node5a2a3 =
+         node5a2a->addChildNode( path, "inapplicable" );
+
+      success = true;
+   }
+   
+   return success;
+}
+
+bool ossimGmlSupportData::configureBounds(
+   ossimRefPtr<ossimXmlNode> node0,
+   const ossimImageGeometry* geom,
+   const ossimIrect& rect)
+{
+   bool success = true;
+   const ossimString BLANK = "";
+
+   ossimString upperCornerString;         
+   ossimString lowerCornerString;
+   getGeoBounds( geom, rect, upperCornerString, lowerCornerString );
+
+   ossimString path = "boundedBy";
+   ossimRefPtr<ossimXmlNode> node1 = node0->addChildNode( path, BLANK );
+
+   path = "Envelope";
+   ossimRefPtr<ossimXmlNode> node1a = node1->addChildNode( path, BLANK );
+
+   ossimRefPtr<ossimXmlAttribute> attr( 0 );
+   ossimString name;
+
+   attr = new ossimXmlAttribute();
+   name = "srsName";
+   attr->setNameValue( name, m_srsNameStringGeo );
+   node1a->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();
+   name = "axisLabels";
+   attr->setNameValue( name, m_axisLabelsStringGeo );
+   node1a->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();
+   name = "uomLabels";
+   attr->setNameValue( name, m_uomLabelsStringGeo );
+   node1a->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();
+   name = "srsDimension";
+   attr->setNameValue( name, m_srsDimensionString );
+   node1a->addAttribute( attr );
+
+   path = "lowerCorner";
+   ossimRefPtr<ossimXmlNode> node1a1 =
+      node1a->addChildNode( path, lowerCornerString );
+
+   path = "upperCorner";
+   ossimRefPtr<ossimXmlNode> node1a2 =
+      node1a->addChildNode( path, upperCornerString );
+
+   return success;
+}
+
+ossimRefPtr<ossimXmlNode> ossimGmlSupportData::getGmljp2V2RootNode() const
+{
+   ossimRefPtr<ossimXmlNode> node = new ossimXmlNode();
+
+   ossimString os = "gmljp2:GMLJP2CoverageCollection";
+   node->setTag( os );
+
+   ossimRefPtr<ossimXmlAttribute> attr( 0 );
+   ossimString name;
+   ossimString value;
+
+   attr = new ossimXmlAttribute();
+   name = "gml:id";
+   value = "JPEG2000_0";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();
+   name = "xmlns";
+   value = "http://www.opengis.net/gml/3.2";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();   
+   name = "xmlns:gml";
+   value = "http://www.opengis.net/gml/3.2";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();   
+   name = "xmlns:gmlcov";
+   value = "http://www.opengis.net/gmlcov/1.0";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();   
+   name = "xmlns:gmljp2";
+   value = "http://www.opengis.net/gmljp2/2.0";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();     
+   name = "xmlns:xsi";
+   value = "http://www.w3.org/2001/XMLSchema-instance";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+      
+   attr = new ossimXmlAttribute();   
+   name = "xsi:schemaLocation";
+   value = "http://www.opengis.net/gmljp2/2.0 http://schemas.opengis.net/gmljp2/2.0/gmljp2.xsd";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   return node;
+   
+} // ossimGmlSupportData::getGmljp2V2Node()
+
+ossimRefPtr<ossimXmlNode> ossimGmlSupportData::getGmljp2V1RootNode() const
+{
+   ossimRefPtr<ossimXmlNode> node = new ossimXmlNode();
+
+   ossimString os = "gml:FeatureCollection";
+   node->setTag( os );
+
+   ossimRefPtr<ossimXmlAttribute> attr(0);
+   ossimString name;
+   ossimString value;
+   
+   attr = new ossimXmlAttribute();
+   name = "xmlns";
+   value = "http://www.opengis.net/gml";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();   
+   name = "xmlns:gml";
+   value = "http://www.opengis.net/gml";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   attr = new ossimXmlAttribute();     
+   name = "xmlns:xsi";
+   value = "http://www.w3.org/2001/XMLSchema-instance";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+      
+   attr = new ossimXmlAttribute();   
+   name = "xsi:schemaLocation";
+   value = "http://www.opengis.net/gml gmlJP2Profile.xsd";
+   attr->setNameValue( name, value );
+   node->addAttribute( attr );
+
+   return node;
+   
+} // ossimGmlSupportData::getGmljp2V1Node()
+
+bool ossimGmlSupportData::write(std::ostream& os)
+{
+   bool status = false;
+   
+   if ( m_xmlDocument.valid() )
+   {
+      os << *(m_xmlDocument.get());
+      
+      status = true;
+   }
+
+   return status;
+}
+
+ossimRefPtr<ossimXmlDocument> ossimGmlSupportData::getXmlDoc() const
+{
+   return m_xmlDocument;
+}
+
+bool ossimGmlSupportData::getImageGeometry( ossimKeywordlist& geomKwl ) const
+{
+   // Try for map projected geometry first...
+   bool success = getImageGeometryFromRectifiedGrid( geomKwl );
+   if ( !success )
+   {
+      // Look for sensor model block.
+      getImageGeometryFromSeonsorModel( geomKwl );
+   }
+
+   return success;
+}
+
+#if 0 /* Please leave.  (drb) */
+
+bool ossimGmlSupportData::getImageGeometry( ossimKeywordlist& geomKwl ) const
+{   
+   if ( m_xmlDocument.valid() )
+   {
+      vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
+      bool gotSensorImage    = false;
+      bool gotRectifiedImage = false;
+      ossim_uint32 pcsCodeGrid = 32767; // only applies to rectified
+
+      // Check the GMLJP2CoverageCollection attributes for the default namespace.
+      ossimString defaultNamespaceStr( "" );
+      ossimString xpath_root = "/gmljp2:GMLJP2CoverageCollection";
+      xml_nodes.clear();
+      m_xmlDocument->findNodes( xpath_root, xml_nodes );
+      if ( xml_nodes.size() == 0 ) 
+      {
+         // check if the default namespace is gmljp2
+         xpath_root = "/GMLJP2CoverageCollection";
+         m_xmlDocument->findNodes( xpath_root, xml_nodes );
+      }
+      if ( xml_nodes.size() >= 1 )
+      {
+         const ossimString defaultNamespaceIdentifierStr( "xmlns" );
+         ossimString defaultNamespacePrependStr = defaultNamespaceIdentifierStr + ":";
+
+         const ossimRefPtr<ossimXmlAttribute> defaultNamespaceAttribute = xml_nodes[0]->findAttribute( defaultNamespaceIdentifierStr );
+         ossimString defaultNamespaceSettingStr = defaultNamespaceAttribute->getValue();
+
+         // search for the attribute value in the other attributes
+         const ossimXmlNode::AttributeListType& attributeList = xml_nodes[0]->getAttributes();
+         size_t nAttributes = attributeList.size();
+         for ( size_t i=0; i<nAttributes; ++i )
+         {
+            const ossimRefPtr<ossimXmlAttribute> attribute = attributeList[i];
+         
+            const ossimString& attribute_name  = attribute->getName();
+            const ossimString& attribute_value = attribute->getValue();
+
+            if ( attribute_name  != defaultNamespaceIdentifierStr && 
+                 attribute_value == defaultNamespaceSettingStr )
+            {
+               defaultNamespaceStr = attribute_name.after( defaultNamespacePrependStr );
+               defaultNamespaceStr += ":";
+            }
+         }
+      }
+       
+      // Check for a sensor image
+      ossimString xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2ReferenceableGridCoverage/gml:domainSet/gmlcov:ReferenceableGridBySensorModel";
+      xpath0 = xpath0.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+      xml_nodes.clear();
+      m_xmlDocument->findNodes( xpath0, xml_nodes );
+      if ( xml_nodes.size() >= 1 )
+      {
+         // we've got a sensor model image
+         gotSensorImage = true;
+      }
+      else
+      {
+         const ossimString srsNameStr( "srsName" );
+         ossimString pcsCodeDefinitionStr( "http://www.opengis.net/def/crs/EPSG/0/" );
+
+         xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2RectifiedGridCoverage/gml:domainSet/gml:RectifiedGrid";
+         xpath0 = xpath0.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath0, xml_nodes );
+         if ( xml_nodes.size() >= 1 )
+         {
+            // we've got a rectified image
+            gotRectifiedImage = true;
+
+            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( srsNameStr );
+            const ossimString& originSrsName = hrefAttribute->getValue();
+            ossimString pcsCodeGridStr = originSrsName.after( pcsCodeDefinitionStr.string() );
+            pcsCodeGrid = pcsCodeGridStr.toUInt32();
+            if ( pcsCodeGrid != 32767 )
+            {
+               //---
+               // The ossimEpsgProjectionFactory will not pick up the origin latitude if code is
+               // 4326 (geographic) so we use the projection name; else, the origin_latitude will
+               // always be 0.  This is so the gsd comes out correct for scale.
+               //---
+               if ( pcsCodeGrid != 4326 ) // map projection
+               {
+                  // Add the pcs code.
+                  geomKwl.add( ossimKeywordNames::PCS_CODE_KW,
+                               pcsCodeGridStr.c_str() );
+               }
+               else // geographic
+               {
+                  geomKwl.add( ossimKeywordNames::TYPE_KW, 
+                               ossimString( "ossimEquDistCylProjection" ) );
+               }
+            }
+         }
+      }
+
+      // Number of lines & samples, for either sensor or rectified imagery
+
+      ossimString xpath_limits_low  = "/gml:limits/gml:GridEnvelope/gml:low";
+      ossimString xpath_limits_high = "/gml:limits/gml:GridEnvelope/gml:high";
+
+      xpath_limits_low  = xpath_limits_low.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+      xpath_limits_high = xpath_limits_high.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+
+      bool gotLow = false;
+      ossim_int32 lowX, lowY;
+      ossimString xpath = xpath0 + xpath_limits_low;
+      xml_nodes.clear();
+      m_xmlDocument->findNodes( xpath, xml_nodes );
+      if ( xml_nodes.size() == 1 )
+      {
+         const ossimString& lowerCorner = xml_nodes[0]->getText();
+         size_t spacePos = lowerCorner.find( ' ' );
+         ossimString lowerXString = lowerCorner.beforePos( spacePos );
+         ossimString lowerYString = lowerCorner.afterPos ( spacePos );
+         lowX = lowerXString.toInt32();
+         lowY = lowerYString.toInt32();
+         gotLow = true;
+      }
+
+      bool gotHigh = false;
+      ossim_int32 highX = 0;
+      ossim_int32 highY = 0;
+      xpath = xpath0 + xpath_limits_high;
+      xml_nodes.clear();
+      m_xmlDocument->findNodes( xpath, xml_nodes );
+      if ( xml_nodes.size() == 1 )
+      {
+         const ossimString& higherCorner = xml_nodes[0]->getText();
+         size_t spacePos = higherCorner.find( ' ' );
+         ossimString higherXString = higherCorner.beforePos( spacePos );
+         ossimString higherYString = higherCorner.afterPos ( spacePos );
+         highX = higherXString.toInt32();
+         highY = higherYString.toInt32();
+         gotHigh = true;
+      }
+
+      if ( gotHigh && gotLow )
+      {
+         geomKwl.add( ossimKeywordNames::NUMBER_LINES_KW,   highY - lowY + 1 );
+         geomKwl.add( ossimKeywordNames::NUMBER_SAMPLES_KW, highX - lowX + 1 );
+      }
+
+      if ( gotSensorImage )
+      {
+         const ossimString hrefStr( "xlink:href" );
+         const ossimString codeSpaceStr( "codeSpace" );
+
+         ossimString sensorModelHref( "" );
+         ossimString xpath_sensor_model = "/gmlcov:sensorModel";
+         xpath_sensor_model = xpath_sensor_model.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+         xpath = xpath0 + xpath_sensor_model;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         if ( xml_nodes.size() == 1 )
+         {
+            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( hrefStr );
+            sensorModelHref = hrefAttribute->getValue();
+         }
+
+         ossimString sensorInstanceHref( "" );
+         ossimString xpath_sensor_typeOf = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:typeOf";
+         xpath_sensor_typeOf = xpath_sensor_typeOf.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+         xpath = xpath0 + xpath_sensor_typeOf;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         if ( xml_nodes.size() == 1 )
+         {
+            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( hrefStr );
+            sensorInstanceHref = hrefAttribute->getValue();
+         }
+
+         ossimRefPtr<ossimSensorModel> sensor_model = 0;
+         ossimString xpath_sensor_name = "/gmlcov:sensorInstance/sml:SimpleProcess/gml:name";
+         xpath_sensor_name = xpath_sensor_name.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+         xpath = xpath0 + xpath_sensor_name;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         int nSensorNames = (int)xml_nodes.size();
+         for ( int i=0; i<nSensorNames; ++i )
+         {
+            const ossimString& sensorName = xml_nodes[i]->getText();
+
+            ossimProjectionFactoryRegistry* registry = ossimProjectionFactoryRegistry::instance();
+            ossimProjection* proj = registry->createProjection( sensorName );
+
+            // Is it a sensor model ?
+            sensor_model = dynamic_cast<ossimSensorModel*>( proj );
+            if ( sensor_model.valid() )
+            {
+               geomKwl.add( ossimKeywordNames::TYPE_KW, sensorName.c_str() );
+               break;
+            }
+         }
+         
+         if ( !sensor_model.valid() )
+         {
+            // Add debug message
+            return false;
+         }
+
+         // Check if the sensor instance is typeOf the sensor model
+         if ( sensorModelHref == sensorInstanceHref )
+         {
+            const ossimString refStr( "ref" );
+
+            // sml:setValue
+            ossimString xpath_setValue = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:configuration/sml:Settings/sml:setValue";
+            xpath_setValue = xpath_setValue.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+            xpath = xpath0 + xpath_setValue;
+            xml_nodes.clear();
+            m_xmlDocument->findNodes( xpath, xml_nodes );
+            size_t nXmlNodes = xml_nodes.size();
+            for( size_t i=0; i<nXmlNodes; ++i )
+            {
+               const ossimString& elementValue = xml_nodes[i]->getText();
+
+               const ossimRefPtr<ossimXmlAttribute> refAttribute = xml_nodes[i]->findAttribute( refStr );
+               const ossimString& settingsRef = refAttribute->getValue();
+
+               bool successSetValue = sensor_model->getImageGeometry( settingsRef, elementValue, geomKwl );
+               success &= successSetValue;
+               if ( !successSetValue )
+               {
+                  // Add debug message
+               }
+            }
+
+            /* sml:setArrayValues */
+            ossimString xpath_setArrayValues = "/gmlcov:sensorInstance/sml:SimpleProcess/sml:configuration/sml:Settings/sml:setArrayValues";
+            xpath_setArrayValues = xpath_setArrayValues.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+            xpath = xpath0 + xpath_setArrayValues;
+            xml_nodes.clear();
+            m_xmlDocument->findNodes( xpath, xml_nodes );
+            nXmlNodes = xml_nodes.size();
+            for( size_t i=0; i<nXmlNodes; ++i )
+            {
+               ossimString elementValue( "" );
+
+               const ossimRefPtr<ossimXmlAttribute> refAttribute = xml_nodes[i]->findAttribute( refStr );
+               const ossimString& settingsRef = refAttribute->getValue();
+
+               const ossimXmlNode::ChildListType& children = xml_nodes[i]->getChildNodes();
+               if ( children.size() > 0 )
+               {
+                  const ossimXmlNode::ChildListType& grandchildren = children[0]->getChildNodes();
+                   
+                  if ( (grandchildren.size() > 1) && (grandchildren[1]->getTag() == ossimString( "sml:value")) )
+                  {
+                     elementValue = grandchildren[1]->getText();
+                  }
+               }
+
+               bool successSetArrayValues = sensor_model->getImageGeometry( settingsRef, elementValue, geomKwl );
+               success &= successSetArrayValues;
+               if ( !successSetArrayValues )
+               {
+                  // Add debug message
+               }
+            }
+         }
+      }
+      else if ( gotRectifiedImage )
+      {
+         const ossimString srsNameStr( "srsName" );
+         ossimString pcsCodeDefinitionStr( "http://www.opengis.net/def/crs/EPSG/0/" );
+
+         /* axis labels for rectified imagery */
+
+         ossimString xpath_axisLabels = "/gml:axisLabels";
+         xpath_axisLabels = xpath_axisLabels.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+         ossimString firstAxisLabelString( "" );
+         ossimString secondAxisLabelString( "" );
+         ossimString xpath = xpath0 + xpath_axisLabels;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         if ( xml_nodes.size() == 1 )
+         {
+            ossimString axisLabelsString = xml_nodes[0]->getText();
+            size_t spacePos = axisLabelsString.find( ' ' );
+            firstAxisLabelString  = axisLabelsString.beforePos( spacePos );
+            secondAxisLabelString = axisLabelsString.afterPos ( spacePos );
+         }
+
+         success = addTieAndScale( geomKwl );
+         
+         //---
+         // origin:
+         // Note: In GML the origin is the tie point, NOT the projection origin.
+         //---
+
+         ossim_uint32 pcsCodeOrigin = 32767;
+         ossimString xpath_originPoint = "/gml:origin/gml:Point";
+         xpath_originPoint = xpath_originPoint.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+         xpath = xpath0 + xpath_originPoint;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         if ( xml_nodes.size() == 1 )
+         {
+            const ossimString& originString = xml_nodes[0]->getChildTextValue( ossimString( "pos" ) );
+            size_t spacePos = originString.find( ' ' );
+            ossimString firstOriginString  = originString.beforePos( spacePos );
+            ossimString secondOriginString = originString.afterPos ( spacePos );
+            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( srsNameStr );
+            const ossimString& originSrsName = hrefAttribute->getValue();
+            ossimString pcsCodeOriginStr = originSrsName.after( pcsCodeDefinitionStr.string() );
+            pcsCodeOrigin = pcsCodeOriginStr.toUInt32();
+
+            if ( pcsCodeOrigin != 32767 )
+            {
+               std::string tie_point_xy;
+               std::string tie_point_units;
+
+               if ( pcsCodeOrigin == 4326 ) // map projection
+               {
+                  // Longitude first, e.g. (lon,lat)
+                  tie_point_units = "degrees";
+               }
+               else
+               {
+                  tie_point_units = "meters";
+               }
+               
+               if ( ( tie_point_units == "degrees" ) &&
+                    ( firstAxisLabelString == "Lat" ) )
+               {
+                  tie_point_xy = "(";
+                  tie_point_xy += secondOriginString.string();
+                  tie_point_xy += ",";
+                  tie_point_xy += firstOriginString.string();
+                  tie_point_xy += ")";
+               }
+               else
+               {
+                  tie_point_xy = "(";
+                  tie_point_xy += firstOriginString.string();
+                  tie_point_xy += ",";
+                  tie_point_xy += secondOriginString.string();
+                  tie_point_xy += ")";
+               }
+                  
+               geomKwl.add( ossimKeywordNames::TIE_POINT_XY_KW, tie_point_xy.c_str() );
+               geomKwl.add( ossimKeywordNames::TIE_POINT_UNITS_KW, tie_point_units.c_str() );
+            }
+         }
+
+         //---
+         // offset vector
+         // Note this is the scale:
+         
+         ossimString xpath_offsetVector = "/gml:offsetVector";
+         xpath_offsetVector = xpath_offsetVector.replaceAllThatMatch( defaultNamespaceStr.c_str(), "" );
+         xpath = xpath0 + xpath_offsetVector;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+
+         if ( xml_nodes.size() )
+         {
+            const ossimString& offsetVectorString = xml_nodes[0]->getText();
+            size_t spacePos = offsetVectorString.find( ' ' );
+            ossimString firstOffsetVectorString  = offsetVectorString.beforePos( spacePos );
+            ossimString secondOffsetVectorString = offsetVectorString.afterPos ( spacePos );
+            
+
+            const ossimRefPtr<ossimXmlAttribute> hrefAttribute = xml_nodes[0]->findAttribute( srsNameStr );
+            const ossimString& offsetVectorSrsName = hrefAttribute->getValue();
+            ossimString pcsCodeOffsetVectorStr = offsetVectorSrsName.after( pcsCodeDefinitionStr.string() );
+            ossim_uint32 pcsCodeOffsetVector = pcsCodeOffsetVectorStr.toUInt32();
+
+            if ( pcsCodeOffsetVector != 32767 )
+            {
+               std::string scale_xy;
+               std::string scale_units;
+               if ( pcsCodeOffsetVector == 4326 )
+               {
+                  scale_units = "degrees";
+               }
+               else
+               {
+                  scale_units = "meters";
+               }
+               
+               if ( ( scale_units == "degrees" ) && ( firstAxisLabelString == "Lat" ) )
+               {
+                  scale_xy = "(";
+                  scale_xy += secondOffsetVectorString.c_str();
+                  scale_xy += ",";
+                  scale_xy += firstOffsetVectorString.c_str();
+                  scale_xy += ")";
+               }
+               else
+               {
+                  scale_xy = "(";
+                  scale_xy += firstOffsetVectorString.c_str();
+                  scale_xy += ",";
+                  scale_xy += secondOffsetVectorString.c_str();
+                  scale_xy += ")";
+               }
+               
+               geomKwl.add( ossimKeywordNames::PIXEL_SCALE_XY_KW, scale_xy.c_str() );
+               geomKwl.add( ossimKeywordNames::PIXEL_SCALE_UNITS_KW, scale_units.c_str() ); 
+            }
+         }
+      }
+   }
+
+   return success;
+   
+} // End: ossimGmlSupportData::getImageGeometry( geomKwl )
+#endif
+
+void ossimGmlSupportData::getGeoOrigin( 
+   const ossimImageGeometry* geom,
+   const ossimIpt& ul,
+   ossimString& originString,
+   ossimString& offsetVector1String, 
+   ossimString& offsetVector2String ) const
+{
+   if ( geom )
+   {
+      // Get the gsd:
+      ossimDpt gsd;
+      geom->getDegreesPerPixel( gsd );
+
+      // Get tie point:
+      ossimGpt tie;
+      geom->localToWorld( ul, tie );
+
+      std::ostringstream os;
+      os.precision(15);
+      os << tie.lat << " " << tie.lon;
+      originString = os.str();
+
+      std::ostringstream os2;
+      os2.precision(15);
+      os2 << -gsd.y << " " << "0.0";
+      offsetVector1String = os2.str();
+
+      std::ostringstream os3;
+      os3.precision(15);
+      os3 << "0.0" << " " << gsd.x;
+      offsetVector2String = os3.str();
+   }
+
+} // End: ossimGmlSupportData::getGeoOrigin
+
+
+void ossimGmlSupportData::getMapOrigin( 
+   const ossimImageGeometry* geom,
+   const ossimIpt& ul,
+   ossimString& originString,
+   ossimString& offsetVector1String, 
+   ossimString& offsetVector2String ) const
+{
+   if ( geom )
+   {
+      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
+      if ( mapProj.valid() != 0 )
+      {
+         // Get the tie point:
+         ossimGpt gpt;
+         geom->localToWorld( ul, gpt );
+
+         ossimDpt tie = mapProj->forward( gpt );
+
+         std::ostringstream os;
+         os.precision(15);
+         os << tie.x << " " << tie.y;
+         originString = os.str();   
+      }
+
+      // Get the projected CS gsd:
+      ossimDpt gsdMap;
+      geom->getMetersPerPixel( gsdMap );
+
+      std::ostringstream os2;
+      os2.precision(15);
+      os2 << gsdMap.x << " " << "0.0";
+      offsetVector1String = os2.str();
+
+      std::ostringstream os3;
+      os3.precision(15);
+      os3 << "0.0" << " " << -gsdMap.y;
+      offsetVector2String = os3.str();
+   }
+
+} // End: ossimGmlSupportData::getMapBounds
+
+void ossimGmlSupportData::getGeoBounds( const ossimImageGeometry* geom,
+                                        const ossimIrect& rect,
+                                        ossimString& upperCornerString,
+                                        ossimString& lowerCornerString ) const
+{
+   if ( geom )
+   {
+      ossimRefPtr<const ossimMapProjection> mapProj = geom->getAsMapProjection();
+      if ( mapProj.valid() )
+      {
+         // Get the bounding rect.  This assumes North up.
+         ossimGpt ulGpt;
+         ossimGpt lrGpt;
+         geom->localToWorld( rect.ul(), ulGpt );
+         geom->localToWorld( rect.lr(), lrGpt );
+         
+         std::ostringstream os;
+         os.precision(15);
+         os << ulGpt.lat << " " << ulGpt.lon;
+         upperCornerString = os.str();
+         
+         std::ostringstream os2;
+         os2.precision(15);
+         os2 << lrGpt.lat << " " << lrGpt.lon;
+         lowerCornerString = os2.str();
+      }
+   }
+   
+} // End: ossimGmlSupportData::getGeoBounds
+
+void ossimGmlSupportData::getLimits( const ossimIrect& rect,
+                                     ossimString& gridHighString,
+                                     ossimString& gridLowString ) const
+{
+   if ( rect.hasNans() == false )
+   {
+      // Zero based image rect.
+      gridLowString = "0 0";
+         
+      ossim_uint32 w = rect.width();
+      ossim_uint32 h = rect.height();
+      
+      std::ostringstream os;
+      os << (w-1) << " " << (h-1);
+      gridHighString = os.str();
+   }
+}
+
+bool ossimGmlSupportData::getImageGeometryFromSeonsorModel( ossimKeywordlist& /* geomKwl */) const
+{
+   bool status = false;
+
+   if ( m_xmlDocument.valid() )
+   {
+      vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
+      ossimString xpath0 =  "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2ReferenceableGridCoverage/gml:domainSet/gmlcov:ReferenceableGridBySensorModel";
+
+      m_xmlDocument->findNodes( xpath0, xml_nodes );
+      if ( xml_nodes.size() >= 1 )
+      {
+         // Put sensor model code here...
+
+         status = true;
+      }
+   }
+
+   return status;
+}
+
+bool ossimGmlSupportData::getImageGeometryFromRectifiedGrid( ossimKeywordlist& geomKwl ) const
+{
+   bool status = false;
+
+   if ( m_xmlDocument.valid() )
+   {
+      bool useGmlPrefix = false;
+      
+      vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
+      
+      ossimString xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2RectifiedGridCoverage/domainSet/RectifiedGrid";
+      m_xmlDocument->findNodes( xpath0, xml_nodes );
+      if ( !xml_nodes.size() )
+      {
+         xpath0 = "/gmljp2:GMLJP2CoverageCollection/gmljp2:featureMember/gmljp2:GMLJP2RectifiedGridCoverage/gml:domainSet/gml:RectifiedGrid";
+        m_xmlDocument->findNodes( xpath0, xml_nodes );
+        if (  xml_nodes.size() )
+        {
+           useGmlPrefix = true;
+        }
+      }
+         
+      if ( xml_nodes.size() )
+      {
+         const ossimString SRS_NAME( "srsName" );
+         const ossimString PCS_CODE_DEFINITION_STR( "http://www.opengis.net/def/crs/EPSG/0/" );
+         
+         const ossimRefPtr<ossimXmlAttribute> hrefAttribute =
+            xml_nodes[0]->findAttribute( SRS_NAME );
+         const ossimString& originSrsName = hrefAttribute->getValue();
+
+         ossimString pcsCodeStr = originSrsName.after( PCS_CODE_DEFINITION_STR.string() );
+         ossim_uint32 pcsCode = pcsCodeStr.toUInt32();
+
+         if ( pcsCode != 32767 )
+         {
+            // Add the pcs code.
+            geomKwl.add( ossimKeywordNames::PCS_CODE_KW, pcsCodeStr.c_str() );
+            if ( pcsCode == 4326 )
+            {
+               ossimString srsName = "EPSG:";
+               srsName += pcsCodeStr;
+               geomKwl.add( ossimKeywordNames::SRS_NAME_KW, srsName.c_str() );
+               geomKwl.add( ossimKeywordNames::TYPE_KW, "ossimEquDistCylProjection");
+            }
+
+            if ( addLineSamps( xpath0, useGmlPrefix, geomKwl ) )
+            {
+               if ( addTie( xpath0, useGmlPrefix, pcsCode, geomKwl ) )
+               {
+                  status = addScale( xpath0, useGmlPrefix, pcsCode, geomKwl );
+               }
+            }
+         }
+      }
+   }
+
+   return status;  
+}
+
+bool ossimGmlSupportData::addLineSamps( const ossimString& xpath0,
+                                        bool useGmlPrefix,
+                                        ossimKeywordlist& geomKwl ) const
+{
+   bool status = false;
+   
+   if ( m_xmlDocument.valid() )
+   {
+      vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
+
+      // Number of lines & samples, for either sensor or rectified imagery:
+      ossimString xpath_limits_low;
+      if (useGmlPrefix)
+      {
+         xpath_limits_low = "/gml:limits/gml:GridEnvelope/gml:low";
+      }
+      else
+      {
+         xpath_limits_low = "/limits/GridEnvelope/low";
+      }
+      ossimString xpath = xpath0 + xpath_limits_low;
+       m_xmlDocument->findNodes( xpath, xml_nodes );
+      if ( xml_nodes.size() == 1 )
+      {
+         const ossimString& lowerCorner = xml_nodes[0]->getText();
+         size_t spacePos = lowerCorner.find( ' ' );
+         ossimString lowerXString = lowerCorner.beforePos( spacePos );
+         ossimString lowerYString = lowerCorner.afterPos ( spacePos );
+         ossim_uint32 lowX = lowerXString.toInt32();
+         ossim_uint32 lowY = lowerYString.toInt32();
+
+         ossimString xpath_limits_high;
+         if ( useGmlPrefix )
+         {
+            xpath_limits_high = "/gml:limits/gml:GridEnvelope/gml:high";
+         }
+         else
+         {
+            xpath_limits_high = "/limits/GridEnvelope/high";
+         }
+
+         xpath = xpath0 + xpath_limits_high;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         if ( xml_nodes.size() == 1 )
+         {
+            const ossimString& higherCorner = xml_nodes[0]->getText();
+            size_t spacePos = higherCorner.find( ' ' );
+            ossimString higherXString = higherCorner.beforePos( spacePos );
+            ossimString higherYString = higherCorner.afterPos ( spacePos );
+            ossim_uint32 highX = higherXString.toInt32();
+            ossim_uint32 highY = higherYString.toInt32();
+            
+            geomKwl.add( ossimKeywordNames::NUMBER_LINES_KW,   highY - lowY + 1 );
+            geomKwl.add( ossimKeywordNames::NUMBER_SAMPLES_KW, highX - lowX + 1 );
+            
+            status = true;
+         }
+      }
+   }
+
+   return status;
+   
+} // ossimGmlSupportData::addLineSamps
+
+bool ossimGmlSupportData::addTie( const ossimString& xpath0,
+                                  bool useGmlPrefix,
+                                  ossim_uint32 pcsCode,
+                                  ossimKeywordlist& geomKwl ) const
+{
+   bool status = false;
+
+   if ( m_xmlDocument.valid() && (pcsCode != 32767 ) )
+   {
+      vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
+
+      //---
+      // origin:
+      // Note: In GML the origin is the tie point, NOT the projection origin.
+      //---
+
+      // axis labels for rectified imagery:
+      ossimString xpath_axisLabels;
+      if ( useGmlPrefix )
+      {
+          xpath_axisLabels = "/gml:axisLabels";
+      }
+      else
+      {
+         xpath_axisLabels = "/axisLabels";
+      }
+
+      ossimString xpath = xpath0 + xpath_axisLabels;
+      m_xmlDocument->findNodes( xpath, xml_nodes );
+      if ( xml_nodes.size() == 1 )
+      {
+         ossimString axisLabelsString = xml_nodes[0]->getText();
+
+         ossimString xpath_originPoint;
+
+         if ( useGmlPrefix )
+         {
+            xpath_originPoint = "/gml:origin/gml:Point";
+         }
+         else
+         {
+            xpath_originPoint = "/origin/Point";
+         }
+
+         xpath = xpath0 + xpath_originPoint;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         if ( xml_nodes.size() == 1 )
+         {
+            const ossimString& originString = xml_nodes[0]->getChildTextValue( ossimString( "pos" ) );
+            size_t spacePos = originString.find( ' ' );
+            ossimString firstOriginString  = originString.beforePos( spacePos );
+            ossimString secondOriginString = originString.afterPos ( spacePos );
+            
+            std::string tie_point_xy;
+            std::string tie_point_units;
+            
+            if ( pcsCode == 4326 ) // map projection
+            {
+               // Longitude first, e.g. (lon,lat)
+               tie_point_units = "degrees";
+            }
+            else
+            {
+               tie_point_units = "meters";
+            }
+            
+            if ( ( tie_point_units == "degrees" ) &&
+                 ( axisLabelsString == "Lat Long" ) )
+            {
+               tie_point_xy = "(";
+               tie_point_xy += secondOriginString.string();
+               tie_point_xy += ",";
+               tie_point_xy += firstOriginString.string();
+               tie_point_xy += ")";
+            }
+            else
+            {
+               tie_point_xy = "(";
+               tie_point_xy += firstOriginString.string();
+               tie_point_xy += ",";
+               tie_point_xy += secondOriginString.string();
+               tie_point_xy += ")";
+            }
+            geomKwl.add( ossimKeywordNames::TIE_POINT_XY_KW, tie_point_xy.c_str() );
+            geomKwl.add( ossimKeywordNames::TIE_POINT_UNITS_KW, tie_point_units.c_str() );
+            status = true;
+         }
+      }
+      
+   } // Matches: if ( m_xmlDocument.valid() && (pscCode != 32767 ) )
+
+   return status;
+   
+} // End: ossimGmlSupportData::addTie( ... )
+
+bool ossimGmlSupportData::addScale( const ossimString& xpath0,
+                                    bool useGmlPrefix,
+                                    ossim_uint32 pcsCode,
+                                    ossimKeywordlist& geomKwl ) const
+{
+   bool status = false;
+
+   if ( m_xmlDocument.valid() && (pcsCode != 32767 ) )
+   {
+      vector< ossimRefPtr<ossimXmlNode> > xml_nodes;
+
+      //---
+      // origin:
+      // Note: In GML the origin is the tie point, NOT the projection origin.
+      //---
+
+      // axis labels for rectified imagery:
+      ossimString xpath_axisLabels;
+      if ( useGmlPrefix )
+      {
+          xpath_axisLabels = "/gml:axisLabels";
+      }
+      else
+      {
+         xpath_axisLabels = "/axisLabels";
+      }
+
+      ossimString xpath = xpath0 + xpath_axisLabels;
+      m_xmlDocument->findNodes( xpath, xml_nodes );
+      if ( xml_nodes.size() == 1 )
+      {
+         ossimString axisLabelsString = xml_nodes[0]->getText();
+
+         ossimString xpath_offsetVector;
+         if ( useGmlPrefix )
+         {
+            xpath_offsetVector = "/gml:offsetVector";
+         }
+         else
+         {
+            xpath_offsetVector =  "/offsetVector";
+         }
+         
+         xpath = xpath0 + xpath_offsetVector;
+         xml_nodes.clear();
+         m_xmlDocument->findNodes( xpath, xml_nodes );
+         if ( xml_nodes.size() == 2 )
+         {
+            const ossimString& offsetVectorString0 = xml_nodes[0]->getText();
+            const ossimString& offsetVectorString1 = xml_nodes[1]->getText();
+            
+            size_t spacePos0 = offsetVectorString0.find( ' ' );
+            size_t spacePos1 = offsetVectorString1.find( ' ' );            
+            
+            ossimString firstOffsetVectorString0  = offsetVectorString0.beforePos( spacePos0 );
+            ossimString secondOffsetVectorString0 = offsetVectorString0.afterPos ( spacePos0 );
+            ossimString firstOffsetVectorString1  = offsetVectorString1.beforePos( spacePos1 );
+            ossimString secondOffsetVectorString1 = offsetVectorString1.afterPos ( spacePos1 );
+            
+            // TODO: Add for rotational matrix:
+            
+            std::string scale_xy;
+            std::string scale_units;
+            if ( pcsCode == 4326 )
+            {
+               scale_units = "degrees";
+            }
+            else
+            {
+               scale_units = "meters";
+            }
+
+            ossimDpt scale;
+            if ( ( scale_units == "degrees" ) &&
+                 ( axisLabelsString == "Lat Long" ) )
+            {
+               scale.x = secondOffsetVectorString1.toFloat64();
+               scale.y = firstOffsetVectorString0.toFloat64();
+            }
+            else
+            {
+               scale.x = firstOffsetVectorString0.toFloat64();
+               scale.y = secondOffsetVectorString1.toFloat64();
+            }
+            if ( scale.y < 0.0 )
+            {
+               scale.y *= -1.0; // make positive
+            }
+
+            if ( ( scale_units == "degrees" ) && ( scale.x != scale.y ) )
+            {
+               // Compute/add the origin latitude of true scale.
+               ossim_float64 origin_lat = ossim::acosd(scale.y/scale.x);
+
+               geomKwl.add(  ossimKeywordNames::ORIGIN_LATITUDE_KW, origin_lat );
+            }
+            
+            geomKwl.add( ossimKeywordNames::PIXEL_SCALE_XY_KW, scale.toString().c_str() );
+            geomKwl.add( ossimKeywordNames::PIXEL_SCALE_UNITS_KW, scale_units.c_str() );                
+            status = true;
+         }
+      }
+
+   } // Matches: if ( m_xmlDocument.valid() && (pscCode != 32767 ) )
+
+   return status;
+   
+} // End: ossimGmlSupportData::addScale( ... )
diff --git a/src/support_data/ossimIkonosMetaData.cpp b/src/support_data/ossimIkonosMetaData.cpp
new file mode 100644
index 0000000..8e803a0
--- /dev/null
+++ b/src/support_data/ossimIkonosMetaData.cpp
@@ -0,0 +1,599 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+// 
+// Class definition for ossimIkonosMetaData.
+// 
+// This class parses a Space Imaging Ikonos meta data file.
+//
+//********************************************************************
+// $Id: ossimIkonosMetaData.cpp 17206 2010-04-25 23:20:40Z dburken $
+
+#include <cstdio>
+#include <iostream>
+#include <ossim/support_data/ossimIkonosMetaData.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimTrace.h>
+
+RTTI_DEF1(ossimIkonosMetaData, "ossimIkonosMetaData", ossimObject);
+
+// Define Trace flags for use within this file:
+static ossimTrace traceExec  ("ossimIkonosMetaData:exec");
+static ossimTrace traceDebug ("ossimIkonosMetaData:debug");
+
+ossimIkonosMetaData::ossimIkonosMetaData()
+  :
+  theNominalCollectionAzimuth(0.0),
+  theNominalCollectionElevation(0.0),
+  theSunAzimuth(0.0),
+  theSunElevation(0.0),
+  theNumBands(0),
+  theBandName("Unknown"),
+  theProductionDate("Unknown"),
+  theAcquisitionDate("Unknown"),
+  theAcquisitionTime("Unknown"),
+  theSensorID("Unknown")
+{
+}
+
+ossimIkonosMetaData::~ossimIkonosMetaData()
+{
+}
+
+bool ossimIkonosMetaData::open(const ossimFilename& imageFile)
+{
+   static const char MODULE[] = "ossimIkonosMetaData::open";
+   
+   clearFields();
+   
+   //retrieve information from the metadata file
+   //if the ikonos tif is po_2619900_pan_0000000.tif
+   //the metadata file will be po_2619900_metadata.txt
+
+   ossimString separator("_");
+   ossimString filenamebase = imageFile.fileNoExtension();
+   std::vector< ossimString > filenameparts = filenamebase.split(separator);
+   
+   if(filenameparts.size() < 2)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " Ikonos filename non standard" << std::endl;
+      }
+      return false;
+   }
+   ossimFilename metadatafile = filenameparts[0];
+   metadatafile += "_";
+   metadatafile += filenameparts[1];
+   metadatafile += "_metadata.txt";
+   
+   metadatafile.setPath(imageFile.path());
+   
+   if( parseMetaData(metadatafile) == false )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " errors parsing metadata" << std::endl;
+      }
+      return false;
+   }
+   
+   ossimFilename hdrfile = imageFile;
+   hdrfile.setExtension(ossimString("hdr"));
+   if( parseHdrData(hdrfile) == false )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " errors parsing hdr" << std::endl;
+      }
+      return false;
+   }
+   
+   ossimFilename rpcfile = imageFile.noExtension();
+   rpcfile += "_rpc.txt";
+   if (parseRpcData (rpcfile) == false)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " errors parsing rpc" << std::endl;
+      }
+      return false;
+   }
+
+   return true;
+}
+
+void ossimIkonosMetaData::clearFields()
+{
+  theNominalCollectionAzimuth = 0.0;
+  theNominalCollectionElevation = 0.0;
+  theSunAzimuth = 0.0;
+  theSunElevation = 0.0;
+  theNumBands = 0;
+  theBandName = "Unknown";
+  theProductionDate = "Unknown";
+  theAcquisitionDate = "Unknown";
+  theAcquisitionTime = "Unknown";
+  theSensorID = "Unknown";
+}
+
+std::ostream& ossimIkonosMetaData::print(std::ostream& out) const
+{
+
+  out << "\n----------------- Info on Ikonos Image -------------------"
+      << "\n  "
+      << "\n  Nominal Azimuth:    " << theNominalCollectionAzimuth
+      << "\n  Nominal Elevation:   " << theNominalCollectionElevation
+      << "\n  Sun Azimuth:    " << theSunAzimuth
+      << "\n  Sun Elevation:   " << theSunElevation
+      << "\n  Number of bands:   " << theNumBands
+      << "\n  Band name:   " << theBandName
+      << "\n  Production date:   " << theProductionDate
+      << "\n  Acquisition date:   " << theAcquisitionDate
+      << "\n  Acquisition time:   " << theAcquisitionTime
+      << "\n  Sensor Type:   " << theSensorID
+      << "\n"
+      << "\n---------------------------------------------------------"
+      << "\n  " << std::endl;
+  return out;
+}
+
+ossimString ossimIkonosMetaData::getSensorID() const
+{
+  return theSensorID;
+}
+
+bool ossimIkonosMetaData::saveState(ossimKeywordlist& kwl,
+                                    const char* prefix)const
+{
+
+  kwl.add(prefix,
+          ossimKeywordNames::TYPE_KW,
+          "ossimIkonosMetaData",
+          true);
+
+  kwl.add(prefix,
+          "nominal_collection_azimuth_angle",
+          theNominalCollectionAzimuth,
+          true);
+
+  kwl.add(prefix,
+          "nominal_collection_elevation_angle",
+          theNominalCollectionElevation,
+          true);
+          
+  kwl.add(prefix,
+          ossimKeywordNames::AZIMUTH_ANGLE_KW,
+          theSunAzimuth,
+          true);
+
+  kwl.add(prefix,
+          ossimKeywordNames::ELEVATION_ANGLE_KW,
+          theSunElevation,
+          true);
+
+  kwl.add(prefix,
+          ossimKeywordNames::NUMBER_BANDS_KW,
+          theNumBands,
+          true);
+
+  kwl.add(prefix,
+          "band_name",
+          theBandName,
+          true);
+
+  kwl.add(prefix,
+          "production_date",
+          theProductionDate,
+          true);
+
+  kwl.add(prefix,
+          "acquisition_date",
+          theAcquisitionDate,
+          true);
+
+  kwl.add(prefix,
+          "acquisition_time",
+          theAcquisitionTime,
+          true);
+
+  kwl.add(prefix,
+          "sensor",
+          theSensorID,
+          true);
+
+  return true;
+}
+
+bool ossimIkonosMetaData::loadState(const ossimKeywordlist& kwl,
+                                    const char* prefix)
+{
+   clearFields();
+
+   const char* lookup = 0;
+   ossimString s;
+  
+   lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      if(s != "ossimIkonosMetaData")
+      {
+         return false;
+      }
+   }
+
+  lookup = kwl.find(prefix, "nominal_collection_azimuth_angle");
+  if (lookup)
+  {
+     s = lookup;
+     theNominalCollectionAzimuth = s.toFloat64();
+  }
+
+  lookup = kwl.find(prefix, "nominal_collection_elevation_angle");
+  if (lookup)
+  {
+     s = lookup;
+     theNominalCollectionElevation = s.toFloat64();
+  }
+  
+   lookup = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      theSunAzimuth = s.toFloat64();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      theSunElevation = s.toFloat64();
+   }
+  
+   lookup = kwl.find(prefix, ossimKeywordNames::NUMBER_BANDS_KW);
+   if (lookup)
+   {
+      s = lookup;
+      theNumBands = s.toUInt32();
+   }
+
+   lookup = kwl.find(prefix, "band_name");
+   if (lookup)
+   {
+      theBandName = lookup;
+   }
+
+   lookup = kwl.find(prefix, "production_date");
+   if (lookup)
+   {
+      theProductionDate = lookup;
+   }
+
+  lookup = kwl.find(prefix, "acquisition_date");
+  if (lookup)
+  {
+     theAcquisitionDate = lookup;
+  }
+
+  lookup = kwl.find(prefix, "acquisition_time");
+  if (lookup)
+  {
+     theAcquisitionTime = lookup;
+  }
+
+  lookup = kwl.find(prefix, "sensor");
+  if (lookup)
+  {
+     theSensorID = lookup;
+  }
+  
+   return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimIkonosMetaData::parseMetaData()
+//
+//  Parses the Ikonos metadata file.
+//
+//*****************************************************************************
+bool ossimIkonosMetaData::parseMetaData(const ossimFilename& data_file)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): entering..."
+         << std::endl;
+   }
+
+   FILE* fptr = fopen (data_file, "r");
+   if (!fptr)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimIkonosRpcModel::parseMetaData(data_file) DEBUG:"
+            << "\nCould not open Meta data file:  " << data_file
+            << "\nreturning with error..." << std::endl;
+      }
+      return false;
+   }
+
+   char* strptr;
+   char dummy[80], name[80];
+   double value;
+
+   //---
+   // Read the file into a buffer:
+   //---
+   ossim_int32 fileSize = static_cast<ossim_int32>(data_file.fileSize());
+   char* filebuf = new char[fileSize];
+   fread(filebuf, 1, fileSize, fptr);
+   fclose(fptr);
+
+   //---
+   // Production date:
+   //---
+   strptr = strstr(filebuf, "\nCreation Date:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << std::endl;
+      }
+      delete [] filebuf;
+      return false;
+   }
+
+   sscanf(strptr, "%15c %s", dummy, name);
+   theProductionDate = name;
+
+   //***
+   // Sensor Type:
+   //***
+   strptr = strstr(strptr, "\nSensor:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      { 
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << std::endl;
+      }
+      delete [] filebuf;
+      return false;
+   }
+
+   sscanf(strptr, "%8c %s", dummy, name);
+   theSensorID = name;
+
+
+   //***
+   // Nominal Azimuth:
+   //***
+   strptr = strstr(strptr, "\nNominal Collection Azimuth:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << std::endl;
+      }
+      delete [] filebuf;
+      return false;
+   }
+
+   sscanf(strptr, "%28c %lf %s", dummy, &value, dummy);
+   theNominalCollectionAzimuth = value;
+
+   //***
+   // Nominal Elevation:
+   //***
+   strptr = strstr(strptr, "\nNominal Collection Elevation:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << std::endl;
+      }
+      delete [] filebuf;
+      return false;
+   }
+  
+   sscanf(strptr, "%31c %lf %s", dummy, &value, dummy);
+   theNominalCollectionElevation = value;
+
+   //***
+   // Sun Azimuth:
+   //***
+   strptr = strstr(strptr, "\nSun Angle Azimuth:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << std::endl;
+      }
+      delete [] filebuf;
+      return false;
+   }
+
+   sscanf(strptr, "%19c %lf %s", dummy, &value, dummy);
+   theSunAzimuth = value;
+
+   //***
+   // Sun Elevation:
+   //***
+   strptr = strstr(strptr, "\nSun Angle Elevation:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+            << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed meta-data file." << std::endl;
+      }
+      delete [] filebuf;
+      return false;
+   }
+
+   sscanf(strptr, "%21c %lf %s", dummy, &value, name);
+   theSunElevation = value;
+
+   //---
+   // Acquisition date and time:
+   //---
+   strptr = strstr(filebuf, "\nAcquisition Date/Time:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+      ossimNotify(ossimNotifyLevel_FATAL)
+          << "FATAL ossimIkonosRpcModel::parseMetaData(data_file): "
+          << "\n\tAborting construction. Error encountered parsing "
+          << "presumed meta-data file." << std::endl;
+      }
+      delete [] filebuf;
+      return false;
+   }
+
+   char name2[80];
+   sscanf(strptr, "%23c %s %s", dummy, name, name2);
+   theAcquisitionDate = name;
+   theAcquisitionTime = name2;
+
+   delete [] filebuf;
+   filebuf = 0;
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseMetaData(data_file): returning..."
+         << std::endl;
+   }
+
+   return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimIkonosMetaData::parseHdrData()
+//
+//  Parses the Ikonos hdr file.
+//
+//*****************************************************************************
+bool ossimIkonosMetaData::parseHdrData(const ossimFilename& data_file)
+{
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): entering..."
+         << std::endl;
+   }
+
+   FILE* fptr = fopen (data_file, "r");
+   if (!fptr)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file) WARN:"
+            << "\nCould not open hdr data file <" << data_file << ">. "
+            << "returning with error..." << std::endl;
+      }
+      return false;
+   }
+
+   char* strptr;
+   // char linebuf[80];
+   char dummy[80];
+   char name[80];
+   int value=0;
+
+   //***
+   // Read the file into a buffer:
+   //***
+   char filebuf[5000];
+   fread(filebuf, 1, 5000, fptr);
+   fclose(fptr);
+
+   //***
+   // Band name:
+   //***
+   strptr = strstr(filebuf, "\nBand:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file):"
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed hdr file." << std::endl;
+      }
+
+      return false;
+   }
+
+   sscanf(strptr, "%6c %s", dummy, name);
+   theBandName = name;
+
+   //***
+   // Number of Bands:
+   //***
+   strptr = strstr(filebuf, "\nNumber of Bands:");
+   if (!strptr)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimIkonosRpcModel::parseHdrData(data_file):"
+            << "\n\tAborting construction. Error encountered parsing "
+            << "presumed hdr file." << std::endl;
+      }
+
+      return false;
+   }
+
+   sscanf(strptr, "%17c %d", dummy, &value);
+   theNumBands = value;
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimIkonosRpcModel::parseHdrData(data_file): returning..."
+         << std::endl;
+   }
+   return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimIkonosMetaData::parseRpcData()
+//
+//  Parses the Ikonos rpc file.
+//
+//*****************************************************************************
+bool ossimIkonosMetaData::parseRpcData(const ossimFilename& /* data_file */)
+{
+   return true;
+}
diff --git a/src/support_data/ossimInfoBase.cpp b/src/support_data/ossimInfoBase.cpp
new file mode 100644
index 0000000..98e57be
--- /dev/null
+++ b/src/support_data/ossimInfoBase.cpp
@@ -0,0 +1,67 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Base class for Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <sstream>
+
+ossimInfoBase::ossimInfoBase()
+   : theOverviewFlag(true)
+{}
+
+ossimInfoBase::~ossimInfoBase()
+{}
+
+bool ossimInfoBase::open(const ossimFilename& file)
+{
+   std::string connectionString = file.c_str();
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
+   if(!str) return false;
+   return open(str, connectionString);
+}
+
+bool ossimInfoBase::open(std::shared_ptr<ossim::istream>& str,
+                         const std::string& connectionString)
+{
+   return false;
+}
+
+void ossimInfoBase::setProcessOverviewFlag(bool flag)
+{
+   theOverviewFlag = flag;
+}
+
+bool ossimInfoBase::getProcessOverviewFlag() const
+{
+   return theOverviewFlag;
+}
+
+bool ossimInfoBase::getKeywordlist(ossimKeywordlist& kwl)const
+{  
+   // Do a print to a memory stream.
+   std::ostringstream out;
+   print(out);
+
+   std::istringstream in(out.str());
+   // Give the result to the keyword list.
+   return kwl.parseStream(in);
+}
+
+bool ossimInfoBase::getKeywordlist(ossimKeywordlist& kwl,
+                                   ossim_uint32 /* entryIndex */ )const
+{
+   // If this gets hit the specific info object does not support entry indexes.
+   return getKeywordlist( kwl );
+}
diff --git a/src/support_data/ossimInfoFactory.cpp b/src/support_data/ossimInfoFactory.cpp
new file mode 100644
index 0000000..033461e
--- /dev/null
+++ b/src/support_data/ossimInfoFactory.cpp
@@ -0,0 +1,374 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Factory for info objects.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimInfoFactory.cpp 22118 2013-01-18 21:05:14Z dburken $
+
+#include <ossim/support_data/ossimInfoFactory.h>
+#include <ossim/ossimConfig.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/support_data/ossimCcfInfo.h>
+#include <ossim/support_data/ossimDemInfo.h>
+#include <ossim/support_data/ossimDoqq.h>
+#include <ossim/support_data/ossimDtedInfo.h>
+#include <ossim/support_data/ossimEnviInfo.h>
+#include <ossim/support_data/ossimJ2kInfo.h>
+#include <ossim/support_data/ossimJp2Info.h>
+#include <ossim/support_data/ossimLasInfo.h>
+#include <ossim/support_data/ossimNitfInfo.h>
+#include <ossim/support_data/ossimRpfInfo.h>
+#include <ossim/support_data/ossimTiffInfo.h>
+#include <ossim/support_data/ossimXmpInfo.h>
+
+#if OSSIM_HAS_HDF5
+#  include <ossim/hdf5/ossimHdf5Info.h>
+#endif
+
+
+ossimInfoFactory* ossimInfoFactory::theInstance = 0;
+
+ossimInfoFactory::~ossimInfoFactory()
+{}
+
+ossimInfoFactory* ossimInfoFactory::instance()
+{
+   if ( !theInstance )
+   {
+      theInstance = new ossimInfoFactory;
+   }
+   return theInstance;
+}
+  
+std::shared_ptr<ossimInfoBase> ossimInfoFactory::create(std::shared_ptr<ossim::istream>& str,
+                                                        const std::string& connectionString) const
+{
+   std::shared_ptr<ossimInfoBase> result(0);
+
+   if ( str )
+   {
+      str->clear();
+      str->seekg(0);
+      result = std::make_shared<ossimNitfInfo>();
+      if ( result->open(str, connectionString) )
+      {
+         return result;      
+      }
+      else
+      {
+         result.reset();
+      }
+      
+      str->clear();
+      str->seekg(0);
+      result = std::make_shared<ossimTiffInfo>();
+      if ( result->open(str, connectionString) )
+      {
+         return result;      
+      }
+      else
+      {
+         result.reset();
+      }
+      
+      str->clear();
+      str->seekg(0);
+      result = std::make_shared<ossimCcfInfo>();
+      if ( result->open(str, connectionString) )
+      {
+         return result;      
+      }
+      else
+      {
+         result.reset();
+      }
+      
+      str->clear();
+      str->seekg(0);
+      result = std::make_shared<ossimDtedInfo>();
+      if ( result->open(str, connectionString) )
+      {
+         return result;      
+      }
+      else
+      {
+         result.reset();
+      }
+      
+      str->clear();
+      str->seekg(0);
+      result = std::make_shared<ossimDoqq>();
+      if ( result->open(str, connectionString) )
+      {
+         return result;      
+      }
+      else
+      {
+         result.reset();
+      }
+      
+      str->clear();
+      str->seekg(0);
+      result = std::make_shared<ossimDemInfo>();
+      if ( result->open(str, connectionString) )
+      {
+         return result;      
+      }
+      else
+      {
+         result.reset();
+      }
+      
+      str->clear();
+      str->seekg(0);
+   }
+   
+   return result;
+}
+
+std::shared_ptr<ossimInfoBase> ossimInfoFactory::create(const ossimFilename& file) const
+{
+   std::shared_ptr<ossimInfoBase> result(0);
+
+   result = std::make_shared<ossimNitfInfo>();
+   if ( result->open( file ) )
+   {
+      return result;      
+   }
+   else
+   {
+      result.reset();
+   }
+      
+   result = std::make_shared<ossimTiffInfo>();
+   if ( result->open( file ) )
+   {
+      return result;      
+   }
+   else
+   {
+      result.reset();
+   }
+      
+   result = std::make_shared<ossimCcfInfo>();
+   if ( result->open( file ) )
+   {
+      return result;      
+   }
+   else
+   {
+      result.reset();
+   }
+      
+   result = std::make_shared<ossimDtedInfo>();
+   if ( result->open( file ) )
+   {
+      return result;      
+   }
+   else
+   {
+      result.reset();
+   }
+
+   result = std::make_shared<ossimDoqq>();
+   if ( result->open( file ) )
+   {
+      return result;      
+   }
+   else
+   {
+      result.reset();
+   }
+   
+   result = std::make_shared<ossimDemInfo>();
+   if ( result->open( file ) )
+   {
+      return result;      
+   }
+   else
+   {
+      result.reset();
+   }
+      
+   result = std::make_shared<ossimJp2Info>();
+   if ( result->open( file ) )
+   {
+      return result;
+   }
+   else
+   {
+      result.reset();
+   }
+   
+   result = std::make_shared<ossimEnviInfo>();
+   if ( result->open( file ) )
+   {
+      return result;
+   }
+   else
+   {
+      result.reset();
+   }
+         
+   result = std::make_shared<ossimRpfInfo>();
+   if ( result->open( file ) )
+   {
+      return result;
+   }
+   else
+   {
+      result.reset();
+   }
+   
+   result = std::make_shared<ossimXmpInfo>();
+   if ( result->open( file ) )
+   {
+      return result;
+   }
+   else
+   {
+      result.reset();
+   }
+   
+   result = std::make_shared<ossimLasInfo>();
+   if ( result->open( file ) )
+   {
+      return result;
+   }
+   else
+   {
+      result.reset();
+   }
+   
+   result = std::make_shared<ossimJ2kInfo>();
+   if ( result->open( file ) )
+   {
+      return result;
+   }
+   else
+   {
+      result.reset();
+   }
+   
+#if OSSIM_HAS_HDF5
+   result = std::make_shared<ossimHdf5Info>();
+   if ( result->open( file ) )
+   {
+      return result;
+   }
+   else
+   {
+      result.reset();
+   }
+#endif
+   
+   return result;
+}
+
+#if 0
+ossimInfoBase* ossimInfoFactory::create(const ossimFilename& file) const
+{
+   ossimRefPtr<ossimInfoBase> result = 0;
+
+   result = new ossimTiffInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimJp2Info();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimNitfInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimDemInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimDtedInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimEnviInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimRpfInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+   
+   result = new ossimXmpInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+   
+   result = new ossimLasInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimDoqq();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+
+   result = new ossimJ2kInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+   
+   result = new ossimCcfInfo();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+   
+#if OSSIM_HAS_HDF5
+   result = new ossimHdf5Info();
+   if ( result->open(file) )
+   {
+      return result.release();
+   }
+#endif
+   return 0;
+}
+#endif
+ossimInfoFactory::ossimInfoFactory()
+{}
+
+ossimInfoFactory::ossimInfoFactory(const ossimInfoFactory& /* obj */ )
+{}
+
+const ossimInfoFactory& ossimInfoFactory::operator=(
+   const ossimInfoFactory& /* rhs */)
+{
+   return *this;
+}
diff --git a/src/support_data/ossimInfoFactoryRegistry.cpp b/src/support_data/ossimInfoFactoryRegistry.cpp
new file mode 100644
index 0000000..01a3a0a
--- /dev/null
+++ b/src/support_data/ossimInfoFactoryRegistry.cpp
@@ -0,0 +1,150 @@
+//---
+//
+// License: MIT
+//
+// Author: David Burken
+//
+// Description: Class definition of registry (singleton) for info factories.
+//
+//---
+// $Id$
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/support_data/ossimInfoFactoryRegistry.h>
+#include <ossim/support_data/ossimInfoFactoryInterface.h>
+#include <ossim/support_data/ossimInfoFactory.h>
+#include <ossim/support_data/ossimInfoBase.h>
+
+#include <algorithm> /* for std::find */
+
+ossimInfoFactoryRegistry* ossimInfoFactoryRegistry::m_instance = 0;
+
+ossimInfoFactoryRegistry::~ossimInfoFactoryRegistry()
+{
+   m_factoryList.clear();
+}
+
+ossimInfoFactoryRegistry* ossimInfoFactoryRegistry::instance()
+{
+   if ( !m_instance )
+   {
+      m_instance = new ossimInfoFactoryRegistry;
+   }
+   return m_instance;
+}
+
+void ossimInfoFactoryRegistry::registerFactory(
+   ossimInfoFactoryInterface* factory)
+{
+   if (factory)
+   {
+      m_mutex.lock();
+      m_factoryList.push_back(factory);
+      m_mutex.unlock();
+   }
+}
+
+void ossimInfoFactoryRegistry::registerFactoryToFront(
+   ossimInfoFactoryInterface* factory)
+{
+   if (factory)
+   {
+      m_mutex.lock();
+      m_factoryList.insert( m_factoryList.begin(), factory );
+      m_mutex.unlock();
+   }
+}
+
+void ossimInfoFactoryRegistry::unregisterFactory(
+   ossimInfoFactoryInterface* factory)
+{
+   m_mutex.lock();
+   std::vector<ossimInfoFactoryInterface*>::iterator i =
+      std::find(m_factoryList.begin(), m_factoryList.end(), factory);
+   
+   if( i != m_factoryList.end() )
+   {
+      m_factoryList.erase(i);
+   }
+   m_mutex.unlock();
+}
+
+std::shared_ptr<ossimInfoBase> ossimInfoFactoryRegistry::create(
+   const ossimFilename& file) const
+{
+   std::shared_ptr<ossimInfoBase> result(0);
+   
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary );
+   if ( str )
+   {
+      std::string connectionString = file.c_str();
+      result = create( str, connectionString );
+      str.reset();
+   }
+   
+   if(!result)
+   {
+      std::vector<ossimInfoFactoryInterface*>::const_iterator i =
+         m_factoryList.begin();
+
+      while ( i != m_factoryList.end() )
+      {
+         result = (*i)->create( file );
+         if ( result )
+         {
+            break;
+         }
+         ++i;
+      }
+   }
+   
+   return result;
+} 
+
+std::shared_ptr<ossimInfoBase> ossimInfoFactoryRegistry::create(
+   std::shared_ptr<ossim::istream>& str,
+   const std::string& connectionString) const
+{
+   std::shared_ptr<ossimInfoBase> result(0);
+   if ( str )
+   {
+      std::vector<ossimInfoFactoryInterface*>::const_iterator i =
+         m_factoryList.begin();
+      
+      while ( i != m_factoryList.end() )
+      {
+         result = (*i)->create(str, connectionString);
+         if ( result )
+         {
+            break;
+         }
+         str->clear();
+         str->seekg(0);
+         ++i;
+      }
+   }
+   return result;
+}
+
+/** hidden from use default constructor */
+ossimInfoFactoryRegistry::ossimInfoFactoryRegistry()
+   : m_factoryList(),
+     m_mutex()
+{
+   this->registerFactory(ossimInfoFactory::instance());
+}
+
+/** hidden from use copy constructor */
+ossimInfoFactoryRegistry::ossimInfoFactoryRegistry(
+   const ossimInfoFactoryRegistry& /* obj */)
+{}
+
+/** hidden from use operator = */
+const ossimInfoFactoryRegistry& ossimInfoFactoryRegistry::operator=(
+   const ossimInfoFactoryRegistry& /* rhs */ )
+{
+   return *this;
+}
diff --git a/src/support_data/ossimJ2kCodRecord.cpp b/src/support_data/ossimJ2kCodRecord.cpp
new file mode 100644
index 0000000..748e2ef
--- /dev/null
+++ b/src/support_data/ossimJ2kCodRecord.cpp
@@ -0,0 +1,159 @@
+//---
+//
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description: Container class for J2K Coding style default (COD) record.
+//
+// See document BPJ2K01.00 Table 7-7 Image and tile size (15444-1 Annex A5.1)
+// 
+//---
+// $Id$
+
+#include <ossim/support_data/ossimJ2kCodRecord.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+
+#include <iostream>
+#include <iomanip>
+
+
+ossimJ2kCodRecord::ossimJ2kCodRecord()
+   :
+   m_marker(0xff52),
+   m_lcod(0),
+   m_scod(0),
+   m_progressionOrder(0),
+   m_numberOfLayers(0),
+   m_multipleComponentTransform(0),
+   m_numberOfDecompositionLevels(0),
+   m_codeBlockWidth(0),
+   m_codeBlockHeight(0),
+   m_codeBlockStyle(0),
+   m_transformation(0),
+   m_precinctSize(0)
+{
+}
+
+ossimJ2kCodRecord::~ossimJ2kCodRecord()
+{
+}
+
+void ossimJ2kCodRecord::parseStream(std::istream& in)
+{
+   // Get the stream posistion.
+   std::streamoff pos = in.tellg();
+
+   // Note: Marker is not read.
+   in.read((char*)&m_lcod, 2);
+   in.read((char*)&m_scod, 1);
+   in.read((char*)&m_progressionOrder, 1);
+   in.read((char*)&m_numberOfLayers, 2);
+   in.read((char*)&m_multipleComponentTransform, 1);
+   in.read((char*)&m_numberOfDecompositionLevels, 1);
+   in.read((char*)&m_codeBlockWidth, 1);
+   in.read((char*)&m_codeBlockHeight, 1);
+   in.read((char*)&m_codeBlockStyle, 1);
+   in.read((char*)&m_transformation, 1);
+
+   //---
+   // SPcod - precinct size (only is defined, Scod = xxxx xxx1)
+   //---   
+   if ( 0 )
+   {
+      in.read((char*)&m_precinctSize, 1);
+   }
+
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      // Stored big endian, must swap.
+      ossimEndian s;
+      s.swap(m_lcod);
+      s.swap(m_numberOfLayers);
+   }
+
+   //---
+   // Seek to next record.  This is needed because there are sometimes extra
+   // bytes.
+   //---
+   in.seekg(pos + m_lcod, std::ios_base::beg);
+}
+
+std::ostream& ossimJ2kCodRecord::print(std::ostream& out,
+                                       const std::string& prefix) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   std::string pfx = prefix;
+   pfx += "cod.";
+
+   out.setf(std::ios_base::hex, std::ios_base::basefield);
+   out << pfx << "marker: 0xff90\n";
+   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
+
+   out << pfx << "Lcod: " << m_lcod       << "\n"
+       << pfx << "Scod: " << int(m_scod)  << "\n"
+       << pfx << "SGcod_progression_order:  "
+       << getProgressionOrderAsString(m_progressionOrder) << "\n"
+       << pfx << "SGcod_number_of_layers:  " << m_numberOfLayers << "\n"
+       << pfx << "SGcod_multiple_component_transform:  "
+       << int(m_multipleComponentTransform) << "\n"
+       << pfx << "SPcod_mumber_of_decomposition_levels: "
+       << int(m_numberOfDecompositionLevels) << "\n"
+       << pfx << "SPcod_code_block_width: " << int(m_codeBlockWidth) << "\n"
+       << pfx << "SPcod_code_block_height: " << int(m_codeBlockHeight) << "\n"
+       << pfx << "SPcod_code_block_style: " << int(m_codeBlockStyle) << "\n"
+       << pfx << "SPcod_transformation: " << int(m_transformation) << "\n"
+       << pfx << "SPcod_precinct_size: " << int(m_precinctSize)
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+std::string ossimJ2kCodRecord::getProgressionOrderAsString( ossim_uint8 progressionOrder ) const
+{
+   std::string result;
+   
+   if ( progressionOrder == 0x00 )
+   {
+      result = "LRCP";
+   }
+   else if ( progressionOrder == 0x01 )
+   {
+      result = "RLCP";
+   }
+   else if ( progressionOrder == 0x02 )
+   {
+      result = "RPCL";
+   }
+   else if ( progressionOrder == 0x03 )
+   {
+      result = "PCRL";
+   }
+   else if ( progressionOrder == 0x04 )
+   {
+      result = "CPRL";
+   }
+   else
+   {
+      result = "unknown";
+   }
+   
+   return result;
+}
+
+ossim_uint8 ossimJ2kCodRecord::getProgressionOrder() const
+{
+   return m_progressionOrder;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimJ2kCodRecord& obj)
+{
+   return obj.print(out);
+}
diff --git a/src/support_data/ossimJ2kInfo.cpp b/src/support_data/ossimJ2kInfo.cpp
new file mode 100644
index 0000000..304768a
--- /dev/null
+++ b/src/support_data/ossimJ2kInfo.cpp
@@ -0,0 +1,238 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: J2K Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimJ2kInfo.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+// #include <ossim/support_data/ossimJ2kCommon.h>
+#include <ossim/support_data/ossimJ2kCodRecord.h>
+#include <ossim/support_data/ossimJ2kSizRecord.h>
+#include <ossim/support_data/ossimJ2kSotRecord.h>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimJ2kInfo:debug");
+static ossimTrace traceDump("ossimJ2kInfo:dump"); // This will dump offsets.
+
+ossimJ2kInfo::ossimJ2kInfo()
+   : ossimInfoBase(),
+     m_file(),
+     m_endian(0)
+{
+   // See if we need to byte swap.  J2k, JP2 boxes are big endian.
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      m_endian = new ossimEndian();
+   }
+}
+
+ossimJ2kInfo::~ossimJ2kInfo()
+{
+   if (m_endian)
+   {
+      delete m_endian;
+      m_endian = 0;
+   }
+}
+
+bool ossimJ2kInfo::open(const ossimFilename& file)
+{
+   bool result = false;
+
+   //---
+   // Open the file.
+   //---
+   std::ifstream str(file.c_str(), std::ios_base::binary|std::ios_base::in);
+   if (str.good()) 
+   {
+      //---
+      // Check for the Start Of Codestream (SOC) and Size (SIZ) markers which
+      // are required as first and second fields in the main header.
+      //---
+      ossim_uint16 soc;
+      ossim_uint16 siz;
+      readUInt16(soc, str);
+      readUInt16(siz, str);
+
+      const ossim_uint16 SOC_MARKER = 0xff4f; // start of codestream marker
+      const ossim_uint16 SIZ_MARKER = 0xff51; // size maker
+      
+      if ( (soc == SOC_MARKER) && (siz == SIZ_MARKER) )
+      {
+         result = true; // Is a j2k...
+      }
+   }
+
+   if (result)
+   {
+      
+      m_file = file;
+   }
+   else
+   {
+      m_file.clear();
+      if (m_endian)
+      {
+         delete m_endian;
+         m_endian = 0;
+      }
+   }
+
+   return result;
+}
+
+std::ostream& ossimJ2kInfo::print(std::ostream& out) const
+{
+   static const char MODULE[] = "ossimJ2kInfo::print";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG Entered...\n";
+   }
+
+   if ( m_file.size() )
+   {  
+      // Open the file.
+      std::ifstream str(m_file.c_str(), std::ios_base::binary|std::ios_base::in);
+      if (str.good())
+      {
+         ossim_uint16 marker;
+         readUInt16(marker, str); // SOC
+         readUInt16(marker, str); // SIZ
+         
+         std::string prefix = "j2k.";
+         
+         // SIZ marker required next.
+         printSizMarker(out, prefix, str);
+         
+         readUInt16(marker, str);
+
+         const ossim_uint16 COD_MARKER = 0xff52; // cod maker
+         const ossim_uint16 EOC_MARKER = 0xffd9; // End of codestream marker.
+         const ossim_uint16 SOT_MARKER = 0xff90; // start of tile marker
+         
+         while ( str.good() && (marker != EOC_MARKER) )
+         {
+            switch(marker)
+            {
+               case COD_MARKER:
+               {
+                  printCodMarker(out, prefix, str);
+                  break;
+               }
+               case SOT_MARKER:
+               {
+                  printSotMarker(out, prefix, str);
+                  break;
+               }
+               default:
+               {
+                  printUnknownMarker(out, prefix, str, marker);
+               }
+            }
+            
+            readUInt16(marker, str);
+            
+         }
+      }
+   }
+
+   return out;
+}
+
+void ossimJ2kInfo::readUInt16(ossim_uint16& s, std::ifstream& str) const
+{
+   str.read((char*)&s, 2);
+   if (m_endian)
+   {
+      m_endian->swap(s);
+   }
+}
+
+std::ostream& ossimJ2kInfo::printCodMarker(std::ostream& out,
+                                           const std::string& prefix,
+                                           std::ifstream& str) const
+{
+   ossimJ2kCodRecord siz;
+   siz.parseStream(str);
+   siz.print(out, prefix);
+   return out;
+}
+
+std::ostream& ossimJ2kInfo::printSizMarker(std::ostream& out,
+                                           const std::string& prefix,
+                                           std::ifstream& str) const
+{
+   ossimJ2kSizRecord siz;
+   siz.parseStream(str);
+   siz.print(out, prefix);
+   return out;
+}
+
+std::ostream& ossimJ2kInfo::printSotMarker(std::ostream& out,
+                                           const std::string& prefix,
+                                           std::ifstream& str) const
+{
+   // Get the stream posistion.
+   std::streamoff pos = str.tellg();
+   
+   ossimJ2kSotRecord sot;
+   sot.parseStream(str);
+   pos += sot.thePsot - 2;
+
+   // Seek past the tile to the next marker.
+   str.seekg(pos, std::ios_base::beg);
+   
+   sot.print(out,prefix);
+   return out;
+}
+
+
+std::ostream& ossimJ2kInfo::printUnknownMarker(std::ostream& out,
+                                               const std::string& prefix,
+                                               std::ifstream& str,
+                                               ossim_uint16 marker) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   ossim_uint16 segmentLength;
+   readUInt16(segmentLength, str);
+
+   std::string pfx = prefix;
+   pfx += "unknown.";
+
+   out.setf(std::ios_base::hex, std::ios_base::basefield);
+   out << pfx << "marker: 0x" << std::setfill('0') << std::setw(4)
+       << marker << "\n";
+   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
+   
+   out << pfx << "length: " << segmentLength
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+
+   // Seek to the next marker.
+   str.seekg( (segmentLength-2), std::ios_base::cur);
+
+   return out;
+}
+      
+
diff --git a/src/support_data/ossimJ2kSizRecord.cpp b/src/support_data/ossimJ2kSizRecord.cpp
new file mode 100644
index 0000000..3fc1335
--- /dev/null
+++ b/src/support_data/ossimJ2kSizRecord.cpp
@@ -0,0 +1,295 @@
+//---
+//
+// License: MIT
+//
+// Author:  David Burken
+//
+// Description: Container class for J2K Image and tile size (SIZ) record.
+//
+// See document BPJ2K01.00 Table 7-6 Image and tile size (15444-1 Annex A5.1)
+// 
+//---
+// $Id$
+
+#include <ossim/support_data/ossimJ2kSizRecord.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimIoStream.h>
+#include <iostream>
+#include <iomanip>
+
+
+ossimJ2kSizRecord::ossimJ2kSizRecord()
+   :
+   m_marker(0xff51),
+   m_Lsiz(0),
+   m_Rsiz(0),
+   m_Xsiz(0),
+   m_Ysiz(0),
+   m_XOsiz(0),
+   m_YOsiz(0),
+   m_XTsiz(0),
+   m_YTsiz(0),
+   m_XTOsiz(0),
+   m_YTOsiz(0),
+   m_Csiz(0),
+   m_Ssiz(0),
+   m_XRsiz(0),
+   m_YRsiz(0)
+{
+}
+
+ossimJ2kSizRecord::~ossimJ2kSizRecord()
+{
+}
+
+void ossimJ2kSizRecord::parseStream(ossim::istream& in)
+{
+   // Note: Marker is not read.
+   in.read((char*)&m_Lsiz,      2);
+   in.read((char*)&m_Rsiz,      2);
+   in.read((char*)&m_Xsiz,      4);
+   in.read((char*)&m_Ysiz,      4);
+   in.read((char*)&m_XOsiz,     4);
+   in.read((char*)&m_YOsiz,     4);
+   in.read((char*)&m_XTsiz,     4);
+   in.read((char*)&m_YTsiz,     4);
+   in.read((char*)&m_XTOsiz,    4);
+   in.read((char*)&m_YTOsiz,    4);
+   in.read((char*)&m_Csiz,      2);
+
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      // Stored in file big endian, must swap.
+      ossimEndian s;
+      s.swap(m_Lsiz);
+      s.swap(m_Rsiz);
+      s.swap(m_Xsiz);
+      s.swap(m_Ysiz);
+      s.swap(m_XOsiz);
+      s.swap(m_YOsiz);
+      s.swap(m_XTsiz);
+      s.swap(m_YTsiz);
+      s.swap(m_XTOsiz);
+      s.swap(m_YTOsiz);
+      s.swap(m_Csiz);
+   }
+
+   m_Ssiz.resize( m_Csiz );
+   in.read((char*)&m_Ssiz.front(), m_Csiz);
+   
+   m_XRsiz.resize( m_Csiz );
+   in.read((char*)&m_XRsiz.front(), m_Csiz);
+   
+   m_YRsiz.resize( m_Csiz );
+   in.read((char*)&m_YRsiz.front(), m_Csiz);
+}
+
+void ossimJ2kSizRecord::writeStream(std::ostream& out)
+{
+   // Length of this marker segment(marker not included):
+   m_Lsiz = 38 + 3*m_Csiz;
+
+   // Grab component count before swapping:
+   ossim_uint16 components = m_Csiz;
+
+   ossimEndian* s = 0;
+   
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      // Stored in file big endian, must swap.
+      s = new ossimEndian();
+      s->swap(m_Lsiz);
+      s->swap(m_Rsiz);
+      s->swap(m_Xsiz);
+      s->swap(m_Ysiz);
+      s->swap(m_XOsiz);
+      s->swap(m_YOsiz);
+      s->swap(m_XTsiz);
+      s->swap(m_YTsiz);
+      s->swap(m_XTOsiz);
+      s->swap(m_YTOsiz);
+      s->swap(m_Csiz);
+   }
+
+   out.put( 0xff );
+   out.put( 0x51 );
+   // out.write( (char*)&m_marker, 2 );
+   
+   out.write((char*)&m_Lsiz,    2);
+   out.write((char*)&m_Rsiz,    2);
+   out.write((char*)&m_Xsiz,    4);
+   out.write((char*)&m_Ysiz,    4);
+   out.write((char*)&m_XOsiz,   4);
+   out.write((char*)&m_YOsiz,   4);
+   out.write((char*)&m_XTsiz,   4);
+   out.write((char*)&m_YTsiz,   4);
+   out.write((char*)&m_XTOsiz,  4);
+   out.write((char*)&m_YTOsiz,  4);
+   out.write((char*)&m_Csiz,    2);
+
+   out.write((char*)&m_Ssiz.front(),  components);
+   out.write((char*)&m_XRsiz.front(), components);
+   out.write((char*)&m_YRsiz.front(), components);
+
+   if ( s )
+   {
+      // Swap it back to native.
+      s->swap(m_Lsiz);
+      s->swap(m_Rsiz);
+      s->swap(m_Xsiz);
+      s->swap(m_Ysiz);
+      s->swap(m_XOsiz);
+      s->swap(m_YOsiz);
+      s->swap(m_XTsiz);
+      s->swap(m_YTsiz);
+      s->swap(m_XTOsiz);
+      s->swap(m_YTOsiz);
+      s->swap(m_Csiz);
+
+      // Cleanup:
+      delete s;
+      s = 0;
+   }   
+}
+
+ossimScalarType ossimJ2kSizRecord::getScalarType() const
+{
+   // Currently assumes all components the same scalar type.
+   
+   ossimScalarType result = OSSIM_SCALAR_UNKNOWN;
+
+   if ( m_Ssiz.size() )
+   {
+      // Bits per pixel first seven bits plus one.
+      ossim_uint8 bpp = ( m_Ssiz[0] & 0x3f ) + 1;
+      
+      // Signed bit is msb.
+      bool isSigned = ( m_Ssiz[0] & 0x80 ) ? true : false;
+      
+      if ( bpp <= 8 )
+      {
+         if ( isSigned == 0 )
+         {
+            result = OSSIM_UINT8;
+         }
+         else if (isSigned == 1)
+         {
+            result = OSSIM_SINT8;
+         }
+      }
+      else if ( bpp == 11 )
+      {
+         if ( isSigned == 0 )
+         {
+            result = OSSIM_USHORT11;
+         }
+         else
+         {
+            result = OSSIM_SINT16;
+         }
+      }
+      else if ( bpp == 12 )
+      {
+         if ( isSigned == 0 )
+         {
+            result = OSSIM_USHORT12;
+         }
+         else
+         {
+            result = OSSIM_SINT16;
+         }
+      }
+      else if ( bpp == 13 )
+      {
+         if ( isSigned == 0 )
+         {
+            result = OSSIM_USHORT13;
+         }
+         else
+         {
+            result = OSSIM_SINT16;
+         }
+      }
+      else if ( bpp == 14 )
+      {
+         if ( isSigned == 0 )
+         {
+            result = OSSIM_USHORT14;
+         }
+         else
+         {
+            result = OSSIM_SINT16;
+         }
+      }
+      else if ( bpp == 15 )
+      {
+         if ( isSigned == 0 )
+         {
+            result = OSSIM_USHORT15;
+         }
+         else
+         {
+            result = OSSIM_SINT16;
+         }
+      }
+      else if( bpp <= 16 )
+      {
+         if( isSigned == 0 )
+         {
+            result = OSSIM_UINT16;
+         }
+         else if( isSigned == 1 )
+         {
+            result = OSSIM_SINT16;
+         }
+      }
+   }
+   return result;
+}
+
+std::ostream& ossimJ2kSizRecord::print(std::ostream& out,
+                                       const std::string& prefix) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   std::string pfx = prefix;
+   pfx += "siz.";
+   
+   out.setf(std::ios_base::hex, std::ios_base::basefield);
+   out << pfx << "marker: 0x" << m_marker << "\n";
+   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
+
+   out << pfx << "Lsiz:   " << m_Lsiz       << "\n"
+       << pfx << "Rsiz:   " << m_Rsiz       << "\n"
+       << pfx << "Xsiz:   " << m_Xsiz       << "\n"
+       << pfx << "Yziz:   " << m_Ysiz       << "\n"
+       << pfx << "XOsiz:  " << m_XOsiz      << "\n"
+       << pfx << "YOsiz:  " << m_YOsiz      << "\n"
+       << pfx << "XTsiz:  " << m_XTsiz      << "\n"
+       << pfx << "YTsiz:  " << m_YTsiz      << "\n"
+       << pfx << "XTOsiz: " << m_XTOsiz     << "\n"
+       << pfx << "YTOsiz: " << m_YTOsiz     << "\n"
+       << pfx << "Csiz:   " << m_Csiz       << "\n";
+   
+   for ( ossim_uint16 i = 0; i < m_Csiz; ++i )
+   {
+      out << pfx << "Ssiz[" << i  << "]:  " << int(m_Ssiz[i])  << "\n"
+          << pfx << "XRsiz[" << i << "]:  " << int(m_XRsiz[i]) << "\n"
+          << pfx << "YRsiz[" << i << "]:  " << int(m_YRsiz[i]) << "\n";
+   }
+
+   out.flush();
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimJ2kSizRecord& obj)
+{
+   return obj.print(out);
+}
diff --git a/src/support_data/ossimJ2kSotRecord.cpp b/src/support_data/ossimJ2kSotRecord.cpp
new file mode 100644
index 0000000..e2d2190
--- /dev/null
+++ b/src/support_data/ossimJ2kSotRecord.cpp
@@ -0,0 +1,127 @@
+//---
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Container class for J2K "Start Of Tile" (SOT) record.
+//
+// marker: FF90
+//
+// See document BPJ2K01.00 Table 7-3 Image and tile size (15444-1 Annex A.4.2)
+// 
+//---
+// $Id$
+
+#include <ossim/support_data/ossimJ2kSotRecord.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+
+#include <iostream>
+#include <iomanip>
+
+ossimJ2kSotRecord::ossimJ2kSotRecord()
+   :
+   theLsot(0),
+   theIsot(0),
+   thePsot(0),
+   theTpsot(0),
+   theTnsot(0)
+{
+}
+
+ossimJ2kSotRecord::~ossimJ2kSotRecord()
+{
+}
+
+void ossimJ2kSotRecord::parseStream(std::istream& in)
+{
+   // Note: marker not read...
+   
+   in.read((char*)&theLsot,  2);
+   in.read((char*)&theIsot,  2);
+   in.read((char*)&thePsot,  4);
+   in.read((char*)&theTpsot, 1);
+   in.read((char*)&theTnsot, 1);
+
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      // Stored big endian, must swap.
+      ossimEndian endian;
+      endian.swap(theLsot);
+      endian.swap(theIsot);
+      endian.swap(thePsot);
+   }
+}
+
+void ossimJ2kSotRecord::writeStream(std::ostream& out)
+{
+   ossimEndian* endian = 0;
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      // Stored in file big endian, must swap.
+      endian = new ossimEndian();
+      endian->swap( theLsot );
+      endian->swap( theIsot );
+      endian->swap( thePsot );      
+   }
+   
+   // Marker 0xff90:
+   out.put( 0xff );
+   out.put( 0x90 );
+   
+   out.write( (char*)&theLsot,  2);
+   out.write( (char*)&theIsot,  2);
+   out.write( (char*)&thePsot,  4);
+   out.write( (char*)&theTpsot, 1);
+   out.write( (char*)&theTnsot, 1);   
+      
+   if ( endian )
+   {
+      // Swap back to native:
+      endian->swap(theLsot);
+      endian->swap(theIsot);
+      endian->swap(thePsot);
+
+      delete endian;
+      endian = 0;
+   }  
+}
+
+void ossimJ2kSotRecord::setIsot( ossim_uint16 isot )
+{
+   theIsot = isot;
+}
+
+std::ostream& ossimJ2kSotRecord::print(std::ostream& out,
+                                       const std::string& prefix) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   std::string pfx = prefix;
+   pfx += "sot.";
+
+   out.setf(std::ios_base::hex, std::ios_base::basefield);
+   out << pfx << "marker: 0xff90\n";
+   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
+
+   out << pfx << "Lsot:   "  << theLsot      << "\n"
+       << pfx << "Isot:   "  << theIsot      << "\n"
+       << pfx << "Psot:   "  << thePsot      << "\n"
+       << pfx << "Tpsot:  " << int(theTpsot) << "\n"
+       << pfx << "Tnsot:  " << int(theTnsot)
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimJ2kSotRecord& obj)
+{
+   return obj.print(out);
+}
diff --git a/src/support_data/ossimJ2kTlmRecord.cpp b/src/support_data/ossimJ2kTlmRecord.cpp
new file mode 100644
index 0000000..1754f71
--- /dev/null
+++ b/src/support_data/ossimJ2kTlmRecord.cpp
@@ -0,0 +1,536 @@
+//---
+// 
+// License: MIT
+//
+// Author: David Burken
+// 
+// Description: Container class definition for J2K Tile-part lengths record.
+// See document BPJ2K01.10 Table 7-21 for detailed description.
+//
+// $Id$
+//---
+
+#include <ossim/support_data/ossimJ2kTlmRecord.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNotify.h>
+#include <iostream>
+#include <iomanip>
+#include <cstring>
+
+
+ossimJ2kTlmRecord::ossimJ2kTlmRecord()
+   :
+   m_Ltlm(0),
+   m_Ztlm(0),
+   m_Stlm(0x40), // Tiles in order 32 bit Ptlm
+   m_Ttlm(0),
+   m_Ptlm(0)
+{
+}
+
+ossimJ2kTlmRecord::~ossimJ2kTlmRecord()
+{
+   clear();
+}
+
+void ossimJ2kTlmRecord::clear()
+{
+   clearTtlm();
+   clearPtlm();
+}
+
+void ossimJ2kTlmRecord::clearTtlm()
+{
+   if ( m_Ttlm )
+   {
+      ossim_uint8 st = getSt();
+      if ( st == 1 )
+      {
+         ossim_uint8* p = (ossim_uint8*)m_Ttlm;
+         delete [] p;
+      }
+      else if ( st == 2 )
+      {
+         ossim_uint16* p = (ossim_uint16*)m_Ttlm;
+         delete [] p;
+      }
+      m_Ttlm = 0;
+   }
+}
+
+void ossimJ2kTlmRecord::clearPtlm()
+{
+   if ( m_Ptlm )
+   {
+      ossim_uint8 sp = getSp();
+      if ( sp == 0 )
+      {
+         ossim_uint16* p = (ossim_uint16*)m_Ptlm;
+         delete [] p;
+      }
+      else if ( sp == 1 )
+      {
+         ossim_uint32* p = (ossim_uint32*)m_Ptlm;
+         delete [] p;
+      }
+      m_Ptlm = 0;
+   }
+}
+
+void ossimJ2kTlmRecord::parseStream(ossim::istream& in)
+{
+   clear(); // Deletes m_Ttlm and m_Ptlm arrays if they exist.
+   
+   ossimEndian* endian = 0;
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      // Stored big endian, must swap.
+      endian = new ossimEndian();
+   }
+   
+   // Get the stream posistion.
+   std::streamoff pos = in.tellg();
+   
+   // Note: Marker is not read.
+
+   // Length of segment minus marker.
+   in.read((char*)&m_Ltlm, 2);
+   if ( endian )
+   {
+      endian->swap(m_Ltlm);
+   }
+
+   // Index of marker segment relative to all other TLM marker segments.
+   in.read((char*)&m_Ztlm, 1);
+
+   // Stlm contains two variables in one byte, ST and SP.
+   in.read((char*)&m_Stlm, 1);
+
+   ossim_uint16 tile_count = getTileCount();
+   if ( tile_count )
+   {
+      ossim_uint8 st = getSt();
+
+      //---
+      // Get the Ttlm array if any:
+      // st value of 0 means tiles are in order and no Ttlm array.
+      //---
+      if ( st == 1 ) // 8 bit
+      {
+         ossim_uint8* p = new ossim_uint8[tile_count];
+         in.read((char*)p, tile_count);
+         m_Ttlm = p;
+      }
+      else if ( st == 2 ) // 16 bit
+      {
+         ossim_uint16* p = new ossim_uint16[tile_count];
+         in.read((char*)p, tile_count*2);
+         if ( endian )
+         {
+            endian->swap(p, tile_count);
+         }
+         m_Ttlm = p;
+      }
+      else if ( st > 2 )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimJ2kTlmRecord::parseStream(...) Bad tlm ST value!"
+            << std::endl;
+      }
+      
+      // Get the Ptlm array:
+      ossim_uint8 sp = getSp();
+      if ( sp == 0 ) // 16 bit
+      {
+         ossim_uint16* p = new ossim_uint16[tile_count];
+         in.read((char*)p, tile_count*2);
+         if ( endian )
+         {
+            endian->swap(p, tile_count);
+         }
+         m_Ptlm = p;
+      }
+      else if ( sp == 1 ) // 32 bit
+      {
+         ossim_uint32* p = new ossim_uint32[tile_count];
+         in.read((char*)p, tile_count*4);
+         if ( endian )
+         {
+            endian->swap(p, tile_count);
+         }
+         m_Ptlm = p;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimJ2kTlmRecord::parseStream(...) Bad tlm SP value!"
+            << std::endl;
+      }
+   }
+
+   // Clean up::
+   if ( endian )
+   {
+      delete endian;
+      endian = 0;
+   }  
+   
+   //---
+   // Seek to next record in case there was a parse error and we didn't read
+   // all bytes.
+   //---
+   in.seekg(pos + m_Ltlm, std::ios_base::beg);
+}
+
+void ossimJ2kTlmRecord::writeStream(std::ostream& out)
+{
+   ossim_uint16 tileCount = getTileCount();
+   ossim_uint8 st = getSt();
+   ossim_uint8 sp = getSp();
+
+   ossimEndian* endian = 0;
+   if (ossim::byteOrder() == OSSIM_LITTLE_ENDIAN)
+   {
+      // Stored in file big endian, must swap.
+      endian = new ossimEndian();
+      endian->swap( m_Ltlm );
+
+      // Conditional ttlm array:
+      if ( st == 2 )
+      {
+         endian->swap( (ossim_uint16*)m_Ttlm, tileCount );
+      }
+
+      // Conditional ptlm array:
+      if (sp == 0 )
+      {
+         endian->swap( (ossim_uint16*)m_Ptlm, tileCount );
+      }
+      else if ( sp == 1 )
+      {
+         endian->swap( (ossim_uint32*)m_Ptlm, tileCount );
+      }
+   }
+
+   // Marker 0xff55:
+   out.put( 0xff );
+   out.put( 0x55 );
+   
+   out.write( (char*)&m_Ltlm, 2);
+   out.write( (char*)&m_Ztlm, 1);
+   out.write( (char*)&m_Stlm, 1);
+
+   // Conditional array of tile indexes:
+   if ( st == 1 ) // 8 bit array
+   {
+      out.write( (char*)m_Ttlm, tileCount );
+   }
+   else if ( st == 2 ) // 16 bit array
+   {
+      out.write( (char*)m_Ttlm, tileCount*2 );
+   }
+
+   // Conditional array of tile byte counts:
+   if ( sp == 0 )  // 16 bit array
+   {
+      out.write( (char*)m_Ptlm, tileCount*2 );
+   }
+   else if ( sp == 1 ) // 32 bit array
+   {
+      out.write( (char*)m_Ptlm, tileCount*4 ); 
+   }
+
+   if ( endian )
+   {
+      // Swap back to native:
+      endian->swap( m_Ltlm );
+
+      // Conditional ttlm array:
+      if ( st == 2 )
+      {
+         endian->swap( (ossim_uint16*)m_Ttlm, tileCount );
+      }
+
+      // Conditional ptlm array:
+      if (sp == 0 )
+      {
+         endian->swap( (ossim_uint16*)m_Ptlm, tileCount );
+      }
+      else if ( sp == 1 )
+      {
+         endian->swap( (ossim_uint32*)m_Ptlm, tileCount );
+      }
+
+      // Cleanup:      
+      delete endian;
+      endian = 0;
+   }
+}
+
+ossim_uint8 ossimJ2kTlmRecord::getSt() const
+{
+   // 5th and 6th bits.
+   return (m_Stlm & 0x30) >> 4;
+}
+
+bool ossimJ2kTlmRecord::setSt(ossim_uint8 bits )
+{
+   bool result = true;
+   
+   // 5th and 6th bits
+   if ( bits == 0 )
+   {
+      // Clear both 5th and 6th bit.
+      m_Stlm = m_Stlm & 0xcf;
+   }
+   else if ( bits == 1 )
+   {
+      // Set the 5th bit clear the 6th bit.
+      m_Stlm = (m_Stlm & 0xdf) | 0x10;
+   }
+   else if ( bits == 2 )
+   {
+      // Set the 6th bit, clear the 5th bit.
+      m_Stlm = (m_Stlm & 0xef) | 0x20;
+   }
+   else
+   {
+      result = false;
+   }  
+
+   return result;
+}
+
+ossim_uint8 ossimJ2kTlmRecord::getZtlm() const
+{
+   return m_Ztlm;
+}
+
+ossim_uint8  ossimJ2kTlmRecord::getSp() const
+{
+   // Last two bits.
+   return m_Stlm >> 6;
+}
+
+bool ossimJ2kTlmRecord::setSp(ossim_uint8 bit )
+{
+   bool result = true;
+   
+   // 7th bit
+   if ( bit == 0 )
+   {
+      // Clear the 7th bit:
+      m_Stlm = m_Stlm & 0xbf;
+   }
+   else if ( bit == 1 )
+   {
+      // Set the 7th bit.
+      m_Stlm = m_Stlm | 0x40;
+   }
+   else
+   {
+      result = false;
+   }
+   return result;
+}
+
+bool ossimJ2kTlmRecord::initPtlmArray( ossim_uint8 spBit, ossim_uint16 count )
+{
+   bool result = setSp( spBit );
+
+   clearPtlm();
+
+   if ( spBit == 0 )
+   {
+      m_Ptlm = new ossim_uint16[count];
+      std::memset( m_Ptlm, 0, count*2 );
+   }
+   else if ( spBit == 1 )
+   {
+      m_Ptlm = new ossim_uint32[count];
+      std::memset( m_Ptlm, 0, count*4 );
+   }
+
+   m_Ltlm = computeLength( count );
+
+   return result;
+}
+
+ossim_uint16 ossimJ2kTlmRecord::getTileCount() const
+{
+   // See Table 7-21 BPJ2K01.10:
+   ossim_uint16 result = 0;
+   if ( m_Ltlm )
+   {
+      ossim_uint8 st = getSt();
+      ossim_uint8 sp = getSp();
+      ossim_uint16 x = st + (sp==0?2:4);
+      if ( x )
+      {
+         result = (m_Ltlm - 4) / x;
+      }
+   }
+   return result;
+}
+
+bool ossimJ2kTlmRecord::getTileLength( ossim_int32 index, ossim_uint32& length ) const
+{
+   bool status = false;
+   if ( (index >= 0) && ( index < getTileCount() ) )
+   {
+      ossim_uint8 sp = getSp();
+      if ( sp == 0 )
+      {
+         ossim_uint16* p = (ossim_uint16*)m_Ptlm;
+         length = p[index];
+         status = true;
+      }
+      else if ( sp == 1 )
+      {
+         ossim_uint32* p = (ossim_uint32*)m_Ptlm;
+         length = p[index];
+         status = true;
+      }
+   }
+
+   return status;
+}
+
+bool ossimJ2kTlmRecord::setTileLength(
+   ossim_int32 index, ossim_uint32 length )
+{
+   bool status = false;
+   if ( (index >= 0) && ( index < getTileCount() ) )
+   {
+      ossim_uint8 sp = getSp();
+      if ( sp == 0 )
+      {
+         ossim_uint16* p = (ossim_uint16*)m_Ptlm;
+         p[index] = static_cast<ossim_uint16>(length);
+         status = true;
+      }
+      else if ( sp == 1 )
+      {
+         ossim_uint32* p = (ossim_uint32*)m_Ptlm;
+         p[index] = length;
+         status = true;
+      }
+   }
+   
+   return status;
+}
+
+bool ossimJ2kTlmRecord::accumulate(
+   ossim_int32 first, ossim_int32 last, std::streampos& init ) const
+{
+   bool status = false;
+   if ( (first >= 0) && (last>first) && (last <= getTileCount()) )
+   {
+      ossim_uint8 sp = getSp();
+      if ( sp == 0 )
+      {
+         ossim_uint16* p = (ossim_uint16*)m_Ptlm;
+         for ( ossim_int32 i = first; i < last; ++i )
+         {
+            init += p[i];
+            status = true;
+         }            
+      }
+      else if ( sp == 1 )
+      {
+         ossim_uint32* p = (ossim_uint32*)m_Ptlm;
+         for ( ossim_int32 i = first; i < last; ++i )
+         {
+            init += p[i];
+            status = true;
+         }
+      }
+   }
+   return status;
+}
+
+ossim_uint16 ossimJ2kTlmRecord::computeLength( ossim_uint16 tileCount ) const
+{
+   return 4 + ( getSt() + (getSp()==1?4:2) ) * tileCount;
+}
+
+std::ostream& ossimJ2kTlmRecord::print(std::ostream& out,
+                                       const std::string& prefix) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   std::string pfx = prefix;
+   pfx += "tlm.";
+   
+   out << pfx << "marker:  0xff55\n"
+       << pfx << "Ltlm:    " << m_Ltlm       << "\n"
+       << pfx << "Ztlm:    " << int(m_Ztlm)  << "\n";
+
+   out.setf(std::ios_base::hex, std::ios_base::basefield);
+   out << pfx << "Stlm:    0x" << int(m_Stlm) << "\n";
+   out.setf(std::ios_base::fmtflags(0), std::ios_base::basefield);
+   out << pfx << "Stlm.ST: " << int(getSt()) << "\n"
+       << pfx << "Stlm.SP: " << int(getSp()) << "\n";
+
+   ossim_uint16 tile_count = getTileCount();
+   if ( tile_count )
+   {
+      ossim_uint8 st = getSt();
+      if ( m_Ttlm == 0 )
+      {
+         out << pfx << "Ttlm:    null\n";
+      }
+      else if ( st == 1 ) // 8 bit
+      {
+         ossim_uint8* p = (ossim_uint8*)m_Ttlm;
+         for ( ossim_uint16 i = 0; i < tile_count; ++i )
+         {
+            out << pfx << "Ttlm[" << i << "]: " << (int)p[i] << "\n";
+         }
+      }
+      else if ( st == 2 ) // 16 bit
+      {
+         ossim_uint16* p = (ossim_uint16*)m_Ttlm;
+         for ( ossim_uint16 i = 0; i < tile_count; ++i )
+         {
+            out << pfx << "Ttlm[" << i << "]: " << p[i] << "\n";
+         }
+      }
+
+      ossim_uint8 sp = getSp();
+      if ( sp == 0 ) // 16 bit
+      {
+         ossim_uint16* p = (ossim_uint16*)m_Ptlm;
+         for ( ossim_uint16 i = 0; i < tile_count; ++i )
+         {
+            out << pfx << "Ptlm[" << i << "]: " << p[i] << "\n";
+         }
+      }
+      else if ( sp == 1 ) // 32 bit
+      {
+         ossim_uint32* p = (ossim_uint32*)m_Ptlm;
+         for ( ossim_uint16 i = 0; i < tile_count; ++i )
+         {
+            out << pfx << "Ptlm[" << i << "]: " << p[i] << "\n";
+         }
+      }
+   }
+   
+   out.flush();
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimJ2kTlmRecord& obj)
+{
+   return obj.print(out);
+}
+
+
diff --git a/src/support_data/ossimJp2Info.cpp b/src/support_data/ossimJp2Info.cpp
new file mode 100644
index 0000000..d23481d
--- /dev/null
+++ b/src/support_data/ossimJp2Info.cpp
@@ -0,0 +1,685 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: JP2 Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimJp2Info.cpp 23222 2015-04-05 15:44:57Z dburken $
+
+#include <ossim/support_data/ossimJp2Info.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTrace.h>
+// #include <ossim/support_data/ossimJ2kCommon.h>
+#include <ossim/support_data/ossimTiffInfo.h>
+#include <fstream>
+#include <istream>
+#include <iostream>
+
+static ossimTrace traceDebug("ossimJp2Info:debug");
+
+ossimJp2Info::ossimJp2Info()
+   : ossimJ2kInfo()
+{
+}
+
+ossimJp2Info::~ossimJp2Info()
+{
+}
+
+bool ossimJp2Info::open(const ossimFilename& file)
+{
+   bool result = false;
+
+   std::ifstream str;
+   str.open( file.c_str(), std::ios_base::in | std::ios_base::binary);
+
+   if ( str.is_open() )
+   {
+      const ossim_uint8 J2K_SIGNATURE_BOX[SIGNATURE_BOX_SIZE] = 
+         {0x00,0x00,0x00,0x0c,0x6a,0x50,0x20,0x20,0x0d,0x0a,0x87,0x0a};
+      
+      ossim_uint8 box[SIGNATURE_BOX_SIZE];
+      
+      // Read in the box.
+      str.read((char*)box, SIGNATURE_BOX_SIZE);
+      
+      result = true;
+      for (ossim_uint32 i = 0; i < SIGNATURE_BOX_SIZE; ++i)
+      {
+         if (box[i] != J2K_SIGNATURE_BOX[i])
+         {
+            result = false;
+            break;
+         }
+      }
+      
+      str.close();
+   }
+
+   if ( result )
+   {
+      m_file = file; // Capture file name.
+   }
+   
+   return result;
+}
+
+std::ostream& ossimJp2Info::print(std::ostream& out) const
+{
+   if ( m_file.size() )
+   {
+      // Open the file.
+      std::ifstream str( m_file.c_str(), std::ios_base::in | std::ios_base::binary );
+      if (str.good())
+      {
+         //---
+         // ISO/IEC 15444-1:2004 (E)
+         // LBox, Box Length. This field specifies the length of the box, stored
+         // as a 4-byte big endian unsigned integer. This value includes all of
+         // the fields of the box, including the length and type. If the value
+         // of this field is 1, then the XLBox field shall exist and the value
+         // of that field shall be the actual length of the box. If the value
+         // of this field is 0, then the length of the box was not known when
+         // the LBox field was written. In this case, this box contains all
+         // bytes up to the end of the file. If a box of length 0 is contained
+         // within another box (its superbox), then the length of that superbox
+         // shall also be 0.  This means that this box is the last box in the
+         // file. The values 2-7 are reserved for ISO use.
+         //---
+         ossim_uint32 lbox  = 0;
+         ossim_uint32 tbox  = 0;
+         ossim_uint64 xlbox = 0;
+
+         const ossim_uint32 UUID_TYPE = 0x75756964;
+         const ossim_uint8 GEOTIFF_UUID[GEOTIFF_UUID_SIZE] = 
+            {
+               0xb1, 0x4b, 0xf8, 0xbd,
+               0x08, 0x3d, 0x4b, 0x43,
+               0xa5, 0xae, 0x8c, 0xd7,
+               0xd5, 0xa6, 0xce, 0x03
+            };
+         
+         while ( str.good() )
+         {
+            std::streamoff boxPos = str.tellg();
+            
+            readUInt32( lbox, str );
+            readUInt32( tbox, str );
+            
+            if ( 1 == lbox )
+            {
+               readUInt64( xlbox, str );
+            }
+
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "jp2.lbox: " << std::dec << lbox << "\n"
+                  << "jp2.tbox: " << std::hex << tbox << std::dec << "\n";
+               printTboxType( tbox, ossimNotify(ossimNotifyLevel_DEBUG)  );
+
+               if ( 1 == lbox )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG) << "jp2.xlbox: " << xlbox << std::endl;
+               }
+            }            
+            
+            if (tbox == UUID_TYPE)
+            {
+               // Check for GeoTIFF box.
+               
+               ossim_uint8 geotiffUuid[GEOTIFF_UUID_SIZE];
+               
+               // Read in the id.
+               str.read((char*)geotiffUuid, GEOTIFF_UUID_SIZE);
+
+#if 0
+               bool foundIt = true;
+               for (ossim_uint32 i = 0; i < GEOTIFF_UUID_SIZE; ++i)
+               {
+                  if (geotiffUuid[i] != GEOTIFF_UUID[i])
+                  {
+                     foundIt = false;
+                     break;
+                  }
+               }
+#endif
+               
+               if( memcmp( (char*)geotiffUuid, GEOTIFF_UUID, GEOTIFF_UUID_SIZE) == 0)
+               {
+                  //---
+                  // Feed the stream to the tiff info object to get a keyword
+                  // list with geometry/projection info.
+                  //---
+                  ossimTiffInfo info;
+                  
+                  //---
+                  // Have geotiff boxes with badly terminated geotiffs. So to keep
+                  // the tag parser from walking past the first image file directory
+                  // (IFD) into garbage we will set the process overview flag to false.
+                  //
+                  // Note if we ever get multiple entries we will need to take this out.
+                  //---
+                  info.setProcessOverviewFlag(false);
+
+                  // Do a print to a memory stream.
+                  std::ostringstream os;
+                  info.print(str, os);
+
+                  // Open an input stream to pass to the keyword list.
+                  std::istringstream in( os.str() );
+                  
+                  ossimKeywordlist kwl;
+                  if ( kwl.parseStream(in) )      
+                  {
+                     kwl.addPrefixToAll( ossimString("jp2.") );
+
+                     // Print it:
+                     out << kwl << std::endl;
+                  }
+                  
+                  // Get out of while loop.
+                  // break;
+               }
+            }
+
+            if (lbox == 0) // last box?
+            {
+               break;
+            }
+            
+            // Seek to the next box.  If xlbox is 1
+            if (lbox == 1)
+            {
+               boxPos += (std::streamoff)xlbox;
+            }
+            else
+            {
+               boxPos += (std::streamoff)lbox;
+            }
+
+            // Go to next box:
+            str.seekg(boxPos, std::ios_base::beg);
+            
+         } // matches: while ( str.good() )
+         
+         // Close the stream.
+         str.close();
+         
+      } // matches: if ( str.is_open() )
+      
+   } // matches: if ( m_file.size() )
+   
+   return out; 
+}
+
+void ossimJp2Info::readUInt32(ossim_uint32& i, std::ifstream& str) const
+{
+   str.read((char*)&i, 4);
+   if (m_endian)
+   {
+      m_endian->swap(i);
+   }
+}
+
+void ossimJp2Info::readUInt64(ossim_uint64& i, std::ifstream& str) const
+{
+   str.read((char*)&i, 8);
+   if (m_endian)
+   {
+      m_endian->swap(i);
+   }
+}
+
+std::streamoff ossimJp2Info::findBoxData( const ossim_uint32& type,
+                                          std::ifstream& str,
+                                          ossim_uint32& length ) const
+{
+   std::streamoff boxPos = 0;
+   std::streamoff dataPosOfType = 0;
+
+   if ( str.good() )
+   {
+      ossim_uint32   lbox   = 0;
+      ossim_uint32   tbox   = 0;
+      ossim_uint64   xlbox  = 0;
+      std::streamoff offsetToDbox = 0;
+
+      while ( str.good() )
+      {
+         boxPos = str.tellg();
+
+         readUInt32( lbox, str );
+         readUInt32( tbox, str );
+
+         if ( lbox == 1 )
+         {
+            readUInt64( xlbox, str );
+            offsetToDbox = 16;
+         }
+         else
+         {
+            offsetToDbox = 8;
+         }
+
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "jp2.lbox: " << std::dec << lbox << "\n"
+               << "jp2.tbox: " << std::hex << tbox << std::dec << "\n";
+            printTboxType( tbox, ossimNotify(ossimNotifyLevel_DEBUG)  );
+
+            if ( lbox == 1 )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG) << "jp2.xlbox: " << xlbox << std::endl;
+            }
+         }            
+
+         if ( tbox == type )
+         {
+            dataPosOfType = boxPos + offsetToDbox; // set up return value
+            length = lbox;
+            break; // done...
+         }
+
+         if ( lbox == 0 ) // last box?
+         {
+            break;
+         }
+
+         // Seek to the next box.
+         std::streamoff nextBoxPos = boxPos;
+         if (lbox == 1)
+         {
+            nextBoxPos+= (std::streamoff)xlbox;
+         }
+         else
+         {
+            nextBoxPos+= (std::streamoff)lbox;
+         }
+
+         // Go to next box:
+         str.seekg(nextBoxPos, std::ios_base::beg);
+
+      } // matches: while ( str.good() )
+
+   } // matches: if ( str.good() )
+
+   return dataPosOfType;
+}
+
+std::streamoff ossimJp2Info::getBox( const ossim_uint32 type,
+                                     bool includeAll,
+                                     std::vector<ossim_uint8>& box ) const
+{
+   std::streamoff boxPos = 0;
+
+   if ( m_file.size() )
+   {
+      // Open the file.
+      std::ifstream str( m_file.c_str(), std::ios_base::in | std::ios_base::binary );
+      if (str.good())
+      {
+         boxPos = getBox( type, includeAll, str, box ) ;
+
+      } // matches: if ( str.is_open() )
+
+   } // matches: if ( m_file.size() ) 
+
+   return boxPos;
+
+} // End: ossimJp2Info::getBox( type, includeAll, box ) const
+
+std::streamoff ossimJp2Info::getBox( const ossim_uint32& type,
+                                     bool includeAll,
+                                     std::ifstream& str,
+                                     std::vector<ossim_uint8>& box ) const
+{
+   std::streamoff boxPos = 0;
+   std::streamoff boxPosOfType = 0;
+   box.clear();
+   
+   if ( str.good() )
+   {
+      ossim_uint32   lbox   = 0;
+      ossim_uint32   tbox   = 0;
+      ossim_uint64   xlbox  = 0;
+      std::streamoff offsetToDbox = 0;
+      
+      while ( str.good() )
+      {
+         boxPos = str.tellg();
+
+         readUInt32( lbox, str );
+         readUInt32( tbox, str );
+            
+         if ( lbox == 1 )
+         {
+            readUInt64( xlbox, str );
+            offsetToDbox = 16;
+         }
+
+         if ( !includeAll )
+         {
+            if ( lbox == 1 )
+            {
+               offsetToDbox = 16;
+            }
+            else
+            {
+               offsetToDbox = 8;
+            }
+         }
+
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "jp2.lbox: " << std::dec << lbox << "\n"
+               << "jp2.tbox: " << std::hex << tbox << std::dec << "\n";
+            printTboxType( tbox, ossimNotify(ossimNotifyLevel_DEBUG)  );
+            
+            if ( 1 == lbox )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG) << "jp2.xlbox: " << xlbox << std::endl;
+            }
+         }            
+
+            
+         if ( tbox == type )
+         {
+            //---
+            // This is our box, copy it to box.
+            // Not copying the lbox,tbox or xlbox
+            std::streamoff boxSize = 0;
+            if ( lbox == 0 )
+            {
+               // Last box, goes to end of file.
+               str.seekg( 0, std::ios_base::end );
+               boxSize = str.tellg() - boxPos;
+            }
+            else if ( lbox == 1 )
+            {
+               boxSize = xlbox;
+            }
+            else
+            {
+               boxSize = lbox;
+            }
+            boxSize -= offsetToDbox;
+               
+            // Seek to box data start
+            str.seekg( boxPos + offsetToDbox, std::ios_base::beg );
+               
+            // std::vector::resize can throw a std::bad_alloc so wrap it...
+            try
+            {
+               box.resize( boxSize );
+               str.read( (char*)&box.front(), boxSize );
+            }
+            catch( std::exception& e )
+            {
+               std::ostringstream errMsg;
+               errMsg << "ossimJp2Info::getBox caught exception on resize:\n"
+                      << "Buffer size in bytes: " << boxSize
+                      << "\n" << e.what() << std::endl;
+               throw ossimException( errMsg.str() );
+            }
+
+            boxPosOfType = boxPos; // set up return value 
+            break; // done...
+         }
+            
+         if (lbox == 0) // last box?
+         {
+            break;
+         }
+            
+         // Seek to the next box.
+         std::streamoff nextBoxPos = boxPos;
+         if (lbox == 1)
+         {
+            nextBoxPos+= (std::streamoff)xlbox;
+         }
+         else
+         {
+            nextBoxPos+= (std::streamoff)lbox;
+         }
+
+         // Go to next box:
+         str.seekg(nextBoxPos, std::ios_base::beg);
+            
+      } // matches: while ( str.good() )
+         
+   } // matches: if ( str.good() )
+   
+   return boxPosOfType;
+   
+} // End: ossimJp2Info::getBox( type, includeAll, str, box ) const
+
+std::streamoff ossimJp2Info::getGeotiffBox(
+   std::ifstream& str, std::vector<ossim_uint8>& box ) const
+{
+   std::streamoff boxPos = 0;
+   if ( str.good() )
+   {
+      const ossim_uint32 UUID_TYPE = 0x75756964;
+      
+      boxPos = getBox( UUID_TYPE, false, str, box );
+      if ( boxPos && ( box.size() >= GEOTIFF_UUID_SIZE) )
+      {
+         const ossim_uint8 GEOTIFF_UUID[GEOTIFF_UUID_SIZE] = 
+            {
+               0xb1, 0x4b, 0xf8, 0xbd,
+               0x08, 0x3d, 0x4b, 0x43,
+               0xa5, 0xae, 0x8c, 0xd7,
+               0xd5, 0xa6, 0xce, 0x03
+            };
+         
+         if( memcmp( (char*)&box.front(), GEOTIFF_UUID, GEOTIFF_UUID_SIZE) != 0)
+         {
+            boxPos = 0;
+            box.clear();
+         }
+      }
+   }
+   return boxPos;
+}
+
+std::streamoff ossimJp2Info::getGmlBox(
+   std::ifstream& str, std::vector<ossim_uint8>& box ) const
+{
+   std::streamoff boxPos = 0;
+   if ( str.good() )
+   {
+      const ossim_uint32 ASOC_TBOX_ID = 0x61736F63;
+      const ossim_uint32 LBL_TBOX_ID  = 0x6C626C20;
+      const ossim_uint32 XML_TBOX_ID  = 0x786D6C20;
+      
+      ossim_uint32 asoc0_data_length = 0;
+      std::streamoff dataPosAsoc0 = findBoxData( ASOC_TBOX_ID, str, asoc0_data_length );
+
+      if ( dataPosAsoc0 > 0 && asoc0_data_length > 0 )
+      {
+         ossim_uint32 lbl0_data_length = 0;
+         std::streamoff dataPosLbl0 = findBoxData( LBL_TBOX_ID, str, lbl0_data_length );
+
+         if ( dataPosLbl0 > 0 && lbl0_data_length > 0 )
+         {
+            std::string gmlDataStr;
+            gmlDataStr.resize( lbl0_data_length );
+
+            // Removed c++ 11 call for portablility...
+            // str.read( (char*)&gmlDataStr.front(), lbl0_data_length );
+            str.read( (char*)&gmlDataStr[0], lbl0_data_length );            
+
+            // Do we have a GML data asoc ?
+            if ( gmlDataStr.compare( 0, 8, "gml.data" ) == 0 )
+            {
+               // Seek to asoc 0 start of data
+               str.seekg( dataPosAsoc0, std::ios_base::beg );
+
+               ossim_uint32 asoc1_data_length = 0;
+               std::streamoff dataPosAsoc1 = findBoxData( ASOC_TBOX_ID, str, asoc1_data_length );
+
+               if ( dataPosAsoc1 > 0 && asoc1_data_length > 0 )
+               {
+                  ossim_uint32 lbl1_data_length = 0;
+                  std::streamoff dataPosLbl1 = findBoxData( LBL_TBOX_ID, str, lbl1_data_length );
+
+                  if ( dataPosLbl1 > 0 && lbl1_data_length > 0 )
+                  {
+                     std::string gmlRootInstanceStr;
+                     gmlRootInstanceStr.resize( lbl1_data_length );
+                     // Removed c++ 11 call for portablility...
+                     // str.read( (char*)&gmlRootInstanceStr.front(), lbl1_data_length );
+                     str.read( (char*)&gmlRootInstanceStr[0], lbl1_data_length );
+
+                     // Do we have a GML root-instance asoc ?
+                     if ( gmlRootInstanceStr.compare( 0, 17, "gml.root-instance" ) == 0 )
+                     {
+                        // Seek to asoc 1 start of data
+                        str.seekg( dataPosAsoc1, std::ios_base::beg );
+
+                        boxPos = getBox( XML_TBOX_ID, false, str, box );
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+   return boxPos;
+}
+
+void ossimJp2Info::printTboxType( ossim_uint32 tbox, std::ostream& out ) const
+{
+   std::string boxType;
+
+   const ossim_uint32 JP2_ASSOC_TYPE = 0x61736f63;
+   const ossim_uint32 JP2_LABEL_TYPE = 0x6c626c20;
+   const ossim_uint32 JP2_SIG_TYPE   = 0x6A502020;
+   const ossim_uint32 FILE_TYPE      = 0x66747970;
+   const ossim_uint32 JP2_HDR_TYPE   = 0x6A703268;
+   const ossim_uint32 IMG_HDR_TYPE   = 0x69686472;
+   const ossim_uint32 BPCC_TYPE      = 0x62706363;
+   const ossim_uint32 COLR_TYPE      = 0x636F6C72;
+   const ossim_uint32 PCLR_TYPE      = 0x70636C72;
+   const ossim_uint32 CMAP_TYPE      = 0x636D6170;
+   const ossim_uint32 CDEF_TYPE      = 0x63646566;
+   const ossim_uint32 RES_TYPE       = 0x72657320;
+   const ossim_uint32 RESC_TYPE      = 0x72657363;
+   const ossim_uint32 RESD_TYPE      = 0x72657364;
+   const ossim_uint32 JP2C_TYPE      = 0x6A703263;
+   const ossim_uint32 JP2I_TYPE      = 0x6A703269;
+   const ossim_uint32 XML_TYPE       = 0x786D6C20;
+   const ossim_uint32 UUID_TYPE      = 0x75756964;
+
+   switch( tbox )
+   {
+      case JP2_ASSOC_TYPE:
+      {
+         boxType = "jp2_assoc";
+         break;
+      }
+      case JP2_LABEL_TYPE:
+      {
+         boxType = "jp2_label";
+         break;
+      }
+      case JP2_SIG_TYPE:
+      {
+         boxType = "jp2_sig";
+         break;
+      }
+      case FILE_TYPE:
+      {
+         boxType = "ftyp";
+         break;
+      }
+      case JP2_HDR_TYPE:
+      {
+         boxType = "jp2h";
+         break;
+      }
+      case IMG_HDR_TYPE:
+      {
+         boxType = "ihdr";
+         break;
+      }
+      case BPCC_TYPE:
+      {
+         boxType = "bpcc";
+         break;
+      }
+      case COLR_TYPE:
+      {
+         boxType = "colr";
+         break;
+      }
+      case PCLR_TYPE:
+      {
+         boxType = "pclr";
+         break;
+      }
+      case CMAP_TYPE:
+      {
+         boxType = "cmap";
+         break;
+      }
+      case CDEF_TYPE:
+      {
+         boxType = "cdef";
+         break;
+      }
+      case RES_TYPE:
+      {
+         boxType = "res";
+         break;
+      }
+      case RESC_TYPE:
+      {
+         boxType = "resc";
+         break;
+      }
+      case RESD_TYPE:
+      {
+         boxType = "resd";
+         break;
+      }
+      case JP2C_TYPE:
+      {
+         boxType = "jp2c";
+         break;
+      }
+      case JP2I_TYPE:
+      {
+         boxType = "jp2i";
+         break;
+      }
+      case XML_TYPE:
+      {
+         boxType = "xml";
+         break;
+      }
+      case UUID_TYPE:
+      {
+         boxType = "uuid";
+         break;
+      }
+      default:
+      {
+         boxType = "unhandled";
+         break;
+      }
+   }
+
+   out << "jp2.box_type: " << boxType << "\n";
+}
diff --git a/ossim/src/ossim/support_data/ossimJpipMessage.cpp b/src/support_data/ossimJpipMessage.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimJpipMessage.cpp
rename to src/support_data/ossimJpipMessage.cpp
diff --git a/ossim/src/ossim/support_data/ossimJpipMessageDecoder.cpp b/src/support_data/ossimJpipMessageDecoder.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimJpipMessageDecoder.cpp
rename to src/support_data/ossimJpipMessageDecoder.cpp
diff --git a/src/support_data/ossimLasHdr.cpp b/src/support_data/ossimLasHdr.cpp
new file mode 100644
index 0000000..f3528fa
--- /dev/null
+++ b/src/support_data/ossimLasHdr.cpp
@@ -0,0 +1,626 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasHdr.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Container class for LAS LIDAR format public header block.
+
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimLasHdr.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+#include <bitset>
+#include <cstring>
+#include <iomanip>
+#include <iostream>
+#include <sstream>
+
+ossimLasHdr::ossimLasHdr() :
+   m_fileSourceId(0),
+   m_globalEncoding(0),
+   m_projectIdGuidData1(0),
+   m_projectIdGuidData2(0),
+   m_projectIdGuidData3(0),
+   m_versionMajor(0),
+   m_versionMinor(0),
+   m_fileCreationDay(0),
+   m_fileCreateionYear(0),
+   m_headerSize(0),
+   m_offsetToPointData(0),
+   m_numberOfVariableLengthRecords(0),
+   m_pointDataFormatId(0),
+   m_pointDataRecordLength(0),
+   m_legacyNumberOfPointRecords(0),
+   m_xScaleFactor(0.0),
+   m_yScaleFactor(0.0),
+   m_zScaleFactor(0.0),
+   m_xOffset(0.0),
+   m_yOffset(0.0),
+   m_zOffset(0.0),
+   m_maxX(0.0),
+   m_minX(0.0),
+   m_maxY(0.0),
+   m_minY(0.0),
+   m_maxZ(0.0),
+   m_minZ(0.0),
+   m_startOfWaveformDataPacket(0),
+   m_startOfExtendedVariableLengthRecords(0),
+   m_numberOfExtendedVariableLengthRecords(0),
+   m_numberOfPointRecords(0)
+{
+   // Initialize arrays:
+   strncpy(m_fileSignature, "LASF", 4);
+   m_fileSignature[4] = '\0';
+   memset(m_projectIdGuidData4, 0, 8);
+   memset(m_systemIndentifier, 0, 32);
+   memset(m_generatingSoftware, 0, 32);
+   memset(m_legacyNumberOfPointsByReturn, 0, 20); // 5 uint32s(5 x 4)
+   memset(m_numberOfPointsByReturn, 0, 120);   // 15 unint64s(15 x 8)
+}
+
+ossimLasHdr::ossimLasHdr(const ossimLasHdr& hdr) :
+   m_fileSourceId(hdr.m_fileSourceId),
+   m_globalEncoding(hdr.m_globalEncoding),
+   m_projectIdGuidData1(hdr.m_projectIdGuidData1),
+   m_projectIdGuidData2(hdr.m_projectIdGuidData2),
+   m_projectIdGuidData3(hdr.m_projectIdGuidData3),
+   m_versionMajor(hdr.m_versionMajor),
+   m_versionMinor(hdr.m_versionMinor),
+   m_fileCreationDay(hdr.m_fileCreationDay),
+   m_fileCreateionYear(hdr.m_fileCreateionYear),
+   m_headerSize(hdr.m_headerSize),
+   m_offsetToPointData(hdr.m_offsetToPointData),
+   m_numberOfVariableLengthRecords(hdr.m_numberOfVariableLengthRecords),
+   m_pointDataFormatId(hdr.m_pointDataFormatId),
+   m_pointDataRecordLength(hdr.m_pointDataRecordLength),
+   m_legacyNumberOfPointRecords(hdr.m_legacyNumberOfPointRecords),
+   m_xScaleFactor(hdr.m_xScaleFactor),
+   m_yScaleFactor(hdr.m_yScaleFactor),
+   m_zScaleFactor(hdr.m_zScaleFactor),
+   m_xOffset(hdr.m_xOffset),
+   m_yOffset(hdr.m_yOffset),
+   m_zOffset(hdr.m_zOffset),
+   m_maxX(hdr.m_maxX),
+   m_minX(hdr.m_minX),
+   m_maxY(hdr.m_maxY),
+   m_minY(hdr.m_minY),
+   m_maxZ(hdr.m_maxZ),
+   m_minZ(hdr.m_minZ),
+   m_startOfWaveformDataPacket(hdr.m_startOfWaveformDataPacket),
+   m_startOfExtendedVariableLengthRecords(hdr.m_startOfExtendedVariableLengthRecords),
+   m_numberOfExtendedVariableLengthRecords(hdr.m_numberOfExtendedVariableLengthRecords),
+   m_numberOfPointRecords(hdr.m_numberOfPointRecords)
+{
+   // Copy arrays.
+   memcpy((void*)m_fileSignature, (void*)(hdr.m_fileSignature), 4);
+   memcpy((void*)m_projectIdGuidData4, (void*)(hdr.m_projectIdGuidData4), 8);
+   memcpy((void*)m_systemIndentifier, (void*)(hdr.m_systemIndentifier), 32);
+   memcpy((void*)m_generatingSoftware, (void*)(hdr.m_generatingSoftware), 32);
+   memcpy((void*)m_legacyNumberOfPointsByReturn, (void*)(hdr.m_legacyNumberOfPointsByReturn), 20);
+   memcpy((void*)m_numberOfPointsByReturn, (void*)(hdr.m_numberOfPointsByReturn), 120);
+}
+
+const ossimLasHdr& ossimLasHdr::operator=(const ossimLasHdr& hdr)
+{
+   if (this != &hdr)
+   {
+      m_fileSourceId = hdr.m_fileSourceId;
+      m_globalEncoding = hdr.m_globalEncoding;
+      m_projectIdGuidData1 = hdr.m_projectIdGuidData1;
+      m_projectIdGuidData2 = hdr.m_projectIdGuidData2;
+      m_projectIdGuidData3 = hdr.m_projectIdGuidData3;
+      m_versionMajor = hdr.m_versionMajor;
+      m_versionMinor = hdr.m_versionMinor;
+      strncpy(m_systemIndentifier, hdr.m_systemIndentifier, 32);
+      strncpy(m_generatingSoftware, hdr.m_generatingSoftware, 32);      
+      m_fileCreationDay = hdr.m_fileCreationDay;
+      m_fileCreateionYear = hdr.m_fileCreateionYear;
+      m_headerSize = hdr.m_headerSize;
+      m_offsetToPointData = hdr.m_offsetToPointData;
+      m_numberOfVariableLengthRecords = hdr.m_numberOfVariableLengthRecords;
+      m_pointDataFormatId = hdr.m_pointDataFormatId;
+      m_pointDataRecordLength = hdr.m_pointDataRecordLength;
+      m_legacyNumberOfPointRecords = hdr.m_legacyNumberOfPointRecords;
+      m_xScaleFactor = hdr.m_xScaleFactor;
+      m_yScaleFactor = hdr.m_yScaleFactor;
+      m_zScaleFactor = hdr.m_zScaleFactor;
+      m_xOffset = hdr.m_xOffset;
+      m_yOffset = hdr.m_yOffset;
+      m_zOffset = hdr.m_zOffset;
+      m_maxX = hdr.m_maxX;
+      m_minX = hdr.m_minX;
+      m_maxY = hdr.m_maxY;
+      m_minY = hdr.m_minY;
+      m_maxZ = hdr.m_maxZ;
+      m_minZ = hdr.m_minZ;
+      m_startOfWaveformDataPacket = hdr.m_startOfWaveformDataPacket;
+      m_startOfExtendedVariableLengthRecords = hdr.m_startOfExtendedVariableLengthRecords;
+      m_numberOfExtendedVariableLengthRecords = hdr.m_numberOfExtendedVariableLengthRecords;
+      m_numberOfPointRecords = hdr.m_numberOfPointRecords;
+
+      // Copy arrays.
+      memcpy((void*)m_fileSignature,(void*)(hdr.m_fileSignature), 4);
+      memcpy((void*)m_projectIdGuidData4, (void*)(hdr.m_projectIdGuidData4), 8);
+      memcpy((void*)m_systemIndentifier, (void*)(hdr.m_systemIndentifier), 32);
+      memcpy((void*)m_generatingSoftware, (void*)(hdr.m_generatingSoftware), 32);
+      memcpy((void*)m_legacyNumberOfPointsByReturn,
+             (void*)(hdr.m_legacyNumberOfPointsByReturn), 20);
+      memcpy((void*)m_numberOfPointsByReturn, (void*)(hdr.m_numberOfPointsByReturn), 120);
+   }
+   return *this;
+}
+
+ossimLasHdr::~ossimLasHdr()
+{
+}
+
+bool ossimLasHdr::checkSignature(std::istream& in) const
+{
+   bool result = false;
+   char SIG[4];
+   in.read(SIG, 4);
+   if ( (SIG[0] == 'L') && (SIG[1] == 'A') &&
+        (SIG[2] == 'S') && (SIG[3] == 'F') )
+   {
+      result = true;
+   }
+   return result;
+}
+
+void ossimLasHdr::readStream(std::istream& in)
+{
+   in.read(m_fileSignature, 4);
+   in.read((char*)&m_fileSourceId, 2);
+   in.read((char*)&m_globalEncoding, 2);
+   in.read((char*)&m_projectIdGuidData1, 4);
+   in.read((char*)&m_projectIdGuidData2, 2);
+   in.read((char*)&m_projectIdGuidData3, 2);
+   in.read((char*)&m_projectIdGuidData4, 8);
+   in.read((char*)&m_versionMajor, 1);
+   in.read((char*)&m_versionMinor, 1);
+   in.read(m_systemIndentifier, 32);
+   in.read(m_generatingSoftware, 32);
+   in.read((char*)&m_fileCreationDay, 2);
+   in.read((char*)&m_fileCreateionYear, 2);
+   in.read((char*)&m_headerSize, 2);
+   in.read((char*)&m_offsetToPointData, 4);
+   in.read((char*)&m_numberOfVariableLengthRecords, 4);
+   in.read((char*)&m_pointDataFormatId, 1);
+   in.read((char*)&m_pointDataRecordLength, 2);
+   in.read((char*)&m_legacyNumberOfPointRecords, 4);
+   in.read((char*)&m_legacyNumberOfPointsByReturn, 20);
+   in.read((char*)&m_xScaleFactor, 8);
+   in.read((char*)&m_yScaleFactor, 8);
+   in.read((char*)&m_zScaleFactor, 8);
+   in.read((char*)&m_xOffset, 8);
+   in.read((char*)&m_yOffset, 8);
+   in.read((char*)&m_zOffset, 8);
+   in.read((char*)&m_maxX, 8);
+   in.read((char*)&m_minX, 8);
+   in.read((char*)&m_maxY, 8);
+   in.read((char*)&m_minY, 8);
+   in.read((char*)&m_maxZ, 8);
+   in.read((char*)&m_minZ, 8);
+
+   // Version specific:
+   if ( versionGreaterThan( 1, 2 ) )
+   {
+      // Added in 1.3:
+      in.read((char*)&m_startOfWaveformDataPacket, 8);
+   }
+   if ( versionGreaterThan( 1, 3 ) )
+   {
+      // Added in 1.4:
+      in.read((char*)&m_startOfExtendedVariableLengthRecords, 8);
+      in.read((char*)&m_numberOfExtendedVariableLengthRecords, 4);
+      in.read((char*)&m_numberOfPointRecords, 8);
+      in.read((char*)&m_numberOfPointsByReturn, 120);
+   }
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      swap();
+   }
+
+   if ( !versionGreaterThan( 1, 3 ) ) // Less than 1.4
+   {
+      //---
+      // Copy legacy point count to 64 bit data members. This will allow LAS code
+      // to always go through same methods for point counts.
+      //---
+      m_numberOfPointRecords = m_legacyNumberOfPointRecords;
+      for ( ossim_uint32 i = 0; i < 5; ++i )
+      {
+         m_numberOfPointsByReturn[i] = m_legacyNumberOfPointsByReturn[i];
+      }
+   }
+}
+
+void ossimLasHdr::writeStream(std::ostream& out)
+{
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Write little endian per spec.
+      swap();
+   }
+   
+   out.write(m_fileSignature, 4);
+   out.write((char*)&m_fileSourceId, 2);
+   out.write((char*)&m_globalEncoding, 2);
+   out.write((char*)&m_projectIdGuidData1, 4);
+   out.write((char*)&m_projectIdGuidData2, 2);
+   out.write((char*)&m_projectIdGuidData3, 2);
+   out.write((char*)&m_projectIdGuidData4, 8);
+   out.write((char*)&m_versionMajor, 1);
+   out.write((char*)&m_versionMinor, 1);
+   out.write(m_systemIndentifier, 32);
+   out.write(m_generatingSoftware, 32);
+   out.write((char*)&m_fileCreationDay, 2);
+   out.write((char*)&m_fileCreateionYear, 2);
+   out.write((char*)&m_headerSize, 2);
+   out.write((char*)&m_offsetToPointData, 4);
+   out.write((char*)&m_numberOfVariableLengthRecords, 4);
+   out.write((char*)&m_pointDataFormatId, 1);
+   out.write((char*)&m_pointDataRecordLength, 2);
+   out.write((char*)&m_legacyNumberOfPointRecords, 4);
+   out.write((char*)&m_legacyNumberOfPointsByReturn, 20);
+   out.write((char*)&m_xScaleFactor, 8);
+   out.write((char*)&m_yScaleFactor, 8);
+   out.write((char*)&m_zScaleFactor, 8);
+   out.write((char*)&m_xOffset, 8);
+   out.write((char*)&m_yOffset, 8);
+   out.write((char*)&m_zOffset, 8);
+   out.write((char*)&m_maxX, 8);
+   out.write((char*)&m_minX, 8);
+   out.write((char*)&m_maxY, 8);
+   out.write((char*)&m_minY, 8);
+   out.write((char*)&m_maxZ, 8);
+   out.write((char*)&m_minZ, 8);
+
+   if ( versionGreaterThan( 1, 2 ) )
+   {
+      // Added in 1.3:
+      out.write((char*)&m_startOfWaveformDataPacket, 8);
+   }
+   if ( versionGreaterThan( 1, 3 ) )
+   {
+      // Added in 1.4:
+      out.write((char*)&m_startOfExtendedVariableLengthRecords, 8);
+      out.write((char*)&m_numberOfExtendedVariableLengthRecords, 4);
+      out.write((char*)&m_numberOfPointRecords, 8);
+      out.write((char*)&m_numberOfPointsByReturn, 120);
+   }
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Swap back to native byte order if needed:
+      swap();
+   }
+}
+
+std::ostream& ossimLasHdr::print(std::ostream& out) const
+{
+   ossimKeywordlist kwl;
+   getKeywordlist( kwl );
+   return out << kwl;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimLasHdr& hdr)
+{
+   return hdr.print(out);
+}
+
+void ossimLasHdr::getKeywordlist(ossimKeywordlist& kwl) const
+{
+   kwl.add("las.file_source_id", m_fileSourceId);
+
+   //---
+   // m_globalEncoding is a bit encoding so we output bit at a time:
+   // At the time of this coding only first four bits used.
+   //---
+
+   // 1.2:
+   kwl.add("las.gps_time_type", (getGpsTimeTypeBit()?"1":"0") );
+
+   if ( versionGreaterThan( 1, 2 ) )
+   {
+      // Added in 1.3:
+      kwl.add("las.waveform_data_packets_internal", (getWaveforDataPacketsInternalBit()?"1":"0") );
+      kwl.add("las.waveform_data_packets_external", (getWaveforDataPacketsExternalBit()?"1":"0") );
+      kwl.add("las.synthetically_generated", (getReturnsSyntheticallyGeneratedBit()?"1":"0") );
+   }
+
+   if (  versionGreaterThan( 1, 3 ) )
+   {
+      // 1.4:
+      kwl.add("las.wkt", (getWktBit()?"1":"0") );
+   }
+   
+   kwl.add("las.project_id_guid", getProjectIdGuid().c_str());
+
+   kwl.add("las.version", getVersion().c_str());
+
+   kwl.add("las.system_indentifier", getSystemIndentifier().c_str());
+   kwl.add("las.generating_software", getGeneratingSoftware().c_str());
+
+   kwl.add("las.file_creation_day", m_fileCreationDay);
+   kwl.add("las.file_creation_year", m_fileCreateionYear);
+
+   kwl.add("las.header_size", m_headerSize);
+   kwl.add("las.offset_to_point_data", m_offsetToPointData );
+   kwl.add("las.number_of_variable_length_records", m_numberOfVariableLengthRecords);
+   kwl.add("las.point_data_format_id", m_pointDataFormatId);
+   kwl.add("las.point_data_record_length", m_pointDataRecordLength);
+
+   kwl.add("las.x_scale_factor", m_xScaleFactor);
+   kwl.add("las.y_scale_factor", m_yScaleFactor);
+   kwl.add("las.z_scale_factor", m_zScaleFactor);
+
+   kwl.add("las.x_offset", m_xOffset);
+   kwl.add("las.y_offset", m_yOffset);
+   kwl.add("las.z_offset", m_zOffset);
+   
+   kwl.add("las.max_x", m_maxX);
+   kwl.add("las.min_x", m_minX);
+   kwl.add("las.max_y", m_maxY);
+   kwl.add("las.min_y", m_minY);
+   kwl.add("las.max_z", m_maxZ);
+   kwl.add("las.min_z", m_minZ);
+
+   kwl.add("las.start_of_wave_form_data", m_startOfWaveformDataPacket);
+
+   if ( versionGreaterThan( 1, 3 ) )
+   {
+      kwl.add("las.number_of_point_records", m_numberOfPointRecords);
+      for (ossim_uint32 i = 0; i < 15; ++i)
+      {
+         std::ostringstream os;
+         os << "las.number_of_points_return" << (i+1);
+         kwl.add( os.str().c_str(), m_numberOfPointsByReturn[i] );
+      }
+   }
+   else
+   {
+      // Prior to 1.4:
+      kwl.add("las.number_of_point_records", m_legacyNumberOfPointRecords);
+      for (ossim_uint32 i = 0; i < 5; ++i)
+      {
+         std::ostringstream os;
+         os << "las.number_of_points_return" << (i+1);
+         kwl.add( os.str().c_str(), m_legacyNumberOfPointsByReturn[i] );
+      } 
+   }
+}
+
+bool ossimLasHdr::getGpsTimeTypeBit() const
+{
+   // Test the first bit:
+   std::bitset<1> bs( m_globalEncoding );
+   return bs.test(0);
+}
+
+bool ossimLasHdr::getWaveforDataPacketsInternalBit() const
+{
+   // Test the second bit:
+   std::bitset<2> bs( m_globalEncoding );
+   return bs.test(1);
+}
+
+bool ossimLasHdr::getWaveforDataPacketsExternalBit() const
+{
+   // Test the third bit:
+   std::bitset<3> bs( m_globalEncoding );
+   return bs.test(2);
+}
+
+bool ossimLasHdr::getReturnsSyntheticallyGeneratedBit() const
+{
+   // Test the fourth bit:
+   std::bitset<4> bs( m_globalEncoding );
+   return bs.test(3);
+}
+
+bool ossimLasHdr::getWktBit() const
+{
+   // Test the fith bit:
+   std::bitset<5> bs( m_globalEncoding );
+   return bs.test(4); 
+}
+
+std::string ossimLasHdr::getProjectIdGuid() const
+{
+   std::ostringstream os;
+   os << std::hex
+      << m_projectIdGuidData1 << "-"
+      << m_projectIdGuidData2 << "-"
+      << m_projectIdGuidData3 << "-";
+   for (int i=0; i<8; ++i)
+   {
+      ossim_uint16 uid = m_projectIdGuidData4[i];
+      os << uid;
+   }
+   return os.str();
+}
+
+std::string ossimLasHdr::getVersion() const
+{
+   std::ostringstream os;
+   os << int(m_versionMajor) << "." << int(m_versionMinor);
+   return os.str();
+}
+
+std::string  ossimLasHdr::getSystemIndentifier() const
+{
+   std::string s;
+   s.reserve(32);
+   for (int i=0; i<32; ++i)
+   {
+      s.push_back(m_systemIndentifier[i]);
+   }
+   return s;
+}
+
+std::string  ossimLasHdr::getGeneratingSoftware() const
+{
+   std::string s;
+   s.reserve(32);
+   for (int i=0; i<32; ++i)
+   {
+      s.push_back(m_generatingSoftware[i]);
+   }
+   return s;
+}
+
+ossim_uint16 ossimLasHdr::getHeaderSize() const
+{
+   return m_headerSize;
+}
+
+ossim_uint32 ossimLasHdr::getOffsetToPointData() const
+{
+   return m_offsetToPointData;
+}
+
+ossim_uint32 ossimLasHdr::getNumberOfVlrs() const
+{
+   return m_numberOfVariableLengthRecords;
+}
+
+ossim_uint8 ossimLasHdr::getPointDataFormatId() const
+{
+   return m_pointDataFormatId;
+}
+
+ossim_uint64 ossimLasHdr::getNumberOfPoints() const
+{
+   return m_numberOfPointRecords;
+}
+
+ossim_uint64 ossimLasHdr::getNumberOfPoints(ossim_uint32 entry) const
+{
+   ossim_uint64 result = 0;
+   if ( entry < 15 )
+   {
+      result = m_numberOfPointsByReturn[entry];
+   }
+   return result;
+}
+
+const ossim_float64& ossimLasHdr::getScaleFactorX() const
+{
+   return m_xScaleFactor;
+}
+
+const ossim_float64& ossimLasHdr::getScaleFactorY() const
+{
+   return m_yScaleFactor;
+}
+
+const ossim_float64& ossimLasHdr::getScaleFactorZ() const
+{
+   return m_zScaleFactor;
+}
+
+const ossim_float64& ossimLasHdr::getOffsetX() const
+{
+   return m_xOffset;
+}
+
+const ossim_float64& ossimLasHdr::getOffsetY() const
+{
+   return m_yOffset;
+}
+
+const ossim_float64& ossimLasHdr::getOffsetZ() const
+{
+   return m_zOffset;
+}
+
+const ossim_float64& ossimLasHdr::getMinX() const
+{
+   return m_minX;
+}
+
+const ossim_float64& ossimLasHdr::getMinY() const
+{
+   return m_minY;
+}
+
+const ossim_float64& ossimLasHdr::getMinZ() const
+{
+   return m_minZ;
+}
+
+const ossim_float64& ossimLasHdr::getMaxX() const
+{
+   return m_maxX;
+}
+
+const ossim_float64& ossimLasHdr::getMaxY() const
+{
+   return m_maxY;
+}
+
+const ossim_float64& ossimLasHdr::getMaxZ() const
+{
+   return m_maxZ;
+}
+
+void ossimLasHdr::swap()
+{
+   ossimEndian endian;
+   endian.swap(m_fileSourceId);
+   endian.swap(m_globalEncoding);
+   endian.swap(m_projectIdGuidData1);
+   endian.swap(m_projectIdGuidData2);
+   endian.swap(m_projectIdGuidData3);
+   endian.swap(m_fileCreationDay);
+   endian.swap(m_fileCreateionYear);
+   endian.swap(m_headerSize);
+   endian.swap(m_offsetToPointData);
+   endian.swap(m_numberOfVariableLengthRecords);
+   endian.swap(m_pointDataRecordLength);
+   endian.swap(m_legacyNumberOfPointRecords);
+   endian.swap(m_legacyNumberOfPointsByReturn, 5);
+   endian.swap(m_xScaleFactor);
+   endian.swap(m_yScaleFactor);
+   endian.swap(m_zScaleFactor);
+   endian.swap(m_xOffset);
+   endian.swap(m_yOffset);
+   endian.swap(m_zOffset);
+   endian.swap(m_maxX);
+   endian.swap(m_minX);
+   endian.swap(m_maxY);
+   endian.swap(m_minY);
+   endian.swap(m_maxZ);
+   endian.swap(m_minZ);
+   endian.swap(m_startOfWaveformDataPacket);
+   endian.swap(m_startOfExtendedVariableLengthRecords);
+   endian.swap(m_numberOfExtendedVariableLengthRecords);
+   endian.swap(m_numberOfPointRecords);
+   endian.swap(m_numberOfPointsByReturn, 15);
+}
+
+bool ossimLasHdr::versionGreaterThan( ossim_uint8 major, ossim_uint8 minor ) const
+{
+   bool result = false;
+   if ( m_versionMajor == major )
+   {
+      result = m_versionMinor > minor;
+   }
+   else if ( m_versionMajor > major )
+   {
+      result = true;
+   }
+   return result;
+}
diff --git a/src/support_data/ossimLasInfo.cpp b/src/support_data/ossimLasInfo.cpp
new file mode 100644
index 0000000..791b858
--- /dev/null
+++ b/src/support_data/ossimLasInfo.cpp
@@ -0,0 +1,59 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLibLasInfo.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: LAS LIDAR info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimLasInfo.h>
+#include <ossim/support_data/ossimLasHdr.h>
+
+#include <fstream>
+
+ossimLasInfo::ossimLasInfo()
+   : m_file()
+{
+}
+
+ossimLasInfo::~ossimLasInfo()
+{
+}
+
+bool ossimLasInfo::open(const ossimFilename& file)
+{
+   bool result = false;
+   std::ifstream istr;
+   istr.open(file.c_str(), std::ios_base::in | std::ios_base::binary);
+   if ( istr.is_open() )
+   {
+      ossimLasHdr hdr;
+      result = hdr.checkSignature(istr);
+      if (result) m_file = file;
+   }
+   return result;
+}
+
+std::ostream& ossimLasInfo::print(std::ostream& out) const
+{
+   std::ifstream istr;
+   istr.open(m_file.c_str(), std::ios_base::in | std::ios_base::binary);
+   if ( istr.is_open() )
+   {
+      ossimLasHdr hdr;
+      if ( hdr.checkSignature(istr) )
+      {
+         istr.seekg(0, std::ios_base::beg);
+         hdr.readStream(istr);
+         hdr.print(out);
+      }
+   }
+   return out;
+}
diff --git a/src/support_data/ossimLasPointRecord0.cpp b/src/support_data/ossimLasPointRecord0.cpp
new file mode 100644
index 0000000..5ab2d3e
--- /dev/null
+++ b/src/support_data/ossimLasPointRecord0.cpp
@@ -0,0 +1,208 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord0.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Container class LAS point record type 1.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimLasPointRecord0.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <iomanip>
+#include <iostream>
+#include <istream>
+#include <ostream>
+
+ossimLasPointRecord0::ossimLasPointRecord0Data::ossimLasPointRecord0Data()
+   :
+   m_x(0),
+   m_y(0),
+   m_z(0),
+   m_intensity(0),
+   m_returnByte(0),
+   m_classification(0),
+   m_scanAngleRank(0),
+   m_userData(0),
+   m_pointSourceID(0)
+{
+}
+
+ossimLasPointRecord0::ossimLasPointRecord0Data::ossimLasPointRecord0Data(
+   const ossimLasPointRecord0::ossimLasPointRecord0Data& obj)
+   :
+   m_x(obj.m_x),
+   m_y(obj.m_y),
+   m_z(obj.m_z),
+   m_intensity(obj.m_intensity),
+   m_returnByte(obj.m_returnByte),
+   m_classification(obj.m_classification),
+   m_scanAngleRank(obj.m_scanAngleRank),
+   m_userData(obj.m_userData),
+   m_pointSourceID(obj.m_pointSourceID)
+{
+}
+
+const ossimLasPointRecord0::ossimLasPointRecord0Data&
+ossimLasPointRecord0::ossimLasPointRecord0Data::operator=(
+   const ossimLasPointRecord0::ossimLasPointRecord0Data& obj)
+{
+   if ( this != &obj )
+   {
+      m_x = obj.m_x;
+      m_y = obj.m_y;
+      m_z = obj.m_z;
+      m_intensity      = obj.m_intensity;
+      m_returnByte     = obj.m_returnByte;
+      m_classification = obj.m_classification;
+      m_scanAngleRank  = obj.m_scanAngleRank;
+      m_userData       = obj.m_userData;
+      m_pointSourceID  = obj.m_pointSourceID;
+   }
+   return *this;
+}
+
+ossimLasPointRecord0::ossimLasPointRecord0()
+   :
+   m_record()
+{
+}
+
+ossimLasPointRecord0::ossimLasPointRecord0(const ossimLasPointRecord0& obj)
+   :
+   m_record(obj.m_record)
+{
+}
+
+const ossimLasPointRecord0& ossimLasPointRecord0::operator=(const ossimLasPointRecord0& copy_this)
+{
+   if (this != &copy_this)
+   {
+      m_record = copy_this.m_record;
+   }
+   return *this;
+}
+
+ossimLasPointRecord0::~ossimLasPointRecord0()
+{
+}
+
+void ossimLasPointRecord0::readStream(std::istream& in)
+{
+   in.read((char*)&m_record, 28);
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      swap();
+   }
+}
+
+void ossimLasPointRecord0::writeStream(std::ostream& out)
+{
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Write little endian per spec:
+      swap();
+   }
+
+   out.write((char*)&m_record, 28);
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Swap back to native byte order if needed:
+      swap();
+   }
+}
+
+ossim_int32 ossimLasPointRecord0::getX() const
+{
+   return m_record.m_x;
+}
+
+ossim_int32 ossimLasPointRecord0::getY() const
+{
+   return m_record.m_y;
+}
+
+ossim_int32 ossimLasPointRecord0::getZ() const
+{
+   return m_record.m_z;
+}
+
+ossim_uint16 ossimLasPointRecord0::getRed() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord0::getGreen() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord0::getBlue() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord0::getIntensity() const
+{
+   return m_record.m_intensity;
+}
+
+ossim_uint8 ossimLasPointRecord0::getReturnNumber() const
+{
+   return (0x07 & m_record.m_returnByte);
+}
+
+ossim_uint8 ossimLasPointRecord0::getNumberOfReturns() const
+{
+   return (0x34 & m_record.m_returnByte);
+}
+
+ossim_uint8 ossimLasPointRecord0::getEdgeFlag() const
+{
+   return (0x40 & m_record.m_returnByte);
+}
+
+std::ostream& ossimLasPointRecord0::print(std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
+
+   out << "x:                 " << m_record.m_x
+       << "\ny:                 " << m_record.m_y
+       << "\nz:                 " << m_record.m_z
+       << "\nintensity:         " << m_record.m_intensity
+       << "\nreturn:            " << int(getReturnNumber())
+       << "\nnumber_of_returns: " << int(getNumberOfReturns())
+       << "\nedge:              " << (getEdgeFlag()?"true":"false")
+       << "\nclassification:    " << m_record.m_classification
+       << "\nscan_angle_rank:   " << int(m_record.m_scanAngleRank)
+       << "\nuser_data:         " << m_record.m_userData
+       << "\npoint_source_id:   " << m_record.m_pointSourceID
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+   return out;
+}
+
+void ossimLasPointRecord0::swap()
+{
+   ossimEndian endian;
+   endian.swap(m_record.m_x);
+   endian.swap(m_record.m_y);
+   endian.swap(m_record.m_z);
+   endian.swap(m_record.m_intensity);
+   endian.swap(m_record.m_pointSourceID);
+}
+
diff --git a/src/support_data/ossimLasPointRecord1.cpp b/src/support_data/ossimLasPointRecord1.cpp
new file mode 100644
index 0000000..98e63cf
--- /dev/null
+++ b/src/support_data/ossimLasPointRecord1.cpp
@@ -0,0 +1,213 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord1.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Container class LAS point record type 1.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimLasPointRecord1.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <iomanip>
+#include <iostream>
+#include <istream>
+#include <ostream>
+
+ossimLasPointRecord1::ossimLasPointRecord1Data::ossimLasPointRecord1Data()
+   :
+   m_x(0),
+   m_y(0),
+   m_z(0),
+   m_intensity(0),
+   m_returnByte(0),
+   m_classification(0),
+   m_scanAngleRank(0),
+   m_userData(0),
+   m_pointSourceID(0),
+   m_gpsTime(0.0)
+{
+}
+
+ossimLasPointRecord1::ossimLasPointRecord1Data::ossimLasPointRecord1Data(
+   const ossimLasPointRecord1::ossimLasPointRecord1Data& obj)
+   :
+   m_x(obj.m_x),
+   m_y(obj.m_y),
+   m_z(obj.m_z),
+   m_intensity(obj.m_intensity),
+   m_returnByte(obj.m_returnByte),
+   m_classification(obj.m_classification),
+   m_scanAngleRank(obj.m_scanAngleRank),
+   m_userData(obj.m_userData),
+   m_pointSourceID(obj.m_pointSourceID),
+   m_gpsTime(obj.m_gpsTime)
+{
+}
+
+const ossimLasPointRecord1::ossimLasPointRecord1Data&
+ossimLasPointRecord1::ossimLasPointRecord1Data::operator=(
+   const ossimLasPointRecord1::ossimLasPointRecord1Data& obj)
+{
+   if ( this != &obj )
+   {
+      m_x = obj.m_x;
+      m_y = obj.m_y;
+      m_z = obj.m_z;
+      m_intensity      = obj.m_intensity;
+      m_returnByte     = obj.m_returnByte;
+      m_classification = obj.m_classification;
+      m_scanAngleRank  = obj.m_scanAngleRank;
+      m_userData       = obj.m_userData;
+      m_pointSourceID  = obj.m_pointSourceID;
+      m_gpsTime        = obj.m_gpsTime;
+   }
+   return *this;
+}
+
+ossimLasPointRecord1::ossimLasPointRecord1()
+   :
+   m_record()
+{
+}
+
+ossimLasPointRecord1::ossimLasPointRecord1(const ossimLasPointRecord1& obj)
+   :
+   m_record(obj.m_record)
+{
+}
+
+const ossimLasPointRecord1& ossimLasPointRecord1::operator=(const ossimLasPointRecord1& copy_this)
+{
+   if (this != &copy_this)
+   {
+      m_record = copy_this.m_record;
+   }
+   return *this;
+}
+
+ossimLasPointRecord1::~ossimLasPointRecord1()
+{
+}
+
+void ossimLasPointRecord1::readStream(std::istream& in)
+{
+   in.read((char*)&m_record, 28);
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      swap();
+   }
+}
+
+void ossimLasPointRecord1::writeStream(std::ostream& out)
+{
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Write little endian per spec:
+      swap();
+   }
+
+   out.write((char*)&m_record, 28);
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Swap back to native byte order if needed:
+      swap();
+   }
+}
+
+ossim_int32 ossimLasPointRecord1::getX() const
+{
+   return m_record.m_x;
+}
+
+ossim_int32 ossimLasPointRecord1::getY() const
+{
+   return m_record.m_y;
+}
+
+ossim_int32 ossimLasPointRecord1::getZ() const
+{
+   return m_record.m_z;
+}
+
+ossim_uint16 ossimLasPointRecord1::getRed() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord1::getGreen() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord1::getBlue() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord1::getIntensity() const
+{
+   return m_record.m_intensity;
+}
+
+ossim_uint8 ossimLasPointRecord1::getReturnNumber() const
+{
+   return (0x07 & m_record.m_returnByte);
+}
+
+ossim_uint8 ossimLasPointRecord1::getNumberOfReturns() const
+{
+   return (0x34 & m_record.m_returnByte);
+}
+
+ossim_uint8 ossimLasPointRecord1::getEdgeFlag() const
+{
+   return (0x40 & m_record.m_returnByte);
+}
+
+std::ostream& ossimLasPointRecord1::print(std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
+
+   out << "x:                 " << m_record.m_x
+       << "\ny:                 " << m_record.m_y
+       << "\nz:                 " << m_record.m_z
+       << "\nintensity:         " << m_record.m_intensity
+       << "\nreturn:            " << int(getReturnNumber())
+       << "\nnumber_of_returns: " << int(getNumberOfReturns())
+       << "\nedge:              " << (getEdgeFlag()?"true":"false")
+       << "\nclassification:    " << m_record.m_classification
+       << "\nscan_angle_rank:   " << int(m_record.m_scanAngleRank)
+       << "\nuser_data:         " << m_record.m_userData
+       << "\npoint_source_id:   " << m_record.m_pointSourceID
+       << "\ngps_time:          " << m_record.m_gpsTime
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+   return out;
+}
+
+void ossimLasPointRecord1::swap()
+{
+   ossimEndian endian;
+   endian.swap(m_record.m_x);
+   endian.swap(m_record.m_y);
+   endian.swap(m_record.m_z);
+   endian.swap(m_record.m_intensity);
+   endian.swap(m_record.m_pointSourceID);
+   endian.swap(m_record.m_gpsTime);
+}
+
diff --git a/src/support_data/ossimLasPointRecord2.cpp b/src/support_data/ossimLasPointRecord2.cpp
new file mode 100644
index 0000000..b429187
--- /dev/null
+++ b/src/support_data/ossimLasPointRecord2.cpp
@@ -0,0 +1,224 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord2.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description: Container class LAS point record type 2.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimLasPointRecord2.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <iomanip>
+#include <iostream>
+#include <istream>
+#include <ostream>
+
+ossimLasPointRecord2::ossimLasPointRecord2Data::ossimLasPointRecord2Data()
+   :
+   m_x(0),
+   m_y(0),
+   m_z(0),
+   m_intensity(0),
+   m_bitFlags(0),
+   m_classification(0),
+   m_scanAngleRank(0),
+   m_userData(0),
+   m_pointSourceId(0),
+   m_red(0),
+   m_green(0),
+   m_blue(0)
+{
+}
+
+ossimLasPointRecord2::ossimLasPointRecord2Data::ossimLasPointRecord2Data(
+   const ossimLasPointRecord2::ossimLasPointRecord2Data& obj)
+   :
+   m_x(obj.m_x),
+   m_y(obj.m_y),
+   m_z(obj.m_z),
+   m_intensity(obj.m_intensity),
+   m_bitFlags(obj.m_bitFlags),
+   m_classification(obj.m_classification),
+   m_scanAngleRank(obj.m_scanAngleRank),
+   m_userData(obj.m_userData),
+   m_pointSourceId(obj.m_pointSourceId),
+   m_red(obj.m_red),
+   m_green(obj.m_green),
+   m_blue(obj.m_blue)   
+{
+}
+
+const ossimLasPointRecord2::ossimLasPointRecord2Data&
+ossimLasPointRecord2::ossimLasPointRecord2Data::operator=(
+   const ossimLasPointRecord2::ossimLasPointRecord2Data& obj)
+{
+   if ( this != &obj )
+   {
+      m_x              = obj.m_x;
+      m_y              = obj.m_y;
+      m_z              = obj.m_z;
+      m_intensity      = obj.m_intensity;
+      m_bitFlags       = obj.m_bitFlags;
+      m_classification = obj.m_classification;
+      m_scanAngleRank  = obj.m_scanAngleRank;
+      m_userData       = obj.m_userData;
+      m_pointSourceId  = obj.m_pointSourceId;
+      m_red            = obj.m_red;
+      m_green          = obj.m_green;
+      m_blue           = obj.m_blue;
+   }
+   return *this;
+}
+
+ossimLasPointRecord2::ossimLasPointRecord2()
+   :
+   m_record()
+{
+}
+
+ossimLasPointRecord2::ossimLasPointRecord2(const ossimLasPointRecord2& obj)
+   :
+   m_record(obj.m_record)
+{
+}
+
+const ossimLasPointRecord2& ossimLasPointRecord2::operator=(const ossimLasPointRecord2& copy_this)
+{
+   if (this != &copy_this)
+   {
+      m_record = copy_this.m_record;
+   }
+   return *this;
+}
+
+ossimLasPointRecord2::~ossimLasPointRecord2()
+{
+}
+
+void ossimLasPointRecord2::readStream(std::istream& in)
+{
+   in.read((char*)&m_record, 26); // sizeof reports 28 due to actual space used for STRUCT //sizeof(ossimLasPointRecord2Data));
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      swap();
+   }
+}
+
+void ossimLasPointRecord2::writeStream(std::ostream& out)
+{
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Write little endian per spec:
+      swap();
+   }
+
+   out.write((char*)&m_record, 26); // sizeof reports 28 due to actual space used for STRUCT //sizeof(ossimLasPointRecord2Data));
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Swap back to native byte order if needed:
+      swap();
+   }
+}
+
+ossim_int32 ossimLasPointRecord2::getX() const
+{
+   return m_record.m_x;
+}
+
+ossim_int32 ossimLasPointRecord2::getY() const
+{
+   return m_record.m_y;
+}
+
+ossim_int32 ossimLasPointRecord2::getZ() const
+{
+   return m_record.m_z;
+}
+
+ossim_uint16 ossimLasPointRecord2::getRed() const
+{  
+   return m_record.m_red;
+}
+
+ossim_uint16 ossimLasPointRecord2::getGreen() const
+{
+   return m_record.m_green;
+}
+
+ossim_uint16 ossimLasPointRecord2::getBlue() const
+{
+   return m_record.m_blue;
+}
+
+ossim_uint16 ossimLasPointRecord2::getIntensity() const
+{
+   return m_record.m_intensity;
+}
+
+ossim_uint8 ossimLasPointRecord2::getReturnNumber() const
+{
+   return (m_record.m_bitFlags.m_returnNumber);
+}
+
+ossim_uint8 ossimLasPointRecord2::getNumberOfReturns() const
+{
+   return (m_record.m_bitFlags.m_numberOfReturns);
+}
+
+ossim_uint8 ossimLasPointRecord2::getEdgeFlag() const
+{
+   return (m_record.m_bitFlags.m_edgeOfFlightLine);
+}
+
+std::ostream& ossimLasPointRecord2::print(std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
+ 
+   out << "x:                 " << m_record.m_x
+       << "\ny:                 " << m_record.m_y
+       << "\nz:                 " << m_record.m_z
+       << "\nintensity:         " << m_record.m_intensity
+       << "\nreturn:            " << int(getReturnNumber())
+       << "\nnumber_of_returns: " << int(getNumberOfReturns())
+       << "\nedge:              " << (getEdgeFlag()?"true":"false")
+       << "\nscan_direction:    " << int(m_record.m_bitFlags.m_scanDirection)
+       << "\nclassification:    " << m_record.m_classification
+       << "\nscan_angle_rank:   " << int(m_record.m_scanAngleRank)
+       << "\nuser_data:         " << m_record.m_userData
+       << "\npoint_source_id:   " << m_record.m_pointSourceId
+       << "\nred:               " << m_record.m_red
+       << "\ngreen:             " << m_record.m_green
+       << "\nblue:              " << m_record.m_blue
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+   return out;
+}
+
+void ossimLasPointRecord2::swap()
+{
+   ossimEndian endian;
+   endian.swap(m_record.m_x);
+   endian.swap(m_record.m_y);
+   endian.swap(m_record.m_z);
+   endian.swap(m_record.m_intensity);
+   endian.swap(m_record.m_pointSourceId);
+   endian.swap(m_record.m_red);
+   endian.swap(m_record.m_green);
+   endian.swap(m_record.m_blue);   
+}
+
diff --git a/src/support_data/ossimLasPointRecord3.cpp b/src/support_data/ossimLasPointRecord3.cpp
new file mode 100644
index 0000000..a1bec57
--- /dev/null
+++ b/src/support_data/ossimLasPointRecord3.cpp
@@ -0,0 +1,230 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord3.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+// Description: Container class LAS point record type 3.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimLasPointRecord3.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <iomanip>
+#include <iostream>
+#include <istream>
+#include <ostream>
+
+ossimLasPointRecord3::ossimLasPointRecord3Data::ossimLasPointRecord3Data()
+   :
+   m_x(0),
+   m_y(0),
+   m_z(0),
+   m_intensity(0),
+   m_bitFlags(0),
+   m_classification(0),
+   m_scanAngleRank(0),
+   m_userData(0),
+   m_pointSourceId(0),
+   m_gpsTime(0.0),
+   m_red(0),
+   m_green(0),
+   m_blue(0)
+{
+}
+
+ossimLasPointRecord3::ossimLasPointRecord3Data::ossimLasPointRecord3Data(
+   const ossimLasPointRecord3::ossimLasPointRecord3Data& obj)
+   :
+   m_x(obj.m_x),
+   m_y(obj.m_y),
+   m_z(obj.m_z),
+   m_intensity(obj.m_intensity),
+   m_bitFlags(obj.m_bitFlags),
+   m_classification(obj.m_classification),
+   m_scanAngleRank(obj.m_scanAngleRank),
+   m_userData(obj.m_userData),
+   m_pointSourceId(obj.m_pointSourceId),
+   m_gpsTime(obj.m_gpsTime),
+   m_red(obj.m_red),
+   m_green(obj.m_green),
+   m_blue(obj.m_blue)   
+{
+}
+
+const ossimLasPointRecord3::ossimLasPointRecord3Data&
+ossimLasPointRecord3::ossimLasPointRecord3Data::operator=(
+   const ossimLasPointRecord3::ossimLasPointRecord3Data& obj)
+{
+   if ( this != &obj )
+   {
+      m_x              = obj.m_x;
+      m_y              = obj.m_y;
+      m_z              = obj.m_z;
+      m_intensity      = obj.m_intensity;
+      m_bitFlags       = obj.m_bitFlags;
+      m_classification = obj.m_classification;
+      m_scanAngleRank  = obj.m_scanAngleRank;
+      m_userData       = obj.m_userData;
+      m_pointSourceId  = obj.m_pointSourceId;
+      m_gpsTime        = obj.m_gpsTime;
+      m_red            = obj.m_red;
+      m_green          = obj.m_green;
+      m_blue           = obj.m_blue;
+   }
+   return *this;
+}
+
+ossimLasPointRecord3::ossimLasPointRecord3()
+   :
+   m_record()
+{
+}
+
+ossimLasPointRecord3::ossimLasPointRecord3(const ossimLasPointRecord3& obj)
+   :
+   m_record(obj.m_record)
+{
+}
+
+const ossimLasPointRecord3& ossimLasPointRecord3::operator=(const ossimLasPointRecord3& copy_this)
+{
+   if (this != &copy_this)
+   {
+      m_record = copy_this.m_record;
+   }
+   return *this;
+}
+
+ossimLasPointRecord3::~ossimLasPointRecord3()
+{
+}
+
+void ossimLasPointRecord3::readStream(std::istream& in)
+{
+   in.read((char*)&m_record, sizeof(ossimLasPointRecord3Data));
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      swap();
+   }
+}
+
+void ossimLasPointRecord3::writeStream(std::ostream& out)
+{
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Write little endian per spec:
+      swap();
+   }
+
+   out.write((char*)&m_record, sizeof(ossimLasPointRecord3Data));
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Swap back to native byte order if needed:
+      swap();
+   }
+}
+
+ossim_int32 ossimLasPointRecord3::getX() const
+{
+   return m_record.m_x;
+}
+
+ossim_int32 ossimLasPointRecord3::getY() const
+{
+   return m_record.m_y;
+}
+
+ossim_int32 ossimLasPointRecord3::getZ() const
+{
+   return m_record.m_z;
+}
+
+ossim_uint16 ossimLasPointRecord3::getRed() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord3::getGreen() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord3::getBlue() const
+{
+   return 0;
+}
+
+
+ossim_uint16 ossimLasPointRecord3::getIntensity() const
+{
+   return m_record.m_intensity;
+}
+
+ossim_uint8 ossimLasPointRecord3::getReturnNumber() const
+{
+   return (m_record.m_bitFlags.m_returnNumber);
+}
+
+ossim_uint8 ossimLasPointRecord3::getNumberOfReturns() const
+{
+   return (m_record.m_bitFlags.m_numberOfReturns);
+}
+
+ossim_uint8 ossimLasPointRecord3::getEdgeFlag() const
+{
+   return (m_record.m_bitFlags.m_edgeOfFlightLine);
+}
+
+std::ostream& ossimLasPointRecord3::print(std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
+ 
+   out << "x:                 " << m_record.m_x
+       << "\ny:                 " << m_record.m_y
+       << "\nz:                 " << m_record.m_z
+       << "\nintensity:         " << m_record.m_intensity
+       << "\nreturn:            " << int(getReturnNumber())
+       << "\nnumber_of_returns: " << int(getNumberOfReturns())
+       << "\nedge:              " << (getEdgeFlag()?"true":"false")
+       << "\nscan_direction:    " << int(m_record.m_bitFlags.m_scanDirection)
+       << "\nclassification:    " << m_record.m_classification
+       << "\nscan_angle_rank:   " << int(m_record.m_scanAngleRank)
+       << "\nuser_data:         " << m_record.m_userData
+       << "\npoint_source_id:   " << m_record.m_pointSourceId
+       << "\ngrs_time:          " << m_record.m_gpsTime
+       << "\nred:               " << m_record.m_red
+       << "\ngreen:             " << m_record.m_green
+       << "\nblue:              " << m_record.m_blue
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+   return out;
+}
+
+void ossimLasPointRecord3::swap()
+{
+   ossimEndian endian;
+   endian.swap(m_record.m_x);
+   endian.swap(m_record.m_y);
+   endian.swap(m_record.m_z);
+   endian.swap(m_record.m_intensity);
+   endian.swap(m_record.m_pointSourceId);
+   endian.swap(m_record.m_gpsTime);
+   endian.swap(m_record.m_red);
+   endian.swap(m_record.m_green);
+   endian.swap(m_record.m_blue);   
+}
+
diff --git a/src/support_data/ossimLasPointRecord4.cpp b/src/support_data/ossimLasPointRecord4.cpp
new file mode 100644
index 0000000..dafb2a5
--- /dev/null
+++ b/src/support_data/ossimLasPointRecord4.cpp
@@ -0,0 +1,248 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimLasPointRecord4.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David burken
+//
+// Description: Container class LAS point record type 4.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimLasPointRecord4.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimEndian.h>
+#include <iomanip>
+#include <iostream>
+#include <istream>
+#include <ostream>
+
+ossimLasPointRecord4::ossimLasPointRecord4Data::ossimLasPointRecord4Data()
+   :
+   m_x(0),
+   m_y(0),
+   m_z(0),
+   m_intensity(0),
+   m_bitFlags(0),
+   m_classification(0),
+   m_scanAngleRank(0),
+   m_userData(0),
+   m_pointSourceId(0),
+   m_gpsTime(0.0),
+   m_wavePacketDescriptorIndex(0),
+   m_byteOffsetToWaveformData(0),
+   m_waveformPacketSizeInBytes(0),
+   m_returnPointWaveformLocation(0.0),
+   m_red(0),
+   m_green(0),
+   m_blue(0)
+{
+}
+
+ossimLasPointRecord4::ossimLasPointRecord4Data::ossimLasPointRecord4Data(
+   const ossimLasPointRecord4::ossimLasPointRecord4Data& obj)
+   :
+   m_x(obj.m_x),
+   m_y(obj.m_y),
+   m_z(obj.m_z),
+   m_intensity(obj.m_intensity),
+   m_bitFlags(obj.m_bitFlags),
+   m_classification(obj.m_classification),
+   m_scanAngleRank(obj.m_scanAngleRank),
+   m_userData(obj.m_userData),
+   m_pointSourceId(obj.m_pointSourceId),
+   m_gpsTime(obj.m_gpsTime),
+   m_wavePacketDescriptorIndex(obj.m_wavePacketDescriptorIndex),
+   m_byteOffsetToWaveformData(obj.m_byteOffsetToWaveformData),
+   m_waveformPacketSizeInBytes(obj.m_waveformPacketSizeInBytes),
+   m_returnPointWaveformLocation(obj.m_returnPointWaveformLocation),
+   m_red(obj.m_red),
+   m_green(obj.m_green),
+   m_blue(obj.m_blue)   
+{
+}
+
+const ossimLasPointRecord4::ossimLasPointRecord4Data&
+ossimLasPointRecord4::ossimLasPointRecord4Data::operator=(
+   const ossimLasPointRecord4::ossimLasPointRecord4Data& obj)
+{
+   if ( this != &obj )
+   {
+      m_x              = obj.m_x;
+      m_y              = obj.m_y;
+      m_z              = obj.m_z;
+      m_intensity      = obj.m_intensity;
+      m_bitFlags       = obj.m_bitFlags;
+      m_classification = obj.m_classification;
+      m_scanAngleRank  = obj.m_scanAngleRank;
+      m_userData       = obj.m_userData;
+      m_pointSourceId  = obj.m_pointSourceId;
+      m_gpsTime        = obj.m_gpsTime;
+      m_wavePacketDescriptorIndex   = obj.m_wavePacketDescriptorIndex;
+      m_byteOffsetToWaveformData    = obj.m_byteOffsetToWaveformData;
+      m_waveformPacketSizeInBytes   = obj.m_waveformPacketSizeInBytes;
+      m_returnPointWaveformLocation = obj.m_returnPointWaveformLocation;
+      m_red            = obj.m_red;
+      m_green          = obj.m_green;
+      m_blue           = obj.m_blue;
+   }
+   return *this;
+}
+
+ossimLasPointRecord4::ossimLasPointRecord4()
+   :
+   m_record()
+{
+}
+
+ossimLasPointRecord4::ossimLasPointRecord4(const ossimLasPointRecord4& obj)
+   :
+   m_record(obj.m_record)
+{
+}
+
+const ossimLasPointRecord4& ossimLasPointRecord4::operator=(const ossimLasPointRecord4& copy_this)
+{
+   if (this != &copy_this)
+   {
+      m_record = copy_this.m_record;
+   }
+   return *this;
+}
+
+ossimLasPointRecord4::~ossimLasPointRecord4()
+{
+}
+
+void ossimLasPointRecord4::readStream(std::istream& in)
+{
+   in.read((char*)&m_record, sizeof(ossimLasPointRecord4Data));
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      swap();
+   }
+}
+
+void ossimLasPointRecord4::writeStream(std::ostream& out)
+{
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Write little endian per spec:
+      swap();
+   }
+
+   out.write((char*)&m_record, sizeof(ossimLasPointRecord4Data));
+
+   if ( ossim::byteOrder() == OSSIM_BIG_ENDIAN )
+   {
+      // Swap back to native byte order if needed:
+      swap();
+   }
+}
+
+ossim_int32 ossimLasPointRecord4::getX() const
+{
+   return m_record.m_x;
+}
+
+ossim_int32 ossimLasPointRecord4::getY() const
+{
+   return m_record.m_y;
+}
+
+ossim_int32 ossimLasPointRecord4::getZ() const
+{
+   return m_record.m_z;
+}
+
+ossim_uint16 ossimLasPointRecord4::getRed() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord4::getGreen() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord4::getBlue() const
+{
+   return 0;
+}
+
+ossim_uint16 ossimLasPointRecord4::getIntensity() const
+{
+   return m_record.m_intensity;
+}
+
+ossim_uint8 ossimLasPointRecord4::getReturnNumber() const
+{
+   return (m_record.m_bitFlags.m_returnNumber);
+}
+
+ossim_uint8 ossimLasPointRecord4::getNumberOfReturns() const
+{
+   return (m_record.m_bitFlags.m_numberOfReturns);
+}
+
+ossim_uint8 ossimLasPointRecord4::getEdgeFlag() const
+{
+   return (m_record.m_bitFlags.m_edgeOfFlightLine);
+}
+
+std::ostream& ossimLasPointRecord4::print(std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << std::setiosflags(std::ios_base::fixed) << std::setprecision(8);
+ 
+   out << "x:                             " << m_record.m_x
+       << "\ny:                             " << m_record.m_y
+       << "\nz:                             " << m_record.m_z
+       << "\nintensity:                     " << m_record.m_intensity
+       << "\nreturn:                        " << int(getReturnNumber())
+       << "\nnumber_of_returns:             " << int(getNumberOfReturns())
+       << "\nedge:                          " << (getEdgeFlag()?"true":"false")
+       << "\nscan_direction:                " << int(m_record.m_bitFlags.m_scanDirection)
+       << "\nclassification:                " << m_record.m_classification
+       << "\nscan_angle_rank:               " << int(m_record.m_scanAngleRank)
+       << "\nuser_data:                     " << m_record.m_userData
+       << "\npoint_source_id:               " << m_record.m_pointSourceId
+       << "\ngrs_time:                      " << m_record.m_gpsTime
+       << "\nwave_packet_descriptor_index:  " << m_record.m_wavePacketDescriptorIndex
+       << "\nbyte_offset_to_waveform_data:  " << m_record.m_byteOffsetToWaveformData
+       << "\nwaveform_packet_size_in_bytes: " << m_record.m_waveformPacketSizeInBytes
+       << "\nm_returnPointWaveformLocation: " << m_record.m_returnPointWaveformLocation
+       << "\nred:                           " << m_record.m_red
+       << "\ngreen:                         " << m_record.m_green
+       << "\nblue:                          " << m_record.m_blue
+       << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+   return out;
+}
+
+void ossimLasPointRecord4::swap()
+{
+   ossimEndian endian;
+   endian.swap(m_record.m_x);
+   endian.swap(m_record.m_y);
+   endian.swap(m_record.m_z);
+   endian.swap(m_record.m_intensity);
+   endian.swap(m_record.m_pointSourceId);
+   endian.swap(m_record.m_gpsTime);
+   endian.swap(m_record.m_byteOffsetToWaveformData);
+   endian.swap(m_record.m_waveformPacketSizeInBytes);
+   endian.swap(m_record.m_returnPointWaveformLocation);
+   endian.swap(m_record.m_red);
+   endian.swap(m_record.m_green);
+   endian.swap(m_record.m_blue);   
+}
+
diff --git a/src/support_data/ossimNitfAcftbTag.cpp b/src/support_data/ossimNitfAcftbTag.cpp
new file mode 100644
index 0000000..14e11ba
--- /dev/null
+++ b/src/support_data/ossimNitfAcftbTag.cpp
@@ -0,0 +1,264 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ACFTB - Aircraft Infomation Extension Format tag class
+// declaration.
+//
+// See document STDI-0002 (version 3), Appendix E, Table E-6 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfAcftbTag.h>
+
+
+RTTI_DEF1(ossimNitfAcftbTag, "ossimNitfAcftbTag", ossimNitfRegisteredTag);
+
+ossimNitfAcftbTag::ossimNitfAcftbTag()
+   : ossimNitfRegisteredTag(std::string("ACFTB"), CEL_SIZE)
+{
+   clearFields();
+}
+
+ossimNitfAcftbTag::~ossimNitfAcftbTag()
+{
+}
+
+void ossimNitfAcftbTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(theAcMsnId, AC_MSN_ID_SIZE);
+   in.read(theAcTailNo, AC_TAIL_NO_SIZE);
+   in.read(theAcTo, AC_TO_SIZE);
+   in.read(theSensorIdType, SENSOR_ID_TYPE_SIZE);
+   in.read(theSensorId, SENSOR_ID_SIZE);
+   in.read(theSceneSource, SCENE_SOURCE_SIZE);
+   in.read(theScNum, SCNUM_SIZE);
+   in.read(thePDate, PDATE_SIZE);
+   in.read(theImHostNo, IMHOSTNO_SIZE);
+   in.read(theImReqID, IMREQID_SIZE);
+   in.read(theMPlan, MPLAN_SIZE);
+   in.read(theEntLoc, ENTLOC_SIZE);
+   in.read(theLocAccy, LOC_ACCY_SIZE);
+   in.read(theEntelv, ENTELV_SIZE);
+   in.read(theElvUnit, ELV_UNIT_SIZE);
+   in.read(theExitLoc, EXITLOC_SIZE);
+   in.read(theExitElev, EXITELV_SIZE);
+   in.read(theTMap, TMAP_SIZE);
+   in.read(theRowSpacing, ROW_SPACING_SIZE);
+   in.read(theRowSpacingUnits, ROW_SPACING_UNITS_SIZE);
+   in.read(theColSpacing, COL_SPACING_SIZE);
+   in.read(theColSpacingUnits, COL_SPACING_UINTS_SIZE);
+   in.read(theFocalLength, FOCAL_LENGTH_SIZE);
+   in.read(theSenserial, SENSERIAL_SIZE);
+   in.read(theAbSwVer, ABSWVER_SIZE);
+   in.read(theCalDate, CAL_DATE_SIZE);
+   in.read(thePatchTot, PATCH_TOT_SIZE);
+   in.read(theMtiTot, MTI_TOT_SIZE);
+}
+
+void ossimNitfAcftbTag::writeStream(std::ostream& out)
+{
+   out.write(theAcMsnId, AC_MSN_ID_SIZE);
+   out.write(theAcTailNo, AC_TAIL_NO_SIZE);
+   out.write(theAcTo, AC_TO_SIZE);
+   out.write(theSensorIdType, SENSOR_ID_TYPE_SIZE);
+   out.write(theSensorId, SENSOR_ID_SIZE);
+   out.write(theSceneSource, SCENE_SOURCE_SIZE);
+   out.write(theScNum, SCNUM_SIZE);
+   out.write(thePDate, PDATE_SIZE);
+   out.write(theImHostNo, IMHOSTNO_SIZE);
+   out.write(theImReqID, IMREQID_SIZE);
+   out.write(theMPlan, MPLAN_SIZE);
+   out.write(theEntLoc, ENTLOC_SIZE);
+   out.write(theLocAccy, LOC_ACCY_SIZE);
+   out.write(theEntelv, ENTELV_SIZE);
+   out.write(theElvUnit, ELV_UNIT_SIZE);
+   out.write(theExitLoc, EXITLOC_SIZE);
+   out.write(theExitElev, EXITELV_SIZE);
+   out.write(theTMap, TMAP_SIZE);
+   out.write(theRowSpacing, ROW_SPACING_SIZE);
+   out.write(theRowSpacingUnits, ROW_SPACING_UNITS_SIZE);
+   out.write(theColSpacing, COL_SPACING_SIZE);
+   out.write(theColSpacingUnits, COL_SPACING_UINTS_SIZE);
+   out.write(theFocalLength, FOCAL_LENGTH_SIZE);
+   out.write(theSenserial, SENSERIAL_SIZE);
+   out.write(theAbSwVer, ABSWVER_SIZE);
+   out.write(theCalDate, CAL_DATE_SIZE);
+   out.write(thePatchTot, PATCH_TOT_SIZE);
+   out.write(theMtiTot, MTI_TOT_SIZE);
+}
+
+void ossimNitfAcftbTag::clearFields()
+{
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+
+   // clear
+   memset(theAcMsnId, ' ', AC_MSN_ID_SIZE);
+   memset(theAcTailNo, ' ', AC_TAIL_NO_SIZE);
+   memset(theAcTo, ' ', AC_TO_SIZE);
+   memset(theSensorIdType, ' ', SENSOR_ID_TYPE_SIZE);
+   memset(theSensorId, ' ', SENSOR_ID_SIZE);
+   memset(theSceneSource, ' ', SCENE_SOURCE_SIZE);
+   memset(theScNum, ' ', SCNUM_SIZE);
+   memset(thePDate, ' ', PDATE_SIZE);
+   memset(theImHostNo, ' ', IMHOSTNO_SIZE);
+   memset(theImReqID, ' ', IMREQID_SIZE);
+   memset(theMPlan, ' ', MPLAN_SIZE);
+   memset(theEntLoc, ' ', ENTLOC_SIZE);
+   memset(theLocAccy, ' ', LOC_ACCY_SIZE);
+   memset(theEntelv, ' ', ENTELV_SIZE);
+   memset(theElvUnit, ' ', ELV_UNIT_SIZE);
+   memset(theExitLoc, ' ', EXITLOC_SIZE);
+   memset(theExitElev, ' ', EXITELV_SIZE);
+   memset(theTMap, ' ', TMAP_SIZE);
+   memset(theRowSpacing, ' ', ROW_SPACING_SIZE);
+   memset(theRowSpacingUnits, ' ', ROW_SPACING_UNITS_SIZE);
+   memset(theColSpacing, ' ', COL_SPACING_SIZE);
+   memset(theColSpacingUnits, ' ', COL_SPACING_UINTS_SIZE);
+   memset(theFocalLength, ' ', FOCAL_LENGTH_SIZE);
+   memset(theSenserial, ' ', SENSERIAL_SIZE);
+   memset(theAbSwVer, ' ', ABSWVER_SIZE);
+   memset(theCalDate, ' ', CAL_DATE_SIZE);
+   memset(thePatchTot, ' ', PATCH_TOT_SIZE);
+   memset(theMtiTot, ' ', MTI_TOT_SIZE);
+
+
+   // null terminate
+   theAcMsnId[AC_MSN_ID_SIZE] = '\0';
+   theAcTailNo[AC_TAIL_NO_SIZE] = '\0';
+   theAcTo[AC_TO_SIZE] = '\0';
+   theSensorIdType[SENSOR_ID_TYPE_SIZE] = '\0';
+   theSensorId[SENSOR_ID_SIZE] = '\0';
+   theSceneSource[SCENE_SOURCE_SIZE] = '\0';
+   theScNum[SCNUM_SIZE] = '\0';
+   thePDate[PDATE_SIZE] = '\0';
+   theImHostNo[IMHOSTNO_SIZE] = '\0';
+   theImReqID[IMREQID_SIZE] = '\0';
+   theMPlan[MPLAN_SIZE] = '\0';
+   theEntLoc[ENTLOC_SIZE] = '\0';
+   theLocAccy[LOC_ACCY_SIZE] = '\0';
+   theEntelv[ENTELV_SIZE] = '\0';
+   theElvUnit[ELV_UNIT_SIZE] = '\0';
+   theExitLoc[EXITLOC_SIZE] = '\0';
+   theExitElev[EXITELV_SIZE] = '\0';
+   theTMap[TMAP_SIZE] = '\0';
+   theRowSpacing[ROW_SPACING_SIZE] = '\0';
+   theRowSpacingUnits[ROW_SPACING_UNITS_SIZE] = '\0';
+   theColSpacing[COL_SPACING_SIZE] = '\0';
+   theColSpacingUnits[COL_SPACING_UINTS_SIZE] = '\0';
+   theFocalLength[FOCAL_LENGTH_SIZE] = '\0';
+   theSenserial[SENSERIAL_SIZE] = '\0';
+   theAbSwVer[ABSWVER_SIZE] = '\0';
+   theCalDate[CAL_DATE_SIZE] = '\0';
+   thePatchTot[PATCH_TOT_SIZE] = '\0';
+   theMtiTot[MTI_TOT_SIZE] = '\0';
+}
+
+ossimString ossimNitfAcftbTag::getFocalLength()const
+{
+   return ossimString(theFocalLength);
+}
+
+ossimString ossimNitfAcftbTag::getColumnSpacing()const
+{
+   return ossimString(theColSpacing);
+}
+
+ossimString ossimNitfAcftbTag::getColumnSpacingUnits()const
+{
+   return ossimString(theColSpacingUnits);
+}
+
+ossimString ossimNitfAcftbTag::getRowSpacing()const
+{
+   return ossimString(theRowSpacing);
+}
+
+ossimString ossimNitfAcftbTag::getRowSpacingUnits()const
+{
+   return ossimString(theRowSpacingUnits);
+}
+
+
+std::ostream& ossimNitfAcftbTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "AC_MSN_ID:"
+       << theAcMsnId << "\n"
+       << pfx << std::setw(24) << "AC_TAIL_NO:"
+       << theAcTailNo << "\n"
+       << pfx << std::setw(24) << "AC_TO:"
+       << theAcTo << "\n"
+       << pfx << std::setw(24) << "SENSOR_ID_TYPE:"
+       << theSensorIdType << "\n"
+       << pfx << std::setw(24) << "SENSOR_ID:"
+       << theSensorId << "\n"
+       << pfx << std::setw(24) << "SCENE_SOURCE:"
+       << theSceneSource << "\n"
+       << pfx << std::setw(24) << "SCNUM:"
+       << theScNum << "\n"
+       << pfx << std::setw(24) << "PDATE:"
+       << thePDate << "\n"
+       << pfx << std::setw(24) << "IMHOSTNO:"
+       << theImHostNo << "\n"
+       << pfx << std::setw(24) << "IMREQID:"
+       << theImReqID << "\n"
+       << pfx << std::setw(24) << "MPLAN:"
+       << theMPlan << "\n"
+       << pfx << std::setw(24) << "ENTLOC:"
+       << theEntLoc << "\n"
+       << pfx << std::setw(24) << "LOC_ACCY:"
+       << theLocAccy << "\n"
+       << pfx << std::setw(24) << "ENTELV:"
+       << theEntelv << "\n"
+       << pfx << std::setw(24) << "ELV_UNIT:"
+       << theElvUnit << "\n"
+       << pfx << std::setw(24) << "EXITLOC:"
+       << theExitLoc << "\n"
+       << pfx << std::setw(24) << "EXITELV:"
+       << theExitElev << "\n"
+       << pfx << std::setw(24) << "TMAP:"
+       << theTMap << "\n"
+       << pfx << std::setw(24) << "ROW_SPACING:"
+       << theRowSpacing << "\n"
+       << pfx << std::setw(24) << "ROW_SPACING_UNITS:"
+       << theRowSpacingUnits << "\n"
+       << pfx << std::setw(24) << "COL_SPACING:"
+       << theColSpacing << "\n"
+       << pfx << std::setw(24) << "COL_SPACING_UINTS:"
+       << theColSpacingUnits << "\n"
+       << pfx << std::setw(24) << "FOCAL_LENGTH:"
+       << theFocalLength << "\n"
+       << pfx << std::setw(24) << "SENSERIAL:"
+       << theSenserial << "\n"
+       << pfx << std::setw(24) << "ABSWVER:"
+       << theAbSwVer << "\n"
+       << pfx << std::setw(24) << "CAL_DATE:"
+       << theCalDate << "\n"
+       << pfx << std::setw(24) << "PATCH_TOT:"
+       << thePatchTot << "\n"
+       << pfx << std::setw(24) << "MTI_TOT:"
+       << theMtiTot << "\n";
+   
+   return out;
+}
diff --git a/src/support_data/ossimNitfAimidbTag.cpp b/src/support_data/ossimNitfAimidbTag.cpp
new file mode 100644
index 0000000..02af9d9
--- /dev/null
+++ b/src/support_data/ossimNitfAimidbTag.cpp
@@ -0,0 +1,171 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: AIMIDB - Additional Image ID Extension Format tag class
+// definition.
+//
+// See document STDI-0002 (version 3), Appendix E, Table E-3 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfAimidbTag.h>
+
+
+RTTI_DEF1(ossimNitfAimidbTag, "ossimNitfAimidbTag", ossimNitfRegisteredTag);
+
+ossimNitfAimidbTag::ossimNitfAimidbTag()
+   : ossimNitfRegisteredTag(std::string("AIMIDB"), CEL_SIZE)
+{
+   clearFields();
+}
+
+ossimNitfAimidbTag::~ossimNitfAimidbTag()
+{
+}
+
+void ossimNitfAimidbTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(theAcquisitionDate, ACQUISITION_DATE_SIZE);
+   in.read(theMissionNumber, MISSION_NO_SIZE);
+   in.read(theMissionIdentification, MISSION_IDENTIFICATION_SIZE);
+   in.read(theFlightNo, FLIGHT_NO_SIZE);
+   in.read(theOpNum, OP_NUM_SIZE);
+   in.read(theCurrentSegment, CURRENT_SEGMENT_SIZE);
+   in.read(theReproNum, REPRO_NUM_SIZE);
+   in.read(theReplay, REPLAY_SIZE);
+   in.read(theReserved1, RESERVED_1_SIZE);
+   in.read(theStartTileColumn, START_TILE_COLUMN_SIZE);
+   in.read(theStartTileRow, START_TILE_ROW_SIZE);
+   in.read(theEndSegment, END_SEGMENT_SIZE);
+   in.read(theTileColumn, END_TILE_COLUMN_SIZE);
+   in.read(theTileRow, END_TILE_ROW_SIZE);
+   in.read(theCountry, COUNTRY_SIZE);
+   in.read(theReserved2, RESERVED_2_SIZE);
+   in.read(theLocation, LOCATION_SIZE);
+   in.read(theReserved3, RESERVED_3_SIZE);
+}
+
+void ossimNitfAimidbTag::writeStream(std::ostream& out)
+{
+   out.write(theAcquisitionDate, ACQUISITION_DATE_SIZE);
+   out.write(theMissionNumber, MISSION_NO_SIZE);
+   out.write(theMissionIdentification, MISSION_IDENTIFICATION_SIZE);
+   out.write(theFlightNo, FLIGHT_NO_SIZE);
+   out.write(theOpNum, OP_NUM_SIZE);
+   out.write(theCurrentSegment, CURRENT_SEGMENT_SIZE);
+   out.write(theReproNum, REPRO_NUM_SIZE);
+   out.write(theReplay, REPLAY_SIZE);
+   out.write(theReserved1, RESERVED_1_SIZE);
+   out.write(theStartTileColumn, START_TILE_COLUMN_SIZE);
+   out.write(theStartTileRow, START_TILE_ROW_SIZE);
+   out.write(theEndSegment, END_SEGMENT_SIZE);
+   out.write(theTileColumn, END_TILE_COLUMN_SIZE);
+   out.write(theTileRow, END_TILE_ROW_SIZE);
+   out.write(theCountry, COUNTRY_SIZE);
+   out.write(theReserved2, RESERVED_2_SIZE);
+   out.write(theLocation, LOCATION_SIZE);
+   out.write(theReserved3, RESERVED_3_SIZE);
+}
+
+void ossimNitfAimidbTag::clearFields()
+{
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+
+   // clear
+   memset(theAcquisitionDate, ' ', ACQUISITION_DATE_SIZE);
+   memset(theMissionNumber, ' ', MISSION_NO_SIZE);
+   memset(theMissionIdentification, ' ', MISSION_IDENTIFICATION_SIZE);
+   memset(theFlightNo, ' ', FLIGHT_NO_SIZE);
+   memset(theOpNum, ' ', OP_NUM_SIZE);
+   memset(theCurrentSegment, ' ', CURRENT_SEGMENT_SIZE);
+   memset(theReproNum, ' ', REPRO_NUM_SIZE);
+   memset(theReplay, ' ', REPLAY_SIZE);
+   memset(theReserved1, ' ', RESERVED_1_SIZE);
+   memset(theStartTileColumn, ' ', START_TILE_COLUMN_SIZE);
+   memset(theStartTileRow, ' ', START_TILE_ROW_SIZE);
+   memset(theEndSegment, ' ', END_SEGMENT_SIZE);
+   memset(theTileColumn, ' ', END_TILE_COLUMN_SIZE);
+   memset(theTileRow, ' ', END_TILE_ROW_SIZE);
+   memset(theCountry, ' ', COUNTRY_SIZE);
+   memset(theReserved2, ' ', RESERVED_2_SIZE);
+   memset(theLocation, ' ', LOCATION_SIZE);
+   memset(theReserved3, ' ', RESERVED_3_SIZE);
+
+   // null terminate
+   theAcquisitionDate[ACQUISITION_DATE_SIZE] = '\0';
+   theMissionNumber[MISSION_NO_SIZE] = '\0';
+   theMissionIdentification[MISSION_IDENTIFICATION_SIZE] = '\0';
+   theFlightNo[FLIGHT_NO_SIZE] = '\0';
+   theOpNum[OP_NUM_SIZE] = '\0';
+   theCurrentSegment[CURRENT_SEGMENT_SIZE] = '\0';
+   theReproNum[REPRO_NUM_SIZE] = '\0';
+   theReplay[REPLAY_SIZE] = '\0';
+   theReserved1[RESERVED_1_SIZE] = '\0';
+   theStartTileColumn[START_TILE_COLUMN_SIZE] = '\0';
+   theStartTileRow[START_TILE_ROW_SIZE] = '\0';
+   theEndSegment[END_SEGMENT_SIZE] = '\0';
+   theTileColumn[END_TILE_COLUMN_SIZE] = '\0';
+   theTileRow[END_TILE_ROW_SIZE] = '\0';
+   theCountry[COUNTRY_SIZE] = '\0';
+   theReserved2[RESERVED_2_SIZE] = '\0';
+   theLocation[LOCATION_SIZE] = '\0';
+   theReserved3[RESERVED_3_SIZE] = '\0';
+}
+
+std::ostream& ossimNitfAimidbTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "ACQUISITION_DATE:"
+       << theAcquisitionDate << "\n"
+       << pfx << std::setw(24) << "MISSION_NO:"
+       << theMissionNumber << "\n"
+       << pfx << std::setw(24) << "MISSION_IDENTIFICATION:"
+       << theMissionIdentification<< "\n"
+       << pfx << std::setw(24) << "FLIGHT_NO:"
+       << theFlightNo << "\n"
+       << pfx << std::setw(24) << "OP_NUM:"
+       << theOpNum << "\n"
+       << pfx << std::setw(24) << "CURRENT_SEGMENT:"
+       << theCurrentSegment << "\n"
+       << pfx << std::setw(24) << "REPRO_NUM:"
+       << theReproNum<< "\n"
+       << pfx << std::setw(24) << "REPLAY:"
+       << theReplay<< "\n"
+       << pfx << std::setw(24) << "START_TILE_COLUMN:"
+       << theStartTileColumn << "\n"
+       << pfx << std::setw(24) << "START_TILE_ROW:"
+       << theStartTileRow << "\n"
+       << pfx << std::setw(24) << "END_SEGMENT:"
+       << theEndSegment << "\n"
+       << pfx << std::setw(24) << "END_TILE_COLUMN:"
+       << theTileColumn << "\n"
+       << pfx << std::setw(24) << "END_TILE_ROW:"
+       << theTileRow << "\n"
+       << pfx << std::setw(24) << "COUNTRY:"
+       << theCountry << "\n"
+       << pfx << std::setw(24) << "LOCATION:"
+       << theLocation << "\n";
+   
+   return out;
+}
diff --git a/src/support_data/ossimNitfBlockaTag.cpp b/src/support_data/ossimNitfBlockaTag.cpp
new file mode 100644
index 0000000..cfefe37
--- /dev/null
+++ b/src/support_data/ossimNitfBlockaTag.cpp
@@ -0,0 +1,325 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: BLOCKA tag class declaration.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfBlockaTag.cpp 23245 2015-04-08 20:53:04Z rashadkm $
+
+#include <cstring> /* for memcpy */
+#include <sstream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfBlockaTag.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimDms.h>
+#include <ossim/base/ossimDpt.h>
+
+static const ossimTrace traceDebug(ossimString("ossimNitfBlockaTag:debug"));
+
+RTTI_DEF1(ossimNitfBlockaTag, "ossimNitfBlockaTag", ossimNitfRegisteredTag);
+
+ossimNitfBlockaTag::ossimNitfBlockaTag()
+   : ossimNitfRegisteredTag(std::string("BLOCKA"), 123)
+{
+   clearFields();
+}
+
+void ossimNitfBlockaTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theBlockInstance, BLOCK_INSTANCE_SIZE);
+   in.read(theNGray,         N_GRAY_SIZE);
+   in.read(theLLines,        L_LINES_SIZE);
+   in.read(theLayoverAngle,  LAYOVER_ANGLE_SIZE);
+   in.read(theShadowAngle,   SHADOW_ANGLE_SIZE);
+   in.read(theField6,        FIELD_6_SIZE);
+   in.read(theFrlcLoc,       FRLC_LOC_SIZE);
+   in.read(theLrlcLoc,       LRLC_LOC_SIZE);
+   in.read(theLrfcLoc,       LRFC_LOC_SIZE);
+   in.read(theFrfcLoc,       FRFC_LOC_SIZE);
+   in.read(theField11,       FIELD_11_SIZE);
+   
+}
+
+void ossimNitfBlockaTag::writeStream(std::ostream& out)
+{
+   out.write(theBlockInstance, BLOCK_INSTANCE_SIZE);
+   out.write(theNGray,         N_GRAY_SIZE);
+   out.write(theLLines,        L_LINES_SIZE);
+   out.write(theLayoverAngle,  LAYOVER_ANGLE_SIZE);
+   out.write(theShadowAngle,   SHADOW_ANGLE_SIZE);
+   out.write(theField6,        FIELD_6_SIZE);
+   out.write(theFrlcLoc,       FRLC_LOC_SIZE);
+   out.write(theLrlcLoc,       LRLC_LOC_SIZE);
+   out.write(theLrfcLoc,       LRFC_LOC_SIZE);
+   out.write(theFrfcLoc,       FRFC_LOC_SIZE);
+   out.write(theField11,       FIELD_11_SIZE);
+}
+
+void ossimNitfBlockaTag::clearFields()
+{
+   memcpy(theBlockInstance, "01",    BLOCK_INSTANCE_SIZE);
+   memset(theNGray,         0,     N_GRAY_SIZE);
+   memset(theLLines,        0,     L_LINES_SIZE);
+   memset(theLayoverAngle,  ' ',     LAYOVER_ANGLE_SIZE);
+   memset(theShadowAngle,   ' ',     SHADOW_ANGLE_SIZE);
+   memset(theField6,        ' ',     FIELD_6_SIZE);
+   memset(theFrlcLoc,       ' ',     FRLC_LOC_SIZE);
+   memset(theLrlcLoc,       ' ',     LRLC_LOC_SIZE);
+   memset(theLrfcLoc,       ' ',     LRFC_LOC_SIZE);
+   memset(theFrfcLoc,       ' ',     FRFC_LOC_SIZE);
+   memcpy(theField11,       "010.0", FIELD_11_SIZE);
+   
+   theBlockInstance[BLOCK_INSTANCE_SIZE] = '\0';
+   theNGray[N_GRAY_SIZE]                 = '\0';
+   theLLines[L_LINES_SIZE]               = '\0';
+   theLayoverAngle[LAYOVER_ANGLE_SIZE]   = '\0';
+   theShadowAngle[SHADOW_ANGLE_SIZE]     = '\0';
+   theField6[FIELD_6_SIZE]               = '\0';
+   theFrlcLoc[FRLC_LOC_SIZE]             = '\0';
+   theLrlcLoc[LRLC_LOC_SIZE]             = '\0';
+   theLrfcLoc[LRFC_LOC_SIZE]             = '\0';
+   theFrfcLoc[FRFC_LOC_SIZE]             = '\0';
+   theField11[FIELD_11_SIZE]              = '\0';
+}
+
+std::ostream& ossimNitfBlockaTag::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   // Grab the corners parsed into points.
+   ossimDpt ulPt;
+   ossimDpt urPt;
+   ossimDpt lrPt;
+   ossimDpt llPt;
+   getFrfcLoc(ulPt);
+   getFrlcLoc(urPt);
+   getLrlcLoc(lrPt);
+   getLrfcLoc(llPt);
+   
+   out << setiosflags(ios::left)
+       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "BLOCK_INSTANCE:" << theBlockInstance << "\n"
+       << pfx << std::setw(24) << "N_GRAY:"         << theNGray << "\n"
+       << pfx << std::setw(24) << "L_LINES:"        << theLLines << "\n"
+       << pfx << std::setw(24) << "LAYOVER_ANGLE:"  << theLayoverAngle << "\n"
+       << pfx << std::setw(24) << "SHADOW_ANGLE:"   << theShadowAngle << "\n"
+       << pfx << std::setw(24) << "FIELD_6:"        << theField6 << "\n"
+       << pfx << std::setw(24) << "FRLC_LOC:"       << theFrlcLoc << "\n"
+       << pfx << std::setw(24) << "LRLC_LOC:"       << theLrlcLoc << "\n"
+       << pfx << std::setw(24) << "LRFC_LOC:"       << theLrfcLoc << "\n"
+       << pfx << std::setw(24) << "FRFC_LOC:"       << theFrfcLoc << "\n"
+       << pfx << std::setw(24) << "FIELD_11:"       << theField11 << "\n"
+       << pfx << std::setw(24) << "upper left:"     << ulPt << "\n"
+       << pfx << std::setw(24) << "upper right:"    << urPt << "\n"
+       << pfx << std::setw(24) << "lower right:"    << lrPt << "\n"
+       << pfx << std::setw(24) << "lower left:"     << llPt << "\n";
+
+   return out;
+}
+
+void ossimNitfBlockaTag::setBlockInstance(ossim_uint32 block)
+{
+   if ( (block > 0) && (block < 100) )
+   {
+      ossimString os =
+         ossimNitfCommon::convertToIntString(block,
+                                             BLOCK_INSTANCE_SIZE);
+      memcpy(theBlockInstance, os.c_str(), BLOCK_INSTANCE_SIZE);
+   }
+}
+
+ossimString ossimNitfBlockaTag::getBlockInstance() const
+{
+   return ossimString(theBlockInstance);
+}
+
+void ossimNitfBlockaTag::setNGray(ossim_uint32 grayCount)
+{
+   if (grayCount < 100000)
+   {
+      ossimString os =
+         ossimNitfCommon::convertToUIntString(grayCount,
+                                              N_GRAY_SIZE);
+      memcpy(theNGray, os.c_str(), N_GRAY_SIZE);
+   }
+}
+
+ossimString ossimNitfBlockaTag::getNGray() const
+{
+   return ossimString(theNGray);
+}
+
+void ossimNitfBlockaTag::setLLines(ossim_uint32 lines)
+{
+   if (lines < 100000)
+   {
+      ossimString os =
+         ossimNitfCommon::convertToUIntString(lines, L_LINES_SIZE);
+      memcpy(theLLines, os.c_str(), L_LINES_SIZE);
+   }
+}
+
+ossimString ossimNitfBlockaTag::getLLines() const
+{
+   return ossimString(theLLines);
+}
+
+void ossimNitfBlockaTag::setLayoverAngle(ossim_uint32 angle)
+{
+   if (angle < 360)
+   {
+      ossimString os =
+         ossimNitfCommon::convertToUIntString(angle, LAYOVER_ANGLE_SIZE);
+      memcpy(theLayoverAngle, os.c_str(), LAYOVER_ANGLE_SIZE);
+   }
+}
+
+ossimString ossimNitfBlockaTag::getLayoverAngle() const
+{
+   return ossimString(theLayoverAngle);
+}
+
+void ossimNitfBlockaTag::setShadowAngle(ossim_uint32 angle)
+{
+   if (angle < 360)
+   {
+      ossimString os =
+         ossimNitfCommon::convertToUIntString(angle, SHADOW_ANGLE_SIZE);
+      memcpy(theShadowAngle, os.c_str(), SHADOW_ANGLE_SIZE);
+   }
+}
+
+ossimString ossimNitfBlockaTag::getShadowAngle() const
+{
+   return ossimString(theShadowAngle);
+}
+
+void ossimNitfBlockaTag::setFrlcLoc(const ossimDpt& pt)
+{
+   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
+   memcpy(theFrlcLoc, os.c_str(), FRLC_LOC_SIZE);
+}
+
+ossimString ossimNitfBlockaTag::getFrlcLoc() const
+{
+   return ossimString(theFrlcLoc);
+}
+
+void ossimNitfBlockaTag::getFrlcLoc(ossimDpt& pt) const
+{
+   ossimString os = theFrlcLoc;
+   converLocStringToPt(os, pt);
+}
+
+void ossimNitfBlockaTag::setLrlcLoc(const ossimDpt& pt)
+{
+   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
+   memcpy(theLrlcLoc, os.c_str(), LRLC_LOC_SIZE);
+}
+   
+ossimString ossimNitfBlockaTag::getLrlcLoc() const
+{
+   return ossimString(theLrlcLoc);
+}
+
+void ossimNitfBlockaTag::getLrlcLoc(ossimDpt& pt) const
+{
+   ossimString os = theLrlcLoc;
+   converLocStringToPt(os, pt);
+}
+
+void ossimNitfBlockaTag::setLrfcLoc(const ossimDpt& pt)
+{
+   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
+   memcpy(theLrfcLoc, os.c_str(), LRFC_LOC_SIZE);
+}
+
+ossimString ossimNitfBlockaTag::getLrfcLoc() const
+{
+   return ossimString(theLrfcLoc);
+}
+
+void ossimNitfBlockaTag::getLrfcLoc(ossimDpt& pt) const
+{
+   ossimString os = theLrfcLoc;
+   converLocStringToPt(os, pt); 
+}
+
+void ossimNitfBlockaTag::setFrfcLoc(const ossimDpt& pt)
+{
+   ossimString os = ossimNitfCommon::convertToDdLatLonLocString(pt, 6);
+   memcpy(theFrfcLoc, os.c_str(), FRFC_LOC_SIZE);
+}
+
+ossimString ossimNitfBlockaTag::getFrfcLoc() const
+{
+   return ossimString(theFrfcLoc);
+}
+
+void ossimNitfBlockaTag::getFrfcLoc(ossimDpt& pt) const
+{
+   ossimString os = theFrfcLoc;
+   converLocStringToPt(os, pt);
+}
+
+void ossimNitfBlockaTag::converLocStringToPt(const ossimString& locationString,
+                                             ossimDpt& pt) const
+{
+   if (locationString.size() != 21) return;
+
+   std::string s = locationString;
+   
+   std::string lat(s, 0, 10);
+   std::string lon(s, 10, 11);
+
+   if ( (lat[0] == 'N') || (lat[0] == 'S') )
+   {
+      // Need to enter spaces for ossimDms to parse correctly
+      std::ostringstream latStream;
+      latStream << lat.substr(0, 3) << " " << lat.substr(3, 2)
+                << " " << lat.substr(5);
+      lat = latStream.str();
+      
+      // Use the dms class to parse.
+      ossimDms dms(0.0, true);
+      dms.setDegrees(lat.c_str());
+      pt.y = dms.getDegrees();
+   }
+   else
+   {
+      ossimString os = lat;
+      pt.y = os.toDouble();
+   }
+   if ( (lon[0] == 'E') || (lon[0] == 'W') )
+   {
+      // Need to enter spaces for ossimDms to parse correctly
+      std::ostringstream lonStream;
+      lonStream << lon.substr(0, 4) << " " << lon.substr(4, 2)
+                << " " << lon.substr(6);
+      lon = lonStream.str();
+      
+      // Use the dms class to parse.
+      ossimDms dms(0.0, false);
+      dms.setDegrees(lon.c_str());
+      pt.x = dms.getDegrees();
+   }
+   else
+   {
+      ossimString os = lon;
+      pt.x = os.toDouble();
+   }
+}
diff --git a/src/support_data/ossimNitfCommon.cpp b/src/support_data/ossimNitfCommon.cpp
new file mode 100644
index 0000000..39a3be5
--- /dev/null
+++ b/src/support_data/ossimNitfCommon.cpp
@@ -0,0 +1,545 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Utility class for global nitf methods.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfCommon.cpp 17978 2010-08-24 16:17:00Z dburken $
+
+#include <cstring> /* for memcpy */
+#include <sstream>
+#include <iomanip>
+#include <sstream>
+#include <stdexcept>
+#include <iostream>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/base/ossimDms.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+
+static const ossimTrace traceDebug(ossimString("ossimNitfCommon:debug"));
+
+                                   
+ossimNitfCommon::ossimNitfCommon(){}
+
+ossimNitfCommon::~ossimNitfCommon(){}
+
+ossimString ossimNitfCommon::convertToScientificString(
+   const ossim_float64& aValue,
+   ossim_uint32 size)
+{
+   // Precision cannot hit 0 for this to work...
+   if ( ((aValue < 0.0) && (size < 8)) ||
+        ((aValue >= 0.0) && (size < 7)) )
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfCommon::convertToScientificString DEBUG:"
+            << "\nsize range error!"
+            << std::endl;
+      }
+      return ossimString();
+   }
+
+   //--
+   // Set the precision to account for size with 1.xxxxxE+01
+   //---
+   ossim_uint32 precision = size - 6;
+   
+   if (aValue < 0.0)
+   {
+      --precision;
+   }
+   
+   std::ostringstream s1;
+   s1 << std::setiosflags(std::ios_base::scientific|std::ios_base::internal)
+      << std::setfill('0')
+      // << setw(size)
+      << std::setprecision(precision)
+      << aValue;
+   
+   ossimString result = s1.str();
+
+   // Upcase the "e".
+   result.upcase();
+   
+   if (traceDebug())
+   {
+      if (result.size() != size)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfCommon::convertToScientificString DEBUG:"
+            << "\nIncorrect output size!"
+            << "\nValue:  " << aValue
+            << "\nString: " << result
+            << std::endl;
+      }
+   }
+   return result;
+}
+
+ossimString ossimNitfCommon::convertToDoubleString(
+   const ossim_float64& aValue,
+   ossim_uint32 precision,
+   ossim_uint32 size)
+{
+   ossim_uint32 width = size;
+   
+   std::ostringstream s1;
+   s1 << std::setiosflags(std::ios_base::fixed|
+                     std::ios_base::internal)
+      << std::setprecision(precision)
+      << std::setfill('0')
+      << std::setw(width)
+      << aValue;
+   
+   ossimString result = s1.str();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfCommon::convertToDoubleString DEBUG:"
+         << "\nresult: " << result << std::endl;
+      
+      if (result.size() != size)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfCommon::convertToDoubleString DEBUG:"
+            << "\nIncorrect output size!"
+            << std::endl;
+      }
+   }
+   return result;
+}
+
+ossimString ossimNitfCommon::convertToUIntString(ossim_uint32 aValue,
+                                                ossim_uint32 size)
+{
+   ossim_uint32 width = size;
+   
+   std::ostringstream s1;
+   s1 << std::setiosflags(std::ios_base::fixed|
+                     std::ios_base::internal)
+      << std::setfill('0')
+      << std::setw(width)
+      << aValue;
+   
+   ossimString result = s1.str();
+
+   if (traceDebug())
+   {
+      if (result.size() != size)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfCommon::convertToUIntString DEBUG:"
+            << "\nIncorrect output size!"
+            << "\nValue:  " << aValue
+            << "\nString: " << result
+            << std::endl;
+      }
+   }
+   return result;   
+}
+
+ossimString ossimNitfCommon::convertToIntString(ossim_int32 aValue,
+                                                ossim_uint32 size)
+{
+   ossim_uint32 width = size;
+   
+   std::ostringstream s1;
+   s1 << std::setiosflags(std::ios_base::fixed|
+                     std::ios_base::internal)
+      << std::setfill('0')
+      << std::setw(width)
+      << aValue;
+   
+   ossimString result = s1.str();
+
+   if (traceDebug())
+   {
+      if (result.size() != size)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfCommon::convertToIntString DEBUG:"
+            << "\nIncorrect output size!"
+            << "\nValue:  " << aValue
+            << "\nString: " << result
+            << std::endl;
+      }
+   }
+   return result;   
+}
+
+ossimString ossimNitfCommon::convertToDdLatLonLocString(const ossimDpt& pt,
+                                                        ossim_uint32 precision)
+{
+   ossimString lat;
+   ossimString lon;
+   ossim_uint32 latSize = precision+4; // size = precision + "-33."
+   ossim_uint32 lonSize = precision+5; // size = precision + "-122."
+   
+   if (pt.y >= 0.0)
+   {
+      lat = "+";
+      --latSize;
+   }
+   if (pt.x >= 0.0)
+   {
+      lon = "+";
+      --lonSize;
+   }
+   lat += convertToDoubleString(pt.y,
+                                precision,
+                                latSize);
+   lon += convertToDoubleString(pt.x,
+                                precision,
+                                lonSize);
+   ossimString result = lat+lon;
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfCommon::convertToDdLatLonLocString DEBUG:"
+         << "\nresult: " << result
+         << std::endl;
+   }
+
+   return result;
+}
+
+void ossimNitfCommon::setField(void* fieldDestination,
+                               const ossimString& src,
+                               std::streamsize width,
+                               std::ios_base::fmtflags ioflags,
+                               char fill)
+{
+   std::ostringstream out;
+   out << std::setw(width)
+       << std::setfill(fill)
+       << std::setiosflags(ioflags)
+       << src.trim().c_str();
+   
+   memcpy(fieldDestination, out.str().c_str(), width);
+}
+
+ossimString ossimNitfCommon::encodeUtm(
+                                       ossim_uint32 zone,
+                                       const ossimDpt& ul,
+                                       const ossimDpt& ur,
+                                       const ossimDpt& lr,
+                                       const ossimDpt& ll)
+{
+   std::ostringstream out;
+   
+   if(zone > 60)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUTM zone greate than 60!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   ossim_float64 east  = ul.x;
+   ossim_float64 north = ul.y;
+   
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   out << std::setw(2)
+   << std::setfill('0')
+   << zone
+   << std::setw(6)
+   << std::setfill('0')
+   <<(ossim_uint32)(east+.5)
+   << std::setw(7)
+   << std::setfill('0')
+   <<(ossim_uint32)(north+.5);
+   
+   
+   east  = ur.x;
+   north = ur.y;
+   
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   out << std::setw(2)
+   << std::setfill('0')
+   << zone
+   << std::setw(6)
+   << std::setfill('0')
+   <<(ossim_uint32)(east+.5)
+   << std::setw(7)
+   << std::setfill('0')
+   <<(ossim_uint32)(north+.5);
+   east  = lr.x;
+   north = lr.y;
+   
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }   
+   
+   out << std::setw(2)
+   << std::setfill('0')
+   << zone
+   << std::setw(6)
+   << std::setfill('0')
+   <<(ossim_uint32)(east+.5)
+   << std::setw(7)
+   << std::setfill('0')
+   <<(ossim_uint32)(north+.5);
+   
+   east  = ll.x;
+   north = ll.y;
+   
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   out << std::setw(2)
+   << std::setfill('0')
+   << zone
+   << std::setw(6)
+   << std::setfill('0')
+   <<(ossim_uint32)(east+.5)
+   << std::setw(7)
+   << std::setfill('0')
+   <<(ossim_uint32)(north+.5);
+   
+   return out.str().c_str();
+}
+
+ossimString ossimNitfCommon::encodeGeographicDms(const ossimDpt& ul,
+                                                 const ossimDpt& ur,
+                                                 const ossimDpt& lr,
+                                                 const ossimDpt& ll)
+{
+   std::ostringstream out;
+   
+   out << ossimDms(ul.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(ul.x, false).toString("dddmmssC").c_str();
+   out << ossimDms(ur.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(ur.x, false).toString("dddmmssC").c_str();
+   out << ossimDms(lr.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(lr.x, false).toString("dddmmssC").c_str();
+   out << ossimDms(ll.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(ll.x, false).toString("dddmmssC").c_str();
+
+   return ossimString(out.str());
+}
+
+ossimString ossimNitfCommon::encodeGeographicDecimalDegrees(const ossimDpt& ul,
+                                                            const ossimDpt& ur,
+                                                            const ossimDpt& lr,
+                                                            const ossimDpt& ll)
+{
+   std::ostringstream out;
+   
+   out << (ul.lat >= 0.0?"+":"")
+   << std::setw(6)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << ul.lat
+   << (ul.lon >= 0.0?"+":"")
+   << std::setw(7)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << ul.lon;
+   out << (ur.lat >= 0.0?"+":"")
+   << std::setw(6)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << ur.lat
+   << (ur.lon >= 0.0?"+":"")
+   << std::setw(7)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << ur.lon;
+   out << (lr.lat >= 0.0?"+":"")
+   << std::setw(6)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << lr.lat
+   << (lr.lon >= 0.0?"+":"")
+   << std::setw(7)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << lr.lon;
+   out << (ll.lat >= 0.0?"+":"")
+   << std::setw(6)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << ll.lat
+   << (ll.lon >= 0.0?"+":"")
+   << std::setw(7)
+   << std::setfill('0')
+   << std::setprecision(3)
+   << std::setiosflags(std::ios::fixed)
+   << ll.lon;
+   
+   return ossimString(out.str());
+}
+
+ossimString ossimNitfCommon::getNitfPixelType(ossimScalarType scalarType)
+{
+   ossimString pixelType;
+   switch(scalarType)
+   {
+      case OSSIM_UINT8:
+      case OSSIM_USHORT11:
+      case OSSIM_USHORT12:
+      case OSSIM_USHORT13:
+      case OSSIM_USHORT14:
+      case OSSIM_USHORT15:
+      case OSSIM_UINT16:
+      case OSSIM_UINT32:
+      {
+         pixelType = "INT";
+         break;
+      }
+      case OSSIM_SINT16:
+      case OSSIM_SINT32:
+      {
+         pixelType    = "SI";
+         break;
+      }
+      case OSSIM_FLOAT:
+      case OSSIM_NORMALIZED_FLOAT:
+      case OSSIM_DOUBLE:
+      case OSSIM_NORMALIZED_DOUBLE:
+      {
+         pixelType    = "R";
+         break;
+      }
+      default:
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << __FILE__ << ":" << __LINE__
+            << "\nUnhandled scalar type:  " << scalarType << std::endl;
+         break;
+      }
+   }
+   return pixelType;
+}
+
+ossimString ossimNitfCommon::getCompressionRate(const ossimIrect& rect,
+                                                ossim_uint32 bands,
+                                                ossimScalarType scalar,
+                                                ossim_uint64 lengthInBytes)
+{
+   ossimString result("");
+   
+   ossim_float64 uncompressedSize =
+      ossim::scalarSizeInBytes(scalar) * rect.width() * rect.height() * bands;
+   ossim_float64 bitsPerPix = ossim::getBitsPerPixel(scalar);
+   ossim_float64 rate = ( bitsPerPix *
+                          (static_cast<ossim_float64>(lengthInBytes) /
+                           uncompressedSize) );
+
+   // Multiply by 100 as there is an implied decimal point.
+   rate *= 100.0;
+
+   // Convert to string with zero precision.
+   ossimString s = ossimString::toString(rate, 0, 4);
+
+   if (s.size())
+   {
+      if (s.size() <= 3)
+      {
+         result = "N";
+         if (s.size() == 3)
+         {
+            result = "0";
+         }
+         else if (s.size() == 2)
+         {
+            result = "00";
+         }
+         result += s;
+      }
+   }
+   return result;
+}
+
diff --git a/src/support_data/ossimNitfCompressionHeader.cpp b/src/support_data/ossimNitfCompressionHeader.cpp
new file mode 100644
index 0000000..1a89c5e
--- /dev/null
+++ b/src/support_data/ossimNitfCompressionHeader.cpp
@@ -0,0 +1,20 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts
+//
+// LICENSE: LGPL see top level LICENSE.txt for more details
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfCompressionHeader.cpp 18413 2010-11-11 19:56:22Z gpotts $
+#include <ossim/support_data/ossimNitfCompressionHeader.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <sstream>
+
+RTTI_DEF1(ossimNitfCompressionHeader, "ossimNitfCompressionHeader", ossimObject);
+
+bool ossimNitfCompressionHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   return ossimObject::saveState(kwl, prefix);
+}
diff --git a/ossim/src/ossim/support_data/ossimNitfCsccgaTag.cpp b/src/support_data/ossimNitfCsccgaTag.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfCsccgaTag.cpp
rename to src/support_data/ossimNitfCsccgaTag.cpp
diff --git a/src/support_data/ossimNitfCscrnaTag.cpp b/src/support_data/ossimNitfCscrnaTag.cpp
new file mode 100644
index 0000000..c92ae86
--- /dev/null
+++ b/src/support_data/ossimNitfCscrnaTag.cpp
@@ -0,0 +1,154 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CSCRNA tag class definition.
+//
+// Corner Footprint TRE.
+//
+// See document STDI-0006-NCDRD Table 3.2-13 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfCscrnaTag.h>
+
+
+RTTI_DEF1(ossimNitfCscrnaTag, "ossimNitfCscrnaTag", ossimNitfRegisteredTag);
+
+ossimNitfCscrnaTag::ossimNitfCscrnaTag()
+   : ossimNitfRegisteredTag(std::string("CSCRNA"), 109)
+{
+   clearFields();
+}
+
+ossimNitfCscrnaTag::~ossimNitfCscrnaTag()
+{
+}
+
+void ossimNitfCscrnaTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(thePredictedCornerFlag, 1);
+
+   in.read(theUlLat, 9);
+   in.read(theUlLon, 10);
+   in.read(theUlHt, 8);
+
+   in.read(theUrLat, 9);
+   in.read(theUrLon, 10);
+   in.read(theUrHt, 8);
+
+   in.read(theLrLat, 9);
+   in.read(theLrLon, 10);
+   in.read(theLrHt, 8);
+
+   in.read(theLlLat, 9);
+   in.read(theLlLon, 10);
+   in.read(theLlHt, 8);
+}
+
+void ossimNitfCscrnaTag::writeStream(std::ostream& out)
+{
+   out.write(thePredictedCornerFlag, 1);
+
+   out.write(theUlLat, 9);
+   out.write(theUlLon, 10);
+   out.write(theUlHt, 8);
+
+   out.write(theUrLat, 9);
+   out.write(theUrLon, 10);
+   out.write(theUrHt, 8);
+
+   out.write(theLrLat, 9);
+   out.write(theLrLon, 10);
+   out.write(theLrHt, 8);
+
+   out.write(theLlLat, 9);
+   out.write(theLlLon, 10);
+   out.write(theLlHt, 8);
+}
+
+void ossimNitfCscrnaTag::clearFields()
+{
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+   memset(thePredictedCornerFlag, ' ', 1);
+   
+   memset(theUlLat, 0, 9);
+   memset(theUlLon, 0, 10);
+   memset(theUlHt, 0, 8);
+
+   memset(theUrLat, 0, 9);
+   memset(theUrLon, 0, 10);
+   memset(theUrHt, 0, 8);
+
+   memset(theLrLat, 0, 9);
+   memset(theLrLon, 0, 10);
+   memset(theLrHt, 0, 8);
+
+   memset(theLlLat, 0, 9);
+   memset(theLlLon, 0, 10);
+   memset(theLlHt, 0, 8);
+
+   thePredictedCornerFlag[1] = '\0';
+   
+   theUlLat[9] = '\0';
+   theUlLon[10] = '\0';
+   theUlHt[8] = '\0';
+
+   theUrLat[9] = '\0';
+   theUrLon[10] = '\0';
+   theUrHt[8] = '\0';
+
+   theLrLat[9] = '\0';
+   theLrLon[10] = '\0';
+   theLrHt[8] = '\0';
+
+   theLlLat[9] = '\0';
+   theLlLon[10] = '\0';
+   theLlHt[8] = '\0';
+}
+
+std::ostream& ossimNitfCscrnaTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+      
+       << pfx << std::setw(24) << "PREDICT_CORNERS:"
+       << thePredictedCornerFlag << "\n"
+      
+       << pfx << std::setw(24) << "ULCRN_LAT:" << theUlLat << "\n"
+       << pfx << std::setw(24) << "ULCRN_LON:" << theUlLon << "\n"
+       << pfx << std::setw(24) << "ULCRN_HT:" << theUlHt << "\n"
+
+       << pfx << std::setw(24) << "URCRN_LAT:" << theUrLat << "\n"
+       << pfx << std::setw(24) << "URCRN_LON:" << theUrLon << "\n"
+       << pfx << std::setw(24) << "URCRN_HT:" << theUrHt << "\n"
+   
+       << pfx << std::setw(24) << "LRCRN_LAT:" << theLrLat << "\n"
+       << pfx << std::setw(24) << "LRCRN_LON:" << theLrLon << "\n"
+       << pfx << std::setw(24) << "LRCRN_HT:" << theLrHt << "\n"
+      
+       << pfx << std::setw(24) << "LLCRN_LAT:" << theLlLat << "\n"
+       << pfx << std::setw(24) << "LLCRN_LON:" << theLlLon << "\n"
+       << pfx << std::setw(24) << "LLCRN_HT:" << theLlHt << "\n";
+
+      return out;
+}
diff --git a/src/support_data/ossimNitfCsdidaTag.cpp b/src/support_data/ossimNitfCsdidaTag.cpp
new file mode 100644
index 0000000..eba286d
--- /dev/null
+++ b/src/support_data/ossimNitfCsdidaTag.cpp
@@ -0,0 +1,149 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CSDIDA tag class definition.
+//
+// Dataset Indentification TRE.
+//
+// See document STDI-0006-NCDRD Table 3.3-14 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfCsdidaTag.h>
+
+
+RTTI_DEF1(ossimNitfCsdidaTag, "ossimNitfCsdidaTag", ossimNitfRegisteredTag);
+
+ossimNitfCsdidaTag::ossimNitfCsdidaTag()
+   : ossimNitfRegisteredTag(std::string("CSDIDA"), 70)
+{
+   clearFields();
+}
+
+ossimNitfCsdidaTag::~ossimNitfCsdidaTag()
+{
+}
+
+void ossimNitfCsdidaTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(theDay, 2);
+   in.read(theMonth, 3);
+   in.read(theYear, 4);
+   in.read(thePlatformCode, 2);
+   in.read(theVehicleId, 2);
+   in.read(thePass, 2);
+   in.read(theOperation, 3);
+   in.read(theSensorId, 2);
+   in.read(theProductId, 2);
+   in.read(theReservedField1, 4);
+   in.read(theTime, 14);
+   in.read(theProcessTime, 14);
+   in.read(theReservedField2, 2);
+   in.read(theReservedField3, 2);
+   in.read(theReservedField4, 1);
+   in.read(theReservedField5, 1);
+   in.read(theSoftwareVersionNumber, 10);
+}
+
+void ossimNitfCsdidaTag::writeStream(std::ostream& out)
+{
+   out.write(theDay, 2);
+   out.write(theMonth, 3);
+   out.write(theYear, 4);
+   out.write(thePlatformCode, 2);
+   out.write(theVehicleId, 2);
+   out.write(thePass, 2);
+   out.write(theOperation, 3);
+   out.write(theSensorId, 2);
+   out.write(theProductId, 2);
+   out.write(theReservedField1, 4);
+   out.write(theTime, 14);
+   out.write(theProcessTime, 14);
+   out.write(theReservedField2, 2);
+   out.write(theReservedField3, 2);
+   out.write(theReservedField4, 1);
+   out.write(theReservedField5, 1);
+   out.write(theSoftwareVersionNumber, 10);
+}
+
+void ossimNitfCsdidaTag::clearFields()
+{
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+   
+   memset(theDay, '0', 2);
+   memset(theMonth, ' ', 3);
+   memset(theYear, '0', 4);
+   memset(thePlatformCode, ' ', 2);
+   memset(theVehicleId, '0', 2);
+   memset(thePass, '0', 2);
+   memset(theOperation, '0', 3);
+   memset(theSensorId, ' ', 2);
+   memset(theProductId, ' ', 2);
+   memcpy(theReservedField1, "00  ", 4);
+   memset(theTime, '0', 14);
+   memset(theProcessTime, '0', 14);
+   memcpy(theReservedField2, "00", 2);
+   memcpy(theReservedField3, "01", 2);
+   memcpy(theReservedField4, "N", 1);
+   memcpy(theReservedField5, "N", 1);
+   memset(theSoftwareVersionNumber, ' ', 10);
+
+   theDay[2] = '\0';
+   theMonth[3] = '\0';
+   theYear[4] = '\0';
+   thePlatformCode[2] = '\0';
+   theVehicleId[2] = '\0';
+   thePass[2] = '\0';
+   theOperation[3] = '\0';
+   theSensorId[2] = '\0';
+   theProductId[2] = '\0';
+   theReservedField1[4] = '\0';
+   theTime[14] = '\0';
+   theProcessTime[14] = '\0';
+   theReservedField2[2] = '\0';
+   theReservedField3[2] = '\0';
+   theReservedField4[0] = '\0';
+   theReservedField5[0] = '\0';
+   theSoftwareVersionNumber[10] = '\0';
+}
+
+std::ostream& ossimNitfCsdidaTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "DAY:" << theDay << "\n"
+       << pfx << std::setw(24) << "MONTH:" << theMonth << "\n"
+       << pfx << std::setw(24) << "YEAR:" << theYear << "\n"
+       << pfx << std::setw(24) << "PLATFORM_CODE:" << thePlatformCode << "\n"
+       << pfx << std::setw(24) << "VEHICLE_ID:" << theVehicleId << "\n"
+       << pfx << std::setw(24) << "PASS:" << thePass << "\n"
+       << pfx << std::setw(24) << "OPERATION:" << theOperation << "\n"
+       << pfx << std::setw(24) << "SENSOR_ID:" << theSensorId << "\n"
+       << pfx << std::setw(24) << "PRODUCT_ID:" << theProductId << "\n"
+       << pfx << std::setw(24) << "TIME:" << theTime << "\n"
+       << pfx << std::setw(24) << "PROCESS_TIME:" << theProcessTime << "\n"
+       << pfx << std::setw(24) << "SOFTWARE_VERSION_NUMBER:"
+       << theSoftwareVersionNumber << "\n";
+   
+   return out;
+}
diff --git a/src/support_data/ossimNitfCsexraTag.cpp b/src/support_data/ossimNitfCsexraTag.cpp
new file mode 100644
index 0000000..bb2b24f
--- /dev/null
+++ b/src/support_data/ossimNitfCsexraTag.cpp
@@ -0,0 +1,337 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: CSEXRA tag class definition.
+//
+// Exploitation Reference Data TRE.
+//
+// See document STDI-0006-NCDRD Table 3.5-16 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfCsexraTag.h>
+
+
+RTTI_DEF1(ossimNitfCsexraTag, "ossimNitfCsexraTag", ossimNitfRegisteredTag);
+
+ossimNitfCsexraTag::ossimNitfCsexraTag()
+   : ossimNitfRegisteredTag(std::string("CSEXRA"), 132)
+{
+   clearFields();
+}
+
+ossimNitfCsexraTag::~ossimNitfCsexraTag()
+{
+}
+
+void ossimNitfCsexraTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(theSensor, 6);
+   in.read(theTileFirstLine, 12);
+   in.read(theImageTimeDuration, 12);
+   in.read(theMaxGsd, 5);
+   in.read(theAlongScanGsd, 5);
+   in.read(theCrossScanGsd, 5);
+   in.read(theGeoMeanGsd, 5);
+   in.read(theAlongScanVertGsd, 5);
+   in.read(theCrossScanVertGsd, 5);
+   in.read(theGeoMeanVertGsd, 5);
+   in.read(theGeoBetaAngle, 5);
+   in.read(theDynamicRange, 5);
+   in.read(theLine, 7);
+   in.read(theSamples, 5);
+   in.read(theAngleToNorth, 7);
+   in.read(theObliquityAngle, 6);
+   in.read(theAzOfObliquity, 7);
+   in.read(theGrdCover, 1);
+   in.read(theSnowDepthCategory, 1);
+   in.read(theSunAzimuth, 7);
+   in.read(theSunElevation, 7);
+   in.read(thePredictedNiirs, 3);
+   in.read(theCircularError, 3);
+   in.read(theLinearError, 3);
+}
+
+void ossimNitfCsexraTag::writeStream(std::ostream& out)
+{
+   out.write(theSensor, 6);
+   out.write(theTileFirstLine, 12);
+   out.write(theImageTimeDuration, 12);
+   out.write(theMaxGsd, 5);
+   out.write(theAlongScanGsd, 5);
+   out.write(theCrossScanGsd, 5);
+   out.write(theGeoMeanGsd, 5);
+   out.write(theAlongScanVertGsd, 5);
+   out.write(theCrossScanVertGsd, 5);
+   out.write(theGeoMeanVertGsd, 5);
+   out.write(theGeoBetaAngle, 5);
+   out.write(theDynamicRange, 5);
+   out.write(theLine, 7);
+   out.write(theSamples, 5);
+   out.write(theAngleToNorth, 7);
+   out.write(theObliquityAngle, 6);
+   out.write(theAzOfObliquity, 7);
+   out.write(theGrdCover, 1);
+   out.write(theSnowDepthCategory, 1);
+   out.write(theSunAzimuth, 7);
+   out.write(theSunElevation, 7);
+   out.write(thePredictedNiirs, 3);
+   out.write(theCircularError, 3);
+   out.write(theLinearError, 3);
+}
+
+void ossimNitfCsexraTag::clearFields()
+{
+   //---
+   // No attempt made to set to defaults.
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+   //---
+
+   memset(theSensor, ' ',  6);
+   memset(theTileFirstLine, 0, 12);
+   memset(theImageTimeDuration, 0, 12);
+   memset(theMaxGsd, 0, 5);
+   memset(theAlongScanGsd, ' ', 5);
+   memset(theCrossScanGsd, ' ', 5);
+   memset(theGeoMeanGsd, ' ', 5);
+   memset(theAlongScanVertGsd, ' ', 5);
+   memset(theCrossScanVertGsd, ' ', 5);
+   memset(theGeoMeanVertGsd, ' ', 5);
+   memset(theGeoBetaAngle, ' ', 5);
+   memset(theDynamicRange, 0, 5);
+   memset(theLine, 0, 7);
+   memset(theSamples, 0, 5);
+   memset(theAngleToNorth, 0, 7);
+   memset(theObliquityAngle, 0, 6);
+   memset(theAzOfObliquity, 0, 7);
+   memset(theGrdCover, 0, 1);
+   memset(theSnowDepthCategory, 0, 1);
+   memset(theSunAzimuth, 0, 7);
+   memset(theSunElevation, 0, 7);
+   memset(thePredictedNiirs, ' ', 3);
+   memset(theCircularError, 0, 3);
+   memset(theLinearError, 0, 3);
+
+   theSensor[6] = '\0';
+   theTileFirstLine[12] = '\0';
+   theImageTimeDuration[12] = '\0';
+   theMaxGsd[5] = '\0';
+   theAlongScanGsd[5] = '\0';
+   theCrossScanGsd[5] = '\0';
+   theGeoMeanGsd[5] = '\0';
+   theAlongScanVertGsd[5] = '\0';
+   theCrossScanVertGsd[5] = '\0';
+   theGeoMeanVertGsd[5] = '\0';
+   theGeoBetaAngle[5] = '\0';
+   theDynamicRange[5] = '\0';
+   theLine[7] = '\0';
+   theSamples[5] = '\0';
+   theAngleToNorth[7] = '\0';
+   theObliquityAngle[6] = '\0';
+   theAzOfObliquity[7] = '\0';
+   theGrdCover[1] = '\0';
+   theSnowDepthCategory[1] = '\0';
+   theSunAzimuth[7] = '\0';
+   theSunElevation[7] = '\0';
+   thePredictedNiirs[3] = '\0';
+   theCircularError[3] = '\0';
+   theLinearError[3] = '\0';
+   
+}
+
+std::ostream& ossimNitfCsexraTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"
+       << getTagLength() << "\n"
+       << pfx << std::setw(24) << "SENSOR:"
+       << theSensor << "\n"
+       << pfx << std::setw(24) << "TIME_FIRST_LINE_IMAGE:"
+       << theTileFirstLine << "\n"
+       << pfx << std::setw(24) << "TIME_IMAGE_DURATION:"
+       << theImageTimeDuration << "\n"
+       << pfx << std::setw(24) << "MAX_GSD:"
+       << theMaxGsd << "\n"
+       << pfx << std::setw(24) << "ALONG_SCAN_GSD:"
+       << theAlongScanGsd << "\n"
+       << pfx << std::setw(24) << "CROSS_SCAN_GSD:"
+       << theCrossScanGsd << "\n"
+       << pfx << std::setw(24) << "GEO_MEAN_GSD:"
+       << theGeoMeanGsd << "\n"
+       << pfx << std::setw(24) << "A_S_VERT_GSD:"
+       << theAlongScanVertGsd << "\n"
+       << pfx << std::setw(24) << "C_S_VERT_GSD:"
+       << theCrossScanVertGsd << "\n"
+       << pfx << std::setw(24) << "GEO_MEAN_VERT_GSD:"
+       << theGeoMeanVertGsd << "\n"
+       << pfx << std::setw(24) << "GEO_BETA_ANGLE:"
+       << theGeoBetaAngle << "\n"
+       << pfx << std::setw(24) << "DYNAMIC_RANGE:"
+       << theDynamicRange << "\n"
+       << pfx << std::setw(24) << "NUM_LINES:"
+       << theLine << "\n"
+       << pfx << std::setw(24) << "NUM_SAMPLES:"
+       << theSamples << "\n"
+       << pfx << std::setw(24) << "ANGLE_TO_NORTH:"
+       << theAngleToNorth << "\n"
+       << pfx << std::setw(24) << "OBLIQUITY_ANGLE:"
+       << theObliquityAngle << "\n"
+       << pfx << std::setw(24) << "AZ_OF_OBLIQUITY:"
+       << theAzOfObliquity << "\n"
+       << pfx << std::setw(24) << "GRD_COVER:"
+       << theGrdCover << "\n"
+       << pfx << std::setw(24) << "SNOW_DEPTH_CAT:"
+       << theSnowDepthCategory << "\n"
+       << pfx << std::setw(24) << "SUN_AZIMUTH:"
+       << theSunAzimuth << "\n"
+       << pfx << std::setw(24) << "SUN_ELEVATION:"
+       << theSunElevation << "\n"
+       << pfx << std::setw(24) << "PREDICTED_NIIRS:"
+       << thePredictedNiirs << "\n"
+       << pfx << std::setw(24) << "CIRCL_ERR:"
+       << theCircularError << "\n"
+       << pfx << std::setw(24) << "LINEAR_ERR:"
+       << theLinearError<< "\n";
+   
+   return out;
+}
+
+ossimString ossimNitfCsexraTag::getSensor() const
+{
+   return ossimString(theSensor);
+}
+   
+ossimString ossimNitfCsexraTag::getTimeFirstLineImage() const
+{
+   return ossimString(theTileFirstLine);
+}
+   
+ossimString ossimNitfCsexraTag::getTimeImageDuration() const
+{
+   return ossimString(theImageTimeDuration);
+}
+   
+ossimString ossimNitfCsexraTag::getMaxGsd() const
+{
+   return ossimString(theMaxGsd);
+}
+   
+ossimString ossimNitfCsexraTag::getAlongScanGsd() const
+{
+   return ossimString(theAlongScanGsd);
+}
+   
+ossimString ossimNitfCsexraTag::getCrossScanGsd() const
+{
+   return ossimString(theCrossScanGsd);
+}
+   
+ossimString ossimNitfCsexraTag::getGeoMeanGsd() const
+{
+   return ossimString(theGeoMeanGsd);
+}
+   
+ossimString ossimNitfCsexraTag::getAlongScanVerticalGsd() const
+{
+   return ossimString(theAlongScanVertGsd);
+}
+   
+ossimString ossimNitfCsexraTag::getCrossScanVerticalGsd() const
+{
+   return ossimString(theCrossScanVertGsd);
+}
+
+ossimString ossimNitfCsexraTag::getGeoMeanVerticalGsd() const
+{
+   return ossimString(theGeoMeanVertGsd);
+}
+
+ossimString ossimNitfCsexraTag::getGeoBetaAngle() const
+{
+   return ossimString(theGeoBetaAngle);
+}
+
+ossimString ossimNitfCsexraTag::getDynamicRange() const
+{
+   return ossimString(theDynamicRange);
+}
+   
+ossimString ossimNitfCsexraTag::getNumLines() const
+{
+   return ossimString(theLine);
+}
+   
+ossimString ossimNitfCsexraTag::getNumSamples() const
+{
+   return ossimString(theSamples);
+}
+   
+ossimString ossimNitfCsexraTag::getAngleToNorth() const
+{
+   return ossimString(theAngleToNorth);
+}
+
+ossimString ossimNitfCsexraTag::getObliquityAngle() const
+{
+   return ossimString(theObliquityAngle);
+}
+
+ossimString ossimNitfCsexraTag::getAzimuthOfObliquity() const
+{
+   return ossimString(theAzOfObliquity);
+}
+   
+ossimString ossimNitfCsexraTag::getGroundCover() const
+{
+   return ossimString(theGrdCover);
+}
+
+ossimString ossimNitfCsexraTag::getSnowDepth() const
+{
+   return ossimString(theSnowDepthCategory);
+}
+   
+ossimString ossimNitfCsexraTag::getSunAzimuth() const
+{
+   return ossimString(theSunAzimuth);
+}
+
+ossimString ossimNitfCsexraTag::getSunElevation() const
+{
+   return ossimString(theSunElevation);
+}
+
+ossimString ossimNitfCsexraTag::getPredictedNiirs() const
+{
+   return ossimString(thePredictedNiirs);
+}
+   
+ossimString ossimNitfCsexraTag::getCE90() const
+{
+   return ossimString(theCircularError);
+}
+
+ossimString ossimNitfCsexraTag::getLE90() const
+{
+   return ossimString(theLinearError);
+}
diff --git a/src/support_data/ossimNitfCsproaTag.cpp b/src/support_data/ossimNitfCsproaTag.cpp
new file mode 100644
index 0000000..352601f
--- /dev/null
+++ b/src/support_data/ossimNitfCsproaTag.cpp
@@ -0,0 +1,94 @@
+#include <ossim/support_data/ossimNitfCsproaTag.h>
+#include <iomanip>
+#include <iostream>
+
+ossimNitfCsproaTag::ossimNitfCsproaTag()
+   : ossimNitfRegisteredTag(std::string("CSPROA"), 120)
+{
+   clearFields();
+}
+
+void ossimNitfCsproaTag::parseStream(std::istream& in)
+{
+   in.read(m_reserved1, RESERVE1_SIZE);
+   in.read(m_reserved2, RESERVE2_SIZE);
+   in.read(m_reserved3, RESERVE3_SIZE);
+   in.read(m_reserved4, RESERVE4_SIZE);
+   in.read(m_reserved5, RESERVE5_SIZE);
+   in.read(m_reserved6, RESERVE6_SIZE);
+   in.read(m_reserved7, RESERVE7_SIZE);
+   in.read(m_reserved8, RESERVE8_SIZE);
+   in.read(m_reserved9, RESERVE9_SIZE);
+   in.read(m_bwc, BWC_SIZE);
+}
+
+void ossimNitfCsproaTag::writeStream(std::ostream& out)
+{
+   out.write(m_reserved1, RESERVE1_SIZE);
+   out.write(m_reserved2, RESERVE2_SIZE);
+   out.write(m_reserved3, RESERVE3_SIZE);
+   out.write(m_reserved4, RESERVE4_SIZE);
+   out.write(m_reserved5, RESERVE5_SIZE);
+   out.write(m_reserved6, RESERVE6_SIZE);
+   out.write(m_reserved7, RESERVE7_SIZE);
+   out.write(m_reserved8, RESERVE8_SIZE);
+   out.write(m_reserved9, RESERVE9_SIZE);
+   out.write(m_bwc, BWC_SIZE);
+}
+
+std::ostream& ossimNitfCsproaTag::print(std::ostream& out,
+                            const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   out << setiosflags(ios::left)
+       << pfx << std::setw(24) << "CETAG:"      << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"        << getTagLength() << "\n"
+       << pfx << std::setw(24) << "RESERVED1:"   << m_reserved1 << "\n"
+       << pfx << std::setw(24) << "RESERVED2:"   << m_reserved2 << "\n"
+       << pfx << std::setw(24) << "RESERVED3:"   << m_reserved3 << "\n"
+       << pfx << std::setw(24) << "RESERVED4:"   << m_reserved4 << "\n"
+       << pfx << std::setw(24) << "RESERVED5:"   << m_reserved5 << "\n"
+       << pfx << std::setw(24) << "RESERVED6:"   << m_reserved6 << "\n"
+       << pfx << std::setw(24) << "RESERVED7:"   << m_reserved7 << "\n"
+       << pfx << std::setw(24) << "RESERVED8:"   << m_reserved8 << "\n"
+       << pfx << std::setw(24) << "RESERVED9:"   << m_reserved9 << "\n"
+       << pfx << std::setw(24) << "BWC:"   << m_bwc << "\n";
+
+    return out;   
+}
+
+void ossimNitfCsproaTag::clearFields()
+{
+   memset(m_reserved1, ' ', RESERVE1_SIZE);
+   memset(m_reserved2, ' ', RESERVE2_SIZE);
+   memset(m_reserved3, ' ', RESERVE3_SIZE);
+   memset(m_reserved4, ' ', RESERVE4_SIZE);
+   memset(m_reserved5, ' ', RESERVE5_SIZE);
+   memset(m_reserved6, ' ', RESERVE6_SIZE);
+   memset(m_reserved7, ' ', RESERVE7_SIZE);
+   memset(m_reserved8, ' ', RESERVE8_SIZE);
+   memset(m_reserved9, ' ', RESERVE9_SIZE);
+   memset(m_bwc, ' ', BWC_SIZE);
+
+   char reserve1[]="LATESTCAL";
+   memcpy(m_reserved1, reserve1, 9);
+   char reserve4[] = "MARKANDFIX";
+   memcpy(m_reserved4, reserve4, 10);
+   char reserve7[] = "SKIPAGM";
+   memcpy(m_reserved7, reserve7, 7);
+   char reserve8[] = "INTERP";
+   memcpy(m_reserved8, reserve8, 6);
+
+   m_reserved1[RESERVE1_SIZE] = '\0';
+   m_reserved2[RESERVE2_SIZE] = '\0';
+   m_reserved3[RESERVE3_SIZE] = '\0';
+   m_reserved4[RESERVE4_SIZE] = '\0';
+   m_reserved5[RESERVE5_SIZE] = '\0';
+   m_reserved6[RESERVE6_SIZE] = '\0';
+   m_reserved7[RESERVE7_SIZE] = '\0';
+   m_reserved8[RESERVE8_SIZE] = '\0';
+   m_reserved9[RESERVE9_SIZE] = '\0';
+   m_bwc[BWC_SIZE] = '\0';
+}
diff --git a/ossim/src/ossim/support_data/ossimNitfDataExtensionSegment.cpp b/src/support_data/ossimNitfDataExtensionSegment.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfDataExtensionSegment.cpp
rename to src/support_data/ossimNitfDataExtensionSegment.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfDataExtensionSegmentV2_0.cpp b/src/support_data/ossimNitfDataExtensionSegmentV2_0.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfDataExtensionSegmentV2_0.cpp
rename to src/support_data/ossimNitfDataExtensionSegmentV2_0.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfDataExtensionSegmentV2_1.cpp b/src/support_data/ossimNitfDataExtensionSegmentV2_1.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfDataExtensionSegmentV2_1.cpp
rename to src/support_data/ossimNitfDataExtensionSegmentV2_1.cpp
diff --git a/src/support_data/ossimNitfDesFactory.cpp b/src/support_data/ossimNitfDesFactory.cpp
new file mode 100644
index 0000000..ed41589
--- /dev/null
+++ b/src/support_data/ossimNitfDesFactory.cpp
@@ -0,0 +1,23 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfDesFactory.cpp 9094 2006-06-13 19:12:40Z dburken $
+#include <ossim/support_data/ossimNitfDesFactory.h>
+
+RTTI_DEF1(ossimNitfDesFactory, "ossimNitfDesFactory", ossimObject)
+
+ossimNitfDesFactory::~ossimNitfDesFactory()
+{
+}
+
+ossimNitfDesFactory::ossimNitfDesFactory()
+{
+}
+
diff --git a/src/support_data/ossimNitfDesFactoryRegistry.cpp b/src/support_data/ossimNitfDesFactoryRegistry.cpp
new file mode 100644
index 0000000..3fbc4dd
--- /dev/null
+++ b/src/support_data/ossimNitfDesFactoryRegistry.cpp
@@ -0,0 +1,99 @@
+//*******************************************************************
+//
+// LICENSE: See top level LICENSE.txt file.
+//
+// Author: 
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfDesFactoryRegistry.cpp 22875 2014-08-27 13:52:03Z dburken $
+
+#include <ossim/support_data/ossimNitfDesFactoryRegistry.h>
+#include <ossim/support_data/ossimNitfRegisteredDesFactory.h>
+
+#include <algorithm> /* for std::find */
+
+ossimNitfDesFactoryRegistry::ossimNitfDesFactoryRegistry()
+{
+   initializeDefaults();
+}
+
+ossimNitfDesFactoryRegistry::~ossimNitfDesFactoryRegistry()
+{
+}
+
+void ossimNitfDesFactoryRegistry::registerFactory(ossimNitfDesFactory* aFactory)
+{
+   if(aFactory&&!exists(aFactory))
+   {
+      theFactoryList.push_back(aFactory);
+   }
+}
+
+void ossimNitfDesFactoryRegistry::unregisterFactory
+(ossimNitfDesFactory* aFactory)
+{
+   std::vector<ossimNitfDesFactory*>::iterator iter =
+      std::find(theFactoryList.begin(),
+                theFactoryList.end(),
+                aFactory);
+   if(iter != theFactoryList.end())
+   {
+      theFactoryList.erase(iter);
+   }
+}
+
+ossimNitfDesFactoryRegistry* ossimNitfDesFactoryRegistry::instance()
+{
+   static ossimNitfDesFactoryRegistry inst;
+   return &inst;
+}
+
+ossimRefPtr<ossimNitfRegisteredDes> ossimNitfDesFactoryRegistry::create(const ossimString &desName)const
+{
+   std::vector<ossimNitfDesFactory*>::const_iterator factory;
+   ossimRefPtr<ossimNitfRegisteredDes> result = 0;
+
+   factory = theFactoryList.begin();
+   while(factory != theFactoryList.end())
+   {
+      result = (*factory)->create(desName);
+
+      if(result.valid())
+      {
+         return result;
+      }
+      ++factory;
+   }
+   
+   return result;
+   //ossimRefPtr<ossimNitfRegisteredDes> des = new ossimNitfUnknownDes;
+   //return des;
+}
+
+void ossimNitfDesFactoryRegistry::initializeDefaults()
+{
+   theFactoryList.push_back(ossimNitfRegisteredDesFactory::instance());
+}
+
+bool ossimNitfDesFactoryRegistry::exists(ossimNitfDesFactory* factory)const
+{
+   std::vector<ossimNitfDesFactory*>::const_iterator iter = std::find(theFactoryList.begin(),
+                                                                      theFactoryList.end(),
+                                                                      factory);
+
+   return (iter != theFactoryList.end());
+   
+}
+
+ossimNitfDesFactoryRegistry::ossimNitfDesFactoryRegistry(
+   const ossimNitfDesFactoryRegistry&)
+{
+}
+
+const ossimNitfDesFactoryRegistry& ossimNitfDesFactoryRegistry::operator=(
+   const ossimNitfDesFactoryRegistry&)
+{
+   return *this;
+}
diff --git a/src/support_data/ossimNitfDesInformation.cpp b/src/support_data/ossimNitfDesInformation.cpp
new file mode 100644
index 0000000..205d733
--- /dev/null
+++ b/src/support_data/ossimNitfDesInformation.cpp
@@ -0,0 +1,325 @@
+//*******************************************************************
+//
+// LICENSE: LGPL  see top level LICENSE.txt
+//
+// Author:
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfDesInformation.cpp 23569 2015-10-05 19:32:00Z dburken $
+
+#include <ossim/support_data/ossimNitfDesInformation.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimNitfDesFactoryRegistry.h>
+#include <ossim/base/ossimPreferences.h>
+#include <sstream>
+#include <iomanip>
+#include <cstring> // for memset
+
+ossimNitfDesInformation::ossimNitfDesInformation(ossimRefPtr<ossimNitfRegisteredDes> desData)
+{
+   clearFields();
+   setDesData(desData);
+}
+
+ossimNitfDesInformation::~ossimNitfDesInformation()
+{
+}
+
+void ossimNitfDesInformation::parseStream(std::istream &in, ossim_uint64 dataLength)
+{
+   if(in)
+   {
+      clearFields();
+      m_desOffset = in.tellg();
+      in.read(m_de, DE_SIZE);
+      in.read(m_desid, DESID_SIZE);
+      in.read(m_desver, DESVER_SIZE);
+      in.read(m_declas, DECLAS_SIZE);
+      in.read(m_desclsy, DESCLSY_SIZE);
+      in.read(m_descode, DESCODE_SIZE);
+      in.read(m_desctlh, DESCTLH_SIZE);
+      in.read(m_desrel, DESREL_SIZE);
+      in.read(m_desdctp, DESDCTP_SIZE);
+      in.read(m_desdcdt, DESDCDT_SIZE);
+      in.read(m_desdcxm, DESDCXM_SIZE);
+      in.read(m_desdg, DESDG_SIZE);
+      in.read(m_desdgdt, DESDGDT_SIZE);
+      in.read(m_descltx, DESCLTX_SIZE);
+      in.read(m_descatp, DESCATP_SIZE);
+      in.read(m_descaut, DESCAUT_SIZE);
+      in.read(m_descrsn, DESCRSN_SIZE);
+      in.read(m_dessrdt, DESSRDT_SIZE);
+      in.read(m_desctln, DESCTLN_SIZE);
+      if (getDesId() == "TRE_OVERFLOW")
+      {
+        in.read(m_desoflw, DESOFLW_SIZE);
+        in.read(m_desitem, DESITEM_SIZE);
+      }
+      in.read(m_desshl, DESSHL_SIZE);
+
+      m_desDataOffset = in.tellg();
+
+      m_desData = ossimNitfDesFactoryRegistry::instance()->create(getDesId());
+
+      if (m_desData.valid())
+      {
+	 /*
+         if (m_desData->getClassName() == "ossimNitfUnknownDes")
+         {
+            // Unknown des doesn't know his des name yet.
+            m_desData->setDesName( getDesId() );
+         }
+	 */
+
+         //---
+         // Dess with dynamic des length construct with 0 length.
+         // Set if 0.
+         //---
+         if ( m_desData->getDesLength() == 0 )
+         {
+            m_desData->setDesLength( dataLength );
+         }
+         // Sanity check fixed length in code with length from CEL field:
+         else if ( m_desData->getDesLength() != getDesLength() )
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimNitfDesInformation::parseStream WARNING!"
+               << "\nCEL field length does not match fixed des length for des: "
+               << m_desData->getDesName().c_str()
+               << "\nCEL: " << getDesLength()
+               << "\nDes: " << m_desData->getDesLength()
+               << std::endl;
+         }
+                               
+         m_desData->parseStream(in);
+      }
+      else
+      {
+         m_desData = (ossimNitfRegisteredDes*)NULL;
+      }
+   }
+}
+
+void ossimNitfDesInformation::writeStream(std::ostream &out)
+{
+   m_desOffset = out.tellp(); // Capture the offset.
+
+   out.write(m_de, DE_SIZE);
+   out.write(m_desid, DESID_SIZE);
+   out.write(m_desver, DESVER_SIZE);
+   out.write(m_declas, DECLAS_SIZE);
+   out.write(m_desclsy, DESCLSY_SIZE);
+   out.write(m_descode, DESCODE_SIZE);
+   out.write(m_desctlh, DESCTLH_SIZE);
+   out.write(m_desrel, DESREL_SIZE);
+   out.write(m_desdctp, DESDCTP_SIZE);
+   out.write(m_desdcdt, DESDCDT_SIZE);
+   out.write(m_desdcxm, DESDCXM_SIZE);
+   out.write(m_desdg, DESDG_SIZE);
+   out.write(m_desdgdt, DESDGDT_SIZE);
+   out.write(m_descltx, DESCLTX_SIZE);
+   out.write(m_descatp, DESCATP_SIZE);
+   out.write(m_descaut, DESCAUT_SIZE);
+   out.write(m_descrsn, DESCRSN_SIZE);
+   out.write(m_dessrdt, DESSRDT_SIZE);
+   out.write(m_desctln, DESCTLN_SIZE);
+   if (getDesId() == "TRE_OVERFLOW")
+   {
+     out.write(m_desoflw, DESOFLW_SIZE);
+     out.write(m_desitem, DESITEM_SIZE);
+   }
+   out.write(m_desshl, DESSHL_SIZE);
+
+
+   //out.write(m_desLength, 5);
+   /*
+   if(m_desData.valid())
+   {
+      m_desData = out.tellp();
+      m_desData->writeStream(out);
+   }
+   */
+}
+
+ossim_uint32 ossimNitfDesInformation::getTotalDesLength()const
+{
+   return (getDesLength() + (ossim_uint32)11);
+}
+
+ossim_uint32 ossimNitfDesInformation::getDesLength()const
+{
+   return ossimString(m_desLength).toUInt32();
+}
+
+ossim_uint64 ossimNitfDesInformation::getDesOffset()const
+{
+   return m_desOffset;
+}
+
+ossim_uint64 ossimNitfDesInformation::getDesDataOffset()const
+{
+   return m_desDataOffset;
+}
+
+ossimString ossimNitfDesInformation::getDesId()const
+{
+   return ossimString(m_desid).trim();
+}
+
+std::ostream& ossimNitfDesInformation::print(std::ostream& out, const std::string& prefix)const
+{
+   bool typeinfo = ossimString(ossimPreferences::instance()->findPreference("kwl_type_info")).toBool();
+
+   std::string pfx = prefix + getDesId() + ".";
+
+   out << setiosflags(ios::left)
+       << pfx << std::setw(24) << "DE:" << ((typeinfo) ? "(string)" : "") << m_de << "\n"
+       << pfx << std::setw(24) << "DESID:" << ((typeinfo) ? "(string)" : "") << m_desid << "\n"
+       << pfx << std::setw(24) << "DESVER:" << ((typeinfo) ? "(string)" : "") << m_desver << "\n"
+       << pfx << std::setw(24) << "DECLAS:" << ((typeinfo) ? "(string)" : "") << m_declas << "\n"
+       << pfx << std::setw(24) << "DESCLSY:" << ((typeinfo) ? "(string)" : "") << m_desclsy << "\n"
+       << pfx << std::setw(24) << "DESCODE:" << ((typeinfo) ? "(string)" : "") << m_descode << "\n"
+       << pfx << std::setw(24) << "DESCTLH:" << ((typeinfo) ? "(string)" : "") << m_desctlh << "\n"
+       << pfx << std::setw(24) << "DESREL:" << ((typeinfo) ? "(string)" : "") << m_desrel << "\n"
+       << pfx << std::setw(24) << "DESDCTP:" << ((typeinfo) ? "(string)" : "") << m_desdctp << "\n"
+       << pfx << std::setw(24) << "DESDCDT:" << ((typeinfo) ? "(string)" : "") << m_desdcdt << "\n"
+       << pfx << std::setw(24) << "DESDCXM:" << ((typeinfo) ? "(string)" : "") << m_desdcxm << "\n"
+       << pfx << std::setw(24) << "DESDG:" << ((typeinfo) ? "(string)" : "") << m_desdg << "\n"
+       << pfx << std::setw(24) << "DESDGDT:" << ((typeinfo) ? "(string)" : "") << m_desdgdt << "\n"
+       << pfx << std::setw(24) << "DESCLTX:" << ((typeinfo) ? "" : "") << m_descltx << "\n"
+       << pfx << std::setw(24) << "DESCATP:" << ((typeinfo) ? "(string)" : "") << m_descatp << "\n"
+       << pfx << std::setw(24) << "DESCAUT:" << ((typeinfo) ? "(string)" : "") << m_descaut << "\n"
+       << pfx << std::setw(24) << "DESCRSN:" << ((typeinfo) ? "(string)" : "") << m_descrsn << "\n"
+       << pfx << std::setw(24) << "DESSRDT:" << ((typeinfo) ? "(string)" : "") << m_dessrdt << "\n"
+       << pfx << std::setw(24) << "DESCTLN:" << ((typeinfo) ? "(string)" : "") << m_desctln << "\n"
+   ;
+   if (getDesId() == "TRE_OVERFLOW")
+   {
+     out
+         << pfx << std::setw(24) << "DESOFLW:" << ((typeinfo) ? "(string)" : "") << m_desoflw << "\n"
+         << pfx << std::setw(24) << "DESITEM:" << ((typeinfo) ? "(string)" : "") << m_desitem << "\n"
+     ;
+   }
+
+   out
+       << pfx << std::setw(24) << "DESSHL:" << ((typeinfo) ? "(string)" : "") << m_desshl << "\n"
+   ;
+
+   if (getDesData().valid())
+   {
+     getDesData()->print(out, prefix);
+   }
+
+   return out;
+}
+
+void ossimNitfDesInformation::clearFields()
+{
+   memset(m_de, ' ', DE_SIZE);
+   m_de[DE_SIZE] = '\0';
+   memset(m_desid, ' ', DESID_SIZE);
+   m_desid[DESID_SIZE] = '\0';
+   memset(m_desver, ' ', DESVER_SIZE);
+   m_desver[DESVER_SIZE] = '\0';
+   memset(m_declas, ' ', DECLAS_SIZE);
+   m_declas[DECLAS_SIZE] = '\0';
+   memset(m_desclsy, ' ', DESCLSY_SIZE);
+   m_desclsy[DESCLSY_SIZE] = '\0';
+   memset(m_descode, ' ', DESCODE_SIZE);
+   m_descode[DESCODE_SIZE] = '\0';
+   memset(m_desctlh, ' ', DESCTLH_SIZE);
+   m_desctlh[DESCTLH_SIZE] = '\0';
+   memset(m_desrel, ' ', DESREL_SIZE);
+   m_desrel[DESREL_SIZE] = '\0';
+   memset(m_desdctp, ' ', DESDCTP_SIZE);
+   m_desdctp[DESDCTP_SIZE] = '\0';
+   memset(m_desdcdt, ' ', DESDCDT_SIZE);
+   m_desdcdt[DESDCDT_SIZE] = '\0';
+   memset(m_desdcxm, ' ', DESDCXM_SIZE);
+   m_desdcxm[DESDCXM_SIZE] = '\0';
+   memset(m_desdg, ' ', DESDG_SIZE);
+   m_desdg[DESDG_SIZE] = '\0';
+   memset(m_desdgdt, ' ', DESDGDT_SIZE);
+   m_desdgdt[DESDGDT_SIZE] = '\0';
+   memset(m_descltx, ' ', DESCLTX_SIZE);
+   m_descltx[DESCLTX_SIZE] = '\0';
+   memset(m_descatp, ' ', DESCATP_SIZE);
+   m_descatp[DESCATP_SIZE] = '\0';
+   memset(m_descaut, ' ', DESCAUT_SIZE);
+   m_descaut[DESCAUT_SIZE] = '\0';
+   memset(m_descrsn, ' ', DESCRSN_SIZE);
+   m_descrsn[DESCRSN_SIZE] = '\0';
+   memset(m_dessrdt, ' ', DESSRDT_SIZE);
+   m_dessrdt[DESSRDT_SIZE] = '\0';
+   memset(m_desctln, ' ', DESCTLN_SIZE);
+   m_desctln[DESCTLN_SIZE] = '\0';
+   memset(m_desoflw, ' ', DESOFLW_SIZE);
+   m_desoflw[DESOFLW_SIZE] = '\0';
+   memset(m_desitem, ' ', DESITEM_SIZE);
+   m_desitem[DESITEM_SIZE] = '\0';
+   memset(m_desshl, ' ', DESSHL_SIZE);
+   m_desshl[DESSHL_SIZE] = '\0';
+   
+   m_desOffset     = 0;
+   m_desDataOffset = 0;
+}
+
+void ossimNitfDesInformation::setDesName(const ossimString& desName)
+{
+   memset(m_desid, ' ', DESID_SIZE);
+
+   std::ostringstream out;
+
+   out << std::setw(DESID_SIZE)
+       << std::setfill(' ')
+       << m_desid;
+   memcpy(m_desid, out.str().c_str(), DESID_SIZE);
+}
+
+void ossimNitfDesInformation::setDesLength(ossim_uint32 desLength)
+{
+   /*
+   memset(m_desLength, 0, 5);
+   
+   if(desLength > 99999)
+   {
+      desLength = 99999;
+   }
+
+   std::ostringstream out;
+
+   out << std::setw(5)
+       << std::setfill('0')
+       << desLength;
+   
+   memcpy(m_desLength, out.str().c_str(), 5);
+   */
+}
+
+ossimRefPtr<ossimNitfRegisteredDes> ossimNitfDesInformation::getDesData()
+{
+   return m_desData;
+}
+
+const ossimRefPtr<ossimNitfRegisteredDes> ossimNitfDesInformation::getDesData()const
+{
+   return m_desData;
+}
+
+void ossimNitfDesInformation::setDesData(ossimRefPtr<ossimNitfRegisteredDes> desData)
+{
+   m_desData = desData;
+
+   /*
+   memset(m_desid, ' ', DESID_SIZE);
+   memset(m_desLength, ' ', 5);
+   
+   if(m_desData.valid())
+   {
+      setDesName(m_desData->getRegisterDesName());
+      setDesLength(m_desData->getSizeInBytes());
+   }
+   */
+}
diff --git a/src/support_data/ossimNitfEmbeddedRpfDes.cpp b/src/support_data/ossimNitfEmbeddedRpfDes.cpp
new file mode 100644
index 0000000..ab4e959
--- /dev/null
+++ b/src/support_data/ossimNitfEmbeddedRpfDes.cpp
@@ -0,0 +1,38 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfEmbeddedRpfDes.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <istream>
+#include <ostream>
+#include <ossim/support_data/ossimNitfEmbeddedRpfDes.h>
+
+
+RTTI_DEF1(ossimNitfEmbeddedRpfDes, "ossimNitfEmbeddedRpfDes", ossimNitfRegisteredTag)
+
+
+ossimNitfEmbeddedRpfDes::ossimNitfEmbeddedRpfDes()
+   : ossimNitfRegisteredTag(std::string("RPFDES"), 0)
+{
+}
+
+ossimNitfEmbeddedRpfDes::~ossimNitfEmbeddedRpfDes()
+{
+}
+
+void ossimNitfEmbeddedRpfDes::parseStream(std::istream& /* in */ )
+{
+}
+
+std::ostream& ossimNitfEmbeddedRpfDes::print(std::ostream& out, const std::string& /* prefix */)const
+{
+   return out;
+}
diff --git a/src/support_data/ossimNitfEngrdaTag.cpp b/src/support_data/ossimNitfEngrdaTag.cpp
new file mode 100644
index 0000000..9953c61
--- /dev/null
+++ b/src/support_data/ossimNitfEngrdaTag.cpp
@@ -0,0 +1,243 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: ENGRDA - Engineering Data tag class declaration.
+//
+// See document STDI-0002 (version 3), Appendix N for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
+#include <ossim/support_data/ossimNitfEngrdaTag.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+
+static const ossimTrace traceDebug(ossimString("ossimNitfEngrda:debug"));
+
+RTTI_DEF1(ossimNitfEngrdaTag, "ossimNitfEngrdaTag", ossimNitfRegisteredTag);
+
+ossimNitfEngrdaTag::ossimNitfEngrdaTag()
+   : ossimNitfRegisteredTag(std::string("ENGRDA"), 0)
+{
+   clearFields();
+}
+
+ossimNitfEngrdaTag::~ossimNitfEngrdaTag()
+{
+}
+
+void ossimNitfEngrdaTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(m_reSrc, RESRC_SIZE);
+   in.read(m_reCnt, RECNT_SIZE);
+ 
+   const ossim_uint16 ELEMENT_COUNT = ossimString(m_reCnt).toUInt16();
+   
+   for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
+   {
+      ossimString os;
+      ossim_uint32 size(0);
+      
+      char buf[TMP_BUF_SIZE];
+
+      ossimEngDataElement element;
+
+      // ENGLN - label length field
+      in.read(element.m_engLn, ENGLN_SIZE);
+      element.m_engLn[ENGLN_SIZE] = '\0';
+
+      // ENGLBL - label field
+      os = element.m_engLn;
+      size = os.toUInt16();
+      in.read(buf, size);
+      buf[size] = '\0';
+      element.m_engLbl = buf;
+
+      // ENGMTXC - data column count
+      in.read(element.m_engMtxC, ENGMTXC_SIZE);
+      element.m_engMtxC[ENGMTXC_SIZE] = '\0';
+
+      // ENGMTXR - data row count
+      in.read(element.m_engMtxR, ENGMTXR_SIZE);
+      element.m_engMtxR[ENGMTXR_SIZE] = '\0';
+
+      // ENGTYP - Value Type of Engineering Data Element.
+      in.get( element.m_engTyp );
+
+      // ENGDTS - Engineering Data Element Size
+      in.get( element.m_engDts );
+      os = element.m_engDts;
+      ossim_uint32 engDataElementSize = os.toUInt32();
+
+      // ENGDATU - Engineering Data Units.
+      in.read( element.m_engDatU, ENGDATU_SIZE );
+      element.m_engDatU[ENGDATU_SIZE] = '\0';
+
+      // ENGDATC - Engineering Data Count
+      in.read(element.m_engDatC, ENGDATC_SIZE);
+      element.m_engDatC[ENGDATC_SIZE] = '\0';
+      os = element.m_engDatC;
+      ossim_uint32 engDataCount = os.toUInt32();
+
+      // ENGDATA - Engineering Data
+      size = engDataElementSize * engDataCount;
+      element.m_engDat.resize(size);
+      in.read((char*)&(element.m_engDat.front()), size);
+      
+      m_data.push_back(element);
+
+   } // Matches: for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
+}
+
+void ossimNitfEngrdaTag::writeStream(std::ostream& out)
+{
+   //out.write(theAcMsnId, AC_MSN_ID_SIZE);
+   // out.write(theAcTailNo, AC_TAIL_NO_SIZE);
+
+   out.write(m_reSrc, RESRC_SIZE);
+   out.write(m_reCnt, RECNT_SIZE);
+
+   const ossim_uint16 ELEMENT_COUNT = ossimString(m_reCnt).toUInt16();
+   
+   for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
+   {
+      // ENGLN - label length field      
+      out.write(m_data[i].m_engLn, ENGLN_SIZE);
+
+      // ENGLBL - label field
+      out.write(m_data[i].m_engLbl.data(), (std::streamsize)m_data[i].m_engLbl.size());
+
+      // ENGMTXC - data column count
+      out.write(m_data[i].m_engMtxC, ENGMTXC_SIZE );
+
+      // ENGMTXR - data row count
+      out.write(m_data[i].m_engMtxR, ENGMTXR_SIZE );
+
+      // ENGTYP - Value Type of Engineering Data Element.
+      out.write( (char*)(&m_data[i].m_engTyp), ENGTYP_SIZE );
+
+      // ENGDTS - Engineering Data Element Size
+      out.write((char*)(&m_data[i].m_engDts), ENGDTS_SIZE );
+
+      // ENGDATU - Engineering Data Units.
+      out.write( m_data[i].m_engDatU, ENGDATU_SIZE );
+
+      // ENGDATC - Engineering Data Count
+      out.write( m_data[i].m_engDatC, ENGDATC_SIZE );
+
+      // ENGDATA - Engineering Data NOTE: should be big endian...
+      out.write((char*)&(m_data[i].m_engDat.front()),
+                (std::streamsize)m_data[i].m_engDat.size());
+
+   } // Matches: for (ossim_uint16 i = 0; i < ELEMENT_COUNT; ++i)
+   
+}
+
+void ossimNitfEngrdaTag::clearFields()
+{
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+
+   // clear
+   memset(m_reSrc, ' ', RESRC_SIZE);
+   memset(m_reCnt, ' ', RECNT_SIZE);
+   m_data.clear();
+
+   // null terminate
+   m_reSrc[RESRC_SIZE] = '\0';
+   m_reCnt[RECNT_SIZE] = '\0';
+}
+
+std::ostream& ossimNitfEngrdaTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+
+   const ossim_uint32 W = 17;
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(W) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(W) << "CEL:"   << getSizeInBytes() << "\n"
+       << pfx << std::setw(W) << "RESRC:" << m_reSrc << "\n"
+       << pfx << std::setw(W) << "RECNT:" << m_reCnt << "\n";
+
+   for (ossim_uint32 i = 0; i < m_data.size(); ++i)
+   {
+      out << pfx << "ENGLN[" << i << std::setw(W-7) << "]:"
+          << m_data[i].m_engLn << "\n"
+          << pfx << "ENGLBL[" << i << std::setw(W-8) << "]:"
+          << m_data[i].m_engLbl << "\n"
+          << pfx << "ENGMTXC[" << i << std::setw(W-9) << "]:"
+          << m_data[i].m_engMtxC << "\n"
+          << pfx << "ENGMTXR[" << i << std::setw(W-9) << "]:"
+          << m_data[i].m_engMtxR << "\n"
+          << pfx << "ENGTYP[" << i << std::setw(W-8) << "]:"
+          << std::string(1, m_data[i].m_engTyp) << "\n"
+          << pfx << "ENGDTS[" << i << std::setw(W-8) << "]:"
+          << std::string(1, m_data[i].m_engDts) << "\n"
+          << pfx << "ENGDATU[" << i << std::setw(W-9) << "]:"
+          << m_data[i].m_engDatU << "\n"
+          << pfx << "ENGDATC[" << i << std::setw(W-9) << "]:"
+          << m_data[i].m_engDat.size() << "\n";
+      
+      printData(out, m_data[i], i, pfx);
+   }
+   
+   return out;
+}
+
+std::ostream& ossimNitfEngrdaTag::printData( std::ostream& out,
+                                             const ossimEngDataElement& element,
+                                             ossim_uint32 elIndex,
+                                             const std::string& prefix ) const
+{
+   if (element.m_engTyp == 'A')
+   {
+      out << prefix << "ENGDATA[" << elIndex << std::setw(8) << "]:";
+      
+      std::vector<ossim_uint8>::const_iterator i = element.m_engDat.begin();
+      while (i != element.m_engDat.end())
+      {
+         out << static_cast<ossim_int8>(*i);
+         ++i;
+      }
+      out << "\n";
+   }
+   else
+   {
+      out << prefix << "ENGDATA[" << elIndex << std::setw(8) << "]:      NOT DISPLAYED\n";
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimNitfEngrdaTag::printData WARNING unhandled data type."
+            << "Data type = " << (char)element.m_engTyp << "\n"
+            << std::endl;
+      }
+   } 
+   return out;
+}
+
+template <class T>
+void ossimNitfEngrdaTag::getValueAsString(
+   T v, ossim_uint16 w, std::string& s) const
+{
+   std::ostringstream os;
+   os << std::setw(w) << std::setfill('0') << setiosflags(ios::right) << v;
+   s = os.str();
+}
+   
diff --git a/ossim/src/ossim/support_data/ossimNitfExoptaTag.cpp b/src/support_data/ossimNitfExoptaTag.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfExoptaTag.cpp
rename to src/support_data/ossimNitfExoptaTag.cpp
diff --git a/src/support_data/ossimNitfFile.cpp b/src/support_data/ossimNitfFile.cpp
new file mode 100644
index 0000000..45608d5
--- /dev/null
+++ b/src/support_data/ossimNitfFile.cpp
@@ -0,0 +1,571 @@
+//---
+//
+//  License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//---
+// $Id$
+
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfTagFactoryRegistry.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/support_data/ossimRpfToc.h>
+
+#include <iostream>
+#include <iomanip>
+#include <memory>
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimNitfFile:debug");
+
+std::ostream& operator <<(std::ostream& out, const ossimNitfFile& data)
+{
+   return data.print(out);
+}
+
+std::ostream& ossimNitfFile::print(std::ostream& out,
+                                   const std::string& prefix,
+                                   bool printOverviews) const
+{
+   if(theNitfFileHeader.valid())
+   {
+      std::string pfx = prefix;
+      pfx += "nitf.";
+      theNitfFileHeader->print(out, pfx);
+      
+      ossim_int32 n = theNitfFileHeader->getNumberOfImages();
+      for(ossim_int32 idx = 0; idx < n; ++idx)
+      {
+         ossimNitfImageHeader* ih = getNewImageHeader(idx);
+         if(ih)
+         {
+            bool printIt = true;
+            
+            if ( !printOverviews )
+            {
+               // Check the IMAG field.
+               ossim_float64 imag;
+               ih->getDecimationFactor(imag);
+               if ( !ossim::isnan(imag) )
+               {
+                  if ( imag < 1.0)
+                  {
+                     printIt = false;
+                  }
+               }
+
+#if 0 /* Not sure why this was in there for a print. (drb 09 Nov. 2016) */
+               //---
+               // Now see if it's a cloud mask image.  Do not print
+               // cloud mask images if the printOverviews is false.
+               //---
+               if ( printIt )
+               {
+                  if ( (ih->getCategory().trim(ossimString(" ")) ==
+                        "CLOUD") &&
+                       (ih->getRepresentation().trim(ossimString(" ")) ==
+                        "NODISPLY") )
+                  {
+                     printIt = false;
+                  }
+               }
+#endif
+            }
+
+            if (printIt)
+            {
+               // Add our prefix onto prefix.
+               std::string s = pfx;
+               s += "image";
+               s += ossimString::toString(idx).string();
+               s += ".";
+               
+               ih->print(out, s);
+            }
+            
+            delete ih;
+            ih = 0;
+         }
+      }
+
+      //---
+      // Check for RPF stuff:
+      //---
+      ossimNitfTagInformation info; 
+      theNitfFileHeader->getTag(info, "RPFHDR");
+      if(info.getTagName() == "RPFHDR")
+      {
+         // Open of the a.toc.
+         ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc;
+         if ( toc->parseFile(getFilename()) ==
+              ossimErrorCodes::OSSIM_OK )
+         {
+            pfx += "rpf.";
+            toc->print(out, pfx, printOverviews);
+         }
+      }
+      
+   } // matches:  if(theNitfFileHeader.valid())
+
+   return out;
+   
+}
+
+std::ostream& ossimNitfFile::print(std::ostream& out,
+                                   ossim_uint32 entryIndex,
+                                   const std::string& prefix,
+                                   bool printOverviews) const
+{
+   if(theNitfFileHeader.valid())
+   {
+      std::string pfx = prefix;
+      pfx += "nitf.";
+      theNitfFileHeader->print(out, pfx);
+      
+      if ( entryIndex < (ossim_uint32)theNitfFileHeader->getNumberOfImages() )
+      {
+         ossimRefPtr<ossimNitfImageHeader> ih = getNewImageHeader(entryIndex);
+         if ( ih.valid() == true )
+         {
+            bool printIt = true;
+            
+            if ( !printOverviews )
+            {
+               // Check the IMAG field.
+               ossim_float64 imag;
+               ih->getDecimationFactor(imag);
+               if ( !ossim::isnan(imag) )
+               {
+                  if ( imag < 1.0)
+                  {
+                     printIt = false;
+                  }
+               }
+               
+               //---
+               // Now see if it's a cloud mask image.  Do not print
+               // cloud mask images if the printOverviews is false.
+               //---
+               if ( printIt )
+               {
+                  if ( (ih->getCategory().trim(ossimString(" ")) ==
+                        "CLOUD") &&
+                       (ih->getRepresentation().trim(ossimString(" ")) ==
+                        "NODISPLY") )
+                  {
+                     printIt = false;
+                  }
+               }
+            }
+
+            if (printIt)
+            {
+               // Add our prefix onto prefix.
+               std::string s = pfx;
+               s += "image";
+               s += ossimString::toString(entryIndex).string();
+               s += ".";
+               
+               ih->print(out, s);
+            }
+            ih = 0;
+         }
+      }
+
+      //---
+      // Check for RPF stuff:
+      //---
+      ossimNitfTagInformation info; 
+      theNitfFileHeader->getTag(info, "RPFHDR");
+      if(info.getTagName() == "RPFHDR")
+      {
+         // Open of the a.toc.
+         ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc;
+         if ( toc->parseFile(getFilename()) ==
+              ossimErrorCodes::OSSIM_OK )
+         {
+            pfx += "rpf.";
+            toc->printHeader(out, pfx);
+            toc->printTocEntry( out, entryIndex, pfx, printOverviews );
+         }
+      }
+      
+   } // matches:  if(theNitfFileHeader.valid())
+
+   return out;
+   
+}
+
+bool ossimNitfFile::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = theNitfFileHeader.valid(); 
+   
+   if(theNitfFileHeader.valid())
+   {
+      theNitfFileHeader->saveState(kwl, prefix);
+   }
+   ossim_int32 n = theNitfFileHeader->getNumberOfImages();
+   for(ossim_int32 idx = 0; idx < n; ++idx)
+   {
+      ossimRefPtr<ossimNitfImageHeader> ih = getNewImageHeader(idx);
+      ossimString newPrefix = prefix + "image" + ossimString::toString(idx) + ".";
+#if 1     
+      ih->saveState(kwl, newPrefix);
+#else
+      if ( (ih->getCategory().trim(ossimString(" ")) !=
+            "CLOUD") ||
+          (ih->getRepresentation().trim(ossimString(" ")) !=
+           "NODISPLY") )
+      {
+         ih->saveState(kwl, newPrefix);
+      }
+#endif
+   }
+   return result;
+}
+
+ossimNitfFile::ossimNitfFile()
+   : theFilename(""),
+     theNitfFileHeader(0)
+{
+}
+
+ossimNitfFile::~ossimNitfFile()
+{
+   theNitfFileHeader = 0;
+}
+
+bool ossimNitfFile::parseFile(const ossimFilename& file)
+{
+   bool result = false;
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimNitfFile::parseFile: entered...\n";
+   }
+   
+   //if( file.exists() )
+   {
+      // Open up a stream to the file.
+      std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+         createIstream( file, std::ios_base::in | std::ios_base::binary );
+
+      if ( str )
+      {
+         result = parseStream( file, *str );   
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG ossimNitfFile::parseFile: "
+               << "Could not open file:  " << file.c_str() << "\n";
+         }
+      }
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimNitfFile::parseFile: "
+         << "exit status: " << (result?"true":"false") << "\n";
+   }
+
+   return result;
+}
+
+bool ossimNitfFile::parseStream( const ossimFilename& file,
+                                 ossim::istream& in )
+{
+   bool result = false;
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfFile::parseStream: DEBUG entered...\n";
+   }
+   
+   if(theNitfFileHeader.valid())
+   {
+      theNitfFileHeader = 0;
+   }
+
+   char temp[10];
+   in.read(temp, 9);
+   in.seekg(0, std::ios::beg);
+   temp[9] ='\0';
+   
+   theFilename = file;
+
+   ossimString s(temp);
+   if(s == "NITF02.00")
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG: NITF Version 2.0"
+            << std::endl;
+      }
+      theNitfFileHeader = new ossimNitfFileHeaderV2_0;
+   }
+   else if ( (s == "NITF02.10") || (s == "NSIF01.00") )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG: NITF Version 2.1"
+            << std::endl;
+      }
+      theNitfFileHeader = new ossimNitfFileHeaderV2_1;
+   }
+   else
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimNitfFile::parseFile: "
+            << "Not an NITF file!\n";
+      }
+   }
+
+   if( theNitfFileHeader.valid() )
+   {
+      try
+      {
+         theNitfFileHeader->parseStream(in);
+         result = true;
+      }
+      catch( const ossimException& e )
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimNitfFile::parseStream caught exception:\n"
+               << e.what()
+               << std::endl;
+         }
+      }
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfFile::parseStream: DEBUG\n"
+         << "exit status: " << (result?"true":"false") << "\n";
+   }
+   return result;
+}
+
+const ossimNitfFileHeader* ossimNitfFile::getHeader() const
+{
+   return theNitfFileHeader.get();
+}
+
+ossimNitfFileHeader* ossimNitfFile::getHeader() 
+{
+   return theNitfFileHeader.get();
+}
+
+ossimIrect ossimNitfFile::getImageRect()const
+{
+   if(theNitfFileHeader.valid())
+   {
+      return theNitfFileHeader->getImageRect();
+   }
+
+   return ossimIrect(ossimIpt(0,0), ossimIpt(0,0));
+}
+
+ossimNitfImageHeader* ossimNitfFile::getNewImageHeader(
+   ossim_uint32 imageNumber)const
+{
+   ossimNitfImageHeader* result = 0;
+
+   if(theNitfFileHeader.valid())
+   {
+      std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+         createIstream(theFilename, std::ios::in|std::ios::binary);
+      
+      if ( in )
+      {
+         result = getNewImageHeader( *in, imageNumber );
+      }
+   }
+   
+   return result;
+}
+
+ossimNitfImageHeader* ossimNitfFile::getNewImageHeader(
+   ossim::istream& in, ossim_uint32 imageNumber)const
+{
+   ossimNitfImageHeader* result = 0;
+
+   if(theNitfFileHeader.valid())
+   {
+      try // getNewImageHeader can throw exception on parse.
+      {
+         result = theNitfFileHeader->getNewImageHeader(imageNumber, in);
+      }
+      catch( const ossimException& e )
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimNitfFile::getNewImageHeader caught exception:\n"
+               << e.what()
+               << std::endl;
+         }
+         result = 0;
+      }
+   }
+
+   return result;
+}
+
+ossimNitfSymbolHeader* ossimNitfFile::getNewSymbolHeader(
+   ossim_uint32 symbolNumber)const
+{
+   ossimNitfSymbolHeader* result = 0;
+
+   if(theNitfFileHeader.valid())
+   {
+      std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+         createIstream(theFilename, std::ios::in|std::ios::binary);
+
+      if ( in )
+      {
+         result = getNewSymbolHeader( *in, symbolNumber );
+      }
+   }
+   
+   return result;
+}
+
+ossimNitfSymbolHeader* ossimNitfFile::getNewSymbolHeader(
+   ossim::istream& in, ossim_uint32 symbolNumber)const
+{
+   ossimNitfSymbolHeader* result = 0;
+   if(theNitfFileHeader.valid())
+   {
+      result = theNitfFileHeader->getNewSymbolHeader(symbolNumber, in);
+   }
+   return result;
+}
+
+ossimNitfLabelHeader* ossimNitfFile::getNewLabelHeader(
+   ossim_uint32 labelNumber)const
+{
+   ossimNitfLabelHeader* result = 0;
+   if(theNitfFileHeader.valid())
+   {
+      std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+         createIstream(theFilename, std::ios::in|std::ios::binary);
+      
+      if ( in )
+      {
+         result = getNewLabelHeader( *in, labelNumber );
+      }
+   }
+   
+   return result;
+}
+
+ossimNitfLabelHeader* ossimNitfFile::getNewLabelHeader(
+   ossim::istream& in, ossim_uint32 labelNumber)const
+{
+   ossimNitfLabelHeader* result = 0;
+   if(theNitfFileHeader.valid())
+   {
+      result = theNitfFileHeader->getNewLabelHeader(labelNumber, in);
+   }
+   return result;
+}
+
+ossimNitfTextHeader* ossimNitfFile::getNewTextHeader(
+   ossim_uint32 textNumber)const
+{
+   ossimNitfTextHeader* result = 0;
+   if(theNitfFileHeader.valid())
+   {
+      std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+         createIstream(theFilename, std::ios::in|std::ios::binary);
+
+      if ( in )
+      {
+         result = getNewTextHeader( *in, textNumber );
+      }
+   }
+   return result;
+}
+
+ossimNitfTextHeader* ossimNitfFile::getNewTextHeader(
+   ossim::istream& in, ossim_uint32 textNumber)const
+{
+   ossimNitfTextHeader* result = 0;
+   if(theNitfFileHeader.valid())
+   {
+      result = theNitfFileHeader->getNewTextHeader(textNumber, in);
+   }
+   return result;
+}
+
+ossimNitfDataExtensionSegment* ossimNitfFile::getNewDataExtensionSegment(
+   ossim_uint32 dataExtNumber)const
+{
+   ossimNitfDataExtensionSegment* result = 0;
+   if(theNitfFileHeader.valid())
+   {
+      std::shared_ptr<ossim::istream> in = ossim::StreamFactoryRegistry::instance()->
+         createIstream(theFilename, std::ios::in|std::ios::binary);
+
+      if ( in )
+      {
+         result = getNewDataExtensionSegment( *in, dataExtNumber );
+      }
+   }
+   return result;
+}
+
+ossimNitfDataExtensionSegment* ossimNitfFile::getNewDataExtensionSegment(
+   ossim::istream& in, ossim_uint32 dataExtNumber)const
+{
+   ossimNitfDataExtensionSegment* result = 0;
+   if(theNitfFileHeader.valid())
+   {
+      result = theNitfFileHeader->getNewDataExtensionSegment(dataExtNumber, in);
+   }
+   return result;
+}
+
+ossimString ossimNitfFile::getVersion()const
+{
+   if(theNitfFileHeader.valid())
+   {
+      return ossimString(theNitfFileHeader->getVersion());
+   }
+   
+   return ossimString("");
+}
+
+ossimFilename ossimNitfFile::getFilename() const
+{
+   return theFilename;
+}
diff --git a/src/support_data/ossimNitfFileHeader.cpp b/src/support_data/ossimNitfFileHeader.cpp
new file mode 100644
index 0000000..257f8d9
--- /dev/null
+++ b/src/support_data/ossimNitfFileHeader.cpp
@@ -0,0 +1,229 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <iostream>
+
+static const char* TAGS_KW = "tags";
+
+RTTI_DEF2(ossimNitfFileHeader, "ossimNitfFileHeader", ossimObject, ossimPropertyInterface);
+
+std::ostream& ossimNitfImageOffsetInformation::print(std::ostream& out) const
+{
+   return out << "theImageHeaderOffset:          "
+              << theImageHeaderOffset << std::endl
+              << "theImageDataOffset:            "
+              << theImageDataOffset;
+}
+
+ossimNitfFileHeader::ossimNitfFileHeader()
+{
+}
+
+ossimNitfFileHeader::~ossimNitfFileHeader()
+{
+}
+
+
+bool ossimNitfFileHeader::getTag(ossimNitfTagInformation& tagInfo,
+                                 const ossimString& tagName)const
+{
+   if(theTagList.size())
+   {
+      for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
+      {
+         if(theTagList[i].getTagName() == tagName)
+         {
+            tagInfo = theTagList[i];
+            return true;
+         }
+      }
+   }
+
+   return false;
+}
+
+bool  ossimNitfFileHeader::hasImages()const
+{
+   return (getNumberOfImages() > 0);
+}
+
+bool  ossimNitfFileHeader::hasSymbols()const
+{
+   return (getNumberOfSymbols() > 0);
+}
+
+bool  ossimNitfFileHeader::hasGraphics()const
+{
+   return (getNumberOfGraphics() > 0);
+}
+
+bool  ossimNitfFileHeader::hasText()const
+{
+   return (getNumberOfTextSegments() > 0);
+}
+
+bool  ossimNitfFileHeader::hasLabels()const
+{
+   return (getNumberOfLabels() > 0);
+}
+bool ossimNitfFileHeader::hasDataExtSegments()const
+{
+   return (getNumberOfDataExtSegments() > 0);
+}
+
+void ossimNitfFileHeader::removeTag(const ossimString& tagName)
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theTagList.size(); ++idx)
+   {
+      if(theTagList[idx].getTagName() == tagName)
+      {
+         theTagList.erase(theTagList.begin() + idx);
+         return;
+      }
+   }
+}
+void ossimNitfFileHeader::addTag(const ossimNitfTagInformation& tag, bool unique)
+{
+   if(unique)
+   {
+      removeTag(tag.getTagName());
+   }
+   theTagList.push_back(tag);
+}
+
+bool ossimNitfFileHeader::getTagInformation(ossimNitfTagInformation& tag,
+                                            int idx) const
+{
+   bool result = false;
+   
+   if(static_cast<ossim_uint32>(idx) < theTagList.size())
+   {
+      tag = theTagList[idx];
+      result = true;
+   }
+   
+   return result;
+}
+
+int ossimNitfFileHeader::getNumberOfTags()const
+{
+   return (int)theTagList.size();
+}
+
+ossim_uint32 ossimNitfFileHeader::getTotalTagLength()const
+{
+   ossim_uint32 tagLength = 0;
+   
+   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
+   {
+      tagLength += theTagList[i].getTotalTagLength();
+   }
+   
+   return tagLength;
+}
+
+
+void ossimNitfFileHeader::setProperty(ossimRefPtr<ossimProperty> /* property */)
+{
+}
+
+ossimRefPtr<ossimProperty> ossimNitfFileHeader::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> result = 0;
+
+   if(name == TAGS_KW)
+   {
+      ossim_uint32 idxMax = (ossim_uint32)theTagList.size();
+      if(idxMax > 0)
+      {
+         ossimContainerProperty* containerProperty = new ossimContainerProperty;
+         containerProperty->setName(name);
+         ossim_uint32 idx = 0;
+
+         result = containerProperty;
+         for(idx = 0; idx < idxMax; ++idx)
+         {
+            ossimNitfTagInformation tagInfo;
+            getTagInformation(tagInfo, idx);
+            
+            const ossimRefPtr<ossimNitfRegisteredTag> tagData = tagInfo.getTagData();
+            if(tagData.valid())
+            {
+               ossimContainerProperty* containerPropertyTag = new ossimContainerProperty;
+               containerPropertyTag->setName(tagInfo.getTagName());
+               std::vector<ossimRefPtr<ossimProperty> > propertyList;
+               tagData->getPropertyList(propertyList);
+               
+               containerPropertyTag->addChildren(propertyList);
+               containerProperty->addChild(containerPropertyTag);
+            }
+            else
+            {
+               containerProperty->addStringProperty(tagInfo.getTagName(), "", true);
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimNitfFileHeader::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(TAGS_KW);
+}
+
+bool ossimNitfFileHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   ossimObject::saveState(kwl, prefix);
+   
+   bool result = true;
+   ossimString tagsPrefix = prefix;
+   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
+   {
+      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
+      if (tag.valid())
+      {
+         // we eventually need to do our own prefix for this object and not let the calling object do any prefix definitions
+//         ossimString newPrefix = tagsPrefix + tag->getRegisterTagName() + ".";
+
+         tag->saveState(kwl, tagsPrefix);
+      }
+   }
+   
+   return result;
+}
+
+std::ostream& ossimNitfFileHeader::print(std::ostream& out,
+                                         const std::string& prefix ) const
+{
+   return printTags(out, prefix);
+}
+
+std::ostream& ossimNitfFileHeader::printTags(std::ostream& out,
+                                             const std::string& prefix) const
+{
+   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
+   {
+      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
+      if (tag.valid())
+      {
+         tag->print(out, prefix);
+      }
+   }
+
+   return out;
+}
diff --git a/src/support_data/ossimNitfFileHeaderV2_0.cpp b/src/support_data/ossimNitfFileHeaderV2_0.cpp
new file mode 100644
index 0000000..f14bd95
--- /dev/null
+++ b/src/support_data/ossimNitfFileHeaderV2_0.cpp
@@ -0,0 +1,1715 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfSymbolHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfLabelHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfTextHeaderV2_0.h>
+#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_0.h>
+
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimStringProperty.h>
+
+#include <sstream>
+#include <cstring> // for memset
+#include <iostream>
+#include <iomanip>
+#include <stdexcept>
+
+
+const ossimString ossimNitfFileHeaderV2_0::FSDWNG_KW = "fsdwng";
+const ossimString ossimNitfFileHeaderV2_0::FSDEVT_KW = "fsdevt";
+
+static const ossimTrace traceDebug("ossimNitfFileHeaderV2_0:debug");
+
+RTTI_DEF1(ossimNitfFileHeaderV2_0, "ossimNitfFileHeaderV2_0", ossimNitfFileHeaderV2_X)
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfImageInfoRecordV2_0 &data)
+{
+   return out << "theImageSubheaderLength:       "
+              << data.theImageSubheaderLength << std::endl
+              << "theImageLength:                "
+              << data.theImageLength;
+}
+
+ossim_uint32 ossimNitfImageInfoRecordV2_0::getHeaderLength()const
+{
+   return ossimString(theImageSubheaderLength).toInt32();
+}
+
+ossim_uint64  ossimNitfImageInfoRecordV2_0::getImageLength()const
+{
+   return ossimString(theImageLength).toInt32();
+}
+
+ossim_uint64 ossimNitfImageInfoRecordV2_0::getTotalLength()const
+{
+   return (getHeaderLength() + getImageLength());
+}
+
+void ossimNitfImageInfoRecordV2_0::setSubheaderLength(ossim_uint32 length)
+{
+   std::ostringstream out;
+   
+   out << std::setw(6)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << length;
+   
+   memcpy(theImageSubheaderLength, out.str().c_str(), 6);
+   theImageSubheaderLength[6] = '\0';
+}
+
+void ossimNitfImageInfoRecordV2_0::setImageLength(ossim_uint64 length)
+{
+   std::ostringstream out;
+   
+   out << std::setw(10)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << length;
+   
+   memcpy(theImageLength, out.str().c_str(), 10);
+   theImageLength[10] = '\0';
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfSymbolInfoRecordV2_0 &data)
+{
+   return out << "theSymbolSubheaderLength:       "
+              << data.theSymbolSubheaderLength << std::endl
+              << "theSymbolLength:                "
+              << data.theSymbolLength;
+}
+ossim_int32 ossimNitfSymbolInfoRecordV2_0::getHeaderLength()const
+{
+   return ossimString(theSymbolSubheaderLength).toInt32();
+}
+
+ossim_int32 ossimNitfSymbolInfoRecordV2_0::getImageLength()const
+{
+   return ossimString(theSymbolLength).toInt32();
+}
+
+ossim_int32 ossimNitfSymbolInfoRecordV2_0::getTotalLength()const
+{
+   return (getHeaderLength() + getImageLength());
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfLabelInfoRecordV2_0 &data)
+{
+   return out << "theLabelSubheaderLength:       "
+              << data.theLabelSubheaderLength << std::endl
+              << "theLabelLength:                "
+              << data.theLabelLength;
+}
+
+ossim_int32 ossimNitfLabelInfoRecordV2_0::getHeaderLength()const
+{
+   return ossimString(theLabelSubheaderLength).toInt32();
+}
+
+ossim_int32 ossimNitfLabelInfoRecordV2_0::getImageLength()const
+{
+   return ossimString(theLabelLength).toInt32();
+}
+
+ossim_int32 ossimNitfLabelInfoRecordV2_0::getTotalLength()const
+{
+   return (getHeaderLength() + getImageLength());
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfTextInfoRecordV2_0 &data)
+{
+   return out << "theTextSubheaderLength:       "
+              << data.theTextSubheaderLength << std::endl
+              << "theTextLength:                "
+              << data.theTextLength;
+}
+
+ossim_int32 ossimNitfTextInfoRecordV2_0::getHeaderLength()const
+{
+   return ossimString(theTextSubheaderLength).toInt32();
+}
+
+ossim_int32 ossimNitfTextInfoRecordV2_0::getImageLength()const
+{
+   return ossimString(theTextLength).toInt32();
+}
+
+ossim_int32 ossimNitfTextInfoRecordV2_0::getTotalLength()const
+{
+   return (getHeaderLength() + getImageLength());
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfDataExtSegInfoRecordV2_0 &data)
+{
+   return out << "theDataExtSegSubheaderLength:       "
+              << data.theDataExtSegSubheaderLength << std::endl
+              << "theDataExtSegLength:                "
+              << data.theDataExtSegLength;
+}
+
+ossim_int32 ossimNitfDataExtSegInfoRecordV2_0::getHeaderLength()const
+{
+   return ossimString(theDataExtSegSubheaderLength).toInt32();
+}
+
+ossim_int32 ossimNitfDataExtSegInfoRecordV2_0::getImageLength()const
+{
+   return ossimString(theDataExtSegLength).toInt32();
+}
+
+ossim_int32 ossimNitfDataExtSegInfoRecordV2_0::getTotalLength()const
+{
+   return (getHeaderLength() + getImageLength());
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfResExtSegInfoRecordV2_0 &data)
+{
+   return out << "theResExtSegSubheaderLength:       "
+              << data.theResExtSegSubheaderLength << std::endl
+              << "theResExtSegLength:                "
+              << data.theResExtSegLength;
+}
+
+ossimNitfFileHeaderV2_0::ossimNitfFileHeaderV2_0()
+   :ossimNitfFileHeaderV2_X()
+{
+   clearFields();
+}
+
+ossimNitfFileHeaderV2_0::~ossimNitfFileHeaderV2_0()
+{
+}
+
+bool ossimNitfFileHeaderV2_0::isValid()const
+{
+   bool result = ossimNitfFileHeaderV2_X::isValid();
+
+   if(result)
+   {
+
+   }
+
+   return result;
+}
+
+void ossimNitfFileHeaderV2_0::parseStream(ossim::istream& in)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfFileHeaderV2_0::parseStream:   entered ......."
+         << std::endl;
+   }
+   
+   clearFields();
+   
+   // identification and origination group
+   in.read(theFileTypeVersion, 9);
+   theHeaderSize+=9;
+   in.read(theComplexityLevel, 2);
+   theHeaderSize+=2;
+   in.read(theSystemType, 4);
+   theHeaderSize+=4;
+   in.read(theOriginatingStationId, 10);
+   theHeaderSize+=10;
+   in.read(theDateTime, 14);
+   theHeaderSize+=14;
+   in.read(theFileTitle, 80);
+   theHeaderSize+=80;
+   
+   // read security group
+   in.read(theSecurityClassification, 1);
+   theHeaderSize++;
+   in.read(theCodewords, 40);
+   theHeaderSize+=40;
+   in.read(theControlAndHandling, 40);
+   theHeaderSize+=40;
+   in.read(theReleasingInstructions, 40);
+   theHeaderSize+=40;
+   in.read(theClassificationAuthority, 20);
+   theHeaderSize+=20;
+   in.read(theSecurityControlNumber, 20);
+   theHeaderSize+=20;
+   in.read(theSecurityDowngrade, 6);
+   theHeaderSize+=6;
+   if(ossimString(theSecurityDowngrade) == "999998")
+   {
+      in.read(theDowngradingEvent, 40);
+      theHeaderSize+=40;
+   }      
+   in.read(theCopyNumber, 5);
+   theHeaderSize+=5;
+   in.read(theNumberOfCopies, 5);
+   theHeaderSize+=5;
+   in.read(theEncryption, 1);
+   theHeaderSize++;
+   in.read(theOriginatorsName, 27);
+   theHeaderSize+=27;
+   in.read(theOriginatorsPhone, 18);
+   theHeaderSize+=18;
+   
+   in.read(theFileLength, 12);
+   theHeaderSize+=12;
+   in.read(theHeaderLength, 6);
+   theHeaderSize+=6;
+   
+   // image description group
+   in.read(theNumberOfImageInfoRecords, 3);
+   theHeaderSize+=3;
+   readImageInfoRecords(in);
+
+   // symbol description group
+   in.read(theNumberOfSymbolInfoRecords, 3);
+   theHeaderSize+=3;
+   readSymbolInfoRecords(in);
+   
+   // label description group
+   in.read(theNumberOfLabelInfoRecords, 3);
+   theHeaderSize+=3;
+   readLabelInfoRecords(in);
+   
+   // text file information group
+   in.read(theNumberOfTextFileInfoRecords, 3);
+   theHeaderSize+=3;
+   readTextFileInfoRecords(in);
+   
+   // Data extension group
+   in.read(theNumberOfDataExtSegInfoRecords, 3);
+   theHeaderSize+=3;
+   readDataExtSegInfoRecords(in);
+   
+   // Reserve Extension Segment group
+   in.read(theNumberOfResExtSegInfoRecords, 3);
+   theHeaderSize+=3;
+   readResExtSegInfoRecords(in);
+   
+   in.read(theUserDefinedHeaderDataLength, 5);
+   theHeaderSize+=5;
+   
+   theTagList.clear();
+   // only get the header overflow if there even exists
+   // user defined data.
+   ossim_int32 userDefinedHeaderLength = ossimString(theUserDefinedHeaderDataLength).toInt32();
+   
+   ossimNitfTagInformation headerTag;
+   
+   std::streampos start   = in.tellg();
+   std::streampos current = in.tellg();
+
+   theHeaderSize+=userDefinedHeaderLength;
+   if(userDefinedHeaderLength > 0)
+   {
+      in.read(theUserDefinedHeaderOverflow, 3);
+      
+      current = in.tellg();
+      while((current - start) < userDefinedHeaderLength)
+      {
+         headerTag.parseStream(in);
+         headerTag.setTagType("UDHD");
+         theTagList.push_back(headerTag);
+         // in.ignore(headerTag.getTagLength());
+         // headerTag.clearFields();
+
+         //---
+         // We will check the stream here as there have been instances of
+         // rpf's with bad stream offsets.
+         //---
+         if (!in)
+         {
+            std::string e =
+               "ossimNitfFileHeaderV2_0::parseStream stream error!";
+            throw ossimException(e);
+         }
+
+         current = in.tellg();
+      }
+   }
+   in.read(theExtendedHeaderDataLength, 5);
+   theHeaderSize+=5;
+   ossim_int32 extendedHeaderDataLength = ossimString(theExtendedHeaderDataLength).toInt32();
+   theHeaderSize+=extendedHeaderDataLength;
+   
+   start   = in.tellg();
+   current = in.tellg();
+   // for now let's just ignore it
+   if(extendedHeaderDataLength > 0)
+   {
+      in.read(theExtendedHeaderOverflow, 3);
+      current = in.tellg();
+     
+      while((current - start) < extendedHeaderDataLength)
+      {
+         headerTag.parseStream(in);
+         headerTag.setTagType("XHD");
+         theTagList.push_back(headerTag);
+         in.ignore(headerTag.getTagLength());
+         headerTag.clearFields();
+         current = in.tellg();
+      }
+   }
+   
+   // this need to be re-thought
+   initializeAllOffsets();
+   readOverflowTags(in);
+
+   if(traceDebug())
+   {
+      ossimNitfFileHeader::print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimNitfFileHeaderV2_0::parseStream:   Leaving......."
+         << std::endl;
+   }
+//      initializeDisplayLevels(in);
+
+}
+
+void ossimNitfFileHeaderV2_0::readOverflowTags(ossim::istream& in)
+{
+   ossim_int32 overflow = ossimString(theUserDefinedHeaderOverflow).toInt32();
+   if (overflow != 0)
+   {
+      ossimRefPtr<ossimNitfDataExtensionSegment> des = getNewDataExtensionSegment(overflow-1, in);
+      if (des.valid())
+      {
+         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
+         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); 
+              iter != desTags.end(); 
+              ++iter)
+         {
+            iter->setTagType("UDHD");
+            theTagList.push_back(*iter);
+         }
+         des = 0;
+      }
+   }
+
+   overflow = ossimString(theExtendedHeaderOverflow).toInt32();
+   if (overflow != 0)
+   {
+      ossimRefPtr<ossimNitfDataExtensionSegment> des = getNewDataExtensionSegment(overflow-1, in);
+      if (des.valid())
+      {
+         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
+         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
+         {
+            iter->setTagType("XHD");
+            theTagList.push_back(*iter);
+         }
+         des = 0;
+
+      }
+   }
+}
+
+void ossimNitfFileHeaderV2_0::writeStream(ossim::ostream& out)
+{
+   // identification and origination group
+   out.write(theFileTypeVersion, 9);
+   out.write(theComplexityLevel, 2);
+   out.write(theSystemType, 4);
+   out.write(theOriginatingStationId, 10);
+   out.write(theDateTime, 14);
+   out.write(theFileTitle, 80);
+   
+   // read security group
+   out.write(theSecurityClassification, 1);
+   out.write(theCodewords, 40);
+   out.write(theControlAndHandling, 40);
+   out.write(theReleasingInstructions, 40);
+   out.write(theClassificationAuthority, 20);
+   out.write(theSecurityControlNumber, 20);
+   out.write(theSecurityDowngrade, 6);
+   if(ossimString(theSecurityDowngrade) == "999998")
+   {
+      out.write(theDowngradingEvent, 40);
+   }      
+   out.write(theCopyNumber, 5);
+   out.write(theNumberOfCopies, 5);
+   out.write(theEncryption, 1);
+   out.write(theOriginatorsName, 27);
+   out.write(theOriginatorsPhone, 18);
+   
+   out.write(theFileLength, 12);
+   out.write(theHeaderLength, 6);   
+   ossim_uint32 idx = 0;
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << theNitfImageInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      
+      for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfImageInfoRecords[idx].theImageSubheaderLength, 6);
+         out.write(theNitfImageInfoRecords[idx].theImageLength, 10);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << theNitfSymbolInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      
+      for(idx = 0; idx < theNitfSymbolInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfSymbolInfoRecords[idx].theSymbolSubheaderLength, 4);
+         out.write(theNitfSymbolInfoRecords[idx].theSymbolLength, 6);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << theNitfLabelInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      
+      for(idx = 0; idx < theNitfLabelInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfLabelInfoRecords[idx].theLabelSubheaderLength, 4);
+         out.write(theNitfLabelInfoRecords[idx].theLabelLength, 3);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << theNitfTextInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      
+      for(idx = 0; idx < theNitfTextInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfTextInfoRecords[idx].theTextSubheaderLength, 4);
+         out.write(theNitfTextInfoRecords[idx].theTextLength, 5);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << theNitfDataExtSegInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      
+      for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegSubheaderLength, 4);
+         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegLength, 9);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << theNitfResExtSegInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      
+      for(idx = 0; idx < theNitfResExtSegInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegSubheaderLength, 4);
+         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegLength, 7);
+      }
+   }
+   out.write(theUserDefinedHeaderDataLength, 5);
+   if(ossimString(theUserDefinedHeaderDataLength).toInt32() > 0)
+   {
+      out.write(theUserDefinedHeaderOverflow, 3);
+   }
+   ossim_uint32 totalLength = getTotalTagLength();
+   if(totalLength <= 99999)
+   {
+      std::ostringstream tempOut;
+      
+      tempOut << std::setw(5)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << totalLength;
+      
+      memcpy(theExtendedHeaderDataLength, tempOut.str().c_str(), 5);
+      
+      out.write(theExtendedHeaderDataLength, 5);
+      
+      // for now we hard code te 000 for we do not currently support writing to the DES if the total tag length is
+      // larger than supported
+      //
+      memset(theExtendedHeaderOverflow, '0', 3);
+      if(totalLength > 0)
+      {
+         ossim_uint32 i = 0;
+         out.write(theExtendedHeaderOverflow, 3);
+         
+         for(i = 0; i < theTagList.size(); ++i)
+         {
+            theTagList[i].writeStream(out);
+         }
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_0::writeStream: Only support writing of total tag length < 99999" << std::endl;
+   }
+}
+
+std::ostream& ossimNitfFileHeaderV2_0::print(std::ostream& out,
+                                             const std::string& prefix) const
+{
+   out << setiosflags(std::ios::left)
+       << prefix << std::setw(24) << "FHDR:"
+       << theFileTypeVersion << "\n"
+       << prefix << std::setw(24) << "CLEVEL:"
+       << theComplexityLevel << "\n"
+       << prefix << std::setw(24) << "STYPE:"
+       << theSystemType  << "\n"    
+       << prefix << std::setw(24) << "OSTAID:"
+       << theOriginatingStationId << "\n"
+       << prefix << std::setw(24) << "FDT:"
+       << theDateTime  << "\n"      
+       << prefix << std::setw(24) << "FTITLE:"
+       << theFileTitle  << "\n"     
+       << prefix << std::setw(24) << "FSCLAS:"
+       << theSecurityClassification << "\n"
+       << prefix << std::setw(24) << "FSCODE:"
+       << theCodewords << "\n"
+       << prefix << std::setw(24) << "FSCTLH:"
+       << theControlAndHandling << "\n"
+       << prefix << std::setw(24) << "FSREL:"
+       << theReleasingInstructions << "\n"
+       << prefix << std::setw(24) << "FSCAUT:"
+       << theClassificationAuthority << "\n"
+       << prefix << std::setw(24) << "FSCTLN:"
+       << theSecurityControlNumber << "\n"
+       << prefix << std::setw(24) << "FSDWNG:"
+       << theSecurityDowngrade << "\n"
+       << prefix << std::setw(24) << "FSDEVT:"
+       << theDowngradingEvent << "\n"
+       << prefix << std::setw(24) << "FSCOP:"
+       << theCopyNumber << "\n"
+       << prefix << std::setw(24) << "FSCPYS:"
+       << theNumberOfCopies << "\n"
+       << prefix << std::setw(24) << "ENCRYP:"
+       << theEncryption << "\n"
+       << prefix << std::setw(24) << "ONAME:"
+       << theOriginatorsName << "\n"
+       << prefix << std::setw(24) << "OPHONE:"
+       << theOriginatorsPhone << "\n"
+       << prefix << std::setw(24) << "FL:"
+       << theFileLength << "\n"
+       << prefix << std::setw(24) << "HL:"
+       << theHeaderLength << "\n"
+       << prefix << std::setw(24) << "NUMI:"
+       << theNumberOfImageInfoRecords << "\n";
+
+   ossim_uint32 index;
+   
+   for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+      
+      ossimString tmpStr = "LISH";
+      tmpStr += os.str();
+      
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
+      tmpStr = "LI";
+      tmpStr += os.str();
+      
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfImageInfoRecords[index].theImageLength << "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMS:" << theNumberOfSymbolInfoRecords
+       << "\n";
+
+   for (index = 0; index < theNitfSymbolInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LSSH";
+      tmpStr += os.str();
+
+      out << tmpStr
+          << theNitfSymbolInfoRecords[index].theSymbolSubheaderLength << "\n";
+
+      tmpStr = "LS";
+      tmpStr += os.str();
+
+      out << tmpStr 
+          << theNitfSymbolInfoRecords[index].theSymbolLength << "\n";
+   }
+
+   
+   out << prefix << std::setw(24) << "NUML:" << theNumberOfLabelInfoRecords
+       << "\n";
+
+   for (index = 0; index < theNitfLabelInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LLSH";
+      tmpStr += os.str();
+
+      out << tmpStr
+          << theNitfLabelInfoRecords[index].theLabelSubheaderLength  << "\n";
+
+      tmpStr = "LL";
+      tmpStr += os.str();
+
+      out << tmpStr 
+          << theNitfLabelInfoRecords[index].theLabelLength << "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMT:" << theNumberOfTextFileInfoRecords
+       << "\n";
+
+   for (index = 0; index < theNitfTextInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LTSH";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfTextInfoRecords[index].theTextSubheaderLength << "\n";
+
+      tmpStr = "LT";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr 
+          << theNitfTextInfoRecords[index].theTextLength<< "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMDES:"
+       << theNumberOfDataExtSegInfoRecords << "\n";
+
+   for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LDSH";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
+          << "\n";
+
+      tmpStr = "LD";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr 
+          << theNitfDataExtSegInfoRecords[index].theDataExtSegLength << "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMRES:"
+       << theNumberOfResExtSegInfoRecords << "\n";
+
+   for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LRSH";
+      tmpStr += os.str();
+
+      out << tmpStr
+          << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
+          << "\n";
+
+      tmpStr = "LR";
+      tmpStr += os.str();
+
+      out << tmpStr 
+          << theNitfResExtSegInfoRecords[index].theResExtSegLength
+          << "\n";
+   }
+
+   out << prefix << std::setw(24) << "UDHDL:"
+       << theUserDefinedHeaderDataLength << "\n"
+       << prefix << std::setw(24) << "UDHOFL:"
+       << theUserDefinedHeaderOverflow << "\n"
+       << prefix << std::setw(24) << "XHDL:"
+       << theExtendedHeaderDataLength << "\n";
+   
+   return ossimNitfFileHeader::print(out, prefix);
+}
+
+
+bool ossimNitfFileHeaderV2_0::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = ossimNitfFileHeaderV2_X::saveState(kwl, prefix);
+   
+   if(result)
+   {
+      kwl.add(prefix, "FSCODE",theCodewords);
+      kwl.add(prefix, "FSCTLH",theControlAndHandling);
+      kwl.add(prefix, "FSREL",theReleasingInstructions);
+      kwl.add(prefix, "FSCAUT",theClassificationAuthority);
+      kwl.add(prefix, "FSCTLN",theSecurityControlNumber);
+      kwl.add(prefix, "FSDWNG",theSecurityDowngrade);
+      kwl.add(prefix, "FSDEVT",theDowngradingEvent);
+      kwl.add(prefix, "ONAME",theOriginatorsName);
+      kwl.add(prefix, "OPHONE",theOriginatorsPhone);
+      kwl.add(prefix, "FL",theFileLength);
+      kwl.add(prefix, "HL",theHeaderLength);
+      kwl.add(prefix, "NUMI",theNumberOfImageInfoRecords);
+      kwl.add(prefix, "UDHDL",theUserDefinedHeaderDataLength);
+      kwl.add(prefix, "UDHOFL",theUserDefinedHeaderDataLength);
+      kwl.add(prefix, "XHDL",theExtendedHeaderDataLength);
+
+      std::ostringstream out;
+      ossim_uint32 index;
+      for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
+      {
+         std::ostringstream os;
+         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+         
+         ossimString tmpStr = "LISH";
+         tmpStr += os.str();
+         
+         out << tmpStr
+         << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
+         tmpStr = "LI";
+         tmpStr += os.str();
+         
+         out << tmpStr
+         << theNitfImageInfoRecords[index].theImageLength << "\n";
+      }
+      
+      out <<"NUMS:" << theNumberOfSymbolInfoRecords
+      << "\n";
+      
+      for (index = 0; index < theNitfSymbolInfoRecords.size(); ++index)
+      {
+         std::ostringstream os;
+         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+         
+         ossimString tmpStr = "LSSH";
+         tmpStr += os.str();
+         
+         out << tmpStr
+         << theNitfSymbolInfoRecords[index].theSymbolSubheaderLength << "\n";
+         
+         tmpStr = "LS";
+         tmpStr += os.str();
+         
+         out << tmpStr 
+         << theNitfSymbolInfoRecords[index].theSymbolLength << "\n";
+      }
+      
+      
+      out << "NUML:" << theNumberOfLabelInfoRecords
+      << "\n";
+      
+      for (index = 0; index < theNitfLabelInfoRecords.size(); ++index)
+      {
+         std::ostringstream os;
+         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+         
+         ossimString tmpStr = "LLSH";
+         tmpStr += os.str();
+         
+         out << tmpStr
+         << theNitfLabelInfoRecords[index].theLabelSubheaderLength  << "\n";
+         
+         tmpStr = "LL";
+         tmpStr += os.str();
+         
+         out << tmpStr 
+         << theNitfLabelInfoRecords[index].theLabelLength << "\n";
+      }
+      
+      out << "NUMT:" << theNumberOfTextFileInfoRecords
+      << "\n";
+      
+      for (index = 0; index < theNitfTextInfoRecords.size(); ++index)
+      {
+         std::ostringstream os;
+         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+         
+         ossimString tmpStr = "LTSH";
+         tmpStr += os.str();
+         
+         out << tmpStr
+         << theNitfTextInfoRecords[index].theTextSubheaderLength << "\n";
+         
+         tmpStr = "LT";
+         tmpStr += os.str();
+         
+         out << tmpStr 
+         << theNitfTextInfoRecords[index].theTextLength<< "\n";
+      }
+      
+      out << "NUMDES:"
+      << theNumberOfDataExtSegInfoRecords << "\n";
+      
+      for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
+      {
+         std::ostringstream os;
+         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+         
+         ossimString tmpStr = "LDSH";
+         tmpStr += os.str();
+         
+         out << tmpStr
+         << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
+         << "\n";
+         
+         tmpStr = "LD";
+         tmpStr += os.str();
+         
+         out << tmpStr 
+         << theNitfDataExtSegInfoRecords[index].theDataExtSegLength << "\n";
+      }
+      
+      out << "NUMRES:"
+      << theNumberOfResExtSegInfoRecords << "\n";
+      
+      for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
+      {
+         std::ostringstream os;
+         os << std::setw(3) << std::setfill('0') << (index+1) << ":";
+         
+         ossimString tmpStr = "LRSH";
+         tmpStr += os.str();
+         
+         out << tmpStr
+         << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
+         << "\n";
+         
+         tmpStr = "LR";
+         tmpStr += os.str();
+         
+         out << tmpStr 
+         << theNitfResExtSegInfoRecords[index].theResExtSegLength
+         << "\n";
+      }
+      
+      {
+         std::istringstream in(out.str());
+         ossimKeywordlist tempKwl;
+         if(tempKwl.parseStream(in))
+         {
+            result = true;
+            kwl.add(prefix, tempKwl);
+         }
+      }
+   }
+   
+   return result;
+}
+
+ossimDrect ossimNitfFileHeaderV2_0::getImageRect()const
+{
+   return theImageRect;
+}
+
+void ossimNitfFileHeaderV2_0::addImageInfoRecord(const ossimNitfImageInfoRecordV2_0& recordInfo)
+{
+   theNitfImageInfoRecords.push_back(recordInfo);
+   
+   setNumberOfImageInfoRecords(theNitfImageInfoRecords.size());
+}
+
+void ossimNitfFileHeaderV2_0::replaceImageInfoRecord(ossim_uint32 i, const ossimNitfImageInfoRecordV2_0& recordInfo)
+{
+   theNitfImageInfoRecords[i]=recordInfo;
+}
+
+ossimNitfImageHeader*
+ossimNitfFileHeaderV2_0::getNewImageHeader(ossim_uint32 imageNumber,
+                                           ossim::istream& in)const
+{
+   ossimNitfImageHeader *result = 0;
+   
+   if( (getNumberOfImages() > 0) && (imageNumber < theImageOffsetList.size()) )
+   {
+      result = allocateImageHeader();
+      in.seekg(theImageOffsetList[imageNumber].theImageHeaderOffset, std::ios::beg);
+      result->parseStream(in);
+   }
+   else
+   {
+#if 0
+      ossimNotify(ossimNotifyLevel_FATAL) << "ossimNitfFileHeaderV2_0::getNewImageHeader ERROR:"
+                                          << "\nNo images in file or image number (" << imageNumber
+                                          << ") is out of range!\n";
+#endif
+   }
+   
+   return result;
+}
+
+ossimNitfSymbolHeader *ossimNitfFileHeaderV2_0::getNewSymbolHeader(
+   ossim_uint32 symbolNumber, ossim::istream& in)const
+{
+   ossimNitfSymbolHeader *result = 0;
+
+   if( (getNumberOfSymbols() > 0) &&
+       (symbolNumber < theSymbolOffsetList.size()) )
+   {
+      result = allocateSymbolHeader();
+      in.seekg(theSymbolOffsetList[symbolNumber].theSymbolHeaderOffset, std::ios::beg);
+      result->parseStream(in);
+   }
+   
+   return result;
+}
+
+ossimNitfLabelHeader *ossimNitfFileHeaderV2_0::getNewLabelHeader(
+   ossim_uint32 labelNumber, ossim::istream& in)const
+{
+   ossimNitfLabelHeader *result = 0;
+
+   if( (getNumberOfLabels() > 0) &&
+       (labelNumber < theLabelOffsetList.size()) )
+   {
+      result = allocateLabelHeader();
+      in.seekg(theLabelOffsetList[labelNumber].theLabelHeaderOffset, std::ios::beg);
+      result->parseStream(in);
+   }
+   
+   return result;
+}
+
+ossimNitfTextHeader *ossimNitfFileHeaderV2_0::getNewTextHeader(
+   ossim_uint32 textNumber, ossim::istream& in)const
+{
+   ossimNitfTextHeader *result = 0;
+
+   if( (getNumberOfTextSegments() > 0) &&
+       (textNumber < theTextOffsetList.size()) )
+   {
+      result = allocateTextHeader();
+      in.seekg(theTextOffsetList[textNumber].theTextHeaderOffset, std::ios::beg);
+      result->parseStream(in);
+   }
+   
+   return result;
+}
+
+ossimNitfDataExtensionSegment* ossimNitfFileHeaderV2_0::getNewDataExtensionSegment(ossim_int32 dataExtNumber,
+                                                                                   ossim::istream& in)const
+{
+   ossimNitfDataExtensionSegment *result = 0;
+
+   if((getNumberOfDataExtSegments() > 0) &&
+      (dataExtNumber < (ossim_int32)theNitfDataExtSegInfoRecords.size()) &&
+      (dataExtNumber >= 0))
+   {
+      result = allocateDataExtSegment();
+      in.seekg(theDataExtSegOffsetList[dataExtNumber].theDataExtSegHeaderOffset, std::ios::beg);
+      result->parseStream(in, theNitfDataExtSegInfoRecords[dataExtNumber].getImageLength());
+   }
+   
+   return result;
+}
+
+void ossimNitfFileHeaderV2_0::initializeDisplayLevels(ossim::istream& in)
+{
+   // we will need to temporarily save the get pointer since
+   // initializeDisplayLevels changes it.
+   std::streampos saveTheGetPointer = in.tellg();
+   
+   std::vector<ossimNitfImageOffsetInformation>::iterator imageOffsetList = theImageOffsetList.begin();
+
+   // allocate temporary space to store image headers
+   ossimNitfImageHeader* imageHeader = allocateImageHeader();
+
+   // clear the list
+   theDisplayInformationList.clear();
+   
+   theImageRect = ossimDrect(0,0,0,0);
+   if(!imageHeader)
+   {
+      return;
+   }
+   
+   ossim_uint32 idx = 0;
+   while(imageOffsetList != theImageOffsetList.end())
+   {
+      // position the get pointer in the input
+      // stream to the start of the image header
+      in.seekg((*imageOffsetList).theImageHeaderOffset, std::ios::beg);
+      // get the data
+      imageHeader->parseStream(in);
+      // create a union of rects.  The result should be the image rect.
+      ossimDrect tempRect = imageHeader->getImageRect();
+      if((tempRect.width() > 1) &&
+         (tempRect.height() > 1))
+      {
+         theImageRect = theImageRect.combine(tempRect);
+      }
+      
+      insertIntoDisplayInfoList(ossimNitfDisplayInfo(ossimString("IM"),
+                                                     imageHeader->getDisplayLevel(),
+                                                     idx));
+      
+      ++imageOffsetList;
+      ++idx;                                       
+   }
+   delete imageHeader;
+   imageHeader = 0;
+
+
+   
+   // finally we reset the saved get state back
+   // to its original position
+   in.seekg(saveTheGetPointer, std::ios::beg);
+}
+
+void ossimNitfFileHeaderV2_0::insertIntoDisplayInfoList(const ossimNitfDisplayInfo &displayInformation)
+{
+   std::vector<ossimNitfDisplayInfo>::iterator displayList = theDisplayInformationList.begin();
+
+   while(displayList != theDisplayInformationList.end())
+   {
+      if(displayInformation.theDisplayLevel < (*displayList).theDisplayLevel)
+      {
+         theDisplayInformationList.insert(displayList, displayInformation);
+         return;
+      }
+      ++displayList;
+   }
+
+   // If we get here it means it's larger than all others
+   // and we push onto the end
+   theDisplayInformationList.push_back(displayInformation);
+}
+
+void ossimNitfFileHeaderV2_0::initializeAllOffsets()
+{
+   // this will be a running tally 
+   ossim_uint64 tally = theHeaderSize;
+   ossim_uint32 idx = 0;
+
+   // clear out all offset inforamtion and begin populating them
+   theImageOffsetList.clear();
+   theSymbolOffsetList.clear();
+   theLabelOffsetList.clear();
+   theLabelOffsetList.clear();
+   
+
+   for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
+   {
+      theImageOffsetList.push_back(ossimNitfImageOffsetInformation(tally,
+                                                                   tally + theNitfImageInfoRecords[idx].getHeaderLength()));
+      tally += theNitfImageInfoRecords[idx].getTotalLength();
+   }
+   for(idx = 0; idx < theNitfSymbolInfoRecords.size(); ++idx)
+   {
+      theSymbolOffsetList.push_back(ossimNitfSymbolOffsetInformation(tally,
+                                                                     tally + theNitfSymbolInfoRecords[idx].getHeaderLength()));
+      tally += theNitfSymbolInfoRecords[idx].getTotalLength();
+   }
+
+   for(idx = 0; idx < theNitfLabelInfoRecords.size(); ++idx)
+   {
+      theLabelOffsetList.push_back(ossimNitfLabelOffsetInformation(tally,
+                                                                   tally + theNitfLabelInfoRecords[idx].getHeaderLength()));
+      tally += theNitfLabelInfoRecords[idx].getTotalLength();
+   }
+
+   for(idx = 0; idx < theNitfTextInfoRecords.size(); ++idx)
+   {
+      theTextOffsetList.push_back(ossimNitfTextOffsetInformation(tally,
+                                                                 tally + theNitfTextInfoRecords[idx].getHeaderLength()));
+      tally += theNitfTextInfoRecords[idx].getTotalLength();
+   }
+
+   for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
+   {
+      theDataExtSegOffsetList.push_back(ossimNitfDataExtSegOffsetInformation(tally,
+                                                                             tally + theNitfDataExtSegInfoRecords[idx].getHeaderLength()));
+      tally += theNitfDataExtSegInfoRecords[idx].getTotalLength();
+   }
+}
+
+ossimNitfImageHeader *ossimNitfFileHeaderV2_0::allocateImageHeader()const
+{
+   return new ossimNitfImageHeaderV2_0;
+}
+
+ossimNitfSymbolHeader *ossimNitfFileHeaderV2_0::allocateSymbolHeader()const
+{
+   return new ossimNitfSymbolHeaderV2_0;
+}
+
+ossimNitfLabelHeader *ossimNitfFileHeaderV2_0::allocateLabelHeader()const
+{
+   return new ossimNitfLabelHeaderV2_0;
+}
+
+ossimNitfTextHeader *ossimNitfFileHeaderV2_0::allocateTextHeader()const
+{
+   return new ossimNitfTextHeaderV2_0;
+}
+
+ossimNitfDataExtensionSegment* ossimNitfFileHeaderV2_0::allocateDataExtSegment()const
+{
+   return new ossimNitfDataExtensionSegmentV2_0();
+}
+
+bool ossimNitfFileHeaderV2_0::isEncrypted()const
+{
+   return (theEncryption[0] == '1');
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfImages()const
+{
+   return (ossim_int32)theNitfImageInfoRecords.size();
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfLabels()const
+{
+   return ((ossim_int32)theNitfLabelInfoRecords.size());
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfSymbols()const
+{
+   return ((ossim_int32)theNitfSymbolInfoRecords.size());
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfGraphics()const
+{
+   return 0;
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfTextSegments()const
+{
+   return (ossim_int32)theNitfTextInfoRecords.size();
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfDataExtSegments()const
+{
+   return (ossim_int32)theNitfDataExtSegInfoRecords.size();
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getHeaderSize()const
+{
+   return theHeaderSize;
+}
+
+ossim_int32 ossimNitfFileHeaderV2_0::getNumberOfReservedExtSegments()const
+{
+   return theNitfResExtSegInfoRecords.size();
+}
+
+ossim_int64 ossimNitfFileHeaderV2_0::getFileSize()const
+{
+   ossimString temp = theFileLength;
+   if(temp == "999999999999")
+   {
+      return -1;
+   }
+   else
+   {
+      return temp.toInt64();
+   }
+}
+
+const char* ossimNitfFileHeaderV2_0::getVersion()const
+{
+   return &theFileTypeVersion[4];
+}
+
+const char* ossimNitfFileHeaderV2_0::getDateTime()const
+{
+   return theDateTime;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getSecurityClassification()const
+{
+   return theSecurityClassification;
+}
+
+void ossimNitfFileHeaderV2_0::clearFields()
+{
+   theDisplayInformationList.clear();
+   theImageOffsetList.clear();
+   theSymbolOffsetList.clear();
+   theLabelOffsetList.clear();
+   theTextOffsetList.clear();
+   theDataExtSegOffsetList.clear();
+   theNitfSymbolInfoRecords.clear();
+   theNitfLabelInfoRecords.clear();
+   theNitfTextInfoRecords.clear();
+   theNitfDataExtSegInfoRecords.clear();
+   theNitfResExtSegInfoRecords.clear();
+   
+   theFilename = "";
+   memcpy(theFileTypeVersion, "NITF02.00", 9);
+   memset(theComplexityLevel, ' ', 2);
+   memset(theSystemType, ' ', 4);
+   memset(theOriginatingStationId, ' ', 10);
+   memset(theDateTime, ' ', 14);
+   memset(theFileTitle, ' ', 80);
+   memset(theSecurityClassification, ' ', 1);
+   memset(theCodewords, ' ', 40);
+   memset(theControlAndHandling, ' ', 40);
+   memset(theReleasingInstructions, ' ', 40);
+   memset(theClassificationAuthority, ' ', 20);
+   memset(theSecurityControlNumber, ' ', 20);
+   memset(theSecurityDowngrade, ' ', 6);
+   memset(theDowngradingEvent, ' ', 40);
+   memset(theCopyNumber, ' ', 5);
+   memset(theNumberOfCopies, ' ', 5);
+   memset(theEncryption, ' ', 1);
+   memset(theOriginatorsName, ' ', 27);
+   memset(theOriginatorsPhone, ' ', 18);
+   memset(theFileLength, ' ', 12);
+   memset(theHeaderLength, ' ', 6);
+   memset(theNumberOfImageInfoRecords, ' ', 3);
+   memset(theNumberOfSymbolInfoRecords, ' ', 3);
+   memset(theNumberOfLabelInfoRecords, ' ', 3);
+   memset(theNumberOfTextFileInfoRecords, ' ', 3);
+   memset(theNumberOfDataExtSegInfoRecords, ' ', 3);
+   memset(theNumberOfResExtSegInfoRecords, ' ', 3);
+   memset(theUserDefinedHeaderDataLength, '0', 5);
+   memset(theUserDefinedHeaderOverflow, ' ', 3);
+   memset(theExtendedHeaderDataLength, '0', 5);
+   memset(theExtendedHeaderOverflow, ' ', 3);
+   
+   theFileTypeVersion[9] = '\0';
+   theComplexityLevel[2] = '\0';
+   theSystemType[4]      = '\0';
+   theOriginatingStationId[10] = '\0';
+   theDateTime[14]       = '\0';
+   theFileTitle[80]      = '\0';
+   theSecurityClassification[1] = '\0';
+   theCodewords[40] = '\0';
+   theControlAndHandling[40] = '\0';
+   theReleasingInstructions[40] = '\0';
+   theClassificationAuthority[20] = '\0';
+   theSecurityControlNumber[20] = '\0';
+   theSecurityDowngrade[6] = '\0';
+   theDowngradingEvent[40] = '\0';
+   theCopyNumber[5] = '\0';
+   theNumberOfCopies[5] = '\0';
+   theEncryption[1] = '\0';
+   theOriginatorsName[27] = '\0';
+   theOriginatorsPhone[18] = '\0';
+   theFileLength[12]  = '\0';
+   theHeaderLength[6] = '\0';
+   theNumberOfImageInfoRecords[3] = '\0';
+   theNumberOfSymbolInfoRecords[3] = '\0';
+   theNumberOfLabelInfoRecords[3] = '\0';
+   theNumberOfTextFileInfoRecords[3] = '\0';
+   theNumberOfDataExtSegInfoRecords[3] = '\0';
+   theNumberOfResExtSegInfoRecords[3] = '\0';
+   theUserDefinedHeaderDataLength[5] = '\0';
+   theUserDefinedHeaderOverflow[3] = '\0';
+   theExtendedHeaderDataLength[5] = '\0';
+   theExtendedHeaderOverflow[3] = '\0';
+   theHeaderSize = 0;
+}
+
+void ossimNitfFileHeaderV2_0::setNumberOfImageInfoRecords(ossim_uint64 num)
+{
+   if (num < 1000)
+   {
+      std::ostringstream out;
+      
+      out << std::setw(3)
+      << std::setfill('0')
+      << std::setiosflags(ios::right)
+      << num;
+      
+      memcpy(theNumberOfImageInfoRecords, out.str().c_str(), 3);
+   }
+   else
+   {
+      std::string s = "ossimNitfFileHeaderV2_0::setNumberOfImageInfoRecords:";
+      s += " ERROR\nExceeded max image info number of 999!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+}
+
+void ossimNitfFileHeaderV2_0::readImageInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfImages = ossimString(theNumberOfImageInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfImageInfoRecords.clear();
+   for(index=0; index < numberOfImages; index++)
+   {
+      ossimNitfImageInfoRecordV2_0 temp;
+      
+      in.read(temp.theImageSubheaderLength, 6);
+      in.read(temp.theImageLength, 10);
+      theHeaderSize+=16;
+      temp.theImageSubheaderLength[6] = '\0';
+      temp.theImageLength[10] = '\0';
+
+      theNitfImageInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_0::readSymbolInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfSymbols = ossimString(theNumberOfSymbolInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfSymbolInfoRecords.clear();
+   
+   for(index=0; index < numberOfSymbols; index++)
+   {
+      ossimNitfSymbolInfoRecordV2_0 temp;
+
+      
+      in.read(temp.theSymbolSubheaderLength, 4);
+      in.read(temp.theSymbolLength, 6);
+      theHeaderSize+=10;
+      
+      temp.theSymbolSubheaderLength[4] = '\0';
+      temp.theSymbolLength[6] = '\0';
+      
+      theNitfSymbolInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_0::readLabelInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfLabels = ossimString(theNumberOfLabelInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfLabelInfoRecords.clear();
+   
+   for(index=0; index < numberOfLabels; index++)
+   {
+      ossimNitfLabelInfoRecordV2_0 temp;
+      
+      in.read(temp.theLabelSubheaderLength, 4);
+      in.read(temp.theLabelLength, 3);
+      theHeaderSize+=7;
+      temp.theLabelSubheaderLength[4] = '\0';
+      temp.theLabelLength[3]          = '\0';
+
+      theNitfLabelInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_0::readTextFileInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfTextFiles = ossimString(theNumberOfTextFileInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfTextInfoRecords.clear();
+   for(index=0; index < numberOfTextFiles; index++)
+   {
+      ossimNitfTextInfoRecordV2_0 temp;
+      
+      in.read(temp.theTextSubheaderLength, 4);
+      in.read(temp.theTextLength, 5);
+      theHeaderSize+=9;
+      
+      temp.theTextSubheaderLength[4] = '\0';
+      temp.theTextLength[5] = '\0';
+      
+      theNitfTextInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_0::readDataExtSegInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfDataExtSegs = ossimString(theNumberOfDataExtSegInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfDataExtSegInfoRecords.clear();
+   for(index=0; index < numberOfDataExtSegs; index++)
+   {
+      ossimNitfDataExtSegInfoRecordV2_0 temp;
+      
+      in.read(temp.theDataExtSegSubheaderLength, 4);
+      in.read(temp.theDataExtSegLength, 9);
+      theHeaderSize+=13;
+      
+      temp.theDataExtSegSubheaderLength[4] = '\0';
+      temp.theDataExtSegLength[9]          = '\0';
+
+      theNitfDataExtSegInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_0::readResExtSegInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfResExtSegs = ossimString(theNumberOfResExtSegInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfResExtSegInfoRecords.clear();
+   for(index=0; index < numberOfResExtSegs; index++)
+   {
+      ossimNitfResExtSegInfoRecordV2_0 temp;
+
+      in.read(temp.theResExtSegSubheaderLength, 4);
+      in.read(temp.theResExtSegLength, 7);
+      theHeaderSize+=11;
+      
+      temp.theResExtSegSubheaderLength[4] = '\0';
+      temp.theResExtSegLength[7]          = '\0';
+      
+      theNitfResExtSegInfoRecords.push_back(temp);      
+   }
+}
+
+void ossimNitfFileHeaderV2_0::setComplianceLevel(const ossimString& complianceLevel)
+{
+   ossimNitfCommon::setField(theComplexityLevel, complianceLevel, 2);
+}
+
+void ossimNitfFileHeaderV2_0::setCodeWords(const ossimString& codeWords)
+{
+   ossimNitfCommon::setField(theCodewords, codeWords, 40);
+}
+
+void ossimNitfFileHeaderV2_0::setControlAndHandling(const ossimString& controlAndHandling)
+{
+   ossimNitfCommon::setField(theControlAndHandling, controlAndHandling, 40);
+}
+
+void ossimNitfFileHeaderV2_0::setReleasingInstructions(const ossimString& releasingInstructions)
+{
+   ossimNitfCommon::setField(theReleasingInstructions, releasingInstructions, 40);
+}
+
+void ossimNitfFileHeaderV2_0::setClassificationAuthority(const ossimString& classAuth)
+{
+   ossimNitfCommon::setField(theClassificationAuthority, classAuth, 20);
+}
+
+void ossimNitfFileHeaderV2_0::setSecurityControlNumber(const ossimString& controlNo)
+{
+   ossimNitfCommon::setField(theSecurityControlNumber, controlNo, 20);
+}
+
+void ossimNitfFileHeaderV2_0::setOriginatorsName(const ossimString& originatorName)
+{
+   ossimNitfCommon::setField(theOriginatorsName, originatorName, 27);
+}
+
+void ossimNitfFileHeaderV2_0::setOriginatorsPhone(const ossimString& originatorPhone)
+{
+   ossimNitfCommon::setField(theOriginatorsPhone, originatorPhone, 18);
+}
+
+void ossimNitfFileHeaderV2_0::setSecurityDowngrade(const ossimString& securityDowngrade)
+{
+   ossimNitfCommon::setField(theSecurityDowngrade, securityDowngrade, 6);
+}
+
+void ossimNitfFileHeaderV2_0::setDowngradingEvent(const ossimString& downgradeEvent)
+{
+   ossimNitfCommon::setField(theDowngradingEvent, downgradeEvent, 40);
+}
+
+void ossimNitfFileHeaderV2_0::setFileLength(ossim_uint64 fileLength)
+{
+   std::ostringstream out;
+   
+   out << std::setw(12)
+   << std::setfill('0')
+   << std::setiosflags(ios::right)
+   << fileLength;
+   
+   memcpy(theFileLength, out.str().c_str(), 12);
+}
+
+void ossimNitfFileHeaderV2_0::setHeaderLength(ossim_uint64 headerLength)
+{
+   std::ostringstream out;
+   
+   out << std::setw(6)
+   << std::setfill('0')
+   << std::setiosflags(ios::right)
+   << headerLength;
+   
+   memcpy(theHeaderLength, out.str().c_str(), 6);
+}
+
+ossimString ossimNitfFileHeaderV2_0::getComplianceLevel()const
+{
+   return theComplexityLevel;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getSecurityDowngrade()const
+{
+   return theSecurityDowngrade;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getDowngradingEvent()const
+{
+   return theDowngradingEvent;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getCodeWords()const
+{
+   return theCodewords;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getControlAndHandling()const
+{
+   return theControlAndHandling;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getReleasingInstructions()const
+{
+   return theReleasingInstructions;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getClassificationAuthority()const
+{
+   return theClassificationAuthority;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getSecurityControlNumber()const
+{
+   return theSecurityControlNumber;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getOriginatorsName()const
+{
+   return theOriginatorsName;
+}
+
+ossimString ossimNitfFileHeaderV2_0::getOriginatorsPhone()const
+{
+   return theOriginatorsPhone;
+}
+
+void ossimNitfFileHeaderV2_0::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   const ossimString& name = property->getName();
+   if(name == CLEVEL_KW)
+   {
+      setComplianceLevel(property->valueToString());
+   }
+   else if(name == FSDWNG_KW)
+   {
+      setSecurityDowngrade(property->valueToString());
+   }
+   else if(name == FSDEVT_KW)
+   {
+      setDowngradingEvent(property->valueToString());
+   }
+   else if(name == ONAME_KW)
+   {
+      setOriginatorsName(property->valueToString());
+   }
+   else if(name == OPHONE_KW)
+   {
+      setOriginatorsPhone(property->valueToString());
+   }
+   else
+   {
+      ossimNitfFileHeaderV2_X::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitfFileHeaderV2_0::getProperty(const ossimString& name)const
+{
+   ossimProperty* property = 0;
+
+	
+   if(name == CLEVEL_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theComplexityLevel).trim());
+   }
+   else if(name == FSDWNG_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theSecurityDowngrade).trim());
+   }
+   else if(name == FSDEVT_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theDowngradingEvent).trim());
+   }
+   else if(name == ONAME_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theOriginatorsName).trim());
+   }
+   else if(name == OPHONE_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theOriginatorsPhone).trim());
+   }
+   else
+   {
+      return ossimNitfFileHeaderV2_X::getProperty(name);
+   }
+   return property;
+}
+
+void ossimNitfFileHeaderV2_0::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfFileHeaderV2_X::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(CLEVEL_KW);
+   propertyNames.push_back(STYPE_KW);
+   propertyNames.push_back(OSTAID_KW);
+   propertyNames.push_back(FDT_KW);
+   propertyNames.push_back(FTITLE_KW);
+   propertyNames.push_back(FSCLAS_KW);
+   propertyNames.push_back(FSCODE_KW);
+   propertyNames.push_back(FSCTLH_KW);
+   propertyNames.push_back(FSREL_KW);
+   propertyNames.push_back(FSCAUT_KW);
+   propertyNames.push_back(FSCTLN_KW);
+   propertyNames.push_back(FSCOP_KW);
+   propertyNames.push_back(FSCPYS_KW);
+   propertyNames.push_back(ENCRYP_KW);
+   propertyNames.push_back(ONAME_KW);
+   propertyNames.push_back(OPHONE_KW);
+}
+
diff --git a/src/support_data/ossimNitfFileHeaderV2_1.cpp b/src/support_data/ossimNitfFileHeaderV2_1.cpp
new file mode 100644
index 0000000..fcf2c35
--- /dev/null
+++ b/src/support_data/ossimNitfFileHeaderV2_1.cpp
@@ -0,0 +1,2188 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfTextHeaderV2_0.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimColorProperty.h>
+#include <ossim/base/ossimDateProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
+#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h> // ??? drb
+
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <cstring> // for memset
+
+RTTI_DEF1(ossimNitfFileHeaderV2_1,
+          "ossimNitfFileHeaderV2_1",
+          ossimNitfFileHeaderV2_X)
+
+const ossimString ossimNitfFileHeaderV2_1::FSCLSY_KW  = "FSCLSY";
+const ossimString ossimNitfFileHeaderV2_1::FSDCTP_KW  = "FSDCTP";
+const ossimString ossimNitfFileHeaderV2_1::FSDCDT_KW  = "FSDCDT";
+const ossimString ossimNitfFileHeaderV2_1::FSDCXM_KW  = "FSDCXM";
+const ossimString ossimNitfFileHeaderV2_1::FSDG_KW    = "FSDG";
+const ossimString ossimNitfFileHeaderV2_1::FSDGDT_KW  = "FSDGDT";
+const ossimString ossimNitfFileHeaderV2_1::FSCLTX_KW  = "FSCLTX";
+const ossimString ossimNitfFileHeaderV2_1::FSCATP_KW  = "FSCATP";
+const ossimString ossimNitfFileHeaderV2_1::FSCRSN_KW  = "FSCRSN";
+const ossimString ossimNitfFileHeaderV2_1::FSSRDT_KW  = "FSSRDT";
+const ossimString ossimNitfFileHeaderV2_1::FBKGC_KW   = "FBKGC";
+const ossimString FL_KW                               = "FL";
+const ossimString HL_KW                                      = "HL";
+const ossimString NUMI_KW    = "NUMI";
+
+static const
+ossimTrace traceDebug(ossimString("ossimNitfFileHeaderV2_1:debug"));
+   
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfImageInfoRecordV2_1 &data)
+{
+   return out << "theImageSubheaderLength:       "
+              << data.theImageSubheaderLength
+              << "\ntheImageLength:                "
+              << data.theImageLength
+              << std::endl;
+}
+
+ossim_uint64 ossimNitfImageInfoRecordV2_1::getHeaderLength()const
+{
+   return ossimString(theImageSubheaderLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfImageInfoRecordV2_1::getImageLength()const
+{
+   return ossimString(theImageLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfImageInfoRecordV2_1::getTotalLength()const
+{
+   return (getHeaderLength() + getImageLength());
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfGraphicInfoRecordV2_1 &data)
+{
+   return out << "theGraphicSubheaderLength:     "
+              << data.theGraphicSubheaderLength
+              << "\ntheGraphicLength:              "
+              << data.theGraphicLength
+              << std::endl;
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfTextFileInfoRecordV2_1 &data)
+{
+   return out << "theTextFileSubheaderLength:    "
+              << data.theTextFileSubheaderLength
+              << "\ntheTextFileLength:             "
+              << data.theTextFileLength
+              << std::endl;
+}
+ossim_uint64 ossimNitfGraphicInfoRecordV2_1::getHeaderLength()const
+{
+   return ossimString(theGraphicSubheaderLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfGraphicInfoRecordV2_1::getGraphicLength()const
+{
+   return ossimString(theGraphicLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfGraphicInfoRecordV2_1::getTotalLength()const
+{
+   return getGraphicLength() + getHeaderLength();
+}
+
+void ossimNitfTextFileInfoRecordV2_1::setSubheaderLength(ossim_uint64 length)
+{
+   std::ostringstream out;
+   
+   out << std::setw(4)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << length;
+   
+   memcpy(theTextFileSubheaderLength, out.str().c_str(), 4);
+   theTextFileSubheaderLength[4] = '\0';
+}
+
+void ossimNitfTextFileInfoRecordV2_1::setTextLength(ossim_uint64 length)
+{
+   std::ostringstream out;
+   
+   out << std::setw(5)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << length;
+   
+   memcpy(theTextFileLength, out.str().c_str(), 5);
+   theTextFileLength[5] = '\0';
+}
+
+ossim_uint64 ossimNitfTextFileInfoRecordV2_1::getHeaderLength()const
+{
+   return ossimString(theTextFileSubheaderLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfTextFileInfoRecordV2_1::getTextLength()const
+{
+   return ossimString(theTextFileLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfTextFileInfoRecordV2_1::getTotalLength()const
+{
+   return (getHeaderLength() + getTextLength());
+}
+
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfDataExtSegInfoRecordV2_1 &data)
+{
+   return out << "theDataExtSegSubheaderLength:  "
+              << data.theDataExtSegSubheaderLength
+              << "\ntheDataExtSegLength:           "
+              << data.theDataExtSegLength
+              << std::endl;
+}
+
+ossim_uint64 ossimNitfDataExtSegInfoRecordV2_1::getHeaderLength()const
+{
+   return ossimString(theDataExtSegSubheaderLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfDataExtSegInfoRecordV2_1::getDataExtSegLength()const
+{
+   return ossimString(theDataExtSegLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfDataExtSegInfoRecordV2_1::getTotalLength()const
+{
+   return getDataExtSegLength() + getHeaderLength();
+}
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfResExtSegInfoRecordV2_1 &data)
+{
+   return out << "theResExtSegSubheaderLength:   "
+              << data.theResExtSegSubheaderLength
+              << "\ntheResExtSegLength:            "
+              << data.theResExtSegLength
+              << std::endl;
+}
+
+ossim_uint64 ossimNitfResExtSegInfoRecordV2_1::getHeaderLength()const
+{
+   return ossimString(theResExtSegSubheaderLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfResExtSegInfoRecordV2_1::getResExtSegLength()const
+{
+   return ossimString(theResExtSegLength).toUInt64();
+}
+
+ossim_uint64 ossimNitfResExtSegInfoRecordV2_1::getTotalLength()const
+{
+   return getResExtSegLength() + getHeaderLength();
+}
+
+void ossimNitfImageInfoRecordV2_1::setSubheaderLength(ossim_uint32 length)
+{
+   std::ostringstream out;
+
+   out << std::setw(6)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << length;
+
+   memcpy(theImageSubheaderLength, out.str().c_str(), 6);
+   theImageSubheaderLength[6] = '\0';
+}
+
+void ossimNitfImageInfoRecordV2_1::setImageLength(ossim_uint64 length)
+{
+   std::ostringstream out;
+
+   out << std::setw(10)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << length;
+   
+   memcpy(theImageLength, out.str().c_str(), 10);
+   theImageLength[10] = '\0';
+}
+
+// 
+
+ossimNitfFileHeaderV2_1::ossimNitfFileHeaderV2_1()
+   :ossimNitfFileHeaderV2_X()
+{
+   clearFields();
+}
+
+ossimNitfFileHeaderV2_1::~ossimNitfFileHeaderV2_1()
+{
+}
+
+void ossimNitfFileHeaderV2_1::parseStream(ossim::istream& in)
+{
+   clearFields();
+
+   // identification and origination group
+   in.read(theFileTypeVersion, 9);
+   theHeaderSize += 9;
+   in.read(theComplexityLevel, 2);
+   theHeaderSize += 2;
+   in.read(theSystemType, 4);
+   theHeaderSize += 4;
+   in.read(theOriginatingStationId, 10);
+   theHeaderSize += 10;
+   in.read(theDateTime, 14);
+   theHeaderSize += 14;
+   in.read(theFileTitle, 80);
+   theHeaderSize += 80;
+
+   // read security group
+   in.read(theSecurityClassification, 1);
+   theHeaderSize ++;
+   in.read(theSecurityClassificationSys, 2);
+   theHeaderSize += 2;
+   in.read(theCodewords, 11);
+   theHeaderSize += 11;
+   in.read(theControlAndHandling, 2);
+   theHeaderSize += 2;
+   in.read(theReleasingInstructions, 20);
+   theHeaderSize += 20;
+   in.read(theDeclassificationType, 2);
+   theHeaderSize += 2;
+   in.read(theDeclassificationDate, 8);
+   theHeaderSize += 8;
+   in.read(theDeclassificationExemption, 4);
+   theHeaderSize += 4;
+      
+   in.read(theDowngrade, 1);
+   theHeaderSize ++;
+   in.read(theDowngradingDate, 8);
+   theHeaderSize += 8;
+   in.read(theClassificationText, 43);
+   theHeaderSize += 43;
+   in.read(theClassificationAuthorityType, 1);
+   theHeaderSize ++;
+   in.read(theClassificationAuthority, 40);
+   theHeaderSize += 40;
+   in.read(theClassificationReason, 1);
+   theHeaderSize ++;
+   in.read(theSecuritySourceDate, 8);
+   theHeaderSize += 8;
+   in.read(theSecurityControlNumber, 15);
+   theHeaderSize += 15;
+   in.read(theCopyNumber, 5);
+   theHeaderSize += 5;
+   in.read(theNumberOfCopies, 5);
+   theHeaderSize += 5;
+   in.read(theEncryption, 1);
+   theHeaderSize ++;
+   in.read((char*)theFileBackgroundColor, 3);
+   theHeaderSize += 3;
+   in.read(theOriginatorsName, 24);
+   theHeaderSize += 24;
+   in.read(theOriginatorsPhone, 18);
+   theHeaderSize += 18;
+   in.read(theFileLength, 12);
+   theHeaderSize += 12;
+   in.read(theHeaderLength, 6);
+   theHeaderSize += 6;
+   
+   // image description group
+   in.read(theNumberOfImageInfoRecords, 3); 
+   theHeaderSize += 3;
+   readImageInfoRecords(in); 
+
+   // symbol description group
+   in.read(theNumberOfGraphicInfoRecords, 3); 
+   theHeaderSize += 3;
+   readGraphicInfoRecords(in);
+
+   in.read(theReservedForFutureUse1, 3);
+   theHeaderSize += 3;
+      
+   // text file information group
+   in.read(theNumberOfTextFileInfoRecords, 3); 
+   theHeaderSize += 3;
+   readTextFileInfoRecords(in);
+
+   // Data extension group
+   in.read(theNumberOfDataExtSegInfoRecords, 3); 
+   theHeaderSize += 3;
+   readDataExtSegInfoRecords(in);
+
+   // Reserve Extension Segment group
+   in.read(theNumberOfResExtSegInfoRecords, 3); 
+   theHeaderSize += 3;
+   readResExtSegInfoRecords(in);
+
+   in.read(theUserDefinedHeaderDataLength, 5);
+   theHeaderSize += 5;
+
+   // only get the header overflow if there even exists
+   // user defined data.
+   std::streampos userDefinedHeaderLength = ossimString(theUserDefinedHeaderDataLength).toInt32();
+   ossimNitfTagInformation         headerTag;
+   std::streampos start   = in.tellg();
+   std::streampos current = in.tellg();
+   if(userDefinedHeaderLength > 0)
+   {
+      in.read(theUserDefinedHeaderOverflow, 3);
+      current = in.tellg();
+         
+      while((current - start) < userDefinedHeaderLength)
+      {
+         headerTag.parseStream(in);
+         headerTag.setTagType("UDHD");
+         theTagList.push_back(headerTag);
+         // in.ignore(headerTag.getTagLength());
+         // headerTag.clearFields();
+         current = in.tellg();
+      }
+      //in.seekg(start + userDefinedHeaderLength);
+      theHeaderSize += (userDefinedHeaderLength);
+   }
+   in.read(theExtendedHeaderDataLength, 5);
+   theHeaderSize += 5;
+   std::streampos extendedHeaderDataLength = ossimString(theExtendedHeaderDataLength).toInt32();
+
+   start   = in.tellg();
+   current = in.tellg();
+   // for now let's just ignore it
+   if(extendedHeaderDataLength > 0)
+   {
+      in.read(theExtendedHeaderDataOverflow, 3);
+      current = in.tellg();
+      while((current - start) < extendedHeaderDataLength)
+      {
+         headerTag.parseStream(in);
+	 headerTag.setTagType("XHD");
+         theTagList.push_back(headerTag);
+         
+         // in.ignore(headerTag.getTagLength());
+         // headerTag.clearFields();
+         current = in.tellg();
+      }
+      theHeaderSize += extendedHeaderDataLength;
+      in.seekg(start + extendedHeaderDataLength);
+   }
+
+   // this need to be re-thought
+   initializeAllOffsets();
+   readOverflowTags(in);
+   // custom DES parsers
+   bool parseDes = ossimString(ossimPreferences::instance()->findPreference("des_parser")).toBool();
+   if (parseDes) readDes(in);
+}
+
+bool ossimNitfFileHeaderV2_1::isValid()const
+{
+   bool result = ossimNitfFileHeaderV2_X::isValid();
+
+   if(result)
+   {
+
+   }
+
+   return result;
+}
+
+void ossimNitfFileHeaderV2_1::readOverflowTags(ossim::istream& in)
+{
+   ossim_int32 overflow = ossimString(theUserDefinedHeaderOverflow).toInt32();
+   if (overflow != 0)
+   {
+      ossimNitfDataExtensionSegment *des = getNewDataExtensionSegment(overflow-1, in);
+      if (des != NULL)
+      {
+         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
+         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
+         {
+            iter->setTagType("UDHD");
+            theTagList.push_back(*iter);
+         }
+      }
+      delete des;
+   }
+
+   overflow = ossimString(theExtendedHeaderDataOverflow).toInt32();
+   if (overflow != 0)
+   {
+      ossimNitfDataExtensionSegment *des = getNewDataExtensionSegment(overflow-1, in);
+      if (des != NULL)
+      {
+         const vector<ossimNitfTagInformation> &desTags = des->getTagList();
+         for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
+         {
+            iter->setTagType("XHD");
+            theTagList.push_back(*iter);
+         }
+      }
+      delete des;
+   }
+}
+
+void ossimNitfFileHeaderV2_1::readDes(istream& in)
+{
+   ossimNitfDesInformation des;
+
+   for (int i=0; i<getNumberOfDataExtSegments(); ++i)
+   {
+      ossimIFStream64::seekg64(in, theDataExtSegOffsetList[i].theDataExtSegHeaderOffset, ios::beg);
+      des.parseStream(in, theNitfDataExtSegInfoRecords[i].getDataExtSegLength());
+      theDesList.push_back(des);
+
+   }
+}
+
+void ossimNitfFileHeaderV2_1::writeStream(ossim::ostream& out)
+{
+   out.write(theFileTypeVersion, 9);
+   out.write(theComplexityLevel, 2);
+   out.write(theSystemType, 4);
+   out.write(theOriginatingStationId, 10);
+   out.write(theDateTime, 14);
+   out.write(theFileTitle, 80);
+   out.write(theSecurityClassification, 1);
+   out.write(theSecurityClassificationSys, 2);
+   out.write(theCodewords, 11);
+   out.write(theControlAndHandling, 2);
+   out.write(theReleasingInstructions, 20);
+   out.write(theDeclassificationType, 2);
+   out.write(theDeclassificationDate, 8);
+   out.write(theDeclassificationExemption, 4);
+   out.write(theDowngrade, 1);
+   out.write(theDowngradingDate, 8);
+   out.write(theClassificationText, 43);
+   out.write(theClassificationAuthorityType, 1);
+   out.write(theClassificationAuthority, 40);
+   out.write(theClassificationReason, 1);
+   out.write(theSecuritySourceDate, 8);
+   out.write(theSecurityControlNumber, 15);
+   out.write(theCopyNumber, 5);
+   out.write(theNumberOfCopies, 5);
+   out.write(theEncryption, 1);
+   out.write((char*)theFileBackgroundColor, 3);
+   out.write(theOriginatorsName, 24);
+   out.write(theOriginatorsPhone, 18);
+   out.write(theFileLength, 12);
+   out.write(theHeaderLength, 6);
+   ossim_uint32 idx = 0;
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+                << std::setfill('0')
+                << std::setiosflags(ios::right)
+                << theNitfImageInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      
+      for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfImageInfoRecords[idx].theImageSubheaderLength, 6);
+         out.write(theNitfImageInfoRecords[idx].theImageLength, 10);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+                << std::setfill('0')
+                << std::setiosflags(ios::right)
+                << theNitfGraphicInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      for(idx = 0; idx < theNitfGraphicInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfGraphicInfoRecords[idx].theGraphicSubheaderLength, 4);
+         out.write(theNitfGraphicInfoRecords[idx].theGraphicLength, 6);
+      }
+   }
+   out.write(theReservedForFutureUse1, 3);
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+                << std::setfill('0')
+                << std::setiosflags(ios::right)
+                << theNitfTextFileInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      for(idx = 0; idx < theNitfTextFileInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfTextFileInfoRecords[idx].theTextFileSubheaderLength, 4);
+         out.write(theNitfTextFileInfoRecords[idx].theTextFileLength, 5);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+                << std::setfill('0')
+                << std::setiosflags(ios::right)
+                << theNitfDataExtSegInfoRecords.size();
+      
+      out.write(outString.str().c_str(), 3);
+      for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegSubheaderLength, 4);
+         out.write(theNitfDataExtSegInfoRecords[idx].theDataExtSegLength, 9);
+      }
+   }
+   {
+      std::ostringstream outString;
+      
+      outString << std::setw(3)
+                << std::setfill('0')
+                << std::setiosflags(ios::right)
+                << theNitfResExtSegInfoRecords.size();
+
+      out.write(outString.str().c_str(), 3);
+      for(idx = 0; idx < theNitfResExtSegInfoRecords.size(); ++idx)
+      {
+         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegSubheaderLength, 4);
+         out.write(theNitfResExtSegInfoRecords[idx].theResExtSegLength, 7);
+      }
+   }
+/*
+   out.write(theUserDefinedHeaderDataLength, 5);
+   if(ossimString(theUserDefinedHeaderDataLength).toInt32() > 0)
+   {
+      out.write(theUserDefinedHeaderOverflow, 3);
+   }
+   ossim_uint32 totalLength = getTotalTagLength();
+   if(totalLength <= 99999)
+   {
+      std::ostringstream tempOut;
+
+      tempOut << std::setw(5)
+              << std::setfill('0')
+	      << std::setiosflags(ios::right)
+              << totalLength;
+      
+      memcpy(theExtendedHeaderDataLength, tempOut.str().c_str(), 5);
+      
+      out.write(theExtendedHeaderDataLength, 5);
+
+      // for now we hard code the 000 for we do not currently support writing to the DES if the total tag length is
+      // larger than supported
+      //
+      memset(theExtendedHeaderDataOverflow, '0', 3);
+
+      if(totalLength > 0)
+      {
+         out.write(theExtendedHeaderDataOverflow, 3);
+         ossim_uint32 i = 0;
+         
+         for(i = 0; i < theTagList.size(); ++i)
+         {
+            theTagList[i].writeStream(out);
+         }
+      }
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length < 99999" << std::endl;
+   }
+   */
+      ossim_uint32 totalLength = ossimString(theUserDefinedHeaderDataLength).toUInt32();
+   if (totalLength > 0)
+   {
+      totalLength += 3;
+   }
+
+   // Scope tempOut
+   {
+      std::ostringstream tempOut;
+      tempOut << std::setw(5)
+              << std::setfill('0')
+              << std::setiosflags(ios::right)
+              << totalLength;
+
+      out.write(tempOut.str().c_str(), 5);
+   }
+
+   if (totalLength > 0)
+   {
+      if(totalLength <= 99999)
+      {
+         out.write(theUserDefinedHeaderOverflow, 3);
+
+         for (unsigned int i = 0; i < theTagList.size(); ++i)
+         {
+            if (theTagList[i].getTagType() == "UDHD")
+            {
+               theTagList[i].writeStream(out);
+            }
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length <= 99999" << std::endl;
+      }
+   }
+
+   totalLength = ossimString(theExtendedHeaderDataLength).toUInt32();
+   if (totalLength > 0)
+   {
+      totalLength += 3;
+   }
+
+   // Scope tempOut
+   {
+      std::ostringstream tempOut;
+      tempOut << std::setw(5)
+              << std::setfill('0')
+              << std::setiosflags(ios::right)
+              << totalLength;
+
+      out.write(tempOut.str().c_str(), 5);
+   }
+
+   if (totalLength > 0)
+   {
+      if(totalLength <= 99999)
+      {
+         out.write(theExtendedHeaderDataOverflow, 3);
+
+         for(unsigned int i = 0; i < theTagList.size(); ++i)
+         {
+            if (theTagList[i].getTagType() == "XHD")
+            {
+               theTagList[i].writeStream(out);
+            }
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length <= 99999" << std::endl;
+      }
+   }
+
+}
+
+std::ostream& ossimNitfFileHeaderV2_1::print(std::ostream& out,
+                                             const std::string& prefix) const
+{
+   out << setiosflags(ios::left)
+       << prefix << std::setw(24) << "FHDR:"
+       << theFileTypeVersion << "\n"
+       << prefix << std::setw(24) << "CLEVEL:"
+       << theComplexityLevel << "\n"
+       << prefix << std::setw(24) << "STYPE:"
+       << theSystemType << "\n"
+       << prefix << std::setw(24) << "OSTAID:"
+       << theOriginatingStationId << "\n"
+       << prefix << std::setw(24) << "FDT:"
+       << theDateTime << "\n"      
+       << prefix << std::setw(24) << "FTITLE:"
+       << theFileTitle << "\n"    
+       << prefix << std::setw(24) << "FSCLAS:"
+       << theSecurityClassification<< "\n"
+       << prefix << std::setw(24) << "FSCLSY:"
+       << theSecurityClassificationSys<< "\n"
+       << prefix << std::setw(24) << "FSCODE:"
+       << theCodewords << "\n"
+       << prefix << std::setw(24) << "FSCTLH:"
+       << theControlAndHandling << "\n"
+       << prefix << std::setw(24) << "FSREL:"
+       << theReleasingInstructions << "\n"
+       << prefix << std::setw(24) << "FSDCTP:"
+       << theDeclassificationType << "\n"
+       << prefix << std::setw(24) << "FSDCDT:"
+       << theDeclassificationDate << "\n"
+       << prefix << std::setw(24) << "FSDCXM:"
+       << theDeclassificationExemption << "\n"
+       << prefix << std::setw(24) << "FSDG:"
+       << theDowngrade << "\n"
+       << prefix << std::setw(24) << "FSDGDT:"
+       << theDowngradingDate << "\n"
+       << prefix << std::setw(24) << "FSCLTX:"
+       << theClassificationText << "\n"
+       << prefix << std::setw(24) << "FSCATP:"
+       << theClassificationAuthorityType << "\n"
+       << prefix << std::setw(24) << "FSCAUT:"
+       << theClassificationAuthority << "\n"
+       << prefix << std::setw(24) << "FSCRSN:"
+       << theClassificationReason << "\n"
+       << prefix << std::setw(24) << "FSSRDT:"
+       << theSecuritySourceDate << "\n"
+       << prefix << std::setw(24) << "FSCTLN:"
+       << theSecurityControlNumber << "\n"
+       << prefix << std::setw(24) << "FSCOP:"
+       << theCopyNumber << "\n"
+       << prefix << std::setw(24) << "FSCOPYS:"
+       << theNumberOfCopies << "\n"
+       << prefix << std::setw(24) << "ENCRYP:"
+       << theEncryption << "\n"
+       << prefix << std::setw(24) << "FBKGC[0]:"
+       << (int)theFileBackgroundColor[0] << "\n"
+       << prefix << std::setw(24) << "FBKGC[1]:"
+       << (int)theFileBackgroundColor[1] << "\n"
+       << prefix << std::setw(24) << "FBKGC[2]:"
+       << (int)theFileBackgroundColor[2] << "\n"
+       << prefix << std::setw(24) << "ONAME:"
+       << theOriginatorsName<< "\n"
+       << prefix << std::setw(24) << "OPHONE:"
+       << theOriginatorsPhone << "\n"
+       << prefix << std::setw(24) << "FL:"
+       << theFileLength  << "\n"
+       << prefix << std::setw(24) << "HL:"
+       << theHeaderLength << "\n"
+       << prefix << std::setw(24) << "NUMI:"
+       << theNumberOfImageInfoRecords << "\n";
+
+   ossim_uint32 index;
+
+   for (index = 0; index < theNitfImageInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << setw(3) << setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LISH";
+      tmpStr += os.str();
+      
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfImageInfoRecords[index].theImageSubheaderLength << "\n";
+      tmpStr = "LI";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfImageInfoRecords[index].theImageLength << "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMS:" << theNumberOfGraphicInfoRecords
+       << "\n";
+ 
+   for (index = 0; index < theNitfGraphicInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << setw(3) << setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LSSH";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfGraphicInfoRecords[index].theGraphicSubheaderLength
+          << "\n";
+
+      tmpStr = "LS";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr 
+          << theNitfGraphicInfoRecords[index].theGraphicLength
+          << "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMX:" << theReservedForFutureUse1 << "\n"
+       << prefix << std::setw(24) << "NUMT:" 
+       << theNumberOfTextFileInfoRecords << "\n";
+   
+   for (index = 0; index < theNitfTextFileInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << setw(3) << setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LTSH";
+      tmpStr += os.str();
+      
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfTextFileInfoRecords[index].theTextFileSubheaderLength
+          << "\n";
+
+      tmpStr = "LT";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfTextFileInfoRecords[index].theTextFileLength << "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMDES:" << theNumberOfDataExtSegInfoRecords
+       << "\n";
+
+   for (index = 0; index < theNitfDataExtSegInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << setw(3) << setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LDSH";
+      tmpStr += os.str();
+      
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfDataExtSegInfoRecords[index].theDataExtSegSubheaderLength
+          << "\n";
+
+      tmpStr = "LD";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfDataExtSegInfoRecords[index].theDataExtSegLength
+          << "\n";
+   }
+
+   out << prefix << std::setw(24) << "NUMRES:"
+       << theNumberOfResExtSegInfoRecords << "\n";
+   
+   for (index = 0; index < theNitfResExtSegInfoRecords.size(); ++index)
+   {
+      std::ostringstream os;
+      os << setw(3) << setfill('0') << (index+1) << ":";
+
+      ossimString tmpStr = "LRESSH";
+      tmpStr += os.str();
+      
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfResExtSegInfoRecords[index].theResExtSegSubheaderLength
+          << "\n";
+
+      tmpStr = "LRE";
+      tmpStr += os.str();
+
+      out << prefix << std::setw(24) << tmpStr
+          << theNitfResExtSegInfoRecords[index].theResExtSegLength
+          << "\n";
+   }
+   
+   out << prefix << std::setw(24) << "UDHDL:"
+       << theUserDefinedHeaderDataLength
+       << "\n"
+       << prefix << std::setw(24) << "UDHOFL:"
+       << theUserDefinedHeaderOverflow
+       << "\n"
+       << prefix << std::setw(24) << "XHDL:"
+       << theExtendedHeaderDataLength
+       << "\n"
+       << prefix << std::setw(24) << "XHDLOFL:"
+       << theExtendedHeaderDataOverflow
+       << "\n";
+
+   // Call DES PRINT
+   for (int i=0; i<theDesList.size(); ++i)
+   {
+      theDesList[i].print(out, prefix);
+   }
+
+   return ossimNitfFileHeader::print(out, prefix);
+}
+
+ossimNitfImageHeader* ossimNitfFileHeaderV2_1::allocateImageHeader()const
+{
+   return new ossimNitfImageHeaderV2_1;
+}
+
+ossimNitfTextHeader *ossimNitfFileHeaderV2_1::allocateTextHeader()const
+{
+   return new ossimNitfTextHeaderV2_0;
+}
+
+ossimNitfDataExtensionSegment* ossimNitfFileHeaderV2_1::allocateDataExtSegment()const
+{
+   return new ossimNitfDataExtensionSegmentV2_1;
+}
+
+bool ossimNitfFileHeaderV2_1::isEncrypted()const
+{
+   return (theEncryption[0]=='1');
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfImages()const
+{
+   return (ossim_int32)theNitfImageInfoRecords.size();
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfTextSegments()const
+{
+   return static_cast<ossim_int32>(theNitfTextFileInfoRecords.size());
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getHeaderSize()const
+{
+   return theHeaderSize;
+}
+
+ossim_int64 ossimNitfFileHeaderV2_1::getFileSize()const
+{
+   ossimString temp = theFileLength;
+
+   if(temp == "999999999999")
+   {
+      return -1;
+   }
+   else
+   {
+      return temp.toInt64();
+   }
+}
+
+const char* ossimNitfFileHeaderV2_1::getVersion()const
+{
+   return &theFileTypeVersion[4];
+}
+
+
+void ossimNitfFileHeaderV2_1::clearFields()
+{
+   memcpy(theFileTypeVersion, "NITF02.10", 9);
+   memcpy(theComplexityLevel, "01", 2);
+   memcpy(theSystemType, "BF01", 4);
+   memset(theOriginatingStationId, ' ', 10);
+   memset(theDateTime, ' ', 14);
+   memset(theFileTitle, ' ', 80);
+   memset(theSecurityClassification, ' ', 1);
+   memset(theSecurityClassificationSys, ' ', 2);
+   memset(theCodewords, ' ', 11);
+   memset(theControlAndHandling, ' ', 2);
+   memset(theReleasingInstructions, ' ', 20);
+   memset(theDeclassificationType, ' ', 2);
+   memset(theDeclassificationDate, ' ', 8);
+   memset(theDeclassificationExemption, ' ', 4);
+   memset(theDowngrade, ' ', 1);
+   memset(theDowngradingDate, ' ', 8);
+   memset(theClassificationText, ' ', 43);
+   memset(theClassificationAuthorityType, ' ', 1);
+   memset(theClassificationAuthority, ' ', 40);
+   memset(theClassificationReason, ' ', 1);
+   memset(theSecuritySourceDate, ' ', 8);
+   memset(theSecurityControlNumber, ' ', 15);
+   memset(theCopyNumber, '0', 5);
+   memset(theNumberOfCopies, '0', 5);
+   memset(theEncryption, ' ', 1);
+   memset(theFileBackgroundColor, 0, 3);
+   memset(theOriginatorsName, ' ', 24);
+   memset(theOriginatorsPhone, ' ', 18);
+   memset(theFileLength, ' ', 12);
+   memset(theHeaderLength, ' ', 6);
+   memset(theNumberOfImageInfoRecords, '0', 3);
+   memset(theNumberOfGraphicInfoRecords, '0', 3);
+   memset(theReservedForFutureUse1, '0', 3);
+   memset(theNumberOfTextFileInfoRecords, '0', 3);
+   memset(theNumberOfDataExtSegInfoRecords, '0', 3);
+   memset(theNumberOfResExtSegInfoRecords, '0', 3);
+   memset(theUserDefinedHeaderDataLength, '0', 5);
+   memset(theUserDefinedHeaderOverflow, '0',3);
+   memset(theExtendedHeaderDataLength, '0',5);
+   memset(theExtendedHeaderDataOverflow, '0', 3);
+   theFileTypeVersion[9] = '\0';
+   theComplexityLevel[2] = '\0';
+   theSystemType[4] = '\0';
+   theOriginatingStationId[10] = '\0';
+   theDateTime[14] = '\0';
+   theFileTitle[80] = '\0';
+   theSecurityClassification[1] = '\0';
+   theSecurityClassificationSys[2] = '\0';
+   theCodewords[11] = '\0';
+   theControlAndHandling[2] = '\0';
+   theReleasingInstructions[20] = '\0';
+   theDeclassificationType[2] = '\0';
+   theDeclassificationDate[8] = '\0';
+   theDeclassificationExemption[4] = '\0';
+   theDowngrade[1] = '\0';
+   theDowngradingDate[8] = '\0';
+   theClassificationText[43] = '\0';
+   theClassificationAuthorityType[1] = '\0';
+   theClassificationAuthority[40] = '\0';
+   theClassificationReason[1] = '\0';
+   theSecuritySourceDate[8] = '\0';
+   theSecurityControlNumber[15] = '\0';
+   theCopyNumber[5] = '\0';
+   theNumberOfCopies[5] = '\0';
+   theEncryption[1] = '\0';
+   theOriginatorsName[24] = '\0';
+   theOriginatorsPhone[18] = '\0';
+   theFileLength[12] = '\0';
+   theHeaderLength[6] = '\0';
+   theNumberOfImageInfoRecords[3] = '\0';
+   theNumberOfGraphicInfoRecords[3] = '\0';
+   theReservedForFutureUse1[3] = '\0';
+   theNumberOfTextFileInfoRecords[3] = '\0';
+   theNumberOfDataExtSegInfoRecords[3] = '\0';
+   theNumberOfResExtSegInfoRecords[3] = '\0';
+   theUserDefinedHeaderDataLength[5] = '\0';
+   theUserDefinedHeaderOverflow[3] = '\0';
+   theExtendedHeaderDataLength[5] = '\0';
+   theExtendedHeaderDataOverflow[3] = '\0';
+
+   theHeaderSize = 0;
+}
+
+void ossimNitfFileHeaderV2_1::readImageInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfImages = ossimString(theNumberOfImageInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfImageInfoRecords.clear();
+   for(index=0; index < numberOfImages; index++)
+   {
+      ossimNitfImageInfoRecordV2_1 temp;
+
+      
+      in.read(temp.theImageSubheaderLength, 6);
+      in.read(temp.theImageLength, 10);
+      theHeaderSize += 16;
+
+      temp.theImageSubheaderLength[6] = '\0';
+      temp.theImageLength[10] = '\0';
+      
+      theNitfImageInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::readGraphicInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfGraphics = ossimString(theNumberOfGraphicInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfGraphicInfoRecords.clear();
+   
+   for(index=0; index < numberOfGraphics; index++)
+   {
+      ossimNitfGraphicInfoRecordV2_1 temp;
+
+      
+      in.read(temp.theGraphicSubheaderLength, 4);
+      in.read(temp.theGraphicLength, 6);
+      theHeaderSize += 10;
+
+      temp.theGraphicSubheaderLength[4] = '\0';
+      temp.theGraphicLength[6] = '\0';
+      
+      theNitfGraphicInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::readTextFileInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfTextFiles = ossimString(theNumberOfTextFileInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfTextFileInfoRecords.clear();
+   for(index=0; index < numberOfTextFiles; index++)
+   {
+      ossimNitfTextFileInfoRecordV2_1 temp;
+      
+      in.read(temp.theTextFileSubheaderLength, 4);
+      in.read(temp.theTextFileLength, 5);
+      theHeaderSize += 9;
+      
+      temp.theTextFileSubheaderLength[4] = '\0';
+      temp.theTextFileLength[5] = '\0';
+      
+      theNitfTextFileInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::readDataExtSegInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfDataExtSegs = ossimString(theNumberOfDataExtSegInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfDataExtSegInfoRecords.clear();
+   for(index=0; index < numberOfDataExtSegs; index++)
+   {
+      ossimNitfDataExtSegInfoRecordV2_1 temp;
+      
+      in.read(temp.theDataExtSegSubheaderLength, 4);
+      in.read(temp.theDataExtSegLength, 9);
+      theHeaderSize += 13;
+
+      temp.theDataExtSegSubheaderLength[4] = '\0';
+      temp.theDataExtSegLength[9]          = '\0';
+
+      theNitfDataExtSegInfoRecords.push_back(temp);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::deleteLastDataExtSegInfoRecord()
+{
+   if (theNitfDataExtSegInfoRecords.size()) theNitfDataExtSegInfoRecords.pop_back();
+
+   setNumberOfDataExtSegInfoRecords(theNitfDataExtSegInfoRecords.size());
+}
+
+void ossimNitfFileHeaderV2_1::readResExtSegInfoRecords(ossim::istream& in)
+{
+   ossim_int32 numberOfResExtSegs = ossimString(theNumberOfResExtSegInfoRecords).toInt32();
+   ossim_int32 index;
+
+   theNitfResExtSegInfoRecords.clear();
+   for(index=0; index < numberOfResExtSegs; index++)
+   {
+      ossimNitfResExtSegInfoRecordV2_1 temp;
+
+      in.read(temp.theResExtSegSubheaderLength, 4);
+      in.read(temp.theResExtSegLength, 7);
+      theHeaderSize += 11;
+
+      temp.theResExtSegSubheaderLength[4] = '\0';
+      temp.theResExtSegLength[7]          = '\0';
+      
+      theNitfResExtSegInfoRecords.push_back(temp);      
+   }
+}
+
+void ossimNitfFileHeaderV2_1::deleteLastImageInfoRecord()
+{
+   if (theNitfImageInfoRecords.size()) theNitfImageInfoRecords.pop_back();
+
+   setNumberOfImageInfoRecords(theNitfImageInfoRecords.size());
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfLabels()const
+{
+   return 0;
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfSymbols()const
+{
+   return 0;
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfGraphics()const
+{
+   return theNitfGraphicInfoRecords.size();
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfDataExtSegments()const
+{
+   return theNitfDataExtSegInfoRecords.size();
+}
+
+ossim_int32 ossimNitfFileHeaderV2_1::getNumberOfReservedExtSegments()const
+{
+   return theNitfResExtSegInfoRecords.size();
+}
+
+const char* ossimNitfFileHeaderV2_1::getDateTime()const
+{
+   return theDateTime;
+}
+
+ossimDrect ossimNitfFileHeaderV2_1::getImageRect()const
+{
+   return theImageRect;
+}
+
+void ossimNitfFileHeaderV2_1::addImageInfoRecord(const ossimNitfImageInfoRecordV2_1& recordInfo)
+{
+   theNitfImageInfoRecords.push_back(recordInfo);
+
+   setNumberOfImageInfoRecords(theNitfImageInfoRecords.size());
+}
+
+void ossimNitfFileHeaderV2_1::addTextInfoRecord(const ossimNitfTextFileInfoRecordV2_1& recordInfo)
+{
+   theNitfTextFileInfoRecords.push_back(recordInfo);
+
+   setNumberOfTextInfoRecords(theNitfTextFileInfoRecords.size());
+}
+
+bool ossimNitfFileHeaderV2_1::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = ossimNitfFileHeaderV2_X::saveState(kwl, prefix);
+
+   if(result)
+   {
+      kwl.add(prefix, FSCLSY_KW.c_str(), theSecurityClassificationSys);
+      kwl.add(prefix, FSCODE_KW.c_str(), theCodewords);
+      kwl.add(prefix, FSCTLH_KW.c_str(), theControlAndHandling);
+      kwl.add(prefix, FSREL_KW.c_str(), theReleasingInstructions);
+      kwl.add(prefix, FSDCTP_KW.c_str(), theDeclassificationType);
+      kwl.add(prefix, FSDCDT_KW.c_str(), theDeclassificationDate);
+      kwl.add(prefix, FSDCXM_KW.c_str(), theDeclassificationExemption);
+      kwl.add(prefix, FSDG_KW.c_str(), theDowngrade);
+      kwl.add(prefix, FSDGDT_KW.c_str(), theDowngradingDate);
+      kwl.add(prefix, FSCLTX_KW.c_str(), theClassificationText);
+      kwl.add(prefix, FSCATP_KW.c_str(), theClassificationAuthorityType);
+      kwl.add(prefix, FSCAUT_KW.c_str(), theClassificationAuthorityType);
+      kwl.add(prefix, FSCRSN_KW.c_str(), theClassificationReason);
+      kwl.add(prefix, FSSRDT_KW.c_str(), theSecuritySourceDate);
+      kwl.add(prefix, FSCTLN_KW.c_str(), theSecurityControlNumber);
+      //kwl.add(prefix, FBKGC_KW.c_str(), theFileBackgroundColor);
+      kwl.add(prefix, ONAME_KW.c_str(), theOriginatorsName);
+      kwl.add(prefix, OPHONE_KW.c_str(), theOriginatorsPhone);
+      kwl.add(prefix, FL_KW.c_str(), theFileLength);
+      kwl.add(prefix, HL_KW.c_str(), theHeaderLength);
+      kwl.add(prefix, NUMI_KW.c_str(), theNumberOfImageInfoRecords);
+   }
+
+   return result;
+}
+
+void ossimNitfFileHeaderV2_1::addDataExtSegInfoRecord(const ossimNitfDataExtSegInfoRecordV2_1& recordInfo)
+{
+   theNitfDataExtSegInfoRecords.push_back(recordInfo);
+
+   setNumberOfDataExtSegInfoRecords(theNitfDataExtSegInfoRecords.size());
+}
+
+
+void ossimNitfFileHeaderV2_1::replaceImageInfoRecord(int i, const ossimNitfImageInfoRecordV2_1& recordInfo)
+{
+   if ( i < static_cast<int>(theNitfImageInfoRecords.size()) )
+   {
+      theNitfImageInfoRecords[i] = recordInfo;
+   }
+}
+
+ossimNitfSymbolHeader *ossimNitfFileHeaderV2_1::allocateSymbolHeader()const
+{
+   return 0;
+}
+
+ossimNitfLabelHeader *ossimNitfFileHeaderV2_1::allocateLabelHeader()const
+{
+   return 0;
+}
+
+void ossimNitfFileHeaderV2_1::initializeAllOffsets()
+{
+   // this will be a running tally 
+   ossim_uint64 tally = theHeaderSize;
+   ossim_uint64 idx = 0;
+
+   // clear out all offset inforamtion and begin populating them
+   theImageOffsetList.clear();
+   theGraphicOffsetList.clear();
+   theTextFileOffsetList.clear();
+   theDataExtSegOffsetList.clear();
+
+   for(idx = 0; idx < theNitfImageInfoRecords.size(); ++idx)
+   {
+      theImageOffsetList.push_back(ossimNitfImageOffsetInformation(tally,
+                                                                   tally + theNitfImageInfoRecords[idx].getHeaderLength()));
+      tally += theNitfImageInfoRecords[idx].getTotalLength();
+   }
+   for(idx = 0; idx < theNitfGraphicInfoRecords.size(); ++idx)
+   {
+      theGraphicOffsetList.push_back(ossimNitfGraphicOffsetInformation(tally,
+                                                                     tally + theNitfGraphicInfoRecords[idx].getHeaderLength()));
+      tally += theNitfGraphicInfoRecords[idx].getTotalLength();
+   }
+
+   for(idx = 0; idx < theNitfTextFileInfoRecords.size(); ++idx)
+   {
+      theTextFileOffsetList.push_back(ossimNitfTextOffsetInformation(tally,
+                                                                     tally + theNitfTextFileInfoRecords[idx].getHeaderLength()));
+      tally += theNitfTextFileInfoRecords[idx].getTotalLength();
+   }
+
+   for(idx = 0; idx < theNitfDataExtSegInfoRecords.size(); ++idx)
+   {
+      theDataExtSegOffsetList.push_back(ossimNitfDataExtSegOffsetInformation(tally,
+                                                                             tally + theNitfDataExtSegInfoRecords[idx].getHeaderLength()));
+      tally += theNitfDataExtSegInfoRecords[idx].getTotalLength();
+   }
+}
+
+ossimNitfImageHeader*
+ossimNitfFileHeaderV2_1::getNewImageHeader(ossim_uint32 imageNumber,
+                                           ossim::istream& in)const
+{
+   ossimNitfImageHeader *result = 0;
+   
+   if( (getNumberOfImages() > 0) && (imageNumber < theImageOffsetList.size()) )
+   {
+      result = allocateImageHeader();
+      in.seekg(theImageOffsetList[imageNumber].theImageHeaderOffset, ios::beg);
+      ((ossimNitfImageHeaderV2_1*)result)->parseStream(in, this);
+   }
+   else
+   {
+#if 0
+      ossimNotify(ossimNotifyLevel_FATAL) << "FATAL ossimNitfFileHeaderV2_1::getNewImageHeader: "
+                                          << "\nNo images in file or image number (" << imageNumber
+                                          << ") is out of range!\n";
+#endif
+   }
+   
+   return result;
+}
+
+ossimNitfSymbolHeader*
+ossimNitfFileHeaderV2_1::getNewSymbolHeader(ossim_uint32 /* symbolNumber */,
+                                            ossim::istream& /* in */)const
+{
+   // Currently not implemented...
+   
+   ossimNitfSymbolHeader *result = 0;
+
+
+   
+   return result;
+}
+
+ossimNitfLabelHeader*
+ossimNitfFileHeaderV2_1::getNewLabelHeader(ossim_uint32 /* labelNumber */,
+                                           ossim::istream& /* in */)const
+{
+   // Currently not implemented...
+   ossimNitfLabelHeader *result = 0;
+   
+   return result;
+}
+
+ossimNitfTextHeader*
+ossimNitfFileHeaderV2_1::getNewTextHeader(ossim_uint32 /* textNumber */,
+                                          ossim::istream& /* in */)const
+{
+   // Currently not implemented...
+   ossimNitfTextHeader *result = 0;
+   
+   return result;
+}
+
+ossimNitfDataExtensionSegment*
+ossimNitfFileHeaderV2_1::getNewDataExtensionSegment(
+   ossim_int32 dataExtNumber, ossim::istream&  in )const
+{
+   ossimNitfDataExtensionSegment *result = 0;
+
+   if((getNumberOfDataExtSegments() > 0) &&
+      (dataExtNumber < (ossim_int32)theNitfDataExtSegInfoRecords.size()) &&
+      (dataExtNumber >= 0))
+   {
+      result = allocateDataExtSegment();
+      // ossimIFStream64::seekg64(in, theDataExtSegOffsetList[dataExtNumber].theDataExtSegHeaderOffset, ios::beg);
+      in.seekg(theDataExtSegOffsetList[dataExtNumber].theDataExtSegHeaderOffset, ios::beg);
+      result->parseStream(in, theNitfDataExtSegInfoRecords[dataExtNumber].getDataExtSegLength());
+   }
+   
+   return result;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getSecurityClassificationSys()const
+{
+   return theSecurityClassificationSys;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getCodeWords()const
+{
+   return theCodewords;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getControlAndHandling()const
+{
+   return theControlAndHandling;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getReleasingInstructions()const
+{
+   return theReleasingInstructions;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getDeclassificationType()const
+{
+   return theDeclassificationType;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getDeclassificationDate()const
+{
+   return theDeclassificationDate;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getDeclassificationExemption()const
+{
+   return theDeclassificationExemption;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getDowngrade()const
+{
+   return theDowngrade;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getDowngradingDate()const
+{
+   return theDowngradingDate;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getClassificationText()const
+{
+   return theClassificationText;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getClassificationAuthorityType()const
+{
+   return theClassificationAuthorityType;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getClassificationAuthority()const
+{
+   return theClassificationAuthority;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getClassificationReason()const
+{
+   return theClassificationReason;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getSecuritySourceDate()const
+{
+   return theSecuritySourceDate;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getSecurityControlNumber()const
+{
+   return theSecurityControlNumber;
+}
+
+void ossimNitfFileHeaderV2_1::getBackgroundColor(ossim_uint8& r,
+                                                 ossim_uint8& g,
+                                                 ossim_uint8& b)const
+{
+   r = theFileBackgroundColor[0];
+   g = theFileBackgroundColor[1];
+   b = theFileBackgroundColor[2];
+}
+
+ossimString ossimNitfFileHeaderV2_1::getOriginatorsName()const
+{
+   return theOriginatorsName;
+}
+
+ossimString ossimNitfFileHeaderV2_1::getOriginatorsPhone()const
+{
+   return theOriginatorsPhone;
+}
+
+void ossimNitfFileHeaderV2_1::setFileLength(ossim_uint64 fileLength)
+{
+   std::ostringstream out;
+
+   out << std::setw(12)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << fileLength;
+
+   memcpy(theFileLength, out.str().c_str(), 12);
+}
+
+
+
+void ossimNitfFileHeaderV2_1::setNumberOfGraphicInfoRecords(ossim_uint64 num)
+	{
+		if (num < 1000)
+   {
+      std::ostringstream out;
+      
+      out << std::setw(3)
+          << std::setfill('0')
+          << std::setiosflags(ios::right)
+          << num;
+      
+      memcpy(theNumberOfGraphicInfoRecords, out.str().c_str(), 3);
+   }
+   else
+   {
+      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfGraphicInfoRecords:";
+      s += " ERROR\nExceeded max number of 999!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+		
+	}
+
+void ossimNitfFileHeaderV2_1::setNumberOfDataExtSegInfoRecords(ossim_uint64 num)
+{
+   if (num < 1000)
+   {
+      std::ostringstream out;
+      
+      out << std::setw(3)
+          << std::setfill('0')
+          << std::setiosflags(ios::right)
+          << num;
+      
+      memcpy(theNumberOfDataExtSegInfoRecords, out.str().c_str(), 3);
+   }
+   else
+   {
+      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfDataExtSegInfoRecords:";
+      s += " ERROR\nExceeded max number of 999!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+}
+
+
+void ossimNitfFileHeaderV2_1::setNumberOfTextInfoRecords(ossim_uint64 num)
+{
+   if (num < 1000)
+   {
+      std::ostringstream out;
+      
+      out << std::setw(3)
+          << std::setfill('0')
+          << std::setiosflags(ios::right)
+          << num;
+      
+      memcpy(theNumberOfTextFileInfoRecords, out.str().c_str(), 3);
+   }
+   else
+   {
+      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfTextRecords:";
+      s += " ERROR\nExceeded max number of 999!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+}
+
+
+void ossimNitfFileHeaderV2_1::setNumberOfImageInfoRecords(ossim_uint64 num)
+{
+   if (num < 1000)
+   {
+      std::ostringstream out;
+      
+      out << std::setw(3)
+          << std::setfill('0')
+          << std::setiosflags(ios::right)
+          << num;
+      
+      memcpy(theNumberOfImageInfoRecords, out.str().c_str(), 3);
+   }
+   else
+   {
+      std::string s = "ossimNitfFileHeaderV2_1::setNumberOfImageInfoRecords:";
+      s += " ERROR\nExceeded max image info number of 999!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::setHeaderLength(ossim_uint64 headerLength)
+{
+   std::ostringstream out;
+
+   out << std::setw(6)
+       << std::setfill('0')
+       << std::setiosflags(ios::right)
+       << headerLength;
+
+   memcpy(theHeaderLength, out.str().c_str(), 6);
+}
+
+void ossimNitfFileHeaderV2_1::setSecurityClassificationSys(const ossimString& value)
+{
+   std::ostringstream out;
+   
+   out << std::setw(2)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << ossimString(value).trim();
+
+   memcpy(theSecurityClassificationSys, out.str().c_str(), 2);
+}
+
+void ossimNitfFileHeaderV2_1::setCodeWords(const ossimString& codeWords)
+{
+   std::ostringstream out;
+   
+   out << std::setw(11)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << ossimString(codeWords).trim();
+
+   memcpy(theCodewords, out.str().c_str(), 11);
+}
+
+void ossimNitfFileHeaderV2_1::setControlAndHandling(const ossimString& controlAndHandling)
+{
+   std::ostringstream out;
+   
+   out << std::setw(2)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << ossimString(controlAndHandling).trim();
+
+   memcpy(theControlAndHandling, out.str().c_str(), 2);
+}
+
+void ossimNitfFileHeaderV2_1::setReleasingInstructions(const ossimString& releasingInstructions)
+{
+   std::ostringstream out;
+   
+   out << std::setw(20)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << ossimString(releasingInstructions).trim();
+
+   memcpy(theReleasingInstructions, out.str().c_str(), 20);
+}
+
+void ossimNitfFileHeaderV2_1::setDeclassificationType(const ossimString& declassType)
+{
+   std::ostringstream out;
+   
+   out << std::setw(2)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << declassType.trim();
+
+   memcpy(theDeclassificationType, out.str().c_str(), 2);
+}
+
+void ossimNitfFileHeaderV2_1::setDeclassificationDate(const ossimLocalTm& d)
+{
+   memcpy(theDeclassificationDate, formatDate(getVersion(), d).c_str(), 8);
+}
+
+void ossimNitfFileHeaderV2_1::setDeclassificationDate(const ossimString& d)
+{
+   if(d.size() >=8)
+   {
+      memcpy(theDeclassificationDate, d.c_str(), 8);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::setDeclassificationExemption(const ossimString& exemption)
+{
+   std::ostringstream out;
+   
+   out << std::setw(4)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << exemption.trim();
+
+   memcpy(theDeclassificationExemption, out.str().c_str(), 4);
+}
+
+void ossimNitfFileHeaderV2_1::setDowngrade(const ossimString& downgrade)
+{
+   std::ostringstream out;
+   
+   out << std::setw(1)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << downgrade.trim();
+
+   memcpy(theDowngrade, out.str().c_str(), 1);
+}
+
+void ossimNitfFileHeaderV2_1::setDowngradingDate(const ossimLocalTm& d)
+{
+   memcpy(theDowngradingDate, formatDate(getVersion(), d).c_str(), 8);
+}
+
+void ossimNitfFileHeaderV2_1::setDowngradingDate(const ossimString& d)
+{
+   if(d.size() >=8)
+   {
+      memcpy(theDowngradingDate, d.c_str(), 8);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::setClassificationText(const ossimString& classificationText)
+{
+   std::ostringstream out;
+   
+   out << std::setw(43)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << classificationText.trim();
+
+   memcpy(theClassificationText, out.str().c_str(), 43);
+}
+
+void ossimNitfFileHeaderV2_1::setClassificationAuthorityType(const ossimString& authorityType)
+{
+   std::ostringstream out;
+   
+   out << std::setw(1)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << authorityType.trim();
+
+   memcpy(theClassificationAuthorityType, out.str().c_str(), 1);
+}
+
+void ossimNitfFileHeaderV2_1::setClassificationAuthority(const ossimString& authority)
+{
+   std::ostringstream out;
+   
+   out << std::setw(40)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << authority.trim();
+
+   memcpy(theClassificationAuthority, out.str().c_str(), 40);
+}
+
+void ossimNitfFileHeaderV2_1::setClassificationReason(const ossimString& reason)
+{
+   std::ostringstream out;
+   
+   out << std::setw(1)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << reason.trim();
+
+   memcpy(theClassificationReason, out.str().c_str(), 1);
+}
+
+void ossimNitfFileHeaderV2_1::setSecuritySourceDate(const ossimLocalTm& d)
+{
+   memcpy(theSecuritySourceDate, formatDate(getVersion(), d).c_str(), 8);
+}
+
+void ossimNitfFileHeaderV2_1::setSecuritySourceDate(const ossimString& d)
+{
+   if(d.size() >=8)
+   {
+      memcpy(theSecuritySourceDate, d.c_str(), 8);
+   }
+}
+
+void ossimNitfFileHeaderV2_1::setSecurityControlNumber(const ossimString& number)
+{
+   std::ostringstream out;
+   
+   out << std::setw(15)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << number.trim();
+
+   memcpy(theSecurityControlNumber, out.str().c_str(), 15);
+}
+
+void ossimNitfFileHeaderV2_1::setFileBackgroundColor(ossim_uint8 r,
+                                                     ossim_uint8 g,
+                                                     ossim_uint8 b)
+{
+   theFileBackgroundColor[0] = r;
+   theFileBackgroundColor[1] = g;
+   theFileBackgroundColor[2] = b;
+}
+
+void ossimNitfFileHeaderV2_1::setOriginatorsName(const ossimString& name)
+{
+   std::ostringstream out;
+   
+   out << std::setw(24)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << name.trim();
+   
+   memcpy(theOriginatorsName, out.str().c_str(), 24);
+}
+
+void ossimNitfFileHeaderV2_1::setOriginatorsPhone(const ossimString& phone)
+{
+   std::ostringstream out;
+   
+   out << std::setw(18)
+       << std::setfill(' ')
+       << std::setiosflags(ios::left)
+       << phone.trim();
+   
+   memcpy(theOriginatorsPhone, out.str().c_str(), 18);
+}
+
+bool ossimNitfFileHeaderV2_1::loadState(const ossimKeywordlist& kwl,
+                                        const char* prefix)
+{
+   // Note: Currently not looking up all fieds only ones that make sense.
+   
+   const char* lookup;
+
+   lookup = kwl.find( prefix, FSCLSY_KW);
+   if ( lookup )
+   {
+      setSecurityClassificationSys( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSDCTP_KW);
+   if ( lookup )
+   {
+      setDeclassificationType( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSDCDT_KW);
+   if ( lookup )
+   {
+      setDeclassificationDate( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSDCXM_KW);
+   if ( lookup )
+   {
+      setDeclassificationExemption( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSDG_KW);
+   if ( lookup )
+   {
+      setDowngrade( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSDGDT_KW);
+   if ( lookup )
+   {
+      setDowngradingDate( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSCLTX_KW );
+   if ( lookup )
+   {
+      setClassificationText( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSCATP_KW );
+   if ( lookup )
+   {
+      setClassificationAuthorityType( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSCRSN_KW );
+   if ( lookup )
+   {
+      setClassificationReason( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FSSRDT_KW);
+   if ( lookup )
+   {
+      setSecuritySourceDate( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, FBKGC_KW );
+   if ( lookup )
+   {
+      ossimString value = lookup;
+      std::vector<ossimString> splitString;
+      value = value.trim();
+      value.split(splitString, " ");
+      if(splitString.size() == 3)
+      {
+         setFileBackgroundColor((ossim_uint8)splitString[0].toUInt32(), 
+                                (ossim_uint8)splitString[1].toUInt32(), 
+                                (ossim_uint8)splitString[2].toUInt32());
+      }
+   }  
+   
+   return ossimNitfFileHeaderV2_X::loadState(kwl, prefix);
+}
+
+void ossimNitfFileHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid()) return;
+   
+   ossimString name = property->getName();
+
+   // Make case insensitive:
+   name.upcase();
+   
+   if(name == FSCLSY_KW)
+   {
+     setSecurityClassificationSys(property->valueToString()); 
+   }
+   else if(name == FSDCTP_KW)
+   {
+      setDeclassificationType(property->valueToString());
+   }
+   else if(name == FSDCDT_KW)
+   {
+      setDeclassificationDate(property->valueToString());
+   }
+   else if(name == FSDCXM_KW)
+   {
+      setDeclassificationExemption(property->valueToString());
+   }
+   else if(name == FSDG_KW)
+   {
+      setDowngrade(property->valueToString());
+   }
+   else if(name == FSDGDT_KW)
+   {
+      setDowngradingDate(property->valueToString());
+   }
+   else if(name == FSCLTX_KW)
+   {
+      setClassificationText(property->valueToString());
+   }
+   else if(name == FSCATP_KW)
+   {
+      setClassificationAuthorityType(property->valueToString());
+   }
+   else if(name == FSCRSN_KW)
+   {
+      setClassificationReason(property->valueToString());
+   }
+   else if(name == FSSRDT_KW)
+   {
+      setSecuritySourceDate(property->valueToString());
+   }
+   else if(name == FBKGC_KW)
+   {
+      ossimColorProperty* colorProp = PTR_CAST(ossimColorProperty, property.get());
+      if (colorProp)
+      {
+         ossim_uint8 r = colorProp->getRed();
+         ossim_uint8 g = colorProp->getGreen();
+         ossim_uint8 b = colorProp->getBlue();
+
+         setFileBackgroundColor(r, g, b);
+      }
+      else
+      {
+        ossimString value = property->valueToString();
+        std::vector<ossimString> splitString;
+        value = value.trim();
+        value.split(splitString, " ");
+        if(splitString.size() == 3)
+        {
+           setFileBackgroundColor((ossim_uint8)splitString[0].toUInt32(), 
+                                  (ossim_uint8)splitString[1].toUInt32(), 
+                                  (ossim_uint8)splitString[2].toUInt32());
+        }
+      }
+
+   }
+   else
+   {
+      ossimNitfFileHeaderV2_X::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitfFileHeaderV2_1::getProperty(const ossimString& name)const
+{
+   ossimProperty* property = 0;
+   ossimStringProperty* stringProperty = 0;
+   ossimColorProperty* colorProperty = 0;
+
+   if(name == CLEVEL_KW)
+   {
+      property = new ossimStringProperty(name, getComplexityLevel().trim());
+   }
+   else if(name == FSCLSY_KW)
+   {
+      property = new ossimStringProperty(name,
+                                               getSecurityClassificationSys().trim());
+   }
+   else if(name == FSDCTP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getDeclassificationType().trim());
+   }
+   else if(name == FSDCDT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getDeclassificationDate().trim());
+   }
+   else if(name == FSDCXM_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getDeclassificationExemption().trim());
+   }
+   else if(name == FSDG_KW)
+   {
+      stringProperty = new ossimStringProperty(name,
+                                               getDowngrade().trim(),
+                                               false);
+      
+      stringProperty->addConstraint("");
+      stringProperty->addConstraint("S");
+      stringProperty->addConstraint("C");
+      stringProperty->addConstraint("R");
+
+      property = stringProperty;
+   }
+   else if(name == FSDGDT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getDowngradingDate().trim());
+   }
+   else if(name == FSCLTX_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getClassificationText().trim());
+   }
+   else if(name == FSCATP_KW)
+   {
+      stringProperty = new ossimStringProperty(name,
+                                               getClassificationAuthorityType().trim(),
+                                               false);
+      
+      stringProperty->addConstraint("");
+      stringProperty->addConstraint("O");
+      stringProperty->addConstraint("D");
+      stringProperty->addConstraint("M");
+      
+      property = stringProperty;
+   }
+   else if(name == FSCRSN_KW)
+   {
+      stringProperty = new ossimStringProperty(name,
+                                               getClassificationReason().trim(),
+                                               false);
+      
+      stringProperty->addConstraint("");
+      stringProperty->addConstraint("A");
+      stringProperty->addConstraint("B");
+      stringProperty->addConstraint("C");
+      stringProperty->addConstraint("D");
+      stringProperty->addConstraint("E");
+      stringProperty->addConstraint("F");
+      stringProperty->addConstraint("G");
+      
+      property = stringProperty;
+   }
+   else if(name == FSSRDT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getSecuritySourceDate().trim());
+   }
+   else if(name == FBKGC_KW)
+   {
+      ossim_uint8 r, g, b;
+      getBackgroundColor(r, g, b);
+      
+      colorProperty = new ossimColorProperty(name,
+                                             ossimRgbVector(r, g, b));
+
+      property = colorProperty;
+   }
+   else if(name == ONAME_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theOriginatorsName).trim());
+   }
+   else if(name == OPHONE_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theOriginatorsPhone).trim());
+   }
+   else
+   {
+      return ossimNitfFileHeaderV2_X::getProperty(name);
+   }
+   return property;
+}
+
+
+void ossimNitfFileHeaderV2_1::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfFileHeaderV2_X::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(FSCLSY_KW);
+   propertyNames.push_back(FSDCTP_KW);
+   propertyNames.push_back(FSDCDT_KW);
+   propertyNames.push_back(FSDCXM_KW);
+   propertyNames.push_back(FSDG_KW);
+   propertyNames.push_back(FSDGDT_KW);
+   propertyNames.push_back(FSCLTX_KW);
+   propertyNames.push_back(FSCATP_KW);
+   propertyNames.push_back(FSCRSN_KW);
+   propertyNames.push_back(FSSRDT_KW);
+   propertyNames.push_back(FBKGC_KW);
+}
+
+void ossimNitfFileHeaderV2_1::addTag(ossimNitfTagInformation tag, bool unique)
+{
+   if (unique)
+   {
+      removeTag(tag.getTagName());
+   }
+   theTagList.push_back(tag);
+}
+
+void ossimNitfFileHeaderV2_1::removeTag(const ossimString& tagName)
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theTagList.size(); ++idx)
+   {
+      if(theTagList[idx].getTagName() == tagName)
+      {
+         theTagList.erase(theTagList.begin() + idx);
+         return;
+      }
+   }
+}
+
+bool ossimNitfFileHeaderV2_1::takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
+   ossim_uint32 potentialDesIndex, bool userDefinedTags)
+{
+   overflowTags.clear();
+   std::vector<ossimNitfTagInformation>::iterator iter;
+   std::vector<ossimNitfTagInformation> specifiedTags;
+   const ossimString tagType(userDefinedTags ? "UDHD" : "XHD");
+   for (iter = theTagList.begin(); iter != theTagList.end(); ++iter)
+   {
+      if (iter->getTagType() == tagType)
+      {
+         specifiedTags.push_back(*iter);
+      }
+   }
+
+   std::sort(specifiedTags.begin(), specifiedTags.end());
+
+   ossim_uint32 totalSize = 0;
+   const ossim_uint32 maxSize = 9996;
+   for (iter = specifiedTags.begin(); iter != specifiedTags.end() &&
+      totalSize + iter->getTotalTagLength() <= maxSize; ++iter)
+   {
+      totalSize += iter->getTotalTagLength();
+   }
+
+   for (; iter != specifiedTags.end(); ++iter)
+   {
+      overflowTags.push_back(*iter);
+      removeTag(iter->getTagName());
+   }
+
+   // If there are no overflow tags, then no DES is required
+   if (overflowTags.empty() == true)
+   {
+      potentialDesIndex = 0;
+   }
+
+   std::ostringstream overflowDes;
+   overflowDes << std::setw(3)
+               << std::setfill('0')
+               << std::setiosflags(ios::right)
+               << potentialDesIndex;
+   
+   std::ostringstream tagLength;
+   tagLength << std::setw(5)
+             << std::setfill('0')
+             << std::setiosflags(ios::right)
+             << totalSize;
+
+   // Even if no overflow tags exist, update the fields
+   if (userDefinedTags)
+   {
+      strcpy(theUserDefinedHeaderOverflow, overflowDes.str().c_str());
+      strcpy(theUserDefinedHeaderDataLength, tagLength.str().c_str());
+   }
+   else
+   {
+      strcpy(theExtendedHeaderDataOverflow, overflowDes.str().c_str());
+      strcpy(theExtendedHeaderDataLength, tagLength.str().c_str());
+   }
+
+   return (overflowTags.empty() == false);
+}
+
diff --git a/src/support_data/ossimNitfFileHeaderV2_X.cpp b/src/support_data/ossimNitfFileHeaderV2_X.cpp
new file mode 100644
index 0000000..095d846
--- /dev/null
+++ b/src/support_data/ossimNitfFileHeaderV2_X.cpp
@@ -0,0 +1,546 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimNitfFileHeaderV2_X.cpp 23245 2015-04-08 20:53:04Z rashadkm $
+
+#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+
+#include <iomanip>
+#include <sstream>
+#include <ossim/base/ossimDate.h> /* for ossimLocalTm */
+#include <ossim/base/ossimDateProperty.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNumericProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+
+RTTI_DEF1(ossimNitfFileHeaderV2_X, "ossimNitfFileHeaderV2_X", ossimNitfFileHeader);
+static ossimString monthConversionTable[] = {"   ", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
+
+const ossimString ossimNitfFileHeaderV2_X::FILE_TYPE_KW = "FILE_TYPE";
+const ossimString ossimNitfFileHeaderV2_X::VERSION_KW   = "VERSION";
+const ossimString ossimNitfFileHeaderV2_X::FHDR_KW      = "FHDR";
+const ossimString ossimNitfFileHeaderV2_X::CLEVEL_KW    = "CLEVEL";
+const ossimString ossimNitfFileHeaderV2_X::STYPE_KW     = "STYPE";
+const ossimString ossimNitfFileHeaderV2_X::OSTAID_KW    = "OSTAID";
+const ossimString ossimNitfFileHeaderV2_X::FDT_KW       = "FDT";  
+const ossimString ossimNitfFileHeaderV2_X::FTITLE_KW    = "FTITLE";
+const ossimString ossimNitfFileHeaderV2_X::FSCLAS_KW    = "FSCLAS";
+const ossimString ossimNitfFileHeaderV2_X::FSCODE_KW    = "FSCODE";
+const ossimString ossimNitfFileHeaderV2_X::FSCTLH_KW    = "FSCTLH";
+const ossimString ossimNitfFileHeaderV2_X::FSREL_KW     = "FSREL";
+const ossimString ossimNitfFileHeaderV2_X::FSCAUT_KW    = "FSCAUT";
+const ossimString ossimNitfFileHeaderV2_X::FSCTLN_KW    = "FSCTLN";
+const ossimString ossimNitfFileHeaderV2_X::FSCOP_KW     = "FSCOP";
+const ossimString ossimNitfFileHeaderV2_X::FSCPYS_KW    = "FSCPYS";
+const ossimString ossimNitfFileHeaderV2_X::ENCRYP_KW    = "ENCRYP";
+const ossimString ossimNitfFileHeaderV2_X::ONAME_KW     = "ONAME";
+const ossimString ossimNitfFileHeaderV2_X::OPHONE_KW    = "OPHONE";
+
+ossimNitfFileHeaderV2_X::ossimNitfFileHeaderV2_X()
+{
+}
+
+void ossimNitfFileHeaderV2_X::setComplexityLevel(const ossimString& level)
+{
+   ossimNitfCommon::setField(theComplexityLevel, level, 2, std::ios::right, '0');
+}
+
+void ossimNitfFileHeaderV2_X::setSystemType(const ossimString& systemType)
+{
+   ossimNitfCommon::setField(theSystemType, systemType, 4);
+}
+
+void ossimNitfFileHeaderV2_X::setOriginatingStationId(const ossimString& originationId)
+{
+   ossimNitfCommon::setField(theOriginatingStationId, originationId, 10);
+}
+
+ossimString ossimNitfFileHeaderV2_X::formatDate(const ossimString& version,
+                                                const ossimLocalTm& d)
+{
+   // Convert to ZULU as per spec for both versions.
+   ossimLocalTm d1 = d.convertToGmt();
+   
+   std::ostringstream out;
+
+   if(version.contains("2.1"))
+   {
+      out << std::setw(4)
+      << std::setfill('0')
+      << d1.getYear()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getMonth()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getDay()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getHour()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getMin()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getSec();
+   }
+   else
+   {
+      out  << std::setw(2)
+      << std::setfill('0')
+      << d1.getDay()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getHour()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getMin()
+      << std::setw(2)
+      << std::setfill('0')
+      << d1.getSec()
+      << "Z"
+      <<monthConversionTable[d1.getMonth()]
+      << std::setw(2)
+      << std::setfill('0')
+      <<d1.getShortYear();
+      
+   }
+      
+   return out.str();
+}
+
+void ossimNitfFileHeaderV2_X::setDate(const ossimLocalTm& d)
+{
+   memcpy(theDateTime, formatDate(getVersion(), d).c_str(), 14);
+}
+
+void ossimNitfFileHeaderV2_X::setDate(const ossimString& d)
+{
+   if(d.size()==14)
+   {
+      memcpy(theDateTime, d.c_str(), 14);
+   }
+}
+
+void ossimNitfFileHeaderV2_X::setDate()
+{
+   setDate(ossimLocalTm(0));
+}  
+
+void ossimNitfFileHeaderV2_X::setTitle(const ossimString& title)
+{
+   ossimNitfCommon::setField(theFileTitle, title, 80);
+}
+
+void ossimNitfFileHeaderV2_X::setFileSecurityClassification(const ossimString& securityClassification)
+{
+   ossimNitfCommon::setField(theSecurityClassification, securityClassification, 1);
+}
+
+void ossimNitfFileHeaderV2_X::setCopyNumber(const ossimString& copyNumber)
+{
+   if(copyNumber.trim() == "")
+   {
+      memset(theCopyNumber, '0', 5);
+   }
+   else
+   {
+      ossimNitfCommon::setField(theCopyNumber, copyNumber, 5, std::ios::right, '0');
+   }
+}
+
+void ossimNitfFileHeaderV2_X::setNumberOfCopies(const ossimString& numberOfCopies)
+{
+   if(numberOfCopies.trim() == "")
+   {
+      memset(theNumberOfCopies, 0, 5);
+   }
+   else
+   {
+      ossimNitfCommon::setField(theNumberOfCopies, numberOfCopies, 5, std::ios::right, '0');
+   }
+}
+
+void ossimNitfFileHeaderV2_X::setEncryption(const ossimString& encryption)
+{
+   ossimNitfCommon::setField(theEncryption, encryption, 1);
+}
+
+ossimString ossimNitfFileHeaderV2_X::getComplexityLevel()const
+{
+   return theComplexityLevel;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getSystemType()const
+{
+   return theSystemType;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getOriginatingStationId()const
+{
+   return theOriginatingStationId;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getDate()const
+{
+   return theDateTime;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getTitle()const
+{
+   return theFileTitle;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getSecurityClassification()const
+{
+   return theSecurityClassification;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getCopyNumber()const
+{
+   return theCopyNumber;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getNumberOfCopies()const
+{
+   return theNumberOfCopies;
+}
+
+ossimString ossimNitfFileHeaderV2_X::getEncryption()const
+{
+   return theEncryption;
+}
+
+bool ossimNitfFileHeaderV2_X::isValid()const
+{
+   return true;
+}
+
+void ossimNitfFileHeaderV2_X::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   if(!property.valid()) return;
+
+   ossimString name = property->getName();
+
+   // Make case insensitive:
+   name.upcase();
+
+   if(name == FHDR_KW)
+   {
+      
+   }
+   else if(name == STYPE_KW)
+   {
+      setSystemType(property->valueToString());
+   }
+   else if(name == OSTAID_KW)
+   {
+      setOriginatingStationId(property->valueToString());
+   }
+   else if(name == FDT_KW)
+   {
+      setDate(property->valueToString());
+   }
+   else if(name == FTITLE_KW)
+   {
+      setTitle(property->valueToString());
+   }
+   else if(name == FSCLAS_KW)
+   {
+      setFileSecurityClassification(property->valueToString());
+   }
+   else if(name == FSCODE_KW)
+   {
+      setCodeWords(property->valueToString()); 
+   }
+   else if(name == FSCTLH_KW)
+   {
+      setControlAndHandling(property->valueToString());
+   }
+   else if(name == FSREL_KW)
+   {
+      setReleasingInstructions(property->valueToString());
+   }
+   else if(name == FSCAUT_KW)
+   {
+      setClassificationAuthority(property->valueToString()); 
+   }
+   else if(name == FSCTLN_KW)
+   {
+      setSecurityControlNumber(property->valueToString());
+   }
+   else if(name == FSCOP_KW)
+   {
+      setCopyNumber(property->valueToString());
+   }
+   else if(name == FSCPYS_KW)
+   {
+      setNumberOfCopies(property->valueToString());
+   }
+   else if(name == ENCRYP_KW)
+   {
+      setEncryption(property->valueToString());
+   }
+   else if(name == ONAME_KW)
+   {
+      setOriginatorsName(property->valueToString());
+   }
+   else if(name == OPHONE_KW)
+   {
+      setOriginatorsPhone(property->valueToString());
+   }
+   else
+   {
+      ossimNitfFileHeader::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitfFileHeaderV2_X::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> property = 0;
+   
+   if(name == FHDR_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(theFileTypeVersion));
+   }
+   else if(name == VERSION_KW)
+   {
+      property = new ossimStringProperty(name, ossimString(getVersion()));
+   }
+   else if(name == FILE_TYPE_KW)
+   {
+      property = new ossimStringProperty(name, "NITF");
+   }
+   else if(name == CLEVEL_KW)
+   {
+      ossimNumericProperty* numericProperty =
+         new ossimNumericProperty(name,
+                                  getComplexityLevel(),
+                                  1,
+                                  99);
+      numericProperty->setNumericType(ossimNumericProperty::ossimNumericPropertyType_INT);
+      property = numericProperty;
+      
+   }
+   else if(name == STYPE_KW)
+   {
+      property = new ossimStringProperty(name, getSystemType().trim());
+   }
+   else if(name == OSTAID_KW)
+   {
+      property = new ossimStringProperty(name, getOriginatingStationId().trim());
+   }
+   else if(name == FDT_KW)
+   {
+      property = new ossimStringProperty(name, getDate());
+   }
+   else if(name == FTITLE_KW)
+   {
+      property = new ossimStringProperty(name, getTitle().trim());
+   }
+   else if(name == FSCLAS_KW)
+   {
+      ossimStringProperty* stringProperty =
+         new ossimStringProperty(name,
+                                 getSecurityClassification().trim(),
+                                 false);
+      
+      stringProperty->addConstraint("");
+      stringProperty->addConstraint("T");
+      stringProperty->addConstraint("S");
+      stringProperty->addConstraint("C");
+      stringProperty->addConstraint("R");
+      stringProperty->addConstraint("U");
+      
+      property = stringProperty;
+   }
+   else if(name == FSCODE_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getCodeWords().trim());
+   }
+   else if(name == FSCTLH_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getControlAndHandling().trim());
+   }
+   else if(name == FSREL_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getReleasingInstructions().trim());
+   }
+   else if(name == FSCAUT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getClassificationAuthority().trim());
+   }
+   else if(name == FSCTLN_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getSecurityControlNumber().trim());
+      
+   }
+   else if(name == FSCOP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getCopyNumber().trim());
+   }
+   else if(name == FSCPYS_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getNumberOfCopies().trim());
+   }
+   else if(name == ENCRYP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         getEncryption().trim(),
+                                         false);
+   }
+   else
+   {
+      property = ossimNitfFileHeader::getProperty(name).get();
+   }
+   
+   return property;
+}
+
+bool ossimNitfFileHeaderV2_X::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = ossimNitfFileHeader::saveState(kwl, prefix);
+   
+   if(result)
+   {
+      kwl.add(prefix, FHDR_KW.c_str(),   theFileTypeVersion);
+      kwl.add(prefix, CLEVEL_KW.c_str(), theComplexityLevel);
+      kwl.add(prefix, STYPE_KW.c_str(),  theSystemType);
+      kwl.add(prefix, OSTAID_KW.c_str(), theOriginatingStationId);
+      kwl.add(prefix, FDT_KW.c_str(),    theDateTime);
+      kwl.add(prefix, FTITLE_KW.c_str(), theFileTitle);
+      kwl.add(prefix, FSCLAS_KW.c_str(), theSecurityClassification);
+      kwl.add(prefix, FSCOP_KW.c_str(),  theCopyNumber);
+      kwl.add(prefix, FSCPYS_KW.c_str(), theNumberOfCopies);
+      kwl.add(prefix, ENCRYP_KW.c_str(), theEncryption);
+   }
+   
+   return result;
+}
+
+bool ossimNitfFileHeaderV2_X::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // Note: Currently not looking up all fieds only ones that make sense.
+   
+   const char* lookup;
+
+   lookup = kwl.find( prefix, CLEVEL_KW);
+   if ( lookup )
+   {
+      setComplexityLevel( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, STYPE_KW);
+   if ( lookup )
+   {
+      setSystemType( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, OSTAID_KW);
+   if ( lookup )
+   {
+      setOriginatingStationId( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FDT_KW);
+   if ( lookup )
+   {
+      setDate( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FTITLE_KW);
+   if ( lookup )
+   {
+      setTitle( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FSCLAS_KW);
+   if ( lookup )
+   {
+      setFileSecurityClassification( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FSCODE_KW);
+   if ( lookup )
+   {
+      setCodeWords( ossimString(lookup) ); 
+   }
+   lookup = kwl.find( prefix, FSCTLH_KW);
+   if ( lookup )
+   {
+      setControlAndHandling( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FSREL_KW);
+   if ( lookup )
+   {
+      setReleasingInstructions( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FSCAUT_KW);
+   if ( lookup )
+   {
+      setClassificationAuthority( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FSCTLN_KW);
+   if ( lookup )
+   {
+      setSecurityControlNumber( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FSCOP_KW);
+   if ( lookup )
+   {
+      setCopyNumber( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, FSCPYS_KW);
+   if ( lookup )
+   {
+      setNumberOfCopies( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ENCRYP_KW);
+   if ( lookup )
+   {
+      setEncryption( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ONAME_KW);
+   if ( lookup )
+   {
+      setOriginatorsName( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, OPHONE_KW);
+   if ( lookup )
+   {
+      setOriginatorsPhone( ossimString(lookup) );
+   }
+
+   return true;
+}
+
+void ossimNitfFileHeaderV2_X::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfFileHeader::getPropertyNames(propertyNames);
+   propertyNames.push_back(FILE_TYPE_KW);
+   propertyNames.push_back(VERSION_KW);
+   propertyNames.push_back(FHDR_KW);
+   propertyNames.push_back(CLEVEL_KW);
+   propertyNames.push_back(STYPE_KW);
+   propertyNames.push_back(OSTAID_KW);
+   propertyNames.push_back(FDT_KW);
+   propertyNames.push_back(FTITLE_KW);
+   propertyNames.push_back(FSCLAS_KW);
+   propertyNames.push_back(FSCODE_KW);
+   propertyNames.push_back(FSCTLH_KW);
+   propertyNames.push_back(FSREL_KW);
+   propertyNames.push_back(FSCAUT_KW);
+   propertyNames.push_back(FSCTLN_KW);
+   propertyNames.push_back(FSCOP_KW);
+   propertyNames.push_back(FSCPYS_KW);
+   propertyNames.push_back(ENCRYP_KW);
+   propertyNames.push_back(ONAME_KW);
+   propertyNames.push_back(OPHONE_KW);
+}
diff --git a/src/support_data/ossimNitfGeoPositioningTag.cpp b/src/support_data/ossimNitfGeoPositioningTag.cpp
new file mode 100644
index 0000000..5a4b0ea
--- /dev/null
+++ b/src/support_data/ossimNitfGeoPositioningTag.cpp
@@ -0,0 +1,142 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfGeoPositioningTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+RTTI_DEF1(ossimNitfGeoPositioningTag, "ossimNitfGeoPositioningTag", ossimNitfRegisteredTag);
+
+ossimNitfGeoPositioningTag::ossimNitfGeoPositioningTag()
+   : ossimNitfRegisteredTag(std::string("GEOPSB"),  443)
+{
+   clearFields();
+}
+
+ossimNitfGeoPositioningTag::~ossimNitfGeoPositioningTag()
+{
+}
+
+void ossimNitfGeoPositioningTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theType, 3);
+   in.read(theCoordinateUnits, 3);
+   in.read(theGeodeticDatumName, 80);
+   in.read(theGeodeticDatumCode, 4);
+   in.read(theEllipsoidName, 80);
+   in.read(theEllipsoidCode, 3);
+   in.read(theVerticalDatumReference, 80);
+   in.read(theVerticalReferenceCode, 4);
+   in.read(theSoundingDatumName, 80);
+   in.read(theSoundingDatumCode, 4);
+   in.read(theZFalseOrigin, 15);
+   in.read(theGridCode, 3);
+   in.read(theGridDescription, 80);
+   in.read(theGridZoneNumber, 4);
+}
+
+void ossimNitfGeoPositioningTag::writeStream(std::ostream& out)
+{
+   out.write(theType, 3);
+   out.write(theCoordinateUnits, 3);
+   out.write(theGeodeticDatumName, 80);
+   out.write(theGeodeticDatumCode, 4);
+   out.write(theEllipsoidName, 80);
+   out.write(theEllipsoidCode, 3);
+   out.write(theVerticalDatumReference, 80);
+   out.write(theVerticalReferenceCode, 4);
+   out.write(theSoundingDatumName, 80);
+   out.write(theSoundingDatumCode, 4);
+   out.write(theZFalseOrigin, 15);
+   out.write(theGridCode, 3);
+   out.write(theGridDescription, 80);
+   out.write(theGridZoneNumber, 4);
+}
+
+void ossimNitfGeoPositioningTag::clearFields()
+{
+   memset(theType, ' ', 3);
+   memset(theCoordinateUnits, ' ', 3);
+   memset(theGeodeticDatumName, ' ', 80);
+   memset(theGeodeticDatumCode, ' ', 4);
+   memset(theEllipsoidName, ' ', 80);
+   memset(theEllipsoidCode, ' ', 3);
+   memset(theVerticalDatumReference, ' ', 80);
+   memset(theVerticalReferenceCode, ' ', 4);
+   memset(theSoundingDatumName, ' ', 80);
+   memset(theSoundingDatumCode, ' ', 4);
+   memset(theZFalseOrigin, '0', 15);
+   memset(theGridCode, ' ', 3);
+   memset(theGridDescription, ' ', 80);
+   memset(theGridZoneNumber, '0',  4);
+   
+   memcpy(theType, "MAP", 3);
+   memcpy(theCoordinateUnits, "M  ", 3);
+   memcpy(theGeodeticDatumName, "World Geodetic System 1984", 26);
+   memcpy(theGeodeticDatumCode, "WGE", 3);
+   memcpy(theEllipsoidName, "World Geodetic System 1984", 26);
+   memcpy(theEllipsoidCode, "WE", 2);
+   memcpy(theVerticalDatumReference, "Geodetic", 8);
+   memcpy(theVerticalReferenceCode, "GEOD", 4);
+   memcpy(theSoundingDatumName, "Mean Sea", 8);
+   memcpy(theSoundingDatumCode, "MSL", 3);
+
+   theType[3]                    = '\0';
+   theCoordinateUnits[3]         = '\0';
+   theGeodeticDatumName[80]      = '\0';
+   theGeodeticDatumCode[4]       = '\0';
+   theEllipsoidName[80]          = '\0';
+   theEllipsoidCode[3]           = '\0';
+   theVerticalDatumReference[80] = '\0';
+   theVerticalReferenceCode[4]   = '\0';
+   theSoundingDatumName[80]      = '\0';
+   theSoundingDatumCode[4]       = '\0';
+   theZFalseOrigin[15]           = '\0';
+   theGridCode[3]                = '\0';
+   theGridDescription[80]        = '\0';
+   theGridZoneNumber[4]          = '\0';
+   
+}
+
+std::ostream& ossimNitfGeoPositioningTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "TYP:" << theType << "\n"
+       << pfx << std::setw(24) << "UNI:" << theCoordinateUnits << "\n"
+       << pfx << std::setw(24) << "DAG:" << theGeodeticDatumName << "\n"
+       << pfx << std::setw(24) << "DCD:" << theGeodeticDatumCode << "\n"
+       << pfx << std::setw(24) << "ELL:" << theEllipsoidName << "\n"
+       << pfx << std::setw(24) << "ELC:" << theEllipsoidCode << "\n"
+       << pfx << std::setw(24) << "DVR:" << theVerticalDatumReference << "\n"
+       << pfx << std::setw(24) << "VDCDVR:" << theVerticalReferenceCode << "\n"
+       << pfx << std::setw(24) << "SDA:" << theSoundingDatumName << "\n"
+       << pfx << std::setw(24) << "VDCSDA:" << theSoundingDatumCode << "\n"
+       << pfx << std::setw(24) << "ZOR:" << theZFalseOrigin << "\n"
+       << pfx << std::setw(24) << "GRD:" << theGridCode << "\n"
+       << pfx << std::setw(24) << "GRN:" << theGridDescription << "\n"
+       << pfx << std::setw(24) << "ZNA:" << theGridZoneNumber << "\n";
+   
+   return out;
+}
diff --git a/ossim/src/ossim/support_data/ossimNitfHistoaTag.cpp b/src/support_data/ossimNitfHistoaTag.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfHistoaTag.cpp
rename to src/support_data/ossimNitfHistoaTag.cpp
diff --git a/src/support_data/ossimNitfIchipbTag.cpp b/src/support_data/ossimNitfIchipbTag.cpp
new file mode 100644
index 0000000..f2dabe9
--- /dev/null
+++ b/src/support_data/ossimNitfIchipbTag.cpp
@@ -0,0 +1,612 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description: ICHIPB tag class declaration.
+//
+// See document STDI-0002 Table 5-2 for more info.
+// 
+// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfIchipbTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <cstring> /* for memcpy */
+#include <iomanip>
+#include <iostream>
+
+#include <ossim/support_data/ossimNitfIchipbTag.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossim2dBilinearTransform.h>
+
+static const ossimString XFRM_FLAG_KW = "XFRM_FLAG";
+static const ossimString SCALE_FACTOR_KW = "SCALE_FACTOR";
+static const ossimString ANAMRPH_CORR_KW = "ANAMRPH_CORR";
+static const ossimString SCANBLK_NUM_KW = "SCANBLK_NUM";
+static const ossimString OP_ROW_11_KW = "OP_ROW_11";
+static const ossimString OP_COL_11_KW = "OP_COL_11";
+static const ossimString OP_ROW_12_KW = "OP_ROW_12";
+static const ossimString OP_COL_12_KW = "OP_COL_12";
+static const ossimString OP_ROW_21_KW = "OP_ROW_21";
+static const ossimString OP_COL_21_KW = "OP_COL_21";
+static const ossimString OP_ROW_22_KW = "OP_ROW_22";
+static const ossimString OP_COL_22_KW = "OP_COL_22";
+static const ossimString FI_ROW_11_KW = "FI_ROW_11";
+static const ossimString FI_COL_11_KW = "FI_COL_11";
+static const ossimString FI_ROW_12_KW = "FI_ROW_12";
+static const ossimString FI_COL_12_KW = "FI_COL_12";
+static const ossimString FI_ROW_21_KW = "FI_ROW_21";
+static const ossimString FI_COL_21_KW = "FI_COL_21";
+static const ossimString FI_ROW_22_KW = "FI_ROW_22";
+static const ossimString FI_COL_22_KW = "FI_COL_22";
+static const ossimString FI_ROW_KW = "FI_ROW";
+static const ossimString FI_COL_KW = "FI_COL";
+
+RTTI_DEF1(ossimNitfIchipbTag, "ossimNitfIchipbTag", ossimNitfRegisteredTag);
+
+ossimNitfIchipbTag::ossimNitfIchipbTag()
+   : ossimNitfRegisteredTag(std::string("ICHIPB"), 224)
+{
+   clearFields();
+}
+
+void ossimNitfIchipbTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(theXfrmFlag,     XFRM_FLAG_SIZE);
+   in.read(theScaleFactor,  SCALE_FACTOR_SIZE);
+   in.read(theAnamrphCorr,  ANAMRPH_CORR_SIZE);
+   in.read(theScanBlock,    SCANBLK_NUM_SIZE);
+   in.read(theOpRow11,      OP_ROW_11_SIZE);
+   in.read(theOpCol11,      OP_COL_11_SIZE);
+   in.read(theOpRow12,      OP_ROW_12_SIZE);
+   in.read(theOpCol12,      OP_COL_12_SIZE);
+   in.read(theOpRow21,      OP_ROW_21_SIZE);
+   in.read(theOpCol21,      OP_COL_21_SIZE);
+   in.read(theOpRow22,      OP_ROW_22_SIZE);
+   in.read(theOpCol22,      OP_COL_22_SIZE);
+   in.read(theFiRow11,      FI_ROW_11_SIZE);
+   in.read(theFiCol11,      FI_COL_11_SIZE);
+   in.read(theFiRow12,      FI_ROW_12_SIZE);
+   in.read(theFiCol12,      FI_COL_12_SIZE);
+   in.read(theFiRow21,      FI_ROW_21_SIZE);
+   in.read(theFiCol21,      FI_COL_21_SIZE);
+   in.read(theFiRow22,      FI_ROW_22_SIZE);
+   in.read(theFiCol22,      FI_COL_22_SIZE);
+   in.read(theFullImageRow, FI_ROW_SIZE);
+   in.read(theFullImageCol, FI_COL_SIZE);
+}
+
+void ossimNitfIchipbTag::writeStream(std::ostream& out)
+{
+   out.write(theXfrmFlag,     XFRM_FLAG_SIZE);
+   out.write(theScaleFactor,  SCALE_FACTOR_SIZE);
+   out.write(theAnamrphCorr,  ANAMRPH_CORR_SIZE);
+   out.write(theScanBlock,    SCANBLK_NUM_SIZE);
+   out.write(theOpRow11,      OP_ROW_11_SIZE);
+   out.write(theOpCol11,      OP_COL_11_SIZE);
+   out.write(theOpRow12,      OP_ROW_12_SIZE);
+   out.write(theOpCol12,      OP_COL_12_SIZE);
+   out.write(theOpRow21,      OP_ROW_21_SIZE);
+   out.write(theOpCol21,      OP_COL_21_SIZE);
+   out.write(theOpRow22,      OP_ROW_22_SIZE);
+   out.write(theOpCol22,      OP_COL_22_SIZE);
+   out.write(theFiRow11,      FI_ROW_11_SIZE);
+   out.write(theFiCol11,      FI_COL_11_SIZE);
+   out.write(theFiRow12,      FI_ROW_12_SIZE);
+   out.write(theFiCol12,      FI_COL_12_SIZE);
+   out.write(theFiRow21,      FI_ROW_21_SIZE);
+   out.write(theFiCol21,      FI_COL_21_SIZE);
+   out.write(theFiRow22,      FI_ROW_22_SIZE);
+   out.write(theFiCol22,      FI_COL_22_SIZE);
+   out.write(theFullImageRow, FI_ROW_SIZE);
+   out.write(theFullImageCol, FI_COL_SIZE);
+}
+
+void ossimNitfIchipbTag::clearFields()
+{
+   memset(theXfrmFlag,     '0', XFRM_FLAG_SIZE);
+   memset(theScaleFactor,  '0', SCALE_FACTOR_SIZE);
+   memset(theAnamrphCorr,  '0', ANAMRPH_CORR_SIZE);
+   memset(theScanBlock,    '0', SCANBLK_NUM_SIZE);
+   memset(theOpRow11,      '0', OP_ROW_11_SIZE);
+   memset(theOpCol11,      '0', OP_COL_11_SIZE);
+   memset(theOpRow12,      '0', OP_ROW_12_SIZE);
+   memset(theOpCol12,      '0', OP_COL_12_SIZE);
+   memset(theOpRow21,      '0', OP_ROW_21_SIZE);
+   memset(theOpCol21,      '0', OP_COL_21_SIZE);
+   memset(theOpRow22,      '0', OP_ROW_22_SIZE);
+   memset(theOpCol22,      '0', OP_COL_22_SIZE);
+   memset(theFiRow11,      '0', FI_ROW_11_SIZE);
+   memset(theFiCol11,      '0', FI_COL_11_SIZE);
+   memset(theFiRow12,      '0', FI_ROW_12_SIZE);
+   memset(theFiCol12,      '0', FI_COL_12_SIZE);
+   memset(theFiRow21,      '0', FI_ROW_21_SIZE);
+   memset(theFiCol21,      '0', FI_COL_21_SIZE);
+   memset(theFiRow22,      '0', FI_ROW_22_SIZE);
+   memset(theFiCol22,      '0', FI_COL_22_SIZE);
+   memset(theFullImageRow, '0', FI_ROW_SIZE);
+   memset(theFullImageCol, '0', FI_COL_SIZE);
+
+   theXfrmFlag[XFRM_FLAG_SIZE]       = '\0';
+   theScaleFactor[SCALE_FACTOR_SIZE] = '\0';
+   theAnamrphCorr[ANAMRPH_CORR_SIZE] = '\0';
+   theScanBlock[SCANBLK_NUM_SIZE]    = '\0';
+   theOpRow11[OP_ROW_11_SIZE]        = '\0';
+   theOpCol11[OP_COL_11_SIZE]        = '\0';
+   theOpRow12[OP_ROW_12_SIZE]        = '\0';
+   theOpCol12[OP_COL_12_SIZE]        = '\0';
+   theOpRow21[OP_ROW_21_SIZE]        = '\0';
+   theOpCol21[OP_COL_21_SIZE]        = '\0';
+   theOpRow22[OP_ROW_22_SIZE]        = '\0';
+   theOpCol22[OP_COL_22_SIZE]        = '\0';
+   theFiRow11[FI_ROW_11_SIZE]        = '\0';
+   theFiCol11[FI_COL_11_SIZE]        = '\0';
+   theFiRow12[FI_ROW_12_SIZE]        = '\0';
+   theFiCol12[FI_COL_12_SIZE]        = '\0';
+   theFiRow21[FI_ROW_21_SIZE]        = '\0';
+   theFiCol21[FI_COL_21_SIZE]        = '\0';
+   theFiRow22[FI_ROW_22_SIZE]        = '\0';
+   theFiCol22[FI_COL_22_SIZE]        = '\0';
+   theFullImageRow[FI_ROW_SIZE]      = '\0';
+   theFullImageCol[FI_COL_SIZE]      = '\0';
+}
+
+std::ostream& ossimNitfIchipbTag::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"
+       << getTagLength() << "\n"
+       << pfx << std::setw(24) << "XFRM_FLAG:"     << theXfrmFlag << "\n"
+       << pfx << std::setw(24) << "SCALE_FACTOR:"  << theScaleFactor << "\n"
+       << pfx << std::setw(24) << "ANAMRPH_CORR:"  << theAnamrphCorr << "\n"
+       << pfx << std::setw(24) << "SCANBLK_NUM:"   << theScanBlock << "\n"
+       << pfx << std::setw(24) << "OP_ROW_11:"     << theOpRow11 << "\n"
+       << pfx << std::setw(24) << "OP_COL_11:"     << theOpCol11 << "\n"
+       << pfx << std::setw(24) << "OP_ROW_12:"     << theOpRow12 << "\n"
+       << pfx << std::setw(24) << "OP_COL_12:"     << theOpCol12 << "\n"
+       << pfx << std::setw(24) << "OP_ROW_21:"     << theOpRow21 << "\n"
+       << pfx << std::setw(24) << "OP_COL_21:"     << theOpCol21 << "\n"
+       << pfx << std::setw(24) << "OP_ROW_22:"     << theOpRow22 << "\n"
+       << pfx << std::setw(24) << "OP_COL_22:"     << theOpCol22 << "\n"
+       << pfx << std::setw(24) << "FI_ROW_11:"     << theFiRow11 << "\n"
+       << pfx << std::setw(24) << "FI_COL_11:"     << theFiCol11 << "\n"
+       << pfx << std::setw(24) << "FI_ROW_12:"     << theFiRow12 << "\n"
+       << pfx << std::setw(24) << "FI_COL_12:"     << theFiCol12 << "\n"
+       << pfx << std::setw(24) << "FI_ROW_21:"     << theFiRow21 << "\n"
+       << pfx << std::setw(24) << "FI_COL_21:"     << theFiCol21 << "\n"
+       << pfx << std::setw(24) << "FI_ROW_22:"     << theFiRow22 << "\n"
+       << pfx << std::setw(24) << "FI_COL_22:"     << theFiCol22 << "\n"
+       << pfx << std::setw(24) << "FI_ROW:"        << theFullImageRow << "\n"
+       << pfx << std::setw(24) << "FI_COL:"        << theFullImageCol
+       << std::endl;
+
+   return out;
+}
+
+bool ossimNitfIchipbTag::getXfrmFlag() const
+{
+   return ossimString::toBool(theXfrmFlag);
+}
+
+ossim_float64 ossimNitfIchipbTag::getScaleFactor() const
+{
+   return ossimString::toFloat64(theScaleFactor);
+}
+
+bool ossimNitfIchipbTag::getAnamrphCorrFlag() const
+{
+   return ossimString::toBool(theAnamrphCorr);
+}
+
+ossim_uint32 ossimNitfIchipbTag::getScanBlock() const
+{
+   return ossimString::toUInt32(theScanBlock);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpRow11() const
+{
+   return ossimString::toFloat64(theOpRow11);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpCol11() const
+{
+   return ossimString::toFloat64(theOpCol11);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpRow12() const
+{
+   return ossimString::toFloat64(theOpRow12);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpCol12() const
+{
+   return ossimString::toFloat64(theOpCol12);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpRow21() const
+{
+   return ossimString::toFloat64(theOpRow21);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpCol21()
+   const
+{ return ossimString::toFloat64(theOpCol21);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpRow22() const
+{
+   return ossimString::toFloat64(theOpRow22);
+}
+
+ossim_float64 ossimNitfIchipbTag::getOpCol22() const
+{
+   return ossimString::toFloat64(theOpCol22);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiRow11() const
+{
+   return ossimString::toFloat64(theFiRow11);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiCol11() const
+{
+   return ossimString::toFloat64(theFiCol11);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiRow12() const
+{
+   return ossimString::toFloat64(theFiRow12);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiCol12() const
+{
+   return ossimString::toFloat64(theFiCol12);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiRow21() const
+{
+   return ossimString::toFloat64(theFiRow21);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiCol21() const
+{
+   return ossimString::toFloat64(theFiCol21);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiRow22() const
+{
+   return ossimString::toFloat64(theFiRow22);
+}
+
+ossim_float64 ossimNitfIchipbTag::getFiCol22() const
+{
+   return ossimString::toFloat64(theFiCol22);
+}
+
+ossim_uint32 ossimNitfIchipbTag::getFullImageRows() const
+{
+   return ossimString::toUInt32(theFullImageRow);
+}
+
+ossim_uint32 ossimNitfIchipbTag::getFullImageCols() const
+{
+   return ossimString::toUInt32(theFullImageCol);
+}
+ 
+#if 0
+void ossimNitfIchipbTag::getImageRect(ossimDrect& rect) const
+{
+   ossimDpt pt;
+
+   pt.x = getOpCol11() - 0.5;
+   pt.y = getOpRow11() - 0.5;
+   rect.set_ul(pt);
+
+   pt.x = getOpCol22() - 0.5;
+   pt.y = getOpRow22() - 0.5;
+   rect.set_lr(pt);
+}
+
+void ossimNitfIchipbTag::getFullImageRect(ossimDrect& rect) const
+{
+   ossimDpt pt;
+
+   ossim_float64 minX = ossim::min(getFiCol11(), getFiCol22());
+   ossim_float64 maxX = ossim::max(getFiCol11(), getFiCol22());
+   ossim_float64 minY = ossim::min(getFiRow11(), getFiRow22());
+   ossim_float64 maxY = ossim::max(getFiRow11(), getFiRow22());
+   
+   pt.x = minX - 0.5;
+   pt.y = minY - 0.5;
+   rect.set_ul(pt);
+
+   pt.x = maxX - 0.5;
+   pt.y = maxY - 0.5;
+   rect.set_lr(pt);
+}
+
+void ossimNitfIchipbTag::getSubImageOffset(ossimDpt& pt) const
+{
+   ossimDrect rect;
+   
+   getFullImageRect(rect);
+   
+   pt = rect.ul();
+}
+#endif
+
+ossim2dTo2dTransform* ossimNitfIchipbTag::newTransform()const
+{
+   return new ossim2dBilinearTransform(ossimDpt(getOpCol11(), getOpRow11()),
+                                       ossimDpt(getOpCol12(), getOpRow12()),
+                                       ossimDpt(getOpCol21(), getOpRow21()),
+                                       ossimDpt(getOpCol22(), getOpRow22()),
+                                       ossimDpt(getFiCol11(), getFiRow11()),
+                                       ossimDpt(getFiCol12(), getFiRow12()),
+                                       ossimDpt(getFiCol21(), getFiRow21()),
+                                       ossimDpt(getFiCol22(), getFiRow22()));
+}
+
+void ossimNitfIchipbTag::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimNitfRegisteredTag::setProperty(property);   
+}
+
+ossimRefPtr<ossimProperty> ossimNitfIchipbTag::getProperty(const ossimString& name)const
+{
+   ossimProperty* result = 0;
+
+   if(name == XFRM_FLAG_KW)
+   {
+      result = new ossimStringProperty(name, theXfrmFlag);
+   }
+   else if(name == SCALE_FACTOR_KW)
+   {
+      result = new ossimStringProperty(name, theScaleFactor);
+   }
+   else if(name == ANAMRPH_CORR_KW)
+   {
+      result = new ossimStringProperty(name, theAnamrphCorr);
+   }
+   else if(name == SCANBLK_NUM_KW)
+   {
+      result = new ossimStringProperty(name, theScanBlock);
+   }
+   else if(name == OP_ROW_11_KW)
+   {
+      result = new ossimStringProperty(name, theOpRow11);
+   }
+   else if(name == OP_COL_11_KW)
+   {
+      result = new ossimStringProperty(name, theOpCol11);
+   }
+   else if(name == OP_ROW_12_KW)
+   {
+      result = new ossimStringProperty(name,theOpRow12 );
+   }
+   else if(name == OP_COL_12_KW)
+   {
+      result = new ossimStringProperty(name, theOpCol12);
+   }
+   else if(name == OP_ROW_21_KW)
+   {
+      result = new ossimStringProperty(name,theOpRow21);
+   }
+   else if(name == OP_COL_21_KW)
+   {
+      result = new ossimStringProperty(name, theOpCol21);
+   }
+   else if(name == OP_ROW_22_KW)
+   {
+      result = new ossimStringProperty(name, theOpRow22);
+   }
+   else if(name == OP_COL_22_KW)
+   {
+      result = new ossimStringProperty(name, theOpCol22);
+   }
+   else if(name == FI_ROW_11_KW)
+   {
+      result = new ossimStringProperty(name, theFiRow11);
+   }
+   else if(name == FI_COL_11_KW)
+   {
+      result = new ossimStringProperty(name, theFiCol11);
+   }
+   else if(name == FI_ROW_12_KW)
+   {
+      result = new ossimStringProperty(name, theFiRow12);
+   }
+   else if(name == FI_COL_12_KW)
+   {
+      result = new ossimStringProperty(name, theFiCol12);
+   }
+   else if(name == FI_ROW_21_KW)
+   {
+      result = new ossimStringProperty(name, theFiRow21);
+   }
+   else if(name == FI_COL_21_KW)
+   {
+      result = new ossimStringProperty(name, theFiCol21);
+   }
+   else if(name == FI_ROW_22_KW)
+   {
+      result = new ossimStringProperty(name, theFiRow22);
+   }
+   else if(name == FI_COL_22_KW)
+   {
+      result = new ossimStringProperty(name, theFiCol22);
+   }
+   else if(name == FI_ROW_KW)
+   {
+      result = new ossimStringProperty(name, theFullImageRow);
+   }
+   else if(name == FI_COL_KW)
+   {
+      result = new ossimStringProperty(name, theFullImageCol);
+   }
+   else
+   {
+      return ossimNitfRegisteredTag::getProperty(name);
+   }
+
+   return result;
+}
+
+void ossimNitfIchipbTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(XFRM_FLAG_KW);
+   propertyNames.push_back(SCALE_FACTOR_KW);
+   propertyNames.push_back(ANAMRPH_CORR_KW);
+   propertyNames.push_back(SCANBLK_NUM_KW);
+   propertyNames.push_back(OP_ROW_11_KW);
+   propertyNames.push_back(OP_COL_11_KW);
+   propertyNames.push_back(OP_ROW_12_KW);
+   propertyNames.push_back(OP_COL_12_KW);
+   propertyNames.push_back(OP_ROW_21_KW);
+   propertyNames.push_back(OP_COL_21_KW);
+   propertyNames.push_back(OP_ROW_22_KW);
+   propertyNames.push_back(OP_COL_22_KW);
+   propertyNames.push_back(FI_ROW_11_KW);
+   propertyNames.push_back(FI_COL_11_KW);
+   propertyNames.push_back(FI_ROW_12_KW);
+   propertyNames.push_back(FI_COL_12_KW);
+   propertyNames.push_back(FI_ROW_21_KW);
+   propertyNames.push_back(FI_COL_21_KW);
+   propertyNames.push_back(FI_ROW_22_KW);
+   propertyNames.push_back(FI_COL_22_KW);
+   propertyNames.push_back(FI_ROW_KW);
+   propertyNames.push_back(FI_COL_KW);
+}
+  
+bool ossimNitfIchipbTag::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup;
+   lookup = kwl.find(prefix, XFRM_FLAG_KW);
+   if(lookup)
+   {
+       strcpy(theXfrmFlag, lookup);
+   }
+   lookup = kwl.find(prefix, SCALE_FACTOR_KW);
+   if(lookup)
+   {
+        strcpy(theScaleFactor, lookup);
+   }
+   lookup = kwl.find(prefix, ANAMRPH_CORR_KW);
+   if(lookup)
+   {
+        strcpy(theAnamrphCorr, lookup);
+   }
+   lookup = kwl.find(prefix, SCANBLK_NUM_KW);
+   if(lookup)
+   {
+        strcpy(theScanBlock, lookup);
+   }
+   lookup = kwl.find(prefix, OP_ROW_11_KW);
+   if(lookup)
+   {
+        strcpy(theOpRow11, lookup);
+   }
+   lookup = kwl.find(prefix, OP_COL_11_KW);
+   if(lookup)
+   {
+        strcpy(theOpCol11, lookup);
+   }
+   lookup = kwl.find(prefix, OP_ROW_12_KW);
+   if(lookup)
+   {
+        strcpy(theOpRow12, lookup);
+   }
+   lookup = kwl.find(prefix, OP_COL_12_KW);
+   if(lookup)
+   {
+        strcpy(theOpCol12, lookup);
+   }
+   lookup = kwl.find(prefix, OP_ROW_21_KW);
+   if(lookup)
+   {
+        strcpy(theOpRow21, lookup);
+   }
+   lookup = kwl.find(prefix, OP_COL_21_KW);
+   if(lookup)
+   {
+        strcpy(theOpCol21, lookup);
+   }
+   lookup = kwl.find(prefix, OP_ROW_22_KW);
+   if(lookup)
+   {
+        strcpy(theOpRow22, lookup);
+   }
+   lookup = kwl.find(prefix, OP_COL_22_KW);
+   if(lookup)
+   {
+        strcpy(theOpCol22, lookup);
+   }
+   lookup = kwl.find(prefix, FI_ROW_11_KW);
+   if(lookup)
+   {
+        strcpy(theFiRow11, lookup);
+   }
+   lookup = kwl.find(prefix, FI_COL_11_KW);
+   if(lookup)
+   {
+        strcpy(theFiCol11, lookup);
+   }
+   lookup = kwl.find(prefix, FI_ROW_12_KW);
+   if(lookup)
+   {
+        strcpy(theFiRow12, lookup);
+   }
+   lookup = kwl.find(prefix, FI_COL_12_KW);
+   if(lookup)
+   {
+        strcpy(theFiCol12, lookup);
+   }
+   lookup = kwl.find(prefix, FI_ROW_21_KW);
+   if(lookup)
+   {
+        strcpy(theFiRow21, lookup);
+   }
+   lookup = kwl.find(prefix, FI_COL_21_KW);
+   if(lookup)
+   {
+        strcpy(theFiCol21, lookup);
+   }
+   lookup = kwl.find(prefix, FI_ROW_22_KW);
+   if(lookup)
+   {
+        strcpy(theFiRow22, lookup);
+   }
+   lookup = kwl.find(prefix, FI_COL_22_KW);
+   if(lookup)
+   {
+        strcpy(theFiCol22, lookup);
+   }
+   lookup = kwl.find(prefix, FI_ROW_KW);
+   if(lookup)
+   {
+        strcpy(theFullImageRow, lookup);
+   }
+   lookup = kwl.find(prefix, FI_COL_KW);
+   if(lookup)
+   {
+        strcpy(theFullImageCol, lookup);
+   }
+
+   return true;
+}
diff --git a/src/support_data/ossimNitfImageBand.cpp b/src/support_data/ossimNitfImageBand.cpp
new file mode 100644
index 0000000..b97cb09
--- /dev/null
+++ b/src/support_data/ossimNitfImageBand.cpp
@@ -0,0 +1,26 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfImageBand.cpp 14241 2009-04-07 19:59:23Z dburken $
+#include <ossim/support_data/ossimNitfImageBand.h>
+#include <ossim/support_data/ossimNitfImageLut.h>
+#include <ossim/base/ossimString.h>
+
+RTTI_DEF1(ossimNitfImageBand, "ossimNitfImageBand", ossimObject);
+
+ossimNitfImageBand::ossimNitfImageBand()
+{
+}
+
+ossimNitfImageBand::~ossimNitfImageBand()
+{
+}
+
diff --git a/src/support_data/ossimNitfImageBandV2_0.cpp b/src/support_data/ossimNitfImageBandV2_0.cpp
new file mode 100644
index 0000000..27d0570
--- /dev/null
+++ b/src/support_data/ossimNitfImageBandV2_0.cpp
@@ -0,0 +1,222 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfImageBandV2_0.cpp 23245 2015-04-08 20:53:04Z rashadkm $
+
+#include <sstream>
+#include <iostream>
+#include <iomanip>
+#include <ossim/support_data/ossimNitfImageBandV2_0.h>
+#include <ossim/base/ossimString.h>
+
+ossimNitfImageBandV2_0::ossimNitfImageBandV2_0()
+{
+   clearFields();
+}
+
+ossimNitfImageBandV2_0::~ossimNitfImageBandV2_0()
+{
+}
+
+void ossimNitfImageBandV2_0::parseStream(std::istream& in)
+{
+   theLookupTables.clear();
+   if(in)
+   {      
+      theLookupTables.clear();
+      in.read(theBandRepresentation, 2);
+      in.read(theBandSignificance, 6);
+      in.read(theBandImageFilterCondition, 1);
+      in.read(theBandStandardImageFilterCode, 3);
+      in.read(theBandNumberOfLuts, 1);
+
+      long numberOfLuts = ossimString(theBandNumberOfLuts).toLong();
+
+      if(numberOfLuts > 0)
+      {
+         theLookupTables.resize(numberOfLuts);
+         in.read(theBandNumberOfLutEntries, 5);
+         
+         ossim_uint32 numberOfLutsIndex = numberOfLuts;
+         ossim_uint32 numberOfLutEntries = ossimString(theBandNumberOfLutEntries).toLong();
+         ossim_uint32 idx = 0;
+
+         while(idx < numberOfLutsIndex)
+         {
+            theLookupTables[idx] = new ossimNitfImageLutV2_0; 
+            theLookupTables[idx]->setNumberOfEntries(numberOfLutEntries);
+            theLookupTables[idx]->parseStream(in);
+            
+            ++idx;
+         }
+      }
+   }   
+}
+
+void ossimNitfImageBandV2_0::writeStream(std::ostream& out)
+{
+   out.write(theBandRepresentation, 2);
+   out.write(theBandSignificance, 6);
+   out.write(theBandImageFilterCondition, 1);
+   out.write(theBandStandardImageFilterCode, 3);
+   out.write(theBandNumberOfLuts, 1);
+
+   if(ossimString(theBandNumberOfLuts).toUInt32() > 0)
+   {
+      // lut output not supported currently
+   }
+}
+
+std::ostream& ossimNitfImageBandV2_0::print(std::ostream& out,
+                                            const std::string& prefix,
+                                            ossim_uint32 band)const
+{
+   std::ostringstream os;
+   os << std::setw(3) << std::setfill('0') << (band+1) << ":";
+
+   ossimString tmpStr = "IREPBAND";
+   tmpStr += os.str();
+   
+   out << prefix << std::setw(24)
+       << tmpStr << theBandRepresentation << "\n";
+
+   tmpStr = "ISUBCAT";
+   tmpStr += os.str();
+   
+   out << prefix << std::setw(24)
+       << tmpStr << theBandSignificance << "\n";
+
+   tmpStr = "IFC";
+   tmpStr += os.str();
+   
+   out << prefix << std::setw(24)
+       << tmpStr << theBandImageFilterCondition << "\n";
+
+   tmpStr = "IMFLT";
+   tmpStr += os.str();
+
+   out << prefix << std::setw(24)
+       << tmpStr << theBandStandardImageFilterCode << "\n";
+
+   tmpStr = "NLUTS";
+   tmpStr += os.str();
+
+   out << prefix << std::setw(24)
+       << tmpStr << theBandNumberOfLuts << "\n";
+
+   tmpStr = "NELUTS";
+   tmpStr += os.str();
+
+   out << prefix << std::setw(24)
+       << tmpStr << theBandNumberOfLutEntries << "\n";
+
+   for(ossim_uint32 idx = 0; idx < theLookupTables.size(); ++idx)
+   {
+      out << *theLookupTables[idx] << std::endl;
+   }
+   
+   return out;
+}
+
+ossim_uint32 ossimNitfImageBandV2_0::getNumberOfLuts()const
+{
+   return static_cast<ossim_uint32>(theLookupTables.size());
+}
+
+const ossimRefPtr<ossimNitfImageLut> ossimNitfImageBandV2_0::getLut(ossim_uint32 idx)const
+{
+   if(idx < getNumberOfLuts())
+   {
+      return theLookupTables[idx];
+   }
+   
+   return NULL;
+}
+
+ossimRefPtr<ossimNitfImageLut> ossimNitfImageBandV2_0::getLut(ossim_uint32 idx)
+{
+   if(idx < getNumberOfLuts())
+   {
+      return theLookupTables[idx];
+   }
+   
+   return NULL;
+}
+
+ossimString ossimNitfImageBandV2_0::getBandRepresentation()const
+{
+   return ossimString(theBandRepresentation);
+}
+
+void ossimNitfImageBandV2_0::setBandRepresentation(const ossimString& rep)
+{
+   std::ostringstream out;
+
+   out << std::setw(2)
+       << std::setfill(' ')
+       << std::setiosflags(std::ios::left)
+       << rep.c_str();
+
+   memcpy(theBandRepresentation, out.str().c_str(), 2);
+}
+
+ossimString ossimNitfImageBandV2_0::getBandSignificance()const
+{
+   return ossimString(theBandSignificance);
+}
+
+void ossimNitfImageBandV2_0::setBandSignificance(const ossimString& rep)
+{
+   std::ostringstream out;
+   
+   out << std::setw(6)
+       << std::setfill(' ')
+       << rep.c_str();
+
+   memcpy(theBandSignificance, out.str().c_str(), 6);
+}
+
+void ossimNitfImageBandV2_0::clearFields()
+{
+   memset(theBandRepresentation, ' ', 2);
+   memset(theBandSignificance, ' ', 6);
+   memset(theBandImageFilterCondition, 'N', 1);
+   memset(theBandStandardImageFilterCode, ' ', 3);
+   memset(theBandNumberOfLuts, 0, 1);
+   memset(theBandNumberOfLutEntries, ' ', 5);
+   
+   theLookupTables.clear();
+   theBandRepresentation[2] = '\0';
+   theBandSignificance[6] = '\0';
+   theBandImageFilterCondition[1] = '\0';
+   theBandStandardImageFilterCode[3] = '\0';
+   theBandNumberOfLuts[1] = '\0';
+   theBandNumberOfLutEntries[5] = '\0';
+}
+
+void ossimNitfImageBandV2_0::printLookupTables(std::ostream& out)const
+{
+   std::vector<ossimRefPtr<ossimNitfImageLut> >::const_iterator tables;
+
+   tables = theLookupTables.begin();
+   while(tables != theLookupTables.end())
+   {
+      if((*tables).valid())
+      {
+         out << *((*tables).get());
+      }
+      ++tables;
+      if(tables != theLookupTables.end())
+      {
+         out << std::endl;
+      }
+   }
+}
diff --git a/ossim/src/ossim/support_data/ossimNitfImageBandV2_1.cpp b/src/support_data/ossimNitfImageBandV2_1.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfImageBandV2_1.cpp
rename to src/support_data/ossimNitfImageBandV2_1.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfImageDataMaskV2_1.cpp b/src/support_data/ossimNitfImageDataMaskV2_1.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfImageDataMaskV2_1.cpp
rename to src/support_data/ossimNitfImageDataMaskV2_1.cpp
diff --git a/src/support_data/ossimNitfImageHeader.cpp b/src/support_data/ossimNitfImageHeader.cpp
new file mode 100644
index 0000000..8ee2ca9
--- /dev/null
+++ b/src/support_data/ossimNitfImageHeader.cpp
@@ -0,0 +1,419 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimNotifyContext.h>
+
+#include <cmath> /* for fmod */
+#include <iomanip>
+#include <ostream>
+#include <sstream>
+
+RTTI_DEF2(ossimNitfImageHeader,
+          "ossimNitfImageHeader",
+          ossimObject,
+          ossimPropertyInterface)
+
+static const char* TAGS_KW = "tags";
+
+ossimNitfImageHeader::ossimNitfImageHeader()
+{
+}
+
+ossimNitfImageHeader::~ossimNitfImageHeader()
+{
+}
+
+bool ossimNitfImageHeader::getTagInformation(ossimNitfTagInformation& tagInfo,
+                                             const ossimString& tagName)const
+{
+   if(theTagList.size())
+   {
+      for(ossim_uint32 idx = 0; idx < theTagList.size(); ++idx)
+      {
+         if(theTagList[idx].getTagName() == tagName)
+         {
+            tagInfo = theTagList[idx];
+            return true;
+         }
+      }
+   }
+   
+   return false;
+}
+
+bool ossimNitfImageHeader::getTagInformation(
+   ossimNitfTagInformation& tagInfo, ossim_uint32 idx) const
+{
+   bool result = false;
+   
+   if(idx < theTagList.size())
+   {
+      tagInfo = theTagList[idx];
+      result = true;
+   }
+   
+   return result;
+}
+
+ossimRefPtr<ossimNitfRegisteredTag> ossimNitfImageHeader::getTagData(
+   const ossimString& tagName)
+{
+   if(theTagList.size())
+   {
+      for(ossim_uint32 idx = 0; idx < theTagList.size(); ++idx)
+      {
+         if(theTagList[idx].getTagName() == tagName)
+         {
+            return theTagList[idx].getTagData();
+         }
+      }
+   }
+
+   return ossimRefPtr<ossimNitfRegisteredTag>();
+}
+   
+const ossimRefPtr<ossimNitfRegisteredTag> ossimNitfImageHeader::getTagData(
+   const ossimString& tagName) const
+{
+   if(theTagList.size())
+   {
+      for(ossim_uint32 idx = 0; idx < theTagList.size(); ++idx)
+      {
+         if(theTagList[idx].getTagName() == tagName)
+         {
+            return theTagList[idx].getTagData();
+         }
+      }
+   }
+   
+   return ossimRefPtr<ossimNitfRegisteredTag>();
+}
+
+void ossimNitfImageHeader::getTagData(
+   const ossimString& tagName,
+   std::vector< const ossimNitfRegisteredTag* > &tags ) const
+{
+   tags.clear();
+   if(theTagList.size())
+   {
+      for(ossim_uint32 idx = 0; idx < theTagList.size(); ++idx)
+      {
+         if(theTagList[idx].getTagName() == tagName)
+         {
+            tags.push_back( theTagList[idx].getTagData().get() );
+         }
+      }
+   }
+}
+
+ossim_uint32 ossimNitfImageHeader::getNumberOfTags()const
+{
+   return static_cast<ossim_uint32>(theTagList.size());
+}
+
+void ossimNitfImageHeader::addTag(const ossimNitfTagInformation& tag, bool unique)
+{
+   if(unique)
+   {
+      removeTag(tag.getTagName());
+   }
+   theTagList.push_back(tag);
+}
+
+void ossimNitfImageHeader::removeTag(const ossimString& tagName)
+{
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theTagList.size(); ++idx)
+   {
+      if(theTagList[idx].getTagName() == tagName)
+      {
+         theTagList.erase(theTagList.begin() + idx);
+         return;
+      }
+   }
+}
+
+bool ossimNitfImageHeader::isSameAs(const ossimNitfImageHeader* hdr) const
+{
+   if (!hdr) return false;
+   
+   return ( (isCompressed() == hdr->isCompressed()) &&
+            (getNumberOfRows() == hdr->getNumberOfRows()) &&
+            (getNumberOfBands() == hdr->getNumberOfBands()) &&
+            (getNumberOfCols() == hdr->getNumberOfCols()) &&
+            (getNumberOfBlocksPerRow() == hdr->getNumberOfBlocksPerRow()) &&
+            (getNumberOfBlocksPerCol() == hdr->getNumberOfBlocksPerCol()) &&
+            (getNumberOfPixelsPerBlockHoriz() ==
+             hdr->getNumberOfPixelsPerBlockHoriz()) &&
+            (getNumberOfPixelsPerBlockVert() ==
+             hdr->getNumberOfPixelsPerBlockVert()) &&
+            (getBitsPerPixelPerBand() == hdr->getBitsPerPixelPerBand()) &&
+            (getImageRect() == hdr->getImageRect()) &&
+            (getIMode() == hdr->getIMode()) &&
+            (getCoordinateSystem() == hdr->getCoordinateSystem()) &&
+            (getGeographicLocation() == hdr->getGeographicLocation()) );
+}
+
+
+void ossimNitfImageHeader::setProperty(ossimRefPtr<ossimProperty> /* property */)
+{
+}
+
+ossimRefPtr<ossimProperty> ossimNitfImageHeader::getProperty(const ossimString& name)const
+{
+   ossimProperty* result = 0;
+
+   if(name == TAGS_KW)
+   {
+      ossim_uint32 idxMax = getNumberOfTags();
+      if(idxMax > 0)
+      {
+         ossimContainerProperty* containerProperty = new ossimContainerProperty;
+         containerProperty->setName(name);
+         ossim_uint32 idx = 0;
+
+         result = containerProperty;
+         for(idx = 0; idx < idxMax; ++idx)
+         {
+            ossimNitfTagInformation tagInfo;
+            getTagInformation(tagInfo, idx);
+            
+            const ossimRefPtr<ossimNitfRegisteredTag> tagData = tagInfo.getTagData();
+            if(tagData.valid())
+            {
+               ossimContainerProperty* containerPropertyTag = new ossimContainerProperty;
+               containerPropertyTag->setName(tagInfo.getTagName());
+               std::vector<ossimRefPtr<ossimProperty> > propertyList;
+               tagData->getPropertyList(propertyList);
+               
+               containerPropertyTag->addChildren(propertyList);
+               containerProperty->addChild(containerPropertyTag);
+            }
+            else
+            {
+               containerProperty->addStringProperty(tagInfo.getTagName(), "", true);
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimNitfImageHeader::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   propertyNames.push_back(TAGS_KW);
+  
+}
+
+ossim_uint32 ossimNitfImageHeader::getTotalTagLength()const
+{
+   ossim_uint32 tagLength = 0;
+   
+   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
+   {
+      tagLength += theTagList[i].getTotalTagLength();
+   }
+
+   return tagLength;
+}
+
+std::ostream& ossimNitfImageHeader::printTags(std::ostream& out,
+                                              const std::string& prefix)const
+{
+   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
+   {
+      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
+      if (tag.valid())
+      {
+         tag->print(out, prefix);
+      }
+   }
+   return out;
+}
+
+void ossimNitfImageHeader::getMetadata(ossimKeywordlist& kwl,
+                                       const char* prefix) const
+{
+   kwl.add(prefix, "source",
+           getImageSource().c_str(),
+           false);
+   kwl.add(prefix,
+           "image_date",
+           getAcquisitionDateMonthDayYear().c_str(),
+           false);
+   kwl.add(prefix,
+           "image_title",
+           getTitle().c_str(),
+           false);
+}
+
+bool ossimNitfImageHeader::hasLut() const
+{
+   bool result = false;
+
+   const ossim_uint32 BANDS = static_cast<ossim_uint32>(getNumberOfBands());
+   for (ossim_uint32 band = 0; band < BANDS; ++band)
+   {
+      const ossimRefPtr<ossimNitfImageBand> imgBand = getBandInformation(band);
+      if(imgBand.valid())
+      {
+         ossim_uint32 luts = imgBand->getNumberOfLuts();
+         if(luts > 0)
+         {
+            if(imgBand->getLut(0).valid())
+            {
+               result = true;
+               break;
+            }
+         }
+      }
+   }
+   
+   return result;
+}
+
+ossimRefPtr<ossimNBandLutDataObject> ossimNitfImageHeader::createLut(
+   ossim_uint32 bandIdx)const
+{
+   ossimRefPtr<ossimNBandLutDataObject> result;
+   
+   if(bandIdx < (ossim_uint32)getNumberOfBands())
+   {
+      const ossimRefPtr<ossimNitfImageBand> band = getBandInformation(bandIdx);
+      if(band.valid())
+      {
+         ossim_uint32 bands = band->getNumberOfLuts();
+         if(bands > 0)
+         {
+            if(band->getLut(0).valid())
+            {
+               ossim_uint32 entries = band->getLut(0)->getNumberOfEntries();
+               
+               result = new ossimNBandLutDataObject();
+               result->create(entries, band->getNumberOfLuts());
+               ossim_uint32 bIdx;
+               ossim_uint32 entryIdx;
+
+               for(bIdx = 0; bIdx < bands; ++bIdx)
+               {
+                  const ossimRefPtr<ossimNitfImageLut> lut = band->getLut(bIdx);
+                  if(lut.valid())
+                  {
+                     for(entryIdx = 0; entryIdx < entries; ++entryIdx)
+                     {
+                        (*result)[entryIdx][bIdx] = (ossimNBandLutDataObject::LUT_ENTRY_TYPE)(lut->getValue(entryIdx));
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+
+void ossimNitfImageHeader::checkForGeographicTiePointTruncation(
+   const ossimDpt& tie) const
+{
+   // One arc second in decimal degrees.
+   const ossim_float64 ARC_SECOND = 1.0/3600.0;
+
+   // Very small number.
+   const ossim_float64 FUDGE_FACTOR = 0.000000001;
+
+   // Remainder portion of latitude divided by an arc second.
+   ossim_float64 y = std::fmod(tie.y, ARC_SECOND);
+
+   // Remainder portion of longitue divided by an arc second.
+   ossim_float64 x = std::fmod(tie.x, ARC_SECOND);
+
+   if ( (std::fabs(y) > FUDGE_FACTOR) || (std::fabs(x) > FUDGE_FACTOR) )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfImageHeader WARNING:\n"
+         << "Tie point will be truncated in image header:  "
+         << tie
+         << std::endl;
+   }
+}
+
+void ossimNitfImageHeader::getDecimationFactor(ossim_float64& result) const
+{
+   //---
+   // Look for string like:
+   // 
+   // "/2" = 1/2
+   // "/4  = 1/4
+   // ...
+   // "/16 = 1/16
+   // 
+   // If it is full resolution it should be "1.0"
+   //
+   // or
+   //
+   // "0.5" which is the same as "/2"
+   // "0.25" which is the same as "/4"
+   //---
+   ossimString os = getImageMagnification();
+
+   // Spec says to fill with spaces so strip them.
+   os.trim(ossimString(" "));
+
+   if (os.size())
+   {
+      if ( os.contains("/") )
+      {
+         os = os.after("/");
+         result = os.toFloat64();
+         if (result)
+         {
+            result = 1.0 / result;
+         }
+      }
+      else
+      {
+         result = os.toFloat64();
+      }
+   }
+   else
+   {
+      result = ossim::nan();
+   }
+}
+
+
+bool ossimNitfImageHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   if(!ossimObject::saveState(kwl, prefix)) return false;
+   ossimString tagsPrefix = prefix;
+   
+   for(ossim_uint32 i = 0; i < theTagList.size(); ++i)
+   {
+      ossimRefPtr<ossimNitfRegisteredTag> tag = theTagList[i].getTagData();
+      if (tag.valid())
+      {
+         if(!tag->saveState(kwl, tagsPrefix))
+         {
+            return false;
+         }
+      }
+   }
+   return true;
+}
diff --git a/src/support_data/ossimNitfImageHeaderV2_0.cpp b/src/support_data/ossimNitfImageHeaderV2_0.cpp
new file mode 100644
index 0000000..0dc9061
--- /dev/null
+++ b/src/support_data/ossimNitfImageHeaderV2_0.cpp
@@ -0,0 +1,1064 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfImageHeaderV2_0.cpp 21518 2012-08-22 21:15:56Z dburken $
+
+#include <ossim/support_data/ossimNitfImageHeaderV2_0.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
+
+#include <cstring> //for memset
+#include <iomanip>
+#include <stdexcept>
+#include <sstream>
+
+static const ossimTrace traceDebug(ossimString("ossimNitfImageHeaderV2_0:debug"));
+
+RTTI_DEF1(ossimNitfImageHeaderV2_0,
+          "ossimNitfImageHeaderV2_0",
+          ossimNitfImageHeaderV2_X);
+
+const ossimString ossimNitfImageHeaderV2_0::ISCODE_KW = "iscode";
+const ossimString ossimNitfImageHeaderV2_0::ISCTLH_KW = "isctlh";
+const ossimString ossimNitfImageHeaderV2_0::ISREL_KW = "isrel";
+const ossimString ossimNitfImageHeaderV2_0::ISCAUT_KW = "iscaut";
+const ossimString ossimNitfImageHeaderV2_0::CTLN_KW = "ctln";
+const ossimString ossimNitfImageHeaderV2_0::ISDWNG_KW = "isdwng";
+const ossimString ossimNitfImageHeaderV2_0::ISDEVT_KW = "isdevt";
+
+ossimNitfImageHeaderV2_0::ossimNitfImageHeaderV2_0()
+{
+   clearFields();
+}
+
+ossimNitfImageHeaderV2_0::~ossimNitfImageHeaderV2_0()
+{
+}
+
+void ossimNitfImageHeaderV2_0::parseStream(ossim::istream& in)
+{
+   clearFields();
+   theImageBands.clear();
+      
+   in.read(theType, 2);
+   if(ossimString(theType) != "IM")
+   {
+      // error
+   }
+   in.read(theImageId, 10);
+   in.read(theDateTime, 14);
+   in.read(theTargetId, 17);
+   in.read(theTitle, 80);
+   in.read(theSecurityClassification, 1);
+   in.read(theCodewords, 40);
+   in.read(theControlAndHandling, 40);
+   in.read(theReleasingInstructions, 40);
+   in.read(theClassificationAuthority, 20);
+   in.read(theSecurityControlNumber, 20);
+   in.read(theSecurityDowngrade, 6);
+   if(ossimString(theSecurityDowngrade) == "999998")
+   {
+      in.read(theDowngradingEvent, 40);
+   }
+   in.read(theEncryption, 1);
+   in.read(theImageSource, 42);
+   in.read(theSignificantRows, 8);
+   in.read(theSignificantCols, 8);
+   in.read(thePixelValueType, 3);
+   in.read(theRepresentation, 8);
+   in.read(theCategory, 8);
+   in.read(theActualBitsPerPixelPerBand, 2);
+   in.read(theJustification, 1);
+   in.read(theCoordinateSystem, 1);
+   if(theCoordinateSystem[0] != 'N')
+   {
+      in.read(theGeographicLocation, 60);
+   }
+   in.read(theNumberOfComments, 1);
+   ossim_uint32 numberOfComments = ossimString(theNumberOfComments).toInt32();
+
+   // for now let's ignore the comments
+   if(numberOfComments > 0)
+   {
+      theImageComments.resize(numberOfComments);
+      for (ossim_uint32 i=0; i < numberOfComments; ++i)
+      {
+        char comment[81];
+        memset(comment, ' ', 80);
+        comment[80] = '\0';
+        in.read(comment, 80);
+        theImageComments[i] = ossimString(comment).trim();
+      }
+   }
+   in.read(theCompression, 2);
+   // check to see if there is compression
+   ossimString temp = theCompression;
+   if((temp !=  "NC") &&
+      (temp != "NM"))
+   {
+      // get the rate if compression exists.
+      in.read(theCompressionRateCode, 4);
+   }
+   in.read(theNumberOfBands, 1);
+   ossim_uint32 numberOfBands = ossimString(theNumberOfBands).toUInt32();
+   theImageBands.resize(numberOfBands);
+   ossim_uint32 idx = 0;
+   while(idx < numberOfBands)
+   {
+      theImageBands[idx] = new ossimNitfImageBandV2_0;
+      theImageBands[idx]->parseStream(in);
+      ++idx;
+   }
+   in.read(theImageSyncCode, 1);
+   in.read(theImageMode, 1);
+   in.read(theNumberOfBlocksPerRow, 4);
+   in.read(theNumberOfBlocksPerCol, 4);
+   in.read(theNumberOfPixelsPerBlockHoriz, 4);
+   in.read(theNumberOfPixelsPerBlockVert, 4);
+   in.read(theNumberOfBitsPerPixelPerBand, 2);
+   in.read(theDisplayLevel, 3);
+   in.read(theAttachmentLevel, 3);
+   in.read(theImageLocation, 10);
+   in.read(theImageMagnification, 4);
+   in.read(theUserDefinedImageDataLength, 5);
+   std::streampos userDefinedDataLen = (std::streampos)ossimString(theUserDefinedImageDataLength).toUInt32();
+   theTagList.clear();
+   ossimNitfTagInformation         headerTag;
+   std::streampos start   = in.tellg();
+   std::streampos current = in.tellg();
+   if(userDefinedDataLen > 0)
+   {
+      in.read(theUserDefinedOverflow, 3);
+      
+      while((current - start) < userDefinedDataLen)
+      {
+         headerTag.parseStream(in);
+         theTagList.push_back(headerTag);
+         // in.ignore(headerTag.getTagLength());
+         // headerTag.clearFields();
+         current = in.tellg();
+      }
+   }
+
+   in.read(theExtendedSubheaderDataLen, 5);
+   std::streampos extSubHeadLen = (std::streampos)ossimString(theExtendedSubheaderDataLen).toUInt32();
+   start   = in.tellg();
+   current = in.tellg();
+   if(extSubHeadLen > 0)
+   {
+      in.read(theExtendedSubheaderOverflow, 3);
+
+      // ossim_uint32 test = 0;
+      while((current - start) < extSubHeadLen)
+      {
+         headerTag.parseStream(in);
+         theTagList.push_back(headerTag);
+         // test = headerTag.getTagLength()+in.tellg();
+         // in.ignore(headerTag.getTagLength());
+         // headerTag.clearFields();
+         current = in.tellg();
+      }
+   }
+   
+   ossimString compressionType = theCompression;
+   compressionType = compressionType.trim().upcase();
+   ossimEndian endian;
+   ossim_uint64 locationBefore = in.tellg();
+
+   //---
+   // Note: "C4" added to skip over the image data mask subheader.
+   // See MIL-STD-2500A paragraph 5.5.1.5
+   //
+   // Seems like CIB data does not have.  Could not find a hard and fast
+   // rule in the specs.  Need a better was to detect if this needs to be
+   // read. (drb - 20100317)
+   //---
+   if( (compressionType == "NM") ||
+       (compressionType == "M0") ||
+       (compressionType == "M3") ||
+       (compressionType == "M4") ||
+       ( (compressionType == "C4") && ( !getImageId().contains("CIB")) ) )
+   {
+      in.read((char*)(&theBlockedImageDataOffset), 4);
+      in.read((char*)(&theBlockMaskRecordLength),2);
+      in.read((char*)(&thePadPixelMaskRecordLength), 2);
+      in.read((char*)(&theTransparentOutputPixelCodeLength), 2);
+
+      
+      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+      {
+         endian.swap(theBlockedImageDataOffset);
+         endian.swap(theBlockMaskRecordLength);
+         endian.swap(thePadPixelMaskRecordLength);
+         endian.swap(theTransparentOutputPixelCodeLength);
+      }
+      if(theTransparentOutputPixelCodeLength <9)
+      {
+         if(theTransparentOutputPixelCodeLength != 0)
+         {
+            ossim_uint8 padOutputPixelCode;
+            in.read((char*)(&padOutputPixelCode), 1);
+            thePadOutputPixelCode = padOutputPixelCode;
+         }
+      }
+      else
+      {
+         in.read((char*)(&thePadOutputPixelCode), 2);
+         if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+         {
+            endian.swap(thePadOutputPixelCode);
+         }
+         // I need to add code here to check for justification when its 2 bytes
+         // but the code length is less than 16 bits.
+         //
+      }
+      if(theBlockMaskRecordLength>0)
+      {
+         ossim_uint32 totalNumber = 0;
+         if(theImageMode[0] == 'S')
+         {
+            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
+         }
+         else
+         {
+            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+         }
+         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
+         ossim_uint32 idx = 0;
+         theBlockMaskRecords.resize(totalNumber);
+         in.read((char*)(blockRead), totalNumber*4);
+         for(idx = 0; idx < totalNumber; ++idx)
+         {
+            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+            {
+               endian.swap(blockRead[idx]);
+            }
+            theBlockMaskRecords[idx] = blockRead[idx];
+         }
+         delete [] blockRead;
+      }
+      if((thePadPixelMaskRecordLength > 0)||
+         (( (getCompressionCode().upcase() == "M3"))&&
+          (thePadPixelMaskRecordLength == 0)))
+      {
+         ossim_uint32 totalNumber = 0;
+         if(theImageMode[0] == 'S')
+         {
+            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
+         }
+         else
+         {
+            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+         }
+         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
+         ossim_uint32 idx = 0;
+         thePadPixelMaskRecords.resize(totalNumber);
+         in.read((char*)(blockRead), totalNumber*4);
+         for(idx = 0; idx < totalNumber; ++idx)
+         {
+            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+            {
+               endian.swap(blockRead[idx]);
+            }
+            thePadPixelMaskRecords[idx] = blockRead[idx];
+         }
+         delete [] blockRead;
+      }
+   }
+
+   theCompressionHeader = 0;
+   if((getCompressionCode() == "C4")||
+      (getCompressionCode() == "M4"))
+   {
+      ossimRefPtr<ossimNitfVqCompressionHeader> compressionHeader =
+         new ossimNitfVqCompressionHeader;
+      compressionHeader->parseStream(in);
+      // do a check to see if the compression header is good
+      //
+      
+      if( compressionHeader->getCompressionAlgorithmId()!= 1 )
+      {
+         compressionHeader = 0;
+      }
+      theCompressionHeader = compressionHeader.get();
+   }
+
+   ossim_uint64 delta = (ossim_uint64)in.tellg() - locationBefore;
+   if(delta < theBlockedImageDataOffset)
+   {
+      in.ignore(theBlockedImageDataOffset-delta);
+   }
+   
+   //
+   // The stream should now be at the start of the data location so capture
+   // it.
+   //
+   theDataLocation = in.tellg();
+}
+
+void ossimNitfImageHeaderV2_0::writeStream(ossim::ostream &out)
+{
+   out.write(theType, 2);
+   out.write(theImageId, 10);
+   out.write(theDateTime, 14);
+   out.write(theTargetId, 17);
+   out.write(theTitle, 80);
+   out.write(theSecurityClassification, 1);
+   out.write(theCodewords, 40);
+   out.write(theControlAndHandling, 40);
+   out.write(theReleasingInstructions, 40);
+   out.write(theClassificationAuthority, 20);
+   out.write(theSecurityControlNumber, 20);
+   out.write(theSecurityDowngrade, 6);
+   if(ossimString(theSecurityDowngrade) == "999998")
+   {
+      out.write(theDowngradingEvent, 40);
+   }
+   out.write(theEncryption, 1);
+   out.write(theImageSource, 42);
+   out.write(theSignificantRows, 8);
+   out.write(theSignificantCols, 8);
+   out.write(thePixelValueType, 3);
+   out.write(theRepresentation, 8);
+   out.write(theCategory, 8);
+   out.write(theActualBitsPerPixelPerBand, 2);
+   out.write(theJustification, 1);
+   out.write(theCoordinateSystem, 1);
+   if(theCoordinateSystem[0] != 'N')
+   {
+      out.write(theGeographicLocation, 60);
+   }
+   out.write(theNumberOfComments, 1);
+   out.write(theCompression, 2);
+   if(ossimString(theCompression) != "NC")
+   {
+      out.write(theCompressionRateCode, 4);
+   }
+   out.write(theNumberOfBands, 1);
+   ossim_uint32 bandIdx = 0;
+   for(bandIdx=0;bandIdx<theImageBands.size();++bandIdx)
+   {
+      theImageBands[bandIdx]->writeStream(out);
+   }
+   out.write(theImageSyncCode, 1);
+   out.write(theImageMode, 1);
+   out.write(theNumberOfBlocksPerRow, 4);
+   out.write(theNumberOfBlocksPerCol, 4);
+   out.write(theNumberOfPixelsPerBlockHoriz, 4);
+   out.write(theNumberOfPixelsPerBlockVert, 4);
+   out.write(theNumberOfBitsPerPixelPerBand, 2);
+   out.write(theDisplayLevel, 3);
+   out.write(theAttachmentLevel, 3);
+   out.write(theImageLocation, 10);
+   out.write(theImageMagnification, 4);
+   out.write(theUserDefinedImageDataLength, 5);
+   if(ossimString(theUserDefinedImageDataLength).toInt32() > 0)
+   {
+      out.write(theUserDefinedOverflow, 3);
+   }
+   ossim_uint32 totalLength = getTotalTagLength();
+   
+   if(totalLength == 0)
+   {
+      //memcpy(theExtendedSubheaderDataLen, "00000", 5);
+      out.write(theExtendedSubheaderDataLen, 5);
+   }
+   else
+   {
+      totalLength += 3; // per Table A-3 of MIL-STD-2500B
+      
+      if(totalLength <= 99999)
+      {
+         std::ostringstream tempOut;
+         
+         tempOut << std::setw(5)
+         << std::setfill('0')
+         << std::setiosflags(ios::right)
+         << totalLength;
+         
+         memcpy(theExtendedSubheaderDataLen, tempOut.str().c_str(), 5);
+         
+         out.write(theExtendedSubheaderDataLen, 5);
+         memset(theExtendedSubheaderOverflow, '0', 3);
+         
+         if(totalLength > 0)
+         {
+            out.write(theExtendedSubheaderOverflow, 3);
+            
+            ossim_uint32 i = 0;
+            
+            for(i = 0; i < theTagList.size(); ++i)
+            {
+               theTagList[i].writeStream(out);
+            }
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNitfFileHeaderV2_0::writeStream: Only support writing of total tag length < 99999" << std::endl;
+      }
+   }
+}
+
+bool ossimNitfImageHeaderV2_0::isValid()const
+{
+   bool result = ossimNitfImageHeaderV2_X::isValid();
+
+   if(result)
+   {
+
+   }
+
+   return result;
+}
+std::ostream& ossimNitfImageHeaderV2_0::print(std::ostream& out,
+                                              const std::string& prefix) const
+{
+   out << setiosflags(std::ios::left)
+       << prefix << std::setw(24) << "IM:"
+       << theType << "\n"
+       << prefix << std::setw(24) << "IID:"
+       << theImageId  << "\n"
+       << prefix << std::setw(24) << "IDATIM:"
+       << theDateTime << "\n" 
+       << prefix << std::setw(24) << "TGTID:"
+       << theTargetId  << "\n"
+       << prefix << std::setw(24) << "ITITLE:"
+       << theTitle  << "\n"   
+       << prefix << std::setw(24) << "ISCLAS:"
+       << theSecurityClassification << "\n"
+       << prefix << std::setw(24) << "ISCODE:"
+       << theCodewords  << "\n"
+       << prefix << std::setw(24) << "ISCTLH:"
+       << theControlAndHandling << "\n" 
+       << prefix << std::setw(24) << "ISREL:"
+       << theReleasingInstructions << "\n" 
+       << prefix << std::setw(24) << "ISCAUT:"
+       << theClassificationAuthority << "\n" 
+       << prefix << std::setw(24) << "ISCTLN:"
+       << theSecurityControlNumber << "\n" 
+       << prefix << std::setw(24) << "ISDWNG:"
+       << theSecurityDowngrade  << "\n"    
+       << prefix << std::setw(24) << "ISDEBT:"
+       << theDowngradingEvent  << "\n"
+       << prefix << std::setw(24) << "ENCRYP:"
+       << theEncryption  << "\n"
+       << prefix << std::setw(24) << "ISORCE:"
+       << theImageSource  << "\n"
+       << prefix << std::setw(24) << "NROWS:"
+       << theSignificantRows  << "\n"
+       << prefix << std::setw(24) << "NCOLS:"
+       << theSignificantCols  << "\n"
+       << prefix << std::setw(24) << "PVTYPE:"
+       << thePixelValueType  << "\n"
+       << prefix << std::setw(24) << "IREP:"
+       << theRepresentation  << "\n"
+       << prefix << std::setw(24) << "ICAT:"
+       << theCategory  << "\n"      
+       << prefix << std::setw(24) << "ABPP:"
+       << theActualBitsPerPixelPerBand << "\n"
+       << prefix << std::setw(24) << "PJUST:"
+       << theJustification  << "\n"
+       << prefix << std::setw(24) << "ICORDS:"
+       << theCoordinateSystem  << "\n"
+       << prefix << std::setw(24) << "IGEOLO:"
+       << theGeographicLocation  << "\n"
+       << prefix << std::setw(24) << "NICOM:"
+       << theNumberOfComments << "\n"; 
+
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theImageComments.size(); ++idx)
+   {
+       ossimString icpre = "ICOM" + ossimString::toString(idx) + ":";
+       out << prefix << std::setw(24) << icpre << theImageComments[idx].trim() << "\n";
+   }
+   out << prefix << std::setw(24) << "IC:"
+       << theCompression  << "\n"     
+       << prefix << std::setw(24) << "COMRAT:"
+       << theCompressionRateCode  << "\n"
+       << prefix << std::setw(24) << "NBANDS:"
+       << theNumberOfBands  << "\n";
+
+   for(idx = 0; idx < theImageBands.size(); ++idx)
+   {
+      if(theImageBands[idx].valid())
+      {
+         theImageBands[idx]->print(out, prefix, idx); 
+      }
+   }
+   
+   out << prefix << std::setw(24) << "ISYNC:"
+       << theImageSyncCode << "\n" 
+       << prefix << std::setw(24) << "IMODE:"
+       << theImageMode  << "\n"
+       << prefix << std::setw(24) << "NBPR:"
+       << theNumberOfBlocksPerRow << "\n" 
+       << prefix << std::setw(24) << "NBPC:"
+       << theNumberOfBlocksPerCol << "\n" 
+       << prefix << std::setw(24) << "NPPBH:"
+       << theNumberOfPixelsPerBlockHoriz << "\n" 
+       << prefix << std::setw(24) << "NPPBV:"
+       << theNumberOfPixelsPerBlockVert  << "\n"
+       << prefix << std::setw(24) << "NBPP:"
+       << theNumberOfBitsPerPixelPerBand  << "\n"
+       << prefix << std::setw(24) << "IDLVL:"
+       << theDisplayLevel << "\n"
+       << prefix << std::setw(24) << "IALVL:"
+       << theAttachmentLevel << "\n" 
+       << prefix << std::setw(24) << "ILOC:"
+       << theImageLocation << "\n" 
+       << prefix << std::setw(24) << "IMAG:"
+       << theImageMagnification  << "\n"
+       << prefix << std::setw(24) << "UDIDL:"
+       << theUserDefinedImageDataLength  << "\n"
+       << prefix << std::setw(24) << "UDOFL:"
+       << theUserDefinedOverflow  << "\n"
+       << prefix << std::setw(24) << "IXSHDL:"
+       << theExtendedSubheaderDataLen  << "\n"
+       << prefix << std::setw(24) << "IXSOFL:"
+       << theExtendedSubheaderOverflow  << "\n";
+
+   if ( traceDebug() )
+   {
+       out << prefix << std::setw(24) << "theDataLocation:"
+           << theDataLocation << "\n"
+           << prefix << std::setw(24) << "theBlockedImageDataOffset:"
+           << theBlockedImageDataOffset << "\n"
+           << prefix << std::setw(24) << "theBlockMaskRecordLength:"
+           << theBlockMaskRecordLength << "\n"
+           << prefix << std::setw(24) << "thePadPixelMaskRecordLength:"
+           << thePadPixelMaskRecordLength << "\n"
+           << prefix << std::setw(24) << "theTransparentOutputPixelCodeLength:"
+           << theTransparentOutputPixelCodeLength << "\n"
+           << prefix << std::setw(24) << "thePadOutputPixelCode:"
+           << thePadOutputPixelCode << "\n";
+   }
+
+   if(theCompressionHeader.valid())
+   {
+      theCompressionHeader->print(out, prefix);
+   }
+
+   out << std::endl;
+
+   return printTags(out, prefix);
+}
+
+bool ossimNitfImageHeaderV2_0::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   ossimNitfImageHeaderV2_X::saveState(kwl, prefix);
+   std::ostringstream out;
+   
+   kwl.add(prefix, "ITITLE", theTitle);
+
+   ossim_uint32 idx = 0;
+   if(theCompressionHeader.valid())
+   {
+      theCompressionHeader->saveState(kwl, prefix + "compression_header.");
+   }
+   
+   for(idx = 0; idx < theImageBands.size(); ++idx)
+   {
+      if(theImageBands[idx].valid())
+      {
+         theImageBands[idx]->print(out, "", idx); 
+      }
+   }
+   
+   out << std::endl;
+   
+   ossimKeywordlist kwlTemp;
+   
+   std::istringstream in(out.str());
+   if(kwlTemp.parseStream(in))
+   {
+      kwl.add(prefix, kwlTemp);
+   }
+   return true;
+}
+
+bool ossimNitfImageHeaderV2_0::isCompressed()const
+{
+   ossimString temp = theCompression;
+   temp = temp.trim();
+   return ((temp != "NC") &&
+           (temp != "NM"));
+}
+
+bool ossimNitfImageHeaderV2_0::isEncrypted()const
+{
+   return (theEncryption[0] == '1');
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBands()const
+{
+   return ossimString(theNumberOfBands).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfRows()const
+{
+   return ossimString(theSignificantRows).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfCols()const
+{
+   return ossimString(theSignificantCols).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBlocksPerRow()const
+{
+   return ossimString(theNumberOfBlocksPerRow).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfBlocksPerCol()const
+{
+   return ossimString(theNumberOfBlocksPerCol).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfPixelsPerBlockHoriz()const
+{
+   return ossimString(theNumberOfPixelsPerBlockHoriz).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getNumberOfPixelsPerBlockVert()const
+{
+   return ossimString(theNumberOfPixelsPerBlockVert).toInt32();
+}
+
+ossimString ossimNitfImageHeaderV2_0::getImageId()const
+{
+   return theImageId;
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getBitsPerPixelPerBand()const
+{
+   return ossimString(theNumberOfBitsPerPixelPerBand).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_0::getActualBitsPerPixelPerBand()const
+{
+   return ossimString(theActualBitsPerPixelPerBand).toInt32();
+}
+
+ossimString ossimNitfImageHeaderV2_0::getIMode() const
+{
+   return ossimString(theImageMode).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_0::getSecurityClassification()const
+{
+   return ossimString(theSecurityClassification);
+}
+
+ossimString  ossimNitfImageHeaderV2_0::getImageDateAndTime() const
+{
+   return ossimString(theDateTime);
+}
+
+ossimString ossimNitfImageHeaderV2_0::getAcquisitionDateMonthDayYear(ossim_uint8 separationChar)const
+{
+   ossimString result;
+   ossimString month(theDateTime+9,
+                     theDateTime+12);
+   month = month.downcase();
+   if(month == "jan")
+   {
+      result += "01";
+   }
+   else if(month == "feb")
+   {
+      result += "02";
+   }
+   else if(month == "mar")
+   {
+      result += "03";
+   }
+   else if(month == "apr")
+   {
+      result += "04";
+   }
+   else if(month == "may")
+   {
+      result += "05";
+   }
+   else if(month == "jun")
+   {
+      result += "06";
+   }
+   else if(month == "jul")
+   {
+      result += "07";
+   }
+   else if(month == "aug")
+   {
+      result += "08";
+   }
+   else if(month == "sep")
+   {
+      result += "09";
+   }
+   else if(month == "oct")
+   {
+      result += "10";
+   }
+   else if(month == "nov")
+   {
+      result += "11";
+   }
+   else if(month == "dec")
+   {
+      result += "12";
+   }
+   result += ossimString(separationChar);
+   result += ossimString(theDateTime,
+                         theDateTime + 2);
+   result += ossimString(separationChar);
+   ossimString year(theDateTime+12,
+                    theDateTime+14);
+   if(year.toUInt32() < 70)
+   {
+      result += "20";
+   }
+   else
+   {
+      result += "19";
+   }
+   result += ossimString(theDateTime+12,
+                         theDateTime+14);
+
+   return result;
+}
+
+ossimString ossimNitfImageHeaderV2_0::getCategory()const
+{
+   return theCategory;
+}
+
+ossimString ossimNitfImageHeaderV2_0::getImageSource()const
+{
+   return theImageSource;
+}
+
+ossimString ossimNitfImageHeaderV2_0::getRepresentation()const
+{
+   return theRepresentation;
+}
+
+ossimString ossimNitfImageHeaderV2_0::getCoordinateSystem()const
+{
+	return theCoordinateSystem;
+}
+
+ossimString ossimNitfImageHeaderV2_0::getPixelValueType()const
+{
+   return ossimString(thePixelValueType).trim();
+}
+
+bool ossimNitfImageHeaderV2_0::hasBlockMaskRecords()const
+{
+   return (theBlockMaskRecords.size() > 0);
+}
+
+bool ossimNitfImageHeaderV2_0::hasPadPixelMaskRecords()const
+{
+   return (thePadPixelMaskRecords.size() > 0);
+}
+
+bool ossimNitfImageHeaderV2_0::hasTransparentCode()const
+{
+   return (theTransparentOutputPixelCodeLength > 0);
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_0::getTransparentCode()const
+{
+   return thePadOutputPixelCode;
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_0::getBlockMaskRecordOffset(ossim_uint32 blockNumber,
+                                                                ossim_uint32 bandNumber)const
+{
+   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+   ossim_uint32 result = 0xffffffff;
+   
+   if((hasBlockMaskRecords())&&
+      (blockNumber < maxBlock))
+   {
+      if(theImageMode[0] == 'S')
+      {
+         if(bandNumber < (ossim_uint32)getNumberOfBands())
+         {
+            result = theBlockMaskRecords[bandNumber*maxBlock + blockNumber];
+         }
+      }
+      else
+      {
+         result = theBlockMaskRecords[blockNumber];
+      }
+   }
+
+   return result;
+}
+ossim_uint32 ossimNitfImageHeaderV2_0::getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
+                                                                   ossim_uint32 bandNumber)const
+{
+   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+   ossim_uint32 result = 0xffffffff;
+   
+   if((hasPadPixelMaskRecords())&&
+      (blockNumber < maxBlock))
+   {
+      if(theImageMode[0] == 'S')
+      {
+         if(bandNumber < (ossim_uint32)getNumberOfBands())
+         {
+            result = thePadPixelMaskRecords[bandNumber*maxBlock + blockNumber];
+         }
+      }
+      else
+      {
+         result = thePadPixelMaskRecords[blockNumber];
+      }
+   }
+
+   return result;
+}
+
+void ossimNitfImageHeaderV2_0::clearFields()
+{
+   theTagList.clear();
+   
+   memcpy(theType, "IM", 2);
+   memset(theImageId, ' ', 10);
+   memset(theDateTime, ' ', 14);
+   memset(theTargetId, ' ', 17);
+   memset(theTitle, ' ', 80);
+   memset(theSecurityClassification, ' ', 1);
+   memset(theCodewords, ' ', 40);
+   memset(theControlAndHandling, ' ', 40);
+   memset(theReleasingInstructions, ' ', 40);
+   memset(theClassificationAuthority, ' ', 20);
+   memset(theSecurityControlNumber, ' ', 20);
+   memset(theSecurityDowngrade, ' ', 6);
+   memset(theDowngradingEvent, ' ', 40);
+   memset(theEncryption, '0', 1);
+   memset(theImageSource, ' ', 42);
+   memset(theSignificantRows, ' ', 8);
+   memset(theSignificantCols, ' ', 8);
+   memset(thePixelValueType, ' ', 3);
+   memset(theRepresentation, ' ', 8);
+   memset(theCategory, ' ', 8);
+   memset(theActualBitsPerPixelPerBand, '0', 2);
+   memset(theJustification, ' ', 1);
+   memset(theCoordinateSystem, 'N', 1);
+   memset(theGeographicLocation, ' ', 60);
+   memset(theNumberOfComments, '0', 1);
+   memcpy(theCompression, "NC", 2);
+   memset(theCompressionRateCode, ' ', 4);
+   memset(theNumberOfBands, ' ', 1);
+   memset(theImageSyncCode, '0', 1);
+   memset(theImageMode, ' ', 1);
+   memset(theNumberOfBlocksPerRow, ' ', 4);
+   memset(theNumberOfBlocksPerCol, ' ', 4);
+   memset(theNumberOfPixelsPerBlockHoriz, ' ', 4);
+   memset(theNumberOfPixelsPerBlockVert, ' ', 4);
+   memset(theNumberOfBitsPerPixelPerBand, '0', 2);
+   memset(theDisplayLevel, ' ', 3);
+   memset(theAttachmentLevel, ' ', 3);
+   memcpy(theImageLocation, "0000000000", 10);
+   memcpy(theImageMagnification, "1.00", 4);
+   memset(theUserDefinedImageDataLength, '0', 5);
+   memset(theUserDefinedOverflow, '0', 3);
+   memset(theExtendedSubheaderDataLen, '0', 5);
+   memset(theExtendedSubheaderOverflow, ' ', 3);
+   
+   theBlockMaskRecords.clear();
+   thePadPixelMaskRecords.clear();
+
+   theBlockedImageDataOffset = 0;
+   theBlockMaskRecordLength = 0;
+   thePadPixelMaskRecordLength = 0;
+   theTransparentOutputPixelCodeLength = 0;
+   thePadOutputPixelCode = 0;
+   theCompressionHeader  = 0;
+   theType[2] = '\0';
+   theImageId[10] = '\0';
+   theDateTime[14] = '\0';
+   theTargetId[17] = '\0';
+   theTitle[80] = '\0';
+   theSecurityClassification[1] = '\0';
+   theCodewords[40] = '\0';
+   theControlAndHandling[40] = '\0';
+   theReleasingInstructions[40] = '\0';
+   theClassificationAuthority[20] = '\0';
+   theSecurityControlNumber[20] = '\0';
+   theSecurityDowngrade[6] = '\0';
+   theDowngradingEvent[40] = '\0';
+   theEncryption[1] = '\0';
+   theImageSource[42] = '\0';
+   theSignificantRows[8] = '\0';
+   theSignificantCols[8] = '\0';
+   thePixelValueType[3] = '\0';
+   theRepresentation[8] = '\0';
+   theCategory[8] = '\0';
+   theActualBitsPerPixelPerBand[2] = '\0';
+   theJustification[1] = '\0';
+   theCoordinateSystem[1] = '\0';
+   theGeographicLocation[60] = '\0';
+   theNumberOfComments[1] = '\0';
+   theCompression[2] = '\0';
+   theCompressionRateCode[4] = '\0';
+   theNumberOfBands[1] = '\0';
+   theImageSyncCode[1] = '\0';
+   theImageMode[1] = '\0';
+   theNumberOfBlocksPerRow[4] = '\0';
+   theNumberOfBlocksPerCol[4] = '\0';
+   theNumberOfPixelsPerBlockHoriz[4] = '\0';
+   theNumberOfPixelsPerBlockVert[4] = '\0';
+   theNumberOfBitsPerPixelPerBand[2] = '\0';
+   theDisplayLevel[3] = '\0';
+   theAttachmentLevel[3] = '\0';
+   theImageLocation[10] = '\0';
+   theImageMagnification[4] = '\0';
+   theUserDefinedImageDataLength[5] = '\0';
+   theUserDefinedOverflow[3] = '\0';
+   theExtendedSubheaderDataLen[5] = '\0';
+   theExtendedSubheaderOverflow[3] = '\0'; 
+   theDataLocation = 0;
+}
+
+const ossimRefPtr<ossimNitfCompressionHeader> ossimNitfImageHeaderV2_0::getCompressionHeader()const
+{
+   return theCompressionHeader;
+}
+
+const ossimRefPtr<ossimNitfImageBand> ossimNitfImageHeaderV2_0::getBandInformation(ossim_uint32 idx)const
+{
+   if(idx < theImageBands.size())
+   {
+      return (ossimNitfImageBand*)theImageBands[idx].get();
+   }
+   
+   return NULL;
+}
+
+void ossimNitfImageHeaderV2_0::setNumberOfBands(ossim_uint32 nbands)
+{
+   std::ostringstream out;
+   if(nbands > 9)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimNitfImageHeaderV2_0::setNumberOfBands: NBANDS is too large.  For 2.0 spec we can only have up to 9 bands\n";
+      }
+      std::string s = "ossimNitfImageHeaderV2_0::setNumberOfBands:";
+      s += " ERROR\nExceeded max number of bands of 9!";
+      throw std::out_of_range(s);
+   }
+   else
+   {
+      out << nbands;
+      theNumberOfBands[0] = out.str().c_str()[0];
+   }
+   
+   theImageBands.resize(getNumberOfBands());
+}
+
+void ossimNitfImageHeaderV2_0::setBandInfo(ossim_uint32 idx,
+                                           const ossimNitfImageBandV2_0& info)
+{
+   if(idx < theImageBands.size())
+   {
+      if(!theImageBands[idx].valid())
+      {
+         theImageBands[idx] = new ossimNitfImageBandV2_0;
+      }
+      (*theImageBands[idx]) = info;
+   }
+}
+void ossimNitfImageHeaderV2_0::setNumberOfRows(ossim_uint32 rows)
+{
+   std::ostringstream out;
+   if(rows > 99999999) rows = 99999999;
+   
+   out << rows;
+   ossimNitfCommon::setField(theSignificantRows, out.str(), 8, ios::right, '0');
+}
+
+void ossimNitfImageHeaderV2_0::setNumberOfCols(ossim_uint32 cols)
+{
+   std::ostringstream out;
+   if(cols > 99999999) cols = 99999999;
+   
+   out << cols;
+   ossimNitfCommon::setField(theSignificantCols, out.str(), 8, ios::right, '0');
+}
+
+void ossimNitfImageHeaderV2_0::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimNitfImageHeaderV2_X::setProperty(property);
+}
+
+ossimRefPtr<ossimProperty> ossimNitfImageHeaderV2_0::getProperty(const ossimString& name)const
+{
+   ossimRefPtr<ossimProperty> property = 0;
+   if(name == ISCODE_KW)
+   {
+      property = new ossimStringProperty(name, theCodewords);
+   }
+   else if(name == ISCTLH_KW)
+   {
+      property = new ossimStringProperty(name, theControlAndHandling);
+   }
+   else if(name == ISREL_KW)
+   {
+      property = new ossimStringProperty(name, theReleasingInstructions);
+   }
+   else if(name == ISCAUT_KW)
+   {
+      property = new ossimStringProperty(name, theClassificationAuthority);
+   }
+   else if(name == CTLN_KW)
+   {
+      property = new ossimStringProperty(name, theSecurityControlNumber);
+   }
+   else if(name == ISDWNG_KW)
+   {
+      property = new ossimStringProperty(name, theSecurityDowngrade);
+   }
+   else if(name == ISDEVT_KW)
+   {
+      property = new ossimStringProperty(name, theDowngradingEvent);
+   }
+   else 
+   {
+      property = ossimNitfImageHeaderV2_X::getProperty(name);
+   }
+   return property;
+}
+
+void ossimNitfImageHeaderV2_0::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfImageHeaderV2_X::getPropertyNames(propertyNames);
+   propertyNames.push_back(ISCODE_KW);
+   propertyNames.push_back(ISCTLH_KW);
+   propertyNames.push_back(ISREL_KW);
+   propertyNames.push_back(ISCAUT_KW);
+   propertyNames.push_back(CTLN_KW);
+   propertyNames.push_back(ISDWNG_KW);
+   propertyNames.push_back(ISDEVT_KW);
+}
diff --git a/src/support_data/ossimNitfImageHeaderV2_1.cpp b/src/support_data/ossimNitfImageHeaderV2_1.cpp
new file mode 100644
index 0000000..af566be
--- /dev/null
+++ b/src/support_data/ossimNitfImageHeaderV2_1.cpp
@@ -0,0 +1,1888 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimDms.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/support_data/ossimNitfImageHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_1.h>
+#include <ossim/support_data/ossimNitfDataExtensionSegmentV2_1.h>
+
+#include <sstream>
+#include <iomanip>
+#include <cstring> // for memset
+
+RTTI_DEF1(ossimNitfImageHeaderV2_1,
+          "ossimNitfImageHeaderV2_1",
+          ossimNitfImageHeaderV2_X)
+
+const ossimString ossimNitfImageHeaderV2_1::ISCLSY_KW = "isclsy";
+const ossimString ossimNitfImageHeaderV2_1::ISCODE_KW = "iscode";
+const ossimString ossimNitfImageHeaderV2_1::ISCTLH_KW = "isctlh";
+const ossimString ossimNitfImageHeaderV2_1::ISREL_KW  = "isrel";
+const ossimString ossimNitfImageHeaderV2_1::ISDCTP_KW = "isdctp";
+const ossimString ossimNitfImageHeaderV2_1::ISDCDT_KW = "isdcdt";
+const ossimString ossimNitfImageHeaderV2_1::ISDCXM_KW = "isdcxm";
+const ossimString ossimNitfImageHeaderV2_1::ISDG_KW   = "isdg";
+const ossimString ossimNitfImageHeaderV2_1::ISDGDT_KW = "isdgdt";
+const ossimString ossimNitfImageHeaderV2_1::ISCLTX_KW = "iscltx";
+const ossimString ossimNitfImageHeaderV2_1::ISCATP_KW = "iscatp";
+const ossimString ossimNitfImageHeaderV2_1::ISCAUT_KW = "iscaut";
+const ossimString ossimNitfImageHeaderV2_1::ISCRSN_KW = "iscrsn";
+const ossimString ossimNitfImageHeaderV2_1::ISSRDT_KW = "issrdt";
+const ossimString ossimNitfImageHeaderV2_1::ISCTLN_KW = "isctln";
+const ossimString ossimNitfImageHeaderV2_1::XBANDS_KW = "xbands";
+const ossimString NBANDS_KW                           = "nbands";
+
+static const
+ossimTrace traceDebug(ossimString("ossimNitfImageHeaderV2_1:debug"));
+
+ossimNitfImageHeaderV2_1::ossimNitfImageHeaderV2_1()
+{
+   clearFields();
+}
+ossimNitfImageHeaderV2_1::~ossimNitfImageHeaderV2_1()
+{
+}
+
+void ossimNitfImageHeaderV2_1::parseStream(ossim::istream& in)
+{
+   parseStream(in, NULL);
+}
+
+void ossimNitfImageHeaderV2_1::parseStream(ossim::istream& in, const ossimNitfFileHeaderV2_1 *file)
+{
+   if (!in)
+   {
+      return;
+   }
+   clearFields();
+   theTagList.clear();
+   in.read(theType, 2);
+   in.read(theImageId, 10);
+   in.read(theDateTime,14);
+   in.read(theTargetId, 17);
+   in.read(theTitle, 80);
+   in.read(theSecurityClassification, 1);
+   in.read(theSecurityClassificationSys, 2);
+   in.read(theCodewords, 11);
+   in.read(theControlAndHandling, 2);
+   in.read(theReleasingInstructions, 20);
+   in.read(theDeclassificationType, 2);
+   in.read(theDeclassificationDate, 8);
+   in.read(theDeclassificationExempt, 4);
+   in.read(theDowngrade, 1);
+   in.read(theDowngradeDate, 8);
+   in.read(theClassificationText, 43);
+   in.read(theClassificationAuthType, 1);
+   in.read(theClassificationAuthority, 40);
+   in.read(theClassificationReason, 1);
+   in.read(theSecuritySourceDate, 8);
+   in.read(theSecurityControlNumber, 15);
+   in.read(theEncryption, 1);
+   in.read(theImageSource, 42);
+   in.read(theSignificantRows, 8);
+   in.read(theSignificantCols, 8);
+   in.read(thePixelValueType, 3);
+   in.read(theRepresentation, 8);
+   in.read(theCategory, 8);
+   in.read(theActualBitsPerPixelPerBand, 2);
+   in.read(theJustification, 1);
+   in.read(theCoordinateSystem, 1);
+   // if it's not blank then read coordinates
+   if(theCoordinateSystem[0] != ' ')
+   {
+      in.read(theGeographicLocation, 60);
+   }
+
+   // Up to 3 80 character comments treated as a single comment.
+   in.read(theNumberOfComments, 1);
+   ossim_int32 numberOfComments = ossimString(theNumberOfComments).toInt32();
+   if(numberOfComments > 0)
+   {
+      theImageComments.resize(numberOfComments);
+      for (ossim_uint32 i=0; i < numberOfComments; ++i)
+      {
+        char comment[81];
+        memset(comment, ' ', 80);
+        comment[80] = '\0';
+        in.read(comment, 80);
+        theImageComments[i] = ossimString(comment).trim();
+      }
+   }
+   
+   in.read(theCompression, 2);
+   
+   // only need the Rate code if its not
+   // NC (No compression)
+   ossimString temp = theCompression;
+   if((temp != "NC") &&
+      (temp != "NM"))
+   {
+      in.read(theCompressionRateCode, 4);
+   }
+   in.read(theNumberOfBands, 1);
+   // check to see if multi spectral bands
+   // exceed 9.  A value of 0 indicates this
+   ossim_int32 numberOfBands = ossimString(theNumberOfBands).toInt32();
+   if (numberOfBands == 0)
+   {
+      in.read(theNumberOfMultispectralBands, 5);
+      numberOfBands = ossimString(theNumberOfMultispectralBands).toInt32();
+   }
+   theImageBands.clear();
+   theImageBands.resize(numberOfBands);
+   for (ossim_int32 band = 0; band < numberOfBands; ++band)
+   {
+      theImageBands[band] = new ossimNitfImageBandV2_1;
+      theImageBands[band]->parseStream(in);
+   }
+   in.read(theImageSyncCode, 1);
+   in.read(theImageMode, 1);
+   in.read(theNumberOfBlocksPerRow, 4);
+   in.read(theNumberOfBlocksPerCol, 4);
+   in.read(theNumberOfPixelsPerBlockHoriz, 4);
+   in.read(theNumberOfPixelsPerBlockVert, 4);
+   in.read(theNumberOfBitsPerPixelPerBand, 2);
+   in.read(theDisplayLevel, 3);
+   in.read(theAttachmentLevel, 3);
+   in.read(theImageLocation, 10);
+   in.read(theImageMagnification, 4);
+   in.read(theUserDefinedImageDataLength, 5);
+   
+   ossimNitfTagInformation         headerTag;
+   std::streampos start   = in.tellg();
+   std::streampos current = in.tellg();
+   
+   std::streampos userDefinedDataLen
+      = ossimString(theUserDefinedImageDataLength).toInt32();
+   if(userDefinedDataLen > 0)
+   {
+      in.read(theUserDefinedOverflow, 3);
+      current = in.tellg();
+      
+      while((current - start) < userDefinedDataLen)
+      {
+         headerTag.parseStream(in);
+         theTagList.push_back(headerTag);
+         headerTag.setTagType("UDID");
+         // in.ignore(headerTag.getTagLength());
+         // headerTag.clearFields();
+         current = in.tellg();
+      }
+//      in.seekg(start + userDefinedDataLen);
+            ossim_int32 overflow = ossimString(theUserDefinedOverflow).toLong();
+      if (overflow != 0 && file != NULL)
+      {
+         ossimNitfDataExtensionSegment *des = file->getNewDataExtensionSegment(overflow-1, in);
+         if (des != NULL)
+         {
+            const vector<ossimNitfTagInformation> &desTags = des->getTagList();
+            for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
+            {
+               iter->setTagType("UDID");
+               theTagList.push_back(*iter);
+            }
+         }
+         delete des;
+      }
+      ossimIFStream64::seekg64(in, start + userDefinedDataLen, ios::beg);
+   }
+   in.read(theExtendedSubheaderDataLen, 5);
+   std::streampos extSubHeadLen = ossimString(theExtendedSubheaderDataLen).toInt32();
+   start   = in.tellg();
+   current = in.tellg();
+   if(extSubHeadLen > 0)
+   {
+      in.read(theExtendedSubheaderOverflow, 3);
+      current = in.tellg();
+      while((current - start) < extSubHeadLen)
+      {
+         headerTag.parseStream(in);
+         headerTag.setTagType("IXSHD");
+         theTagList.push_back(headerTag);
+         
+         // in.ignore(headerTag.getTagLength());
+         // headerTag.clearFields();
+         current = in.tellg();
+      }
+//      in.seekg(start + extSubHeadLen);
+      ossim_int32 overflow = ossimString(theExtendedSubheaderOverflow).toLong();
+      if (overflow != 0 && file != NULL)
+      {
+         ossimNitfDataExtensionSegment *des = file->getNewDataExtensionSegment(overflow-1, in);
+         if (des != NULL)
+         {
+            const vector<ossimNitfTagInformation> &desTags = des->getTagList();
+            for (vector<ossimNitfTagInformation>::const_iterator iter = desTags.begin(); iter != desTags.end(); ++iter)
+            {
+               iter->setTagType("IXSHD");
+               theTagList.push_back(*iter);
+            }
+            delete des;
+         }
+      }
+      ossimIFStream64::seekg64(in, start + extSubHeadLen, ios::beg);
+   }
+   ossimString compressionType = theCompression;
+   compressionType = compressionType.trim().upcase();
+   ossimEndian endian;
+
+   //---
+   // Note: "C4" added to skip over the image data mask subheader.
+   // See MIL-STD-2500C paragraph 5.4.3.2
+   //---
+   if((compressionType == "NM")||
+      (compressionType == "M1")||
+      (compressionType == "M3")||
+      (compressionType == "M4")||
+      (compressionType == "M5")||
+      (compressionType == "C4"))
+   {
+      ossim_uint64 locationBefore = in.tellg();
+      in.read((char*)(&theBlockedImageDataOffset), 4);
+      in.read((char*)(&theBlockMaskRecordLength),2);
+      in.read((char*)(&thePadPixelMaskRecordLength), 2);
+      in.read((char*)(&theTransparentOutputPixelCodeLength), 2);
+
+      
+      if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+      {
+         endian.swap(theBlockedImageDataOffset);
+         endian.swap(theBlockMaskRecordLength);
+         endian.swap(thePadPixelMaskRecordLength);
+         endian.swap(theTransparentOutputPixelCodeLength);
+      }
+      if(theTransparentOutputPixelCodeLength <9)
+      {
+         if(theTransparentOutputPixelCodeLength != 0)
+         {
+            ossim_uint8 padOutputPixelCode;
+            in.read((char*)(&padOutputPixelCode), 1);
+            thePadOutputPixelCode = padOutputPixelCode;
+         }
+      }
+      else
+      {
+         in.read((char*)(&thePadOutputPixelCode), 2);
+         if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+         {
+            endian.swap(thePadOutputPixelCode);
+         }
+         // I need to add code here to check for justification when its 2 bytes
+         // but the code length is less than 16 bits.
+         //
+      }
+      if(theBlockMaskRecordLength>0)
+      {
+         ossim_uint32 totalNumber = 0;
+         if(theImageMode[0] == 'S')
+         {
+             totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
+         }
+         else
+         {
+            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+         }
+         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
+         ossim_uint32 idx = 0;
+         theBlockMaskRecords.resize(totalNumber);
+         in.read((char*)(blockRead), totalNumber*4);
+         for(idx = 0; idx < totalNumber; ++idx)
+         {
+            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+            {
+               endian.swap(blockRead[idx]);
+            }
+            theBlockMaskRecords[idx] = blockRead[idx];
+         }
+         delete [] blockRead;
+      }
+      if( (thePadPixelMaskRecordLength > 0) ||
+          ( (getCompressionCode().upcase() == "M3") && (thePadPixelMaskRecordLength == 0) ) )
+      {
+         ossim_uint32 totalNumber = 0;
+         if(theImageMode[0] == 'S')
+         {
+            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol()*getNumberOfBands();
+         }
+         else
+         {
+            totalNumber = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+         }
+         ossim_uint32 *blockRead = new ossim_uint32[totalNumber];
+         ossim_uint32 idx = 0;
+         thePadPixelMaskRecords.resize(totalNumber);
+         in.read((char*)(blockRead), totalNumber*4);
+         for(idx = 0; idx < totalNumber; ++idx)
+         {
+            if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+            {
+               endian.swap(blockRead[idx]);
+            }
+            thePadPixelMaskRecords[idx] = blockRead[idx];
+         }
+         delete [] blockRead;
+      }
+      theCompressionHeader = 0;
+      if((getCompressionCode() == "C4")||
+         (getCompressionCode() == "M4"))
+      {
+         ossimRefPtr<ossimNitfVqCompressionHeader> compressionHeader = new ossimNitfVqCompressionHeader;
+         compressionHeader->parseStream(in);
+         // do a check to see if the compression header is good
+         //
+         if(compressionHeader->getCompressionAlgorithmId()!= 1)
+         {
+            compressionHeader = 0;
+         }
+         theCompressionHeader = compressionHeader.get();
+      }
+      
+      ossim_uint64 delta = (ossim_uint64)in.tellg() - locationBefore;
+      if(delta < theBlockedImageDataOffset)
+      {
+         in.ignore(theBlockedImageDataOffset-delta);
+      }
+   }
+   //***
+   // The stream should now be at the start of the data location so capture
+   // it.
+   //***
+   theDataLocation = in.tellg();
+}
+
+void ossimNitfImageHeaderV2_1::writeStream(ossim::ostream &out)
+{
+   out.write(theType, 2);
+   out.write(theImageId, 10);
+   out.write(theDateTime,14);
+   out.write(theTargetId, 17);
+   out.write(theTitle, 80);
+   out.write(theSecurityClassification, 1);
+   out.write(theSecurityClassificationSys, 2);
+   out.write(theCodewords, 11);
+   out.write(theControlAndHandling, 2);
+   out.write(theReleasingInstructions, 20);
+   out.write(theDeclassificationType, 2);
+   out.write(theDeclassificationDate, 8);
+   out.write(theDeclassificationExempt, 4);
+   out.write(theDowngrade, 1);
+   out.write(theDowngradeDate, 8);
+   out.write(theClassificationText, 43);
+   out.write(theClassificationAuthType, 1);
+   out.write(theClassificationAuthority, 40);
+   out.write(theClassificationReason, 1);
+   out.write(theSecuritySourceDate, 8);
+   out.write(theSecurityControlNumber, 15);
+   out.write(theEncryption, 1);
+   out.write(theImageSource, 42);
+   out.write(theSignificantRows, 8);
+   out.write(theSignificantCols, 8);
+   out.write(thePixelValueType, 3);
+   out.write(theRepresentation, 8);
+   out.write(theCategory, 8);
+   out.write(theActualBitsPerPixelPerBand, 2);
+   out.write(theJustification, 1);
+   out.write(theCoordinateSystem, 1);
+   
+   if(theCoordinateSystem[0] != ' ')
+   {
+      out.write(theGeographicLocation, 60);
+   }
+   
+   out.write(theNumberOfComments, 1);
+
+   if (ossimString(theNumberOfComments).toUInt32() > 0)
+   {
+     for (ossim_uint32 i=0; i < theImageComments.size(); ++i)
+     {
+        char icom[81];
+        memset(icom, ' ', 80);
+        icom[80] = '\0';
+        strcpy(icom, theImageComments[i].c_str());
+        out.write(icom, 80);
+     }
+   }
+   
+   out.write(theCompression, 2);
+   ossimString compressionTest = theCompression;
+   if(compressionTest != "NC" &&
+      compressionTest != "NM")
+     {
+      out.write(theCompressionRateCode, 4);
+     }
+
+   out.write(theNumberOfBands, 1);
+
+   if(ossimString(theNumberOfBands).toInt32() == 0)
+   {
+      out.write(theNumberOfMultispectralBands, 5);
+   }
+
+   if(theImageBands.size())
+   {
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < theImageBands.size(); ++idx)
+      {
+         if (theImageBands[idx].valid() == false)
+         {
+            theImageBands[idx] = new ossimNitfImageBandV2_1;
+         }
+         theImageBands[idx]->writeStream(out);
+      }
+   }
+
+   out.write(theImageSyncCode, 1);
+   out.write(theImageMode, 1);
+   out.write(theNumberOfBlocksPerRow, 4);
+   out.write(theNumberOfBlocksPerCol, 4);
+   out.write(theNumberOfPixelsPerBlockHoriz, 4);
+   out.write(theNumberOfPixelsPerBlockVert, 4);
+   out.write(theNumberOfBitsPerPixelPerBand, 2);
+   out.write(theDisplayLevel, 3);
+   out.write(theAttachmentLevel, 3);
+   out.write(theImageLocation, 10);
+   out.write(theImageMagnification, 4);
+   out.write(theUserDefinedImageDataLength, 5);
+
+   if(ossimString(theUserDefinedImageDataLength).toInt32() > 0)
+   {
+      out.write(theUserDefinedOverflow, 3);
+   }
+
+   // need to output tagged data
+   // here
+   //
+   ossim_uint32 totalLength = getTotalTagLength();
+
+   if (totalLength == 0)
+   {
+      out.write(theExtendedSubheaderDataLen, 5);
+   }
+   else
+   {
+      totalLength += 3; // per Table A-3 of MIL-STD-2500B
+      
+      if(totalLength <= 99999)
+      {
+         std::ostringstream tempOut;
+         
+         tempOut << std::setw(5)
+                 << std::setfill('0')
+                 << std::setiosflags(ios::right)
+                 << totalLength;
+         
+         memcpy(theExtendedSubheaderDataLen, tempOut.str().c_str(), 5);
+         
+         out.write(theExtendedSubheaderDataLen, 5);
+         ossim_uint32 theExtendedSubheaderDataLenBytes = ossimString(theExtendedSubheaderDataLen).toUInt32();
+
+         if (theExtendedSubheaderDataLenBytes > 0)
+         {
+           strcpy(theExtendedSubheaderOverflow, ossimString("001").c_str());
+         }
+         else
+         {
+            memset(theExtendedSubheaderOverflow, '0', 3);
+         }
+         
+         if(totalLength > 0)
+         {
+            out.write(theExtendedSubheaderOverflow, 3);
+            
+            ossim_uint32 i = 0;
+            
+            for(i = 0; i < theTagList.size(); ++i)
+            {
+               theTagList[i].writeStream(out);
+            }
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "WARNING ossimNitfFileHeaderV2_1::writeStream: Only support writing of total tag length < 99999" << std::endl;
+      }
+   }
+}
+
+std::ostream& ossimNitfImageHeaderV2_1::print(std::ostream& out,
+                                              const std::string& prefix) const
+{
+   out << setiosflags(ios::left)
+       << prefix << setw(24)
+       << "IM:"     << theType << "\n"
+       << prefix << setw(24)
+       << "IID1:"   << theImageId << "\n"
+       << prefix << setw(24)
+       << "IDATIM:" << theDateTime << "\n"
+       << prefix << setw(24)
+       << "TGTID:"  << theTargetId << "\n"
+       << prefix << setw(24)
+       << "IID2:"   << theTitle << "\n"
+       << prefix << setw(24)
+       << "ISCLAS:" << theSecurityClassification << "\n"
+       << prefix << setw(24)
+       << "ISCLSY:" << theSecurityClassificationSys << "\n"
+       << prefix << setw(24)
+       << "ISCODE:" << theCodewords << "\n"
+       << prefix << setw(24)
+       << "ISCTLH:" << theControlAndHandling << "\n"
+       << prefix << setw(24)
+       << "ISREL:"  << theReleasingInstructions << "\n"
+       << prefix << setw(24)
+       << "ISDCTP:" << theDeclassificationType << "\n"
+       << prefix << setw(24)
+       << "ISDCDT:" << theDeclassificationDate << "\n"
+       << prefix << setw(24)
+       << "ISDCXM:" << theDeclassificationExempt << "\n"
+       << prefix << setw(24)
+       << "ISDG:"   << theDowngrade << "\n"
+       << prefix << setw(24)
+       << "ISDGDT:" << theDowngradeDate << "\n"
+       << prefix << setw(24)
+       << "ISCLTX:" << theClassificationText << "\n"
+       << prefix << setw(24)
+       << "ISCATP:" << theClassificationAuthType << "\n"
+       << prefix << setw(24)
+       << "ISCAUT:" << theClassificationAuthority << "\n"
+       << prefix << setw(24)
+       << "ISCRSN:" << theClassificationReason << "\n"
+       << prefix << setw(24)
+       << "ISSRDT:" << theSecuritySourceDate << "\n"
+       << prefix << setw(24)
+       << "ISCTLN:" << theSecurityControlNumber << "\n"
+       << prefix << setw(24)
+       << "ENCRYP:" << theEncryption << "\n"
+       << prefix << setw(24)
+       << "ISORCE:" << theImageSource << "\n"
+       << prefix << setw(24)
+       << "NROWS:"  << theSignificantRows << "\n"
+       << prefix << setw(24)
+       << "NCOLS:"  << theSignificantCols << "\n"
+       << prefix << setw(24)
+       << "PVTYPE:" << thePixelValueType << "\n"
+       << prefix << setw(24)
+       << "IREP:"   << theRepresentation << "\n"
+       << prefix << setw(24)
+       << "ICAT:"   << theCategory << "\n"
+       << prefix << setw(24)
+       << "ABPP:"   << theActualBitsPerPixelPerBand << "\n"
+       << prefix << setw(24)
+       << "PJUST:"  << theJustification << "\n"
+       << prefix << setw(24)
+       << "ICORDS:" << theCoordinateSystem << "\n"
+       << prefix << setw(24)
+       << "IGEOLO:" << theGeographicLocation << "\n"
+       << prefix << setw(24)
+       << "NICOM:"  << theNumberOfComments << "\n";
+
+   ossim_uint32 idx = 0;
+   for(idx = 0; idx < theImageComments.size(); ++idx)
+   {
+       ossimString icpre = "ICOM" + ossimString::toString(idx) + ":";
+       out << prefix << std::setw(24) << icpre << theImageComments[idx].trim() << "\n";
+   }
+
+   out << prefix << setw(24)
+       << "IC:"     << theCompression << "\n"
+       << prefix << setw(24)
+       << "COMRAT:" << theCompressionRateCode << "\n"
+       << prefix << setw(24)
+       << "NBANDS:" << theNumberOfBands << "\n"
+       << prefix << setw(24)
+       << "XBANDS:" << theNumberOfMultispectralBands << "\n";
+   
+   for(idx = 0; idx < theImageBands.size(); ++idx)
+   {
+      if(theImageBands[idx].valid())
+      {
+         theImageBands[idx]->print(out, prefix, idx); 
+      }
+   }
+
+   out << prefix << setw(24)
+       << "ISYNC:"     << theImageSyncCode << "\n"
+       << prefix << setw(24)
+       << "IMODE:"     << theImageMode << "\n"
+       << prefix << setw(24)
+       << "NBPR:"      << theNumberOfBlocksPerRow << "\n"
+       << prefix << setw(24)
+       << "NBPC:"      << theNumberOfBlocksPerCol << "\n"
+       << prefix << setw(24)
+       << "NPPBH:"     << theNumberOfPixelsPerBlockHoriz << "\n"
+       << prefix << setw(24)
+       << "NPPBV:"     << theNumberOfPixelsPerBlockVert << "\n"
+       << prefix << setw(24)
+       << "NBPP:"      << theNumberOfBitsPerPixelPerBand << "\n"
+       << prefix << setw(24)
+       << "IDLVL:"     << theDisplayLevel << "\n"
+       << prefix << setw(24)
+       << "IALVL:"     << theAttachmentLevel << "\n"
+       << prefix << setw(24)
+       << "ILOC:"      << theImageLocation << "\n"
+       << prefix << setw(24)
+       << "IMAG:"      << theImageMagnification << "\n"
+       << prefix << setw(24)
+       << "UDIDL:"     << theUserDefinedImageDataLength << "\n"
+       << prefix << setw(24)
+       << "UDOFL:"     << theUserDefinedOverflow << "\n"
+       << prefix << setw(24)
+       << "IXSHDL:"    << theExtendedSubheaderDataLen << "\n"
+       << prefix << setw(24)
+       << "IXSOFL:"    << theExtendedSubheaderOverflow << "\n"
+       << prefix << setw(24)
+       << "IMDATOFF:"  << theBlockedImageDataOffset << "\n"
+       << prefix << setw(24)
+       << "BMRLNTH:"   << theBlockMaskRecordLength << "\n"
+       << prefix << setw(24)
+       << "TMRLNTH:"   << thePadPixelMaskRecordLength << "\n"
+       << prefix << setw(24)
+       << "TPXCDLNTH:" << theTransparentOutputPixelCodeLength << "\n"
+       << prefix << setw(24)
+       << "TPXCD:"     << thePadOutputPixelCode << "\n";
+
+   if ( traceDebug() )
+   {
+      out << prefix << setw(24)
+          << "theDataLocation:" << theDataLocation << "\n";
+   }
+
+   out << std::endl;
+
+   return printTags(out, prefix);
+}
+
+
+bool ossimNitfImageHeaderV2_1::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   ossimNitfImageHeaderV2_X::saveState(kwl, prefix);
+   
+   kwl.add(prefix, "ISCLSY", theSecurityClassificationSys);
+   kwl.add(prefix, "ISCODE", theCodewords);
+   kwl.add(prefix, "ISCTLH", theControlAndHandling);
+   kwl.add(prefix, "ISREL", theReleasingInstructions);
+   kwl.add(prefix, "ISDCTP", theDeclassificationType);
+   kwl.add(prefix, "ISDCDT", theDeclassificationDate);
+   kwl.add(prefix, "ISDCXM", theDeclassificationExempt);
+   kwl.add(prefix, "ISDG", theDowngrade);
+   kwl.add(prefix, "ISDGDT", theDowngradeDate);
+   kwl.add(prefix, "ISCLTX", theClassificationText);
+   kwl.add(prefix, "ISCATP", theClassificationAuthType);
+   kwl.add(prefix, "ISCAUT", theClassificationAuthority);
+   kwl.add(prefix, "ISCRSN", theClassificationReason);
+   kwl.add(prefix, "ISSRDT", theSecuritySourceDate);
+   kwl.add(prefix, "ISCTLN", theSecurityControlNumber);
+   kwl.add(prefix, "XBANDS", theNumberOfMultispectralBands);
+   
+   ossim_uint32 idx = 0;
+   
+   std::ostringstream out;
+   if(theCompressionHeader.valid())
+   {
+      theCompressionHeader->saveState(kwl, prefix);
+   }
+
+   for(idx = 0; idx < theImageBands.size(); ++idx)
+   {
+      if(theImageBands[idx].valid())
+      {
+         theImageBands[idx]->print(out, "", idx); 
+      }
+   }
+   
+   out << std::endl;
+   
+   ossimKeywordlist kwlTemp;
+   
+   std::istringstream in(out.str());
+   if(kwlTemp.parseStream(in))
+   {
+      kwl.add(prefix, kwlTemp);
+   }
+   
+   return true;
+}
+
+bool ossimNitfImageHeaderV2_1::isValid()const
+{
+   bool result = ossimNitfImageHeaderV2_X::isValid();
+
+   if(result)
+   {
+
+   }
+
+   return result;
+}
+
+bool ossimNitfImageHeaderV2_1::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // Note: Currently not looking up all fieds only ones that make sense.
+   
+   const char* lookup;
+
+   lookup = kwl.find( prefix, ISCLSY_KW );
+   if ( lookup )
+   {
+      setSecurityClassificationSystem( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCODE_KW );
+   if ( lookup )
+   {
+      setCodewords( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCTLH_KW );
+   if ( lookup )
+   {
+      setControlAndHandling( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISREL_KW);
+   if ( lookup )
+   {
+      setReleasingInstructions( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISDCTP_KW );
+   if ( lookup )
+   {
+      setDeclassificationType( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISDCDT_KW );
+   if ( lookup )
+   {
+      setDeclassificationDate( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISDCXM_KW );
+   if ( lookup )
+   {
+      setDeclassificationExempt( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISDG_KW );
+   if ( lookup )
+   {
+      setDowngrade( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISDGDT_KW );
+   if ( lookup )
+   {
+      setDowngradeDate( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCLTX_KW );
+   if ( lookup )
+   {
+      setClassificationText( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCATP_KW );
+   if ( lookup )
+   {
+      setClassificationAuthorityType( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCAUT_KW );
+   if ( lookup )
+   {
+      setClassificationAuthority( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCRSN_KW );
+   if ( lookup )
+   {
+      setClassificationReason( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISSRDT_KW );
+   if ( lookup )
+   {
+      setSecuritySourceDate( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCTLN_KW );
+   if ( lookup )
+   {
+      setSecurityControlNumber( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, NBANDS_KW );
+   if ( lookup )
+   {
+      setNumberOfBands( ossimString(lookup).toUInt32() );
+   }
+   /* Setting this in the writer versus loadstate right now
+   for (int i=0; i < theImageBands.size(); ++i)
+   {
+     theImageBands[i]->loadState(kwl, prefix, i);
+   }
+   */
+   
+   return ossimNitfImageHeaderV2_X::loadState(kwl, prefix);
+}
+
+bool ossimNitfImageHeaderV2_1::isCompressed()const
+{
+   ossimString temp = theCompression;
+   temp = temp.trim();
+   return ((temp != "NC") && (temp != "NM"));
+}
+
+bool ossimNitfImageHeaderV2_1::isEncrypted()const
+{
+   return (theEncryption[0] == '1');
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfBands()const
+{
+   if(theNumberOfBands[0] == '0')
+   {
+      return ossimString(theNumberOfMultispectralBands).toInt32();
+   }
+   else
+   {
+      return ossimString(theNumberOfBands).toInt32();
+   }
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfRows()const
+{
+   return ossimString(theSignificantRows).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfCols()const
+{
+   return ossimString(theSignificantCols).toInt32();
+}
+
+ossimString ossimNitfImageHeaderV2_1::getImageId()const
+{
+   return theImageId;
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getBitsPerPixelPerBand()const
+{
+   return ossimString(theNumberOfBitsPerPixelPerBand).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getActualBitsPerPixelPerBand()const
+{
+   return ossimString(theActualBitsPerPixelPerBand).toInt32();
+}
+
+ossimString ossimNitfImageHeaderV2_1::getIMode() const
+{
+   return ossimString(theImageMode).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_1::getSecurityClassification()const
+{
+   return theSecurityClassification;
+}
+
+ossimString  ossimNitfImageHeaderV2_1::getImageDateAndTime() const
+{
+   return ossimString(theDateTime);
+}
+
+ossimString ossimNitfImageHeaderV2_1::getAcquisitionDateMonthDayYear(ossim_uint8 separationChar)const
+{
+   ossimString result;
+
+   result += ossimString(theDateTime + 4,
+                         theDateTime + 6);
+   result += ossimString(separationChar);
+   result += ossimString(theDateTime + 6,
+                         theDateTime + 8);
+   result += ossimString(separationChar);
+   result += ossimString(theDateTime,
+                         theDateTime + 4);
+   
+   return result;
+}
+
+ossimString ossimNitfImageHeaderV2_1::getCategory()const
+{
+   return theCategory;
+}
+
+ossimString ossimNitfImageHeaderV2_1::getImageSource()const
+{
+   return theImageSource;
+}
+
+ossimString ossimNitfImageHeaderV2_1::getRepresentation()const
+{
+   return theRepresentation;
+}
+
+ossimString ossimNitfImageHeaderV2_1::getCoordinateSystem()const
+{
+   return theCoordinateSystem;
+}
+ossimString ossimNitfImageHeaderV2_1::getGeographicLocation()const
+{
+  return theGeographicLocation;
+}
+
+bool ossimNitfImageHeaderV2_1::hasBlockMaskRecords()const
+{
+   return (theBlockMaskRecords.size() > 0);
+}
+
+bool ossimNitfImageHeaderV2_1::hasPadPixelMaskRecords()const
+{
+   return (thePadPixelMaskRecords.size()>0);
+}
+
+bool ossimNitfImageHeaderV2_1::hasTransparentCode()const
+{
+   return (theTransparentOutputPixelCodeLength > 0);
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_1::getTransparentCode()const
+{
+   return thePadOutputPixelCode;
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_1::getBlockMaskRecordOffset(ossim_uint32 blockNumber,
+                                                                ossim_uint32 bandNumber)const
+{
+   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+   ossim_uint32 result = 0xffffffff;
+   
+   if((hasBlockMaskRecords())&&
+      (blockNumber < maxBlock))
+   {
+      if(theImageMode[0] == 'S')
+      {
+         if(bandNumber < (ossim_uint32)getNumberOfBands())
+         {
+            result = theBlockMaskRecords[bandNumber*maxBlock + blockNumber];
+         }
+      }
+      else
+      {
+         result = theBlockMaskRecords[blockNumber];
+      }
+   }
+
+   return result;
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_1::getPadPixelMaskRecordOffset(ossim_uint32 blockNumber,
+                                                                   ossim_uint32 bandNumber)const
+{
+   ossim_uint32 maxBlock = getNumberOfBlocksPerRow()*getNumberOfBlocksPerCol();
+   ossim_uint32 result = 0xffffffff;
+   
+   if((hasPadPixelMaskRecords())&&
+      (blockNumber < maxBlock))
+   {
+      if(theImageMode[0] == 'S')
+      {
+         if(bandNumber < (ossim_uint32)getNumberOfBands())
+         {
+            result = thePadPixelMaskRecords[bandNumber*maxBlock + blockNumber];
+         }
+      }
+      else
+      {
+         result = thePadPixelMaskRecords[blockNumber];
+      }
+   }
+
+   return result;
+}
+
+
+void ossimNitfImageHeaderV2_1::clearFields()
+{
+   memcpy(theType, "IM", 2);
+   memset(theImageId, ' ',10);
+   memset(theDateTime, '-',14);
+   memset(theTargetId, ' ',17);
+   memset(theTitle, ' ',80);
+   memset(theSecurityClassification, ' ',1);
+   memset(theSecurityClassificationSys, ' ',2);
+   memset(theCodewords, ' ',11);
+   memset(theControlAndHandling, ' ',2);
+   memset(theReleasingInstructions, ' ',20);
+   memset(theDeclassificationType, ' ',2);
+   memset(theDeclassificationDate, ' ',8);
+   memset(theDeclassificationExempt, ' ',4);
+   memset(theDowngrade, ' ',1);
+   memset(theDowngradeDate, ' ',8);
+   memset(theClassificationText, ' ',43);
+   memset(theClassificationAuthType, ' ',1);
+   memset(theClassificationAuthority, ' ',40);
+   memset(theClassificationReason, ' ',1);
+   memset(theSecuritySourceDate, ' ',8);
+   memset(theSecurityControlNumber, ' ',15);
+   memset(theEncryption, '0',1);
+   memset(theImageSource, ' ',42);
+   memset(theSignificantRows, '0',8);
+   memset(theSignificantCols, '0',8);
+   memset(thePixelValueType, ' ',3);
+   memset(theRepresentation, ' ',8);
+   memset(theCategory, ' ',8);
+   memset(theActualBitsPerPixelPerBand, ' ',2);
+   memset(theJustification, 'R',1);
+   memset(theCoordinateSystem, ' ',1);
+   memset(theGeographicLocation, ' ',60);
+   memset(theNumberOfComments, '0', 1);
+   theImageComments.clear();
+   memcpy(theCompression, "NC",2);
+   memset(theCompressionRateCode, ' ',4);
+   memset(theNumberOfBands, '0',1);
+   memset(theNumberOfMultispectralBands, ' ',5);
+   memset(theImageSyncCode, '0', 1);
+   memset(theImageMode, 'B', 1);
+   memset(theNumberOfBlocksPerRow, '0', 4);
+   memset(theNumberOfBlocksPerCol, '0', 4);
+   memset(theNumberOfPixelsPerBlockHoriz, '0', 4);
+   memset(theNumberOfPixelsPerBlockVert, '0', 4);
+   memset(theNumberOfBitsPerPixelPerBand, '0', 2);
+   memcpy(theDisplayLevel, "001", 3);
+   memset(theAttachmentLevel, '0', 3);
+   memset(theImageLocation, '0', 10);
+   memcpy(theImageMagnification, "1.0 ", 4);
+   
+   memset(theUserDefinedImageDataLength,'0', 5);
+   memset(theUserDefinedOverflow, '0', 3);
+   memset(theExtendedSubheaderDataLen, '0', 5);
+   memset(theExtendedSubheaderOverflow, '0', 3);
+   theBlockMaskRecords.clear();
+   thePadPixelMaskRecords.clear();
+
+   theBlockedImageDataOffset = 0;
+   theBlockMaskRecordLength = 0;
+   thePadPixelMaskRecordLength = 0;
+   theTransparentOutputPixelCodeLength = 0;
+   thePadOutputPixelCode = 0;
+   
+   theCompressionHeader = 0;
+   
+   theType[2] = '\0';
+   theImageId[10] = '\0';
+   theDateTime[14] = '\0';
+   theTargetId[17] = '\0';
+   theTitle[80] = '\0';
+   theSecurityClassification[1] = '\0';
+   theSecurityClassificationSys[2] = '\0';
+   theCodewords[11] = '\0';
+   theControlAndHandling[2] = '\0';
+   theReleasingInstructions[20] = '\0';
+   theDeclassificationType[2] = '\0';
+   theDeclassificationDate[8] = '\0';
+   theDeclassificationExempt[4] = '\0';
+   theDowngrade[1] = '\0';
+   theDowngradeDate[8] = '\0';
+   theClassificationText[43] = '\0';
+   theClassificationAuthType[1] = '\0';
+   theClassificationAuthority[40] = '\0';
+   theClassificationReason[1] = '\0';
+   theSecuritySourceDate[8] = '\0';
+   theSecurityControlNumber[15] = '\0';
+   theEncryption[1] = '\0';
+   theImageSource[42] = '\0';
+   theSignificantRows[8] = '\0';
+   theSignificantCols[8] = '\0';
+   thePixelValueType[3] = '\0';
+   theRepresentation[8] = '\0';
+   theCategory[8] = '\0';
+   theActualBitsPerPixelPerBand[2] = '\0';
+   theJustification[1] = '\0';
+   theCoordinateSystem[1] = '\0';
+   theGeographicLocation[60] = '\0';
+   theNumberOfComments[1] = '\0';
+   theCompression[2] = '\0';
+   theCompressionRateCode[4] = '\0';
+   theNumberOfBands[1] = '\0';
+   theNumberOfMultispectralBands[5] = '\0';
+   theImageSyncCode[1] = '\0';
+   theImageMode[1] = '\0';
+   theNumberOfBlocksPerRow[4] = '\0';
+   theNumberOfBlocksPerCol[4] = '\0';
+   theNumberOfPixelsPerBlockHoriz[4] = '\0';
+   theNumberOfPixelsPerBlockVert[4] = '\0';
+   theNumberOfBitsPerPixelPerBand[2] = '\0';
+   theDisplayLevel[3] = '\0';
+   theAttachmentLevel[3] = '\0';
+   theImageLocation[10] = '\0';
+   theImageMagnification[4] = '\0';
+   theUserDefinedImageDataLength[5] = '\0';
+   theUserDefinedOverflow[3] = '\0';
+   theExtendedSubheaderDataLen[5] = '\0';
+   theExtendedSubheaderOverflow[3] = '\0';
+   
+   theDataLocation = 0;
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfBlocksPerRow()const
+{
+   return ossimString(theNumberOfBlocksPerRow).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfBlocksPerCol()const
+{
+   return ossimString(theNumberOfBlocksPerCol).toInt32();
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfPixelsPerBlockHoriz()const
+{
+ //  return ossimString(theNumberOfPixelsPerBlockHoriz).toInt32();
+   ossim_int32 rval = ossimString(theNumberOfPixelsPerBlockHoriz).toInt32();
+   if ((rval == 0) && (getNumberOfBlocksPerCol() == 1))
+   {
+      rval = getNumberOfCols();
+   }
+   return rval;
+   
+}
+
+ossim_int32 ossimNitfImageHeaderV2_1::getNumberOfPixelsPerBlockVert()const
+{
+//   return ossimString(theNumberOfPixelsPerBlockVert).toInt32();
+   ossim_int32 rval = ossimString(theNumberOfPixelsPerBlockVert).toInt32();
+   if ((rval == 0) && (getNumberOfBlocksPerRow() == 1))
+   {
+      rval = getNumberOfRows();
+   }
+   return rval;
+}
+
+ossimIrect ossimNitfImageHeaderV2_1::getImageRect()const
+{
+//   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
+//               ossimString((char*)theImageLocation,
+//                           (char*)(&theImageLocation[5])).toDouble());
+   ossimDpt ul(0.0,0.0);   
+    double rows = ossimString(theSignificantRows).toDouble();
+    double cols = ossimString(theSignificantCols).toDouble();
+
+//    ossimDpt lr(ul.x + cols-1,
+//                ul.y + rows-1);
+    ossimDpt lr(cols-1,
+                rows-1);
+   
+    return ossimIrect(ul, lr);
+}
+
+ossimIrect ossimNitfImageHeaderV2_1::getBlockImageRect()const
+{
+//   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
+//               ossimString((char*)theImageLocation,
+//g                           (char*)(&theImageLocation[5])).toDouble());
+   ossimDpt ul(0.0,0.0);   
+   
+   double rows = getNumberOfPixelsPerBlockVert()*getNumberOfBlocksPerCol();
+   double cols = getNumberOfPixelsPerBlockHoriz()*getNumberOfBlocksPerRow();;
+   
+//   ossimDpt lr(ul.x + cols-1,
+//               ul.y + rows-1);
+   ossimDpt lr(cols-1,
+               rows-1);
+   
+    return ossimIrect(ul, lr);
+}
+
+
+ossimString ossimNitfImageHeaderV2_1::getPixelValueType()const
+{
+   return ossimString(thePixelValueType).trim();
+}
+
+
+void ossimNitfImageHeaderV2_1::setNumberOfBands(ossim_uint32 nbands)
+{
+   std::ostringstream out;
+
+   if(nbands > 9)
+   {
+      out << std::setw(5)
+          << std::setfill('0')
+          << std::setiosflags(ios::right)
+          << nbands;
+
+      theNumberOfBands[0] = '0';
+      memcpy(theNumberOfMultispectralBands, out.str().c_str(), 5);
+   }
+   else
+   {
+      out << nbands;
+      theNumberOfBands[0] = out.str().c_str()[0];
+   }
+
+   theImageBands.resize(getNumberOfBands());
+}
+
+void ossimNitfImageHeaderV2_1::setBandInfo(ossim_uint32 idx,
+                                           const ossimNitfImageBandV2_1& info)
+{
+   if(idx < theImageBands.size())
+   {
+      if(!theImageBands[idx].valid())
+      {
+         theImageBands[idx] = new ossimNitfImageBandV2_1;
+      }
+      (*theImageBands[idx]) = info;
+   }
+}
+
+void ossimNitfImageHeaderV2_1::setNumberOfRows(ossim_uint32 rows)
+{
+   std::ostringstream out;
+   if(rows > 99999999) rows = 99999999;
+   
+   out << rows;
+   ossimNitfCommon::setField(theSignificantRows, out.str(), 8, ios::right, '0');
+}
+
+void ossimNitfImageHeaderV2_1::setNumberOfCols(ossim_uint32 cols)
+{
+   std::ostringstream out;
+   if(cols > 99999999) cols = 99999999;
+
+   out << cols;
+   ossimNitfCommon::setField(theSignificantCols, out.str(), 8, ios::right, '0');
+}
+
+void ossimNitfImageHeaderV2_1::setGeographicLocationDms(const ossimDpt& ul,
+                                                        const ossimDpt& ur,
+                                                        const ossimDpt& lr,
+                                                        const ossimDpt& ll)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << ossimDms(ul.y, true).toString("ddmmss.ssssC").c_str()
+         << ossimDms(ul.x, false).toString("dddmmss.ssssC").c_str()
+         << ossimDms(ur.y, true).toString("ddmmss.ssssC").c_str()
+         << ossimDms(ur.x, false).toString("dddmmss.ssssC").c_str()
+         << ossimDms(lr.y, true).toString("ddmmss.ssssC").c_str()
+         << ossimDms(lr.x, false).toString("dddmmss.ssssC").c_str()
+         << ossimDms(ll.y, true).toString("ddmmss.ssssC").c_str()
+         << ossimDms(ll.x, false).toString("dddmmss.ssssC").c_str()
+         << std::endl;
+
+      checkForGeographicTiePointTruncation(ul);
+      checkForGeographicTiePointTruncation(ur);
+      checkForGeographicTiePointTruncation(lr);
+      checkForGeographicTiePointTruncation(ll);
+   }
+      
+   theCoordinateSystem[0] = 'G';
+   std::ostringstream out;
+
+   out << ossimDms(ul.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(ul.x, false).toString("dddmmssC").c_str();
+   out << ossimDms(ur.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(ur.x, false).toString("dddmmssC").c_str();
+   out << ossimDms(lr.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(lr.x, false).toString("dddmmssC").c_str();
+   out << ossimDms(ll.y, true).toString("ddmmssC").c_str();
+   out << ossimDms(ll.x, false).toString("dddmmssC").c_str();
+
+   memcpy(theGeographicLocation, out.str().c_str(), 60);
+}
+
+void ossimNitfImageHeaderV2_1::setGeographicLocationDecimalDegrees(
+   const ossimDpt& ul,
+   const ossimDpt& ur,
+   const ossimDpt& lr,
+   const ossimDpt& ll)
+{
+   theCoordinateSystem[0] = 'D';
+   ostringstream out;
+
+   out << (ul.lat >= 0.0?"+":"")
+       << std::setw(6)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << ul.lat
+       << (ul.lon >= 0.0?"+":"")
+       << std::setw(7)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << ul.lon;
+   out << (ur.lat >= 0.0?"+":"")
+       << std::setw(6)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << ur.lat
+       << (ur.lon >= 0.0?"+":"")
+       << std::setw(7)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << ur.lon;
+   out << (lr.lat >= 0.0?"+":"")
+       << std::setw(6)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << lr.lat
+       << (lr.lon >= 0.0?"+":"")
+       << std::setw(7)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << lr.lon;
+   out << (ll.lat >= 0.0?"+":"")
+       << std::setw(6)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << ll.lat
+       << (ll.lon >= 0.0?"+":"")
+       << std::setw(7)
+       << std::setfill('0')
+       << std::setprecision(3)
+       << std::setiosflags(std::ios::fixed)
+       << ll.lon;
+
+   memcpy(theGeographicLocation, out.str().c_str(), 60);
+}
+
+void ossimNitfImageHeaderV2_1::setUtmNorth(ossim_uint32 zone,
+                                           const ossimDpt& ul,
+                                           const ossimDpt& ur,
+                                           const ossimDpt& lr,
+                                           const ossimDpt& ll)
+{
+   theCoordinateSystem[0] = 'N';
+   
+   memcpy(theGeographicLocation,
+          encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
+}
+
+void ossimNitfImageHeaderV2_1::setUtmSouth(ossim_uint32 zone,
+                                           const ossimDpt& ul,
+                                           const ossimDpt& ur,
+                                           const ossimDpt& lr,
+                                           const ossimDpt& ll)
+{
+   theCoordinateSystem[0] = 'S';
+   
+   memcpy(theGeographicLocation,
+          encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
+}
+
+
+void ossimNitfImageHeaderV2_1::setSecurityClassificationSystem(const ossimString& value)
+{
+   ossimNitfCommon::setField(theSecurityClassificationSys, value, 2);
+}
+
+void ossimNitfImageHeaderV2_1::setCodewords(const ossimString& value)
+{
+   ossimNitfCommon::setField(theCodewords, value, 11);
+}
+
+void ossimNitfImageHeaderV2_1::setControlAndHandling(const ossimString& value)
+{
+   ossimNitfCommon::setField(theControlAndHandling, value, 2);
+}
+
+void ossimNitfImageHeaderV2_1::setReleasingInstructions(const ossimString& value)
+{
+   ossimNitfCommon::setField(theReleasingInstructions, value, 20);
+}
+
+void ossimNitfImageHeaderV2_1::setDeclassificationType(const ossimString& value)
+{
+   ossimNitfCommon::setField(theDeclassificationType, value, 2);
+}
+
+void ossimNitfImageHeaderV2_1::setDeclassificationDate(const ossimString& value)
+{
+   ossimNitfCommon::setField(theDeclassificationDate, value, 8);
+}
+
+void ossimNitfImageHeaderV2_1::setDeclassificationExempt(const ossimString& value)
+{
+   ossimNitfCommon::setField(theDeclassificationExempt, value, 4);
+}
+
+void ossimNitfImageHeaderV2_1::setDowngrade(const ossimString& value)
+{
+   ossimNitfCommon::setField(theDowngrade, value, 1);
+}
+
+void ossimNitfImageHeaderV2_1::setDowngradeDate(const ossimString& value)
+{
+   ossimNitfCommon::setField(theDowngradeDate, value, 8);
+}
+
+void ossimNitfImageHeaderV2_1::setClassificationText(const ossimString& value)
+{
+   ossimNitfCommon::setField(theClassificationText, value, 43);
+}
+
+void ossimNitfImageHeaderV2_1::setClassificationAuthorityType(const ossimString& value)
+{
+   ossimNitfCommon::setField(theClassificationAuthType, value, 1);
+}
+
+void ossimNitfImageHeaderV2_1::setClassificationAuthority(const ossimString& value)
+{
+   ossimNitfCommon::setField(theClassificationAuthority, value, 40);
+}
+
+void ossimNitfImageHeaderV2_1::setClassificationReason(const ossimString& value)
+{
+   ossimNitfCommon::setField(theClassificationReason, value, 1);
+}
+
+void ossimNitfImageHeaderV2_1::setSecuritySourceDate(const ossimString& value)
+{
+   ossimNitfCommon::setField(theSecuritySourceDate, value, 8);
+}
+
+void ossimNitfImageHeaderV2_1::setSecurityControlNumber(const ossimString& value)
+{
+   ossimNitfCommon::setField(theSecurityControlNumber, value, 15);
+}
+
+void ossimNitfImageHeaderV2_1::setImageMagnification(const ossimString& value)
+{
+   ossimNitfCommon::setField(theImageMagnification, value, 4);
+}
+
+void ossimNitfImageHeaderV2_1::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimString name = property->getName();
+
+   // Make case insensitive:
+   name.downcase();
+   
+   std::ostringstream out;
+   
+   if(!property) return;
+   
+   if(name.contains(ISCLSY_KW))
+   {
+      setSecurityClassificationSystem(property->valueToString());
+   }
+   else if(name.contains(ISCODE_KW))
+   {
+      setCodewords(property->valueToString());
+   }
+   else if(name.contains(ISCTLH_KW))
+   {
+      setControlAndHandling(property->valueToString());
+   }
+   else if(name.contains(ISREL_KW))
+   {
+      setReleasingInstructions(property->valueToString());
+   }
+   else if(name.contains(ISDCTP_KW))
+   {
+      setDeclassificationType(property->valueToString());
+   }
+   else if(name.contains(ISDCDT_KW))
+   {
+      setDeclassificationDate(property->valueToString());
+   }
+   else if(name.contains(ISDCXM_KW))
+   {
+      setDeclassificationExempt(property->valueToString());
+   }
+   else if(name.contains(ISDGDT_KW)) // Must be before: "ISDG_KW"
+   {
+      setDowngradeDate(property->valueToString());
+   }   
+   else if(name.contains(ISDG_KW))
+   {
+      setDowngrade(property->valueToString());
+   }
+   else if(name.contains(ISCLTX_KW))
+   {
+      setClassificationText(property->valueToString());
+   }
+   else if(name.contains(ISCATP_KW))
+   {
+      setClassificationAuthorityType(property->valueToString());
+   }
+   else if(name.contains(ISCAUT_KW))
+   {
+      setClassificationAuthority(property->valueToString());
+   }
+   else if(name.contains(ISCRSN_KW))
+   {
+      setClassificationReason(property->valueToString());
+   }
+   else if(name == ISCRSN_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theClassificationReason).trim());
+   }
+   else if(name.contains(ISSRDT_KW))
+   {
+      setSecuritySourceDate(property->valueToString());
+   }
+   else if(name.contains(ISCTLN_KW))
+   {
+      setSecurityControlNumber(property->valueToString());
+   }
+   else
+   {
+      ossimNitfImageHeaderV2_X::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitfImageHeaderV2_1::getProperty(const ossimString& name)const
+{
+   ossimProperty* property = 0;
+
+   if(name == ISCLSY_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theSecurityClassificationSys).trim());
+   }
+   else if(name == ISCODE_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theCodewords).trim());
+   }
+   else if(name == ISCTLH_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theControlAndHandling).trim());
+   }
+   else if(name == ISREL_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theReleasingInstructions).trim());
+   }
+   else if(name == ISDCTP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theDeclassificationType).trim());
+   }
+   else if(name == ISDCDT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theDeclassificationDate).trim());
+   }
+   else if(name == ISDCXM_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theDeclassificationExempt).trim());
+   }
+   else if(name == ISDG_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theDowngrade).trim());
+   }
+   else if(name == ISDGDT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theDowngradeDate).trim());
+   }
+   else if(name == ISCLTX_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theClassificationText).trim());
+   }
+   else if(name == ISCATP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theClassificationAuthType).trim());
+   }
+   else if(name == ISCAUT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theClassificationAuthority).trim());
+   }
+   else if(name == ISCRSN_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theClassificationReason).trim());
+   }
+   else if(name == ISSRDT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theSecuritySourceDate).trim());
+   }
+   else if(name == ISCTLN_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theSecurityControlNumber).trim());
+   }
+   else
+   {
+      return ossimNitfImageHeaderV2_X::getProperty(name);
+   }
+   
+   return property;
+}
+
+void ossimNitfImageHeaderV2_1::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfImageHeaderV2_X::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(ISCLSY_KW);
+   propertyNames.push_back(ISCODE_KW);
+   propertyNames.push_back(ISCTLH_KW);
+   propertyNames.push_back(ISREL_KW);
+   propertyNames.push_back(ISDCTP_KW);
+   propertyNames.push_back(ISDCDT_KW);
+   propertyNames.push_back(ISDCXM_KW);
+   propertyNames.push_back(ISDG_KW);
+   propertyNames.push_back(ISDGDT_KW);
+   propertyNames.push_back(ISCLTX_KW);
+   propertyNames.push_back(ISCATP_KW);
+   propertyNames.push_back(ISCAUT_KW);
+   propertyNames.push_back(ISCRSN_KW);
+   propertyNames.push_back(ISSRDT_KW);
+   propertyNames.push_back(ISCTLN_KW);
+   propertyNames.push_back(XBANDS_KW);
+}
+
+const ossimRefPtr<ossimNitfCompressionHeader> ossimNitfImageHeaderV2_1::getCompressionHeader()const
+{
+   return theCompressionHeader;
+}
+
+const ossimRefPtr<ossimNitfImageBand> ossimNitfImageHeaderV2_1::getBandInformation(ossim_uint32 idx)const
+{
+   if(idx < theImageBands.size())
+   {
+      return (ossimNitfImageBand*)theImageBands[idx].get();
+   }
+   
+   return 0;
+}
+
+
+ossimString ossimNitfImageHeaderV2_1::encodeUtm(
+   ossim_uint32 zone,
+   const ossimDpt& ul,
+   const ossimDpt& ur,
+   const ossimDpt& lr,
+   const ossimDpt& ll) const
+{
+   ostringstream out;
+
+   if(zone > 60)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUTM zone greate than 60!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   ossim_float64 east  = ul.x;
+   ossim_float64 north = ul.y;
+   
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper left northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+
+   out << setw(2)
+       << setfill('0')
+       << zone
+       << setw(6)
+       << setfill('0')
+       <<(ossim_uint32)(east+.5)
+       << setw(7)
+          << setfill('0')
+       <<(ossim_uint32)(north+.5);
+
+   
+   east  = ur.x;
+   north = ur.y;
+   
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nUpper right northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   out << setw(2)
+       << setfill('0')
+       << zone
+       << setw(6)
+       << setfill('0')
+       <<(ossim_uint32)(east+.5)
+       << setw(7)
+       << setfill('0')
+       <<(ossim_uint32)(north+.5);
+   east  = lr.x;
+   north = lr.y;
+
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower right northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }   
+
+   out << setw(2)
+       << setfill('0')
+       << zone
+       << setw(6)
+       << setfill('0')
+       <<(ossim_uint32)(east+.5)
+       << setw(7)
+       << setfill('0')
+       <<(ossim_uint32)(north+.5);
+   
+   east  = ll.x;
+   north = ll.y;
+
+   if((ossim_uint32)(east+.5) > 999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left easting too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   if((ossim_uint32)(north+.5) > 9999999)
+   {
+      std::string s = "ossimNitfImageHeaderV2_1::encodeUtm: ERROR\nLower left northing too large for NITF field!";
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << s << std::endl;
+      }
+      throw std::out_of_range(s);
+   }
+   
+   out << setw(2)
+       << setfill('0')
+       << zone
+       << setw(6)
+       << setfill('0')
+       <<(ossim_uint32)(east+.5)
+       << setw(7)
+       << setfill('0')
+       <<(ossim_uint32)(north+.5);
+   
+   return out.str().c_str();
+}
+
+bool ossimNitfImageHeaderV2_1::takeOverflowTags(std::vector<ossimNitfTagInformation> &overflowTags,
+   ossim_uint32 potentialDesIndex, bool userDefinedTags)
+{
+   overflowTags.clear();
+   std::vector<ossimNitfTagInformation>::iterator iter;
+   std::vector<ossimNitfTagInformation> specifiedTags;
+   const ossimString tagType(userDefinedTags ? "UDID" : "IXSHD");
+   for (iter = theTagList.begin(); iter != theTagList.end(); ++iter)
+   {
+      if (iter->getTagType() == tagType)
+      {
+         specifiedTags.push_back(*iter);
+      }
+   }
+
+   std::sort(specifiedTags.begin(), specifiedTags.end());
+
+   ossim_uint32 totalSize = 0;
+   const ossim_uint32 maxSize = 9996;
+   for (iter = specifiedTags.begin(); iter != specifiedTags.end() &&
+      totalSize + iter->getTotalTagLength() <= maxSize; ++iter)
+   {
+      totalSize += iter->getTotalTagLength();
+   }
+
+   for (; iter != specifiedTags.end(); ++iter)
+   {
+      overflowTags.push_back(*iter);
+      removeTag(iter->getTagName());
+   }
+
+   // If there are no overflow tags, then no DES is required
+   if (overflowTags.empty() == true)
+   {
+      potentialDesIndex = 0;
+   }
+
+   std::ostringstream overflowDes;
+   overflowDes << std::setw(3)
+           << std::setfill('0')
+           << std::setiosflags(ios::right)
+           << potentialDesIndex;
+
+   std::ostringstream tagLength;
+   tagLength << std::setw(5)
+           << std::setfill('0')
+           << std::setiosflags(ios::right)
+           << totalSize;
+
+   if (userDefinedTags)
+   {
+      strcpy(theUserDefinedOverflow, overflowDes.str().c_str());
+      strcpy(theUserDefinedImageDataLength, tagLength.str().c_str());
+   }
+   else
+   {
+      strcpy(theExtendedSubheaderOverflow, overflowDes.str().c_str());
+      strcpy(theExtendedSubheaderDataLen, tagLength.str().c_str());
+   }
+
+   return (overflowTags.empty() == false);
+}
+
diff --git a/src/support_data/ossimNitfImageHeaderV2_X.cpp b/src/support_data/ossimNitfImageHeaderV2_X.cpp
new file mode 100644
index 0000000..1b9e81b
--- /dev/null
+++ b/src/support_data/ossimNitfImageHeaderV2_X.cpp
@@ -0,0 +1,1046 @@
+#include <ossim/support_data/ossimNitfImageHeaderV2_X.h>
+
+#include <cmath> /* for fmod */
+#include <iomanip>
+#include <sstream>
+
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimDms.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimNitfImageHeader.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+
+static const ossimTrace traceDebug(
+   ossimString("ossimNitfImageHeaderV2_X:debug"));
+
+const ossimString ossimNitfImageHeaderV2_X::IM_KW       = "IM";
+const ossimString ossimNitfImageHeaderV2_X::IID1_KW     = "IID1";
+const ossimString ossimNitfImageHeaderV2_X::IDATIM_KW   = "IDATIM";
+const ossimString ossimNitfImageHeaderV2_X::TGTID_KW    = "TGTID";
+const ossimString ossimNitfImageHeaderV2_X::IID2_KW     = "IID2";
+const ossimString ossimNitfImageHeaderV2_X::ITITLE_KW   = "ITITLE";
+const ossimString ossimNitfImageHeaderV2_X::ISCLAS_KW   = "ISCLAS";
+const ossimString ossimNitfImageHeaderV2_X::ENCRYP_KW   = "ENCRYP";
+const ossimString ossimNitfImageHeaderV2_X::ISORCE_KW   = "ISORCE";
+const ossimString ossimNitfImageHeaderV2_X::NROWS_KW    = "NROWS";
+const ossimString ossimNitfImageHeaderV2_X::NCOLS_KW    = "NCOLS";
+const ossimString ossimNitfImageHeaderV2_X::PVTYPE_KW   = "PVTYPE";
+const ossimString ossimNitfImageHeaderV2_X::IREP_KW     = "IREP";
+const ossimString ossimNitfImageHeaderV2_X::ICAT_KW     = "ICAT";
+const ossimString ossimNitfImageHeaderV2_X::ABPP_KW     = "ABPP";
+const ossimString ossimNitfImageHeaderV2_X::PJUST_KW    = "PJUST";
+const ossimString ossimNitfImageHeaderV2_X::ICORDS_KW   = "ICORDS";
+const ossimString ossimNitfImageHeaderV2_X::IGEOLO_KW   = "IGEOLO";
+const ossimString ossimNitfImageHeaderV2_X::NICOM_KW    = "NICOM";
+const ossimString ossimNitfImageHeaderV2_X::ICOM_KW     =  "ICOM";
+const ossimString ossimNitfImageHeaderV2_X::IC_KW       = "IC";
+const ossimString ossimNitfImageHeaderV2_X::COMRAT_KW   = "COMRAT";
+const ossimString ossimNitfImageHeaderV2_X::NBANDS_KW   = "NBANDS";
+const ossimString ossimNitfImageHeaderV2_X::ISYNC_KW    = "ISYNC";
+const ossimString ossimNitfImageHeaderV2_X::IMODE_KW    = "IMODE";
+const ossimString ossimNitfImageHeaderV2_X::NBPR_KW     = "NBPR";
+const ossimString ossimNitfImageHeaderV2_X::NBPC_KW     = "NBPC";
+const ossimString ossimNitfImageHeaderV2_X::NPPBH_KW    = "NPPBH";
+const ossimString ossimNitfImageHeaderV2_X::NPPBV_KW    = "NPPBV";
+const ossimString ossimNitfImageHeaderV2_X::NBPP_KW     = "NBPP";
+const ossimString ossimNitfImageHeaderV2_X::IDLVL_KW    = "IDLVL";
+const ossimString ossimNitfImageHeaderV2_X::IALVL_KW    = "IALVL";
+const ossimString ossimNitfImageHeaderV2_X::ILOC_KW     = "ILOC";
+const ossimString ossimNitfImageHeaderV2_X::IMAG_KW     = "IMAG";
+const ossimString ossimNitfImageHeaderV2_X::UDIDL_KW    = "UDIDL";
+const ossimString ossimNitfImageHeaderV2_X::UDOFL_KW    = "UDOFL";
+const ossimString ossimNitfImageHeaderV2_X::IXSHDL_KW   = "IXSHDL";
+const ossimString ossimNitfImageHeaderV2_X::IXSOFL_KW   = "IXSOFL";
+const ossimString ossimNitfImageHeaderV2_X::IMDATOFF_KW = "IMDATOFF";
+const ossimString ossimNitfImageHeaderV2_X::BMRLNTH_KW  = "BMRLNTH";
+
+
+
+RTTI_DEF1(ossimNitfImageHeaderV2_X,
+          "ossimNitfImageHeaderV2_X",
+          ossimNitfImageHeader);
+
+ossimNitfImageHeaderV2_X::ossimNitfImageHeaderV2_X()
+:theImageComments()
+{
+}
+
+ossimIrect ossimNitfImageHeaderV2_X::getImageRect()const
+{
+   ossimIpt ul(0, 0);
+   ossimIpt lr(getNumberOfCols()-1, getNumberOfRows()-1);
+   return ossimIrect(ul, lr);
+   
+#if 0 
+   //---
+   // Changed to not include offset 20100619 (drb).
+   // Use void getImageLocation(ossimIpt& loc)const to get offset.
+   //---
+   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
+               ossimString((char*)theImageLocation,
+                           (char*)(&theImageLocation[5])).toDouble());
+   
+    double rows = ossimString(theSignificantRows).toDouble();
+    double cols = ossimString(theSignificantCols).toDouble();
+
+    ossimDpt lr(ul.x + cols-1,
+                ul.y + rows-1);
+     return ossimDrect(ul, lr);
+#endif
+}
+
+ossimIrect ossimNitfImageHeaderV2_X::getBlockImageRect()const
+{
+   ossimIpt ul(0, 0);
+   ossimIpt lr( (getNumberOfPixelsPerBlockHoriz()*getNumberOfBlocksPerRow())-1,
+                (getNumberOfPixelsPerBlockVert() *getNumberOfBlocksPerCol())-1);
+               
+   return ossimIrect(ul, lr);
+   
+#if 0
+   //---
+   // Changed to not include offset 20100619 (drb).
+   // Use void getImageLocation(ossimIpt& loc)const to get offset.
+   //---   
+   ossimDpt ul(ossimString((char*)(&theImageLocation[5])).toDouble(),
+               ossimString((char*)theImageLocation,
+                           (char*)(&theImageLocation[5])).toDouble());
+   
+   double rows = getNumberOfPixelsPerBlockVert()*getNumberOfBlocksPerCol();
+   double cols = getNumberOfPixelsPerBlockHoriz()*getNumberOfBlocksPerRow();;
+   
+   ossimDpt lr(ul.x + cols-1,
+               ul.y + rows-1);
+   return ossimDrect(ul, lr);
+#endif
+}
+
+void ossimNitfImageHeaderV2_X::setImageId(const ossimString& value)
+{
+   ossimNitfCommon::setField(theImageId, value, 10);
+}
+
+void ossimNitfImageHeaderV2_X::setAquisitionDateTime(const ossimString& value)
+{
+   ossimNitfCommon::setField(theDateTime, value, 14);
+}
+
+void ossimNitfImageHeaderV2_X::setTargetId(const ossimString& value)
+{
+   ossimNitfCommon::setField(theTargetId, value, 17);
+}
+
+void ossimNitfImageHeaderV2_X::setTitle(const ossimString& value)
+{
+   ossimNitfCommon::setField(theTitle, value, 80);
+}
+
+void ossimNitfImageHeaderV2_X::setSecurityClassification(const ossimString& value)
+{
+   ossimNitfCommon::setField(theSecurityClassification, value, 1);
+}
+
+void ossimNitfImageHeaderV2_X::setEncryption(const ossimString& value)
+{
+   ossimNitfCommon::setField(theEncryption, value, 1);
+}
+
+void ossimNitfImageHeaderV2_X::setImageSource(const ossimString& value)
+{
+   ossimNitfCommon::setField(theImageSource, value, 42);
+}
+
+void ossimNitfImageHeaderV2_X::setJustification(const ossimString& value)
+{
+   ossimNitfCommon::setField(theJustification, value, 1);
+}
+
+void ossimNitfImageHeaderV2_X::setCoordinateSystem(const ossimString& value)
+{
+   ossimNitfCommon::setField(theCoordinateSystem, value, 1);
+}
+
+void ossimNitfImageHeaderV2_X::setGeographicLocation(const ossimString& value)
+{
+   ossimNitfCommon::setField(theGeographicLocation, value, 60);
+}
+
+void ossimNitfImageHeaderV2_X::setNumberOfComments(const ossimString& value)
+{
+   ossimNitfCommon::setField(theNumberOfComments, value, 1);
+}
+
+void ossimNitfImageHeaderV2_X::setCompression(const ossimString& value)
+{
+   ossimNitfCommon::setField(theCompression, value, 2);
+}
+
+void ossimNitfImageHeaderV2_X::setCompressionRateCode(const ossimString& value)
+{
+   ossimNitfCommon::setField(theCompressionRateCode, value, 4);
+}
+
+void ossimNitfImageHeaderV2_X::setDisplayLevel(const ossimString& value)
+{
+   ossimNitfCommon::setField(theDisplayLevel, value, 3, std::ios::right, '0');
+}
+
+void ossimNitfImageHeaderV2_X::setAttachmentLevel(const ossimString& value)
+{
+   ossimNitfCommon::setField(theAttachmentLevel, value, 3);
+}
+
+void ossimNitfImageHeaderV2_X::setPixelType(const ossimString& pixelType)
+{
+   ossimNitfCommon::setField(thePixelValueType, pixelType, 3);
+}
+
+void ossimNitfImageHeaderV2_X::setBitsPerPixel(ossim_uint32 bitsPerPixel)
+{
+   std::stringstream strm;
+   strm << bitsPerPixel;
+   ossimNitfCommon::setField(theNumberOfBitsPerPixelPerBand,
+                             strm.str(),
+                             2,
+                             std::ios::right,
+                             '0');
+}
+
+void ossimNitfImageHeaderV2_X::setActualBitsPerPixel(ossim_uint32 bitsPerPixel)
+{
+   std::stringstream strm;
+   strm << bitsPerPixel;
+   ossimNitfCommon::setField(theActualBitsPerPixelPerBand,
+                             strm.str(),
+                             2,
+                             std::ios::right,
+                             '0');
+}
+
+void ossimNitfImageHeaderV2_X::setImageMode(char mode)
+{
+   theImageMode[0] = mode;
+}
+
+void ossimNitfImageHeaderV2_X::setCategory(const ossimString& category)
+{
+   ossimNitfCommon::setField(theCategory, category, 8);
+}
+
+void ossimNitfImageHeaderV2_X::setRepresentation(const ossimString& rep)
+{
+   ossimNitfCommon::setField(theRepresentation, rep, 8);
+}
+
+void ossimNitfImageHeaderV2_X::setBlocksPerRow(ossim_uint32 blocks)
+{
+   std::stringstream strm;
+   strm << blocks;
+   ossimNitfCommon::setField(theNumberOfBlocksPerRow,
+                             strm.str(),
+                             4,
+                             std::ios::right,
+                             '0');
+}
+
+void ossimNitfImageHeaderV2_X::setBlocksPerCol(ossim_uint32 blocks)
+{
+   std::stringstream strm;
+   strm << blocks;
+   ossimNitfCommon::setField(theNumberOfBlocksPerCol,
+                             strm.str(),
+                             4,
+                             std::ios::right,
+                             '0');
+}
+
+void ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockRow(ossim_uint32 pixels)
+{
+   std::stringstream strm;
+   strm << pixels;
+   ossimNitfCommon::setField(theNumberOfPixelsPerBlockHoriz,
+                             strm.str(),
+                             4,
+                             std::ios::right,
+                             '0');
+}
+
+void ossimNitfImageHeaderV2_X::setNumberOfPixelsPerBlockCol(ossim_uint32 pixels)
+{
+   std::stringstream strm;
+   strm << pixels;
+   ossimNitfCommon::setField(theNumberOfPixelsPerBlockVert,
+                             strm.str(),
+                             4,
+                             std::ios::right,
+                             '0');
+}
+
+ossim_uint64 ossimNitfImageHeaderV2_X::getDataLocation() const
+{
+   return theDataLocation;
+}
+
+ossimString ossimNitfImageHeaderV2_X::getImageId()const
+{
+   return theImageId;
+}
+
+ossimString ossimNitfImageHeaderV2_X::getAquisitionDateTime()const
+{
+   return theDateTime;
+}
+
+ossimString ossimNitfImageHeaderV2_X::getTargetId()const
+{
+   return ossimString(theTargetId).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getTitle()const
+{
+   return ossimString(theTitle).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getSecurityClassification()const
+{
+   return ossimString(theSecurityClassification).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getEncryption()const
+{
+   return ossimString(theEncryption).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getImageSource()const
+{
+   return ossimString(theImageSource).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getJustification()const
+{
+   return ossimString(theJustification).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getCoordinateSystem()const
+{
+   return ossimString(theCoordinateSystem).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getGeographicLocation()const
+{
+   return ossimString(theGeographicLocation).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getNumberOfComments()const
+{
+   return ossimString(theNumberOfComments).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getCompressionCode()const
+{
+   return ossimString(theCompression).trim();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getCompressionRateCode()const
+{
+   return theCompressionRateCode;
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getDisplayLevel()const
+{
+   return ossimString(theDisplayLevel).toUInt32();
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getAttachmentLevel()const
+{
+   return ossimString(theAttachmentLevel).toUInt32();
+}
+
+ossimString ossimNitfImageHeaderV2_X::getPixelType()const
+{
+   return thePixelValueType;
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getBitsPerPixel()const
+{
+   return ossimString(theNumberOfBitsPerPixelPerBand).toUInt32();
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getActualBitsPerPixel()const
+{
+   return ossimString(theActualBitsPerPixelPerBand).toUInt32();
+}
+
+char ossimNitfImageHeaderV2_X::getImageMode()const
+{
+   return theImageMode[0];
+}
+
+ossimString ossimNitfImageHeaderV2_X::getCategory()const
+{
+   return theCategory;
+}
+
+ossimString ossimNitfImageHeaderV2_X::getRepresentation()const
+{
+   return theRepresentation;
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getBlocksPerRow()const
+{
+   return ossimString(theNumberOfBlocksPerRow).toUInt32();
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getBlocksPerCol()const
+{
+   return ossimString(theNumberOfBlocksPerCol).toUInt32();
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getNumberOfPixelsPerBlockRow()const
+{
+   return ossimString(theNumberOfPixelsPerBlockVert).toUInt32();
+}
+
+ossim_uint32 ossimNitfImageHeaderV2_X::getNumberOfPixelsPerBlockCol()const
+{
+   return ossimString(theNumberOfPixelsPerBlockHoriz).toUInt32();
+}
+
+bool ossimNitfImageHeaderV2_X::isValid()const
+{
+  if((theType[0] != 'I') || theType[1] != 'M')
+  {
+    return false;
+  }
+  ossim_uint32 actualBitsPerPixel = getActualBitsPerPixel();
+  ossim_uint32 bitsPerPixel = getBitsPerPixel();
+
+  if(actualBitsPerPixel>bitsPerPixel)
+  {
+    return false;
+  }
+  
+  return true;
+}
+
+bool ossimNitfImageHeaderV2_X::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   // Note: Currently not looking up all fieds only ones that make sense.
+   
+   const char* lookup;
+
+   lookup = kwl.find( prefix, IID1_KW);
+   if ( lookup )
+   {
+      setImageId( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, IDATIM_KW);
+   if ( lookup )
+   {
+      setAquisitionDateTime( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, TGTID_KW);
+   if ( lookup )
+   {
+      setTargetId( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, IID2_KW);
+   if ( lookup )
+   {
+      setTitle( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ITITLE_KW); // duplicate of above
+   if ( lookup )
+   {
+      setTitle( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ISCLAS_KW);
+   if ( lookup )
+   {
+      setSecurityClassification( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ENCRYP_KW);
+   if ( lookup )
+   {
+      setEncryption( ossimString(lookup) );
+   }  
+   lookup = kwl.find( prefix, ISORCE_KW);
+   if ( lookup )
+   {
+      setImageSource( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, NROWS_KW);
+   if ( lookup )
+   {
+      ossimNitfCommon::setField(theSignificantRows, ossimString(lookup), 8);
+   }
+
+   lookup = kwl.find( prefix, NCOLS_KW);
+   if ( lookup )
+   {
+      ossimNitfCommon::setField(theSignificantCols, ossimString(lookup), 8);
+   }
+
+   lookup = kwl.find( prefix, PVTYPE_KW);
+   if ( lookup )
+   {
+      ossimNitfCommon::setField(thePixelValueType, ossimString(lookup), 3);
+   }
+
+   lookup = kwl.find( prefix, IREP_KW);
+   if ( lookup )
+   {
+      ossimNitfCommon::setField(theRepresentation, ossimString(lookup), 8);
+   }
+   lookup = kwl.find( prefix, ICAT_KW);
+   if ( lookup )
+   {
+      setCategory( ossimString(lookup) );
+   }
+   lookup = kwl.find( prefix, ABPP_KW);
+   if ( lookup )
+   {
+      ossimNitfCommon::setField(theActualBitsPerPixelPerBand, ossimString(lookup), 2);
+   }
+   lookup = kwl.find( prefix, NBPP_KW);
+   if ( lookup )
+   {
+      setBitsPerPixel(ossimString(lookup).toUInt32());
+   }
+   lookup = kwl.find( prefix, PJUST_KW);
+   if ( lookup )
+   {
+      setJustification(ossimString(lookup));
+   }
+   lookup = kwl.find( prefix, ICORDS_KW);
+   if ( lookup )
+   {
+      setCoordinateSystem(ossimString(lookup));
+   }
+   lookup = kwl.find( prefix, IGEOLO_KW);
+   if ( lookup )
+   {
+      setGeographicLocation(ossimString(lookup));
+   }
+   lookup = kwl.find( prefix, NICOM_KW);
+   if ( lookup )
+   {
+      setNumberOfComments(ossimString(lookup));
+   }
+   ossim_uint32 numberOfComments = ossimString(theNumberOfComments).toUInt32();
+   if (numberOfComments > 0)
+   {
+      theImageComments.resize(numberOfComments);
+      for(ossim_uint32 i=0; i < numberOfComments; ++i)
+      {
+        ossimString icpre = ossimString(ICOM_KW) + ossimString::toString(i);
+         lookup = kwl.find( prefix, icpre );
+        theImageComments[i] = ossimString(lookup);
+      }
+   }
+   lookup = kwl.find( prefix, IC_KW);
+   if ( lookup )
+   {
+      setCompression(ossimString(lookup));
+   }
+   lookup = kwl.find( prefix, COMRAT_KW);
+   if ( lookup )
+   {
+      setCompressionRateCode(ossimString(lookup));
+   }
+   lookup = kwl.find( prefix, IMODE_KW);
+   if ( lookup )
+   {
+      setImageMode(lookup[0]);
+   }
+   lookup = kwl.find( prefix, ISYNC_KW);
+   if ( lookup )
+   {
+      ossimNitfCommon::setField(theImageSyncCode, ossimString(lookup), 1);
+   }
+   lookup = kwl.find( prefix, IALVL_KW);
+   if ( lookup )
+   {
+      setAttachmentLevel(ossimString(lookup));
+   }
+   lookup = kwl.find( prefix, IDLVL_KW);
+   if ( lookup )
+   {
+      setDisplayLevel(ossimString(lookup));
+   }
+   
+   return true;
+}
+
+void ossimNitfImageHeaderV2_X::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimString name = property->getName();
+
+   // Make case insensitive:
+   name.upcase();
+   
+   std::ostringstream out;
+   
+   if(!property) return;
+   
+   if(name.contains(IID1_KW))
+   {
+      setImageId(property->valueToString());
+   }
+   else if(name.contains(IDATIM_KW))
+   {
+      setAquisitionDateTime(property->valueToString());
+   }
+   else if(name.contains(TGTID_KW))
+   {
+      setTargetId(property->valueToString());
+   }
+   else if(name.contains(IID2_KW)||
+           name.contains(ITITLE_KW))
+   {
+      setTitle(property->valueToString());
+   }
+   else if(name.contains(ISCLAS_KW))
+   {
+      setSecurityClassification(property->valueToString());
+   }
+   else if(name.contains(ENCRYP_KW))
+   {
+      setEncryption(property->valueToString());
+   }
+   else if(name.contains(ISORCE_KW))
+   {
+      setImageSource(property->valueToString());
+   }
+   else if(name.contains(PVTYPE_KW))
+   {
+      setPixelType(property->valueToString());
+   }
+   else if(name.contains(IREP_KW))
+   {
+      setRepresentation(property->valueToString());
+   }
+   else if(name.contains(ICAT_KW))
+   {
+      setCategory(property->valueToString());
+   }
+   else if(name.contains(ABPP_KW))
+   {
+      setActualBitsPerPixel(property->valueToString().toUInt32());
+   }
+   else if(name.contains(PJUST_KW))
+   {
+      setJustification(property->valueToString());
+   }
+   else if(name.contains(ICORDS_KW))
+   {
+      setCoordinateSystem(property->valueToString());
+   }
+   else if(name.contains(IGEOLO_KW))
+   {
+      setGeographicLocation(property->valueToString());
+   }
+   else if(name.contains(NICOM_KW))
+   {
+      setNumberOfComments(property->valueToString());
+   }
+   else if(name.contains(IC_KW))
+   {
+      setCompression(property->valueToString());
+   }
+   else if(name.contains(COMRAT_KW))
+   {
+      setCompressionRateCode(property->valueToString());
+   }
+   else if(name.contains(ISYNC_KW))
+   {
+   }
+   else if(name.contains(IMODE_KW))
+   {
+      setImageMode(*(property->valueToString().trim().begin()));
+   }
+   else if(name.contains(NBPR_KW))
+   {
+      setBlocksPerRow(property->valueToString().toUInt32());
+   }
+   else if(name.contains(NBPC_KW))
+   {
+      setBlocksPerCol(property->valueToString().toUInt32());
+   }
+   else if(name.contains(NPPBH_KW))
+   {
+      setNumberOfPixelsPerBlockRow(property->valueToString().toUInt32());
+   }
+   else if(name.contains(NPPBV_KW))
+   {
+      setNumberOfPixelsPerBlockCol(property->valueToString().toUInt32());
+   }
+   else if(name.contains(NBPP_KW))
+   {
+      setBitsPerPixel(property->valueToString().toUInt32());
+   }
+   else if(name.contains(IDLVL_KW))
+   {
+      setDisplayLevel(property->valueToString());
+   }
+   else if(name.contains(IALVL_KW))
+   {
+      setAttachmentLevel(property->valueToString());
+   }
+   else if(name.contains(ILOC_KW))
+   {
+   }
+   else if(name.contains(IMAG_KW))
+   {
+   }
+   else
+   {
+      ossimNitfImageHeader::setProperty(property);
+   }
+}
+
+ossimRefPtr<ossimProperty> ossimNitfImageHeaderV2_X::getProperty(const ossimString& name)const
+{
+   ossimProperty* property = 0;
+
+   if(name == IID1_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theImageId).trim());
+   }
+   else if(name == IDATIM_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theDateTime).trim());
+   }
+   else if(name == TGTID_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theTargetId).trim());
+   }
+   else if((name == IID2_KW)||
+           (name == ITITLE_KW))
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theTitle).trim());
+   }
+   else if(name == ISCLAS_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theSecurityClassification).trim());
+   }
+   else if(name == ENCRYP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theEncryption).trim());
+   }
+   else if(name == ISORCE_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theImageSource).trim());
+   }
+   else if(name == PVTYPE_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(thePixelValueType).trim());
+   }
+   else if(name == IREP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theRepresentation).trim());
+   }
+   else if(name == ICAT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theCategory).trim());
+   }
+   else if(name == ABPP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theActualBitsPerPixelPerBand).trim());
+   }
+   else if(name == PJUST_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theJustification).trim());
+   }
+   else if(name == ICORDS_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theCoordinateSystem).trim());
+   }
+   else if(name == IGEOLO_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theGeographicLocation).trim());
+   }
+   else if(name == NICOM_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theNumberOfComments).trim());
+   }
+   else if(name == IC_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theCompression).trim());
+   }
+   else if(name == COMRAT_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theCompressionRateCode).trim());
+   }
+   else if(name == ISYNC_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theImageSyncCode).trim());
+   }
+   else if(name == IMODE_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theImageMode).trim());
+   }
+   else if(name == NBPR_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theNumberOfBlocksPerRow).trim());
+   }
+   else if(name == NBPC_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theNumberOfBlocksPerCol).trim());
+   }
+   else if(name == NPPBH_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theNumberOfPixelsPerBlockHoriz).trim());
+   }
+   else if(name == NPPBV_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theNumberOfPixelsPerBlockVert).trim());
+   }
+   else if(name == NBPP_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theNumberOfBitsPerPixelPerBand).trim());
+   }
+   else if(name == IDLVL_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theDisplayLevel).trim());
+   }
+   else if(name == IALVL_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theAttachmentLevel).trim());
+   }
+   else if(name == ILOC_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theImageLocation).trim());
+   }
+   else if(name == IMAG_KW)
+   {
+      property = new ossimStringProperty(name,
+                                         ossimString(theImageMagnification).trim());
+   }
+   else if(name == "source")
+   {
+      property = new ossimStringProperty(name,
+                                         getImageSource());
+   }
+   else if(name == "image_date")
+   {
+      property = new ossimStringProperty(name,
+                                         getAcquisitionDateMonthDayYear());
+   }
+   else if(name == "image_title")
+   {
+      property = new ossimStringProperty(name,
+                                         getTitle());
+   }
+   else
+   {
+      return ossimNitfImageHeader::getProperty(name);
+                                         
+   }
+   return property;
+}
+
+void ossimNitfImageHeaderV2_X::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfImageHeader::getPropertyNames(propertyNames);
+   propertyNames.push_back(IID1_KW);
+   propertyNames.push_back(IDATIM_KW);
+   propertyNames.push_back(TGTID_KW);
+   propertyNames.push_back(IID2_KW);
+   propertyNames.push_back(ISCLAS_KW);
+   propertyNames.push_back(ENCRYP_KW);
+   propertyNames.push_back(ISORCE_KW);
+   propertyNames.push_back(PVTYPE_KW);
+   propertyNames.push_back(IREP_KW);
+   propertyNames.push_back(ICAT_KW);
+   propertyNames.push_back(ABPP_KW);
+   propertyNames.push_back(PJUST_KW);
+   propertyNames.push_back(ICORDS_KW);
+   propertyNames.push_back(IGEOLO_KW);
+   propertyNames.push_back(NICOM_KW);
+   propertyNames.push_back(IC_KW);
+   propertyNames.push_back(COMRAT_KW);
+   propertyNames.push_back(ISYNC_KW);
+   propertyNames.push_back(IMODE_KW);
+   propertyNames.push_back(NBPR_KW);
+   propertyNames.push_back(NBPC_KW);
+   propertyNames.push_back(NPPBH_KW);
+   propertyNames.push_back(NPPBV_KW);
+   propertyNames.push_back(NBPP_KW);
+   propertyNames.push_back(IDLVL_KW);
+   propertyNames.push_back(IALVL_KW);
+   propertyNames.push_back(ILOC_KW);
+   propertyNames.push_back(IMAG_KW);
+
+   // Temp addition (drb)
+   propertyNames.push_back(ossimString("source"));
+   propertyNames.push_back(ossimString("image_date"));
+   propertyNames.push_back(ossimString("image_title"));
+}
+
+ossimString ossimNitfImageHeaderV2_X::getImageMagnification()const
+{
+   return ossimString(theImageMagnification).trim();
+}
+
+void ossimNitfImageHeaderV2_X::getImageLocation(ossimIpt& loc)const
+{
+   loc.x = ossimString((char*)(&theImageLocation[5])).toInt32();
+   loc.y = ossimString((char*)theImageLocation,
+                       (char*)(&theImageLocation[5])).toInt32();
+}
+
+void ossimNitfImageHeaderV2_X::setGeographicLocationDms(const ossimDpt& ul,
+                                                        const ossimDpt& ur,
+                                                        const ossimDpt& lr,
+                                                        const ossimDpt& ll)
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+      << ossimDms(ul.y, true).toString("ddmmss.ssssC").c_str()
+      << ossimDms(ul.x, false).toString("dddmmss.ssssC").c_str()
+      << ossimDms(ur.y, true).toString("ddmmss.ssssC").c_str()
+      << ossimDms(ur.x, false).toString("dddmmss.ssssC").c_str()
+      << ossimDms(lr.y, true).toString("ddmmss.ssssC").c_str()
+      << ossimDms(lr.x, false).toString("dddmmss.ssssC").c_str()
+      << ossimDms(ll.y, true).toString("ddmmss.ssssC").c_str()
+      << ossimDms(ll.x, false).toString("dddmmss.ssssC").c_str()
+      << std::endl;
+      
+      checkForGeographicTiePointTruncation(ul);
+      checkForGeographicTiePointTruncation(ur);
+      checkForGeographicTiePointTruncation(lr);
+      checkForGeographicTiePointTruncation(ll);
+   }
+   
+   theCoordinateSystem[0] = 'G';
+   
+   memcpy(theGeographicLocation,
+          ossimNitfCommon::encodeGeographicDms(ul,ur,lr,ll).c_str(), 60);
+}
+
+void ossimNitfImageHeaderV2_X::setGeographicLocationDecimalDegrees(
+   const ossimDpt& ul,
+   const ossimDpt& ur,
+   const ossimDpt& lr,
+   const ossimDpt& ll)
+{
+   theCoordinateSystem[0] = 'D';
+   memcpy(theGeographicLocation,
+          ossimNitfCommon::encodeGeographicDecimalDegrees(
+             ul, ur, lr, ll).c_str(), 60);
+}
+
+void ossimNitfImageHeaderV2_X::setUtmNorth(ossim_uint32 zone,
+                                           const ossimDpt& ul,
+                                           const ossimDpt& ur,
+                                           const ossimDpt& lr,
+                                           const ossimDpt& ll)
+{
+   theCoordinateSystem[0] = 'N';
+   
+   memcpy(theGeographicLocation,
+          ossimNitfCommon::encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
+}
+
+void ossimNitfImageHeaderV2_X::setUtmSouth(ossim_uint32 zone,
+                                           const ossimDpt& ul,
+                                           const ossimDpt& ur,
+                                           const ossimDpt& lr,
+                                           const ossimDpt& ll)
+{
+   theCoordinateSystem[0] = 'S';
+   
+   memcpy(theGeographicLocation,
+          ossimNitfCommon::encodeUtm(zone, ul, ur, lr, ll).c_str(), 60);
+}
+
+
+bool ossimNitfImageHeaderV2_X::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = ossimNitfImageHeader::saveState(kwl, prefix);
+   
+   kwl.add(prefix, IM_KW.c_str(),       theType);
+   kwl.add(prefix, IID1_KW.c_str(),     theImageId);
+   kwl.add(prefix, IDATIM_KW.c_str(),   theDateTime);
+   kwl.add(prefix, TGTID_KW.c_str(),    theTargetId);
+   kwl.add(prefix, IID2_KW.c_str(),     theTitle);
+   kwl.add(prefix, ISCLAS_KW.c_str(),   theSecurityClassification);
+   kwl.add(prefix, ENCRYP_KW.c_str(),   theEncryption);
+   kwl.add(prefix, ISORCE_KW.c_str(),   theImageSource);
+   kwl.add(prefix, NROWS_KW.c_str(),    theSignificantRows);
+   kwl.add(prefix, NCOLS_KW.c_str(),    theSignificantCols);
+   kwl.add(prefix, PVTYPE_KW.c_str(),   thePixelValueType);
+   kwl.add(prefix, IREP_KW.c_str(),     theRepresentation);
+   kwl.add(prefix, ABPP_KW.c_str(),     theActualBitsPerPixelPerBand);
+   kwl.add(prefix, ICAT_KW.c_str(),     theCategory);
+   kwl.add(prefix, PJUST_KW.c_str(),    theJustification);
+   kwl.add(prefix, ICORDS_KW.c_str(),   theCoordinateSystem);
+   kwl.add(prefix, NICOM_KW.c_str(),    theNumberOfComments);
+   for (ossim_uint32 i=0; i < ossimString(theNumberOfComments).toUInt32(); ++i)
+   {
+     ossimString icpre = ossimString(ICOM_KW) + ossimString::toString(i);
+     kwl.add(prefix, icpre.c_str(), theImageComments[i]);
+   }
+   kwl.add(prefix, IGEOLO_KW.c_str(),   theGeographicLocation);
+   kwl.add(prefix, IC_KW.c_str(),       theCompression);
+   kwl.add(prefix, COMRAT_KW.c_str(),   theCompressionRateCode);
+   kwl.add(prefix, NBANDS_KW.c_str(),   theNumberOfBands);
+   kwl.add(prefix, ISYNC_KW.c_str(),    theImageSyncCode);
+   kwl.add(prefix, IMODE_KW.c_str(),    theImageMode);
+   kwl.add(prefix, NBPR_KW.c_str(),     theNumberOfBlocksPerRow);
+   kwl.add(prefix, NBPC_KW.c_str(),     theNumberOfBlocksPerCol);
+   kwl.add(prefix, NPPBH_KW.c_str(),    theNumberOfPixelsPerBlockHoriz);
+   kwl.add(prefix, NPPBV_KW.c_str(),    theNumberOfPixelsPerBlockVert);
+   kwl.add(prefix, NBPP_KW.c_str(),     theNumberOfBitsPerPixelPerBand);
+   kwl.add(prefix, IDLVL_KW.c_str(),    theDisplayLevel);
+   kwl.add(prefix, IALVL_KW.c_str(),    theAttachmentLevel);
+   kwl.add(prefix, ILOC_KW.c_str(),     theImageLocation);
+   kwl.add(prefix, IMAG_KW.c_str(),     theImageMagnification);
+   kwl.add(prefix, UDIDL_KW.c_str(),    theUserDefinedImageDataLength);
+   kwl.add(prefix, UDOFL_KW.c_str(),    theUserDefinedOverflow);
+   kwl.add(prefix, IXSHDL_KW.c_str(),   theExtendedSubheaderDataLen);
+   kwl.add(prefix, IXSOFL_KW.c_str(),   theExtendedSubheaderOverflow);
+   kwl.add(prefix, IMDATOFF_KW.c_str(), theBlockedImageDataOffset);
+   kwl.add(prefix, BMRLNTH_KW.c_str(),  theBlockMaskRecordLength);
+   
+   return result;
+}
+
+
+
+
+
+
diff --git a/src/support_data/ossimNitfImageLut.cpp b/src/support_data/ossimNitfImageLut.cpp
new file mode 100644
index 0000000..6b931d6
--- /dev/null
+++ b/src/support_data/ossimNitfImageLut.cpp
@@ -0,0 +1,34 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License: MIT
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <cstring> // memcpy
+#include <ostream>
+
+#include <ossim/support_data/ossimNitfImageLut.h>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimNitfImageLut &data)
+{
+   data.print(out);
+
+   return out;
+}
+
+RTTI_DEF1(ossimNitfImageLut, "ossimNitfImageLut", ossimObject);
+ossimNitfImageLut::ossimNitfImageLut()
+{
+}
+
+ossimNitfImageLut::~ossimNitfImageLut()
+{
+}
+
diff --git a/ossim/src/ossim/support_data/ossimNitfImageLutV2_0.cpp b/src/support_data/ossimNitfImageLutV2_0.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfImageLutV2_0.cpp
rename to src/support_data/ossimNitfImageLutV2_0.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfImageLutV2_1.cpp b/src/support_data/ossimNitfImageLutV2_1.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfImageLutV2_1.cpp
rename to src/support_data/ossimNitfImageLutV2_1.cpp
diff --git a/src/support_data/ossimNitfInfo.cpp b/src/support_data/ossimNitfInfo.cpp
new file mode 100644
index 0000000..f70cf0d
--- /dev/null
+++ b/src/support_data/ossimNitfInfo.cpp
@@ -0,0 +1,78 @@
+//---
+//
+// License: MIT
+//
+// Description: NITF Info object.
+// 
+//---
+// $Id$
+
+#include <ossim/support_data/ossimNitfInfo.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+
+#include <ostream>
+#include <sstream>
+#include <memory>
+
+ossimNitfInfo::ossimNitfInfo()
+   : m_nitfFile(0)
+{
+}
+
+ossimNitfInfo::~ossimNitfInfo()
+{
+   m_nitfFile.reset();
+}
+
+bool ossimNitfInfo::open(const ossimFilename& file)
+{
+   bool result = false;
+   
+   std::string connectionString = file.c_str();
+   std::shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+      createIstream( file.c_str(), std::ios_base::in|std::ios_base::binary);
+   
+   if ( str )
+   {
+      result = open(str, connectionString);
+   }
+   return result;
+}
+
+bool ossimNitfInfo::open(std::shared_ptr<ossim::istream>& str,
+                         const std::string& connectionString)
+{
+   bool result = false;
+   if ( str )
+   {
+      m_nitfFile = std::make_shared<ossimNitfFile>();
+      result = m_nitfFile->parseStream(ossimFilename(connectionString), *str);
+   }
+   return result;
+}
+
+std::ostream& ossimNitfInfo::print(std::ostream& out) const
+{
+   if ( m_nitfFile )
+   {
+      std::string prefix;
+      m_nitfFile->print(out, prefix, getProcessOverviewFlag());
+   }
+   return out;
+}
+
+
+bool ossimNitfInfo::getKeywordlist(ossimKeywordlist& kwl,
+                                   ossim_uint32 entryIndex)const
+{
+   // Do a print to a memory stream.
+   std::ostringstream out;
+   m_nitfFile->print( out, entryIndex );
+
+   std::istringstream in( out.str() );
+
+   // Give the result to the keyword list.
+   return kwl.parseStream( in );
+}
diff --git a/src/support_data/ossimNitfJ2klraTag.cpp b/src/support_data/ossimNitfJ2klraTag.cpp
new file mode 100644
index 0000000..8e52af0
--- /dev/null
+++ b/src/support_data/ossimNitfJ2klraTag.cpp
@@ -0,0 +1,349 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimNitfJ2klraTag.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: NITF J2KLRA tag.
+//
+// See:  ISO/IEC BIIF Profile BPJ2K01.00 Table 9-3.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+
+#include <ossim/support_data/ossimNitfJ2klraTag.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/base/ossimString.h>
+
+#include <cstring> /* for memcpy */
+#include <iomanip>
+#include <istream>
+#include <ostream>
+
+RTTI_DEF1(ossimNitfJ2klraTag, "ossimNitfJ2klraTag", ossimNitfRegisteredTag);
+
+ossimNitfJ2klraTag::ossimNitfJ2klraTag()
+   : ossimNitfRegisteredTag(std::string("J2KLRA"), 0),
+     m_layer(1)
+{
+   clearFields();
+}
+
+void ossimNitfJ2klraTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(m_orig, ORIG_SIZE);
+   in.read(m_levels_o, NLEVELS_O_SIZE);
+   in.read(m_bands_o, NBANDS_O_SIZE);
+   in.read(m_layers_o, NLAYERS_O_SIZE);
+
+   ossim_uint32 layers = getNumberOfLayersOriginal();
+   if ( layers && (layers < 1000) ) // 999 max
+   {
+      m_layer.resize(layers);
+      for ( ossim_uint32 i = 0; i < layers; ++i )
+      {
+         in.read(m_layer[i].m_layer_id, LAYER_ID_SIZE);
+         in.read(m_layer[i].m_bitrate, BITRATE_SIZE);
+         m_layer[i].m_layer_id[LAYER_ID_SIZE] = '\0';
+         m_layer[i].m_bitrate[BITRATE_SIZE]   = '\0';
+      }
+   }
+   else
+   {
+      m_layer.clear();
+   }
+
+   // Conditional:
+   if ( isParsed() )
+   {
+      in.read(m_nlevels_i, NLEVELS_I_SIZE);
+      in.read(m_nbands_i,  NBANDS_I_SIZE);
+      in.read(m_nlayers_i, NLAYERS_I_SIZE);
+   }
+   
+   // Set the base tag length.
+   setTagLength( getSizeInBytes() );
+}
+
+void ossimNitfJ2klraTag::writeStream(std::ostream& out)
+{
+   out.write(m_orig, ORIG_SIZE);
+   out.write(m_levels_o, NLEVELS_O_SIZE);
+   out.write(m_bands_o, NBANDS_O_SIZE);
+   out.write(m_layers_o, NLAYERS_O_SIZE);
+   
+   ossim_uint32 size = m_layer.size();
+   for ( ossim_uint32 i = 0; i < size; ++i )
+   {
+      out.write(m_layer[i].m_layer_id, LAYER_ID_SIZE);
+      out.write(m_layer[i].m_bitrate, BITRATE_SIZE);
+   }
+
+   // Conditional:
+   if ( isParsed() )
+   {
+      out.write(m_nlevels_i, NLEVELS_I_SIZE);
+      out.write(m_nbands_i, NBANDS_I_SIZE);
+      out.write(m_nlayers_i, NLAYERS_I_SIZE);
+   }
+}
+
+ossim_uint32 ossimNitfJ2klraTag::getSizeInBytes()const
+{
+   ossim_uint32 result = 11 + (m_layer.size() * 12);
+
+   // Conditional:
+   ossim_uint32 orig = getOriginNumber();
+   if ( orig )
+   {
+      if ( orig % 2 ) // Odd origins are "parsed".
+      {   
+         result += 10;
+      }
+   }
+   return result;
+}
+
+void ossimNitfJ2klraTag::clearFields()
+{
+   memset(m_orig, 0, ORIG_SIZE);
+
+   memset(m_levels_o, 0, NLEVELS_O_SIZE);
+   memset(m_bands_o, 0, NBANDS_O_SIZE);
+   memset(m_layers_o, 0, NLAYERS_O_SIZE);
+
+   m_layer.clear();
+
+   memset(m_nlevels_i, 0, NLEVELS_I_SIZE);
+   memset(m_nbands_i, 0, NBANDS_I_SIZE);
+   memset(m_nlayers_i, 0, NLAYERS_I_SIZE);
+   
+   m_orig[ORIG_SIZE]= '\0';
+   
+   m_levels_o[NLEVELS_O_SIZE]= '\0';
+   m_bands_o[NBANDS_O_SIZE]= '\0';
+   m_layers_o[NLAYERS_O_SIZE]= '\0';
+
+   m_nlevels_i[NLEVELS_I_SIZE]= '\0';
+   m_nbands_i[NBANDS_I_SIZE] = '\0';
+   m_nlayers_i[NLAYERS_I_SIZE] = '\0';
+
+   // Set the base tag length.
+   setTagLength( 0 );
+}
+
+std::ostream& ossimNitfJ2klraTag::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(ios::left)
+       << pfx << std::setw(24) << "CETAG:"     << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"       << getTagLength() << "\n"
+       << pfx << std::setw(24) << "ORIG:"      << m_orig << "\n"
+       << pfx << std::setw(24) << "NLEVELS_O:" << m_levels_o << "\n"
+       << pfx << std::setw(24) << "NBANDS_O:"  << m_bands_o << "\n"
+       << pfx << std::setw(24) << "NLAYERS_O:" << m_layers_o << "\n";
+
+   ossim_uint32 size = m_layer.size();
+   for ( ossim_uint32 i = 0; i < size; ++i )
+   {
+      out << pfx << "LAYER_ID[" << i << std::setw(14) << "]:" << m_layer[i].m_layer_id << "\n"
+          << pfx << "BITRATE[" << i << std::setw(15) << "]:" << m_layer[i].m_bitrate << "\n";
+   }
+
+   // Conditional:
+   if ( isParsed() )
+   {
+      out << pfx << std::setw(24) << "NLEVELS_I:"     << m_nlevels_i << "\n"
+          << pfx << std::setw(24) << "NBANDS_I_SIZE:" << m_nbands_i << "\n"
+          << pfx << std::setw(24) << "NLAYERS_I:"     << m_nlayers_i << "\n";
+   }
+   
+   return out;
+}
+   
+ossim_uint32 ossimNitfJ2klraTag::getOriginNumber() const
+{
+   return ossimString(m_orig).toUInt32();
+}
+   
+ossim_uint32 ossimNitfJ2klraTag::getNumberOfLayersOriginal() const
+{
+   return ossimString(m_layers_o).toUInt32();
+}
+
+bool ossimNitfJ2klraTag::setOrigin( ossim_uint32 origin )
+{
+   bool result = true;
+   if ( origin <= 9 )
+   {
+      // Ascii 0 to 9
+      m_orig[0] = 0x30 + origin;
+   }
+   else
+   {
+      result = false;
+   }
+   return result;
+}
+
+bool ossimNitfJ2klraTag::setLevelsO( ossim_uint32 levels )
+{
+   bool result = false;
+   if ( levels <= 32 )
+   {
+      ossimString os = ossimNitfCommon::convertToUIntString( levels, NLEVELS_O_SIZE );
+      if ( os.size() == NLEVELS_O_SIZE )
+      {
+         strncpy( m_levels_o, os.string().c_str(), NLEVELS_O_SIZE );
+         result = true;
+      }
+   }
+   return result;
+}
+   
+bool ossimNitfJ2klraTag::setBandsO( ossim_uint32 bands )
+{
+   bool result = false;
+   if ( ( bands >= 1 ) && ( bands <= 16384 ) )
+   {
+      ossimString os = ossimNitfCommon::convertToUIntString( bands, NBANDS_O_SIZE );
+      if ( os.size() == NBANDS_O_SIZE )
+      {
+         strncpy( m_bands_o, os.string().c_str(), NBANDS_O_SIZE );
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimNitfJ2klraTag::setLayersO( ossim_uint32 layers )
+{
+   bool result = false;
+   if ( ( layers >= 1 ) && ( layers <= 999 ) )
+   {
+      ossimString os = ossimNitfCommon::convertToUIntString( layers, NLAYERS_O_SIZE );
+      if ( os.size() == NLAYERS_O_SIZE )
+      {
+         strncpy( m_layers_o, os.string().c_str(), NLAYERS_O_SIZE );
+
+         // Conditional repeating field:
+         m_layer.resize( layers );
+         
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimNitfJ2klraTag::setLevelsI( ossim_uint32 levels )
+{
+   bool result = false;
+   if ( levels <= 32 )
+   {
+      ossimString os = ossimNitfCommon::convertToUIntString( levels, NLEVELS_I_SIZE );
+      if ( os.size() == NLEVELS_I_SIZE )
+      {
+         strncpy( m_nlevels_i, os.string().c_str(), NLEVELS_I_SIZE );
+         result = true;
+      }
+   }
+   return result;
+}
+   
+bool ossimNitfJ2klraTag::setBandsI( ossim_uint32 bands )
+{
+   bool result = false;
+   if ( ( bands >= 1 ) && ( bands <= 16384 ) )
+   {
+      ossimString os = ossimNitfCommon::convertToUIntString( bands, NBANDS_I_SIZE );
+      if ( os.size() == NBANDS_I_SIZE )
+      {
+         strncpy( m_nbands_i, os.string().c_str(), NBANDS_I_SIZE );
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimNitfJ2klraTag::setLayersI( ossim_uint32 layers )
+{
+   bool result = false;
+   if ( ( layers >= 1 ) && ( layers <= 999 ) )
+   {
+      ossimString os = ossimNitfCommon::convertToUIntString( layers, NLAYERS_I_SIZE );
+      if ( os.size() == NLAYERS_I_SIZE )
+      {
+         strncpy( m_nlayers_i, os.string().c_str(), NLAYERS_I_SIZE );
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimNitfJ2klraTag::setLayerId( ossim_uint32 index, ossim_uint32 id )
+{
+   bool result = false;
+   if ( index < m_layer.size() && ( id <= 998 ) )
+   {
+      ossimString os = ossimNitfCommon::convertToUIntString( id, LAYER_ID_SIZE );
+      if ( os.size() ==  LAYER_ID_SIZE)
+      {
+         strncpy( m_layer[index].m_layer_id, os.string().c_str(), LAYER_ID_SIZE );
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimNitfJ2klraTag::setLayerBitRate( ossim_uint32 index, ossim_float64 bitRate )
+{
+   bool result = false;
+   if ( index < m_layer.size() && ( bitRate >= 0.0 ) && ( bitRate <= 37.0 ) )
+   {
+      // 00.000000 – 37.000000
+      ossimString os = ossimNitfCommon::convertToDoubleString( bitRate, 6, BITRATE_SIZE );
+      if ( os.size() == BITRATE_SIZE)
+      {
+         strncpy( m_layer[index].m_bitrate, os.string().c_str(), BITRATE_SIZE);
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimNitfJ2klraTag::isParsed() const
+{
+   bool result = false;
+   ossim_uint32 orig = getOriginNumber();
+   if ( orig )
+   {
+      /*  
+       * 0 - Original NPJE
+       * 1 – Parsed NPJE
+       * 2 – Original EPJE
+       * 3 – Parsed EPJE*
+       * 4 - Original TPJE
+       * 5 - Parsed TPJE
+       * 6 - Original LPJE
+       * 7 - Parsed LPJE
+       * 8 – Original other
+       * 9 – Parsed other
+       */
+      if ( orig % 2 ) // Odd origins are "parsed".
+      {
+         result = true;
+      }
+   }
+   return result;
+}
diff --git a/ossim/src/ossim/support_data/ossimNitfLabelHeader.cpp b/src/support_data/ossimNitfLabelHeader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfLabelHeader.cpp
rename to src/support_data/ossimNitfLabelHeader.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfLabelHeaderV2_0.cpp b/src/support_data/ossimNitfLabelHeaderV2_0.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfLabelHeaderV2_0.cpp
rename to src/support_data/ossimNitfLabelHeaderV2_0.cpp
diff --git a/src/support_data/ossimNitfLocalCartographicTag.cpp b/src/support_data/ossimNitfLocalCartographicTag.cpp
new file mode 100644
index 0000000..5ba8f89
--- /dev/null
+++ b/src/support_data/ossimNitfLocalCartographicTag.cpp
@@ -0,0 +1,137 @@
+//*******************************************************************
+//
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfLocalCartographicTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <sstream>
+#include <iostream>
+#include <iomanip>
+#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
+
+RTTI_DEF1(ossimNitfLocalCartographicTag, "ossimNitfLocalCartographicTag", ossimNitfRegisteredTag);
+
+ossimNitfLocalCartographicTag::ossimNitfLocalCartographicTag()
+   : ossimNitfRegisteredTag(std::string("MAPLOB"), 43)
+{
+}
+
+ossimNitfLocalCartographicTag::~ossimNitfLocalCartographicTag()
+{
+}
+
+void ossimNitfLocalCartographicTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theLengthUnits, 3);
+   in.read(theEastingInterval, 5);
+   in.read(theNorthingInterval, 5);
+   in.read(theEastingReferenceOrigin, 15);
+   in.read(theNorthingReferenceOrigin, 15);
+}
+
+void ossimNitfLocalCartographicTag::writeStream(std::ostream& out)
+{
+   out.write(theLengthUnits, 3);
+   out.write(theEastingInterval, 5);
+   out.write(theNorthingInterval, 5);
+   out.write(theEastingReferenceOrigin, 15);
+   out.write(theNorthingReferenceOrigin, 15);
+}
+
+void ossimNitfLocalCartographicTag::clearFields()
+{
+   memset(theLengthUnits, ' ', 3);
+   memset(theEastingInterval, '0', 5);
+   memset(theNorthingInterval, '0', 5);
+   memset(theEastingReferenceOrigin, '0', 15);
+   memset(theNorthingReferenceOrigin, '0', 15);
+
+   theLengthUnits[3]              = '\0';
+   theEastingInterval[5]          = '\0';
+   theNorthingInterval[5]         = '\0';
+   theEastingReferenceOrigin[15]  = '\0';
+   theNorthingReferenceOrigin[15] = '\0';
+}
+
+void ossimNitfLocalCartographicTag::setLengthUnits(const ossimString& units)
+{
+   ossimString temp = ossimString(units).trim().upcase();
+   std::ostringstream out;
+
+   out << std::setw(3)
+       << std::setfill(' ')
+       << temp.c_str();
+   
+   memcpy(theLengthUnits, out.str().c_str(), 3);
+}
+
+void ossimNitfLocalCartographicTag::setEastingInterval(ossim_uint32 eastingInterval)
+{
+   ossim_uint32 temp = eastingInterval;
+
+   if(temp > 99999)
+   {
+      temp = 99999;
+   }
+   
+   std::ostringstream out;
+
+   out << std::setw(5)
+       << std::setfill('0')
+       << temp;
+   
+   memcpy(theEastingInterval, out.str().c_str(), 5);
+}
+
+void ossimNitfLocalCartographicTag::setNorthingInterval(ossim_uint32 northingInterval)
+{
+   ossim_uint32 temp = northingInterval;
+
+   if(temp > 99999)
+   {
+      temp = 99999;
+   }
+   
+   std::ostringstream out;
+
+   out << std::setw(5)
+       << std::setfill('0')
+       << temp;
+   
+   memcpy(theNorthingInterval, out.str().c_str(), 5);
+}
+
+void ossimNitfLocalCartographicTag::setEastingReferenceOrigin(ossim_float64 east)
+{
+   std::ostringstream out;
+
+   out << std::setw(15)
+       << std::setfill(' ')
+       << std::setprecision(1)
+       << std::setiosflags(std::ios::fixed)
+       << east;
+   
+   memcpy(theEastingReferenceOrigin, out.str().c_str(), 15);
+   
+}
+
+void ossimNitfLocalCartographicTag::setNorthingReferenceOrigin(ossim_float64 north)
+{
+   std::ostringstream out;
+
+   out << std::setw(15)
+       << std::setfill(' ')
+       << std::setprecision(1)
+       << std::setiosflags(std::ios::fixed)
+       << north;
+   
+   memcpy(theNorthingReferenceOrigin, out.str().c_str(), 15);
+}
diff --git a/src/support_data/ossimNitfLocalGeographicTag.cpp b/src/support_data/ossimNitfLocalGeographicTag.cpp
new file mode 100644
index 0000000..38d5e84
--- /dev/null
+++ b/src/support_data/ossimNitfLocalGeographicTag.cpp
@@ -0,0 +1,110 @@
+//*******************************************************************
+// Copyright (C) 2004 Intelligence Data Systems. 
+//
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfLocalGeographicTag.cpp 23245 2015-04-08 20:53:04Z rashadkm $
+#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
+#include <iomanip>
+#include <sstream>
+
+RTTI_DEF1(ossimNitfLocalGeographicTag, "ossimNitfLocalGeographicTag", ossimNitfRegisteredTag);
+
+ossimNitfLocalGeographicTag::ossimNitfLocalGeographicTag()
+   : ossimNitfRegisteredTag(std::string("GEOLOB"), 48)
+{
+   clearFields();
+}
+
+ossimNitfLocalGeographicTag::~ossimNitfLocalGeographicTag()
+{
+}
+
+void ossimNitfLocalGeographicTag::parseStream(std::istream& in)
+{
+   in.read(theLonDensity, 9);
+   in.read(theLatDensity, 9);
+   in.read(theLonOrigin, 15);
+   in.read(theLatOrigin, 15);
+}
+
+void ossimNitfLocalGeographicTag::writeStream(std::ostream& out)
+{
+   out.write(theLonDensity, 9);
+   out.write(theLatDensity, 9);
+   out.write(theLonOrigin, 15);
+   out.write(theLatOrigin, 15);
+}
+
+void ossimNitfLocalGeographicTag::clearFields()
+{
+   memset(theLonDensity, ' ', 9);
+   memset(theLatDensity, ' ', 9);
+   memset(theLonOrigin, 0, 15);
+   memset(theLatOrigin, 0, 15);
+
+   
+   
+   theLonDensity[9] = '\0';
+   theLatDensity[9] = '\0';
+   theLonOrigin[15] = '\0';
+   theLatOrigin[14] = '\0';
+}
+
+void ossimNitfLocalGeographicTag::setDegreesPerPixelLat(double deltaLat)
+{
+   ossim_uint32 pixels = 0;
+   if(deltaLat > 0.0)
+   {
+      pixels = (ossim_uint32)((1.0/deltaLat)*360.0 + .5);
+   }
+   std::ostringstream out;
+
+   out << std::setw(9)
+       << std::setfill('0')
+       << pixels;
+
+   memcpy(theLatDensity, out.str().c_str(), 9);
+}
+
+void ossimNitfLocalGeographicTag::setDegreesPerPixelLon(double deltaLon)
+{
+   ossim_uint32 pixels = 0;
+   if(deltaLon > 0.0)
+   {
+      pixels = (ossim_uint32)((1.0/deltaLon)*360.0 + .5);
+   }
+   std::ostringstream out;
+
+   out << std::setw(9)
+       << std::setfill('0')
+       << pixels;
+
+   memcpy(theLonDensity, out.str().c_str(), 9);
+}
+
+void ossimNitfLocalGeographicTag::setLatOrigin(double origin)
+{
+   std::ostringstream out;
+
+   out << std::setw(15)
+       << std::setfill('0')
+       << origin;
+   memcpy(theLatOrigin, out.str().c_str(), 15);
+}
+
+void ossimNitfLocalGeographicTag::setLonOrigin(double origin)
+{
+   std::ostringstream out;
+
+   out << std::setw(15)
+       << std::setfill('0')
+       << origin;
+   memcpy(theLonOrigin, out.str().c_str(), 15);
+}
diff --git a/src/support_data/ossimNitfMstgtaTag.cpp b/src/support_data/ossimNitfMstgtaTag.cpp
new file mode 100644
index 0000000..445e6b0
--- /dev/null
+++ b/src/support_data/ossimNitfMstgtaTag.cpp
@@ -0,0 +1,134 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: MSTGTA Mission Target Information Extension Format
+// tag class definition.
+//
+// See document STDI-0002 Table 8-16 for more info.
+// 
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfMstgtaTag.h>
+
+
+RTTI_DEF1(ossimNitfMstgtaTag, "ossimNitfMstgtaTag", ossimNitfRegisteredTag);
+
+ossimNitfMstgtaTag::ossimNitfMstgtaTag()
+   : ossimNitfRegisteredTag(std::string("MSTGTA"), 101)
+{
+   clearFields();
+}
+
+ossimNitfMstgtaTag::~ossimNitfMstgtaTag()
+{
+}
+
+void ossimNitfMstgtaTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theTgtNum, TGT_NUM_SIZE);
+   in.read(theTgtId, TGT_ID_SIZE);
+   in.read(theTgtBe, TGT_BE_SIZE);
+   in.read(theTgtPri, TGT_PRI_SIZE);
+   in.read(theTgtReq, TGT_REQ_SIZE);
+   in.read(theTgtLtiov, TGT_LTIOV_SIZE);
+   in.read(theTgtType, TGT_TYPE_SIZE);
+   in.read(theTgtColl, TGT_COLL_SIZE);
+   in.read(theTgtCat, TGT_CAT_SIZE);
+   in.read(theTgtUtc, TGT_UTC_SIZE);
+   in.read(theTgtElev, TGT_ELEV_SIZE);
+   in.read(theTgtElevUnit, TGT_ELEV_UNIT_SIZE);
+   in.read(theTgtLoc, TGT_LOC_SIZE);
+}
+
+void ossimNitfMstgtaTag::writeStream(std::ostream& out)
+{
+   out.write(theTgtNum, TGT_NUM_SIZE);
+   out.write(theTgtId, TGT_ID_SIZE);
+   out.write(theTgtBe, TGT_BE_SIZE);
+   out.write(theTgtPri, TGT_PRI_SIZE);
+   out.write(theTgtReq, TGT_REQ_SIZE);
+   out.write(theTgtLtiov, TGT_LTIOV_SIZE);
+   out.write(theTgtType, TGT_TYPE_SIZE);
+   out.write(theTgtColl, TGT_COLL_SIZE);
+   out.write(theTgtCat, TGT_CAT_SIZE);
+   out.write(theTgtUtc, TGT_UTC_SIZE);
+   out.write(theTgtElev, TGT_ELEV_SIZE);
+   out.write(theTgtElevUnit, TGT_ELEV_UNIT_SIZE);
+   out.write(theTgtLoc, TGT_LOC_SIZE);
+}
+
+void ossimNitfMstgtaTag::clearFields()
+{
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+
+   // clear
+   memset(theTgtNum, '0', TGT_NUM_SIZE);
+   memset(theTgtId, ' ', TGT_ID_SIZE);
+   memset(theTgtBe, ' ', TGT_BE_SIZE);
+   memset(theTgtPri, ' ', TGT_PRI_SIZE);
+   memset(theTgtReq, ' ', TGT_REQ_SIZE);
+   memset(theTgtLtiov, ' ', TGT_LTIOV_SIZE);
+   memset(theTgtType, ' ', TGT_TYPE_SIZE);
+   memset(theTgtColl, '0', TGT_COLL_SIZE);
+   memset(theTgtCat, ' ', TGT_CAT_SIZE);
+   memset(theTgtUtc, ' ', TGT_UTC_SIZE);
+   memset(theTgtElev, ' ', TGT_ELEV_SIZE);
+   memset(theTgtElevUnit, ' ', TGT_ELEV_UNIT_SIZE);
+   memset(theTgtLoc, ' ', TGT_LOC_SIZE);
+
+   // null terminate
+   theTgtNum[TGT_NUM_SIZE] = '\0';
+   theTgtId[TGT_ID_SIZE] = '\0';
+   theTgtBe[TGT_BE_SIZE] = '\0';
+   theTgtPri[TGT_PRI_SIZE] = '\0';
+   theTgtReq[TGT_REQ_SIZE] = '\0';
+   theTgtLtiov[TGT_LTIOV_SIZE] = '\0';
+   theTgtType[TGT_TYPE_SIZE] = '\0';
+   theTgtColl[TGT_COLL_SIZE] = '\0';
+   theTgtCat[TGT_CAT_SIZE] = '\0';
+   theTgtUtc[TGT_UTC_SIZE] = '\0';
+   theTgtElev[TGT_ELEV_SIZE] = '\0';
+   theTgtElevUnit[TGT_ELEV_UNIT_SIZE] = '\0';
+   theTgtLoc[TGT_LOC_SIZE] = '\0';
+}
+
+std::ostream& ossimNitfMstgtaTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "TGT_NUM:" << theTgtNum << "\n"
+       << pfx << std::setw(24) << "TGT_ID:" << theTgtId << "\n"
+       << pfx << std::setw(24) << "TGT_BE:" << theTgtBe << "\n"
+       << pfx << std::setw(24) << "TGT_PRI:" << theTgtPri << "\n"
+       << pfx << std::setw(24) << "TGT_REQ:" << theTgtReq << "\n"
+       << pfx << std::setw(24) << "TGT_LTIOV:" << theTgtLtiov << "\n"
+       << pfx << std::setw(24) << "TGT_TYPE:" << theTgtType << "\n"
+       << pfx << std::setw(24) << "TGT_COLL:" << theTgtColl << "\n"
+       << pfx << std::setw(24) << "TGT_CAT:" << theTgtCat << "\n"
+       << pfx << std::setw(24) << "TGT_UTC:" << theTgtUtc << "\n"
+       << pfx << std::setw(24) << "TGT_ELEV:" << theTgtElev << "\n"
+       << pfx << std::setw(24) << "TGT_ELEV_UNIT:" << theTgtElevUnit << "\n"
+       << pfx << std::setw(24) << "TGT_LOC:" << theTgtLoc << "\n";
+   
+   return out;
+}
diff --git a/src/support_data/ossimNitfNameConversionTables.cpp b/src/support_data/ossimNitfNameConversionTables.cpp
new file mode 100644
index 0000000..d741fda
--- /dev/null
+++ b/src/support_data/ossimNitfNameConversionTables.cpp
@@ -0,0 +1,163 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Garrett Potts
+//
+//*******************************************************************
+//  $Id: ossimNitfNameConversionTables.cpp 13219 2008-07-23 19:27:49Z dburken $
+
+#include <cstddef>
+#include <ossim/support_data/ossimNitfNameConversionTables.h>
+#include <ossim/base/ossimString.h>
+
+struct ossimNitfMapProjectionCodeToOssimName
+{
+   const char* nitfProjCode; // nitf code name
+   const char* projectionName; // ossim projection name
+};
+
+struct ossimNitfMapProjectionCodeToNitfName
+{
+   const char* nitfProjCode; // nitf code name
+   const char* projectionName; // ossim projection name
+};
+
+static const ossimNitfMapProjectionCodeToOssimName mapProjectiontable[]=
+{
+   {"AC", "ossimAlbersProjection"},
+   {"AL", "ossimAzimEquDistProjection"},
+   {"BF", "ossimBonneProjection"},
+   {"CP", "ossimEquDistCylProjection"},
+   {"CP", "ossimLlxyProjection"},
+   {"CS", "ossimCassiniProjection"},
+   {"ED", "ossimEckert6Projection"},
+   {"EF", "ossimEckert4Projection"},
+   {"GN", "ossimGnomonicProjection"},
+   {"LE", "ossimLambertConformalConicProjection"},
+   {"LI", "ossimCylEquAreaProjection"},
+   {"MC", "ossimMercatorProjection"},
+   {"MH", "ossimMillerProjection"},
+   {"MP", "ossimMollweidProjection"},
+   {"NT", "ossimNewZealandMapGridProjection"},
+   {"OD", "ossimOrthoGraphicProjection"},
+   {"PG", "ossimPolarStereoProjection"},
+   {"PH", "ossimPolyconicProjection"},
+   {"SA", "ossimSinusoidalProjection"},
+   {"SX", "ossimSpaceObliqueMercatorProjection"},
+   {"TC", "ossimTransMercatorProjection"},
+   {"TX", "ossimTransCylEquAreaProjection"},
+   {"VA", "ossimVanDerGrintenProjection"},
+   { 0, 0 }
+};
+
+static const ossimNitfMapProjectionCodeToNitfName nitfMapProjectiontable[]=
+{
+   {"AC", "Albers Equal-Area Conic"},
+   {"AK", "(Lambert) Azimuthal Equal-Area"},
+   {"AL", "Azimuthal Equidistant"},
+   {"BF", "Bonne"},
+   {"CC", "Equidistant Conic with 1 Standard Parallel"},
+   {"CP", "Equirectangular"},
+   {"CS", "Cassini-Soldner"},
+   {"ED", "Eckert VI"},
+   {"EF", "Eckert IV"},
+   {"GN", "Gnomonic"},
+   {"HX", "Hotine Oblique Mercator based on 2 Points"},
+   {"KA", " Equidistant Conic with 2 Standard Parallels"},
+   {"LA", "Laborde"},
+   {"LE", "Lambert Conformal Conic"},
+   {"LI", "Cylindrical Equal Area"},
+   {"LJ", " Lambert Equal-Area Meridional"},
+   {"MC", "Mercator"},
+   {"MH", "Miller Cylindrical"},
+   {"MJ", "French Lambert"},
+   {"MP", "Mollweide"},
+   {"NT", "New Zealand Map Grid"},
+   {"OC", "Oblique Mercator"},
+   {"OD", "Orthographic"},
+   {"PG", "Polar Stereographic"},
+   {"PH", "Polyconic"},
+   {"RS", "Hotine Oblique Mercator (Rectified Skew Orthomorphic)"},
+   {"RB", "Hotine Oblique Mercator (Rectified Skew Orthomorphic)"},
+   {"RX", "Robinson"},
+   {"SA", "Sinusoidal"},
+   {"SD", "Oblique Stereographic"},
+   {"SX", "Space Oblique Mercator"},
+   {"TC", " Transverse Mercator"},
+   {"TX", "Transverse Cylindrical Equal Area"},
+   {"VA", "Van der Grinten"},
+   {"VX", "General Vertical NearSide Perspective"},
+   { 0, 0 }
+};
+
+ossimNitfNameConversionTables::ossimNitfNameConversionTables()
+{
+}
+
+ossimString ossimNitfNameConversionTables::convertMapProjectionNameToNitfCode(const ossimString& mapProjectionName)const
+{
+   ossim_uint32 idx = 0;
+
+   while(mapProjectiontable[idx].nitfProjCode)
+   {
+      if(mapProjectionName == mapProjectiontable[idx].projectionName)
+      {
+         return mapProjectiontable[idx].nitfProjCode;
+      }
+      ++idx;
+   }
+
+   return "";
+}
+
+ossimString ossimNitfNameConversionTables::convertNitfCodeToOssimProjectionName(const ossimString& nitfProjectionCode)const
+{
+   ossim_uint32 idx = 0;
+
+   while(mapProjectiontable[idx].nitfProjCode)
+   {
+      if(nitfProjectionCode == mapProjectiontable[idx].nitfProjCode)
+      {
+         return mapProjectiontable[idx].projectionName;
+      }
+      ++idx;
+   }
+
+   return "";
+}
+
+ossimString ossimNitfNameConversionTables::convertNitfCodeToNitfProjectionName(const ossimString& nitfProjectionCode)const
+{
+   ossim_uint32 idx = 0;
+
+   while(nitfMapProjectiontable[idx].nitfProjCode)
+   {
+      if(nitfProjectionCode == nitfMapProjectiontable[idx].nitfProjCode)
+      {
+         return nitfMapProjectiontable[idx].projectionName;
+      }
+      ++idx;
+   }
+
+   return "";
+}
+
+ossimString ossimNitfNameConversionTables::convertNitfProjectionNameToNitfCode(const ossimString& nitfProjectionName)const
+{
+   ossim_uint32 idx = 0;
+
+   while(nitfMapProjectiontable[idx].nitfProjCode)
+   {
+      if(nitfProjectionName ==  nitfMapProjectiontable[idx].projectionName)
+      {
+         return nitfMapProjectiontable[idx].nitfProjCode;
+      }
+      ++idx;
+   }
+
+   return "";
+}
diff --git a/src/support_data/ossimNitfPiaimcTag.cpp b/src/support_data/ossimNitfPiaimcTag.cpp
new file mode 100644
index 0000000..f2a10f9
--- /dev/null
+++ b/src/support_data/ossimNitfPiaimcTag.cpp
@@ -0,0 +1,411 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: PIAIMC tag class declaration.
+// 
+// "Profile for Imagery Access Image Support Extensions"
+//
+// See document STDI-0002 Table 6-1 for more info.
+// 
+// http://164.214.2.51/ntb/baseline/docs/stdi0002/final.pdf
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfPiaimcTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <cstring> /* for memcpy */
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfPiaimcTag.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimCommon.h>
+
+static const ossimString CLOUDCVR_KW = "CLOUDCVR";
+static const ossimString SRP_KW = "SRP";
+static const ossimString SENSMODE_KW = "SENSMODE";
+static const ossimString SENSNAME_KW = "SENSNAME";
+static const ossimString SOURCE_KW = "SOURCE";
+static const ossimString COMGEN_KW = "COMGEN";
+static const ossimString SUBQUAL_KW = "SUBQUAL";
+static const ossimString PIAMSNNUM_KW = "PIAMSNNUM";
+static const ossimString CAMSPECS_KW = "CAMSPECS";
+static const ossimString PROJID_KW = "PROJID";
+static const ossimString GENERATION_KW = "GENERATION";
+static const ossimString ESD_KW = "ESD";
+static const ossimString OTHERCOND_KW = "OTHERCOND";
+static const ossimString MEANGSD_KW = "MEANGSD";
+static const ossimString IDATUM_KW = "IDATUM";
+static const ossimString IELLIP_KW = "IELLIP";
+static const ossimString PREPROC_KW = "PREPROC";
+static const ossimString IPROJ_KW = "IPROJ";
+static const ossimString SATTRACK_KW = "SATTRACK";
+
+RTTI_DEF1(ossimNitfPiaimcTag,
+          "ossimNitfPiaimcTag",
+          ossimNitfRegisteredTag);
+
+ossimNitfPiaimcTag::ossimNitfPiaimcTag()
+   : ossimNitfRegisteredTag(std::string("PIAIMC"), 362)
+{
+   clearFields();
+}
+
+void ossimNitfPiaimcTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theCloudcvr,   CLOUDCVR_SIZE);
+   in.read(theSrp,        SRP_SIZE);
+   in.read(thesSensmode,  SENSMODE_SIZE);
+   in.read(theSensname,   SENSNAME_SIZE);
+   in.read(theSource,     SOURCE_SIZE);
+   in.read(theComgen,     COMGEN_SIZE);
+   in.read(theSubqual,    SUBQUAL_SIZE);
+   in.read(thePiamsnnum,  PIAMSNNUM_SIZE);
+   in.read(theCamspecs,   CAMSPECS_SIZE);
+   in.read(theProjid,     PROJID_SIZE);
+   in.read(theGeneration, GENERATION_SIZE);
+   in.read(theEsd,        ESD_SIZE);
+   in.read(theOthercond,  OTHERCOND_SIZE);
+   in.read(theMeanGsd,    MEANGSD_SIZE);
+   in.read(theIdatum,     IDATUM_SIZE);
+   in.read(theIellip,     IELLIP_SIZE);
+   in.read(thePreproc,    PREPROC_SIZE);
+   in.read(theIproj,      IPROJ_SIZE);
+   in.read(theSattrack,   SATTRACK_SIZE);
+}
+
+void ossimNitfPiaimcTag::writeStream(std::ostream& out)
+{
+   out.write(theCloudcvr,   CLOUDCVR_SIZE);
+   out.write(theSrp,        SRP_SIZE);
+   out.write(thesSensmode,  SENSMODE_SIZE);
+   out.write(theSensname,   SENSNAME_SIZE);
+   out.write(theSource,     SOURCE_SIZE);
+   out.write(theComgen,     COMGEN_SIZE);
+   out.write(theSubqual,    SUBQUAL_SIZE);
+   out.write(thePiamsnnum,  PIAMSNNUM_SIZE);
+   out.write(theCamspecs,   CAMSPECS_SIZE);
+   out.write(theProjid,     PROJID_SIZE);
+   out.write(theGeneration, GENERATION_SIZE);
+   out.write(theEsd,        ESD_SIZE);
+   out.write(theOthercond,  OTHERCOND_SIZE);
+   out.write(theMeanGsd,    MEANGSD_SIZE);
+   out.write(theIdatum,     IDATUM_SIZE);
+   out.write(theIellip,     IELLIP_SIZE);
+   out.write(thePreproc,    PREPROC_SIZE);
+   out.write(theIproj,      IPROJ_SIZE);
+   out.write(theSattrack,   SATTRACK_SIZE);
+}
+
+void ossimNitfPiaimcTag::clearFields()
+{
+   memcpy(theCloudcvr, "999",   CLOUDCVR_SIZE);
+   memset(theSrp,        ' ',        SRP_SIZE);
+   memset(thesSensmode,  ' ',  SENSMODE_SIZE);
+   memset(theSensname,   ' ',   SENSNAME_SIZE);
+   memset(theSource,     ' ',     SOURCE_SIZE);
+   memset(theComgen,     ' ',     COMGEN_SIZE);
+   memset(theSubqual,    ' ',    SUBQUAL_SIZE);
+   memset(thePiamsnnum,  ' ',  PIAMSNNUM_SIZE);
+   memset(theCamspecs,   ' ',   CAMSPECS_SIZE);
+   memset(theProjid,     ' ',     PROJID_SIZE);
+   memset(theGeneration, ' ', GENERATION_SIZE);
+   memset(theEsd,        ' ',        ESD_SIZE);
+   memset(theOthercond,  ' ',  OTHERCOND_SIZE);
+   memset(theMeanGsd,    ' ',    MEANGSD_SIZE);
+   memset(theIdatum,     ' ',     IDATUM_SIZE);
+   memset(theIellip,     ' ',     IELLIP_SIZE);
+   memset(thePreproc,    ' ',    PREPROC_SIZE);
+   memset(theIproj,      ' ',     IPROJ_SIZE);
+   memset(theSattrack,   ' ',   SATTRACK_SIZE);
+
+   theCloudcvr[CLOUDCVR_SIZE]     = '\0';
+   theSrp[SRP_SIZE]               = '\0';
+   thesSensmode[SENSMODE_SIZE]    = '\0';
+   theSensname[SENSNAME_SIZE]     = '\0';
+   theSource[SOURCE_SIZE]         = '\0';
+   theComgen[COMGEN_SIZE]         = '\0';
+   theSubqual[SUBQUAL_SIZE]       = '\0';
+   thePiamsnnum[PIAMSNNUM_SIZE]   = '\0';
+   theCamspecs[CAMSPECS_SIZE]     = '\0';
+   theProjid[PROJID_SIZE]         = '\0';
+   theGeneration[GENERATION_SIZE] = '\0';
+   theEsd[ESD_SIZE]               = '\0';
+   theOthercond[OTHERCOND_SIZE]   = '\0';
+   theMeanGsd[MEANGSD_SIZE]       = '\0';
+   theIdatum[IDATUM_SIZE]         = '\0';
+   theIellip[IELLIP_SIZE]         = '\0';
+   thePreproc[PREPROC_SIZE]       = '\0';
+   theIproj[IPROJ_SIZE]           = '\0';
+   theSattrack[SATTRACK_SIZE]     = '\0';
+}
+
+std::ostream& ossimNitfPiaimcTag::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "CLOUDCVR:"  << theCloudcvr << "\n"
+       << pfx << std::setw(24) << "SRP:"       << theSrp << "\n"
+       << pfx << std::setw(24) << "SENSMODE:"   << thesSensmode << "\n"
+       << pfx << std::setw(24) << "SENSNAME:"   << theSensname << "\n"
+       << pfx << std::setw(24) << "SOURCE:"     << theSource << "\n"
+       << pfx << std::setw(24) << "COMGEN:"     << theComgen << "\n"
+       << pfx << std::setw(24) << "SUBQUAL:"    << theSubqual << "\n"
+       << pfx << std::setw(24) << "PIAMSNNUM:"  << thePiamsnnum << "\n"
+       << pfx << std::setw(24) << "CAMSPECS:"   << theCamspecs << "\n"
+       << pfx << std::setw(24) << "PROJID:"     << theProjid << "\n"
+       << pfx << std::setw(24) << "GENERATION:" << theGeneration << "\n"
+       << pfx << std::setw(24) << "ESD:"        << theEsd << "\n"
+       << pfx << std::setw(24) << "OTHERCOND:"  << theOthercond << "\n"
+       << pfx << std::setw(24) << "MEANGSD:"    << theMeanGsd << "\n"
+       << pfx << std::setw(24) << "IDATUM:"     << theIdatum << "\n"
+       << pfx << std::setw(24) << "IELLIP:"     << theIellip << "\n"
+       << pfx << std::setw(24) << "PREPROC:"    << thePreproc << "\n"
+       << pfx << std::setw(24) << "IPROJ:"     << theIproj << "\n"
+       << pfx << std::setw(24) << "SATTRACK:"  << theSattrack << "\n";
+
+   return out;
+}
+
+ossimString ossimNitfPiaimcTag::getCloudcvrString() const
+{
+   return ossimString(theCloudcvr);
+}
+
+ossimString ossimNitfPiaimcTag::getSrpString() const
+{
+   return ossimString(theSrp);
+}
+   
+ossimString ossimNitfPiaimcTag::getSensmodeString() const
+{
+   return ossimString(thesSensmode);
+}
+
+ossimString ossimNitfPiaimcTag::getSensnameString() const
+{
+   return ossimString(theSensname);
+}
+   
+ossimString ossimNitfPiaimcTag::getSourceString() const
+{
+   return ossimString(theSource);
+}
+  
+ossimString ossimNitfPiaimcTag::getComgenString() const
+{
+   return ossimString(theComgen);
+}
+
+ossimString ossimNitfPiaimcTag::getSubqualString() const
+{
+   return ossimString(theSubqual);
+}
+
+ossimString ossimNitfPiaimcTag::getPiamsnnumString() const
+{
+   return ossimString(thePiamsnnum);
+}
+
+ossimString ossimNitfPiaimcTag::getCamspecsString() const
+{
+   return ossimString(theCamspecs);
+}
+
+ossimString ossimNitfPiaimcTag::getProjidString() const
+{
+   return ossimString(theProjid);
+}
+
+ossimString ossimNitfPiaimcTag::getGenerationString() const
+{
+   return ossimString(theGeneration);
+}
+
+ossimString ossimNitfPiaimcTag::getEsdString() const
+{
+   return ossimString(theEsd);
+}
+   
+ossimString ossimNitfPiaimcTag::getOthercondString() const
+{
+   return ossimString(theOthercond);
+}
+
+ossimString ossimNitfPiaimcTag::getMeadGsdString() const
+{
+   return ossimString(theMeanGsd);
+}
+
+ossim_float64 ossimNitfPiaimcTag::getMeanGsdInMeters() const
+{
+   ossim_float64 gsd = 0.0;
+   
+   ossimString s = theMeanGsd;
+   if (s.size())
+   {
+      ossim_float64 d = s.toFloat64();
+      if ( (d != 0.0) && (ossim::isnan(d) == false) )
+      {
+         gsd = d / 12.0 * MTRS_PER_FT;
+      }
+   }
+   
+   return gsd;
+}
+
+ossimString ossimNitfPiaimcTag::getIdatumString() const
+{
+   return ossimString(theIdatum);
+}
+   
+ossimString ossimNitfPiaimcTag::getIellipString() const
+{
+   return ossimString(theIellip);
+}
+   
+ossimString ossimNitfPiaimcTag::getPreprocString() const
+{
+   return ossimString(thePreproc);
+}
+   
+ossimString ossimNitfPiaimcTag::getIprojString() const
+{
+   return ossimString(theIproj);
+}
+   
+ossimString ossimNitfPiaimcTag::getSattrackString() const
+{
+   return ossimString(theSattrack);
+}
+
+void ossimNitfPiaimcTag::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimNitfRegisteredTag::setProperty(property);
+}
+
+ossimRefPtr<ossimProperty> ossimNitfPiaimcTag::getProperty(const ossimString& name)const
+{
+   ossimProperty* result = 0;
+
+   if(name == CLOUDCVR_KW)
+   {
+      result = new ossimStringProperty(name, theCloudcvr);
+   }
+   else if(name == SRP_KW)
+   {
+      result = new ossimStringProperty(name, theSrp);
+   }
+   else if(name == SENSMODE_KW)
+   {
+      result = new ossimStringProperty(name, thesSensmode);
+   }
+   else if(name == SENSNAME_KW)
+   {
+      result = new ossimStringProperty(name, theSensname);
+   }
+   else if(name == SOURCE_KW)
+   {
+      result = new ossimStringProperty(name, theSource);
+   }
+   else if(name == COMGEN_KW)
+   {
+      result = new ossimStringProperty(name, theComgen);
+   }
+   else if(name == SUBQUAL_KW)
+   {
+      result = new ossimStringProperty(name, theSubqual);
+   }
+   else if(name == PIAMSNNUM_KW)
+   {
+      result = new ossimStringProperty(name, thePiamsnnum);
+   }
+   else if(name == CAMSPECS_KW)
+   {
+      result = new ossimStringProperty(name, theCamspecs);
+   }
+   else if(name == PROJID_KW)
+   {
+      result = new ossimStringProperty(name, theProjid);
+   }
+   else if(name == GENERATION_KW)
+   {
+      result = new ossimStringProperty(name, theGeneration);
+   }
+   else if(name == ESD_KW)
+   {
+      result = new ossimStringProperty(name, theEsd);
+   }
+   else if(name == OTHERCOND_KW)
+   {
+      result = new ossimStringProperty(name, theOthercond);
+   }
+   else if(name == MEANGSD_KW)
+   {
+      result = new ossimStringProperty(name, theMeanGsd);
+   }
+   else if(name == IDATUM_KW)
+   {
+      result = new ossimStringProperty(name, theIdatum);
+   }
+   else if(name == IELLIP_KW)
+   {
+      result = new ossimStringProperty(name, theIellip);
+   }
+   else if(name == PREPROC_KW)
+   {
+      result = new ossimStringProperty(name, thePreproc);
+   }
+   else if(name == IPROJ_KW)
+   {
+      result = new ossimStringProperty(name, theIproj);
+   }
+   else if(name == SATTRACK_KW)
+   {
+      result = new ossimStringProperty(name, theSattrack);
+   }
+   else
+   {
+      return ossimNitfRegisteredTag::getProperty(name);
+   }
+
+   return result;
+}
+
+void ossimNitfPiaimcTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
+   
+   propertyNames.push_back(CLOUDCVR_KW);
+   propertyNames.push_back(SRP_KW);
+   propertyNames.push_back(SENSMODE_KW);
+   propertyNames.push_back(SENSNAME_KW);
+   propertyNames.push_back(SOURCE_KW);
+   propertyNames.push_back(COMGEN_KW);
+   propertyNames.push_back(SUBQUAL_KW);
+   propertyNames.push_back(PIAMSNNUM_KW);
+   propertyNames.push_back(CAMSPECS_KW);
+   propertyNames.push_back(PROJID_KW);
+   propertyNames.push_back(GENERATION_KW);
+   propertyNames.push_back(ESD_KW);
+   propertyNames.push_back(OTHERCOND_KW);
+   propertyNames.push_back(MEANGSD_KW);
+   propertyNames.push_back(IDATUM_KW);
+   propertyNames.push_back(IELLIP_KW);
+   propertyNames.push_back(PREPROC_KW);
+   propertyNames.push_back(IPROJ_KW);
+   propertyNames.push_back(SATTRACK_KW);
+}
diff --git a/src/support_data/ossimNitfProjectionParameterTag.cpp b/src/support_data/ossimNitfProjectionParameterTag.cpp
new file mode 100644
index 0000000..7831558
--- /dev/null
+++ b/src/support_data/ossimNitfProjectionParameterTag.cpp
@@ -0,0 +1,212 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfProjectionParameterTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
+#include <sstream>
+#include <iomanip>
+
+ossimNitfProjectionParameterTag::ossimNitfProjectionParameterTag()
+   :ossimNitfRegisteredTag(std::string("PRJPSB"), 0 )
+{
+   clearFields();
+}
+
+ossimNitfProjectionParameterTag::~ossimNitfProjectionParameterTag()
+{
+}
+
+void ossimNitfProjectionParameterTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theProjectionName, 80);
+   in.read(theProjectionCode, 2);
+   in.read(theNumberOfParameters, 1);
+
+   ossim_uint32 numberOfParameters = ossimString(theNumberOfParameters).toUInt32();
+
+   for(ossim_uint32 i = 0; i < numberOfParameters; ++i)
+   {
+      char param[15];
+
+      in.read(param, 15);
+      theProjectionParameters.push_back(ossimString(param,
+                                                    param + 15));
+   }
+   in.read(theFalseXOrigin, 15);
+   in.read(theFalseYOrigin, 15);
+
+   // Set the base tag length.
+   setTagLength( getSizeInBytes() );
+}
+
+void ossimNitfProjectionParameterTag::writeStream(std::ostream& out)
+{
+   out.write(theProjectionName, 80);
+   out.write(theProjectionCode, 2);
+
+   {
+      std::ostringstream tempOut;
+
+      tempOut << std::setw(1)
+              << theProjectionParameters.size();
+      theNumberOfParameters[0] = *(tempOut.str().c_str());
+   }
+   out.write(theNumberOfParameters, 1);
+   ossim_uint32 numberOfParameters = ossimString(theNumberOfParameters).toUInt32();
+
+   for(ossim_uint32 i = 0; i < numberOfParameters; ++i)
+   {
+      out.write(theProjectionParameters[i].c_str(), 15);
+   }
+   out.write(theFalseXOrigin, 15);
+   out.write(theFalseYOrigin, 15);
+}
+
+ossim_uint32 ossimNitfProjectionParameterTag::getSizeInBytes()const
+{
+   return (113 + (ossim_uint32)theProjectionParameters.size()*15);
+}
+
+std::ostream& ossimNitfProjectionParameterTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getRegisterTagName();
+   pfx += ".";
+
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:" << getRegisterTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "PRN:"   << theProjectionName << "\n"
+       << pfx << std::setw(24) << "PCO:"   << theProjectionCode << "\n"
+       << pfx << std::setw(24) << "NUM_PRJ:" << theNumberOfParameters << "\n";
+
+   for (ossim_uint32 i = 0; i < theProjectionParameters.size(); ++i)
+   {
+      ossimString s = "PRJ";
+      s += ossimString::toString(i);
+      s += ":";
+      out << pfx << std::setw(24) << s
+          << theProjectionParameters[i] << "\n";
+   }
+
+   out << pfx << std::setw(24) << "XOR:"   <<theFalseXOrigin << "\n"
+       << pfx << std::setw(24) << "YOR:"   <<theFalseYOrigin << std::endl;
+   
+   return out;   
+}
+    
+void ossimNitfProjectionParameterTag::clearFields()
+{
+   theProjectionParameters.clear();
+   
+   memset(theProjectionName, ' ', 80);
+   memset(theProjectionCode, ' ', 2);
+   memset(theNumberOfParameters, '0', 1);
+   memset(theFalseXOrigin, '0', 15);
+   memset(theFalseYOrigin, '0', 15);
+
+   theProjectionName[80] = '\0';
+   theProjectionCode[2] = '\0';
+   theNumberOfParameters[1] = '\0';
+   theFalseXOrigin[15] = '\0';
+   theFalseYOrigin[15] = '\0';
+
+   // Set the base tag length.
+   setTagLength( 0 );
+}
+
+void ossimNitfProjectionParameterTag::clearParameters()
+{
+   theProjectionParameters.clear();
+   theNumberOfParameters[0] = '0';
+}
+
+void ossimNitfProjectionParameterTag::addParameter(const ossimString& param)
+{
+   std::ostringstream out;
+
+   out << std::setw(15)
+       << std::setfill('0')
+       << param.c_str();
+
+   theProjectionParameters.push_back(out.str());
+}
+
+void ossimNitfProjectionParameterTag::addParameter(const ossim_float64& param)
+{
+   addParameter(ossimString::toString(param));
+}
+
+void ossimNitfProjectionParameterTag::setName(const ossimString& name)
+{
+   std::ostringstream out;
+
+   out << std::setw(80)
+       << std::setfill(' ')
+       << name.c_str();
+
+   memcpy(theProjectionName, out.str().c_str(), 80);
+}
+
+void ossimNitfProjectionParameterTag::setCode(const ossimString& code)
+{
+   std::ostringstream out;
+
+   out << std::setw(2)
+       << std::setfill(' ')
+       << code.c_str();
+
+   memcpy(theProjectionCode, out.str().c_str(), 2);
+}
+
+ossimString ossimNitfProjectionParameterTag::getName()const
+{
+   return ossimString(theProjectionName).trim();
+}
+
+ossimString ossimNitfProjectionParameterTag::getCode()const
+{
+   return ossimString(theProjectionCode).trim();
+}
+
+void ossimNitfProjectionParameterTag::setFalseX(double falseX)
+{
+   std::ostringstream out;
+   out << std::setw(15)
+       << std::setprecision(15)
+       << std::setfill('0')
+       << falseX;
+   
+   memcpy(theFalseXOrigin, out.str().c_str(), 15);
+}
+
+void ossimNitfProjectionParameterTag::setFalseY(double falseY)
+{
+   std::ostringstream out;
+   out << std::setw(15)
+       << std::setprecision(15)
+       << std::setfill('0')
+       << falseY;
+   
+   memcpy(theFalseYOrigin, out.str().c_str(), 15);
+}
+
+double ossimNitfProjectionParameterTag::getFalseX()const
+{
+   return ossimString(theFalseXOrigin).toDouble();
+}
+
+double ossimNitfProjectionParameterTag::getFalseY()const
+{
+   return ossimString(theFalseYOrigin).toDouble();
+}
diff --git a/src/support_data/ossimNitfRegisteredDes.cpp b/src/support_data/ossimNitfRegisteredDes.cpp
new file mode 100644
index 0000000..b19391a
--- /dev/null
+++ b/src/support_data/ossimNitfRegisteredDes.cpp
@@ -0,0 +1,116 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRegisteredDes.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <sstream>
+#include <ossim/support_data/ossimNitfRegisteredDes.h>
+
+RTTI_DEF2(ossimNitfRegisteredDes, "ossimNitfRegisteredDes", ossimObject, ossimPropertyInterface)
+
+ossimNitfRegisteredDes::ossimNitfRegisteredDes()
+   : 
+   ossimObject(),
+   ossimPropertyInterface(),
+   m_desName(),
+   m_desLength(0)
+{}
+ossimNitfRegisteredDes::ossimNitfRegisteredDes(const std::string& desName, ossim_uint32 desLength)
+   : 
+   ossimObject(),
+   ossimPropertyInterface(),
+   m_desName(desName),
+   m_desLength(desLength)
+{}
+
+ossimNitfRegisteredDes::~ossimNitfRegisteredDes()
+{}
+
+std::string ossimNitfRegisteredDes::getRegisterDesName() const
+{
+   // Deprecated:
+   return m_desName;
+}
+
+const std::string& ossimNitfRegisteredDes::getDesName() const
+{
+   return m_desName;
+}
+
+void ossimNitfRegisteredDes::setDesName(const std::string& desName)
+{
+   m_desName = desName;
+}
+
+ossim_uint32 ossimNitfRegisteredDes::getSizeInBytes() const
+{
+   // Deprecated:
+   return getDesLength();
+}
+
+ossim_uint32 ossimNitfRegisteredDes::getDesLength() const
+{
+   return m_desLength;
+}
+
+void ossimNitfRegisteredDes::setDesLength(ossim_uint32 length)
+{
+   m_desLength = length;
+}
+
+void ossimNitfRegisteredDes::setProperty(ossimRefPtr<ossimProperty> /* property */)
+{
+}
+
+ossimRefPtr<ossimProperty> ossimNitfRegisteredDes::getProperty(const ossimString& /* name */)const
+{
+   return 0;
+}
+
+void ossimNitfRegisteredDes::getPropertyNames(std::vector<ossimString>& /* propertyNames */)const
+{
+}
+
+void ossimNitfRegisteredDes::getMetadata(ossimKeywordlist& /* kwl */,
+                                         const char* /* prefix */ ) const
+{
+}
+
+std::ostream& ossimNitfRegisteredDes::print(
+   std::ostream& out, const std::string& /* prefix */) const
+{
+   // return print(out);
+   return out;
+}
+
+bool ossimNitfRegisteredDes::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = false;
+   // by default we will use the already implemented print method as backup
+   //
+   std::ostringstream out;
+   
+   print(out);
+   
+   ossimKeywordlist kwlTemp;
+   
+   std::istringstream in(out.str());
+   if(kwlTemp.parseStream(in))
+   {
+      result = true;
+      kwl.add(prefix, kwlTemp);
+   }
+   
+   return result;
+}
diff --git a/src/support_data/ossimNitfRegisteredDesFactory.cpp b/src/support_data/ossimNitfRegisteredDesFactory.cpp
new file mode 100644
index 0000000..32c4514
--- /dev/null
+++ b/src/support_data/ossimNitfRegisteredDesFactory.cpp
@@ -0,0 +1,46 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRegisteredDesFactory.cpp 23113 2015-01-28 17:04:17Z gpotts $
+
+#include <ossim/support_data/ossimNitfRegisteredDesFactory.h>
+
+#include <ossim/support_data/ossimNitfXmlDataContentDes.h>
+
+RTTI_DEF1(ossimNitfRegisteredDesFactory, "ossimNitfRegisteredDesFactory", ossimNitfDesFactory);
+
+static const char XML_DATA_CONTENT_DES[]                = "XML_DATA_CONTENT";
+
+ossimNitfRegisteredDesFactory::ossimNitfRegisteredDesFactory()
+{
+}
+
+ossimNitfRegisteredDesFactory::~ossimNitfRegisteredDesFactory()
+{
+}
+
+ossimNitfRegisteredDesFactory* ossimNitfRegisteredDesFactory::instance()
+{
+   static ossimNitfRegisteredDesFactory inst;
+   return &inst;
+}
+
+ossimRefPtr<ossimNitfRegisteredDes> ossimNitfRegisteredDesFactory::create(
+   const ossimString& desName)const
+{
+   ossimString name = ossimString(desName).trim().upcase();
+   
+   if(desName == XML_DATA_CONTENT_DES)
+   {
+      return new ossimNitfXmlDataContentDes;
+   }
+   return NULL;
+}
diff --git a/src/support_data/ossimNitfRegisteredTag.cpp b/src/support_data/ossimNitfRegisteredTag.cpp
new file mode 100644
index 0000000..c3ae575
--- /dev/null
+++ b/src/support_data/ossimNitfRegisteredTag.cpp
@@ -0,0 +1,116 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRegisteredTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <sstream>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+
+RTTI_DEF2(ossimNitfRegisteredTag, "ossimNitfRegisteredTag", ossimObject, ossimPropertyInterface)
+
+ossimNitfRegisteredTag::ossimNitfRegisteredTag()
+   : 
+   ossimObject(),
+   ossimPropertyInterface(),
+   m_tagName(),
+   m_tagLength(0)
+{}
+ossimNitfRegisteredTag::ossimNitfRegisteredTag(const std::string& tagName, ossim_uint32 tagLength)
+   : 
+   ossimObject(),
+   ossimPropertyInterface(),
+   m_tagName(tagName),
+   m_tagLength(tagLength)
+{}
+
+ossimNitfRegisteredTag::~ossimNitfRegisteredTag()
+{}
+
+std::string ossimNitfRegisteredTag::getRegisterTagName() const
+{
+   // Deprecated:
+   return m_tagName;
+}
+
+const std::string& ossimNitfRegisteredTag::getTagName() const
+{
+   return m_tagName;
+}
+
+void ossimNitfRegisteredTag::setTagName(const std::string& tagName)
+{
+   m_tagName = tagName;
+}
+
+ossim_uint32 ossimNitfRegisteredTag::getSizeInBytes() const
+{
+   // Deprecated:
+   return getTagLength();
+}
+
+ossim_uint32 ossimNitfRegisteredTag::getTagLength() const
+{
+   return m_tagLength;
+}
+
+void ossimNitfRegisteredTag::setTagLength(ossim_uint32 length)
+{
+   m_tagLength = length;
+}
+
+void ossimNitfRegisteredTag::setProperty(ossimRefPtr<ossimProperty> /* property */)
+{
+}
+
+ossimRefPtr<ossimProperty> ossimNitfRegisteredTag::getProperty(const ossimString& /* name */)const
+{
+   return 0;
+}
+
+void ossimNitfRegisteredTag::getPropertyNames(std::vector<ossimString>& /* propertyNames */)const
+{
+}
+
+void ossimNitfRegisteredTag::getMetadata(ossimKeywordlist& /* kwl */,
+                                         const char* /* prefix */ ) const
+{
+}
+
+std::ostream& ossimNitfRegisteredTag::print(
+   std::ostream& out, const std::string& /* prefix */) const
+{
+   // return print(out);
+   return out;
+}
+
+bool ossimNitfRegisteredTag::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = false;
+   // by default we will use the already implemented print method as backup
+   //
+   std::ostringstream out;
+   
+   print(out);
+   
+   ossimKeywordlist kwlTemp;
+   
+   std::istringstream in(out.str());
+   if(kwlTemp.parseStream(in))
+   {
+      result = true;
+      kwl.add(prefix, kwlTemp);
+   }
+   
+   return result;
+}
diff --git a/src/support_data/ossimNitfRegisteredTagFactory.cpp b/src/support_data/ossimNitfRegisteredTagFactory.cpp
new file mode 100644
index 0000000..8463dec
--- /dev/null
+++ b/src/support_data/ossimNitfRegisteredTagFactory.cpp
@@ -0,0 +1,215 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRegisteredTagFactory.cpp 23113 2015-01-28 17:04:17Z gpotts $
+
+#include <ossim/support_data/ossimNitfRegisteredTagFactory.h>
+
+#include <ossim/support_data/ossimNitfAcftbTag.h>
+#include <ossim/support_data/ossimNitfAimidbTag.h>
+#include <ossim/support_data/ossimNitfBlockaTag.h>
+#include <ossim/support_data/ossimNitfCscrnaTag.h>
+#include <ossim/support_data/ossimNitfCsdidaTag.h>
+#include <ossim/support_data/ossimNitfCsexraTag.h>
+#include <ossim/support_data/ossimNitfCsexraTag.h>
+#include <ossim/support_data/ossimNitfEngrdaTag.h>
+#include <ossim/support_data/ossimNitfGeoPositioningTag.h>
+#include <ossim/support_data/ossimNitfIchipbTag.h>
+#include <ossim/support_data/ossimNitfJ2klraTag.h>
+#include <ossim/support_data/ossimNitfLocalGeographicTag.h>
+#include <ossim/support_data/ossimNitfLocalCartographicTag.h>
+#include <ossim/support_data/ossimNitfMstgtaTag.h>
+#include <ossim/support_data/ossimNitfPiaimcTag.h>
+#include <ossim/support_data/ossimNitfProjectionParameterTag.h>
+#include <ossim/support_data/ossimNitfRpcBTag.h>
+#include <ossim/support_data/ossimNitfRpcATag.h>
+#include <ossim/support_data/ossimNitfSensraTag.h>
+#include <ossim/support_data/ossimNitfStdidcTag.h>
+#include <ossim/support_data/ossimNitfUse00aTag.h>
+#include <ossim/support_data/ossimNitfHistoaTag.h>
+#include <ossim/support_data/ossimNitfCsccgaTag.h>
+#include <ossim/support_data/ossimNitfCsproaTag.h>
+#include <ossim/support_data/ossimNitfExoptaTag.h>
+#include <ossim/support_data/ossimNitfRsmecaTag.h>
+#include <ossim/support_data/ossimNitfRsmidaTag.h>
+#include <ossim/support_data/ossimNitfRsmpcaTag.h>
+#include <ossim/support_data/ossimNitfRsmpiaTag.h>
+#include <ossim/support_data/ossimNitfStreobTag.h>
+
+
+RTTI_DEF1(ossimNitfRegisteredTagFactory, "ossimNitfRegisteredTagFactory", ossimNitfTagFactory);
+
+static const char ACFTB_TAG[]                = "ACFTB";
+static const char AIMIDB_TAG[]               = "AIMIDB";
+static const char BLOCKA_TAG[]               = "BLOCKA";
+static const char CSCRNA_TAG[]               = "CSCRNA";
+static const char CSDIDA_TAG[]               = "CSDIDA";
+static const char CSEXRA_TAG[]               = "CSEXRA";
+static const char ENGRDA_TAG[]               = "ENGRDA";
+static const char GEO_POSITIONING_TAG[]      = "GEOPSB";
+static const char ICHIPB_TAG[]               = "ICHIPB";
+static const char J2KLRA_TAG[]               = "J2KLRA";
+static const char LOCAL_GEOGRAPHIC_TAG[]     = "GEOLOB";
+static const char LOCAL_CARTOGRAPHIC_TAG[]   = "MAPLOB";
+static const char MSTGTA_TAG[]               = "MSTGTA";
+static const char PIAIMC_TAG[]               = "PIAIMC";
+static const char PROJECTION_PARAMETER_TAG[] = "PRJPSB";
+static const char RPCB_TAG[]                 = "RPC00B";
+static const char RPCA_TAG[]                 = "RPC00A";
+static const char SENSRA_TAG[]               = "SENSRA";
+static const char STDIDC_TAG[]               = "STDIDC";
+static const char STREOB_TAG[]               = "STREOB";
+static const char USE00A_TAG[]               = "USE00A";
+static const char HISTOA_TAG[]               = "HISTOA";
+static const char CSCCGA_TAG[]               = "CSCCGA";
+static const char CSPROA_TAG[]               = "CSPROA";
+static const char EXOPTA_TAG[]               = "EXOPTA";
+static const char RSMECA_TAG[]               = "RSMECA";
+static const char RSMIDA_TAG[]               = "RSMIDA";
+static const char RSMPCA_TAG[]               = "RSMPCA";
+static const char RSMPIA_TAG[]               = "RSMPIA";
+ossimNitfRegisteredTagFactory::ossimNitfRegisteredTagFactory()
+{
+}
+
+ossimNitfRegisteredTagFactory::~ossimNitfRegisteredTagFactory()
+{
+}
+
+ossimNitfRegisteredTagFactory* ossimNitfRegisteredTagFactory::instance()
+{
+   static ossimNitfRegisteredTagFactory inst;
+   return &inst;
+}
+
+ossimRefPtr<ossimNitfRegisteredTag> ossimNitfRegisteredTagFactory::create(
+   const ossimString& tagName)const
+{
+   ossimString name = ossimString(tagName).trim().upcase();
+   
+   if(tagName == ACFTB_TAG)
+   {
+      return new ossimNitfAcftbTag;
+   }
+   else if(tagName == AIMIDB_TAG)
+   {
+      return new ossimNitfAimidbTag;
+   }
+   else if(tagName == BLOCKA_TAG)
+   {
+      return new ossimNitfBlockaTag;
+   }
+   else if(tagName == CSCRNA_TAG)
+   {
+      return new ossimNitfCscrnaTag;
+   }
+   else if(tagName == CSDIDA_TAG)
+   {
+      return new ossimNitfCsdidaTag;
+   }
+   else if(tagName == CSEXRA_TAG)
+   {
+      return new ossimNitfCsexraTag;
+   }
+   else if(tagName == ENGRDA_TAG)
+   {
+      return new ossimNitfEngrdaTag;
+   }
+   else if(tagName == GEO_POSITIONING_TAG)
+   {
+      return new ossimNitfGeoPositioningTag;
+   }
+   else if(tagName == ICHIPB_TAG)
+   {
+      return new ossimNitfIchipbTag;
+   }
+   else if(tagName == J2KLRA_TAG)
+   {
+      return new ossimNitfJ2klraTag;
+   }
+   else if(tagName == LOCAL_GEOGRAPHIC_TAG)
+   {
+      return new ossimNitfLocalGeographicTag;
+   }
+   else if(tagName == LOCAL_CARTOGRAPHIC_TAG)
+   {
+      return new ossimNitfLocalCartographicTag;
+   }
+   else if(tagName == MSTGTA_TAG)
+   {
+      return new ossimNitfMstgtaTag;
+   }
+   else if(tagName == PIAIMC_TAG)
+   {
+      return new ossimNitfPiaimcTag;
+   }
+   else if(tagName == PROJECTION_PARAMETER_TAG)
+   {
+      return new ossimNitfProjectionParameterTag;
+   }
+   else if(tagName == RPCB_TAG)
+   {
+      return new ossimNitfRpcBTag();
+   }
+   else if(tagName == RPCA_TAG)
+   {
+      return new ossimNitfRpcATag();
+   }
+   else if (tagName == SENSRA_TAG)
+   {
+      return new ossimNitfSensraTag();
+   }
+   else if (tagName == STDIDC_TAG)
+   {
+      return new ossimNitfStdidcTag();
+   }
+   else if (tagName == STREOB_TAG)
+   {
+      return new ossimNitfStreobTag();
+   }
+   else if (tagName == USE00A_TAG)
+   {
+      return new ossimNitfUse00aTag();
+   }
+   else if(tagName == HISTOA_TAG)
+   {
+      return new ossimNitfHistoaTag();
+   }
+   else if(tagName == CSCCGA_TAG)
+   {
+      return new ossimNitfCsccgaTag();
+   }
+   else if(tagName == CSPROA_TAG)
+   {
+      return new ossimNitfCsproaTag();
+   }
+   else if(tagName == EXOPTA_TAG)
+   {
+      return new ossimNitfExoptaTag();
+   }
+   else if(tagName == RSMECA_TAG)
+   {
+      return new ossimNitfRsmecaTag();
+   }
+   else if(tagName == RSMIDA_TAG)
+   {
+      return new ossimNitfRsmidaTag();
+   }
+   else if(tagName == RSMPCA_TAG)
+   {
+      return new ossimNitfRsmpcaTag();
+   }
+   else if(tagName == RSMPIA_TAG)
+   {
+      return new ossimNitfRsmpiaTag();
+   }
+   return NULL;
+}
diff --git a/src/support_data/ossimNitfRpcATag.cpp b/src/support_data/ossimNitfRpcATag.cpp
new file mode 100644
index 0000000..14626a1
--- /dev/null
+++ b/src/support_data/ossimNitfRpcATag.cpp
@@ -0,0 +1,24 @@
+//*******************************************************************
+//
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+//
+// Description: Nitf support class for RPC00A -
+// Rational Polynomial Coefficient extension.
+//
+//********************************************************************
+// $Id: ossimNitfRpcATag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <ossim/support_data/ossimNitfRpcATag.h>
+
+RTTI_DEF1(ossimNitfRpcATag, "ossimNitfRpcATag", ossimNitfRpcBase);
+
+ossimNitfRpcATag::ossimNitfRpcATag()
+   : ossimNitfRpcBase()
+{
+   // Set the tag name in base.
+   setTagName(std::string("RPC00A"));
+}
diff --git a/src/support_data/ossimNitfRpcBTag.cpp b/src/support_data/ossimNitfRpcBTag.cpp
new file mode 100644
index 0000000..1656db2
--- /dev/null
+++ b/src/support_data/ossimNitfRpcBTag.cpp
@@ -0,0 +1,22 @@
+//*******************************************************************
+//
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRpcBTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <ossim/support_data/ossimNitfRpcBTag.h>
+
+RTTI_DEF1(ossimNitfRpcBTag, "ossimNitfRpcBTag", ossimNitfRpcBase);
+
+ossimNitfRpcBTag::ossimNitfRpcBTag()
+   : ossimNitfRpcBase()
+{
+   // Set the tag name in base.
+   setTagName(std::string("RPC00B"));
+}
diff --git a/src/support_data/ossimNitfRpcBase.cpp b/src/support_data/ossimNitfRpcBase.cpp
new file mode 100644
index 0000000..a97d088
--- /dev/null
+++ b/src/support_data/ossimNitfRpcBase.cpp
@@ -0,0 +1,1038 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: Nitf support class for RPC00A -
+// Rational Polynomial Coefficient extension.
+//
+//********************************************************************
+// $Id: ossimNitfRpcBase.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <algorithm>
+#include <iostream>
+#include <iomanip>
+#include <vector>
+#include <ossim/support_data/ossimNitfRpcBase.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimStringProperty.h>
+
+static const ossimTrace traceDebug(ossimString("ossimNitfRpcBase:debug"));
+static const ossimString ERR_BIAS_KW = "ERR_BIAS";
+static const ossimString ERR_RAND_KW = "ERR_RAND";
+static const ossimString LINE_OFF_KW = "LINE_OFF";
+static const ossimString SAMP_OFF_KW = "SAMP_OFF";
+static const ossimString LAT_OFF_KW = "LAT_OFF";
+static const ossimString LONG_OFF_KW = "LONG_OFF";
+static const ossimString HEIGHT_OFF_KW = "HEIGHT_OFF";
+static const ossimString LINE_SCALE_KW = "LINE_SCALE";
+static const ossimString SAMP_SCALE_KW = "SAMP_SCALE";
+static const ossimString LAT_SCALE_KW = "LAT_SCALE";
+static const ossimString LONG_SCALE_KW = "LONG_SCALE";
+static const ossimString HEIGHT_SCALE_KW = "HEIGHT_SCALE";
+static const ossimString LINE_NUM_COEFF_KW = "LINE_NUM_COEFF_";
+static const ossimString LINE_DEN_COEFF_KW = "LINE_DEN_COEFF_";
+static const ossimString SAMP_NUM_COEFF_KW = "SAMP_NUM_COEFF_";
+static const ossimString SAMP_DEN_COEFF_KW = "SAMP_DEN_COEFF_";
+
+RTTI_DEF1(ossimNitfRpcBase, "ossimNitfRpcBase", ossimNitfRegisteredTag);
+
+
+ossimNitfRpcBase::ossimNitfRpcBase()
+   : ossimNitfRegisteredTag()
+{
+   // Set the tag length in base.
+   setTagLength(1041);
+   
+   clearFields();
+}
+
+void ossimNitfRpcBase::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theSuccess, SUCCESS_SIZE);
+   in.read(theErrorBias, ERROR_BIAS_SIZE);
+   in.read(theErrRand, ERR_RAND_SIZE);
+   in.read(theLineOffset, LINE_OFFSET_SIZE);
+   in.read(theSampleOffset, SAMPLE_OFFSET_SIZE);
+   in.read(theGeodeticLatOffset, GEODETIC_LAT_OFFSET_SIZE);
+   in.read(theGeodeticLonOffset, GEODETIC_LON_OFFSET_SIZE);
+   in.read(theGeodeticHeightOffset, GEODETIC_HEIGHT_OFFSET_SIZE);
+   in.read(theLineScale, LINE_SCALE_SIZE);
+   in.read(theSampleScale, SAMPLE_SCALE_SIZE);
+   in.read(theGeodeticLatScale, GEODETIC_LAT_SCALE_SIZE);
+   in.read(theGeodeticLonScale, GEODETIC_LON_SCALE_SIZE);
+   in.read(theGeodeticHeightScale, GEODETIC_HEIGHT_SCALE_SIZE);
+   
+   ossim_uint32 idx = 0;
+   
+   char temp1[LINE_NUMERATOR_COEFFICIENT_SIZE+1];
+   temp1[LINE_NUMERATOR_COEFFICIENT_SIZE] = '\0';
+   for(idx = 0; idx < LINE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      in.read(temp1, LINE_NUMERATOR_COEFFICIENT_SIZE);
+      theLineNumeratorCoefficient[idx] = temp1;
+   }
+   
+   char temp2[LINE_DENOMINATOR_COEFFICIENT_SIZE+1];
+   temp2[LINE_DENOMINATOR_COEFFICIENT_SIZE] = '\0';
+   for(idx = 0; idx < LINE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      in.read(temp2, LINE_DENOMINATOR_COEFFICIENT_SIZE);
+      theLineDenominatorCoefficient[idx] = temp2;
+   }
+   
+   char temp3[SAMPLE_NUMERATOR_COEFFICIENT_SIZE+1];
+   temp3[SAMPLE_NUMERATOR_COEFFICIENT_SIZE] = '\0';
+   for(idx = 0; idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      in.read(temp3, SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
+      theSampleNumeratorCoefficient[idx] = temp3;
+   }
+   
+   char temp4[SAMPLE_DENOMINATOR_COEFFICIENT_SIZE+1];
+   temp4[SAMPLE_DENOMINATOR_COEFFICIENT_SIZE] = '\0';
+   for(idx = 0; idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      in.read(temp4, SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
+      theSampleDenominatorCoefficient[idx] = temp4;
+   }
+}
+
+void ossimNitfRpcBase::writeStream(std::ostream& out)
+{
+   ossim_uint32 idx = 0;
+   
+   out.write(theSuccess, SUCCESS_SIZE);
+   out.write(theErrorBias, ERROR_BIAS_SIZE);
+   out.write(theErrRand, ERR_RAND_SIZE);
+   out.write(theLineOffset, LINE_OFFSET_SIZE);
+   out.write(theSampleOffset, SAMPLE_OFFSET_SIZE);
+   out.write(theGeodeticLatOffset, GEODETIC_LAT_OFFSET_SIZE);
+   out.write(theGeodeticLonOffset, GEODETIC_LON_OFFSET_SIZE);
+   out.write(theGeodeticHeightOffset, GEODETIC_HEIGHT_OFFSET_SIZE);
+   out.write(theLineScale, LINE_SCALE_SIZE);
+   out.write(theSampleScale, SAMPLE_SCALE_SIZE);
+   out.write(theGeodeticLatScale, GEODETIC_LAT_SCALE_SIZE);
+   out.write(theGeodeticLonScale, GEODETIC_LON_SCALE_SIZE);
+   out.write(theGeodeticHeightScale, GEODETIC_HEIGHT_SCALE_SIZE);
+   for(idx = 0; idx < LINE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      out.write(theLineNumeratorCoefficient[idx].c_str(),
+                LINE_NUMERATOR_COEFFICIENT_SIZE);
+   }
+   for(idx = 0; idx < LINE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      out.write(theLineDenominatorCoefficient[idx].c_str(),
+                LINE_DENOMINATOR_COEFFICIENT_SIZE);
+   }
+   for(idx = 0; idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      out.write(theSampleNumeratorCoefficient[idx].c_str(),
+                SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
+   }
+   for(idx = 0; idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT; ++idx)
+   {
+      out.write(theSampleDenominatorCoefficient[idx].c_str(),
+                SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
+   }
+}
+
+void ossimNitfRpcBase::clearFields()
+{
+   theSuccess[0] = '1';
+   memcpy(theErrorBias, "0000.00", 7);
+   memcpy(theErrRand, "0000.00", 7);
+   memcpy(theLineOffset, "000000", 6);
+   memcpy(theSampleOffset, "00000", 5);
+   memcpy(theGeodeticLatOffset, "+00.0000", 8);
+   memcpy(theGeodeticLonOffset, "+000.0000", 9);
+   memcpy(theGeodeticHeightOffset, "+0000", 5);
+   memcpy(theLineScale, "000001", 6);
+   memcpy(theSampleScale, "00001", 5);
+   memcpy(theGeodeticLatScale, "+00.0000", 8);
+   memcpy(theGeodeticLonScale, "+000.0000", 9);
+   memcpy(theGeodeticHeightScale, "+0000", 5);
+   
+   theSuccess[1] = '\0';
+   theErrorBias[7] = '\0';
+   theErrRand[7] = '\0';
+   theLineOffset[6] = '\0';
+   theSampleOffset[5] = '\0';
+   theGeodeticLatOffset[8]='\0';
+   theGeodeticLonOffset[9]='\0';
+   theGeodeticHeightOffset[5]='\0';
+   theLineScale[6]='\0';
+   theSampleScale[5]='\0';
+   theGeodeticLatScale[8]='\0';
+   theGeodeticLonScale[9]='\0';
+   theGeodeticHeightScale[5]='\0';
+   
+   theLineNumeratorCoefficient.resize(20);
+   theLineDenominatorCoefficient.resize(20);
+   theSampleNumeratorCoefficient.resize(20);
+   theSampleDenominatorCoefficient.resize(20);
+   ossim_uint32 idx = 0;
+   const char* zeroString = "+0.000000E+0";
+   
+   for(idx = 0; idx < theLineNumeratorCoefficient.size();++idx)
+   {
+      theLineNumeratorCoefficient[idx] = zeroString; 
+      theLineDenominatorCoefficient[idx] = zeroString;;
+      theSampleNumeratorCoefficient[idx] = zeroString;;
+      theSampleDenominatorCoefficient[idx] = zeroString;;
+   }
+}
+
+bool ossimNitfRpcBase::getSuccess()const
+{
+   return (theSuccess[0] == '1');
+}
+
+void ossimNitfRpcBase::setSuccess(bool success)
+{
+   theSuccess[0] = success?'1':'0';
+}
+
+ossimString ossimNitfRpcBase::getErrorBias()const
+{
+   return theErrorBias;
+}
+
+void ossimNitfRpcBase::setErrorBias(const ossim_float64& errorBias)
+{
+   ossimString os = ossimNitfCommon::convertToDoubleString(errorBias,
+                                                           2,
+                                                           ERROR_BIAS_SIZE);
+   setErrorBias(os);
+}
+
+void ossimNitfRpcBase::setErrorBias(const ossimString& errorBias)
+{
+   memset(theErrorBias, ' ', ERROR_BIAS_SIZE);
+   memcpy(theErrorBias, errorBias.c_str(), std::min((size_t)ERROR_BIAS_SIZE, errorBias.length()));
+}
+
+ossimString ossimNitfRpcBase::getErrorRand()const
+{
+   return theErrRand;
+}
+
+void ossimNitfRpcBase::setErrorRand(const ossim_float64& errorRand)
+{
+   ossimString os = ossimNitfCommon::convertToDoubleString(errorRand,
+                                                           2,
+                                                           ERROR_BIAS_SIZE);
+   setErrorRand(os);
+}
+
+void ossimNitfRpcBase::setErrorRand(const ossimString& errorRand)
+{
+   memset(theErrRand, ' ', ERR_RAND_SIZE);
+   memcpy(theErrRand, errorRand.c_str(), std::min((size_t)ERR_RAND_SIZE, errorRand.length()));
+}
+
+ossimString ossimNitfRpcBase::getLineOffset()const
+{
+   return theLineOffset;
+}
+
+void ossimNitfRpcBase::setLineOffset(ossim_uint32 lineOffset)
+{
+   ossimString os = ossimNitfCommon::convertToUIntString(lineOffset,
+                                                         LINE_OFFSET_SIZE);
+   setLineOffset(os);
+}
+
+void ossimNitfRpcBase::setLineOffset(const ossimString& lineOffset)
+{
+   memset(theLineOffset, ' ', LINE_OFFSET_SIZE);
+   memcpy(theLineOffset, lineOffset.c_str(), std::min((size_t)LINE_OFFSET_SIZE, lineOffset.length()));
+}
+
+ossimString ossimNitfRpcBase::getSampleOffset()const
+{
+   return theSampleOffset;
+}
+
+void ossimNitfRpcBase::setSampleOffset(ossim_uint32 sampleOffset)
+{
+   ossimString os = ossimNitfCommon::convertToUIntString(sampleOffset,
+                                                         SAMPLE_OFFSET_SIZE);
+   setSampleOffset(os);
+}
+
+void ossimNitfRpcBase::setSampleOffset(const ossimString& sampleOffset)
+{
+   memset(theSampleOffset, ' ', SAMPLE_OFFSET_SIZE);
+   memcpy(theSampleOffset, sampleOffset.c_str(), std::min((size_t)SAMPLE_OFFSET_SIZE, sampleOffset.length()));
+}
+
+ossimString ossimNitfRpcBase::getGeodeticLatOffset()const
+{
+   return theGeodeticLatOffset;
+}
+
+void ossimNitfRpcBase::setGeodeticLatOffset(
+   const ossim_float64& geodeticLatOffset)
+{
+   if ( (geodeticLatOffset >= -90.0) && (geodeticLatOffset <= 90.0) )
+   {
+      ossimString os =
+         ossimNitfCommon::convertToDoubleString(geodeticLatOffset,
+                                                4,
+                                                GEODETIC_LAT_OFFSET_SIZE);
+      setGeodeticLatOffset(os);
+   }
+}
+
+void ossimNitfRpcBase::setGeodeticLatOffset(
+   const ossimString& geodeticLatOffset)
+{
+   memset(theGeodeticLatOffset, ' ', GEODETIC_LAT_OFFSET_SIZE);
+   memcpy(theGeodeticLatOffset, geodeticLatOffset.c_str(), std::min((size_t)GEODETIC_LAT_OFFSET_SIZE, geodeticLatOffset.length()));
+}
+
+ossimString ossimNitfRpcBase::getGeodeticLonOffset()const
+{
+   return theGeodeticLonOffset;
+}
+
+void ossimNitfRpcBase::setGeodeticLonOffset(
+   const ossim_float64& geodeticLonOffset)
+{
+   if ( (geodeticLonOffset >= -180.0) && (geodeticLonOffset <= 180.0) )
+   {
+      ossimString os =
+         ossimNitfCommon::convertToDoubleString(geodeticLonOffset,
+                                                4,
+                                                GEODETIC_LON_OFFSET_SIZE);
+      setGeodeticLonOffset(os);
+   }
+}
+
+void ossimNitfRpcBase::setGeodeticLonOffset(const ossimString& geodeticLonOffset)
+{
+   memset(theGeodeticLonOffset, ' ', GEODETIC_LON_OFFSET_SIZE);
+   memcpy(theGeodeticLonOffset, geodeticLonOffset.c_str(), std::min((size_t)GEODETIC_LON_OFFSET_SIZE, geodeticLonOffset.length()));
+}
+
+ossimString ossimNitfRpcBase::getGeodeticHeightOffset()const
+{
+   return theGeodeticHeightOffset;
+}
+
+void ossimNitfRpcBase::setGeodeticHeightOffset(
+   ossim_int32 geodeticHeightOffset)
+{
+   ossimString os =
+      ossimNitfCommon::convertToIntString(geodeticHeightOffset,
+                                          GEODETIC_HEIGHT_OFFSET_SIZE);
+   setGeodeticHeightOffset(os);
+}
+
+void ossimNitfRpcBase::setGeodeticHeightOffset(const ossimString& geodeticHeightOffset)
+{
+   memset(theGeodeticHeightOffset, ' ', GEODETIC_HEIGHT_OFFSET_SIZE);
+   memcpy(theGeodeticHeightOffset, geodeticHeightOffset.c_str(), std::min((size_t)GEODETIC_HEIGHT_OFFSET_SIZE, geodeticHeightOffset.length()));
+}
+
+ossimString ossimNitfRpcBase::getLineScale()const
+{
+   return theLineScale;
+}
+
+void ossimNitfRpcBase::setLineScale(ossim_uint32 lineScale)
+{
+   ossimString os = ossimNitfCommon::convertToUIntString(lineScale,
+                                                         LINE_SCALE_SIZE);
+   setLineScale(os);
+}
+
+void ossimNitfRpcBase::setLineScale(const ossimString& lineScale)
+{
+   memset(theLineScale, ' ', LINE_SCALE_SIZE);
+   memcpy(theLineScale, lineScale.c_str(), std::min((size_t)LINE_SCALE_SIZE, lineScale.length()));
+}
+
+ossimString ossimNitfRpcBase::getSampleScale()const
+{
+   return theSampleScale;
+}
+
+void ossimNitfRpcBase::setSampleScale(ossim_uint32 sampleScale)
+{
+   ossimString os = ossimNitfCommon::convertToUIntString(sampleScale,
+                                       SAMPLE_SCALE_SIZE);
+   setSampleScale(os);
+}
+
+void ossimNitfRpcBase::setSampleScale(const ossimString& sampleScale)
+{
+   memset(theSampleScale, ' ', SAMPLE_SCALE_SIZE);
+   memcpy(theSampleScale, sampleScale.c_str(), std::min((size_t)SAMPLE_SCALE_SIZE, sampleScale.length()));
+}
+
+ossimString ossimNitfRpcBase::getGeodeticLatScale()const
+{
+   return theGeodeticLatScale;
+}
+
+void ossimNitfRpcBase::setGeodeticLatScale(
+   const ossim_float64& geodeticLatScale)
+{
+   if (geodeticLatScale == 0.0)
+   {
+      // Error scale cannot be zero.
+      return;
+   }
+   
+   if ( (geodeticLatScale >= -90.0) && (geodeticLatScale <= 90.0) )
+   {
+      ossimString os = ossimNitfCommon::convertToDoubleString(geodeticLatScale,
+                                             4,
+                                             GEODETIC_LAT_SCALE_SIZE);
+      setGeodeticLatScale(os);
+   }
+}
+
+void ossimNitfRpcBase::setGeodeticLatScale(const ossimString& geodeticLatScale)
+{
+   memset(theGeodeticLatScale, ' ', GEODETIC_LAT_SCALE_SIZE);
+   memcpy(theGeodeticLatScale, geodeticLatScale.c_str(), std::min((size_t)GEODETIC_LAT_SCALE_SIZE, geodeticLatScale.length()));
+}
+
+ossimString ossimNitfRpcBase::getGeodeticLonScale()const
+{
+   return theGeodeticLonScale;
+}
+
+void ossimNitfRpcBase::setGeodeticLonScale(
+   const ossim_float64& geodeticLonScale)
+{
+   if (geodeticLonScale == 0.0)
+   {
+      // Error scale cannot be zero.
+      return;
+   }
+   
+   if ( (geodeticLonScale >= -180.0) && (geodeticLonScale <= 180.0) )
+   {
+      ossimString os = ossimNitfCommon::convertToDoubleString(geodeticLonScale,
+                                             4,
+                                             GEODETIC_LON_SCALE_SIZE);
+      setGeodeticLonScale(os);
+   }
+}
+
+void ossimNitfRpcBase::setGeodeticLonScale(const ossimString& geodeticLonScale)
+{
+   memset(theGeodeticLonScale, ' ', GEODETIC_LON_SCALE_SIZE);
+   memcpy(theGeodeticLonScale, geodeticLonScale.c_str(), std::min((size_t)GEODETIC_LON_SCALE_SIZE, geodeticLonScale.length()));
+}
+
+ossimString ossimNitfRpcBase::getGeodeticHeightScale()const
+{
+   return theGeodeticHeightScale;
+}
+
+void ossimNitfRpcBase::setGeodeticHeightScale(ossim_int32 geodeticHeightScale)
+{
+   ossimString os =
+      ossimNitfCommon::convertToIntString(geodeticHeightScale,
+                                          GEODETIC_HEIGHT_SCALE_SIZE);
+   setGeodeticHeightScale(os);
+}
+
+void ossimNitfRpcBase::setGeodeticHeightScale(
+   const ossimString& geodeticHeightScale)
+{
+   memset(theGeodeticHeightScale, ' ', GEODETIC_HEIGHT_SCALE_SIZE);
+   memcpy(theGeodeticHeightScale, geodeticHeightScale.c_str(), std::min((size_t)GEODETIC_HEIGHT_SCALE_SIZE, geodeticHeightScale.length()));
+}
+
+/* Temp comment out until range error handling is decided.*/
+#if 0
+// The assert here will be ignored when compiled with -DNDEBUG so ossimSetError and fix the index
+#define ASSERT_ARRAY_CONSTRAINT(expression, idx, correctedValue, module) \
+   assert(expression);                                                  \
+   ossimSetError(getClassName().c_str(), ossimErrorCodes::OSSIM_ERROR,  \
+                 "File %s line %d Module %s Error:\nArray index constraint error.\n", \
+                 __FILE__, __LINE__, module);                           \
+   if (! (expression) ) idx = correctedValue;
+
+#endif
+   
+ossimString ossimNitfRpcBase::getLineNumeratorCoeff(ossim_uint32 idx)const
+{
+//ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getLineNumeratorCoeff");
+
+   if (idx >= LINE_NUMERATOR_COEFFICIENT_COUNT)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimNitfRpcBase::getLineNumeratorCoeff range error!"
+            << std::endl;
+      }
+      return ossimString();
+   }
+   
+   return theLineNumeratorCoefficient[idx];
+}
+
+void ossimNitfRpcBase::setLineNumeratorCoeff(
+   const std::vector<ossim_float64>& coeff)
+{
+   if (coeff.size() != LINE_NUMERATOR_COEFFICIENT_COUNT)
+   {
+      // Error...
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcBase::setLineNumeratorCoeff WARNING:"
+            << "\nArray not of correct size!"
+            << std::endl;
+      }
+      return;
+   }
+
+   for (ossim_uint32 i = 0; i < LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
+   {
+      ossimString os = ossimNitfCommon::convertToScientificString(
+         coeff[i], LINE_NUMERATOR_COEFFICIENT_SIZE);
+      setLineNumeratorCoeff(i, os);
+   }
+}
+
+void ossimNitfRpcBase::setLineNumeratorCoeff(ossim_uint32 idx,
+                                             const ossimString& coeff)
+{
+   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setLineNumeratorCoeff");
+
+   if (idx >= LINE_NUMERATOR_COEFFICIENT_COUNT)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfRpcBase::setLineNumeratorCoeff range error!"
+         << std::endl;
+      return;
+   } 
+
+   std::string s(coeff, 0, LINE_NUMERATOR_COEFFICIENT_SIZE);
+   theLineNumeratorCoefficient[idx] = s;  
+}
+
+ossimString ossimNitfRpcBase::getLineDenominatorCoeff(ossim_uint32 idx)const
+{
+   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getLineDenominatorCoeff");
+
+   if (idx >= LINE_DENOMINATOR_COEFFICIENT_COUNT)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfRpcBase::getLineDenominatorCoeff range error!"
+         << std::endl;
+      return ossimString();
+   }  
+   
+   return theLineDenominatorCoefficient[idx];
+}
+
+void ossimNitfRpcBase::setLineDenominatorCoeff(
+   const std::vector<ossim_float64>& coeff)
+{
+   if (coeff.size() != LINE_DENOMINATOR_COEFFICIENT_COUNT)
+   {
+      // Error...
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcBase::setLineDenominatorCoeff WARNING:"
+            << "\nArray not of correct size!"
+            << std::endl;
+      }
+      return;
+   }
+
+   for (ossim_uint32 i = 0; i < LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
+   {
+      ossimString os = ossimNitfCommon::convertToScientificString(
+         coeff[i], LINE_DENOMINATOR_COEFFICIENT_SIZE);
+      setLineDenominatorCoeff(i, os);
+   }
+}
+
+void ossimNitfRpcBase::setLineDenominatorCoeff(ossim_uint32 idx,
+                                               const ossimString& coeff)
+{
+   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < LINE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setLineDenominatorCoeff");
+
+   if (idx >= LINE_DENOMINATOR_COEFFICIENT_COUNT)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfRpcBase::setLineDenominatorCoeff range error!"
+         << std::endl;
+      return;
+   } 
+   
+   std::string s(coeff, 0, LINE_DENOMINATOR_COEFFICIENT_SIZE);
+   theLineDenominatorCoefficient[idx] = s;  
+}
+
+ossimString ossimNitfRpcBase::getSampleNumeratorCoeff(ossim_uint32 idx)const
+{
+   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getSampleNumeratorCoeff");
+
+   if (idx >= SAMPLE_NUMERATOR_COEFFICIENT_COUNT)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfRpcBase::getSampleNumeratorCoeff range error!"
+         << std::endl;
+      return ossimString();
+   } 
+   return theSampleNumeratorCoefficient[idx];
+}
+
+void ossimNitfRpcBase::setSampleNumeratorCoeff(
+   const std::vector<ossim_float64>& coeff)
+{
+   if (coeff.size() != SAMPLE_NUMERATOR_COEFFICIENT_COUNT)
+   {
+      // Error...
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcBase::setSampleNumeratorCoeff WARNING:"
+            << "\nArray not of correct size!"
+            << std::endl;
+      }
+      return;
+   }
+
+   for (ossim_uint32 i = 0; i < SAMPLE_NUMERATOR_COEFFICIENT_COUNT; ++i)
+   {
+      ossimString os = ossimNitfCommon::convertToScientificString(
+         coeff[i], SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
+      setSampleNumeratorCoeff(i, os);
+   }
+}
+
+void ossimNitfRpcBase::setSampleNumeratorCoeff(ossim_uint32 idx,
+                                               const ossimString& coeff)
+{
+   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_NUMERATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setSampleNumeratorCoeff");
+
+   if (idx >= SAMPLE_NUMERATOR_COEFFICIENT_COUNT)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfRpcBase::setSampleNumeratorCoeff range error!"
+         << std::endl;
+      return;
+   } 
+   
+   std::string s(coeff, 0, SAMPLE_NUMERATOR_COEFFICIENT_SIZE);
+   theSampleNumeratorCoefficient[idx] = s;  
+}
+
+ossimString ossimNitfRpcBase::getSampleDenominatorCoeff(ossim_uint32 idx)const
+{
+   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::getSampleDenominatorCoeff");
+
+   if (idx >= SAMPLE_DENOMINATOR_COEFFICIENT_COUNT)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfRpcBase::getSampleDenominatorCoeff range error!"
+         << std::endl;
+      return ossimString();
+   } 
+   
+   return theSampleDenominatorCoefficient[idx];
+}
+
+void ossimNitfRpcBase::setSampleDenominatorCoeff(
+   const std::vector<ossim_float64>& coeff)
+{
+   if (coeff.size() != SAMPLE_DENOMINATOR_COEFFICIENT_COUNT)
+   {
+      // Error...
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimNitfRpcBase::setSampleDenominatorCoeff WARNING:"
+            << "\nArray not of correct size!"
+            << std::endl;
+      }
+      return;
+   }
+
+   for (ossim_uint32 i = 0; i < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
+   {
+      ossimString os = ossimNitfCommon::convertToScientificString(
+         coeff[i], SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
+      setSampleDenominatorCoeff(i, os);
+   }
+}
+
+void ossimNitfRpcBase::setSampleDenominatorCoeff(
+   ossim_uint32 idx, const ossimString& coeff)
+{
+   // ASSERT_ARRAY_CONSTRAINT(idx >= 0 && idx < SAMPLE_DENOMINATOR_COEFFICIENT_COUNT,idx,0,"ossimNitfRpcBase::setSampleDenominatorCoeff");
+
+   if (idx >= SAMPLE_DENOMINATOR_COEFFICIENT_COUNT)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimNitfRpcBase::setSampleDenominatorCoeff range error!"
+         << std::endl;
+      return;
+   }
+   
+  std::string s(coeff, 0, SAMPLE_DENOMINATOR_COEFFICIENT_SIZE);
+  s.resize(SAMPLE_DENOMINATOR_COEFFICIENT_SIZE, ' ');
+  theSampleDenominatorCoefficient[idx] = s;  
+}
+
+std::ostream& ossimNitfRpcBase::print(std::ostream& out,
+                                      const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"
+       << getSizeInBytes() << "\n"
+       << pfx << std::setw(24) << "SUCCESS:"
+       << theSuccess << "\n" 
+       << pfx << std::setw(24) << "ERR_BIAS:"
+       << theErrorBias << "\n"
+       << pfx << std::setw(24) << "ERR_RAND:"
+       <<theErrRand  << "\n" 
+       << pfx << std::setw(24) << "LINE_OFF:"
+       << theLineOffset << "\n"
+       << pfx << std::setw(24) << "SAMP_OFF:"
+       << theSampleOffset << "\n" 
+       << pfx << std::setw(24) << "LAT_OFF:"
+       << theGeodeticLatOffset << "\n"
+       << pfx << std::setw(24) << "LONG_OFF:"
+       << theGeodeticLonOffset << "\n" 
+       << pfx << std::setw(24) << "HEIGHT_OFF:"
+       << theGeodeticHeightOffset << "\n"
+       << pfx << std::setw(24) << "LINE_SCALE:"
+       << theLineScale  << "\n" 
+       << pfx << std::setw(24)
+       << "SAMP_SCALE:" << theSampleScale << "\n"
+       << pfx << std::setw(24) << "LAT_SCALE:"
+       << theGeodeticLatScale << "\n" 
+       << pfx << std::setw(24) << "LONG_SCALE:"
+       << theGeodeticLonScale << "\n"
+       << pfx << std::setw(24) << "HEIGHT_SCALE:"
+       << theGeodeticHeightScale << "\n";
+
+   ossim_int32 i;
+   ossimString s;
+   
+   for (i=0; i<LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
+   {
+      s = "LINE_NUM_COEFF_";
+      s += ossimString::toString(i);
+      s += ":";
+      out << pfx << std::setw(24) << s
+          << theLineNumeratorCoefficient[i] << "\n";
+   }
+
+   for (i=0; i<LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
+   {
+      s = "LINE_DEN_COEFF_";
+      s += ossimString::toString(i);
+      s += ":";
+      out << pfx << std::setw(24) << s
+          << theLineDenominatorCoefficient[i] << "\n";
+   }
+
+   for (i=0; i<LINE_NUMERATOR_COEFFICIENT_COUNT; ++i)
+   {
+      s = "SAMP_NUM_COEFF_";
+      s += ossimString::toString(i);
+      s += ":";
+      out << pfx << std::setw(24) << s
+          << theSampleNumeratorCoefficient[i] << "\n";
+   }
+
+   for (i=0; i<LINE_DENOMINATOR_COEFFICIENT_COUNT; ++i)
+   {
+      s = "SAMP_DEN_COEFF_";
+      s += ossimString::toString(i);
+      s += ":";
+      out << pfx << std::setw(24) << s
+          << theSampleDenominatorCoefficient[i] << "\n";
+   }
+
+   out.flush();
+   
+   return out;
+}
+
+void ossimNitfRpcBase::setProperty(ossimRefPtr<ossimProperty> /* property */)
+{
+   
+}
+
+ossimRefPtr<ossimProperty> ossimNitfRpcBase::getProperty(const ossimString& name)const
+{
+   ossimProperty* result = 0;
+   if(name == ERR_BIAS_KW)
+   {
+      result = new ossimStringProperty(name, theErrorBias);
+   }
+   else if(name == ERR_RAND_KW)
+   {
+      result = new ossimStringProperty(name, theErrRand);
+   }
+   else if(name == LINE_OFF_KW)
+   {
+      result = new ossimStringProperty(name, theLineOffset);
+   }
+   else if(name == SAMP_OFF_KW)
+   {
+      result = new ossimStringProperty(name, theSampleOffset);
+   }
+   else if(name == LAT_OFF_KW)
+   {
+      result = new ossimStringProperty(name, theGeodeticLatOffset);
+   }
+   else if(name == LONG_OFF_KW)
+   {
+      result = new ossimStringProperty(name, theGeodeticLonOffset);
+   }
+   else if(name == HEIGHT_OFF_KW)
+   {
+      result = new ossimStringProperty(name, theGeodeticHeightOffset);
+   }
+   else if(name == LINE_SCALE_KW)
+   {
+      result = new ossimStringProperty(name, theLineScale);
+   }
+   else if(name == SAMP_SCALE_KW)
+   {
+      result = new ossimStringProperty(name,theSampleScale );
+   }
+   else if(name == LAT_SCALE_KW)
+   {
+      result = new ossimStringProperty(name, theGeodeticLatScale);
+   }
+   else if(name == LONG_SCALE_KW)
+   {
+      result = new ossimStringProperty(name, theGeodeticLonScale);
+   }
+   else if(name == HEIGHT_SCALE_KW)
+   {
+      result = new ossimStringProperty(name, theGeodeticHeightScale);
+   }
+   else if(name.contains(LINE_NUM_COEFF_KW))
+   {
+      ossim_uint32 idx = 0;
+
+         idx = ossimString(name.begin()+LINE_NUM_COEFF_KW.length(),
+                           name.end()).toUInt32();
+      --idx;
+
+      if(idx < theLineNumeratorCoefficient.size())
+      {
+         result = new ossimStringProperty(name, theLineNumeratorCoefficient[idx]);
+      }
+   }
+   else if(name.contains(LINE_DEN_COEFF_KW))
+   {
+      ossim_uint32 idx = 0;
+
+      idx = ossimString(name.begin()+LINE_DEN_COEFF_KW.length(),
+                        name.end()).toUInt32();
+      --idx;
+
+      if(idx < theLineDenominatorCoefficient.size())
+      {
+         result = new ossimStringProperty(name, theLineDenominatorCoefficient[idx]);
+      }
+   }
+   else if(name.contains(SAMP_NUM_COEFF_KW))
+   {
+      ossim_uint32 idx = 0;
+
+      idx = ossimString(name.begin()+SAMP_NUM_COEFF_KW.length(),
+                        name.end()).toUInt32(); 
+      --idx;
+
+      if(idx < theSampleNumeratorCoefficient.size())
+      {
+         result = new ossimStringProperty(name, theSampleNumeratorCoefficient[idx]);
+      }
+   }
+   else if(name.contains(SAMP_DEN_COEFF_KW))
+   {
+      ossim_uint32 idx = 0;
+
+      idx = ossimString(name.begin()+SAMP_DEN_COEFF_KW.length(),
+                        name.end()).toUInt32();
+      --idx;
+
+      if(idx < theSampleDenominatorCoefficient.size())
+      {
+         result = new ossimStringProperty(name, theSampleDenominatorCoefficient[idx]);
+      }
+   }
+
+   return result;
+}
+
+void ossimNitfRpcBase::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossim_uint32 idx = 0;
+   
+   propertyNames.push_back(ERR_BIAS_KW);
+   propertyNames.push_back(ERR_RAND_KW);
+   propertyNames.push_back(LINE_OFF_KW);
+   propertyNames.push_back(SAMP_OFF_KW);
+   propertyNames.push_back(LAT_OFF_KW);
+   propertyNames.push_back(LONG_OFF_KW);
+   propertyNames.push_back(HEIGHT_OFF_KW);
+   propertyNames.push_back(LINE_SCALE_KW);
+   propertyNames.push_back(SAMP_SCALE_KW);
+   propertyNames.push_back(LAT_SCALE_KW);
+   propertyNames.push_back(LONG_SCALE_KW);
+   propertyNames.push_back(HEIGHT_SCALE_KW);
+
+   for(idx = 1; idx <= 20; ++idx)
+   {
+      propertyNames.push_back(LINE_NUM_COEFF_KW+ossimString::toString(idx));
+   }
+   for(idx = 1; idx <= 20; ++idx)
+   {
+      propertyNames.push_back(LINE_DEN_COEFF_KW+ossimString::toString(idx));
+   }
+   for(idx = 1; idx <= 20; ++idx)
+   {
+      propertyNames.push_back(SAMP_NUM_COEFF_KW+ossimString::toString(idx));
+   }
+   for(idx = 1; idx <= 20; ++idx)
+   {
+      propertyNames.push_back(SAMP_DEN_COEFF_KW+ossimString::toString(idx));
+   }
+}
+
+bool ossimNitfRpcBase::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   bool result = ossimNitfRegisteredTag::loadState(kwl, prefix);
+   const char* lookup;
+
+   if(!result) return result;
+   lookup = kwl.find(prefix, "SUCCESS");
+   if(lookup)
+   {
+        strcpy(theSuccess, lookup);
+   }
+   lookup = kwl.find(prefix, "ERR_BIAS");
+   if(lookup)
+   {
+        strcpy(theErrorBias, lookup); 
+   }
+   lookup = kwl.find(prefix, "ERR_RAND");
+   if(lookup)
+   {
+        strcpy(theErrRand, lookup); 
+   }
+   lookup = kwl.find(prefix, "LINE_OFF");
+   if(lookup)
+   {
+        strcpy(theLineOffset, lookup);
+   }
+   lookup = kwl.find(prefix, "SAMP_OFF");
+   if(lookup)
+   {
+        strcpy(theSampleOffset, lookup);
+   }
+   lookup = kwl.find(prefix, "LAT_OFF");
+   if(lookup)
+   {
+        strcpy(theGeodeticLatOffset, lookup); 
+   }
+   lookup = kwl.find(prefix, "LONG_OFF");
+   if(lookup)
+   {
+        strcpy(theGeodeticLonOffset, lookup); 
+   }
+   lookup = kwl.find(prefix, "HEIGHT_OFF");
+   if(lookup)
+   {
+        strcpy(theGeodeticHeightOffset, lookup);
+   }
+   lookup = kwl.find(prefix, "LINE_SCALE");
+   if(lookup)
+   {
+        strcpy(theLineScale, lookup);
+   }
+   lookup = kwl.find(prefix, "SAMP_SCALE");
+   if(lookup)
+   {
+        strcpy(theSampleScale, lookup);
+   }
+   lookup = kwl.find(prefix, "LAT_SCALE");
+   if(lookup)
+   {
+        strcpy(theGeodeticLatScale, lookup); 
+   }
+   lookup = kwl.find(prefix, "LONG_SCALE");
+   if(lookup)
+   {
+        strcpy(theGeodeticLonScale, lookup);
+   }
+   lookup = kwl.find(prefix, "HEIGHT_SCALE");
+   if(lookup)
+   {
+        strcpy(theGeodeticHeightScale, lookup);
+   }
+   for (ossim_uint32 i = 0; i < 20; ++i)
+   {
+       ossimString line_num_coeff = "LINE_NUM_COEFF_" + ossimString::toString(i);
+       lookup = kwl.find(prefix, line_num_coeff);
+       if(lookup)
+       {
+           theLineNumeratorCoefficient[i] = ossimString(lookup); //temp.substr(0,1) + "0." + temp.substr(1,6) + "E" + temp.substr(7,2);
+       }
+   }
+   for (ossim_uint32 i = 0; i < 20; ++i)
+   {
+        ossimString line_den_coeff = "LINE_DEN_COEFF_" + ossimString::toString(i);
+        lookup = kwl.find(prefix, line_den_coeff);
+        if(lookup)
+        {
+          theLineDenominatorCoefficient[i] = ossimString(lookup); //temp.substr(0,1) + "0." + temp.substr(1,6) + "E" + temp.substr(7,2);
+        }
+   }
+   for (ossim_uint32 i = 0; i < 20; ++i)
+   {
+        ossimString samp_num_coeff = "SAMP_NUM_COEFF_" + ossimString::toString(i);
+        lookup = kwl.find(prefix, samp_num_coeff);
+        if(lookup)
+        {
+          theSampleNumeratorCoefficient[i] = ossimString(lookup); //temp.substr(0,1) + "0." + temp.substr(1,6) + "E" + temp.substr(7,2);
+        }
+   }
+   for (ossim_uint32 i = 0; i < 20; ++i)
+   {
+        ossimString samp_den_coeff = "SAMP_DEN_COEFF_" + ossimString::toString(i);
+        lookup = kwl.find(prefix, samp_den_coeff);
+        if(lookup)
+        {
+          theSampleDenominatorCoefficient[i] = ossimString(lookup); //temp.substr(0,1) + "0." + temp.substr(1,6) + "E" + temp.substr(7,2);
+        }
+   }
+
+   return result;
+}
diff --git a/src/support_data/ossimNitfRpfTagFactory.cpp b/src/support_data/ossimNitfRpfTagFactory.cpp
new file mode 100644
index 0000000..e1e8e87
--- /dev/null
+++ b/src/support_data/ossimNitfRpfTagFactory.cpp
@@ -0,0 +1,54 @@
+//*******************************************************************
+//
+// LICENSE: LGPL  see top level LICENSE.txt
+// 
+// Author: Garrett Potts
+// 
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfRpfTagFactory.cpp 22875 2014-08-27 13:52:03Z dburken $
+#include <ossim/support_data/ossimNitfRpfTagFactory.h>
+#include <ossim/support_data/ossimRpfHeader.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+
+RTTI_DEF1(ossimNitfRpfTagFactory, "ossimNitfRpfTagFactory", ossimNitfTagFactory);
+
+static const ossimString REGISTERED_RPF_HEADER_TAG = "RPFHDR";
+static const ossimString REGISTERED_RPF_DES_TAG    = "RPFDES";
+
+static ossimTrace traceDebug = ossimTrace("ossimNitfRpfTagFactory:debug");
+
+ossimNitfRpfTagFactory::ossimNitfRpfTagFactory()
+{
+}
+
+ossimNitfRpfTagFactory::~ossimNitfRpfTagFactory()
+{
+}
+
+ossimNitfRpfTagFactory* ossimNitfRpfTagFactory::instance()
+{
+   static ossimNitfRpfTagFactory inst;
+   return &inst;
+}
+
+ossimRefPtr<ossimNitfRegisteredTag> ossimNitfRpfTagFactory::create(const ossimString &tagName)const
+{
+   ossimString temp(ossimString(tagName).trim().upcase());
+   
+   if(temp == REGISTERED_RPF_HEADER_TAG)
+   {
+      return new ossimRpfHeader;
+   }
+   if(temp == REGISTERED_RPF_DES_TAG)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "WARNING  ossimNitfRpfTagFactory::create: Reader for REGISTERED_RPF_DES_TAG not implemented yet" << std::endl;
+      }
+   }
+   
+   return 0;
+}
diff --git a/ossim/src/ossim/support_data/ossimNitfRsmecaTag.cpp b/src/support_data/ossimNitfRsmecaTag.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfRsmecaTag.cpp
rename to src/support_data/ossimNitfRsmecaTag.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfRsmidaTag.cpp b/src/support_data/ossimNitfRsmidaTag.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfRsmidaTag.cpp
rename to src/support_data/ossimNitfRsmidaTag.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfRsmpcaTag.cpp b/src/support_data/ossimNitfRsmpcaTag.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfRsmpcaTag.cpp
rename to src/support_data/ossimNitfRsmpcaTag.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfRsmpiaTag.cpp b/src/support_data/ossimNitfRsmpiaTag.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfRsmpiaTag.cpp
rename to src/support_data/ossimNitfRsmpiaTag.cpp
diff --git a/src/support_data/ossimNitfSensraTag.cpp b/src/support_data/ossimNitfSensraTag.cpp
new file mode 100644
index 0000000..489928f
--- /dev/null
+++ b/src/support_data/ossimNitfSensraTag.cpp
@@ -0,0 +1,444 @@
+//*******************************************************************
+
+// LICENSE: LGPL
+//
+// see top level LICENSE.txt
+// 
+// Author: Walt Bunch
+//
+// Description: Nitf support class for SENSRA - Sensor parameters extension.
+// 
+//********************************************************************
+// $Id: ossimNitfSensraTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <istream>
+#include <iomanip>
+#include <ossim/support_data/ossimNitfSensraTag.h>
+
+RTTI_DEF1(ossimNitfSensraTag, "ossimNitfSensraTag", ossimNitfRegisteredTag);
+
+
+ossimNitfSensraTag::ossimNitfSensraTag()
+   : ossimNitfRegisteredTag(std::string("SENSRA"), 132)
+{
+   clearFields();
+}
+
+ossimNitfSensraTag::~ossimNitfSensraTag()
+{
+}
+
+void ossimNitfSensraTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theRefRow, REF_ROW_SIZE);
+   in.read(theRefCol, REF_COL_SIZE);
+   in.read(theSensorModel, SENSOR_MODEL_SIZE);
+   in.read(theSensorMount, SENSOR_MOUNT_SIZE);
+   in.read(theSensorLoc, SENSOR_LOC_SIZE);
+   in.read(theSensorAltSrc, SENSOR_ALT_SRC_SIZE);
+   in.read(theSensorAlt, SENSOR_ALT_SIZE);
+   in.read(theSensorAltUnit, SENSOR_ALT_UNIT_SIZE);
+   in.read(theSensorAgl, SENSOR_AGL_SIZE);
+   in.read(theSensorPitch, SENSOR_PITCH_SIZE);
+   in.read(theSensorRoll, SENSOR_ROLL_SIZE);
+   in.read(theSensorYaw, SENSOR_YAW_SIZE);
+   in.read(thePlatformPitch, PLATFORM_PITCH_SIZE);
+   in.read(thePlatformRoll, PLATFORM_ROLL_SIZE);
+   in.read(thePlatformHdg, PLATFORM_HDG_SIZE);
+   in.read(theGroundSpdSrc, GROUND_SPD_SRC_SIZE);
+   in.read(theGroundSpeed, GROUND_SPEED_SIZE);
+   in.read(theGroundSpdUnit, GROUND_SPD_UNIT_SIZE);
+   in.read(theGroundTrack, GROUND_TRACK_SIZE);
+   in.read(theVerticalVel, VERTICAL_VEL_SIZE);
+   in.read(theVertVelUnit, VERT_VEL_UNIT_SIZE);
+   in.read(theSwathFrames, SWATH_FRAMES_SIZE);
+   in.read(theNSwaths, N_SWATHS_SIZE);
+   in.read(theSpotNum, SPOT_NUM_SIZE);
+}
+
+void ossimNitfSensraTag::writeStream(std::ostream& out)
+{
+   out.write(theRefRow, REF_ROW_SIZE);
+   out.write(theRefCol, REF_COL_SIZE);
+   out.write(theSensorModel, SENSOR_MODEL_SIZE);
+   out.write(theSensorMount, SENSOR_MOUNT_SIZE);
+   out.write(theSensorLoc, SENSOR_LOC_SIZE);
+   out.write(theSensorAltSrc, SENSOR_ALT_SRC_SIZE);
+   out.write(theSensorAlt, SENSOR_ALT_SIZE);
+   out.write(theSensorAltUnit, SENSOR_ALT_UNIT_SIZE);
+   out.write(theSensorAgl, SENSOR_AGL_SIZE);
+   out.write(theSensorPitch, SENSOR_PITCH_SIZE);
+   out.write(theSensorRoll, SENSOR_ROLL_SIZE);
+   out.write(theSensorYaw, SENSOR_YAW_SIZE);
+   out.write(thePlatformPitch, PLATFORM_PITCH_SIZE);
+   out.write(thePlatformRoll, PLATFORM_ROLL_SIZE);
+   out.write(thePlatformHdg, PLATFORM_HDG_SIZE);
+   out.write(theGroundSpdSrc, GROUND_SPD_SRC_SIZE);
+   out.write(theGroundSpeed, GROUND_SPEED_SIZE);
+   out.write(theGroundSpdUnit, GROUND_SPD_UNIT_SIZE);
+   out.write(theGroundTrack, GROUND_TRACK_SIZE);
+   out.write(theVerticalVel, VERTICAL_VEL_SIZE);
+   out.write(theVertVelUnit, VERT_VEL_UNIT_SIZE);
+   out.write(theSwathFrames, SWATH_FRAMES_SIZE);
+   out.write(theNSwaths, N_SWATHS_SIZE);
+   out.write(theSpotNum, SPOT_NUM_SIZE);
+}
+
+void ossimNitfSensraTag::clearFields()
+{
+   memset(theRefRow, ' ', REF_ROW_SIZE);
+   memset(theRefCol, ' ', REF_COL_SIZE);
+   memset(theSensorModel, ' ', SENSOR_MODEL_SIZE);
+   memset(theSensorMount, ' ', SENSOR_MOUNT_SIZE);
+   memset(theSensorLoc, ' ', SENSOR_LOC_SIZE);
+   memset(theSensorAltSrc, ' ', SENSOR_ALT_SRC_SIZE);
+   memset(theSensorAlt, ' ', SENSOR_ALT_SIZE);
+   memset(theSensorAltUnit, ' ', SENSOR_ALT_UNIT_SIZE);
+   memset(theSensorAgl, ' ', SENSOR_AGL_SIZE);
+   memset(theSensorPitch, ' ', SENSOR_PITCH_SIZE);
+   memset(theSensorRoll, ' ', SENSOR_ROLL_SIZE);
+   memset(theSensorYaw, ' ', SENSOR_YAW_SIZE);
+   memset(thePlatformPitch, ' ', PLATFORM_PITCH_SIZE);
+   memset(thePlatformRoll, ' ', PLATFORM_ROLL_SIZE);
+   memset(thePlatformHdg, ' ', PLATFORM_HDG_SIZE);
+   memset(theGroundSpdSrc, ' ', GROUND_SPD_SRC_SIZE);
+   memset(theGroundSpeed, ' ', GROUND_SPEED_SIZE);
+   memset(theGroundSpdUnit, ' ', GROUND_SPD_UNIT_SIZE);
+   memset(theGroundTrack, ' ', GROUND_TRACK_SIZE);
+   memset(theVerticalVel, ' ', VERTICAL_VEL_SIZE);
+   memset(theVertVelUnit, ' ', VERT_VEL_UNIT_SIZE);
+   memset(theSwathFrames, ' ', SWATH_FRAMES_SIZE);
+   memset(theNSwaths, ' ', N_SWATHS_SIZE);
+   memset(theSpotNum, ' ', SPOT_NUM_SIZE);
+
+   theRefRow[REF_ROW_SIZE] = '\0';
+   theRefCol[REF_COL_SIZE] = '\0';
+   theSensorModel[SENSOR_MODEL_SIZE] = '\0';
+   theSensorMount[SENSOR_MOUNT_SIZE] = '\0';
+   theSensorLoc[SENSOR_LOC_SIZE] = '\0';
+   theSensorAltSrc[SENSOR_ALT_SRC_SIZE] = '\0';
+   theSensorAlt[SENSOR_ALT_SIZE] = '\0';
+   theSensorAltUnit[SENSOR_ALT_UNIT_SIZE] = '\0';
+   theSensorAgl[SENSOR_AGL_SIZE] = '\0';
+   theSensorPitch[SENSOR_PITCH_SIZE] = '\0';
+   theSensorRoll[SENSOR_ROLL_SIZE] = '\0';
+   theSensorYaw[SENSOR_YAW_SIZE] = '\0';
+   thePlatformPitch[PLATFORM_PITCH_SIZE] = '\0';
+   thePlatformRoll[PLATFORM_ROLL_SIZE] = '\0';
+   thePlatformHdg[PLATFORM_HDG_SIZE] = '\0';
+   theGroundSpdSrc[GROUND_SPD_SRC_SIZE] = '\0';
+   theGroundSpeed[GROUND_SPEED_SIZE] = '\0';
+   theGroundSpdUnit[GROUND_SPD_UNIT_SIZE] = '\0';
+   theGroundTrack[GROUND_TRACK_SIZE] = '\0';
+   theVerticalVel[VERTICAL_VEL_SIZE] = '\0';
+   theVertVelUnit[VERT_VEL_UNIT_SIZE] = '\0';
+   theSwathFrames[SWATH_FRAMES_SIZE] = '\0';
+   theNSwaths[N_SWATHS_SIZE] = '\0';
+   theSpotNum[SPOT_NUM_SIZE] = '\0';
+}
+
+std::ostream& ossimNitfSensraTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << std::setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
+       << pfx << std::setw(24) << "REFROW:" << theRefRow << "\n"
+       << pfx << std::setw(24) << "REFCOL:" << theRefCol << "\n"
+       << pfx << std::setw(24) << "SENSORMODEL:" << theSensorModel<< "\n"
+       << pfx << std::setw(24) << "SENSORMOUNT:" << theSensorMount << "\n"
+       << pfx << std::setw(24) << "SENSORLOC:" << theSensorLoc << "\n"
+       << pfx << std::setw(24) << "SENSORALTSRC:" << theSensorAltSrc<< "\n"
+       << pfx << std::setw(24) << "SENSORALT:" << theSensorAlt << "\n"
+       << pfx << std::setw(24) << "SENSORALTUNIT:" << theSensorAltUnit << "\n"
+       << pfx << std::setw(24) << "SENSORAGL:" << theSensorAgl << "\n"
+       << pfx << std::setw(24) << "SENSORPITCH:" << theSensorPitch << "\n"
+       << pfx << std::setw(24) << "SENSORROLL:" << theSensorRoll<< "\n"
+       << pfx << std::setw(24) << "SENSORYAW:" << theSensorYaw << "\n"
+       << pfx << std::setw(24) << "PLATFORMPITCH:" << thePlatformPitch << "\n"
+       << pfx << std::setw(24) << "PLATFORMROLL:" << thePlatformRoll << "\n"
+       << pfx << std::setw(24) << "PLATFORMHDG:" << thePlatformHdg << "\n"
+       << pfx << std::setw(24) << "GROUNDSPDSRC:" << theGroundSpdSrc << "\n"
+       << pfx << std::setw(24) << "GROUNDSPEED:" << theGroundSpeed << "\n"
+       << pfx << std::setw(24) << "GROUNDSPDUNIT:" << theGroundSpdUnit << "\n"
+       << pfx << std::setw(24) << "GROUNDTRACK:" << theGroundTrack << "\n"
+       << pfx << std::setw(24) << "VERTICALVEL:" << theVerticalVel<< "\n"
+       << pfx << std::setw(24) << "VERTVELUNIT:" << theVertVelUnit << "\n"
+       << pfx << std::setw(24) << "SWATHFRAMES:" << theSwathFrames<< "\n"
+       << pfx << std::setw(24) << "NSWATHS:" << theNSwaths << "\n"
+       << pfx << std::setw(24) << "SPOTNUM:" << theSpotNum << "\n";
+   
+   return out;
+}
+
+ossimString ossimNitfSensraTag::getRefRow()const
+{
+   return theRefRow;
+}
+
+void ossimNitfSensraTag::setRefRow(ossimString refRow)
+{
+   memset(theRefRow, ' ', REF_ROW_SIZE);
+   memcpy(theRefRow, refRow.c_str(), std::min((size_t)REF_ROW_SIZE, refRow.length()));
+}
+
+ossimString ossimNitfSensraTag::getRefCol()const
+{
+   return theRefCol;
+}
+
+void ossimNitfSensraTag::setRefCol(ossimString refCol)
+{
+   memset(theRefCol, ' ', REF_COL_SIZE);
+   memcpy(theRefCol, refCol.c_str(), std::min((size_t)REF_COL_SIZE, refCol.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorModel()const
+{
+   return theSensorModel;
+}
+
+void ossimNitfSensraTag::setSensorModel(ossimString sensorModel)
+{
+   memset(theSensorModel, ' ', SENSOR_MODEL_SIZE);
+   memcpy(theSensorModel, sensorModel.c_str(), std::min((size_t)SENSOR_MODEL_SIZE, sensorModel.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorMount()const
+{
+   return theSensorMount;
+}
+
+void ossimNitfSensraTag::setSensorMount(ossimString sensorMount)
+{
+   memset(theSensorMount, ' ', SENSOR_MOUNT_SIZE);
+   memcpy(theSensorMount, sensorMount.c_str(), std::min((size_t)SENSOR_MOUNT_SIZE, sensorMount.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorLoc()const
+{
+   return theSensorLoc;
+}
+
+void ossimNitfSensraTag::setSensorLoc(ossimString sensorLoc)
+{
+   memset(theSensorLoc, ' ', SENSOR_LOC_SIZE);
+   memcpy(theSensorLoc, sensorLoc.c_str(), std::min((size_t)SENSOR_LOC_SIZE, sensorLoc.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorAltSrc()const
+{
+   return theSensorAltSrc;
+}
+
+void ossimNitfSensraTag::setSensorAltSrc(ossimString sensorAltSrc)
+{
+   memset(theSensorAltSrc, ' ', SENSOR_ALT_SRC_SIZE);
+   memcpy(theSensorAltSrc, sensorAltSrc.c_str(), std::min((size_t)SENSOR_ALT_SRC_SIZE, sensorAltSrc.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorAlt()const
+{
+   return theSensorAlt;
+}
+
+void ossimNitfSensraTag::setSensorAlt(ossimString sensorAlt)
+{
+   memset(theSensorAlt, ' ', SENSOR_ALT_SIZE);
+   memcpy(theSensorAlt, sensorAlt.c_str(), std::min((size_t)SENSOR_ALT_SIZE, sensorAlt.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorAltUnit()const
+{
+   return theSensorAltUnit;
+}
+
+void ossimNitfSensraTag::setSensorAltUnit(ossimString sensorAltUnit)
+{
+   memset(theSensorAltUnit, ' ', SENSOR_ALT_UNIT_SIZE);
+   memcpy(theSensorAltUnit, sensorAltUnit.c_str(), std::min((size_t)SENSOR_ALT_UNIT_SIZE, sensorAltUnit.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorAgl()const
+{
+   return theSensorAgl;
+}
+
+void ossimNitfSensraTag::setSensorAgl(ossimString sensorAgl)
+{
+   memset(theSensorAgl, ' ', SENSOR_AGL_SIZE);
+   memcpy(theSensorAgl, sensorAgl.c_str(), std::min((size_t)SENSOR_AGL_SIZE, sensorAgl.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorPitch()const
+{
+   return theSensorPitch;
+}
+
+void ossimNitfSensraTag::setSensorPitch(ossimString sensorPitch)
+{
+   memset(theSensorPitch, ' ', SENSOR_PITCH_SIZE);
+   memcpy(theSensorPitch, sensorPitch.c_str(), std::min((size_t)SENSOR_PITCH_SIZE, sensorPitch.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorRoll()const
+{
+   return theSensorRoll;
+}
+
+void ossimNitfSensraTag::setSensorRoll(ossimString sensorRoll)
+{
+   memset(theSensorRoll, ' ', SENSOR_ROLL_SIZE);
+   memcpy(theSensorRoll, sensorRoll.c_str(), std::min((size_t)SENSOR_ROLL_SIZE, sensorRoll.length()));
+}
+
+ossimString ossimNitfSensraTag::getSensorYaw()const
+{
+   return theSensorYaw;
+}
+
+void ossimNitfSensraTag::setSensorYaw(ossimString sensorYaw)
+{
+   memset(theSensorYaw, ' ', SENSOR_YAW_SIZE);
+   memcpy(theSensorYaw, sensorYaw.c_str(), std::min((size_t)SENSOR_YAW_SIZE, sensorYaw.length()));
+}
+
+ossimString ossimNitfSensraTag::getPlatformPitch()const
+{
+   return thePlatformPitch;
+}
+
+void ossimNitfSensraTag::setPlatformPitch(ossimString platformPitch)
+{
+   memset(thePlatformPitch, ' ', PLATFORM_PITCH_SIZE);
+   memcpy(thePlatformPitch, platformPitch.c_str(), std::min((size_t)PLATFORM_PITCH_SIZE, platformPitch.length()));
+}
+
+ossimString ossimNitfSensraTag::getPlatformRoll()const
+{
+   return thePlatformRoll;
+}
+
+void ossimNitfSensraTag::setPlatformRoll(ossimString platformRoll)
+{
+   memset(thePlatformRoll, ' ', PLATFORM_ROLL_SIZE);
+   memcpy(thePlatformRoll, platformRoll.c_str(), std::min((size_t)PLATFORM_ROLL_SIZE, platformRoll.length()));
+}
+
+ossimString ossimNitfSensraTag::getPlatformHdg()const
+{
+   return thePlatformHdg;
+}
+
+void ossimNitfSensraTag::setPlatformHdg(ossimString platformHdg)
+{
+   memset(thePlatformHdg, ' ', PLATFORM_HDG_SIZE);
+   memcpy(thePlatformHdg, platformHdg.c_str(), std::min((size_t)PLATFORM_HDG_SIZE, platformHdg.length()));
+}
+
+ossimString ossimNitfSensraTag::getGroundSpdSrc()const
+{
+   return theGroundSpdSrc;
+}
+
+void ossimNitfSensraTag::setGroundSpdSrc(ossimString groundSpdSrc)
+{
+   memset(theGroundSpdSrc, ' ', GROUND_SPD_SRC_SIZE);
+   memcpy(theGroundSpdSrc, groundSpdSrc.c_str(), std::min((size_t)GROUND_SPD_SRC_SIZE, groundSpdSrc.length()));
+}
+
+ossimString ossimNitfSensraTag::getGroundSpeed()const
+{
+   return theGroundSpeed;
+}
+
+void ossimNitfSensraTag::setGroundSpeed(ossimString groundSpeed)
+{
+   memset(theGroundSpeed, ' ', GROUND_SPEED_SIZE);
+   memcpy(theGroundSpeed, groundSpeed.c_str(), std::min((size_t)GROUND_SPEED_SIZE, groundSpeed.length()));
+}
+
+ossimString ossimNitfSensraTag::getGroundSpdUnit()const
+{
+   return theGroundSpdUnit;
+}
+
+void ossimNitfSensraTag::setGroundSpdUnit(ossimString groundSpdUnit)
+{
+   memset(theGroundSpdUnit, ' ', GROUND_SPD_UNIT_SIZE);
+   memcpy(theGroundSpdUnit, groundSpdUnit.c_str(), std::min((size_t)GROUND_SPD_UNIT_SIZE, groundSpdUnit.length()));
+}
+
+ossimString ossimNitfSensraTag::getGroundTrack()const
+{
+   return theGroundTrack;
+}
+
+void ossimNitfSensraTag::setGroundTrack(ossimString groundTrack)
+{
+   memset(theGroundTrack, ' ', GROUND_TRACK_SIZE);
+   memcpy(theGroundTrack, groundTrack.c_str(), std::min((size_t)GROUND_TRACK_SIZE, groundTrack.length()));
+}
+
+ossimString ossimNitfSensraTag::getVerticalVel()const
+{
+   return theVerticalVel;
+}
+
+void ossimNitfSensraTag::setVerticalVel(ossimString verticalVel)
+{
+   memset(theVerticalVel, ' ', VERTICAL_VEL_SIZE);
+   memcpy(theVerticalVel, verticalVel.c_str(), std::min((size_t)VERTICAL_VEL_SIZE, verticalVel.length()));
+}
+
+ossimString ossimNitfSensraTag::getVertVelUnit()const
+{
+   return theVertVelUnit;
+}
+
+void ossimNitfSensraTag::setVertVelUnit(ossimString vertVelUnit)
+{
+   memset(theVertVelUnit, ' ', VERT_VEL_UNIT_SIZE);
+   memcpy(theVertVelUnit, vertVelUnit.c_str(), std::min((size_t)VERT_VEL_UNIT_SIZE, vertVelUnit.length()));
+}
+
+ossimString ossimNitfSensraTag::getSwathFrames()const
+{
+   return theSwathFrames;
+}
+
+void ossimNitfSensraTag::setSwathFrames(ossimString swathFrames)
+{
+   memset(theSwathFrames, ' ', SWATH_FRAMES_SIZE);
+   memcpy(theSwathFrames, swathFrames.c_str(), std::min((size_t)SWATH_FRAMES_SIZE, swathFrames.length()));
+}
+
+ossimString ossimNitfSensraTag::getNSwaths()const
+{
+   return theNSwaths;
+}
+
+void ossimNitfSensraTag::setNSwaths(ossimString nSwaths)
+{
+   memset(theNSwaths, ' ', N_SWATHS_SIZE);
+   memcpy(theNSwaths, nSwaths.c_str(), std::min((size_t)N_SWATHS_SIZE, nSwaths.length()));
+}
+
+ossimString ossimNitfSensraTag::getSpotNum()const
+{
+   return theSpotNum;
+}
+
+void ossimNitfSensraTag::setSpotNum(ossimString spotNum)
+{
+   memset(theSpotNum, ' ', SPOT_NUM_SIZE);
+   memcpy(theSpotNum, spotNum.c_str(), std::min((size_t)SPOT_NUM_SIZE, spotNum.length()));
+}
+
diff --git a/src/support_data/ossimNitfStdidcTag.cpp b/src/support_data/ossimNitfStdidcTag.cpp
new file mode 100644
index 0000000..6802bcf
--- /dev/null
+++ b/src/support_data/ossimNitfStdidcTag.cpp
@@ -0,0 +1,468 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author:  Walt Bunch
+// 
+// Description:   NITF support data class for STDIDC - Standard ID extension.
+//
+// See:  STDI-000_v2.1 Table 7-3 for detailed description.
+// 
+//********************************************************************
+// $Id: ossimNitfStdidcTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <iostream>
+#include <iomanip>
+#include <ossim/support_data/ossimNitfStdidcTag.h>
+#include <ossim/base/ossimStringProperty.h>
+
+RTTI_DEF1(ossimNitfStdidcTag, "ossimNitfStdidcTag", ossimNitfRegisteredTag);
+static const ossimString ACQDATE_KW = "ACQDATE";
+static const ossimString MISSION_KW = "MISSION";
+static const ossimString PASS_KW = "PASS";
+static const ossimString OPNUM_KW = "OPNUM";
+static const ossimString STARTSEGMENT_KW = "STARTSEGMENT";
+static const ossimString REPRONUM_KW = "REPRONUM";
+static const ossimString REPLAYREGEN_KW = "REPLAYREGEN";
+static const ossimString BLANKFILL_KW = "BLANKFILL";
+static const ossimString STARTCOLUMN_KW = "STARTCOLUMN";
+static const ossimString STARTROW_KW = "STARTROW";
+static const ossimString ENDSEGMENT_KW = "ENDSEGMENT";
+static const ossimString ENDCOLUMN_KW = "ENDCOLUMN";
+static const ossimString ENDROW_KW = "ENDROW";
+static const ossimString COUNTRY_KW = "COUNTRY";
+static const ossimString WAC_KW = "WAC";
+static const ossimString LOCATION_KW = "LOCATION";
+
+
+ossimNitfStdidcTag::ossimNitfStdidcTag()
+   : ossimNitfRegisteredTag(std::string("STDIDC"), 89)
+{
+   clearFields();
+}
+
+ossimNitfStdidcTag::~ossimNitfStdidcTag()
+{
+}
+
+void ossimNitfStdidcTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theAcqDate,      ACQ_DATE_SIZE);
+   in.read(theMission,      MISSION_SIZE);
+   in.read(thePass,         PASS_SIZE);
+   in.read(theOpNum,        OP_NUM_SIZE);
+   in.read(theStartSegment, START_SEGMENT_SIZE);
+   in.read(theReproNum,     REPRO_NUM_SIZE);
+   in.read(theReplayRegen,  REPLAY_REGEN_SIZE);
+   in.read(theBlankFill,    BLANK_FILL_SIZE);
+   in.read(theStartColumn,  START_COLUMN_SIZE);
+   in.read(theStartRow,     START_ROW_SIZE);
+   in.read(theEndSegment,   END_SEGMENT_SIZE);
+   in.read(theEndColumn,    END_COLUMN_SIZE);
+   in.read(theEndRow,       END_ROW_SIZE);
+   in.read(theCountry,      COUNTRY_SIZE);
+   in.read(theWac,          WAC_SIZE);
+   in.read(theLocation,     LOCATION_SIZE);
+   in.read(theField17,      FIELD17_SIZE);
+   in.read(theField18,      FIELD18_SIZE);
+}
+
+void ossimNitfStdidcTag::writeStream(std::ostream& out)
+{
+   out.write(theAcqDate,      ACQ_DATE_SIZE);
+   out.write(theMission,      MISSION_SIZE);
+   out.write(thePass,         PASS_SIZE);
+   out.write(theOpNum,        OP_NUM_SIZE);
+   out.write(theStartSegment, START_SEGMENT_SIZE);
+   out.write(theReproNum,     REPRO_NUM_SIZE);
+   out.write(theReplayRegen,  REPLAY_REGEN_SIZE);
+   out.write(theBlankFill,    BLANK_FILL_SIZE);
+   out.write(theStartColumn,  START_COLUMN_SIZE);
+   out.write(theStartRow,     START_ROW_SIZE);
+   out.write(theEndSegment,   END_SEGMENT_SIZE);
+   out.write(theEndColumn,    END_COLUMN_SIZE);
+   out.write(theEndRow,       END_ROW_SIZE);
+   out.write(theCountry,      COUNTRY_SIZE);
+   out.write(theWac,          WAC_SIZE);
+   out.write(theLocation,     LOCATION_SIZE);
+   out.write(theField17,      FIELD17_SIZE);
+   out.write(theField18,      FIELD18_SIZE);
+}
+
+void ossimNitfStdidcTag::clearFields()
+{
+   memset(theAcqDate,      ' ', ACQ_DATE_SIZE);
+   memset(theMission,      ' ', MISSION_SIZE);
+   memset(thePass,         ' ', PASS_SIZE);
+   memset(theOpNum,        ' ', OP_NUM_SIZE);
+   memset(theStartSegment, ' ', START_SEGMENT_SIZE);
+   memset(theReproNum,     ' ', REPRO_NUM_SIZE);
+   memset(theReplayRegen,  ' ', REPLAY_REGEN_SIZE);
+   memset(theBlankFill,    ' ', BLANK_FILL_SIZE);
+   memset(theStartColumn,  ' ', START_COLUMN_SIZE);
+   memset(theStartRow,     ' ', START_ROW_SIZE);
+   memset(theEndSegment,   ' ', END_SEGMENT_SIZE);
+   memset(theEndColumn,    ' ', END_COLUMN_SIZE);
+   memset(theEndRow,       ' ', END_ROW_SIZE);
+   memset(theCountry,      ' ', COUNTRY_SIZE);
+   memset(theWac,          ' ', WAC_SIZE);
+   memset(theLocation,     ' ', LOCATION_SIZE);
+   memset(theField17,      ' ', FIELD17_SIZE);
+   memset(theField18,      ' ', FIELD18_SIZE);
+
+   theAcqDate[ACQ_DATE_SIZE]           = '\0';
+   theMission[MISSION_SIZE]            = '\0';
+   thePass[PASS_SIZE]                  = '\0';
+   theOpNum[OP_NUM_SIZE]               = '\0';
+   theStartSegment[START_SEGMENT_SIZE] = '\0';
+   theReproNum[REPRO_NUM_SIZE]         = '\0';
+   theReplayRegen[REPLAY_REGEN_SIZE]   = '\0';
+   theBlankFill[BLANK_FILL_SIZE]       = '\0';
+   theStartColumn[START_COLUMN_SIZE]   = '\0';
+   theStartRow[START_ROW_SIZE]         = '\0';
+   theEndSegment[END_SEGMENT_SIZE]     = '\0';
+   theEndColumn[END_COLUMN_SIZE]       = '\0';
+   theEndRow[END_ROW_SIZE]             = '\0';
+   theCountry[COUNTRY_SIZE]            = '\0';
+   theWac[WAC_SIZE]                    = '\0';
+   theLocation[LOCATION_SIZE]          = '\0';
+   theField17[FIELD17_SIZE]            = '\0';
+   theField18[FIELD18_SIZE]            = '\0';
+}
+
+ossimString ossimNitfStdidcTag::getAcqDate()const
+{
+  return ossimString(theAcqDate);
+}
+
+void ossimNitfStdidcTag::setAcqDate(ossimString acqDate)
+{
+   memset(theAcqDate, ' ', ACQ_DATE_SIZE);
+   memcpy(theAcqDate, acqDate.c_str(), std::min((size_t)ACQ_DATE_SIZE, acqDate.length()));
+}
+
+ossimString ossimNitfStdidcTag::getMission()const
+{
+  return ossimString(theMission);
+}
+
+void ossimNitfStdidcTag::setMission(ossimString mission)
+{
+   memset(theMission, ' ', MISSION_SIZE);
+   memcpy(theMission, mission.c_str(), std::min((size_t)MISSION_SIZE, mission.length()));
+}
+
+ossimString ossimNitfStdidcTag::getPass()const
+{
+  return ossimString(thePass);
+}
+
+void ossimNitfStdidcTag::setPass(ossimString pass)
+{
+   memset(thePass, ' ', PASS_SIZE);
+   memcpy(thePass, pass.c_str(), std::min((size_t)PASS_SIZE, pass.length()));
+}
+
+ossimString ossimNitfStdidcTag::getOpNum()const
+{
+  return ossimString(theOpNum);
+}
+
+void ossimNitfStdidcTag::setOpNum(ossimString opNum) 
+{
+   memset(theOpNum, ' ', OP_NUM_SIZE);
+   memcpy(theOpNum, opNum.c_str(), std::min((size_t)OP_NUM_SIZE, opNum.length()));
+}
+
+ossimString ossimNitfStdidcTag::getStartSegment()const
+{
+  return ossimString(theStartSegment);
+}
+
+void ossimNitfStdidcTag::setStartSegment(ossimString startSegment) 
+{
+   memset(theStartSegment, ' ', START_SEGMENT_SIZE);
+   memcpy(theStartSegment, startSegment.c_str(), std::min((size_t)START_SEGMENT_SIZE, startSegment.length()));
+}
+
+ossimString ossimNitfStdidcTag::getReproNum()const
+{
+  return ossimString(theReproNum);
+}
+
+void ossimNitfStdidcTag::setReproNum(ossimString reproNum) 
+{
+   memset(theReproNum, ' ', REPRO_NUM_SIZE);
+   memcpy(theReproNum, reproNum.c_str(), std::min((size_t)REPRO_NUM_SIZE, reproNum.length()));
+}
+
+ossimString ossimNitfStdidcTag::getReplayRegen()const
+{
+  return ossimString(theReplayRegen);
+}
+
+void ossimNitfStdidcTag::setReplayRegen(ossimString replayRegen) 
+{
+   memset(theReplayRegen, ' ', REPLAY_REGEN_SIZE);
+   memcpy(theReplayRegen, replayRegen.c_str(), std::min((size_t)REPLAY_REGEN_SIZE, replayRegen.length()));
+}
+
+ossimString ossimNitfStdidcTag::getBlankFill()const
+{
+  return ossimString(theBlankFill);
+}
+
+void ossimNitfStdidcTag::setBlankFill(ossimString blankFill) 
+{
+   memset(theBlankFill, ' ', BLANK_FILL_SIZE);
+   memcpy(theBlankFill, blankFill.c_str(), std::min((size_t)BLANK_FILL_SIZE, blankFill.length()));
+}
+
+ossimString ossimNitfStdidcTag::getStartColumn()const
+{
+  return ossimString(theStartColumn);
+}
+
+void ossimNitfStdidcTag::setStartColumn(ossimString startColumn) 
+{
+   memset(theStartColumn, ' ', START_COLUMN_SIZE);
+   memcpy(theStartColumn, startColumn.c_str(), std::min((size_t)START_COLUMN_SIZE, startColumn.length()));
+}
+
+ossimString ossimNitfStdidcTag::getStartRow()const
+{
+  return ossimString(theStartRow);
+}
+
+void ossimNitfStdidcTag::setStartRow(ossimString startRow) 
+{
+   memset(theStartRow, ' ', START_ROW_SIZE);
+   memcpy(theStartRow, startRow.c_str(), std::min((size_t)START_ROW_SIZE, startRow.length()));
+}
+
+ossimString ossimNitfStdidcTag::getEndSegment()const
+{
+  return ossimString(theEndSegment);
+}
+
+void ossimNitfStdidcTag::setEndSegment(ossimString endSegment) 
+{
+   memset(theEndSegment, ' ', END_SEGMENT_SIZE);
+   memcpy(theEndSegment, endSegment.c_str(), std::min((size_t)END_SEGMENT_SIZE, endSegment.length()));
+}
+
+ossimString ossimNitfStdidcTag::getEndColumn()const
+{
+  return ossimString(theEndColumn);
+}
+
+void ossimNitfStdidcTag::setEndColumn(ossimString endColumn) 
+{
+   memset(theEndColumn, ' ', END_COLUMN_SIZE);
+   memcpy(theEndColumn, endColumn.c_str(), std::min((size_t)END_COLUMN_SIZE, endColumn.length()));
+}
+
+ossimString ossimNitfStdidcTag::getEndRow()const
+{
+  return ossimString(theEndRow);
+}
+
+void ossimNitfStdidcTag::setEndRow(ossimString endRow) 
+{
+   memset(theEndRow, ' ', END_ROW_SIZE);
+   memcpy(theEndRow, endRow.c_str(), std::min((size_t)END_ROW_SIZE, endRow.length()));
+}
+
+ossimString ossimNitfStdidcTag::getCountry()const
+{
+  return ossimString(theCountry);
+}
+
+void ossimNitfStdidcTag::setCountry(ossimString country) 
+{
+   memset(theCountry, ' ', COUNTRY_SIZE);
+   memcpy(theCountry, country.c_str(), std::min((size_t)COUNTRY_SIZE, country.length()));
+}
+
+ossimString ossimNitfStdidcTag::getWac()const
+{
+  return ossimString(theWac);
+}
+
+void ossimNitfStdidcTag::setWac(ossimString wac) 
+{
+   memset(theWac, ' ', WAC_SIZE);
+   memcpy(theWac, wac.c_str(), std::min((size_t)WAC_SIZE, wac.length()));
+}
+
+ossimString ossimNitfStdidcTag::getLocation()const
+{
+  return ossimString(theLocation);
+}
+
+void ossimNitfStdidcTag::setLocation(ossimString location) 
+{
+   memset(theLocation, ' ', LOCATION_SIZE);
+   memcpy(theLocation, location.c_str(), std::min((size_t)LOCATION_SIZE, location.length()));
+}
+
+ossimString ossimNitfStdidcTag::getField17()const
+{
+  return ossimString(theField17);
+}
+
+void ossimNitfStdidcTag::setField17(ossimString field17) 
+{
+   memset(theField17, ' ', FIELD17_SIZE);
+   memcpy(theField17, field17.c_str(), std::min((size_t)FIELD17_SIZE, field17.length()));
+}
+
+ossimString ossimNitfStdidcTag::getField18()const
+{
+  return ossimString(theField18);
+}
+
+void ossimNitfStdidcTag::setField18(ossimString field18) 
+{
+   memset(theField18, ' ', FIELD18_SIZE);
+   memcpy(theField18, field18.c_str(), std::min((size_t)FIELD18_SIZE, field18.length()));
+}
+
+std::ostream& ossimNitfStdidcTag::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "ACQDATE:"      << theAcqDate << "\n"
+       << pfx << std::setw(24) << "MISSION:"      << theMission << "\n"
+       << pfx << std::setw(24) << "PASS:"         << thePass << "\n"
+       << pfx << std::setw(24) << "OPNUM:"        << theOpNum  << "\n"
+       << pfx << std::setw(24) << "STARTSEGMENT:" << theStartSegment << "\n"
+       << pfx << std::setw(24) << "REPRONUM:"     << theReproNum << "\n"
+       << pfx << std::setw(24) << "REPLAYREGEN:"  << theReplayRegen << "\n"
+       << pfx << std::setw(24) << "STARTCOLUMN:"  << theStartColumn << "\n"
+       << pfx << std::setw(24) << "STARTROW:"     << theStartRow << "\n"
+       << pfx << std::setw(24) << "ENDSEGMENT:"   << theEndSegment << "\n"
+       << pfx << std::setw(24) << "ENDCOLUMN:"    << theEndColumn << "\n"
+       << pfx << std::setw(24) << "ENDROW:"       << theEndRow << "\n"
+       << pfx << std::setw(24) << "COUNTRY:"      << theCountry << "\n"
+       << pfx << std::setw(24) << "WAC:"          << theWac << "\n"
+       << pfx << std::setw(24) << "LOCATION:"     << theLocation << "\n";
+
+   return out;
+}
+
+void ossimNitfStdidcTag::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimNitfRegisteredTag::setProperty(property);
+}
+
+ossimRefPtr<ossimProperty> ossimNitfStdidcTag::getProperty(const ossimString& name)const
+{
+   ossimProperty* result = 0;
+   
+   if(name == ACQDATE_KW)
+   {
+      result = new ossimStringProperty(name, theAcqDate);
+   }
+   else if(name == MISSION_KW)
+   {
+      result = new ossimStringProperty(name, theMission);
+   }
+   else if(name == PASS_KW)
+   {
+      result = new ossimStringProperty(name, thePass);
+   }
+   else if(name == OPNUM_KW)
+   {
+      result = new ossimStringProperty(name, theOpNum);
+   }
+   else if(name == STARTSEGMENT_KW)
+   {
+      result = new ossimStringProperty(name, theStartSegment);
+   }
+   else if(name == REPRONUM_KW)
+   {
+      result = new ossimStringProperty(name, theReproNum);
+   }
+   else if(name == REPLAYREGEN_KW)
+   {
+      result = new ossimStringProperty(name, theReplayRegen);
+   }
+   else if(name == BLANKFILL_KW)
+   {
+      result = new ossimStringProperty(name, theBlankFill);
+   }
+   else if(name == STARTCOLUMN_KW)
+   {
+      result = new ossimStringProperty(name, theStartColumn);
+   }
+   else if(name == STARTROW_KW)
+   {
+      result = new ossimStringProperty(name, theStartRow);
+   }
+   else if(name == ENDSEGMENT_KW)
+   {
+      result = new ossimStringProperty(name, theEndSegment);
+   }
+   else if(name == ENDCOLUMN_KW)
+   {
+      result = new ossimStringProperty(name, theEndColumn);
+   }
+   else if(name == ENDROW_KW)
+   {
+      result = new ossimStringProperty(name, theEndRow);
+   }
+   else if(name == COUNTRY_KW)
+   {
+      result = new ossimStringProperty(name,theCountry );
+   }
+   else if(name == WAC_KW)
+   {
+      result = new ossimStringProperty(name, theWac);
+   }
+   else if(name == LOCATION_KW)
+   {
+      result = new ossimStringProperty(name, theLocation);
+   }
+   else
+   {
+      return ossimNitfRegisteredTag::getProperty(name);
+   }
+
+   return result;
+}
+
+void ossimNitfStdidcTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(ACQDATE_KW);
+   propertyNames.push_back(MISSION_KW);
+   propertyNames.push_back(PASS_KW);
+   propertyNames.push_back(OPNUM_KW);
+   propertyNames.push_back(STARTSEGMENT_KW);
+   propertyNames.push_back(REPRONUM_KW);
+   propertyNames.push_back(REPLAYREGEN_KW);
+   propertyNames.push_back(BLANKFILL_KW);
+   propertyNames.push_back(STARTCOLUMN_KW);
+   propertyNames.push_back(STARTROW_KW);
+   propertyNames.push_back(ENDSEGMENT_KW);
+   propertyNames.push_back(ENDCOLUMN_KW);
+   propertyNames.push_back(ENDROW_KW);
+   propertyNames.push_back(COUNTRY_KW);
+   propertyNames.push_back(WAC_KW);
+   propertyNames.push_back(LOCATION_KW);
+   
+}
+
diff --git a/src/support_data/ossimNitfStreobTag.cpp b/src/support_data/ossimNitfStreobTag.cpp
new file mode 100644
index 0000000..e62c7a2
--- /dev/null
+++ b/src/support_data/ossimNitfStreobTag.cpp
@@ -0,0 +1,97 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+//
+// Description: STREOB tag class definition.
+//
+// Dataset Indentification TRE.
+//
+//----------------------------------------------------------------------------
+// $Id
+
+#include <cstring>
+#include <istream>
+#include <iostream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfStreobTag.h>
+
+
+RTTI_DEF1(ossimNitfStreobTag, "ossimNitfStreobTag", ossimNitfRegisteredTag);
+
+ossimNitfStreobTag::ossimNitfStreobTag()
+   : ossimNitfRegisteredTag(std::string("STREOB"), 94)
+{
+   clearFields();
+}
+
+ossimNitfStreobTag::~ossimNitfStreobTag()
+{
+}
+
+void ossimNitfStreobTag::parseStream(std::istream& in)
+{
+   clearFields();
+
+   in.read(m_stdId, 60);
+   in.read(n_nMates, 1);
+   in.read(m_mateInstance, 1);
+   in.read(m_bConv, 5);
+   in.read(m_eConv, 5);
+   in.read(m_bAsym, 5);
+   in.read(m_eAsym, 5);
+   in.read(m_bBie, 6);
+   in.read(m_eBie, 6);
+}
+
+void ossimNitfStreobTag::writeStream(std::ostream& out)
+{
+   out.write(m_stdId, 60);
+   out.write(n_nMates, 1);
+   out.write(m_mateInstance, 1);
+   out.write(m_bConv, 5);
+   out.write(m_eConv, 5);
+   out.write(m_bAsym, 5);
+   out.write(m_eAsym, 5);
+   out.write(m_bBie, 6);
+   out.write(m_eBie, 6);
+}
+
+void ossimNitfStreobTag::clearFields()
+{
+   // BCS-N's to '0's, BCS-A's to ' '(spaces)
+   
+   memset(m_stdId, '\0', 61);
+   memset(n_nMates, '\0', 2);
+   memset(m_mateInstance, '\0', 2);
+   memset(m_bConv, '\0', 6);
+   memset(m_eConv, '\0', 6);
+   memset(m_bAsym, '\0', 6);
+   memset(m_eAsym, '\0', 7);
+   memset(m_bBie, '\0', 7);
+}
+
+std::ostream& ossimNitfStreobTag::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+   
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:"
+       << getTagName() << "\n"
+       << pfx << std::setw(24) << "ST_ID:"   << m_stdId << "\n"
+       << pfx << std::setw(24) << "N_MATES:" << n_nMates << "\n"
+       << pfx << std::setw(24) << "MATE_INSTANCE:" << m_mateInstance << "\n"
+       << pfx << std::setw(24) << "B_CONV:" << m_bConv << "\n"
+       << pfx << std::setw(24) << "E_CONV:" << m_eConv << "\n"
+       << pfx << std::setw(24) << "B_ASYM:" << m_bAsym << "\n"
+       << pfx << std::setw(24) << "E_ASYM:" << m_eAsym << "\n"
+       << pfx << std::setw(24) << "B_BIE:" << m_bBie << "\n";
+   
+   return out;
+}
diff --git a/ossim/src/ossim/support_data/ossimNitfSymbolHeader.cpp b/src/support_data/ossimNitfSymbolHeader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfSymbolHeader.cpp
rename to src/support_data/ossimNitfSymbolHeader.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfSymbolHeaderV2_0.cpp b/src/support_data/ossimNitfSymbolHeaderV2_0.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfSymbolHeaderV2_0.cpp
rename to src/support_data/ossimNitfSymbolHeaderV2_0.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfTagFactory.cpp b/src/support_data/ossimNitfTagFactory.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfTagFactory.cpp
rename to src/support_data/ossimNitfTagFactory.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfTagFactoryRegistry.cpp b/src/support_data/ossimNitfTagFactoryRegistry.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfTagFactoryRegistry.cpp
rename to src/support_data/ossimNitfTagFactoryRegistry.cpp
diff --git a/src/support_data/ossimNitfTagInformation.cpp b/src/support_data/ossimNitfTagInformation.cpp
new file mode 100644
index 0000000..4de9fc2
--- /dev/null
+++ b/src/support_data/ossimNitfTagInformation.cpp
@@ -0,0 +1,210 @@
+//*******************************************************************
+//
+// LICENSE: MIT
+//
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimNitfTagInformation.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimIoStream.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimNitfTagFactoryRegistry.h>
+#include <ossim/support_data/ossimNitfUnknownTag.h>
+#include <sstream>
+#include <iomanip>
+#include <cstring> // for memset
+
+ossimNitfTagInformation::ossimNitfTagInformation(ossimRefPtr<ossimNitfRegisteredTag> tagData)
+{
+   clearFields();
+   setTagData(tagData);
+}
+
+ossimNitfTagInformation::~ossimNitfTagInformation()
+{
+}
+
+void ossimNitfTagInformation::parseStream(ossim::istream& in)
+{
+   if(in)
+   {
+      clearFields();
+      theTagOffset = in.tellg();
+      in.read(theTagName, 6);
+      in.read(theTagLength, 5);
+      theTagDataOffset = in.tellg();
+
+      theTagData = ossimNitfTagFactoryRegistry::instance()->create(getTagName());
+
+      if (theTagData.valid())
+      {
+         if (theTagData->getClassName() == "ossimNitfUnknownTag")
+         {
+            // Unknown tag doesn't know his tag name yet.
+            theTagData->setTagName( getTagName() );
+         }
+
+         //---
+         // Tags with dynamic tag length construct with 0 length.
+         // Set if 0.
+         //---
+         if ( theTagData->getTagLength() == 0 )
+         {
+            theTagData->setTagLength( getTagLength() );
+         }
+         // Sanity check fixed length in code with length from CEL field:
+         else if ( theTagData->getTagLength() != getTagLength() )
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimNitfTagInformation::parseStream WARNING!"
+               << "\nCEL field length does not match fixed tag length for tag: "
+               << theTagData->getTagName().c_str()
+               << "\nCEL: " << getTagLength()
+               << "\nTag: " << theTagData->getTagLength()
+               << std::endl;
+         }
+                               
+         theTagData->parseStream(in);
+      }
+      else
+      {
+         theTagData = (ossimNitfRegisteredTag*)NULL;
+      }
+   }
+}
+
+void ossimNitfTagInformation::writeStream(ossim::ostream &out)
+{
+   theTagOffset = out.tellp(); // Capture the offset.
+   out.write(theTagName, 6);
+   out.write(theTagLength, 5);
+   if(theTagData.valid())
+   {
+      theTagDataOffset = out.tellp();
+      theTagData->writeStream(out);
+   }
+}
+
+ossim_uint32 ossimNitfTagInformation::getTotalTagLength()const
+{
+   return (getTagLength() + (ossim_uint32)11);
+}
+
+ossim_uint32 ossimNitfTagInformation::getTagLength()const
+{
+   return ossimString(theTagLength).toUInt32();
+}
+
+ossim_uint64 ossimNitfTagInformation::getTagOffset()const
+{
+   return theTagOffset;
+}
+
+ossim_uint64 ossimNitfTagInformation::getTagDataOffset()const
+{
+   return theTagDataOffset;
+}
+
+ossimString ossimNitfTagInformation::getTagName()const
+{
+   return ossimString(theTagName).trim();
+}
+
+std::ostream& ossimNitfTagInformation::print(std::ostream& out)const
+{
+   out << "theTagName:       " << theTagName
+       << "\ntheTagLength:     " << theTagLength
+       << "\ntheTagType:       " << theTagType
+       << "\ntheTagOffset:     " << theTagOffset
+       << "\ntheTagDataOffset: " << theTagDataOffset
+       << std::endl;
+
+   return out;
+}
+
+void ossimNitfTagInformation::clearFields()
+{
+   memset(theTagName, ' ', 6);
+   memset(theTagLength, 0, 5);
+   strcpy(theTagType, "IXSHD ");
+
+   theTagName[6]    = '\0';
+   theTagLength[5]  = '\0';
+   
+   theTagOffset     = 0;
+   theTagDataOffset = 0;
+}
+
+void ossimNitfTagInformation::setTagName(const ossimString& tagName)
+{
+   memset(theTagName, ' ', 6);
+
+   std::ostringstream out;
+
+   out << std::setw(6)
+       << std::setfill(' ')
+       << tagName;
+   memcpy(theTagName, out.str().c_str(), 6);
+}
+
+void ossimNitfTagInformation::setTagLength(ossim_uint32 tagLength)
+{
+   memset(theTagLength, 0, 5);
+   
+   if(tagLength > 99999)
+   {
+      tagLength = 99999;
+   }
+
+   std::ostringstream out;
+
+   out << std::setw(5)
+       << std::setfill('0')
+       << tagLength;
+   
+   memcpy(theTagLength, out.str().c_str(), 5);
+}
+
+ossimRefPtr<ossimNitfRegisteredTag> ossimNitfTagInformation::getTagData()
+{
+   return theTagData;
+}
+
+const ossimRefPtr<ossimNitfRegisteredTag> ossimNitfTagInformation::getTagData()const
+{
+   return theTagData;
+}
+
+void ossimNitfTagInformation::setTagData(ossimRefPtr<ossimNitfRegisteredTag> tagData)
+{
+   theTagData = tagData;
+
+   memset(theTagName, ' ', 6);
+   memset(theTagLength, ' ', 5);
+   
+   if(theTagData.valid())
+   {
+      setTagName(theTagData->getRegisterTagName());
+      setTagLength(theTagData->getSizeInBytes());
+   }
+}
+ossimString ossimNitfTagInformation::getTagType() const
+{
+   return ossimString(theTagType).trim();
+}
+
+void ossimNitfTagInformation::setTagType(const ossimString& tagType) const
+{
+   std::ostringstream out;
+   out << std::setw(6)
+       << std::setfill(' ')
+       << std::setiosflags(std::ios::left)
+       << tagType;
+   memcpy(theTagType, out.str().c_str(), 6);
+   theTagType[6] = 0;
+}
+
diff --git a/ossim/src/ossim/support_data/ossimNitfTextHeader.cpp b/src/support_data/ossimNitfTextHeader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfTextHeader.cpp
rename to src/support_data/ossimNitfTextHeader.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfTextHeaderV2_0.cpp b/src/support_data/ossimNitfTextHeaderV2_0.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfTextHeaderV2_0.cpp
rename to src/support_data/ossimNitfTextHeaderV2_0.cpp
diff --git a/ossim/src/ossim/support_data/ossimNitfTextHeaderV2_1.cpp b/src/support_data/ossimNitfTextHeaderV2_1.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNitfTextHeaderV2_1.cpp
rename to src/support_data/ossimNitfTextHeaderV2_1.cpp
diff --git a/src/support_data/ossimNitfUnknownTag.cpp b/src/support_data/ossimNitfUnknownTag.cpp
new file mode 100644
index 0000000..a549d48
--- /dev/null
+++ b/src/support_data/ossimNitfUnknownTag.cpp
@@ -0,0 +1,142 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Unknown tag class declaration.
+//
+// Note: By "unknown" this means that the tag name was not found in any of
+// the tag factories.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimNitfUnknownTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <ostream>
+#include <iomanip>
+#include <cctype> /* for isascii */
+
+#include <ossim/support_data/ossimNitfUnknownTag.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+
+RTTI_DEF1(ossimNitfUnknownTag, "ossimNitfUnknownTag", ossimNitfRegisteredTag);
+
+ossimNitfUnknownTag::ossimNitfUnknownTag()
+   : m_tagData(0)
+{
+}
+
+ossimNitfUnknownTag::~ossimNitfUnknownTag()
+{
+   if (m_tagData)
+   {
+      delete [] m_tagData;
+      m_tagData = 0;
+   }
+}
+
+void ossimNitfUnknownTag::parseStream(std::istream& in)
+{
+   if (m_tagLength)
+   {
+      if (m_tagData)
+      {
+         delete [] m_tagData;
+      }
+
+      m_tagData = new char[m_tagLength+1];
+      
+      in.read(m_tagData, m_tagLength);
+
+      m_tagData[m_tagLength] = '\0';
+   }
+}
+
+void ossimNitfUnknownTag::writeStream(std::ostream& out)
+{
+   if (m_tagLength && m_tagData)
+   {
+      out.write(m_tagData, m_tagLength);
+   }
+}
+
+void ossimNitfUnknownTag::clearFields()
+{
+   if (m_tagData)
+   {
+      delete [] m_tagData;
+      m_tagData = 0;
+   }
+}
+
+std::ostream& ossimNitfUnknownTag::print(std::ostream& out,
+                                         const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "unformatted_tag_data: ";
+   
+   if (tagDataIsAscii())
+   {
+      if (tagDataIsXml())
+        out << "<![CDATA[" << m_tagData << "]]>" << "\n";
+      else
+        out << m_tagData << "\n";
+   }
+   else
+   {
+      out << "binary not displayed\n";
+   }
+   
+   return out;
+}
+
+bool ossimNitfUnknownTag::tagDataIsXml() const
+{
+   ossimString xmlTest = "<?xml";
+   ossim_uint32 len = xmlTest.length();
+   if ( (m_tagLength < len) || !m_tagData )
+   {
+      return false;
+   }
+
+   ossimString tagDataString = ossimString(m_tagData).substr(0, len);
+   if (tagDataString == xmlTest) return true;
+   return false;
+}
+
+void ossimNitfUnknownTag::setTagLength(ossim_uint32 length)
+{
+   if (m_tagData)
+   {
+      delete [] m_tagData;
+      m_tagData = 0;
+   }
+   m_tagLength = length;
+}
+
+bool ossimNitfUnknownTag::tagDataIsAscii() const
+{
+   if ( (m_tagLength == 0) || !m_tagData )
+   {
+      return false;
+   }
+
+   for (ossim_uint32 i = 0; i < m_tagLength; ++i)
+   {
+      int c = m_tagData[i];
+      if (isascii(c) == false)
+      {
+         return false;
+      }
+   }
+
+   return true;
+}
diff --git a/src/support_data/ossimNitfUse00aTag.cpp b/src/support_data/ossimNitfUse00aTag.cpp
new file mode 100644
index 0000000..cce55f9
--- /dev/null
+++ b/src/support_data/ossimNitfUse00aTag.cpp
@@ -0,0 +1,539 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Walt Bunch
+//
+// Description: Nitf support class for USE00A -
+// Exploitation Usability extension.
+// 
+//********************************************************************
+// $Id: ossimNitfUse00aTag.cpp 22013 2012-12-19 17:37:20Z dburken $
+
+#include <iostream>
+#include <iomanip>
+#include <ossim/support_data/ossimNitfUse00aTag.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimCommon.h>
+
+RTTI_DEF1(ossimNitfUse00aTag, "ossimNitfUse00aTag", ossimNitfRegisteredTag);
+
+static const ossimString ANGLETONORTH_KW = "ANGLETONORTH";
+static const ossimString MEANGSD_KW = "MEANGSD";
+static const ossimString DYNAMICRANGE_KW = "DYNAMICRANGE";
+static const ossimString OBLANG_KW = "OBLANG";
+static const ossimString ROLLANG_KW = "ROLLANG";
+static const ossimString NREF_KW = "NREF";
+static const ossimString REVNUM_KW = "REVNUM";
+static const ossimString NSEG_KW = "NSEG";
+static const ossimString MAXLPSEG_KW = "MAXLPSEG";
+static const ossimString SUNEL_KW = "SUNEL";
+static const ossimString SUNAZ_KW = "SUNAZ";
+
+
+ossimNitfUse00aTag::ossimNitfUse00aTag()
+   : ossimNitfRegisteredTag(std::string("USE00A"), 107) 
+{
+   clearFields();
+}
+
+ossimNitfUse00aTag::~ossimNitfUse00aTag()
+{
+}
+
+void ossimNitfUse00aTag::parseStream(std::istream& in)
+{
+   clearFields();
+   
+   in.read(theAngleToNorth, ANGLE_TO_NORTH_SIZE);
+   in.read(theMeanGsd, MEAN_GSD_SIZE);
+   in.read(theField3, FIELD3_SIZE);
+   in.read(theDynamicRange, DYNAMIC_RANGE_SIZE);
+   in.read(theField5, FIELD5_SIZE);
+   in.read(theField6, FIELD6_SIZE);
+   in.read(theField7, FIELD7_SIZE);
+   in.read(theOblAng, OBL_ANG_SIZE);
+   in.read(theRollAng, ROLL_ANG_SIZE);
+   in.read(theField10, FIELD10_SIZE);
+   in.read(theField11, FIELD11_SIZE);
+   in.read(theField12, FIELD12_SIZE);
+   in.read(theField13, FIELD13_SIZE);
+   in.read(theField14, FIELD14_SIZE);
+   in.read(theField15, FIELD15_SIZE);
+   in.read(theField16, FIELD16_SIZE);
+   in.read(theNRef, N_REF_SIZE);
+   in.read(theRevNum, REV_NUM_SIZE);
+   in.read(theNSeg, N_SEG_SIZE);
+   in.read(theMaxLpSeg, MAX_LP_SEG_SIZE);
+   in.read(theField20, FIELD20_SIZE);
+   in.read(theField21, FIELD21_SIZE);
+   in.read(theSunEl, SUN_EL_SIZE);
+   in.read(theSunAz, SUN_AZ_SIZE);
+}
+
+void ossimNitfUse00aTag::writeStream(std::ostream& out)
+{
+   out.write(theAngleToNorth, ANGLE_TO_NORTH_SIZE);
+   out.write(theMeanGsd, MEAN_GSD_SIZE);
+   out.write(theField3, FIELD3_SIZE);
+   out.write(theDynamicRange, DYNAMIC_RANGE_SIZE);
+   out.write(theField5, FIELD5_SIZE);
+   out.write(theField6, FIELD6_SIZE);
+   out.write(theField7, FIELD7_SIZE);
+   out.write(theOblAng, OBL_ANG_SIZE);
+   out.write(theRollAng, ROLL_ANG_SIZE);
+   out.write(theField10, FIELD10_SIZE);
+   out.write(theField11, FIELD11_SIZE);
+   out.write(theField12, FIELD12_SIZE);
+   out.write(theField13, FIELD13_SIZE);
+   out.write(theField14, FIELD14_SIZE);
+   out.write(theField15, FIELD15_SIZE);
+   out.write(theField16, FIELD16_SIZE);
+   out.write(theNRef, N_REF_SIZE);
+   out.write(theRevNum, REV_NUM_SIZE);
+   out.write(theNSeg, N_SEG_SIZE);
+   out.write(theMaxLpSeg, MAX_LP_SEG_SIZE);
+   out.write(theField20, FIELD20_SIZE);
+   out.write(theField21, FIELD21_SIZE);
+   out.write(theSunEl, SUN_EL_SIZE);
+   out.write(theSunAz, SUN_AZ_SIZE);
+}
+
+void ossimNitfUse00aTag::clearFields()
+{
+   memset(theAngleToNorth, ' ', ANGLE_TO_NORTH_SIZE);
+   memset(theMeanGsd, ' ', MEAN_GSD_SIZE);
+   memset(theField3, ' ', FIELD3_SIZE);
+   memset(theDynamicRange, ' ', DYNAMIC_RANGE_SIZE);
+   memset(theField5, ' ', FIELD5_SIZE);
+   memset(theField6, ' ', FIELD6_SIZE);
+   memset(theField7, ' ', FIELD7_SIZE);
+   memset(theOblAng, ' ', OBL_ANG_SIZE);
+   memset(theRollAng, ' ', ROLL_ANG_SIZE);
+   memset(theField10, ' ', FIELD10_SIZE);
+   memset(theField11, ' ', FIELD11_SIZE);
+   memset(theField12, ' ', FIELD12_SIZE);
+   memset(theField13, ' ', FIELD13_SIZE);
+   memset(theField14, ' ', FIELD14_SIZE);
+   memset(theField15, ' ', FIELD15_SIZE);
+   memset(theField16, ' ', FIELD16_SIZE);
+   memset(theNRef, ' ', N_REF_SIZE);
+   memset(theRevNum, ' ', REV_NUM_SIZE);
+   memset(theNSeg, ' ', N_SEG_SIZE);
+   memset(theMaxLpSeg, ' ', MAX_LP_SEG_SIZE);
+   memset(theField20, ' ', FIELD20_SIZE);
+   memset(theField21, ' ', FIELD21_SIZE);
+   memset(theSunEl, ' ', SUN_EL_SIZE);
+   memset(theSunAz, ' ', SUN_AZ_SIZE);
+
+   theAngleToNorth[ANGLE_TO_NORTH_SIZE] = '\0';
+   theMeanGsd[MEAN_GSD_SIZE] = '\0';
+   theField3[FIELD3_SIZE] = '\0';
+   theDynamicRange[DYNAMIC_RANGE_SIZE] = '\0';
+   theField5[FIELD5_SIZE] = '\0';
+   theField6[FIELD6_SIZE] = '\0';
+   theField7[FIELD7_SIZE] = '\0';
+   theOblAng[OBL_ANG_SIZE] = '\0';
+   theRollAng[ROLL_ANG_SIZE] = '\0';
+   theField10[FIELD10_SIZE] = '\0';
+   theField11[FIELD11_SIZE] = '\0';
+   theField12[FIELD12_SIZE] = '\0';
+   theField13[FIELD13_SIZE] = '\0';
+   theField14[FIELD14_SIZE] = '\0';
+   theField15[FIELD15_SIZE] = '\0';
+   theField16[FIELD16_SIZE] = '\0';
+   theNRef[N_REF_SIZE] = '\0';
+   theRevNum[REV_NUM_SIZE] = '\0';
+   theNSeg[N_SEG_SIZE] = '\0';
+   theMaxLpSeg[MAX_LP_SEG_SIZE] = '\0';
+   theField20[FIELD20_SIZE] = '\0';
+   theField21[FIELD21_SIZE] = '\0';
+   theSunEl[SUN_EL_SIZE] = '\0';
+   theSunAz[SUN_AZ_SIZE] = '\0';
+}
+
+ossimString ossimNitfUse00aTag::getAngleToNorth()const
+{
+   return theAngleToNorth;
+}
+
+void ossimNitfUse00aTag::setAngleToNorth(const ossimString& angleToNorth)
+{
+   memset(theAngleToNorth, ' ', ANGLE_TO_NORTH_SIZE);
+   memcpy(theAngleToNorth, angleToNorth.c_str(), std::min((size_t)ANGLE_TO_NORTH_SIZE, angleToNorth.length()));
+}
+
+ossimString ossimNitfUse00aTag::getMeanGsd()const
+{
+   return theMeanGsd;
+}
+
+ossim_float64 ossimNitfUse00aTag::getMeanGsdInMeters() const
+{
+   ossim_float64 gsd = 0.0;
+   
+   ossimString s = theMeanGsd;
+   if (s.size())
+   {
+      ossim_float64 d = s.toFloat64();
+      if ( (d != 0.0) && (ossim::isnan(d) == false) )
+      {
+         gsd = d / 12.0 * MTRS_PER_FT;
+      }
+   }
+   
+   return gsd;
+}
+
+void ossimNitfUse00aTag::setMeanGsd(const ossimString& meanGsd)
+{
+   memset(theMeanGsd, ' ', MEAN_GSD_SIZE);
+   memcpy(theMeanGsd, meanGsd.c_str(), std::min((size_t)MEAN_GSD_SIZE, meanGsd.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField3()const
+{
+   return theField3;
+}
+
+void ossimNitfUse00aTag::setField3(const ossimString& field3)
+{
+   memset(theField3, ' ', FIELD3_SIZE);
+   memcpy(theField3, field3.c_str(), std::min((size_t)FIELD3_SIZE, field3.length()));
+}
+
+ossimString ossimNitfUse00aTag::getDynamicRange()const
+{
+   return theDynamicRange;
+}
+
+void ossimNitfUse00aTag::setDynamicRange(const ossimString& dynamicRange)
+{
+   memset(theDynamicRange, ' ', DYNAMIC_RANGE_SIZE);
+   memcpy(theDynamicRange, dynamicRange.c_str(), std::min((size_t)DYNAMIC_RANGE_SIZE, dynamicRange.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField5()const
+{
+   return theField5;
+}
+
+void ossimNitfUse00aTag::setField5(const ossimString& field5)
+{
+   memset(theField5, ' ', FIELD5_SIZE);
+   memcpy(theField5, field5.c_str(), std::min((size_t)FIELD5_SIZE, field5.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField6()const
+{
+   return theField6;
+}
+
+void ossimNitfUse00aTag::setField6(const ossimString& field6)
+{
+   memset(theField6, ' ', FIELD6_SIZE);
+   memcpy(theField6, field6.c_str(), std::min((size_t)FIELD6_SIZE, field6.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField7()const
+{
+   return theField7;
+}
+
+void ossimNitfUse00aTag::setField7(const ossimString& field7)
+{
+   memset(theField7, ' ', FIELD7_SIZE);
+   memcpy(theField7, field7.c_str(), std::min((size_t)FIELD7_SIZE, field7.length()));
+}
+
+ossimString ossimNitfUse00aTag::getOblAng()const
+{
+   return theOblAng;
+}
+
+void ossimNitfUse00aTag::setOblAng(const ossimString& oblAng)
+{
+   memset(theOblAng, ' ', OBL_ANG_SIZE);
+   memcpy(theOblAng, oblAng.c_str(), std::min((size_t)OBL_ANG_SIZE, oblAng.length()));
+}
+
+ossimString ossimNitfUse00aTag::getRollAng()const
+{
+   return theRollAng;
+}
+
+void ossimNitfUse00aTag::setRollAng(const ossimString& rollAng)
+{
+   memset(theRollAng, ' ', ROLL_ANG_SIZE);
+   memcpy(theRollAng, rollAng.c_str(), std::min((size_t)ROLL_ANG_SIZE, rollAng.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField10()const
+{
+   return theField10;
+}
+
+void ossimNitfUse00aTag::setField10(const ossimString& field10)
+{
+   memset(theField10, ' ', FIELD10_SIZE);
+   memcpy(theField10, field10.c_str(), std::min((size_t)FIELD10_SIZE, field10.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField11()const
+{
+   return theField11;
+}
+
+void ossimNitfUse00aTag::setField11(const ossimString& field11)
+{
+   memset(theField11, ' ', FIELD11_SIZE);
+   memcpy(theField11, field11.c_str(), std::min((size_t)FIELD11_SIZE, field11.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField12()const
+{
+   return theField12;
+}
+
+void ossimNitfUse00aTag::setField12(const ossimString& field12)
+{
+   memset(theField12, ' ', FIELD12_SIZE);
+   memcpy(theField12, field12.c_str(), std::min((size_t)FIELD12_SIZE, field12.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField13()const
+{
+   return theField13;
+}
+
+void ossimNitfUse00aTag::setField13(const ossimString& field13)
+{
+   memset(theField13, ' ', FIELD13_SIZE);
+   memcpy(theField13, field13.c_str(), std::min((size_t)FIELD13_SIZE, field13.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField14()const
+{
+   return theField14;
+}
+
+void ossimNitfUse00aTag::setField14(const ossimString& field14)
+{
+   memset(theField14, ' ', FIELD14_SIZE);
+   memcpy(theField14, field14.c_str(), std::min((size_t)FIELD14_SIZE, field14.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField15()const
+{
+   return theField15;
+}
+
+void ossimNitfUse00aTag::setField15(const ossimString& field15)
+{
+   memset(theField15, ' ', FIELD15_SIZE);
+   memcpy(theField15, field15.c_str(), std::min((size_t)FIELD15_SIZE, field15.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField16()const
+{
+   return theField16;
+}
+
+void ossimNitfUse00aTag::setField16(const ossimString& field16)
+{
+   memset(theField16, ' ', FIELD16_SIZE);
+   memcpy(theField16, field16.c_str(), std::min((size_t)FIELD16_SIZE, field16.length()));
+}
+
+ossimString ossimNitfUse00aTag::getNRef()const
+{
+   return theNRef;
+}
+
+void ossimNitfUse00aTag::setNRef(const ossimString& nRef)
+{
+   memset(theNRef, ' ', N_REF_SIZE);
+   memcpy(theNRef, nRef.c_str(), std::min((size_t)N_REF_SIZE, nRef.length()));
+}
+
+ossimString ossimNitfUse00aTag::getRevNum()const
+{
+   return theRevNum;
+}
+
+void ossimNitfUse00aTag::setRevNum(const ossimString& revNum)
+{
+   memset(theRevNum, ' ', REV_NUM_SIZE);
+   memcpy(theRevNum, revNum.c_str(), std::min((size_t)REV_NUM_SIZE, revNum.length()));
+}
+
+ossimString ossimNitfUse00aTag::getNSeg()const
+{
+   return theNSeg;
+}
+
+void ossimNitfUse00aTag::setNSeg(const ossimString& nSeg)
+{
+   memset(theNSeg, ' ', N_SEG_SIZE);
+   memcpy(theNSeg, nSeg.c_str(), std::min((size_t)N_SEG_SIZE, nSeg.length()));
+}
+
+ossimString ossimNitfUse00aTag::getMaxLpSeg()const
+{
+   return theMaxLpSeg;
+}
+
+void ossimNitfUse00aTag::setMaxLpSeg(const ossimString& maxLpSeg)
+{
+   memset(theMaxLpSeg, ' ', MAX_LP_SEG_SIZE);
+   memcpy(theMaxLpSeg, maxLpSeg.c_str(), std::min((size_t)MAX_LP_SEG_SIZE, maxLpSeg.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField20()const
+{
+   return theField20;
+}
+
+void ossimNitfUse00aTag::setField20(const ossimString& field20)
+{
+   memset(theField20, ' ', FIELD20_SIZE);
+   memcpy(theField20, field20.c_str(), std::min((size_t)FIELD20_SIZE, field20.length()));
+}
+
+ossimString ossimNitfUse00aTag::getField21()const
+{
+   return theField21;
+}
+
+void ossimNitfUse00aTag::setField21(const ossimString& field21)
+{
+   memset(theField21, ' ', FIELD21_SIZE);
+   memcpy(theField21, field21.c_str(), std::min((size_t)FIELD21_SIZE, field21.length()));
+}
+
+ossimString ossimNitfUse00aTag::getSunEl()const
+{
+   return theSunEl;
+}
+
+void ossimNitfUse00aTag::setSunEl(const ossimString& sunEl)
+{
+   memset(theSunEl, ' ', SUN_EL_SIZE);
+   memcpy(theSunEl, sunEl.c_str(), std::min((size_t)SUN_EL_SIZE, sunEl.length()));
+}
+
+ossimString ossimNitfUse00aTag::getSunAz()const
+{
+   return theSunAz;
+}
+
+void ossimNitfUse00aTag::setSunAz(const ossimString& sunAz)
+{
+   memset(theSunAz, ' ', SUN_AZ_SIZE);
+   memcpy(theSunAz, sunAz.c_str(), std::min((size_t)SUN_AZ_SIZE, sunAz.length()));
+}
+
+std::ostream& ossimNitfUse00aTag::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   std::string pfx = prefix;
+   pfx += getTagName();
+   pfx += ".";
+
+   out << setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "CETAG:" << getTagName() << "\n"
+       << pfx << std::setw(24) << "CEL:"   << getTagLength() << "\n"
+       << pfx << std::setw(24) << "ANGLETONORTH:" << theAngleToNorth << "\n" 
+       << pfx << std::setw(24) << "MEANGSD:"      << theMeanGsd << "\n"
+       << pfx << std::setw(24) << "DYNAMICRANGE:" << theDynamicRange << "\n"
+       << pfx << std::setw(24) << "OBLANG:"       << theOblAng << "\n"
+       << pfx << std::setw(24) << "ROLLANG:"      << theRollAng << "\n"
+       << pfx << std::setw(24) << "NREF:"         << theNRef << "\n"
+       << pfx << std::setw(24) << "REVNUM:"       << theRevNum << "\n"
+       << pfx << std::setw(24) << "NSEG:"         << theNSeg << "\n"
+       << pfx << std::setw(24) << "MAXLPSEG:"     << theMaxLpSeg << "\n"
+       << pfx << std::setw(24) << "SUNEL:"        << theSunEl << "\n"
+       << pfx << std::setw(24) << "SUNAZ:"        << theSunAz << "\n";
+
+   return out; 
+}
+   
+void ossimNitfUse00aTag::setProperty(ossimRefPtr<ossimProperty> property)
+{
+   ossimNitfRegisteredTag::setProperty(property);
+}
+
+ossimRefPtr<ossimProperty> ossimNitfUse00aTag::getProperty(const ossimString& name)const
+{
+   ossimProperty* result = 0;
+
+   if(name == ANGLETONORTH_KW)
+   {
+      result = new ossimStringProperty(name, theAngleToNorth);
+   }
+   else if(name == MEANGSD_KW)
+   {
+      result = new ossimStringProperty(name, theMeanGsd);
+   }
+   else if(name == DYNAMICRANGE_KW)
+   {
+      result = new ossimStringProperty(name, theDynamicRange);
+   }
+   else if(name == OBLANG_KW)
+   {
+      result = new ossimStringProperty(name, theOblAng);
+   }
+   else if(name == ROLLANG_KW)
+   {
+      result = new ossimStringProperty(name, theRollAng);
+   }
+   else if(name == NREF_KW)
+   {
+      result = new ossimStringProperty(name, theNRef);
+   }
+   else if(name == REVNUM_KW)
+   {
+      result = new ossimStringProperty(name, theRevNum);
+   }
+   else if(name == NSEG_KW)
+   {
+      result = new ossimStringProperty(name, theNSeg);
+   }
+   else if(name == MAXLPSEG_KW)
+   {
+      result = new ossimStringProperty(name, theMaxLpSeg);
+   }
+   else if(name == SUNEL_KW)
+   {
+      result = new ossimStringProperty(name, theSunEl);
+   }
+   else if(name == SUNAZ_KW)
+   {
+      result = new ossimStringProperty(name, theSunAz);
+   }
+   else
+   {
+      return ossimNitfRegisteredTag::getProperty(name);
+   }
+
+   return result;
+}
+
+void ossimNitfUse00aTag::getPropertyNames(std::vector<ossimString>& propertyNames)const
+{
+   ossimNitfRegisteredTag::getPropertyNames(propertyNames);
+
+   propertyNames.push_back(ANGLETONORTH_KW);
+   propertyNames.push_back(MEANGSD_KW);
+   propertyNames.push_back(DYNAMICRANGE_KW);
+   propertyNames.push_back(OBLANG_KW);
+   propertyNames.push_back(ROLLANG_KW);
+   propertyNames.push_back(NREF_KW);
+   propertyNames.push_back(REVNUM_KW);
+   propertyNames.push_back(NSEG_KW);
+   propertyNames.push_back(MAXLPSEG_KW);
+   propertyNames.push_back(SUNEL_KW);
+   propertyNames.push_back(SUNAZ_KW);
+}
diff --git a/src/support_data/ossimNitfVqCompressionHeader.cpp b/src/support_data/ossimNitfVqCompressionHeader.cpp
new file mode 100644
index 0000000..68f30c1
--- /dev/null
+++ b/src/support_data/ossimNitfVqCompressionHeader.cpp
@@ -0,0 +1,349 @@
+//*******************************************************************
+// Copyright (C) 2004 Garrett Potts
+//
+// LICENSE: LGPL see top level LICENSE.txt for more details
+// 
+// Author: Garrett Potts
+// Description: Nitf support class
+// 
+//********************************************************************
+// $Id: ossimNitfVqCompressionHeader.cpp 19682 2011-05-31 14:21:20Z dburken $
+
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+
+#include <ossim/support_data/ossimNitfVqCompressionHeader.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+RTTI_DEF1(ossimNitfVqCompressionHeader, "ossimNitfVqCompressionHeader", ossimNitfCompressionHeader);
+
+#if 0
+std::ostream& operator<<(std::ostream& out,
+                         const ossimNitfVqCompressionOffsetTableData& data)
+{
+   out << "theTableId:                              " << data.theTableId << std::endl
+       << "theNumberOfCompressionLookupRecords:     " << data.theNumberOfCompressionLookupRecords << std::endl
+       << "theNumberOfValuesPerCompressionLookup:   " << data.theNumberOfValuesPerCompressionLookup << std::endl
+       << "theCompressionLookupValueBitLength:      " << data.theCompressionLookupValueBitLength<< std::endl
+       << "theCompressionLookupTableOffset:         " << data.theCompressionLookupTableOffset;
+
+   return out;
+}
+#endif
+
+
+ossimNitfVqCompressionOffsetTableData::ossimNitfVqCompressionOffsetTableData()
+      :theData(NULL)
+{
+   clearFields();
+}
+
+ossimNitfVqCompressionOffsetTableData::ossimNitfVqCompressionOffsetTableData(const ossimNitfVqCompressionOffsetTableData& rhs)
+      :theTableId(rhs.theTableId),
+       theNumberOfCompressionLookupRecords(rhs.theNumberOfCompressionLookupRecords),
+       theNumberOfValuesPerCompressionLookup(rhs.theNumberOfValuesPerCompressionLookup),
+       theCompressionLookupValueBitLength(rhs.theCompressionLookupValueBitLength),
+       theCompressionLookupTableOffset(rhs.theCompressionLookupTableOffset),
+       theData(NULL)
+
+{
+   ossim_uint32 size = (theNumberOfValuesPerCompressionLookup*
+                        theNumberOfCompressionLookupRecords*
+                        theCompressionLookupValueBitLength)/8;
+   if(size > 0)
+   {
+      theData = new unsigned char[size];
+      if(rhs.theData)
+      {
+         memcpy(theData, rhs.theData, size);
+      }
+   }
+}
+
+ossimNitfVqCompressionOffsetTableData::~ossimNitfVqCompressionOffsetTableData()
+{
+   if(theData)
+   {
+      delete [] theData;
+      theData = NULL;
+   }
+}
+
+const ossimNitfVqCompressionOffsetTableData& ossimNitfVqCompressionOffsetTableData::operator =(const ossimNitfVqCompressionOffsetTableData& rhs)
+{
+   if(this != &rhs)
+   {
+      if(theData)
+      {
+         delete [] theData;
+         theData = NULL;
+      }
+
+      theTableId                            = rhs.theTableId;
+      theNumberOfCompressionLookupRecords   = rhs.theNumberOfCompressionLookupRecords;
+      theCompressionLookupValueBitLength    = rhs.theCompressionLookupValueBitLength;
+      theNumberOfValuesPerCompressionLookup = rhs.theNumberOfValuesPerCompressionLookup;
+      theCompressionLookupTableOffset       = rhs.theCompressionLookupTableOffset;
+      
+      if(rhs.theData)
+      {
+         ossim_uint32 size = (theNumberOfValuesPerCompressionLookup*
+                              theNumberOfCompressionLookupRecords*
+                              theCompressionLookupValueBitLength)/8;
+         if(size > 0)
+         {
+            theData = new unsigned char[size];
+            memcpy(theData, rhs.theData, size);
+         }
+      }
+   }
+   
+   return *this;
+   
+}
+ossim_uint32 ossimNitfVqCompressionOffsetTableData::getDataLengthInBytes()const
+{
+   return (theNumberOfValuesPerCompressionLookup*
+           theNumberOfCompressionLookupRecords*
+           theCompressionLookupValueBitLength)/8;
+}
+
+void ossimNitfVqCompressionOffsetTableData::parseStream(std::istream& in)
+{
+   ossimEndian endian;
+   in.read((char*)(&theTableId), 2);
+   in.read((char*)(&theNumberOfCompressionLookupRecords),4);
+   in.read((char*)(&theNumberOfValuesPerCompressionLookup), 2);
+   in.read((char*)(&theCompressionLookupValueBitLength),2);
+   in.read((char*)(&theCompressionLookupTableOffset), 4);
+
+   if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+   {
+      endian.swap(theTableId);
+      endian.swap(theNumberOfCompressionLookupRecords);
+      endian.swap(theNumberOfValuesPerCompressionLookup);
+      endian.swap(theCompressionLookupValueBitLength);
+      endian.swap(theCompressionLookupTableOffset);
+   }
+}
+
+void ossimNitfVqCompressionOffsetTableData::clearFields()
+{
+   theTableId = 0;
+   theNumberOfCompressionLookupRecords = 0;
+   theNumberOfValuesPerCompressionLookup = 0;
+   theCompressionLookupValueBitLength = 0;
+   theCompressionLookupTableOffset = 0;
+
+   if(theData)
+   {
+      delete [] theData;
+      theData = NULL;
+   }
+}
+
+ossimNitfVqCompressionHeader::ossimNitfVqCompressionHeader()
+{
+   clearFields();
+}
+
+void ossimNitfVqCompressionHeader::parseStream(std::istream &in)
+{
+   ossimEndian endian;
+
+   in.read((char*)(&theNumberOfImageRows), 4);
+   in.read((char*)(&theNumberOfImageCodesPerRow), 4);
+   in.read((char*)(&theImageCodeBitLength), 1);
+   in.read((char*)(&theCompressionAlgorithmId), 2);
+
+   in.read((char*)(&theNumberOfCompressionLookupOffsetRecords), 2);
+   in.read((char*)(&theNumberOfCompressionParameterOffsetRecords), 2);
+   in.read((char*)(&theCompressionLookupOffsetTableOffset), 4);
+   in.read((char*)(&theCompressionLookupTableOffsetRecordLength), 2);
+   
+   if(endian.getSystemEndianType() == OSSIM_LITTLE_ENDIAN)
+   {
+      endian.swap(theNumberOfImageRows);
+      endian.swap(theNumberOfImageCodesPerRow);
+      endian.swap(theCompressionAlgorithmId);
+      endian.swap(theNumberOfCompressionLookupOffsetRecords);
+      endian.swap(theNumberOfCompressionParameterOffsetRecords);
+      endian.swap(theCompressionLookupOffsetTableOffset);
+      endian.swap(theCompressionLookupTableOffsetRecordLength);
+   }
+   
+   if((theNumberOfCompressionLookupOffsetRecords > 0)&&
+      (theCompressionAlgorithmId == 1)) 
+   {
+      theTable.clear();
+      theTable.resize(theNumberOfCompressionLookupOffsetRecords);
+
+      ossim_uint32 idx = 0;
+
+      for(idx = 0; idx < theNumberOfCompressionLookupOffsetRecords; ++idx)
+      {
+         theTable[idx].parseStream(in);
+      }
+      for(idx = 0; idx < theTable.size(); ++idx)
+      {
+         if(theTable[idx].theData)
+         {
+            delete [] theTable[idx].theData;
+            theTable[idx].theData = 0;
+         }
+         if(theTable[idx].getDataLengthInBytes()>0)
+         {
+            theTable[idx].theData = new ossim_uint8[theTable[idx].getDataLengthInBytes()];
+            in.read((char*)(theTable[idx].theData), theTable[idx].getDataLengthInBytes());
+         }
+      }
+   }
+}
+
+std::ostream& ossimNitfVqCompressionHeader::print(std::ostream& out) const
+{
+   return this->print(out, std::string(""));
+}
+
+std::ostream& ossimNitfVqCompressionHeader::print(
+   std::ostream& out, const std::string& prefix ) const
+{
+   std::string pfx = prefix;
+   pfx += "vq_header.";
+
+   out << std::setiosflags(std::ios::left)
+       << pfx << std::setw(24) << "image_rows:"
+       << theNumberOfImageRows << "\n"
+       << pfx << std::setw(24) << "codes_per_row:"
+       << theNumberOfImageCodesPerRow << "\n"
+       << pfx << std::setw(24) << "codebit_length:"
+       << (ossim_uint32)theImageCodeBitLength << "\n"
+       << pfx << std::setw(24) << "algorithm_id:"
+       << theCompressionAlgorithmId << "\n"
+       << pfx << std::setw(24)
+       << "offset_records:"
+       << theNumberOfCompressionLookupOffsetRecords << "\n"
+       << pfx << std::setw(24)
+       << "offset_record_length:"
+       << theCompressionLookupTableOffsetRecordLength << "\n";
+
+   if(theTable.size() > 0)
+   {
+      for(ossim_uint32 idx = 0; idx < theTable.size()-1; ++idx)
+      {
+         std::string tblPfx = pfx;
+         tblPfx += "table";
+         tblPfx += ossimString::toString(idx).string();
+         tblPfx += ".";
+
+         out << tblPfx << std::setw(24) << "id:"
+             << theTable[idx].theTableId << "\n"
+             << tblPfx << std::setw(24) << "lookup_records:"
+             << theTable[idx].theNumberOfCompressionLookupRecords << "\n"
+             << tblPfx << std::setw(24) << "values_per_lookup:"
+             << theTable[idx].theNumberOfValuesPerCompressionLookup << "\n"
+             << tblPfx << std::setw(24) << "lookup_bit_length:"
+             << theTable[idx].theCompressionLookupValueBitLength << "\n"
+             << tblPfx << std::setw(24) << "lookup_table_offset:"
+             << theTable[idx].theCompressionLookupTableOffset << "\n";
+      }
+
+   }
+
+   return out;
+}
+
+bool ossimNitfVqCompressionHeader::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const
+{
+   bool result = ossimNitfCompressionHeader::saveState(kwl, prefix);
+   
+   if(result)
+   {
+      std::ostringstream out;
+      
+      out << std::setiosflags(std::ios::left)
+      << "image_rows:" << theNumberOfImageRows << "\n"
+      << "codes_per_row:" << theNumberOfImageCodesPerRow << "\n"
+      << "codebit_length:" << (ossim_uint32)theImageCodeBitLength << "\n"
+      << "algorithm_id:" << theCompressionAlgorithmId << "\n"
+      << "offset_records:" << theNumberOfCompressionLookupOffsetRecords << "\n"
+      << "offset_record_length:" << theCompressionLookupTableOffsetRecordLength << "\n";
+      
+      if(theTable.size() > 0)
+      {
+         for(ossim_uint32 idx = 0; idx < theTable.size()-1; ++idx)
+         {
+            std::string tblPfx = "table";
+            tblPfx += ossimString::toString(idx).string();
+            tblPfx += ".";
+            
+            out << tblPfx<< "id:"
+            << theTable[idx].theTableId << "\n"
+            << tblPfx << "lookup_records:"<< theTable[idx].theNumberOfCompressionLookupRecords << "\n"
+            << tblPfx <<"values_per_lookup:"<< theTable[idx].theNumberOfValuesPerCompressionLookup << "\n"
+            << tblPfx << "lookup_bit_length:"<< theTable[idx].theCompressionLookupValueBitLength << "\n"
+            << tblPfx << "lookup_table_offset:"<< theTable[idx].theCompressionLookupTableOffset << "\n";
+         }
+      }
+      ossimKeywordlist kwlTemp;
+      
+      std::istringstream in(out.str());
+      if(kwlTemp.parseStream(in))
+      {
+         kwl.add(prefix, kwlTemp);
+      }
+   }
+   
+   return result;
+}
+
+ossim_uint32 ossimNitfVqCompressionHeader::getBlockSizeInBytes()const
+{
+   return (getNumberOfImageRows()*
+           getNumberOfImageCodesPerRow()*
+           getImageCodeBitLength())/8;
+}
+
+ossim_uint32 ossimNitfVqCompressionHeader::getNumberOfImageRows()const
+{
+   return theNumberOfImageRows;
+}
+
+ossim_uint32 ossimNitfVqCompressionHeader::getNumberOfImageCodesPerRow()const
+{
+   return theNumberOfImageCodesPerRow;
+}
+
+ossim_uint32 ossimNitfVqCompressionHeader::getCompressionAlgorithmId()const
+{
+   return theCompressionAlgorithmId;
+}
+
+ossim_uint32 ossimNitfVqCompressionHeader::getImageCodeBitLength()const
+{
+   return theImageCodeBitLength;
+}
+
+ossim_uint32 ossimNitfVqCompressionHeader::getNumberOfTables()const
+{
+   return (ossim_uint32)theTable.size();
+}
+
+const std::vector<ossimNitfVqCompressionOffsetTableData>& ossimNitfVqCompressionHeader::getTable()const
+{
+   return theTable;
+}
+
+void ossimNitfVqCompressionHeader::clearFields()
+{
+   theNumberOfImageRows                        = 0;
+   theNumberOfImageCodesPerRow                 = 0;
+   theImageCodeBitLength                       = 0;
+   theCompressionAlgorithmId                   = 0;
+   theNumberOfCompressionLookupOffsetRecords   = 0;
+   theCompressionLookupTableOffsetRecordLength = 0;
+}
+
diff --git a/src/support_data/ossimNitfXmlDataContentDes.cpp b/src/support_data/ossimNitfXmlDataContentDes.cpp
new file mode 100644
index 0000000..1c70183
--- /dev/null
+++ b/src/support_data/ossimNitfXmlDataContentDes.cpp
@@ -0,0 +1,190 @@
+#include <ossim/support_data/ossimNitfXmlDataContentDes.h>
+#include <ossim/base/ossimPreferences.h>
+#include <iomanip>
+#include <iostream>
+#include <sstream>
+
+//<CHILDCLASSCPP>
+
+ossimNitfXmlDataContentDes::ossimNitfXmlDataContentDes()
+   : ossimNitfRegisteredDes(std::string("XML_DATA_CONTENT"), 0),
+     m_xmlString()
+{
+   clearFields();
+}
+
+void ossimNitfXmlDataContentDes::parseStream(std::istream& in)
+{
+   in.read(m_descrc, DESCRC_SIZE);
+   in.read(m_desshft, DESSHFT_SIZE);
+   in.read(m_desshdt, DESSHDT_SIZE);
+   in.read(m_desshrp, DESSHRP_SIZE);
+   in.read(m_desshsi, DESSHSI_SIZE);
+   in.read(m_desshsv, DESSHSV_SIZE);
+   in.read(m_desshsd, DESSHSD_SIZE);
+   in.read(m_desshtn, DESSHTN_SIZE);
+
+   if(getSizeInBytes())
+   {
+     char* c = new char[getSizeInBytes()+1];
+     in.read(c, getSizeInBytes());
+     c[getSizeInBytes()] = '\0';
+     m_xmlString.string().resize(getSizeInBytes());
+     m_xmlString = c;
+     m_xmlDocument = new ossimXmlDocument;;
+     std::istringstream xmlStringStream(m_xmlString.string());
+     m_xmlDocument->read(xmlStringStream);
+     delete [] c;
+     c = 0;
+   }
+}
+
+void ossimNitfXmlDataContentDes::writeStream(std::ostream& out)
+{
+   out.write(m_desshl, DESSHL_SIZE);
+   out.write(m_descrc, DESCRC_SIZE);
+   out.write(m_desshft, DESSHFT_SIZE);
+   out.write(m_desshdt, DESSHDT_SIZE);
+   out.write(m_desshrp, DESSHRP_SIZE);
+   out.write(m_desshsi, DESSHSI_SIZE);
+   out.write(m_desshsv, DESSHSV_SIZE);
+   out.write(m_desshsd, DESSHSD_SIZE);
+   out.write(m_desshtn, DESSHTN_SIZE);
+}
+
+std::ostream& ossimNitfXmlDataContentDes::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   bool typeinfo = ossimString(ossimPreferences::instance()->findPreference("kwl_type_info")).toBool();
+
+   std::string pfx = prefix;
+   pfx += getDesName() + ".";
+   
+   out << setiosflags(ios::left)
+       << pfx << std::setw(24) << "DESCRC:" << ((typeinfo) ? "(string)" : "") << m_descrc << "\n"
+       << pfx << std::setw(24) << "DESSHFT:" << ((typeinfo) ? "(string)" : "") << m_desshft << "\n"
+       << pfx << std::setw(24) << "DESSHDT:" << ((typeinfo) ? "(string)" : "") << m_desshdt << "\n"
+       << pfx << std::setw(24) << "DESSHRP:" << ((typeinfo) ? "(string)" : "") << m_desshrp << "\n"
+       << pfx << std::setw(24) << "DESSHSI:" << ((typeinfo) ? "(string)" : "") << m_desshsi << "\n"
+       << pfx << std::setw(24) << "DESSHSV:" << ((typeinfo) ? "(string)" : "") << m_desshsv << "\n"
+       << pfx << std::setw(24) << "DESSHSD:" << ((typeinfo) ? "(string)" : "") << m_desshsd << "\n"
+       << pfx << std::setw(24) << "DESSHTN:" << ((typeinfo) ? "(string)" : "") << m_desshtn << "\n"
+       // Quick hack to print on one line, this will leave extra spaces in CDATA sections
+       << pfx << std::setw(24) << "XML:" << m_xmlString.substitute(ossimString("\n"), " ", true) << "\n"
+   ;
+   return out;
+}
+
+void ossimNitfXmlDataContentDes::clearFields()
+{
+   memset(m_descrc, ' ', DESCRC_SIZE);
+   m_descrc[DESCRC_SIZE] = '\0';
+   memset(m_desshft, ' ', DESSHFT_SIZE);
+   m_desshft[DESSHFT_SIZE] = '\0';
+   memset(m_desshdt, ' ', DESSHDT_SIZE);
+   m_desshdt[DESSHDT_SIZE] = '\0';
+   memset(m_desshrp, ' ', DESSHRP_SIZE);
+   m_desshrp[DESSHRP_SIZE] = '\0';
+   memset(m_desshsi, ' ', DESSHSI_SIZE);
+   m_desshsi[DESSHSI_SIZE] = '\0';
+   memset(m_desshsv, ' ', DESSHSV_SIZE);
+   m_desshsv[DESSHSV_SIZE] = '\0';
+   memset(m_desshsd, ' ', DESSHSD_SIZE);
+   m_desshsd[DESSHSD_SIZE] = '\0';
+   memset(m_desshtn, ' ', DESSHTN_SIZE);
+   m_desshtn[DESSHTN_SIZE] = '\0';
+}
+
+bool ossimNitfXmlDataContentDes::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup;
+   lookup = kwl.find(prefix, "DESCRC");
+   {
+      strcpy(m_descrc, lookup);
+   }
+   lookup = kwl.find(prefix, "DESSHFT");
+   {
+      strcpy(m_desshft, lookup);
+   }
+   lookup = kwl.find(prefix, "DESSHDT");
+   {
+      strcpy(m_desshdt, lookup);
+   }
+   lookup = kwl.find(prefix, "DESSHRP");
+   {
+      strcpy(m_desshrp, lookup);
+   }
+   lookup = kwl.find(prefix, "DESSHSI");
+   {
+      strcpy(m_desshsi, lookup);
+   }
+   lookup = kwl.find(prefix, "DESSHSV");
+   {
+      strcpy(m_desshsv, lookup);
+   }
+   lookup = kwl.find(prefix, "DESSHSD");
+   {
+      strcpy(m_desshsd, lookup);
+   }
+   lookup = kwl.find(prefix, "DESSHTN");
+   {
+      strcpy(m_desshtn, lookup);
+   }
+
+   return true;
+}
+
+bool ossimNitfXmlDataContentDes::loadValueFromXml(const ossimRefPtr<ossimXmlDocument> xml, const ossimString& xpath, ossimString& target) const
+{
+  bool result = false;
+  if (xml->getErrorStatus()) return result;
+  std::vector<ossimRefPtr<ossimXmlNode> > xml_nodes;
+  xml->findNodes(xpath, xml_nodes);
+  if (xml_nodes.size())
+  { 
+    target = xml_nodes[0]->getText();
+    result = true;
+  }
+
+  return result;
+}
+
+ossimString ossimNitfXmlDataContentDes::getDescrc() const
+{
+   return ossimString(m_descrc);
+}
+
+ossimString ossimNitfXmlDataContentDes::getDesshft() const
+{
+   return ossimString(m_desshft);
+}
+
+ossimString ossimNitfXmlDataContentDes::getDesshdt() const
+{
+   return ossimString(m_desshdt);
+}
+
+ossimString ossimNitfXmlDataContentDes::getDesshrp() const
+{
+   return ossimString(m_desshrp);
+}
+
+ossimString ossimNitfXmlDataContentDes::getDesshsi() const
+{
+   return ossimString(m_desshsi);
+}
+ 
+ossimString ossimNitfXmlDataContentDes::getDesshsv() const
+{
+   return ossimString(m_desshsv);
+}
+
+ossimString ossimNitfXmlDataContentDes::getDesshsd() const
+{
+   return ossimString(m_desshsd);
+}
+
+ossimString ossimNitfXmlDataContentDes::getDesshtn() const
+{
+   return ossimString(m_desshtn);
+}
diff --git a/src/support_data/ossimNmeaMessage.cpp b/src/support_data/ossimNmeaMessage.cpp
new file mode 100644
index 0000000..3b1766c
--- /dev/null
+++ b/src/support_data/ossimNmeaMessage.cpp
@@ -0,0 +1,98 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL See top level LICENSE.txt file.
+//
+// File: ossimNmeaMessage.h
+//
+// Author:  Garrett Potts
+//
+// Description: Contains a general parser for NMEA messages.
+//
+//
+// $Id$
+//----------------------------------------------------------------------------
+#include <ossim/support_data/ossimNmeaMessage.h>
+#include <ossim/base/ossimCommon.h>
+#include <iomanip>
+
+ossim_uint32 ossimNmeaMessage::checksum(std::string::const_iterator start, std::string::const_iterator end)
+{
+   ossim_uint32 sum = 0;
+   
+   while(start!=end&&((*start)!='*'))
+   {
+      sum ^= ((*start)%128);
+      ++start;
+   }
+   return sum;
+}
+
+void ossimNmeaMessage::setFields(std::string::const_iterator start, std::string::const_iterator end)
+{
+   m_fields.clear();
+   ossim_uint32 idx = 0;
+   while(start != end)
+   {
+      m_fields.push_back("");
+      
+      while((start!=end)&&
+            (*start!=','))
+      {
+         m_fields[idx]+=*start;
+         ++start;
+      }
+      
+      if(start!=end)
+      {
+         ++start;
+      }
+      ++idx;
+   }
+}
+
+bool ossimNmeaMessage::isValidStartChar(char c)const
+{
+   std::string::const_iterator iter = std::find(m_startChars.begin(), m_startChars.end(), c);
+   return (iter != m_startChars.end());
+}
+
+
+void ossimNmeaMessage::parseMessage(std::istream& in)throw(ossimException)
+{
+   ossim::skipws(in);
+   m_validCheckSum = false;
+   m_message = "";
+   if(!isValidStartChar(static_cast<char>(in.peek())))
+   {
+      throw ossimException(ossimString("Starting NMEA message indicator not found, expected one of ") +
+                           m_startChars + " but found " +
+                           ossimString((char)in.peek()));
+   }
+   
+   char c = static_cast<char>(in.get());
+   while(((c!='\n')&&(c!='\r'))&&
+         !in.eof()&&!in.bad()) 
+   {
+      m_message += c;
+      c = static_cast<char>(in.get());
+   }
+   std::string::iterator iter = std::find(m_message.begin(), m_message.end(), '*');
+   
+   if(iter != m_message.end())
+   {
+      setFields(m_message.begin()+1, m_message.end());
+      ossim_uint32 check = checksum(m_message.begin()+1, iter);
+      std::ostringstream out;
+      out << std::setw(2) << std::setfill('0') << std::hex << check;
+      std::string::iterator endChecksumIter = iter+1;
+      while((endChecksumIter!= m_message.end())&&(*endChecksumIter!=',')) ++endChecksumIter;
+      if(out.str() == ossimString(iter+1, endChecksumIter).downcase()) 
+      {
+         m_validCheckSum = true;
+      }
+   }
+   else
+   {
+      throw ossimException("Terminating * indicator for cbecksum not found in NMEA message format");
+   }
+}
diff --git a/ossim/src/ossim/support_data/ossimNmeaMessageSequencer.cpp b/src/support_data/ossimNmeaMessageSequencer.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimNmeaMessageSequencer.cpp
rename to src/support_data/ossimNmeaMessageSequencer.cpp
diff --git a/ossim/src/ossim/support_data/ossimPpjFrameSensorFile.cpp b/src/support_data/ossimPpjFrameSensorFile.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimPpjFrameSensorFile.cpp
rename to src/support_data/ossimPpjFrameSensorFile.cpp
diff --git a/src/support_data/ossimQuickbirdMetaData.cpp b/src/support_data/ossimQuickbirdMetaData.cpp
new file mode 100644
index 0000000..d834063
--- /dev/null
+++ b/src/support_data/ossimQuickbirdMetaData.cpp
@@ -0,0 +1,1080 @@
+//*******************************************************************
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Description:
+// 
+// Class definition for ossimQuickbirdMetaData.
+// 
+// This class parses a Space Imaging Quickbird meta data file.
+//
+//********************************************************************
+// $Id: ossimQuickbirdMetaData.cpp 14431 2009-04-30 21:58:33Z dburken $
+
+#include <ossim/support_data/ossimQuickbirdMetaData.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <cstdio>
+#include <iostream>
+
+RTTI_DEF1(ossimQuickbirdMetaData, "ossimQuickbirdMetaData", ossimObject);
+ 
+// Define Trace flags for use within this file:
+static ossimTrace traceExec  ("ossimQuickbirdMetaData:exec");
+static ossimTrace traceDebug ("ossimQuickbirdMetaData:debug");
+
+ossimQuickbirdMetaData::ossimQuickbirdMetaData()
+   :
+   theGenerationDate("Unknown"),
+   theBandId("Unknown"),
+   theBitsPerPixel(0),
+   theSatID("Unknown"),
+   theTLCDate("Unknown"),
+   theSunAzimuth(0.0),
+   theSunElevation(0.0),
+   theSatAzimuth(0.0),
+   theSatElevation(0.0),
+   theTDILevel(0),
+   theAbsCalFactors(),
+   theBandNameList("Unknown"),
+   theImageSize()
+{
+   theImageSize.makeNan();
+   theAbsCalFactors.clear();
+}
+
+ossimQuickbirdMetaData::~ossimQuickbirdMetaData()
+{
+}
+
+bool ossimQuickbirdMetaData::open(const ossimFilename& imageFile)
+{
+   static const char MODULE[] = "ossimQuickbirdMetaData::open";
+
+   clearFields();
+
+   //retrieve information from the metadata file
+   //if the Quickbird tif is 02APR01105228-M1BS-000000128955_01_P001.TIF
+   //the metadata file will be 02APR01105228-M1BS-000000128955_01_P001.IMD
+
+   ossimFilename metadatafile = imageFile;
+   metadatafile.setExtension(ossimString("IMD"));
+
+   if( parseMetaData(metadatafile) == false )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+	    << MODULE << " errors parsing metadata" << std::endl;
+      }
+      return false;
+   }
+
+   return true;
+}
+
+void ossimQuickbirdMetaData::clearFields()
+{
+   theGenerationDate = "Unknown";
+   theBitsPerPixel = 0;
+   theBandId = "Unknown";
+   theSatID = "Unknown";
+   theTLCDate = "Unknown";
+   theSunAzimuth = 0.0;
+   theSunElevation = 0.0;
+   theSatAzimuth = 0.0;
+   theSatElevation = 0.0;
+   theTDILevel = 0;
+   theAbsCalFactors.clear();
+   theBandNameList = "Unknown";
+   theImageSize.makeNan();
+}
+
+std::ostream& ossimQuickbirdMetaData::print(std::ostream& out) const
+{
+
+   out << "\n----------------- Info on Quickbird Image -------------------"
+       << "\n  "
+       << "\n  Generation date:    " << theGenerationDate
+       << "\n  Band Id:            " << theBandId
+       << "\n  Bits per pixel:     " << theBitsPerPixel
+       << "\n  Sat Id:             " << theSatID
+       << "\n  TLC date:           " << theTLCDate
+       << "\n  Sun Azimuth:        " << theSunAzimuth
+       << "\n  Sun Elevation:      " << theSunElevation
+       << "\n  Sat Azimuth:        " << theSatAzimuth
+       << "\n  Sat Elevation:      " << theSatElevation
+       << "\n  Band name list:     " << theBandNameList
+       << "\n  TDI Level:          " << theTDILevel
+       << "\n  abs Calibration Factors:   " 
+       << std::endl;
+   for(unsigned int i=0; i<theAbsCalFactors.size(); i++)
+   {
+      out<<theAbsCalFactors[i] << "   ";
+   }
+   out << "\n  Image Size:         " << theImageSize
+       << "\n"
+       << "\n---------------------------------------------------------"
+       << "\n  " << std::endl;
+   return out;
+}
+
+bool ossimQuickbirdMetaData::saveState(ossimKeywordlist& kwl,
+				       const char* prefix)const
+{
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           "ossimQuickbirdMetaData",
+           true);
+
+   kwl.add(prefix,
+           "generation_date",
+           theGenerationDate,
+           true);
+
+   kwl.add(prefix,
+           "bits_per_pixel",
+           theBitsPerPixel,
+           true);
+
+   kwl.add(prefix,
+           "band_id",
+           theBandId,
+           true);
+
+   kwl.add(prefix,
+           "sat_id",
+           theSatID,
+           true);
+
+   kwl.add(prefix,
+           "tlc_date",
+           theTLCDate,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::AZIMUTH_ANGLE_KW,
+           theSunAzimuth,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::ELEVATION_ANGLE_KW,
+           theSunElevation,
+           true);
+
+   kwl.add(prefix,
+           "sat_azimuth_angle",
+           theSatAzimuth,
+           true);
+
+   kwl.add(prefix,
+           "sat_elevation_angle",
+           theSatElevation,
+           true);
+          
+   kwl.add(prefix,
+           "TDI_level",
+           theTDILevel,
+           true);
+   kwl.add(prefix,
+           "band_name_list",
+           theBandNameList,
+           true);
+
+   if( theBandId=="Multi" )
+   {
+      std::vector<ossimString> bandNameList = theBandNameList.split(" ");
+      for(unsigned int i = 0 ; i < bandNameList.size(); ++i)
+      {
+         kwl.add(prefix,
+                 bandNameList[i] + "_band_absCalFactor",
+                 theAbsCalFactors[i],
+                 true);
+
+      }
+   }
+   else if(!theAbsCalFactors.empty())
+   {
+      kwl.add(prefix,
+              "absCalFactor",
+              theAbsCalFactors[0],
+              true);  	
+   }
+
+   return true;
+}
+
+bool ossimQuickbirdMetaData::loadState(const ossimKeywordlist& kwl,
+				       const char* prefix)
+{
+   clearFields();
+
+   const char* lookup = 0;
+   ossimString s;
+  
+   lookup = kwl.find(prefix, ossimKeywordNames::TYPE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      if(s != "ossimQuickbirdMetaData")
+      {
+         return false;
+      }
+   }
+
+   lookup = kwl.find(prefix, "generation_date");
+   if (lookup)
+   {
+      theGenerationDate = lookup;
+   }
+
+   lookup = kwl.find(prefix, "band_id");
+   if (lookup)
+   {
+      theBandId = lookup;
+   }
+  
+   lookup = kwl.find(prefix, "bits_per_pixel");
+   if (lookup)
+   {
+      s = lookup;
+      theBitsPerPixel = s.toInt();;
+   }
+    
+   lookup = kwl.find(prefix, "sat_id");
+   if (lookup)
+   {
+      theSatID = lookup;
+   }
+
+   lookup = kwl.find(prefix, "tlc_date");
+   if (lookup)
+   {
+      theTLCDate= lookup;
+   }
+
+   lookup = kwl.find(prefix, "TDI_level");
+   if (lookup)
+   {
+      s = lookup;
+      theTDILevel = s.toInt();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::AZIMUTH_ANGLE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      theSunAzimuth = s.toFloat64();
+   }
+
+   lookup = kwl.find(prefix, ossimKeywordNames::ELEVATION_ANGLE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      theSunElevation = s.toFloat64();
+   }
+
+   lookup = kwl.find(prefix, "sat_azimuth_angle");
+   if (lookup)
+   {
+      s = lookup;
+      theSatAzimuth = s.toFloat64();
+   }
+
+   lookup = kwl.find(prefix, "sat_elevation_angle");
+   if (lookup)
+   {
+      s = lookup;
+      theSatElevation = s.toFloat64();
+   }
+
+   lookup = kwl.find(prefix, "band_name_list");
+   if (lookup)
+   {
+      theBandNameList= lookup;
+   }
+
+   if(theBandId=="Multi")
+   {
+      std::vector<ossimString> bandNameList = theBandNameList.split(" ");
+      theAbsCalFactors = std::vector<double>(bandNameList.size(), 1.);
+      for(unsigned int i = 0 ; i < bandNameList.size() ; ++i)
+      {
+         lookup = kwl.find(prefix, bandNameList[i] + "_band_absCalFactor");
+         if (lookup)
+         {
+            s = lookup;
+            theAbsCalFactors[i] = s.toDouble();
+         }
+      }
+   }
+   else if (theBandId=="P")
+   {
+      theAbsCalFactors = std::vector<double>(1, 1.);
+      lookup = kwl.find(prefix, "absCalFactor");
+      if (lookup)
+      {
+         s = lookup;
+         theAbsCalFactors[0] = s.toDouble();
+      }	
+   }
+   return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimQuickbirdMetaData::parseMetaData()
+//
+//  Parses the Quickbird IMD file.
+//
+//*****************************************************************************
+bool ossimQuickbirdMetaData::parseMetaData(const ossimFilename& data_file)
+{
+   if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimQuickbirdMetaData::parseMetaData(data_file): entering..." << std::endl;
+   
+   if( !data_file.exists() )
+   {
+      if (traceExec()) ossimNotify(ossimNotifyLevel_WARN) << "ossimQuickbirdMetaData::parseMetaData(data_file) WARN:" << "\nmetadate data file <" << data_file << ">. " << "doesn't exist..." << std::endl;
+      return false;
+   }
+  
+
+   FILE* fptr = fopen (data_file, "r");
+   if (!fptr)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+	    << "ossimQuickbirdRpcModel::parseMetaData(data_file) DEBUG:"
+	    << "\nCould not open Meta data file:  " << data_file
+	    << "\nreturning with error..." << std::endl;
+      }
+      return false;
+   }
+
+   char* strptr(NULL);
+
+   //---
+   // Read the file into a buffer:
+   //---
+   ossim_int32 fileSize = static_cast<ossim_int32>(data_file.fileSize());
+   char* filebuf = new char[fileSize];
+   fread(filebuf, 1, fileSize, fptr);
+   strptr = filebuf;
+   fclose(fptr);
+   ossimString temp;
+
+   //---
+   // Generation time:
+   //---
+  
+   if(getEndOfLine( strptr, ossimString("\ngenerationTime ="), "%17c %s", temp))
+      theGenerationDate = ossimString(temp).before(";");
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+	    << "\n\tAborting construction. Error encountered parsing "
+	    << "presumed meta-data file." << std::endl;
+
+         delete [] filebuf;
+         return false;
+      }
+   }
+
+   // Number of rows and columns in full image:
+   if(getEndOfLine( strptr, ossimString("\nnumRows ="), "%10c %s", temp))
+      theImageSize.line = ossimString(temp).before("\";").toInt();
+
+   if(getEndOfLine( strptr, ossimString("\nnumColumns ="), "%13c %s", temp))
+      theImageSize.samp = ossimString(temp).before("\";").toInt();
+
+   //---
+   // BandId:
+   //---
+   if(getEndOfLine( strptr, ossimString("\nbandId ="), "%9c %s", temp))
+      theBandId = ossimString(temp).after("\"").before("\";");
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+	    << "\n\tAborting construction. Error encountered parsing "
+	    << "presumed meta-data file." << std::endl;
+
+         delete [] filebuf;
+         return false;
+      }
+   }
+    
+  
+   //---
+   // BitsPerPixel:
+   //---
+   if(getEndOfLine( strptr, ossimString("\nbitsPerPixel = "), "%16c %s", temp))
+      theBitsPerPixel = ossimString(temp).before(";").toInt();
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+	    << "\n\tAborting construction. Error encountered parsing "
+	    << "presumed meta-data file." << std::endl;
+
+         delete [] filebuf;
+         return false;
+      }
+   }
+     
+   //---
+   // absCalFactors:
+   //---
+
+   char *iter = (char *)filebuf;
+   unsigned int nbBand = 0;
+   theBandNameList = "";
+   for(iter = strstr(iter, "BEGIN_GROUP = BAND_"); iter ; iter = strstr(iter, "BEGIN_GROUP = BAND_"))
+   {
+      ++nbBand;
+      char dummy[80], nameChar[80];
+      sscanf(iter, "%19c %s", dummy, nameChar);
+      ossimString bandCur = ossimString(nameChar).before("\n");
+      theBandNameList = theBandNameList + bandCur + " ";
+      ++iter;
+   }
+   theBandNameList.trim();
+   
+   //--- Multispectral
+   if(theBandId=="Multi")
+   {
+      std::vector<ossimString> bandList;
+      bandList = theBandNameList.split(" ");
+      theAbsCalFactors = std::vector<double>(bandList.size(), 1.);
+      for(unsigned int j=0; j<bandList.size(); j++)
+      {
+         ossimString begin_group = "BEGIN_GROUP = BAND_" + bandList[j];
+         strptr = strstr(filebuf, begin_group.c_str());
+         if(!strptr && traceDebug())
+         {	  				
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+            delete [] filebuf;
+            return false;
+         }
+         else
+         {
+            char dummy[80], nameChar[80];
+            sscanf(strptr, "%19c %s", dummy, nameChar);
+            ossimString bandCur = ossimString(nameChar).before("\n");
+            if(!strptr && traceDebug())
+            {	  				
+               ossimNotify(ossimNotifyLevel_FATAL)
+                  << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+                  << "\n\tAborting construction. Error encountered parsing "
+                  << "presumed meta-data file." << std::endl;
+               delete [] filebuf;
+               return false;
+            }
+            else
+            {
+               if(bandList[j] == bandCur)
+               {
+                  strptr = strstr(strptr, "\tabsCalFactor = ");
+                  sscanf(strptr, "%16c %s", dummy, nameChar);
+                  theAbsCalFactors[j] = ossimString(nameChar).before(";").toDouble();
+               }
+            }
+         }
+      }
+   }
+   //--- Panchromatic
+   else
+   {
+      theAbsCalFactors = std::vector<double>(1, 1.);
+      if(getEndOfLine( strptr, ossimString("\tabsCalFactor = "), "%16c %s", temp))
+         theAbsCalFactors[0] = ossimString(temp).before(";").toDouble();
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+    
+   //---
+   // SatID:
+   //---
+   if(getEndOfLine( strptr, ossimString("\n\tsatId ="), "%9c %s", temp))
+      theSatID = ossimString(temp).after("\"").before("\";");
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+	    << "\n\tAborting construction. Error encountered parsing "
+	    << "presumed meta-data file." << std::endl;
+
+         delete [] filebuf;
+         return false;
+      }
+   }
+
+   //---
+   // TLCTime:
+   //---
+   if(getEndOfLine( strptr, ossimString("\n\tTLCTime ="), "%11c %s", temp))
+      theTLCDate = ossimString(temp).before("\";");
+   else
+   {
+      if(getEndOfLine( strptr, ossimString("\n\tfirstLineTime ="), "%17c %s", temp))
+         theTLCDate = ossimString(temp).before("\";");
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+   
+   //---
+   // Sun Azimuth:
+   //---
+   if(getEndOfLine( strptr, ossimString("\n\tsunAz ="), "%9c %s", temp))
+        theSunAzimuth = ossimString(temp).before(";").toFloat64();
+   else
+   {
+      if(getEndOfLine( strptr, ossimString("\n\tmeanSunAz ="), "%13c %s", temp))
+         theSunAzimuth = ossimString(temp).before(";").toFloat64();
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+
+   //---
+   // Sun Elevation:
+   //---
+   if(getEndOfLine( filebuf, ossimString("\n\tsunEl ="), "%9c %s", temp))
+        theSunElevation = ossimString(temp).before(";").toFloat64();
+   else
+   {
+      if(getEndOfLine( filebuf, ossimString("\n\tmeanSunEl ="), "%13c %s", temp))
+         theSunElevation = ossimString(temp).before(";").toFloat64();
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+
+   //---
+   // Sun Azimuth:
+   //---
+   if(getEndOfLine( strptr, ossimString("\n\tsunAz ="), "%9c %s", temp))
+      theSunAzimuth = ossimString(temp).before(";").toFloat64();
+   else
+   {
+      if(getEndOfLine( strptr, ossimString("\n\tmeanSunAz ="), "%13c %s", temp))
+         theSunAzimuth = ossimString(temp).before(";").toFloat64();
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+            
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+
+   //---
+   // Sun Elevation:
+   //---
+   if(getEndOfLine( filebuf, ossimString("\n\tsunEl ="), "%9c %s", temp))
+      theSunElevation = ossimString(temp).before(";").toFloat64();
+   else
+   {
+      if(getEndOfLine( filebuf, ossimString("\n\tmeanSunEl ="), "%13c %s", temp))
+         theSunElevation = ossimString(temp).before(";").toFloat64();
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+
+
+   //---
+   // Sat Azimuth:
+   //---
+   if(getEndOfLine( strptr, ossimString("\n\tsatAz ="), "%9c %s", temp))
+      theSatAzimuth = ossimString(temp).before(";").toFloat64();
+   else
+   {
+      if(getEndOfLine( strptr, ossimString("\n\tmeanSatAz ="), "%13c %s", temp))
+         theSatAzimuth = ossimString(temp).before(";").toFloat64();
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+            
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+   
+   //---
+   // Sat Elevation:
+   //---
+   if(getEndOfLine( filebuf, ossimString("\n\tsatEl ="), "%9c %s", temp))
+      theSatElevation = ossimString(temp).before(";").toFloat64();
+   else
+   {
+      if(getEndOfLine( filebuf, ossimString("\n\tmeanSatEl ="), "%13c %s", temp))
+         theSatElevation = ossimString(temp).before(";").toFloat64();
+      else
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_FATAL)
+               << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+               << "\n\tAborting construction. Error encountered parsing "
+               << "presumed meta-data file." << std::endl;
+            
+            delete [] filebuf;
+            return false;
+         }
+      }
+   }
+   
+   
+   //---
+   // TDILevel:
+   //---
+   if(getEndOfLine( strptr, ossimString("\n\tTDILevel = "), "%13c %s", temp))
+      theTDILevel = ossimString(temp).before(";").toInt();
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+	    << "FATAL ossimQuickbirdRpcModel::parseMetaData(data_file): "
+	    << "\n\tAborting construction. Error encountered parsing "
+	    << "presumed meta-data file." << std::endl;
+
+         delete [] filebuf;
+         return false;
+      }
+   }
+
+
+   delete [] filebuf;
+   filebuf = 0;
+
+   if (traceExec())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "DEBUG ossimQuickbirdRpcModel::parseMetaData(data_file): returning..."
+         << std::endl;
+   }
+
+   return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimQuickbirdMetaData::parseGEOData()
+//
+//  Parses the Quickbird GEO file.
+//
+//*****************************************************************************
+bool ossimQuickbirdMetaData::parseGEOData(const ossimFilename& /* data_file */)
+{
+  return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimQuickbirdMetaData::parseRpcData()
+//
+//  Parses the Quickbird EPH file.
+//
+//*****************************************************************************
+bool ossimQuickbirdMetaData::parseEPHData(const ossimFilename& /* data_file */)
+{
+  return true;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimQuickbirdMetaData::parseRpcData()
+//
+//  Parses the Quickbird ATT file.
+//
+//*****************************************************************************
+bool ossimQuickbirdMetaData::parseATTData(const ossimFilename& /* data_file */)
+{
+  return true;
+}
+
+ossimString ossimQuickbirdMetaData::getSatID() const
+{
+   return theSatID;
+}
+
+bool ossimQuickbirdMetaData::getMapProjectionKwl( const ossimFilename& imd_file,
+                                                  ossimKeywordlist& kwl )
+{
+   static const char MODULE[] = "ossimQuickbirdMetaData::getMapProjectionKwl";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+   
+   bool result = false;
+   
+   if( imd_file.exists() )
+   {
+      FILE* fptr = fopen (imd_file.c_str(), "r");
+      if (fptr)
+      {
+
+         char* strptr(NULL);
+         
+         //---
+         // Read the file into a buffer:
+         //---
+         ossim_int32 fileSize = static_cast<ossim_int32>(imd_file.fileSize());
+         char* filebuf = new char[fileSize];
+         fread(filebuf, 1, fileSize, fptr);
+         strptr = filebuf;
+         fclose(fptr);
+         ossimString imd_key;
+         ossimString tempStr;
+         std::string key;
+         std::string value;
+
+
+         // Loop until we find all our keys or bust out with error.
+         while ( 1 )
+         {
+            // Verify map projected.
+            imd_key = "BEGIN_GROUP = MAP_PROJECTED_PRODUCT";
+            if ( strstr( filebuf, imd_key.c_str() ) == NULL )
+            {
+               break; // Not a map projected product.
+            }
+
+            // Get datum:
+            if( getEndOfLine( strptr, ossimString("\n\tdatumName = "), "%13c %s", tempStr) )
+            {
+               if ( tempStr.contains("WE") )
+               {
+                  key = "dataum";
+                  value   = "WGE";
+                  kwl.addPair(key, value);
+               }
+               else
+               {
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "Unhandled datum: " << tempStr << "\n";
+                  }
+               }
+            }
+
+            // Get projection:
+            if( getEndOfLine( strptr, ossimString("\n\tmapProjName = "), "%15c %s", tempStr) )
+            {
+               if ( tempStr.contains("UTM") )
+               {
+                  key = "type";
+                  value   = "ossimUtmProjection";
+                  kwl.addPair(key, value);
+               }
+               else
+               {
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "Unhandled projection name: " << tempStr << "\n";
+                  }
+               }
+            }
+
+             // Get projection:
+            if( getEndOfLine( strptr, ossimString("\n\tmapProjName = "), "%15c %s", tempStr) )
+            {
+               if ( tempStr.contains("UTM") )
+               {
+                  key = "type";
+                  value   = "ossimUtmProjection";
+                  kwl.addPair(key, value);
+
+                  // Get UTM zone:
+                  if( getEndOfLine( strptr, ossimString("\n\tmapZone = "), "%11c %s", tempStr) )
+                  {
+                     key = "zone";
+                     value = tempStr.trim(";").string();
+                     kwl.addPair(key, value);
+                  }
+                  else
+                  {
+                     break;
+                  }
+                  
+                  // Get UTM hemisphere:
+                  if( getEndOfLine( strptr, ossimString("\n\tmapHemi = "), "%11c %s", tempStr) )
+                  {
+                     key = "hemisphere";
+                     tempStr = tempStr.trim(";");
+                     tempStr = tempStr.trim("\"");
+                     value = tempStr.string();
+                     kwl.addPair(key, value);
+                  }
+                  else
+                  {
+                     break;
+                  }
+                  
+               } // End UTM:
+            }
+
+            // Get projection units:
+            std::string units;
+            if( getEndOfLine( strptr, ossimString("\n\tproductUnits = "), "%16c %s", tempStr) )
+            {
+               if ( tempStr == "\"M\";" )
+               {
+                  key = "units";
+                  units = "meters";
+                  kwl.addPair(key, units);
+               }
+               else
+               {
+                  if(traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << "Unhandled units: " << tempStr << "\n";
+                  }
+               }
+            }
+
+            // Get projection tie point:
+            ossimDpt dpt;
+            dpt.makeNan();
+            if( getEndOfLine( strptr, ossimString("\n\toriginX = "), "%11c %s", tempStr) )
+            {
+               tempStr = tempStr.trim(";");
+               dpt.x = tempStr.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            if( getEndOfLine( strptr, ossimString("\n\toriginY = "), "%11c %s", tempStr) )
+            {
+               tempStr = tempStr.trim(";");
+               dpt.y = tempStr.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            if ( dpt.hasNans() == false )
+            {  
+               key = "tie_point_units";
+               kwl.addPair(key, units);
+
+               key = "tie_point_xy";
+               value = dpt.toString().string();
+               kwl.addPair( key, value );
+            }
+            else
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << "tie point has nans!";
+               }
+               break;
+            }
+
+            // Get projection scale:
+            dpt.makeNan();
+            if( getEndOfLine( strptr, ossimString("\n\tcolSpacing = "), "%14c %s", tempStr) )
+            {
+               tempStr = tempStr.trim(";");
+               dpt.x = tempStr.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            if( getEndOfLine( strptr, ossimString("\n\trowSpacing = "), "%14c %s", tempStr) )
+            {
+               tempStr = tempStr.trim(";");
+               dpt.y = tempStr.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+
+            if ( dpt.hasNans() == false )
+            {  
+               key = "pixel_scale_units";
+               kwl.addPair(key, units);
+
+               key = "pixel_scale_xy";
+               value = dpt.toString().string();
+               kwl.addPair( key, value );
+            }
+            else
+            {
+               if(traceDebug())
+               {
+                  ossimNotify(ossimNotifyLevel_WARN)
+                     << "scale has nans!";
+               }
+               break;
+            }
+            
+            //---
+            // End of key look up. If we get here set the status to true and
+            // bust out of loop.
+            //---
+            result = true;
+            break;
+         }
+
+         if ( result == false )
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ERROR: Missing or unhandled key in metadat: " << imd_key << "\n";
+            }
+         }
+
+         delete [] filebuf;
+         filebuf = 0;
+      }
+      else
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimQuickbirdRpcModel::parseMetaData(imd_file) DEBUG:"
+               << "\nCould not open Meta data file:  " << imd_file
+	    << "\nreturning with error...\n";
+         }
+      }
+   }
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exit status = " << (result?"true":"false") << "\n";
+   }
+
+   return result;
+}
+
+//*****************************************************************************
+// PROTECTED METHOD: ossimQuickbirdMetaData::getEndOfLine
+//
+// //  Parse a char * to find another char *. Change the pointer only if the second char * is found.
+//
+//*****************************************************************************
+bool ossimQuickbirdMetaData::getEndOfLine( char * fileBuf,
+                                           ossimString lineBeginning,
+                                           const char * format,
+                                           ossimString & name)
+{
+   //char * res = strstr(fileBuf, lineBeginning.c_str());
+   //if (!res)
+   //{
+   //  return false;
+   // }
+   //// if the lineBeginning is found, update the start pointer adress
+   //fileBuf = res;
+   
+   //char dummy[80], nameChar[80];
+   //sscanf(res, format, dummy, nameChar);    
+   //name = ossimString(nameChar);
+    
+   char * res = strstr(fileBuf, lineBeginning.c_str());
+   if(!res)
+   {
+      return false;
+   }
+   fileBuf = strstr(fileBuf, lineBeginning.c_str());
+   char dummy[80], nameChar[80];
+   sscanf(fileBuf, format, dummy, nameChar);  
+   name = ossimString(nameChar);
+    
+   return true;
+}
+
+const ossimIpt& ossimQuickbirdMetaData::getImageSize() const
+{
+   return theImageSize;
+}
diff --git a/src/support_data/ossimQuickbirdRpcHeader.cpp b/src/support_data/ossimQuickbirdRpcHeader.cpp
new file mode 100644
index 0000000..69fefb4
--- /dev/null
+++ b/src/support_data/ossimQuickbirdRpcHeader.cpp
@@ -0,0 +1,246 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimQuickbirdRpcHeader.cpp 9094 2006-06-13 19:12:40Z dburken $
+
+#include <ossim/support_data/ossimQuickbirdRpcHeader.h>
+#include <iostream>
+#include <fstream>
+#include <algorithm>
+#include <iterator>
+
+std::ostream& operator << (std::ostream& out,
+		      const ossimQuickbirdRpcHeader& data)
+{
+   out << "theSatId      = " << data.theSatId << std::endl
+       << "theBandId     = " << data.theBandId << std::endl
+       << "theSpecId     = " << data.theSpecId << std::endl
+       << "theErrBias    = " << data.theErrBias << std::endl
+       << "theLineOffset = " << data.theLineOffset << std::endl
+       << "theSampOffset = " << data.theSampOffset << std::endl
+       << "theLatOffset  = " << data.theLatOffset << std::endl
+       << "theLonOffset  = " << data.theLonOffset << std::endl
+       << "theHeightOffset  = " << data.theHeightOffset << std::endl
+       << "theLineScale  = " << data.theLineScale << std::endl
+       << "theSampScale  = " << data.theSampScale << std::endl
+       << "theLatScale  = " << data.theLatScale << std::endl
+       << "theLonScale  = " << data.theLonScale << std::endl
+       << "theHeightScale  = " << data.theHeightScale << std::endl;
+   
+   out << "lineNumCoef = " << std::endl;
+   std::copy(data.theLineNumCoeff.begin(),
+             data.theLineNumCoeff.end(),
+             std::ostream_iterator<double>(out, "\n"));
+   out << "lineDenCoef = " << std::endl;
+   std::copy(data.theLineDenCoeff.begin(),
+             data.theLineDenCoeff.end(),
+             std::ostream_iterator<double>(out, "\n"));
+   out << "sampNumCoef = " << std::endl;
+   std::copy(data.theSampNumCoeff.begin(),
+             data.theSampNumCoeff.end(),
+             std::ostream_iterator<double>(out, "\n"));
+   out << "sampDenCoef = " << std::endl;
+   std::copy(data.theSampDenCoeff.begin(),
+             data.theSampDenCoeff.end(),
+             std::ostream_iterator<double>(out, "\n"));
+   
+   return out;
+}
+
+
+ossimQuickbirdRpcHeader::ossimQuickbirdRpcHeader()
+{
+}
+
+bool ossimQuickbirdRpcHeader::open(const ossimFilename& file)
+{
+   theFilename = file;
+   std::ifstream in(file.c_str(), std::ios::in|std::ios::binary);
+   
+   char test[64];
+   
+   in.read((char*)test, 63);
+   test[63] = '\0';
+   in.seekg(0);
+   ossimString line = test;
+   line = line.upcase();
+   
+   if(parseNameValue(line))
+   {
+      theErrorStatus = ossimErrorCodes::OSSIM_OK;
+      getline(in,
+              line);
+      while((in)&&(theErrorStatus == ossimErrorCodes::OSSIM_OK))
+      {
+         line = line.upcase();
+         if(line.contains("LINENUMCOEF"))
+         {
+            if(!readCoeff(in, theLineNumCoeff))
+            {
+               setErrorStatus();
+               break;
+            }
+         }
+         else if(line.contains("LINEDENCOEF"))
+         {
+            if(!readCoeff(in, theLineDenCoeff))
+            {
+               setErrorStatus();
+               break;
+            }
+         }
+         else if(line.contains("SAMPNUMCOEF"))
+         {
+            if(!readCoeff(in, theSampNumCoeff))
+            {
+               setErrorStatus();
+               break;
+            }
+         }
+         else if(line.contains("SAMPDENCOEF"))
+         {
+            if(!readCoeff(in, theSampDenCoeff))
+            {
+               setErrorStatus();
+               break;
+            }
+         }
+         else if(!parseNameValue(line))
+         {
+            setErrorStatus();
+            break;
+         }
+         getline(in,
+                 line);
+      }
+   }
+   else
+   {
+      setErrorStatus();
+   }
+   return (theErrorStatus == ossimErrorCodes::OSSIM_OK);
+}
+
+bool ossimQuickbirdRpcHeader::readCoeff(std::istream& in,
+					std::vector<double>& coeff)
+{
+   coeff.clear();
+   bool done = false;
+   ossimString line;
+   while(!in.eof()&&!in.bad()&&!done)
+   {
+      getline(in,
+	      line);
+      line.trim();
+      line.trim(',');
+      if(line.contains(");"))
+      {
+         done = true;
+         line.trim(';');
+         line.trim(')');
+      }
+      coeff.push_back(line.toDouble());
+   }
+   return done;
+}
+
+bool ossimQuickbirdRpcHeader::parseNameValue(const ossimString& line)
+{
+   bool result = true;
+   ossimString lineCopy = line;
+   
+   if(lineCopy.contains("SATID"))
+   {
+      theSatId = lineCopy.after("\"");
+      theSatId = theSatId.before("\"");
+   }
+   else if(lineCopy.contains("BANDID"))
+   {
+      theBandId = lineCopy.after("\"");
+      theBandId = theBandId.before("\"");
+   }
+   else if(lineCopy.contains("SPECID"))
+   {
+      theSpecId = lineCopy.after("\"");
+      theSpecId = theSpecId.before("\"");
+   }
+   else if(lineCopy.contains("BEGIN_GROUP"))
+   {
+   }
+   else if(lineCopy.contains("ERRBIAS"))
+   {
+      lineCopy = lineCopy.after("=");
+      theErrBias = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("ERRRAND"))
+   {
+      lineCopy = lineCopy.after("=");
+      theErrRand = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("LINEOFFSET"))
+   {
+      lineCopy = lineCopy.after("=");
+      theLineOffset = lineCopy.before(";").toInt();
+   }
+   else if(lineCopy.contains("SAMPOFFSET"))
+   {
+      lineCopy = lineCopy.after("=");
+      theSampOffset = lineCopy.before(";").toInt();
+   }
+   else if(lineCopy.contains("LATOFFSET"))
+   {
+      lineCopy = lineCopy.after("=");
+      theLatOffset = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("LONGOFFSET"))
+   {
+      lineCopy = lineCopy.after("=");
+      theLonOffset = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("HEIGHTOFFSET"))
+   {
+      lineCopy = lineCopy.after("=");
+      theHeightOffset = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("LINESCALE"))
+   {
+      lineCopy = lineCopy.after("=");
+      theLineScale = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("SAMPSCALE"))
+   {
+      lineCopy = lineCopy.after("=");
+      theSampScale = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("LATSCALE"))
+   {
+      lineCopy = lineCopy.after("=");
+      theLatScale = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("LONGSCALE"))
+   {
+      lineCopy = lineCopy.after("=");
+      theLonScale = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("HEIGHTSCALE"))
+   {
+      lineCopy = lineCopy.after("=");
+      theHeightScale = lineCopy.before(";").toDouble();
+   }
+   else if(lineCopy.contains("END_GROUP"))
+   {
+   }
+   else if(lineCopy.contains("END"))
+   {
+   }
+   else
+   {
+      result = false;
+   }
+
+   return result;
+}
diff --git a/ossim/src/ossim/support_data/ossimQuickbirdTile.cpp b/src/support_data/ossimQuickbirdTile.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimQuickbirdTile.cpp
rename to src/support_data/ossimQuickbirdTile.cpp
diff --git a/src/support_data/ossimRpfAttributeOffsetRecord.cpp b/src/support_data/ossimRpfAttributeOffsetRecord.cpp
new file mode 100644
index 0000000..8c499f4
--- /dev/null
+++ b/src/support_data/ossimRpfAttributeOffsetRecord.cpp
@@ -0,0 +1,59 @@
+#include <ossim/support_data/ossimRpfAttributeOffsetRecord.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(
+   std::ostream& out, const ossimRpfAttributeOffsetRecord& data)
+{
+   data.print(out);
+   
+   return out;
+}
+
+ossimRpfAttributeOffsetRecord::ossimRpfAttributeOffsetRecord()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfAttributeOffsetRecord::parseStream(ossim::istream& in,
+                                                          ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      in.read((char*)&theAttributeId, 2);
+      in.read((char*)&theParameterId, 1);
+      in.read((char*)&theArealCoverageSequenceNumber, 1);
+      in.read((char*)&theAttributeRecordOffset, 4);
+
+      ossimEndian anEndian;
+
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theAttributeId);
+         anEndian.swap(theAttributeRecordOffset);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfAttributeOffsetRecord::print(std::ostream& out)const
+{
+   out << "theAttributeId:                  " << theAttributeId
+       << "\ntheParameterId:                  " << theParameterId
+       << "\ntheArealCoverageSequenceNumber:  " << theArealCoverageSequenceNumber
+       << "\ntheAttributeRecordOffset:        " << theAttributeRecordOffset;
+}
+
+void ossimRpfAttributeOffsetRecord::clearFields()
+{
+   theAttributeId                 = 0;
+   theParameterId                 = 0;
+   theArealCoverageSequenceNumber = 0;
+   theAttributeRecordOffset       = 0;
+}
diff --git a/src/support_data/ossimRpfAttributeSectionSubheader.cpp b/src/support_data/ossimRpfAttributeSectionSubheader.cpp
new file mode 100644
index 0000000..59e502f
--- /dev/null
+++ b/src/support_data/ossimRpfAttributeSectionSubheader.cpp
@@ -0,0 +1,87 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// Author: Garrett Potts (gpotts at imagelinks.com)
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimRpfAttributeSectionSubheader.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(
+   std::ostream& out, const ossimRpfAttributeSectionSubheader& data)
+{
+   data.print(out);
+   
+   return out;
+}
+
+ossimRpfAttributeSectionSubheader::ossimRpfAttributeSectionSubheader()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfAttributeSectionSubheader::parseStream(ossim::istream& in,
+                                                              ossimByteOrder byteOrder)
+{
+   theAttributeSectionSubheaderStart = 0;
+   theAttributeSectionSubheaderEnd = 0;
+   if(in)
+   {
+      theAttributeSectionSubheaderStart = in.tellg();
+      in.read((char*)&theNumberOfAttributeOffsetRecords, 2);
+      in.read((char*)&theNumberOfExplicitArealCoverageRecords, 2);
+      in.read((char*)&theAttributeOffsetTableOffset, 4);
+      in.read((char*)&theAttribteOffsetRecordLength, 2);
+      ossimEndian anEndian;
+
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theNumberOfAttributeOffsetRecords);
+         anEndian.swap(theNumberOfExplicitArealCoverageRecords);
+         anEndian.swap(theAttributeOffsetTableOffset);
+         anEndian.swap(theAttribteOffsetRecordLength);
+      }
+      theAttributeSectionSubheaderEnd = in.tellg();
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfAttributeSectionSubheader::print(std::ostream& out)const
+{
+   out << "theNumberOfAttributeOffsetRecords:         " << theNumberOfAttributeOffsetRecords
+       << "\ntheNumberOfExplicitArealCoverageRecords:   " << theNumberOfExplicitArealCoverageRecords
+       << "\ntheAttributeOffsetTableOffset:             " << theAttributeOffsetTableOffset
+       << "\ntheAttribteOffsetRecordLength:             " << theAttribteOffsetRecordLength;
+}
+
+void ossimRpfAttributeSectionSubheader::clearFields()
+{
+   theNumberOfAttributeOffsetRecords       = 0;
+   theNumberOfExplicitArealCoverageRecords = 0;
+   theAttributeOffsetTableOffset           = 0;
+   theAttribteOffsetRecordLength           = 0;
+   
+   theAttributeSectionSubheaderStart       = 0;
+   theAttributeSectionSubheaderEnd         = 0;
+}
+
+ossim_uint64 ossimRpfAttributeSectionSubheader::getSubheaderStart()const
+{
+   return theAttributeSectionSubheaderStart;
+}
+
+ossim_uint64 ossimRpfAttributeSectionSubheader::getSubheaderEnd()const
+{
+   return theAttributeSectionSubheaderEnd;
+}
diff --git a/src/support_data/ossimRpfAttributes.cpp b/src/support_data/ossimRpfAttributes.cpp
new file mode 100644
index 0000000..4e6fb6f
--- /dev/null
+++ b/src/support_data/ossimRpfAttributes.cpp
@@ -0,0 +1,170 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfAttributes.cpp 14241 2009-04-07 19:59:23Z dburken $
+
+#include <iostream>
+ 
+#include <ossim/support_data/ossimRpfAttributes.h>
+
+std::ostream& operator<<(std::ostream& out,
+                    const ossimRpfAttributes& data)
+{
+   data.print(out);
+   
+   return out;
+}
+
+ossimRpfAttributes::ossimRpfAttributes()
+{
+   clearFields();
+}
+ossimRpfAttributes::~ossimRpfAttributes()
+{
+}
+
+std::ostream& ossimRpfAttributes::print(std::ostream& out,
+                                        const std::string& prefix) const
+{
+   out << prefix << "CurrencyDate: " << theCurrencyDate << "\n"
+       << prefix << "ProductionDate: " << theProductionDate << "\n"
+       << prefix << "SignificantDate: " << theSignificantDate << "\n"
+       << prefix << "ChartSeriesCode: " << theChartSeriesCode << "\n"
+       << prefix << "MapDesignationCode: " << theMapDesignationCode << "\n"
+       << prefix << "OldHorDatum: " << theOldHorDatum << "\n"
+       << prefix << "Edition: " << theEdition << "\n"
+       << prefix << "ProjectionCode: " << theProjectionCode << "\n"
+       << prefix << "ProjectionA: " << theProjectionA << "\n"
+       << prefix << "ProjectionB: " << theProjectionB << "\n"
+       << prefix << "ProjectionC: " << theProjectionC << "\n"
+       << prefix << "ProjectionD: " << theProjectionD << "\n"
+       << prefix << "VertDatumCode: " << theVertDatumCode<< "\n"
+       << prefix << "HorDatumCode: " << theHorDatumCode << "\n"
+       << prefix << "VertAbsAccuracy: " << theVertAbsAccuracy << "\n"
+       << prefix << "VertAbsUnits: " << theVertAbsUnits << "\n"
+       << prefix << "HorAbsAccuracy: " << theHorAbsAccuracy << "\n"
+       << prefix << "HorAbsUnits: " << theHorAbsUnits << "\n"
+       << prefix << "VertRelAccuracy: " << theVertRelAccuracy << "\n"
+       << prefix << "VertRelUnits: " << theVertRelUnits << "\n"
+       << prefix << "HorRelAccuracy: " << theHorRelAccuracy << "\n"
+       << prefix << "HorRelUnits: " << theHorRelUnits << "\n"
+       << prefix << "ellipsoidCode: " << ellipsoidCode << "\n"
+       << prefix << "SoundingDatumCode: " << theSoundingDatumCode << "\n"
+       << prefix << "NavSystemCode: " << theNavSystemCode << "\n"
+       << prefix << "GridCode: " << theGridCode << "\n"
+       << prefix << "EeasterlyMagChange: " << theEeasterlyMagChange << "\n"
+       << prefix << "EasterlyMagChangeUnits: " << theEasterlyMagChangeUnits << "\n"
+       << prefix << "WesterlyMagChange: " << theWesterlyMagChange << "\n"
+       << prefix << "WesterlyMagChangeUnits: " << theWesterlyMagChangeUnits << "\n"
+       << prefix << "MagAngle: " << theMagAngle << "\n"
+       << prefix << "GridConver: " << theGridConver << "\n"
+       << prefix << "GridConverUnits: " << theGridConverUnits << "\n"
+       << prefix << "HighElevation: " << theHighElevation << "\n"
+       << prefix << "HighElevationUnits: " << theHighElevationUnits << "\n"
+       << prefix << "HighLat: " << theHighLat << "\n"
+       << prefix << "HighLon: " << theHighLon << "\n"
+       << prefix << "LegendFileName: " << theLegendFileName << "\n"
+       << prefix << "DataSource: " << theDataSource << "\n"
+       << prefix << "gsd: " << theGsd << "\n"
+       << prefix << "DataLevel: " << theDataLevel << std::endl;
+   return out;
+}
+
+bool ossimRpfAttributes::isEmpty()const
+{
+   for(std::map<ossim_uint32, bool>::const_iterator iter= theAttributeIdBoolMap.begin();
+       iter != theAttributeIdBoolMap.end();++iter)
+   {
+      if(iter->second!=false)
+      {
+         return false;
+      }
+   }
+   return true;
+}
+
+void ossimRpfAttributes::clearFields()
+{
+   theCurrencyDate    = "";
+   theProductionDate  = "";
+   theSignificantDate = "";
+   theChartSeriesCode = "";
+   theMapDesignationCode = "";
+   theOldHorDatum = "";
+   theEdition = "";
+   theProjectionCode = "";
+   theProjectionA = 0.0;
+   theProjectionB = 0.0;
+   theProjectionC = 0.0;
+   theProjectionD = 0.0;
+   theVertDatumCode = "";
+   theHorDatumCode = "";
+   theVertAbsAccuracy = 0;
+   theVertAbsUnits = 0;
+   theHorAbsAccuracy = 0;
+   theHorAbsUnits    = 0;
+   theVertRelAccuracy = 0;
+   theVertRelUnits = 0;
+   theHorRelAccuracy = 0;
+   theHorRelUnits = 0;
+   ellipsoidCode = "";
+   theSoundingDatumCode = "";
+   theNavSystemCode = 0;
+   theGridCode = "";
+   theEeasterlyMagChange = 0.0;
+   theEasterlyMagChangeUnits = 0;
+   theWesterlyMagChange = 0.0;
+   theWesterlyMagChangeUnits = 0;
+   theMagAngle = 0.0;
+   theMagAngleUnits = 0;
+   theGridConver = 0.0;
+   theGridConverUnits = 0;
+   theHighElevation = 0.0;
+   theHighElevationUnits = 0;
+   theHighLat = 0.0;
+   theHighLon = 0.0;
+   theLegendFileName = "";
+   theDataSource = "";
+   theGsd = 0;
+   theDataLevel = 0;
+
+   theAttributeIdBoolMap.clear();
+}
+
+void ossimRpfAttributes::setAttributeFlag(ossim_uint32 id,
+                                          bool flag)
+{
+   std::map<ossim_uint32, bool>::iterator iter = theAttributeIdBoolMap.find(id);
+
+   if(iter != theAttributeIdBoolMap.end())
+   {
+      if(flag)
+      {
+         iter->second = flag;
+      }
+      else
+      {
+         theAttributeIdBoolMap.erase(iter); 
+      }
+   }
+   else if(flag)
+   {
+	   theAttributeIdBoolMap.insert(std::make_pair(id, flag));
+   }
+}
+
+bool ossimRpfAttributes::getAttributeFlag(ossim_uint32 id)const
+{
+   std::map<ossim_uint32, bool>::const_iterator iter = theAttributeIdBoolMap.find(id);
+
+   if(iter != theAttributeIdBoolMap.end())
+   {
+      return iter->second;
+   }
+
+   return false;
+}
diff --git a/ossim/src/ossim/support_data/ossimRpfBoundaryRectRecord.cpp b/src/support_data/ossimRpfBoundaryRectRecord.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfBoundaryRectRecord.cpp
rename to src/support_data/ossimRpfBoundaryRectRecord.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.cpp b/src/support_data/ossimRpfBoundaryRectSectionSubheader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfBoundaryRectSectionSubheader.cpp
rename to src/support_data/ossimRpfBoundaryRectSectionSubheader.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfBoundaryRectTable.cpp b/src/support_data/ossimRpfBoundaryRectTable.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfBoundaryRectTable.cpp
rename to src/support_data/ossimRpfBoundaryRectTable.cpp
diff --git a/src/support_data/ossimRpfColorConverterOffsetRecord.cpp b/src/support_data/ossimRpfColorConverterOffsetRecord.cpp
new file mode 100644
index 0000000..b4f161a
--- /dev/null
+++ b/src/support_data/ossimRpfColorConverterOffsetRecord.cpp
@@ -0,0 +1,61 @@
+#include <ossim/support_data/ossimRpfColorConverterOffsetRecord.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimRpfColorConverterOffsetRecord& data)
+{
+   out << "theColorConverterTableId:                 " << data.theColorConverterTableId
+       << "\ntheNumberOfColorConverterRecords:         " << data.theNumberOfColorConverterRecords
+       << "\ntheColorConverterTableOffset:             " << data.theColorConverterTableOffset
+       << "\ntheSourceColorGrayscaleOffsetTableOffset: " << data.theSourceColorGrayscaleOffsetTableOffset
+       << "\ntheTargetColorGrayscaleOffsetTableOffset: " << data.theTargetColorGrayscaleOffsetTableOffset;
+
+   return out;
+}
+
+ossimRpfColorConverterOffsetRecord::ossimRpfColorConverterOffsetRecord()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfColorConverterOffsetRecord::parseStream(ossim::istream& in,
+                                                               ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      in.read((char*)&theColorConverterTableId, 2);
+      in.read((char*)&theNumberOfColorConverterRecords, 4);
+      in.read((char*)&theColorConverterTableOffset, 4);
+      in.read((char*)&theSourceColorGrayscaleOffsetTableOffset, 4);
+      in.read((char*)&theTargetColorGrayscaleOffsetTableOffset, 4);
+      
+      ossimEndian anEndian;
+      
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theColorConverterTableId);
+         anEndian.swap(theNumberOfColorConverterRecords);
+         anEndian.swap(theColorConverterTableOffset);
+         anEndian.swap(theSourceColorGrayscaleOffsetTableOffset);
+         anEndian.swap(theTargetColorGrayscaleOffsetTableOffset);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfColorConverterOffsetRecord::clearFields()
+{
+   theColorConverterTableId                 = 0;
+   theNumberOfColorConverterRecords         = 0;
+   theColorConverterTableOffset             = 0;
+   theSourceColorGrayscaleOffsetTableOffset = 0;
+   theTargetColorGrayscaleOffsetTableOffset = 0;
+}
+
diff --git a/src/support_data/ossimRpfColorConverterSubsection.cpp b/src/support_data/ossimRpfColorConverterSubsection.cpp
new file mode 100644
index 0000000..7f48e90
--- /dev/null
+++ b/src/support_data/ossimRpfColorConverterSubsection.cpp
@@ -0,0 +1,131 @@
+//*******************************************************************
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimRpfColorConverterSubsection.h>
+#include <ossim/support_data/ossimRpfColorConverterOffsetRecord.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+#include <iterator>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimRpfColorConverterSubsection& data)
+{
+   data.print(out);
+   return out;
+}
+
+ossimRpfColorConverterSubsection::ossimRpfColorConverterSubsection()
+{
+   theNumberOfColorConverterOffsetRecords = 0;
+   clearFields();
+}
+
+void ossimRpfColorConverterSubsection::clearFields()
+{
+   theColorConverterOffsetTableOffset     = 0;
+   theColorConverterOffsetRecordLength    = 0;
+   theConverterRecordLength               = 0;
+
+   theTableList.clear();
+}
+
+const ossimRpfColorConverterTable* ossimRpfColorConverterSubsection::getColorConversionTable(ossim_uint32 givenThisNumberOfEntires)const
+{
+   std::vector<ossimRpfColorConverterTable>::const_iterator listElement = theTableList.begin();
+
+   while(listElement != theTableList.end())
+   {
+      if((*listElement).getNumberOfEntries() == givenThisNumberOfEntires)
+      {
+         return &(*listElement);
+      }
+   }
+
+   return NULL;
+}
+
+ossimErrorCode ossimRpfColorConverterSubsection::parseStream(ossim::istream& in,
+                                                             ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      clearFields();
+
+      // this is the start of the subsection
+      theStartOffset = in.tellg();
+      in.read((char*)&theColorConverterOffsetTableOffset, 4);
+      in.read((char*)&theColorConverterOffsetRecordLength, 2);
+      in.read((char*)&theConverterRecordLength, 2);
+
+      // this grabs the end of the subsection
+      theEndOffset   = in.tellg();
+
+      ossimEndian anEndian;
+
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theColorConverterOffsetTableOffset);
+         anEndian.swap(theColorConverterOffsetRecordLength);
+         anEndian.swap(theConverterRecordLength);
+
+      }
+      theTableList.resize(theNumberOfColorConverterOffsetRecords);
+      for(unsigned long index = 0;
+          index < theNumberOfColorConverterOffsetRecords;
+          ++index)
+      {
+         ossimRpfColorConverterOffsetRecord recordInfo;
+         
+         if(recordInfo.parseStream(in, byteOrder) ==
+            ossimErrorCodes::OSSIM_OK)
+         {
+            unsigned long rememberGet = in.tellg();
+
+            theTableList[index].setNumberOfEntries(recordInfo.theNumberOfColorConverterRecords);
+            theTableList[index].setTableId(recordInfo.theColorConverterTableId);
+            in.seekg(theStartOffset + recordInfo.theColorConverterTableOffset, std::ios_base::beg);
+            theTableList[index].parseStream(in, byteOrder);
+            
+            in.seekg(rememberGet, std::ios_base::beg);
+         }
+         else
+         {
+            return ossimErrorCodes::OSSIM_ERROR;
+         }
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfColorConverterSubsection::setNumberOfColorConverterOffsetRecords(ossim_uint16 numberOfRecords)
+{
+   theNumberOfColorConverterOffsetRecords = numberOfRecords;
+}
+
+void ossimRpfColorConverterSubsection::print(std::ostream& out)const
+{
+   out << "theColorConverterOffsetTableOffset:      "
+       << theColorConverterOffsetTableOffset
+       << "\ntheColorConverterOffsetRecordLength:     "
+       << theColorConverterOffsetRecordLength
+       << "\ntheConverterRecordLength:                "
+       << theConverterRecordLength << "\n";
+
+   copy(theTableList.begin(),
+        theTableList.end(),
+        std::ostream_iterator<ossimRpfColorConverterTable>(out, "\n"));
+}
diff --git a/src/support_data/ossimRpfColorConverterTable.cpp b/src/support_data/ossimRpfColorConverterTable.cpp
new file mode 100644
index 0000000..7fdb90b
--- /dev/null
+++ b/src/support_data/ossimRpfColorConverterTable.cpp
@@ -0,0 +1,93 @@
+#include <ossim/support_data/ossimRpfColorConverterTable.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(
+   std::ostream& out, const ossimRpfColorConverterTable& data)
+{
+   data.print(out);
+   return out;
+}
+
+ossimRpfColorConverterTable::ossimRpfColorConverterTable()
+{
+   theTableId                      = 0;
+   theNumberOfEntries              = 0;
+   theColorGrayscaleTableEntryList = NULL;
+}
+
+ossimRpfColorConverterTable::~ossimRpfColorConverterTable()
+{
+   if(theColorGrayscaleTableEntryList)
+   {
+      delete [] theColorGrayscaleTableEntryList;
+      theColorGrayscaleTableEntryList = NULL;
+   }
+}
+ossimErrorCode ossimRpfColorConverterTable::parseStream(ossim::istream& in,
+                                                        ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      if(theNumberOfEntries > 0)
+      {
+         in.read((char*)theColorGrayscaleTableEntryList, 4*theNumberOfEntries);
+
+         ossimEndian anEndian;
+         if(anEndian.getSystemEndianType() != byteOrder)
+         {
+            for(ossim_uint32 index = 0;
+                index < theNumberOfEntries;
+                ++index)
+            {
+               anEndian.swap(theColorGrayscaleTableEntryList[index]);
+            }
+         }
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfColorConverterTable::print(std::ostream& out)const
+{
+   out << "theTableId:                   " << theTableId << "\n"
+       << "theNumberOfEntries:           " << theNumberOfEntries << "\n";
+
+   if(theColorGrayscaleTableEntryList)
+   {
+      out << "Values:\n";
+      for(ossim_uint32 index=0; index < theNumberOfEntries; index++)
+      {
+         out<< theColorGrayscaleTableEntryList[index] << "\n";
+      }
+   }
+   
+}
+
+void ossimRpfColorConverterTable::setNumberOfEntries(ossim_uint32 entries)
+{
+   if(theColorGrayscaleTableEntryList)
+   {
+      delete [] theColorGrayscaleTableEntryList;
+      theColorGrayscaleTableEntryList = NULL;
+   }
+   theColorGrayscaleTableEntryList = new ossim_uint32[entries];
+   theNumberOfEntries = entries;
+   
+   for(ossim_uint32 index=0;
+       index < theNumberOfEntries;
+       ++index)
+   {
+      theColorGrayscaleTableEntryList[index] = 0;
+   }
+}
+void ossimRpfColorConverterTable::setTableId(ossim_uint16 id)
+{
+   theTableId = id;
+}
diff --git a/src/support_data/ossimRpfColorGrayscaleOffsetRecord.cpp b/src/support_data/ossimRpfColorGrayscaleOffsetRecord.cpp
new file mode 100644
index 0000000..08ecf45
--- /dev/null
+++ b/src/support_data/ossimRpfColorGrayscaleOffsetRecord.cpp
@@ -0,0 +1,70 @@
+#include <ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimRpfColorGrayscaleOffsetRecord& data)
+{
+   data.print(out);
+   
+   return out;
+}
+   
+ossimRpfColorGrayscaleOffsetRecord::ossimRpfColorGrayscaleOffsetRecord()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfColorGrayscaleOffsetRecord::parseStream(ossim::istream& in,
+                                                               ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      clearFields();
+      
+      in.read((char*)&theColorGrayscaleTableId, 2);
+      in.read((char*)&theNumberOfColorGrayscaleRecords, 4);
+      in.read((char*)&theColorGrayscaleElementLength, 1);
+      in.read((char*)&theHistogramRecordLength, 2);
+      in.read((char*)&theColorGrayscaleTableOffset, 4);
+      in.read((char*)&theHistogramTableOffset, 4);
+
+      ossimEndian anEndian;
+
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theColorGrayscaleTableId);
+         anEndian.swap(theNumberOfColorGrayscaleRecords);
+         anEndian.swap(theHistogramRecordLength);
+         anEndian.swap(theColorGrayscaleTableOffset);
+         anEndian.swap(theHistogramTableOffset);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfColorGrayscaleOffsetRecord::print(std::ostream& out)const
+{
+   out << "theColorGrayscaleTableId:                 " << theColorGrayscaleTableId
+       << "\ntheNumberOfColorGrayscaleRecords:         " << theNumberOfColorGrayscaleRecords
+       << "\ntheColorGrayscaleElementLength:           " << (unsigned long)theColorGrayscaleElementLength
+       << "\ntheHistogramRecordLength:                 " << theHistogramRecordLength
+       << "\ntheColorGrayscaleTableOffset:             " << theColorGrayscaleTableOffset
+       << "\ntheHistogramTableOffset:                  " << theHistogramTableOffset;
+}
+
+void ossimRpfColorGrayscaleOffsetRecord::clearFields()
+{
+   theColorGrayscaleTableId         = 0;
+   theNumberOfColorGrayscaleRecords = 0;
+   theColorGrayscaleElementLength   = 0;
+   theHistogramRecordLength         = 0;
+   theColorGrayscaleTableOffset     = 0;
+   theHistogramTableOffset          = 0;
+}
diff --git a/src/support_data/ossimRpfColorGrayscaleSubheader.cpp b/src/support_data/ossimRpfColorGrayscaleSubheader.cpp
new file mode 100644
index 0000000..7fb55ed
--- /dev/null
+++ b/src/support_data/ossimRpfColorGrayscaleSubheader.cpp
@@ -0,0 +1,60 @@
+#include <ossim/support_data/ossimRpfColorGrayscaleSubheader.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimRpfColorGrayscaleSubheader& data)
+{
+   data.print(out);
+
+   return out;
+}
+
+ossimRpfColorGrayscaleSubheader::ossimRpfColorGrayscaleSubheader()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfColorGrayscaleSubheader::parseStream(ossim::istream& in,
+                                                            ossimByteOrder /* byteOrder */)
+{
+   if(in)
+   {
+      clearFields();
+      
+      theStartOffset = in.tellg();
+      in.read((char*)&theNumberOfColorGreyscaleOffsetRecords, 1);
+      in.read((char*)&theNumberOfColorConverterOffsetRecords, 1);
+
+      char tempString[12];
+      in.read(tempString, 12);
+      theColorGrayscaleFilename = ossimString(tempString,
+                                              (char*)(&tempString[12]));
+      theEndOffset = in.tellg();
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfColorGrayscaleSubheader::print(std::ostream& out)const
+{
+   out << "theNumberOfColorGreyscaleOffsetRecords:    " << (int)theNumberOfColorGreyscaleOffsetRecords
+       << "\ntheNumberOfColorConverterOffsetRecords:    " << (int)theNumberOfColorConverterOffsetRecords
+       << "\ntheColorGrayscaleFilename:                 " << theColorGrayscaleFilename;
+   
+}
+
+void ossimRpfColorGrayscaleSubheader::clearFields()
+{
+   theStartOffset = 0;
+   theEndOffset   = 0;
+   
+   theNumberOfColorGreyscaleOffsetRecords = 0;
+   theNumberOfColorConverterOffsetRecords = 0;
+   theColorGrayscaleFilename              = "";
+}
+
diff --git a/src/support_data/ossimRpfColorGrayscaleTable.cpp b/src/support_data/ossimRpfColorGrayscaleTable.cpp
new file mode 100644
index 0000000..d574ca3
--- /dev/null
+++ b/src/support_data/ossimRpfColorGrayscaleTable.cpp
@@ -0,0 +1,153 @@
+#include <ossim/support_data/ossimRpfColorGrayscaleTable.h>
+#include <string.h> // for memcpy
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimRpfColorGrayscaleTable& data)
+{
+   out << "theNumberOfElements:                   " << data.theNumberOfElements
+       << "\ntheTotalNumberOfBytes:                 " << data.theTotalNumberOfBytes
+       << "\ntheTableId:                            " << data.theTableId;
+
+   return out;
+}
+
+ossimRpfColorGrayscaleTable::ossimRpfColorGrayscaleTable()
+   :theNumberOfElements(0),
+    theTotalNumberOfBytes(0),
+    theTableId(0),
+    theData(NULL)
+{
+}
+
+ossimRpfColorGrayscaleTable::ossimRpfColorGrayscaleTable(const ossimRpfColorGrayscaleTable& rhs)
+   :theNumberOfElements(0),
+    theTotalNumberOfBytes(0),
+    theTableId(0),
+    theData(NULL)
+{
+   *this = rhs;
+}
+
+
+ossimRpfColorGrayscaleTable::~ossimRpfColorGrayscaleTable()
+{
+   if(theData)
+   {
+      delete [] theData;
+      theData = NULL;
+   }
+}
+
+ossimErrorCode ossimRpfColorGrayscaleTable::parseStream(ossim::istream& in,
+                                                        ossimByteOrder /* byteOrder */)
+{
+   if(in)
+   {
+      if((theTotalNumberOfBytes > 0)&&theData)
+      {
+         in.read((char*)theData, theTotalNumberOfBytes);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+const unsigned char* ossimRpfColorGrayscaleTable::getStartOfData(unsigned long entry)const
+{
+   unsigned long offset = 0;
+
+   switch(theTableId)
+   {
+   case 1: // this is in format RGB
+   {
+      offset = 3*entry;
+      break;
+   }
+   case 2: // format RGBM
+   case 4: // format CMYK
+   {
+      offset = 4*entry;
+      break;
+   }
+   case 3: // format M
+   {
+      offset = entry;
+      break;
+   }
+   }
+
+   return (const unsigned char*)(theData + offset);
+}
+
+void ossimRpfColorGrayscaleTable::setTableData(unsigned short id,
+                                               unsigned long  numberOfElements)
+{
+   if(theData)
+   {
+      delete theData;
+      theData = NULL;
+   }
+
+   unsigned long totalBytes = 0;
+   
+   switch(id)
+   {
+   case 1: // this is in format RGB
+   {
+      totalBytes = 3*numberOfElements;
+      break;
+   }
+   case 2: // format RGBM
+   case 4: // format CMYK
+   {
+      totalBytes = 4*numberOfElements;
+      break;
+   }
+   case 3: // format M
+   {
+      totalBytes = numberOfElements;
+      break;
+   }
+   }
+
+   if(totalBytes > 0)
+   {
+      theTableId            = id;
+      theNumberOfElements   = numberOfElements;
+      theTotalNumberOfBytes = totalBytes;
+
+      theData = new unsigned char[totalBytes];
+   }
+}
+
+
+
+const ossimRpfColorGrayscaleTable& ossimRpfColorGrayscaleTable::operator =(const ossimRpfColorGrayscaleTable& rhs)
+{
+   
+   if(&rhs != this)
+   {
+      theNumberOfElements   = rhs.theNumberOfElements;
+      theTotalNumberOfBytes = rhs.theTotalNumberOfBytes;
+      theTableId            = rhs.theTableId;
+      if(theData)
+      {
+         delete theData;
+         theData = NULL;
+      }
+      if(theTotalNumberOfBytes&&rhs.theData)
+      {
+         theData = new unsigned char[theTotalNumberOfBytes];
+         
+         memcpy(theData, rhs.theData, theTotalNumberOfBytes);
+      }
+   }
+   
+   return *this;
+}
diff --git a/ossim/src/ossim/support_data/ossimRpfComponentIdLut.cpp b/src/support_data/ossimRpfComponentIdLut.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfComponentIdLut.cpp
rename to src/support_data/ossimRpfComponentIdLut.cpp
diff --git a/src/support_data/ossimRpfCompressionLookupOffsetRecord.cpp b/src/support_data/ossimRpfCompressionLookupOffsetRecord.cpp
new file mode 100644
index 0000000..97482a6
--- /dev/null
+++ b/src/support_data/ossimRpfCompressionLookupOffsetRecord.cpp
@@ -0,0 +1,65 @@
+#include <ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator <<(std::ostream &out,
+                          const ossimRpfCompressionLookupOffsetRecord& data)
+{
+   data.print(out);
+   
+   return out;
+}
+
+ossimRpfCompressionLookupOffsetRecord::ossimRpfCompressionLookupOffsetRecord()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfCompressionLookupOffsetRecord::parseStream(ossim::istream& in,
+                                                                  ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      ossimEndian anEndian;
+
+      in.read((char*)&theCompressionLookupTableId, 2);
+      in.read((char*)&theNumberOfCompressionLookupRecords, 4);
+      in.read((char*)&theNumberOfValuesPerCompressionLookupRecord, 2);
+      in.read((char*)&theCompressionLookupValueBitLength, 2);
+      in.read((char*)&theCompressionLookupTableOffset, 4);
+      
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theCompressionLookupTableId);
+         anEndian.swap(theNumberOfCompressionLookupRecords);
+         anEndian.swap(theNumberOfValuesPerCompressionLookupRecord);
+         anEndian.swap(theCompressionLookupValueBitLength);
+         anEndian.swap(theCompressionLookupTableOffset);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfCompressionLookupOffsetRecord::print(std::ostream& out)const
+{
+   out << "theCompressionLookupTableId:                 " << theCompressionLookupTableId
+       << "\ntheNumberOfCompressionLookupRecords:         " << theNumberOfCompressionLookupRecords
+       << "\ntheNumberOfValuesPerCompressionLookupRecord: " << theNumberOfValuesPerCompressionLookupRecord
+       << "\ntheCompressionLookupValueBitLength:          " << theCompressionLookupValueBitLength
+       << "\ntheCompressionLookupTableOffset:             " << theCompressionLookupTableOffset;
+}
+
+void ossimRpfCompressionLookupOffsetRecord::clearFields()
+{
+   theCompressionLookupTableId                  = 0;
+   theNumberOfCompressionLookupRecords          = 0;
+   theNumberOfValuesPerCompressionLookupRecord  = 0;
+   theCompressionLookupValueBitLength           = 0;
+   theCompressionLookupTableOffset              = 0;
+}
diff --git a/src/support_data/ossimRpfCompressionSection.cpp b/src/support_data/ossimRpfCompressionSection.cpp
new file mode 100644
index 0000000..dc3c693
--- /dev/null
+++ b/src/support_data/ossimRpfCompressionSection.cpp
@@ -0,0 +1,199 @@
+#include <ossim/support_data/ossimRpfCompressionSection.h>
+#include <ossim/support_data/ossimRpfCompressionSectionSubheader.h>
+#include <ossim/support_data/ossimRpfCompressionLookupOffsetRecord.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+#include <cstring> // for memset
+#include <iterator>
+
+std::ostream& operator<<(std::ostream& out,
+                         const ossimRpfCompressionOffsetTableData& data)
+{
+   unsigned long size = (data.theNumberOfValuesPerLookup*data.theNumberOfLookupValues*
+                         data.theCompressionLookupValueBitLength)/8;
+   
+   out << "theTableId:                         " << data.theTableId
+       << "\ntheNumberOfLookupValues:            " << data.theNumberOfLookupValues
+       << "\ntheCompressionLookupValueBitLength: " << data.theCompressionLookupValueBitLength
+       << "\ntheNumberOfValuesPerLookup:         " << data.theNumberOfValuesPerLookup
+       << "\nData Size in bytes:                 "
+       << size;
+
+   return out;
+}
+
+
+ossimRpfCompressionOffsetTableData::ossimRpfCompressionOffsetTableData()
+   :theTableId(0),
+    theNumberOfLookupValues(0),
+    theCompressionLookupValueBitLength(0),
+    theNumberOfValuesPerLookup(0),
+    theData(NULL)
+{
+}
+
+ossimRpfCompressionOffsetTableData::ossimRpfCompressionOffsetTableData(
+   const ossimRpfCompressionOffsetTableData& rhs)
+   :theNumberOfLookupValues(0),
+    theCompressionLookupValueBitLength(0),
+    theNumberOfValuesPerLookup(0),
+    theData(NULL)
+{
+   *this = rhs;
+}
+
+const ossimRpfCompressionOffsetTableData& ossimRpfCompressionOffsetTableData::operator = (
+   const ossimRpfCompressionOffsetTableData& rhs)
+{
+   if(this != &rhs)
+   {
+      if(theData)
+      {
+         delete [] theData;
+         theData = 0;
+      }
+
+      if(rhs.theData)
+      {
+         theTableId                         = rhs.theTableId;
+         theNumberOfLookupValues            = rhs.theNumberOfLookupValues;
+         theCompressionLookupValueBitLength = rhs.theCompressionLookupValueBitLength;
+         theNumberOfValuesPerLookup         = rhs.theNumberOfValuesPerLookup;
+         
+         unsigned long size = (theNumberOfValuesPerLookup*
+                               theNumberOfLookupValues*
+                               theCompressionLookupValueBitLength)/8;
+         if(size > 0)
+         {
+            theData = new unsigned char[size];
+            memcpy(theData, rhs.theData, size);
+         }
+      }
+      else
+      {
+         theTableId = 0;
+         theNumberOfLookupValues = 0;
+         theCompressionLookupValueBitLength = 0;
+         theNumberOfValuesPerLookup = 0;
+      }
+   }
+   
+   return *this;
+}
+
+ossimRpfCompressionOffsetTableData::~ossimRpfCompressionOffsetTableData()
+{
+   if(theData)
+   {
+      delete [] theData;
+      theData = 0;
+   }
+}
+
+
+std::ostream& operator << (
+   std::ostream& out, const ossimRpfCompressionSection& data)
+{
+   data.print(out);
+   return out;
+}
+
+ossimRpfCompressionSection::ossimRpfCompressionSection()
+   :theSubheader(NULL)
+{
+   theSubheader = new ossimRpfCompressionSectionSubheader;
+}
+
+ossimRpfCompressionSection::~ossimRpfCompressionSection()
+{
+   if(theSubheader)
+   {
+      delete theSubheader;
+      theSubheader = NULL;
+   }
+}
+
+ossimErrorCode ossimRpfCompressionSection::parseStream(ossim::istream& in,
+                                                       ossimByteOrder byteOrder)
+{
+   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
+   
+   if(in&&theSubheader)
+   {
+      result = theSubheader->parseStream(in, byteOrder);
+
+      if(result == ossimErrorCodes::OSSIM_OK)
+      {
+         ossimEndian anEndian;
+         ossimRpfCompressionLookupOffsetRecord record;
+         
+         in.read((char*)&theCompressionLookupOffsetTableOffset, 4);
+         in.read((char*)&theCompressionLookupTableOffsetRecordLength, 2);
+         
+         if(byteOrder != anEndian.getSystemEndianType())
+         {
+            anEndian.swap(theCompressionLookupOffsetTableOffset);
+            anEndian.swap(theCompressionLookupTableOffsetRecordLength);
+         }
+
+         if(theSubheader->getNumberOfCompressionLookupOffsetRecords() > 0)
+         {
+            // clear the table
+            theTable.clear();
+
+            // resize it
+            theTable.resize(theSubheader->getNumberOfCompressionLookupOffsetRecords());
+            
+            // now populate it
+            for(long index = 0;
+                index < theSubheader->getNumberOfCompressionLookupOffsetRecords();
+                ++index)
+            {
+               record.parseStream(in, byteOrder);
+               unsigned long rememberLocation = in.tellg();
+               in.seekg(record.getCompressionLookupTableOffset()+
+                        theSubheader->getEndOffset(), std::ios_base::beg);
+
+               theTable[index].theTableId                            = record.getCompressionLookupTableId();
+               theTable[index].theNumberOfLookupValues               = record.getNumberOfCompressionLookupRecords();
+               theTable[index].theCompressionLookupValueBitLength    = record.getCompressionLookupValueBitLength();
+               theTable[index].theNumberOfValuesPerLookup            = record.getNumberOfValuesPerCompressionLookupRecord();
+               
+               // store the information about this compress/decompress algorithm
+               // I am not sure but I will assume that the bit length can be
+               // arbitrary.  In other words if someone says that the bit length of
+               // the lookup value is 12 this should be handled ok.
+               //
+               unsigned long size = (theTable[index].theNumberOfValuesPerLookup*
+                                     theTable[index].theNumberOfLookupValues*
+                                     theTable[index].theCompressionLookupValueBitLength)/8;
+               
+               theTable[index].theData = new unsigned char[size];
+
+               in.read( (char*)theTable[index].theData, size);
+               
+               in.seekg(rememberLocation, std::ios_base::beg);
+            }
+         }
+      }
+   }
+   else
+   {
+      result = ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return result;
+}
+
+void ossimRpfCompressionSection::print(std::ostream& out)const
+{
+   if(theSubheader)
+   {
+      out << *theSubheader << "\n";
+      copy(theTable.begin(),
+           theTable.end(),
+           std::ostream_iterator<ossimRpfCompressionOffsetTableData>(out, "\n"));
+   }
+}
+
diff --git a/src/support_data/ossimRpfCompressionSectionSubheader.cpp b/src/support_data/ossimRpfCompressionSectionSubheader.cpp
new file mode 100644
index 0000000..7a8c3de
--- /dev/null
+++ b/src/support_data/ossimRpfCompressionSectionSubheader.cpp
@@ -0,0 +1,63 @@
+#include <ossim/support_data/ossimRpfCompressionSectionSubheader.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+ossimRpfCompressionSectionSubheader::ossimRpfCompressionSectionSubheader()
+{
+   clearFields();
+}
+
+std::ostream& operator<<(std::ostream& out,
+                         const ossimRpfCompressionSectionSubheader& data)
+{
+   data.print(out);
+   
+   return out;
+}
+
+ossimErrorCode ossimRpfCompressionSectionSubheader::parseStream(ossim::istream& in,
+                                                                ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      theStartOffset = in.tellg();
+      
+      in.read((char*)&theCompressionAlgorithmId, 2);
+      in.read((char*)&theNumberOfCompressionLookupOffsetRecords, 2);
+      in.read((char*)&theNumberOfCompressionParameterOffsetRecords, 2);
+
+      theEndOffset = in.tellg();
+      
+      ossimEndian anEndian;
+
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theCompressionAlgorithmId);
+         anEndian.swap(theNumberOfCompressionLookupOffsetRecords);
+         anEndian.swap(theNumberOfCompressionParameterOffsetRecords);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+   
+void ossimRpfCompressionSectionSubheader::print(std::ostream& out)const
+{
+   out << "theCompressionAlgorithmId:                    " << theCompressionAlgorithmId
+       << "\ntheNumberOfCompressionLookupOffsetRecords:    " << theNumberOfCompressionLookupOffsetRecords
+       << "\ntheNumberOfCompressionParameterOffsetRecords: " << theNumberOfCompressionParameterOffsetRecords;
+}
+
+void ossimRpfCompressionSectionSubheader::clearFields()
+{
+   theStartOffset                               = 0;
+   theEndOffset                                 = 0;
+   theCompressionAlgorithmId                    = 0;
+   theNumberOfCompressionLookupOffsetRecords    = 0;
+   theNumberOfCompressionParameterOffsetRecords = 0;
+}
diff --git a/src/support_data/ossimRpfCoverageSection.cpp b/src/support_data/ossimRpfCoverageSection.cpp
new file mode 100644
index 0000000..51e441b
--- /dev/null
+++ b/src/support_data/ossimRpfCoverageSection.cpp
@@ -0,0 +1,295 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+// 
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfCoverageSection.cpp 16997 2010-04-12 18:53:48Z dburken $
+
+#include <istream>
+#include <iostream>
+
+#include <ossim/support_data/ossimRpfCoverageSection.h>
+#include <ossim/base/ossimCommon.h> /* ossim::byteOrder */
+#include <ossim/base/ossimEndian.h>
+
+std::ostream& operator <<(std::ostream &out, const ossimRpfCoverageSection &data)
+{
+   return data.print(out);
+}
+
+ossimRpfCoverageSection::ossimRpfCoverageSection()
+   :
+   theUpperLeftLat(0.0),
+   theUpperLeftLon(0.0),
+
+   theLowerLeftLat(0.0),
+   theLowerLeftLon(0.0),
+
+   theUpperRightLat(0.0),
+   theUpperRightLon(0.0),
+
+   theLowerRightLat(0.0),
+   theLowerRightLon(0.0),
+
+   theVerticalResolution(0.0),
+   theHorizontalResolution(0.0),
+
+   theVerticalInterval(0.0),
+   theHorizontalInterval(0.0)
+{
+}
+
+ossimRpfCoverageSection::ossimRpfCoverageSection(const ossimRpfCoverageSection& obj)
+   :
+   theUpperLeftLat(obj.theUpperLeftLat),
+   theUpperLeftLon(obj.theUpperLeftLon),
+
+   theLowerLeftLat(obj.theLowerLeftLat),
+   theLowerLeftLon(obj.theLowerLeftLon),
+
+   theUpperRightLat(obj.theUpperRightLat),
+   theUpperRightLon(obj.theUpperRightLon),
+
+   theLowerRightLat(obj.theLowerRightLat),
+   theLowerRightLon(obj.theLowerRightLon),
+
+   theVerticalResolution(obj.theVerticalResolution),
+   theHorizontalResolution(obj.theHorizontalResolution),
+
+   theVerticalInterval(obj.theVerticalInterval),
+   theHorizontalInterval(obj.theHorizontalInterval)
+{
+}
+
+const ossimRpfCoverageSection& ossimRpfCoverageSection::operator=(
+   const ossimRpfCoverageSection& rhs)
+{
+   if ( this != & rhs )
+   {
+      theUpperLeftLat = rhs.theUpperLeftLat;
+      theUpperLeftLon = rhs.theUpperLeftLon;
+      
+      theLowerLeftLat = rhs.theLowerLeftLat;
+      theLowerLeftLon = rhs.theLowerLeftLon;
+      
+      theUpperRightLat = rhs.theUpperRightLat;
+      theUpperRightLon = rhs.theUpperRightLon;
+      
+      theLowerRightLat = rhs.theLowerRightLat;
+      theLowerRightLon = rhs.theLowerRightLon;
+      
+      theVerticalResolution = rhs.theVerticalResolution;
+      theHorizontalResolution = rhs.theHorizontalResolution;
+      
+      theVerticalInterval = rhs.theVerticalInterval;
+      theHorizontalInterval = rhs.theHorizontalInterval;
+   }
+   return *this;
+}
+
+ossimErrorCode ossimRpfCoverageSection::parseStream(std::istream &in,
+                                                    ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      in.read((char*)&theUpperLeftLat,  8);
+      in.read((char*)&theUpperLeftLon,  8);
+      in.read((char*)&theLowerLeftLat,  8);
+      in.read((char*)&theLowerLeftLon,  8);
+      in.read((char*)&theUpperRightLat, 8);
+      in.read((char*)&theUpperRightLon, 8);
+      in.read((char*)&theLowerRightLat, 8);
+      in.read((char*)&theLowerRightLon, 8);
+      in.read((char*)&theVerticalResolution,   8);
+      in.read((char*)&theHorizontalResolution, 8);
+      in.read((char*)&theVerticalInterval,     8);
+      in.read((char*)&theHorizontalInterval,   8);
+
+      if( ossim::byteOrder()  != byteOrder )
+      {
+         ossimEndian anEndian;
+         anEndian.swap(theUpperLeftLat);
+         anEndian.swap(theUpperLeftLon);
+         anEndian.swap(theLowerLeftLat);
+         anEndian.swap(theLowerLeftLon);
+         anEndian.swap(theUpperRightLat);
+         anEndian.swap(theUpperRightLon);
+         anEndian.swap(theLowerRightLat);
+         anEndian.swap(theLowerRightLon);
+         anEndian.swap(theVerticalResolution);
+         anEndian.swap(theHorizontalResolution);
+         anEndian.swap(theVerticalInterval);
+         anEndian.swap(theHorizontalInterval);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfCoverageSection::writeStream(std::ostream& out)
+{
+   ossimEndian anEndian;
+
+   if( anEndian.getSystemEndianType() != OSSIM_BIG_ENDIAN )
+   {
+      // Always write out big endian.
+      anEndian.swap(theUpperLeftLat);
+      anEndian.swap(theUpperLeftLon);
+      anEndian.swap(theLowerLeftLat);
+      anEndian.swap(theLowerLeftLon);
+      anEndian.swap(theUpperRightLat);
+      anEndian.swap(theUpperRightLon);
+      anEndian.swap(theLowerRightLat);
+      anEndian.swap(theLowerRightLon);
+      anEndian.swap(theVerticalResolution);
+      anEndian.swap(theHorizontalResolution);
+      anEndian.swap(theVerticalInterval);
+      anEndian.swap(theHorizontalInterval);
+   }     
+   
+   out.write((char*)&theUpperLeftLat,  8);
+   out.write((char*)&theUpperLeftLon,  8);
+   out.write((char*)&theLowerLeftLat,  8);
+   out.write((char*)&theLowerLeftLon,  8);
+   out.write((char*)&theUpperRightLat, 8);
+   out.write((char*)&theUpperRightLon, 8);
+   out.write((char*)&theLowerRightLat, 8);
+   out.write((char*)&theLowerRightLon, 8);
+   out.write((char*)&theVerticalResolution,   8);
+   out.write((char*)&theHorizontalResolution, 8);
+   out.write((char*)&theVerticalInterval,     8);
+   out.write((char*)&theHorizontalInterval,   8);
+   
+   if( anEndian.getSystemEndianType() != OSSIM_BIG_ENDIAN )
+   {
+      // Swap back to native byte order.
+      anEndian.swap(theUpperLeftLat);
+      anEndian.swap(theUpperLeftLon);
+      anEndian.swap(theLowerLeftLat);
+      anEndian.swap(theLowerLeftLon);
+      anEndian.swap(theUpperRightLat);
+      anEndian.swap(theUpperRightLon);
+      anEndian.swap(theLowerRightLat);
+      anEndian.swap(theLowerRightLon);
+      anEndian.swap(theVerticalResolution);
+      anEndian.swap(theHorizontalResolution);
+      anEndian.swap(theVerticalInterval);
+      anEndian.swap(theHorizontalInterval);
+   }
+}
+
+std::ostream& ossimRpfCoverageSection::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   out << prefix << "ul_lat: "
+       << theUpperLeftLat << "\n"
+       << prefix << "ul_lon: "
+       << theUpperLeftLon << "\n"
+       << prefix << "ll_lat: "
+       << theLowerLeftLat << "\n"
+       << prefix << "ll_lon: "
+       << theLowerLeftLon << "\n"
+       << prefix << "ur_lat: "
+       << theUpperRightLat << "\n"
+       << prefix << "ur_lon: "
+       << theUpperRightLon << "\n"
+       << prefix << "lr_lat: "
+       << theLowerRightLat << "\n"
+       << prefix << "lr_lon: "
+       << theLowerRightLon << "\n"
+       << prefix << "vertical_resolution: "
+       << theVerticalResolution << "\n"
+       << prefix << "horizontal_resolution: "
+       << theHorizontalResolution << "\n"
+       << prefix << "vertical_interval: "
+       << theVerticalInterval << "\n"
+       << prefix << "horizontal_interval: "
+       << theHorizontalInterval << std::endl;
+   return out;
+}
+
+void ossimRpfCoverageSection::clearFields()
+{
+   theUpperLeftLat  = 0.0;
+   theUpperLeftLon  = 0.0;
+   theLowerLeftLat  = 0.0;
+   theLowerLeftLon  = 0.0;
+   theUpperRightLat = 0.0;
+   theUpperRightLon = 0.0;
+   theLowerRightLat = 0.0;
+   theLowerRightLon = 0.0;
+   theVerticalResolution   = 0.0;
+   theHorizontalResolution = 0.0;
+   theVerticalInterval     = 0.0;
+   theHorizontalInterval   = 0.0;
+}
+
+void ossimRpfCoverageSection::setUlLat(ossim_float64 value)
+{
+   theUpperLeftLat = value;
+}
+
+void ossimRpfCoverageSection::setUlLon(ossim_float64 value)
+{
+   theUpperLeftLon = value;
+}
+
+void ossimRpfCoverageSection::setLlLat(ossim_float64 value)
+{
+   theLowerLeftLat = value;
+}
+
+void ossimRpfCoverageSection::setLlLon(ossim_float64 value)
+{
+   theLowerLeftLon = value;
+}
+
+void ossimRpfCoverageSection::setLrLat(ossim_float64 value)
+{
+   theLowerRightLat = value;
+}
+
+void ossimRpfCoverageSection::setLrLon(ossim_float64 value)
+{
+   theLowerRightLon = value;
+}
+
+void ossimRpfCoverageSection::setUrLat(ossim_float64 value)
+{
+   theUpperRightLat = value;
+}
+
+void ossimRpfCoverageSection::setUrLon(ossim_float64 value)
+{
+   theUpperRightLon = value;
+}
+
+void ossimRpfCoverageSection::setVerticalResolution(ossim_float64 value)
+{
+   theVerticalResolution = value;
+}
+
+void ossimRpfCoverageSection::setHorizontalResolution(ossim_float64 value)
+{
+   theHorizontalResolution = value;
+}
+
+void ossimRpfCoverageSection::setVerticalInterval(ossim_float64 value)
+{
+   theVerticalInterval = value;
+}
+
+void ossimRpfCoverageSection::setHorizontalInterval(ossim_float64 value)
+{
+   theHorizontalInterval = value;
+}
diff --git a/src/support_data/ossimRpfFrame.cpp b/src/support_data/ossimRpfFrame.cpp
new file mode 100644
index 0000000..9239e70
--- /dev/null
+++ b/src/support_data/ossimRpfFrame.cpp
@@ -0,0 +1,1144 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+// Description: This class give the capability to access tiles from an
+//              rpf file.
+//
+//********************************************************************
+// $Id: ossimRpfFrame.cpp 23345 2015-05-29 13:05:51Z dburken $
+
+#include <ossim/support_data/ossimRpfFrame.h>
+#include <ossim/support_data/ossimRpfHeader.h>
+#include <ossim/support_data/ossimRpfAttributes.h>
+#include <ossim/support_data/ossimRpfAttributeOffsetRecord.h>
+#include <ossim/support_data/ossimRpfAttributeSectionSubheader.h>
+#include <ossim/support_data/ossimRpfCoverageSection.h>
+#include <ossim/support_data/ossimRpfImageDescriptionSubheader.h>
+#include <ossim/support_data/ossimRpfImageDisplayParameterSubheader.h>
+#include <ossim/support_data/ossimRpfMaskSubheader.h>
+#include <ossim/support_data/ossimRpfCompressionSection.h>
+#include <ossim/support_data/ossimRpfColorGrayscaleSubheader.h>
+#include <ossim/support_data/ossimRpfColorGrayscaleOffsetRecord.h>
+#include <ossim/support_data/ossimRpfColorConverterSubsection.h>
+#include <ossim/support_data/ossimRpfColorConverterTable.h>
+#include <ossim/support_data/ossimRpfColorGrayscaleTable.h>
+#include <ossim/support_data/ossimRpfLocationSection.h>
+#include <ossim/support_data/ossimRpfColorConverterSubsection.h>
+#include <ossim/support_data/ossimRpfConstants.h>
+#include <ossim/support_data/ossimRpfReplaceUpdateRecord.h>
+#include <ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/support_data/ossimNitfFileHeader.h>
+#include <ossim/support_data/ossimNitfTagInformation.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimTrace.h>
+#include <istream>
+#include <ostream>
+
+static const ossimTrace traceDebug("ossimRpfFrame:debug");
+
+std::ostream& operator <<(std::ostream& out, const ossimRpfFrame& data)
+{
+   data.print(out);
+   
+   return out;
+}
+
+ossimRpfFrame::ossimRpfFrame()
+   :theHeader(0),
+    theFilename(""),
+    theCoverage(0),
+    theAttributes(0),
+    theImageDescriptionSubheader(0),
+    theMaskSubheader(0),
+    theImageDisplayParameterSubheader(0),
+    theCompressionSection(0),
+    theColorGrayscaleSubheader(0),
+    theColorConverterSubsection(0),
+    theNitfFile(0),
+    theSubframeMaskTable(0),
+    theSubframeTransparencyMaskTable(0),
+    theReplaceUpdateTable(0)
+{
+}
+
+ossimRpfFrame::~ossimRpfFrame()
+{
+   deleteAll();
+}
+
+std::ostream& ossimRpfFrame::print(std::ostream& out, const std::string& prefix) const
+{
+   if (traceDebug())
+   {
+      out << "begin_rpf_frame_print:\n";
+   }
+   
+   if(theHeader)
+   {
+      theHeader->print(out, prefix);
+   }
+
+   out << prefix << "filename: " << theFilename << "\n";
+
+   if ( theReplaceUpdateTable.valid() )
+   {
+      theReplaceUpdateTable->print(out, prefix);
+   }
+
+   if (traceDebug())
+   {
+      if(theCoverage)
+      {
+         theCoverage->print(out, prefix);
+      }
+   }
+
+   //---
+   // Derived series code from first two characters of file extension.
+   // Note ChartSeriesCode from RPF Frame attributes may or may not be
+   // present.
+   //---
+   if ( theFilename.size() )
+   {
+      ossimString ext = theFilename.ext();
+      if ( ext.size() > 1 )
+      {
+         ext.upcase();
+         out << prefix << "SeriesCode: " << ext.string().substr(0, 2) << "\n";
+      }
+   }
+
+   if(theAttributes)
+   {
+      theAttributes->print(out, prefix);
+   }
+
+   if (traceDebug())
+   {
+      if(theImageDescriptionSubheader)
+      {
+         theImageDescriptionSubheader->print(out, prefix);
+      }
+      
+      if(theMaskSubheader)
+      {
+         out << *theMaskSubheader << endl;
+      }
+      if(theImageDisplayParameterSubheader)
+      {
+         out << *theImageDisplayParameterSubheader << endl;
+      }
+      if(theCompressionSection)
+      {
+         out << *theCompressionSection << endl;
+      }
+      if(theColorGrayscaleSubheader)
+      {
+         out << *theColorGrayscaleSubheader << endl;
+      }
+      if(theColorConverterSubsection)
+      {
+         out << *theColorConverterSubsection << endl;
+      }
+      
+      copy(theColorGrayscaleTable.begin(),
+           theColorGrayscaleTable.end(),
+           ostream_iterator<ossimRpfColorGrayscaleTable>(out, "\n"));
+      
+      if(theImageDescriptionSubheader&&
+         !(theImageDescriptionSubheader->isSubframeMaskTableOffsetNull()))
+      {
+         out << "Subframe Mask Table:" << endl;
+         unsigned long spectralIndex;
+         unsigned long rowIndex;
+         unsigned long colIndex;
+         // first loop through the Mask table and allocate while we do it
+         for(spectralIndex = 0;
+             spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
+             ++spectralIndex)
+         {
+            for(rowIndex = 0;
+                rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
+                ++rowIndex)
+            {
+               for(colIndex = 0;
+                   colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
+                   ++colIndex)
+               {
+                  if( theSubframeMaskTable[spectralIndex][rowIndex][colIndex] == OSSIM_RPF_ULONG_NULL)
+                  {
+                     out << "NULL ";
+                  }
+                  else
+                  {
+                     out << theSubframeMaskTable[spectralIndex][rowIndex][colIndex] << " ";
+                  }
+               }
+               out << endl;
+            }
+         }
+      }
+
+
+      if(theImageDescriptionSubheader&&
+         !(theImageDescriptionSubheader->isTransparencyMaskTableOffsetNull()))
+      {
+         out << "Transparency Mask Table:" << endl;
+         unsigned long spectralIndex;
+         unsigned long rowIndex;
+         unsigned long colIndex;
+         // first loop through the Mask table and allocate while we do it
+         for(spectralIndex = 0;
+             spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
+             ++spectralIndex)
+         {
+            for(rowIndex = 0;
+                rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
+                ++rowIndex)
+            {
+               for(colIndex = 0;
+                   colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
+                   ++colIndex)
+               {
+                  if( theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] == OSSIM_RPF_ULONG_NULL)
+                  {
+                     out << "NULL ";
+                  }
+                  else
+                  {
+                     out << theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] << " ";
+                  }
+               }
+            }
+         }
+      }
+
+
+      
+      out << "end_rpf_frame_print:\n";
+      
+   } // matches:  if (traceDebug())
+
+   out << std::endl;
+   
+   return out;
+}
+
+ossimErrorCode ossimRpfFrame::parseFile(const ossimFilename& filename,
+                                        bool minimalParse)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfFrame::parseFile: entered......" << std::endl;
+   }
+   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
+
+   //Make sure any fileds have beend cleared
+   clearFields();
+
+   // Make sure all data is deleted.  The initialize call the
+   // populate methods.  These methods will re-allocate the information
+   deleteAll();
+
+
+   theNitfFile = new ossimNitfFile;
+   theNitfFile->parseFile(filename);
+   
+   const ossimRefPtr<ossimNitfFileHeader> nitfFileHeader =
+      theNitfFile.valid() ? theNitfFile->getHeader() : 0;
+
+   if(!nitfFileHeader)
+   {
+      theNitfFile = 0;
+
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   ossimNitfTagInformation info;
+   nitfFileHeader->getTag(info, "RPFHDR");
+
+   theFilename = filename;
+   if(info.getTagName() == "RPFHDR")
+   {
+      ifstream in(filename.c_str(), ios::in|ios::binary);
+      // set the get pointer for the stream to the start
+      // of the Rpf header data
+      in.seekg(info.getTagDataOffset(), ios::beg);
+
+      if(theHeader) delete theHeader;
+      theHeader = new ossimRpfHeader;
+      
+      // if(theHeader->parseStream(in) != ossimErrorCodes::OSSIM_OK)
+      theHeader->parseStream(in);
+
+      if ( in.fail() )
+      {
+         deleteAll();
+         
+         return ossimErrorCodes::OSSIM_ERROR;
+      }
+      else
+         // if(!in.fail()&&theHeader)
+      {
+         result = populateAttributeSection(in);
+
+         // This is needed for ossim-rpf --list-frames so NOT put in full parse section.
+         if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
+         {
+            result = populateReplaceUpdateTable(in);
+         }
+
+         if ( minimalParse == false )
+         {
+            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
+            {
+               populateCompressionSection(in);
+            }
+            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
+            {
+               result = populateCoverageSection(in);
+            }
+            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
+            {
+               result = populateImageSection(in);
+            }
+            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
+            {
+               result = populateColorGrayscaleSection(in);
+            }
+            if(!in.fail()&&(result == ossimErrorCodes::OSSIM_OK))
+            {
+               result = populateMasks(in);
+            }
+         }
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+bool ossimRpfFrame::hasSubframeMaskTable()const
+{
+   if(theImageDescriptionSubheader)
+   {
+      return (!theImageDescriptionSubheader->isSubframeMaskTableOffsetNull());
+   }
+
+   return false;
+          
+}
+
+bool ossimRpfFrame::fillSubFrameBuffer(ossim_uint8* buffer,
+                                       ossim_uint32 /* spectralGroup */,
+                                       ossim_uint32 row,
+                                       ossim_uint32 col)const
+{
+   if(theImageDescriptionSubheader &&
+      theImageDisplayParameterSubheader&&
+      theHeader&&
+      (col < theImageDescriptionSubheader->getNumberOfSubframesHorizontal()) &&
+      (row < theImageDescriptionSubheader->getNumberOfSubframesVertical()))
+   {
+      ossimRpfComponentLocationRecord info;
+      
+      if(!theHeader->getLocationSection()->getComponent(OSSIM_RPF_SPATIAL_DATA_SUBSECTION, info))
+      {
+         return false;
+      }
+      
+      ossim_uint32 offset = info.m_componentLocation;
+      ossim_uint32 bytesPerSubframe = 0;
+
+      // note that the code length is bit encoded so we must devide by 8
+      // in order to get the byte offset instead of the bit offset.  We
+      // then add that to the start of the spatial data section which is
+      // the current value of offset.
+      bytesPerSubframe = (theImageDisplayParameterSubheader->getNumberOfImageRows()*
+                          theImageDisplayParameterSubheader->getNumberOfImageCodesPerRow()*
+                          theImageDisplayParameterSubheader->getImageCodeLength())/8;
+      
+         
+      if(hasSubframeMaskTable())
+      {
+         // check to see if the offset is NULL.  If it is
+         // then just return false to let the caller know that the
+         // buffer did not exist.
+         if(theSubframeMaskTable[0][row][col] != OSSIM_RPF_ULONG_NULL)
+         {
+            offset += theSubframeMaskTable[0][row][col];
+         }
+         else
+         {
+            return false;
+         }
+      }
+      else
+      {
+         ossim_uint32 bytes = bytesPerSubframe*(row*theImageDescriptionSubheader->getNumberOfSubframesHorizontal()+
+                                                col);
+         offset += bytes;
+      }
+      
+      // now since we have the adjustment and we got to this point then
+      // we can read in the data into the destination buffer.
+      ifstream in(theFilename.c_str(), ios::in|ios::binary);
+      if(!in.fail())
+      {
+         in.seekg(offset, ios::beg);
+         in.read((char*)buffer, bytesPerSubframe);
+         if(in.fail())
+         {
+            return false;
+         }
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      // this is if it was not within the rows and cols of
+      // the subframe or if the image description header didn't exist
+      return false;
+   }
+
+   return true;
+}
+
+void ossimRpfFrame::clearFields()
+{   
+   theFilename = "";
+}
+
+void ossimRpfFrame::deleteAll()
+{
+   if(theHeader)
+   {
+      delete theHeader;
+      theHeader = 0;
+   }
+   if(theAttributes)
+   {
+      delete theAttributes;
+      theAttributes = 0;
+   }
+   if(theCoverage)
+   {
+      delete theCoverage;
+      theCoverage = 0;
+   }
+   if(theImageDescriptionSubheader)
+   {
+      delete theImageDescriptionSubheader;
+      theImageDescriptionSubheader = 0;
+   }
+   if(theMaskSubheader)
+   {
+      delete theMaskSubheader;
+      theMaskSubheader = 0;
+   }
+   if(theImageDisplayParameterSubheader)
+   {
+      delete theImageDisplayParameterSubheader;
+      theImageDisplayParameterSubheader = 0;
+   }
+   if(theCompressionSection)
+   {
+      delete theCompressionSection;
+      theCompressionSection = 0;
+   }
+   if(theColorGrayscaleSubheader)
+   {
+      delete theColorGrayscaleSubheader;
+      theColorGrayscaleSubheader = 0;
+   }
+   if(theColorConverterSubsection)
+   {
+      delete theColorConverterSubsection;
+      theColorConverterSubsection = 0;
+   }
+   if (theNitfFile.valid())
+   {
+      theNitfFile = 0;
+   }
+}
+
+ossimErrorCode ossimRpfFrame::populateCoverageSection(istream& in)
+{
+   if(theCoverage) delete theCoverage;
+   theCoverage = 0;
+   if(theHeader)
+   {
+      theCoverage = theHeader->getNewCoverageSection(in);
+   }
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+ossimErrorCode ossimRpfFrame::populateCompressionSection(istream& in)
+{
+   if(theCompressionSection) delete theCompressionSection;
+   theCompressionSection = 0;
+   if(theHeader)
+   {
+      theCompressionSection = theHeader->getNewCompressionSection(in);
+   }
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+ossimErrorCode ossimRpfFrame::populateColorGrayscaleSection(istream& in)
+{
+   ossimErrorCode resultError = ossimErrorCodes::OSSIM_OK;
+   if(theColorGrayscaleSubheader) delete theColorGrayscaleSubheader;
+   theColorGrayscaleSubheader = 0;
+   if(theHeader)
+   {
+      theColorGrayscaleSubheader  = theHeader->getNewColorGrayscaleSubheader(in);
+
+      if(theColorGrayscaleSubheader)
+      {
+         const ossimRpfLocationSection* location = theHeader->getLocationSection();
+         if(location)
+         {
+            ossimRpfComponentLocationRecord component;
+            
+            if(location->getComponent(OSSIM_RPF_COLOR_CONVERTER_SUBSECTION,
+                                     component))
+            {
+               in.seekg(component.m_componentLocation,ios::beg);
+               if(theColorConverterSubsection) delete theColorConverterSubsection;
+               theColorConverterSubsection = new ossimRpfColorConverterSubsection;
+               theColorConverterSubsection->setNumberOfColorConverterOffsetRecords(
+                  theColorGrayscaleSubheader->getNumberOfColorConverterOffsetRecords());
+               resultError = theColorConverterSubsection->parseStream(in, theHeader->getByteOrder());
+            }
+            if(location->getComponent(OSSIM_RPF_COLORMAP_SUBSECTION, component))
+            {
+               in.seekg(component.m_componentLocation, ios::beg);
+               
+               theColorGrayscaleTable.clear();
+               theColorGrayscaleTable.resize(theColorGrayscaleSubheader->getNumberOfColorGreyscaleOffsetRecords());
+
+               // we will ignore the offset table offset which is a 4 byte value
+               // and ignore the offset record length which is a 2 byte value.
+               // This is suppose to put us at the beginning of the
+               // [color/grayscale offset record].  The total number of
+               // these offset records is found in the [color/grayscale section
+               // subheader.
+               in.ignore(6);
+               for(ossim_uint32 index = 0;
+                   index < theColorGrayscaleSubheader->getNumberOfColorGreyscaleOffsetRecords();
+                   ++index)
+               {
+                  
+                  ossimRpfColorGrayscaleOffsetRecord grayscaleOffsetRecord;
+
+                  if(grayscaleOffsetRecord.parseStream(in, theHeader->getByteOrder()) == ossimErrorCodes::OSSIM_OK)
+                  {
+                     ossim_uint32 rememberLocation = in.tellg();
+                     in.seekg(grayscaleOffsetRecord.getColorGrayscaleTableOffset()+component.m_componentLocation, ios::beg);
+                     theColorGrayscaleTable[index].setTableData(grayscaleOffsetRecord.getColorGrayscaleTableId(),
+                                                                grayscaleOffsetRecord.getNumberOfColorGrayscaleRecords());
+                     theColorGrayscaleTable[index].parseStream(in, theHeader->getByteOrder());
+                     in.seekg(rememberLocation, ios::beg);
+                  }
+                  else
+                  {
+                     return ossimErrorCodes::OSSIM_ERROR;
+                  }
+               }
+            }
+         }
+      }
+   }
+   
+   return resultError;
+}
+
+ossimErrorCode ossimRpfFrame::populateImageSection(istream& in)
+{
+   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
+   if(theImageDescriptionSubheader) delete theImageDescriptionSubheader;
+   theImageDescriptionSubheader = 0;
+   if(theHeader&&in)
+   {
+      // get the subheader information.
+      theImageDescriptionSubheader = theHeader->getNewImageDescriptionSubheader(in);
+
+      
+      // need to do something with the table before going to the display.
+      if(theImageDescriptionSubheader &&(!theImageDescriptionSubheader->isSubframeMaskTableOffsetNull()))
+      {
+         if(theMaskSubheader) delete theMaskSubheader;
+         // need to get the mask subheader
+         theMaskSubheader = new ossimRpfMaskSubheader;
+
+         // seek to the start of the subheader
+         in.seekg(theImageDescriptionSubheader->getEndOffset() +
+                  theImageDescriptionSubheader->getSubframeMaskTableOffset(), ios::beg);
+
+         // get the information
+         result = theMaskSubheader->parseStream(in, theHeader->getByteOrder());
+      }
+
+      if(theImageDisplayParameterSubheader) delete theImageDisplayParameterSubheader;
+      // Get the display parameter header
+      theImageDisplayParameterSubheader = theHeader->getNewImageDisplayParameterSubheader(in);
+   }
+   return result;
+}
+
+ossimErrorCode ossimRpfFrame::populateAttributeSection(istream& in)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimRpfFrame::populateAttributeSection:  entered ..." << std::endl;
+   }
+   ossimRpfAttributeSectionSubheader* temp = 0;
+   
+   const ossimRpfLocationSection* location = theHeader->getLocationSection();
+   if(location)
+   {
+      ossimRpfComponentLocationRecord component;
+      
+      if(location->getComponent(OSSIM_RPF_ATTRIBUTE_SECTION_SUBHEADER,
+                               component))
+      {
+         temp = new ossimRpfAttributeSectionSubheader;
+         in.seekg(component.m_componentLocation, std::ios::beg);
+         if(temp->parseStream(in, theHeader->getByteOrder()) != ossimErrorCodes::OSSIM_OK)
+         {
+            delete temp;
+            temp =0;
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimRpfFrame::populateAttributeSection:  leaving 1 ..." << std::endl;
+            }
+            return ossimErrorCodes::OSSIM_ERROR;
+         }
+      }
+   }
+   if(!in.fail()&&temp)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: Has attribute section" << std::endl;
+      }
+      if(theAttributes) delete theAttributes;
+      theAttributes = new ossimRpfAttributes;
+      ossimRpfAttributeOffsetRecord record;
+      ossim_uint64 locationAttributeSubsection = in.tellg();
+      ossim_uint64 absoluteAddresToTable = locationAttributeSubsection + temp->getAttributeOffsetTableOffset();
+      ossimEndian anEndian;
+
+      
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG: Number of attributes = "
+            <<  temp->getNumberOfAttributeOffsetRecords()
+            << std::endl;
+      }
+      in.seekg(absoluteAddresToTable, ios::beg);
+      for(ossim_uint32 index = 0;
+          index < temp->getNumberOfAttributeOffsetRecords();
+          index++)
+      {
+         if((!in.fail())&&
+            record.parseStream(in, theHeader->getByteOrder()) ==
+            ossimErrorCodes::OSSIM_OK)
+         {
+            // make sure we save the current position.  The attribute
+            // parser in the switch/case will change the location and
+            // we must come back to the start of the next record.
+            ossim_uint64 currentLocation = in.tellg();
+
+            // go to the location of the start of the attribute.               
+            in.seekg(locationAttributeSubsection + record.getAttributeRecordOffset(), ios::beg);
+
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "DEBUG: Parsing attribute number  " << index
+                  << " with id = " << record.getAttributeId()
+                  << std::endl;
+            }
+            // allocate some temporary space for the string type
+            // attributes.
+            char tempString[50];
+            if(!theAttributes->getAttributeFlag(record.getAttributeId()))
+            {
+               theAttributes->setAttributeFlag(record.getAttributeId(), true);
+               switch(record.getAttributeId())
+               {
+               case 1:
+               {
+                  in.read((char*)tempString, 8);
+                  tempString[8] = '\0';
+                  theAttributes->theCurrencyDate = tempString;
+                  break;
+               }
+               case 2:
+               {
+                  in.read((char*)tempString, 8);
+                  tempString[8] = '\0';
+                  theAttributes->theProductionDate = tempString;
+                  break;
+               }
+               case 3:
+               {
+                  in.read((char*)tempString, 8);
+                  tempString[8] = '\0';
+                  theAttributes->theSignificantDate = tempString;
+                  break;
+               }
+               case 4:
+               {
+                  in.read((char*)tempString, 10);
+                  theAttributes->theChartSeriesCode = ossimString(tempString,
+                                                                  &tempString[10]);
+                  in.read((char*)tempString, 8);
+                  theAttributes->theMapDesignationCode = ossimString(tempString,
+                                                                     &tempString[8]);
+                  in.read((char*)tempString, 4);
+                  theAttributes->theOldHorDatum = ossimString(tempString,
+                                                              &tempString[4]);
+                  in.read((char*)tempString, 7);
+                  theAttributes->theEdition = ossimString(tempString,
+                                                          &tempString[7]);
+                  break;
+               }
+               case 5:
+               {
+                  in.read((char*)tempString, 2);
+                  theAttributes->theProjectionCode = ossimString(tempString,
+                                                                 &tempString[2]);
+                  theAttributes->theProjectionCode = theAttributes->theProjectionCode.upcase();
+                  if((theAttributes->theProjectionCode == "AC") ||
+                     (theAttributes->theProjectionCode == "LE") ||
+                     (theAttributes->theProjectionCode == "PG"))
+                  {
+                     in.read((char*)&(theAttributes->theProjectionA), 4);
+                     in.read((char*)&(theAttributes->theProjectionB), 4);
+                     in.read((char*)&(theAttributes->theProjectionC), 4);
+                     in.read((char*)&(theAttributes->theProjectionD), 4);
+                  }
+                  else if((theAttributes->theProjectionCode == "RB") ||
+                          (theAttributes->theProjectionCode == "OC") ||
+                          (theAttributes->theProjectionCode == "TC"))
+                  {
+                     in.read((char*)&(theAttributes->theProjectionA), 4);
+                     in.read((char*)&(theAttributes->theProjectionB), 4);
+                     in.read((char*)&(theAttributes->theProjectionC), 4);
+                  }
+                  else if((theAttributes->theProjectionCode == "AL") ||
+                          (theAttributes->theProjectionCode == "MC") ||
+                          (theAttributes->theProjectionCode == "OD") ||
+                          (theAttributes->theProjectionCode == "PH"))
+                  {
+                     in.read((char*)&(theAttributes->theProjectionA), 4);
+                     in.read((char*)&(theAttributes->theProjectionB), 4);
+                  }
+                  else if((theAttributes->theProjectionCode == "UT"))
+                  {
+                     in.read((char*)&(theAttributes->theProjectionA), 4);
+                  }
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theProjectionA);
+                     anEndian.swap(theAttributes->theProjectionB);
+                     anEndian.swap(theAttributes->theProjectionC);
+                     anEndian.swap(theAttributes->theProjectionD);
+                  }
+                  break;
+               }
+               case 6:
+               {
+                  in.read((char*)tempString, 4);
+                  theAttributes->theVertDatumCode = ossimString(tempString,
+                                                                &tempString[4]);
+                  break;
+               }
+               case 7:
+               {
+                  in.read((char*)tempString, 4);
+                  theAttributes->theHorDatumCode = ossimString(tempString,
+                                                               &tempString[4]);
+                  break;
+               }
+               case 8:
+               {
+                  in.read((char*)&(theAttributes->theVertAbsAccuracy), 4);
+                  in.read((char*)&(theAttributes->theVertAbsUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theVertAbsAccuracy);
+                     anEndian.swap(theAttributes->theVertAbsUnits);
+                  }
+                  break;
+               }
+               case 9:
+               {
+                  in.read((char*)&(theAttributes->theHorAbsAccuracy), 4);
+                  in.read((char*)&(theAttributes->theHorAbsUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theHorAbsAccuracy);
+                     anEndian.swap(theAttributes->theHorAbsUnits);
+                  }
+                  break;
+               }
+               case 10:
+               {
+                  in.read((char*)&(theAttributes->theVertRelAccuracy), 4);
+                  in.read((char*)&(theAttributes->theVertRelUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theVertRelAccuracy);
+                     anEndian.swap(theAttributes->theVertRelUnits);
+                  }
+                  break;
+               }
+               case 11:
+               {
+                  in.read((char*)&(theAttributes->theHorRelAccuracy), 4);
+                  in.read((char*)&(theAttributes->theHorRelUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theHorRelAccuracy);
+                     anEndian.swap(theAttributes->theHorRelUnits);
+                  }
+                  break;
+               }            
+               case 12:
+               {
+                  in.read((char*)tempString, 3);
+                  theAttributes->ellipsoidCode = ossimString(tempString,
+                                                             &tempString[3]);
+                  break;
+               }            
+               case 13:
+               {
+                  in.read((char*)tempString, 4);
+                  theAttributes->theSoundingDatumCode = ossimString(tempString,
+                                                                    &tempString[4]);
+                  break;
+               }            
+               case 14:
+               {
+                  in.read((char*)&(theAttributes->theNavSystemCode), 2);
+                  
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theNavSystemCode);
+                  }
+                  break;
+               }            
+               case 15:
+               {
+                  in.read((char*)tempString, 2);
+                  theAttributes->theGridCode = ossimString(tempString,
+                                                           &tempString[2]);
+                  break;
+               }            
+               case 16:
+               {
+                  in.read((char*)&(theAttributes->theEeasterlyMagChange), 4);
+                  in.read((char*)&(theAttributes->theEasterlyMagChangeUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theEeasterlyMagChange);
+                     anEndian.swap(theAttributes->theEasterlyMagChangeUnits);
+                  }
+                  break;
+               }
+               case 17:
+               {
+                  in.read((char*)&(theAttributes->theWesterlyMagChange), 4);
+                  in.read((char*)&(theAttributes->theWesterlyMagChangeUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theWesterlyMagChange);
+                     anEndian.swap(theAttributes->theWesterlyMagChangeUnits);
+                  }
+                  break;
+               }
+               case 18:
+               {
+                  in.read((char*)&(theAttributes->theMagAngle), 4);
+                  in.read((char*)&(theAttributes->theMagAngleUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theMagAngle);
+                     anEndian.swap(theAttributes->theMagAngleUnits);
+                  }
+                  break;
+               }
+               case 19:
+               {
+                  in.read((char*)&(theAttributes->theGridConver), 4);
+                  in.read((char*)&(theAttributes->theGridConverUnits), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theGridConver);
+                     anEndian.swap(theAttributes->theGridConverUnits);
+                  }
+                  break;
+               }
+               case 20:
+               {
+                  in.read((char*)&(theAttributes->theHighElevation), 8);
+                  in.read((char*)&(theAttributes->theHighElevationUnits), 2);
+                  in.read((char*)&(theAttributes->theHighLat), 8);
+                  in.read((char*)&(theAttributes->theHighLon), 8);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theHighElevation);
+                     anEndian.swap(theAttributes->theHighElevationUnits);
+                     anEndian.swap(theAttributes->theHighLat);
+                     anEndian.swap(theAttributes->theHighLon);
+                  }
+                  break;
+               }
+               case 21:
+               {
+                  in.read((char*)tempString, 12);
+                  theAttributes->theLegendFileName = ossimString(tempString,
+                                                                 &tempString[12]);
+                  break;
+               }
+               case 22:
+               {
+                  in.read((char*)tempString, 12);
+                  tempString[12] = '\0';
+                  theAttributes->theDataSource = tempString;
+                  in.read((char*)&(theAttributes->theGsd), 4);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theGsd);
+                  }
+                  break;
+               }
+               case 23:
+               {
+                  in.read((char*)&(theAttributes->theDataLevel), 2);
+                  if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                  {
+                     anEndian.swap(theAttributes->theDataLevel);
+                  }
+                  break;
+               }
+               }
+            }
+            in.seekg(currentLocation, ios::beg);
+         }
+         else
+         {
+            delete temp;
+            temp = 0;
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimRpfFrame::populateAttributeSection:  leaving 2 ..." << std::endl;
+            }
+            return ossimErrorCodes::OSSIM_ERROR;
+         }
+      }
+   }
+   if(temp) delete temp;
+   temp = 0;
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimRpfFrame::populateAttributeSection:  leaving OK ..." << std::endl;
+   }
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+ossimErrorCode ossimRpfFrame::populateMasks(istream& in)
+{
+   theSubframeMaskTable.clear();
+   theSubframeTransparencyMaskTable.clear();
+
+   if(!in)
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   if(theImageDescriptionSubheader)
+   {
+      const ossimRpfLocationSection* location = theHeader->getLocationSection();
+      if(location)
+      {
+         ossimRpfComponentLocationRecord component;
+         
+         if(location->getComponent(OSSIM_RPF_MASK_SUBSECTION,
+                                   component))
+         {
+            
+            // now allocate the space we need and then reader the table in
+            
+            theSubframeMaskTable.resize(theImageDescriptionSubheader->getNumberOfSpectralGroups());
+            theSubframeTransparencyMaskTable.resize(theImageDescriptionSubheader->getNumberOfSpectralGroups());
+            
+            ossim_uint32 spectralIndex;
+            ossim_uint32 rowIndex;
+            ossim_uint32 colIndex;
+            
+            if(!theImageDescriptionSubheader->isSubframeMaskTableOffsetNull())
+            {
+               // move get to the first byte of the Mask table.  This is the offset from the
+               // start of the maskSubsection. 
+               in.seekg(component.m_componentLocation +
+                        theImageDescriptionSubheader->getSubframeMaskTableOffset(), ios::beg);
+               // first loop through the Mask table and allocate while we do it
+               for(spectralIndex = 0;
+                   spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
+                   ++spectralIndex)
+               {
+                  // reserve space for the number of rows
+                  theSubframeMaskTable[spectralIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesVertical());
+                  for(rowIndex = 0;
+                      rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
+                      ++rowIndex)
+                  {
+                     // allocate the columns
+                     theSubframeMaskTable[spectralIndex][rowIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesHorizontal());
+                     for(colIndex = 0;
+                         colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
+                         ++colIndex)
+                     {
+                        ossim_uint32 value;
+                        
+                        in.read((char*)&value, 4);
+                        ossimEndian anEndian;
+                        
+                        if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                        {
+                           anEndian.swap(value);
+                        }
+                        theSubframeMaskTable[spectralIndex][rowIndex][colIndex] = value;
+                     }
+                  }
+               }
+            }
+            if(!theImageDescriptionSubheader->isTransparencyMaskTableOffsetNull())
+            {
+               // move get to the first byte of the Mask table.  This is the offset from the
+               // start of the maskSubsection. 
+               in.seekg(component.m_componentLocation +
+                        theImageDescriptionSubheader->getTransparencyMaskTableOffset(),ios::beg);
+               for(spectralIndex = 0;
+                   spectralIndex < theImageDescriptionSubheader->getNumberOfSpectralGroups();
+                   ++spectralIndex)
+               {
+                  // reserve space for the number of rows
+                  theSubframeTransparencyMaskTable[spectralIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesVertical());
+                  for(rowIndex = 0;
+                      rowIndex < theImageDescriptionSubheader->getNumberOfSubframesVertical();
+                      ++rowIndex)
+                  {
+                     // allocate the columns
+                     theSubframeTransparencyMaskTable[spectralIndex][rowIndex].resize(theImageDescriptionSubheader->getNumberOfSubframesHorizontal());
+                     for(colIndex = 0;
+                         colIndex < theImageDescriptionSubheader->getNumberOfSubframesHorizontal();
+                         ++colIndex)
+                     {
+                        ossim_uint32 value;
+                        
+                        in.read((char*)&value, 4);
+                        ossimEndian anEndian;
+                        
+                        if(anEndian.getSystemEndianType() != theHeader->getByteOrder())
+                        {
+                           anEndian.swap(value);
+                        }
+                        theSubframeTransparencyMaskTable[spectralIndex][rowIndex][colIndex] = value;
+                     }
+                  }
+               }
+            }
+         }
+      }
+   }
+   
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+ossimErrorCode ossimRpfFrame::populateReplaceUpdateTable(std::istream& in)
+{
+   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
+   
+   const ossimRpfLocationSection* location = theHeader->getLocationSection();
+
+   if( location )
+   {
+      if ( location->hasComponent(OSSIM_RPF_REPLACE_UPDATE_SECTION_SUBHEADER) )
+      {
+         ossimRpfComponentLocationRecord component;
+         if( location->getComponent(OSSIM_RPF_REPLACE_UPDATE_SECTION_SUBHEADER, component) )
+         {
+            ossimRefPtr<ossimRpfReplaceUpdateSectionSubheader> hdr =
+               new ossimRpfReplaceUpdateSectionSubheader();
+            
+            in.seekg(component.m_componentLocation, ios::beg);
+            
+            if( hdr->parseStream( in, theHeader->getByteOrder() ) == ossimErrorCodes::OSSIM_OK )
+            {
+               ossim_uint16 count = hdr->getNumberOfRecords();
+               if ( count )
+               {
+                  if ( theReplaceUpdateTable.valid() )
+                  {
+                     theReplaceUpdateTable->clear();
+                  }
+                  else
+                  {
+                     theReplaceUpdateTable = new ossimRpfReplaceUpdateTable();
+                  }
+                  ossimRpfReplaceUpdateRecord record;
+                  for ( ossim_uint16 i = 0; i < count; ++i )
+                  {
+                     if ( record.parseStream(in) == ossimErrorCodes::OSSIM_OK )
+                     {
+                        theReplaceUpdateTable->addRecord( record );
+                     }
+                     else
+                     {
+                        break;
+                     }
+                  }
+               }
+               
+            }
+         }  
+      }
+   }
+
+   if ( in.fail() )
+   {
+      theReplaceUpdateTable = 0;
+      result = ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return result;
+
+} // End: ossimRpfFrame::populateReplaceUpdateTable(std::istream& in)
+
+ossimRefPtr<ossimRpfReplaceUpdateTable> ossimRpfFrame::getRpfReplaceUpdateTable() const
+{
+   return theReplaceUpdateTable;
+}
diff --git a/src/support_data/ossimRpfFrameEntry.cpp b/src/support_data/ossimRpfFrameEntry.cpp
new file mode 100644
index 0000000..7b1b3a0
--- /dev/null
+++ b/src/support_data/ossimRpfFrameEntry.cpp
@@ -0,0 +1,125 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id: ossimRpfFrameEntry.cpp 18052 2010-09-06 14:33:08Z dburken $
+
+#include <ostream>
+#include <ossim/support_data/ossimRpfFrameEntry.h>
+
+std::ostream& operator<<(std::ostream& out, const ossimRpfFrameEntry& data)
+{
+   return data.print(out);
+}
+
+ossimRpfFrameEntry::ossimRpfFrameEntry(const ossimFilename& rootDirectory,
+                                       const ossimFilename& pathToFrameFileFromRoot)
+   :m_exists(false),
+    m_rootDirectory(rootDirectory),
+    m_pathToFrameFileFromRoot(pathToFrameFileFromRoot),
+    m_fullValidPath()
+{
+   setEntry(rootDirectory,
+            pathToFrameFileFromRoot);
+}
+
+ossimRpfFrameEntry::ossimRpfFrameEntry(const ossimRpfFrameEntry& obj)
+   :m_exists(obj.m_exists),
+    m_rootDirectory(obj.m_rootDirectory),
+    m_pathToFrameFileFromRoot(obj.m_pathToFrameFileFromRoot),
+    m_fullValidPath(obj.m_fullValidPath)
+{}
+
+const ossimRpfFrameEntry& ossimRpfFrameEntry::operator=(const ossimRpfFrameEntry& rhs)
+{
+   if (this != &rhs)
+   {
+      m_exists                  = rhs.m_exists;
+      m_rootDirectory           = rhs.m_rootDirectory;
+      m_pathToFrameFileFromRoot = rhs.m_pathToFrameFileFromRoot;
+      m_fullValidPath           = rhs.m_fullValidPath;
+   }
+   return *this;
+}
+
+void ossimRpfFrameEntry::setEntry(const ossimFilename& rootDirectory,
+                                  const ossimFilename& pathToFrameFileFromRoot)
+{
+   //---
+   // We must check for case combinations:
+   //---
+   m_rootDirectory           = rootDirectory;
+   m_pathToFrameFileFromRoot = pathToFrameFileFromRoot;
+   m_fullValidPath = m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
+
+   // Check as supplied:
+   if(m_fullValidPath.exists())
+   {
+      m_exists = true;
+   }
+   else // Check root/downcased_path
+   {
+      m_pathToFrameFileFromRoot = m_pathToFrameFileFromRoot.downcase();
+      m_fullValidPath = m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
+
+      if(m_fullValidPath.exists())
+      {
+         m_exists = true;
+      }
+      else // Check root/upcased_path
+      {
+         m_pathToFrameFileFromRoot = m_pathToFrameFileFromRoot.upcase();
+         m_fullValidPath =
+            m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
+         if(m_fullValidPath.exists())
+         {
+            m_exists = true;
+         }
+         else
+         {
+            m_pathToFrameFileFromRoot = pathToFrameFileFromRoot;
+            m_fullValidPath =
+               m_rootDirectory.dirCat(m_pathToFrameFileFromRoot);
+            m_exists = false;
+         }
+      }
+   }
+}
+std::ostream& ossimRpfFrameEntry::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   out << prefix << "exists:       " << m_exists << "\n"
+       << prefix << "root_directory: " << m_rootDirectory << "\n"
+       << prefix << "relative_path: "
+       << m_pathToFrameFileFromRoot << "\n"
+       << prefix << "full_path:     " << m_fullValidPath << "\n";
+
+   return out;
+}
+
+bool ossimRpfFrameEntry::exists() const
+{
+   return m_exists;
+}
+
+const ossimFilename& ossimRpfFrameEntry::getFullPath() const
+{
+   return m_fullValidPath;
+}
+
+const ossimString& ossimRpfFrameEntry::getRootDirectory() const
+{
+   return m_rootDirectory;
+}
+
+const ossimString ossimRpfFrameEntry::getPathToFrameFileFromRoot() const
+{
+   return m_pathToFrameFileFromRoot;
+}
diff --git a/ossim/src/ossim/support_data/ossimRpfFrameFileIndexRecord.cpp b/src/support_data/ossimRpfFrameFileIndexRecord.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfFrameFileIndexRecord.cpp
rename to src/support_data/ossimRpfFrameFileIndexRecord.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.cpp b/src/support_data/ossimRpfFrameFileIndexSectionSubheader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.cpp
rename to src/support_data/ossimRpfFrameFileIndexSectionSubheader.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfFrameFileIndexSubsection.cpp b/src/support_data/ossimRpfFrameFileIndexSubsection.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfFrameFileIndexSubsection.cpp
rename to src/support_data/ossimRpfFrameFileIndexSubsection.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfFrameFileReader.cpp b/src/support_data/ossimRpfFrameFileReader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfFrameFileReader.cpp
rename to src/support_data/ossimRpfFrameFileReader.cpp
diff --git a/src/support_data/ossimRpfHeader.cpp b/src/support_data/ossimRpfHeader.cpp
new file mode 100644
index 0000000..ccfb9c1
--- /dev/null
+++ b/src/support_data/ossimRpfHeader.cpp
@@ -0,0 +1,872 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: This class extends the stl's string class.
+//
+//********************************************************************
+// $Id: ossimRpfHeader.cpp 22702 2014-04-02 13:50:02Z gpotts $
+
+#include <cstring>
+#include <iostream>
+#include <fstream>
+
+#include <ossim/support_data/ossimRpfHeader.h>
+#include <ossim/base/ossimCommon.h> /* ossim::byteOrder() */
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimNitfCommon.h>
+#include <ossim/support_data/ossimRpfLocationSection.h>
+#include <ossim/support_data/ossimRpfCoverageSection.h>
+#include <ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h>
+#include <ossim/support_data/ossimRpfBoundaryRectTable.h>
+#include <ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h>
+#include <ossim/support_data/ossimRpfFrameFileIndexSubsection.h>
+#include <ossim/support_data/ossimRpfImageDescriptionSubheader.h>
+#include <ossim/support_data/ossimRpfMaskSubsection.h>
+#include <ossim/support_data/ossimRpfAttributeSectionSubheader.h>
+#include <ossim/support_data/ossimRpfImageDisplayParameterSubheader.h>
+#include <ossim/support_data/ossimRpfCompressionSectionSubheader.h>
+#include <ossim/support_data/ossimRpfCompressionSection.h>
+#include <ossim/support_data/ossimRpfColorGrayscaleSubheader.h>
+
+#include <ossim/base/ossimTrace.h>
+
+ // Static trace for debugging
+static ossimTrace traceDebug("ossimRpfHeader:debug");
+
+// Keywords:
+static const ossimString HEADER_SECTION_LENGTH_KW    = "HeaderSectionLength";
+static const ossimString NEW_REP_UP_INDICATOR_KW     = "NewRepUpIndicator";
+static const ossimString GOV_SPEC_NUMBER_KW          = "GovSpecNumber";
+static const ossimString GOV_SPEC_DATE_KW            = "GovSpecDate";
+static const ossimString SECURITY_CLASSIFICATION_KW  = "SecurityClassification";
+static const ossimString COUNTRY_CODE_KW             = "CountryCode";
+static const ossimString SECURITY_RELEASE_MARKING_KW = "SecurityReleaseMarking";
+
+
+ossimRpfHeader::ossimRpfHeader()
+   :
+   ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
+   m_littleBigEndianIndicator(0x00),
+   m_headerSectionLength(48),
+   m_fileName(),
+   m_newRepUpIndicator(0),
+   m_govSpecNumber(),
+   m_govSpecDate(),
+   m_securityClassification(),
+   m_countryCode(),
+   m_securityReleaseMarking(),
+   m_locSectionLoc(0),
+   m_locationSection(new ossimRpfLocationSection)
+{
+   memset(m_fileName, ' ' , 12);
+   memset(m_govSpecNumber, ' ', 15);
+   memset(m_govSpecDate, ' ', 8);
+   memset(m_securityClassification, ' ', 1);
+   memset(m_countryCode, ' ', 2);
+   memset(m_securityReleaseMarking, ' ', 2);
+   
+   m_fileName[12] = '\0';
+   m_govSpecNumber[15] = '\0';
+   m_govSpecDate[8] = '\0';
+   m_securityClassification[1] = '\0';
+   m_countryCode[2] = '\0';
+   m_securityReleaseMarking[2] = '\0';
+}
+
+ossimRpfHeader::ossimRpfHeader(const ossimRpfHeader& obj)
+   :
+   ossimNitfRegisteredTag(std::string("RPFHDR"), 48),
+   m_littleBigEndianIndicator(obj.m_littleBigEndianIndicator),
+   m_headerSectionLength(obj.m_headerSectionLength),
+   m_fileName(),
+   m_newRepUpIndicator(obj.m_newRepUpIndicator),
+   m_govSpecNumber(),
+   m_govSpecDate(),
+   m_securityClassification(),
+   m_countryCode(),
+   m_securityReleaseMarking(),
+   m_locSectionLoc(obj.m_locSectionLoc),
+   m_locationSection( new ossimRpfLocationSection( *(obj.m_locationSection) ) )
+{
+   memcpy(m_fileName, obj.m_fileName, 13);
+   memcpy(m_govSpecNumber, obj.m_govSpecNumber, 16);
+   memcpy(m_govSpecDate, obj.m_govSpecDate, 9);
+   memcpy(m_securityClassification, obj.m_securityClassification, 2);
+   memcpy(m_countryCode, obj.m_countryCode, 3);
+   memcpy(m_securityReleaseMarking, obj.m_securityReleaseMarking, 3);
+}
+
+const ossimRpfHeader& ossimRpfHeader::operator=(const ossimRpfHeader& rhs)
+{
+   if ( this != &rhs )
+   {
+      m_littleBigEndianIndicator = rhs.m_littleBigEndianIndicator;
+      m_headerSectionLength = rhs.m_headerSectionLength;
+      memcpy(m_fileName, rhs.m_fileName, 13);
+      m_newRepUpIndicator = rhs.m_newRepUpIndicator;
+      memcpy(m_govSpecNumber, rhs.m_govSpecNumber, 16);
+      memcpy(m_govSpecDate, rhs.m_govSpecDate, 9);   
+      memcpy(m_securityClassification, rhs.m_securityClassification, 2);
+      memcpy(m_countryCode, rhs.m_countryCode, 3);
+      memcpy(m_securityReleaseMarking, rhs.m_securityReleaseMarking, 3);
+      m_locSectionLoc = rhs.m_locSectionLoc;
+
+      m_locationSection = new ossimRpfLocationSection( *(rhs.m_locationSection) );
+   }
+   return *this;
+}
+
+ossimRpfHeader::~ossimRpfHeader()
+{
+   if(m_locationSection)
+   {
+      delete m_locationSection;
+      m_locationSection = 0;
+   }
+}
+
+void ossimRpfHeader::parseStream(std::istream& in)
+{
+   if(in)
+   {
+      in.read((char*)&m_littleBigEndianIndicator, 1);
+
+      in.read((char*)&m_headerSectionLength, 2);
+      in.read((char*)m_fileName, 12);
+      in.read((char*)&m_newRepUpIndicator, 1);
+      in.read((char*)m_govSpecNumber, 15);
+      in.read((char*)m_govSpecDate, 8);
+      in.read((char*)m_securityClassification, 1);
+      in.read((char*)m_countryCode, 2);
+      in.read((char*)m_securityReleaseMarking, 2);
+      in.read((char*)&m_locSectionLoc, 4);
+      
+      m_fileName[12] = '\0';
+      m_govSpecNumber[15] = '\0';
+      m_govSpecDate[8] = '\0';
+      m_securityClassification[1] = '\0';
+      m_countryCode[2] = '\0';
+      m_securityReleaseMarking[2] = '\0';
+      
+      //---
+      // From spec:  MIL-PRF-89038CARDG m_littleBigEndianIndicator shall
+      // be 0x00 for all data denoting big endian storage.  We will test
+      // anyway just in case...
+      //---
+      ossimByteOrder dataByteOrder = getByteOrder();
+
+      if( ossim::byteOrder() != dataByteOrder )
+      {
+         ossimEndian anEndian;
+         anEndian.swap(m_headerSectionLength);
+         anEndian.swap(m_locSectionLoc);
+      }
+
+      std::streamoff saveGet = in.tellg();
+      in.seekg(m_locSectionLoc, ios::beg);
+      m_locationSection->parseStream(in, dataByteOrder);
+      in.seekg(saveGet, ios::beg);
+   }
+}
+
+void ossimRpfHeader::writeStream(std::ostream& out)
+{
+   // Always write in big endian.
+   if (m_littleBigEndianIndicator != 0x00)
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "ossimRpfHeader::writeStream writing in big endian even though"
+         << " the m_littleBigEndianIndicator is set to little endian."
+         << std::endl;
+      m_littleBigEndianIndicator = 0x00;
+   }
+   
+   ossimByteOrder dataByteOrder = getByteOrder();
+
+   if( ossim::byteOrder() != dataByteOrder )
+   {
+      ossimEndian anEndian;
+      anEndian.swap(m_headerSectionLength);
+      anEndian.swap(m_locSectionLoc);
+   }
+
+   out.write((char*)&m_littleBigEndianIndicator, 1);
+   
+   out.write((char*)&m_headerSectionLength, 2);
+   out.write((char*)m_fileName, 12);
+   out.write((char*)&m_newRepUpIndicator, 1);
+   out.write((char*)m_govSpecNumber, 15);
+   out.write((char*)m_govSpecDate, 8);
+   out.write((char*)m_securityClassification, 1);
+   out.write((char*)m_countryCode, 2);
+   out.write((char*)m_securityReleaseMarking, 2);
+   out.write((char*)&m_locSectionLoc, 4);
+
+   if( ossim::byteOrder() != dataByteOrder )
+   {
+      // Must swap things back or we will seek to a bad location.
+      ossimEndian anEndian;
+      anEndian.swap(m_headerSectionLength);
+      anEndian.swap(m_locSectionLoc);
+   }
+
+   if (m_locSectionLoc) // May or may not be set.
+   {
+      std::streampos pos = out.tellp();
+      out.seekp(m_locSectionLoc, ios::beg);
+      m_locationSection->writeStream(out);
+      out.seekp(pos);
+   }
+}
+
+std::ostream& ossimRpfHeader::print(std::ostream& out, const std::string& prefix) const
+{
+   out << prefix << "byte_order:               "
+       << (m_littleBigEndianIndicator==0x00?"big_endian\n":"little_endian\n")
+       << prefix << HEADER_SECTION_LENGTH_KW << ":      "
+       << m_headerSectionLength << "\n"
+       << prefix << ossimKeywordNames::FILENAME_KW << ":                 "
+       << m_fileName << "\n"
+       << prefix << NEW_REP_UP_INDICATOR_KW << ":        "
+       << int(m_newRepUpIndicator) << "\n"       
+       << prefix << GOV_SPEC_NUMBER_KW << ":            "
+       << m_govSpecNumber << "\n"
+       << prefix << GOV_SPEC_DATE_KW << ":              "
+       << m_govSpecDate << "\n"
+       << prefix << SECURITY_CLASSIFICATION_KW << ":   "
+       << m_securityClassification << "\n"
+       << prefix << COUNTRY_CODE_KW << ":              "
+       << m_countryCode   << "\n"           
+       << prefix << SECURITY_RELEASE_MARKING_KW << ":   "
+       << m_securityReleaseMarking << "\n";
+
+   if ( traceDebug() )
+   {
+      out << prefix << "LocSectionLoc:            "
+          << m_locSectionLoc << "\n";
+      if (m_locationSection)
+      {
+         m_locationSection->print(out, prefix);
+      }
+   }
+
+   return out;
+}
+
+ossimByteOrder ossimRpfHeader::getByteOrder()const
+{
+   return ( (m_littleBigEndianIndicator==0x00) ? OSSIM_BIG_ENDIAN : OSSIM_LITTLE_ENDIAN);
+}
+
+const ossimRpfLocationSection* ossimRpfHeader::getLocationSection() const
+{
+   return m_locationSection;
+}
+
+ossimRpfLocationSection* ossimRpfHeader::getLocationSection()
+{
+   return m_locationSection;
+}
+
+bool ossimRpfHeader::hasComponent(ossimRpfComponentId componentId)const
+{
+   if(m_locationSection)
+   {
+      return m_locationSection->hasComponent(componentId);
+   }
+   
+   return false;
+}
+
+ossimString ossimRpfHeader::getSecurityClassification()const
+{
+   return m_securityClassification;
+}
+
+ossimRpfCoverageSection* ossimRpfHeader::getNewCoverageSection(std::istream& in)const
+{
+   ossimRpfCoverageSection* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_COVERAGE_SECTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfCoverageSection;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            result->parseStream(in, getByteOrder());
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }
+   return result;
+}
+
+ossimRpfMaskSubsection*  ossimRpfHeader::getNewMaskSubsection(std::istream& in)const
+{
+   ossimRpfMaskSubsection* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_MASK_SUBSECTION,
+                                          component))
+      {
+         result = new ossimRpfMaskSubsection;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }
+   
+   return result;   
+}
+
+
+ossimRpfAttributeSectionSubheader* ossimRpfHeader::getNewAttributeSectionSubheader(std::istream& in)const
+{
+   ossimRpfAttributeSectionSubheader* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_ATTRIBUTE_SECTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfAttributeSectionSubheader;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }
+   
+   return result;
+}
+
+ossimRpfColorGrayscaleSubheader* ossimRpfHeader::getNewColorGrayscaleSubheader(std::istream& in)const
+{
+   ossimRpfColorGrayscaleSubheader* result = 0;
+   
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_COLOR_GRAYSCALE_SECTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfColorGrayscaleSubheader;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }      
+   }
+
+   return result;
+}
+
+ossimRpfCompressionSection* ossimRpfHeader::getNewCompressionSection(std::istream& in)const
+{   
+   ossimRpfCompressionSection* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_COMPRESSION_SECTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfCompressionSection;
+         
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }
+   
+   return result;   
+}
+
+ossimRpfCompressionSectionSubheader* ossimRpfHeader::getNewCompressionSectionSubheader(std::istream& in)const
+{
+   ossimRpfCompressionSectionSubheader* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_COMPRESSION_SECTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfCompressionSectionSubheader;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }
+   
+   return result;   
+}
+
+   
+
+ossimRpfImageDisplayParameterSubheader* ossimRpfHeader::getNewImageDisplayParameterSubheader(std::istream& in)const
+{
+   ossimRpfImageDisplayParameterSubheader* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_IMAGE_DISPLAY_PARAMETERS_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfImageDisplayParameterSubheader;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }
+   
+   return result;
+}
+
+ossimRpfImageDescriptionSubheader* ossimRpfHeader::getNewImageDescriptionSubheader(std::istream& in)const
+{
+   ossimRpfImageDescriptionSubheader* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_IMAGE_DESCRIPTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfImageDescriptionSubheader;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }
+   
+   return result;
+}
+
+
+ossimRpfBoundaryRectTable* ossimRpfHeader::getNewBoundaryRectTable(std::istream &in)const
+{
+   ossimRpfBoundaryRectTable* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      ossimRpfBoundaryRectSectionSubheader* tempSubheader = getNewBoundaryRectSectSubheader(in);
+
+      if(tempSubheader)
+      {
+         if(m_locationSection->getComponent(OSSIM_RPF_BOUNDARY_RECT_TABLE,
+                                             component))
+         {
+            result = new ossimRpfBoundaryRectTable;
+            
+            result->setNumberOfEntries(tempSubheader->getNumberOfEntries());
+            in.seekg(component.m_componentLocation, ios::beg);
+            if(in)
+            {
+               if(result->parseStream(in, getByteOrder()) !=
+                  ossimErrorCodes::OSSIM_OK)
+               {
+                  delete result;
+                  result = 0;
+               }
+            }
+            else
+            {
+               delete result;
+               result = 0;
+            }
+         }
+
+         delete tempSubheader;
+         tempSubheader = 0;
+      }
+   }   
+
+   return result;
+}
+
+ossimRpfBoundaryRectSectionSubheader* ossimRpfHeader::getNewBoundaryRectSectSubheader(std::istream &in)const
+{
+   ossimRpfBoundaryRectSectionSubheader* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+      
+      if(m_locationSection->getComponent(OSSIM_RPF_BOUNDARY_RECT_SECTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfBoundaryRectSectionSubheader;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }   
+
+   return result;
+   
+}
+
+ossimRpfFrameFileIndexSectionSubheader* ossimRpfHeader::getNewFrameFileIndexSectionSubheader(std::istream &in)const
+{
+   ossimRpfFrameFileIndexSectionSubheader* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+
+      if(m_locationSection->getComponent(OSSIM_RPF_FRAME_FILE_INDEX_SECTION_SUBHEADER,
+                                          component))
+      {
+         result = new ossimRpfFrameFileIndexSectionSubheader;
+
+         in.seekg(component.m_componentLocation, ios::beg);
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+   }   
+
+   return result;   
+}
+
+ossimRpfFrameFileIndexSubsection* ossimRpfHeader::getNewFileIndexSubsection(std::istream& in)const
+{
+   ossimRpfFrameFileIndexSubsection* result = 0;
+
+   if(in&&m_locationSection)
+   {
+      ossimRpfComponentLocationRecord component;
+      ossimRpfFrameFileIndexSectionSubheader* tempSubheader = getNewFrameFileIndexSectionSubheader(in);
+
+      if(m_locationSection->getComponent(OSSIM_RPF_FRAME_FILE_INDEX_SUBSECTION,
+                                          component))
+      {
+         result = new ossimRpfFrameFileIndexSubsection;
+
+         result->setNumberOfFileIndexRecords(tempSubheader->getNumberOfIndexRecords());
+         result->setNumberOfPathnames(tempSubheader->getNumberOfPathnameRecords());
+         in.seekg(component.m_componentLocation, ios::beg);
+         if(in)
+         {
+            if(result->parseStream(in, getByteOrder()) !=
+               ossimErrorCodes::OSSIM_OK)
+            {
+               delete result;
+               result = 0;
+            }
+         }
+         else
+         {
+            delete result;
+            result = 0;
+         }
+      }
+      if(tempSubheader)
+      {
+         delete tempSubheader;
+         tempSubheader = 0;
+      }
+   }   
+
+   return result;      
+}
+
+ossimRpfCompressionSection* ossimRpfHeader::getNewCompressionSection(const ossimFilename& file)const
+{
+   ifstream in(file.c_str(), ios::in|ios::binary);
+
+   return getNewCompressionSection(in);
+}
+
+ossimRpfCoverageSection* ossimRpfHeader::getNewCoverageSection(const ossimFilename& file)const
+{
+   ifstream in(file.c_str(), ios::in|ios::binary);
+   
+   return getNewCoverageSection(in);
+}
+
+ossimRpfBoundaryRectTable* ossimRpfHeader::getNewBoundaryRectTable(const ossimFilename &file)const
+{
+   ifstream in(file.c_str(), ios::in|ios::binary);
+   
+   return getNewBoundaryRectTable(in);
+}
+
+ossimRpfBoundaryRectSectionSubheader* ossimRpfHeader::getNewBoundaryRectSectSubheader(const ossimFilename &file)const
+{
+   ifstream in(file.c_str(), ios::in|ios::binary);
+
+   return getNewBoundaryRectSectSubheader(in);
+}
+
+ossimRpfFrameFileIndexSectionSubheader* ossimRpfHeader::getNewFrameFileIndexSectionSubheader(const ossimFilename &file)const
+{
+   ifstream in(file.c_str(), ios::in|ios::binary);
+
+   return getNewFrameFileIndexSectionSubheader(in);
+}
+
+ossimRpfFrameFileIndexSubsection* ossimRpfHeader::getNewFileIndexSubsection(const ossimFilename& file)const
+{
+   ifstream in(file.c_str(), ios::in|ios::binary);
+
+   return getNewFileIndexSubsection(in);
+}
+
+ossimString ossimRpfHeader::getDate()const
+{
+   return m_govSpecDate;
+}
+
+ossim_uint32 ossimRpfHeader::getLocationSectionLocation() const
+{
+   return m_locSectionLoc;
+}
+
+void ossimRpfHeader::setFilename(const ossimString& file)
+{
+   ossimNitfCommon::setField(m_fileName, file, 12);
+}
+
+void ossimRpfHeader::setNewRepUpIndicator(const ossimString& s)
+{
+   if (s.size())
+   {
+      // Range check maybe??? (drb)
+      m_newRepUpIndicator = static_cast<ossim_uint8>(*s.begin());
+   }
+}
+
+void ossimRpfHeader::setGovSpecNumber(const ossimString& s)
+{
+   ossimNitfCommon::setField(m_govSpecNumber, s, 15); 
+}
+
+void ossimRpfHeader::setGovSpecDate(const ossimString& s)
+{
+   ossimNitfCommon::setField(m_govSpecDate, s, 8); 
+}
+
+void ossimRpfHeader::setSecurityClassification(const ossimString& s)
+{
+   ossimNitfCommon::setField(m_securityClassification, s, 1);
+}
+
+void ossimRpfHeader::setCountryCode(const ossimString& s)
+{
+   ossimNitfCommon::setField(m_countryCode, s, 2); 
+}
+
+void ossimRpfHeader::setSecurityReleaseMarking(const ossimString& s)
+{
+   ossimNitfCommon::setField(m_securityReleaseMarking, s, 2);
+}
+
+void ossimRpfHeader::setLocationSectionPos(std::streamoff off)
+{
+   m_locSectionLoc = static_cast<ossim_uint32>(off);
+}
+
+bool ossimRpfHeader::loadState(const ossimKeywordlist& kwl, const char* prefix)
+{
+   const char* lookup = 0;
+   ossimString s;
+
+   lookup = kwl.find(prefix, NEW_REP_UP_INDICATOR_KW);
+   if (lookup)
+   {
+      s = lookup;
+      setNewRepUpIndicator(s);
+   }
+
+   lookup = kwl.find(prefix, GOV_SPEC_NUMBER_KW);
+   if (lookup)
+   {
+      s = lookup;
+      setGovSpecNumber(s);
+   }
+
+   lookup = kwl.find(prefix, GOV_SPEC_DATE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      setGovSpecDate(s);
+   }
+
+   lookup = kwl.find(prefix, SECURITY_CLASSIFICATION_KW);
+   if (lookup)
+   {
+      s = lookup;
+      setSecurityClassification(s);
+   }
+
+   lookup = kwl.find(prefix, COUNTRY_CODE_KW);
+   if (lookup)
+   {
+      s = lookup;
+      setCountryCode(s);
+   }
+
+   lookup = kwl.find(prefix, SECURITY_RELEASE_MARKING_KW);
+   if (lookup)
+   {
+      s = lookup;
+      setSecurityReleaseMarking(s);
+   }
+
+   return true;
+}
diff --git a/src/support_data/ossimRpfImageDescriptionSubheader.cpp b/src/support_data/ossimRpfImageDescriptionSubheader.cpp
new file mode 100644
index 0000000..070928e
--- /dev/null
+++ b/src/support_data/ossimRpfImageDescriptionSubheader.cpp
@@ -0,0 +1,114 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: This class extends the stl's string class.
+//
+//********************************************************************
+// $Id: ossimRpfImageDescriptionSubheader.cpp 14241 2009-04-07 19:59:23Z dburken $
+
+#include <istream>
+#include <ostream>
+#include <ossim/support_data/ossimRpfImageDescriptionSubheader.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimRpfImageDescriptionSubheader& data)
+{
+   return data.print(out);
+}
+
+ossimRpfImageDescriptionSubheader::ossimRpfImageDescriptionSubheader()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfImageDescriptionSubheader::parseStream(
+   std::istream& in, ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      theStartOffset = in.tellg();
+      in.read((char*)&theNumberOfSpectralGroups, 2);
+      in.read((char*)&theNumberOfSubframeTables, 2);
+      in.read((char*)&theNumberOfSpectralBandTables, 2);
+      in.read((char*)&theNumberOfSpectralBandLinesPerImageRow, 2);
+      in.read((char*)&theNumberOfSubframesHorizontal, 2);
+      in.read((char*)&theNumberOfSubframesVertical, 2);
+      in.read((char*)&theNumberOfOutputColumnsPerSubframe, 4);
+      in.read((char*)&theNumberOfOutputRowsPerSubframe, 4);
+      in.read((char*)&theSubframeMaskTableOffset, 4);
+      in.read((char*)&theTransparencyMaskTableOffset, 4);
+
+      theEndOffset = in.tellg();
+      ossimEndian anEndian;
+
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theNumberOfSpectralGroups);
+         anEndian.swap(theNumberOfSubframeTables);
+         anEndian.swap(theNumberOfSpectralBandTables);
+         anEndian.swap(theNumberOfSpectralBandLinesPerImageRow);
+         anEndian.swap(theNumberOfSubframesHorizontal);
+         anEndian.swap(theNumberOfSubframesVertical);
+         anEndian.swap(theNumberOfOutputColumnsPerSubframe);
+         anEndian.swap(theNumberOfOutputRowsPerSubframe);
+         anEndian.swap(theSubframeMaskTableOffset);
+         anEndian.swap(theTransparencyMaskTableOffset);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+std::ostream& ossimRpfImageDescriptionSubheader::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   out << prefix << "NumberOfSpectralGroups: "
+       << theNumberOfSpectralGroups << "\n"
+       << prefix << "NumberOfSubframeTables: "
+       << theNumberOfSubframeTables << "\n"
+       << prefix << "NumberOfSpectralBandTables: "
+       << theNumberOfSpectralBandTables << "\n"
+       << prefix << "NumberOfSpectralBandLinesPerImageRow: "
+       << theNumberOfSpectralBandLinesPerImageRow << "\n"
+       << prefix << "NumberOfSubframesHorizontal: "
+       << theNumberOfSubframesHorizontal << "\n"
+       << prefix << "NumberOfSubframesVertical: "
+       << theNumberOfSubframesVertical << "\n"
+       << prefix << "NumberOfOutputColumnsPerSubframe: "
+       << theNumberOfOutputColumnsPerSubframe << "\n"
+       << prefix << "NumberOfOutputRowsPerSubframe: "
+       << theNumberOfOutputRowsPerSubframe << "\n"
+       << prefix << "SubframeMaskTableOffset: "
+       << theSubframeMaskTableOffset << "\n"
+       << prefix << "TransparencyMaskTableOffset: "
+       << theTransparencyMaskTableOffset << std::endl;
+   return out;
+}
+
+void ossimRpfImageDescriptionSubheader::clearFields()
+{
+   theStartOffset                          = 0;
+   theEndOffset                            = 0;
+   
+   theNumberOfSpectralGroups               = 0;
+   theNumberOfSubframeTables               = 0;
+   theNumberOfSpectralBandTables           = 0;
+   theNumberOfSpectralBandLinesPerImageRow = 0;
+   theNumberOfSubframesHorizontal          = 0;
+   theNumberOfSubframesVertical            = 0;
+   theNumberOfOutputColumnsPerSubframe     = 0;
+   theNumberOfOutputRowsPerSubframe        = 0;
+   theSubframeMaskTableOffset              = 0;
+   theTransparencyMaskTableOffset          = 0;
+}
diff --git a/src/support_data/ossimRpfImageDisplayParameterSubheader.cpp b/src/support_data/ossimRpfImageDisplayParameterSubheader.cpp
new file mode 100644
index 0000000..2bb01f4
--- /dev/null
+++ b/src/support_data/ossimRpfImageDisplayParameterSubheader.cpp
@@ -0,0 +1,68 @@
+//*******************************************************************
+// License: MIT
+//
+// Author: Garrett Potts
+// 
+// Description: This class extends the stl's string class.
+//
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimRpfImageDisplayParameterSubheader.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIoStream.h>
+
+std::ostream& operator<<(std::ostream& out,
+                         const ossimRpfImageDisplayParameterSubheader& data)
+{
+   data.print(out);
+
+   return out;
+}
+
+ossimRpfImageDisplayParameterSubheader::ossimRpfImageDisplayParameterSubheader()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfImageDisplayParameterSubheader::parseStream(ossim::istream& in,
+                                                                   ossimByteOrder byteOrder)
+{
+   clearFields();
+   if(in)
+   {
+      theStartOffset = in.tellg();
+      in.read((char*)&theNumberOfImageRows, 4);
+      in.read((char*)&theNumberOfImageCodesPerRow, 4);
+      in.read((char*)&theImageCodeBitLength, 1);
+      theEndOffset = in.tellg();
+
+      ossimEndian anEndian;
+      if(anEndian.getSystemEndianType() != byteOrder)
+      {
+         anEndian.swap(theNumberOfImageRows);
+         anEndian.swap(theNumberOfImageCodesPerRow);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   return ossimErrorCodes::OSSIM_OK;
+}
+   
+void ossimRpfImageDisplayParameterSubheader::print(std::ostream& out)const
+{
+   out << "theNumberOfImageRows:          " << theNumberOfImageRows << "\n"
+       << "theNumberOfImageCodesPerRow:   " << theNumberOfImageCodesPerRow << "\n"
+       << "theImageCodeBitLength:         " << (unsigned long)theImageCodeBitLength;
+}
+
+void ossimRpfImageDisplayParameterSubheader::clearFields()
+{
+   theNumberOfImageRows        = 0;
+   theNumberOfImageCodesPerRow = 0;
+   theImageCodeBitLength       = 0;
+}
diff --git a/src/support_data/ossimRpfInfo.cpp b/src/support_data/ossimRpfInfo.cpp
new file mode 100644
index 0000000..89e6951
--- /dev/null
+++ b/src/support_data/ossimRpfInfo.cpp
@@ -0,0 +1,92 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Mingjie Su
+//
+// Description: Rpf Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossimRpfInfo.cpp 1237 2010-08-05 19:50:27Z ming.su $
+
+//ossim includes
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimRpfInfo.h>
+#include <ossim/support_data/ossimInfoFactory.h>
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimRpfInfo:debug");
+static ossimTrace traceDump("ossimRpfInfo:dump"); // This will dump offsets.
+
+ossimRpfInfo::ossimRpfInfo()
+   : ossimInfoBase(),
+     theFile(),
+     m_infoFile()
+{
+}
+
+ossimRpfInfo::~ossimRpfInfo()
+{
+}
+
+bool ossimRpfInfo::open(const ossimFilename& file)
+{
+   theFile = file;
+   if (isOpen())
+   {
+     std::ifstream in((theFile).c_str() );
+
+     std::string line;
+     int index = 0;
+     while(in.good())
+     {
+       // Read in a line.
+       std::getline(in, line);
+       ossimString tmpStr = ossimString(line);
+       if (index > 0)
+       {
+         if (!tmpStr.empty())
+         {
+           std::vector<ossimString> tmpVector = tmpStr.split("|");
+           if (tmpVector.size() > 0)
+           {
+             m_infoFile = tmpVector[0];
+             break;
+           }
+         }
+       }
+       index++;
+     }
+     in.close();
+
+     return true;
+   }
+   return false;
+}
+
+bool ossimRpfInfo::isOpen()
+{
+  ossimString ext = theFile.ext().downcase();
+
+  if(ext == "rpf")
+  {
+    return true;
+  }
+  else
+  {
+    return false;
+  }
+}
+
+std::ostream& ossimRpfInfo::print(std::ostream& out) const
+{
+  std::shared_ptr<ossimInfoBase> info = ossimInfoFactory::instance()->create(m_infoFile);
+  if (info)
+  {
+    info->print(out);
+  }
+
+  return out;
+}
\ No newline at end of file
diff --git a/src/support_data/ossimRpfLocationSection.cpp b/src/support_data/ossimRpfLocationSection.cpp
new file mode 100644
index 0000000..3b89862
--- /dev/null
+++ b/src/support_data/ossimRpfLocationSection.cpp
@@ -0,0 +1,315 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Rpf support class
+//
+//********************************************************************
+// $Id: ossimRpfLocationSection.cpp 20324 2011-12-06 22:25:23Z dburken $
+
+#include <ossim/support_data/ossimRpfLocationSection.h>
+#include <ossim/base/ossimCommon.h> /* ossim::byteOrder() */
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimRpfComponentIdLut.h>
+#include <istream>
+#include <ostream>
+#include <iterator>
+
+static const ossimTrace traceDebug("ossimRpfLocationSection:debug");
+
+std::ostream& operator<<(std::ostream& out, const ossimRpfComponentLocationRecord& data)
+{
+   return data.print(out);
+}
+
+ossimRpfComponentLocationRecord::ossimRpfComponentLocationRecord()
+   : m_componentId(0),
+     m_componentLength(0),
+     m_componentLocation(0)
+{
+}
+
+ossimRpfComponentLocationRecord::ossimRpfComponentLocationRecord(
+   const ossimRpfComponentLocationRecord& record)
+   : m_componentId(record.m_componentId),
+     m_componentLength(record.m_componentLength),
+     m_componentLocation(record.m_componentLocation)
+{
+}
+
+const ossimRpfComponentLocationRecord& ossimRpfComponentLocationRecord::operator=(
+   const ossimRpfComponentLocationRecord& rhs)
+{
+   if (this != &rhs)
+   {
+      m_componentId       = rhs.m_componentId;
+      m_componentLength   = rhs.m_componentLength;
+      m_componentLocation = rhs.m_componentLocation;
+   }
+   return *this;
+}
+
+std::ostream& ossimRpfComponentLocationRecord::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   out << prefix << "ComponentId:             "
+       << m_componentId << "\n"
+       << prefix << "ComponentIdString:       "
+       << ossimRpfComponentIdLut::instance()->getEntryString(m_componentId) << "\n"
+       << prefix << "ComponentLength:         "
+       << m_componentLength   << "\n"
+       << prefix << "ComponentLocation:       "
+       << m_componentLocation << "\n";
+   return out;
+}
+
+std::ostream& operator <<(std::ostream& out, const ossimRpfLocationSection &data)
+{
+   return data.print(out);
+}
+
+ossimErrorCode ossimRpfComponentLocationRecord::parseStream(
+   std::istream& in, ossimByteOrder byteOrder)
+{
+   if(in)
+   {
+      in.read((char*)&m_componentId, 2);
+      in.read((char*)&m_componentLength, 4);
+      in.read((char*)&m_componentLocation, 4);
+
+      if( ossim::byteOrder() != byteOrder)
+      {
+         // swap to native
+         ossimEndian anEndian;
+         anEndian.swap(m_componentId);
+         anEndian.swap(m_componentLength);
+         anEndian.swap(m_componentLocation);
+      }
+   }
+   else
+   {
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return  ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfComponentLocationRecord::writeStream(std::ostream& out)
+{
+   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
+   {
+      ossimEndian endian;
+      endian.swap(m_componentId);
+      endian.swap(m_componentLength);
+      endian.swap(m_componentLocation);
+   }
+
+   out.write((char*)&m_componentId, 2);
+   out.write((char*)&m_componentLength, 4);
+   out.write((char*)&m_componentLocation, 4);
+
+   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
+   {
+      // Swap back to native byte order.
+      ossimEndian endian;
+      endian.swap(m_componentId);
+      endian.swap(m_componentLength);
+      endian.swap(m_componentLocation);
+   }
+}
+
+ossimRpfLocationSection::ossimRpfLocationSection()
+{
+   clearFields();
+}
+
+ossimErrorCode ossimRpfLocationSection::parseStream(std::istream& in,
+                                                    ossimByteOrder byteOrder)
+{
+   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
+   
+   if(in)
+   {
+      clearFields();
+      
+      in.read((char*)&m_locationSectionLength, 2);
+      in.read((char*)&m_locationTableOffset, 4);
+      in.read((char*)&m_numberOfComponentLocationRecords, 2);
+      in.read((char*)&m_locationRecordLength, 2);
+      in.read((char*)&m_componentAggregateLength, 4);
+
+      if( ossim::byteOrder() != byteOrder )
+      {
+         ossimEndian anEndian;
+         anEndian.swap(m_locationSectionLength);
+         anEndian.swap(m_locationTableOffset);
+         anEndian.swap(m_numberOfComponentLocationRecords);
+         anEndian.swap(m_locationRecordLength);
+         anEndian.swap(m_componentAggregateLength);
+      }
+      
+      if(traceDebug())
+      {
+         print(ossimNotify(ossimNotifyLevel_DEBUG));
+         ossimNotify(ossimNotifyLevel_DEBUG) << std::endl;
+      }
+
+      m_componentLocationList.resize(m_numberOfComponentLocationRecords);
+      for(ossim_uint32 index = 0;
+          (index < m_componentLocationList.size())&&
+             (result == ossimErrorCodes::OSSIM_OK);
+          ++index)
+      {        
+         result = m_componentLocationList[index].parseStream(in, byteOrder);
+      }
+   }
+   else
+   {
+      result = ossimErrorCodes::OSSIM_ERROR;
+   }
+
+   return result;
+}
+
+
+void ossimRpfLocationSection::writeStream(std::ostream& out)
+{
+   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
+   {
+      // Always write in big endian.
+      ossimEndian endian;
+      endian.swap(m_locationSectionLength);
+      endian.swap(m_locationTableOffset);
+      endian.swap(m_numberOfComponentLocationRecords);
+      endian.swap(m_locationRecordLength);
+      endian.swap(m_componentAggregateLength);
+   }
+   
+   out.write((char*)&m_locationSectionLength, 2);
+   out.write((char*)&m_locationTableOffset, 4);
+   out.write((char*)&m_numberOfComponentLocationRecords, 2);
+   out.write((char*)&m_locationRecordLength, 2);
+   out.write((char*)&m_componentAggregateLength, 4);
+
+   if( ossim::byteOrder() != OSSIM_BIG_ENDIAN)
+   {
+      // Swap back to native byte order.
+      ossimEndian endian;
+      endian.swap(m_locationSectionLength);
+      endian.swap(m_locationTableOffset);
+      endian.swap(m_numberOfComponentLocationRecords);
+      endian.swap(m_locationRecordLength);
+      endian.swap(m_componentAggregateLength);
+   }
+   
+   for(ossim_uint32 i = 0; i < m_componentLocationList.size(); ++i)
+   {
+      m_componentLocationList[i].writeStream(out);
+   }
+}
+
+std::ostream& ossimRpfLocationSection::print(
+   std::ostream& out, const std::string& prefix) const
+{
+   out << prefix << "LocationSectionLength:            "
+       << m_locationSectionLength << "\n"
+       << prefix << "LocationTableOffset:              "
+       << m_locationTableOffset << "\n"
+       << prefix << "NumberOfComponentLocationRecords: "
+       << m_numberOfComponentLocationRecords << "\n"
+       << prefix << "LocationRecordLength:             "
+       << m_locationRecordLength << "\n"
+       << prefix << "ComponentAggregateLength:         "
+       << m_componentAggregateLength << "\n";
+   
+   if(m_numberOfComponentLocationRecords > 0)
+   {
+      std::vector<ossimRpfComponentLocationRecord>::const_iterator i =
+         m_componentLocationList.begin();
+      while (i != m_componentLocationList.end())
+      {
+         (*i).print(out, prefix);
+         ++i;
+      }
+   }
+   return out;
+}
+
+bool ossimRpfLocationSection::hasComponent(ossimRpfComponentId componentId)const
+{
+   ossimRpfComponentLocationRecord result;
+   
+   return getComponent(componentId, result);
+}
+
+bool ossimRpfLocationSection::getComponent(ossimRpfComponentId componentId,
+                                           ossimRpfComponentLocationRecord &result)const
+{
+   std::vector<ossimRpfComponentLocationRecord>::const_iterator component =
+      m_componentLocationList.begin();
+   
+   while(component != m_componentLocationList.end())
+   {
+      if((*component).m_componentId == static_cast<unsigned short>(componentId))
+      {
+         result = *component;
+
+         return true;
+      }      
+      ++component;
+   }
+   
+   return false;
+}
+
+void ossimRpfLocationSection::addComponentRecord(const ossimRpfComponentLocationRecord& record)
+{
+   m_componentLocationList.push_back(record);
+}
+
+void ossimRpfLocationSection::setLocationSectionLength(ossim_uint16 length)
+{
+   m_locationSectionLength = length;
+}
+
+void ossimRpfLocationSection::setLocationTableOffset(ossim_uint32 offset)
+{
+   m_locationTableOffset = offset;
+}
+
+void ossimRpfLocationSection::setNumberOfComponentLocationRecords(ossim_uint16 count)
+{
+   m_numberOfComponentLocationRecords = count;
+}
+
+void ossimRpfLocationSection::setLocationRecordLength(ossim_uint16 length)
+{
+   m_locationRecordLength = length;
+}
+
+void ossimRpfLocationSection::setComponentAggregateLength(ossim_uint32 length)
+{
+   m_componentAggregateLength = length;
+}
+
+void ossimRpfLocationSection::clearFields()
+{
+   m_locationSectionLength            = 0;
+   m_locationTableOffset              = 0;
+   m_numberOfComponentLocationRecords = 0;
+   m_locationRecordLength             = 0;
+   m_componentAggregateLength         = 0;
+
+   m_componentLocationList.clear();
+}
+
+std::vector<ossimRpfComponentLocationRecord>& ossimRpfLocationSection::getLocationRecordList()
+{
+   return m_componentLocationList;
+}
diff --git a/ossim/src/ossim/support_data/ossimRpfMaskSubheader.cpp b/src/support_data/ossimRpfMaskSubheader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfMaskSubheader.cpp
rename to src/support_data/ossimRpfMaskSubheader.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfMaskSubsection.cpp b/src/support_data/ossimRpfMaskSubsection.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfMaskSubsection.cpp
rename to src/support_data/ossimRpfMaskSubsection.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfPathnameRecord.cpp b/src/support_data/ossimRpfPathnameRecord.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfPathnameRecord.cpp
rename to src/support_data/ossimRpfPathnameRecord.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfReplaceUpdateRecord.cpp b/src/support_data/ossimRpfReplaceUpdateRecord.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfReplaceUpdateRecord.cpp
rename to src/support_data/ossimRpfReplaceUpdateRecord.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.cpp b/src/support_data/ossimRpfReplaceUpdateSectionSubheader.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfReplaceUpdateSectionSubheader.cpp
rename to src/support_data/ossimRpfReplaceUpdateSectionSubheader.cpp
diff --git a/ossim/src/ossim/support_data/ossimRpfReplaceUpdateTable.cpp b/src/support_data/ossimRpfReplaceUpdateTable.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimRpfReplaceUpdateTable.cpp
rename to src/support_data/ossimRpfReplaceUpdateTable.cpp
diff --git a/src/support_data/ossimRpfToc.cpp b/src/support_data/ossimRpfToc.cpp
new file mode 100644
index 0000000..f40a1f5
--- /dev/null
+++ b/src/support_data/ossimRpfToc.cpp
@@ -0,0 +1,1306 @@
+//*******************************************************************
+//
+// License: MIT
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+// 
+// Description: Rpf support class
+// 
+//********************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimRpfToc.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_X.h>
+#include <ossim/support_data/ossimNitfFileHeaderV2_0.h>
+#include <ossim/support_data/ossimRpfFrame.h>
+#include <ossim/support_data/ossimRpfFrameFileIndexSectionSubheader.h>
+#include <ossim/support_data/ossimRpfFrameFileIndexSubsection.h>
+#include <ossim/support_data/ossimRpfBoundaryRectTable.h>
+#include <ossim/support_data/ossimRpfLocationSection.h>
+#include <ossim/support_data/ossimRpfTocEntry.h>
+#include <ossim/support_data/ossimRpfFrameFileIndexRecord.h>
+#include <ossim/support_data/ossimRpfBoundaryRectSectionSubheader.h>
+#include <ossim/support_data/ossimRpfPathnameRecord.h>
+#include <ossim/support_data/ossimNitfFile.h>
+#include <ossim/base/ossimTrace.h>
+#include <iostream>
+#include <fstream>
+
+static ossimTrace traceDebug("ossimRpfToc:debug");
+
+std::ostream& operator <<(std::ostream& out, const ossimRpfToc& data)
+{
+   return data.print(out);
+}
+
+ossimRpfToc::ossimRpfToc()
+   :m_tocEntryList(),
+    m_filename(),
+    m_nitfFileHeader(0),
+    m_rpfHeader(0)
+{
+}
+
+ossimRpfToc::~ossimRpfToc()
+{
+   deleteAll();
+}
+
+ossimErrorCode ossimRpfToc::parseFile(const ossimFilename &fileName, bool keepFileHeader)
+{
+   static const char MODULE[] = "ossimRpfToc::parseFile";
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered....." << std::endl;
+   }
+
+   ossimRefPtr<ossimNitfFile> nitfFile = new ossimNitfFile;
+
+   clearAll();
+
+   nitfFile->parseFile(fileName);
+
+   m_nitfFileHeader = nitfFile->getHeader();
+
+   m_rpfHeader = 0; // ossimRefPtr
+   
+   if( !m_nitfFileHeader.valid() )
+   {
+      nitfFile = 0;
+      
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " leaving with no nitf header found....." << std::endl;
+      }
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   ossimNitfTagInformation info; 
+   m_nitfFileHeader->getTag(info, "RPFHDR");
+
+   if(traceDebug() && (info.getTagName() == "RPFHDR") )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " nitf file header print\n";
+      m_nitfFileHeader->print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+   
+   if ( !keepFileHeader )
+   {
+      // we no longer need access to the nitf header.  We got what we needed.
+      m_nitfFileHeader = 0;
+   }
+   nitfFile = 0;
+   
+   m_filename = fileName;
+
+   if(info.getTagName() == "RPFHDR")
+   {
+      m_rpfHeader = new ossimRpfHeader;
+
+      std::ifstream in(m_filename.c_str(), std::ios::in|std::ios::binary);
+      
+      // set the get pointer for the stream to the start
+      // of the Rpf header data
+      in.seekg(info.getTagDataOffset(), std::ios::beg);
+      
+      // now get the header data.  We do not need to pass in the byte order.
+      // this is grabbed from the first byte of the stream.  To see this,
+      // Look at the RpfHeader implementation.
+      m_rpfHeader->parseStream(in);
+
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG: Found RPF HEADER tag\n";
+         m_rpfHeader->print( ossimNotify(ossimNotifyLevel_DEBUG) );
+      }
+
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimRpfToc::parseFile: Leaving No RPFHDR tag found" << "\n";
+      }
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   if( m_rpfHeader.valid() )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: Building toc list" << "\n";
+      }
+      buildTocEntryList( m_rpfHeader.get() );
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimRpfToc::parseFile: Leaving no RPFHDR " << __LINE__ << "\n";
+      }
+      return ossimErrorCodes::OSSIM_ERROR;
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimRpfToc::parseFile: Returning with OK." << std::endl;
+   }
+   
+   return ossimErrorCodes::OSSIM_OK;
+}
+
+void ossimRpfToc::createTocAndCopyFrames( const ossimFilename& dotRpfFile,
+                                          const ossimFilename& outputDir )
+{
+   static const char MODULE[] = "ossimRpfToc::createTocAndCopyFrames";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..."
+         << "\ndot rpf file:      " << dotRpfFile
+         << "\noutput directory:  " << outputDir
+         << "\n";
+   }
+
+   if ( outputDir.expand().exists() == false )
+   {
+      if ( !outputDir.createDirectory(true, 0775) )
+      {
+         std::string e = MODULE;
+         e += " ERROR:\nCould not create directory: ";
+         e+= outputDir.c_str();
+         throw ossimException(e);
+      }
+   }
+
+   // Open the dot rpf file.
+   std::ifstream* dotRpfStr = new std::ifstream;
+   dotRpfStr->open(dotRpfFile.c_str(), ios_base::in);
+   if ( !dotRpfStr->good() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+
+      std::string e = MODULE;
+      e += " ERROR:\nCould not open: ";
+      e += dotRpfFile.c_str();
+      throw ossimException(e);
+   }
+
+   ossimFilename sourceADotTocFile = getSourceTocFile(*dotRpfStr);
+   if ( sourceADotTocFile.empty() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+
+      std::string e = MODULE;
+      e += " ERROR:\nCould not deduce source a.toc file!";
+      throw ossimException(e);
+   }
+   
+   // Open the source a.toc file. Note the true flag is to keep the file header.
+   ossimRefPtr<ossimRpfToc> sourceADotToc = new ossimRpfToc;
+   if ( sourceADotToc->parseFile(sourceADotTocFile, true) != ossimErrorCodes::OSSIM_OK )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+ 
+      std::string e = MODULE;
+      e += " ERROR:\nCould not open: ";
+      e += sourceADotTocFile.c_str();
+      throw ossimException(e);
+   }
+
+   ossimRefPtr<const ossimNitfFileHeader> sourceNitfFileHdr = sourceADotToc->getNitfFileHeader();
+   if ( !sourceNitfFileHdr.valid() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;        
+
+      std::string e = MODULE;
+      e += " ERROR:\nCould not get nitf file header from: ";
+      e += sourceADotTocFile.c_str();
+      throw ossimException(e);
+   }
+   
+   ossimRefPtr<const ossimRpfHeader> sourceRpfHdr = sourceADotToc->getRpfHeader();
+   if ( !sourceRpfHdr.valid() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+      
+      std::string e = MODULE;
+      e += " ERROR:\nCould not get rpf header from: ";
+      e += sourceADotTocFile.c_str();
+      throw ossimException(e);
+   }
+
+   // Get the boundary rect sub header from the source a.toc.
+   ossimRefPtr<ossimRpfBoundaryRectSectionSubheader> boundaryRectSectionSubheader =
+      sourceRpfHdr->getNewBoundaryRectSectSubheader(sourceADotTocFile);
+   if ( !boundaryRectSectionSubheader.valid() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+
+      std::string e = MODULE;
+      e += " ERROR:\nCould not pull boundary rect sub header from source file: ";
+      e += sourceADotTocFile.c_str();
+      throw ossimException(e);
+   }   
+
+   // Get the boundary rect table from the source a.toc.
+   ossimRefPtr<ossimRpfBoundaryRectTable> boundaryRectTable =
+      sourceRpfHdr->getNewBoundaryRectTable(sourceADotTocFile);
+   if ( !boundaryRectTable.valid() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+      
+      std::string e = MODULE;
+      e += " ERROR:\nCould not pull boundary rect table from source file: ";
+      e += sourceADotTocFile.c_str();
+      throw ossimException(e);
+   }
+   
+   // Get the frame file subheader from the source a.toc.
+   ossimRefPtr<ossimRpfFrameFileIndexSectionSubheader> frameFileSubHeader =
+      sourceRpfHdr->getNewFrameFileIndexSectionSubheader(sourceADotTocFile);
+   if ( !frameFileSubHeader.valid() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+
+      std::string e = MODULE;
+      e += " ERROR:\nCould not pull frame file sub header from source file: ";
+      e += sourceADotTocFile.c_str();
+      throw ossimException(e);
+   }
+
+   // Get the frame file subsection from the source a.toc.
+   ossimRefPtr<ossimRpfFrameFileIndexSubsection> frameFileSubSection =
+      sourceRpfHdr->getNewFileIndexSubsection(sourceADotTocFile);
+   if ( !frameFileSubSection.valid() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+
+      std::string e = MODULE;
+      e += " ERROR:\nCould not pull frame file sub section from source file: ";
+      e += sourceADotTocFile.c_str();
+      throw ossimException(e); 
+   }
+   
+   // Open the output file to write to.
+   const ossimFilename A_DOT_TOC_FILE = "a.toc";
+   ossimFilename dotTocFile = outputDir.dirCat(A_DOT_TOC_FILE);
+   std::ofstream* dotTocStr = new std::ofstream;
+   dotTocStr->open( dotTocFile.c_str(), ios::out|ios::binary );
+   if ( !dotTocStr->good() )
+   {
+      delete dotRpfStr;
+      dotRpfStr = 0;
+      delete dotTocStr;
+      dotTocStr =0;
+
+      std::string e = MODULE;
+      e += " ERROR:\nCould not open: ";
+      e += dotTocFile.c_str();
+      throw ossimException(e);
+   }
+   
+   // Variables used throughout:
+   ossimRefPtr<ossimProperty> prop = new ossimStringProperty();
+   ossimString field;
+   ossimString s;
+   // std::streampos fileHeaderLength = 0;
+   // std::streampos fileLength = 0;
+      
+   ossimRefPtr<ossimNitfFileHeaderV2_0> fileHdr = new ossimNitfFileHeaderV2_0();
+   
+   // Set the CLEVEL:
+   s = "01";
+   fileHdr->setComplexityLevel(s);
+   
+   // Set the OSTAID:
+   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::OSTAID_KW);
+   fileHdr->setProperty(prop);
+   
+   // Set the FDT (date):
+   fileHdr->setDate();
+   
+   // Set the FTITLE:
+   s = "a.toc";
+   fileHdr->setTitle(s);
+   
+   // Set the FSCLAS:
+   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::FSCLAS_KW);
+   fileHdr->setProperty(prop);
+   
+   // Set the FSCODE:
+   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::FSCODE_KW);
+   fileHdr->setProperty(prop);
+   
+   // Set the FSCTLH:
+   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::FSCTLH_KW);
+   fileHdr->setProperty(prop);
+   
+   // Set the ONAME:
+   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::ONAME_KW);
+   fileHdr->setProperty(prop);
+   
+   // Set the OPHONE:
+   prop = sourceNitfFileHdr->getProperty(ossimNitfFileHeaderV2_X::OPHONE_KW);
+   fileHdr->setProperty(prop);
+   
+   // Add the rpf header.
+   ossimRpfHeader* rpfHdr = new ossimRpfHeader( *(sourceRpfHdr.get()) );
+   
+   ossimRefPtr<ossimNitfRegisteredTag> rpfHdrRp = rpfHdr;
+   ossimNitfTagInformation rpfHdrInfo(rpfHdrRp);
+   fileHdr->addTag(rpfHdrInfo);
+   
+   //---
+   // Write it out...
+   // The first write will be with an rpfheader with no location sections just
+   // to see where the end of the file header is.
+   //---
+   fileHdr->writeStream(*dotTocStr);
+   
+   //---
+   // End of file header. Get the header length. This will also be the
+   // start of the location section.
+   //---
+   std::streampos pos = dotTocStr->tellp();
+   std::streamoff locationSectionOffset = pos;
+   
+   // Set the header length:
+   fileHdr->setHeaderLength( static_cast<ossim_uint64>(locationSectionOffset) );
+   
+   // Set the location of the location section.
+   rpfHdr->setLocationSectionPos(locationSectionOffset);
+
+   // Set the file name.
+   rpfHdr->setFilename(A_DOT_TOC_FILE);
+   
+   // Add the component location records to the header.
+   ossimRpfLocationSection* locSec = rpfHdr->getLocationSection();
+   
+   // Clear the records copied from the source a.toc.
+   locSec->clearFields();
+   
+   //---
+   // Set the length of the locSec to 74.  The record itself is 14 bytes plus
+   // an additional 60 bytes for six location records ten bytes each.
+   //---
+   const ossim_uint16 LOCATION_SECTION_SIZE = 74;
+   locSec->setLocationSectionLength(LOCATION_SECTION_SIZE);
+   
+   // Set the offset which 14 bytes to get to the first record.
+   locSec->setLocationTableOffset(14);
+   
+   // Six records:
+   locSec->setNumberOfComponentLocationRecords(6);
+   
+   // Each record 10 bytes:
+   locSec->setLocationRecordLength(10);
+   
+   // Don't know the aggregate length yet.
+   
+   ossimRpfComponentLocationRecord locRec;
+   
+   // Note: See ossimRpfConstants for enum ossimRpfComponentId
+   
+   const ossim_uint32 RPFHDR_SIZE = 48;
+   const ossim_uint32 LOCATION_SECTION_OFFSET = static_cast<ossim_uint32>(locationSectionOffset);
+   const ossim_uint32 BOUNDARY_SUBHEADER_SIZE = 8;
+   const ossim_uint32 BOUNDARY_RECORD_SIZE = 132;
+   const ossim_uint32 FILE_SUBHEADER_SIZE = 13;
+   // const ossim_uint32 = ;
+   
+   // Record 1 RPFHDR location:
+   ossim_uint32 rpfHdrOffset = 0;
+   if ( fileHdr->getTag(rpfHdrInfo, "RPFHDR") )
+   {
+      rpfHdrOffset = rpfHdrInfo.getTagDataOffset();
+   }
+
+   locRec.m_componentId = OSSIM_RPF_HEADER_COMPONENT; // 128
+   locRec.m_componentLength = RPFHDR_SIZE;
+   locRec.m_componentLocation = static_cast<ossim_uint32>(rpfHdrInfo.getTagDataOffset());
+   locSec->addComponentRecord(locRec);
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "rpf hdr offset: " << rpfHdrOffset << "\n";
+      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+   
+   // Record 2 location section:
+   locRec.m_componentId = OSSIM_RPF_LOCATION_COMPONENT; // 129
+   locRec.m_componentLength = LOCATION_SECTION_SIZE;
+   locRec.m_componentLocation = LOCATION_SECTION_OFFSET;
+   locSec->addComponentRecord(locRec);
+
+   if ( traceDebug() )
+   {
+      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+   
+   // Record 3 boundary rect sub header section:
+   locRec.m_componentId = OSSIM_RPF_BOUNDARY_RECT_SECTION_SUBHEADER; // 148
+   locRec.m_componentLength = BOUNDARY_SUBHEADER_SIZE;
+   locRec.m_componentLocation = locRec.m_componentLocation + LOCATION_SECTION_SIZE;
+   locSec->addComponentRecord(locRec);
+
+   if ( traceDebug() )
+   {
+      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+   
+   // Capture the location.
+   std::streamoff boundaryRectPosition = locRec.m_componentLocation;
+   
+   // Record 4 boundary rect table:
+   locRec.m_componentId = OSSIM_RPF_BOUNDARY_RECT_TABLE; // 149
+   locRec.m_componentLength = BOUNDARY_RECORD_SIZE;
+   locRec.m_componentLocation = locRec.m_componentLocation + BOUNDARY_SUBHEADER_SIZE;
+   locSec->addComponentRecord(locRec);
+
+   if ( traceDebug() )
+   {
+      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+   
+   // Record 5 file index sub header:
+   locRec.m_componentId = OSSIM_RPF_FRAME_FILE_INDEX_SECTION_SUBHEADER; // 150
+   locRec.m_componentLength = FILE_SUBHEADER_SIZE;
+   locRec.m_componentLocation = locRec.m_componentLocation + BOUNDARY_RECORD_SIZE;
+   locSec->addComponentRecord(locRec);
+
+   if ( traceDebug() )
+   {
+      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+    
+   // Record 6 file index sub header:
+   locRec.m_componentId = OSSIM_RPF_FRAME_FILE_INDEX_SUBSECTION; // 151
+   locRec.m_componentLength = 0;  // need to calculate.
+   locRec.m_componentLocation = locRec.m_componentLocation + FILE_SUBHEADER_SIZE;
+   locSec->addComponentRecord(locRec);
+
+   if ( traceDebug() )
+   {
+      locRec.print( ossimNotify(ossimNotifyLevel_DEBUG) );
+   }
+   
+   // Seek back and re-write...
+   dotTocStr->seekp(0, ios::beg);
+   fileHdr->writeStream(*dotTocStr);
+   
+   dotTocStr->seekp(boundaryRectPosition, ios::beg);
+
+   // Only writing one entry:
+   boundaryRectSectionSubheader->setNumberOfEntries(1);
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "writing boundaryRectSectionSubheader:\n" << *(boundaryRectSectionSubheader.get())
+         << "\n";
+   }
+
+   //---
+   // Write the boundary rectangle section.  This includes the subheader and subsection.
+   // These coorespond to location records 3 and 4 above.
+   //---
+   boundaryRectSectionSubheader->writeStream(*dotTocStr);
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) 
+         << "Original boundaryRectTable:\n" << *(boundaryRectTable.get()) << "\n";
+   }
+
+   ossim_uint32 entry;
+   if ( getCorespondingEntry( frameFileSubSection.get(), *dotRpfStr, entry ) )
+   {
+      ossimRpfBoundaryRectRecord boundaryRectRecord;
+      if ( boundaryRectTable->getEntry( entry, boundaryRectRecord) )
+      {
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) 
+               << "writing boundaryRectTable:\n" << boundaryRectRecord << "\n";
+         }
+         
+         boundaryRectRecord.writeStream(*dotTocStr);
+      }
+      else
+      {
+         std::string e = MODULE;
+         e += " ERROR:\nCould not get bounding rect record for entry: ";
+         e += ossimString::toString(entry).c_str();
+         throw ossimException(e);
+      }
+   }
+   else
+   {
+      std::string e = MODULE;
+      e += " ERROR:\nCould not deduce entry from frame list!";
+      throw ossimException(e);
+   }
+
+   frameFileSubHeader->setNumberOfIndexRecords( getNumberOfFrames(*dotRpfStr) );
+   frameFileSubHeader->setNumberOfPathnameRecords(1);
+   const ossim_uint16 FRAME_FILE_INDEX_RECORD_LENGTH = 33;
+   frameFileSubHeader->setIndexRecordLength( FRAME_FILE_INDEX_RECORD_LENGTH );
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "writing frameFileSubHeader:\n" << *(frameFileSubHeader.get()) << "\n";
+   }
+   frameFileSubHeader->writeStream( *dotTocStr );
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "writing frameFileSubSection:\n";
+   }
+
+   std::streamoff frameFileIndexSectionStartPos = dotTocStr->tellp();
+   
+   writeFrameFileIndexSection(frameFileSubSection.get(), *dotRpfStr, *dotTocStr);
+   
+   std::streamoff endOfFilePos = dotTocStr->tellp();
+
+   // Update the location section length for the frame file index section.
+   locSec->getLocationRecordList()[5].m_componentLength =
+      static_cast<ossim_uint32>(endOfFilePos - frameFileIndexSectionStartPos);
+
+   // Update the length of all location sections.
+   locSec->setComponentAggregateLength(
+      static_cast<ossim_uint32>(endOfFilePos) - rpfHdr->getLocationSectionLocation() );
+   
+
+   fileHdr->setFileLength(static_cast<ossim_uint64>(endOfFilePos));
+   dotTocStr->seekp(0, ios::beg);
+   fileHdr->writeStream(*dotTocStr);
+
+   ossimNotify(ossimNotifyLevel_DEBUG) << "Wrote file: " << dotTocFile << "\n";
+
+   // Copy the frames to the output directory.
+   copyFrames(*dotRpfStr, outputDir);
+
+   // Cleanup:
+   delete dotRpfStr;
+   dotRpfStr = 0;
+   delete dotTocStr;
+   dotTocStr =0;
+}
+
+std::ostream& ossimRpfToc::print(std::ostream& out,
+                                 const std::string& prefix,
+                                 bool printOverviews) const
+{
+   printHeader( out, prefix );
+
+   //---
+   // Go through the entries...  We're going to skip overviews here.
+   //---
+   for ( ossim_uint32 entryIndex = 0; entryIndex < m_tocEntryList.size(); ++entryIndex )
+   {
+      printTocEntry( out, entryIndex, prefix, printOverviews );
+   }
+
+
+   return out;
+}
+
+std::ostream& ossimRpfToc::printHeader( std::ostream& out,
+                                        const std::string& prefix ) const
+{
+   if( m_rpfHeader.valid() )
+   {
+      m_rpfHeader->print(out, prefix);
+   }
+   return out;
+}
+
+std::ostream& ossimRpfToc::printTocEntry( std::ostream& out,
+                                          ossim_uint32 entryIndex,
+                                          const std::string& prefix,
+                                          bool printOverviews ) const
+{
+   const ossimRpfTocEntry* tocEntry = getTocEntry( entryIndex );
+   if ( tocEntry )
+   {
+      if ( traceDebug() )
+      {
+         tocEntry->print(out, prefix);
+      }
+      
+      const ossimRpfBoundaryRectRecord REC = tocEntry->getBoundaryInformation();
+         
+      ossimString scale = REC.getScale();
+      if ( (scale.contains("OVERVIEW") == false) || printOverviews )
+      {
+         ossimString entryPrefix = prefix;
+         entryPrefix += "image";
+         entryPrefix += ossimString::toString(entryIndex);
+         entryPrefix += ".";
+         REC.print(out, entryPrefix);
+         
+         //---
+         // Get the first frame that exists so we can get to
+         // the attributes.
+         //---
+         ossimRpfFrameEntry frameEntry;
+         getFirstEntry( tocEntry, frameEntry);
+         
+         if (frameEntry.exists())
+         {
+            ossimRpfFrame rpfFrame;
+            if ( rpfFrame.parseFile(frameEntry.getFullPath())
+                 == ossimErrorCodes::OSSIM_OK )
+            {
+               rpfFrame.print(out, entryPrefix);
+            }
+         }
+      }
+   }
+   return out;
+}
+
+ossim_uint32 ossimRpfToc::getNumberOfEntries()const
+{
+   return static_cast<ossim_uint32>(m_tocEntryList.size());
+}
+
+const ossimRpfTocEntry* ossimRpfToc::getTocEntry(ossim_uint32 index)const
+{
+   if(index < m_tocEntryList.size())
+   {
+      return m_tocEntryList[index];
+   }
+   return 0;
+}
+
+ossim_int32 ossimRpfToc::getTocEntryIndex(const ossimRpfTocEntry* entry)
+
+{
+   for(ossim_int32 i = 0; i < (ossim_int32)m_tocEntryList.size(); ++i)
+   {
+      if(m_tocEntryList[i] == entry)
+      {
+         return i;
+      }
+   }
+
+   return -1;
+}
+
+const ossimNitfFileHeader* ossimRpfToc::getNitfFileHeader()const
+{
+   return m_nitfFileHeader.get();
+}
+
+const ossimRpfHeader* ossimRpfToc::getRpfHeader()const
+{
+   return m_rpfHeader.get();
+}
+
+ossim_uint32 ossimRpfToc::getNumberOfFramesHorizontal(ossim_uint32 idx) const
+{
+   ossim_uint32 nFrames = 0;
+   const ossimRpfTocEntry* pEntry = getTocEntry( idx );
+   if ( pEntry != NULL )
+   {
+      nFrames = pEntry->getNumberOfFramesHorizontal();
+   }
+   return nFrames;
+}
+
+ossim_uint32 ossimRpfToc::getNumberOfFramesVertical(ossim_uint32 idx) const
+{
+   ossim_uint32 nFrames = 0;
+   const ossimRpfTocEntry* pEntry = getTocEntry( idx );
+   if ( pEntry != NULL )
+   {
+      nFrames = pEntry->getNumberOfFramesVertical();
+   }
+   return nFrames;
+}
+
+bool ossimRpfToc::getRpfFrameEntry(ossim_uint32 entryIdx, 
+                                   ossim_uint32 row,
+                                   ossim_uint32 col,
+                                   ossimRpfFrameEntry& result)const
+{
+   const ossimRpfTocEntry* pEntry = getTocEntry( entryIdx );
+   if ( pEntry != NULL )
+   {
+      return pEntry->getEntry( row, col, result );
+   }
+   return false;
+}
+
+const ossimString ossimRpfToc::getRelativeFramePath( ossim_uint32 entryIdx,
+                                                     ossim_uint32 row,
+                                                     ossim_uint32 col) const
+{
+   ossimRpfFrameEntry frameEntry;
+   bool bResult = getRpfFrameEntry( entryIdx, row, col, frameEntry );
+   if ( bResult == true )
+   {
+      return frameEntry.getPathToFrameFileFromRoot();
+   }
+   return ossimString("");
+}
+
+void ossimRpfToc::deleteAll()
+{
+   m_rpfHeader = 0;
+
+   deleteTocEntryList();
+}
+
+void ossimRpfToc::clearAll()
+{
+   deleteTocEntryList();
+   m_filename = "";
+}
+
+void ossimRpfToc::deleteTocEntryList()
+{
+   std::vector< ossimRpfTocEntry*>::iterator tocEntry =
+      m_tocEntryList.begin();
+   while(tocEntry != m_tocEntryList.end())
+   {
+      if(*tocEntry)
+      {
+         delete (*tocEntry);
+         *tocEntry = NULL;
+      }
+      ++tocEntry;
+   }
+   m_tocEntryList.clear();
+}
+
+void ossimRpfToc::buildTocEntryList(ossimRpfHeader* rpfHeader)
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimRpfToc::buildTocEntryList: entered.....\n";
+   }
+   std::ifstream in(m_filename.c_str(), std::ios::in | std::ios::binary);
+
+   if(!in)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimRpfToc::buildTocEntryList: invalid input leaving..... " << std::endl;
+      }
+      return;
+   }
+   
+   if(rpfHeader)
+   {
+      if(traceDebug())
+      {
+         rpfHeader->print(ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+      
+      deleteTocEntryList();
+      ossimRpfBoundaryRectSectionSubheader *boundaryRect =
+         rpfHeader->getNewBoundaryRectSectSubheader(in);
+
+      if(boundaryRect)
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG: Got boundary rect\n";
+         }
+         std::streamoff current = in.tellg();
+
+         // they give the offset from the
+         // end of the boundary subheader to the start of the 
+         // entry table.  We have to create an absolute
+         // offset.
+         current += boundaryRect->getTableOffset();
+
+         // take to the start of the table entries
+         in.seekg(current, ios::beg);
+         allocateTocEntryList(boundaryRect->getNumberOfEntries());
+
+         // now we can read the entries
+         if(m_tocEntryList.size() > 0)
+         {
+            for(ossim_uint32 index = 0; index < m_tocEntryList.size(); index++)
+            {
+               m_tocEntryList[index]->parseStream(in, rpfHeader->getByteOrder());
+            }
+         }
+         
+         ossimRpfFrameFileIndexSectionSubheader* frameFileIndexHead = rpfHeader->getNewFrameFileIndexSectionSubheader(in);
+         // get the offset to the table
+         long offsetToIndexSubsection = in.tellg();
+         if(frameFileIndexHead)
+         {
+            ossimRpfFrameFileIndexRecord tempIndexRec;
+            ossimRpfPathnameRecord       tempPathNameRec;
+            
+            ossim_int32 count = frameFileIndexHead->getNumberOfIndexRecords();
+            while(count > 0)
+            {
+               tempIndexRec.parseStream(in, rpfHeader->getByteOrder() );
+
+               // get the path information.  we must seek to a different location
+               // within the file.  So we must remember where we currently are at
+               std::streamoff currentPosition = in.tellg();
+               
+               in.seekg(offsetToIndexSubsection + tempIndexRec.getPathnameRecordOffset(), ios::beg);
+               tempPathNameRec.parseStream(in, rpfHeader->getByteOrder());
+
+               // We have the root directory where all frame files are subfiles of
+//               ossimString rootDirectory(ossimFilename(m_filename.path())+
+               // ossimFilename(ossimFilename::thePathSeparator));
+               ossimFilename rootDirectory;
+               getRootDirectory(rootDirectory);
+
+               // we have the actual path from the root directory to the
+               // frame file.  We must separate the two.  There have been
+               // occurrences where the path in the A.TOC file
+               // is upper case but the path in the directory on the file
+               // system is lower case.  This
+               // will fool the system in thinking the file does not exist
+               // when it actually does.
+               ossimString pathToFrameFile( ossimFilename(tempPathNameRec.getPathname()) +
+                                              tempIndexRec.getFilename());
+
+               ossimRpfFrameEntry entry(rootDirectory,
+                                        pathToFrameFile);
+               m_tocEntryList[tempIndexRec.getBoundaryRecNumber()]->setEntry(entry,
+                                                                              tempIndexRec.getLocationRowNumber(),
+                                                                              tempIndexRec.getLocationColNumber());
+               // now go back to where we were
+               in.seekg(currentPosition, ios::beg);
+               
+               --count;
+            }
+            delete frameFileIndexHead;
+            frameFileIndexHead = 0;
+         }
+      }
+      delete boundaryRect;
+      boundaryRect = NULL;
+   }
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimRpfToc::buildTocEntryList: leaving....." << std::endl;
+   }
+}
+
+void ossimRpfToc::allocateTocEntryList(ossim_uint32 numberOfEntries)
+{
+   if(m_tocEntryList.size() > 0)
+   {
+      deleteTocEntryList();
+   }
+   for(ossim_uint32 index = 0; index < numberOfEntries; index++)
+   {
+      m_tocEntryList.push_back(new ossimRpfTocEntry);
+   }   
+}
+
+void ossimRpfToc::getRootDirectory(ossimFilename& dir) const
+{
+   dir = m_filename.expand().path();
+}
+
+void ossimRpfToc::getFirstEntry(const ossimRpfTocEntry* rpfTocEntry,
+                                ossimRpfFrameEntry& frameEntry) const
+{
+   if (rpfTocEntry)
+   {
+      ossim_int32 framesHorizontal =
+         rpfTocEntry->getNumberOfFramesHorizontal();
+      ossim_int32 framesVertical =
+         rpfTocEntry->getNumberOfFramesVertical();
+   
+      bool foundEntry = false;
+      for (ossim_int32 v = 0; v < framesVertical; ++v)
+      {
+         for (ossim_int32 h = 0; h < framesHorizontal; ++h)
+         {
+            rpfTocEntry->getEntry(v, h, frameEntry);
+            if (frameEntry.exists())
+            {
+               foundEntry = true;
+               break;
+            }
+         }
+         if (foundEntry)
+         {
+            break;
+         }
+      }
+   }
+}
+
+void ossimRpfToc::writeFrameFileIndexSection(ossimRpfFrameFileIndexSubsection* frameFileSubSection,
+                                             std::ifstream& dotRpfStr,
+                                             std::ofstream& dotTocStr)
+{
+   static const char MODULE[] = "ossimRpfToc::writeFrameFileIndexSection";
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   const ossim_uint16 FRAME_FILE_INDEX_RECORD_LENGTH = 33;
+   ossim_uint32 frames = getNumberOfFrames(dotRpfStr);
+   ossim_uint32 pathnameRecordOffset = FRAME_FILE_INDEX_RECORD_LENGTH * frames;
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "frames: " << frames << "\n";
+   }
+   
+   if ( !dotRpfStr.good() )
+   {
+      // see if we can clear it.  Someone might have hit end of file(eof).
+      dotRpfStr.clear();
+   }
+
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   std::string line;
+   ossimFilename file;
+   ossimRpfFrameFileIndexRecord record;
+   ossim_uint32 framesWritten = 0;
+
+   // Eat the first line which is the bounding rect line
+   std::getline(dotRpfStr, line);
+
+   while( dotRpfStr.good() )
+   {
+      std::getline(dotRpfStr, line);
+
+      if ( dotRpfStr.good() )
+      {
+         if ( getFile(line, file) )
+         {
+            if ( frameFileSubSection->getFrameFileIndexRecordFromFile(file.file(), record) )
+            {
+               // Always single entry.
+               record.setBoundaryRecNumber(0);
+               
+               record.setPathnameRecordOffset(pathnameRecordOffset);
+               record.writeStream(dotTocStr);
+               ++framesWritten;
+
+               if ( traceDebug() )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG) << "wrote record:\n" << record << "\n";
+               }
+            }
+         }
+      }
+   }
+
+   // Now set the path record.
+   ossimFilename d = file.path();
+   ossimString s = "./";
+   s += d.file();
+   s += "/";
+   ossimRpfPathnameRecord pathRecord;
+   pathRecord.setPathName(s);
+   pathRecord.writeStream(dotTocStr);
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "frames written: " << framesWritten
+         << "\nwrote record:\n" << pathRecord
+         << "\n";
+   }
+
+   dotRpfStr.clear();
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
+   }
+}
+
+void ossimRpfToc::copyFrames(std::ifstream& dotRpfStr, const ossimFilename& outputDir)
+{
+   static const char MODULE[] = "ossimRpfToc::copyFrames";
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossim_uint32 frames = getNumberOfFrames(dotRpfStr);
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "frames to copy: " << frames << "\n";
+   }
+   
+   if ( !dotRpfStr.good() )
+   {
+      // see if we can clear it.  Someone might have hit end of file(eof).
+      dotRpfStr.clear();
+   }
+
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   std::string line;
+   ossimFilename file;
+   ossimFilename destinationFile;
+   ossimFilename subDir;
+   ossim_uint32 framesCopied = 0;
+            
+   // Eat the first line which is the bounding rect line
+   std::getline(dotRpfStr, line);
+
+   // Get the second line which is first file. 
+   std::getline(dotRpfStr, line);
+
+   // Get the file name and make the sub directory if needed.
+   if ( getFile(line, file) )
+   {
+      destinationFile = outputDir;
+      subDir = file.path();
+      subDir = subDir.file();
+      destinationFile = destinationFile.dirCat( subDir );
+      
+      // This is output_dir/subdir.  See if subdir exist:
+      if ( !destinationFile.exists() )
+      {
+         destinationFile.createDirectory();
+      }
+   }
+
+   // Start over:
+   if ( !dotRpfStr.good() )
+   {
+      // see if we can clear it.  Someone might have hit end of file(eof).
+      dotRpfStr.clear();
+   }
+   dotRpfStr.seekg(0, ios_base::beg);
+   
+   // Eat the first line which is the bounding rect line
+   std::getline(dotRpfStr, line);
+   
+   while( dotRpfStr.good() )
+   {
+      std::getline(dotRpfStr, line);
+
+      if ( dotRpfStr.good() )
+      {
+         if ( getFile(line, file) )
+         {
+            destinationFile = outputDir;
+            subDir = file.path();
+            subDir = subDir.file();
+            destinationFile = destinationFile.dirCat( subDir );
+            destinationFile = destinationFile.dirCat( file.file() );
+
+            if ( file.copyFileTo(destinationFile) )
+            {
+               ++framesCopied;
+            }
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG) << "Copied frame: " << destinationFile << "\n";
+            }
+         }
+      }
+   }
+
+   ossimNotify(ossimNotifyLevel_NOTICE) << "Frames copied: " << framesCopied << std::endl;
+
+   dotRpfStr.clear();
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
+   }
+}
+
+ossim_uint32 ossimRpfToc::getNumberOfFrames(std::ifstream& dotRpfStr) const
+{
+   ossim_uint32 result = 0;
+
+   if ( !dotRpfStr.good() )
+   {
+      // see if we can clear it.  Someone might have hit end of file(eof).
+      dotRpfStr.clear();
+   }
+
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   // Eat the first line which is the bounding rect.
+   std::string line;
+   std::getline(dotRpfStr, line);
+   
+   while( dotRpfStr.good() )
+   {
+      std::getline(dotRpfStr, line);
+
+      if ( dotRpfStr.good() )
+      {
+         ++result;
+      }
+   }
+
+   dotRpfStr.clear();
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   return result;
+}
+
+ossimFilename ossimRpfToc::getSourceTocFile(std::ifstream& dotRpfStr) const
+{
+   ossimFilename tocFile;
+   
+   if ( !dotRpfStr.good() )
+   {
+      dotRpfStr.clear();
+   }
+
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   // Eat the first line which is the bounding rect.
+   std::string line;
+   std::getline(dotRpfStr, line);
+
+   // Get the second line which is first file. 
+   std::getline(dotRpfStr, line);
+
+   // Get the file name and make the sub directory if needed.
+   ossimFilename file;
+   if ( getFile(line, file) )
+   {
+      ossimFilename subDir = file.path();
+      tocFile = subDir.dirCat("a.toc");
+      if ( !tocFile.exists() )
+      {
+         tocFile = subDir.dirCat("A.TOC");
+         if ( !tocFile.exists() )
+         {
+            subDir = subDir.path();
+            tocFile = subDir.dirCat("a.toc");
+            if ( !tocFile.exists() )
+            {
+               tocFile = subDir.dirCat("A.TOC");
+               if ( !tocFile.exists() )
+               {
+                  tocFile.clear();
+               }
+            }
+         }
+      }
+   }
+
+   if ( !dotRpfStr.good() )
+   {
+      dotRpfStr.clear();
+   }
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimRpfToc::getSourceTocFile result: " << tocFile << "\n";
+   }
+
+   return tocFile;
+}
+
+bool ossimRpfToc::getCorespondingEntry(
+   ossimRpfFrameFileIndexSubsection* frameFileSubSection,
+   std::ifstream& dotRpfStr, ossim_uint32& entry) const
+{
+   bool result = false;
+   
+   if ( !dotRpfStr.good() )
+   {
+      // see if we can clear it.  Someone might have hit end of file(eof).
+      dotRpfStr.clear();
+   }
+   
+   dotRpfStr.seekg(0, ios_base::beg);
+
+   std::string line;
+   ossimFilename file;
+   ossimRpfFrameFileIndexRecord record;
+
+   // Eat the first line which is the bounding rect line
+   std::getline(dotRpfStr, line);
+
+   std::getline(dotRpfStr, line);
+
+   if ( getFile(line, file) )
+   {
+      if ( frameFileSubSection->getFrameFileIndexRecordFromFile(file.file(), record) )
+      {
+         entry = record.getBoundaryRecNumber();
+         result = true;
+      }
+   }
+
+   if ( !dotRpfStr.good() )
+   {
+      dotRpfStr.clear();
+   }
+
+   dotRpfStr.seekg(0, ios_base::beg);
+   return result;
+}
+
+bool ossimRpfToc::getFile(const std::string& line, ossimFilename& file) const
+{
+   //---
+   // line form:
+   // /some_path/N03E030/006EZC1B.I21|30.4654240835311,3.59074642049858|30.5401678385356,3.65984532949882
+   //           <file>                    <lr_lon>           <lr_lat>        <ur_lon>          <ur_lat>
+   //---
+   
+   bool result = false;
+   if ( line.size() )
+   {
+      ossimString os(line);
+      std::vector<ossimString> lineArray;
+      os.split(lineArray, "|");
+      if ( lineArray.size() )
+      {
+         file = lineArray[0];
+         result = true;
+      }
+   }
+   return result;
+}
diff --git a/src/support_data/ossimRpfTocEntry.cpp b/src/support_data/ossimRpfTocEntry.cpp
new file mode 100644
index 0000000..1bd712e
--- /dev/null
+++ b/src/support_data/ossimRpfTocEntry.cpp
@@ -0,0 +1,279 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+// 
+// Author: Garrett Potts
+//
+//*************************************************************************
+// $Id: ossimRpfTocEntry.cpp 19900 2011-08-04 14:19:57Z dburken $
+
+#include <istream>
+#include <ostream>
+#include <iterator>
+
+#include <ossim/support_data/ossimRpfTocEntry.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimAzimEquDistProjection.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/support_data/ossimRpfFrameEntry.h>
+
+std::ostream& operator <<(std::ostream& out,
+                          const ossimRpfTocEntry& data)
+{
+   data.print(out);
+   return out;
+}
+
+ossimRpfTocEntry::ossimRpfTocEntry()
+{
+   
+}
+
+ossimErrorCode ossimRpfTocEntry::parseStream(
+   std::istream &in, ossimByteOrder byteOrder)
+{
+   ossimErrorCode result = ossimErrorCodes::OSSIM_OK;
+   
+   result = theBoundaryInformation.parseStream(in, byteOrder);
+   if(result == ossimErrorCodes::OSSIM_OK)
+   {
+      allocateFrameEntryArray();
+   }
+
+   // Fetch the number of samples as data member since it may need to be adjusted due to 
+   // wrap (OLK 10/10):
+   theNumSamples =  theBoundaryInformation.getNumberOfFramesHorizontal() * 1536;
+   ossimDpt ddpp;
+   getDecimalDegreesPerPixel(ddpp);
+   ossim_float64 width_in_deg = theNumSamples*ddpp.x;
+   if (width_in_deg >= 360.0)
+      theNumSamples -= (width_in_deg - 360.0)/ddpp.x;
+
+   return result;
+}
+
+std::ostream& ossimRpfTocEntry::print(std::ostream& out,
+                                      const std::string& prefix) const
+{
+   theBoundaryInformation.print(out, prefix);
+
+   std::vector< std::vector<ossimRpfFrameEntry> >::const_iterator frameEntry =
+      theFrameEntryArray.begin();
+
+   while( frameEntry != theFrameEntryArray.end() )
+   {
+      std::vector<ossimRpfFrameEntry>::const_iterator i =
+         (*frameEntry).begin();
+      while ( i != (*frameEntry).end() ) 
+      {
+         (*i).print(out, prefix);
+         ++i;
+      }
+      ++frameEntry;
+   }
+   return out;
+}
+
+ossim_uint32 ossimRpfTocEntry::getNumberOfFramesHorizontal()const
+{
+   return theBoundaryInformation.getNumberOfFramesHorizontal();
+}
+
+ossim_uint32 ossimRpfTocEntry::getNumberOfFramesVertical()const
+{
+   return theBoundaryInformation.getNumberOfFramesVertical();
+}
+
+ossim_uint32 ossimRpfTocEntry::getNumberOfLines() const
+{
+   return  theBoundaryInformation.getNumberOfFramesVertical() * 1536;
+}
+
+ossim_uint32 ossimRpfTocEntry::getNumberOfSamples() const
+{
+   return theNumSamples;
+}
+
+ossim_uint32 ossimRpfTocEntry::getNumberOfBands() const
+{
+   ossim_uint32 result = 0;
+   ossimString productType = getProductType().trim().upcase();
+   if( productType == "CIB" )
+   {
+      result = 1;
+   }
+   else if ( productType == "CADRG" )
+   {
+      result = 3;
+   }
+   return result;
+}
+
+void ossimRpfTocEntry::getBoundingRect(ossimIrect& rect) const
+{
+   rect = ossimIrect(0, 0, getNumberOfSamples()-1, getNumberOfLines()-1); 
+}
+
+const ossimRpfBoundaryRectRecord& ossimRpfTocEntry::getBoundaryInformation() const
+{
+   return theBoundaryInformation;
+}
+
+void ossimRpfTocEntry::setEntry(const ossimRpfFrameEntry& entry,
+                                long row,
+                                long col)
+{
+   if(row < (long)theFrameEntryArray.size() && row >= 0)
+   {
+      if(col < (long)theFrameEntryArray[row].size() && col >= 0)
+      {
+         theFrameEntryArray[row][col] = entry;
+      }
+   }
+}
+
+bool ossimRpfTocEntry::getEntry(long row,
+                                long col,
+                                ossimRpfFrameEntry& result)const
+{
+   if(row < (long)theFrameEntryArray.size() && row >= 0)
+   {
+      if(col < (long)theFrameEntryArray[row].size() && col >= 0)
+      {
+         result = theFrameEntryArray[row][col];
+      }
+      else
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+   
+   return true;
+}
+
+ossimString ossimRpfTocEntry::getProductType() const
+{
+   return theBoundaryInformation.getProductType();
+}
+
+/*!
+ * If there is an entry and all the files don't exist we will return
+ * true.
+ */
+bool ossimRpfTocEntry::isEmpty()const
+{
+   long rows = (long)theFrameEntryArray.size();
+   long cols = 0;
+   if(rows > 0)
+   {
+      cols = (long)theFrameEntryArray[0].size();
+      for(long rowIndex = 0; rowIndex < rows; ++ rowIndex)
+      {
+         for(long colIndex = 0; colIndex < cols; ++colIndex)
+         {
+            if(theFrameEntryArray[rowIndex][colIndex].exists())
+            {
+               return false;
+            }
+         }
+      }
+   }
+
+   return true;
+}
+
+ossimRefPtr<ossimImageGeometry> ossimRpfTocEntry::getImageGeometry() const
+{
+
+   ossimGpt ul(theBoundaryInformation.getCoverage().getUlLat(), 
+               theBoundaryInformation.getCoverage().getUlLon());
+
+   // Decimal degrees per pixel:
+   ossimDpt ddpp;
+   getDecimalDegreesPerPixel(ddpp);
+   
+   // Tie point - Shifted to pixel-is-point:
+   ossimGpt tie( (ul.latd() - (ddpp.y/2.0)), (ul.lond() + (ddpp.x/2.0)), 0.0 );
+   
+   // Origin - Use the center latitude for horizontal scale, and the left edge as origin longitude
+   // (OLK 10/10)
+   ossimGpt origin ((ul.lat + theBoundaryInformation.getCoverage().getLlLat())/2.0, tie.lon);
+
+#if 0 /* Please leave for debug. (drb) */
+   std::cout << "boundaryInfo:\n" << boundaryInfo << std::endl;
+#endif
+
+   int z = theBoundaryInformation.getZone();
+   
+   if (z == 74) z--; // Fix J to a zone.
+   if (z > 64) z -= 64; // Below the equator
+   else z -= 48; // Above the equator
+
+   ossimRefPtr<ossimMapProjection> mapProj = 0;
+   if ( z != 9 )
+   {
+      mapProj = new ossimEquDistCylProjection;
+   }
+   else
+   {
+      mapProj = new ossimAzimEquDistProjection;
+   }
+
+   // Set the origin:
+   mapProj->setOrigin(origin);
+   
+   // Set the scale:
+   mapProj->setDecimalDegreesPerPixel(ddpp);
+
+   // Set the tie:
+   mapProj->setUlTiePoints(tie);
+
+   // Give projection to the geometry object.
+   ossimRefPtr<ossimImageGeometry> geom =  new ossimImageGeometry;
+   geom->setProjection( mapProj.get() );
+
+   return geom;
+}
+
+void ossimRpfTocEntry::getDecimalDegreesPerPixel(ossimDpt& scale) const
+{
+#if 1
+   scale.x = theBoundaryInformation.getCoverage().getHorizontalInterval();
+   scale.y = theBoundaryInformation.getCoverage().getVerticalInterval();
+#else
+   ossim_float64 ulLat = theBoundaryInformation.getCoverage().getUlLat();
+   ossim_float64 ulLon = theBoundaryInformation.getCoverage().getUlLon();
+   ossim_float64 urLon = theBoundaryInformation.getCoverage().getUrLon();
+   ossim_float64 llLat = theBoundaryInformation.getCoverage().getLrLat();
+   ossim_float64 lines = getNumberOfLines();
+   ossim_float64 samps = getNumberOfSamples();
+   scale.x = (urLon - ulLon) / samps;
+   scale.y = (ulLat - llLat) / lines;
+#endif
+}
+
+void ossimRpfTocEntry::getMetersPerPixel(ossimDpt& scale) const
+{
+   scale.x = theBoundaryInformation.getCoverage().getVerticalResolution();
+   scale.y = theBoundaryInformation.getCoverage().getHorizontalResolution();
+}
+
+void ossimRpfTocEntry::allocateFrameEntryArray()
+{
+   theFrameEntryArray.resize(theBoundaryInformation.getNumberOfFramesVertical());
+   ossim_uint32 horizontalSize = theBoundaryInformation.getNumberOfFramesHorizontal();
+
+   for(ossim_uint32 index = 0; index < theFrameEntryArray.size(); index++)
+   {
+      theFrameEntryArray[index].resize(horizontalSize);
+   }
+}
diff --git a/src/support_data/ossimRsmida.cpp b/src/support_data/ossimRsmida.cpp
new file mode 100644
index 0000000..ff14854
--- /dev/null
+++ b/src/support_data/ossimRsmida.cpp
@@ -0,0 +1,1662 @@
+//---
+// File: ossimRsmida.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//---
+
+#include <ossim/support_data/ossimRsmida.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimNitfRsmidaTag.h>
+
+static const ossimTrace traceDebug("ossimRsmida:debug");
+
+static std::string IID_KW     = "iid";
+static std::string EDITION_KW = "edition";
+
+static std::string ISID_KW = "isid";
+static std::string SID_KW  = "sid";
+static std::string STID_KW = "stid";
+
+static std::string YEAR_KW   = "year";
+static std::string MONTH_KW  = "month";
+static std::string DAY_KW    = "day";
+static std::string HOUR_KW   = "hour";
+static std::string MINUTE_KW = "minute";
+static std::string SECOND_KW = "second";
+
+static std::string NRG_KW = "nrg";
+static std::string NCG_KW = "ncg";
+
+static std::string TRG_KW = "trg";
+static std::string TCG_KW = "tcg";
+
+static std::string GRNDD_KW = "grndd";
+
+static std::string XUOR_KW = "xuor";
+static std::string YUOR_KW = "yuor";
+static std::string ZUOR_KW = "zuor";
+
+static std::string XUXR_KW = "xuxr";
+static std::string XUYR_KW = "xuyr";
+static std::string XUZR_KW = "xuzr";
+
+static std::string YUXR_KW = "yuxr";
+static std::string YUYR_KW = "yuyr";
+static std::string YUZR_KW = "yuzr";
+
+static std::string ZUXR_KW = "zuxr";
+static std::string ZUYR_KW = "zuyr";
+static std::string ZUZR_KW = "zuzr";
+
+static std::string V1X_KW = "v1x";
+static std::string V1Y_KW = "v1y";
+static std::string V1Z_KW = "v1z";
+
+static std::string V2X_KW = "v2x";
+static std::string V2Y_KW = "v2y";
+static std::string V2Z_KW = "v2z";
+
+static std::string V3X_KW = "v3x";
+static std::string V3Y_KW = "v3y";
+static std::string V3Z_KW = "v3z";
+
+static std::string V4X_KW = "v4x";
+static std::string V4Y_KW = "v4y";
+static std::string V4Z_KW = "v4z";
+
+static std::string V5X_KW = "v5x";
+static std::string V5Y_KW = "v5y";
+static std::string V5Z_KW = "v5z";
+
+static std::string V6X_KW = "v6x";
+static std::string V6Y_KW = "v6y";
+static std::string V6Z_KW = "v6z";
+
+static std::string V7X_KW = "v7x";
+static std::string V7Y_KW = "v7y";
+static std::string V7Z_KW = "v7z";
+
+static std::string V8X_KW = "v8x";
+static std::string V8Y_KW = "v8y";
+static std::string V8Z_KW = "v8z";
+
+static std::string GRPX_KW = "grpx";
+static std::string GRPY_KW = "grpy";
+static std::string GRPZ_KW = "grpz";
+
+static std::string FULLR_KW = "fullr";
+static std::string FULLC_KW = "fullc";
+
+static std::string MINR_KW = "minr";
+static std::string MAXR_KW = "maxr";
+static std::string MINC_KW = "minc";
+static std::string MAXC_KW = "maxc";
+
+static std::string IE0_KW = "ie0";
+static std::string IER_KW = "ier";
+static std::string IEC_KW = "iec";
+static std::string IERR_KW = "ierr";
+static std::string IERC_KW = "ierc";
+static std::string IECC_KW = "iecc";
+
+static std::string IA0_KW = "ia0";
+static std::string IAR_KW = "iar";
+static std::string IAC_KW = "iac";
+static std::string IARR_KW = "iarr";
+static std::string IARC_KW = "iarc";
+static std::string IACC_KW = "iacc";
+
+static std::string SPX_KW = "spx";
+static std::string SVX_KW = "svx";
+static std::string SAX_KW = "sax";
+
+static std::string SPY_KW = "spy";
+static std::string SVY_KW = "svy";
+static std::string SAY_KW = "say";
+
+static std::string SPZ_KW = "spz";
+static std::string SVZ_KW = "svz";
+static std::string SAZ_KW = "saz";
+
+ossimRsmida::ossimRsmida()
+   :
+   m_iid(),
+   m_edition(),
+
+   m_isid(),
+   m_sid(),
+   m_stid(),
+   
+   m_year(0),
+   m_month(0),
+   m_day(0),
+   m_hour(0),
+   m_minute(0),
+   m_second(0.0),
+
+   m_nrg(0),
+   m_ncg(0),
+   
+   m_trg(0.0),
+   m_tcg(0.0),
+   
+   m_grndd('\0'),
+
+   m_xuor(0.0),
+   m_yuor(0.0),
+   m_zuor(0.0),
+   
+   m_xuxr(0.0),
+   m_xuyr(0.0),
+   m_xuzr(0.0),
+   
+   m_yuxr(0.0),
+   m_yuyr(0.0),
+   m_yuzr(0.0),
+   
+   m_zuxr(0.0),
+   m_zuyr(0.0),
+   m_zuzr(0.0),
+   
+   m_v1x(0.0),
+   m_v1y(0.0),
+   m_v1z(0.0),
+   
+   m_v2x(0.0),
+   m_v2y(0.0),
+   m_v2z(0.0),
+   
+   m_v3x(0.0),
+   m_v3y(0.0),
+   m_v3z(0.0),
+   
+   m_v4x(0.0),
+   m_v4y(0.0),
+   m_v4z(0.0),
+   
+   m_v5x(0.0),
+   m_v5y(0.0),
+   m_v5z(0.0),
+   
+   m_v6x(0.0),
+   m_v6y(0.0),
+   m_v6z(0.0),
+   
+   m_v7x(0.0),
+   m_v7y(0.0),
+   m_v7z(0.0),
+   
+   m_v8x(0.0),
+   m_v8y(0.0),
+   m_v8z(0.0),
+   
+   m_grpx(0.0),
+   m_grpy(0.0),
+   m_grpz(0.0),
+   
+   m_fullr(0),
+   m_fullc(0),
+   
+   m_minr(0),
+   m_maxr(0),
+   m_minc(0),
+   m_maxc(0),
+   
+   m_ie0(0.0),
+   m_ier(0.0),
+   m_iec(0.0),
+   m_ierr(0.0),
+   m_ierc(0.0),
+   m_iecc(0.0),
+   
+   m_ia0(0.0),
+   m_iar(0.0),
+   m_iac(0.0),
+   m_iarr(0.0),
+   m_iarc(0.0),
+   m_iacc(0.0),
+   
+   m_spx(0.0),
+   m_svx(0.0),
+   m_sax(0.0),
+   
+   m_spy(0.0),
+   m_svy(0.0),
+   m_say(0.0),
+   
+   m_spz(0.0),
+   m_svz(0.0),
+   m_saz(0.0)
+{
+}
+
+ossimRsmida::ossimRsmida( const ossimRsmida& obj )
+   :
+   m_iid( obj.m_iid ),
+   m_edition( obj.m_edition ),
+
+   m_isid( obj.m_isid ),
+   m_sid( obj.m_sid ),
+   m_stid( obj.m_stid ),
+   
+   m_year( obj.m_year ),
+   m_month( obj.m_month ),
+   m_day( obj.m_day ),
+   m_hour( obj.m_hour ),
+   m_minute( obj.m_minute ),
+   m_second( obj.m_second ),
+
+   m_nrg( obj.m_nrg ),
+   m_ncg( obj.m_ncg ),
+   
+   m_trg( obj.m_trg ),
+   m_tcg( obj.m_tcg ),
+   
+   m_grndd( obj.m_grndd ),
+
+   m_xuor( obj.m_xuor ),
+   m_yuor( obj.m_yuor ),
+   m_zuor( obj.m_zuor ),
+   
+   m_xuxr( obj.m_xuxr ),
+   m_xuyr( obj.m_xuyr ),
+   m_xuzr( obj.m_xuzr ),
+   
+   m_yuxr( obj.m_yuxr ),
+   m_yuyr( obj.m_yuyr ),
+   m_yuzr( obj.m_yuzr ),
+   
+   m_zuxr( obj.m_zuxr ),
+   m_zuyr( obj.m_zuyr ),
+   m_zuzr( obj.m_zuzr ),
+   
+   m_v1x( obj.m_v1x ),
+   m_v1y( obj.m_v1y ),
+   m_v1z( obj.m_v1z ),
+   
+   m_v2x( obj.m_v2x ),
+   m_v2y( obj.m_v2y ),
+   m_v2z( obj.m_v2z ),
+   
+   m_v3x( obj.m_v3x ),
+   m_v3y( obj.m_v3y ),
+   m_v3z( obj.m_v3z ),
+   
+   m_v4x( obj.m_v4x ),
+   m_v4y( obj.m_v4y ),
+   m_v4z( obj.m_v4z ),
+   
+   m_v5x( obj.m_v5x ),
+   m_v5y( obj.m_v5y ),
+   m_v5z( obj.m_v5z ),
+   
+   m_v6x( obj.m_v6x ),
+   m_v6y( obj.m_v6y ),
+   m_v6z( obj.m_v6z ),
+   
+   m_v7x( obj.m_v7x ),
+   m_v7y( obj.m_v7y ),
+   m_v7z( obj.m_v7z ),
+   
+   m_v8x( obj.m_v8x ),
+   m_v8y( obj.m_v8y ),
+   m_v8z( obj.m_v8z ),
+   
+   m_grpx( obj.m_grpx ),
+   m_grpy( obj.m_grpy ),
+   m_grpz( obj.m_grpz ),
+   
+   m_fullr( obj.m_fullr ),
+   m_fullc( obj.m_fullc ),
+   
+   m_minr( obj.m_minr ),
+   m_maxr( obj.m_maxr ),
+   m_minc( obj.m_minc ),
+   m_maxc( obj.m_maxc ),
+   
+   m_ie0( obj.m_ie0 ),
+   m_ier( obj.m_ier ),
+   m_iec( obj.m_iec ),
+
+   m_ierr( obj.m_ierr ),
+   m_ierc( obj.m_ierc ),
+   m_iecc( obj.m_iecc ),
+   
+   m_ia0( obj.m_ia0 ),
+   m_iar( obj.m_iar ),
+   m_iac( obj.m_iac ),
+
+   m_iarr( obj.m_iarr ),
+   m_iarc( obj.m_iarc ),
+   m_iacc( obj.m_iacc ),
+   
+   m_spx( obj.m_spx ),
+   m_svx( obj.m_svx ),
+   m_sax( obj.m_sax ),
+   
+   m_spy( obj.m_spy ),
+   m_svy( obj.m_svy ),
+   m_say( obj.m_say ),
+   
+   m_spz( obj.m_spz ),
+   m_svz( obj.m_svz ),
+   m_saz( obj.m_saz )
+{
+}
+
+const ossimRsmida& ossimRsmida::operator=( const ossimRsmida& rhs )
+{
+   if (this != &rhs)
+   {
+      m_iid = rhs.m_iid;
+      m_edition = rhs.m_edition;
+      
+      m_isid = rhs.m_isid;
+      m_sid  = rhs.m_sid;
+      m_stid = rhs.m_stid;
+      
+      m_year   = rhs.m_year;
+      m_month  = rhs.m_month;
+      m_day    = rhs.m_day;
+      m_hour   = rhs.m_hour;
+      m_minute = rhs.m_minute;
+      m_second = rhs.m_second;
+      
+      m_nrg = rhs.m_nrg;
+      m_ncg = rhs.m_ncg;
+      
+      m_trg = rhs.m_trg;
+      m_tcg = rhs.m_tcg;
+      
+      m_grndd = rhs.m_grndd;
+      
+      m_xuor = rhs.m_xuor;
+      m_yuor = rhs.m_yuor;
+      m_zuor = rhs.m_zuor;
+      
+      m_xuxr = rhs.m_xuxr;
+      m_xuyr = rhs.m_xuyr;
+      m_xuzr = rhs.m_xuzr;
+      
+      m_yuxr = rhs.m_yuxr;
+      m_yuyr = rhs.m_yuyr;
+      m_yuzr = rhs.m_yuzr;
+      
+      m_zuxr = rhs.m_zuxr;
+      m_zuyr = rhs.m_zuyr;
+      m_zuzr = rhs.m_zuzr;
+      
+      m_v1x = rhs.m_v1x;
+      m_v1y = rhs.m_v1y;
+      m_v1z = rhs.m_v1z;
+      
+      m_v2x = rhs.m_v2x;
+      m_v2y = rhs.m_v2y;
+      m_v2z = rhs.m_v2z;
+      
+      m_v3x = rhs.m_v3x;
+      m_v3y = rhs.m_v3y;
+      m_v3z = rhs.m_v3z;
+      
+      m_v4x = rhs.m_v4x;
+      m_v4y = rhs.m_v4y;
+      m_v4z = rhs.m_v4z;
+      
+      m_v5x = rhs.m_v5x;
+      m_v5y = rhs.m_v5y;
+      m_v5z = rhs.m_v5z;
+      
+      m_v6x = rhs.m_v6x;
+      m_v6y = rhs.m_v6y;
+      m_v6z = rhs.m_v6z;
+      
+      m_v7x = rhs.m_v7x;
+      m_v7y = rhs.m_v7y;
+      m_v7z = rhs.m_v7z;
+      
+      m_v8x = rhs.m_v8x;
+      m_v8y = rhs.m_v8y;
+      m_v8z = rhs.m_v8z;
+      
+      m_grpx = rhs.m_grpx;
+      m_grpy = rhs.m_grpy;
+      m_grpz = rhs.m_grpz;
+      
+      m_fullr = rhs.m_fullr;
+      m_fullc = rhs.m_fullc;
+      
+      m_minr = rhs.m_minr;
+      m_maxr = rhs.m_maxr;
+      m_minc = rhs.m_minc;
+      m_maxc = rhs.m_maxc;
+      
+      m_ie0 = rhs.m_ie0;
+      m_ier = rhs.m_ier;
+      m_iec = rhs.m_iec;
+      
+      m_ierr = rhs.m_ierr;
+      m_ierc = rhs.m_ierc;
+      m_iecc = rhs.m_iecc;
+      
+      m_ia0 = rhs.m_ia0;
+      m_iar = rhs.m_iar;
+      m_iac = rhs.m_iac;
+      
+      m_iarr = rhs.m_iarr;
+      m_iarc = rhs.m_iarc;
+      m_iacc = rhs.m_iacc;
+      
+      m_spx = rhs.m_spx;
+      m_svx = rhs.m_svx;
+      m_sax = rhs.m_sax;
+      
+      m_spy = rhs.m_spy;
+      m_svy = rhs.m_svy;
+      m_say = rhs.m_say;
+      
+      m_spz = rhs.m_spz;
+      m_svz = rhs.m_svz;
+      m_saz = rhs.m_saz;
+   }
+   return *this;
+}
+
+void ossimRsmida::saveState( ossimKeywordlist& kwl,
+                             const std::string& prefix ) const
+{
+   std::string pfx = prefix + std::string("rsmida.");
+   
+   kwl.add(pfx.c_str(), IID_KW.c_str(), m_iid.c_str());
+   kwl.add(pfx.c_str(), EDITION_KW.c_str(), m_edition.c_str());
+   
+   kwl.add(pfx.c_str(), ISID_KW.c_str(), m_isid.c_str());   
+   kwl.add(pfx.c_str(), SID_KW.c_str(), m_sid.c_str());   
+   kwl.add(pfx.c_str(), STID_KW.c_str(), m_stid.c_str());   
+
+   kwl.add(pfx.c_str(), YEAR_KW.c_str(), m_year);   
+   kwl.add(pfx.c_str(), MONTH_KW.c_str(), m_month);   
+   kwl.add(pfx.c_str(), DAY_KW.c_str(), m_day);   
+   kwl.add(pfx.c_str(), HOUR_KW.c_str(), m_hour);   
+   kwl.add(pfx.c_str(), MINUTE_KW.c_str(), m_minute);
+   kwl.add(pfx.c_str(), SECOND_KW.c_str(), m_second);
+
+   kwl.add(pfx.c_str(), NRG_KW.c_str(), m_nrg);
+   kwl.add(pfx.c_str(), NCG_KW.c_str(), m_ncg);
+
+   kwl.add(pfx.c_str(), TRG_KW.c_str(), m_trg);
+   kwl.add(pfx.c_str(), TCG_KW.c_str(), m_tcg);
+   
+   kwl.add(pfx.c_str(), GRNDD_KW.c_str(), m_grndd);
+
+   kwl.add(pfx.c_str(), XUOR_KW.c_str(), m_xuor);   
+   kwl.add(pfx.c_str(), YUOR_KW.c_str(), m_yuor);
+   kwl.add(pfx.c_str(), ZUOR_KW.c_str(), m_zuor);   
+
+   kwl.add(pfx.c_str(), XUXR_KW.c_str(), m_xuxr);
+   kwl.add(pfx.c_str(), XUYR_KW.c_str(), m_xuyr);
+   kwl.add(pfx.c_str(), XUZR_KW.c_str(), m_xuzr);   
+
+   kwl.add(pfx.c_str(), YUXR_KW.c_str(), m_yuxr); 
+   kwl.add(pfx.c_str(), YUYR_KW.c_str(), m_yuyr);
+   kwl.add(pfx.c_str(), YUZR_KW.c_str(), m_yuzr);   
+
+   kwl.add(pfx.c_str(), ZUXR_KW.c_str(), m_zuxr);   
+   kwl.add(pfx.c_str(), ZUYR_KW.c_str(), m_zuyr);
+   kwl.add(pfx.c_str(), ZUZR_KW.c_str(), m_zuzr);   
+
+   kwl.add(pfx.c_str(), V1X_KW.c_str(), m_v1x);
+   kwl.add(pfx.c_str(), V1Y_KW.c_str(), m_v1y);
+   kwl.add(pfx.c_str(), V1Z_KW.c_str(), m_v1z);   
+
+   kwl.add(pfx.c_str(), V2X_KW.c_str(), m_v2x);
+   kwl.add(pfx.c_str(), V2Y_KW.c_str(), m_v2y);
+   kwl.add(pfx.c_str(), V2Z_KW.c_str(), m_v2z);
+
+   kwl.add(pfx.c_str(), V3X_KW.c_str(), m_v3x);
+   kwl.add(pfx.c_str(), V3Y_KW.c_str(), m_v3y);
+   kwl.add(pfx.c_str(), V3Z_KW.c_str(), m_v3z);
+
+   kwl.add(pfx.c_str(), V4X_KW.c_str(), m_v4x);  
+   kwl.add(pfx.c_str(), V4Y_KW.c_str(), m_v4y);
+   kwl.add(pfx.c_str(), V4Z_KW.c_str(), m_v4z);  
+
+   kwl.add(pfx.c_str(), V5X_KW.c_str(), m_v5x);  
+   kwl.add(pfx.c_str(), V5Y_KW.c_str(), m_v5y);
+   kwl.add(pfx.c_str(), V5Z_KW.c_str(), m_v5z);  
+
+   kwl.add(pfx.c_str(), V6X_KW.c_str(), m_v6x);  
+   kwl.add(pfx.c_str(), V6Y_KW.c_str(), m_v6y);
+   kwl.add(pfx.c_str(), V6Z_KW.c_str(), m_v6z);  
+
+   kwl.add(pfx.c_str(), V7X_KW.c_str(), m_v7x);  
+   kwl.add(pfx.c_str(), V7Y_KW.c_str(), m_v7y);
+   kwl.add(pfx.c_str(), V7Z_KW.c_str(), m_v7z);   
+
+   kwl.add(pfx.c_str(), V8X_KW.c_str(), m_v8x);  
+   kwl.add(pfx.c_str(), V8Y_KW.c_str(), m_v8y);
+   kwl.add(pfx.c_str(), V8Z_KW.c_str(), m_v8z);
+
+   kwl.add(pfx.c_str(), GRPX_KW.c_str(), m_grpx);
+   kwl.add(pfx.c_str(), GRPY_KW.c_str(), m_grpy);
+   kwl.add(pfx.c_str(), GRPZ_KW.c_str(), m_grpz);
+
+   kwl.add(pfx.c_str(), FULLR_KW.c_str(), m_fullr);
+   kwl.add(pfx.c_str(), FULLC_KW.c_str(), m_fullc);
+
+   kwl.add(pfx.c_str(), MINR_KW.c_str(), m_minr);
+   kwl.add(pfx.c_str(), MAXR_KW.c_str(), m_maxr);
+   kwl.add(pfx.c_str(), MINC_KW.c_str(), m_minc);   
+   kwl.add(pfx.c_str(), MAXC_KW.c_str(), m_maxc);
+
+   kwl.add(pfx.c_str(), IE0_KW.c_str(), m_ie0);
+   kwl.add(pfx.c_str(), IER_KW.c_str(), m_ier);  
+   kwl.add(pfx.c_str(), IEC_KW.c_str(), m_iec);
+
+   kwl.add(pfx.c_str(), IERR_KW.c_str(), m_ierr);
+   kwl.add(pfx.c_str(), IERC_KW.c_str(), m_ierc);   
+   kwl.add(pfx.c_str(), IECC_KW.c_str(), m_iecc);
+
+   kwl.add(pfx.c_str(), IA0_KW.c_str(), m_ie0);
+   kwl.add(pfx.c_str(), IAR_KW.c_str(), m_ier);  
+   kwl.add(pfx.c_str(), IAC_KW.c_str(), m_iec);
+
+   kwl.add(pfx.c_str(), IARR_KW.c_str(), m_ie0);
+   kwl.add(pfx.c_str(), IARC_KW.c_str(), m_ier);  
+   kwl.add(pfx.c_str(), IACC_KW.c_str(), m_iec);
+
+   kwl.add(pfx.c_str(), SPX_KW.c_str(), m_spx);
+   kwl.add(pfx.c_str(), SVX_KW.c_str(), m_svx);   
+   kwl.add(pfx.c_str(), SAX_KW.c_str(), m_sax);
+
+   kwl.add(pfx.c_str(), SPY_KW.c_str(), m_spy);
+   kwl.add(pfx.c_str(), SVY_KW.c_str(), m_svy);   
+   kwl.add(pfx.c_str(), SAY_KW.c_str(), m_say);
+
+   kwl.add(pfx.c_str(), SPZ_KW.c_str(), m_spz);
+   kwl.add(pfx.c_str(), SVZ_KW.c_str(), m_svz);   
+   kwl.add(pfx.c_str(), SAZ_KW.c_str(), m_saz);
+
+} // End: ossimRsmida::saveState( ... )
+
+bool ossimRsmida::loadState( const ossimKeywordlist& kwl,
+                             const std::string& prefix )
+{
+   static const char MODULE[] = "ossimRsmida::loadState";
+   std::string pfx = prefix + std::string("rsmida.");
+   std::string key;
+   std::string value;
+   
+   bool result = false; // Set to true on last key.
+      
+   while( 1 ) // Break out on error.
+   {
+      key = IID_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iid = value;
+      }
+      else
+      {
+         break;
+      }
+
+      key = EDITION_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_edition = value;
+      }
+      else
+      {
+         break;
+      }
+
+      key = ISID_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_isid = value;
+      }
+      else // Not required at this time.  Blank in nitf test data.
+      {
+         m_isid.clear();
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << MODULE << " NOTICE: " << ISID_KW << "was not found or is blank.\n";
+         }
+      }
+
+      key = SID_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_sid = value;
+      }
+      else // Not required at this time.  Blank in nitf test data.
+      {
+         m_sid.clear();
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << MODULE << " NOTICE: " << ISID_KW << "was not found or is blank.\n";
+         }
+      }
+
+      key = STID_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_stid = value;
+      }
+      else
+      {
+         break;
+      }
+
+      key = YEAR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_year = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = MONTH_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_month = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = DAY_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_day = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = HOUR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_hour = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = MINUTE_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_minute = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = SECOND_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_second = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = NRG_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_nrg = ossimString(value).toInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = NCG_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ncg = ossimString(value).toInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = TRG_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_trg = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = TCG_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_tcg = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = GRNDD_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_grndd = value[0];
+      }
+      else
+      {
+         break;
+      }
+
+      key = XUOR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_xuor = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = YUOR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_yuor = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = ZUOR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_zuor = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = XUXR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_xuxr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = XUYR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_xuyr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = XUZR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_xuzr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = YUXR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_yuxr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = YUYR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_yuyr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = YUZR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_yuzr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = ZUXR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_zuxr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = ZUYR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_zuyr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = ZUZR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_zuzr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V1X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v1x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V1Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v1y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V1Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v1z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = V2X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v2x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V2Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v2y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V2Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v2z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = V3X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v3x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V3Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v3y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V3Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v3z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V4X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v4x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = V4Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v4y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V4Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v4z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = V5X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v5x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V5Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v5y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V5Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v5z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = V6X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v6x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V6Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v6y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V6Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v6z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V7X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v7x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V7Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v7y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V7Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v7z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V8X_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v8x = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V8Y_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v8y = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = V8Z_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_v8z = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = GRPX_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_grpx = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = GRPY_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_grpy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = GRPZ_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_grpz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = FULLR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_fullr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = FULLC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_fullc = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = MINR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_minr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = MAXR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_maxr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = MINC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_minc = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = MAXC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_maxc = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IE0_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ie0 = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IER_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ier = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IEC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iec = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IERR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ierr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IERC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ierc = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IECC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iecc = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IA0_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ia0 = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IAR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iar = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IAC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iac = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IARR_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iarr = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IARC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iarc = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = IACC_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iacc = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = SPX_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_spx = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = SVX_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_svx = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = SAX_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_sax = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+     
+      key = SPY_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_spy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+     
+      key = SVY_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_svy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+     
+      key = SAY_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_say = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+     
+      key = SPZ_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_spz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+     
+      key = SVZ_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_svz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = SAZ_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_saz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      // If we get here we're good, so set the status for downstream code.
+      result = true;
+      
+      // Final break from while forever loop.
+      break;
+      
+   } // Matches: while( FOREVER )
+
+   if ( result == false )
+   {  
+      // Find on key failed...
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " WARNING:\n"
+         << "Error encountered parsing the following required keyword: "
+         << key
+         << "\nCheck the keywordlist for required key:value pairs."
+         << std::endl;
+   }
+   
+   return result;
+   
+} // End: ossimRsmida::loadState( ... )
+
+bool ossimRsmida::initialize( const ossimNitfRsmidaTag* rsmidaTag )
+{
+   bool status = false;
+   
+   if ( rsmidaTag )
+   {
+      m_iid = rsmidaTag->getIid().trim().string();
+      m_edition = rsmidaTag->getEdition().trim().string();
+
+      m_isid = rsmidaTag->getIsid().trim().string();
+      m_sid  = rsmidaTag->getSid().trim().string();
+      m_stid = rsmidaTag->getStid().trim().string();
+
+      m_year   = rsmidaTag->getYear().toUInt32();
+      m_month  = rsmidaTag->getMonth().toUInt32();
+      m_day    = rsmidaTag->getDay().toUInt32();
+      m_hour   = rsmidaTag->getHour().toUInt32();
+      m_minute = rsmidaTag->getMinute().toUInt32();
+      m_second = rsmidaTag->getSecond().toFloat64();
+      
+      m_nrg = rsmidaTag->getNrg().toUInt32();
+      m_ncg = rsmidaTag->getNcg().toUInt32();
+      
+      m_trg = rsmidaTag->getTrg().toFloat64();
+      m_tcg = rsmidaTag->getTcg().toFloat64();
+
+      std::string s = rsmidaTag->getGrndd().string();
+      if ( s.size() )
+      {
+         m_grndd = s[0];
+      }
+      else
+      {
+         m_grndd = '\0'; // This should not happen. return false??? (drb)
+      }
+      
+      m_xuor = rsmidaTag->getXuor().toFloat64();
+      m_yuor = rsmidaTag->getYuor().toFloat64();
+      m_zuor = rsmidaTag->getZuor().toFloat64();
+      
+      m_xuxr = rsmidaTag->getXuxr().toFloat64();
+      m_xuyr = rsmidaTag->getXuyr().toFloat64();
+      m_xuzr = rsmidaTag->getXuzr().toFloat64();
+      
+      m_yuxr = rsmidaTag->getYuxr().toFloat64();
+      m_yuyr = rsmidaTag->getYuyr().toFloat64();
+      m_yuzr = rsmidaTag->getYuzr().toFloat64();
+      
+      m_zuxr = rsmidaTag->getZuxr().toFloat64();
+      m_zuyr = rsmidaTag->getZuyr().toFloat64();
+      m_zuzr = rsmidaTag->getZuzr().toFloat64();
+      
+      m_v1x = rsmidaTag->getV1x().toFloat64();
+      m_v1y = rsmidaTag->getV1y().toFloat64();
+      m_v1z = rsmidaTag->getV1z().toFloat64();
+      
+      m_v2x = rsmidaTag->getV2x().toFloat64();
+      m_v2y = rsmidaTag->getV2y().toFloat64();
+      m_v2z = rsmidaTag->getV2z().toFloat64();
+      
+      m_v3x = rsmidaTag->getV3x().toFloat64();
+      m_v3y = rsmidaTag->getV3y().toFloat64();
+      m_v3z = rsmidaTag->getV3z().toFloat64();
+      
+      m_v4x = rsmidaTag->getV4x().toFloat64();
+      m_v4y = rsmidaTag->getV4y().toFloat64();
+      m_v4z = rsmidaTag->getV4z().toFloat64();
+      
+      m_v5x = rsmidaTag->getV5x().toFloat64();
+      m_v5y = rsmidaTag->getV5y().toFloat64();
+      m_v5z = rsmidaTag->getV5z().toFloat64();
+      
+      m_v6x = rsmidaTag->getV6x().toFloat64();
+      m_v6y = rsmidaTag->getV6y().toFloat64();
+      m_v6z = rsmidaTag->getV6z().toFloat64();
+      
+      m_v7x = rsmidaTag->getV7x().toFloat64();
+      m_v7y = rsmidaTag->getV7y().toFloat64();
+      m_v7z = rsmidaTag->getV7z().toFloat64();
+      
+      m_v8x = rsmidaTag->getV8x().toFloat64();
+      m_v8y = rsmidaTag->getV8y().toFloat64();
+      m_v8z = rsmidaTag->getV8z().toFloat64();
+      
+      m_grpx = rsmidaTag->getGrpx().toFloat64();
+      m_grpy = rsmidaTag->getGrpy().toFloat64();
+      m_grpz = rsmidaTag->getGrpz().toFloat64();
+      
+      m_fullr = rsmidaTag->getFullr().toUInt32();
+      m_fullc = rsmidaTag->getFullc().toUInt32();
+      
+      m_minr = rsmidaTag->getMinr().toUInt32();
+      m_maxr = rsmidaTag->getMaxr().toUInt32();
+      m_minc = rsmidaTag->getMinc().toUInt32();
+      m_maxc = rsmidaTag->getMaxc().toUInt32();
+      
+      m_ie0 = rsmidaTag->getIe0().toFloat64();
+      m_ier = rsmidaTag->getIer().toFloat64();
+      m_iec = rsmidaTag->getIec().toFloat64();
+      
+      m_ierr = rsmidaTag->getIerr().toFloat64();
+      m_ierc = rsmidaTag->getIerc().toFloat64();
+      m_iecc = rsmidaTag->getIecc().toFloat64();
+      
+      m_ia0 = rsmidaTag->getIa0().toFloat64();
+      m_iar = rsmidaTag->getIar().toFloat64();
+      m_iac = rsmidaTag->getIac().toFloat64();
+      
+      m_iarr = rsmidaTag->getIarr().toFloat64();
+      m_iarc = rsmidaTag->getIarc().toFloat64();
+      m_iacc = rsmidaTag->getIacc().toFloat64();
+      
+      m_spx = rsmidaTag->getSpx().toFloat64();
+      m_svx = rsmidaTag->getSvx().toFloat64();
+      m_sax = rsmidaTag->getSax().toFloat64();
+      
+      m_spy = rsmidaTag->getSpy().toFloat64();
+      m_svy = rsmidaTag->getSvy().toFloat64();
+      m_say = rsmidaTag->getSay().toFloat64();
+      
+      m_spz = rsmidaTag->getSpz().toFloat64();
+      m_svz = rsmidaTag->getSvz().toFloat64();
+      m_saz = rsmidaTag->getSaz().toFloat64();
+
+      status = true;
+      
+   } // Matches: if ( rsmidaTag )
+
+   return status;
+   
+} // End: ossimRsmida::initializeModel( rsmidaTag )
diff --git a/src/support_data/ossimRsmpca.cpp b/src/support_data/ossimRsmpca.cpp
new file mode 100644
index 0000000..989715b
--- /dev/null
+++ b/src/support_data/ossimRsmpca.cpp
@@ -0,0 +1,840 @@
+//---
+// File: ossimRsmpca.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//---
+
+#include <ossim/support_data/ossimRsmpca.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimNitfRsmpcaTag.h>
+
+static std::string IID_KW = "iid";
+static std::string EDITION_KW = "edition";
+
+static std::string RSN_KW = "rsn";
+static std::string CSN_KW = "csn";
+
+static std::string RFEP_KW = "rfep";
+static std::string CFEP_KW = "cfep";
+
+static std::string RNRMO_KW = "rnrmo";
+static std::string CNRMO_KW = "cnrmo";
+static std::string XNRMO_KW = "xnrmo";
+static std::string YNRMO_KW = "ynrmo";
+static std::string ZNRMO_KW = "znrmo";
+
+static std::string RNRMSF_KW = "rnrmsf";
+static std::string CNRMSF_KW = "cnrmsf";
+static std::string XNRMSF_KW = "xnrmsf";
+static std::string YNRMSF_KW = "ynrmsf";
+static std::string ZNRMSF_KW = "znrmsf";
+
+static std::string RNPWRX_KW = "rnpwrx";
+static std::string RNPWRY_KW = "rnpwry";
+static std::string RNPWRZ_KW = "rnpwrz";
+static std::string RNTRMS_KW = "rntrms";
+
+static std::string RNPCF_KW = "rnpcf";
+
+static std::string RDPWRX_KW = "rdpwrx";
+static std::string RDPWRY_KW = "rdpwry";
+static std::string RDPWRZ_KW = "rdpwrz";
+static std::string RDTRMS_KW = "rdtrms";
+
+static std::string RDPCF_KW = "rdpcf";
+
+static std::string CNPWRX_KW = "cnpwrx";
+static std::string CNPWRY_KW = "cnpwry";
+static std::string CNPWRZ_KW = "cnpwrz";
+static std::string CNTRMS_KW = "cntrms";
+
+static std::string CNPCF_KW = "cnpcf";
+
+static std::string CDPWRX_KW = "cdpwrx";
+static std::string CDPWRY_KW = "cdpwry";
+static std::string CDPWRZ_KW = "cdpwrz";
+static std::string CDTRMS_KW = "cdtrms";
+
+static std::string CDPCF_KW = "cdpcf";
+
+ossimRsmpca::ossimRsmpca()
+   :
+   m_iid(),
+   m_edition(),
+
+   m_rsn(0),
+   m_csn(0),
+
+   m_rfep(0.0),
+   m_cfep(0.0),
+
+   m_rnrmo(0.0),
+   m_cnrmo(0.0),
+   m_xnrmo(0.0),
+   m_ynrmo(0.0),
+   m_znrmo(0.0),
+
+   m_rnrmsf(0.0),
+   m_cnrmsf(0.0),
+   m_xnrmsf(0.0),
+   m_ynrmsf(0.0),
+   m_znrmsf(0.0),
+   
+   m_rnpwrx(0),
+   m_rnpwry(0),
+   m_rnpwrz(0),
+   m_rntrms(0),
+
+   m_rnpcf(),
+   
+   m_rdpwrx(0),
+   m_rdpwry(0),
+   m_rdpwrz(0),
+   m_rdtrms(0),
+
+   m_rdpcf(),
+   
+   m_cnpwrx(0),
+   m_cnpwry(0),
+   m_cnpwrz(0),
+   m_cntrms(0),
+
+   m_cnpcf(),
+   
+   m_cdpwrx(0),
+   m_cdpwry(0),
+   m_cdpwrz(0),
+   m_cdtrms(0),
+
+   m_cdpcf()
+{
+}
+
+ossimRsmpca::ossimRsmpca( const ossimRsmpca& obj )
+   :
+   m_iid( obj.m_iid ),
+   m_edition( obj.m_edition ),
+
+   m_rsn( obj.m_rsn ),
+   m_csn( obj.m_csn ),
+
+   m_rfep( obj.m_rfep ),
+   m_cfep( obj.m_cfep ),
+
+   m_rnrmo( obj.m_rnrmo ),
+   m_cnrmo( obj.m_cnrmo ),
+   m_xnrmo( obj.m_xnrmo ),
+   m_ynrmo( obj.m_ynrmo ),
+   m_znrmo( obj.m_znrmo ),
+
+   m_rnrmsf( obj.m_rnrmsf ),
+   m_cnrmsf( obj.m_cnrmsf ),
+   m_xnrmsf( obj.m_xnrmsf ),
+   m_ynrmsf( obj.m_ynrmsf ),
+   m_znrmsf( obj.m_znrmsf ),
+   
+   m_rnpwrx( obj.m_rnpwrx ),
+   m_rnpwry( obj.m_rnpwry ),
+   m_rnpwrz( obj.m_rnpwrz ),
+   m_rntrms( obj.m_rntrms ),
+
+   m_rnpcf( obj.m_rnpcf ),
+   
+   m_rdpwrx( obj.m_rdpwrx ),
+   m_rdpwry( obj.m_rdpwry ),
+   m_rdpwrz( obj.m_rdpwrz ),
+   m_rdtrms( obj.m_rdtrms ),
+
+   m_rdpcf( obj.m_rdpcf ),
+   
+   m_cnpwrx( obj.m_cnpwrx ),
+   m_cnpwry( obj.m_cnpwry ),
+   m_cnpwrz( obj.m_cnpwrz ),
+   m_cntrms( obj.m_cntrms ),
+
+   m_cnpcf( obj.m_cnpcf ),
+   
+   m_cdpwrx( obj.m_cdpwrx ),
+   m_cdpwry( obj.m_cdpwry ),
+   m_cdpwrz( obj.m_cdpwrz ),
+   m_cdtrms( obj.m_cdtrms ),
+
+   m_cdpcf( obj.m_cdpcf )
+{
+}
+
+const ossimRsmpca& ossimRsmpca::operator=( const ossimRsmpca& rhs )
+{
+   if (this != &rhs)
+   {
+      m_iid = rhs.m_iid;
+      m_edition = rhs.m_edition;
+      
+      m_rsn = rhs.m_rsn;
+      m_csn = rhs.m_csn;
+      
+      m_rfep = rhs.m_rfep;
+      m_cfep = rhs.m_cfep;
+
+      m_rnrmo = rhs.m_rnrmo;
+      m_cnrmo = rhs.m_cnrmo;
+      m_xnrmo = rhs.m_xnrmo;
+      m_ynrmo = rhs.m_ynrmo;
+      m_znrmo = rhs.m_znrmo;
+
+      m_rnrmsf = rhs.m_rnrmsf;
+      m_cnrmsf = rhs.m_cnrmsf;
+      m_xnrmsf = rhs.m_xnrmsf;
+      m_ynrmsf = rhs.m_ynrmsf;
+      m_znrmsf = rhs.m_znrmsf;
+      
+      m_rnpwrx = rhs.m_rnpwrx;
+      m_rnpwry = rhs.m_rnpwry;
+      m_rnpwrz = rhs.m_rnpwrz;
+      m_rntrms = rhs.m_rntrms;
+      
+      m_rnpcf = rhs.m_rnpcf;
+      
+      m_rdpwrx = rhs.m_rdpwrx;
+      m_rdpwry = rhs.m_rdpwry;
+      m_rdpwrz = rhs.m_rdpwrz;
+      m_rdtrms = rhs.m_rdtrms;
+      
+      m_rdpcf = rhs.m_rdpcf;
+      
+      m_cnpwrx = rhs.m_cnpwrx;
+      m_cnpwry = rhs.m_cnpwry;
+      m_cnpwrz = rhs.m_cnpwrz;
+      m_cntrms = rhs.m_cntrms;
+      
+      m_cnpcf = rhs.m_cnpcf;
+      
+      m_cdpwrx = rhs.m_cdpwrx;
+      m_cdpwry = rhs.m_cdpwry;
+      m_cdpwrz = rhs.m_cdpwrz;
+      m_cdtrms = rhs.m_cdtrms;
+      
+      m_cdpcf = rhs.m_cdpcf;
+   }
+   return *this;
+}
+
+void ossimRsmpca::saveState(
+   ossimKeywordlist& kwl, const std::string& prefix, ossim_uint32 index ) const
+{
+   std::string pfx = prefix + std::string("rsmpca");
+   pfx += ossimString::toString( index ).string();
+   pfx += std::string(".");
+   
+   kwl.add( pfx.c_str(), IID_KW.c_str(), m_iid.c_str() );
+   kwl.add(pfx.c_str(), EDITION_KW.c_str(), m_edition.c_str());
+
+   kwl.add(pfx.c_str(), RSN_KW.c_str(), m_rsn);
+   kwl.add(pfx.c_str(), CSN_KW.c_str(), m_csn);
+
+   kwl.add(pfx.c_str(), RFEP_KW.c_str(), m_rfep);
+   kwl.add(pfx.c_str(), CFEP_KW.c_str(), m_cfep);
+
+   kwl.add(pfx.c_str(), RNRMO_KW.c_str(), m_rnrmo);
+   kwl.add(pfx.c_str(), CNRMO_KW.c_str(), m_cnrmo);
+   kwl.add(pfx.c_str(), XNRMO_KW.c_str(), m_xnrmo);
+   kwl.add(pfx.c_str(), YNRMO_KW.c_str(), m_ynrmo);
+   kwl.add(pfx.c_str(), ZNRMO_KW.c_str(), m_znrmo);
+
+   kwl.add(pfx.c_str(), RNRMSF_KW.c_str(), m_rnrmsf);
+   kwl.add(pfx.c_str(), CNRMSF_KW.c_str(), m_cnrmsf);
+   kwl.add(pfx.c_str(), XNRMSF_KW.c_str(), m_xnrmsf);
+   kwl.add(pfx.c_str(), YNRMSF_KW.c_str(), m_ynrmsf);
+   kwl.add(pfx.c_str(), ZNRMSF_KW.c_str(), m_znrmsf);
+
+   kwl.add(pfx.c_str(), RNPWRX_KW.c_str(), m_rnpwrx);
+   kwl.add(pfx.c_str(), RNPWRY_KW.c_str(), m_rnpwry);
+   kwl.add(pfx.c_str(), RNPWRZ_KW.c_str(), m_rnpwrz);
+   kwl.add(pfx.c_str(), RNTRMS_KW.c_str(), m_rntrms);
+
+   for (ossim_uint32 i=0; i<m_rntrms; ++i)
+   {
+      ossimString key;
+      key = RNPCF_KW.c_str();
+      key += ossimString::toString(i);
+      kwl.add(pfx.c_str(), key.c_str(), m_rnpcf[i]);
+   }
+
+   kwl.add(pfx.c_str(), RDPWRX_KW.c_str(), m_rdpwrx);
+   kwl.add(pfx.c_str(), RDPWRY_KW.c_str(), m_rdpwry);
+   kwl.add(pfx.c_str(), RDPWRZ_KW.c_str(), m_rdpwrz);
+   kwl.add(pfx.c_str(), RDTRMS_KW.c_str(), m_rdtrms);
+
+   for (ossim_uint32 i=0; i<m_rdtrms; ++i)
+   {
+	
+      ossimString key;
+      key = RDPCF_KW.c_str();
+      key += ossimString::toString(i);
+      kwl.add(pfx.c_str(), key.c_str(), m_rdpcf[i]);
+   }
+
+   kwl.add(pfx.c_str(), CNPWRX_KW.c_str(), m_cnpwrx);
+   kwl.add(pfx.c_str(), CNPWRY_KW.c_str(), m_cnpwry);
+   kwl.add(pfx.c_str(), CNPWRZ_KW.c_str(), m_cnpwrz);
+   kwl.add(pfx.c_str(), CNTRMS_KW.c_str(), m_cntrms);
+
+   for (ossim_uint32 i=0; i<m_cntrms; ++i)
+   {
+      ossimString key;
+      key = CNPCF_KW.c_str();
+      key += ossimString::toString(i);
+      kwl.add(pfx.c_str(), key.c_str(), m_cnpcf[i]);
+   }
+
+   kwl.add(pfx.c_str(), CDPWRX_KW.c_str(), m_cdpwrx);
+   kwl.add(pfx.c_str(), CDPWRY_KW.c_str(), m_cdpwry);
+   kwl.add(pfx.c_str(), CDPWRZ_KW.c_str(), m_cdpwrz);
+   kwl.add(pfx.c_str(), CDTRMS_KW.c_str(), m_cdtrms);
+
+   for (ossim_uint32 i=0; i<m_cdtrms; ++i)
+   {
+      ossimString key;
+      key = CDPCF_KW.c_str();
+      key += ossimString::toString(i);
+      kwl.add(pfx.c_str(), key.c_str(), m_cdpcf[i]);
+   }
+
+   
+} // End: ossimRsmpca::saveState( ... )
+
+
+bool ossimRsmpca::loadState( const ossimKeywordlist& kwl,
+                             const std::string& prefix,
+                             ossim_uint32 index )
+{
+   std::string pfx = prefix + std::string("rsmpca");
+   pfx += ossimString::toString( index ).string();
+   pfx += std::string(".");
+
+   std::string key;
+   std::string value;
+   
+   bool result = false; // Set to true on last key.
+      
+   while( 1 ) // Break out on error.
+   {
+      key = IID_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iid = value;
+      }
+      else
+      {
+         break;
+      }
+
+      key = EDITION_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+        m_edition = value;
+      }
+      else
+      {
+         break;
+      }
+
+      key = RSN_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rsn = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+     
+      key = CSN_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_csn = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RFEP_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rfep = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+     
+      key = CFEP_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cfep = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RNRMO_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rnrmo = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CNRMO_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cnrmo = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = XNRMO_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_xnrmo = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = YNRMO_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_ynrmo = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = ZNRMO_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_znrmo = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RNRMSF_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rnrmsf = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CNRMSF_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cnrmsf = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = XNRMSF_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_xnrmsf = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = YNRMSF_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_ynrmsf = ossimString(value).toFloat64();
+      }
+      else
+      {
+            break;
+      }
+      
+      key = ZNRMSF_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_znrmsf = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RNPWRX_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rnpwrx = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RNPWRY_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rnpwry = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RNPWRZ_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rnpwrz = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RNTRMS_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rntrms = ossimString(value).toUInt32();
+         m_rnpcf.resize(m_rntrms);
+         bool keysParsed = true; // Set to false if not found.
+         for (ossim_uint32 i=0; i<m_rntrms; ++i)
+         {
+            key = RNPCF_KW;
+            key += ossimString::toString(i).string();
+            value = kwl.findKey(pfx, key);
+            if ( !value.size() )
+            {
+               keysParsed = false;
+               break; // Break from for loop.
+            }
+            m_rnpcf[i] = ossimString(value).toFloat64();
+         }
+         if ( keysParsed == false )
+         {
+            break; // Break from while (FOREVER) loop.
+         }
+      }
+
+      key = RDPWRX_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rdpwrx = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RDPWRY_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rdpwry = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RDPWRZ_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rdpwrz = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RDTRMS_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_rdtrms = ossimString(value).toUInt32();
+         m_rdpcf.resize(m_rdtrms);
+         bool keysParsed = true; // Set to false if not found.
+         for (ossim_uint32 i=0; i<m_rdtrms; ++i)
+         {
+            key = RDPCF_KW;
+            key += ossimString::toString(i).string();
+            value = kwl.findKey(pfx, key);
+            if ( !value.size() )
+            {
+               keysParsed = false;
+               break; // Break from for loop.
+            }
+            m_rdpcf[i] = ossimString(value).toFloat64();
+         }
+         if ( keysParsed == false )
+         {
+            break; // Break from while (FOREVER) loop.
+         }
+      }
+      
+      key = CNPWRX_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cnpwrx = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CNPWRY_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cnpwry = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CNPWRZ_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cnpwrz = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CNTRMS_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cntrms = ossimString(value).toUInt32();
+         m_cnpcf.resize(m_cntrms);
+         bool keysParsed = true; // Set to false if not found.
+         for (ossim_uint32 i=0; i<m_cntrms; ++i)
+         {
+            key = CNPCF_KW;
+            key += ossimString::toString(i).string();
+            value = kwl.findKey(pfx, key);
+            if ( !value.size() )
+            {
+               keysParsed = false;
+               break; // Break from for loop.
+            }
+            m_cnpcf[i] = ossimString(value).toFloat64();
+         }
+         if ( keysParsed == false )
+         {
+            break; // Break from while (FOREVER) loop.
+         }
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CDPWRX_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cdpwrx = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CDPWRY_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cdpwry = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CDPWRZ_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cdpwrz = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = CDTRMS_KW;
+      value = kwl.findKey(pfx, key);
+      if ( value.size() )
+      {
+         m_cdtrms = ossimString(value).toUInt32();
+         m_cdpcf.resize(m_cdtrms);
+         bool keysParsed = true; // Set to false if not found.
+         for (ossim_uint32 i=0; i<m_cdtrms; ++i)
+         {
+            key = CDPCF_KW;
+            key += ossimString::toString(i).string();
+            value = kwl.findKey(pfx, key);
+            if ( !value.size() )
+            {
+               keysParsed = false;
+               break; // Break from for loop.
+            }
+            m_cdpcf[i] = ossimString(value).toFloat64();
+         }
+         if ( keysParsed == false )
+         {
+            break; // Break from while (FOREVER) loop.
+         }
+      }
+      else
+      {
+         break;
+      }
+
+      // If we get here we're good, so set the status for downstream code.
+      result = true;
+      
+      // Final break from while forever loop.
+      break;
+         
+   } // Matches while( FOREVER ){ ...
+
+   if ( result == false )
+   {  
+      // Find on key failed...
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimRsmpca::loadState WARNING:\n"
+         << "Error encountered parsing the following required keyword: "
+         << "<" << key << ">. Check the keywordlist for proper syntax."
+         << std::endl;
+   }
+   
+   return result;
+   
+} // End: ossimRsmpca::loadState( ... )
+
+bool ossimRsmpca::initialize( const ossimNitfRsmpcaTag* rsmpcaTag )
+{
+   bool status = false;
+   
+   if ( rsmpcaTag )
+   {
+      m_iid = rsmpcaTag->getIid().trim().string();
+      m_edition = rsmpcaTag->getEdition().trim().string();
+
+      m_rsn = rsmpcaTag->getRsn().toUInt32();
+      m_csn = rsmpcaTag->getCsn().toUInt32();
+
+      m_rfep = rsmpcaTag->getRfep().toFloat64();
+      m_cfep = rsmpcaTag->getCfep().toFloat64();
+
+      m_rnrmo = rsmpcaTag->getRnrmo().toFloat64();
+      m_cnrmo = rsmpcaTag->getCnrmo().toFloat64();
+      m_xnrmo = rsmpcaTag->getXnrmo().toFloat64();
+      m_ynrmo = rsmpcaTag->getYnrmo().toFloat64();
+      m_znrmo = rsmpcaTag->getZnrmo().toFloat64();
+
+      m_rnrmsf = rsmpcaTag->getRnrmsf().toFloat64();
+      m_cnrmsf = rsmpcaTag->getCnrmsf().toFloat64();
+      m_xnrmsf = rsmpcaTag->getXnrmsf().toFloat64();
+      m_ynrmsf = rsmpcaTag->getYnrmsf().toFloat64();
+      m_znrmsf = rsmpcaTag->getZnrmsf().toFloat64();
+         
+      m_rnpwrx = rsmpcaTag->getRnpwrx().toUInt32();
+      m_rnpwry = rsmpcaTag->getRnpwry().toUInt32();
+      m_rnpwrz = rsmpcaTag->getRnpwrz().toUInt32();
+      m_rntrms = rsmpcaTag->getRntrms().toUInt32();
+      m_rnpcf.resize(m_rntrms);
+
+      for (ossim_uint32 i = 0; i < m_rntrms; ++i)
+      {
+         m_rnpcf[i] = rsmpcaTag->getRnpcf(i).toFloat64();
+      }
+      
+      m_rdpwrx = rsmpcaTag->getRdpwrx().toUInt32();
+      m_rdpwry = rsmpcaTag->getRdpwry().toUInt32();
+      m_rdpwrz = rsmpcaTag->getRdpwrz().toUInt32();
+      m_rdtrms = rsmpcaTag->getRdtrms().toUInt32();
+      m_rdpcf.resize(m_rdtrms);
+
+      for (ossim_uint32 i = 0; i < m_rdtrms; ++i)
+      {
+         m_rdpcf[i] = rsmpcaTag->getRdpcf(i).toFloat64();
+      }
+      
+      m_cnpwrx = rsmpcaTag->getCnpwrx().toUInt32();
+      m_cnpwry = rsmpcaTag->getCnpwry().toUInt32();
+      m_cnpwrz = rsmpcaTag->getCnpwrz().toUInt32();
+      m_cntrms = rsmpcaTag->getCntrms().toUInt32();
+      m_cnpcf.resize(m_cntrms);
+
+      for (ossim_uint32 i = 0; i < m_cntrms; ++i)
+      {
+         m_cnpcf[i] = rsmpcaTag->getCnpcf(i).toFloat64();
+      }
+      
+      m_cdpwrx = rsmpcaTag->getCdpwrx().toUInt32();
+      m_cdpwry = rsmpcaTag->getCdpwry().toUInt32();
+      m_cdpwrz = rsmpcaTag->getCdpwrz().toUInt32();
+      m_cdtrms = rsmpcaTag->getCdtrms().toUInt32();
+      m_cdpcf.resize(m_cdtrms);
+
+      for (ossim_uint32 i = 0; i < m_cdtrms; ++i)
+      {
+         m_cdpcf[i] = rsmpcaTag->getCdpcf(i).toFloat64();
+      }
+         
+      status = true;
+      
+   } // Matches: if ( rsmpcaTag )
+
+   return status;
+   
+} // End: ossimRsmpca::initializeModel( rsmpcaTag )
diff --git a/src/support_data/ossimRsmpia.cpp b/src/support_data/ossimRsmpia.cpp
new file mode 100644
index 0000000..7cc3180
--- /dev/null
+++ b/src/support_data/ossimRsmpia.cpp
@@ -0,0 +1,594 @@
+//---
+// File: ossimRsmpia.cpp
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//---
+
+#include <ossim/support_data/ossimRsmpia.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/support_data/ossimNitfRsmpiaTag.h>
+
+static std::string IID_KW     = "iid";
+static std::string EDITION_KW = "edition";
+
+static std::string R0_KW      = "r0";
+static std::string RX_KW      = "rx";
+static std::string RY_KW      = "ry";
+static std::string RZ_KW      = "rz";
+
+static std::string RXX_KW     = "rxx";
+static std::string RXY_KW     = "rxy";
+static std::string RXZ_KW     = "rxz";
+
+static std::string RYY_KW     = "ryy";
+static std::string RYZ_KW     = "ryz";
+static std::string RZZ_KW     = "rzz";
+
+static std::string C0_KW      = "c0";
+static std::string CX_KW      = "cx";
+static std::string CY_KW      = "cy";
+static std::string CZ_KW      = "cz";
+
+static std::string CXX_KW     = "cxx";
+static std::string CXY_KW     = "cxy";
+static std::string CXZ_KW     = "cxz";
+
+static std::string CYY_KW     = "cyy";
+static std::string CYZ_KW     = "cyz";
+static std::string CZZ_KW     = "czz";
+
+static std::string RNIS_KW    = "rnis";
+static std::string CNIS_KW    = "cnis";
+static std::string TNIS_KW    = "tnis";
+
+static std::string RSSIZ_KW   = "rssiz";
+static std::string CSSIZ_KW   = "cssiz";
+
+ossimRsmpia::ossimRsmpia()
+   :
+   m_iid(),
+   m_edition(),
+
+   m_r0(0.0),
+   m_rx(0.0),
+   m_ry(0.0),
+   m_rz(0.0),
+
+   m_rxx(0.0),
+   m_rxy(0.0),
+   m_rxz(0.0),
+
+   m_ryy(0.0),
+   m_ryz(0.0),
+   m_rzz(0.0),
+
+   m_c0(0.0),
+   m_cx(0.0),
+   m_cy(0.0),
+   m_cz(0.0),
+
+   m_cxx(0.0),
+   m_cxy(0.0),
+   m_cxz(0.0),   
+
+   m_cyy(0.0),
+   m_cyz(0.0),
+   m_czz(0.0),
+
+   m_rnis(0),
+   m_cnis(0),
+   m_tnis(0),
+
+   m_rssiz(0.0),
+   m_cssiz(0.0)
+{
+}
+
+ossimRsmpia::ossimRsmpia( const ossimRsmpia& obj )
+   :
+   m_iid( obj.m_iid ),
+   m_edition( obj.m_edition ),
+
+   m_r0( obj.m_r0 ),
+   m_rx( obj.m_rx ),
+   m_ry( obj.m_ry ),
+   m_rz( obj.m_rz ),
+
+   m_rxx( obj.m_rxx ),
+   m_rxy( obj.m_rxy ),
+   m_rxz( obj.m_rxz ),
+
+   m_ryy( obj.m_ryy ),
+   m_ryz( obj.m_ryz ),
+   m_rzz( obj.m_rzz ),
+
+   m_c0( obj.m_c0 ),
+   m_cx( obj.m_cx ),
+   m_cy( obj.m_cy ),
+   m_cz( obj.m_cz ),
+
+   m_cxx( obj.m_cxx ),
+   m_cxy( obj.m_cxy ),
+   m_cxz( obj.m_cxz ),   
+
+   m_cyy( obj.m_cyy ),
+   m_cyz( obj.m_cyz ),   
+   m_czz( obj.m_czz ),
+
+   m_rnis( obj.m_rnis ),
+   m_cnis( obj.m_cnis ),
+   m_tnis( obj.m_tnis ),
+
+   m_rssiz( obj.m_rssiz ),
+   m_cssiz( obj.m_cssiz )
+{
+}
+
+const ossimRsmpia& ossimRsmpia::operator=( const ossimRsmpia& rhs )
+{
+   if (this != &rhs)
+   {
+      m_iid = rhs.m_iid;
+      m_edition = rhs.m_edition;
+
+      m_r0 = rhs.m_r0;
+      m_rx = rhs.m_rx;
+      m_ry = rhs.m_ry;
+      m_rz = rhs.m_rz;
+
+      m_rxx = rhs.m_rxx;
+      m_rxy = rhs.m_rxy;
+      m_rxz = rhs.m_rxz;
+
+      m_ryy = rhs.m_ryy;
+      m_ryz = rhs.m_ryz;
+      m_rzz = rhs.m_rzz;
+
+      m_c0 = rhs.m_c0;
+      m_cx = rhs.m_cx;
+      m_cy = rhs.m_cy;
+      m_cz = rhs.m_cz;
+
+      m_cxx = rhs.m_cxx;
+      m_cxy = rhs.m_cxy;
+      m_cxz = rhs.m_cxz;      
+
+      m_cyy = rhs.m_cyy;
+      m_cyz = rhs.m_cyz;      
+      m_czz = rhs.m_czz;
+
+      m_rnis = rhs.m_rnis;
+      m_cnis = rhs.m_cnis;
+      m_tnis = rhs.m_tnis;
+
+      m_rssiz = rhs.m_rssiz;
+      m_cssiz = rhs.m_cssiz;
+   }
+   return *this;
+}
+
+void ossimRsmpia::saveState( ossimKeywordlist& kwl,
+                             const std::string& prefix ) const
+{
+   std::string pfx = prefix + std::string("rsmpia.");
+   
+   kwl.add(pfx.c_str(), IID_KW.c_str(), m_iid.c_str());
+   kwl.add(pfx.c_str(), EDITION_KW.c_str(), m_edition.c_str());
+
+   kwl.add(pfx.c_str(), R0_KW.c_str(), m_r0);
+   kwl.add(pfx.c_str(), RX_KW.c_str(), m_rx);
+   kwl.add(pfx.c_str(), RY_KW.c_str(), m_ry);
+   kwl.add(pfx.c_str(), RZ_KW.c_str(), m_rz);
+
+   kwl.add(pfx.c_str(), RXX_KW.c_str(), m_rxx);
+   kwl.add(pfx.c_str(), RXY_KW.c_str(), m_rxy);
+   kwl.add(pfx.c_str(), RXZ_KW.c_str(), m_rxz);
+
+   kwl.add(pfx.c_str(), RYY_KW.c_str(), m_ryy);
+   kwl.add(pfx.c_str(), RYZ_KW.c_str(), m_ryz);
+   kwl.add(pfx.c_str(), RZZ_KW.c_str(), m_rzz);
+
+   kwl.add(pfx.c_str(), C0_KW.c_str(), m_c0);
+   kwl.add(pfx.c_str(), CX_KW.c_str(), m_cx);
+   kwl.add(pfx.c_str(), CY_KW.c_str(), m_cy);
+   kwl.add(pfx.c_str(), CZ_KW.c_str(), m_cz);
+
+   kwl.add(pfx.c_str(), CXX_KW.c_str(), m_cxx);
+   kwl.add(pfx.c_str(), CXY_KW.c_str(), m_cxy);
+   kwl.add(pfx.c_str(), CXZ_KW.c_str(), m_cxz);
+
+   kwl.add(pfx.c_str(), CYY_KW.c_str(), m_cyy);
+   kwl.add(pfx.c_str(), CYZ_KW.c_str(), m_cyz);
+   kwl.add(pfx.c_str(), CZZ_KW.c_str(), m_czz);
+
+   kwl.add(pfx.c_str(), RNIS_KW.c_str(), m_rnis);
+   kwl.add(pfx.c_str(), CNIS_KW.c_str(), m_cnis);
+   kwl.add(pfx.c_str(), TNIS_KW.c_str(), m_tnis);
+
+   kwl.add(pfx.c_str(), RSSIZ_KW.c_str(), m_rssiz);
+   kwl.add(pfx.c_str(), CSSIZ_KW.c_str(), m_cssiz);
+   
+} // End: ossimRsmpia::saveState( ... )
+
+bool ossimRsmpia::loadState( const ossimKeywordlist& kwl,
+                             const std::string& prefix )
+{
+   std::string pfx = prefix + std::string("rsmpia.");
+   std::string key;
+   std::string value;
+   
+   bool result = false; // Set to true on last key.
+      
+   while( 1 ) // Break out on error.
+   {
+      key = IID_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_iid = value;
+      }
+      else
+      {
+         break;
+      }
+
+      key = EDITION_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+        m_edition = value;
+      }
+      else
+      {
+         break;
+      }
+
+      key = R0_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_r0 = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RX_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rx = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+      
+      key = RY_KW;
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ry = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RXX_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rxx = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RXY_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rxy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RXZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rxz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RYY_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ryy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RYZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_ryz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RZZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rzz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = C0_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_c0 = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CX_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cx = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CY_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CXX_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cxx = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CXY_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cxy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CXZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cxz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CYY_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cyy = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CYZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cyz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CZZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_czz = ossimString(value).toFloat64();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RNIS_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rnis = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CNIS_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cnis = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = TNIS_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_tnis = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = RSSIZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_rssiz = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      key = CSSIZ_KW;  
+      value = kwl.findKey( pfx, key );
+      if ( value.size() )
+      {
+         m_cssiz = ossimString(value).toUInt32();
+      }
+      else
+      {
+         break;
+      }
+
+      // If we get here we're good, so set the status for downstream code.
+      result = true;
+
+      // Final break from while forever loop.
+      break;
+      
+   } // Matches: while( FOREVER )
+
+   if ( result == false )
+   {  
+      // Find on key failed...
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimRsmpia::loadState WARNING:\n"
+         << "Error encountered parsing the following required keyword: "
+         << "<" << key << ">. Check the keywordlist for proper syntax."
+         << std::endl;
+   }
+   
+   return result;
+   
+} // End: ossimRsmpia::loadState( ... )
+
+bool ossimRsmpia::initialize( const ossimNitfRsmpiaTag* rsmpiaTag )
+{
+   bool status = false;
+   
+   if ( rsmpiaTag )
+   {
+      m_iid = rsmpiaTag->getIid().trim().string();
+      m_edition = rsmpiaTag->getEdition().trim().string();
+
+      m_r0 = rsmpiaTag->getR0().toFloat64();
+      m_rx = rsmpiaTag->getRx().toFloat64();
+      m_ry = rsmpiaTag->getRy().toFloat64();
+      m_rz = rsmpiaTag->getRz().toFloat64();
+
+      m_rxx = rsmpiaTag->getRxx().toFloat64();
+      m_rxy = rsmpiaTag->getRxy().toFloat64();
+      m_rxz = rsmpiaTag->getRxz().toFloat64();
+
+      m_ryy = rsmpiaTag->getRyy().toFloat64();
+      m_ryz = rsmpiaTag->getRyz().toFloat64();
+      m_rzz = rsmpiaTag->getRzz().toFloat64();
+
+      m_c0 = rsmpiaTag->getC0().toFloat64();
+      m_cx = rsmpiaTag->getCx().toFloat64();
+      m_cy = rsmpiaTag->getCy().toFloat64();
+      m_cz = rsmpiaTag->getCz().toFloat64();
+
+      m_cxx = rsmpiaTag->getCxx().toFloat64();
+      m_cxy = rsmpiaTag->getCxy().toFloat64();
+      m_cxz = rsmpiaTag->getCxz().toFloat64();
+
+      m_cyy = rsmpiaTag->getCyy().toFloat64();
+      m_cyz = rsmpiaTag->getCyz().toFloat64();
+      m_czz = rsmpiaTag->getCzz().toFloat64();
+
+      m_rnis = rsmpiaTag->getRnis().toUInt32();
+      m_cnis = rsmpiaTag->getCnis().toUInt32();
+      m_tnis = rsmpiaTag->getTnis().toUInt32();
+
+      m_rssiz = rsmpiaTag->getRssiz().toFloat64();
+      m_cssiz = rsmpiaTag->getCssiz().toFloat64();
+
+      status = true;
+      
+   } // Matches: if ( rsmpiaTag )
+
+   return status;
+   
+} // End: ossimRsmpia::initializeModel( rsmpiaTag )
diff --git a/ossim/src/ossim/support_data/ossimSpaceImagingGeom.cpp b/src/support_data/ossimSpaceImagingGeom.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimSpaceImagingGeom.cpp
rename to src/support_data/ossimSpaceImagingGeom.cpp
diff --git a/ossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp b/src/support_data/ossimSpotDimapSupportData.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimSpotDimapSupportData.cpp
rename to src/support_data/ossimSpotDimapSupportData.cpp
diff --git a/ossim/src/ossim/support_data/ossimSrcRecord.cpp b/src/support_data/ossimSrcRecord.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimSrcRecord.cpp
rename to src/support_data/ossimSrcRecord.cpp
diff --git a/ossim/src/ossim/support_data/ossimSrtmFilename.cpp b/src/support_data/ossimSrtmFilename.cpp
similarity index 100%
rename from ossim/src/ossim/support_data/ossimSrtmFilename.cpp
rename to src/support_data/ossimSrtmFilename.cpp
diff --git a/src/support_data/ossimSrtmSupportData.cpp b/src/support_data/ossimSrtmSupportData.cpp
new file mode 100644
index 0000000..0d066d9
--- /dev/null
+++ b/src/support_data/ossimSrtmSupportData.cpp
@@ -0,0 +1,917 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description:
+// 
+// Support data class for a Shuttle Radar Topography Mission (SRTM) file.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+
+#include <ossim/support_data/ossimSrtmSupportData.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimDatumFactory.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimRegExp.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimMapProjection.h>
+
+#include <cmath>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimSrtmSupportData:debug");
+
+//---
+// Start with the min and max at some default setting.
+// Mt. Everest highest elev point on Earth 8850 meters.
+//---
+static const ossim_float64 DEFAULT_MIN = -8850.0;
+static const ossim_float64 DEFAULT_MAX =  8850.0;
+
+
+ossimSrtmSupportData::ossimSrtmSupportData()
+   :
+   m_file(),
+   m_numberOfLines(0),
+   m_numberOfSamples(0),
+   m_southwestLatitude(ossim::nan()),
+   m_southwestLongitude(ossim::nan()),
+   m_latSpacing(ossim::nan()),
+   m_lonSpacing(ossim::nan()),
+   m_minPixelValue(DEFAULT_MIN),
+   m_maxPixelValue(DEFAULT_MAX),
+   m_scalarType(OSSIM_SCALAR_UNKNOWN),
+   m_str(0)
+{
+}
+
+ossimSrtmSupportData::~ossimSrtmSupportData()
+{
+}
+
+bool ossimSrtmSupportData::setFilename(const ossimFilename& srtmFile,
+                                       bool scanForMinMax)
+{
+   m_file = srtmFile;
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSrtmSupportData::setFilename: entered:"
+         << "\nsrtmFile:  " << srtmFile
+         << "\nscanForMinMax flag:  " << scanForMinMax
+         << std::endl;
+   }
+   
+   m_str =  ossimStreamFactoryRegistry::instance()->
+      createIFStream(m_file, std::ios_base::in | std::ios_base::binary);
+   if (m_str)
+   {
+      if(m_str->fail())
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << m_file << " does not exist: leaving ..." << std::endl;
+         }
+         clear();
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+
+   // Start with default.
+   m_minPixelValue = DEFAULT_MIN;
+   m_maxPixelValue = DEFAULT_MAX;
+   
+   // See if we have an ossim metadata file to initialize from.
+   bool outputOmd     = false;
+   bool loadedFromOmd = false;
+   
+   ossimFilename omdFile = m_file;
+   omdFile.setExtension(ossimString("omd"));
+   if (omdFile.exists())
+   {
+      //---
+      // The loadOmd is called instead of loadState so m_file is not
+      // overwrote.
+      //---
+      ossimKeywordlist kwl(omdFile);
+      loadedFromOmd = loadOmd(kwl);
+   }
+
+   if (!loadedFromOmd)
+   {
+      if (!setCornerPoints())
+      {
+         clear();
+         return false;
+      }
+      if (!setSize())
+      {
+         clear();
+         return false;
+      }
+      outputOmd = true;
+   }
+
+   if (scanForMinMax)
+   {
+      // These could have been picked up in the loadOmd.
+      if ( (m_minPixelValue == DEFAULT_MIN) ||
+           (m_maxPixelValue == DEFAULT_MAX) )
+      {
+         if ( computeMinMax() )
+         {
+            outputOmd = true;
+         }
+         else
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "Unable to compute min max: leaving ..." << std::endl;
+            }
+            clear();
+            return false;
+         }
+      }
+   }
+
+   //---
+   // NOTE:  The outputOmd flag should probably be set if !loadedFromOmd.
+   // Leaving as is for now (only set if scanForMinMax).
+   //---
+   if (outputOmd)
+   {
+      ossimKeywordlist kwl;
+      saveState(kwl);
+      kwl.write(omdFile);
+   }
+
+   if(m_str->is_open())
+   {
+      m_str->close();
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << *this << std::endl;
+   }
+   
+   return true;
+}
+
+ossimFilename ossimSrtmSupportData::getFilename() const
+{
+   return m_file;
+}
+
+ossim_uint32 ossimSrtmSupportData::getNumberOfLines() const
+{
+   return m_numberOfLines;
+}
+
+ossim_uint32 ossimSrtmSupportData::getNumberOfSamples() const
+{
+   return m_numberOfSamples;
+}
+
+bool ossimSrtmSupportData::getImageGeometry(ossimKeywordlist& kwl,
+                                            const char* prefix)
+{
+   if (m_file == ossimFilename::NIL)
+   {
+      return false;
+   }
+   
+   kwl.add(prefix,
+           ossimKeywordNames::TYPE_KW,
+           "ossimEquDistCylProjection",
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::ORIGIN_LATITUDE_KW,
+           0.0,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::CENTRAL_MERIDIAN_KW,
+           m_southwestLongitude,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LAT_KW,
+           (m_southwestLatitude+1.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LON_KW,
+           m_southwestLongitude,
+           true);
+
+   // Add the pixel scale.
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+           m_latSpacing,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+           m_lonSpacing,
+           true);
+
+   // Add the datum.  (always WGS-84 per spec)
+   kwl.add(prefix,
+           ossimKeywordNames::DATUM_KW,
+           ossimDatumFactory::instance()->wgs84()->code(),
+           true);
+
+   // Add the number of lines and samples.
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_LINES_KW,
+           m_numberOfLines,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_SAMPLES_KW,
+           m_numberOfSamples,
+           true);
+   
+   return true;
+}
+
+ossimRefPtr<ossimProjection> ossimSrtmSupportData::getProjection() const
+{
+   //---
+   // Make an Equidistant Cylindrical projection with a origin at the equator
+   // since the DTED post spacing is considered to be square.
+   //---
+   const ossimDatum* datum = ossimDatumFactory::instance()->wgs84();
+   ossimRefPtr<ossimEquDistCylProjection> eq = new ossimEquDistCylProjection(*(datum->ellipsoid()));
+   
+   //---
+   // Set the tie point.
+   // NOTE: Latitude southwest corner we need northwest; hence, the +1.
+   //---
+   eq->setUlTiePoints( ossimGpt(m_southwestLatitude+1.0, m_southwestLongitude, 0.0, datum) );
+   
+   // Set the scale:
+   eq->setDecimalDegreesPerPixel( ossimDpt(m_lonSpacing, m_latSpacing) );
+
+   ossimRefPtr<ossimProjection> proj = eq.get();
+
+   return proj;
+}
+
+bool ossimSrtmSupportData::saveState(ossimKeywordlist& kwl,
+                                     const char* prefix) const
+{
+   if (m_file == ossimFilename::NIL)
+   {
+      return false;
+   }
+   
+   ossimString bandPrefix;
+   if (prefix)
+   {
+      bandPrefix = prefix;
+   }
+   bandPrefix += "band1.";
+   
+   kwl.add(prefix,
+           ossimKeywordNames::FILENAME_KW,
+           m_file.c_str(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_BANDS_KW,
+           1,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_LINES_KW,
+           m_numberOfLines,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::NUMBER_SAMPLES_KW,
+           m_numberOfSamples,
+           true);
+
+   //---
+   // Special case, store the tie point as the upper left lat so add one.
+   //---
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LAT_KW,
+           (m_southwestLatitude + 1.0),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_LON_KW,
+           m_southwestLongitude,
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+           m_latSpacing,
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+           m_lonSpacing,
+           true);
+
+   // User can opt out of scanning for this so don't save if it is still nan.
+   if (m_minPixelValue != DEFAULT_MIN)
+   {
+      kwl.add(bandPrefix,
+              ossimKeywordNames::MIN_VALUE_KW,
+              m_minPixelValue,
+              true);
+   }
+
+   // User can opt out of scanning for this so don't save if it is still nan.
+   if (m_maxPixelValue != DEFAULT_MAX)
+   {
+      kwl.add(bandPrefix.c_str(),
+              ossimKeywordNames::MAX_VALUE_KW,
+              m_maxPixelValue,
+              true);
+   }
+
+   // constant
+   kwl.add(bandPrefix,
+           ossimKeywordNames::NULL_VALUE_KW,
+           "-32768",
+           true);
+
+   // constant
+   kwl.add(prefix,
+           ossimKeywordNames::BYTE_ORDER_KW,
+           "big_endian",
+           true);
+
+   // constant
+   kwl.add(prefix,
+           ossimKeywordNames::SCALAR_TYPE_KW,
+           ossimScalarTypeLut::instance()->getEntryString(m_scalarType),
+           true);
+
+   return true;
+}
+   
+bool ossimSrtmSupportData::loadState(const ossimKeywordlist& kwl,
+                                     const char* prefix)
+{
+   ossimString bandPrefix;
+   if (prefix)
+   {
+      bandPrefix = prefix;
+   }
+   bandPrefix += "band1.";
+   
+   ossimString s; // For numeric conversions.
+   
+   const char* lookup;
+
+   // Look for "filename" then look for deprecated "image_file" next.
+   lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
+   if (lookup)
+   {
+      m_file = lookup;
+   }
+   else
+   {
+      // Deprecated...
+      lookup = kwl.find(prefix, ossimKeywordNames::IMAGE_FILE_KW);
+      if (lookup)
+      {
+         m_file = lookup;
+      }
+      else
+      {
+         return false;
+      }
+   }
+
+   return loadOmd(kwl, prefix);
+}
+
+bool ossimSrtmSupportData::loadOmd(const ossimKeywordlist& kwl,
+                                   const char* prefix)
+{
+   std::string pfx;
+   std::string bandPrefix;
+   
+   if (prefix) // Cannot give null to std::string.
+   {
+      pfx        = prefix;
+      bandPrefix = prefix;
+   }
+   bandPrefix += "band1.";
+   
+   ossimString value;
+
+   //---
+   // Look for the min and max first since they could have been populated by
+   // "cmm" (compute min max).  Min and Max are not required by this method
+   // as they are handled elsewhere if they are not found here.
+   //---
+   
+   // Not an error if not present.
+   value.string() = kwl.findKey(bandPrefix, std::string(ossimKeywordNames::MIN_VALUE_KW));
+   if ( value.size() )
+   {
+      m_minPixelValue = value.toFloat64();
+   }
+   
+   // Not an error if not present.
+   value.string() = kwl.findKey(bandPrefix.c_str(), std::string(ossimKeywordNames::MAX_VALUE_KW));
+   if ( value.size() )
+   {
+      m_maxPixelValue = value.toFloat64();
+   }
+   
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_LINES_KW));
+   if ( value.size() )
+   {
+      m_numberOfLines = value.toUInt32();
+   }
+   else
+   {
+      return false;
+   }
+   
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::NUMBER_SAMPLES_KW));
+   if ( value.size() )
+   {
+      m_numberOfSamples = value.toUInt32();
+   }
+   else
+   {
+      return false;
+   }
+
+   //---
+   // Special case the tie point was stored as the upper left so we must
+   // subtract one.
+   //---
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::TIE_POINT_LAT_KW));
+   if ( value.size() )
+   {
+      m_southwestLatitude = value.toFloat64() - 1.0;
+   }
+   else
+   {
+      return false;
+   }
+
+   value.string() = kwl.findKey(pfx, std::string(ossimKeywordNames::TIE_POINT_LON_KW));
+   if ( value.size() )
+   {
+      m_southwestLongitude = value.toFloat64();
+   }
+   else
+   {
+      return false;
+   }
+   
+   int scalar = ossimScalarTypeLut::instance()->getEntryNumber(kwl, prefix);
+   
+   if (scalar != ossimLookUpTable::NOT_FOUND)
+   {
+      m_scalarType = (ossimScalarType)scalar;
+      if((m_scalarType != OSSIM_FLOAT32) && (m_scalarType != OSSIM_SINT16))
+      {
+         return false;
+      }
+   }
+   else
+   {
+      return false;
+   }
+   
+   m_latSpacing = 1.0 / (m_numberOfLines   - 1);
+   m_lonSpacing = 1.0 / (m_numberOfSamples - 1);
+   
+   return true;
+}
+
+ossim_float64 ossimSrtmSupportData::getSouthwestLatitude() const
+{
+   return m_southwestLatitude;
+}
+
+ossim_float64 ossimSrtmSupportData::getSouthwestLongitude() const
+{
+   return m_southwestLongitude;
+}
+ossim_float64 ossimSrtmSupportData::getLatitudeSpacing() const
+{
+   return m_latSpacing;
+}
+
+ossim_float64 ossimSrtmSupportData::getLongitudeSpacing() const
+{
+   return m_lonSpacing;
+}
+
+void ossimSrtmSupportData::clear()
+{
+   m_file               = ossimFilename::NIL;
+   m_numberOfLines      = 0;
+   m_numberOfSamples    = 0;
+   m_southwestLatitude  = ossim::nan();
+   m_southwestLongitude = ossim::nan();
+   m_latSpacing         = ossim::nan();
+   m_lonSpacing         = ossim::nan();
+   m_minPixelValue      = DEFAULT_MIN;
+   m_maxPixelValue      = DEFAULT_MAX;
+}
+
+bool ossimSrtmSupportData::setCornerPoints()
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSrtmSupportData::setCornerPoints(): entered..." << std::endl;
+   }
+   
+   ossimFilename f = m_file.fileNoExtension();
+   ossimString regularExp1 = "[N|S][0-9][0-9][E|W][0-9][0-9][0-9]";
+   ossimString regularExp2 = "[E|W][0-9][0-9][0-9][N|S][0-9][0-9]";
+   ossimRegExp regEx;
+   bool latLonOrderFlag = true;
+   bool foundFlag = false;
+   f = f.upcase();
+
+   regEx.compile(regularExp1.c_str());
+   foundFlag = regEx.find(f.c_str());
+   if(!foundFlag)
+   {
+      regEx.compile(regularExp2.c_str());
+      foundFlag = regEx.find(f.c_str());
+      if(foundFlag)
+      {
+         latLonOrderFlag = false;
+         f = ossimFilename(ossimString(f.begin()+regEx.start(),
+                                       f.begin()+regEx.end()));
+      }
+   }
+   if(foundFlag)
+   {
+      f = ossimFilename(ossimString(f.begin()+regEx.start(),
+                                    f.begin()+regEx.end()));
+   }
+   if (f.size() != 7)
+   {
+      return false;
+   }
+//    ossimString s;
+
+   if(latLonOrderFlag)
+   {
+      
+//       s.push_back(f[1]);
+//       s.push_back(f[2]);
+      m_southwestLatitude = ossimString(f.begin()+1,
+                                         f.begin()+3).toDouble();//s.toDouble();
+      // Get the latitude.
+      if (f[static_cast<std::string::size_type>(0)] == 'S')
+      {
+         m_southwestLatitude *= -1;
+      }
+      else if (f[static_cast<std::string::size_type>(0)] != 'N')
+      {
+         return false; // Must be either 's' or 'n'.
+      }
+      // Get the longitude.
+//       s.clear();
+//       s.push_back(f[4]);
+//       s.push_back(f[5]);
+//       s.push_back(f[6]);
+      m_southwestLongitude = ossimString(f.begin()+4,
+                                          f.begin()+7).toDouble();//s.toDouble();
+      if (f[static_cast<std::string::size_type>(3)] == 'W')
+      {
+      m_southwestLongitude *= -1;
+      }
+      else if (f[static_cast<std::string::size_type>(3)] != 'E')
+      {
+         return false; // Must be either 'e' or 'w'.
+      }
+   }
+   else
+   {
+      // Get the longitude.
+//       s.clear();
+//       s.push_back(f[1]);
+//       s.push_back(f[2]);
+//       s.push_back(f[3]);
+      m_southwestLongitude =  ossimString(f.begin()+1,
+                                           f.begin()+4).toDouble();//s.toDouble();
+      if (f[static_cast<std::string::size_type>(0)] == 'W')
+      {
+      m_southwestLongitude *= -1;
+      }
+      else if (f[static_cast<std::string::size_type>(0)] != 'E')
+      {
+         return false; // Must be either 'e' or 'w'.
+      }
+//       s.clear();
+      
+//       s.push_back(f[5]);
+//       s.push_back(f[6]);
+      m_southwestLatitude = ossimString(f.begin()+5,
+                                         f.begin()+7).toDouble();//s.toDouble();
+      // Get the latitude.
+      if (f[static_cast<std::string::size_type>(4)] == 'S')
+      {
+         m_southwestLatitude *= -1;
+      }
+      else if (f[static_cast<std::string::size_type>(4)] != 'N')
+      {
+         return false; // Must be either 's' or 'n'.
+      }
+   }
+   
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSrtmSupportData::setCornerPoints(): leaving with true..."
+         << std::endl;
+   }
+   return true;
+}
+
+bool ossimSrtmSupportData::setSize()
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSrtmSupportData::setSize(): entered..." << std::endl;
+   }
+
+   if(m_str->is_open() == false)
+   {
+      m_str = ossimStreamFactoryRegistry::instance()->createIFStream(
+         m_file, std::ios_base::in | std::ios_base::binary);
+   }
+   
+   if (!m_str)
+   {
+      return false;
+   }
+
+   if(m_str->fail())
+   {
+      return false;
+   }
+   
+   ossim_float64 size = 0.0;
+   m_str->seekg(0, std::ios::beg);
+
+#if 0 /* tmp drb */
+   if(m_str->isCompressed())
+   {
+      ossimFilename tmp = m_file;
+      tmp.setExtension("hgt");
+      if(!tmp.exists())
+      {
+         ossimOFStream out(tmp.c_str(),
+                           std::ios::out|std::ios::binary);
+
+         if(!out.fail())
+         {
+            bool done = false;
+            char buf[1024];
+            while(!done&&!m_str->fail())
+            {
+               m_str->read(buf, 1024);
+               if(m_str->gcount() < 1024)
+               {
+                  done = true;
+               }
+               if(m_str->gcount() > 0)
+               {
+                  out.write(buf, m_str->gcount());
+               }
+            }
+            out.close();
+            size = tmp.fileSize();
+            tmp.remove();
+         }
+      }
+   }
+   else
+   {
+      size = m_file.fileSize();
+   }
+#endif /* tmp drb */
+   
+   size = m_file.fileSize();
+   if (!size)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimSrtmSupportData::setSize(): leaving with false at line "
+            << __LINE__ << std::endl;
+      }
+      return false;
+   }
+
+   m_scalarType = OSSIM_SCALAR_UNKNOWN;
+   
+   //---
+   // Assuming square for now.  Have to check the spec for this.
+   //---
+   if (size == 25934402) // 2 * 3601 * 3601 three arc second
+   {
+      m_numberOfLines     = 3601;
+      m_numberOfSamples   = 3601;
+      m_scalarType = OSSIM_SINT16;
+   }
+   else if(size == 51868804) // 4*3601*3601
+   {
+      m_numberOfLines   = 3601;
+      m_numberOfSamples = 3601;
+      m_scalarType = OSSIM_FLOAT32;
+   }
+   else if (size == 2884802) // 2 * 1201 * 1201 one arc second
+   {
+      m_numberOfLines   = 1201;
+      m_numberOfSamples = 1201;
+      m_scalarType = OSSIM_SINT16;
+   }
+   else if (size == 5769604)
+   {
+      m_numberOfLines   = 1201;
+      m_numberOfSamples = 1201;
+      m_scalarType = OSSIM_FLOAT32;
+   }
+   else // try to get a square width and height
+   {
+      ossim_uint64 lines   = (ossim_uint64)sqrt((ossim_float64)(size / 2));
+      ossim_uint64 samples = (ossim_uint64)sqrt((ossim_float64)(size / 2));
+      // check square
+      if(lines*samples*2 == size)
+      {
+         m_numberOfLines   = lines;
+         m_numberOfSamples = samples;
+         m_scalarType = OSSIM_SINT16;
+         
+      }
+      else
+      {
+         ossim_uint64 lines   = (ossim_uint64)sqrt((ossim_float64)(size / 4));
+         ossim_uint64 samples = (ossim_uint64)sqrt((ossim_float64)(size / 4));
+         // check square
+         if(lines*samples*4 == size)
+         {
+            m_numberOfLines   = lines;
+            m_numberOfSamples = samples;
+            m_scalarType = OSSIM_FLOAT32;
+         }
+         else
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ossimSrtmSupportData::setSize(): leaving with false at line " << __LINE__ << std::endl;
+            }
+            return false;
+         }
+      }
+   }
+      
+   m_latSpacing      = 1.0 / (m_numberOfLines   - 1);
+   m_lonSpacing      = 1.0 / (m_numberOfSamples - 1);
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimSrtmSupportData::setSize(): leaving with true..."
+         << std::endl;
+   }
+
+   m_str->close();
+   
+   return true;
+}
+
+bool ossimSrtmSupportData::computeMinMax()
+{
+   if(m_scalarType == OSSIM_FLOAT32)
+   {
+      return computeMinMaxTemplate((ossim_float32)0,
+                                   -32768.0);
+   }
+   return computeMinMaxTemplate((ossim_sint16)0,
+                                -32768.0);
+}
+
+template <class T>
+bool ossimSrtmSupportData::computeMinMaxTemplate(T /* dummy */,
+                                                 double defaultNull)
+{
+   if(m_str->is_open() == false)
+   {
+      m_str =
+         ossimStreamFactoryRegistry::instance()->createIFStream(
+            m_file,
+            std::ios_base::in | std::ios_base::binary);
+   }
+   
+   if (!m_str)
+   {
+      return false;
+   }
+
+   if(m_str->fail())
+   {
+      return false;
+   }
+   
+   const size_t BYTES_IN_LINE = m_numberOfSamples * 2;
+   const T NULL_PIX = (T)defaultNull;
+
+   double minValue = 1.0/FLT_EPSILON;
+   double maxValue = -1.0/FLT_EPSILON;
+   T* line_buf = new T[m_numberOfSamples];
+   char* char_buf = (char*)line_buf;
+   ossimEndian swapper;
+
+   ossimByteOrder endianType = ossim::byteOrder();
+   for (ossim_uint32 line = 0; line < m_numberOfLines; ++line)
+   {
+      m_str->read(char_buf, (std::streamsize)BYTES_IN_LINE);
+      if(endianType == OSSIM_LITTLE_ENDIAN)
+      {
+         swapper.swap(line_buf, m_numberOfSamples);
+      }
+      for (ossim_uint32 sample = 0; sample < m_numberOfSamples; ++sample)
+      {
+         if (line_buf[sample] == NULL_PIX) continue;
+         if (line_buf[sample] > maxValue) maxValue = line_buf[sample];
+         if (line_buf[sample] < minValue) minValue = line_buf[sample];
+      }
+   }
+   delete [] line_buf;
+   m_minPixelValue = minValue;
+   m_maxPixelValue = maxValue;
+
+   m_str->close();
+
+   return true;
+}
+
+ossim_float64 ossimSrtmSupportData::getMinPixelValue() const
+{
+   return m_minPixelValue;
+}
+
+ossim_float64 ossimSrtmSupportData::getMaxPixelValue() const
+{
+   return m_maxPixelValue;
+}
+
+ossimScalarType ossimSrtmSupportData::getScalarType()const
+{
+   return m_scalarType;
+}
+
+std::ostream& ossimSrtmSupportData::print(std::ostream& out) const
+{
+   out << std::setprecision(15) << "ossimSrtmSupportData data members:"
+       << "\nFile:                  " << m_file
+       << "\nLines:                 " << m_numberOfLines
+       << "\nSamples:               " << m_numberOfSamples
+       << "\nSouth West Latitude:   " << m_southwestLatitude
+       << "\nSouth West Longitude:  " << m_southwestLongitude
+       << "\nLatitude spacing:      " << m_latSpacing
+       << "\nLongitude spacing:     " << m_lonSpacing
+       << "\nMin post value:        " << m_minPixelValue
+       << "\nMax post value:        " << m_maxPixelValue
+       << std::endl;
+   return out;
+}
+
+
diff --git a/src/support_data/ossimSupportFilesList.cpp b/src/support_data/ossimSupportFilesList.cpp
new file mode 100644
index 0000000..3e4d1d0
--- /dev/null
+++ b/src/support_data/ossimSupportFilesList.cpp
@@ -0,0 +1,42 @@
+//**************************************************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Oscar Kramer
+// 
+// Description: Singleton class for logging all support data files opened during a session.
+//
+//**************************************************************************************************
+// $Id$
+
+#include <ossim/support_data/ossimSupportFilesList.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+ossimSupportFilesList* ossimSupportFilesList::m_instance = 0;
+
+//*************************************************************************************************
+// Implements singleton pattern
+//*************************************************************************************************
+ossimSupportFilesList* ossimSupportFilesList::instance()
+{
+   if (!m_instance)
+      m_instance = new ossimSupportFilesList;
+
+   return m_instance;
+}
+
+//*************************************************************************************************
+// Saves the list to a KWL
+//*************************************************************************************************
+void ossimSupportFilesList::save(ossimKeywordlist& kwl, const char* prefix) const
+{
+   ossimString baseName ("support_file");
+   for (unsigned int i=0; i< (unsigned int) m_list.size(); i++)
+   {
+      ossimString key = baseName + ossimString::toString(i);
+      kwl.add(prefix, key.chars(), m_list[i]);
+   }
+}
diff --git a/src/support_data/ossimTiffInfo.cpp b/src/support_data/ossimTiffInfo.cpp
new file mode 100644
index 0000000..6f7f989
--- /dev/null
+++ b/src/support_data/ossimTiffInfo.cpp
@@ -0,0 +1,4191 @@
+//----------------------------------------------------------------------------
+//
+// License: MIT
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: TIFF Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimTiffInfo.h>
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimGeoTiffCoordTransformsLut.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTieGptSet.h>
+#include <ossim/base/ossimTiffConstants.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <ossim/base/ossimIoStream.h>
+
+// Static trace for debugging
+static ossimTrace traceDebug("ossimTiffInfo:debug");
+static ossimTrace traceDump("ossimTiffInfo:dump"); // This will dump offsets.
+
+static const std::string PHOTO_INTERP[] =
+{
+   "MINISWHITE",
+   "MINISBLACK",
+   "RGB",
+   "PALETTE",
+   "MASK",
+   "SEPARATED",
+   "YCBCR",
+   "CIELAB"
+};
+
+static const std::string ANGULAR_UNITS_KW = "angular_units";
+static const std::string CENTER_LATITUDE__KW = "center_latitude";
+static const std::string CENTER_LONGITUDE_KW = "center_longitude";
+static const std::string COORD_TRANS_CODE_KW = "coord_trans_code";
+static const std::string FALSE_ORIGIN_LONGITUDE_KW = "false_origin_longitude";
+static const std::string FALSE_ORIGIN_LATITUDE_KW = "false_origin_latitude";
+static const std::string FALSE_ORIGIN_EASTING_KW = "false_origin_easting";
+static const std::string FALSE_ORIGIN_NORTHING_KW = "false_origin_northing";
+static const std::string GEODETIC_DATUM_KW = "geodetic_datum";
+static const std::string IMAGE_LENGTH_KW = "image_length";
+static const std::string IMAGE_WIDTH_KW = "image_width";
+static const std::string LINEAR_UNITS_KW = "linear_units";
+static const std::string MODEL_PIXEL_SCALE_KW = "model_pixel_scale";
+static const std::string MODEL_TIE_POINT_KW = "model_tie_point";
+static const std::string MODEL_TRANSFORM_KW = "model_transform";
+static const std::string MODEL_TYPE_KW = "model_type";
+static const std::string ORIGIN_LATITUDE_KW = "origin_latitude";
+static const std::string ORIGIN_LONGITUDE_KW = "origin_longitude";
+static const std::string RASTER_TYPE_KW = "raster_type";
+static const std::string VERTICAL_UNITS_KW = "vertical_units";
+
+
+ossimTiffInfo::ossimTiffInfo()
+   : ossimInfoBase(),
+     m_connectionString(),
+     m_endian(0)
+{
+}
+
+ossimTiffInfo::~ossimTiffInfo()
+{
+   if (m_endian)
+   {
+      delete m_endian;
+      m_endian = 0;
+   }
+}
+
+bool ossimTiffInfo::open(const ossimFilename& file)
+{
+   std::shared_ptr<ossim::istream> inStream = ossim::StreamFactoryRegistry::instance()->createIstream(file.c_str());
+   if(!inStream) return false;
+   return open(inStream, file.c_str());
+}
+
+bool ossimTiffInfo::open( std::shared_ptr<ossim::istream>& str,
+                          const std::string& connectionString )
+{
+   bool result = false;
+   
+   //---
+   // Open the tif file.
+   //---
+   //std::ifstream str(file.c_str(), std::ios_base::binary|std::ios_base::in);
+   if (str&&str->good()) 
+   {
+      //---
+      // Get the byte order.  First two byte should be "II" or "MM".
+      //---
+      char byteOrder[2];
+      str->read(byteOrder, 2); // Read the byte order.
+      ossimByteOrder sysByteOrder = ossim::byteOrder();
+      ossimByteOrder tifByteOrder = OSSIM_LITTLE_ENDIAN;
+      if (byteOrder[0] == 'M')
+      {
+         tifByteOrder = OSSIM_BIG_ENDIAN;
+      }
+
+      if (sysByteOrder != tifByteOrder)
+      {
+         if(!m_endian)
+         {
+            m_endian = new ossimEndian();
+         }
+      }
+      else if (m_endian)
+      {
+         delete m_endian;
+         m_endian = 0;
+      }
+      
+      //--
+      // Get the version. Note m_endian must be set/unset before calling
+      // "readShort".
+      //---
+      ossim_uint16 version;
+      readShort(version, *str);
+
+      if ( ( (byteOrder[0] == 'M') || (byteOrder[0] == 'I') ) &&
+           ( (version == 42) || (version == 43) ) )
+      {
+         result = true;  // is a tif...
+      }
+   }
+
+   if (result)
+   {
+      m_connectionString = connectionString;
+      m_inputStream = str;
+   }
+   else
+   {
+      m_connectionString.clear();
+      if (m_endian)
+      {
+         delete m_endian;
+         m_endian = 0;
+      }
+   }
+   return result;   
+}
+
+
+std::ostream& ossimTiffInfo::print(std::ostream& out) const
+{
+   static const char MODULE[] = "ossimTiffInfo::print";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG Entered...\n";
+   }
+   //---
+   // Open the tif file.
+   //---
+  // std::ifstream str(theFile.c_str(), std::ios_base::binary|std::ios_base::in);
+   if (!m_inputStream) 
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " Cannot open file:  " << m_connectionString << std::endl;
+      }
+      return out;
+   }
+   
+   //---
+   // Get the byte order.  First two byte should be "II" or "MM".
+   //---
+   char byteOrder[2];
+   m_inputStream->seekg(0);
+   m_inputStream->clear();
+
+   m_inputStream->read(byteOrder, 2); // Read the byte order.
+   ossimByteOrder sysByteOrder = ossim::byteOrder();
+   ossimByteOrder tifByteOrder = OSSIM_LITTLE_ENDIAN;
+   
+   if (byteOrder[0] == 'M')
+   {
+      tifByteOrder = OSSIM_BIG_ENDIAN;
+   }
+   if (sysByteOrder != tifByteOrder)
+   {
+      if(!m_endian)
+      {
+         m_endian = new ossimEndian();
+      }
+   }
+   else if (m_endian)
+   {
+      delete m_endian;
+      m_endian = 0;
+   }
+
+   //--
+   // Get the version. Note m_endian must be set/unset before calling
+   // "readShort".
+   //---
+   ossim_uint16 version;
+   readShort(version, *m_inputStream);
+
+   // Set the tag value length.
+   ossim_uint64 tagValueLength;
+   if (version == 42)
+   {
+      tagValueLength = 4;
+   }
+   else
+   {
+      tagValueLength = 8;
+   }
+
+   out << "tiff.version: " << int(version)
+       << ((version==42)?"(classic)\n":"(big)\n")
+       << "tiff.byte_order: ";
+   
+   if (byteOrder[0] == 'M')
+   {
+      out << "big_endian\n";
+   }
+   else // OSSIM_LITTLE_ENDIAN
+   {
+      out  << "little_endian\n";
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "system_byte_order: ";
+      if (ossim::byteOrder() == OSSIM_BIG_ENDIAN)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)<< "big_endian\n";
+      }
+      else // OSSIM_LITTLE_ENDIAN
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)<< "little_endian\n";
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "tiff.tag_value_length: " << tagValueLength << "\n";
+   }
+
+   //---
+   // Variables used within the loop.
+   //---
+   std::streamoff seekOffset;      // used throughout
+   std::streampos streamPosition;  // used throughout
+
+   if (version == 43)
+   {
+      // We must skip the first four bytes.
+      ossim_uint32 offsetSize;
+      readLong(offsetSize, *m_inputStream);
+   }
+
+   // Get the offset.
+   if (getOffset(seekOffset, *m_inputStream, version) == false)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) 
+        << MODULE << " FATAL ERROR - "
+        << "No offset to an image file directory found.\n"
+        << "Returning with error."
+        << std::endl;
+      return out;
+   }
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG: "
+         << "Offset to first ifd:  " << seekOffset
+         << "\n";
+   }
+
+   // Capture the original flags then set float output to full precision.
+   std::ios_base::fmtflags f = out.flags();
+   out << std::setprecision(15);
+   
+   // Image File Directory (IFD) loop.
+   ossim_int32 ifdIndex = 0;
+   while(seekOffset)
+   {
+      out << "tiff.directory_offset: " << seekOffset << "\n";
+
+      // Seek to the image file directory.
+      m_inputStream->seekg(seekOffset, std::ios_base::beg);  
+
+      // directory prefix for prints.
+      std::string prefix = "tiff.";
+      getDirPrefix(ifdIndex, prefix);
+
+      //---
+      // Things we need to save for printGeoKeys:
+      //---
+      ossim_uint16*  geoKeyBlock     = 0;
+      ossim_uint64   geoKeyLength    = 0;
+      ossim_float64* geoDoubleBlock  = 0;
+      ossim_uint64   geoDoubleLength = 0;
+      ossim_int8*    geoAsciiBlock   = 0;
+      ossim_uint64   geoAsciiLength  = 0;
+      
+      //---
+      // Get the number of directories within the IFD.
+      //---
+      ossim_uint64 nTags; // Number of tags in an IFD.
+      if (getValue(nTags, *m_inputStream, TWO_OR_EIGHT, version) == false)
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " FATAL error reading number of direcories."
+               << std::endl;
+         }
+         m_inputStream.reset();
+         return out;
+      }
+
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG:\n"
+            << "ifd:  " << seekOffset
+            << "\ntags in directory:  " << nTags<< "\n";
+      }
+
+      // Tag loop:
+      for (ossim_uint64 tagIdx = 0; tagIdx < nTags; ++tagIdx)
+      {
+         // Variables used within the loop.
+         ossim_uint16   tag              = 0; // Tag number
+         ossim_uint16   type             = 0; // Type(short, long...)
+         ossim_uint64   count            = 0;
+         ossim_uint64   arraySizeInBytes = 0; // 
+         ossim_uint8*   valueArray       = 0; // To hold value.
+         
+         //---
+         // Get the tag.
+         //---
+         readShort(tag, *m_inputStream);
+         if (!m_inputStream->good())
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " FATAL error reading tag number."
+                  << std::endl;
+            }
+            return out;
+         }
+
+         //---
+         // Get the type (byte, ascii, short...)
+         //---
+         readShort(type, *m_inputStream);
+         if (!m_inputStream->good())
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " FATAL error reading type number."
+                  << std::endl;
+            }
+            m_inputStream.reset();
+            return out;
+         }
+
+         //---
+         // Get the count.  This is not in bytes.  It is based on the
+         // type.  So if the type is a short and the count is one then
+         // read "sizeof(short"(2) bytes.
+         //---
+         getValue(count, *m_inputStream, FOUR_OR_EIGHT, version);
+         if (!m_inputStream->good())
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " FATAL error reading count."
+                  << std::endl;
+            }
+            m_inputStream.reset();
+            return out;
+         }
+
+         // Get the array size in bytes.
+         arraySizeInBytes = getArraySizeInBytes(count, type);
+         if (arraySizeInBytes == 0)
+         {
+            // Could be an unhandle type.  Gobble the value.
+            eatValue(*m_inputStream, version);
+         }
+         else
+         {
+            // Allocate array.
+            if (valueArray) delete [] valueArray;
+            valueArray = new ossim_uint8[arraySizeInBytes];
+
+            if (arraySizeInBytes <= tagValueLength)
+            {
+               // Read in the value(s).
+               m_inputStream->read((char*)valueArray, arraySizeInBytes);
+
+               // Skip any byes left in the field.
+               if (arraySizeInBytes < tagValueLength)
+               {
+                  // Skip these bytes.
+                  m_inputStream->ignore(tagValueLength-arraySizeInBytes);
+               }
+            }
+            else // Data to big for field.  Stored elsewhere...
+            {
+               // Get the offset to the data.
+               getOffset(seekOffset, *m_inputStream, version);
+
+               // Capture the seek position to come back to.
+               streamPosition = m_inputStream->tellg();
+
+               // Seek to the data.
+               m_inputStream->seekg(seekOffset, std::ios_base::beg);
+
+               // Read in the value(s).
+               m_inputStream->read((char*)valueArray, arraySizeInBytes);
+
+               // Seek back.
+               m_inputStream->seekg(streamPosition);
+            }
+
+            // Swap the bytes if needed.
+            swapBytes(valueArray, type, count);
+         }
+
+         if( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << MODULE << " DEBUG:"
+               << "\ntag[" << tagIdx << "]:" << tag
+               << "\ntype:                " << type
+               << "\ncount:        " << count
+               << "\narray size in bytes: " << arraySizeInBytes
+               << "\n";
+	 }
+
+         if (tag == ossim::OGEO_KEY_DIRECTORY_TAG)
+         {
+            // tag 34735 save for printGeoKeys
+            if ( geoKeyBlock )
+            {
+               delete [] geoKeyBlock;
+            }
+            geoKeyBlock = reinterpret_cast<ossim_uint16*>(valueArray);
+            geoKeyLength = count;
+         }
+         else if (tag == ossim::OGEO_DOUBLE_PARAMS_TAG)
+         {
+            // tag 34736 save for printGeoKeys
+            if ( geoDoubleBlock )
+            {
+               delete [] geoDoubleBlock;
+            }
+            geoDoubleBlock  = reinterpret_cast<ossim_float64*>(valueArray);
+            geoDoubleLength = count;
+         }
+         else if (tag == ossim::OGEO_ASCII_PARAMS_TAG)
+         {
+            // tag 34737 save for printGeoKeys
+            if ( geoAsciiBlock )
+            {
+               delete [] geoAsciiBlock;
+            }
+            geoAsciiBlock   = reinterpret_cast<ossim_int8*>(valueArray);
+            geoAsciiLength  = count;
+         }
+         else
+         {
+            print(out,
+                  prefix,
+                  tagIdx,
+                  tag,
+                  type,
+                  count,
+                  arraySizeInBytes,
+                  valueArray);
+            
+            // Free memory if allocated...
+            if (valueArray)
+            {
+               delete [] valueArray;
+               valueArray = 0;
+            }
+         }
+         
+      } // End of tag loop.
+
+      //---
+      // If Geotiff Keys read them.
+      // This had to done last since the keys could
+      // have references to tags GEO_DOUBLE_PARAMS_TAG and
+      // GEO_ASCII_PARAMS_TAG.
+      //---
+      if (geoKeyBlock)
+      {
+         printGeoKeys(out, prefix, geoKeyLength, geoKeyBlock,
+                      geoDoubleLength,geoDoubleBlock,
+                      geoAsciiLength,geoAsciiBlock);
+
+         delete [] geoKeyBlock;
+         geoKeyBlock = 0;
+      }
+
+      if (geoDoubleBlock)
+      {
+         delete [] geoDoubleBlock;
+         geoDoubleBlock = 0;
+      }
+      if (geoAsciiBlock)
+      {
+         delete [] geoAsciiBlock;
+         geoAsciiBlock = 0;
+      }
+      geoKeyLength = 0;
+      geoDoubleLength = 0;
+      geoAsciiLength = 0;
+
+      //---
+      // Get the next IFD offset.  Continue this loop until the offset is
+      // zero.
+      //---
+      if (getOffset(seekOffset, *m_inputStream, version) == false)
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " No offset to an image file directory found.\n"
+               << "Returning with error."
+               << std::endl;
+         }
+         m_inputStream.reset();
+         return out;
+      }
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimTiffInfo::readTags: "
+            << "Next Image File Directory(IFD) offset = "
+            << seekOffset << "\n";
+      }
+
+      ++ifdIndex; // next ifd
+
+      //---
+      // Note this does NOT check to see if sub_file_type is '1' simply
+      // skips all directories past the first if theOverviewFlag is false.
+      //---
+      if ( ifdIndex && !theOverviewFlag) // Don't process overviews...
+      {
+         break;
+      }
+      
+   } // End of loop through the IFD's.
+   
+   out << std::endl;
+    
+   m_inputStream.reset();
+
+   // Reset flags.
+   out.setf(f);
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG Exited..." << std::endl;
+   }
+   
+   return out;
+}
+
+std::ostream& ossimTiffInfo::print(std::istream& inStr,
+                                   std::ostream& outStr) const
+{
+   static const char MODULE[] = "ossimTiffInfo::print(std::istream&, std::ostream&)";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " DEBUG Entered...\n";
+   }
+
+   std::streampos startPosition = inStr.tellg();
+   
+   //---
+   // Get the byte order.  First two byte should be "II" or "MM".
+   //---
+   char byteOrder[2];
+   inStr.read(byteOrder, 2); // Read the byte order.
+   ossimByteOrder sysByteOrder = ossim::byteOrder();
+   ossimByteOrder tifByteOrder = OSSIM_LITTLE_ENDIAN;
+   if (byteOrder[0] == 'M')
+   {
+      tifByteOrder = OSSIM_BIG_ENDIAN;
+   }
+   
+   if (sysByteOrder != tifByteOrder)
+   {
+      if (!m_endian)
+      {
+         m_endian = new ossimEndian();
+      }
+   }
+   else if (m_endian) // No swapping required.
+   {
+      delete m_endian;
+      m_endian = 0;
+   }
+
+   //--
+   // Get the version. Note m_endian must be set/unset before calling
+   // "readShort".
+   //---
+   ossim_uint16 version;
+   readShort(version, inStr);
+
+   // Set the tag value length.
+   ossim_uint64 tagValueLength;
+   if (version == 42)
+   {
+      tagValueLength = 4;
+   }
+   else
+   {
+      tagValueLength = 8;
+   }
+
+   outStr << "tiff.version: " << int(version)
+          << ((version==42)?"(classic)\n":"(big)\n")
+          << "tiff.byte_order: ";
+   
+   if (byteOrder[0] == 'M')
+   {
+      outStr << "big_endian\n";
+   }
+   else // OSSIM_LITTLE_ENDIAN
+   {
+      outStr  << "little_endian\n";
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "system_byte_order: ";
+      if (ossim::byteOrder() == OSSIM_BIG_ENDIAN)
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)<< "big_endian\n";
+      }
+      else // OSSIM_LITTLE_ENDIAN
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)<< "little_endian\n";
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "tiff.tag_value_length: " << tagValueLength << "\n";
+   }
+
+   //---
+   // Variables used within the loop.
+   //---
+   std::streamoff seekOffset;      // used throughout
+   std::streampos streamPosition;  // used throughout
+
+   if (version == 43)
+   {
+      // We must skip the first four bytes.
+      ossim_uint32 offsetSize;
+      readLong(offsetSize, inStr);
+   }
+
+   // Get the offset.
+   if (getOffset(seekOffset, inStr, version) == false)
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) 
+            << MODULE << " FATAL ERROR - "
+            << "No offset to an image file directory found.\n"
+            << "Returning with error."
+            << std::endl;
+      }
+      return outStr;
+   }
+   
+   if (traceDebug())
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << MODULE << " DEBUG: "
+            << "Offset to first ifd:  " << seekOffset
+            << "\n";
+      }
+   }
+
+   // Capture the original flags then set float output to full precision.
+   std::ios_base::fmtflags f = outStr.flags();
+   outStr << std::setprecision(15);
+   
+   // Image File Directory (IFD) loop.
+   ossim_int32 ifdIndex = 0;
+   while(seekOffset)
+   {
+      outStr << "tiff.directory_offset: " << seekOffset << "\n";
+
+      // Seek to the image file directory.
+      inStr.seekg(startPosition+seekOffset, std::ios_base::beg);  
+
+      // directory prefix for prints.
+      std::string prefix = "tiff.";
+      getDirPrefix(ifdIndex, prefix);
+
+      //---
+      // Things we need to save for printGeoKeys:
+      //---
+      ossim_uint16*  geoKeyBlock     = 0;
+      ossim_uint64   geoKeyLength    = 0;
+      ossim_float64* geoDoubleBlock  = 0;
+      ossim_uint64   geoDoubleLength = 0;
+      ossim_int8*    geoAsciiBlock   = 0;
+      ossim_uint64   geoAsciiLength  = 0;
+      
+      //---
+      // Get the number of directories within the IFD.
+      //---
+      ossim_uint64 nTags; // Number of tags in an IFD.
+      if (getValue(nTags, inStr, TWO_OR_EIGHT, version) == false)
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " FATAL error reading number of direcories."
+               << std::endl;
+         }
+         return outStr;
+      }
+
+      if (traceDebug())
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << MODULE << " DEBUG:\n"
+               << "ifd:  " << seekOffset
+               << "\ntags in directory:  " << nTags<< "\n";
+         }
+      }
+
+      // Tag loop:
+      for (ossim_uint64 tagIdx = 0; tagIdx < nTags; ++tagIdx)
+      {
+         // Variables used within the loop.
+         ossim_uint16   tag              = 0; // Tag number
+         ossim_uint16   type             = 0; // Type(short, long...)
+         ossim_uint64   count            = 0;
+         ossim_uint64   arraySizeInBytes = 0; // 
+         ossim_uint8*   valueArray       = 0; // To hold value.
+         
+         //---
+         // Get the tag.
+         //---
+         readShort(tag, inStr);
+         if (!inStr)
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " FATAL error reading tag number."
+                  << std::endl;
+            }
+            return outStr;
+         }
+
+         //---
+         // Get the type (byte, ascii, short...)
+         //---
+         readShort(type, inStr);
+         if (!inStr)
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " FATAL error reading type number."
+                  << std::endl;
+            }
+            return outStr;
+         }
+
+         //---
+         // Get the count.  This is not in bytes.  It is based on the
+         // type.  So if the type is a short and the count is one then
+         // read "sizeof(short"(2) bytes.
+         //---
+         getValue(count, inStr, FOUR_OR_EIGHT, version);
+         if (!inStr)
+         {
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << MODULE << " FATAL error reading count."
+                  << std::endl;
+            }
+            return outStr;
+         }
+
+         // Get the array size in bytes.
+         arraySizeInBytes = getArraySizeInBytes(count, type);
+         if (arraySizeInBytes == 0)
+         {
+            // Could be an unhandle type.  Gobble the value.
+            eatValue(inStr, version);
+         }
+         else
+         {
+            // Allocate array.
+            if (valueArray) delete [] valueArray;
+            valueArray = new ossim_uint8[arraySizeInBytes];
+
+            if (arraySizeInBytes <= tagValueLength)
+            {
+               // Read in the value(s).
+               inStr.read((char*)valueArray, arraySizeInBytes);
+
+               // Skip any byes left in the field.
+               if (arraySizeInBytes < tagValueLength)
+               {
+                  // Skip these bytes.
+                  inStr.ignore(tagValueLength-arraySizeInBytes);
+               }
+            }
+            else // Data to big for field.  Stored elsewhere...
+            {
+               // Get the offset to the data.
+               getOffset(seekOffset, inStr, version);
+
+               // Capture the seek position to come back to.
+               streamPosition = inStr.tellg();
+
+               // Seek to the data.
+               inStr.seekg(startPosition+seekOffset, std::ios_base::beg);
+
+               // Read in the value(s).
+               inStr.read((char*)valueArray, arraySizeInBytes);
+
+               // Seek back.
+               inStr.seekg(streamPosition);
+            }
+
+            // Swap the bytes if needed.
+            swapBytes(valueArray, type, count);
+         }
+
+         if( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << MODULE << " DEBUG:"
+               << "\ntag[" << tagIdx << "]:" << tag
+               << "\ntype:                " << type
+               << "\ncount:        " << count
+               << "\narray size in bytes: " << arraySizeInBytes
+               << "\n";
+         }
+
+         if (tag == ossim::OGEO_KEY_DIRECTORY_TAG)
+         {
+            // tag 34735 save for printGeoKeys
+            geoKeyBlock = reinterpret_cast<ossim_uint16*>(valueArray);
+            geoKeyLength = count;
+         }
+         else if (tag == ossim::OGEO_DOUBLE_PARAMS_TAG)
+         {
+            // tag 34736 save for printGeoKeys
+            geoDoubleBlock  = reinterpret_cast<ossim_float64*>(valueArray);
+            geoDoubleLength = count;
+         }
+         else if (tag == ossim::OGEO_ASCII_PARAMS_TAG)
+         {
+            // tag 34737 save for printGeoKeys
+            geoAsciiBlock   = reinterpret_cast<ossim_int8*>(valueArray);
+            geoAsciiLength  = count;
+         }
+         else
+         {
+            print(outStr,
+                  prefix,
+                  tagIdx,
+                  tag,
+                  type,
+                  count,
+                  arraySizeInBytes,
+                  valueArray);
+            
+            // Free memory if allocated...
+            if (valueArray)
+            {
+               delete [] valueArray;
+               valueArray = 0;
+            }
+         }
+         
+      } // End of tag loop.
+
+      //---
+      // If Geotiff Keys read them.
+      // This had to done last since the keys could
+      // have references to tags GEO_DOUBLE_PARAMS_TAG and
+      // GEO_ASCII_PARAMS_TAG.
+      //---
+      if (geoKeyBlock)
+      {
+         printGeoKeys(outStr, prefix, geoKeyLength, geoKeyBlock,
+                      geoDoubleLength,geoDoubleBlock,
+                      geoAsciiLength,geoAsciiBlock);
+
+         delete [] geoKeyBlock;
+         geoKeyBlock = 0;
+      }
+
+      if (geoDoubleBlock)
+      {
+         delete [] geoDoubleBlock;
+         geoDoubleBlock = 0;
+      }
+      if (geoAsciiBlock)
+      {
+         delete [] geoAsciiBlock;
+         geoAsciiBlock = 0;
+      }
+      geoKeyLength = 0;
+      geoDoubleLength = 0;
+      geoAsciiLength = 0;
+
+      //---
+      // Get the next IFD offset.  Continue this loop until the offset is
+      // zero.
+      //---
+      if (getOffset(seekOffset, inStr, version) == false)
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << MODULE << " No offset to an image file directory found.\n"
+               << "Returning with error."
+               << std::endl;
+         }
+         return outStr;
+      }
+      
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "DEBUG ossimTiffInfo::readTags: "
+            << "Next Image File Directory(IFD) offset = "
+            << seekOffset << "\n";
+      }
+
+      ++ifdIndex; // next ifd
+
+      //---
+      // Note this does NOT check to see if sub_file_type is '1' simply
+      // skips all directories past the first if theOverviewFlag is false.
+      //---
+      if ( ifdIndex && !theOverviewFlag) // Don't process overviews...
+      {
+         break;
+      }
+      
+   } // End of loop through the IFD's.
+   
+   outStr << std::endl;
+    
+   // Reset flags.
+   outStr.setf(f);
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " DEBUG Exited..." << std::endl;
+   }
+   
+   return outStr;
+}
+
+bool ossimTiffInfo::getImageGeometry(ossimKeywordlist& geomKwl,
+                                     ossim_uint32 entryIndex) const
+{
+   static const char MODULE[] = "ossimTiffInfo::getImageGeometry #1";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << " entered...\n";
+   }
+   
+   bool result = false;
+
+   // Open the file.
+  // std::ifstream str;
+  // m_inputStream->open(theFile.c_str(), ios::in | ios::binary);
+   
+   if ( m_inputStream->good() )
+   {
+      m_inputStream->seekg(0);
+      m_inputStream->clear();
+      result = getImageGeometry(*m_inputStream, geomKwl, entryIndex);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "geomKwl:\n"
+         << geomKwl
+         << MODULE << " exit status = " << (result?"true":"false") << "\n";
+   }
+
+   return result;
+}
+
+bool ossimTiffInfo::getImageGeometry(std::istream& inStr,
+                                     ossimKeywordlist& geomKwl,
+                                     ossim_uint32 entryIndex) const
+{
+   static const char M[] = "ossimTiffInfo::getImageGeometry #2";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+   
+   bool result = false;
+
+   // Do a print to a memory stream.
+   std::ostringstream out;
+   print(inStr, out);
+
+   // Open an input stream to pass to the keyword list.
+   std::istringstream in( out.str() );
+
+   // Since the print is in key:value format we can pass to a keyword list.
+   ossimKeywordlist gtiffKwl;
+   if ( gtiffKwl.parseStream(in) )      
+   {
+      result = getImageGeometry(gtiffKwl, geomKwl, entryIndex);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "geomKwl:\n"
+         << geomKwl
+         << M << " exit status = " << (result?"true":"false") << "\n";
+   }
+
+   return result;
+}
+
+void ossimTiffInfo::getImageGeometry(ossim_uint64   geoKeyLength,
+                                     ossim_uint16*  geoKeyBlock,
+                                     ossim_uint64   geoDoubleLength,
+                                     ossim_float64* geoDoubleBlock,
+                                     ossim_uint64   geoAsciiLength,
+                                     ossim_int8*    geoAsciiBlock,
+                                     ossimKeywordlist& geomKwl) const
+{
+   static const char M[] = "ossimTiffInfo::getImageGeometry #3";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+
+   // Dump the geotiff keys to memory.
+   ostringstream out;
+   printGeoKeys(out, std::string("tiff.image0."),
+                geoKeyLength, geoKeyBlock,
+                geoDoubleLength,geoDoubleBlock,
+                geoAsciiLength,geoAsciiBlock);
+
+   // Open an input stream to pass to the keyword list.
+   std::istringstream in( out.str() );
+
+   // Since the print is in key:value format we can pass to a keyword list.
+   ossimKeywordlist gtiffKwl;
+   if ( gtiffKwl.parseStream(in) )
+   {
+      getImageGeometry(gtiffKwl, geomKwl, 0);
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+}
+
+// Private method:
+bool ossimTiffInfo::getImageGeometry(const ossimKeywordlist& gtiffKwl,
+                                     ossimKeywordlist& geomKwl,
+                                     ossim_uint32 entryIndex) const
+{
+   static const char M[] = "ossimTiffInfo::getImageGeometry #4";
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+   
+   //---
+   // Start with a return status of true and set to false if something bad
+   // happens.
+   //---
+   bool result = true;
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "tiffinfo dump to kwl:\n" << gtiffKwl << "\n";
+   }
+   
+   ossimString gtiffPrefix = "tiff.image";
+   gtiffPrefix += ossimString::toString(entryIndex);
+   gtiffPrefix += ".";
+   ossimString geomPrefix = "image";
+   geomPrefix += ossimString::toString(entryIndex);
+   geomPrefix += ".";
+   
+   // Get the pixel type.
+   ossimString pixelType;
+   if ( getPixelType(gtiffPrefix, gtiffKwl, pixelType) == false )
+   {
+      pixelType = "pixel_is_point"; // Not an error we'll make assumption?
+   }
+   geomKwl.add(geomPrefix.c_str(),
+               ossimKeywordNames::PIXEL_TYPE_KW,
+               pixelType.c_str());
+   
+   // Get the lines.
+   ossim_uint32 height = getLines(gtiffPrefix, gtiffKwl);
+   if (height)
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::NUMBER_LINES_KW,
+                  height);
+   }
+   else
+   {
+      result = false;
+   }
+   
+   // Get the samples.
+   ossim_uint32 width = getSamples(gtiffPrefix, gtiffKwl);
+   if (width)
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::NUMBER_SAMPLES_KW,
+                  width);
+   }
+   else
+   {
+      result = false;
+   }
+   
+   // Add the pixel type.
+   geomKwl.add(geomPrefix.c_str(),
+               ossimKeywordNames::PIXEL_TYPE_KW,
+               pixelType.c_str());
+   
+   // Set the projection type.
+   bool isGeographic = false;
+   ossimString pcsCode;
+   ossimString ossimProjectionName = "";
+   bool hasPcsCode = getPcsCode(gtiffPrefix, gtiffKwl, pcsCode);
+
+   //---
+   // The ossimEpsgProjectionFactory will not pick up the origin latitude if code is
+   // 4326 (geographic) so we use the projection name; else, the origin_latitude will
+   // always be 0.  This is so the gsd comes out correct for scale.
+   //---
+   if ( hasPcsCode && ( pcsCode != "4326" ) )
+   {
+      // Add the pcs code.
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::PCS_CODE_KW,
+                  pcsCode.c_str());
+   }
+   else
+   {
+      if ( getOssimProjectionName(gtiffPrefix, gtiffKwl, ossimProjectionName) == false )
+      {
+         ossimProjectionName = "ossimEquDistCylProjection";
+      }
+      geomKwl.add(geomPrefix.c_str(), ossimKeywordNames::TYPE_KW, ossimProjectionName);
+
+      if ( ossimProjectionName == "ossimEquDistCylProjection" )
+      {
+         isGeographic = true;
+      }
+   }
+   
+   // Get the units. 
+   ossimString units = "";
+   getUnits(gtiffPrefix, gtiffKwl, units);
+   if (units.empty() || (units.contains("unknown")))
+   {
+      // HACK: Encountered JP2 with geotiff info that did not specify units, so using projection
+      // type to discern units if none explicitly specified. (OLK 05/11)
+      if (ossimProjectionName == "ossimEquDistCylProjection")
+         units = "degrees";
+   }
+   
+   // Get the pixel scale.
+   ossimDpt scale;
+   bool hasScale = getPixelScale(gtiffPrefix, gtiffKwl, scale);
+   
+   // Get the tie point.
+   std::vector<ossim_float64> ties;
+   getTiePoint(gtiffPrefix, gtiffKwl, ties);
+
+   //---
+   // Tie count:
+   // NOTE: It takes six doubles to make one tie point ie:
+   // x,y,z,longitude,latitude,height or x,y,z,easting,northing,height
+   //--- 
+   ossim_uint32 tieCount = (ossim_uint32)ties.size()/6;
+   
+   // Get the model transform.
+   std::vector<ossim_float64> xfrm;
+   getModelTransform(gtiffPrefix, gtiffKwl, xfrm);
+   
+   bool useXfrm = false;
+   if ( xfrm.size() == 16 )
+   {
+      // Need at least 24 (which is four ties) to use bilinear.
+      if ( !hasScale && ties.size() < 24 )
+      {
+         useXfrm = true;
+      }
+   }
+   if (useXfrm)
+   {
+      std::ostringstream out;
+      out << std::setprecision(15); // To avoid truncating.
+      ossim_uint32 idx = 0;
+      for(idx =0; idx < 16; ++idx)
+      {
+         out << xfrm[idx] << " ";
+      }
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::IMAGE_MODEL_TRANSFORM_MATRIX_KW,
+                  out.str().c_str(), true);
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::IMAGE_MODEL_TRANSFORM_UNIT_KW,
+                  units.c_str(), true);
+   }
+   else // Use tie points.
+   {
+      if ( hasScale && (tieCount == 1) )
+      {
+         // Shift the tile to 0,0 pixel of image if not already there.
+         ossimDpt tie;
+         tie.x = ties[3] - ties[0] * scale.x;
+         tie.y = ties[4] + ties[1] * scale.y;
+         geomKwl.add(geomPrefix.c_str(),
+                     ossimKeywordNames::TIE_POINT_XY_KW,
+                     tie.toString().c_str());
+         geomKwl.add(geomPrefix.c_str(),
+                     ossimKeywordNames::TIE_POINT_UNITS_KW,
+                     units.c_str());
+         
+         // Add the scale.
+         geomKwl.add(geomPrefix.c_str(),
+                     ossimKeywordNames::PIXEL_SCALE_XY_KW,
+                     scale.toString().c_str());
+         geomKwl.add(geomPrefix.c_str(),
+                     ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
+                     units.c_str());
+      }
+      else if (tieCount > 1) // four or better tie points.
+      {
+         ossimTieGptSet tieSet;
+         getTieSets(ties, width, height, tieSet);
+         
+         if(tieCount >= 4)
+         {
+            ossimRefPtr<ossimBilinearProjection> proj =
+               new ossimBilinearProjection;
+            proj->optimizeFit(tieSet);
+            proj->saveState(geomKwl, geomPrefix.c_str());
+            if(traceDebug())
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "Creating a bilinear projection\n";
+            }
+         }
+         else  // Need at least four ties.
+         {
+            result = false;
+         }
+      }
+      else
+      {
+         result = false;
+      }
+      
+   } // matches: else Use tie points block.
+   
+   ossimString tmpStr;
+   if ( getStdParallelOne(gtiffPrefix, gtiffKwl, tmpStr) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::STD_PARALLEL_1_KW,
+                  tmpStr);
+   }
+   
+   if ( getStdParallelTwo(gtiffPrefix, gtiffKwl, tmpStr) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::STD_PARALLEL_2_KW,
+                  tmpStr);
+   }
+   
+   ossimDpt eastingNorthing;
+   if ( getFalseEastingNorthing(gtiffPrefix, gtiffKwl,
+                                eastingNorthing) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::FALSE_EASTING_NORTHING_KW,
+                  eastingNorthing.toString());
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::
+                  FALSE_EASTING_NORTHING_UNITS_KW, units);
+   }
+   
+   ossim_float64 tmpDbl = ossim::nan();
+   
+   if ( getOriginLat(gtiffPrefix, gtiffKwl, tmpDbl) == false )
+   {
+      if ( isGeographic && hasScale && scale.x )
+      {
+         //---
+         // ossimEquDistCylProjection uses the origin_latitude for meters per pixel (gsd)
+         // computation.  So is not set in tiff tags, compute to achieve the proper
+         // horizontal scaling.
+         //---
+         tmpDbl = ossim::acosd(scale.y/scale.x);
+      }
+   }
+   if ( !ossim::isnan(tmpDbl) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::ORIGIN_LATITUDE_KW,
+                  tmpDbl);
+   }
+   
+   if ( getCentralMeridian(gtiffPrefix, gtiffKwl, tmpDbl) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::CENTRAL_MERIDIAN_KW,
+                  tmpDbl);
+   }
+   
+   if ( getScaleFactor(gtiffPrefix, gtiffKwl, tmpDbl) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::SCALE_FACTOR_KW,
+                  tmpDbl);
+   }
+   
+   if ( getDatumCode(gtiffPrefix, gtiffKwl, tmpStr) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  ossimKeywordNames::DATUM_KW,
+                  tmpStr.c_str());
+   }
+
+   //---
+   // Linear and vertical units not read by projection factories but added so external user could
+   // query.
+   //---
+   if ( getLinearUnits(gtiffPrefix, gtiffKwl, tmpStr) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  LINEAR_UNITS_KW.c_str(),
+                  tmpStr.c_str());
+   }
+
+   if ( getVerticalUnits(gtiffPrefix, gtiffKwl, tmpStr) )
+   {
+      geomKwl.add(geomPrefix.c_str(),
+                  VERTICAL_UNITS_KW.c_str(),
+                  tmpStr.c_str());
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "geomKwl:\n"
+         << geomKwl << "\n"
+         << M << " exit status = " << (result?"true":"false") << "\n";
+   }
+   
+   return result;
+}
+
+void ossimTiffInfo::readShort(ossim_uint16& s, std::istream& str) const
+{
+   str.read((char*)&s, sizeof(s));
+   if (m_endian)
+   {
+      m_endian->swap(s);
+   }
+}
+
+void ossimTiffInfo::readLong(ossim_uint32& l, std::istream& str) const
+{
+   str.read((char*)&l, sizeof(l));
+   if (m_endian)
+   {
+      m_endian->swap(l);
+   }
+}
+
+void ossimTiffInfo::readLongLong(ossim_uint64& l, std::istream& str) const
+{
+   str.read((char*)&l, sizeof(l));
+   if (m_endian)
+   {
+      m_endian->swap(l);
+   }
+}
+
+
+
+bool ossimTiffInfo::getOffset(
+   std::streamoff& offset, std::istream& str, ossim_uint16 version) const
+{
+   bool status = true;
+   if  (version == 42)
+   {
+      ossim_uint32   littleOffset;
+      readLong(littleOffset, str);
+      offset = littleOffset;
+   }
+   else
+   {
+      ossim_uint64 bigOffset;
+      readLongLong(bigOffset, str);
+      offset = bigOffset;
+   }
+   if (!str)
+   {
+      status = false;
+   }
+   return status;
+}
+
+bool ossimTiffInfo::getValue(ossim_uint64& value,
+                             std::istream& str,
+                             WordType type,
+                             ossim_uint16 version) const
+{
+   bool status = true;
+   if  (version == 42)
+   {
+      if (type == TWO_OR_EIGHT)
+      {
+         ossim_uint16 i;
+         readShort(i, str);
+         value = i;
+      }
+      else
+      {
+         ossim_uint32 i;
+         readLong(i, str);
+         value = i;
+      }
+   }
+   else
+   {
+      ossim_uint64 i;
+      readLongLong(i, str);
+      value = i;
+   }
+   if (!str)
+   {
+      status = false;
+   }
+   return status;
+}
+
+ossim_uint64 ossimTiffInfo::getArraySizeInBytes(ossim_uint64 length,
+                                                ossim_uint16 type) const
+{
+   return length * getTypeByteSize(type);
+}
+
+ossim_uint16 ossimTiffInfo::getTypeByteSize(ossim_uint16 type) const
+{
+   ossim_uint16 result = 0;
+   
+   switch (type)
+   {
+      case ossim::OTIFF_BYTE:
+      case ossim::OTIFF_ASCII:
+      case ossim::OTIFF_SBYTE:
+      case ossim::OTIFF_UNDEFINED:
+      {
+         result = 1;
+         break;
+      }
+         
+      case ossim::OTIFF_SHORT:
+      case ossim::OTIFF_SSHORT:
+      {
+         result = 2;
+         break;
+      }
+         
+      case ossim::OTIFF_LONG:
+      case ossim::OTIFF_SLONG:
+      case ossim::OTIFF_IFD:
+      case ossim::OTIFF_FLOAT:
+      {
+         result = 4;
+         break;
+      }
+         
+      case ossim::OTIFF_RATIONAL:
+      case ossim::OTIFF_SRATIONAL:
+      case ossim::OTIFF_DOUBLE:
+      case 16:             // TIFF_LONG8 defined in big tiff only.
+      case 17:             // TIFF_SLONG8 defined in big tiff only.
+      case 18:             // TIFF_IFD8 defined in big tiff only.
+      {
+         result = 8;
+         break;
+      }
+
+      default:
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimTiffInfo::getTypeByteSize DEBUG:"
+               << "\nUnhandled type: " << int(type) << "\n";
+         }
+         break;
+      }
+   }
+   return result;
+}
+
+void ossimTiffInfo::eatValue(std::istream& str, ossim_uint16 version) const
+{
+   if (version == 42)
+   {
+      ossim_uint32 dummy;
+      readLong(dummy, str);
+   }
+   else
+   {
+      ossim_uint64 dummy;
+      readLongLong(dummy, str);
+   }
+}
+
+void ossimTiffInfo::swapBytes(ossim_uint8* v,
+                              ossim_uint16 type,
+                              ossim_uint64 count) const
+{
+   if (m_endian)
+   {
+      ossim_uint32 byteSize = getTypeByteSize(type);
+      switch(byteSize)
+      {
+         case 2:
+            m_endian->swapTwoBytes(v, count);
+            break;
+         case 4:
+            m_endian->swapFourBytes(v, count);
+            break;
+         case 8:
+            m_endian->swapEightBytes(v, count);
+            break;
+         default:
+            break;
+      }
+   }
+}
+
+template <class T> void ossimTiffInfo::getArrayValue(
+   T& v,
+   ossim_uint8* array,
+   ossim_uint64 position) const
+{
+   T* p = (T*)array;
+   v = p[position];
+}
+
+std::ostream& ossimTiffInfo::print(std::ostream& out,
+                                   const std::string& prefix,
+                                   ossim_uint64 tagIdx,
+                                   ossim_uint16 tag,
+                                   ossim_uint16 type,
+                                   ossim_uint64 count,
+                                   ossim_uint64 arraySizeInBytes,
+                                   ossim_uint8* valueArray) const
+{
+   switch(tag)
+   {
+      case ossim::OTIFFTAG_SUBFILETYPE: // tag 254
+      {
+         out << prefix << "sub_file_type: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      case ossim::OTIFFTAG_IMAGEWIDTH: // tag 256
+      {
+         out << prefix << IMAGE_WIDTH_KW << ": ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      
+      case ossim::OTIFFTAG_IMAGELENGTH: // tag 257
+      {
+         out << prefix << IMAGE_LENGTH_KW << ": ";
+         printValue(out, type, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_BITSPERSAMPLE: // tag 258
+      {
+         out << prefix << "bits_per_sample: ";
+         if (count == 1)
+         {
+            printValue(out, type, valueArray);
+         }
+         else if (valueArray)
+         {
+            printArray(out, type, count, valueArray);
+         }
+         break;
+      }
+         
+      case ossim::OTIFFTAG_COMPRESSION: // tag 259
+      {
+         if ( (count == 1) && (type == ossim::OTIFF_SHORT) )
+         {
+            out << prefix << "compression: ";
+            
+            ossim_uint16 s;
+            getArrayValue(s, valueArray, 0);
+            if (s == 1)
+            {
+               out << "false\n";
+            }
+            else
+            {
+               out << "true\n";
+            }
+         }
+         break;
+      }
+
+      case ossim::OTIFFTAG_PHOTOMETRIC: // tag 262
+      {
+         out << prefix << "photo_interpretation: ";
+
+         if ( (count == 1) && (type == ossim::OTIFF_SHORT) )
+         {
+            ossim_uint16 s;
+            getArrayValue(s, valueArray, 0);
+            if (s <= ossim::OPHOTO_CIELAB)
+            {
+               out << PHOTO_INTERP[s] << "\n";
+            }
+            else
+            {
+               out <<"range error!\n";
+            }
+         }
+         break;
+      }
+
+      case ossim::OTIFFTAG_FILLORDER: // tag 266
+      {
+         if ( (count == 1) && (type == ossim::OTIFF_SHORT) )
+         {
+            out << prefix << "fill_order: ";
+            ossim_uint16 s;
+            getArrayValue(s, valueArray, 0);
+            out << s << "\n";
+
+         }
+         break;
+      }
+
+      case ossim::OTIFFTAG_IMAGEDESCRIPTION: // tag 270
+      {
+         out << prefix << "image_description: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_MAKE: // tag 271
+      {
+         out << prefix << "make: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+      
+      case ossim::OTIFFTAG_MODEL: // tag 272
+      {
+         out << prefix << "model: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_STRIPOFFSETS: // tag 273
+      {
+         if (traceDump())
+         {
+            out << prefix << "bytes_per_strip: ";
+            
+            if (count == 1)
+            {
+               printValue(out, type, valueArray);
+            }
+            else
+            {
+               printArray(out, type, count, valueArray);
+            }
+         }
+         break;
+      }
+      case ossim::OTIFFTAG_ORIENTATION: // tag 274
+      {
+         ossim_uint16 code;
+         getArrayValue(code, valueArray, 0);
+         printOrientation(out, prefix, code);
+         break;
+      }
+      
+      case ossim::OTIFFTAG_SAMPLESPERPIXEL: // tag 277
+      {
+         out << prefix << "samples_per_pixel: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_ROWSPERSTRIP: // tag 278
+      {
+         out << prefix << "rows_per_strip: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_STRIPBYTECOUNTS: // tag 279
+      {
+         if (traceDump())
+         {
+            out << prefix << "bytes_per_strip: ";
+            
+            if (count == 1)
+            {
+               printValue(out, type, valueArray);
+            }
+            else
+            {
+               printArray(out, type, count, valueArray);
+            }
+         }
+         break;
+      }
+      
+      case ossim::OTIFFTAG_MINSAMPLEVALUE: // tag 280
+      {
+         out << prefix << "min_sample_value: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      case ossim::OTIFFTAG_MAXSAMPLEVALUE: // tag 281
+      {
+         out << prefix << "max_sample_value: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      
+      case ossim::OTIFFTAG_XRESOLUTION: // tag 282
+      {
+         out << prefix << "xresolution: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      case ossim::OTIFFTAG_YRESOLUTION: // tag 283
+      {
+         out << prefix << "yresolution: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      
+      case ossim::OTIFFTAG_PLANARCONFIG: // tag 284
+      {
+         if ( (count == 1) && (type == ossim::OTIFF_SHORT) )
+         {
+            out << prefix << "planar_configuration: ";
+            ossim_uint16 v;
+            getArrayValue(v, valueArray, 0);
+            if (v == 1)
+            {
+               out << "single image plane\n";
+            }
+            else if (v == 2)
+            {
+               out << "separate image planes\n";
+            }
+            else
+            {
+               out << "unknown planar value!\n";
+            }
+         }
+         break;
+      }
+
+      case ossim::OTIFFTAG_RESOLUTIONUNIT: // tag 296
+      {
+         out << prefix << "resolution_units: ";
+         ossim_uint16 v;
+         getArrayValue(v, valueArray, 0);
+         if (v == 2) 
+         {
+            out << "inch\n";
+         }
+         else if (v == 3)
+         {
+            out << "cm\n";
+         }
+         else
+         {
+            out << "none\n";
+         }
+         break;
+      }
+
+      case ossim::OTIFFTAG_PAGENUMBER: // tag 297
+      {
+         if ( (count == 2) && (type == ossim::OTIFF_SHORT) )
+         {
+            out << prefix << "page_number: ";
+            ossim_uint16 s;
+            getArrayValue(s, valueArray, 0);
+            out << s << "\n";
+            out << prefix << "total_pages: ";
+            getArrayValue(s, valueArray, 1);
+            out << s << "\n";
+         }
+         break;
+      }
+      
+      case ossim::OTIFFTAG_SOFTWARE: // tag 305
+      {
+         out << prefix << "software: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_DATETIME: // tag 306
+      {
+         out << prefix << "date_time: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_ARTIST: // tag 315
+      {
+         out << prefix << "artist: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_PREDICTOR: // tag 317
+      {
+         out << prefix << "predictor: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      
+      case ossim::OTIFFTAG_TILEWIDTH: // tag 322
+      {
+         out << prefix << "tile_width: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      case ossim::OTIFFTAG_TILELENGTH: // tag 323
+      {
+         out << prefix << "tile_length: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      case ossim::OTIFFTAG_TILEOFFSETS: // tag 324
+      {
+         if (traceDump())
+         {
+            out << prefix << "tile_offsets: ";
+            if (count == 1)
+            {
+               printValue(out, type, valueArray);
+            }
+            else
+            {
+               printArray(out, type, count, valueArray);
+            }
+         }
+         break;
+      }
+      case ossim::OTIFFTAG_TILEBYTECOUNTS: // tag 325
+      {
+         if (traceDump())
+         {
+            out << prefix << "tile_byte_counts: ";
+            if (count == 1)
+            {
+               printValue(out, type, valueArray);
+            }
+            else
+            {
+               printArray(out, type, count, valueArray);
+            }
+         }
+         break;
+      }
+      case ossim::OTIFFTAG_SUBIFD: // tag 330
+      {
+         if ( (count == 1) && (type == ossim::OTIFF_IFD8) )
+         {
+            out << prefix << "subimage_descriptor: ";
+            ossim_uint64 v;
+            getArrayValue(v, valueArray, 0);
+            out << v << "\n";
+         }
+         else
+         {
+            out << prefix << "tag 330 unhandled condition.\n";
+         }
+         break;
+      }
+      case ossim::OTIFFTAG_EXTRASAMPLES: // tag 338
+      {
+         out << prefix << "extra_samples: ";
+         ossim_uint16 v;
+         getArrayValue(v, valueArray, 0);
+         switch (v)
+         {
+            case 1:
+            {
+               out << "associated_alpha_data\n";
+               break;
+            }
+            case 2:
+            {
+               out << "unassociated_alpha_data\n";
+               break;
+            }
+            default:
+            {
+               out << "unspecified_data\n";
+               break;
+            }
+         }
+         break;
+      }
+      case ossim::OTIFFTAG_SAMPLEFORMAT: // tag 339
+      {
+         out << prefix << "sample_format: ";
+         
+         if (count == 1)
+         {
+            printValue(out, type, valueArray);
+         }
+         else if (valueArray)
+         {
+            printArray(out, type, count, valueArray);
+         }
+         for (ossim_uint64 i = 0; i < count; ++i)
+         {
+            std::ostringstream s;
+            s << "sample_format_string";
+            if (count > 1)
+            {
+               s << i;
+            }
+            out << prefix << s.str() << ": ";
+            
+            ossim_uint16 v;
+            getArrayValue(v, valueArray, i);
+            switch (v)
+            {
+               case ossim::OSAMPLEFORMAT_UINT:
+                  out << "unsigned integer data\n";
+                  break;
+               case ossim::OSAMPLEFORMAT_INT:
+                  out << "signed integer data\n";
+                  break;
+               case ossim::OSAMPLEFORMAT_IEEEFP:
+                  out << "IEEE floating point data\n";
+                  break;
+               case ossim::OSAMPLEFORMAT_COMPLEXINT:
+                  out << "complex signed int\n";
+                  break;
+               case ossim::OSAMPLEFORMAT_COMPLEXIEEEFP:
+                  out << "complex ieee floating\n";
+                  break;
+               case ossim::OSAMPLEFORMAT_VOID:
+               default:
+                  out << "untyped data\n";
+                  break;
+            }
+         }
+         break;
+      }
+      case ossim::OTIFFTAG_SMINSAMPLEVALUE: // tag 340
+      {
+         out << prefix << "smin_sample_value: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+      case ossim::OTIFFTAG_SMAXSAMPLEVALUE: // tag 341
+      {
+         out << prefix << "smax_sample_value: ";
+         printValue(out, type, valueArray);
+         break;
+      }
+
+      case ossim::OTIFFTAG_XMLPACKET: // tag 700
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << prefix << "xml: ";
+            printArray(ossimNotify(ossimNotifyLevel_DEBUG),
+                       ossim::OTIFF_BYTE, count, valueArray);
+         }
+         printXmpMetadata(out, prefix, count, valueArray);
+         break;
+      }
+      
+      case ossim::OTIFFTAG_COPYRIGHT: // tag 33432
+      {
+         out << prefix << "copyright: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+      case ossim::OMODEL_PIXEL_SCALE_TAG: // tag 33550
+      {
+         out << prefix << MODEL_PIXEL_SCALE_KW << ": ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+      case ossim::OMODEL_TIE_POINT_TAG: // tag 33992
+      {
+         out << prefix << MODEL_TIE_POINT_KW << ": ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+      case ossim::OMODEL_TRANSFORM_TAG: // tag 34264
+      {
+         out << prefix << MODEL_TRANSFORM_KW << ": ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+      case ossim::OTIFFTAG_PHOTOSHOP:  // tag 34377
+      {
+         out << prefix << "photoshop_image_resource_blocks: found\n";
+         break;
+      }
+      case ossim::OGEO_DOUBLE_PARAMS_TAG: // tag 34736
+      {
+         out << prefix << "double_params: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+      case ossim::OGEO_ASCII_PARAMS_TAG: // tag 34737
+      {
+         out << prefix << "ascii_params: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+      case ossim::OGDAL_METADATA_TAG: // tag  42112
+      {
+         printGdalMetadata(out, prefix, count, valueArray);
+         break;
+      }
+      case ossim::OGDAL_NODATA: // tag 42113
+      {
+         out << prefix << "gdal_nodata: ";
+         printArray(out, type, count, valueArray);
+         break;
+      }
+
+      case ossim::ORPC_COEFFICIENT_TAG: // tag 50844
+      {
+         printRpcs(out, prefix, type, count, valueArray);
+         break;
+      }
+      
+      default:
+      {
+         out << prefix << "unhandled_tag: " << tag << "\n";
+         if (traceDebug())
+         {
+             ossimNotify(ossimNotifyLevel_DEBUG)
+                << "generic:"
+                << "\ntag[" << tagIdx << "]:         " << tag
+                << "\ntype:                " << type
+                << "\ncount:        " << count
+                << "\narray size in bytes: " << arraySizeInBytes
+                << "\n";
+            printArray(out, type, count, valueArray);
+         }
+         break;
+      }
+
+   } // end of switch on tag...
+
+   return out;
+
+} // end of print
+
+std::ostream& ossimTiffInfo::printValue(std::ostream& out,
+                                        ossim_uint16 type,
+                                        ossim_uint8* valueArray) const
+{
+   switch (type)
+   {
+      case ossim::OTIFF_BYTE:
+      {
+         ossim_uint8 v;
+         getArrayValue(v, valueArray, 0);
+         out << (ossim_uint16)v << "\n";
+         break;
+      }
+      case ossim::OTIFF_SHORT:
+      {
+         ossim_uint16 v;
+         getArrayValue(v, valueArray, 0);
+         out << v << "\n";
+         break;
+      }
+      case ossim::OTIFF_SSHORT:
+      {
+         ossim_sint16 v;
+         getArrayValue(v, valueArray, 0);
+         out << v << "\n";
+         break;
+      }
+      case ossim::OTIFF_LONG:
+      {
+         ossim_uint32 v;
+         getArrayValue(v, valueArray, 0);
+         out << v << "\n";
+         break;
+      }
+      case ossim::OTIFF_RATIONAL: // two longs first=numerator, second=denominator
+      {
+         ossim_uint32 num;
+         ossim_uint32 den;
+         
+         getArrayValue(num, valueArray, 0);
+         getArrayValue(den, valueArray, 1);
+
+         if ( den )
+         {
+            out << (num/den) << "\n";
+         }
+         else
+         {
+            out << num << " / " << den << "\n";
+         }
+         
+         break;
+         
+      }
+      case ossim::OTIFF_SLONG:
+      {
+         ossim_sint32 v;
+         getArrayValue(v, valueArray, 0);
+         out << v << "\n";
+         break;
+      }
+      case ossim::OTIFF_FLOAT:
+      {
+         ossim_float32 v;
+         getArrayValue(v, valueArray, 0);
+         out << v << "\n";
+         break;
+      }
+      case ossim::OTIFF_DOUBLE:
+      {
+         ossim_float64 v;
+         getArrayValue(v, valueArray, 0);
+         out << v << "\n";
+         break;
+      }
+      default:
+      {
+         out << "print_value_unhandled type: " << type << "\n";
+         break;
+      }
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printArray(std::ostream& out,
+                                        ossim_uint16 type,
+                                        ossim_uint64 arraySizeInBytes,
+                                        ossim_uint8* valueArray) const
+{
+   if (valueArray)
+   {
+      switch (type)
+      {
+         case ossim::OTIFF_BYTE:
+         {
+            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
+            {
+               out << ((ossim_uint8)valueArray[i]);
+            }
+            out << "\n";
+            break;
+         }
+         case ossim::OTIFF_ASCII:
+         {
+            //---
+            // Add tripple quotes front and back for ossimKeywordlist to handle multi-line
+            // comments.
+            //---
+            out << "\"\"\"";
+            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
+            {
+               //---
+               // Test to avoid putting nulls in the ascii string out.  Added to fix
+               // ossimKeywordlist::parseStream returning false on trailing null Where array was
+               // tagged as 11 bytes and ascii string was OrthoVista(10 bytes) and 11 byte was
+               // ascii NUL '\0'.
+               //---
+               if ( valueArray[i] != 0 )
+               {
+                  out << ((char)valueArray[i]);
+               }
+            }
+            out << "\"\"\"\n";
+            break;
+         }
+         case ossim::OTIFF_SHORT:
+         {
+            ossim_uint16* p = (ossim_uint16*)valueArray;
+            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
+            {
+               out << p[i] << " ";
+            }
+            out << "\n";
+            break;
+         }
+         case ossim::OTIFF_LONG:
+         {
+            ossim_uint32* p = (ossim_uint32*)valueArray;
+            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
+            {
+               out << p[i] << " ";
+            }
+            out << "\n";
+            break;
+         }
+         case ossim::OTIFF_LONG8:
+         {
+            ossim_uint64* p = (ossim_uint64*)valueArray;
+            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
+            {
+               out << p[i] << " ";
+            }
+            out << "\n";
+            break;
+         }
+         case ossim::OTIFF_DOUBLE:
+         {
+            ossim_float64* p = (ossim_float64*)valueArray;
+            for (ossim_uint64 i = 0; i < arraySizeInBytes; ++i)
+            {
+               out << p[i] << " ";
+            }
+            out << "\n";
+            break;
+         }
+         default:
+         {
+            out << "print_array_unhandled type: " << type << "\n";
+            break;
+         }
+      }
+   }
+   else
+   {
+      out << "null array passed to ossimTiffInfo::printArray method." << "\n";
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printGdalMetadata(std::ostream& out,
+                                               const std::string& prefix,
+                                               ossim_uint64 count,
+                                               ossim_uint8* valueArray) const
+{
+   ossimString xmlString(valueArray, valueArray+count);
+   ossimRefPtr<ossimXmlNode> xmlNode = new ossimXmlNode();
+   std::istringstream in(xmlString);
+   if(xmlNode->read(in))
+   {
+      const ossimXmlNode::ChildListType& children = xmlNode->getChildNodes();
+      
+      ossim_uint32 idx = 0;
+      for(idx = 0; idx < children.size(); ++idx)
+      {
+         out << prefix << "gdalmetadata."
+             << ossimString(children[idx]->getAttributeValue("name")).downcase()
+             << ":" << children[idx]->getText() << std::endl;
+      }
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printXmpMetadata(std::ostream& out,
+                                              const std::string& prefix,
+                                              ossim_uint64 count,
+                                              ossim_uint8* valueArray) const
+{
+   ossimString xmlString(valueArray, valueArray+count);
+   ossimRefPtr<ossimXmlNode> xmlNode = new ossimXmlNode();
+   std::istringstream in(xmlString);
+
+   ossimRefPtr<ossimXmlDocument> xdoc = new ossimXmlDocument();
+
+   // Read the xml document:
+   if ( xdoc->read( in ) )
+   {
+      std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
+
+      // Wavelength:
+      ossimString path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:CentralWavelength";
+      ossimString result;
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.central_wavelength: " << result << "\n";
+            }
+         }
+      }
+
+      xnodes.clear();
+      path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:BandName";
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.band_name: " << result << "\n";
+            }
+         }
+      }
+
+      xnodes.clear();
+      path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:WavelengthFWHM";
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.wavelength_fwhm: " << result << "\n";
+            }
+         }
+      }
+
+      xnodes.clear();
+      path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:BandSensitivity";
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.band_sensitivity: " << result << "\n";
+            }
+         }
+      }
+
+      xnodes.clear();
+      path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:RigCameraIndex";
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.rig_camera_index: " << result << "\n";
+            }
+         }
+      }
+
+      xnodes.clear();
+      path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:Yaw";
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.yaw: " << result << "\n";
+            }
+         }
+      }     
+
+      xnodes.clear();
+      path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:Pitch";
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.pitch: " << result << "\n";
+            }
+         }
+      }
+
+      xnodes.clear();
+      path = "/x:xmpmeta/rdf:RDF/rdf:Description/Camera:Roll";
+      xdoc->findNodes(path, xnodes);
+      if ( xnodes.size() == 1 ) // Error if more than one.
+      {
+         if ( xnodes[0].valid() )
+         {
+            result = xnodes[0]->getText();
+            if ( result.size() )
+            {
+               out << prefix << "xmp.camera.roll: " << result << "\n";
+            }
+         }
+      }
+   }
+   
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printGeoKeys(
+   std::ostream& out,
+   const std::string&  prefix,
+   ossim_uint64   geoKeyLength,
+   ossim_uint16*  geoKeyBlock,
+   ossim_uint64   geoDoubleLength,
+   ossim_float64* geoDoubleBlock,
+   ossim_uint64   geoAsciiLength,
+   ossim_int8*    geoAsciiBlock) const
+{
+   if (geoKeyLength && geoKeyBlock)
+   {
+      //---
+      // Length passed in is the total number of shorts in the geo key
+      // directory.  Each key has four short values; hence, "length/4".
+      //---
+      ossim_int32 index = 0;
+      ossim_int32 tagCount = static_cast<ossim_int32>(geoKeyLength/4);
+      for (ossim_int32 i = 0; i < tagCount; ++i)
+      {
+         //---
+         // Each key contains four unsigned shorts:
+         // GeoKey ID
+         // TIFF Tag ID or 0
+         // GeoKey value count
+         // value or tag offset
+         //---
+         ossim_uint16 key   = geoKeyBlock[index++];
+         ossim_uint16 tag   = geoKeyBlock[index++];
+         ossim_uint16 count = geoKeyBlock[index++];
+         ossim_uint16 code  = geoKeyBlock[index++];
+
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "DEBUG  ossimTiffInfo::printGeoKeys"
+               << "\nKey index:  " << i
+               << "\ngeo key:  " << key
+               << "\ntag:      " << tag
+               << "\ncount:    " << count
+               << "\ncode:     " << code
+               << "\n";
+         }
+
+         //---
+         // NOTE: Add tripple quotes front and back of ascii blocks for
+         // ossimKeywordlist to handle multi-line comments.
+         //---
+         
+         switch (key)
+         {
+            case ossim::OGT_MODEL_TYPE_GEO_KEY:  // key 1024 Section 6.3.1.1 Codes
+            {
+               printModelType(out, prefix, code);
+               break;
+            }               
+            case ossim::OGT_RASTER_TYPE_GEO_KEY:  // key 1025 Section 6.3.1.2 Code
+            {
+               printRasterType(out, prefix, code);
+               break;
+            }
+
+            case ossim::OGT_CITATION_GEO_KEY: // key 1026
+            {
+               if (tag == 34737) // using ascii array
+               {
+                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
+                  {
+                     std::string s;
+                     int i = 0;
+                     while (i < count)
+                     {
+                        s.push_back(geoAsciiBlock[code+i]);
+                        ++i;
+                     }
+                     out << prefix << "citation: \"\"\"" << s << "\"\"\"\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OGEOGRAPHIC_TYPE_GEO_KEY:  // key 2048  Section 6.3.2.1 Codes
+            {
+               out << prefix << ossimKeywordNames::GCS_CODE_KW << ": "
+                   << code << "\n";
+               break;
+            }
+
+            case ossim::OGEOG_CITATION_GEO_KEY: // key 2049
+            {
+               if (tag == 34737) // using ascii array
+               {
+                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
+                  {
+                     std::string s;
+                     int i = 0;
+                     while (i < count)
+                     {
+                        s.push_back(geoAsciiBlock[code+i]);
+                        ++i;
+                     }
+                     out << prefix << "geographic_citation: \"\"\"" << s << "\"\"\"\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OGEOG_GEODETIC_DATUM_GEO_KEY:// key 2050 Section 6.3.2.2 Codes
+            {
+               out << prefix << GEODETIC_DATUM_KW << ": " << code << "\n";
+               break;
+            }
+
+            case ossim::OGEOG_PRIME_MERIDIAN_GEOKEY:// key 2051 Section 6.3.2.4 Codes
+            {
+               out << prefix << "prime_meridian_code: " << code << "\n";
+               break;
+            }
+            
+            case ossim::OGEOG_LINEAR_UNITS_GEO_KEY:// key 2052  Section 6.3.1.3 Codes
+            {
+               out << prefix << "linear_units_code: " << code << "\n";
+               printLinearUnits(out, prefix, LINEAR_UNITS_KW, code);
+               break;
+            }
+            
+            case ossim::OGEOG_ANGULAR_UNITS_GEO_KEY:// key 2054  Section 6.3.1.4 Codes
+            {
+               out << prefix << "angular_units_code: " << code << "\n";
+               printAngularUnits(out, prefix, code);
+               break;
+            }
+
+            case ossim::OGEOG_ANGULAR_UNIT_SIZE_GEO_KEY:// key 2055 Size in radians Section 6.2.2
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && (code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "angular_units_size_radians: "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+            
+            case ossim::OGEOG_ELLIPSOID_GEO_KEY:// key 2056  Section 6.3.23 Codes
+            {
+               out << prefix << "ellipsoid_code: " << code << "\n";
+               break;
+            }
+            
+            case ossim::OGEOG_SEMI_MAJOR_AXIS: // key 2057
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && (code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "semi_major_axis: " << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+            
+            case ossim::OGEOG_SEMI_MINOR_AXIS: // key 2058
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "semi_minor_axis: "  << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OGEOG_INV_FLATTENING_GEO_KEY: // key 2059 ratio Section 6.2.2
+            {
+               if (tag == 34736) // using double array
+               {  
+                  // Code is index into array.
+                  if ( geoDoubleBlock && (code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "inverse_flattening_ratio: " << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OGEOG_PRIME_MERIDIAN_LONG_GEO_KEY: // key 2061 GeogAngularUnit Section 6.2.2
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && (code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "prime_meridian_longitude: " << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OPROJECTED_CS_TYPE_GEO_KEY: // key 3072 Section 6.3.3.1 codes
+            {
+               out << prefix << "pcs_code: " << code << "\n";
+               break;
+            }
+
+            case ossim::OPCS_CITATION_GEO_KEY: // key 3073 ascii
+            {
+               if (tag == 34737) // using ascii array
+               {
+                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
+                  {
+                     std::string s;
+                     int i = 0;
+                     while (i < count)
+                     {
+                        s.push_back(geoAsciiBlock[code+i]);
+                        ++i;
+                     }
+                     out << prefix << "pcs_citation: \"\"\"" << s << "\"\"\"\n";
+                  }
+               }
+               
+               break;
+            }
+      
+            case ossim::OPROJECTION_GEO_KEY: // key 3074 Section 6.3.3.2 codes
+            {
+               out << prefix << "proj_code: " << code << "\n";
+               break;
+            }
+            
+            case ossim::OPROJ_COORD_TRANS_GEO_KEY:  // key 3075 Section 6.3.3.3 codes
+            {
+               out << prefix << COORD_TRANS_CODE_KW << ": " << code << "\n";
+               printCoordTrans(out, prefix, code);
+               break;
+            }
+         
+            case ossim::OPROJ_LINEAR_UNITS_GEO_KEY:  // key 3076 Section 6.3.1.3 codes
+            {
+               out << prefix << "linear_units_code: " << code << "\n";
+               printLinearUnits(out, prefix, std::string("linear_units"), code);
+               break;
+            }
+
+            case ossim::OPROJ_LINEAR_UNIT_SIZE_GEO_KEY:  // key 3077 meters Section 6.2.3
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "linear_units_size: " << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OPROJ_STD_PARALLEL1_GEO_KEY:  // key 3078
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && (code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         << ossimKeywordNames::STD_PARALLEL_1_KW << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+         
+            case ossim::OPROJ_STD_PARALLEL2_GEO_KEY:  // key 3079
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         << ossimKeywordNames::STD_PARALLEL_2_KW << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+         
+            case ossim::OPROJ_NAT_ORIGIN_LONG_GEO_KEY:  // key 3080
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << ORIGIN_LONGITUDE_KW << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+               
+            case ossim::OPROJ_NAT_ORIGIN_LAT_GEO_KEY:  // key 3081
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << ORIGIN_LATITUDE_KW << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OPROJ_FALSE_EASTING_GEO_KEY:  // key 3082
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         << ossimKeywordNames::FALSE_EASTING_KW<< ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OPROJ_FALSE_NORTHING_GEO_KEY:  // key 3083
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         << ossimKeywordNames::FALSE_NORTHING_KW
+                         << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+            
+            case ossim::OPROJ_FALSE_ORIGIN_LONG_GEO_KEY:  // key 3084
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         << FALSE_ORIGIN_LONGITUDE_KW << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+            
+            case ossim::OPROJ_FALSE_ORIGIN_LAT_GEO_KEY:  // key 3085
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         << FALSE_ORIGIN_LATITUDE_KW << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+            
+            case ossim::OPROJ_FALSE_ORIGIN_EASTING_GEO_KEY:  // key 3086
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         <<  FALSE_ORIGIN_EASTING_KW<< ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+            
+            case ossim::OPROJ_FALSE_ORIGIN_NORTHING_GEO_KEY:  // key 3087
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix
+                         <<  FALSE_ORIGIN_NORTHING_KW<< ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+           
+            case ossim::OPROJ_CENTER_LONG_GEO_KEY:  // key 3088
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "center_longitude: "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OPROJ_CENTER_LAT_GEO_KEY:  // key 3089
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << "center_latitude: "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OPROJ_SCALE_AT_NAT_ORIGIN_GEO_KEY:  // key 3092
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << ossimKeywordNames::SCALE_FACTOR_KW
+                         << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+            case ossim::OPROJ_SCALE_AT_CENTER_GEO_KEY:  // key 3093
+            {
+               if (tag == 34736) // using double array
+               {
+                  // Code is index into array.
+                  if ( geoDoubleBlock && ( code < geoDoubleLength) )
+                  {
+                     // Always count of one.
+                     out << prefix << ossimKeywordNames::SCALE_FACTOR_KW
+                         << ": "
+                         << geoDoubleBlock[code] << "\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OVERTICAL_CITATION_GEO_KEY: // key 4097
+            {               
+               if (tag == 34737) // using ascii array
+               {
+                  if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
+                  {
+                     std::string s;
+                     int i = 0;
+                     while (i < count)
+                     {
+                        s.push_back(geoAsciiBlock[code+i]);
+                        ++i;
+                     }
+                     out << prefix << "vertical_citation: \"\"\"" << s << "\"\"\"\n";
+                  }
+               }
+               break;
+            }
+
+            case ossim::OVERTICAL_UNITS_GEO_KEY: // key 4099  Section 6.3.1.3 Codes
+            {
+               out << prefix << "vertical_units_code: " << code << "\n";
+               printLinearUnits(out, prefix, VERTICAL_UNITS_KW, code);
+               break;
+            }
+ 
+            default:
+            {
+               if (key > 1)
+               {
+                  if (tag == 34737) // using ascii array
+                  {
+                     if (geoAsciiBlock && ( (code+count) <= geoAsciiLength ) )
+                     {
+                        std::string s;
+                        int i = 0;
+                        while (i < count)
+                        {
+                           s.push_back(geoAsciiBlock[code+i]);
+                           ++i;
+                        }
+                        out << prefix << "key_" << key << ": \"\"\"" << s << "\"\"\"\n";
+                     }
+                  }
+                  else
+                  {
+                     out << prefix << "unhandle_key: " << key << "\n";
+                  }
+               }
+               break;
+            }
+            
+         } // matches: switch(key)
+
+      } //  for (ossim_int32 i = 0; i < tagCount; ++i)
+      
+      if (traceDebug())
+      {
+         if (geoAsciiBlock && geoAsciiLength)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "ossimTiffInfo::printGeoKeys DEBUG: geo ascii block: ";
+            std::string s(geoAsciiBlock, static_cast<std::string::size_type>(geoAsciiLength));
+            ossimNotify(ossimNotifyLevel_DEBUG)<< s << "\n";
+         }
+      } 
+      
+   } // if (geoKeyLength && geoKeyBlock)
+   
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printRpcs(std::ostream& out,
+                                       const std::string& prefix,
+                                       ossim_uint16 type,
+                                       ossim_uint64 count,
+                                       ossim_uint8* valueArray) const
+{
+   if ( valueArray )
+   {
+      if ( count == 92 )
+      {
+         switch (type)
+         {
+            case ossim::OTIFF_DOUBLE:
+            {
+               ossim_float64* p = (ossim_float64*)valueArray;
+               
+               out << prefix << "rpc.bias_error:         " << p[0] << "\n"
+                   << prefix << "rpc.rand_error:         " << p[1] << "\n"
+                   << prefix << "rpc.line_off:           " << p[2] << "\n"
+                   << prefix << "rpc.samp_off:           " << p[3] << "\n"
+                   << prefix << "rpc.lat_off:            " << p[4] << "\n"
+                   << prefix << "rpc.long_off:           " << p[5] << "\n"
+                   << prefix << "rpc.height_off:         " << p[6] << "\n"
+                   << prefix << "rpc.line_scale:         " << p[7] << "\n"
+                   << prefix << "rpc.samp_scale:         " << p[8] << "\n"
+                   << prefix << "rpc.lat_scale:          " << p[9] << "\n"
+                   << prefix << "rpc.long_scale:         " << p[10] << "\n"
+                   << prefix << "rpc.height_scale:       " << p[11] << "\n";
+               
+               ossim_int32 i = 12;
+               ossim_int32 coeff = 0;
+               
+               for (coeff = 0; coeff < 20; ++coeff)
+               {
+                  out << prefix << "rpc.line_num_coeff_" << std::setfill('0')
+                      << std::setw(2) << coeff << ": " << p[i] << "\n";
+                  ++i;
+               }
+               for (coeff = 0; coeff < 20; ++coeff)
+               {
+                  out << prefix << "rpc.line_den_coeff_" << std::setfill('0')
+                      << std::setw(2) << coeff << ": " << p[i] << "\n";
+                  ++i;
+               }
+               for (coeff = 0; coeff < 20; ++coeff)
+               {
+                  out << prefix << "rpc.samp_num_coeff_" << std::setfill('0')
+                      << std::setw(2) << coeff << ": " << p[i] << "\n";
+                  ++i;
+               }
+               for (coeff = 0; coeff < 20; ++coeff)
+               {
+                  out << prefix << "rpc.samp_den_coeff_" << std::setfill('0')
+                      << std::setw(2) << coeff << ": " << p[i] << "\n";
+                  ++i;
+               }
+               break;
+            }
+            
+            default:
+            {
+               out << "print_rpcs_unhandled_type: " << type << "\n";
+               break;
+            }
+         }
+      }
+      else
+      {
+         out << "print_rpcs_invalid_count: " << count << "\n";
+      }
+   }
+   else
+   {
+      out << "print_rpcs_error: null_array\n";
+   }
+   return out;  
+}
+
+std::ostream& ossimTiffInfo::printModelType(std::ostream& out,
+                                            const std::string& prefix,
+                                            ossim_uint16 code) const
+{
+   // key 1024 Section 6.3.1.1 Codes
+   out << prefix << MODEL_TYPE_KW << ": ";
+   if (code == 1)
+   {
+      out << "projected\n";
+   }
+   else if (code == 2)
+   {
+      out << "geographic\n";
+   }
+   else if (code == 2)
+   {
+      out << "geocentric\n";
+   }
+   else
+   {
+      out << "unknown\n";
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printRasterType(std::ostream& out,
+                                             const std::string& prefix,
+                                             ossim_uint16 code) const
+{
+   // key 1025 Section 6.3.1.2 Codes
+   out << prefix << RASTER_TYPE_KW << ": ";
+   if (code == 1)
+   {
+      out << "pixel_is_area\n";
+   }
+   else if (code == 2)
+   {
+      out << "pixel_is_point\n";
+   }
+   else
+   {
+      out << "unknown\n";
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printAngularUnits(std::ostream& out,
+                                               const std::string& prefix,
+                                               ossim_uint16 code) const
+{
+   // key 2054 Section 6.3.1.4 Codes
+   out << prefix << ANGULAR_UNITS_KW << ": ";
+   switch (code)
+   {
+      case 9101:
+      {
+         out << "radians\n";
+         break;
+      }
+      case 9102:
+      {
+         out << "degrees\n";
+         break;
+      }
+      case 9103:
+      {
+         out << "arc_minutes\n";
+         break;
+      }
+      case 9104:
+      {
+         out << "arc_seconds\n";
+         break;
+      }
+      case 9105:
+      {
+         out << "grad\n";
+         break;
+      }
+      case 9106:
+      {
+         out << "gon\n";
+         break;
+      }
+      case 9107:
+      {
+         out << "dms\n";
+         break;
+      }
+      case 9108:
+      {
+         out << "dms_hemisphere\n";
+         break;
+      }
+      default:
+      {
+         out << "unknown\n";
+         break;
+      }
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printCoordTrans(std::ostream& out,
+                                             const std::string& prefix,
+                                             ossim_uint16 code) const
+{
+   // key 3075 Section 6.3.3.3 Codes
+   out << prefix << "coord_trans: ";
+   switch (code)
+   {
+      case 1:
+      {
+         out << "TransverseMercator\n";
+         break;
+      }
+      case 2:
+      {
+         out << "TransvMercator_Modified_Alaska\n";
+         break;
+      }
+      case 3:
+      {
+         out << "ObliqueMercator\n";
+         break;
+      }
+      case 4:
+      {
+         out << "ObliqueMercator_Laborde\n";
+         break;
+      }
+      case 5:
+      {
+         out << "ObliqueMercator_Rosenmund\n";
+         break;
+      }
+      case 6:
+      {
+         out << "ObliqueMercator_Spherical\n";
+         break;
+      }
+      case 7:
+      {
+         out << "Mercator\n";
+         break;
+      }
+      case 8:
+      {
+         out << "LambertConfConic_2SP\n";
+         break;
+      }
+      case 9:
+      {
+         out << "LambertConfConic_Helmert\n";
+         break;
+      }
+      case 10:
+      {
+         out << "LambertAzimEqualArea\n";
+         break;
+      }
+      case 11:
+      {
+         out << "AlbersEqualArea\n";
+         break;
+      }
+      case 12:
+      {
+         out << "AzimuthalEquidistant\n";
+         break;
+      }
+      case 13:
+      {
+         out << "EquidistantConic\n";
+         break;
+      }
+      case 14:
+      {
+         out << "Stereographic\n";
+         break;
+      }
+      case 15:
+      {
+         out << "PolarStereographic\n";
+         break;
+      }
+      case 16:
+      {
+         out << "ObliqueStereographic\n";
+         break;
+      }
+      case 17:
+      {
+         out << "Equirectangular\n";
+         break;
+      }
+      case 18:
+      {
+         out << "CassiniSoldner\n";
+         break;
+      }
+      case 19:
+      {
+         out << "Gnomonic\n";
+         break;
+      }
+      case 20:
+      {
+         out << "MillerCylindrical\n";
+         break;
+      }
+      case 21:
+      {
+         out << "Orthographic\n";
+         break;
+      }
+      case 22:
+      {
+         out << "Polyconic\n";
+         break;
+      }
+      case 23:
+      {
+         out << "Robinson\n";
+         break;
+      }
+      case 24:
+      {
+         out << "Sinusoidal\n";
+         break;
+      }
+      case 25:
+      {
+         out << "VanDerGrinten\n";
+         break;
+      }
+      case 26:
+      {
+         out << "NewZealandMapGrid\n";
+         break;
+      }
+      case 27:
+      {
+         out << "TransvMercator_SouthOriented\n";
+         break;
+      }
+      default:
+      {
+         out << code << " unknown\n";
+         break;
+      }
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printLinearUnits(std::ostream& out,
+                                              const std::string& prefix,
+                                              const std::string& key,
+                                              ossim_uint16 code) const
+{
+   // key 3076 Section 6.3.1.3 Codes
+   out << prefix << key << ": ";
+   switch (code)
+   {
+      case 9001:
+      {
+         out << "meters\n";
+         break;
+      }
+      case 9002:
+      {
+         out << "feet\n";
+         break;
+      }
+      case 9003:
+      {
+         out << "us_survey_feet\n";
+         break;
+      }
+      case 9004:
+      {
+         out << "foot_modified_american\n";
+         break;
+      }
+      case 9005:
+      {
+         out << "foot_clarke\n";
+         break;
+      }
+      case 9006:
+      {
+         out << "foot_indian\n";
+         break;
+      }
+      case 9007:
+      {
+         out << "link\n";
+         break;
+      }
+      case 9008:
+      {
+         out << "link_benoit\n";
+         break;
+      }
+      case 9009:
+      {
+         out << "link_sears\n";
+         break;
+      }
+      case 9010:
+      {
+         out << "chain_benoit\n";
+         break;
+      }
+      case 9011:
+      {
+         out << "chain_sears\n";
+         break;
+      }
+      case 9012:
+      {
+         out << "yard_sears\n";
+         break;
+      }
+      case 9013:
+      {
+         out << "yard_indian\n";
+         break;
+      }
+      case 9014:
+      {
+         out << "fathom\n";
+         break;
+      }
+      case 9015:
+      {
+         out << "mile_international_nautical\n";
+         break;
+      }
+      default:
+      {
+         out << code << " unknown\n";
+         break;
+      }
+   }
+   return out;
+}
+
+std::ostream& ossimTiffInfo::printOrientation(std::ostream& out,
+                                              const std::string& prefix,
+                                              ossim_uint16 code) const
+{
+   // Tag 274:
+   out << prefix << "orientation: ";
+   switch (code)
+   {
+      case 1:
+      {
+         out << "top_left\n";
+         break;
+      }
+      case 2:
+      {
+         out << "top_right\n";
+         break;
+      }
+      case 3:
+      {
+         out << "bottom_right\n";
+         break;
+      }
+      case 4:
+      {
+         out << "bottom_left\n";
+         break;
+      }
+      case 5:
+      {
+         out << "left_top\n";
+         break;
+      }
+      case 6:
+      {
+         out << "right_top\n";
+         break;
+      }
+      case 7:
+      {
+         out << "right_bottom\n";
+         break;
+      }
+      case 8:
+      {
+         out << "left_bottom\n";
+         break;
+      }
+      default:
+      {
+         out << code << " unknown\n";
+         break;
+      }
+   }
+   return out;
+}
+
+void ossimTiffInfo::getDirPrefix(ossim_int32 index,
+                                 std::string& prefix) const
+{
+   prefix += "image";
+   std::ostringstream s;
+   s << index;
+   prefix += s.str();
+   prefix += ".";
+}
+
+bool ossimTiffInfo::getPixelScale(const ossimString& gtiffPrefix,
+                                  const ossimKeywordlist& gtiffKwl,
+                                  ossimDpt& scale) const
+{
+   bool result = false;
+
+   std::vector<ossim_float64> floats;
+   if ( getFloats(gtiffPrefix, MODEL_PIXEL_SCALE_KW, gtiffKwl, floats) )
+   {
+      if ( floats.size() == 3 )
+      {
+         scale.x = floats[0];
+         scale.y = floats[1];
+         result = true;
+      }
+   }
+
+   return result;
+}
+
+bool ossimTiffInfo::getTiePoint(const ossimString& gtiffPrefix,
+                                const ossimKeywordlist& gtiffKwl,
+                                std::vector<ossim_float64>& ties) const
+{
+   return getFloats(gtiffPrefix, MODEL_TIE_POINT_KW, gtiffKwl, ties);
+}
+
+bool ossimTiffInfo::getModelTransform(const ossimString& gtiffPrefix,
+                                      const ossimKeywordlist& gtiffKwl,
+                                      std::vector<ossim_float64>& xfrm) const
+{
+   return getFloats(gtiffPrefix, MODEL_TRANSFORM_KW, gtiffKwl, xfrm);
+}
+
+bool ossimTiffInfo::getFloats(const ossimString& gtiffPrefix,
+                              const ossimString& key,
+                              const ossimKeywordlist& gtiffKwl,
+                              std::vector<ossim_float64>& floats) const
+{
+   bool result = false;
+   
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), key.c_str());
+   if ( lookup )
+   {
+      ossimString line = lookup;
+      result  = getFloats(line, floats);
+   }
+
+   return result; 
+}
+
+bool ossimTiffInfo::getFloats(const ossimString& line,
+                              std::vector<ossim_float64>& floats) const
+{
+   bool result = false;
+   
+   floats.clear();
+   
+   if (line.size())
+   {
+      ossim_float64 f;
+      std::istringstream is(line);
+
+      is >> f; // Get the first double.
+      while ( ! is.fail() )
+      {
+         floats.push_back(f);
+         is >> f;
+      }
+   }
+
+   if ( floats.size() )
+   {
+      result = true;
+   }
+
+   return result;
+}
+
+bool ossimTiffInfo::getDatumCode(const ossimString& gtiffPrefix,
+                                 const ossimKeywordlist& gtiffKwl,
+                                 ossimString& datumCode) const
+{
+   bool result = false;
+   
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), GEODETIC_DATUM_KW.c_str());
+
+   // There is some ambiguity in the definition of EPSG GCS code. Here both the datum code (6000-
+   // series) and projection code (4000-series) are tested to get to the datum's native ascii code:
+
+   // Look for GEODETIC_DATUM_KW code first:
+   if (lookup)
+   {
+      ossim_int32 code = ossimString(lookup).toInt32();
+      result = getDatumCode( code, datumCode );
+   }
+
+   if ( !result )
+   {
+      // Try GCS_CODE_KW:
+      lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::GCS_CODE_KW);
+      if ( lookup )
+      {
+         ossim_int32 code = ossimString(lookup).toInt32();
+         result = getDatumCode( code, datumCode );
+      }
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getDatumCode(ossim_int32 code, ossimString& datumCode) const
+{
+   bool result = false;
+   datumCode.clear();
+   switch(code)
+   {
+      case 4267:
+      case 6267:   
+      {
+         datumCode = "NAS-C";
+         break;
+      }
+      case 4269:
+      case 6269:
+      {
+         datumCode = "NAR-C";
+         break;
+      }
+      case 4322:
+      case 6322:
+      {
+         datumCode = "WGD";
+         break;
+      }
+      case 4326:
+      case 6326:
+      {
+         datumCode = "WGE";
+         break;
+      }
+      
+   } // matches: switch(code)
+
+   if ( datumCode.size() )
+   {
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getPcsCode(const ossimString& gtiffPrefix,
+                               const ossimKeywordlist& gtiffKwl,
+                               ossimString& pcsCode) const
+{
+   bool result = false;
+
+   // Check for key "pcs_code":
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::PCS_CODE_KW);
+   if (lookup)
+   {
+      pcsCode = lookup;
+      
+      ossim_uint32 code = pcsCode.toUInt32();
+      if ( code != 32767 )
+      {
+         // See if we handle this code in our projection factories.
+         ossimRefPtr<ossimProjection>  proj = 
+            ossimEpsgProjectionFactory::instance()->createProjection(pcsCode);
+         if (proj.valid())
+         {
+            proj = 0;
+            result = true;
+         }
+      }
+      
+   }
+
+   if (result == false)
+   {
+      // Check for key "pcs_citation":
+      lookup = gtiffKwl.find(gtiffPrefix.c_str(), "pcs_citation");
+      if ( lookup )
+      {
+         ossimString spec = lookup;
+
+         // Strip commonly found or bar '|' from end if present.
+         spec.trim(ossimString("|"));
+
+         // See if we handle this code in our projection factories.
+         ossimRefPtr<ossimProjection>  proj =
+            ossimEpsgProjectionFactory::instance()->createProjection(spec);
+         if (proj.valid())
+         {
+            ossimMapProjection* mapProj = dynamic_cast<ossimMapProjection*>(proj.get());
+            if ( mapProj )
+            {
+               ossim_uint32 intCode = mapProj->getPcsCode();
+               if ( intCode != 32767 )
+               {
+                  proj = 0;
+                  pcsCode = ossimString::toString(intCode);
+                  result = true;
+               }
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+bool ossimTiffInfo::getUnits(const ossimString& gtiffPrefix,
+                             const ossimKeywordlist& gtiffKwl,
+                             ossimString& units) const
+{
+   bool result = true;
+   
+   ossimString linearUnits = "";
+   getLinearUnits(gtiffPrefix, gtiffKwl, linearUnits);
+   
+   ossimString angularUnits = "";
+   getAngularUnits(gtiffPrefix, gtiffKwl, angularUnits);
+
+   ossimString modelType;
+   getModelType(gtiffPrefix, gtiffKwl, modelType);
+   
+   if (modelType == "geographic")
+   {
+      if (angularUnits.size())
+      {
+         units = angularUnits;
+      }
+      else
+      {
+         units = "degrees";
+      }
+   }
+   else if (modelType == "projected")
+   {
+      if (linearUnits.size())
+      {
+         units = linearUnits;
+      }
+      else
+      {
+         units = "meters";
+      }
+   }
+   else
+   {
+      units = "meters";
+   }
+
+   return result;
+}
+
+
+bool ossimTiffInfo::getLinearUnits(const ossimString& gtiffPrefix,
+                                   const ossimKeywordlist& gtiffKwl,
+                                   ossimString& linearUnits) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), LINEAR_UNITS_KW.c_str());
+   if (lookup)
+   {
+      linearUnits = lookup;
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getVerticalUnits(const ossimString& gtiffPrefix,
+                                     const ossimKeywordlist& gtiffKwl,
+                                     ossimString& verticalUnits) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), VERTICAL_UNITS_KW.c_str());
+   if (lookup)
+   {
+      verticalUnits = lookup;
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getAngularUnits(const ossimString& gtiffPrefix,
+                                    const ossimKeywordlist& gtiffKwl,
+                                    ossimString& angularUnits) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ANGULAR_UNITS_KW.c_str());
+   if (lookup)
+   {
+      angularUnits = lookup;
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getPixelType(const ossimString& gtiffPrefix,
+                                 const ossimKeywordlist& gtiffKwl,
+                                 ossimString& pixelType) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), RASTER_TYPE_KW.c_str());
+   if (lookup)
+   {
+      pixelType = lookup;
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getModelType(const ossimString& gtiffPrefix,
+                                 const ossimKeywordlist& gtiffKwl,
+                                 ossimString& modelType) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), MODEL_TYPE_KW.c_str());
+   if (lookup)
+   {
+      modelType = lookup;
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getOssimProjectionName(const ossimString& gtiffPrefix,
+                                           const ossimKeywordlist& gtiffKwl,
+                                           ossimString& ossimProj) const
+{
+   bool result = false;
+   ossimProj.clear();
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), COORD_TRANS_CODE_KW.c_str());
+   if (lookup)
+   {
+      ossim_uint32 code = ossimString(lookup).toUInt32();
+
+      ossimGeoTiffCoordTransformsLut lut;
+      
+      ossimProj = lut.getEntryString(code);
+      
+      if (ossimProj.size())
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+ossim_uint32 ossimTiffInfo::getLines(const ossimString& gtiffPrefix,
+                                     const ossimKeywordlist& gtiffKwl) const
+{
+   ossim_uint32 result = 0;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), IMAGE_LENGTH_KW.c_str());
+   if (lookup)
+   {
+      result = ossimString(lookup).toUInt32();
+   }
+   return result;
+}
+
+ossim_uint32 ossimTiffInfo::getSamples(const ossimString& gtiffPrefix,
+                                       const ossimKeywordlist& gtiffKwl) const
+{
+   ossim_uint32 result = 0;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), IMAGE_WIDTH_KW.c_str());
+   if (lookup)
+   {
+      result = ossimString(lookup).toUInt32();
+   }   
+   return result;
+}
+
+bool ossimTiffInfo::getStdParallelOne(const ossimString& gtiffPrefix,
+                                      const ossimKeywordlist& gtiffKwl,
+                                      ossimString& value) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::STD_PARALLEL_1_KW);
+   if (lookup)
+   {
+      value = lookup;
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getStdParallelTwo(const ossimString& gtiffPrefix,
+                                      const ossimKeywordlist& gtiffKwl,
+                                      ossimString& value) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::STD_PARALLEL_2_KW);
+   if (lookup)
+   {
+      value = lookup;
+      result = true;
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getFalseEasting(const ossimString& gtiffPrefix,
+                                    const ossimKeywordlist& gtiffKwl,
+                                    ossimString& value) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::FALSE_EASTING_KW);
+   if (lookup)
+   {
+      value = lookup;
+      result = true;
+   }
+   return result; 
+}
+
+bool ossimTiffInfo::getFalseNorthing(const ossimString& gtiffPrefix,
+                                     const ossimKeywordlist& gtiffKwl,
+                                     ossimString& value) const
+{
+   bool result = false;
+   const char* lookup = gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::FALSE_NORTHING_KW);
+   if (lookup)
+   {
+      value = lookup;
+      result = true;
+   }
+   return result; 
+}
+
+bool ossimTiffInfo::getFalseEastingNorthing(const ossimString& gtiffPrefix,
+                                            const ossimKeywordlist& gtiffKwl,
+                                            ossimDpt& eastingNorthing) const
+{
+   bool result = false;
+   ossimString value;
+   if ( getFalseEasting(gtiffPrefix, gtiffKwl, value) )
+   {
+      eastingNorthing.x = value.toFloat64();
+
+      if ( getFalseNorthing(gtiffPrefix, gtiffKwl, value) )
+      {
+         eastingNorthing.y = value.toFloat64();
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimTiffInfo::getScaleFactor(const ossimString& gtiffPrefix,
+                                   const ossimKeywordlist& gtiffKwl,
+                                   ossim_float64& value) const
+{
+   bool result = false;
+
+   const char* lookup =
+      gtiffKwl.find(gtiffPrefix.c_str(), ossimKeywordNames::SCALE_FACTOR_KW);
+   
+   if (lookup)
+   {
+      value = ossimString(lookup).toFloat64();
+      result = true;
+   }
+
+   return result; 
+}
+
+bool ossimTiffInfo::getOriginLat(const ossimString& gtiffPrefix,
+                                 const ossimKeywordlist& gtiffKwl,
+                                 ossim_float64& value) const
+{
+   bool result = false;
+
+   //---
+   // Not sure of the order of precedence here.
+   //---
+   const char* projOriginLatGeoKey =
+      gtiffKwl.find(gtiffPrefix.c_str(), ORIGIN_LATITUDE_KW.c_str());
+
+   //---
+   // Go for this key first as it is used in geotiff spec example:
+   // http://www.remotesensing.org/geotiff/spec/geotiff3.html#3.1.3.
+   //---
+   if (projOriginLatGeoKey)
+   {
+      value = ossimString(projOriginLatGeoKey).toFloat64();
+      result = true;
+   }
+   else
+   {
+      const char* projCenterLatGeoKey =
+         gtiffKwl.find(gtiffPrefix.c_str(), CENTER_LATITUDE__KW.c_str());
+
+      if (projCenterLatGeoKey)
+      {
+         value = ossimString(projCenterLatGeoKey).toFloat64();
+         result = true;
+      }
+      else
+      {
+         const char* projFalseOriginLatGeoKey =
+            gtiffKwl.find(gtiffPrefix.c_str(),
+                          FALSE_ORIGIN_LATITUDE_KW.c_str());
+
+         if (projFalseOriginLatGeoKey)
+         {
+            //---
+            // Seems the term "false" implies it should be added to the real
+            // origin?
+            //---
+            value = ossimString(projFalseOriginLatGeoKey).toFloat64();
+            result = true;
+         }
+      }
+   }
+   
+   return result;
+}
+
+bool ossimTiffInfo::getCentralMeridian(const ossimString& gtiffPrefix,
+                                       const ossimKeywordlist& gtiffKwl,
+                                       ossim_float64& value) const
+{
+   bool result = false;
+
+   //---
+   // Not sure of the order of precedence here.
+   //---
+   const char* projCenterLongGeoKey =
+      gtiffKwl.find(gtiffPrefix.c_str(), CENTER_LONGITUDE_KW.c_str());
+
+   //---
+   // Go for this key first as it is used in geotiff spec example:
+   // http://www.remotesensing.org/geotiff/spec/geotiff3.html#3.1.3.
+   //---
+   if (projCenterLongGeoKey)
+   {
+      value = ossimString(projCenterLongGeoKey).toFloat64();
+      result = true;
+   }
+   else
+   {
+      const char* projOriginLongGeoKey =
+         gtiffKwl.find(gtiffPrefix.c_str(), ORIGIN_LONGITUDE_KW.c_str());
+
+      if (projOriginLongGeoKey)
+      {
+         value = ossimString(projOriginLongGeoKey).toFloat64();
+         result = true;
+      }
+      else
+      {
+         const char* projFalseOriginLongGeoKey =
+            gtiffKwl.find(gtiffPrefix.c_str(),
+                          FALSE_ORIGIN_LONGITUDE_KW.c_str());
+
+         if (projFalseOriginLongGeoKey)
+         {
+            //---
+            // Seems the term "false" implies it should be added to the real
+            // origin?
+            //---
+            value = ossimString(projFalseOriginLongGeoKey).toFloat64();
+            result = true;
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimTiffInfo::getTieSets(const std::vector<ossim_float64>& ties,
+                               ossim_uint32 width,
+                               ossim_uint32 height,
+                               ossimTieGptSet& tieSet) const
+{
+   ossim_uint32 idx = 0;
+   ossim_uint32 tieCount = (ossim_uint32)ties.size()/6;
+   const double* tiePointsPtr = &ties.front();
+   double offset = 0;
+   if (hasOneBasedTiePoints(ties, width, height))
+   {
+      offset = -1.0;
+   }
+   
+   for(idx = 0; idx < tieCount; ++idx)
+   {
+      ossimDpt xyPixel(tiePointsPtr[0]+offset, tiePointsPtr[1]+offset);
+      // tie[3] = x, tie[4]
+      ossimGpt gpt(tiePointsPtr[4], tiePointsPtr[3], tiePointsPtr[5]);
+      
+      tieSet.addTiePoint(new ossimTieGpt(gpt, xyPixel, .5));
+      tiePointsPtr+=6;
+   }
+}
+
+bool ossimTiffInfo::hasOneBasedTiePoints(
+   const std::vector<ossim_float64>& ties,
+   ossim_uint32 width, ossim_uint32 height) const
+{
+   bool result = false;
+   
+   // Assuming ties of (x,y,z,lat,lon,hgt) so size should be divide by 3.
+   if (ties.size()%6)
+   {
+      return result;
+   }
+   
+   ossim_float64 minX = 999999.0;
+   ossim_float64 minY = 999999.0;
+   ossim_float64 maxX = 0.0;
+   ossim_float64 maxY = 0.0;
+
+   const ossim_uint32 SIZE = (ossim_uint32)ties.size();
+   ossim_uint32 tieIndex = 0;
+
+   while (tieIndex < SIZE)
+   {
+      if ( ties[tieIndex]   < minX ) minX = ties[tieIndex];
+      if ( ties[tieIndex]   > maxX ) maxX = ties[tieIndex];
+      if ( ties[tieIndex+1] < minY ) minY = ties[tieIndex+1];
+      if ( ties[tieIndex+1] > maxY ) maxY = ties[tieIndex+1];
+      tieIndex += 6;
+   }
+
+   if ( (minX == 1) && (maxX == width) &&
+        (minY == 1) && (maxY == height) )
+   {
+      result = true;
+   }
+
+#if 0
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimGeoTiff::hasOneBasedTiePoints DEBUG:"
+         << "\nminX:       " << minX
+         << "\nmaxX:       " << maxX
+         << "\nminY:       " << minY
+         << "\nmaxY:       " << maxY
+         << "\ntheWidth:   " << theWidth
+         << "\ntheLength:  " << theLength
+         << "\none based:  " << (result?"true":"false")
+         << std::endl;
+   }
+#endif
+   
+   return result;
+}
diff --git a/src/support_data/ossimTiffWorld.cpp b/src/support_data/ossimTiffWorld.cpp
new file mode 100644
index 0000000..0fabd67
--- /dev/null
+++ b/src/support_data/ossimTiffWorld.cpp
@@ -0,0 +1,268 @@
+//*******************************************************************
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Ken Melero
+// 
+// Description: Container class for a tiff world file data.
+//
+//********************************************************************
+// $Id: ossimTiffWorld.cpp 19682 2011-05-31 14:21:20Z dburken $
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimUnitConversionTool.h>
+#include <ossim/support_data/ossimTiffWorld.h>
+#include <ossim/base/ossimNotify.h>
+#include <cmath>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+using namespace std;
+
+//**************************************************************************
+// ossimTiffWorld::ossimTiffWorld()
+//***************************************************************************
+ossimTiffWorld::ossimTiffWorld()
+   :
+      theXform1(1.0),
+      theXform2(0.0),
+      theXform3(0.0),
+      theXform4(-1.0),
+      theTranslation(0.0,0.0),
+      thePixelType(OSSIM_PIXEL_IS_AREA),
+      theUnit(OSSIM_METERS),
+      theComputedScale(0.0, 0.0),
+      theComputedRotation(0.0)
+{}
+
+//**************************************************************************
+// ossimTiffWorld::ossimTiffWorld(const char* file, PixelType ptype)
+//***************************************************************************
+ossimTiffWorld::ossimTiffWorld(const char* file, 
+			       ossimPixelType ptype,
+			       ossimUnitType  scaleUnits)
+   :
+      theXform1(1.0),
+      theXform2(0.0),
+      theXform3(0.0),
+      theXform4(-1.0),
+      theTranslation(0.0,0.0),
+      thePixelType(ptype),
+      theUnit(scaleUnits),
+      theComputedScale(0.0, 0.0),
+      theComputedRotation(0.0)
+{
+   open(ossimFilename(file), ptype, scaleUnits);
+}
+
+bool ossimTiffWorld::open(const ossimFilename& file, ossimPixelType ptype, ossimUnitType  unit)
+{
+   bool result = false;
+
+   ifstream is;
+   is.open(file.c_str());
+
+   if( !is.is_open() )
+   {
+      // ESH 07/2008, Trac #234: OSSIM is case sensitive 
+      // when using worldfile templates during ingest
+      // -- If first you don't succeed with the user-specified
+      // filename, try again with the results of a case insensitive search.
+      ossimFilename fullName(file);
+      ossimDirectory directory(fullName.path());
+      ossimFilename filename(fullName.file());
+      
+      std::vector<ossimFilename> result;
+      bool bSuccess = directory.findCaseInsensitiveEquivalents(
+         filename, result );
+      if ( bSuccess == true )
+      {
+         int numResults = (int)result.size();
+         int i;
+         for ( i=0; i<numResults && !is.is_open(); ++i )
+         {
+            is.open( result[i].c_str() );
+         }
+      }
+   }
+      
+   if ( is.is_open() )
+   {
+      double x,y;
+      is >> theXform1 >> theXform2 >> theXform3 >> theXform4 >> x >> y;
+      theTranslation = ossimDpt(x,y);
+      
+      // Compute the affine parameters from the transform:
+      theComputedRotation = atan2(theXform2,theXform1);
+      
+/*
+ * Commented out warning.
+ * Used all the time for tie and scale, NOT for affine. We could wrap around trace
+ * if we added trace to class. (drb - 20110115)
+ */
+#if 0
+      double angle2 = atan2(theXform4,theXform3);
+      if (fabs(theComputedRotation - angle2) > 0.00001)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimTiffWorld -- Non-affine transform encountered."
+            << " Use of an affine transform to represent this world file geometry will result in errors."
+            << endl;
+      }
+#endif
+      
+      double cos_rot = cos(theComputedRotation);
+      if (cos_rot != 0.0)
+      {
+         theComputedScale.x = theXform1/cos_rot;
+         theComputedScale.y = theXform4/cos_rot;
+      }
+      else
+      {
+         theComputedScale.x = theXform4;
+         theComputedScale.y = theXform1;
+      }
+      thePixelType = ptype;
+      theUnit = unit;
+      is.close();
+      result = true;
+   }
+   return result;
+}
+
+ossimTiffWorld::~ossimTiffWorld()
+{
+}
+
+void ossimTiffWorld::forward(const ossimDpt& ip,
+                             ossimDpt& transformedPoint)
+{
+   transformedPoint.x = ip.x*theXform1 + ip.y*theXform2 + theTranslation.x;
+   transformedPoint.y = ip.x*theXform3 + ip.y*theXform4 + theTranslation.y;
+}
+
+bool ossimTiffWorld::saveToOssimGeom(ossimKeywordlist& kwl, const char* prefix)const
+{
+   ossimDpt scale(fabs(theXform1), fabs(theXform4));
+   ossimDpt tie(theTranslation.x, theTranslation.y);
+
+   if ( (theUnit == OSSIM_FEET) || (theUnit == OSSIM_US_SURVEY_FEET) )
+   {
+      // Convert to meters.
+      scale.x = ossimUnitConversionTool(scale.x, theUnit).getMeters();
+      scale.y = ossimUnitConversionTool(scale.y, theUnit).getMeters();
+      tie.x   = ossimUnitConversionTool(tie.x, theUnit).getMeters();
+      tie.y   = ossimUnitConversionTool(tie.y, theUnit).getMeters();
+   }
+   
+   // Shift the tie point to be relative to the center of the pixel.
+   if(thePixelType == OSSIM_PIXEL_IS_AREA)
+   {
+      tie.x += (scale.x/2.0);
+      tie.y -= (scale.y/2.0);
+
+      // Adjust the keyword list to reflect pixel is point.
+      kwl.add(prefix,
+              ossimKeywordNames::PIXEL_TYPE_KW,
+              "pixel_is_point",
+              true);
+   }
+
+   // Units in feet converted to meters up above.
+   ossimString units = "meters";
+   if(theUnit == OSSIM_DEGREES)
+   {
+      units = "degrees";
+   }
+   
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_XY_KW,
+           tie.toString().c_str(),
+           true);
+   
+   kwl.add(prefix,
+           ossimKeywordNames::TIE_POINT_UNITS_KW,
+           units.c_str(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::PIXEL_SCALE_XY_KW,
+           scale.toString().c_str(),
+           true);
+
+   kwl.add(prefix,
+           ossimKeywordNames::PIXEL_SCALE_UNITS_KW,
+           units.c_str(),
+           true);
+
+   return true;
+}
+
+bool ossimTiffWorld::loadFromOssimGeom(const ossimKeywordlist& kwl, const char* prefix)
+{
+   theXform2 = 0.0;
+   theXform3 = 0.0;
+
+   const char* lookup;
+
+   // Get the scale...
+   lookup = kwl.find(prefix, ossimKeywordNames::PIXEL_SCALE_XY_KW);
+   if (lookup)
+   {
+      ossimDpt scale;
+      scale.toPoint(std::string(lookup));
+      theXform1      = scale.x;
+      theXform4      = -(scale.y);
+   }
+   else // BACKWARDS COMPATIBILITY LOOKUPS...
+   {
+      ossimString xscale = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_X_KW);
+      ossimString yscale = kwl.find(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW);
+      theXform1 = xscale.toDouble();
+      theXform4 = -(yscale.toDouble());
+   }
+
+   // Get the tie...
+   lookup = kwl.find(prefix, ossimKeywordNames::TIE_POINT_XY_KW);
+   if (lookup)
+   {
+      ossimDpt tie;
+      tie.toPoint(std::string(lookup));
+      theTranslation.x  = tie.x;
+      theTranslation.y  = tie.y;
+   }
+   else // BACKWARDS COMPATIBILITY LOOKUPS...
+   {
+      ossimString easting  =
+         kwl.find(prefix, ossimKeywordNames::TIE_POINT_EASTING_KW);
+      ossimString northing =
+         kwl.find(prefix, ossimKeywordNames::TIE_POINT_NORTHING_KW);
+      theTranslation.x  = easting.toDouble();
+      theTranslation.y  = northing.toDouble(); 
+   }
+   
+   return true;
+}
+
+std::ostream& ossimTiffWorld::print(std::ostream& out) const
+{
+   out << setiosflags(ios::fixed) << setprecision(15)
+       << theXform1     << "\n"
+       << theXform2     << "\n"
+       << theXform3     << "\n"
+       << theXform4     << "\n"
+       << theTranslation
+       << endl;
+   return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const ossimTiffWorld& obj)
+{
+   return obj.print(out);
+}
+
diff --git a/src/support_data/ossimWavelength.cpp b/src/support_data/ossimWavelength.cpp
new file mode 100644
index 0000000..f155a9c
--- /dev/null
+++ b/src/support_data/ossimWavelength.cpp
@@ -0,0 +1,203 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Class definition for ossimWavelength.
+//
+//----------------------------------------------------------------------------
+
+#include <ossim/support_data/ossimWavelength.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+#include <cmath>
+
+ossimWavelength::ossimWavelength()
+   : m_map()
+{}
+
+ossimWavelength::ossimWavelength( const ossimWavelength& obj )
+   : m_map( obj.m_map )
+{}
+
+const ossimWavelength& ossimWavelength::operator=( const ossimWavelength& rhs )
+{
+   if ( this != &rhs )
+   {
+      m_map = rhs.m_map;
+   }
+   return *this;   
+}
+
+ossimWavelength::~ossimWavelength()
+{
+}
+   
+const ossimWavelength::WavelengthMap& ossimWavelength::getMap() const
+{
+   return m_map;
+}
+   
+ossimWavelength::WavelengthMap& ossimWavelength::getMap()
+{
+   return m_map;
+}
+
+bool ossimWavelength::initialize( const ossimEnviHeader& hdr )
+{
+   //---
+   // Example envi wavelength format:
+   // wavelength = { 374.323608,  382.530487,  390.737427 }
+   //---
+   ossimString value;
+
+   // Check the units...
+   ossimString key = "wavelength units";
+   if ( hdr.getValue( key, value ) )
+   {
+      if ( value.downcase() == "nanometers" )
+      {
+         // Check for wavelength key:
+         key = "wavelength";
+         if ( hdr.getValue( key, value ) )
+         {
+            if ( value.size() )
+            {
+               // Split into array.
+               value.trim( ossimString("{}") );
+               std::vector<ossimString> list;
+               value.split( list, ossimString(","), true );
+
+               if ( list.size() )
+               {
+                  // Initialize the map:
+                  
+                  std::vector<ossimString>::const_iterator i = list.begin();
+                  ossim_uint32 band = 0;
+                  ossim_float32 wavelength = 0.0;
+            
+                  while ( i != list.end() )
+                  {
+                     wavelength = (*i).toFloat64();
+                     m_map.insert( std::make_pair( wavelength, band ) );
+                     ++band;
+                     ++i;
+                  }
+               }
+            }
+         }
+      }
+   }
+   
+   return ( m_map.size() ? true : false);
+   
+} // End: bool ossimWavelength::initialize(const ossimEnviHeader&)
+
+using namespace std;
+ossimWavelength::WavelengthMap::const_iterator ossimWavelength::findClosestIterator(
+   const ossim_float64& requestedWavelength,
+   const ossim_float64& thresholdFromCenter  ) const
+{
+   WavelengthMap::const_iterator result = m_map.lower_bound( requestedWavelength );
+   if ( result != m_map.end() )
+   {
+      if ( result != m_map.begin() ) //  && (result->first > requestedWavelength) )
+      {
+         // Somewhere in the middle.
+         WavelengthMap::const_iterator lower = result;
+         --lower;
+
+         ossim_float64 t = (requestedWavelength - lower->first) / (result->first -lower->first);
+         if ( t < 0.5 )
+         {
+            result = lower;
+         }
+      }
+   }
+   else
+   {
+      --result;
+   }
+      
+   if ( result != m_map.end() )
+   {
+      // Within threshold check.
+      if ( std::fabs( result->first - requestedWavelength) > thresholdFromCenter )
+      {
+         result = m_map.end();
+      }
+      
+   } // if ( result != m_map.end() )
+
+   return result;
+   
+} // End: WavelengthMap::const_iterator ossimWavelength::findClosestIterator
+
+ossim_int32 ossimWavelength::findClosestIndex(
+   const ossim_float64& requestedWavelength, const ossim_float64& thresholdFromCenter  ) const
+{
+   ossim_int32 result = -1;
+   WavelengthMap::const_iterator i =
+      findClosestIterator( requestedWavelength, thresholdFromCenter );
+   if ( i != m_map.end() )
+   {
+      result = (*i).second;
+   }
+   return result;
+   
+} // End: ossim_int32 ossimWavelength::findClosestIndex(...
+
+bool ossimWavelength::getRgbBands( std::vector<ossim_uint32>& bands ) const
+{
+   bool result = false;
+
+   if ( m_map.size() )
+   {
+      //---
+      // Attempt to find bands with closest rgb wavelengths.
+      // red:   620 - 750 nm
+      // green: 495 - 570 nm
+      // blue:  450 - 495 nm
+      //---
+      //const ossim_float32 RED_WAVELENGTH              = 439.978577; // 442.0;      
+      //const ossim_float32 GREEN_WAVELENGTH            = 546.666504; // 546.0;
+      //const ossim_float32 BLUE_WAVELENGTH             = 636.941406; // 637.0;
+      const ossim_float32 RED_WAVELENGTH              = 685.0;      
+      const ossim_float32 GREEN_WAVELENGTH            = 532.5;
+      const ossim_float32 BLUE_WAVELENGTH             = 472.5;
+      const ossim_float32 RED_THRESHOLD_FROM_CENTER   =  65.0;      
+      const ossim_float32 GREEN_THRESHOLD_FROM_CENTER =  37.5;
+      const ossim_float32 BLUE_THRESHOLD_FROM_CENTER  =  22.5;
+
+      WavelengthMap::const_iterator r =
+         findClosestIterator( RED_WAVELENGTH, RED_THRESHOLD_FROM_CENTER );
+      WavelengthMap::const_iterator g =
+         findClosestIterator( GREEN_WAVELENGTH, GREEN_THRESHOLD_FROM_CENTER );
+      WavelengthMap::const_iterator b =
+         findClosestIterator( BLUE_WAVELENGTH, BLUE_THRESHOLD_FROM_CENTER );
+
+      if ( (r != m_map.end()) && (g != m_map.end()) && (b != m_map.end()) )
+      {
+         bands.resize(3);
+         bands[0] = (*r).second;
+         bands[1] = (*g).second;
+         bands[2] = (*b).second;
+         result = true;
+      }
+   }
+   return result;
+   
+} // bool ossimWavelength::getRgbBands( std::vector<ossim_uint32>& ) const
+
+ossimWavelength::WavelengthMap::const_iterator ossimWavelength::end() const
+{
+   return m_map.end();
+}
+
+ossimWavelength::WavelengthMap::iterator ossimWavelength::end()
+{
+   return m_map.end();
+}
diff --git a/src/support_data/ossimWkt.cpp b/src/support_data/ossimWkt.cpp
new file mode 100644
index 0000000..da5e9cf
--- /dev/null
+++ b/src/support_data/ossimWkt.cpp
@@ -0,0 +1,273 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// ossimWkt class definition.  A well known text(WKT) utility class.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+/*************************************************************************************************
+ * Sample WKT string (for reference, line feeds and spaces added for human readability)
+ *
+ * PROJCS["NAD_1983_HARN_Lambert_Conformal_Conic",
+ *        GEOGCS["GCS_North_American_1983_HARN",
+ *               DATUM["NAD83_High_Accuracy_Regional_Network",
+ *                     SPHEROID["GRS_1980",6378137,298.257222101, AUTHORITY["EPSG","7019"]],
+ *                     AUTHORITY["EPSG","6152"]],
+ *               PRIMEM["Greenwich",0],
+ *               UNIT["degree",0.0174532925199433]],
+ *        PROJECTION["Lambert_Conformal_Conic_2SP"],
+ *        PARAMETER["standard_parallel_1",43],
+ *        PARAMETER["standard_parallel_2",45.5],
+ *        PARAMETER["latitude_of_origin",41.75],
+ *        PARAMETER["central_meridian",-120.5],
+ *        PARAMETER["false_easting",1312335.958005249],
+ *        PARAMETER["false_northing",0],
+ *        UNIT["foot",0.3048, AUTHORITY["EPSG","9002"]]]
+ *
+ **************************************************************************************************/
+#include <ossim/support_data/ossimWkt.h>
+#include <cstdio>
+#include <iostream>
+#include <sstream>
+
+using namespace std; // tmp drb...
+
+ossimWkt::ossimWkt()
+   : m_kwl()
+{
+}
+
+ossimWkt::~ossimWkt()
+{
+}
+
+bool ossimWkt::parse( const std::string& wkt )
+{
+   bool result = false;
+   if ( wkt.size() )
+   {
+      std::istringstream is( wkt );
+      result = parseWktGroup( is, m_kwl );
+   }
+   return result;
+}
+
+const ossimKeywordlist& ossimWkt::getKwl() const
+{
+   return m_kwl;
+}
+
+bool ossimWkt::parseWktGroup( std::istringstream& is, ossimKeywordlist& kwl )
+{
+   bool result = false;
+
+   if ( is.good() )
+   {
+      char c;
+
+      // Get the wkt group name up to '[', e.g. "PROJCS[".
+      std::string prefix = "";      
+      std::string object;
+      // std::string v;
+      while ( is.good() )
+      {
+         is.get(c);
+         if ( is.good() )
+         {
+            // Look for parens or square brackets.
+            if ( (c != '[') && (c != '(') )
+            {
+               object.push_back(c);
+            }
+            else
+            {
+               result = parseObject( is, prefix, object, kwl );
+            }
+         }
+         else
+         {
+            break;
+         }
+      }
+   }
+   
+   return result;
+}
+
+bool ossimWkt::parseObject( std::istringstream& is,
+                            const std::string& prefix,
+                            const std::string& object,
+                            ossimKeywordlist& kwl )
+{
+   bool result = false;
+
+   result = parseName( is, prefix, object, kwl );
+
+   if ( result && is.good() )
+   {
+      char c;
+      ossim_uint32 myObjectIndex = 0;
+      ossim_uint32 paramIndex = 0;
+      while ( is.good() )
+      {
+         is.get(c);
+         if ( is.good() )
+         {  
+            if ( c == ',' )
+            {
+               parseParam( is, prefix, object, myObjectIndex, paramIndex, kwl );
+            }
+            else if ( (c == ']') || (c == ')') )
+            {
+               break; // End of object.
+            }
+         }
+      }
+      
+   }
+   
+   return result;
+}
+
+bool ossimWkt::parseName( std::istringstream& is,
+                          const std::string& prefix,
+                          const std::string& object,
+                          ossimKeywordlist& kwl )
+{
+   bool result = false;
+   char c;
+   std::string name;
+
+   // Find the first quote:
+   while ( is.good() )
+   {
+      is.get(c);
+      if ( is.good() )
+      {  
+         if ( c == '"' )
+         {
+            break;
+         }
+      }
+   }
+
+   // Get the name:
+   while ( is.good() )
+   {
+      is.get(c);
+      if ( is.good() )
+      {  
+         if ( c != '"' )
+         {
+            name.push_back(c);
+         }
+         else
+         {
+            break; // End quote:
+         }
+      }
+   }
+
+   if ( name.size() )
+   {
+      // Add to keyword list.
+      std::string key;
+      if ( prefix.size() )
+      {
+         key += prefix;
+      }
+      key += object;
+      key += ".name";
+      kwl.addPair( key, name );
+      result = true;
+   }
+   
+   return result;
+}
+
+bool ossimWkt::parseParam( std::istringstream& is,
+                           const std::string& prefix,
+                           const std::string& object,
+                           ossim_uint32& objectIndex,
+                           ossim_uint32& paramIndex,
+                           ossimKeywordlist& kwl )
+{
+   bool result = false;
+   char c;
+   std::string name;
+
+   // Get the name:
+   while ( is.good() )
+   {
+      int i = is.peek(); // Don't gobble the trailing comma or bracket.
+      
+      if ( (i == ',') || (i == ']') || (i == ')') )
+      {
+         // End of param.
+         if ( name.size() )
+         {
+            // Add to keyword list.
+            std::string key;
+            if ( prefix.size() )
+            {
+               key += prefix;
+            }
+            key += object;
+            key += ".param";
+            key += ossimString::toString(paramIndex).string();
+            kwl.addPair( key, name );
+            name = "";
+            ++paramIndex;
+            result = true;
+         }
+         
+         break; // Next param or at end of object.
+      }
+
+      is.get(c);
+      if ( is.good() )
+      {
+         // Look nexted object.
+         if ( (c == '[') || (c == '(') )
+         {
+            std::string myPrefix;
+            if ( prefix.size() )
+            {
+               myPrefix += prefix;
+            }
+            
+            myPrefix += object;
+
+            myPrefix += ".";
+
+            //---
+            // Special hack for duplicated keyword "PARAMETER"
+            //---
+            if ( name == "PARAMETER" )
+            {
+               name += ossimString::toString(objectIndex).string();
+               ++objectIndex;
+            }
+
+            result = parseObject( is, myPrefix, name, kwl );
+
+            name = "";
+         }
+         else
+         {
+            name.push_back(c);
+         }
+      }
+   }
+   
+   return result;
+}
+
diff --git a/src/support_data/ossimXmpInfo.cpp b/src/support_data/ossimXmpInfo.cpp
new file mode 100644
index 0000000..6cd7c21
--- /dev/null
+++ b/src/support_data/ossimXmpInfo.cpp
@@ -0,0 +1,644 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Extensible Metadata Platform (XMP) Info object.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/support_data/ossimXmpInfo.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimEndian.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/base/ossimXmlNode.h>
+#include <ossim/projection/ossimBilinearProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <sstream>
+#include <vector>
+
+// Static trace for debugging.
+static const ossimTrace traceDebug( ossimString("ossimXmpInfo:debug") );
+
+ossimXmpInfo::ossimXmpInfo()
+   : ossimInfoBase(),
+     m_file(),
+     m_xmpApp1XmlBlock()
+{
+}
+
+ossimXmpInfo::~ossimXmpInfo()
+{
+}
+
+bool ossimXmpInfo::open(const ossimFilename& file)
+{
+   //---
+   // NOTE:
+   // This parser was written for a specific aerial camera.  If something more generic is
+   // needed please provide sample to the group. D. Burken, 17 January 2013.
+   //---
+   
+   bool result = false;
+
+   //---
+   // Open the file.
+   //---
+   std::ifstream str(file.c_str(), std::ios_base::binary|std::ios_base::in);
+   if ( str.good() ) 
+   {
+      // Parse for XMP APP1 XML block. Currently only case.
+      std::string xmlString;
+      result = getXmpApp1XmlBlock( str, xmlString );
+      if ( result )
+      {
+         m_file = file;
+         m_xmpApp1XmlBlock = xmlString;
+      }
+      else
+      {
+         m_file.clear();
+         m_xmpApp1XmlBlock.clear();
+      }
+   }
+
+   return result;
+}
+
+bool ossimXmpInfo::getXmpApp1XmlBlock( std::ifstream& str, std::string& xmpApp1XmlBlock ) const
+{
+   bool result = false;
+
+   if ( str.good() )
+   {
+      ossim_uint8 c;
+      
+      // Look for Start Of Image (SOI) marker 0xFFD8:
+      str.read( (char*)&c, 1);
+      if ( c == 0xff )
+      {
+         str.read( (char*)&c, 1);
+         if ( c == 0xd8 )
+         {
+            // Found SOI marker.
+            
+            // Now find APP1 marker 0xffe1.  Only do 24 iterations max:
+            for ( ossim_uint32 i = 0; i < 24; ++i )
+            {
+               str.read( (char*)&c, 1);
+               if ( c == 0xff )
+               {
+                  str.read( (char*)&c, 1);
+                  if ( c == 0xe1 )
+                  {
+                     // Found APP1 marker.
+                     
+                     //---
+                     // Next two bytes are the length, MSB first (big endian) per jpeg spec.
+                     // length = 2 + 29 + length_of_xmp_packet
+                     //---
+                     ossim_uint16 xpacketLength = 0;
+                     str.read( (char*)&xpacketLength, 2 );
+                     
+                     // See if system is not big endian and swap if needed.
+                     if ( ossim::byteOrder() != OSSIM_BIG_ENDIAN )
+                     {
+                        ossimEndian swapper;
+                        swapper.swap( xpacketLength );
+                     }
+                     
+                     if ( xpacketLength > 31 )
+                     {
+                        //---
+                        // XMP namepsace URI, used as unique ID:
+                        // Null terminated ascii string: "http://ns.adobe.com/xap/1.0/"
+                        // (29 bytes)
+                        // Not using getline until ID verified.
+                        //---
+                        const ossim_uint32 XMP_ID_SIZE = 29;
+                        std::vector<char> v( XMP_ID_SIZE );
+                        
+                        // Read the next 29 bytes.  (string + null)
+                        str.read( &v.front(), XMP_ID_SIZE );
+                        
+                        // Copy.
+                        v.push_back( '\0' ); // Just in case string is bad.
+                        std::string s = &v.front();
+                        
+                        if ( s == "http://ns.adobe.com/xap/1.0/" )
+                        {
+                           //---
+                           // Now read header to determine encoding:
+                           // Note: Currently hard coded for UTF-8.
+                           //---
+                           
+                           //---
+                           // Look for "<?xpacket begin="
+                           // Line has binary data in it or getline could be used.
+                           //---
+                           const ossim_uint32 HEADER_SIZE = 16;
+                           v.resize( HEADER_SIZE );
+                           str.read( &v.front(), HEADER_SIZE );
+                           
+                           v.push_back( '\0' ); // Null terminate.
+                           s = &v.front();
+                           
+                           if ( s == "<?xpacket begin=" )
+                           {
+                              // Skip the quote which can be single or double.
+                              str.seekg( 1, std::ios_base::cur );
+                              
+                              // Now look for 0xEF, 0xBB, 0xBF which is UTF-8
+                              ossim_uint8 encode_bytes[3];
+                              str.read( (char*)encode_bytes, 3 );
+                              
+                              if ( ( encode_bytes[0] == 0xef ) &&
+                                   ( encode_bytes[1] == 0xbb ) &&
+                                   ( encode_bytes[2] == 0xbf ) )
+                              {
+                                 // Skip the next six bytes: "' id='"
+                                 str.seekg( 6, std::ios_base::cur );
+                                 
+                                 // Read the ID: W5M0MpCehiHzreSzNTczkc9d
+                                 const ossim_uint32 XPACKET_ID_SIZE = 24;
+                                 v.resize( XPACKET_ID_SIZE );
+                                 str.read ( &v.front(), XPACKET_ID_SIZE );
+                                 
+                                 v.push_back( '\0' ); // null terminate
+                                 s = &v.front();
+                                 
+                                 if ( s == "W5M0MpCehiHzreSzNTczkc9d" )
+                                 {
+                                    //---
+                                    // Gobble the rest of the line. No more binary characters
+                                    // so just use getline.
+                                    //---
+                                    std::getline( str, s );
+                                    
+                                    // Read in the xml string (single line):
+                                    std::getline( str, xmpApp1XmlBlock );
+                                    
+                                    if ( xmpApp1XmlBlock.size() )
+                                    {
+                                       result = true;
+                                    }
+                                 }
+                              }
+                              
+                           } // Matches: if ( s == "<?xpacket begin=" )
+                           
+                        } // Matches: if ( s == "http://ns.adobe.com/xap/1.0/" )
+                        
+                     } // Matches: if ( xpacketLength > 31 )
+                  
+                  } // Matches: if ( c == 0xd8 )
+                  
+               } // Matches: if ( c == 0xff )
+               
+            } // Matches: for ( ossim_uint32 i; i < 24; ++i )
+            
+         } // Matches: if ( c == 0xd8 )
+         
+      } // Matches: if ( c == 0xff )
+      
+   } // Matches: if ( str.good() ) 
+
+   return result;
+   
+} // End: ossimXmpInfo::getXmpApp1XmlBlock
+
+std::ostream& ossimXmpInfo::print(std::ostream& out) const
+{
+   if ( getXmpApp1XmlBlock().size() )
+   {
+      std::string prefix = "";
+      std::string ext = m_file.ext().downcase().string();
+      if ( ( ext == "jpg" ) || ( ext == "jpeg" ) )
+      {
+         prefix = "jpeg.";
+      }
+      
+      std::string s;
+
+      // Date:
+      getDate( s );
+      if ( s.size() )
+      {
+         out << prefix << "acquisitionDate: " << s << std::endl;
+      }      
+      
+      // Mission ID:
+      getMissionId( s );
+      if ( s.size() )
+      {
+         out << prefix << "missionId: " << s << std::endl;
+      }
+
+      // Sensor ID:
+      getSensorId( s );
+      if ( s.size() )
+      {
+         out << prefix << "sensorId: " << s << std::endl;
+      }
+      
+      out << prefix << "xmp.app1.xml: " << getXmpApp1XmlBlock() << std::endl;
+      
+   }
+   return out;
+
+} // End: std::ostream& ossimXmpInfo::print(std::ostream& out) const
+
+const std::string& ossimXmpInfo::getXmpApp1XmlBlock() const
+{
+   return m_xmpApp1XmlBlock;
+}
+
+ossimRefPtr<ossimProjection> ossimXmpInfo::getProjection( const ossimDrect& imageRect ) const
+{
+   ossimRefPtr<ossimProjection> result = 0;
+
+   if ( getXmpApp1XmlBlock().size() && ( imageRect.hasNans() == false ) )
+   {
+      // Open a stream to the xml block.
+      std::istringstream is;
+      is.str( m_xmpApp1XmlBlock );
+
+      ossimXmlDocument xmlDoc;
+
+      // Read the xml document:
+      if ( xmlDoc.read( is ) )
+      {
+         // Find the four corner ground points.
+         ossimString s;
+         ossimString path;
+         ossimGpt ulg;
+         ossimGpt urg;
+         ossimGpt lrg;
+         ossimGpt llg;
+         bool foundAll = false;
+
+         while ( 1 )
+         {
+            // Upper left:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UL_Latitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               ulg.lat = s.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UL_Longitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               ulg.lon = s.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+
+            // Upper right:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UR_Latitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               urg.lat = s.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:UR_Longitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               urg.lon = s.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            
+            // Lower right:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LR_Latitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               lrg.lat = s.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LR_Longitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               lrg.lon = s.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            
+            // Lower left:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LL_Latitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               llg.lat = s.toFloat64();
+            }
+            else
+            {
+               break;
+            }
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:LL_Longitude";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               llg.lon = s.toFloat64();
+
+               // If we get here mark the status good:
+               foundAll = true;
+            }
+            else
+            {
+               break;
+            }
+
+            //---
+            // Final trailing break out of infinite loop.
+            // No code past this point if while loop.
+            //---
+            break;
+         }
+
+         if ( foundAll )
+         {
+            result = new ossimBilinearProjection( imageRect.ul(),
+                                                  imageRect.ur(),
+                                                  imageRect.lr(),
+                                                  imageRect.ll(),
+                                                  ulg,
+                                                  urg,
+                                                  lrg,
+                                                  llg );
+         }
+         
+      } // Matches: if ( xmlDoc.read( is ) )
+      
+   } // Matches: if ( getXmpApp1XmlBlock().size() )
+   
+   return result;
+   
+} // End: ossimXmpInfo::getProjection
+
+void  ossimXmpInfo::getDate( std::string& date ) const
+{
+   date.clear();
+   
+   if ( getXmpApp1XmlBlock().size() )
+   {
+      // Open a stream to the xml block.
+      std::istringstream is;
+      is.str( m_xmpApp1XmlBlock );
+      
+      ossimXmlDocument xmlDoc;
+      
+      // Read the xml document:
+      if ( xmlDoc.read( is ) )
+      {
+         //---
+         // ISO8601 date in the form of: YYYY-MM-DDThh:mm:ss.sssZ
+         // Find the four corner ground points.
+         //---
+         ossimString s;
+         ossimString path;
+         std::string year;
+         std::string month;
+         std::string dayOfMonth;
+         std::string hour;
+         std::string minute;
+         std::string second;
+         std::string milliSecond;
+         
+         bool foundAll = false;
+
+         while ( 1 )
+         {
+            // year:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Year";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               year = s.string();
+            }
+            else
+            {
+               break;
+            }
+            // month:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Month";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               month = s.string();
+            }
+            else
+            {
+               break;
+            }
+            
+            // day of month:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Day_of_Month";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               dayOfMonth = s.string();
+            }
+            else
+            {
+               break;
+            }
+            
+            // hour:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Hour";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               hour = s.string();
+            }
+            else
+            {
+               break;
+            }
+            
+            // minute:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Min";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               minute = s.string();
+            }
+            else
+            {
+               break;
+            }
+            
+            // second:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Sec";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               second = s.string();
+            }
+            else
+            {
+               break;
+            }
+            
+            // millisecond:
+            path = "/x:xmpmeta/rdf:RDF/rdf:Description/dc:IRIG_Msec";
+            if ( getPath( path, xmlDoc, s ) )
+            {
+               milliSecond = s.string();
+            }
+            else
+            {
+               break;
+            }
+
+            // If we get here mark the status good for downstream code.
+            foundAll = true;
+            
+            //---
+            // Final trailing break out of infinite loop.
+            // No code past this point if while loop.
+            //---
+            break;
+
+         } // End: while ( 1 )
+         
+         if ( foundAll )
+         {
+            date = year + "-"; // Assuming year in 4 digit form, e.g. 2013.
+
+            // Month two digit wide.
+            std::ostringstream os1;
+            os1 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
+                << std::setfill('0')
+                << std::setw(2)
+                << month;
+            date += os1.str() + "-";
+
+            // Day two digit wide.
+            std::ostringstream os2;
+            os2 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
+                << std::setfill('0')
+                << std::setw(2)
+                << dayOfMonth;
+            date += os2.str() + "T";
+
+            // Hour two digit wide.
+            std::ostringstream os3;
+            os3 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
+                << std::setfill('0')
+                << std::setw(2)
+                << hour;
+            date += os3.str() + ":";
+
+            // Minute two digit wide.
+            std::ostringstream os4;
+            os4 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
+                << std::setfill('0')
+                << std::setw(2)
+                << minute;
+            date += os4.str() + ":";
+
+            // Second two digit wide.
+            std::ostringstream os5;
+            os5 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
+                << std::setfill('0')
+                << std::setw(2)
+                << second;
+            date += os5.str() + ".";
+
+             // Milli second three digit wide.
+            std::ostringstream os6;
+            os6 << std::setiosflags(std::ios_base::fixed|std::ios_base::right) 
+                << std::setfill('0')
+                << std::setw(3)
+                << milliSecond;
+            date += os6.str() + "Z"; // Assumption...
+         }
+         
+      } // Matches: if ( xmlDoc.read( is ) )
+      
+   } // Matches: if ( getXmpApp1XmlBlock().size() )
+   
+} // End: void  ossimXmpInfo::getDate( std::string& date ) const
+
+
+void ossimXmpInfo::getMissionId( std::string& mission ) const
+{
+   // Currently nothing in sample data to grab so using mission "x".
+   mission = "x";
+}
+
+void ossimXmpInfo::getSensorId( std::string& sensor ) const
+{
+   // Currently nothing in sample data to grab so using sensor "x".
+   sensor = "x";
+}
+
+bool ossimXmpInfo::getPath(
+   const ossimString& path, const ossimXmlDocument& xdoc, ossimString& s) const
+{
+   bool result = false;
+
+   std::vector<ossimRefPtr<ossimXmlNode> > xnodes;
+   xdoc.findNodes(path, xnodes);
+   if ( xnodes.size() == 1 ) // Error if more than one.
+   {
+      if ( xnodes[0].valid() )
+      {
+         s = xnodes[0]->getText();
+         result = true;
+      }
+      else if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimXmpInfo::getPath ERROR:\n"
+            << "Node not found: " << path
+            << std::endl;
+      }
+   }
+   else if ( xnodes.size() == 0 )
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimXmpInfo::getPath ERROR:\n"
+            << "Node not found: " << path
+            << std::endl;
+      }
+   }
+   else
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimXmpInfo::getPath ERROR:\n"
+            << "Multiple nodes found: " << path
+            << std::endl;
+      }
+   }
+
+   if (!result)
+   {
+      s.clear();
+   }
+   return result;
+   
+} // bool ossimXmpInfo::getPath
+
diff --git a/src/util/Notes.txt b/src/util/Notes.txt
new file mode 100644
index 0000000..e81256c
--- /dev/null
+++ b/src/util/Notes.txt
@@ -0,0 +1,34 @@
+X  AutoReg 
+X  Equation
+U  FileWalker
+U  Info
+X  OrthoIgen
+CP PointCloud
+   --pc
+   
+CP Slope
+   --dem|BB
+   
+CP Viewshed
+   --dem|BB --image
+   
+CP Hillshade
+   --dem|BB [--image]
+   
+CP HLZ
+   [--pc] --dem|BB [--image]
+   
+CP 2CMV
+   --imageA --imageB
+   
+CP ColorRelief
+   --dem|BB --lut
+   
+CP Ortho
+   --image [--dem]
+   
+CP Chip
+   --image
+   
+CP PSM
+   --image_pan --image_ms
diff --git a/src/util/ossimAutRegUtil.cpp b/src/util/ossimAutRegUtil.cpp
new file mode 100755
index 0000000..030f23f
--- /dev/null
+++ b/src/util/ossimAutRegUtil.cpp
@@ -0,0 +1,1747 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimAutRegUtil.cpp
+//
+// License:  LGPL
+// 
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Hicks
+//
+// Description: Utility class for autonomous registration operations.
+//
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/util/ossimAutRegUtil.h>
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimDate.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimTieMeasurementGeneratorInterface.h>
+#include <ossim/base/ossimAdjustmentExecutive.h>
+#include <ossim/base/ossimPointObservation.h>
+#include <ossim/base/ossimObservationSet.h>
+
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/init/ossimInit.h>
+
+#include <iostream>
+
+static ossimTrace traceDebug ("ossimAutRegUtil:debug");
+static ossimTrace traceLog("ossimAutRegUtil:log");
+static ossimTrace traceOptions("ossimAutRegUtil:options");
+
+static const std::string APPLICATION_NAME_KW            = "application_name";
+static const std::string ADJ_DESC_LABEL_KW              = "adj_desc_label";
+static const std::string FALSE_KW                       = "false";
+static const std::string IMG_1_KW                       = "img_1";
+static const std::string IMG_2_KW                       = "img_2";
+static const std::string IMG_M_KW                       = "img_m"; // master
+static const std::string IMG_S_KW                       = "img_s"; // slave
+static const std::string OP_KW                          = "operation";
+static const std::string SRC_FILE_KW                    = "src_file";
+static const std::string TRUE_KW                        = "true";
+static const std::string ROI_CENTER_LAT_KW              = "roi_center_lat";
+static const std::string ROI_CENTER_LON_KW              = "roi_center_lon";
+static const std::string ROI_RADIUS_KW                  = "roi_radius";  // meters
+static const std::string ROI_HEIGHT_KW                  = "roi_height";  // pixels
+static const std::string ROI_MAX_LAT_KW                 = "roi_max_lat";
+static const std::string ROI_MAX_LON_KW                 = "roi_max_lon";
+static const std::string ROI_MIN_LAT_KW                 = "roi_min_lat";
+static const std::string ROI_MIN_LON_KW                 = "roi_min_lon";
+static const std::string ROI_WIDTH_KW                   = "roi_width";   // pixels
+static const std::string REPORT_FILE_KW                 = "report_file";
+        
+static const std::string FILE_KW                 = "file";
+static const std::string IMG_KW                  = "image";
+static const std::string READER_PROPERTY_KW      = "reader_property";
+
+static const std::string OCV_CONFIG_FILE_KW             = "ocv_config_file";
+static const std::string OCV_DETECTOR_NAME_KW           = "ocv_detector_name";
+static const std::string OCV_DRAW_MATCHES_FLAG_KW       = "ocv_draw_matches_flag";
+static const std::string OCV_EXTRACTOR_NAME_KW          = "ocv_extractor_name";
+static const std::string OCV_MATCHER_NAME_KW            = "ocv_matcher_name";
+static const std::string OCV_MAX_MATCHES_KW             = "ocv_max_matches";
+static const std::string OCV_USE_CROSS_CHECK_KW         = "ocv_use_cross_check";
+static const std::string OCV_USE_GRID_ADAPTED_DETECT_KW = "ocv_use_grid_adapted_detect";
+static const std::string OCV_RESULTS_WINDOW_SHOW_KW     = "ocv_results_window_show";//????
+
+static const std::string OAX_CONFIG_FILE_KW             = "oax_config_file";
+static const std::string OAX_CONVERGENCE_CRITERIA_KW    = "oax_convergence_criteria";
+static const std::string OAX_GROUND_SIGMA_KW            = "oax_ground_sigma";
+static const std::string OAX_LAT_SIGMA_KW               = "oax_lat_sigma";
+static const std::string OAX_LON_SIGMA_KW               = "oax_lon_sigma";
+static const std::string OAX_HGT_SIGMA_KW               = "oax_hgt_sigma";
+static const std::string OAX_CONTROL_SIGMA_KW           = "oax_control_sigma";
+static const std::string OAX_MAX_ITERATIONS_KW          = "oax_max_iterations";
+
+
+//*****************************************************************************
+//  METHOD: ossimAutRegUtil::ossimAutRegUtil()
+//  
+//  Constructor.
+//*****************************************************************************
+ossimAutRegUtil::ossimAutRegUtil()
+   : ossimReferenced(),
+     m_tGen(0),
+     m_tGenObj(0),
+     m_roiRects(),
+     m_showMatchWindow(false),
+     m_adjExec(0),
+     m_obsSet(0),
+     m_LatLonHgtSigmas(),
+     m_LatLonHgtControlSigmas(),
+     m_rep(0),
+     m_imgLayer(0),
+     m_kwl(new ossimKeywordlist()),
+     m_ocvKwl(0),
+     m_oaxKwl(0),
+     m_srcKwl(0),
+     m_operation(OSSIM_AUTREG_OP_UNKNOWN)
+{
+   // traceDebug.setTraceFlag(true);
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nossimAutRegUtil::ossimAutRegUtil 1 DEBUG:" << std::endl;
+   }
+
+   // Default tie point ground sigmas
+   m_LatLonHgtSigmas[0] = 50.0;
+   m_LatLonHgtSigmas[1] = 50.0;
+   m_LatLonHgtSigmas[2] = 50.0;
+
+   // Default control point ground sigmas
+   m_LatLonHgtControlSigmas[0] = 1.0;
+   m_LatLonHgtControlSigmas[1] = 1.0;
+   m_LatLonHgtControlSigmas[2] = 1.0;
+
+   // ossimImageGeometry
+   m_geom[0] = 0;
+   m_geom[1] = 0;
+
+   // Default control image flags
+   m_controlImage[0] = false;
+   m_controlImage[1] = false;
+
+
+   m_kwl->setExpandEnvVarsFlag(true);
+
+}
+
+// Private/hidden
+ossimAutRegUtil::ossimAutRegUtil( const ossimAutRegUtil& /* obj */ )
+{
+}
+
+// Private/hidden
+const ossimAutRegUtil& ossimAutRegUtil::operator=( const ossimAutRegUtil& /* rhs */)
+{
+   return *this;
+}
+
+
+//*****************************************************************************
+//  DESTRUCTOR: ~ossimAutRegUtil()
+//*****************************************************************************
+ossimAutRegUtil::~ossimAutRegUtil()
+{
+   
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ~ossimAutRegUtil(): entered..." << std::endl;
+
+   clear();
+
+   *m_rep << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
+   *m_rep << endl;
+
+   if (traceDebug())  ossimNotify(ossimNotifyLevel_DEBUG)
+      << "DEBUG: ~ossimAutRegUtil(): returning..." << std::endl;
+}
+
+
+void ossimAutRegUtil::addArguments(ossimArgumentParser& ap)
+{
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [option]... [input-option]... -img_1 <input-file 1> -img_2 <input-file 2>\n\nAvailable traces:\n-T \"ossimAutRegUtil:debug\"   - General debug trace to standard out.\n-T \"ossimAutRegUtil:log\"     - Writes a log file to output-file.log.\n-T \"ossimAutRegUtil:options\" - Writes the options to output-file-options.kwl.";
+
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   
+   au->setCommandLineUsage(usageString);
+    
+   au->setDescription(ap.getApplicationName()+": Utility application for autonomous image registration.");
+
+   au->addCommandLineOption("-h or --help", "Display this help and exit.");
+
+   au->addCommandLineOption("--quality", "<quality>\nNOT WORKING... Desired quality of tiepoint collection.\nRange: 1 to 5, Default = 3");
+   
+   au->addCommandLineOption("--roi-center-llwh","<latitude> <longitude> <width> <height>\nSpecify the center ROI in latitude longitude space with width and height in pixels.");
+
+   au->addCommandLineOption("--roi-center-llr","<latitude> <longitude> <radius_in_meters>\nSpecify the center ROI in latitude longitude space with radius in meters.");
+
+   au->addCommandLineOption("--ocv_config_file","<file_path>\nSpecify a keyword list OpenCV configuration file.");
+
+   au->addCommandLineOption("--oax_config_file","<file_path>\nSpecify a keyword list oax configuration file.");
+
+   
+} // End: ossimAutRegUtil::addArguments
+
+
+void ossimAutRegUtil::clear()
+{
+   // Must disconnect chains so that they destroy.
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator i = m_imgLayer.begin();
+   while ( i != m_imgLayer.end() )
+   {
+      (*i)->disconnect();
+      (*i) = 0;
+      ++i;
+   }
+   m_imgLayer.clear();
+
+   // i = m_demLayer.begin();
+   // while ( i != m_demLayer.end() )
+   // {
+   //    (*i)->disconnect();
+   //    (*i) = 0;
+   //    ++i;
+   // }
+   // m_demLayer.clear();
+}
+
+bool ossimAutRegUtil::initialize(ossimArgumentParser& ap)
+{
+   static const char MODULE[] = "ossimAutRegUtil::initialize(ossimArgumentParser&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   clear();
+   if( ap.read("-h") || ap.read("--help") || (ap.argc() == 1) )
+   {
+      usage(ap);
+      
+      return false; // Indicates process should be terminated to caller.
+   }
+
+   // Start with clean options keyword list.
+   m_kwl->clear();
+
+   std::string tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+   std::string tempString2;
+   ossimArgumentParser::ossimParameter stringParam2(tempString2);
+   std::string tempString3;
+   ossimArgumentParser::ossimParameter stringParam3(tempString3);
+   std::string tempString4;
+   ossimArgumentParser::ossimParameter stringParam4(tempString4);
+
+   double tempDouble1;
+   ossimArgumentParser::ossimParameter doubleParam1(tempDouble1);
+   double tempDouble2;
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+
+   ossimString key = "";
+   
+   // Extract arguments and stuff them in a keyword list.
+   if( ap.read("--report_file", stringParam1) )
+   {
+      m_kwl->addPair( std::string(REPORT_FILE_KW), tempString1 );
+   }
+
+   // report file
+   if( ap.read("--quality", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::QUALITY_KW), tempString1 );
+   }
+
+   // operation
+   if( ap.read("--op", stringParam1) )
+   {
+      m_kwl->addPair( OP_KW, tempString1 );
+   }
+
+   // image 1
+   if( ap.read("--img_1", stringParam1))
+   {
+      m_kwl->addPair( std::string(IMG_1_KW), tempString1 );
+   }
+
+   // image 2
+   if( ap.read("--img_2", stringParam1))
+   {
+     m_kwl->addPair( std::string(IMG_2_KW), tempString1 );
+   }
+
+   // master image
+   if( ap.read("--img_m", stringParam1))
+   {
+      m_kwl->addPair( std::string(IMG_M_KW), tempString1 );
+   }
+
+   // slave image
+   if( ap.read("--img_s", stringParam1))
+   {
+     m_kwl->addPair( std::string(IMG_S_KW), tempString1 );
+   }
+
+   // OpenCV config
+   if( ap.read("--ocv_config_file", stringParam1))
+   {
+     m_kwl->addPair( std::string(OCV_CONFIG_FILE_KW), tempString1 );
+   }
+
+   // oax config
+   if( ap.read("--oax_config_file", stringParam1))
+   {
+     m_kwl->addPair( std::string(OAX_CONFIG_FILE_KW), tempString1 );
+   }
+
+   // llwh chipping parameters
+   if( ap.read("--roi-center-llwh", stringParam1, stringParam2, stringParam3, stringParam4) )
+   {
+      m_kwl->addPair( ROI_CENTER_LAT_KW, tempString1 );
+      m_kwl->addPair( ROI_CENTER_LON_KW, tempString2 );
+      m_kwl->addPair( ROI_WIDTH_KW,      tempString3 );
+      m_kwl->addPair( ROI_HEIGHT_KW,     tempString4 );
+   }
+
+   // llr chipping parameters
+   if( ap.read("--roi-center-llr", stringParam1, stringParam2, stringParam3) )
+   {
+      m_kwl->addPair( ROI_CENTER_LAT_KW, tempString1 );
+      m_kwl->addPair( ROI_CENTER_LON_KW, tempString2 );
+      m_kwl->addPair( ROI_RADIUS_KW,     tempString3 );
+   }
+
+   // TODO Necessary???
+   if( ap.read("--input-src", stringParam1) )
+   {
+      m_kwl->addPair( SRC_FILE_KW, tempString1 );
+   }
+
+   // TODO  For now, just an example of using ossimKeywordNames content
+   if( ap.read("--quality", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::QUALITY_KW), tempString1 );
+   }
+
+   //---
+   // Deprecated: "--options-keyword-list"
+   //---
+   if( ap.read("--options", stringParam1) )
+   {
+      ossimFilename optionsKwl = tempString1;
+      if ( optionsKwl.exists() )
+      {
+         if ( m_kwl->addFile(optionsKwl) == false )
+         {
+            std::string errMsg = "ERROR could not open options keyword list file: ";
+            errMsg += optionsKwl.string();
+            throw ossimException(errMsg);
+         }
+      }
+      else
+      {
+         std::string errMsg = "ERROR options keyword list file does not exists: ";
+         errMsg += optionsKwl.string();
+         throw ossimException(errMsg); 
+      }
+   }
+
+
+   // End of arg parsing.
+
+
+   ap.reportRemainingOptionsAsUnrecognized();
+   if ( ap.errors() )
+   {
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      std::string errMsg = "Unknown option...";
+      throw ossimException(errMsg);
+   }
+
+
+   if ( ap.argc() >= 2 )
+   {
+      // Output file is last arg:
+      m_kwl->add( ossimKeywordNames::OUTPUT_FILE_KW, ap[ap.argc()-1]);
+   }
+   else
+   {
+      if ( !m_kwl->find(ossimKeywordNames::OUTPUT_FILE_KW) )
+      {
+         ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+         std::string errMsg = "Must supply an output file.";
+         throw ossimException(errMsg);
+      }
+   }
+
+   if ( ap.argc() > 2 ) // User passed inputs in front of output file.
+   {
+      int pos = 1; // ap.argv[0] is application name. 
+      while ( pos < (ap.argc()-1) )
+      {
+         ossimFilename file = ap[pos];
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "argv[" << pos << "]: " << file << "\n";
+         }
+         
+         if ( isSrcFile(file) ) 
+         {
+            if ( m_kwl->find( SRC_FILE_KW.c_str() ) ) // --input-src used also
+            {
+               std::string errMsg = MODULE;
+               errMsg += "ERROR Multiple src files passed in.  Please combine into one.";
+               throw ossimException(errMsg);
+            }
+            
+            m_kwl->addPair( SRC_FILE_KW, file.string() );
+         }
+         else // Add as an input image.
+         {
+            // key = IMG_KW;
+            // key += ossimString::toString(imgIdx);
+            // key += ".";
+            // key += FILE_KW;
+            // m_kwl->addPair(key.string(), file.string() );
+            // ++imgIdx;
+         }
+         
+         ++pos; // Go to next arg...
+         
+      } // End: while ( pos < (ap.argc()-1) )
+       
+   } // End: if ( ap.argc() > 2 )
+
+   initialize();
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
+   }  
+   return true;
+   
+} // End: void ossimAutRegUtil::initialize(ossimArgumentParser& ap)
+
+
+void ossimAutRegUtil::initialize( const ossimKeywordlist& kwl )
+{
+   clear();
+
+   // Start with clean options keyword list.
+   m_kwl->clear();
+
+   m_kwl->addList( kwl, true );
+
+   initialize();
+}
+
+
+
+void ossimAutRegUtil::initialize()
+{
+   static const char MODULE[] = "ossimAutRegUtil::initialize()";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+   
+   if ( traceOptions() )
+   {
+      ossimFilename optionsFile;
+      getOutputFilename(optionsFile);
+      optionsFile = optionsFile.noExtension();
+      optionsFile += "-options.kwl";
+      ossimString comment = " Can be use for --options argument.";
+      m_kwl->write( optionsFile.c_str(), comment.c_str() );
+   }
+
+   // Determine the operation to do.
+   std::string op = m_kwl->findKey( OP_KW );
+   if ( op.size() )
+   {
+      ossimString s = op;
+      s.downcase();
+      
+      if ( s == "coreg" )
+      {
+         m_operation = OSSIM_AUTREG_OP_COREG;
+      }
+      else if ( s == "masreg" )
+      {
+         m_operation = OSSIM_AUTREG_OP_MASREG;
+      }
+      else
+      {
+         std::string errMsg = "unknown operation: ";
+         errMsg += s.string();
+         throw ossimException(errMsg);
+      }
+   }
+   else
+   {
+      std::string errMsg = "keyword not found: ";
+      errMsg += OP_KW;
+      errMsg += "\nUse --op option to specify operation.\n";
+      throw ossimException(errMsg);  
+   }
+
+   //---
+   // Report file
+   //---
+   ossimFilename repFile = m_kwl->findKey( REPORT_FILE_KW );
+
+   if (repFile.size())
+   {
+      m_rep = new ofstream( repFile.c_str(), ios::out );
+   }
+   else
+   {
+      m_rep = &std::cout;
+   }
+   *m_rep << "\n ossimAutRegUtil Summary..."<<std::endl;
+   ossimString ts;
+   ossim::getFormattedTime("%a %m.%d.%y %H:%M:%S", false, ts);
+   *m_rep << "\n" << ts;
+   *m_rep << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
+   *m_rep << endl;
+
+
+   //---
+   // Populate the m_srcKwl if --src option was set.
+   // Note do this before creating chains.
+   //---
+   initializeSrcKwl();
+   
+   //---
+   // Load OpenCV config if --ocv_config_file option was set.
+   //---
+   initializeOcvKwl();
+   
+   //---
+   // Load oax config if --oax_config_file option was set.
+   //---
+   initializeOaxKwl();
+
+
+   //---
+   // Load input image pair
+   //---
+   if (!loadImages())
+   {
+      throw ossimException("loadImages() failed...");
+   }
+
+//=========================================================
+// TODO...  Is there a possibility of ortho image input?
+//   What about associated geometry/adjustbale parameters?
+//=========================================================
+   //--
+   // Raw image input
+   //--
+   createIdentityProjection(0);
+   createIdentityProjection(1);
+
+
+   //---
+   // Determine overlap ROIs
+   //---
+   if (!delineateROIs())
+   {
+      throw ossimException("delineateROIs() failed...");
+   }
+
+
+   if ( traceLog() )
+   {
+      ossimKeywordlist logKwl;
+      // m_writer->saveStateOfAllInputs(logKwl);
+      
+      ossimFilename logFile;
+      getOutputFilename(logFile);
+      logFile.setExtension("log");
+
+      logKwl.write( logFile.c_str() );
+   }
+
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "options keyword list:\n"
+         << *(m_kwl.get()) << "\n";
+      
+      if ( m_srcKwl.valid() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "support record keyword list:\n"
+            << *(m_srcKwl.get()) << "\n";
+      }
+   }
+
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Instantiate ossimTieMeasurementGenerator
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    m_tGenObj = ossimObjectFactoryRegistry::instance()->
+      createObject(ossimString("ossimTieMeasurementGenerator"));
+   if(m_tGenObj.valid())
+   {
+      m_tGen = dynamic_cast<ossimTieMeasurementGeneratorInterface*> (m_tGenObj.get());
+   }
+   else
+   {
+      throw ossimException("ossimTieMeasurementGenerator createObject failed...");
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+} // End: void ossimAutRegUtil::initialize()
+
+
+
+//*****************************************************************************
+//  METHOD: ossimAutRegUtil::loadImages()
+//  
+//  Load image pair.
+//  
+//*****************************************************************************
+bool ossimAutRegUtil::loadImages()
+{
+   static const char MODULE[] = "ossimAutRegUtil::loadImages";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   bool isGoodLoad = false;
+   ossimFilename inputFile;
+
+   ossimString key;
+
+
+   // Load 1st image
+   if (m_operation == OSSIM_AUTREG_OP_COREG)
+   {
+      key = IMG_1_KW;
+   }
+   else  // Load master image
+   {
+      key = IMG_M_KW;
+      m_controlImage[0] = true;
+   }
+   inputFile = m_kwl->findKey(key.string());
+   if (addImgSource(inputFile, 0 ))
+   {
+      ossimImageHandler *ih1 = m_imgLayer[0]->getImageHandler().get();
+      if (!ih1)
+      {
+         *m_rep << " open for image 1 failed..."<<std::endl;
+      }
+      else
+      {
+         int overviews     = ih1->getNumberOfDecimationLevels();
+         ossimIrect bounds = ih1->getBoundingRect(0);
+         // ossimScalarType scalarType = ih1->getOutputScalarType();
+         ossimScalarTypeLut* lut = ossimScalarTypeLut::instance();
+         *m_rep << "-----------------" << endl
+                << "filename       = " << ih1->getFilename() << endl
+                << "width          = " << bounds.width() << endl
+                << "height         = " << bounds.height() << endl
+                << "overview count = " << (overviews-1) << endl
+                << "scalar type    = " << lut->getEntryString(ih1->getOutputScalarType()) << endl
+                << "Handler used   = " << ih1->getClassName() << endl;
+
+
+         // Load 2nd image
+         if (m_operation == OSSIM_AUTREG_OP_COREG)
+         {
+            key = IMG_2_KW;
+         }
+         else  // Load slave image
+         {
+            key = IMG_S_KW;
+            m_controlImage[1] = false;
+         }
+         inputFile = m_kwl->findKey(key.string());
+         if (addImgSource(inputFile, 0 ))
+         {
+            ossimImageHandler *ih2 = m_imgLayer[1]->getImageHandler().get();
+            if (!ih2)
+            {
+               *m_rep << " open for image 2 failed"<<std::endl;
+            }
+            else
+            {
+               int overviews     = ih2->getNumberOfDecimationLevels();
+               ossimIrect bounds = ih2->getBoundingRect(0);
+               // ossimScalarType scalarType = ih2->getOutputScalarType();
+               ossimScalarTypeLut* lut = ossimScalarTypeLut::instance();
+               *m_rep << "-----------------" << endl
+                      << "filename       = " << ih2->getFilename() << endl
+                      << "width          = " << bounds.width() << endl
+                      << "height         = " << bounds.height() << endl
+                      << "overview count = " << (overviews-1) << endl
+                      << "scalar type    = " << lut->getEntryString(ih2->getOutputScalarType()) << endl
+                      << "Handler used   = " << ih2->getClassName() << endl;
+               *m_rep << "-----------------" << endl;
+               isGoodLoad = true;
+            }
+         }
+      }  
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+   return isGoodLoad;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAutRegUtil::delineateROIs()
+//  
+//  Determine correlation region of interest.
+//  
+//*****************************************************************************
+bool ossimAutRegUtil::delineateROIs()
+{
+   static const char MODULE[] = "ossimAutRegUtil::delineateROIs";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   bool isGoodOp = false;
+
+   for (int img=0; img<2; ++img)
+   {
+      ossimIrect rect;
+      rect.makeNan();
+   
+      ossimImageSource* source = m_imgLayer[img].get();
+      
+      if ( source )
+      {
+   
+         if ( m_geom[img].valid() )
+         {
+            if ( m_kwl->find( ROI_CENTER_LAT_KW.c_str() ) ) 
+            {
+               // "ROI Center" with: --roi-center-llwh or --roi-center-llr:
+               ossimString latStr = m_kwl->findKey( ROI_CENTER_LAT_KW );
+               ossimString lonStr = m_kwl->findKey( ROI_CENTER_LON_KW );
+               if ( latStr.size() && lonStr.size() )
+               {
+                  ossimGpt centerGpt;
+   
+                  //---
+                  // Want the height nan going into worldToLocal call so it gets picked
+                  // up by the elevation manager.
+                  //---
+                  centerGpt.makeNan(); 
+   
+                  centerGpt.lat = latStr.toFloat64();
+                  centerGpt.lon = lonStr.toFloat64();
+   
+                  if ( !centerGpt.isLatNan() && !centerGpt.isLonNan() )
+                  {
+                     // Ground "cut center" to view:
+                     ossimDpt centerDpt(0.0, 0.0);
+                     m_geom[img]->worldToLocal(centerGpt, centerDpt);
+   
+                     if ( !centerDpt.hasNans() )
+                     {
+                        // if ( isIdentity() && m_ivt.valid() ) // Chipping in image space.
+                        if ( m_ivt[img].valid() ) // Chipping in image space.
+                        {
+                           // Transform image center point to view:
+                           ossimDpt ipt = centerDpt;
+                           m_ivt[img]->imageToView( ipt, centerDpt );
+                        }
+                        
+                        // --roi-center-llwh:
+                        ossimString widthStr  = m_kwl->findKey( ROI_WIDTH_KW );
+                        ossimString heightStr = m_kwl->findKey( ROI_HEIGHT_KW );
+                        if ( widthStr.size() && heightStr.size() )
+                        {
+                           ossim_int32 width  = widthStr.toInt32();
+                           ossim_int32 height = heightStr.toInt32();
+                           if ( width && height )
+                           {
+                              ossimIpt ul( ossim::round<int>(centerDpt.x - (width/2)),
+                                           ossim::round<int>(centerDpt.y - (height/2)) );
+                              ossimIpt lr( (ul.x + width - 1), ul.y + height - 1);
+                              rect = ossimIrect(ul, lr);
+                           }
+                        }
+                        else // --roi-center-llr: 
+                        {
+                           ossimString radiusStr = m_kwl->findKey( ROI_RADIUS_KW );
+                           if ( radiusStr.size() )
+                           {
+                              ossim_float64 radius = radiusStr.toFloat64();
+                              if ( radius )
+                              {
+                                 ossimDpt mpp;
+                                 m_geom[0]->getMetersPerPixel( mpp );
+   
+                                 if ( !mpp.hasNans() )
+                                 {
+                                    ossim_float64 rx = radius/mpp.x;
+                                    ossim_float64 ry = radius/mpp.y;
+                                    
+                                    ossimIpt ul( ossim::round<int>( centerDpt.x - rx ),
+                                                 ossim::round<int>( centerDpt.y - ry ) );
+                                    ossimIpt lr( ossim::round<int>( centerDpt.x + rx ),
+                                                 ossim::round<int>( centerDpt.y + ry ) );
+                                    rect = ossimIrect(ul, lr);
+                                 }
+                              }
+                           }
+                        }
+                     }
+                     
+                  } // Matches: if ( !centerGpt.hasNans() )
+                  
+               } // Matches: if ( latStr && lonStr )
+               
+            } // Matches: if ( m_kwl->find( ROI_CENTER_LAT_KW ) )
+   
+         } // if ( igeom.valid() )
+   
+         else
+         {
+            // Should never happen...
+            std::string errMsg = MODULE;
+            if ( !source )
+            {
+               errMsg += " image source null!";
+            }
+            throw( ossimException(errMsg) );
+         }
+   
+         // rect.print(*m_rep);
+         m_roiRects.push_back(rect);
+      } // if ( source )
+
+   }
+
+   isGoodOp = true;
+
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+   return isGoodOp;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAutRegUtil::populateObsSet()
+//  
+//  Transfer tie points from generator to observation set.
+//  
+//*****************************************************************************
+bool ossimAutRegUtil::populateObsSet()
+{
+   static const char MODULE[] = "ossimAutRegUtil::populateObsSet";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   bool isGoodLoad = true;
+
+   ossimString id;
+   ossimGpt gp;
+
+
+   for (int m=0; m<m_tGen->numMeasurements(); ++m)
+   {
+      id = ossimString::toString(m+1);
+
+      // Initialize ground point
+      gp.makeNan();
+      ossimPointObservation *pt = new ossimPointObservation(gp, id, m_LatLonHgtSigmas);
+
+      for (int img=0; img<2; ++img)
+      {
+         ossimDpt imgPt = m_tGen->pointIndexedAt(img,m);
+         // If control, set ground coordinates and reset sigmas
+         if (m_controlImage[img])
+         {
+            // Point drop to get control coordinates
+            ossimGpt worldPt;
+            m_geom[img]->localToWorld(imgPt, worldPt);
+            if (worldPt.isHgtNan())
+            {
+               ossim_float64 hgt =
+                  ossimElevManager::instance()->getHeightAboveEllipsoid(worldPt);
+               worldPt.height(hgt);
+            }
+            pt->Gpt() = worldPt;
+
+            // Set control sigmas
+            pt->setGroundSigmas
+               (m_LatLonHgtControlSigmas[0],m_LatLonHgtControlSigmas[1],m_LatLonHgtControlSigmas[2]);
+         }
+         else
+         {
+            // Get image filename
+            ossimFilename filename = m_imgLayer[img]->getImageHandler()->getFilename();
+            
+            // Add measurement to point observation
+            pt->addMeasurement(imgPt, filename);
+         }
+      }
+      // Add point observation to set
+      if (pt->numMeas() > 0)
+      {
+         m_obsSet->addObservation(pt);
+      }
+   }
+
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+   return isGoodLoad;
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAutRegUtil::configureTieMeasGenerator()
+//  
+//  Configure the tie measurement generator using m_ocvKwl
+//  
+//*****************************************************************************
+void ossimAutRegUtil::configureTieMeasGenerator()
+{
+   static const char MODULE[] = "ossimAutRegUtil::configureTieMeasGenerator";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   if ( m_ocvKwl.valid() )
+   {
+
+      // Draw OpenCV match window
+      m_showMatchWindow = keyIsTrue(m_ocvKwl, OCV_DRAW_MATCHES_FLAG_KW);
+      m_tGen->setShowCvWindow(m_showMatchWindow);
+   
+      // OpenCV detector
+      if (m_ocvKwl->find(OCV_DETECTOR_NAME_KW.c_str()))
+      {
+         m_tGen->setFeatureDetector(m_ocvKwl->findKey(OCV_DETECTOR_NAME_KW));
+      }
+   
+      // OpenCV descriptor/extractor
+      if (m_ocvKwl->find(OCV_EXTRACTOR_NAME_KW.c_str()))
+      {
+         m_tGen->setDescriptorExtractor(m_ocvKwl->findKey(OCV_EXTRACTOR_NAME_KW));
+      }
+   
+      // OpenCV matcher
+      if (m_ocvKwl->find(OCV_MATCHER_NAME_KW.c_str()))
+      {
+         m_tGen->setDescriptorMatcher(m_ocvKwl->findKey(OCV_MATCHER_NAME_KW));
+      }
+
+      // OpenCV maximum number of matches
+      if (m_ocvKwl->find(OCV_MAX_MATCHES_KW.c_str()))
+      {
+         ossimString maxMatches = m_ocvKwl->findKey(OCV_MAX_MATCHES_KW);
+         if (maxMatches.size())
+         {
+            ossim_int32 max  = maxMatches.toInt32();
+            m_tGen->setMaxMatches(max);
+         }
+      }
+   
+      // TODO: set crossCheck currently commented out in ossimTieMeasurementGenerator
+      // m_tGen->setUseCrossCheck(keyIsTrue(m_ocvKwl, OCV_USE_CROSS_CHECK_KW));
+   
+      // Use OpenCV GridAdaptedFeatureDetector
+      m_tGen->setUseGrid(keyIsTrue(m_ocvKwl, OCV_USE_GRID_ADAPTED_DETECT_KW));
+
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAutRegUtil::configureAdjustmentExecutive()
+//  
+//  Configure the adjustment executive using m_oaxKwl
+//  
+//*****************************************************************************
+void ossimAutRegUtil::configureAdjustmentExecutive()
+{
+   static const char MODULE[] = "ossimAutRegUtil::configureAdjustmentExecutive";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   if ( m_oaxKwl.valid() )
+   {
+
+      if (m_oaxKwl->find(OAX_MAX_ITERATIONS_KW.c_str()))
+      {
+         ossimString maxIter = m_oaxKwl->findKey(OAX_MAX_ITERATIONS_KW);
+         if (maxIter.size())
+         {
+            ossim_int32 max  = maxIter.toInt32();
+            m_adjExec->setMaxIter(max);
+         }
+      }
+
+      if (m_oaxKwl->find(OAX_CONVERGENCE_CRITERIA_KW.c_str()))
+      {
+         ossimString conv = m_oaxKwl->findKey(OAX_CONVERGENCE_CRITERIA_KW);
+         if (conv.size())
+         {
+            ossim_float64 convPerc = conv.toFloat64();
+            m_adjExec->setConvCriteria(convPerc);
+         }
+      }
+
+      if (m_oaxKwl->find(OAX_GROUND_SIGMA_KW.c_str()))
+      {
+         ossimString conv = m_oaxKwl->findKey(OAX_GROUND_SIGMA_KW);
+         if (conv.size())
+         {
+            ossim_float64 gndSigma = conv.toFloat64();
+            m_LatLonHgtSigmas[0] = gndSigma;
+            m_LatLonHgtSigmas[1] = gndSigma;
+            m_LatLonHgtSigmas[2] = gndSigma;
+         }
+      }
+
+      if (m_oaxKwl->find(OAX_CONTROL_SIGMA_KW.c_str()))
+      {
+         ossimString conv = m_oaxKwl->findKey(OAX_CONTROL_SIGMA_KW);
+         if (conv.size())
+         {
+            ossim_float64 gndSigma = conv.toFloat64();
+            m_LatLonHgtControlSigmas[0] = gndSigma;
+            m_LatLonHgtControlSigmas[1] = gndSigma;
+            m_LatLonHgtControlSigmas[2] = gndSigma;
+         }
+      }
+
+      if (m_oaxKwl->find(OAX_LAT_SIGMA_KW.c_str()))
+      {
+         ossimString conv = m_oaxKwl->findKey(OAX_LAT_SIGMA_KW);
+         if (conv.size())
+         {
+            ossim_float64 gndLatSigma = conv.toFloat64();
+            m_LatLonHgtSigmas[0] = gndLatSigma;
+         }
+      }
+
+      if (m_oaxKwl->find(OAX_LON_SIGMA_KW.c_str()))
+      {
+         ossimString conv = m_oaxKwl->findKey(OAX_LON_SIGMA_KW);
+         if (conv.size())
+         {
+            ossim_float64 gndLonSigma = conv.toFloat64();
+            m_LatLonHgtSigmas[1] = gndLonSigma;
+         }
+      }
+
+      if (m_oaxKwl->find(OAX_HGT_SIGMA_KW.c_str()))
+      {
+         ossimString conv = m_oaxKwl->findKey(OAX_HGT_SIGMA_KW);
+         if (conv.size())
+         {
+            ossim_float64 gndHgtSigma = conv.toFloat64();
+            m_LatLonHgtSigmas[2] = gndHgtSigma;
+         }
+      }
+
+   }
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+}
+
+
+//*****************************************************************************
+//  METHOD: ossimAutRegUtil::execute()
+//  
+//  Execute registration operation.
+//*****************************************************************************
+void ossimAutRegUtil::execute()
+{
+   static const char MODULE[] = "ossimAutRegUtil::execute";
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Initialize the measurement generator
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   *m_rep<<"\n\n >> Tie point collection follows...\n"<<endl;
+   m_tGen->init(*m_rep);
+
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Configure the measurement generator
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   configureTieMeasGenerator();
+
+
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Load ossimImageSource vector
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   std::vector<ossimImageSource*> src;
+   src.push_back(m_imgLayer[0].get());
+   src.push_back(m_imgLayer[1].get());
+
+
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Set correlation areas
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   m_tGen->setImageList(src);
+   m_tGen->setROIs(m_roiRects);
+
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   // Run the OpenCV detector/extractor/matcher to collect tiepoints
+   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+   if (m_tGen->run())
+   {
+
+      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      // Close match window if active
+      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      if (m_showMatchWindow)
+      {
+         bool waitKey = true;
+         m_tGen->closeCvWindow(waitKey);
+      }
+
+      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      // Check for adjustable parameter interface before adjustment
+      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+      ossimAdjustableParameterInterface* iface1 = m_geom[0]->getAdjustableParameterInterface();
+      ossimAdjustableParameterInterface* iface2 = m_geom[1]->getAdjustableParameterInterface();
+      
+      if (iface1 && iface2)
+      {
+
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         // Create observation set
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         m_obsSet = new ossimObservationSet;
+
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         // Create adjustment executive
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         m_adjExec = new ossimAdjustmentExecutive(*m_rep);
+
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         // Configure adjustment executive
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         configureAdjustmentExecutive();
+
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         // Load measurements into the observation set
+         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+         if (populateObsSet())
+         {
+   
+            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+            // Perform adjustment
+            //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+            bool solutionOK = false;
+         
+            *m_rep<<"\n\n >> Adjustment summary follows...\n"<<endl;
+            if (m_adjExec->initializeSolution(*m_obsSet))
+            {
+               solutionOK = m_adjExec->runSolution();
+               m_adjExec->summarizeSolution();
+               if (solutionOK)
+               {
+                  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                  // Write updated geometry files
+                  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                  saveAdjustment();
+
+                  if (traceDebug())
+                  {
+                     ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << "Solution complete...\n";
+                  }   
+               }
+               else
+               {
+                  throw ossimException("m_adjExec->runSolution() failed...");
+               } //end if m_adjExec->runSolution()
+            }
+            else
+            {
+               throw ossimException("m_adjExec->initializeSolution() failed...");
+            } //end if m_adjExec->initializeSolution()
+      
+         } 
+         else
+         {
+            throw ossimException("populateObsSet() failed...");
+         } //end if (populateObsSet())
+
+      }
+      else
+      {
+         throw ossimException("ossimAdjustableParameterInterface missing...");
+      } //end if (iface1 && iface2)
+
+   }
+   else
+   {
+      throw ossimException( "m_tGen->run() failed...");
+   } //end if (m_tGen->run())
+   
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }   
+}
+
+
+void ossimAutRegUtil::saveAdjustment()
+{
+   ossimString ts;
+   ossim::getFormattedTime("ossim-autreg_%a_%m.%d.%y_%H:%M:%S", false, ts);
+ 
+   ossimAdjustmentInfo* adjInfo = new ossimAdjustmentInfo;
+
+   for (int img=0; img<2; ++img)
+   {
+      if (!m_controlImage[img])
+      {
+         // Get the adjustment info from the bundle adjustment via m_obsSet
+         ossimFilename filename = m_imgLayer[img]->getImageHandler()->getFilename();
+
+         // Oscar, should this be a ref ptr? drb - 20160810
+         ossimAdjustableParameterInterface* adjParIface = 0;
+         for (ossim_uint32 ii=0; ii<m_obsSet->numImages(); ++ii)
+         {
+            if (filename == m_obsSet->imageFile(ii))
+               adjParIface = m_obsSet->getImageGeom(ii)->getAdjustableParameterInterface();
+         }
+
+         if ( adjParIface )
+         {
+            adjParIface->setAdjustmentDescription(ts);
+            adjParIface->getAdjustment(*adjInfo);
+   
+            // Grab adjustable parameter interface and update it with the adjustment info
+            ossimAdjustableParameterInterface* iface = m_geom[img]->getAdjustableParameterInterface();
+            if ( iface )
+            {
+               iface->setAdjustment(*adjInfo, true);
+               ossimFilename fn = m_imgLayer[img]->getImageHandler()->createDefaultGeometryFilename();
+// TODO ***********
+//  dirty flag????
+// fn += "_test";
+// TODO ***********
+               ossimKeywordlist kwl;
+               iface->getBaseObject()->saveState(kwl);
+               kwl.write(fn);
+            }
+         }
+      }
+   }
+
+   delete adjInfo;
+}
+
+
+void ossimAutRegUtil::getOutputFilename(ossimFilename& f) const
+{
+   f.string() = m_kwl->findKey( std::string(ossimKeywordNames::OUTPUT_FILE_KW) );
+}
+
+
+bool ossimAutRegUtil::isSrcFile(const ossimFilename& file) const
+{
+   bool result = false;
+   ossimString ext = file.ext();
+   ext.downcase();
+   if ( ext == "src" )
+   {
+      result = true;
+   }
+   return result;
+}
+
+
+void ossimAutRegUtil::usage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+   
+   // Set app name.
+   std::string appName = ap.getApplicationName();
+   ap.getApplicationUsage()->setApplicationName( ossimString( appName ) );
+
+   // Add options.
+   addArguments(ap);
+   
+   // Write usage.
+   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+
+   // Keeping single line in tact for examples for cut and paste purposes.
+   ossimNotify(ossimNotifyLevel_INFO)
+      << "NOTES:\n"
+      << "1) Note 1 content\n"
+      << "   Note 1 place holder continued...\n"
+      << "2) Note 2 content\n"
+      << "   Note 2 place holder continued...\n"
+      
+      << "\nExample commands:\n"
+
+      << "\n// Co-register image1 and image2 with 512x512 ROIs centered on point:\n"
+      << appName << " --op coreg --img_1 image1.ntf --img_2 image2.ntf --roi-center-llwh 28.097255037664400 -80.630762190246145 512 512\n"
+
+      << "\n// Register image2 to control image1 (master): (TBD... not working)\n"
+      << appName << " --op masreg -img_m image1.ntf -img_s image2.ntf -cfg configFile.kwl\n"
+
+      << "\n// Above command where all options are in a keyword list:\n"
+      << appName << " --options autreg-options.kwl\n"
+      << std::endl;
+}
+
+
+void  ossimAutRegUtil::initializeSrcKwl()
+{
+   static const char MODULE[] = "ossimAutRegUtil::initializeSrcKwl";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\n";
+   }
+
+   std::string value = m_kwl->findKey(std::string(SRC_FILE_KW));
+   if ( value.size() )
+   {
+      m_srcKwl = new ossimKeywordlist();
+      m_srcKwl->setExpandEnvVarsFlag(true);
+      if ( m_srcKwl->addFile( value.c_str() ) == false )
+      {
+         m_srcKwl = 0;
+      }
+   }
+   else
+   {
+      m_srcKwl = 0; 
+   }
+
+   if ( traceDebug() )
+   {
+      if ( m_srcKwl.valid() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "src keyword list:\n" << *(m_srcKwl.get()) << "\n";
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exited...\n";
+   }
+}
+
+
+void  ossimAutRegUtil::initializeOcvKwl()
+{
+   static const char MODULE[] = "ossimAutRegUtil::initializeOcvKwl";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\n";
+   }
+
+   std::string value = m_kwl->findKey(std::string(OCV_CONFIG_FILE_KW));
+   if ( value.size() )
+   {
+      m_ocvKwl = new ossimKeywordlist();
+      m_ocvKwl->setExpandEnvVarsFlag(true);
+      if ( m_ocvKwl->addFile( value.c_str() ) == false )
+      {
+         m_ocvKwl = 0;
+      }
+   }
+   else
+   {
+      m_ocvKwl = 0; 
+   }
+
+   if ( traceDebug() )
+   {
+      if ( m_ocvKwl.valid() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ocv keyword list:\n" << *(m_ocvKwl.get()) << "\n";
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exited...\n";
+   }
+}
+
+
+void  ossimAutRegUtil::initializeOaxKwl()
+{
+   static const char MODULE[] = "ossimAutRegUtil::initializeOaxKwl";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\n";
+   }
+
+   std::string value = m_kwl->findKey(std::string(OAX_CONFIG_FILE_KW));
+   if ( value.size() )
+   {
+      m_oaxKwl = new ossimKeywordlist();
+      m_oaxKwl->setExpandEnvVarsFlag(true);
+      if ( m_oaxKwl->addFile( value.c_str() ) == false )
+      {
+         m_oaxKwl = 0;
+      }
+   }
+   else
+   {
+      m_oaxKwl = 0; 
+   }
+
+   if ( traceDebug() )
+   {
+      if ( m_oaxKwl.valid() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "oax keyword list:\n" << *(m_oaxKwl.get()) << "\n";
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exited...\n";
+   }
+}
+
+
+bool ossimAutRegUtil::addImgSource(const ossimFilename& file, ossim_uint32 entryIndex)
+{
+   static const char MODULE[] = "ossimAutRegUtil::addImgSource";
+
+   bool addOK = false;
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\nFile: " << file << "\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = createChain(file, entryIndex);
+   if ( ic.valid() )
+   {
+      m_imgLayer.push_back(ic);
+      addOK = true;
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
+   }
+
+   return addOK;
+}
+
+
+void ossimAutRegUtil::setReaderProps( ossimImageHandler* ih ) const
+{
+   if ( ih && m_kwl.valid() )
+   {
+      ossim_uint32 count = m_kwl->numberOf( READER_PROPERTY_KW.c_str() );
+      for (ossim_uint32 i = 0; i < count; ++i)
+      {
+         ossimString key = READER_PROPERTY_KW;
+         key += ossimString::toString(i);
+         ossimString value = m_kwl->findKey( key.string() );
+         if ( value.size() )
+         {
+            std::vector<ossimString> splitArray;
+            value.split(splitArray, "=");
+            if(splitArray.size() == 2)
+            {
+               ossimRefPtr<ossimProperty> prop =
+                  new ossimStringProperty(splitArray[0], splitArray[1]);
+               
+               ih->setProperty( prop );
+            }
+         }
+      }
+   }
+}
+
+
+bool ossimAutRegUtil::setChainEntry(
+   ossimRefPtr<ossimSingleImageChain>& chain, ossim_uint32 entryIndex ) const
+{
+   bool result = false;
+   if ( chain.valid() )
+   {
+      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
+      if ( ih.valid() )
+      {
+         result = ih->setCurrentEntry( entryIndex );
+      }
+   }
+   return result;
+}
+
+ossimRefPtr<ossimSingleImageChain> ossimAutRegUtil::createChain(const ossimFilename& file,
+                                                                 ossim_uint32 entryIndex) const
+{
+   static const char MODULE[] = "ossimAutRegUtil::createChain(const ossimFilename&";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..."
+         << "\nfile: " << file
+         << "\nentry: " << entryIndex
+         << "\n";
+   }   
+   
+   ossimRefPtr<ossimSingleImageChain> ic = 0;
+
+   if ( file.size() )
+   {
+      if ( file.exists() )
+      {
+         ic = new ossimSingleImageChain;
+         if ( ic->open( file ) )
+         {
+            // Set any reader props:
+            setReaderProps( ic->getImageHandler().get() );
+            
+            // we can't guarantee the state of the image handler at this point so
+            // let's make sure that the entry is always set to the requested location
+            //  On Cib/Cadrg we were having problems.  Removed the compare for entry 0
+            //
+             if ( setChainEntry( ic, entryIndex ) == false )
+             {
+                std::ostringstream errMsg;
+                errMsg << MODULE << " ERROR:\nEntry " << entryIndex << " out of range!"
+                       << std::endl;
+                throw ossimException( errMsg.str() );
+             }
+
+            
+            // Always have resampler cache.
+            ic->setAddResamplerCacheFlag(true);
+
+            //---
+            // Don't need a chain cache as we're doing a sequential write.  So the same tile
+            // should never be visited more than once.
+            //---
+            ic->setAddChainCacheFlag(false);
+
+
+            // // Brightness, contrast. Note in same filter.
+            // if ( hasBrightnesContrastOperation() )
+            // {
+            //    ic->setBrightnessContrastFlag(true);
+            // }
+
+            // std::string sharpnessMode = getSharpenMode();
+            // if ( sharpnessMode.size() )
+            // {
+            //    ic->setSharpenFlag(true);
+            // }
+
+            // Create the chain.
+            ic->createRenderedChain();
+
+
+            // // Histogram setup.
+            // if ( hasHistogramOperation() )
+            // {
+            //    setupChainHistogram( ic );
+            // }
+
+            // // Brightness contrast setup:
+            // if ( hasBrightnesContrastOperation() )
+            // {
+            //    // Assumption bright contrast filter in chain:
+               
+            //    ossim_float64 value = getBrightness();
+            //    ic->getBrightnessContrast()->setBrightness( value );
+               
+            //    value = getContrast();
+            //    ic->getBrightnessContrast()->setContrast( value );
+            // }
+
+            // // Sharpness:
+            // if ( sharpnessMode.size() )
+            // {
+            //    if ( sharpnessMode == "light" )
+            //    {
+            //       ic->getSharpenFilter()->setWidthAndSigma( 3, 0.5 );
+            //    }
+            //    else if ( sharpnessMode == "heavy" )
+            //    {
+            //       ic->getSharpenFilter()->setWidthAndSigma( 5, 1.0 );
+            //    }
+            // }
+         }
+      }
+   }
+
+   if ( ic.valid() == false )
+   {
+      std::string errMsg = "Could not open: ";
+      errMsg += file.string();
+      throw ossimException(errMsg); 
+   }
+
+   if ( traceDebug() )
+   {
+      ossimKeywordlist kwl;
+      ic->saveState(kwl, 0);
+
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "chain:\n" << kwl << "\n"
+         << MODULE << " exiting...\n";
+   }   
+
+   return ic;
+}
+
+
+void ossimAutRegUtil::createIdentityProjection(int idx)
+{
+   static const char MODULE[] = "ossimAutRegUtil::createIdentityProjection";
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   // Get the singe image chain.  Should be only one.
+   ossimRefPtr<ossimSingleImageChain> sic = 0;
+   if ( m_imgLayer.size() )
+   {
+      sic = m_imgLayer[idx];
+   }
+
+   if ( sic.valid() )
+   {
+      // Get the image handler.
+      ossimRefPtr<ossimImageHandler>  ih = sic->getImageHandler();
+
+      // Resampler:
+      ossimRefPtr<ossimImageRenderer> resampler = sic->getImageRenderer();
+
+      if ( ih.valid() )
+      {
+         //---
+         // Get the geometry from the image handler.  Since we're in "identity"
+         // mode use the inputs for the outputs.
+         //---
+         m_geom[idx] = ih->getImageGeometry();
+
+         if ( m_geom[idx].valid() )
+         {
+            // Get the image projection.
+            ossimRefPtr<ossimProjection> proj = m_geom[idx]->getProjection();
+            if ( proj.valid() )
+            {
+               ossim_float64 rotation = 0.0;
+               
+               ossimDrect rect;
+               m_geom[idx]->getBoundingRect(rect);
+               ossimDpt midPt = rect.midPoint();
+               
+               if ( traceDebug() )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << MODULE
+                     << "\nAffine transform parameters:"
+                     << "\nrotation:  " << rotation
+                     << "\nmid point: " << midPt << std::endl;
+               }
+               
+               m_ivt[idx] = new ossimImageViewAffineTransform(-rotation,
+                                                              1.0, 1.0, // image space scale x and y
+                                                              1.0, 1.0, //scale x and y
+                                                              0.0, 0.0, // translate x,y
+                                                              midPt.x, midPt.y); // pivot point
+               
+               resampler->setImageViewTransform( m_ivt[idx].get() );
+            }
+
+         } // Matches: if ( m_geom.valid() )
+         
+      } // Matches: if ( ih.valid() )
+      
+   } // Matches: if ( sic.valid() 
+   
+} // End: createIdentityProjection()
+
+
+bool ossimAutRegUtil::keyIsTrue(ossimRefPtr<ossimKeywordlist> kwl, const std::string& key ) const
+{
+   bool result = false;
+   if ( kwl.valid() )
+   {
+      std::string value = kwl->findKey( key );
+      if ( value.size() )
+      {
+         result = ossimString(value).toBool();
+      }
+   }
+   return result;
+}
diff --git a/src/util/ossimBandMergeTool.cpp b/src/util/ossimBandMergeTool.cpp
new file mode 100644
index 0000000..ad86c40
--- /dev/null
+++ b/src/util/ossimBandMergeTool.cpp
@@ -0,0 +1,185 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/imaging/ossimBandMergeSource.h>
+#include <ossim/imaging/ossimHistogramRemapper.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/util/ossimBandMergeTool.h>
+#include <iostream>
+
+using namespace std;
+
+const char* ossimBandMergeTool::DESCRIPTION  =
+      "Merges multiple band files into a single RGB image.";
+
+static const std::string HISTO_STRETCH_KW = "histo_stretch";
+
+ossimBandMergeTool::ossimBandMergeTool()
+:  m_stretchProduct(false)
+{
+}
+
+ossimBandMergeTool::~ossimBandMergeTool()
+{
+}
+
+void ossimBandMergeTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add options.
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " bandmerge --red <red_band> --green <green_band> --blue <blue_band> [--stretch] <output-rgb-image>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->setDescription(DESCRIPTION);
+
+   // Base class has its own:
+   ossimChipProcTool::setUsage(ap);
+
+   au->addCommandLineOption("--red", "<filename> Filename of red band. ");
+   au->addCommandLineOption("--green", "<filename> Filename of green band. ");
+   au->addCommandLineOption("--blue", "<filename> Filename of blue band. ");
+   au->addCommandLineOption("--stretch", "Optionally histogram-stretch the product image. ");
+}
+
+bool ossimBandMergeTool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   ostringstream xmsg;
+
+   std::string ts1;
+   ossimArgumentParser::ossimParameter sp1 (ts1);
+   int band_count = 0;
+
+   if ( ap.read("--red", sp1))
+   {
+      ostringstream key;
+      key<<ossimKeywordNames::IMAGE_FILE_KW<<"0";
+      m_kwl.addPair( key.str(), ts1 );
+      ++band_count;
+   }
+   if ( ap.read("--green", sp1))
+   {
+      ostringstream key;
+      key<<ossimKeywordNames::IMAGE_FILE_KW<<"1";
+      m_kwl.addPair( key.str(), ts1 );
+      ++band_count;
+   }
+   if ( ap.read("--blue", sp1))
+   {
+      ostringstream key;
+      key<<ossimKeywordNames::IMAGE_FILE_KW<<"2";
+      m_kwl.addPair( key.str(), ts1 );
+      ++band_count;
+   }
+   if (band_count != 3)
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"ossimBandMergeUtil:"<<__LINE__
+            <<" Must supply three band filenames."<<endl;
+      return false;
+   }
+
+   if ( ap.read("--stretch"))
+   {
+      m_kwl.addPair(HISTO_STRETCH_KW, string("true") );
+   }
+
+   processRemainingArgs(ap);
+   return true;
+}
+
+void ossimBandMergeTool::initialize(const ossimKeywordlist& kwl)
+{
+   kwl.getBoolKeywordValue(m_stretchProduct, HISTO_STRETCH_KW.c_str());
+
+   m_kwl.add( ossimKeywordNames::PROJECTION_KW, "input", false );
+   ossimChipProcTool::initialize(kwl);
+}
+
+void ossimBandMergeTool::initProcessingChain()
+{
+   if (m_imgLayers.size() != 3)
+   {
+      ostringstream errMsg;
+      errMsg<<"ERROR ossimBandMergeUtil:"<<__LINE__<<"  Expected 3 input layers but found "
+            <<m_imgLayers.size() <<". Cannot continue. "<<ends;
+      throw ossimException(errMsg.str());
+   }
+
+   ossimConnectableObject::ConnectableObjectList bandList;
+   for (int band=0; band<3; band++)
+   {
+      ossimSingleImageChain* band_image = m_imgLayers[band].get();
+      bandList.push_back(band_image);
+
+      // If performing histo stretch, try using existing histogram files before creating new ones:
+      if (m_stretchProduct)
+         initHistogramStretch(band_image);
+   }
+   ossimRefPtr<ossimBandMergeSource> combiner = new ossimBandMergeSource(bandList);
+   m_procChain->add(combiner.get());
+}
+
+void ossimBandMergeTool::initHistogramStretch(ossimSingleImageChain* image)
+{
+   ostringstream errMsg;
+
+   // Check if this image already has a histogram file associated with it:
+   ossimRefPtr<ossimImageHandler> handler = image->getImageHandler();
+   if (!handler.valid())
+   {
+      errMsg<<"ERROR ossimBandMergeUtil:"<<__LINE__<<"  Bad handler returned for image chain.";
+      throw ossimException(errMsg.str());
+   }
+
+   ossimRefPtr<ossimMultiResLevelHistogram> histogram = handler->getImageHistogram();
+   if (!histogram.valid())
+   {
+      errMsg<<"ERROR ossimBandMergeUtil:"<<__LINE__<<"  Bad histogram returned from image handler.";
+      throw ossimException(errMsg.str());
+   }
+
+   ossimRefPtr<ossimHistogramRemapper> histogramRemapper = new ossimHistogramRemapper();
+   histogramRemapper->setEnableFlag(true);
+   histogramRemapper->setStretchMode( ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX );
+   histogramRemapper->setHistogram(histogram);
+   image->add(histogramRemapper.get());
+}
+
+bool ossimBandMergeTool::execute()
+{
+   return ossimChipProcTool::execute();
+}
+
+void ossimBandMergeTool::getKwlTemplate(ossimKeywordlist& kwl)
+{
+   ossimChipProcTool::getKwlTemplate(kwl);
+
+   ossimString keybase (ossimKeywordNames::IMAGE_FILE_KW );
+   ossimString key = keybase + "0";
+   kwl.add(key.chars(), "<red-band>", true);
+   key = keybase + "1";
+   kwl.add(key.chars(), "<green-band>", true);
+   key = keybase + "2";
+   kwl.add(key.chars(), "<blue-band>", true);
+
+   kwl.add(HISTO_STRETCH_KW.c_str(), "true|false", true);
+}
+
diff --git a/src/util/ossimBatchTest.cpp b/src/util/ossimBatchTest.cpp
new file mode 100644
index 0000000..e696a7e
--- /dev/null
+++ b/src/util/ossimBatchTest.cpp
@@ -0,0 +1,1261 @@
+//----------------------------------------------------------------------------
+//
+// File ossim-batch-test.cpp
+// 
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken, Oscar Kramer
+//
+// Description: Test code application ossim batch test.
+//
+//----------------------------------------------------------------------------
+// $Id: ossim-batch-test.cpp 3112 2012-01-26 17:28:00Z david.burken $
+
+#include <ossim/util/ossimBatchTest.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimEnvironmentUtility.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/init/ossimInit.h>
+
+#include <cstdlib> /* for system() */
+#include <ctime>
+#include <iomanip>
+#include <iostream>
+#include <string>
+#include <sstream>
+
+using namespace std;
+
+//**************************************************************************************************
+// Constructor
+//**************************************************************************************************
+ossimBatchTest::ossimBatchTest()
+   :
+   m_acceptTestList(),
+   m_cleanTestList(),
+   m_preprocessTestList(),
+   m_runTestList(),
+   m_templateModeActive(false),
+   m_configFileName(),
+   m_outDir(),
+   m_expDir(),
+   m_logStr()
+{
+   typedef std::map<ossim_uint32, std::string>::value_type map_item;
+   m_statusLabels.insert(map_item(TEST_TBD,      "UNKNOWN"));
+   m_statusLabels.insert(map_item(TEST_PASSED,   "PASSED"));
+   m_statusLabels.insert(map_item(TEST_FAILED,   "FAILED"));
+   m_statusLabels.insert(map_item(TEST_ERROR,    "ERROR"));
+   m_statusLabels.insert(map_item(TEST_DISABLED, "DISABLED"));
+   m_statusLabels.insert(map_item(TEST_PASSED|TEST_FAILED,   "FAILURE ENCOUNTERED"));
+   m_statusLabels.insert(map_item(TEST_PASSED|TEST_ERROR,   "ERROR ENCOUNTERED"));
+   m_statusLabels.insert(map_item(TEST_FAILED|TEST_ERROR,   "FAILURE AND ERROR ENCOUNTERED"));
+   m_statusLabels.insert(map_item(TEST_PASSED|TEST_FAILED|TEST_ERROR,   "FAILURE AND ERROR ENCOUNTERED"));
+}
+
+//**************************************************************************************************
+// Initialize parses the command line. Returns true if status OK.
+//**************************************************************************************************
+bool ossimBatchTest::initialize(ossimArgumentParser& ap)
+{
+   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
+   {
+      usage(ap);
+
+      // continue_after_init to false
+      return false;
+   }
+
+   // Initialize environment:
+#if defined(WIN32) || defined(_MSC_VER) && !defined(__CYGWIN__) && !defined(__MWERKS__)
+   _putenv("DEL_CMD=del /Q"); // For backwards compatiblity.
+   _putenv("DIFF_CMD=fc /W");
+   _putenv("COPY_CMD=copy /Y");
+   _putenv("MKDIR_CMD=mkdir");
+   _putenv("RM_CMD=del /Q");
+   _putenv("RMDIR_CMD=rmdir /S /Q");
+   
+#else
+   setenv("DEL_CMD",  "rm -rf",    1); // For backwards compatiblity.
+   setenv("DIFF_CMD",  "diff -w",  1);
+   setenv("COPY_CMD",  "cp",       1);
+   setenv("MKDIR_CMD", "mkdir -p", 1);
+   setenv("RM_CMD",    "rm -f",    1);
+   setenv("RMDIR_CMD", "rm -rf",   1);
+   
+#endif
+   
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   
+   if (ap.read("-W", stringParam) || ap.read("-W"))
+   {
+      ossimFilename templateFile (tempString.c_str());
+      if (templateFile.empty())
+         templateFile = "obt_config_long_template.kwl";
+      m_templateModeActive = true;
+      writeTemplate(templateFile, true);
+      return true;
+   }
+   if (ap.read("-w", stringParam) || ap.read("-w"))
+   {
+      ossimFilename templateFile(tempString.c_str());
+      if (templateFile.empty())
+         templateFile = "obt_config_short_template.kwl";
+      m_templateModeActive = true;
+      writeTemplate(templateFile, false);
+      return true;
+   }
+   
+   while ( ap.read("-a", stringParam) || ap.read("--accept-test", stringParam) )
+   {
+      if ( tempString.size() )
+      {
+         ossimString os = tempString;
+         ossimString separatorList = " ";
+         std::vector<ossimString> result;
+         os.split(result, separatorList);
+         std::vector<ossimString>::const_iterator i = result.begin();
+         while ( i != result.end() )
+         {
+            m_acceptTestList.push_back((*i));
+            ++i;
+         }
+      }
+   }
+
+   while ( ap.read("-c", stringParam) || ap.read("--clean-test", stringParam) )
+   {
+      if ( tempString.size() )
+      {
+         ossimString os = tempString;
+         ossimString separatorList = " ";
+         std::vector<ossimString> result;
+         os.split(result, separatorList);
+         std::vector<ossimString>::const_iterator i = result.begin();
+         while ( i != result.end() )
+         {
+            m_cleanTestList.push_back((*i));
+            ++i;
+         }
+      }
+   }
+
+   while ( ap.read("-p", stringParam) || ap.read("--preprocess-test", stringParam) )
+   {
+      if ( tempString.size() )
+      {
+         ossimString os = tempString;
+         ossimString separatorList = " ";
+         std::vector<ossimString> result;
+         os.split(result, separatorList);
+         std::vector<ossimString>::const_iterator i = result.begin();
+         while ( i != result.end() )
+         {
+            m_preprocessTestList.push_back((*i));
+            ++i;
+         }
+      }
+   }
+
+   while ( ap.read("-r", stringParam) || ap.read("--run-test", stringParam) )
+   {
+      if ( tempString.size() )
+      {
+         ossimString os = tempString;
+         ossimString separatorList = " ";
+         std::vector<ossimString> result;
+         os.split(result, separatorList);
+         std::vector<ossimString>::const_iterator i = result.begin();
+         while ( i != result.end() )
+         {
+            m_runTestList.push_back((*i));
+            ++i;
+         }
+      }
+   }
+
+   // End of arg parsing.
+   ap.reportRemainingOptionsAsUnrecognized();
+   if ( ap.errors() )
+   {
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      return false;
+   }
+
+   if (ap.argc() > 1 )
+   {
+      m_configFileName = ap.argv()[1];
+   }
+   else
+   {
+      usage(ap);
+
+      // continue_after_init to false
+      return false;
+   }
+
+   // Special command line case: When only a config filename is provided, this implies "run all 
+   // tests".
+   if (m_cleanTestList.empty()  && m_preprocessTestList.empty() &&
+       m_acceptTestList.empty() && m_runTestList.empty() && m_configFileName.size())
+   {
+      m_runTestList.push_back("all");
+   }
+
+   return true;
+}
+
+//---
+// Writes a template (either long form or short) to the file name specified.
+//---
+void ossimBatchTest::writeTemplate(const ossimFilename& templateFile, bool write_long_form)
+{
+   if (templateFile.exists())
+   {
+      ossimString del_cmd ("$(RM_CMD) ");
+      del_cmd += templateFile;
+      del_cmd = del_cmd.expandEnvironmentVariable();
+      if (system(del_cmd.chars()) != 0)
+      {
+         cerr << "ERROR: Could not delete existing template file before writing new template."
+            " Please delete the existing and rerun the command."<< endl;
+         return;
+      }
+   }
+
+   std::ofstream out(templateFile.c_str());
+   if ( !out.good() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "Could not open: " << templateFile.c_str() << std::endl;
+      return;
+   }
+
+   if (write_long_form)
+   {
+      out<< "//===================================================================================\n"
+         << "// \n"
+         << "// File: " << templateFile.c_str() << "\n"
+         << "// Generated by command: ossim-batch-test -W " << templateFile.c_str() << "\n"
+         << "// Description: ossim-batch-test template config file.\n"
+         << "// \n"
+         << "// Control flags:\n"
+         << "// Use 1 or true, 0 or false to turn on and off sections.\n"
+         << "// Typically preprocess and expected results only turned on for first run.\n"
+         << "// Clean commands should erase anything created by this test.\n"
+         << "// Command order if flag turned on:\n"
+         << "// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process\n"
+         << "// \n"
+         << "// NOTES:\n"
+         << "// * The following environment variables must be set before running batch test:\n"
+         << "//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data\n"
+         << "//     OSSIM_BATCH_TEST_EXPECTED Top-level dir containing all test expected results \n"
+         << "//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results and logging output \n"
+         << "// \n"
+         << "// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to\n"
+         << "//   the proper paths according to the config filename. It isn't required to replace\n"
+         << "//   these nor predefine them in the environment. You can leave them as is or modify\n"
+         << "//   the paths to your unconventional file paths.\n"
+         << "// \n"
+         << "// * In order to preserve platform independence, please utilize the following \n"
+         << "//   variables for the common OS commands when adding new commands to the test\n"
+         << "//   configuration KWL file. Examples are provided in this template\n"
+         << "//       $(DIFF_CMD) Use this var for windows \"fc\" or linux \"diff\"\n"
+         << "//       $(COPY_CMD) Use this var for windows \"copy\" or linux \"cp\"\n"
+         << "//       $(MKDIR_CMD) Use this var for windows \"mkdir\" or linux \"mkdir\"\n"
+         << "//       $(RM_CMD) Use this var for windows \"del /Q\" or linux \"rm -f\"\n"
+         << "//       $(RMDIR_CMD) Use this var for windows \"rmdir /S /Q\" or linux \"rm -rf\"\n"
+         << "//   This application will set the environment variables to the proper values at \n"
+         << "//   runtime, so no need to worry about defining these.\n"
+         << "// \n"
+         << "// * Use forward slashes \"//\", at beginning of line for comments.\n"
+         << "// \n"
+         << "// * You can use existing environment variables as $(YOUR_VARIABLE). They will be \n"
+         << "//   expanded at run time if valid.\n"
+         << "// \n"
+         << "// * Clean, preprocess, run, and accept test sections can be switched on or off\n"
+         << "//   at run time.  These override config file flags.  Optional arguments are the \n"
+         << "//   the following: \n"
+         << "//      -c or --clean-test \n"
+         << "//      -p or --preprocess-test\n"
+         << "//      -r or --run-test \n"
+         << "//      -a or --accept-test \n"
+         << "//   Multiple tests can be entered by quoting string of space-separated\n"
+         << "//   test names, e.g. \"test1 test2\". To do all tests use \"all\" or leave blank.\n"
+         << "// \n"
+         << "//===================================================================================\n"
+         << "\n"
+         << "// If the config file will contain only a list of subordinate config files to be\n"
+         << "// run as one consolidated \"super-test\", then use only the following suffixed\n"
+         << "// keywords. Otherwise, REMOVE THESE:\n"
+         << "test_config_file1: <my_first_test_config.kwl>\n"
+         << "test_config_file2: <my_second_test_config.kwl>\n"
+         << "// ... etc.\n"
+         << "\n"
+         << "// The remaining keywords are used exclusive of \"test_config_fileX\" above. The\n"
+         << "// config files must be either a list of subordinate configs, or a concrete, \n"
+         << "// low-level config file.\n"
+         << "\n"
+         << "// Where you want the top-level (inter-test) log files to go:\n"
+         << "log_directory: $(OBT_OUT_DIR)\\..\\log\n"
+         << "\n"
+         << "//===================================================================================\n"
+         << "// Begin Test 1\n"
+         << "// NOTE: If the config file contains just a single test, then the use of the \"test1\"\n"
+         << "// prefix is optional. Make sure the results directory spec reflects the proper path.\n"
+         << "\n"
+         << "test1.name: <YOUR_TEST_NAME>\n"
+         << "test1.description: Test height for the center of the image for test2 and test3.\n"
+         << "\n"
+         << "// Controls/turns on/off whole test (all sections):\n"
+         << "test1.enabled: 1\n"
+         << "\n"
+         << "// Individual control flags:\n"
+         << "test1.run_clean_commands: 0\n"
+         << "test1.run_preprocessing_commands: 0\n"
+         << "test1.run_expected_results_commands: 0\n"
+         << "test1.run_test_commands: 1\n"
+         << "test1.run_postprocessing_commands: 1\n"
+         << "\n"
+         << "// Temp file to catch diff output.\n"
+         << "test1.temp_file: $(TEMP)\\tmp.txt\n"
+         << "\n"
+         << "// Clean up commands\n"
+         << "test1.clean_command1: $(RMDIR_CMD) $(OBT_OUT_DIR)\n"
+         << "\n"
+         << "// Pre-process commands\n"
+         << "test1.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)\n"
+         << "test1.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)\\..\\log\n"
+         << "\n"
+         << "//---------------------------------------\n"
+         << "// Commands to generate expected results\n"
+         << "//---------------------------------------\n"
+         << "// Since test2 and test3 are dependent on elevation test the center of the image.\n"
+         << "test1.expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OBT_EXP_DIR)\\height.txt\n"
+         << "test1.expected_results_command1: $(COPY_CMD) $(OBT_OUT_DIR)\\height.txt $(OBT_EXP_DIR)\\height.txt\n"
+         << "\n"
+         << "//---------------------------------------\n"
+         << "// The actual commands to test\n"
+         << "//---------------------------------------\n"
+         << "test1.test_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n"
+         << "\n"
+         << "//-------------------------------------------\n"
+         << "// Post process commands for diffs, etc.\n"
+         << "//-------------------------------------------\n"
+         << "test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)\\height.txt $(OBT_OUT_DIR)\\height.txt\n"
+         << " \n"
+         << "\n"
+         << "// End <TEST_NAME>\n"
+         << "//===================================================================================\n"
+         << "// Begin <TEST2_NAME>...\n"
+         << "\n"
+         << "// You can specify additional tests by copying the test1 keywords and changing the\n"
+         << "// prefix indices to be unique. It is not necessary to be consecutive.\n"
+         << "\n"
+         << std::endl;
+   }
+   else 
+   {
+      out<< "//===================================================================================\n"
+         << "// \n"
+         << "// File: " << templateFile.c_str() << "\n"
+         << "// Generated by command: ossim-batch-test -w " << templateFile.c_str() << "\n"
+         << "// Description: ossim-batch-test template config file.\n"
+         << "// \n"
+         << "// NOTES:\n"
+         << "// * The following environment variables must be set before running batch test:\n"
+         << "//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data\n"
+         << "//     OSSIM_BATCH_TEST_EXPECTED Top-level dir containing all test expected results \n"
+         << "//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results and logging output \n"
+         << "// \n"
+         << "// * You can use existing environment variables as $(YOUR_VARIABLE). They will be \n"
+         << "//   expanded at run time if valid.\n"
+         << "// \n"
+         << "// * If the config file contains more than a single test, then it will be necessary \n" 
+         << "//   to prefix all test-specific keywords with \"testN.\"\n"
+         << "// \n"
+         << "// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to\n"
+         << "//   the proper paths according to the config filename. It isn't required to replace\n"
+         << "//   these nor predefine them in the environment. You can leave them as is or modify\n"
+         << "//   the paths to your unconventional file paths.\n"
+         << "// \n"
+         << "//===================================================================================\n"
+         << "\n"
+         << "description: Test height for the center of the image for test2 and test3.\n"
+         << "\n"
+         << "//---------------------------------------\n"
+         << "// Commands to generate expected results.\n"
+         << "//---------------------------------------\n"
+         << "expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n"
+         << "expected_results_command1: $(COPY_CMD) $(OBT_OUT_DIR)\\height.txt $(OBT_EXP_DIR)\\height.txt\n"
+         << "\n"
+         << "//---------------------------------------\n"
+         << "// The actual commands to test.\n"
+         << "//---------------------------------------\n"
+         << "test_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\\height.txt\n"
+         << "\n"
+         << "//---------------------------------------\n"
+         << "// The post-processing (comparison) commands. Typically these involve a file \n"
+         << "// comparison of last run command against expected results.\n"
+         << "//---------------------------------------\n"
+         << "postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)\\height.txt $(OBT_OUT_DIR)\\height.txt\n"
+         << std::endl;
+   }
+
+   out.close();
+   ossimNotify(ossimNotifyLevel_NOTICE) << "Wrote file: " << templateFile.c_str() << std::endl;
+}
+
+//**************************************************************************************************
+// Processes a test config file
+//**************************************************************************************************
+ossim_uint8 ossimBatchTest::execute()
+{
+   if (m_templateModeActive)
+   {
+      return TEST_PASSED;
+   }
+
+   ossim_uint8 status = TEST_TBD;
+
+   ossimString configName (m_configFileName.fileNoExtension());
+   cout << "\nExecuting batch test for config: <" << configName << ">" << endl;
+
+   try
+   {
+      ossimEnvironmentUtility* ossimEnv = ossimEnvironmentUtility::instance();
+
+      // Fetch possible existing env vars for the expected and output directories:
+      ossimFilename base_output_dir =
+            ossimEnv->getEnvironmentVariable(ossimString("OSSIM_BATCH_TEST_RESULTS"));
+      if (base_output_dir.empty())
+      {
+         // Need to establish the top-level test directory that will contain log and out subdirs:
+         cout<<"\nossimBatchTest WARNING: The environment variable OSSIM_BATCH_TEST_RESULTS is not "
+               "defined. Results will be written relative to the current working directory."<<endl;
+         base_output_dir = ossimEnv->getCurrentWorkingDir();
+      }
+
+      // The base output directory is appended with the name of the test config file. Need to export
+      // the corresponding env var so that the KeywordList class can expand the same env var used
+      // in the config file:
+      base_output_dir = base_output_dir.dirCat(configName);
+      m_outDir = base_output_dir.dirCat("out");
+      ossimEnv->setEnvironmentVariable("OBT_OUT_DIR", m_outDir.chars());
+
+      m_expDir = ossimEnv->getEnvironmentVariable(ossimString("OSSIM_BATCH_TEST_EXPECTED"));
+      if (m_expDir.empty())
+      {
+         // Need to establish the top-level test directory that will contain expected results:
+         m_expDir = base_output_dir.dirCat("exp");
+      }
+      else
+      {
+         m_expDir = m_expDir.dirCat(configName);
+      }
+      ossimEnv->setEnvironmentVariable("OBT_EXP_DIR", m_expDir.chars());
+
+      // Turn expansion of for like: $(OBT_TEST_RESULTS)
+      ossimKeywordlist kwl;
+      kwl.setExpandEnvVarsFlag(true);
+      if (!kwl.addFile(m_configFileName))
+      {
+         ostringstream errmsg;
+         errmsg << "Error encountered reading test config at <"<<m_configFileName<<">."<<endl;
+         throw ossimException(errmsg.str());
+      }
+
+      // The KWL may contain names of other test config files. Is this a list of config files? If the
+      // status returns anything other than TBD, then a list was present and processed:
+      status = processConfigList(kwl);
+      if (status != TEST_TBD)
+      {
+         cout<<"\nossimBatchTest: Exiting <"<<configName<<"> with overall status = "
+               <<m_statusLabels[status]<<"\n"<<endl;
+         return status;
+      }
+
+      // Pick up individual test options passed in by user.  These will adjust the keyword list
+      // flags loaded in memory.
+      if ( m_cleanTestList.size() ) // Do this first always...
+      {
+         std::string testCommand = "run_clean_commands";
+         preprocessKwl(m_cleanTestList, testCommand, kwl);
+      }
+
+      if ( m_preprocessTestList.size() )
+      {
+         std::string testCommand = "run_preprocessing_commands";
+         preprocessKwl(m_preprocessTestList, testCommand, kwl);
+      }
+
+      if ( m_acceptTestList.size() )
+      {
+         std::string testCommand = "run_expected_results_commands";
+         preprocessKwl(m_acceptTestList, testCommand, kwl);
+      }
+      
+      if ( m_runTestList.size() ) // Do this last always...
+      {
+         std::string testCommand = "run_test_commands";
+         preprocessKwl(m_runTestList, testCommand, kwl);
+      }
+
+      ossimFilename logDir = base_output_dir.dirCat("log");
+      const char* lookup = kwl.find("log_directory");
+      if ( lookup )
+      {
+         logDir = convertToNative( lookup ).c_str();
+      }
+
+      if (( logDir.exists() == false ) && ( logDir.createDirectory() == false ))
+      {
+         status = TEST_ERROR;
+         ostringstream errmsg;
+         errmsg << "Could not create: <" << logDir << ">."<< endl;
+         throw ossimException(errmsg.str());
+      }
+
+      // Establish path to and active stream for the log file:
+      ossimFilename logFile;
+      getLogFilename(logFile);
+      logFile = logDir.dirCat(logFile);
+      ossimSetLogFilename(logFile);
+      m_logStr.open(logFile.c_str());
+      if ( m_logStr.fail() )
+      {
+         status = TEST_ERROR;
+         ostringstream errmsg;
+         errmsg << "Could not open: <" << logFile  << ">."<< endl;
+         throw ossimException(errmsg.str());
+      }
+
+      cout << "Logging to file: " << logFile << "\n";
+
+      ossimString date;
+      getDateString(date);
+      m_logStr << "// ---\n"
+               << "// ossim-batch-test log:\n"
+               << "// date format = yyyymmddhhmmss\n"
+               << "//---\n"
+               << "start_time: " << date << "\n"
+               << "config_file: " << m_configFileName<< "\n";
+      // Start the timer.
+      ossimTimer::instance()->setStartTick();
+      
+      double startTime = ossimTimer::instance()->time_s();
+      
+   
+      ossimString regExpStr = "test[0-9]+\\.";
+      std::vector<ossimString> prefixes;
+      kwl.getSubstringKeyList(prefixes, regExpStr);
+      
+      // If no test prefix is used, this implies a single test:
+      if (prefixes.empty())
+         prefixes.push_back("");
+      
+      status = TEST_TBD;
+      for(ossim_uint32 idx = 0; idx < prefixes.size(); ++idx)
+      {
+         ossim_uint8 individual_test_status = processTest( prefixes[idx], kwl);
+         status |= individual_test_status;
+      }
+      
+      getDateString(date);
+      m_logStr << "\nstop_time: " << date << "\n";
+      double stopTime = ossimTimer::instance()->time_s();
+      m_logStr << "total elapsed time in seconds: "
+               << std::setiosflags(ios::fixed) << std::setprecision(4)
+               << (stopTime-startTime)
+               << endl; // flush
+      m_logStr.close();
+
+      cout << "\ntotal elapsed time in seconds: "
+           << std::setiosflags(ios::fixed) << std::setprecision(4)
+           << (stopTime-startTime)
+           << "\nWrote log: " << logFile << "\n" << endl;
+   }
+   catch (ossimException& e)
+   {
+      status = TEST_ERROR;
+      cerr << "\nossimBatchTest::execute() caught exception: " << e.what() << endl;
+   }
+   catch ( ... )
+   {
+      cerr << "\nossimBatchTest::execute() caught unhandled exception: " << endl;
+   }
+
+   cout<<"ossimBatchTest: Exiting <"<<configName<<"> with status = "
+         <<m_statusLabels[status]<<endl;
+
+   return status;
+}
+
+//************************************************************************************************
+// Special handler for KWL containing list of test config files.
+//************************************************************************************************
+ossim_uint8 ossimBatchTest::processConfigList(const ossimKeywordlist& kwl)
+{
+   ossim_uint8 overall_test_status = TEST_TBD;
+   ossimFilename config_list_path = m_configFileName.path();
+
+   ossimString keywordRegEx = "test_config_file[0-9]+";
+   std::vector<ossimString> keywords;
+   kwl.getSubstringKeyList(keywords, keywordRegEx);
+
+   for(ossim_uint32 idx=0;idx < (ossim_uint32)keywords.size(); ++idx)
+   {
+      // Looping over each config file listed, performing an execute() on each:
+      m_configFileName = kwl.findKey(keywords[idx]);
+      
+      if (!m_configFileName.empty())
+      {
+         // Expand any environment variable:
+         if (m_configFileName.contains("$("))
+            m_configFileName = m_configFileName.expand();
+
+         // Handle paths relative to the master config list file:
+         if (m_configFileName.path().empty())
+            m_configFileName = m_configFileName.setPath(config_list_path);
+      }
+
+      // Execute this config file:
+      if (m_configFileName.isReadable())
+      {
+         overall_test_status |= execute();
+      }
+   }
+
+   return overall_test_status;
+}
+
+//************************************************************************************************
+//! Fetches string from OS for naming and tagging the log file.
+//************************************************************************************************
+void ossimBatchTest::getDateString(ossimString& date)
+{
+   time_t t;
+   time(&t);
+   tm* lt;
+   lt = localtime(&t);
+   std::string frmt = "%Y%m%d%H%M%S";
+   // yyyymmddhhmmss
+   char s[15];
+   size_t count = strftime(s, 15, frmt.c_str(), lt);
+   if ( count && (count < 15) )
+      date = s;
+   else
+      date.clear();
+
+}
+
+//**************************************************************************************************
+//! Establishes name of output log file.
+//**************************************************************************************************
+void ossimBatchTest::getLogFilename(ossimFilename& logFile)
+{
+   logFile = "obt-log-";
+   ossimString date;
+   getDateString(date);
+   logFile += date;
+   logFile += ".txt";
+}
+
+//**************************************************************************************************
+//! Within a single config file can be multiple tests, distinguished by the "test*." prefix. This
+//! method manages the execution of a single test.
+//**************************************************************************************************
+ossim_uint8 ossimBatchTest::processTest(const ossimString& prefix, const ossimKeywordlist& kwl)
+{
+   ossim_uint8 testStatus = TEST_TBD;
+
+   // Determine first if this test prefix is represented in the KWL:
+   if (kwl.getNumberOfSubstringKeys(prefix) == 0)
+      return testStatus;
+
+   ossimString testName;
+   const char* lookup = kwl.find( prefix, "name" );
+   if ( lookup )
+   {
+      testName = lookup;
+   }
+   if (testName.empty())
+   {
+      if (prefix.empty())
+         testName = m_configFileName.fileNoExtension();
+      else
+         testName = prefix.trim(".");
+   }
+
+   m_logStr << "\n----------------------------------------------------------------------\n";
+
+   // See if test is disabled/enabled:
+   
+   bool enabled = true;
+   lookup = kwl.find( prefix, "enabled" );
+   if ( lookup )
+   {
+      enabled = ossimString(lookup).toBool();
+   }
+
+   if ( !enabled )
+   {
+      testStatus = TEST_DISABLED;
+      ossimString statusString;
+      if ( prefix.size() )
+      {
+         statusString = prefix.trim(ossimString(".")) + ossimString(": disabled");
+      }
+      else
+      {
+         statusString = "test: disabled";
+      }
+      cout << "test_name: " << testName << "\n" << statusString << endl;
+      m_logStr << "test_name: " << testName << "\n" << statusString << endl;
+      return testStatus;
+   }
+
+   cout     << "\n\nbegin_test:\n" << prefix << "name: " << testName << "\n";
+   m_logStr << "\n\nbegin_test:\n" << prefix << "name: " << testName << "\n";   
+   lookup = kwl.find( prefix, "description" );
+   if ( lookup )
+      m_logStr << "description: " << lookup << "\n";
+
+   bool preProcessFlag  = false;
+   bool expectedFlag    = false;
+   bool testFlag        = false;
+   bool postProcessFlag = false;
+   bool cleanFlag       = false;
+   std::string date; 
+
+   lookup = kwl.find(prefix.c_str(), "run_clean_commands");
+   if ( lookup )
+   {
+      cleanFlag = ossimString(lookup).toBool();
+   }
+
+   lookup = kwl.find(prefix.c_str(), "run_preprocessing_commands");
+   if ( lookup )
+   {  
+      preProcessFlag = ossimString(lookup).toBool();
+   }
+
+   lookup = kwl.find(prefix.c_str(), "run_expected_results_commands");
+   if ( lookup )
+   {
+      expectedFlag = ossimString(lookup).toBool();
+   }
+
+   lookup = kwl.find(prefix.c_str(), "run_test_commands");
+   if ( lookup )
+   {
+      testFlag = ossimString(lookup).toBool();
+   }
+
+   lookup = kwl.find(prefix.c_str(), "run_postprocessing_commands");
+   if ( lookup )
+   {
+      postProcessFlag = ossimString(lookup).toBool();
+   }
+
+   m_logStr << "preProcessFlag:  " << preProcessFlag
+            << "\nexpectedFlag:    " <<expectedFlag
+            << "\ntestFlag:        " <<testFlag
+            << "\npostProcessFlag: " <<postProcessFlag
+            << "\ncleanFlag:       " <<cleanFlag
+            << "\n";
+
+   // Run the clean first if set...
+   if ( cleanFlag )
+   {
+      ossimString prefixBase = prefix + "clean_command";
+      testStatus |= processCommands( prefixBase, kwl, testName, false );
+   }
+
+   if ( preProcessFlag && !(testStatus & TEST_ERROR))
+   {
+      ossimString prefixBase = prefix + "preprocess_command";
+      testStatus |= processCommands( prefixBase, kwl, testName, false );
+   }
+   if ( expectedFlag  && !(testStatus & TEST_ERROR))
+   {
+      ossimString prefixBase = prefix + "expected_results_command";
+      testStatus |= processCommands( prefixBase, kwl, testName, true );
+   }
+   if ( testFlag  && !(testStatus & TEST_ERROR))
+   {
+      ossimString prefixBase = prefix + "test_command";
+      testStatus |= processCommands( prefixBase, kwl, testName, true );
+   }
+   if ( postProcessFlag  && !(testStatus & TEST_ERROR))
+   {
+      ossimFilename tempFile;
+
+      if ( getTempFileName( prefix, kwl, tempFile ) )
+      {
+         ossimString prefixBase = prefix + "postprocess_command";
+         testStatus |= processCommands( prefixBase, kwl, testName, false, tempFile );
+      }
+      else
+      {
+         m_logStr << testName << ": ERROR temp file could not be derived..." << endl;
+         testStatus |= TEST_ERROR; // Set an error bit...
+      }
+   }
+
+   cout     << "end_test:\n";
+   m_logStr << "end_test:\n";
+
+   m_logStr << "----------------------------------------------------------------------\n"; 
+   return testStatus; 
+}
+
+//**************************************************************************************************
+ossim_uint8 ossimBatchTest::processCommands(const ossimString& prefixBase,
+                                            const ossimKeywordlist& kwl,
+                                            const ossimString& testName,
+                                            bool logTime,
+                                            const ossimFilename& tempFileName)
+{
+   ossim_uint8 result = TEST_TBD;
+
+   //---
+   // We must do these in order so we will use the
+   // ossimKeywordlist::getNumberOfSubstringKeys
+   // instead of: ossimKeywordlist::getSubstringKeyList
+   //
+   // MAX_INDEX is just so people can skip numbers in their config file like:
+   // test1.command
+   // test3.command oops...
+   //---
+   ossimString regExpStr = prefixBase + "[0-9]+";
+   const ossim_uint32 num_commands = kwl.getNumberOfSubstringKeys(regExpStr);
+   const ossim_uint32 MAX_INDEX = num_commands + 1000;
+
+   // Hack to permit defaulted results paths and default clean operation:
+   if (num_commands == 0)
+   {
+      bool rtn_ok = true;
+      if (prefixBase.contains("preprocess"))
+         rtn_ok = makeDefaultResultsDir();
+      if (prefixBase.contains("clean"))
+         rtn_ok = doDefaultClean();
+      if (rtn_ok)
+         result = TEST_PASSED;
+      else
+         result = TEST_ERROR;
+      return result;
+   }
+
+   ossimString date;
+   double startTime;
+   double stopTime;
+   
+   ossimString command;
+   ossim_uint32 index = 0;
+   ossim_uint32 processedIndexes = 0;
+   const char* lookup = 0;
+   
+   bool postprocessing = false;
+   if (prefixBase.contains("postprocess"))
+      postprocessing = true;
+
+   while (  processedIndexes < num_commands )
+   {
+      ossimString cmd_kw =  prefixBase + ossimString::toString(index);
+      lookup = kwl.find( cmd_kw );
+      if ( lookup )
+      {
+         ossimString command_line = convertToNative( lookup ).c_str();
+         if ( tempFileName.size() )
+         {
+            command_line += " > " + tempFileName;
+         }
+
+         m_logStr << "executing command: " << command_line << "\n";
+
+         if ( logTime )
+         {
+            getDateString(date);
+            m_logStr << "begin: " << date << "\n";
+
+            // Start the clock:
+            startTime = ossimTimer::instance()->time_s();
+         }
+            
+         // Launch the command:
+         int status = system(command_line.chars());
+         if (status == 0)
+            result |= TEST_PASSED;
+         else if (postprocessing)
+            result |= TEST_FAILED;
+         else
+            result |= TEST_ERROR;
+
+         if ( logTime )
+         {
+            // Log the time and status:
+            stopTime = ossimTimer::instance()->time_s();
+            getDateString(date);
+            m_logStr << "end: " << date << "\n"
+                   << testName << "[" << index << "]: elapsed time in seconds: "
+                   << std::setiosflags(ios::fixed)
+                   << std::setprecision(4)
+                   << (stopTime-startTime) << "\n";
+         }
+         
+         m_logStr << "return status: " << status << "\n";
+         
+         // Output the status.
+         // If failed write the temp file to the log.  This should have the diffs in it.
+         ostringstream statusString;
+         if ( prefixBase.size() )
+         {
+            statusString << prefixBase;
+         }
+         else
+         {
+            statusString << "test";
+         }
+         statusString << "[" << index << "]: ";
+
+         if ( status != 0 )
+         {
+            // A bad return status can be a test fail if the command was a postprocess:
+            if ( postprocessing )
+            {
+               statusString << "FAILED";
+            }
+            else
+            {
+               statusString << "ERROR";
+            }
+
+            cout << statusString.str() << endl;
+            m_logStr << statusString.str() << endl;
+            m_logStr << command << "\noutput follows:\n";
+            std::ifstream in;
+            if (!tempFileName.empty())
+            {
+               in.open(tempFileName.c_str(), ios::in | ios::binary);
+               if ( in.is_open() )
+               {
+                  char ch;
+                  while ( in.get(ch) ) m_logStr.put(ch);
+                  m_logStr << "\n";
+                  in.close();
+               }
+            }
+         }
+         else
+         {
+            statusString << "PASSED";
+            cout << statusString.str() << endl;
+            m_logStr << statusString.str() << endl;
+         }
+
+         ++processedIndexes;
+      }
+      ++index;
+      
+      if ( index >= MAX_INDEX ) 
+         break; // Config file has bad numbering...
+   }
+   return result;
+}
+
+//**************************************************************************************************
+void ossimBatchTest::preprocessKwl(const std::vector<std::string>& testList,
+                                   const std::string& testCommand,
+                                   ossimKeywordlist& kwl)
+{
+   if ( testList.empty() || testCommand.empty() || (kwl.getSize()==0) )
+      return;
+
+   // Check for user passed in "all" to option.
+   std::vector<std::string>::const_iterator testIter = testList.begin();
+   bool enableAllTestFlag = false;
+   ossimString firstTest(*testIter);
+   firstTest.downcase();
+   if ( firstTest == "all" )
+   {
+      enableAllTestFlag = true;
+   }
+
+   while ( testIter != testList.end() )
+   {
+      // Get the number of test:
+      ossimString regExpStr = "test[0-9]+\\.";
+      ossim_uint32 num_tests = kwl.getNumberOfSubstringKeys(regExpStr);
+      const ossim_uint32 MAX_INDEX = num_tests + 1000;
+      ossimString prefixBase = "test";
+      ossim_uint32 index = 0;
+      ossim_uint32 processedIndexes = 0;
+
+      // A count of 0 may indicate that the config file consists of a single, unprefixed test spec:
+      bool is_single_test = false;
+      if (num_tests == 0)
+      {
+         regExpStr = "test_command[0-9]+";
+         const ossim_uint32 cmd_count = kwl.getNumberOfSubstringKeys(regExpStr);
+         if (cmd_count != 0)
+         {
+            ++num_tests;
+            is_single_test = true;
+         }
+         else
+            break; // Nothing to do here:
+      }
+
+      while ( processedIndexes < num_tests )
+      {
+         ossimString prefix ("");
+         bool test_name_matches = true;
+         bool test_exists = true;
+         
+         if (!is_single_test)
+         {
+            // The tests are prefixed with "test*". Assign the prefix for this test set:
+            prefix = prefixBase + ossimString::toString(index);
+            test_name_matches = (prefix == (*testIter).c_str());
+            prefix += ".";
+            
+            // With a valid prefix, check if this test even exists before doing any more 
+            // preprocessing:
+            regExpStr = prefix + "test_command[0-9]+";
+            const ossim_uint32 cmd_count = kwl.getNumberOfSubstringKeys(regExpStr);
+            test_exists = cmd_count > 0;
+         }
+
+         if ( test_exists )
+         {
+            if ( test_name_matches || enableAllTestFlag )
+            {
+               //---
+               // Removed adjustment of "enable" flag. Let the config file "enable" key
+               // control this.  drb - 20151202
+               // kwl.add(prefix.c_str(), "enabled", "1", true);
+               //---
+               kwl.add(prefix.c_str(), testCommand.c_str(), "1", true);
+               if ( testCommand == "run_expected_results_commands" )
+               {
+                  // Need pre-processing if clean performed.
+                  kwl.add(prefix.c_str(), "run_preprocessing_commands", "1", true);
+               }
+               if ( testCommand == "run_test_commands" )
+               {
+                  // Need pre/post-processing:
+                  kwl.add(prefix.c_str(), "run_preprocessing_commands", "1", true);
+                  kwl.add(prefix.c_str(), "run_postprocessing_commands", "1", true);
+               }
+            }
+            ++processedIndexes;
+         }
+         ++index;
+         if ( index >= MAX_INDEX ) break; 
+      }
+      ++testIter;
+
+   } // End: while ( testIter != testList.end() )
+   
+} // End: preprocessKwl method
+
+//**************************************************************************************************
+//! Default preprocessing step makes expected and output results directories. Returns TRUE if
+//! successful.
+//**************************************************************************************************
+bool ossimBatchTest::makeDefaultResultsDir()
+{
+   if ( !m_outDir.exists() && !m_outDir.createDirectory() )
+   {
+      cerr << "Could not create: " << m_outDir << endl;
+      return false;
+   }
+   if ( !m_expDir.exists() &&  !m_expDir.createDirectory() )
+   {
+      cerr << "Could not create: " << m_expDir << endl;
+      return false;
+   }
+   return true;
+}
+
+//**************************************************************************************************
+//! Default clean step deletes all files in out and exp dirs. Returns TRUE if successful.
+//**************************************************************************************************
+bool ossimBatchTest::doDefaultClean()
+{
+   bool result = true;
+
+   ossimString del_cmd = ossimEnvironmentUtility::instance()->getEnvironmentVariable(
+      ossimString("RMDIR_CMD") );
+   ossimString command_line;
+   
+   if ( m_outDir.exists() )
+   {
+      command_line = del_cmd + " " + m_outDir;
+      m_logStr << "executing command: " << command_line << "\n";
+      if (system(command_line) != 0)
+      {
+         m_logStr << "ERROR: execution failed!\n";
+         cerr << "ERROR: Could not delete <"<<m_outDir<<">. Clean operation failed."<< endl;
+         result = false;
+      }
+   }
+   
+   ossimFilename tmpDir;
+   if ( getDefaultTempFileDir( tmpDir ) )
+   {
+      if ( tmpDir.exists() )
+      {
+         command_line = del_cmd + " " + tmpDir;
+         m_logStr << "executing command: " << command_line << "\n";
+         if (system(command_line) != 0)
+         {
+            m_logStr << "ERROR: execution failed!\n";
+            cerr << "ERROR: Could not delete <"<<m_outDir<<">. Clean operation failed."<< endl;
+            result = false;
+         }
+      }
+   }
+   
+   return result;
+}
+
+bool ossimBatchTest::getTempFileName( const ossimString& prefix,
+                                      const ossimKeywordlist& kwl,
+                                      ossimFilename& tempFile ) const
+{
+   const char* lookup = kwl.find(prefix.c_str(), "temp_file");
+   if ( lookup )
+   {
+      tempFile = ossimFilename(lookup);
+      if (tempFile.contains("$("))
+         tempFile = tempFile.expand();
+   }
+   else
+   {
+      if ( getDefaultTempFileDir( tempFile ) )
+      {
+         if ( tempFile.createDirectory( true, 0775 ) )
+         {
+            // Tack on the file name.
+            tempFile = tempFile.dirCat("tmp.txt");
+         }
+         else
+         {
+            tempFile.clear();
+         }
+      }
+   }
+   return ( tempFile.size() > 0 );
+}
+
+bool ossimBatchTest::getDefaultTempFileDir( ossimFilename& tempFile ) const
+{
+   // Create a default tmp directory under OSSIM_BATCH_TEST_RESULTS.
+   tempFile = ossimEnvironmentUtility::instance()->getEnvironmentVariable(
+      ossimString("OSSIM_BATCH_TEST_RESULTS") );
+   if (!tempFile.empty())
+      tempFile = tempFile.dirCat("tmp");
+   else
+      tempFile = ossimEnvironmentUtility::instance()->getEnvironmentVariable(ossimString("TEMP"));
+   return ( tempFile.size() > 0 );
+}
+
+void ossimBatchTest::usage(ossimArgumentParser& ap)
+{
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+
+   au->addCommandLineOption("-a or --accept-test", 
+      "<testX> Runs \"run_expected_results_commands\" portion from test configuration file for "
+      "testX where X is some test number, i.e. 1, 2, 3...  This will turn off all other test in "
+      "the test config file. Notes: Multiple tests can be entered by quoting string of space "
+      "separated test, e.g. \"test1 test2\". To accept all tests use \"all\" for test.");
+   
+   au->addCommandLineOption("-c or --clean-test", "<testX> Runs \"run_clean_commands\" portion "
+      "from test configuration file for testX where X is some test number, i.e. 1, 2, 3...  This "
+      "will turn off all other test in the test config file. Notes: Multiple tests can be entered "
+      "by quoting string of space separated test, e.g. \"test1 test2\". To clean all tests use "
+      "\"all\" for test.");
+
+   au->addCommandLineOption("-p or --preprocess-test", 
+      "<testX> Runs \"run_preprocessing_commands\" portion from test configuration file for testX "
+      "where X is some test number, i.e. 1, 2, 3...  This will turn off all other test in the test "
+      "config file. Notes: Multiple tests can be entered by quoting string of space separated "
+      "test, e.g. \"test1 test2\". To preprocess all tests use \"all\" for test.");
+   
+   au->addCommandLineOption("-r or --run-test", 
+      "<testX> Runs \"run_test_commands\" portion from test configuration file for testX where X "
+      "is some test number, i.e. 1, 2, 3...  This will turn off all other test in the test config "
+      "file. Notes: Multiple tests can be entered by quoting string of space separated test, e.g. "
+      "\"test1 test2\". To run all tests use \"all\" for test.");
+   
+   au->addCommandLineOption("-h or --help", "Display usage.");
+   
+   au->addCommandLineOption("-W or -w", 
+      "<template_name.kwl> Writes a long-form (-W) or a short-form (-w) template test "
+      "configuration file.");
+
+   // Write usage.
+   au->write(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::string ossimBatchTest::convertToNative( const char* lookup ) const
+{
+   std::string s;
+   
+   if ( lookup )
+   {
+      s = lookup;
+      const std::string::size_type SIZE = s.size();
+      std::string::size_type i = 0;
+      
+#if defined(_WIN32)
+      //---
+      // Must not convert slashes for: "del /Q", "fc /W", and "copy /Y"
+      //---
+      while( i < SIZE )
+      {
+         if( s[i] == '/' )
+         {
+            bool replace = true;
+            if ( (i+2) < SIZE ) // Could fit a window command and space like: "/Y "
+            {
+               if ( (s[i+1] == 'Q') || (s[i+1] == 'W') || (s[i+1] == 'Y') )
+               {
+                  if ( s[i+2] == ' ' ) // Check for space after "/Q".
+                  {
+                     replace = false;
+                  }
+               }
+            }
+            if ( replace )
+            {
+               s[i] = '\\';
+            }
+         }
+         ++i;
+      }
+#else
+      while( i < SIZE )
+      {
+         if( s[i] == '\\' )
+         {
+            s[i] = '/';
+         }
+         ++i;
+      }
+#endif
+      
+   } // Matches: if ( lookup )
+   
+   return s;
+}
+
+
diff --git a/src/util/ossimChipProcTool.cpp b/src/util/ossimChipProcTool.cpp
new file mode 100755
index 0000000..31b3fac
--- /dev/null
+++ b/src/util/ossimChipProcTool.cpp
@@ -0,0 +1,1509 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGeoPolygon.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimRefreshEvent.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/util/ossimChipProcTool.h>
+#include <cmath>
+#include <sstream>
+#include <string>
+
+static const std::string AOI_GEO_RECT_KW         = "aoi_geo_rect";
+static const std::string AOI_MAP_RECT_KW         = "aoi_map_rect";
+static const std::string AOI_GEO_CENTER_KW       = "aoi_geo_center";
+static const std::string AOI_SIZE_METERS_KW      = "aoi_size_meters";
+static const std::string AOI_SIZE_PIXELS_KW      = "aoi_size_pixels";
+static const std::string CLIP_POLY_LAT_LON_KW    = "clip_poly_lat_lon";
+static const std::string LUT_FILE_KW             = "lut_file";
+static const std::string GSD_KW                  = "gsd";
+static const std::string OUTPUT_RADIOMETRY_KW    = "output_radiometry";
+static const std::string READER_PROPERTY_KW      = "reader_property";
+static const std::string SNAP_TIE_TO_ORIGIN_KW   = "snap_tie_to_origin";
+static const std::string SRS_KW                  = "srs";
+static const std::string TILE_SIZE_KW            = "tile_size"; // pixels
+static const std::string TRUE_KW                 = "true";
+static const std::string WRITER_KW               = "writer";
+static const std::string WRITER_PROPERTY_KW      = "writer_property";
+
+ossimChipProcTool::ossimChipProcTool( const ossimChipProcTool& /* obj */)
+: m_projIsIdentity(false),
+  m_geoScaled (false),
+  m_productScalarType(OSSIM_SCALAR_UNKNOWN),
+  m_needCutRect(false)
+{}
+
+ossimChipProcTool::ossimChipProcTool()
+:  m_projIsIdentity(false),
+   m_geoScaled(false),
+   m_productScalarType(OSSIM_SCALAR_UNKNOWN),
+   m_needCutRect(false)
+{
+   m_kwl.setExpandEnvVarsFlag(true);
+   m_gsd.makeNan();
+   m_geom = new ossimImageGeometry;
+   m_procChain = new ossimImageChain;
+}
+
+ossimChipProcTool::~ossimChipProcTool()
+{
+   clear();
+}
+
+void ossimChipProcTool::clear()
+{
+   m_gsd.makeNan();
+
+   m_procChain = 0;
+   m_imgLayers.clear();
+   m_writer = 0;
+   m_geom = 0;
+   m_needCutRect = false;
+}
+
+bool ossimChipProcTool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   std::string tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+   std::string tempString2;
+   ossimArgumentParser::ossimParameter stringParam2(tempString2);
+   std::string tempString3;
+   ossimArgumentParser::ossimParameter stringParam3(tempString3);
+   std::string tempString4;
+   ossimArgumentParser::ossimParameter stringParam4(tempString4);
+   double tempDouble1;
+   ossimArgumentParser::ossimParameter doubleParam1(tempDouble1);
+   double tempDouble2;
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+   vector<ossimString> paramList;
+
+   ossim_uint32 readerPropIdx = 0;
+   ossim_uint32 writerPropIdx = 0;
+   ostringstream keys;
+
+   if ( ap.read("--load-options", stringParam1))
+   {
+      if (!m_kwl.addFile(tempString1.c_str()))
+      {
+         ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+         throw ossimException("Must supply an output file.");
+      }
+   }
+
+   if ( ap.read("--aoi-geo-bbox", stringParam1, stringParam2, stringParam3, stringParam4))
+   {
+      ostringstream ostr;
+      ostr<<tempString1<<" "<<tempString2<<" "<<tempString3<<" "<<tempString4<<ends;
+      m_kwl.addPair( AOI_GEO_RECT_KW, ostr.str() );
+   }
+
+   if ( ap.read("--aoi-geo-center", stringParam1, stringParam2))
+   {
+      ostringstream ostr;
+      ostr<<tempString1<<" "<<tempString2<<ends;
+      m_kwl.addPair( AOI_GEO_CENTER_KW, ostr.str() );
+   }
+
+   if ( ap.read("--aoi-map-bbox", stringParam1, stringParam2, stringParam3, stringParam4))
+   {
+      ostringstream ostr;
+      ostr<<tempString1<<" "<<tempString2<<" "<<tempString3<<" "<<tempString4<<ends;
+      m_kwl.addPair( AOI_MAP_RECT_KW, ostr.str() );
+   }
+
+   if ( ap.read("--aoi-size-meters", stringParam1, stringParam2))
+   {
+      ostringstream ostr;
+      ostr<<tempString1<<" "<<tempString2<<ends;
+      m_kwl.addPair( AOI_SIZE_METERS_KW, ostr.str() );
+   }
+
+   if ( ap.read("--aoi-size-pixels", stringParam1, stringParam2))
+   {
+      ostringstream ostr;
+      ostr<<tempString1<<" "<<tempString2<<ends;
+      m_kwl.addPair( AOI_SIZE_PIXELS_KW, ostr.str() );
+   }
+
+   if (ap.read("-b", stringParam1) || ap.read("--bands", stringParam1))
+      m_kwl.addPair( std::string(ossimKeywordNames::BANDS_KW), tempString1 );
+
+   if( ap.read("--central-meridian", stringParam1) )
+      m_kwl.addPair( std::string(ossimKeywordNames::CENTRAL_MERIDIAN_KW), tempString1 );
+
+   if( ap.read("--color-table", stringParam1) || ap.read("--lut", stringParam1) )
+      m_kwl.addPair( LUT_FILE_KW, tempString1 );
+
+   if ( ap.read("-e", stringParam1) || ap.read("--entry", stringParam1) )
+      m_kwl.addPair( std::string(ossimKeywordNames::ENTRY_KW), tempString1 );
+
+   if (ap.read("--dem", paramList))
+   {
+      ostringstream value;
+      for(ossim_uint32 idx=0; idx<paramList.size(); ++idx)
+      {
+         ostringstream key;
+         key<<ossimKeywordNames::ELEVATION_SOURCE_KW<<idx;
+         m_kwl.addPair(key.str(), paramList[idx] );
+      }
+   }
+
+   if( ap.read("--gsd", stringParam1) )
+      m_kwl.addPair( GSD_KW, tempString1 );
+
+   if ( ap.read("--hemisphere", stringParam1) )
+      m_kwl.addPair( std::string(ossimKeywordNames::HEMISPHERE_KW), tempString1 );
+
+   vector<ossimString> imageFnames;
+   if (ap.read("--image", imageFnames) || ap.read("-i", imageFnames))
+   {
+      if (imageFnames.size() == 1)
+         m_kwl.add(ossimKeywordNames::IMAGE_FILE_KW, imageFnames[0].chars() );
+      else for(ossim_uint32 idx=0; idx<imageFnames.size(); ++idx)
+      {
+         ostringstream key;
+         key<<ossimKeywordNames::IMAGE_FILE_KW<<idx;
+         m_kwl.addPair(key.str(), imageFnames[idx] );
+      }
+   }
+
+   if( ap.read("--origin-latitude", stringParam1) )
+      m_kwl.addPair( std::string(ossimKeywordNames::ORIGIN_LATITUDE_KW), tempString1 );
+
+   if(ap.read("--output-file", stringParam1) || ap.read("-o", stringParam1))
+      m_kwl.addPair( ossimKeywordNames::OUTPUT_FILE_KW, tempString1 );
+
+   if(ap.read("--output-radiometry", stringParam1))
+      m_kwl.addPair( OUTPUT_RADIOMETRY_KW, tempString1 );
+
+   if( ap.read("--projection", stringParam1) )
+      m_kwl.addPair( std::string(ossimKeywordNames::PROJECTION_KW), tempString1 );
+
+   while (ap.read("--reader-prop", stringParam1))
+   {
+      ostringstream key;
+      key << READER_PROPERTY_KW << readerPropIdx;
+      m_kwl.addPair(key.str(), tempString1 );
+      ++readerPropIdx;
+   }
+
+   if ( ap.read("--snap-tie-to-origin") )
+      m_kwl.addPair( SNAP_TIE_TO_ORIGIN_KW, TRUE_KW);
+
+   if( ap.read("--srs", stringParam1) )
+   {
+      ossimString os = tempString1;
+      if ( os.contains("EPSG:") )
+         os.gsub( ossimString("EPSG:"), ossimString("") );
+      m_kwl.addPair( SRS_KW, os.string() );
+   }
+
+   if( ap.read("--tile-size", stringParam1) )
+      m_kwl.addPair( TILE_SIZE_KW, tempString1 );
+
+   if( ap.read("-w", stringParam1) || ap.read("--writer", stringParam1) )
+      m_kwl.addPair( WRITER_KW, tempString1);
+
+   while (ap.read("--writer-prop", stringParam1))
+   {
+      ostringstream key;
+      key << WRITER_PROPERTY_KW << writerPropIdx;
+      m_kwl.addPair(key.str(), tempString1 );
+      ++writerPropIdx;
+   }
+
+   if( ap.read("--zone", stringParam1) )
+      m_kwl.addPair( std::string(ossimKeywordNames::ZONE_KW), tempString1);
+
+   return true;
+}
+
+void ossimChipProcTool::processRemainingArgs(ossimArgumentParser& ap)
+{
+   ossim_uint32 inputIdx = 0;
+
+   bool dumpKwl = false;
+   if ( ap.read("--dump-options") )
+      dumpKwl = true;
+
+   if ( ap.argc() >= 2 )
+   {
+      // Output file is last arg:
+      m_kwl.add( ossimKeywordNames::OUTPUT_FILE_KW, ap[ap.argc()-1]);
+   }
+   else
+   {
+      if ( !m_kwl.find(ossimKeywordNames::OUTPUT_FILE_KW) )
+      {
+         ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+         throw ossimException("Must supply an output file.");
+      }
+   }
+
+   if ( ap.argc() > 2 ) // User passed inputs in front of output file.
+   {
+      int pos = 1; // ap.argv[0] is application name. 
+      int idx = 0;
+      while ( pos < (ap.argc()-1) )
+      {
+         ostringstream key;
+         key<<ossimKeywordNames::IMAGE_FILE_KW<<idx;
+         m_kwl.add( key.str().c_str(), ap[pos] );
+
+         ++pos; // Go to next arg...
+
+      } // End: while ( pos < (ap.argc()-1) )
+
+   } // End: if ( ap.argc() > 2 )
+
+   // End of arg parsing.
+   ap.reportRemainingOptionsAsUnrecognized();
+   if ( ap.errors() )
+   {
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      throw ossimException("Unknown option...");
+   }
+
+   if (dumpKwl)
+   {
+      ossimFilename f = getClassName();
+      f.setExtension("kwl");
+      if (!m_kwl.write(f.chars()))
+      {
+         ostringstream xmsg;
+         xmsg<<"ossimChipProcUtil:"<<__LINE__<<" Error encountered writing options file to <"<<f<<">";
+         throw ossimException(xmsg.str());
+      }
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"\nWrote options file to <"<<f<<">"<<endl;
+   }
+
+   initialize(m_kwl);
+}
+
+void ossimChipProcTool::initialize( const ossimKeywordlist& kwl )
+{
+   m_helpRequested = false;
+
+   // Don't copy KWL if member KWL passed in:
+   if (&kwl != &m_kwl)
+   {
+      // Start with clean options keyword list.
+      m_kwl.clear();
+      m_kwl.addList( kwl, true );
+   }
+
+   // Assign some members from KWL:
+   m_productScalarType = ossimScalarTypeLut::instance()->
+         getScalarTypeFromString( m_kwl.findKey( OUTPUT_RADIOMETRY_KW ) );
+
+   m_productFilename = m_kwl.findKey( std::string(ossimKeywordNames::OUTPUT_FILE_KW) );
+
+   // Create chains for input sources.
+   loadImageFiles();
+
+   // Load any specified DEMs:
+   loadDemFiles();
+
+   // Initialize projection and propagate to chains.
+   createOutputProjection();
+
+   // Pass control to derived class so it can add its specific processing to the chain(s). This
+   // should return an initialized m_procChain.
+   initProcessingChain();
+   finalizeChain();
+}
+
+void ossimChipProcTool::finalizeChain()
+{
+   ostringstream errMsg;
+
+   // See if an LUT is requested:
+   ossimFilename lutFile = m_kwl.findKey( LUT_FILE_KW );
+   if (!lutFile.empty())
+   {
+      if ( !lutFile.exists() )
+      {
+         errMsg<<"ERROR ossimChipProcUtil ["<<__LINE__<<"] Color table <"<<lutFile
+               <<"> does not exists: "<<ends;
+         throw ossimException(errMsg.str());
+      }
+      ossimRefPtr<ossimIndexToRgbLutFilter> lut = new ossimIndexToRgbLutFilter();
+      lut->setLut(lutFile);
+      m_procChain->add(lut.get());
+   }
+
+   if (m_needCutRect)
+   {
+      // Add a cut filter. This will:
+      // 1) Null out/clip any data pulled in.
+      // 2) Speed up by not propagating get tile request outside the cut or "aoi"
+      //    to the left hand side(input).
+      m_cutRectFilter = new ossimRectangleCutFilter();
+      m_cutRectFilter->setRectangle( m_aoiViewRect );
+      m_cutRectFilter->setCutType( ossimRectangleCutFilter::OSSIM_RECTANGLE_NULL_OUTSIDE );
+      m_procChain->add(m_cutRectFilter.get());
+   }
+
+   // Set the image size here.  Note must be set after combineLayers.  This is needed for
+   // the ossimImageGeometry::worldToLocal call for a geographic projection to handle wrapping
+   // accross the date line.
+   m_geom->setImageSize( m_aoiViewRect.size() );
+
+   // Reset the source bounding rect if it changed.
+   m_procChain->initialize();
+}
+
+bool ossimChipProcTool::execute()
+{
+   if (m_helpRequested)
+      return true;
+
+   ostringstream xmsg;
+
+   if ( !m_procChain.valid() )
+   {
+      xmsg << "ossimChipProcUtil:"<<__LINE__<<"Null pointer encountered for m_procChain!";
+      throw ossimException(xmsg.str());
+   }
+
+   if (m_geom->getImageSize().hasNans())
+   {
+      xmsg << "ossimChipProcUtil:"<<__LINE__<<"Image size is NaN!";
+      throw ossimException(xmsg.str());
+   }
+
+   // Set up the writer.
+   m_writer = newWriter();
+
+   // Connect the writer to the processing chain.
+   m_writer->connectMyInputTo(0, m_procChain.get());
+
+   // Set the area of interest. NOTE: This must be called after the writer->connectMyInputTo as
+   // ossimImageFileWriter::initialize incorrectly resets AOI back to the bounding rect.
+   m_writer->setAreaOfInterest(m_aoiViewRect);
+
+   if (m_writer->getErrorStatus() != ossimErrorCodes::OSSIM_OK)
+      throw ossimException( "Unable to initialize writer for execution" );
+
+   // Add a listener to get percent complete.
+   ossimStdOutProgress prog(0, true);
+   m_writer->addListener(&prog);
+
+   // Write the file:
+   m_writer->execute();
+   m_writer->removeListener(&prog);
+   if(m_writer->isAborted())
+   {
+      xmsg << "ossimChipProcUtil:"<<__LINE__<<"Writer Process aborted!";
+      throw ossimException(xmsg.str());
+   }
+
+   ossimNotify(ossimNotifyLevel_INFO)<<"Wrote product image to <"<<m_productFilename<<">"<<endl;
+
+   return true;
+}
+
+void ossimChipProcTool::abort()
+{
+   if(m_writer.valid())
+   {
+      m_writer->abort();
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimChipProcTool::getChip(const ossimDrect& map_bounding_rect,
+                                                       const ossimDpt& gsd)
+{
+   ostringstream xmsg;
+   if (!m_geom.valid())
+      return 0;
+
+   ossimMapProjection* proj = m_geom->getAsMapProjection();
+   if (proj == 0)
+      return 0;
+
+   proj->setMetersPerPixel(gsd);
+   ossimGpt ulGpt = proj->inverse(map_bounding_rect.ul());
+   ossimGpt lrGpt = proj->inverse(map_bounding_rect.lr());
+   m_aoiGroundRect = ossimGrect(ulGpt, lrGpt);
+   ossimDrect view_rect;
+   m_geom->worldToLocal(m_aoiGroundRect, view_rect);
+   m_aoiViewRect = view_rect;
+   m_geom->setImageSize( m_aoiViewRect.size() );
+
+   return getChip(m_aoiViewRect);
+}
+
+ossimRefPtr<ossimImageData> ossimChipProcTool::getChip(const ossimGrect& geo_bounding_grect)
+{
+   ossimRefPtr<ossimImageData> chip = 0;
+   if (!m_geom.valid())
+      return chip;
+
+   // Set the new cut rectangle. Note that a NaN rect passed in implies the full AOI:
+   if (!geo_bounding_grect.hasNans())
+   {
+      ossimNotify(ossimNotifyLevel_INFO) <<"\nossimChipProcUtil::getChip(grect) -- NaN rect "
+            "provided. Using full AOI."<<endl;
+      m_aoiGroundRect = geo_bounding_grect;
+      computeAdjustedViewFromGrect();
+   }
+
+   return getChip(m_aoiViewRect);
+}
+
+ossimRefPtr<ossimImageData> ossimChipProcTool::getChip(const ossimIrect& bounding_irect)
+{
+   ossimRefPtr<ossimImageData> chip = 0;
+   if(!m_procChain.valid())
+      return chip;
+
+   m_aoiViewRect = bounding_irect;
+   m_geom->setImageSize( m_aoiViewRect.size() );
+
+   // There should not be a chipper filter in the chain for getImage() calls since the chipping
+   // is implied by the requested rect to getTile(), but if present, make sure it covers
+   // the requested AOI to avoid masking out the tile.
+   if (!m_cutRectFilter.valid())
+   {
+      m_cutRectFilter = new ossimRectangleCutFilter;
+      m_cutRectFilter->setCutType( ossimRectangleCutFilter::OSSIM_RECTANGLE_NULL_OUTSIDE );
+      m_procChain->add(m_cutRectFilter.get());
+   }
+   m_cutRectFilter->setRectangle( m_aoiViewRect );
+   return m_procChain->getTile( m_aoiViewRect, 0 );
+}
+
+ossimListenerManager* ossimChipProcTool::getManager()
+{
+   return this;
+};
+
+ossimObject* ossimChipProcTool::getObject()
+{
+   return this;
+}
+
+const ossimObject* ossimChipProcTool::getObject() const
+{
+   return this;
+}
+
+void ossimChipProcTool::loadImageFiles()
+{
+   ossim_uint32 numImages = m_kwl.numberOf( ossimKeywordNames::IMAGE_FILE_KW );
+   ossim_uint32 count = numImages;
+   ossim_uint32 entryIndex = 0;
+
+   // Returns 0 if no entry found. This is default anyway.
+   ossim_uint32 globalEntryValue = ossimString(m_kwl.find(ossimKeywordNames::ENTRY_KW)).toUInt32();
+
+   for (ossim_uint32 i=0; count > 0; ++i)
+   {
+      ossimFilename f;
+      if (numImages == 1)
+      {
+         ostringstream key;
+         key <<  ossimKeywordNames::IMAGE_FILE_KW; // Try non-indexed first
+         f = m_kwl.findKey( key.str() );
+      }
+      if (f.empty())
+      {
+         ostringstream key;
+         key <<  ossimKeywordNames::IMAGE_FILE_KW << i ;
+         f = m_kwl.findKey( key.str() );
+      }
+      if ( f.empty() )
+         continue;
+
+      // Look for the entry key, e.g. image_source0.entry: 10
+      ostringstream entryKey;
+      entryKey <<  ossimKeywordNames::IMAGE_FILE_KW << i << "." << ossimKeywordNames::ENTRY_KW;
+      ossimString os = m_kwl.findKey(entryKey.str());
+      if (!os.empty())
+         entryIndex = os.toUInt32();
+      else
+         entryIndex = globalEntryValue;
+
+      // Add it:
+      ossimRefPtr<ossimSingleImageChain> ic = createInputChain(f, entryIndex);
+      if (!ic.valid())
+      {
+         ostringstream errMsg;
+         errMsg<<"ERROR: ossimChipProcUtil ["<<__LINE__<<"] Could not open <"<<f<<">"<<ends;
+         throw ossimException(errMsg.str());
+      }
+
+      // Need a band selector?
+      std::vector<ossim_uint32> bandList(0);
+      getBandList(i, bandList );
+      if ( bandList.size() )
+         ic->setBandSelection( bandList );
+
+      m_imgLayers.push_back(ic);
+      --count;
+   }
+}
+
+ossimRefPtr<ossimSingleImageChain>
+ossimChipProcTool::createInputChain(const ossimFilename& fname, ossim_uint32 entry_index)
+{
+   // Init chain with handler:
+   ossimRefPtr<ossimSingleImageChain> chain = new ossimSingleImageChain;
+   if (!chain->open(fname))
+   {
+      ostringstream errMsg;
+      errMsg<<"ERROR: ossimChipProcUtil ["<<__LINE__<<"] Could not open <"<<fname<<">"<<ends;
+      throw ossimException(errMsg.str());
+   }
+
+   // Set any reader props:
+   ossimImageHandler* handler = chain->getImageHandler().get();
+   setReaderProps( handler );
+   if (!handler->setCurrentEntry( entry_index ))
+   {
+      std::ostringstream errMsg;
+      errMsg << " ERROR: ossimChipProcUtil ["<<__LINE__<<"] Entry " << entry_index << " out of range!" << std::endl;
+      throw ossimException( errMsg.str() );
+   }
+
+   // Set up the remapper:
+   if ( ( m_productScalarType != OSSIM_SCALAR_UNKNOWN) &&
+         ( m_procChain->getOutputScalarType() != m_productScalarType ) )
+   {
+      ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper();
+      remapper->setOutputScalarType(m_productScalarType);
+      chain->add(remapper.get());
+   }
+
+   // Set up the renderer with cache:
+   chain->addResampler();
+   chain->addCache();
+
+   // Add geo polygon cutter if specifried:
+   ossimString param = m_kwl.findKey(CLIP_POLY_LAT_LON_KW);
+   if (!param.empty())
+   {
+      std::vector<ossimGpt> points;
+      ossim::toVector(points, param);
+      if(points.size() >= 3)
+      {
+         ossimGeoPolygon polygon(points);
+         chain->addGeoPolyCutterPolygon(polygon);
+      }
+   }
+
+   chain->initialize();
+   return chain;
+}
+
+void ossimChipProcTool::loadDemFiles()
+{
+   ossim_uint32 numDems = m_kwl.numberOf( ossimKeywordNames::ELEVATION_SOURCE_KW );
+   if (numDems == 0)
+      return;
+
+   cout<<m_kwl<<endl;//TODO:REMOVE
+   ossim_uint32 count = numDems;
+   for (ossim_uint32 i=0; count > 0; ++i)
+   {
+      ossimFilename f;
+      if (numDems == 1)
+      {
+         ostringstream key;
+         key <<  ossimKeywordNames::ELEVATION_SOURCE_KW; // Try non-indexed first
+         f = m_kwl.findKey( key.str() );
+      }
+      if (f.empty())
+      {
+         ostringstream key;
+         key <<  ossimKeywordNames::ELEVATION_SOURCE_KW << i ;
+         cout<<key.str()<<endl;//TODO:REMOVE
+         f = m_kwl.findKey( key.str() );
+      }
+      if ( f.empty() )
+         continue;
+
+      if (!f.isReadable())
+      {
+         ostringstream errMsg;
+         errMsg << "ossimChipProcUtil ["<<__LINE__<<"] Could not open DEM file: <" << f << ">";
+         throw ossimException(errMsg.str());
+      }
+
+      m_demSources.push_back(f);
+      ossimElevManager::instance()->loadElevationPath(f, true);
+      --count;
+   }
+}
+
+void ossimChipProcTool::createOutputProjection()
+{
+   static const char* MODULE = "ossimChipProcUtil::createOutputProjection()";
+
+   ossimString op  = m_kwl.findKey( std::string(ossimKeywordNames::PROJECTION_KW) );
+   ossimString srs = m_kwl.findKey( SRS_KW );
+   if ( op.size() && srs.size() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                           << MODULE << " WARNING:"
+                           << "\nBoth " << SRS_KW << " and " << ossimKeywordNames::PROJECTION_KW
+                           << " keywords are set!"
+                           << "\nsrs:               " << srs
+                           << "\noutput_projection: " << op
+                           << "\nTaking " << srs << " over " << op << "\n";
+   }
+
+   ossimRefPtr<ossimMapProjection> proj = 0;
+   m_geoScaled = false;
+   op.downcase();
+
+   if (op.contains("epsg"))
+      srs = op;
+
+   if ( (op == "geo") || (srs.contains("4326")))
+      proj = new ossimEquDistCylProjection();
+
+   else if (srs.size())
+   {
+      proj = PTR_CAST(ossimMapProjection,
+                      ossimProjectionFactoryRegistry::instance()->createProjection(srs));
+      if (!proj.valid())
+         throw ossimException("ossimChipProcUtil::createOutputProjection() -- Bad EPSG code passed.");
+   }
+   else if (op == "geo-scaled")
+   {
+      m_geoScaled = true; // used later when reference latitude is known
+      proj = new ossimEquDistCylProjection();
+   }
+   else if ( ( op == "input" ) || (op == "identity") || (op == "none") )
+      proj = newIdentityProjection();
+
+   else if ( (op == "utm") || (op == "ossimutmprojection") )
+      proj = newUtmProjection();
+
+   else
+   {
+      m_geoScaled = true; // used later when reference latitude is known
+      proj = new ossimEquDistCylProjection();
+   }
+
+   // Create our ossimImageGeometry with projection (no transform).
+   proj->setElevationLookupFlag(true);
+   m_geom->setProjection(proj.get());
+
+   // Set the scale and AOI.
+   initializeProjectionGsd();
+   initializeAOI(); // also sets the tie point to AOI UL and geoscaling to origin.
+
+   // Setup the view in all the chains.
+   propagateGeometryToChains();
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipProcTool::newIdentityProjection()
+{
+   ossimRefPtr<ossimSingleImageChain> sic = 0;
+   ossimProjection* input_proj = 0;
+   ossimRefPtr<ossimMapProjection> output_proj = 0;
+   ossimRefPtr<ossimImageRenderer> resampler = 0;
+
+   if ( m_imgLayers.size() )
+   {
+      sic = m_imgLayers[0];
+      if (sic.valid())
+      {
+         ossimRefPtr<ossimImageHandler>  ih = sic->getImageHandler();
+         if (ih.valid())
+         {
+            ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+            if (geom.valid())
+            {
+               input_proj = geom->getProjection();
+
+               // Check if input is UTM, need to copy zone and hemisphere if so:
+               ossimUtmProjection* input_utm = dynamic_cast<ossimUtmProjection*>(input_proj);
+               if ( input_utm )
+               {
+                  ossimRefPtr<ossimUtmProjection> output_utm = new ossimUtmProjection;
+                  output_utm->setZone(input_utm->getZone());
+                  output_utm->setHemisphere(input_utm->getHemisphere());
+                  output_proj = output_utm.get();
+               }
+               else
+               {
+                  input_proj = dynamic_cast<ossimMapProjection*>( geom->getProjection() );
+                  if (input_proj)
+                  {
+                     output_proj = (ossimMapProjection*) input_proj->dup();
+                     m_projIsIdentity = true;
+                  }
+               }
+            }
+         }
+      }
+   }
+
+   // try input dem "image" if specified:
+   if (!output_proj.valid() && (m_demSources.size()))
+   {
+      ossimImageGeometry geom;
+      if (geom.open(m_demSources[0]))
+      {
+         input_proj = dynamic_cast<ossimMapProjection*>(geom.getProjection());
+         if (input_proj)
+         {
+            output_proj = (ossimMapProjection*) input_proj->dup();
+            m_projIsIdentity = true;
+         }
+      }
+   }
+
+   return output_proj;
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipProcTool::newUtmProjection()
+{
+   // Make projection:
+   ossimRefPtr<ossimUtmProjection> utm = new ossimUtmProjection;
+
+   // Set the zone from keyword option:
+   bool setZone = false;
+   ossim_int32 zone = 0;
+   std::string value = m_kwl.findKey( std::string( ossimKeywordNames::ZONE_KW ) );
+   if ( value.size() )
+      zone = ossimString(value).toUInt32();
+   if ( (zone > 0 ) && ( zone < 61 ) )
+   {
+      utm->setZone( zone );
+      setZone = true;
+   }
+
+   // Set the hemisphere from keyword option:
+   bool setHemisphere = false;
+   ossimString h = m_kwl.findKey( std::string( ossimKeywordNames::HEMISPHERE_KW ) );
+   if ( h.size() )
+   {
+      h.upcase();
+      if ( ( h == "N" ) || ( h == "NORTH" ) || ( h == "S" ) || ( h == "SOUTH" ) )
+      {
+         utm->setHemisphere( h.string()[0] );
+         setHemisphere = true;
+      }
+   }
+
+   if ( !setZone || !setHemisphere )
+   {
+      // Check for user set "central_meridian" and "origin_latitude":
+      ossimGpt origin;
+      getProjectionOrigin(origin);
+      if ( !setZone )
+         utm->setZone(origin);
+      if ( !setHemisphere )
+         utm->setHemisphere(origin);
+   }
+
+   return ossimRefPtr<ossimMapProjection>(utm.get());
+}
+
+void ossimChipProcTool::initializeProjectionGsd()
+{
+   // The GSD computation may be a chicken-and-egg problem. Need to try different methods depending
+   // on information available in KWL including specified input images and DEMs.
+
+   ossimRefPtr<ossimMapProjection> mapProj =
+         dynamic_cast<ossimMapProjection*>(m_geom->getProjection());
+
+   ossimString lookup = m_kwl.findKey( GSD_KW );
+   if ( lookup.size() )
+      m_gsd.y = m_gsd.x = lookup.toFloat64();
+
+   if (m_gsd.hasNans() && m_projIsIdentity && m_geom.valid())
+         m_geom->getMetersPerPixel(m_gsd);
+
+   if (m_gsd.hasNans())
+   {
+      // No GSD specified, use minimum among all input images:
+      ossimGpt chainTiePoint;
+      std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx = m_imgLayers.begin();
+      while ( chainIdx != m_imgLayers.end() )
+      {
+         ossimRefPtr<ossimImageGeometry> geom =  (*chainIdx)->getImageGeometry();
+         if (geom.valid())
+         {
+            ossimDpt gsd;
+            geom->getMetersPerPixel(gsd);
+            gsd.y = gsd.x = gsd.mean();
+            if (m_gsd.hasNans() ||  ( m_gsd.x > gsd.x))
+               m_gsd = gsd;
+         }
+         ++chainIdx;
+      }
+   }
+
+   if (m_gsd.hasNans())
+   {
+      // Still no GSD established, try using minimum among all input DEMs (the operation possibly
+      // involves DEMs as inputs):
+      std::vector<ossimFilename>::iterator demFile = m_demSources.begin();
+      while ( demFile != m_demSources.end() )
+      {
+         ossimImageGeometry geom;
+         if (geom.open(*demFile))
+         {
+            ossimDpt gsd;
+            geom.getMetersPerPixel(gsd);
+            gsd.y = gsd.x = gsd.mean();
+            if (m_gsd.hasNans() ||  ( m_gsd.x > gsd.x))
+               m_gsd = gsd;
+         }
+         ++demFile;
+      }
+   }
+
+   if (m_gsd.hasNans())
+   {
+      // Still no GSD specified. As a last resort, use the elevation database nominal GSD at center
+      // as output GSD. This is valid since most operations without input images depend on DEM data.
+      // Requires that the center point be given in input spec:
+      ossimGpt centerGpt;
+      findCenterGpt(centerGpt);
+      if (!centerGpt.hasNans())
+      {
+         ossimElevManager::instance()->getHeightAboveEllipsoid(centerGpt);
+         m_gsd.y = m_gsd.x = ossimElevManager::instance()->getMeanSpacingMeters();
+         if (m_gsd.x == 0) // getMeanSpacing unfortunately return 0 for unknown GSD
+            m_gsd.makeNan();
+      }
+   }
+
+   if (!m_gsd.hasNans())
+      mapProj->setMetersPerPixel(m_gsd);
+}
+
+void ossimChipProcTool::initializeAOI()
+{
+   // Nan rect for starters.
+   m_aoiViewRect.makeNan();
+   m_aoiGroundRect.makeNan();
+   ossimString lookup;
+
+   // The AOI rect can be specified in different ways:
+   if ( m_kwl.hasKey( AOI_GEO_CENTER_KW.c_str() ) )
+   {
+      // A center point was given:
+      ossimGpt centerGpt;
+      findCenterGpt(centerGpt);
+
+      // A center point spec can be accompanied by a width/height (in meters or pixels):
+      ossimDpt sizeMeters;
+      sizeMeters.makeNan();
+      if (m_kwl.hasKey(AOI_SIZE_METERS_KW))
+      {
+         lookup = m_kwl.findKey( AOI_SIZE_METERS_KW );
+         lookup.trim();
+         sizeMeters.x = lookup.before(" ").toDouble();
+         sizeMeters.y = lookup.after(" ").toDouble();
+      }
+      else if (m_kwl.hasKey(AOI_SIZE_PIXELS_KW))
+      {
+         lookup = m_kwl.findKey( AOI_SIZE_PIXELS_KW );
+         lookup.trim();
+         ossimIpt imageSize (lookup.before(" ").toUInt32(), lookup.after(" ").toUInt32());
+         sizeMeters.x = imageSize.x*m_gsd.x;
+         sizeMeters.y = imageSize.y*m_gsd.y;
+      }
+      if (!sizeMeters.hasNans())
+      {
+         ossimDpt metersPerDegree (centerGpt.metersPerDegree());
+         double dlat = sizeMeters.y/metersPerDegree.y/2.0;
+         double dlon = sizeMeters.x/metersPerDegree.x/2.0;
+         ossimGpt ulgpt (centerGpt.lat + dlat, centerGpt.lon - dlon);
+         ossimGpt lrgpt (centerGpt.lat - dlat, centerGpt.lon + dlon);
+         m_aoiGroundRect = ossimGrect(ulgpt, lrgpt);
+         m_needCutRect = true;
+      }
+   }
+
+   else if ( m_kwl.hasKey( AOI_GEO_RECT_KW ) )
+   {
+      ossimString lookup = m_kwl.findKey(AOI_GEO_RECT_KW);
+      lookup.trim();
+      vector<ossimString> substrings = lookup.split(" ");
+      if (substrings.size() != 4)
+      {
+         ostringstream errMsg;
+         errMsg << "ossimChipProcUtil ["<<__LINE__<<"] Incorrect number of values specified for "
+               "aoi_geo_rect!";
+         throw( ossimException(errMsg.str()) );
+      }
+      ossim_float64 minLatF = substrings[0].toFloat64();
+      ossim_float64 minLonF = substrings[1].toFloat64();
+      ossim_float64 maxLatF = substrings[2].toFloat64();
+      ossim_float64 maxLonF = substrings[3].toFloat64();
+
+      // Check for swap so we don't get a negative height.
+      // Note no swap check for longitude as box could cross date line.
+      if ( minLatF > maxLatF )
+      {
+         ossim_float64 tmpF = minLatF;
+         minLatF = maxLatF;
+         maxLatF = tmpF;
+      }
+
+      // Assume cut box is edge to edge or "Pixel Is Area". Our
+      // AOI(area of interest) uses center of pixel or "Pixel Is Point"
+      // so get the degrees per pixel and shift AOI to center.
+      ossimGpt ulgpt (maxLatF, minLonF);
+      ossimGpt lrgpt (minLatF , maxLonF);
+      m_aoiGroundRect = ossimGrect(ulgpt, lrgpt);
+      m_needCutRect = true;
+   }
+
+   else if ( m_kwl.hasKey( AOI_MAP_RECT_KW ) )
+   {
+      ossimRefPtr<ossimMapProjection> mapProj =
+            dynamic_cast<ossimMapProjection*>(m_geom->getProjection());
+      if (mapProj.valid())
+      {
+         ossimString lookup = m_kwl.findKey(AOI_MAP_RECT_KW);
+         lookup.trim();
+         vector<ossimString> substrings = lookup.split(", ", true);
+         if (substrings.size() != 4)
+         {
+            ostringstream errMsg;
+            errMsg << "ossimChipProcUtil ["<<__LINE__<<"] Incorrect number of values specified for "
+                  "aoi_geo_rect!";
+            throw( ossimException(errMsg.str()) );
+         }
+         ossim_float64 minX = substrings[0].toFloat64();
+         ossim_float64 minY = substrings[1].toFloat64();
+         ossim_float64 maxX = substrings[2].toFloat64();
+         ossim_float64 maxY = substrings[3].toFloat64();
+
+         // Check for swap so we don't get a negative height.
+         // Note no swap check for longitude as box could cross date line.
+         if ( minX > maxX )
+         {
+            ossim_float64 tmpF = minX;
+            minX = maxX;
+            maxX = tmpF;
+         }
+         if ( minY > maxY )
+         {
+            ossim_float64 tmpF = minY;
+            minY = maxY;
+            maxY = tmpF;
+         }
+
+         ossimDpt ulMap (minX, maxY);
+         ossimDpt lrMap (maxX , minY);
+         ossimGpt ulGeo = mapProj->inverse(ulMap);
+         ossimGpt lrGeo = mapProj->inverse(lrMap);
+         m_aoiGroundRect = ossimGrect(ulGeo, lrGeo);
+         m_needCutRect = true;
+      }
+   }
+
+   // If no user defined rect set to scene bounding rect.
+   if ( m_aoiGroundRect.hasNans() )
+      setAoiToInputs();
+
+   // If AOI established, we can set projection TP and origin if applicable:
+   ossimRefPtr<ossimMapProjection> mapProj =
+         dynamic_cast<ossimMapProjection*>(m_geom->getProjection());
+   if (!m_aoiGroundRect.hasNans() && mapProj.valid())
+   {
+      // Geo-scaled projection needs to know the reference latitude:
+      if (m_geoScaled)
+      {
+         // The origin may have ben explicitely specified,or just use midpoint of AOI:
+         ossimGpt origin;
+         if (!getProjectionOrigin(origin))
+            origin = m_aoiGroundRect.midPoint();
+         mapProj->setOrigin(origin);
+         m_geom->getMetersPerPixel(m_gsd);
+      }
+
+      // Set the tie-point of the projection to the AOI's UL.
+      // Adjust it to be on an even pixel distance from projection origin if desired:
+      mapProj->setUlTiePoints(m_aoiGroundRect.ul());
+      bool snapToTP = false;
+      m_kwl.getBoolKeywordValue(snapToTP, SNAP_TIE_TO_ORIGIN_KW.c_str());
+      if ( snapToTP )
+         mapProj->snapTiePointToOrigin();
+
+      // Re-establish the AOI view rect based on updated projection:
+      computeAdjustedViewFromGrect();
+   }
+}
+
+bool ossimChipProcTool::getProjectionOrigin(ossimGpt& gpt)
+{
+   gpt = ossimGpt(0,0,0);
+   bool found_spec = false;
+   ossimString lookup = m_kwl.find(ossimKeywordNames::ORIGIN_LATITUDE_KW);
+   if ( lookup.size() )
+   {
+      gpt.lat = lookup.toFloat64();
+      if ( (gpt.lat < -90) || (gpt.lat > 90.0) )
+      {
+         std::string errMsg = "origin latitude range error! Valid range: -90 to 90";
+         throw ossimException(errMsg);
+      }
+      m_geoScaled = true;
+      found_spec = true;
+   }
+
+   lookup = m_kwl.find(ossimKeywordNames::CENTRAL_MERIDIAN_KW);
+   if ( lookup.size() )
+   {
+      gpt.lon = lookup.toFloat64();
+      if ( (gpt.lon < -180.0) || (gpt.lon > 180.0) )
+      {
+         std::string errMsg = "central meridian range error! Valid range: -180 to 180";
+         throw ossimException(errMsg);
+      }
+      found_spec = true;
+   }
+   return found_spec;
+}
+
+void ossimChipProcTool::findCenterGpt(ossimGpt& gpt)
+{
+   gpt.hgt = 0.0;
+   ossimString lookup = m_kwl.findKey( AOI_GEO_CENTER_KW );
+   if (lookup.size())
+   {
+      lookup.trim();
+      vector<ossimString> substrings = lookup.split(", ");
+      if (substrings.size() != 2)
+      {
+         ostringstream errMsg;
+         errMsg << "ossimChipProcUtil ["<<__LINE__<<"] Incorrect number of values specified for "
+               "aoi_geo_center!";
+         throw( ossimException(errMsg.str()) );
+      }
+      gpt.lat = substrings[0].toDouble();
+      gpt.lon = substrings[1].toDouble();
+      return;
+   }
+
+   lookup = m_kwl.findKey(AOI_GEO_RECT_KW);
+   if (lookup.size())
+   {
+      lookup.trim();
+      vector<ossimString> substrings = lookup.split(", ");
+      if (substrings.size() != 4)
+      {
+         ostringstream errMsg;
+         errMsg << "ossimChipProcUtil ["<<__LINE__<<"] Incorrect number of values specified for "
+               "aoi_geo_rect!";
+         throw( ossimException(errMsg.str()) );
+      }
+      ossim_float64 minLatF = substrings[0].toDouble();
+      ossim_float64 minLonF = substrings[1].toDouble();
+      ossim_float64 maxLatF = substrings[2].toDouble();
+      ossim_float64 maxLonF = substrings[3].toDouble();
+      gpt.lat = 0.5*(minLatF + maxLatF);
+      gpt.lon = 0.5*(minLonF + maxLonF);
+      return;
+   }
+   gpt.makeNan();
+}
+
+void ossimChipProcTool::setAoiToInputs()
+{
+   ossimRefPtr<ossimImageGeometry> geom;
+   ossimGrect bbox_i;
+   m_aoiGroundRect.makeNan();
+
+   //  Assign the AOI to be the bounding rect of the union of all inputs. Start with image inputs:
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chain = m_imgLayers.begin();
+   while (chain != m_imgLayers.end())
+   {
+      geom = (*chain)->getImageGeometry();
+      if (geom.valid())
+      {
+          geom->getBoundingGroundRect(bbox_i);
+          if (!bbox_i.hasNans())
+          {
+             if (m_aoiGroundRect.hasNans())
+                m_aoiGroundRect = bbox_i;
+             else
+                m_aoiGroundRect.expandToInclude(bbox_i);
+          }
+      }
+      ++chain;
+   }
+
+   // Now determine DEM inputs coverage:
+   ossimGrect bbox_dems;
+   bbox_dems.makeNan();
+   std::vector<ossimFilename>::iterator dem_file = m_demSources.begin();
+   while (dem_file != m_demSources.end())
+   {
+      ossimRefPtr<ossimImageGeometry> geom = new ossimImageGeometry;
+      if (!geom->open(*dem_file))
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "ossimHLZUtil::initialize ERR: Cannot open DEM file <" << *dem_file << "> "
+                  "as image handler. Ignoring entry for bounding box computation.\n" << std::endl;
+      }
+      geom->getBoundingGroundRect(bbox_i);
+      if (!bbox_i.hasNans())
+      {
+         if (bbox_dems.hasNans())
+            bbox_dems = bbox_i;
+         else
+            bbox_dems.expandToInclude(bbox_i);
+      }
+      ++dem_file;
+   }
+
+   // Finally compute the AOI as the intersection of the image and DEM inputs:
+   if (m_aoiGroundRect.hasNans())
+      m_aoiGroundRect = bbox_dems;
+   else if (!bbox_dems.hasNans())
+      m_aoiGroundRect = m_aoiGroundRect.clipToRect(bbox_dems);
+}
+
+void ossimChipProcTool::computeAdjustedViewFromGrect()
+{
+   // Nan rect for starters.
+   m_aoiViewRect.makeNan();
+   if (m_aoiGroundRect.hasNans())
+      return;
+
+   // Assume cut box is edge to edge or "Pixel Is Area". Our
+   // AOI(area of interest) uses center of pixel or "Pixel Is Point"
+   // so get the degrees per pixel and shift AOI to center.
+   ossimDpt halfDpp;
+   m_geom->getDegreesPerPixel( halfDpp );
+   halfDpp = halfDpp/2.0;
+
+   ossimGpt gpt(0.0, 0.0, 0.0);
+   ossimDpt ulPt;
+   ossimDpt lrPt;
+
+   // Upper left:
+   gpt.lat = m_aoiGroundRect.ul().lat - halfDpp.y;
+   gpt.lon = m_aoiGroundRect.ul().lon + halfDpp.x;
+   m_geom->worldToLocal(gpt, ulPt);
+
+   // Lower right:
+   gpt.lat = m_aoiGroundRect.lr().lat + halfDpp.y;
+   gpt.lon = m_aoiGroundRect.lr().lon - halfDpp.x;
+   m_geom->worldToLocal(gpt, lrPt);
+
+   m_aoiViewRect = ossimIrect( ossimIpt(ulPt), ossimIpt(lrPt) );
+
+   // If no user defined rect set to scene bounding rect.
+   if ( m_aoiViewRect.hasNans() )
+      m_aoiViewRect = m_procChain->getBoundingRect(0);
+}
+
+void ossimChipProcTool::propagateGeometryToChains()
+{
+   // we need to make sure the outputs are refreshed so they can reset themselves
+   // Needed when we are doing interactive update to the GSD and clip window
+   ossimRefPtr<ossimRefreshEvent> refreshEvent = new ossimRefreshEvent();
+   ossimEventVisitor eventVisitor(refreshEvent.get());
+   ossimViewInterfaceVisitor viewVisitor(m_geom.get());
+
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx = m_imgLayers.begin();
+   while ( chainIdx != m_imgLayers.end() )
+   {
+      viewVisitor.reset();
+      eventVisitor.reset();
+      (*chainIdx)->accept(viewVisitor);
+      (*chainIdx)->accept(eventVisitor);
+      ossimRefPtr<ossimImageRenderer> resampler = (*chainIdx)->getImageRenderer();
+      if (resampler.valid())
+      {
+         resampler->setView( m_geom.get() );
+         resampler->propagateEventToOutputs(*refreshEvent);
+      }
+      ++chainIdx;
+   }
+}
+
+void ossimChipProcTool::setReaderProps( ossimImageHandler* ih ) const
+{
+   if ( ih )
+   {
+      ossim_uint32 count = m_kwl.numberOf( READER_PROPERTY_KW.c_str() );
+      for (ossim_uint32 i = 0; i < count; ++i)
+      {
+         ossimString key = READER_PROPERTY_KW;
+         key += ossimString::toString(i);
+         ossimString value = m_kwl.findKey( key.string() );
+         if ( value.size() )
+         {
+            std::vector<ossimString> splitArray;
+            value.split(splitArray, "=");
+            if(splitArray.size() == 2)
+            {
+               ossimRefPtr<ossimProperty> prop =
+                     new ossimStringProperty(splitArray[0], splitArray[1]);
+
+               ih->setProperty( prop );
+            }
+         }
+      }
+   }
+}
+
+void ossimChipProcTool::getBandList(ossim_uint32 image_idx,
+                                    std::vector<ossim_uint32>& bandList ) const
+{
+   bandList.clear();
+   ostringstream key;
+   key <<  ossimKeywordNames::IMAGE_FILE_KW << image_idx << "." << ossimKeywordNames::BANDS_KW;
+   ossimString os = m_kwl.findKey(key.str());
+   if (os.empty())
+   {
+      // Look for possible global bands selection:
+      os = m_kwl.find(ossimKeywordNames::BANDS_KW);
+   }
+
+   if ( os.size() )
+   {
+      std::vector<ossimString> band_list(0);
+      os.split( band_list, ossimString(", "), false );
+      if ( band_list.size() )
+      {
+         std::vector<ossimString>::const_iterator i = band_list.begin();
+         while ( i != band_list.end() )
+         {
+            ossim_uint32 band = (*i).toUInt32();
+            if ( band ) // One based so we need to subtract.
+            {
+               bandList.push_back( band - 1 );
+            }
+            ++i;
+         }
+      }
+   }
+} // End: ossimChipProcUtil::getBandList
+
+ossimRefPtr<ossimImageSource> ossimChipProcTool::mosaicDemSources()
+{
+   ostringstream xmsg;
+   ossimRefPtr<ossimImageSource> demMosaic = 0;
+
+   if (m_demSources.empty())
+   {
+      // Establish connection to DEM posts directly as raster "images" versus using the OSSIM elev
+      // manager that performs interpolation of DEM posts for arbitrary locations. These elev images
+      // feed into a combiner in order to have a common tap for elev pixels:
+      ossimElevManager* elevMgr = ossimElevManager::instance();
+      elevMgr->getCellsForBounds(m_aoiGroundRect, m_demSources);
+   }
+
+   // Open a raster image for each elevation source being considered:
+   ossimConnectableObject::ConnectableObjectList elevChains;
+   vector<ossimFilename>::iterator fname_iter = m_demSources.begin();
+   while (fname_iter != m_demSources.end())
+   {
+      ossimRefPtr<ossimSingleImageChain> chain = createInputChain(*fname_iter).get();
+      if (!chain.valid() || !chain->getImageRenderer().valid() )
+      {
+         xmsg<<"ossimChipProcUtil:"<<__LINE__<<"  Cannot open DEM file at <"<<*fname_iter<<">";
+         throw(xmsg.str());
+      }
+
+      // Set up the input chain with proper renderer IVT:
+      ossimRefPtr<ossimImageViewProjectionTransform> ivt = new ossimImageViewProjectionTransform
+            (chain->getImageHandler()->getImageGeometry().get(), m_geom.get());
+      chain->getImageRenderer()->setImageViewTransform(ivt.get());
+      ossimRefPtr<ossimConnectableObject> connectable = chain.get();
+      elevChains.push_back(connectable);
+      ++fname_iter;
+   }
+
+   if (elevChains.size() == 1)
+      demMosaic = (ossimImageSource*) elevChains[0].get();
+   else
+      demMosaic = new ossimImageMosaic(elevChains);
+
+   return demMosaic;
+}
+
+
+ossimRefPtr<ossimImageSource>
+ossimChipProcTool::combineLayers(std::vector< ossimRefPtr<ossimSingleImageChain> >& layers) const
+{
+   ossimRefPtr<ossimImageSource> combiner = 0;
+   ossim_uint32 layerCount = (ossim_uint32) layers.size();
+   if ( layerCount  == 1 )
+   {
+      combiner = layers[0].get();
+   }
+   else if (layerCount  > 1)
+   {
+      combiner = new ossimImageMosaic;
+      std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx = layers.begin();
+      while ( chainIdx !=  layers.end() )
+      {
+         combiner->connectMyInputTo( (*chainIdx).get() );
+         ++chainIdx;
+      }
+   }
+   return combiner;
+}
+
+ossimRefPtr<ossimImageFileWriter> ossimChipProcTool::newWriter()
+{
+   ossimRefPtr<ossimImageFileWriter> writer = 0;
+
+   ossimString lookup = m_kwl.findKey( WRITER_KW );
+   if ( lookup.size() )
+   {
+      writer = ossimImageWriterFactoryRegistry::instance()->createWriter( lookup );
+      if ( !writer.valid() )
+      {
+         ostringstream errMsg;
+         errMsg << "ossimChipProcUtil ["<<__LINE__<<"] ERROR creating writer for <"<<lookup<<">"
+               <<ends;
+         throw ossimException(errMsg.str());
+      }
+   }
+   else // Create from output file extension.
+   {
+      writer = ossimImageWriterFactoryRegistry::instance()->
+            createWriterFromExtension( m_productFilename.ext() );
+
+      if ( !writer.valid() )
+      {
+         ostringstream errMsg;
+         errMsg << "ossimChipProcUtil ["<<__LINE__<<"] ERROR creating writer from extension <"
+               <<m_productFilename.ext()<<">"<<ends;
+         throw ossimException(errMsg.str());
+      }
+   }
+
+   // Set the output name.
+   writer->setFilename( m_productFilename );
+
+   // Add any writer props.
+   ossim_uint32 count = m_kwl.numberOf( WRITER_PROPERTY_KW.c_str() );
+   for (ossim_uint32 i = 0; i < count; ++i)
+   {
+      ossimString key = WRITER_PROPERTY_KW;
+      key += ossimString::toString(i);
+      lookup = m_kwl.findKey( key.string() );
+      if ( lookup.size() )
+      {
+         std::vector<ossimString> splitArray;
+         lookup.split(splitArray, "=");
+         if(splitArray.size() == 2)
+         {
+            ossimRefPtr<ossimProperty> prop =
+                  new ossimStringProperty(splitArray[0], splitArray[1]);
+
+            writer->setProperty( prop );
+         }
+      }
+   }
+
+   // Output tile size:
+   lookup = m_kwl.findKey( TILE_SIZE_KW );
+   if ( lookup.size() )
+   {
+      ossimIpt tileSize;
+      tileSize.x = lookup.toInt32();
+      if ( (tileSize.x % 16) == 0 )
+      {
+         tileSize.y = tileSize.x;
+         writer->setTileSize( tileSize );
+      }
+   }
+
+   return writer;
+}
+
+void ossimChipProcTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+
+   // Set app name.
+   std::string appName = ap.getApplicationName();
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+
+   // Base class has some:
+   ossimTool::setUsage(ap);
+
+   // Add options.
+   au->addCommandLineOption("--aoi-geo-bbox", "<min-lat> <min-lon> <max-lat> <max-lon>\nSpecify a comma-separated list for the lower-left and upper-right corners of the scene rect in decimal degrees.");
+   au->addCommandLineOption("--aoi-geo-center", "<lat> <lon>\nCenter of AOI in decimal degrees.");
+   au->addCommandLineOption("--aoi-map-bbox", "<min-x> <min-y> <max-x> <max-y>\nSpecify a space-separated list for the upper-left and lower-right corners of the scene rect in decimal degrees.");
+   au->addCommandLineOption("--aoi-map-center", "<x> <y>\nCenter of AOI in map coordinates.");
+   au->addCommandLineOption("--aoi-size-pixels", "<dx> <dy>,\nSize of AOI in output product pixels.");
+   au->addCommandLineOption("--aoi-size-meters", "<dx> <dy>,\nSize of AOI in meters.");
+   au->addCommandLineOption( "-b or --bands <n,n...>", "Use the specified bands in given order: e.g. \"3,2,1\" will select bands 3, 2 and 1 of the input image.\nNote: it is 1 based" );
+   au->addCommandLineOption("--central-meridian","<lon>\nNote if set this will be used for the central meridian of the projection.  This can be used to lock the utm zone.");
+   au->addCommandLineOption("--color-table | --lut","<color-table.kwl>\nKeyword list containing color table for color-relief option.");
+   au->addCommandLineOption("--deg-per-pixel","<dpp_xy> | <dpp_x> <dpp_y>\nSpecifies an override for degrees per pixel. Takes either a single value applied equally to x and y directions, or two values applied correspondingly to x then y. This option takes precedence over the \"--meters\" option.");
+   au->addCommandLineOption("--dem", "<file1>[,<file2>...]\n Input DEM file(s) (comma-separated) to process.");
+   au->addCommandLineOption("--dump-options","The current state of the utility (after the entire command line is parsed) is written to the file $PWD/<utility>.kwl, where <utility> is the name of the operation being performed. See \"--load-options\".");
+   au->addCommandLineOption("-e or --entry", "<entry> For multi image handlers which entry do you wish to extract. For list of entries use: \"ossim-info -i <your_image>\" ");
+   au->addCommandLineOption("--gsd", "<meters>\nSpecifies an override for the meters per pixel");
+   au->addCommandLineOption("-h or --help", "Display this help and exit.");
+   au->addCommandLineOption("--hemisphere", "<hemisphere>\nSpecify a projection hemisphere if supported. E.g. UTM projection. This will lock the hemisphere even if input scene center is the other hemisphere. Valid values for UTM are \"N\" and \"S\"");
+   au->addCommandLineOption("--image | -i", "<file1>[, <file2>...] Input image file(s) (comma-separated) to process.");
+   au->addCommandLineOption("--load-options","[<filename>]\nThe contents of <filename> (keyword-value pairs) are loaded as command options. The command-line options take precedence.  See \"--load-options\" and \"--write-template\" options.");
+   au->addCommandLineOption("--output-file | -o","<filename>\nThe product output file name. The format is dictated by the extension.");
+   au->addCommandLineOption("--origin-latitude","<latidude_in_decimal_degrees>\nNote if set this will be used for the origin latitude of the projection.  Setting this to something other than 0.0 with a geographic projection creates a scaled geographic projection.");
+   au->addCommandLineOption("--output-radiometry", "<R>\nSpecifies the desired product's pixel radiometry type. Possible values for <R> are: U8, U11, U16, S16, F32. Note this overrides the deprecated option \"scale-to-8-bit\".");
+   au->addCommandLineOption("--projection", "<output_projection> Valid projections: geo, geo-scaled, input or utm\ngeo = Equidistant Cylindrical, origin latitude = 0.0\ngeo-scaled = Equidistant Cylindrical, origin latitude = image center\ninput Use first images projection. Must be a map projecion.\nutm = Universal Tranverse Mercator\nIf input and multiple sources the projection of the first image will be used.\nIf utm the zone will be set from the scene center of first image.\nNOTE: --sr [...]
+   au->addCommandLineOption("--reader-prop", "<string>Adds a property to send to the reader. format is name=value");
+   au->addCommandLineOption("--scale-to-8-bit", "Scales the output to unsigned eight bits per band. This option has been deprecated by the newer \"--output-radiometry\" option.");
+   au->addCommandLineOption("--snap-tie-to-origin", "Snaps tie point to projection origin so that (tie-origin)/gsd come out on an even integer boundary.");
+   au->addCommandLineOption("--srs","<src_code>\nSpecify a spatial reference system(srs) code for the output projection. Example: --srs EPSG:4326");
+   au->addCommandLineOption("-t or --thumbnail", "<max_dimension>\nSpecify a thumbnail resolution.\nScale will be adjusted so the maximum dimension = argument given.");
+   au->addCommandLineOption("--tile-size", "<size_in_pixels>\nSets the output tile size if supported by writer.  Notes: This sets both dimensions. Must be a multiple of 16, e.g. 1024.");
+   au->addCommandLineOption("-w or --writer","<writer>\nSpecifies the output writer.  Default uses output file extension to determine writer. For valid output writer types use: \"ossim-info --writers\"\n");
+   au->addCommandLineOption("--writer-prop", "<writer-property>\nPasses a name=value pair to the writer for setting it's property. Any number of these can appear on the line.");
+   au->addCommandLineOption("--write-template", "<filename>\nWrites a keywrd list template to the filename specified.");
+   au->addCommandLineOption("--zone", "<zone>\nSpecify a projection zone if supported.  E.g. UTM projection. This will lock the zone even if input scene center is in another zone. Valid values for UTM are \"1\" to \"60\"");
+}
+
diff --git a/src/util/ossimChipperUtil.cpp b/src/util/ossimChipperUtil.cpp
new file mode 100644
index 0000000..344bb19
--- /dev/null
+++ b/src/util/ossimChipperUtil.cpp
@@ -0,0 +1,5646 @@
+//---
+//
+// File: ossimChipperUtil.cpp
+// 
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description: Utility class definition processing digital elevation
+// models(dems).
+//
+//---
+// $Id: ossimChipperUtil.cpp 23675 2015-12-22 18:16:28Z dburken $
+
+#include <ossim/util/ossimChipperUtil.h>
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGeoPolygon.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimRefreshEvent.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimVisitor.h>
+
+#include <ossim/imaging/ossimAnnotationFontObject.h>
+#include <ossim/imaging/ossimAnnotationLineObject.h>
+#include <ossim/imaging/ossimAnnotationSource.h>
+#include <ossim/imaging/ossimBrightnessContrastSource.h>
+#include <ossim/imaging/ossimBumpShadeTileSource.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimFusionCombiner.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimSFIMFusion.h>
+#include <ossim/imaging/ossimTwoColorView.h>
+#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
+#include <ossim/init/ossimInit.h>
+
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimUtmProjection.h>
+
+#include <ossim/support_data/ossimSrcRecord.h>
+
+#include <cmath>
+#include <sstream>
+#include <string>
+
+static ossimTrace traceDebug("ossimChipperUtil:debug");
+static ossimTrace traceLog("ossimChipperUtil:log");
+static ossimTrace traceOptions("ossimChipperUtil:options");
+
+static const std::string BRIGHTNESS_KW           = "brightness";
+static const std::string COLOR_BLUE_KW           = "color_blue";
+static const std::string COLOR_GREEN_KW          = "color_green";
+static const std::string COLOR_RED_KW            = "color_red";
+static const std::string CONTRAST_KW             = "contrast";
+static const std::string CLIP_WMS_BBOX_LL_KW     = "clip_wms_bbox_ll";
+static const std::string CLIP_POLY_LAT_LON_KW    = "clip_poly_lat_lon";
+static const std::string CUT_BBOX_XYWH_KW        = "cut_bbox_xywh";
+static const std::string CUT_WMS_BBOX_KW         = "cut_wms_bbox";
+static const std::string CUT_WMS_BBOX_LL_KW      = "cut_wms_bbox_ll";
+static const std::string CUT_CENTER_LAT_KW       = "cut_center_lat";
+static const std::string CUT_CENTER_LON_KW       = "cut_center_lon";
+static const std::string CUT_RADIUS_KW           = "cut_radius";  // meters
+static const std::string CUT_HEIGHT_KW           = "cut_height";  // pixels
+static const std::string CUT_MAX_LAT_KW          = "cut_max_lat";
+static const std::string CUT_MAX_LON_KW          = "cut_max_lon";
+static const std::string CUT_MIN_LAT_KW          = "cut_min_lat";
+static const std::string CUT_MIN_LON_KW          = "cut_min_lon";
+static const std::string CUT_WIDTH_KW            = "cut_width";   // pixels
+static const std::string DEM_KW                  = "dem";
+static const std::string GAIN_KW                 = "gain";
+static const std::string FILE_KW                 = "file";
+static const std::string HIST_AOI_KW             = "hist_aoi";
+static const std::string HIST_CENTER_KW          = "hist_center";
+static const std::string HIST_LLWH_KW            = "hist_llwh";
+static const std::string HIST_OP_KW              = "hist_op";
+static const std::string IMAGE_SPACE_SCALE_X_KW  = "image_space_scale_x";
+static const std::string IMAGE_SPACE_SCALE_Y_KW  = "image_space_scale_y";
+static const std::string IMG_KW                  = "image";
+static const std::string LUT_FILE_KW             = "lut_file";
+static const std::string DEGREES_X_KW            = "degrees_x";
+static const std::string DEGREES_Y_KW            = "degrees_y";
+static const std::string METERS_KW               = "meters";
+static const std::string NORTH_UP_KW             = "north_up"; // bool
+static const std::string OP_KW                   = "operation";
+static const std::string OUTPUT_RADIOMETRY_KW    = "output_radiometry";
+static const std::string PAD_THUMBNAIL_KW        = "pad_thumbnail"; // bool
+static const std::string READER_PROPERTY_KW      = "reader_property";
+static const std::string RESAMPLER_FILTER_KW     = "resampler_filter";
+static const std::string ROTATION_KW             = "rotation";
+static const std::string RRDS_KW                 = "rrds";
+static const std::string SCALE_2_8_BIT_KW        = "scale_2_8_bit";
+static const std::string SHARPEN_MODE_KW         = "sharpen_mode";
+static const std::string SNAP_TIE_TO_ORIGIN_KW   = "snap_tie_to_origin";
+static const std::string SRC_FILE_KW             = "src_file";
+static const std::string SRS_KW                  = "srs";
+static const std::string THREE_BAND_OUT_KW       = "three_band_out"; // bool
+static const std::string THUMBNAIL_RESOLUTION_KW = "thumbnail_resolution"; // pixels
+static const std::string TILE_SIZE_KW            = "tile_size"; // pixels
+static const std::string TRUE_KW                 = "true";
+static const std::string UP_IS_UP_KW             = "up_is_up"; // bool
+static const std::string WRITER_KW               = "writer";
+static const std::string WRITER_PROPERTY_KW      = "writer_property";
+static const std::string COMBINER_TYPE_KW        = "combiner_type";
+
+static const std::string TWOCMV_OLD_INPUT_BAND_KW      = "2cmv_old_input_band";
+static const std::string TWOCMV_NEW_INPUT_BAND_KW      = "2cmv_new_input_band";
+static const std::string TWOCMV_RED_OUTPUT_SOURCE_KW   = "2cmv_red_output_source";
+static const std::string TWOCMV_GREEN_OUTPUT_SOURCE_KW = "2cmv_green_output_source";
+static const std::string TWOCMV_BLUE_OUTPUT_SOURCE_KW  = "2cmv_blue_output_source";
+
+ossimChipperUtil::ossimChipperUtil()
+   : ossimReferenced(),
+     m_operation(OSSIM_CHIPPER_OP_UNKNOWN),
+     m_kwl(new ossimKeywordlist()),
+     m_srcKwl(0),
+     m_geom(0),
+     m_ivt(0),
+     m_demLayer(0),
+     m_imgLayer(0)
+{
+   // traceDebug.setTraceFlag(true);
+
+   m_kwl->setExpandEnvVarsFlag(true);
+}
+
+// Private/hidden from use.
+ossimChipperUtil::ossimChipperUtil( const ossimChipperUtil& /* obj */ )
+:  m_operation(OSSIM_CHIPPER_OP_UNKNOWN)
+{
+}
+
+// Private/hidden from use.
+const ossimChipperUtil& ossimChipperUtil::operator=( const ossimChipperUtil& /* rhs */)
+{
+   return *this;
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::createCombiner()const
+{
+   ossimRefPtr<ossimImageSource> result;
+   ossimString combinerType = m_kwl->find(COMBINER_TYPE_KW.c_str());
+   if(combinerType.empty())
+   {
+      combinerType = "ossimImageMosaic";
+   }
+
+   result = ossimImageSourceFactoryRegistry::instance()->createImageSource(combinerType);
+   if(!result.valid())
+   {
+      result = new ossimImageMosaic();
+   }
+
+   return result;
+}
+
+ossimChipperUtil::~ossimChipperUtil()
+{
+   clear();
+}
+
+void ossimChipperUtil::addArguments(ossimArgumentParser& ap)
+{
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [option]... [input-option]... <input-file(s)> <output-file>\nNote at least one input is required either from one of the input options, e.g. --input-dem <my-dem.hgt> or adding to command line in front of the output file in which case the code will try to ascertain what type of input it is.\n\nAvailable traces:\n-T \"ossimChipperUtil:debug\"   - General debug trace to standard out.\n-T \"ossimChipperUtil:log\"     - Writes a log file to output-file.log.\n-T \"ossimChipp [...]
+
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+
+   au->setCommandLineUsage(usageString);
+
+   au->setDescription(ap.getApplicationName()+" Utility application for generating elevation products from dem data.");
+
+   au->addCommandLineOption("--azimuth", "<azimuth>\nhillshade option - Light source azimuth angle for bump shade.\nRange: 0 to 360, Default = 180.0");
+
+   au->addCommandLineOption( "-b or --bands <n,n...>", "Use the specified bands in given order: e.g. \"3,2,1\" will select bands 3, 2 and 1 of the input image.\nNote: it is 1 based" );
+
+   au->addCommandLineOption( "--brightness", "<brightness>\nApply brightness to input image(s). Valid range: -1.0 to 1.0" );
+
+   au->addCommandLineOption("--central-meridian","<central_meridian_in_decimal_degrees>\nNote if set this will be used for the central meridian of the projection.  This can be used to lock the utm zone.");
+
+   au->addCommandLineOption("--color","<r> <g> <b>\nhillshade option - Set the red, green and blue color values to be used with hillshade.\nThis option can be used with or without an image source for color.\nRange 0 to 255, Defualt r=255, g=255, b=255");
+
+   au->addCommandLineOption("--color-table","<color-table.kwl>\nhillshade or color-relief option - Keyword list containing color table for color-relief option.");
+
+   au->addCommandLineOption( "--contrast", "<constrast>\nApply constrast to input image(s). Valid range: -1.0 to 1.0" );
+
+   au->addCommandLineOption("--cut-bbox-xywh", "<x>,<y>,<width>,<height>\nSpecify a comma separated bounding box.");
+
+   au->addCommandLineOption("--cut-wms-bbox", "<minx>,<miny>,<maxx>,<maxy>\nSpecify a comma separated list in the format of a WMS BBOX.\nThe units are in the units of the projector defined by the --srs key");
+
+   au->addCommandLineOption("--cut-wms-bbox-ll", "<minx>,<miny>,<maxx>,<maxy>\nSpecify a comma separated list in the format of a WMS BBOX.\nThe units are always decimal degrees");
+
+   au->addCommandLineOption("--cut-width", "<width>\nSpecify the cut width in pixel");
+
+   au->addCommandLineOption("--cut-height", "<height>\nSpecify the cut height in pixel");
+
+   au->addCommandLineOption("--clip-wms-bbox-ll", "<minx>,<miny>,<maxx>,<maxy>\nSpecify a comma separated list in the format of a WMS BBOX.\nThe units are always decimal degrees");
+
+   au->addCommandLineOption("--clip-poly-lat-lon", "Polygon in the form of a string: (lat,lon),(lat,lon),...(lat,lon)");
+
+   au->addCommandLineOption("--cut-bbox-ll", "<min_lat> <min_lon> <max_lat> <max_lon>\nSpecify a bounding box with the minimum latitude/longitude and max latitude/longitude in decimal degrees.\nNote coordinates are edge to edge.");
+
+   au->addCommandLineOption("--cut-bbox-llwh", "<min_lat> <min_lon> <max_lat> <max_lon> <width> <height>\nSpecify a bounding box with the minimum latitude/longitude, max latitude/longitude in decimal degrees and width/height in pixels.\nNote coordinates are edge to edge.");
+
+   au->addCommandLineOption("--cut-center-llwh","<latitude> <longitude> <width> <height>\nSpecify the center cut in latitude longitude space with width and height in pixels.");
+
+   au->addCommandLineOption("--cut-center-llr","<latitude> <longitude> <radius_in_meters>\nSpecify the center cut in latitude longitude space with radius in meters.");
+
+   au->addCommandLineOption("--degrees","<dpp_xy> | <dpp_x> <dpp_y>\nSpecifies an override for degrees per pixel. Takes either a single value applied equally to x and y directions, or two values applied correspondingly to x then y. This option takes precedence over the \"--meters\" option.");
+
+   au->addCommandLineOption("--elevation", "<elevation>\nhillshade option - Light source elevation angle for bumb shade.\nRange: 0 to 90, Default = 45.0");
+
+   au->addCommandLineOption("-e or --entry", "<entry> For multi image handlers which entry do you wish to extract. For list of entries use: \"ossim-info -i <your_image>\" ");
+
+   au->addCommandLineOption("--exaggeration", "<factor>\nMultiplier for elevation values when computing surface normals. Has the effect of lengthening shadows for oblique lighting.\nRange: .0001 to 50000, Default = 1.0");
+
+   au->addCommandLineOption("-h or --help", "Display this help and exit.");
+
+   au->addCommandLineOption("--hemisphere", "<hemisphere>\nSpecify a projection hemisphere if supported. E.g. UTM projection. This will lock the hemisphere even if input scene center is the other hemisphere. Valid values for UTM are \"N\" and \"S\"");
+
+   au->addCommandLineOption("--histogram-aoi", "<x>,<y>,<width>,<height>\nSets single image region of interest(roi) to compute histogram from. Coordinates are zero based image space.  Single image operation only. Comma separated, no spaces.");
+
+   au->addCommandLineOption("--histogram-center-tile", "Will compute histogram from center tile of image.");
+
+   au->addCommandLineOption("--histogram-llwh", "<latitude>,<longitude>,<width>,<height>\nSpecify the region of interest(roi) to compute histogram from. Latitude and longitude will be roi center space with width and height in pixels. Comma separated, no spaces.");
+
+   au->addCommandLineOption("--histogram-op", "<operation>\nHistogram operation to perform. Valid operations are \"auto-minmax\", \"auto-percentile\", \"std-stretch-1\", \"std-stretch-2\" and \"std-stretch-3\".");
+
+   au->addCommandLineOption("--image-space-scale","<x> <y>\nSpecifies an image space scale for x and y direction. \"chip\" operation only.");
+
+   au->addCommandLineOption("--input-dem", "<dem> Input dem to process.");
+
+   au->addCommandLineOption("--input-img", "<image> Input image to process.");
+
+   au->addCommandLineOption("--input-src","<file.src> Input source file list keyword list with list of dems or images or both to process.");
+
+   au->addCommandLineOption("--meters", "<meters>\nSpecifies an override for the meters per pixel");
+
+   au->addCommandLineOption("-n or --north-up", "Rotates image North up. \"chip\" operation only.");
+
+   au->addCommandLineOption( "--op", "<operation>\nOperation to perform. Valid operations are \"chip\", \"color-relief\", \"hillshade\", \"psm\"(pan sharpened multispectral), \"2cmv\"(two color multi view) and \"ortho\".\nchip = input projection = output projection(image space), single image operation only." );
+
+   au->addCommandLineOption("--options","<options.kwl>  This can be all or part of the application options.  To get a template you can turn on trace to the ossimChipperUtil class by adding \"-T ossimChipperUtil\" to your command.");
+
+   au->addCommandLineOption("--origin-latitude","<latidude_in_decimal_degrees>\nNote if set this will be used for the origin latitude of the projection.  Setting this to something other than 0.0 with a geographic projection creates a scaled geographic projection.");
+
+   au->addCommandLineOption("--output-radiometry", "<R>\nSpecifies the desired product's pixel radiometry type. Possible values for <R> are: U8, U11, U16, S16, F32. Note this overrides the deprecated option \"scale-to-8-bit\".");
+
+   au->addCommandLineOption("--pad-thumbnail", "<boolean>\nIf true, output thumbnail dimensions will be padded in width or height to make square; else, it will have the aspect ratio of input,  Default=false");
+
+   au->addCommandLineOption("--projection", "<output_projection> Valid projections: geo, geo-scaled, input or utm\ngeo = Equidistant Cylindrical, origin latitude = 0.0\ngeo-scaled = Equidistant Cylindrical, origin latitude = image center\ninput Use first images projection. Must be a map projecion.\nutm = Universal Tranverse Mercator\nIf input and multiple sources the projection of the first image will be used.\nIf utm the zone will be set from the scene center of first image.\nNOTE: --sr [...]
+
+   au->addCommandLineOption("--resample-filter","<type>\nSpecify what resampler filter to use, e.g. nearest neighbor, bilinear, cubic, sinc.\nSee ossim-info --resampler-filters");
+
+   au->addCommandLineOption("-r or --rotate", "<degrees>\nRotate image by degrees. \"chip\" operation only.");
+
+   au->addCommandLineOption("--reader-prop", "<string>Adds a property to send to the reader. format is name=value");
+
+   au->addCommandLineOption("--rrds", "<rrds> Reduced resolution data set where 0 is full resolution. \"chip\" operation only.");
+
+   au->addCommandLineOption("--scale-to-8-bit", "Scales the output to unsigned eight bits per band. This option has been deprecated by the newer \"--output-radiometry\" option.");
+
+   au->addCommandLineOption("--sharpen-mode", "<mode> Applies sharpness to image chain(s). Valid modes: \"light\", \"heavy\"");
+
+   au->addCommandLineOption("--snap-tie-to-origin",
+                                "Snaps tie point to projection origin so that (tie-origin)/gsd come out on an even integer boundary.");
+
+   au->addCommandLineOption("--srs","<src_code>\nSpecify a spatial reference system(srs) code for the output projection. Example: --srs EPSG:4326");
+
+   au->addCommandLineOption("-t or --thumbnail", "<max_dimension>\nSpecify a thumbnail resolution.\nScale will be adjusted so the maximum dimension = argument given.");
+
+   au->addCommandLineOption("--three-band-out", "Force three band output even if input is not. Attempts to map bands to RGB if possible.");
+
+   au->addCommandLineOption("--tile-size", "<size_in_pixels>\nSets the output tile size if supported by writer.  Notes: This sets both dimensions. Must be a multiple of 16, e.g. 1024.");
+
+   au->addCommandLineOption("-u or --up-is-up", "Rotates image to up is up. \"chip\" operation only.");
+
+   au->addCommandLineOption("-w or --writer","<writer>\nSpecifies the output writer.  Default uses output file extension to determine writer. For valid output writer types use: \"ossim-info --writers\"\n");
+
+   au->addCommandLineOption("--writer-prop", "<writer-property>\nPasses a name=value pair to the writer for setting it's property. Any number of these can appear on the line.");
+
+   au->addCommandLineOption("--zone", "<zone>\nSpecify a projection zone if supported.  E.g. UTM projection. This will lock the zone even if input scene center is in another zone. Valid values for UTM are \"1\" to \"60\"");
+
+   au->addCommandLineOption("--2cmv-old-input-band", "<band>\nBand to use for two color multi view old input.\n");
+   au->addCommandLineOption("--2cmv-new-input-band", "<band>\nBand to use for two color multi view new input.\n");
+
+   au->addCommandLineOption("--2cmv-red-output-source", "<source>\nTwo color multi view source input for red output.  Either, old, new, or mp(min pix).  Default=old.\n");
+
+   au->addCommandLineOption("--2cmv-green-output-source", "<source>\nTwo color multi view source input for green output.  Either, old, new, or mp(min pix).  Default=new.\n");
+
+   au->addCommandLineOption("--2cmv-blue-output-source", "<source>\nTwo color multi view source input for blue output.  Either, old, new, or mp(min pix).  Default=new.\n");
+   au->addCommandLineOption("--combiner-type", "<type>\nossimBlendMosaic, ossimFeatherMosaic, ossimImageMosaic.  Default: ossimImageMosaic.  Example --combiner-type ossimImageMosaic\n");
+
+} // End: ossimChipperUtil::addArguments
+
+void ossimChipperUtil::clear()
+{
+      // Must disonnect chains so that they destroy.
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator i = m_imgLayer.begin();
+   while ( i != m_imgLayer.end() )
+   {
+      (*i)->disconnect();
+      (*i) = 0;
+      ++i;
+   }
+   m_imgLayer.clear();
+
+   i = m_demLayer.begin();
+   while ( i != m_demLayer.end() )
+   {
+      (*i)->disconnect();
+      (*i) = 0;
+      ++i;
+   }
+   m_demLayer.clear();
+
+   if(m_writer.valid())
+   {
+      m_writer->disconnect();
+      m_writer = 0;
+   }
+}
+
+bool ossimChipperUtil::initialize(ossimArgumentParser& ap)
+{
+   static const char MODULE[] = "ossimChipperUtil::initialize(ossimArgumentParser&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   clear();
+   if( ap.read("-h") || ap.read("--help") || (ap.argc() == 1) )
+   {
+      usage(ap);
+
+      return false; // Indicates process should be terminated to caller.
+   }
+
+   // Start with clean options keyword list.
+   m_kwl->clear();
+
+   std::string tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+   std::string tempString2;
+   ossimArgumentParser::ossimParameter stringParam2(tempString2);
+   std::string tempString3;
+   ossimArgumentParser::ossimParameter stringParam3(tempString3);
+   std::string tempString4;
+   ossimArgumentParser::ossimParameter stringParam4(tempString4);
+   std::string tempString5;
+   ossimArgumentParser::ossimParameter stringParam5(tempString5);
+   std::string tempString6;
+   ossimArgumentParser::ossimParameter stringParam6(tempString6);
+   double tempDouble1;
+   ossimArgumentParser::ossimParameter doubleParam1(tempDouble1);
+   double tempDouble2;
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+
+   ossim_uint32 demIdx        = 0;
+   ossim_uint32 imgIdx        = 0;
+   ossim_uint32 readerPropIdx = 0;
+   ossim_uint32 writerPropIdx = 0;
+   ossimString  key           = "";
+
+   // Extract optional arguments and stuff them in a keyword list.
+   if( ap.read("--azimuth", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::AZIMUTH_ANGLE_KW), tempString1 );
+   }
+
+   if (ap.read("-b", stringParam1) || ap.read("--bands", stringParam1))
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::BANDS_KW), tempString1 );
+   }
+
+   if( ap.read("--brightness", stringParam1) )
+   {
+      m_kwl->addPair( BRIGHTNESS_KW, tempString1 );
+   }
+
+   if( ap.read("--central-meridian", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::CENTRAL_MERIDIAN_KW), tempString1 );
+   }
+
+   if( ap.read("--color", stringParam1, stringParam2, stringParam3) )
+   {
+      m_kwl->addPair( COLOR_RED_KW,   tempString1 );
+      m_kwl->addPair( COLOR_GREEN_KW, tempString2 );
+      m_kwl->addPair( COLOR_BLUE_KW,  tempString3 );
+   }
+
+   if( ap.read("--color-table", stringParam1) )
+   {
+      m_kwl->addPair( LUT_FILE_KW, tempString1 );
+   }
+
+   if( ap.read("--contrast", stringParam1) )
+   {
+      m_kwl->addPair( CONTRAST_KW, tempString1 );
+   }
+
+   if( ap.read("--cut-width", stringParam1) )
+   {
+      m_kwl->addPair( CUT_WIDTH_KW,   tempString1 );
+   }
+   if( ap.read("--cut-height", stringParam1) )
+   {
+      m_kwl->addPair( CUT_HEIGHT_KW,  tempString1 );
+   }
+   if( ap.read("--cut-bbox-xywh", stringParam1) )
+   {
+      m_kwl->addPair(CUT_BBOX_XYWH_KW, tempString1);
+   }
+   if( ap.read("--cut-wms-bbox", stringParam1) )
+   {
+      m_kwl->addPair(CUT_WMS_BBOX_KW, tempString1);
+   }
+   if( ap.read("--cut-wms-bbox-ll", stringParam1) )
+   {
+      m_kwl->addPair(CUT_WMS_BBOX_LL_KW, tempString1);
+   }
+
+   if( ap.read("--clip-wms-bbox-ll", stringParam1) )
+   {
+      m_kwl->addPair(CLIP_WMS_BBOX_LL_KW, tempString1);
+   }
+
+   if( ap.read("--clip-poly-lat-lon", stringParam1) )
+   {
+      //std::vector<ossimGpt> result;
+      //ossim::toVector(result, ossimString(tempString1));
+      //std::cout << result[0] << std::endl;
+      //std::cout <<tempString1<<std::endl;
+      //exit(0);
+      m_kwl->addPair(CLIP_POLY_LAT_LON_KW, tempString1);
+   }
+
+   if( ap.read("--cut-bbox-ll", stringParam1, stringParam2, stringParam3, stringParam4) )
+   {
+      m_kwl->addPair( CUT_MIN_LAT_KW, tempString1 );
+      m_kwl->addPair( CUT_MIN_LON_KW, tempString2 );
+      m_kwl->addPair( CUT_MAX_LAT_KW, tempString3 );
+      m_kwl->addPair( CUT_MAX_LON_KW, tempString4 );
+   }
+
+   if( ap.read("--cut-bbox-llwh", stringParam1, stringParam2, stringParam3,
+               stringParam4, stringParam5, stringParam6) )
+   {
+      m_kwl->addPair( CUT_MIN_LAT_KW, tempString1 );
+      m_kwl->addPair( CUT_MIN_LON_KW, tempString2 );
+      m_kwl->addPair( CUT_MAX_LAT_KW, tempString3 );
+      m_kwl->addPair( CUT_MAX_LON_KW, tempString4 );
+      m_kwl->addPair( CUT_WIDTH_KW,   tempString5 );
+      m_kwl->addPair( CUT_HEIGHT_KW,  tempString6 );
+   }
+
+   if( ap.read("--cut-center-llwh", stringParam1, stringParam2, stringParam3, stringParam4) )
+   {
+      m_kwl->addPair( CUT_CENTER_LAT_KW, tempString1 );
+      m_kwl->addPair( CUT_CENTER_LON_KW, tempString2 );
+      m_kwl->addPair( CUT_WIDTH_KW,      tempString3 );
+      m_kwl->addPair( CUT_HEIGHT_KW,     tempString4 );
+   }
+
+   if( ap.read("--cut-center-llr", stringParam1, stringParam2, stringParam3) )
+   {
+      m_kwl->addPair( CUT_CENTER_LAT_KW, tempString1 );
+      m_kwl->addPair( CUT_CENTER_LON_KW, tempString2 );
+      m_kwl->addPair( CUT_RADIUS_KW,     tempString3 );
+   }
+
+   int num_params = ap.numberOfParams("--degrees", doubleParam1);
+   if (num_params == 1)
+   {
+      ap.read("--degrees", doubleParam1);
+      m_kwl->add( DEGREES_X_KW.c_str(), tempDouble1 );
+      m_kwl->add( DEGREES_Y_KW.c_str(), tempDouble1 );
+   }
+   else if (num_params == 2)
+   {
+      ap.read("--degrees", doubleParam1, doubleParam2);
+      m_kwl->add( DEGREES_X_KW.c_str(), tempDouble1 );
+      m_kwl->add( DEGREES_Y_KW.c_str(), tempDouble2 );
+   }
+
+   if ( ap.read("--elevation", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::ELEVATION_ANGLE_KW), tempString1 );
+   }
+
+   if ( ap.read("-e", stringParam1) || ap.read("--entry", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::ENTRY_KW), tempString1 );
+   }
+
+   if ( ap.read("--exaggeration", stringParam1) )
+   {
+      m_kwl->addPair( GAIN_KW, tempString1 );
+   }
+
+   if ( ap.read("--hemisphere", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::HEMISPHERE_KW), tempString1 );
+   }
+
+   if ( ap.read("--histogram-aoi", stringParam1) )
+   {
+      m_kwl->addPair( HIST_AOI_KW, tempString1 );
+   }
+
+   if ( ap.read( "--histogram-center-tile" ) )
+   {
+      m_kwl->addPair( HIST_CENTER_KW, TRUE_KW );
+   }
+
+   if ( ap.read("--histogram-llwh", stringParam1) )
+   {
+      m_kwl->addPair( HIST_LLWH_KW, tempString1 );
+   }
+
+   if ( ap.read("--histogram-op", stringParam1) )
+   {
+      m_kwl->addPair( HIST_OP_KW, tempString1 );
+   }
+
+   if ( ap.read("--image-space-scale", doubleParam1, doubleParam2) )
+   {
+      m_kwl->add( IMAGE_SPACE_SCALE_X_KW.c_str(), tempDouble1 );
+      m_kwl->add( IMAGE_SPACE_SCALE_Y_KW.c_str(), tempDouble2 );
+   }
+
+   while( ap.read("--input-dem", stringParam1) )
+   {
+      key = DEM_KW;
+      key += ossimString::toString(demIdx);
+      key += ".";
+      key += FILE_KW;
+      m_kwl->addPair( key.string(), tempString1 );
+      ++demIdx;
+   }
+
+   while( ap.read("--input-img", stringParam1) )
+   {
+      key = IMG_KW;
+      key += ossimString::toString(imgIdx);
+      key += ".";
+      key += FILE_KW;
+      m_kwl->addPair(key.string(), tempString1 );
+      ++imgIdx;
+   }
+
+   if( ap.read("--input-src", stringParam1) )
+   {
+      m_kwl->addPair( SRC_FILE_KW, tempString1 );
+   }
+
+   if( ap.read("--meters", stringParam1) )
+   {
+      m_kwl->addPair( METERS_KW, tempString1 );
+   }
+
+   if ( ap.read("-n") || ap.read("--north-up") )
+   {
+      m_kwl->addPair( NORTH_UP_KW, TRUE_KW);
+   }
+
+   if( ap.read("--op", stringParam1) )
+   {
+      m_kwl->addPair( OP_KW, tempString1 );
+   }
+
+   //---
+   // Deprecated: "--options-keyword-list"
+   //---
+   if( ap.read("--options", stringParam1) )
+   {
+      ossimFilename optionsKwl = tempString1;
+      if ( optionsKwl.exists() )
+      {
+         if ( m_kwl->addFile(optionsKwl) == false )
+         {
+            std::string errMsg = "ERROR could not open options keyword list file: ";
+            errMsg += optionsKwl.string();
+            throw ossimException(errMsg);
+         }
+      }
+      else
+      {
+         std::string errMsg = "ERROR options keyword list file does not exists: ";
+         errMsg += optionsKwl.string();
+         throw ossimException(errMsg);
+      }
+   }
+
+   if( ap.read("--origin-latitude", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::ORIGIN_LATITUDE_KW), tempString1 );
+   }
+
+   if(ap.read("--output-radiometry", stringParam1))
+   {
+      m_kwl->addPair( OUTPUT_RADIOMETRY_KW, tempString1 );
+   }
+
+   if ( ap.read("--pad-thumbnail", stringParam1) )
+   {
+      m_kwl->addPair( PAD_THUMBNAIL_KW, tempString1 );
+   }
+
+   if( ap.read("--projection", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::PROJECTION_KW), tempString1 );
+   }
+
+   if( ap.read("--resample-filter", stringParam1) )
+   {
+      m_kwl->addPair( RESAMPLER_FILTER_KW, tempString1 );
+   }
+
+   if ( ap.read("-r", stringParam1) || ap.read("--rotate", stringParam1) )
+   {
+      m_kwl->addPair( ROTATION_KW, tempString1 );
+   }
+
+   while (ap.read("--reader-prop", stringParam1))
+   {
+      key = READER_PROPERTY_KW;
+      key += ossimString::toString(readerPropIdx);
+      m_kwl->addPair(key.string(), tempString1 );
+      ++readerPropIdx;
+   }
+
+   if ( ap.read("--rrds", stringParam1) )
+   {
+      m_kwl->addPair( RRDS_KW, tempString1);
+   }
+
+   if ( ap.read("--scale-to-8-bit") )
+   {
+      m_kwl->addPair( SCALE_2_8_BIT_KW, TRUE_KW);
+   }
+
+   if ( ap.read("--sharpen-mode", stringParam1) )
+   {
+      m_kwl->addPair( SHARPEN_MODE_KW, tempString1 );
+   }
+
+   if ( ap.read("--snap-tie-to-origin") )
+   {
+      m_kwl->addPair( SNAP_TIE_TO_ORIGIN_KW, TRUE_KW);
+   }
+
+   if( ap.read("--srs", stringParam1) )
+   {
+      ossimString os = tempString1;
+      if ( os.contains("EPSG:") )
+      {
+         os.gsub( ossimString("EPSG:"), ossimString("") );
+      }
+      m_kwl->addPair( SRS_KW, os.string() );
+   }
+
+   if( ap.read("-t", stringParam1) || ap.read("--thumbnail", stringParam1) )
+   {
+      m_kwl->addPair( THUMBNAIL_RESOLUTION_KW, tempString1 );
+   }
+
+   if ( ap.read("--three-band-out") )
+   {
+      m_kwl->addPair( THREE_BAND_OUT_KW, TRUE_KW);
+   }
+
+   if( ap.read("--tile-size", stringParam1) )
+   {
+      m_kwl->addPair( TILE_SIZE_KW, tempString1 );
+   }
+
+   if ( ap.read("-u") || ap.read("--up-is-up") )
+   {
+      m_kwl->addPair( UP_IS_UP_KW, TRUE_KW);
+   }
+
+   if( ap.read("-w", stringParam1) || ap.read("--writer", stringParam1) )
+   {
+      m_kwl->addPair( WRITER_KW, tempString1);
+   }
+
+   while (ap.read("--writer-prop", stringParam1))
+   {
+      key = WRITER_PROPERTY_KW;
+      key += ossimString::toString(writerPropIdx);
+      m_kwl->addPair(key.string(), tempString1 );
+      ++writerPropIdx;
+   }
+
+   if( ap.read("--zone", stringParam1) )
+   {
+      m_kwl->addPair( std::string(ossimKeywordNames::ZONE_KW), tempString1);
+   }
+
+   if( ap.read("--2cmv-old-input-band", stringParam1) )
+   {
+      m_kwl->addPair( TWOCMV_OLD_INPUT_BAND_KW, tempString1 );
+   }
+
+   if( ap.read("--2cmv-new-input-band", stringParam1) )
+   {
+      m_kwl->addPair( TWOCMV_NEW_INPUT_BAND_KW, tempString1 );
+   }
+   if( ap.read("--2cmv-red-output-source", stringParam1) )
+   {
+      m_kwl->addPair( TWOCMV_RED_OUTPUT_SOURCE_KW, tempString1 );
+   }
+
+   if( ap.read("--2cmv-green-output-source", stringParam1) )
+   {
+      m_kwl->addPair( TWOCMV_GREEN_OUTPUT_SOURCE_KW, tempString1 );
+   }
+
+   if( ap.read("--2cmv-blue-output-source", stringParam1) )
+   {
+      m_kwl->addPair( TWOCMV_BLUE_OUTPUT_SOURCE_KW, tempString1 );
+   }
+   if(ap.read("--combiner-type", stringParam1))
+   {
+      m_kwl->addPair(COMBINER_TYPE_KW, tempString1);
+   }
+   // End of arg parsing.
+   ap.reportRemainingOptionsAsUnrecognized();
+   if ( ap.errors() )
+   {
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      std::string errMsg = "Unknown option...";
+      throw ossimException(errMsg);
+   }
+
+   if ( ap.argc() >= 2 )
+   {
+      // Output file is last arg:
+      m_kwl->add( ossimKeywordNames::OUTPUT_FILE_KW, ap[ap.argc()-1]);
+   }
+   else
+   {
+      if ( !m_kwl->find(ossimKeywordNames::OUTPUT_FILE_KW) )
+      {
+         ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+         std::string errMsg = "Must supply an output file.";
+         throw ossimException(errMsg);
+      }
+   }
+
+   if ( ap.argc() > 2 ) // User passed inputs in front of output file.
+   {
+      int pos = 1; // ap.argv[0] is application name.
+      while ( pos < (ap.argc()-1) )
+      {
+         ossimFilename file = ap[pos];
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "argv[" << pos << "]: " << file << "\n";
+         }
+
+         if ( isDemFile(file) )
+         {
+            key = DEM_KW;
+            key += ossimString::toString(demIdx);
+            key += ".";
+            key += FILE_KW;
+            m_kwl->addPair( key, file.string() );
+            ++demIdx;
+         }
+         else if ( isSrcFile(file) )
+         {
+            if ( m_kwl->find( SRC_FILE_KW.c_str() ) ) // --input-src used also
+            {
+               std::string errMsg = MODULE;
+               errMsg += "ERROR Multiple src files passed in.  Please combine into one.";
+               throw ossimException(errMsg);
+            }
+
+            m_kwl->addPair( SRC_FILE_KW, file.string() );
+         }
+         else // Add as an input image.
+         {
+            key = IMG_KW;
+            key += ossimString::toString(imgIdx);
+            key += ".";
+            key += FILE_KW;
+            m_kwl->addPair(key.string(), file.string() );
+            ++imgIdx;
+         }
+
+         ++pos; // Go to next arg...
+
+      } // End: while ( pos < (ap.argc()-1) )
+
+   } // End: if ( ap.argc() > 2 )
+
+   initialize();
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited..." << std::endl;
+   }
+   return true;
+
+} // End: void ossimChipperUtil::initialize(ossimArgumentParser& ap)
+
+void ossimChipperUtil::initialize( const ossimKeywordlist& kwl )
+{
+   clear();
+
+   // Start with clean options keyword list.
+   m_kwl->clear();
+
+   m_kwl->addList( kwl, true );
+
+   initialize();
+}
+
+void ossimChipperUtil::initialize()
+{
+   static const char MODULE[] = "ossimChipperUtil::initialize()";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   if ( traceOptions() )
+   {
+      ossimFilename optionsFile;
+      getOutputFilename(optionsFile);
+      optionsFile = optionsFile.noExtension();
+      optionsFile += "-options.kwl";
+      ossimString comment = " Can be use for --options argument.";
+      m_kwl->write( optionsFile.c_str(), comment.c_str() );
+   }
+
+   // Determine the operation to do.
+   std::string op = m_kwl->findKey( OP_KW );
+   if ( op.size() )
+   {
+      ossimString s = op;
+      s.downcase();
+
+      if ( s == "chip" )
+      {
+         m_operation = OSSIM_CHIPPER_OP_CHIP;
+      }
+      else if ( s == "hillshade" )
+      {
+         m_operation = OSSIM_CHIPPER_OP_HILL_SHADE;
+      }
+
+      else if ( s == "color-relief" )
+      {
+         m_operation = OSSIM_CHIPPER_OP_COLOR_RELIEF;
+      }
+      else if ( s == "ortho" )
+      {
+         m_operation = OSSIM_CHIPPER_OP_ORTHO;
+      }
+      else if ( s == "psm" )
+      {
+         m_operation = OSSIM_CHIPPER_OP_PSM;
+      }
+      else if ( s == "2cmv" )
+      {
+         m_operation = OSSIM_CHIPPER_OP_2CMV;
+      }
+      else
+      {
+         std::string errMsg = "unknown operation: ";
+         errMsg += s.string();
+         throw ossimException(errMsg);
+      }
+   }
+   else
+   {
+      std::string errMsg = "keyword not found: ";
+      errMsg += OP_KW;
+      errMsg += "\nUse --op option to specify operation.\n";
+      throw ossimException(errMsg);
+   }
+
+   //---
+   // Populate the m_srcKwl if --src option was set.
+   // Note do this before creating chains.
+   //---
+   initializeSrcKwl();
+
+   // Check for required inputs. Do this after initializeSrcKwl.
+   if ( m_operation == OSSIM_CHIPPER_OP_CHIP )
+   {
+      if ( getNumberOfInputs() != 1 )
+      {
+         std::ostringstream errMsg;
+         errMsg << op << " operation takes one input.";
+         throw ossimException( errMsg.str() );
+      }
+   }
+
+   if ( ( m_operation == OSSIM_CHIPPER_OP_2CMV ) || ( m_operation == OSSIM_CHIPPER_OP_PSM ) )
+   {
+      if ( getNumberOfInputs() != 2 )
+      {
+         std::ostringstream errMsg;
+         errMsg << op << " operation requires two inputs.";
+         throw ossimException( errMsg.str() );
+      }
+   }
+
+   // Sanity check rotation options.
+   if ( upIsUp() || northUp() || hasRotation() )
+   {
+      std::string option;
+      ossim_uint32 rotationOptionCount = 0;
+      if ( upIsUp() )
+      {
+         option = UP_IS_UP_KW;
+         ++rotationOptionCount;
+      }
+      if ( northUp() )
+      {
+         option = NORTH_UP_KW;
+         ++rotationOptionCount;
+      }
+      if ( hasRotation() )
+      {
+         option = ROTATION_KW;
+         ++rotationOptionCount;
+      }
+
+      // Can only do ONE rotation option.
+      if ( rotationOptionCount > 1 )
+      {
+         std::ostringstream errMsg;
+         if ( upIsUp() )
+         {
+            errMsg << UP_IS_UP_KW << " is on.\n";
+         }
+         if ( northUp() )
+         {
+            errMsg << NORTH_UP_KW << " is on.\n";
+         }
+         if ( hasRotation() )
+         {
+            errMsg << ROTATION_KW << " is on.\n";
+         }
+         errMsg << "Multiple rotation options do not make sense!";
+         throw ossimException( errMsg.str() );
+      }
+
+      // One input, chip operation only.
+      if ( getNumberOfInputs() != 1 )
+      {
+         std::ostringstream errMsg;
+         errMsg << option << " option takes one input.";
+         throw ossimException( errMsg.str() );
+      }
+
+      if ( m_operation != OSSIM_CHIPPER_OP_CHIP )
+      {
+         std::ostringstream errMsg;
+         errMsg << option << " option only valid with \"chip\" operation.";
+         throw ossimException( errMsg.str() );
+      }
+   }
+
+   // Create chains for any dem sources.
+   addDemSources();
+
+   // Create chains for any image sources.
+   addImgSources();
+
+   // Initialize projection and propagate to chains.
+   initializeOutputProjection();
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "options keyword list:\n"
+         << *(m_kwl.get()) << "\n";
+
+      if ( m_srcKwl.valid() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "support record keyword list:\n"
+            << *(m_srcKwl.get()) << "\n";
+      }
+
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+} // End: void ossimChipperUtil::initialize()
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeChain( ossimIrect& aoi )
+{
+   static const char MODULE[] = "ossimChipperUtil::initializeChain";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimString lookup;  // used throughout...
+
+   ossimRefPtr<ossimImageSource> source = 0;
+
+   if ( hasBumpShadeArg() )
+   {
+      // Create chain:
+      source = initializeBumpShadeChain();
+   }
+   else if ( m_operation == OSSIM_CHIPPER_OP_COLOR_RELIEF )
+   {
+      source = initializeColorReliefChain();
+   }
+   else if ( ( m_operation == OSSIM_CHIPPER_OP_CHIP ) ||
+             ( m_operation == OSSIM_CHIPPER_OP_ORTHO ) )
+   {
+      source = combineLayers();
+   }
+   else if ( m_operation == OSSIM_CHIPPER_OP_2CMV )
+   {
+      source = initialize2CmvChain(); // Two Color Multiview.
+   }
+   else if ( m_operation == OSSIM_CHIPPER_OP_PSM )
+   {
+      source = initializePsmChain(); // Pan sharpened multispectral.
+   }
+
+   if ( source.valid() )
+   {
+      //---
+      // This is conditional.  Output radiometry may of may not be set.  This can also be set at
+      // the ossimSingleImageChain level.
+      //---
+      if ( ( getOutputScalarType() != OSSIM_SCALAR_UNKNOWN) &&
+           ( source->getOutputScalarType() != getOutputScalarType() ) )
+      {
+         source = addScalarRemapper( source, getOutputScalarType() );
+      }
+
+      //---
+      // Get the area of interest. This will be the scene bounding rect if not
+      // explicitly set by user with one of the --cut options.
+      //  Need to get this before the thumbnail code.
+      //---
+      getAreaOfInterest(source.get(), aoi);
+
+      //---
+      // Set the image size here.  Note must be set after combineLayers.  This is needed for
+      // the ossimImageGeometry::worldToLocal call for a geographic projection to handle wrapping
+      // accross the date line.
+      //---
+      m_geom->setImageSize( aoi.size() );
+
+      if ( hasThumbnailResolution() )
+      {
+         //---
+         // Adjust the projection scale and get the new rect.
+         // Note this will resize the ossimImageGeometry::m_imageSize is scale changes.
+         //---
+         initializeThumbnailProjection( aoi, aoi );
+
+         // Reset the source bounding rect if it changed.
+         source->initialize();
+      }
+
+      if ( source.valid() && !aoi.hasNans() )
+      {
+         //---
+         // Add a cut filter. This will:
+         // 1) Null out/clip any data pulled in.
+         // 2) Speed up by not propagating get tile request outside the cut or "aoi"
+         //    to the left hand side(input).
+         //---
+         ossimRefPtr<ossimRectangleCutFilter> cutter = new ossimRectangleCutFilter();
+
+         // Set the cut rectangle:
+         cutter->setRectangle( aoi );
+
+         // Null outside.
+         cutter->setCutType( ossimRectangleCutFilter::OSSIM_RECTANGLE_NULL_OUTSIDE );
+
+         // Connect cutter input to source chain.
+         cutter->connectMyInputTo( 0, source.get() );
+
+         source = cutter.get();
+
+         // Dependent on correct aoi so place after the cutter.
+         if ( hasAnnotations() )
+         {
+            // Put annotations after scalar remapper.
+            ossimRefPtr<ossimImageSource> result = addAnnotations( source );
+            if ( result.valid() )
+            {
+               source = result.get();
+            }
+         }
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return source;
+}
+
+void ossimChipperUtil::setOptionsToChain(
+   ossimIrect& aoi, const ossimKeywordlist& /* kwl */ )
+{
+   getAreaOfInterest(m_source.get(), aoi);
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeBumpShadeChain()
+{
+   static const char MODULE[] = "ossimChipperUtil::initializeBumpShadeChain";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimString lookup;
+   ossimRefPtr<ossimImageSource> source = 0;
+
+   // Combine the dems.
+   ossimRefPtr<ossimImageSource> demSource = combineLayers( m_demLayer );
+
+   // Set up the normal source.
+   ossimRefPtr<ossimImageToPlaneNormalFilter> normSource = new ossimImageToPlaneNormalFilter;
+
+   //---
+   // Set the track scale flag to true.  This enables scaling the surface
+   // normals by the GSD in order to maintain terrain proportions.
+   //---
+   normSource->setTrackScaleFlag(true);
+
+   // Connect to dems.
+   normSource->connectMyInputTo( demSource.get() );
+
+   // Set the smoothness factor.
+   ossim_float64 gain = 1.0;
+   lookup = m_kwl->findKey( GAIN_KW );
+   if ( lookup.size() )
+   {
+      gain = lookup.toFloat64();
+   }
+   normSource->setSmoothnessFactor(gain);
+
+   ossimRefPtr<ossimImageSource> colorSource = 0;
+   if ( hasLutFile() )
+   {
+      if ( m_imgLayer.size() )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << MODULE << " WARNING:"
+            << "\nBoth a color table and image(s) have been provided for a color source.\n"
+            << "Choosing color table of image(s).\n";
+      }
+
+      colorSource = addIndexToRgbLutFilter( demSource );
+   }
+   else
+   {
+      // Combine the images and set as color source for bump shade.
+      colorSource = combineLayers( m_imgLayer );
+   }
+
+   // Create the bump shade.
+   ossimRefPtr<ossimBumpShadeTileSource> bumpShade = new ossimBumpShadeTileSource;
+
+   // Set the azimuth angle.
+   ossim_float64 azimuthAngle = 180;
+   lookup = m_kwl->findKey( ossimKeywordNames::AZIMUTH_ANGLE_KW );
+   if ( lookup.size() )
+   {
+      ossim_float64 f = lookup.toFloat64();
+      if ( (f >= 0) && (f <= 360) )
+      {
+         azimuthAngle = f;
+      }
+   }
+   bumpShade->setAzimuthAngle(azimuthAngle);
+
+   // Set the elevation angle.
+   ossim_float64 elevationAngle = 45.0;
+   lookup = m_kwl->findKey( ossimKeywordNames::ELEVATION_ANGLE_KW );
+   if ( lookup.size() )
+   {
+      ossim_float64 f = lookup.toFloat64();
+      if ( (f >= 0.0) && (f <= 90) )
+      {
+         elevationAngle = f;
+      }
+   }
+   bumpShade->setElevationAngle(elevationAngle);
+
+   if ( !hasLutFile() )
+   {
+      // Set the color.
+      ossim_uint8 r = 0xff;
+      ossim_uint8 g = 0xff;
+      ossim_uint8 b = 0xff;
+      lookup = m_kwl->findKey( COLOR_RED_KW );
+      if ( lookup.size() )
+      {
+         r = lookup.toUInt8();
+      }
+      lookup = m_kwl->findKey( COLOR_GREEN_KW );
+      if ( lookup.size() )
+      {
+         g = lookup.toUInt8();
+      }
+      lookup = m_kwl->findKey( COLOR_BLUE_KW );
+      if ( lookup.size() )
+      {
+         b = lookup.toUInt8();
+      }
+      bumpShade->setRgbColorSource(r, g, b);
+   }
+
+   // Connect the two sources.
+   bumpShade->connectMyInputTo(0, normSource.get());
+   bumpShade->connectMyInputTo(1, colorSource.get());
+
+   if ( traceDebug() )
+   {
+      ossim_uint8 r = 0xff;
+      ossim_uint8 g = 0xff;
+      ossim_uint8 b = 0xff;
+      bumpShade->getRgbColorSource(r, g, b);
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "\nazimuthAngle:      " << azimuthAngle
+         << "\nelevation angle:   " << elevationAngle
+         << "\ngain factor:       " << gain
+         << "\nr:                 " << int(r)
+         << "\ng:                 " << int(g)
+         << "\nb:                 " << int(b)
+         << "\n";
+   }
+
+   // Capture the pointer to give to the writer.
+   source = bumpShade.get();
+
+   return source;
+
+} // End: ossimChipperUtil::initializeBumpShadeChain()
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::initializeColorReliefChain()
+{
+   ossimRefPtr<ossimImageSource> result = combineLayers();
+   if ( hasLutFile() )
+   {
+      result = addIndexToRgbLutFilter( result );
+   }
+   else
+   {
+      // No LUT file provided, so doing the default 8-bit linear stretch:
+      if ( result->getOutputScalarType() != OSSIM_UINT8 )
+      {
+         result = addScalarRemapper( result, OSSIM_UINT8 );
+      }
+   }
+   return result;
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::initializePsmChain()
+{
+   ossimRefPtr<ossimImageSource> result = 0;
+
+   ossim_uint32 layerCount = (ossim_uint32) (m_demLayer.size() + m_imgLayer.size());
+
+   // Must have two and only two inputs.
+   if ( layerCount == 2 )
+   {
+      ossimRefPtr<ossimSingleImageChain> input1 = 0; // First input should be color.
+      ossimRefPtr<ossimSingleImageChain> input2 = 0; // Second input should be pan.
+
+      // Most likely case, two image layers.
+      if ( m_imgLayer.size() )
+      {
+         input1 = m_imgLayer[0].get();
+
+         if ( m_imgLayer.size() == 2 )
+         {
+            input2 = m_imgLayer[1].get();
+         }
+      }
+
+      if ( m_demLayer.size() )
+      {
+         if ( !input1.valid() )
+         {
+            input1 = m_demLayer[0].get();
+         }
+
+         if ( !input2.valid() )
+         {
+            if ( m_demLayer.size() == 1 )
+            {
+               input2 = m_demLayer[0].get();
+            }
+            else if ( m_demLayer.size() == 2 )
+            {
+               input2 = m_demLayer[1].get();
+            }
+         }
+      }
+
+      if ( input1.valid() && input2.valid() )
+      {
+         // Make the color input the first connection to the combiner.
+         if ( input1->getNumberOfOutputBands() == 1 )
+         {
+            // Swap:
+            ossimRefPtr<ossimSingleImageChain> tmpChain = input1;
+            input1 = input2;
+            input2 = tmpChain;
+         }
+
+         //---
+         // Check the pan source for one band:
+         // This really shouldn't happen, i.e. caller should typically pass a
+         // one band pan image that is higher resolution than the color source.
+         //---
+         if ( input2->getNumberOfOutputBands() > 1 )
+         {
+            // Note this will add a band selector if there isn't one in chain.
+            std::vector<ossim_uint32> bandList(1);
+            bandList[0] = 0;
+            input2->setBandSelection( bandList );
+         }
+
+         // TODO: Make dynamic by type.
+         ossimRefPtr<ossimFusionCombiner> psm = new ossimSFIMFusion();
+         psm->connectMyInputTo(0, input1.get());
+         psm->connectMyInputTo(1, input2.get());
+         psm->initialize();
+         result = dynamic_cast<ossimImageSource*>(psm.get());
+      }
+
+   } // Matches: if ( layerCount == 2 )
+
+   return result;
+
+} // End: ossimChipperUtil::initializePsmChain()
+
+void ossimChipperUtil::initializeOutputProjection()
+{
+   if ( isChipMode() )
+   {
+      createIdentityProjection();
+   }
+   else
+   {
+      // Create the output projection.
+      createOutputProjection();
+
+      // Setup the view in all the chains.
+      propagateOutputProjectionToChains();
+   }
+}
+
+void ossimChipperUtil::execute()
+{
+   static const char MODULE[] = "ossimChipperUtil::execute";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimIrect aoi;
+   ossimRefPtr<ossimImageSource> source = initializeChain( aoi );
+
+   if ( source.valid() && !aoi.hasNans() )
+   {
+      // Set up the writer.
+      m_writer = createNewWriter();
+
+      // Connect the writer to the cutter.
+      m_writer->connectMyInputTo(0, source.get());
+
+      //---
+      // Set the area of interest.
+      // NOTE: This must be called after the writer->connectMyInputTo as
+      // ossimImageFileWriter::initialize incorrectly resets theAreaOfInterest
+      // back to the bounding rect.
+      //---
+      m_writer->setAreaOfInterest(aoi);
+
+      if (m_writer->getErrorStatus() == ossimErrorCodes::OSSIM_OK)
+      {
+         // Add a listener to get percent complete.
+         ossimStdOutProgress prog(0, true);
+         m_writer->addListener(&prog);
+
+         if ( traceLog() )
+         {
+            ossimKeywordlist logKwl;
+            m_writer->saveStateOfAllInputs(logKwl);
+
+            ossimFilename logFile;
+            getOutputFilename(logFile);
+            logFile.setExtension("log");
+
+            logKwl.write( logFile.c_str() );
+         }
+
+         // Write the file:
+         m_writer->execute();
+
+         m_writer->removeListener(&prog);
+
+         if(m_writer->isAborted())
+         {
+            throw ossimException( "Writer Process aborted!" );
+         }
+      }
+      else
+      {
+         throw ossimException( "Unable to initialize writer for execution" );
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+}
+void ossimChipperUtil::abort()
+{
+   if(m_writer.valid())
+   {
+      m_writer->abort();
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimChipperUtil::getChip(const ossimKeywordlist& optionsKwl)
+{
+  ossimRefPtr<ossimImageData> result = 0;
+
+  ossimIrect aoi;
+
+  if( optionsKwl.getSize() > 0 )
+  {
+     m_kwl->addList(optionsKwl, true);
+  }
+
+  // (GP)
+  // Until we add more ellaborate code to check for scale changes
+  // as well as moving windows we will just always initialize
+  // the output projection
+  //
+
+  initializeOutputProjection();
+  if(!m_source.valid())
+  {
+    m_source = initializeChain( aoi );
+  }
+
+  if ( optionsKwl.getSize() > 0 )
+  {
+     //---
+     // Only do this if new options were passed in. This was causing an off by
+     // one error when now options were passed in using thumbnail option.
+     // The m_source->getBoundingRect(...) was returning 257 instead of 256.
+     // Need to hunt that down but for right now this fixes problem.
+     // (drb 20151222)
+     //---
+     getAreaOfInterest(m_source.get(), aoi);
+
+     m_geom->setImageSize( aoi.size() );
+  }
+
+  if ( m_source.valid() )
+  {
+    result = m_source->getTile( aoi, 0 );
+  }
+
+   return result;
+}
+
+void ossimChipperUtil::addDemSources()
+{
+   static const char MODULE[] = "ossimChipperUtil::addDemSources";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   // Add the images from the options keyword list.
+   ossim_uint32 demCount = m_kwl->numberOf( DEM_KW.c_str() );
+   ossim_uint32 maxIndex = demCount + 100; // Allow for skippage in numbering.
+   ossim_uint32 foundRecords = 0;
+   ossim_uint32 i = 0;
+   while ( foundRecords < demCount )
+   {
+      ossimString key = DEM_KW;
+      key += ossimString::toString(i);
+      key += ".";
+      key += FILE_KW;
+      ossimFilename f = m_kwl->findKey( key.string() );
+      if ( f.size() )
+      {
+         // Look for the entry key, e.g. dem0.entry: 10
+         ossim_uint32 entryIndex = 0;
+         key = DEM_KW;
+         key += ossimString::toString(i);
+         key += ".";
+         key += ossimKeywordNames::ENTRY_KW;
+         std::string value = m_kwl->findKey( key.string() );
+         if ( value.size() )
+         {
+            entryIndex = ossimString(value).toUInt32();
+         }
+         else
+         {
+            // Get global entry.  Set by "-e" on command line apps.
+            entryIndex = getEntryNumber();
+         }
+
+         addDemSource( f, entryIndex );
+         ++foundRecords;
+      }
+      ++i;
+      if ( i >= maxIndex ) break;
+   }
+
+   if ( m_srcKwl.valid() )
+   {
+      // Add stuff from src keyword list.
+      demCount = m_srcKwl->numberOf( DEM_KW.c_str() );
+      maxIndex = demCount + 100;
+      foundRecords = 0;
+      i = 0;
+      while ( foundRecords < demCount )
+      {
+         ossimString prefix = DEM_KW;
+         prefix += ossimString::toString(i);
+         prefix += ".";
+         ossimSrcRecord src;
+         if ( src.loadState( *(m_srcKwl.get()), prefix ) )
+         {
+            addDemSource(src);
+            ++foundRecords;
+         }
+         ++i;
+         if ( i >= maxIndex ) break;
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::addDemSource(const ossimFilename& file, ossim_uint32 entryIndex)
+{
+   static const char MODULE[] = "ossimChipperUtil::addDemSource(const ossimFilename&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = createChain(file, entryIndex, true);
+   if ( ic.valid() )
+   {
+      m_demLayer.push_back(ic);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
+   }
+}
+
+void ossimChipperUtil::addDemSource(const ossimSrcRecord& rec)
+{
+   static const char MODULE[] = "ossimChipperUtil::addDemSource(const ossimSrcRecord&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = createChain(rec, true);
+   if ( ic.valid() )
+   {
+      m_demLayer.push_back(ic);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
+   }
+}
+
+void ossimChipperUtil::addImgSources()
+{
+   static const char MODULE[] = "ossimChipperUtil::addImgSources";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossim_uint32 imgCount = m_kwl->numberOf( IMG_KW.c_str() );
+   ossim_uint32 maxIndex = imgCount + 100; // Allow for skippage in numbering.
+   ossim_uint32 foundRecords = 0;
+   ossim_uint32 i = 0;
+   while ( foundRecords < imgCount )
+   {
+      ossimString key = IMG_KW;
+      key += ossimString::toString(i);
+      key += ".";
+      key += FILE_KW;
+      ossimFilename f = m_kwl->findKey( key.string() );
+      if ( f.size() )
+      {
+         // Look for the entry key, e.g. image0.entry: 10
+         ossim_uint32 entryIndex = 0;
+         key = IMG_KW;
+         key += ossimString::toString(i);
+         key += ".";
+         key += ossimKeywordNames::ENTRY_KW;
+         std::string value = m_kwl->findKey( key.string() );
+         if ( value.size() )
+         {
+            entryIndex = ossimString(value).toUInt32();
+         }
+         else
+         {
+            // Get global entry.  Set by "-e" on command line apps.
+            entryIndex = getEntryNumber();
+         }
+         // Add it:
+         addImgSource(f, entryIndex );
+         ++foundRecords;
+      }
+      ++i;
+      if ( i >= maxIndex ) break;
+   }
+
+   if ( m_srcKwl.valid() )
+   {
+      // Add stuff from src keyword list.
+      imgCount = m_srcKwl->numberOf( IMG_KW.c_str() );
+      maxIndex = imgCount + 100;
+      foundRecords = 0;
+      i = 0;
+      while ( foundRecords < imgCount )
+      {
+         ossimString prefix = IMG_KW;
+         prefix += ossimString::toString(i);
+         prefix += ".";
+         ossimSrcRecord src;
+         if ( src.loadState( *(m_srcKwl.get()), prefix ) )
+         {
+            addImgSource(src);
+            ++foundRecords;
+         }
+         ++i;
+         if ( i >= maxIndex ) break;
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::addImgSource(const ossimFilename& file, ossim_uint32 entryIndex)
+{
+   static const char MODULE[] = "ossimChipperUtil::addImgSource";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\nFile: " << file << "\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = createChain(file, entryIndex, false);
+   if ( ic.valid() )
+   {
+      m_imgLayer.push_back(ic);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
+   }
+}
+
+void ossimChipperUtil::addImgSource(const ossimSrcRecord& rec)
+{
+   static const char MODULE[] = "ossimChipperUtil::addImgSource(const ossimSrcRecord&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = createChain(rec, false);
+   if ( ic.valid() )
+   {
+      m_imgLayer.push_back(ic);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exiting...\n";
+   }
+}
+
+ossimRefPtr<ossimSingleImageChain> ossimChipperUtil::createChain(const ossimFilename& file,
+                                                                 ossim_uint32 entryIndex,
+                                                                 bool isDemSource) const
+{
+   static const char MODULE[] = "ossimChipperUtil::createChain(const ossimFilename&";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..."
+         << "\nfile: " << file
+         << "\nentry: " << entryIndex
+         << "\nisDemSource: " << (isDemSource?"true":"false")
+         << "\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = 0;
+
+   if ( file.size() )
+   {
+      // ossimFilename::exists() currently does not work with s3 url's.
+      // if ( file.exists() )
+      if ( 1 )
+      {
+         ic = new ossimSingleImageChain;
+         if ( ic->open( file ) )
+         {
+            // Set any reader props:
+            setReaderProps( ic->getImageHandler().get() );
+
+            // we can't guarantee the state of the image handler at this point so
+            // let's make sure that the entry is always set to the requested location
+            //  On Cib/Cadrg we were having problems.  Removed the compare for entry 0
+            //
+
+             if ( setChainEntry( ic, entryIndex ) == false )
+             {
+                std::ostringstream errMsg;
+                errMsg << MODULE << " ERROR:\nEntry " << entryIndex << " out of range!"
+                       << std::endl;
+                throw ossimException( errMsg.str() );
+             }
+
+            //---
+            // If PSM (pan sharpening) operation and this input is one band, don't
+            // mess with its bands.
+            //---
+            bool psmPanInput = false;
+            if ( ( m_operation == OSSIM_CHIPPER_OP_PSM ) && ( ic->getNumberOfOutputBands() == 1 ) )
+            {
+               psmPanInput = true;
+            }
+
+            // Bands selection.  Note: Not performed on PSM pan band.
+            if ( !psmPanInput )
+            {
+               if ( isThreeBandOut() )
+               {
+                  //---
+                  // This will guarantee three bands out.  Will put band
+                  // selector at the end of the chain if input is one band. If input image
+                  // handler has implemented a getRgbBandlist(...) it will also set the
+                  // rgb band order.
+                  //---
+                  ic->setThreeBandFlag( true );
+               }
+
+               if ( hasBandSelection() )
+               {
+                  // User entered band list.
+                  std::vector<ossim_uint32> bandList(0);
+                  getBandList( bandList );
+                  if ( bandList.size() )
+                  {
+                     ic->setBandSelection( bandList );
+                  }
+                  else
+                  {
+                     ic->setDefaultBandSelection();     
+                  }
+               }
+            }
+
+            //---
+            // If multiple inputs and scaleToEightBit do it at the end of the processing
+            // chain to alleviate un-even stretches between inputs.
+            //---
+            const ossim_uint32 INPUT_COUNT = getNumberOfInputs();
+            bool scaleFlag = ( scaleToEightBit() && (INPUT_COUNT == 1) );
+            ic->setRemapToEightBitFlag( scaleFlag );
+
+            // Always have resampler cache.
+            ic->setAddResamplerCacheFlag(true);
+
+            //---
+            // Don't need a chain cache as we're doing a sequential write.  So the same tile
+            // should never be visited more than once.
+            //---
+            ic->setAddChainCacheFlag(false);
+
+            //---
+            // Histogram:
+            // Don't apply histogram stretch to dem sources for hill shade
+            // operation.
+            //---
+            if ( ( isDemSource == false ) ||
+                 ( isDemSource && (m_operation != OSSIM_CHIPPER_OP_HILL_SHADE) ) )
+            {
+               ic->setAddHistogramFlag( hasHistogramOperation() );
+            }
+
+            // Brightness, contrast. Note in same filter.
+            if ( hasBrightnesContrastOperation() )
+            {
+               ic->setBrightnessContrastFlag(true);
+            }
+
+            std::string sharpnessMode = getSharpenMode();
+            if ( sharpnessMode.size() )
+            {
+              ic->setSharpenFlag(true);
+            }
+
+            // Create the chain.
+            ic->createRenderedChain();
+
+            // Set the filter type if needed.
+            ossimString lookup = m_kwl->findKey( RESAMPLER_FILTER_KW );
+            if ( lookup.size() )
+            {
+               // Assumption image renderer is in chain:
+               ic->getImageRenderer()->getResampler()->setFilterType( lookup );
+            }
+
+            // Histogram setup.
+            if ( hasHistogramOperation() )
+            {
+               setupChainHistogram( ic );
+            }
+
+            // Brightness constrast setup:
+            if ( hasBrightnesContrastOperation() )
+            {
+               // Assumption bright contrast filter in chain:
+
+               ossim_float64 value = getBrightness();
+               ic->getBrightnessContrast()->setBrightness( value );
+
+               value = getContrast();
+               ic->getBrightnessContrast()->setContrast( value );
+            }
+
+            // Sharpness:
+            if ( sharpnessMode.size() )
+            {
+               if ( sharpnessMode == "light" )
+               {
+                  ic->getSharpenFilter()->setWidthAndSigma( 3, 0.5 );
+               }
+               else if ( sharpnessMode == "heavy" )
+               {
+                  ic->getSharpenFilter()->setWidthAndSigma( 5, 1.0 );
+               }
+            }
+
+            if(hasGeoPolyCutterOption())
+            {
+               ossimGeoPolygon polygon;
+               getClipPolygon(polygon);
+               if(polygon.size()>0)
+               {
+                  ic->addGeoPolyCutterPolygon(polygon);
+               }
+            }
+         }
+      }
+   }
+
+   if ( ic.valid() == false )
+   {
+      std::string errMsg = "Could not open: ";
+      errMsg += file.string();
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimKeywordlist kwl;
+      ic->saveState(kwl, 0);
+
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "chain:\n" << kwl << "\n"
+         << MODULE << " exiting...\n";
+   }
+
+   return ic;
+}
+
+ossimRefPtr<ossimSingleImageChain> ossimChipperUtil::createChain(const ossimSrcRecord& rec,
+                                                                 bool isDemSource) const
+{
+   static const char MODULE[] = "ossimChipperUtil::createChain(const ossimSrcRecord&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimSingleImageChain> ic = new ossimSingleImageChain;
+   if ( ic->open(rec) )
+   {
+      // Set any reader props:
+      setReaderProps( ic->getImageHandler().get() );
+
+      // Entry is set in ossimSingleImageChain::open(src)
+
+      //---
+      // If PSM (pan sharpening) operation and this input is one band, don't
+      // mess with its bands.
+      //---
+      bool psmPanInput = false;
+      if ( ( m_operation == OSSIM_CHIPPER_OP_PSM ) && ( ic->getNumberOfOutputBands() == 1 ) )
+      {
+         psmPanInput = true;
+      }
+      
+      // Bands selection.  Note: Not performed on PSM pan band.
+      if ( !psmPanInput )
+      {
+         if ( isThreeBandOut() )
+         {
+            //---
+            // This will guarantee three bands out.  Will put band
+            // selector at the end of the chain if input is one band. If input image
+            // handler has implemented a getRgbBandlist(...) it will also set the
+            // rgb band order.
+            //---
+            ic->setThreeBandFlag( true );
+         }
+         
+         if ( hasBandSelection() )
+         {
+            // User entered band list.
+            std::vector<ossim_uint32> bandList(0);
+            getBandList( bandList );
+            if ( bandList.size() )
+            {
+               ic->setBandSelection( bandList );
+            }
+            else
+            {
+               ic->setDefaultBandSelection();     
+            }
+         }
+      }
+
+      //---
+      // If multiple inputs and scaleToEightBit do it at the end of the processing
+      // chain to alleviate un-even stretches between inputs.
+      //---
+      const ossim_uint32 INPUT_COUNT = getNumberOfInputs();
+      bool scaleFlag = ( scaleToEightBit() && (INPUT_COUNT == 1) );
+      ic->setRemapToEightBitFlag( scaleFlag );
+
+      // Always have resampler cache.
+      ic->setAddResamplerCacheFlag(true);
+
+      //---
+      // Don't need a chain cache as we're doing a sequential write.  So the same tile
+      // should never be visited more than once.
+      //---
+      ic->setAddChainCacheFlag(false);
+
+      //---
+      // Histogram:
+      // Don't apply histogram stretch to dem sources for hill shade
+      // operation.
+      //---
+      if ( ( isDemSource == false ) ||
+           ( isDemSource && (m_operation != OSSIM_CHIPPER_OP_HILL_SHADE) ) )
+      {
+         ic->setAddHistogramFlag( hasHistogramOperation() );
+      }
+      
+      // Brightness, contrast. Note in same filter.
+      if ( hasBrightnesContrastOperation() )
+      {
+         ic->setBrightnessContrastFlag(true);
+      }
+      
+      std::string sharpnessMode = getSharpenMode();
+      if ( sharpnessMode.size() )
+      {
+         ic->setSharpenFlag(true);
+      }
+
+      //---
+      // Create the chain.
+      // 
+      // NOTE: Histogram and band selector can be set in ic->createRenderedChain(rec)
+      // if the right keywords are there.
+      //---
+      ic->createRenderedChain(rec);
+
+      // Set the filter type if needed.
+      ossimString lookup = m_kwl->findKey( RESAMPLER_FILTER_KW );
+      if ( lookup.size() )
+      {
+         // Assumption image renderer is in chain:
+         ic->getImageRenderer()->getResampler()->setFilterType( lookup );
+      }
+      
+      // Histogram setup.
+      if ( hasHistogramOperation() )
+      {
+         setupChainHistogram( ic );
+      }
+      
+      // Brightness constrast setup:
+      if ( hasBrightnesContrastOperation() )
+      {
+         // Assumption bright contrast filter in chain:
+         
+         ossim_float64 value = getBrightness();
+         ic->getBrightnessContrast()->setBrightness( value );
+         
+         value = getContrast();
+         ic->getBrightnessContrast()->setContrast( value );
+      }
+      
+      // Sharpness:
+      if ( sharpnessMode.size() )
+      {
+         if ( sharpnessMode == "light" )
+         {
+            ic->getSharpenFilter()->setWidthAndSigma( 3, 0.5 );
+         }
+         else if ( sharpnessMode == "heavy" )
+         {
+            ic->getSharpenFilter()->setWidthAndSigma( 5, 1.0 );
+         }
+      }
+      
+      if(hasGeoPolyCutterOption())
+      {
+         ossimGeoPolygon polygon;
+         getClipPolygon(polygon);
+         if(polygon.size()>0)
+         {
+            ic->addGeoPolyCutterPolygon(polygon);
+         }
+      }
+   }
+   else // Open failed.
+   {
+      std::string errMsg = "Could not open from src record!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimKeywordlist kwl;
+      ic->saveState(kwl, 0);
+
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "chain:\n" << kwl << "\n"
+         << MODULE << " exiting...\n";
+   }
+
+   return ic;
+}
+
+void ossimChipperUtil::createOutputProjection()
+{
+   static const char MODULE[] = "ossimChipperUtil::createOutputProjection";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   std::string op  = m_kwl->findKey( std::string(ossimKeywordNames::PROJECTION_KW) );
+   std::string srs = m_kwl->findKey( SRS_KW );
+
+   if ( op.size() && srs.size() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << MODULE << " WARNING:"
+         << "\nBoth " << SRS_KW << " and " << ossimKeywordNames::PROJECTION_KW
+         << " keywords are set!"
+         << "\nsrs:               " << srs
+         << "\noutput_projection: " << op
+         << "\nTaking " << srs << " over " << op << "\n";
+   }
+
+   bool usingInput = false;
+   ossimChipperOutputProjection projType = getOutputProjectionType();
+   ossimRefPtr<ossimMapProjection> proj = 0;
+
+   // If an srs code use that first.
+   if ( srs.size() )
+   {
+      proj = getNewProjectionFromSrsCode( srs );
+   }
+   else if ( op.size() )
+   {
+      switch ( projType )
+      {
+         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO:
+         {
+            proj = getNewGeoProjection();
+            break;
+         }
+         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO_SCALED:
+         {
+            proj = getNewGeoScaledProjection();
+            break;
+         }
+         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_INPUT:
+         {
+            proj = getFirstInputProjection();
+            usingInput = true;
+            break;
+         }
+         case ossimChipperUtil::OSSIM_CHIPPER_PROJ_UTM:
+         {
+            proj = getNewUtmProjection();
+            break;
+         }
+         default:
+         {
+            break; // Just for un-handled type warning.
+         }
+      }
+   }
+
+   // Check for identity projection:
+   ossimRefPtr<ossimMapProjection> inputProj = getFirstInputProjection();
+   if ( proj.valid() && inputProj.valid() )
+   {
+      if ( *(inputProj.get()) == *(proj.get()) )
+      {
+         if ( projType == OSSIM_CHIPPER_PROJ_GEO_SCALED )
+         {
+            // Get the origin used for scaling.
+            ossimGpt origin = proj->getOrigin();
+
+            // Copy the input projection to our projection.  Has the tie and scale we need.
+            proj = inputProj;
+
+            // Set the origin for scaling.
+            proj->setOrigin(origin);
+         }
+         else
+         {
+            proj = inputProj;
+         }
+         usingInput = true;
+      }
+   }
+
+   if ( !proj.valid() )
+   {
+      // Try first input. If map projected use that.
+      if ( inputProj.valid() )
+      {
+         proj = inputProj;
+         usingInput = true;
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "WARNING: No projection set!"
+               << "\nDefaulting to first input's projection.\n";
+         }
+      }
+      else
+      {
+         proj = getNewGeoScaledProjection();
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "WARNING: No projection set!"
+               << "\nDefaulting to scaled geographic at scene center.\n";
+         }
+      }
+   }
+
+   // Create our ossimImageGeometry with projection (no transform).
+   m_geom  = new ossimImageGeometry( 0, proj.get() );
+
+   //---
+   // If the input is the same as output projection do not modify; else, set
+   // the gsd to user selected "METERS_KW" or the best resolution of the inputs,
+   // set the tie and then snap it to the projection origin.
+   //---
+   if ( !usingInput || hasScaleOption() )
+   {
+      // Set the scale.
+      initializeProjectionGsd();
+   }
+
+   // Set the tie.
+   intiailizeProjectionTiePoint();
+
+   if ( snapTieToOrigin() )
+   {
+      // Adjust the projection tie to the origin.
+      proj->snapTiePointToOrigin();
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "using input projection: " << (usingInput?"true":"false")
+         << "\noutput image geometry:\n";
+
+      m_geom->print(ossimNotify(ossimNotifyLevel_DEBUG));
+
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+} // End: ossimChipperUtil::createOutputProjection()
+
+void ossimChipperUtil::createIdentityProjection()
+{
+   static const char MODULE[] = "ossimChipperUtil::createIdentityProjection";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   // Get the singe image chain.  Sould be only one.
+   ossimRefPtr<ossimSingleImageChain> sic = 0;
+   if ( m_demLayer.size() )
+   {
+      sic = m_demLayer[0];
+   }
+   else if ( m_imgLayer.size() )
+   {
+      sic = m_imgLayer[0];
+   }
+
+   if ( sic.valid() )
+   {
+      // Get the image handler.
+      ossimRefPtr<ossimImageHandler>  ih = sic->getImageHandler();
+
+      // Resampler:
+      ossimRefPtr<ossimImageRenderer> resampler = sic->getImageRenderer();
+
+      if ( ih.valid() )
+      {
+         //---
+         // Get the geometry from the image handler.  Since we're in "identity"
+         // mode use the inputs for the outputs.
+         //---
+         m_geom = ih->getImageGeometry();
+
+         if ( m_geom.valid() )
+         {
+            // Get the image projection.
+            ossimRefPtr<ossimProjection> proj = m_geom->getProjection();
+            if ( proj.valid() )
+            {
+               ossim_float64 rotation = 0.0;
+               if ( upIsUp() )
+               {
+                  rotation = m_geom->upIsUpAngle();
+               }
+               else if ( northUp() )
+               {
+                  rotation = m_geom->northUpAngle();
+               }
+               else if ( hasRotation() )
+               {
+                  rotation = getRotation();
+               }
+
+               if ( ossim::isnan( rotation ) )
+               {
+                  rotation = 0.0;
+               }
+
+               ossimDpt imageSpaceScale;
+               getImageSpaceScale( imageSpaceScale );
+
+               ossimDrect rect;
+               m_geom->getBoundingRect(rect);
+               ossimDpt midPt = rect.midPoint();
+
+               if ( traceDebug() )
+               {
+                  ossimNotify(ossimNotifyLevel_DEBUG)
+                     << MODULE
+                     << "\nAffine transform parameters:"
+                     << "\nrotation:  " << rotation
+                     << "\nmid point: " << midPt << std::endl;
+               }
+
+               m_ivt = new ossimImageViewAffineTransform(-rotation,
+                                                         imageSpaceScale.x, // image space scale x
+                                                         imageSpaceScale.y, // image space scale y
+                                                         1.0,1.0,  //scale x and y
+                                                         0.0, 0.0, // translate x,y
+                                                         midPt.x, midPt.y); // pivot point
+
+               if ( m_kwl->hasKey( METERS_KW )    ||
+                    m_kwl->hasKey( DEGREES_X_KW ) ||
+                    m_kwl->hasKey( RRDS_KW ) )
+               {
+                  // Set the image view transform scale.
+                  initializeIvtScale();
+               }
+
+               resampler->setImageViewTransform( m_ivt.get() );
+            }
+
+         } // Matches: if ( m_geom.valid() )
+
+      } // Matches: if ( ih.valid() )
+
+   } // Matches: if ( sic.valid()
+
+} // End: createIdentityProjection()
+
+void ossimChipperUtil::initializeIvtScale()
+{
+   if ( isChipMode() && m_ivt.valid() && m_geom.valid() )
+   {
+      ossimDpt scale;
+      scale.makeNan();
+
+      // Check for GSD spec. Degrees/pixel takes priority over meters/pixel:
+      ossimString lookup;
+      lookup.string() = m_kwl->findKey( DEGREES_X_KW );
+      if ( lookup.size() )
+      {
+         ossimDpt outputDpp;
+         outputDpp.makeNan();
+
+         outputDpp.x = lookup.toFloat64();
+
+         lookup.string() = m_kwl->findKey( DEGREES_Y_KW );
+         if ( lookup.size() )
+         {
+            outputDpp.y = lookup.toFloat64();
+         }
+
+         if ( !outputDpp.hasNans() )
+         {
+            // Input degress per pixel.  Consider this a scale of 1.0.
+            ossimDpt inputDpp;
+            m_geom->getDegreesPerPixel( inputDpp );
+
+            if ( !inputDpp.hasNans() )
+            {
+               scale.x = inputDpp.x/outputDpp.x;
+               scale.y = inputDpp.y/outputDpp.y;
+            }
+         }
+      }
+
+      if ( scale.hasNans() )
+      {
+         lookup = m_kwl->findKey( METERS_KW );
+         if ( lookup.size() )
+         {
+            ossimDpt outputMpp;
+            outputMpp.makeNan();
+            outputMpp.x = lookup.toFloat64();
+            outputMpp.y = outputMpp.x;
+
+            if ( !outputMpp.hasNans() )
+            {
+               // Input meters per pixel.  Consider this a scale of 1.0.
+               ossimDpt inputMpp;
+               m_geom->getMetersPerPixel( inputMpp );
+
+               if ( !inputMpp.hasNans() )
+               {
+                  scale.x = inputMpp.x/outputMpp.x;
+                  scale.y = inputMpp.y/outputMpp.y;
+               }
+            }
+         }
+      }
+
+      if ( scale.hasNans() )
+      {
+         lookup = m_kwl->findKey( RRDS_KW );
+         if ( lookup.size() )
+         {
+            ossim_float64 d = lookup.toInt32();
+            if ( d == 0.0 )
+            {
+               scale.x = 1.0;
+            }
+            else
+            {
+               scale.x = 1.0 / std::pow(2.0, d);
+            }
+            scale.y = scale.x;
+         }
+      }
+
+      if ( !scale.hasNans() )
+      {
+         m_ivt->scale( scale.x, scale.y );
+      }
+      else
+      {
+         std::string errMsg = "ossimChipperUtil::initializeIvtScale failed!";
+         throw ossimException(errMsg);
+      }
+
+   } // Matches: if ( isChipMode() && ... )
+
+} // End: ossimChipperUtil::initializeIvtScale()
+
+void ossimChipperUtil::intiailizeProjectionTiePoint()
+{
+   static const char MODULE[] = "ossimChipperUtil::initializeProjectionTiePoint()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   // Get the map projection from the output geometry:
+   ossimRefPtr<ossimMapProjection> mapProj = getMapProjection();
+
+   if ( mapProj.valid() )
+   {
+      //---
+      // If the output is geographic of there are sensor model inputs, get the tie
+      // using the ground point.
+      //---
+      if ( mapProj->isGeographic() || hasSensorModelInput() )
+      {
+         ossimGpt tiePoint;
+         tiePoint.makeNan();
+         getTiePoint(tiePoint);
+
+         if ( !tiePoint.hasNans() )
+         {
+            //---
+            // The tie point coordinates currently reflect the UL edge of the UL pixel.
+            // We'll need to shift the tie point bac from the edge to the center base on the
+            // output gsd.
+            //---
+            ossimDpt half_pixel_shift = m_geom->getDegreesPerPixel() * 0.5;
+            tiePoint.lat -= half_pixel_shift.lat;
+            tiePoint.lon += half_pixel_shift.lon;
+            mapProj->setUlTiePoints(tiePoint);
+         }
+         else
+         {
+            std::string errMsg = MODULE;
+            errMsg += " tie point has nans!";
+            throw( ossimException(errMsg) );
+         }
+
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "projection tie point: " << tiePoint << "\n" << MODULE << " exited...\n";
+         }
+      }
+      else
+      {
+         //---
+         // TODO: Add test for like input projections and use above geographic tie
+         // code if not.
+         //---
+         ossimDpt tiePoint;
+         tiePoint.makeNan();
+         getTiePoint(tiePoint);
+
+         if ( !tiePoint.hasNans() )
+         {
+            //---
+            // The tie point coordinates currently reflect the UL edge of the UL pixel.
+            // We'll need to shift the tie point bac from the edge to the center base on the
+            // output gsd.
+            //---
+            ossimDpt half_pixel_shift = m_geom->getMetersPerPixel() * 0.5;
+            tiePoint.y -= half_pixel_shift.y;
+            tiePoint.x += half_pixel_shift.x;
+            mapProj->setUlTiePoints(tiePoint);
+         }
+         else
+         {
+            std::string errMsg = MODULE;
+            errMsg += " tie point has nans!";
+            throw( ossimException(errMsg) );
+         }
+
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "projection tie point: " << tiePoint << "\n" << MODULE << " exited...\n";
+         }
+      }
+
+   } // Matches: if ( mapProj.valid() )
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += "m_projection is null!";
+      throw( ossimException(errMsg) );
+   }
+}
+
+void ossimChipperUtil::initializeProjectionGsd()
+{
+   static const char MODULE[] = "ossimChipperUtil::initializeProjectionGsd()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimMapProjection> mapProj = getMapProjection();
+   if ( !mapProj.valid() )
+   {
+      std::string errMsg = MODULE;
+      errMsg += " projection is null!";
+      throw( ossimException(errMsg) );
+   }
+
+   ossimDpt gsd;
+   gsd.makeNan();
+
+   ossimString degreesX;
+   ossimString degreesY;
+   ossimString meters;
+   degreesX.string() = m_kwl->findKey( DEGREES_X_KW );
+   degreesY.string() = m_kwl->findKey( DEGREES_Y_KW );
+   meters.string()   = m_kwl->findKey( METERS_KW );
+
+   if ( hasCutBoxWidthHeight() )
+   {
+      // --cut-bbox-llwh Implies a scale...
+      if ( degreesX.size() || degreesY.size() || meters.size() )
+      {
+         std::ostringstream errMsg;
+         errMsg << MODULE << " ERROR: Ambiguous scale keywords!\n"
+                << "Do not combine meters or degrees with cut box with a width and height.\n";
+         throw( ossimException( errMsg.str() ) );
+      }
+
+      ossimString cutMinLat;
+      ossimString cutMinLon;
+      ossimString cutMaxLat;
+      ossimString cutMaxLon;
+      ossimString cutWidth;
+      ossimString cutHeight;
+      cutMinLat.string() = m_kwl->findKey( CUT_MIN_LAT_KW );
+      cutMinLon.string() = m_kwl->findKey( CUT_MIN_LON_KW );
+      cutMaxLat.string() = m_kwl->findKey( CUT_MAX_LAT_KW );
+      cutMaxLon.string() = m_kwl->findKey( CUT_MAX_LON_KW );
+      cutWidth.string()  = m_kwl->findKey( CUT_WIDTH_KW );
+      cutHeight.string() = m_kwl->findKey( CUT_HEIGHT_KW );
+      if ( cutMinLat.size() && cutMinLon.size() && cutMaxLat.size() &&
+           cutMaxLon.size() && cutWidth.size() && cutHeight.size() )
+      {
+         ossim_float64 minLat = cutMinLat.toFloat64();
+         ossim_float64 minLon = cutMinLon.toFloat64();
+         ossim_float64 maxLat = cutMaxLat.toFloat64();
+         ossim_float64 maxLon = cutMaxLon.toFloat64();
+         ossim_float64 width  = cutWidth.toFloat64();
+         ossim_float64 height = cutHeight.toFloat64();
+         if ( !ossim::isnan(minLat) && !ossim::isnan(minLon) && !ossim::isnan(maxLat) &&
+              !ossim::isnan(maxLon) && !ossim::isnan(width) && !ossim::isnan(height) )
+         {
+            gsd.x = std::fabs( maxLon - minLon ) / width;
+            gsd.y = std::fabs( maxLat - minLat ) / height;
+
+            mapProj->setDecimalDegreesPerPixel(gsd);
+         }
+      }
+   }
+   else if(hasWmsBboxCutWidthHeight())
+   {
+      ossimString cutWidth;
+      ossimString cutHeight;
+      ossimString cutWmsBbox;
+
+      cutWidth.string()   = m_kwl->findKey( CUT_WIDTH_KW );
+      cutHeight.string()  = m_kwl->findKey( CUT_HEIGHT_KW );
+      cutWmsBbox.string() = m_kwl->findKey( CUT_WMS_BBOX_KW );
+
+      cutWmsBbox = cutWmsBbox.upcase().replaceAllThatMatch("BBOX:","");
+      std::vector<ossimString> cutBox = cutWmsBbox.split(",");
+      if(cutBox.size()==4)
+      {
+         ossim_float64 minx = cutBox[0].toFloat64();
+         ossim_float64 miny = cutBox[1].toFloat64();
+         ossim_float64 maxx = cutBox[2].toFloat64();
+         ossim_float64 maxy = cutBox[3].toFloat64();
+         ossim_float64 width  = cutWidth.toFloat64();
+         ossim_float64 height = cutHeight.toFloat64();
+         gsd.x = std::fabs( maxx - minx ) / width;
+         gsd.y = std::fabs( maxy - miny ) / height;
+
+         // bbox is in the units of the projector
+         if(mapProj->isGeographic())
+         {
+
+            mapProj->setDecimalDegreesPerPixel(gsd);
+         }
+         else
+         {
+            mapProj->setMetersPerPixel(gsd);
+         }
+      }
+      else
+      {
+         std::ostringstream errMsg;
+         errMsg << MODULE << " ERROR: cut box does not have 4 values!\n";
+         throw( ossimException( errMsg.str() ) );
+      }
+   }
+   else
+   {
+      if ( meters.size() && ( degreesX.size() || degreesY.size() ) )
+      {
+         std::ostringstream errMsg;
+         errMsg << MODULE << " ERROR: Ambiguous scale keywords!\n"
+                << "Do not combine meters with degrees.\n";
+         throw( ossimException( errMsg.str() ) );
+      }
+
+      if ( degreesX.size() )
+      {
+         // --degrees
+         gsd.x = degreesX.toFloat64();
+
+         if ( degreesY.size() )
+         {
+            gsd.y = degreesY.toFloat64();
+         }
+         if ( !gsd.hasNans() )
+         {
+            mapProj->setDecimalDegreesPerPixel(gsd);
+         }
+      }
+      else if ( meters.size() )
+      {
+         // --meters
+         gsd.x = meters.toFloat64();
+         gsd.y = gsd.x;
+         if ( !gsd.hasNans() )
+         {
+            mapProj->setMetersPerPixel(gsd);
+         }
+      }
+   }
+
+   if ( gsd.hasNans() )
+   {
+      // Get the best resolution from the inputs.
+      getMetersPerPixel(gsd);
+
+      // See if the output projection is geo-scaled; if so, make the pixels square in meters.
+      if ( getOutputProjectionType() == ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO_SCALED )
+      {
+         // Pick the best resolution and make them both the same.
+         gsd.x = ossim::min<ossim_float64>(gsd.x, gsd.y);
+         gsd.y = gsd.x;
+      }
+
+      // Set to input gsd.
+      mapProj->setMetersPerPixel(gsd);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "projection gsd: " << gsd << "\n" << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::getTiePoint(ossimGpt& tie)
+{
+   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimGpt&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
+
+   tie.lat = ossim::nan();
+   tie.lon = ossim::nan();
+   tie.hgt = 0.0;
+
+   // Loop through dem layers.
+   ossimGpt chainTiePoint;
+   chainIdx = m_demLayer.begin();
+   while ( chainIdx != m_demLayer.end() )
+   {
+      getTiePoint( (*chainIdx).get(), chainTiePoint );
+      if ( tie.hasNans() )
+      {
+         tie = chainTiePoint;
+      }
+      else
+      {
+         if ( chainTiePoint.lat > tie.lat )
+         {
+            tie.lat = chainTiePoint.lat;
+         }
+         if ( chainTiePoint.lon < tie.lon )
+         {
+            tie.lon = chainTiePoint.lon;
+         }
+      }
+      ++chainIdx;
+   }
+
+   // Loop through image layers.
+   chainIdx = m_imgLayer.begin();
+   while ( chainIdx != m_imgLayer.end() )
+   {
+      getTiePoint( (*chainIdx).get(), chainTiePoint );
+      if ( tie.hasNans() )
+      {
+         tie = chainTiePoint;
+      }
+      else
+      {
+         if ( chainTiePoint.lat > tie.lat )
+         {
+            tie.lat = chainTiePoint.lat;
+         }
+         if ( chainTiePoint.lon < tie.lon )
+         {
+            tie.lon = chainTiePoint.lon;
+         }
+      }
+      ++chainIdx;
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "tie point: " << tie << "\n" << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::getTiePoint(ossimSingleImageChain* chain, ossimGpt& tie)
+{
+   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimSingleImageChain*,ossimGpt&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   if (chain && m_geom.valid() )
+   {
+      //---
+      // The view is not set yet in the chain so we get the tie point from the
+      // image handler geometry not from the chain which will come from the
+      // ossimImageRenderer.
+      //---
+      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
+      if ( ih.valid() )
+      {
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if ( geom.valid() )
+         {
+            geom->getTiePoint( tie, true );
+         }
+
+
+         // Set height to 0.0 even though it's not used so hasNans test works.
+         tie.hgt = 0.0;
+
+         if ( tie.hasNans() )
+         {
+            std::string errMsg = MODULE;
+            errMsg += "\ngeom->localToWorld returned nan for chain.";
+            errMsg += "\nChain: ";
+            errMsg += chain->getFilename().string();
+            throw ossimException(errMsg);
+         }
+      }
+      else
+      {
+         std::string errMsg = MODULE;
+         errMsg += "\nNo geometry for chain: ";
+         errMsg += chain->getFilename().string();
+         throw ossimException(errMsg);
+      }
+   }
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR: Null chain passed to method!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "chain name: " << chain->getFilename()
+         << "\ntie point:  " << tie << "\n"
+         << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::getTiePoint(ossimDpt& tie)
+{
+   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimDpt&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
+
+   tie.makeNan();
+
+   // Loop through dem layers.
+   ossimDpt chainTiePoint;
+   chainIdx = m_demLayer.begin();
+   while ( chainIdx != m_demLayer.end() )
+   {
+      getTiePoint( (*chainIdx).get(), chainTiePoint );
+      if ( tie.hasNans() )
+      {
+         tie = chainTiePoint;
+      }
+      else
+      {
+         if ( chainTiePoint.y > tie.y )
+         {
+            tie.y = chainTiePoint.y;
+         }
+         if ( chainTiePoint.x < tie.x )
+         {
+            tie.x = chainTiePoint.x;
+         }
+      }
+      ++chainIdx;
+   }
+
+   // Loop through image layers.
+   chainIdx = m_imgLayer.begin();
+   while ( chainIdx != m_imgLayer.end() )
+   {
+      getTiePoint( (*chainIdx).get(), chainTiePoint );
+      if ( tie.hasNans() )
+      {
+         tie = chainTiePoint;
+      }
+      else
+      {
+         if ( chainTiePoint.y > tie.y )
+         {
+            tie.y = chainTiePoint.y;
+         }
+         if ( chainTiePoint.x < tie.x )
+         {
+            tie.x = chainTiePoint.x;
+         }
+      }
+      ++chainIdx;
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "tie point: " << tie << "\n" << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::getTiePoint(ossimSingleImageChain* chain, ossimDpt& tie)
+{
+   static const char MODULE[] = "ossimChipperUtil::getTiePoint(ossimSingleImageChain*,ossimDpt&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   if (chain && m_geom.valid() )
+   {
+      //---
+      // The view is not set yet in the chain so we get the tie point from the
+      // image handler geometry not from the chain which will come from the
+      // ossimImageRenderer.
+      //---
+      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
+      if ( ih.valid() )
+      {
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if ( geom.valid() )
+         {
+            geom->getTiePoint( tie, true );
+         }
+
+         if ( tie.hasNans() )
+         {
+            std::string errMsg = MODULE;
+            errMsg += "\ngeom->localToWorld returned nan for chain.";
+            errMsg += "\nChain: ";
+            errMsg += chain->getFilename().string();
+            throw ossimException(errMsg);
+         }
+      }
+      else
+      {
+         std::string errMsg = MODULE;
+         errMsg += "\nNo geometry for chain: ";
+         errMsg += chain->getFilename().string();
+         throw ossimException(errMsg);
+      }
+   }
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR: Null chain passed to method!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "chain name: " << chain->getFilename()
+         << "\ntie point:  " << tie << "\n"
+         << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::getMetersPerPixel(ossimDpt& gsd)
+{
+   static const char MODULE[] = "ossimChipperUtil::getMetersPerPixel(ossimDpt&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   gsd.makeNan();
+
+   ossimDpt chainGsd;
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
+
+   // Loop through dem layers.
+   chainIdx = m_demLayer.begin();
+   while ( chainIdx != m_demLayer.end() )
+   {
+      getMetersPerPixel( (*chainIdx).get(), chainGsd);
+      if ( gsd.hasNans() || ( chainGsd.x < gsd.x ) )
+      {
+         gsd = chainGsd;
+      }
+      ++chainIdx;
+   }
+
+   // Loop through image layers.
+   chainIdx = m_imgLayer.begin();
+   while ( chainIdx != m_imgLayer.end() )
+   {
+      getMetersPerPixel( (*chainIdx).get(), chainGsd);
+      if ( gsd.hasNans() || ( chainGsd.x < gsd.x ) )
+      {
+         gsd = chainGsd;
+      }
+      ++chainIdx;
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "gsd: " << gsd << "\n" << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::getMetersPerPixel(ossimSingleImageChain* chain, ossimDpt& gsd)
+{
+   static const char MODULE[] = "ossimChipperUtil::getMetersPerPixel(ossimSingleImageChain*,ossimDpt&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   if (chain)
+   {
+      ossimRefPtr<ossimImageGeometry> geom = chain->getImageGeometry();
+      if ( geom.valid() )
+      {
+         geom->getMetersPerPixel( gsd );
+         if ( gsd.hasNans() )
+         {
+            std::string errMsg = MODULE;
+            errMsg += "\ngeom->getMetersPerPixel returned nan for chain.";
+            errMsg += "\nChain: ";
+            errMsg += chain->getFilename().string();
+            throw ossimException(errMsg);
+         }
+      }
+      else
+      {
+         std::string errMsg = MODULE;
+         errMsg += "\nNo geometry for chain: ";
+         errMsg += chain->getFilename().string();
+         throw ossimException(errMsg);
+      }
+   }
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR: Null chain passed to method!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "chain name: " << chain->getFilename()
+         << "\nmeters per pixel: " << gsd << "\n" << MODULE << " exited...\n";
+   }
+}
+
+ossim_float64 ossimChipperUtil::getCentralMeridian() const
+{
+   ossim_float64 result = ossim::nan();
+   ossimString lookup = m_kwl->findKey( std::string(ossimKeywordNames::CENTRAL_MERIDIAN_KW) );
+   if ( lookup.size() )
+   {
+      result = lookup.toFloat64();
+      if ( (result < -180.0) || (result > 180.0) )
+      {
+         std::string errMsg = "central meridian range error!";
+         errMsg += " Valid range: -180 to 180";
+         throw ossimException(errMsg);
+      }
+   }
+   return result;
+}
+
+ossim_float64 ossimChipperUtil::getOriginLatitude() const
+{
+   ossim_float64 result = ossim::nan();
+   ossimString lookup = m_kwl->find(ossimKeywordNames::ORIGIN_LATITUDE_KW);
+   if ( lookup.size() )
+   {
+      result = lookup.toFloat64();
+      if ( (result < -90) || (result > 90.0) )
+      {
+         std::string errMsg = "origin latitude range error!";
+         errMsg += " Valid range: -90 to 90";
+         throw ossimException(errMsg);
+      }
+   }
+   return result;
+}
+
+void ossimChipperUtil::getSceneCenter(ossimGpt& gpt)
+{
+   static const char MODULE[] = "ossimChipperUtil::getSceneCenter(ossimGpt&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   std::vector<ossimGpt> centerGptArray;
+   ossimGpt centerGpt;
+
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
+
+   // Loop through dem layers.
+   chainIdx = m_demLayer.begin();
+   while ( chainIdx != m_demLayer.end() )
+   {
+      getSceneCenter( (*chainIdx).get(), centerGpt);
+      if ( !centerGpt.hasNans() )
+      {
+         centerGptArray.push_back( centerGpt );
+      }
+      ++chainIdx;
+   }
+
+   // Loop through image layers.
+   chainIdx = m_imgLayer.begin();
+   while ( chainIdx != m_imgLayer.end() )
+   {
+      getSceneCenter( (*chainIdx).get(), centerGpt);
+      if ( !centerGpt.hasNans() )
+      {
+         centerGptArray.push_back( centerGpt );
+      }
+      ++chainIdx;
+   }
+
+   ossim_float64 lat = 0.0;
+   ossim_float64 lon = 0.0;
+
+   std::vector<ossimGpt>::const_iterator pointIdx = centerGptArray.begin();
+   while ( pointIdx != centerGptArray.end() )
+   {
+      lat += (*pointIdx).lat;
+      lon += (*pointIdx).lon;
+      ++pointIdx;
+   }
+
+   lat /= centerGptArray.size();
+   lon /= centerGptArray.size();
+
+   if ( (lat >= -90.0) && (lat <= 90.0) && (lon >= -180.0) && (lon <= 180.0) )
+   {
+      gpt.lat = lat;
+      gpt.lon = lon;
+   }
+   else
+   {
+      std::ostringstream errMsg;
+      errMsg << MODULE << " range error!\nlatitude = "
+             << ossimString::toString(lat).string()
+             << "\nlongitude = "
+             << ossimString::toString(lon).string();
+      throw ossimException( errMsg.str() );
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "scene center: " << gpt << "\n" << MODULE << " exited...\n";
+   }
+}
+
+void ossimChipperUtil::getSceneCenter(ossimSingleImageChain* chain, ossimGpt& gpt)
+{
+   static const char MODULE[] =
+      "ossimChipperUtil::getSceneCenter(const ossimSingleImageChain*,ossimGpt&)";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   if (chain)
+   {
+      ossimRefPtr<ossimImageGeometry> geom = chain->getImageGeometry();
+      if ( geom.valid() )
+      {
+         ossimIrect boundingRect = chain->getBoundingRect();
+         ossimDpt midPoint = boundingRect.midPoint();
+         geom->localToWorld(midPoint, gpt);
+         gpt.hgt = 0.0;
+
+         if ( gpt.hasNans() )
+         {
+            std::string errMsg = MODULE;
+            errMsg += "\ngeom->localToWorld returned nan for chain.";
+            errMsg += "\nChain: ";
+            errMsg += chain->getFilename().string();
+            throw ossimException(errMsg);
+         }
+      }
+      else
+      {
+         std::string errMsg = MODULE;
+         errMsg += "\nNo geometry for chain: ";
+         errMsg += chain->getFilename().string();
+         throw ossimException(errMsg);
+      }
+   }
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR: Null chain passed to method!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "chain name: " << chain->getFilename()
+         << "\nscene center: " << gpt << "\n"
+         << MODULE << " exited...\n";
+   }
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipperUtil::getFirstInputProjection()
+{
+   static const char MODULE[] = "ossimChipperUtil::getFirstInputProjection";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimImageHandler>  ih     = 0;
+   ossimRefPtr<ossimMapProjection> result = 0;
+
+   // Get the first image handler.
+   if ( m_demLayer.size() )
+   {
+      ih = m_demLayer[0]->getImageHandler();
+   }
+   else if ( m_imgLayer.size() )
+   {
+      ih = m_imgLayer[0]->getImageHandler();
+   }
+
+   if ( ih.valid() )
+   {
+      // Get the geometry from the first image handler.
+      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+      if ( geom.valid() )
+      {
+         // Get the image projection.
+         ossimRefPtr<ossimProjection> proj = geom->getProjection();
+         if ( proj.valid() )
+         {
+            // Cast and assign to result.
+            ossimMapProjection* mapProj = PTR_CAST( ossimMapProjection, proj.get() );
+            if (mapProj)
+            {
+               // Must duplicate in case the output projection gets modified.
+               result = (ossimMapProjection*) mapProj->dup();
+            }
+            if ( !result.valid() && traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_WARN) << "Could not cast to map projection.\n";
+            }
+         }
+         else if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "No projection in first chain...\n";
+         }
+      }
+   }
+   else if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "No image handler in first chain...\n";
+   }
+
+   if ( traceDebug() )
+   {
+      if ( result.valid() )
+      {
+         result->print(ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewGeoProjection()
+{
+   return ossimRefPtr<ossimMapProjection>(new ossimEquDistCylProjection());
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewGeoScaledProjection()
+{
+   // Make projection:
+   ossimRefPtr<ossimMapProjection> result = getNewGeoProjection();
+
+   // Set the origin for scaling:
+
+   // First check for user set "central_meridian" and "origin_latitude":
+   ossimGpt origin;
+   origin.lat = getOriginLatitude();
+   origin.lon = getCentralMeridian();
+   origin.hgt = 0.0;
+
+   if ( origin.hasNans() )
+   {
+      // Use the scene center from the input.
+      getSceneCenter( origin );
+
+      //---
+      // Note only latitude used for scaling, origin kept at 0.0.
+      // This is a fix/hack for ossimEquDistCylProjection wrapping issues.
+      //---
+      origin.lon = 0.0;
+   }
+
+   if ( !origin.hasNans() )
+   {
+      result->setOrigin(origin);
+   }
+   else
+   {
+      std::string errMsg = "ossimChipperUtil::getNewGeoScaledProjection ERROR";
+      errMsg += "\nOrigin has nans!";
+      throw ossimException(errMsg);
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewProjectionFromSrsCode(
+   const std::string& code)
+{
+   ossimRefPtr<ossimMapProjection> result = 0;
+
+   ossimString os = code;
+   os.downcase();
+
+   if ( ( os == "epsg:4326" ) || ( code == "4326" ) )
+   {
+      // Avoid factory call for this.
+      result = new ossimEquDistCylProjection();
+   }
+   else
+   {
+      ossimRefPtr<ossimProjection> proj = ossimProjectionFactoryRegistry::instance()->
+         createProjection(code);
+      if ( proj.valid() )
+      {
+         result = PTR_CAST( ossimMapProjection, proj.get() );
+      }
+   }
+   return result;
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipperUtil::getNewUtmProjection()
+{
+   // Make projection:
+   ossimRefPtr<ossimUtmProjection> utm = new ossimUtmProjection;
+
+   // Set the zone from keyword option:
+   bool setZone = false;
+   ossim_int32 zone = getZone();
+   if ( (zone > 0 ) && ( zone < 61 ) )
+   {
+      utm->setZone( zone );
+      setZone = true;
+   }
+
+   // Set the hemisphere from keyword option:
+   bool setHemisphere = false;
+   std::string hemisphere = getHemisphere();
+   if ( hemisphere.size() )
+   {
+      ossimString h(hemisphere);
+      h.upcase();
+      if ( ( h == "N" ) || ( h == "NORTH" ) )
+      {
+         char c = 'N';
+         utm->setHemisphere( c );
+         setHemisphere = true;
+      }
+      if ( ( h == "S" ) || ( h == "SOUTH" ) )
+      {
+         char c = 'S';
+         utm->setHemisphere( c );
+         setHemisphere = true;
+      }
+   }
+
+   if ( !setZone || !setHemisphere )
+   {
+      // First check for user set "central_meridian" and "origin_latitude":
+      ossimGpt origin;
+      origin.lat = getOriginLatitude();
+      origin.lon = getCentralMeridian();
+      origin.hgt = 0.0;
+
+      if ( origin.hasNans() )
+      {
+         // Use the scene center from the input.
+         getSceneCenter( origin );
+      }
+
+      if ( !origin.hasNans() )
+      {
+         if ( !setZone )
+         {
+            utm->setZone(origin);
+         }
+         if ( !setHemisphere )
+         {
+            utm->setHemisphere(origin);
+         }
+      }
+      else
+      {
+         std::string errMsg = "ossimChipperUtil::getNewUtmProjection ERROR";
+         errMsg += "\nOrigin has nans!";
+         throw ossimException(errMsg);
+      }
+   }
+
+   return ossimRefPtr<ossimMapProjection>(utm.get());
+}
+
+ossimRefPtr<ossimMapProjection> ossimChipperUtil::getMapProjection()
+{
+   ossimRefPtr<ossimMapProjection> mp = 0;
+   if ( m_geom.valid() )
+   {
+      mp = dynamic_cast<ossimMapProjection*>( m_geom->getProjection() );
+   }
+   return mp;
+}
+
+ossimRefPtr<ossimImageFileWriter> ossimChipperUtil::createNewWriter() const
+{
+   static const char MODULE[] = "ossimChipperUtil::createNewWriter()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimFilename outputFile;
+   getOutputFilename(outputFile);
+
+   if ( outputFile == ossimFilename::NIL)
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR no output file name!";
+      throw ossimException(errMsg);
+   }
+
+   ossimRefPtr<ossimImageFileWriter> writer = 0;
+
+   ossimString lookup = m_kwl->findKey( WRITER_KW );
+   if ( lookup.size() )
+   {
+      writer = ossimImageWriterFactoryRegistry::instance()->createWriter( lookup );
+      if ( !writer.valid() )
+      {
+         std::string errMsg = MODULE;
+         errMsg += " ERROR creating writer: ";
+         errMsg += lookup.string();
+         throw ossimException(errMsg);
+      }
+   }
+   else // Create from output file extension.
+   {
+      writer = ossimImageWriterFactoryRegistry::instance()->
+         createWriterFromExtension( outputFile.ext() );
+
+      if ( !writer.valid() )
+      {
+         std::string errMsg = MODULE;
+         errMsg += " ERROR creating writer from extension: ";
+         errMsg += outputFile.ext().string();
+         throw ossimException(errMsg);
+      }
+   }
+
+   // Set the output name.
+   writer->setFilename( outputFile );
+
+   // Add any writer props.
+   ossim_uint32 count = m_kwl->numberOf( WRITER_PROPERTY_KW.c_str() );
+   for (ossim_uint32 i = 0; i < count; ++i)
+   {
+      ossimString key = WRITER_PROPERTY_KW;
+      key += ossimString::toString(i);
+      lookup = m_kwl->findKey( key.string() );
+      if ( lookup.size() )
+      {
+         std::vector<ossimString> splitArray;
+         lookup.split(splitArray, "=");
+         if(splitArray.size() == 2)
+         {
+            ossimRefPtr<ossimProperty> prop =
+               new ossimStringProperty(splitArray[0], splitArray[1]);
+
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "Setting writer prop: " << splitArray[0] << "=" << splitArray[1] << "\n";
+            }
+
+            writer->setProperty( prop );
+         }
+      }
+   }
+
+   // Output tile size:
+   lookup = m_kwl->findKey( TILE_SIZE_KW );
+   if ( lookup.size() )
+   {
+      ossimIpt tileSize;
+      tileSize.x = lookup.toInt32();
+      if ( (tileSize.x % 16) == 0 )
+      {
+         tileSize.y = tileSize.x;
+         writer->setTileSize( tileSize );
+      }
+      else if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << MODULE << " NOTICE:"
+            << "\nTile width must be a multiple of 16! Using default.."
+            << std::endl;
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "writer name: " << writer->getClassName() << "\n"
+         << MODULE << " exited...\n";
+   }
+
+   return writer;
+}
+
+void ossimChipperUtil::propagateOutputProjectionToChains()
+{
+   static const char MODULE[] = "ossimChipperUtil::propagateOutputProjectionToChains()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx;
+
+   // we need to make sure the outputs are refreshed so they can reset themselves
+   // Needed when we are doing interactive update to the GSD and clip window
+   ossimRefPtr<ossimRefreshEvent> refreshEvent = new ossimRefreshEvent();
+   ossimEventVisitor eventVisitor(refreshEvent.get());
+   ossimViewInterfaceVisitor viewVisitor(m_geom.get());
+   // Loop through dem layers.
+   chainIdx = m_demLayer.begin();
+   while ( chainIdx != m_demLayer.end() )
+   {
+      viewVisitor.reset();
+      eventVisitor.reset();
+      (*chainIdx)->accept(viewVisitor);
+      (*chainIdx)->accept(eventVisitor);
+
+      ossimRefPtr<ossimImageRenderer> resampler = (*chainIdx)->getImageRenderer();
+      if ( resampler.valid() )
+      {
+         //resampler->setView( m_geom.get() );
+         // resampler->propagateEventToOutputs(refreshEvent);
+      }
+      else
+      {
+         std::string errMsg = MODULE;
+         errMsg += " chain has no resampler!";
+         throw( ossimException(errMsg) );
+      }
+      ++chainIdx;
+   }
+
+   // Loop through image layers.
+   chainIdx = m_imgLayer.begin();
+   while ( chainIdx != m_imgLayer.end() )
+   {
+      ossimRefPtr<ossimImageRenderer> resampler = (*chainIdx)->getImageRenderer();
+      eventVisitor.reset();
+      viewVisitor.reset();
+      (*chainIdx)->accept(viewVisitor);
+      (*chainIdx)->accept(eventVisitor);
+
+      if ( resampler.valid() )
+      {
+         //resampler->setView( m_geom.get() );
+         //resampler->propagateEventToOutputs(refreshEvent);
+      }
+      else
+      {
+         std::string errMsg = MODULE;
+         errMsg += " chain has no resampler!";
+         throw( ossimException(errMsg) );
+      }
+      ++chainIdx;
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::combineLayers(
+   std::vector< ossimRefPtr<ossimSingleImageChain> >& layers) const
+{
+   static const char MODULE[] = "ossimChipperUtil::combineLayers(layers)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimImageSource> result = 0;
+
+   if ( layers.size() == 1 )
+   {
+      result = layers[0].get();
+   }
+   else if ( layers.size() > 1 )
+   {
+
+      result = createCombiner();//new ossimImageMosaic;
+
+      std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx = layers.begin();
+      while ( chainIdx != layers.end() )
+      {
+         result->connectMyInputTo( (*chainIdx).get() );
+         ++chainIdx;
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::combineLayers()
+{
+   static const char MODULE[] = "ossimChipperUtil::combineLayers()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimImageSource> result = 0;
+
+   ossim_uint32 layerCount = (ossim_uint32) (m_demLayer.size() + m_imgLayer.size());
+
+   if ( layerCount )
+   {
+      if ( layerCount == 1 )
+      {
+         if ( m_imgLayer.size() )
+         {
+            result = m_imgLayer[0].get();
+         }
+         else
+         {
+            result = m_demLayer[0].get();
+         }
+      }
+      else
+      {
+         result = createCombiner();//new ossimImageMosaic;
+
+         // Combine the images.  Note we'll put the images on top of the dems.
+         if ( m_imgLayer.size() )
+         {
+            std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx =
+               m_imgLayer.begin();
+            while ( chainIdx !=  m_imgLayer.end() )
+            {
+               result->connectMyInputTo( (*chainIdx).get() );
+               ++chainIdx;
+            }
+         }
+         if ( m_demLayer.size() ) // Combine any dem layers.
+         {
+            std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx =
+               m_demLayer.begin();
+            while ( chainIdx != m_demLayer.end() )
+            {
+               result->connectMyInputTo( (*chainIdx).get() );
+               ++chainIdx;
+            }
+         }
+      }
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return result;
+
+} // End: ossimChipperUtil::combineLayers
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::initialize2CmvChain()
+{
+   ossimRefPtr<ossimImageSource> result = 0;
+
+   ossim_uint32 layerCount = (ossim_uint32) (m_demLayer.size() + m_imgLayer.size());
+
+   // Must have two and only two inputs.
+   if ( layerCount == 2 )
+   {
+      ossimRefPtr<ossimConnectableObject> oldImg = 0;
+      ossimRefPtr<ossimConnectableObject> newImg = 0;
+
+      //---
+      // Expecting two image layers.  We'll code it for flexabilty though...
+      // - Take old and new from m_imgLayer if present.
+      // - Use m_demLayer only if missing.
+      // - Using first image found as old, second new.
+      //---
+
+      // Most likely case, two image layers.
+      if ( m_imgLayer.size() )
+      {
+         oldImg = m_imgLayer[0].get();
+
+         if ( m_imgLayer.size() == 2 )
+         {
+            newImg = m_imgLayer[1].get();
+         }
+      }
+
+      if ( m_demLayer.size() )
+      {
+         if ( !oldImg.valid() )
+         {
+            oldImg = m_demLayer[0].get();
+         }
+
+         if ( !newImg.valid() )
+         {
+            if ( m_demLayer.size() == 1 )
+            {
+               newImg = m_demLayer[0].get();
+            }
+            else if ( m_demLayer.size() == 2 )
+            {
+               newImg = m_demLayer[1].get();
+            }
+         }
+      }
+
+      if ( newImg.valid() && oldImg.valid() )
+      {
+         // Input 0 is old, 1 is new.
+         ossimRefPtr<ossimTwoColorView> tcmv = new ossimTwoColorView;
+         tcmv->connectMyInputTo( 0, oldImg.get() );
+         tcmv->connectMyInputTo( 1, newImg.get() );
+
+         // Look for 2cmv options.
+         ossim_uint32 oldInputBandIndex = 0;
+         ossim_uint32 newInputBandIndex = 0;
+         ossimTwoColorView::ossimTwoColorMultiViewOutputSource redOutputSource =
+            ossimTwoColorView::OLD;
+         ossimTwoColorView::ossimTwoColorMultiViewOutputSource grnOutputSource =
+            ossimTwoColorView::NEW;
+         ossimTwoColorView::ossimTwoColorMultiViewOutputSource bluOutputSource =
+            ossimTwoColorView::NEW;
+
+         ossimString os;
+         std::string key = TWOCMV_OLD_INPUT_BAND_KW;
+         std::string val = m_kwl->findKey( key );
+
+         if ( val.size() )
+         {
+            os = val;
+            oldInputBandIndex = os.toUInt32();
+         }
+
+         key = TWOCMV_NEW_INPUT_BAND_KW;
+         val = m_kwl->findKey( key );
+         if ( val.size() )
+         {
+            os = val;
+            newInputBandIndex = os.toUInt32();
+         }
+
+         key = TWOCMV_RED_OUTPUT_SOURCE_KW;
+         val = m_kwl->findKey( key );
+         if ( val.size() )
+         {
+            os = val;
+            os.downcase();
+
+            if ( os == "new" )
+            {
+               redOutputSource = ossimTwoColorView::NEW;
+            }
+            else if ( os == "MIN" )
+            {
+               redOutputSource = ossimTwoColorView::MIN;
+            }
+         }
+
+         key = TWOCMV_GREEN_OUTPUT_SOURCE_KW;
+         val = m_kwl->findKey( key );
+         if ( val.size() )
+         {
+            os = val;
+            os.downcase();
+
+            if ( os == "old" )
+            {
+               grnOutputSource = ossimTwoColorView::OLD;
+            }
+            else if ( os == "MIN" )
+            {
+               grnOutputSource = ossimTwoColorView::MIN;
+            }
+         }
+
+         key = TWOCMV_BLUE_OUTPUT_SOURCE_KW;
+         val = m_kwl->findKey( key );
+         if ( val.size() )
+         {
+            os = val;
+            os.downcase();
+
+            if ( os == "old" )
+            {
+               bluOutputSource = ossimTwoColorView::OLD;
+            }
+            else if ( os == "MIN" )
+            {
+               bluOutputSource = ossimTwoColorView::MIN;
+            }
+         }
+
+         // Set options.
+         tcmv->setBandIndexMapping( oldInputBandIndex,
+                                    newInputBandIndex,
+                                    redOutputSource,
+                                    grnOutputSource,
+                                    bluOutputSource );
+         tcmv->initialize();
+
+         result = tcmv.get();
+      }
+   }
+
+   return result;
+
+} // ossimChipperUtil::initialize2CmvChain()
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::addIndexToRgbLutFilter(
+   ossimRefPtr<ossimImageSource> &source) const
+{
+   static const char MODULE[] = "ossimChipperUtil::addIndexToRgbLutFilter(source)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimImageSource> result = 0;
+
+   if ( source.valid() )
+   {
+      ossimRefPtr<ossimIndexToRgbLutFilter> lut = new ossimIndexToRgbLutFilter();
+      ossimFilename lutFile;
+      lutFile.string() = m_kwl->findKey( LUT_FILE_KW );
+      if ( lutFile.exists() )
+      {
+         //---
+         // Connect to dems:
+         // Must do this first so that the min and max get set from the input
+         // connection prior to initializing the lut.
+         //---
+         lut->connectMyInputTo( source.get() );
+
+         // Note sure about this.  Make option maybe? (drb)
+         lut->setMode(ossimIndexToRgbLutFilter::REGULAR);
+
+         lut->setLut(lutFile);
+
+         // Set as color source for bump shade.
+         result = lut.get();
+      }
+      else
+      {
+         std::string errMsg = MODULE;
+         errMsg += " color table does not exists: ";
+         errMsg += lutFile.string();
+         throw ossimException(errMsg);
+      }
+   }
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR: Null source passed to method!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::addScalarRemapper(
+   ossimRefPtr<ossimImageSource> &source, ossimScalarType scalar) const
+{
+   static const char MODULE[] = "ossimChipperUtil::addScalarRemapper(source)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimImageSource> result = 0;
+
+   if ( source.valid() )
+   {
+      if ( ( scalar != OSSIM_SCALAR_UNKNOWN ) && ( source->getOutputScalarType() != scalar ) )
+      {
+         ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper();
+         remapper->setOutputScalarType(scalar);
+         remapper->connectMyInputTo( source.get() );
+         result = remapper.get();
+
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "\nOutput remapped to: "
+               << ossimScalarTypeLut::instance()->getEntryString(scalar) << "\n";
+         }
+      }
+      else
+      {
+         result = source;
+      }
+   }
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR: Null source passed to method!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exited...\n";
+   }
+
+   return result;
+}
+
+ossimRefPtr<ossimImageSource> ossimChipperUtil::addAnnotations(
+   ossimRefPtr<ossimImageSource>& source ) const
+{
+   static const char MODULE[] = "ossimChipperUtil::addAnnotations(source)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   ossimRefPtr<ossimImageSource> result = 0;
+
+   if ( source.valid() & m_geom.valid() )
+   {
+      ossimString regularExpression = "annotation[0-9]*\\.type";
+      const ossim_uint32 COUNT = m_kwl->getNumberOfKeysThatMatch( regularExpression );
+      if ( COUNT > 0 )
+      {
+         // Create annotator:
+         ossimRefPtr<ossimAnnotationSource> annotator = new ossimAnnotationSource();
+
+         // Connect it up:
+         annotator->connectMyInputTo( source.get() );
+
+         // Loop through keyword list and add all annotation objects.
+         ossim_uint32 i = 0;
+         ossim_uint32 found = 0;
+         std::string prefixBase = "annotation";
+         std::string prefix;
+         std::string key;
+         std::string value;
+         while ( (found < COUNT) && ( i < (COUNT+100) ) )
+         {
+            prefix = prefixBase + ossimString::toString( i ).string() + ".";
+            key = "type";
+            value = m_kwl->findKey( prefix, key );
+            if ( value.size() )
+            {
+               ++found;
+
+               if ( value == "cross_hair" )
+               {
+                  addCrossHairAnnotation( annotator, prefix );
+               }
+            }
+            ++i;
+         }
+
+         annotator->initialize();
+
+         // Assign return result:
+         result = annotator.get();
+      }
+   }
+   else
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR: Null source passed to method!";
+      throw ossimException(errMsg);
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return result;
+}
+
+void ossimChipperUtil::addCrossHairAnnotation(
+   ossimRefPtr<ossimAnnotationSource> annotator, const std::string& prefix ) const
+{
+   if ( annotator.valid() && prefix.size() )
+   {
+      std::string linePrefix = prefix + std::string("line.");
+      std::string textPrefix = prefix + std::string("text.");
+      ossimDpt centerPt;
+      centerPt.makeNan();
+      ossim_float64 lineSize = 8.0;
+      ossimDpt start;
+      ossimDpt end;
+
+      // Cross hair line location:
+      std::string key = "location";
+      std::string value = m_kwl->findKey( linePrefix, key );
+      if ( value.size() )
+      {
+         if (value == "scene_center")
+         {
+            ossimIrect boundingRect = annotator->getBoundingRect( 0 );
+            centerPt = boundingRect.midPoint();
+         }
+      }
+      else
+      {
+         key = "location.gpt";
+         value = m_kwl->findKey( linePrefix, key );
+         if ( value.size() )
+         {
+            ossimGpt gpt;
+            gpt.toPoint( value );
+            if ( gpt.hasNans() == false )
+            {
+               // Convert to view coordinate.
+               ossimDpt imgPt;
+               m_geom->worldToLocal( gpt, imgPt );
+               if ( m_ivt.valid() )
+               {
+                  m_ivt->imageToView( imgPt, centerPt );
+               }
+               else
+               {
+                  centerPt = imgPt;
+               }
+            }
+         }
+      }
+
+      if ( centerPt.hasNans() == false )
+      {
+         // Cross hair size:
+         key = "size";
+         value = m_kwl->findKey( linePrefix, key );
+         if ( value.size() )
+         {
+            lineSize = ossimString::toInt32( ossimString(value) );
+         }
+         ossim_float64 halfLine = lineSize/2.0;
+
+         // Create lines.
+         ossimRefPtr<ossimAnnotationLineObject> line1 = new ossimAnnotationLineObject();
+
+         // Pick up r,g,b,thickness.
+         line1->loadState( *(m_kwl.get()), linePrefix.c_str() );
+
+         start.x = centerPt.x;
+         start.y = centerPt.y-halfLine;
+         end.x   = centerPt.x;
+         end.y   = centerPt.y+halfLine;
+
+         // ossimAnnotationLineObject::setLine recomputes the bounding box.
+         line1->setLine( start, end );
+
+         annotator->addObject( line1.get() );
+
+         ossimRefPtr<ossimAnnotationLineObject> line2 = new ossimAnnotationLineObject();
+
+         // This will pick up r,g,b,thickness.
+         line2->loadState( *(m_kwl.get()), linePrefix.c_str() );
+
+         start.x = centerPt.x-halfLine;
+         start.y = centerPt.y;
+         end.x   = centerPt.x+halfLine;
+         end.y   = centerPt.y;
+
+         // ossimAnnotationLineObject::setLine recomputes the bounding box.
+         line2->setLine( start, end );
+
+         annotator->addObject( line2.get() );
+
+         // Set text if any:
+         key = "string";
+         value = m_kwl->findKey( textPrefix, key );
+         if ( value.size() )
+         {
+            ossimRefPtr<ossimAnnotationFontObject> text = new ossimAnnotationFontObject();
+            text->loadState( *(m_kwl.get()), textPrefix.c_str() );
+
+            text->setString( ossimString(value) );
+
+            // text scale:
+            key = "scale";
+            value = m_kwl->findKey( textPrefix, key );
+            if ( value.size() )
+            {
+               ossimDpt scale;
+               scale.toPoint( value );
+               text->setScale( scale );
+            }
+
+            // text point size:
+            key = "point_size";
+            value = m_kwl->findKey( textPrefix, key );
+            if ( value.size() )
+            {
+               ossimIpt ptSize;
+               ptSize.toPoint( value );
+               text->setPointSize( ptSize );
+            }
+
+            // text location:
+            key = "location";
+            value = m_kwl->findKey( textPrefix, key );
+            if ( value.size() )
+            {
+               if ( value == "bottom" )
+               {
+                  ossimIpt ipt;
+                  ipt.x = (ossim_int32)centerPt.x;
+                  ipt.y = (ossim_int32)(centerPt.y+halfLine+10);
+                  text->setUpperLeftPosition( ipt );
+
+                  ossimDrect rect;
+                  text->getBoundingRect( rect );
+                  ipt.x = ipt.x - rect.width()/2;
+                  text->setUpperLeftPosition( ipt );
+               }
+            }
+
+            annotator->addObject( text.get() );
+         }
+      }
+   }
+
+} // End: ossimChipperUtil::addCrossHairAnnotations( ... )
+
+bool ossimChipperUtil::setupChainHistogram( ossimRefPtr<ossimSingleImageChain>& chain) const
+{
+   static const char MODULE[] = "ossimChipperUtil::setupChainHistogram(chain)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   bool result = false;
+
+   ossimHistogramRemapper::StretchMode mode =
+      (ossimHistogramRemapper::StretchMode)getHistoMode();
+
+   if ( chain.valid() )
+   {
+      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
+      ossimRefPtr<ossimHistogramRemapper> remapper = chain->getHistogramRemapper();
+
+      if ( ih.valid() && remapper.valid() &&
+           ( mode != ossimHistogramRemapper::STRETCH_UNKNOWN ) )
+      {
+         result = true;
+         ossimString histCenterKw = m_kwl->findKey(HIST_CENTER_KW);
+         if(histCenterKw.empty())
+         {
+           histCenterKw = "false";
+         }
+         bool roiStretch = ( m_kwl->hasKey( HIST_AOI_KW ) || m_kwl->hasKey( HIST_LLWH_KW ) ||
+                             histCenterKw.toBool() );
+
+         if ( !roiStretch )
+         {
+            bool openedHistogram = false;
+            if ( remapper->getHistogramFile() == ossimFilename::NIL )
+            {
+               // Open histogram file.
+               ossimFilename f = ih->getFilenameWithThisExtension( ossimString("his") );
+               if ( f.empty() || (f.exists() == false) )
+               {
+                  // For backward compatibility check if single entry and _e0.his
+                  f = ih->getFilenameWithThisExtension( ossimString("his"), true );
+               }
+
+               if ( f.exists() )
+               {
+                  openedHistogram = remapper->openHistogram( f );
+                  if ( !openedHistogram && traceDebug() )
+                  {
+                     ossimNotify(ossimNotifyLevel_WARN)
+                        << MODULE << " WARNING:"
+                        << "\nCould not open:  " << f << "\n";
+                  }
+               }
+
+               if ( !openedHistogram )
+               {
+                  //---
+                  // User requested a histogram operation but does not have
+                  // external histogram file. This will cause downstream code
+                  // to computer from center tile of image.
+                  //---
+                  roiStretch = true;
+               }
+            }
+         }
+
+         // Enable and set mode:
+         remapper->setEnableFlag(true);
+         remapper->setStretchMode( mode );
+         
+         if ( roiStretch )
+         {
+            ossimIrect aoi;
+
+            std::string value =  m_kwl->findKey( HIST_AOI_KW );
+            if ( value.size() )
+            {
+               result = getIrect( value, aoi );
+            }
+            else
+            {
+               value =  m_kwl->findKey( HIST_LLWH_KW );
+               if ( value.size() )
+               {
+                  result = getIrect( chain, value, aoi );
+               }
+               else //  Use center of image.
+               {
+                  result = getIrect( chain, aoi );
+               }
+            }
+
+            if ( traceDebug() )
+            {
+               ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "ROI of histogram: " << aoi << std::endl;
+            }
+
+            if ( result )
+            {
+               //---
+               // Note: both of these sections work.
+               // Going with separate connection for now. drb - 20 Feb. 2016
+               //---
+#if 1
+               ossimRefPtr<ossimImageHistogramSource> ihist =
+                  new ossimImageHistogramSource();
+               ihist->setAreaOfInterest( aoi );
+               ihist->connectMyInputTo( remapper->getInput() );//ih.get());
+               remapper->connectMyInputTo( ihist.get() );
+#else
+               remapper->computeHistogram( aoi );
+#endif
+            }
+         }
+
+         if ( !result )
+         {
+            remapper->setEnableFlag(false);
+         }
+
+      } // Matches: if ( ih.valid() && remapper.valid() && mode... )
+
+   } // Matches: if ( chain.valid() )
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+
+   return result;
+}
+
+bool ossimChipperUtil::setChainEntry(
+   ossimRefPtr<ossimSingleImageChain>& chain, ossim_uint32 entryIndex ) const
+{
+   bool result = false;
+   if ( chain.valid() )
+   {
+      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
+      if ( ih.valid() )
+      {
+         result = ih->setCurrentEntry( entryIndex );
+      }
+   }
+   return result;
+}
+
+void ossimChipperUtil::getOutputFilename(ossimFilename& f) const
+{
+   f.string() = m_kwl->findKey( std::string(ossimKeywordNames::OUTPUT_FILE_KW) );
+}
+
+void ossimChipperUtil::getAreaOfInterest(ossimImageSource* source, ossimIrect& rect) const
+{
+   static const char MODULE[] = "ossimChipperUtil::getAreaOfInterest()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " entered...\n";
+   }
+
+   // Nan rect for starters.
+   rect.makeNan();
+
+   if ( source )
+   {
+      source->initialize(); // Ensure all bounding rectangles are set.
+      
+      if (  m_kwl->hasKey( CUT_BBOX_XYWH_KW ) )
+      {
+         // <x>,<y>,<w>,<h>
+         std::string cutBbox = m_kwl->findKey( CUT_BBOX_XYWH_KW );
+         getIrect( cutBbox, rect );
+      }
+
+      if ( rect.hasNans() )
+      {
+         if ( m_geom.valid() )
+         {
+            if ( m_kwl->find( CUT_CENTER_LAT_KW.c_str() ) )
+            {
+               // "Cut Center" with: --cut-center-llwh or --cut-center-llr:
+
+               ossimString latStr = m_kwl->findKey( CUT_CENTER_LAT_KW );
+               ossimString lonStr = m_kwl->findKey( CUT_CENTER_LON_KW );
+               if ( latStr.size() && lonStr.size() )
+               {
+                  ossimGpt centerGpt;
+
+                  //---
+                  // Want the height nan going into worldToLocal call so it gets picked
+                  // up by the elevation manager.
+                  //---
+                  centerGpt.makeNan();
+
+                  centerGpt.lat = latStr.toFloat64();
+                  centerGpt.lon = lonStr.toFloat64();
+
+                  if ( !centerGpt.isLatNan() && !centerGpt.isLonNan() )
+                  {
+                     // Ground "cut center" to view:
+                     ossimDpt centerDpt(0.0, 0.0);
+                     m_geom->worldToLocal(centerGpt, centerDpt);
+
+                     if ( !centerDpt.hasNans() )
+                     {
+                        if ( isChipMode() && m_ivt.valid() ) // Chipping in image space.
+                        {
+                           // Tranform image center point to view:
+                           ossimDpt ipt = centerDpt;
+                           m_ivt->imageToView( ipt, centerDpt );
+                        }
+
+                        // --cut-center-llwh:
+                        ossimString widthStr  = m_kwl->findKey( CUT_WIDTH_KW );
+                        ossimString heightStr = m_kwl->findKey( CUT_HEIGHT_KW );
+                        if ( widthStr.size() && heightStr.size() )
+                        {
+                           ossim_int32 width  = widthStr.toInt32();
+                           ossim_int32 height = heightStr.toInt32();
+                           if ( width && height )
+                           {
+                              ossimIpt ul( ossim::round<int>(centerDpt.x - (width/2)),
+                                           ossim::round<int>(centerDpt.y - (height/2)) );
+                              ossimIpt lr( (ul.x + width - 1), ul.y + height - 1);
+                              rect = ossimIrect(ul, lr);
+                           }
+                        }
+                        else // --cut-center-llr:
+                        {
+                           ossimString radiusStr = m_kwl->findKey( CUT_RADIUS_KW );
+                           if ( radiusStr.size() )
+                           {
+                              ossim_float64 radius = radiusStr.toFloat64();
+                              if ( radius )
+                              {
+                                 ossimDpt mpp;
+                                 m_geom->getMetersPerPixel( mpp );
+
+                                 if ( !mpp.hasNans() )
+                                 {
+                                    ossim_float64 rx = radius/mpp.x;
+                                    ossim_float64 ry = radius/mpp.y;
+
+                                    ossimIpt ul( ossim::round<int>( centerDpt.x - rx ),
+                                                 ossim::round<int>( centerDpt.y - ry ) );
+                                    ossimIpt lr( ossim::round<int>( centerDpt.x + rx ),
+                                                 ossim::round<int>( centerDpt.y + ry ) );
+                                    rect = ossimIrect(ul, lr);
+                                 }
+                              }
+                           }
+                        }
+                     }
+
+                  } // Matches: if ( !centerGpt.hasNans() )
+
+               } // Matches: if ( latStr && lonStr )
+
+            } // Matches: if ( m_kwl->find( CUT_CENTER_LAT_KW ) )
+
+            else if ( (m_kwl->find( CUT_MAX_LAT_KW.c_str() ) ||
+                       (m_kwl->find( CUT_WMS_BBOX_LL_KW.c_str() ))))
+            {
+               ossimString maxLat;
+               ossimString maxLon;
+               ossimString minLat;
+               ossimString minLon;
+
+               // --cut-bbox-ll or --cut-bbox-llwh
+               if(m_kwl->find( CUT_MAX_LAT_KW.c_str() ))
+               {
+                  maxLat = m_kwl->findKey( CUT_MAX_LAT_KW );
+                  maxLon = m_kwl->findKey( CUT_MAX_LON_KW );
+                  minLat = m_kwl->findKey( CUT_MIN_LAT_KW );
+                  minLon = m_kwl->findKey( CUT_MIN_LON_KW );
+               }
+               else
+               {
+                  ossimString cutBbox = m_kwl->findKey( CUT_WMS_BBOX_LL_KW );
+
+                  cutBbox = cutBbox.upcase().replaceAllThatMatch("BBOX:");
+                  std::vector<ossimString> cutBox = cutBbox.split(",");
+                  if(cutBox.size() >3)
+                  {
+                     minLon = cutBox[0];
+                     minLat = cutBox[1];
+                     maxLon = cutBox[2];
+                     maxLat = cutBox[3];
+                  }
+               }
+
+               if ( maxLat.size() && maxLon.size() && minLat.size() && minLon.size() )
+               {
+                  ossim_float64 minLatF = minLat.toFloat64();
+                  ossim_float64 maxLatF = maxLat.toFloat64();
+                  ossim_float64 minLonF = minLon.toFloat64();
+                  ossim_float64 maxLonF = maxLon.toFloat64();
+
+                  //---
+                  // Check for swap so we don't get a negative height.
+                  // Note no swap check for longitude as box could cross date line.
+                  //---
+                  if ( minLatF > maxLatF )
+                  {
+                     ossim_float64 tmpF = minLatF;
+                     minLatF = maxLatF;
+                     maxLatF = tmpF;
+                  }
+
+                  //---
+                  // Assume cut box is edge to edge or "Pixel Is Area". Our
+                  // AOI(area of interest) uses center of pixel or "Pixel Is Point"
+                  // so get the degrees per pixel and shift AOI to center.
+                  //---
+                  ossimDpt halfDpp;
+                  m_geom->getDegreesPerPixel( halfDpp );
+                  halfDpp = halfDpp/2.0;
+
+                  ossimGpt gpt(0.0, 0.0, 0.0);
+                  ossimDpt ulPt;
+                  ossimDpt lrPt;
+
+                  // Upper left:
+                  gpt.lat = maxLatF - halfDpp.y;
+                  gpt.lon = minLonF + halfDpp.x;
+                  m_geom->worldToLocal(gpt, ulPt);
+
+                  // Lower right:
+                  gpt.lat = minLatF + halfDpp.y;
+                  gpt.lon = maxLonF - halfDpp.x;
+                  m_geom->worldToLocal(gpt, lrPt);
+
+                  if ( isChipMode() && m_ivt.valid() )
+                  {
+                     // Chipping in image space:
+
+                     // Tranform image ul point to view:
+                     ossimDpt ipt = ulPt;
+                     m_ivt->imageToView( ipt, ulPt );
+
+                     // Tranform image lr point to view:
+                     ipt = lrPt;
+                     m_ivt->imageToView( ipt, lrPt );
+                  }
+
+                  rect = ossimIrect( ossimIpt(ulPt), ossimIpt(lrPt) );
+               }
+            }
+            else if ( m_kwl->find( CUT_WMS_BBOX_KW.c_str() ) )
+            {
+               ossimString cutBbox = m_kwl->findKey( CUT_WMS_BBOX_KW );
+
+               cutBbox = cutBbox.upcase().replaceAllThatMatch("BBOX:");
+               std::vector<ossimString> cutBox = cutBbox.split(",");
+               if(cutBox.size()==4)
+               {
+
+                  ossim_float64 minx=cutBox[0].toFloat64();
+                  ossim_float64 miny=cutBox[1].toFloat64();
+                  ossim_float64 maxx=cutBox[2].toFloat64();
+                  ossim_float64 maxy=cutBox[3].toFloat64();
+
+                  const ossimMapProjection* mapProj = m_geom->getAsMapProjection();
+                  if(mapProj)
+                  {
+                     std::vector<ossimDpt> pts(4);
+                     ossimDpt* ptsArray = &pts.front();
+                     if(mapProj->isGeographic())
+                     {
+                        ossimDpt halfDpp;
+                        m_geom->getDegreesPerPixel( halfDpp );
+                        halfDpp = halfDpp/2.0;
+
+                        ossimGpt gpt(0.0, 0.0, 0.0);
+                        ossimDpt ulPt;
+                        ossimDpt lrPt;
+
+                        // Upper left:
+                        gpt.lat = maxy - halfDpp.y;
+                        gpt.lon = minx + halfDpp.x;
+                        m_geom->worldToLocal(gpt, ptsArray[0]);
+                        // Upper right:
+                        gpt.lat = maxy - halfDpp.y;
+                        gpt.lon = maxx - halfDpp.x;
+                        m_geom->worldToLocal(gpt, ptsArray[1]);
+
+                        // Lower right:
+                        gpt.lat = miny + halfDpp.y;
+                        gpt.lon = maxx - halfDpp.x;
+                        m_geom->worldToLocal(gpt, ptsArray[2]);
+
+                        //Lower left
+                        gpt.lat = miny + halfDpp.y;
+                        gpt.lon = minx + halfDpp.x;
+                        m_geom->worldToLocal(gpt, ptsArray[3]);
+                        //m_geom->worldToLocal(ossimGpt(miny,minx), ptsArray[0]);
+                        //m_geom->worldToLocal(ossimGpt(maxy,minx), ptsArray[1]);
+                        //m_geom->worldToLocal(ossimGpt(maxy,maxx), ptsArray[2]);
+                        //m_geom->worldToLocal(ossimGpt(miny,maxx), ptsArray[3]);
+
+                     }
+                     else
+                     {
+                        ossimDpt halfMpp;
+                        ossimDpt eastingNorthing;
+                        m_geom->getMetersPerPixel( halfMpp );
+                        halfMpp = halfMpp/2.0;
+
+                        eastingNorthing.x = minx+halfMpp.x;
+                        eastingNorthing.y = miny+halfMpp.y;
+                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[0]);
+                        eastingNorthing.x = minx+halfMpp.x;
+                        eastingNorthing.y = maxy-halfMpp.y;
+                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[1]);
+                        eastingNorthing.x = maxx-halfMpp.x;
+                        eastingNorthing.y = maxy-halfMpp.y;
+                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[2]);
+                        eastingNorthing.x = maxx-halfMpp.x;
+                        eastingNorthing.y = miny+halfMpp.y;
+                        mapProj->eastingNorthingToLineSample(eastingNorthing, ptsArray[3]);
+                     }
+                     rect = ossimIrect(pts);
+                  }
+               }
+            }
+
+            // If no user defined rect set to scene bounding rect.
+            if ( rect.hasNans() )
+            {
+               // Get the rectangle from the input chain:
+               rect = source->getBoundingRect(0);
+            }
+
+         } // if ( m_getOutputGeometry.valid() )
+         else
+         {
+            // Should never happer...
+            std::string errMsg = MODULE;
+            if ( !source )
+            {
+               errMsg += " image source null!";
+            }
+            else
+            {
+               errMsg += " output projection null!";
+            }
+            throw( ossimException(errMsg) );
+         }
+
+      } // if ( rect.hasNans() )
+
+   } // if ( source )
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "aoi: " << rect << "\n"
+         << MODULE << " exited...\n";
+   }
+
+} // End: ossimChipperUtil::getAreaOfInterest
+
+bool ossimChipperUtil::getIrect( const std::string& s, ossimIrect& rect ) const
+{
+   bool result = false;
+   if ( s.size() )
+   {
+      // <x>,<y>,<w>,<h>
+      ossimString cutBbox = s;
+      std::vector<ossimString> keys;
+      cutBbox.split(keys, ",");
+      if( keys.size() > 3 )
+      {
+         ossimIpt ul;
+         ossimIpt lr;
+         ul.x = keys[0].toInt32();
+         ul.y = keys[1].toInt32();
+         lr.x = ul.x + keys[2].toInt32() - 1;
+         lr.y = ul.y + keys[3].toInt32() - 1;
+         rect = ossimIrect(ul, lr);
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimChipperUtil::getIrect( ossimRefPtr<ossimSingleImageChain>& chain,
+                                 const std::string& s,
+                                 ossimIrect& rect ) const
+{
+   bool result = false;
+
+   if ( chain.valid() )
+   {
+      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
+      if ( ih.valid() )
+      {
+         // Get the geometry from the image handler.
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if ( geom.valid() )
+         {
+            // <lat>,<lon>,<w>,<h>
+            ossimString cutBbox = s;
+            std::vector<ossimString> keys;
+            cutBbox.split(keys, ",");
+            if( keys.size() > 3 )
+            {
+               ossimGpt gpt;
+               gpt.lat = keys[0].toFloat64();
+               gpt.lon = keys[1].toFloat64();
+               ossim_int32 w = keys[2].toInt32();
+               ossim_int32 h = keys[3].toInt32();
+               ossimDpt dpt;
+               geom->worldToLocal( gpt, dpt );
+               ossimIpt ul = dpt;
+               ul.x -= w/2;
+               ul.y -= h/2;
+               ossimIpt lr( ul.x + w - 1, ul.y + h - 1);
+               rect = ossimIrect(ul, lr);
+               result = true;
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+bool ossimChipperUtil::getIrect( ossimRefPtr<ossimSingleImageChain>& chain,
+                                 ossimIrect& rect ) const
+{
+   bool result = false;
+   if ( chain.valid() )
+   {
+      ossimRefPtr<ossimImageHandler> ih = chain->getImageHandler();
+      if ( ih.valid() )
+      {
+         const ossim_int32 MAX = 512;
+         ossimIrect r = ih->getImageRectangle();
+         ossimIpt size = r.size();
+         ossim_int32 w = ossim::min( MAX, size.x );
+         ossim_int32 h = ossim::min( MAX, size.y );
+         ossimIpt ul = r.midPoint();
+         ul.x -= w/2;
+         ul.y -= h/2;
+         ossimIpt lr( ul.x + w - 1, ul.y + h -1 );
+         rect = ossimIrect(ul, lr);
+         result = true;
+      }
+   }
+   return result;
+}
+
+void ossimChipperUtil::initializeThumbnailProjection(const ossimIrect& originalRect,
+                                                     ossimIrect& adjustedRect)
+{
+   static const char MODULE[] = "ossimChipperUtil::initializeThumbnailProjection";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\n"
+         << "origial rect:  " << originalRect << "\n";
+
+      if (m_geom.valid())
+      {
+         m_geom->print(ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+   }
+
+   if ( !originalRect.hasNans() && m_geom.valid() )
+   {
+      //---
+      // Thumbnail setup:
+      //---
+      ossimString thumbRes = m_kwl->findKey( THUMBNAIL_RESOLUTION_KW );
+      if ( thumbRes.size() )
+      {
+         ossim_float64 thumbSize = thumbRes.toFloat64();
+         ossim_float64 maxRectDimension =
+            ossim::max( originalRect.width(), originalRect.height() );
+
+         if ( maxRectDimension > thumbSize )
+         {
+            // Need to adjust scale:
+
+            // Get the corners before the scale change:
+            ossimGpt ulGpt;
+            ossimGpt lrGpt;
+
+            m_geom->localToWorld(ossimDpt(originalRect.ul()), ulGpt);
+            m_geom->localToWorld(ossimDpt(originalRect.lr()), lrGpt);
+
+            if ( isChipMode()  && m_ivt.valid() ) // Chipping in image space.)
+            {
+               ossim_float64 scale = thumbSize / maxRectDimension;
+               if ( m_ivt->getScale().hasNans() )
+               {
+                  m_ivt->scale( scale, scale );
+               }
+               else
+               {
+                  m_ivt->scale( m_ivt->getScale().x*scale,m_ivt->getScale().y*scale );
+               }
+            }
+            else
+            {
+               ossim_float64 scale = maxRectDimension / thumbSize;
+
+               //---
+               // Adjust the projection scale.  Note the "true" is to recenter
+               // the tie point so it falls relative to the projection origin.
+               //
+               // This call also scales: ossimImageGeometry::m_imageSize
+               //---
+               m_geom->applyScale(ossimDpt(scale, scale), true);
+            }
+
+            // Must call to reset the ossimImageRenderer's bounding rect for each input.
+            propagateOutputProjectionToChains();
+
+            // Get the new upper left in view space.
+            ossimDpt dpt;
+            m_geom->worldToLocal(ulGpt, dpt);
+            ossimIpt ul(dpt);
+
+            // Get the new lower right in view space.
+            m_geom->worldToLocal(lrGpt, dpt);
+            ossimIpt lr(dpt);
+
+            //---
+            // Clamp to thumbnail bounds with padding if turned on.
+            // Padding is optional. If padding turned on alway make square.
+            //---
+            ossim_int32 ts = thumbSize;
+            bool pad = padThumbnail();
+
+            if ( ( (lr.x - ul.x + 1) > ts ) || pad )
+            {
+               lr.x = ul.x + ts - 1;
+            }
+            if ( ( (lr.y - ul.y + 1) > ts ) || pad )
+            {
+               lr.y = ul.y + ts - 1;
+            }
+
+            adjustedRect = ossimIrect(ul, lr);
+         }
+      }
+
+   } // if ( !originalRect.hasNans() && m_geom.valid() )
+   else
+   {
+      // Should never happer...
+      std::string errMsg = MODULE;
+      if ( originalRect.hasNans() )
+      {
+         errMsg += " passed in rect has nans!";
+      }
+      else
+      {
+         errMsg += " output projection null!";
+      }
+      throw( ossimException(errMsg) );
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "\nadjusted rect: " << adjustedRect << "\n";
+      if (m_geom.valid())
+      {
+         m_geom->print(ossimNotify(ossimNotifyLevel_DEBUG));
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG) << MODULE << " exited...\n";
+   }
+}
+
+bool ossimChipperUtil::hasBandSelection() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      result = m_kwl->hasKey( std::string(ossimKeywordNames::BANDS_KW) );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasWmsBboxCutWidthHeight()const
+{
+   bool result = false;
+
+   if(m_kwl.valid())
+   {
+      result = (m_kwl->hasKey( CUT_HEIGHT_KW )&&
+                m_kwl->hasKey( CUT_WIDTH_KW ) &&
+                (m_kwl->hasKey( CUT_WMS_BBOX_KW )||
+                  m_kwl->hasKey(CUT_WMS_BBOX_LL_KW)));
+   }
+
+   return result;
+}
+
+bool ossimChipperUtil::hasCutBoxWidthHeight() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      if ( m_kwl->hasKey( CUT_HEIGHT_KW ) )
+      {
+         if ( m_kwl->hasKey( CUT_WIDTH_KW ) )
+         {
+            if ( m_kwl->hasKey( CUT_MIN_LAT_KW ) )
+            {
+               if ( m_kwl->hasKey( CUT_MIN_LON_KW ) )
+               {
+                  if ( m_kwl->hasKey( CUT_MAX_LAT_KW ) )
+                  {
+                     if ( m_kwl->hasKey( CUT_MAX_LON_KW ) )
+                     {
+                        result = true;
+                     }
+                  }
+               }
+            } // if lat and lon WMS style bbox is specified then we will behave the same as above
+            else if( m_kwl->hasKey(CUT_WMS_BBOX_LL_KW))
+            {
+              result = true;
+            }
+         }
+      }
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasScaleOption() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      if ( m_kwl->hasKey( METERS_KW.c_str() ) ||
+           m_kwl->hasKey( DEGREES_X_KW.c_str() ) ||
+           hasCutBoxWidthHeight()||
+           hasWmsBboxCutWidthHeight() )
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimChipperUtil::isThreeBandOut() const
+{
+   return keyIsTrue( THREE_BAND_OUT_KW );
+}
+
+bool ossimChipperUtil::padThumbnail() const
+{
+   return  keyIsTrue( PAD_THUMBNAIL_KW );
+}
+
+void ossimChipperUtil::setReaderProps( ossimImageHandler* ih ) const
+{
+   if ( ih && m_kwl.valid() )
+   {
+      ossim_uint32 count = m_kwl->numberOf( READER_PROPERTY_KW.c_str() );
+      for (ossim_uint32 i = 0; i < count; ++i)
+      {
+         ossimString key = READER_PROPERTY_KW;
+         key += ossimString::toString(i);
+         ossimString value = m_kwl->findKey( key.string() );
+         if ( value.size() )
+         {
+            std::vector<ossimString> splitArray;
+            value.split(splitArray, "=");
+            if(splitArray.size() == 2)
+            {
+               ossimRefPtr<ossimProperty> prop =
+                  new ossimStringProperty(splitArray[0], splitArray[1]);
+
+               ih->setProperty( prop );
+            }
+         }
+      }
+   }
+}
+
+void ossimChipperUtil::getBandList( std::vector<ossim_uint32>& bandList ) const
+{
+   bandList.clear();
+   if ( m_kwl.valid() )
+   {
+      ossimString os;
+      os.string() = m_kwl->findKey( std::string( ossimKeywordNames::BANDS_KW ) );
+      if ( os.size() &&(os!="default"))
+      {
+         std::vector<ossimString> band_list(0);
+         os.split( band_list, ossimString(","), false );
+         if ( band_list.size() )
+         {
+            std::vector<ossimString>::const_iterator i = band_list.begin();
+            while ( i != band_list.end() )
+            {
+               ossim_uint32 band = (*i).toUInt32();
+               if ( band ) // One based so we need to subtract.
+               {
+                  bandList.push_back( band - 1 );
+               }
+               ++i;
+            }
+         }
+      }
+   }
+
+} // End: ossimChipperUtil::getBandList
+
+bool ossimChipperUtil::hasAnnotations() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      ossimString regularExpression = "annotation[0-9]*\\.type";
+      ossim_uint32 count = m_kwl->getNumberOfKeysThatMatch( regularExpression );
+      if ( count > 0 )
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasLutFile() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      result = ( m_kwl->find( LUT_FILE_KW.c_str() ) != 0 );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasBrightnesContrastOperation() const
+{
+   bool result = false;
+   std::string value = m_kwl->findKey( BRIGHTNESS_KW );
+   if ( value.size() )
+   {
+      result = true;
+   }
+   else
+   {
+      value = m_kwl->findKey( CONTRAST_KW );
+      if ( value.size() )
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasGeoPolyCutterOption()const
+{
+   bool result = (m_kwl->find(CLIP_WMS_BBOX_LL_KW.c_str())||
+                  m_kwl->find(CLIP_POLY_LAT_LON_KW.c_str()));
+
+   return result;
+}
+
+bool ossimChipperUtil::hasBumpShadeArg() const
+{
+   bool result = ( m_operation == OSSIM_CHIPPER_OP_HILL_SHADE );
+   if ( !result && m_kwl.valid() )
+   {
+      result = ( m_kwl->find( ossimKeywordNames::AZIMUTH_ANGLE_KW ) ||
+                 m_kwl->find( COLOR_RED_KW.c_str() ) ||
+                 m_kwl->find( COLOR_GREEN_KW.c_str() ) ||
+                 m_kwl->find( COLOR_BLUE_KW.c_str() ) ||
+                 m_kwl->find( ossimKeywordNames::ELEVATION_ANGLE_KW ) ||
+                 m_kwl->find( GAIN_KW.c_str() ) );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasThumbnailResolution() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      result = ( m_kwl->find( THUMBNAIL_RESOLUTION_KW.c_str() ) != 0 );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasHistogramOperation() const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      result = m_kwl->hasKey( HIST_OP_KW );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::isDemFile(const ossimFilename& file) const
+{
+   bool result = false;
+   ossimString ext = file.ext();
+   if ( ext.size() >= 2 )
+   {
+      ext.downcase();
+      if ( ( ext == "hgt" ) || ( ext == "dem" ) ||
+           ( ( (*ext.begin()) == 'd' ) && ( (*(ext.begin()+1)) == 't' ) ) )
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+bool ossimChipperUtil::isSrcFile(const ossimFilename& file) const
+{
+   bool result = false;
+   ossimString ext = file.ext();
+   ext.downcase();
+   if ( ext == "src" )
+   {
+      result = true;
+   }
+   return result;
+}
+
+ossimScalarType ossimChipperUtil::getOutputScalarType() const
+{
+   ossimScalarType scalar = OSSIM_SCALAR_UNKNOWN;
+   ossimString lookup = m_kwl->findKey( OUTPUT_RADIOMETRY_KW );
+   if ( lookup.size() )
+   {
+      scalar = ossimScalarTypeLut::instance()->getScalarTypeFromString( lookup );
+   }
+   if ( scalar == OSSIM_SCALAR_UNKNOWN )
+   {
+      // deprecated keyword...
+      if ( keyIsTrue( std::string(SCALE_2_8_BIT_KW) ) )
+      {
+         scalar = OSSIM_UINT8;
+      }
+   }
+   return scalar;
+}
+
+bool ossimChipperUtil::scaleToEightBit() const
+{
+   bool result = false;
+   if ( getOutputScalarType() == OSSIM_UINT8 )
+   {
+      result = true;
+   }
+   return result;
+}
+
+bool ossimChipperUtil::snapTieToOrigin() const
+{
+   return keyIsTrue( SNAP_TIE_TO_ORIGIN_KW );
+}
+
+void ossimChipperUtil::getImageSpaceScale( ossimDpt& imageSpaceScale ) const
+{
+   std::string value = m_kwl->findKey( IMAGE_SPACE_SCALE_X_KW );
+   if ( value.size() )
+   {
+      imageSpaceScale.x = ossimString(value).toFloat64();
+   }
+   else
+   {
+      imageSpaceScale.x = 1.0;
+   }
+   value = m_kwl->findKey( IMAGE_SPACE_SCALE_Y_KW );
+   if ( value.size() )
+   {
+      imageSpaceScale.y = ossimString(value).toFloat64();
+   }
+   else
+   {
+      imageSpaceScale.y = 1.0;
+   }
+}
+
+ossim_float64 ossimChipperUtil::getRotation() const
+{
+   ossim_float64 result = ossim::nan();
+   if ( m_kwl.valid() )
+   {
+      std::string value = m_kwl->findKey( ROTATION_KW);
+      if ( value.size() )
+      {
+         result = ossimString(value).toFloat64();
+         if ( result < 0 )
+         {
+            result += 360.0;
+         }
+
+         // Range check:
+         if ( ( result < 0.0 ) || ( result > 360.0 ) )
+         {
+            std::ostringstream errMsg;
+            errMsg << "ossimChipperUtil::getRotation range error!\n"
+                   << "rotation = " << result
+                   << "\nMust be between 0 and 360.";
+            throw ossimException( errMsg.str() );
+         }
+      }
+   }
+   return result;
+}
+
+bool ossimChipperUtil::upIsUp() const
+{
+   return keyIsTrue( std::string(UP_IS_UP_KW) );
+}
+
+bool ossimChipperUtil::hasRotation() const
+{
+   bool result = false;
+   std::string value = m_kwl->findKey(std::string(ROTATION_KW));
+   if ( value.size() )
+   {
+      result = true;
+   }
+   return result;
+}
+
+bool ossimChipperUtil::northUp() const
+{
+   return keyIsTrue( std::string(NORTH_UP_KW) );
+}
+
+bool ossimChipperUtil::isChipMode() const
+{
+   return (m_operation == OSSIM_CHIPPER_OP_CHIP);
+}
+
+bool ossimChipperUtil::keyIsTrue( const std::string& key ) const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      std::string value = m_kwl->findKey( key );
+      if ( value.size() )
+      {
+         result = ossimString(value).toBool();
+      }
+   }
+   return result;
+}
+
+ossim_uint32 ossimChipperUtil::getEntryNumber() const
+{
+   ossim_uint32 result = 0;
+   if ( m_kwl.valid() )
+   {
+      std::string value = m_kwl->findKey( std::string( ossimKeywordNames::ENTRY_KW ) );
+      if ( value.size() )
+      {
+         result = ossimString(value).toUInt32();
+      }
+   }
+   return result;
+}
+
+ossim_int32 ossimChipperUtil::getZone() const
+{
+   ossim_int32 result = 0;
+   if ( m_kwl.valid() )
+   {
+      std::string value = m_kwl->findKey( std::string( ossimKeywordNames::ZONE_KW ) );
+      if ( value.size() )
+      {
+         result = ossimString(value).toUInt32();
+      }
+   }
+   return result;
+}
+
+
+std::string ossimChipperUtil::getHemisphere() const
+{
+   std::string result;
+   if ( m_kwl.valid() )
+   {
+      result = m_kwl->findKey( std::string( ossimKeywordNames::HEMISPHERE_KW ) );
+   }
+   return result;
+}
+
+bool ossimChipperUtil::hasSensorModelInput()
+{
+   bool result = false;
+
+   // Test image layers.
+   std::vector< ossimRefPtr<ossimSingleImageChain> >::iterator chainIdx = m_imgLayer.begin();
+   while ( chainIdx != m_imgLayer.end() )
+   {
+      // Get the image handler:
+      ossimRefPtr<ossimImageHandler> ih = (*chainIdx)->getImageHandler();
+      if ( ih.valid() )
+      {
+         // Get the geometry from the first image handler.
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if ( geom.valid() )
+         {
+            // Get the image projection.
+            ossimRefPtr<ossimProjection> proj = geom->getProjection();
+            if ( proj.valid() )
+            {
+               // Cast and assign to result.
+               ossimMapProjection* mapProj = PTR_CAST( ossimMapProjection, proj.get() );
+               if ( !mapProj )
+               {
+                  result = true;
+                  break;
+               }
+            }
+         }
+      }
+      ++chainIdx;
+   }
+
+   if ( !result )
+   {
+      // Test dem layers.
+      chainIdx = m_demLayer.begin();
+      while ( chainIdx != m_demLayer.end() )
+      {
+         // Get the image handler:
+         ossimRefPtr<ossimImageHandler>  ih = (*chainIdx)->getImageHandler();
+         if ( ih.valid() )
+         {
+            // Get the geometry from the first image handler.
+            ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+            if ( geom.valid() )
+            {
+               // Get the image projection.
+               ossimRefPtr<ossimProjection> proj = geom->getProjection();
+               if ( proj.valid() )
+               {
+                  // Cast and assign to result.
+                  ossimMapProjection* mapProj = PTR_CAST( ossimMapProjection, proj.get() );
+                  if ( !mapProj )
+                  {
+                     result = true;
+                     break;
+                  }
+               }
+            }
+         }
+         ++chainIdx;
+      }
+   }
+
+   return result;
+}
+
+void  ossimChipperUtil::initializeSrcKwl()
+{
+   static const char MODULE[] = "ossimChipperUtil::initializeSrcKwl";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered...\n";
+   }
+
+   std::string value = m_kwl->findKey(std::string(SRC_FILE_KW));
+   if ( value.size() )
+   {
+      m_srcKwl = new ossimKeywordlist();
+      m_srcKwl->setExpandEnvVarsFlag(true);
+      if ( m_srcKwl->addFile( value.c_str() ) == false )
+      {
+         m_srcKwl = 0;
+      }
+   }
+   else
+   {
+      m_srcKwl = 0;
+   }
+
+   if ( traceDebug() )
+   {
+      if ( m_srcKwl.valid() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "src keyword list:\n" << *(m_srcKwl.get()) << "\n";
+      }
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " exited...\n";
+   }
+}
+
+ossim_uint32 ossimChipperUtil::getNumberOfInputs() const
+{
+   ossim_uint32 result = 0;
+   
+   ossimString demRegExpr = "dem[0-9]*\\.file";
+   ossimString imgRegExpr = "image[0-9]*\\.file";
+   
+   if ( m_kwl.valid() )
+   {
+      // Look for dems, e.g. dem0.file: foo.tif
+      result = m_kwl->getNumberOfKeysThatMatch( demRegExpr );
+
+      // Look for images, e.g. image0.file: foo.tif
+      result += m_kwl->getNumberOfKeysThatMatch( imgRegExpr );
+   }
+
+   if ( m_srcKwl.valid() )
+   {
+      // Look for dems, e.g. dem0.file: foo.tif
+      result += m_srcKwl->getNumberOfKeysThatMatch( demRegExpr );
+
+      // Look for images, e.g. image0.file: foo.tif
+      result += m_srcKwl->getNumberOfKeysThatMatch( imgRegExpr );     
+   }
+
+   return result;
+}
+
+ossimChipperUtil::ossimChipperOutputProjection ossimChipperUtil::getOutputProjectionType() const
+{
+   ossimChipperOutputProjection result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_UNKNOWN;
+   const char* op  = m_kwl->find(ossimKeywordNames::PROJECTION_KW);
+   if ( op )
+   {
+      ossimString os = op;
+      os.downcase();
+      if (os == "geo")
+      {
+         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO;
+      }
+      else if (os == "geo-scaled")
+      {
+         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_GEO_SCALED;
+      }
+      else if ( os == "input" )
+      {
+         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_INPUT;
+      }
+      else if ( (os == "utm") || (os == "ossimutmprojection") )
+      {
+         result = ossimChipperUtil::OSSIM_CHIPPER_PROJ_UTM;
+      }
+   }
+   return result;
+}
+
+void ossimChipperUtil::getClipPolygon(ossimGeoPolygon& polygon)const
+{
+   ossimString param = m_kwl->find(CLIP_WMS_BBOX_LL_KW.c_str());
+   if(!param.empty())
+   {
+      if(!polygon.addWmsBbox(param))
+      {
+         polygon.clear();
+      }
+   }
+   else
+   {
+      param = m_kwl->find(CLIP_POLY_LAT_LON_KW.c_str());
+      if(!param.empty())
+      {
+         std::vector<ossimGpt> points;
+         ossim::toVector(points, param);
+         if(!points.empty())
+         {
+            polygon = points;
+         }
+      }
+   }
+}
+
+ossim_float64 ossimChipperUtil::getBrightness() const
+{
+   ossim_float64 brightness = 0.0;
+   std::string value = m_kwl->findKey( BRIGHTNESS_KW );
+   if ( value.size() )
+   {
+      brightness = ossimString(value).toFloat64();
+
+      // Range check it:
+      if ( ( brightness < -1.0 ) || ( brightness > 1.0 ) )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimChipperUtil::getBrightness range error!"
+            << "\nbrightness: " << brightness
+            << "\nvalid range: -1.0 to 1.0"
+            << "\nReturned brightness has been reset to: 0.0"
+            << std::endl;
+
+         brightness = 0.0;
+      }
+   }
+   return brightness;
+
+}
+
+ossim_float64 ossimChipperUtil::getContrast() const
+{
+   ossim_float64 contrast = 1.0;
+   std::string value = m_kwl->findKey( CONTRAST_KW );
+   if ( value.size() )
+   {
+      contrast = ossimString(value).toFloat64();
+
+      // Range check it:
+      if ( ( contrast < 0.0 ) || ( contrast > 20.0 ) )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimChipperUtil::getContrast range error!"
+            << "\ncontrast: " << contrast
+            << "\nvalid range: 0 to 20.0"
+            << "\nReturned contrast has been reset to: 1.0"
+            << std::endl;
+
+         contrast = 1.0;
+      }
+   }
+   return contrast;
+
+}
+
+std::string ossimChipperUtil::getSharpenMode() const
+{
+   ossimString mode = m_kwl->findKey( SHARPEN_MODE_KW );
+   if ( mode.size() )
+   {
+      mode.downcase();
+      if ( (mode != "light") && (mode != "heavy") && (mode != "none") )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimChipperUtil::getSharpnessMode WARNING!"
+            << "\nInvalid sharpness mode: " << mode
+            << "\nValid modes: \"light\" and \"heavy\""
+            << std::endl;
+         mode = "";
+      }
+      if(mode=="none") mode = "";
+   }
+   return mode.string();
+}
+
+int ossimChipperUtil::getHistoMode() const
+{
+   int result = ossimHistogramRemapper::STRETCH_UNKNOWN;
+
+   ossimString op = m_kwl->findKey( HIST_OP_KW );
+   op.downcase();
+
+   if ( ( op.string() == "auto-minmax" ) )
+   {
+      result = ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX;
+   }
+   else if ( ( op.string() == "auto-percentile" ) )
+   {
+      result = ossimHistogramRemapper::LINEAR_AUTO_PERCENTILE;
+   }
+   else if ( (op == "std-stretch-1") || (op == "std-stretch 1") )
+   {
+      result = ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN;
+   }
+   else if ( (op == "std-stretch-2") || (op == "std-stretch 2") )
+   {
+      result = ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN;
+   }
+   else if ( (op == "std-stretch-3") || (op == "std-stretch 3") )
+   {
+      result = ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN;
+   }
+   else if( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimChipperUtil::getHistoMode: Unhandled operation: " << op << "\n";
+   }
+
+   return result;
+}
+
+void ossimChipperUtil::usage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+
+   // Set app name.
+   std::string appName = ap.getApplicationName();
+   ap.getApplicationUsage()->setApplicationName( ossimString( appName ) );
+
+   // Add options.
+   addArguments(ap);
+
+   // Write usage.
+   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+
+   // Keeping single line in tact for examples for cut and paste purposes.
+   ossimNotify(ossimNotifyLevel_INFO)
+
+      << "NOTES:\n"
+      << "1) Never use same base name in the same directory! Example is you have a Chicago.tif\n"
+      << "   and you want a Chicago.jp2, output Chicago.jp2 to its own directory.\n"
+
+      << "\nExample commands:\n"
+
+      << "\n// File conversion: Convert geotiff to a jp2 file.\n"
+      << appName << " --op chip -w ossim_kakadu_jp2 Chicago.tif outputs/Chicago.jp2\n"
+
+      << "\n// Orthorectification: Orthorectify a nitf with RPC model out to a geotiff.\n"
+      << appName << " --op ortho 5V090205P0001912264B220000100282M_001508507.ntf outputs/ortho.tif\n"
+
+      << "\n// Mosaic: Mosaic multiple images together and output to a geotiff.\n"
+      << appName << " --combiner-type ossimImageMosaic --op ortho f1.tif f2.tif f3.tif outputs/mosaic.tif\n"
+
+      << "\n// Mosaic: Feather Mosaic multiple images together and output to a geotiff.\n"
+      << appName << " --combiner-type ossimFeatherMosaic --op ortho f1.tif f2.tif f3.tif outputs/feather.tif\n"
+
+      << "\n// Color relief: Colorize two DEMs from a lut, output to a geotiff.\n"
+      << appName << " --op color-relief --color-table ossim-dem-color-table-template.kwl N37W123.hgt N38W123.hgt outputs/color-relief.tif\n"
+
+      << "\n// Color relief: Colorize two DEMs from a lut, output to a png thumbnail.\n"
+      << appName << " --op color-relief --color-table ossim-dem-color-table-template.kwl -t 1024 -w ossim_png N37W123.hgt N38W123.hgt outputs/color-relief.png\n"
+
+      << "\n// Hill shade: Hill shade two DEMs, output to a geotiff.\n"
+      << appName << " --color 255 255 255 --azimuth 270 --elevation 45 --exaggeration 2.0 --op  hillshade N37W123.hgt N38W123.hgt outputs/hillshade.tif\n"
+
+      << "\n// Two color multi view with cut box.  First image is old, second image is new:\n"
+      << appName << " --cut-bbox-ll 28.092885092033352 -80.664539599998633 28.109128691071547 -80.626914963229325 --op 2cmv oldMLB.tif newMLB.tif outputs/2cmv-test1.tif\n"
+
+      << "\n// Ortho about point, 512x512, with histogram stretch, and 3,2,1 band order:\n"
+      << appName << " --op ortho -b 3,2,1 --histogram-op auto-minmax --cut-center-llwh -42.819784401784275 147.265811350983 512 512 5V090205M0001912264B220000100072M_001508507.ntf orth.tif\n"
+
+      << "\n// Chip, in image space, about point, 512x512, with histogram stretch, and 3,2,1 band order:\n"
+      << appName << " --op chip -b 3,2,1 --histogram-op auto-minmax --cut-center-llwh -42.819784401784275 147.265811350983 512 512 5V090205M0001912264B220000100072M_001508507.ntf chip.tif\n"
+
+      << "\n// Chip in image space, rotate \"up is up\"(-u option) about point, 512x512 with histogram stretch and 3,2,1 band order:\n"
+      << appName << " --op chip -u -b 3,2,1 --histogram-op auto-minmax --cut-center-llwh -42.819784401784275 147.265811350983 512 512 5V090205M0001912264B220000100072M_001508507.ntf up-is-up-chip.tif\n"
+
+      << "\n// Chip in image space, rotate 39 degrees (-r option) about point, 1024x1024, scaled to eight bit:\n"
+      << appName << " --op chip -r 39 --histogram-op auto-minmax --cut-center-llwh -42.883809539602893 147.331984112985765 1024 1024 --output-radiometry ossim_uint8 5V090205P0001912264B220000100282M_001508507.ntf outputs/r39.png\n"
+
+      << "\n// Above command where all options are in a keyword list:\n"
+      << appName << " --options r39-options.kwl\n"
+      << std::endl;
+}
diff --git a/src/util/ossimEquationUtil.cpp b/src/util/ossimEquationUtil.cpp
new file mode 100644
index 0000000..2fd963a
--- /dev/null
+++ b/src/util/ossimEquationUtil.cpp
@@ -0,0 +1,408 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <iostream>
+#include <sstream>
+#include <fstream>
+using namespace std;
+
+#include <ossim/util/ossimEquationUtil.h>
+#include <ossim/imaging/ossimEquationCombiner.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimRtti.h>
+
+static ossimTrace traceDebug(ossimString("mosaic:main"));
+
+// Copied from ossimEquationCombiner.h:
+static const char* EQ_SPEC = "\nEquation Specification:\n\
+\n\
+sin(x)                 takes the sine of the input  \n\
+sind(x)                takes the sin of the input and assumes degree input \n\
+cos(x)                 takes cosine of input \n\
+cosd(x)                takes the cosine of input and assumes input in degrees \n\
+sqrt(x)                takes square root of input \n\
+log(x)                 takes the natural log of input \n\
+log10(x)               takes the log base 10 of the input \n\
+exp(x)                 takes the e raised to the passed in argument \n\
+abs(x)                 takes the absolute value of the passed in value \n\
+min(x1, x2, ... xn)    takes the min of all values in the list \n\
+max(x1, x2, ... xn)    takes the max of all values in the list. \n\
+\n\
+clamp(image_data, min, max) \n\
+                      will clamp all data to be between the min max values. \n\
+                      will set anything less than min to min and anythin \n\
+                      larger than max to max \n\
+\n\
+band(image_data, num)  returns a single band image object \n\
+                      by selecting band num from input image i1.  Note \n\
+                      the first argument must be an image \n\
+                      and the second argument must be a number \n\
+\n\
+shift(index, num_x, num_y) \n\
+                      currently, the first argument must be an image \n\
+                      variable(i1, i2, ... in) and x, and y must b numbers \n\
+                      indicating the delta in that direction to shift the \n\
+                      input. \n\
+\n\
+blurr(index, rows, cols) \n\
+                      Will blurr the input image i with a \n\
+                      rows-by-cols kernel.  All values are equal \n\
+                      weight.  Note the fist argument must by an image \n\
+                      variable (ex: i1, i2,....in). \n\
+\n\
+conv(index, rows, cols, <row ordered list of values> ) \n\
+                      this allows you to define an arbitrary matrix.  The \n\
+                      <row ordered list of values> is a comma separated \n\
+                      list of constant values. \n\
+\n\
+assign_band(image_data, num1, data2, num2) \n\
+                      will take band num2 from image data2 and assign it to \n\
+                      band num1 in data 1. \n\
+\n\
+assign_band(image_data, num1, data2) \n\
+                      will take band 1 from image data2 and assign it to \n\
+                      band num1 in data 1. \n\
+\n\
+assign_band(image_data, num1, num2) \n\
+                      will assin to band num1 of data 1 the value of num2 \n\
+\n\
+x1 * x2                will multiply x1 and x2 \n\
+x1 + x2                will add x1 and x2 \n\
+x1 - x2                will subtract x1 and x2 \n\
+x1 / x2                will divide x1 and x2 \n\
+x1 ^ x2                will do a power, raises x1 to x2 \n\
+x1 | x2                will do a bitwise or operation \n\
+                      ( will do it in unisgned char precision) \n\
+\n\
+x1 & x2                will do a bitwise and operation \n\
+                      ( will do it in unsigned char precision) \n\
+\n\
+~x1                    will do the ones complement of the input \n\
+\n\
+x1 xor x2              will do an xclusive or operation \n\
+                      (will do it in unsigned char precision) \n\
+\n\
+- x1                   will negative of x1 \n\
+\n\
+Boolean ops: 1=true, 0=false \n\
+x1 > x2 \n\
+x1 >= x2 \n\
+x1 == x2 \n\
+x1 <= x2 \n\
+x1 < x2 \n\
+x1 <> x2 \n\
+\n\
+Note: \n\
+\n\
+Currently an image input is reference by the variable in[<I>] where \n\
+<I> is the input image index beginning at 0.  So 1 referes to the second image \n\
+in the input list. \n\
+\n\
+(in[0] + in[1])/2 \n\
+Will take image 1 and add it to image 2 and average them. \n\
+\n\
+exp(sqrt(in[0])/4) \n\
+Will take the root of the image and divide by 4 and then raise e to that \n\
+amount. \n\
+\n\
+128 \n\
+Will return a constant value of 128 for all input bands. \n\
+\n\
+min(1,in[2],in[3], max(in[1],in[0])) \n\
+\n\
+shift(0, 1, 1) - i1 \n\
+Will shift input 0 by 1 pixel along the diagonal  and then subtract it \n\
+from input 1. \n\
+\n\
+assign_band(in[0], 1, blurr(in[0], 5, 5), 2) \n\
+Will assign to the first band of i1 the 2nd band of the 5x5 blurr of i1. \n\
+\n\
+conv(0, 3, 3, -1, -2, -1, 0, 0, 0, 1, 2, 1) \n\
+Will convolve the first input connection with a 3x3 matrix. \n\
+The args are row ordered: \n\
+                        -1, -2, -1 \n\
+                         0,  0,  0 \n\
+                         1,  2,  1 \n\
+\n\
+NDVI: \n\
+N=(in[0]-in[1])/(in[0]+in[1]) \n\
+\n\
+For indexed-type values,like NDVI, (with limited values) it is better \n\
+to rescale between 0.0 and 1.0 and use type NormalizedFloat. \n\
+\n\
+Rescaled NDVI between 0 and 1: \n\
+(N+1)/2 = in[0]/(in[0]+in[1]) \n\
+\n";
+
+ossimEquationUtil::ossimEquationUtil(ossimArgumentParser& ap)
+:  m_argumentParser(new ossimArgumentParser(ap))
+{
+   m_usage.setApplicationName(ap.getApplicationName());
+   m_usage.setDescription(ap.getApplicationName() +
+                        " Takes a list of images and performs the specified equation. The inputs"
+                        "must be in the same projection as the operations are done at the pixel"
+                        "level with no renderer in th chain. The output file will contain the same"
+                        "geospatial header info as the first image in the input list.");
+   m_usage.setCommandLineUsage(ap.getApplicationName()+
+                              " \"<equation spec>\" <input_file1> <input_file2> <input_file...> <output_file>");
+   m_usage.addCommandLineOption("-h or --help","Display this information");
+   m_usage.addCommandLineOption("-k <filename>", "keyword list to load from");
+   m_usage.addCommandLineOption("-w <type>", "Writer type (tiff_strip, jpeg, etc... see ossim-info --writers) (default=tiff_strip)");
+   m_usage.addCommandLineOption("--writer-prop <string>", "Adds a property to send to the writer. format is name=value");
+   m_usage.addCommandLineOption("-t <filename>", "output a keyword list template");
+}
+
+bool ossimEquationUtil::execute()
+{
+   // Allocate some stuff up front for use later
+   ossimString writerType = "tiff_strip";
+   ossimString equationSpec;
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   std::map<ossimString, ossimString, ossimStringLtstr> writerPropertyMap;
+   vector<ossimFilename> infiles;
+   ossimFilename outfile;
+
+   // Display Help
+   if (m_argumentParser->read("-h") || m_argumentParser->read("--help") || (m_argumentParser->argc() < 4))
+   {
+      m_usage.write(ossimNotify(ossimNotifyLevel_INFO));
+      ossimNotify(ossimNotifyLevel_INFO)<<EQ_SPEC<<endl;
+      return false;
+   }
+
+   // Output KWL template
+   if (m_argumentParser->read("-t", stringParam))
+   {
+      ossimFilename templateFilename = tempString.c_str();
+      outputTemplateKeywordlist(templateFilename);
+      return false;
+   }
+
+   // Keyword list to load from
+   if (m_argumentParser->read("-k", stringParam))
+   {
+      if (!parseKwl(tempString.c_str(), infiles, equationSpec, outfile, writerType))
+         return false;
+   }
+   else
+   {
+      // Everything on command line:
+      // user input writer props, should use those
+      while(m_argumentParser->read("--writer-prop", stringParam))
+      {
+         std::vector<ossimString> nameValue;
+         ossimString(tempString).split(nameValue, "=");
+         if(nameValue.size() == 2)
+            writerPropertyMap.insert(std::make_pair(nameValue[0], nameValue[1]));
+      }
+
+      // User input a writer type
+      if (m_argumentParser->read("-w", stringParam))
+         writerType = tempString;
+
+      int argCount = m_argumentParser->argc();
+      if (argCount < 4)
+      {
+         m_usage.write(ossimNotify(ossimNotifyLevel_INFO));
+         ossimNotify(ossimNotifyLevel_INFO)<<EQ_SPEC<<endl;
+         return false;
+      }
+
+      // First the equation spec:
+      equationSpec = m_argumentParser->argv()[1];
+
+      // Get the input files.
+      for (int i=2; i< (argCount-1); ++i)
+         infiles.push_back(ossimFilename(m_argumentParser->argv()[i]));
+
+      // Get the output file.
+      outfile = m_argumentParser->argv()[argCount-1];
+   }
+
+   if (!initInputSources(infiles))
+      return false;
+
+   // Create combiner object
+   ossimRefPtr<ossimEquationCombiner> combiner = new ossimEquationCombiner(m_inputSources);
+   combiner->setEquation(equationSpec);
+
+   // Create writer:
+   ossimRefPtr<ossimImageFileWriter> writer;
+   writer = ossimImageWriterFactoryRegistry::instance()->createWriter(writerType);
+   if(!writer.valid())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<"Could not create writer of type <"<<writerType<<">"<<endl;
+      return false;
+   }
+   writer->connectMyInputTo(combiner.get());
+   writer->setFilename(outfile);
+   ossimIrect bounding_irect;
+   m_prodGeometry->getBoundingRect(bounding_irect);
+   writer->setAreaOfInterest(bounding_irect);
+   writer->initialize();
+
+   if ( writerPropertyMap.size() )
+   {
+      ossimPropertyInterface* propInterface = (ossimPropertyInterface*) writer.get();
+      std::map<ossimString, ossimString, ossimStringLtstr>::iterator iter = writerPropertyMap.begin();
+      while(iter!=writerPropertyMap.end())
+      {
+         propInterface->setProperty(iter->first, iter->second);
+         ++iter;
+      }
+   }
+
+   // Execute:
+   ossimStdOutProgress listener;
+   writer->addListener(&listener);
+   if (!writer->execute())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<< "Error encountered writing file..."<<endl;
+      return false;
+   }
+
+   writer->close();
+   return true;
+}
+
+void ossimEquationUtil::outputTemplateKeywordlist(const ossimFilename &templateFilename)
+{
+   ofstream out(templateFilename.c_str());
+
+   out << "file1.filename: <full path and file name>" << endl
+       << "file2.filename: <full path and file name>" << endl
+       << "// :\n"
+       << "// :\n"
+       << "// fileN.filename:: <full path and file name>" << endl
+       << "\n// currently this option has been tested\n"
+       << "// with ossimTiffWriter and ossimJpegWriter\n"
+       << "writer.type: tiff_strip"            << endl
+       << "writer.filename: <full path to output file>"  << endl
+       << "\n// Equation specification:\n"
+       << "equation: <equation spec string>"<<endl;
+
+   ossimNotify(ossimNotifyLevel_NOTICE) << "Wrote file: " << templateFilename << std::endl;
+}
+
+bool ossimEquationUtil::parseKwl(const ossimFilename& kwl_file,
+              vector<ossimFilename>& inputs,
+              ossimString& equationSpec,
+              ossimFilename& output,
+              ossimString& writerType)
+{
+   ossimKeywordlist kwl;
+   if (!kwl.addFile(kwl_file))
+      return false;
+
+   ossim_int32 index = 0;
+   ossim_int32 result = kwl.getNumberOfSubstringKeys("file[0-9]+\\.filename");
+   const char* lookup = NULL;
+   ossim_int32 numberOfMatches = 0;
+
+   while(numberOfMatches < result)
+   {
+      ossimString searchValue = "file" + ossimString::toString(index);
+
+      ossimString filename = searchValue + ".filename";
+      lookup = kwl.find(filename.c_str());
+      if(lookup)
+      {
+         inputs.push_back(ossimFilename(lookup));
+         ++numberOfMatches;
+      }
+      ++index;
+   }
+
+   equationSpec = kwl.find("equation");
+   if (equationSpec.empty())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<"No equation specified in KWL"<<endl;
+      return false;
+   }
+
+   output = kwl.find("writer.filename");
+   if (output.empty())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<"No output filename specified in KWL"<<endl;
+      return false;
+   }
+
+   writerType = kwl.find("writer.type");
+   if (writerType.empty())
+      writerType = "tiff_strip";
+
+   return true;
+}
+
+bool ossimEquationUtil::initInputSources(vector<ossimFilename>& fileList)
+{
+   bool result = true;
+   m_inputSources.clear();
+   ossimRefPtr<ossimImageGeometry> input_geom;
+
+   for(ossim_int32 index = 0; index < (ossim_int32)fileList.size();++index)
+   {
+      ossimRefPtr<ossimImageHandler> handler =
+            ossimImageHandlerRegistry::instance()->open(fileList[index]);
+      if(!handler.valid())
+      {
+         cerr << "Error: Unable to load image " << fileList[index] << endl;
+         result = false;
+         break;
+      }
+
+      input_geom = handler->getImageGeometry();
+
+      if (index == 0)
+      {
+         m_prodGeometry = (ossimImageGeometry*) input_geom->dup();
+         ossimGpt origin;
+         m_prodGeometry->getTiePoint(origin, false);
+         ossimDpt gsd (m_prodGeometry->getMetersPerPixel());
+
+         if (m_prodGeometry->isAffectedByElevation())
+         {
+            // Need to ortho to UTM, so define output geometry shared by all input chains:
+            ossimMapProjection* prod_proj = new ossimUtmProjection;
+            prod_proj->setOrigin(origin);
+            prod_proj->setMetersPerPixel(m_prodGeometry->getMetersPerPixel());
+            m_prodGeometry->setProjection(prod_proj);
+         }
+      }
+
+      // Set up the IVT for this input's renderer:
+      ossimRefPtr<ossimImageViewProjectionTransform> transform = new ossimImageViewProjectionTransform;
+      transform->setImageGeometry(input_geom.get());
+      transform->setViewGeometry(m_prodGeometry.get());
+
+      ossimRefPtr<ossimImageRenderer> renderer = new ossimImageRenderer;
+      renderer->connectMyInputTo(0, handler.get());
+      renderer->setImageViewTransform(transform.get());
+      renderer->initialize();
+
+      m_inputSources.push_back(renderer.get());
+   }
+
+   return result;
+}
+
diff --git a/src/util/ossimFileWalker.cpp b/src/util/ossimFileWalker.cpp
new file mode 100644
index 0000000..74aaa4d
--- /dev/null
+++ b/src/util/ossimFileWalker.cpp
@@ -0,0 +1,534 @@
+//----------------------------------------------------------------------------
+//
+// File: ossimFileWalker.h
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:
+//
+// Utility class to walk through directories and get a list of files to
+// process.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/util/ossimFileWalker.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimFileProcessorInterface.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/parallel/ossimJobQueue.h>
+#include <OpenThreads/Thread>
+
+static ossimTrace traceDebug(ossimString("ossimFileWalker:debug"));
+
+ossimFileWalker::ossimFileWalker()
+   : m_fileProcessor(0),
+     m_jobQueue(new ossimJobMultiThreadQueue(new ossimJobQueue(), 1)),     
+     m_filteredExtensions(0),
+     m_recurseFlag(true),
+     m_waitOnDirFlag(false),
+     m_abortFlag(false),
+     m_mutex()
+{
+}
+
+ossimFileWalker::~ossimFileWalker()
+{
+   m_jobQueue = 0; // Not a leak, ref pointer.
+}
+
+void ossimFileWalker::walk(const std::vector<ossimFilename>& files)
+{
+   static const char M[] = "ossimFileWalker::walk";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered\n";
+   }
+
+   if ( files.size() )
+   {
+      std::vector<ossimFilename>::const_iterator i = files.begin();
+      while ( i != files.end() )
+      {
+         // Must have call back set at this point.
+         if ( !m_abortFlag && m_fileProcessor )
+         {
+            ossimFilename file = (*i).expand();
+            if ( file.size() && file.exists() )
+            {
+               if ( file.isDir() ) // Directory:
+               {
+                  walkDir(file);
+               }  
+               else // File:
+               {
+                  if ( isFiltered(file) == false )
+                  {
+                     if(traceDebug())
+                     {
+                        ossimNotify(ossimNotifyLevel_DEBUG)
+                           << "Making the job for: " << (*i) << std::endl;
+                     }
+                     
+                     // Make the job:
+                     ossimRefPtr<ossimFileWalkerJob> job =
+                        new ossimFileWalkerJob( m_fileProcessor, file );
+                     
+                     job->setName( ossimString( file.string() ) );
+                     
+                     job->setCallback( new ossimFileWalkerJobCallback() );
+                     
+                     // Set the state to ready:
+                     job->ready();
+                     
+                     // Add job to the queue:
+                     m_jobQueue->getJobQueue()->add( job.get() );
+                     
+                     m_mutex.lock();
+                     if ( m_abortFlag )
+                     {
+                        // Clear out the queue.
+                        m_jobQueue->getJobQueue()->clear();
+                        
+                        break; // Callee set our abort flag so break out of loop.
+                     }
+                     m_mutex.unlock();
+                  }
+               }
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_WARN)
+                  << M << " WARNING: file: \""<< file << "\" does not exist" << std::endl;
+            }
+         }
+
+         ++i;
+      
+      } // while ( i != files.end() )
+
+      // FOREVER loop until all jobs are completed.
+      while (1)
+      {
+         if ( OpenThreads::Thread::microSleep(250) == 0 )
+         {
+            if ( m_jobQueue->hasJobsToProcess() == false )
+            {
+               break;
+            }
+         }
+      }
+
+   } // if ( files.size() )
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exiting...\n";
+   }  
+}
+
+void ossimFileWalker::walk(const ossimFilename& root)
+{
+   static const char M[] = "ossimFileWalker::walk";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered root=" << root << "\n";
+   }
+
+   // Must have call back set at this point.
+   if ( !m_abortFlag && m_fileProcessor )
+   {
+      ossimFilename rootFile = root.expand();
+      if ( rootFile.size() && rootFile.exists() )
+      {
+         if ( rootFile.isDir() )
+         {
+            walkDir(rootFile);
+
+            // FOREVER loop until all jobs are completed.
+            while (1)
+            {
+               if ( OpenThreads::Thread::microSleep(250) == 0 )
+               {
+                  if ( m_jobQueue->hasJobsToProcess() == false )
+                  {
+                     break;
+                  }
+               }
+            }
+         }
+         else
+         {
+            // Single file no job queue needed.
+            if ( isFiltered( rootFile ) == false )
+            {
+               m_fileProcessor->processFile( rootFile );
+            }
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << M << " WARNING: file: \""<< rootFile << "\" does not exist" << std::endl;
+      }
+   }
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exiting...\n";
+   }  
+}
+
+void ossimFileWalker::walkDir(const ossimFilename& dir)
+{
+   static const char M[] = "ossimFileWalker::walkDir";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "processing dir: " << dir << "\n";
+   }
+
+   // List of directories in this directory...
+   std::vector<ossimFilename> dirs;
+   
+   // List of files in this directory...
+   std::vector<ossimFilename> files;
+
+   m_mutex.lock();
+   ossimDirectory d;
+   bool ossimDirectoryStatus = d.open(dir);
+   m_mutex.unlock();
+
+   if ( ossimDirectoryStatus )
+   {
+      // Loop to get the list of files and directories in this directory.
+      m_mutex.lock();
+      ossimFilename f;
+      bool valid_file = d.getFirst(f);
+      while ( valid_file )
+      {
+         if ( isFiltered(f) == false )
+         {
+            if (f.isDir())
+            {
+               dirs.push_back(f);
+            }
+            else
+            {
+               files.push_back(f);
+            }
+         }
+         valid_file = d.getNext(f);
+      }
+      m_mutex.unlock();
+
+      //---
+      // Process files first before recursing directories.  If a file is a directory base image,
+      // e.g. RPF, then the callee should call ossimFileWalker::setRecurseFlag to false to
+      // stop us from going into sub directories.
+      //---
+      std::vector<ossimFilename>::const_iterator i = files.begin();
+      while (i != files.end())
+      {
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "Making the job for: " << (*i) << std::endl;
+         }
+         
+         // Make the job:
+         ossimRefPtr<ossimFileWalkerJob> job =
+            new ossimFileWalkerJob( m_fileProcessor, (*i) );
+
+         job->setName( ossimString( (*i).string() ) );
+
+         job->setCallback( new ossimFileWalkerJobCallback() );
+
+         // Set the state to ready:
+         job->ready();
+
+         // Add job to the queue:
+         m_jobQueue->getJobQueue()->add( job.get() );
+
+         m_mutex.lock();
+         if ( m_abortFlag )
+         {
+            // Clear out the queue.
+            m_jobQueue->getJobQueue()->clear();
+            
+            break; // Callee set our abort flag so break out of loop.
+         }
+         m_mutex.unlock();
+
+         ++i;
+      }
+
+      if ( m_waitOnDirFlag )
+      {
+         // FOREVER loop until all jobs are completed.
+         while (1)
+         {
+            if ( OpenThreads::Thread::microSleep(250) == 0 )
+            {
+               if ( m_jobQueue->hasJobsToProcess() == false )
+               {
+                  break;
+               }
+            }
+         }
+      }
+
+      m_mutex.lock();
+      if ( !m_abortFlag && m_recurseFlag )
+      {
+         // Process sub directories...
+         i = dirs.begin();
+         while (i != dirs.end())
+         {
+            m_mutex.unlock();
+            walkDir( (*i) );
+            m_mutex.lock();
+
+            if ( m_abortFlag )
+            {
+               break; // Callee set our abort flag so break out of loop.
+            }
+            ++i;
+         }
+      }
+      m_mutex.unlock();
+      
+   } // if ( ossimDirectoryOpenStatus )
+
+   // Reset the m_recurseFlag.
+   m_mutex.lock();
+   m_recurseFlag = true;
+   m_mutex.unlock();
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+}
+
+bool ossimFileWalker::isFiltered(const ossimFilename& file) const
+{
+   bool result = false;
+   if ( file.size() )
+   {
+      if ( isDotFile(file) )
+      {
+         result = true;
+      }
+      else if ( file[file.size()-1] == '~' )
+      {
+         result = true;
+      }
+      else 
+      {
+         std::string ext = file.ext().downcase().c_str();
+         if ( ext.size() )
+         {
+            std::vector<std::string>::const_iterator i = m_filteredExtensions.begin();
+            while ( i != m_filteredExtensions.end() )
+            {
+               if ( ext == (*i) )
+               {
+                  result = true;
+                  break;
+               }
+               ++i;
+            }
+         }
+      }
+   }
+#if 0 /* Please leave for debug. (drb) */
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimFileWalker::isFiltered file " << (result?"filtered: ":"not filtered: ")
+         << file << "\n";
+   }
+#endif
+   
+   return result;
+}
+
+bool ossimFileWalker::isDotFile(const ossimFilename& f) const
+{
+   bool result = false;
+   
+   // Get the size in bytes.
+   if ( f.size() )
+   {
+      std::string::size_type firstDotPos = f.find('.');
+      if ( firstDotPos == 0 )
+      {
+         result = true;
+      }
+      else if ( firstDotPos != std::string::npos ) // Dot in file.
+      {
+         // Get the position of first dot from the end.
+         std::string::size_type lastDotPos = f.find_last_of('.');
+         if ( lastDotPos != std::string::npos )
+         {
+            // Make copy.
+            ossimFilename f2 = f;
+            
+            // Convert an '\'s to '/'s. 
+            // f2.convertBackToForwardSlashes();
+            
+            // Find the first slash from end.
+            std::string::size_type lastSlashPos = f2.find_last_of('/');
+            
+            if (lastSlashPos != std::string::npos) // Found a slash.
+            {
+               if ( (lastSlashPos+1) == lastDotPos )
+               {
+                  // dot in front of slash like /home/foo/.xemacs
+                  result = true;
+               }
+            }
+         }
+      }
+   }
+
+   return result;
+}
+
+const std::vector<std::string>& ossimFileWalker::getFilteredExtensions() const
+{
+   return m_filteredExtensions;
+}
+
+std::vector<std::string>& ossimFileWalker::getFilteredExtensions()
+{
+   return m_filteredExtensions;
+}
+
+void ossimFileWalker::dumpFilteredExtensionList() const
+{
+   ossimNotify(ossimNotifyLevel_NOTICE) << "Filtered extension list:\n";
+   std::vector<std::string>::const_iterator i = m_filteredExtensions.begin();
+   while ( i != m_filteredExtensions.end() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << (*i) << "\n";
+      ++i;
+   }
+   ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
+}
+
+void ossimFileWalker::initializeDefaultFilterList()
+{
+   m_mutex.lock();
+   
+   // Common extensions to filter out, most common first.
+   m_filteredExtensions.push_back(std::string("ovr"));
+   m_filteredExtensions.push_back(std::string("omd"));
+   m_filteredExtensions.push_back(std::string("his"));
+   m_filteredExtensions.push_back(std::string("geom"));
+   
+   // The rest alphabetical.
+   m_filteredExtensions.push_back(std::string("aux"));
+   m_filteredExtensions.push_back(std::string("bin"));
+   m_filteredExtensions.push_back(std::string("dbf"));
+   m_filteredExtensions.push_back(std::string("h5"));
+   m_filteredExtensions.push_back(std::string("hdr"));
+   m_filteredExtensions.push_back(std::string("jgw"));
+   m_filteredExtensions.push_back(std::string("jpw"));   
+   m_filteredExtensions.push_back(std::string("kwl"));
+   m_filteredExtensions.push_back(std::string("log"));
+   m_filteredExtensions.push_back(std::string("man"));
+   m_filteredExtensions.push_back(std::string("ocg"));
+   m_filteredExtensions.push_back(std::string("out"));
+   m_filteredExtensions.push_back(std::string("prj"));
+   m_filteredExtensions.push_back(std::string("save"));
+   m_filteredExtensions.push_back(std::string("sdw"));
+   m_filteredExtensions.push_back(std::string("sh"));
+   m_filteredExtensions.push_back(std::string("shp"));
+   m_filteredExtensions.push_back(std::string("shx"));
+   m_filteredExtensions.push_back(std::string("spec"));
+   m_filteredExtensions.push_back(std::string("statistics"));
+   m_filteredExtensions.push_back(std::string("tar"));
+   m_filteredExtensions.push_back(std::string("til"));   
+   m_filteredExtensions.push_back(std::string("tfw"));
+   m_filteredExtensions.push_back(std::string("tgz"));
+   m_filteredExtensions.push_back(std::string("tmp"));
+   m_filteredExtensions.push_back(std::string("txt"));
+
+   m_mutex.unlock();
+}
+
+void ossimFileWalker::setRecurseFlag(bool flag)
+{
+   m_mutex.lock();
+   m_recurseFlag = flag;
+   m_mutex.unlock();
+}
+
+void ossimFileWalker::setWaitOnDirFlag(bool flag)
+{
+   m_mutex.lock();
+   m_waitOnDirFlag = flag;
+   m_mutex.unlock();
+}
+
+void ossimFileWalker::setAbortFlag(bool flag)
+{
+   m_mutex.lock();
+   m_abortFlag = flag;
+   m_mutex.unlock();
+}
+
+void ossimFileWalker::setNumberOfThreads(ossim_uint32 nThreads)
+{
+   m_mutex.lock();
+   m_jobQueue->setNumberOfThreads(nThreads);
+   m_mutex.unlock();
+}
+
+void ossimFileWalker::setFileProcessor(ossimFileProcessorInterface* fpi)
+{
+   m_mutex.lock();
+   m_fileProcessor = fpi;
+   m_mutex.unlock();
+}
+
+ossimFileWalker::ossimFileWalkerJob::ossimFileWalkerJob(
+   ossimFileProcessorInterface* fpi,
+   const ossimFilename& file)
+   : m_fileProcessor( fpi ),
+     m_file( file )
+{
+}
+
+void ossimFileWalker::ossimFileWalkerJob::start()
+{
+   if ( m_fileProcessor && m_file.size() )
+   {
+      m_fileProcessor->processFile( m_file );
+   }
+}
+
+ossimFileWalker::ossimFileWalkerJobCallback::ossimFileWalkerJobCallback()
+   : ossimJobCallback()
+{
+}
+
+void ossimFileWalker::ossimFileWalkerJobCallback::started(ossimJob* job)
+{
+   ossimJobCallback::started(job);
+}
+
+void ossimFileWalker::ossimFileWalkerJobCallback::finished(ossimJob* job)
+{
+   ossimJobCallback::finished(job);
+}
+
+void ossimFileWalker::ossimFileWalkerJobCallback::canceled(ossimJob* job)
+{
+   ossimJobCallback::canceled(job);
+}
diff --git a/src/util/ossimHillshadeTool.cpp b/src/util/ossimHillshadeTool.cpp
new file mode 100644
index 0000000..7188933
--- /dev/null
+++ b/src/util/ossimHillshadeTool.cpp
@@ -0,0 +1,256 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGeoPolygon.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimRefreshEvent.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimVisitor.h>
+
+#include <ossim/imaging/ossimBrightnessContrastSource.h>
+#include <ossim/imaging/ossimBumpShadeTileSource.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimFusionCombiner.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimSFIMFusion.h>
+#include <ossim/imaging/ossimTwoColorView.h>
+#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
+#include <ossim/init/ossimInit.h>
+
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimUtmProjection.h>
+
+#include <ossim/support_data/ossimSrcRecord.h>
+#include <ossim/util/ossimHillshadeTool.h>
+#include <cmath>
+#include <sstream>
+#include <string>
+
+static ossimTrace traceDebug("ossimHillshadeUtil:debug");
+
+static const std::string COLOR_BLUE_KW           = "color_blue";
+static const std::string COLOR_GREEN_KW          = "color_green";
+static const std::string COLOR_RED_KW            = "color_red";
+static const std::string COLOR_SOURCE_KW         = "color_source";
+
+const char*  ossimHillshadeTool::DESCRIPTION =
+   "Computes shaded representation of input elevation surface with specified lighting parameters.";
+
+ossimHillshadeTool::ossimHillshadeTool()
+{
+   m_kwl.setExpandEnvVarsFlag(true);
+}
+
+// Private/hidden from use.
+ossimHillshadeTool::ossimHillshadeTool( const ossimHillshadeTool& /* obj */ )
+{
+}
+
+// Private/hidden from use.
+const ossimHillshadeTool& ossimHillshadeTool::operator=( const ossimHillshadeTool& /* rhs */)
+{
+   return *this;
+}
+
+ossimHillshadeTool::~ossimHillshadeTool()
+{
+   clear();
+}
+
+bool ossimHillshadeTool::initialize(ossimArgumentParser& ap)
+{
+   // Permit base class to pull out common options first.
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   std::string tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+   std::string tempString2;
+   ossimArgumentParser::ossimParameter stringParam2(tempString2);
+   std::string tempString3;
+   ossimArgumentParser::ossimParameter stringParam3(tempString3);
+   std::string tempString4;
+   ossimArgumentParser::ossimParameter stringParam4(tempString4);
+   std::string tempString5;
+   ossimArgumentParser::ossimParameter stringParam5(tempString5);
+   std::string tempString6;
+   ossimArgumentParser::ossimParameter stringParam6(tempString6);
+   double tempDouble1;
+   ossimArgumentParser::ossimParameter doubleParam1(tempDouble1);
+   double tempDouble2;
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+   
+   // Extract optional arguments and stuff them in a keyword list.
+   if( ap.read("--azimuth", stringParam1) )
+   {
+      m_kwl.addPair( std::string(ossimKeywordNames::AZIMUTH_ANGLE_KW), tempString1 );
+   }
+
+   if( ap.read("--color", stringParam1, stringParam2, stringParam3) )
+   {
+      m_kwl.addPair( COLOR_RED_KW,   tempString1 );
+      m_kwl.addPair( COLOR_GREEN_KW, tempString2 );
+      m_kwl.addPair( COLOR_BLUE_KW,  tempString3 );
+   }
+
+   int color_source_idx = 0;
+   while( ap.read("--color-source", stringParam1) )
+   {
+      ossimString key = COLOR_SOURCE_KW;
+      key += ossimString::toString(color_source_idx++);
+      key += ".";
+      key += ossimKeywordNames::FILE_KW;
+      m_kwl.addPair(key.string(), tempString1 );
+   }
+
+   if ( ap.read("--elevation", stringParam1) )
+   {
+      m_kwl.addPair( std::string(ossimKeywordNames::ELEVATION_ANGLE_KW), tempString1 );
+   }
+
+   processRemainingArgs(ap);
+   return true;
+}
+
+
+void ossimHillshadeTool::initProcessingChain()
+{
+   // Need a mosaic of DEM over the AOI as an image mosaic:
+   ossimRefPtr<ossimImageSource> demMosaic = mosaicDemSources();
+   m_procChain->add(demMosaic.get());
+
+   // Set up the normal source.
+   ossimRefPtr<ossimImageToPlaneNormalFilter> normSource = new ossimImageToPlaneNormalFilter;
+   normSource->setTrackScaleFlag(true);
+   m_procChain->add( normSource.get() );
+
+   // Set the smoothness factor.
+   ossim_float64 gain = 1.0;
+   normSource->setSmoothnessFactor(gain);
+
+   // Create the bump shade.
+   ossimRefPtr<ossimBumpShadeTileSource> bumpShade = new ossimBumpShadeTileSource;
+   m_procChain->add(bumpShade.get());
+
+   // Set the azimuth angle.
+   ossim_float64 azimuthAngle = 180;
+   ossimString lookup = m_kwl.findKey( ossimKeywordNames::AZIMUTH_ANGLE_KW );
+   if ( lookup.size() )
+   {
+      ossim_float64 f = lookup.toFloat64();
+      if ( (f >= 0) && (f <= 360) )
+      {
+         azimuthAngle = f;
+      }
+   }
+   bumpShade->setAzimuthAngle(azimuthAngle);
+
+   // Set the elevation angle.
+   ossim_float64 elevationAngle = 45.0;
+   lookup = m_kwl.findKey( ossimKeywordNames::ELEVATION_ANGLE_KW );
+   if ( lookup.size() )
+   {
+      ossim_float64 f = lookup.toFloat64();
+      if ( (f >= 0.0) && (f <= 90) )
+      {
+         elevationAngle = f;
+      }
+   }
+   bumpShade->setElevationAngle(elevationAngle);
+
+
+   // Color can be added via color image source:
+   if (!m_imgLayers.empty())
+   {
+      // A color source image (or list) is provided. Add them as input to bump shade:
+      ossimRefPtr<ossimImageSource> colorSource = combineLayers( m_imgLayers );
+      bumpShade->connectMyInputTo(1, colorSource.get());
+   }
+   else
+   {
+      // Default colors are grey:
+      ossim_uint8 r = 0xff;
+      ossim_uint8 g = 0xff;
+      ossim_uint8 b = 0xff;
+      lookup = m_kwl.findKey( COLOR_RED_KW );
+      if ( lookup.size() )
+         r = lookup.toUInt8();
+      lookup = m_kwl.findKey( COLOR_GREEN_KW );
+      if ( lookup.size() )
+         g = lookup.toUInt8();
+      lookup = m_kwl.findKey( COLOR_BLUE_KW );
+      if ( lookup.size() )
+         b = lookup.toUInt8();
+      bumpShade->setRgbColorSource(r, g, b);
+   }
+}
+
+void ossimHillshadeTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+   
+   // Set app name.
+   ossimString appName = ap.getApplicationName();
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = appName;
+   usageString += " hillshade [option]... [input-option]... <input-file(s)> <output-file>\nNote at least one input is required either from one of the input options, e.g. --input-dem <my-dem.hgt> or adding to command line in front of the output file in which case the code will try to ascertain what type of input it is.\n\nAvailable traces:\n-T \"ossimChipperUtil:debug\"   - General debug trace to standard out.\n-T \"ossimChipperUtil:log\"     - Writes a log file to output-file.log.\n-T \" [...]
+   au->setCommandLineUsage(usageString);
+
+   // Add arguments.
+   au->addCommandLineOption("--azimuth", "<azimuth>\nLight source azimuth angle for bump shade.\nRange: 0 to 360, Default = 180.0");
+   au->addCommandLineOption("--color","<r> <g> <b>\nSet the red, green and blue color values to be used with hillshade.\nRange 0 to 255, Defualt r=255, g=255, b=255");
+   au->addCommandLineOption("--color-source","<file>\nSpecifies the image file to use as a color source instead of a fixed RGB value.");
+   au->addCommandLineOption("--elevation", "<elevation>\nhillshade option - Light source elevation angle for bumb shade.\nRange: 0 to 90, Default = 45.0");
+
+   // Base class has its own:
+   ossimChipProcTool::setUsage(ap);
+
+   ostringstream description;
+   description << DESCRIPTION << "\n\nNOTES:\n"
+      << "1) Never use same base name in the same directory! Example is you have a Chicago.tif\n"
+      << "   and you want a Chicago.jp2, output Chicago.jp2 to its own directory.\n"
+      << "\nExample command to Hill shade: Hill shade two DEMs, output to a geotiff.\n"
+      << appName << " --color 255 255 255 --azimuth 270 --elevation 45 --exaggeration 2.0 N37W123.hgt N38W123.hgt outputs/hillshade.tif\n"
+      << "\n// Above command where all options are in a keyword list:\n"
+      << appName << " --options r39-options.kwl\n"
+      << std::endl;
+
+   au->setDescription(description.str());
+
+}
+
diff --git a/src/util/ossimHlzTool.cpp b/src/util/ossimHlzTool.cpp
new file mode 100644
index 0000000..e7d9def
--- /dev/null
+++ b/src/util/ossimHlzTool.cpp
@@ -0,0 +1,737 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/elevation/ossimImageElevationDatabase.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimSlopeFilter.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/point_cloud/ossimPointCloudHandlerRegistry.h>
+#include <ossim/util/ossimHlzTool.h>
+#include <fstream>
+
+static const string MASK_EXCLUDE_KW = "exclude_regions";
+static const string MASK_INCLUDE_KW = "include_regions";
+static const string SLOPE_OUTPUT_FILE_KW = "slope_output_file";
+static const string POINT_CLOUD_FILE_KW = "point_clouds";
+static const string HLZ_CODING_KW = "hlz_coding";
+static const string LZ_MIN_RADIUS_KW = "min_lz_radius";
+static const string ROUGHNESS_THRESHOLD_KW = "max_roughness";
+static const string SLOPE_THRESHOLD_KW = "max_slope";
+
+const char* ossimHlzTool::DESCRIPTION =
+      "Computes bitmap of helicopter landing zones given ROI and DEM.";
+
+using namespace std;
+
+ossimHlzTool::ossimHlzTool()
+: m_slopeThreshold(7.0),
+  m_roughnessThreshold(0.5),
+  m_hlzMinRadius(25.0),
+  m_outBuffer(NULL),
+  m_badLzValue(255),
+  m_marginalLzValue(128),
+  m_goodLzValue(64),
+  m_useLsFitMethod(true),
+  m_numThreads(1),
+  d_accumT(0)
+{
+}
+
+ossimHlzTool::~ossimHlzTool()
+{
+}
+
+void ossimHlzTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimChipProcTool::setUsage(ap);
+
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " hlz [options] <output-image>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->addCommandLineOption("--exclude-regions <file1>[, <file2>...]",
+         "List of raster image(s) representing mask files that defines regions to be excluded from "
+         "HLZ solutions. Any non-zero pixel is excluded Multiple filenames must be comma-separated.");
+   au->addCommandLineOption("--hlz-coding <bad> <marginal> <good>",
+         "Specifies the pixel values (0-255) for the output product corresponding to bad, marginal, "
+         "and good landing zones, respectively. Defaults to bad=255 (null), marginal=128, and "
+         "good=64.");
+   au->addCommandLineOption("--include-regions <file1>[, <file2>...]",
+         "List of raster image(s) representing mask files that defines regions where the HLZs ."
+         "identified must overlap. Any non-zero pixel represents an inclusion zone. Multiple "
+         "filenames must be comma-separated.");
+   au->addCommandLineOption("--output-slope <filename.tif>",
+         "Generates a slope byproduct image (floating point degrees) to the specified filename. "
+         "Only valid if normal-vector method used (i.e., --ls-fit option NOT specified)");
+   au->addCommandLineOption("--point-clouds <file1>[, <file2>...]",
+         "Specifies ancillary point-cloud data file(s) for level-2 search for obstructions. "
+         "Must be comma-separated file names.");
+   au->addCommandLineOption("--min-lz-radius <meters>",
+         "Specifies minimum radius of landing zone. Defaults to 25 m. ");
+   au->addCommandLineOption("--max-roughness <meters>",
+         "Specifies the terrain roughness threshold (meters). This is the maximum deviation from a "
+         "flat plane permitted. Defaults to 0.5 m. Valid only with --ls-fit specified.");
+   au->addCommandLineOption("--max-slope <degrees>",
+         "Threshold for acceptable landing zone terrain slope. Defaults to 7 deg.");
+   au->addCommandLineOption("--threads <n>",
+         "Number of threads. Defaults to use single core. For engineering/debug purposes.");
+   au->addCommandLineOption("--use-slope",
+         "Slope is computed from the normal vector using neighboring posts instead of "
+         "least-squares fit to a plane (prefered). For engineering/debug purposes.");
+}
+
+bool ossimHlzTool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   string ts1;
+   ossimArgumentParser::ossimParameter sp1(ts1);
+   string ts2;
+   ossimArgumentParser::ossimParameter sp2(ts2);
+   string ts3;
+   ossimArgumentParser::ossimParameter sp3(ts3);
+   ossimString  key ;
+
+   vector<ossimString> maskFnames;
+   ap.read("--exclude-regions", maskFnames);
+   for(ossim_uint32 idx=0; idx<maskFnames.size(); ++idx)
+   {
+      key = MASK_EXCLUDE_KW;
+      key += ossimString::toString(idx++);
+      m_kwl.addPair(key.string(), maskFnames[idx] );
+   }
+
+   if (ap.read("--hlz-coding", sp1, sp2, sp3) || ap.read("--values", sp1, sp2, sp3))
+   {
+      ostringstream value;
+      value<<ts1<<" "<<ts2<<" "<<ts3;
+      m_kwl.addPair( HLZ_CODING_KW, value.str() );
+   }
+
+   maskFnames.clear();
+   ap.read("--include-regions", maskFnames);
+   for(ossim_uint32 idx=0; idx<maskFnames.size(); ++idx)
+   {
+      key = MASK_INCLUDE_KW;
+      key += ossimString::toString(idx++);
+      m_kwl.addPair(key.string(), maskFnames[idx] );
+   }
+
+   if ( ap.read("--output-slope", sp1))
+      m_kwl.addPair(SLOPE_OUTPUT_FILE_KW, ts1);
+
+   vector<ossimString> pcFnames;
+   ap.read("--point-clouds", pcFnames);
+   for(ossim_uint32 idx=0; idx<pcFnames.size(); ++idx)
+   {
+      key = POINT_CLOUD_FILE_KW;
+      key += ossimString::toString(idx++);
+      m_kwl.addPair(key.string(), pcFnames[idx] );
+   }
+
+   if (ap.read("--min-lz-radius", sp1) || ap.read("--rlz", sp1))
+      m_kwl.addPair(LZ_MIN_RADIUS_KW, ts1);
+
+   if (ap.read("--max-roughness", sp1) || ap.read("--roughness", sp1))
+      m_kwl.addPair(ROUGHNESS_THRESHOLD_KW, ts1);
+
+   if (ap.read("--max-slope", sp1) || ap.read("--slope", sp1))
+      m_kwl.addPair(SLOPE_THRESHOLD_KW, ts1);
+
+   if (ap.read("--threads", sp1))
+   {
+      // Command line mode only
+      m_numThreads = ossimString(ts1).toUInt32();
+   }
+
+   if (ap.read("--use_slope"))
+   {
+      // Command line mode only
+      m_useLsFitMethod = false;
+   }
+
+   processRemainingArgs(ap);
+   return true;
+}
+
+void ossimHlzTool::initialize(const ossimKeywordlist& kwl)
+{
+   ossimString value;
+   ostringstream xmsg;
+
+   // Don't copy KWL if member KWL passed in:
+   if (&kwl != &m_kwl)
+   {
+      // Start with clean options keyword list.
+      m_kwl.clear();
+      m_kwl.addList( kwl, true );
+   }
+
+   value = m_kwl.findKey(LZ_MIN_RADIUS_KW);
+   if (!value.empty())
+      m_hlzMinRadius = value.toDouble();
+   if (m_hlzMinRadius < 1.0)
+   {
+      xmsg<<"ossimHlzUtil:"<<__LINE__<<"  The HLZ minimum radius is too small.";
+      throw(xmsg.str());
+   }
+
+   value = m_kwl.findKey(ROUGHNESS_THRESHOLD_KW);
+   if (!value.empty())
+      m_roughnessThreshold = value.toDouble();
+
+   value = m_kwl.findKey(SLOPE_THRESHOLD_KW);
+   if (!value.empty())
+      m_slopeThreshold = value.toDouble();
+
+   value = m_kwl.findKey(HLZ_CODING_KW);
+   if (!value.empty())
+   {
+      vector<ossimString> values = value.split(" ");
+      if (values.size() == 3)
+      {
+         m_badLzValue = values[0].toUInt8();
+         m_marginalLzValue = values[1].toUInt8();
+         m_goodLzValue = values[2].toUInt8();
+      }
+      else
+      {
+         xmsg<<"ossimHlzUtil:"<<__LINE__<<"  Unexpected number of values encountered for keyword <"
+               <<HLZ_CODING_KW<<">.";
+         throw(xmsg.str());
+      }
+   }
+
+   ossimChipProcTool::initialize(kwl);
+}
+
+void ossimHlzTool::initProcessingChain()
+{
+   ostringstream xmsg;
+
+   if (m_aoiGroundRect.hasNans() || m_aoiViewRect.hasNans())
+   {
+      xmsg<<"ossimHlzUtil:"<<__LINE__<<"  Encountered NaNs in AOI."<<ends;
+      throw ossimException(xmsg.str());
+   }
+
+
+   // If PC provided as file on command line, Load it. This uses the output ground rect so needs to
+   // be after the initialization of m_geom:
+   loadPcFiles();
+
+   // If threat-domes spec (or any mask) provided as file on command line, Load it:
+   loadMaskFiles();
+
+   // In order to use the slope filter to establish terrain quality, the elevation data needs to
+   // be loaded as images, not elevation cells. Need to transfer relevant cells to image chains:
+   m_combinedElevSource = mosaicDemSources();
+
+   // The "chain" for this utility is just the memory source containing the output buffer:
+   m_outBuffer = ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, m_aoiViewRect.width(),
+                                                           m_aoiViewRect.height());
+   if (!m_outBuffer.valid())
+   {
+      xmsg<<"ossimHlzUtil:"<<__LINE__<<"  Error encountered allocating output image buffer.";
+      throw(xmsg.str());
+   }
+   m_memSource = new ossimMemoryImageSource;
+   m_memSource->setImage(m_outBuffer);
+   m_memSource->setImageGeometry(m_geom.get());
+
+   // If input image(s) provided, need to combine them with the product:
+   if (m_imgLayers.empty())
+   {
+      m_procChain->add(m_memSource.get());
+   }
+   else
+   {
+      ossimRefPtr<ossimImageSource> combiner = combineLayers(m_imgLayers);
+      combiner->connectMyInputTo(m_memSource.get());
+      m_procChain->add(combiner.get());
+   }
+
+   if (!m_useLsFitMethod)
+   {
+      // Add the slope computation engine on the elevation source.
+      // Set up processing chain with plane to normal filter, equation combiner, and band selector.
+      ossimRefPtr<ossimSlopeFilter> slope_filter = new ossimSlopeFilter;
+      slope_filter->connectMyInputTo(m_combinedElevSource.get());
+      slope_filter->setSlopeType(ossimSlopeFilter::DEGREES);
+      m_combinedElevSource = slope_filter.get();
+      m_combinedElevSource->initialize();
+
+      m_slopeFile = m_kwl.findKey(SLOPE_OUTPUT_FILE_KW);
+      if (!m_slopeFile.empty())
+         writeSlopeImage();
+   }
+   // Determine number of posts (in one dimension) needed to cover the specified LZ radius:
+   if ((m_gsd.x == 0) || (m_gsd.y == 0) || m_gsd.hasNans())
+   {
+      ostringstream xmsg;
+      xmsg<<"ossimHlzUtil:"<<__LINE__<<"  Invalid GSD: "<<m_gsd;
+      throw(xmsg.str());
+   }
+
+   m_demFilterSize.x = (int) ceil(m_hlzMinRadius/m_gsd.x);
+   m_demFilterSize.y = (int) ceil(m_hlzMinRadius/m_gsd.y);
+   if ((m_demFilterSize.x < 2) || (m_demFilterSize.y < 2))
+   {
+      xmsg<<"ossimHlzUtil:"<<__LINE__<<"  The DEM provided does not have sufficient"
+                  " resolution to determine HLZs.";
+      throw ossimException(xmsg.str());
+   }
+}
+
+void ossimHlzTool::loadPcFiles()
+{
+   ostringstream xmsg;
+
+   ossimString key;
+   ossimFilename pc_file;
+   ossimPointCloudHandlerRegistry* registry = ossimPointCloudHandlerRegistry::instance();
+   ossimGrect pc_bbox;
+
+   for(ossim_uint32 idx=0; true; ++idx)
+   {
+      key = POINT_CLOUD_FILE_KW;
+      key += ossimString::toString(idx++);
+      pc_file = m_kwl.find(key.chars());
+      if (pc_file.empty())
+         break;
+
+      ossimRefPtr<ossimPointCloudHandler> pc_handler =  registry->open(pc_file);
+      if (!pc_handler.valid())
+      {
+         xmsg<<"ossimHlzUtil:"<<__LINE__<<"  Error loading point cloud file <"<<pc_file<<">.";
+         throw(xmsg.str());
+      }
+
+      // Verify that PC bounding rect overlaps the output bounding rect:
+      pc_handler->getBounds(pc_bbox);
+      if (m_aoiGroundRect.intersects(pc_bbox))
+      {
+         m_pcSources.push_back(pc_handler);
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+               << "ossimHLZUtil::loadPcFile() WARNING: point-cloud file <" << pc_file << "> "
+               << "does not overlap the output ROI." << endl;
+      }
+   }
+}
+
+void ossimHlzTool::loadMaskFiles()
+{
+   ostringstream xmsg;
+
+   ossimString key;
+   ossimFilename mask_file;
+
+  // Exclusion masks:
+   for(ossim_uint32 idx=0; true; ++idx)
+   {
+      key = MASK_EXCLUDE_KW;
+      key += ossimString::toString(idx++);
+      mask_file = m_kwl.find(key.chars());
+      if (mask_file.empty())
+         break;
+
+      MaskSource mask_image (this, mask_file, true);
+      if (mask_image.image.valid())
+         m_maskSources.push_back(mask_image);
+   }
+
+   // Inclusion masks:
+   for(ossim_uint32 idx=0; true; ++idx)
+   {
+      key = MASK_INCLUDE_KW;
+      key += ossimString::toString(idx++);
+      mask_file = m_kwl.find(key.chars());
+      if (mask_file.empty())
+         break;
+
+      // First check if the filename specified is an image file:
+      MaskSource mask_image (this, mask_file, false);
+      if (mask_image.image.valid())
+         m_maskSources.push_back(mask_image);
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimHlzTool::getChip(const ossimIrect& bounding_irect)
+{
+   ostringstream xmsg;
+   if (!m_geom.valid())
+      return 0;
+
+   m_aoiViewRect = bounding_irect;
+   m_geom->setImageSize( m_aoiViewRect.size() );
+   m_geom->localToWorld(m_aoiViewRect, m_aoiGroundRect);
+
+   if (computeHLZ())
+   {
+      // The memory source has been populated, now do the getTile on the full chain to pick up
+      // other filters inserted after the memsource:
+      return m_procChain->getTile( m_aoiViewRect, 0 );
+   }
+   // else:
+   return 0;
+}
+
+bool ossimHlzTool::execute()
+{
+   if (m_helpRequested)
+      return true;
+
+   getChip(m_aoiViewRect);
+   return ossimChipProcTool::execute();
+}
+
+bool ossimHlzTool::computeHLZ()
+{
+
+   // To help with multithreading, just load entire AOI of DEM into memory:
+   m_demBuffer = m_combinedElevSource->getTile(m_aoiViewRect);
+   if (!m_demBuffer.valid())
+      return false;
+
+   // Allocate the output image buffer:
+   m_outBuffer = ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, m_aoiViewRect.width(),
+                                                           m_aoiViewRect.height());
+   ostringstream xmsg;
+   if (!m_outBuffer.valid() || !m_memSource.valid())
+   {
+      xmsg<<"ossimHlzUtil:"<<__LINE__<<"  Error encountered allocating output image buffer.";
+      throw(xmsg.str());
+   }
+
+   // Initialize the image with all points hidden:
+   m_outBuffer->initialize();
+   m_outBuffer->setImageRectangle(m_aoiViewRect);
+   m_outBuffer->fill(0);
+   m_memSource->setImage(m_outBuffer);
+
+   d_accumT = 0;
+
+   // Establish loop limits in input DEM raster coordinate space:
+   ossim_int32 min_x = m_aoiViewRect.ul().x;
+   ossim_int32 min_y = m_aoiViewRect.ul().y;
+   ossim_int32 max_x = m_aoiViewRect.lr().x - m_demFilterSize.x;
+   ossim_int32 max_y = m_aoiViewRect.lr().y - m_demFilterSize.y;
+   ossimIpt chip_origin;
+   ossim_uint32 numPatches = (max_x-min_x)*(max_y-min_y);
+
+   // Determine the DEM step size as a fraction of the LZ radius:
+   const double CHIP_STEP_FACTOR = 0.25; // chip position increment as fraction of chip width
+   ossim_int32 dem_step =
+         (ossim_int32) floor(4*CHIP_STEP_FACTOR*m_hlzMinRadius/(m_gsd.x+m_gsd.y));
+   if (dem_step <= 0)
+      dem_step = 1;
+
+   // Hack: degrading to single thread when slope-image scheme is used. Runs extremely slow in
+   // multithread mode, but much faster as single thread than multithreaded ls-fit
+   if ((m_numThreads == 1) || !m_useLsFitMethod)
+   {
+      // Not threaded (or slope-image scheme):
+      setPercentComplete(0);
+      ossim_uint32 chipId = 0;
+      for (chip_origin.y = min_y; chip_origin.y <= max_y; chip_origin.y += dem_step)
+      {
+         for (chip_origin.x = min_x; chip_origin.x <= max_x; chip_origin.x += dem_step)
+         {
+            ossimHlzTool::PatchProcessorJob* job = 0;
+            if (m_useLsFitMethod)
+               job = new ossimHlzTool::LsFitPatchProcessorJob(this, chip_origin, chipId++);
+            else
+               job = new ossimHlzTool::NormPatchProcessorJob(this, chip_origin, chipId++);
+            job->start();
+         }
+         setPercentComplete(100*chipId/numPatches);
+      }
+   }
+   else
+   {
+      if (m_numThreads == 0)
+         m_numThreads = ossim::getNumberOfThreads();
+
+      // Loop over input DEM, creating a thread job for each filter window:
+      ossimRefPtr<ossimJobMultiThreadQueue> jobMtQueue =
+            new ossimJobMultiThreadQueue(0, m_numThreads);
+      ossimJobQueue* jobQueue = jobMtQueue->getJobQueue();
+
+      ossimNotify(ossimNotifyLevel_INFO) << "\nPreparing " << numPatches << " jobs..." << endl; // TODO: DEBUG
+      setPercentComplete(0);
+      ossim_int32 qsize = 0;
+      ossimIpt chip_origin;
+      ossim_uint32 chipId = 0;
+      for (chip_origin.y = min_y; chip_origin.y <= max_y; ++chip_origin.y)
+      {
+         for (chip_origin.x = min_x; chip_origin.x <= max_x; ++chip_origin.x)
+         {
+            //ossimNotify(ossimNotifyLevel_INFO) << "Submitting " << chipId << endl;
+            ossimHlzTool::PatchProcessorJob* job = 0;
+            if (m_useLsFitMethod)
+               job = new ossimHlzTool::LsFitPatchProcessorJob(this, chip_origin, chipId++);
+            else
+               job = new ossimHlzTool::NormPatchProcessorJob(this, chip_origin, chipId++);
+            jobQueue->add(job, false);
+         }
+         qsize = jobQueue->size();
+         setPercentComplete(100*(chipId-qsize)/numPatches);
+      }
+
+      // Wait until all chips have been processed before proceeding:
+      ossimNotify(ossimNotifyLevel_INFO) << "All jobs queued. Waiting for job threads to finish..." << endl;
+      while (jobMtQueue->hasJobsToProcess() || jobMtQueue->numberOfBusyThreads())
+      {
+         qsize = jobMtQueue->getJobQueue()->size();
+         setPercentComplete(100*(numPatches-qsize)/numPatches);
+         OpenThreads::Thread::microSleep(10000);
+      }
+      jobMtQueue = 0;
+   }
+
+   ossimNotify(ossimNotifyLevel_INFO) << "Finished processing chips." << endl;
+   return true;
+}
+
+void ossimHlzTool::writeSlopeImage()
+{
+   // Set up the writer:
+   ossimRefPtr<ossimImageFileWriter> writer = 0;
+   ossimTiffWriter* tif_writer = new ossimTiffWriter();
+   tif_writer->setGeotiffFlag(true);
+   tif_writer->setFilename(m_slopeFile);
+   writer = tif_writer;
+   writer->connectMyInputTo(0, m_combinedElevSource.get());
+   writer->setAreaOfInterest(m_aoiViewRect);
+   if (writer->execute())
+      ossimNotify(ossimNotifyLevel_INFO)<<"Wrote slope image to <"<<m_slopeFile<<">."<<endl;
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimHLZUtil::writeSlopeImage() Error encountered "
+            "writing slope image to <"<<m_slopeFile<<">."<<endl;
+   }
+}
+
+OpenThreads::ReadWriteMutex ossimHlzTool::PatchProcessorJob::m_bufMutex;
+
+ossimHlzTool::PatchProcessorJob::PatchProcessorJob(ossimHlzTool* hlzUtil, const ossimIpt& origin,
+                                   ossim_uint32 /*chip_id*/)
+: m_hlzUtil (hlzUtil),
+  m_demPatchUL (origin),
+  m_status (0),
+  m_nullValue (hlzUtil->m_demBuffer->getNullPix(0))
+{
+   m_demPatchLR.x = m_demPatchUL.x + m_hlzUtil->m_demFilterSize.x;
+   m_demPatchLR.y = m_demPatchUL.y + m_hlzUtil->m_demFilterSize.y;
+}
+
+void ossimHlzTool::PatchProcessorJob::start()
+{
+   bool passed = level1Test() && level2Test() && maskTest();
+   ossimIpt p;
+
+   OpenThreads::ScopedWriteLock lock (m_bufMutex);
+   for (p.y = m_demPatchUL.y; p.y < m_demPatchLR.y; ++p.y)
+   {
+      for (p.x = m_demPatchUL.x; p.x < m_demPatchLR.x; ++p.x)
+      {
+         if (passed && (m_status == 2))
+            m_hlzUtil->m_outBuffer->setValue(p.x, p.y, m_hlzUtil->m_goodLzValue);
+         else if (passed && (m_status == 1))
+            m_hlzUtil->m_outBuffer->setValue(p.x, p.y, m_hlzUtil->m_marginalLzValue);
+         else
+            m_hlzUtil->m_outBuffer->setValue(p.x, p.y, m_hlzUtil->m_badLzValue);
+      }
+   }
+}
+
+bool ossimHlzTool::LsFitPatchProcessorJob::level1Test()
+{
+   // Start with computing best-fit plane:
+   ossimIpt p;
+   double z;
+   double y_meters;
+   for (p.y = m_demPatchUL.y; p.y < m_demPatchLR.y; ++p.y)
+   {
+      y_meters = p.y*m_hlzUtil->m_gsd.y;
+      for (p.x = m_demPatchUL.x; p.x < m_demPatchLR.x; ++p.x)
+      {
+         z = m_hlzUtil->m_demBuffer->getPix(p, 0);
+         if ((z == m_nullValue) || ossim::isnan(z))
+            return false;
+         m_plane->addSample(p.x*m_hlzUtil->m_gsd.x, y_meters, z);
+      }
+   }
+   if (!m_plane->solveLS())
+      return false;
+
+   // The slope is derived from the normal unit vector. Extract that from the solution and test
+   // against threshold:
+   double a, b, c;
+   m_plane->getLSParms(a, b, c);
+   double z_proj = 1.0 / sqrt(a*a + b*b + 1.0);
+   double theta = fabs(ossim::acosd(z_proj));
+   if (theta > m_hlzUtil->m_slopeThreshold)
+      return false;
+
+   // Passed the slope test. Now measure the roughness as peak deviation from the plane:
+   double distance;
+   for (p.y = m_demPatchUL.y; (p.y < m_demPatchLR.y); ++p.y)
+   {
+      for (p.x = m_demPatchUL.x; (p.x < m_demPatchLR.x); ++p.x)
+      {
+         z = m_hlzUtil->m_demBuffer->getPix(p, 0);
+         distance = fabs(z_proj * (a*p.x + b*p.y + c - z));
+         if (distance > m_hlzUtil->m_roughnessThreshold)
+            return false;
+      }
+   }
+
+   m_status = 1; // indicates passed level 1
+   return true;
+}
+
+bool ossimHlzTool::NormPatchProcessorJob::level1Test()
+{
+   // The processing chain is outputing slope values in degrees from vertical.
+   // Scan the data tile for slopes outside the threshold:
+   ossimIpt p;
+   float theta;
+   for (p.y = m_demPatchUL.y; p.y < m_demPatchLR.y; ++p.y)
+   {
+      for (p.x = m_demPatchUL.x; p.x < m_demPatchLR.x; ++p.x)
+      {
+         theta = m_hlzUtil->m_demBuffer->getPix(p, 0);
+         if ((theta == m_nullValue) || ossim::isnan(theta) || (theta > m_hlzUtil->m_slopeThreshold))
+            return false;
+      }
+   }
+
+   m_status = 1; // indicates passed level 1
+   return true;
+}
+
+bool ossimHlzTool::PatchProcessorJob::level2Test()
+{
+   // Level 2 only valid if a point cloud dataset is available:
+   if (m_hlzUtil->m_pcSources.empty())
+   {
+      ++m_status; // assumes level2 passes
+      return true;
+   }
+
+   // Need to convert DEM file coordinate bounds to geographic.
+   ossimGpt chipUlGpt, chipLrGpt;
+   m_hlzUtil->m_geom->localToWorld(ossimDpt(m_demPatchUL), chipUlGpt);
+   m_hlzUtil->m_geom->localToWorld(ossimDpt(m_demPatchLR), chipLrGpt);
+   chipUlGpt.hgt = ossim::nan();
+   chipLrGpt.hgt = ossim::nan();
+   ossimGrect grect (chipUlGpt, chipLrGpt);
+
+   // TODO: LIMITATION: Only a single point cloud source is considered. Need to expand to handle
+   // a list:
+   const ossimPointCloudHandler* pc_src = m_hlzUtil->m_pcSources[0].get();
+
+   // First check if there is even any coverage:
+   m_status = 0; // reset assumes no coverage
+   ossimGrect bb;
+   pc_src->getBounds(bb);
+   if (!bb.intersects(grect))
+      return false;
+
+   ossimPointBlock pc_block(0, ossimPointRecord::ReturnNumber|ossimPointRecord::NumberOfReturns);
+   pc_src->getBlock(grect, pc_block);
+   if (pc_block.empty())
+      return false;
+
+   bool found_obstruction = false;
+
+   // Scan the block for obstructions:
+   ossimGpt point_plh;
+   ossimDpt point_xy;
+   ossim_uint32 numPoints = pc_block.size();
+   for (ossim_uint32 i=0; (i<numPoints) && !found_obstruction; ++i)
+   {
+      //If this is not the only return, implies clutter along the ray:
+      int num_returns = (int) pc_block[i]->getField(ossimPointRecord::NumberOfReturns);
+      if (num_returns > 1)
+      {
+         found_obstruction = true;
+         break;
+      }
+   }
+
+   if (!found_obstruction)
+      m_status = 2;
+
+   return true;
+}
+
+bool ossimHlzTool::PatchProcessorJob::maskTest()
+{
+   // Threat dome only valid if a mask source is available:
+   if (m_hlzUtil->m_maskSources.empty())
+      return true;
+
+   ossimIrect chipRect (m_demPatchUL, m_demPatchLR);
+   vector<MaskSource>::iterator mask_source = m_hlzUtil->m_maskSources.begin();
+   bool test_passed = true;
+   ossimIpt p;
+   ossim_uint8 mask_value;
+
+   while ((mask_source != m_hlzUtil->m_maskSources.end()) && test_passed)
+   {
+      ossimRefPtr<ossimImageData> mask_data = mask_source->image->getTile(chipRect);
+      for (p.y = m_demPatchUL.y; (p.y < m_demPatchLR.y) && test_passed; ++p.y)
+      {
+         for (p.x = m_demPatchUL.x; (p.x < m_demPatchLR.x) && test_passed; ++p.x)
+         {
+            mask_value = mask_data->getPix(p);
+            if (( mask_value &&  mask_source->exclude) || (!mask_value && !mask_source->exclude))
+               test_passed = false;
+         }
+      }
+      ++mask_source;
+   }
+
+   return test_passed;
+}
+
+ossimHlzTool::MaskSource::MaskSource(ossimHlzTool* hlzUtil,
+                                     const ossimFilename& mask_image,
+                                     bool exclusion)
+:  exclude (exclusion)
+{
+   image = hlzUtil->createInputChain(mask_image);
+}
diff --git a/src/util/ossimImageUtil.cpp b/src/util/ossimImageUtil.cpp
new file mode 100644
index 0000000..5898d4a
--- /dev/null
+++ b/src/util/ossimImageUtil.cpp
@@ -0,0 +1,2165 @@
+//----------------------------------------------------------------------------
+// File: ossimImageUtil.cpp
+// 
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description: ossimImageUtil class definition
+//
+// Utility class for processing image recursively.  This is for doing things like:
+// building overview, histograms, compute min/max, extract vertices.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/util/ossimImageUtil.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimDatumFactoryRegistry.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimPropertyInterface.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/plugin/ossimSharedPluginRegistry.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/support_data/ossimSupportFilesList.h>
+#include <ossim/util/ossimFileWalker.h>
+
+#include <cstdlib>
+#include <iomanip>
+#include <string>
+#include <vector>
+ 
+static std::string CMM_MAX_KW                  = "cmm_max"; // CMM(ComputeMinMax)
+static std::string CMM_MIN_KW                  = "cmm_min";
+static std::string CMM_NULL_KW                 = "cmm_null";
+static std::string COPY_ALL_FLAG_KW            = "copy_all_flag";
+static std::string CREATE_HISTOGRAM_KW         = "create_histogram";
+static std::string CREATE_HISTOGRAM_FAST_KW    = "create_histogram_fast";
+static std::string CREATE_HISTOGRAM_R0_KW      = "create_histogram_r0";
+static std::string CREATE_OVERVIEWS_KW         = "create_overviews";
+static std::string DUMP_FILTERED_IMAGES_KW     = "dump_filter_image";
+static std::string FALSE_KW                    = "false";
+static std::string FILE_KW                     = "file";
+static std::string INTERNAL_OVERVIEWS_FLAG_KW  = "internal_overviews_flag";
+static std::string OUTPUT_DIRECTORY_KW         = "output_directory";
+static std::string OUTPUT_FILENAMES_KW         = "output_filenames";
+static std::string OVERRIDE_FILTERED_IMAGES_KW = "override_filtered_images";
+static std::string OVERVIEW_STOP_DIM_KW        = "overview_stop_dimension";
+static std::string OVERVIEW_TYPE_KW            = "overview_type";
+static std::string READER_PROP_KW              = "reader_prop";
+static std::string REBUILD_HISTOGRAM_KW        = "rebuild_histogram";
+static std::string REBUILD_OVERVIEWS_KW        = "rebuild_overviews";
+static std::string SCAN_MIN_MAX_KW             = "scan_for_min_max";
+static std::string SCAN_MIN_MAX_NULL_KW        = "scan_for_min_max_null";
+static std::string THREADS_KW                  = "threads";
+static std::string TILE_SIZE_KW                = "tile_size";
+static std::string TRUE_KW                     = "true";
+static std::string WRITER_PROP_KW              = "writer_prop";
+ 
+// Static trace for debugging.  Use -T ossimImageUtil to turn on.
+static ossimTrace traceDebug = ossimTrace("ossimImageUtil:debug");
+ 
+ossimImageUtil::ossimImageUtil()
+   :
+   ossimReferenced(),
+   ossimFileProcessorInterface(),
+   m_kwl( new ossimKeywordlist() ),
+   m_fileWalker(0),
+   m_mutex(),
+   m_errorStatus(0),
+   m_filteredImages(0)
+{
+}
+ 
+ossimImageUtil::~ossimImageUtil()
+{
+   if ( m_fileWalker )
+   {
+      delete m_fileWalker;
+      m_fileWalker = 0;
+   }
+}
+    
+void ossimImageUtil::addOptions(ossimApplicationUsage* au)
+{
+   // Set the command line options:
+   au->addCommandLineOption("-a or --include-fullres", "Copy full res dataset to overview file as well as building reduced res sets. Option only valid with tiff overview builder. Requires -o option.");
+ 
+   au->addCommandLineOption("--ch or --create-histogram", "Computes full histogram alongside overview.");
+ 
+   au->addCommandLineOption("--chf or --create-histogram-fast", "Computes a histogram in fast mode which samples partial tiles.");
+ 
+   au->addCommandLineOption("--compression-quality", "Compression quality for TIFF JPEG takes values from 0 to 100, where 100 is best.  For J2K plugin, numerically_lossless, visually_lossless, lossy");
+ 
+   au->addCommandLineOption("--compute-min-max", "Turns on min, max scanning when reading tiles and writes a dot omd file. This option assumes the null is known.");
+ 
+   au->addCommandLineOption("--compute-min-max-null", "Turns on min, max, null scanning when reading tiles and write a dot omd file. This option tries to find a null value which is useful for float data.");
+ 
+   au->addCommandLineOption("--compression-type", "Compression type can be: deflate, jpeg, lzw, none or packbits");
+ 
+   au->addCommandLineOption("--create-histogram-r0", "Forces create-histogram code to compute a histogram using r0 instead of the starting resolution for the overview builder. Can require a separate pass of R0 layer if the base image has built in overviews.");
+ 
+   au->addCommandLineOption("-d", "<output_directory> Write overview to output directory specified.");
+ 
+   au->addCommandLineOption("--dump-filtered-image-list", "Outputs list of filtered images and extensions.");
+ 
+   au->addCommandLineOption("-h", "Display this information");
+ 
+   au->addCommandLineOption("-i or --internal-overviews", "Builds internal overviews. Requires -o option. Option only valid with tiff input image and tiff overview builder. WARNING: Modifies source image and cannot be undone!");
+ 
+   au->addCommandLineOption("--list-entries", "Lists the entries within the image");
+ 
+   au->addCommandLineOption("--max","Overrides max value for compute-min-max option.");
+ 
+   au->addCommandLineOption("--min","Overrides min value for compute-min-max option.");
+ 
+   au->addCommandLineOption("--null", "<null_value> Overrides null value for compute-min-max option.  e.g. -9999.0 for float data");
+ 
+   au->addCommandLineOption("-o", "Creates overviews. (default=ossim_tiff_box)");
+ 
+   au->addCommandLineOption("--of or --output-files", "Output image files we can open, exluding overviews.");
+
+   au->addCommandLineOption("--options","<options.kwl>  This can be all or part of the application options. Also used for custom prep, per file and post system commands. To get a template you can turn on trace to the ossimImageUtil class by adding \"-T ossimImageUtil\" to your command.");
+ 
+   au->addCommandLineOption("--ot", "<overview_type> Overview type. see list at bottom for valid types. (default=ossim_tiff_box)");
+ 
+   au->addCommandLineOption("--override-filtered-images", "Allows processing of file that is in the filtered image list.");
+ 
+   au->addCommandLineOption("-r or --rebuild-overviews", "Rebuild overviews even if they are already present.");
+ 
+   au->addCommandLineOption("--rebuild-histogram", "Rebuild histogram even if they are already present.");
+ 
+   au->addCommandLineOption("--reader-prop", "Adds a property to send to the reader. format is name=value");
+ 
+   au->addCommandLineOption("-s",  "Stop dimension for overviews.  This controls how \nmany layers will be built. If set to 64 then the builder will stop when height and width for current level are less than or equal to 64.  Note a default can be set in the ossim preferences file by setting the keyword \"overview_stop_dimension\".");
+
+   au->addCommandLineOption("--tile-size", "<size> Defines the tile size for overview builder.  Tiff option only. Must be a multiple of 16. Size will be used in both x and y directions. Note a default can be set in your ossim preferences file by setting the key \"tile_size\".");
+ 
+   au->addCommandLineOption("--threads", "<threads> The number of threads to use. (default=1) Note a default can be set in your ossim preferences file by setting the key \"ossim_threads\".");
+ 
+   au->addCommandLineOption("--writer-prop", "Adds a property to send to the writer. format is name=value");
+}
+
+void ossimImageUtil::addArguments(ossimArgumentParser& ap)
+{
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [options] <file-or-directory-to-walk>";
+   au->setCommandLineUsage(usageString);
+
+   addOptions(au);
+ 
+} // void ossimImageUtil::addArguments(ossimArgumentParser& ap)
+ 
+bool ossimImageUtil::initialize(ossimArgumentParser& ap)
+{
+   static const char M[] = "ossimImageUtil::initialize(ossimArgumentParser&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+ 
+   bool result = true;
+ 
+   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
+   {
+      usage(ap);
+ 
+      // continue_after_init to false
+      result = false;
+   }
+   else
+   {
+      // Start with clean options keyword list.
+      m_kwl->clear();
+
+      // Used throughout below:
+      std::string ts1;
+      ossimArgumentParser::ossimParameter sp1(ts1);
+      std::string ts2;
+      ossimArgumentParser::ossimParameter sp2(ts2);
+ 
+      while ( 1 ) //  While forever loop...
+      {
+         if( ap.read("-a") || ap.read("--include-fullres") )
+         {
+            setCopyAllFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--compression-quality", sp1) )
+         {
+            if ( ts1.size() )
+            {
+               setCompressionQuality( ts1 );
+            }
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--compression-type", sp1) )
+         {
+            if ( ts1.size() )
+            {
+               setCompressionType( ts1 );
+            }
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--ch") || ap.read("--create-histogram") )
+         {
+            setCreateHistogramFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--chf") || ap.read("--create-histogram-fast") )
+         {
+            setCreateHistogramFastFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--compute-min-max") )
+         {
+            setScanForMinMax( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--compute-min-max-null") )
+         {
+            setScanForMinMaxNull( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--create-histogram-r0") )
+         {
+            setCreateHistogramR0Flag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("-d", sp1) )
+         {
+            setOutputDirectory( ts1 );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--dump-filtered-image-list") )
+         {
+            setDumpFilteredImageListFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("-i") || ap.read("--internal-overviews") )
+         {
+            setInternalOverviewsFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--max", sp1) )
+         {
+            addOption( CMM_MAX_KW, ts1 );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--min", sp1) )
+         {
+            addOption( CMM_MIN_KW, ts1 );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--null", sp1) )
+         {
+            addOption( CMM_NULL_KW, ts1 );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+
+         if( ap.read("--options", sp1) )
+         {
+            ossimFilename optionsKwl = ts1;
+            if ( optionsKwl.exists() )
+            {
+               if ( m_kwl->addFile(optionsKwl) == false )
+               {
+                  std::string errMsg = "ERROR could not open options keyword list file: ";
+                  errMsg += optionsKwl.string();
+                  throw ossimException(errMsg);
+               }
+            }
+            else
+            {
+               std::string errMsg = "ERROR options keyword list file does not exists: ";
+               errMsg += optionsKwl.string();
+               throw ossimException(errMsg); 
+            }
+         }
+         
+         if( ap.read("--of") || ap.read("--output-files") )
+         {
+            setOutputFileNamesFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("-o") )
+         {
+            setCreateOverviewsFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }        
+ 
+         if( ap.read("--ot", sp1) )
+         {
+            setOverviewType( ts1 );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--override-filtered-images") )
+         {
+            setOverrideFilteredImagesFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("-r") || ap.read("--rebuild-overviews") )
+         {
+            setRebuildOverviewsFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--rebuild-histogram") )
+         {
+            setRebuildHistogramFlag( true );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         while(ap.read("--reader-prop", sp1))
+         {
+            if (ts1.size())
+            {
+               std::string key = READER_PROP_KW;
+               key += ossimString::toString( getNextReaderPropIndex() ).string();
+               addOption( key, ts1 );
+            }
+         }
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+ 
+         if( ap.read("-s", sp1) )
+         {
+            setOverviewStopDimension( ts1 );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if ( ap.read("--tile-size", sp1))
+         {
+            setTileSize( ossimString(ts1).toInt32() );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         if( ap.read("--threads", sp1) )
+         {
+            m_kwl->addPair( THREADS_KW, ts1 );
+            if ( ap.argc() < 2 )
+            {
+               break;
+            }
+         }
+ 
+         while(ap.read("--writer-prop", sp1))
+         {
+            if (ts1.size())
+            {
+               std::string key = WRITER_PROP_KW;
+               key += ossimString::toString( getNextWriterPropIndex() ).string();
+               addOption( key, ts1 );
+            }
+         }
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+ 
+         // End of arg parsing.
+         ap.reportRemainingOptionsAsUnrecognized();
+         if ( ap.errors() )
+         {
+            ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+            std::string errMsg = "Unknown option...";
+            throw ossimException(errMsg);
+         }
+ 
+         break; // Break from while forever.
+ 
+      } // End while (forever) loop.
+ 
+      if(ap.argc() > 1)
+      {
+         for (ossim_int32 i = 0; i < (ap.argc()-1); ++i)
+         {
+            ossimString kw = FILE_KW;
+            kw += ossimString::toString(i);
+            std::string value = ap[i+1];
+            m_kwl->addPair(kw.string(), value, true);
+         }
+      }
+      else
+      {
+         if ( getDumpFilterImagesFlag() )
+         {
+            // Caller wants to see filtered image names:
+            if ( m_filteredImages.empty() )
+            {
+               initializeDefaultFilterList();
+            }
+
+            // Dump our filtered images.
+            dumpFilteredImageList();
+
+            if ( !m_fileWalker )
+            {
+               m_fileWalker = new ossimFileWalker();
+               m_fileWalker->initializeDefaultFilterList();
+            }
+
+            // Dump the file walker's filtered extensions.
+            m_fileWalker->dumpFilteredExtensionList();
+         }
+         else
+         {
+            usage(ap);
+         }
+ 
+         // continue_after_init to false
+         result = false; 
+ 
+      }
+ 
+   } // not usage
+ 
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "m_kwl:\n" << *(m_kwl.get()) << "\n"
+         << M << " exit result = " << (result?"true":"false")
+         << "\n";
+   }
+ 
+   return result;
+}
+ 
+ossim_int32 ossimImageUtil::execute()
+{
+   static const char M[] = "ossimImageUtil::execute()";
+ 
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+
+   // Launch any prep system commands:
+   executePrepCommands();
+
+   // Get the number of "file*" keywords.
+   ossim_uint32 fileCount = m_kwl->numberOf("file");
+ 
+   if ( fileCount )
+   {
+      if ( !m_fileWalker )
+      {
+         m_fileWalker = new ossimFileWalker();
+      }
+ 
+      m_fileWalker->setNumberOfThreads( getNumberOfThreads() );
+ 
+      // Must set this so we can stop recursion on directory based images.
+      m_fileWalker->setWaitOnDirFlag( true );
+ 
+      // This links the file walker back to our "processFile" method.
+      m_fileWalker->setFileProcessor( this );
+ 
+      // Wrap in try catch block as excptions can be thrown under the hood.
+      try
+      {
+         // Get the list of files passed to us:
+         std::vector<ossimFilename> files;
+         ossim_uint32 processedFiles = 0;;
+         ossim_uint32 i = 0;
+         while ( processedFiles < fileCount )
+         {
+            ossimString key = FILE_KW;
+            key += ossimString::toString(i);
+            std::string lookup = m_kwl->findKey( key.string() );
+            if ( lookup.size() )
+            {
+               files.push_back( ossimFilename(lookup) );
+               ++processedFiles;
+            }
+ 
+            ++i;
+            if ( i > (fileCount + 100) ) break;
+         }
+
+         //---
+         // If the file count is one and it is not a directory, we will assume
+         // the caller wanted to process that file. So leave the filter list
+         // blank.
+         //---
+         if ( (getOverrideFilteredImagesFlag() == false) && files.size() &&
+              ( (files.size() > 1) || (files[0].isDir() == true) ) )
+         {
+            if ( m_filteredImages.empty() )
+            {
+               initializeDefaultFilterList();
+            }
+            if ( m_fileWalker->getFilteredExtensions().empty() )
+            {
+               m_fileWalker->initializeDefaultFilterList();
+            }
+         }         
+
+         // Process the files:
+         m_fileWalker->walk( files ); 
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "Caught exception: " << e.what() << endl;
+         setErrorStatus( ossimErrorCodes::OSSIM_ERROR );
+      }
+ 
+   } // if ( fileCount )
+
+   // Launch any post system commands:
+   executePostCommands();
+   
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " exit status: " << m_errorStatus << std::endl;
+   }
+ 
+   // Zero is good, non zero is bad.
+   return m_errorStatus; 
+}
+ 
+//---
+// This method is called back by the ossimFileWalker::walk method for each file it finds that it
+// deems can be processed.
+//---
+void ossimImageUtil::processFile(const ossimFilename& file)
+{
+   static const char M[] = "ossimImageUtil::processFile";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << M << " entered...\n" << "file: " << file << "\n";
+   }
+ 
+   bool processFileFlag = true;
+   if ( !getOverrideFilteredImagesFlag() )
+   {
+      processFileFlag = !isFiltered( file );
+   }
+ 
+   if ( processFileFlag )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << "Processing file: " << file << std::endl;
+ 
+      m_mutex.lock();
+      ossimRefPtr<ossimImageHandler> ih =
+         ossimImageHandlerRegistry::instance()->open(file, true, true);
+      m_mutex.unlock();
+ 
+      if ( ih.valid() && !ih->hasError() )
+      {
+         // Check for output directory:
+         if ( m_kwl->hasKey( OUTPUT_DIRECTORY_KW ) )
+         {
+            ossimFilename outputDir;
+            outputDir.string() = m_kwl->findKey( OUTPUT_DIRECTORY_KW );
+
+            if ( outputDir.exists() && outputDir.isDir() )
+            {
+               ih->setSupplementaryDirectory( outputDir );
+            }
+         }
+         
+         if ( isDirectoryBasedImage( ih.get() ) )
+         {
+            // Tell the walker not to recurse this directory.
+            m_mutex.lock();
+            m_fileWalker->setRecurseFlag(false);
+            m_mutex.unlock();
+         }
+
+         // Set any reader props:
+         ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>(ih.get());
+         if ( pi ) setProps(pi);
+ 
+         bool consumedHistogramOptions  = false;
+         bool consumedCmmOptions = false;
+ 
+         if ( getOutputFileNamesFlag() )
+         {
+            // Simply output the file name of any images we can open:
+            ossimNotify(ossimNotifyLevel_NOTICE) << ih->getFilename().expand(); 
+         }
+ 
+         // Compute/Scan for min, max.  Note the overview sequencer may have computed for us.
+         if ( ( scanForMinMax() || scanForMinMaxNull() ) && !consumedCmmOptions )
+         {
+            computeMinMax( ih );
+         }
+
+         if ( createOverviews() )
+         {
+            // Skip shape files...
+            if ( ih->getClassName() != "ossimOgrGdalTileSource" )
+            {
+               createOverview(ih, consumedHistogramOptions, consumedCmmOptions);
+            }
+         }
+ 
+         // Build stand alone histogram.  Note the overview sequencer may have computed for us.
+         if ( hasHistogramOption() && !consumedHistogramOptions)
+         {
+            createHistogram( ih );
+         }
+ 
+         // Launch any file system commands.
+         executeFileCommands( file );
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << M << "\nCould not open: " << file << std::endl;
+      }
+   }
+   else // Matches: if ( processFileFlag )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "Filtered file, not processing: " << file << std::endl;
+   }
+ 
+   if(traceDebug())
+   {
+      // Since ossimFileWalker is threaded output the file so we know which job exited.
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << "\nfile: " << file << "\nexited...\n";
+   }
+}
+
+// Create overview for image:
+void ossimImageUtil::createOverview( ossimRefPtr<ossimImageHandler>& ih,
+                                     bool& consumedHistogramOptions,
+                                     bool& consumedCmmOptions )
+{
+   static const char M[] = "ossimImageUtil::createOverview #1";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+ 
+   if ( ih.valid() )
+   {
+      // Get the entry list:
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+ 
+      bool useEntryIndex = false;
+      if ( entryList.size() )
+      {
+         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
+      }
+
+      // Create the overview builder:
+      ossimString overviewType;
+      getOverviewType( overviewType.string() );
+      ossimRefPtr<ossimOverviewBuilderBase> ob =
+         ossimOverviewBuilderFactoryRegistry::instance()->createBuilder(overviewType);
+      if ( ob.valid() )
+      {
+         // Set up any overview builder options that don't involve histograms.
+         ossimPropertyInterface* pi = dynamic_cast<ossimPropertyInterface*>( ob.get() );
+         if ( pi ) setProps(pi);
+ 
+         ossim_uint32 stopDimension = getOverviewStopDimension();
+         if ( stopDimension ) ob->setOverviewStopDimension(stopDimension);
+ 
+         if ( ( scanForMinMax() || scanForMinMaxNull() ) && !hasCmmOption() )
+         {
+            //---
+            // If scan is set and we don't have any min, max, null overrides let the
+            // overview builder scan for min, max.
+            //
+            // If min, max, or null option is set, scan will be performed in
+            // separate function.
+            //---
+            ob->setScanForMinMax( scanForMinMax() );
+            ob->setScanForMinMaxNull( scanForMinMaxNull() );
+            consumedCmmOptions = true;
+         }
+ 
+         for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
+         {
+            createOverview(ih, ob, entryList[idx], useEntryIndex, consumedHistogramOptions);
+         }
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ERROR:\nCould not create builder for:  "<< overviewType << std::endl;
+         outputOverviewWriterTypes();
+      }
+   }
+ 
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+}
+
+// Create overview for entry:
+void ossimImageUtil::createOverview(ossimRefPtr<ossimImageHandler>& ih,
+                                    ossimRefPtr<ossimOverviewBuilderBase>& ob,
+                                    ossim_uint32 entry,
+                                    bool useEntryIndex,
+                                    bool& consumedHistogramOptions)
+{
+   static const char M[] = "ossimImageUtil::createOverview #2";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+ 
+   if ( ih.valid() && ob.valid() )
+   {
+      if (useEntryIndex)
+      {
+         // Set entry before deriving file name.
+         ih->setCurrentEntry(entry);
+         ossimNotify(ossimNotifyLevel_NOTICE) << "entry number: "<< entry << std::endl;
+      }
+ 
+      ossimFilename outputFile =
+         ih->getFilenameWithThisExtension(ossimString(".ovr"), useEntryIndex);
+ 
+      if ( rebuildOverviews() )
+      {
+         ih->closeOverview(); 
+         if ( outputFile.exists() )
+         {
+            outputFile.remove();
+         }
+      }
+ 
+      if ( getInternalOverviewsFlag() )
+      {
+         if ( ih->getClassName() == "ossimTiffTileSource")
+         {
+            //---
+            // INTERNAL_OVERVIEWS_FLAG_KW is set to true:
+            // Tiff reader can handle internal overviews.  Set the output file to
+            // input file.  Do it after the above remove so that if there were
+            // external overviews they will get removed.
+            //---
+            outputFile = ih->getFilename();
+         }
+         else 
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "Internal overviews not supported for reader type: "
+               <<ih->getClassName()
+               << "\nIgnoring option..."
+               << endl;
+         }
+      }
+ 
+      if ( hasRequiredOverview( ih, ob ) == false )
+      {
+         //---
+         // Set create histogram code...
+         //
+         // Notes:
+         // 1) Must put this logic after any removal of external overview file.
+         // 
+         // 2) Base file could have built in overviews, e.g. jp2 files.  So the sequensor could
+         //    start at R6 even if there is no external overview file.
+         //
+         // 3) If user want the histogram from R0 the overview builder can do as long as
+         //    ossimImageHandler::getNumberOfDecimationLevels returns 1.  If we are starting
+         //    overview building at R6 then we must do the create histogram in a separate path.
+         //---
+         ossimHistogramMode histoMode = OSSIM_HISTO_MODE_UNKNOWN;
+         if ( createHistogram() ||
+              ( createHistogramR0() && ( ih->getNumberOfDecimationLevels() == 1 ) ) )
+         {
+            histoMode = OSSIM_HISTO_MODE_NORMAL;
+         }
+         else if ( createHistogramFast() )
+         {
+            histoMode = OSSIM_HISTO_MODE_FAST;
+         }
+ 
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << "Histogram mode: " << histoMode << "\n";
+         }
+ 
+         if ( histoMode != OSSIM_HISTO_MODE_UNKNOWN )
+         {
+            consumedHistogramOptions = true;
+            ob->setHistogramMode(histoMode);
+ 
+            ossimNotify(ossimNotifyLevel_NOTICE)
+               << "Creating overviews with histogram for file: " << ih->getFilename() << std::endl;
+         }
+         else
+         {
+            if ( histoMode != OSSIM_HISTO_MODE_UNKNOWN )
+            {
+               consumedHistogramOptions = false;  
+               ossimNotify(ossimNotifyLevel_NOTICE)
+                  << "Creating overviews for file: " << ih->getFilename() << std::endl;
+            }
+         }
+
+         //---
+         // Set properties, e.g. tile size.  Must be set before the call to
+         // ob->setInputSource(...)
+         //---
+         std::vector< ossimRefPtr<ossimProperty> > propertyList(0);
+         ossimIpt tileSize;
+         if ( getTileSize( tileSize ) == true )
+         {
+            propertyList.push_back(new ossimStringProperty(ossimKeywordNames::OUTPUT_TILE_SIZE_KW,
+            tileSize.toString()));
+            ob->setProperties(propertyList);
+         }
+
+         ob->setOutputFile(outputFile);
+         ob->setInputSource(ih.get());
+
+         // Create the overview for this entry in this file:
+         if ( ob->execute() == false )
+         {
+            setErrorStatus( ossimErrorCodes::OSSIM_ERROR );
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "Error returned creating overviews for file: " << ih->getFilename() << std::endl;
+         }
+      }
+      else
+      {
+         consumedHistogramOptions = false;
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Image has required reduced resolution data sets." << std::endl;
+      }
+   }
+ 
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+}
+ 
+bool ossimImageUtil::hasRequiredOverview( ossimRefPtr<ossimImageHandler>& ih,
+                                          ossimRefPtr<ossimOverviewBuilderBase>& ob )
+{
+   bool result = false;
+   if ( ih.valid() && ob.valid() && ( getCopyAllFlag() == false ) )
+   {
+      if ( ih->getClassName() == "ossimCcfTileSource" )
+      {
+         // CCF reader does not use external overviews.
+         result = true;
+      }
+      else
+      {
+         // Note we always have one rset
+         ossim_uint32 required = 1;
+ 
+         ossim_uint32 startingResLevel      = ih->getNumberOfDecimationLevels();
+         ossim_uint32 overviewStopDimension = ob->getOverviewStopDimension();
+ 
+         ossim_uint32 largestImageDimension =
+            ih->getNumberOfSamples(0) >
+            ih->getNumberOfLines(0) ?
+            ih->getNumberOfSamples(0) :
+            ih->getNumberOfLines(0);
+ 
+         while(largestImageDimension > overviewStopDimension)
+         {
+            largestImageDimension /= 2;
+            ++required;
+         }
+ 
+         if ( startingResLevel >= required )
+         {
+            result = true;
+         }
+      }
+   }
+   return result;
+}
+ 
+void ossimImageUtil::createHistogram(ossimRefPtr<ossimImageHandler>& ih)
+{
+   static const char M[] = "ossimImageUtil::createHistogram #1";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+ 
+   if ( ih.valid() )
+   {
+      // Get the entry list:
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+ 
+      bool useEntryIndex = false;
+      if ( entryList.size() )
+      {
+         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
+      }
+ 
+      for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
+      {
+         createHistogram(ih, entryList[idx], useEntryIndex);
+      }
+   }
+ 
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+}
+
+// Create histogram for entry:
+void ossimImageUtil::createHistogram(ossimRefPtr<ossimImageHandler>& ih,
+                                     ossim_uint32 entry,
+                                     bool useEntryIndex)
+{
+   static const char M[] = "ossimImageUtil::createHistogram #2";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+ 
+   if ( ih.valid() )
+   {
+      if (useEntryIndex)
+      {
+         // Set entry before deriving file name.
+         ih->setCurrentEntry(entry);
+         ossimNotify(ossimNotifyLevel_NOTICE) << "entry number: "<< entry << std::endl;
+      }
+ 
+      ossimFilename outputFile =
+         ih->getFilenameWithThisExtension(ossimString(".his"), useEntryIndex);
+
+      // Only build if needed:
+      if ( (outputFile.exists() == false) || rebuildHistogram() )
+      {
+         ossimNotify(ossimNotifyLevel_NOTICE)
+            << "Computing histogram for file: " << ih->getFilename() << std::endl;
+ 
+         // Check handler to see if it's filtering bands.
+         std::vector<ossim_uint32> originalBandList(0);
+         if ( ih->isBandSelector() )
+         { 
+            // Capture for finalize method.
+            ih->getOutputBandList( originalBandList );
+ 
+            // Set output list to input.
+            ih->setOutputToInputBandList();
+         }
+ 
+         ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
+         ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
+ 
+         histoSource->setMaxNumberOfRLevels(1); // Currently hard coded...
+ 
+#if 0 /* TODO tmp drb */
+         if( !ossim::isnan(histoMin) )
+         {
+            histoSource->setMinValueOverride(histoMin);
+         }
+ 
+         if( !ossim::isnan(histoMax) )
+         {
+            histoSource->setMaxValueOverride(histoMax);
+         }
+ 
+         if(histoBins > 0)
+         {
+            histoSource->setNumberOfBinsOverride(histoBins);
+         }
+#endif
+ 
+         if(traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "Histogram mode: " << getHistogramMode() << "\n";
+         }
+ 
+         // Connect histogram source to image handler.
+         histoSource->setComputationMode( getHistogramMode() );
+         histoSource->connectMyInputTo(0, ih.get() );
+         histoSource->enableSource();
+ 
+         // Connect writer to histogram source.
+         writer->connectMyInputTo(0, histoSource.get());
+         writer->setFilename(outputFile);
+         theStdOutProgress.setFlushStreamFlag(true);
+         writer->addListener(&theStdOutProgress);
+ 
+         // Compute...
+         writer->execute();
+ 
+         writer=0;
+ 
+         // Reset the band list.
+         if ( ih->isBandSelector() && originalBandList.size() )
+         {
+            ih->setOutputBandList( originalBandList );
+         }
+ 
+      } // Matches: if ( (outputFile.exists() == false) || rebuildHistogram() )
+ 
+   } // Matches: if ( ih.valid() )
+ 
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+ 
+} // End: ossimImageUtil::createHistogram #2
+ 
+void ossimImageUtil::computeMinMax(ossimRefPtr<ossimImageHandler>& ih)
+{
+   static const char M[] = "ossimImageUtil::computeMinMax #1";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+ 
+   if ( ih.valid() )
+   {
+      // Get the entry list:
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+ 
+      bool useEntryIndex = false;
+      if ( entryList.size() )
+      {
+         if ( (entryList.size() > 1) || (entryList[0] != 0) ) useEntryIndex = true;
+      }
+ 
+      for(ossim_uint32 idx = 0; idx < entryList.size(); ++idx)
+      {
+         computeMinMax(ih, entryList[idx], useEntryIndex);
+      }
+   }
+ 
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+ 
+} // End: ossimImageUtil::computeMinMax( ih )
+ 
+void ossimImageUtil::computeMinMax( ossimRefPtr<ossimImageHandler>& ih,
+                                    ossim_uint32 entry,
+                                    bool useEntryIndex )
+{
+   static const char M[] = "ossimImageUtil::computeMinMax #2";
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+ 
+   if ( ih.valid() )
+   {
+      // Get any min, max, null overrides;
+      double maxValue  = ossim::nan();
+      double minValue  = ossim::nan();
+      double nullValue = ossim::nan();
+
+      ossimString value = m_kwl->findKey( CMM_MAX_KW );
+      if ( value.size() )
+      {
+         maxValue = value.toDouble();
+      }
+
+      value = m_kwl->findKey( CMM_MIN_KW );
+      if ( value.size() )
+      {
+         minValue = value.toDouble();
+      }
+
+      bool hasNull = false;
+      value = m_kwl->findKey( CMM_NULL_KW );
+      if ( value.size() )
+      {
+         nullValue = value.toDouble();
+         if ( !ossim::isnan(nullValue) )
+         {
+            hasNull = true;
+         }
+      }
+ 
+      // Select the entry.
+      ih->setCurrentEntry( entry );
+ 
+      // Build the .omd file name.
+      ossimFilename omd_file = ih->getFilename();;
+
+      // Check for output directory:
+      if ( m_kwl->hasKey( OUTPUT_DIRECTORY_KW ) )
+      {
+         ossimFilename outputDir;
+         outputDir.string() = m_kwl->findKey( OUTPUT_DIRECTORY_KW );
+         
+         if ( outputDir.exists() && outputDir.isDir() )
+         {
+            omd_file = outputDir.dirCat( omd_file.file() );
+         }
+      }
+ 
+      if ( useEntryIndex )
+      {
+         ossim_uint32 currentEntry = ih->getCurrentEntry();
+         omd_file.setExtension("");
+         omd_file += "_e";
+         omd_file += ossimString::toString(currentEntry);
+ 
+         //---
+         // Note:  Set extension was not used here deliberately to avoid
+         // messing
+         // up a MODIS file in hdf format with multiple '.'s in the file
+         // name.
+         //---
+         omd_file += ".omd";
+      }
+      else
+      {
+         omd_file.setExtension("omd");
+      }
+ 
+      ossimRefPtr<ossimImageSourceSequencer> is = new ossimImageSourceSequencer(ih.get());
+ 
+      //---
+      // Note: getImageTileWidth/Height will return zero if the image is not
+      // intenally tiles.
+      //---
+      ossimIpt tileWidthHeight( ih->getImageTileWidth(), ih->getImageTileHeight() );
+      if (!tileWidthHeight.x)
+      {
+         //---
+         // Make the sequencer read entire strips from the image handler
+         // at a time.  This will speed up access time for strip images
+         //---
+         tileWidthHeight.x = ih->getBoundingRect().width();
+      }
+      if(!tileWidthHeight.y)
+      {
+         tileWidthHeight.y = ih->getTileHeight();
+      }
+ 
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "Sequencer tile size: " << tileWidthHeight << endl;
+      }
+ 
+      is->setTileSize(tileWidthHeight);
+ 
+      //---
+      // Make arrays of doubles to hold the min/max values.
+      // Initialize mins to default maxes and maxes to default mins to be
+      // safe.
+      //---
+      ossim_uint32 i; // for numerous iterations...
+ 
+      const ossimScalarType ST = ih->getOutputScalarType();
+ 
+      const double DEFAULT_MIN = ossim::defaultMin(ST);
+      const double DEFAULT_MAX = ossim::defaultMax(ST);
+ 
+      const ossim_uint32 BANDS = ih->getNumberOfInputBands();
+ 
+      vector<double> tmin(BANDS);
+      vector<double> tmax(BANDS);
+      vector<double> tnull(BANDS);
+      for (i = 0; i < BANDS; ++i)
+      {
+         tmin[i] = DEFAULT_MAX;
+         tmax[i] = DEFAULT_MIN;
+ 
+         if ( hasNull )
+         {
+            // User passed in with --null option so set here.
+            tnull[i] = nullValue;
+         }
+         else
+         {
+            tnull[i] = ih->getNullPixelValue(i);
+         }
+      }
+ 
+      // Scan the image and compute the min and max.
+      const double TOTAL_TILES = is->getNumberOfTiles();
+      double tile_count = 0.0;
+      ossimNotify(ossimNotifyLevel_INFO)
+         << setiosflags(ios::fixed) << setprecision(0);
+ 
+      if( (ossim::isnan(minValue) ) || (ossim::isnan(maxValue) ) )
+      {
+         ossimRefPtr<ossimImageData> id = is->getNextTile();
+         while(id.valid())
+         {
+            if ( hasNull )
+            {
+               // Pass null to image data object so it doesn't get picked up as "min".
+               id->setNullPix( nullValue );
+            }
+            id->computeMinMaxPix(tmin, tmax);
+            id = is->getNextTile();
+            ++tile_count;
+            ossimNotify(ossimNotifyLevel_INFO)
+               << "\r"  << setw(3)
+               << (tile_count / TOTAL_TILES * 100.0) << "%"
+               << flush;
+         }
+      }
+      
+      if(!ossim::isnan(minValue))
+      {
+         std::fill(tmin.begin(), tmin.end(), minValue);
+      }
+      if(!ossim::isnan(maxValue))
+      {
+         std::fill(tmax.begin(), tmax.end(), maxValue);
+      }
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "\r100%\nFinished..." << endl;
+ 
+      ossimKeywordlist okwl(omd_file);
+ 
+      for(i = 0; i < BANDS; ++i)
+      {
+         //---
+         // Check to see if values got assigned.  If not flip to default and
+         // issue a warning.
+         //---
+         if (tmin[i] == DEFAULT_MAX)
+         {
+            tmin[i] = DEFAULT_MIN;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "cmm scan for min failed! Using default min."
+               << std::endl;
+         }
+         if (tmax[i] == DEFAULT_MIN)
+         {
+            tmax[i] = DEFAULT_MAX;
+            ossimNotify(ossimNotifyLevel_WARN)
+               << "cmm scan for max failed! Using default max."
+               << std::endl;
+         }
+            
+         ossimString band =
+            ossimString("band")+ossimString::toString(i+1)+".";
+
+         if (tmin[i] == DEFAULT_MAX)
+         {
+            tmin[i] = DEFAULT_MIN;
+         }
+         // if (tmax[i] == DEFAULT_MIN){}
+            
+         okwl.add(band + "min_value", tmin[i], true);
+         okwl.add(band + "max_value", tmax[i], true);
+         okwl.add(band + "null_value", tnull[i], true); 
+         
+         if( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_INFO)
+               << setiosflags(ios::fixed) << setprecision(16)
+               << "band" << ossimString::toString(i+1) << ".min_value: "
+               << tmin[i]
+               << "\nband" << ossimString::toString(i+1) << ".max_value: "
+               << tmax[i]
+               << "\nband" << ossimString::toString(i+1) << ".null_value: "
+               << tnull[i] << endl;
+         }
+         
+      } // End of band loop.
+      
+      // Add missing info (number of bands, scalar type) to the .omd file
+      okwl.add("bytes_per_pixel", ossim::scalarSizeInBytes(ST), true);
+      okwl.add("number_bands", BANDS, true);
+      okwl.add("scalar_type", (ossimScalarTypeLut::instance()->getEntryString(ST)), true);
+
+      // Write the file to disk:
+      okwl.write(omd_file);
+      ossimNotify(ossimNotifyLevel_INFO)
+         << "wrote file:  " << omd_file << endl;
+
+      ih->loadMetaData(); 
+
+   } // Matches: if ( ih.valid() )
+   
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+   
+} // End: ossimImageUtil::computeMinMax( ih, entry, ... )
+
+void ossimImageUtil::usage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+   
+   // Set app name.
+   ap.getApplicationUsage()->setApplicationName(ap.getApplicationName());
+
+   // Add options.
+   addArguments(ap);
+   
+   // Write usage.
+   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+
+   outputOverviewWriterTypes();
+   
+   ossimNotify(ossimNotifyLevel_INFO)
+      << "\nExample commands:\n"
+
+      << "\n// A single image standard tiff overviews, histogram:\n"
+      << "ossim-preproc -o --ch <file>\n"
+
+      << "\n// A single image with j2k overviews(requires kakadu plugin), histogram:\n"
+      << "ossim-preproc --ot ossim_kakadu_nitf_j2k --ch <file>\n"
+      << "\n// j2k, histogram, 4 threads\n"
+
+      << "\n// standard tiff overviews, full histogram, 4 threads:\n"
+      << "ossim-preproc -r -o --ch --threads 4 <directory_to_walk>\n"
+
+      << "\n// j2k, histogram (fast mode), 4 threads\n"
+      << "ossim-preproc -r --ot ossim_kakadu_nitf_j2k --chf --threads 4 "
+      << "<directory_to_walk>\n"
+
+      << "\n// tiff, jpeg compression, histogram, 4 threads\n"
+      << "ossim-preproc -r --ch --compression-quality 75 --compression-type "
+      << "jpeg --threads 4 <directory_to_walk>\n"
+      << "ossim-preproc -r --ch --compression-quality 75 --compression-type "
+      << "jpeg --threads 4 <directory_to_walk>\n"
+
+      << "\n// Process all the tiffs in a directory feeding \"prep\", \"file\", \"post\" system commands via the --options option which includes indexing file into the omar database via omar-data-mgr app:\n"
+      << "ossim-preproc --options preproc-options.kwl -r -o --ch *.tif\n"
+      << "\n// Contents of preproc-options.kwl used in above command:\n"
+      << "prep.command0: echo start_time: %{date}\n"
+      << "prep.command0.strf_time_format: %Y%m%d%H%M%S\n"
+      << "prep.command1: mkdir -p %{date}\n"
+      << "file.command0: mv %{file_no_ext}.* %{date}/.\n"
+      << "file.command1: omar-data-mgr -u http://localhost:8080/omar add %{date}/%{basename}\n"
+      << "post.command0: echo end_time: %{date}\n"
+      << "post.command0.strf_time_format: %Y%m%d%H%M%S\n"
+      
+      << "\nNOTES:\n"
+      << "\n  --ch  equals --create-histogram"
+      << "\n  --chf equals --create-histogram-fast"
+
+      << "\n\nExpanded command option variables:\n\n"
+      << "%{basename}        = filename without path\n"
+      << "%{basename_no_ext} = filename without path and without extension\n"
+      << "%{date}            = Expanded to current zulu time. Default format=yyyymmdd\n"
+      << "                     output format controlled by command0.strf_time_format key.\n"
+      << "%{dirname}         = path of filename\n"
+      << "%{file}            = filename being processed\n"
+      << "%{file_no_ext}     = filename with no extension\n"
+
+      << std::endl;
+}
+
+// Private method:
+void ossimImageUtil::outputOverviewWriterTypes() const
+{
+   ossimNotify(ossimNotifyLevel_NOTICE)
+      << "\nValid overview types: " << std::endl;
+   
+   std::vector<ossimString> outputType;
+   
+   ossimOverviewBuilderFactoryRegistry::instance()->getTypeNameList(outputType);
+   std::copy(outputType.begin(),
+             outputType.end(),
+             std::ostream_iterator<ossimString>(ossimNotify(ossimNotifyLevel_NOTICE), "\t\n"));
+}
+
+// Private method:
+bool ossimImageUtil::isDirectoryBasedImage(const ossimImageHandler* ih) const
+{
+   bool result = false;
+   if ( ih )
+   {
+      // Get the image handler name.
+      ossimString imageHandlerName = ih->getClassName();
+      if ( (imageHandlerName == "ossimAdrgTileSource") ||
+           (imageHandlerName == "ossimCibCadrgTileSource") )  
+      {
+         result = true;
+      }
+   }
+   return result;
+}
+
+void ossimImageUtil::setCreateOverviewsFlag( bool flag )
+{
+   addOption( CREATE_OVERVIEWS_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+}
+
+bool ossimImageUtil::createOverviews() const
+{
+   return  keyIsTrue( CREATE_OVERVIEWS_KW );
+}
+
+void ossimImageUtil::setRebuildOverviewsFlag( bool flag )
+{
+   addOption( REBUILD_OVERVIEWS_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+   if ( flag )
+   {
+      setCreateOverviewsFlag( true ); // Turn on overview building.
+   }
+}
+
+bool ossimImageUtil::rebuildOverviews() const
+{
+   return keyIsTrue( REBUILD_OVERVIEWS_KW );
+}
+
+void ossimImageUtil::setRebuildHistogramFlag( bool flag )
+{
+   addOption( REBUILD_HISTOGRAM_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+   if ( flag )
+   {
+      setCreateHistogramFlag( true ); // Turn on histogram building.
+   }
+}
+
+bool ossimImageUtil::rebuildHistogram() const
+{
+   return keyIsTrue( REBUILD_HISTOGRAM_KW );
+}
+
+void ossimImageUtil::setScanForMinMax( bool flag )
+{
+   addOption( SCAN_MIN_MAX_KW, ( flag ? TRUE_KW : FALSE_KW ) ); 
+}
+
+bool ossimImageUtil::scanForMinMax() const
+{
+   return keyIsTrue( SCAN_MIN_MAX_KW );
+}
+
+void ossimImageUtil::setScanForMinMaxNull( bool flag )
+{
+   addOption( SCAN_MIN_MAX_NULL_KW, ( flag ? TRUE_KW : FALSE_KW ) ); 
+}
+
+bool ossimImageUtil::scanForMinMaxNull() const
+{
+   return keyIsTrue( SCAN_MIN_MAX_NULL_KW );
+}
+
+void ossimImageUtil::setCompressionQuality( const std::string& quality )
+{
+   if ( quality.size() )
+   {
+      std::string key = WRITER_PROP_KW;
+      key += ossimString::toString( getNextWriterPropIndex() ).string();
+      std::string value = ossimKeywordNames::COMPRESSION_QUALITY_KW;
+      value += "=";
+      value += quality;
+      addOption( key, value );
+   }
+}
+
+void ossimImageUtil::setCompressionType(const std::string& type)
+{
+   if ( type.size() )
+   {
+      std::string key = WRITER_PROP_KW;
+      key += ossimString::toString( getNextWriterPropIndex() ).string();
+      std::string value = ossimKeywordNames::COMPRESSION_TYPE_KW;
+      value += "=";
+      value += type;
+      addOption( key, value );
+   }   
+}
+
+void ossimImageUtil::setCopyAllFlag( bool flag )
+{
+   // Add this for hasRequiredOverview method.
+   std::string key   = COPY_ALL_FLAG_KW;
+   std::string value = ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+
+   // Add as a writer prop:
+   key = WRITER_PROP_KW;
+   key += ossimString::toString( getNextWriterPropIndex() ).string();
+   value = COPY_ALL_FLAG_KW;
+   value += "=";
+   value += ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+}
+
+bool ossimImageUtil::getCopyAllFlag() const
+{
+   return keyIsTrue( COPY_ALL_FLAG_KW );
+}
+
+void ossimImageUtil::setDumpFilteredImageListFlag( bool flag )
+{
+   std::string key   = DUMP_FILTERED_IMAGES_KW;
+   std::string value = ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+}
+
+bool ossimImageUtil::getDumpFilterImagesFlag() const
+{
+   return keyIsTrue( DUMP_FILTERED_IMAGES_KW );
+}
+
+void ossimImageUtil::setInternalOverviewsFlag( bool flag )
+{
+   // Add this for hasRequiredOverview method.
+   std::string key   = INTERNAL_OVERVIEWS_FLAG_KW;
+   std::string value = ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+
+   // Add as a writer prop:
+   key = WRITER_PROP_KW;
+   key += ossimString::toString( getNextWriterPropIndex() ).string();
+   value = INTERNAL_OVERVIEWS_FLAG_KW;
+   value += "=";
+   value += ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+}
+
+bool ossimImageUtil::getInternalOverviewsFlag() const
+{
+   return keyIsTrue( INTERNAL_OVERVIEWS_FLAG_KW );
+}
+
+void ossimImageUtil::setOutputFileNamesFlag( bool flag )
+{
+   std::string key   = OUTPUT_FILENAMES_KW;
+   std::string value = ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+}
+
+bool ossimImageUtil::getOutputFileNamesFlag() const
+{
+   return keyIsTrue( OUTPUT_FILENAMES_KW );
+}
+
+void ossimImageUtil::setOverrideFilteredImagesFlag( bool flag )
+{
+   std::string key   = OVERRIDE_FILTERED_IMAGES_KW;
+   std::string value = ( flag ? TRUE_KW : FALSE_KW );
+   addOption( key, value );
+}
+
+bool ossimImageUtil::getOverrideFilteredImagesFlag() const
+{
+   return keyIsTrue( OVERRIDE_FILTERED_IMAGES_KW );
+}
+
+void ossimImageUtil::setOutputDirectory( const std::string& directory )
+{
+   std::string key = OUTPUT_DIRECTORY_KW;
+   addOption( key, directory );
+}
+   
+void ossimImageUtil::setOverviewType( const std::string& type )
+{
+   std::string key = OVERVIEW_TYPE_KW;
+   addOption( key, type );
+   setCreateOverviewsFlag( true ); // Assume caller wants overviews.
+}
+
+void ossimImageUtil::getOverviewType(std::string& type) const
+{
+   std::string lookup = m_kwl->findKey(OVERVIEW_TYPE_KW);
+   if ( lookup.size() )
+   {
+      type = lookup;
+   }
+   else
+   {
+      type = "ossim_tiff_box"; // default
+   }
+}
+
+void ossimImageUtil::setProps(ossimPropertyInterface* pi) const
+{
+   if ( pi )
+   {
+      ossimString baseKey;
+      if ( dynamic_cast<ossimImageHandler*>(pi) )
+      {
+         baseKey = READER_PROP_KW;
+      }
+      else
+      {
+         baseKey = WRITER_PROP_KW;
+      }
+      
+      ossim_uint32 propCount = m_kwl->numberOf( baseKey.c_str() );
+      if ( propCount )
+      {
+         ossim_uint32 foundProps = 0;
+         ossim_uint32 index = 0;
+         
+         // (propCount+100) is to allow for holes like reader_prop0, reader_prop2...
+         while ( (foundProps < propCount) && (index < (propCount+100) ) ) 
+         {
+            ossimString key = baseKey;
+            key += ossimString::toString(index);
+            std::string lookup = m_kwl->findKey( key.string() );
+            if ( lookup.size() )
+            {
+               ossimString value = lookup;
+               std::vector<ossimString> v = value.split("=");
+               if (v.size() == 2)
+               {
+                  ossimString propertyName  = v[0];
+                  ossimString propertyValue = v[1];
+                  ossimRefPtr<ossimProperty> p =
+                     new ossimStringProperty(propertyName, propertyValue);
+                  pi->setProperty( p );
+               }
+               ++foundProps;
+            }
+            ++index;
+         }
+      }
+   }
+}
+
+void ossimImageUtil::setOverviewStopDimension( ossim_uint32 dimension )
+{
+   addOption( OVERVIEW_STOP_DIM_KW, dimension );
+}
+
+void ossimImageUtil::setOverviewStopDimension( const std::string& dimension )
+{
+   addOption( OVERVIEW_STOP_DIM_KW, dimension );
+}
+
+void ossimImageUtil::setTileSize( ossim_uint32 tileSize )
+{
+   if ((tileSize % 16) == 0)
+   {
+      addOption( TILE_SIZE_KW, tileSize );
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)
+         << "ossimImageUtil::setTileSize NOTICE:"
+         << "\nTile width must be a multiple of 16!"
+         << std::endl;
+   }
+}
+
+bool ossimImageUtil::getTileSize( ossimIpt& tileSize ) const
+{
+   bool result = false;
+   std::string lookup = m_kwl->findKey( TILE_SIZE_KW );
+   if ( lookup.size() )
+   {
+      ossim_int32 i = ossimString(lookup).toInt32();
+      if ( (i % 16) == 0 )
+      {
+         tileSize.x = i;
+         tileSize.y = i;
+         result = true;
+      }  
+   }
+   return result;
+}
+
+ossim_uint32 ossimImageUtil::getOverviewStopDimension() const
+{
+   ossim_uint32 result = 0;
+   std::string lookup = m_kwl->findKey( OVERVIEW_STOP_DIM_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toUInt32();
+   }
+   return result;
+}
+
+void ossimImageUtil::setCreateHistogramFlag( bool flag )
+{
+   addOption( CREATE_HISTOGRAM_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+}
+
+bool ossimImageUtil::createHistogram() const
+{
+   return keyIsTrue( CREATE_HISTOGRAM_KW );
+}
+
+void ossimImageUtil::setCreateHistogramFastFlag( bool flag )
+{
+   addOption( CREATE_HISTOGRAM_FAST_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+}
+
+bool ossimImageUtil::createHistogramFast() const
+{
+   return keyIsTrue( CREATE_HISTOGRAM_FAST_KW );
+}
+
+void ossimImageUtil::setCreateHistogramR0Flag( bool flag )
+{
+   addOption( CREATE_HISTOGRAM_R0_KW, ( flag ? TRUE_KW : FALSE_KW ) );
+}
+
+bool ossimImageUtil::createHistogramR0() const
+{
+   return keyIsTrue( CREATE_HISTOGRAM_R0_KW );
+}
+
+bool ossimImageUtil::hasHistogramOption() const
+{
+   return ( createHistogram() || createHistogramFast() || createHistogramR0() );
+}
+
+bool ossimImageUtil::hasCmmOption() const
+{
+   return ( keyIsTrue( CMM_MAX_KW ) || keyIsTrue( CMM_MIN_KW )|| keyIsTrue( CMM_NULL_KW ) );
+}
+
+ossimHistogramMode ossimImageUtil::getHistogramMode() const
+{
+   ossimHistogramMode result = OSSIM_HISTO_MODE_UNKNOWN;
+   if ( createHistogram() || createHistogramR0() )
+   {
+      result = OSSIM_HISTO_MODE_NORMAL;
+   }
+   else if ( createHistogramFast() )
+   {
+      result = OSSIM_HISTO_MODE_FAST;
+   }
+   return result;
+}
+
+void ossimImageUtil::setNumberOfThreads( ossim_uint32 threads )
+{
+   addOption( THREADS_KW, threads );
+}
+
+void ossimImageUtil::setNumberOfThreads( const std::string& threads )
+{
+   addOption( THREADS_KW, threads );
+}
+
+ossim_uint32 ossimImageUtil::getNumberOfThreads() const
+{
+   ossim_uint32 result;
+   std::string lookup = m_kwl->findKey( THREADS_KW );
+   if ( lookup.size() )
+   {
+      result = ossimString(lookup).toUInt32();
+   }
+   else
+   {
+      result = ossim::getNumberOfThreads();
+   }
+   return result;
+}
+
+ossim_uint32 ossimImageUtil::getNextWriterPropIndex() const
+{
+   ossim_uint32 result = m_kwl->numberOf( WRITER_PROP_KW.c_str() );
+   if ( result )
+   {
+      ossim_uint32 foundProps = 0;
+      ossim_uint32 index = 0;
+
+      //---
+      // Loop until we find the last index used for WRITER_PROP_KW.
+      // (result+100) is to allow for holes like writer_prop0, writer_prop2...
+      //---
+      while ( (foundProps < result) && (index < (result+100) ) ) 
+      {
+         ossimString key = WRITER_PROP_KW;
+         key += ossimString::toString(index);
+         std::string lookup = m_kwl->findKey( key.string() );
+         if ( lookup.size() )
+         {
+            ++foundProps;
+         }
+         ++index;
+      }
+      result = index;
+   }
+   return result;
+}
+
+ossim_uint32 ossimImageUtil::getNextReaderPropIndex() const
+{
+   ossim_uint32 result = m_kwl->numberOf( READER_PROP_KW.c_str() );
+   if ( result )
+   {
+      ossim_uint32 foundProps = 0;
+      ossim_uint32 index = 0;
+      
+      //---
+      // Loop until we find the last index used for WRITER_PROP_KW.
+      // (result+100) is to allow for holes like reader_prop0, reader_prop2...
+      //---
+      while ( (foundProps < result) && (index < (result+100) ) ) 
+      {
+         ossimString key = READER_PROP_KW;
+         key += ossimString::toString(index);
+         std::string lookup = m_kwl->findKey( key.string() );
+         if ( lookup.size() )
+         {
+            ++foundProps;
+         }
+         ++index;
+      }
+      result = index;
+   }
+   return result;
+}
+
+void ossimImageUtil::addOption( const std::string& key, ossim_uint32 value )
+{
+   addOption( key, ossimString::toString( value ).string() );
+}
+
+void ossimImageUtil::addOption(  const std::string& key, const std::string& value )
+{
+   m_mutex.lock();
+   if ( m_kwl.valid() )
+   {
+      if ( key.size() && value.size() )
+      {
+         m_kwl->addPair( key, value );
+      }
+   }
+   m_mutex.unlock();
+}
+
+void ossimImageUtil::setErrorStatus( ossim_int32 status )
+{
+   m_mutex.lock();
+   m_errorStatus = status;
+   m_mutex.unlock();
+}
+
+bool ossimImageUtil::isFiltered(const ossimFilename& file) const
+{
+   bool result = false;
+   if ( file.size() )
+   {
+      // Strip full path to base name.
+      std::string baseName = file.file().string();
+      if ( baseName.size() )
+      {
+         std::vector<std::string>::const_iterator i = m_filteredImages.begin();
+         while ( i != m_filteredImages.end() )
+         {
+            if ( baseName == (*i) )
+            {
+               result = true;
+               break;
+            }
+            ++i;
+         }
+      }
+   }
+#if 0 /* Please leave for debug. (drb) */
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimFileWalker::isFiltered file " << (result?"filtered: ":"not filtered: ")
+         << file << "\n";
+   }
+#endif
+   
+   return result;
+}
+
+bool ossimImageUtil::keyIsTrue( const std::string& key ) const
+{
+   bool result = false;
+   if ( m_kwl.valid() )
+   {
+      std::string value = m_kwl->findKey( key );
+      if ( value.size() )
+      {
+         result = ossimString(value).toBool();
+      }
+   }
+   return result;
+}
+
+const std::vector<std::string>& ossimImageUtil::getFilteredImages() const
+{
+   return m_filteredImages;
+}
+
+std::vector<std::string>& ossimImageUtil::getFilteredImages()
+{
+   return m_filteredImages;
+}
+
+void ossimImageUtil::initializeDefaultFilterList()
+{
+   m_mutex.lock();
+
+   // Common images to filter out, put most common first.
+   m_filteredImages.push_back(std::string("icon.jpg"));
+   m_filteredImages.push_back(std::string("logo.jpg"));
+   m_filteredImages.push_back(std::string("preview.jpg"));
+   
+   m_mutex.unlock();
+}
+
+void ossimImageUtil::dumpFilteredImageList() const
+{
+   ossimNotify(ossimNotifyLevel_NOTICE) << "Filtered image list:\n";
+   std::vector<std::string>::const_iterator i = m_filteredImages.begin();
+   while ( i != m_filteredImages.end() )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE) << (*i) << "\n";
+      ++i;
+   }
+   ossimNotify(ossimNotifyLevel_NOTICE) << std::endl;
+}
+
+void ossimImageUtil::executePrepCommands() const
+{
+   std::string prefix = "prep.";
+   ossimFilename file = "";
+   executeCommands( prefix, file );
+}
+
+void ossimImageUtil::executeFileCommands( const ossimFilename& file ) const
+{
+   std::string prefix = "file.";
+   executeCommands( prefix, file ); 
+}
+
+void ossimImageUtil::executePostCommands() const
+{
+   std::string prefix = "post.";
+   ossimFilename file = "";
+   executeCommands( prefix, file );   
+}
+
+void ossimImageUtil::executeCommands(
+   const std::string& prefix, const ossimFilename& file  ) const
+{
+   const std::string BASE_KEY = "command";
+   
+   // Get the number of test:
+   const std::string REG_EXP_STR = prefix + BASE_KEY + std::string("[0-9]+");
+   const ossim_uint32 NUM_COMMANDS = m_kwl->getNumberOfSubstringKeys(REG_EXP_STR);
+   if ( NUM_COMMANDS )
+   {
+      const ossim_uint32 MAX_INDEX = NUM_COMMANDS + 1000; // for skipage...
+      ossim_uint32 index = 0;
+      ossim_uint32 processedIndexes = 0;
+      std::string commandKey;
+      ossimString command;
+
+      while ( processedIndexes < MAX_INDEX )
+      {
+         commandKey = prefix + BASE_KEY + ossimString::toString( index++ ).string();
+         command.string() = m_kwl->findKey( commandKey );
+
+         if ( command.size() )
+         {
+            substituteCommandString( file, prefix, commandKey, command );
+
+            ossimNotify( ossimNotifyLevel_NOTICE )
+               << "executing_command: " << command << std::endl;
+            
+            // Launch the command:
+            int status = system( command.c_str() );
+
+            ossimNotify( ossimNotifyLevel_NOTICE )
+               << "return_status: " << status << std::endl;
+            
+            ++processedIndexes;
+
+            if ( processedIndexes == NUM_COMMANDS )
+            {
+               break;
+            }
+         }
+      }
+   }
+}
+
+void ossimImageUtil::substituteCommandString(
+   const ossimFilename& file,
+   const std::string& prefix,
+   const std::string& commandKey,
+   ossimString& command ) const
+{
+   // Expand any environment vars, e.g. $(env_var_name):
+   command.expandEnvironmentVariable();
+
+   gsubDate( commandKey, command );
+
+   if ( prefix == "file." )
+   {
+      substituteFileStrings( file, command );
+   }
+}
+
+void ossimImageUtil::substituteFileStrings( const ossimFilename& file,
+                                            ossimString& command ) const
+{
+   const std::string BASENAME_VARIABLE = "%{basename}";
+   command.gsub( BASENAME_VARIABLE, file.file().string() );
+   
+   const std::string BASENAME_NO_EXT_VARIABLE = "%{basename_no_ext}";
+   command.gsub( BASENAME_NO_EXT_VARIABLE, file.file().string() );
+
+   const std::string DIRNAME_VARIABLE = "%{dirname}";
+   command.gsub( DIRNAME_VARIABLE, file.path().string() );
+
+   const std::string FILE_VARIABLE = "%{file}";
+   command.gsub( FILE_VARIABLE, file.string(), true );
+
+   const std::string FILE_NO_EXT_VARIABLE = "%{file_no_ext}";
+   command.gsub( FILE_NO_EXT_VARIABLE, file.noExtension().string(), true );
+}
+
+void ossimImageUtil::gsubDate( const std::string& commandKey,
+                               ossimString& command ) const
+{
+   // Date:
+   const std::string DATE_VARIABLE = "%{date}";
+   if ( command.find( DATE_VARIABLE ) )
+   {
+      std::string key = ".strf_time_format";
+      std::string strfTimeFormat = m_kwl->findKey( commandKey, key );
+      if ( strfTimeFormat.empty() )
+      {
+         // yyyymmdd
+         strfTimeFormat = "%Y%m%d";
+      }
+      
+      //---
+      // Get the date as a string, e.g 20150411.
+      // true for gmt time.
+      //---
+      std::string date;
+      ossim::getFormattedTime( strfTimeFormat, true, date );
+      
+      if ( date.size() )
+      {
+         // Sustitute:
+         command.gsub( DATE_VARIABLE, date, true );
+      }
+   }
+}
+
+   
diff --git a/src/util/ossimInfo.cpp b/src/util/ossimInfo.cpp
new file mode 100644
index 0000000..35bae2b
--- /dev/null
+++ b/src/util/ossimInfo.cpp
@@ -0,0 +1,3211 @@
+//---
+// File: ossimInfo.cpp
+// 
+// License: MIT
+// 
+// Author:  David Burken
+//
+// Description: ossimInfo class definition
+//
+// Utility class for getting information from the ossim library.
+// 
+//---
+// $Id$
+
+#include <ossim/util/ossimInfo.h>
+#include <ossim/ossimVersion.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimContainerProperty.h>
+#include <ossim/base/ossimDatum.h>
+#include <ossim/base/ossimDatumFactoryRegistry.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimFontInformation.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimEllipsoid.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGeoidManager.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/font/ossimFont.h>
+#include <ossim/font/ossimFontFactoryRegistry.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimOverviewBuilderFactoryRegistry.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/plugin/ossimSharedPluginRegistry.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/support_data/ossimInfoFactoryRegistry.h>
+#include <ossim/support_data/ossimSupportFilesList.h>
+
+#include <iomanip>
+#include <sstream>
+#include <vector>
+#include <memory>
+
+static const char BUILD_DATE_KW[]           = "build_date";
+static const char CENTER_GROUND_KW[]        = "center_ground";
+static const char CENTER_IMAGE_KW[]         = "center_image";
+static const char CONFIGURATION_KW[]        = "configuration";
+static const char DATUMS_KW[]               = "datums";
+static const char DEG2RAD_KW[]              = "deg2rad";
+static const char DUMP_KW[]                 = "dump";
+static const char DUMP_NO_OVERVIEWS_KW[]    = "dump_no_overviews";
+static const char FACTORIES_KW[]            = "factories";
+static const char FACTORY_KEYWORD_LIST_KW[] = "factory_keyword_list";
+static const char FONTS_KW[]                = "fonts";
+static const char FORMAT_KW[]               = "format"; 
+static const char FT2MTRS_KW[]              = "ft2mtrs";
+static const char FT2MTRS_US_SURVEY_KW[]    = "ft2mtrs_us_survey";
+static const char GEOM_INFO_KW[]            = "geometry_info";
+static const char HEIGHT_KW[]               = "height";
+static const char IMAGE_BOUNDS_KW[]         = "image_bounds";
+static const char IMAGE_CENTER_KW[]         = "image_center";
+static const char IMAGE_FILE_KW[]           = "image_file";
+static const char IMAGE_INFO_KW[]           = "image_info";
+static const char IMAGE_RECT_KW[]           = "image_rect";
+static const char IMG2GRD_KW[]              = "img2grd";
+static const char GRD2IMG_KW[]              = "grd2img";
+static const char METADATA_KW[]             = "metadata";
+static const char MTRS2FT_KW[]              = "mtrs2ft";
+static const char MTRS2FT_US_SURVEY_KW[]    = "mtrs2ft_us_survey";
+static const char MTRSPERDEG_KW[]           = "mtrs_per_deg";
+static const char NORTH_UP_KW[]             = "north_up_angle";
+static const char OUTPUT_FILE_KW[]          = "output_file";
+static const char OVERVIEW_TYPES_KW[]       = "overview_types";
+static const char OVERWRITE_KW[]            = "overwrite";
+static const char PALETTE_KW[]              = "palette";
+static const char PLUGINS_KW[]              = "plugins";
+static const char PLUGIN_TEST_KW[]          = "plugin_test";
+static const char PRETTY_PRINT_KW[]         = "pretty_print";
+static const char PROJECTIONS_KW[]          = "projections";
+static const char RAD2DEG_KW[]              = "rad2deg";
+static const char READER_PROPS_KW[]         = "reader_props";
+static const char RESAMPLER_FILTERS_KW[]    = "resampler_filters";
+static const char REVISION_NUMBER_KW[]      = "revision_number";
+static const char UP_IS_UP_KW[]             = "up_is_up_angle";
+static const char VERSION_KW[]              = "version";
+static const char WRITERS_KW[]              = "writers_kw";
+static const char WRITER_PROPS_KW[]         = "writer_props";
+static const char ZOOM_LEVEL_GSDS_KW[]      = "zoom_level_gsds";
+static const char ECEF2LLH_KW[]             = "ecef2llh";
+
+const char* ossimInfo::DESCRIPTION =
+      "Dumps metadata information about input image and OSSIM in general.";
+
+// Static trace for debugging.  Use -T ossimInfo to turn on.
+static ossimTrace traceDebug = ossimTrace("ossimInfo:debug");
+
+ossimInfo::ossimInfo() :
+         m_img(0)
+{
+}
+
+ossimInfo::~ossimInfo()
+{
+}
+
+void ossimInfo::setUsage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+   
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [options] <optional-image>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->addCommandLineOption("--bounds", "Will print out the edge to edge image bounds.");
+   
+   au->addCommandLineOption("--build-date", "Build date of code.");
+
+   au->addCommandLineOption("-c", "Will print ground and image center.");
+
+   au->addCommandLineOption("--cg", "Will print out ground center.");
+
+   au->addCommandLineOption("--ci", "Will print out image center.");
+
+   au->addCommandLineOption("--config", "Displays configuration info.");
+
+   au->addCommandLineOption("-D", "A human-readable (i.e., not necessarily key:value pairs) dump of the image.");
+
+   au->addCommandLineOption("-d", "A generic dump if one is available.");
+
+   au->addCommandLineOption("--datums", "Prints datum list.");   
+
+   au->addCommandLineOption("--deg2rad", "<degrees> Gives radians from degrees.");
+
+   au->addCommandLineOption("--dno", "A generic dump if one is available.  This option ignores overviews.");
+
+   au->addCommandLineOption("--ecef2llh", "<X> <Y> <Z> in ECEF coordinates and returns latitude longitude height position.");
+
+   au->addCommandLineOption("-f", "<format> Will output the information specified format [KWL | XML].  Default is KWL.");   
+
+   au->addCommandLineOption("--factories", "<keyword_list_flag> Prints factory list.  If keyword_list_flag is true, the result of a saveState will be output for each object.");
+
+   au->addCommandLineOption("--fonts", "Prints available fonts.");
+   
+   au->addCommandLineOption("--ft2mtrs", "<feet> Gives meters from feet (0.3048 meters per foot).");
+
+   au->addCommandLineOption("--ft2mtrs-us-survey", "<feet> Gives meters from feet (0.3048006096 meters per foot).");
+
+   au->addCommandLineOption("-h", "Display this information");
+
+   au->addCommandLineOption("--height", "<latitude-in-degrees> <longitude-in-degrees> Returns the MSL and ellipoid height given a latitude longitude position.");
+   
+   au->addCommandLineOption("-i", "Will print out the general image information.");
+
+   au->addCommandLineOption("--img2grd", "<x> <y> Gives ground point from zero based image point.  Returns \"nan\" if point is outside of image area.");
+   au->addCommandLineOption("--grd2img", "<lat> <lon> <height> Gives full res image point from lat lon height.");
+
+   au->addCommandLineOption("-m", "Will print out meta data image information.");
+
+   au->addCommandLineOption("--mtrsPerDeg", "<latitude> Gives meters per degree and meters per minute for a given latitude.");
+
+   au->addCommandLineOption("--mtrs2ft", "<meters> Gives feet from meters (0.3048 meters per foot).");
+
+   au->addCommandLineOption("--mtrs2ft-us-survey", "<meters> Gives feet from meters (0.3048006096 meters per foot).");
+
+   au->addCommandLineOption("-n or --north-up", "Rotation angle to North for an image.");
+
+   au->addCommandLineOption("-o", "<output-file> Will output the information to the file specified.  Default is to standard out.");
+
+   au->addCommandLineOption("--overview-types", "Prints overview builder types.");
+
+   au->addCommandLineOption("-p", "Will print out the image projection information.");
+
+   au->addCommandLineOption("--palette", "Will print out the color palette if one exists.");
+
+   au->addCommandLineOption("--plugins", "Prints plugin list.");
+
+   au->addCommandLineOption("--plugin-test", "Test plugin passed to option.");
+
+   au->addCommandLineOption("--projections", "Prints projections.");
+
+   au->addCommandLineOption("-r", "Will print image rectangle.");
+
+   au->addCommandLineOption("--rad2deg", "<radians> Gives degrees from radians.");
+
+   au->addCommandLineOption("--reader-props", "Prints readers and properties.");
+
+   au->addCommandLineOption("--resampler-filters", "Prints resampler filter list.");
+
+   au->addCommandLineOption("--revision", "Revision of code.");
+
+   au->addCommandLineOption("-s", "Force the ground rect to be the specified datum");
+
+   au->addCommandLineOption("-u or --up-is-up", "Rotation angle to \"up is up\" for an image.\nWill return 0 if image's projection is not affected by elevation.");
+
+   au->addCommandLineOption("-v", "Overwrite existing geometry.");
+
+   au->addCommandLineOption("-V or --vesion", "Version of code, e.g. 1.8.20");
+
+   au->addCommandLineOption("--writer-props", "Prints writers and properties.");
+
+   au->addCommandLineOption("--writers", "Prints list of available writers.");
+
+   au->addCommandLineOption("--zoom-level-gsds", "Prints zoom level gsds for projections EPSG:4326 and EPSG:3857.");
+   au->addCommandLineOption("--image-to-ground", "Takes a 3 tuple of the form x y res where x and y are image coordinates and res is the resolution.  res = 0 is full resolution");
+   au->addCommandLineOption("--ground-to-image", "Takes a 2 or 3 tuple of the form lat lon h where x and y are image coordinates and res is the resolution");
+
+   ostringstream description;
+   description << DESCRIPTION << "\n\n Examples:\n\n"
+         << "    ossim-info --version\n"
+         << "    ossim-info -i ./myfile.tif\n"
+         << "      prints out only general image information\n\n"
+         << "    ossim-info -p ./myfile.tif\n"
+         << "      prints out only image projection information\n\n"
+         << "    ossim-info -p -s wge ./myfile.tif\n"
+         << "      prints out only image projection information and shifts to wgs84\n\n"
+         << "    ossim-info -p -i ./myfile.tif\n"
+         << "      prints out both image and projection information\n\n"
+         << "    ossim-info -p -i ./myfile.tif -o ./myfile.geom\n"
+         << "      writes geometry file with both image and projection information\n\n"
+         << "    ossim-info -p -i ./myfile.tif -v -o ./myfile.geom\n"
+         << "      writes geometry file with both image and projection information\n"
+         << "      while overwriting existing .geom file.\n\n"
+         << "    ossim-info -f XML ./myfile.tif\n"
+         << "      prints out image and projection information as an XML document\n\n"
+         << "    ossim-info -d myfile.ntf\n"
+         << "      Dumps all data available, in this case, all nitf tags, from file.\n\n"
+         << "    ossim-info -d a.toc\n"
+         << "      Dumps all data available, in this case, all nitf and rpf tags, from file.\n\n"
+         << "    ossim-info --dno a.toc\n"
+         << "      \"dno\" for \"dump no overviews\" Dumps all data available,\n"
+         << "       in this case, all nitf and rpf tags, from file ignoring overviews.\n\n"
+         << "    ossim-info -d -i -p myfile.ntf\n"
+         << "      Typical usage case, i.e. do a dump of tags and print out image and\n"
+         << "      projection information.\n\n"
+         << std::endl;
+   au->setDescription(description.str());
+
+} // void ossimInfo::addArguments(ossimArgumentParser& ap)
+
+bool ossimInfo::initialize(ossimArgumentParser& ap)
+{
+   static const char M[] = "ossimInfo::initialize(ossimArgumentParser&)";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\n";
+   }
+
+   if (!ossimTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   bool result = true;
+
+   //---
+   // Start with clean options keyword list.
+   //---
+   m_kwl.clear();
+
+   bool requiresInputImage = false;
+
+   while ( 1 ) //  While forever loop...
+   {
+      // Used throughout below:
+      std::string ts1;
+      ossimArgumentParser::ossimParameter sp1(ts1);
+      std::string ts2;
+      ossimArgumentParser::ossimParameter sp2(ts2);
+      std::string ts3;
+      ossimArgumentParser::ossimParameter sp3(ts3);
+      const char TRUE_KW[] = "true";
+
+      if( ap.read("--bounds") )
+      {
+         m_kwl.add( IMAGE_BOUNDS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--build-date") )
+      {
+         m_kwl.add( BUILD_DATE_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-c") )
+      {
+         m_kwl.add( IMAGE_CENTER_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--cg") )
+      {
+         m_kwl.add( CENTER_GROUND_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--ci") )
+      {
+         m_kwl.add( CENTER_IMAGE_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--config") || ap.read("--configuration") )
+      {
+         m_kwl.add( CONFIGURATION_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--datums") )
+      {
+         m_kwl.add( DATUMS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--deg2rad", sp1) )
+      {
+         m_kwl.add( DEG2RAD_KW, ts1.c_str() );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-D") )
+      {
+         m_kwl.add( PRETTY_PRINT_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-d") )
+      {
+         m_kwl.add( DUMP_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--dno") )
+      {
+         m_kwl.add( DUMP_KW, TRUE_KW );
+         m_kwl.add( DUMP_NO_OVERVIEWS_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-f", sp1) )
+      {
+         m_kwl.add( FORMAT_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--factories", sp1) )
+      {
+         m_kwl.add( FACTORIES_KW, TRUE_KW);
+         m_kwl.add( FACTORY_KEYWORD_LIST_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--fonts") )
+      {
+         m_kwl.add( FONTS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+      
+      if( ap.read("--ft2mtrs", sp1) )
+      {
+         m_kwl.add( FT2MTRS_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--ft2mtrs-us-survey", sp1) )
+      {
+         m_kwl.add( FT2MTRS_KW, ts1.c_str());
+         m_kwl.add( FT2MTRS_US_SURVEY_KW, TRUE_KW);
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--height", sp1, sp2) )
+      {
+         ossimString lat = ts1;
+         ossimString lon = ts2;
+         ossimGpt gpt;
+         gpt.lat = lat.toFloat64();
+         gpt.lon = lon.toFloat64();
+         m_kwl.add( HEIGHT_KW, gpt.toString().c_str() );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+      if( ap.read("--ecef2llh", sp1, sp2, sp3))
+      {
+         ossimString x = ts1;
+         ossimString y = ts2;
+         ossimString z = ts3;
+         ossimEcefPoint ecefPoint(x.toFloat64(), y.toFloat64(), z.toFloat64());
+         m_kwl.add( ECEF2LLH_KW, ecefPoint.toString().c_str() );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+
+      }
+      if( ap.read("-i") )
+      {
+         m_kwl.add( IMAGE_INFO_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--img2grd", sp1, sp2) )
+      {
+         ossimString x = ts1;
+         ossimString y = ts2;
+         ossimDpt dpt;
+         dpt.x = x.toFloat64();
+         dpt.y = y.toFloat64();
+         m_kwl.add( IMG2GRD_KW, dpt.toString().c_str() );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--grd2img", sp1, sp2, sp3) )
+      {
+         ossimString lat = ts1;
+         ossimString lon = ts2;
+         ossimString hgt = ts3;
+         ossimGpt gpt;
+         gpt.makeNan();
+         gpt.latd(lat.toFloat64());
+         gpt.lond(lon.toFloat64());
+         if(hgt != "nan")
+         {
+           gpt.height(hgt.toFloat64());
+         }
+         m_kwl.add( GRD2IMG_KW, gpt.toString().c_str() );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-m") )
+      {
+         m_kwl.add( METADATA_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--mtrs2ft", sp1) )
+      {
+         m_kwl.add( MTRS2FT_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--mtrs2ft-us-survey", sp1) )
+      {
+         m_kwl.add( MTRS2FT_KW, ts1.c_str());
+         m_kwl.add( MTRS2FT_US_SURVEY_KW, TRUE_KW);
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--mtrsPerDeg", sp1) )
+      {
+         m_kwl.add( MTRSPERDEG_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-n") || ap.read("--north-up") )
+      {
+         m_kwl.add( NORTH_UP_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-o", sp1) )
+      {
+         m_kwl.add( OUTPUT_FILE_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--overview-types") )
+      {
+         m_kwl.add( OVERVIEW_TYPES_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-p") )
+      {
+         m_kwl.add( GEOM_INFO_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--palette") )
+      {
+         m_kwl.add( PALETTE_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--plugins") )
+      {
+         m_kwl.add( PLUGINS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--plugin-test", sp1) )
+      {
+         m_kwl.add( PLUGIN_TEST_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--projections") )
+      {
+         m_kwl.add( PROJECTIONS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-r") )
+      {
+         m_kwl.add( IMAGE_RECT_KW, TRUE_KW );
+         requiresInputImage = true;
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--rad2deg", sp1) )
+      {
+         m_kwl.add( RAD2DEG_KW, ts1.c_str());
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--reader-props") )
+      {
+         m_kwl.add( READER_PROPS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--resampler-filters") )
+      {
+         m_kwl.add( RESAMPLER_FILTERS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--revision") ||
+            ap.read("--revision-number") ) // backwards compat
+      {
+         m_kwl.add( REVISION_NUMBER_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-u") || ap.read("--up-is-up") )
+      {
+         m_kwl.add( UP_IS_UP_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("-v") )
+      {
+         m_kwl.add( OVERWRITE_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--version") || ap.read("-V") )
+      {
+         m_kwl.add( VERSION_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--writer-props") )
+      {
+         m_kwl.add( WRITER_PROPS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--writers") )
+      {
+         m_kwl.add( WRITERS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      if( ap.read("--zoom-level-gsds") )
+      {
+         m_kwl.add( ZOOM_LEVEL_GSDS_KW, TRUE_KW );
+         if ( ap.argc() < 2 )
+         {
+            break;
+         }
+      }
+
+      // End of arg parsing.
+      ap.reportRemainingOptionsAsUnrecognized();
+      if ( ap.errors() )
+      {
+         ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+         std::string errMsg = "Unknown option...";
+         throw ossimException(errMsg);
+      }
+
+      break; // Break from while forever.
+
+   } // End while (forever) loop.
+
+   if ( ap.argc() == 2 )
+   {
+      m_kwl.add( IMAGE_FILE_KW, ap[1]  );
+   }
+
+   if ( requiresInputImage && ( ap.argc() == 1 ) )
+   {
+      setUsage(ap);
+      ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+      result = false;
+   }
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+               << "m_kwl:\n" << m_kwl << "\n"
+               << M << " exit result = " << (result?"true":"false")
+               << "\n";
+   }
+
+   return result;
+}
+
+bool ossimInfo::execute()
+{
+   static const char M[] = "ossimInfo::execute()";
+
+   const ossim_uint32 KEY_COUNT = m_kwl.getSize();
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+               << M << " entered..."
+               << "\nMap size: " << KEY_COUNT << "\n";
+   }
+
+   if ( KEY_COUNT )
+   {
+      ossim_uint32 consumedKeys = 0;
+
+      const char* lookup;
+
+      lookup = m_kwl.find(IMAGE_FILE_KW);
+      if ( lookup )
+      {
+         ++consumedKeys;
+         ossimFilename image = lookup;
+
+         consumedKeys += executeImageOptions(image);
+      }
+
+      if ( consumedKeys < KEY_COUNT )
+      {
+         ossimString value;
+
+         if ( keyIsTrue( std::string(BUILD_DATE_KW)) )
+         {
+            getBuildDate( value.string() );
+            ossimNotify(ossimNotifyLevel_INFO)
+            << BUILD_DATE_KW << ": " << value << "\n";
+         }
+
+         lookup = m_kwl.find(CONFIGURATION_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printConfiguration();
+            }
+         }
+
+         lookup = m_kwl.find(DATUMS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printDatums();
+            }
+         }
+
+         lookup = m_kwl.find(DEG2RAD_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            deg2rad( value.toFloat64() );
+         }
+         lookup = m_kwl.find(ECEF2LLH_KW);
+         if(lookup)
+         {
+            ++consumedKeys;
+            ossimEcefPoint ecefPoint;
+            ecefPoint.toPoint(lookup);
+
+            ecef2llh(ecefPoint, ossimNotify(ossimNotifyLevel_INFO));
+         }
+
+         lookup = m_kwl.find(FACTORIES_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            ossimString factories = lookup;
+            bool keywordListFlag = false;
+            lookup = m_kwl.find(FACTORY_KEYWORD_LIST_KW);
+            if ( lookup )
+            {
+               ++consumedKeys;
+               keywordListFlag = ossimString(lookup).toBool();
+            }
+            printFactories(keywordListFlag);
+         }
+         
+         lookup = m_kwl.find(FONTS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printFonts();
+            }
+         }
+         
+         lookup = m_kwl.find(FT2MTRS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            bool us_survey = false;
+            lookup = m_kwl.find(FT2MTRS_US_SURVEY_KW);
+            if ( lookup )
+            {
+               ++consumedKeys;
+               us_survey = ossimString(lookup).toBool();
+            }
+            ft2mtrs( value.toFloat64(), us_survey);
+         }
+
+         lookup = m_kwl.find(HEIGHT_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            ossimGpt gpt;
+            gpt.toPoint(value);
+            outputHeight(gpt);
+         }
+
+         lookup = m_kwl.find(MTRS2FT_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            bool us_survey = false;
+            lookup = m_kwl.find(MTRS2FT_US_SURVEY_KW);
+            if ( lookup )
+            {
+               ++consumedKeys;
+               us_survey = ossimString(lookup).toBool();
+            }
+            mtrs2ft( value.toFloat64(), us_survey);
+         }
+
+         lookup = m_kwl.find(MTRSPERDEG_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            mtrsPerDeg( value.toFloat64() );
+         }
+
+         lookup = m_kwl.find(OVERVIEW_TYPES_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printOverviewTypes();
+            }
+         }
+
+         lookup = m_kwl.find(PLUGINS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printPlugins();
+            }
+         }
+
+         lookup = m_kwl.find(PLUGIN_TEST_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            testPlugin(value);
+         }
+
+         lookup = m_kwl.find(PROJECTIONS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printProjections();
+            }
+         }
+
+         lookup = m_kwl.find(RAD2DEG_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            rad2deg( value.toFloat64() );
+         }
+
+         lookup = m_kwl.find(READER_PROPS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printReaderProps();
+            }
+         }
+
+         lookup = m_kwl.find(RESAMPLER_FILTERS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printResamplerFilters();
+            }
+         }
+
+         if ( keyIsTrue( std::string(REVISION_NUMBER_KW) ) )
+         {
+            getRevisionNumber( value.string() );
+            ossimNotify(ossimNotifyLevel_INFO)
+            << REVISION_NUMBER_KW << ": " << value << "\n";
+         }
+
+         if ( keyIsTrue( std::string(VERSION_KW) ) )
+         {
+            getVersion( value.string() );
+            ossimNotify(ossimNotifyLevel_INFO)
+            << VERSION_KW << ": " << value << "\n";
+         }
+
+         lookup = m_kwl.find(WRITERS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printWriters();
+            }
+         }
+
+         lookup = m_kwl.find(WRITER_PROPS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printWriterProps();
+            }
+         }
+
+         lookup = m_kwl.find(ZOOM_LEVEL_GSDS_KW);
+         if ( lookup )
+         {
+            ++consumedKeys;
+            value = lookup;
+            if ( value.toBool() )
+            {
+               printZoomLevelGsds();
+            }
+         }
+
+      } // if ( consumedKeys < KEY_COUNT )
+
+      if ( traceDebug() )
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+                  << "KEY_COUNT:    " << KEY_COUNT
+                  << "\nconsumedKeys: " << consumedKeys << "\n";
+      }
+
+   } // if ( KEY_COUNT )
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " exited...\n";
+   }
+   return true;
+}
+
+ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
+{
+   static const char M[] = "ossimInfo::executeImageOptions()";
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << M << " entered...\nfile: " << file << "\n";
+   }
+
+   // Output keyword list.
+   ossimKeywordlist okwl;
+
+   ossim_uint32 consumedKeys = 0;
+   const char* lookup = 0;
+   ossimString value  = "";
+
+   bool dnoFlag       = false;
+   bool overwriteFlag = false;   
+   bool xmlOutFlag    = false;
+
+   lookup = m_kwl.find( OVERWRITE_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      overwriteFlag = value.toBool();
+   }
+
+   // Check for xml format option.
+   lookup = m_kwl.find( FORMAT_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      ossimString format = lookup;
+      if ( format.upcase() == "XML" )
+      {
+         xmlOutFlag = true;
+      }
+   }
+
+   lookup = m_kwl.find( OUTPUT_FILE_KW );
+   ossimFilename outputFile;
+   if ( lookup )
+   {
+      ++consumedKeys;
+      outputFile = lookup;
+   }
+
+   lookup = m_kwl.find( PRETTY_PRINT_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      prettyPrint(file);
+   }
+
+   // Check for dump.  Does not require image to be opened.
+   lookup = m_kwl.find( DUMP_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      lookup = m_kwl.find( DUMP_NO_OVERVIEWS_KW );
+      if ( lookup )
+      {
+         ++consumedKeys;
+         value = lookup;
+         dnoFlag = value.toBool();
+      }
+
+      if ( !xmlOutFlag && ( outputFile == ossimFilename::NIL ) )
+      {
+         //---
+         // Write to standard out:
+         // This dump will come out in order so is preferred over going to
+         // okwl(output keyword list) which will come out alphabetical.
+         //---
+         ossimKeywordlist kwl;
+         dumpImage(file, dnoFlag, kwl);
+         kwl.print(ossimNotify(ossimNotifyLevel_INFO));
+      }
+      else
+      {
+         // Save to output keyword list. Will be output later.
+         dumpImage(file, dnoFlag, okwl);
+      }
+   }
+
+   bool centerGroundFlag  = false;
+   bool centerImageFlag   = false;
+   bool imageBoundsFlag   = false;
+   bool imageCenterFlag   = false;   
+   bool imageGeomFlag     = false;
+   bool imageInfoFlag     = false;
+   bool imageRectFlag     = false;
+   bool img2grdFlag       = false;
+   bool grd2imgFlag       = false;
+   bool metaDataFlag      = false;
+   bool northUpFlag       = false;
+   bool paletteFlag       = false;
+   bool upIsUpFlag        = false;
+   bool imageToGroundFlag = false;
+   bool groundToImageFlag = false;
+
+   // Center Ground:
+   lookup = m_kwl.find( CENTER_GROUND_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      centerGroundFlag = value.toBool();
+   }
+
+   // Center Image:
+   lookup = m_kwl.find( CENTER_IMAGE_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      centerImageFlag = value.toBool();
+   }
+
+   // Metadata:
+   lookup = m_kwl.find( METADATA_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      metaDataFlag = value.toBool();
+   }
+
+   // Palette:
+   lookup = m_kwl.find( PALETTE_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      paletteFlag = value.toBool();
+   }
+
+   // Image bounds:
+   lookup = m_kwl.find( IMAGE_BOUNDS_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      imageBoundsFlag = value.toBool();
+   }
+
+   // Image center:
+   lookup = m_kwl.find( IMAGE_CENTER_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      imageCenterFlag = value.toBool();
+   }
+
+   // Image rect:
+   lookup = m_kwl.find( IMAGE_RECT_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      imageRectFlag = value.toBool();
+   }
+
+   //---
+   // General image info:
+   // Defaulted ON if no image options set.
+   //---
+   lookup = m_kwl.find( IMAGE_INFO_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      imageInfoFlag = value.toBool();
+   }
+
+   lookup = m_kwl.find( IMG2GRD_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      img2grdFlag = true;
+   }
+
+   lookup = m_kwl.find( GRD2IMG_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      grd2imgFlag = true;
+   }
+
+   //---
+   // Image geometry info:
+   // Defaulted on if no image options set.
+   //---
+   lookup = m_kwl.find( GEOM_INFO_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      imageGeomFlag = value.toBool();
+   }      
+
+   // North up:
+   lookup = m_kwl.find( NORTH_UP_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      northUpFlag = value.toBool();
+   }
+
+   // Up is up:
+   lookup = m_kwl.find( UP_IS_UP_KW );
+   if ( lookup )
+   {
+      ++consumedKeys;
+      value = lookup;
+      upIsUpFlag = value.toBool();
+   }
+
+   // If no options consumed default is image info and geom info:
+   if ( consumedKeys == 0 )
+   {
+      imageInfoFlag = true;
+      imageGeomFlag = true;
+   }
+
+   if ( centerGroundFlag || centerImageFlag || imageBoundsFlag || imageCenterFlag ||
+        imageRectFlag || img2grdFlag || grd2imgFlag || metaDataFlag || paletteFlag ||
+        imageInfoFlag || imageGeomFlag || northUpFlag || upIsUpFlag || 
+        imageToGroundFlag || groundToImageFlag)
+   {
+      // Requires open image.
+      if ( m_img.valid() == false )
+      {
+         openImage(file);
+      }
+
+      if ( centerGroundFlag )
+      {
+         getCenterGround(okwl);
+      }
+
+      if ( centerImageFlag )
+      {
+         getCenterImage(okwl);
+      }
+
+      if ( imageCenterFlag )
+      {
+         // -c option prints both ground and image point of center.
+         getCenterGround(okwl);
+         getCenterImage(okwl);
+      }
+
+      if ( imageBoundsFlag )
+      {
+         getImageBounds(okwl);
+      }
+
+      if ( imageRectFlag )
+      {
+         getImageRect(okwl);
+      }
+
+      if ( img2grdFlag )
+      {
+         getImg2grd(okwl);
+      }
+      if ( grd2imgFlag )
+      {
+         getGrd2img(okwl);
+      }
+
+      if ( metaDataFlag )
+      {
+         getImageMetadata(okwl);
+      }
+
+      if ( paletteFlag )
+      {
+         getImagePalette(okwl);
+      }
+
+      if ( imageInfoFlag )
+      {
+         getImageInfo(okwl, dnoFlag);
+      }
+
+      if ( imageGeomFlag )
+      {
+         getImageGeometryInfo(okwl, dnoFlag);
+      }
+
+      if ( imageRectFlag )
+      {
+         getImageRect(okwl);
+      }
+
+      if ( northUpFlag )
+      {
+         getNorthUpAngle( okwl );
+      }
+
+      if ( upIsUpFlag )
+      {
+         getUpIsUpAngle( okwl );
+      }
+
+   } // if ( metaDataFlag || paletteFlag || imageInfoFlag || imageGeomFlag )
+
+   if ( okwl.getSize() ) // Output section:
+   {
+      if ( outputFile == ossimFilename::NIL )
+      {
+         // Write to standard out:
+         if ( !xmlOutFlag )
+         {
+            ossimNotify(ossimNotifyLevel_INFO) << okwl << std::endl;
+         }
+         else
+         {
+            outputXml( okwl );
+         }
+      }
+      else
+      {
+         // Write to file:
+
+         if ( !overwriteFlag && outputFile.exists() )
+         {
+            ossimNotify(ossimNotifyLevel_INFO)
+                     << "ERROR: File already exists: "  << outputFile
+                     << "\nUse -v option to overwrite."
+                     << std::endl;
+         }
+         else
+         {
+            if ( !xmlOutFlag )
+            {
+               okwl.write( outputFile );
+            }
+            else
+            {
+               outputXml( okwl, outputFile );
+            }
+         }
+      }
+
+   } // if ( okwl )
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+               << "consumedKeys: " << consumedKeys << "\n"
+               << M << " exited...\n";
+   }
+
+   return consumedKeys;
+
+} // ossim_uint32 ossimInfo::executeImageOptions(const ossimFilename& file)
+
+void ossimInfo::getImageInfo( const ossimFilename& file,
+                              bool dumpFlag,
+                              bool dnoFlag,
+                              bool imageGeomFlag,
+                              bool imageInfoFlag,
+                              bool metaDataFlag,
+                              bool paletteFlag,
+                              ossimKeywordlist& kwl ) const
+{
+   if ( dumpFlag || dnoFlag )
+   {
+      dumpImage(file, dnoFlag, kwl);
+   }
+
+   // These flags requires open image.
+   if ( imageGeomFlag || imageInfoFlag || metaDataFlag || paletteFlag )
+   {
+      // Note: openImageHandler throws ossimException if it can't open.
+      ossimRefPtr<ossimImageHandler> ih = openImageHandler( file );
+      if ( ih.valid() )
+      {
+         if ( metaDataFlag )
+         {
+            getImageMetadata( ih.get(), kwl );
+         }
+         if ( paletteFlag )
+         {
+            getImagePalette( ih.get(), kwl );
+         }
+         if ( imageInfoFlag )
+         {
+            getImageInfo( ih.get(), kwl, dnoFlag );
+         }
+         if ( imageGeomFlag )
+         {
+            getImageGeometryInfo( ih.get(), kwl, dnoFlag) ;
+         }
+      }
+   }
+}
+
+bool ossimInfo::getImageInfo( const ossimFilename& file,
+                              ossim_uint32 entry,
+                              ossimKeywordlist& kwl ) const
+{
+   bool result = false;
+
+   // Note: openImageHandler throws ossimException if it can't open.
+   ossimRefPtr<ossimImageHandler> ih = openImageHandler( file );
+   if ( ih.valid() )
+   {
+      if ( ih->setCurrentEntry( entry ) )
+      {
+         if ( getImageInfo( ih.get(), entry, kwl, false ) )
+         {
+            result = getImageGeometryInfo( ih.get(), entry, kwl, false );
+         }
+      }
+      else
+      {
+         std::ostringstream errMsg;
+         errMsg << "ossimInfo::getImageInfo ERROR:\nInvalid entry: " << entry
+               << "\n";
+         throw ossimException( errMsg.str() );
+      }
+   }
+
+   return result;
+}
+
+void ossimInfo::openImage(const ossimFilename& file)
+{
+   m_img = openImageHandler( file );
+}
+
+ossimRefPtr<ossimImageHandler> ossimInfo::openImageHandler(const ossimFilename& file) const
+{
+   // Go through new interface that passes a stream around. (drb 10 Nov. 2016)
+   // ossimRefPtr<ossimImageHandler> result = ossimImageHandlerRegistry::instance()->open(file);
+   ossimRefPtr<ossimImageHandler> result = ossimImageHandlerRegistry::instance()->
+      openConnection(file);
+   if ( result.valid() == false )
+   {
+      std::string errMsg = "ossimInfo::openImage ERROR:\nCould not open: ";
+      errMsg += file.string();
+      throw ossimException(errMsg);
+   }
+   return result;
+}
+
+void ossimInfo::closeImage()
+{
+   m_img = 0;
+}
+
+ossimRefPtr<ossimImageHandler> ossimInfo::getImageHandler()
+{
+   return m_img;
+}
+
+void ossimInfo::prettyPrint(const ossimFilename& file) const
+{
+   std::shared_ptr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(file);
+   if (info)
+   {
+      //---
+      // Old -d behavior was to dump all unless the dump no overview flag
+      // was set. Need to see tiff tags in file order for all image file
+      // directories(ifd's) so commenting out hard coded
+      // info->setProcessOverviewFlag(false) that used to be settable with -d
+      // + --dno options.  Note the old -d option used to do file order for
+      // tiffs but now dumps to a keyword list that prints alphabetical(not
+      // file order) so can't use that anymore.
+      // 
+      // drb - 15 Dec. 2016
+      //---
+      // info->setProcessOverviewFlag(false);
+      
+      info->print(ossimNotify(ossimNotifyLevel_INFO));
+      info.reset();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+               << "No print available for:  " << file.c_str() << std::endl;
+   }
+}
+
+void ossimInfo::dumpImage(const ossimFilename& file,
+                          bool dnoFlag,
+                          ossimKeywordlist& kwl) const
+{
+   std::shared_ptr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(file);
+   if (info)
+   {
+      if (dnoFlag) // Default info processes overviews.
+      {
+         info->setProcessOverviewFlag(false);
+      }
+      info->getKeywordlist(kwl);
+      info.reset();
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_INFO)
+               << "No dump available for:  " << file.c_str() << std::endl;
+   }
+}
+void ossimInfo::getImageMetadata(ossimKeywordlist& kwl) const
+{
+   if ( m_img.valid() )
+   {
+      getImageMetadata( m_img.get(), kwl);
+   }
+}
+
+void ossimInfo::getImageMetadata(const ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {
+      std::vector< ossimRefPtr< ossimProperty > > list;
+      ih->getPropertyList(list);
+      std::vector< ossimRefPtr< ossimProperty > >::const_iterator i = list.begin();
+      while (i != list.end())
+      {
+         if ( (*i).valid() )
+         {
+            ossimString key;
+            ossimString value;
+
+            // Check for one level of nested container.
+            if ((*i)->getClassName() == "ossimContainerProperty")
+            {
+               ossimContainerProperty* ptr = PTR_CAST(ossimContainerProperty, (*i).get());
+               if (ptr)
+               {
+                  std::vector< ossimRefPtr< ossimProperty > > list2;    
+                  ptr->getPropertyList(list2);
+
+                  std::vector< ossimRefPtr< ossimProperty > >::const_iterator i2 = list2.begin();
+                  while (i2 != list2.end())
+                  {
+                     key   = (*i2)->getName();
+                     value = (*i2)->valueToString();
+                     kwl.add(key.c_str(), value.c_str(), true);
+                     ++i2;
+                  }
+               }
+            }
+            else // Not a container.
+            {
+               key   = (*i)->getName();
+               value = (*i)->valueToString();
+               kwl.add(key.c_str(), value.c_str(), true);
+            }
+         }
+         ++i;
+      }
+
+   } // if ( ih )
+
+} // End: getImageMetadata(ossimImageHandler* ih, ossimKeywordlist& kwl)
+
+void ossimInfo::getImagePalette(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getImagePalette( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getImagePalette(ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {
+      if(ih->getLut().valid())
+      {
+         ossim_uint32 entryIdx = 0;
+         std::vector<ossim_uint32> entryList;
+         ih->getEntryList(entryList);
+         for(entryIdx = 0; entryIdx < ih->getNumberOfEntries();++entryIdx)
+         {
+            ih->setCurrentEntry(entryList[entryIdx]);
+            ossimString prefix = "image";
+            prefix = prefix + ossimString::toString(entryList[entryIdx]) + ".lut.";
+            if(ih->getLut().valid())
+            {
+               ih->getLut()->saveState(kwl, prefix);
+            }
+         }
+      }
+
+   } // if ( ih )
+}
+
+void ossimInfo::getImageInfo(ossimKeywordlist& kwl, bool dnoFlag)
+{
+   if ( m_img.valid() )
+   {
+      getImageInfo( m_img.get(), kwl, dnoFlag );
+   }
+}
+
+void ossimInfo::getImageInfo( ossimImageHandler* ih, ossimKeywordlist& kwl, bool dnoFlag ) const
+{
+   if ( ih )
+   {
+      ossim_uint32 numEntries = 0;
+
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         if ( getImageInfo( ih, (*i), kwl, dnoFlag ) )
+         {
+            ++numEntries;
+         }
+         ++i;
+      }
+
+      kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
+
+   } // if ( ih )
+}
+
+bool ossimInfo::getImageInfo( ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag )
+{
+   bool result = false;
+   if ( m_img.valid() )
+   {
+      result = getImageInfo( m_img.get(), entry, kwl, dnoFlag );
+   }
+   return result;
+}
+
+bool ossimInfo::getImageInfo( ossimImageHandler* ih, ossim_uint32 entry, 
+                              ossimKeywordlist& kwl, bool dnoFlag ) const
+{
+   bool result = false;
+
+   if ( ih )
+   {
+      if ( ih->setCurrentEntry(entry) )
+      {
+         bool outputEntry = true;
+         if ( dnoFlag )
+         {
+            if ( isImageEntryOverview() )
+            {
+               outputEntry = false;
+            }
+         }
+
+         if ( outputEntry )
+         {
+            result = true;
+
+            // Entry number:
+            ossimString prefix = "image";
+            prefix = prefix + ossimString::toString(entry) + ".";
+            kwl.add(prefix.c_str(), ossimKeywordNames::ENTRY_KW, entry, true);
+
+            // Get the entry_name (specialized multi-entry readers only):
+            std::string entryName;
+            ih->getEntryName( entry, entryName );
+            if ( entryName.size() )
+            {
+               kwl.add(prefix.c_str(), "entry_name", entryName.c_str(), true);
+            }
+
+            // Type/class of reader:
+            kwl.add(prefix, "type", ih->getClassName().c_str(), true);
+
+            // Add RGB bands if available:
+            getRgbBands( ih, entry, kwl );
+
+            // Driver name if different from class name:
+            if ( ih->getClassName() != ih->getShortName() )
+            {
+               kwl.add(prefix, "driver", ih->getShortName().c_str(), true);
+            }
+
+            // Type/class of overview reader:
+            if (ih->getOverview())
+            {
+               kwl.add(prefix, "overview.type",
+                       ih->getOverview()->getClassName().c_str(), true);
+            }
+
+            ossimDrect boundingRect = ih->getBoundingRect();
+            kwl.add(prefix,ossimKeywordNames::UL_X_KW, boundingRect.ul().x, true);
+            kwl.add(prefix,ossimKeywordNames::UL_Y_KW, boundingRect.ul().y, true);
+            kwl.add(prefix,ossimKeywordNames::LR_X_KW, boundingRect.lr().x, true);
+            kwl.add(prefix,ossimKeywordNames::LR_Y_KW, boundingRect.lr().y, true);
+
+            const ossim_uint32 BANDS = ih->getNumberOfInputBands();
+            kwl.add(prefix,ossimKeywordNames::NUMBER_INPUT_BANDS_KW, BANDS, true);
+            kwl.add(prefix,ossimKeywordNames::NUMBER_OUTPUT_BANDS_KW,
+                    ih->getNumberOfOutputBands(), true);
+            kwl.add(prefix,ossimKeywordNames::NUMBER_LINES_KW,
+                    boundingRect.height(), true);
+            kwl.add(prefix,ossimKeywordNames::NUMBER_SAMPLES_KW,
+                    boundingRect.width(), true);
+
+            ossimScalarType scalar = ih->getOutputScalarType();
+
+            for(ossim_uint32 i = 0; i < BANDS; ++i)
+            {
+               ossimString band = ossimString("band") + ossimString::toString(i) + ".";
+
+               kwl.add(prefix, band+"null_value", ih->getNullPixelValue(i), true);
+               kwl.add(prefix, band+"min_value", ih->getMinPixelValue(i), true);
+               kwl.add(prefix, band+"max_value", ih->getMaxPixelValue(i), true);
+            }
+
+            // Output Radiometry.
+            std::string rad;
+            getRadiometry(scalar, rad);
+            kwl.add(prefix, "radiometry", rad.c_str(), true);
+            kwl.add(prefix,"number_decimation_levels", ih->getNumberOfDecimationLevels(), true);
+
+
+
+         } // if ( outputEntry )
+
+      } // if ( ih->setCurrentEntry(entry) )
+
+   } // if ( ih )
+
+   return result;
+
+} // End: ossimInfo::getImageInfo( ih, entry...
+
+void ossimInfo::getImageGeometryInfo(ossimKeywordlist& kwl, bool dnoFlag)
+{
+   if ( m_img.valid() )
+   {
+      getImageGeometryInfo( m_img.get(), kwl, dnoFlag );
+   }
+}
+
+void ossimInfo::getImageGeometryInfo( ossimImageHandler* ih, ossimKeywordlist& kwl, bool dnoFlag) const
+{
+   if ( ih )
+   {      ossim_uint32 numEntries = 0;
+
+   std::vector<ossim_uint32> entryList;
+   ih->getEntryList(entryList);
+
+   std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+   while ( i != entryList.end() )
+   {
+      if ( getImageGeometryInfo( ih, (*i), kwl, dnoFlag ) )
+      {
+         ++numEntries;
+      }
+      ++i;
+   }
+
+   kwl.add(ossimKeywordNames::NUMBER_ENTRIES_KW, numEntries, true);
+
+   } // if ( ih )
+}
+
+bool ossimInfo::getImageGeometryInfo(ossim_uint32 entry, ossimKeywordlist& kwl, bool dnoFlag)
+{
+   bool result = false; 
+   if ( m_img.valid() )
+   {
+      getImageGeometryInfo( m_img.get(), entry, kwl, dnoFlag );
+   }
+   return result;
+}
+
+bool ossimInfo::getImageGeometryInfo( ossimImageHandler* ih,
+                                      ossim_uint32 entry, 
+                                      ossimKeywordlist& kwl, 
+                                      bool dnoFlag) const
+{
+   bool result = false;
+
+   if ( ih )
+   {      
+      if ( ih->setCurrentEntry(entry) )
+      {
+         bool outputEntry = true;
+         if ( dnoFlag )
+         {
+            if ( isImageEntryOverview() )
+            {
+               outputEntry = false;
+            }
+         }
+
+         if ( outputEntry )
+         {
+            ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+            if(geom.valid())
+            {
+               result = true;
+
+               ossimString prefix = "image";
+               prefix = prefix + ossimString::toString(entry) + ossimString(".geometry.");
+
+               geom->saveState(kwl, prefix);
+
+               // Output support files list:
+               ossimSupportFilesList::instance()->save(kwl, prefix);
+
+               ossimGpt ulg;
+               ossimGpt llg;
+               ossimGpt lrg;
+               ossimGpt urg;
+
+               ossimDrect outputRect = ih->getBoundingRect();
+
+               geom->localToWorld(outputRect.ul(), ulg);
+               geom->localToWorld(outputRect.ll(), llg);
+               geom->localToWorld(outputRect.lr(), lrg);
+               geom->localToWorld(outputRect.ur(), urg);
+
+               //---
+               // *** HACK *** 
+               // Encountered CADRG RPF imagery where the left edge was longitude -180 and
+               // right edge +180. The projection code above reasonably maps all -180 to +180.
+               // This however breaks the image footprint since it would appear that the left
+               // and right edges were coincident instead of 360 degrees apart, i.e., a line
+               // segment instead of a rect. So added check here for coincident left and right
+               // edges and remapping left edge to -180.
+               //---
+               if ((ulg.lon == 180.0) && (urg.lon == 180.0))  
+               {
+                  ulg.lon = -180.0;
+               }
+               if ((llg.lon == 180.0) && (lrg.lon == 180.0))  
+               {
+                  llg.lon = -180.0;
+               }
+
+               kwl.add(prefix, "ul_lat", ulg.latd(), true);
+               kwl.add(prefix, "ul_lon", ulg.lond(), true);
+               kwl.add(prefix, "ll_lat", llg.latd(), true);
+               kwl.add(prefix, "ll_lon", llg.lond(), true);
+               kwl.add(prefix, "lr_lat", lrg.latd(), true);
+               kwl.add(prefix, "lr_lon", lrg.lond(), true);
+               kwl.add(prefix, "ur_lat", urg.latd(), true);
+               kwl.add(prefix, "ur_lon", urg.lond(), true);
+
+               if(!kwl.find(ossimKeywordNames::TIE_POINT_LAT_KW))
+               {
+                  kwl.add(prefix, ossimKeywordNames::TIE_POINT_LAT_KW, ulg.latd(), true);
+                  kwl.add(prefix, ossimKeywordNames::TIE_POINT_LON_KW, ulg.lond(), true);
+
+                  if ( outputRect.height()-1.0 > DBL_EPSILON )
+                  {
+                     kwl.add(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LAT,
+                             fabs(ulg.latd()-llg.latd())/(outputRect.height()-1.0), true);
+                  }
+
+                  if ( outputRect.width()-1.0 > DBL_EPSILON )
+                  {
+                     kwl.add(prefix, ossimKeywordNames::DECIMAL_DEGREES_PER_PIXEL_LON,
+                             fabs(ulg.lond()-urg.lond())/(outputRect.width()-1.0), true);
+                  }
+               }
+
+               ossimDpt gsd = geom->getMetersPerPixel();
+               kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_X_KW, gsd.x, true);
+               kwl.add(prefix, ossimKeywordNames::METERS_PER_PIXEL_Y_KW, gsd.y, true);
+
+            } // if(geom.valid())
+
+         } // if ( outputEntry )
+
+      } // if ( ih->setCurrentEntry(entry) )
+
+      if ( !result )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "No geometry for file " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+
+   return result;
+
+} // End: ossimInfo::getImageGeometryInfo( ih, entry...
+
+void ossimInfo::getCenterImage(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getCenterImage( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getCenterImage( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getCenterImage( ih, (*i), kwl );
+         ++i;
+      }
+   } 
+}
+
+void ossimInfo::getCenterImage( ossimImageHandler* ih,
+                                ossim_uint32 entry, 
+                                ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".";
+         ossimDrect bounds = ih->getBoundingRect();
+
+         if( !bounds.hasNans() )
+         {
+            ossimDpt iPt = bounds.midPoint();
+            kwl.add(prefix, "center_image", iPt.toString().c_str(), true);
+         }
+
+      } // if ( ih->setCurrentEntry(entry) )
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get image center for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+}
+
+void ossimInfo::getCenterGround(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getCenterGround( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getCenterGround( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getCenterGround( ih, (*i), kwl );
+         ++i;
+      }
+   } 
+}
+
+void ossimInfo::getCenterGround( ossimImageHandler* ih,
+                                 ossim_uint32 entry, 
+                                 ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".";
+
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if(geom.valid())
+         {
+            ossimDrect bounds;
+            geom->getBoundingRect( bounds );
+
+            if( !bounds.hasNans() )
+            {
+               ossimDpt iPt = bounds.midPoint();
+               ossimGpt gPt;
+               geom->localToWorld(iPt, gPt);
+               kwl.add(prefix, "center_ground", gPt.toString().c_str(), true);
+            }
+         }
+
+      } // if ( ih->setCurrentEntry(entry) )
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get ground center for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+}
+
+void ossimInfo::getImageBounds(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getImageBounds( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getImageBounds( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getImageBounds( ih, (*i), kwl );
+         ++i;
+      }
+   } 
+}
+
+void ossimInfo::getImageBounds( ossimImageHandler* ih,
+                                ossim_uint32 entry, 
+                                ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".bounds.";
+
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if(geom.valid())
+         {
+            ossimDrect bounds;
+            geom->getBoundingRect( bounds );
+
+            // Make edge to edge.
+            bounds.expand( ossimDpt(0.5, 0.5) );
+
+            if( !bounds.hasNans() )
+            {
+               ossimGpt gPt;
+
+               geom->localToWorld(bounds.ul(), gPt);
+               kwl.add(prefix, "ul", gPt.toString().c_str(), true);
+
+               geom->localToWorld(bounds.ur(), gPt);
+               kwl.add(prefix, "ur", gPt.toString().c_str(), true);
+
+               geom->localToWorld(bounds.lr(), gPt);
+               kwl.add(prefix, "lr", gPt.toString().c_str(), true);
+
+               geom->localToWorld(bounds.ll(), gPt);
+               kwl.add(prefix, "ll", gPt.toString().c_str(), true);
+            }
+         }
+
+      } // if ( ih->setCurrentEntry(entry) )
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get image bounds for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+}
+
+void ossimInfo::getImg2grd(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getImg2grd( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getImg2grd( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getImg2grd( ih, (*i), kwl );
+         ++i;
+      }
+   } 
+}
+
+void ossimInfo::getImg2grd( ossimImageHandler* ih,
+                            ossim_uint32 entry, 
+                            ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".";
+
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if(geom.valid())
+         {
+
+            ossimDrect bounds;
+            geom->getBoundingRect( bounds );
+
+            if( !bounds.hasNans() )
+            {
+               //---
+               // Expand the bounds out to edge of image so caller can do:
+               // ossim-info --img2grd -0.5 -0.5 <image.tif>
+               //---
+               bounds.expand( ossimDpt(0.5, 0.5) );
+               std::string value = m_kwl.findKey( IMG2GRD_KW );
+               if ( value.size() )
+               {
+                  ossimDpt ipt;
+                  ipt.toPoint( value );
+                  if ( bounds.pointWithin( ipt ) )
+                  {
+                     ossimGpt gpt;
+                     gpt.makeNan();
+                     geom->localToWorld(ipt, gpt);
+                     kwl.add(prefix, "ground_point", gpt.toString().c_str(), true);
+                  }
+                  else
+                  {
+                     kwl.add(prefix, "ground_point", "nan", true);
+                  }
+               }
+            }
+         }
+
+      } // if ( ih->setCurrentEntry(entry) )
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get ground center for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+}
+
+void ossimInfo::getGrd2img(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getGrd2img( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getGrd2img( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getGrd2img( ih, (*i), kwl );
+         ++i;
+      }
+   } 
+}
+
+void ossimInfo::getGrd2img( ossimImageHandler* ih,
+                            ossim_uint32 entry, 
+                            ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".";
+
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if(geom.valid())
+         {
+            std::string value = m_kwl.findKey( GRD2IMG_KW );
+            if ( value.size() )
+            {
+               ossimGpt gpt;
+               ossimDpt dpt;
+               gpt.toPoint( value );
+               dpt.makeNan();
+               geom->worldToLocal(gpt, dpt);
+               kwl.add(prefix, "image_point", dpt.toString().c_str(), true);
+            }
+         }
+
+      } // if ( ih->setCurrentEntry(entry) )
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get ground center for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+}
+
+void ossimInfo::getUpIsUpAngle(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getUpIsUpAngle( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getUpIsUpAngle( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getUpIsUpAngle( ih, (*i), kwl );
+         ++i;
+      }
+   } 
+}
+
+void ossimInfo::getUpIsUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getUpIsUpAngle( m_img.get(), entry, kwl );
+   }
+}
+
+void ossimInfo::getUpIsUpAngle( ossimImageHandler* ih,
+                                ossim_uint32 entry, 
+                                ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      bool result = false;
+
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".";
+
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if(geom.valid())
+         {
+            ossim_float64 upIsUp = 0.0;
+            if ( geom->isAffectedByElevation() )
+            {
+               upIsUp = geom->upIsUpAngle();
+               kwl.add(prefix, UP_IS_UP_KW, upIsUp, true);
+            }
+         }
+
+         result = true;
+
+      } // if ( ih->setCurrentEntry(entry) )
+
+      if ( !result )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get up is up angle for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+}
+
+
+void ossimInfo::getNorthUpAngle(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getNorthUpAngle( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getNorthUpAngle( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getNorthUpAngle( ih, (*i), kwl );
+         ++i;
+      }
+   } 
+}
+
+void ossimInfo::getNorthUpAngle(ossim_uint32 entry, ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getNorthUpAngle( m_img.get(), entry, kwl );
+   }
+}
+
+void ossimInfo::getNorthUpAngle( ossimImageHandler* ih,
+                                 ossim_uint32 entry, 
+                                 ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      bool result = false;
+
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".";
+
+         ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+         if(geom.valid())
+         {
+            ossim_float64 northUp = geom->northUpAngle();
+            kwl.add(prefix, NORTH_UP_KW, northUp, true);
+         }
+
+         result = true;
+
+      } // if ( ih->setCurrentEntry(entry) )
+
+      if ( !result )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get north up angle for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+}
+
+void ossimInfo::getImageRect(ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getImageRect( m_img.get(), kwl );
+   }
+}
+
+void ossimInfo::getImageRect( ossimImageHandler* ih, ossimKeywordlist& kwl) const
+{
+   if ( ih )
+   {  
+      std::vector<ossim_uint32> entryList;
+      ih->getEntryList(entryList);
+
+      std::vector<ossim_uint32>::const_iterator i = entryList.begin();
+      while ( i != entryList.end() )
+      {
+         getImageRect( ih, (*i), kwl );
+         ++i;
+      }
+   } // if ( ih )
+}
+
+bool ossimInfo::getRgbBands(
+      ossimImageHandler* ih, ossim_uint32 entry, ossimKeywordlist& kwl ) const
+{
+   bool result = false;
+   if ( ih )
+   {
+      std::vector<ossim_uint32> bandList;
+      result = ih->getRgbBandList( bandList );
+      if ( result && ( bandList.size() == 3 ) )
+      {
+         ossimString os;
+         ossim::toSimpleStringList<ossim_uint32>(os, bandList);
+         if ( os.size() )
+         {
+            ossimString prefix = "image";
+            prefix = prefix + ossimString::toString(entry) + ".";
+            kwl.add(prefix, "rgb_bands", os.c_str(), true);
+         }
+      }
+   }
+   return result;
+
+} // End: ossimInfo::getRgbBands( ... )
+
+void ossimInfo::getImageRect(ossim_uint32 entry, ossimKeywordlist& kwl)
+{
+   if ( m_img.valid() )
+   {
+      getImageRect( m_img.get(), entry, kwl );
+   }
+}
+
+void ossimInfo::getImageRect( ossimImageHandler* ih,
+                              ossim_uint32 entry, 
+                              ossimKeywordlist& kwl ) const
+{
+   if ( ih )
+   {
+      if ( ih->setCurrentEntry(entry) )
+      {
+         ossimString prefix = "image";
+         prefix = prefix + ossimString::toString(entry) + ".";
+         ossimIrect outputRect = ih->getBoundingRect();
+         kwl.add(prefix, "image_rectangle", outputRect.toString().c_str(), true);
+
+      } // if ( ih->setCurrentEntry(entry) )
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+                  << "Could not get image rectangle for: " << ih->getFilename() << std::endl;
+      }
+
+   } // if ( ih )
+
+} // End: getImageRect( ih, entry...
+
+// Note be sure to m_img->setCurrentEntry before calling.
+bool ossimInfo::isImageEntryOverview() const
+{
+   bool result = false; // Have to prove it.
+   if ( m_img.valid() )
+   {
+      result = isImageEntryOverview( m_img.get() );
+   }
+   return result;
+}
+
+bool ossimInfo::isImageEntryOverview( const ossimImageHandler* ih ) const
+{
+   bool result = false; // Have to prove it.
+   if ( ih )
+   {     
+      ossimString s = "imag";
+      ossimRefPtr<ossimProperty> prop = ih->getProperty(s);
+      if (prop.valid())
+      {
+         ossimString s;
+         prop->valueToString(s);
+         if (s.toFloat32() < 1.0)
+         {
+            result = true;
+         }
+      }
+   }
+   return result;
+}
+
+void ossimInfo::printConfiguration() const
+{
+   printConfiguration( ossimNotify(ossimNotifyLevel_INFO) );
+}
+
+std::ostream& ossimInfo::printConfiguration(std::ostream& out) const
+{
+   out << "\npreferences_keyword_file: "
+       << ossimPreferences::instance()->getPreferencesFilename() << "\n"
+       << "preferences_keyword_list:\n"
+       << ossimPreferences::instance()->preferencesKWL()
+       << std::endl;
+   return out;
+}
+
+void ossimInfo::printFactories(bool keywordListFlag)const
+{
+   std::vector<ossimString> typeList;
+   ossimObjectFactoryRegistry::instance()->getTypeNameList(typeList);
+   for(int i = 0; i < (int)typeList.size(); ++i)
+   {
+      if(keywordListFlag)
+      {
+         ossimObject* obj = ossimObjectFactoryRegistry::instance()->createObject(typeList[i]);
+         if(obj)
+         {
+            cout << typeList[i] << endl;
+            cout << "______________________________________________________" << endl;
+            ossimKeywordlist kwl;
+            obj->saveState(kwl);
+            cout << kwl << endl;
+            cout << "______________________________________________________" << endl;
+            delete obj;
+         }
+      }
+      else
+      {
+         cout << typeList[i] << endl;
+      }
+   }  
+}
+
+void ossimInfo::printDatums() const
+{
+   ossimInfo::printDatums( ossimNotify(ossimNotifyLevel_INFO) );
+}
+
+std::ostream& ossimInfo::printDatums(std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   std::vector<ossimString> datumList;
+   ossimDatumFactoryRegistry::instance()->getList(datumList);
+
+   std::vector<ossimString>::const_iterator i = datumList.begin();
+
+   while ( i != datumList.end() )
+   {
+      const ossimDatum* datum = ossimDatumFactoryRegistry::instance()->create(*i);
+      if (datum)
+      {
+         if ( datum->ellipsoid() )
+         {
+            out << setiosflags(ios::left)
+                << setw(7)
+                << datum->code().c_str()
+                << setw(7)
+                << datum->epsgCode()
+                << setw(48)
+                << datum->name().c_str()
+                << setw(10)
+                << "Ellipse:"
+                << datum->ellipsoid()->name()
+                << std::endl;
+         }
+         else
+         {
+            out << "No ellipsoid for code: " << (*i) << std::endl;
+         }
+      }
+      else
+      {
+         out << "No datum for code: " << (*i) << std::endl;
+      }
+
+      ++i;
+   }
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+void ossimInfo::printFonts() const
+{
+   ossimInfo::printFonts( ossimNotify(ossimNotifyLevel_INFO) );
+}
+
+std::ostream& ossimInfo::printFonts(std::ostream& out) const
+{
+   std::vector<ossimFontInformation> fontInfoList;
+   ossimFontFactoryRegistry::instance()->getFontInformation( fontInfoList );
+
+   std::vector<ossimFontInformation>::const_iterator i = fontInfoList.begin();
+
+   while ( i != fontInfoList.end() )
+   {
+      out << *(i) << endl;
+      ++i;
+   }
+
+   // Get the default:
+   ossimRefPtr<ossimFont> defaultFont = ossimFontFactoryRegistry::instance()->getDefaultFont();
+   if ( defaultFont.valid() )
+   {
+      out << "default_font: " << defaultFont->getFamilyName() << std::endl;
+   }
+
+   return out;
+}
+
+void ossimInfo::deg2rad(const ossim_float64& degrees) const
+{
+   deg2rad( degrees, ossimNotify(ossimNotifyLevel_INFO) );
+}
+
+std::ostream& ossimInfo::deg2rad(const ossim_float64& degrees, std::ostream& out) const
+{
+   double radians = degrees * RAD_PER_DEG;
+
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
+   << "\n" << degrees << " degrees = "
+   << radians << " radians.\n" << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+std::ostream& ossimInfo::ecef2llh(const ossimEcefPoint& ecefPoint, std::ostream& out) const
+{
+   out << "ECEF:            " << ecefPoint.toString() << "\n"
+       << "lat_lon_height:  " << ossimGpt(ecefPoint).toString() << "\n"; 
+
+   return out;
+}
+
+void ossimInfo::rad2deg(const ossim_float64& radians) const
+{
+   rad2deg(radians, ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::rad2deg(const ossim_float64& radians, std::ostream& out) const
+{
+   double degrees = radians * DEG_PER_RAD;
+
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << std::setiosflags(std::ios::fixed) << std::setprecision(15)
+   << "\n" << radians << " radians = "
+   << degrees << " degrees.\n" << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+void ossimInfo::ft2mtrs(const ossim_float64& feet, bool us_survey) const
+{
+   ft2mtrs( feet, us_survey, ossimNotify(ossimNotifyLevel_INFO) );
+}
+
+std::ostream& ossimInfo::ft2mtrs(const ossim_float64& feet,
+                                 bool us_survey,
+                                 std::ostream& out) const
+{
+   ossim_float64 meters = 0.0;
+   std::string conversionString;
+   if (us_survey)
+   {
+      meters = feet * US_METERS_PER_FT;
+      conversionString = "0.3048006096";
+   }
+   else
+   {
+      meters = feet * MTRS_PER_FT;
+      conversionString = "0.3048";
+   }
+
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << setiosflags(ios::fixed) << setprecision(15)
+             << feet << " * " << conversionString << " = "
+             << meters << " meters." << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+void ossimInfo::mtrs2ft(const ossim_float64& meters, bool us_survey) const
+{
+   mtrs2ft(meters, us_survey, ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::mtrs2ft(const ossim_float64& meters,
+                                 bool us_survey,
+                                 std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   double feet = 0.0;
+   std::string conversionString;
+
+   if (us_survey)
+   {
+      feet = meters / US_METERS_PER_FT;
+      conversionString = "0.3048006096";
+   }
+   else
+   {
+      feet = meters / MTRS_PER_FT;
+      conversionString = "0.3048";
+   }
+
+   out << setiosflags(ios::fixed) << setprecision(15)
+             << meters << " / " << conversionString << " = "
+             << feet << " feet." << std::endl;
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+void ossimInfo::mtrsPerDeg(const ossim_float64& latitude) const
+{
+   mtrsPerDeg(latitude, ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::mtrsPerDeg(const ossim_float64& latitude, std::ostream& out) const
+{
+   ossimGpt gpt(latitude, 0.0);
+   ossimDpt      mpd          = gpt.metersPerDegree();  
+   ossim_float64 radius       = gpt.datum()->ellipsoid()->geodeticRadius(latitude);
+   ossim_float64 arcLengthLat = mpd.y/60.0;
+   ossim_float64 arcLengthLon = mpd.x/60.0;
+   out << setiosflags(ios::fixed) << setprecision(15)
+             << "Meters per degree and minute at latitude of " << latitude << ":\n"
+             << "Meters per degree latitude:   "
+             << setw(20) << mpd.y << "\n"
+             << "Meters per degree longitude:  "
+             << setw(20) << mpd.x << "\n"
+             << "Meters per minute latitude:   "
+             << setw(20) << arcLengthLat << "\n"
+             << "Meters per minute longitude:  "
+             << setw(20) << arcLengthLon << "\n"
+             << "Geodetic radius:              "
+             << setw(20) << radius << "\n"
+             << std::endl;
+   return out;
+}
+
+void ossimInfo::outputHeight(const ossimGpt& gpt) const
+{
+   outputHeight(gpt, ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::outputHeight(const ossimGpt& gpt, std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   // Handle wrap conditions.
+   ossimGpt copyGpt = gpt;
+   copyGpt.wrap();
+
+   ossim_float64 hgtAboveMsl = ossimElevManager::instance()->getHeightAboveMSL(copyGpt);
+   ossim_float64 hgtAboveEllipsoid =
+         ossimElevManager::instance()->getHeightAboveEllipsoid(copyGpt);
+   ossim_float64 geoidOffset = ossimGeoidManager::instance()->offsetFromEllipsoid(copyGpt);
+   ossim_float64 mslOffset = 0.0;
+
+   if(ossim::isnan(hgtAboveEllipsoid)||ossim::isnan(hgtAboveMsl))
+   {
+      mslOffset = ossim::nan();
+   }
+   else
+   {
+      mslOffset = hgtAboveEllipsoid - hgtAboveMsl;
+   }
+
+   std::vector<ossimFilename> cellList;
+   ossimElevManager::instance()->getOpenCellList(cellList);
+
+   if (!cellList.empty())
+   {
+      out << "Opened cell:            " << cellList[0] << "\n";
+   }
+   else
+   {
+      out << "Did not find cell for point: " << gpt << "\n";
+   }
+
+   out << "MSL to ellipsoid delta: ";
+   if (!ossim::isnan(mslOffset))
+   {
+      out << std::setprecision(15) << mslOffset;
+   }
+   else
+   {
+      out << "nan";
+   }
+   out << "\nHeight above MSL:       ";
+   if (!ossim::isnan(hgtAboveMsl))
+   {
+      out << std::setprecision(15) << hgtAboveMsl;
+   }
+   else
+   {
+      out << "nan";
+   }
+   out << "\nHeight above ellipsoid: ";
+   if (!ossim::isnan(hgtAboveEllipsoid))
+   {
+      out << std::setprecision(15) << hgtAboveEllipsoid << "\n";
+   }
+   else
+   {
+      out << "nan" << "\n";
+   }
+   out << "Geoid value:            ";
+
+   if (!ossim::isnan(geoidOffset))
+   {
+      out << std::setprecision(15) << geoidOffset << std::endl;
+   }
+   else
+   {
+      out << "nan" << std::endl;
+   }
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+}
+
+void ossimInfo::printPlugins() const
+{
+   printPlugins(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printPlugins(std::ostream& out) const
+{
+   if(ossimSharedPluginRegistry::instance()->getNumberOfPlugins() > 0)
+   {
+      ossimSharedPluginRegistry::instance()->printAllPluginInformation(out);
+   }
+   else
+   {
+      out << "No plugins loaded in the OSSIM core library" << std::endl;
+   }
+   return out;
+}
+
+void ossimInfo::testPlugin(const ossimFilename& plugin) const
+{
+   testPlugin(plugin, ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::testPlugin(const ossimFilename& plugin, std::ostream& out) const
+{
+   if( ossimSharedPluginRegistry::instance()->registerPlugin(plugin.expand()) )
+   {
+      out << "Plugin loaded: " << plugin << std::endl;
+   }
+   else
+   {
+      out << "Unable to load plugin: " << plugin << std::endl;
+   }
+   return out;
+}
+
+void ossimInfo::printOverviewTypes() const
+{
+   printOverviewTypes(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printOverviewTypes(std::ostream& out) const
+{
+   out << "\nValid overview types: " << std::endl;
+
+   std::vector<ossimString> outputType;
+
+   ossimOverviewBuilderFactoryRegistry::instance()->getTypeNameList(outputType);
+   std::copy(outputType.begin(),
+             outputType.end(),
+             std::ostream_iterator<ossimString>(out, "\t\n"));
+   return out;
+}
+
+void ossimInfo::printProjections() const
+{
+   printProjections(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printProjections(std::ostream& out) const
+{
+   out << "Projections:\n";
+
+   std::vector<ossimString> list;
+   ossimProjectionFactoryRegistry::instance()->
+         getAllTypeNamesFromRegistry(list);
+
+   std::vector<ossimString>::const_iterator i = list.begin();
+   while ( i != list.end() )
+   {
+      out << *i << "\n";
+      ++i;
+   }
+   out << std::endl;
+
+   return out;
+}
+
+void ossimInfo::printReaderProps() const
+{
+   printReaderProps(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printReaderProps(std::ostream& out) const
+{
+   return ossimImageHandlerRegistry::instance()->printReaderProps( out );
+}
+
+void ossimInfo::printResamplerFilters() const
+{
+   printResamplerFilters(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printResamplerFilters(std::ostream& out) const
+{
+   std::vector<ossimString> list;
+   ossimFilterResampler f;
+   f.getFilterTypes(list);
+   std::vector<ossimString>::const_iterator i = list.begin();
+   while ( i != list.end() )
+   {
+      out << *i << "\n";
+      ++i;
+   }
+   out << std::endl;
+   return out;
+}
+
+void ossimInfo::printWriters() const
+{
+   printWriters(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printWriters(std::ostream& out) const
+{
+   return ossimImageWriterFactoryRegistry::instance()->printImageTypeList( out );
+}
+
+void ossimInfo::printZoomLevelGsds() const
+{
+   printZoomLevelGsds(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printZoomLevelGsds(std::ostream& out) const
+{
+   // Capture the original flags.
+   std::ios_base::fmtflags f = out.flags();
+
+   out << setprecision(15)<< setiosflags(std::ios_base::fixed|std::ios_base::right);
+
+   const int MAX_LEVEL = 24;
+   const double TILE_SIZE = 256.0;
+   const double EPSG_4326_BOUNDS = 180.0;
+   const double EPSG_3857_BOUNDS = 40075016.685578488;
+
+   // From: ossim-info --mtrsPerDeg 0.0
+   const double MTRS_PER_DEGREE_AT_EQUATOR = 111319.490793273565941;
+
+   out << "Notes:\n"
+         << "tile size: 256\n"
+         << "dpp = \"degrees per pixel\"\n"
+         << "mpp = \"meters per pixel\"\n\n";
+
+   // Assuming square pixels, level 0 having (2 x 1) tiles.
+   double level_0_gsd = EPSG_4326_BOUNDS / TILE_SIZE;
+   double level_gsd = 0.0;
+   int i = 0;
+   int tilesX = 2;
+   int tilesY = 1;
+
+   out << "EPSG:4326 level info:\n"
+       << "Note: Assuming square pixels, level 0 having (2x1) tiles.\n"
+       << "bounds: 360.0 X 180.0\n"
+       << "level[" << std::setw(2) << std::setfill('0') << i << "] dpp:"
+       << std::setw(18) << std::setfill(' ') << level_0_gsd
+       << "  equivalent mpp:" << std::setw(22)
+       << (level_0_gsd * MTRS_PER_DEGREE_AT_EQUATOR)
+       << " (" << tilesX << "x" << tilesY << ")" << "\n";
+
+   for ( i = 1; i <= MAX_LEVEL; ++i )
+   {
+      tilesX = tilesX << 1;
+      tilesY = tilesY << 1;
+      level_gsd = level_0_gsd / std::pow( 2.0, i );
+      out << "level[" << std::setw(2) << std::setfill('0') << i << "] dpp:"
+          << std::setw(18) << std::setfill(' ') << level_gsd
+          << "  equivalent mpp:" << std::setw(22)
+          << (level_gsd * MTRS_PER_DEGREE_AT_EQUATOR)
+          << " (" << tilesX << "x" << tilesY << ")"<< "\n";
+
+   }
+
+   // Assuming square pixels, level 0 having (1 x 1) tiles.
+   level_0_gsd = EPSG_3857_BOUNDS / TILE_SIZE;
+   level_gsd = 0.0;
+   i = 0;
+   tilesX = 1; // X and y the same.
+
+   out << "\n\nEPSG:3857 level info:\n"
+       << "Note: Assuming square pixels, level 0 having (1x1) tile.\n"
+       << "bounds: 40075016.685578488 X 40075016.685578488\n"
+       << "level[" << std::setw(2) << std::setfill('0') << i << "] mpp:"
+       << std::setw(23) << std::setfill(' ') << level_0_gsd
+       << " (" << tilesX << "x" << tilesX << ")" << "\n";
+
+   for ( i = 1; i <= MAX_LEVEL; ++i )
+   {
+      tilesX = tilesX << 1;
+      level_gsd = level_0_gsd / std::pow( 2.0, i );
+      out << "level[" << std::setw(2) << std::setfill('0') << i << "] mpp:"
+          << std::setw(23) << std::setfill(' ') << level_gsd
+          << " (" << tilesX << "x" << tilesX << ")" << "\n";
+   }
+
+   // Reset flags.
+   out.setf(f);
+
+   return out;
+
+} // End: ossimInfo::printZoomLevelGsds(std::ostream& out)
+
+void ossimInfo::printWriterProps() const
+{
+   printWriterProps(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+std::ostream& ossimInfo::printWriterProps(std::ostream& out) const
+{
+   return ossimImageWriterFactoryRegistry::instance()->printWriterProps( out );
+}
+
+void ossimInfo::getRadiometry(ossimScalarType scalar, std::string& s) const
+{
+   // Output Radiometry.
+   switch(scalar)
+   {
+   case OSSIM_UINT8:
+   {
+      s = "8-bit";
+      break;
+   }
+   case OSSIM_USHORT11:
+   {
+      s = "11-bit";
+      break;
+   }
+   case OSSIM_USHORT12:
+   {
+      s = "12-bit";
+      break;
+   }
+   case OSSIM_USHORT13:
+   {
+      s = "13-bit";
+      break;
+   }
+   case OSSIM_USHORT14:
+   {
+      s = "14-bit";
+      break;
+   }
+   case OSSIM_USHORT15:
+   {
+      s = "15-bit";
+      break;
+   }
+   case OSSIM_UINT16:
+   {
+      s = "16-bit unsigned";
+      break;
+   }
+   case OSSIM_SINT16:
+   {
+      s = "16-bit signed";
+      break;
+   }
+   case OSSIM_UINT32:
+   {
+      s = "32-bit unsigned";
+      break;
+   }
+   case OSSIM_SINT32:
+   {
+      s = "32-bit signed";
+      break;
+   }
+   case OSSIM_FLOAT32:
+   {
+      s = "32-bit float";
+      break;
+   }
+   case OSSIM_DOUBLE:
+   {
+      s = "64-bit double float";
+      break;
+   }
+   case OSSIM_NORMALIZED_FLOAT:
+   {
+      s = "normalized 32-bit float";
+      break;
+   }
+   case OSSIM_NORMALIZED_DOUBLE:
+   {
+      s = "normalized 64-bit double float";
+      break;
+   }
+   default:
+   {
+      s = "unknown";
+      break;
+   }
+   }
+}
+
+void ossimInfo::getBuildDate(std::string& s) const
+{
+#ifdef OSSIM_BUILD_DATE
+   s = OSSIM_BUILD_DATE;
+#else
+   s = "unknown";
+#endif
+}
+
+void ossimInfo::getRevisionNumber(std::string& s) const
+{
+#ifdef OSSIM_REVISION
+   s = OSSIM_REVISION;
+#else
+   s = "unknown";
+#endif
+}
+
+void ossimInfo::getVersion(std::string& s) const
+{
+#ifdef OSSIM_VERSION
+   s = OSSIM_VERSION;
+#else
+   s = "unknown";
+#endif
+}
+
+void ossimInfo::outputXml( const ossimKeywordlist& kwl ) const
+{
+   ossimXmlDocument document;
+   document.fromKwl( kwl );
+   ossimNotify(ossimNotifyLevel_INFO) << document << std::endl;
+}
+
+void ossimInfo::outputXml( const ossimKeywordlist& kwl, const ossimFilename& file  ) const
+{
+   ossimXmlDocument document;
+   document.fromKwl( kwl );
+   document.write( file );
+}
+
+bool ossimInfo::keyIsTrue( const std::string& key ) const
+{
+   bool result = false;
+   std::string value = m_kwl.findKey( key );
+   if ( value.size() )
+   {
+      result = ossimString(value).toBool();
+   }
+   return result;
+}
diff --git a/src/util/ossimOrthoIgen.cpp b/src/util/ossimOrthoIgen.cpp
new file mode 100644
index 0000000..1f42c78
--- /dev/null
+++ b/src/util/ossimOrthoIgen.cpp
@@ -0,0 +1,3042 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+//----------------------------------------------------------------------------
+// $Id: ossimOrthoIgen.cpp 22813 2014-06-04 19:52:08Z okramer $
+
+
+#include <ossim/util/ossimOrthoIgen.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimNotifyContext.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimVisitor.h>
+#include <ossim/imaging/ossimBandSelector.h>
+#include <ossim/imaging/ossimCacheTileSource.h>
+#include <ossim/imaging/ossimGeoAnnotationSource.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimHistogramRemapper.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimBlendMosaic.h>
+#include <ossim/imaging/ossimBandMergeSource.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimOrthoImageMosaic.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimMaskFilter.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimEsriShapeFileInterface.h>
+#include <ossim/imaging/ossimTilingRect.h>
+#include <ossim/imaging/ossimTilingPoly.h>
+#include <ossim/imaging/ossimGeoPolyCutter.h>
+#include <ossim/imaging/ossimEastingNorthingCutter.h>
+#include <ossim/imaging/ossimHistogramEqualization.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/imaging/ossimHistogramWriter.h>
+#include <ossim/imaging/ossimGeoAnnotationPolyObject.h>
+#include <ossim/imaging/ossimGeoAnnotationMultiPolyObject.h>
+#include <ossim/imaging/ossimPixelFlipper.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/parallel/ossimIgen.h>
+#include <ossim/parallel/ossimMpi.h>
+#include <ossim/projection/ossimUtmProjection.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimEpsgProjectionFactory.h>
+
+#include <sstream>
+
+// In Windows, standard output is ASCII by default. 
+// Let's include the following in case we have
+// to change it over to binary mode.
+#if defined(_WIN32)
+#  include <io.h>
+#  include <fcntl.h>
+#endif
+
+
+static ossimTrace traceDebug("ossimOrthoIgen:debug");
+static ossimTrace traceLog("ossimOrthoIgen:log");
+
+static const char* AUTOGENERATE_HISTOGRAM_KW = "autogenerate_histogram";
+
+using namespace ossim;
+
+//*************************************************************************************************
+// Parses the file info as specified in the command line or src file. The file info is a '|'-
+// delimited string with filename and additional attributes such as entry and band numbers.
+//*************************************************************************************************
+bool ossimOrthoIgen::parseFilename(const ossimString& file_spec, bool decodeEntry)
+{
+   ossimSrcRecord src_record;
+
+   std::vector<ossimString> fileInfos = file_spec.split("|");
+   unsigned int num_fields = (unsigned int) fileInfos.size();
+   unsigned int field_idx = 0;
+
+   if (num_fields == 0)
+      return false;
+
+   // First field is the actual filename:
+   src_record.setFilename(fileInfos[field_idx]);
+   ++field_idx;
+
+   // Next field depends on whether an entry is being decoded:
+   if ((field_idx < num_fields) && decodeEntry)
+   {
+      src_record.setEntryIndex(fileInfos[field_idx].trim().toInt32());
+      ++field_idx;
+   }
+
+   // The rest of the fields can appear in any order:
+   while (field_idx < num_fields)
+   {
+      ossimString active_field (fileInfos[field_idx].trim());
+      ossimString downcased_field (active_field);
+      downcased_field.downcase();
+      ++field_idx;
+
+      // Check for overview file spec:
+      ossimFilename filename (active_field);
+      if (filename.contains(".ovr") || filename.isDir())
+      {
+         src_record.setSupportDir(filename.path());
+      }
+      else if (filename.contains(".mask") || filename.isDir())
+      {
+         src_record.setSupportDir(filename.path());
+      }
+
+      // else check for auto-minmax histogram stretch:
+      else if ((downcased_field == "auto-minmax") || downcased_field.contains("std-stretch"))
+      {
+         src_record.setHistogramOp(downcased_field);
+      }
+
+      // Otherwise, this must be a band specification. Band numbers begin with 1:
+      else
+      {
+         // multiple bands delimited by comma:
+         std::vector<ossimString> bandsStr = active_field.split(",");
+         std::vector<ossim_uint32> bands;
+         for (unsigned int i = 0; i < bandsStr.size(); i++)
+         {
+            int band = bandsStr[i].toInt32() - 1;
+            if (band >= 0)
+               bands.push_back((ossim_uint32)band);
+         }
+         src_record.setBands(bands);
+      }
+
+   } // end of while loop parsing fileInfos spec
+
+   theSrcRecords.push_back(src_record);
+   return true;
+}
+
+//*************************************************************************************************
+// Constructor
+//*************************************************************************************************
+ossimOrthoIgen::ossimOrthoIgen()
+   :
+   ossimIgen(),
+   theDeltaPerPixelUnit(OSSIM_UNIT_UNKNOWN),
+   theDeltaPerPixelOverride(ossim::nan(), ossim::nan()),
+   theProjectionType(OSSIM_UNKNOWN_PROJECTION),
+   theProjectionName(""),
+   theGeoScalingLatitude(ossim::nan()),
+   theCombinerType("ossimImageMosaic"),
+   theResamplerType("nearest neighbor"),
+   theWriterType(""),
+   theTemplateView(""),
+   theTilingTemplate(""),
+   theTilingFilename(""),
+   theChainTemplate(""),
+   theCombinerTemplate(""),
+   theAnnotationTemplate(""),
+   theWriterTemplate(""),
+   theSupplementaryDirectory(""),
+   theSlaveBuffers("2"),
+   theCutOriginType(ossimOrthoIgen::OSSIM_CENTER_ORIGIN),
+   theCutOrigin(ossim::nan(), ossim::nan()),
+   theCutDxDy(ossim::nan(), ossim::nan()),
+   theCutOriginUnit(OSSIM_UNIT_UNKNOWN),
+   theCutDxDyUnit(OSSIM_UNIT_UNKNOWN),
+   theLowPercentClip(ossim::nan()),
+   theHighPercentClip(ossim::nan()),
+   theStdDevClip(-1),
+   theUseAutoMinMaxFlag(false),
+   theClipToValidRectFlag(false),   
+   theReaderProperties(),
+   theWriterProperties(),   
+   theTargetHistoFileName(),
+   theProductFilename(),
+   theReferenceProj(0),
+   theMaskShpFile(""),
+   theCacheExcludedFlag(false),
+   theOutputRadiometry(""),
+   thePixelAlignment(OSSIM_PIXEL_IS_AREA) // will revert to "point" upon first occurrence in source list
+{
+   // Determine default behavior of clip from preferences:
+   ossimString flag = ossimPreferences::instance()->findPreference("orthoigen.clip_to_valid_rect");
+   if (!flag.empty())
+      theClipToValidRectFlag = flag.toBool();
+
+   thePixelReplacementMode = ossimPreferences::instance()->findPreference("orthoigen.flip_null_pixels"); 
+   return;
+}
+
+//*************************************************************************************************
+// Initializes the argument parser
+//*************************************************************************************************
+void ossimOrthoIgen::addArguments(ossimArgumentParser& argumentParser)
+{
+   // These are in ALPHABETIC ORDER. Please keep it that way.
+
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--annotate", "annotation keyword list");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--chain-template","Specify an external file that contains chain information");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--clamp-pixels <min> <max>","Specify the min and max allowed pixel values. All values "
+      "outside of this get mapped to their corresponding clamp value.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--clip-pixels <min> <max>","Causes all pixel values between min and max (inclusive)"
+      " to be mapped to the null pixel value. Min and max can be equal for mapping a single value."
+      " See also related option \"--replacement-mode\" for additional explanation.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--clip-to-valid-rect <true|false>","When true, any requested cut rect is clipped by the "
+      "valid image bounding rect to minimize null border pixels. If false, the output will "
+      "correspond to the cut rect as close as possible given the product projection. This option "
+      "overrides the ossim_preferences setting. If no cut options are supplied, this option is "
+      "ignored.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--combiner-template","Specify an external file that contains combiner information");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--combiner-type","Specify what mosaic to use, ossimImageMosiac or ossimFeatherMosaic or "
+      "osimBlendMosaic ... etc");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--cut-bbox-en","Specify the min easting, min northing, max easting, max northing");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--cut-bbox-ll","Specify the min lat and min lon and max lat and maxlon <minLat> <minLon> "
+      "<maxLat> <maxLon>");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--cut-center-ll","Specify the center cut in lat lon space.  Takes two argument <lat> <lon>");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--cut-pixel-width-height","Specify cut box's width and height in pixels");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--cut-radius-meters","Specify the cut distance in meters.  A bounding box for the cut will "
+      "be produced");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--degrees","Specifies an override for degrees per pixel. Takes either a single value "
+      "applied equally to x and y directions, or two values applied correspondingly to x then y.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--geo","Defaults to a geographic image chain with GSD = to the input.  Origin of latitude is"
+      "on the equator.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--geo-auto-scaled","Computes the mosaic center latitude  for purpose of scaling in the "
+      "longitude direction so that the pixels will appear nearly square in ground space at "
+      "specified latitude. Implies a geographic projection.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--geo-scaled","Takes latitude as an argument for purpose of scaling in the "
+      "longitude direction so that the pixels will appear nearly square in ground space at "
+      "specified latitude. Implies a geographic projection.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--hist-auto-minmax","uses the automatic search for the best min and max clip values."
+      " Incompatible with other histogram options.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--hist-match","Takes one image filename argument for target histogram to match."
+      " Incompatible with other histogram options.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--hist-std-stretch","Specify histogram stretch as a standard deviation from the mean as"
+      " <int>, where <int> is 1, 2, or 3."
+      " Incompatible with other histogram options.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--hist-stretch","Specify in normalized percent the low clip and then the high clip value"
+      " as <low.dd> <hi.dd>."
+      " Incompatible with other histogram options.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--input-proj","Makes the view equal to the input.  If more than one file then the first is "
+      "taken");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--mask","Specify the ESRI shape file with polygons to clip the image");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--meters","Specifies an override for the meters per pixel. Takes either a single value "
+      "applied equally to x and y directions, or two values applied correspondingly to x then y.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--no-cache","Excludes the cache from the input image chain(s). Necessary as a workaround "
+      " for inconsistent cache behavior for certain image types.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--output-radiometry","Specifies the desired product's pixel radiometry type. Possible "
+      "values are: U8, U11, U16, S16, F32. Note this overrides the deprecated option \"scale-to"
+      "-8-bit\".");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--reader-prop","Passes a name=value pair to the reader(s) for setting it's property.  Any "
+      "number of these can appear on the line.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--replacement-mode <mode>","Specify how to treat multi-band imagery when providing "
+      "clip-pixels and/or clamp-pixels settings. Possible values are: REPLACE_BAND_IF_TARGET | "
+      "REPLACE_BAND_IF_PARTIAL_TARGET | REPLACE_ALL_BANDS_IF_ANY_TARGET | "
+      "REPLACE_ONLY_FULL_TARGETS.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--resample-type","Specify what resampler to use, nearest neighbor, bilinear, cubic");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--scale-to-8-bit","Scales the output to unsigned eight bits per band. This option has been"
+      " deprecated by the newer \"--output-radiometry\" option.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--slave-buffers","number of slave tile buffers for mpi processing (default = 2)");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--srs","specify an output reference frame/projection. Example: --srs EPSG:4326");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--stdout","Output the image to standard out.  This will return an error if writer does not "
+      "support writing to standard out.  Callers should combine this with the --ossim-logfile "
+      "option to ensure output image stream does not get corrupted.  You must still pass an output "
+      "file so the writer type can be determined like \"dummy.png\".");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--supplementary-directory or --support","Specify the supplementary directory path where "
+      "overviews, histograms and external geometries are located");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "-t or --thumbnail", "thumbnail size");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--tiling-template","Specify an external file that contains tiling information");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--threads [n]","Indicates multi-threaded process using optionally-specified number of threads");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--utm","Defaults to a utm image chain with GSD = to the input");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--view-template","Specify an external file that contains view information");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "-w or --writer","Specifies the output writer.  Default uses output file extension to "
+      "determine writer.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--wkt","specify an output reference frame/projection that is in a wkt format.  Must have the"
+      " ossimgdal_plugin compiled");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--writer-prop","Passes a name=value pair to the writer for setting it's property.  Any "
+      "number of these can appear on the line.");
+   argumentParser.getApplicationUsage()->addCommandLineOption(
+      "--writer-template","Specify an external file that contains tiling information"); 
+}
+
+//*************************************************************************************************
+// Initializes this objects data members given the command line args
+//*************************************************************************************************
+void ossimOrthoIgen::initialize(ossimArgumentParser& argumentParser)
+{
+   if(traceDebug())
+   {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimOrthoIgen::initialize DEBUG:"
+            << "Entered..... " 
+            << std::endl;
+   }
+   double tempDouble;
+   double tempDouble2;
+   double tempDouble3;
+   double tempDouble4;
+   ossimString tempString;
+   unsigned int tempUint;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+   ossimArgumentParser::ossimParameter doubleParam(tempDouble);
+   ossimArgumentParser::ossimParameter doubleParam2(tempDouble2);
+   ossimArgumentParser::ossimParameter doubleParam3(tempDouble3);
+   ossimArgumentParser::ossimParameter doubleParam4(tempDouble4);
+   ossimArgumentParser::ossimParameter uintParam(tempUint);
+   theCutOriginType = ossimOrthoIgen::OSSIM_CENTER_ORIGIN;
+   theCutOrigin.makeNan();
+   theCutDxDy.makeNan();
+   theCutOriginUnit   = OSSIM_UNIT_UNKNOWN;
+   theCutDxDyUnit     = OSSIM_UNIT_UNKNOWN;
+   theLowPercentClip  = ossim::nan();
+   theHighPercentClip = ossim::nan();
+   double minX=ossim::nan(), minY=ossim::nan(), maxX=ossim::nan(), maxY=ossim::nan();
+   theUseAutoMinMaxFlag = false;
+   theDeltaPerPixelOverride.makeNan();
+   theDeltaPerPixelUnit = OSSIM_UNIT_UNKNOWN;
+   theCacheExcludedFlag = false;
+   theClampPixelMin = ossim::nan();
+   theClampPixelMax = ossim::nan();
+   theClipPixelMin = ossim::nan();
+   theClipPixelMax = ossim::nan();
+   
+   if(argumentParser.read("--annotate", stringParam))
+   {
+      theAnnotationTemplate = ossimFilename(tempString);
+   }
+   if(argumentParser.read("-t", stringParam)   ||
+      argumentParser.read("--thumbnail", stringParam))
+   {
+      ossimString comma (",");
+      if (tempString.contains(comma))
+      {
+         theThumbnailSize.x = tempString.before(comma).toInt();
+         theThumbnailSize.y = tempString.after(comma).toInt();
+      }
+      else
+      {
+         theThumbnailSize.x = tempString.toInt();
+         theThumbnailSize.y = 0;
+      }
+      theBuildThumbnailFlag = true;
+   }
+
+   theReaderProperties.clear();
+   while(argumentParser.read("--reader-prop", stringParam))
+   {
+      std::vector<ossimString> splitArray;
+      tempString.split(splitArray, "=");
+      if(splitArray.size() == 2)
+      {
+         theReaderProperties.insert(std::make_pair(splitArray[0], splitArray[1]));
+      }
+   }
+
+   if(argumentParser.read("-w", stringParam)   ||
+      argumentParser.read("--writer", stringParam))
+   {
+      theWriterType = tempString;
+   }
+
+   theWriterProperties.clear();
+   
+   while(argumentParser.read("--writer-prop", stringParam))
+   {
+      std::vector<ossimString> splitArray;
+      tempString.split(splitArray, "=");
+      if(splitArray.size() == 2)
+      {
+         theWriterProperties.insert(std::make_pair(splitArray[0], splitArray[1]));
+      }
+   }
+         
+   if(argumentParser.read("--slave-buffers", stringParam))
+   {
+      theSlaveBuffers = tempString;
+   }
+   if(argumentParser.read("--cut-center-ll", doubleParam, doubleParam2))
+   {
+      theCutOrigin.lat = tempDouble;
+      theCutOrigin.lon = tempDouble2;
+      theCutOriginUnit = OSSIM_DEGREES;
+      theCutOriginType = ossimOrthoIgen::OSSIM_CENTER_ORIGIN;
+   }
+   if(argumentParser.read("--cut-radius-meters", doubleParam))
+   {
+      theCutDxDy.x = tempDouble;
+      theCutDxDy.y = tempDouble;
+      theCutDxDyUnit = OSSIM_METERS;
+   }
+   if(argumentParser.read("--cut-bbox-ll", doubleParam, doubleParam2, doubleParam3, doubleParam4))
+   {
+      minY = tempDouble;
+      minX = tempDouble2;
+      maxY = tempDouble3;
+      maxX = tempDouble4;
+      theCutOriginUnit = OSSIM_DEGREES;
+      theCutOriginType = ossimOrthoIgen::OSSIM_UPPER_LEFT_ORIGIN;
+      theCutOrigin.lat = maxY;
+      theCutOrigin.lon = minX;
+      theCutDxDy.lat   = (maxY-minY);
+      if ( (maxX < 0.0) && (minX >= 0.0) )
+      {
+         //---
+         // Min is eastern hemisphere, max is western. Crossed the international date line.
+         // Add 360 to make it positive.
+         //
+         // Note no check for just max < min here???  Perhaps throw exception.(drb)
+         //---
+         maxX += 360.0;
+      }      
+      theCutDxDy.lon   = (maxX-minX);
+      theCutDxDyUnit   = OSSIM_DEGREES;
+   }
+   if(argumentParser.read("--cut-bbox-en", doubleParam, doubleParam2, doubleParam3, doubleParam4))
+   {
+      minX = tempDouble;
+      minY = tempDouble2;
+      maxX = tempDouble3;
+      maxY = tempDouble4;
+      theCutOriginUnit = OSSIM_METERS;
+      theCutOriginType = ossimOrthoIgen::OSSIM_UPPER_LEFT_ORIGIN;
+      theCutOrigin.x = minX;
+      theCutOrigin.y = maxY;
+      theCutDxDy.x   = (maxX-minX);
+      theCutDxDy.y   = (maxY-minY);
+      theCutDxDyUnit   = OSSIM_METERS;
+   }
+   if(argumentParser.read("--cut-pixel-width-height", doubleParam, doubleParam2))
+   {
+      if((ossim::isnan(minX) == false)&&
+         (ossim::isnan(minY) == false)&&
+         (ossim::isnan(maxX) == false)&&
+         (ossim::isnan(maxY) == false))
+      {
+         theDeltaPerPixelOverride = ossimDpt(theCutDxDy.x/(tempDouble-1),
+                                             theCutDxDy.y/(tempDouble2-1));
+         theDeltaPerPixelUnit     = theCutDxDyUnit;
+      }
+      else
+      {
+         theCutOrigin.makeNan();
+         ossimNotify(ossimNotifyLevel_WARN) << "Can't have option --cut-pixel-width-height without --cut-bbox-ll" << std::endl;
+      }
+   }
+   
+   int num_params = argumentParser.numberOfParams("--degrees", doubleParam);
+   if (num_params == 1)
+   {
+      argumentParser.read("--degrees", doubleParam);
+      theDeltaPerPixelUnit = OSSIM_DEGREES;
+      theDeltaPerPixelOverride.x = tempDouble;
+      theDeltaPerPixelOverride.y = tempDouble;
+   }
+   else if (num_params == 2)
+   {
+      argumentParser.read("--degrees", doubleParam, doubleParam2);
+      theDeltaPerPixelUnit = OSSIM_DEGREES;
+      theDeltaPerPixelOverride.x = tempDouble;
+      theDeltaPerPixelOverride.y = tempDouble2;
+   }
+
+   // The three histogram options are mutually exclusive:
+   bool histo_op_selected = false;
+   if(argumentParser.read("--hist-match", stringParam))
+   {
+      ossimFilename target_image (tempString);
+      histo_op_selected = true;
+      
+      // Check for histogram matching request and initialize for that:
+      if (target_image.isReadable())
+      {
+         // Establish target histogram file:
+         theTargetHistoFileName = target_image;
+         theTargetHistoFileName.setExtension("his");
+         if (!theTargetHistoFileName.isReadable())
+         {
+            ossimNotify(ossimNotifyLevel_NOTICE)<<"Target histogram file <" << theTargetHistoFileName 
+               << "> not found. Cannot perform histogram matching." << std::endl;
+            theTargetHistoFileName.clear();
+         }
+      }
+   }
+   if(argumentParser.read("--hist-stretch", doubleParam, doubleParam2))
+   {
+      if (histo_op_selected)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "Cannot specify nore than one histogram operation. "
+            " Ignoring --hist-stretch option." << std::endl;
+      }
+      else
+      {
+         theLowPercentClip = tempDouble;
+         theHighPercentClip = tempDouble2;
+         histo_op_selected = true;
+      }
+   }
+   if(argumentParser.read("--hist-std-stretch", stringParam))
+   {
+      if (histo_op_selected)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "Cannot specify nore than one histogram operation. "
+            " Ignoring --hist-stretch option." << std::endl;
+      }
+      else
+      {
+         theStdDevClip = tempString.toInt32();
+         histo_op_selected = true;
+         if ((theStdDevClip < 1) || (theStdDevClip > 3))
+         {
+            ossimNotify(ossimNotifyLevel_WARN) << "Invalid standard deviation value provided with"
+               " --hist-std-stretch option. Only 1,2, or 3 allowed. Ignoring option."<< std::endl;
+         }
+      }
+   }
+   if(argumentParser.read("--hist-auto-minmax"))
+   {
+      if (histo_op_selected)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "Cannot specify nore than one histogram operation. "
+            " Ignoring --hist-auto-minmax option." << std::endl;
+      }
+      else
+         theUseAutoMinMaxFlag = true;
+   }
+
+   num_params = argumentParser.numberOfParams("--meters", doubleParam);
+   if (num_params == 1)
+   {
+      argumentParser.read("--meters", doubleParam);
+      theDeltaPerPixelUnit = OSSIM_METERS;
+      theDeltaPerPixelOverride.x = tempDouble;
+      theDeltaPerPixelOverride.y = tempDouble;
+   }
+   else if (num_params == 2)
+   {
+      argumentParser.read("--meters", doubleParam, doubleParam2);
+      theDeltaPerPixelUnit = OSSIM_METERS;
+      theDeltaPerPixelOverride.x = tempDouble;
+      theDeltaPerPixelOverride.y = tempDouble2;
+   }
+
+   if(argumentParser.read("--no-cache"))
+   {
+      theCacheExcludedFlag = true;
+   }
+
+   if(argumentParser.read("--output-radiometry", stringParam))
+   {
+      theOutputRadiometry = tempString;
+   }
+
+   if(argumentParser.read("--scale-to-8-bit"))
+   {
+      if (theOutputRadiometry.empty())
+         theOutputRadiometry = "U8";
+   }
+
+   if (argumentParser.read("--stdout"))
+   {
+#if defined(_WIN32)
+      // In Windows, cout is ASCII by default. 
+      // Let's change it over to binary mode.
+      int result = _setmode( _fileno(stdout), _O_BINARY );
+      if( result == -1 )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimOrthoIgen::initialize WARNING:"
+            << "\nCannot set standard output mode to binary."
+            << std::endl;
+         return;
+      }
+#endif
+
+      theStdoutFlag = true;
+   }
+   
+   if(argumentParser.read("--writer-template", stringParam))
+   {
+      theWriterTemplate = tempString;
+   }
+   if(argumentParser.read("--tiling-template", stringParam))
+   {
+      theTilingTemplate = ossimFilename(tempString);
+   }
+   if(argumentParser.read("--chain-template", stringParam))
+   {
+      theChainTemplate = ossimFilename(tempString);
+   }
+   if(argumentParser.read("--combiner-template", stringParam))
+   {
+      theCombinerTemplate = ossimFilename(tempString);
+   }
+   
+   theGeoScalingLatitude = ossim::nan();
+
+   if (argumentParser.read("--utm"))
+   {
+      theProjectionType = OSSIM_UTM_PROJECTION;
+      theProjectionName = "ossimUtmProjection";
+   }
+   else if(argumentParser.read("--geo"))
+   {
+      theProjectionType = OSSIM_GEO_PROJECTION;
+      theProjectionName = "ossimEquDistCylProjection";
+      theGeoScalingLatitude = 0.0;
+   }
+   else if(argumentParser.read("--input-proj"))
+   {
+      theProjectionType = OSSIM_INPUT_PROJECTION;
+   }
+   else if (argumentParser.read("--srs", stringParam))
+   {
+      theCrsString=tempString;
+      theProjectionType = OSSIM_SRS_PROJECTION;
+   }
+
+   if(argumentParser.read("--view-template", stringParam))
+   {
+      theTemplateView = ossimFilename(tempString);
+      theProjectionType = OSSIM_EXTERNAL_PROJECTION;
+   }
+
+   if(argumentParser.read("--geo-scaled", doubleParam))
+   {
+      theProjectionType = OSSIM_GEO_PROJECTION;
+      theProjectionName = "ossimEquDistCylProjection";
+      if ( (tempDouble < 90.0) && (tempDouble > -90.0) )
+      {
+         theGeoScalingLatitude = tempDouble;
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimOrthoIgen::initialize WARNING:"
+            << "\nLatitude out  of range!  Must be between -90 and 90."
+            << std::endl;
+      }
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimOrthoIgen::initialize DEBUG:"
+            << "\ngeographicOriginOfLatitude:  " << theGeoScalingLatitude
+            << std::endl;
+      }
+   }
+
+   if(argumentParser.read("--geo-auto-scaled"))
+   {
+      theProjectionType = OSSIM_GEO_PROJECTION;
+      theProjectionName = "ossimEquDistCylProjection";
+      theGeoScalingLatitude = 999.0; // Flags computation of center lat for scaling
+   }
+
+   if(argumentParser.read("--combiner-type", stringParam))
+      theCombinerType = tempString;
+
+   if(argumentParser.read("--resample-type", stringParam))
+   {
+      theResamplerType = tempString;
+   }
+   if(argumentParser.read("--supplementary-directory", stringParam) ||
+      argumentParser.read("--support", stringParam))
+   {
+      theSupplementaryDirectory = ossimFilename(tempString);
+   }
+
+   if (argumentParser.read("--clip-to-valid-rect", stringParam))
+   {
+      theClipToValidRectFlag = tempString.toBool();
+   }
+
+   if(argumentParser.read("--mask", stringParam))
+   {
+     theMaskShpFile = tempString;
+   }
+
+   // Pixel flipper control options:
+   if (argumentParser.read("--clip-pixels", doubleParam, doubleParam2))
+   {
+      theClipPixelMin = tempDouble;
+      theClipPixelMax = tempDouble2;
+   }
+   if (argumentParser.read("--clamp-pixels", doubleParam, doubleParam2))
+   { 
+      theClampPixelMin = tempDouble;
+      theClampPixelMax = tempDouble2;
+   }
+   if (argumentParser.read("--replacement-mode", stringParam))
+   { 
+      thePixelReplacementMode = tempString;
+   }
+
+   // Threading:
+   num_params = argumentParser.numberOfParams("--threads", uintParam);
+   if (num_params == 0)   // No param means system decides optimal thread count
+   {
+      argumentParser.read("--threads");
+      theThreadCount = 0; // Flags system-resolved
+   }
+   else if (num_params == 1)
+   {
+      argumentParser.read("--threads", uintParam);
+      theThreadCount = (ossim_uint32) tempUint; 
+   }
+
+   if(traceDebug())
+   {
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "ossimOrthoIgen::initialize DEBUG:"
+            << "Leaving..... " 
+            << std::endl;
+   }
+}
+
+//*************************************************************************************************
+// Adds any file specifications to the files list
+//*************************************************************************************************
+void ossimOrthoIgen::addFiles(ossimArgumentParser& argumentParser,
+                              bool withDecoding,
+                              ossim_uint32 startIdx)
+{
+   ossim_uint32 idx = startIdx;
+   ossim_uint32 last_idx = argumentParser.argc()-1;
+   while(argumentParser.argv()[idx] && (idx < last_idx))
+   {
+     ossimString file_spec = argumentParser.argv()[idx];
+     if (file_spec.contains(".src"))
+     {
+        // input file spec provided via src file. Need to parse it:
+        addSrcFile(ossimFilename(file_spec));
+     }
+     else
+     {
+        // Filename with optional switches explicitly provided on command line:
+        parseFilename(file_spec, withDecoding);
+     }
+     ++idx;
+   }
+
+   // The last filename left on the command line should be the product filename:
+   theProductFilename = argumentParser.argv()[last_idx];
+}
+
+//*************************************************************************************************
+// Performs the top-level management of image generation
+//*************************************************************************************************
+bool ossimOrthoIgen::execute()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimOrthoIgen::execute DEBUG: Entered ..."
+         << std::endl;
+   }
+//   double start=0, stop=0;
+
+   if(theSrcRecords.size() < 1)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossimOrthoIgen::execute WARNING: No filenames to process"
+         << std::endl;
+      return false;
+   }
+
+   if (!theCrsString.empty() && !theProductFilename.empty())
+   {
+     if ((theProductFilename.ext().upcase() == "KMZ" || theProductFilename.ext().upcase() == "KML") 
+       && theCrsString.upcase() != "EPSG:4326")
+     {
+       ossimNotify(ossimNotifyLevel_FATAL)
+         << "ossimOrthoIgen::execute ERROR: Unsupported projection for kmz or kml"
+         << std::endl;
+       return false;
+     }
+   }
+
+   //if(ossimMpi::instance()->getRank() == 0)
+   //{
+      try
+      {
+         setupIgenChain();
+      }
+      catch (const ossimException& e)
+      {
+         if (traceDebug())
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG) << e.what() << std::endl;
+         }
+         throw; // re-throw exception
+      }
+
+      if (traceLog())
+      {
+         generateLog();
+      }
+   //}
+
+   try
+   {
+      // theProductProjection->print(cout) << endl;
+      outputProduct();
+   }
+   catch(const ossimException& e)
+   {
+      if (traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << e.what() << std::endl;
+      }
+      throw; // re-throw
+   }
+   
+   return true;
+}
+
+//*************************************************************************************************
+// METHOD
+//*************************************************************************************************
+void ossimOrthoIgen::clearFilenameList()
+{
+   theSrcRecords.clear();
+}
+
+//*************************************************************************************************
+// Parses the .src file specified in the command line. These contain an alternate specification
+// of input file and associated attributes as a KWL.
+//*************************************************************************************************
+void ossimOrthoIgen::addSrcFile(const ossimFilename& src_file)
+{
+   if (!src_file.isReadable())
+      return;
+
+   ossimKeywordlist src_kwl;
+   src_kwl.setExpandEnvVarsFlag(true);
+   if ( src_kwl.addFile(src_file) == false ) return;
+
+   unsigned int image_idx = 0;
+   // int entry = -1;
+
+   // Loop to read all image file entries:
+   double sum_weights = 0;
+   while (true)
+   {
+      ossimSrcRecord src_record(src_kwl, image_idx++);
+      if (!src_record.valid()) 
+         break;
+
+      // Check for the presence of separate RGB file specs in this SRC record. This indicates 
+      // special processing. (comment added OLK 01/11)
+      if (src_record.isRgbData())
+      {
+         for (ossim_uint32 rgb_index = 0; rgb_index < 3; rgb_index++)
+         {
+            // This call creates another band-specific ossimSrcRecord that is pushed onto 
+            // theSrcRecords vector data member. (comment added OLK 01/11)
+            if (parseFilename(src_record.getRgbFilename(rgb_index), true))
+            {
+               // The parseFilename call pushes the R, G, or B band onto the back of theSrcRecords 
+               // vector. Set some additional attributes on this last entry. (OLK 01/11)
+               theSrcRecords.back().setRgbDataBool(true);
+               theSrcRecords.back().setHistogramOp(src_record.getRgbHistogramOp(rgb_index));
+               theSrcRecords.back().setHistogram(src_record.getRgbHistogramPath(rgb_index));
+               theSrcRecords.back().setOverview(src_record.getRgbOverviewPath(rgb_index));
+            }
+         }
+      }
+      else
+      {
+         // Not RGB data, so treat as conventional image: (comment added OLK 01/11)
+         theSrcRecords.push_back(src_record);
+         sum_weights += src_record.getWeight();
+
+         //if the vector file exists, set the mosaic combiner type to ossimBlendMosaic
+         if (src_record.isVectorData())
+            theCombinerType = "ossimBlendMosaic";
+      }
+   }
+
+   double max_weight = (sum_weights > 100.0 ? sum_weights : 100.0);
+   double num_entries = (double)theSrcRecords.size();
+   double weight; 
+   vector<ossimSrcRecord>::iterator iter = theSrcRecords.begin();
+   while (iter != theSrcRecords.end())
+   {
+      if (sum_weights > 0.0)
+      {
+         // Somebody declared opacity, so need to share the remaining contributions among
+         // other images:
+         theCombinerType = "ossimBlendMosaic";
+         if (iter->getWeight() == 0.0)
+         {
+            // No weight has been assigned for this image, so use default remaining partial
+            if (num_entries == 1.0)
+               weight = 1.0; // This is the only image, so full weight
+            else
+            {
+               // share remaining contributions:
+               weight = (1.0 - sum_weights/max_weight)/(num_entries - 1); 
+               if (weight < 0.01)
+                  weight = 0.01;
+            }
+         }
+         else
+         {
+            // An opacity value was specified for this
+            weight = iter->getWeight()/max_weight;
+         }
+      }
+      else
+      {
+         // No opacity values were specified, so simply use the default equal share. Note that the
+         // mosaic may not even be of type ossimBlendMosaic:
+         weight = 100.0/num_entries; // default if no opacity specified
+      }
+
+      iter->setWeight(weight);
+      iter++;
+   }
+}
+
+//*************************************************************************************************
+// METHOD
+//*************************************************************************************************
+void ossimOrthoIgen::setDefaultValues()
+{
+   theBuildThumbnailFlag = false;
+   theDeltaPerPixelUnit = OSSIM_UNIT_UNKNOWN;
+   theDeltaPerPixelOverride.makeNan();
+   theTemplateView = "";
+   theProjectionType = OSSIM_UNKNOWN_PROJECTION;
+   theGeoScalingLatitude = ossim::nan();
+   theCombinerType = "ossimImageMosaic";
+   theResamplerType = "nearest neighbor";
+   theTilingTemplate = "";
+   theTilingFilename = "";
+   theSupplementaryDirectory = "";
+   theSlaveBuffers = "2";
+   clearFilenameList();
+   theLowPercentClip = ossim::nan();
+   theHighPercentClip = ossim::nan();
+   theCutOrigin.makeNan();
+   theCutDxDy.makeNan();
+   theCutOriginUnit   = OSSIM_UNIT_UNKNOWN;
+   theCutDxDyUnit     = OSSIM_UNIT_UNKNOWN;
+
+   // PIXEL_IS_AREA HACK -- Set the assumed pixel alignment type to "area". Upon the first occurrence
+   // of a pixel-is-point entry, this property will revert to point. THIS NEEDS TO BE
+   // REMOVED WHEN THE EW GUI PROVIDES FOR THE USER TO SET THIS PROPERTY (OLK 09/11):
+   thePixelAlignment = OSSIM_PIXEL_IS_AREA; // not a default, but necessary for later logic
+}
+
+//*************************************************************************************************
+// Initializes the processing chain from the information on the command line
+//*************************************************************************************************
+void ossimOrthoIgen::setupIgenChain()
+{
+   if (traceDebug())
+      ossimNotify(ossimNotifyLevel_DEBUG)<< "ossimOrthoIgen::setupIgenChain DEBUG: Entered ..."<< std::endl;
+
+   setupTiling();
+
+   if (theSlaveBuffers == "")
+      theNumberOfTilesToBuffer = 2;
+   else
+      theNumberOfTilesToBuffer = theSlaveBuffers.toLong();
+
+   if(theProductFilename.empty())
+      throw(ossimException(std::string("Must supply an output file.")));
+
+   // Create the output mosaic object, to be connected to its inputs later:
+   ossimKeywordlist templateKwl;
+   templateKwl.clear();
+   ossimRefPtr<ossimImageCombiner> mosaicObject = 0;
+   ossimRefPtr<ossimImageCombiner> bandMergeObject = 0;
+   if(theCombinerTemplate.exists())
+   {
+      templateKwl.addFile(theCombinerTemplate);
+      mosaicObject = PTR_CAST(ossimImageCombiner, 
+                              ossimObjectFactoryRegistry::instance()->createObject(templateKwl));
+   }
+   if (!mosaicObject.valid())
+   {
+      mosaicObject = PTR_CAST(ossimImageCombiner, 
+         ossimObjectFactoryRegistry::instance()->createObject(theCombinerType));
+      if(!mosaicObject.valid())
+      {
+         mosaicObject = PTR_CAST(ossimImageMosaic, ossimObjectFactoryRegistry::instance()->
+            createObject(ossimString("ossimImageMosaic")));
+      }
+   }
+   
+   // Keep this pointer around for special processing if blend mosaic:
+   ossimBlendMosaic* obm = PTR_CAST(ossimBlendMosaic, mosaicObject.get());
+
+   // An orthomosaic implies that all input images are already orthorectified to a common projection
+   // so the input chains do not require a renderer:
+   bool orthoMosaic = (PTR_CAST(ossimOrthoImageMosaic, mosaicObject.get()) != 0);
+
+   // Establish default individual input chain from template, if any:
+   templateKwl.clear();
+   ossimRefPtr<ossimImageChain> default_single_image_chain = 0;
+   if(theChainTemplate.exists())
+   {
+      templateKwl.addFile(theChainTemplate);
+      ossimObject* obj = 0;
+      if(templateKwl.find("type"))
+         obj = ossimObjectFactoryRegistry::instance()->createObject(templateKwl);
+      else if(templateKwl.find("object1.type"))
+         obj = ossimObjectFactoryRegistry::instance()->createObject(templateKwl, "object1.");  
+      default_single_image_chain = PTR_CAST(ossimImageChain, obj);
+   }
+   if(!default_single_image_chain.valid())  // then create a default rendering chain
+   {
+      default_single_image_chain = new ossimImageChain;
+      {
+         // Only need a renderer if an output projection or an explicit GSD was specified.
+         if(!orthoMosaic)
+         {
+            ossimImageRenderer* renderer   = new ossimImageRenderer;
+            if (renderer->getResampler())
+               renderer->getResampler()->setFilterType(theResamplerType);
+            default_single_image_chain->addChild(renderer);
+         }
+      }
+   }
+
+   ossim_uint32 num_inputs = (ossim_uint32)theSrcRecords.size();
+   ossim_uint32 idx;
+   ossimString prefix ("object1.object");
+   theReferenceProj = 0;
+
+   // Loop over each input image file to establish a single image chain that will be added to the
+   // output mosaic:
+   ossimImageSource* current_source = 0;
+   for(idx = 0; idx < num_inputs; ++idx)
+   {
+      // first lets add an input handler to the chain:
+      ossimFilename input  = theSrcRecords[idx].getFilename();
+      ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(input);
+      if(!handler.valid())
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "Could not open input file <" << input << ">. "
+            << "Skipping this entry." << std::endl;
+         continue;
+      }
+
+      // Pass on any reader properties if there are any.
+      ossimPropertyInterface* propInterface = (ossimPropertyInterface*)handler.get();
+      PropertyMap::iterator iter = theReaderProperties.begin();
+      while(iter != theReaderProperties.end())
+      {
+         propInterface->setProperty(iter->first, iter->second);
+         ++iter;
+      }
+
+      // Presently, handler->loadState() is called only on vector data, though in the future we
+      // should stuff many of the members in ossimSrcRecord in a KWL (similar to what is currently
+      // done with vector properties) so that the handler is initialized via loadState() instead of 
+      // individual calls to set methods.  OLK 10/10
+      if (theSrcRecords[idx].isVectorData())
+         handler->loadState(theSrcRecords[idx].getAttributesKwl());
+
+      std::vector<ossim_uint32> entryList;
+      if(theSrcRecords[idx].getEntryIndex() > -1 )
+         entryList.push_back(theSrcRecords[idx].getEntryIndex());
+      else
+         handler->getEntryList(entryList);
+
+      // Input image file may have multiple entries. Loop over each and establish single image
+      // chains for each:
+      ossim_uint32 entryIdx = 0;
+      for(entryIdx = 0; entryIdx < entryList.size(); ++entryIdx)
+      {
+         // Instantiate the chain for one input image source. Copy existing default chain
+         // which may already possess a renderer (so don't do any addFirst()!):
+         ossimImageChain* singleImageChain = (ossimImageChain*) default_single_image_chain->dup();
+
+         // Establish the image handler for this particular frame. This may be just
+         // the handler already opened in the case of single image per file:
+          ossimImageHandler* img_handler = 0;
+         if (entryList.size() == 1)
+            img_handler = handler.get();
+         else
+            img_handler = (ossimImageHandler*)handler->dup();
+
+         // The user can specify an external "support" (a.k.a. supplementary directory) several ways
+         if ( theSupplementaryDirectory.empty() == false )
+         {
+            img_handler->setSupplementaryDirectory( theSupplementaryDirectory );
+         }
+         else if (theSrcRecords[idx].getSupportDir().empty() == false)
+         {
+            img_handler->setSupplementaryDirectory(theSrcRecords[idx].getSupportDir());
+         }
+         else if (theSrcRecords[idx].getOverviewPath().empty() == false)
+         {
+            if (theSrcRecords[idx].getOverviewPath().isDir())
+               img_handler->setSupplementaryDirectory(theSrcRecords[idx].getOverviewPath());
+            else
+               img_handler->setSupplementaryDirectory(theSrcRecords[idx].getOverviewPath().path());
+         }
+         img_handler->setCurrentEntry(entryList[entryIdx]);
+         if ( img_handler->hasOverviews() )
+         {
+            img_handler->openOverview();
+         }
+         if (theSrcRecords[idx].isRgbData() && theSrcRecords[idx].getBands().size() > 0 && 
+            theSrcRecords[idx].getOverviewPath().empty())
+         {
+            img_handler->setOutputBandList(theSrcRecords[idx].getBands());
+         }
+
+         // Image handler is ready to insert on the input side of the chain:
+         singleImageChain->addLast(img_handler);
+         current_source = img_handler;
+
+         // PIXEL_IS_AREA HACK -- Scan the pixel alignment to see if all inputs are "area",
+         // in which case we override the command-line writer property setting. THIS NEEDS TO BE
+         // REMOVED WHEN THE EW GUI PROVIDES FOR THE USER TO SET THIS PROPERTY (OLK 09/11):
+         if (img_handler->getPixelType() == OSSIM_PIXEL_IS_POINT)
+            thePixelAlignment = OSSIM_PIXEL_IS_POINT;
+
+         // This call will check for the presence of a raster mask file alongside the image,
+         // and insert the mask filter in the chain if present:
+         current_source = setupRasterMask(singleImageChain, theSrcRecords[idx]);
+
+         // If this is the first input chain, use it as the reference projection to help with
+         // the instantiation of the product projection (the view):
+         if (!theReferenceProj.valid())
+         {
+            ossimRefPtr<ossimImageGeometry> geom = img_handler->getImageGeometry();
+            if ( geom.valid() ) 
+               theReferenceProj = geom->getProjection();
+         }
+
+         // Insert a partial-pixel flipper to remap null-valued pixels to min.  
+         // This is set via preference keyword "orthoigen.flip_null_pixels"  
+         current_source = setupPixelFlipper(singleImageChain, theSrcRecords[idx]);
+
+         // Install a band selector if needed:
+         if (theSrcRecords[idx].getBands().size() && (img_handler->getNumberOfOutputBands() > 1))
+         {
+            ossim_uint32 bands = img_handler->getNumberOfOutputBands();
+            bool validBand = true;
+            for (ossim_uint32 i = 0; i < theSrcRecords[idx].getBands().size(); ++i)
+            {
+               if (theSrcRecords[idx].getBands()[i] >= bands)
+               {
+                  validBand = false;
+                  ossimNotify(ossimNotifyLevel_FATAL) << " ERROR:" << "\nBand list range error!"
+                     << "\nHighest available band:  " << bands << std::endl;
+               }
+            }
+            if (validBand)
+            {
+               ossimRefPtr<ossimBandSelector> bs = new ossimBandSelector();
+               singleImageChain->insertRight(bs.get(), current_source);
+               bs->setOutputBandList(theSrcRecords[idx].getBands());
+               current_source = bs.get();
+            }
+         }
+
+         // Install a histogram object if needed. This inserts just to the left of the resampler.
+         setupHistogram(singleImageChain, theSrcRecords[idx]);
+
+         // Add a cache just to the left of the resampler.
+         if (!theCacheExcludedFlag)
+            addChainCache(singleImageChain);
+
+         // Add the single image chain to the mosaic and save it to the product spec file:
+         singleImageChain->makeUniqueIds();
+
+         if (theSrcRecords[idx].isRgbData())
+         {
+            if (bandMergeObject == 0)
+            {
+               bandMergeObject = new ossimBandMergeSource();
+            }
+            bandMergeObject->connectMyInputTo(singleImageChain);
+            singleImageChain->changeOwner(bandMergeObject.get());
+         }
+         else
+         {
+            mosaicObject->connectMyInputTo(singleImageChain);
+            singleImageChain->changeOwner(mosaicObject.get());
+         }
+         //theContainer->addChild(singleImageChain);
+
+         // Set the weight for this image when doing a blend mosaic:
+         if (obm)
+            obm->setWeight(idx, theSrcRecords[idx].getWeight());
+      }
+   }
+
+   // Finished initializing the inputs to the mosaic. Add the mosaic to the product chain.
+   theProductChain = new ossimImageChain;
+   if (bandMergeObject != 0)
+   {
+      theProductChain->addFirst(bandMergeObject.get());
+   }
+   theProductChain->addFirst(mosaicObject.get());
+   
+   // Now need to pass the product chain through the histogram setup for possible remapper given 
+   // target histogram (used when histo-matching selected):
+   setupHistogram();
+
+   // When mosaicking common input projections without rendering each, need to add a renderer to the
+   // mosaic for reprojecting to output projection:
+   if(orthoMosaic)
+   {
+      ossimImageRenderer* renderer   = new ossimImageRenderer;
+      renderer->getResampler()->setFilterType(theResamplerType);
+      theProductChain->addFirst(current_source);
+   }
+
+   //---
+   // Now that "theProductChain" is initialized we must initialize elevation if needed as it can
+   // affect the tie point of the output projection.
+   //---
+   if ( isAffectedByElevation() )
+   {
+      ossimInit::instance()->initializeElevation();
+
+      // Chain gsd's affected by elevation so recompute.
+      reComputeChainGsds();
+   }
+
+   // Set up the output product's projection:
+   setupProjection();
+
+   // Annotation setup...
+   setupAnnotation();
+
+   // Output rect cutter:
+   setupCutter();
+
+   // Output radiometry filter:
+   setupOutputRadiometry();
+
+   // After all the connections have been established, add the product chain to the overall 
+   // product container. This container will also hold the writer object.
+   theContainer->addChild(theProductChain.get());
+
+   // Lastly, set up the write object (object2):
+   setupWriter();
+
+}
+
+//*************************************************************************************************
+// Initializes the Cut Rect filter to crop the mosaic to specified rectangle.
+// This method assumes that the view (theProductProjection) has already been propagated to all 
+// the renderers (via call to setView()). This was done by prior call to setupProjection().
+//*************************************************************************************************
+void ossimOrthoIgen::setupCutter()
+{
+   // The command line accepts cut rect specification in several formats. Consolidate them to
+   // a common form (UL tiepoint <theCutOrigin> and distance to LR pixel center <theCutDxDy>. This
+   // method also updates the product projection with new bounds:
+   consolidateCutRectSpec();
+
+   ossimImageSource* input_source = theProductChain->getFirstSource();
+   if((theCutDxDy.hasNans()&&theMaskShpFile.empty())||!theProductProjection.valid()||!input_source)
+      return;
+
+   //user may pass the shape filename with an query (e.g C:/myshp.shp|select * from myshp),
+   //parse the name of mask shape file here
+   ossimString query = "";
+   if (!theMaskShpFile.empty())
+   {
+     if (theMaskShpFile.contains("|"))
+     {
+       ossimString fileName = theMaskShpFile;
+       std::vector<ossimString> fileList = fileName.split("|");
+       if (fileList.size() > 1)
+       {
+         theMaskShpFile = fileList[0];
+         query = fileList[1];
+       }
+     }
+   }
+
+   if (!theMaskShpFile.exists())
+   {
+     if (theCutOriginUnit == OSSIM_METERS)  // projection in meters...
+     {
+       ossimEastingNorthingCutter* cutter = new ossimEastingNorthingCutter;
+       ossimDpt mpp (theProductProjection->getMetersPerPixel());
+       ossimDpt lr (theCutOrigin.x + theCutDxDy.x - mpp.x, theCutOrigin.y - theCutDxDy.y + mpp.y);
+       cutter->setView(theProductProjection.get());
+       cutter->setEastingNorthingRectangle(theCutOrigin, lr);
+       theProductChain->addFirst(cutter);
+     }
+     else // geographic projection, units = decimal degrees.
+     {
+       ossimGeoPolyCutter* cutter = new ossimGeoPolyCutter;
+       std::vector<ossimGpt> polygon;
+
+       ossimDpt dpp (theProductProjection->getDecimalDegreesPerPixel());
+       ossimGpt ul(theCutOrigin.lat,                        theCutOrigin.lon               );
+       ossimGpt ur(theCutOrigin.lat,                        theCutOrigin.lon + theCutDxDy.x - dpp.x);
+       ossimGpt lr(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon + theCutDxDy.x - dpp.x);
+       ossimGpt ll(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon               );
+
+       polygon.push_back(ul);
+       polygon.push_back(ur);
+       polygon.push_back(lr);
+       polygon.push_back(ll);
+
+       cutter->setView(theProductProjection.get());
+       cutter->setNumberOfPolygons(1);
+       cutter->setPolygon(polygon);
+       theProductChain->addFirst(cutter);
+     }
+   }
+   else
+   {
+     ossimIrect inputRect = input_source->getBoundingRect();
+
+     ossimGeoPolyCutter* exteriorCutter = new ossimGeoPolyCutter;
+     exteriorCutter->setView(theProductProjection.get());
+
+     ossimGeoPolyCutter* interiorCutter = NULL;
+
+     ossimRefPtr<ossimImageHandler> shpHandler = ossimImageHandlerRegistry::instance()->open(theMaskShpFile);
+     ossimEsriShapeFileInterface* shpInterface = PTR_CAST(ossimEsriShapeFileInterface, shpHandler.get());
+     if (shpInterface != NULL)
+     {
+       if (!query.empty())
+       {
+         shpInterface->setQuery(query);
+       }
+       std::multimap<long, ossimAnnotationObject*> features = shpInterface->getFeatureTable();
+       if (features.size() > 0)
+       {
+         std::multimap<long, ossimAnnotationObject*>::iterator it = features.begin();
+         while (it != features.end())
+         {
+           ossimAnnotationObject* anno = it->second;
+           if (anno != NULL)
+           {
+             ossimGeoAnnotationPolyObject* annoPoly = PTR_CAST(ossimGeoAnnotationPolyObject, anno);
+             ossimGeoAnnotationMultiPolyObject* annoMultiPoly = NULL;
+             if (annoPoly == NULL)
+             {
+                annoMultiPoly = PTR_CAST(ossimGeoAnnotationMultiPolyObject, anno);
+             }
+             if (annoPoly != NULL)
+             {
+               std::vector<ossimGpt> polygon;
+
+               //get the points of a polygon
+               std::vector<ossimGpt> points = annoPoly->getPoints();
+               for (ossim_uint32 i = 0; i < points.size(); i++)
+               {
+                 polygon.push_back(points[i]);
+               }
+
+               //get polygon type, if it is an internal polygon, initialize the internal cutter
+               ossimGeoAnnotationPolyObject::ossimPolyType polyType = annoPoly->getPolyType();
+               if (polyType == ossimGeoAnnotationPolyObject::OSSIM_POLY_INTERIOR_RING)
+               {
+                 if (interiorCutter == NULL)
+                 {
+                   interiorCutter = new ossimGeoPolyCutter;
+                   interiorCutter->setView(theProductProjection.get());
+                   interiorCutter->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
+                 }
+                 interiorCutter->addPolygon(polygon);
+               }
+               else
+               {
+                 exteriorCutter->addPolygon(polygon);
+               }
+             }
+             else if (annoMultiPoly != NULL)
+             {
+               std::vector<ossimGeoPolygon> multiPolys = annoMultiPoly->getMultiPolygon();
+               for (ossim_uint32 i = 0; i < multiPolys.size(); i++)
+               {
+                 ossimGeoPolygon geoPoly = multiPolys[i];
+                 std::vector<ossimGeoPolygon> holePolys = geoPoly.getHoleList();
+                 if (holePolys.size() > 0)
+                 {
+                   if (interiorCutter == NULL)
+                   {
+                     interiorCutter = new ossimGeoPolyCutter;
+                     interiorCutter->setView(theProductProjection.get());
+                     interiorCutter->setCutType(ossimPolyCutter::OSSIM_POLY_NULL_INSIDE);
+                   }
+                   for (ossim_uint32 j = 0; j < holePolys.size(); j++)
+                   {
+                      interiorCutter->addPolygon(holePolys[j]);
+                   }
+                 }
+                 exteriorCutter->addPolygon(multiPolys[i]);
+               }
+             }
+             else
+             {
+                throw(ossimException(std::string("The geometry type of the mask shape file is not polygon.")));
+             }
+           }
+           it++;
+         }
+       }
+     }
+
+     //if user define the cut box, add it to the image chain
+     ossimGeoPolyCutter* boundCutter = NULL;
+     if (!theCutDxDy.hasNans() && !theCutOrigin.hasNans())
+     {
+       std::vector<ossimGpt> bound;
+       if (theCutOriginUnit == OSSIM_METERS)
+       {
+          ossimDpt mpp (theProductProjection->getMetersPerPixel());
+         ossimGpt ul = theProductProjection->inverse(ossimDpt(theCutOrigin.x, theCutOrigin.y));
+         ossimGpt ur = theProductProjection->inverse(ossimDpt(theCutOrigin.x + theCutDxDy.x - mpp.x, theCutOrigin.y));
+         ossimGpt lr = theProductProjection->inverse(ossimDpt(theCutOrigin.x + theCutDxDy.x - mpp.x, theCutOrigin.y - theCutDxDy.y + mpp.y));
+         ossimGpt ll = theProductProjection->inverse(ossimDpt(theCutOrigin.x, theCutOrigin.y - theCutDxDy.y + mpp.y));
+
+         bound.push_back(ul);
+         bound.push_back(ur);
+         bound.push_back(lr);
+         bound.push_back(ll);
+       }
+       else
+       {
+          ossimDpt dpp (theProductProjection->getDecimalDegreesPerPixel());
+          ossimGpt ul(theCutOrigin.lat,                        theCutOrigin.lon               );
+          ossimGpt ur(theCutOrigin.lat,                        theCutOrigin.lon + theCutDxDy.x - dpp.x);
+          ossimGpt lr(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon + theCutDxDy.x - dpp.x);
+          ossimGpt ll(theCutOrigin.lat - theCutDxDy.y + dpp.y, theCutOrigin.lon               );
+
+         bound.push_back(ul);
+         bound.push_back(ur);
+         bound.push_back(lr);
+         bound.push_back(ll);
+       }
+       boundCutter = new ossimGeoPolyCutter;
+
+       boundCutter->setView(theProductProjection.get());
+       boundCutter->setNumberOfPolygons(1);
+       boundCutter->setPolygon(bound);
+     }
+
+     if (boundCutter == NULL)
+     {
+        ossimIrect shpRect = shpHandler->getBoundingRect();
+        if (shpRect.width() > inputRect.width() && shpRect.height() > inputRect.height())
+        {
+           exteriorCutter->setRectangle(inputRect);
+        }
+     }
+     
+     theProductChain->addFirst(exteriorCutter);
+
+     if (interiorCutter != NULL)
+     {
+       theProductChain->addFirst(interiorCutter);
+     }
+
+     if (boundCutter != NULL)
+     {
+        theProductChain->addFirst(boundCutter);
+     }
+   }
+}
+
+//*************************************************************************************************
+// METHOD 
+//*************************************************************************************************
+void ossimOrthoIgen::setupWriter()
+{
+   if (!theProductChain.valid())
+      return;
+
+   ossimRefPtr<ossimImageFileWriter> writer = 0;
+   
+   if (theWriterType.size())
+   {
+       // User selected writer with -w or --writer option.
+      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(theWriterType);
+   }
+   else if ( theWriterTemplate.size() && theWriterTemplate.exists() )
+   {
+      // User sent us a writer template.
+      ossimKeywordlist kwlTemplate;
+      kwlTemplate.addFile(theWriterTemplate);
+
+      // Try first with no prefix.
+      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwlTemplate);
+      if ( !writer.valid() )
+         writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwlTemplate, "object2.");
+   }
+   else if ( theTilingFilename == "%SRTM%")
+   {
+      ossimKeywordlist kwlWriter;
+      kwlWriter.add("type", "ossimGeneralRasterWriter", true);
+      kwlWriter.add("byte_order", "big_endian");
+      writer = ossimImageWriterFactoryRegistry::instance()->createWriter(kwlWriter);
+      theProductFilename = theProductFilename.path();
+   }
+   else if (!theTilingFilename.empty())
+   {
+      if (theProductFilename.isDir())
+      {
+         theProductFilename = theProductFilename + "/" + theTilingFilename;
+      }
+   }
+
+   try
+   {
+      //---
+      // Set the output file name if not already set.
+      // NOTE: Could be outputing to stdout in which case outputFilename does not
+      // make sense.  Leaving here though to not break code downstream. (drb)
+      //---
+      if ( theProductFilename == ossimFilename::NIL )
+      {
+         throw(ossimException(std::string("Writer output filename not set.")));
+      }
+
+      //---
+      // Final check for writer.
+      //---
+      if ( !writer.valid() )
+      {
+         // Derive writer from the extension.
+         ossimFilename ext = theProductFilename.ext();
+         if ( ext.size() )
+            writer = ossimImageWriterFactoryRegistry::instance()->createWriterFromExtension(ext);
+
+         //---
+         // Lastly default to tiff.  Perhaps throw exception here instead. (drb)
+         //---
+         if( !writer.valid() )
+         {
+            writer = new ossimTiffWriter;
+            theProductFilename.setExtension("tif");
+         }
+      }
+
+      // PIXEL_IS_AREA HACK: Temporary patch to override command line alignment type with source
+      // image's alignment type. TO BE REMOVED ONCE EW GUI PROVIDES FOR USER-SETTING OF THIS 
+      // PROPERTY (OLK 09/11):
+      if (thePixelAlignment == OSSIM_PIXEL_IS_AREA)
+      {
+          ossimString pixelType ("pixel_type");
+          theWriterProperties.erase(pixelType);
+          theWriterProperties.insert(std::make_pair(pixelType, ossimString("area")));
+      }
+
+      //---
+      // Set writer filename, connect and add to writer to keyword list.
+      //---
+      if ( writer.valid() )
+      {
+         writer->setFilename(theProductFilename);
+         writer->connectMyInputTo(0, theProductChain.get());
+
+         ossimPropertyInterface* propInterface = (ossimPropertyInterface*)writer.get();
+         PropertyMap::iterator iter = theWriterProperties.begin();
+         while(iter != theWriterProperties.end())
+         {
+            propInterface->setProperty(iter->first, iter->second);
+            ++iter;
+         }
+         theContainer->addChild(writer.get());
+      }
+      else
+      {
+         throw(ossimException(std::string("Unable to create writer.")));
+      }
+   }
+   catch (const ossimException& e)
+   {
+      if (traceDebug())
+         ossimNotify(ossimNotifyLevel_DEBUG) << e.what() << std::endl;
+      throw; // re-throw exception
+   }
+}
+
+
+//*************************************************************************************************
+// This method establishes the output (view) projection of the product.
+// NOTE: Completely rewritten to simplify and reduce redundancy. OLK 3/10
+//*************************************************************************************************
+void ossimOrthoIgen::setupProjection()
+{
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)<<"Entering ossimOrthoIgen::setupProjection():"<<std::endl;
+   }
+
+   theProductProjection = 0;
+
+   // Throw exception if no valid input image projection was established:
+   if(!theReferenceProj.valid())
+   {
+      std::string errMsg = "ossimOrthoIgen::setupProjection() -- Could not establish input image's "
+         "projection. Cannot setup output view.";
+      throw(ossimException(errMsg));
+   }
+
+   // Fetch the reference input projection first. Settings may be copied to the product projection:
+   ossimMapProjection* ref_map = PTR_CAST(ossimMapProjection, theReferenceProj.get());
+
+   // Now focus on establishing the output product projection.
+   // Consider externally specified geometry first:
+   if (theProjectionType == OSSIM_EXTERNAL_PROJECTION)
+   {
+      if (!theTemplateView.isReadable())
+      {
+         ossimString errMsg = "ossimOrthoIgen::setupProjection() -- Could not read the product "
+            "projection template file at <";
+         errMsg += theTemplateView;
+         errMsg += ">. Cannot establish output projection.";
+         throw(ossimException(errMsg));
+      }
+
+      // Default template format is no prefix, but consider alternate with prefix if first attempt 
+      // fails:
+      ossimKeywordlist templateKwl (theTemplateView);
+      ossimObjectFactoryRegistry* ofr = ossimObjectFactoryRegistry::instance();
+      ossimRefPtr<ossimObject> productObj = ofr->createObject(templateKwl, "product.projection.");
+      if(!productObj.valid())
+         productObj = ofr->createObject(templateKwl);
+      theProductProjection = PTR_CAST(ossimMapProjection, productObj.get());
+   }
+
+   // Geographic? (Assuming WGS 84 for now.)
+   else if (theProjectionType == OSSIM_GEO_PROJECTION)
+   {
+      theProductProjection = new ossimEquDistCylProjection();
+      ossimGpt gpt(0.0, 0.0);
+      if (theGeoScalingLatitude == 999.0) // flags that lat is to be computed
+      {
+        computeGeoScalingLatitude();
+        gpt = ossimGpt(theGeoScalingLatitude, 0.0);
+      }
+      else if (!ossim::isnan(theGeoScalingLatitude))
+        gpt = ossimGpt(theGeoScalingLatitude, 0.0);
+      theProductProjection->setOrigin(gpt);
+   }
+
+   // CRS code specified on the command line
+   else if (theProjectionType == OSSIM_SRS_PROJECTION)
+   {
+      ossimProjection* base_proj = 
+        ossimEpsgProjectionFactory::instance()->createProjection(theCrsString);
+
+      theProductProjection = PTR_CAST(ossimMapProjection, base_proj);
+      if(theProductProjection.valid())
+      {
+         // Reassign the type for geographic. Now we know
+         if (theProductProjection->isGeographic())
+         {
+            theProjectionType = OSSIM_GEO_PROJECTION;
+            ossimGpt gpt(0.0, 0.0);
+            if (!ossim::isnan(theGeoScalingLatitude))
+              gpt = ossimGpt(theGeoScalingLatitude, 0.0);
+            theProductProjection->setOrigin(gpt);
+         }
+      }
+      else
+      {
+         theProjectionType = OSSIM_UNKNOWN_PROJECTION;
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimOrthoIgen::setupProjection() WARNING:" << " Unsupported spatial reference system."
+            << " Will default to the projection from the input image."
+            << std::endl;
+      }
+   }
+
+   // UTM?
+   else if (theProjectionType == OSSIM_UTM_PROJECTION)
+   {
+      ossimUtmProjection* utm = new ossimUtmProjection;
+      ossimGpt refGpt;
+      theReferenceProj->lineSampleToWorld(ossimDpt(0,0), refGpt);
+
+      utm->setZone(refGpt);
+      utm->setHemisphere(refGpt);
+      theProductProjection = utm;
+   }
+
+   // None of the above?
+   else
+   {
+      // Either OSSIM_INPUT_PROJECTION or OSSIM_UNKNOWN_PROJECTION. In both cases
+      // just use the first image's input projection for the output. Need to make 
+      // sure the input_proj is a map projection though:
+      if (ref_map)
+      {
+         theProductProjection = PTR_CAST(ossimMapProjection, ref_map->dup());
+         theProjectionType = OSSIM_INPUT_PROJECTION; // just in case it was unknown before
+      }
+      else
+      {  
+         theProjectionType = OSSIM_GEO_PROJECTION;
+         theProductProjection = new ossimEquDistCylProjection();
+
+         ossimGpt gpt(0.0, 0.0);
+         if (!ossim::isnan(theGeoScalingLatitude))
+            gpt = ossimGpt(theGeoScalingLatitude, 0.0);
+         theProductProjection->setOrigin(gpt);
+      }  
+   }
+
+   // At this point there should be a valid output projection defined:
+   if (!theProductProjection.valid())
+   {
+      std::string errMsg = "ossimOrthoIgen::setupProjection() -- Could not establish valid output "
+         "projection";
+      throw(ossimException(errMsg));
+   }
+
+   // HACK (OLK 06/10): The projection may not have had the PCS code initialized even though it
+   // is an EPSG projection, so take this opportunity to identify a PCS for output:
+   ossim_uint32 pcs_code = theProductProjection->getPcsCode();
+   if (pcs_code == 0)
+   {
+      pcs_code = ossimEpsgProjectionDatabase::instance()->
+         findProjectionCode(*(theProductProjection.get()));
+      theProductProjection->setPcsCode(pcs_code);
+   }
+
+   // Bootstrap the process of establishing the mosaic tiepoint by setting it to the reference proj.
+   if (ref_map)
+      theProductProjection->setUlGpt(ref_map->getUlGpt());
+
+   // cout << "ref_map->getUlGpt(): " << ref_map->getUlGpt() << endl;
+
+   // Base class makes sure the product view projection is properly wired into the chain. 
+   setView();
+
+   // Set the desired image GSD. This is nontrivial due to the many ways GSD can be implied and/or
+   // explicitly provided. This method also does a setView before returning:
+   setProductGsd();
+
+   theProjectionName = theProductProjection->getProjectionName();
+
+   // At this point, the product projection will not have a tiepoint (UL corner coordinates)
+   // defined unless it is the same projection as the input reference. Need to set it now. Note that
+   // if a cut-rect is specified, the tie-point will be modified later in setupCutter()
+   establishMosaicTiePoint();
+
+   if (traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "ossimOrthoIgen::setupProjection DEBUG:"
+         << "Leaving...." << __LINE__
+         << std::endl;
+   }
+}
+
+//*************************************************************************************************
+// METHOD
+//*************************************************************************************************
+void ossimOrthoIgen::setupAnnotation()
+{
+   ossimImageSource* input_source = theProductChain->getFirstSource();
+   if (!input_source)
+      return;
+
+   if(theAnnotationTemplate.exists() == false)
+      return;
+   
+   ossimKeywordlist templateKwl;
+   if (templateKwl.addFile(theAnnotationTemplate) == false)
+      return;
+   
+   ossimRefPtr<ossimObject> obj = ossimObjectFactoryRegistry::instance()->
+      createObject(templateKwl, "object1.");
+   if (obj.valid())
+   {
+      ossimGeoAnnotationSource* oga = PTR_CAST(ossimGeoAnnotationSource, obj.get());
+      if (oga)
+      {
+         if (theProductProjection.valid())
+            oga->setGeometry(new ossimImageGeometry(0, theProductProjection.get())); 
+         theProductChain->addFirst(oga);
+      }
+   }
+   return;
+}
+
+//*************************************************************************************************
+// Set up multi-file tiling if indicated on the command line.
+//*************************************************************************************************
+bool ossimOrthoIgen::setupTiling()
+{
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimOrthoIgen::setupTiling: Entered......" << std::endl;
+   }
+   ossimKeywordlist templateKwl;
+   ossimFilename outputFilename = theProductFilename;
+   theTilingEnabled = false;
+
+   if ((theTilingTemplate == "")||(!templateKwl.addFile(theTilingTemplate)))
+   {
+      if(traceDebug())
+      {
+         ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimOrthoIgen::setupTiling: Leaving......" << __LINE__ << std::endl;
+      }
+      return false;
+   }
+
+   ossimString prefix ("igen.tiling.");
+   while (1)
+   {
+      if(outputFilename.isDir())
+      {
+         if(templateKwl.find(prefix.chars(), "type"))
+         {
+            theTilingFilename = templateKwl.find(prefix.chars(),"tile_name_mask");
+            theTilingEnabled = true;
+            break;
+         }
+         else if (templateKwl.find(prefix.chars(), "tile_size") || templateKwl.find(prefix.chars(), "tile_source"))
+         {
+            theTilingFilename = templateKwl.find(prefix.chars(),"output_file_name");
+            theTilingEnabled = true;
+            break;
+         }
+      }
+      else
+      {
+         theTilingFilename = outputFilename.file();
+         if (!theTilingFilename.contains("%"))
+         {
+            ossimString fileNoExt = theTilingFilename.fileNoExtension();
+            ossimString ext = theTilingFilename.ext();
+            theTilingFilename = fileNoExt + "_%r%_%c%." + ext;
+         }
+         if(templateKwl.find(prefix.chars(), "type"))
+         {
+            templateKwl.add(prefix.chars(), "tile_name_mask", theTilingFilename.c_str(), true);
+            ossimFilename path (outputFilename.path());
+            theProductFilename = path;
+            theTilingEnabled = true;
+            break;
+         }
+         else if (templateKwl.find(prefix.chars(), "tile_size") || templateKwl.find(prefix.chars(), "tile_source"))
+         {
+            templateKwl.add(prefix.chars(), "output_file_name", theTilingFilename.c_str(), true);
+            ossimFilename path (outputFilename.path());
+            theProductFilename = path;
+            theTilingEnabled = true;
+            break;
+         }
+      }
+
+      // If we got here, then no matches were found in the template. Try again but without a prefix:
+      if (prefix.empty())
+         break;
+      prefix.clear();
+   }
+
+   // Initialize the tiling object if enabled:
+   if (templateKwl.find(prefix.chars(), "tile_size"))
+   {
+      theTiling = 0;
+      theTiling = new ossimTilingRect;
+   }
+
+   if (templateKwl.find(prefix.chars(), "tile_source"))
+   {
+      theTiling = 0;
+      theTiling = new ossimTilingPoly;
+   }
+
+   if (theTilingEnabled && !theTiling->loadState(templateKwl, prefix))
+      theTilingEnabled = false;
+
+   if(traceDebug())
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG) << "ossimOrthoIgen::setupTiling: templateKwl = \n" << templateKwl << std::endl;
+      ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimOrthoIgen::setupTiling: Leaving......" << __LINE__ << std::endl;
+   }
+   
+   return true;
+}
+
+//*************************************************************************************************
+// Consolidates specification of bounding rect given various ways of specifying on the command
+// line. This avoids multiple, redundant checks scattered throughout the code. On exit:
+// 
+//   1. theCutOriginType is converted to OSSIM_UPPER_LEFT_ORIGIN
+//   2. theCutOrigin is converted to the proper coordinates (lat/lon or easting/northing) and
+//      associated theCutOriginUnits is assigned accordingly.
+//   3. theCutDxDy reflects the full size of the rect, in the units corresponding to the projection
+//      and associated theCutDxDyUnit is set to METERS for UTM, DEGREES for geographic
+//   4. The product projection's origin (image center) and tie point are updated to reflect the
+//      output rectangle.
+//
+//*************************************************************************************************
+void ossimOrthoIgen::consolidateCutRectSpec()
+{
+   if (!theProductProjection.valid() || theCutDxDy.hasNans() || theCutOrigin.hasNans())
+      return; 
+
+   if ((theCutDxDyUnit != OSSIM_METERS) && 
+       (theCutDxDyUnit != OSSIM_DEGREES) &&
+       (theCutDxDyUnit != OSSIM_UNIT_UNKNOWN))
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << "ossimOrthoIgen::consolidateCutRectSpec: An unhandled"
+         " type of units was encountered. The cut rect needs to be specified in either meters or"
+         " degrees. The resulting cut rect and origin may be incorrect." << std::endl;
+      return;
+   }
+
+   ossimGpt originPLH;
+   ossimDpt resolution;
+
+   // Geographic Projection (lat/lon cut rect) requested?
+   if(theProductProjection->isGeographic()) 
+   {
+      // geographic projection; units need to be decimal degrees. First check for consistent origin:
+      if (theCutOriginUnit == OSSIM_METERS)
+      {
+         originPLH = theProductProjection->inverse(theCutOrigin);
+         theCutOrigin.x = originPLH.lon;
+         theCutOrigin.y = originPLH.lat;
+      }
+      else
+      {
+         originPLH.lat = theCutOrigin.y;
+         originPLH.lon = theCutOrigin.x;
+      }
+
+      // Check for consistent rect size:
+      if (theCutDxDyUnit == OSSIM_METERS)
+      {
+         ossimDpt mtrs_per_deg (originPLH.metersPerDegree());
+         theCutDxDy.x = theCutDxDy.x/mtrs_per_deg.x;
+         theCutDxDy.y = theCutDxDy.y/mtrs_per_deg.y;
+      }
+
+      // Set these to the correct units. May already be correct, but just in case...
+      theCutOriginUnit = OSSIM_DEGREES; 
+      theCutDxDyUnit = OSSIM_DEGREES; 
+
+      if (theClipToValidRectFlag)
+      {
+         // Now we need to clip the cut rect by the valid image footprint for the entire mosaic:
+         ossimDrect boundingRect = theProductChain->getBoundingRect(); // in view coordinates
+
+         // The bounding rect is in image space. Since pixel-is-point, the actual valid area on the
+         // ground will extend 1/2 pixel beyond the centers, so grow the bounding rect by 1/2 p:
+         boundingRect.expand(ossimDpt(0.5, 0.5));
+         ossimGpt mosaic_ul, mosaic_lr;
+         theProductProjection->lineSampleHeightToWorld(boundingRect.ul(), 0, mosaic_ul);
+         theProductProjection->lineSampleHeightToWorld(boundingRect.lr(), 0, mosaic_lr);
+
+         // Establish the LR bound defined by the cut-rect and clip the cut-rect if necessary:
+         ossimGpt cutrect_lr (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon + theCutDxDy.lon);
+         if (mosaic_ul.lat < theCutOrigin.lat)
+            theCutOrigin.lat = mosaic_ul.lat;
+         if (mosaic_lr.lat > cutrect_lr.lat)
+            theCutDxDy.lat = theCutOrigin.lat - mosaic_lr.lat;
+         if (mosaic_ul.lon > theCutOrigin.lon)
+            theCutOrigin.lon = mosaic_ul.lon;
+         if (mosaic_lr.lon < cutrect_lr.lon)
+            theCutDxDy.lon = mosaic_lr.lon - theCutOrigin.lon;
+      }
+
+      resolution = theProductProjection->getDecimalDegreesPerPixel();
+   }
+
+   // Map Projection (easting, northing cut rect) requested?
+   else 
+   {
+      // Special case code to account for origin and delta being specified in geographic, leading to
+      // offset error due to northing difference between UL and UR corners at constant lat:
+      if ((theCutOriginType == OSSIM_UPPER_LEFT_ORIGIN) &&
+          (theCutOriginUnit == OSSIM_DEGREES) && (theCutDxDyUnit == OSSIM_DEGREES))
+      {
+         ossimGpt ulgp (theCutOrigin.lat                 , theCutOrigin.lon                 , 0);
+         ossimGpt urgp (theCutOrigin.lat                 , theCutOrigin.lon + theCutDxDy.lon, 0);
+         ossimGpt llgp (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon                 , 0);
+         ossimGpt lrgp (theCutOrigin.lat - theCutDxDy.lat, theCutOrigin.lon + theCutDxDy.lon, 0);
+
+         ossimDpt ulen (theProductProjection->forward(ulgp));
+         ossimDpt uren (theProductProjection->forward(urgp));
+         ossimDpt llen (theProductProjection->forward(llgp));
+         ossimDpt lren (theProductProjection->forward(lrgp));
+         
+         double n_top    = (ulen.y > uren.y ? ulen.y : uren.y);
+         double n_bottom = (llen.y < lren.y ? llen.y : lren.y);
+         double e_left   = (ulen.x < llen.x ? ulen.x : llen.x);
+         double e_right  = (uren.x > lren.x ? uren.x : lren.x);
+
+         theCutOrigin.x = e_left;
+         theCutOrigin.y = n_top;
+
+         theCutDxDy.x = e_right - e_left;
+         theCutDxDy.y = n_top - n_bottom;
+
+         if (theClipToValidRectFlag)
+         {
+            // Now we need to clip the cut rect by the valid image footprint for the entire mosaic:
+            ossimDrect boundingRect = theProductChain->getBoundingRect(); // in view coordinates
+            boundingRect.expand(ossimDpt(0.5, 0.5));
+            ossimDpt mosaic_ul, mosaic_lr;
+            theProductProjection->lineSampleToEastingNorthing(boundingRect.ul(), mosaic_ul);
+            theProductProjection->lineSampleToEastingNorthing(boundingRect.lr(), mosaic_lr);
+
+            // Establish the LR bound defined by the cut-rect and clip the cut-rect if necessary:
+            ossimDpt cutrect_lr (theCutOrigin.x + theCutDxDy.x, theCutOrigin.y - theCutDxDy.y);
+            if (mosaic_ul.y < theCutOrigin.y)
+               theCutOrigin.y = mosaic_ul.y;
+            if (mosaic_lr.y > cutrect_lr.y)
+               theCutDxDy.y = theCutOrigin.y - mosaic_lr.y;
+            if (mosaic_ul.x > theCutOrigin.x)
+               theCutOrigin.x = mosaic_ul.x;
+            if (mosaic_lr.x < cutrect_lr.x)
+               theCutDxDy.x = mosaic_lr.x - theCutOrigin.x;
+         }
+      }
+      else
+      {
+         // Just map the geographic coordinates to easting/northing, without regard to corner
+         // mismatch:
+         if (theCutOriginUnit == OSSIM_DEGREES)
+         {
+            originPLH.lat = theCutOrigin.y;
+            originPLH.lon = theCutOrigin.x;
+            theCutOrigin = theProductProjection->forward(originPLH);
+         }
+         else
+         {
+            // Determine the geographic position that might be needed for scaling below:
+            originPLH = theProductProjection->inverse(theCutOrigin);
+         }
+
+         // Check for consistent rect size:
+         if (theCutDxDyUnit == OSSIM_DEGREES)
+         {
+            // POTENTIAL BUG: conversion from degrees longitude to meters should be a function 
+            //                of latitude here. Implemented here but needs testing:
+            ossimDpt mtrs_per_deg (originPLH.metersPerDegree());
+            theCutDxDy.x = theCutDxDy.x * mtrs_per_deg.x;
+            theCutDxDy.y = theCutDxDy.y * mtrs_per_deg.y;
+         }
+      }
+
+      // Set these to the correct units. May already be correct, but just in case...
+      theCutOriginUnit = OSSIM_METERS; 
+      theCutDxDyUnit = OSSIM_METERS; 
+
+      resolution = theProductProjection->getMetersPerPixel();
+   }
+
+   // The cut rect corresponds to the edges of the pixel ("edge-to-edge"), while OSSIM considers
+   // coordinates to correspond to the pixel centers. Need to shift the origin to the SE by 1/2p:
+   ossimDpt half_pixel = resolution * 0.5;
+   theCutOrigin.y -= half_pixel.y;
+   theCutOrigin.x += half_pixel.x;
+
+   // The size of the cutrect needs to be an integral number of pixels in output space:
+   theCutDxDy.x = (floor(theCutDxDy.x/resolution.x + 0.5))* resolution.x;
+   theCutDxDy.y = (floor(theCutDxDy.y/resolution.y + 0.5))* resolution.y;
+
+   // Adjust a center origin specification to be Upper Left corner:
+   if (theCutOriginType == OSSIM_CENTER_ORIGIN)
+   {
+      theCutOrigin.y += theCutDxDy.y;
+      theCutOrigin.x -= theCutDxDy.x;
+
+      // theCutDxDy in this case represented a radius. This needs to be converted to 
+      // OSSIM_UPPER_LEFT_ORIGIN form:
+      theCutDxDy.x *= 2.0;
+      theCutDxDy.y *= 2.0;
+      theCutOriginType = OSSIM_UPPER_LEFT_ORIGIN;
+   }
+
+   // Finally, update the product projection with new rectangle:
+   ossimDpt cutCenter (theCutOrigin.x + theCutDxDy.x/2.0, theCutOrigin.y - theCutDxDy.y/2.0);
+   ossimGpt gpt;
+   if (theCutDxDyUnit == OSSIM_METERS)
+   {
+      // Set the E/N values for the cut origin as the tie point:
+      theProductProjection->setUlTiePoints(theCutOrigin);
+   }
+   else
+   {
+      // Set the projection center (origin) latitude at the center of the cut rect:
+      gpt.lat = cutCenter.y;
+      gpt.lon = 0.0;
+      theProductProjection->setOrigin(gpt);
+
+      // Set the lat/lon values for the cut origin as the tie point:
+      gpt.lat = theCutOrigin.y;
+      gpt.lon = theCutOrigin.x;
+      theProductProjection->setUlTiePoints(gpt);
+   }
+
+   // cout << "\n**************** proj 2:\n";
+   // theProductProjection->print(cout);
+
+   // Propagates changes to the projection to the processing chain:
+   setView();
+}
+
+//*************************************************************************************************
+//! Sets up the histogram operation requested for the image chain passed in.
+//*************************************************************************************************
+void ossimOrthoIgen::setupHistogram(ossimImageChain* input_chain, const ossimSrcRecord& src_record)
+{
+   // Check if the source passed in is the output mosaic object, because the target
+   // histogram remapper needs to be connected to it (only valid when histo matching is requested):
+   if (input_chain == NULL)
+   {
+      if (!theTargetHistoFileName.isReadable())
+         return;
+
+      ossimHistogramRemapper* remapper = new ossimHistogramRemapper;
+      remapper->openHistogram(theTargetHistoFileName);
+      theProductChain->addFirst(remapper);
+      return;
+   }
+
+   // Check if any histo operation was requested on individual image:
+   if ((ossim::isnan(theHighPercentClip) || ossim::isnan(theLowPercentClip)) &&
+      !theUseAutoMinMaxFlag && (theStdDevClip < 0) && src_record.getHistogramOp().empty() &&
+      theTargetHistoFileName.empty())
+   {
+      return; // no histo op requested
+   }
+
+   // Remaining operations require a histogram on the input image source:
+   ossimImageHandler* handler = PTR_CAST(ossimImageHandler, input_chain->getLastSource());
+   if (handler == NULL)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)<<"Could not locate an image handler object in the image"
+         << "chain provided. This should not happen. Ignoring histogram request." << std::endl;
+      return;
+   }
+
+   // Establish the ideal filename for this histogram. The following do-block is all for testing
+   // different histogram file naming schemes since alternate directory and entry-indexing might be
+   // used:
+   ossimFilename histoFilename (src_record.getHistogramPath());
+   ossimFilename candidateHistoFilename;
+   ossimFilename defaultHistoFilename (handler->createDefaultHistogramFilename());
+   ossimFilename entryName (handler->getFilenameWithThisExtension(ossimString(".his"), true));
+
+   do
+   {
+      if (!histoFilename.empty())
+      {
+         // Try histogram filename based on specified name in the .src file:
+         if (histoFilename.isDir())
+            histoFilename = histoFilename.dirCat(defaultHistoFilename.file());
+         if (histoFilename.exists()) break;
+
+         // Try specified name with entry index:
+         if (src_record.getEntryIndex() >= 0)
+         {
+            histoFilename = histoFilename.path().dirCat(entryName.file());
+            if (histoFilename.exists()) break;
+         }
+
+         // Not found so set the candidate filename in case we need to generate it:
+         candidateHistoFilename = histoFilename;
+      }
+
+      // Next try looking for a histogram based on the default name:
+      histoFilename = defaultHistoFilename;
+      if (histoFilename.exists())  break;
+
+      //---
+      // Last possibility is the default name with entry index.  We will test
+      // even if there is only one entry, like "file_e0.his".
+      //---
+      histoFilename = entryName;
+      if (histoFilename.exists())  break;
+
+      // If not already set, set the candidate filename in case we need to generate it:
+      if (candidateHistoFilename.empty())
+         candidateHistoFilename = histoFilename;
+   }
+   while (false); // only pass through once
+
+
+   // If the histogram was still not located, look into creating one:
+   if (!histoFilename.exists())
+   {
+      // Check the preferences for histogram autogeneration:
+      ossimString lookup = ossimPreferences::instance()->findPreference(AUTOGENERATE_HISTOGRAM_KW);
+      if (lookup.toBool())
+      {
+         // No histogram available for this image, need to create one:
+         histoFilename = candidateHistoFilename;
+         ossimNotify(ossimNotifyLevel_WARN) <<"Histogram file <" <<  histoFilename
+            << "> not found. Creating one now..."  << std::endl;
+         bool success = createHistogram(input_chain, histoFilename);
+         if (!success)
+         {
+            ossimNotify(ossimNotifyLevel_WARN) <<"Error encountered creating histogram file <" 
+               << histoFilename << ">. Ignoring histogram request."  << std::endl;
+            return;
+         }
+      }
+   }
+
+   // Need to insert any histogram object to the left of the renderer in the chain. Search for a 
+   // renderer and save for later:
+   // ossimConnectableObject* renderer = PTR_CAST(ossimConnectableObject,
+   //    input_chain->findFirstObjectOfType(ossimString("ossimImageRenderer")));
+
+   ossimTypeNameVisitor visitor( ossimString("ossimImageRenderer"),
+                                 true, // firstofTypeFlag
+                                 (ossimVisitor::VISIT_INPUTS|
+                                  ossimVisitor::VISIT_CHILDREN) );
+   input_chain->accept( visitor );
+   ossimRefPtr<ossimImageRenderer> renderer = visitor.getObjectAs<ossimImageRenderer>(0);
+
+   // Histo Match?
+   if (theTargetHistoFileName.isReadable())
+   {
+      // A histogram match was requested. This involves applying a histo equalization to the input
+      // chain and then applying an inverted equalization using the target histogram:
+      ossimRefPtr<ossimHistogramEqualization> forwardEq = new ossimHistogramEqualization;
+      ossimRefPtr<ossimHistogramEqualization> inverseEq = new ossimHistogramEqualization;
+      
+      // Init equalizers with the source and target histogram files:
+      forwardEq->setInverseFlag(false);
+      forwardEq->setHistogram(histoFilename);
+      inverseEq->setInverseFlag(true);
+      inverseEq->setHistogram(theTargetHistoFileName);
+
+      // Need check that source and target histograms are compatible:
+      ossimRefPtr<ossimMultiResLevelHistogram> sourceHisto = forwardEq->getHistogram();
+      ossimRefPtr<ossimMultiResLevelHistogram> targetHisto = inverseEq->getHistogram();
+      bool are_incompatible = false;
+      if (!sourceHisto.valid() || !targetHisto.valid())
+      {
+         are_incompatible = true;
+      }
+      else
+      {
+         ossim_uint32 num_source_bands = sourceHisto->getNumberOfBands();
+         if (num_source_bands != targetHisto->getNumberOfBands())
+         {
+            are_incompatible = true;
+         }
+         else
+         {
+            for (ossim_uint32 band=0; band<num_source_bands; band++)
+            {
+               ossimRefPtr<ossimHistogram> sourceBandHisto = sourceHisto->getHistogram(band);
+               ossimRefPtr<ossimHistogram> targetBandHisto = targetHisto->getHistogram(band);
+               if (!sourceBandHisto.valid() || !targetBandHisto.valid() ||
+                   (sourceBandHisto->GetRes() != targetBandHisto->GetRes()))
+               {
+                  are_incompatible = true;
+                  break;
+               }
+            }
+         }
+      }
+      if (are_incompatible)
+      {
+         // Error was encountered establishing histograms for match operation:
+         ossimNotify(ossimNotifyLevel_WARN)<<"Error encountered setting up histogram match "
+            "operation. Check that source and target histograms are compatible. No histogram "
+            "operations will be performed on this image." << std::endl;
+         return;
+      }
+
+      // The source and target histos are compatible, insert to the left of renderer if one exists:
+      if ( renderer.valid() )
+         input_chain->insertLeft( forwardEq.get(), renderer.get() );
+      else
+         input_chain->addFirst(forwardEq.get());
+      input_chain->insertRight(inverseEq.get(), forwardEq.get());
+      
+      return;
+   }
+
+   // Remaining possibilities (clip or stretch) require a remapper.
+   // Insert to the left of renderer if one exists:
+   ossimRefPtr<ossimHistogramRemapper> remapper = new ossimHistogramRemapper;
+   if ( renderer.valid() )
+      input_chain->insertLeft( remapper.get(), renderer.get() );
+   else
+      input_chain->addFirst(remapper.get());
+
+   // Fetch the input histogram:
+   bool histo_read_ok = remapper->openHistogram(histoFilename);
+   if (!histo_read_ok)
+   {
+      // No histogram available for this image, need to create one (TODO):
+      ossimNotify(ossimNotifyLevel_WARN)<<"Error encountered loading histogram file <" 
+         << histoFilename << ">. No histogram operations will be performed on this image." 
+         << std::endl;
+      return;
+   }
+
+   // Set values to construct remap table:
+   if (!ossim::isnan(theHighPercentClip) && !ossim::isnan(theLowPercentClip))
+   {
+      // Hi/Lo clip requested
+      remapper->setHighNormalizedClipPoint(1.0-theHighPercentClip);
+      remapper->setLowNormalizedClipPoint(theLowPercentClip);
+   }
+
+   else
+   {
+      // Consider histogram stretch operations. These can be on a per-image basis or global for all
+      // input images. Give priority to the img_histo_op (per-image spec) over general flags below:
+      ossimHistogramRemapper::StretchMode mode = ossimHistogramRemapper::STRETCH_UNKNOWN;
+      ossimString img_histo_op (src_record.getHistogramOp());
+      if (img_histo_op=="auto-minmax")
+         mode = ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX;
+      else if (img_histo_op.contains("std-stretch"))
+      {
+         if (img_histo_op.contains("1"))
+            mode = ossimHistogramRemapper::LINEAR_1STD_FROM_MEAN;
+         else if (img_histo_op.contains("2"))
+            mode = ossimHistogramRemapper::LINEAR_2STD_FROM_MEAN;
+         else if (img_histo_op.contains("3"))
+            mode = ossimHistogramRemapper::LINEAR_3STD_FROM_MEAN;
+      }
+      else if (theUseAutoMinMaxFlag)
+         mode = ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX;
+      else if (theStdDevClip > 0)
+         mode = (ossimHistogramRemapper::StretchMode) theStdDevClip;
+
+      // Finally init the remapper with proper stretch mode:
+      if (mode != ossimHistogramRemapper::STRETCH_UNKNOWN)
+         remapper->setStretchMode(mode, true);
+   }
+   
+   return;
+}
+
+
+//*************************************************************************************************
+//! Utility method for creating a histogram for an input image. Returns TRUE if successful.
+//*************************************************************************************************
+bool ossimOrthoIgen::createHistogram(ossimImageChain* chain, const ossimFilename& histo_filename)
+{
+   ossimRefPtr<ossimImageHistogramSource> histoSource = new ossimImageHistogramSource;
+   ossimRefPtr<ossimHistogramWriter> writer = new ossimHistogramWriter;
+
+   histoSource->connectMyInputTo(chain);
+   histoSource->enableSource();
+   histoSource->setComputationMode(OSSIM_HISTO_MODE_FAST);
+
+   writer->connectMyInputTo(histoSource.get());
+   writer->setFilename(histo_filename);
+   writer->addListener(&theStdOutProgress);
+   bool success = writer->execute();
+
+   writer=0;
+   histoSource=0;
+
+   if (success)
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)<<std::endl;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"Error encountered creating Histogram file <" 
+         << histo_filename << ">. No histogram operations will be performed on this image." 
+         << std::endl;
+   }
+
+   return success;
+}
+
+//*************************************************************************************************
+// METHOD
+//*************************************************************************************************
+void ossimOrthoIgen::addChainCache(ossimImageChain* chain) const
+{
+   if (chain)
+   {
+      //ossimConnectableObject* renderer =
+      //   PTR_CAST(ossimConnectableObject,
+      //             chain->findFirstObjectOfType(ossimString("ossimImageRenderer")));
+
+      ossimTypeNameVisitor visitor( ossimString("ossimImageRenderer"),
+                                    true, // firstofTypeFlag
+                                    (ossimVisitor::VISIT_INPUTS|
+                                     ossimVisitor::VISIT_CHILDREN) );
+      chain->accept( visitor );
+      ossimRefPtr<ossimImageRenderer> renderer = visitor.getObjectAs<ossimImageRenderer>(0);
+      if ( renderer.valid() )
+      {
+         ossimCacheTileSource* cache = new ossimCacheTileSource();
+         chain->insertLeft( cache, renderer.get() );
+      }
+   }
+}
+
+//*************************************************************************************************
+// Generates a log KWL file that could be fed directly to Igen. Used for verifying chain.
+//*************************************************************************************************
+void ossimOrthoIgen::generateLog()
+{
+   if (!theSrcRecords.size() || !theProductChain.valid() || theProductFilename.empty())
+      return;
+
+   // Establish output filename:
+   ossimFilename logFile = theProductFilename;
+   logFile.setExtension("log");
+
+   // Fill a KWL with all info:
+   ossimKeywordlist kwl; 
+   theContainer->saveState(kwl);
+
+   if (theProductProjection.valid())
+      theProductProjection->saveState(kwl, "product.projection.");
+
+   kwl.write(logFile.chars());
+}
+
+//*************************************************************************************************
+//! Determines the UL corner tiepoint of the product projection as the overall UL corner of the
+//! mosaic. This may not be the final tiepoint, since a cut origin may have been specified, and the
+//*************************************************************************************************
+void ossimOrthoIgen::establishMosaicTiePoint()
+{
+   if (!theProductChain.valid())
+      return;
+
+   // Need to find all image handlers to query for their UL ground point:
+#if 0
+   ossimConnectableObject::ConnectableObjectList clientList;
+   theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler), true, true);
+
+   if (clientList.size() == 0)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::establishMosaicTiePoint() WARNING -- "
+         "Expected to find image handler in the chain but none was identified."<<std::endl;
+      return;
+   }
+#endif
+
+   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
+                                 false, // firstofTypeFlag
+                                 (ossimVisitor::VISIT_INPUTS|
+                                  ossimVisitor::VISIT_CHILDREN) );
+   theProductChain->accept( visitor );
+
+   if ( visitor.getObjects().empty() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::establishMosaicTiePoint() WARNING -- "
+         "Expected to find image handler in the chain but none was identified."<<std::endl;
+      return;
+   }
+
+   ossimGpt tie_gpt_i, tie_gpt;
+   ossimDpt tie_dpt_i, tie_dpt;
+   tie_gpt.makeNan();
+   tie_gpt.height(0.0);
+   tie_dpt.makeNan();
+
+   // Loop over all input handlers and latch the most NW tiepoint as the mosaic TP:
+   //   ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
+   // while (iter != clientList.end())
+   for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
+   {
+      // ossimImageHandler* handler = PTR_CAST(ossimImageHandler, (*iter).get());
+      // iter++;
+
+      ossimImageHandler* handler = visitor.getObjectAs<ossimImageHandler>( i );
+      if (!handler) break;
+
+      ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+      if (!geom.valid()) 
+         continue; // Skip over any non geometry inputs (e.g., masks)
+
+      if ( theProductProjection->isGeographic() )
+      {
+         geom->getTiePoint( tie_gpt_i, true ); // True to get edge of tie.
+         if ( tie_gpt_i.hasNans() == false )
+         {
+            if (tie_gpt.hasNans())
+               tie_gpt = tie_gpt_i;
+            else
+            {
+               if (tie_gpt_i.lat > tie_gpt.lat) 
+                  tie_gpt.lat = tie_gpt_i.lat;
+               if (tie_gpt_i.lon < tie_gpt.lon) 
+                  tie_gpt.lon = tie_gpt_i.lon;
+            }
+         }
+      }
+      else
+      {
+         geom->getTiePoint( tie_dpt_i, true ); // True to get edge of tie.
+         if ( tie_dpt_i.hasNans() == false )
+         {
+            if (tie_dpt.hasNans())
+               tie_dpt = tie_dpt_i;
+            else
+            {
+               if (tie_dpt_i.y > tie_dpt.y) 
+                  tie_dpt.y = tie_dpt_i.y;
+               if (tie_dpt_i.x < tie_dpt.x) 
+                  tie_dpt.x = tie_dpt_i.x;
+            }
+         }
+      }
+   }
+   
+#if 0
+      // Establish input image bounding rect, making sure to expand to include the FULL pixel since
+      // pixel is point -- i.e. the pixel coordinate corresponds to the center of the pixel area, 
+      // not the edge. Therefore shift the image point by 1/2 pixel to correspond to edges:
+      // (OLK 09/11)
+      ossimDrect boundingRect (handler->getBoundingRect());
+      vector<ossimDpt> img_vertices;
+      img_vertices.push_back(boundingRect.ul() + ossimDpt(-0.5, -0.5));
+      img_vertices.push_back(boundingRect.ur() + ossimDpt( 0.5, -0.5));
+      img_vertices.push_back(boundingRect.lr() + ossimDpt( 0.5,  0.5));
+      img_vertices.push_back(boundingRect.ll() + ossimDpt(-0.5,  0.5));
+      
+
+      // The tie point will be in easting/northing or lat/lon depending on the type of projection 
+      // used for the product. Need to consider all image corners since the orientation of the image
+      // is not known:
+      for (int j=0; j<4; j++)
+      {
+         geom->localToWorld(img_vertices[j], tie_gpt_i);
+         if (theProductProjection->isGeographic())
+         {
+            tie_gpt.height(0.0);
+            if (tie_gpt.hasNans())
+               tie_gpt = tie_gpt_i;
+            else
+            {
+               if (tie_gpt_i.lat > tie_gpt.lat) 
+                  tie_gpt.lat = tie_gpt_i.lat;
+               if (tie_gpt_i.lon < tie_gpt.lon) 
+                  tie_gpt.lon = tie_gpt_i.lon;
+            }
+         }
+         else
+         {
+            tie_dpt_i = theProductProjection->forward(tie_gpt_i);
+            if (tie_dpt.hasNans())
+               tie_dpt = tie_dpt_i;
+            else
+            {
+               if (tie_dpt_i.y > tie_dpt.y) 
+                  tie_dpt.y = tie_dpt_i.y;
+               if (tie_dpt_i.x < tie_dpt.x) 
+                  tie_dpt.x = tie_dpt_i.x;
+            }
+         }
+      }
+   }
+
+#endif
+
+   // The tie point coordinates currently reflect the UL edge of the UL pixel. We'll need to shift
+   // the tie point from the edge to the center. (OLK 09/11)
+   ossimDpt half_pixel_shift(0,0);
+   if (theProductProjection->isGeographic())
+   {
+      half_pixel_shift = theProductProjection->getDecimalDegreesPerPixel() * 0.5;
+      if (!tie_gpt.hasNans())
+      {
+         tie_gpt.lat -= half_pixel_shift.lat;
+         tie_gpt.lon += half_pixel_shift.lon;
+         theProductProjection->setUlTiePoints(tie_gpt);
+      }
+   }
+   else
+   {
+      half_pixel_shift = theProductProjection->getMetersPerPixel() * 0.5;
+      tie_dpt.y -= half_pixel_shift.y;
+      tie_dpt.x += half_pixel_shift.x;
+      theProductProjection->setUlTiePoints(tie_dpt);
+   }
+
+   // Propagates changes to the projection to the processing chain:
+   setView();
+}
+
+//*************************************************************************************************
+//! Computes the center latitude of the mosaic for use as the geographic scaling latitude
+//*************************************************************************************************
+void ossimOrthoIgen::computeGeoScalingLatitude()
+{
+   if (!theProductChain.valid())
+      return;
+
+   // Need to find all image handlers to query for their UL ground point:
+   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
+                                 false, // firstofTypeFlag
+                                 (ossimVisitor::VISIT_INPUTS|
+                                  ossimVisitor::VISIT_CHILDREN) );
+   theProductChain->accept( visitor );
+   if ( visitor.getObjects().empty() )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::establishMosaicTiePoint() WARNING -- "
+         "Expected to find image handler in the chain but none was identified."<<std::endl;
+      return;
+   }
+
+   ossimGpt ul_i, ur_i, lr_i, ll_i;
+   ossimGrect bbox;
+   bbox.makeNan();
+
+   // Loop over all input handlers and latch the extremes of the corner points:
+   for (ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i)
+   {
+      ossimImageHandler* handler = visitor.getObjectAs<ossimImageHandler>(i);
+      if (!handler)
+         break;
+
+      ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+      if (!geom.valid())
+         continue; // Skip over any non geometry inputs (e.g., masks)
+
+      geom->getCornerGpts(ul_i, ur_i, lr_i, ll_i);
+      ossimGrect bbox_i(ul_i, ur_i, lr_i, ll_i);
+      bbox = bbox.combine(bbox_i);
+   }
+
+   // Fetch midpoint and assign scaling latitude:
+   ossimGpt midPoint (bbox.midPoint());
+   if (!midPoint.isLatNan())
+      theGeoScalingLatitude = midPoint.lat;
+   else
+      theGeoScalingLatitude = 0.0;
+}
+
+//*************************************************************************************************
+// Initialize the pixel flipper in the source chain if one is called for
+//*************************************************************************************************
+ossimImageSource* ossimOrthoIgen::setupPixelFlipper(ossimImageChain* singleImageChain,
+                                                    const ossimSrcRecord& src_record)
+{
+   if (singleImageChain == NULL)
+      return NULL;
+
+   // Fetch the image handler that should be the last (left-most) source in the chain:
+   ossimImageSource* current_source = singleImageChain->getLastSource();
+   if (current_source == NULL)
+      return NULL;
+
+   // There are two possibilities for specifying pixel flipping -- either as a command line option
+   // that applies to all input imagery, or specified for a particular input via the .src file.
+   // The .src file takes precedence:
+   const ossimSrcRecord::PixelFlipParams& flipParams = src_record.getPixelFlipParams();
+
+   // The replacement can be specified globally in the preferences if none found in the src record:  
+   ossimString replaceModeStr = flipParams.replacementMode;
+   if (replaceModeStr.empty())
+      replaceModeStr = thePixelReplacementMode; 
+   
+   // First consider if a range of clipped pixels was specified:
+   ossim_float64 clip_min = flipParams.clipMin;
+   if (ossim::isnan(clip_min)) 
+      clip_min = theClipPixelMin;
+   ossim_float64 clip_max = flipParams.clipMax;
+   if (ossim::isnan(clip_max))
+      clip_max = theClipPixelMax;
+
+   ossimPixelFlipper* flipper = 0;
+   if (!ossim::isnan(clip_min) && !ossim::isnan(clip_max))
+   {
+      // A clip within a range of pixel values was requested. All pixels within the specified range
+      // are mapped to NULL. Create the remapper and insert it into the chain just after the handler
+      flipper = new ossimPixelFlipper();  
+      flipper->setTargetRange(clip_min, clip_max);  
+      flipper->setReplacementValue(current_source->getNullPixelValue());
+      flipper->setReplacementMode(replaceModeStr);
+      singleImageChain->insertRight(flipper, current_source);  
+      current_source = flipper;
+   }
+
+   // The user can also specify a clamping similar to the pixel clipping above. This would be a
+   // second flipper object in the chain:
+   ossim_float64 clamp_min = flipParams.clampMin;
+   if (ossim::isnan(clamp_min))
+      clamp_min = theClampPixelMin;
+   ossim_float64 clamp_max = flipParams.clampMax;
+   if (ossim::isnan(clamp_max))
+      clamp_max = theClampPixelMax;
+
+   flipper = 0; // no leak since chain assumes ownership of prior instance.
+   if (!ossim::isnan(clamp_min))
+   {
+      // A bottom clamping was requested. All pixels below this value are set to this value:
+      flipper = new ossimPixelFlipper();  
+      flipper->setClampValue(clamp_min, false); // false = clamp bottom
+   }
+   if (!ossim::isnan(clamp_max))
+   {
+      // A top clamping was requested. All pixels above this value are set to this value.
+      // The same flipper object can be used as the bottom clamp (if created):
+      if (!flipper)
+         flipper = new ossimPixelFlipper();  
+      flipper->setClampValue(clamp_max, true); // true = clamp top
+   }
+   if (flipper)
+   {
+      // Common code for top and bottom clamping:
+      flipper->setReplacementMode(replaceModeStr);
+      singleImageChain->insertRight(flipper, current_source);  
+      current_source = flipper;
+   }
+
+   return current_source;
+}
+
+//*************************************************************************************************
+// Checks for the presence of a raster mask file alongside the image, and inserts the mask 
+// filter in the chain if mask file exists. Returns pointer to the "current (last added) source 
+// in the single image chain. 
+//*************************************************************************************************
+ossimImageSource* ossimOrthoIgen::setupRasterMask(ossimImageChain* singleImageChain,
+                                                  const ossimSrcRecord& src_record)
+{
+   if (singleImageChain == NULL)
+      return NULL;
+
+   // Search for the image handler in the chain:
+   ossimImageHandler* img_handler = 
+      dynamic_cast<ossimImageHandler*>(singleImageChain->getLastSource());
+   if (img_handler == NULL) 
+      return NULL;
+
+   // See if a raster mask was specified in the SRC record:
+   ossimFilename mask_file = src_record.getMaskPath();
+   if (!mask_file.exists())
+      return img_handler;
+
+   // Open up the mask file and verify it is good:
+   ossimImageHandler* mask_handler =  ossimImageHandlerRegistry::instance()->open(mask_file);
+   if (mask_handler == NULL)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimOrthoIgen::setupRasterMask() -- Could not open "
+         "raster mask file <"<<mask_file<<">. Maske request will be ignored."<<endl;
+      return img_handler;
+   }
+
+   // Create the mask filter and give it the image and mask tile sources. Add it to the chain.
+   // IMPORTANT NOTE: the mask filter is an image combiner. It is being inserted into a single 
+   // image chain. Since it owns its two inputs (the image handler and the mask), it must
+   // replace the handler in the chain. Also, see note in ossimMaskFilter::setInputSources().
+   //singleImageChain->deleteLast(); // Remove the handler
+   // ossimImageSource* nextInChain = singleImageChain->getLastSource();
+   ossimRefPtr<ossimMaskFilter> mask_filter = new ossimMaskFilter;
+   singleImageChain->insertRight(mask_filter.get(), img_handler); 
+   mask_filter->setMaskSource(mask_handler);  // assumes ownership of object
+
+   //---
+   // Set the mode to SELECT_CLAMP_MIN.  This clamps data to min pixel value in the valid image
+   // area if the input pixel is null(essentially a pixel flip).
+   //---
+   mask_filter->setMaskType(ossimMaskFilter::OSSIM_MASK_TYPE_SELECT_CLAMP_MIN);
+   
+   return mask_filter.get();
+}
+
+//*************************************************************************************************
+// Adds a scalar remapper to the extreme right of the chain is specified by the 
+// --output-radiometry option.
+//*************************************************************************************************
+void ossimOrthoIgen::setupOutputRadiometry()
+{
+   if (theOutputRadiometry.empty())
+      return;
+
+   // Map the specified radiometry to a valid type:
+   ossimScalarType scalar_type = 
+      ossimScalarTypeLut::instance()->getScalarTypeFromString(theOutputRadiometry);
+   if (scalar_type == OSSIM_SCALAR_UNKNOWN)
+      return;
+
+   // Add a scalar remapper to the product chain:
+   if(theProductChain->getOutputScalarType() != scalar_type)
+   {
+      ossimScalarRemapper* remapper = new ossimScalarRemapper;
+      remapper->setOutputScalarType(scalar_type);
+      theProductChain->addFirst(remapper);
+   }
+}
+
+//*************************************************************************************************
+// Private method to see if any image chain input projections are affected by elevation.
+//*************************************************************************************************
+bool ossimOrthoIgen::isAffectedByElevation()
+{
+   bool result = false;
+   
+   // Get a list of all the image handlers.
+   // ossimConnectableObject::ConnectableObjectList clientList;
+   // theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler),
+   //                                      true, true);
+
+   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
+                                 false, // firstofTypeFlag
+                                 (ossimVisitor::VISIT_INPUTS|
+                                  ossimVisitor::VISIT_CHILDREN) );
+   theProductChain->accept( visitor );
+   
+   // Loop over all input handlers and see if affected by elevation.
+   // ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
+   // while (iter != clientList.end())
+   for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
+   {
+      // ossimRefPtr<ossimImageHandler> handler = PTR_CAST(ossimImageHandler, (*iter).get());
+      ossimRefPtr<ossimImageHandler> handler =  visitor.getObjectAs<ossimImageHandler>( i );
+      if ( handler.valid() )
+      {
+         ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+         if (geom.valid())
+         {
+            ossimRefPtr<const ossimProjection> proj = geom->getProjection();
+            if ( proj.valid() )
+            {
+               if ( proj->isAffectedByElevation() )
+               {
+                  result = true;
+                  break;
+               }
+            }
+         }
+      }
+      // ++iter;
+   }
+   return result;
+}
+
+//*************************************************************************************************
+// Private method to recompute the gsd on all image handlers that have projections affected by
+// elevation.
+//*************************************************************************************************
+void ossimOrthoIgen::reComputeChainGsds()
+{
+   // Get a list of all the image handlers.
+   // ossimConnectableObject::ConnectableObjectList clientList;
+   // theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler),
+   //                                      true, true);
+   
+   // Loop over all input handlers and see if affected by elevation.
+   // ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
+   // while (iter != clientList.end())
+
+   ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
+                                 false, // firstofTypeFlag
+                                 (ossimVisitor::VISIT_INPUTS|
+                                  ossimVisitor::VISIT_CHILDREN) );
+   theProductChain->accept( visitor );
+
+   for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
+   {
+      // ossimRefPtr<ossimImageHandler> handler = PTR_CAST(ossimImageHandler, (*iter).get());
+
+      ossimRefPtr<ossimImageHandler> handler =  visitor.getObjectAs<ossimImageHandler>( i );
+      if ( handler.valid() )
+      {
+         ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+         if (geom.valid())
+         {
+            ossimRefPtr<ossimProjection> proj = geom->getProjection();
+            if ( proj.valid() )
+            {
+               if ( proj->isAffectedByElevation() )
+                  proj->getMetersPerPixel();
+            }
+         }
+      }
+      // ++iter;
+   }
+}
+
+//*************************************************************************************************
+// GSD Determination is nontrivial since there are various command-line options that control
+// this quantity. This method considers all information before setting the product's GSD.
+//*************************************************************************************************
+void ossimOrthoIgen::setProductGsd()
+{
+   if (!theProductChain.valid())
+      return;
+
+   // Fetch the reference input projection first. Settings may be copied to the product projection:
+   ossimMapProjection* ref_map = PTR_CAST(ossimMapProjection, theReferenceProj.get());
+   ossimGpt origin;
+
+   // The geo-scaling latitude effectively specifies the map projection's origin latitude, which
+   // may affect the scaling of GSD in x-direction. This is only relevant for geographic projections
+   if (theProductProjection->isGeographic())
+   {
+      ossimGpt origin (0.0, theProductProjection->getOrigin().lon, 0.0);
+      if (ossim::isnan(theGeoScalingLatitude))
+      {
+         // Loop over all input handlers and accumulate the geographic centers. This will allow 
+         // computing mosaic center point (approximate) for purposes of establishing reference 
+         // latitude for scale:
+         origin.lat = 0.0;
+         origin.lon = theProductProjection->getOrigin().lon;
+
+         // ossimConnectableObject::ConnectableObjectList clientList;
+         // theProductChain->findAllInputsOfType(clientList, STATIC_TYPE_INFO(ossimImageHandler), 1, 1);
+         // ossimConnectableObject::ConnectableObjectList::iterator iter = clientList.begin();
+
+         ossimTypeNameVisitor visitor( ossimString("ossimImageHandler"),
+                                       false, // firstofTypeFlag
+                                       (ossimVisitor::VISIT_INPUTS|
+                                        ossimVisitor::VISIT_CHILDREN) );
+         theProductChain->accept( visitor );
+         
+         ossimDpt center_pt;
+         ossimGpt geocenter;
+         int num_contributors = 0;
+         // while (iter != clientList.end())
+
+         for( ossim_uint32 i = 0; i < visitor.getObjects().size(); ++i )
+         {
+            // ossimImageHandler* handler = PTR_CAST(ossimImageHandler, (*iter).get());
+            ossimRefPtr<ossimImageHandler> handler =  visitor.getObjectAs<ossimImageHandler>( i );
+            if ( handler.valid() )
+            {
+               // iter++;
+               ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+               if (!geom.valid()) 
+                  continue; // Skip over any non geometry inputs (e.g., masks)
+               
+               handler->getBoundingRect().getCenter(center_pt);
+               if (!geom->localToWorld(center_pt, geocenter))  
+                  continue;
+               if (num_contributors == 0)
+                  origin.lat = geocenter.lat;
+               else
+                  origin.lat += geocenter.lat;
+               ++num_contributors;
+            }
+            else
+            {
+               break;
+            }
+         }
+
+         // Compute average latitude among all contributors:
+         if (num_contributors)
+            origin.lat /= (double)num_contributors;
+      }
+      else
+      {
+         // A geo-scaling reference latitude was provided on the command line:
+         origin.lat = theGeoScalingLatitude;
+      }
+
+      // Set the latitude of origin to the reference latitude (either specified on command line or
+      // computed as scene center):
+      theProductProjection->setOrigin(origin); // proj now can handle meters and degrees correctly
+   }
+
+   // Establish the resolution based on either command line option or reference proj if no values
+   // provided on command line (--degrees or --meters):
+   ossimDpt resolution (theDeltaPerPixelOverride);
+   ossimUnitType resUnits = theDeltaPerPixelUnit;
+   if (resolution.hasNans())
+   {
+      //  No GSD specified, so copy it from the input projection:
+      if (ref_map && ref_map->isGeographic())
+      {
+         resolution = ref_map->getDecimalDegreesPerPixel();
+         resUnits = OSSIM_DEGREES;
+      }
+      else
+      {
+         resolution = theReferenceProj->getMetersPerPixel();
+         resUnits = OSSIM_METERS;
+      }
+   }
+
+   // Set the desired image GSD, accounting for possible mixing of units:
+   if (resUnits == OSSIM_DEGREES)
+   {
+      // Need to adjust the resolution in the longitude direction if the user requested geo-scaling:
+      if (!ossim::isnan(theGeoScalingLatitude))
+         resolution.lon = resolution.lat/ossim::cosd(theGeoScalingLatitude);
+      theProductProjection->setDecimalDegreesPerPixel(resolution);
+   }
+   else 
+      theProductProjection->setMetersPerPixel(resolution);
+
+   // Propagates changes to the projection to the processing chain:
+   setView();
+}
diff --git a/src/util/ossimOrthoTool.cpp b/src/util/ossimOrthoTool.cpp
new file mode 100644
index 0000000..b9a7725
--- /dev/null
+++ b/src/util/ossimOrthoTool.cpp
@@ -0,0 +1,82 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/imaging/ossimSlopeFilter.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/util/ossimOrthoTool.h>
+#include <iostream>
+
+using namespace std;
+
+const char* ossimOrthoTool::DESCRIPTION  = "Utility for orthorectifying and reprojecting image data.";
+
+ossimOrthoTool::ossimOrthoTool()
+{
+}
+
+ossimOrthoTool::~ossimOrthoTool()
+{
+}
+
+void ossimOrthoTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add options.
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " ortho [options] [<input-image>] <output-image>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->setDescription(DESCRIPTION);
+
+   // Base class has its own:
+   ossimChipProcTool::setUsage(ap);
+}
+
+bool ossimOrthoTool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   processRemainingArgs(ap);
+   return true;
+}
+
+void ossimOrthoTool::initialize(const ossimKeywordlist& kwl)
+{
+   // Base class does the heavy work:
+   ossimChipProcTool::initialize(kwl);
+}
+
+void ossimOrthoTool::initProcessingChain()
+{
+   ossimRefPtr<ossimImageSource> input_mosaic = combineLayers(m_imgLayers);
+   m_procChain->add(input_mosaic.get());
+}
+
diff --git a/src/util/ossimPointCloudUtil.cpp b/src/util/ossimPointCloudUtil.cpp
new file mode 100644
index 0000000..f13aa34
--- /dev/null
+++ b/src/util/ossimPointCloudUtil.cpp
@@ -0,0 +1,266 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc.
+//
+// License:  LGPL
+//
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  Oscar Kramer
+//
+//*******************************************************************
+//  $Id$
+
+#include <ossim/util/ossimPointCloudUtil.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/elevation/ossimImageElevationDatabase.h>
+#include <ossim/point_cloud/ossimPointCloudHandlerRegistry.h>
+
+using namespace std;
+
+ossimPointCloudUtil::ossimPointCloudUtil()
+:  m_operation (LOWEST_DEM),
+   m_gsd (0)
+{
+}
+
+ossimPointCloudUtil::~ossimPointCloudUtil()
+{
+   m_pcHandler = 0;
+   m_prodGeom = 0;
+   m_pcuFilter = 0;
+}
+
+void ossimPointCloudUtil::addArguments(ossimArgumentParser& ap)
+{
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [options] <point-cloud-file> <output-image>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->addCommandLineOption(
+         "--gsd <meters>",
+         "Specifies output GSD in meters. Defaults to the same "
+         "resolution as input DEM.");
+   au->addCommandLineOption(
+         "--dem <filename>",
+         "Specifies the input DEM filename. If none provided, the elevation database is "
+         "referenced as specified in prefs file");
+   au->addCommandLineOption(
+         "--lut <filename>",
+         "Specifies the optional lookup table filename for "
+         "mapping the single-band output image to an RGB. The LUT provided must be "
+         "in the ossimIndexToRgbLutFilter format and must handle the three output "
+         "viewshed values (see --values option).");
+   au->addCommandLineOption(
+         "--op",
+         "Specify the desired operation. Possible values are:\n"
+         "  \"highest-dem\", \"lowest-dem\" (default), or \"highest-lowest\". \n"
+         "Alternatively can be specified in shorthand as \"h-d\", \"l-d\", or \"h-l\", "
+         "respectively.");
+   au->addCommandLineOption(
+         "--request-api",
+         "Causes applications API to be output as JSON to stdout."
+         " Accepts optional filename to store JSON output.");
+   au->addCommandLineOption(
+         "--threads <n>",
+         "Number of threads. Defaults to use all available cores. "
+         "For engineering/debug purposes ");
+}
+
+void ossimPointCloudUtil::usage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+
+   // Add options.
+   addArguments(ap);
+
+   // Write usage.
+   ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+
+   ossimNotify(ossimNotifyLevel_INFO)
+   <<"\nPerforms specified processing on point-cloud.\n\n"
+   << std::endl;
+}
+
+bool ossimPointCloudUtil::initialize(ossimArgumentParser& ap)
+{
+   if ( (ap.argc() == 1) || ap.read("-h") || ap.read("--help") )
+   {
+      usage(ap);
+      return false;
+   }
+
+   ossimString ts1;
+   ossimArgumentParser::ossimParameter sp1(ts1);
+
+   if ( ap.read("--dem", sp1) )
+      m_demFile = ts1;
+
+   if ( ap.read("--gsd", sp1) )
+      m_gsd = ossimString(ts1).toDouble();
+
+   if ( ap.read("--lut", sp1) )
+      m_lutFile = ts1;
+
+   if ( ap.read("--op", sp1) )
+   {
+      if (ts1.contains("highest-dem") || ts1.contains("h-d"))
+         m_operation = HIGHEST_DEM;
+      else if (ts1.contains("highest-lowest") || ts1.contains("h-l"))
+         m_operation = HIGHEST_LOWEST;
+   }
+
+   if ( ap.read("--pc", sp1) )
+      m_demFile = ts1;
+
+/*
+   if ( ap.read("--request-api", sp1))
+   {
+      ofstream ofs ( ts1.c_str() );
+      printApiJson(ofs);
+      ofs.close();
+      return false;
+   }
+   if ( ap.read("--request-api"))
+   {
+      printApiJson(cout);
+      return false;
+   }
+*/
+   // There should only be the required command line args left:
+   if (ap.argc() < 3)
+   {
+      usage(ap);
+      return false;
+   }
+
+   // Parse the required command line params:
+   m_pcFile = ap[1];
+   m_prodFile = ap[2];
+
+   return initialize();
+}
+
+bool ossimPointCloudUtil::initialize()
+{
+   if (loadPC())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+              << "ossimPointCloudUtil::initialize ERR: Cannot open PC file at <"<<m_pcFile
+              <<">\n"<< endl;
+      return false;
+   }
+
+   if (!m_demFile.empty() && !loadDem())
+      return false;
+
+   m_pcuFilter = new ossimPointCloudUtilityFilter(this);
+   return true;
+}
+
+bool ossimPointCloudUtil::loadPC()
+{
+   // DEM provided as file on command line, reset the elev manager to use only this:
+   m_pcHandler = ossimPointCloudHandlerRegistry::instance()->open(m_pcFile);
+   if(!m_pcHandler.valid())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+            << "ossimPointCloudUtil::initialize ERR: Cannot open PC file at <"<<m_pcFile
+            <<">\n" << std::endl;
+      return false;
+   }
+
+   // Use "rasterized" PC to establish best output image geometry:
+   m_pciHandler = new ossimPointCloudImageHandler;
+   m_pciHandler->setPointCloudHandler(m_pcHandler.get());
+   m_prodGeom = m_pciHandler->getImageGeometry();
+   if (!m_prodGeom.valid() || !m_prodGeom->getAsMapProjection())
+      return false;
+
+   if (m_gsd != 0)
+      m_prodGeom->getAsMapProjection()->setMetersPerPixel(ossimDpt(m_gsd, m_gsd));
+
+   return true;
+}
+
+bool ossimPointCloudUtil::loadDem()
+{
+   // DEM provided as file on command line, reset the elev manager to use only this:
+   ossimElevManager* elevMgr = ossimElevManager::instance();
+   elevMgr->clear();
+   ossimRefPtr<ossimImageElevationDatabase> ied = new ossimImageElevationDatabase;
+   if(!ied->open(m_demFile))
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+                           << "ossimViewshedUtil::initialize ERR: Cannot open DEM file at <"<<m_demFile<<">\n"
+                           << std::endl;
+      return false;
+   }
+
+   elevMgr->addDatabase(ied.get());
+
+   // When DEM file specified, need to turn off all defaulting to ellipsoid/geoid to make sure
+   // only the DEM file data is processed:
+   elevMgr->setDefaultHeightAboveEllipsoid(ossim::nan());
+   elevMgr->setUseGeoidIfNullFlag(false);
+
+   return true;
+}
+
+void ossimPointCloudUtil::setGSD(const double& meters_per_pixel)
+{
+   if (m_prodGeom->getAsMapProjection() && (meters_per_pixel > 0))
+   {
+      m_gsd = meters_per_pixel;
+      m_prodGeom->getAsMapProjection()->setMetersPerPixel(ossimDpt(m_gsd, m_gsd));
+   }
+}
+
+bool ossimPointCloudUtil::execute()
+{
+   // See if an LUT is requested:
+   ossimImageSource* last_source = m_pcuFilter.get();
+   ossimRefPtr<ossimIndexToRgbLutFilter> lutSource = 0;
+   if (!m_lutFile.empty())
+   {
+      ossimKeywordlist lut_kwl;
+      lut_kwl.addFile(m_lutFile);
+      lutSource = new ossimIndexToRgbLutFilter;
+      if (!lutSource->loadState(lut_kwl))
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << "ossimViewshedUtil::writeFile() ERROR: The LUT "
+               "file <"<<m_lutFile<<"> could not be read. Ignoring remap request.\n"<< std::endl;
+         lutSource = 0;
+      }
+      else
+      {
+         lutSource->connectMyInputTo(last_source);
+         lutSource->initialize();
+         last_source = lutSource.get();
+      }
+   }
+
+   // Set up the writer:
+   ossimRefPtr<ossimImageFileWriter> writer =
+         ossimImageWriterFactoryRegistry::instance()->createWriter(m_prodFile);
+   bool success = false;
+   if (writer.valid())
+   {
+      writer->connectMyInputTo(0, last_source);
+      success = writer->execute();
+   }
+
+   return success;
+}
+
+
diff --git a/src/util/ossimRpfUtil.cpp b/src/util/ossimRpfUtil.cpp
new file mode 100644
index 0000000..a6ec92f
--- /dev/null
+++ b/src/util/ossimRpfUtil.cpp
@@ -0,0 +1,348 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description:  ossimRpfUtil.cpp
+// 
+// Utility class to stuff with rpf files.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/util/ossimRpfUtil.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/support_data/ossimRpfToc.h>
+#include <ossim/support_data/ossimRpfTocEntry.h>
+#include <ctime>
+#include <iomanip>
+
+static ossimTrace traceDebug = ossimTrace("ossimRpfUtil:debug");
+
+ossimRpfUtil::ossimRpfUtil()
+{
+}
+
+ossimRpfUtil::~ossimRpfUtil()
+{
+}
+
+
+// Note: throws ossimException on error.
+void ossimRpfUtil::writeDotRpfFiles( const ossimFilename& aDotTocFile,
+                                     const ossimFilename& outputDir )
+{
+   static const char MODULE[] = "ossimRpfUtil::writeDotRpfFiles";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..."
+         << "\na.toc file:        " << aDotTocFile
+         << "\noutput directory:  " << outputDir
+         << "\n";
+   }
+   
+   // Parse the a.toc file:
+   ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc();
+   
+   if ( toc->parseFile(aDotTocFile) != ossimErrorCodes::OSSIM_OK )
+   {
+      std::string e = MODULE;
+      e += " ERROR:\nCould not open: ";
+      e+= aDotTocFile.string();
+      throw ossimException(e);
+   }
+
+   if ( outputDir.expand().exists() == false )
+   {
+      if ( !outputDir.createDirectory(true, 0775) )
+      {
+         std::string e = MODULE;
+         e += " ERROR:\nCould not create directory: ";
+         e+= outputDir.c_str();
+         throw ossimException(e);
+      }
+   }
+
+   //---
+   // Go through the entries...
+   //---
+   ossim_uint32 entries = toc->getNumberOfEntries();
+   for (ossim_uint32 entry = 0; entry < entries; ++entry)
+   {
+      const ossimRpfTocEntry* tocEntry = toc->getTocEntry(entry);
+      if (tocEntry)
+      {
+         if ( tocEntry->isEmpty() == false )
+         {
+            writeDotRpfFile(toc.get(), tocEntry, outputDir, entry);
+         }
+      }
+      else
+      {
+         std::string e = MODULE;
+         e += " ERROR:  Null entry: ";
+         e += ossimString::toString(entry).string();
+         throw ossimException(e);
+      }
+   }
+   
+} // End: ossimRpfUtil::writeDotRpfFiles
+
+//---
+// Writer a dot rpf file for entry to output directory.
+// 
+// NOTES:
+//
+// 1) All coordinate written out in AREA or edge to edge format.
+// 2) Throws ossimException on error.
+//---
+void ossimRpfUtil::writeDotRpfFile( const ossimRpfToc* toc,
+                                    const ossimRpfTocEntry* tocEntry,
+                                    const ossimFilename& outputDir,
+                                    ossim_uint32 entry)
+{
+   static const char MODULE[] = "ossimRpfUtil::writeDotRpfFile";
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << MODULE << " entered..."
+         << "\noutput directory:  " << outputDir
+         << "\nentry: " << entry << "\n";
+   }
+
+   if ( !toc )
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR toc pointer null!";
+      throw ossimException(errMsg);
+   }
+   if ( !tocEntry )
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR toc entry pointer null!";
+      throw ossimException(errMsg);
+   }
+
+   // Get the file name.
+   ossimFilename outFile;
+   if ( outputDir.expand().isDir() )
+   {
+      getDotRfpFilenameForEntry(outputDir, entry, outFile);
+   }
+   else
+   {
+      outFile = outputDir;
+   }
+   
+   // Open the file to write.
+   std::ofstream os;
+   os.open(outFile.c_str(), ios::out);
+   if ( os.good() == false )
+   {
+      std::string errMsg = MODULE;
+      errMsg += "ERROR could not open: ";
+      errMsg += outFile.string();
+      throw ossimException(errMsg);
+   }
+   
+   // Set up the output stream fix with full precision for ground points.
+   os << setiosflags(std::ios_base::fixed) << setprecision(15);
+   
+   //---
+   // Overall TOC entry bounds:
+   // 
+   // Write the first line which is the bounding box of the entry in the form of:
+   // "89.9850464205332, 23.9892538162654|90.5085823882692, 24.5002602501599|1"
+   //      lr-lon            lr-lat           ul-lon            ul-lat
+   //---
+   ossimRefPtr<ossimImageGeometry> geom = tocEntry->getImageGeometry();
+   if( geom.valid() == false)
+   {
+      std::string errMsg = "ERROR could not get geometry.";
+      errMsg += outFile.string();
+      throw ossimException(errMsg);  
+   }
+
+   // Rectangle in image space.
+   ossimIrect outputRect;
+   tocEntry->getBoundingRect(outputRect);
+
+   // bands:
+   ossim_uint32 bands = tocEntry->getNumberOfBands();
+
+   // scale:
+   ossimDpt scale;
+   tocEntry->getDecimalDegreesPerPixel(scale);
+   ossimDpt halfPix = scale / 2.0;
+
+   ossimGpt llg;
+   ossimGpt urg;
+   geom->localToWorld(outputRect.ur(), urg);
+   geom->localToWorld(outputRect.ll(), llg);
+
+   if ( traceDebug() )
+   {
+      ossimNotify(ossimNotifyLevel_DEBUG)
+         << "outputRect: " << outputRect
+         << "\nbands: " << bands
+         << "\nscale: " << scale
+         << "\nllg:   " << llg
+         << "\nurg:   " << urg
+         << std::endl;
+   }
+
+   // Expand coordinates to edge:
+   llg.lon -= halfPix.x;
+   llg.lat -= halfPix.y;
+   urg.lon += halfPix.x;
+   urg.lat += halfPix.y;
+   
+   // Test for 360 degrees apart.
+   checkLongitude(llg, urg);
+   
+   os << llg.lon << "," // lower left longitude
+      << llg.lat << "|" // lower left latitude
+      << urg.lon << "," // upper right longitude
+      << urg.lat << "|" // upper right latitude
+      << bands << "\n";
+
+   // Frame loop:
+   const ossim_int32 FRAMESIZE = 1536;
+   const ossim_int32 ROWS = static_cast<ossim_int32>(tocEntry->getNumberOfFramesVertical());
+   if( ROWS == 0 )
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR no rows!";
+      throw ossimException(errMsg);  
+   }
+   const ossim_int32 COLS = static_cast<ossim_int32>(tocEntry->getNumberOfFramesHorizontal());
+   if( COLS == 0 )
+   {
+      std::string errMsg = MODULE;
+      errMsg += " ERROR no columns!";
+      throw ossimException(errMsg);  
+   }
+
+   // Set the initial lower left and upper right image points for localToWorld call.
+   //ossimDpt urd( ( (ROWS-1)*FRAMESIZE) -1, 0.0);
+   //ossimDpt lld(0.0, (ROWS*FRAMESIZE)-1);
+   ossimDpt urd( FRAMESIZE-1, 0.0);
+   ossimDpt lld(0.0, FRAMESIZE-1);
+   
+   for (ossim_int32 row = ROWS-1; row > -1; --row)
+   {
+      for (ossim_int32 col = 0; col < COLS; ++col)
+      {
+         //---
+         // Example format (only with 15 digit precision):
+         // /data/spadac/rpf/world/cb01/ng467a1/0xslpk1a.i41|90.0448,24.3621|90.0598,24.3750
+         //---
+         
+         // Get the path to the frame.
+         ossimFilename path;
+         toc->getRootDirectory(path);
+         
+         path = path.dirCat( toc->getRelativeFramePath(entry, row, col) );
+
+         // Not sure if this is backwards:
+         geom->localToWorld(urd, urg);
+         geom->localToWorld(lld, llg);
+
+         // Expand coordinates to edge:
+         llg.lon -= halfPix.x;
+         llg.lat -= halfPix.y;
+         urg.lon += halfPix.x;
+         urg.lat += halfPix.y;
+         
+         // Test for 360 degrees apart.
+         checkLongitude(llg, urg);
+
+         os << path.c_str() << "|"
+            << llg.lon << "," // lower left longitude
+            << llg.lat << "|" // lower left latitude
+            << urg.lon << "," // upper right longitude
+            << urg.lat        // upper right latitude
+            << "\n";
+
+         if ( traceDebug() )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "row[" << row << "]col[" << col << "]path: " << path
+               << "\nlld: " << lld
+               << "\nllg: " << llg
+               << "\nurd: " << urd
+               << "\nurg: " << urg
+               << std::endl;
+         }
+
+         // Go to next col.
+         urd.x += FRAMESIZE;
+         lld.x += FRAMESIZE;
+            
+      } // End column loop.
+
+      // Go to nex row.
+      urd.y += FRAMESIZE;
+      urd.x = FRAMESIZE-1;
+      lld.y += FRAMESIZE;
+      lld.x = 0;
+      
+   } // End row loop.
+
+   // Close the file.
+   os.close();
+
+   ossimNotify(ossimNotifyLevel_DEBUG) << "wrote file: " << outFile << std::endl;
+   
+} // End: ossimRpfUtil::writeDotRpfFile
+
+void ossimRpfUtil::checkLongitude(ossimGpt& left, ossimGpt& right) const
+{
+   //---
+   // Test for scene coordinates being 180 to 180 (360 degree spread) and
+   // adjust leftLon to -180 if so.
+   //
+   // NOTE:
+   // Setting tolerance to 1/7200 about 15 meters.
+   // Not sure if this is too loose or not. (drb)
+   //---
+   const ossim_float64 TOLERANCE = 0.000138889; // 1/7200 about 15 meters.
+
+   if ( ossim::almostEqual(left.lon, 180.0, TOLERANCE) )
+   {
+      if ( ossim::almostEqual(right.lon, 180.0, TOLERANCE) )
+      {
+         left.lon = -180.0;
+         right.lon = 180.0;
+      }
+   }
+}
+
+void ossimRpfUtil::getDotRfpFilenameForEntry(const ossimFilename& outputDir,
+                                             ossim_uint32 entry,
+                                             ossimFilename& outFile) const
+{
+   // Get the build date in the format of (yyyymmddhhmmss).
+   char s[15];
+   s[14] = '\0';
+   time_t t;
+   time(&t);
+   tm* lt = localtime(&t);
+   strftime(s, 15, "%Y%m%d%H%M%S", lt);
+   std::string date = s;
+   
+   outFile = outputDir.dirCat(s);
+   outFile += "_e";
+   outFile += ossimString::toString(entry);
+   outFile += ".rpf";
+}
diff --git a/src/util/ossimShorelineTool.cpp b/src/util/ossimShorelineTool.cpp
new file mode 100644
index 0000000..e2e5f55
--- /dev/null
+++ b/src/util/ossimShorelineTool.cpp
@@ -0,0 +1,631 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/base/jsoncpp.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimKMeansClustering.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimEquationCombiner.h>
+#include <ossim/imaging/ossimBandLutFilter.h>
+#include <ossim/imaging/ossimEdgeFilter.h>
+#include <ossim/imaging/ossimImageGaussianFilter.h>
+#include <ossim/imaging/ossimErosionFilter.h>
+#include <ossim/imaging/ossimImageHistogramSource.h>
+#include <ossim/ossimVersion.h>
+#include <ossim/util/ossimShorelineTool.h>
+#include <ossim/util/ossimToolRegistry.h>
+#include <fstream>
+
+static const string COLOR_CODING_KW = "color_coding";
+static const string SMOOTHING_KW = "smoothing";
+static const string THRESHOLD_KW = "threshold";
+static const string TMODE_KW = "tmode";
+static const string TOLERANCE_KW = "tolerance";
+static const string ALGORITHM_KW = "algorithm";
+static const ossimFilename DUMMY_OUTPUT_FILENAME = "@@NEVER_USE_THIS@@";
+static const ossimFilename TEMP_INDEX_FILENAME = "temp_shoreline_index.tif";
+static const ossimFilename TEMP_THRESHOLD_FILENAME = "temp_shoreline_threshold.tif";
+static const ossimFilename TEMP_MASK_FILENAME = "temp_shoreline_mask.tif";
+
+const char* ossimShorelineTool::DESCRIPTION =
+      "Computes bitmap of water versus land areas in an input image.";
+
+using namespace std;
+
+ossimShorelineTool::ossimShorelineTool()
+:    m_waterValue (0),
+     m_marginalValue (128),
+     m_landValue (255),
+     m_sensor ("ls8"),
+     m_threshold (-1.0), // Flags auto-thresholding
+     m_tolerance(0.0),
+     m_algorithm(NDWI),
+     m_thresholdMode(SIGMA),
+     m_smoothing(0),
+     m_noVector(false)
+{
+}
+
+ossimShorelineTool::~ossimShorelineTool()
+{
+}
+
+void ossimShorelineTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimChipProcTool::setUsage(ap);
+
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " shoreline [options] [<output-vector-filename>]";
+   au->setCommandLineUsage(usageString);
+   au->setDescription("Computes vector shoreline from raster imagery. The vectors are output "
+         "in GeoJSON format. If an output filename is specified, the JSON is written to it. "
+         "Otherwise it is written to the console. The supported algorithms are (where A, B, etc are ordered input band files): \n"
+         "   NDWI = (A - B) / (A + B) \n"
+         "   AWEI = 4*(A + B) - 0.25*C - 2.75*D \n"
+         "   PAN-THRESHOLD = A (no equation applied). The input single-band image is thresholded directly. \n");
+
+   // Set the command line options:
+   au->addCommandLineOption("--algorithm <name>",
+         "Specifies detection algorithm to apply. Supported names are: "
+         "\"ndwi\", \"aewi\", \"pan-threshold\"");
+   au->addCommandLineOption("--color-coding <water> <marginal> <land>",
+         "Specifies the pixel values (0-255) for the output product corresponding to water, marginal, "
+         "and land zones. Defaults to 0, 128, and 255, respectively.");
+   au->addCommandLineOption("--no-vector",
+        "Outputs the raster, thresholded indexed image instead of a vector product. For engineering purposes.");
+    au->addCommandLineOption("--sensor <string>",
+           "Sensor used to compute Modified Normalized Difference Water Index. Currently only "
+           "\"ls8\" supported (default).");
+   au->addCommandLineOption("--smooth <sigma>",
+         "Applies gaussian filter to index raster file. The filter sigma must be specified (0.2 is good). Sigma=0 "
+         "indicates no smoothing.");
+   au->addCommandLineOption("--threshold <0.0-1.0>",
+         "Normalized threshold for converting the image to bitmap. Defaults to 0.55. If none specified, an optimized threshold"
+         " is computed.");
+   au->addCommandLineOption("--tmode <1|2|3>",
+         "Mode to use for computing threshold from k-means statistics, where:\n"
+         "   0 = no auto-thresholding,\n"
+         "   1 = unweighted mean of means,\n"
+         "   2 = sigma-weighted mean of means (default),\n"
+         "   3 = variance-weighted mean of means."
+         "If \"--threshold\" option is specified, this option is ignored.\n");
+   au->addCommandLineOption("--tolerance <float>",
+         "tolerance +- deviation from threshold for marginal classifications. Defaults to 0.01.");
+}
+
+bool ossimShorelineTool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   ossimString ts1;
+   ossimArgumentParser::ossimParameter sp1(ts1);
+   ossimString ts2;
+   ossimArgumentParser::ossimParameter sp2(ts2);
+   ossimString ts3;
+   ossimArgumentParser::ossimParameter sp3(ts3);
+
+   if ( ap.read("--algorithm", sp1))
+      m_kwl.addPair(ALGORITHM_KW, ts1);
+
+   if (ap.read("--color-coding", sp1, sp2, sp3))
+   {
+      ostringstream value;
+      value<<ts1<<" "<<ts2<<" "<<ts3;
+      m_kwl.addPair( COLOR_CODING_KW, value.str() );
+   }
+
+   if ( ap.read("--no-vector"))
+      m_noVector = true;
+
+   if ( ap.read("--sensor", sp1))
+      m_kwl.addPair(ossimKeywordNames::SENSOR_ID_KW, ts1);
+
+   if ( ap.read("--smooth", sp1))
+      m_kwl.addPair(SMOOTHING_KW, ts1);
+
+   if ( ap.read("--threshold", sp1))
+      m_kwl.addPair(THRESHOLD_KW, ts1);
+
+   if ( ap.read("--tmode", sp1))
+      m_kwl.addPair(TMODE_KW, ts1);
+
+   if ( ap.read("--tolerance", sp1))
+      m_kwl.addPair(TOLERANCE_KW, ts1);
+
+   // Added for "beachfront" to allow passing properties (keyword:value pairs) through to the
+   // GeoJSON vector output
+   while (ap.read("--prop", sp1))
+   {
+      m_geoJsonProps.insert(pair<ossimString, ossimString>(ts1.before(":"), ts1.after(":")));
+   }
+
+   // Fake the base class into thinking there is a default output filename to avoid it complaining,
+   // since this utility will stream vector output to console if no output file name provided:
+   m_kwl.add( ossimKeywordNames::OUTPUT_FILE_KW, DUMMY_OUTPUT_FILENAME.c_str());
+
+   processRemainingArgs(ap);
+   return true;
+}
+
+void ossimShorelineTool::initialize(const ossimKeywordlist& kwl)
+{
+   ossimString value;
+   ostringstream xmsg;
+
+   // Don't copy KWL if member KWL passed in:
+   if (&kwl != &m_kwl)
+   {
+      // Start with clean options keyword list.
+      m_kwl.clear();
+      m_kwl.addList( kwl, true );
+   }
+
+   value = m_kwl.findKey(ALGORITHM_KW);
+   if (!value.empty())
+   {
+      if (value=="ndwi")
+         m_algorithm = NDWI;
+      else if (value=="awei")
+         m_algorithm = AWEI;
+      else if (value=="pan-threshold")
+         m_algorithm = PAN_THRESHOLD;
+      else
+      {
+         xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Bad value encountered for keyword <"
+               <<ALGORITHM_KW<<">.";
+         throw ossimException(xmsg.str());
+      }
+   }
+
+   value = m_kwl.findKey(COLOR_CODING_KW);
+   if (!value.empty())
+   {
+      vector<ossimString> values = value.split(" ");
+      if (values.size() == 3)
+      {
+         m_waterValue = values[0].toUInt8();
+         m_marginalValue = values[1].toUInt8();
+         m_landValue = values[2].toUInt8();
+      }
+      else
+      {
+         xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Unexpected number of values encountered for keyword <"
+               <<COLOR_CODING_KW<<">.";
+         throw ossimException(xmsg.str());
+      }
+   }
+
+   value = m_kwl.find(ossimKeywordNames::SENSOR_ID_KW);
+   if (!value.empty())
+      m_sensor = value;
+
+   value = m_kwl.findKey(SMOOTHING_KW);
+   if (!value.empty())
+      m_smoothing = value.toDouble();
+
+   value = m_kwl.findKey(TMODE_KW);
+   if (!value.empty())
+   {
+      int tmode = value.toInt();
+      if ((tmode >= 0) && (tmode <= 4))
+         m_thresholdMode = (ThresholdMode) tmode;
+   }
+
+   value = m_kwl.findKey(THRESHOLD_KW);
+   if (!value.empty())
+   {
+      m_threshold = value.toDouble();
+      m_thresholdMode = VALUE;
+   }
+
+   value = m_kwl.findKey(TOLERANCE_KW);
+   if (!value.empty())
+      m_tolerance = value.toDouble();
+
+   // Output filename specifies the vector output, while base class interprets as raster, correct:
+   m_vectorFilename = m_kwl.find(ossimKeywordNames::OUTPUT_FILE_KW);
+   if (m_vectorFilename == DUMMY_OUTPUT_FILENAME)
+   {
+      m_vectorFilename = "";
+      m_indexFilename = TEMP_INDEX_FILENAME;
+      m_threshFilename = TEMP_THRESHOLD_FILENAME;
+      m_maskFilename = TEMP_MASK_FILENAME;
+   }
+   else
+   {
+      m_indexFilename = m_vectorFilename.fileNoExtension() + "_index.tif";
+      m_threshFilename = m_vectorFilename.fileNoExtension() + "_thresh.tif";
+      m_maskFilename = m_vectorFilename.fileNoExtension() + "_mask.tif";
+   }
+   m_kwl.add(ossimKeywordNames::OUTPUT_FILE_KW, m_indexFilename.chars());
+
+   // Unless an output projection was specifically requested, use the input:
+   m_kwl.add(ossimKeywordNames::PROJECTION_KW, "identity", false);
+
+   ossimChipProcTool::initialize(kwl);
+}
+
+void ossimShorelineTool::initProcessingChain()
+{
+   // The processing chain to produce the index image is assembled here. The thresholding part is
+   // done during execute().
+   ostringstream xmsg;
+
+   if (m_aoiGroundRect.hasNans() || m_aoiViewRect.hasNans())
+   {
+      xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Encountered NaNs in AOI."<<ends;
+      throw ossimException(xmsg.str());
+   }
+
+   ossim_uint32 reqdNumInputs = 0;
+   ossimString equationSpec;
+   switch (m_algorithm)
+   {
+   case NDWI:
+      reqdNumInputs = 2;
+      equationSpec = "in[0]/(in[0]+in[1])";
+      break;
+   case AWEI:
+      reqdNumInputs = 4;
+      equationSpec = "4*(in[0]+in[1]) - 0.25*in[2] - 2.75*in[3]";
+      break;
+   case PAN_THRESHOLD:
+      reqdNumInputs = 1;
+      break;
+   default:
+      break;
+   }
+
+   if (m_imgLayers.size() < reqdNumInputs)
+   {
+      xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Expected "<< reqdNumInputs << " input images"
+            " but only found "<<m_imgLayers.size()<<"."<<ends;
+      throw ossimException(xmsg.str());
+   }
+
+   if ((m_algorithm==NDWI) || (m_algorithm==AWEI))
+   {
+      // Set up equation combiner:
+      ossimConnectableObject::ConnectableObjectList connectable_list;
+      for (ossim_uint32 i=0; i<reqdNumInputs; ++i)
+         connectable_list.push_back(m_imgLayers[i].get());
+      ossimRefPtr<ossimEquationCombiner> eqFilter = new ossimEquationCombiner(connectable_list);
+      eqFilter->setOutputScalarType(OSSIM_NORMALIZED_DOUBLE);
+      eqFilter->setEquation(equationSpec);
+      m_procChain->add(eqFilter.get());
+   }
+   else
+   {
+      // Just add input connection for pan thresholding:
+      m_procChain->add(m_imgLayers[0].get());
+   }
+
+   if (m_smoothing > 0)
+   {
+      // Set up gaussian filter:
+      ossimRefPtr<ossimImageGaussianFilter> smoother = new ossimImageGaussianFilter;
+      smoother->setGaussStd(m_smoothing);
+      m_procChain->add(smoother.get());
+   }
+
+   return;
+}
+
+ossimRefPtr<ossimImageData> ossimShorelineTool::getChip(const ossimIrect& bounding_irect)
+{
+   // NOTE:
+   // getChip only performs the index and thresholding (and possibly edge). For vector output,
+   // execute must be called.
+
+   ostringstream xmsg;
+   if (!m_geom.valid())
+      return 0;
+
+   m_aoiViewRect = bounding_irect;
+   m_geom->setImageSize( m_aoiViewRect.size() );
+   m_geom->localToWorld(m_aoiViewRect, m_aoiGroundRect);
+
+   return m_procChain->getTile( m_aoiViewRect, 0 );
+}
+
+bool ossimShorelineTool::execute()
+{
+   if (m_helpRequested)
+      return true;
+
+   bool status = true;
+
+   // Base class handles the thresholded image generation. May throw exception. Output written to
+   // m_productFilename. Note that if PAN mode selected, there is no intermediate index file:
+   m_productFilename = m_indexFilename;
+   if ((m_algorithm != PAN_THRESHOLD) && !ossimChipProcTool::execute())
+      return false;
+
+   if (m_thresholdMode != NONE)
+      doThreshold();
+   else
+      return true;
+
+   if (m_noVector)
+      return status;
+
+   // Now for vector product, need services of a plugin utility. Check if available:
+   ossimRefPtr<ossimTool> potrace =
+         ossimToolRegistry::instance()->createTool(string("potrace"));
+   if (!potrace.valid())
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimShorelineUtil:"<<__LINE__<<"  Need the "
+            "ossim-potrace plugin to perform vectorization. Only the thresholded image is "
+            "available at <"<<m_productFilename<<">."<<endl;
+      return false;
+   }
+
+   // Need a mask image representing an eroded version of the input image:
+   m_procChain = new ossimImageChain;
+   m_procChain->add(m_imgLayers[0].get());
+   if (m_smoothing > 0)
+   {
+      // Set up gaussian filter:
+      ossimRefPtr<ossimImageGaussianFilter> smoother = new ossimImageGaussianFilter;
+      smoother->setGaussStd(m_smoothing);
+      m_procChain->add(smoother.get());
+   }
+   ossimRefPtr<ossimErosionFilter> eroder = new ossimErosionFilter;
+   eroder->setWindowSize(10);
+   m_procChain->add(eroder.get());
+   m_procChain->initialize();
+   m_productFilename = m_maskFilename;
+   status = ossimChipProcTool::execute(); // generates mask
+   if (m_productFilename.ext() != "JSON")
+      m_productFilename = m_vectorFilename.setExtension("json");
+
+   // Convey possible redirection of console out:
+   potrace->setOutputStream(m_consoleStream);
+
+   ossimKeywordlist potrace_kwl;
+   potrace_kwl.add("image_file0", m_threshFilename.chars());
+   potrace_kwl.add("image_file1", m_maskFilename.chars());
+   potrace_kwl.add(ossimKeywordNames::OUTPUT_FILE_KW, m_productFilename.chars());
+   potrace_kwl.add("mode", "linestring");
+   potrace_kwl.add("alphamax", "1.0");
+   potrace_kwl.add("turdsize", "4");
+
+   potrace->initialize(potrace_kwl);
+
+   status =  potrace->execute();
+   if (status)
+      status =  addPropsToJSON();
+
+   if (status)
+      ossimNotify(ossimNotifyLevel_INFO)<<"Wrote vector product to <"<<m_productFilename<<">"<<endl;
+   else
+      ossimNotify(ossimNotifyLevel_WARN)<<"Error encountered writing vector product to <"<<m_productFilename<<">"<<endl;
+
+   return status;
+}
+
+void ossimShorelineTool::doThreshold()
+{
+   ostringstream xmsg;
+
+   // Open the index file (unless doing pan thresholding) to use as the input:
+   if (m_algorithm != PAN_THRESHOLD)
+   {
+      m_procChain = new ossimImageChain();
+      ossimRefPtr<ossimImageHandler> indexImage =
+            ossimImageHandlerRegistry::instance()->open(m_indexFilename);
+      if (!indexImage.valid())
+      {
+         xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Error encountered reading index image at <"
+               <<m_indexFilename<<">.";
+         throw ossimException(xmsg.str());
+      }
+      m_procChain->add(indexImage.get());
+   }
+
+   // Some form of auto-thresholding was specified:
+   if (m_thresholdMode != VALUE)
+      autoComputeThreshold();
+
+   // Set up threshold filter using a simple LUT remapper:
+   double del = FLT_EPSILON;
+   ossimString landValue = ossimString::toString(m_landValue).chars();
+   ossimString waterValue = ossimString::toString(m_waterValue).chars();
+   ossimString marginalValue = ossimString::toString(m_marginalValue).chars();
+   ossimString thresholdValueLo1 = ossimString::toString(m_threshold-m_tolerance, 9).chars();
+   ossimString thresholdValueLo2 = ossimString::toString(m_threshold-m_tolerance+del, 9).chars();
+   ossimString thresholdValueHi1 = ossimString::toString(m_threshold+m_tolerance, 9).chars();
+   ossimString thresholdValueHi2 = ossimString::toString(m_threshold+m_tolerance+del, 9).chars();
+   ossimKeywordlist remapper_kwl;
+   remapper_kwl.add("type", "ossimBandLutFilter");
+   remapper_kwl.add("enabled", "1");
+   remapper_kwl.add("mode", "interpolated");
+   remapper_kwl.add("scalar_type", "U8");
+   remapper_kwl.add("entry0.in", "0.0");
+   remapper_kwl.add("entry0.out", landValue.chars());
+   remapper_kwl.add("entry1.in", thresholdValueLo1.chars());
+   remapper_kwl.add("entry1.out", landValue.chars());
+   if (m_tolerance == 0)
+   {
+      remapper_kwl.add("entry2.in", thresholdValueLo2.chars());
+      remapper_kwl.add("entry2.out", waterValue.chars());
+      remapper_kwl.add("entry3.in", "1.0");
+      remapper_kwl.add("entry3.out", waterValue.chars());
+   }
+   else
+   {
+      remapper_kwl.add("entry2.in", thresholdValueLo2.chars());
+      remapper_kwl.add("entry2.out", marginalValue.chars());
+      remapper_kwl.add("entry3.in", thresholdValueHi1.chars());
+      remapper_kwl.add("entry3.out", marginalValue.chars());
+      remapper_kwl.add("entry4.in", thresholdValueHi2.chars());
+      remapper_kwl.add("entry4.out", waterValue.chars());
+      remapper_kwl.add("entry5.in", "1.0");
+      remapper_kwl.add("entry5.out", waterValue.chars());
+   }
+
+   ossimRefPtr<ossimBandLutFilter> remapper = new ossimBandLutFilter;
+   remapper->loadState(remapper_kwl);
+   m_procChain->add(remapper.get());
+
+   m_productFilename = m_threshFilename;
+   if (!ossimChipProcTool::execute())
+   {
+      xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Error encountered creating threshold image at <"
+            <<m_threshFilename<<">.";
+      throw ossimException(xmsg.str());
+   }
+}
+
+void ossimShorelineTool::autoComputeThreshold()
+{
+   // Use the K-means classifier to determine the threshold point based on the histogram clustering
+   // into two groups: land and water.
+
+   // If an input histogram was provided, use it. Otherwise compute one:
+   ossimImageHandler* handler = dynamic_cast<ossimImageHandler*>(m_procChain->getFirstSource());
+   ostringstream xmsg;
+   if (!handler)
+   {
+      xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  No input handler in procession chain.";
+      throw ossimException(xmsg.str());
+   }
+   ossimRefPtr<ossimMultiResLevelHistogram> multi_histo = handler->getImageHistogram();
+   if (!multi_histo.valid())
+   {
+      xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Could not establish an index histogram.";
+      throw ossimException(xmsg.str());
+   }
+
+   ossimRefPtr<ossimHistogram> band_histo = multi_histo->getHistogram(0);
+   if (!band_histo.valid())
+   {
+      xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  Null band histogram returned!";
+      throw ossimException(xmsg.str());
+   }
+
+   ossimRefPtr<ossimKMeansClustering> classifier = new ossimKMeansClustering;
+   //classifier->setVerbose(); // TODO: Remove verbose mode
+   classifier->setNumClusters(2);
+   classifier->setSamples(band_histo->GetVals(), band_histo->GetRes());
+   classifier->setPopulations(band_histo->GetCounts(), band_histo->GetRes());
+   if (!classifier->computeKmeans())
+   {
+      xmsg<<"ossimShorelineUtil:"<<__LINE__<<"  K-means clustering of histogram failed. Cannot "
+            "auto-compute threshold point.";
+      throw ossimException(xmsg.str());
+   }
+
+   double mean0 = classifier->getMean(0);
+   double mean1 = classifier->getMean(1);
+   double sigma0 = classifier->getSigma(0);
+   double sigma1 = classifier->getSigma(1);
+   switch (m_thresholdMode)
+   {
+   case MEAN:
+      m_threshold = (mean0 + mean1)/2.0;
+      break;
+   case SIGMA:
+      m_threshold = (sigma1*mean0 + sigma0*mean1)/(sigma0 + sigma1);
+      break;
+   case VARIANCE:
+      m_threshold = (sigma1*sigma1*mean0 + sigma0*sigma0*mean1)/(sigma0*sigma0 + sigma1*sigma1);
+      break;
+   default:
+      break;
+   }
+
+   cout.precision(8);
+   cout<<"ossimShorelineUtil::autoComputeThreshold(): Using threshold = "<<m_threshold<<endl;
+}
+
+bool ossimShorelineTool::addPropsToJSON()
+{
+   // Read existing JSON file as output by potrace:
+   Json::Value root;
+   std::ifstream jsonFile (m_vectorFilename.chars(), std::ifstream::binary);
+   if (jsonFile.fail() || jsonFile.eof())
+      return false;
+   jsonFile >> root;
+   jsonFile.close();
+
+   // Add OSSIM-specific properties:
+   Json::Value properties(Json::objectValue);
+   properties["ossim-version"] = OSSIM_VERSION;
+
+   properties["commit"] = OSSIM_REVISION;
+
+   properties["build_date"] = OSSIM_BUILD_DATE;
+
+   switch (m_algorithm)
+   {
+   case NDWI:
+      properties["algorithm"] = "NDWI";
+      break;
+   case AWEI:
+      properties["algorithm"] = "AWEI";
+      break;
+   default:
+      properties["algorithm"] = "UNKNOWN";
+   }
+
+   Json::Value  fnames(Json::arrayValue);
+   for (ossim_uint32 f=0; f<m_imgLayers.size(); f++)
+   {
+      Json::Value fname (m_imgLayers[f]->getFilename().chars());
+      fnames.append(fname);
+   }
+   properties["input_files"] = fnames;
+
+   // Add additional properties provided in the command line:
+   map<ossimString, ossimString>::iterator prop = m_geoJsonProps.begin();
+   while (prop != m_geoJsonProps.end())
+   {
+      properties[prop->first.chars()] = prop->second.chars();
+      ++prop;
+   }
+
+   Json::Value& features = root["features"];
+   int n = features.size();
+   for (int i=0; i<n; ++i)
+   {
+      Json::Value& feature = features[i];
+      Json::Value& feature_props = feature["properties"];
+      feature_props = properties;
+   }
+
+   // Output the updated JSON to the file:
+   ofstream outFile;
+   outFile.open (m_vectorFilename.chars(), ofstream::out | ofstream::trunc);
+   if (outFile.fail())
+      return false;
+
+   outFile << root;
+   outFile.close();
+
+   return true;
+}
+
+
+
diff --git a/src/util/ossimSlopeTool.cpp b/src/util/ossimSlopeTool.cpp
new file mode 100644
index 0000000..c8d6f48
--- /dev/null
+++ b/src/util/ossimSlopeTool.cpp
@@ -0,0 +1,134 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimImageViewProjectionTransform.h>
+#include <ossim/imaging/ossimSlopeFilter.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/util/ossimSlopeTool.h>
+#include <iostream>
+
+using namespace std;
+
+const char* ossimSlopeTool::DESCRIPTION  =
+      "Utility for computing the slope at each elevation post and generating "
+      "a corresponding slope image.";
+
+ossimSlopeTool::ossimSlopeTool()
+: m_recursiveCall (false)
+{
+}
+
+ossimSlopeTool::~ossimSlopeTool()
+{
+}
+
+void ossimSlopeTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add options.
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " slope [options] <output-image>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->setDescription(DESCRIPTION);
+
+   // Base class has its own:
+   ossimChipProcTool::setUsage(ap);
+}
+
+bool ossimSlopeTool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   processRemainingArgs(ap);
+   return true;
+}
+
+void ossimSlopeTool::initialize(const ossimKeywordlist& kwl)
+{
+   // Base class does the heavy work:
+   ossimChipProcTool::initialize(kwl);
+}
+
+void ossimSlopeTool::initProcessingChain()
+{
+   ostringstream key;
+
+   // Reinitialization needs to skip this method if called recursively:
+   if (m_recursiveCall)
+      return;
+
+   // Need to establish list of DEM cells given either the bounding rect or explicit DEM cells:
+   if (m_demSources.empty())
+   {
+      // Query elevation manager for cells providing needed coverage:
+      std::vector<ossimFilename> cells;
+      ossimElevManager::instance()->getCellsForBounds(m_aoiGroundRect, cells);
+
+      // Insert the list of DEM cells into the KWL as input images:
+      ossimConnectableObject::ConnectableObjectList elevChains;
+      for(ossim_uint32 idx=0; idx<cells.size(); ++idx)
+      {
+         // Add the DEM as an image source to the KWL:
+         ostringstream key;
+         key<<ossimKeywordNames::IMAGE_FILE_KW<<idx;
+         m_kwl.addPair(key.str(), cells[idx].string() );
+      }
+   }
+   else
+   {
+      // DEMs explicitly listed in keywordlist, use these:
+      for(ossim_uint32 idx=0; idx<m_demSources.size(); ++idx)
+      {
+         // Add the DEM as an image source to the KWL:
+         ostringstream key;
+         key<<ossimKeywordNames::IMAGE_FILE_KW<<idx;
+         m_kwl.addPair(key.str(), m_demSources[idx].string() );
+      }
+   }
+
+   // Remove any occurence of elev_source in the KWL:
+   ossimString regex = ossimKeywordNames::ELEVATION_SOURCE_KW;
+   regex += "*";
+   m_kwl.removeKeysThatMatch(regex);
+
+   // Reinitialize the object with the DEMs listed as input images and create a mosaic of them:
+   m_recursiveCall = true;
+   initialize(m_kwl);
+   m_recursiveCall = false;
+   ossimRefPtr<ossimImageSource> combiner = combineLayers(m_imgLayers);
+   m_procChain->add(combiner.get());
+
+   // Finally add the slope filter:
+   ossimRefPtr<ossimSlopeFilter> slope_filter = new ossimSlopeFilter;
+   slope_filter->setSlopeType(ossimSlopeFilter::NORMALIZED);
+   m_procChain->add(slope_filter.get());
+}
+
diff --git a/src/util/ossimTool.cpp b/src/util/ossimTool.cpp
new file mode 100644
index 0000000..d531462
--- /dev/null
+++ b/src/util/ossimTool.cpp
@@ -0,0 +1,192 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimTool.h>
+
+using namespace std;
+
+ossimTool::ossimTool()
+   : m_kwl(),
+     m_consoleStream (&cout),
+     m_helpRequested (false)
+{
+}
+
+ossimTool::~ossimTool()
+{
+}
+
+void ossimTool::clear()
+{
+}
+
+void ossimTool::abort()
+{
+}
+
+ossimString ossimTool::getClassName() const
+{
+   return "ossimTool";
+}
+
+void ossimTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+
+   std::string appName = ap.getApplicationName();
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   au->setApplicationName( ossimString( appName ) );
+
+   au->addCommandLineOption(
+         "--write-api <filename>",
+         "Writes a JSON API specification to the specified filename.");
+   au->addCommandLineOption(
+         "--write-template <filename>",
+         "Writes a template keyword-list to the specified filename.");
+}
+
+bool ossimTool::initialize(ossimArgumentParser& ap)
+{
+   m_helpRequested = false;
+   if (ap.read("-h") || ap.read("--help") )
+   {
+      // Write usage.
+      setUsage(ap);
+      ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+      m_helpRequested = true;
+      return true;
+   }
+
+   std::string ts1;
+   ossimArgumentParser::ossimParameter sp1(ts1);
+
+   if ( ap.read("--write-api", sp1))
+   {
+      ofstream ofs ( ts1.c_str() );
+      ossimString json_str;
+      getAPI(json_str);
+      ofs << json_str <<endl;
+      return true;
+   }
+
+   if ( ap.read("--write-template", sp1))
+   {
+      ofstream ofs ( ts1.c_str() );
+      ossimKeywordlist kwl;
+      getKwlTemplate(kwl);
+      ofs << kwl <<endl;
+      return true;
+   }
+
+   return true;
+}
+
+void ossimTool::initialize(const ossimKeywordlist& kwl)
+{
+   m_helpRequested = false;
+   m_kwl = kwl;
+}
+
+void ossimTool::initialize(const std::string& request)
+{
+   m_helpRequested = false;
+}
+
+void ossimTool::getKwlTemplate(ossimKeywordlist& kwl)
+{
+   ossimFilename share_dir = ossimPreferences::instance()->
+      preferencesKWL().findKey( std::string( "ossim_share_directory" ) );
+   ossimFilename classTemplate = "util/" + getClassName() + ".kwl";
+   ossimFilename kwl_path = share_dir.dirCat( classTemplate );
+
+   if (!kwl.addFile(kwl_path))
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimTool::getKwlTemplate() -- Could not find <"
+            <<kwl_path<<">. Ignoring"<<endl;
+   }
+}
+
+void ossimTool::getAPI(string& json) const
+{
+   ossimFilename share_dir = ossimPreferences::instance()->
+      preferencesKWL().findKey( std::string( "ossim_share_directory" ) );
+   ossimFilename classJson = "util/" + getClassName() + ".json";
+   ossimFilename json_path = share_dir.dirCat( classJson );
+
+   readTextFile(json_path, json);
+}
+
+string ossimTool::getAPI() const
+{
+   string result;
+   getAPI(result);
+   return result;
+}
+
+bool ossimTool::readTextFile(const ossimFilename& filename, string& contents) const
+{
+   contents.clear();
+
+   std::ifstream is(filename.chars());
+   if (!is)
+   {
+      ossimNotify(ossimNotifyLevel_WARN)<<"ossimTool::readTextFile() -- Could not find <"
+            <<filename<<">. Ignoring."<<endl;
+      return false;
+   }
+
+   // get length of file:
+   is.seekg (0, is.end);
+   int length = is.tellg();
+   is.seekg (0, is.beg);
+
+   // allocate memory:
+   char *buffer = new char [length];
+
+   // read data as a block:
+   is.read (buffer,length);
+   is.close();
+
+   contents.append(buffer);
+   delete [] buffer;
+
+   return true;
+}
+
+void ossimTool::getBuildDate(std::string& s) const
+{
+#ifdef OSSIM_BUILD_DATE
+   s = OSSIM_BUILD_DATE;
+#else
+   s = "unknown";
+#endif
+}
+
+void ossimTool::getRevision(std::string& s) const
+{
+#ifdef OSSIM_REVISION
+   s = OSSIM_REVISION;
+#else
+   s = "unknown";
+#endif
+}
+
+void ossimTool::getVersion(std::string& s) const
+{
+#ifdef OSSIM_VERSION
+   s = OSSIM_VERSION;
+#else
+   s = "unknown";
+#endif
+}
+
diff --git a/src/util/ossimToolFactory.cpp b/src/util/ossimToolFactory.cpp
new file mode 100644
index 0000000..e8b46a3
--- /dev/null
+++ b/src/util/ossimToolFactory.cpp
@@ -0,0 +1,119 @@
+//**************************************************************************************************
+//
+//     OSSIM Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/util/ossimBandMergeTool.h>
+#include <ossim/util/ossimHillshadeTool.h>
+#include <ossim/util/ossimHlzTool.h>
+#include <ossim/util/ossimInfo.h>
+#include <ossim/util/ossimOrthoTool.h>
+#include <ossim/util/ossimShorelineTool.h>
+#include <ossim/util/ossimSlopeTool.h>
+#include <ossim/util/ossimToolFactory.h>
+#include <ossim/util/ossimToolRegistry.h>
+#include <ossim/util/ossimVerticesFinderTool.h>
+#include <ossim/util/ossimViewshedTool.h>
+#if OSSIM_HAS_HDF5
+#include <ossim/hdf5/ossimHdf5Tool.h>
+#endif
+
+ossimToolFactory* ossimToolFactory::s_Instance = 0;
+
+ossimToolFactory* ossimToolFactory::instance()
+{
+   if (!s_Instance)
+      s_Instance = new ossimToolFactory;
+   return s_Instance;
+}
+
+ossimToolFactory::ossimToolFactory()
+{
+}
+
+ossimToolFactory::~ossimToolFactory()
+{
+   ossimToolRegistry::instance()->unregisterFactory(this);
+}
+
+ossimTool* ossimToolFactory::createTool(const std::string& argName) const
+{
+   ossimString utilName (argName);
+   utilName.downcase();
+
+   if ((utilName == "info") || (argName == "ossimInfo"))
+      return new ossimInfo;
+
+   if ((utilName == "hillshade") || (argName == "ossimHillshadeTool"))
+      return new ossimHillshadeTool;
+
+   if ((utilName == "viewshed") || (argName == "ossimViewshedTool"))
+      return new ossimViewshedTool;
+
+   if ((utilName == "slope") || (argName == "ossimSlopeTool"))
+      return new ossimSlopeTool;
+
+   if ((utilName == "hlz") || (argName == "ossimHlzTool"))
+      return new ossimHlzTool;
+
+   if ((utilName == "shoreline") || (argName == "ossimShorelineTool"))
+      return new ossimShorelineTool;
+
+   if ((utilName == "ortho") || (argName == "ossimOrthoTool"))
+      return new ossimOrthoTool;
+
+   if ((utilName == "vertices") || (argName == "ossimVerticesFinderTool"))
+      return new ossimVerticesFinderTool;
+
+   if ((utilName == "bandmerge") || (argName == "ossimBandMergeTool"))
+      return new ossimBandMergeTool;
+
+#if OSSIM_HAS_HDF5
+   if ((utilName == "hdf5") || (argName == "ossimHdf5Tool"))
+      return new ossimHdf5Tool;
+#endif
+
+   return 0;
+}
+
+void ossimToolFactory::getCapabilities(std::map<std::string, std::string>& capabilities) const
+{
+   capabilities.insert(pair<string, string>("info", ossimInfo::DESCRIPTION));
+   capabilities.insert(pair<string, string>("hillshade", ossimHillshadeTool::DESCRIPTION));
+   capabilities.insert(pair<string, string>("viewshed", ossimViewshedTool::DESCRIPTION));
+   capabilities.insert(pair<string, string>("slope", ossimSlopeTool::DESCRIPTION));
+   capabilities.insert(pair<string, string>("hlz", ossimHlzTool::DESCRIPTION));
+   capabilities.insert(pair<string, string>("shoreline", ossimShorelineTool::DESCRIPTION));
+   capabilities.insert(pair<string, string>("ortho", ossimOrthoTool::DESCRIPTION));
+   capabilities.insert(pair<string, string>("vertices", ossimVerticesFinderTool::DESCRIPTION));
+   capabilities.insert(pair<string, string>("bandmerge", ossimBandMergeTool::DESCRIPTION));
+#if OSSIM_HAS_HDF5
+   capabilities.insert(pair<string, string>("hdf5", ossimHdf5Tool::DESCRIPTION));
+#endif
+}
+
+std::map<std::string, std::string> ossimToolFactory::getCapabilities() const
+{
+   std::map<std::string, std::string> result;
+   getCapabilities(result);
+   return result;
+}
+
+void ossimToolFactory::getTypeNameList(vector<ossimString>& typeList) const
+{
+   typeList.push_back("ossimInfo");
+   typeList.push_back("ossimHillshadeUtil");
+   typeList.push_back("ossimViewshedUtil");
+   typeList.push_back("ossimSlopeUtil");
+   typeList.push_back("ossimHLZUtil");
+   typeList.push_back("ossimShorelineUtil");
+   typeList.push_back("ossimOrthoUtil");
+   typeList.push_back("ossimVerticesFinderUtil");
+   typeList.push_back("ossimBandMergeUtil");
+#if OSSIM_HAS_HDF5
+   typeList.push_back("ossimHdf5Tool");
+#endif
+}
+
diff --git a/src/util/ossimToolRegistry.cpp b/src/util/ossimToolRegistry.cpp
new file mode 100644
index 0000000..13e18c6
--- /dev/null
+++ b/src/util/ossimToolRegistry.cpp
@@ -0,0 +1,81 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/util/ossimToolFactory.h>
+#include <ossim/util/ossimToolRegistry.h>
+
+using namespace std;
+
+ossimToolRegistry* ossimToolRegistry::s_instance = 0;
+
+ossimToolRegistry* ossimToolRegistry::instance()
+{
+   if (!s_instance)
+      s_instance = new ossimToolRegistry;
+   return s_instance;
+}
+
+ossimToolRegistry::ossimToolRegistry()
+{
+   registerFactory(ossimToolFactory::instance(), true);
+}
+
+ossimToolRegistry::~ossimToolRegistry()
+{
+
+}
+
+bool ossimToolRegistry::initialize()
+{
+   return false;
+}
+
+void ossimToolRegistry::getCapabilities(map<string, string>& capabilities) const
+{
+   capabilities.clear();
+   ossimString name, descr;
+
+   // Loop over all factories and get capabilities which is list of (name, descr) pairs for all
+   // registered operations:
+   vector<ossimToolFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   while (iter != m_factoryList.end())
+   {
+      (*iter)->getCapabilities(capabilities);
+      ++iter;
+   }
+}
+
+std::map<std::string, std::string> ossimToolRegistry::getCapabilities() const
+{
+   std::map<std::string, std::string> result;
+   getCapabilities(result);
+   return result;
+}
+
+ossimTool* ossimToolRegistry::createTool(const std::string& argName) const
+{
+   ossimTool* result = 0;
+   vector<ossimToolFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   while ((iter != m_factoryList.end()) && (!result))
+   {
+      result = (*iter)->createTool(argName);
+      ++iter;
+   }
+   return result;
+}
+
+void ossimToolRegistry::getTypeNameList(vector<ossimString>& typeList) const
+{
+   typeList.clear();
+   vector<ossimToolFactoryBase*>::const_iterator iter = m_factoryList.begin();
+   while (iter != m_factoryList.end())
+   {
+      (*iter)->getTypeNameList(typeList);
+      ++iter;
+   }
+}
+
diff --git a/src/util/ossimVerticesFinderTool.cpp b/src/util/ossimVerticesFinderTool.cpp
new file mode 100644
index 0000000..f542b6d
--- /dev/null
+++ b/src/util/ossimVerticesFinderTool.cpp
@@ -0,0 +1,171 @@
+//**************************************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//**************************************************************************************************
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimVertexExtractor.h>
+#include <ossim/util/ossimVerticesFinderTool.h>
+#include <iostream>
+
+using namespace std;
+
+const char* ossimVerticesFinderTool::DESCRIPTION  =
+      "Utility for determining the active image corner vertices inside larger null-filled image "
+      "rectangle.";
+
+ossimVerticesFinderTool::ossimVerticesFinderTool()
+:  m_entryIndex (0)
+{
+}
+
+ossimVerticesFinderTool::~ossimVerticesFinderTool()
+{
+}
+
+void ossimVerticesFinderTool::setUsage(ossimArgumentParser& ap)
+{
+   // Add options.
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " vertices [options] <input-image> [<output-vertices.kwl>]";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->setDescription(DESCRIPTION);
+
+   // Base class has its own:
+   ossimTool::setUsage(ap);
+
+   au->addCommandLineOption("-e or --entry",
+                            "<entry> For multi image handlers which entry do you wish to extract. "
+                            "For list of entries use: \"ossim-info -i <your_image>\" ");
+}
+
+bool ossimVerticesFinderTool::initialize(ossimArgumentParser& ap)
+{
+   if (!ossimTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   std::string tempString1;
+   ossimArgumentParser::ossimParameter stringParam1(tempString1);
+
+   if ( ap.read("-e", stringParam1) || ap.read("--entry", stringParam1) )
+      m_kwl.addPair( std::string(ossimKeywordNames::ENTRY_KW), tempString1 );
+
+   cout<<ap.argc()<<endl;//TODO:REMOVE
+
+   if ( ap.argc() > 1 )
+   {
+      m_kwl.add( ossimKeywordNames::IMAGE_FILE_KW, ap[1]);
+      ap.remove(1);
+   }
+   if ( ap.argc() > 1 )
+   {
+      m_kwl.add( ossimKeywordNames::OUTPUT_FILE_KW, ap[1]);
+      ap.remove(1);
+   }
+   if ( ap.argc() > 1 )
+   {
+      ossimNotify(ossimNotifyLevel_NOTICE)<<"ossimVerticesFinderUtil:"<<__LINE__<<" Too many "
+            "arguments provided on command line. Ignoring superfluous entries.";
+   }
+
+   initialize(m_kwl);
+   return true;
+}
+
+void ossimVerticesFinderTool::initialize(const ossimKeywordlist& kwl)
+{
+   ostringstream errMsg;
+
+   // Don't copy KWL if member KWL passed in:
+   if (&kwl != &m_kwl)
+   {
+      // Start with clean options keyword list.
+      m_kwl.clear();
+      m_kwl.addList( kwl, true );
+   }
+
+   m_inputFile  = m_kwl.find( ossimKeywordNames::IMAGE_FILE_KW);
+
+   m_outputFile = m_kwl.find( ossimKeywordNames::OUTPUT_FILE_KW);
+
+   ossimString value = m_kwl.find( ossimKeywordNames::ENTRY_KW);
+   if (!value.empty())
+      m_entryIndex = value.toUInt32();
+
+   // See if an LUT is requested:
+   if (m_inputFile.empty() || !m_inputFile.isReadable())
+   {
+      errMsg<<"ERROR ossimVerticesFinderUtil:"<<__LINE__<<"  Input filename was not provided or "
+            " file <"<<m_inputFile <<"> is not readable. "<<ends;
+      throw ossimException(errMsg.str());
+   }
+
+   if (m_outputFile.empty())
+   {
+      m_outputFile = m_inputFile.path();
+      m_outputFile = m_outputFile.dirCat(m_inputFile.fileNoExtension());
+      m_outputFile += "_vertices.kwl";
+   }
+}
+
+bool ossimVerticesFinderTool::execute()
+{
+   if (m_helpRequested)
+      return true;
+
+   ostringstream errMsg;
+
+   // Get an image handler for the input file.
+   ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(m_inputFile);
+   if (ih.valid())
+   {
+      ih->setCurrentEntry(m_entryIndex);
+   }
+   else
+   {
+      errMsg<<"ERROR ossimVerticesFinderUtil:"<<__LINE__<<"  Unsupported image file format for <"
+            << m_inputFile<<">. Cannot open file.";
+      throw ossimException(errMsg.str());
+   }
+
+   // Give the image handler to the vertex extractor as an input source.
+   ossimRefPtr<ossimVertexExtractor> ve = new ossimVertexExtractor(ih.get());
+
+   // Set the file name.
+   ve->setOutputName(m_outputFile);
+
+   // Set the area of interest to the full bounding rect of the source.
+   ve->setAreaOfInterest(ih->getBoundingRect(0));
+
+   // Add a listener for the percent complete to standard output.
+   ossimStdOutProgress prog(0, true);
+   ve->addListener(&prog);
+
+   // Start the extraction...
+   bool success = ve->execute();
+   return success;
+}
+
+
+void ossimVerticesFinderTool::getKwlTemplate(ossimKeywordlist& kwl)
+{
+   kwl.add(ossimKeywordNames::ENTRY_KW, "<sub-image entry index>");
+   kwl.add(ossimKeywordNames::IMAGE_FILE_KW, "<input-raster-file>");
+   kwl.add(ossimKeywordNames::OUTPUT_FILE_KW, "<output-vertices-file>");
+}
+
diff --git a/src/util/ossimViewshedTool.cpp b/src/util/ossimViewshedTool.cpp
new file mode 100644
index 0000000..2771a60
--- /dev/null
+++ b/src/util/ossimViewshedTool.cpp
@@ -0,0 +1,1057 @@
+//*****************************************************************************
+//
+//     OSSIM Open Source Geospatial Data Processing Library
+//     See top level LICENSE.txt file for license information
+//
+//*****************************************************************************
+
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimPolygon.h>
+#include <ossim/base/ossimRtti.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossim2dTo2dShiftTransform.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimPreferences.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/elevation/ossimImageElevationDatabase.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/util/ossimViewshedTool.h>
+
+using namespace std;
+
+const char* ossimViewshedTool::DESCRIPTION =
+      "Computes bitmap image representing the viewshed from specified location using only "
+      "DEM information.";
+static const string FOV_KW               = "fov";
+static const string HEIGHT_OF_EYE_KW     = "height_of_eye";
+static const string HORIZON_FILE_KW      = "horizon_file";
+static const string OBSERVER_KW          = "observer";
+static const string VISIBILITY_RADIUS_KW = "visibility_radius";
+static const string RETICLE_SIZE_KW      = "reticle_size";
+static const string VIEWSHED_CODING_KW   = "viewshed_coding";
+static const string AOI_SIZE_METERS_KW   = "aoi_size_meters";
+
+ossimViewshedTool::ossimViewshedTool()
+:   m_obsHgtAbvTer (1.5),
+    m_visRadius (0.0),
+    m_radials (0),
+    m_obsInsideAoi (true),
+    m_displayAsRadar (false),
+    m_halfWindow (0),
+    m_outBuffer (NULL),
+    m_visibleValue (1),
+    m_hiddenValue (128),
+    m_overlayValue (255),
+    m_reticleSize(25),
+    m_simulation (false),
+    m_numThreads(1),
+    m_startFov(0),
+    m_stopFov(0),
+    m_threadBySector(false),
+    d_accumT(0)
+{
+   m_observerGpt.makeNan();
+}
+
+ossimViewshedTool::~ossimViewshedTool()
+{
+   if (m_radials)
+   {
+      for (int i=0; i<4; ++i)
+         delete [] m_radials[i];
+      delete [] m_radials;
+   }
+}
+
+void ossimViewshedTool::setUsage(ossimArgumentParser& ap)
+{
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString appName = ap.getApplicationName();
+   ossimString usageString = appName;
+   usageString += " viewshed [options] <obs_lat> <obs_lon> <output-image>";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->addCommandLineOption(
+         "--fov <start> <end>", "Optional arguments specifying the field-of"
+         "-view boundary azimuths (in degrees). By default, a 360 deg FOV is"
+         " computed. The arc is taken clockwise from start to end, so for a"
+         " FOV of 225 deg from W, through N to SE, start=270 and end=135");
+   au->addCommandLineOption(
+         "--height-of-eye <meters>", "Specifies the observers height-of-eye above the "
+         "terrain in meters. Defaults to 1.5 m.");
+   au->addCommandLineOption(
+         "--horizon <filename>", "Experimental. Outputs the max elevation angles "
+         "for all azimuths to <filename>, for horizon profiling.");
+   au->addCommandLineOption(
+         "--radius <meters>", "Specifies max visibility in meters. Required "
+         "unless --size is specified. This option constrains output to a circle, "
+         "similar to a radar display");
+   au->addCommandLineOption(
+         "--reticle <int>", "Specifies the size of the reticle at the observer"
+         "location in pixels from the center (i.e., the radius of the reticle). "
+         "Defaults to 2. A value of 0 hides the reticle. See --values option for "
+         "setting reticle color.");
+   au->addCommandLineOption(
+         "--simulation", "For engineering/debug purposes ");
+   au->addCommandLineOption(
+         "--tbs", "\"Thread By Sector\". For engineering/debug purposes ");
+   au->addCommandLineOption(
+         "--threads <n>", "Number of threads. Defaults to use all available cores. "
+         "For engineering/debug purposes ");
+   au->addCommandLineOption(
+         "--viewshed-coding <int int int>", "Specifies the pixel values (0-255) for the visible,"
+         " hidden and overlay pixels, respectively. Defaults to visible=null (0), "
+         "hidden=128, and overlay (observer position, reticle, and circumference) is "
+         "highlighted with 255.");
+
+   // Base class has its own:
+   ossimChipProcTool::setUsage(ap);
+
+   ostringstream description;
+   description << DESCRIPTION << "\n\nExamples:\n\n"
+         "    "<<appName<<" viewshed --radius 50  28.0 -80.5 output-hlz.tif\n"
+         "\nAn alternate command line provides switch for observer lat and lon:\n\n"
+         "    "<<appName<<" viewshed --rlz 25 --observer 28.0 -80.5  output-hlz.tif \n";
+   au->setDescription(description.str());
+}
+
+bool ossimViewshedTool::initialize(ossimArgumentParser& ap)
+{
+   ostringstream xmsg;
+   xmsg<<"ossimViewshedUtil::initialize(ossimArgumentParser) -- ";
+
+   int numArgsExpected = 4;
+
+   // Base class first:
+   if (!ossimChipProcTool::initialize(ap))
+      return false;
+   if (m_helpRequested)
+      return true;
+
+   string ts1;
+   ossimArgumentParser::ossimParameter sp1(ts1);
+   string ts2;
+   ossimArgumentParser::ossimParameter sp2(ts2);
+   string ts3;
+   ossimArgumentParser::ossimParameter sp3(ts3);
+
+   if ( ap.read("--fov", sp1, sp2) )
+   {
+      double startFov = ossimString(ts1).toDouble();
+      if (startFov < 0)
+         startFov += 360.0;
+      ostringstream value;
+      value<<startFov<<" "<<ts2;
+      m_kwl.addPair( FOV_KW, value.str() );
+   }
+
+   if ( ap.read("--hgt-of-eye", sp1) || ap.read("--height-of-eye", sp1) )
+      m_kwl.addPair( HEIGHT_OF_EYE_KW, ts1 );
+
+   if ( ap.read("--horizon", sp1) || ap.read("--horizon-file", sp1))
+      m_kwl.addPair( HORIZON_FILE_KW, ts1 );
+
+   if ( ap.read("--observer", sp1, sp2) )
+   {
+      ostringstream value;
+      value<<ts1<<" "<<ts2;
+      m_kwl.addPair( OBSERVER_KW, value.str() );
+      numArgsExpected -= 2;
+   }
+
+   if ( ap.read("--radius", sp1) )
+      m_kwl.addPair( VISIBILITY_RADIUS_KW, ts1 );
+
+   if ( ap.read("--reticle", sp1) )
+      m_kwl.addPair( RETICLE_SIZE_KW, ts1 );
+
+   if ( ap.read("--values", sp1, sp2, sp3) || ap.read("--viewshed-coding", sp1, sp2, sp3))
+   {
+      ostringstream value;
+      value<<ts1<<" "<<ts2<<" "<<ts3;
+      m_kwl.addPair( VIEWSHED_CODING_KW, value.str() );
+   }
+
+   // The remaining options are available only via command line (i.e., no KWL entries defined)
+   if ( ap.read("--tbs") )
+      m_threadBySector = true;
+
+   if ( ap.read("--simulation") )
+      m_simulation = true;
+
+   if ( ap.read("--threads", sp1) )
+      m_numThreads = ossimString(ts1).toUInt32();
+
+   if ( ap.argc() < numArgsExpected )
+   {
+      xmsg<<"Expecting more arguments.";
+      throw(ossimException(xmsg.str()));
+   }
+   else
+   {
+      ossimString latstr = ap[1];
+      ossimString lonstr = ap[2];
+      ostringstream value;
+      value<<latstr<<" "<<lonstr;
+      m_kwl.addPair( OBSERVER_KW, value.str() );
+      ap.remove(1,2);
+      processRemainingArgs(ap);
+   }
+
+   return true;
+}
+
+void ossimViewshedTool::initialize(const ossimKeywordlist& kwl)
+{
+   ossimString value;
+
+   value = kwl.findKey(FOV_KW);
+   if (!value.empty())
+   {
+      vector <ossimString> coordstr;
+      value.split(coordstr, ossimString(" ,"), false);
+      if (coordstr.size() == 2)
+      {
+         m_startFov = coordstr[0].toDouble();
+         m_stopFov = coordstr[1].toDouble();
+         if (m_startFov < 0)
+            m_startFov += 360.0;
+      }
+   }
+
+   value = kwl.findKey(HEIGHT_OF_EYE_KW);
+   if (!value.empty())
+      m_obsHgtAbvTer = value.toDouble();
+
+   m_horizonFile = kwl.findKey(HORIZON_FILE_KW);
+
+   value = kwl.findKey(OBSERVER_KW);
+   if (!value.empty())
+   {
+      vector <ossimString> coordstr;
+      value.split(coordstr, ossimString(" ,"), false);
+      if (coordstr.size() == 2)
+      {
+         m_observerGpt.lat = coordstr[0].toDouble();
+         m_observerGpt.lon = coordstr[1].toDouble();
+         m_observerGpt.hgt = 0.0;
+      }
+   }
+
+   value = kwl.findKey(RETICLE_SIZE_KW);
+   if (!value.empty())
+      m_reticleSize = value.toInt32();
+
+   value = kwl.findKey(VIEWSHED_CODING_KW);
+   if (!value.empty())
+   {
+      vector <ossimString> coordstr;
+      value.split(coordstr, ossimString(" ,"), false);
+      if (coordstr.size() == 3)
+      {
+         m_visibleValue = coordstr[0].toUInt8();
+         m_hiddenValue = coordstr[1].toUInt8();
+         m_overlayValue = coordstr[2].toUInt8();
+      }
+   }
+
+   value = kwl.findKey(VISIBILITY_RADIUS_KW);
+   if (!value.empty())
+   {
+      m_visRadius = value.toDouble();
+      m_displayAsRadar = true;
+   }
+
+   // If running simulation, clear out all pre-loaded elevation databases:
+   if (m_simulation)
+   {
+      ossimElevManager::instance()->clear();
+      ossimElevManager::instance()->setUseGeoidIfNullFlag(false);
+   }
+
+   // Base class does most work:
+   ossimChipProcTool::initialize(kwl);
+}
+
+void ossimViewshedTool::clear()
+{
+   m_observerGpt.makeNan();
+   m_visRadius = 0;
+   m_outBuffer = 0;
+   m_horizonMap.clear();
+   m_jobMtQueue = 0;
+   ossimChipProcTool::clear();
+}
+
+void ossimViewshedTool::initializeProjectionGsd()
+{
+   // First try normal base class initialization. If that doesn't work, then probably no DEM
+   // or input images were provided, so need to use elev manager resoltion at observer point.
+
+   ossimChipProcTool::initializeProjectionGsd();
+   if (!m_gsd.hasNans() || m_observerGpt.hasNans())
+      return;
+
+   ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>(m_geom->getProjection());
+   if (!proj)
+      return;
+
+   ossimElevManager* elevMgr = ossimElevManager::instance();
+   elevMgr->getHeightAboveEllipsoid(m_observerGpt);
+   m_gsd.x = m_gsd.y = ossimElevManager::instance()->getMeanSpacingMeters();
+   if (m_geoScaled)
+      proj->setOrigin(m_observerGpt);
+   proj->setMetersPerPixel(m_gsd);
+}
+
+void ossimViewshedTool::initializeAOI()
+{
+   ossimChipProcTool::initializeAOI();
+   if (!m_aoiGroundRect.hasNans())
+   {
+      // AOI established by base class, nothing to do except take this opportunity to set the
+      // observer location to AOI center if not already defined:
+      if (m_observerGpt.hasNans())
+         m_observerGpt = m_aoiGroundRect.midPoint();
+      return;
+   }
+
+   // Not enough info available to base class to determine AOI, maybe can determine from observer
+   // position and radius:
+   if ((m_visRadius == 0) && m_kwl.hasKey(AOI_SIZE_METERS_KW))
+   {
+      ossimString lookup = m_kwl.findKey( AOI_SIZE_METERS_KW );
+      lookup.trim();
+      m_visRadius = 0.5*(lookup.before(" ").toDouble() + lookup.after(" ").toDouble());
+      m_displayAsRadar = true;
+   }
+   if (m_observerGpt.hasNans())
+      findCenterGpt(m_observerGpt);
+
+   if ((m_visRadius != 0) && !m_observerGpt.hasNans())
+   {
+      ossimMapProjection* proj = dynamic_cast<ossimMapProjection*>(m_geom->getProjection());
+      if (!proj)
+         return;
+
+      ossimDpt metersPerDegree (m_observerGpt.metersPerDegree());
+      double dlat = m_visRadius/metersPerDegree.y;
+      double dlon = m_visRadius/metersPerDegree.x;
+      ossimGpt ulg (m_observerGpt.lat + dlat, m_observerGpt.lon - dlon);
+      ossimGpt lrg (m_observerGpt.lat - dlat, m_observerGpt.lon + dlon);
+
+      m_aoiGroundRect = ossimGrect(ulg, lrg);
+      proj->setUlTiePoints(ulg);
+
+      computeAdjustedViewFromGrect();
+   }
+}
+
+void ossimViewshedTool::initProcessingChain()
+{
+   ostringstream xmsg;
+
+   if (m_observerGpt.hasNans())
+   {
+      xmsg<<"ossimViewshedUtil:"<<__LINE__<<" Observer ground position has not been set."<<ends;
+      throw ossimException(xmsg.str());
+   }
+
+   ossimElevManager* elevMgr = ossimElevManager::instance();
+
+   // Initialize the height of eye component of observer position:
+   m_observerGpt.hgt = elevMgr->getHeightAboveEllipsoid(m_observerGpt);
+   m_observerGpt.hgt += m_obsHgtAbvTer;
+   m_geom->worldToLocal(m_observerGpt, m_observerVpt);
+
+   ossimRefPtr<ossimMapProjection> mapProj =
+         dynamic_cast<ossimMapProjection*>(m_geom->getProjection());
+
+   // If no radius specified, need to compute R large enough to cover the requested AOI:
+   if (m_visRadius == 0)
+      computeRadius();
+   if (m_halfWindow == 0)
+      m_halfWindow = ossim::round<ossim_int32, double>(m_visRadius/m_gsd.x);
+   ossim_uint32 size = 2*m_halfWindow + 1;
+
+   // If no AOI defined, just use the visibility rectangle:
+   ossimIrect visRect (ossimIpt(m_observerVpt), size, size);
+   if (m_aoiViewRect.hasNans())
+   {
+      m_aoiViewRect = visRect;
+      m_geom->localToWorld(ossimDrect(m_aoiViewRect), m_aoiGroundRect);
+      m_geom->setImageSize(m_aoiViewRect.size());
+   }
+
+   // Allocate the output image buffer:
+   ossimIrect bufViewRect = visRect.clipToRect(m_aoiViewRect);
+   if (bufViewRect.area() == 0)
+   {
+      xmsg<<"ossimViewshedUtil:"<<__LINE__<<" The requested AOI rect is outside the visibility range." << ends;
+      throw ossimException(xmsg.str());
+   }
+   m_outBuffer = ossimImageDataFactory::instance()->
+         create(0, OSSIM_UINT8, 1, m_aoiViewRect.width(), m_aoiViewRect.height());
+   if(!m_outBuffer.valid())
+   {
+      xmsg<<"ossimViewshedUtil:"<<__LINE__<<" Output buffer allocation failed." << ends;
+      throw ossimException(xmsg.str());
+   }
+   m_outBuffer->setImageRectangle(m_aoiViewRect);
+
+   // The processing chain for this class is simply a memory source containing the output buffer:
+   m_memSource = new ossimMemoryImageSource;
+   m_memSource->setImage(m_outBuffer);
+   m_memSource->setImageGeometry(m_geom.get());
+
+   // If input image(s) provided, need to combine them with the product:
+   if (m_imgLayers.empty())
+   {
+      m_procChain->add(m_memSource.get());
+   }
+   else
+   {
+      ossimRefPtr<ossimImageSource> combiner = combineLayers(m_imgLayers);
+      combiner->connectMyInputTo(m_memSource.get());
+      m_procChain->add(combiner.get());
+   }
+}
+
+ossimRefPtr<ossimImageData> ossimViewshedTool::getChip(const ossimIrect& bounding_irect)
+{
+   cerr<<"ossimViewshedUtil:"<<__LINE__<<endl;//TODO:remove debug
+   ostringstream xmsg;
+   if (!m_geom.valid())
+      return 0;
+
+   cerr<<"ossimViewshedUtil:"<<__LINE__<<endl;//TODO:remove debug
+   m_aoiViewRect = bounding_irect;
+   m_geom->setImageSize( m_aoiViewRect.size() );
+   m_geom->localToWorld(m_aoiViewRect, m_aoiGroundRect);
+
+   cerr<<"ossimViewshedUtil:"<<__LINE__<<endl;//TODO:remove debug
+   if (computeViewshed())
+   {
+      // The memory source has been populated, now do the getTile on the full chain to pick up
+      // other filters inserted after the memsource:
+      return m_procChain->getTile( m_aoiViewRect, 0 );
+   }
+   // else:
+   return 0;
+}
+
+bool ossimViewshedTool::execute()
+{
+   if (m_helpRequested)
+      return true;
+
+   if (!computeViewshed())
+      return false;
+
+   if (!m_horizonFile.empty() && writeHorizonProfile())
+      ossimNotify(ossimNotifyLevel_INFO) << "Wrote horizon profile to <"<<m_horizonFile<<">" <<endl;
+
+   return ossimChipProcTool::execute();
+}
+
+bool ossimViewshedTool::computeViewshed()
+{
+   // Allocate the output image buffer:
+   m_outBuffer = ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, m_aoiViewRect.width(),
+                                                           m_aoiViewRect.height());
+   cerr<<"ossimViewshedUtil:"<<__LINE__<<endl;//TODO:remove debug
+   ostringstream xmsg;
+   if (!m_outBuffer.valid() || !m_memSource.valid())
+   {
+      xmsg<<"ossimViewshedUtil:"<<__LINE__<<"  Error encountered allocating output image buffer.";
+      throw ossimException(xmsg.str());
+   }
+
+   // Initialize the image with all points hidden:
+   m_outBuffer->initialize();
+   m_outBuffer->setImageRectangle(m_aoiViewRect);
+   m_outBuffer->fill(m_procChain->getNullPixelValue());
+   m_memSource->setImage(m_outBuffer);
+
+   // Initialize the radials after intersecting the requested FOV with the FOV required to see the
+   // full AOI (not applicable if observer inside AOI). Skip radial init if no intersection found:
+   if (!optimizeFOV())
+      return false;
+   initRadials();
+
+   // The viewshed process necessarily first fills the output buffer with the complete result before
+   // the writer requests a tile. Control is passed later to the base class execute() for writing.
+   d_accumT = 0;
+
+   if (m_numThreads == 0)
+      m_numThreads = ossim::getNumberOfThreads();
+
+   if (m_numThreads > 1)
+   {
+      ossimRefPtr<ossimJobQueue> jobQueue = new ossimJobQueue();
+      for (int sector=0; sector<8; ++sector)
+      {
+         if (m_radials[sector] == 0)
+            continue;
+
+         if (m_threadBySector)
+         {
+            SectorProcessorJob* job = new SectorProcessorJob(this, sector, m_halfWindow);
+            jobQueue->add(job, false);
+         }
+         else
+         {
+            for (ossim_uint32 r=0; r<=m_halfWindow; ++r)
+            {
+               RadialProcessorJob* job = new RadialProcessorJob(this, sector, r, m_halfWindow);
+               jobQueue->add(job, false);
+            }
+         }
+         if (needsAborting())
+            return 0;
+      }
+
+      ossimNotify(ossimNotifyLevel_INFO) << "\nSubmitting "<<jobQueue->size()<<" jobs..."<<endl;
+      m_jobMtQueue = new ossimJobMultiThreadQueue(jobQueue.get(), m_numThreads);
+
+      // Wait until all radials have been processed before proceeding:
+      ossimNotify(ossimNotifyLevel_INFO) << "Waiting for job threads to finish..."<<endl;
+      while (m_jobMtQueue->hasJobsToProcess() || m_jobMtQueue->numberOfBusyThreads())
+         OpenThreads::Thread::microSleep(250);
+   }
+   else
+   {
+      // Unthreaded processing:
+      ossimNotify(ossimNotifyLevel_INFO) << "\nProcessing radials (non-threaded)..."<<endl;
+
+      // Loop over pixels in layer for each sector:
+      for (int sector=0; sector<8; ++sector)
+      {
+         if (m_radials[sector] == 0)
+            continue;
+
+         SectorProcessorJob spj (this, sector, m_halfWindow);
+         spj.start();
+
+         if (needsAborting())
+            return false;
+
+      } // end loop over sectors
+   }
+
+   ossimNotify(ossimNotifyLevel_INFO) << "Finished processing radials."<<endl;
+   paintReticle();
+
+   return true;
+}
+
+bool ossimViewshedTool::optimizeFOV()
+{
+   bool intersects = false;
+
+   // If the observer position lies outside of the requested AOI, we can reduce the search arc:
+   if (m_aoiGroundRect.pointWithin(m_observerGpt))
+      return true;
+
+   // Determine cardinal region (N, NE, E, ...) of observer relative to AOI:
+   enum CardinalDirections { N=1, S=2, E=4, W=8, NE=5, NW=9, SE=6, SW=10 };
+   int direction = 0;
+   if (m_observerGpt.lat > m_aoiGroundRect.ul().lat)
+      direction = (int) N;
+   else if (m_observerGpt.lat < m_aoiGroundRect.ll().lat)
+      direction = (int) S;
+   if (m_observerGpt.lon < m_aoiGroundRect.ul().lon)
+      direction += (int) W;
+   else if (m_observerGpt.lon > m_aoiGroundRect.ur().lon)
+      direction += (int) E;
+
+   // Calculate start and stop FOV depending on region:
+   double start, stop;
+   switch ((CardinalDirections) direction)
+   {
+   case N:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.ur());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.ul());
+      break;
+   case NE:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.lr());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.ul());
+      break;
+   case E:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.lr());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.ur());
+      break;
+   case SE:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.ll());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.ur());
+      break;
+   case S:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.ll());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.lr());
+      break;
+   case SW:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.ul());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.lr());
+      break;
+   case W:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.ul());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.ll());
+      break;
+   case NW:
+      start = m_observerGpt.azimuthTo(m_aoiGroundRect.ur());
+      stop  = m_observerGpt.azimuthTo(m_aoiGroundRect.ll());
+      break;
+   }
+
+   // Now need to intersect this arc with the requested FOV:
+   if (m_startFov == m_stopFov)
+   {
+      // There was no requested FOV (i.e, FOV = 360). So use the optimized FOV straight away:
+      m_startFov = start;
+      m_stopFov  = stop;
+      intersects = true;
+   }
+   else
+   {
+      // Pick m_startFov as reference, and make sure all others are greater:
+      double a1 = m_stopFov;
+      double a2 = start;
+      double a3 = stop;
+      if (m_startFov > m_stopFov)
+         a1 += 360;
+      if (m_startFov > start)
+         a2 += 360;
+      if (m_startFov > stop)
+         a3 += 360;
+
+      // Map to sort remaining azimuths by increasing angle clockwise:
+      map<double, int> angle_map;
+      angle_map.insert(pair<double, int>(a1, 1));
+      angle_map.insert(pair<double, int>(a2, 2));
+      angle_map.insert(pair<double, int>(a3, 3));
+
+      map<double, int>::iterator iter = angle_map.begin();
+      if (iter->second == 1)
+      {
+         ++iter;
+         if (iter->second == 3)
+            intersects = true;
+      }
+      else if (iter->second == 2)
+      {
+         m_startFov = start;
+         intersects = true;
+         ++iter;
+         if (iter->second == 3)
+            m_stopFov = stop;
+      }
+      else
+      {
+         intersects = true;
+         m_stopFov = stop;
+      }
+   }
+
+   if (!intersects)
+   {
+      ossimNotify(ossimNotifyLevel_INFO)<<
+            "ossimViewshedUtil::optimizeFOV() -- No FOV intersection found. Nothing to do."<<endl;
+   }
+   else
+   {
+      ossimNotify(ossimNotifyLevel_INFO)<<"ossimViewshedUtil::optimizeFOV() -- "
+            "The start and stop FOV azimuths have been optimized to "<<m_startFov<<" -> "
+            <<m_stopFov<<" deg."<<endl;
+   }
+
+   return intersects;
+}
+
+void ossimViewshedTool::computeRadius()
+{
+   ostringstream xmsg ("ossimViewshedUtil::computeRadius() -- ");
+
+   // AOI is required for computing R
+   if (m_aoiViewRect.hasNans())
+   {
+      xmsg<<"AOI undefined. Cannot compute visibility radius." << ends;
+      throw ossimException(xmsg.str());
+   }
+
+   // Compute distance from observer to farthest corner of AOI. This is the radius
+   m_visRadius= m_observerGpt.distanceTo(m_aoiGroundRect.ul());
+   double d = m_observerGpt.distanceTo(m_aoiGroundRect.ur());
+   if (d > m_visRadius)
+      m_visRadius = d;
+   d = m_observerGpt.distanceTo(m_aoiGroundRect.lr());
+   if (d > m_visRadius)
+      m_visRadius = d;
+   d = m_observerGpt.distanceTo(m_aoiGroundRect.ll());
+   if (d > m_visRadius)
+      m_visRadius = d;
+}
+
+void ossimViewshedTool::initRadials()
+{
+   // All eaight sectors' radials have the same azimuths except that the abscissa and ordinate are
+   // reversed between the N-S and E-W sectors, i.e., the N and S sectors use the y-axis as the
+   // abscissa (u) and the x-axis is the ordinate (v). The azimuth (dv/du) is therefore DX/DY for
+   // the north and south, while the azimuth is DY/DX for the east and west sectors. Nevertheless,
+   // each sectors radials must be maintained separately as they contain the max elevation angle.
+
+   // First determine which sectors are involved given the desired FOV:
+   bool* sectorInFov = new bool[8];
+   memset(sectorInFov, false, 8);
+   bool crossed_north = true;
+   if (m_stopFov <= m_startFov) // Crosses 0 azimuth
+      crossed_north = false;
+   double azimuth = m_startFov;
+   for (int i=0; (i < 8) && ((azimuth < m_stopFov) || !crossed_north); ++i)
+   {
+      if ((azimuth >= 0) && (azimuth < 45.0))
+         sectorInFov[0] = true;
+      else if (azimuth < 90.0)
+         sectorInFov[1] = true;
+      else if (azimuth < 135.0)
+         sectorInFov[2] = true;
+      else if (azimuth < 180.0)
+         sectorInFov[3] = true;
+      else if (azimuth < 225.0)
+         sectorInFov[4] = true;
+      else if (azimuth < 270.0)
+         sectorInFov[5] = true;
+      else if (azimuth < 315.0)
+         sectorInFov[6] = true;
+      else if (azimuth < 360.0)
+         sectorInFov[7] = true;
+
+      azimuth += 45.0;
+      if (azimuth > 360.0)
+      {
+         azimuth -= 360.0;
+         crossed_north = true;
+      }
+   }
+
+   // Compute the azimuth slopes for each radial in the sector.
+   m_radials = new Radial* [8];
+   double du = m_halfWindow;
+   for (int sector=0; sector<8; ++sector)
+   {
+      if (!sectorInFov[sector])
+      {
+         m_radials[sector] = 0;
+         continue;
+      }
+
+      ossim_uint32 ridx = 0;
+      m_radials[sector] = new Radial [m_halfWindow+1];
+      for (ossim_int32 dv = 0; dv <= (ossim_int32) m_halfWindow; ++dv)
+      {
+         if (sector & 1) // odd-numbered sector, azimuths computed in reverse order
+            m_radials[sector][m_halfWindow-ridx].azimuth = ((double)dv)/du;
+         else
+            m_radials[sector][ridx].azimuth = ((double)dv)/du;
+         ++ridx;
+      }
+   }
+
+   // Cleanup:
+   delete [] sectorInFov;
+   sectorInFov = 0;
+}
+
+void ossimViewshedTool::paintReticle()
+{
+   if (m_reticleSize == 0)
+      return;
+
+   // Highlight the observer position with X reticle:
+   ossimDpt obsViewPt;
+   m_geom->worldToLocal(m_observerGpt, obsViewPt);
+   if (m_aoiViewRect.pointWithin(ossimIpt(obsViewPt)))
+   {
+      for (int i=-m_reticleSize; i<=m_reticleSize; ++i)
+      {
+         if (m_aoiViewRect.pointWithin(ossimIpt(m_observerVpt.x + i, m_observerVpt.y)))
+            m_outBuffer->setValue(m_observerVpt.x + i, m_observerVpt.y    , m_overlayValue);
+         if (m_aoiViewRect.pointWithin(ossimIpt(m_observerVpt.x, m_observerVpt.y + i)))
+            m_outBuffer->setValue(m_observerVpt.x    , m_observerVpt.y + i, m_overlayValue);
+      }
+   }
+
+   // Paint boundary rectangle if no visibility radius painted:
+   if (!m_displayAsRadar)
+   {
+      for (int y=m_aoiViewRect.ul().y; y<=m_aoiViewRect.lr().y; y++)
+      {
+         m_outBuffer->setValue(m_aoiViewRect.ul().x, y, m_overlayValue);
+         m_outBuffer->setValue(m_aoiViewRect.lr().x, y, m_overlayValue);
+      }
+      for (int x=m_aoiViewRect.ul().x; x<=m_aoiViewRect.lr().x; x++)
+      {
+         m_outBuffer->setValue(x, m_aoiViewRect.ul().y, m_overlayValue);
+         m_outBuffer->setValue(x, m_aoiViewRect.lr().y, m_overlayValue);
+      }
+   }
+}
+
+bool ossimViewshedTool::writeHorizonProfile()
+{
+   // Store the max elevation angles for horizon profiling:
+   double az_deg, arctan;
+   for (ossim_uint32 sector=0; sector<8; ++sector)
+   {
+      if (m_radials[sector] == 0)
+         continue;
+
+      for (ossim_uint32 radial = 0; radial <= m_halfWindow; ++radial)
+      {
+         arctan = ossim::atand(m_radials[sector][radial].azimuth);
+         switch (sector)
+         {
+         case 0: // 0 - 45
+            az_deg = arctan;
+            break;
+         case 1: // 45 - 90
+            az_deg = 90 - arctan;
+            break;
+         case 2: // 90 - 135
+            az_deg = 90 + arctan;
+            break;
+         case 3: // 135 - 180
+            az_deg = 180 - arctan;
+            break;
+         case 4: // 180 - 225
+            az_deg = 180 + arctan;
+            break;
+         case 5: // 225 - 270
+            az_deg = 270 - arctan;
+            break;
+         case 6: // 270 - 315
+            az_deg = 270 + arctan;
+            break;
+         case 7: // 315 - 360
+            az_deg = 360 - arctan;
+            break;
+         default:
+            break;
+         }
+
+         m_horizonMap.insert(pair<double, double>(az_deg, m_radials[sector][radial].elevation));
+      }
+   }
+
+   // Open output file and write the map:
+   ofstream fstr (m_horizonFile.chars());
+   if (!fstr.is_open())
+      return false;
+   map<double, double>::iterator iter = m_horizonMap.begin();
+   while (iter != m_horizonMap.end())
+   {
+      fstr << iter->first << ", " << iter->second << endl;
+      ++iter;
+   }
+
+   fstr.close();
+   return true;
+}
+
+void SectorProcessorJob::start()
+{
+   // Loop over all the sector's radials and walk over each one.
+   for (ossim_uint32 r=0; r<=m_numRadials; ++r)
+   {
+      RadialProcessor::doRadial(m_vsUtil, m_sector, r);
+   }
+}
+
+void RadialProcessorJob::start()
+{
+   RadialProcessor::doRadial(m_vsUtil, m_sector, m_radial);
+}
+
+OpenThreads::ReadWriteMutex RadialProcessor::m_bufMutex;
+
+void RadialProcessor::doRadial(ossimViewshedTool* vsUtil,
+                               ossim_uint32 sector_idx,
+                               ossim_uint32 radial_idx)
+{
+   double u, v;
+   ossimDpt pt_i, vpt_i;
+   ossimGpt gpt_i;
+   double elev_i, elev;
+   double r2_max = vsUtil->m_halfWindow*vsUtil->m_halfWindow;
+
+   // Establish shorthand access to radial:
+   ossimViewshedTool::Radial& radial = vsUtil->m_radials[sector_idx][radial_idx];
+
+   // Walk along the radial using the appropriate coordinate abscissa for that sector and
+   // compute ordinate using the radials azimuth:
+   for (u=1.0; u <= (double) vsUtil->m_halfWindow; u += 1.0)
+   {
+      // Compute ordinate from abscissa and slope of this radial:
+      v = radial.azimuth*(u);
+      switch (sector_idx)
+      {
+      case 0: // N-NE, (u, v) = (-y, x)
+         pt_i.y = -u;
+         pt_i.x = v;
+         break;
+      case 1: // NE-E, (u, v) = (x, -y)
+         pt_i.x = u;
+         pt_i.y = -v;
+         break;
+      case 2: // E-SE, (u, v) = (x, y)
+         pt_i.x = u;
+         pt_i.y = v;
+         break;
+      case 3: // SE-S, (u, v) = (y, x)
+         pt_i.y = u;
+         pt_i.x = v;
+         break;
+      case 4: // S-SW, (u, v) = (y, -x)
+         pt_i.y = u;
+         pt_i.x = -v;
+         break;
+      case 5: // SW-W, (u, v) = (-x, y)
+         pt_i.x = -u;
+         pt_i.y = v;
+         break;
+      case 6: // W-NW, (u, v) = (-x, -y)
+         pt_i.x = -u;
+         pt_i.y = -v;
+         break;
+      case 7: // NW-N, (u, v) = (-y, -x)
+         pt_i.y = -u;
+         pt_i.x = -v;
+         break;
+      default:
+         break;
+      }
+
+      // Shift to actual view coordinates:
+      vpt_i = pt_i + vsUtil->m_observerVpt;
+      ossimIpt ipt (vpt_i);
+
+      // Check if alread accounted for at this location:
+      //if (!vsUtil->m_outBuffer->isNull(vpt_i))
+      //   continue;
+
+      // Check if we are exiting the AOI (no more processing required for this radial):
+      bool pointInsideAoi = vsUtil->m_aoiViewRect.pointWithin(ipt);
+      if (radial.insideAoi && !pointInsideAoi)
+         break;
+
+      // Alternatively, check if we were OUTSIDE and now moving INSIDE:
+      if (!radial.insideAoi && pointInsideAoi)
+         radial.insideAoi = true;
+
+      // Check if we passed beyong the visibilty radius, and exit loop if so:
+      if (vsUtil->m_displayAsRadar && ((u*u + v*v) >= r2_max))
+      {
+         //OpenThreads::ScopedWriteLock lock (m_bufMutex);
+         vsUtil->m_outBuffer->setValue(ipt.x, ipt.y, vsUtil->m_overlayValue);
+         break;
+      }
+
+      // Fetch the pixel value as the elevation value and compute elevation angle from
+      // the observer pt as dz/dx
+      vsUtil->m_geom->localToWorld(vpt_i, gpt_i);
+      if (vsUtil->m_simulation && ossim::isnan(gpt_i.hgt))
+         gpt_i.hgt = vsUtil->m_observerGpt.hgt-vsUtil->m_obsHgtAbvTer; // ground level
+
+      if (!gpt_i.hasNans())
+      {
+         // Compare elev angle to max angle latched so far along this radial:
+         elev_i = (gpt_i.hgt - vsUtil->m_observerGpt.hgt) / u;
+         elev = radial.elevation;
+         if (elev_i > elev)
+         {
+            // point is visible, latch this line-of-sight as the new max elevation angle for this
+            // radial, and mark the output pixel as visible:
+            radial.elevation = elev_i;
+            //OpenThreads::ScopedWriteLock lock (m_bufMutex);
+            vsUtil->m_outBuffer->setValue(ipt.x, ipt.y, vsUtil->m_visibleValue);
+         }
+         else
+         {
+            //OpenThreads::ScopedWriteLock lock (m_bufMutex);
+            vsUtil->m_outBuffer->setValue(ipt.x, ipt.y, vsUtil->m_hiddenValue);
+         }
+      }
+   } // end loop over radial's abscissas
+}
+
+void ossimViewshedTool::test()
+{
+   m_aoiGroundRect = ossimGrect(1.0, 0.0, 0.0, 1.0);
+
+   m_observerGpt = ossimGpt(1.5, 0.5);
+   m_startFov = 180;
+   m_stopFov = 270;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+
+   m_observerGpt = ossimGpt(1.5, 0.5);
+   m_startFov = 335;
+   m_stopFov = 180;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+
+   m_observerGpt = ossimGpt(1.5, 0.5);
+   m_startFov = 270;
+   m_stopFov = 0;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+
+   m_observerGpt = ossimGpt(-0.5, 0.5);
+   m_startFov = 270;
+   m_stopFov = 10;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+
+   m_observerGpt = ossimGpt(-0.5, 0.5);
+   m_startFov = 350;
+   m_stopFov = 90;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+
+   m_observerGpt = ossimGpt(-0.5, 0.5);
+   m_startFov = 10;
+   m_stopFov = 20;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+
+   m_observerGpt = ossimGpt(-0.5, 0.5);
+   m_startFov = 270;
+   m_stopFov = 90;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+
+   m_observerGpt = ossimGpt(-0.5, 0.5);
+   m_startFov = 90;
+   m_stopFov = 270;
+   cout<<"Before: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<endl;
+   optimizeFOV();
+   cout<<"After: m_startFov="<<m_startFov<<"  m_stopFov="<<m_stopFov<<"\n"<<endl;
+}
diff --git a/ossim/src/ossim/vec/ossimVpfBoundingRecordTable.cpp b/src/vec/ossimVpfBoundingRecordTable.cpp
similarity index 100%
rename from ossim/src/ossim/vec/ossimVpfBoundingRecordTable.cpp
rename to src/vec/ossimVpfBoundingRecordTable.cpp
diff --git a/ossim/src/ossim/vec/ossimVpfCoverage.cpp b/src/vec/ossimVpfCoverage.cpp
similarity index 100%
rename from ossim/src/ossim/vec/ossimVpfCoverage.cpp
rename to src/vec/ossimVpfCoverage.cpp
diff --git a/src/vec/ossimVpfDatabase.cpp b/src/vec/ossimVpfDatabase.cpp
new file mode 100644
index 0000000..789152d
--- /dev/null
+++ b/src/vec/ossimVpfDatabase.cpp
@@ -0,0 +1,190 @@
+//*******************************************************************
+// License:  See top level LICENSE.txt file.
+//
+// Author: Garrett Potts
+// 
+// Description: This class extends the stl's string class.
+//
+//********************************************************************
+// $Id: ossimVpfDatabase.cpp 19636 2011-05-24 16:48:45Z gpotts $
+#include <ossim/vec/ossimVpfDatabase.h>
+#include <ossim/vec/ossimVpfDatabaseHeader.h>
+#include <ossim/vec/ossimVpfDatabaseHeaderTableValidator.h>
+#include <ossim/vec/ossimVpfLibraryAttributeTableValidator.h>
+#include <ossim/vec/ossimVpfTable.h>
+#include <ossim/vec/ossimVpfLibrary.h>
+#include <ossim/base/ossimErrorCodes.h>
+
+ossimVpfDatabase::ossimVpfDatabase()
+   :theDatabaseHeaderTable(""),
+    theLibraryAttributeTable(""),
+    theOpenedFlag(false)
+{
+}
+
+ossimVpfDatabase::~ossimVpfDatabase()
+{
+   deleteLibraryList();
+   
+   closeDatabase();
+}
+
+bool ossimVpfDatabase::openDatabase(const ossimFilename& filename)
+{
+   bool result = true;
+
+   ossimFilename tempFilename = filename;
+
+   // tempFilename.convertBackToForwardSlashes();
+
+   // we should have two table to look at for the database.
+   // 1) database header (dht) 2) and the Library attribute (lat)
+   theDatabaseHeaderTable   = ossimFilename(tempFilename.path()).dirCat("dht");
+   theLibraryAttributeTable = ossimFilename(tempFilename.path()).dirCat("lat");
+
+   if(theDatabaseHeaderTable.exists() &&
+      theLibraryAttributeTable.exists())
+   {
+      ossimVpfTable table;
+      // now lets see if they are valid tables
+      result = table.openTable(theDatabaseHeaderTable);
+      if(result&&
+         !ossimVpfDatabaseHeaderTableValidator().isValid(table))
+      {
+         result =  false;
+      }
+      
+      result = table.openTable(theLibraryAttributeTable);
+      if((result) &&!ossimVpfLibraryAttributeTableValidator().isValid(table))
+      {
+         result = false;
+      }
+   }
+   else
+   {
+      result = false;
+   }
+
+   if(result)
+   {
+      theOpenedFlag = true;
+      initializeLibraryList();
+   }
+   
+   return result;
+}
+
+void ossimVpfDatabase::closeDatabase()
+{
+   theLibraryAttributeTable = "";
+   theDatabaseHeaderTable   = "";
+   theOpenedFlag = false;
+   deleteLibraryList();
+}
+
+
+ossimFilename ossimVpfDatabase::getPath()const
+{
+   // we can use either table name since all we need is the path
+   return theLibraryAttributeTable.path();
+}
+
+long ossimVpfDatabase::getNumberOfLibraries()const
+{
+   return (long)theVpfLibraryList.size();
+}
+
+ossimVpfLibrary* ossimVpfDatabase::getLibrary(unsigned long libraryNumber)
+{
+
+   if(libraryNumber < theVpfLibraryList.size())
+   {
+      return theVpfLibraryList[libraryNumber];
+   }
+   
+   return NULL;
+}
+
+ossimVpfLibrary* ossimVpfDatabase::getLibrary(const ossimString& name)
+{
+   for(long index = 0; index < (long)theVpfLibraryList.size(); ++index)
+   {
+      if(theVpfLibraryList[index]->getName() == name)
+      {
+         return theVpfLibraryList[index];
+      }
+   }
+   
+   return NULL;
+}
+
+
+bool ossimVpfDatabase::isOpened()const
+{
+   return theOpenedFlag;
+}
+
+vector<ossimString> ossimVpfDatabase::getLibraryNames()const
+{
+
+   ossimVpfTable table;
+
+   if(table.openTable(theLibraryAttributeTable))
+   {
+      return table.getColumnValues("LIBRARY_NAME");
+   }
+   
+   return vector<ossimString>();
+}
+
+vector<ossimString> ossimVpfDatabase::getLibraryNamesFullPath()const
+{
+   vector<ossimString> result;
+   
+   ossimVpfTable table;
+
+   if(table.openTable(theLibraryAttributeTable))
+   {
+      result = table.getColumnValues("LIBRARY_NAME");
+   }
+
+   for(long index=0; index < (long)result.size();index++)
+   {
+      result[index] = ossimString(theLibraryAttributeTable.path()) +
+                      ossimString("/") +
+                      result[index];
+   }
+   
+   return result;
+}
+
+ossimFilename ossimVpfDatabase::getLibraryAttributeTable()const
+{
+   return theLibraryAttributeTable;
+}
+
+void ossimVpfDatabase::initializeLibraryList()
+{
+   // make sure the library list is deleted
+   deleteLibraryList();
+   vector<ossimString> libraryNames = getLibraryNames();
+   for(long index = 0; index < (long)libraryNames.size(); index++)
+   {
+      ossimVpfLibrary *library = new ossimVpfLibrary;
+      library->openLibrary(this,
+                           libraryNames[index],
+                           getPath().dirCat(libraryNames[index]));
+      theVpfLibraryList.push_back(library);
+   }
+}
+
+void ossimVpfDatabase::deleteLibraryList()
+{
+   for(long idx = 0; idx <(long)theVpfLibraryList.size(); idx++)
+   {
+      delete theVpfLibraryList[idx];
+      theVpfLibraryList[idx] = 0;
+   }
+
+   theVpfLibraryList.clear();
+}
diff --git a/ossim/src/ossim/vec/ossimVpfDatabaseHeader.cpp b/src/vec/ossimVpfDatabaseHeader.cpp
similarity index 100%
rename from ossim/src/ossim/vec/ossimVpfDatabaseHeader.cpp
rename to src/vec/ossimVpfDatabaseHeader.cpp
diff --git a/src/vec/ossimVpfDatabaseHeaderTableValidator.cpp b/src/vec/ossimVpfDatabaseHeaderTableValidator.cpp
new file mode 100644
index 0000000..1e3ff4d
--- /dev/null
+++ b/src/vec/ossimVpfDatabaseHeaderTableValidator.cpp
@@ -0,0 +1,132 @@
+//-----------------------------------------------------------------
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//-----------------------------------------------------------------
+#include <ossim/vec/ossimVpfDatabaseHeaderTableValidator.h>
+#include <ossim/vec/ossimVpfTable.h>
+
+ossimVpfDatabaseHeaderTableValidator::~ossimVpfDatabaseHeaderTableValidator()
+{
+}
+
+bool ossimVpfDatabaseHeaderTableValidator::isValid(ossimVpfTable& aTable)const
+{
+   // make sure the table is not null
+   if(&aTable == NULL)
+   {
+      return false;
+   }
+
+   // and make sure that the table is not closed
+   if(aTable.isClosed())
+   {
+      return false;
+   }
+
+   // get the table data defined in vpf_util/vpftable.h"
+   const vpf_table_type* data = aTable.getVpfTableData();
+
+   if(!data)
+   {
+      return false;
+   }
+   
+   // if the file is not open then we can't validate
+   if(!data->fp)
+   {
+      return false;
+   }
+
+   // The way that we will validate is to see if the columns of a dht
+   // exist.  if the column didn't exist then the position
+   // will be negative
+   long column = table_pos("ID", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("VPF_VERSION", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("DATABASE_NAME", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("DATABASE_DESC", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("MEDIA_STANDARD", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("ORIGINATOR", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("ADDRESSEE", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("MEDIA_VOLUMES", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("SEQ_NUMBERS", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("NUM_DATA_SETS", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("SECURITY_CLASS", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("DOWNGRADING", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("DOWNGRADE_DATE", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("RELEASABILITY", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("TRANSMITTAL_ID", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("EDITION_NUMBER", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   column = table_pos("EDITION_DATE", *data);
+   if(column < 0)
+   {
+      return false;
+   }
+   
+   return true;
+
+}
diff --git a/ossim/src/ossim/vec/ossimVpfExtent.cpp b/src/vec/ossimVpfExtent.cpp
similarity index 100%
rename from ossim/src/ossim/vec/ossimVpfExtent.cpp
rename to src/vec/ossimVpfExtent.cpp
diff --git a/src/vec/ossimVpfFeatureClass.cpp b/src/vec/ossimVpfFeatureClass.cpp
new file mode 100644
index 0000000..ffdeb2b
--- /dev/null
+++ b/src/vec/ossimVpfFeatureClass.cpp
@@ -0,0 +1,151 @@
+#include <algorithm>
+using namespace std;
+
+#include <ossim/vec/ossimVpfFeatureClass.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/vec/ossimVpfCoverage.h>
+#include <ossim/base/ossimErrorCodes.h>
+#include <ossim/vec/ossimVpfTable.h>
+
+#include <string.h> 
+
+#ifndef NULL
+#include <stddef.h>
+#endif
+
+ossimVpfFeatureClass::ossimVpfFeatureClass()
+{
+}
+
+
+bool ossimVpfFeatureClass::openFeatureClass(const ossimString& featureClassName,
+                                            const ossimFilename& featureClassFullPath,
+                                            const ossimFilename& table1,
+                                            const ossimString&   columnNameIdTable1,
+                                            const ossimFilename& table2,
+                                            const ossimString&   columnNameIdTable2)
+{
+   theFeatureClassFullPath = featureClassFullPath;
+   theFeatureClassName     = featureClassName;
+   theTableName1           = table1;
+   theColumnNameId1        = columnNameIdTable1;
+   theTableName2           = table2;
+   theColumnNameId2        = columnNameIdTable2;
+   
+   ossimVpfTable t1;
+   ossimVpfTable t2;
+
+   ossimFilename t1Name = getTable1();
+   ossimFilename t2Name = getTable2();
+
+   if((!t1.openTable(t1Name))||
+      (!t2.openTable(t2Name)))
+     {
+       
+       return false;
+     }
+   
+   return true;
+}
+
+const ossimString& ossimVpfFeatureClass::getName()const
+{
+  return theFeatureClassName;
+  
+}
+
+bool ossimVpfFeatureClass::isPrimitive(const ossimString& featureName)
+{
+   // make sure we have forward slashes
+   ossimFilename filename(featureName.trim());   
+   // filename.convertBackToForwardSlashes();
+   
+   ossimString copyOfFeature = filename;
+
+   // find
+   const char* temp = strrchr(copyOfFeature.c_str(), '/');
+
+   ossimString value;
+   if(temp)
+   {
+      ++temp;
+      value = temp;
+   }
+   else
+   {
+      
+      value = copyOfFeature;
+   }
+
+   value = value.downcase();
+   return( (value == "end") ||
+           (value == "cnd") ||
+           (value == "edg") ||
+           (value == "fac") ||
+           (value == "txt") );
+}
+
+bool ossimVpfFeatureClass::isSimpleFeature(const ossimString& featureName)
+{
+   // find the suffix
+   ossimString value = strrchr(featureName.trim().c_str(), '.');
+
+   // the suffix will be null or empty string if not found.
+   if(value == "")
+   {
+      return false;
+   }
+   // make case insensitive
+   value = value.downcase();
+
+   return ( (value == ".pft")||
+            (value == ".lft")||
+            (value == ".aft")||
+            (value == ".tft"));
+}
+
+bool ossimVpfFeatureClass::isComplexFeature(const ossimString& featureName)
+{
+   const char* suffix = strrchr(featureName.trim(), '.');
+   
+   if (!suffix)
+   {
+      return false;
+   }
+
+   ossimString value = ossimString(suffix).downcase();
+   
+   return (value == ".cft");
+}
+
+bool ossimVpfFeatureClass::isFeature(const ossimString& featureName)
+{
+   return (isSimpleFeature(featureName) || isComplexFeature(featureName));
+}
+
+bool ossimVpfFeatureClass::isJoin(const ossimString& featureName)
+{
+   ossimString value = strrchr(featureName.c_str(), '.');
+   if(value == "")
+   {
+      return false;
+   }
+   
+   value = value.downcase();
+   
+   return ( (value == ".cjt")||
+            (value == ".pjt")||
+            (value == ".ljt")||
+            (value == ".ajt")||
+            (value == ".tjt"));
+}
+
+ossimFilename ossimVpfFeatureClass::getTable1()const
+{
+  return theFeatureClassFullPath.dirCat(theTableName1);
+}
+
+ossimFilename ossimVpfFeatureClass::getTable2()const
+{
+  return theFeatureClassFullPath.dirCat(theTableName2);
+}
diff --git a/src/vec/ossimVpfFeatureClassSchema.cpp b/src/vec/ossimVpfFeatureClassSchema.cpp
new file mode 100644
index 0000000..c3be940
--- /dev/null
+++ b/src/vec/ossimVpfFeatureClassSchema.cpp
@@ -0,0 +1,148 @@
+//*******************************************************************
+// Copyright (C) 2000 ImageLinks Inc. 
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author: Garrett Potts
+//
+//********************************************************************
+// $Id: ossimVpfFeatureClassSchema.cpp 20936 2012-05-18 14:45:00Z oscarkramer $
+#include <ossim/vec/ossimVpfLibrary.h>
+#include <ossim/vec/ossimVpfCoverage.h>
+#include <ossim/vec/ossimVpfFeatureClassSchema.h>
+#include <ossim/vec/ossimVpfFeatureClass.h>
+
+ossimVpfFeatureClassSchema::ossimVpfFeatureClassSchema()
+   :theCoverage(NULL)
+{
+}
+
+bool ossimVpfFeatureClassSchema::openSchema(ossimVpfCoverage* coverage)
+{
+   theCoverage = coverage;
+   bool result = false;
+
+   if(theCoverage)
+   {
+      theSchemaTableName = theCoverage->getPath().dirCat("fcs");
+
+      if(theSchemaTableName.exists())
+      {
+         result = openTable(theSchemaTableName);
+
+         if(result)
+         {
+            result = validateColumnNames();
+         }
+         if(result)
+         {
+            setFeatureClassMapping();
+         }
+      }
+   }
+   
+   return result;
+}
+
+void ossimVpfFeatureClassSchema::closeTable()
+{
+   ossimVpfTable::closeTable();
+   theFeatureClassMap.clear();
+}
+
+void ossimVpfFeatureClassSchema::getFeatureClasses(std::vector<ossimString>& featureClassArray)const
+{
+   featureClassArray.clear();
+   std::map<ossimString, ossimVpfFeatureClassSchemaNode, ossimStringLtstr>::const_iterator featureClassIter = theFeatureClassMap.begin();
+
+   while(featureClassIter != theFeatureClassMap.end())
+   {
+      featureClassArray.push_back((*featureClassIter).first);
+      ++featureClassIter;
+   }
+}
+
+bool ossimVpfFeatureClassSchema::getFeatureClassNode(const ossimString& featureClass,
+                                                     ossimVpfFeatureClassSchemaNode& featureClassNode)const
+{
+   std::map<ossimString, ossimVpfFeatureClassSchemaNode, ossimStringLtstr>::const_iterator fIter = theFeatureClassMap.find(featureClass);
+
+   if(fIter != theFeatureClassMap.end())
+   {
+      featureClassNode = (*fIter).second;
+      return true;
+   }
+
+   return false;
+}
+
+ossim_int32 ossimVpfFeatureClassSchema::getNumberOfFeatureClasses()const
+{
+   return (ossim_int32)theFeatureClassMap.size();
+}
+
+bool ossimVpfFeatureClassSchema::validateColumnNames()const
+{
+   if(isClosed()) return false;
+   return ((getColumnPosition("feature_class")>=0)&&
+           (getColumnPosition("table1")>=0)&&
+           (getColumnPosition("table1_key")>=0)&&
+           (getColumnPosition("table2")>=0)&&
+           (getColumnPosition("table2_key")>=0));
+}
+
+void ossimVpfFeatureClassSchema::setFeatureClassMapping()
+{
+   if(!isClosed())
+   {
+      ossim_int32 featureIdx = getColumnPosition("feature_class");
+      ossim_int32 table1Idx = getColumnPosition("table1");
+      ossim_int32 table1KeyIdx = getColumnPosition("table1_key");
+      ossim_int32 table2Idx = getColumnPosition("table2");
+      ossim_int32 table2KeyIdx = getColumnPosition("table2_key");
+      reset();
+      if(getNumberOfRows() > 0)
+      {
+         row_type row;
+         const int ROWS = getNumberOfRows();
+         for(int rowIdx = 1; rowIdx <= ROWS; ++rowIdx)
+         {
+            if(rowIdx == 1)
+            {
+               row = read_row(rowIdx,
+                              *theTableInformation);
+            }
+            else
+            {
+               row = read_next_row(*theTableInformation);
+            }
+            ossimFilename primitiveTable =  getColumnValueAsString(row,
+                                                                   table2Idx);
+            if(ossimVpfFeatureClass::isPrimitive(primitiveTable))
+            {
+               ossimString primitiveTableKey = getColumnValueAsString(row,
+                                                                      table2KeyIdx);
+               ossimFilename table = getColumnValueAsString(row,
+                                                            table1Idx);
+               ossimString tableKey = getColumnValueAsString(row,
+                                                             table1KeyIdx);
+               ossimString featureClass = getColumnValueAsString(row,
+                                                                 featureIdx);
+               ossimVpfFeatureClassSchemaNode node(table,
+                                                   tableKey,
+                                                   primitiveTable,
+                                                   primitiveTableKey);
+               
+               theFeatureClassMap.insert(make_pair(featureClass,
+                                                   node));
+            }
+            
+            free_row(row, *theTableInformation);
+         }
+      }
+   }
+}
+
+
diff --git a/ossim/src/ossim/vec/ossimVpfLibrary.cpp b/src/vec/ossimVpfLibrary.cpp
similarity index 100%
rename from ossim/src/ossim/vec/ossimVpfLibrary.cpp
rename to src/vec/ossimVpfLibrary.cpp
diff --git a/ossim/src/ossim/vec/ossimVpfLibraryAttributeTableValidator.cpp b/src/vec/ossimVpfLibraryAttributeTableValidator.cpp
similarity index 100%
rename from ossim/src/ossim/vec/ossimVpfLibraryAttributeTableValidator.cpp
rename to src/vec/ossimVpfLibraryAttributeTableValidator.cpp
diff --git a/ossim/src/ossim/vec/ossimVpfTable.cpp b/src/vec/ossimVpfTable.cpp
similarity index 100%
rename from ossim/src/ossim/vec/ossimVpfTable.cpp
rename to src/vec/ossimVpfTable.cpp
diff --git a/ossim/src/ossim/version-config.cpp b/src/version-config.cpp
similarity index 100%
rename from ossim/src/ossim/version-config.cpp
rename to src/version-config.cpp
diff --git a/ossim/src/ossim/video/ossimVideoGeometry.cpp b/src/video/ossimVideoGeometry.cpp
similarity index 100%
rename from ossim/src/ossim/video/ossimVideoGeometry.cpp
rename to src/video/ossimVideoGeometry.cpp
diff --git a/ossim/src/ossim/video/ossimVideoHandler.cpp b/src/video/ossimVideoHandler.cpp
similarity index 100%
rename from ossim/src/ossim/video/ossimVideoHandler.cpp
rename to src/video/ossimVideoHandler.cpp
diff --git a/ossim/src/ossim/video/ossimVideoImageHandler.cpp b/src/video/ossimVideoImageHandler.cpp
similarity index 100%
rename from ossim/src/ossim/video/ossimVideoImageHandler.cpp
rename to src/video/ossimVideoImageHandler.cpp
diff --git a/ossim/src/ossim/video/ossimVideoImageSource.cpp b/src/video/ossimVideoImageSource.cpp
similarity index 100%
rename from ossim/src/ossim/video/ossimVideoImageSource.cpp
rename to src/video/ossimVideoImageSource.cpp
diff --git a/ossim/src/ossim/video/ossimVideoSource.cpp b/src/video/ossimVideoSource.cpp
similarity index 100%
rename from ossim/src/ossim/video/ossimVideoSource.cpp
rename to src/video/ossimVideoSource.cpp
diff --git a/ossim/src/ossim/vpfutil/bitarray.c b/src/vpfutil/bitarray.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/bitarray.c
rename to src/vpfutil/bitarray.c
diff --git a/ossim/src/ossim/vpfutil/distance.c b/src/vpfutil/distance.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/distance.c
rename to src/vpfutil/distance.c
diff --git a/src/vpfutil/linklist.c b/src/vpfutil/linklist.c
new file mode 100644
index 0000000..bfa2a71
--- /dev/null
+++ b/src/vpfutil/linklist.c
@@ -0,0 +1,712 @@
+/*************************************************************************
+ *
+ *N  Module LINKLIST.C
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This module contains functions that make up a singly linked list
+ *     data structure.  It is generic in the sense that it can hold any
+ *     type of data, including user-defined types and structures.  That
+ *     is why you must treat the data element as a void pointer and pass
+ *     in its size when inserting into the list.  These routines are
+ *     assured of working with "non-pointer" types of data elements.
+ *     If you try storing other lists, or structures with pointers hanging
+ *     off of them, the results will become unpredictable.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    N/A
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    linked_list_type ll_init();
+ *    int ll_empty( linked_list_type list );
+ *    position_type ll_first( linked_list_type list );
+ *    position_type ll_last( linked_list_type list );
+ *    position_type ll_next( position_type position );
+ *    position_type ll_previous( position_type position, linked_list_type
+ *                  list );
+ *    int ll_end( position_type position );
+ *    void ll_element( position_type position, void *element );
+ *    void ll_insert( void *element, unsigned size, position_type position );
+ *    void ll_delete( position_type position );
+ *    void ll_reset( linked_list_type list );
+ *    position_type ll_locate( void *element, linked_list_type list );
+ *    void ll_replace( void *element, position_type position );
+ *E
+ *************************************************************************/
+#ifdef __MSDOS__
+#include <alloc.h>
+#include <mem.h>
+#else
+#ifdef __APPLE__ 
+#include <sys/types.h>
+#include <sys/malloc.h>
+#else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#include <malloc.h>
+#include <string.h>
+#endif
+#endif
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ossim/vpfutil/linklist.h>
+#include <string.h>
+
+#ifndef __MSDOS__
+#define farmalloc malloc
+#define farfree free
+#define movmem(a,b,c) memmove(b,a,c)
+#endif
+
+/*************************************************************************
+ *
+ *N  ll_init
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function allocates and initializes a new linked list structure.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    ll_init <output> == (linked_list_type) initialized head of the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+linked_list_type ll_init()
+{
+   linked_list_type list;
+
+   if ((list = (linked_list_type) farmalloc( sizeof(cell_type) ))==NULL) {
+      printf("Out of memory in ll_init()\n");
+      exit(1);
+   }
+   list->element = NULL;
+   list->element_size = 0;
+   list->next = NULL;
+   return list;
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_empty
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function TRUE if the list is empty and FALSE if it is not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    list      <input> == (linked_list_type) linked list being checked.
+ *    ll_empty <output> == (int) boolean function result.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+int ll_empty( linked_list_type list )
+{
+   if (list == NULL) return TRUE;
+   if (list->next == NULL)
+      return TRUE;
+   else
+      return FALSE;
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_first
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the head of the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    list      <input> == (linked_list_type) linked list.
+ *    ll_first <output> == (position_type) head of the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+position_type ll_first( linked_list_type list )
+{
+   return ((position_type) list);
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_last
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns *THE* last position in the list, which is
+ *     not useable.  Use ll_previous to get to the las USEABLE link in
+ *     the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    list     <input> == (linked_list_type) linked list.
+ *    ll_last <output> == (position_type) tail of the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+position_type ll_last( linked_list_type list )
+{
+   position_type p;
+
+   p = (position_type) list;
+   while (p->next != NULL)
+      p = p->next;
+   return p;
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_next
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the next position in the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    position <input> == (position_type) current position in the list.
+ *    ll_next <output> == (position_type) next position in the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+position_type ll_next( position_type position )
+{
+   return(position->next);
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_previous
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the previous position in the list.  Note:
+ *     This is a singly linked list -> no backward pointer -> this
+ *     operation is relatively inefficient.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    position     <input> == (position_type) current position.
+ *    list         <input> == (linked_list_type) linked list.
+ *    ll_previous <output> == (position_type) previous position in the list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+position_type ll_previous( position_type    position,
+			   linked_list_type list )
+{
+   position_type p;
+
+   if (position==list) return(position);
+   p = list;
+   while (p->next != position)
+      p = p->next;
+   return(p);
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_end
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines if the given position is at the end of the
+ *     list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    position <input> == (position_type) current position in the list.
+ *    ll_end  <output> == (int) TRUE  -- if position is the end of the list.
+ *                              FALSE -- if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+int ll_end( position_type position )
+{
+   if (position == NULL)
+      return(TRUE);
+   else {
+      if (position->next == NULL)
+	 return(TRUE);
+      else
+	 return(FALSE);
+   }
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_element
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function copies the element at position in the list into the
+ *     contents of element.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    position <input> == (position_type) position in the list.
+ *    element <output> == (void *) pointer to the element data.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+void ll_element( position_type position,
+		 void         *element )
+{
+   movmem(position->next->element,element,position->next->element_size);
+}
+
+/*************************************************************************
+ *
+ *N  ll_insert
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function inserts a new cell into the list at position that will
+ *     contain the data pointed to by element.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    element  <input> == (void *) pointer to the data element to insert.
+ *    size     <input> == (unsigned) size of the data element.
+ *    position <input> == (position_type) position to insert the new cell.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+void ll_insert( void          *element,
+		unsigned      size,
+		position_type position )
+{
+   position_type temp;
+
+   if ((temp = (position_type) farmalloc( sizeof(cell_type) )) == NULL) {
+      printf("out of memory\n");
+      abort();
+   }
+   temp->next = position->next;
+   position->next = temp;
+   temp->element_size = size;
+   if ((temp->element = farmalloc( size ))==NULL) {
+      printf("out of memory\n");
+      abort();
+   }
+   movmem(element,temp->element,size);
+
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_delete
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function deletes and disposes of a cell from the linked list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    position <input> == (position_type) position in the list to delete.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+void ll_delete( position_type position )
+{
+   position_type    p;
+
+   if (position != NULL) {  /* Cut the element out of the chain */
+      p = position->next;
+      position->next = p->next;
+      farfree( p->element );
+      farfree( p );
+   }
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  ll_reset
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function empties out a linked list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    list <inout> == (linked_list_type) linked list to be emptied.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    void ll_delete( position_type position );
+ *    int ll_empty( linked_list_type list );
+ *E
+ *************************************************************************/
+void ll_reset( linked_list_type list )
+{
+   while (! ll_empty(list))
+      ll_delete(ll_first(list));
+   farfree(list);
+   list = NULL;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  ll_locate
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function locates a position in the list by comparing data.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    element <input> == (void *) pointer to the data element to locate.
+ *    list    <input> == (linked_list_type) linked list.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+position_type ll_locate( void             *element,
+			 linked_list_type list )
+{
+   position_type p;
+
+   p = list;
+   while (p->next != NULL) {
+      if ( memcmp(p->next->element,element,p->next->element_size) == 0 )
+	 return p;
+      else
+	 p = p->next;
+   }
+   return NULL;
+}
+
+
+/*************************************************************************
+ *
+ *N  ll_replace
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function replaces an element in the linked list at the given
+ *     position.  WARNING:  The new data element must be the same size as
+ *     the previous data element or you will get some rather INTERESTING
+ *     results.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    element  <input> == (void *) data element to replace existing data.
+ *    position <input> == (position_type) position in the list to replace
+ *                        the data.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Feb. 1990                      DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+void ll_replace( void          *element,
+		 position_type position )
+{
+   movmem(element,position->next->element,position->next->element_size);
+}
+
+
+
diff --git a/ossim/src/ossim/vpfutil/polygrf.c b/src/vpfutil/polygrf.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/polygrf.c
rename to src/vpfutil/polygrf.c
diff --git a/ossim/src/ossim/vpfutil/set.c b/src/vpfutil/set.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/set.c
rename to src/vpfutil/set.c
diff --git a/src/vpfutil/vpfclip.c b/src/vpfutil/vpfclip.c
new file mode 100644
index 0000000..acb005e
--- /dev/null
+++ b/src/vpfutil/vpfclip.c
@@ -0,0 +1,293 @@
+/*************************************************************************
+ *
+ *N  Module VPFCLIP
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This module geometrically clips an edge table to a given map
+ *     extent and creates a new edge table.  It does not attempt to
+ *     maintain topology, nor does it maintain its relationship to
+ *     any feature tables associated with it.  Its intent is to be
+ *     used only for the Library Reference coverage.  It may also serve
+ *     as a basic starting point for a complete GIS clipping algorithm.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    N/A
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    Dec 1991                     DOS Turbo C
+ *E
+ *************************************************************************/
+
+
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#if defined(__MSDOS__) || defined(__MINGW32__)
+#  include <malloc.h>
+#  include <mem.h>
+#else
+#  ifdef __APPLE__ 
+#    include <sys/types.h>
+#    include <sys/malloc.h>
+#  else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#      include <malloc.h>
+#      include <string.h>
+#    endif
+#  endif
+#endif
+
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfview.h>
+#include <ossim/vpfutil/vpfprim.h>
+#  ifndef min
+#    define min(a,b) ((a) <= (b) ? (a) : (b))
+#  endif
+#  ifndef max
+#    define max(a,b) ((a) <= (b) ? (b) : (a))
+#  endif
+
+typedef struct {
+   float x1, y1, x2, y2;
+} line_segment_type;
+
+/* Defined in VPFPTPLY.C */
+int intersect( line_segment_type l1, line_segment_type l2,
+	       float *xint, float *yint );
+
+edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table );
+
+/* Determine if a line segment intersects a box. 		   */
+/* If so return the intersection coordinate in the parameter list. */
+static int box_intersection( line_segment_type lseg,
+			     extent_type extent,
+			     coordinate_type *coord )
+{
+   line_segment_type boxseg;
+   float xint, yint;
+
+   boxseg.x1 = extent.x1;
+   boxseg.y1 = extent.y1;
+   boxseg.x2 = extent.x2;
+   boxseg.y2 = extent.y1;
+   if (intersect(lseg,boxseg,&xint,&yint)) {
+      coord->x = xint;
+      coord->y = yint;
+      return TRUE;
+   }
+
+   boxseg.x1 = extent.x2;
+   boxseg.y1 = extent.y1;
+   boxseg.x2 = extent.x2;
+   boxseg.y2 = extent.y2;
+   if (intersect(lseg,boxseg,&xint,&yint)) {
+      coord->x = xint;
+      coord->y = yint;
+      return TRUE;
+   }
+
+   boxseg.x1 = extent.x2;
+   boxseg.y1 = extent.y2;
+   boxseg.x2 = extent.x1;
+   boxseg.y2 = extent.y2;
+   if (intersect(lseg,boxseg,&xint,&yint)) {
+      coord->x = xint;
+      coord->y = yint;
+      return TRUE;
+   }
+
+   boxseg.x1 = extent.x1;
+   boxseg.y1 = extent.y2;
+   boxseg.x2 = extent.x1;
+   boxseg.y2 = extent.y1;
+   if (intersect(lseg,boxseg,&xint,&yint)) {
+      coord->x = xint;
+      coord->y = yint;
+      return TRUE;
+   }
+   return FALSE;
+}
+
+/* Replace the given coordinate string into the given edge row */
+/* and write the new row to the specified edge table.	       */
+static void write_edge_record( ossim_int32 id, coordinate_type *coord,
+			       ossim_int32 ncoord, row_type row,
+			       vpf_table_type *table )
+{
+   int ID_, COORD_;
+
+   ID_ = table_pos("ID",*table);
+   COORD_ = table_pos("COORDINATES",*table);
+
+   put_table_element(ID_, row, *table, &id, 1);
+   put_table_element(COORD_, row, *table, coord, ncoord);
+   write_next_row(row,table);
+
+}
+
+
+
+#define WITHIN(x,y,ext) ((x>=ext.x1)&&(x<=ext.x2)&&(y>=ext.y1)&&(y<=ext.y2))
+
+/*************************************************************************
+ *
+ *N  vpf_edge_clip
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function clips an edge table to the given extent and writes
+ *     the clipped table to the specified output path.
+ *     NOTE: If a segment of an edge in the EDG table has both a beginning
+ *     point and ending point outside of the given extent, and the line
+ *     segment passes through the extent, the segment will not be written
+ *     out to the new edge table.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    covpath <input> == (char *) path to the coverage of the edge table.
+ *    extent  <input> == (extent_type) clipping extent.
+ *    outpath <input> == (char *) output path for the clipped edge table.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    Dec 1991      Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+void vpf_edge_clip( char *covpath, extent_type extent, char *outpath )
+{
+   vpf_table_type in, out;
+   row_type row;
+   edge_rec_type inedge, outedge;
+   ossim_int32 i,j,n,id;
+   line_segment_type lseg;
+   coordinate_type coord;
+   char path[255], *def;
+   float xmin, xmax, ymin, ymax;
+
+   /* Standardize extent, Lower Left, Upper Right */
+   xmin = (float)min(extent.x1,extent.x2);
+   xmax = (float)max(extent.x1,extent.x2);
+   ymin = (float)min(extent.y1,extent.y2);
+   ymax = (float)max(extent.y1,extent.y2);
+   extent.x1 = xmin;
+   extent.y1 = ymin;
+   extent.x2 = xmax;
+   extent.y2 = ymax;
+
+   sprintf(path,"%sedg",covpath);
+   in = vpf_open_table(path,disk,"rb",NULL);
+
+   rewind(in.fp);
+   fread(&n,sizeof(n),1,in.fp);
+   def = (char *)vpfmalloc((n+1)*sizeof(char));
+   fread(def,sizeof(char),n,in.fp);
+   def[n] = '\0';
+   sprintf(path,"%sedg",outpath);
+   out = vpf_open_table(path,disk,"wb",def);
+
+   for (i=1,id=1;i<=in.nrows;i++) {
+      row = get_row( i, in );
+      inedge = create_edge_rec( row, in );
+      if (!inedge.coord) {
+	 free_row(row,in);
+	 continue;
+      }
+      outedge.coord = (coordinate_type *)malloc(inedge.npts*sizeof(
+						coordinate_type));
+      if (!outedge.coord) {
+	 free(inedge.coord);
+	 free_row(row,in);
+	 continue;
+      }
+
+      n = 0;
+
+      for (j=0;j<inedge.npts;j++) {
+
+	 if (WITHIN(inedge.coord[j].x,inedge.coord[j].y,extent)) {
+	    /* Current coordinate within extent */
+
+	    if (j > 0) {
+	       if (!WITHIN(inedge.coord[j-1].x,inedge.coord[j-1].y,
+			    extent)) {
+		  /* Previous coordinate was not in the extent - */
+		  /* create an intersection vertex */
+
+		  lseg.x1 = inedge.coord[j-1].x;
+		  lseg.y1 = inedge.coord[j-1].y;
+		  lseg.x2 = inedge.coord[j].x;
+		  lseg.y2 = inedge.coord[j].y;
+		  if (box_intersection(lseg,extent,&coord)) {
+		     outedge.coord[n].x = coord.x;
+		     outedge.coord[n].y = coord.y;
+		  } else {
+		     outedge.coord[n].x = lseg.x1;
+		     outedge.coord[n].y = lseg.y1;
+		  }
+		  n++;
+	       }
+	    }
+	    outedge.coord[n].x = inedge.coord[j].x;
+	    outedge.coord[n].y = inedge.coord[j].y;
+	    n++;
+	 } else {
+	    if (j > 0) {
+	       if (WITHIN(inedge.coord[j-1].x,inedge.coord[j-1].y,extent)) {
+
+		  /* The coordinate is not within the extent and     */
+		  /* the previous one was - Create an intersection   */
+		  /* vertex point and write the current edge record. */
+
+		  lseg.x1 = inedge.coord[j-1].x;
+		  lseg.y1 = inedge.coord[j-1].y;
+		  lseg.x2 = inedge.coord[j].x;
+		  lseg.y2 = inedge.coord[j].y;
+		  if (box_intersection(lseg,extent,&coord)) {
+		     outedge.coord[n].x = coord.x;
+		     outedge.coord[n].y = coord.y;
+		  } else {
+		     outedge.coord[n].x = lseg.x2;
+                     outedge.coord[n].y = lseg.y2;
+		  }
+
+		  /* Break the edge in (at least) two */
+		  n++;
+		  write_edge_record( id, outedge.coord, n, row, &out );
+		  id++;
+		  n=0;
+
+	       }
+	    }
+	 }
+      }
+      free(inedge.coord);
+
+      if (n > 0) {
+	 write_edge_record( id, outedge.coord, n, row, &out );
+	 id++;
+      }
+
+      free(outedge.coord);
+      free_row(row,in);
+   }
+
+   vpf_close_table(&in);
+   vpf_close_table(&out);
+}
+
diff --git a/src/vpfutil/vpfcntnt.c b/src/vpfutil/vpfcntnt.c
new file mode 100644
index 0000000..b4f95c1
--- /dev/null
+++ b/src/vpfutil/vpfcntnt.c
@@ -0,0 +1,513 @@
+/***************************************************************************
+ *
+ *N  VPFCNTNT.C  - VPF Contents
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This module contains functions to display the contents of VPF tables
+ *    and VPF databases and libraries.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels      November 1991
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ **************************************************************************/
+#if defined(__CYGWIN__) || defined(__APPLE__)|| defined(_WIN32) || defined(__FreeBSD__) || defined(__OpenBSD__)
+#  include "ossim/vpfutil/values.h"
+#else
+#  include <values.h>
+#endif
+
+#include <stdlib.h>
+
+#ifdef __MSDOS__
+#  include <graphics.h>
+#  include <dir.h>
+#  include <dos.h>
+#  include <alloc.h>
+#else
+#  ifndef _WIN32
+#    include <unistd.h>
+#  endif
+#  ifdef __APPLE__
+#    include <sys/types.h>
+#    include <sys/malloc.h>
+#    define MAXINT INT_MAX
+#    ifndef MAXSHORT
+#        define MAXSHORT SHORT_MAX
+#    endif
+#    define MAXLONG  LONG_MAX
+#  else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#      include <malloc.h>
+#    endif
+#  endif
+#endif
+#ifdef _MSC_VER
+#  include <io.h>
+#endif
+
+#include <string.h>
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfview.h>
+#include <ossim/vpfutil/system.h>
+#include <ossim/vpfutil/vpfmisc.h>
+#include <ossim/vpfutil/vpfdisp.h>
+
+#include <ossim/vpfutil/vpfapi.h>
+
+
+
+/**************************************************************************
+ *
+ *N  vpf_dump_table
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Dump the contents of a VPF table into an ASCII file
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    tablename <input> == (char *) VPF table to dump.
+ *    outname   <input> == (char *) name of ASCII dump file.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+void vpf_dump_table( char *tablename, char *outname )
+{
+   vpf_table_type table;
+   ossim_int32   i,j,k,n;
+   int        ival,*iptr;
+   ossim_int32   lval,*lptr;
+   float      fval,*fptr;
+   date_type  dval,*dptr;
+   id_triplet_type kval, *kptr;
+   coordinate_type cval, *cptr;
+   char       *buf,  ch, date[40];
+   row_type   row;
+   FILE       *fp;
+
+   fp = fopen(outname,"w");
+
+   table = vpf_open_table(tablename,disk,"rb",NULL);
+
+   fprintf(fp,"%s\n%s\n\n",tablename,table.description);
+
+   fprintf(fp,"Definition:\n");
+   for (i=0;i<table.nfields;i++) {
+      if (table.header[i].count < 0)
+	 fprintf(fp,"%s (%c,*)  %s\n",
+		 table.header[i].name,table.header[i].type,
+		 table.header[i].description);
+      else
+	 fprintf(fp,"%s (%c,%ld)  %s\n",
+		 table.header[i].name,table.header[i].type,
+		 table.header[i].count,table.header[i].description);
+   }
+
+   fprintf(fp,"\nContents:\n");
+   for (i=1;i<=table.nrows;i++) {
+      row = read_next_row(table);
+      for (j=0;j<table.nfields;j++) {
+	 fprintf(fp,"%s: ",table.header[j].name);
+	 switch (table.header[j].type) {
+	    case 'T':
+	       if (table.header[j].count==1) {
+		  get_table_element(j,row,table,&ch,&n);
+		  fprintf(fp,"%c\n",ch);
+	       } else {
+		  buf = (char *)get_table_element(j,row,table,NULL,&n);
+		  n = (long)strlen(table.header[j].name) + 2;
+		  for (k=0;(unsigned int)k<strlen(buf);k++) {
+		     fprintf(fp,"%c",buf[k]);
+		     n++;
+		     if (n>80) {
+			fprintf(fp,"\n");
+			n = 0;
+		     }
+		  }
+		  fprintf(fp,"\n");
+		  free(buf);
+	       }
+	       break;
+	    case 'I':
+	       if (table.header[j].count==1) {
+		  get_table_element(j,row,table,&lval,&n);
+		  if (lval != MAXFLOAT)
+		     fprintf(fp,"%ld\n",lval);
+		  else
+		     fprintf(fp,"(null)\n");
+	       } else {
+		  lptr = (ossim_int32*)get_table_element(j,row,table,NULL,&n);
+		  for (k=0;k<n;k++) {
+		     if (lptr[k] != MAXFLOAT)
+			fprintf(fp,"%ld ",lptr[k]);
+		     else
+			fprintf(fp,"(null) ");
+		  }
+		  fprintf(fp,"\n");
+		  free(lptr);
+	       }
+	       break;
+	    case 'S':
+	       if (table.header[j].count==1) {
+		  get_table_element(j,row,table,&ival,&n);
+		  if (ival != MAXINT)
+		     fprintf(fp,"%d\n",ival);
+		  else
+		     fprintf(fp,"(null)\n");
+	       } else {
+		  iptr = (int*)get_table_element(j,row,table,NULL,&n);
+		  for (k=0;k<n;k++) {
+		     if (iptr[k] != MAXINT)
+			fprintf(fp,"%d ",iptr[k]);
+		     else
+			fprintf(fp,"(null) ");
+		  }
+		  fprintf(fp,"\n");
+		  free(iptr);
+	       }
+	       break;
+	    case 'F':
+	       if (table.header[j].count==1) {
+		  get_table_element(j,row,table,&fval,&n);
+		  if (fval != MAXFLOAT)
+		     fprintf(fp,"%f\n",fval);
+		  else
+		     fprintf(fp,"(null)\n");
+	       } else {
+		  fptr = (float*)get_table_element(j,row,table,NULL,&n);
+		  for (k=0;k<n;k++) {
+		     if (fptr[k] != MAXFLOAT)
+			fprintf(fp,"%f ",fptr[k]);
+		     else
+			fprintf(fp,"(null) ");
+		  }
+		  fprintf(fp,"\n");
+		  free(fptr);
+	       }
+	       break;
+	    case 'C':
+	       if (table.header[j].count==1) {
+		  get_table_element(j,row,table,&cval,&n);
+		  fprintf(fp,"(%f,%f)\n",cval.x,cval.y);
+	       } else {
+		  cptr = (coordinate_type*)get_table_element(j,row,table,NULL,&n);
+		  for (k=0;k<n;k++)
+		     fprintf(fp,"(%f,%f) ",cptr[k].x,cptr[k].y);
+		  fprintf(fp,"\n");
+		  free(cptr);
+	       }
+	       break;
+	    case 'K':
+	       if (table.header[j].count==1) {
+		  get_table_element(j,row,table,&kval,&n);
+		  fprintf(fp,"(%ld,%ld,%ld)\n",
+			  kval.id,kval.tile,kval.exid);
+	       } else {
+		  kptr = (id_triplet_type*)get_table_element(j,row,table,NULL,&n);
+		  for (k=0;k<n;k++)
+		     fprintf(fp,"(%ld,%ld,%ld)  ",
+			     kptr[k].id,kptr[k].tile,kptr[k].exid);
+		  fprintf(fp,"\n");
+		  free(kptr);
+	       }
+	       break;
+	    case 'D':   /* Date */
+	       if (table.header[j].count==1) {
+		  get_table_element(j,row,table,&dval,&n);
+		  format_date(dval,date);
+		  fprintf(fp,"%s\n",date);
+	       } else {
+		  dptr = (date_type*)get_table_element(j,row,table,NULL,&n);
+		  for (k=0;k<n;k++) {
+		     format_date((char*)(&dptr[k]),date);
+		     fprintf(fp,"%s ",date);
+		  }
+		  fprintf(fp,"\n");
+		  free(dptr);
+	       }
+	       break;
+	 }
+      }
+      fprintf(fp,"\n");
+      free_row( row, table );
+   }
+
+   fclose(fp);
+   vpf_close_table( &table );
+}
+
+
+/* Dump a Narrative-style .DOC VPF table to an ASCII file */
+/**************************************************************************
+ *
+ *N  vpf_dump_doc_table
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Dump the contents of a narrative-style .DOC VPF table into an
+ *    ASCII file as a series of text strings.  This function checks
+ *    to make sure that the given table is a real narrative file
+ *    (two fields: ID and TEXT).  If not, it displays it as a normal
+ *    VPF table.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    tablename <input> == (char *) narrative-style .DOC VPF table to dump.
+ *    outname   <input> == (char *) name of ASCII dump file.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+void vpf_dump_doc_table( char *tablename, char *outname )
+{
+   vpf_table_type table;
+   ossim_int32   i,n;
+   char       *buf;
+   row_type   row;
+   FILE       *fp;
+
+   fp = fopen(outname,"w");
+
+   table = vpf_open_table(tablename,disk,"rb",NULL);
+
+   /* Check header to make sure the table is a narrative table */
+   if ((ossim_strcasecmp(table.header[1].name,"TEXT") != 0) ||
+       (table.nfields != 2)) {
+      /* Not a real narrative table -> normal VPF table dump */
+      vpf_close_table(&table);
+      vpf_dump_table(tablename,outname);
+      return;
+   }
+
+   fprintf(fp,"%s\n%s\n\n",tablename,table.description);
+
+   for (i=1;i<=table.nrows;i++) {
+      row = read_next_row(table);
+      buf = (char *)get_table_element(1,row,table,NULL,&n);
+      fprintf(fp,"%s\n",buf);
+      free(buf);
+      free_row(row,table);
+   }
+
+   fclose(fp);
+   vpf_close_table( &table );
+}
+
+#if 0
+static void not_a_vpf_table( char *path )
+{
+   char *buf,*filename,*tempstr,ch;
+
+   buf = (char *)vpfmalloc(255);
+   filename = (char *)vpfmalloc(255);
+
+   /* Not a VPF table - try to determine what type of file it is */
+   if (strstr(path,"\\asi") ||
+       strstr(path,"\\lsi") ||
+       strstr(path,"\\nsi") ||
+       strstr(path,"\\csi") ||
+       strstr(path,"\\tsi")) {
+      sprintf(filename,"%s is a spatial index file.",path);
+      displaymessage(filename,
+	   "It is not a VPF table and cannot be viewed directly",
+	   NULL);
+   } else if (strstr(path,".ati") ||
+	      strstr(path,".lti") ||
+	      strstr(path,".pti") ||
+	      strstr(path,".tti")) {
+      sprintf(filename,"%s is a thematic index file.",path);
+      displaymessage(filename,
+	       "It is not a VPF table and cannot be viewed directly",
+	       NULL);
+   } else if (path[strlen(path)-1] == 'x') {
+      /* Need to determine what file it is the index for */
+      sprintf(buf,"%s is a variable-length index file",path);
+      strcpy(filename,path);
+      for (ch='a';ch <= 'z';ch++) {
+	 if (ch=='x') continue;
+	 filename[strlen(path)-1] = ch;
+	 if (access(filename,0) == 0) {
+	    tempstr = strdup(filename);
+	    sprintf(filename,"for %s.",tempstr);
+	    free(tempstr);
+	    break;
+	 }
+      }
+      if (strcmp(path,filename)==0) {
+	 displaymessage(buf,
+	       "It is not a VPF table and cannot be viewed directly.",
+	       NULL);
+      } else {
+	    displaymessage(buf, filename,
+	       "It is not a VPF table and cannot be viewed directly.",
+	       NULL);
+      }
+   } else {
+      /* Not a VPF type of file */
+      sprintf(filename,"%s: Not a VPF table",path);
+      display_message(filename);
+   }
+
+   free(filename);
+   free(buf);
+}
+#endif
+
+#if 0
+/**************************************************************************
+ *
+ *N  display_database_contents
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    List the tables in the Database level directory and display their
+ *    contents if selected.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    database <input> == (database_type) VPF database.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+void display_database_contents( database_type database )
+{
+   char *filename, *dbpath, *path, *dbstr;
+
+   dbstr = (char *)vpfmalloc(128);
+   dbpath = (char *)vpfmalloc(255);
+   filename = (char *)vpfmalloc(128);
+   path = (char *)vpfmalloc(255);
+
+   strcpy( dbstr, "Database: " );
+   strcat( dbstr, database.name );
+
+   strcpy(dbpath,database.path);
+   strcat(dbpath,"*.*");
+   do {
+      strcpy(filename,pickfile(dbpath,0,dbstr));
+      if (strcmp(filename,"")==0) break;
+      strcpy( path, database.path );
+      strcat( path, filename );
+      rightjust(path);
+      strlwr(path);
+      if (is_vpf_table(path)) {
+	 if (strstr(path,".doc"))
+	    vpf_dump_doc_table(path,"temp.out");
+	 else
+	    vpf_dump_table(path,"temp.out");
+	 viewfile("temp.out", getmaxy()/3);
+	 unlink("temp.out");
+      } else {
+	 not_a_vpf_table(path);
+      }
+   } while (strcmp(filename,"") != 0);
+
+   free(path);
+   free(filename);
+   free(dbpath);
+   free(dbstr);
+}
+
+/**************************************************************************
+ *
+ *N  display_library_contents
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    List the tables in the Library level directory and display their
+ *    contents if selected.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    library   <input> == (library_type) VPF library structure.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+void display_library_contents( library_type library )
+{
+   char *filename, *libpath, *path, *libstr;
+
+   libstr = (char *)vpfmalloc(128);
+   libpath = (char *)vpfmalloc(255);
+   filename = (char *)vpfmalloc(128);
+   path = (char *)vpfmalloc(255);
+
+   strcpy( libstr, "Library: " );
+   strcat( libstr, library.name );
+
+   strcpy(libpath,library.path);
+   strcat(libpath,"*.*");
+   do {
+      strcpy(filename,pickfile(libpath,0,libstr));
+      if (strcmp(filename,"")==0) break;
+      strcpy( path, library.path );
+      strcat( path, filename );
+      rightjust(path);
+      leftjust(path);
+      strlwr(path);
+      if (is_vpf_table(path)) {
+	 strlwr(path);
+	 if (strstr(path,".doc"))
+	    vpf_dump_doc_table(path,"temp.out");
+	 else
+	    vpf_dump_table(path,"temp.out");
+	 viewfile("temp.out", getmaxy()/3);
+	 unlink("temp.out");
+      } else {
+	 not_a_vpf_table(path);
+      }
+   } while (strcmp(filename,"") != 0);
+
+   free(path);
+   free(filename);
+   free(libpath);
+   free(libstr);
+}
+#endif
diff --git a/src/vpfutil/vpfdict.c b/src/vpfutil/vpfdict.c
new file mode 100644
index 0000000..fc025f0
--- /dev/null
+++ b/src/vpfutil/vpfdict.c
@@ -0,0 +1,238 @@
+#include <stdio.h>
+#include <string.h>
+#ifdef __MSDOS__
+#include <graphics.h>
+#endif
+
+#ifdef __MSDOS__
+#include <alloc.h>
+#include <mem.h>
+#else
+#ifdef __APPLE__ 
+#include <sys/types.h>
+#include <sys/malloc.h>
+#else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#include <malloc.h>
+#include <string.h>
+#endif
+#endif
+#endif
+
+
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfview.h>
+#include <ossim/vpfutil/vpfinit.h>
+
+extern color_type menutextcolor,menubordercolor,menucolor;
+#if 0
+/*************************************************************************
+ *
+ *N  feature_class_dictionary
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays the data dictionary for a feature class.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    fc  <input> == (int) feature class number.
+ *    lib <input> == (library_type) VPF library structure.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Mody Buchbinder  May 1991   Original Version   DOS Turbo C
+ *    Barry Michaels July 1991 - Separated into two routines
+ *    Barry Michaels  Oct 1991 - Modified narrative table read
+ *E
+ *************************************************************************/
+void feature_class_dictionary( int fc, library_type lib )
+{
+   int                i,j,k,
+		      it_pos,val_pos,des_pos,att_pos;
+   char               *outfile,*line,temp[128],temp2[128],
+		      *item_buf, *att_buf, *des_buf, *tval;
+   vpf_table_type     ft,table,nar;
+   storage_type       stor = disk;
+   FILE               *out;
+   row_type           row;
+   float              fval;
+   ossim_int32           ival,n;
+
+   hidemousecursor();
+   time_cursor();
+   showmousecursor();
+
+   /** prepare temporary display file **/
+   outfile = (char *)malloc(L_tmpnam + 2);
+   outfile = tmpnam(outfile);
+   out = fopen(outfile,"w");
+
+   /** start to write to display file **/
+   fprintf(out,"FEATURE CLASS: %s \n",lib.fc[fc].description);
+   fprintf(out,"COVERAGE     : %s \n",
+	   lib.cover[lib.fc[fc].coverage].description);
+
+   ft = vpf_open_table(lib.fc[fc].table,stor,"rb",NULL);
+
+   fprintf(out,"ATTRIBUTES:\n");
+
+   for(i=0;i<ft.nfields;i++) {
+     fprintf(out,"   %s - %s \n",ft.header[i].name,ft.header[i].description);
+     if(ft.header[i].vdt[0] != '\0')
+
+	 /** create table name **/
+      { strcpy(temp,lib.fc[fc].table);
+	 /** cut temp to path and name **/
+	for(j=strlen(temp);temp[j] != '\\';j--);
+	temp[j] = '\0';
+
+	rightjust(temp);
+
+	 /** add to the path the new table name **/
+	strcpy(temp2,temp);
+	strcat(temp2,"\\");
+	strcat(temp2,ft.header[i].vdt);
+	if(access(temp2,0) == 0)
+	  {
+	    table   = vpf_open_table(temp2,stor,"rb",NULL);
+	    it_pos  = table_pos("TABLE",table);
+	    val_pos = table_pos("VALUE",table);
+	    des_pos = table_pos("DESCRIPTION",table);
+	    att_pos = table_pos("ATTRIBUTE",table);
+
+	    for(k=1;k<=table.nrows;k++)
+	      {
+		if (stor == disk)
+		   row = read_next_row(table);
+		else
+		   row = get_row(k,table);
+		item_buf = (char *)get_table_element( it_pos
+						,row,table,NULL,&n);
+
+		rightjust(item_buf);
+
+		att_buf  = (char *)get_table_element(att_pos
+						,row,table,NULL,&n);
+
+		rightjust(att_buf);
+
+		if(ossim_strcasecmp(item_buf,&temp[j+1]) == 0 &&
+                   ossim_strcasecmp(att_buf,ft.header[i].name) == 0)
+		   { des_buf  = (char *)get_table_element(des_pos
+						,row,table,NULL,&n);
+		     switch (ft.header[i].type) {
+			case 'T':
+		     tval = (char *)get_table_element(val_pos
+						,row,table,NULL,&n);
+		     fprintf(out,"    %s =  %s  \n",tval,des_buf);
+		     free(tval);break;
+			case 'I':
+		     get_table_element(val_pos,row,table,&ival,&n);
+		     fprintf(out,"    %12ld =  %s  \n",ival,des_buf);
+		     break;
+			case 'F':
+		     get_table_element(val_pos,row,table,&fval,&n);
+		     fprintf(out,"    %12f =  %s  \n",fval,des_buf);
+		     break;
+		     } /** switch **/
+		     free(des_buf);
+		   }  /** if strcmp **/
+
+		free(item_buf);
+		free(att_buf);
+		free_row(row,table);
+	      }  /** for k on table.nrows **/
+	    vpf_close_table(&table);
+	  } /** if access **/
+      } /** if there is vdt **/
+   }  /** for fields **/
+
+   /** get information from narrative file if it exists **/
+   if(ft.narrative[0] != '\0') {
+      sprintf(temp,"%s%s",ft.path,ft.narrative);
+      if (access(temp,0)==0) {
+	 fprintf(out,"\n\n");
+	 nar = vpf_open_table(temp,disk,"rb",NULL);
+	 for (i=1;i<=nar.nrows;i++) {
+	    row = read_next_row(nar);
+	    line = (char *)get_table_element(1,row,nar,NULL,&n);
+	    rightjust(line);
+	    fprintf(out,"%s\n",line);
+	    free(line);
+	    free_row(row,nar);
+	 }
+	 vpf_close_table(&nar);
+      }
+   }
+
+   /** clean up **/
+   vpf_close_table(&ft);
+   fclose(out);
+
+   arrow_cursor();
+
+   viewfile(outfile,getmaxy()/3);
+   remove(outfile);
+   free(outfile);
+}
+
+/*************************************************************************
+ *
+ *N  display_data_dictionary
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function shows a feature class menu, lets the user select
+ *     a feature class and print the information from the data dictionary
+ *     for this feature class
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    lib <in> == (library_type) VPF library structure.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Mody Buchbinder  May 1991   Original Version   DOS Turbo C
+ *    Barry Michaels  June 1991 - Separated into two routines.
+ *    Barry Michaels   Oct 1991 - Feature class selection from a panel.
+ *    Barry Michaels   Jan 1992 - Select FCs by coverage first.
+ *E
+ *************************************************************************/
+void display_data_dictionary(library_type lib)
+{
+   int       fc,cov;
+   view_type dummyview;
+   char      title[80];
+
+   dummyview.nthemes = 0;
+
+   cov = 0;
+   while (cov >= 0) {
+      sprintf(title,"%s COVERAGES",lib.name);
+      cov = select_coverage(&dummyview,&lib,title);
+      if (cov < 0) break;
+      fc = 0;
+      while (fc >= 0) {
+	 sprintf(title,"%s Feature Classes",lib.cover[cov].description);
+	 fc = select_feature_class(&dummyview,&lib,title,cov);
+	 if (fc < 0) break;
+	 feature_class_dictionary( fc, lib );
+      }
+   }
+
+}
+
+#endif
diff --git a/ossim/src/ossim/vpfutil/vpfdisp.c b/src/vpfutil/vpfdisp.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpfdisp.c
rename to src/vpfutil/vpfdisp.c
diff --git a/ossim/src/ossim/vpfutil/vpfdraw.c b/src/vpfutil/vpfdraw.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpfdraw.c
rename to src/vpfutil/vpfdraw.c
diff --git a/src/vpfutil/vpfmisc.c b/src/vpfutil/vpfmisc.c
new file mode 100644
index 0000000..b9ab9df
--- /dev/null
+++ b/src/vpfutil/vpfmisc.c
@@ -0,0 +1,1837 @@
+/*************************************************************************
+ *
+ *N  Module VPFMISC
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This module contains miscellaneous routines used (potentially) by
+ *     several other VPF modules.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    N/A
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                     DOS Turbo C
+ *E
+ *************************************************************************/
+
+#ifdef __MSDOS__
+#  include <graphics.h>
+#  include <alloc.h>
+#else
+#  ifdef __APPLE__ 
+#    include <sys/types.h>
+#    include <sys/malloc.h>
+#  else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#      include <malloc.h>
+#      include <string.h>
+#    endif
+#  endif
+#endif
+
+
+#include <ctype.h> /* For toupper function. */
+
+#include <ossim/vpfutil/vpftidx.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <fcntl.h>
+#ifdef __MSDOS__
+#  include <sys\stat.h>
+#  include <io.h>
+#  include <conio.h>
+#  include <dos.h>
+#  include <dir.h>
+#else
+#  include <sys/stat.h>
+#endif
+#include <math.h>
+#include <errno.h>
+#include <stdarg.h>
+#ifdef __MSDOS__
+#  include <process.h>
+#  include <bios.h>
+#  include "gui.h"
+#endif
+#include <ossim/vpfutil/vpfmisc.h>
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfview.h>
+
+
+#ifdef __MSDOS__
+  extern color_type menucolor, menubordercolor, menutextcolor;
+#endif
+
+#if !defined(__MSDOS__) && !defined(_MSC_VER)
+char* strrev(char* str)
+{
+  register int i,len;
+  char *copy;
+
+  len = strlen(str);
+  copy = (char *) malloc(sizeof(char)*(len+1));
+  (void) strcpy(copy,str);
+  for(i=0;i<len;i++)
+    str[i]=copy[(len-1)-i];
+  free(copy);
+  return str;
+}
+
+char* strupr(char* str)
+{
+  char* s = str;
+  while (*s)
+  {
+	  *s = toupper(*s);
+	  ++s;
+  }
+  return str;
+}
+#endif /* #ifndef __MSDOS__ */
+
+/*************************************************************************
+ *
+ *N  vpfmalloc
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function allocates memory off of the heap and checks for
+ *     success.  If not enough memory is available, this routine will abort
+ *     the program with an error message.  Can be in graphics mode to call
+ *     this procedure, not a necessity.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    size    <input> == (unsigned long) number of bytes to allocate.
+ *    return <output> == (void *) pointer to the allocated memory.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1990    Original Version    DOS Turbo C
+ *    Ronald Rozensky   Sept 1991 check for no memory, graphics mode
+ *E
+ *************************************************************************/
+void *vpfmalloc( unsigned long size )
+{
+   void *p;
+#ifdef __MSDOS__
+   p = farmalloc( size );
+   if (!p)
+   {
+      printf("Out of memory  %ld  %ld\n",size,farcoreleft());
+      getch();
+
+      if (graphic_mode())
+	 closegraph();
+      exit(1);
+   }
+#else
+   p = malloc(size);
+   if (!p)
+   {
+     printf("Out of memory %ld\n", size);
+     exit(1);
+   }
+#endif
+   return p;
+}
+#ifdef __MSDOS__
+/*************************************************************************
+ *
+ *N  get_display_position
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function finds a suitable position to display a new window on
+ *     the screen.  If the window fits, its upper left hand corner will be
+ *     the current mouse position.  If not, it will be adjusted so that it
+ *     will fit on the screen.  Should be in graphics mode to call this
+ *     function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    x     <output> == (int *) pointer to the x display position.
+ *    y     <output> == (int *) pointer to the y display position.
+ *    window <input> == (window_type) window to be displayed.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1990    Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+void get_display_position( int *x, int *y, window_type window )
+{
+   int mbutton, delta;
+
+   getmouseposition( x, y, &mbutton );
+   delta = window.x2 - window.x1;
+   if ((*x) + delta > getmaxx()-2)
+      (*x) = getmaxx()-delta-10;
+   if ((*x) < 2)
+      (*x) = 2;
+   delta = window.y2 - window.y1;
+   if ((*y) + delta > getmaxy()-2)
+      (*y) = getmaxy()-delta-10;
+   if ((*y) < 2)
+      (*y) = 2;
+}
+
+
+/*************************************************************************
+ *
+ *N  displayinfo
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays an array of text strings in a
+ *     popup text window.  Must be in graphics mode to call this function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    text[] <input> == (char *) array of text strings to be displayed.
+ *    nlines <input> == (int) number of text lines.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    June 1990    Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+void displayinfo( char *text[],
+		  int  nlines )
+{
+   int         i,maxw,height,x,y,pad;
+   panel_type  panel;
+
+   arrow_cursor();
+   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
+   maxw = 0;
+   height = 0;
+   for (i=0;i<nlines;i++) {
+      if (textwidth(text[i]) > maxw) maxw = textwidth(text[i]);
+      height = height + textheight(text[i]) + 5;
+   }
+   if (maxw < (textwidth("Continue") + 10))
+      maxw = textwidth("Continue") + 10;
+   pad = (maxw*10)/100;
+   maxw = maxw + (2*pad);
+   if (maxw > getmaxx())
+     maxw = getmaxx() - 8;
+   height = height + 2*(textheight("Continue") + 10);
+
+   create_panel( &panel, maxw, height, menucolor, menubordercolor );
+   x = pad;
+   y = 0;
+   for (i=0;i<nlines;i++) {
+      y = y + textheight(text[i]) + 3;
+      create_label( text[i], x, y, SMALL_FONT, 4, menutextcolor, &panel );
+   }
+   y = height - (textheight("Continue") + 6);
+   x = (maxw - (textwidth("Continue") + 10))/2;
+   create_button( 27, "Continue", x, y, SMALL_FONT, 4,
+		  menutextcolor, menucolor, menubordercolor, RELIEVED,
+		  &panel );
+
+   get_display_position( &x, &y, panel.window );
+
+   display_panel( &panel, x, y );
+   i = process_panel( &panel, i );
+
+   destroy_panel( &panel );
+   close_panel( &panel );
+}
+
+
+
+/*************************************************************************
+ *
+ *N  displaymessage
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays a list of text strings in a
+ *     popup text window.  The list must be NULL-terminated.  Must be in
+ *     graphics mode to call this function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    string <input> == (char *) first text string to be displayed.
+ *    ... <input> == (char *) variable list of text strings to be displayed.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    August 1991                        DOS Turbo C
+ *E
+ *************************************************************************/
+void displaymessage( char *string, ... )
+{
+   int         i,maxw,height,x,y,pad, nlines;
+   panel_type  panel;
+   char **text;
+   va_list arglist;
+
+   va_start(arglist,string);
+   nlines = 1;
+   while (va_arg(arglist,char *)) nlines++;
+   va_end(arglist);
+
+   text = (char **)vpfmalloc((nlines+1)*sizeof(char *));
+   text[0] = string;
+   va_start(arglist,string);
+   for (i=1;i<nlines;i++) {
+      text[i] = va_arg(arglist,char *);
+   }
+   va_end(arglist);
+
+   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
+   maxw = 0;
+   height = 0;
+   for (i=0;i<nlines;i++) {
+      if (textwidth(text[i]) > maxw) maxw = textwidth(text[i]);
+      height = height + textheight(text[i]) + 5;
+
+   }
+   if (maxw < (textwidth("Continue") + 10))
+      maxw = textwidth("Continue") + 10;
+   pad = (maxw*10)/100;
+   maxw = maxw + (2*pad);
+   if (maxw > getmaxx())
+     maxw = getmaxx() - 8;
+   height = height + 2*(textheight("Continue") + 5) + 5;
+
+   create_panel( &panel, maxw, height, menucolor, menubordercolor );
+   x = pad;
+   y = 0;
+   for (i=0;i<nlines;i++) {
+      y = y + textheight(text[i]) + 5;
+      create_label( text[i], x, y, SMALL_FONT, 4, menutextcolor, &panel );
+   }
+   y = height - (textheight("Continue") + 6);
+   x = (maxw - (textwidth("Continue") + 10))/2;
+   create_button( 27, "Continue", x, y, SMALL_FONT, 4,
+		  menutextcolor, menucolor, menubordercolor, RELIEVED,
+		  &panel );
+
+   get_display_position( &x, &y, panel.window );
+
+   display_panel( &panel, x, y );
+   i = process_panel( &panel, i );
+
+   destroy_panel( &panel );
+   close_panel( &panel );
+
+   free(text);
+}
+
+
+
+/*************************************************************************
+ *
+ *N  display_message
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays a one-line informational message to the
+ *     screen and waits for the user to continue.  Must be in graphics mode
+ *     to call this function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    str <input> == (char *) message to be displayed.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    July 1990    Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+void display_message(char *str)
+{
+   char **txt;
+
+   txt = (char **)vpfmalloc( (unsigned long)(1*sizeof(char **)) );
+   txt[0] = strdup(str);
+   displayinfo( txt, 1 );
+   free(txt[0]);
+   free(txt);
+}
+
+#else
+
+void displaymessage( char *s, ... )
+{
+   int         i, nlines;
+   char **text;
+   va_list arglist;
+
+   va_start(arglist,s);
+   nlines = 1;
+   while (va_arg(arglist,char *)) nlines++;
+   va_end(arglist);
+
+   text = (char **)vpfmalloc((nlines+1)*sizeof(char *));
+   text[0] = s;
+   va_start(arglist,s);
+   for (i=1;i<nlines;i++) {
+      text[i] = va_arg(arglist,char *);
+   }
+   va_end(arglist);
+   for (i=0;i<nlines;i++) {
+       fprintf(stderr, "%s", text[i]);
+   }
+   free(text);
+}
+
+void display_message(char *str)
+{
+   fprintf(stderr, "%s", str);
+}
+
+
+#endif
+
+
+/*************************************************************************
+ *
+ *N  float_to_dms
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function converts a floating point lat lon coordinate to
+ *     degrees-minutes-seconds format.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    coord   <input> == (double) floating point lat lon coordinate.
+ *    return <output> == (dms_type) degrees-minutes-seconds coordinate.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1990    Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+dms_type float_to_dms( double coord )
+{
+   dms_type dms_coord;
+
+   dms_coord.degrees = (int)coord;
+   dms_coord.minutes = (int)((double)(coord-(int)coord)*60.0);
+   dms_coord.seconds = (float)((((double)(coord-(int)coord)* 60.0) -
+			(double)dms_coord.minutes) * 60.0);
+   dms_coord.minutes = abs(dms_coord.minutes);
+   dms_coord.seconds = (float)(fabs(dms_coord.seconds));
+
+   if (dms_coord.minutes == 60) {
+      if (dms_coord.degrees > 0)
+	 dms_coord.degrees++;
+      else
+	 dms_coord.degrees--;
+      dms_coord.minutes = 0;
+   }
+
+   if ((dms_coord.degrees == 0)&&(coord < 0.0)) dms_coord.minutes *= -1;
+
+   return dms_coord;
+}
+
+
+/*************************************************************************
+ *
+ *N  dms_to_float
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function converts a coordinate in degrees-minutes-seconds format
+ *     to a floating point coordinate.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    coord   <input> == (dms_type) degrees-minutes-seconds coordinate.
+ *    return <output> == (double) floating point lat lon coordinate.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1990    Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+double dms_to_float( dms_type coord )
+{
+   return ( (double)coord.degrees +
+	    ((double)coord.minutes / 60.0) +
+	    (coord.seconds/3600.0) );
+}
+
+
+
+/*************************************************************************
+ *
+ *N  dms_string
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function converts a coordinate in degrees-minutes-seconds format
+ *     to a character string.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    coord   <input> == (dms_type) degrees-minutes-seconds coordinate.
+ *    seconds <input> == (int) flag to indicate if seconds are to be
+ *                       displayed.
+ *    return <output> == (char *) character string.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1990    Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+char *dms_string( dms_type coord, int seconds )
+{
+   char *str,deg[5],min[3],sec[3];
+
+   str = (char *)vpfmalloc( (20*sizeof(char))+
+			    sizeof(deg)+sizeof(min)+sizeof(sec) );
+
+   itoa( coord.degrees, deg, 10 );
+   itoa( abs(coord.minutes), min, 10 );
+   if (seconds) itoa( ((int)floor(coord.seconds)), sec, 10 );
+   if ((coord.degrees==0)&&(coord.minutes < 0)) {
+      strcpy(str,"-0");
+      coord.minutes *= -1;
+   } else {
+      strcpy(str,deg);
+   }
+   strcat(str," deg ");
+   strcat(str,min);
+   strcat(str," min ");
+   if (seconds) {
+      strcat(str,sec);
+      strcat(str," sec");
+   }
+
+   return(str);
+}
+#ifdef __MSDOS__
+/*************************************************************************
+ *
+ *N  out_dms
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays the given degree-minutes-seconds coordinate
+ *     at the specified location on the screen.  The direction is given
+ *     for placement along the edges of the screen.  Must be in graphics
+ *     mode to call this function.  User must make sure that all text will
+ *     fit on the screen; this program will not adjust size, but will adjust
+ *     location to make sure that all text that CAN fit on the screen WILL
+ *     fit on the screen.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    coord   <input> == (dms_type) degrees-minutes-seconds coordinate.
+ *    x       <input> == (int) x location.
+ *    y       <input> == (int) y location.
+ *    dir     <input> == (int) dir.  HORIZ_DIR=0, VERT_DIR=1
+ *    seconds <input> == (int) flag indicating whether to display seconds.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    October 1990    Original Version    DOS Turbo C
+ *    Ronald Rozensky   Sept 1991 x,y adjustments to make text fit on screen
+ *E
+ *************************************************************************/
+void out_dms( dms_type coord, int x, int y, int dir, int seconds )
+{
+   char deg[8],min[8],sec[8];
+   int x1,x2,y1,y2, width, adjust, minutes;
+
+   settextjustify(LEFT_TEXT,BOTTOM_TEXT);
+
+   itoa( coord.degrees, deg, 10 );
+   if ((coord.seconds >= 30.0)&&(!seconds)) {
+      /* Round up */
+      minutes = abs(coord.minutes)+1;
+      if (minutes == 60) {
+	 /* Rounded up to next degree */
+	 strcpy(min,"0");
+	 if (coord.degrees > 0)
+	    coord.degrees++;
+	 else if (coord.degrees < 0)
+	    coord.degrees--;
+	 else {
+	    if (coord.minutes < 0 || coord.seconds < 0.0)
+	       coord.degrees++;
+	    else
+	       coord.degrees--;
+	 }
+      } else {
+	 itoa( minutes, min, 10 );
+      }
+      itoa( coord.degrees, deg, 10 );
+   } else {
+      itoa( abs(coord.minutes), min, 10 );
+   }
+   if (seconds) itoa( floor(abs(coord.seconds+0.5)), sec, 10 );
+   if ((coord.degrees==0)&&(coord.minutes < 0)) {
+      strcpy(deg,"-0");
+   }
+   if ((coord.degrees==0)&&(coord.minutes==0)&&(coord.seconds<0)) {
+      strcpy(deg,"-0");
+   }
+   strcat(min,"'");
+   if (seconds) strcat(sec,"''");
+
+   if (dir==HORIZ_DIR) {
+      width = textwidth(deg)+3;
+      if ((coord.minutes > 0)||(seconds)) {
+	 width += textwidth(min)+3;
+      }
+      if (seconds) {
+	 width += textwidth(sec)+3;
+      }
+      x1 = x - width/2;
+      x2 = x1 + width;
+      y1 = y-textheight(deg)-1;
+      y2 = y+1;
+   } else {
+      width = textwidth(deg)+3;
+      if ((coord.minutes > 0)||(seconds)) {
+	 width += textwidth(min)+3;
+      }
+      if (seconds) {
+	 width += textwidth(sec)+3;
+      }
+      x1 = x;
+      x2 = x1 + width;
+      y1 = y - (textheight(deg)+4)/2;
+      y2 = y + (textheight(deg)+4)/2;
+   }
+
+   setfillstyle(SOLID_FILL,DARKGRAY);
+   if (x1 <0)
+     {
+     adjust = 0-x1;
+     x1 = 0;
+     x2 = x2 += adjust;
+     }
+   if (y1 <0)
+     {
+     adjust = 0-y1;
+     y1 = 0;
+     y2 = y2 += adjust;
+     }
+   if ((y1-y2 < getmaxy()) && (y2 > getmaxy()))
+     {
+     adjust = y2-getmaxy();
+     y2 = getmaxy();
+     y1 -= adjust;
+     }
+   if ((x1-x2 < getmaxx()) && (x2 > getmaxx()))
+     {
+     adjust = x2-getmaxx();
+     x2 = getmaxx();
+     x1 -= adjust;
+     }
+   bar(x1,y1,x2,y2);
+   outtextxy(x1,y2,deg);
+   circle(x1+textwidth(deg)+1, y2-textheight(deg), 2);
+   if ((coord.minutes > 0)||(seconds))
+      outtextxy(x1+textwidth(deg)+5,y2-1,min);
+   if (seconds)
+      outtextxy(x1+textwidth(deg)+3+textwidth(min)+3,y2-1,sec);
+
+}
+#endif
+
+
+/*************************************************************************
+ *
+ *N  strpos
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the character array position of the first
+ *     occurrence of the given character. (-1 if not present)
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    str     <input> == (char *) character string to be searched.
+ *    ch      <input> == (char) character to search for.
+ *    return <output> == (int) position of character (-1 if not present).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1990    Original Version    DOS Turbo C
+ *E
+ *************************************************************************/
+int strpos( char *str, char ch )
+{
+   register int i;
+
+   for (i=0;(unsigned int)i<strlen(str);i++)
+      if (str[i] == ch) return i;
+   return -1;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  fwithin
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether the input (x,y) coordinate lies
+ *     within the given rectangular extent.  It returns either TRUE or FALSE.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    x        <input> == (float) x coordinate of the test point.
+ *    y        <input> == (float) y coordinate of the test point.
+ *    extent   <input> == (extent_type) rectangular area to be tested.
+ *    fwithin <output> == (VPF_BOOLEAN) VPF_BOOLEAN:
+ *                               TRUE if (x,y) lies within area
+ *                               FALSE if (x,y) lies outside of area
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+VPF_BOOLEAN fwithin( float x,
+		 float y,
+		 extent_type extent )
+{
+   if ((x >= extent.x1) && (x <= extent.x2) &&
+      (y >= extent.y1) && (y <= extent.y2))
+      return TRUE;
+   else
+      return FALSE;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  contained
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether an input rectangular 'extent1' is
+ *     contained within another rectangular 'extent2'.  It returns either
+ *     TRUE or FALSE.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    extent1 <input> == (extent_type) rectangular area to be tested within.
+ *    extent2 <input> == (extent_type) rectangular area to be tested against.
+ *    contained <output> == (VPF_BOOLEAN) VPF_BOOLEAN:
+ *                               TRUE if extent2 contains extent1
+ *                               FALSE if extent2 does not contain extent1
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+VPF_BOOLEAN contained( extent_type extent1,
+		   extent_type extent2 )
+{
+   /* Test each of the four corners of extent1 */
+   /*   	  ____________
+		  |          |
+		  |  2       |
+		  |    ______+___
+		  |    |     |
+		  |    |     |
+		  |    |  1  |
+		  |    |     |
+		  ------------
+		       |
+		       |
+   */
+   if ((extent1.x1 >= extent2.x1) && (extent1.x1 <= extent2.x2) &&
+      (extent1.y1 >= extent2.y1) && (extent1.y1 <= extent2.y2))
+      return TRUE;
+   /*             ____________
+		  |          |
+		  |  2       |
+		  |          |
+	       ---+------    |
+		  |     |    |
+		  |  1  |    |
+		  |     |    |
+		  ------------
+			|
+			|
+   */
+   if ((extent1.x2 >= extent2.x1) && (extent1.x2 <= extent2.x2) &&
+      (extent1.y1 >= extent2.y1) && (extent1.y1 <= extent2.y2))
+      return TRUE;
+   /*
+		       |
+		  _____|______
+		  |    |     |
+		  |  1 |     |
+		  |    |     |
+		--+-----     |
+		  |          |
+		  |    2     |
+		  |__________|
+   */
+   if ((extent1.x2 >= extent2.x1) && (extent1.x2 <= extent2.x2) &&
+      (extent1.y2 >= extent2.y1) && (extent1.y2 <= extent2.y2))
+      return TRUE;
+   /*			|
+			|
+		  ______|_____
+		  |     |    |
+		  |     | 1  |
+		  |     |    |
+		  | 2   -----+--
+		  |          |
+		  |          |
+		  ------------
+   */
+   if ((extent1.x1 >= extent2.x1) && (extent1.x1 <= extent2.x2) &&
+      (extent1.y2 >= extent2.y1) && (extent1.y2 <= extent2.y2))
+      return TRUE;
+
+
+   /* Test for overlaps */
+   /*	 ________             --------------
+	 |      |             |     2      |
+	 |  1   |             | ---------- |
+     ----+------+----         | |        | |
+     | 2 |      |   |         | |        | |
+     |   |      |   |         | |   1    | |
+     ----+------+----         | |        | |
+	 |      |             | |        | |
+	 |      |             | ---------- |
+	 --------             |            |
+			      --------------
+   */
+   if ((extent1.y1 >= extent2.y1) && (extent1.y2 <= extent2.y2) &&
+       (extent1.x1 <= extent2.x2) && (extent1.x2 >= extent2.x1))
+      return TRUE;
+   /*	 ________             --------------
+	 |      |             |     1      |
+	 |  2   |             | ---------- |
+     ----+------+----         | |        | |
+     | 1 |      |   |         | |        | |
+     |   |      |   |         | |   2    | |
+     ----+------+----         | |        | |
+	 |      |             | |        | |
+	 |      |             | ---------- |
+	 --------             |            |
+			      --------------
+   */
+   if ((extent1.x1 >= extent2.x1) && (extent1.x2 <= extent2.x2) &&
+       (extent1.y1 <= extent2.y2) && (extent1.y2 >= extent2.y1))
+      return TRUE;
+   return FALSE;
+}
+
+
+#ifdef __MSDOS__
+/*************************************************************************
+ *
+ *N  info_window
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays a temporary window to the screen with a
+ *     single string of text.  Must be in graphics mode to call this
+ *     function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    text    <input> == (char *)message to display.
+ *    return <output> == (window_type) window created and displayed.
+ *                       [Will need to be deleted]
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   July 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+window_type info_window( char *text )
+{
+   window_type w;
+   int x,y;
+
+   settextstyle(SMALL_FONT,HORIZ_DIR,4);
+   settextjustify(LEFT_TEXT,BOTTOM_TEXT);
+   if (textwidth(text) > getmaxx())
+     x = getmaxx()-20;
+    else
+     x = textwidth(text) + 20;
+   create_window( &w, x, textheight(text)+10,
+		  menucolor,menubordercolor );
+   get_display_position( &x, &y, w );
+   open_window( &w, x,y );
+   setcolor(menutextcolor);
+   hidemousecursor();
+   outtextxy( 10,textheight(text)+5,text );
+   showmousecursor();
+   return w;
+}
+#endif
+
+
+/*************************************************************************
+ *
+ *N  rightjust
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function right justifies the given string and removes the
+ *     trailing newline character (if one exists).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    str <inout> == (char *) string to be justified.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   November 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+char *rightjust( char *str )
+{
+   return strrev(leftjust(strrev(str)));
+}
+
+/*************************************************************************
+ *
+ *N  leftjust
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function left justifies the given string and removes the
+ *     trailing newline character (if one exists)
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    str <inout> == (char *) string to be justified.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   November 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+char *leftjust(char * str)
+{
+   register char * eol;
+
+   strcpy(str, str + strspn(str, " \t\n\b"));
+
+   if ((eol = strchr(str, '\n')) != NULL)
+     *eol = 0;
+
+   return str;
+}
+
+#ifdef __MSDOS__
+/*************************************************************************
+ *
+ *N  displayerror
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays an error message when a disk error is detected.
+ *     It displays the given lines of text in a popup panel and waits for
+ *     the user to click on either retry or cancel.  It returns 1 for retry
+ *     and 0 for cancel.  Must be in graphics mode to call this function.
+ *
+ *     text strings may contain embedded newlines, in which case text to the
+ *     right of the newline will be displayed on (what else?) a new line.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    text[]  <input> == (char *) array of text strings to be displayed.
+ *    nlines  <input> == (int) number of lines of text (this count ignores
+ *                             newline characters embedded in the text
+ *                             strings
+ *    return <output> == (VPF_BOOLEAN) 1 => retry,
+ *                                 0 => cancel.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    July 1990    Prototype 3    DOS Turbo C
+ *E
+ *************************************************************************/
+VPF_BOOLEAN displayerror( char *text[],
+		      int  nlines )
+{
+   register int i;
+   int          maxw,
+		height,
+		x,
+		y,
+		pad,
+		choice,
+		n_real_lines;
+   panel_type   panel;
+   int          retry_button  = 'r',
+		cancel_button = 'c',
+		msg_ar_sz     = 10;
+   char       * walker,
+	     ** msgs;
+   struct viewporttype view;
+
+   getviewsettings( &view );
+   setviewport(0,0,getmaxx(),getmaxy(),1);
+
+
+   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
+   msgs = (char **) vpfmalloc(msg_ar_sz * sizeof(char *));
+   maxw = height = 0;
+
+   for (n_real_lines = i = 0; i < nlines; i++) {
+     walker = text[i];
+     while (1) {
+	size_t substr_len = strcspn(walker, "\n");
+	char   plug;
+
+	maxw                 = max(maxw, textwidth(walker));
+	height               = height + textheight(walker) + 5;
+	plug                 = walker[substr_len];
+	walker[substr_len]   = '\0';
+	msgs[n_real_lines++] = strdup(walker);
+
+	if (n_real_lines == msg_ar_sz)
+	  msgs = (char **) realloc(msgs, (msg_ar_sz += 5) * sizeof(char *));
+	if (plug == 0)
+	  break;
+
+	walker[substr_len] = plug;
+	walker            += substr_len + 1;
+     }
+   }
+
+   if (maxw < (textwidth("Retry") + textwidth("Cancel") + 20))
+      maxw = textwidth("Retry") + textwidth("Cancel") + 20;
+
+   pad    = (maxw*10)/100;
+   maxw   = maxw + (2*pad);
+   height = height + 2*(textheight("Retry") + 5) + 1;
+   maxw   = min(getmaxx(), maxw);
+   height = min(getmaxy()-10, height);
+
+   create_panel( &panel, maxw, height, menucolor, menubordercolor );
+
+   for (y = i = 0; i < n_real_lines; i++) {
+     create_label(msgs[i], pad, y, SMALL_FONT, 4, menutextcolor, &panel );
+     y += textheight(msgs[i]) + 3;
+   }
+
+   y = height-15;
+
+   create_button( retry_button,
+		  "Retry",
+		  3,
+		  y,
+		  SMALL_FONT,
+		  4,
+		  menutextcolor,
+		  menucolor,
+		  menubordercolor,
+		  RELIEVED,
+		  &panel );
+   create_button( cancel_button,
+		  "Cancel",
+		  maxw - (textwidth("Cancel") + 13),
+		  y,
+		  SMALL_FONT,
+		  4,
+		  menutextcolor,
+		  menucolor,
+		  menubordercolor,
+		  RELIEVED,
+		  &panel );
+
+   get_display_position( &x, &y, panel.window );
+
+   display_panel( &panel, x,y );
+   showmousecursor();
+   arrow_cursor();
+   choice = process_panel( &panel, 0 );
+   hidemousecursor();
+
+   destroy_panel( &panel );
+   close_panel( &panel );
+
+   setviewport(view.left,view.top,view.right,view.bottom,view.clip);
+
+   for (i = 0; i < n_real_lines; i++)
+     free(msgs[i]);
+   free(msgs);
+
+   return (choice == retry_button) ? 1 : 0;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  getcursorposition
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the cursor position when either the mouse
+ *     has been moved or an arrow key has been pressed.  Must have called
+ *     showmousecursor() before calling this routine.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    x       <inout> == (int *) x position of the cursor.
+ *    y       <inout> == (int *) y position of the cursor.
+ *    button  <inout> == (int *) mouse button pressed (or simulated with
+ *                               the keyboard).
+ *    return <output> == (int) escape status:
+ *                             FALSE -> escape pressed
+ *                             TRUE  -> escape not pressed
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   November 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+int getcursorposition( int *x,
+		       int *y,
+		       int *button )
+{
+   char ch,ch2;
+   int  xpos,ypos, ok = TRUE;
+
+   if (kbhit()) {
+      xpos = *x;
+      ypos = *y;
+      ch = getch();
+      switch (ch) {
+	 case 13:                         /* Enter key */
+	    *button = LEFT_BUTTON_DOWN;
+	    break;
+	 case '8':
+	    ypos -= 10;
+	    break;
+	 case '2':
+	    ypos += 10;
+	    break;
+	 case '4':
+	    xpos -= 10;
+	    break;
+	 case '6':
+	    xpos += 10;
+	    break;
+	 case 27:
+	    ok = FALSE;
+	    break;
+      }
+      if (ch==0) {
+	 ch2 = getch();
+	 switch (ch2) {
+	    case 72:
+	       ypos--;
+	       break;
+	    case 80:
+	       ypos++;
+	       break;
+	    case 75:
+	       xpos--;
+	       break;
+	    case 77:
+	       xpos++;
+	       break;
+	    case 59: /* F1 key */
+	       *button = RIGHT_BUTTON_DOWN;
+	       break;
+	 }
+      }
+      setmouseposition(xpos,ypos);
+      *x = xpos;
+      *y = ypos;
+   } else getmouseposition(x,y,button);
+   return ok;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  yes_no
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function displays a panel asking the user a yes or no
+ *     question and returns the response.  Must be in graphics mode to call
+ *     this function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    text     <input>==(char *) question string.
+ *    return  <output>==(int) yes (TRUE) or no (FALSE).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                    DOS Turbo C
+ *E
+ *************************************************************************/
+int yes_no( char *text )
+{
+   panel_type  panel;
+   int         no_id = 27;
+   int         yes_id = 13;
+   int         x,y,width,height,maxheight,id=0;
+
+   settextstyle( SMALL_FONT, HORIZ_DIR, 4 );
+
+   width = 0;
+   maxheight = 0;
+   width = textwidth(text);
+   maxheight = textheight(text);
+
+   width = width + 50;
+   if (width > getmaxx())
+      width = getmaxx()-10;
+   height = maxheight * 5;
+
+   create_panel( &panel,width,height,menucolor,menubordercolor );
+
+   y = maxheight;
+   create_label( text,CENTER,y,SMALL_FONT,4,menutextcolor,&panel );
+   y += maxheight;
+
+   create_button( yes_id, "Yes",
+		  3, height-textheight("Y")-6,
+		  SMALL_FONT, 4,
+		  menutextcolor, menucolor, menubordercolor, RELIEVED,
+		  &panel );
+   create_button( no_id, "No",
+		  width-textwidth("No")-13,
+		  height-textheight("No")-6,
+		  SMALL_FONT, 4,
+		  menutextcolor, menucolor, menubordercolor, RELIEVED,
+		  &panel );
+
+   get_display_position( &x, &y, panel.window );
+
+   display_panel( &panel, x,y );
+
+   id = process_panel(&panel, id);
+
+   destroy_panel( &panel );
+   close_panel( &panel );
+
+   if (id == yes_id)
+      return TRUE;
+   else
+      return FALSE;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  printer_ready
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether or not the attached
+ *     printer is ready.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    return <output> == (int) TRUE if ready, FALSE if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   November 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+int printer_ready( void )
+{
+   union REGS reg;
+
+   reg.h.ah = 2;
+   reg.x.dx = 0;
+   int86(0x17, &reg, &reg);
+
+   /* this is not busy           not an io error      not out of paper */
+   return (reg.h.ah & 0x80) && (!(reg.h.ah & 8)) && (!(reg.h.ah & 32));
+}
+
+
+/*************************************************************************
+ *
+ *N  printer_ok
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether the printer is ready and allows
+ *     the user to keep retrying or cancel.  Must be in graphics mode to call
+ *     this function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    return <output> == (int) TRUE if ready, FALSE if cancel.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   November 1990   Original Version   DOS Turbo C
+ *E
+ *************************************************************************/
+int printer_ok( void )
+{
+   int retry;
+   char *msg[] = {"Printer not ready"};
+
+   while (!printer_ready()) {
+      hidemousecursor();
+      retry = displayerror(msg,1);
+      showmousecursor();
+      if (!retry) return FALSE;
+   }
+   return TRUE;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  coprocessor_present
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether a math coprocessor chip is present
+ *     on the current computer configuration.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    return <output> == (int) TRUE if present, FALSE if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   July 1991                          DOS Turbo C
+ *E
+ *************************************************************************/
+int coprocessor_present( void )
+{
+   int stat;
+
+   stat = biosequip();
+
+   /* If bit 1 of stat is on, a coprocessor is present */
+   if (stat & 2)
+      return TRUE;
+   else
+      return FALSE;
+}
+#endif
+
+
+
+
+/*************************************************************************
+ *
+ *N  is_primitive
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether the given file name specifies a
+ *     VPF primitive table (Edge, Face, Entity Node, or Text).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    name    <input> == (char *) file name to be tested.
+ *    return <output> == (int) TRUE if primitive, FALSE if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int is_primitive( char *name )
+{
+   strupr(name);
+   if (strstr(name,"END")) return TRUE;
+   if (strstr(name,"CND")) return TRUE;
+   if (strstr(name,"EDG")) return TRUE;
+   if (strstr(name,"FAC")) return TRUE;
+   if (strstr(name,"TXT")) return TRUE;
+   return FALSE;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  is_simple_feature
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether the given file name specifies a
+ *     VPF simple feature table (Point, Line, or Area feature table).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    name    <input> == (char *) file name to be tested.
+ *    return <output> == (int) TRUE if simple feature, FALSE if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int is_simple_feature( char *name )
+{
+   strupr(name);
+   if (strstr(name,"PFT")) return TRUE;
+   if (strstr(name,"LFT")) return TRUE;
+   if (strstr(name,"AFT")) return TRUE;
+   return FALSE;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  is_complex_feature
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether the given file name specifies a
+ *     VPF complex feature table.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    name    <input> == (char *) file name to be tested.
+ *    return <output> == (int) TRUE if complex feature, FALSE if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int is_complex_feature( char *name )
+{
+   strupr(name);
+   if (strstr(name,"CFT")) return TRUE;
+   return FALSE;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  is_feature
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether the given file name specifies a
+ *     VPF feature table (Point, Line, Area, or Complex feature table).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    name    <input> == (char *) file name to be tested.
+ *    return <output> == (int) TRUE if feature, FALSE if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int is_feature( char *name )
+{
+   strupr(name);
+   if (strstr(name,"PFT")) return TRUE;
+   if (strstr(name,"LFT")) return TRUE;
+   if (strstr(name,"AFT")) return TRUE;
+   if (strstr(name,"TFT")) return TRUE;
+   if (strstr(name,"CFT")) return TRUE;
+   return FALSE;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  feature_type
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the type of feature the given table name
+ *     refers to (POINT, LINE, AREA, ANNO, or COMPLEX_FEATURE).  If the table
+ *     name does not specify a feature type, the function returns FALSE.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    name    <input> == (char *) file name to be tested.
+ *    return <output> == (int) feature type (FALSE if invalid name).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int feature_type( char *name )
+{
+   strupr(name);
+   if (strstr(name,"PFT")) return VPF_POINT;
+   if (strstr(name,"LFT")) return VPF_LINE;
+   if (strstr(name,"AFT")) return VPF_AREA;
+   if (strstr(name,"TXT")) return VPF_ANNO;
+   if (strstr(name,"TFT")) return VPF_ANNO;
+   if (strstr(name,"CFT")) return VPF_COMPLEX_FEATURE;
+   return FALSE;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  is_join
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function determines whether the given file name specifies a
+ *     VPF join table.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    name    <input> == (char *) file name to be tested.
+ *    return <output> == (int) TRUE if join, FALSE if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int is_join( char *name )
+{
+   char *ptr;
+
+   strupr(name);
+   ptr = strstr(name,".");
+   if (strstr(ptr,"JT")) return TRUE;
+   return FALSE;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  primitive_class
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the feature type the given primitive table
+ *     name refers to (POINT, LINE, AREA, or ANNO).  If the table
+ *     name is not a valid primitive table name, the function returns NULL.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    name    <input> == (char *) file name to be tested.
+ *    return <output> == (int) feature type (NULL if invalid primitive
+ *                             name).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int primitive_class( char *name )
+{
+   strupr(name);
+   if (strstr(name,"END")) return VPF_ENTITY_NODE;
+   if (strstr(name,"CND")) return VPF_CONNECTED_NODE;
+   if (strstr(name,"EDG")) return VPF_EDGE;
+   if (strstr(name,"FAC")) return VPF_FACE;
+   if (strstr(name,"TXT")) return VPF_TEXT;
+#ifdef __MSDOS__
+   return NULL;
+#else
+   return 0;
+#endif
+}
+
+int ossim_strcasecmp(const char *s1, const char *s2)
+{
+   size_t s1_size;
+   size_t s2_size;
+   unsigned int i;
+
+   /* Check for one string being null, one not. */
+   if (!s1 && s2)
+   {
+      return -1;
+   }
+   else if (s1 && !s2)
+   {
+      return 1;
+   }
+
+   /* Check for both strings being null.  Consider this equal? */
+   if (!s1 && !s2)
+   {
+      return 0;
+   }
+
+   /* Check for size differences. */
+   s1_size = strlen(s1);
+   s2_size = strlen(s2);
+   if (s1_size < s2_size)
+   {
+      return -1;
+   }
+   else if (s1_size > s2_size)
+   {
+      return 1;
+   }
+
+   /* Check the strings. */
+   for (i=0; i<s1_size; i++)
+   {
+      if ( toupper(s1[i]) != toupper(s2[i]) )
+      {
+         return ( (toupper(s1[i]) < toupper(s2[i]) ) ? -1 : 1);
+      }
+   }
+
+      /* Equal */   
+   return 0;
+}
+
+int ossim_strncasecmp(const char *s1, const char *s2, unsigned int n)
+{
+   size_t s1_size;
+   size_t s2_size;
+   unsigned int i;
+
+   /* Check for one string being null, one not. */
+   if (!s1 && s2)
+   {
+      return -1;
+   }
+   else if (s1 && !s2)
+   {
+      return 1;
+   }
+
+   /* Check for both strings being null.  Consider this equal? */
+   if (!s1 && !s2)
+   {
+      return 0;
+   }
+
+   /* Check for size. */
+   if (n == 0)
+   {
+      return 0;
+   }
+   
+   s1_size = strlen(s1);
+   s2_size = strlen(s2);
+   if (n > s1_size)
+   {
+      return -1;
+   }
+   else if (n > s2_size )
+   {
+      return 1;
+   }
+
+   /* Check the strings. */
+   for (i=0; i<n; i++)
+   {
+      if ( toupper(s1[i]) != toupper(s2[i]) )
+      {
+         return ( (toupper(s1[i]) < toupper(s2[i]) ) ? -1 : 1);
+      }
+   }
+
+      /* Equal */   
+   return 0;
+}
diff --git a/ossim/src/ossim/vpfutil/vpfnear.c b/src/vpfutil/vpfnear.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpfnear.c
rename to src/vpfutil/vpfnear.c
diff --git a/src/vpfutil/vpfprim.c b/src/vpfutil/vpfprim.c
new file mode 100644
index 0000000..3957b37
--- /dev/null
+++ b/src/vpfutil/vpfprim.c
@@ -0,0 +1,1137 @@
+/*************************************************************************
+ *
+ *N  Module VPFPRIM  -  VPF Primitives
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This module contains functions for handling VPF primitives
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    N/A
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   April 1991                  DOS Turbo C
+ *E
+ *************************************************************************/
+
+#include <stdio.h>
+#ifdef __MSDOS__
+#include <io.h>
+#include <dos.h>
+#include <graphics.h>
+#else
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#endif
+
+#include <string.h>
+#include <ctype.h>
+#if defined(__CYGWIN__) || defined(__APPLE__)|| defined(_WIN32)
+#include <ossim/vpfutil/values.h>
+#else
+#include <ossim/vpfutil/values.h>
+#endif
+#ifdef __MSDOS__
+#include <alloc.h>
+#else
+#ifdef __APPLE__ 
+#include <sys/types.h>
+#include <sys/malloc.h>
+#else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#include <malloc.h>
+#include <string.h>
+#endif
+#endif
+#endif
+#include <stdlib.h>
+
+
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfprim.h>
+
+/* Compute the offset from the start of the row to the given field */
+static ossim_int32 row_offset( int field, row_type row, vpf_table_type table) 
+{
+   ossim_int32 offset,n,size;
+   int i;
+   id_triplet_type key;
+   int keysize[] = {0,sizeof(char),sizeof(short int),sizeof(ossim_int32)};
+
+   if (field < 0 || field >= table.nfields) return -1;
+
+   offset = 0L;
+   for (i=0;i<field;i++) {
+      switch (table.header[i].type) {
+	 case 'I':
+	    offset += sizeof(ossim_int32)*row[i].count;
+	    break;
+	 case 'S':
+	    offset += sizeof(short int)*row[i].count;
+	    break;
+	 case 'T':
+	    offset += sizeof(char)*row[i].count;
+	    break;
+	 case 'F':
+	    offset += sizeof(float)*row[i].count;
+	    break;
+	 case 'D':
+	    offset += sizeof(date_type)*row[i].count;
+	    break;
+	 case 'K':
+	    get_table_element(i,row,table,&key,&n);
+	    size = sizeof(char) +
+		   keysize[TYPE0(key.type)] +
+		   keysize[TYPE1(key.type)] +
+		   keysize[TYPE2(key.type)];
+	    offset += size*row[i].count;
+	    break;
+	 case 'R':
+	    offset += sizeof(double)*row[i].count;
+	    break;
+	 case 'C':
+	    offset += sizeof(coordinate_type)*row[i].count;
+	    break;
+	 case 'B':
+	    offset += sizeof(double_coordinate_type)*row[i].count;
+	    break;
+	 case 'Z':
+	    offset += sizeof(tri_coordinate_type)*row[i].count;
+	    break;
+	 case 'Y':
+	    offset += sizeof(double_tri_coordinate_type)*row[i].count;
+	    break;
+      }
+   }
+   return offset;
+}
+
+
+/*************************************************************************
+ *
+ *N  create_edge_rec
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function creates an edge record internal structure from a
+ *     row of a VPF edge table.   NOTE:  This function allocates memory
+ *     for "edge_rec.coord". This array should be freed when no longer
+ *     needed.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    row        <input> == (row_type) VPF table row.
+ *    edge_table <input> == (vpf_table_type) opened VPF table to read.
+ *    return    <output> == (edge_rec_type) returned edge record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+edge_rec_type create_edge_rec( row_type row, vpf_table_type edge_table )
+{
+   edge_rec_type edge;
+   ossim_int32 count,i;
+   int rowid,start,end,right,left,rightfwd,leftfwd,coord;
+   id_triplet_type key;
+   tri_coordinate_type *Zcoord;
+   double_coordinate_type *Bcoord;
+   double_tri_coordinate_type *Ycoord;
+
+   rowid = table_pos( "ID", edge_table );
+   start = table_pos( "START_NODE", edge_table );
+   end = table_pos( "END_NODE", edge_table );
+   right = table_pos( "RIGHT_FACE", edge_table );
+   left = table_pos( "LEFT_FACE", edge_table );
+   rightfwd = table_pos( "RIGHT_EDGE", edge_table );
+   leftfwd = table_pos( "LEFT_EDGE", edge_table );
+   coord = table_pos( "COORDINATES", edge_table );
+
+   get_table_element( rowid, row, edge_table, &(edge.id), &count );
+
+   if (start >= 0)
+      get_table_element( start, row, edge_table, &(edge.start), &count );
+   else
+      edge.start = 0;
+
+   if (end >= 0)
+      get_table_element( end, row, edge_table, &(edge.end), &count );
+   else
+      edge.end = 0;
+
+   if (right >= 0) {
+      if (edge_table.header[right].type=='K') {
+	 get_table_element( right, row, edge_table, &key, &count );
+	 edge.right = key.id;
+      } else if (edge_table.header[right].type=='I') {
+	 get_table_element( right, row, edge_table, &(edge.right),
+			    &count );
+      } else {
+	 edge.right=1;
+      }
+   } else {
+      edge.right = 1;
+   }
+
+   if (left >= 0) {
+      if (edge_table.header[right].type=='K') {
+	 get_table_element( left, row, edge_table, &key, &count );
+	 edge.left = key.id;
+      } else if (edge_table.header[left].type=='I') {
+	 get_table_element( right, row, edge_table, &(edge.left),
+			    &count );
+      } else {
+	 edge.left=1;
+      }
+   } else {
+      edge.left = 1;
+   }
+
+   if (edge_table.header[rightfwd].type=='K') {
+      get_table_element( rightfwd, row, edge_table, &key, &count );
+      edge.rightfwd = key.id;
+   } else if (edge_table.header[rightfwd].type=='I') {
+      get_table_element( rightfwd, row, edge_table, &(edge.rightfwd),
+			 &count );
+   } else {
+      edge.rightfwd=0;
+   }
+
+   if (edge_table.header[leftfwd].type=='K') {
+      get_table_element( leftfwd, row, edge_table, &key, &count );
+      edge.leftfwd = key.id;
+   } else if (edge_table.header[leftfwd].type=='I') {
+      get_table_element( leftfwd, row, edge_table, &(edge.leftfwd),
+			 &count );
+   } else {
+      edge.leftfwd=0;
+   }
+
+   switch (edge_table.header[coord].type) {
+      case 'C':
+	 edge.coord = (coordinate_type *)get_table_element( coord,
+						      row, edge_table,
+						      NULL, &count );
+	 break;
+      case 'Z':
+	 Zcoord = (tri_coordinate_type *)get_table_element( coord,
+						      row, edge_table,
+						      NULL, &count );
+	 edge.coord = (coordinate_type *)malloc(count*
+					  sizeof(coordinate_type));
+	 if (edge.coord) {
+	    for (i=0;i<count;i++) {
+	       edge.coord[i].x = Zcoord[i].x;
+	       edge.coord[i].y = Zcoord[i].y;
+	    }
+	 }
+	 free(Zcoord);
+	 break;
+      case 'B':
+	 Bcoord = (double_coordinate_type *)get_table_element( coord,
+						      row, edge_table,
+						      NULL, &count );
+	 edge.coord = (coordinate_type *)malloc(count*
+					  sizeof(coordinate_type));
+	 if (edge.coord) {
+	    for (i=0;i<count;i++) {
+	       edge.coord[i].x = (float)Bcoord[i].x;
+	       edge.coord[i].y = (float)Bcoord[i].y;
+	    }
+	 }
+	 free(Bcoord);
+	 break;
+      case 'Y':
+	 Ycoord = (double_tri_coordinate_type *)get_table_element( coord,
+						      row, edge_table,
+						      NULL, &count );
+	 edge.coord = (coordinate_type *)malloc(count*
+					  sizeof(coordinate_type));
+	 if (edge.coord) {
+	    for (i=0;i<count;i++) {
+	       edge.coord[i].x = (float)Ycoord[i].x;
+	       edge.coord[i].y = (float)Ycoord[i].y;
+	    }
+	 }
+	 free(Ycoord);
+	 break;
+      default:
+	 count = 0;
+	 break;
+   }
+   edge.coord_type = edge_table.header[coord].type;
+   edge.npts = count;
+
+   edge.fp = NULL;
+   if (!edge.coord) {
+      edge.fp = edge_table.fp;
+      edge.startpos = index_pos(edge.id,edge_table) +
+		      row_offset(coord,row,edge_table) +
+		      (ossim_int32)sizeof(ossim_int32);
+      edge.pos = -1;
+   }
+
+   edge.current_coordinate = -1;
+
+   edge.dir = ' ';
+
+   return edge;
+}
+
+
+/*************************************************************************
+ *
+ *N  read_edge
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads a VPF edge record from the input VPF table.
+ *     It performs a search for the specified line number, and, if found,
+ *     allocates, reads, and returns the edge record.   NOTE:  This function
+ *     allocates memory for "edge_rec.coord". This array should be freed
+ *     when no longer needed.  If an invalid row id is passed in, this
+ *     function will have unpredictable results.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    id         <input> == (ossim_int32) edge id number.
+ *    edge_table <input> == (vpf_table_type) opened VPF table to read.
+ *    return    <output> == (edge_rec_type) returned edge record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+edge_rec_type read_edge( ossim_int32  id,
+			 vpf_table_type edge_table )
+{
+   edge_rec_type edge;
+   row_type row;
+
+   row = get_row( id, edge_table );
+   edge = create_edge_rec( row, edge_table );
+   free_row( row, edge_table );
+   return edge;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_next_edge
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads the next VPF edge record from the input VPF table.
+ *     NOTE:  This function allocates memory for "edge_rec.coord".
+ *     This array should be freed when no longer needed.
+ *     Must have called vpf_open_table with DISK as the storage type,
+ *     since this function accesses the disk to read the next row.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    edge_table  <input> == (vpf_table_type) opened VPF table to read.
+ *    return     <output> == (edge_rec_type) returned edge record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+edge_rec_type read_next_edge( vpf_table_type edge_table )
+{
+   edge_rec_type edge;
+   row_type row;
+
+   row = read_next_row( edge_table );
+   edge = create_edge_rec( row, edge_table );
+   free_row( row, edge_table );
+
+   return edge;
+}
+
+coordinate_type first_edge_coordinate( edge_rec_type *edge_rec )
+{
+   coordinate_type coord;
+   tri_coordinate_type Zcoord;
+   double_coordinate_type Bcoord;
+   double_tri_coordinate_type Ycoord;
+   int size;
+
+   edge_rec->current_coordinate = 0;
+
+   if (edge_rec->coord) {
+      /* Coordinate array is in memory */
+      return edge_rec->coord[0];
+   }
+
+   /* Read coordinate from table */
+   fseek(edge_rec->fp,edge_rec->startpos,SEEK_SET);
+   switch (edge_rec->coord_type) {
+      case 'C':
+	 fread(&coord,sizeof(coord),1,edge_rec->fp);
+	 size = sizeof(coord);
+	 break;
+      case 'Z':
+	 fread(&Zcoord,sizeof(Zcoord),1,edge_rec->fp);
+	 coord.x = Zcoord.x;
+	 coord.y = Zcoord.y;
+	 size = sizeof(Zcoord);
+	 break;
+      case 'B':
+	 fread(&Bcoord,sizeof(Bcoord),1,edge_rec->fp);
+	 coord.x = (float)Bcoord.x;
+	 coord.y = (float)Bcoord.y;
+	 size = sizeof(Bcoord);
+	 break;
+      case 'Y':
+	 fread(&Ycoord,sizeof(Ycoord),1,edge_rec->fp);
+	 coord.x = (float)Ycoord.x;
+	 coord.y = (float)Ycoord.y;
+	 size = sizeof(Ycoord);
+	 break;
+      default:
+	 coord.x = MAXFLOAT/2.0;
+	 coord.y = MAXFLOAT/2.0;
+	 size = 0;
+	 break;
+   }
+   edge_rec->pos = edge_rec->startpos + size;
+
+   return coord;
+}
+
+coordinate_type next_edge_coordinate( edge_rec_type *edge_rec )
+{
+   coordinate_type coord;
+   tri_coordinate_type Zcoord;
+   double_coordinate_type Bcoord;
+   double_tri_coordinate_type Ycoord;
+   int size;
+
+   if (edge_rec->current_coordinate < 0)
+      return first_edge_coordinate(edge_rec);
+
+   edge_rec->current_coordinate++;
+
+   if (edge_rec->current_coordinate >= edge_rec->npts) {
+      edge_rec->current_coordinate = edge_rec->npts-1L;
+      if (!edge_rec->coord)
+	 fseek(edge_rec->fp,edge_rec->startpos +
+			    (edge_rec->npts-1L)*sizeof(coord),
+	       SEEK_SET);
+   }
+
+   if (edge_rec->coord) {
+      /* Coordinate array is in memory */
+      return edge_rec->coord[edge_rec->current_coordinate];
+   }
+
+   /* Read coordinate from table */
+   switch (edge_rec->coord_type) {
+      case 'C':
+	 fread(&coord,sizeof(coord),1,edge_rec->fp);
+	 size = sizeof(coord);
+	 break;
+      case 'Z':
+	 fread(&Zcoord,sizeof(Zcoord),1,edge_rec->fp);
+	 coord.x = Zcoord.x;
+	 coord.y = Zcoord.y;
+	 size = sizeof(Zcoord);
+	 break;
+      case 'B':
+	 fread(&Bcoord,sizeof(Bcoord),1,edge_rec->fp);
+	 coord.x = (float)Bcoord.x;
+	 coord.y = (float)Bcoord.y;
+	 size = sizeof(Bcoord);
+	 break;
+      case 'Y':
+	 fread(&Ycoord,sizeof(Ycoord),1,edge_rec->fp);
+	 coord.x = (float)Ycoord.x;
+	 coord.y = (float)Ycoord.y;
+	 size = sizeof(Ycoord);
+	 break;
+      default:
+	 coord.x = MAXFLOAT/2.0;
+	 coord.y = MAXFLOAT/2.0;
+	 size = 0;
+	 break;
+   }
+   edge_rec->pos = edge_rec->startpos + size;
+
+   return coord;
+}
+
+coordinate_type get_edge_coordinate( ossim_int32 n,
+				     edge_rec_type *edge_rec )
+{
+   coordinate_type coord;
+   tri_coordinate_type Zcoord;
+   double_coordinate_type Bcoord;
+   double_tri_coordinate_type Ycoord;
+   ossim_int32 size;
+
+   if (n < 0)
+      return first_edge_coordinate(edge_rec);
+
+   if (n >= edge_rec->npts) n = edge_rec->npts-1L;
+
+   edge_rec->current_coordinate = n;
+
+   if (edge_rec->coord) {
+      /* Coordinate array is in memory */
+      return edge_rec->coord[n];
+   }
+
+   /* Read coordinate from table */
+   switch (edge_rec->coord_type) {
+      case 'C':
+	 size = sizeof(coord);
+	 break;
+      case 'Z':
+	 size = sizeof(Zcoord);
+	 break;
+      case 'B':
+	 size = sizeof(Bcoord);
+	 break;
+      case 'Y':
+	 size = sizeof(Ycoord);
+	 break;
+      default:
+	 size = 0;
+	 break;
+   }
+   edge_rec->pos = edge_rec->startpos + (n*size);
+   fseek(edge_rec->fp,edge_rec->pos,SEEK_SET);
+   switch (edge_rec->coord_type) {
+      case 'C':
+	 fread(&coord,sizeof(coord),1,edge_rec->fp);
+	 break;
+      case 'Z':
+	 fread(&Zcoord,sizeof(Zcoord),1,edge_rec->fp);
+	 coord.x = Zcoord.x;
+	 coord.y = Zcoord.y;
+	 break;
+      case 'B':
+	 fread(&Bcoord,sizeof(Bcoord),1,edge_rec->fp);
+	 coord.x = (float)Bcoord.x;
+	 coord.y = (float)Bcoord.y;
+	 break;
+      case 'Y':
+	 fread(&Ycoord,sizeof(Ycoord),1,edge_rec->fp);
+	 coord.x = (float)Ycoord.x;
+	 coord.y = (float)Ycoord.y;
+	 break;
+      default:
+	 coord.x = MAXFLOAT/2.0;
+	 coord.y = MAXFLOAT/2.0;
+	 break;
+   }
+
+   return coord;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_face
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads a VPF face record from the input VPF table.
+ *     It performs a search for the specified face number, and, if found,
+ *     reads and returns the face record.  If id is out of range,
+ *     either the lowest or highest id numbered face record type will be
+ *     returned.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    id           <input> == (ossim_int32) face id number.
+ *    face_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return      <output> == (face_rec_type) returned face record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+face_rec_type read_face( ossim_int32  id,
+			 vpf_table_type face_table )
+{
+   face_rec_type face;
+   int rowid,ring;
+   ossim_int32 count;
+   row_type row;
+
+   rowid = table_pos( "ID", face_table );
+   ring = table_pos( "RING_PTR", face_table );
+
+   row = get_row( id, face_table );
+
+   get_table_element( rowid, row, face_table, &(face.id), &count );
+
+   get_table_element( ring, row, face_table, &(face.ring), &count );
+
+   free_row( row, face_table );
+
+   return face;
+}
+
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_next_face
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads the next VPF face record from the input VPF
+ *     table.  Must have used vpf_open_table with DISK as the storage type.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    face_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return      <output> == (face_rec_type) returned face record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+face_rec_type read_next_face( vpf_table_type face_table )
+{
+   face_rec_type face;
+   int rowid,ring;
+   ossim_int32 count;
+   row_type row;
+
+   rowid = table_pos( "ID", face_table );
+   ring = table_pos( "RING_PTR", face_table );
+
+   row = read_next_row( face_table );
+
+   get_table_element( rowid, row, face_table, &(face.id), &count );
+
+   get_table_element( ring, row, face_table, &(face.ring), &count );
+
+   free_row( row, face_table );
+
+   return face;
+}
+
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_ring
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads a VPF ring record from the input VPF table.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    id           <input> == (ossim_int32) ring id number.
+ *    ring_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return      <output> == (ring_rec_type) returned ring record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+ring_rec_type read_ring( ossim_int32  id,
+			 vpf_table_type ring_table )
+{
+   ring_rec_type ring;
+   int rowid,face,edge;
+   ossim_int32 count;
+   row_type row;
+
+   rowid = table_pos( "ID", ring_table );
+   face = table_pos( "FACE_ID", ring_table );
+   edge = table_pos( "START_EDGE", ring_table );
+
+   row = get_row( id, ring_table );
+
+   get_table_element( rowid, row, ring_table, &(ring.id), &count );
+
+   get_table_element( face, row, ring_table, &(ring.face), &count );
+
+   get_table_element( edge, row, ring_table, &(ring.edge), &count );
+
+   free_row( row, ring_table );
+
+   return ring;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_next_ring
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads the next VPF ring record from the input VPF table.
+ *     If read_next_ring goes past the end of the vpftable, ring_rec_type
+ *     id will be a garbage number.  The programmer must ensure that this
+ *     does NOT happen.  Must have called vpf_open_table with DISK as the
+ *     storage type.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    ring_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return      <output> == (ring_rec_type) returned ring record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+ring_rec_type read_next_ring( vpf_table_type ring_table )
+{
+   ring_rec_type ring;
+   int rowid,face,edge;
+   ossim_int32 count;
+   row_type row;
+
+   rowid = table_pos( "ID", ring_table );
+   face = table_pos( "FACE_ID", ring_table );
+   edge = table_pos( "START_EDGE", ring_table );
+
+   row = read_next_row( ring_table );
+
+   get_table_element( rowid, row, ring_table, &(ring.id), &count );
+
+   get_table_element( face, row, ring_table, &(ring.face), &count );
+
+   get_table_element( edge, row, ring_table, &(ring.edge), &count );
+
+   free_row( row, ring_table );
+
+   return ring;
+}
+
+
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_point
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads a VPF point record from the input VPF table.
+ *     It performs a search for the specified point number, and, if found,
+ *     reads and returns the point record.  If read_point is given an
+ *     invalid id (eg 1000000) it will return garbage.  It is the programmers
+ *     responsibility to ensure that this does NOT happen.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    id            <input> == (ossim_int32) point id number.
+ *    point_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return       <output> == (point_rec_type) returned point record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+point_rec_type read_point( ossim_int32  id,
+			   vpf_table_type point_table )
+{
+   point_rec_type point;
+   int rowid,face,coord;
+   ossim_int32 count;
+   coordinate_type c;
+   tri_coordinate_type Zcoord;
+   double_coordinate_type Bcoord;
+   double_tri_coordinate_type Ycoord;
+   row_type row;
+
+   rowid = table_pos( "ID", point_table );
+   face = table_pos( "CONTAINING_FACE", point_table );
+   coord = table_pos( "COORDINATE", point_table );
+
+   row = get_row( id, point_table );
+
+   get_table_element( rowid, row, point_table, &(point.id), &count );
+
+   if (face == -1)
+     point.face = -1;
+   else
+     get_table_element( face, row, point_table, &(point.face), &count );
+
+   switch (point_table.header[coord].type) {
+      case 'C':
+	 get_table_element( coord, row, point_table, &c, &count );
+	 point.x = c.x;
+	 point.y = c.y;
+	 break;
+      case 'Z':
+	 get_table_element( coord, row, point_table, &Zcoord, &count );
+	 point.x = Zcoord.x;
+	 point.y = Zcoord.y;
+	 break;
+      case 'B':
+	 get_table_element( coord, row, point_table, &Bcoord, &count );
+	 point.x = (float)Bcoord.x;
+	 point.y = (float)Bcoord.y;
+	 break;
+      case 'Y':
+	 get_table_element( coord, row, point_table, &Ycoord, &count );
+	 point.x = (float)Ycoord.x;
+	 point.y = (float)Ycoord.y;
+	 break;
+      default:
+	 point.x = MAXFLOAT/2.0;
+	 point.y = MAXFLOAT/2.0;
+	 break;
+   }
+
+   free_row( row, point_table );
+
+   return point;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_next_point
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads the next VPF point record from the input
+ *     VPF table.  Must have called vpf_open_table with DISK as the
+ *     storage type.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    point_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return       <output> == (point_rec_type) returned point record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+point_rec_type read_next_point( vpf_table_type point_table )
+{
+   point_rec_type point;
+   int rowid,face,coord;
+   ossim_int32 count;
+   coordinate_type c;
+   tri_coordinate_type Zcoord;
+   double_coordinate_type Bcoord;
+   double_tri_coordinate_type Ycoord;
+   row_type row;
+
+   rowid = table_pos( "ID", point_table );
+   face = table_pos( "CONTAINING_FACE", point_table );
+   coord = table_pos( "COORDINATE", point_table );
+
+   row = read_next_row( point_table );
+
+   get_table_element( rowid, row, point_table, &(point.id), &count );
+
+   get_table_element( face, row, point_table, &(point.face), &count );
+
+   switch (point_table.header[coord].type) {
+      case 'C':
+	 get_table_element( coord, row, point_table, &c, &count );
+	 point.x = c.x;
+	 point.y = c.y;
+	 break;
+      case 'Z':
+	 get_table_element( coord, row, point_table, &Zcoord, &count );
+	 point.x = Zcoord.x;
+	 point.y = Zcoord.y;
+	 break;
+      case 'B':
+	 get_table_element( coord, row, point_table, &Bcoord, &count );
+	 point.x = (float)Bcoord.x;
+	 point.y = (float)Bcoord.y;
+	 break;
+      case 'Y':
+	 get_table_element( coord, row, point_table, &Ycoord, &count );
+	 point.x = (float)Ycoord.x;
+	 point.y = (float)Ycoord.y;
+	 break;
+      default:
+	 point.x = MAXFLOAT/2.0;
+	 point.y = MAXFLOAT/2.0;
+	 break;
+   }
+
+   free_row( row, point_table );
+
+   return point;
+}
+
+
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_anno
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads a VPF annotation record from the input VPF table.
+ *     It performs a search for the specified annotation id, and, if
+ *     found, reads and returns the annotation record.  NOTE: This function
+ *     allocates memory for "anno.text".  This must be freed when no
+ *     longer needed.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    id           <input> == (ossim_int32) annotation id.
+ *    anno_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return      <output> == (anno_rec_type) returned annotation record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+anno_rec_type read_anno( ossim_int32 id,
+			 vpf_table_type anno_table )
+{
+   anno_rec_type anno;
+   int rowid,text,coord;
+   ossim_int32 count;
+   coordinate_type *c;
+   tri_coordinate_type *Zcoord;
+   double_coordinate_type *Bcoord;
+   double_tri_coordinate_type *Ycoord;
+   row_type row;
+
+   rowid = table_pos( "ID", anno_table );
+   text = table_pos( "STRING", anno_table );
+   coord = table_pos( "SHAPE_LINE", anno_table );
+
+   row = get_row( id, anno_table );
+
+   get_table_element( rowid, row, anno_table, &(anno.id), &count );
+
+   anno.text = (char*)get_table_element( text, row, anno_table, NULL, &count );
+
+   switch (anno_table.header[coord].type) {
+      case 'C':
+	 c = (coordinate_type *)get_table_element( coord, row,
+					  anno_table, NULL, &count );
+	 anno.x = c[0].x;
+	 anno.y = c[0].y;
+	 free(c);
+	 break;
+      case 'Z':
+	 Zcoord = (tri_coordinate_type *)get_table_element( coord, row,
+					       anno_table, NULL, &count );
+	 anno.x = Zcoord[0].x;
+	 anno.y = Zcoord[0].y;
+	 free(Zcoord);
+	 break;
+      case 'B':
+	 Bcoord = (double_coordinate_type *)get_table_element( coord, row,
+					       anno_table, NULL, &count );
+	 anno.x = (float)Bcoord[0].x;
+	 anno.y = (float)Bcoord[0].y;
+	 free(Bcoord);
+	 break;
+      case 'Y':
+	 Ycoord = (double_tri_coordinate_type *)get_table_element( coord,
+					 row, anno_table, NULL, &count );
+	 anno.x = (float)Ycoord[0].x;
+	 anno.y = (float)Ycoord[0].y;
+	 free(Ycoord);
+	 break;
+      default:
+	 anno.x = MAXFLOAT/2.0;
+	 anno.y = MAXFLOAT/2.0;
+	 break;
+   }
+
+   free_row( row, anno_table );
+
+   return anno;
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  read_next_anno
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function reads the next VPF annotation record from the input
+ *     VPF table.  Must have called vpf_open_table with DISK as the storage
+ *     type.  NOTE: This function allocates memory for "anno.text".  This
+ *     must be freed when no longer needed.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    anno_table   <input> == (vpf_table_type) opened VPF table to read.
+ *    return      <output> == (anno_rec_type) returned annotation record.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    April 1991                      DOS Turbo C
+ *E
+ *************************************************************************/
+anno_rec_type read_next_anno( vpf_table_type anno_table )
+{
+   anno_rec_type anno;
+   int rowid,text,coord;
+   ossim_int32 count;
+   coordinate_type *c;
+   tri_coordinate_type *Zcoord;
+   double_coordinate_type *Bcoord;
+   double_tri_coordinate_type *Ycoord;
+   row_type row;
+
+   rowid = table_pos( "ID", anno_table );
+   text = table_pos( "STRING", anno_table );
+   coord = table_pos( "SHAPE_LINE", anno_table );
+
+   row = read_next_row( anno_table );
+
+   get_table_element( rowid, row, anno_table, &(anno.id), &count );
+
+   anno.text = (char*)get_table_element( text, row, anno_table, NULL, &count );
+
+   switch (anno_table.header[coord].type) {
+      case 'C':
+	 c = (coordinate_type *)get_table_element( coord, row,
+					  anno_table, NULL, &count );
+	 anno.x = c[0].x;
+	 anno.y = c[0].y;
+	 free(c);
+	 break;
+      case 'Z':
+	 Zcoord = (tri_coordinate_type *)get_table_element( coord, row,
+					       anno_table, NULL, &count );
+	 anno.x = Zcoord[0].x;
+	 anno.y = Zcoord[0].y;
+	 free(Zcoord);
+	 break;
+      case 'B':
+	 Bcoord = (double_coordinate_type *)get_table_element( coord, row,
+					       anno_table, NULL, &count );
+	 anno.x = (float)Bcoord[0].x;
+	 anno.y = (float)Bcoord[0].y;
+	 free(Bcoord);
+	 break;
+      case 'Y':
+	 Ycoord = (double_tri_coordinate_type *)get_table_element( coord,
+					 row, anno_table, NULL, &count );
+	 anno.x = (float)Ycoord[0].x;
+	 anno.y = (float)Ycoord[0].y;
+	 free(Ycoord);
+	 break;
+      default:
+	 anno.x = MAXFLOAT/2.0;
+	 anno.y = MAXFLOAT/2.0;
+	 break;
+   }
+
+   free_row( row, anno_table );
+
+   return anno;
+}
+
+
diff --git a/ossim/src/ossim/vpfutil/vpfptply.c b/src/vpfutil/vpfptply.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpfptply.c
rename to src/vpfutil/vpfptply.c
diff --git a/src/vpfutil/vpfquery.c b/src/vpfutil/vpfquery.c
new file mode 100644
index 0000000..9185caa
--- /dev/null
+++ b/src/vpfutil/vpfquery.c
@@ -0,0 +1,972 @@
+/*************************************************************************
+ *
+ *N  Module VPFQUERY
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This module contains functions for querying a VPF table with a
+ *     selection expression.  It has one main entry point - query_table().
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    N/A
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions:
+ *F
+ *    set_type query_table( char *expression, vpf_table_type table );
+ *E
+*************************************************************************/
+
+#include <string.h>
+#include <stdlib.h>
+#if defined(__MSDOS__)
+#include <alloc.h>
+#include <mem.h>
+#include <conio.h>
+#else
+#ifdef __APPLE__ 
+#include <sys/types.h>
+#include <sys/malloc.h>
+#else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#include <malloc.h>
+#include <string.h>
+#endif
+#endif
+#endif
+
+
+#ifndef __MSDOS__
+#ifndef _WIN32
+#include <unistd.h>
+#endif
+#endif
+#include <stdio.h>
+#include <ossim/vpfutil/linklist.h>
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfview.h>
+#include <ossim/vpfutil/vpftidx.h>
+#include <ossim/vpfutil/set.h>
+
+
+/* Delimiter tokens */
+typedef enum { EQ, NE, LE, GE, LT, GT, AND, OR, QUOTE } delim_type;
+/*static delim_type delim;*/
+
+/* Valid delimeter strings */
+char *delimstr[] = { "=", "<>", "<=", ">=", "<", ">", " AND ",
+		     " OR ", "\"" };
+int ndelim = 9;
+
+char **fieldname;
+int *fieldcol;
+int nfields;
+
+/* Token types */
+#define DELIMETER  1
+#define FIELD      2
+#define VALUE      3
+#define QUOTE      4
+#define STRING     5
+#define EOL        6
+#define FINISHED   7
+#define LOP        8   /* Logical Operator */
+#define JOIN       9
+#define ERROR     10
+
+#ifndef TRUE
+#define TRUE  1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+
+typedef struct {
+   int field;
+   char op;
+   char value[255];
+   char join;
+} expr_type;
+
+
+static void *memalloc( ossim_uint32 size )
+{
+   void *ptr;
+
+   ptr = malloc(size);
+   if (!ptr) {
+#ifdef __MSDOS__
+      printf("Memory allocation error in VPFQUERY  (%d)(%d)\n",size,
+	     farcoreleft());
+#else
+      printf("Memory allocation error in VPFQUERY  (%d)\n",(int)size);
+#endif
+      exit(1);
+   }
+   return ptr;
+}
+
+int is_white( char c )
+{
+   if (c==' ' || c=='\t') return 1;
+   return 0;
+}
+
+
+/*************************************************************************
+ *
+ *N  return_token
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the first token string found in the
+ *     expression string.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    expr   <input>==(char *) selection expression string.
+ *    token <output>==(char *) first token in the string.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+*************************************************************************/
+static void return_token( char *expr, char *token )
+{
+   register int i,j,n,found=0,stopflag;
+
+   n = 0;
+   stopflag=0;
+   while (expr[0] == ' ') {
+      for (i=0;i<ndelim;i++)
+	 if (ossim_strncasecmp(expr,delimstr[i],(unsigned int)strlen(delimstr[i])) == 0) {
+	    stopflag=1;
+	    break;
+	 }
+      if (stopflag) break;
+      expr++;
+   }
+   strcpy(token,expr);
+   for (i=0;(unsigned int)i<strlen(token);i++) {
+      for (j=0;j<ndelim;j++) {
+	 if (ossim_strncasecmp(expr,delimstr[j],(unsigned int)strlen(delimstr[j]))==0) {
+	    if (n>0)
+	       token[i] = '\0';
+	    else
+	       token[strlen(delimstr[j])] = '\0';
+	    found = 1;
+	    break;
+	 }
+      }
+      if ((found) || (!is_white(*expr))) n++;
+      if ((!found)&&(*expr)) expr++;
+/*      if (!is_white(*expr)) n++;  */
+/*      if ((found) || (!is_white(*expr))) n++; */
+      if (found) break;
+   }
+}
+
+
+
+
+/*************************************************************************
+ *
+ *N  get_token
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function gets the first token, token type, and token value of
+ *     the expression string, and then advances the expression string
+ *     past the token.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    expression   <input>==(char *) selection expression string.
+ *    token       <output>==(char *) first token in the string.
+ *    token_type  <output>==(int *) token type.
+ *    token_value <output>==(int *) token_value.
+ *    return      <output>==(char *) new selection expression.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    static void return_token( char *expr, char *token ) VPFQUERY.C
+ *E
+ *************************************************************************/
+static char *get_token( char *expression,
+		 char *token, int *token_type, int *token_value )
+{
+   register int i, stopflag;
+
+   *token_type = 0;
+
+   if (*expression == '\0') {
+      *token_type = FINISHED;
+      *token_value = 0;
+      return expression;
+   }
+
+   if (*expression=='\r') {  /* crlf */
+      ++expression; ++expression;
+      *token = '\r';
+      token[1] = '\n';
+      token[2] = 0;
+      *token_type = DELIMETER;
+   }
+
+   stopflag = 0;
+   while ((expression[0] == '\"') || (expression[0] == ' ')) {
+      for (i=0;i<ndelim;i++)
+	 if (ossim_strncasecmp(expression,delimstr[i],(unsigned int)strlen(delimstr[i]))==0) {
+	    stopflag=1;
+	    break;
+	 }
+      if (stopflag) break;
+      expression++;
+   }
+
+   return_token( expression, token );
+   expression += strlen(token);
+
+   if (*token == '\0') {
+      *token_type = FINISHED;
+      *expression = '\0';
+      return expression;
+   }
+
+   leftjust(token);
+   rightjust(token);
+
+   if (ossim_strcasecmp(token,"AND")==0) {
+      strupr(token);
+      *token_type = JOIN;
+      *token_value = AND;
+      while ((expression[0] == '\"') || (expression[0] == ' ')) expression++;
+      return expression;
+   }
+
+   if (ossim_strcasecmp(token,"OR")==0) {
+      strupr(token);
+      *token_type = JOIN;
+      *token_value = OR;
+      while ((expression[0] == '\"') || (expression[0] == ' ')) expression++;
+      return expression;
+   }
+
+   if (token[0] == '"') {   /* quoted string */
+      if (*expression) expression++;
+      i = 0;
+      while (*expression != '"') {
+	 token[i] = *expression;
+	 i++;
+	 expression++;
+	 if (*expression == '\0') {
+	    *token_type = ERROR;
+	    *token_value = ERROR;
+	    return expression;
+	 }
+      }
+
+      while ((expression[0] == '\"') || (expression[0] == ' '))
+	 expression++;
+      token[i] = '\0';
+      *token_type = STRING;
+      *token_value = (int)strlen(token);
+      return expression;
+   }
+
+   for (i=0;i<ndelim;i++) {
+      if (ossim_strcasecmp(token,delimstr[i])==0) {
+	 *token_type = LOP;
+	 *token_value = i;
+	 return expression;
+      }
+   }
+
+   for (i=0;i<nfields;i++) {
+      if (ossim_strcasecmp(token,fieldname[i])==0) {
+	 strupr(token);
+	 *token_type = FIELD;
+	 *token_value = i;
+	 return expression;
+      }
+   }
+
+   *token_type = VALUE;
+   *token_value = 0;
+   return expression;
+}
+
+
+/*************************************************************************
+ *
+ *N  parse_expression
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns a list of selection expression clause
+ *     structures.  This list forms the internal structure of the query
+ *     expression.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    expression   <input>==(char *) selection expression string.
+ *    table        <input>==(vpf_table_type) VPF table structure.
+ *    return      <output>==(linked_list_type) list of expression clauses.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    char *get_token( char *expression, char *token, int *token_type,
+ *    int *token_value) VPFQUERY.C
+ *    void display_message( char *input) USER DEFINED
+ *    linked_list_type ll_init() LINKLIST.C
+ *    void ll_reset( linked_list_type list ) LINKLIST.C
+ *    void ll_insert( void *element, unsigned size,
+ *    position_type position ) LINKLIST.C
+ *E
+ *************************************************************************/
+static linked_list_type parse_expression( char *expression, vpf_table_type table )
+{
+   linked_list_type exprlist;
+   position_type pos;
+   expr_type expr;
+   int i, token_type, token_value;
+   char token[260];
+
+   exprlist = ll_init();
+   pos = exprlist;
+
+   /* Set up static globals */
+
+   nfields = table.nfields;
+
+   fieldname = (char **)memalloc( (nfields+2) * sizeof(char *) );
+   fieldcol = (int *)memalloc( (nfields+2) * sizeof(int) );
+
+   for (i=0;i<table.nfields;i++) {
+      fieldname[i] = (char *)memalloc(40*sizeof(char));
+      strcpy(fieldname[i], table.header[i].name);
+      fieldcol[i] = i;
+   }
+
+   /*****/
+
+   expression = get_token( expression, token, &token_type, &token_value );
+   while (token_type != FINISHED) {
+      if (token_type != FIELD) {
+	 display_message("Expression syntax error -- Invalid field name");
+	 ll_reset(exprlist);
+	 exprlist = NULL;
+	 break;
+      }
+      expr.field = token_value;
+
+      expression = get_token( expression, token, &token_type, &token_value );
+      if (token_type != LOP) {
+	 display_message("Expression syntax error");
+	 ll_reset(exprlist);
+	 exprlist = NULL;
+	 break;
+      }
+      expr.op = (char)token_value;
+
+      expression = get_token( expression, token, &token_type, &token_value );
+      if (token_type == ERROR) {
+	 display_message("Expression syntax error");
+	 ll_reset(exprlist);
+	 exprlist = NULL;
+	 break;
+      }
+      strcpy(expr.value,token);
+
+      expression = get_token( expression, token, &token_type, &token_value );
+      if (token_type == JOIN) {
+	 expr.join = (char)token_value;
+	 ll_insert( &expr, sizeof(expr), pos );
+	 pos = pos->next;
+	 expression = get_token( expression, token, &token_type,
+				 &token_value );
+      } else if (token_type == FINISHED) {
+	 expr.join = '\0';
+	 ll_insert( &expr, sizeof(expr), pos );
+      } else {
+	 display_message("Expression syntax error");
+	 ll_reset(exprlist);
+	 exprlist = NULL;
+	 break;
+      }
+   }
+
+   for (i=0;i<nfields;i++) free(fieldname[i]);
+   free(fieldname);
+   free(fieldcol);
+
+   return exprlist;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  comp
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function is a general comparison function for comparing two
+ *     buffers.  NOTE:  This function compares the bytes of the buffers
+ *     as unsigned characters.  Numeric values > 255 should not be
+ *     compared with this function.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    val1    <input>==(void *) first buffer to compare.
+ *    val2    <input>==(void *) second buffer to compare.
+ *    size    <input>==(int) number of bytes to compare.
+ *    op      <input>==(char) logical operator.
+ *    return <output>==(int) TRUE or FALSE.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+static int comp( void *val1, void *val2, int size, char op )
+{
+   int result;
+
+   result = memcmp(val1,val2,size);
+
+   switch (op) {
+      case EQ:
+	 result = !result;
+	 break;
+      case NE:
+	 break;
+      case LT:
+	 if (result < 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      case LE:
+	 if (result <= 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      case GT:
+	 if (result > 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      case GE:
+	 if (result >= 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      default:
+	 printf("Invalid logical operator (%d)\n",op);
+	 result = FALSE;
+	 break;
+   }
+   return result;
+}
+
+
+/*************************************************************************
+ *
+ *N  strcompare
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function compares two strings with the given logical operator.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    val1    <input>==(char *) first buffer to compare.
+ *    val2    <input>==(char *) second buffer to compare.
+ *    op      <input>==(char) logical operator.
+ *    return <output>==(int) TRUE or FALSE.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+static int strcompare( char *val1, char *val2, char op )
+{
+   int result;
+   char str1[300], str2[300];
+
+   strcpy(str1,val1);
+   rightjust(str1);
+   strcpy(str2,val2);
+   rightjust(val2);
+
+   result = ossim_strcasecmp(str1,str2);
+
+   switch (op) {
+      case EQ:
+	 result = !result;
+	 break;
+      case NE:
+	 break;
+      case LT:
+	 if (result < 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      case LE:
+	 if (result <= 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      case GT:
+	 if (result > 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      case GE:
+	 if (result >= 0)
+	    result = TRUE;
+	 else
+	    result = FALSE;
+	 break;
+      default:
+	 printf("Invalid logical operator (%d)\n",op);
+	 result = FALSE;
+	 break;
+   }
+   return result;
+}
+
+
+/*************************************************************************
+ *
+ *N  icompare
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function compares two ossim_int32 integers with the given logical
+ *     operator.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    val1    <input>==(ossim_int32) first buffer to compare.
+ *    val2    <input>==(ossim_int32) second buffer to compare.
+ *    op      <input>==(char) logical operator.
+ *    return <output>==(int) TRUE or FALSE.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+static int icompare( ossim_int32 val1, ossim_int32 val2, char op )
+{
+   int result;
+
+   switch (op) {
+      case EQ:
+	 result = (val1 == val2);
+	 break;
+      case NE:
+	 result = (val1 != val2);
+	 break;
+      case LT:
+	 result = (val1 < val2);
+	 break;
+      case LE:
+	 result = (val1 <= val2);
+	 break;
+      case GT:
+	 result = (val1 > val2);
+	 break;
+      case GE:
+	 result = (val1 >= val2);
+	 break;
+      default:
+	 printf("Invalid logical operator (%d)\n",op);
+	 result = FALSE;
+	 break;
+   }
+   return result;
+}
+
+
+/*************************************************************************
+ *
+ *N  fcompare
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function compares two floating point numbers with the given
+ *     logical operator.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    val1    <input>==(ossim_int32) first buffer to compare.
+ *    val2    <input>==(ossim_int32) second buffer to compare.
+ *    op      <input>==(char) logical operator.
+ *    return <output>==(int) TRUE or FALSE.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    None
+ *E
+ *************************************************************************/
+static int fcompare( float val1, float val2, char op )
+{
+   int result;
+
+   switch (op) {
+      case EQ:
+	 result = (val1 == val2);
+	 break;
+      case NE:
+	 result = (val1 != val2);
+	 break;
+      case LT:
+	 result = (val1 < val2);
+	 break;
+      case LE:
+	 result = (val1 <= val2);
+	 break;
+      case GT:
+	 result = (val1 > val2);
+	 break;
+      case GE:
+	 result = (val1 >= val2);
+	 break;
+      default:
+	 printf("Invalid logical operator (%d)\n",op);
+	 result = FALSE;
+	 break;
+   }
+   return result;
+}
+
+
+/*************************************************************************
+ *
+ *N  query_table
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This function returns the set of selected rows of a VPF table
+ *     based upon the evaluation of the given selection expression string.
+ *
+ *     The expression is strictly evaluated left to right.  No nesting
+ *     is supported, so parentheses are not allowed.  The expression
+ *     must match the form:
+ *        <field><log op><value> [ <join> <field><log op><value>]
+ *     where,
+ *        <field> is a valid field name of the table.
+ *        <log op> is one of the following: =, <, >, <=, >=, <> (not equal).
+ *        <value> is a valid value for the field.
+ *        <join> is either " AND " or " OR ".
+ *     Any number of clauses (<field><log op><value>) may be joined
+ *     together with AND or OR to form the expression.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    expression <input>==(char *) selection expression string.
+ *    table      <input>==(vpf_table_type) VPF table structure.
+ *    return    <output>==(set_type) set of selected rows.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels    May 1991                          DOS Turbo C
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Functions Called:
+ *F
+ *    set_type set_init( ossim_int32 n ) SET.C
+ *    void set_insert( ossim_int32 element, set_type set ) SET.C
+ *    linked_list_type parse_expression( char *expression,
+ *                     vpf_table_type table ) VPFQUERY.C
+ *    row_type read_next_row( vpf_table_type table ) VPFREAD.C
+ *    position_type ll_first( linked_list_type list ) LINKLIST.C
+ *    int ll_end( position_type position ) LINKLIST.C
+ *    void ll_element( position_type position, void *element ) LINKLIST.C
+ *    void *get_table_element( ossim_int32 field_number,
+ * 			 row_type row,
+ *			 vpf_table_type table,
+ *			 void *value,
+ *			 ossim_int32  *count ) VPFREAD.C
+ *    void display_message( char *info ) USER DEFINED
+ *    static int strcompare( char *val1, char *val2, char op ) VPFQUERY.C
+ *    static int icompare( ossim_int32 val1, ossim_int32 val2, char op ) VPFQUERY.C
+ *    static int fcompare( float val1, float val2, char op ) VPFQUERY.C
+ *    void ll_reset( linked_list_type list ) LINKLIST.C
+      void free_row( row_type row, vpf_table_type table) VPFREAD.C
+ *E
+ *************************************************************************/
+set_type query_table( char *expression, vpf_table_type table )
+{
+   row_type row;
+   position_type pos;
+   expr_type expr;
+   register ossim_int32 i;
+   int boolval=FALSE, booltemp=0, join = OR;
+   ossim_int32 lval, lval2, count;
+   float fval, fval2;
+   char tval, tval2, *tptr;
+   linked_list_type exprlist;
+   set_type select_set;
+
+   select_set = set_init(table.nrows+1);
+
+   if (strcmp(expression,"*")==0) {
+      set_on(select_set);
+      return select_set;
+   }
+
+   exprlist = parse_expression( expression, table );
+
+   if (!exprlist) return select_set;
+
+   if (table.storage == DISK)
+      fseek( table.fp, index_pos(1,table), SEEK_SET );
+
+   for (i=1;i<=table.nrows;i++) {
+
+      if (table.storage == DISK)
+	 row = read_next_row(table);
+      else
+	 row = get_row( i, table );
+
+      pos = ll_first(exprlist);
+      while (!ll_end(pos)) {
+	 ll_element( pos, &expr );
+	 switch (table.header[expr.field].type) {
+	    case 'I':
+	       if (table.header[expr.field].count == 1) {
+		  get_table_element( expr.field, row, table, &lval, &count );
+		  lval2 = atol(expr.value);
+		  booltemp = icompare( lval, lval2, expr.op );
+	       } else {
+		  display_message(
+		     "Selection may not be performed upon arrays");
+		  i=table.nrows+1;
+	       }
+	       break;
+	    case 'T':
+	       if (table.header[expr.field].count == 1) {
+		  get_table_element( expr.field, row, table, &tval, &count );
+		  tval2 = expr.value[0];
+		  booltemp = comp( &tval, &tval2, sizeof(tval), expr.op );
+	       } else {
+		  tptr = (char *)get_table_element( expr.field, row, table,
+				   NULL, &count );
+		  booltemp = strcompare( tptr, expr.value, expr.op );
+		  free(tptr);
+	       }
+	       break;
+	    case 'F':
+	       if (table.header[expr.field].count == 1) {
+		  get_table_element( expr.field, row, table, &fval, &count );
+		  if (!is_vpf_null_float(fval)) {
+		     fval2 = (float)atof(expr.value);
+		     booltemp = fcompare( fval, fval2, expr.op );
+		  } else booltemp = FALSE;
+	       } else {
+		  display_message(
+		     "Selection may not be performed upon arrays");
+		  i=table.nrows+3;
+	       }
+	       break;
+	    default:
+	       display_message("Field type not supported for query");
+	       i=table.nrows+3;
+	       break;
+	 }
+
+	 if (i>table.nrows) break;
+
+	 if (join==OR)
+	    boolval = boolval || booltemp;
+	 else
+	    boolval = boolval && booltemp;
+
+	 join = expr.join;
+
+	 pos = pos->next;
+      }
+      free_row( row, table );
+      if (boolval) set_insert(i,select_set);
+      boolval = FALSE;
+      join = OR;
+
+      if (i==table.nrows+3) break;
+
+   }
+
+   ll_reset(exprlist);
+
+   return select_set;
+}
+
diff --git a/ossim/src/ossim/vpfutil/vpfread.c b/src/vpfutil/vpfread.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpfread.c
rename to src/vpfutil/vpfread.c
diff --git a/src/vpfutil/vpfrelat.c b/src/vpfutil/vpfrelat.c
new file mode 100644
index 0000000..8efced0
--- /dev/null
+++ b/src/vpfutil/vpfrelat.c
@@ -0,0 +1,907 @@
+/***************************************************************************
+ *
+ *N  Module VPFRELAT.C
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This module contains functions supporting relates between VPF
+ *    feature classes and primitives (and vice versa).  It relies
+ *    upon the information provided by the Feature Class Schema table.
+ *    This table is used to generate a feature class relationship (fcrel)
+ *    data structure for a feature class.  This structure contains all
+ *    of the tables and their primary and foreign keys for the
+ *    relationships between a feature table and its primitive, or
+ *    from a primitive to its feature table (each relate chain is one way).
+ *    This module tries to be as much of a black box as it can to
+ *    enable a programmer to simply return the corresponding primitive
+ *    row of a feature record, or the corresponding feature row of a
+ *    primitive record.
+ *
+ *    This is one of the most difficult modules required to support
+ *    a truly 'generic' VPF application, since VPF allows so many
+ *    variations of feature-primitive relationships.  The final version
+ *    of this module must support every allowed relationship.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels
+ *
+ *    Added one-to-many relates 3/2/92 - BJM
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   External Variables:
+ *X
+ *    None
+ *E
+ **************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef __MSDOS__
+#include <alloc.h>
+#include <mem.h>
+#else
+#ifdef __APPLE__ 
+#include <sys/types.h>
+#include <sys/malloc.h>
+#else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#include <malloc.h>
+#include <string.h>
+#endif
+#endif
+#endif
+
+
+#if defined(__CYGWIN__)||defined(__APPLE__)|| defined(_WIN32)
+#include <ossim/vpfutil/values.h>
+#else
+#include <ossim/vpfutil/values.h>
+#endif
+#include <string.h>
+#include <stdarg.h>
+#include <ossim/vpfutil/vpftable.h>
+#include <ossim/vpfutil/vpfview.h>
+#include <ossim/vpfutil/vpfrelat.h>
+#include <ossim/vpfutil/vpftidx.h>
+
+/* Determine if the given table name is in the given list of */
+/* vpf relate structures.                */
+static int table_in_list( char *tablename, linked_list_type rlist )
+{
+   position_type p;
+   vpf_relate_struct rcell;
+
+   p = ll_first(rlist);
+   while (!ll_end(p)) {
+      ll_element(p,&rcell);
+      if (strcmp(rcell.table1,tablename)==0) return 1;
+      p = ll_next(p);
+   }
+   return 0;
+}
+
+/**************************************************************************
+ *
+ *N  fcs_relate_list
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Read the feature class schema table and create the list of
+ *    tables to chain through.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    fcname       <input> == (char *) feature class name.
+ *    start_table  <input> == (char *) table to start from.
+ *    end_table    <input> == (char *) table to end with.
+ *    fcs          <input> == (vpf_table_type) feature class schema table.
+ *    fcs_relate_list <output> == (linked_list_type) list of tables to
+ *                                chain through.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+linked_list_type fcs_relate_list( char *fcname, char *start_table,
+              char *end_table, vpf_table_type fcs )
+{
+   linked_list_type rlist;
+   vpf_relate_struct rstruct;
+   set_type fcset, set1, set2;
+   char tablename[255], *buf, expr[255];
+   row_type row;
+   ossim_int32 rownum,n;
+   int TABLE1_, KEY1_, TABLE2_, KEY2_;
+
+   rlist = ll_init();
+
+   sprintf(expr,"FEATURE_CLASS = %s",fcname);
+
+   fcset = query_table(expr,fcs);
+
+   if (set_empty(fcset)) {
+      set_nuke(&fcset);
+      return rlist;
+   }
+
+   TABLE1_ = table_pos("TABLE1",fcs);
+   KEY1_ = table_pos("FOREIGN_KEY",fcs);
+   if (KEY1_ < 0) KEY1_ = table_pos("TABLE1_KEY",fcs);
+   TABLE2_ = table_pos("TABLE2",fcs);
+   KEY2_ = table_pos("PRIMARY_KEY",fcs);
+   if (KEY2_ < 0) KEY2_ = table_pos("TABLE2_KEY",fcs);
+
+   strcpy( tablename, start_table );
+   while (1) {
+      sprintf(expr,"TABLE1 = %s",tablename);
+
+      set1 = query_table(expr,fcs);
+      set2 = set_intersection(set1,fcset);
+      set_nuke(&set1);
+      if (set_empty(set2)) {
+    set_nuke(&fcset);
+    set_nuke(&set2);
+    return rlist;
+      }
+      rownum = set_min(set2);
+
+      set_nuke(&set2);
+
+      row = get_row(rownum,fcs);
+
+      buf = (char *)get_table_element(TABLE1_,row,fcs,NULL,&n);
+      strcpy(rstruct.table1,buf);
+      rightjust(rstruct.table1);
+      free(buf);
+
+      buf = (char *)get_table_element(KEY1_,row,fcs,NULL,&n);
+      strcpy(rstruct.key1,buf);
+      rightjust(rstruct.key1);
+      free(buf);
+
+      buf = (char *)get_table_element(TABLE2_,row,fcs,NULL,&n);
+      strcpy(rstruct.table2,buf);
+      rightjust(rstruct.table2);
+      free(buf);
+
+      buf = (char *)get_table_element(KEY2_,row,fcs,NULL,&n);
+      strcpy(rstruct.key2,buf);
+      rightjust(rstruct.key2);
+      free(buf);
+
+      rstruct.degree = R_ONE;  /* Default */
+
+      free_row( row, fcs );
+
+      if (table_in_list(rstruct.table1, rlist)) break;
+
+      ll_insert( &rstruct, sizeof(rstruct), ll_last(rlist) );
+
+      strcpy( tablename, rstruct.table2 );
+
+      if (ossim_strcasecmp(tablename,end_table)==0) break;
+   }
+
+   set_nuke(&fcset);
+
+   return rlist;
+}
+
+
+/**************************************************************************
+ *
+ *N  vpf_binary_search
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function performs a binary search on a VPF table for the
+ *    specified integer value.  Only VPF data type 'I' is supported.
+ *    The table must be sorted on the specified field, or this function
+ *    will give unpredictable results.  The table must have been
+ *    successfully opened.  If more than one row matches the search
+ *    value, only the first encountered will be returned.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    srchval <input> == (ossim_int32) specified search value.
+ *    field   <input> == (int) table sort field.
+ *    table   <input> == (vpf_table_type) VPF table.
+ *    vpf_binary_search <output> == (ossim_int32) first matching row.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+ossim_int32 vpf_binary_search( ossim_int32 srchval,
+             int field,
+             vpf_table_type table )
+{
+   ossim_int32 left,right, ival, rowid, n;
+   row_type row;
+
+   left = 1;
+   right = table.nrows;
+
+   do {
+      rowid = (left+right)/2;
+      row = get_row(rowid,table);
+      get_table_element(field,row,table,&ival,&n);
+      free_row(row,table);
+      if (ival < srchval)
+    right = rowid-1;
+      else
+    left = rowid+1;
+   } while ((srchval != ival) && (left <= right));
+
+   if (srchval != ival) rowid = 0;
+
+   return rowid;
+}
+
+
+/**************************************************************************
+ *
+ *N  related_row
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Return the related row of table2 based upon the value of table 1's key
+ *    Table 2 must be the '1' side of an n:1 relationship  --  If it isn't,
+ *    use 'related_rows()'.
+ *    Supported data types - I and T<n>.
+ *    Binary search supported only for data type I. (column must be sorted)
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+ossim_int32 related_row( void *keyval1,
+            vpf_table_type table2, char *key2,
+            int sort_flag )
+{
+   ossim_int32 rowid, i, ival, kval, n;
+   row_type row;
+   int KEY2_;
+   char cval, *tval;
+
+   if (ossim_strcasecmp(key2,"ID")==0) {
+      memcpy( &rowid, keyval1, sizeof(rowid) );
+      return rowid;
+   }
+
+   rowid = 0;
+
+   KEY2_ = table_pos(key2,table2);
+
+   if ((table2.header[KEY2_].type != 'I')&&
+       (table2.header[KEY2_].type != 'T')) return rowid;
+
+   if ((table2.header[KEY2_].type == 'I')&&
+       (table2.header[KEY2_].count != 1)) return rowid;
+
+   if ((table2.header[KEY2_].type == 'T')&&(sort_flag)) sort_flag = 0;
+
+   if (table2.header[KEY2_].type == 'I') memcpy(&kval,keyval1,sizeof(kval));
+
+   if (!sort_flag) {   /* Sequential search */
+
+      for (i=1;i<=table2.nrows;i++) {
+    row = get_row(i,table2);
+    if (table2.header[KEY2_].type == 'I') {
+       get_table_element(KEY2_,row,table2,&ival,&n);
+       if (ival == kval) rowid = i;
+    } else {
+       if (table2.header[KEY2_].count==1) {
+          get_table_element(KEY2_,row,table2,&cval,&n);
+          if (memcmp(&cval,keyval1,sizeof(ival))==0) rowid = i;
+       } else {
+          tval = (char*)get_table_element(KEY2_,row,table2,NULL,&n);
+          if (strcmp(tval,(char *)keyval1)==0) rowid = i;
+       }
+    }
+    free_row(row,table2);
+    if (rowid > 0) break;
+      }
+
+   } else {   /* Binary search */
+
+      memcpy(&kval,keyval1,sizeof(kval));
+      rowid = vpf_binary_search( kval, KEY2_, table2 );
+
+   }
+
+   return rowid;
+}
+
+
+/**************************************************************************
+ *
+ *N  related_rows
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Return the list of related rows of table2 based upon the value of
+ *    table 1's key.
+ *    Supported data types - I and T<n>.
+ *    Binary search supported only for data type I. (column must be sorted)
+ *    Thematic index used, if present on key column.
+ *    NOTE: A sequential search operation will search the entire
+ *          table ...zzz...
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+linked_list_type related_rows( void *keyval1,
+             vpf_table_type table2, char *key2,
+             int sort_flag,
+             ThematicIndex *idx )
+{
+   linked_list_type rowlist;
+   set_type rowset;
+   ossim_int32 rowid, i, ival, kval, n, start,end;
+   row_type row = 0;
+   int KEY2_;
+   char cval, *tval;
+
+   rowlist = ll_init();
+
+   if (ossim_strcasecmp(key2,"ID")==0) {
+      memcpy( &rowid, keyval1, sizeof(rowid) );
+      ll_insert(&rowid,sizeof(rowid),rowlist);
+      return rowlist;
+   }
+
+   KEY2_ = table_pos(key2,table2);
+
+   if ((table2.header[KEY2_].type != 'I')&&
+       (table2.header[KEY2_].type != 'T')) return rowlist;
+
+   if ((table2.header[KEY2_].type == 'I')&&
+       (table2.header[KEY2_].count != 1)) return rowlist;
+
+   if ((table2.header[KEY2_].type == 'T')&&(sort_flag)) sort_flag = 0;
+
+   if (idx) {
+      if (idx->fp) {
+    rowset = search_thematic_index(idx,(char *)keyval1);
+    start = set_min(rowset);
+    end = set_max(rowset);
+    for (i=start;i<=end;i++)
+       if (set_member(i,rowset)) {
+          ll_insert(&i,sizeof(i),ll_last(rowlist));
+       }
+    set_nuke(&rowset);
+    return rowlist;
+      }
+   }
+
+   if (!sort_flag) {   /* Sequential search */
+
+      for (i=1;i<=table2.nrows;i++) {
+    row = get_row(i,table2);
+    if (table2.header[KEY2_].type == 'I') {
+       get_table_element(KEY2_,row,table2,&ival,&n);
+       if (memcmp(&ival,keyval1,sizeof(ival))==0)
+          ll_insert(&i,sizeof(i),ll_last(rowlist));
+    } else {
+       if (table2.header[KEY2_].count==1) {
+          get_table_element(KEY2_,row,table2,&cval,&n);
+          if (memcmp(&cval,keyval1,sizeof(ival))==0)
+        ll_insert(&i,sizeof(i),ll_last(rowlist));
+       } else {
+          tval = (char*)get_table_element(KEY2_,row,table2,NULL,&n);
+          if (strcmp(tval,(char *)keyval1)==0)
+        ll_insert(&i,sizeof(i),ll_last(rowlist));
+       }
+    }
+    free_row(row,table2);
+      }
+
+   } else {   /* Binary search */
+
+      memcpy(&kval,keyval1,sizeof(kval));
+      rowid = vpf_binary_search( kval, KEY2_, table2 );
+
+      if (rowid > 0) {
+    ll_insert(&rowid,sizeof(rowid),ll_last(rowlist));
+    i = rowid-1L;
+    do {
+       row = get_row(i,table2);
+       get_table_element(KEY2_,row,table2,&ival,&n);
+       if (ival == kval)
+          ll_insert(&i,sizeof(i),ll_last(rowlist));
+       i--;
+       free_row(row, table2);
+    } while ((ival==kval)&&(i>0));
+    i = rowid+1L;
+    do {
+
+       row = get_row(i,table2);
+       get_table_element(KEY2_,row,table2,&ival,&n);
+       if (ival == kval)
+          ll_insert(&i,sizeof(i),ll_last(rowlist));
+       i++;
+       free_row(row, table2);
+    } while ((ival==kval)&&(i<=table2.nrows));
+      }
+
+   }
+
+   return rowlist;
+}
+
+
+/**************************************************************************
+ *
+ *N  vpf_nullify_table
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Nullify the given VPF table structure.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+void vpf_nullify_table( vpf_table_type *table )
+{
+   strcpy(table->name,"");
+   table->path = NULL;
+   table->nfields = 0;
+   strcpy(table->description,"");
+   strcpy(table->narrative,"");
+   table->header = NULL;
+   table->xfp = NULL;
+   table->index = NULL;
+   table->xstorage = (storage_type)0;
+   table->fp = NULL;
+   table->nrows = 0;
+   table->row = NULL;
+   table->reclen = 0;
+   table->ddlen = 0;
+   table->defstr = NULL;
+   table->storage = (storage_type)0;
+   table->mode = (file_mode)0;
+   table->status = CLOSED;
+}
+
+
+/**************************************************************************
+ *
+ *N  select_feature_class_relate
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Set up the relationships between features and primitives or between
+ *    primitives and features (one way only) for a specified feature class.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+fcrel_type select_feature_class_relate( int fcnum,
+               library_type *library,
+               char *start_table,
+               char *end_table )
+{
+   int storage, cov;
+   vpf_table_type fcs;
+   ossim_int32 i;
+   char path[255], covpath[255];
+   position_type p;
+   vpf_relate_struct rcell;
+   fcrel_type fcrel;
+
+   fcrel.nchain = 0;
+   fcrel.table = NULL;
+   fcrel.relate_list = NULL;
+
+   cov = library->fc[fcnum].coverage;
+   strcpy(covpath,library->cover[cov].path);
+   rightjust(covpath);
+   sprintf( path, "%sfcs", covpath );
+
+   /* Feature Class Schema table */
+   fcs = vpf_open_table( path, disk, "rb", NULL );
+
+   fcrel.relate_list = fcs_relate_list( library->fc[fcnum].name,
+               start_table,end_table,
+               fcs );
+
+   if (ll_empty(fcrel.relate_list)) {
+      ll_reset(fcrel.relate_list);
+      displaymessage("ERROR in feature class relationship!",
+           start_table,end_table,NULL);
+      return fcrel;
+   }
+
+   /* Find the number of tables in the relate chain */
+   p = ll_first(fcrel.relate_list);
+   fcrel.nchain = 0;
+   while (!ll_end(p)) {
+      fcrel.nchain++;
+      p = ll_next(p);
+   }
+   /* Allow for last table2 */
+   fcrel.nchain++;
+
+   fcrel.table = (vpf_table_type *)
+        vpfmalloc((fcrel.nchain+1)*
+              sizeof(vpf_table_type));
+
+   for (i=0;i<fcrel.nchain+1;i++)
+      vpf_nullify_table( &(fcrel.table[i]) );
+
+
+   p = ll_first(fcrel.relate_list);
+   for (i=0;i<fcrel.nchain-1;i++) {
+
+      ll_element(p,&rcell);
+
+      /** Can't open primitive table - may be several under tile **/
+      /** directories.  Open all others **/
+      if (!is_primitive(rcell.table1)) {
+
+    sprintf(path,"%s%s",covpath,rcell.table1);
+    if (is_join(rcell.table1))
+       storage = ram;
+    else
+       storage = disk;
+
+    fcrel.table[i] = vpf_open_table(path,(storage_type)storage,"rb",NULL);
+
+      }
+
+      if (!ll_end(p)) p = ll_next(p);
+   }
+
+   /* End of relate chain */
+   i = fcrel.nchain-1;
+   if (!is_primitive(rcell.table2)) {
+
+      sprintf(path,"%s%s",covpath,rcell.table2);
+      storage = disk;
+
+      fcrel.table[i] = vpf_open_table(path,(storage_type)storage,"rb",NULL);
+
+   }
+
+
+   vpf_close_table( &fcs );
+
+   return fcrel;
+}
+
+
+/**************************************************************************
+ *
+ *N  fc_row_number
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Given the starting row of a feature class relationship, return the
+ *    row number of the table at the end of the feature class relate
+ *    chain.
+ *    If your relate goes from the feature to the primitive, this will
+ *    return the primitive id for the given feature row.
+ *    If your relate goes from the primitive to the feature, this will
+ *    return the feature id of the given primitive row.
+ *
+ *    Currently only supports relates on 'I' or 'K' fields.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+ossim_int32 fc_row_number( row_type row, fcrel_type fcrel, ossim_int32 tile )
+{
+   row_type relrow;
+   ossim_int32 count;
+   ossim_int32 i, rownum, keyval;
+   id_triplet_type triplet_keyval;
+   int KEY1_, KEY_;
+   position_type p;
+   vpf_relate_struct rcell;
+
+   p = ll_first(fcrel.relate_list);
+   ll_element(p,&rcell);
+   KEY1_ = table_pos(rcell.key1,fcrel.table[0]);
+
+   get_table_element(0,row,fcrel.table[0],&rownum,&count);
+
+   if (KEY1_ == 0) {     /* "ID" */
+      keyval = rownum;
+   } else {
+      switch (fcrel.table[0].header[KEY1_].type) {
+    case 'I':
+       get_table_element(KEY1_,row,fcrel.table[0],&keyval,&count);
+       break;
+    case 'K':
+       get_table_element(KEY1_,row,fcrel.table[0],&triplet_keyval,
+               &count);
+       keyval = triplet_keyval.exid;
+       if (tile != triplet_keyval.tile) {
+          return -2;
+       }
+       break;
+    default:
+       keyval = 0;
+       break;
+      }
+   }
+
+   p = ll_first(fcrel.relate_list);
+   for (i=1;i<(fcrel.nchain-1);i++) {
+      /* Relate through Join table(s) */
+      rownum = related_row(&keyval,fcrel.table[i],rcell.key2,0);
+      relrow = get_row(rownum,fcrel.table[i]);
+
+      p = ll_next(p);
+      ll_element(p,&rcell);
+      KEY_ = table_pos(rcell.key1,fcrel.table[i]);
+
+      if (KEY_ == 0) {     /* "ID" */
+    keyval = rownum;
+      } else {
+    switch (fcrel.table[i].header[KEY_].type) {
+    case 'I':
+       get_table_element(KEY_,relrow,fcrel.table[i],&keyval,&count);
+       break;
+    case 'K':
+       get_table_element(KEY_,relrow,fcrel.table[i],&triplet_keyval,
+               &count);
+       keyval = triplet_keyval.exid;
+       if (tile != triplet_keyval.tile) {
+         free_row(relrow,fcrel.table[i]);
+          return -2;
+       }
+       break;
+    default:
+       keyval = 0;
+       break;
+    }
+      }
+
+      free_row(relrow,fcrel.table[i]);
+   }
+
+   if (ossim_strcasecmp(rcell.key2,"ID")==0)
+      rownum = keyval;
+   else
+      rownum = related_row(&keyval,fcrel.table[i],rcell.key2,0);
+
+   return rownum;
+}
+
+
+/**************************************************************************
+ *
+ *N  fc_row_numbers
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Given the starting row of a feature class relationship, return the
+ *    list of row numbers of the table at the end of the feature class
+ *    relate chain.
+ *    If your relate goes from the feature to the primitive, this will
+ *    return the primitive ids for the given feature row.
+ *    If your relate goes from the primitive to the feature, this will
+ *    return the feature ids of the given primitive row.
+ *
+ *    Currently only supports relates on 'I' or 'K' fields.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+linked_list_type fc_row_numbers( row_type row,
+             fcrel_type fcrel,
+             ossim_int32 tile,
+             ThematicIndex *idx )
+{
+   row_type relrow;
+   ossim_int32 count;
+   ossim_int32 n, rownum, keyval;
+   id_triplet_type triplet_keyval;
+   int KEY1_, KEY_;
+   position_type p, prow, pkey;
+   vpf_relate_struct rcell;
+   linked_list_type rowlist, keylist, templist;
+
+   p = ll_first(fcrel.relate_list);
+   ll_element(p,&rcell);
+   KEY1_ = table_pos(rcell.key1,fcrel.table[0]);
+
+   get_table_element(0,row,fcrel.table[0],&rownum,&count);
+
+   if (KEY1_ == 0) {     /* "ID" */
+      keyval = rownum;
+   } else {
+      switch (fcrel.table[0].header[KEY1_].type) {
+    case 'I':
+       get_table_element(KEY1_,row,fcrel.table[0],&keyval,&count);
+       break;
+    case 'K':
+       get_table_element(KEY1_,row,fcrel.table[0],&triplet_keyval,
+               &count);
+       keyval = triplet_keyval.exid;
+       if (tile != triplet_keyval.tile) {
+          keyval = -2;
+       }
+       break;
+    default:
+       keyval = 0;
+       break;
+      }
+   }
+
+   keylist = ll_init();
+   ll_insert(&keyval,sizeof(keyval),keylist);
+
+   n = 0;
+
+   p = ll_first(fcrel.relate_list);
+   for (n=1;n<(fcrel.nchain-1);n++) {
+
+      /* Relate through Join table(s) */
+
+      rowlist = ll_init();
+      pkey = ll_first(keylist);
+      while (!ll_end(pkey)) {
+    ll_element(pkey,&keyval);
+    templist = related_rows(&keyval,fcrel.table[n],rcell.key2,0,NULL);
+    prow = ll_first(templist);
+    while (!ll_end(prow)) {
+       ll_element(prow,&rownum);
+       if (!ll_locate(&rownum,rowlist))
+          ll_insert(&rownum,sizeof(rownum),ll_last(rowlist));
+       prow = ll_next(prow);
+    }
+    ll_reset(templist);
+    pkey = ll_next(pkey);
+      }
+      ll_reset(keylist);
+
+      p = ll_next(p);
+      ll_element(p,&rcell);
+      KEY_ = table_pos(rcell.key1,fcrel.table[n]);
+
+      keylist = ll_init();
+      prow = ll_first(rowlist);
+      while (!ll_end(prow)) {
+    ll_element(prow,&rownum);
+    relrow = get_row(rownum,fcrel.table[n]);
+
+    if (KEY_ == 0) {     /* "ID" */
+       keyval = rownum;
+    } else {
+       switch (fcrel.table[n].header[KEY_].type) {
+       case 'I':
+          get_table_element(KEY_,relrow,fcrel.table[n],&keyval,&count);
+          break;
+       case 'K':
+          get_table_element(KEY_,relrow,fcrel.table[n],&triplet_keyval,
+             &count);
+          keyval = triplet_keyval.exid;
+          if (tile != triplet_keyval.tile) {
+        keyval = -2;
+          }
+          break;
+       default:
+          keyval = 0;
+          break;
+       }
+    }
+    if (keyval > 0)
+       ll_insert(&keyval,sizeof(keyval),ll_last(keylist));
+    prow = ll_next(prow);
+    free_row(relrow,fcrel.table[n]);
+      }
+      ll_reset(rowlist);
+   }
+
+   rowlist = ll_init();
+   p = ll_first(keylist);
+   while (!ll_end(p)) {
+      ll_element(p,&keyval);
+      templist = related_rows(&keyval,fcrel.table[n],rcell.key2,0,idx);
+      prow = ll_first(templist);
+      while (!ll_end(prow)) {
+    ll_element(prow,&rownum);
+    if (!ll_locate(&rownum,rowlist))
+       ll_insert(&rownum,sizeof(rownum),ll_last(rowlist));
+    prow = ll_next(prow);
+      }
+      ll_reset(templist);
+      p = ll_next(p);
+   }
+   ll_reset(keylist);
+
+   return rowlist;
+}
+
+
+/**************************************************************************
+ *
+ *N  deselect_feature_class_relate
+ *
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    Clear out a previously allocated feature class relate structure
+ *    from memory.
+ *E
+ *:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels  DOS Turbo C
+ *E
+ *************************************************************************/
+void deselect_feature_class_relate( fcrel_type *fcrel )
+{
+   register int i;
+
+   if (fcrel->nchain > 0) {
+      for (i=0;i<fcrel->nchain;i++) {
+    if (fcrel->table[i].status == OPENED) {
+       vpf_close_table(&(fcrel->table[i]));
+    }
+      }
+      free(fcrel->table);
+      ll_reset(fcrel->relate_list);
+   }
+   fcrel->nchain = 0;
+}
diff --git a/src/vpfutil/vpfselec.c b/src/vpfutil/vpfselec.c
new file mode 100644
index 0000000..5e0a0ad
--- /dev/null
+++ b/src/vpfutil/vpfselec.c
@@ -0,0 +1,1320 @@
+/*************************************************************************
+ *
+ *N  Module VPFSELEC - VPF SELECTED FEATURES
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *     This module contains functions for selecting VPF features and
+ *     primitives.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     N/A
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   Nov 1991                           DOS Turbo C
+ *                     Feb 1992 - Optimized for CD-ROM performance.
+ *E
+ *************************************************************************/
+
+#ifdef __MSDOS__
+#include <alloc.h>
+#include <mem.h>
+#else
+#ifdef __APPLE__ 
+#include <sys/types.h>
+#include <sys/malloc.h>
+#else
+#if !defined(__OpenBSD__) && !defined( __FreeBSD__)
+#include <malloc.h>
+#include <string.h>
+#endif
+#endif
+#endif
+
+
+#ifdef __MSDOS__
+#include <graphics.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#ifdef __MSDOS__
+#include <sys\stat.h>
+#include <dos.h>
+#else
+#include <sys/stat.h>
+#include <limits.h>
+#endif
+#include <ossim/vpfutil/vpfview.h>
+#include <ossim/vpfutil/vpfprim.h>
+#include <ossim/vpfutil/vpfrelat.h>
+#include <ossim/vpfutil/mapgraph.h>
+#include <ossim/vpfutil/projectn.h>
+#include <ossim/vpfutil/vpftidx.h>
+#include <ossim/vpfutil/vpfselec.h>
+#include <ossim/vpfutil/vpfdraw.h>
+
+
+extern char home[255];
+
+/* Defined in VPFSPX.C */
+set_type spatial_index_search( char *fname,
+			       float x1, float y1, float x2, float y2 );
+
+
+#ifdef __MSDOS__
+/*************************************************************************
+ *
+ *N  read_selected_features
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function reads a saved selection set for a given theme of the
+ *    specified view.
+ *
+ *    NOTE:  This function has "special knowledge" about the structure of
+ *    a set.  If that structure is changed, this function must account
+ *    for those changes.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     view       <input>==(view_type *) view structure.
+ *     themenum   <input>==(int) theme number.
+ *     return    <output>==(set_type) set of selected features.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+set_type read_selected_features( view_type *view, int themenum )
+{
+   set_type selset;
+   char path[255], *num = "          ", byte;
+   FILE *fp;
+   register int i;
+
+   /* Determine path name from theme number */
+   strcpy(path,home);
+   strcat(path,view->name);
+   strcat(path,"\\sel");
+   num = itoa(themenum,num,10);
+   for (i=0;i<(4-strlen(num));i++)
+      strcat(path,"0");
+   strcat(path,num);
+
+   if (access(path,0) != 0) {
+      selset.size = 0;
+      selset.buf = NULL;
+      return selset;
+   }
+
+   /* Read the set */
+   if ((fp = fopen(path,"rb")) == NULL) {
+      selset.size = 0;
+      selset.buf = NULL;
+      return selset;
+   }
+   fread( &selset.size, sizeof(ossim_int32), 1, fp );
+   selset.buf = (char *)malloc( ((selset.size/8L)+1L) * sizeof(char) );
+   if (selset.buf) {
+      fread( selset.buf, sizeof(char), (selset.size/8L)+1L, fp );
+      selset.diskstorage = 0;
+   } else {
+      selset.diskstorage = 1;
+      /* Can speed this up by buffering */
+      selset.fp = tmpfile();
+      if (!selset.fp) {
+	 selset.diskstorage=0;
+	 selset.size=0;
+	 selset.buf=NULL;
+	 return selset;
+      }
+      fread(&byte,1,1,selset.fp);
+      while (!feof(fp)) {
+	 fwrite(&byte,1,1,selset.fp);
+	 fread(&byte,1,1,fp);
+      }
+   }
+   fclose(fp);
+
+
+   return selset;
+}
+
+
+/*************************************************************************
+ *
+ *N  save_selected_features
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function saves the selection set for a given theme of the
+ *    specified view to a file in the view directory.
+ *
+ *    NOTE:  This function has "special knowledge" about the structure of
+ *    a set.  If that structure is changed, this function must account
+ *    for those changes.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     view     <input>==(view_type *) view structure.
+ *     themenum <input>==(int) theme number.
+ *     selset   <input>==(set_type) set of selected features.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+void save_selected_features( view_type *view, int themenum,
+			     set_type selset )
+{
+   char path[80], *num="    ", byte;
+   FILE *fp;
+   register int i;
+
+   /* Determine the path name from the theme number */
+   strcpy(path,home);
+   strcat(path,view->name);
+   strcat(path,"\\sel");
+   num = itoa(themenum,num,10);
+   for (i=0;i<(4-strlen(num));i++)
+      strcat(path,"0");
+   strcat(path,num);
+
+   /* Write the set */
+   fp = fopen(path,"wb");
+   if (!fp) return;
+   fwrite( &(selset.size), sizeof(ossim_int32), 1, fp );
+   if (!selset.diskstorage) {
+      fwrite( selset.buf, sizeof(char), (selset.size/8L)+1L, fp );
+   } else {
+      rewind(selset.fp);
+      fread(&byte,1,1,selset.fp);
+      while (!feof(selset.fp)) {
+	 fwrite(&byte,1,1,fp);
+	 fread(&byte,1,1,selset.fp);
+      }
+   }
+   fclose(fp);
+}
+
+
+/*************************************************************************
+ *
+ *N  get_selected_features
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function gets the selection set for a given theme of the
+ *    specified view, either by querying the table, or by reading a
+ *    previously saved selection set file.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     view     <input>==(view_type *) view structure.
+ *     themenum <input>==(int) theme number.
+ *     library  <input>==(library-type) VPF library structure.
+ *     return  <output>==(set_type) set of selected features.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+set_type get_selected_features( view_type *view, int themenum,
+				library_type library )
+{
+   set_type selset;
+   vpf_table_type ft;
+   register int i;
+
+   /* Read a selection set, if present */
+   if (strcmp(view->name,"") != 0) {
+      selset = read_selected_features( view, themenum );
+      if (selset.size > 0) return selset;
+   }
+
+   /* No selection set... */
+
+   /* Find the feature class for the theme */
+   for (i=0;i<library.nfc;i++)
+      if (strcasecmp(library.fc[i].name,view->theme[themenum].fc)==0) break;
+   if (i>=library.nfc) {
+      display_message("Invalid theme in view");
+      return selset;
+   }
+
+   /* Query the feature table */
+   ft = vpf_open_table( library.fc[i].table, disk, "rb", NULL );
+   selset = query_table( view->theme[themenum].expression, ft );
+   vpf_close_table( &ft );
+
+   /* Save the selection set so we don't have to query again */
+   if (strcmp(view->name,"") != 0) {
+      save_selected_features( view, themenum, selset );
+   }
+
+   return selset;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  bounding_select
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function reads the bounding rectangle table to weed out the
+ *    local primitives.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *    path      <input> == (char *) path to the bounding rectangle table.
+ *    mapextent <input> == (extent_type) map extent to compare.
+ *    dec_degrees <input> == (int) flag to indicate if data is in decimal
+ *                                 degrees.
+ *    bounding_select <output> == (set_type) set of bounding rectangle ids.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+set_type bounding_select( char *path, extent_type mapextent,
+			  int dec_degrees )
+{
+   vpf_table_type table;
+   set_type set;
+   ossim_int32 i, count;
+   extent_type box, pextent;
+   double x1,y1,x2,y2;
+   row_type row;
+   int XMIN_,YMIN_,XMAX_,YMAX_;
+
+   /* Project all extents to plate-carree for cartesian comparisons */
+   /* (decimal degree coordinate systems) */
+
+   x1 = mapextent.x1; y1 = mapextent.y1;
+   x2 = mapextent.x2; y2 = mapextent.y2;
+   if (dec_degrees) {
+      set_plate_carree_parameters( central_meridian(x1,x2), 0.0, 1.0 );
+      pcarree_xy(&x1,&y1);
+      pcarree_xy(&x2,&y2);
+   }
+   pextent.x1 = x1; pextent.y1 = y1;
+   pextent.x2 = x2; pextent.y2 = y2;
+
+   table = vpf_open_table(path,disk,"rb",NULL);
+   XMIN_ = table_pos("XMIN",table);
+   YMIN_ = table_pos("YMIN",table);
+   XMAX_ = table_pos("XMAX",table);
+   YMAX_ = table_pos("YMAX",table);
+   set = set_init(table.nrows+1);
+   for (i=1;i<=table.nrows;i++) {
+      row = read_next_row(table);
+      get_table_element(XMIN_,row,table,&box.x1,&count);
+      get_table_element(YMIN_,row,table,&box.y1,&count);
+      get_table_element(XMAX_,row,table,&box.x2,&count);
+      get_table_element(YMAX_,row,table,&box.y2,&count);
+      free_row(row,table);
+
+      x1 = box.x1; y1 = box.y1;
+      x2 = box.x2; y2 = box.y2;
+      if (dec_degrees) {
+	 pcarree_xy(&x1,&y1);
+	 pcarree_xy(&x2,&y2);
+      }
+      box.x1 = x1; box.y1 = y1;
+      box.x2 = x2; box.y2 = y2;
+
+      if ( contained(box,pextent) || contained(pextent,box) ) {
+	 set_insert(i,set);
+      }
+   }
+   vpf_close_table(&table);
+
+   return set;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  tile_thematic_index_name
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function determines the name of the tile thematic index for
+ *    the given table.  If the table does not have a "TILE_ID" field,
+ *    the name is set to null.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     table    <input>==(vpf_table_type) opened VPF table.
+ *     path    <output>==(char *) name of the thematic index file.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+void tile_thematic_index_name( vpf_table_type table,
+			       char *path )
+{
+   int i;
+
+   i = table_pos("TILE_ID",table);
+   if (i<0) {
+      strcpy(path,"");
+   } else {
+      /* Thematic index name from the table header */
+      sprintf(path,"%s%s",table.path,table.header[i].tdx);
+   }
+}
+#endif
+/*************************************************************************
+ *
+ *N  completely_within
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function determines whether extent1 is completely within
+ *    extent2.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     extent1 <input>==(extent_type) first extent to compare.
+ *     extent2 <input>==(extent_type) second extent to compare.
+ *     return  <output>==(int) 1 if extent1 is completely within extent2,
+ *                             0 if not.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+int completely_within( extent_type extent1, extent_type extent2 )
+{
+   if (extent1.x1 < extent2.x1) return 0;
+   if (extent1.y1 < extent2.y1) return 0;
+   if (extent1.x2 > extent2.x2) return 0;
+   if (extent1.y2 > extent2.y2) return 0;
+   return 1;
+}
+
+#ifdef __MSDOS__
+/*************************************************************************
+ *
+ *N  get_selected_primitives
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function determines all of the selected primitive rows from
+ *    the selected features.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     view     <input> == (view_type *) view structure.
+ *     themenum <input> == (int) theme number.
+ *     library  <input> == (library_type *) VPF library structure.
+ *     mapenv   <input> == (map_environment_type *) map environment.
+ *     status  <output> == (int *) status of the function:
+ *                         1 if completed, 0 if user escape.
+ *     get_selected_primitives <output> == (set_type *) array of sets, each position
+ *                         representing the set of primitives for the
+ *                         corresponding tile in the tileref.aft table.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+set_type *get_selected_primitives( view_type *view,
+				   int themenum,
+				   library_type *library,
+				   map_environment_type *mapenv,
+				   int *status )
+{
+   int fcnum, finished, found, cov, tilecover, TILEPATH_, degree;
+   int feature, prim;
+   vpf_table_type tile_table;
+   row_type row;
+   char *ptable[] = {"","edg","fac","txt","end","cnd"};
+   char *spxname[] = {"","esi","fsi","tsi","nsi","csi"};
+   char *brname[] = {"","ebr","fbr","tbr","nbr","cbr"};
+   set_type feature_rows, primitive_rows, tile_features;
+   set_type *primitives;
+   ossim_int32 prim_rownum, count, tile;
+   register ossim_int32 i,j, pclass, start,end;
+   char path[255], covpath[255], tiledir[255], *buf, str[255];
+   fcrel_type fcrel;
+   linked_list_type primlist;
+   position_type p;
+   vpf_relate_struct rcell;
+   ThematicIndex idx;
+
+   primitives = (set_type *)vpfmalloc((library->ntiles+1)*sizeof(set_type));
+   for (i=0;i<=library->ntiles;i++) {
+      primitives[i].size = 0;
+      primitives[i].buf = NULL;
+   }
+
+   fcnum = view->theme[themenum].fcnum;
+
+   feature_rows = get_selected_features( view, themenum, *library );
+
+   /* Open the tile reference table, if present */
+   sprintf(path,"%stileref\\tileref.aft",library->path);
+   if (access(path,0) != 0) {
+      tilecover = FALSE;
+   } else {
+      tile_table = vpf_open_table(path,disk,"rb",NULL);
+      TILEPATH_ = table_pos("TILE_NAME",tile_table);
+      tilecover = TRUE;
+   }
+
+   for (pclass=EDGE;pclass<=CONNECTED_NODE;pclass++) {
+
+      if ((pclass != library->fc[fcnum].primclass) &&
+	  (library->fc[fcnum].primclass != COMPLEX_FEATURE)) continue;
+
+      /* Set up the feature class table relate chain.        */
+      /* The feature table is fcrel.table[0].                */
+      /* The primitive table is the last table in the chain: */
+      /*    fcrel.table[ fcrel.nchain-1 ].                   */
+
+      j = 0;
+      for (i=0;i<strlen(library->fc[fcnum].table);i++)
+	 if (library->fc[fcnum].table[i] == '\\') j = i+1;
+      strcpy( str, &(library->fc[fcnum].table[j]));
+      fcrel = select_feature_class_relate(fcnum, library, str,
+					  ptable[pclass]);
+      feature = 0;
+      prim = fcrel.nchain-1;
+
+      p = ll_previous(ll_last(fcrel.relate_list),fcrel.relate_list);
+      ll_element(p,&rcell);
+      degree = rcell.degree;
+
+      /*** 'Tile' number 1 is the universe polygon for the tileref cover ***/
+      for (tile = 2; tile <= library->ntiles; tile++ ) {
+
+	 if (!set_member(tile,library->tile_set)) continue;
+
+	 if (tilecover) {
+	    row = get_row(tile,tile_table);
+	    buf = (char *)get_table_element(TILEPATH_,row,tile_table,
+					     NULL,&count);
+	    free_row(row,tile_table);
+	    strcpy(tiledir,buf);
+	    rightjust(tiledir);
+	    strcat(tiledir,"\\");
+	    free(buf);
+	 } else {
+	    strcpy(tiledir,"");
+	 }
+
+	 cov = library->fc[fcnum].coverage;
+	 strcpy( covpath, library->cover[cov].path );
+
+	 finished = 1;
+	 found = 0;
+
+	 /* Open primitive table in tile */
+	 sprintf(path,"%s%s%s",covpath,tiledir,ptable[pclass]);
+	 if (access(path,0) != 0) continue;
+	 found = 1;
+	 fcrel.table[prim] = vpf_open_table(path,disk,"rb",NULL);
+
+	 if (primitives[tile].size > 0) {
+	    printf("Oops!  size = %ld\n",primitives[tile].size);
+	    exit(1);
+	 }
+	 primitives[tile] = set_init(fcrel.table[prim].nrows+1);
+
+	 /* Get the set of primitive rows within the map extent */
+
+	 /* Look for spatial index file */
+	 primitive_rows.size = 0;
+	 if (mapenv->projection == PLATE_CARREE &&
+	     mapenv->mapextent.x1 < mapenv->mapextent.x2) {
+	    sprintf(path,"%s%s%s",covpath,tiledir,spxname[pclass]);
+	    if ((access(path,0)==0)&&(fcrel.table[prim].nrows > 20)) {
+
+	       primitive_rows = spatial_index_search(path,
+			  mapenv->mapextent.x1,mapenv->mapextent.y1,
+			  mapenv->mapextent.x2,mapenv->mapextent.y2);
+
+	    } else {
+	       /* Next best thing - bounding rectangle table */
+	       sprintf(path,"%s%s%s",covpath,tiledir,brname[pclass]);
+	       if (access(path,0)==0) {
+		  primitive_rows = bounding_select(path,mapenv->mapextent,
+						   library->dec_degrees);
+	       }
+	    }
+	 } /* projection check */
+
+	 if (primitive_rows.size == 0) {
+	    /* Search through all the primitives */
+	    primitive_rows=set_init(fcrel.table[prim].nrows+1);
+	    set_on(primitive_rows);
+	 }
+
+	 tile_thematic_index_name(fcrel.table[feature], path);
+	 if ( (strcmp(path,"") != 0) && (access(path,4)==0) ) {
+	    /* Tile thematic index for feature table present, */
+	    tile_features = read_thematic_index( path, (char *)&tile );
+	 } else {
+	    tile_features = set_init(fcrel.table[feature].nrows+1);
+	    set_on(tile_features);
+	 }
+
+	 idx.fp = NULL;
+	 i = table_pos(rcell.key2,fcrel.table[prim]);
+	 if (i >= 0) {
+	    if (fcrel.table[prim].header[i].tdx) {
+	       sprintf(path,"%s%s",fcrel.table[prim].path,
+				fcrel.table[prim].header[i].tdx);
+	       if (access(path,0)==0)
+		  idx = open_thematic_index(path);
+	    }
+	    if (fcrel.table[prim].header[i].keytype == 'U') degree = R_ONE;
+	    if (fcrel.table[prim].header[i].keytype == 'N') degree = R_MANY;
+	    if (fcrel.table[prim].header[i].keytype == 'P') degree = R_ONE;
+	 }
+
+	 finished = 1;
+
+	 start = set_min(tile_features);
+	 end = set_max(tile_features);
+
+	 fseek(fcrel.table[feature].fp,
+	       index_pos(start,fcrel.table[feature]),
+	       SEEK_SET);
+
+	 for (i=start;i<=end;i++) {
+
+	    row = read_next_row(fcrel.table[feature]);
+
+	    if (!set_member( i, feature_rows )) {
+	       free_row(row,fcrel.table[feature]);
+	       continue;
+	    }
+
+	    if (!set_member( i, tile_features )) {
+	       free_row(row,fcrel.table[feature]);
+	       continue;
+	    }
+
+	    if (degree == R_ONE) {
+	       prim_rownum = fc_row_number( row, fcrel, tile );
+	       primlist = NULL;
+	       p = NULL;
+	    } else {
+	       primlist = fc_row_numbers( row, fcrel, tile, &idx );
+	    }
+
+	    free_row( row, fcrel.table[feature] );
+
+	    if (!primlist) {
+	       if ((prim_rownum<1)||
+		   (prim_rownum>fcrel.table[prim].nrows))
+		  continue;
+	       if (set_member( prim_rownum, primitive_rows )) {
+		  set_insert(prim_rownum,primitives[tile]);
+	       }
+	    } else {
+	       p = ll_first(primlist);
+	       while (!ll_end(p)) {
+		  ll_element(p,&prim_rownum);
+		  if ((prim_rownum<1)||
+		      (prim_rownum>fcrel.table[prim].nrows))
+		     continue;
+		  if (set_member( prim_rownum, primitive_rows )) {
+		     set_insert(prim_rownum,primitives[tile]);
+		  }
+		  p = ll_next(p);
+	       }
+	    }
+
+	    if (kbhit()) {
+	       if (getch()==27) {
+		  *status = 0;
+		  finished = 0;
+		  break;
+	       }
+	    }
+	 }
+
+	 if (idx.fp) close_thematic_index(&idx);
+
+	 vpf_close_table(&(fcrel.table[prim]));
+
+	 set_nuke(&primitive_rows);
+
+	 set_nuke(&tile_features);
+
+	 if (set_empty(primitives[tile])) {
+	    set_nuke(&primitives[tile]);
+	    primitives[tile].size = 0;
+	    primitives[tile].buf = NULL;
+	 }
+
+	 if (!finished) {
+	    *status = 0;
+	    break;
+	 }
+
+      }
+
+      if (!finished) {
+	 *status = 0;
+	 deselect_feature_class_relate( &fcrel );
+	 break;
+      }
+
+      if (found) *status = 1;
+
+      if (kbhit()) {
+	 if (getch()==27) {
+	    *status = 0;
+	    deselect_feature_class_relate( &fcrel );
+	    break;
+	 }
+      }
+
+      deselect_feature_class_relate( &fcrel );
+   }
+
+   set_nuke(&feature_rows);
+
+   if (tilecover) {
+      vpf_close_table(&tile_table);
+   }
+
+   return primitives;
+}
+
+
+
+/*************************************************************************
+ *
+ *N  get_selected_tile_primitives
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function determines all of the selected primitive rows from
+ *    the selected features of a given tile.
+ *
+ *    This function expects a feature class relationship structure that
+ *    has been successfully created with select_feature_class_relate()
+ *    from the feature table to the primitive.  The primitive table in
+ *    the feature class relate structure must have been successfully
+ *    opened for the given tile.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     library   <input>==(library_type *) VPF library structure.
+ *     fcnum     <input>==(int) feature class number of the feature table.
+ *     fcrel     <input>==(fcrel_type) feature class relate structure.
+ *     feature_rows <input>==(set_type) set of selected features.
+ *     mapenv    <input>==(map_environment_type *) map environment.
+ *     tile      <input>==(ossim_int32) tile number.
+ *     tiledir   <input>==(char *) path to the tile directory.
+ *     status   <output>==(int *) status of the function:
+ *                         1 if completed, 0 if user escape.
+ *     return   <output>==(set_type) set of primitives for the features
+ *                         in the corresponding tile.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   May 1991                           DOS Turbo C
+ *E
+ *************************************************************************/
+set_type get_selected_tile_primitives( library_type *library,
+				       int fcnum,
+				       fcrel_type fcrel,
+				       set_type feature_rows,
+				       map_environment_type *mapenv,
+				       ossim_int32 tile,
+				       char *tiledir,
+				       int *status )
+{
+   int cov, degree;
+   int feature, prim;
+   row_type row;
+   char *spxname[] = {"","esi","fsi","tsi","nsi","csi"};
+   char *brname[] = {"","ebr","fbr","tbr","nbr","cbr"};
+   set_type primitive_rows, tile_features;
+   set_type primitives;
+   ossim_int32 prim_rownum;
+   register ossim_int32 i,pclass, start,end;
+   char path[255], covpath[255];
+   linked_list_type primlist;
+   position_type p;
+   vpf_relate_struct rcell;
+   ThematicIndex idx;
+
+   feature = 0;
+   prim = fcrel.nchain-1;
+
+   /* Assume that fcrel.table[prim] has been opened */
+
+   primitives.size = 0;
+   primitives.buf = NULL;
+
+   cov = library->fc[fcnum].coverage;
+   strcpy( covpath, library->cover[cov].path );
+
+   p = ll_previous(ll_last(fcrel.relate_list),fcrel.relate_list);
+   ll_element(p,&rcell);
+   degree = rcell.degree;
+
+   for (pclass=EDGE;pclass<=CONNECTED_NODE;pclass++) {
+
+      if ((pclass != library->fc[fcnum].primclass) &&
+	  (library->fc[fcnum].primclass != COMPLEX_FEATURE)) continue;
+
+      primitives = set_init(fcrel.table[prim].nrows+1);
+
+      /* Get the set of primitive rows within the map extent */
+
+      /* Look for the spatial index file to weed out primitives in the */
+      /* given tile but outside of the viewing area.  If a projection  */
+      /* other than plate-carree (rectangular) is on, or if the extent */
+      /* crosses the meridian, the quick check is no longer valid.     */
+
+      primitive_rows.size = 0;
+
+      if (mapenv->projection == PLATE_CARREE &&
+	  mapenv->mapextent.x1 < mapenv->mapextent.x2) {
+	 sprintf(path,"%s%s%s",covpath,tiledir,spxname[pclass]);
+	 /* 20 (below) is a fairly arbitrary cutoff of the number of */
+	 /* primitives that make a spatial index search worth while. */
+	 if ((access(path,0)==0)&&(fcrel.table[prim].nrows > 20)) {
+	    primitive_rows = spatial_index_search(path,
+			  mapenv->mapextent.x1,mapenv->mapextent.y1,
+			  mapenv->mapextent.x2,mapenv->mapextent.y2);
+	 } else {
+	    /* Next best thing - bounding rectangle table */
+	    sprintf(path,"%s%s%s",covpath,tiledir,brname[pclass]);
+	    if ((access(path,0)==0)&&(fcrel.table[prim].nrows > 20)) {
+	       primitive_rows = bounding_select(path,mapenv->mapextent,
+						library->dec_degrees);
+	    }
+	 }
+      }
+      if (primitive_rows.size == 0) {
+	 /* Search through all the primitives */
+	 primitive_rows=set_init(fcrel.table[prim].nrows+1);
+	 set_on(primitive_rows);
+      }
+
+      if (strcmp(tiledir,"") != 0) {
+	 tile_thematic_index_name(fcrel.table[feature], path);
+	 if ((strcmp(path,"")!=0) && (access(path,4)==0)) {
+	    /* Tile thematic index for feature table present, */
+	    tile_features = read_thematic_index( path, (char *)&tile );
+	 } else {
+	    tile_features = set_init(fcrel.table[feature].nrows+1);
+	    set_on(tile_features);
+	 }
+      } else {
+	 tile_features = set_init(fcrel.table[feature].nrows+1);
+	 set_on(tile_features);
+      }
+      set_delete(0,tile_features);
+
+      idx.fp = NULL;
+      i = table_pos(rcell.key2,fcrel.table[prim]);
+      if (i >= 0) {
+	 if (fcrel.table[prim].header[i].tdx) {
+	    sprintf(path,"%s%s",fcrel.table[prim].path,
+				fcrel.table[prim].header[i].tdx);
+	    if (access(path,0)==0)
+	       idx = open_thematic_index(path);
+	 }
+	 if (fcrel.table[prim].header[i].keytype == 'U') degree = R_ONE;
+	 if (fcrel.table[prim].header[i].keytype == 'N') degree = R_MANY;
+	 if (fcrel.table[prim].header[i].keytype == 'P') degree = R_ONE;
+      }
+
+      start = set_min(tile_features);
+      end = set_max(tile_features);
+
+      /* It turns out to be MUCH faster off of a CD-ROM to */
+      /* read each row and discard unwanted ones than to   */
+      /* forward seek past them.  It's about the same off  */
+      /* of a hard disk.				      */
+
+      fseek(fcrel.table[feature].fp,index_pos(start,fcrel.table[feature]),
+	    SEEK_SET);
+
+      for (i=start;i<=end;i++) {
+
+	 row = read_next_row(fcrel.table[feature]);
+
+	 if (!set_member( i, feature_rows )) {
+	    free_row(row,fcrel.table[feature]);
+	    continue;
+	 }
+	 if (!set_member( i, tile_features )) {
+	    free_row(row,fcrel.table[feature]);
+	    continue;
+	 }
+
+	 if (degree == R_ONE) {
+	    prim_rownum = fc_row_number( row, fcrel, tile );
+	    primlist = NULL;
+	    p = NULL;
+	 } else {
+	    primlist = fc_row_numbers( row, fcrel, tile, &idx );
+	 }
+
+	 free_row( row, fcrel.table[feature] );
+
+	 if (!primlist) {
+	    if ((prim_rownum<1)||(prim_rownum>fcrel.table[prim].nrows))
+	       continue;
+	    if (set_member( prim_rownum, primitive_rows )) {
+	       set_insert(prim_rownum,primitives);
+	    }
+	 } else {
+	    p = ll_first(primlist);
+	    while (!ll_end(p)) {
+	       ll_element(p,&prim_rownum);
+	       if ((prim_rownum<1)||
+		   (prim_rownum>fcrel.table[prim].nrows))
+		  continue;
+	       if (set_member( prim_rownum, primitive_rows )) {
+		  set_insert(prim_rownum,primitives);
+	       }
+	       p = ll_next(p);
+	    }
+	 }
+
+	 if (primlist) ll_reset(primlist);
+
+	 if (kbhit()) {
+	    if (getch()==27) {
+	       *status = 0;
+	       break;
+	    }
+	 }
+      }
+
+      set_nuke(&primitive_rows);
+
+      set_nuke(&tile_features);
+
+      if (idx.fp) close_thematic_index(&idx);
+
+      *status = 1;
+
+      if (kbhit()) {
+	 if (getch()==27) {
+	    *status = 0;
+	    break;
+	 }
+      }
+   }
+
+   return primitives;
+}
+#endif
+
+#if __MSDOS__
+static ossim_int32 filesize( char *file )
+{
+   struct stat s;
+   stat(file,&s);
+   return (ossim_int32)s.st_size;
+}
+
+static ossim_int32 available_space( char *drive )
+{
+   struct dfree disktable;
+   int disknum;
+
+   if (!drive) return 0;
+
+   disknum=toupper(drive[0])-'A'+1;
+   getdfree(disknum,&disktable);
+   return (ossim_int32) disktable.df_avail *
+	  (ossim_int32) disktable.df_sclus *
+	  (ossim_int32) disktable.df_bsec;
+}
+#endif
+
+#ifdef __MSDOS__
+/*************************************************************************
+ *
+ *N  draw_selected_features
+ *
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Purpose:
+ *P
+ *    This function draws the selected features from a specified feature
+ *    class based upon a query (either an expression or the pre-compiled
+ *    results of an expression).
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   Parameters:
+ *A
+ *     view     <inout>==(view_type *) view structure.
+ *     themenum <input>==(int) theme number.
+ *     library  <input>==(library_type *) VPF library structure.
+ *     mapenv   <input>==(map_environment_type *) map environment structure.
+ *     return  <output>==(int) completion status:
+ *                                1 if completed successfully,
+ *                                0 if an error occurred.
+ *E
+ *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ *
+ *   History:
+ *H
+ *    Barry Michaels   August 1991                        DOS Turbo C
+ *E
+ *************************************************************************/
+int draw_selected_features( view_type *view,
+			    int themenum,
+			    library_type *library,
+			    map_environment_type *mapenv )
+{
+   int status, fcnum, finished, cov, tilecover, TILEPATH_, prim;
+   int outline, color1, color2, color3, color4;
+   vpf_table_type rngtable,edgtable,fbrtable, tile_table;
+   row_type row;
+   char *ptable[] = {"","edg","fac","txt","end","cnd"};
+   register ossim_int32 i, j, p, pclass, tile;
+   int display_order[] = {FACE,EDGE,ENTITY_NODE,CONNECTED_NODE,TEXT};
+   register ossim_int32 starttile, endtile, startprim, endprim;
+   ossim_int32 count;
+   char path[255], covpath[255], tiledir[255], *buf, str[255];
+   char *drive, rngpath[255],edgpath[255],edxpath[255],fbrpath[255];
+   boolean rng_rdisk,edg_rdisk,fbr_rdisk;
+   set_type primitives, feature_rows;
+   fcrel_type fcrel;
+   window_type info;
+   struct viewporttype vp;
+
+   getviewsettings(&vp);
+
+   fcnum = view->theme[themenum].fcnum;
+
+   sprintf(path,"%stileref\\tileref.aft",library->path);
+   if (access(path,0) != 0) {
+      tilecover = FALSE;
+   } else {
+      tile_table = vpf_open_table(path,disk,"rb",NULL);
+      TILEPATH_ = table_pos("TILE_NAME",tile_table);
+      tilecover = TRUE;
+   }
+
+   feature_rows = get_selected_features( view, themenum, *library );
+
+   for (p=0;p<5;p++) {
+      pclass = display_order[p];
+
+      if ((pclass != library->fc[fcnum].primclass) &&
+	  (library->fc[fcnum].primclass != COMPLEX_FEATURE)) continue;
+
+      if ((library->fc[fcnum].primclass == COMPLEX_FEATURE) &&
+	  (!library->fc[fcnum].cprim[pclass])) continue;
+
+      /* Set up the feature class table relate chain.        */
+      /* The feature table is fcrel.table[0].                */
+      /* The primitive table is the last table in the chain: */
+      /*    fcrel.table[ fcrel.nchain-1 ].                   */
+
+      j = 0;
+      for (i=0;i<strlen(library->fc[fcnum].table);i++)
+	 if (library->fc[fcnum].table[i] == '\\') j = i+1;
+      strcpy( str, &(library->fc[fcnum].table[j]));
+      fcrel = select_feature_class_relate(fcnum, library, str,
+					  ptable[pclass]);
+      prim = fcrel.nchain-1;
+
+      /*** 'Tile' number 1 is the universe polygon for
+	   the tileref cover ***/
+      starttile = set_min(library->tile_set);
+      if (starttile < 2) starttile = 2;
+      endtile = set_max(library->tile_set);
+      if (endtile < 2) endtile = 2;
+
+      for (tile = starttile; tile <= endtile; tile++ ) {
+
+	 if (!set_member(tile,library->tile_set)) continue;
+
+	 if (tilecover) {
+	    row = get_row(tile,tile_table);
+	    buf = (char *)get_table_element(TILEPATH_,row,tile_table,
+					     NULL,&count);
+	    free_row(row,tile_table);
+	    strcpy(tiledir,buf);
+	    rightjust(tiledir);
+	    strcat(tiledir,"\\");
+	    free(buf);
+	 } else {
+	    strcpy(tiledir,"");
+	 }
+
+	 cov = library->fc[fcnum].coverage;
+	 strcpy( covpath, library->cover[cov].path );
+
+	 finished = TRUE;
+
+	 sprintf(path,"%s%s%s",covpath,tiledir,ptable[pclass]);
+
+	 if (access(path,0) != 0) continue;
+	 fcrel.table[prim] = vpf_open_table(path,disk,"rb",NULL);
+
+	 info = info_window("Searching...");
+
+	 primitives = get_selected_tile_primitives( library,
+						    fcnum, fcrel,
+						    feature_rows,
+						    mapenv,
+						    tile, tiledir,
+						    &status );
+	 delete_window(&info);
+	 setviewport(vp.left,vp.top,vp.right,vp.bottom,vp.clip);
+
+	 /* Reset plate-carree parameters (changed in  */
+	 /* get_selected_tile_primitives() )           */
+	 if (mapenv->projection == PLATE_CARREE)
+	    set_plate_carree_parameters( central_meridian(
+					 mapenv->mapextent.x1,
+					 mapenv->mapextent.x2),
+					 0.0, 1.0 );
+
+	 if (primitives.size < 1) {
+	    vpf_close_table(&fcrel.table[prim]);
+	    continue;
+	 }
+
+	 if (!status) {
+	    set_nuke(&primitives);
+	    vpf_close_table(&fcrel.table[prim]);
+	    break;
+	 }
+
+	 if (pclass == FACE) {
+	    /* Must also open RNG, EDG, and FBR for drawing faces. */
+	    /* If a RAM disk is specified, copy these to it and open */
+	    /* them there. */
+	    rng_rdisk = FALSE;
+	    edg_rdisk = FALSE;
+	    fbr_rdisk = FALSE;
+	    drive = getenv("TMP");
+	    buf = (char *)vpfmalloc(255);
+
+	    sprintf(path,"%s%srng",covpath,tiledir);
+	    strcpy(rngpath,path);
+	    if (drive && filesize(path) < available_space(drive)) {
+	       sprintf(rngpath,"%s\\RNG",drive);
+	       sprintf(buf,"COPY %s %s > NUL",path,rngpath);
+	       system(buf);
+	       rng_rdisk = TRUE;
+	    }
+	    rngtable = vpf_open_table(rngpath,disk,"rb",NULL);
+
+	    sprintf(path,"%s%sedg",covpath,tiledir);
+	    strcpy(edgpath,path);
+            sprintf(edxpath,"%s%sedx",covpath,tiledir);
+	    if (drive &&
+	       (filesize(path)+filesize(edxpath))<available_space(drive)) {
+	       sprintf(edgpath,"%s\\EDG",drive);
+	       sprintf(buf,"COPY %s %s > NUL",path,edgpath);
+	       system(buf);
+	       sprintf(edxpath,"%s\\EDX",drive);
+	       sprintf(buf,"COPY %s%sedx %s > NUL",covpath,tiledir,edxpath);
+	       system(buf);
+	       edg_rdisk = TRUE;
+	    }
+	    edgtable = vpf_open_table(edgpath,disk,"rb",NULL);
+
+	    sprintf(path,"%s%sfbr",covpath,tiledir);
+	    strcpy(fbrpath,path);
+	    if (drive && filesize(path) < available_space(drive)) {
+	       sprintf(fbrpath,"%s\\FBR",drive);
+	       sprintf(buf,"COPY %s %s > NUL",path,fbrpath);
+	       system(buf);
+	       fbr_rdisk = TRUE;
+	    }
+	    fbrtable = vpf_open_table(fbrpath,disk,"rb",NULL);
+
+	    free(buf);
+	 }
+
+	 finished = 1;
+
+	 startprim = set_min(primitives);
+	 endprim = set_max(primitives);
+
+	 /* It turns out to be MUCH faster off of a CD-ROM to */
+	 /* read each row and discard unwanted ones than to   */
+	 /* forward seek past them.  It's about the same off  */
+	 /* of a hard disk.				      */
+
+	 fseek(fcrel.table[prim].fp,
+	       index_pos(startprim,fcrel.table[prim]),
+	       SEEK_SET);
+
+	 for (i=startprim;i<=endprim;i++) {
+
+	    row = read_next_row(fcrel.table[prim]);
+
+	    if (set_member( i, primitives )) {
+	       /* Draw the primitive */
+	       switch (pclass) {
+		  case EDGE:
+		     finished = draw_edge_row(row,fcrel.table[prim]);
+		     break;
+		  case ENTITY_NODE:
+		  case CONNECTED_NODE:
+		     finished = draw_point_row(row,fcrel.table[prim]);
+		     break;
+		  case FACE:
+		     gpgetlinecolor( &outline );
+		     gpgetpattern( &color1, &color2, &color3, &color4 );
+		     hidemousecursor();
+		     draw_face_row( row,fcrel.table[prim],
+				    rngtable, edgtable, fbrtable,
+				    outline,
+				    color1, color2, color3, color4 );
+		     showmousecursor();
+		     finished = 1;
+		     if (kbhit()) {
+			if (getch()==27) finished = 0;
+		     }
+		     break;
+		  case TEXT:
+		     finished = draw_text_row(row,fcrel.table[prim]);
+		     break;
+	       }
+	    }
+
+	    free_row(row,fcrel.table[prim]);
+
+	    if (!finished) {
+	       status = 0;
+	       break;
+	    }
+	 }
+
+	 if (pclass == FACE) {
+	    vpf_close_table(&rngtable);
+	    if (rng_rdisk) remove(rngpath);
+	    vpf_close_table(&edgtable);
+	    if (edg_rdisk) {
+	       remove(edgpath);
+	       remove(edxpath);
+	    }
+	    vpf_close_table(&fbrtable);
+	    if (fbr_rdisk) remove(fbrpath);
+	 }
+
+	 vpf_close_table(&fcrel.table[prim]);
+
+	 set_nuke(&primitives);
+
+	 if (!finished) {
+	    status = 0;
+	    break;
+	 }
+
+      }
+
+      if (!finished) {
+	 status = 0;
+	 deselect_feature_class_relate( &fcrel );
+	 break;
+      }
+
+      status = 1;
+
+      if (kbhit()) {
+	 if (getch()==27) {
+	    status = 0;
+	    deselect_feature_class_relate( &fcrel );
+	    break;
+	 }
+      }
+
+      deselect_feature_class_relate(&fcrel);
+   }
+
+   if (tilecover) {
+      vpf_close_table(&tile_table);
+   }
+
+   set_nuke(&feature_rows);
+
+   return status;
+}
+#endif
+
+
diff --git a/ossim/src/ossim/vpfutil/vpfspx.c b/src/vpfutil/vpfspx.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpfspx.c
rename to src/vpfutil/vpfspx.c
diff --git a/ossim/src/ossim/vpfutil/vpftable.c b/src/vpfutil/vpftable.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpftable.c
rename to src/vpfutil/vpftable.c
diff --git a/ossim/src/ossim/vpfutil/vpftidx.c b/src/vpfutil/vpftidx.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpftidx.c
rename to src/vpfutil/vpftidx.c
diff --git a/ossim/src/ossim/vpfutil/vpfwrite.c b/src/vpfutil/vpfwrite.c
similarity index 100%
rename from ossim/src/ossim/vpfutil/vpfwrite.c
rename to src/vpfutil/vpfwrite.c
diff --git a/support/linux/etc/ld.so.conf.d/ossim.conf b/support/linux/etc/ld.so.conf.d/ossim.conf
new file mode 100644
index 0000000..23b43c0
--- /dev/null
+++ b/support/linux/etc/ld.so.conf.d/ossim.conf
@@ -0,0 +1,2 @@
+# Add lib path for ossim for non-standard install:
+# /usr/local/ossim/lib64
diff --git a/support/linux/etc/profile.d/ossim.csh b/support/linux/etc/profile.d/ossim.csh
new file mode 100644
index 0000000..21945c3
--- /dev/null
+++ b/support/linux/etc/profile.d/ossim.csh
@@ -0,0 +1,19 @@
+#---
+# Open Source Software Image Map(OSSIM) csh initialization script (csh).
+# This file is installed by ossim rpm in: /etc/profile.d/ossim.csh
+#---
+if ( ! $?OSSIM_INSTALL_PREFIX ) then
+   setenv OSSIM_INSTALL_PREFIX "/usr"
+endif
+
+if ( ( ! $?OSSIM_PREFS_FILE ) then
+   setenv OSSIM_PREFS_FILE $OSSIM_INSTALL_PREFIX/share/ossim/ossim-site-preferences
+endif
+
+#---
+# Stub to set path for non-standard install:
+#---
+# set ossim_bin=/usr/local/ossim/bin
+# if ( "${path}" !~ *$ossim_bin* ) then
+#   set path = ( $ossim_bin $path )
+# endif
diff --git a/support/linux/etc/profile.d/ossim.sh b/support/linux/etc/profile.d/ossim.sh
new file mode 100644
index 0000000..e078f8d
--- /dev/null
+++ b/support/linux/etc/profile.d/ossim.sh
@@ -0,0 +1,20 @@
+#---
+# Open Source Software Image Map(OSSIM) bash initialization script (sh).
+# This file is installed by ossim rpm in: /etc/profile.d/ossim.sh
+#---
+if [ -z "$OSSIM_INSTALL_PREFIX" ]; then
+   export OSSIM_INSTALL_PREFIX=/usr
+fi
+
+if [ -z "$OSSIM_PREFS_FILE" ]; then
+   export OSSIM_PREFS_FILE=$OSSIM_INSTALL_PREFIX/share/ossim/ossim-site-preferences
+fi
+
+#---
+# Stub to set path for non-standard install:
+#---
+# ossim_bin=/usr/local/ossim/bin
+# if ! echo ${PATH} | /bin/grep -q $ossim_bin ; then
+#    PATH=$ossim_bin:${PATH}
+# fi
+# export PATH
diff --git a/support/linux/rpm_specs/ossim-all-el6.spec b/support/linux/rpm_specs/ossim-all-el6.spec
new file mode 100644
index 0000000..e48aec0
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-all-el6.spec
@@ -0,0 +1,565 @@
+#---
+# File: ossim-all-el6.spec
+#
+# Spec file for building ossim rpms with rpmbuild.
+#
+# NOTE: This files differs from ossim-all-el7.spec in that it needs libtiff4
+# to pick up bigtiff support.
+#
+# Example usage:
+# rpmbuild -ba --define 'RPM_OSSIM_VERSION 1.9.0' --define 'BUILD_RELEASE 1' ossim-el7.spec
+#
+# Caveats: 
+# 1) Builder/user needs "groovy" in their search path.
+# 2) Use "archive.sh" script in ossim/scripts/archive.sh to generate the source
+#    tar ball, e.g. ossim-1.9.0.tar.gz, from appropriate git branch.
+#---
+Name:           ossim
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        Open Source Software Image Map library and command line applications
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        LGPLv2+
+URL:            https://github.com/orgs/ossimlabs/dashboard
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+
+BuildRequires: ant
+BuildRequires: cmake
+BuildRequires: ffmpeg-devel
+BuildRequires: gdal-devel
+BuildRequires: geos-devel
+# BuildRequires: hdf4-devel
+BuildRequires: hdf5a-devel
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libgeotiff-devel
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
+BuildRequires: libtiff4-devel
+#BuildRequires: libRaw-devel
+BuildRequires: minizip-devel
+BuildRequires: opencv-devel
+BuildRequires: OpenSceneGraph-devel
+BuildRequires: OpenThreads-devel
+BuildRequires: podofo-devel
+BuildRequires: qt4-devel
+BuildRequires: sqlite-devel
+BuildRequires: gpstk-devel
+BuildRequires: openjpeg2-devel
+#BuildRequires: swig
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+
+%description
+OSSIM is a powerful suite of geospatial libraries and applications
+used to process remote sensing imagery, maps, terrain, and vector data.
+
+%package 	devel
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description devel
+Development files for ossim.
+
+%package 	libs
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+
+%description libs
+Libraries for ossim.
+
+%package 	geocell
+Summary:        Desktop electronic light table
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geocell
+Desktop electronic light table for geospatial image processing. Has 2D, 2 1/2D
+and 3D viewer with image chain editing capabilities.
+
+%package        oms
+Summary:        Wrapper library/java bindings for interfacing with ossim.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms
+This sub-package contains the oms wrapper library with java bindings for
+interfacing with the ossim library from java.
+
+%package        oms-devel
+Summary:        Development files for ossim oms wrapper library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms-devel
+This sub-package contains the development files for oms.
+
+%package 	planet
+Summary:        3D ossim library interface via OpenSceneGraph
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet
+3D ossim library interface via OpenSceneGraph.
+
+%package 	planet-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet-devel
+This sub-package contains development files for ossim planet.
+
+%package        test-apps
+Summary:        Ossim test apps.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    test-apps
+A suite of ossim test apps.
+
+%package 	video
+Summary:        Ossim vedeo library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video
+Ossim vedeo library.
+
+%package 	video-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video-devel
+This sub-package contains development files for ossim planet.
+
+# libwms does not depend on ossim
+%package        wms
+Summary:        wms ossim library
+Group:          System Environment/Libraries
+
+%description    wms
+This sub-package contains the web mapping service (wms) library.
+
+%package 	wms-devel
+Summary:        Development files libwms
+Group:          System Environment/Libraries
+Requires:       libwms%{?_isa} = %{version}-%{release}
+
+%description    wms-devel
+This sub-package contains the development files for libwms.
+
+#---
+# ossim plugins:
+#---
+%package 	cnes-plugin
+Summary:        Plugin with various sensor models
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description cnes-plugin
+This sub-package contains the ossim plugin which has various SAR sensor models,
+readers, and support data parsers.  Most of this code was provided by the ORFEO
+Toolbox (OTB) group / Centre national d'études spatiales.
+
+%package 	gdal-plugin
+Summary:        GDAL ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description gdal-plugin
+This sub-package contains the Geospatial Data Abstraction Library(gdal) ossim
+plugin for reading/writing images supported by the gdal library.
+
+%package 	geopdf-plugin
+Summary:        geopdf ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geopdf-plugin
+This sub-package contains the geopdf ossim plugin for reading geopdf files via
+the podofo library.
+
+%package 	hdf5-plugin
+Summary:        HDF5 ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description hdf5-plugin
+This sub-package contains the Hierarchical Data Format(hdf) ossim plugin for
+reading hdf5 images via the hdf5 libraries
+
+%package  	jpip-server
+Summary:        ossim kakadu jpip server
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+Requires:       kakadu-plugin%{?_isa} = %{version}-%{release}
+
+%description    jpip-server
+This sub-package contains the ossim kakadu jpip server for streaming
+J2K compressed data to via the Kakadu library.
+
+%package  	kml-plugin
+Summary:        kml ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    kml-plugin
+This sub-package contains the kmlsuperoverlay ossim plugin for reading/writing
+kml super overlays.
+
+%package  	kakadu-plugin
+Summary:        kakadu ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    kakadu-plugin
+This sub-package contains the kakadu ossim plugin for reading/writing
+J2K compressed data via the Kakadu library.
+
+%package  	mrsid-plugin
+Summary:        mrsid ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    mrsid-plugin
+This sub-package contains the mrsid ossim plugin for reading/writing
+mrsid compressed data via the MrSID library.
+
+%package  	opencv-plugin
+Summary:        OSSIM OpenCV plugin, contains registration code.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    opencv-plugin
+This sub-package contains the ossim opencv plugin with various pieces of 
+image registration code.
+
+%package  	openjpeg-plugin
+Summary:        OpenJPEG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    openjpeg-plugin
+This sub-package contains the OpenJPEG ossim plugin for
+reading/writing J2K compressed images via the OpenJPEG library.
+
+%package 	png-plugin
+Summary:        PNG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description png-plugin
+This sub-package contains the Portable Network Graphic(png) ossim plugin for
+reading/writing png images via the png library.
+
+%package  	sqlite-plugin
+Summary:        OSSIM sqlite plugin, contains GeoPackage reader/writer.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description sqlite-plugin
+This sub-package contains GeoPackage reader/writer.
+
+%package 	web-plugin
+Summary:        web ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description web-plugin
+This sub-package contains the web ossim plugin for interfacing with http via
+curl library. 
+
+%prep
+
+#---
+# Notes for debugging:
+# Using the "%setup -q -D -T" is handy debugging.
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+# %setup -q -D
+%setup -q
+
+# Delete bundled libraw
+rm -rf ossim_plugins/libraw/LibRaw-0.9.0/
+
+
+%build
+
+# Exports for ossim abuild:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_INSTALL_PREFIX=/usr
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+mkdir -p build
+pushd build
+%cmake \
+-DOSSIM_BUILD_ADDITIONAL_DIRECTORIES=$OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server \
+-DBUILD_CSMAPI=OFF \
+-DBUILD_OMS=ON \
+-DBUILD_OSSIM=ON \
+-DBUILD_OSSIM_APPS=ON \
+-DBUILD_OSSIM_CURL_APPS=ON \
+-DBUILD_OSSIM_GUI=ON \
+-DBUILD_OSSIM_TESTS=ON \
+-DBUILD_OSSIM_MPI_SUPPORT=OFF \
+-DBUILD_OSSIM_PLANET=ON \
+-DBUILD_OSSIM_PLANET_QT=OFF \
+-DBUILD_OSSIM_VIDEO=ON \
+\
+-DBUILD_CNES_PLUGIN=ON \
+-DBUILD_CONTRIB_PLUGIN=OFF \
+-DBUILD_CSM_PLUGIN=OFF \
+-DBUILD_GDAL_PLUGIN=ON \
+-DBUILD_GEOPDF_PLUGIN=ON \
+-DBUILD_HDF5_PLUGIN=ON \
+-DBUILD_KAKADU_PLUGIN=ON \
+-DBUILD_KML_PLUGIN=ON \
+-DBUILD_LIBRAW_PLUGIN=OFF \
+-DBUILD_MRSID_PLUGIN=ON \
+-DBUILD_OSSIMMRSID_PLUGIN=ON \
+-DBUILD_NDF_PLUGIN=OFF \
+-DBUILD_OPENCV_PLUGIN=ON \
+-DBUILD_OPENJPEG_PLUGIN=ON \
+-DBUILD_PDAL_PLUGIN=OFF \
+-DBUILD_PNG_PLUGIN=ON \
+-DBUILD_REGISTRATION_PLUGIN=OFF \
+-DBUILD_SQLITE_PLUGIN=ON \
+-DBUILD_WEB_PLUGIN=ON \
+\
+-DBUILD_RUNTIME_DIR=bin \
+-DBUILD_SHARED_LIBS=ON \
+-DBUILD_WMS=ON \
+\
+-DOSSIMPLANET_ENABLE_EPHEMERIS=OFF \
+\
+-DCMAKE_BUILD_TYPE=$OSSIM_BUILD_TYPE \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/ossim_package_support/cmake/CMakeModules \
+-DCMAKE_PREFIX_PATH=/usr \
+\
+-DKAKADU_ROOT_SRC=/opt/kakadu/latest \
+-DKAKADU_AUX_LIBRARY=/opt/kakadu/latest/lib/Linux-x86-64-gcc/libkdu_aux.a \
+-DKAKADU_LIBRARY=/opt/kakadu/latest/lib/Linux-x86-64-gcc/libkdu.a  \
+\
+-DMRSID_DIR=/opt/mrsid/latest \
+\
+../ossim/cmake
+make VERBOSE=1 %{?_smp_mflags}
+popd
+
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+
+# Build c++ jni bindings and java side of oms module:
+pushd ossim-oms/joms
+cp local.properties.template local.properties
+ant
+popd
+
+%install
+
+# Exports for ossim install:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.sh %{buildroot}%{_sysconfdir}/profile.d/ossim.sh
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.csh %{buildroot}%{_sysconfdir}/profile.d/ossim.csh
+install -p -m644 -D ossim/share/ossim/templates/ossim_preferences_template %{buildroot}%{_datadir}/ossim/ossim-preferences-template
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+export OSSIM_INSTALL_PREFIX=%{buildroot}/usr
+
+# mrsid libraries:
+# Need to replace /opt/mrsid/latest with variable later
+install -p -m755 -D /opt/mrsid/latest/Lidar_DSDK/lib/liblti_lidar_dsdk.so %{buildroot}%{_libdir}
+install -p -m755 -D /opt/mrsid/latest/Raster_DSDK/lib/libltidsdk.so %{buildroot}%{_libdir}
+
+# oms "ant" build:
+pushd ossim-oms/joms
+ant dist
+ant install
+# ant mvn-install
+# Fix bad perms:
+chmod 755 %{buildroot}%{_libdir}/libjoms.so
+popd
+
+
+%post
+/sbin/ldconfig
+
+# First time through create the site preferences.
+if [ ! -f %{_datadir}/ossim/ossim-site-preferences ]; then
+   cp %{_datadir}/ossim/ossim-preferences-template %{_datadir}/ossim/ossim-site-preferences
+fi
+
+%post oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+ln -s %{_javadir}/joms-%{version}.jar %{_javadir}/joms.jar
+
+%post planet
+/sbin/ldconfig
+
+%post wms
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%postun oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+
+%postun planet
+/sbin/ldconfig
+
+%postun wms
+/sbin/ldconfig
+
+
+%files
+%{_bindir}/*
+
+# Weed out apps:
+%exclude %{_bindir}/ossim-*-test
+
+%exclude %{_bindir}/ossim-adrg-dump
+%exclude %{_bindir}/ossim-btoa
+%exclude %{_bindir}/ossim-computeSrtmStats
+%exclude %{_bindir}/ossim-correl 
+%exclude %{_bindir}/ossim-create-bitmask
+%exclude %{_bindir}/ossim-dump-ocg
+%exclude %{_bindir}/ossim-image-compare
+%exclude %{_bindir}/ossim-modopt
+%exclude %{_bindir}/ossimplanetklv
+%exclude %{_bindir}/ossimplanet-chip
+%exclude %{_bindir}/ossimplanettest
+%exclude %{_bindir}/ossim-rejout
+%exclude %{_bindir}/ossim-rpf 
+%exclude %{_bindir}/ossim-senint
+%exclude %{_bindir}/ossim-space-imaging
+%exclude %{_bindir}/ossim-src2src
+%exclude %{_bindir}/ossim-swapbytes
+%exclude %{_bindir}/ossim-ws-cmp
+
+# These are in the geocell package:
+%exclude %{_bindir}/ossim-geocell
+%exclude %{_bindir}/ossimplanetviewer
+
+# In jpip-server package:
+%exclude %{_bindir}/ossim-jpip-server
+
+%files devel
+%{_includedir}/ossim
+
+%files libs
+%{_datadir}/ossim/
+%doc ossim/LICENSE.txt
+%{_libdir}/libossim.so*
+%{_libdir}/pkgconfig/ossim.pc
+%{_sysconfdir}/profile.d/ossim.sh
+%{_sysconfdir}/profile.d/ossim.csh
+
+%files geocell
+%{_bindir}/ossim-geocell
+%{_libdir}/libossimGui.so*
+
+%files oms
+%{_javadir}/joms-%{version}.jar
+%{_libdir}/libjoms.so
+%{_libdir}/liboms.so*
+
+%files oms-devel
+%{_includedir}/oms/
+
+%files planet
+# %{_bindir}/ossimplanet
+%{_bindir}/ossimplanetviewer
+%{_libdir}/libossim-planet.so*
+# %{_libdir}/libossimPlanetQt.so*
+
+%files planet-devel
+%{_includedir}/ossimPlanet
+
+%files test-apps
+%{_bindir}/ossim-*-test
+
+%files video
+%{_libdir}/libossim-video.so*
+
+%files video-devel
+%{_includedir}/ossimPredator
+
+%files wms
+%{_includedir}/wms/
+%{_libdir}/libossim-wms.so*
+
+#---
+# ossim plugins
+#---
+%files cnes-plugin
+%{_libdir}/ossim/plugins/libossim_cnes_plugin.so
+
+%files gdal-plugin
+%{_libdir}/ossim/plugins/libossim_gdal_plugin.so
+
+%files geopdf-plugin
+%{_libdir}/ossim/plugins/libossim_geopdf_plugin.so
+
+%files hdf5-plugin
+%{_libdir}/ossim/plugins/libossim_hdf5_plugin.so
+
+%files jpip-server
+%{_bindir}/ossim-jpip-server
+
+%files kml-plugin
+%{_libdir}/ossim/plugins/libossim_kml_plugin.so
+
+%files kakadu-plugin
+%{_libdir}/ossim/plugins/libossim_kakadu_plugin.so
+%{_libdir}/libkdu_a75R.so
+%{_libdir}/libkdu_v75R.so
+
+%files mrsid-plugin
+%{_libdir}/ossim/plugins/libossim_mrsid_plugin.so
+%{_libdir}/liblti_lidar_dsdk.so
+%{_libdir}/libltidsdk.so
+
+%files opencv-plugin
+%{_libdir}/ossim/plugins/libossim_opencv_plugin.so
+
+%files openjpeg-plugin
+%{_libdir}/ossim/plugins/libossim_openjpeg_plugin.so
+
+%files png-plugin
+%{_libdir}/ossim/plugins/libossim_png_plugin.so
+
+%files sqlite-plugin
+%{_libdir}/ossim/plugins/libossim_sqlite_plugin.so
+
+%files web-plugin
+%{_libdir}/ossim/plugins/libossim_web_plugin.so
+
+
+
+%changelog
+* Sun Dec 29 2013 Volker Fröhlich <volker27 at gmx.at> - yes-1
+- Initial package
diff --git a/support/linux/rpm_specs/ossim-all-el7.spec b/support/linux/rpm_specs/ossim-all-el7.spec
new file mode 100644
index 0000000..39ddfb7
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-all-el7.spec
@@ -0,0 +1,565 @@
+#---
+# File: ossim-all-el7.spec
+#
+# Spec file for building ossim rpms with rpmbuild.
+#
+# NOTE: This files differs from ossim-all-el6.spec in that it does not need
+# libtiff4 to pick up bigtiff support as libtiff is version 4.x.
+#
+# Example usage:
+# rpmbuild -ba --define 'RPM_OSSIM_VERSION 1.9.0' --define 'BUILD_RELEASE 1' ossim-el7.spec
+#
+# Caveats: 
+# 1) Builder/user needs "groovy" in their search path.
+# 2) Use "archive.sh" script in ossim/scripts/archive.sh to generate the source
+#    tar ball, e.g. ossim-1.9.0.tar.gz, from appropriate git branch.
+#---
+Name:           ossim
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        Open Source Software Image Map library and command line applications
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        LGPLv2+
+URL:            https://github.com/orgs/ossimlabs/dashboard
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+BuildRequires: ant
+BuildRequires: cmake
+BuildRequires: ffmpeg-devel
+BuildRequires: gdal-devel
+BuildRequires: geos-devel
+# BuildRequires: hdf4-devel
+BuildRequires: hdf5a-devel
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libgeotiff-devel
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
+BuildRequires: libtiff-devel
+#BuildRequires: libRaw-devel
+BuildRequires: minizip-devel
+BuildRequires: opencv-devel
+BuildRequires: OpenSceneGraph-devel
+BuildRequires: OpenThreads-devel
+BuildRequires: podofo-devel
+BuildRequires: qt4-devel
+BuildRequires: sqlite-devel
+BuildRequires: gpstk-devel
+BuildRequires: openjpeg2-devel
+#BuildRequires: swig
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+
+%description
+OSSIM is a powerful suite of geospatial libraries and applications
+used to process remote sensing imagery, maps, terrain, and vector data.
+
+%package 	devel
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description devel
+Development files for ossim.
+
+%package 	libs
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+
+%description libs
+Libraries for ossim.
+
+%package 	geocell
+Summary:        Desktop electronic light table
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geocell
+Desktop electronic light table for geospatial image processing. Has 2D, 2 1/2D
+and 3D viewer with image chain editing capabilities.
+
+%package        oms
+Summary:        Wrapper library/java bindings for interfacing with ossim.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms
+This sub-package contains the oms wrapper library with java bindings for
+interfacing with the ossim library from java.
+
+%package        oms-devel
+Summary:        Development files for ossim oms wrapper library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms-devel
+This sub-package contains the development files for oms.
+
+%package 	planet
+Summary:        3D ossim library interface via OpenSceneGraph
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet
+3D ossim library interface via OpenSceneGraph.
+
+%package 	planet-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet-devel
+This sub-package contains development files for ossim planet.
+
+%package        test-apps
+Summary:        Ossim test apps.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    test-apps
+A suite of ossim test apps.
+
+%package 	video
+Summary:        Ossim vedeo library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video
+Ossim vedeo library.
+
+%package 	video-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video-devel
+This sub-package contains development files for ossim planet.
+
+# libwms does not depend on ossim
+%package        wms
+Summary:        wms ossim library
+Group:          System Environment/Libraries
+
+%description    wms
+This sub-package contains the web mapping service (wms) library.
+
+%package 	wms-devel
+Summary:        Development files libwms
+Group:          System Environment/Libraries
+Requires:       libwms%{?_isa} = %{version}-%{release}
+
+%description    wms-devel
+This sub-package contains the development files for libwms.
+
+#---
+# ossim plugins:
+#---
+%package 	cnes-plugin
+Summary:        Plugin with various sensor models
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description cnes-plugin
+This sub-package contains the ossim plugin which has various SAR sensor models,
+readers, and support data parsers.  Most of this code was provided by the ORFEO
+Toolbox (OTB) group / Centre national d'études spatiales.
+
+%package 	gdal-plugin
+Summary:        GDAL ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description gdal-plugin
+This sub-package contains the Geospatial Data Abstraction Library(gdal) ossim
+plugin for reading/writing images supported by the gdal library.
+
+%package 	geopdf-plugin
+Summary:        geopdf ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geopdf-plugin
+This sub-package contains the geopdf ossim plugin for reading geopdf files via
+the podofo library.
+
+%package 	hdf5-plugin
+Summary:        HDF5 ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description hdf5-plugin
+This sub-package contains the Hierarchical Data Format(hdf) ossim plugin for
+reading hdf5 images via the hdf5 libraries
+
+%package  	jpip-server
+Summary:        ossim kakadu jpip server
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+Requires:       kakadu-plugin%{?_isa} = %{version}-%{release}
+
+%description    jpip-server
+This sub-package contains the ossim kakadu jpip server for streaming
+J2K compressed data to via the Kakadu library.
+
+%package  	kml-plugin
+Summary:        kml ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    kml-plugin
+This sub-package contains the kmlsuperoverlay ossim plugin for reading/writing
+kml super overlays.
+
+%package  	kakadu-plugin
+Summary:        kakadu ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    kakadu-plugin
+This sub-package contains the kakadu ossim plugin for reading/writing
+J2K compressed data via the Kakadu library.
+
+%package  	mrsid-plugin
+Summary:        mrsid ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    mrsid-plugin
+This sub-package contains the mrsid ossim plugin for reading/writing
+mrsid compressed data via the MrSID library.
+
+%package  	opencv-plugin
+Summary:        OSSIM OpenCV plugin, contains registration code.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    opencv-plugin
+This sub-package contains the ossim opencv plugin with various pieces of 
+image registration code.
+
+%package  	openjpeg-plugin
+Summary:        OpenJPEG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    openjpeg-plugin
+This sub-package contains the OpenJPEG ossim plugin for
+reading/writing J2K compressed images via the OpenJPEG library.
+
+%package 	png-plugin
+Summary:        PNG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description png-plugin
+This sub-package contains the Portable Network Graphic(png) ossim plugin for
+reading/writing png images via the png library.
+
+%package  	sqlite-plugin
+Summary:        OSSIM sqlite plugin, contains GeoPackage reader/writer.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description sqlite-plugin
+This sub-package contains GeoPackage reader/writer.
+
+%package 	web-plugin
+Summary:        web ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description web-plugin
+This sub-package contains the web ossim plugin for interfacing with http via
+curl library. 
+
+%prep
+
+#---
+# Notes for debugging:
+# Using the "%setup -q -D -T" is handy debugging.
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+# %setup -q -D
+%setup -q
+
+# Delete bundled libraw
+rm -rf ossim_plugins/libraw/LibRaw-0.9.0/
+
+
+%build
+
+# Exports for ossim abuild:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_INSTALL_PREFIX=/usr
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+# Need to ensure ossim-private branch on kak_v7_7
+pushd $OSSIM_DEV_HOME/ossim-private
+git checkout kak_v7_7
+popd
+
+mkdir -p build
+pushd build
+%cmake \
+-DOSSIM_BUILD_ADDITIONAL_DIRECTORIES=$OSSIM_DEV_HOME/ossim-private/ossim-kakadu-jpip-server \
+-DBUILD_CSMAPI=OFF \
+-DBUILD_OMS=ON \
+-DBUILD_OSSIM=ON \
+-DBUILD_OSSIM_APPS=ON \
+-DBUILD_OSSIM_CURL_APPS=ON \
+-DBUILD_OSSIM_GUI=ON \
+-DBUILD_OSSIM_TESTS=ON \
+-DBUILD_OSSIM_MPI_SUPPORT=OFF \
+-DBUILD_OSSIM_PLANET=ON \
+-DBUILD_OSSIM_PLANET_QT=OFF \
+-DBUILD_OSSIM_VIDEO=ON \
+\
+-DBUILD_CNES_PLUGIN=ON \
+-DBUILD_CONTRIB_PLUGIN=OFF \
+-DBUILD_CSM_PLUGIN=OFF \
+-DBUILD_GDAL_PLUGIN=ON \
+-DBUILD_GEOPDF_PLUGIN=ON \
+-DBUILD_HDF5_PLUGIN=ON \
+-DBUILD_KAKADU_PLUGIN=ON \
+-DBUILD_KML_PLUGIN=ON \
+-DBUILD_LIBRAW_PLUGIN=OFF \
+-DBUILD_MRSID_PLUGIN=ON \
+-DBUILD_OSSIMMRSID_PLUGIN=ON \
+-DBUILD_NDF_PLUGIN=OFF \
+-DBUILD_OPENCV_PLUGIN=ON \
+-DBUILD_OPENJPEG_PLUGIN=ON \
+-DBUILD_PDAL_PLUGIN=OFF \
+-DBUILD_PNG_PLUGIN=ON \
+-DBUILD_REGISTRATION_PLUGIN=OFF \
+-DBUILD_SQLITE_PLUGIN=ON \
+-DBUILD_WEB_PLUGIN=ON \
+\
+-DBUILD_RUNTIME_DIR=bin \
+-DBUILD_SHARED_LIBS=ON \
+-DBUILD_WMS=ON \
+\
+-DOSSIMPLANET_ENABLE_EPHEMERIS=OFF \
+\
+-DCMAKE_BUILD_TYPE=$OSSIM_BUILD_TYPE \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/ossim_package_support/cmake/CMakeModules \
+-DCMAKE_PREFIX_PATH=/usr \
+\
+-DKAKADU_ROOT_SRC=/opt/kakadu/latest \
+-DKAKADU_AUX_LIBRARY=/opt/kakadu/latest/lib/Linux-x86-64-gcc/libkdu_a77R.so \
+-DKAKADU_LIBRARY=/opt/kakadu/latest/lib/Linux-x86-64-gcc/libkdu_v77R.so  \
+\
+-DMRSID_DIR=/opt/mrsid/latest \
+\
+../ossim/cmake
+make VERBOSE=1 %{?_smp_mflags}
+popd
+
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+
+# Build c++ jni bindings and java side of oms module:
+pushd ossim-oms/joms
+cp local.properties.template local.properties
+ant
+popd
+
+%install
+
+# Exports for ossim install:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.sh %{buildroot}%{_sysconfdir}/profile.d/ossim.sh
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.csh %{buildroot}%{_sysconfdir}/profile.d/ossim.csh
+install -p -m644 -D ossim/share/ossim/templates/ossim_preferences_template %{buildroot}%{_datadir}/ossim/ossim-preferences-template
+
+# Shared Kakadu libs.
+install -p -m775 /opt/kakadu/latest/lib/Linux-x86-64-gcc/libkdu_a77R.so %{buildroot}%{_libdir}/.
+install -p -m775 /opt/kakadu/latest/lib/Linux-x86-64-gcc/libkdu_v77R.so %{buildroot}%{_libdir}/.
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+export OSSIM_INSTALL_PREFIX=%{buildroot}/usr
+
+# oms "ant" build:
+pushd ossim-oms/joms
+ant dist
+ant install
+# ant mvn-install
+# Fix bad perms:
+chmod 755 %{buildroot}%{_libdir}/libjoms.so
+popd
+
+
+%post
+/sbin/ldconfig
+
+# First time through create the site preferences.
+if [ ! -f %{_datadir}/ossim/ossim-site-preferences ]; then
+   cp %{_datadir}/ossim/ossim-preferences-template %{_datadir}/ossim/ossim-site-preferences
+fi
+
+%post oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+ln -s %{_javadir}/joms-%{version}.jar %{_javadir}/joms.jar
+
+%post planet
+/sbin/ldconfig
+
+%post wms
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%postun oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+
+%postun planet
+/sbin/ldconfig
+
+%postun wms
+/sbin/ldconfig
+
+
+%files
+%{_bindir}/*
+
+# Weed out apps:
+%exclude %{_bindir}/ossim-*-test
+
+%exclude %{_bindir}/ossim-adrg-dump
+%exclude %{_bindir}/ossim-btoa
+%exclude %{_bindir}/ossim-computeSrtmStats
+%exclude %{_bindir}/ossim-correl 
+%exclude %{_bindir}/ossim-create-bitmask
+%exclude %{_bindir}/ossim-dump-ocg
+%exclude %{_bindir}/ossim-image-compare
+%exclude %{_bindir}/ossim-modopt
+%exclude %{_bindir}/ossimplanetklv
+%exclude %{_bindir}/ossimplanet-chip
+%exclude %{_bindir}/ossimplanettest
+%exclude %{_bindir}/ossim-rejout
+%exclude %{_bindir}/ossim-rpf 
+%exclude %{_bindir}/ossim-senint
+%exclude %{_bindir}/ossim-space-imaging
+%exclude %{_bindir}/ossim-src2src
+%exclude %{_bindir}/ossim-swapbytes
+%exclude %{_bindir}/ossim-ws-cmp
+
+# These are in the geocell package:
+%exclude %{_bindir}/ossim-geocell
+%exclude %{_bindir}/ossimplanetviewer
+
+# In jpip-server package:
+%exclude %{_bindir}/ossim-jpip-server
+
+%files devel
+%{_includedir}/ossim
+
+%files libs
+%{_datadir}/ossim/
+%doc ossim/LICENSE.txt
+%{_libdir}/libossim.so*
+%{_libdir}/pkgconfig/ossim.pc
+%{_sysconfdir}/profile.d/ossim.sh
+%{_sysconfdir}/profile.d/ossim.csh
+
+%files geocell
+%{_bindir}/ossim-geocell
+%{_libdir}/libossimGui.so*
+
+%files oms
+%{_javadir}/joms-%{version}.jar
+%{_libdir}/libjoms.so
+%{_libdir}/liboms.so*
+
+%files oms-devel
+%{_includedir}/oms/
+
+%files planet
+# %{_bindir}/ossimplanet
+%{_bindir}/ossimplanetviewer
+%{_libdir}/libossim-planet.so*
+# %{_libdir}/libossimPlanetQt.so*
+
+%files planet-devel
+%{_includedir}/ossimPlanet
+
+%files test-apps
+%{_bindir}/ossim-*-test
+
+%files video
+%{_libdir}/libossim-video.so*
+
+%files video-devel
+%{_includedir}/ossimPredator
+
+%files wms
+%{_includedir}/wms/
+%{_libdir}/libossim-wms.so*
+
+#---
+# ossim plugins
+#---
+%files cnes-plugin
+%{_libdir}/ossim/plugins/libossim_cnes_plugin.so
+
+%files gdal-plugin
+%{_libdir}/ossim/plugins/libossim_gdal_plugin.so
+
+%files geopdf-plugin
+%{_libdir}/ossim/plugins/libossim_geopdf_plugin.so
+
+%files hdf5-plugin
+%{_libdir}/ossim/plugins/libossim_hdf5_plugin.so
+
+%files jpip-server
+%{_bindir}/ossim-jpip-server
+
+%files kml-plugin
+%{_libdir}/ossim/plugins/libossim_kml_plugin.so
+
+%files kakadu-plugin
+%{_libdir}/ossim/plugins/libossim_kakadu_plugin.so
+%{_libdir}/libkdu_a77R.so
+%{_libdir}/libkdu_v77R.so
+
+%files mrsid-plugin
+%{_libdir}/ossim/plugins/libossim_mrsid_plugin.so
+
+%files opencv-plugin
+%{_libdir}/ossim/plugins/libossim_opencv_plugin.so
+
+%files openjpeg-plugin
+%{_libdir}/ossim/plugins/libossim_openjpeg_plugin.so
+
+%files png-plugin
+%{_libdir}/ossim/plugins/libossim_png_plugin.so
+
+%files sqlite-plugin
+%{_libdir}/ossim/plugins/libossim_sqlite_plugin.so
+
+%files web-plugin
+%{_libdir}/ossim/plugins/libossim_web_plugin.so
+
+
+%changelog
+* Sun Dec 29 2013 Volker Fröhlich <volker27 at gmx.at> - yes-1
+- Initial package
diff --git a/support/linux/rpm_specs/ossim-el6.spec b/support/linux/rpm_specs/ossim-el6.spec
new file mode 100644
index 0000000..76f4932
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-el6.spec
@@ -0,0 +1,507 @@
+#---
+# File: ossim-el7.spec
+#
+# Spec file for building ossim rpms with rpmbuild.
+#
+# NOTE: This files differs from ossim-el6.spec on in el6 need libtiff4 to pick
+# up bigtiff support.
+#
+# Example usage:
+# rpmbuild -ba --define 'RPM_OSSIM_VERSION 1.9.0' --define 'BUILD_RELEASE 1' ossim-el7.spec
+#
+# Caveats: 
+# 1) Builder/user needs "groovy" in their search path.
+# 2) Use "archive.sh" script in ossim/scripts/archive.sh to generate the source
+#    tar ball, e.g. ossim-1.9.0.tar.gz, from appropriate git branch.
+#---
+Name:           ossim
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        Open Source Software Image Map library and command line applications
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        LGPLv2+
+URL:            https://github.com/orgs/ossimlabs/dashboard
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+BuildRequires: ant
+BuildRequires: cmake
+BuildRequires: ffmpeg-devel
+BuildRequires: gdal-devel
+BuildRequires: geos-devel
+# BuildRequires: hdf4-devel
+BuildRequires: hdf5a-devel
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libgeotiff-devel
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
+BuildRequires: libtiff4-devel
+#BuildRequires: libRaw-devel
+BuildRequires: minizip-devel
+BuildRequires: opencv-devel
+BuildRequires: OpenSceneGraph-devel
+BuildRequires: OpenThreads-devel
+BuildRequires: podofo-devel
+BuildRequires: qt4-devel
+BuildRequires: sqlite-devel
+BuildRequires: gpstk-devel
+BuildRequires: openjpeg2-devel
+#BuildRequires: swig
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+
+%description
+OSSIM is a powerful suite of geospatial libraries and applications
+used to process remote sensing imagery, maps, terrain, and vector data.
+
+%package 	devel
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description devel
+Development files for ossim.
+
+%package 	libs
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+
+%description libs
+Libraries for ossim.
+
+%package 	geocell
+Summary:        Desktop electronic light table
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geocell
+Desktop electronic light table for geospatial image processing. Has 2D, 2 1/2D
+and 3D viewer with image chain editing capabilities.
+
+%package        oms
+Summary:        Wrapper library/java bindings for interfacing with ossim.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms
+This sub-package contains the oms wrapper library with java bindings for
+interfacing with the ossim library from java.
+
+%package        oms-devel
+Summary:        Development files for ossim oms wrapper library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms-devel
+This sub-package contains the development files for oms.
+
+%package 	planet
+Summary:        3D ossim library interface via OpenSceneGraph
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet
+3D ossim library interface via OpenSceneGraph.
+
+%package 	planet-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet-devel
+This sub-package contains development files for ossim planet.
+
+%package        test-apps
+Summary:        Ossim test apps.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    test-apps
+A suite of ossim test apps.
+
+%package 	video
+Summary:        Ossim vedeo library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video
+Ossim vedeo library.
+
+%package 	video-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video-devel
+This sub-package contains development files for ossim planet.
+
+# libwms does not depend on ossim
+%package        wms
+Summary:        wms ossim library
+Group:          System Environment/Libraries
+
+%description    wms
+This sub-package contains the web mapping service (wms) library.
+
+%package 	wms-devel
+Summary:        Development files libwms
+Group:          System Environment/Libraries
+Requires:       libwms%{?_isa} = %{version}-%{release}
+
+%description    wms-devel
+This sub-package contains the development files for libwms.
+
+#---
+# ossim plugins:
+#---
+%package 	cnes-plugin
+Summary:        Plugin with various sensor models
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description cnes-plugin
+This sub-package contains the ossim plugin which has various SAR sensor models,
+readers, and support data parsers.  Most of this code was provided by the ORFEO
+Toolbox (OTB) group / Centre national d'études spatiales.
+
+%package 	gdal-plugin
+Summary:        GDAL ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description gdal-plugin
+This sub-package contains the Geospatial Data Abstraction Library(gdal) ossim
+plugin for reading/writing images supported by the gdal library.
+
+%package 	geopdf-plugin
+Summary:        geopdf ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geopdf-plugin
+This sub-package contains the geopdf ossim plugin for reading geopdf files via
+the podofo library.
+
+%package 	hdf5-plugin
+Summary:        HDF5 ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description hdf5-plugin
+This sub-package contains the Hierarchical Data Format(hdf) ossim plugin for
+reading hdf5 images via the hdf5 libraries
+
+%package  	kml-plugin
+Summary:        kml ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    kml-plugin
+This sub-package contains the kmlsuperoverlay ossim plugin for reading/writing
+kml super overlays.
+
+%package  	opencv-plugin
+Summary:        OSSIM OpenCV plugin, contains registration code.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    opencv-plugin
+This sub-package contains the ossim opencv plugin with various pieces of 
+image registration code.
+
+%package  	openjpeg-plugin
+Summary:        OpenJPEG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    openjpeg-plugin
+This sub-package contains the OpenJPEG ossim plugin for
+reading/writing J2K compressed images via the OpenJPEG library.
+
+%package 	png-plugin
+Summary:        PNG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description png-plugin
+This sub-package contains the Portable Network Graphic(png) ossim plugin for
+reading/writing png images via the png library.
+
+%package  	sqlite-plugin
+Summary:        OSSIM sqlite plugin, contains GeoPackage reader/writer.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description sqlite-plugin
+This sub-package contains GeoPackage reader/writer.
+
+%package 	web-plugin
+Summary:        web ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description web-plugin
+This sub-package contains the web ossim plugin for interfacing with http via
+curl library. 
+
+%prep
+
+#---
+# Notes for debugging:
+# Using the "%setup -q -D -T" is handy debugging.
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+# %setup -q -D
+%setup -q
+
+# Delete bundled libraw
+rm -rf ossim_plugins/libraw/LibRaw-0.9.0/
+
+
+%build
+
+# Exports for ossim abuild:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_INSTALL_PREFIX=/usr
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+mkdir -p build
+pushd build
+%cmake \
+-DBUILD_CSMAPI=OFF \
+-DBUILD_OMS=ON \
+-DBUILD_OSSIM=ON \
+-DBUILD_OSSIM_APPS=ON \
+-DBUILD_OSSIM_CURL_APPS=ON \
+-DBUILD_OSSIM_GUI=ON \
+-DBUILD_OSSIM_TESTS=ON \
+-DBUILD_OSSIM_MPI_SUPPORT=OFF \
+-DBUILD_OSSIM_PLANET=ON \
+-DBUILD_OSSIM_PLANET_QT=OFF \
+-DBUILD_OSSIM_VIDEO=ON \
+\
+-DBUILD_CNES_PLUGIN=ON \
+-DBUILD_CONTRIB_PLUGIN=OFF \
+-DBUILD_CSM_PLUGIN=OFF \
+-DBUILD_GDAL_PLUGIN=ON \
+-DBUILD_GEOPDF_PLUGIN=ON \
+-DBUILD_HDF5_PLUGIN=ON \
+-DBUILD_KAKADU_PLUGIN=OFF \
+-DBUILD_KML_PLUGIN=ON \
+-DBUILD_LIBRAW_PLUGIN=OFF \
+-DBUILD_MRSID_PLUGIN=OFF \
+-DBUILD_OSSIMMRSID_PLUGIN=ON \
+-DBUILD_NDF_PLUGIN=OFF \
+-DBUILD_OPENCV_PLUGIN=ON \
+-DBUILD_OPENJPEG_PLUGIN=ON \
+-DBUILD_PDAL_PLUGIN=OFF \
+-DBUILD_PNG_PLUGIN=ON \
+-DBUILD_REGISTRATION_PLUGIN=OFF \
+-DBUILD_SQLITE_PLUGIN=ON \
+-DBUILD_WEB_PLUGIN=ON \
+\
+-DBUILD_RUNTIME_DIR=bin \
+-DBUILD_SHARED_LIBS=ON \
+-DBUILD_WMS=ON \
+\
+-DOSSIMPLANET_ENABLE_EPHEMERIS=OFF \
+\
+-DCMAKE_BUILD_TYPE=$OSSIM_BUILD_TYPE \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/ossim_package_support/cmake/CMakeModules \
+-DCMAKE_PREFIX_PATH=/usr \
+../ossim/cmake
+make VERBOSE=1 %{?_smp_mflags}
+popd
+
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+
+# Build c++ jni bindings and java side of oms module:
+pushd ossim-oms/joms
+cp local.properties.template local.properties
+ant
+popd
+
+%install
+
+# Exports for ossim install:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.sh %{buildroot}%{_sysconfdir}/profile.d/ossim.sh
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.csh %{buildroot}%{_sysconfdir}/profile.d/ossim.csh
+install -p -m644 -D ossim/share/ossim/templates/ossim_preferences_template %{buildroot}%{_datadir}/ossim/ossim-preferences-template
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+export OSSIM_INSTALL_PREFIX=%{buildroot}/usr
+
+# oms "ant" build:
+pushd ossim-oms/joms
+ant dist
+ant install
+# ant mvn-install
+# Fix bad perms:
+chmod 755 %{buildroot}%{_libdir}/libjoms.so
+popd
+
+
+%post
+/sbin/ldconfig
+
+# First time through create the site preferences.
+if [ ! -f %{_datadir}/ossim/ossim-site-preferences ]; then
+   cp %{_datadir}/ossim/ossim-preferences-template %{_datadir}/ossim/ossim-site-preferences
+fi
+
+%post oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+ln -s %{_javadir}/joms-%{version}.jar %{_javadir}/joms.jar
+
+%post planet
+/sbin/ldconfig
+
+%post wms
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%postun oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+
+%postun planet
+/sbin/ldconfig
+
+%postun wms
+/sbin/ldconfig
+
+
+%files
+%{_bindir}/*
+
+# Weed out apps:
+%exclude %{_bindir}/ossim-*-test
+
+%exclude %{_bindir}/ossim-adrg-dump
+%exclude %{_bindir}/ossim-btoa
+%exclude %{_bindir}/ossim-computeSrtmStats
+%exclude %{_bindir}/ossim-correl 
+%exclude %{_bindir}/ossim-create-bitmask
+%exclude %{_bindir}/ossim-dump-ocg
+%exclude %{_bindir}/ossim-image-compare
+%exclude %{_bindir}/ossim-modopt
+%exclude %{_bindir}/ossimplanetklv
+%exclude %{_bindir}/ossimplanet-chip
+%exclude %{_bindir}/ossimplanettest
+%exclude %{_bindir}/ossim-rejout
+%exclude %{_bindir}/ossim-rpf 
+%exclude %{_bindir}/ossim-senint
+%exclude %{_bindir}/ossim-space-imaging
+%exclude %{_bindir}/ossim-src2src
+%exclude %{_bindir}/ossim-swapbytes
+%exclude %{_bindir}/ossim-ws-cmp
+
+# These are in the geocell package:
+%exclude %{_bindir}/ossim-geocell
+%exclude %{_bindir}/ossimplanetviewer
+
+%files devel
+%{_includedir}/ossim
+
+%files libs
+%{_datadir}/ossim/
+%doc ossim/LICENSE.txt
+%{_libdir}/libossim.so*
+%{_libdir}/pkgconfig/ossim.pc
+%{_sysconfdir}/profile.d/ossim.sh
+%{_sysconfdir}/profile.d/ossim.csh
+
+%files geocell
+%{_bindir}/ossim-geocell
+%{_libdir}/libossimGui.so*
+
+%files oms
+%{_javadir}/joms-%{version}.jar
+%{_libdir}/libjoms.so
+%{_libdir}/liboms.so*
+
+%files oms-devel
+%{_includedir}/oms/
+
+%files planet
+# %{_bindir}/ossimplanet
+%{_bindir}/ossimplanetviewer
+%{_libdir}/libossim-planet.so*
+# %{_libdir}/libossimPlanetQt.so*
+
+%files planet-devel
+%{_includedir}/ossimPlanet
+
+%files test-apps
+%{_bindir}/ossim-*-test
+
+%files video
+%{_libdir}/libossim-video.so*
+
+%files video-devel
+%{_includedir}/ossimPredator
+
+%files wms
+%{_includedir}/wms/
+%{_libdir}/libossim-wms.so*
+
+#---
+# ossim plugins
+#---
+%files cnes-plugin
+%{_libdir}/ossim/plugins/libossim_cnes_plugin.so
+
+%files gdal-plugin
+%{_libdir}/ossim/plugins/libossim_gdal_plugin.so
+
+%files geopdf-plugin
+%{_libdir}/ossim/plugins/libossim_geopdf_plugin.so
+
+%files hdf5-plugin
+%{_libdir}/ossim/plugins/libossim_hdf5_plugin.so
+
+%files kml-plugin
+%{_libdir}/ossim/plugins/libossim_kml_plugin.so
+
+%files opencv-plugin
+%{_libdir}/ossim/plugins/libossim_opencv_plugin.so
+
+%files openjpeg-plugin
+%{_libdir}/ossim/plugins/libossim_openjpeg_plugin.so
+
+%files png-plugin
+%{_libdir}/ossim/plugins/libossim_png_plugin.so
+
+%files sqlite-plugin
+%{_libdir}/ossim/plugins/libossim_sqlite_plugin.so
+
+%files web-plugin
+%{_libdir}/ossim/plugins/libossim_web_plugin.so
+
+
+
+%changelog
+* Sun Dec 29 2013 Volker Fröhlich <volker27 at gmx.at> - yes-1
+- Initial package
diff --git a/support/linux/rpm_specs/ossim-el7.spec b/support/linux/rpm_specs/ossim-el7.spec
new file mode 100644
index 0000000..207bfb8
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-el7.spec
@@ -0,0 +1,507 @@
+#---
+# File: ossim-el7.spec
+#
+# Spec file for building ossim rpms with rpmbuild.
+#
+# NOTE: This files differs from ossim-el6.spec on in el6 need libtiff4 to pick
+# up bigtiff support.
+#
+# Example usage:
+# rpmbuild -ba --define 'RPM_OSSIM_VERSION 1.9.0' --define 'BUILD_RELEASE 1' ossim-el7.spec
+#
+# Caveats: 
+# 1) Builder/user needs "groovy" in their search path.
+# 2) Use "archive.sh" script in ossim/scripts/archive.sh to generate the source
+#    tar ball, e.g. ossim-1.9.0.tar.gz, from appropriate git branch.
+#---
+Name:           ossim
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        Open Source Software Image Map library and command line applications
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        LGPLv2+
+URL:            https://github.com/orgs/ossimlabs/dashboard
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+BuildRequires: ant
+BuildRequires: cmake
+BuildRequires: ffmpeg-devel
+BuildRequires: gdal-devel
+BuildRequires: geos-devel
+# BuildRequires: hdf4-devel
+BuildRequires: hdf5a-devel
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libgeotiff-devel
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
+BuildRequires: libtiff-devel
+#BuildRequires: libRaw-devel
+BuildRequires: minizip-devel
+BuildRequires: opencv-devel
+BuildRequires: OpenSceneGraph-devel
+BuildRequires: OpenThreads-devel
+BuildRequires: podofo-devel
+BuildRequires: qt4-devel
+BuildRequires: sqlite-devel
+BuildRequires: gpstk-devel
+BuildRequires: openjpeg2-devel
+#BuildRequires: swig
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+
+%description
+OSSIM is a powerful suite of geospatial libraries and applications
+used to process remote sensing imagery, maps, terrain, and vector data.
+
+%package 	devel
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description devel
+Development files for ossim.
+
+%package 	libs
+Summary:        Develelopment files for ossim
+Group:          System Environment/Libraries
+
+%description libs
+Libraries for ossim.
+
+%package 	geocell
+Summary:        Desktop electronic light table
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geocell
+Desktop electronic light table for geospatial image processing. Has 2D, 2 1/2D
+and 3D viewer with image chain editing capabilities.
+
+%package        oms
+Summary:        Wrapper library/java bindings for interfacing with ossim.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms
+This sub-package contains the oms wrapper library with java bindings for
+interfacing with the ossim library from java.
+
+%package        oms-devel
+Summary:        Development files for ossim oms wrapper library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    oms-devel
+This sub-package contains the development files for oms.
+
+%package 	planet
+Summary:        3D ossim library interface via OpenSceneGraph
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet
+3D ossim library interface via OpenSceneGraph.
+
+%package 	planet-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description planet-devel
+This sub-package contains development files for ossim planet.
+
+%package        test-apps
+Summary:        Ossim test apps.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    test-apps
+A suite of ossim test apps.
+
+%package 	video
+Summary:        Ossim vedeo library.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video
+Ossim vedeo library.
+
+%package 	video-devel
+Summary:        Development files for ossim planet.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    video-devel
+This sub-package contains development files for ossim planet.
+
+# libwms does not depend on ossim
+%package        wms
+Summary:        wms ossim library
+Group:          System Environment/Libraries
+
+%description    wms
+This sub-package contains the web mapping service (wms) library.
+
+%package 	wms-devel
+Summary:        Development files libwms
+Group:          System Environment/Libraries
+Requires:       libwms%{?_isa} = %{version}-%{release}
+
+%description    wms-devel
+This sub-package contains the development files for libwms.
+
+#---
+# ossim plugins:
+#---
+%package 	cnes-plugin
+Summary:        Plugin with various sensor models
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description cnes-plugin
+This sub-package contains the ossim plugin which has various SAR sensor models,
+readers, and support data parsers.  Most of this code was provided by the ORFEO
+Toolbox (OTB) group / Centre national d'études spatiales.
+
+%package 	gdal-plugin
+Summary:        GDAL ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description gdal-plugin
+This sub-package contains the Geospatial Data Abstraction Library(gdal) ossim
+plugin for reading/writing images supported by the gdal library.
+
+%package 	geopdf-plugin
+Summary:        geopdf ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description geopdf-plugin
+This sub-package contains the geopdf ossim plugin for reading geopdf files via
+the podofo library.
+
+%package 	hdf5-plugin
+Summary:        HDF5 ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description hdf5-plugin
+This sub-package contains the Hierarchical Data Format(hdf) ossim plugin for
+reading hdf5 images via the hdf5 libraries
+
+%package  	kml-plugin
+Summary:        kml ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    kml-plugin
+This sub-package contains the kmlsuperoverlay ossim plugin for reading/writing
+kml super overlays.
+
+%package  	opencv-plugin
+Summary:        OSSIM OpenCV plugin, contains registration code.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    opencv-plugin
+This sub-package contains the ossim opencv plugin with various pieces of 
+image registration code.
+
+%package  	openjpeg-plugin
+Summary:        OpenJPEG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description    openjpeg-plugin
+This sub-package contains the OpenJPEG ossim plugin for
+reading/writing J2K compressed images via the OpenJPEG library.
+
+%package 	png-plugin
+Summary:        PNG ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description png-plugin
+This sub-package contains the Portable Network Graphic(png) ossim plugin for
+reading/writing png images via the png library.
+
+%package  	sqlite-plugin
+Summary:        OSSIM sqlite plugin, contains GeoPackage reader/writer.
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description sqlite-plugin
+This sub-package contains GeoPackage reader/writer.
+
+%package 	web-plugin
+Summary:        web ossim plugin
+Group:          System Environment/Libraries
+Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
+
+%description web-plugin
+This sub-package contains the web ossim plugin for interfacing with http via
+curl library. 
+
+%prep
+
+#---
+# Notes for debugging:
+# Using the "%setup -q -D -T" is handy debugging.
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+# %setup -q -D
+%setup -q
+
+# Delete bundled libraw
+rm -rf ossim_plugins/libraw/LibRaw-0.9.0/
+
+
+%build
+
+# Exports for ossim abuild:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_INSTALL_PREFIX=/usr
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+mkdir -p build
+pushd build
+%cmake \
+-DBUILD_CSMAPI=OFF \
+-DBUILD_OMS=ON \
+-DBUILD_OSSIM=ON \
+-DBUILD_OSSIM_APPS=ON \
+-DBUILD_OSSIM_CURL_APPS=ON \
+-DBUILD_OSSIM_GUI=ON \
+-DBUILD_OSSIM_TESTS=ON \
+-DBUILD_OSSIM_MPI_SUPPORT=OFF \
+-DBUILD_OSSIM_PLANET=ON \
+-DBUILD_OSSIM_PLANET_QT=OFF \
+-DBUILD_OSSIM_VIDEO=ON \
+\
+-DBUILD_CNES_PLUGIN=ON \
+-DBUILD_CONTRIB_PLUGIN=OFF \
+-DBUILD_CSM_PLUGIN=OFF \
+-DBUILD_GDAL_PLUGIN=ON \
+-DBUILD_GEOPDF_PLUGIN=ON \
+-DBUILD_HDF5_PLUGIN=ON \
+-DBUILD_KAKADU_PLUGIN=OFF \
+-DBUILD_KML_PLUGIN=ON \
+-DBUILD_LIBRAW_PLUGIN=OFF \
+-DBUILD_MRSID_PLUGIN=OFF \
+-DBUILD_OSSIMMRSID_PLUGIN=ON \
+-DBUILD_NDF_PLUGIN=OFF \
+-DBUILD_OPENCV_PLUGIN=ON \
+-DBUILD_OPENJPEG_PLUGIN=ON \
+-DBUILD_PDAL_PLUGIN=OFF \
+-DBUILD_PNG_PLUGIN=ON \
+-DBUILD_REGISTRATION_PLUGIN=OFF \
+-DBUILD_SQLITE_PLUGIN=ON \
+-DBUILD_WEB_PLUGIN=ON \
+\
+-DBUILD_RUNTIME_DIR=bin \
+-DBUILD_SHARED_LIBS=ON \
+-DBUILD_WMS=ON \
+\
+-DOSSIMPLANET_ENABLE_EPHEMERIS=OFF \
+\
+-DCMAKE_BUILD_TYPE=$OSSIM_BUILD_TYPE \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/ossim_package_support/cmake/CMakeModules \
+-DCMAKE_PREFIX_PATH=/usr \
+../ossim/cmake
+make VERBOSE=1 %{?_smp_mflags}
+popd
+
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+
+# Build c++ jni bindings and java side of oms module:
+pushd ossim-oms/joms
+cp local.properties.template local.properties
+ant
+popd
+
+%install
+
+# Exports for ossim install:
+export OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+export OSSIM_VERSION=%{RPM_OSSIM_VERSION}
+
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.sh %{buildroot}%{_sysconfdir}/profile.d/ossim.sh
+install -p -m644 -D ossim/support/linux/etc/profile.d/ossim.csh %{buildroot}%{_sysconfdir}/profile.d/ossim.csh
+install -p -m644 -D ossim/share/ossim/templates/ossim_preferences_template %{buildroot}%{_datadir}/ossim/ossim-preferences-template
+
+# Exports for java builds:
+export JAVA_HOME=/usr/lib/jvm/java
+#export JAVA_HOME=/usr/java/latest
+export OSSIM_INSTALL_PREFIX=%{buildroot}/usr
+
+# oms "ant" build:
+pushd ossim-oms/joms
+ant dist
+ant install
+# ant mvn-install
+# Fix bad perms:
+chmod 755 %{buildroot}%{_libdir}/libjoms.so
+popd
+
+
+%post
+/sbin/ldconfig
+
+# First time through create the site preferences.
+if [ ! -f %{_datadir}/ossim/ossim-site-preferences ]; then
+   cp %{_datadir}/ossim/ossim-preferences-template %{_datadir}/ossim/ossim-site-preferences
+fi
+
+%post oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+ln -s %{_javadir}/joms-%{version}.jar %{_javadir}/joms.jar
+
+%post planet
+/sbin/ldconfig
+
+%post wms
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%postun oms
+/sbin/ldconfig
+rm -f %{_javadir}/joms.jar
+
+%postun planet
+/sbin/ldconfig
+
+%postun wms
+/sbin/ldconfig
+
+
+%files
+%{_bindir}/*
+
+# Weed out apps:
+%exclude %{_bindir}/ossim-*-test
+
+%exclude %{_bindir}/ossim-adrg-dump
+%exclude %{_bindir}/ossim-btoa
+%exclude %{_bindir}/ossim-computeSrtmStats
+%exclude %{_bindir}/ossim-correl 
+%exclude %{_bindir}/ossim-create-bitmask
+%exclude %{_bindir}/ossim-dump-ocg
+%exclude %{_bindir}/ossim-image-compare
+%exclude %{_bindir}/ossim-modopt
+%exclude %{_bindir}/ossimplanetklv
+%exclude %{_bindir}/ossimplanet-chip
+%exclude %{_bindir}/ossimplanettest
+%exclude %{_bindir}/ossim-rejout
+%exclude %{_bindir}/ossim-rpf 
+%exclude %{_bindir}/ossim-senint
+%exclude %{_bindir}/ossim-space-imaging
+%exclude %{_bindir}/ossim-src2src
+%exclude %{_bindir}/ossim-swapbytes
+%exclude %{_bindir}/ossim-ws-cmp
+
+# These are in the geocell package:
+%exclude %{_bindir}/ossim-geocell
+%exclude %{_bindir}/ossimplanetviewer
+
+%files devel
+%{_includedir}/ossim
+
+%files libs
+%{_datadir}/ossim/
+%doc ossim/LICENSE.txt
+%{_libdir}/libossim.so*
+%{_libdir}/pkgconfig/ossim.pc
+%{_sysconfdir}/profile.d/ossim.sh
+%{_sysconfdir}/profile.d/ossim.csh
+
+%files geocell
+%{_bindir}/ossim-geocell
+%{_libdir}/libossimGui.so*
+
+%files oms
+%{_javadir}/joms-%{version}.jar
+%{_libdir}/libjoms.so
+%{_libdir}/liboms.so*
+
+%files oms-devel
+%{_includedir}/oms/
+
+%files planet
+# %{_bindir}/ossimplanet
+%{_bindir}/ossimplanetviewer
+%{_libdir}/libossim-planet.so*
+# %{_libdir}/libossimPlanetQt.so*
+
+%files planet-devel
+%{_includedir}/ossimPlanet
+
+%files test-apps
+%{_bindir}/ossim-*-test
+
+%files video
+%{_libdir}/libossim-video.so*
+
+%files video-devel
+%{_includedir}/ossimPredator
+
+%files wms
+%{_includedir}/wms/
+%{_libdir}/libossim-wms.so*
+
+#---
+# ossim plugins
+#---
+%files cnes-plugin
+%{_libdir}/ossim/plugins/libossim_cnes_plugin.so
+
+%files gdal-plugin
+%{_libdir}/ossim/plugins/libossim_gdal_plugin.so
+
+%files geopdf-plugin
+%{_libdir}/ossim/plugins/libossim_geopdf_plugin.so
+
+%files hdf5-plugin
+%{_libdir}/ossim/plugins/libossim_hdf5_plugin.so
+
+%files kml-plugin
+%{_libdir}/ossim/plugins/libossim_kml_plugin.so
+
+%files opencv-plugin
+%{_libdir}/ossim/plugins/libossim_opencv_plugin.so
+
+%files openjpeg-plugin
+%{_libdir}/ossim/plugins/libossim_openjpeg_plugin.so
+
+%files png-plugin
+%{_libdir}/ossim/plugins/libossim_png_plugin.so
+
+%files sqlite-plugin
+%{_libdir}/ossim/plugins/libossim_sqlite_plugin.so
+
+%files web-plugin
+%{_libdir}/ossim/plugins/libossim_web_plugin.so
+
+
+
+%changelog
+* Sun Dec 29 2013 Volker Fröhlich <volker27 at gmx.at> - yes-1
+- Initial package
diff --git a/support/linux/rpm_specs/ossim-kakadu-plugin-el6.spec b/support/linux/rpm_specs/ossim-kakadu-plugin-el6.spec
new file mode 100644
index 0000000..a99a170
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-kakadu-plugin-el6.spec
@@ -0,0 +1,89 @@
+#---
+# File: ossim-kakadu-el7.spec
+#
+# Spec file for building ossim rpms with rpmbuild.
+#
+# NOTE: This files differs from ossim-el6.spec on in el6 need libtiff4 to pick
+# up bigtiff support.
+#
+# Example usage:
+# rpmbuild -ba --define 'RPM_OSSIM_VERSION 1.9.0' --define 'BUILD_RELEASE 1' ossim-kakadu-el7.spec
+#---
+
+
+Name:           ossim-kakadu-plugin
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        OSSIM Kakadu Plugin
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        Kakadu license restrictions.
+URL:            http://trac.osgeo.org/ossim/wiki
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libtiff4-devel
+BuildRequires: ossim-devel
+
+# Kakadu version used:
+# %define KAKADU_VERSION v7_7-01123C
+%define KAKADU_VERSION kakadu_src
+
+%description
+
+OSSIM Kakadu Plugin
+
+%prep
+#---
+# Notes for debugging: 
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+%setup -q
+
+%build
+OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+#export JAVA_HOME=/usr/java/latest
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+
+# Build kakadu:
+pushd %{KAKADU_VERSION}/make
+make -f Makefile-Linux-x86-64-gcc
+popd
+
+#build plugin:
+mkdir -p build
+pushd build
+
+# Note: Linking static libs.
+%cmake \
+-DCMAKE_BUILD_TYPE=${OSSIM_BUILD_TYPE} \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/CMakeModules \
+-DKAKADU_ROOT_SRC=$OSSIM_DEV_HOME/%{KAKADU_VERSION} \
+-DKAKADU_AUX_LIBRARY=$OSSIM_DEV_HOME/%{KAKADU_VERSION}/lib/Linux-x86-64-gcc/libkdu_aux.a \
+-DKAKADU_LIBRARY=$OSSIM_DEV_HOME/%{KAKADU_VERSION}/lib/Linux-x86-64-gcc/libkdu.a  \
+../kakadu
+
+make VERBOSE=1 %{?_smp_mflags}
+
+popd
+
+%install
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%{_libdir}/ossim/plugins/libossim_kakadu_plugin.so
+
+%changelog
+* Mon Jan 6 2013 David Burken <dburken at radiantblue.com> 1.8.18-1
+- Initial package
diff --git a/support/linux/rpm_specs/ossim-kakadu-plugin-el7.spec b/support/linux/rpm_specs/ossim-kakadu-plugin-el7.spec
new file mode 100644
index 0000000..a98b9e3
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-kakadu-plugin-el7.spec
@@ -0,0 +1,89 @@
+#---
+# File: ossim-kakadu-el7.spec
+#
+# Spec file for building ossim rpms with rpmbuild.
+#
+# NOTE: This files differs from ossim-el6.spec on in el6 need libtiff4 to pick
+# up bigtiff support.
+#
+# Example usage:
+# rpmbuild -ba --define 'RPM_OSSIM_VERSION 1.9.0' --define 'BUILD_RELEASE 1' ossim-kakadu-el7.spec
+#---
+
+
+Name:           ossim-kakadu-plugin
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        OSSIM Kakadu Plugin
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        Kakadu license restrictions.
+URL:            http://trac.osgeo.org/ossim/wiki
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libtiff-devel
+BuildRequires: ossim-devel
+
+# Kakadu version used:
+# %define KAKADU_VERSION v7_7-01123C
+%define KAKADU_VERSION kakadu_src
+
+%description
+
+OSSIM Kakadu Plugin
+
+%prep
+#---
+# Notes for debugging: 
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+%setup -q
+
+%build
+OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+#export JAVA_HOME=/usr/java/latest
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+
+# Build kakadu:
+pushd %{KAKADU_VERSION}/make
+make -f Makefile-Linux-x86-64-gcc
+popd
+
+#build plugin:
+mkdir -p build
+pushd build
+
+# Note: Linking static libs.
+%cmake \
+-DCMAKE_BUILD_TYPE=${OSSIM_BUILD_TYPE} \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/CMakeModules \
+-DKAKADU_ROOT_SRC=$OSSIM_DEV_HOME/%{KAKADU_VERSION} \
+-DKAKADU_AUX_LIBRARY=$OSSIM_DEV_HOME/%{KAKADU_VERSION}/lib/Linux-x86-64-gcc/libkdu_aux.a \
+-DKAKADU_LIBRARY=$OSSIM_DEV_HOME/%{KAKADU_VERSION}/lib/Linux-x86-64-gcc/libkdu.a  \
+../kakadu
+
+make VERBOSE=1 %{?_smp_mflags}
+
+popd
+
+%install
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%{_libdir}/ossim/plugins/libossim_kakadu_plugin.so
+
+%changelog
+* Mon Jan 6 2013 David Burken <dburken at radiantblue.com> 1.8.18-1
+- Initial package
diff --git a/support/linux/rpm_specs/ossim-mrsid-plugin-el6.spec b/support/linux/rpm_specs/ossim-mrsid-plugin-el6.spec
new file mode 100644
index 0000000..86b17ce
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-mrsid-plugin-el6.spec
@@ -0,0 +1,72 @@
+Name:           ossim-mrsid-plugin
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        OSSIM MrSID Plugin
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        Mrsid license restrictions.
+URL:            http://trac.osgeo.org/ossim/wiki
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libtiff4-devel
+BuildRequires: ossim-devel
+
+%description
+
+OSSIM Mrsid Plugin
+
+%prep
+#---
+# Notes for debugging: 
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+%setup -q
+
+%build
+OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+
+#build plugin:
+mkdir -p build
+pushd build
+
+# Note: Linking static libs.
+%cmake \
+-DCMAKE_BUILD_TYPE=$OSSIM_BUILD_TYPE \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/CMakeModules \
+-DMRSID_DIR=$OSSIM_DEV_HOME/mrsid_code \
+../mrsid
+
+make VERBOSE=1 %{?_smp_mflags}
+
+popd
+
+%install
+
+# ossim mrsid plugin:
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+# mrsid libraries:
+install -p -m755 -D mrsid_code/Lidar_DSDK/lib/liblti_lidar_dsdk.so %{buildroot}%{_libdir}
+install -p -m755 -D mrsid_code/Raster_DSDK/lib/libltidsdk.so %{buildroot}%{_libdir}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%{_libdir}/ossim/plugins/libossim_mrsid_plugin.so
+%{_libdir}/liblti_lidar_dsdk.so
+%{_libdir}/libltidsdk.so
+
+%changelog
+* Mon Jan 9 2013 David Burken <dburken at - 1.8.18-1
+- Initial package
diff --git a/support/linux/rpm_specs/ossim-mrsid-plugin-el7.spec b/support/linux/rpm_specs/ossim-mrsid-plugin-el7.spec
new file mode 100644
index 0000000..b7c9e87
--- /dev/null
+++ b/support/linux/rpm_specs/ossim-mrsid-plugin-el7.spec
@@ -0,0 +1,72 @@
+Name:           ossim-mrsid-plugin
+Version:        %{RPM_OSSIM_VERSION} 
+Release:        %{BUILD_RELEASE}%{?dist}
+Summary:        OSSIM MrSID Plugin
+Group:          System Environment/Libraries
+#TODO: Which version?
+License:        Mrsid license restrictions.
+URL:            http://trac.osgeo.org/ossim/wiki
+Source0:        http://download.osgeo.org/ossim/source/%{name}-%{version}.tar.gz
+
+BuildRequires: cmake
+BuildRequires: java-devel
+BuildRequires: libcurl-devel
+BuildRequires: libtiff-devel
+BuildRequires: ossim-devel
+
+%description
+
+OSSIM Mrsid Plugin
+
+%prep
+#---
+# Notes for debugging: 
+# -D on setup = Do not delete the directory before unpacking.
+# -T on setup = Disable the automatic unpacking of the archives.
+#---
+# %setup -q -D -T
+%setup -q
+
+%build
+OSSIM_DEV_HOME=%{_builddir}/%{name}-%{version}
+export OSSIM_BUILD_DIR=%{_builddir}/%{name}-%{version}/build
+export OSSIM_BUILD_TYPE=RelWithDebInfo
+
+#build plugin:
+mkdir -p build
+pushd build
+
+# Note: Linking static libs.
+%cmake \
+-DCMAKE_BUILD_TYPE=$OSSIM_BUILD_TYPE \
+-DCMAKE_MODULE_PATH=$OSSIM_DEV_HOME/CMakeModules \
+-DMRSID_DIR=$OSSIM_DEV_HOME/mrsid_code \
+../mrsid
+
+make VERBOSE=1 %{?_smp_mflags}
+
+popd
+
+%install
+
+# ossim mrsid plugin:
+pushd build
+make install DESTDIR=%{buildroot}
+popd
+
+# mrsid libraries:
+install -p -m755 -D mrsid_code/Lidar_DSDK/lib/liblti_lidar_dsdk.so %{buildroot}%{_libdir}
+install -p -m755 -D mrsid_code/Raster_DSDK/lib/libltidsdk.so %{buildroot}%{_libdir}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%{_libdir}/ossim/plugins/libossim_mrsid_plugin.so
+%{_libdir}/liblti_lidar_dsdk.so
+%{_libdir}/libltidsdk.so
+
+%changelog
+* Mon Jan 9 2013 David Burken <dburken at - 1.8.18-1
+- Initial package
diff --git a/support/linux/service-wrapper-initd-template b/support/linux/service-wrapper-initd-template
new file mode 100644
index 0000000..6ce2a08
--- /dev/null
+++ b/support/linux/service-wrapper-initd-template
@@ -0,0 +1,213 @@
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# chkconfig: 3 80 20
+# Provides: General service wrapper for {{program_name}} services
+# Required-Start: $network $syslog
+# Required-Stop: $network $syslog
+# Default-Start: 3
+# Default-Stop: 0 1 2 6
+# Should-Start: $network $syslog
+# Should-Stop: $network $syslog
+# Description: start, stop and restart script
+# Short-Description: start, stop and restart ingestListener
+### END INIT INFO
+RETVAL=$?
+PROG={{program_name}}
+PROG_USER={{program_user}}
+PROG_GROUP={{program_group}}
+PID_DIR="/var/run/${PROG}"
+PROG_PID_DIR="${PID_DIR}"
+PROG_PID="$PID_DIR/${PROG}.pid"
+PROG_LOG_DIR="/var/log/${PROG}"
+PROG_ERROR_LOG="${PROG_LOG_DIR}/error_log"
+export WORKING_DIR="/usr/share/omar/${PROG}"
+RUN_PROG_TEST="/usr/share/omar/${PROG}/${PROG}.sh"
+RUN_PROGRAM="${RUN_PROG_TEST} ${PROG_PID}"
+
+# Must be exported in order for catatlina to generate pid file
+export PROG_PID
+start() {
+   if [ -f "$RUN_PROG_TEST" ]; then
+      # Make omar lock file dir and change ownership to omar user
+      if [ ! -d "$PID_DIR" ]; then
+            mkdir -p $PID_DIR
+            chown $PROG_USER:$PROG_GROUP $PID_DIR
+      fi
+      # Make omar log directory and change ownership to omar user
+      if [ ! -d "$PROG_LOG_DIR" ]; then
+            mkdir -p $PROG_LOG_DIR
+            chown $PROG_USER:$PROG_GROUP $PROG_LOG_DIR
+      fi
+      # Check for running instance
+      if [ -e "$PROG_PID" ]; then
+              read PID < $PROG_PID
+                   if checkpid $PID 2>&1; then
+                       echo $"$PROG process is already running..."
+                           return 1
+                           echo_failure
+                       else
+                           echo "Lock file found but no $PROG process running for (pid $PID)"
+                           echo "Removing old lock file..."
+                     rm -rf $PROG_PID
+                   fi
+        fi
+         echo -ne $"Starting $PROG: "
+         echo $RUN_PROGRAM
+            /bin/su - $PROG_USER $RUN_PROGRAM >> $PROG_ERROR_LOG 2>&1
+            RETVAL="$?"
+          if [ "$RETVAL" -eq 0 ]; then
+               echo_success
+                  echo -en "\n"
+            else
+                  echo_failure
+                  echo -en "\n"
+               exit 1
+          fi
+   else
+      echo "$RUN_PROGRAM does not exist..."
+      echo_failure
+      echo -en "\n"
+      exit 1
+   fi
+}
+
+stop() {
+    COUNT=0
+    WAIT=10
+    if [ -e "$PROG_PID" ]; then
+      read PID < $PROG_PID
+#echo ${PID}
+        if checkpid $PID 2>&1; then
+            echo -ne $"Stopping $PROG: "
+         kill $PID >> $PROG_ERROR_LOG 2>&1
+         RETVAL="$?"
+         sleep 2
+#        if [ "$RETVAL" -eq 0 ]; then
+#           echo_successss
+#           echo -en "\n"
+#        else
+            while [ "$(ps -p $PID | grep -c $PID)" -eq "1"  -a  "$COUNT" -lt "$WAIT" ]; do
+            echo -ne "\nWaiting on $PROG process to exit..."
+            COUNT=`expr $COUNT + 1`
+            sleep .3
+#           echo $COUNT
+            done
+
+#              if [ "$COUNT" -gt "$WAIT" ]; then
+               if [ "$(ps -p $PID | grep -c $PID)" == "1" ] ; then
+                  echo -ne "\nCouldn't shutdown, forcing shutdown of $PROG process"
+                  kill -9 $PID
+               fi
+               echo_success
+               echo -en "\n"
+#        fi
+      fi
+   else
+      echo -ne $"Stopping $PROG: "
+      echo_failure
+      echo -en "\n"
+   fi
+}
+
+status() {
+  RETVAL="1"
+    if [ -e "$PROG_PID" ]; then
+        read PID < $PROG_PID
+        if checkpid $PID 2>&1; then
+            echo "$PROG (pid $PID) is running..."
+            RETVAL="0"
+        else
+            echo "Lock file found but no process running for (pid $PID)"
+        fi
+    else
+        PID="$(pgrep -u $PROG_USER java)"
+        if [ -n "$PID" ]; then
+            echo "$PROG running (pid $PID) but no PID file exists"
+            RETVAL="0"
+        else
+            echo "$PROG is stopped"
+            RETVAL="1"
+        fi
+    fi
+    return $RETVAL
+}
+
+# Check if pid is running
+checkpid() {
+   local PID
+   for PID in $* ; do
+      [ -d "/proc/$PID" ] && return 0
+   done
+   return 1
+}
+
+echo_success() {
+   if [ -e "/etc/redhat-release" ]; then
+      echo -en "\\033[60G"
+      echo -n "[  "
+      echo -en "\\033[0;32m"
+      echo -n $"OK"
+      echo -en "\\033[0;39m"
+      echo -n "  ]"
+      echo -en "\r"
+   elif [ -e "/etc/SuSE-release" ]; then
+      echo -en "\\033[60G"
+      echo -en "\\033[1;32m"
+      echo -n $"done"
+      echo -en "\\033[0;39m"
+      echo -en "\r"
+   else
+      echo -en "\\033[60G"
+      echo "OK"
+      echo -en "\r"
+   fi
+   return 0
+}
+
+echo_failure() {
+   if [ -e "/etc/redhat-release" ]; then
+      echo -en "\\033[60G"
+      echo -n "["
+      echo -en "\\033[0;31m"
+      echo -n $"FAILED"
+      echo -en "\\033[0;39m"
+      echo -n "]"
+      echo -en "\r"
+   elif [ -e "/etc/SuSE-release" ]; then
+      echo -en "\\033[60G"
+      echo -en "\\033[0;31m"
+      echo -n $"failed"
+      echo -en "\\033[0;39m"
+      echo -en "\r"
+   else
+      echo -en "\\033[60G"
+      echo "FAILED"
+      echo -en "\r"
+   fi
+    return 1
+}
+
+# See how we were called.
+case "$1" in
+ start)
+   start
+   ;;
+ stop)
+   stop
+   ;;
+restart)
+   stop
+    sleep 2
+    start
+    ;;
+status)
+   status
+   ;;
+ *)
+   echo $"Usage: $PROG {start|stop|restart|status}"
+   exit 1
+   ;;
+esac
+
+exit $RETVAL
\ No newline at end of file
diff --git a/support/linux/service-wrapper-systemd-template b/support/linux/service-wrapper-systemd-template
new file mode 100644
index 0000000..5c8cba9
--- /dev/null
+++ b/support/linux/service-wrapper-systemd-template
@@ -0,0 +1,9 @@
+[Service]
+PermissionsStartOnly=true
+Type=forking
+PIDFile=/var/run/{{program_name}}/{{program_name}}.pid
+ExecStart=/bin/bash -c "/usr/share/omar/{{program_name}}/{{program_name}}.sh /var/run/{{program_name}}/{{program_name}}.pid >> /var/log/{{program_name}}/{{program_name}}.log 2>&1" &
+User={{program_user}}
+Group={{program_group}}
+WorkingDirectory=/usr/share/omar/{{program_name}}
+Restart=on-abort
diff --git a/test/README.md b/test/README.md
new file mode 100644
index 0000000..b732219
--- /dev/null
+++ b/test/README.md
@@ -0,0 +1,5 @@
+# Testing
+
+Currently all testing in OSSIM is done via the ossim-batch-test executable with configuration files as input. The `config` subdirectory contains the keyword lists that define each test. See the [readme](config/README.md) file for more information.
+
+The src directory contains individual standalone test executables that serve as unit and functional tests for various components of OSSIM core. The directory heirarchy parallels that of ossim/src. Any new tests should be located in the subdirectory that reflects the highest level class being tested.
diff --git a/test/config/README.md b/test/config/README.md
new file mode 100644
index 0000000..469694e
--- /dev/null
+++ b/test/config/README.md
@@ -0,0 +1,19 @@
+# OSSIM Batch Test Scripts
+
+The *.kwl files in this directory are configuration scripts for the ossim-batch-test executable. The format for the command line is
+```
+ossim-batch-test <test-configuration-file.kwl>
+```
+There are two required environment variables referenced by ossim-batch-test and associated config scripts, namely, 
+
+`OSSIM_BATCH_TEST_DATA` -- top-level (read-only) directory containing all source test data used by batch tests, and 
+
+`OSSIM_BATCH_TEST_RESULTS` -- location (read-write) where expected results, actual results, and log files are written.
+
+These env vars must be set before running ossim-batch-test. There is a collection of public data (including expected results) available [here](https://github.com/ossimlabs/ossim-test-data).
+
+The expected results need to be populated the first time through for your platform. This is accomplished by running ossim-batch-test with the option to save ("accept") the results as the new, expected results:
+
+`ossim-batch-test --accept-test <test-configuration-file.kwl>`
+
+There is one composite configuration called `super-test.kwl` that instructs ossim-batch-test to run all individual tests found in this directory. 
diff --git a/test/config/applanix-test.kwl b/test/config/applanix-test.kwl
new file mode 100644
index 0000000..0a642df
--- /dev/null
+++ b/test/config/applanix-test.kwl
@@ -0,0 +1,214 @@
+//=============================================================================
+// File: applanix-test.kwl
+// 
+// Description: ossim-batch-test config file.  
+// 
+// Test applanix data with UTM and ECEF support data format.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are:
+//      -c or --clean-test
+//      -p or --preprocess-test
+//      -r or --run-test
+//      -a or --accept-test
+//   Multiple tests can be entered by quoting string of space separated
+//   test, e.g. "test1 test2". To accept all tests use "all" for test.
+// 
+//===================================================================================
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: Test height for center of image from test2 as it is affected by height.
+
+// Clean up commands.
+test1.clean_command0: $(RMDIR_CMD) $(OBT_OUT_DIR)/test1-info-height.txt
+
+// Commands to generate expected results:
+
+// Height center of image for test2
+test1.expected_results_command0: ossim-info --height 46.5518724502617 -87.3832426544229 > $(OBT_EXP_DIR)/test1-info-height.txt
+
+// The actual commands to test:
+
+test1.test_command0: ossim-info --height 46.5518724502617 -87.3832426544229 > $(OBT_OUT_DIR)/test1-info-height.txt
+
+// Post process commands for diffs and stuff:
+
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test1-info-height.txt $(OBT_OUT_DIR)/test1-info-height.txt
+ 
+// ---
+// End test1:
+// ---
+
+// ---
+// Begin test2:
+// ---
+test2.name: test2
+test2.description: Test applanix data with UTM support data and a tiff with embedded thumbnail.
+
+// Clean up commands.
+test2.clean_command0: $(RM_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.geom
+test2.clean_command1: $(RM_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.his
+test2.clean_command2: $(RM_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.ovr
+test2.clean_command3: $(RMDIR_CMD) $(OBT_OUT_DIR)/test2
+
+// Pre-process commands:
+test2.preprocess_command0: $(MKDIR_CMD) $(OBT_EXP_DIR)/test2
+test2.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)/test2
+
+
+// Commands to generate expected results:
+
+// Reduced res sets with histogram.
+test2.expected_results_command0: ossim-preproc -r --ch $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.tif
+
+test2.expected_results_command1: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.his $(OBT_EXP_DIR)/test2/17657707.his
+
+// Geometry file:
+test2.expected_results_command2: ossim-applanix2ogeom  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/sn0085D_25Jan2011_camfile.txt  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/event1_eo_110625_1.txt  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.tif
+
+test2.expected_results_command3: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.geom $(OBT_EXP_DIR)/test2/17657707.geom
+
+// ossim-info:
+test2.expected_results_command4: ossim-info -d -i -p  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.tif > $(OBT_EXP_DIR)/test2/17657707-info.txt
+
+// The actual commands to test:
+test2.test_command0: ossim-preproc -r --ch $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.tif
+
+test2.test_command1: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.his $(OBT_OUT_DIR)/test2/17657707.his
+
+// Geometry file:
+test2.test_command2: ossim-applanix2ogeom  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/sn0085D_25Jan2011_camfile.txt  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/event1_eo_110625_1.txt  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.tif
+
+test2.test_command3: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.geom $(OBT_OUT_DIR)/test2/17657707.geom
+
+// ossim-info:
+test2.test_command4: ossim-info -d -i -p  $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.tif > $(OBT_OUT_DIR)/test2/17657707-info.txt
+
+
+// Post process commands for diffs and stuff:
+test2.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test2/17657707.geom $(OBT_OUT_DIR)/test2/17657707.geom
+test2.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/test2/17657707.his $(OBT_OUT_DIR)/test2/17657707.his
+test2.postprocess_command2: $(DIFF_CMD) $(OBT_EXP_DIR)/test2/17657707-info.txt $(OBT_OUT_DIR)/test2/17657707-info.txt
+ 
+// ---
+// End test2:
+// ---
+
+// ---
+// Begin test3:
+// ---
+test3.name: test3
+test3.description: Test height for center of image from test 4 as it is affected by height.
+
+
+// Clean up commands.
+test3.clean_command0: $(RMDIR_CMD) $(OBT_OUT_DIR)/test3-info-height.txt
+
+// Commands to generate expected results:
+
+// Height center of image for test4.
+test3.expected_results_command0: ossim-info --height 33.7519522209528 -117.013690129189 > $(OBT_EXP_DIR)/test3-info-height.txt
+
+// The actual commands to test:
+
+test3.test_command0: ossim-info --height 33.7519522209528 -117.013690129189 > $(OBT_OUT_DIR)/test3-info-height.txt
+
+// Post process commands for diffs and stuff:
+
+test3.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test3-info-height.txt $(OBT_OUT_DIR)/test3-info-height.txt
+ 
+// ---
+// End test3:
+// ---
+
+// ---
+// Begin test4:
+// ---
+test4.name: test4
+test4.description: Test applanix data with ECEF support data.
+
+// Clean up commands.
+test4.clean_command0: $(RM_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.geom
+test4.clean_command1: $(RM_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.his
+test4.clean_command2: $(RM_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/utm/17657707.ovr
+test4.clean_command3: $(RMDIR_CMD) $(OBT_OUT_DIR)/test4
+
+// Pre-process commands:
+test4.preprocess_command0: $(MKDIR_CMD) $(OBT_EXP_DIR)/test4
+test4.preprocess_command1: $(MKDIR_CMD) $(OBT_OUT_DIR)/test4
+
+
+// Commands to generate expected results:
+
+// Reduced res sets with histogram.
+test4.expected_results_command0: ossim-preproc -r --ch --compute-min-max $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.tif
+
+test4.expected_results_command1: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.his $(OBT_EXP_DIR)/test4/18056119.his
+
+// Geometry file:
+test4.expected_results_command2: ossim-applanix2ogeom  $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/sn0056.kwl  $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/eo_ECEF_050629.txt $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.tif
+
+test4.expected_results_command3: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.geom $(OBT_EXP_DIR)/test4/18056119.geom
+
+// ossim-info:
+test4.expected_results_command4: ossim-info -d -i -p  $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.tif > $(OBT_EXP_DIR)/test4/18056119-info.txt
+
+// The actual commands to test:
+test4.test_command0: ossim-preproc -r --ch --compute-min-max $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.tif
+
+test4.test_command1: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.his $(OBT_OUT_DIR)/test4/18056119.his
+
+// Geometry file:
+test4.test_command2: ossim-applanix2ogeom  $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/sn0056.kwl $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/eo_ECEF_050629.txt $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.tif
+
+test4.test_command3: $(COPY_CMD) $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.geom $(OBT_OUT_DIR)/test4/18056119.geom
+
+// ossim-info:
+test4.test_command4: ossim-info -d -i -p  $(OSSIM_BATCH_TEST_DATA)/public/applanix/ecef/18056119.tif > $(OBT_OUT_DIR)/test4/18056119-info.txt
+
+
+// Post process commands for diffs and stuff:
+test4.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test4/18056119.geom $(OBT_OUT_DIR)/test4/18056119.geom
+test4.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/test4/18056119.his $(OBT_OUT_DIR)/test4/18056119.his
+test4.postprocess_command2: $(DIFF_CMD) $(OBT_EXP_DIR)/test4/18056119-info.txt $(OBT_OUT_DIR)/test4/18056119-info.txt
+ 
+// ---
+// End test4:
+// ---
diff --git a/test/config/dot1.kwl b/test/config/dot1.kwl
new file mode 100644
index 0000000..b2ce1e5
--- /dev/null
+++ b/test/config/dot1.kwl
@@ -0,0 +1,98 @@
+//===================================================================================
+// 
+// File: do-test1.kwl
+// Generated by command: ossim-batch-test -W test1.kwl
+// Description: ossim-batch-test template config file.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are the 
+//   the following: 
+//      -c or --clean-test 
+//      -p or --preprocess-test
+//      -r or --run-test 
+//      -a or --accept-test 
+//   Multiple tests can be entered by quoting string of space-separated
+//   test names, e.g. "test1 test2". To do all tests use "all" or leave blank.
+// 
+//===================================================================================
+
+// ---
+// Begin test1:
+// 
+// Note: 
+// 
+// This assumes liboms.so and libjoms.so are in your LD_LIBRARY_PATH.
+// If not you must add java arg "-Djava.library.path=/path/to/libs".
+// 
+// --- 
+
+test1.name: Java org.ossim.jni.apps.DataInfoTest
+test1.description: Test oms/joms DataInfoTest and associated bindings.
+test1.enabled: 1
+
+// Commands to generate expected results:
+test1.expected_results_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.DataInfoTest $(OSSIM_BATCH_TEST_DATA)/public/tif/Iowa-utm.tif > $(OBT_EXP_DIR)/info.txt
+
+// The actual commands to test:
+test1.test_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.DataInfoTest $(OSSIM_BATCH_TEST_DATA)/public/tif/Iowa-utm.tif > $(OBT_OUT_DIR)/info.txt
+
+// Post process commands for diffs and stuff:
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/info.txt $(OBT_OUT_DIR)/info.txt
+
+// End test1:
+
+// Begin test2:
+test2.name: Java org.ossim.jni.apps.ImageModelTest
+test2.description: Test oms/joms ImageModelTest and associated bindings.
+test2.enabled: 1
+
+// Commands to generate expected results:
+test2.expected_results_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.ImageModelTest $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205M0001912264B220000100072M_001508507/Volume1/5V090205M0001912264B220000100072M_001508507.ntf > $(OBT_EXP_DIR)/test2-info.txt
+
+// The actual commands to test:
+test2.test_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.ImageModelTest $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205M0001912264B220000100072M_001508507/Volume1/5V090205M0001912264B220000100072M_001508507.ntf  > $(OBT_OUT_DIR)/test2-info.txt
+
+// Post process commands for diffs and stuff:
+test2.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/info.txt $(OBT_OUT_DIR)/info.txt
+
+// End test2:
+
+
+// Begin test2:
+test2.name: Java org.ossim.jni.apps.ImageModelTest
+test2.description: Test oms/joms ImageModelTest and associated bindings.
+test2.enabled: 1
diff --git a/test/config/dot2.kwl b/test/config/dot2.kwl
new file mode 100644
index 0000000..21b867d
--- /dev/null
+++ b/test/config/dot2.kwl
@@ -0,0 +1,109 @@
+//===================================================================================
+// 
+// File: do-test1.kwl
+// Generated by command: ossim-batch-test -W test1.kwl
+// Description: ossim-batch-test template config file.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are the 
+//   the following: 
+//      -c or --clean-test 
+//      -p or --preprocess-test
+//      -r or --run-test 
+//      -a or --accept-test 
+//   Multiple tests can be entered by quoting string of space-separated
+//   test names, e.g. "test1 test2". To do all tests use "all" or leave blank.
+// 
+//===================================================================================
+
+// ---
+// Begin test1:
+// 
+// Note: 
+// 
+// This assumes liboms.so and libjoms.so are in your LD_LIBRARY_PATH.
+// If not you must add java arg "-Djava.library.path=/path/to/libs".
+// 
+// --- 
+
+test1.name: Java org.ossim.jni.apps.DataInfoTest
+test1.description: Test oms/joms DataInfoTest and associated bindings.
+test1.enabled: 1
+
+// Commands to generate expected results:
+test1.expected_results_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.DataInfoTest $(OSSIM_BATCH_TEST_DATA)/public/tif/Iowa-utm.tif > $(OBT_EXP_DIR)/info.txt
+
+// The actual commands to test:
+test1.test_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.DataInfoTest $(OSSIM_BATCH_TEST_DATA)/public/tif/Iowa-utm.tif > $(OBT_OUT_DIR)/info.txt
+
+// Post process commands for diffs and stuff:
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/info.txt $(OBT_OUT_DIR)/info.txt
+
+// End test1:
+
+// Begin test2:
+test2.name: Java org.ossim.jni.apps.ImageModelTest
+test2.description: Test oms/joms ImageModelTest and associated bindings.
+test2.enabled: 1
+
+// Commands to generate expected results:
+test2.expected_results_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.ImageModelTest $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205M0001912264B220000100072M_001508507/Volume1/5V090205M0001912264B220000100072M_001508507.ntf > $(OBT_EXP_DIR)/test2-info.txt
+
+// The actual commands to test:
+test2.test_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.ImageModelTest $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205M0001912264B220000100072M_001508507/Volume1/5V090205M0001912264B220000100072M_001508507.ntf  > $(OBT_OUT_DIR)/test2-info.txt
+
+// Post process commands for diffs and stuff:
+test2.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/info.txt $(OBT_OUT_DIR)/info.txt
+
+// End test2:
+
+
+// Begin test3:
+test3.name: Java org.ossim.jni.apps.ImageModelTest
+test3.description: Test oms/joms ImageModelTest and associated bindings.
+test3.enabled: 1
+
+// Commands to generate expected results:
+test3.expected_results_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.ImageModelTest $(OSSIM_BATCH_TEST_DATA)http://71.43.98.140/omar/ogc/wms?request=GetMap&layers=3699&bbox=63.5129,27.0062,63.7034,27.1442&srs=EPSG:4326&width=1024&height=702&format=image/jpeg > $(OBT_EXP_DIR)/test3-info.txt
+
+// The actual commands to test:
+test3.test_command0: java -cp $(OSSIM_DEV_HOME)/oms/lib/joms.jar org.ossim.oms.apps.ImageModelTest $(OSSIM_BATCH_TEST_DATA)http://71.43.98.140/omar/ogc/wms?request=GetMap&layers=3699&bbox=63.5129,27.0062,63.7034,27.1442&srs=EPSG:4326&width=1024&height=702&format=image/jpeg  > $(OBT_OUT_DIR)/test3-info.txt
+
+// Post process commands for diffs and stuff:
+test3.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/info.txt $(OBT_OUT_DIR)/info.txt
+
+// End test3:
diff --git a/test/config/eq-test.kwl b/test/config/eq-test.kwl
new file mode 100644
index 0000000..5dacf8d
--- /dev/null
+++ b/test/config/eq-test.kwl
@@ -0,0 +1,28 @@
+//---
+// File ossim-eq-test.kwl
+//---
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: Test  ossimEquDistCylProjection
+
+// Clean up commands.
+test1.clean_command0: $(RMDIR_CMD) $(OBT_OUT_DIR)/t1-info.txt
+
+// Commands to generate expected results:
+
+test1.expected_results_command0: ossim-eq-projection-test > $(OBT_EXP_DIR)/t1-info.txt
+
+// The actual commands to test:
+
+test1.test_command0: ossim-eq-projection-test > $(OBT_OUT_DIR)/t1-info.txt
+
+// Post process commands for diffs and stuff:
+
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t1-info.txt $(OBT_OUT_DIR)/t1-info.txt
+ 
+// ---
+// End test1:
+// ---
diff --git a/test/config/fusion-test1.kwl b/test/config/fusion-test1.kwl
new file mode 100644
index 0000000..276c960
--- /dev/null
+++ b/test/config/fusion-test1.kwl
@@ -0,0 +1,109 @@
+//===================================================================================
+// 
+// File: test1.kwl
+// Description: Contains assorted tests.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are:
+//      -c or --clean-test
+//      -p or --preprocess-test
+//      -r or --run-test
+//      -a or --accept-test
+//   Multiple tests can be entered by quoting string of space separated
+//   test, e.g. "test1 test2". To accept all tests use "all" for test.
+// 
+//===================================================================================
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: Test Landsat 7 fast format geometry.
+test1.enabled: 1
+
+// Commands to generate expected results:
+
+test1.expected_results_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/ls7/p24r31/l71024031_03119990929_hpn.fst > $(OBT_EXP_DIR)/ls7-ff-pan-info.txt
+
+// The actual commands to test:
+
+test1.test_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/ls7/p24r31/l71024031_03119990929_hpn.fst > $(OBT_OUT_DIR)/ls7-ff-pan-info.txt
+
+// Post process commands for diffs and stuff:
+
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/ls7-ff-pan-info.txt $(OBT_OUT_DIR)/ls7-ff-pan-info.txt
+ 
+
+// ---
+// Begin test2:
+// ---
+test2.name: test2
+test2.description: Test fusion output of Landsat 7 fast format data:
+test2.enabled: 1
+
+// Commands to generate expected results:
+
+// igen:
+test2.expected_results_command0: ossim-igen $(OSSIM_BATCH_TEST_DATA)/public/ls7/p24r31/fusion-test-exp.spec
+
+// Make overviews and histogram:
+test2.expected_results_command1: ossim-preproc -r -o --create-histogram $(OBT_OUT_DIR)/ls7-ff-fusion-exp.tif
+
+// Capture info dump of output:
+test2.expected_results_command2: ossim-info -d -i -p $(OBT_OUT_DIR)/ls7-ff-fusion-exp.tif > $(OBT_EXP_DIR)/ls7-ff-fusion-exp-info.txt
+
+// Put the histogram in the expected output dir.
+test2.expected_results_command3: $(COPY_CMD) $(OBT_OUT_DIR)/ls7-ff-fusion-exp.his $(OBT_EXP_DIR)/ls7-ff-fusion-exp.his
+
+// The actual commands to test:
+
+// igen:
+test2.test_command0: ossim-igen $(OSSIM_BATCH_TEST_DATA)/public/ls7/p24r31/fusion-test-out.spec
+
+// Make overviews and histogram:
+test2.test_command1: ossim-preproc -r -o --create-histogram $(OBT_OUT_DIR)/ls7-ff-fusion-out.tif
+
+// Capture info dump of output:
+test2.test_command2: ossim-info -d -i -p $(OBT_OUT_DIR)/ls7-ff-fusion-out.tif > $(OBT_OUT_DIR)/ls7-ff-fusion-out-info.txt
+
+// Post process commands for diffs and stuff:
+
+// Test info dump:
+test2.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/ls7-ff-fusion-exp-info.txt $(OBT_OUT_DIR)/ls7-ff-fusion-out-info.txt
+
+// Test for histogram diffs:
+test2.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/ls7-ff-fusion-exp.his $(OBT_OUT_DIR)/ls7-ff-fusion-out.his
diff --git a/test/config/genras-writer-test.kwl b/test/config/genras-writer-test.kwl
new file mode 100644
index 0000000..55f911e
--- /dev/null
+++ b/test/config/genras-writer-test.kwl
@@ -0,0 +1,198 @@
+//===================================================================================
+// 
+// File: rbt-test1.kwl
+// Description: Contains assorted tests.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are:
+//      -c or --clean-test
+//      -p or --preprocess-test
+//      -r or --run-test
+//      -a or --accept-test
+//   Multiple tests can be entered by quoting string of space separated
+//   test, e.g. "test1 test2". To accept all tests use "all" for test.
+// 
+//===================================================================================
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: ossimGeneralRasterWriter bip test
+test1.enabled: 1
+
+// ---
+// Commands to generate expected results:
+// ---
+
+// Write the image:
+test1.expected_results_command0: ossim-icp general_raster_bip $(OSSIM_BATCH_TEST_DATA)/public/tif/ls7-ff-fusion.tif $(OBT_OUT_DIR)/Clinton-bip-exp.ras
+
+// Build overviews:
+test1.expected_results_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/Clinton-bip-exp.ras
+
+// Info dump to expected results dir:
+test1.expected_results_command2: ossim-info -i -p $(OBT_OUT_DIR)/Clinton-bip-exp.ras > $(OBT_EXP_DIR)/test1-info.txt
+
+// Copy histogram to expected results dir:
+test1.expected_results_command3: $(COPY_CMD)  $(OBT_OUT_DIR)/Clinton-bip-exp.his $(OBT_EXP_DIR)/test1-his.txt
+
+// ---
+// The actual commands to test:
+// ---
+
+// Write the image:
+test1.test_command0: ossim-icp general_raster_bip $(OSSIM_BATCH_TEST_DATA)/public/tif/ls7-ff-fusion.tif $(OBT_OUT_DIR)/Clinton-bip-out.ras
+
+// Build overviews:
+test1.test_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/Clinton-bip-out.ras
+
+// Info dump to expected results dir:
+test1.test_command2: ossim-info -i -p $(OBT_OUT_DIR)/Clinton-bip-out.ras > $(OBT_OUT_DIR)/test1-info.txt
+
+// Copy histogram to expected results dir:
+test1.test_command3: $(COPY_CMD)  $(OBT_OUT_DIR)/Clinton-bip-out.his $(OBT_OUT_DIR)/test1-his.txt
+
+// ---
+// Post process commands for diffs and stuff:
+// ---
+
+// Test for info dump diffs:
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test1-info.txt $(OBT_OUT_DIR)/test1-info.txt
+
+// Test for histogram diffs:
+test1.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/test1-his.txt $(OBT_OUT_DIR)/test1-his.txt
+
+
+// ---
+// Begin test2:
+// ---
+test2.name: test2
+test2.description: ossimGeneralRasterWriter bil test
+test2.enabled: 1
+
+// ---
+// Commands to generate expected results:
+// ---
+
+// Write the image:
+test2.expected_results_command0: ossim-icp general_raster_bil $(OSSIM_BATCH_TEST_DATA)/public/tif/ls7-ff-fusion.tif $(OBT_OUT_DIR)/Clinton-bil-exp.ras
+
+// Build overviews:
+test2.expected_results_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/Clinton-bil-exp.ras
+
+// Info dump to expected results dir:
+test2.expected_results_command2: ossim-info -i -p $(OBT_OUT_DIR)/Clinton-bil-exp.ras > $(OBT_EXP_DIR)/test2-info.txt
+
+// Copy histogram to expected results dir:
+test2.expected_results_command3: $(COPY_CMD)  $(OBT_OUT_DIR)/Clinton-bil-exp.his $(OBT_EXP_DIR)/test2-his.txt
+
+// ---
+// The actual commands to test:
+// ---
+
+// Write the image:
+test2.test_command0: ossim-icp general_raster_bil $(OSSIM_BATCH_TEST_DATA)/public/tif/ls7-ff-fusion.tif $(OBT_OUT_DIR)/Clinton-bil-out.ras
+
+// Build overviews:
+test2.test_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/Clinton-bil-out.ras
+
+// Info dump to expected results dir:
+test2.test_command2: ossim-info -i -p $(OBT_OUT_DIR)/Clinton-bil-out.ras > $(OBT_OUT_DIR)/test2-info.txt
+
+// Copy histogram to expected results dir:
+test2.test_command3: $(COPY_CMD)  $(OBT_OUT_DIR)/Clinton-bil-out.his $(OBT_OUT_DIR)/test2-his.txt
+
+// ---
+// Post process commands for diffs and stuff:
+// ---
+
+// Test for info dump diffs:
+test2.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test2-info.txt $(OBT_OUT_DIR)/test2-info.txt
+
+// Test for histogram diffs:
+test2.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/test2-his.txt $(OBT_OUT_DIR)/test2-his.txt
+
+
+// ---
+// Begin test3:
+// ---
+test3.name: test3
+test3.description: ossimGeneralRasterWriter bsq test
+test3.enabled: 1
+
+// ---
+// Commands to generate expected results:
+// ---
+
+// Write the image:
+test3.expected_results_command0: ossim-icp general_raster_bsq $(OSSIM_BATCH_TEST_DATA)/public/tif/ls7-ff-fusion.tif $(OBT_OUT_DIR)/Clinton-bsq-exp.ras
+
+// Build overviews:
+test3.expected_results_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/Clinton-bsq-exp.ras
+
+// Info dump to expected results dir:
+test3.expected_results_command2: ossim-info -i -p $(OBT_OUT_DIR)/Clinton-bsq-exp.ras > $(OBT_EXP_DIR)/test3-info.txt
+
+// Copy histogram to expected results dir:
+test3.expected_results_command3: $(COPY_CMD)  $(OBT_OUT_DIR)/Clinton-bsq-exp.his $(OBT_EXP_DIR)/test3-his.txt
+
+// ---
+// The actual commands to test:
+// ---
+
+// Write the image:
+test3.test_command0: ossim-icp general_raster_bsq $(OSSIM_BATCH_TEST_DATA)/public/tif/ls7-ff-fusion.tif $(OBT_OUT_DIR)/Clinton-bsq-out.ras
+
+// Build overviews:
+test3.test_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/Clinton-bsq-out.ras
+
+// Info dump to expected results dir:
+test3.test_command2: ossim-info -i -p $(OBT_OUT_DIR)/Clinton-bsq-out.ras > $(OBT_OUT_DIR)/test3-info.txt
+
+// Copy histogram to expected results dir:
+test3.test_command3: $(COPY_CMD)  $(OBT_OUT_DIR)/Clinton-bsq-out.his $(OBT_OUT_DIR)/test3-his.txt
+
+// ---
+// Post process commands for diffs and stuff:
+// ---
+
+// Test for info dump diffs:
+test3.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test3-info.txt $(OBT_OUT_DIR)/test3-info.txt
+
+// Test for histogram diffs:
+test3.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/test3-his.txt $(OBT_OUT_DIR)/test3-his.txt
diff --git a/test/config/height-info-test.kwl b/test/config/height-info-test.kwl
new file mode 100644
index 0000000..dc42f81
--- /dev/null
+++ b/test/config/height-info-test.kwl
@@ -0,0 +1,44 @@
+//===================================================================================
+// 
+// File: height-info-test.kwl
+// Generated by command: ossim-batch-test -w height-info-test.kwl
+// Description: ossim-batch-test template config file.
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * If the config file contains more than a single test, then it will be necessary 
+//   to prefix all test-specific keywords with "testN."
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+//===================================================================================
+
+description: Test height for the center of the image for test2 and test3.
+
+//---------------------------------------
+// Commands to generate expected results.
+//---------------------------------------
+expected_results_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\height.txt
+expected_results_command1: $(COPY_CMD) $(OBT_OUT_DIR)\height.txt $(OBT_EXP_DIR)\height.txt
+
+//---------------------------------------
+// The actual commands to test.
+//---------------------------------------
+test_command0: ossim-info --height -42.8508 147.2537 > $(OBT_OUT_DIR)\height.txt
+
+//---------------------------------------
+// The post-processing (comparison) commands. Typically these involve a file 
+// comparison of last run command against expected results.
+//---------------------------------------
+postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)\height.txt $(OBT_OUT_DIR)\height.txt
+
diff --git a/test/config/hlz-test.kwl b/test/config/hlz-test.kwl
new file mode 100644
index 0000000..50bbcaf
--- /dev/null
+++ b/test/config/hlz-test.kwl
@@ -0,0 +1,47 @@
+//===================================================================================
+// 
+// File: hlz-test.kwl
+//
+// Description: ossim-batch-test template config file.
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * If the config file contains more than a single test, then it will be necessary 
+//   to prefix all test-specific keywords with "testN."
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+//===================================================================================
+
+test1.name: hlz-test-pattern
+test1.description: HLZ test using synthesized test pattern as input DEM
+test1.enabled: 1
+
+//---------------------------------------
+// Commands to generate expected results.
+//---------------------------------------
+test1.expected_results_command0: ossim-hlz --dem $OSSIM_BATCH_TEST_DATA/public/HLZ/test-dem.tif --lut $OSSIM_BATCH_TEST_DATA/public/HLZ/hlz2.lut --rlz 8 $(OBT_EXP_DIR)/hlz-test.tif
+
+//---------------------------------------
+// The actual commands to test.
+//---------------------------------------
+test1.test_command0: ossim-hlz --dem $OSSIM_BATCH_TEST_DATA/public/HLZ/test-dem.tif --lut $OSSIM_BATCH_TEST_DATA/public/HLZ/hlz2.lut --rlz 8 $(OBT_OUT_DIR)/hlz-test.tif 
+
+//---------------------------------------
+// The post-processing (comparison) commands. Typically these involve a file 
+// comparison of last run command against expected results.
+//---------------------------------------
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/hlz-test.tif $(OBT_OUT_DIR)/hlz-test.tif
+
+
+
diff --git a/test/config/index-to-rgb-lut.kwl b/test/config/index-to-rgb-lut.kwl
new file mode 100644
index 0000000..ae49524
--- /dev/null
+++ b/test/config/index-to-rgb-lut.kwl
@@ -0,0 +1,46 @@
+//===================================================================================
+// 
+// File: index-to-rgb-lut.kwl
+//
+// Description: ossim-batch-test template config file.
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * If the config file contains more than a single test, then it will be necessary 
+//   to prefix all test-specific keywords with "testN."
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+//===================================================================================
+
+test1.description: Test various modes of index to RGB loook-up-table remapper class
+
+//---------------------------------------
+// Commands to generate expected results.
+//---------------------------------------
+test1.expected_results_command0: ossim-index-to-rgb-lut-test $(OBT_EXP_DIR)/lut-test.tif > $(OBT_EXP_DIR)/lut-test.txt
+
+//---------------------------------------
+// The actual commands to test.
+//---------------------------------------
+test1.test_command0: ossim-index-to-rgb-lut-test $(OBT_OUT_DIR)/lut-test.tif > $(OBT_OUT_DIR)/lut-test.txt
+
+//---------------------------------------
+// The post-processing (comparison) commands. Typically these involve a file 
+// comparison of last run command against expected results.
+//---------------------------------------
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/lut-test.txt $(OBT_OUT_DIR)/lut-test.txt
+test1.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/lut-test.tif $(OBT_OUT_DIR)/lut-test.tif
+
+
+
diff --git a/test/config/lut-test.kwl b/test/config/lut-test.kwl
new file mode 100644
index 0000000..8236e34
--- /dev/null
+++ b/test/config/lut-test.kwl
@@ -0,0 +1,60 @@
+//===================================================================================
+// 
+// File: lut-test.kwl
+//
+// Description: ossim-batch-test template config file.
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * If the config file contains more than a single test, then it will be necessary 
+//   to prefix all test-specific keywords with "testN."
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+//===================================================================================
+
+test1.description: Test various modes of index to RGB loook-up-table remapper class
+
+// Commands to generate expected results.
+test1.expected_results_command0: ossim-index-to-rgb-lut-test $(OSSIM_BATCH_TEST_DATA)/public/lut/lut-test.tif > $(OBT_EXP_DIR)/index-rgb-lut-test.txt
+
+// The actual commands to test.
+test1.test_command0: ossim-index-to-rgb-lut-test $(OSSIM_BATCH_TEST_DATA)/public/lut/lut-test.tif > $(OBT_OUT_DIR)/index-rgb-lut-test.txt
+
+// The post-processing (comparison) commands. Typically these involve a file 
+// comparison of last run command against expected results.
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/index-rgb-lut-test.txt $(OBT_OUT_DIR)/index-rgb-lut-test.txt
+
+
+test2.description: Test various modes of band-separate LUT remapper class
+
+//---------------------------------------
+// Commands to generate expected results.
+//---------------------------------------
+test2.expected_results_command0: ossim-band-lut-test $(OBT_EXP_DIR) > $(OBT_EXP_DIR)/band-lut-test.txt
+
+//---------------------------------------
+// The actual commands to test.
+//---------------------------------------
+test2.test_command0: ossim-band-lut-test $(OBT_OUT_DIR) > $(OBT_OUT_DIR)/band-lut-test.txt
+
+//---------------------------------------
+// The post-processing (comparison) commands. Typically these involve a file 
+// comparison of last run command against expected results.
+//---------------------------------------
+test2.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/bandLutTest-literal.tif $(OBT_OUT_DIR)/bandLutTest-literal.tif
+test2.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/bandLutTest-interpolated.tif $(OBT_OUT_DIR)/bandLutTest-interpolated.tif
+
+
+
+
diff --git a/test/config/ossim-chipper-test.kwl b/test/config/ossim-chipper-test.kwl
new file mode 100644
index 0000000..2ac683b
--- /dev/null
+++ b/test/config/ossim-chipper-test.kwl
@@ -0,0 +1,300 @@
+//---
+// File ossim-chipper-test.kwl
+//---
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: Test height for center of image from test2 as it is affected by height.
+
+// Clean up commands.
+test1.clean_command0: $(RMDIR_CMD) $(OBT_OUT_DIR)/t1-info-height.txt
+
+// Commands to generate expected results:
+
+// Height center of image for test2
+test1.expected_results_command0: ossim-info --height -42.8612076379401 147.259269295413,253.262469256983 > $(OBT_EXP_DIR)/t1-info-height.txt
+
+// The actual commands to test:
+
+test1.test_command0: ossim-info --height -42.8612076379401 147.259269295413,253.262469256983 > $(OBT_OUT_DIR)/t1-info-height.txt
+
+// Post process commands for diffs and stuff:
+
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t1-info-height.txt $(OBT_OUT_DIR)/t1-info-height.txt
+ 
+// ---
+// End test1:
+// ---
+
+// ---
+// Begin test2:
+// ---
+test2.name: test2
+test2.description: Test ossim-chipper ortho mode on rpc image.
+test2.enabled: 1
+
+// Commands to generate expected results:
+
+test2.expected_results_command0: ossim-chipper --op ortho --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_EXP_DIR)/t2.tif
+
+test2.expected_results_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram $(OBT_EXP_DIR)/t2.tif
+
+test2.expected_results_command2: ossim-info -d -i -p $(OBT_EXP_DIR)/t2.tif > $(OBT_EXP_DIR)/t2-info.txt
+
+// The actual commands to test:
+
+test2.test_command0: ossim-chipper --op ortho --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_OUT_DIR)/t2.tif
+
+test2.test_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram-fast $(OBT_OUT_DIR)/t2.tif
+
+test2.test_command2: ossim-info -d -i -p $(OBT_OUT_DIR)/t2.tif > $(OBT_OUT_DIR)/t2-info.txt
+
+// Post process commands for diffs and stuff:
+
+test2.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t2-info.txt $(OBT_OUT_DIR)/t2-info.txt
+test2.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t2.his $(OBT_OUT_DIR)/t2.his
+
+// ---
+// End test2:
+// ---
+
+
+// ---
+// Begin test3:
+// Note no geometry with "chip" mode so no -p in ossim-info.
+// ---
+test3.name: test3
+test3.description: Test ossim-chipper chip mode, with up is up, on rpc image.
+test3.enabled: 1
+
+// Commands to generate expected results:
+
+test3.expected_results_command0: ossim-chipper --op chip -u --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_EXP_DIR)/t3.tif
+
+test3.expected_results_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram $(OBT_EXP_DIR)/t3.tif
+
+test3.expected_results_command2: ossim-info -d -i $(OBT_EXP_DIR)/t3.tif > $(OBT_EXP_DIR)/t3-info.txt
+
+// The actual commands to test:
+
+test3.test_command0: ossim-chipper --op chip -u --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_OUT_DIR)/t3.tif
+
+test3.test_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram-fast $(OBT_OUT_DIR)/t3.tif
+
+test3.test_command2: ossim-info -d -i $(OBT_OUT_DIR)/t3.tif > $(OBT_OUT_DIR)/t3-info.txt
+
+// Post process commands for diffs and stuff:
+
+test3.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t3-info.txt $(OBT_OUT_DIR)/t3-info.txt
+test3.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t3.his $(OBT_OUT_DIR)/t3.his
+
+// ---
+// End test3:
+// ---
+
+
+// ---
+// Begin test4:
+// Note no geometry with "chip" mode so no -p in ossim-info.
+// ---
+test4.name: test4
+test4.description: Test ossim-chipper chip mode, with north up, on rpc image.
+test4.enabled: 1
+
+// Commands to generate expected results:
+
+test4.expected_results_command0: ossim-chipper --op chip -n --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_EXP_DIR)/t4.tif
+
+test4.expected_results_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram $(OBT_EXP_DIR)/t4.tif
+
+test4.expected_results_command2: ossim-info -d -i $(OBT_EXP_DIR)/t4.tif > $(OBT_EXP_DIR)/t4-info.txt
+
+// The actual commands to test:
+
+test4.test_command0: ossim-chipper --op chip -n --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_OUT_DIR)/t4.tif
+
+test4.test_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram-fast $(OBT_OUT_DIR)/t4.tif
+
+test4.test_command2: ossim-info -d -i $(OBT_OUT_DIR)/t4.tif > $(OBT_OUT_DIR)/t4-info.txt
+
+// Post process commands for diffs and stuff:
+
+test4.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t4-info.txt $(OBT_OUT_DIR)/t4-info.txt
+test4.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t4.his $(OBT_OUT_DIR)/t4.his
+
+// ---
+// End test4:
+// ---
+
+// ---
+// Begin test5:
+// Note no geometry with "chip" mode so no -p in ossim-info.
+// ---
+test5.name: test5
+test5.description: Test ossim-chipper chip mode, with rotation, on rpc image.
+test5.enabled: 1
+
+// Commands to generate expected results:
+
+test5.expected_results_command0: ossim-chipper --op chip -r 45.0 --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_EXP_DIR)/t5.tif
+
+test5.expected_results_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram $(OBT_EXP_DIR)/t5.tif
+
+test5.expected_results_command2: ossim-info -d -i $(OBT_EXP_DIR)/t5.tif > $(OBT_EXP_DIR)/t5-info.txt
+
+// The actual commands to test:
+
+test5.test_command0: ossim-chipper --op chip -r 45.0 --histogram-op auto-minmax --cut-center-llwh -42.883986392005788 147.331309643650911 512 512 --scale-to-8-bit -w tiff_tiled_band_separate $(OSSIM_BATCH_TEST_DATA)/geoeye1/GE1_Hobart_GeoStereo_NITF-NCD/001508507_01000SP00332258/5V090205P0001912264B220000100282M_001508507/Volume1/5V090205P0001912264B220000100282M_001508507.ntf $(OBT_OUT_DIR)/t5.tif
+
+test5.test_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram-fast $(OBT_OUT_DIR)/t5.tif
+
+test5.test_command2: ossim-info -d -i $(OBT_OUT_DIR)/t5.tif > $(OBT_OUT_DIR)/t5-info.txt
+
+// Post process commands for diffs and stuff:
+
+test5.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t5-info.txt $(OBT_OUT_DIR)/t5-info.txt
+test5.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t5.his $(OBT_OUT_DIR)/t5.his
+
+// ---
+// End test5:
+// ---
+
+
+// ---
+// Begin test6:
+// ---
+test6.name: test6
+test6.description: Test ossim-chipper ortho mode on, rpc image, with polygon remapper in chain.
+test6.enabled: 1
+
+// Commands to generate expected results:
+
+test6.expected_results_command0: ossim-chipper --op ortho --clip-poly-lat-lon "(-42.826019566439,147.293941362084468),(-42.822529953243581,147.297524165910716),(-42.822242150093437,147.308125338875925),(-42.826271394195437,147.311757222206637),(-42.828501868609038,147.306898351264209),(-42.834042079249286,147.307192828291022),(-42.833358546767698,147.297229688883874),(-42.829113450303090,147.292518056454895),(-42.826019566439,147.293941362084468)" --histogram-op auto-minmax --cut-center- [...]
+
+test6.expected_results_command1: ossim-preproc -r -o --ch $(OBT_EXP_DIR)/t6.tif
+
+test6.expected_results_command2: ossim-info -d -i -p $(OBT_EXP_DIR)/t6.tif > $(OBT_EXP_DIR)/t6-info.txt
+
+// The actual commands to test:
+
+test6.test_command0: ossim-chipper --op ortho --clip-poly-lat-lon "(-42.826019566439,147.293941362084468),(-42.822529953243581,147.297524165910716),(-42.822242150093437,147.308125338875925),(-42.826271394195437,147.311757222206637),(-42.828501868609038,147.306898351264209),(-42.834042079249286,147.307192828291022),(-42.833358546767698,147.297229688883874),(-42.829113450303090,147.292518056454895),(-42.826019566439,147.293941362084468)" --histogram-op auto-minmax --cut-center-llwh -42.828 [...]
+
+
+test6.test_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/t6.tif
+
+test6.test_command2: ossim-info -d -i -p $(OBT_OUT_DIR)/t6.tif > $(OBT_OUT_DIR)/t6-info.txt
+
+// Post process commands for diffs and stuff:
+
+test6.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t6-info.txt $(OBT_OUT_DIR)/t6-info.txt
+test6.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t6.his $(OBT_OUT_DIR)/t6.his
+
+// ---
+// End test6:
+// ---
+
+
+
+// ---
+// Begin test7:
+// ---
+test7.name: test7
+test7.description: Test ossim-chipper --op hillshade mode:
+test7.enabled: 1
+
+// Commands to generate expected results:
+
+test7.expected_results_command0: ossim-chipper --op hillshade --color 240 210 180 $(OSSIM_BATCH_TEST_DATA)/public/elevation/srtm/1arc/N37W123.hgt $(OBT_EXP_DIR)/t7.tif
+
+test7.expected_results_command1: ossim-preproc -r -o --ch $(OBT_EXP_DIR)/t7.tif
+
+test7.expected_results_command2: ossim-info -d -i -p $(OBT_EXP_DIR)/t7.tif > $(OBT_EXP_DIR)/t7-info.txt
+
+// The actual commands to test:
+
+test7.test_command0: ossim-chipper --op hillshade --color 240 210 180 $(OSSIM_BATCH_TEST_DATA)/public/elevation/srtm/1arc/N37W123.hgt $(OBT_OUT_DIR)/t7.tif
+
+test7.test_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/t7.tif
+
+test7.test_command2: ossim-info -d -i -p $(OBT_OUT_DIR)/t7.tif > $(OBT_OUT_DIR)/t7-info.txt
+
+// Post process commands for diffs and stuff:
+
+test7.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t7-info.txt $(OBT_OUT_DIR)/t7-info.txt
+test7.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t7.his $(OBT_OUT_DIR)/t7.his
+
+// ---
+// End test7:
+// ---
+
+// ---
+// Begin test8:
+// ---
+test8.name: test8
+test8.description: Test ossim-chipper --op hillshade mode with color lut.
+test8.enabled: 1
+
+// Commands to generate expected results:
+
+test8.expected_results_command0: ossim-chipper --op hillshade --azimuth 270 --elevation 45 --exaggeration 10 --color-table color-relief-lut1.kwl $(OSSIM_BATCH_TEST_DATA)/public/elevation/srtm/1arc/N37W123.hgt $(OBT_EXP_DIR)/t8.tif
+
+test8.expected_results_command1: ossim-preproc -r -o --ch $(OBT_EXP_DIR)/t8.tif
+
+test8.expected_results_command2: ossim-info -d -i -p $(OBT_EXP_DIR)/t8.tif > $(OBT_EXP_DIR)/t8-info.txt
+
+// The actual commands to test:
+
+test8.test_command0: ossim-chipper --op hillshade --azimuth 270 --elevation 45 --exaggeration 10 --color-table color-relief-lut1.kwl $(OSSIM_BATCH_TEST_DATA)/public/elevation/srtm/1arc/N37W123.hgt $(OBT_OUT_DIR)/t8.tif
+
+test8.test_command1: ossim-preproc -r -o --ch $(OBT_OUT_DIR)/t8.tif
+
+test8.test_command2: ossim-info -d -i -p $(OBT_OUT_DIR)/t8.tif > $(OBT_OUT_DIR)/t8-info.txt
+
+// Post process commands for diffs and stuff:
+
+test8.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t8-info.txt $(OBT_OUT_DIR)/t8-info.txt
+test8.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t8.his $(OBT_OUT_DIR)/t8.his
+
+// ---
+// End test8:
+// ---
+
+// ---
+// Begin test9:
+// ---
+test9.name: test9
+test9.description: "Test ossimChipper::getChip() through ossim-chipper-test app."
+test9.enabled: 1
+
+// Commands to generate expected results:
+
+// Write chip to file:
+test9.expected_results_command0: ossim-chipper-test chipper-test-options-001.kwl $(OBT_EXP_DIR)/t9.ras
+
+// Make a histogram:
+test9.expected_results_command1: ossim-preproc --ch $(OBT_EXP_DIR)/t9.ras
+
+// Make an info file:
+test9.expected_results_command2: ossim-info -i $(OBT_EXP_DIR)/t9.ras > $(OBT_EXP_DIR)/t9-info.txt
+
+// The actual commands to test:
+
+// Write chip to file:
+test9.test_command0: ossim-chipper-test chipper-test-options-001.kwl $(OBT_OUT_DIR)/t9.ras
+
+// Make a histogram:
+test9.test_command1: ossim-preproc --ch $(OBT_OUT_DIR)/t9.ras
+
+// Make an info file:
+test9.test_command2: ossim-info -i $(OBT_OUT_DIR)/t9.ras > $(OBT_OUT_DIR)/t9-info.txt
+
+// Post process commands for diffs and stuff:
+test9.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t9-info.txt $(OBT_OUT_DIR)/t9-info.txt
+test9.postprocess_command1: $(DIFF_CMD) $(OBT_EXP_DIR)/t9.his $(OBT_OUT_DIR)/t9.his
+
+// ---
+// End test9:
+// ---
+
diff --git a/test/config/potrace-test.kwl b/test/config/potrace-test.kwl
new file mode 100644
index 0000000..7efd529
--- /dev/null
+++ b/test/config/potrace-test.kwl
@@ -0,0 +1,41 @@
+//===================================================================================
+// 
+// File: potrace-test.kwl
+//
+// Description: ossim-batch-test template config file.
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * If the config file contains more than a single test, then it will be necessary 
+//   to prefix all test-specific keywords with "testN."
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+//===================================================================================
+
+test1.description: Test of potrace plugin
+
+// Commands to generate expected results.
+test1.expected_results_command0: ossim-potrace $(OSSIM_BATCH_TEST_DATA)/public/potrace/simulated.tif > $(OBT_EXP_DIR)/potrace-plugin-test.txt
+
+// The actual commands to test.
+test1.test_command0: ossim-potrace $(OSSIM_BATCH_TEST_DATA)/public/potrace/simulated.tif > $(OBT_OUT_DIR)/potrace-plugin-test.txt
+
+// The post-processing (comparison) commands. Typically these involve a file 
+// comparison of last run command against expected results.
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/simulated.geojson $(OBT_OUT_DIR)/simulated.geojson
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/potrace-plugin-test.txt $(OBT_OUT_DIR)/potrace-plugin-test.txt
+
+
+
+
diff --git a/test/config/super-test.kwl b/test/config/super-test.kwl
new file mode 100644
index 0000000..3bc9fea
--- /dev/null
+++ b/test/config/super-test.kwl
@@ -0,0 +1,69 @@
+//===================================================================================
+// 
+// File: super-test.kwl
+// Generated by command: ossim-batch-test -W super-test.kwl
+// Description: ossim-batch-test template config file.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are the 
+//   the following: 
+//      -c or --clean-test 
+//      -p or --preprocess-test
+//      -r or --run-test 
+//      -a or --accept-test 
+//   Multiple tests can be entered by quoting string of space-separated
+//   test names, e.g. "test1 test2". To do all tests use "all" or leave blank.
+// 
+//===================================================================================
+
+// If the config file will contain only a list of subordinate config files to be
+// run as one consolidated "super-test", then use only the following suffixed
+// keywords. Otherwise, REMOVE THESE:
+
+test_config_file0: applanix-test.kwl
+test_config_file1: eq-test.kwl
+test_config_file2: fusion-test1.kw1
+test_config_file3: genras-writer-test.kwl
+test_config_file4: height-info-test.kwl
+test_config_file5: index-to-rgb-lut.kwl
+test_config_file6: test1.kwl
+test_config_file7: wrap-test.kwl
+test_config_file8: hlz-test.kwl
+test_config_file9: viewshed-test.kwl
+
+
+
diff --git a/test/config/test1.kwl b/test/config/test1.kwl
new file mode 100644
index 0000000..b3fae25
--- /dev/null
+++ b/test/config/test1.kwl
@@ -0,0 +1,133 @@
+//===================================================================================
+// 
+// File: test1.kwl
+// Description: Contains assorted tests.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are:
+//      -c or --clean-test
+//      -p or --preprocess-test
+//      -r or --run-test
+//      -a or --accept-test
+//   Multiple tests can be entered by quoting string of space separated
+//   test, e.g. "test1 test2". To accept all tests use "all" for test.
+// 
+//===================================================================================
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: Test geographic projection with nitf format.
+test1.enabled: 1
+
+// Commands to generate expected results:
+
+test1.expected_results_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/ntf/Clinton_IA.ntf > $(OBT_EXP_DIR)/nitf-info.txt
+
+// The actual commands to test:
+
+test1.test_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/ntf/Clinton_IA.ntf > $(OBT_OUT_DIR)/nitf-info.txt
+
+// Post process commands for diffs and stuff:
+
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/nitf-info.txt $(OBT_OUT_DIR)/nitf-info.txt
+ 
+
+// ---
+// Begin test3:
+// ---
+test3.name: test3
+test3.description: Test geographic projection with tiff format.
+test3.enabled: 1
+
+// Commands to generate expected results:
+
+test3.expected_results_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/tif/Clinton_IA.tif > $(OBT_EXP_DIR)/tif-geo-info.txt
+
+// The actual commands to test:
+
+test3.test_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/tif/Clinton_IA.tif  > $(OBT_OUT_DIR)/tif-geo-info.txt
+
+// Post process commands for diffs and stuff:
+
+test3.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/tif-geo-info.txt $(OBT_OUT_DIR)/tif-geo-info.txt
+
+ 
+// ---
+// Begin test4:
+// ---
+test4.name: test4
+test4.description: Test utm projection with tiff format.
+test4.enabled: 1
+
+// Commands to generate expected results:
+
+test4.expected_results_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/tif/Iowa-utm.tif > $(OBT_EXP_DIR)/tif-utm-info.txt
+
+// The actual commands to test:
+
+test4.test_command0: ossim-info -d -i -p $(OSSIM_BATCH_TEST_DATA)/public/tif/Iowa-utm.tif  > $(OBT_OUT_DIR)/tif-utm-info.txt
+
+// Post process commands for diffs and stuff:
+
+test4.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/tif-utm-info.txt $(OBT_OUT_DIR)/tif-utm-info.txt
+
+ 
+// ---
+// Begin: test5
+// ---
+test5.name: test5
+test5.description: Test ossimImageData::loadTile from 16 to 8.  Test histogram dropping last bin.
+test5.enabled: 1
+
+// Commands to generate expected results:
+
+test5.expected_results_command0: ossim-loadtile-test > $(OBT_EXP_DIR)/test5.txt
+
+// The actual commands to test:
+
+test5.test_command0: ossim-loadtile-test > $(OBT_OUT_DIR)/test5.txt
+
+// Post process commands for diffs and stuff:
+
+test5.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/test5.txt $(OBT_OUT_DIR)/test5.txt
+
+// ---
+// End: test5
+// ---
+ 
diff --git a/test/config/viewshed-test.kwl b/test/config/viewshed-test.kwl
new file mode 100644
index 0000000..04ce5d7
--- /dev/null
+++ b/test/config/viewshed-test.kwl
@@ -0,0 +1,47 @@
+//===================================================================================
+// 
+// File: viewshed-test.kwl
+//
+// Description: ossim-batch-test template config file.
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * If the config file contains more than a single test, then it will be necessary 
+//   to prefix all test-specific keywords with "testN."
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during runtime to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+//===================================================================================
+
+test1.name: viewshed-test-pattern
+test1.description: Viewshed test using synthesized test pattern as input DEM
+test1.enabled: 1
+
+//---------------------------------------
+// Commands to generate expected results.
+//---------------------------------------
+test1.expected_results_command0: ossim-viewshed --dem $OSSIM_BATCH_TEST_DATA/public/viewshed/vs-test-dem.tif --lut $OSSIM_BATCH_TEST_DATA/public/viewshed/vs.lut 0 0 $(OBT_EXP_DIR)/viewshed-test.tif
+
+//---------------------------------------
+// The actual commands to test.
+//---------------------------------------
+test1.test_command0: ossim-viewshed --dem $OSSIM_BATCH_TEST_DATA/public/viewshed/vs-test-dem.tif --lut $OSSIM_BATCH_TEST_DATA/public/viewshed/vs.lut 0 0 $(OBT_OUT_DIR)/viewshed-test.tif 
+
+//---------------------------------------
+// The post-processing (comparison) commands. Typically these involve a file 
+// comparison of last run command against expected results.
+//---------------------------------------
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/viewshed-test.tif $(OBT_OUT_DIR)/viewshed-test.tif
+
+
+
diff --git a/test/config/wrap-test.kwl b/test/config/wrap-test.kwl
new file mode 100644
index 0000000..f135b83
--- /dev/null
+++ b/test/config/wrap-test.kwl
@@ -0,0 +1,76 @@
+//===================================================================================
+// 
+// File: wrap-test.kwl
+// Description: Test output of edge to edge world scene.
+// 
+// Control flags:
+// Use 1 or true, 0 or false to turn on and off sections.
+// Typically preprocess and expected results only turned on for first run.
+// Clean commands should erase anything created by this test.
+// Command order if flag turned on:
+// 1) clean, 2) pre-process, 3) expected, 4) test, 5) post-process
+// 
+// NOTES:
+// * The following environment variables must be set before running batch test:
+//     OSSIM_BATCH_TEST_DATA     Top-level dir containing all test source data
+//     OSSIM_BATCH_TEST_RESULTS  Top-level dir containing all test results (exp, 
+//                               out and log),
+// 
+// * The variables OBT_EXP_DIR and OBT_OUT_DIR are assigned during run-time to
+//   the proper paths according to the config filename. It isn't required to replace
+//   these nor predefine them in the environment. You can leave them as is or modify
+//   the paths to your unconventional file paths.
+// 
+// * In order to preserve platform independence, please utilize the following 
+//   variables for the common OS commands when adding new commands to the test
+//   configuration KWL file. Examples are provided in this template
+//       $(DIFF_CMD) Use this var for windows "fc" or linux "diff"
+//       $(COPY_CMD) Use this var for windows "copy" or linux "cp"
+//       $(MKDIR_CMD) Use this var for windows "mkdir" or linux "mkdir"
+//       $(RM_CMD) Use this var for windows "del /Q" or linux "rm -f"
+//       $(RMDIR_CMD) Use this var for windows "rmdir /S /Q" or linux "rm -rf"
+//   This application will set the environment variables to the proper values at 
+//   runtime, so no need to worry about defining these.
+// 
+// * Use forward slashes "//", at beginning of line for comments.
+// 
+// * You can use existing environment variables as $(YOUR_VARIABLE). They will be 
+//   expanded at run time if valid.
+// 
+// * Clean, preprocess, run, and accept test sections can be switched on or off
+//   at run time.  These override config file flags.  Optional arguments are:
+//      -c or --clean-test
+//      -p or --preprocess-test
+//      -r or --run-test
+//      -a or --accept-test
+//   Multiple tests can be entered by quoting string of space separated
+//   test, e.g. "test1 test2". To accept all tests use "all" for test.
+// 
+//===================================================================================
+
+// ---
+// Begin test1:
+// ---
+test1.name: test1
+test1.description: Test output of edge to edge world scene.
+test1.enabled: 1
+
+// Commands to generate expected results:
+
+test1.expected_results_command0: ossim-orthoigen $(OSSIM_BATCH_TEST_DATA)/public/bmng/july/world.200407.3x5400x2700.jpg $(OBT_OUT_DIR)/t1.tif
+
+//test1.expected_results_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram-fast $(OBT_OUT_DIR)/t1.tif
+
+test1.expected_results_command1: ossim-info -d -i -p $(OBT_OUT_DIR)/t1.tif > $(OBT_EXP_DIR)/t1-info.txt
+
+// The actual commands to test:
+
+test1.test_command0: ossim-orthoigen $(OSSIM_BATCH_TEST_DATA)/public/bmng/july/world.200407.3x5400x2700.jpg $(OBT_OUT_DIR)/t1.tif
+
+//test1.test_command1: ossim-preproc -r --ot ossim_kakadu_nitf_j2k --create-histogram-fast $(OBT_OUT_DIR)/t1.tif
+
+test1.test_command1: ossim-info -d -i -p $(OBT_OUT_DIR)/t1.tif > $(OBT_OUT_DIR)/t1-info.txt
+
+// Post process commands for diffs and stuff:
+
+test1.postprocess_command0: $(DIFF_CMD) $(OBT_EXP_DIR)/t1-info.txt $(OBT_OUT_DIR)/t1-info.txt
diff --git a/test/src/CMakeLists.txt b/test/src/CMakeLists.txt
new file mode 100644
index 0000000..cc4f8c6
--- /dev/null
+++ b/test/src/CMakeLists.txt
@@ -0,0 +1,23 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+# Only "install" the following. 
+OSSIM_SETUP_APPLICATION(ossim-batch-test INSTALL COMPONENT_NAME ossim SOURCE_FILES ossim-batch-test.cpp)
+
+# Remainder to be built but not installed
+OSSIM_SETUP_APPLICATION(ossim-foo COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-foo.cpp)
+OSSIM_SETUP_APPLICATION(ossim-test COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-test.cpp)
+
+add_subdirectory(base)
+add_subdirectory(elevation)
+add_subdirectory(gsoc)
+add_subdirectory(imaging)
+add_subdirectory(parallel)
+add_subdirectory(point_cloud)
+add_subdirectory(projection)
+add_subdirectory(support_data)
+add_subdirectory(util)
+add_subdirectory(vec)
+
+if (OSSIM_HAS_HDF5)
+  add_subdirectory(hdf5)
+endif (OSSIM_HAS_HDF5)
diff --git a/test/src/base/CMakeLists.txt b/test/src/base/CMakeLists.txt
new file mode 100644
index 0000000..533ae1d
--- /dev/null
+++ b/test/src/base/CMakeLists.txt
@@ -0,0 +1,30 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+# Remainder to be built but not installed
+OSSIM_SETUP_APPLICATION(ossim-byte-stream-buffer-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-byte-stream-buffer-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-csv-file-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-csv-file-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-date-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-date-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-datum-shift INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-datum-shift.cpp)
+OSSIM_SETUP_APPLICATION(ossim-directory-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-directory-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-dms-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-dms-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-duration-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-duration-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-filename-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-filename-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-gpt-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gpt-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-histo-compare INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-histo-compare.cpp)
+OSSIM_SETUP_APPLICATION(ossim-keywordlist-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-keywordlist-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-kmeans-clustering-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-kmeans-clustering-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-least-squares-plane-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-least-squares-plane-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-lsr-space-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-lsr-space-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-notify-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-notify-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-obj-allocate INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-obj-allocate.cpp)
+OSSIM_SETUP_APPLICATION(ossim-point-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-point-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-rect-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-rect-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-ref-ptr-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-ref-ptr-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-stream-factory-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-stream-factory-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-string-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-string-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-thin-plate-spline-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-thin-plate-spline-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-threaded-logfile-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-logfile-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-threaded-polyarea2d-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-polyarea2d-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-visitor-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-visitor-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-xml-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-xml-test.cpp)
+
diff --git a/test/src/base/ossim-argument-parser-test.cpp b/test/src/base/ossim-argument-parser-test.cpp
new file mode 100644
index 0000000..ab8e14c
--- /dev/null
+++ b/test/src/base/ossim-argument-parser-test.cpp
@@ -0,0 +1,78 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test code for ossimGpt class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-gpt-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <stdlib.h>
+#include <string.h>
+#include <iostream>
+#include <vector>
+
+using namespace std;
+
+template <typename T, size_t N> size_t SizeOfArray( const T(&)[ N ] ) { return N; }
+
+#define DO_TEST true
+
+void fail()
+{
+#if DO_TEST
+   cout<<"\nFAILED ossimArgumentParser TEST"<<endl;
+   exit(-1);
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+   // define alternate command line:
+#if DO_TEST
+   char* test_argv[]  = { argv[0],
+                          "-b", "B1", "B2",
+                          "-a", "A1",
+                          "-a", "A2",
+                          "-c", "C1,", "C2,C3,", "C4",
+                          "arg1", "arg2" };
+   int test_argc = SizeOfArray(test_argv);
+   ossimArgumentParser ap (&test_argc, test_argv);
+#else
+   ossimArgumentParser ap (&argc, argv);
+#endif
+
+   std::string ts1;
+   std::string ts2;
+
+   if ( !ap.read("-a", ts1) || (ts1 != "A1"))
+      fail();
+
+   if ( !ap.read("-a", ts1) || (ts1 != "A2"))
+      fail();
+
+   if ( !ap.read("-b", ts1, ts2) || (ts1 != "B1") || (ts2 != "B2"))
+      fail();
+
+   vector<ossimString> param_list;
+   if ( !ap.read("-c", param_list) || (param_list.size() != 4) ||
+         (param_list[0] != "C1") ||
+         (param_list[1] != "C2") ||
+         (param_list[2] != "C3") ||
+         (param_list[3] != "C4"))
+   {
+      fail();
+   }
+
+   if (( ap.argc() != 3 ) || (strcmp(ap[1], "arg1") != 0) || (strcmp(ap[2], "arg2") != 0))
+      fail();
+
+
+   cout<<"\nPASSED ossimArgumentParser TEST"<<endl;
+   exit(0);
+}
diff --git a/ossim/src/test/ossim-byte-stream-buffer-test.cpp b/test/src/base/ossim-byte-stream-buffer-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-byte-stream-buffer-test.cpp
rename to test/src/base/ossim-byte-stream-buffer-test.cpp
diff --git a/ossim/src/test/ossim-csv-file-test.cpp b/test/src/base/ossim-csv-file-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-csv-file-test.cpp
rename to test/src/base/ossim-csv-file-test.cpp
diff --git a/test/src/base/ossim-date-test.cpp b/test/src/base/ossim-date-test.cpp
new file mode 100644
index 0000000..199c465
--- /dev/null
+++ b/test/src/base/ossim-date-test.cpp
@@ -0,0 +1,56 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test code for generic ossim test.
+//
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-date-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimDate.h>
+#include <ossim/init/ossimInit.h>
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   std::string s1 = "2009-02-05T11:26:13.458650Z";
+   ossimLocalTm d1;
+   d1.setIso8601(s1);
+   
+   std::string s2 = "2009-01-11T09:06:05.606000Z";
+   ossimLocalTm d2;
+   d2.setIso8601(s2);
+
+   cout << "s1: " << s1 << "\n";
+   d1.dump(std::cout);
+   cout << "s2: " << s2 << "\n";
+   d2.dump(std::cout);
+
+   ossimLocalTm d4;
+   cout << "local time:\n";
+   d4.dump(cout);
+ 
+   ossimLocalTm d5 = d4.convertToGmt();
+   cout << "local time converted to GMT:\n";
+   d5.dump(cout);
+
+   
+   ossimDate d6;
+   cout << "Date:\n";
+   d6.print(cout);
+   cout << "\n";
+   d6.dump(cout);
+   cout << endl;
+
+   return 0;
+}
+
diff --git a/ossim/src/test/ossim-datum-shift.cpp b/test/src/base/ossim-datum-shift.cpp
similarity index 100%
rename from ossim/src/test/ossim-datum-shift.cpp
rename to test/src/base/ossim-datum-shift.cpp
diff --git a/test/src/base/ossim-directory-test.cpp b/test/src/base/ossim-directory-test.cpp
new file mode 100644
index 0000000..582f4c2
--- /dev/null
+++ b/test/src/base/ossim-directory-test.cpp
@@ -0,0 +1,80 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-directory-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test application for ossimDirectory class.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimDirectory.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <iostream>
+using namespace std;
+
+static void usage()
+{
+   cout << "ossim-directory-test <directory>"
+        << "\nDumps files in directory..." << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   int result = 0;
+   
+   ossimInit::instance()->initialize(argc, argv);
+   
+   if (argc == 2)
+   {
+      try // Exceptions can be thrown so 
+      {
+         ossimFilename directory = argv[1];
+         
+         cout << "directory: " << directory << "\n";
+         directory = directory.expand();
+
+         ossimDirectory d;
+         if ( d.open(directory) )
+         {
+            ossimFilename f;
+            if ( d.getFirst(f) )
+            {
+               do
+               {
+                  if ( f.size() )
+                  {
+                     cout << "file: " << f << endl;
+                  }
+                  else
+                  {
+                     cout << "file is empty!" << endl;
+                  }
+               } while ( d.getNext(f) );
+            }
+            else
+            {
+               cout << "ossimDirectory::getFirst() returned false!" << endl;
+            }
+         }
+      }
+      catch( const ossimException& e )
+      {
+         cout << e.what() << endl;
+         result = 1;
+      }
+   }
+   else
+   {
+      usage();
+   }
+   
+   return result;
+}
diff --git a/ossim/src/test/ossim-dms-test.cpp b/test/src/base/ossim-dms-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-dms-test.cpp
rename to test/src/base/ossim-dms-test.cpp
diff --git a/ossim/src/test/ossim-duration-test.cpp b/test/src/base/ossim-duration-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-duration-test.cpp
rename to test/src/base/ossim-duration-test.cpp
diff --git a/test/src/base/ossim-filename-test.cpp b/test/src/base/ossim-filename-test.cpp
new file mode 100644
index 0000000..09a890a
--- /dev/null
+++ b/test/src/base/ossim-filename-test.cpp
@@ -0,0 +1,210 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// ossimFilename class test app.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-filename-test.cpp 20097 2011-09-14 17:03:00Z dburken $
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimFilename.h>
+
+#include <iostream>
+#include <string>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimFilename directoryToDelete;
+
+   if ( argc == 2 )
+   {
+      ossimString osArg1 = argv[1];
+      osArg1.downcase();
+      if ( (osArg1 == "-h") || (osArg1 == "--help") )
+      {
+         cout << "\nUsage: ossim-filename-test <optional_directory_to_delete>\n"
+              << "Runs various test on ossimFilename class.\n"
+              << "If optional_directory_to_delete is set calls ossimFilename::remove on it.\n"
+              << "Options: -h --help Gives this usage.\n" << endl;
+         return 0;
+      }
+      else
+      {
+         directoryToDelete = argv[1];
+      }
+   }
+         
+   ossimFilename a  = "c:\\foo\\you";
+   ossimFilename a2 = "\\foo\\you";
+   ossimFilename b  = "/foo/you";
+   ossimFilename c  = "foo/you";
+   ossimFilename d1 = "~/docs";
+   ossimFilename d2 = "./foo";
+   ossimFilename d3 = "../../foo";
+   ossimFilename d4 = ".";
+   ossimFilename d5 = "ab";
+   ossimFilename d6 = "a";
+
+   // Environment var WORK must be set.
+   ossimFilename d7 = "$(WORK)/ossim";
+   ossimFilename d8 = "~/tmp/$(WORK)/ossim";
+
+   // Test windows x$ 
+   ossimFilename d9 = "//kiosk/x$/SourceImagery/foo.ntf";
+   
+  ossimFilename e = "/foo/you.xxx";
+   ossimString   ext1 = ".tif";
+   ossimString   ext2 = "jpg";
+   ossimString   ext3;
+
+
+   cout << "\na:              " << a
+        << "\na.expand():     " << a.expand()
+        << "\na.isRelative(): " << a.isRelative() << "\n"
+
+        << "\na2:              " << a2
+        << "\na2.expand():     " << a2.expand()
+        << "\na2.isRelative(): " << a2.isRelative() << "\n"      
+
+        << "\nb:              " << b
+        << "\nb.expand():     " << b.expand()
+        << "\nb.isRelative(): " << b.isRelative() << "\n"
+      
+        << "\nc:              " << c
+        << "\nc.expand():     " << c.expand()
+        << "\nc.isRelative(): " << c.isRelative() << "\n"
+
+        << "\nd1:              " << d1
+        << "\nd1.expand():     " << d1.expand()
+        << "\nd1.isRelative(): " << d1.isRelative() << "\n"
+      
+        << "\nd2:              " << d2
+        << "\nd2.expand():     " << d2.expand()
+        << "\nd2.isRelative(): " << d2.isRelative() << "\n"
+
+        << "\nd3:              " << d3
+        << "\nd3.expand():     " << d3.expand()
+        << "\nd3.isRelative(): " << d3.isRelative() << "\n"
+
+        << "\nd4:              " << d4
+        << "\nd4.expand():     " << d4.expand()
+        << "\nd4.isRelative(): " << d4.isRelative() << "\n"
+
+        << "\nd5:              " << d5
+        << "\nd5.expand():     " << d5.expand()
+        << "\nd5.isRelative(): " << d5.isRelative() << "\n"
+      
+        << "\nd6:              " << d6
+        << "\nd6.expand():     " << d6.expand()
+        << "\nd6.isRelative(): " << d6.isRelative() << "\n";
+
+   cout << "\nNOTE: d7 and d8 output require variable WORK be set in your "
+        << "environment.\n"
+      
+        << "\nd7:              " << d7
+        << "\nd7.expand():     " << d7.expand()
+        << "\nd7.isRelative(): " << d7.isRelative() << "\n"
+
+        << "\nd8:              " << d8
+        << "\nd8.expand():     " << d8.expand()
+        << "\nd8.isRelative(): " << d8.isRelative() << "\n"
+      
+        << "\nd9:              " << d9
+        << "\nd9.expand():     " << d9.expand()
+        << "\nd9.isRelative(): " << d9.isRelative() << "\n"
+      
+        << "\next1:        " << ext1
+        << "\next2:        " << ext2
+        << "\next3:        " << ext3 << "\n";
+   
+   cout << "e:                    " << e << "\n";
+   cout << "e.setExtension(ext1): " << e.setExtension(ext1) << "\n";
+   cout << "e.setExtension(ext2): " << e.setExtension(ext2) << "\n";
+   cout << "e.setExtension(ext3): " << e.setExtension(ext3) << "\n";
+
+   // Test dir cat.
+   a = "/foo/";
+   b = "you";
+   c = a.dirCat(b);
+   cout << "\na:           " << a
+        << "\nb:           " << b
+        << "\nc = a.dirCat(b): " << c << "\n";
+
+   a = "/foo";
+   b = "you";
+   c = a.dirCat(b);
+   cout << "\na:           " << a
+        << "\nb:           " << b
+        << "\nc = a.dirCat(b): " << c << "\n";
+
+   a = "/foo";
+   b = "./you";
+   c = a.dirCat(b);
+   cout << "\na:           " << a
+        << "\nb:           " << b
+        << "\nc = a.dirCat(b): " << c << "\n";
+
+   a = "/foo";
+   b = "/you";
+   c = a.dirCat(b);
+   cout << "\na:           " << a
+        << "\nb:           " << b
+        << "\nc = a.dirCat(b): " << c << "\n";
+
+   a = "/foo";
+   b = "";
+   c = a.dirCat(b);
+   cout << "\na:           " << a
+        << "\nb:           " << b
+        << "\nc = a.dirCat(b): " << c << "\n";
+
+   a = "";
+   b = "you";
+   c = a.dirCat(b);
+   cout << "\na:           " << a
+        << "\nb:           " << b
+        << "\nc = a.dirCat(b): " << c << "\n";
+
+   a = "/data/images/t1.tif";
+   cout << "\na: " << a
+        << "\na.fileNoExtension(): " << a.fileNoExtension()
+        << "\na.noExtension(): " << a.noExtension() << "\n";
+
+   // Test a file with two dots.
+   a = "/data/ascii_dems/dtm_v1.5_5mp_3141.asc";
+   cout << "\n// Test a file with two dots."
+        << "\na: " << a
+        << "\na.fileNoExtension(): " << a.fileNoExtension()
+        << "\na.noExtension(): " << a.noExtension() << "\n";
+
+   std::string s = "abc";
+   ossimFilename f = s; // Used to not compile.
+   cout << "ossimFilename f = std::string(abc): " << f << "\n";
+
+   // Test a 
+
+   if ( directoryToDelete.size() )
+   {
+      cout << "ossimFilename::remove on " << directoryToDelete << " was ";
+      if ( directoryToDelete.remove() )
+      {
+         cout << "successful...\n";
+      }
+      else
+      {
+         cout << "unsuccessful...\n";
+      }
+   }
+
+   cout << endl;
+   
+   return 0;
+}
diff --git a/test/src/base/ossim-gpt-test.cpp b/test/src/base/ossim-gpt-test.cpp
new file mode 100644
index 0000000..d3d803c
--- /dev/null
+++ b/test/src/base/ossim-gpt-test.cpp
@@ -0,0 +1,141 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test code for ossimGpt class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-gpt-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimGpt.h>
+#include <ossim/init/ossimInit.h>
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   cout << "ossimGpt::wrap test:\n";
+   
+   ossimGpt gpt(0.0, 0.0, 0.0);
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 45.0;
+   gpt.lon = 45.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+   
+   gpt.lat = 90.0;
+   gpt.lon = 180.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 91.0;
+   gpt.lon = 181.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 179.0;
+   gpt.lon = 359.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 181.0;
+   gpt.lon = 361.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 271.0;
+   gpt.lon = 361.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 359.0;
+   gpt.lon = 361.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 361.0;
+   gpt.lon = 721.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = 451.0;
+   gpt.lon = 901.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -45.0;
+   gpt.lon = -45.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+   
+   gpt.lat = -90.0;
+   gpt.lon = -180.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -91.0;
+   gpt.lon = -181.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -179.0;
+   gpt.lon = -359.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -181.0;
+   gpt.lon = -361.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -271.0;
+   gpt.lon = -361.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -359.0;
+   gpt.lon = -361.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -361.0;
+   gpt.lon = -721.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   gpt.lat = -451.0;
+   gpt.lon = -901.0;
+   cout << "gpt: " << gpt << "\n";
+   gpt.wrap();
+   cout << "gpt::wrap: " << gpt << "\n\n";
+
+   
+   return 0;
+}
diff --git a/ossim/src/test/ossim-histo-compare.cpp b/test/src/base/ossim-histo-compare.cpp
similarity index 100%
rename from ossim/src/test/ossim-histo-compare.cpp
rename to test/src/base/ossim-histo-compare.cpp
diff --git a/test/src/base/ossim-keywordlist-test.cpp b/test/src/base/ossim-keywordlist-test.cpp
new file mode 100644
index 0000000..a21174e
--- /dev/null
+++ b/test/src/base/ossim-keywordlist-test.cpp
@@ -0,0 +1,399 @@
+#include <iostream>
+#include <fstream>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimTempFilename.h>
+
+using namespace std;
+
+bool runTestForFileVariations()
+{
+   cout << "------------------ Running tests on different file variations ---------------- \n";
+   bool test_failed = false;
+
+   ossimTempFilename tempFile(".", "temp","txt",true,false);
+   tempFile.generateRandomFile();
+   
+   {
+      ofstream out(tempFile.c_str());
+      
+      out<< "";
+      out.close();
+      
+      ossimKeywordlist kwl;
+      cout << "Empty File Test? ";
+      if(kwl.addFile(tempFile))
+      {
+         cout << "PASSED" << endl;
+      }
+      else 
+      {
+         cout << "FAILED" << endl;
+         test_failed = false;
+      }
+   }
+   {
+      ossimTempFilename tempFileDos(".", "tempDos","txt",true,false);
+      tempFileDos.generateRandomFile();
+      
+      ofstream outUnix(tempFile.c_str());
+      ofstream outDos(tempFileDos.c_str());
+      
+      outUnix<< "key1: value1\n";
+      outUnix<< "key2: value2\n";
+      outUnix<< "key3: value3\n";
+      outUnix<< "key4: value4\n";
+      outUnix<< "key5: value5\n";
+      outUnix.close();
+      outDos<< "key1: value1\r";
+      outDos<< "key2: value2\r";
+      outDos<< "key3: value3\r";
+      outDos<< "key4: value4\r";
+      outDos<< "key5: value5\r";
+      outDos.close();
+      
+      ossimKeywordlist kwlUnix;
+      ossimKeywordlist kwlDos;
+      cout << "Dos carriage returns and unix returns? ";
+      
+      if((kwlUnix.addFile(tempFile)&&kwlDos.addFile(tempFileDos))&&
+         (kwlUnix.getMap() == kwlDos.getMap()))
+      {
+         cout << "PASSED" << endl;
+      }
+      else 
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+   }
+   {
+      ofstream out(tempFile.c_str());
+      
+      out<< "/adfakdfhkadkjh\n";
+      out.close();
+      
+      ossimKeywordlist kwl;
+      cout << "bad comment? ";
+      if(kwl.addFile(tempFile))
+      {
+         cout << "PASSED" << endl;
+      }
+      else 
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+   }
+   {
+      ofstream out(tempFile.c_str());
+      
+      out<< "//adfakdfhkadkjh\n";
+      out.close();
+      
+      ossimKeywordlist kwl;
+      cout << "good comment? ";
+      if(kwl.addFile(tempFile))
+      {
+         cout << "PASSED" << endl;
+      }
+      else 
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+   }
+   {
+      ofstream out(tempFile.c_str());
+      
+      out<< "//adfakdfhkadkjh";
+      out.close();
+      
+      ossimKeywordlist kwl;
+      cout << "good comment no end of line? ";
+      if(kwl.addFile(tempFile))
+      {
+         cout << "PASSED" << endl;
+      }
+      else 
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+   }
+   {
+      ofstream out(tempFile.c_str());
+      
+      out<< "/test:";
+      out.close();
+      
+      ossimKeywordlist kwl;
+      cout << "----------- 1 token lookahead problem, single slash start of line with valid key but no value ------------ \n";
+      cout << "Accepted file? ";
+      if(kwl.addFile(tempFile))
+      {
+         cout << "PASSED" << endl;
+      }
+      else 
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+
+      cout << "Verify key? ";
+      const char* value = kwl.find("/test");
+      if (value)
+      {
+         cout << "PASSED" << endl;
+      }
+      else
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+   }
+   {
+      ofstream out(tempFile.c_str());
+      
+      out<< "test   :";
+      out.close();
+      cout << "----------- trailing spaces for key trimmed ------------ \n";
+      
+      ossimKeywordlist kwl;
+      cout << "Accepted file? ";
+      if(kwl.addFile(tempFile))
+      {
+         cout << "PASSED" << endl;
+      }
+      else 
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+
+      cout << "Verify key? ";
+      const char* value = kwl.find("test");
+      if (value)
+      {
+         cout << "PASSED" << endl;
+      }
+      else
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+   }
+   {
+      ossimKeywordlist kwl;
+      ossimString value1 ="   --leading and trailing---   ";
+      ossimString value2 ="   --trailing---";
+      ossimString value3 ="--leading---   ";
+      kwl.add("","key1", value1);
+      kwl.add("","key2", value2);
+      kwl.add("","key3", value3);
+      kwl.trimAllValues();
+      cout << "----------- Testing utility method trimAll values ------------ \n";
+      cout << "Verify  value1? ";
+      if (value1.trim() == ossimString(kwl.find("key1")))
+         cout << "PASSED" << endl;
+      else
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+      cout << "Verify  value2? ";
+      if (value2.trim() == ossimString(kwl.find("key2")))
+         cout << "PASSED" << endl;
+      else
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+      cout << "Verify  value3? ";
+      if (value3.trim() == ossimString(kwl.find("key3")))
+         cout << "PASSED" << endl;
+      else
+      {
+         cout << "FAILED" << endl;
+         test_failed = true;
+      }
+   }
+   return test_failed;
+}
+
+bool runIncludeTest()
+{
+   cout << "----------- Testing #include directive handling ------------ \n";
+
+
+   ossimTempFilename t1(".", "f1","kwl",true,false);
+   ossimTempFilename t2(".", "f2","kwl",true,false);
+   ossimTempFilename t3(".", "f3","kwl",true,false);
+   ossimTempFilename t4(".", "f4","kwl",true,false);
+
+   t1.generateRandomFile();
+   t2.generateRandomFile();
+   t3.generateRandomFile();
+   t4.generateRandomFile();
+
+   ofstream f1 (t1.chars());
+   ofstream f2 (t2.chars());
+   ofstream f3 (t3.chars());
+   ofstream f4 (t4.chars());
+
+   f1<<"f1k1: f1v1\nf1k2: f1v2\n#include "<<t2<<"\n#include \""<<t3<<"\""<<endl;
+   f2<<"f2k1: f2v1\n#include "<<t4<<"\nf2k2: f2v2"<<endl;
+   f3<<"f3k1: f3v1\nf3k2: f3v2"<<endl;
+   f4<<"f4k1: f4v1\nf4k2: f4v2"<<endl;
+
+   f1.close();
+   f2.close();
+   f3.close();
+   f4.close();
+
+   ossimKeywordlist kwl (t1.chars());
+   kwl.print(cout);
+
+   ossimString value;
+   bool test_failed = true;
+   while (true)
+   {
+      value = kwl.find("f1k1");
+      if (value != "f1v1")
+         break;
+      value = kwl.find("f1k2");
+      if (value != "f1v2")
+         break;
+      value = kwl.find("f2k1");
+      if (value != "f2v1")
+         break;
+      value = kwl.find("f2k2");
+      if (value != "f2v2")
+         break;
+      value = kwl.find("f3k1");
+      if (value != "f3v1")
+         break;
+      value = kwl.find("f3k2");
+      if (value != "f3v2")
+         break;
+      value = kwl.find("f4k1");
+      if (value != "f4v1")
+         break;
+      value = kwl.find("f4k2");
+      if (value != "f4v2")
+         break;
+
+      test_failed = false;
+      break;
+   }
+
+   if (!test_failed)
+      cout << "#include test PASSED."<<endl;
+   else
+      cout << "#include test FAILED."<<endl;
+
+   return test_failed;
+}
+
+int main(int argc, char* argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+   ossimString complicatedHtmlEmbed = "<html>\n\
+   <head>\n\
+   <title>OMAR Login</title>\n\
+   <link rel=\"stylesheet\" href=\"/omar/css/main.css\"/>\n\
+   <link rel=\"stylesheet\" href=\"/omar/css/omar-2.0.css\"/>\n\
+   <link rel=\"stylesheet\" href=\"/omar/css/main.css\"/>\
+   <link rel=\"stylesheet\" href=\"/omar/css/omar-2.0.css\"/>\n\
+   <link rel=\"stylesheet\" type=\"text/css\" href=\"richui-0.8/js/yui/reset-fonts-grids/reset-fonts-grids.css\"/>\n\
+   <link rel=\"stylesheet\" type=\"text/css\" href=\"richui-0.8/js/yui/layout/assets/skins/sam/layout.css\"/>\n\
+   \n\
+   \n\
+   \n\
+   <style>\n\
+   /*\n\
+   margin and padding on body element\n\
+   can introduce errors in determining\n\
+   element position and are not recommended;\n\
+   we turn them off as a foundation for YUI\n\
+   CSS treatments.\n\
+   */ \n\
+   body {\n\
+   margin: 0;\n\
+   padding: 0;\n\
+   }\n\
+   \n\
+   /* Set the background color */\n\
+   .yui-skin-sam .yui-layout {\n\
+   background-color: #FFFFFF;\n\
+   }\n\
+   \n\
+   /* Style the body */\n\
+   .yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {\n\
+   background-color: #FFFFFF;\n\
+   }\n\
+   \n\
+   </style>\n\
+   </head>\n\
+   ";
+   ossimString testValueAllBlanks = "          ";
+   ossimString testValueLeftBlanks = "  blanks are to the left";
+   ossimString testValueRightBlanks = "blanks are to the right    ";
+   ossimString testValueRightBlanksEol = "\n\n\n\n\nblanks are to the right   \n\n ";
+   ossimKeywordlist kwl;
+   ossimKeywordlist kwl2;
+   
+   kwl.add("test1.", "value", "value no new line", true);
+   kwl.add("test2.", "value", "value \n\n\non separate\nlines", true);
+   kwl.add("test3.", "value", "value no new line", true);
+   kwl.add("test4.", "value", "", true);
+   kwl.add("testAllBlanks.",   "value", testValueAllBlanks, true);
+   kwl.add("testLeftBlanks.",  "value", testValueLeftBlanks, true);
+   kwl.add("testRightBlanks.", "value", testValueRightBlanks, true);
+   kwl.add("testRightBlanks.", "value", testValueRightBlanks, true);
+   kwl.add("testRightBlanksEol.", "value", testValueRightBlanksEol, true);
+   kwl.add("testZ.", "value", "", true);
+   kwl.add("complicatedHtmlEmbed.", "value", complicatedHtmlEmbed, true);
+   ossimTempFilename tempFile(".", "temp","txt",true,false);
+   tempFile.generateRandomFile();
+   cout << "tempFile === " << tempFile << endl;
+   ofstream out(tempFile.c_str());
+   out << kwl << endl;
+   out.close();
+   
+   kwl2.addFile(tempFile.c_str());
+   
+   cout << "---------------------- Original KWL --------------------\n";
+   cout << kwl << endl;
+   cout << "---------------------- Testing Original KWL Read back in from file --------------------\n";
+   cout << kwl2 << endl;
+   cout << "---------------------- Testing Original KWL toString no arguments--------------------\n";
+   cout << kwl.toString() << endl;
+   cout << "---------------------- Testing Original KWL toString with arguments--------------------\n";
+   ossimString result;
+   kwl.toString(result);
+   cout << result << endl;
+   cout << "---------------------- Testing environment variable expand for add variable--------------------\n";
+   ossimKeywordlist kwl3;
+   kwl3.setExpandEnvVarsFlag(true);
+   kwl3.add("test1.", "value", "$(HOME) no new line", true);
+   kwl3.add("test1.", "value", "$(HOME) no $(HOME) new line", true);
+   cout << kwl3 << endl;
+   cout << "------------------ Running sanity tests to make sure that triple quotes are retained ---------------- \n";
+ 
+   cout << "kwl1 == kwl2? " << ((kwl.getMap() == kwl2.getMap())?"PASSED":"FAILED") << endl;
+   cout << "testValueAllBlanks preserved? " << ((ossimString(kwl2.find("testAllBlanks.value"))==testValueAllBlanks)?"PASSED":"FAILED") << endl;
+   cout << "testValueLeftBlanks preserved? " << ((ossimString(kwl2.find("testLeftBlanks.value"))==testValueLeftBlanks)?"PASSED":"FAILED") << endl;
+   cout << "testValueRightBlanks preserved? " << ((ossimString(kwl2.find("testRightBlanks.value"))==testValueRightBlanks)?"PASSED":"FAILED") << endl;
+   cout << "testRightBlanksEol preserved? " << ((ossimString(kwl2.find("testRightBlanksEol.value"))==testValueRightBlanksEol)?"PASSED":"FAILED") << endl;
+   cout << "complicatedHtmlEmbed preserved? " << ((ossimString(kwl2.find("complicatedHtmlEmbed.value"))==complicatedHtmlEmbed)?"PASSED":"FAILED") << endl;
+   bool test_failed = runTestForFileVariations();
+   test_failed |= runIncludeTest();
+
+   if (!test_failed)
+      cout<<"\nAll tests PASSED.\n"<<endl;
+   else
+      cout<<"\nEnountered at least one FAILED.\n"<<endl;
+
+   return test_failed;
+}
diff --git a/test/src/base/ossim-kmeans-clustering-test.cpp b/test/src/base/ossim-kmeans-clustering-test.cpp
new file mode 100644
index 0000000..fb5ce1d
--- /dev/null
+++ b/test/src/base/ossim-kmeans-clustering-test.cpp
@@ -0,0 +1,123 @@
+#include <ossim/base/ossimKMeansClustering.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimException.h>
+#include <fstream>
+
+#ifdef WIN32
+#define MY_POPEN(arg1, arg2) _popen(arg1, arg2)
+#else
+#define MY_POPEN(arg1, arg2) popen(arg1, arg2)
+#endif
+
+using namespace std;
+
+void usage(char* appName)
+{
+   cout << "\nUsage: "<<appName<<" <samples-file>\n"<<endl;
+}
+
+int main(int argc, char *argv[])
+{
+   ostringstream xmsg;
+   int returnCode = 0;
+   
+   if ( argc < 2 )
+   {
+      usage(argv[0]);
+      exit(0);
+   }
+
+   // Load data:
+   ossimFilename histoFile (argv[1]);
+   ossimString label (histoFile.before("-"));
+   ossimRefPtr<ossimMultiResLevelHistogram> mrlh = new ossimMultiResLevelHistogram;
+   bool result = mrlh->importHistogram(histoFile);
+   if (!result)
+   {
+      cout << "Could not open datafile at <"<<argv[1]<<">. Aborting."<<endl;
+      exit (-1);
+   }
+
+   ossimRefPtr<ossimHistogram> band_histo = mrlh->getHistogram(0);
+   if (!band_histo.valid())
+   {
+      xmsg<<"ossimKMeansFilter:"<<__LINE__<<"  Null band histogram returned!";
+      throw ossimException(xmsg.str());
+   }
+
+   ossimRefPtr<ossimKMeansClustering> classifier = new ossimKMeansClustering;
+   classifier->setNumClusters(2);
+   const float* x = band_histo->GetVals();
+   const float* y = band_histo->GetCounts();
+   ossim_uint32 N = (ossim_uint32) band_histo->GetRes();
+   classifier->setSamples(x, N);
+   classifier->setPopulations(y, N);
+   if (!classifier->computeKmeans())
+   {
+      cout<<"ossimKMeansFilter:"<<__LINE__<<" No K-means clustering data available."<<endl;
+      exit(1);
+   }
+
+   double A = classifier->getMean(0);
+   double a = classifier->getSigma(0);
+   double B = classifier->getMean(1);
+   double b = classifier->getSigma(1);
+
+   double T1 = classifier->getMaxValue(0);
+   double T2 = (b*A + a*B)/(a+b);
+   double T3 = (b*b*A + a*a*B)/(a*a+b*b);
+
+   ostringstream xtics;
+   xtics << "0.2, 0.8, "
+         << "\"-a\" "<<A-a<<", "
+         << "\"A\" "<<A<<", "
+         << "\"a\" "<<A+a<<", "
+         << "\"\" 0.5, "
+         << "\"-b\" "<<B-b<<", "
+         << "\"B\" "<<B<<", "
+         << "\"b\" "<<B+b;
+
+   // Create temporary data file stream:
+   FILE * gnuplotPipe = MY_POPEN ("gnuplot -persistent", "w");
+   //FILE * gnuplotPipe = fopen("gnuplot.dat", "w");
+   if (!gnuplotPipe)
+   {
+      cout << "Could not create temporary gnuplot pipe. "<< endl;
+      exit(1);
+   }
+
+   ostringstream xticsCmd;
+   xticsCmd<<"set xtics ("<<xtics.str()<<")";
+   fprintf(gnuplotPipe, "%s \n",xticsCmd.str().c_str());
+   fprintf(gnuplotPipe, "set xrange [0.2:0.8]\n");
+
+   fprintf(gnuplotPipe, "set style arrow 1 lt 1 lc rgb \"blue\" lw 1 \n");
+   fprintf(gnuplotPipe, "set style arrow 2 lt 1 lc rgb \"green\" lw 1 \n");
+   fprintf(gnuplotPipe, "set style arrow 3 lt 1 lc rgb \"orange\" lw 1 \n");
+
+   fprintf(gnuplotPipe, "set arrow arrowstyle 1 from %f,graph(0.3, 0.3) to %f,graph(0,0)\n", T1, T1);
+   fprintf(gnuplotPipe, "set label \"T1\" at %f, graph 0.33 center\n", T1);
+
+   fprintf(gnuplotPipe, "set arrow arrowstyle 2 from %f,graph(0.4, 0.4) to %f,graph(0,0)\n", T2, T2);
+   fprintf(gnuplotPipe, "set label \"T2\" at %f, graph 0.43 center\n", T2);
+
+   fprintf(gnuplotPipe, "set arrow arrowstyle 3 from %f,graph(0.5, 0.5) to %f,graph(0,0)\n", T3, T3);
+   fprintf(gnuplotPipe, "set label \"T3\" at %f, graph 0.53 center\n", T3);
+
+   fprintf(gnuplotPipe, "set label \"%s\" at graph 0.15, graph 0.9 right font \",16\"\n", label.chars());
+
+   // Output histogram data to temporary x, y file:
+   ossimString command ("plot '-' with dots");
+   fprintf(gnuplotPipe, "%s \n", command.chars());
+
+   for (int i=0; i<N; ++i)
+   {
+      fprintf(gnuplotPipe, "%f %f \n", x[i], y[i]);
+   }
+   fprintf(gnuplotPipe, "e\n");
+
+   fclose(gnuplotPipe);
+
+   return 0;
+}
diff --git a/ossim/src/test/ossim-least-squares-plane-test.cpp b/test/src/base/ossim-least-squares-plane-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-least-squares-plane-test.cpp
rename to test/src/base/ossim-least-squares-plane-test.cpp
diff --git a/ossim/src/test/ossim-lsr-space-test.cpp b/test/src/base/ossim-lsr-space-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-lsr-space-test.cpp
rename to test/src/base/ossim-lsr-space-test.cpp
diff --git a/test/src/base/ossim-notify-test.cpp b/test/src/base/ossim-notify-test.cpp
new file mode 100644
index 0000000..6423c79
--- /dev/null
+++ b/test/src/base/ossim-notify-test.cpp
@@ -0,0 +1,51 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// ossimNotify functions test.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-notify-test.cpp 23285 2015-04-28 19:45:07Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimNotify.h>
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimFilename logFile;
+   ossimGetLogFilename(logFile);
+
+   cout << "log file after ossimInit::instance()->initialize: "
+        << logFile << endl;
+
+   if (logFile.size() == 0)
+   {
+      logFile = "/tmp/ossim-log.txt";
+      ossimSetLogFilename(logFile);
+   }
+
+   ossimGetLogFilename(logFile);
+
+   cout << "set logFile end of test: " << logFile << endl;
+
+   // ossimSetError was hanging:
+   cout << "Calling ossimSetError(...) ..." << endl;
+   ossimSetError( ossimString("ossimTiffOverviewBuilder"),
+                 ossimErrorCodes::OSSIM_WRITE_FILE_ERROR,
+                 "%s file %s line %d\nError creating reduced res set!",
+                 "MODULE",
+                 __FILE__,
+                 __LINE__);
+   cout << "ossimSetError(...) returned..." << endl;
+   
+   return 0;
+}
diff --git a/ossim/src/test/ossim-obj-allocate.cpp b/test/src/base/ossim-obj-allocate.cpp
similarity index 100%
rename from ossim/src/test/ossim-obj-allocate.cpp
rename to test/src/base/ossim-obj-allocate.cpp
diff --git a/test/src/base/ossim-point-test.cpp b/test/src/base/ossim-point-test.cpp
new file mode 100644
index 0000000..522d768
--- /dev/null
+++ b/test/src/base/ossim-point-test.cpp
@@ -0,0 +1,184 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+//----------------------------------------------------------------------------
+// $Id: ossim-point-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <string>
+#include <iostream>
+#include <sstream>
+
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDpt3d.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimEcefPoint.h>
+#include <ossim/base/ossimEcefVector.h>
+
+int main()
+{
+   //---
+   // Test ossiIpt::operator>>
+   //---
+   std::string is1(" ( 0, 1 )");
+   std::string is2(" (2,3)");
+   std::string is3(" ( 4, 5 )");
+   std::string is4_5_6_7(" ( 6, 7 )(8, 9) ( 10, 11 ) ( 12, 13) 9876");
+
+   ossimIpt ip1;
+   ossimIpt ip2;
+   ossimIpt ip3;
+   ossimIpt ip4;
+   ossimIpt ip5;
+   ossimIpt ip6;
+   ossimIpt ip7;
+   
+
+   ip1.toPoint(is1);
+   ip2.toPoint(is2);
+   ip3.toPoint(is3);
+   int i;
+
+   std::istringstream istr(is4_5_6_7);
+   istr >> ip4 >> ip5 >> ip6 >> ip7 >> i;
+
+   //---
+   // Test ossiDpt::operator>>
+   //---
+   std::string ds1(" ( 0.0, 1.1 )");
+   std::string ds2(" (2.2,3.3)");
+   std::string ds3(" ( 4.4, 5.5 )");
+   std::string ds4_5_6_7(" ( 6.6, 7.7 )(8.8, 9.9) ( 10.0, 11.0 ) ( 12.0, 13.0) 9876.12345678");
+   std::string ds8("12 20");
+
+   ossimDpt dp1;
+   ossimDpt dp2;
+   ossimDpt dp3;
+   ossimDpt dp4;
+   ossimDpt dp5;
+   ossimDpt dp6;
+   ossimDpt dp7;
+   ossimDpt dp8;
+
+   dp1.toPoint(ds1);
+   dp2.toPoint(ds2);
+   dp3.toPoint(ds3);
+   double d;
+
+   std::istringstream istr2(ds4_5_6_7);
+   istr2 >> dp4 >> dp5 >> dp6 >> dp7 >> d;
+
+   dp8.toPoint(ds8); // Test an invalid string "12 20"
+
+    //---
+   // Test ossiDpt3d
+   //---
+   std::string ds3d1  = " ( 0.0, 1.1, 2.2 )";
+   std::string ds3d2 = "(1.0,2.0,3.0)";
+   
+   ossimDpt3d dp3d1;
+   ossimDpt3d dp3d2;
+   dp3d1.toPoint(ds3d1);
+   dp3d2.toPoint(ds3d2);
+
+
+   //---
+   // Test ossiGpt::operator>>
+   //---
+   std::string gs1("(0.0,0.0,0.0,WGE)");
+   std::string gs2("(1.1,2.2,3.3,NAR-C)");
+   std::string gs3(" (4.4,5.5,6.6,NAS-C )");
+   std::string gs4_5_6_7(" (4.4,5.5,6.6,NAS-C )( 10.0, 10.0 ,5.0, TOY-C ) (17, -89, 50.0, xxx) (28.2, -44.5, 10000.0, NAS-B) 12345.6789");
+
+   ossimGpt gp1;
+   ossimGpt gp2;
+   ossimGpt gp3;
+   ossimGpt gp4;
+   ossimGpt gp5;
+   ossimGpt gp6;
+   ossimGpt gp7;
+   double d2;
+
+   gp1.toPoint(gs1);
+   gp2.toPoint(gs2);
+   gp3.toPoint(gs3);
+
+   std::istringstream istr4(gs4_5_6_7);
+   istr4 >> gp4 >> gp5 >> gp6 >> gp7 >> d2;
+
+
+   //---
+   // Test ossimEcefPoint toString and toPoint methods.
+   //---
+   std::string es1("(1.0,2.0,3.0)");
+   ossimEcefPoint ep1;
+   ep1.toPoint(es1);
+   std::string es2 = ep1.toString(10).string();
+
+   //---
+   // Test ossimEcefPoint toString and toPoint methods.
+   //---
+   ossimEcefVector ev1;
+   ev1.toPoint(es1);
+   std::string es3 = ev1.toString(10).string();
+  
+   std::cout
+      << "\nis1:       " << is1
+      << "\nip1:       " << ip1
+      << "\nis2:       " << is2
+      << "\nip2:       " << ip2
+      << "\nis3:       " << is3
+      << "\nip3:       " << ip3
+      << "\nis4_5_6_7: " << is4_5_6_7
+      << "\nip4:       " << ip4
+      << "\nip5:       " << ip5
+      << "\nip6:       " << ip6
+      << "\nip7:       " << ip7
+      << "\ni:         " << i
+
+      << "\n\n\nds1:       " << ds1
+      << "\ndp1:       " << dp1
+      << "\nds2:       " << ds2
+      << "\ndp2:       " << dp2
+      << "\nds3:       " << ds3
+      << "\ndp3:       " << dp3
+      << "\nds4_5_6_7: " << ds4_5_6_7
+      << "\ndp4:       " << dp4
+      << "\ndp5:       " << dp5
+      << "\ndp6:       " << dp6
+      << "\ndp7:       " << dp7
+      << "\nds8:       " << ds8
+      << "\ndp8:       " << dp8
+      << "\nd:         " << d
+
+      << "\n\nds3d1:       " << ds3d1
+      << "\nds3d2:     " << ds3d2
+      << "\ndp3d1:     " << dp3d1
+      << "\ndp3d2:     " << dp3d2
+
+      << "\n\n\ngs1:       " << gs1
+      << "\ngp1:       " << gp1
+      << "\ngs2:       " << gs2
+      << "\ngp2:       " << gp2
+      << "\ngs3:       " << gs3
+      << "\ngp3:       " << gp3
+      << "\ngs4_5_6_7: " << gs4_5_6_7
+      << "\ngp4:       " << gp4
+      << "\ngp5:       " << gp5
+      << "\ngp6:       " << gp6
+      << "\ngp7:       " << gp7
+      << "\nd2:         " << d2
+
+      << "\n\n\nes1:       " << es1
+      << "\nep1:       " << ep1
+      << "\nes2:       " << es2
+      << "\nev1:       " << ev1
+      << "\nes3:       " << es3
+
+      << std::endl;
+
+   return 0;
+}
diff --git a/test/src/base/ossim-rect-test.cpp b/test/src/base/ossim-rect-test.cpp
new file mode 100644
index 0000000..6532884
--- /dev/null
+++ b/test/src/base/ossim-rect-test.cpp
@@ -0,0 +1,160 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-rect-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test app for ossimIrect and ossimDrect classes.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimGrect.h>
+
+#include <iostream>
+using namespace std;
+
+int main()
+{
+   // IRECTS:
+
+   // left handed irects
+   ossimIrect ir1(0, 0, 10, 10);
+   ossimIrect ir2(1, 1, 9, 9);
+   ossimIrect ir3 = ir1.clipToRect(ir2);
+   cout << "ossimIrect Left Handed:"
+        << "\nrect ir1:            " << ir1
+        << "\nrect ir2:            " << ir2
+        << "\nir1.clipToRect(ir2): " << ir3
+        << "\nexpected: ul=(1,1), ur=(9,1), lr=(9,9), ll=(1,9)\n\n";
+   
+   // right handed irects
+   ossimIrect ir4(0,10, 10,0,OSSIM_RIGHT_HANDED);
+   ossimIrect ir5(-5,8,14,1,OSSIM_RIGHT_HANDED);
+   ossimIrect ir6 = ir4.clipToRect(ir5);
+   cout << "ossimIrect Right Handed:"
+        << "\nrect ir4:          " << ir4
+        << "\nrect ir5:          " << ir5
+        << "\nd.clipToRect(e):   " << ir6
+        << "\nexpected: ul=(0,8), ur=(10,8), lr=(10,1), ll=(0,1)\n\n";
+
+   // DRECTS:
+
+   // left handed irects
+   ossimDrect dr1(0, 0, 10, 10);
+   ossimDrect dr2(1, 1, 9, 9);
+   ossimDrect dr3 = dr1.clipToRect(dr2);
+   cout << "ossimDrect Left Handed:"
+        << "\nrect dr1:            " << dr1
+        << "\nrect dr2:            " << dr2
+        << "\ndr1.clipToRect(dr2): " << dr3
+        << "\nexpected: ul=(1,1), ur=(9,1), lr=(9,9), ll=(1,9)\n\n";
+   
+   // right handed drects
+   ossimDrect dr4(0,10, 10,0,OSSIM_RIGHT_HANDED);
+   ossimDrect dr5(-5,8,14,1,OSSIM_RIGHT_HANDED);
+   ossimDrect dr6 = dr4.clipToRect(dr5);
+   cout << "ossimDrect Right Handed:"
+        << "\nrect dr4:          " << dr4
+        << "\nrect dr5:          " << dr5
+        << "\nd.clipToRect(e):   " << dr6
+        << "\nexpected: ul=(0,8), ur=(10,8), lr=(10,1), ll=(0,1)\n"
+        << endl;
+
+
+  ossimDrect dComletelyWithinSource(0,0,10,10);
+  ossimDrect dWithinEqual(0,0,10,10);
+  ossimDrect dWithinLess(5,5,8,8);
+  ossimDrect dWithinTop(0,-1,10,9);
+  ossimDrect dWithinLeft(-1,0,9,10);
+  ossimDrect dWithinRight(10,0,20,20);
+  ossimDrect dWithinBottom(0,10,20,20);
+  ossimIrect dWithinWayOut(50000,50000,100000,100000);
+
+  std::cout << "ossimDrect completely within tests:" 
+        << "\nrect source:          " << dComletelyWithinSource
+        << "\nrect dWithinEqual:          " << dWithinEqual
+        << "\nrect dWithinLess:          " << dWithinLess
+        << "\nrect dWithinTop:          " << dWithinTop
+        << "\nrect dWithinLeft:          " << dWithinLeft
+        << "\nrect dWithinRight:          " << dWithinRight
+        << "\nrect dWithinBottom:          " << dWithinBottom
+        << "\nrect dWithinWayOut:          " << dWithinWayOut
+        << "\nrect  dWithinEqual  " << dWithinEqual.completely_within(dComletelyWithinSource)
+        << "\nrect  dWithinLess  " << dWithinLess.completely_within(dComletelyWithinSource)
+        << "\nrect  dWithinTop  " << dWithinTop.completely_within(dComletelyWithinSource)
+        << "\nrect  dWithinLeft  " << dWithinLeft.completely_within(dComletelyWithinSource)
+        << "\nrect  dWithinRight  " << dWithinRight.completely_within(dComletelyWithinSource)
+        << "\nrect  dWithinBottom  " << dWithinBottom.completely_within(dComletelyWithinSource)
+        << "\nrect  dWithinWayOut  " << dWithinWayOut.completely_within(dComletelyWithinSource)
+        << "\nexpected: 1, 1, 0, 0, 0, 0, 0\n"
+        << endl;
+
+  ossimIrect iComletelyWithinSource(0,0,10,10);
+  ossimIrect iWithinEqual(0,0,10,10);
+  ossimIrect iWithinLess(5,5,8,8);
+  ossimIrect iWithinTop(0,-1,10,9);
+  ossimIrect iWithinLeft(-1,0,9,10);
+  ossimIrect iWithinRight(10,0,20,20);
+  ossimIrect iWithinBottom(0,10,20,20);
+  ossimIrect iWithinWayOut(50000,50000,100000,100000);
+
+  std::cout << "ossimIrect completely within tests:" 
+        << "\nrect source:          " << iComletelyWithinSource
+        << "\nrect iWithinEqual:          " << iWithinEqual
+        << "\nrect iWithinLess:          " << iWithinLess
+        << "\nrect iWithinTop:          " << iWithinTop
+        << "\nrect iWithinLeft:          " << iWithinLeft
+        << "\nrect iWithinRight:          " << iWithinRight
+        << "\nrect iWithinBottom:          " << iWithinBottom
+        << "\nrect iWithinWayOut:          " << iWithinWayOut
+        << "\nrect  iWithinEqual  " << iWithinEqual.completely_within(iComletelyWithinSource)
+        << "\nrect  iWithinLess  " << iWithinLess.completely_within(iComletelyWithinSource)
+        << "\nrect  iWithinTop  " << iWithinTop.completely_within(iComletelyWithinSource)
+        << "\nrect  iWithinLeft  " << iWithinLeft.completely_within(iComletelyWithinSource)
+        << "\nrect  iuWithinRight  " << iWithinRight.completely_within(iComletelyWithinSource)
+        << "\nrect  uWithinBottom  " << iWithinBottom.completely_within(iComletelyWithinSource)
+        << "\nrect  iWithinWayOut  " << iWithinWayOut.completely_within(iComletelyWithinSource)
+        << "\nexpected: 1, 1, 0, 0, 0, 0, 0\n"
+        << endl;
+
+
+  ossimGrect gComletelyWithinSource(ossimGpt(0,0),ossimGpt(10,10));
+  ossimGrect gWithinEqual(ossimGpt(0,0),ossimGpt(10,10));
+  ossimGrect gWithinLess(ossimGpt(5,5),ossimGpt(8,8));
+  ossimGrect gWithinTop(ossimGpt(0,-1),ossimGpt(10,9));
+  ossimGrect gWithinLeft(ossimGpt(-1,0),ossimGpt(9,10));
+  ossimGrect gWithinRight(ossimGpt(10,0),ossimGpt(20,20));
+  ossimGrect gWithinBottom(ossimGpt(0,10),ossimGpt(20,20));
+  ossimGrect gWithinWayOut(ossimGpt(45,45),ossimGpt(50,50));
+
+  std::cout << "ossimGrect completely within tests:" 
+        << "\nrect source:          " << gComletelyWithinSource
+        << "\nrect gWithinEqual:          " << gWithinEqual
+        << "\nrect gWithinLess:          " << gWithinLess
+        << "\nrect gWithinTop:          " << gWithinTop
+        << "\nrect gWithinLeft:          " << gWithinLeft
+        << "\nrect gWithinRight:          " << gWithinRight
+        << "\nrect gWithinBottom:          " << gWithinBottom
+        << "\nrect gWithinWayOut:          " << gWithinWayOut
+        << "\nrect  gWithinEqual  " << gWithinEqual.completely_within(gComletelyWithinSource)
+        << "\nrect  gWithinLess  " << gWithinLess.completely_within(gComletelyWithinSource)
+        << "\nrect  gWithinTop  " << gWithinTop.completely_within(gComletelyWithinSource)
+        << "\nrect  gWithinLeft  " << gWithinLeft.completely_within(gComletelyWithinSource)
+        << "\nrect  gWithinRight  " << gWithinRight.completely_within(gComletelyWithinSource)
+        << "\nrect  gWithinBottom  " << gWithinBottom.completely_within(gComletelyWithinSource)
+        << "\nrect  gWithinWayOut  " << gWithinWayOut.completely_within(gComletelyWithinSource)
+        << "\nexpected: 1, 1, 0, 0, 0, 0, 0\n"
+        << endl;
+
+
+
+   return 0;
+}
+
diff --git a/test/src/base/ossim-ref-ptr-test.cpp b/test/src/base/ossim-ref-ptr-test.cpp
new file mode 100644
index 0000000..869a237
--- /dev/null
+++ b/test/src/base/ossim-ref-ptr-test.cpp
@@ -0,0 +1,90 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimRefPtr class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-ref-ptr-test.cpp 19980 2011-08-17 20:14:46Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimReferenced.h>
+#include <ossim/init/ossimInit.h>
+
+// Referenced object.
+class Obj : public ossimReferenced
+{
+public:
+   Obj(){}
+   virtual ~Obj(){ cout << "~Obj..." << endl; }
+};
+
+// Owns a ref ptr.
+class Foo
+{
+public:
+   Foo() : m_refPtr(new Obj) {}
+   ~Foo() { m_refPtr = 0; }
+   ossimRefPtr<Obj>& getRefPtr() { return m_refPtr; }
+
+private:
+   ossimRefPtr<Obj> m_refPtr;
+};
+
+static void assignRefPtr(ossimRefPtr<Obj>& rp)
+{
+   rp = new Obj;
+}
+
+static ossimRefPtr<Obj> getRefPtr()
+{
+   return ossimRefPtr<Obj>(new Obj);
+}
+
+// Test app
+int main( /* int argc, char* argv[] */ )
+{
+   ossimInit::instance()->initialize();
+
+   Foo* f = new Foo;
+
+   cout << "count(1): " << f->getRefPtr()->referenceCount() << endl;
+
+   ossimRefPtr<Obj> rp = f->getRefPtr();
+
+   cout << "count(2): " << f->getRefPtr()->referenceCount() << endl;
+
+   delete f;  
+   f = 0;
+
+   cout << "count(1): " << rp->referenceCount() << endl;
+
+   rp = 0; // Should destroy here...
+
+   rp = 0;
+   assignRefPtr(rp);
+
+   if ( rp.valid() )
+   {
+      cout << "assignRefPtr rp count(1): " << rp->referenceCount() << endl;
+   }
+
+   rp = 0;
+
+   rp = getRefPtr();
+
+   if ( rp.valid() )
+   {
+      cout << "getRefPtr rp count(1): " << rp->referenceCount() << endl;
+   }
+   
+   
+   return 0;
+}
diff --git a/test/src/base/ossim-stream-factory-test.cpp b/test/src/base/ossim-stream-factory-test.cpp
new file mode 100644
index 0000000..1aaa5db
--- /dev/null
+++ b/test/src/base/ossim-stream-factory-test.cpp
@@ -0,0 +1,133 @@
+//---
+//
+// License: MIT
+//
+// File: ossim-stream-factory-test.cpp
+//
+// Description: Test app for ossim::StreamFactoryRegistry and associated
+// factories.
+//
+// $Id$
+//---
+
+// ossim includes:  These are here just to save time/typing...
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/init/ossimInit.h>
+
+#include <iostream>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [options]";
+   au->setCommandLineUsage(usageString);
+   au->addCommandLineOption("--in",  "<file> open ossim::istream");
+   au->addCommandLineOption("--out", "<file> open ossim::ostream");
+   au->addCommandLineOption("--io",  "<file> open ossim::iostream");
+   
+   ossimInit::instance()->initialize(ap);
+
+   if ( ap.argc() > 1)
+   {
+      try
+      {
+         std::string ts1;
+         ossimArgumentParser::ossimParameter sp1(ts1);
+         
+         if( ap.read("--in", sp1) )
+         {
+            ossimString connnectionString(ts1);
+            shared_ptr<ossim::istream> str = ossim::StreamFactoryRegistry::instance()->
+               createIstream( connnectionString, std::ios_base::in|std::ios_base::binary );
+
+            if ( str )
+            {
+               ossimNotify(ossimNotifyLevel_INFO)
+                  << "Opened ossim::istream (str) for " << connnectionString
+                  << "\nInitial use_count: " << str.use_count()  << endl;
+
+               shared_ptr<ossim::ifstream> str2 = std::dynamic_pointer_cast<ossim::ifstream>( str );
+
+               if ( str2 )
+               {
+                  ossimNotify(ossimNotifyLevel_INFO)
+                     << "cast to ossim::ifstream (srt2) successful."
+                     << "\nstr use_count:  " << str.use_count()
+                     << "\nstr2 use_count: " << str2.use_count()  << endl;
+               }
+               else
+               {
+                   ossimNotify(ossimNotifyLevel_INFO)
+                      << "cast to ossim::ifstream failed!" << endl;
+               }
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_INFO)
+                  << "Could not open ossim::istream for " << connnectionString << endl;
+            }
+         }
+
+         if( ap.read("--out", sp1) )
+         {
+            ossimString connnectionString(ts1);
+            shared_ptr<ossim::ostream> str = ossim::StreamFactoryRegistry::instance()->
+               createOstream( connnectionString, std::ios_base::in|std::ios_base::binary );
+
+            if ( str )
+            {
+               ossimNotify(ossimNotifyLevel_INFO)
+                  << "Opened ossim::ostream for " << connnectionString << endl;
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_INFO)
+                  << "Could not open ossim::ostream for " << connnectionString << endl;
+            }
+         }
+
+         if( ap.read("--io", sp1) )
+         {
+            ossimString connnectionString(ts1);
+            shared_ptr<ossim::iostream> str = ossim::StreamFactoryRegistry::instance()->
+               createIOstream( connnectionString, std::ios_base::in|std::ios_base::binary );
+            
+            if ( str )
+            {
+               ossimNotify(ossimNotifyLevel_INFO)
+                  << "Opened ossim::iostream for " << connnectionString << endl;
+            }
+            else
+            {
+               ossimNotify(ossimNotifyLevel_INFO)
+                  << "Could not open iossim::ostream for " << connnectionString << endl;
+            }
+         }
+      }
+      catch(const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         returnCode = 1;
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossim-foo caught unhandled exception!" << std::endl;
+         returnCode = 1;
+      }
+   }
+   else
+   {
+      ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+   }
+   return returnCode;
+}
diff --git a/ossim/src/test/ossim-string-test.cpp b/test/src/base/ossim-string-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-string-test.cpp
rename to test/src/base/ossim-string-test.cpp
diff --git a/ossim/src/test/ossim-thin-plate-spline-test.cpp b/test/src/base/ossim-thin-plate-spline-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-thin-plate-spline-test.cpp
rename to test/src/base/ossim-thin-plate-spline-test.cpp
diff --git a/ossim/src/test/ossim-threaded-logfile-test.cpp b/test/src/base/ossim-threaded-logfile-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-threaded-logfile-test.cpp
rename to test/src/base/ossim-threaded-logfile-test.cpp
diff --git a/ossim/src/test/ossim-threaded-polyarea2d-test.cpp b/test/src/base/ossim-threaded-polyarea2d-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-threaded-polyarea2d-test.cpp
rename to test/src/base/ossim-threaded-polyarea2d-test.cpp
diff --git a/ossim/src/test/ossim-visitor-test.cpp b/test/src/base/ossim-visitor-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-visitor-test.cpp
rename to test/src/base/ossim-visitor-test.cpp
diff --git a/test/src/base/ossim-xml-test.cpp b/test/src/base/ossim-xml-test.cpp
new file mode 100644
index 0000000..09c40d7
--- /dev/null
+++ b/test/src/base/ossim-xml-test.cpp
@@ -0,0 +1,48 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// XML functions test.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-xml-test.cpp 23285 2015-04-28 19:45:07Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimXmlDocument.h>
+#include <ossim/init/ossimInit.h>
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 2)
+   {
+      cout << "usage: " << argv[0] << " <xml_file>" << endl;
+      return 0;
+   }
+   
+   ossimFilename f = argv[1];
+
+   cout << "file: " << f << endl;
+
+   ossimXmlDocument* xdoc = new ossimXmlDocument();
+   if ( xdoc->openFile(f) )
+   {
+      cout << "opened..." << endl;
+   }
+   else
+   {
+      cout << "not opened..." << endl;
+   }
+   
+   delete xdoc;
+
+   return 0;
+}
diff --git a/test/src/elevation/CMakeLists.txt b/test/src/elevation/CMakeLists.txt
new file mode 100644
index 0000000..e41631a
--- /dev/null
+++ b/test/src/elevation/CMakeLists.txt
@@ -0,0 +1,8 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+# Remainder to be built but not installed
+OSSIM_SETUP_APPLICATION(ossim-dted-handler-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-dted-handler-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-elevation-manager-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-elevation-manager-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-image-elevation-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-elevation-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-threaded-elevation-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-elevation-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-tiled-elevation-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-tiled-elevation-test.cpp)
diff --git a/test/src/elevation/ossim-dted-handler-test.cpp b/test/src/elevation/ossim-dted-handler-test.cpp
new file mode 100644
index 0000000..80a6541
--- /dev/null
+++ b/test/src/elevation/ossim-dted-handler-test.cpp
@@ -0,0 +1,80 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2005 David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application / example code of opening a dted handler
+// and using it.
+//
+// $Id: ossim-dted-handler-test.cpp 23495 2015-08-28 15:25:19Z okramer $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/elevation/ossimDtedHandler.h>
+
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   //---
+   // Note: You must tweak the next three variables...
+   // This is a 3601x3601 cell.
+   //---
+   ossimFilename dtedCell = "/work/drb/image_formats/dted/1arc/w092/n40.dt1";
+   double neLat = 41.0;
+   double neLon = -92.0;
+   
+   ossimDtedHandler* dh = new ossimDtedHandler(dtedCell);
+   double p00 = dh->getPostValue(ossimIpt(0, 3599));
+   double p01 = dh->getPostValue(ossimIpt(0, 3600));
+   double p10 = dh->getPostValue(ossimIpt(1, 3599));
+   double p11 = dh->getPostValue(ossimIpt(1, 3600));
+
+   double ps  = 1.0/3601.0; // post spacing
+   double hps = ps/2.0;     // half post spacing
+   
+   ossimGpt gp00( (neLat-ps),    neLon,      0.0 );
+   ossimGpt gp01(  neLat,        neLon,      0.0 );
+   ossimGpt gp10( (neLat-ps),   (neLon+ps),  0.0);
+   ossimGpt gp11(  neLat,       (neLon+ps),  0.0 );
+   ossimGpt gpMid( (neLat-hps), (neLon+hps), 0.0 );
+   
+   double hp00  =  dh->getHeightAboveMSL(gp00);   
+   double hp01  =  dh->getHeightAboveMSL(gp01);
+   double hp10  =  dh->getHeightAboveMSL(gp10);
+   double hp11  =  dh->getHeightAboveMSL(gp11);
+   double hpMid =  dh->getHeightAboveMSL(gpMid);
+
+   cout << "\ngp00:   " << gp00
+        << "\np00:    " << p00
+        << "\nhp00:   " << hp00
+      
+        << "\ngp01:   " << gp01
+        << "\np01:    " << p01
+        << "\nhp01:   " << hp01
+      
+        << "\ngp10:   " << gp10
+        << "\np10:    " << p10
+        << "\nhp10:   " << hp10
+
+        << "\ngp11:   " << gp11
+        << "\np11:    " << p11
+        << "\nhp11:   " << hp11
+
+        << "\ngpMid:  " << gpMid
+        << "\nhpMid:  " << hpMid
+
+        << endl;
+
+   delete dh;
+   
+   return 0;
+}
diff --git a/test/src/elevation/ossim-elevation-manager-test.cpp b/test/src/elevation/ossim-elevation-manager-test.cpp
new file mode 100644
index 0000000..254c47e
--- /dev/null
+++ b/test/src/elevation/ossim-elevation-manager-test.cpp
@@ -0,0 +1,55 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  David Burken
+//
+// Description: Test code for ossimElevManger.
+//
+// $Id: ossim-elevation-manager-test.cpp 22751 2014-04-25 17:54:56Z dburken $
+//----------------------------------------------------------------------------
+#include <iostream>
+using namespace std;
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/elevation/ossimElevManager.h>
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+#if 1
+   if (argc != 2)
+   {
+      cout << "usage: " << argv[0] << " <elevationDirectoryToOpen>" << endl;
+      return 0;
+   }
+   
+   ossimFilename dir = argv[1];
+
+   cout << "dir: " << dir << endl;
+   
+   if (ossimElevManager::instance()->loadElevationPath(dir))
+   {
+      cout << "ossimElevManager::openDirectory worked for: " << dir << endl;
+   }
+   else
+   {
+      cout << "ossimElevManager::openDirectory failed for: " << dir << endl;
+   }
+#endif
+#if 1
+   std::vector<ossimFilename> cells;
+   ossimElevManager::instance()->getCellsForBounds( 24.0, -83.0, 28.0, -80.0, cells );
+
+   std::vector<ossimFilename>::const_iterator i = cells.begin();
+   while ( i != cells.end() )
+   {
+      cout << "cell: " << (*i) << endl;
+      ++i;
+   }
+#endif
+   
+   return 0;
+}
diff --git a/test/src/elevation/ossim-image-elevation-test.cpp b/test/src/elevation/ossim-image-elevation-test.cpp
new file mode 100644
index 0000000..479a4b5
--- /dev/null
+++ b/test/src/elevation/ossim-image-elevation-test.cpp
@@ -0,0 +1,99 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-tiled-elevation-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test application for ossimImageElevationDatabase class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-image-elevation-test.cpp 22197 2013-03-12 02:00:55Z dburken $
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/elevation/ossimImageElevationDatabase.h>
+
+#include <iomanip>
+#include <iostream>
+using namespace std;
+
+static void usage()
+{
+   cout << "ossim-image-elevation-test <elev-dir>"
+        << "\nCreates a ossimImageElevationDatabase from elev-dir." << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   int result = 0;
+
+   ossimTimer::instance()->setStartTick();
+
+   // Turn off elevation initialization as we want to use ours.
+   ossimInit::instance()->setElevEnabledFlag(false);
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   cout << std::setiosflags(ios::fixed) << std::setprecision(3)
+        << "elapsed time after initialize: "
+        << ossimTimer::instance()->time_s() << "\n";
+   
+   if (argc == 2)
+   {
+      try // Exceptions can be thrown so 
+      {
+         ossimString elevDir = argv[1];
+         
+         cout << "elev-dir: " << elevDir << "\n";
+         
+         ossimRefPtr<ossimImageElevationDatabase> elevdb = new ossimImageElevationDatabase();
+         if ( elevdb->open(elevDir) )
+         {
+            std::vector<ossimGpt> pts(10);
+            
+            pts[0] = ossimGpt(3.5, -67.5);
+            pts[1] = ossimGpt(7.5, -79.5);
+            pts[2] = ossimGpt(35.694166666666668, 51.598333333333336);
+            pts[3] = ossimGpt(35.821992089329882, 51.437673634967858);
+            pts[4] = ossimGpt(35.843333333333334, 51.373333333333335);
+            pts[5] = ossimGpt(3.25, -67.25);
+            pts[6] = ossimGpt(7.5, -79.5);
+            pts[7] = ossimGpt(35.821992089329882, 51.437673634967858);
+            pts[8] = ossimGpt(7, -80);
+            pts[9] = ossimGpt(7.9, -79.1);
+            std::vector<ossimGpt>::iterator i = pts.begin();
+
+            while ( i != pts.end() )
+            {
+               cout << "getHeightAboveEllipsoid(" << (*i) << "): " 
+                    << elevdb->getHeightAboveEllipsoid( (*i) ) << endl;
+               ++i;
+            }
+         }
+         else
+         {
+            cout << "Could not open: " << elevDir << endl;
+         }
+      }
+      catch( const ossimException& e )
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         result = 1;
+      }
+   }
+   else
+   {
+      usage();
+   }
+   return result;
+}
+
diff --git a/ossim/src/test/ossim-threaded-elevation-test.cpp b/test/src/elevation/ossim-threaded-elevation-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-threaded-elevation-test.cpp
rename to test/src/elevation/ossim-threaded-elevation-test.cpp
diff --git a/test/src/elevation/ossim-tiled-elevation-test.cpp b/test/src/elevation/ossim-tiled-elevation-test.cpp
new file mode 100644
index 0000000..9eddf56
--- /dev/null
+++ b/test/src/elevation/ossim-tiled-elevation-test.cpp
@@ -0,0 +1,208 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-tiled-elevation-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test application for ossimTiledElevationDatabase class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-tiled-elevation-test.cpp 22384 2013-08-30 14:09:08Z dburken $
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimGrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/elevation/ossimTiledElevationDatabase.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+
+#include <iostream>
+using namespace std;
+
+static void usage()
+{
+   cout << "ossim-tiled-elevation-test <elev-dir> <input-image> <output-image>"
+        << "\n\nCreates a ossimTiledElevationDatabase from elev-dir for the bounding box of\ninput-image and writes output-image in tiff format.\n\nThis test the ossimTiledElevationDatabase ability to map a region of interest\nand serve it up as an elevation source.  Since this is testing elevation, the\n\"input-image\" should have a projection affected by elevation.  In other words,\nsome type of sensor model." << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   int result = 0;
+
+   ossimTimer::instance()->setStartTick();
+
+   // Turn off elevation initialization as we want to use ours.
+   ossimInit::instance()->setElevEnabledFlag(false);
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   cout << std::setiosflags(ios::fixed) << std::setprecision(3)
+        << "elapsed time after initialize: "
+        << ossimTimer::instance()->time_s() << "\n";
+   
+   if (argc == 4)
+   {
+      try // Exceptions can be thrown so 
+      {
+         ossimFilename elevDir     = argv[1];
+         ossimFilename inputImage  = argv[2];
+         ossimFilename outputImage = argv[3];
+         
+         cout << "elev-dir: " << elevDir << "\ninput-image: " << inputImage
+              << "\noutput-image: " << outputImage << "\n";
+         
+         ossimTiledElevationDatabase* elevdb = new ossimTiledElevationDatabase();
+         
+         ossimKeywordlist kwl;
+         kwl.setExpandEnvVarsFlag(true);
+         // kwl.add("connection_string", "$(OSSIM_DATA)/elevation/srtm/3arc");
+         kwl.add("connection_string", elevDir.c_str());
+         kwl.add("geoid.type", "geoid1996");
+         kwl.add("max_open_cells", "50");
+         kwl.add("memory_map_cells", "false");
+         kwl.add("min_open_cells", "25");
+         kwl.add("type", "ossimTiledElevationDatabase");
+         
+         if ( elevdb->loadState(kwl, 0) )
+         {
+            ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
+            sic1->setAddResamplerCacheFlag(true);
+            sic1->setAddChainCacheFlag(true);
+
+            // Open:
+            if ( sic1->open( inputImage ) )
+            {
+               // Get the geometry:
+               ossimRefPtr<ossimImageGeometry> geom = sic1->getImageGeometry();
+               
+               // Get the bounding rectangle:
+               ossimGrect boundingRect;
+               std::vector<ossimGpt> corner(4);
+               if ( geom->getCornerGpts(corner[0], corner[1], corner[2], corner[3]) )
+               {
+                  ossimGpt ulGpt(corner[0]);
+                  ossimGpt lrGpt(corner[0]);
+                  cout << "corner[0]: " << corner[0] << endl;
+                  for ( ossim_uint32 i = 1; i < 4; ++i )
+                  {
+                     cout << "corner[" << i << "]: " << corner[i] << endl;
+                     if ( corner[i].lon < ulGpt.lon ) ulGpt.lon = corner[i].lon;
+                     if ( corner[i].lat > ulGpt.lat ) ulGpt.lat = corner[i].lat;
+                     if ( corner[i].lon > lrGpt.lon ) lrGpt.lon = corner[i].lon;
+                     if ( corner[i].lat < lrGpt.lat ) lrGpt.lat = corner[i].lat;
+                  }
+
+                  //---
+                  // Add a padding to ensure no nans on edges:
+                  // Should check for wrap here but just test code.
+                  //---
+                  const ossim_float64 PADDING = 1.0/60.0; // one minute.
+                  ulGpt.lon -= PADDING;
+                  ulGpt.lat += PADDING;
+                  lrGpt.lon += PADDING;
+                  lrGpt.lat -= PADDING;
+                  cout << "ulGpt: " << ulGpt
+                       << "\nlrGpt: " << lrGpt
+                       << endl;
+                  boundingRect = ossimGrect(ulGpt, lrGpt);
+               }
+               else
+               {
+                  boundingRect.makeNan();
+               }
+               
+               if ( boundingRect.isLonLatNan() == false )
+               {
+                  // Create the chain:
+                  sic1->createRenderedChain();
+                  
+                  cout << "boundingRect: " << boundingRect << endl;
+                  elevdb->mapRegion(boundingRect);
+
+                  cout << std::setiosflags(ios::fixed) << std::setprecision(3)
+                       << "elapsed time after mapping elevation: "
+                       << ossimTimer::instance()->time_s() << "\n";
+
+                  cout << "ossimTiledElevationDatabase::getMeanSpacingMeters: "
+                       << elevdb->getMeanSpacingMeters() << "\n";
+                  
+                  cout << "mappedRect: " << elevdb->getBoundingGndRect() << endl;
+                  ossimElevManager::instance()->setDefaultHeightAboveEllipsoid(0.0);
+                  ossimElevManager::instance()->setUseGeoidIfNullFlag(true);
+                  ossimElevManager::instance()->addDatabase(elevdb);
+
+#if 0
+                  // 35.821992089329882, 51.437673634967858
+                  // Height: 1874.649761970292 MSL: 1871.642024320508
+                  ossimGpt pt1(35.821992089329882, 51.437673634967858);
+                  ossimGpt pt2(35.843333333333334, 51.373333333333335);
+                  ossimGpt pt3(35.694166666666668, 51.598333333333336);
+
+                  cout << "getHeightAboveEllipsoid(35.821992089329882, 51.437673634967858): "
+                       << ossimElevManager::instance()->getHeightAboveEllipsoid(pt1)
+                       << "\ngetHeightAboveEllipsoid(35.843333333333334, 51.373333333333335): "
+                       << ossimElevManager::instance()->getHeightAboveEllipsoid(pt2)
+                       << "\ngetHeightAboveEllipsoid(35.694166666666668, 51.598333333333336): "
+                       << ossimElevManager::instance()->getHeightAboveEllipsoid(pt3) << endl;
+#endif
+                  
+                  ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+                  if ( writer->open( outputImage ) )
+                  {
+                     // Add a listener to get percent complete.
+                     ossimStdOutProgress prog(0, true);
+                     writer->addListener(&prog);
+                     
+                     writer->connectMyInputTo(0, sic1.get());
+                     writer->execute();
+                     cout << std::setiosflags(ios::fixed) << std::setprecision(3)
+                          << "elapsed time in seconds: "
+                          << ossimTimer::instance()->time_s() << "\n";
+                  }
+                  else
+                  {
+                    cout << "Could not open: " << outputImage << endl;
+                  }
+               }
+               else
+               {
+                  cout << "bounding box for " << inputImage << " has nans...\n";
+               }
+               
+            } // if ( sic1->open( inputImage) ) )
+            else
+            {
+               cout << "Could not open: " << inputImage << endl;
+            }
+            
+            // ossimDrect boundingRect = elevdb->getBounding
+         }
+
+            
+      }
+      catch( const ossimException& e )
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         result = 1;
+      }
+   }
+   else
+   {
+      usage();
+   }
+   return result;
+}
+
diff --git a/test/src/gsoc/CMakeLists.txt b/test/src/gsoc/CMakeLists.txt
new file mode 100644
index 0000000..11d8165
--- /dev/null
+++ b/test/src/gsoc/CMakeLists.txt
@@ -0,0 +1,3 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+OSSIM_SETUP_APPLICATION(ossim-gsoc1 COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gsoc1.cpp)
diff --git a/ossim/src/test/ossim-gsoc1.cpp b/test/src/gsoc/ossim-gsoc1.cpp
similarity index 100%
rename from ossim/src/test/ossim-gsoc1.cpp
rename to test/src/gsoc/ossim-gsoc1.cpp
diff --git a/test/src/hdf5/CMakeLists.txt b/test/src/hdf5/CMakeLists.txt
new file mode 100644
index 0000000..ce8569f
--- /dev/null
+++ b/test/src/hdf5/CMakeLists.txt
@@ -0,0 +1,2 @@
+OSSIM_SETUP_APPLICATION(ossim-hdf5-info INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-hdf5-info.cpp)
+OSSIM_SETUP_APPLICATION(ossim-hdf5-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-hdf5-test.cpp)
diff --git a/test/src/hdf5/ossim-hdf5-info.cpp b/test/src/hdf5/ossim-hdf5-info.cpp
new file mode 100644
index 0000000..0663a52
--- /dev/null
+++ b/test/src/hdf5/ossim-hdf5-info.cpp
@@ -0,0 +1,55 @@
+/*****************************************************************************
+*                                                                            *
+*                                 O S S I M                                  *
+*            Open Source, Geospatial Image Processing Project                *
+*          License: MIT, see LICENSE at the top-level directory              *
+*                                                                            *
+*****************************************************************************/
+
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimInfoFactoryRegistry.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <iostream>
+#include <memory>
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   
+   try
+   {
+      std::shared_ptr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(argv[1]);
+      if (info)
+      {
+         std::cout<<std::endl;
+         ossimKeywordlist kwl;
+         info->getKeywordlist(kwl);
+         kwl.print(std::cout);
+      }
+      else
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "The info factory failed to create an hdf5 info object. Check that hdf5 is enabled "
+            "via the BUILD_OSSIM_HDF5_SUPPORT environment variable before running cmake, and that "
+            "the hdf5 library is discoverable." << std::endl;
+         returnCode = 1;
+      }
+   }
+   catch(const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      returnCode = 1;
+   }
+   catch( ... )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossim-foo caught unhandled exception!" << std::endl;
+      returnCode = 1;
+   }
+   
+   std::cout<<std::endl;
+   return returnCode;
+}
diff --git a/test/src/hdf5/ossim-hdf5-test.cpp b/test/src/hdf5/ossim-hdf5-test.cpp
new file mode 100644
index 0000000..213837d
--- /dev/null
+++ b/test/src/hdf5/ossim-hdf5-test.cpp
@@ -0,0 +1,56 @@
+/*****************************************************************************
+*                                                                            *
+*                                 O S S I M                                  *
+*            Open Source, Geospatial Image Processing Project                *
+*          License: MIT, see LICENSE at the top-level directory              *
+*                                                                            *
+*****************************************************************************/
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   ossimInit::instance()->initialize(argc, argv);
+
+   try
+   {
+      ossimRefPtr<ossimImageHandler> handler =
+            ossimImageHandlerRegistry::instance()->open(ossimFilename(argv[1]));
+      if (!handler.valid())
+      {
+         throw ossimException("The handler factory failed to create an hdf5 image handler object. Check that hdf5 is enabled "
+            "via the BUILD_OSSIM_HDF5_SUPPORT environment variable before running cmake, and that "
+            "the hdf5 library is discoverable.");
+      }
+
+      cout<<"\n Successfully created an instance of "<<handler->getClassName()<<endl;
+      ossimRefPtr<ossimImageGeometry> geom = handler->getImageGeometry();
+      if (!geom.valid())
+         throw ossimException("Could not create geometry object.");
+
+      geom->print(cout);
+   }
+   catch(const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      returnCode = 1;
+   }
+   catch( ... )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossim-foo caught unhandled exception!" << std::endl;
+      returnCode = 1;
+   }
+   
+   cout<<endl;
+   return returnCode;
+}
diff --git a/test/src/imaging/CMakeLists.txt b/test/src/imaging/CMakeLists.txt
new file mode 100644
index 0000000..f477a3c
--- /dev/null
+++ b/test/src/imaging/CMakeLists.txt
@@ -0,0 +1,26 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+# Remainder to be built but not installed
+OSSIM_SETUP_APPLICATION(ossim-band-lut-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-band-lut-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-get-pixel-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-get-pixel-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-gpkg-writer-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gpkg-writer-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-gsd-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-gsd-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-image-chain-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-chain-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-image-handler-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-handler-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-image-writer-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-writer-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-index-to-rgb-lut-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-index-to-rgb-lut-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-histogram-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-histogram-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-linear-stretch-remapper-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-linear-stretch-remapper-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-loadtile-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-loadtile-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-mask-filter-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-mask-filter-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-piecewise-remapper-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-piecewise-remapper-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-pixel-flipper-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-pixel-flipper-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-range-dome-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-range-dome-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-read-write-consistency-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-read-write-consistency-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-remap-table-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-remap-table-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-shift-filter-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-shift-filter-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-single-image-chain-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-single-image-chain-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-single-image-chain-threaded-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-single-image-chain-threaded-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-threaded-chain-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-threaded-chain-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-kmeans-filter-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-kmeans-filter-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-fft-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-fft-test.cpp)
diff --git a/test/src/imaging/ossim-band-lut-test.cpp b/test/src/imaging/ossim-band-lut-test.cpp
new file mode 100644
index 0000000..a6d0d15
--- /dev/null
+++ b/test/src/imaging/ossim-band-lut-test.cpp
@@ -0,0 +1,199 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description: Test of ossimBandLutFilter.
+//
+// $Id$
+//----------------------------------------------------------------------------
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimConstants.h>  // ossim contants...
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimBandLutFilter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+
+void initKwl1(ossimKeywordlist& kwl)
+{
+   kwl.add("type", "ossimBandLutFilter");
+   kwl.add("scalar_type", "F32");
+
+   // Entry 0 (1,1,1) --> (1,1,0.1) yellow
+   kwl.add("band0.entry0.in", "1");
+   kwl.add("band1.entry0.in", "1");
+   kwl.add("band2.entry0.in", "1");
+   kwl.add("band0.entry0.out", "1.0");
+   kwl.add("band1.entry0.out", "1.0");
+   kwl.add("band2.entry0.out", "0.1");
+
+   // Entry 1 (128,128,128) --> (1,0.5,0.5) red
+   kwl.add("band0.entry1.in", "128");
+   kwl.add("band1.entry1.in", "128");
+   kwl.add("band2.entry1.in", "128");
+   kwl.add("band0.entry1.out", "0.1");
+   kwl.add("band1.entry1.out", "0.1");
+   kwl.add("band2.entry1.out", "1.0");
+
+   // Entry 2 (255,255,255) --> (1,0.1,1.0) violet
+   kwl.add("band0.entry2.in", "255");
+   kwl.add("band1.entry2.in", "255");
+   kwl.add("band2.entry2.in", "255");
+   kwl.add("band0.entry2.out", "1.0");
+   kwl.add("band1.entry2.out", "0.1");
+   kwl.add("band2.entry2.out", "1.0");
+}
+
+void initKwl2(ossimKeywordlist& kwl)
+{
+   kwl.add("type", "ossimBandLutFilter");
+   kwl.add("enabled", "1");
+   kwl.add("mode", "interpolated");
+   kwl.add("scalar_type", "U8");
+   kwl.add("entry0.in", "0.0");
+   kwl.add("entry0.out", "64");
+   kwl.add("entry1.in", "0.45");
+   kwl.add("entry1.out", "64");
+   kwl.add("entry2.in", "0.450001");
+   kwl.add("entry2.out", "128");
+   kwl.add("entry3.in", "0.55");
+   kwl.add("entry3.out", "128");
+   kwl.add("entry4.in", "0.550001");
+   kwl.add("entry4.out", "255");
+   kwl.add("entry5.in", "1.0");
+   kwl.add("entry5.out", "255");
+
+}
+bool writeTile(ossimFilename& fname, ossimImageSource* source)
+{
+   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter;
+   writer->setFilename(fname);
+   writer->connectMyInputTo(0, source);
+   writer->setGeotiffFlag(false);
+   if ( !writer->execute() )
+      return false;
+
+   cout << "Wrote result tile to <"<<fname<<">."<<endl;
+   return true;
+}
+
+bool runTest(const ossimKeywordlist& kwl, ossimFilename& fname, ossimRefPtr<ossimImageSourceFilter>& lutFilter)
+{
+   lutFilter->loadState(kwl);
+   lutFilter->initialize();
+
+   return writeTile(fname, lutFilter.get());
+}
+
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimKeywordlist kwl;
+   initKwl1(kwl);
+
+   // Accept test directory on command line:
+   ossimFilename outputPath;
+   if (argc > 1)
+   {
+      outputPath = argv[1];
+      if (!outputPath.isDir())
+      {
+         cout << "Bad destination directory <"<<outputPath<<"> specified on command line. Ignoring,"
+               << endl;
+         outputPath = "";
+      }
+   }
+
+   // Initialize the input index buffer:
+   ossimRefPtr<ossimImageData> indexTile =
+         ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 3, 256, 256);
+   if(!indexTile.valid())
+      return -1;
+   indexTile->initialize();
+   for (int band=0; band<3; ++band)
+   {
+      ossim_uint8 p = 0;
+      ossim_uint8* bandBuf = indexTile->getUcharBuf(band);
+      ossim_uint32 pixel = 0;
+      for (int y=0; y<256; ++y)
+      {
+         for (int x=0; x<256; ++x)
+            bandBuf[pixel++] = p;
+         p += 1;
+      }
+   }
+   indexTile->validate();
+
+   // Create output image chain:
+   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
+   memSource->setImage(indexTile);
+   memSource->setRect(0, 0, 256, 256);
+
+   ossimRefPtr<ossimImageSourceFilter> lutFilter = new ossimBandLutFilter();
+   lutFilter->connectMyInputTo(memSource.get());
+
+   // Test 1: LITERAL mode
+   cout << "\nTEST 1 -- Running LITERAL mode test...\n"<<endl;
+   kwl.add("mode", "literal");
+   ossimFilename fname ("literal-lut.tif");
+   fname.setPath(outputPath);
+   if (!runTest(kwl, fname, lutFilter))
+      return -1;
+
+   // Test 2: INTERPOLATED mode
+   cout << "\nTEST 2 -- Running INTERPOLATED mode test...\n"<<endl;
+   fname = "interpolated-lut.tif";
+   fname.setPath(outputPath);
+   kwl.add("mode", "interpolated");
+   if (!runTest(kwl, fname, lutFilter))
+      return -1;
+
+   // Test 3: Thresholding test using interpolated mode
+   kwl.clear();
+   initKwl2(kwl);
+
+   // Initialize the input index buffer:
+   ossimRefPtr<ossimImageData> floatTile =
+         ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT32, 1, 256, 256);
+   if(!floatTile.valid())
+      return -1;
+   floatTile->initialize();
+   float dp = 1.0/256.0;
+   float p = 0;
+   float* floatBuf = floatTile->getFloatBuf();
+   ossim_uint32 pixel = 0;
+   for (int y=0; y<256; ++y)
+   {
+      for (int x=0; x<256; ++x)
+         floatBuf[pixel++] = p;
+      p += dp;
+   }
+   floatTile->validate();
+
+   // Create output image chain:
+   ossimRefPtr<ossimMemoryImageSource> memSource2 = new ossimMemoryImageSource;
+   memSource2->setImage(floatTile);
+   memSource2->setRect(0, 0, 256, 256);
+
+//   ossimFilename tempFile ("float_tile.tif");
+//   writeTile(tempFile, memSource2.get());
+
+   ossimRefPtr<ossimImageSourceFilter> lutFilter2 = new ossimBandLutFilter();
+   lutFilter2->connectMyInputTo(memSource2.get());
+
+   cout << "\nTEST 3 -- Running threshold test...\n"<<endl;
+   fname = "thresholded-lut.tif";
+   fname.setPath(outputPath);
+   if (!runTest(kwl, fname, lutFilter2))
+      return -1;
+
+   return 0;
+}
diff --git a/test/src/imaging/ossim-fft-test.cpp b/test/src/imaging/ossim-fft-test.cpp
new file mode 100644
index 0000000..688f132
--- /dev/null
+++ b/test/src/imaging/ossim-fft-test.cpp
@@ -0,0 +1,269 @@
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimFftFilter.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <cmath>
+#include <sstream>
+#include <iostream>
+
+using namespace std;
+
+void usage(char* appName)
+{
+   cout << "\nUsage: "<<appName<<" -i <input-image-name> [-p <int>] [-z]"<<endl;
+   cout << "       "<<appName<<" -x <int> -y <int> \n"<<endl;
+   cout << "Options:\n"<<endl;
+   cout << "  -i  Specifiy an input image in lieu of having one auto-generated."<<endl;
+   cout << "  -p  Chip size to use (in pixels) for computing FFTs."<<endl;
+   cout << "  -z  Skip forward and do only inverse FFT. Presumes input transform image is provided with -i."<<endl;
+   cout << "  -x, -y  Wavelengths in pixels along x and/or y directions for generated image."<<endl;
+   cout << endl;
+}
+
+bool writeFile(ossimImageData* tile, ossimFilename& fname)
+{
+   // Create geometry:
+   ossimIpt image_size (256 , 256);
+   ossimGpt observerGpt (0, 0, 0);
+   ossimDpt gsd (1.0, 1.0); // must be same value in both directions
+   ossimRefPtr<ossimEquDistCylProjection> mapProj = new ossimEquDistCylProjection();
+   mapProj->setOrigin(observerGpt);
+   mapProj->setMetersPerPixel(gsd);
+   ossimDpt degPerPixel (mapProj->getDecimalDegreesPerPixel());
+   mapProj->setElevationLookupFlag(false);
+   ossimGpt ulTiePt (observerGpt);
+   ulTiePt.lat += degPerPixel.lat * (image_size.y-1)/2.0;
+   ulTiePt.lon -= degPerPixel.lon * (image_size.x-1)/2.0;
+   mapProj->setUlTiePoints(ulTiePt);
+   ossimRefPtr<ossimImageGeometry> geometry = new ossimImageGeometry(0, mapProj.get());
+   geometry->setImageSize(image_size);
+
+   // Create output image chain:
+   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
+   memSource->setImage(tile);
+   memSource->setImageGeometry(geometry.get());
+   ossimImageSource* last_source = memSource.get();
+
+//   if (memSource->getOutputScalarType() != OSSIM_UINT8)
+//   {
+//      ossimRefPtr<ossimScalarRemapper> remapper = new ossimScalarRemapper;
+//      remapper->connectMyInputTo(memSource.get());
+//      remapper->setOutputScalarType(OSSIM_UINT8);
+//      last_source = remapper.get();
+//   }
+
+   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
+   writer->connectMyInputTo(0, last_source);
+   writer->setFilename(fname);
+   writer->setGeotiffFlag(false);
+   bool success = writer->execute();
+   if (success)
+   {
+      writer->writeExternalGeometryFile();
+      cout<<"Wrote <"<<fname<<">"<<endl;
+   }
+   else
+      cout<<"Error encountered writing <"<<fname<<">"<<endl;
+
+   return success;
+}
+
+bool synthesizeInput(int dx, int dy, ossimFilename& inputFilename)
+{
+#
+   // Allocate image buffer:
+   ossimIpt image_size (256 , 256);
+   ossimRefPtr<ossimImageData> outImage =
+         ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, image_size.x, image_size.y);
+   outImage->initialize();
+
+   double A = 128; // amplitude
+   outImage->fill(A);
+
+   if ((dx != 0) || (dy != 0))
+   {
+      ossim_uint8* buffer = (ossim_uint8*) outImage->getBuf(0);
+      ossim_uint32 i = 0;
+      double phase = 0; // Chip always starts at 0 phase angle
+      double dpy = 0;
+      if (dy != 0)
+         dpy = 2*M_PI/dy; // phase rate (radians per pixel)
+
+      double dpx = 0;
+      if (dx != 0)
+         dpx = 2*M_PI/dx; // phase rate (radians per pixel)
+
+      // Loops to fill one n x n chip with a single freq (1/lambda) component:
+      for (int y=0; y<image_size.y; y++)
+      {
+         phase = y*dpy;
+         for (int x=0; x<image_size.x; x++)
+         {
+            buffer[i++] = (ossim_uint8) A*cos(phase) + A;
+            phase += dpx;
+         }
+      }
+   }
+
+   return writeFile(outImage.get(), inputFilename);
+}
+
+bool doFFT(ossimFilename& inputFname, int chip_size, bool forward, ossimFilename& fname)
+{
+   ossimRefPtr<ossimImageSource> inputImage =
+         ossimImageHandlerRegistry::instance()->open(inputFname);
+   if (!inputImage.valid())
+   {
+      cout<< "Could not load image <"<<inputFname<<">."<<endl;
+      return -1;
+   }
+
+   ossimRefPtr<ossimImageGeometry> geom = inputImage->getImageGeometry();
+   ossimIpt image_size = geom->getImageSize();
+
+   // Set up FFT filter. Will first try to use the FFTW3 library if plugin was loaded, otherwise
+   // will fallback to use the core newmat implementation:
+   ossimImageSourceFactoryRegistry* isf = ossimImageSourceFactoryRegistry::instance();
+   ossimString name ("ossimFftw3Filter");
+   ossimRefPtr<ossimFftFilter> fft = (ossimFftFilter*) isf->createImageSource(name);
+   if (!fft.valid())
+   {
+      ossimNotify(ossimNotifyLevel_INFO)<<"FFTW3 plugin was not available. Using core ossimFftFilter."<<endl;
+      fft = new ossimFftFilter;
+   }
+   if (forward)
+      fft->setDirectionType(ossimFftFilter::FORWARD);
+   else
+      fft->setDirectionType(ossimFftFilter::INVERSE);
+   fft->connectMyInputTo(inputImage.get());
+   ossimImageSource* last_source = fft.get();
+
+   // Allocate output image buffer:
+   ossimRefPtr<ossimImageData> outImage;
+   ossimImageDataFactory* idf = ossimImageDataFactory::instance();
+   if (forward)
+      outImage = idf->create(0, fft->getOutputScalarType(), 3, image_size.x, image_size.y);
+   else
+      outImage = idf->create(0, fft->getOutputScalarType(), 1, image_size.x, image_size.y);
+
+   outImage->initialize();
+   outImage->setNullPix(0.0);
+
+   // Loop over input data chips (n x n):
+   if (chip_size == 0)
+      chip_size = 256;
+   for (int y=0; y<image_size.y; y+=chip_size)
+   {
+      for (int x=0; x<image_size.x; x+=chip_size)
+      {
+         ossimIrect chipRect (x, y, x+chip_size-1, y+chip_size-1);
+         ossimRefPtr<ossimImageData> fft_chip = fft->getTile(chipRect);
+         if (forward)
+         {
+            outImage->loadBand(fft_chip->getBuf(0), chipRect, 0);
+            outImage->loadBand(fft_chip->getBuf(1), chipRect, 1);
+         }
+         else
+         {
+            outImage->loadTile(fft_chip.get());
+         }
+      }
+   }
+
+   return writeFile(outImage.get(), fname);
+}
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+   ossimString tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+
+   if ( ap.read("-h") || ap.read("--help") || (argc < 2))
+   {
+      usage(ap[0]);
+      return 0;
+   }
+
+   bool generate_image = true;
+   ossimFilename inputFilename;
+   if ( ap.read("-i", stringParam))
+   {
+      inputFilename = tempString;
+      generate_image = false;
+   }
+
+   int dx = 0;
+   if ( ap.read("-x", stringParam))
+      dx = tempString.toInt();
+
+   int dy = 0;
+   if ( ap.read("-y", stringParam))
+      dy = tempString.toInt();
+
+   int chip_size = 256;
+   if ( ap.read("-p", stringParam))
+      chip_size = tempString.toInt();
+
+   bool inverse_only = false;
+   if ( ap.read("-z"))
+      inverse_only = true;
+
+   ostringstream f0, f1, f2;
+   ossimFilename fftFilename, invFilename;
+
+   if (generate_image)
+   {
+      f0 << "gen-" << dx << "-" << dy << ".tif";
+      inputFilename = f0.str();
+   }
+
+   f1 << inputFilename.fileNoExtension() << "-FFT.tif";
+   fftFilename = f1.str();
+   f2 << inputFilename.fileNoExtension() << "-INV.tif";
+   invFilename = f2.str();
+
+   ap.reportRemainingOptionsAsUnrecognized();
+   if ( ap.errors() )
+   {
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      return -1;
+   }
+
+   if (generate_image && !synthesizeInput(dx, dy, inputFilename))
+   {
+      cout<< "Could not load input image <"<<inputFilename<<">."<<endl;
+      return -1;
+   }
+
+   // Do forward FFT:
+   if (!inverse_only)
+   {
+      if (!doFFT(inputFilename, chip_size, true, fftFilename))
+         return -1;
+   }
+   else
+      fftFilename = inputFilename;
+
+   if (!doFFT(fftFilename, chip_size, false, invFilename))
+      return -1;
+
+   return 0;
+}
diff --git a/test/src/imaging/ossim-get-pixel-test.cpp b/test/src/imaging/ossim-get-pixel-test.cpp
new file mode 100644
index 0000000..88a6583
--- /dev/null
+++ b/test/src/imaging/ossim-get-pixel-test.cpp
@@ -0,0 +1,218 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: ossim-get-pixel-test.cpp
+//
+// Test code to spit out a pixel value at a given band, line, sample.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-get-pixel-test.cpp 22073 2013-01-04 21:27:39Z dburken $
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+
+#include <iostream>
+#include <vector>
+using namespace std;
+
+static void usage(ossimArgumentParser& ap)
+{
+   // Add global usage options.
+   ossimInit::instance()->addOptions(ap);
+   
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   
+   // Set app name.
+   au->setApplicationName(ap.getApplicationName());
+   
+   au->setDescription(ossimString("Returns pixel value at the given sample and line.\nNotes:\nBand, line and sample are zero based.\nUse an \"a\" for <band> if you want to see all bands.\n"));
+   
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [options] <imagefile> <band> <sample> <line>\n";
+   au->setCommandLineUsage(usageString);
+   
+   au->addCommandLineOption("-e","<entry_index> Entry index to get pixel from.  Only significant with multi entry data only.");
+
+   au->addCommandLineOption("--reader-prop","Passes a name=value pair to the reader(s) for setting it's property.  Any number of these can appear on the line.");
+   
+   // Write usage.
+   au->write(ossimNotify(ossimNotifyLevel_INFO));
+}
+
+struct readerProp
+{
+   ossimString name;
+   ossimString value;
+};
+
+/**
+ * @brief Adds band to bandList returning true on success, false on range error
+ * with error message to standard out.
+ */
+static bool addBand( ossim_uint32 band,
+                     ossim_uint32 bandCount,
+                     vector<ossim_uint32>& bandList );
+
+int main(int argc, char *argv[])
+{
+   // Initialize:
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   // Argument check:
+   if ( (ap.argc() < 5) || ap.read("-h") || ap.read("--help") )
+   {
+      usage(ap);
+      return 1;
+   }
+
+   // Read options:
+   
+   // For argument parser reads.
+   ossimString ts1;
+   ossimArgumentParser::ossimParameter sp1(ts1);
+
+   // Entry index:
+   ossim_uint32 entryIndex = 0;
+   if ( ap.read("-e", sp1) )
+   {
+      entryIndex = ts1.toUInt32();
+   }
+
+   // Set the reader properties if any.
+   std::vector<readerProp> readerProps;
+   while(ap.read("--reader-prop", sp1))
+   {
+      std::vector<ossimString> splitArray;
+      ts1.split(splitArray, "=");
+      if(splitArray.size() == 2)
+      {
+         readerProp prop;
+         prop.name = splitArray[0];
+         prop.value = splitArray[1];
+         readerProps.push_back(prop);
+      }
+   }
+
+   ap.reportRemainingOptionsAsUnrecognized();
+
+   // Check the input file:
+   ossimFilename imageFile = argv[1];
+   if ( !imageFile.exists() )
+   {
+      usage(ap);
+      return 1;
+   }
+
+   // Open up an image handler.
+   ossimRefPtr<ossimImageHandler> ih
+      = (ossimImageHandler*)ossimImageHandlerRegistry::instance()->open( imageFile );
+   if ( ih.valid() == false )
+   {
+      cerr << "Could not open: " << imageFile << endl;
+      return 1;
+   }
+
+   if ( entryIndex )
+   {
+      if ( ih->setCurrentEntry( entryIndex ) == false )
+      {
+         cerr << "Invalid entry: " << entryIndex << endl;
+         return 1;
+      }
+   }
+   
+   // Set the reader properties if any.
+   if ( readerProps.size() )
+   {
+      std::vector<readerProp>::const_iterator i = readerProps.begin();
+      while( i != readerProps.end() )
+      {
+         ossimRefPtr<ossimProperty> prop = new ossimStringProperty( (*i).name, (*i).value );
+         ih->setProperty(prop);
+         ++i;
+      }
+   }
+
+   vector<ossim_uint32> bandList;
+   ossimString bandString = argv[2];
+
+   const ossim_uint32 BANDS = ih->getNumberOfOutputBands();
+   if ( bandString.downcase() == "a" )
+   {
+      for ( ossim_uint32 band = 0; band < BANDS; ++band)
+      {
+         if ( addBand( band, BANDS, bandList ) == false )
+         {
+            return 1;
+         }
+      }
+   }
+   else
+   {
+      ossim_int32 band = bandString.toUInt32();
+      if ( addBand( band, BANDS, bandList ) == false )
+      {
+         return 1;
+      }
+   }
+      
+   ossimIpt pt;
+   pt.x = ossimString::toInt32(argv[3]);
+   pt.y = ossimString::toInt32(argv[4]);
+   
+   ossimIrect rect(pt.x, pt.y, pt.x+1, pt.y+1);
+   ossimRefPtr<ossimImageData> id = ih->getTile(rect, 0);
+
+   if ( id.valid() )
+   {
+      cout << "image_file: " << imageFile
+           << "\nsample:     " << pt.x
+           << "\nline:       " << pt.y;
+
+      vector<ossim_uint32>::const_iterator i = bandList.begin();
+      while ( i != bandList.end() )
+      {
+         cout << "\nvalue[" << (*i) << "]: " << id->getPix( pt, (*i) );
+         ++i;
+      }
+      cout << endl;
+   }
+   else
+   {
+      cerr << "getTile request failed!" << endl;
+      return 1;
+   }
+   
+   return 0;
+}
+
+bool addBand( ossim_uint32 band, ossim_uint32 bandCount, vector<ossim_uint32>& bandList )
+{
+   bool result = true;
+   if ( band < bandCount )
+   {
+      bandList.push_back(band);
+   }
+   else
+   {
+      cerr << "Band number " << band << " is out of range!" << endl;
+      result = false;
+   }
+   return result;
+}
diff --git a/test/src/imaging/ossim-gpkg-writer-test.cpp b/test/src/imaging/ossim-gpkg-writer-test.cpp
new file mode 100644
index 0000000..8089c02
--- /dev/null
+++ b/test/src/imaging/ossim-gpkg-writer-test.cpp
@@ -0,0 +1,232 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// File: ossim-gpkg-writer-test.cpp
+//
+// Description: Test class for ossimGpkgWriter.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/imaging/ossimGpkgWriterInterface.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimU8ImageData.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+
+#include <iomanip>
+#include <iostream>
+#include <string>
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+   int status = 0;
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc == 2 )
+   {
+      ossimFilename outputFile = argv[1];
+      
+      ossimString writerClass = "ossimGpkgWriter";
+      ossimRefPtr<ossimImageFileWriter> writer =
+         ossimImageWriterFactoryRegistry::instance()->createWriter( writerClass );
+
+      if ( writer.valid() )
+      {
+         ossimGpkgWriterInterface* gpkgWriter =
+            dynamic_cast<ossimGpkgWriterInterface*>( writer.get() );
+
+         if ( gpkgWriter )
+         {
+            ossimKeywordlist kwl;
+            std::string key;
+            std::string value;
+            
+            key = "zoom_levels";
+            // value = "(0,1,2,3,4,5,6,7,8,9,10,11)";
+            value = "(2,3,4,5)";
+            kwl.addPair( key, value );
+            
+            key = "epsg";
+            value = "3857";
+            kwl.addPair( key, value );
+            
+            key = "filename";
+            value = outputFile.string();
+            kwl.addPair( key, value );
+
+            if ( gpkgWriter->openFile( kwl ) )
+            {
+               gpkgWriter->beginTileProcessing();
+               
+               // Write some tiles:
+               ossimRefPtr<ossimImageData> id = new ossimU8ImageData(0, 3, 256, 256);
+               id->initialize();
+               id->createTestTile();
+
+               // Valid tile:
+               if ( gpkgWriter->writeTile( id, 2, 0, 0 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 2, 0, 0 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 2, 0, 0 failed..." << endl;
+               }
+               
+               if ( gpkgWriter->writeTile( id, 2, 0, 1 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 2, 0, 1 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 2, 0, 1 failed..." << endl;
+               }
+               
+               if ( gpkgWriter->writeTile( id, 2, 1, 0 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 2, 1, 0 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 2, 1, 0 failed..." << endl;
+               }
+
+               if ( gpkgWriter->writeTile( id, 2, 1, 1 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 2, 1, 1 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 2, 1, 1 failed..." << endl;
+               }
+
+               if ( gpkgWriter->writeTile( id, 3, 0, 0 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 3, 0, 0 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 3, 0, 0 failed..." << endl;
+               }
+               
+               if ( gpkgWriter->writeTile( id, 4, 0, 0 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 4, 0, 0 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 4, 0, 0 failed..." << endl;
+               }
+
+               if ( gpkgWriter->writeTile( id, 5, 0, 0 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 5, 0, 0 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 5, 0, 0 failed..." << endl;
+               }
+               // Invalid level
+               if ( gpkgWriter->writeTile( id, 20, 0, 0 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 20, 0, 0 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 20, 0, 0 failed..." << endl;
+               }
+
+               // Invalid row
+               if ( gpkgWriter->writeTile( id, 4, 10000, 0 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 4, 10000, 0success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 4, 10000, 0 failed..." << endl;
+               }
+
+               // Invalid col
+               if ( gpkgWriter->writeTile( id, 4, 0, 10000 ) ) // tile, level, row, col
+               {
+                  cout << "writeTile id, 4, 0, 10000 success..." << endl;
+               }
+               else
+               {
+                  cout << "writeTile id, 4, 0, 10000 failed..." << endl;
+               }
+
+               gpkgWriter->finalizeTileProcessing();
+
+               // Close this writer and test append mode:
+               writer->close();
+               gpkgWriter = 0;
+               writer = 0; // ref ptr
+
+               cout << "Testing append mode..." << endl;
+               
+               writer = ossimImageWriterFactoryRegistry::instance()->createWriter( writerClass );
+               if ( writer.valid() )
+               {
+                  ossimGpkgWriterInterface* gpkgWriter =
+                     dynamic_cast<ossimGpkgWriterInterface*>( writer.get() );
+                  
+                  if ( gpkgWriter )
+                  {
+                     // Add append to options:
+                     key = "append";
+                     value = "true";
+                     kwl.addPair( key, value );
+
+                     if ( gpkgWriter->openFile( kwl ) )
+                     {
+                        gpkgWriter->beginTileProcessing();
+                        
+                        if ( gpkgWriter->writeTile( id, 3, 0, 1 ) ) // tile, level, row, col
+                        {
+                           cout << "writeTile id, 3, 0, 1 success..." << endl;
+                        }
+                        else
+                        {
+                           cout << "writeTile id, 3, 0, 1 failed..." << endl;
+                        }
+                     }
+
+                     gpkgWriter->finalizeTileProcessing();
+                     
+                     writer->close();
+                     gpkgWriter = 0;
+                  }
+                  writer = 0;
+               }
+            }
+         }
+         else
+         {
+            cerr << "Could not cast!" << endl;
+         }
+         
+         writer = 0;
+      }
+      else // Matches: 
+      {
+         cerr << "ossimImageWriterFactoryRegistry::instance()->createWriter( ossimGpkgWriter ) failed!" << endl;
+      }
+   }
+   else // Matches: if (argc == 2 ){ ... }
+   {
+      cout << argv[0] << " <output_file>"
+           << "\n\nGeoPackage writer test code.\n" << endl;
+   }
+
+   return status;
+}
diff --git a/test/src/imaging/ossim-gsd-test.cpp b/test/src/imaging/ossim-gsd-test.cpp
new file mode 100644
index 0000000..1eba9cb
--- /dev/null
+++ b/test/src/imaging/ossim-gsd-test.cpp
@@ -0,0 +1,118 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-gsd-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test to output gsd from image geometry and then compute the gsd from center
+// latitude of the image if the projecion is geographic, i.e. scale is in
+// decimal degrees.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-gsd-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+
+#include <iostream>
+using namespace std;
+
+static void usage()
+{
+   cout << "ossim-gsd-test <imagefile>"
+        << "\nThis will compute meters per pixel from the center latitude if the\n"
+        << "underlying projection scale units are in degrees." << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 2)
+   {
+      usage();
+      return 0;
+   }
+
+   ossimFilename imageFile = argv[argc - 1];
+
+   if ( !imageFile.exists() )
+   {
+      usage();
+      return 1;
+   }
+
+   // Open up an image handler.
+   ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(
+      ossimFilename(argv[argc - 1]));
+   if ( ih.valid() == false )
+   {
+      cerr << "Could not open: " << imageFile << endl;
+      return 1;
+   }
+   
+   cout << "image_file:  " << imageFile << "\n";
+   
+   ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+   if ( geom.valid() )
+   {
+      ossimDpt imageGeomGsd = geom->getMetersPerPixel();
+      cout << "image_geometry_meters_per_pixel: " << imageGeomGsd << "\n";
+
+      ossimDrect rect = ih->getImageRectangle(0);
+      ossimKeywordlist kwl;
+      geom->saveState(kwl);
+      ossimDpt ipt = rect.midPoint();
+      cout << "center_image_point: " << ipt << "\n";
+      ossimGpt wpt;
+      geom->localToWorld(ipt, wpt);
+      cout << "center_world_point: " << wpt << "\n";
+
+      ossimDpt scale;
+      bool scaleDegrees = false;
+      const char* lookup = kwl.find("projection.pixel_scale_xy");
+      if ( lookup )
+      {
+         ossimString s = lookup;
+         scale.toPoint(s);
+         cout << "projection.pixel_scale_xy: " << scale << "\n";
+         const char* lookup = kwl.find("projection.pixel_scale_units");
+         if ( lookup )
+         {
+            s = lookup;
+            scaleDegrees = (s == "degrees");
+            cout << "projection.scale_units: " << s << "\n";
+         }
+
+         if ( scaleDegrees )
+         {
+            ossimDpt mpd = wpt.metersPerDegree();
+            cout << "meters_per_degree_for_center: " << mpd << "\n";
+            ossimDpt computeGsd;
+            computeGsd.x = mpd.x * scale.x;
+            computeGsd.y = mpd.y * scale.y;
+            cout << "computed_meters_per_pixel_for_center_lat: " << computeGsd << "\n";
+         }
+      }
+   }
+   else
+   {
+      cout << "null geometry!\n";
+   }
+
+   cout << endl;
+   return 0;
+}
+
diff --git a/test/src/imaging/ossim-histogram-test.cpp b/test/src/imaging/ossim-histogram-test.cpp
new file mode 100644
index 0000000..7a77919
--- /dev/null
+++ b/test/src/imaging/ossim-histogram-test.cpp
@@ -0,0 +1,111 @@
+//---
+// License: MIT
+//
+// File: ossim-quickbird-metadata-test.cpp
+//
+// Description: Test code for ossim histogram stuff.
+//---
+// $Id$
+
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimMultiResLevelHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/init/ossimInit.h>
+#include <cmath>
+#include <iostream>
+
+using namespace std;
+
+static void usage()
+{
+   cout << "ossim-histogram-test <ossim_histogram_file>" << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc == 2)
+   {
+      try
+      {
+         ossimFilename file = argv[argc - 1];
+         if ( file.exists() )
+         {
+            ossimRefPtr<ossimMultiResLevelHistogram> mrh = new ossimMultiResLevelHistogram();
+            if ( mrh.valid() )
+            {
+               if ( mrh->importHistogram(file) == true )
+               {
+                  cout << "opened histogram: " << file << "\n";
+                  
+                  ossimRefPtr<ossimMultiBandHistogram> mbh = mrh->getMultiBandHistogram(0);
+                  if ( mbh.valid() )
+                  {
+                     const ossim_uint32 BANDS = mbh->getNumberOfBands();
+                     cout << "bands: " << BANDS << "\n";
+                     for ( ossim_uint32 band = 0; band < BANDS; ++band)
+                     {
+                        ossimRefPtr<ossimHistogram> h = mbh->getHistogram(band);
+                        if ( h.valid() )
+                        {
+                           ossim_uint32 min_idx = std::floor(h->GetMinVal());
+                           ossim_uint32 max_idx = std::floor(h->GetMaxVal());
+                           
+                           cout << "band:            " << band << "\n"
+                                << "buckets:         " << h->GetRes() << "\n"
+                                << "min_val:         " << h->GetMinVal() << "\n"
+                                << "max_val:         " << h->GetMaxVal() << "\n"
+                                << "max_count:       " << h->GetMaxCount() << "\n"
+                                << "min_val_count:   " << h->GetCounts()[min_idx] << "\n"
+                                << "max_val_count:   " << h->GetCounts()[max_idx]  << "\n"
+                                << "vmin:            " << h->GetRangeMin() << "\n"
+                                << "vmax:            " << h->GetRangeMax() << "\n"
+                                << "low_clip(0%):    " << std::floor( h->LowClipVal(0.0) ) << "\n"
+                                << "high_clip(0%):   " << std::floor( h->HighClipVal(0.0) ) << "\n"
+                                << "low_clip(0.1%):  " << std::floor( h->LowClipVal(0.001) ) << "\n"
+                                << "high_clip(0.1%): " << std::floor( h->HighClipVal(0.001) ) << "\n"
+                                << "low_clip(1%):    " << std::floor( h->LowClipVal(0.01) ) << "\n"
+                                << "high_clip(1%):   " << std::floor( h->HighClipVal(0.01) ) << "\n\n";
+                       }
+                     }
+                     cout << endl;
+                  }
+               }
+            }
+            else
+            {
+               cout << "could not open: " << file << endl;
+            }
+         }
+         else
+         {
+            usage();
+            returnCode = 1;
+         }
+      }
+      catch(const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         returnCode = 1;
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossim-foo caught unhandled exception!" << std::endl;
+         returnCode = 1;
+      }
+   }
+   else
+   {
+      usage();
+   }
+   
+   return returnCode;
+}
diff --git a/test/src/imaging/ossim-image-chain-test.cpp b/test/src/imaging/ossim-image-chain-test.cpp
new file mode 100644
index 0000000..8907fb5
--- /dev/null
+++ b/test/src/imaging/ossim-image-chain-test.cpp
@@ -0,0 +1,80 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-image-chain-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test application for ossimImageChain class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-image-chain-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageChain.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+
+#include <iostream>
+using namespace std;
+
+static void usage()
+{
+   cout << "ossim-image-chain-test <image>" << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   int result = 0;
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc == 2)
+   {
+      try // In case exceptions is thrown. 
+      {
+         ossimFilename image = argv[1];
+         ossimRefPtr<ossimImageHandler> ih = ossimImageHandlerRegistry::instance()->open(image);
+         if ( ih.valid() )
+         {
+            cout << "Opened image: " << image << endl;
+
+            ossimRefPtr<ossimImageChain> ic = new ossimImageChain();
+            ic->addLast( ih.get() );
+            cout << "Added to image chain via ossimImageChain::addLast" << endl;
+
+            cout << "Calling ossimImageChain::removeChild" << endl;
+
+            if ( ic->removeChild( ih.get() ) )
+            {
+               cout << "Removed from chain..." << endl;
+               ih = 0;
+            }
+
+            ic = 0;
+         }
+         else
+         {
+            cout << "Could not open: " << image << endl;
+            result = 1;
+         }
+      }
+      catch( const ossimException& e )
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         result = 1;
+      }
+   }
+   else
+   {
+      usage();
+   }
+
+   return result;
+}
diff --git a/ossim/src/test/ossim-image-handler-test.cpp b/test/src/imaging/ossim-image-handler-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-image-handler-test.cpp
rename to test/src/imaging/ossim-image-handler-test.cpp
diff --git a/ossim/src/test/ossim-image-writer-test.cpp b/test/src/imaging/ossim-image-writer-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-image-writer-test.cpp
rename to test/src/imaging/ossim-image-writer-test.cpp
diff --git a/test/src/imaging/ossim-index-to-rgb-lut-test.cpp b/test/src/imaging/ossim-index-to-rgb-lut-test.cpp
new file mode 100644
index 0000000..43e46e7
--- /dev/null
+++ b/test/src/imaging/ossim-index-to-rgb-lut-test.cpp
@@ -0,0 +1,196 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description: Test of ossimIndexToRgbLutFilter.
+//
+// $Id: ossim-index-to-rgb-lut-test.cpp 23068 2015-01-07 23:08:29Z okramer $
+//----------------------------------------------------------------------------
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimConstants.h>  // ossim contants...
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+
+static const std::string kwl_literal =
+      "type: ossimIndexToRgbLutFilter \n"
+      "mode: literal  \n"
+      "entry0.index: 0 \n"
+      "entry0.color: 1 2 3 \n"
+      "entry1.index: 1.0 \n"
+      "entry1.color: 255 1 1 \n"
+      "entry2.index: 2.0 \n"
+      "entry2.color: 1 255 1 \n";
+
+static const std::string kwl_vertices =
+      "type: ossimIndexToRgbLutFilter \n"
+      "mode: vertices  \n"
+      "entry0.index: 0.5 \n"
+      "entry0.color: 1 2 3 \n"
+      "entry1.index: 127.5 \n"
+      "entry1.color: 255 1 1 \n"
+      "entry2.index: 250.0 \n"
+      "entry2.color: 1 255 1 \n";
+
+static const std::string kwl_regular =
+      "type: ossimIndexToRgbLutFilter \n"
+      "mode: regular \n"
+      "entry0: 1 1 255 \n"
+      "entry1: 1 255 1 \n"
+      "entry2: 255 1 1 \n"
+      "max_value:  250 \n"
+      "min_value:  1 \n";
+
+static const std::string kwl_regular2 =
+      "type: ossimIndexToRgbLutFilter \n"
+      "mode: regular \n"
+      "entry0.r: 1 \n"
+      "entry0.g: 1 \n"
+      "entry0.b: 255 \n"
+      "entry1.r: 1 \n"
+      "entry1.g: 255 \n"
+      "entry1.b: 1 \n"
+      "entry2.r: 255 \n"
+      "entry2.g: 1 \n"
+      "entry2.b: 1 \n"
+      "max_value:  250 \n"
+      "min_value:  1 \n";
+
+static const std::string kwl_regnorm =
+      "type: ossimIndexToRgbLutFilter \n"
+      "mode: regular \n"
+      "entry0: 1 1 255 \n"
+      "entry1: 1 255 1 \n"
+      "entry2: 255 1 1 \n"
+      "max_value:  1.0 \n"
+      "min_value:  0 \n";
+
+
+bool runTest(const std::string& kwlString, ossimRefPtr<ossimImageSourceFilter>& lutFilter)
+{
+   ossimKeywordlist kwl;
+   kwl.parseString(kwlString);
+   if (!lutFilter->loadState(kwl))
+   {
+      cout << "ERROR: bad state returned from ossimIndexToRgbLutFilter::loadState()" << endl;
+      return false;
+   }
+
+   lutFilter->initialize();
+   ossimIrect rect (lutFilter->getBoundingRect());
+   ossimRefPtr<ossimImageData> rgbBuffer = lutFilter->getTile(rect);
+
+   ossim_uint8* outBuf[3];
+   outBuf[0] = (ossim_uint8*)(rgbBuffer->getBuf(0));
+   outBuf[1] = (ossim_uint8*)(rgbBuffer->getBuf(1));
+   outBuf[2] = (ossim_uint8*)(rgbBuffer->getBuf(2));
+   for (int x=0; x<256; ++x)
+   {
+      cout << "[" <<  x  << "] : " << (int)outBuf[0][x] << "  " << (int)outBuf[1][x] << "  "
+            << (int)outBuf[2][x] << endl;
+   }
+   cout << endl;
+
+   return true;
+}
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   // For batch testing, permit assigning output dir for test tiff:
+   ossimFilename tiffOutFile ("./test-tif.tif");
+   if (argc > 1)
+      tiffOutFile = argv[1];
+
+   // Initialize the input index buffer:
+   ossimRefPtr<ossimImageData> indexBuffer =
+         ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, 256, 1);
+   if(!indexBuffer.valid())
+      return -1;
+   indexBuffer->initialize();
+   for (int x=0; x<256; ++x)
+      indexBuffer->setValue(x, 0, x);
+   indexBuffer->validate();
+
+   // Create output image chain:
+   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
+   memSource->setImage(indexBuffer);
+   memSource->setRect(0, 0, 256, 1);
+   ossimRefPtr<ossimImageSourceFilter> lutFilter = new ossimIndexToRgbLutFilter();
+   lutFilter->connectMyInputTo(memSource.get());
+   bool success;
+
+   // Test 1: LITERAL mode
+   cout << "\nTEST 1 -- Running LITERAL mode test...\n"<<endl;
+   if (!runTest(kwl_literal, lutFilter))
+      return -1;
+
+   // Test 2: VERTICES mode
+   cout << "\nTEST 2 -- Running VERTICES mode test...\n"<<endl;
+   if (!runTest(kwl_vertices, lutFilter))
+      return -1;
+
+   // Test 3: REGULAR mode, compact-format
+   cout << "\nTEST 3 -- Running REGULAR mode, compact-format test...\n"<<endl;
+   if (!runTest(kwl_regular, lutFilter))
+      return -1;
+
+   // Test 4: REGULAR mode, bloated-format
+   cout << "\nTEST 4 -- Running REGULAR mode, bloated-format test...\n"<<endl;
+   if (!runTest(kwl_regular2, lutFilter))
+      return -1;
+
+   // Test 5: Heat map tile output using type double input index:
+   cout << "\nTEST 5 --Output of heatmap tile from floating point normalized index data...\n"<<endl;
+   indexBuffer = ossimImageDataFactory::instance()->create(0, OSSIM_FLOAT64, 1, 512, 512);
+   indexBuffer->initialize();
+   for (int y=0; y<512; ++y)
+   {
+      for (int x=0; x<512; ++x)
+      {
+         double distance = sqrt((double) ((x-256)*(x-256) + (y-256)*(y-256)));
+         double d = (256.0 - distance) / 256.0;
+         if (d <= 0)
+            d = 0.0;
+         indexBuffer->setValue(x, y, d);
+      }
+   }
+   indexBuffer->validate();
+
+   ossimRefPtr<ossimMemoryImageSource> idxSource = new ossimMemoryImageSource;
+   idxSource->setImage(indexBuffer);
+
+   ossimRefPtr<ossimImageSourceFilter> lut2Filter = new ossimIndexToRgbLutFilter();
+   lut2Filter->connectMyInputTo(idxSource.get());
+   ossimKeywordlist kwl;
+   kwl.parseString(kwl_regnorm);
+   lut2Filter->loadState(kwl);
+   lut2Filter->initialize();
+   ossimIrect rect (lut2Filter->getBoundingRect());
+
+   ossimRefPtr<ossimImageData> rgbBuffer = lut2Filter->getTile(rect);
+
+   ossimRefPtr<ossimMemoryImageSource> rgbSource = new ossimMemoryImageSource;
+   rgbSource->setImage(rgbBuffer);
+   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter;
+   writer->setFilename(tiffOutFile);
+   writer->connectMyInputTo(0, rgbSource.get());
+   writer->setAreaOfInterest(rect);
+   writer->setGeotiffFlag(false);
+   success = writer->execute();
+   if (success)
+      cout << "Heat map image successfully written."<<endl;
+   else
+      return -1;
+
+   return 0;
+}
diff --git a/test/src/imaging/ossim-kmeans-filter-test.cpp b/test/src/imaging/ossim-kmeans-filter-test.cpp
new file mode 100644
index 0000000..64bb28c
--- /dev/null
+++ b/test/src/imaging/ossim-kmeans-filter-test.cpp
@@ -0,0 +1,195 @@
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimImageDataFactory.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimMemoryImageSource.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimKMeansFilter.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <cmath>
+#include <sstream>
+#include <iostream>
+
+using namespace std;
+
+void usage(char* appName)
+{
+   cout << "\nUsage: "<<appName<<" [-i <filename>] [--remap] [<output_filename>]\n"<<endl;
+}
+
+ossimRefPtr<ossimImageSource> synthesizeInput()
+{
+   // Create geometry:
+   ossimGpt observerGpt (0, 0, 0);
+   ossimDpt gsd (1.0, 1.0); // must be same value in both directions
+   ossimRefPtr<ossimEquDistCylProjection> mapProj = new ossimEquDistCylProjection();
+   mapProj->setOrigin(observerGpt);
+   mapProj->setMetersPerPixel(gsd);
+   ossimDpt degPerPixel (mapProj->getDecimalDegreesPerPixel());
+   mapProj->setElevationLookupFlag(false);
+   ossimGpt ulTiePt (observerGpt);
+   ossimIpt image_size (512 , 512);
+   ulTiePt.lat += degPerPixel.lat * (image_size.y-1)/2.0;
+   ulTiePt.lon -= degPerPixel.lon * (image_size.x-1)/2.0;
+   mapProj->setUlTiePoints(ulTiePt);
+   ossimRefPtr<ossimImageGeometry> geometry = new ossimImageGeometry(0, mapProj.get());
+   geometry->setImageSize(image_size);
+   ossim_uint32 tile_size = 256;
+   ossim_uint8 mean1 = 20;
+   ossim_uint8 mean2 = 60;
+   ossim_uint8 mean3 = 100;
+
+   // Generate data:
+   ossimRefPtr<ossimImageData> outTile =
+         ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, tile_size, tile_size);
+   outTile->initialize();
+   ossim_uint8* buf = outTile->getUcharBuf();
+   srand (time(NULL));
+   ossim_uint32 buf_size = tile_size*tile_size;
+   ossim_uint32 buf_offset = buf_size / 4;
+   double noiseAmplitude1 = 15;
+   ossim_uint32 i=0;
+   for (; i<buf_offset; ++i)
+      buf[i] = mean1 + round(2.0* noiseAmplitude1 * ((float)rand()/(float)RAND_MAX - 0.5));
+   buf_offset += buf_size / 4;
+   for (;i<buf_offset; ++i)
+      buf[i] = mean2 + round(2.0* noiseAmplitude1 * ((float)rand()/(float)RAND_MAX - 0.5));
+   buf_offset += buf_size / 4;
+   for (;i<buf_offset; ++i)
+      buf[i] = mean3 + round(2.0* noiseAmplitude1 * ((float)rand()/(float)RAND_MAX - 0.5));
+
+   // Set the destination image size:
+   ossimRefPtr<ossimImageData> outImage =
+         ossimImageDataFactory::instance()->create(0, OSSIM_UINT8, 1, image_size.x, image_size.y);
+   if(outImage.valid())
+      outImage->initialize();
+   else
+   {
+      cout<<"Error encountered allocating tile for input data generation."<<endl;
+      return 0;
+   }
+
+   // Fill the buffer with test image pattern. Start with fill:
+   outImage->fill(0);
+
+   ossimIpt tile_origin(0,0);
+   for (tile_origin.y=0; tile_origin.y<image_size.y; tile_origin.y+=tile_size)
+   {
+      for (tile_origin.x=0; tile_origin.x<image_size.x; tile_origin.x+=tile_size)
+      {
+         outTile->setOrigin(tile_origin);
+         outImage->loadTile(outTile.get());
+      }
+   }
+
+   // Create output image chain:
+   ossimRefPtr<ossimMemoryImageSource> memSource = new ossimMemoryImageSource;
+   memSource->setImage(outImage);
+   memSource->setImageGeometry(geometry.get());
+   // Write the synth image to disk:
+   //ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
+   //writer->connectMyInputTo(0, memSource.get());
+   //ossimFilename test_raster ("generated-kmeans-input.tif");
+   //writer->setFilename(test_raster);
+   //writer->setGeotiffFlag(true);
+   //bool success = writer->execute();
+
+   ossimRefPtr<ossimImageSource> pointer = memSource.get();
+   return pointer;
+}
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+   std::string tempString;
+   ossimArgumentParser::ossimParameter stringParam(tempString);
+
+   if ( ap.read("-h") || ap.read("--help") )
+   {
+      usage(ap[0]);
+      return 0;
+   }
+
+   ossimFilename inputFilename;
+   if ( ap.read("-i", stringParam))
+      inputFilename = tempString;
+
+   bool doRemap = false;
+   if ( ap.read("--remap"))
+      doRemap = true;
+
+   ap.reportRemainingOptionsAsUnrecognized();
+   if ( ap.errors() )
+   {
+      ap.writeErrorMessages(ossimNotify(ossimNotifyLevel_NOTICE));
+      return -1;
+   }
+
+   ossimFilename outputFilename ("kmeans-out.tif");
+   if (ap.argc() > 1 )
+      outputFilename = ap.argv()[1];
+
+   ossimRefPtr<ossimImageSource> inputImage = 0;
+   if (inputFilename.empty())
+      inputImage = synthesizeInput();
+   else
+      inputImage = ossimImageHandlerRegistry::instance()->open(inputFilename);
+
+   if (!inputImage.valid())
+   {
+      cout<< "Could not load input image <"<<inputFilename<<">."<<endl;
+      return -1;
+   }
+
+   ossimRefPtr<ossimImageGeometry> geometry = inputImage->getImageGeometry();
+   if (!geometry.valid())
+   {
+      cout<< "Could not establish an input image geometry for input image <"<<inputFilename<<">."<<endl;
+      return -1;
+   }
+
+   ossimRefPtr<ossimKMeansFilter> kmeans = new ossimKMeansFilter;
+   kmeans->connectMyInputTo(inputImage.get());
+   ossim_uint32 lut [3] = { 32, 128, 255 };
+   kmeans->setClusterPixelValues(lut, 3);
+   ossimRefPtr<ossimImageSource> lastSource = kmeans.get();
+
+   if (doRemap)
+   {
+      // Remap to color for better visibility
+      ossimKeywordlist lutkwl;
+      lutkwl.add("type", "ossimIndexToRgbLutFilter");
+      lutkwl.add("mode", "literal");
+      lutkwl.add("entry0.index", "0");
+      lutkwl.add("entry0.color", "0 0 0");
+      lutkwl.add("entry1.index", "32");
+      lutkwl.add("entry1.color", "255 255 1");
+      lutkwl.add("entry2.index", "128");
+      lutkwl.add("entry2.color", "255 1 1");
+      lutkwl.add("entry3.index", "255");
+      lutkwl.add("entry3.color", "1 255 1");
+      ossimRefPtr<ossimIndexToRgbLutFilter> lutfilter = new ossimIndexToRgbLutFilter;
+      lutfilter->connectMyInputTo(kmeans.get());
+      lutfilter->loadState(lutkwl);
+      lastSource = lutfilter.get();
+   }
+
+   // Output the clustered image to disk:
+   ossimRefPtr<ossimTiffWriter> writer = new ossimTiffWriter();
+   writer->connectMyInputTo(0, lastSource.get());
+   writer->setFilename(outputFilename);
+   writer->setGeotiffFlag(true);
+   bool success = writer->execute();
+
+   return 0;
+}
diff --git a/test/src/imaging/ossim-linear-stretch-remapper-test.cpp b/test/src/imaging/ossim-linear-stretch-remapper-test.cpp
new file mode 100644
index 0000000..513ef75
--- /dev/null
+++ b/test/src/imaging/ossim-linear-stretch-remapper-test.cpp
@@ -0,0 +1,96 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimPiecewiseRemapper class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-single-image-chain-test.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimLinearStretchRemapper.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+#include <iomanip>
+#include <iostream>
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+   ossimTimer::instance()->setStartTick();
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
+   
+   cout << "elapsed time after initialize(ms): "
+        << std::setiosflags(ios::fixed)
+        << std::setprecision(3)
+        << ossimTimer::instance()->time_s() << "\n";
+
+   if (argc < 5)
+   {
+      cout <<"\n"<< argv[0] << " <min> <max> <infile> <outfile>"
+           << "\nPerforms a linear stretch on <infile> and writes the result to <outfile>. The input"
+           " image is stretched between <min> and <max> provided.\n"<< endl;
+      return 0;
+   }
+
+   ossimFilename infile = argv[3];
+   ossimFilename outfile = argv[4];
+   double min = atof(argv[1]);
+   double max = atof(argv[2]);
+
+   ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
+   if ( !sic1->open( infile ) )
+   {
+      cout<<"Error opening input file <"<<infile<<">"<<endl;
+      return 1;
+   }
+
+   cout << "Opened: " << infile << endl;
+
+   ossimRefPtr<ossimLinearStretchRemapper> remapper = new ossimLinearStretchRemapper();
+   remapper->setMinPixelValue(min, 0);
+   remapper->setMaxPixelValue(max, 0);
+   sic1->addFirst( remapper.get() );
+   sic1->initialize();
+
+   // Write image:
+   ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+   if ( !writer->open( outfile ) )
+   {
+      cout<<"Error opening output file <"<<outfile<<">"<<endl;
+      return 1;
+   }
+
+   cout << "Outputting file: " << outfile << endl;
+
+   // Add a listener to get percent complete.
+   ossimStdOutProgress prog(0, true);
+   writer->addListener(&prog);
+
+   writer->connectMyInputTo(0, sic1.get());
+   writer->execute();
+   ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
+   cout << "elapsed time after write(ms): "
+         << std::setiosflags(ios::fixed)
+   << std::setprecision(3)
+   << ossimTimer::instance()->time_s() << "\n";
+
+   cout << "write time minus initialize: "
+         << std::setiosflags(ios::fixed)
+         << std::setprecision(3)
+         << ossimTimer::instance()->delta_s(t1, t2) << "\n";
+
+   return 0;
+}
+
diff --git a/test/src/imaging/ossim-loadtile-test.cpp b/test/src/imaging/ossim-loadtile-test.cpp
new file mode 100644
index 0000000..08324c7
--- /dev/null
+++ b/test/src/imaging/ossim-loadtile-test.cpp
@@ -0,0 +1,130 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// File: ossim-foo.cpp
+//
+// Author:  David Burken
+//
+// Description: Test app:
+//
+// 1) Makes a 256x256 tile.  Each line having a single value from 0 to 255.
+// 2) Test ossimImageData::loadTile where source is 16 bit, destination 8 bit.
+// 3) Test histogram.  Should have 256 bins (0 to 255) each with count of 256.
+//
+// Returns 0 on success and outputs PASSED, 1 on failure and outputs FAILED.
+//
+// $Id$
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimConstants.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimHistogram.h>
+#include <ossim/base/ossimMultiBandHistogram.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/init/ossimInit.h>
+
+#include <iostream>
+using namespace std;
+
+int main( int argc, char* argv[] )
+{
+   enum
+   {
+      PASSED = 0,
+      FAILED = 1
+   };
+
+   int status = PASSED;
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   try
+   {
+      ossimIrect rect(0,0,255,255);
+      
+      ossimRefPtr<ossimImageData> srcTile = new ossimImageData(0, OSSIM_UINT16, 1, 256, 256);
+      srcTile->initialize();
+      srcTile->setImageRectangle( rect );
+
+      // Set max for conversion to 8 bit.
+      srcTile->setMaxPix( 255, 0 );
+      ossim_uint16* src = srcTile->getUshortBuf();
+      
+      const ossim_uint32 LINES   = 256;
+      const ossim_uint32 SAMPLES = 256;
+      ossim_uint32 s = 0;
+   
+      // line loop
+      for(ossim_uint32 line = 0; line < LINES; ++line)
+      {
+         // sample loop
+         for(ossim_uint32 samp = 0; samp < SAMPLES; ++samp)
+         {
+            src[samp] = s;
+         }
+         src += SAMPLES;
+         ++s;
+      }
+      
+      ossimRefPtr<ossimImageData> destTile = new ossimImageData(0, OSSIM_UINT8, 1, 256, 256);
+      destTile->initialize();
+      destTile->setImageRectangle( rect );
+      destTile->loadTile( srcTile.get() );
+      destTile->validate();
+
+      ossimRefPtr<ossimMultiBandHistogram> his = new ossimMultiBandHistogram( 1, 256, 0, 255 );
+
+      destTile->populateHistogram( his );
+
+      const ossimRefPtr<ossimHistogram> h = his->getHistogram( 0 );
+      if ( h.valid() )
+      {
+         float count;
+
+         // Skipping NULL pixel (i=0) since those are no longer being counted in the histogram
+         // (OLK 04/2016)
+         for( ossim_uint32 i = 1; i < LINES; ++i )
+         {
+            count = h->GetCount( static_cast<float>(i) );
+            if ( count != 256.0 )
+            {
+               status = FAILED;
+ 
+               cerr << "bin[254]: " << h->GetCount( 254.0)
+                    << "\nbin[" << i << "]: count = " << count
+                    << "\nShould be 256..."
+                    << "\nhistogram bin count: " << h->GetRes()
+                    << endl;
+
+               const ossim_uint8* buf = destTile->getUcharBuf();
+               if ( buf )
+               {
+                  cerr << "tile buffer index(255, 255) = "
+                       << (int)buf[65535] << endl;
+               }
+
+               break;
+            }
+         }
+      }
+      else
+      {
+         status = FAILED;
+      }
+   }
+   catch (const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      status = FAILED;
+   }
+
+   cout << "ossim-loadtile-test: " << (status == PASSED ? "PASSED" : "FAILED")  << endl;
+   return status;
+}
diff --git a/test/src/imaging/ossim-mask-filter-test.cpp b/test/src/imaging/ossim-mask-filter-test.cpp
new file mode 100644
index 0000000..7dba6a2
--- /dev/null
+++ b/test/src/imaging/ossim-mask-filter-test.cpp
@@ -0,0 +1,181 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// File: ossim-mask-filter-test.cpp
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimMaskFilter.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-mask-filter-test.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/base/ossimViewInterface.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/imaging/ossimMaskFilter.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+
+int main(int argc, char* argv[])
+{
+   ossimTimer::instance()->setStartTick();
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 6)
+   {
+      cout << argv[0] << " <mask_type> <resample_flag> <image_file> <shape_file> <output_file>"
+           << "\nCombines image and shape files with mask filter and writes "
+           << "result to output file.\n"
+           << "valid mask_types:\n"
+           << "1 = OSSIM_MASK_TYPE_SELECT\n"
+           << "2 = OSSIM_MASK_TYPE_INVERT\n"
+           << "3 = OSSIM_MASK_TYPE_WEIGHTED\n"
+           << "4 = OSSIM_MASK_TYPE_BINARY\n"
+           << "5 = OSSIM_MASK_TYPE_BINARY_INVERSE\n"
+           << "resample_flag if true the output will be rendered to a geographic projection.\n"
+           << "output_file is a mask of image and shape.\n"
+           << endl;
+      return 0;
+   }
+
+
+   int i = atoi(argv[1]);
+   if ( (i < 1) || (i > 5) )
+   {
+      cerr << "mask type out of range!" << endl;
+      return 1;
+   }
+   ossimMaskFilter::ossimFileSelectionMaskType mask_type =
+      static_cast<ossimMaskFilter::ossimFileSelectionMaskType>(i);
+   i = atoi(argv[2]);
+   bool resample_flag = (i?true:false);
+   ossimFilename inputImgName = ossimFilename(argv[3]);
+   ossimFilename inputShpName = ossimFilename(argv[4]);
+   ossimFilename outputFile  = ossimFilename(argv[5]);
+
+   cout << "ossim-mask-filter-test:"
+        << "\nmask_type:     " << mask_type
+        << "\nresample_flag: " << resample_flag
+        << "\ninputImgName:  " << inputImgName
+        << "\ninputShpName:  " << inputShpName
+        << "\noutputFile:    " << outputFile
+        << endl;
+
+   //---
+   // Test masking shape and image:
+   //---
+   ossimRefPtr<ossimImageSource> inputImg = 0;
+   if ( !resample_flag )
+   {
+      inputImg = ossimImageHandlerRegistry::instance()->open(inputImgName);
+   }
+   else
+   {
+      ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
+      if ( sic->open( inputImgName ) )
+      {
+         // Render the image chain.
+         sic->createRenderedChain();
+         inputImg = sic.get();
+      }
+      else
+      {
+         sic = 0;
+      }
+   }
+   if ( inputImg.valid() == false )
+   {
+      cout << "Could not open: " << inputImgName  << endl;
+      return 1;
+   }
+         
+   ossimRefPtr<ossimImageHandler> inputShp =
+      ossimImageHandlerRegistry::instance()->open(inputShpName);
+   if ( inputShp.valid() )
+   {
+      if ( inputShp->getClassName() == "ossimOgrGdalTileSource" )
+      {
+         ossimViewInterface* shpView = PTR_CAST(ossimViewInterface, inputShp.get());
+         if (shpView)
+         {
+            //---
+            // Test masking image handler and shape file.
+            //---
+            
+            // Set the shape reader's view to that of the image's.
+            shpView->setView(inputImg->getImageGeometry().get());
+            
+            // Turn fill on...
+            ossimRefPtr<ossimProperty> fillProp =
+               new ossimStringProperty(ossimString("fill_flag"),
+                                       ossimString("1"));
+            inputShp->setProperty(fillProp);
+            
+            
+            ossimRefPtr<ossimMaskFilter> maskFlt = new ossimMaskFilter();
+            maskFlt->setMaskType(mask_type);
+            maskFlt->connectMyInputTo( 0, inputImg.get() );
+            // maskFlt->connectMyInputTo(1, inputShp.get());
+            maskFlt->setMaskSource( inputShp.get() );
+            maskFlt->initialize();
+            
+            ossimRefPtr<ossimImageFileWriter> writer =
+               ossimImageWriterFactoryRegistry::instance()->
+               createWriterFromExtension(outputFile.ext());
+            
+            if ( writer->open( outputFile ) )
+            {
+               // Add a listener to get percent complete.
+               ossimStdOutProgress prog(0, true);
+               writer->addListener(&prog);
+               
+               writer->connectMyInputTo(0, maskFlt.get());
+               
+               // Set the cut rect to the input image.
+               writer->setAreaOfInterest(inputImg->getBoundingRect());
+               
+               writer->execute();
+               
+               cout << "Wrote file: " << outputFile
+                    << "\nElapsed time(seconds): "
+                    << ossimTimer::instance()->time_s() << "\n";
+            }
+            else
+            {
+               cout << "Could not open: " << argv[3] << endl;
+            }
+         }
+         else
+         {
+            cerr << "Could not get view interface..." << endl;
+         }
+      }
+      else
+      {
+         cerr << "2nd argument must be a shape file." << endl;
+      }
+   }
+   else
+   {
+      cerr << "Could not open: " << inputShpName << endl;
+   }
+
+   return 0;
+}
diff --git a/test/src/imaging/ossim-piecewise-remapper-test.cpp b/test/src/imaging/ossim-piecewise-remapper-test.cpp
new file mode 100644
index 0000000..b52588f
--- /dev/null
+++ b/test/src/imaging/ossim-piecewise-remapper-test.cpp
@@ -0,0 +1,252 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimPiecewiseRemapper class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-single-image-chain-test.cpp 21631 2012-09-06 18:10:55Z dburken $
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimPiecewiseRemapper.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+#include <iomanip>
+#include <iostream>
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+   ossimTimer::instance()->setStartTick();
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
+   
+   cout << "elapsed time after initialize(ms): "
+        << std::setiosflags(ios::fixed)
+        << std::setprecision(3)
+        << ossimTimer::instance()->time_s() << "\n";
+
+   if (argc < 2)
+   {
+      cout << argv[0] << "<image_file> <optional_output_file>"
+           << "\nOpens up single image chain and remaps it to the hardcoded parameters."
+           << " list." << endl;
+      return 0;
+   }
+
+   ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      cout << "Opened: " << argv[1] << endl;
+      
+      ossimRefPtr<ossimPiecewiseRemapper> pwr = new ossimPiecewiseRemapper();
+
+      // Add to the end of the chain. So it's image_handler->piecewise_remapper.
+      sic1->addFirst( pwr.get() );
+
+      ossimKeywordlist kwl;
+      std::string key;
+      std::string val;
+      
+      key = "number_bands";
+      val = "1";
+      kwl.addPair(key, val);
+
+      key = "remap_type";
+      val = "linear_native";
+      kwl.addPair(key, val);
+
+      // ((<min_in> <max_in> <min_out> <max_out>),(<min_in> <max_in> <min_out> <max_out>))
+      key = "band0.remap0";
+      val = "(1, 255, 255, 1)";
+
+      key = "scalar_type";
+      val = "OSSIM_UINT8";
+      kwl.addPair(key, val);
+
+      key = "type";
+      val = "ossimPiecewiseRemapper";
+      kwl.addPair(key, val);
+
+      cout << "kwl:\n" << kwl << "\n";
+
+      pwr->loadState( kwl, 0 );
+      // pwr->initialize();
+
+      // sic1->addScalarRemapper();
+      sic1->addCache();
+
+      sic1->initialize();
+      
+      // Set up chain:
+      if ( sic1->getImageHandler()->getNumberOfOutputBands() == 4 )
+      {
+         // Just guessing...
+         // sic1->setThreeBandReverseFlag(true);
+      }
+               
+      // Always have resampler cache.
+      // sic1->setAddResamplerCacheFlag(true);
+
+      // Histogram:
+      // sic1->setAddHistogramFlag(true);
+
+      // sic1->createRenderedChain();
+
+      kwl.clear();
+      sic1->saveState(kwl, 0);
+
+      cout << "sic1 state: " << kwl << endl;
+   }
+
+   if (argc == 3)
+   {
+      // Write image:
+      ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+      if ( writer->open( ossimFilename(argv[2]) ) )
+      {
+         cout << "Outputting file: " << ossimFilename(argv[2]) << endl;
+         
+         // Add a listener to get percent complete.
+         ossimStdOutProgress prog(0, true);
+         writer->addListener(&prog);
+         
+         writer->connectMyInputTo(0, sic1.get());
+         writer->execute();
+         ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
+         cout << "elapsed time after write(ms): "
+              << std::setiosflags(ios::fixed)
+              << std::setprecision(3)
+              << ossimTimer::instance()->time_s() << "\n";
+         
+         cout << "write time minus initialize: "
+              << std::setiosflags(ios::fixed)
+              << std::setprecision(3)
+              << ossimTimer::instance()->delta_s(t1, t2) << "\n";
+      }
+   }
+
+   return 0;
+}
+
+#if 0
+      // Histogram stretch:
+      if ( sic1->openHistogram(ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX) == false )
+      {
+         cout << "Could not do histogram stretch!" << endl;
+      }
+      
+      if (argc == 3)
+      {
+         // Write image:
+         ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+         if ( writer->open( ossimFilename(argv[2]) ) )
+         {
+            cout << "Outputting file: " << ossimFilename(argv[2]) << endl;
+            
+            // Add a listener to get percent complete.
+            ossimStdOutProgress prog(0, true);
+            writer->addListener(&prog);
+
+            writer->connectMyInputTo(0, sic1.get());
+            writer->execute();
+            ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
+            cout << "elapsed time after write(ms): "
+                 << std::setiosflags(ios::fixed)
+                 << std::setprecision(3)
+                 << ossimTimer::instance()->time_s() << "\n";
+
+            cout << "write time minus initialize: "
+                 << std::setiosflags(ios::fixed)
+                 << std::setprecision(3)
+                 << ossimTimer::instance()->delta_s(t1, t2) << "\n";
+         }
+      }
+#endif
+
+#if 0 
+      ossimRefPtr<ossimImageGeometry> geom = sic1->getImageGeometry();
+      if (geom.valid())
+      {
+         geom->print(cout);
+      }
+
+      // Test the load state.
+      // ossimKeywordlist kwl;
+      kwl.clear();
+      sic1->saveState(kwl, 0);
+
+      ossimSingleImageChain* sic2 = new ossimSingleImageChain();
+      sic2->loadState(kwl, 0);
+
+      kwl.clear();
+      sic2->saveState(kwl, 0);
+
+      cout << "\n\nSingle image chain from load state kwl\n" << kwl;
+   }
+
+#endif
+
+#if 0
+
+   // Create a normal chain.
+   sic1 = new ossimSingleImageChain(true,  // addHistogramFlag
+                                    true,  // addResamplerCacheFlag
+                                    true,  // addChainCacheFlag
+                                    false, // remapToEightBitFlag
+                                    false, // threeBandFlag
+                                    false); // threeBandReverseFlag
+   
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      sic1->createRenderedChain();
+      ossimKeywordlist kwl;
+      sic1->saveState(kwl, 0);
+      cout << "\n\nNormal single image chain kwl\n" << kwl;
+   }
+
+   // Create a stripped down chain.
+   sic1 = new ossimSingleImageChain();
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      sic1->createRenderedChain();
+      ossimKeywordlist kwl;
+      sic1->saveState(kwl, 0);
+      cout << "\n\nSingle image chain stripped down kwl\n" << kwl;
+   }
+
+   // Create a rgb reversed chain.
+   sic1 = new ossimSingleImageChain();
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      sic1->setThreeBandReverseFlag(true);
+      sic1->createRenderedChain();
+      ossimKeywordlist kwl;
+      sic1->saveState(kwl, 0);
+      cout << "\n\nSingle image chain rgb reversed kwl\n" << kwl;
+   }
+
+   cout << "constness test:\n";
+   ossimRefPtr<const ossimSingleImageChain> consSic = sic1.get();
+   ossimRefPtr<const ossimImageHandler> ihConst =  consSic->getImageHandler().get();
+   cout << "image handler bands: " << ihConst->getNumberOfOutputBands() << endl;
+
+
+   
+   return 0;
+}
+#endif
diff --git a/ossim/src/test/ossim-pixel-flipper-test.cpp b/test/src/imaging/ossim-pixel-flipper-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-pixel-flipper-test.cpp
rename to test/src/imaging/ossim-pixel-flipper-test.cpp
diff --git a/test/src/imaging/ossim-range-dome-test.cpp b/test/src/imaging/ossim-range-dome-test.cpp
new file mode 100644
index 0000000..672521e
--- /dev/null
+++ b/test/src/imaging/ossim-range-dome-test.cpp
@@ -0,0 +1,247 @@
+//----------------------------------------------------------------------------
+//
+// License:  See top level LICENSE.txt file.
+//
+// Description: Functional test for ossimRangeDomeTileSource class.
+//
+// $Id: ossim-range-dome-test.cpp 23468 2015-08-19 01:51:42Z dburken $
+//----------------------------------------------------------------------------
+
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimRangeDomeTileSource.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <iostream>
+#include <cstdlib> /* for exit */
+
+using namespace std;
+
+const char* globalData = "OSSIM_RANGE_DOMES 1.0\n"
+      "# ID, Lat, Lon, Hgt, Radius, Classification [, Az_start, Az_end] [, \"Description\"]\n"
+      "1, 25.8607, -80.1343, 0, 20, 1\n"
+      "2, 25.8601, -80.1336, 0, 40, 3, 135, 45, NATO friendly dome\n"
+      "3, 25.8605, -80.1343, 0, 40, 102, 135, 225, 50mm battery threat dome\n"
+      "4, 25.8601, -80.1335, 0, 50, 103, 45, 135\n"
+      "5, 25.8605, -80.1336, 0, 50, 104, 340, 20\n";
+
+const char* lut =
+      "type: ossimIndexToRgbLutFilter \n"
+      "mode: literal \n"
+      "entry0.index: 1 \n"
+      "entry0.color: 48 48 255\n"
+      "entry1.index: 2 \n"
+      "entry1.color: 32 32 255 \n"
+      "entry2.index: 3 \n"
+      "entry2.color: 16 16 255 \n"
+      "entry3.index: 4 \n"
+      "entry3.color: 1 1 255 \n"
+      "entry0.index: 101 \n"
+      "entry0.color: 255 32 32 \n"
+      "entry4.index: 102 \n"
+      "entry4.color: 255 128 1 \n"
+      "entry5.index: 103 \n"
+      "entry5.color: 255 64 1 \n"
+      "entry6.index: 104 \n"
+      "entry6.color: 255 1 1 \n";
+
+const char* TEMP_CSV_FILE = "rdtltest-default.csv";
+const char* TEMP_LUT_FILE = "rdtltest-default.lut";
+const char* DEFAULT_RESULTS_FILE = "rdtltest-RESULT.tif";
+
+class Executive
+{
+public:
+   Executive(ossimArgumentParser& ap);
+   ~Executive();
+   bool run();
+
+private:
+   ossimFilename m_csvFile;
+   ossimFilename m_lutFile;
+   ossimFilename m_resultsFile;
+   double m_gsd;
+   bool m_saveFiles;
+};
+
+Executive::Executive(ossimArgumentParser& ap)
+:  m_gsd (1.0),
+   m_saveFiles (false)
+{
+   // Set the general usage:
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   ossimString usageString = ap.getApplicationName();
+   usageString += " [options]";
+   au->setCommandLineUsage(usageString);
+
+   // Set the command line options:
+   au->addCommandLineOption(
+         "--domes <filename>",
+         "Specifies the input range-dome specifications CSV file name.");
+   au->addCommandLineOption(
+         "--gsd <meters>",
+         "Specifies output GSD in meters. Defaults to 1 meter. ");
+   au->addCommandLineOption(
+         "--lut <filename>",
+         "Causes single-band, output range-dome raster to be remapped to the RGB LUT specified in "
+         "<filename>. Implies \"--use-lut\" option.");
+   au->addCommandLineOption(
+         "--out <filename>",
+         "Specifies output filename. Defaults to <rdtltest-OUT.tif>.");
+   au->addCommandLineOption(
+         "--save",
+         "Prevents temporary domes CSV file and LUT file from being deleted after test so they "
+         "can be used as examples for custom inputs.");
+   au->addCommandLineOption(
+         "--use-lut",
+         "Causes single-band, output range-dome raster to be remapped to default "
+         "range-dome RGB LUT.");
+
+   if (ap.read("-h") || ap.read("--help"))
+   {
+      ap.getApplicationUsage()->write(ossimNotify(ossimNotifyLevel_INFO));
+      return;
+   }
+
+   std::string ts1;
+   ossimArgumentParser::ossimParameter sp1(ts1);
+   m_csvFile = TEMP_CSV_FILE;
+   m_resultsFile = DEFAULT_RESULTS_FILE;
+   m_lutFile.clear();
+
+   if (ap.read("--gsd", sp1))
+      m_gsd = ossimString(ts1).toDouble();
+
+   if (ap.read("--domes", sp1))
+      m_csvFile = ts1;
+
+   if (ap.read("--lut", sp1))
+      m_lutFile = ts1;
+
+   if (ap.read("--out", sp1))
+      m_resultsFile = ts1;
+
+   if (ap.read("--save"))
+      m_saveFiles = true;
+
+   if (ap.read("--use-lut"))
+      m_lutFile = TEMP_LUT_FILE;
+}
+
+Executive::~Executive()
+{
+   if (!m_saveFiles)
+   {
+      if (m_csvFile == TEMP_CSV_FILE)
+         m_csvFile.remove();
+
+      if (m_lutFile == TEMP_LUT_FILE)
+         m_lutFile.remove();
+   }
+}
+
+bool Executive::run()
+{
+   if (m_resultsFile.empty())
+      return false;
+
+   // Output temp datafile if none provided:
+   if (m_csvFile == TEMP_CSV_FILE)
+   {
+      ofstream ofs (m_csvFile.string().c_str(), ios_base::trunc);
+      if (ofs.fail())
+      {
+         ossimNotify(ossimNotifyLevel_FATAL)
+               << "Could not write out temporary CSV file to CWD. Check permissions." << endl;
+         return false;
+      }
+      ofs << globalData << endl;
+      ofs.close();
+   }
+
+   // Use factory to open the RDTS:
+   ossimRefPtr<ossimImageHandler> handler = ossimImageHandlerRegistry::instance()->open(m_csvFile);
+   if (!handler.valid())
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+            << "Error encountered instantiating threat dome handler from CSV." << std::endl;
+      return false;
+   }
+
+   // Set up the range-dome filter chain:
+   ossimRangeDomeTileSource* rdts =  dynamic_cast<ossimRangeDomeTileSource*>(handler.get());
+   if (!rdts)
+   {
+      ossimNotify(ossimNotifyLevel_FATAL)
+            << "Error encountered casting handler to ossimRangeDomeTileSource" << std::endl;
+      return false;
+   }
+   ossimConnectableObject* chain_head = rdts;
+   rdts->setGSD(m_gsd);
+
+   cout<<" numLines = "<< rdts->getNumberOfLines()<<endl;
+   cout<<" numSamps = "<< rdts->getNumberOfSamples()<<endl;
+   cout<<" numDomes = "<< rdts->getNumRangeDomes()<<endl;
+
+   // Add LUT for visibility if requested:
+   if (!m_lutFile.empty())
+   {
+      if (m_lutFile == TEMP_LUT_FILE)
+      {
+         // Need to output default temporary LUT:
+         ofstream lutfs (m_lutFile.string().c_str(), ios_base::trunc);
+         if (lutfs.fail())
+         {
+            cout << "Could not write out temporary LUT file to CWD. Check permissions." << endl;
+            return false;
+         }
+         lutfs << lut << endl;
+         lutfs.close();
+      }
+
+      ossimRefPtr<ossimIndexToRgbLutFilter> lutFilter = new ossimIndexToRgbLutFilter();
+      lutFilter->connectMyInputTo(chain_head);
+      lutFilter->setLut(m_lutFile);
+      lutFilter->initialize();
+      chain_head = lutFilter.get();
+   }
+
+   // Set up the writer for results file:
+   ossimRefPtr<ossimTiffWriter> tiffWriter = new ossimTiffWriter();
+   tiffWriter->connectMyInputTo(chain_head);
+   tiffWriter->setFilename(m_resultsFile);
+   if (!tiffWriter->execute())
+   {
+      cout << "Could not write results file <"<<m_resultsFile<<">." << endl;
+      return false;
+   }
+
+   tiffWriter->close();
+   tiffWriter = 0;
+   handler = 0;
+
+   cout<<"\nTest completed. Output written to <"<<m_resultsFile<<">.\n"<<endl;
+   return true;
+}
+
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap(&argc, argv);
+   ap.getApplicationUsage()->setApplicationName(argv[0]);
+   ossimInit::instance()->initialize(ap);
+
+   Executive* executive = new Executive(ap);
+   bool success = executive->run();
+   delete executive;
+
+   if (!success)
+      exit(1);
+
+   exit(0);
+}
+
+
diff --git a/ossim/src/test/ossim-read-write-consistency-test.cpp b/test/src/imaging/ossim-read-write-consistency-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-read-write-consistency-test.cpp
rename to test/src/imaging/ossim-read-write-consistency-test.cpp
diff --git a/test/src/imaging/ossim-remap-table-test.cpp b/test/src/imaging/ossim-remap-table-test.cpp
new file mode 100644
index 0000000..ec80c6e
--- /dev/null
+++ b/test/src/imaging/ossim-remap-table-test.cpp
@@ -0,0 +1,359 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description: Test normalized remap table.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-remap-table-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <iostream>
+#include <iomanip>
+using namespace std;
+
+#include <ossim/base/ossimConstants.h>  // ossim contants...
+#include <ossim/imaging/ossimNormalizedS16RemapTable.h>
+#include <ossim/imaging/ossimNormalizedU16RemapTable.h>
+#include <ossim/imaging/ossimNormalizedU11RemapTable.h>
+#include <ossim/imaging/ossimNormalizedU8RemapTable.h>
+
+
+int main(int argc, char *argv[])
+{
+   cout << setiosflags(std::ios::fixed) << setprecision(15);
+
+   ossim_float64 n;
+   ossim_int32   p;
+   ossim_int32   i;
+   
+   cout << "//------------------------------------------\n"
+        << "// *** ossimNormalizedS16RemapTable test ***\n"
+        << "//------------------------------------------\n"
+        << endl;
+   
+   ossimNormalizedS16RemapTable s16tbl;
+   
+   i = -32768;
+   while (i < 32768)
+   {
+      n = s16tbl[i];
+      p = s16tbl.pixFromNorm(n);
+      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
+      ++i;
+   }
+
+   n = -0.1;
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+    
+   n = 0.0;
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.000000250; // Just above null pixel
+   p = s16tbl.pixFromNorm(n);
+   cout << "Just above null\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 0.000015250; // Slightly less than -32767
+   p = s16tbl.pixFromNorm(n);
+   cout << "Slightly less than -32767\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.0000152588; // -32767
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 0.000015258;  // Slightly bigger than -32767
+   p = s16tbl.pixFromNorm(n);
+   cout << "Slightly bigger than -32767\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.000030518043793; // -32766
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 0.0000305180436;  // Slightly to the left of -32766
+   p = s16tbl.pixFromNorm(n);
+   cout << "Slightly less than -32766\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.5;
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.999984740977; // Slightly less than 32766
+   p = s16tbl.pixFromNorm(n);
+   cout << "Slightly less than 32766\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.999984740978103; // 32766
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.99998474098; // Slightly greater than 32766
+   p = s16tbl.pixFromNorm(n);
+   cout << "Slightly greater than 32766\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 1.0;
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 1.1;
+   p = s16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   p = -32768;
+   n = s16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+   
+   p = -32767;
+   n = s16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 0;
+   n = s16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 32766.99999999999;
+   n = s16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 32767;
+   n = s16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 32768;
+   n = s16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   cout << "//------------------------------------------\n"
+        << "// *** ossimNormalizedU16RemapTable test ***\n"
+        << "//------------------------------------------\n"
+        << endl;
+   
+   ossimNormalizedU16RemapTable u16tbl;
+   
+   i = 0;
+   while (i < 65536)
+   {
+      n = u16tbl[i];
+      p = u16tbl.pixFromNorm(n);
+      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
+      ++i;
+   }
+
+   n = -0.1;
+   p = u16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+
+   n = 0.0;
+   p = u16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.001;
+   p = u16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.000000250; // Just above null pixel
+   p = u16tbl.pixFromNorm(n);
+   cout << "Just above null\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 1.0;
+   p = u16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 1.1;
+   p = u16tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   p = -1;
+   n = u16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 0;
+   n = u16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 1;
+   n = u16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 65534;
+   n = u16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 65535;
+   n = u16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 65536;
+   n = u16tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+      
+   cout << "\n\n//------------------------------------------\n"
+        << "// *** ossimNormalizedU11RemapTable test ***\n"
+        << "//------------------------------------------\n"
+        << endl;
+   
+   ossimNormalizedU11RemapTable u11tbl;
+   
+   i = 0;
+   while (i < 2048)
+   {
+      n = u11tbl[i];
+      p = u11tbl.pixFromNorm(n);
+      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
+      ++i;
+   }
+
+   n = -0.1;
+   p = u11tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+    
+   n = 0.0;
+   p = u11tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.00000852; // Just above null pixel
+   p = u11tbl.pixFromNorm(n);
+   cout << "Just above null\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.000;
+   p = u11tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = .000488519785; // Slightly less than 1
+   p = u11tbl.pixFromNorm(n);
+   cout << "Slightly less than 1\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.000488519785051; // 1
+   cout << "1\n";
+   p = u11tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.000488519786;  // Slightly bigger than 1
+   p = u11tbl.pixFromNorm(n);
+   cout << "Slightly bigger than 1\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.9995114802149; // Slightly less than 2046
+   p = u11tbl.pixFromNorm(n);
+   cout << "Slightly less than 2046\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.999511480214949; // 2046
+   p = u11tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.999511480215; // Slightly greater than 2046
+   p = u11tbl.pixFromNorm(n);
+   cout << "Slightly greater than 2046\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 1.0;
+   p = u11tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 1.1;
+   p = u11tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   p = -1;
+   n = u11tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+   
+   p = 0;
+   n = u11tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 2046;
+   n = u11tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 2047;
+   n = u11tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 2048;
+   n = u11tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   cout << "\n\n//------------------------------------------\n"
+        << "// *** ossimNormalizedU8RemapTable test ***\n"
+        << "//------------------------------------------\n"
+        << endl;
+   
+   ossimNormalizedU8RemapTable u8tbl;
+   
+   i = 0;
+   while (i < 256)
+   {
+      n = u8tbl[i];
+      p = u8tbl.pixFromNorm(n);
+      cout << "idx[" << i << "]: n (" << n << "), p(" << p << ")\n";
+      ++i;
+   }
+
+   n = -0.1;
+   p = u8tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+    
+   n = 0.0;
+   p = u8tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.00000625; // Just above null pixel
+   p = u8tbl.pixFromNorm(n);
+   cout << "Just above null\n";
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 0.001;
+   p = u8tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 1.0;
+   p = u8tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 1.1;
+   p = u8tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   n = 1.0;
+   p = u8tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+   
+   n = 1.1;
+   p = u8tbl.pixFromNorm(n);
+   cout << "pixFromNorm(" << n << "): " << p << "\n";
+
+   p = -1;
+   n = u8tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+   
+   p = 0;
+   n = u8tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 254;
+   n = u8tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 255;
+   n = u8tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+
+   p = 256;
+   n = u8tbl.normFromPix(p);
+   cout << "normFromPix(" << p << "): " << n << "\n";
+   
+   return 0;
+}
diff --git a/test/src/imaging/ossim-shift-filter-test.cpp b/test/src/imaging/ossim-shift-filter-test.cpp
new file mode 100644
index 0000000..1faf44d
--- /dev/null
+++ b/test/src/imaging/ossim-shift-filter-test.cpp
@@ -0,0 +1,200 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// File: ossim-viirs-proc
+//
+// Description: Application to extract VIIRS Radiance layer, shifting
+// min/max linearly to 16 bit space with coarse grid geometry file.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimMetadataInterface.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimCastTileSourceFilter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimShiftFilter.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimCoarseGridModel.h>
+#include <ossim/projection/ossimProjection.h>
+
+#include <iomanip>
+#include <iostream>
+#include <string>
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+   int status = 0;
+
+   // Timer for elapsed time:
+   ossimTimer::instance()->setStartTick();
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc == 2 )
+   {
+      ossimFilename inputFile = argv[1];
+      if ( inputFile.exists() )
+      {
+         ossimFilename outputFile = inputFile.expand().noExtension();
+         outputFile.string() += "_1.tif";
+         
+         if ( inputFile != outputFile )
+         {
+            std::string command =
+               "ossim-cmm --null -9999.0 --reader-prop layer=/All_Data/VIIRS-DNB-SDR_All/Radiance ";
+            command += inputFile.string();
+            cout << "Executing command: " << command << endl;
+
+            status = system( command.c_str() );
+
+            if ( status == 0 )
+            {
+               ossimRefPtr<ossimSingleImageChain> sic = new ossimSingleImageChain();
+               if ( sic->open( inputFile, false ) )
+               {
+                  cout << "Opened: " << inputFile << endl;
+
+                  // Set the entry to the Radiance layer.
+                  ossimRefPtr<ossimProperty> readerProp = new  ossimStringProperty(
+                     ossimString("layer"),
+                     ossimString("/All_Data/VIIRS-DNB-SDR_All/Radiance") );
+
+                  sic->getImageHandler()->setProperty( readerProp );
+
+                  // Add filter to shift/stretch data uint16 range.
+                  ossimRefPtr<ossimShiftFilter> sf = new ossimShiftFilter();
+                  sf->setNullPixelValue( 0.0 );
+                  sf->setMinPixelValue( 1.0 );
+                  sf->setMaxPixelValue( 65535.0 );
+                  sic->addFirst( sf.get() );
+
+                  // Cast it to uint16:
+                  ossimRefPtr<ossimCastTileSourceFilter> cf =
+                     new ossimCastTileSourceFilter(0, OSSIM_UINT16 );
+                  sic->addFirst( cf.get() );
+
+                  // Put a cache in front of resampler.
+                  sic->addCache();
+                  
+                  // sic->addResampler();
+                  
+                  sic->initialize();
+                  
+                  // Write image:
+                  ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+                  if ( writer->open( outputFile ) )
+                  {
+                     // Turn on overviews and histograms:
+                     writer->setWriteOverviewFlag( true );
+                     writer->setWriteHistogramFlag( true );
+
+                     // Add a listener to get percent complete.
+                     ossimStdOutProgress prog(0, true);
+                     writer->addListener(&prog);
+                     
+                     writer->connectMyInputTo(0, sic.get());
+
+                     ossimIrect rect = writer->getAreaOfInterest();
+                     
+                     writer->execute();
+
+                     cout << "Wrote file: " << outputFile << endl;
+                     
+                     ossimRefPtr<ossimImageHandler> ih = sic->getImageHandler();
+
+                     if ( ih.valid() )
+                     {
+                        //---
+                        // If there is a coarse grid model write it out so the
+                        // oqutput file will pick it up.
+                        //---
+                        ossimRefPtr<ossimImageGeometry> geom = sic->getImageHandler()->
+                           getImageGeometry();
+                        if ( geom.valid() )
+                        {
+                           ossimRefPtr<ossimProjection> proj = geom->getProjection();
+                           if ( proj.valid() )
+                           {
+                              ossimRefPtr<ossimCoarseGridModel> cg =
+                                 dynamic_cast<ossimCoarseGridModel*>( proj.get() );
+                              if ( cg.valid() )
+                              {
+                                 ossimFilename geomFile = outputFile.noExtension();
+                                 geomFile.string() += ".geom";
+
+                                 // this saves geom file as well
+                                 cg->saveCoarseGrid( geomFile );
+                                 cout << "Wrote file: " << geomFile << endl;
+                              }
+                           }
+                        }
+
+                        //---
+                        // If the image handler is a metadata interface pass the metadata
+                        // to the dot.omd file and rewrite it.
+                        //---
+                        ossimMetadataInterface* mdi =
+                           dynamic_cast<ossimMetadataInterface*>( ih.get() );
+                        if ( mdi )
+                        {
+                           ossimFilename omdFile = outputFile.noExtension();
+                           omdFile += ".omd";
+                           ossimRefPtr<ossimKeywordlist> kwl = new ossimKeywordlist();
+                           if ( omdFile.exists() )
+                           {
+                              kwl->addFile( omdFile );
+                           }
+                           
+                           std::string prefix = "";
+                           mdi->addMetadata( kwl.get(), prefix );
+                           kwl->write( omdFile.c_str() );
+                           cout << "Wrote file: " << omdFile << endl;
+                        }
+                     }
+                  }
+                  else
+                  {
+                     cerr << "Could not open: " << outputFile << endl;
+                  }
+               }
+            }
+         } 
+         else // Matches: 
+         {
+            cerr << "Input file is same as output file!  Returning..." << endl;
+            status = -1;
+         }
+      }
+      else // Match: if ( inputFile.exists() ){ ... }
+      {
+         cerr << "Input file does not exists!" << endl;
+         status = -1;
+      }
+   }
+   else // Matches: if (argc == 2 ){ ... }
+   {
+      cout << argv[0] << " <image_file>"
+           << "\n\nExtracts VIIRS Radiance layer from hdf5 file, shifting min/max "
+           << "linearly to 16 bit space with coarse grid geometry file.\n" << endl;
+   }
+
+   cout << "Elapsed time in seconds: "
+        << std::setiosflags(ios::fixed)
+        << std::setprecision(3)
+        << ossimTimer::instance()->time_s() << "\n";
+
+   return status;
+}
diff --git a/test/src/imaging/ossim-single-image-chain-test.cpp b/test/src/imaging/ossim-single-image-chain-test.cpp
new file mode 100644
index 0000000..fbaa2d8
--- /dev/null
+++ b/test/src/imaging/ossim-single-image-chain-test.cpp
@@ -0,0 +1,165 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimSingleImageChain class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-single-image-chain-test.cpp 22531 2013-12-28 18:13:34Z dburken $
+
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimPiecewiseRemapper.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+#include <iomanip>
+#include <iostream>
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+   ossimTimer::instance()->setStartTick();
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
+   
+   cout << "elapsed time after initialize(ms): "
+        << std::setiosflags(ios::fixed)
+        << std::setprecision(3)
+        << ossimTimer::instance()->time_s() << "\n";
+
+   if (argc < 2)
+   {
+      cout << argv[0] << "<image_file> <optional_output_file>"
+           << "\nOpens up single image chain and dumps the state to keyword"
+           << " list." << endl;
+      return 0;
+   }
+
+   ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      // Set up chain:
+      
+      if ( sic1->getImageHandler()->getNumberOfOutputBands() == 4 )
+      {
+         // Just guessing...
+         sic1->setThreeBandReverseFlag(true);
+      }
+               
+      // Always have resampler cache.
+      sic1->setAddResamplerCacheFlag(true);
+
+      // Histogram:
+      sic1->setAddHistogramFlag(true);
+
+      sic1->createRenderedChain();
+
+      // Histogram stretch:
+      if ( sic1->openHistogram(ossimHistogramRemapper::LINEAR_AUTO_MIN_MAX) == false )
+      {
+         cout << "Could not do histogram stretch!" << endl;
+      }
+      
+      if (argc == 3)
+      {
+         // Write image:
+         ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+         if ( writer->open( ossimFilename(argv[2]) ) )
+         {
+            cout << "Outputting file: " << ossimFilename(argv[2]) << endl;
+            
+            // Add a listener to get percent complete.
+            ossimStdOutProgress prog(0, true);
+            writer->addListener(&prog);
+
+            writer->connectMyInputTo(0, sic1.get());
+            writer->execute();
+            ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
+            cout << "elapsed time after write(ms): "
+                 << std::setiosflags(ios::fixed)
+                 << std::setprecision(3)
+                 << ossimTimer::instance()->time_s() << "\n";
+
+            cout << "write time minus initialize: "
+                 << std::setiosflags(ios::fixed)
+                 << std::setprecision(3)
+                 << ossimTimer::instance()->delta_s(t1, t2) << "\n";
+         }
+      }
+
+      ossimRefPtr<ossimImageGeometry> geom = sic1->getImageGeometry();
+      if (geom.valid())
+      {
+         geom->print(cout);
+      }
+
+      // Test the load state.
+      ossimKeywordlist kwl;
+      sic1->saveState(kwl, 0);
+
+      ossimSingleImageChain* sic2 = new ossimSingleImageChain();
+      sic2->loadState(kwl, 0);
+
+      kwl.clear();
+      sic2->saveState(kwl, 0);
+
+      cout << "\n\nSingle image chain from load state kwl\n" << kwl;
+   }
+
+   // Create a normal chain.
+   sic1 = new ossimSingleImageChain(true,  // addHistogramFlag
+                                    true,  // addResamplerCacheFlag
+                                    true,  // addChainCacheFlag
+                                    false, // remapToEightBitFlag
+                                    false, // threeBandFlag
+                                    false); // threeBandReverseFlag
+   
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      sic1->createRenderedChain();
+      ossimKeywordlist kwl;
+      sic1->saveState(kwl, 0);
+      cout << "\n\nNormal single image chain kwl\n" << kwl;
+   }
+
+   // Create a stripped down chain.
+   sic1 = new ossimSingleImageChain();
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      sic1->createRenderedChain();
+      ossimKeywordlist kwl;
+      sic1->saveState(kwl, 0);
+      cout << "\n\nSingle image chain stripped down kwl\n" << kwl;
+   }
+
+   // Create a rgb reversed chain.
+   sic1 = new ossimSingleImageChain();
+   if ( sic1->open( ossimFilename(argv[1]) ) )
+   {
+      sic1->setThreeBandReverseFlag(true);
+      sic1->createRenderedChain();
+      ossimKeywordlist kwl;
+      sic1->saveState(kwl, 0);
+      cout << "\n\nSingle image chain rgb reversed kwl\n" << kwl;
+   }
+
+   cout << "constness test:\n";
+   ossimRefPtr<const ossimSingleImageChain> consSic = sic1.get();
+   ossimRefPtr<const ossimImageHandler> ihConst =  consSic->getImageHandler();
+   cout << "image handler bands: " << ihConst->getNumberOfOutputBands() << endl;
+
+   return 0;
+}
diff --git a/test/src/imaging/ossim-single-image-chain-threaded-test.cpp b/test/src/imaging/ossim-single-image-chain-threaded-test.cpp
new file mode 100644
index 0000000..1b2a613
--- /dev/null
+++ b/test/src/imaging/ossim-single-image-chain-threaded-test.cpp
@@ -0,0 +1,101 @@
+//----------------------------------------------------------------------------
+//
+// File: ossim-single-image-chain-threaded-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimSingleImageChain with a
+// ossimMultiThreadSequencer.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-single-image-chain-threaded-test.cpp 20269 2011-11-18 15:40:56Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimSingleImageChain.h>
+#include <ossim/imaging/ossimTiffWriter.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/parallel/ossimMultiThreadSequencer.h>
+
+int main(int argc, char* argv[])
+{
+   ossimTimer::instance()->setStartTick();
+   
+   ossimInit::instance()->initialize(argc, argv);
+
+   ossimTimer::Timer_t t1 = ossimTimer::instance()->tick();
+   
+   cout << "elapsed time after initialize(ms): "
+        << ossimTimer::instance()->time_s() << "\n";
+
+   if (argc < 4)
+   {
+      cout << argv[0] << "<threads> <image_file> <output_file.tif>"
+           << "\nOpens up single image chain and writes to output_file using N threads."
+           << " list.\nNOTE: Hard wired tiff writer; hence, the output_file.tif." << endl;
+      return 0;
+   }
+
+   ossim_uint32  threads     = ossimString(argv[1]).toUInt32();
+   if ( threads == 0 )
+   {
+      threads = ossim::getNumberOfThreads();
+   }
+   ossimFilename image_file  = argv[2];
+   ossimFilename output_file = argv[3];
+
+   cout << "threads:     " << threads
+        << "\nimage_file:  " << image_file
+        << "\noutput_file: " << output_file
+        << "\n";
+   
+   ossimRefPtr<ossimSingleImageChain> sic1 = new ossimSingleImageChain();
+   
+   if ( sic1->open( image_file ) )
+   {
+      sic1->createRenderedChain();
+
+      // Establish the MT sequencer:
+      ossimRefPtr<ossimMultiThreadSequencer> mts =
+         new ossimMultiThreadSequencer( sic1.get(), threads );
+
+      ossimRefPtr<ossimImageFileWriter> writer = new ossimTiffWriter();
+      writer->changeSequencer( mts.get() );
+      
+      if ( writer->open( output_file ) )
+      {
+         // Add a listener to get percent complete.
+         ossimStdOutProgress prog(0, true);
+         writer->addListener(&prog);
+
+         // Connect the chain to writer.
+         writer->connectMyInputTo(0, sic1.get());
+
+         // Write the file.
+         writer->execute();
+         
+         ossimTimer::Timer_t t2 = ossimTimer::instance()->tick();
+         cout << "elapsed time after write(ms): "
+              << std::setiosflags(ios::fixed)
+              << std::setprecision(3)
+              << ossimTimer::instance()->time_s() << "\n";
+         
+         cout << "write time minus initialize: "
+              << std::setiosflags(ios::fixed)
+              << std::setprecision(3)
+              << ossimTimer::instance()->delta_s(t1, t2) << "\n";
+      }
+   }
+
+   return 0;
+}
diff --git a/ossim/src/test/ossim-threaded-app-tile-cache-test.cpp b/test/src/imaging/ossim-threaded-app-tile-cache-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-threaded-app-tile-cache-test.cpp
rename to test/src/imaging/ossim-threaded-app-tile-cache-test.cpp
diff --git a/ossim/src/test/ossim-threaded-chain-test.cpp b/test/src/imaging/ossim-threaded-chain-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-threaded-chain-test.cpp
rename to test/src/imaging/ossim-threaded-chain-test.cpp
diff --git a/test/src/ossim-batch-test.cpp b/test/src/ossim-batch-test.cpp
new file mode 100644
index 0000000..d0986dc
--- /dev/null
+++ b/test/src/ossim-batch-test.cpp
@@ -0,0 +1,72 @@
+//----------------------------------------------------------------------------
+//
+// File ossim-batch-test.cpp
+// 
+// License:  See top level LICENSE.txt file.
+//
+// Author:  Oscar Kramer
+//
+// Description: Test code application ossim batch test.
+//
+//----------------------------------------------------------------------------
+// $Id: ossim-batch-test.cpp 20675 2012-03-10 16:30:04Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/util/ossimBatchTest.h>
+#include <ossim/init/ossimInit.h>
+#include <ostream>
+
+//**************************************************************************************************
+// MAIN MODULE
+// See ossimBatchTest.cpp for usage, or run executable with no args for usage.
+// Returns:
+//   -1 if any error occurred during test
+//    1 if any test failed
+//    0 if all tests passed
+//**************************************************************************************************
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+
+   ossimApplicationUsage* au = ap.getApplicationUsage();
+   au->setDescription(
+         "This application is used for functional testing of OSSIM components. The tests are"
+         "\nspecified within the configuration file passed in.  The following status codes are"
+         "\nreturned on exit:\n"
+         "\n    0  Test passed"
+         "\n    1  No test performed (disabled)"
+         "\n    2  Problem encountered during test initialization."
+         "\n    3  Error occurred during test execution."
+         "\n    4  Test ran but failed.\n"
+         "\nFor enabling individual tests, you can edit the \"enabled\" flag in the configuration"
+         "\nfile or use the \"-r\" options described below. ");
+   au->setCommandLineUsage(ap.getApplicationName()+" <test-configuration-file.kwl>");
+
+   int return_status = 0;
+   ossimBatchTest obt;
+   if (!obt.initialize(ap))
+   {
+      return_status = 2;
+   }
+   else
+   {
+      ossim_uint8 status = obt.execute();
+      
+      // Bitwise and ops to isolate status bits (see ossimBatchTest.h for bit definitions)
+      if (status == ossimBatchTest::TEST_TBD)
+         return_status = 1; // nothing was done
+      else if (status & ossimBatchTest::TEST_ERROR)
+         return_status = 3; // an error occurred running a command
+      else if (status & ossimBatchTest::TEST_FAILED)
+         return_status = 4;  // A test failed post-processing (diff)
+      else
+         return_status = 0;  // Everything passed
+   }
+
+   return return_status;
+}
+
diff --git a/test/src/ossim-foo.cpp b/test/src/ossim-foo.cpp
new file mode 100644
index 0000000..3af5a81
--- /dev/null
+++ b/test/src/ossim-foo.cpp
@@ -0,0 +1,112 @@
+//---
+//
+// License: MIT
+//
+// File: ossim-foo.cpp
+//
+// Description: Contains application definition "ossim-foo" app.
+//
+// NOTE:  This is supplied for simple quick test. DO NOT checkin your test to
+//        the svn repository.  Simply edit ossim-foo.cpp and run your test.
+//        After completion you can do a "git checkout -- ossimfoo.cpp" if
+//        you want to keep your working repository up to snuff.
+//
+// $Id$
+//---
+
+// ossim includes:  These are here just to save time/typing...
+#include <ossim/base/ossimApplicationUsage.h>
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimConnectableObject.h>
+#include <ossim/base/ossimCsvFile.h>
+#include <ossim/base/ossimDate.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimIpt.h>
+#include <ossim/base/ossimIrect.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimKeywordNames.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimObjectFactory.h>
+#include <ossim/base/ossimObjectFactoryRegistry.h>
+#include <ossim/base/ossimProperty.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimString.h>
+#include <ossim/base/ossimScalarTypeLut.h>
+#include <ossim/base/ossimStdOutProgress.h>
+#include <ossim/base/ossimStreamFactoryRegistry.h>
+#include <ossim/base/ossimStringProperty.h>
+#include <ossim/base/ossimTrace.h>
+#include <ossim/base/ossimUrl.h>
+#include <ossim/base/ossimVisitor.h>
+
+#include <ossim/imaging/ossimBrightnessContrastSource.h>
+#include <ossim/imaging/ossimBumpShadeTileSource.h>
+#include <ossim/imaging/ossimFilterResampler.h>
+#include <ossim/imaging/ossimFusionCombiner.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/imaging/ossimImageFileWriter.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageMosaic.h>
+#include <ossim/imaging/ossimImageRenderer.h>
+#include <ossim/imaging/ossimImageSource.h>
+#include <ossim/imaging/ossimImageSourceFilter.h>
+#include <ossim/imaging/ossimImageToPlaneNormalFilter.h>
+#include <ossim/imaging/ossimImageWriterFactoryRegistry.h>
+#include <ossim/imaging/ossimIndexToRgbLutFilter.h>
+#include <ossim/imaging/ossimRectangleCutFilter.h>
+#include <ossim/imaging/ossimScalarRemapper.h>
+#include <ossim/imaging/ossimSFIMFusion.h>
+#include <ossim/imaging/ossimTwoColorView.h>
+#include <ossim/imaging/ossimImageSourceFactoryRegistry.h>
+
+#include <ossim/init/ossimInit.h>
+
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <ossim/projection/ossimImageViewAffineTransform.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+#include <ossim/projection/ossimUtmProjection.h>
+
+#include <ossim/support_data/ossimSrcRecord.h>
+#include <ossim/support_data/ossimWkt.h>
+
+// Put your includes here:
+
+// System includes:
+#include <cmath>
+#include <memory>
+#include <sstream>
+#include <iostream>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+   
+   ossimArgumentParser ap(&argc, argv);
+   ossimInit::instance()->addOptions(ap);
+   ossimInit::instance()->initialize(ap);
+
+   try
+   {
+      // Put your code here.
+   }
+   catch(const ossimException& e)
+   {
+      ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+      returnCode = 1;
+   }
+   catch( ... )
+   {
+      ossimNotify(ossimNotifyLevel_WARN)
+         << "ossim-foo caught unhandled exception!" << std::endl;
+      returnCode = 1;
+   }
+   
+   return returnCode;
+}
diff --git a/ossim/src/test/ossim-test.cpp b/test/src/ossim-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-test.cpp
rename to test/src/ossim-test.cpp
diff --git a/test/src/parallel/CMakeLists.txt b/test/src/parallel/CMakeLists.txt
new file mode 100644
index 0000000..101cbf7
--- /dev/null
+++ b/test/src/parallel/CMakeLists.txt
@@ -0,0 +1,3 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+OSSIM_SETUP_APPLICATION(ossim-jobqueue-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-jobqueue-test.cpp)
diff --git a/ossim/src/test/ossim-jobqueue-test.cpp b/test/src/parallel/ossim-jobqueue-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-jobqueue-test.cpp
rename to test/src/parallel/ossim-jobqueue-test.cpp
diff --git a/test/src/point_cloud/CMakeLists.txt b/test/src/point_cloud/CMakeLists.txt
new file mode 100644
index 0000000..2378c8f
--- /dev/null
+++ b/test/src/point_cloud/CMakeLists.txt
@@ -0,0 +1,3 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+OSSIM_SETUP_APPLICATION(ossim-point-cloud-handler-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-point-cloud-handler-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-point-cloud-image-handler-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-point-cloud-image-handler-test.cpp)
diff --git a/ossim/src/test/ossim-point-cloud-handler-test.cpp b/test/src/point_cloud/ossim-point-cloud-handler-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-point-cloud-handler-test.cpp
rename to test/src/point_cloud/ossim-point-cloud-handler-test.cpp
diff --git a/ossim/src/test/ossim-point-cloud-image-handler-test.cpp b/test/src/point_cloud/ossim-point-cloud-image-handler-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-point-cloud-image-handler-test.cpp
rename to test/src/point_cloud/ossim-point-cloud-image-handler-test.cpp
diff --git a/test/src/projection/CMakeLists.txt b/test/src/projection/CMakeLists.txt
new file mode 100644
index 0000000..185a452
--- /dev/null
+++ b/test/src/projection/CMakeLists.txt
@@ -0,0 +1,10 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+OSSIM_SETUP_APPLICATION(ossim-epsg-factory-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-epsg-factory-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-eq-projection-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-eq-projection-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-image-geometry-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-image-geometry-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-nitf-rsm-model-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-nitf-rsm-model-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-projection-factory-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-projection-factory-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-projection-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-projection-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-wkt-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-wkt-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-wkt-proj-factory-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-wkt-proj-factory-test.cpp)
diff --git a/ossim/src/test/ossim-epsg-factory-test.cpp b/test/src/projection/ossim-epsg-factory-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-epsg-factory-test.cpp
rename to test/src/projection/ossim-epsg-factory-test.cpp
diff --git a/test/src/projection/ossim-eq-projection-test.cpp b/test/src/projection/ossim-eq-projection-test.cpp
new file mode 100644
index 0000000..6432773
--- /dev/null
+++ b/test/src/projection/ossim-eq-projection-test.cpp
@@ -0,0 +1,54 @@
+#include <ossim/projection/ossimEquDistCylProjection.h>
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   ossimGpt gpt_ul (38.0, -77.0);
+   ossimDpt ipt_ul (0.0, 0.0);
+   ossimDpt ipt_lr (255.0, 255.0);
+   ossimGpt gpt;
+   ossimDpt gsd;
+
+   ossimEquDistCylProjection proj;
+
+   proj.setUlTiePoints(gpt_ul);
+   proj.setDecimalDegreesPerPixel(ossimDpt(0.0000090,0.0000090));
+
+   cout << "\n Normal initialization ***************"<<endl;
+   cout << "ORIG: "<<proj.getOrigin()<<endl;
+   cout << "TP: "<<proj.getUlGpt()<<endl;
+   cout << "GSD: "<<proj.getMetersPerPixel() << endl;
+   cout << "Deg/pixel: "<<proj.getDecimalDegreesPerPixel() << endl;
+   proj.lineSampleHeightToWorld(ipt_ul, 0.0, gpt);
+   cout << "UL: " <<gpt << endl;
+   proj.lineSampleHeightToWorld(ipt_lr, 0.0, gpt);
+   cout << "LR: " <<gpt << endl;
+
+   proj.setOrigin(gpt_ul);
+
+   cout << "\n Origin set to UL ***************"<<endl;
+   cout << "ORIG: "<<proj.getOrigin()<<endl;
+   cout << "TP: "<<proj.getUlGpt()<<endl;
+   cout << "GSD: "<<proj.getMetersPerPixel() << endl;
+   cout << "Deg/pixel: "<<proj.getDecimalDegreesPerPixel() << endl;
+   proj.lineSampleHeightToWorld(ipt_ul, 0.0, gpt);
+   cout << "UL: " <<gpt << endl;
+   proj.lineSampleHeightToWorld(ipt_lr, 0.0, gpt);
+   cout << "LR: " <<gpt << endl;
+
+   proj.setUlTiePoints(gpt_ul);
+
+   cout << "\n Tiepoint reset to UL ***************"<<endl;
+   cout << "ORIG: "<<proj.getOrigin()<<endl;
+   cout << "TP: "<<proj.getUlGpt()<<endl;
+   cout << "GSD: "<<proj.getMetersPerPixel() << endl;
+   cout << "Deg/pixel: "<<proj.getDecimalDegreesPerPixel() << endl;
+   proj.lineSampleHeightToWorld(ipt_ul, 0.0, gpt);
+   cout << "UL: " <<gpt << endl;
+   proj.lineSampleHeightToWorld(ipt_lr, 0.0, gpt);
+   cout << "LR: " <<gpt << endl;
+
+   return 0;
+}
diff --git a/test/src/projection/ossim-image-geometry-test.cpp b/test/src/projection/ossim-image-geometry-test.cpp
new file mode 100644
index 0000000..df72a72
--- /dev/null
+++ b/test/src/projection/ossim-image-geometry-test.cpp
@@ -0,0 +1,362 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test app for image geometries.  Prints out projection keyword
+// list.  Performs lineSampleToWorld, worldToLineSample, lineSampleToWorld
+// round trip dumping points and delta on image points.  Dumps elevation cells
+// used.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-image-geometry-test.cpp 22201 2013-03-20 00:53:33Z dburken $
+
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <sstream>
+#include <ctime>
+using namespace std;
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimCommon.h>
+#include <ossim/base/ossimDpt.h>
+#include <ossim/base/ossimDrect.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/elevation/ossimElevManager.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/projection/ossimMapProjection.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimProjectionFactoryRegistry.h>
+
+// Points in one direction.  If 5, will get 5X5 or 25.
+static const ossim_int32 POINTS = 5; 
+
+static std::string getDate()
+{
+// Get the build date in the format of (yyyymmdd).
+   char s[9];
+   s[8] = '\0';
+   time_t t;
+   time(&t);
+   tm* lt = localtime(&t);
+   strftime(s, 9, "%Y%m%d", lt);
+   std::string date = s;
+   return date;
+}
+
+static void usage()
+{
+   cout << "ossimGeometryTest <imagefile>"
+        << "\nTest image geometry." << endl;
+}
+
+static const ossim_uint32 W = 14;
+
+static void print(const std::string& prefix,
+                  const ossimDpt& ipt,
+                  const ossimGpt& wpt,
+                  const ossimDpt& rpt)
+{
+   ossimDpt delta = ipt - rpt;
+   ossim_uint32 w =
+      (prefix.size() < W) ? (W - prefix.size()) : prefix.size();
+                                                     
+   cout << std::setfill(' ') << setiosflags(ios::left) 
+        << prefix << std::setw(w) << "ipt:" << ipt.toString().c_str() << "\n"
+        << prefix << std::setw(w) << "wpt:" << wpt.toString().c_str() << "\n"
+        << prefix << std::setw(w) << "rpt:" << rpt.toString().c_str() << "\n"
+        << prefix << std::setw(w) << "delta:" << delta.toString() << "\n\n";
+}
+
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 2)
+   {
+      usage();
+      return 0;
+   }
+
+   ossimFilename imageFile = argv[argc - 1];
+
+   if ( !imageFile.exists() )
+   {
+      usage();
+      return 1;
+   }
+
+   // Open up an image handler.
+   ossimRefPtr<ossimImageHandler> ih
+      = (ossimImageHandler*)ossimImageHandlerRegistry::instance()->open(
+         ossimFilename(argv[argc - 1]));
+   if ( !ih )
+   {
+      cerr << "Could not open: " << imageFile << endl;
+      return 1;
+   }
+
+   cout << "image_file:  " << imageFile << "\n";
+
+   // cout << "date_yyyymmdd: " << getDate().c_str() << "\n"; 
+   
+   // Get the entry list:
+   std::vector<ossim_uint32> entryList;
+   ih->getEntryList(entryList);
+   
+   std::vector<ossim_uint32>::const_iterator entry = entryList.begin();
+   while ( entry != entryList.end() )
+   {
+      cout << "entry_index:  " << (*entry) << "\n";
+      ih->setCurrentEntry( (*entry) );
+
+      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+
+      if ( geom.valid() )
+      {
+#if 1    /* Comment out to disable elevation for map projections. */
+         ossimRefPtr<ossimProjection> proj = geom->getProjection();
+         if (proj.valid() )
+         {
+            ossimRefPtr<ossimMapProjection> mp = PTR_CAST(ossimMapProjection, proj.get());
+            if (mp.valid())
+            {
+               cout << "setting elev lookup flag..." << endl;
+               mp->setElevationLookupFlag(true);
+            }
+         }
+#endif
+         ossimKeywordlist kwl;
+         geom->saveState(kwl, 0);
+         cout << kwl << "\n";
+
+         ossimDrect rect = ih->getImageRectangle(0);
+
+         cout << "image_rect: " << rect << "\n\n";
+
+         // Do forward, inverse, forward on corners and center.
+
+         std::string prefix;
+         ossimDpt ipt;  // image point
+         ossimDpt rpt;  // round trip image point
+         ossimGpt wpt;  // world point
+
+         // Upper left:
+         prefix = "ul.";
+         ipt = rect.ul();
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // Upper right:
+         prefix = "ur.";
+         ipt = rect.ur();
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // Lower right:
+         prefix = "lr.";
+         ipt = rect.lr();
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // Lower left:
+         prefix = "ll.";
+         ipt = rect.ll();
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // center:
+         prefix = "center.";
+         ipt = rect.midPoint();
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         geom->setTargetRrds(2);
+         cout << "geometry target rrds set to: " << geom->getTargetRrds() << "\n\n";
+         
+         // Upper left:
+         prefix = "ul-r2.";
+         geom->rnToRn(rect.ul(), 0, 2, ipt);
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // Upper right:
+         prefix = "ur-r2.";
+         geom->rnToRn(rect.ur(), 0, 2, ipt);
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // Lower right:
+         prefix = "lr-r2.";
+         geom->rnToRn(rect.lr(), 0, 2, ipt);
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // Lower left:
+         prefix = "ll-r2.";
+         ipt = rect.ll();
+         geom->rnToRn(rect.ll(), 0, 2, ipt);
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // center:
+         prefix = "center-r2.";
+         ipt = rect.midPoint();
+         geom->rnToRn(ipt, 0, 2, ipt);
+         geom->localToWorld(ipt, wpt);
+         geom->worldToLocal(wpt, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         // Test rnToWorld and world to rn:
+         cout << "testing rnToWorld and worldToRn:\n\n";
+         prefix = "center-r3.";
+         ipt = rect.midPoint();
+         geom->rnToRn(ipt, 0, 3, ipt);
+         geom->rnToWorld(ipt, 3, wpt);
+         geom->worldToRn(wpt, 3, rpt);
+         print(prefix, ipt, wpt, rpt);
+
+         geom->setTargetRrds(0);
+         cout << "geometry target rrds set to: " << geom->getTargetRrds() << "\n\n";
+
+         prefix = "center-r3.";
+         ipt = rect.midPoint();
+         geom->rnToRn(ipt, 0, 3, ipt);
+         geom->rnToWorld(ipt, 3, wpt);
+         geom->worldToRn(wpt, 3, rpt);
+         print(prefix, ipt, wpt, rpt);
+         
+
+         ossim_int32 tenthW  = rect.width()  / POINTS;
+         ossim_int32 tenthH  = rect.height() / POINTS;
+         ossim_int32 offW    = tenthW / 2;
+         ossim_int32 offH    = tenthH / 2;
+         ossimIpt    ul      = rect.ul();
+         ossimIpt    lr      = rect.lr();
+         ossim_int32 ptIndex = 0;
+
+         // Line loop:
+         for (ossim_int32 y = ul.y+offH; y < lr.y; y += tenthH)
+         {
+            ipt.y = y;
+            
+            // Sample loop:
+            for (ossim_int32 x = ul.x+offW; x < lr.x; x += tenthW)
+            {
+               ipt.x = x;
+
+               std::ostringstream s;
+               s << std::setfill('0') << setiosflags(ios::right) 
+                 << "pt" << std::setw(3) << ptIndex << ".";
+               prefix = s.str();
+               geom->localToWorld(ipt, wpt);
+               geom->worldToLocal(wpt, rpt);
+               print(s.str(), ipt, wpt, rpt);
+
+               ++ptIndex;
+            }
+         }
+
+         // Test the decimationFactors method.
+         ossim_uint32 level;
+         std::vector<ossimDpt> decimations;
+         geom->decimationFactors(decimations);
+         
+         for (level = 0; level < decimations.size(); ++level)
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "decimation[" << level << "]: " << decimations[level]
+               << std::endl;
+         }
+         
+         bool isAffectedByElevation = geom->isAffectedByElevation();
+         ossimNotify(ossimNotifyLevel_DEBUG)
+            << "\nImage projection " << ( isAffectedByElevation ? "is" : "isn't")
+            << " affected by elevation." << std::endl;
+         
+         // Test up is code:
+         if ( isAffectedByElevation )
+         {
+            ossim_float64 upIsUpAngle = geom->upIsUpAngle();
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "\nUp is up rotation angle: " << upIsUpAngle << "\n" << std::endl;
+         }
+         
+#if 0 /* commented out as one time test is good */
+         
+         // Test the decimationFactor method.
+         ossimDpt decimation;
+         geom->decimationFactors(decimations);
+         ossim_float64 r0_lines = ih->getNumberOfLines(0);
+         ossim_float64 r0_samps = ih->getNumberOfSamples(0);
+         
+         for (level = 0; level < geom->getNumberOfDecimations(); ++level)
+         {
+            geom->decimationFactor(level, decimation);
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "decimation[" << level << "]:          " << decimation
+               << "\nlines[" << level << "]:             " << ih->getNumberOfLines(level)
+               << "\nsamples[" << level << "]:           " << ih->getNumberOfSamples(level)
+               << "\ncomputed lines[" << level << "]:    " << (r0_lines * decimation.y)
+               << "\ncomputed samples[" << level << "]:  " << (r0_samps * decimation.x)
+               << std::endl;
+         }
+#endif
+
+         // Print out transform, if any:
+         if ( geom->getTransform() != 0 )
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "Image geometry 2d To 2d transform:\n"
+               << *(geom->getTransform()) << "\n";
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_DEBUG)
+               << "Image geometry has no 2d To 2d transform.\n";
+         }
+            
+         
+      }
+      
+      ++entry; // Go to next entry.
+      
+   } // matches: while ( entry != entryList.end() )
+
+#if 0
+   // Dump the elevation cells used:
+   std::vector<ossimFilename> cells;
+   ossimElevManager::instance()->getOpenCellList(cells);
+
+   for (ossim_uint32 cellIndex = 0; cellIndex < cells.size(); ++cellIndex)
+   {
+      std::ostringstream s;
+      s << std::setfill('0')
+        << "cell" << std::setw(3) << cellIndex << ": ";
+
+      cout << std::setfill(' ') << setiosflags(ios::left) << std::setw(W)
+           << s.str().c_str() << cells[cellIndex] << "\n";
+   }
+
+   cout << endl;
+#endif
+   return 0;
+}
+
diff --git a/test/src/projection/ossim-nitf-rsm-model-test.cpp b/test/src/projection/ossim-nitf-rsm-model-test.cpp
new file mode 100644
index 0000000..0c3a316
--- /dev/null
+++ b/test/src/projection/ossim-nitf-rsm-model-test.cpp
@@ -0,0 +1,467 @@
+//---
+// File: ossim-nitf-rsm-model-test.cpp
+//
+// Description: Test app for ossimNitfRsmModel class.
+// 
+//---
+
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimGpt.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/imaging/ossimImageGeometry.h>
+#include <ossim/imaging/ossimImageHandler.h>
+#include <ossim/imaging/ossimImageHandlerRegistry.h>
+#include <ossim/projection/ossimNitfRsmModel.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/projection/ossimRsmModel.h>
+#include <ossim/support_data/ossimNitfRegisteredTag.h>
+#include <ossim/support_data/ossimNitfRsmecaTag.h>
+#include <ossim/support_data/ossimNitfRsmidaTag.h>
+#include <ossim/support_data/ossimNitfRsmpcaTag.h>
+#include <ossim/support_data/ossimNitfRsmpiaTag.h>
+#include <ossim/support_data/ossimNitfTagFactoryRegistry.h>
+
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <string>
+#include <vector>
+
+using namespace std;
+
+static ossimRefPtr<ossimNitfRegisteredTag> getTag( const std::string& tagLine );
+static ossimRefPtr<ossimNitfRsmModel> getModel( const ossimFilename& file );
+static ossimRefPtr<ossimNitfRsmModel> getModelFromExtFile( const ossimFilename& file );
+static ossimRefPtr<ossimNitfRsmModel> getModelFromImage( const ossimFilename& file );
+static void testGpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl );
+static void testIpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl );
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if ( argc == 3 )
+   {
+      ossimFilename file = argv[1];
+      ossimKeywordlist kwl;
+      if ( kwl.addFile( argv[2] ) )
+      {
+         ossimRefPtr<ossimNitfRsmModel> model = getModel( file );
+         if ( model.valid() )
+         {
+            testGpts( model, kwl );
+            testIpts( model, kwl );
+         }
+         else
+         {
+            cerr << "Could not create model!" << endl;
+         }
+      }
+      else
+      {
+         cerr << "Could not open keyword list: " << argv[2] << endl;
+      }  
+   }
+   else
+   {
+      cout << "\n" << argv[0] << " <input-test-file> <options.kwl>"
+           << "\ninput-test-file can be an input test file or a test.ext file.\n"
+           << "\nPrints out debug info for model testing.."
+           << "\ngpts test:"
+           << "\nmodel->worldToLineSample(...), model->lineSampleToWorld(...)"
+           << "\nipts test:"
+           << "\nmodel->lineSampleHeightToWorld(...), model->worldToLineSample(...)"
+           << "\noptions.kwl format example:\n"
+
+           << "\n// Input line, sample type: area=upper left corner, point = center of pixel."
+           << "\n// pixel_type: area"
+
+           << "\ngtest_id0: E123456\n"
+           << "gtest_gpt0: ( lat, lon, hgt )\n"
+
+           << "gtest_gpt_id1: E123457\n"
+           << "gtest_gpt1: ( lat, lon, hgt )\n"
+
+           << "ggtest_pt_id2: E123458\n"
+           << "gtest_gpt2: ( lat, lon, hgt )\n"
+
+           << "gtest_gpt_id3: E123459\n"
+           << "gtest_gpt3: ( lat, lon, hgt )\n"
+
+           << "gtest_gpt_id4: E123459\n"
+           << "gtest_pt4: ( lat, lon, hgt )\n"
+
+           << "\nitest_height_units: feet\n"
+         
+           << "itest_id0: E123456\n"
+           << "itest_ipt0: ( sample, line )\n"
+           << "itest_hgt0: hgt\n"
+         
+           << "itest_id1: E123457\n"
+           << "itest_ipt1: ( x, y )\n"
+           << "itest_hgt1: hgt\n"
+
+           << "itest_id2: E123458\n"
+           << "itest_ipt2: ( x, y )\n"
+           << "itest_hgt2: hgt\n"
+
+           << "itest_id3: E123459\n"
+           << "itest_ipt3: ( x, y )\n"
+           << "itest_hgt3: hgt\n"
+
+           << "itest_id4: E123459\n"
+           << "itest_ipt4: ( x, y )\n"
+           << "itest_hgt4: hgt\n"
+
+           << "\nNotes:\n"
+           << "* itest_hgt default = meters if units not specified.\n"
+           << "* gpt0: ( lat, lon, hgt ) \"hgt\" is in meters.\n"
+           << "* All test height output is in meters.\n"
+           << "* \"rtd\"=round trip delta.\n"
+           << endl;
+   }
+
+   return 0;
+}
+
+
+ossimRefPtr<ossimNitfRegisteredTag> getTag( const std::string& tagLine )
+{
+   ossimRefPtr<ossimNitfRegisteredTag> result = 0;
+
+   if ( tagLine.size() > 6 )
+   {
+      ossimString tagName = tagLine.substr(0, 6);
+      result = ossimNitfTagFactoryRegistry::instance()->create( tagName );
+      if ( result.valid() )
+      {
+         cout << "tag_name: " << tagName << "\n";
+         
+         istringstream is( tagLine );
+         if ( is.good() )
+         {
+            is.seekg( 6 );
+            char tagLength[6];
+            tagLength[5] = '\0';
+            is.read( tagLength, 5 );
+            cout << "tag_length: " << tagLength << "\n";
+            result->parseStream( is );
+
+            result->print( cout, std::string("") );
+         }
+      }
+      else
+      {
+         cerr << "unhandled_tag: " << tagName << endl;
+      }
+   }
+   return result;
+}
+
+ossimRefPtr<ossimNitfRsmModel> getModel( const ossimFilename& file )
+{
+   ossimRefPtr<ossimNitfRsmModel> result = 0;
+   if ( file.size() )
+   {
+      // Get downcased extension:
+      std::string ext = file.ext().downcase().string();
+      
+      if ( ext == "ext" )
+      {
+         result = getModelFromExtFile( file );
+      }
+      else if ( ( ext == "ntf" ) || ( ext == "nitf" ) )
+      {
+         result = getModelFromImage( file );
+      }
+   }
+   return result;
+}
+
+ossimRefPtr<ossimNitfRsmModel> getModelFromExtFile( const ossimFilename& file )
+{
+   ossimRefPtr<ossimNitfRsmModel> result = 0;
+
+   if ( file.exists() )
+   {
+      result = new ossimNitfRsmModel();
+      if ( result->parseFile( file, 0 ) ) // Hard coded entry index of 0 for now.
+      {
+         cout << "Initialize from ext file success!" << endl;
+      }
+      else
+      {
+         result = 0;
+         cerr << "Could not open: " << file << endl;
+      }
+   }
+   else
+   {
+     cerr << "File does not exists: " << file << endl;
+   }
+
+   return result;
+   
+} // End: getModelFromExtFile(...)
+
+
+ossimRefPtr<ossimNitfRsmModel> getModelFromImage( const ossimFilename& file )
+{
+   ossimRefPtr<ossimNitfRsmModel> result = 0;
+
+   ossimRefPtr<ossimImageHandler> ih =
+      ossimImageHandlerRegistry::instance()->open(file,
+                                                  true,   // try suffix first
+                                                  false); // open overview
+   if ( ih.valid() )
+   {
+      ossimRefPtr<ossimImageGeometry> geom = ih->getImageGeometry();
+      if ( geom.valid() )
+      {
+         ossimRefPtr<ossimProjection> proj = geom->getProjection();
+         if ( proj.valid() )
+         {
+            result = dynamic_cast<ossimNitfRsmModel*>( proj.get() );
+         }
+      }
+   }
+   
+   return result;  
+}
+
+void testGpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl )
+{
+   if ( model.valid() )
+   {
+      cout << std::setfill(' ') << setiosflags(ios::left);
+      
+      const std::string  ID_KW  = "gtest_id";
+      const std::string  GPT_KW = "gtest_gpt";
+      const ossim_uint32 POINTS = kwl.numberOf( ID_KW.c_str() );
+      
+      cout << "\ngtest begin ********************************\n\n"
+           << "number_of_points_world_points: " << POINTS << "\n";
+      
+      ossim_uint32 foundPts = 0;
+      ossim_uint32 i = 0;
+      
+      std::string key;
+      std::string value;
+      
+      while ( foundPts < POINTS )
+      {
+         // ID:
+         key = ID_KW + ossimString::toString( i ).string();
+         value = kwl.findKey( key );
+         if ( value.size() )
+         {
+            cout << "gtest_id" << std::setw(6) << i << ":  " << value << "\n";
+         }
+      
+         // World point :
+         key = GPT_KW + ossimString::toString( i ).string();
+         value = kwl.findKey( key );
+      
+         if ( value.size() )
+         {
+            ossimDpt ipt; // image point
+            ossimGpt wpt; // world point
+            ossimGpt rtp; // round trip point
+            ossimDpt rtd; // round trip delta;
+         
+            wpt.toPoint( value );
+
+            cout << "gtest_gpt" << std::setw(5) << i << ":  " << wpt << "\n";
+
+            model->worldToLineSample( wpt, ipt );
+
+            if ( wpt.hasNans() == false )
+            {
+               model->lineSampleHeightToWorld( ipt, wpt.hgt, rtp );
+            
+               rtd.x = wpt.lon - rtp.lon;
+               rtd.y = wpt.lat - rtp.lat;
+            
+               cout << "gtest_ipt" << std::setw(5) << i << ":  " << ipt << "\n"
+                    << "gtest_rtp" << std::setw(5) << i << ":  " << rtp << "\n"
+                    << "gtest_rtd" << std::setw(5) << i << ":  " << rtd << "\n\n";  
+            }
+            else
+            {
+               cerr << "model->worldToLineSample(...) result has nans!\n"
+                    << wpt << endl;
+            }
+         
+            ++foundPts;
+         }
+      
+         ++i;
+      
+         if ( i > POINTS+100 )
+         {
+            break;
+         }
+      }
+
+      cout << "\ngtest end **********************************\n\n";
+   }
+   
+} // End: testGpts
+
+void testIpts( ossimRefPtr<ossimNitfRsmModel>& model, const ossimKeywordlist& kwl )
+{
+   if ( model.valid() )
+   {
+      cout << std::setfill(' ') << setiosflags(ios::left);
+
+      const std::string  ID_KW      = "itest_id";
+      const std::string  IPT_KW     = "itest_ipt";
+      const std::string  IPT_GT_KW  = "itest_gt"; // ground truth      
+      const std::string  IPT_HGT_KW = "itest_hgt";
+      const ossim_uint32 POINTS     = kwl.numberOf( ID_KW.c_str() );
+   
+      // Test data height values can be in feet.
+      ossimUnitType heightUnits = OSSIM_METERS;
+      std::string key = "itest_height_units";
+      std::string value = kwl.findKey( key );
+      if ( value.size() )
+      {
+         cout << key << ": " << value << "\n";
+         if ( value == "feet" )
+         {
+            heightUnits = OSSIM_FEET;
+         }
+      }
+
+      // Test the pixel type.
+      ossim_float64 iptShift = 0.0;
+      key = "pixel_type";
+      value = kwl.findKey( key );
+      if ( value.size() )
+      {
+         if ( value == "area" )
+         {
+            iptShift = -0.5;
+            cout << key << ": " << value << "\n";
+            cout << "input_line_sample_shift: " << iptShift << "\n";
+         }
+      }     
+      
+      cout << "\nitest begin ********************************\n\n"
+           << "number_of_line_sample_points: " << POINTS << "\n";
+      
+      ossim_uint32 foundPts = 0;
+      ossim_uint32 i = 0;
+
+      while ( foundPts < POINTS )
+      {
+         // ID:
+         key = ID_KW + ossimString::toString( i ).string();
+         value = kwl.findKey( key );
+         if ( value.size() )
+         {
+            cout << "itest_id" << std::setw(9) << i << ":  " << value << "\n";
+         }
+      
+         // Image point, sample, line:
+         key = IPT_KW + ossimString::toString( i ).string();
+         value = kwl.findKey( key );
+      
+         if ( value.size() )
+         {
+            ossimDpt ipt; // image point
+            ossimGpt wpt; // world point
+            ossimGpt gt;  // ground truth
+            ossimDpt gtd; // wpt to gt delta
+            ossimDpt rtp; // round trip point
+            ossimDpt rtd; // round trip delta;
+         
+            ipt.toPoint( value );
+            ipt.x += iptShift;
+            ipt.y += iptShift;
+         
+            cout << "itest_ipt" << std::setw(8) << i << ":  " << value << "\n";
+         
+            // Get the height above ellipsoid:
+            ossim_float64 hgt = 0.0;
+            key = IPT_HGT_KW + ossimString::toString( i ).string();
+            value = kwl.findKey( key );
+            if ( value.size() )
+            {
+               ossimString os ( value );
+               hgt = os.toFloat64();
+            
+               if ( heightUnits == OSSIM_FEET )
+               {
+                  hgt *= MTRS_PER_FT;
+               }
+            }
+            else
+            {
+               cerr << "missing height above ellipsoid for point!  Using 0.0."
+                    << endl;
+            }
+         
+            cout << "itest_hgt" << std::setw(8) << i << ":  " << value << "\n";
+         
+            model->lineSampleHeightToWorld( ipt, hgt, wpt );
+
+            cout << "itest_wpt" << std::setw(8) << i << ":  " << wpt << "\n";
+            
+            if ( wpt.hasNans() == false )
+            {
+               model->worldToLineSample( wpt, rtp );
+               
+               // Get the ground truth;
+               key = IPT_GT_KW + ossimString::toString( i ).string();
+               value = kwl.findKey( key );
+               if ( value.size() )
+               {
+                  gt.toPoint( value );
+                  cout << "itest_gt" << std::setw(9) << i << ":  " << gt << "\n";
+                  if ( gt.isNan() == false )
+                  {
+                     gtd.x = wpt.lon - gt.lon;
+                     gtd.y = wpt.lat - gt.lat;
+                     ossimDpt mpd = wpt.metersPerDegree();
+                     ossimDpt gtm;
+                     gtm.x = gtd.x * mpd.x;
+                     gtm.y = gtd.y * mpd.y;
+                     cout << "itest_gtd_dd" << std::setw(5) << i << ":  " << gtd << "\n";
+                     cout << "itest_gtd_mtrs" << std::setw(3) << i << ":  " << gtm << "\n";                     
+                  }
+               }
+               else
+               {
+                  gt.makeNan();
+               }
+            
+               rtd = ipt - rtp;
+               
+               cout << "itest_rtp" << std::setw(8) << i << ":  " << rtp << "\n"
+                    << "itest_rtd" << std::setw(8) << i << ":  " << rtd << "\n\n";
+            }
+            else
+            {
+               cerr << "model->worldToLineSample(...) result has nans!\n"
+                    << wpt << endl;
+            }
+         
+            ++foundPts;
+         }
+      
+         ++i;
+      
+         if ( i > POINTS+100 )
+         {
+            break;
+         }
+      }
+
+      cout << "\ntestIpts end **********************************\n\n";
+   }
+   
+} // End: testIpts
diff --git a/ossim/src/test/ossim-projection-factory-test.cpp b/test/src/projection/ossim-projection-factory-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-projection-factory-test.cpp
rename to test/src/projection/ossim-projection-factory-test.cpp
diff --git a/ossim/src/test/ossim-projection-test.cpp b/test/src/projection/ossim-projection-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-projection-test.cpp
rename to test/src/projection/ossim-projection-test.cpp
diff --git a/ossim/src/test/ossim-wkt-proj-factory-test.cpp b/test/src/projection/ossim-wkt-proj-factory-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-wkt-proj-factory-test.cpp
rename to test/src/projection/ossim-wkt-proj-factory-test.cpp
diff --git a/ossim/src/test/ossim-wkt-test.cpp b/test/src/projection/ossim-wkt-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-wkt-test.cpp
rename to test/src/projection/ossim-wkt-test.cpp
diff --git a/test/src/support_data/CMakeLists.txt b/test/src/support_data/CMakeLists.txt
new file mode 100644
index 0000000..a017e30
--- /dev/null
+++ b/test/src/support_data/CMakeLists.txt
@@ -0,0 +1,10 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+OSSIM_SETUP_APPLICATION(ossim-aux-dot-xml-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-aux-dot-xml-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-envi-hdr-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-envi-hdr-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-fgdc-txt-doc-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-fgdc-txt-doc-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-quickbird-metadata-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-quickbird-metadata-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-srtm-support-data-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-srtm-support-data-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-tiff-info-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-tiff-info-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-wavelength-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-wavelength-test.cpp)
+
diff --git a/ossim/src/test/ossim-aux-dot-xml-test.cpp b/test/src/support_data/ossim-aux-dot-xml-test.cpp
similarity index 100%
rename from ossim/src/test/ossim-aux-dot-xml-test.cpp
rename to test/src/support_data/ossim-aux-dot-xml-test.cpp
diff --git a/test/src/support_data/ossim-envi-hdr-test.cpp b/test/src/support_data/ossim-envi-hdr-test.cpp
new file mode 100644
index 0000000..0b0d9af
--- /dev/null
+++ b/test/src/support_data/ossim-envi-hdr-test.cpp
@@ -0,0 +1,48 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test app for ossimEnviHeader class.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+#include <iostream>
+using namespace std;
+
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 2)
+   {
+      cout << argv[0] << " <envi_header_file>"
+           << "\nOpen, parse and print ossimEnviHeader object." << endl;
+      return 0;
+   }
+
+   cout << "ossimEnviHeader test:\n";
+
+   ossimEnviHeader hdr;
+   if ( hdr.open( ossimFilename( argv[1] ) ) )
+   {
+      ossimString s = "Hello world...";
+      hdr.setDescription( s );
+      
+      cout << hdr << endl;
+   }
+   else
+   {
+      cout << "Could not open: " << argv[1] << endl;
+   }
+
+   return 0;
+}
diff --git a/test/src/support_data/ossim-fgdc-txt-doc-test.cpp b/test/src/support_data/ossim-fgdc-txt-doc-test.cpp
new file mode 100644
index 0000000..a61e8a1
--- /dev/null
+++ b/test/src/support_data/ossim-fgdc-txt-doc-test.cpp
@@ -0,0 +1,73 @@
+//----------------------------------------------------------------------------
+//
+// File ossim-fgdc-txt-doc-test.cpp
+// 
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimFgdcTxtDoc class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-info-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/projection/ossimProjection.h>
+#include <ossim/support_data/ossimFgdcTxtDoc.h>
+
+#include <iostream>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   ossimArgumentParser ap(&argc, argv);
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(ap);
+
+   if ( ap.argc() == 2 )
+   {
+      try
+      {
+         // Test the ossimFgdcTxtDoc
+         ossimRefPtr<ossimFgdcTxtDoc> fgdcDoc = new ossimFgdcTxtDoc();
+         ossimFilename file(argv[1]);
+         if ( fgdcDoc->open( file ) )
+         {
+            cout << "opened: " << file << endl;
+            ossimRefPtr<ossimProjection> proj;
+            fgdcDoc->getProjection(proj);
+            if ( proj.valid() )
+            {
+               proj->print(cout);
+            }
+
+            std::string units;
+            fgdcDoc->getAltitudeDistanceUnits(units);
+            cout << "units: " << units << endl;
+         }
+         
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         return 1;
+      }
+      
+   }  // End: if ( ( ap.argc() == 2 ) ...
+   else
+   {
+      cout << argv[0] << " <FGDC-text-doc.txt>\nTest ossimFgdcTxtDoc class..." << endl;
+   }
+   
+   return 0;
+   
+} // End of main...
diff --git a/test/src/support_data/ossim-quickbird-metadata-test.cpp b/test/src/support_data/ossim-quickbird-metadata-test.cpp
new file mode 100644
index 0000000..5532aad
--- /dev/null
+++ b/test/src/support_data/ossim-quickbird-metadata-test.cpp
@@ -0,0 +1,73 @@
+//---
+// License: MIT
+//
+// File: ossim-quickbird-metadata-test.cpp
+//
+// Description: Test code for Quickbird/Digital Globe dot.IMD file.
+//---
+// $Id$
+
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/support_data/ossimQuickbirdMetaData.h>
+#include <iostream>
+
+using namespace std;
+
+static void usage()
+{
+   cout << "ossim-quickbird-metadata-test <IMD_file>" << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   int returnCode = 0;
+
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc == 2)
+   {
+      try
+      {
+         ossimFilename file = argv[argc - 1];
+         if ( file.exists() )
+         {
+            ossimQuickbirdMetaData md;
+            if ( md.open( file ) )
+            {
+               md.print( cout );
+            }
+
+            ossimKeywordlist kwl;
+            if ( md.getMapProjectionKwl( file, kwl ) == true )
+            {
+               cout << "kwl:\n" << kwl << endl;
+            }
+         }
+         else
+         {
+            usage();
+            returnCode = 1;
+         }
+      }
+      catch(const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         returnCode = 1;
+      }
+      catch( ... )
+      {
+         ossimNotify(ossimNotifyLevel_WARN)
+            << "ossim-foo caught unhandled exception!" << std::endl;
+         returnCode = 1;
+      }
+   }
+   else
+   {
+      usage();
+   }
+   
+   return returnCode;
+}
diff --git a/test/src/support_data/ossim-srtm-support-data-test.cpp b/test/src/support_data/ossim-srtm-support-data-test.cpp
new file mode 100644
index 0000000..fe95e1a
--- /dev/null
+++ b/test/src/support_data/ossim-srtm-support-data-test.cpp
@@ -0,0 +1,48 @@
+//----------------------------------------------------------------------------
+// Copyright (C) 2005 David Burken, all rights reserved.
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application / example code for srtm support data class.
+// and using it.
+//
+// $Id: ossim-srtm-support-data-test.cpp 23497 2015-08-28 15:28:59Z okramer $
+//----------------------------------------------------------------------------
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/support_data/ossimSrtmSupportData.h>
+#include <ossim/base/ossimKeywordlist.h>
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 2)
+   {
+      cout << "usage:  " << argv[0] << " srtm_file" << endl;
+      return 0;
+   }
+
+   ossimSrtmSupportData sd;
+   if (sd.setFilename(ossimFilename(argv[1]), true))
+   {
+      cout << sd << endl;
+
+      ossimKeywordlist kwl;
+      sd.getImageGeometry(kwl);
+      cout << "geometry file:\n" << kwl << endl;
+   }
+   else
+   {
+      cout << "Could not open:  " << argv[1] << endl;
+   }
+   
+   return 0;
+}
diff --git a/test/src/support_data/ossim-tiff-info-test.cpp b/test/src/support_data/ossim-tiff-info-test.cpp
new file mode 100644
index 0000000..1a12c35
--- /dev/null
+++ b/test/src/support_data/ossim-tiff-info-test.cpp
@@ -0,0 +1,82 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test app for ossimTiffInfo class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-tiff-info-test.cpp 19751 2011-06-13 15:13:07Z dburken $
+
+#include <iostream>
+using namespace std;
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/support_data/ossimTiffInfo.h>
+#include <ossim/support_data/ossimGeoTiff.h>
+
+
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 2)
+   {
+      cout << argv[0] << "<tiff_file>"
+           << "\nPrint dump and geometry info for tiff_file." << endl;
+      return 0;
+   }
+
+   cout << "ossimTiffInfo test:\n";
+   
+   ossimTiffInfo* info = new ossimTiffInfo();
+
+   if ( info->open( ossimFilename(argv[1]) ) )
+   {
+      cout << "ossimTiffInfo dump info:\n";
+      info->print(cout);
+
+      ossimKeywordlist kwl;
+      if ( info->getImageGeometry(kwl, 0) )
+      {
+         cout << "ossimTiffInfo geometry info:\n" << kwl << endl;
+      }
+      else
+      {
+         cout << "ossimTiffInfo get image geometry failed..." << endl;
+      }
+   }
+   else
+   {
+      cout << "Could not open: " << argv[1] << endl;
+   }
+
+   delete info;
+   info = 0;
+
+   cout << "ossimGeoTiff test:\n";
+   
+   ossimGeoTiff* gtif = new ossimGeoTiff();
+   if ( gtif->readTags(argv[1], 0) )
+   {
+      ossimKeywordlist kwl;
+      if ( gtif->addImageGeometry(kwl, 0) )
+      {
+         cout << "ossimGeoTiff geometry info:\n" << kwl << endl;
+      }
+      else
+      {
+         cout << "ossimGeoTiff get image geometry failed..." << endl;
+      }
+   }
+
+   delete gtif;
+   gtif = 0;
+
+   return 0;
+}
diff --git a/test/src/support_data/ossim-wavelength-test.cpp b/test/src/support_data/ossim-wavelength-test.cpp
new file mode 100644
index 0000000..7b3528a
--- /dev/null
+++ b/test/src/support_data/ossim-wavelength-test.cpp
@@ -0,0 +1,127 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Description:
+//
+// Test app for ossimWavelength class.
+// 
+//----------------------------------------------------------------------------
+// $Id$
+
+#include <ossim/init/ossimInit.h>
+#include <ossim/support_data/ossimEnviHeader.h>
+#include <ossim/support_data/ossimWavelength.h>
+
+#include <iostream>
+#include <vector>
+using namespace std;
+
+static void usage()
+{
+   cout << "\nUsage:\nossim-wavelength-test <envi-header-file> <wavelength> <threshold_from_center>"
+        << "\nWill output found closest index and wavelength."
+        << "Note: Units in nanometers"
+        << "\nContents of minimal header file:"
+        << "\nwavelength units = Nanometers"
+        << "\nwavelength = {374.323608,  382.530487,  390.737427,  398.944336,  407.150970}"
+        << "\n" << endl;
+}
+
+int main(int argc, char *argv[])
+{
+   ossimInit::instance()->initialize(argc, argv);
+
+   if (argc != 4)
+   {
+      usage();
+      return 0;
+   }
+
+   ossimFilename hdrFile                   = argv[argc - 3];
+   ossimString   waveLengthString          = argv[argc - 2];
+   ossimString   thresholdFromCenterString = argv[argc - 1];
+   ossim_float64 wavelength                = waveLengthString.toFloat64();
+   ossim_float64 thresholdFromCenter       = thresholdFromCenterString.toFloat64();
+   
+
+   cout << "header file: " << hdrFile
+        << "\nwavelength:  " << waveLengthString
+        << "\nthreshold from center: " << thresholdFromCenterString
+        << "\n";
+
+   if ( hdrFile.exists() )
+   {
+      ossimEnviHeader hdr;
+      if ( hdr.open( hdrFile ) )
+      {
+         ossimWavelength wl;
+         if ( wl.initialize( hdr ) )
+         {
+            cout << "\nossimWavelength::getRgbBands returned:\n";
+            std::vector<ossim_uint32> bands;
+            ossim_uint32 band = 0;
+            if ( wl.getRgbBands( bands ) )
+            {
+               std::vector<ossim_uint32>::const_iterator i = bands.begin();
+               while ( i != bands.end() )
+               {
+                  cout << "band[" << band << "]: " << (*i) << "\n";
+                  ++band;
+                  ++i;
+               }
+            }
+            else
+            {
+               cout << "error...\n";
+            }
+
+            cout << "\nossimWavelength::findClosestIterator(...) returned:\n";
+            ossimWavelength::WavelengthMap::const_iterator i =
+               wl.findClosestIterator( wavelength, thresholdFromCenter );
+            if ( i != wl.end() )
+            {
+               cout << "(*i).first: " << (*i).first << " (*i).second: " << (*i).second << "\n";
+            }
+            else
+            {
+               cout << "error...\n";
+            }
+
+            cout << "\nossimWavelength::findClosestIndex(...) returned:\n";
+            ossim_int32 index = wl.findClosestIndex( wavelength, thresholdFromCenter );
+            if ( index > -1 )
+            {
+               cout << "index: " << index << "\n";
+            }
+            else
+            {
+               cout << "error...\n";
+            }
+
+
+            
+         }
+         else
+         {
+            cerr << "ossimWavelength::initialize( ossimEnviHeader ) failed!" << endl;
+         }
+      }
+      else
+      {
+         cout << "Could not open: " << hdrFile << endl;
+      }
+   }
+   else
+   {
+      cerr << "File: " << hdrFile << "\nDoes not exists!" << endl;
+      usage();
+   }
+   cout << endl;
+   
+   return 0;
+   
+} // End of main...
+
diff --git a/test/src/util/CMakeLists.txt b/test/src/util/CMakeLists.txt
new file mode 100644
index 0000000..7fb3834
--- /dev/null
+++ b/test/src/util/CMakeLists.txt
@@ -0,0 +1,7 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+OSSIM_SETUP_APPLICATION(ossim-chipper-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-chipper-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-info-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-info-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-viewshed-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-viewshed-test.cpp)
+OSSIM_SETUP_APPLICATION(ossim-tools-test INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-tools-test.cpp)
+
diff --git a/test/src/util/ossim-chipper-test.cpp b/test/src/util/ossim-chipper-test.cpp
new file mode 100644
index 0000000..35aba4e
--- /dev/null
+++ b/test/src/util/ossim-chipper-test.cpp
@@ -0,0 +1,122 @@
+//---
+// File: ossim-chipper-test.cpp
+//
+// License: MIT
+//
+// Author:  David Burken
+// 
+// Description: Test application for ossimChipperUtil class.
+//---
+// $Id$
+
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimChipperUtil.h>
+
+#include <iostream>
+using namespace std;
+
+static void usage( const std::string& app )
+{
+   cout << app
+         << " <chipper_options> <output_file>"
+         << "\n\nWrites out a single image data raster buffer.\n"
+         << "\nSample chipper options file that can be cut and pasted in a "
+         << "\"chipper_options.kwl\" file for test.\n"
+         << "hist_op: auto-minmax\n"
+         << "image0.file: /data1/test/data/public/applanix/utm/17657707.tif\n"
+         << "image0.entry: 0\n"
+         << "operation: chip\n"
+         << "thumbnail_resolution: 256\n"
+         << "three_band_out: true\n"
+         << "output_radiometry: U8\n"
+         << "pad_thumbnail: true\n"
+         << endl;
+}
+
+int main(int argc, char* argv[])
+{
+   int status = -1;
+
+   if (argc != 3 )
+   {
+      usage( std::string( argv[0] ) );
+      return 0;
+   }
+
+   ossimFilename chipperOptions = argv[1];
+   ossimFilename outputFile = argv[2];
+   ostringstream exceptionMsg;
+
+   if ( !chipperOptions.exists() )
+   {
+      cerr << "Input options file <"<<chipperOptions<<"> does not exists!" << endl;
+      return -1;
+   }
+
+   // Timer for elapsed time:
+   ossimTimer::instance()->setStartTick();
+
+   try
+   {
+      ossimInit::instance()->initialize(argc, argv);
+
+      ossimFilename chipperOptions = argv[1];
+      ossimFilename outputFile = argv[2];
+      cout << "chipper options file: " << chipperOptions
+           << "output file:          " << outputFile << "\n";
+
+      ossimKeywordlist kwl;
+      if ( !kwl.addFile( chipperOptions ) )
+      {
+         exceptionMsg<<"ERROR: Could not open <"<<chipperOptions<<"> as keyword list." << ends;
+         throw (ossimException(exceptionMsg.str()));
+      }
+
+      cout << "chipper input options:\n" << kwl << endl;
+
+      ossimRefPtr<ossimChipperUtil> chipper = new ossimChipperUtil();
+      chipper->initialize( kwl);
+
+      ossimRefPtr<ossimImageData> chip = chipper->getChip( );
+      if ( !chip.valid() )
+      {
+         exceptionMsg<<"ERROR: NULL chip returned from chipper->getChip()." << ends;
+         throw (ossimException(exceptionMsg.str()));
+      }
+
+      status = chip->getDataObjectStatus();
+      if ( status == (int)OSSIM_NULL )
+      {
+         exceptionMsg<<"ERROR: returned chip status OSSIM_NULL!" << ends;
+         throw (ossimException(exceptionMsg.str()));
+      }
+
+      if ( !chip->write( outputFile ) )
+      {
+         exceptionMsg<<"ERROR: Could not write <"<<outputFile<<">." << ends;
+         throw (ossimException(exceptionMsg.str()));
+      }
+      cout << "Wrote file: " << outputFile << endl;
+      status = 0;
+   }
+   catch( const ossimException& e )
+   {
+      cerr << "Caught exception: " << e.what() << endl;
+   }
+   catch( ... )
+   {
+      cerr << "Caught unknown exception!" << endl;
+   }
+
+   cout << "Elapsed time in seconds: " << std::setiosflags(ios::fixed) << std::setprecision(3)
+   << ossimTimer::instance()->time_s() << endl;
+
+   return status;
+
+} // End of main(...)
diff --git a/test/src/util/ossim-info-test.cpp b/test/src/util/ossim-info-test.cpp
new file mode 100644
index 0000000..61c2dc4
--- /dev/null
+++ b/test/src/util/ossim-info-test.cpp
@@ -0,0 +1,95 @@
+//----------------------------------------------------------------------------
+//
+// License:  LGPL
+// 
+// See LICENSE.txt file in the top level directory for more details.
+//
+// Author:  David Burken
+//
+// Description: Test application for ossimInfo class.
+// 
+//----------------------------------------------------------------------------
+// $Id: ossim-info-test.cpp 22197 2013-03-12 02:00:55Z dburken $
+
+#include <ossim/base/ossimArgumentParser.h>
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimNotify.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/support_data/ossimInfoBase.h>
+#include <ossim/support_data/ossimInfoFactoryRegistry.h>
+#include <ossim/util/ossimInfo.h>
+
+#include <iostream>
+#include <memory>
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+   //---
+   // Get the arg count so we can tell if an arg was consumed by
+   // ossimInit::instance()->initialize
+   //---
+   // int originalArgCount = argc;
+
+   ossimArgumentParser ap(&argc, argv);
+
+   // Initialize ossim stuff, factories, plugin, etc.
+   ossimInit::instance()->initialize(ap);
+
+   if ( ap.argc() == 2 )
+   {
+      try
+      {
+         // Test the ossimInfo::getImageInfo method.
+         ossimRefPtr<ossimInfo> oi = new ossimInfo;
+         ossimFilename file(argv[1]);
+
+         ossimKeywordlist kwl;
+         oi->getImageInfo(file,
+                          true,  // dump
+                          false, // dno
+                          true,  // image geom
+                          true,  // image info
+                          true,  // metadata
+                          true,  // palette
+                          kwl);
+         cout << kwl << endl;
+
+         cout << "\n\ntest info dump to a keyword list:\n";
+         std::shared_ptr<ossimInfoBase> info = ossimInfoFactoryRegistry::instance()->create(file);
+         if (info)
+         {
+            info->setProcessOverviewFlag(false);
+
+            ossimKeywordlist kwl;
+            // if ( info->getKeywordlist( kwl, 9 ) )
+            if ( info->getKeywordlist( kwl ) )
+            {
+               cout << kwl << endl;
+            }
+            info = 0;
+         }
+         else
+         {
+            ossimNotify(ossimNotifyLevel_INFO)
+               << "No dump available for:  " << file.c_str() << std::endl;
+         } 
+      }
+      catch (const ossimException& e)
+      {
+         ossimNotify(ossimNotifyLevel_WARN) << e.what() << std::endl;
+         return 1;
+      }
+      
+   }  // End: if ( ( ap.argc() == 2 ) ...
+   else
+   {
+      cout << argv[0] << " <image_file>\nTest ossimInfo class..." << endl;
+   }
+   
+   return 0;
+   
+} // End of main...
diff --git a/test/src/util/ossim-tools-test.cpp b/test/src/util/ossim-tools-test.cpp
new file mode 100644
index 0000000..dc16bc5
--- /dev/null
+++ b/test/src/util/ossim-tools-test.cpp
@@ -0,0 +1,88 @@
+//---
+// File: ossim-chipper-test.cpp
+//
+// License: MIT
+//
+// Author:  David Burken
+// 
+// Description: Test application for ossimChipperUtil class.
+//---
+// $Id$
+
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimChipProcTool.h>
+#include <ossim/util/ossimToolRegistry.h>
+#include <iostream>
+using namespace std;
+
+static void usage( const std::string& app )
+{
+   cout << app << " <TBD>" << endl;
+}
+
+int main(int argc, char* argv[])
+{
+   int status = -1;
+
+   // Timer for elapsed time:
+   ossimTimer::instance()->setStartTick();
+
+   try
+   {
+      ossimArgumentParser ap(&argc, argv);
+      ossimInit::instance()->initialize(ap);
+
+      ossimKeywordlist kwl;
+      kwl.add("observer", "48.433324 -113.7850077");
+      //kwl.add("aoi_map_rect", "-12684715.289296463,6168162.4345005825,-12649344.0544575,6205998.763501747");
+      kwl.add("visibility_radius", "1000");
+      //kwl.add("srs", "3857");
+      kwl.add("height_of_eye", "5");
+      kwl.add("lut_file", "/data/TEST/HLZ/N48W114/vs.lut");
+      kwl.add("lz_min_radius", "100");
+      kwl.add("roughness_threshold", "1.5");
+      kwl.add("slope_threshold", "7.0");
+      kwl.add("output_file", "test.tif");
+      kwl.add("elev_sources", "N48W114.hgt");
+
+      if (argc < 2)
+      {
+         cout<<"\nNeed tool name!"<<endl;
+         return 0;
+      }
+      string toolName = argv[1];
+      ossimRefPtr<ossimChipProcTool> chipProcUtil =
+            (ossimChipProcTool*) ossimToolRegistry::instance()->createTool(toolName);
+      if (chipProcUtil == 0)
+         cerr<<"OssimTools() Bad opeation requested: <"<<toolName<<">. Ignoring."<<endl;
+
+      chipProcUtil->initialize(kwl);
+
+      ossimDrect map_bbox (-12684715.289296463, 6168162.4345005825, -12649344.0544575, 6205998.763501747);
+      ossimDpt gsd (30, 30);
+      ossimRefPtr<ossimImageData> tile = chipProcUtil->getChip(map_bbox, gsd);
+      tile->write("debug_chip.ras");
+   }
+   catch( const ossimException& e )
+   {
+      cerr << "Caught exception: " << e.what() << endl;
+   }
+   catch( ... )
+   {
+      cerr << "Caught unknown exception!" << endl;
+   }
+   
+   cout << "Elapsed time in seconds: "
+        << std::setiosflags(ios::fixed)
+        << std::setprecision(3)
+        << ossimTimer::instance()->time_s() << "\n";
+   
+   return status;
+   
+} // End of main(...)
diff --git a/test/src/util/ossim-viewshed-test.cpp b/test/src/util/ossim-viewshed-test.cpp
new file mode 100644
index 0000000..7827799
--- /dev/null
+++ b/test/src/util/ossim-viewshed-test.cpp
@@ -0,0 +1,72 @@
+//---
+// File: ossim-chipper-test.cpp
+//
+// License: MIT
+//
+// Author:  David Burken
+// 
+// Description: Test application for ossimChipperUtil class.
+//---
+// $Id$
+
+#include <ossim/base/ossimException.h>
+#include <ossim/base/ossimFilename.h>
+#include <ossim/base/ossimKeywordlist.h>
+#include <ossim/base/ossimRefPtr.h>
+#include <ossim/base/ossimTimer.h>
+#include <ossim/imaging/ossimImageData.h>
+#include <ossim/init/ossimInit.h>
+#include <ossim/util/ossimViewshedTool.h>
+#include <iostream>
+using namespace std;
+
+static void usage( const std::string& app )
+{
+   cout << app << " <TBD>" << endl;
+}
+
+int main(int argc, char* argv[])
+{
+   int status = -1;
+
+   // Timer for elapsed time:
+   ossimTimer::instance()->setStartTick();
+
+   try
+   {
+      ossimArgumentParser ap(&argc, argv);
+      ossimInit::instance()->initialize(ap);
+
+      ossimKeywordlist kwl;
+      kwl.add("observer", "48.48 -113.79");
+      kwl.add("aoi_map_rect", "-12684715.289296463,6168162.4345005825,-12649344.0544575,6205998.763501747");
+      //kwl.add("visibility_radius", "8000");
+      kwl.add("srs", "3857");
+      kwl.add("height_of_eye", "5");
+      kwl.add("lut_file", "/data/TEST/HLZ/N48W114/vs.lut");
+
+      ossimRefPtr<ossimChipProcTool> viewshed = new ossimViewshedTool;
+      viewshed->initialize(kwl);
+
+      ossimDrect map_bbox (-12684715.289296463, 6168162.4345005825, -12649344.0544575, 6205998.763501747);
+      ossimDpt gsd (30, 30);
+      ossimRefPtr<ossimImageData> tile = viewshed->getChip(map_bbox, gsd);
+      tile->write("debug_chip.ras");
+   }
+   catch( const ossimException& e )
+   {
+      cerr << "Caught exception: " << e.what() << endl;
+   }
+   catch( ... )
+   {
+      cerr << "Caught unknown exception!" << endl;
+   }
+   
+   cout << "Elapsed time in seconds: "
+        << std::setiosflags(ios::fixed)
+        << std::setprecision(3)
+        << ossimTimer::instance()->time_s() << "\n";
+   
+   return status;
+   
+} // End of main(...)
diff --git a/test/src/vec/CMakeLists.txt b/test/src/vec/CMakeLists.txt
new file mode 100644
index 0000000..653877c
--- /dev/null
+++ b/test/src/vec/CMakeLists.txt
@@ -0,0 +1,3 @@
+# $Id: CMakeLists.txt 23496 2015-08-28 15:26:18Z okramer $
+
+OSSIM_SETUP_APPLICATION(ossim-dump-vpf-table INSTALL COMMAND_LINE COMPONENT_NAME ossim SOURCE_FILES ossim-dump-vpf-table.cpp)
diff --git a/ossim/src/test/ossim-dump-vpf-table.cpp b/test/src/vec/ossim-dump-vpf-table.cpp
similarity index 100%
rename from ossim/src/test/ossim-dump-vpf-table.cpp
rename to test/src/vec/ossim-dump-vpf-table.cpp

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/ossim.git



More information about the Pkg-grass-devel mailing list